From 1494a655e181693f631f770bceb0d68adef16853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= Date: Wed, 7 Dec 2022 17:09:34 +0000 Subject: [PATCH 01/18] Protocol: Mumbai --- docs/alpha/consensus.rst | 24 +- docs/alpha/liquidity_baking.rst | 4 +- docs/alpha/proof_of_stake.rst | 4 +- docs/alpha/randomness_generation.rst | 4 +- docs/index.rst | 10 + docs/mumbai/blocks_ops.rst | 229 + docs/mumbai/cli-commands.rst | 41 + docs/mumbai/consensus.rst | 505 ++ docs/mumbai/event.rst | 111 + docs/mumbai/global_constants.rst | 141 + docs/mumbai/glossary.rst | 231 + docs/mumbai/liquidity_baking.rst | 85 + docs/mumbai/michelson.rst | 3728 ++++++++++ docs/mumbai/plugins.rst | 244 + docs/mumbai/precheck.rst | 111 + docs/mumbai/proof_of_stake.rst | 170 + docs/mumbai/protocol.rst | 102 + docs/mumbai/protocol_overview.rst | 183 + docs/mumbai/randomness_generation.rst | 164 + docs/mumbai/sapling.rst | 534 ++ docs/mumbai/smart_rollups.rst | 1245 ++++ docs/mumbai/sr_boot_kernel.sh | 3 + docs/mumbai/timelock.rst | 138 + docs/mumbai/token_management.rst | 206 + docs/mumbai/transaction_rollups.rst | 902 +++ docs/mumbai/validation.rst | 401 + docs/mumbai/voting.rst | 343 + docs/protocols/016_mumbai.rst | 202 + .../final_protocol_versions | 3 +- src/proto_016_PtMumbai/bin_accuser/dune | 30 + .../bin_accuser/main_accuser_016_PtMumbai.ml | 38 + src/proto_016_PtMumbai/bin_baker/dune | 30 + .../bin_baker/main_baker_016_PtMumbai.ml | 47 + .../bin_sc_rollup_client/RPC.ml | 37 + .../bin_sc_rollup_client/commands.ml | 339 + .../bin_sc_rollup_client/commands.mli | 29 + .../bin_sc_rollup_client/configuration.ml | 112 + .../bin_sc_rollup_client/configuration.mli | 65 + .../bin_sc_rollup_client/dune | 35 + .../main_sc_rollup_client_016_PtMumbai.ml | 59 + .../bin_sc_rollup_node/RPC_server.ml | 592 ++ .../bin_sc_rollup_node/RPC_server.mli | 38 + .../bin_sc_rollup_node/arith_pvm.ml | 85 + .../bin_sc_rollup_node/batcher.ml | 420 ++ .../bin_sc_rollup_node/batcher.mli | 80 + .../bin_sc_rollup_node/batcher_events.ml | 86 + .../batcher_worker_types.ml | 90 + .../batcher_worker_types.mli | 46 + .../bin_sc_rollup_node/commitment.ml | 439 ++ .../bin_sc_rollup_node/commitment.mli | 64 + .../bin_sc_rollup_node/commitment_event.ml | 151 + .../bin_sc_rollup_node/commitment_event.mli | 67 + .../bin_sc_rollup_node/commitment_sig.ml | 91 + .../bin_sc_rollup_node/components.ml | 40 + .../bin_sc_rollup_node/configuration.ml | 637 ++ .../bin_sc_rollup_node/configuration.mli | 174 + .../bin_sc_rollup_node/context.ml | 203 + .../bin_sc_rollup_node/context.mli | 171 + .../bin_sc_rollup_node/daemon.ml | 485 ++ .../bin_sc_rollup_node/daemon_event.ml | 175 + .../bin_sc_rollup_node/daemon_event.mli | 62 + .../bin_sc_rollup_node/dal_pages_request.ml | 226 + .../bin_sc_rollup_node/dal_pages_request.mli | 76 + .../bin_sc_rollup_node/dal_slots_tracker.ml | 430 ++ .../bin_sc_rollup_node/dal_slots_tracker.mli | 80 + .../dal_slots_tracker_event.ml | 49 + .../bin_sc_rollup_node/dune | 66 + .../bin_sc_rollup_node/event.ml | 134 + .../bin_sc_rollup_node/event.mli | 66 + .../bin_sc_rollup_node/fuel.ml | 90 + .../bin_sc_rollup_node/fueled_pvm.ml | 387 + .../bin_sc_rollup_node/inbox.ml | 265 + .../bin_sc_rollup_node/inbox.mli | 82 + .../bin_sc_rollup_node/inbox_event.ml | 65 + .../bin_sc_rollup_node/inbox_event.mli | 35 + .../bin_sc_rollup_node/injector.ml | 175 + .../bin_sc_rollup_node/injector.mli | 29 + .../bin_sc_rollup_node/interpreter.ml | 280 + .../bin_sc_rollup_node/interpreter.mli | 63 + .../bin_sc_rollup_node/interpreter_event.ml | 75 + .../bin_sc_rollup_node/layer1.ml | 325 + .../bin_sc_rollup_node/layer1.mli | 102 + .../bin_sc_rollup_node/layer1_event.ml | 61 + .../bin_sc_rollup_node/layer1_event.mli | 35 + .../bin_sc_rollup_node/loser_mode.ml | 76 + .../bin_sc_rollup_node/loser_mode.mli | 46 + .../main_sc_rollup_node_016_PtMumbai.ml | 361 + .../bin_sc_rollup_node/metrics.ml | 75 + .../bin_sc_rollup_node/metrics.mli | 28 + .../bin_sc_rollup_node/node_context.ml | 123 + .../bin_sc_rollup_node/node_context.mli | 120 + .../bin_sc_rollup_node/outbox.ml | 68 + .../bin_sc_rollup_node/outbox.mli | 37 + .../bin_sc_rollup_node/pvm.ml | 88 + .../bin_sc_rollup_node/refutation_game.ml | 492 ++ .../bin_sc_rollup_node/refutation_game.mli | 36 + .../refutation_game_event.ml | 94 + .../bin_sc_rollup_node/reveals.ml | 120 + .../bin_sc_rollup_node/reveals.mli | 73 + .../sc_rollup_node_errors.ml | 249 + .../bin_sc_rollup_node/simulation.ml | 194 + .../bin_sc_rollup_node/simulation.mli | 78 + .../bin_sc_rollup_node/state.ml | 138 + .../bin_sc_rollup_node/state.mli | 58 + .../bin_sc_rollup_node/store.ml | 494 ++ .../bin_sc_rollup_node/store.mli | 239 + .../bin_sc_rollup_node/wasm_2_0_0_pvm.ml | 94 + .../bin_tx_rollup_client/commands.ml | 1002 +++ .../bin_tx_rollup_client/commands.mli | 30 + .../bin_tx_rollup_client/configuration.ml | 138 + .../bin_tx_rollup_client/configuration.mli | 67 + .../bin_tx_rollup_client/dune | 32 + .../main_tx_rollup_client_016_PtMumbai.ml | 135 + .../bin_tx_rollup_client/progress_bar.ml | 62 + .../bin_tx_rollup_client/progress_bar.mli | 29 + .../bin_tx_rollup_node/dune | 29 + .../main_tx_rollup_node_016_PtMumbai.ml | 487 ++ .../bin_wasm_repl/commands.ml | 418 ++ .../bin_wasm_repl/config.ml | 40 + src/proto_016_PtMumbai/bin_wasm_repl/dune | 39 + .../main_wasm_repl_016_PtMumbai.ml | 186 + .../bin_wasm_repl/messages.ml | 188 + .../bin_wasm_repl/repl_helpers.ml | 93 + .../lib_benchmark/README.md | 42 + .../lib_benchmark/autocomp.ml | 380 + src/proto_016_PtMumbai/lib_benchmark/dune | 34 + .../lib_benchmark/execution_context.ml | 95 + .../lib_benchmark/kernel.ml | 39 + .../lib_benchmark_type_inference/dune | 23 + .../lib_benchmark_type_inference/inference.ml | 1150 +++ .../inference.mli | 145 + .../lib_benchmark_type_inference/int_map.ml | 26 + .../mikhailsky.ml | 422 ++ .../mikhailsky.mli | 331 + .../mikhailsky_prim.ml | 572 ++ .../lib_benchmark_type_inference/monads.ml | 83 + .../lib_benchmark_type_inference/stores.ml | 85 + .../lib_benchmark_type_inference/test/dune | 26 + .../test/test_inference.ml | 615 ++ .../test/test_uf.ml | 63 + .../lib_benchmark_type_inference/type.ml | 200 + .../lib_benchmark_type_inference/type.mli | 111 + .../lib_benchmark_type_inference/uf.ml | 99 + .../lib_benchmark/micheline_sampler.ml | 110 + .../lib_benchmark/micheline_sampler.mli | 70 + .../lib_benchmark/michelson_mcmc_samplers.ml | 336 + .../lib_benchmark/michelson_mcmc_samplers.mli | 115 + .../lib_benchmark/michelson_samplers.ml | 831 +++ .../lib_benchmark/michelson_samplers.mli | 133 + .../lib_benchmark/michelson_samplers_base.ml | 139 + .../lib_benchmark/michelson_samplers_base.mli | 67 + .../lib_benchmark/mikhailsky_to_michelson.ml | 229 + src/proto_016_PtMumbai/lib_benchmark/rules.ml | 975 +++ .../lib_benchmark/sampling_helpers.ml | 41 + .../lib_benchmark/state_space.ml | 78 + .../lib_benchmark/test/dune | 38 + .../lib_benchmark/test/test_autocompletion.ml | 120 + .../lib_benchmark/test/test_distribution.ml | 152 + .../lib_benchmark/test/test_helpers.ml | 91 + .../lib_benchmark/test/test_sampling_code.ml | 96 + .../lib_benchmark/test/test_sampling_data.ml | 85 + .../lib_benchmark/type_helpers.ml | 88 + .../lib_benchmark/type_helpers.mli | 57 + .../lib_benchmarks_proto/cache_benchmarks.ml | 197 + .../carbonated_map_benchmarks.ml | 351 + .../lib_benchmarks_proto/dune | 45 + .../encodings_benchmarks.ml | 479 ++ .../lib_benchmarks_proto/gas_helpers.ml | 36 + .../global_constants_storage_benchmarks.ml | 723 ++ .../interpreter_benchmarks.ml | 3525 +++++++++ .../lib_benchmarks_proto/interpreter_model.ml | 563 ++ .../interpreter_workload.ml | 1680 +++++ .../michelson_commands.ml | 207 + .../michelson_generation.ml | 113 + .../michelson_generation.mli | 61 + .../lib_benchmarks_proto/michelson_types.ml | 131 + .../registration_helpers.ml | 39 + .../sapling_benchmarks.ml | 161 + .../lib_benchmarks_proto/sapling_commands.ml | 134 + .../sapling_generation.ml | 588 ++ .../sc_rollup_benchmarks.ml | 482 ++ .../script_repr_benchmarks.ml | 149 + .../script_typed_ir_size_benchmarks.ml | 301 + .../skip_list_benchmarks.ml | 188 + .../storage_benchmarks.ml | 244 + .../lib_benchmarks_proto/tags.ml | 32 + .../lib_benchmarks_proto/ticket_benchmarks.ml | 328 + .../translator_benchmarks.ml | 808 ++ .../lib_benchmarks_proto/translator_model.ml | 70 + .../translator_workload.ml | 188 + .../tx_rollup_benchmarks.ml | 642 ++ .../lib_client/annotated_manager_operation.ml | 123 + .../annotated_manager_operation.mli | 98 + .../lib_client/client_proto_args.ml | 1152 +++ .../lib_client/client_proto_args.mli | 294 + .../lib_client/client_proto_context.ml | 1685 +++++ .../lib_client/client_proto_context.mli | 1109 +++ .../lib_client/client_proto_contracts.ml | 206 + .../lib_client/client_proto_contracts.mli | 96 + .../lib_client/client_proto_fa12.ml | 986 +++ .../lib_client/client_proto_fa12.mli | 162 + .../lib_client/client_proto_multisig.ml | 1244 ++++ .../lib_client/client_proto_multisig.mli | 152 + .../lib_client/client_proto_programs.ml | 390 + .../lib_client/client_proto_programs.mli | 236 + .../lib_client/client_proto_rollups.ml | 214 + .../lib_client/client_proto_rollups.mli | 38 + .../lib_client/client_proto_utils.ml | 59 + .../lib_client/client_proto_utils.mli | 40 + src/proto_016_PtMumbai/lib_client/dune | 32 + .../lib_client/injection.ml | 1532 ++++ .../lib_client/injection.mli | 130 + src/proto_016_PtMumbai/lib_client/light.ml | 37 + src/proto_016_PtMumbai/lib_client/limit.ml | 84 + src/proto_016_PtMumbai/lib_client/limit.mli | 49 + .../lib_client/managed_contract.ml | 339 + .../lib_client/managed_contract.mli | 135 + .../lib_client/michelson_v1_emacs.ml | 230 + .../lib_client/michelson_v1_emacs.mli | 39 + .../lib_client/michelson_v1_entrypoints.ml | 250 + .../lib_client/michelson_v1_entrypoints.mli | 110 + .../lib_client/michelson_v1_error_reporter.ml | 802 ++ .../michelson_v1_error_reporter.mli | 40 + .../lib_client/michelson_v1_helpers.ml | 60 + .../lib_client/michelson_v1_macros.ml | 1518 ++++ .../lib_client/michelson_v1_macros.mli | 86 + .../lib_client/michelson_v1_parser.ml | 103 + .../lib_client/michelson_v1_parser.mli | 55 + .../lib_client/michelson_v1_printer.ml | 231 + .../lib_client/michelson_v1_printer.mli | 63 + src/proto_016_PtMumbai/lib_client/mockup.ml | 601 ++ .../lib_client/operation_result.ml | 1190 +++ .../lib_client/operation_result.mli | 37 + .../lib_client/protocol_client_context.ml | 260 + src/proto_016_PtMumbai/lib_client/proxy.ml | 174 + src/proto_016_PtMumbai/lib_client/test/dune | 47 + .../test/test_client_proto_context.ml | 68 + .../test/test_client_proto_contracts.ml | 97 + .../test/test_michelson_v1_macros.ml | 1347 ++++ .../lib_client/test/test_proxy.ml | 88 + .../alpha_commands_registration.ml | 38 + .../client_proto_context_commands.ml | 3788 ++++++++++ .../client_proto_contracts_commands.ml | 98 + .../client_proto_fa12_commands.ml | 698 ++ .../client_proto_mockup_commands.ml | 82 + .../client_proto_mockup_commands.mli | 26 + .../client_proto_multisig_commands.ml | 1091 +++ .../client_proto_multisig_commands.mli | 26 + .../client_proto_programs_commands.ml | 1160 +++ .../client_proto_programs_commands.mli | 26 + .../client_proto_stresstest_commands.ml | 1985 +++++ .../client_proto_stresstest_commands.mli | 29 + .../client_proto_stresstest_contracts.ml | 263 + .../client_proto_stresstest_contracts.mli | 88 + .../client_proto_utils_commands.ml | 184 + .../client_proto_utils_commands.mli | 26 + .../lib_client_commands/dune | 72 + .../client_sapling_commands.ml | 751 ++ .../client_sapling_commands.mli | 23 + .../lib_client_sapling/context.ml | 520 ++ .../lib_client_sapling/context.mli | 147 + .../lib_client_sapling/dune | 29 + .../lib_client_sapling/wallet.ml | 100 + .../lib_client_sapling/wallet.mli | 66 + src/proto_016_PtMumbai/lib_dal/RPC.ml | 183 + .../lib_dal/dac_external_message_manager.ml | 114 + src/proto_016_PtMumbai/lib_dal/dac_manager.ml | 30 + .../lib_dal/dac_pages_encoding.ml | 475 ++ .../lib_dal/dac_preimage_data_manager.ml | 61 + .../lib_dal/dac_signature_manager.ml | 180 + .../lib_dal/dal_plugin_registration.ml | 78 + .../lib_dal/dal_slot_frame_encoding.ml | 257 + .../lib_dal/dal_slot_frame_encoding.mli | 182 + src/proto_016_PtMumbai/lib_dal/dune | 30 + src/proto_016_PtMumbai/lib_dal/test/dune | 25 + src/proto_016_PtMumbai/lib_dal/test/main.ml | 56 + .../lib_dal/test/test_dac_pages_encoding.ml | 623 ++ .../test/test_dal_slot_frame_encoding.ml | 413 ++ .../lib_delegate/abstract_context_index.ml | 37 + .../lib_delegate/abstract_context_index.mli | 33 + .../lib_delegate/baking_actions.ml | 636 ++ .../lib_delegate/baking_actions.mli | 125 + .../lib_delegate/baking_cache.ml | 85 + .../lib_delegate/baking_commands.ml | 416 ++ .../lib_delegate/baking_commands.mli | 33 + .../baking_commands_registration.ml | 29 + .../lib_delegate/baking_configuration.ml | 317 + .../lib_delegate/baking_configuration.mli | 126 + .../lib_delegate/baking_errors.ml | 65 + .../lib_delegate/baking_events.ml | 932 +++ .../lib_delegate/baking_files.ml | 37 + .../lib_delegate/baking_files.mli | 33 + .../lib_delegate/baking_highwatermarks.ml | 233 + .../lib_delegate/baking_highwatermarks.mli | 91 + .../lib_delegate/baking_lib.ml | 543 ++ .../lib_delegate/baking_lib.mli | 65 + .../lib_delegate/baking_nonces.ml | 345 + .../lib_delegate/baking_nonces.mli | 125 + .../lib_delegate/baking_pow.ml | 85 + .../lib_delegate/baking_pow.mli | 40 + .../lib_delegate/baking_scheduling.ml | 804 ++ .../lib_delegate/baking_scheduling.mli | 85 + .../lib_delegate/baking_simulator.ml | 158 + .../lib_delegate/baking_simulator.mli | 61 + .../lib_delegate/baking_state.ml | 1044 +++ .../lib_delegate/baking_state.mli | 235 + .../lib_delegate/baking_vdf.ml | 357 + .../lib_delegate/baking_vdf.mli | 33 + .../lib_delegate/block_forge.ml | 396 + .../lib_delegate/block_forge.mli | 64 + .../lib_delegate/client_baking_blocks.ml | 233 + .../lib_delegate/client_baking_blocks.mli | 68 + .../client_baking_denunciation.ml | 488 ++ .../client_baking_denunciation.mli | 31 + .../lib_delegate/client_baking_scheduling.ml | 33 + .../lib_delegate/client_baking_scheduling.mli | 54 + .../lib_delegate/client_daemon.ml | 188 + .../lib_delegate/client_daemon.mli | 65 + .../lib_delegate/delegate_events.ml | 226 + src/proto_016_PtMumbai/lib_delegate/dune | 106 + .../liquidity_baking_vote_file.ml | 200 + .../lib_delegate/logging.ml | 167 + .../lib_delegate/logging.mli | 83 + .../lib_delegate/node_rpc.ml | 218 + .../lib_delegate/node_rpc.mli | 76 + .../lib_delegate/operation_pool.ml | 397 + .../lib_delegate/operation_pool.mli | 168 + .../lib_delegate/operation_selection.ml | 341 + .../lib_delegate/operation_selection.mli | 53 + .../lib_delegate/operation_worker.ml | 548 ++ .../lib_delegate/operation_worker.mli | 91 + .../lib_delegate/state_transitions.ml | 740 ++ .../lib_delegate/state_transitions.mli | 93 + .../lib_delegate/test/README.md | 127 + src/proto_016_PtMumbai/lib_delegate/test/dune | 32 + .../lib_delegate/test/main.ml | 10 + .../mockup_simulator/broadcast_services.ml | 85 + .../lib_delegate/test/mockup_simulator/dune | 32 + .../mockup_simulator/faked_client_context.ml | 174 + .../test/mockup_simulator/faked_daemon.ml | 29 + .../test/mockup_simulator/faked_services.ml | 316 + .../test/mockup_simulator/mockup_simulator.ml | 1414 ++++ .../mockup_simulator/mockup_simulator.mli | 257 + .../lib_delegate/test/tenderbrute/dune | 22 + .../lib_delegate/test/tenderbrute/lib/dune | 22 + .../test/tenderbrute/lib/tenderbrute.ml | 202 + .../test/tenderbrute/lib/tenderbrute.mli | 85 + .../test/tenderbrute/tenderbrute_main.ml | 169 + .../lib_delegate/test/test_scenario.ml | 1479 ++++ .../lib_injector/disk_persistence.ml | 395 + .../lib_injector/disk_persistence.mli | 149 + src/proto_016_PtMumbai/lib_injector/dune | 34 + .../lib_injector/injector_common.ml | 149 + .../lib_injector/injector_common.mli | 94 + .../lib_injector/injector_errors.ml | 88 + .../lib_injector/injector_errors.mli | 38 + .../lib_injector/injector_events.ml | 248 + .../lib_injector/injector_functor.ml | 1211 +++ .../lib_injector/injector_functor.mli | 29 + .../lib_injector/injector_sigs.ml | 250 + .../lib_injector/injector_tags.ml | 39 + .../lib_injector/injector_tags.mli | 35 + .../lib_injector/injector_worker_types.ml | 108 + .../lib_injector/injector_worker_types.mli | 47 + .../lib_injector/l1_operation.ml | 232 + .../lib_injector/l1_operation.mli | 48 + src/proto_016_PtMumbai/lib_layer2_utils/dune | 19 + .../lib_layer2_utils/layer1_services.ml | 129 + .../lib_layer2_utils/layer1_services.mli | 74 + .../lib_parameters/default_parameters.ml | 436 ++ .../lib_parameters/default_parameters.mli | 52 + src/proto_016_PtMumbai/lib_parameters/dune | 52 + src/proto_016_PtMumbai/lib_parameters/gen.ml | 62 + src/proto_016_PtMumbai/lib_plugin/RPC.ml | 3496 +++++++++ src/proto_016_PtMumbai/lib_plugin/dune | 34 + src/proto_016_PtMumbai/lib_plugin/mempool.ml | 1394 ++++ .../lib_plugin/metrics_plugin.ml | 64 + src/proto_016_PtMumbai/lib_plugin/plugin.ml | 32 + .../lib_plugin/plugin_errors.ml | 62 + .../lib_plugin/plugin_registerer.ml | 46 + .../lib_plugin/script_interpreter_logging.ml | 2317 ++++++ .../lib_plugin/script_interpreter_logging.mli | 43 + src/proto_016_PtMumbai/lib_plugin/test/dune | 44 + .../lib_plugin/test/generators.ml | 150 + .../lib_plugin/test/test_consensus_filter.ml | 448 ++ .../lib_plugin/test/test_filter_state.ml | 199 + .../lib_plugin/test/test_plugin.ml | 95 + .../lib_plugin/test/test_utils.ml | 118 + .../lib_plugin/view_helpers.ml | 293 + .../lib_protocol/TEZOS_PROTOCOL | 273 + .../lib_protocol/alpha_context.ml | 648 ++ .../lib_protocol/alpha_context.mli | 5347 ++++++++++++++ .../lib_protocol/alpha_services.ml | 313 + .../lib_protocol/alpha_services.mli | 95 + .../lib_protocol/amendment.ml | 221 + .../lib_protocol/amendment.mli | 133 + src/proto_016_PtMumbai/lib_protocol/apply.ml | 3036 ++++++++ src/proto_016_PtMumbai/lib_protocol/apply.mli | 166 + .../lib_protocol/apply_internal_results.ml | 723 ++ .../lib_protocol/apply_internal_results.mli | 157 + .../lib_protocol/apply_operation_result.ml | 54 + .../lib_protocol/apply_operation_result.mli | 43 + .../lib_protocol/apply_results.ml | 3170 ++++++++ .../lib_protocol/apply_results.mli | 368 + src/proto_016_PtMumbai/lib_protocol/baking.ml | 136 + .../lib_protocol/baking.mli | 64 + src/proto_016_PtMumbai/lib_protocol/bitset.ml | 67 + .../lib_protocol/bitset.mli | 75 + .../lib_protocol/blinded_public_key_hash.ml | 60 + .../lib_protocol/blinded_public_key_hash.mli | 45 + .../lib_protocol/block_header_repr.ml | 505 ++ .../lib_protocol/block_header_repr.mli | 134 + .../lib_protocol/block_payload_hash.ml | 42 + .../lib_protocol/block_payload_hash.mli | 28 + .../lib_protocol/block_payload_repr.ml | 42 + .../lib_protocol/block_payload_repr.mli | 41 + .../lib_protocol/bond_id_repr.ml | 129 + .../lib_protocol/bond_id_repr.mli | 44 + .../lib_protocol/bootstrap_storage.ml | 152 + .../lib_protocol/bootstrap_storage.mli | 43 + .../lib_protocol/bounded_history_repr.ml | 277 + .../lib_protocol/bounded_history_repr.mli | 118 + .../lib_protocol/cache_memory_helpers.ml | 185 + .../lib_protocol/cache_repr.ml | 320 + .../lib_protocol/cache_repr.mli | 244 + .../lib_protocol/carbonated_map.ml | 234 + .../lib_protocol/carbonated_map.mli | 167 + .../lib_protocol/carbonated_map_costs.ml | 70 + .../lib_protocol/carbonated_map_costs.mli | 47 + .../lib_protocol/commitment_repr.ml | 36 + .../lib_protocol/commitment_repr.mli | 34 + .../lib_protocol/commitment_storage.ml | 44 + .../lib_protocol/commitment_storage.mli | 45 + .../constants_parametric_previous_repr.ml | 516 ++ .../constants_parametric_previous_repr.mli | 194 + .../lib_protocol/constants_parametric_repr.ml | 498 ++ .../constants_parametric_repr.mli | 192 + .../lib_protocol/constants_repr.ml | 383 + .../lib_protocol/constants_repr.mli | 130 + .../lib_protocol/constants_services.ml | 70 + .../lib_protocol/constants_services.mli | 38 + .../lib_protocol/constants_storage.ml | 291 + .../lib_protocol/constants_storage.mli | 168 + .../lib_protocol/context_binary_proof.ml | 57 + .../lib_protocol/context_binary_proof.mli | 36 + .../lib_protocol/contract_delegate_storage.ml | 77 + .../contract_delegate_storage.mli | 82 + .../lib_protocol/contract_hash.ml | 51 + .../lib_protocol/contract_hash.mli | 32 + .../lib_protocol/contract_manager_storage.ml | 164 + .../lib_protocol/contract_manager_storage.mli | 85 + .../lib_protocol/contract_repr.ml | 233 + .../lib_protocol/contract_repr.mli | 97 + .../lib_protocol/contract_services.ml | 653 ++ .../lib_protocol/contract_services.mli | 148 + .../lib_protocol/contract_storage.ml | 792 ++ .../lib_protocol/contract_storage.mli | 337 + .../lib_protocol/contracts/cpmm.bin | 1 + .../lib_protocol/contracts/cpmm.mligo | 388 + .../lib_protocol/contracts/cpmm.tz | 929 +++ .../lib_protocol/contracts/lqt.bin | 1 + .../lib_protocol/contracts/lqt.mligo | 164 + .../lib_protocol/contracts/lqt.tz | 327 + .../lib_protocol/cycle_repr.ml | 85 + .../lib_protocol/cycle_repr.mli | 66 + .../lib_protocol/dal_apply.ml | 172 + .../lib_protocol/dal_apply.mli | 65 + .../lib_protocol/dal_attestation_repr.ml | 148 + .../lib_protocol/dal_attestation_repr.mli | 126 + .../lib_protocol/dal_errors_repr.ml | 313 + .../lib_protocol/dal_services.ml | 49 + .../lib_protocol/dal_services.mli | 33 + .../lib_protocol/dal_slot_repr.ml | 983 +++ .../lib_protocol/dal_slot_repr.mli | 357 + .../lib_protocol/dal_slot_storage.ml | 78 + .../lib_protocol/dal_slot_storage.mli | 72 + .../delegate_activation_storage.ml | 85 + .../delegate_activation_storage.mli | 55 + .../lib_protocol/delegate_consensus_key.ml | 236 + .../lib_protocol/delegate_consensus_key.mli | 97 + .../lib_protocol/delegate_cycles.ml | 282 + .../lib_protocol/delegate_cycles.mli | 51 + .../delegate_missed_endorsements_storage.ml | 214 + .../delegate_missed_endorsements_storage.mli | 99 + .../lib_protocol/delegate_sampler.ml | 239 + .../lib_protocol/delegate_sampler.mli | 70 + .../lib_protocol/delegate_services.ml | 549 ++ .../lib_protocol/delegate_services.mli | 146 + .../delegate_slashed_deposits_storage.ml | 123 + .../delegate_slashed_deposits_storage.mli | 77 + .../lib_protocol/delegate_storage.ml | 281 + .../lib_protocol/delegate_storage.mli | 152 + .../lib_protocol/dependent_bool.ml | 64 + .../lib_protocol/dependent_bool.mli | 65 + .../lib_protocol/destination_repr.ml | 163 + .../lib_protocol/destination_repr.mli | 64 + src/proto_016_PtMumbai/lib_protocol/dune | 1088 +++ .../lib_protocol/entrypoint_repr.ml | 241 + .../lib_protocol/entrypoint_repr.mli | 137 + .../lib_protocol/fees_storage.ml | 159 + .../lib_protocol/fees_storage.mli | 125 + .../lib_protocol/fitness_repr.ml | 289 + .../lib_protocol/fitness_repr.mli | 96 + .../lib_protocol/fixed_point_repr.ml | 94 + .../lib_protocol/fixed_point_repr.mli | 105 + .../lib_protocol/frozen_deposits_storage.ml | 58 + .../lib_protocol/frozen_deposits_storage.mli | 71 + .../lib_protocol/gas_comparable_input_size.ml | 141 + .../gas_comparable_input_size.mli | 73 + .../lib_protocol/gas_input_size.ml | 79 + .../lib_protocol/gas_input_size.mli | 55 + .../lib_protocol/gas_limit_repr.ml | 239 + .../lib_protocol/gas_limit_repr.mli | 130 + .../lib_protocol/gas_monad.ml | 120 + .../lib_protocol/gas_monad.mli | 119 + .../lib_protocol/global_constants_costs.ml | 47 + .../lib_protocol/global_constants_costs.mli | 34 + .../lib_protocol/global_constants_storage.ml | 269 + .../lib_protocol/global_constants_storage.mli | 150 + .../lib_protocol/indexable.ml | 199 + .../lib_protocol/indexable.mli | 197 + .../lib_protocol/init_storage.ml | 182 + .../lib_protocol/init_storage.mli | 57 + .../lib_protocol/lazy_storage_diff.ml | 433 ++ .../lib_protocol/lazy_storage_diff.mli | 71 + .../lib_protocol/lazy_storage_kind.ml | 318 + .../lib_protocol/lazy_storage_kind.mli | 178 + .../lib_protocol/legacy_script_patches.ml | 52 + .../lib_protocol/level_repr.ml | 354 + .../lib_protocol/level_repr.mli | 121 + .../lib_protocol/level_storage.ml | 127 + .../lib_protocol/level_storage.mli | 76 + .../lib_protocol/liquidity_baking_cpmm.ml | 13 + .../lib_protocol/liquidity_baking_lqt.ml | 13 + .../liquidity_baking_migration.ml | 244 + .../liquidity_baking_migration.mli | 33 + .../lib_protocol/liquidity_baking_repr.ml | 122 + .../lib_protocol/liquidity_baking_repr.mli | 64 + .../lib_protocol/liquidity_baking_storage.ml | 59 + .../lib_protocol/liquidity_baking_storage.mli | 43 + .../lib_protocol/local_gas_counter.ml | 95 + .../lib_protocol/local_gas_counter.mli | 68 + src/proto_016_PtMumbai/lib_protocol/main.ml | 425 ++ src/proto_016_PtMumbai/lib_protocol/main.mli | 59 + .../lib_protocol/manager_counter_repr.ml | 61 + .../lib_protocol/manager_counter_repr.mli | 69 + .../lib_protocol/manager_repr.ml | 52 + .../lib_protocol/manager_repr.mli | 38 + .../lib_protocol/mempool_validation.ml | 221 + .../lib_protocol/mempool_validation.mli | 185 + .../lib_protocol/merkle_list.ml | 338 + .../lib_protocol/merkle_list.mli | 115 + .../lib_protocol/michelson_v1_gas.ml | 974 +++ .../lib_protocol/michelson_v1_gas.mli | 537 ++ .../lib_protocol/michelson_v1_gas_costs.ml | 153 + .../michelson_v1_gas_costs_generated.ml | 1015 +++ .../lib_protocol/michelson_v1_primitives.ml | 836 +++ .../lib_protocol/michelson_v1_primitives.mli | 239 + .../lib_protocol/migration_repr.ml | 65 + .../lib_protocol/migration_repr.mli | 39 + src/proto_016_PtMumbai/lib_protocol/misc.ml | 91 + src/proto_016_PtMumbai/lib_protocol/misc.mli | 51 + .../lib_protocol/non_empty_string.ml | 34 + .../lib_protocol/non_empty_string.mli | 39 + .../lib_protocol/nonce_hash.ml | 45 + .../lib_protocol/nonce_hash.mli | 31 + .../lib_protocol/nonce_storage.ml | 139 + .../lib_protocol/nonce_storage.mli | 87 + .../lib_protocol/operation_repr.ml | 2874 ++++++++ .../lib_protocol/operation_repr.mli | 905 +++ .../lib_protocol/origination_nonce.ml | 43 + .../lib_protocol/origination_nonce.mli | 39 + .../lib_protocol/parameters_repr.ml | 252 + .../lib_protocol/parameters_repr.mli | 61 + .../lib_protocol/path_encoding.ml | 55 + .../lib_protocol/path_encoding.mli | 50 + .../lib_protocol/period_repr.ml | 164 + .../lib_protocol/period_repr.mli | 73 + .../lib_protocol/ratio_repr.ml | 38 + .../lib_protocol/ratio_repr.mli | 30 + .../lib_protocol/raw_context.ml | 1851 +++++ .../lib_protocol/raw_context.mli | 475 ++ .../lib_protocol/raw_context_intf.ml | 599 ++ .../lib_protocol/raw_level_repr.ml | 126 + .../lib_protocol/raw_level_repr.mli | 72 + .../lib_protocol/receipt_repr.ml | 439 ++ .../lib_protocol/receipt_repr.mli | 82 + .../lib_protocol/round_repr.ml | 485 ++ .../lib_protocol/round_repr.mli | 247 + .../lib_protocol/sampler.ml | 219 + .../lib_protocol/sampler.mli | 111 + .../lib_protocol/sapling_repr.ml | 205 + .../lib_protocol/sapling_services.ml | 103 + .../lib_protocol/sapling_storage.ml | 488 ++ .../lib_protocol/sapling_validator.ml | 108 + .../lib_protocol/saturation_repr.ml | 200 + .../lib_protocol/saturation_repr.mli | 234 + .../lib_protocol/sc_rollup_PVM_sig.ml | 557 ++ .../lib_protocol/sc_rollup_arith.ml | 1549 ++++ .../lib_protocol/sc_rollup_arith.mli | 186 + .../lib_protocol/sc_rollup_commitment_repr.ml | 141 + .../sc_rollup_commitment_repr.mli | 102 + .../sc_rollup_commitment_storage.ml | 144 + .../sc_rollup_commitment_storage.mli | 252 + .../lib_protocol/sc_rollup_costs.ml | 152 + .../lib_protocol/sc_rollup_costs.mli | 93 + .../sc_rollup_data_version_sig.ml | 49 + .../sc_rollup_dissection_chunk_repr.ml | 322 + .../sc_rollup_dissection_chunk_repr.mli | 108 + .../lib_protocol/sc_rollup_errors.ml | 533 ++ .../lib_protocol/sc_rollup_game_repr.ml | 987 +++ .../lib_protocol/sc_rollup_game_repr.mli | 430 ++ ...up_inbox_merkelized_payload_hashes_repr.ml | 248 + ...p_inbox_merkelized_payload_hashes_repr.mli | 125 + .../sc_rollup_inbox_message_repr.ml | 199 + .../sc_rollup_inbox_message_repr.mli | 102 + .../lib_protocol/sc_rollup_inbox_repr.ml | 863 +++ .../lib_protocol/sc_rollup_inbox_repr.mli | 377 + .../lib_protocol/sc_rollup_inbox_storage.ml | 217 + .../lib_protocol/sc_rollup_inbox_storage.mli | 75 + .../sc_rollup_management_protocol.ml | 170 + .../sc_rollup_management_protocol.mli | 113 + .../lib_protocol/sc_rollup_metadata_repr.ml | 54 + .../lib_protocol/sc_rollup_metadata_repr.mli | 42 + .../lib_protocol/sc_rollup_operations.ml | 548 ++ .../lib_protocol/sc_rollup_operations.mli | 103 + .../sc_rollup_outbox_message_repr.ml | 133 + .../sc_rollup_outbox_message_repr.mli | 69 + .../lib_protocol/sc_rollup_outbox_storage.ml | 82 + .../lib_protocol/sc_rollup_outbox_storage.mli | 45 + .../lib_protocol/sc_rollup_proof_repr.ml | 500 ++ .../lib_protocol/sc_rollup_proof_repr.mli | 267 + .../sc_rollup_refutation_storage.ml | 507 ++ .../sc_rollup_refutation_storage.mli | 200 + .../lib_protocol/sc_rollup_repr.ml | 172 + .../lib_protocol/sc_rollup_repr.mli | 105 + .../lib_protocol/sc_rollup_reveal_hash.ml | 103 + .../lib_protocol/sc_rollup_reveal_hash.mli | 85 + .../lib_protocol/sc_rollup_stake_storage.ml | 604 ++ .../lib_protocol/sc_rollup_stake_storage.mli | 259 + .../lib_protocol/sc_rollup_storage.ml | 162 + .../lib_protocol/sc_rollup_storage.mli | 78 + .../lib_protocol/sc_rollup_tick_repr.ml | 69 + .../lib_protocol/sc_rollup_tick_repr.mli | 74 + .../lib_protocol/sc_rollup_wasm.ml | 721 ++ .../lib_protocol/sc_rollup_wasm.mli | 137 + .../lib_protocol/sc_rollups.ml | 90 + .../lib_protocol/sc_rollups.mli | 75 + .../lib_protocol/script_big_map.ml | 92 + .../lib_protocol/script_big_map.mli | 83 + .../lib_protocol/script_bytes.ml | 204 + .../lib_protocol/script_bytes.mli | 103 + .../lib_protocol/script_cache.ml | 120 + .../lib_protocol/script_cache.mli | 86 + .../lib_protocol/script_comparable.ml | 93 + .../lib_protocol/script_comparable.mli | 34 + .../lib_protocol/script_expr_hash.ml | 44 + .../lib_protocol/script_expr_hash.mli | 31 + .../lib_protocol/script_int.ml | 126 + .../lib_protocol/script_int.mli | 169 + .../lib_protocol/script_interpreter.ml | 1909 +++++ .../lib_protocol/script_interpreter.mli | 253 + .../lib_protocol/script_interpreter_defs.ml | 1072 +++ .../lib_protocol/script_ir_annot.ml | 260 + .../lib_protocol/script_ir_annot.mli | 87 + .../lib_protocol/script_ir_translator.ml | 5528 ++++++++++++++ .../lib_protocol/script_ir_translator.mli | 464 ++ .../script_ir_translator_config.ml | 91 + .../lib_protocol/script_ir_unparser.ml | 777 ++ .../lib_protocol/script_ir_unparser.mli | 228 + .../lib_protocol/script_list.ml | 47 + .../lib_protocol/script_list.mli | 50 + .../lib_protocol/script_map.ml | 145 + .../lib_protocol/script_map.mli | 80 + .../lib_protocol/script_repr.ml | 352 + .../lib_protocol/script_repr.mli | 137 + .../lib_protocol/script_set.ml | 81 + .../lib_protocol/script_set.mli | 57 + .../lib_protocol/script_string.ml | 81 + .../lib_protocol/script_string.mli | 50 + .../lib_protocol/script_tc_context.ml | 65 + .../lib_protocol/script_tc_context.mli | 80 + .../lib_protocol/script_tc_errors.ml | 223 + .../script_tc_errors_registration.ml | 827 +++ .../script_tc_errors_registration.mli | 34 + .../lib_protocol/script_timestamp.ml | 66 + .../lib_protocol/script_timestamp.mli | 75 + .../lib_protocol/script_typed_ir.ml | 2342 ++++++ .../lib_protocol/script_typed_ir.mli | 1900 +++++ .../lib_protocol/script_typed_ir_size.ml | 717 ++ .../lib_protocol/script_typed_ir_size.mli | 85 + .../script_typed_ir_size_costs.ml | 34 + .../script_typed_ir_size_costs.mli | 28 + .../lib_protocol/seed_repr.ml | 270 + .../lib_protocol/seed_repr.mli | 135 + .../lib_protocol/seed_storage.ml | 259 + .../lib_protocol/seed_storage.mli | 100 + .../lib_protocol/services_registration.ml | 126 + .../lib_protocol/services_registration.mli | 145 + .../lib_protocol/skip_list_costs.ml | 47 + .../lib_protocol/skip_list_costs.mli | 40 + .../lib_protocol/skip_list_repr.ml | 586 ++ .../lib_protocol/skip_list_repr.mli | 226 + .../lib_protocol/slot_repr.ml | 110 + .../lib_protocol/slot_repr.mli | 121 + .../lib_protocol/stake_storage.ml | 211 + .../lib_protocol/stake_storage.mli | 140 + .../lib_protocol/state_hash.ml | 44 + .../lib_protocol/state_hash.mli | 30 + .../lib_protocol/storage.ml | 2095 ++++++ .../lib_protocol/storage.mli | 950 +++ .../lib_protocol/storage_costs.ml | 53 + .../lib_protocol/storage_costs.mli | 34 + .../lib_protocol/storage_description.ml | 380 + .../lib_protocol/storage_description.mli | 93 + .../lib_protocol/storage_functors.ml | 1273 ++++ .../lib_protocol/storage_functors.mli | 125 + .../lib_protocol/storage_sigs.ml | 500 ++ .../lib_protocol/test/README.md | 30 + .../lib_protocol/test/helpers/README.md | 3 + .../lib_protocol/test/helpers/account.ml | 154 + .../lib_protocol/test/helpers/account.mli | 100 + .../lib_protocol/test/helpers/assert.ml | 300 + .../test/helpers/big_map_helpers.ml | 74 + .../test/helpers/big_map_helpers.mli | 40 + .../lib_protocol/test/helpers/block.ml | 1034 +++ .../lib_protocol/test/helpers/block.mli | 310 + .../test/helpers/consensus_helpers.ml | 93 + .../lib_protocol/test/helpers/context.ml | 603 ++ .../lib_protocol/test/helpers/context.mli | 399 + .../test/helpers/contract_helpers.ml | 145 + .../lib_protocol/test/helpers/cpmm_logic.ml | 102 + .../lib_protocol/test/helpers/cpmm_repr.ml | 384 + .../lib_protocol/test/helpers/dal_helpers.ml | 254 + .../lib_protocol/test/helpers/dal_helpers.mli | 171 + .../test/helpers/dummy_zk_rollup.ml | 630 ++ .../lib_protocol/test/helpers/dune | 33 + .../test/helpers/error_monad_operators.ml | 36 + .../test/helpers/error_monad_operators.mli | 39 + .../lib_protocol/test/helpers/expr.ml | 50 + .../lib_protocol/test/helpers/expr_common.ml | 98 + .../lib_protocol/test/helpers/incremental.ml | 291 + .../lib_protocol/test/helpers/incremental.mli | 136 + .../helpers/liquidity_baking_generator.ml | 328 + .../helpers/liquidity_baking_generator.mli | 86 + .../test/helpers/liquidity_baking_machine.ml | 1362 ++++ .../test/helpers/liquidity_baking_machine.mli | 387 + .../test/helpers/lqt_fa12_repr.ml | 253 + .../test/helpers/merkle_list_helper.ml | 54 + .../lib_protocol/test/helpers/nonce.ml | 35 + .../lib_protocol/test/helpers/nonce.mli | 33 + .../lib_protocol/test/helpers/op.ml | 1106 +++ .../lib_protocol/test/helpers/op.mli | 822 +++ .../test/helpers/operation_generator.ml | 854 +++ .../lib_protocol/test/helpers/rewards.ml | 1641 +++++ .../test/helpers/sapling_helpers.ml | 476 ++ .../test/helpers/sc_rollup_helpers.ml | 664 ++ .../test/helpers/script_big_map.ml | 30 + .../test/helpers/script_big_map.mli | 44 + .../lib_protocol/test/helpers/script_map.ml | 36 + .../lib_protocol/test/helpers/script_map.mli | 31 + .../lib_protocol/test/helpers/script_set.ml | 31 + .../lib_protocol/test/helpers/script_set.mli | 32 + .../test/helpers/test_global_constants.ml | 321 + .../lib_protocol/test/helpers/test_tez.ml | 70 + .../lib_protocol/test/helpers/testable.ml | 38 + .../test/helpers/ticket_helpers.ml | 59 + .../lib_protocol/test/helpers/transfers.ml | 69 + .../lib_protocol/test/helpers/transfers.mli | 68 + .../test/helpers/tx_rollup_l2_helpers.ml | 200 + .../test/helpers/zk_rollup_l2_helpers.ml | 26 + .../test/integration/consensus/dune | 27 + .../test/integration/consensus/main.ml | 51 + .../test/integration/consensus/test_baking.ml | 460 ++ .../consensus/test_consensus_key.ml | 304 + .../consensus/test_deactivation.ml | 358 + .../integration/consensus/test_delegation.ml | 1616 ++++ .../consensus/test_double_baking.ml | 465 ++ .../consensus/test_double_endorsement.ml | 513 ++ .../consensus/test_double_preendorsement.ml | 403 + .../integration/consensus/test_endorsement.ml | 616 ++ .../consensus/test_frozen_deposits.ml | 718 ++ .../consensus/test_helpers_rpcs.ml | 65 + .../consensus/test_participation.ml | 205 + .../consensus/test_preendorsement.ml | 246 + .../consensus/test_preendorsement_functor.ml | 300 + .../test/integration/consensus/test_seed.ml | 645 ++ .../lib_protocol/test/integration/dune | 30 + .../lib_protocol/test/integration/gas/dune | 23 + .../lib_protocol/test/integration/gas/main.ml | 40 + .../test/integration/gas/test_gas_costs.ml | 286 + .../test/integration/gas/test_gas_levels.ml | 571 ++ .../lib_protocol/test/integration/main.ml | 45 + .../contracts/big_interpreter_stack.tz | 5 + .../integration/michelson/contracts/emit.tz | 16 + .../michelson/contracts/fail_rec.tz | 8 + .../forbidden_op_in_view_CREATE_CONTRACT.tz | 24 + .../contracts/forbidden_op_in_view_SELF.tz | 11 + .../forbidden_op_in_view_SET_DELEGATE.tz | 11 + .../forbidden_op_in_view_TRANSFER_TOKENS.tz | 12 + .../michelson/contracts/int-store.tz | 3 + .../integration/michelson/contracts/omega.tz | 9 + .../michelson/contracts/rec_fact.tz | 19 + .../michelson/contracts/rec_fact_apply.tz | 24 + .../contracts/rec_fact_apply_store.tz | 27 + .../michelson/contracts/rec_fact_store.tz | 22 + .../michelson/contracts/sapling_contract.tz | 73 + .../contracts/sapling_contract_double.tz | 27 + .../contracts/sapling_contract_drop.tz | 13 + .../contracts/sapling_contract_send.tz | 20 + .../sapling_contract_state_as_arg.tz | 18 + .../contracts/sapling_push_sapling_state.tz | 11 + .../contracts/sapling_use_existing_state.tz | 12 + .../michelson/contracts/temp_big_maps.tz | 81 + .../michelson/contracts/timelock.tz | 31 + .../test/integration/michelson/dune | 36 + .../test/integration/michelson/main.ml | 59 + .../integration/michelson/test_annotations.ml | 140 + .../michelson/test_block_time_instructions.ml | 80 + .../michelson/test_contract_event.ml | 135 + .../test_global_constants_storage.ml | 133 + .../michelson/test_interpretation.ml | 451 ++ .../michelson/test_lazy_storage_diff.ml | 140 + .../michelson/test_patched_contracts.ml | 214 + .../integration/michelson/test_sapling.ml | 1222 +++ .../michelson/test_script_cache.ml | 415 ++ .../michelson/test_script_typed_ir_size.ml | 1054 +++ .../michelson/test_temp_big_maps.ml | 101 + .../michelson/test_ticket_accounting.ml | 1474 ++++ .../michelson/test_ticket_balance.ml | 1764 +++++ .../michelson/test_ticket_balance_key.ml | 454 ++ .../test_ticket_lazy_storage_diff.ml | 696 ++ .../michelson/test_ticket_manager.ml | 806 ++ .../michelson/test_ticket_operations_diff.ml | 1372 ++++ .../michelson/test_ticket_scanner.ml | 695 ++ .../michelson/test_ticket_storage.ml | 273 + .../integration/michelson/test_timelock.ml | 239 + .../michelson/test_typechecking.ml | 930 +++ .../operations/contracts/tx_rollup_deposit.tz | 34 + .../tx_rollup_deposit_incorrect_entrypoint.tz | 34 + .../tx_rollup_deposit_incorrect_param.tz | 25 + .../contracts/tx_rollup_deposit_one_mutez.tz | 34 + .../tx_rollup_deposit_pair_string.tz | 36 + .../contracts/tx_rollup_deposit_string.tz | 34 + .../tx_rollup_parse_comparable_type.tz | 7 + .../contracts/tx_rollup_parse_data.tz | 7 + .../contracts/tx_rollup_parse_type.tz | 3 + .../contracts/tx_rollup_withdraw.tz | 3 + .../tx_rollup_withdraw_unit_tickets.tz | 3 + .../test/integration/operations/dune | 28 + .../test/integration/operations/main.ml | 51 + .../integration/operations/test_activation.ml | 575 ++ .../operations/test_combined_operations.ml | 411 ++ .../operations/test_failing_noop.ml | 51 + .../operations/test_origination.ml | 328 + .../operations/test_paid_storage_increase.ml | 247 + .../integration/operations/test_reveal.ml | 749 ++ .../integration/operations/test_sc_rollup.ml | 2783 +++++++ .../operations/test_sc_rollup_transfer.ml | 420 ++ .../integration/operations/test_transfer.ml | 896 +++ .../operations/test_transfer_ticket.ml | 343 + .../integration/operations/test_tx_rollup.ml | 5953 +++++++++++++++ .../integration/operations/test_voting.ml | 2107 ++++++ .../integration/operations/test_zk_rollup.ml | 1257 ++++ .../test/integration/test_constants.ml | 201 + .../test/integration/test_frozen_bonds.ml | 699 ++ .../test/integration/test_liquidity_baking.ml | 545 ++ .../test/integration/test_sc_rollup_wasm.ml | 230 + .../test/integration/test_storage.ml | 239 + .../integration/test_storage_functions.ml | 179 + .../test/integration/test_token.ml | 757 ++ .../test/integration/validate/dune | 28 + .../validate/generator_descriptors.ml | 925 +++ .../validate/generator_descriptors.mli | 161 + .../test/integration/validate/generators.ml | 281 + .../test/integration/validate/main.ml | 44 + .../validate/manager_operation_helpers.ml | 1658 +++++ .../validate/test_1m_restriction.ml | 229 + .../integration/validate/test_covalidity.ml | 159 + .../test_manager_operation_validation.ml | 624 ++ .../test/integration/validate/test_mempool.ml | 389 + .../test/integration/validate/test_sanity.ml | 176 + .../validate/test_validation_batch.ml | 624 ++ .../validate/valid_operations_generators.ml | 242 + .../integration/validate/validate_helpers.ml | 396 + .../test/integration/wasm_kernel/README.md | 56 + .../integration/wasm_kernel/computation.wasm | Bin 0 -> 9199 bytes .../test/integration/wasm_kernel/echo.wasm | Bin 0 -> 408 bytes .../test/integration/wasm_kernel/echo.wast | 106 + .../wasm_kernel/no_parse_bad_fingerprint.wasm | Bin 0 -> 9863 bytes .../wasm_kernel/no_parse_random.wasm | 1 + .../lib_protocol/test/pbt/dune | 179 + .../test/pbt/liquidity_baking_pbt.ml | 326 + .../test/pbt/saturation_fuzzing.ml | 201 + .../lib_protocol/test/pbt/test_bitset.ml | 125 + .../test/pbt/test_bytes_conversion.ml | 212 + .../test/pbt/test_carbonated_map.ml | 554 ++ .../test/pbt/test_compare_operations.ml | 101 + .../test/pbt/test_dal_slot_proof.ml | 216 + .../test/pbt/test_gas_properties.ml | 144 + .../lib_protocol/test/pbt/test_merkle_list.ml | 125 + .../test/pbt/test_operation_encoding.ml | 66 + .../test/pbt/test_refutation_game.ml | 1806 +++++ .../lib_protocol/test/pbt/test_sampler.ml | 270 + .../test/pbt/test_sc_rollup_encoding.ml | 291 + .../test/pbt/test_sc_rollup_tick_repr.ml | 109 + .../test/pbt/test_script_comparison.ml | 355 + .../lib_protocol/test/pbt/test_tez_repr.ml | 136 + .../test/pbt/test_tx_rollup_l2_encoding.ml | 300 + .../test/pbt/test_zk_rollup_encoding.ml | 229 + .../test/regression/contracts/accounts.tz | 67 + .../test/regression/contracts/append.tz | 10 + .../test/regression/contracts/auction.tz | 30 + .../regression/contracts/big_map_union.tz | 14 + .../regression/contracts/check_signature.tz | 11 + .../test/regression/contracts/comb-get.tz | 27 + .../test/regression/contracts/comb-set.tz | 13 + .../test/regression/contracts/concat.tz | 9 + .../test/regression/contracts/conditionals.tz | 12 + .../test/regression/contracts/cps_fact.tz | 28 + .../test/regression/contracts/dign.tz | 11 + .../test/regression/contracts/dipn.tz | 15 + .../test/regression/contracts/dugn.tz | 14 + .../test/regression/contracts/ediv.tz | 28 + .../test/regression/contracts/faucet.tz | 17 + .../contracts/get_and_update_map.tz | 7 + .../test/regression/contracts/if.tz | 7 + .../regression/contracts/insertion_sort.tz | 21 + .../regression/contracts/list_map_block.tz | 9 + .../test/regression/contracts/loop_left.tz | 16 + .../test/regression/contracts/opt_map.tz | 12 + .../test/regression/contracts/packunpack.tz | 13 + .../test/regression/contracts/pexec.tz | 9 + .../test/regression/contracts/rec_id_unit.tz | 9 + .../test/regression/contracts/reverse_loop.tz | 12 + .../test/regression/contracts/set_delegate.tz | 3 + .../test/regression/contracts/shifts.tz | 7 + .../regression/contracts/spawn_identities.tz | 28 + .../test/regression/contracts/ticket_join.tz | 10 + .../test/regression/contracts/ticket_split.tz | 21 + .../test/regression/contracts/view_fib.tz | 6 + .../regression/contracts/view_toplevel_lib.tz | 80 + .../test/regression/contracts/xor.tz | 7 + .../lib_protocol/test/regression/dune | 47 + .../expected/test_logging.ml/accounts.out | 166 + .../expected/test_logging.ml/append.out | 135 + .../expected/test_logging.ml/auction.out | 415 ++ .../test_logging.ml/big_map_union.out | 499 ++ .../test_logging.ml/check_signature.out | 230 + .../expected/test_logging.ml/comb-get.out | 234 + .../expected/test_logging.ml/comb-set.out | 61 + .../expected/test_logging.ml/concat.out | 69 + .../expected/test_logging.ml/conditionals.out | 66 + .../expected/test_logging.ml/cps_fact.out | 276 + .../expected/test_logging.ml/dign.out | 107 + .../expected/test_logging.ml/dipn.out | 165 + .../expected/test_logging.ml/dugn.out | 97 + .../expected/test_logging.ml/ediv.out | 272 + .../expected/test_logging.ml/faucet.out | 122 + .../test_logging.ml/get_and_update_map.out | 53 + .../expected/test_logging.ml/if.out | 38 + .../test_logging.ml/insertion_sort.out | 6541 +++++++++++++++++ .../test_logging.ml/list_map_block.out | 451 ++ .../expected/test_logging.ml/loop_left.out | 253 + .../expected/test_logging.ml/opt_map.out | 82 + .../expected/test_logging.ml/packunpack.out | 103 + .../expected/test_logging.ml/pexec.out | 83 + .../expected/test_logging.ml/rec_id_unit.out | 56 + .../expected/test_logging.ml/reverse_loop.out | 261 + .../expected/test_logging.ml/set_delegate.out | 51 + .../expected/test_logging.ml/shifts.out | 44 + .../test_logging.ml/spawn_identities.out | 4341 +++++++++++ .../expected/test_logging.ml/ticket_join.out | 42 + .../expected/test_logging.ml/ticket_split.out | 180 + .../expected/test_logging.ml/view_fib.out | 41 + .../test_logging.ml/view_toplevel_lib.out | 21 + .../expected/test_logging.ml/xor.out | 48 + .../test/regression/test_logging.ml | 401 + .../lib_protocol/test/unit/dune | 41 + .../lib_protocol/test/unit/main.ml | 90 + .../test/unit/test_alpha_context.ml | 287 + .../test/unit/test_bond_id_repr.ml | 147 + .../test/unit/test_consensus_key.ml | 240 + .../test/unit/test_contract_repr.ml | 120 + .../test/unit/test_dal_slot_proof.ml | 440 ++ .../test/unit/test_destination_repr.ml | 225 + .../lib_protocol/test/unit/test_fitness.ml | 158 + .../test/unit/test_fixed_point.ml | 175 + .../lib_protocol/test/unit/test_gas_monad.ml | 212 + .../unit/test_global_constants_storage.ml | 413 ++ .../test/unit/test_level_module.ml | 279 + .../test/unit/test_liquidity_baking_repr.ml | 260 + .../test/unit/test_local_contexts.ml | 134 + .../test/unit/test_merkle_list.ml | 258 + .../test/unit/test_operation_repr.ml | 188 + .../lib_protocol/test/unit/test_qty.ml | 160 + .../test/unit/test_raw_level_repr.ml | 176 + .../lib_protocol/test/unit/test_receipt.ml | 103 + .../lib_protocol/test/unit/test_round_repr.ml | 635 ++ .../lib_protocol/test/unit/test_saturation.ml | 236 + .../test/unit/test_sc_rollup_arith.ml | 548 ++ .../test/unit/test_sc_rollup_game.ml | 257 + .../test/unit/test_sc_rollup_inbox.ml | 587 ++ .../test/unit/test_sc_rollup_inbox_legacy.ml | 543 ++ .../test_sc_rollup_management_protocol.ml | 344 + .../test/unit/test_sc_rollup_storage.ml | 2745 +++++++ .../test/unit/test_sc_rollup_wasm.ml | 305 + .../test/unit/test_skip_list_repr.ml | 535 ++ .../lib_protocol/test/unit/test_tez_repr.ml | 202 + .../lib_protocol/test/unit/test_time_repr.ml | 45 + .../test/unit/test_tx_rollup_l2.ml | 575 ++ .../test/unit/test_tx_rollup_l2_apply.ml | 1796 +++++ .../test/unit/test_zk_rollup_storage.ml | 397 + .../lib_protocol/tez_repr.ml | 285 + .../lib_protocol/tez_repr.mli | 91 + .../lib_protocol/ticket_accounting.ml | 296 + .../lib_protocol/ticket_accounting.mli | 76 + .../lib_protocol/ticket_amount.ml | 48 + .../lib_protocol/ticket_amount.mli | 46 + .../lib_protocol/ticket_balance_key.ml | 88 + .../lib_protocol/ticket_balance_key.mli | 51 + .../lib_protocol/ticket_costs.ml | 64 + .../lib_protocol/ticket_costs.mli | 67 + .../lib_protocol/ticket_hash_builder.ml | 80 + .../lib_protocol/ticket_hash_builder.mli | 47 + .../lib_protocol/ticket_hash_repr.ml | 38 + .../lib_protocol/ticket_hash_repr.mli | 61 + .../lib_protocol/ticket_lazy_storage_diff.ml | 283 + .../lib_protocol/ticket_lazy_storage_diff.mli | 32 + .../lib_protocol/ticket_operations_diff.ml | 299 + .../lib_protocol/ticket_operations_diff.mli | 54 + .../lib_protocol/ticket_receipt.ml | 50 + .../lib_protocol/ticket_receipt.mli | 42 + .../lib_protocol/ticket_scanner.ml | 562 ++ .../lib_protocol/ticket_scanner.mli | 104 + .../lib_protocol/ticket_storage.ml | 121 + .../lib_protocol/ticket_storage.mli | 75 + .../lib_protocol/ticket_token.ml | 52 + .../lib_protocol/ticket_token.mli | 51 + .../lib_protocol/ticket_token_map.ml | 135 + .../lib_protocol/ticket_token_map.mli | 123 + .../lib_protocol/ticket_token_unparser.ml | 51 + .../lib_protocol/ticket_token_unparser.mli | 34 + .../lib_protocol/ticket_transfer.ml | 93 + .../lib_protocol/ticket_transfer.mli | 90 + .../lib_protocol/time_repr.ml | 73 + .../lib_protocol/time_repr.mli | 55 + src/proto_016_PtMumbai/lib_protocol/token.ml | 253 + src/proto_016_PtMumbai/lib_protocol/token.mli | 145 + .../lib_protocol/tx_rollup_commitment_repr.ml | 240 + .../tx_rollup_commitment_repr.mli | 101 + .../tx_rollup_commitment_storage.ml | 411 ++ .../tx_rollup_commitment_storage.mli | 201 + .../lib_protocol/tx_rollup_errors_repr.ml | 678 ++ .../lib_protocol/tx_rollup_gas.ml | 138 + .../lib_protocol/tx_rollup_gas.mli | 53 + .../lib_protocol/tx_rollup_hash_builder.ml | 68 + .../lib_protocol/tx_rollup_inbox_repr.ml | 129 + .../lib_protocol/tx_rollup_inbox_repr.mli | 85 + .../lib_protocol/tx_rollup_inbox_storage.ml | 228 + .../lib_protocol/tx_rollup_inbox_storage.mli | 112 + .../lib_protocol/tx_rollup_l2_address.ml | 53 + .../lib_protocol/tx_rollup_l2_address.mli | 73 + .../lib_protocol/tx_rollup_l2_apply.ml | 778 ++ .../lib_protocol/tx_rollup_l2_apply.mli | 226 + .../lib_protocol/tx_rollup_l2_batch.ml | 318 + .../lib_protocol/tx_rollup_l2_batch.mli | 256 + .../lib_protocol/tx_rollup_l2_context.ml | 374 + .../lib_protocol/tx_rollup_l2_context_hash.ml | 39 + .../tx_rollup_l2_context_hash.mli | 28 + .../lib_protocol/tx_rollup_l2_context_sig.ml | 374 + .../lib_protocol/tx_rollup_l2_proof.ml | 43 + .../lib_protocol/tx_rollup_l2_proof.mli | 47 + .../lib_protocol/tx_rollup_l2_qty.ml | 63 + .../lib_protocol/tx_rollup_l2_qty.mli | 82 + .../lib_protocol/tx_rollup_l2_storage_sig.ml | 89 + .../lib_protocol/tx_rollup_l2_verifier.ml | 197 + .../lib_protocol/tx_rollup_l2_verifier.mli | 73 + .../lib_protocol/tx_rollup_level_repr.ml | 30 + .../lib_protocol/tx_rollup_level_repr.mli | 62 + .../tx_rollup_message_hash_repr.ml | 49 + .../tx_rollup_message_hash_repr.mli | 40 + .../lib_protocol/tx_rollup_message_repr.ml | 113 + .../lib_protocol/tx_rollup_message_repr.mli | 66 + .../tx_rollup_message_result_hash_repr.ml | 57 + .../tx_rollup_message_result_hash_repr.mli | 39 + .../tx_rollup_message_result_repr.ml | 52 + .../tx_rollup_message_result_repr.mli | 47 + .../lib_protocol/tx_rollup_parameters.ml | 42 + .../lib_protocol/tx_rollup_parameters.mli | 51 + .../lib_protocol/tx_rollup_prefixes.ml | 92 + .../lib_protocol/tx_rollup_prefixes.mli | 59 + .../lib_protocol/tx_rollup_repr.ml | 162 + .../lib_protocol/tx_rollup_repr.mli | 69 + .../lib_protocol/tx_rollup_reveal_repr.ml | 46 + .../lib_protocol/tx_rollup_reveal_repr.mli | 36 + .../lib_protocol/tx_rollup_reveal_storage.ml | 55 + .../lib_protocol/tx_rollup_reveal_storage.mli | 54 + .../lib_protocol/tx_rollup_services.ml | 94 + .../lib_protocol/tx_rollup_services.mli | 55 + .../lib_protocol/tx_rollup_state_repr.ml | 721 ++ .../lib_protocol/tx_rollup_state_repr.mli | 255 + .../lib_protocol/tx_rollup_state_storage.ml | 72 + .../lib_protocol/tx_rollup_state_storage.mli | 78 + .../lib_protocol/tx_rollup_storage.ml | 33 + .../lib_protocol/tx_rollup_storage.mli | 31 + .../tx_rollup_withdraw_list_hash_repr.ml | 54 + .../tx_rollup_withdraw_list_hash_repr.mli | 30 + .../lib_protocol/tx_rollup_withdraw_repr.ml | 44 + .../lib_protocol/tx_rollup_withdraw_repr.mli | 40 + .../lib_protocol/validate.ml | 3320 +++++++++ .../lib_protocol/validate.mli | 339 + .../lib_protocol/validate_errors.ml | 1351 ++++ .../lib_protocol/validate_errors.mli | 213 + .../lib_protocol/vote_repr.ml | 50 + .../lib_protocol/vote_repr.mli | 37 + .../lib_protocol/vote_storage.ml | 269 + .../lib_protocol/vote_storage.mli | 184 + .../lib_protocol/voting_period_repr.ml | 175 + .../lib_protocol/voting_period_repr.mli | 82 + .../lib_protocol/voting_period_storage.ml | 210 + .../lib_protocol/voting_period_storage.mli | 76 + .../lib_protocol/voting_services.ml | 147 + .../lib_protocol/voting_services.mli | 63 + .../lib_protocol/zk_rollup_account_repr.ml | 127 + .../lib_protocol/zk_rollup_account_repr.mli | 61 + .../lib_protocol/zk_rollup_apply.ml | 491 ++ .../lib_protocol/zk_rollup_apply.mli | 292 + .../zk_rollup_circuit_public_inputs_repr.ml | 73 + .../zk_rollup_circuit_public_inputs_repr.mli | 67 + .../lib_protocol/zk_rollup_errors.ml | 136 + .../lib_protocol/zk_rollup_operation_repr.ml | 78 + .../lib_protocol/zk_rollup_operation_repr.mli | 61 + .../lib_protocol/zk_rollup_parameters.ml | 50 + .../lib_protocol/zk_rollup_parameters.mli | 51 + .../lib_protocol/zk_rollup_repr.ml | 153 + .../lib_protocol/zk_rollup_repr.mli | 70 + .../lib_protocol/zk_rollup_scalar.ml | 37 + .../lib_protocol/zk_rollup_scalar.mli | 40 + .../lib_protocol/zk_rollup_state_repr.ml | 28 + .../lib_protocol/zk_rollup_state_repr.mli | 34 + .../lib_protocol/zk_rollup_storage.ml | 314 + .../lib_protocol/zk_rollup_storage.mli | 158 + .../lib_protocol/zk_rollup_ticket_repr.ml | 40 + .../lib_protocol/zk_rollup_ticket_repr.mli | 37 + .../lib_protocol/zk_rollup_update_repr.ml | 86 + .../lib_protocol/zk_rollup_update_repr.mli | 60 + src/proto_016_PtMumbai/lib_sc_rollup/dune | 24 + .../lib_sc_rollup/game_helpers.ml | 176 + .../lib_sc_rollup/game_helpers.mli | 70 + .../lib_sc_rollup/l2_message.ml | 72 + .../lib_sc_rollup/l2_message.mli | 48 + .../lib_sc_rollup/sc_rollup_services.ml | 662 ++ src/proto_016_PtMumbai/lib_tx_rollup/RPC.ml | 903 +++ src/proto_016_PtMumbai/lib_tx_rollup/RPC.mli | 119 + .../lib_tx_rollup/accuser.ml | 246 + .../lib_tx_rollup/accuser.mli | 46 + .../lib_tx_rollup/batcher.ml | 382 + .../lib_tx_rollup/batcher.mli | 68 + .../lib_tx_rollup/batcher_worker_types.ml | 104 + .../lib_tx_rollup/batcher_worker_types.mli | 48 + .../lib_tx_rollup/committer.ml | 48 + .../lib_tx_rollup/committer.mli | 39 + .../lib_tx_rollup/context.ml | 281 + .../lib_tx_rollup/context.mli | 170 + .../lib_tx_rollup/daemon.ml | 1046 +++ .../lib_tx_rollup/daemon.mli | 41 + .../lib_tx_rollup/debug_events.ml | 37 + .../lib_tx_rollup/dispatcher.ml | 119 + .../lib_tx_rollup/dispatcher.mli | 32 + src/proto_016_PtMumbai/lib_tx_rollup/dune | 51 + src/proto_016_PtMumbai/lib_tx_rollup/error.ml | 565 ++ .../lib_tx_rollup/error.mli | 136 + src/proto_016_PtMumbai/lib_tx_rollup/event.ml | 348 + .../lib_tx_rollup/fancy_l2block.ml | 345 + .../lib_tx_rollup/fancy_l2block.mli | 81 + src/proto_016_PtMumbai/lib_tx_rollup/inbox.ml | 128 + .../lib_tx_rollup/inbox.mli | 79 + .../lib_tx_rollup/injector.ml | 194 + .../lib_tx_rollup/injector.mli | 35 + .../lib_tx_rollup/interpreter.ml | 129 + .../lib_tx_rollup/interpreter.mli | 61 + .../lib_tx_rollup/l2_apply.ml | 26 + .../lib_tx_rollup/l2_transaction.ml | 72 + .../lib_tx_rollup/l2_transaction.mli | 53 + .../lib_tx_rollup/l2block.ml | 126 + .../lib_tx_rollup/l2block.mli | 95 + .../lib_tx_rollup/node_config.ml | 524 ++ .../lib_tx_rollup/node_config.mli | 113 + .../lib_tx_rollup/node_data.ml | 53 + .../lib_tx_rollup/prover_apply.ml | 50 + .../lib_tx_rollup/prover_apply.mli | 45 + src/proto_016_PtMumbai/lib_tx_rollup/state.ml | 392 + .../lib_tx_rollup/state.mli | 224 + .../lib_tx_rollup/stores.ml | 809 ++ .../lib_tx_rollup/stores.mli | 203 + .../lib_tx_rollup/ticket.ml | 44 + .../lib_tx_rollup/ticket.mli | 35 + src/proto_016_PtMumbai/parameters/dune | 4 + .../lib_benchmark/michelson_samplers.ml | 3 +- src/proto_alpha/lib_protocol/main.ml | 2 +- tests_python/contracts_016/attic/accounts.tz | 54 + tests_python/contracts_016/attic/add1.tz | 7 + tests_python/contracts_016/attic/add1_list.tz | 6 + .../contracts_016/attic/after_strategy.tz | 3 + tests_python/contracts_016/attic/always.tz | 4 + tests_python/contracts_016/attic/append.tz | 8 + tests_python/contracts_016/attic/at_least.tz | 6 + tests_python/contracts_016/attic/auction.tz | 8 + .../contracts_016/attic/bad_lockup.tz | 6 + .../contracts_016/attic/big_map_union.tz | 8 + .../contracts_016/attic/cadr_annotation.tz | 3 + tests_python/contracts_016/attic/concat.tz | 7 + .../contracts_016/attic/conditionals.tz | 9 + .../contracts_016/attic/cons_twice.tz | 9 + tests_python/contracts_016/attic/cps_fact.tz | 16 + .../contracts_016/attic/create_add1_lists.tz | 14 + .../contracts_016/attic/data_publisher.tz | 8 + tests_python/contracts_016/attic/dispatch.tz | 9 + tests_python/contracts_016/attic/empty.tz | 3 + .../contracts_016/attic/fail_amount.tz | 6 + tests_python/contracts_016/attic/faucet.tz | 7 + tests_python/contracts_016/attic/forward.tz | 150 + tests_python/contracts_016/attic/id.tz | 3 + .../contracts_016/attic/infinite_loop.tz | 3 + .../contracts_016/attic/insertion_sort.tz | 16 + .../contracts_016/attic/int_publisher.tz | 17 + .../contracts_016/attic/king_of_tez.tz | 19 + .../attic/list_of_transactions.tz | 8 + tests_python/contracts_016/attic/queue.tz | 24 + .../contracts_016/attic/reduce_map.tz | 16 + .../contracts_016/attic/reentrancy.tz | 7 + tests_python/contracts_016/attic/reservoir.tz | 25 + .../attic/scrutable_reservoir.tz | 67 + .../contracts_016/attic/spawn_identities.tz | 20 + .../entrypoints/big_map_entrypoints.tz | 31 + .../entrypoints/delegatable_target.tz | 79 + .../contracts_016/entrypoints/manager.tz | 31 + .../entrypoints/no_default_target.tz | 11 + .../entrypoints/no_entrypoint_target.tz | 11 + .../entrypoints/rooted_target.tz | 11 + .../entrypoints/simple_entrypoints.tz | 4 + .../contracts_016/ill_typed/big_dip.tz | 4 + .../contracts_016/ill_typed/big_drop.tz | 4 + .../contracts_016/ill_typed/chain_id_arity.tz | 3 + tests_python/contracts_016/ill_typed/comb0.tz | 3 + tests_python/contracts_016/ill_typed/comb1.tz | 3 + .../ill_typed/contract_annotation_default.tz | 11 + .../ill_typed/create_contract_rootname.tz | 15 + .../contracts_016/ill_typed/dip_failwith.tz | 4 + tests_python/contracts_016/ill_typed/dup0.tz | 3 + .../ill_typed/failwith_big_map.tz | 22 + .../ill_typed/invalid_self_entrypoint.tz | 10 + .../contracts_016/ill_typed/map_failwith.tz | 4 + .../ill_typed/missing_only_code_field.tz | 2 + .../ill_typed/missing_only_parameter_field.tz | 4 + .../ill_typed/missing_only_storage_field.tz | 4 + .../missing_parameter_and_storage_fields.tz | 3 + .../ill_typed/multiple_code_field.tz | 6 + .../ill_typed/multiple_parameter_field.tz | 6 + .../multiple_storage_and_code_fields.tz | 7 + .../ill_typed/multiple_storage_field.tz | 6 + .../contracts_016/ill_typed/never_literal.tz | 6 + .../contracts_016/ill_typed/pack_big_map.tz | 7 + .../contracts_016/ill_typed/pack_operation.tz | 20 + .../ill_typed/pack_sapling_state.tz | 13 + .../push_big_map_with_id_with_parens.tz | 10 + .../push_big_map_with_id_without_parens.tz | 11 + ...ng_build_empty_state_with_int_parameter.tz | 10 + .../ill_typed/set_update_non_comparable.tz | 9 + .../ill_typed/stack_bottom_undig2able.tz | 5 + .../ill_typed/stack_bottom_undigable.tz | 6 + .../ill_typed/stack_bottom_undip2able.tz | 6 + .../ill_typed/stack_bottom_undipable.tz | 5 + .../ill_typed/stack_bottom_undropable.tz | 5 + .../ill_typed/stack_bottom_undug2able.tz | 5 + .../ill_typed/stack_bottom_undugable.tz | 6 + .../ill_typed/stack_bottom_undup2able.tz | 5 + .../ill_typed/stack_bottom_unfailwithable.tz | 6 + .../ill_typed/stack_bottom_ungetable.tz | 6 + .../ill_typed/stack_bottom_unleftable.tz | 6 + .../ill_typed/stack_bottom_unpairable.tz | 6 + .../ill_typed/stack_bottom_unpopable.tz | 10 + .../stack_bottom_unpopable_in_lambda.tz | 10 + .../ill_typed/stack_bottom_unrightable.tz | 6 + .../contracts_016/ill_typed/ticket_apply.tz | 17 + .../contracts_016/ill_typed/ticket_dup.tz | 3 + .../ill_typed/ticket_in_ticket.tz | 17 + .../contracts_016/ill_typed/ticket_unpack.tz | 5 + .../contracts_016/ill_typed/uncomb0.tz | 3 + .../contracts_016/ill_typed/uncomb1.tz | 3 + .../ill_typed/unpack_sapling_state.tz | 12 + .../view_op_bad_name_invalid_char_set.tz | 3 + .../view_op_bad_name_invalid_type.tz | 3 + .../view_op_bad_name_non_printable_char.tz | 3 + .../ill_typed/view_op_bad_name_too_long.tz | 4 + .../ill_typed/view_op_bad_return_type.tz | 3 + .../ill_typed/view_op_dupable_type.tz | 3 + .../ill_typed/view_op_invalid_arity.tz | 3 + .../ill_typed/view_op_lazy_storage.tz | 8 + .../ill_typed/view_op_lazy_storage_type.tz | 8 + .../ill_typed/view_toplevel_bad_input_type.tz | 4 + ...view_toplevel_bad_name_invalid_char_set.tz | 5 + .../view_toplevel_bad_name_invalid_type.tz | 4 + ...ew_toplevel_bad_name_non_printable_char.tz | 4 + .../view_toplevel_bad_name_too_long.tz | 4 + .../view_toplevel_bad_return_type.tz | 4 + .../ill_typed/view_toplevel_bad_type.tz | 7 + .../view_toplevel_dupable_type_input.tz | 5 + .../view_toplevel_dupable_type_output.tz | 4 + .../view_toplevel_duplicated_name.tz | 5 + .../ill_typed/view_toplevel_invalid_arity.tz | 4 + .../view_toplevel_lazy_storage_input.tz | 4 + .../view_toplevel_lazy_storage_output.tz | 4 + .../contracts_016/legacy/create_account.tz | 29 + .../contracts_016/legacy/create_contract.tz | 18 + .../legacy/create_contract_flags.tz | 26 + .../legacy/create_contract_rootname.tz | 18 + .../contracts_016/legacy/originator.tz | 16 + .../contracts_016/legacy/steps_to_quota.tz | 12 + tests_python/contracts_016/macros/assert.tz | 3 + .../contracts_016/macros/assert_cmpeq.tz | 3 + .../contracts_016/macros/assert_cmpge.tz | 3 + .../contracts_016/macros/assert_cmpgt.tz | 3 + .../contracts_016/macros/assert_cmple.tz | 3 + .../contracts_016/macros/assert_cmplt.tz | 3 + .../contracts_016/macros/assert_cmpneq.tz | 3 + .../contracts_016/macros/assert_eq.tz | 3 + .../contracts_016/macros/assert_ge.tz | 3 + .../contracts_016/macros/assert_gt.tz | 3 + .../contracts_016/macros/assert_le.tz | 3 + .../contracts_016/macros/assert_lt.tz | 3 + .../contracts_016/macros/assert_neq.tz | 3 + .../contracts_016/macros/big_map_get_add.tz | 7 + .../contracts_016/macros/big_map_mem.tz | 5 + .../contracts_016/macros/build_list.tz | 6 + .../contracts_016/macros/carn_and_cdrn.tz | 26 + tests_python/contracts_016/macros/compare.tz | 9 + .../contracts_016/macros/compare_bytes.tz | 9 + tests_python/contracts_016/macros/fail.tz | 5 + .../contracts_016/macros/guestbook.tz | 10 + .../contracts_016/macros/macro_annotations.tz | 6 + .../contracts_016/macros/map_caddaadr.tz | 4 + .../contracts_016/macros/max_in_list.tz | 9 + tests_python/contracts_016/macros/min.tz | 11 + .../contracts_016/macros/pair_macro.tz | 6 + .../contracts_016/macros/set_caddaadr.tz | 5 + .../contracts_016/macros/take_my_money.tz | 9 + .../contracts_016/macros/unpair_macro.tz | 9 + .../mini_scenarios/add_clear_tickets.tz | 6 + .../mini_scenarios/authentication.tz | 30 + .../mini_scenarios/big_map_entrypoints.tz | 31 + .../mini_scenarios/big_map_magic.tz | 41 + .../mini_scenarios/big_map_read.tz | 9 + .../mini_scenarios/big_map_store.tz | 8 + .../mini_scenarios/big_map_write.tz | 10 + .../mini_scenarios/create_contract.tz | 33 + .../mini_scenarios/create_contract_simple.tz | 14 + .../mini_scenarios/default_account.tz | 9 + .../execution_order_appender.tz | 17 + .../mini_scenarios/execution_order_caller.tz | 17 + .../mini_scenarios/execution_order_storer.tz | 4 + .../mini_scenarios/fa12_reference.tz | 749 ++ .../mini_scenarios/generic_multisig.tz | 92 + .../contracts_016/mini_scenarios/groth16.tz | 74 + .../contracts_016/mini_scenarios/hardlimit.tz | 5 + .../mini_scenarios/legacy_multisig.tz | 78 + .../contracts_016/mini_scenarios/lockup.tz | 19 + .../mini_scenarios/lqt_fa12.mligo.tz | 328 + .../mini_scenarios/multiple_en2.tz | 77 + .../multiple_entrypoints_counter.tz | 29 + .../mini_scenarios/originate_contract.tz | 14 + .../mini_scenarios/parameterized_multisig.tz | 24 + .../receive_tickets_in_big_map.tz | 3 + .../contracts_016/mini_scenarios/replay.tz | 8 + .../mini_scenarios/reveal_signed_preimage.tz | 13 + .../mini_scenarios/self_address_receiver.tz | 12 + .../mini_scenarios/self_address_sender.tz | 17 + .../mini_scenarios/send_tickets_in_big_map.tz | 47 + .../mini_scenarios/ticket_builder_fungible.tz | 40 + .../ticket_builder_non_fungible.tz | 47 + .../mini_scenarios/ticket_wallet_fungible.tz | 103 + .../ticket_wallet_non_fungible.tz | 61 + .../mini_scenarios/vote_for_delegate.tz | 30 + .../mini_scenarios/weather_insurance.tz | 19 + .../contracts_016/mini_scenarios/xcat.tz | 48 + .../contracts_016/mini_scenarios/xcat_dapp.tz | 79 + .../non_regression/bad_annot_contract.tz | 6 + .../contracts_016/non_regression/bug_262.tz | 5 + .../contracts_016/non_regression/bug_843.tz | 10 + .../non_regression/pairk_annot.tz | 7 + tests_python/contracts_016/opcodes/abs.tz | 5 + tests_python/contracts_016/opcodes/add.tz | 25 + .../contracts_016/opcodes/add_bls12_381_fr.tz | 3 + .../contracts_016/opcodes/add_bls12_381_g1.tz | 3 + .../contracts_016/opcodes/add_bls12_381_g2.tz | 3 + .../opcodes/add_delta_timestamp.tz | 3 + .../opcodes/add_timestamp_delta.tz | 3 + tests_python/contracts_016/opcodes/address.tz | 3 + .../opcodes/amount_after_fib_view.tz | 24 + .../opcodes/amount_after_nonexistent_view.tz | 23 + .../opcodes/amount_after_view.tz | 26 + tests_python/contracts_016/opcodes/and.tz | 3 + .../contracts_016/opcodes/and_binary.tz | 27 + .../contracts_016/opcodes/and_bytes.tz | 15 + .../contracts_016/opcodes/and_logical_1.tz | 3 + tests_python/contracts_016/opcodes/balance.tz | 3 + .../opcodes/balance_after_fib_view.tz | 25 + .../opcodes/balance_after_nonexistent_view.tz | 22 + .../opcodes/balance_after_view.tz | 25 + .../contracts_016/opcodes/big_map_mem_nat.tz | 7 + .../opcodes/big_map_mem_string.tz | 7 + .../contracts_016/opcodes/big_map_to_self.tz | 22 + .../bls12_381_fr_push_bytes_not_padded.tz | 9 + .../opcodes/bls12_381_fr_push_nat.tz | 9 + .../opcodes/bls12_381_fr_to_int.tz | 8 + .../opcodes/bls12_381_fr_to_mutez.tz | 12 + .../opcodes/bls12_381_fr_z_int.tz | 8 + .../opcodes/bls12_381_fr_z_nat.tz | 8 + .../opcodes/bls12_381_z_fr_int.tz | 9 + .../opcodes/bls12_381_z_fr_nat.tz | 9 + tests_python/contracts_016/opcodes/bytes.tz | 11 + .../contracts_016/opcodes/bytes_of_int.tz | 25 + .../contracts_016/opcodes/bytes_of_nat.tz | 14 + tests_python/contracts_016/opcodes/car.tz | 3 + tests_python/contracts_016/opcodes/cdr.tz | 3 + .../contracts_016/opcodes/chain_id.tz | 3 + .../contracts_016/opcodes/chain_id_store.tz | 3 + .../contracts_016/opcodes/check_signature.tz | 10 + .../contracts_016/opcodes/comb-get.tz | 27 + .../contracts_016/opcodes/comb-literals.tz | 9 + .../contracts_016/opcodes/comb-set-2.tz | 10 + .../contracts_016/opcodes/comb-set.tz | 10 + tests_python/contracts_016/opcodes/comb.tz | 9 + tests_python/contracts_016/opcodes/compare.tz | 52 + .../contracts_016/opcodes/compare_big_type.tz | 20 + .../opcodes/compare_big_type2.tz | 22 + .../contracts_016/opcodes/comparisons.tz | 15 + .../contracts_016/opcodes/concat_hello.tz | 4 + .../opcodes/concat_hello_bytes.tz | 4 + .../contracts_016/opcodes/concat_list.tz | 5 + tests_python/contracts_016/opcodes/cons.tz | 3 + .../contracts_016/opcodes/contains_all.tz | 7 + .../contracts_016/opcodes/contract.tz | 11 + .../contracts_016/opcodes/create_contract.tz | 14 + .../opcodes/create_contract_rootname.tz | 15 + .../opcodes/create_contract_rootname_alt.tz | 14 + .../opcodes/create_contract_with_view.tz | 17 + .../contracts_016/opcodes/diff_timestamps.tz | 3 + tests_python/contracts_016/opcodes/dig_eq.tz | 14 + tests_python/contracts_016/opcodes/dign.tz | 3 + tests_python/contracts_016/opcodes/dip.tz | 8 + tests_python/contracts_016/opcodes/dipn.tz | 3 + tests_python/contracts_016/opcodes/dropn.tz | 3 + tests_python/contracts_016/opcodes/dugn.tz | 3 + tests_python/contracts_016/opcodes/dup-n.tz | 18 + tests_python/contracts_016/opcodes/ediv.tz | 13 + .../contracts_016/opcodes/ediv_mutez.tz | 12 + tests_python/contracts_016/opcodes/emit.tz | 16 + .../contracts_016/opcodes/empty_map.tz | 6 + .../contracts_016/opcodes/exec_concat.tz | 7 + tests_python/contracts_016/opcodes/first.tz | 3 + .../opcodes/get_and_update_big_map.tz | 9 + .../opcodes/get_and_update_map.tz | 9 + .../opcodes/get_big_map_value.tz | 6 + .../contracts_016/opcodes/get_map_value.tz | 3 + .../opcodes/hash_consistency_checker.tz | 3 + .../contracts_016/opcodes/hash_key.tz | 3 + .../contracts_016/opcodes/hash_string.tz | 3 + tests_python/contracts_016/opcodes/if.tz | 3 + tests_python/contracts_016/opcodes/if_some.tz | 3 + tests_python/contracts_016/opcodes/int.tz | 5 + .../contracts_016/opcodes/iter_fail.tz | 4 + tests_python/contracts_016/opcodes/keccak.tz | 8 + .../contracts_016/opcodes/left_right.tz | 3 + tests_python/contracts_016/opcodes/level.tz | 3 + .../contracts_016/opcodes/list_concat.tz | 3 + .../opcodes/list_concat_bytes.tz | 3 + tests_python/contracts_016/opcodes/list_id.tz | 3 + .../contracts_016/opcodes/list_id_map.tz | 3 + .../contracts_016/opcodes/list_iter.tz | 5 + .../contracts_016/opcodes/list_map_block.tz | 5 + .../contracts_016/opcodes/list_size.tz | 3 + .../contracts_016/opcodes/loop_failwith.tz | 4 + .../contracts_016/opcodes/loop_left.tz | 7 + .../opcodes/loop_left_failwith.tz | 4 + .../contracts_016/opcodes/lsl_bytes.tz | 19 + .../contracts_016/opcodes/lsr_bytes.tz | 23 + tests_python/contracts_016/opcodes/map_car.tz | 5 + tests_python/contracts_016/opcodes/map_id.tz | 3 + .../contracts_016/opcodes/map_iter.tz | 7 + tests_python/contracts_016/opcodes/map_map.tz | 8 + .../opcodes/map_map_sideeffect.tz | 12 + .../contracts_016/opcodes/map_mem_nat.tz | 7 + .../contracts_016/opcodes/map_mem_string.tz | 7 + .../contracts_016/opcodes/map_size.tz | 3 + .../opcodes/merge_comparable_pairs.tz | 14 + tests_python/contracts_016/opcodes/mul.tz | 48 + .../contracts_016/opcodes/mul_bls12_381_fr.tz | 3 + .../contracts_016/opcodes/mul_bls12_381_g1.tz | 3 + .../contracts_016/opcodes/mul_bls12_381_g2.tz | 3 + .../contracts_016/opcodes/mul_overflow.tz | 18 + tests_python/contracts_016/opcodes/munch.tz | 14 + .../opcodes/mutez_to_bls12_381_fr.tz | 14 + tests_python/contracts_016/opcodes/neg.tz | 8 + .../contracts_016/opcodes/neg_bls12_381_fr.tz | 3 + .../contracts_016/opcodes/neg_bls12_381_g1.tz | 3 + .../contracts_016/opcodes/neg_bls12_381_g2.tz | 3 + tests_python/contracts_016/opcodes/none.tz | 3 + tests_python/contracts_016/opcodes/noop.tz | 3 + tests_python/contracts_016/opcodes/not.tz | 3 + .../contracts_016/opcodes/not_binary.tz | 12 + .../contracts_016/opcodes/not_bytes.tz | 14 + tests_python/contracts_016/opcodes/or.tz | 3 + .../contracts_016/opcodes/or_binary.tz | 9 + .../contracts_016/opcodes/or_bytes.tz | 15 + .../opcodes/originate_big_map.tz | 3 + .../contracts_016/opcodes/packunpack.tz | 6 + .../contracts_016/opcodes/packunpack_rev.tz | 43 + .../opcodes/packunpack_rev_cty.tz | 31 + tests_python/contracts_016/opcodes/pair_id.tz | 3 + .../contracts_016/opcodes/pairing_check.tz | 3 + tests_python/contracts_016/opcodes/pexec.tz | 6 + tests_python/contracts_016/opcodes/pexec_2.tz | 11 + tests_python/contracts_016/opcodes/proxy.tz | 13 + tests_python/contracts_016/opcodes/ret_int.tz | 3 + tests_python/contracts_016/opcodes/reverse.tz | 5 + .../contracts_016/opcodes/reverse_loop.tz | 5 + .../opcodes/sapling_empty_state.tz | 3 + tests_python/contracts_016/opcodes/self.tz | 3 + .../contracts_016/opcodes/self_address.tz | 11 + .../opcodes/self_address_after_fib_view.tz | 25 + .../self_address_after_nonexistent_view.tz | 26 + .../opcodes/self_address_after_view.tz | 24 + .../opcodes/self_after_fib_view.tz | 27 + .../opcodes/self_after_nonexistent_view.tz | 28 + .../contracts_016/opcodes/self_after_view.tz | 26 + .../opcodes/self_with_default_entrypoint.tz | 19 + .../opcodes/self_with_entrypoint.tz | 26 + tests_python/contracts_016/opcodes/sender.tz | 8 + .../opcodes/sender_after_fib_view.tz | 26 + .../opcodes/sender_after_nonexistent_view.tz | 25 + .../opcodes/sender_after_view.tz | 25 + tests_python/contracts_016/opcodes/set_car.tz | 3 + tests_python/contracts_016/opcodes/set_cdr.tz | 3 + .../contracts_016/opcodes/set_delegate.tz | 9 + tests_python/contracts_016/opcodes/set_id.tz | 3 + .../contracts_016/opcodes/set_iter.tz | 3 + .../contracts_016/opcodes/set_member.tz | 3 + .../contracts_016/opcodes/set_size.tz | 3 + tests_python/contracts_016/opcodes/sets.tz | 40 + tests_python/contracts_016/opcodes/sha3.tz | 8 + tests_python/contracts_016/opcodes/shifts.tz | 18 + tests_python/contracts_016/opcodes/slice.tz | 5 + .../contracts_016/opcodes/slice_bytes.tz | 5 + tests_python/contracts_016/opcodes/slices.tz | 11 + tests_python/contracts_016/opcodes/source.tz | 10 + .../contracts_016/opcodes/split_bytes.tz | 16 + .../contracts_016/opcodes/split_string.tz | 16 + .../opcodes/store_bls12_381_fr.tz | 3 + .../opcodes/store_bls12_381_g1.tz | 3 + .../opcodes/store_bls12_381_g2.tz | 3 + .../contracts_016/opcodes/store_input.tz | 3 + .../contracts_016/opcodes/store_now.tz | 3 + tests_python/contracts_016/opcodes/str_id.tz | 3 + .../opcodes/sub_timestamp_delta.tz | 3 + tests_python/contracts_016/opcodes/subset.tz | 12 + .../contracts_016/opcodes/tez_add_sub.tz | 5 + .../contracts_016/opcodes/ticket_bad.tz | 5 + .../contracts_016/opcodes/ticket_big_store.tz | 3 + .../contracts_016/opcodes/ticket_join.tz | 7 + .../contracts_016/opcodes/ticket_read.tz | 8 + .../contracts_016/opcodes/ticket_split.tz | 11 + .../contracts_016/opcodes/ticket_store-2.tz | 3 + .../contracts_016/opcodes/ticket_store.tz | 3 + .../contracts_016/opcodes/ticketer-2.tz | 9 + .../contracts_016/opcodes/ticketer.tz | 11 + .../contracts_016/opcodes/transfer_amount.tz | 3 + .../contracts_016/opcodes/transfer_tokens.tz | 5 + tests_python/contracts_016/opcodes/uncomb.tz | 8 + tests_python/contracts_016/opcodes/unpair.tz | 71 + .../unpair_field_annotation_mismatch.tz | 10 + .../contracts_016/opcodes/update_big_map.tz | 6 + .../contracts_016/opcodes/utxo_read.tz | 9 + tests_python/contracts_016/opcodes/utxor.tz | 25 + .../contracts_016/opcodes/view_fib.tz | 9 + .../opcodes/view_mutual_recursion.tz | 11 + .../contracts_016/opcodes/view_op_add.tz | 3 + .../contracts_016/opcodes/view_op_constant.tz | 3 + .../contracts_016/opcodes/view_op_id.tz | 4 + .../opcodes/view_op_nonexistent_addr.tz | 5 + .../opcodes/view_op_nonexistent_func.tz | 3 + .../opcodes/view_op_test_step_contants.tz | 8 + ...iew_op_toplevel_inconsistent_input_type.tz | 3 + ...ew_op_toplevel_inconsistent_output_type.tz | 3 + .../contracts_016/opcodes/view_rec.tz | 12 + .../opcodes/view_toplevel_lib.tz | 67 + .../contracts_016/opcodes/voting_power.tz | 7 + tests_python/contracts_016/opcodes/xor.tz | 13 + .../contracts_016/opcodes/xor_bytes.tz | 15 + tests_python/tests_016/__init__.py | 0 ...est_macro_expansion[macros--assert.tz].out | 9 + ...cro_expansion[macros--assert_cmpeq.tz].out | 12 + ...cro_expansion[macros--assert_cmpge.tz].out | 12 + ...cro_expansion[macros--assert_cmpgt.tz].out | 12 + ...cro_expansion[macros--assert_cmple.tz].out | 12 + ...cro_expansion[macros--assert_cmplt.tz].out | 12 + ...ro_expansion[macros--assert_cmpneq.tz].out | 12 + ..._macro_expansion[macros--assert_eq.tz].out | 13 + ..._macro_expansion[macros--assert_ge.tz].out | 13 + ..._macro_expansion[macros--assert_gt.tz].out | 13 + ..._macro_expansion[macros--assert_le.tz].out | 13 + ..._macro_expansion[macros--assert_lt.tz].out | 13 + ...macro_expansion[macros--assert_neq.tz].out | 13 + ..._expansion[macros--big_map_get_add.tz].out | 23 + ...acro_expansion[macros--big_map_mem.tz].out | 14 + ...macro_expansion[macros--build_list.tz].out | 24 + ...ro_expansion[macros--carn_and_cdrn.tz].out | 29 + ...st_macro_expansion[macros--compare.tz].out | 22 + ...ro_expansion[macros--compare_bytes.tz].out | 22 + ...:test_macro_expansion[macros--fail.tz].out | 3 + ..._macro_expansion[macros--guestbook.tz].out | 18 + ...xpansion[macros--macro_annotations.tz].out | 13 + ...cro_expansion[macros--map_caddaadr.tz].out | 40 + ...acro_expansion[macros--max_in_list.tz].out | 17 + ...::test_macro_expansion[macros--min.tz].out | 13 + ...macro_expansion[macros--pair_macro.tz].out | 18 + ...cro_expansion[macros--set_caddaadr.tz].out | 33 + ...ro_expansion[macros--take_my_money.tz].out | 14 + ...cro_expansion[macros--unpair_macro.tz].out | 20 + ...ination::test_big_map_origination_diff.out | 29 + ...igination::test_big_map_origination_id.out | 27 + ...tion::test_big_map_origination_literal.out | 50 + ...rigination::test_big_map_transfer_diff.out | 23 + ...pOrigination::test_big_map_transfer_id.out | 22 + ...s.TestContractOnchainLevel::test_level.out | 123 + ...actOnchainOpcodes::test_contract_fails.out | 2 + ...tContractOnchainOpcodes::test_gen_keys.out | 2 + ...ontractOnchainOpcodes::test_init_proxy.out | 53 + ...s.TestContractOnchainOpcodes::test_now.out | 2 + ....TestContractOnchainOpcodes::test_self.out | 2 + ...estContractOnchainOpcodes::test_sender.out | 2 + ...tractOnchainOpcodes::test_set_delegate.out | 123 + ...TestContractOnchainOpcodes::test_slice.out | 87 + ...\"spsig1PPUFZucuAQybs5wsqs.818025e860.out" | 66 + ...0e55c43a9a857214d8761e67b75.2d6806d54e.out | 66 + ...0e55c43a9a857214d8761e67b75.378d03ae2d.out | 66 + ...0e55c43a9a857214d8761e67b75.57fdc7ad1c.out | 66 + ...0e55c43a9a857214d8761e67b75.c583c796bf.out | 66 + ...ef0e55c43a9a857214d8761e67b.7da5c9014e.out | 46 + ...estContractOnchainOpcodes::test_source.out | 119 + ...ntractOnchainOpcodes::test_split_bytes.out | 139 + ...tractOnchainOpcodes::test_split_string.out | 139 + ...ntractOnchainOpcodes::test_store_input.out | 185 + ...trace_origination[compare_big_type.tz].out | 93 + ...race_origination[compare_big_type2.tz].out | 97 + ...ctOnchainOpcodes::test_transfer_amount.out | 83 + ...ctOnchainOpcodes::test_transfer_tokens.out | 238 + ...(Some 4) {})-\"hello\"-(Pa.f6092ac5d6.out" | 35 + ...(Some 5) { Elt \"hello\" 4.0427752f13.out" | 35 + ...(Some 5) { Elt \"hello\" 4.0793dc66d5.out" | 36 + ...None { Elt \"1\" 1 ; .df114499b8.out" | 36 + ...None { Elt \"1\" 1 ; .f9bea98de9.out" | 36 + ...None { Elt \"hello\" 4 })-.1db12cd837.out" | 35 + ...None {})-\"hello\"-(Pair N.6fc7d0acf2.out" | 35 + ..." \"one\" ; Elt \"2\" \"tw.524c5459f8.out" | 46 + ...ello\" \"hi\" } None)-\"\".33eba403e7.out" | 45 + ...hello\" \"hi\" } None)-\"h.a5cd1005c9.out" | 45 + ...one\" ; Elt \"2\" \"two\" .6f3d35b151.out" | 36 + ...one\" ; Elt \"2\" \"two\" .76aeaa0706.out" | 48 + ...one\" ; Elt \"2\" \"two\" .7e7197f248.out" | 48 + ...one\" ; Elt \"2\" \"two\" .7ef2c415a7.out" | 49 + ...one\" ; Elt \"2\" \"two\" .b688cc94a7.out" | 49 + ...one\" ; Elt \"2\" \"two\" .c68db221ed.out" | 48 + ...erflow[mul_overflow.tz-Unit-Left Unit].out | 40 + ...rflow[mul_overflow.tz-Unit-Right Unit].out | 40 + ...ow[shifts.tz-None-(Left (Pair 1 257))].out | 36 + ...[shifts.tz-None-(Left (Pair 123 257))].out | 36 + ...w[shifts.tz-None-(Right (Pair 1 257))].out | 36 + ...shifts.tz-None-(Right (Pair 123 257))].out | 36 + ...TestContractOpcodes::test_balance[0.5].out | 21 + ...s.TestContractOpcodes::test_balance[0].out | 21 + ...estContractOpcodes::test_balance[1000].out | 21 + ...s.TestContractOpcodes::test_balance[1].out | 21 + ...stContractOpcodes::test_balance[1e-06].out | 21 + ...s.TestContractOpcodes::test_balance[5].out | 21 + ...Opcodes::test_balance[8000000000000.0].out | 21 + ... \"two\" }) )-(Right (Righ.7492e8cdea.out" | 90 + ... \"two\" }))-(Left Unit)-(.21b30dd90f.out" | 44 + ... \"two\" }))-(Right (Left .2873ef610c.out" | 39 + ... \"two\" }))-(Right (Left .8a6f480005.out" | 35 + ... \"two\" }))-(Right (Right.d336ca1903.out" | 83 + ...Pair \"foo\" \"bar\" } { P.7f2ee47600.out" | 135 + ...tContractOpcodes::test_check_signature.out | 241 + ...s::test_hash_consistency_michelson_cli.out | 51 + ...pcodes.TestContractOpcodes::test_level.out | 21 + ...bar\" 5 ; Elt \"foo\" 1 } .480b9afc63.out" | 155 + ...\"foo\" 1 } 1)-10-(Pair { .811573b5a7.out" | 105 + ...eeffect.tz-(Pair {} 0)-10-(Pair {} 0)].out | 55 + ..._opcodes.TestContractOpcodes::test_now.out | 21 + ...s.TestContractOpcodes::test_packunpack.out | 106 + ...roveTransferRemove::test_add_liquidity.out | 83 + ...ddApproveTransferRemove::test_approval.out | 41 + ...TransferRemove::test_approved_transfer.out | 41 + ...roveTransferRemove::test_call_approve1.out | 41 + ...roveTransferRemove::test_call_approve2.out | 41 + ...roveTransferRemove::test_call_approve3.out | 41 + ...TransferRemove::test_call_mint_or_burn.out | 40 + ...pproveTransferRemove::test_dex_storage.out | 7 + ...pproveTransferRemove::test_lqt_storage.out | 3 + ...eTransferRemove::test_remove_liquidity.out | 80 + ...stAddApproveTransferRemove::test_setup.out | 8 + ...pproveTransferRemove::test_tok_storage.out | 3 + ..._baking.TestTrades::test_add_liquidity.out | 83 + ...uidity_baking.TestTrades::test_buy_tok.out | 75 + ..._baking.TestTrades::test_call_approve1.out | 41 + ..._baking.TestTrades::test_call_approve2.out | 41 + ..._baking.TestTrades::test_call_approve3.out | 41 + ...ing.TestTrades::test_call_mint_or_burn.out | 40 + ...ty_baking.TestTrades::test_dex_storage.out | 7 + ...ty_baking.TestTrades::test_lqt_storage.out | 3 + ...idity_baking.TestTrades::test_sell_tok.out | 74 + ...iquidity_baking.TestTrades::test_setup.out | 8 + ...ty_baking.TestTrades::test_tok_storage.out | 3 + ...idity_baking.TestTrades::test_transfer.out | 43 + tests_python/tests_016/conftest.py | 121 + tests_python/tests_016/contract_paths.py | 20 + .../operations_files/empty_operations.json | 1 + tests_python/tests_016/protocol.py | 69 + tests_python/tests_016/test_accuser.py | 126 + .../test_baker_operations_cli_options.py | 376 + tests_python/tests_016/test_basic.py | 476 ++ tests_python/tests_016/test_binaries.py | 47 + tests_python/tests_016/test_client.py | 35 + .../tests_016/test_client_without_node.py | 450 ++ tests_python/tests_016/test_contract.py | 1146 +++ .../tests_016/test_contract_annotations.py | 108 + tests_python/tests_016/test_contract_baker.py | 55 + .../tests_016/test_contract_macros.py | 447 ++ .../test_contract_onchain_opcodes.py | 1325 ++++ .../tests_016/test_contract_opcodes.py | 500 ++ tests_python/tests_016/test_cors.py | 47 + tests_python/tests_016/test_forge_block.py | 46 + tests_python/tests_016/test_fork.py | 88 + .../tests_016/test_liquidity_baking.py | 279 + tests_python/tests_016/test_many_bakers.py | 47 + tests_python/tests_016/test_many_nodes.py | 71 + tests_python/tests_016/test_mempool.py | 66 + .../test_multinode_storage_reconstruction.py | 191 + .../tests_016/test_multiple_transfers.py | 133 + tests_python/tests_016/test_multisig.py | 620 ++ .../tests_016/test_nonce_seed_revelation.py | 134 + tests_python/tests_016/test_openapi.py | 71 + tests_python/tests_016/test_p2p.py | 147 + .../tests_016/test_proto_demo_counter.py | 88 + .../test_proto_demo_noops_manual_bake.py | 97 + tests_python/tests_016/test_sapling.py | 968 +++ .../tests_016/test_slice_fails_params.txt | 5 + .../tests_016/test_slice_success_params.txt | 1 + tests_python/tests_016/test_tls.py | 23 + tests_python/tests_016/test_voting.py | 256 + tests_python/tests_016/test_voting_full.py | 228 + tests_python/tools/constants.py | 5 + 1763 files changed, 352074 insertions(+), 21 deletions(-) create mode 100644 docs/mumbai/blocks_ops.rst create mode 100644 docs/mumbai/cli-commands.rst create mode 100644 docs/mumbai/consensus.rst create mode 100644 docs/mumbai/event.rst create mode 100644 docs/mumbai/global_constants.rst create mode 100644 docs/mumbai/glossary.rst create mode 100644 docs/mumbai/liquidity_baking.rst create mode 100644 docs/mumbai/michelson.rst create mode 100644 docs/mumbai/plugins.rst create mode 100644 docs/mumbai/precheck.rst create mode 100644 docs/mumbai/proof_of_stake.rst create mode 100644 docs/mumbai/protocol.rst create mode 100644 docs/mumbai/protocol_overview.rst create mode 100644 docs/mumbai/randomness_generation.rst create mode 100644 docs/mumbai/sapling.rst create mode 100644 docs/mumbai/smart_rollups.rst create mode 100644 docs/mumbai/sr_boot_kernel.sh create mode 100644 docs/mumbai/timelock.rst create mode 100644 docs/mumbai/token_management.rst create mode 100644 docs/mumbai/transaction_rollups.rst create mode 100644 docs/mumbai/validation.rst create mode 100644 docs/mumbai/voting.rst create mode 100644 docs/protocols/016_mumbai.rst create mode 100644 src/proto_016_PtMumbai/bin_accuser/dune create mode 100644 src/proto_016_PtMumbai/bin_accuser/main_accuser_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_baker/dune create mode 100644 src/proto_016_PtMumbai/bin_baker/main_baker_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/RPC.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/commands.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/commands.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/dune create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/arith_pvm.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_events.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_sig.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/components.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/context.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/context.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/daemon.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/dune create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/event.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/fuel.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/fueled_pvm.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/injector.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/injector.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/main_sc_rollup_node_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/pvm.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game_event.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/sc_rollup_node_errors.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/state.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/state.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/store.ml create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/store.mli create mode 100644 src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/commands.ml create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/commands.mli create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.ml create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.mli create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/dune create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/main_tx_rollup_client_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.ml create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.mli create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_node/dune create mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_node/main_tx_rollup_node_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/commands.ml create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/config.ml create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/dune create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/main_wasm_repl_016_PtMumbai.ml create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/messages.ml create mode 100644 src/proto_016_PtMumbai/bin_wasm_repl/repl_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/README.md create mode 100644 src/proto_016_PtMumbai/lib_benchmark/autocomp.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/dune create mode 100644 src/proto_016_PtMumbai/lib_benchmark/execution_context.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/kernel.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/int_map.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky_prim.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/monads.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/stores.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_uf.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/uf.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmark/mikhailsky_to_michelson.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/rules.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/sampling_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/state_space.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/dune create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/test_autocompletion.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/test_distribution.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/test_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_code.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_data.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/type_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmark/type_helpers.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/dune create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/gas_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_model.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_workload.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.mli create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_types.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/registration_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_generation.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/tags.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/translator_model.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/translator_workload.ml create mode 100644 src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml create mode 100644 src/proto_016_PtMumbai/lib_client/annotated_manager_operation.ml create mode 100644 src/proto_016_PtMumbai/lib_client/annotated_manager_operation.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_args.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_args.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_context.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_context.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_contracts.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_contracts.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_fa12.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_fa12.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_multisig.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_multisig.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_programs.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_programs.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_rollups.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_rollups.mli create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_utils.ml create mode 100644 src/proto_016_PtMumbai/lib_client/client_proto_utils.mli create mode 100644 src/proto_016_PtMumbai/lib_client/dune create mode 100644 src/proto_016_PtMumbai/lib_client/injection.ml create mode 100644 src/proto_016_PtMumbai/lib_client/injection.mli create mode 100644 src/proto_016_PtMumbai/lib_client/light.ml create mode 100644 src/proto_016_PtMumbai/lib_client/limit.ml create mode 100644 src/proto_016_PtMumbai/lib_client/limit.mli create mode 100644 src/proto_016_PtMumbai/lib_client/managed_contract.ml create mode 100644 src/proto_016_PtMumbai/lib_client/managed_contract.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_macros.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_macros.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_parser.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_parser.mli create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_printer.ml create mode 100644 src/proto_016_PtMumbai/lib_client/michelson_v1_printer.mli create mode 100644 src/proto_016_PtMumbai/lib_client/mockup.ml create mode 100644 src/proto_016_PtMumbai/lib_client/operation_result.ml create mode 100644 src/proto_016_PtMumbai/lib_client/operation_result.mli create mode 100644 src/proto_016_PtMumbai/lib_client/protocol_client_context.ml create mode 100644 src/proto_016_PtMumbai/lib_client/proxy.ml create mode 100644 src/proto_016_PtMumbai/lib_client/test/dune create mode 100644 src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml create mode 100644 src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml create mode 100644 src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml create mode 100644 src/proto_016_PtMumbai/lib_client/test/test_proxy.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/alpha_commands_registration.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_context_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_contracts_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_fa12_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_commands/dune create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/context.ml create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/context.mli create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/dune create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/wallet.ml create mode 100644 src/proto_016_PtMumbai/lib_client_sapling/wallet.mli create mode 100644 src/proto_016_PtMumbai/lib_dal/RPC.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dac_external_message_manager.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dac_manager.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dac_pages_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dac_preimage_data_manager.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dac_signature_manager.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.mli create mode 100644 src/proto_016_PtMumbai/lib_dal/dune create mode 100644 src/proto_016_PtMumbai/lib_dal/test/dune create mode 100644 src/proto_016_PtMumbai/lib_dal/test/main.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/test/test_dac_pages_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/abstract_context_index.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/abstract_context_index.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_actions.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_actions.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_cache.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_commands.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_commands.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_commands_registration.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_configuration.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_configuration.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_events.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_files.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_files.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_lib.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_lib.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_nonces.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_nonces.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_pow.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_pow.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_scheduling.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_scheduling.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_simulator.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_simulator.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_state.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_state.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_vdf.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/baking_vdf.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/block_forge.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/block_forge.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_daemon.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/client_daemon.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/delegate_events.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/dune create mode 100644 src/proto_016_PtMumbai/lib_delegate/liquidity_baking_vote_file.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/logging.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/logging.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/node_rpc.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/node_rpc.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_pool.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_pool.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_selection.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_selection.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_worker.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/operation_worker.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/state_transitions.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/state_transitions.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/README.md create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/dune create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/main.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/broadcast_services.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_client_context.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_daemon.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_services.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.mli create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/tenderbrute_main.ml create mode 100644 src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/disk_persistence.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/disk_persistence.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/dune create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_common.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_common.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_errors.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_events.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_functor.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_functor.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_sigs.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_tags.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_tags.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_worker_types.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/injector_worker_types.mli create mode 100644 src/proto_016_PtMumbai/lib_injector/l1_operation.ml create mode 100644 src/proto_016_PtMumbai/lib_injector/l1_operation.mli create mode 100644 src/proto_016_PtMumbai/lib_layer2_utils/dune create mode 100644 src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml create mode 100644 src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli create mode 100644 src/proto_016_PtMumbai/lib_parameters/default_parameters.ml create mode 100644 src/proto_016_PtMumbai/lib_parameters/default_parameters.mli create mode 100644 src/proto_016_PtMumbai/lib_parameters/dune create mode 100644 src/proto_016_PtMumbai/lib_parameters/gen.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/RPC.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/dune create mode 100644 src/proto_016_PtMumbai/lib_plugin/mempool.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/metrics_plugin.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/plugin.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/plugin_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/plugin_registerer.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.mli create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/dune create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/generators.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/test/test_utils.ml create mode 100644 src/proto_016_PtMumbai/lib_plugin/view_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/TEZOS_PROTOCOL create mode 100644 src/proto_016_PtMumbai/lib_protocol/alpha_context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/alpha_context.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/alpha_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/alpha_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/amendment.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/amendment.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_internal_results.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_internal_results.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_operation_result.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_operation_result.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_results.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/apply_results.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/baking.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/baking.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/bitset.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/bitset.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_header_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_header_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_payload_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_payload_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_payload_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/block_payload_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/bond_id_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/bond_id_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/cache_memory_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/cache_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/cache_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/carbonated_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/carbonated_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/commitment_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/commitment_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/commitment_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/commitment_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/constants_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/context_binary_proof.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/context_binary_proof.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/contract_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.bin create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.mligo create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/lqt.bin create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/lqt.mligo create mode 100644 src/proto_016_PtMumbai/lib_protocol/contracts/lqt.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/cycle_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/cycle_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_apply.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_errors_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_cycles.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_cycles.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_sampler.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_sampler.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/delegate_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dependent_bool.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/dependent_bool.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/destination_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/destination_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/fees_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/fees_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/fitness_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/fitness_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_input_size.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_input_size.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_monad.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/gas_monad.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/global_constants_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/global_constants_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/global_constants_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/global_constants_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/indexable.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/indexable.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/init_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/init_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/legacy_script_patches.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/level_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/level_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/level_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/level_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_cpmm.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_lqt.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/local_gas_counter.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/local_gas_counter.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/main.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/manager_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/manager_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/mempool_validation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/mempool_validation.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/merkle_list.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/merkle_list.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs_generated.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/migration_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/migration_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/misc.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/misc.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/non_empty_string.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/non_empty_string.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/nonce_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/nonce_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/nonce_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/nonce_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/operation_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/operation_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/origination_nonce.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/origination_nonce.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/parameters_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/parameters_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/path_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/path_encoding.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/period_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/period_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ratio_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ratio_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/raw_context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/raw_context.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/raw_context_intf.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/raw_level_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/raw_level_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/receipt_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/receipt_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/round_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/round_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sampler.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sampler.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sapling_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sapling_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sapling_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sapling_validator.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/saturation_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/saturation_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_PVM_sig.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_data_version_sig.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollups.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/sc_rollups.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_big_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_big_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_bytes.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_bytes.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_cache.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_cache.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_comparable.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_comparable.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_expr_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_expr_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_int.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_int.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_interpreter.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_interpreter.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_interpreter_defs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_annot.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_annot.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_translator.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_translator.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_translator_config.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_list.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_list.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_set.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_set.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_string.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_string.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_tc_context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_tc_context.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_tc_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_timestamp.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_timestamp.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/seed_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/seed_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/seed_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/seed_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/services_registration.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/services_registration.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/skip_list_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/skip_list_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/skip_list_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/skip_list_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/slot_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/slot_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/stake_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/stake_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/state_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/state_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_description.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_description.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_functors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_functors.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/storage_sigs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/README.md create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/README.md create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/account.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/account.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/assert.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/block.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/block.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/consensus_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/context.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/contract_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_logic.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/dummy_zk_rollup.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/expr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/expr_common.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/lqt_fa12_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/merkle_list_helper.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/op.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/op.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/operation_generator.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/rewards.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/sapling_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/sc_rollup_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/test_global_constants.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/test_tez.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/testable.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/ticket_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/tx_rollup_l2_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/helpers/zk_rollup_l2_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/big_interpreter_stack.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/emit.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/fail_rec.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_CREATE_CONTRACT.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SELF.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SET_DELEGATE.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_TRANSFER_TOKENS.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/int-store.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/omega.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply_store.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_store.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_double.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_drop.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_send.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_state_as_arg.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_push_sapling_state.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_use_existing_state.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/temp_big_maps.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/timelock.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_timelock.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_entrypoint.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_param.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_one_mutez.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_pair_string.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_string.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_comparable_type.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_data.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_type.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_sc_rollup_wasm.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generators.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/README.md create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/computation.wasm create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wasm create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wast create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/accounts.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/append.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/auction.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/big_map_union.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/check_signature.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-get.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-set.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/concat.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/conditionals.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/cps_fact.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dign.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dipn.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dugn.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ediv.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/faucet.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/get_and_update_map.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/if.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/insertion_sort.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/list_map_block.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/loop_left.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/opt_map.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/packunpack.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/pexec.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/rec_id_unit.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/reverse_loop.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/set_delegate.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/shifts.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/spawn_identities.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_join.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_split.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_fib.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_toplevel_lib.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/xor.tz create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/accounts.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/append.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/auction.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/big_map_union.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/check_signature.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-get.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-set.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/concat.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/conditionals.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/cps_fact.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dign.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dipn.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dugn.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ediv.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/faucet.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/get_and_update_map.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/if.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/insertion_sort.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/list_map_block.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/loop_left.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/opt_map.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/packunpack.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/pexec.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/rec_id_unit.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/reverse_loop.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/set_delegate.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/shifts.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/spawn_identities.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_join.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_split.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_fib.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_toplevel_lib.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/xor.out create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/dune create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/main.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tez_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tez_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_accounting.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_accounting.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_amount.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_amount.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_costs.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_costs.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_receipt.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_receipt.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_scanner.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_scanner.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token_map.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token_map.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_transfer.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/ticket_transfer.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/time_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/time_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/token.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/token.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_errors_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_hash_builder.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_sig.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_storage_sig.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/validate.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/validate.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/validate_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/validate_errors.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/vote_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/vote_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/vote_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/vote_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_period_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_period_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_period_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_period_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_services.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/voting_services.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_errors.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.ml create mode 100644 src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.mli create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/dune create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.ml create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.mli create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/l2_message.ml create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/l2_message.mli create mode 100644 src/proto_016_PtMumbai/lib_sc_rollup/sc_rollup_services.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/RPC.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/RPC.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/accuser.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/accuser.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/batcher.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/batcher.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/committer.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/committer.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/context.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/context.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/daemon.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/daemon.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/debug_events.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/dune create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/error.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/error.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/event.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/inbox.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/inbox.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/injector.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/injector.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/interpreter.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/interpreter.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/l2_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/l2block.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/l2block.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/node_config.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/node_config.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/node_data.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/state.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/state.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/stores.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/stores.mli create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/ticket.ml create mode 100644 src/proto_016_PtMumbai/lib_tx_rollup/ticket.mli create mode 100644 src/proto_016_PtMumbai/parameters/dune create mode 100644 tests_python/contracts_016/attic/accounts.tz create mode 100644 tests_python/contracts_016/attic/add1.tz create mode 100644 tests_python/contracts_016/attic/add1_list.tz create mode 100644 tests_python/contracts_016/attic/after_strategy.tz create mode 100644 tests_python/contracts_016/attic/always.tz create mode 100644 tests_python/contracts_016/attic/append.tz create mode 100644 tests_python/contracts_016/attic/at_least.tz create mode 100644 tests_python/contracts_016/attic/auction.tz create mode 100644 tests_python/contracts_016/attic/bad_lockup.tz create mode 100644 tests_python/contracts_016/attic/big_map_union.tz create mode 100644 tests_python/contracts_016/attic/cadr_annotation.tz create mode 100644 tests_python/contracts_016/attic/concat.tz create mode 100644 tests_python/contracts_016/attic/conditionals.tz create mode 100644 tests_python/contracts_016/attic/cons_twice.tz create mode 100644 tests_python/contracts_016/attic/cps_fact.tz create mode 100644 tests_python/contracts_016/attic/create_add1_lists.tz create mode 100644 tests_python/contracts_016/attic/data_publisher.tz create mode 100644 tests_python/contracts_016/attic/dispatch.tz create mode 100644 tests_python/contracts_016/attic/empty.tz create mode 100644 tests_python/contracts_016/attic/fail_amount.tz create mode 100644 tests_python/contracts_016/attic/faucet.tz create mode 100644 tests_python/contracts_016/attic/forward.tz create mode 100644 tests_python/contracts_016/attic/id.tz create mode 100644 tests_python/contracts_016/attic/infinite_loop.tz create mode 100644 tests_python/contracts_016/attic/insertion_sort.tz create mode 100644 tests_python/contracts_016/attic/int_publisher.tz create mode 100644 tests_python/contracts_016/attic/king_of_tez.tz create mode 100644 tests_python/contracts_016/attic/list_of_transactions.tz create mode 100644 tests_python/contracts_016/attic/queue.tz create mode 100644 tests_python/contracts_016/attic/reduce_map.tz create mode 100644 tests_python/contracts_016/attic/reentrancy.tz create mode 100644 tests_python/contracts_016/attic/reservoir.tz create mode 100644 tests_python/contracts_016/attic/scrutable_reservoir.tz create mode 100644 tests_python/contracts_016/attic/spawn_identities.tz create mode 100644 tests_python/contracts_016/entrypoints/big_map_entrypoints.tz create mode 100644 tests_python/contracts_016/entrypoints/delegatable_target.tz create mode 100644 tests_python/contracts_016/entrypoints/manager.tz create mode 100644 tests_python/contracts_016/entrypoints/no_default_target.tz create mode 100644 tests_python/contracts_016/entrypoints/no_entrypoint_target.tz create mode 100644 tests_python/contracts_016/entrypoints/rooted_target.tz create mode 100644 tests_python/contracts_016/entrypoints/simple_entrypoints.tz create mode 100644 tests_python/contracts_016/ill_typed/big_dip.tz create mode 100644 tests_python/contracts_016/ill_typed/big_drop.tz create mode 100644 tests_python/contracts_016/ill_typed/chain_id_arity.tz create mode 100644 tests_python/contracts_016/ill_typed/comb0.tz create mode 100644 tests_python/contracts_016/ill_typed/comb1.tz create mode 100644 tests_python/contracts_016/ill_typed/contract_annotation_default.tz create mode 100644 tests_python/contracts_016/ill_typed/create_contract_rootname.tz create mode 100644 tests_python/contracts_016/ill_typed/dip_failwith.tz create mode 100644 tests_python/contracts_016/ill_typed/dup0.tz create mode 100644 tests_python/contracts_016/ill_typed/failwith_big_map.tz create mode 100644 tests_python/contracts_016/ill_typed/invalid_self_entrypoint.tz create mode 100644 tests_python/contracts_016/ill_typed/map_failwith.tz create mode 100644 tests_python/contracts_016/ill_typed/missing_only_code_field.tz create mode 100644 tests_python/contracts_016/ill_typed/missing_only_parameter_field.tz create mode 100644 tests_python/contracts_016/ill_typed/missing_only_storage_field.tz create mode 100644 tests_python/contracts_016/ill_typed/missing_parameter_and_storage_fields.tz create mode 100644 tests_python/contracts_016/ill_typed/multiple_code_field.tz create mode 100644 tests_python/contracts_016/ill_typed/multiple_parameter_field.tz create mode 100644 tests_python/contracts_016/ill_typed/multiple_storage_and_code_fields.tz create mode 100644 tests_python/contracts_016/ill_typed/multiple_storage_field.tz create mode 100644 tests_python/contracts_016/ill_typed/never_literal.tz create mode 100644 tests_python/contracts_016/ill_typed/pack_big_map.tz create mode 100644 tests_python/contracts_016/ill_typed/pack_operation.tz create mode 100644 tests_python/contracts_016/ill_typed/pack_sapling_state.tz create mode 100644 tests_python/contracts_016/ill_typed/push_big_map_with_id_with_parens.tz create mode 100644 tests_python/contracts_016/ill_typed/push_big_map_with_id_without_parens.tz create mode 100644 tests_python/contracts_016/ill_typed/sapling_build_empty_state_with_int_parameter.tz create mode 100644 tests_python/contracts_016/ill_typed/set_update_non_comparable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undig2able.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undigable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undip2able.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undipable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undropable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undug2able.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undugable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_undup2able.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unfailwithable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_ungetable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unleftable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unpairable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unpopable.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unpopable_in_lambda.tz create mode 100644 tests_python/contracts_016/ill_typed/stack_bottom_unrightable.tz create mode 100644 tests_python/contracts_016/ill_typed/ticket_apply.tz create mode 100644 tests_python/contracts_016/ill_typed/ticket_dup.tz create mode 100644 tests_python/contracts_016/ill_typed/ticket_in_ticket.tz create mode 100644 tests_python/contracts_016/ill_typed/ticket_unpack.tz create mode 100644 tests_python/contracts_016/ill_typed/uncomb0.tz create mode 100644 tests_python/contracts_016/ill_typed/uncomb1.tz create mode 100644 tests_python/contracts_016/ill_typed/unpack_sapling_state.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_char_set.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_bad_name_non_printable_char.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_bad_name_too_long.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_bad_return_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_dupable_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_invalid_arity.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_lazy_storage.tz create mode 100644 tests_python/contracts_016/ill_typed/view_op_lazy_storage_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_input_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_char_set.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_name_non_printable_char.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_name_too_long.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_return_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_bad_type.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_input.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_output.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_duplicated_name.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_invalid_arity.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_input.tz create mode 100644 tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_output.tz create mode 100644 tests_python/contracts_016/legacy/create_account.tz create mode 100644 tests_python/contracts_016/legacy/create_contract.tz create mode 100644 tests_python/contracts_016/legacy/create_contract_flags.tz create mode 100644 tests_python/contracts_016/legacy/create_contract_rootname.tz create mode 100644 tests_python/contracts_016/legacy/originator.tz create mode 100644 tests_python/contracts_016/legacy/steps_to_quota.tz create mode 100644 tests_python/contracts_016/macros/assert.tz create mode 100644 tests_python/contracts_016/macros/assert_cmpeq.tz create mode 100644 tests_python/contracts_016/macros/assert_cmpge.tz create mode 100644 tests_python/contracts_016/macros/assert_cmpgt.tz create mode 100644 tests_python/contracts_016/macros/assert_cmple.tz create mode 100644 tests_python/contracts_016/macros/assert_cmplt.tz create mode 100644 tests_python/contracts_016/macros/assert_cmpneq.tz create mode 100644 tests_python/contracts_016/macros/assert_eq.tz create mode 100644 tests_python/contracts_016/macros/assert_ge.tz create mode 100644 tests_python/contracts_016/macros/assert_gt.tz create mode 100644 tests_python/contracts_016/macros/assert_le.tz create mode 100644 tests_python/contracts_016/macros/assert_lt.tz create mode 100644 tests_python/contracts_016/macros/assert_neq.tz create mode 100644 tests_python/contracts_016/macros/big_map_get_add.tz create mode 100644 tests_python/contracts_016/macros/big_map_mem.tz create mode 100644 tests_python/contracts_016/macros/build_list.tz create mode 100644 tests_python/contracts_016/macros/carn_and_cdrn.tz create mode 100644 tests_python/contracts_016/macros/compare.tz create mode 100644 tests_python/contracts_016/macros/compare_bytes.tz create mode 100644 tests_python/contracts_016/macros/fail.tz create mode 100644 tests_python/contracts_016/macros/guestbook.tz create mode 100644 tests_python/contracts_016/macros/macro_annotations.tz create mode 100644 tests_python/contracts_016/macros/map_caddaadr.tz create mode 100644 tests_python/contracts_016/macros/max_in_list.tz create mode 100644 tests_python/contracts_016/macros/min.tz create mode 100644 tests_python/contracts_016/macros/pair_macro.tz create mode 100644 tests_python/contracts_016/macros/set_caddaadr.tz create mode 100644 tests_python/contracts_016/macros/take_my_money.tz create mode 100644 tests_python/contracts_016/macros/unpair_macro.tz create mode 100644 tests_python/contracts_016/mini_scenarios/add_clear_tickets.tz create mode 100644 tests_python/contracts_016/mini_scenarios/authentication.tz create mode 100644 tests_python/contracts_016/mini_scenarios/big_map_entrypoints.tz create mode 100644 tests_python/contracts_016/mini_scenarios/big_map_magic.tz create mode 100644 tests_python/contracts_016/mini_scenarios/big_map_read.tz create mode 100644 tests_python/contracts_016/mini_scenarios/big_map_store.tz create mode 100644 tests_python/contracts_016/mini_scenarios/big_map_write.tz create mode 100644 tests_python/contracts_016/mini_scenarios/create_contract.tz create mode 100644 tests_python/contracts_016/mini_scenarios/create_contract_simple.tz create mode 100644 tests_python/contracts_016/mini_scenarios/default_account.tz create mode 100644 tests_python/contracts_016/mini_scenarios/execution_order_appender.tz create mode 100644 tests_python/contracts_016/mini_scenarios/execution_order_caller.tz create mode 100644 tests_python/contracts_016/mini_scenarios/execution_order_storer.tz create mode 100644 tests_python/contracts_016/mini_scenarios/fa12_reference.tz create mode 100644 tests_python/contracts_016/mini_scenarios/generic_multisig.tz create mode 100644 tests_python/contracts_016/mini_scenarios/groth16.tz create mode 100644 tests_python/contracts_016/mini_scenarios/hardlimit.tz create mode 100644 tests_python/contracts_016/mini_scenarios/legacy_multisig.tz create mode 100644 tests_python/contracts_016/mini_scenarios/lockup.tz create mode 100644 tests_python/contracts_016/mini_scenarios/lqt_fa12.mligo.tz create mode 100644 tests_python/contracts_016/mini_scenarios/multiple_en2.tz create mode 100644 tests_python/contracts_016/mini_scenarios/multiple_entrypoints_counter.tz create mode 100644 tests_python/contracts_016/mini_scenarios/originate_contract.tz create mode 100644 tests_python/contracts_016/mini_scenarios/parameterized_multisig.tz create mode 100644 tests_python/contracts_016/mini_scenarios/receive_tickets_in_big_map.tz create mode 100644 tests_python/contracts_016/mini_scenarios/replay.tz create mode 100644 tests_python/contracts_016/mini_scenarios/reveal_signed_preimage.tz create mode 100644 tests_python/contracts_016/mini_scenarios/self_address_receiver.tz create mode 100644 tests_python/contracts_016/mini_scenarios/self_address_sender.tz create mode 100644 tests_python/contracts_016/mini_scenarios/send_tickets_in_big_map.tz create mode 100644 tests_python/contracts_016/mini_scenarios/ticket_builder_fungible.tz create mode 100644 tests_python/contracts_016/mini_scenarios/ticket_builder_non_fungible.tz create mode 100644 tests_python/contracts_016/mini_scenarios/ticket_wallet_fungible.tz create mode 100644 tests_python/contracts_016/mini_scenarios/ticket_wallet_non_fungible.tz create mode 100644 tests_python/contracts_016/mini_scenarios/vote_for_delegate.tz create mode 100644 tests_python/contracts_016/mini_scenarios/weather_insurance.tz create mode 100644 tests_python/contracts_016/mini_scenarios/xcat.tz create mode 100644 tests_python/contracts_016/mini_scenarios/xcat_dapp.tz create mode 100644 tests_python/contracts_016/non_regression/bad_annot_contract.tz create mode 100644 tests_python/contracts_016/non_regression/bug_262.tz create mode 100644 tests_python/contracts_016/non_regression/bug_843.tz create mode 100644 tests_python/contracts_016/non_regression/pairk_annot.tz create mode 100644 tests_python/contracts_016/opcodes/abs.tz create mode 100644 tests_python/contracts_016/opcodes/add.tz create mode 100644 tests_python/contracts_016/opcodes/add_bls12_381_fr.tz create mode 100644 tests_python/contracts_016/opcodes/add_bls12_381_g1.tz create mode 100644 tests_python/contracts_016/opcodes/add_bls12_381_g2.tz create mode 100644 tests_python/contracts_016/opcodes/add_delta_timestamp.tz create mode 100644 tests_python/contracts_016/opcodes/add_timestamp_delta.tz create mode 100644 tests_python/contracts_016/opcodes/address.tz create mode 100644 tests_python/contracts_016/opcodes/amount_after_fib_view.tz create mode 100644 tests_python/contracts_016/opcodes/amount_after_nonexistent_view.tz create mode 100644 tests_python/contracts_016/opcodes/amount_after_view.tz create mode 100644 tests_python/contracts_016/opcodes/and.tz create mode 100644 tests_python/contracts_016/opcodes/and_binary.tz create mode 100644 tests_python/contracts_016/opcodes/and_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/and_logical_1.tz create mode 100644 tests_python/contracts_016/opcodes/balance.tz create mode 100644 tests_python/contracts_016/opcodes/balance_after_fib_view.tz create mode 100644 tests_python/contracts_016/opcodes/balance_after_nonexistent_view.tz create mode 100644 tests_python/contracts_016/opcodes/balance_after_view.tz create mode 100644 tests_python/contracts_016/opcodes/big_map_mem_nat.tz create mode 100644 tests_python/contracts_016/opcodes/big_map_mem_string.tz create mode 100644 tests_python/contracts_016/opcodes/big_map_to_self.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz create mode 100644 tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz create mode 100644 tests_python/contracts_016/opcodes/bytes.tz create mode 100644 tests_python/contracts_016/opcodes/bytes_of_int.tz create mode 100644 tests_python/contracts_016/opcodes/bytes_of_nat.tz create mode 100644 tests_python/contracts_016/opcodes/car.tz create mode 100644 tests_python/contracts_016/opcodes/cdr.tz create mode 100644 tests_python/contracts_016/opcodes/chain_id.tz create mode 100644 tests_python/contracts_016/opcodes/chain_id_store.tz create mode 100644 tests_python/contracts_016/opcodes/check_signature.tz create mode 100644 tests_python/contracts_016/opcodes/comb-get.tz create mode 100644 tests_python/contracts_016/opcodes/comb-literals.tz create mode 100644 tests_python/contracts_016/opcodes/comb-set-2.tz create mode 100644 tests_python/contracts_016/opcodes/comb-set.tz create mode 100644 tests_python/contracts_016/opcodes/comb.tz create mode 100644 tests_python/contracts_016/opcodes/compare.tz create mode 100644 tests_python/contracts_016/opcodes/compare_big_type.tz create mode 100644 tests_python/contracts_016/opcodes/compare_big_type2.tz create mode 100644 tests_python/contracts_016/opcodes/comparisons.tz create mode 100644 tests_python/contracts_016/opcodes/concat_hello.tz create mode 100644 tests_python/contracts_016/opcodes/concat_hello_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/concat_list.tz create mode 100644 tests_python/contracts_016/opcodes/cons.tz create mode 100644 tests_python/contracts_016/opcodes/contains_all.tz create mode 100644 tests_python/contracts_016/opcodes/contract.tz create mode 100644 tests_python/contracts_016/opcodes/create_contract.tz create mode 100644 tests_python/contracts_016/opcodes/create_contract_rootname.tz create mode 100644 tests_python/contracts_016/opcodes/create_contract_rootname_alt.tz create mode 100644 tests_python/contracts_016/opcodes/create_contract_with_view.tz create mode 100644 tests_python/contracts_016/opcodes/diff_timestamps.tz create mode 100644 tests_python/contracts_016/opcodes/dig_eq.tz create mode 100644 tests_python/contracts_016/opcodes/dign.tz create mode 100644 tests_python/contracts_016/opcodes/dip.tz create mode 100644 tests_python/contracts_016/opcodes/dipn.tz create mode 100644 tests_python/contracts_016/opcodes/dropn.tz create mode 100644 tests_python/contracts_016/opcodes/dugn.tz create mode 100644 tests_python/contracts_016/opcodes/dup-n.tz create mode 100644 tests_python/contracts_016/opcodes/ediv.tz create mode 100644 tests_python/contracts_016/opcodes/ediv_mutez.tz create mode 100644 tests_python/contracts_016/opcodes/emit.tz create mode 100644 tests_python/contracts_016/opcodes/empty_map.tz create mode 100644 tests_python/contracts_016/opcodes/exec_concat.tz create mode 100644 tests_python/contracts_016/opcodes/first.tz create mode 100644 tests_python/contracts_016/opcodes/get_and_update_big_map.tz create mode 100644 tests_python/contracts_016/opcodes/get_and_update_map.tz create mode 100644 tests_python/contracts_016/opcodes/get_big_map_value.tz create mode 100644 tests_python/contracts_016/opcodes/get_map_value.tz create mode 100644 tests_python/contracts_016/opcodes/hash_consistency_checker.tz create mode 100644 tests_python/contracts_016/opcodes/hash_key.tz create mode 100644 tests_python/contracts_016/opcodes/hash_string.tz create mode 100644 tests_python/contracts_016/opcodes/if.tz create mode 100644 tests_python/contracts_016/opcodes/if_some.tz create mode 100644 tests_python/contracts_016/opcodes/int.tz create mode 100644 tests_python/contracts_016/opcodes/iter_fail.tz create mode 100644 tests_python/contracts_016/opcodes/keccak.tz create mode 100644 tests_python/contracts_016/opcodes/left_right.tz create mode 100644 tests_python/contracts_016/opcodes/level.tz create mode 100644 tests_python/contracts_016/opcodes/list_concat.tz create mode 100644 tests_python/contracts_016/opcodes/list_concat_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/list_id.tz create mode 100644 tests_python/contracts_016/opcodes/list_id_map.tz create mode 100644 tests_python/contracts_016/opcodes/list_iter.tz create mode 100644 tests_python/contracts_016/opcodes/list_map_block.tz create mode 100644 tests_python/contracts_016/opcodes/list_size.tz create mode 100644 tests_python/contracts_016/opcodes/loop_failwith.tz create mode 100644 tests_python/contracts_016/opcodes/loop_left.tz create mode 100644 tests_python/contracts_016/opcodes/loop_left_failwith.tz create mode 100644 tests_python/contracts_016/opcodes/lsl_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/lsr_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/map_car.tz create mode 100644 tests_python/contracts_016/opcodes/map_id.tz create mode 100644 tests_python/contracts_016/opcodes/map_iter.tz create mode 100644 tests_python/contracts_016/opcodes/map_map.tz create mode 100644 tests_python/contracts_016/opcodes/map_map_sideeffect.tz create mode 100644 tests_python/contracts_016/opcodes/map_mem_nat.tz create mode 100644 tests_python/contracts_016/opcodes/map_mem_string.tz create mode 100644 tests_python/contracts_016/opcodes/map_size.tz create mode 100644 tests_python/contracts_016/opcodes/merge_comparable_pairs.tz create mode 100644 tests_python/contracts_016/opcodes/mul.tz create mode 100644 tests_python/contracts_016/opcodes/mul_bls12_381_fr.tz create mode 100644 tests_python/contracts_016/opcodes/mul_bls12_381_g1.tz create mode 100644 tests_python/contracts_016/opcodes/mul_bls12_381_g2.tz create mode 100644 tests_python/contracts_016/opcodes/mul_overflow.tz create mode 100644 tests_python/contracts_016/opcodes/munch.tz create mode 100644 tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz create mode 100644 tests_python/contracts_016/opcodes/neg.tz create mode 100644 tests_python/contracts_016/opcodes/neg_bls12_381_fr.tz create mode 100644 tests_python/contracts_016/opcodes/neg_bls12_381_g1.tz create mode 100644 tests_python/contracts_016/opcodes/neg_bls12_381_g2.tz create mode 100644 tests_python/contracts_016/opcodes/none.tz create mode 100644 tests_python/contracts_016/opcodes/noop.tz create mode 100644 tests_python/contracts_016/opcodes/not.tz create mode 100644 tests_python/contracts_016/opcodes/not_binary.tz create mode 100644 tests_python/contracts_016/opcodes/not_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/or.tz create mode 100644 tests_python/contracts_016/opcodes/or_binary.tz create mode 100644 tests_python/contracts_016/opcodes/or_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/originate_big_map.tz create mode 100644 tests_python/contracts_016/opcodes/packunpack.tz create mode 100644 tests_python/contracts_016/opcodes/packunpack_rev.tz create mode 100644 tests_python/contracts_016/opcodes/packunpack_rev_cty.tz create mode 100644 tests_python/contracts_016/opcodes/pair_id.tz create mode 100644 tests_python/contracts_016/opcodes/pairing_check.tz create mode 100644 tests_python/contracts_016/opcodes/pexec.tz create mode 100644 tests_python/contracts_016/opcodes/pexec_2.tz create mode 100644 tests_python/contracts_016/opcodes/proxy.tz create mode 100644 tests_python/contracts_016/opcodes/ret_int.tz create mode 100644 tests_python/contracts_016/opcodes/reverse.tz create mode 100644 tests_python/contracts_016/opcodes/reverse_loop.tz create mode 100644 tests_python/contracts_016/opcodes/sapling_empty_state.tz create mode 100644 tests_python/contracts_016/opcodes/self.tz create mode 100644 tests_python/contracts_016/opcodes/self_address.tz create mode 100644 tests_python/contracts_016/opcodes/self_address_after_fib_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_address_after_nonexistent_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_address_after_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_after_fib_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_after_nonexistent_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_after_view.tz create mode 100644 tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz create mode 100644 tests_python/contracts_016/opcodes/self_with_entrypoint.tz create mode 100644 tests_python/contracts_016/opcodes/sender.tz create mode 100644 tests_python/contracts_016/opcodes/sender_after_fib_view.tz create mode 100644 tests_python/contracts_016/opcodes/sender_after_nonexistent_view.tz create mode 100644 tests_python/contracts_016/opcodes/sender_after_view.tz create mode 100644 tests_python/contracts_016/opcodes/set_car.tz create mode 100644 tests_python/contracts_016/opcodes/set_cdr.tz create mode 100644 tests_python/contracts_016/opcodes/set_delegate.tz create mode 100644 tests_python/contracts_016/opcodes/set_id.tz create mode 100644 tests_python/contracts_016/opcodes/set_iter.tz create mode 100644 tests_python/contracts_016/opcodes/set_member.tz create mode 100644 tests_python/contracts_016/opcodes/set_size.tz create mode 100644 tests_python/contracts_016/opcodes/sets.tz create mode 100644 tests_python/contracts_016/opcodes/sha3.tz create mode 100644 tests_python/contracts_016/opcodes/shifts.tz create mode 100644 tests_python/contracts_016/opcodes/slice.tz create mode 100644 tests_python/contracts_016/opcodes/slice_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/slices.tz create mode 100644 tests_python/contracts_016/opcodes/source.tz create mode 100644 tests_python/contracts_016/opcodes/split_bytes.tz create mode 100644 tests_python/contracts_016/opcodes/split_string.tz create mode 100644 tests_python/contracts_016/opcodes/store_bls12_381_fr.tz create mode 100644 tests_python/contracts_016/opcodes/store_bls12_381_g1.tz create mode 100644 tests_python/contracts_016/opcodes/store_bls12_381_g2.tz create mode 100644 tests_python/contracts_016/opcodes/store_input.tz create mode 100644 tests_python/contracts_016/opcodes/store_now.tz create mode 100644 tests_python/contracts_016/opcodes/str_id.tz create mode 100644 tests_python/contracts_016/opcodes/sub_timestamp_delta.tz create mode 100644 tests_python/contracts_016/opcodes/subset.tz create mode 100644 tests_python/contracts_016/opcodes/tez_add_sub.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_bad.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_big_store.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_join.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_read.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_split.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_store-2.tz create mode 100644 tests_python/contracts_016/opcodes/ticket_store.tz create mode 100644 tests_python/contracts_016/opcodes/ticketer-2.tz create mode 100644 tests_python/contracts_016/opcodes/ticketer.tz create mode 100644 tests_python/contracts_016/opcodes/transfer_amount.tz create mode 100644 tests_python/contracts_016/opcodes/transfer_tokens.tz create mode 100644 tests_python/contracts_016/opcodes/uncomb.tz create mode 100644 tests_python/contracts_016/opcodes/unpair.tz create mode 100644 tests_python/contracts_016/opcodes/unpair_field_annotation_mismatch.tz create mode 100644 tests_python/contracts_016/opcodes/update_big_map.tz create mode 100644 tests_python/contracts_016/opcodes/utxo_read.tz create mode 100644 tests_python/contracts_016/opcodes/utxor.tz create mode 100644 tests_python/contracts_016/opcodes/view_fib.tz create mode 100644 tests_python/contracts_016/opcodes/view_mutual_recursion.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_add.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_constant.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_id.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_nonexistent_addr.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_nonexistent_func.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_test_step_contants.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_input_type.tz create mode 100644 tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_output_type.tz create mode 100644 tests_python/contracts_016/opcodes/view_rec.tz create mode 100644 tests_python/contracts_016/opcodes/view_toplevel_lib.tz create mode 100644 tests_python/contracts_016/opcodes/voting_power.tz create mode 100644 tests_python/contracts_016/opcodes/xor.tz create mode 100644 tests_python/contracts_016/opcodes/xor_bytes.tz create mode 100644 tests_python/tests_016/__init__.py create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpeq.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpge.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpgt.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmple.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmplt.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpneq.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_eq.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_ge.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_gt.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_le.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_lt.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_neq.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_get_add.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_mem.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--build_list.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--carn_and_cdrn.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare_bytes.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--fail.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--guestbook.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--macro_annotations.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--map_caddaadr.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--max_in_list.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--min.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--pair_macro.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--set_caddaadr.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--take_my_money.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--unpair_macro.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_diff.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_id.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_diff.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_id.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainLevel::test_level.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_contract_fails.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_gen_keys.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_init_proxy.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_now.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_self.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_sender.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice.out create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0 \"spsig1PPUFZucuAQybs5wsqs.818025e860.out" create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.2d6806d54e.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.378d03ae2d.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.57fdc7ad1c.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75.c583c796bf.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_bytes.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_string.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_store_input.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type2.tz].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_amount.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.f6092ac5d6.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0427752f13.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0793dc66d5.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .df114499b8.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .f9bea98de9.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.1db12cd837.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.6fc7d0acf2.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.524c5459f8.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".33eba403e7.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.a5cd1005c9.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .6f3d35b151.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .76aeaa0706.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7e7197f248.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7ef2c415a7.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .b688cc94a7.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c68db221ed.out" create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Left Unit].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Right Unit].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 1 257))].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 123 257))].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 1 257))].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 123 257))].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0.5].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1000].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1e-06].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[5].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[8000000000000.0].out create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.7492e8cdea.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.21b30dd90f.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .2873ef610c.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .8a6f480005.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.d336ca1903.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.7f2ee47600.out" create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_check_signature.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_hash_consistency_michelson_cli.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_level.out create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"bar\" 5 ; Elt \"foo\" 1 } .480b9afc63.out" create mode 100644 "tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"foo\" 1 } 1)-10-(Pair { .811573b5a7.out" create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair {} 0)-10-(Pair {} 0)].out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_now.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_packunpack.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_dex_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_lqt_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_setup.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_tok_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_dex_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_lqt_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_setup.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_tok_storage.out create mode 100644 tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out create mode 100644 tests_python/tests_016/conftest.py create mode 100644 tests_python/tests_016/contract_paths.py create mode 100644 tests_python/tests_016/operations_files/empty_operations.json create mode 100644 tests_python/tests_016/protocol.py create mode 100644 tests_python/tests_016/test_accuser.py create mode 100644 tests_python/tests_016/test_baker_operations_cli_options.py create mode 100644 tests_python/tests_016/test_basic.py create mode 100644 tests_python/tests_016/test_binaries.py create mode 100644 tests_python/tests_016/test_client.py create mode 100644 tests_python/tests_016/test_client_without_node.py create mode 100644 tests_python/tests_016/test_contract.py create mode 100644 tests_python/tests_016/test_contract_annotations.py create mode 100644 tests_python/tests_016/test_contract_baker.py create mode 100644 tests_python/tests_016/test_contract_macros.py create mode 100644 tests_python/tests_016/test_contract_onchain_opcodes.py create mode 100644 tests_python/tests_016/test_contract_opcodes.py create mode 100644 tests_python/tests_016/test_cors.py create mode 100755 tests_python/tests_016/test_forge_block.py create mode 100644 tests_python/tests_016/test_fork.py create mode 100644 tests_python/tests_016/test_liquidity_baking.py create mode 100644 tests_python/tests_016/test_many_bakers.py create mode 100644 tests_python/tests_016/test_many_nodes.py create mode 100644 tests_python/tests_016/test_mempool.py create mode 100644 tests_python/tests_016/test_multinode_storage_reconstruction.py create mode 100644 tests_python/tests_016/test_multiple_transfers.py create mode 100644 tests_python/tests_016/test_multisig.py create mode 100644 tests_python/tests_016/test_nonce_seed_revelation.py create mode 100644 tests_python/tests_016/test_openapi.py create mode 100644 tests_python/tests_016/test_p2p.py create mode 100644 tests_python/tests_016/test_proto_demo_counter.py create mode 100644 tests_python/tests_016/test_proto_demo_noops_manual_bake.py create mode 100644 tests_python/tests_016/test_sapling.py create mode 100644 tests_python/tests_016/test_slice_fails_params.txt create mode 100644 tests_python/tests_016/test_slice_success_params.txt create mode 100755 tests_python/tests_016/test_tls.py create mode 100644 tests_python/tests_016/test_voting.py create mode 100644 tests_python/tests_016/test_voting_full.py diff --git a/docs/alpha/consensus.rst b/docs/alpha/consensus.rst index 795c312eaa5e..7dbc919a1bf1 100644 --- a/docs/alpha/consensus.rst +++ b/docs/alpha/consensus.rst @@ -331,7 +331,7 @@ CONSENSUS_COMMITTEE_SIZE * active_stake / total_active_stake``). Regarding the concrete values for rewards, we first fix the total reward per level, call it ``total_rewards``, to ``80 / blocks_per_minute`` tez. -Assuming ``blocks_per_minute = 4``, ``total_rewards`` is 20 tez. +Assuming ``blocks_per_minute = 2``, ``total_rewards`` is 40 tez. We define: - ``BAKING_REWARD_FIXED_PORTION := baking_reward_ratio * total_rewards`` @@ -343,16 +343,16 @@ where: - ``baking_reward_ratio`` to ``1 / 4``, - ``bonus_ratio`` to ``1 / 3``. -Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 5`` tez, -(maximum) ``bonus = 5`` tez, and ``endorsing_rewards = 10`` tez. +Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 10`` tez, +(maximum) ``bonus = 10`` tez, and ``endorsing_rewards = 20`` tez. The bonus per additional endorsement slot is in turn ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` (because there are at most ``CONSENSUS_COMMITTEE_SIZE / 3`` validator slots corresponding to the additional endorsements included in a block). The rewards per endorsement slot are ``endorsing_rewards / CONSENSUS_COMMITTEE_SIZE``. Assuming ``CONSENSUS_COMMITTEE_SIZE = 7000``, we obtain a bonus per slot of -``5 / (7000 / 3) = 0.002143`` tez and an endorsing -rewards per slot of ``10 / 7000 = 0.001428`` tez. +``10 / (7000 / 3) = 0.004286`` tez and an endorsing +rewards per slot of ``20 / 7000 = 0.002857`` tez. Let's take an example. Say a block has round 1, is proposed by delegate B, and contains the payload from round 0 produced by delegate @@ -360,7 +360,7 @@ A. Also, B includes endorsements with endorsing power ``5251``. Then A receives the fees and 10 tez (the ``BAKING_REWARD_FIXED_PORTION``) as a reward for producing the block's payload. Concerning the bonus, given that ``CONSENSUS_COMMITTEE_SIZE = 7000``, the minimum required validator slots is ``4667``, and there are ``2333 = 7000 - 4667`` additional validator slots. -Therefore B receives the bonus ``(5251 - 4667) * 0.002143 = 1.251512`` tez. (Note +Therefore B receives the bonus ``(5251 - 4667) * 0.004286 = 2.503`` tez. (Note that B only included endorsements corresponding to 584 = 5251 - 4667 additional validator slots, about a quarter of the maximum 2333 extra endorsements it could have theoretically included.) Finally, consider some delegate C, whose active stake at some cycle is 5% of the total stake. Note that @@ -368,7 +368,7 @@ his expected number of validator slots for that cycle is ``5/100 * 8192 * 7000 = 2,867,200`` slots. Assume also that the endorsing power of C's endorsements included during that cycle has been ``2,123,456`` slots. Given that this number is bigger than the minimum required (``2,867,200 * 2 / 3``), it receives an endorsing -reward of ``2,867,200 * 0.001428 = 4094.3616`` tez for that cycle. +reward of ``2,867,200 * 0.002857 = 8191.59`` tez for that cycle. .. _slashing_alpha: @@ -414,9 +414,9 @@ Consensus related protocol parameters * - ``CONSENSUS_THRESHOLD`` - ``ceil(2 * CONSENSUS_COMMITTEE_SIZE / 3)`` = 4667 * - ``MINIMAL_BLOCK_DELAY`` - - 15s + - 30s * - ``DELAY_INCREMENT_PER_ROUND`` - - 8s + - 15s * - ``MINIMAL_PARTICIPATION_RATIO`` - 2/3 * - ``FROZEN_DEPOSITS_PERCENTAGE`` @@ -428,11 +428,11 @@ Consensus related protocol parameters * - ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` - 1/2 * - ``BAKING_REWARD_FIXED_PORTION`` - - 5 tez + - 10 tez * - ``BAKING_REWARD_BONUS_PER_SLOT`` - - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.002143 tez + - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.004286 tez * - ``ENDORSING_REWARD_PER_SLOT`` - - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.001428 tez + - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez These are a subset of the :ref:`protocol constants `. diff --git a/docs/alpha/liquidity_baking.rst b/docs/alpha/liquidity_baking.rst index 6685c0fe8c8a..19f4bd704f37 100644 --- a/docs/alpha/liquidity_baking.rst +++ b/docs/alpha/liquidity_baking.rst @@ -26,7 +26,7 @@ The LIGO and Michelson code for these contracts, as well as detailed documentati Subsidy ~~~~~~~ -At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block of round 0 with all endorsements; currently these rewards are 20 tez per block so the amount that is sent to the CPMM contract is 1.25 tez per block. +At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block; currently these rewards are 40 tez per block so the amount that is sent to the CPMM contract is 2.5 tez per block. So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. @@ -60,7 +60,7 @@ For indicative purposes, if among the non-abstaining blocks a fraction reached after roughly ``2*(log(1-1/(2f)) / log(0.999))`` non-abstaining blocks, about 1386 blocks if everyone signals, 1963 blocks if 80% do, 3583 blocks if 60% do etc. Recall for comparison -that assuming four blocks per minute there are 5760 blocks per day. +that assuming two blocks per minute there are 2880 blocks per day. When producing blocks using Octez baking daemon ``octez-baker``, there are two command-line options affecting toggle vote. The diff --git a/docs/alpha/proof_of_stake.rst b/docs/alpha/proof_of_stake.rst index 0a221815deff..450f9e9d2696 100644 --- a/docs/alpha/proof_of_stake.rst +++ b/docs/alpha/proof_of_stake.rst @@ -149,13 +149,13 @@ Proof-of-stake parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_CYCLE`` - - 16384 blocks + - 8192 blocks * - ``PRESERVED_CYCLES`` - 5 cycles * - ``TOKENS_PER_ROLL`` - 6,000 ꜩ * - ``BLOCKS_PER_STAKE_SNAPSHOT`` - - 1024 blocks + - 512 blocks Further External Resources diff --git a/docs/alpha/randomness_generation.rst b/docs/alpha/randomness_generation.rst index 6e2d21933fce..417c5acaa144 100644 --- a/docs/alpha/randomness_generation.rst +++ b/docs/alpha/randomness_generation.rst @@ -150,9 +150,9 @@ Randomness generation parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_COMMITMENT`` - - 128 blocks + - 64 blocks * - ``NONCE_REVELATION_THRESHOLD`` - - 512 blocks + - 256 blocks * - ``MAX_ANON_OPS_PER_BLOCK`` - 132 revelations * - ``SEED_NONCE_REVELATION_TIP`` diff --git a/docs/index.rst b/docs/index.rst index 6ff9bd2d5a4d..43c505e58e77 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -165,6 +165,15 @@ in the :ref:`introduction `. lima/cli-commands lima/rpc +.. toctree:: + :maxdepth: 2 + :caption: Mumbai Protocol doc: + + mumbai/protocol + mumbai/glossary + mumbai/cli-commands + mumbai/rpc + .. toctree:: :maxdepth: 2 :caption: Alpha Development Protocol doc: @@ -221,6 +230,7 @@ in the :ref:`introduction `. protocols/013_jakarta protocols/014_kathmandu protocols/015_lima + protocols/016_mumbai protocols/alpha .. toctree:: diff --git a/docs/mumbai/blocks_ops.rst b/docs/mumbai/blocks_ops.rst new file mode 100644 index 000000000000..f832a40e2b15 --- /dev/null +++ b/docs/mumbai/blocks_ops.rst @@ -0,0 +1,229 @@ +===================== +Blocks and Operations +===================== + +The content of a Tezos block is made up of operations, which implement +and reify different functionalities provided by a Tezos economic +protocol: from reaching consensus on the state of the Tezos +blockchain, to performing smart contract calls and transactions. Each +Tezos economic protocol can specify different kinds of operations. + +This entry describes the operations supported by :doc:`the economic +protocol <./protocol>` that implement *enabled* features -- that is, +those available to end-users on Tezos Mainnet. The complete list of +operations, including those corresponding to features in development +or available only on test networks, is given in the +:package-api:`OCaml Documentation +`. + +.. _validation_passes_mumbai: + +Validation Passes +~~~~~~~~~~~~~~~~~ + +The different kinds of operations are grouped into classes. Each class +has an associated index, a natural number, also known as a +:ref:`validation pass`. There are currently four classes +of operations: :ref:`consensus `, +:ref:`voting `, +:ref:`anonymous`, and :ref:`manager +operations`. This order also specifies the +:ref:`validation and application` priority +of each of these classes. Consensus operations are considered the +highest priority ones, and manager operations the lowest. + +The current protocol implementation enforces the following invariant: + +- each kind of operation belongs to *at most one* validation pass; +- operations whose kind does not belong to any validation pass cannot + be :ref:`applied`. + +.. FIXME tezos/tezos#3915: + + Failing noops don't fit within any of the validation passes + below. We need to change the structure a bit to be able to list + them here. + +In the sequel, we describe the different classes of operations, and +the different kinds of operations belonging to each class. + +.. _consensus_operations_mumbai: + +Consensus Operations +~~~~~~~~~~~~~~~~~~~~ + +.. TODO tezos/tezos#4204: document PCQ/PQ + +Consensus operations are administrative operations that are necessary +to implement the :doc:`consensus algorithm`. There are two +kinds of consensus operations, each belonging to the different voting +phases required to agree on the next block. + +- A ``Preendorsement`` operation implements a first vote for a + :ref:`candidate block ` with the aim of + building a :ref:`preendorsement quorum `. + +- An ``Endorsement`` operation implements a vote for a candidate block + for which a preendorsement quorum certificate (PQC) has been + observed. + +.. _voting_operations_mumbai: + +Voting Operations +~~~~~~~~~~~~~~~~~ + +Voting operations are operations related to the on-chain :doc:`Tezos +Amendment` process. In this economic protocol, there are two +voting operations: + +- The ``Proposal`` operation enables delegates to submit (also known as + to "inject") protocol amendment proposals, or to up-vote previously + submitted proposals, during the Proposal period. + +- The ``Ballot`` operation enables delegates to participate in the + Exploration and Promotion periods. Delegates use this operation to + vote for (``Yay``), against (``Nay``), or to side with the majority + (``Pass``), when examining a protocol amendment proposal. + +Further details on each operation's implementation and semantics are +provided in the dedicated entry for :ref:`on-chain +governance`. + +.. _anonymous_operations_mumbai: + +Anonymous Operations +~~~~~~~~~~~~~~~~~~~~ + +This class groups all operations that do not require a signature from +a Tezos account (with an exception, detailed below). They implement +different functionalities of the protocol, and their common +characteristic is that they allow the account originating these +operations to remain anonymous in order to avoid censorship. + +Two operations in this class implement functionality pertaining to the +protocol's :doc:`random seeds generation +mechanism`: + +- The ``Seed_nonce_revelation`` operation allows a baker to + anonymously reveal the nonce seed for the commitment it had included + in a previously baked block (in the previous cycle). + +- The ``Vdf_revelation`` operation allows the submission of a solution + to, and a proof of correctness of, the :ref:`VDF + challenge` corresponding to the VDF revelation period of + the randomness generation protocol. + +Further details on the latter operation's implementation and semantics +are provided in the :ref:`random seed generation +protocol`. + +Three operations in this class are used to :ref:`punish participants +which engage in Byzantine behaviour` -- notably +delegates which :ref:`"double sign" ` blocks, or emit +conflicting :ref:`consensus operations`: + +- The ``Double_preendorsement_evidence`` operation allows for accusing + a delegate of having *double-preendorsed* -- i.e., of having + preendorsed two different block candidates, at the same level and at + the same round. The bulk of the evidence, the two arguments + provided, consists of the two offending preendorsements. + +- Similarly, the ``Double_endorsement_evidence`` operation allows for + accusing a delegate of having *double-endorsed* -- i.e., of having + endorsed two different block candidates at the same level and the + same round -- by providing the two offending endorsements. + +- The ``Double_baking_evidence`` allows for accusing a delegate of + having "double-baked" a block -- i.e., of having signed two + different blocks at the same level and at same round. The bulk of + the evidence consists of the :ref:`block + headers` of each of the two offending blocks. + +See :ref:`here` for further detail on the semantics of +evidence-providing operations. + +The ``Activation`` operation allows users which participated in the +Tezos fundraiser to make their :ref:`accounts ` operational. + +Finally, the ``Drain_delegate`` operation allows an active +consensus-key account, i.e., an account to which a baker delegated its +consensus-signing responsibility, to **empty** its delegate +account. This operation is used as a deterrent to ensure that a +delegate secures its consensus key as much as its manager (or main) +key. + +.. _manager_operations_mumbai: + +Manager Operations +~~~~~~~~~~~~~~~~~~ + +.. FIXME tezos/tezos#3936: integrate consensus keys operations. + +.. FIXME tezos/tezos#3937: + + Document increased paid storage manager operation. + +Manager operations enable end-users to interact with the Tezos +blockchain -- e.g., transferring funds or calling :doc:`smart +contracts`. A manager operation is issued by a single +*manager* account which signs the operation and pays the +:ref:`fees` to the baker for its inclusion in a block. Indeed, +manager operations are the only fee-paying and +:ref:`gas-consuming` operations. + +- The ``Reveal`` operation reveals the public key of the sending + manager. Knowing this public key is indeed necessary to check the signature + of future operations signed by this manager. +- The ``Transaction`` operation allows users to either transfer tez + between accounts and/or to invoke a smart contract. +- The ``Delegation`` operation allows users to :ref:`delegate their + stake ` to a :ref:`delegate` (a + *baker*), or to register themselves as delegates. +- The ``Update_consensus_key`` operation allows users to delegate the + responsibility of signing blocks and consensus-related operations to + another account. Note that consensus keys cannot be BLS public keys. +- The ``Origination`` operation is used to + :ref:`originate`, that is to deploy, smart contracts + in the Tezos blockchain. +- The ``Set_deposits_limit`` operation enables delegates to adjust the + amount of stake a delegate :ref:`has locked in + bonds`. +- Support for registering global constants is implemented with the + ``Register_global_constant`` operation. +- The ``Increase_paid_storage`` operation allows a sender to increase + the paid storage of some previously deployed contract. +- The ``Event`` operation enables sending event-like information to + external applications from Tezos smart contracts -- see + :doc:`Contract Events` for further detail. + +Moreover, all operations necessary to implement Tezos' *enshrined* +Layer 2 solutions into the economic protocol are also manager +operations: + +.. FIXME tezos/tezos#3916: expand documentation of TORU operations. + +- :doc:`Transaction Optimistic Rollups` are + implemented using the following manager operations: + ``Tx_rollup_origination``, ``Tx_rollup_submit_batch``, + ``Tx_rollup_commit``, ``Tx_rollup_return_bond``, + ``Tx_rollup_finalize_commitment``, ``Tx_rollup_remove_commitment``, + ``Tx_rollup_rejection``, ``Tx_rollup_rejection``, + ``Transfer_ticket``. + +.. _manager_operations_batches_mumbai: + +Manager Operation Batches +""""""""""""""""""""""""" + +Manager operations can be grouped, forming a so-called +**batch**. Batches enable the inclusion of several manager operations +from the same manager in a single block. + +Batches satisfy the following properties: + +- All operations in a batch are issued by the same manager, which + provides a single signature for the entire batch. +- A batch is :ref:`applied` + atomically: all its operations are executed sequentially, without + interleaving other operations. Either all the operations in the + batch succeed, or none is applied. diff --git a/docs/mumbai/cli-commands.rst b/docs/mumbai/cli-commands.rst new file mode 100644 index 000000000000..9f9be362cc8f --- /dev/null +++ b/docs/mumbai/cli-commands.rst @@ -0,0 +1,41 @@ +********************** +Command Line Interface +********************** + +This document is a prettier output of the documentation produced by +the command ``man`` of the different Octez binaries. You can obtain similar pages +using shell commands such as (:ref:`indicating the appropriate protocol `): + +:: + + octez-client -protocol man -verbosity 3 + +The rest of this page documents the protocol-dependent tools. +The protocol-independent tools are documented :doc:`here <../shell/cli-commands>`. + + +.. _client_manual_mumbai: + +Client manual +============= + +.. raw:: html + :file: octez-client.html + + +.. _baker_manual_mumbai: + +Baker manual +============ + +.. raw:: html + :file: octez-baker.html + + +.. _accuser_manual_mumbai: + +Accuser manual +============== + +.. raw:: html + :file: octez-accuser.html diff --git a/docs/mumbai/consensus.rst b/docs/mumbai/consensus.rst new file mode 100644 index 000000000000..f0f44f515f97 --- /dev/null +++ b/docs/mumbai/consensus.rst @@ -0,0 +1,505 @@ +The consensus algorithm +======================= + +This document provides a high-level description of Tenderbake, the Tezos +:doc:`proof-of-stake` consensus algorithm. + +History +------- + +Before Tenderbake, there was +`Emmy* `_, +a Nakamoto-style consensus consisting of a series of improvements of the one in +the `Tezos whitepaper `_. + +Emmy*, like any Nakamoto-style consensus algorithm (such as `Bitcoin +`_ or `Ouroboros +`_), offers *probabilistic* +finality: forks of arbitrary length are possible but they collapse +with a probability that increases rapidly with fork length. + +`Tenderbake `_ instead, like any classic +BFT-style consensus algorithm (such as +`PBFT `_ or +`Tendermint `_), offers *deterministic* +finality: a block that has just been appended to the chain of some node is known +to be final once it has two additional blocks on top of it, regardless of +network latency. + + +Overview +-------- + +The starting point for Tenderbake is +`Tendermint `_, the first classic-style algorithm +for blockchains. + +Tenderbake adapts Tendermint to the Tezos blockchain, but the adjustments +required are +`substantive `_: + +* Tenderbake is tailored to match the Tezos architecture by using only + communication primitives and network assumptions which Tezos supports. +* Tenderbake makes weaker network assumptions than Tendermint, at the price of + adding the extra assumption that participants have loosely synchronized clocks + — which is fine, because Tezos already uses them. + +The design of Tenderbake and its rationale are described at +length in the `technical report `_ and in a +`Nomadic Labs's blog +post `_. Here we +only provide a user/developer perspective. + +.. _tb_validator_mumbai: + +Tenderbake is executed for each new block level by a "committee" whose members +are called *validators*, which are delegates selected at random based on their +stake, in the same way as endorsers are selected in Emmy*. We let +``CONSENSUS_COMMITTEE_SIZE`` be the number of validator :ref:`slots` per level. +Furthermore, we use ``CONSENSUS_THRESHOLD`` to denote two thirds of ``CONSENSUS_COMMITTEE_SIZE``. + +For each level, Tenderbake proceeds in rounds. Each *round* represents an +attempt by the validators to agree on the content of the block for the current +level, that is, on the sequence of non-consensus operations the block contains. +We call this sequence the block's *payload*. + +Each round has an associated duration. Round durations are set to increase so +that for any possible message delay, there is a round that is sufficiently long +for all required messages to be exchanged. +Round durations depend on protocol parameters ``MINIMAL_BLOCK_DELAY`` and ``DELAY_INCREMENT_PER_ROUND``. +These parameters specify round durations as follows: + +.. math:: + + round\_duration(0) &= minimal\_block\_delay \\ + round\_duration(r+1) &= round\_duration(r) + delay\_increment\_per\_round \\ + & = minimal\_block\_delay + (r + 1) * delay\_increment\_per\_round + +Round durations thus increase linearly with ``DELAY_INCREMENT_PER_ROUND``. + +Schematically, a round consists in the following steps: + +.. _candidate_block_mumbai: + +* a validator designated for that round injects a *candidate block* (representing a proposal) and consensus operations (representing votes) into the node to which it is attached, which then +* diffuses those blocks and consensus operations to other nodes of the network, and thus +* communicates them to the validators attached to those nodes, to carry out voting on which block to accept. + +.. _quorum_mumbai: + +Unlike Emmy*, Tenderbake has `two types of +votes `_: +before endorsing a block ``b``, a validator preendorses ``b``. Furthermore, +to be able to endorse, a validator must have observed a preendorsement *quorum*, that is a +set of preendorsements from validators having at least ``CONSENSUS_THRESHOLD`` validator slots. Similarly, to be able to decide, a validator must have observed an endorsement quorum, that is, a set of endorsements from validators having at least ``CONSENSUS_THRESHOLD`` validator slots. The +endorsement quorum for a block ``b`` is included in a block ``b'`` on top of ``b``, +serving as a certification that ``b`` has been agreed upon. +We also say that block ``b'`` confirms block ``b``. + +The validator's whose turn is to inject a candidate block at a given round is +called the *proposer* at that round. Proposers in Tenderbake are selected +similarly to bakers in Emmy*: the proposer at round ``r`` is the +validator who has the validator slot ``r``. A proposer who has observed a +preendorsement quorum for a candidate block in a previous round, is required to propose a block with +the same *payload* as +the initial block. We talk about a *re-proposal* in this case. + + +.. _finality_mumbai: + +Transaction and block finality +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A transaction is final as soon as the block including it has a confirmation (that is, a block on top of it). +Indeed, as hinted above, a block contains the certification (that is, the endorsement quorum) for the previous +payload. Thanks to the endorsement quorum, Tenderbake guarantees **transaction finality +after 1 confirmation**. + +It may be possible that different validators decide at different rounds, though on the same payload. The blocks at these different rounds differ precisely because they contain, in the header, as part of the block fitness, +the round at which they were proposed. +Among these "candidate" blocks, the block with the smallest round has the highest fitness and so it will be the one decided. +Consequently, to agree on a block, that is, on both the payload and the header, Tenderbake needs one more +confirmation, and thus guarantees +**block finality after 2 confirmations**. + +Time between blocks +~~~~~~~~~~~~~~~~~~~~~~~ + +The time between blocks represents the difference between the timestamps of the blocks. The timestamp of a block is given by the beginning of the round at which the block has been agreed upon. Thus, the time between blocks depends on the round at which decisions are taken. For +example, if the decision at the previous level was taken at round 4 and at the current level at round 2, then the current block's delay relative to +its predecessor, is :math:`round\_duration(4) + round\_duration(0) + round\_duration(1)`. +The general case is as follows, say that the decision at the previous +level is taken at round ``m`` and the decision at the current level is +taken at round ``n``, then the current block's delay relative to its +predecessor is :math:`round\_duration(m) + \sum_{i=0}^{n-1} round\_duration(i)`. +We note that, under +normal network conditions, and with active and compliant validators, decisions +should be taken at round 0, meaning that the time between blocks would be +:math:`round\_duration(0)` seconds i.e., parameter ``MINIMAL_BLOCK_DELAY``. + + +.. _active_stake_mumbai: + +Validator selection: staking balance, active stake, and frozen deposits +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Validator selection is based on the stake, as in Emmy*, with the exception that +it is based on the delegate's *active stake* instead of its *staking +balance*. Let us first (re)define these and related concepts. + +- The *(maximal) staking balance* of a delegate is its full balance (i.e. all the tokens owned by the delegate) plus the + balances of all accounts that have delegated to it. + It must be at least ``TOKENS_PER_ROLL`` tez, otherwise the delegate cannot be selected as a validator. +- The *active stake* of a delegate is the amount of tez with which + it participates in consensus. It is at most its + staking balance. We explain below how it is computed. +- The *frozen deposit* represents a percentage ``FROZEN_DEPOSIT_PERCENTAGE`` + of the maximum active stake during the last ``PRESERVED_CYCLES + MAX_SLASHING_PERIOD``. This amount + represents the delegate's skin in the game: in the case that the + delegate behaves badly, its frozen deposit is partly slashed (see + :ref:`slashing_mumbai`). Taking the maximum over an + interval of cycles (instead of just considering the active stake at + the cycle where the bad action can occur) allows to avoid situations + where a malicious delegate empties its accounts between the time when + rights are attributed and the time when the deposit is frozen. The frozen deposits are updated at the end of each cycle. +- The *spendable balance* of a delegate is its full balance + minus the frozen deposits. + +We state next the RPCs which allow to retrieve these types of balances, and also some invariants about them +(Note that these are just invariants, not definitions; for +instance, the frozen deposits are computed in terms of the full balance, +not the other way around.): + +- ``delegated balance`` represents the total amount of tokens delegated by others to a + given delegate; it excludes the delegate's full balance; it is obtained + with ``../context/delegates//delegated_balance`` +- ``staking balance = full balance + delegated balance``; it is obtained with + ``../context/delegates//staking_balance`` +- ``full balance = spendable balance + frozen deposit``; it is obtained with + ``../context/delegates//full_balance`` +- ``frozen deposit`` is obtained with ``../context/delegates//frozen_deposits`` +- ``spendable balance`` is obtained with ``../context/contracts//balance`` + +Delegates can set an upper limit to their frozen deposits with the +command ``octez-client set deposits limit for to +``, and unset this limit with the command ``octez-client +unset deposits limit for ``. These commands are implemented +using a new manager operation ``Set_deposits_limit``. When emitting such a +command in cycle ``c``, it affects the active stake for cycles starting +with ``c + PRESERVED_CYCLES + 1``; the new active stake is +taken into account when computing the frozen deposit for cycle ``c+1`` +already, however the user may see an update to its frozen deposit at +cycle ``c + PRESERVED_CYCLES + MAX_SLASHING_PERIOD`` at the +latest (because up to that cycle the frozen deposit also depends on the +active stake at cycles before cycle ``c+1``). + +The active stake is computed ``PRESERVED_CYCLES`` in advance: at +the end of cycle ``c`` for cycle ``c + 1 + PRESERVED_CYCLES`` (as in Emmy*), +before updating the delegates' :ref:`activity status`. + +.. + This entails that a delegate which was participating until cycle ``c - + 1`` and is no longer participating in cycle ``c`, + will lose its rights from cycle + ``c + 2 * PRESERVED_CYCLES + 2`` onwards -- at the end of cycle ``c + + PRESERVED_CYCLES``, the rights for cycle ``c + 2 * + PRESERVED_CYCLES + 1`` are computed, and only then is the delegate + declared passive. Here "participation" means *having baked a final + block* or *having a preendorsement or endorsement included in a final + block*. + +Intuitively, the active stake is set to 10 times the delegate's chosen frozen +deposit limit, without going beyond its available staking balance, +nor its maximum staking capacity (determined by its full balance). +More precisely, the active stake is the minimum between: + +- the delegate's staking balance, and +- 10 times the delegate's *deposit cap*, i.e. ``deposit_cap * 100 / deposit_percentage``. If the delegate has not set a frozen deposit limit, ``deposit_cap`` is its full balance. Otherwise ``deposit_cap`` is the minimum between its full balance and the frozen deposit limit set by the delegate. + +Let's take some examples. Say that the full balance of a delegate is ``1000`` tez. +Then its theoretical maximum staking balance is +``10000`` tez. The following table lists some scenarios (assuming for +simplicity no changes in the delegate's full and staking balances +during the last 8 cycles). + +.. list-table:: + :widths: 20 20 20 20 20 + :header-rows: 1 + + * - Staking balance + - Frozen deposit limit + - Active stake + - Frozen deposit + - Spendable balance + * - 9000 + - -- + - 9000 + - 900 + - 100 + * - 12000 + - -- + - 10000 + - 1000 + - 0 + * - 9000 + - 400 + - 4000 + - 400 + - 600 + * - 12000 + - 400 + - 4000 + - 400 + - 600 + +We note in passing that this new schema basically solves the main +problem of over-delegation: a delegate will not fail anymore to bake +and endorse because of an insufficient balance to pay the +deposit. However, a delegate can still be over-delegated, and it will be +rewarded based on its active stake, not on its staking balance. + +Economic Incentives +~~~~~~~~~~~~~~~~~~~ + +As Emmy*, Tenderbake rewards participation in consensus and punishes bad +behavior. Notable changes however are as follows: + +* Fees and baking rewards go to the payload producer, the one who selected the + transactions to be included in the block (and was the first to propose a + block with that payload). In case of re-proposal, the payload producer might + be different from the block proposer, the baker who injects the block. +* Including extra endorsements, that is, more than the minimal required to + obtain a quorum, is rewarded with a bonus. +* Endorsing rewards are shared equally among all validators. Participation above + a minimal threshold per cycle is however required. +* Deposits are no longer frozen and unfrozen, instead a percentage of the active stake is always locked. +* Validators are rewarded instantaneously for baking blocks and including extra endorsements, and not at the end of the cycle like in Emmy*. +* At the end of a cycle ``c``, the following actions happen: + + - the selection of the consensus committee cycle ``c + PRESERVED_CYCLES``, based on the current active stake distribution, + - the distribution of endorsing rewards, + - the adjustment of frozen deposits. + + +Fees +^^^^ + +The fees associated to the transactions included in a block go to the payload +producer. This is only natural given that this is the validator that selects the +transactions to be included; see `an in-depth blog +post `_ for further motivation. + +The payload producer is usually the same delegate as the block +proposer (that is, the one that signs and injects the block): that's +always true for blocks at round 0; however, in case of re-proposals +this is not necessarily the case (see the algorithm description above). + +Fees are given to the payload producer immediately, that is, they are +already reflected in the blockchain state obtained after applying the injected +block. + +Rewards +^^^^^^^ + +There are three kinds of rewards: baking rewards, endorsing rewards, and a bonus for including extra endorsements. + +The baking rewards are treated in the same way as fees: they go to the *payload* +producer and are distributed immediately. + +To encourage fairness and participation, the *block* proposer receives +a bonus for the extra endorsements it includes in the block. +The bonus is proportional to the number of +validator slots above the threshold of ``CONSENSUS_COMMITTEE_SIZE * 2 / 3`` that +the included endorsements represent. The bonus is also distributed +immediately. + +The endorsing rewards are distributed at the end of the cycle. +The endorsing reward may be received even if not all of the validator's endorsements are included in a block and is proportional to the validator's active stake (in other words, to its *expected* number of validator slots, and not its actual number of slots). +However, two conditions must be met: + + - the validator has revealed its nonce, and + - the validator has been present during the cycle. + +Not giving rewards in case of missing revelations is not new as it is :ref:`adapted` +from Emmy*. +The second condition is new. We say that a delegate is *present* during a cycle +if the endorsing power (that is, the number of validator slots at the +corresponding level) of all the endorsements included by the delegate during the +cycle represents at least ``MINIMAL_PARTICIPATION_RATIO`` of the delegate's expected number of +validator slots for the current cycle (which is ``BLOCKS_PER_CYCLE * +CONSENSUS_COMMITTEE_SIZE * active_stake / total_active_stake``). + +Regarding the concrete values for rewards, we first fix the total reward per +level, call it ``total_rewards``, to ``80 / blocks_per_minute`` tez. +Assuming ``blocks_per_minute = 2``, ``total_rewards`` is 40 tez. +We define: + +- ``BAKING_REWARD_FIXED_PORTION := baking_reward_ratio * total_rewards`` +- ``bonus := (1 - baking_reward_ratio) * bonus_ratio * total_rewards`` is the max bonus +- ``endorsing_reward := (1 - baking_reward_ratio) * (1 - bonus_ratio) * total_rewards`` + +where: + +- ``baking_reward_ratio`` to ``1 / 4``, +- ``bonus_ratio`` to ``1 / 3``. + +Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 10`` tez, +(maximum) ``bonus = 10`` tez, and ``endorsing_rewards = 20`` tez. +The bonus per additional endorsement slot is in turn ``bonus / +(CONSENSUS_COMMITTEE_SIZE / 3)`` (because there are at most +``CONSENSUS_COMMITTEE_SIZE / 3`` validator slots corresponding to the +additional endorsements included in a block). The rewards per +endorsement slot are ``endorsing_rewards / CONSENSUS_COMMITTEE_SIZE``. +Assuming ``CONSENSUS_COMMITTEE_SIZE = 7000``, we obtain a bonus per slot of +``10 / (7000 / 3) = 0.004286`` tez and an endorsing +rewards per slot of ``20 / 7000 = 0.002857`` tez. + +Let's take an example. Say a block has round 1, is proposed by +delegate B, and contains the payload from round 0 produced by delegate +A. Also, B includes endorsements with endorsing power ``5251``. Then A receives +the fees and 10 tez (the ``BAKING_REWARD_FIXED_PORTION``) as a reward for +producing the block's payload. Concerning the bonus, given that +``CONSENSUS_COMMITTEE_SIZE = 7000``, the minimum required validator slots is ``4667``, and there are ``2333 = 7000 - 4667`` additional validator slots. +Therefore B receives the bonus ``(5251 - 4667) * 0.004286 = 2.503`` tez. (Note +that B only included endorsements corresponding to 584 = 5251 - 4667 additional validator slots, about a quarter of the +maximum 2333 extra endorsements it could have theoretically included.) Finally, consider some +delegate C, whose active stake at some cycle is 5% of the total stake. Note that +his expected number of validator slots for that cycle is ``5/100 * 8192 * 7000 = +2,867,200`` slots. Assume also that the endorsing power of C's endorsements +included during that cycle has been ``2,123,456`` slots. Given that this number is +bigger than the minimum required (``2,867,200 * 2 / 3``), it receives an endorsing +reward of ``2,867,200 * 0.002857 = 8191.59`` tez for that cycle. + +.. _slashing_mumbai: + +Slashing +^^^^^^^^ + +Like in Emmy*, not revealing nonces and double signing are punishable. If a +validator does not reveal its nonce by the end of the cycle, it does not receive +its endorsing rewards. If a validator double signs, that is, it double bakes +(which means signing different blocks at the same level and same round) or +it double (pre)endorses (which means voting on two different proposals at the +same level and round), a part of the frozen deposit is slashed. The slashed amount for double baking +is ``DOUBLE_BAKING_PUNISHMENT``. The slashed amount for double (pre)endorsing is +a fixed percentage ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` +of the frozen deposit. The payload producer that includes the misbehavior +evidence is rewarded half of the slashed amount. + +The evidence for double signing at a given level can be collected by any +:ref:`accuser` and included as an *accusation* operation in a block +for a period of ``MAX_SLASHING_PERIOD``. + +We note that selfish baking is not an issue in Tenderbake: say we are at round +``r`` and the validator which is proposer at round ``r+1`` does not (pre)endorse +at round ``r`` in the hope that the block at round ``r`` is not agreed upon and +its turn comes to propose at round ``r+1``. Under the assumption that the +correct validators have more than two thirds of the total stake, these correct +validators have sufficient power for agreement to be reached, thus the lack of +participation of a selfish baker does not have an impact. + +.. _cs_constants_mumbai: + +Consensus related protocol parameters +------------------------------------- + +.. list-table:: + :widths: 55 25 + :header-rows: 1 + + * - Parameter name + - Parameter value + * - ``CONSENSUS_COMMITTEE_SIZE`` + - 7000 + * - ``CONSENSUS_THRESHOLD`` + - ``ceil(2 * CONSENSUS_COMMITTEE_SIZE / 3)`` = 4667 + * - ``MINIMAL_BLOCK_DELAY`` + - 30s + * - ``DELAY_INCREMENT_PER_ROUND`` + - 15s + * - ``MINIMAL_PARTICIPATION_RATIO`` + - 2/3 + * - ``FROZEN_DEPOSITS_PERCENTAGE`` + - 10 + * - ``MAX_SLASHING_PERIOD`` + - 2 cycles + * - ``DOUBLE_BAKING_PUNISHMENT`` + - 640 tez + * - ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` + - 1/2 + * - ``BAKING_REWARD_FIXED_PORTION`` + - 10 tez + * - ``BAKING_REWARD_BONUS_PER_SLOT`` + - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.004286 tez + * - ``ENDORSING_REWARD_PER_SLOT`` + - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez + +These are a subset of the :ref:`protocol constants `. + +.. _shell_proto_revisit_mumbai: + +Shell-protocol interaction revisited +------------------------------------ + +.. FIXME tezos/tezos#3914: + + Integrate protocol-specific block parts in the blocks and ops + entry. + +:ref:`Recall` that, for the shell to interact with the economic protocol, two notions are defined abstractly at the level of the shell and made concrete at the level of the consensus protocol. +Namely, these two notions are the protocol-specific header and the fitness. +As in Emmy*, the protocol-specific header contains the fields: + +- ``signature``: a digital signature of the shell and protocol headers (excluding the signature itself) +- ``seed_nonce_hash``: a commitment to :ref:`a random number`, used to generate entropy on the chain +- ``proof_of_work_nonce``: a nonce used to pass a low-difficulty proof-of-work for the block, as a spam prevention measure +- ``liquidity_baking_toggle_vote``: :ref:`a vote` to continue the Liquidity Baking Subsidy, stop it, or abstain. + +There are two additional fields: ``payload_hash`` and ``payload_round`` which are needed for establishing if a block is :ref:`final`. + +.. _fitness_mumbai: + +The fitness is given by the tuple ``(version, level, locked_round, - predecessor_round - 1, round)``. +The current version of the fitness is 2 (version 0 was used by Emmy, and version 1 by Emmy+ and Emmy*). +The fitness encapsulates more information than in Emmy* because Tenderbake is more complex: recall that blocks at the last level only represent :ref:`candidate blocks`. +In Emmy*, only the level mattered. +But in Tenderbake, we need to, for instance, allow for new blocks at the same level to be accepted by nodes. +Therefore the fitness also includes the block's round (as the fifth component). +Furthermore, we also allow to change the predecessor block when it has a :ref:`smaller round`. +Therefore the fitness also includes the opposite of predecessor block's round as the forth component (the predecessor is taken for technical reasons). +Finally, to (partially) enforce :ref:`the rule on +re-proposals`, the fitness also includes, as the third +component, the round at which a preendorsement quorum was observed by +the baker, if any (this component can therefore be empty). By the way, +preendorsements are present in a block if and only if the locked round +component is non-empty and if so, the locked round has to match the +round of the included preendorsements. + +Next, we provide two examples of fitness values: +``02::00001000::::ffffffff::00000000`` and +``02::00001000::00000000::fffffffe::00000001`` (in the hexadecimal +format that one may observe in the node's logs). These two values have +the following components: + +- the 1st component, ``02``, is the fitness version; +- the 2nd component, ``00001000``, is the block's level (level 4096); +- the 3rd component is the block's locked round: empty in the first case, 0 in the second; +- the 4th component is the round of the predecessor block, here 0 in the first case and 1 in the second case; +- the 5th component is the block's round: 0 in the first case, 1 in the second case. + +We recall (see :ref:`shell_header`) that the fitness is, from the +shell's perspective, a sequence of sequences of unsigned bytes and +comparison is done first by the length of the sequence and then +lexicographically (both for the outer sequence, and for each of the +inner sequences). So the first fitness is smaller than the second one, +because of the third component, the empty bitstring being smaller than +any other bitstring. + + + +Further External Resources +-------------------------- + +* Tenderbake `report `_ +* Tenderbake `blog post `_. +* Tenderbake `tzip `_. diff --git a/docs/mumbai/event.rst b/docs/mumbai/event.rst new file mode 100644 index 000000000000..9f355d18dace --- /dev/null +++ b/docs/mumbai/event.rst @@ -0,0 +1,111 @@ +Contract events +=============== + +Contract events provide a way for contracts to deliver event-like information to external applications. +This mechanism allows off-chain applications to react to Tezos contracts execution. + + +Sending events +-------------- +Contract events can be emitted by invoking the Michelson instruction ``EMIT``. +``EMIT %tag ty`` pops an item of type ``ty`` off the stack and pushes an ``operation`` onto the stack. +The type ascription ``ty`` is special since annotations in ``ty`` are preserved and eventually transmitted +in the event so that indexers have a choice to present the event body with appropriate labels. +Both the ``ty`` type ascription and ``%tag`` are optional. +If ``ty`` is absent, this type is inferred from the type of the top element of the stack. +If ``%tag`` is absent, no tag is attached to the event. + +To actually send out the events, most importantly, the produced ``operation``\s must be included in the list of +operations, along with ``TRANSFER_TOKEN`` operations for example, that the contract wants to effect. + +Event +----- + +Each successful contract execution attaches into the transaction receipt a list of contract events +arranged in the order of appearance in the resultant list of operations. +There, the events are made ready for consumption by services observing the chain. + +Example +------- +Suppose a contract wants to emit events with the following type: + +:: + + or (nat %int) (string %str) + +Then, this contract may generate an event emission operation with the following instructions. +Note that the ``EMIT`` instruction will emit an event with a tag ``notify_client``. +In addition, it allows indexers to recognise the two variants as ``int`` and ``str`` and, +therefore, be able to present the values with the appropriate variant labels. + +:: + + PUSH string "right"; + RIGHT nat; + EMIT %notify_client (or (nat %int) (string %str)); + + +Retrieving events +----------------- +Events successfully emitted can be read off directly from transaction results. +This is typically achieved by making JSON RPCs to the block service. +It will return a list of operations, each including the event entries with the information above. + +Here is a sample result from a call, corresponding to the example above. + +:: + + { + "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK", + "hash": "opNX59asPwNZGu2kFiHFVJzn7QwtyaExoLtxdZSm3Q3o4jDdSmo", + // ... fields elided for brevity + "contents": [ + { + "kind": "transaction", + // ... fields elided for brevity + "metadata": { + // ... fields elided for brevity + "internal_operation_results": [ + { + "kind": "event", + // ... fields elided for brevity + "source": "KT1M1ynE3YXkM7qLZoMppq6szMbBvxX9yQVL", + "nonce": 0, + "type": { + "prim": "or", + "args": [ + { + "prim": "nat", + "annots": [ + "%int" + ] + }, + { + "prim": "string", + "annots": [ + "%str" + ] + } + ] + }, + "tag": "notify_client", + "payload": { + "prim": "Right", + "args": [ + { + "string": "right" + } + ] + }, + "result": { + "status": "applied", + "consumed_milligas": "1000000" + } + } + ] + } + } + ] + } + +Note that the ``operation`` produced by ``EMIT`` does not constitute a call to any other contract. diff --git a/docs/mumbai/global_constants.rst b/docs/mumbai/global_constants.rst new file mode 100644 index 000000000000..383f3e0e3fd2 --- /dev/null +++ b/docs/mumbai/global_constants.rst @@ -0,0 +1,141 @@ +Global Constants +================ + +The size limit for :doc:`Michelson ` contracts is quite small, limited to 60 +kilobytes as of Granada protocol. Global constants are a feature added +in Hangzhou protocol that enables the re-use of user-defined Micheline chunks in Michelson scripts, allowing +for larger and more complex contracts on the chain. It works in the +following way: + +- Fragments of Michelson code (written in the :doc:`Micheline format <../shell/micheline>`) are + registered on the chain via a new operation + ``register_global_constant``. An example expression might be the + integer ``999`` or the lambda expression ``{ PUSH int 999; ADD }`` +- Included in the receipt of the operation is a hash of the expression + registered. For example the hash ``999`` is + ``expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8``. +- Constants can be referenced inside a Michelson script with the new + primitive ``constant``. For example, we could write a lambda + equivalent to the one above like so: + ``{ PUSH int (constant "expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8"); ADD }`` + +Global Constant Registration +---------------------------- + +The new ``register_global_constant`` operation includes an object with a +single key ``"value"``, the value of which is the Micheline expression +to be registered. + +You can submit this operation conveniently through a new :doc:`octez-client ` command. +For example, the command: + +.. code:: sh + + octez-client register global constant "999" from bootstrap1 --burn-cap 0.017 + +would result in the output: + +:: + + Node is bootstrapped. + Estimated gas: 1440 units (will add 100 for safety) + Estimated storage: 68 bytes added (will add 20 for safety) + Operation successfully injected in the node. + Operation hash is 'onsFknW5iWa6eiTYqAghY4peQZ7JYQUJg5fR8MwAQkMKjXfNqGf' + NOT waiting for the operation to be included. + Use command + octez-client wait for onsFknW5iWa6eiTYqAghY4peQZ7JYQUJg5fR8MwAQkMKjXfNqGf to be included --confirmations 5 --branch BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU + and/or an external block explorer to make sure that it has been included. + This sequence of operations was run: + Manager signed operations: + From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx + Fee to the baker: ꜩ0.000385 + Expected counter: 1 + Gas limit: 1540 + Storage limit: 88 bytes + Balance updates: + tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ................ -ꜩ0.000385 + fees(the baker who will include this operation,0) ... +ꜩ0.000385 + Register Global: + Value: 999 + This global constant registration was successfully applied + Balance updates: + tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.017 + Consumed gas: 1440 + Storage size: 68 bytes + Global address: expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8 + +As you can see, the address of the constant is returned in the operation +receipt in the field ``Global address``. This address is the Base58-encode Blake2b +hash of the binary serialization of the registered Micheline expression. +This means constants are content-addressable - given a particular Micheline +expression, you can always calculate its on-chain address and check if it’s registered. + +A few points about registering global constants: + +- Global constants may contain references to other constants; however, + any referenced constants must already be registered on the chain. As a + corollary, you cannot have cyclic references. +- Global constants are not type-checked before registration - any + valid Micheline expression may be registered. That said, attempting + to originate a contract that uses a constant in an ill-typed way will + fail. +- The total depth of the expression registered as a constant (after + expanding all constant references) may not exceed 10,000. +- The total number of nodes in the Micheline expression being + registered (after expanding all constant references) may not exceed + the ``max_micheline_node_count`` protocol constant. As of Hangzhou + this is 50,000. +- The total number of bytes in the Micheline expression being + registered (after expanding all constant references) may not exceed + the ``max_micheline_bytes_limit`` protocol constant. As of Hangzhou + this is 50,000. + +Originating a Contract that uses Global Constants +------------------------------------------------- + +A global constant can be referenced in Michelson scripts via the +primitive ``constant``, which accepts a single string argument, being +the hash of the expression to be referenced at runtime. This primitive +can be used to replace any Micheline node in the bodies of the +``parameter``, ``storage``, ``code``, or ``view`` fields of a Michelson script. For +example, we replace every instance of the type ``lambda unit unit`` and +value 999 with their respective hashes: + +.. code-block:: michelson + + parameter (constant "exprtYirrFwYKm6yKLzJNtYRbq49zedYq16BonRvMzHiwSbUekB9YL"); + storage (big_map int (constant "exprtYirrFwYKm6yKLzJNtYRbq49zedYq16BonRvMzHiwSbUekB9YL")); + code { + PUSH int (constant "expruQN5r2umbZVHy6WynYM8f71F8zS4AERz9bugF8UkPBEqrHLuU8"); + # + }; + +The full expansion of this contract would be: + +.. code-block:: michelson + + parameter (lambda unit unit); + storage (big_map int (lambda unit unit)); + code { + PUSH int 999; + # + }; + +During origination, all constants are expanded recursively. The +operation will fail if the resulting contract is ill-typed. Global +constant expansion consumes gas; thus, the operation may also fail due +to gas exhaustion. + +Global Constants at Runtime +--------------------------- + +Contracts that use global constants are semantically equivalent to the +contract with all constants expanded. + +Note that using the `UNPACK `__ +operation to deserialize a lambda which contains a reference to a global +constant is not supported. Similarly, originating a contract which contains +a reference to a global constant using the +`CREATE_CONTRACT `__ +instruction will also fail. diff --git a/docs/mumbai/glossary.rst b/docs/mumbai/glossary.rst new file mode 100644 index 000000000000..5bd5f81960f7 --- /dev/null +++ b/docs/mumbai/glossary.rst @@ -0,0 +1,231 @@ +Glossary +======== + +This glossary is divided in two sections, the first one concerns Tezos, and +the second one concerns the `economic protocol`_. The definitions in the latter +section may be different for other protocol versions. + +Tezos +----- + +.. include:: ../shell/glossary.rst.h + +Protocol +-------- + +_`Accuser` + When a delegate_ attempts to inject several incompatible blocks (or when it tries + to abuse the network in another similar way), another delegate_ can make an + accusation: show evidence of attempted abuse. The delegate_ making the accusation + is the accuser. + + The accuser is awarded some funds from the security deposit of the accused. + + When using :ref:`Octez `, accusations are handled by the + accuser binary. + +_`Account` + An account is a unique identifier within the protocol. There are different + kinds of accounts (see `originated account`_ and `implicit account`_). + + In the context_, each account is associated with a balance (an amount of + tez available). + +_`Baker` + When a delegate_ creates a new block_, it is the baker of this block_. + Baking_ rights are distributed to different accounts based on their + available balance. Only a delegate_ with baking_ rights + is allowed to bake. + The baker selects transactions from the mempool_ to be included in the block_ it bakes. + + When using :ref:`Octez `, baking_ and other consensus actions are handled by the baker + binary. + +_`Baking`/_`endorsing rights` + A delegate_ is allowed to bake/endorse a block_ if it holds the + baking/endorsing right for that block_. At the start of a cycle_, + baking and endorsing rights are computed for all the block_ levels in the + cycle_, based on the proportion of the stake owned by each account. + + For each block_ level and block round_, there is exactly one account that is allowed to bake. + + When a block_ is created and propagated on the network, delegates that have + `endorsing rights`_ for the matching block_ level can emit an endorsement + operation_. + Endorsement operations_ are included in the next block_. + +_`Burn` + To ensure responsible use of the storage space on the public blockchain, + there are some costs charged to users for consuming storage. These + costs are burnt (i.e., the amount of tez is destroyed). For example, + a per-byte storage cost is burnt for increasing the storage space of a + smart contract; a fixed amount is burnt for allocating a new contract + (which consumes space by storing its address on the blockchain). + + See also `fee`_. + +_`Constants` + Protocols are parameterized by several parameters called protocol constants, which may vary from one protocol to another or from one network to another. + +_`Contract` + See account_. + +_`Cycle` + A cycle is a set of consecutive blocks. E.g., cycle 12 started at block_ + level 49152 and ended at block_ level 53248. + + Cycles are used as a unit of “time” in the blockchain. For + example, the different phases in the amendment voting procedures + are defined based on cycles. + + The length of a cycle is a (parametric) protocol + :ref:`constant`, and thus might change across different + Tezos protocols. + +_`Delegate` + An `implicit account`_ to which an account_ has delegated their + rights to participate in consensus (aka baking_ rights) and in + governance. + The delegate's rights are calculated based on its own tokens plus the sum of tokens + delegated to it. Note that since ``tz4`` accounts cannot be delegates. + +_`Delegation` + An operation_ in which an account_ balance is lent to a + delegate_. This increases the delegate_'s stake and consequently + its baking_ rights. The delegate_ does not control the funds from + the account_. + +_`Double signing` + The action of a baker_ signing two different blocks at the same + level and same round is called *double baking*. Double baking + is detrimental to the network and might be indicative of an + attempt to double spend. The same goes for signing two different + *endorsements* at the same level and the same round. + + Double signing (i.e. double baking or double endorsing) is + punished by the network: an accuser_ can provide proof of the + double signing to be awarded part of the double signer's deposit + -- see :ref:`Slashing`. + +_`Failing Noop` + The ``Failing_noop`` operation implements a *No-op*, which always + fails at :ref:`application time`, and + should never appear in :ref:`applied + blocks`. This operation allows end-users to + :ref:`sign arbitrary messages` which have no + computational semantics. + +_`Fee` + To ensure responsible use of computation resources of other + nodes, and also to encourage active participation in the consensus + protocol, users pay fees to bakers for including (some of) their + operations in blocks. For example, fees are paid to a baker for + operations such as a transaction_ or a revelation of a public key. + + Currently, only :ref:`manager operations` + require collecting fees from its sender account_. + + See also `burn`_. + +_`Gas` + A measure of the number of elementary operations_ performed during + the execution of a `smart contract`_. Gas is used to measure how + much computing power is used to execute a `smart contract`_. + +_`Implicit account` + An account_ that is linked to a public key. Contrary to a `smart + contract`_, an `Implicit account`_ cannot include a script and it + cannot reject incoming transactions. + + If *registered*, an `implicit account`_ can act as a delegate_. + + The address of an `implicit account`_ always starts with the + letters `tz` followed by `1`, `2`, `3` or `4` (depending on the + signature scheme) and finally the hash of the public key. + +_`Layer 1` + The primary blockchain i.e. the Tezos chain. Within any blockchain ecosystem, Layer 1 (L1) refers to the main chain to + which side chains, rollups, or other protocols connect and settle to. The Layer 1 chain is deemed to be most + secure, since it has the most value (or stake) tied to it, and be most decentralized and censorship resistant. + However, transaction space is limited leading to low throughput and possibly high transaction costs. + See `Layer 2`_. + +_`Layer 2` + Layer 2 (L2) includes sidechains, rollups, payment channels, etc. that batch their transactions and + write to the `layer 1`_ chain. By processing transactions on layer 2 networks, + greater scalability in speed and throughput can be achieved by the ecosystem overall, since the number of transactions + the layer 1 can process directly is limited. By cementing transactions from a L2 to L1, + the security of the L1 chain backs those operations. In Tezos there are a number of layer 2 solutions, + including :doc:`TORUs (Transaction Optimistic Rollups) `, + `Smart Optimistic Rollups`_, + validity or ZK-Rollups `Epoxy `_ , + zkChannels, and sidechains such as `Deku `_. + +.. _glossary_michelson_mumbai: + +Michelson + The built-in language used by a `smart contract`_. + +.. _glossary_minimal_stake_mumbai: + +_`Minimal stake` + An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a + delegate to have baking_ and voting rights in a cycle_. + +_`Operations` + The main operations in the protocol are transactions (to transfer funds + or to execute smart contracts), accusations, activations, delegations, + endorsements and originations. + +_`Originated account` + See `smart contract`_. + +_`Origination` + A manager operation_ whose purpose is to create -- that + is, to deploy -- a `smart contract`_ on the Tezos blockchain. + +_`Round` + An attempt to reach consensus on a block at a given level. + A round is represented by an index, starting with 0. + Each round corresponds to a time span. + A baker_ with baking_ rights at a given round is only allowed to bake during + the round's corresponding time span. Baking_ outside of one's designated + round results in an invalid block_. + +_`Roll` + deprecated; see `Minimal stake`_. + +_`Smart contract` + Account_ which is associated to a :ref:`Michelson + ` script. They are created with an + explicit origination_ operation and are therefore sometimes called + originated accounts. The address of a smart contract always starts + with the letters ``KT1``. + +_`Smart Optimistic Rollups` + Smart optimistic rollups constitute a `layer 2`_ solution that can be used to deploy either a general-purpose polyvalent layer 2 blockchain + (e.g., an EVM-compatible one), or an application-specific DApp. + See :doc:`smart_rollups`. + +_`Transaction` + An operation_ to transfer tez between two accounts, or to run the code of a + `smart contract`_. + +_`Validation pass` + An index (a natural number) associated with a particular kind of + operations, allowing to group them into classes. Validation passes + enable prioritizing the :ref:`validation and + application` of certain classes of + operations. + +_`Voting period` + Any of the ``proposal``, ``exploration``, ``cooldown``, + ``promotion`` or ``adoption`` stages in the voting procedure when + amending the `economic protocol`_. + +_`Voting listings` + The list calculated at the beginning of each `voting period`_ that contains + the staking balance (in number of mutez) of each delegate_ that owns more + than one roll_ at that moment. For each delegate_, The voting listings + reflects the weight of the vote emitted by the delegate_ when amending the + `economic protocol`_. diff --git a/docs/mumbai/liquidity_baking.rst b/docs/mumbai/liquidity_baking.rst new file mode 100644 index 000000000000..7665c2ae2d04 --- /dev/null +++ b/docs/mumbai/liquidity_baking.rst @@ -0,0 +1,85 @@ +Liquidity Baking +================ + +Liquidity baking incentivizes large amounts of decentralized liquidity provision between tez and tzBTC by minting a small amount of tez every block and depositing it inside of a constant product market making smart-contract. + +Contracts +~~~~~~~~~ + +During activation of Granada protocol, a constant product market making (CPMM) Michelson contract has been deployed on the chain with address ``KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5`` as well as an associated liquidity token contract (LQT) with address ``KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo``. + +.. warning:: + + while the CPMM and LQT contract originations provide an ``Origination_result``, the LQT contract contains two big maps not included in a `lazy_storage_diff` field. Indexers and other tooling may need manual updates to include these. + +The CPMM maintains a balance of ``a`` tez and ``b`` `tzBTC `_, where tzBTC is the `FA1.2 token `_ found at address ``KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn``. The smart contract accepts deposits of ``da`` tez and returns ``db`` tzBTC (or vice versa) where the invariant ``(a + da * (1 - f - n)) * (b - db) = a b`` is preserved, and ``f`` and ``n`` are a fee and burn, set at 0.1% each. Calculations are done with precision of 1000, rounding down on division. + +To implement this contract, we use a fork of the open source code base used by `version two `_ of the "Dexter" project. The implementation of this contract has been `formally verified `_ against its functional specification. The contract code is modified in the following way: + +1. The fee is set to 0.1% only (the fee in Dexter v2 is set to 0.3%). Rationale: given the subsidy it is not necessary to charge a large fee and better to improve liquidity. +2. An additional 0.1% of every trade is burned by being transferred to the null implicit account. Rationale: this mechanism offsets inflation from the subsidy. The inflation is exactly balanced at a daily trade volume of 7.2 million tez. +3. The ability to set a delegate has been removed. Rationale: the subsidy means there is no need for a baker for that contract and having one would create an imbalance. +4. The ability to set a manager has been removed. Rationale: the only privilege of the Dexter manager is to set Dexter's delegate so this role is now unnecessary. + +The LIGO and Michelson code for these contracts, as well as detailed documentation, can be found on `the liquidity baking branch of the Dexter 2 repository `_. + +Subsidy +~~~~~~~ + +At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block; currently these rewards are 40 tez per block so the amount that is sent to the CPMM contract is 2.5 tez per block. + +So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. + +.. _toggle_mumbai: + +Toggle vote +~~~~~~~~~~~ + +The subsidy can be paused by a mechanism called the Liquidity Baking +Toggle Vote. At every block, the baker producing the block includes +a flag that requests ending the subsidy or on the contrary continuing +or restarting it. The context maintains an exponential moving average +of that flag. The baker has three options for this flag: ``Off`` to +request ending the subsidy, ``On`` to request continuing or restarting +the subsidy, and ``Pass`` to abstain. + +``e[n+1] = e[n]`` if the flag is set to ``Pass``. +``e[n+1] = (1999 * e[n] // 2000) + 1_000_000`` if the flag is set to ``Off``. +``e[n+1] = (1999 * e[n] // 2000)`` if the flag is set to ``On``. +When computing ``e[n+1]``, the division is rounded toward ``1_000_000_000```. + +If at any block ``e[n] >= 1_000_000_000`` then it means that an +exponential moving average with a window size on the order of two +thousand non-abstaining blocks has had roughly at least a half of the +blocks demanding the end of the subsidy. If that is the case, the +subsidy is halted but can be reactivated if for some later block +``e[n] < 1_000_000_000``. + +For indicative purposes, if among the non-abstaining blocks a fraction +``f`` of blocks use it to request ending the subsidy, the threshold is +reached after roughly ``2*(log(1-1/(2f)) / log(0.999))`` +non-abstaining blocks, about 1386 blocks if everyone signals, 1963 +blocks if 80% do, 3583 blocks if 60% do etc. Recall for comparison +that assuming two blocks per minute there are 2880 blocks per day. + +When producing blocks using Octez baking daemon ``octez-baker``, there +are two command-line options affecting toggle vote. The +``--liquidity-baking-toggle-vote `` option sets a static +value to be used in each block. Note that this option must be placed +**after** ``run`` on the command-line. Moreover, the path of a JSON file +can be given to the ``--votefile `` option +e.g. ``octez-baker- run with local node +~/.tezos-node alice --liquidity-baking-toggle-vote on --votefile +"per_block_votes.json"``, or placed in a default location: +``per_block_votes.json`` in the current working directory. The content +of the JSON file will be repeatedly submitted on each baked block, +where ``per_block_votes.json`` contains just +``{"liquidity_baking_toggle_vote": "pass"}`` (to abstain), +``{"liquidity_baking_toggle_vote": "off"}`` (to request ending the +subsidy), or ``{"liquidity_baking_toggle_vote": "on"}`` (to request +continuing the subsidy). When the ``--votefile`` option is present it +takes precedence over ``--liquidity-baking-toggle-vote``. If the JSON +file is deleted or becomes malformed while the baker is running, the +last valid value read is used. If neither a valid vote file is provided +nor a CLI value given, the baker will fail on the first block after it +was started. See also the :ref:`baker man page`. diff --git a/docs/mumbai/michelson.rst b/docs/mumbai/michelson.rst new file mode 100644 index 000000000000..3eb20cb3be2a --- /dev/null +++ b/docs/mumbai/michelson.rst @@ -0,0 +1,3728 @@ +Michelson: the language of Smart Contracts in Tezos +=================================================== + +This specification gives a detailed formal semantics of the Michelson +language and a short explanation of how smart contracts are executed +and interact in the blockchain. + +The language is stack-based, with high level data types and primitives, +and strict static type checking. Its design cherry picks traits from +several language families. Vigilant readers will notice direct +references to Forth, Scheme, ML and Cat. + +A Michelson program is a series of instructions that are run in +sequence: each instruction receives as input the stack resulting from the +previous instruction, and rewrites it for the next one. The stack +contains both immediate values and heap allocated structures. All values +are immutable and garbage collected. + +The types of the input and output stack are fixed and monomorphic, +and the program is typechecked before being introduced into the system. +No smart contract execution can fail because an instruction has been +executed on a stack of unexpected length or contents. + +This specification gives the complete instruction set, type system and +semantics of the language. It is meant as a precise reference manual, +not an easy introduction. Even though, some examples are provided at +the end of the document and can be read first or at the same time as +the specification. The document also starts with a less formal +explanation of the context: how Michelson code interacts with the +blockchain. + +.. _address_prefixes_mumbai: + +Semantics of smart contracts and transactions +--------------------------------------------- + +The Tezos ledger currently has two types of accounts that can hold +tokens (and be the destinations of transactions). + + - An implicit account is a non programmable account, whose tokens + are spendable and delegatable by a public key. Its address is + directly the public key hash, and starts with ``tz1``, ``tz2``, + ``tz3`` or ``tz4``. + - A smart contract is a programmable account. A transaction to such + an address can provide data, and can fail for reasons decided by + its Michelson code. Its address is a unique hash that depends on + the operation that led to its creation, and starts with ``KT1``. + +From Michelson, they are indistinguishable. A safe way to think about +this is to consider that implicit accounts are smart contracts that +always succeed to receive tokens, and does nothing else. + +Another kind of addresses, prefixed by ``txr1``, are related to +:doc:`transaction rollups <./transaction_rollups>`. + +Finally, addresses prefixed with ``scr1`` identify smart rollups. + +Intra-transaction semantics +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Alongside their tokens, smart contracts keep a piece of storage. Both +are ruled by a specific logic specified by a Michelson program. A +transaction to a smart contract will provide an input value and in +option some tokens, and in return, the smart contract can modify its +storage and transfer its tokens. + +The Michelson program receives as input a stack containing a single +pair whose first element is an input value and second element the +content of the storage space. It must return a stack containing a +single pair whose first element is the list of internal operations +that it wants to emit, and second element is the new contents of the +storage space. Alternatively, a Michelson program can fail, explicitly +using a specific opcode, or because something went wrong that could +not be caught by the type system (e.g. gas exhaustion). + +A bit of polymorphism can be used at contract level, with a +lightweight system of named entrypoints: instead of an input value, +the contract can be called with an entrypoint name and an argument, +and these two components are transformed automatically in a simple and +deterministic way to an input value. This feature is available both +for users and from Michelson code. See the dedicated section. + +Inter-transaction semantics +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +An operation included in the blockchain is a sequence of "external +operations" signed as a whole by a source address. These operations +are of three kinds: + + - Transactions to transfer tokens to implicit accounts or tokens and + parameters to a smart contract (or, optionally, to a specified + entrypoint of a smart contract). + - Originations to create new smart contracts from its Michelson + source code, an initial amount of tokens transferred from the + source, and an initial storage contents. + - Delegations to assign the tokens of the source to the stake of + another implicit account (without transferring any tokens). + +Smart contracts can also emit "internal operations". These are run +in sequence after the external transaction completes, as in the +following schema for a sequence of two external operations. + +:: + + +------+----------------+-------+----------------+ + | op 1 | internal ops 1 | op 2 | internal ops 2 | + +------+----------------+-------+----------------+ + +Smart contracts called by internal transactions can in turn also emit +internal operation. The interpretation of the internal operations +of a given external operation uses a stack, as in the following +example, also with two external operations. + +:: + + +-----------+---------------+--------------------------+ + | executing | emissions | resulting stack | + +-----------+---------------+--------------------------+ + | op 1 | 1a, 1b, 1c | 1a, 1b, 1c | + | op 1a | 1ai, 1aj | 1ai, 1aj, 1b, 1c | + | op 1ai | | 1aj, 1b, 1c | + | op 1aj | | 1b, 1c | + | op 1b | 1bi | 1bi, 1c | + | op 1bi | | 1c | + | op 1c | | | + | op 2 | 2a, 2b | 2a, 2b | + | op 2a | 2ai | 2ai, 2b | + | op 2ai | 2ai1 | 2ai1, 2b | + | op 2ai1 | | 2b | + | op 2b | 2bi | 2bi | + | op 2bi | 2bi1 | 2bi1 | + | op 2bi1 | 2bi2 | 2bi2 | + | op 2bi2 | | | + +-----------+---------------+--------------------------+ + +Failures +~~~~~~~~ + +All transactions can fail for a few reasons, mostly: + + - Not enough tokens in the source to spend the specified amount. + - The script took too many execution steps. + - The script failed programmatically using the ``FAILWITH`` instruction. + +External transactions can also fail for these additional reasons: + + - The signature of the external operations was wrong. + - The code or initial storage in an origination did not typecheck. + - The parameter in a transfer did not typecheck. + - The destination did not exist. + - The specified entrypoint did not exist. + +All these errors cannot happen in internal transactions, as the type +system catches them at operation creation time. In particular, +Michelson has two types to talk about other accounts: ``address`` and +``contract t``. The ``address`` type merely gives the guarantee that +the value has the form of a Tezos address. The ``contract t`` type, on +the other hand, guarantees that the value is indeed a valid, existing +account whose parameter type is ``t``. To make a transaction from +Michelson, a value of type ``contract t`` must be provided, and the +type system checks that the argument to the transaction is indeed of +type ``t``. Hence, all transactions made from Michelson are well +formed by construction. + +In any case, when a failure happens, either total success or total +failure is guaranteed. If a transaction (internal or external) fails, +then the whole sequence fails and all the effects up to the failure +are reverted. These transactions can still be included in blocks, and +the transaction fees are given to the implicit account who baked the +block. + +Language semantics +------------------ + +This specification explains in a symbolic way the computation performed by the +Michelson interpreter on a given program and initial stack to produce +the corresponding resulting stack. The Michelson interpreter is a pure +function: it only builds a result stack from the elements of an initial +one, without affecting its environment. This semantics is then naturally +given in what is called a big step form: a symbolic definition of a +recursive reference interpreter. This definition takes the form of a +list of rules that cover all the possible inputs of the interpreter +(program and stack), and describe the computation of the corresponding +resulting stacks. + +Rules form and selection +~~~~~~~~~~~~~~~~~~~~~~~~ + +The rules have the main following form. + +:: + + > (syntax pattern) / (initial stack pattern) => (result stack pattern) + iff (conditions) + where (recursions) + and (more recursions) + +The left hand side of the ``=>`` sign is used for selecting the rule. +Given a program and an initial stack, one (and only one) rule can be +selected using the following process. First, the toplevel structure of +the program must match the syntax pattern. This is quite simple since +there are only a few non-trivial patterns to deal with instruction +sequences, and the rest is made of trivial patterns that match one +specific instruction. Then, the initial stack must match the initial +stack pattern. Finally, some rules add extra conditions over the values +in the stack that follow the ``iff`` keyword. Sometimes, several rules +may apply in a given context. In this case, the one that appears first +in this specification is to be selected. If no rule applies, the result +is equivalent to the one for the explicit ``FAILWITH`` instruction. This +case does not happen on well-typed programs, as explained in the next +section. + +The right hand side describes the result of the interpreter if the rule +applies. It consists in a stack pattern, whose parts are either +constants, or elements of the context (program and initial stack) that +have been named on the left hand side of the ``=>`` sign. + +Recursive rules (big step form) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sometimes, the result of interpreting a program is derived from the +result of interpreting another one (as in conditionals or function +calls). In these cases, the rule contains a clause of the following +form. + +:: + + where (intermediate program) / (intermediate stack) => (partial result) + +This means that this rule applies in case interpreting the intermediate +state on the left gives the pattern on the right. + +The left hand sign of the ``=>`` sign is constructed from elements of +the initial state or other partial results, and the right hand side +identify parts that can be used to build the result stack of the rule. + +If the partial result pattern does not actually match the result of the +interpretation, then the result of the whole rule is equivalent to the +one for the explicit ``FAILWITH`` instruction. Again, this case does not +happen on well-typed programs, as explained in the next section. + +Format of patterns +~~~~~~~~~~~~~~~~~~ + +Code patterns are of one of the following syntactical forms. + +- ``INSTR`` (an uppercase identifier) is a simple instruction (e.g. + ``DROP``). +- ``INSTR (arg) ...`` is a compound instruction, whose arguments can be + code, data or type patterns (e.g. ``PUSH nat 3``). +- ``{ (instr) ; ... }`` is a possibly empty sequence of instructions, + (e.g. ``IF { SWAP ; DROP } { DROP }``), nested sequences can drop the + braces. +- ``name`` is a pattern that matches any program and names a part of + the matched program that can be used to build the result. +- ``_`` is a pattern that matches any instruction. + +Stack patterns are of one of the following syntactical forms. + +- ``[FAILED]`` is the special failed state. +- ``[]`` is the empty stack. +- ``(top) : (rest)`` is a stack whose top element is matched by the + data pattern ``(top)`` on the left, and whose remaining elements are + matched by the stack pattern ``(rest)`` on the right (e.g. + ``x : y : rest``). +- ``name`` is a pattern that matches any stack and names it in order to + use it to build the result. +- ``_`` is a pattern that matches any stack. + +Data patterns are of one of the following syntactical forms. + +- integer/natural number literals, (e.g. ``3``). +- string literals, (e.g. ``"contents"``). +- raw byte sequence literals (e.g. ``0xABCDEF42``). +- ``Tag`` (capitalized) is a symbolic constant, (e.g. ``Unit``, + ``True``, ``False``). +- ``(Tag (arg) ...)`` tagged constructed data, (e.g. ``(Pair 3 4)``). +- a code pattern for first class code values. +- ``name`` to name a value in order to use it to build the result. +- ``_`` to match any value. + +The domain of instruction names, symbolic constants and data +constructors is fixed by this specification. Michelson does not let the +programmer introduce its own types. + +Be aware that the syntax used in the specification may differ from +the :ref:`concrete syntax `. In particular +some instructions are annotated with types that are not present in the +concrete language because they are synthesized by the typechecker. + +Shortcuts +~~~~~~~~~ + +Sometimes, it is easier to think (and shorter to write) in terms of +program rewriting than in terms of big step semantics. When it is the +case, and when both are equivalents, we write rules of the form: + +:: + + p / S => S'' + where p' / S' => S'' + +using the following shortcut: + +:: + + p / S => p' / S' + +The concrete language also has some syntax sugar to group some common +sequences of operations as one. This is described in this specification +using a simple regular expression style recursive instruction rewriting. + +.. _michelson_type_system_mumbai: + +Introduction to the type system and notations +--------------------------------------------- + +This specification describes a type system for Michelson. To make things +clear, in particular to readers that are not accustomed to reading +formal programming language specifications, it does not give a +typechecking or inference algorithm. It only gives an intentional +definition of what we consider to be well-typed programs. For each +syntactical form, it describes the stacks that are considered well-typed +inputs, and the resulting outputs. + +The type system is sound, meaning that if a program can be given a type, +then if run on a well-typed input stack, the interpreter will never +apply an interpretation rule on a stack of unexpected length or +contents. Also, it will never reach a state where it cannot select an +appropriate rule to continue the execution. Well-typed programs do not +block, and do not go wrong. + +Type notations +~~~~~~~~~~~~~~ + +The specification introduces notations for the types of values, terms +and stacks. Apart from a subset of value types that appear in the form +of type annotations in some places throughout the language, it is +important to understand that this type language only exists in the +specification. + +A stack type can be written: + +- ``[]`` for the empty stack. +- ``(top) : (rest)`` for the stack whose first value has type ``(top)`` + and queue has stack type ``(rest)``. + +Instructions, programs and primitives of the language are also typed, +their types are written: + +:: + + (type of stack before) -> (type of stack after) + +The types of values in the stack are written: + +- ``identifier`` for a primitive data-type (e.g. ``bool``). +- ``identifier (arg)`` for a parametric data-type with one parameter + type ``(arg)`` (e.g. ``list nat``). +- ``identifier (arg) ...`` for a parametric data-type with several + parameters (e.g. ``map string int``). +- ``[ (type of stack before) -> (type of stack after) ]`` for a code + quotation, (e.g. ``[ int : int : [] -> int : [] ]``). +- ``lambda (arg) (ret)`` is a shortcut for + ``[ (arg) : [] -> (ret) : [] ]``. + +Meta type variables +~~~~~~~~~~~~~~~~~~~ + +The typing rules introduce meta type variables. To be clear, this has +nothing to do with polymorphism, which Michelson does not have. These +variables only live at the specification level, and are used to express +the consistency between the parts of the program. For instance, the +typing rule for the ``IF`` construct introduces meta variables to +express that both branches must have the same type. + +Here are the notations for meta type variables: + +- ``'a`` for a type variable. +- ``'A`` for a stack type variable. +- ``_`` for an anonymous type or stack type variable. + +Typing rules +~~~~~~~~~~~~ + +The system is syntax directed, meaning that it defines a single +typing rule for each syntax construct. A typing rule restricts the type +of input stacks that are authorized for this syntax construct, links the +output type to the input type, and links both of them to the +subexpressions when needed, using meta type variables. + +Typing rules are of the form: + +:: + + (syntax pattern) + :: (type of stack before) -> (type of stack after) [rule-name] + iff (premises) + +Where premises are typing requirements over subprograms or values in the +stack, both of the form ``(x) :: (type)``, meaning that value ``(x)`` +must have type ``(type)``. + +A program is shown well-typed if one can find an instance of a rule that +applies to the toplevel program expression, with all meta type variables +replaced by non variable type expressions, and of which all type +requirements in the premises can be proven well-typed in the same +manner. For the reader unfamiliar with formal type systems, this is +called building a typing derivation. + +Here is an example typing derivation on a small program that computes +``(x+5)*10`` for a given input ``x``, obtained by instantiating the +typing rules for instructions ``PUSH``, ``ADD`` and for the sequence, as +found in the next sections. When instantiating, we replace the ``iff`` +with ``by``. + +:: + + { PUSH nat 5 ; ADD ; PUSH nat 10 ; MUL } + :: [ nat : [] -> nat : [] ] + by { PUSH nat 5 ; ADD } + :: [ nat : [] -> nat : [] ] + by PUSH nat 5 + :: [ nat : [] -> nat : nat : [] ] + by 5 :: nat + and ADD + :: [ nat : nat : [] -> nat : [] ] + and { PUSH nat 10 ; MUL } + :: [ nat : [] -> nat : [] ] + by PUSH nat 10 + :: [ nat : [] -> nat : nat : [] ] + by 10 :: nat + and MUL + :: [ nat : nat : [] -> nat : [] ] + +Producing such a typing derivation can be done in a number of manners, +such as unification or abstract interpretation. In the implementation of +Michelson, this is done by performing a recursive symbolic evaluation of +the program on an abstract stack representing the input type provided by +the programmer, and checking that the resulting symbolic stack is +consistent with the expected result, also provided by the programmer. + +Side note +~~~~~~~~~ + +As with most type systems, it is incomplete. There are programs that +cannot be given a type in this type system, yet that would not go wrong +if executed. This is a necessary compromise to make the type system +usable. Also, it is important to remember that the implementation of +Michelson does not accept as many programs as the type system describes +as well-typed. This is because the implementation uses a simple single +pass typechecking algorithm, and does not handle any form of +polymorphism. + +Core data types and notations +----------------------------- + +- ``string``, ``nat``, ``int`` and ``bytes``: The core primitive + constant types. + +- ``bool``: The type for booleans whose values are ``True`` and + ``False``. + +- ``unit``: The type whose only value is ``Unit``, to use as a + placeholder when some result or parameter is not necessary. For + instance, when the only goal of a contract is to update its storage. + +- ``never``: The empty type. Since ``never`` has no inhabitant, no value of + this type is allowed to occur in a well-typed program. + +- ``list (t)``: A single, immutable, homogeneous linked list, whose + elements are of type ``(t)``, and that we write ``{}`` for the empty + list or ``{ first ; ... }``. In the semantics, we use chevrons to + denote a subsequence of elements. For instance: ``{ head ; }``. + +- ``pair (l) (r)``: A pair of values ``a`` and ``b`` of types ``(l)`` + and ``(r)``, that we write ``(Pair a b)``. + +- ``pair (t{1}) ... (t{n})`` with ``n > 2``: A shorthand for ``pair (t{1}) (pair (t{2}) ... (pair (t{n-1}) (t{n})) ...)``. + +- ``option (t)``: Optional value of type ``(t)`` that we write ``None`` + or ``(Some v)``. + +- ``or (l) (r)``: A union of two types: a value holding either a value + ``a`` of type ``(l)`` or a value ``b`` of type ``(r)``, that we write + ``(Left a)`` or ``(Right b)``. + +- ``set (t)``: Immutable sets of values of type ``(t)`` that we write as + lists ``{ item ; ... }``, of course with their elements unique, and + sorted. + +- ``map (k) (t)``: Immutable maps from keys of type ``(k)`` of values + of type ``(t)`` that we write ``{ Elt key value ; ... }``, with keys + sorted. + +- ``big_map (k) (t)``: Lazily deserialized maps from keys of type + ``(k)`` of values of type ``(t)``. + These maps should be used if you intend to store large amounts of data in a map. + Using ``big_map`` can reduce gas costs significantly compared to standard maps, as data is lazily deserialized. + Note however that individual operations on ``big_map`` have higher gas costs than those over standard maps. + A ``big_map`` also has a lower storage cost than a standard map of the same size, when large keys are used, since only the hash of each key is stored in a ``big_map``. + + A ``big_map`` cannot appear inside another ``big_map``. + See the section on :ref:`operations on big maps ` for a description of the syntax of values of type ``big_map (k) (t)`` and available operations. + +Core instructions +----------------- + +Control structures +~~~~~~~~~~~~~~~~~~ + +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. + +- ``FAILWITH``: Explicitly abort the current program (`documentation `__). +- ``{}``: Empty sequence (`documentation `__). +- ``{ I ; C }``: Sequence (`documentation `__). +- ``IF bt bf``: Conditional branching (`documentation `__). +- ``LOOP body``: A generic loop (`documentation `__). +- ``LOOP_LEFT body``: A loop with an accumulator (`documentation `__). +- ``DIP code``: Runs code protecting the top element of the stack (`documentation `__). +- ``DIP n code``: Runs code protecting the ``n`` topmost elements of the stack (`documentation `__). +- ``EXEC``: Execute a function from the stack (`documentation `__). +- ``APPLY``: Partially apply a tuplified function from the stack (`documentation `__). + +Stack operations +~~~~~~~~~~~~~~~~ + +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. + +- ``DROP``: Drop the top element of the stack (`documentation `__). +- ``DROP n``: Drop the ``n`` topmost elements of the stack (`documentation `__). +- ``DUP``: Duplicate the top element of the stack (`documentation `__). +- ``DUP n``: Duplicate the ``n``-th element of the stack (`documentation `__). +- ``SWAP``: Exchange the top two elements of the stack (`documentation `__). +- ``DIG n``: Take the element at depth ``n`` of the stack and move it + on top (`documentation `__). +- ``DUG n``: Place the element on top of the stack at depth ``n`` (`documentation `__). +- ``PUSH 'a x``: Push a constant value of a given type onto the stack (`documentation `__). +- ``LAMBDA 'a 'b code``: Push a lambda with the given parameter type ``'a`` and return type ``'b`` onto the stack (`documentation `__). +- ``LAMBDA_REC 'a 'b code``: Push a recursive lambda onto the stack (`documentation `__). + +Generic comparison +~~~~~~~~~~~~~~~~~~ + +Comparison only works on a class of types that we call comparable. A +``COMPARE`` operation is defined in an ad hoc way for each comparable +type, but the result of compare is always an ``int``, which can in turn +be checked in a generic manner using the following combinators. The +result of ``COMPARE`` is ``0`` if the top two elements of the stack are +equal, negative if the first element in the stack is less than the +second, and positive otherwise. + +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. + +- ``EQ``: Checks that the top element of the stack is equal to zero (`documentation `__). +- ``NEQ``: Checks that the top element of the stack is not equal to zero (`documentation `__). +- ``LT``: Checks that the top element of the stack is less than zero (`documentation `__). +- ``GT``: Checks that the top element of the stack is greater than zero (`documentation `__). +- ``LE``: Checks that the top element of the stack is less than or equal to + zero (`documentation `__). +- ``GE``: Checks that the top of the stack is greater than or equal to + zero (`documentation `__). + +Operations +---------- + +Operations on unit +~~~~~~~~~~~~~~~~~~ + +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. + +- ``UNIT``: Push a unit value onto the stack (`documentation `__). +- ``COMPARE``: Unit comparison (`documentation `__). + +Operations on type never +~~~~~~~~~~~~~~~~~~~~~~~~ + +The type ``never`` is the type of forbidden values. The most prominent +scenario in which ``never`` is used is when implementing a contract +template with no additional entrypoint. A contract template defines a set +of basic entrypoints, and its ``parameter`` declaration contains a type +variable for additional entrypoints in some branch of an union type, or +wrapped inside an option type. Letting this type variable be ``never`` in +a particular implementation indicates that the contract template has not +been extended, and turns the branch in the code that processes the +additional entrypoints into a forbidden branch. + +Values of type ``never`` cannot occur in a well-typed program. However, +they can be abstracted in the ``parameter`` declaration of a contract---or +by using the ``LAMBDA`` operation---thus indicating that the corresponding +branches in the code are forbidden. The type ``never`` also plays a role +when introducing values of union or option type with ``LEFT never``, +``RIGHT never``, or ``NONE never``. In such cases, the created values can +be inspected with the operations ``IF_LEFT``, ``IF_RIGHT``, or +``IF_NONE``, and the corresponding branches in the code are forbidden +branches. + +- ``NEVER``: Close a forbidden branch. + +:: + + :: never : 'A -> 'B + +- ``COMPARE``: Trivial comparison on type ``never`` + +:: + + :: never : never : 'S -> int : 'S + + +Operations on booleans +~~~~~~~~~~~~~~~~~~~~~~ + +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. + +- ``OR`` (`documentation `__). +- ``AND`` (`documentation `__). +- ``XOR`` (`documentation `__). +- ``NOT`` (`documentation `__). +- ``COMPARE``: Boolean comparison (`documentation `__). + +Operations on integers and natural numbers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Integers and naturals are arbitrary-precision, meaning that the only size +limit is gas. + +- ``NEG`` + +:: + + :: int : 'S -> int : 'S + :: nat : 'S -> int : 'S + + > NEG / x : S => -x : S + +- ``ABS`` + +:: + + :: int : 'S -> nat : 'S + + > ABS / x : S => abs (x) : S + +- ``ISNAT`` + +:: + + :: int : 'S -> option nat : 'S + + > ISNAT / x : S => Some (x) : S + iff x >= 0 + + > ISNAT / x : S => None : S + iff x < 0 + +- ``INT`` + +:: + + :: nat : 'S -> int : 'S + + > INT / x : S => x : S + +- ``ADD`` + +:: + + :: int : int : 'S -> int : 'S + :: int : nat : 'S -> int : 'S + :: nat : int : 'S -> int : 'S + :: nat : nat : 'S -> nat : 'S + + > ADD / x : y : S => (x + y) : S + +- ``SUB`` + +:: + + :: int : int : 'S -> int : 'S + :: int : nat : 'S -> int : 'S + :: nat : int : 'S -> int : 'S + :: nat : nat : 'S -> int : 'S + + > SUB / x : y : S => (x - y) : S + +- ``MUL`` + +:: + + :: int : int : 'S -> int : 'S + :: int : nat : 'S -> int : 'S + :: nat : int : 'S -> int : 'S + :: nat : nat : 'S -> nat : 'S + + > MUL / x : y : S => (x * y) : S + +- ``EDIV``: Perform Euclidean division + +:: + + :: int : int : 'S -> option (pair int nat) : 'S + :: int : nat : 'S -> option (pair int nat) : 'S + :: nat : int : 'S -> option (pair int nat) : 'S + :: nat : nat : 'S -> option (pair nat nat) : 'S + + > EDIV / x : 0 : S => None : S + > EDIV / x : y : S => Some (Pair (x / y) (x % y)) : S + iff y <> 0 + +Bitwise logical operators are also available on unsigned integers. + +- ``OR`` + +:: + + :: nat : nat : 'S -> nat : 'S + + > OR / x : y : S => (x | y) : S + +- ``AND``: (also available when the top operand is signed) + +:: + + :: nat : nat : 'S -> nat : 'S + :: int : nat : 'S -> nat : 'S + + > AND / x : y : S => (x & y) : S + +- ``XOR`` + +:: + + :: nat : nat : 'S -> nat : 'S + + > XOR / x : y : S => (x ^ y) : S + +- ``NOT``: Two's complement + +:: + + :: nat : 'S -> int : 'S + :: int : 'S -> int : 'S + + > NOT / x : S => ~x : S + + +The return type of ``NOT`` is an ``int`` and not a ``nat``. This is +because the sign is also negated. The resulting integer is computed +using two's complement. For instance, the boolean negation of ``0`` is +``-1``. To get a natural back, a possibility is to use ``AND`` with an +unsigned mask afterwards. + + +- ``LSL`` + +:: + + :: nat : nat : 'S -> nat : 'S + + > LSL / x : s : S => (x << s) : S + iff s <= 256 + > LSL / x : s : S => [FAILED] + iff s > 256 + +- ``LSR`` + +:: + + :: nat : nat : 'S -> nat : 'S + + > LSR / x : s : S => (x >> s) : S + iff s <= 256 + > LSR / x : s : S => [FAILED] + iff s > 256 + +- ``COMPARE``: Integer/natural comparison + +:: + + :: int : int : 'S -> int : 'S + :: nat : nat : 'S -> int : 'S + + > COMPARE / x : y : S => -1 : S + iff x < y + > COMPARE / x : y : S => 0 : S + iff x = y + > COMPARE / x : y : S => 1 : S + iff x > y + +Operations on strings +~~~~~~~~~~~~~~~~~~~~~ + +Strings are mostly used for naming things without having to rely on +external ID databases. They are restricted to the printable subset of +7-bit ASCII, plus some escaped characters (see section on +constants). So what can be done is basically use string constants as +is, concatenate or splice them, and use them as keys. + + +- ``CONCAT``: String concatenation. + +:: + + :: string : string : 'S -> string : 'S + + > CONCAT / s : t : S => (s ^ t) : S + + :: string list : 'S -> string : 'S + + > CONCAT / {} : S => "" : S + > CONCAT / { s ; } : S => (s ^ r) : S + where CONCAT / { } : S => r : S + +- ``SIZE``: number of characters in a string. + +:: + + :: string : 'S -> nat : 'S + +- ``SLICE``: String access. + +:: + + :: nat : nat : string : 'S -> option string : 'S + + > SLICE / offset : length : s : S => Some ss : S + where ss is the substring of s at the given offset and of the given length + iff offset and (offset + length) are in bounds + > SLICE / offset : length : s : S => None : S + iff offset or (offset + length) are out of bounds + +- ``COMPARE``: Lexicographic comparison. + +:: + + :: string : string : 'S -> int : 'S + + > COMPARE / s : t : S => -1 : S + iff s < t + > COMPARE / s : t : S => 0 : S + iff s = t + > COMPARE / s : t : S => 1 : S + iff s > t + +Operations on pairs and right combs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The type ``pair l r`` is the type of binary pairs composed of a left +element of type ``l`` and a right element of type ``r``. A value of +type ``pair l r`` is written ``Pair x y`` where ``x`` is a value of +type ``l`` and ``y`` is a value of type ``r``. + +To build tuples of length greater than 2, right combs have specific +optimized operations. For any ``n > 2``, the compact notations ``pair +t{0} t{1} ... t{n-2} t{n-1}`` is provided for the type of right combs +``pair t{0} (pair t{1} ... (pair t{n-2} t{n-1}) ...)``. Similarly, the +compact notation ``Pair x{0} x{1} ... x{n-2} x{n-1}`` is provided for +the right-comb value ``Pair x{0} (Pair x{1} ... (Pair x{n-2} x{n-1}) +...)``. Right-comb values can also be written using sequences; ``Pair +x{0} x{1} ... x{n-2} x{n-1}`` can be written ``{x{0}; x{1}; ...; x{n-2}; x{n-1}}``. + +- ``PAIR``: Build a binary pair from the stack's top two elements. + +:: + + :: 'a : 'b : 'S -> pair 'a 'b : 'S + + > PAIR / x : y : S => Pair x y : S + +- ``PAIR n``: Fold ``n`` values on the top of the stack in a right comb. + ``PAIR 0`` and ``PAIR 1`` are rejected. ``PAIR 2`` is equivalent to ``PAIR``. + +:: + + PAIR 2 :: 'a : 'b : 'S -> pair 'a 'b : 'S + PAIR (k+1) :: 'x : 'S -> pair 'x 'y : 'T + iff PAIR k :: 'S -> 'y : 'T + + Or equivalently, for n >= 2, + PAIR n :: 'a{0} : ... : 'a{n-1} : 'A -> pair 'a{0} ... 'a{n-1} : 'A + + > PAIR 2 / x : y : S => Pair x y : S + > PAIR (k+1) / x : S => Pair x y : T + iff PAIR k / S => y : T + + Or equivalently, for n >= 2, + > PAIR n / x{0} : ... : x{n-1} : S => Pair x{0} ... x{n-1} : S + +- ``UNPAIR``: Split a pair into its components. + +:: + + :: pair 'a 'b : 'S -> 'a : 'b : 'S + + > UNPAIR / Pair a b : S => a : b : S + + +- ``UNPAIR n``: Unfold ``n`` values from a right comb on the top of the stack. ``UNPAIR 0`` and ``UNPAIR 1`` are rejected. ``UNPAIR 2`` is equivalent to ``UNPAIR``. + +:: + + UNPAIR 2 :: pair 'a 'b : 'A -> 'a : 'b : 'A + UNPAIR (k+1) :: pair 'a 'b : 'A -> 'a : 'B + iff UNPAIR k :: 'b : 'A -> 'B + + Or equivalently, for n >= 2, + UNPAIR n :: pair 'a{0} ... 'a{n-1} : S -> 'a{0} : ... : 'a{n-1} : S + + > UNPAIR 2 / Pair x y : S => x : y : S + > UNPAIR (k+1) / Pair x y : SA => x : SB + iff UNPAIR k / y : SA => SB + + Or equivalently, for n >= 2, + > UNPAIR n / Pair x{0} ... x{n-1} : S => x{0} : ... : x{n-1} : S + +- ``CAR``: Access the left part of a pair. + +:: + + :: pair 'a _ : 'S -> 'a : 'S + + > CAR / Pair x _ : S => x : S + +- ``CDR``: Access the right part of a pair. + +:: + + :: pair _ 'b : 'S -> 'b : 'S + + > CDR / Pair _ y : S => y : S + +- ``GET k``: Access an element or a sub comb in a right comb. + + The nodes of a right comb of size ``n`` are canonically numbered as follows: + +:: + + 0 + / \ + 1 2 + / \ + 3 4 + / \ + 5 ... + 2n-2 + / \ + 2n-1 2n + + +Or in plain English: + + - The root is numbered with 0, + - The left child of the node numbered by ``k`` is numbered by ``k+1``, and + - The right child of the node numbered by ``k`` is numbered by ``k+2``. + +The ``GET k`` instruction accesses the node numbered by ``k``. In +particular, for a comb of size ``n``, the ``n-1`` first elements are +accessed by ``GET 1``, ``GET 3``, ..., and ``GET (2n-1)`` and the last +element is accessed by ``GET (2n)``. + +:: + + GET 0 :: 'a : 'S -> 'a : 'S + GET 1 :: pair 'x _ : 'S -> 'x : 'S + GET (k+2) :: pair _ 'y : 'S -> 'z : 'S + iff GET k :: 'y : 'S -> 'z : 'S + + Or equivalently, + GET 0 :: 'a : 'S -> 'a : 'S + GET (2k) :: pair 'a{0} ... 'a{k-1} 'a{k} : 'S -> 'a{k} : 'S + GET (2k+1) :: pair 'a{0} ... 'a{k} 'a{k+1} : 'S -> 'a{k} : 'S + + > GET 0 / x : S => x : S + > GET 1 / Pair x _ : S => x : S + > GET (k+2) / Pair _ y : S => GET k / y : S + + Or equivalently, + > GET 0 / x : S => x : S + > GET (2k) / Pair x{0} ... x{k-1} x{k} : 'S -> x{k} : 'S + > GET (2k+1) / Pair x{0} ... x{k} x{k+1} : 'S -> x{k} : 'S + + +- ``UPDATE k``: Update an element or a sub comb in a right comb. The topmost stack element is the new value to insert in the comb, the second stack element is the right comb to update. The meaning of ``k`` is the same as for the ``GET k`` instruction. + +:: + + UPDATE 0 :: 'a : 'b : 'S -> 'a : 'S + UPDATE 1 :: 'a2 : pair 'a1 'b : 'S -> pair 'a2 'b : 'S + UPDATE (k+2) :: 'c : pair 'a 'b1 : 'S -> pair 'a 'b2 : 'S + iff UPDATE k :: 'c : 'b1 : 'S -> 'b2 : 'S + + Or equivalently, + UPDATE 0 :: 'a : 'b : 'S -> 'a : 'S + UPDATE (2k) :: 'c : pair 'a{0} ... 'a{k-1} 'a{k} : 'S -> pair 'a{0} ... 'a{k-1} 'c : 'S + UPDATE (2k+1) :: 'c : pair 'a{0} ... 'a{k} 'a{k+1} : 'S -> pair 'a{0} ... 'a{k-1} 'c 'a{k+1} : 'S + + > UPDATE 0 / x : _ : S => x : S + > UPDATE 1 / x2 : Pair x1 y : S => Pair x2 y : S + > UPDATE (k+2) / z : Pair x y1 : S => Pair x y2 : S + iff UPDATE k / z : y1 : S => y2 : S + + Or equivalently, + > UPDATE 0 / x : _ : S => x : S + > UPDATE (2k) / z : Pair x{0} ... x{k-1} x{k} : 'S => Pair x{0} ... x{k-1} z : 'S + > UPDATE (2k+1) / z : Pair x{0} ... x{k-1} x{k} x{k+1} : 'S => Pair x{0} ... x{k-1} z x{k+1} : 'S + +- ``COMPARE``: Lexicographic comparison. + +:: + + :: pair 'a 'b : pair 'a 'b : 'S -> int : 'S + + > COMPARE / (Pair sa sb) : (Pair ta tb) : S => -1 : S + iff COMPARE / sa : ta : S => -1 : S + > COMPARE / (Pair sa sb) : (Pair ta tb) : S => 1 : S + iff COMPARE / sa : ta : S => 1 : S + > COMPARE / (Pair sa sb) : (Pair ta tb) : S => r : S + iff COMPARE / sa : ta : S => 0 : S + COMPARE / sb : tb : S => r : S + +Operations on sets +~~~~~~~~~~~~~~~~~~ + +- ``EMPTY_SET 'elt``: Build a new, empty set for elements of a given + type. + + The ``'elt`` type must be comparable (the ``COMPARE`` + primitive must be defined over it). + +:: + + :: 'S -> set 'elt : 'S + + > EMPTY_SET _ / S => {} : S + +- ``MEM``: Check for the presence of an element in a set. + +:: + + :: 'elt : set 'elt : 'S -> bool : 'S + + > MEM / x : {} : S => false : S + > MEM / x : { hd ; } : S => r : S + iff COMPARE / x : hd : [] => 1 : [] + where MEM / x : { } : S => r : S + > MEM / x : { hd ; } : S => true : S + iff COMPARE / x : hd : [] => 0 : [] + > MEM / x : { hd ; } : S => false : S + iff COMPARE / x : hd : [] => -1 : [] + +- ``UPDATE``: Inserts or removes an element in a set, replacing a + previous value. + +:: + + :: 'elt : bool : set 'elt : 'S -> set 'elt : 'S + + > UPDATE / x : false : {} : S => {} : S + > UPDATE / x : true : {} : S => { x } : S + > UPDATE / x : v : { hd ; } : S => { hd ; } : S + iff COMPARE / x : hd : [] => 1 : [] + where UPDATE / x : v : { } : S => { } : S + > UPDATE / x : false : { hd ; } : S => { } : S + iff COMPARE / x : hd : [] => 0 : [] + > UPDATE / x : true : { hd ; } : S => { hd ; } : S + iff COMPARE / x : hd : [] => 0 : [] + > UPDATE / x : false : { hd ; } : S => { hd ; } : S + iff COMPARE / x : hd : [] => -1 : [] + > UPDATE / x : true : { hd ; } : S => { x ; hd ; } : S + iff COMPARE / x : hd : [] => -1 : [] + +- ``ITER body``: Apply the body expression to each element of a set. + The body sequence has access to the stack. + +:: + + :: (set 'elt) : 'A -> 'A + iff body :: [ 'elt : 'A -> 'A ] + + > ITER body / {} : S => S + > ITER body / { hd ; } : S => ITER body / { } : S' + iff body / hd : S => S' + + +- ``SIZE``: Get the cardinality of the set. + +:: + + :: set 'elt : 'S -> nat : 'S + + > SIZE / {} : S => 0 : S + > SIZE / { _ ; } : S => 1 + s : S + where SIZE / { } : S => s : S + +Operations on maps +~~~~~~~~~~~~~~~~~~ + +- ``EMPTY_MAP 'key 'val``: Build a new, empty map from keys of a + given type to values of another given type. + + The ``'key`` type must be comparable (the ``COMPARE`` primitive must + be defined over it). + +:: + + :: 'S -> map 'key 'val : 'S + + > EMPTY_MAP _ _ / S => {} : S + + +- ``GET``: Access an element in a map, returns an optional value to be + checked with ``IF_SOME``. + +:: + + :: 'key : map 'key 'val : 'S -> option 'val : 'S + + > GET / x : {} : S => None : S + > GET / x : { Elt k v ; } : S => opt_y : S + iff COMPARE / x : k : [] => 1 : [] + where GET / x : { } : S => opt_y : S + > GET / x : { Elt k v ; } : S => Some v : S + iff COMPARE / x : k : [] => 0 : [] + > GET / x : { Elt k v ; } : S => None : S + iff COMPARE / x : k : [] => -1 : [] + +- ``MEM``: Check for the presence of a binding for a key in a map. + +:: + + :: 'key : map 'key 'val : 'S -> bool : 'S + + > MEM / x : {} : S => false : S + > MEM / x : { Elt k v ; } : S => r : S + iff COMPARE / x : k : [] => 1 : [] + where MEM / x : { } : S => r : S + > MEM / x : { Elt k v ; } : S => true : S + iff COMPARE / x : k : [] => 0 : [] + > MEM / x : { Elt k v ; } : S => false : S + iff COMPARE / x : k : [] => -1 : [] + +- ``UPDATE``: Assign or remove an element in a map. + +:: + + :: 'key : option 'val : map 'key 'val : 'S -> map 'key 'val : 'S + + > UPDATE / x : None : {} : S => {} : S + > UPDATE / x : Some y : {} : S => { Elt x y } : S + > UPDATE / x : opt_y : { Elt k v ; } : S => { Elt k v ; } : S + iff COMPARE / x : k : [] => 1 : [] + where UPDATE / x : opt_y : { } : S => { } : S + > UPDATE / x : None : { Elt k v ; } : S => { } : S + iff COMPARE / x : k : [] => 0 : [] + > UPDATE / x : Some y : { Elt k v ; } : S => { Elt k y ; } : S + iff COMPARE / x : k : [] => 0 : [] + > UPDATE / x : None : { Elt k v ; } : S => { Elt k v ; } : S + iff COMPARE / x : k : [] => -1 : [] + > UPDATE / x : Some y : { Elt k v ; } : S => { Elt x y ; Elt k v ; } : S + iff COMPARE / x : k : [] => -1 : [] + +- ``GET_AND_UPDATE``: A combination of the ``GET`` and ``UPDATE`` instructions. + +:: + + :: 'key : option 'val : map 'key 'val : 'S -> option 'val : map 'key 'val : 'S + +This instruction is similar to ``UPDATE`` but it also returns the +value that was previously stored in the ``map`` at the same key as +``GET`` would. + +:: + + > GET_AND_UPDATE / x : None : {} : S => None : {} : S + > GET_AND_UPDATE / x : Some y : {} : S => None : { Elt x y } : S + > GET_AND_UPDATE / x : opt_y : { Elt k v ; } : S => opt_y' : { Elt k v ; } : S + iff COMPARE / x : k : [] => 1 : [] + where GET_AND_UPDATE / x : opt_y : { } : S => opt_y' : { } : S + > GET_AND_UPDATE / x : None : { Elt k v ; } : S => Some v : { } : S + iff COMPARE / x : k : [] => 0 : [] + > GET_AND_UPDATE / x : Some y : { Elt k v ; } : S => Some v : { Elt k y ; } : S + iff COMPARE / x : k : [] => 0 : [] + > GET_AND_UPDATE / x : None : { Elt k v ; } : S => None : { Elt k v ; } : S + iff COMPARE / x : k : [] => -1 : [] + > GET_AND_UPDATE / x : Some y : { Elt k v ; } : S => None : { Elt x y ; Elt k v ; } : S + iff COMPARE / x : k : [] => -1 : [] + +- ``MAP body``: Apply the body expression to each element of a map. The + body sequence has access to the stack. + +:: + + :: (map 'key 'val) : 'A -> (map 'key 'b) : 'A + iff body :: [ (pair 'key 'val) : 'A -> 'b : 'A ] + + > MAP body / {} : S => {} : S + > MAP body / { Elt k v ; } : S => { Elt k v' ; } : S'' + where body / Pair k v : S => v' : S' + and MAP body / { } : S' => { } : S'' + +- ``ITER body``: Apply the body expression to each element of a map. + The body sequence has access to the stack. + +:: + + :: (map 'elt 'val) : 'A -> 'A + iff body :: [ (pair 'elt 'val : 'A) -> 'A ] + + > ITER body / {} : S => S + > ITER body / { Elt k v ; } : S => ITER body / { } : S' + iff body / (Pair k v) : S => S' + +- ``SIZE``: Get the cardinality of the map. + +:: + + :: map 'key 'val : 'S -> nat : 'S + + > SIZE / {} : S => 0 : S + > SIZE / { _ ; } : S => 1 + s : S + where SIZE / { } : S => s : S + + +Operations on ``big_maps`` +~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _OperationsOnBigMaps_mumbai: + +Big maps have three possible representations. A map literal is always +a valid representation for a big map. Big maps can also be represented +by integers called big-map identifiers. Finally, big maps can be +represented as pairs of a big-map identifier (an integer) and a +big-map diff (written in the same syntax as a map whose values are +options). + +So for example, ``{ Elt "bar" True ; Elt "foo" False }``, ``42``, and +``Pair 42 { Elt "foo" (Some False) }`` are all valid representations +of type ``big_map string bool``. + +The behavior of big-map operations is the same as if they were normal +maps, except that under the hood, the elements are loaded and +deserialized on demand. + +- ``EMPTY_BIG_MAP 'key 'val``: Build a new, empty big map from keys of a + given type to values of another given type. + + The ``'key`` type must be comparable (the ``COMPARE`` primitive must + be defined over it). + +:: + + :: 'S -> map 'key 'val : 'S + +- ``GET``: Access an element in a ``big_map``, returns an optional value to be + checked with ``IF_SOME``. + +:: + + :: 'key : big_map 'key 'val : 'S -> option 'val : 'S + +- ``MEM``: Check for the presence of an element in a ``big_map``. + +:: + + :: 'key : big_map 'key 'val : 'S -> bool : 'S + +- ``UPDATE``: Assign or remove an element in a ``big_map``. + +:: + + :: 'key : option 'val : big_map 'key 'val : 'S -> big_map 'key 'val : 'S + + +- ``GET_AND_UPDATE``: A combination of the ``GET`` and ``UPDATE`` instructions. + +:: + + :: 'key : option 'val : big_map 'key 'val : 'S -> option 'val : big_map 'key 'val : 'S + +This instruction is similar to ``UPDATE`` but it also returns the +value that was previously stored in the ``big_map`` at the same key as +``GET`` would. + + +Operations on optional values +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``SOME``: Pack a value as an optional value. + +:: + + :: 'a : 'S -> option 'a : 'S + + > SOME / v : S => (Some v) : S + +- ``NONE 'a``: The absent optional value. + +:: + + :: 'S -> option 'a : 'S + + > NONE / S => None : S + +- ``IF_NONE bt bf``: Inspect an optional value. + +:: + + :: option 'a : 'A -> 'B + iff bt :: [ 'A -> 'B] + bf :: [ 'a : 'A -> 'B] + + > IF_NONE bt bf / (None) : S => bt / S + > IF_NONE bt bf / (Some a) : S => bf / a : S + +- ``COMPARE``: Optional values comparison + +:: + + :: option 'a : option 'a : 'S -> int : 'S + + > COMPARE / None : None : S => 0 : S + > COMPARE / None : (Some _) : S => -1 : S + > COMPARE / (Some _) : None : S => 1 : S + > COMPARE / (Some a) : (Some b) : S => COMPARE / a : b : S + +- ``MAP body``: Apply the body expression to the value inside the option if there is one. + +:: + + :: option 'a : 'S -> option 'b : 'S + iff body :: [ 'a : 'S -> 'b : 'S ] + + > MAP body / None : S => None : S + > MAP body / (Some a) : S => (Some b) : S' + where body / a : S => b : S' + +Operations on unions +~~~~~~~~~~~~~~~~~~~~ + +- ``LEFT 'b``: Pack a value in a union (left case). + +:: + + :: 'a : 'S -> or 'a 'b : 'S + + > LEFT / v : S => (Left v) : S + +- ``RIGHT 'a``: Pack a value in a union (right case). + +:: + + :: 'b : 'S -> or 'a 'b : 'S + + > RIGHT / v : S => (Right v) : S + +- ``IF_LEFT bt bf``: Inspect a value of a union. + +:: + + :: or 'a 'b : 'A -> 'B + iff bt :: [ 'a : 'A -> 'B] + bf :: [ 'b : 'A -> 'B] + + > IF_LEFT bt bf / (Left a) : S => bt / a : S + > IF_LEFT bt bf / (Right b) : S => bf / b : S + +- ``COMPARE``: Unions comparison + +:: + + :: or 'a 'b : or 'a 'b : 'S -> int : 'S + + > COMPARE / (Left a) : (Left b) : S => COMPARE / a : b : S + > COMPARE / (Left _) : (Right _) : S => -1 : S + > COMPARE / (Right _) : (Left _) : S => 1 : S + > COMPARE / (Right a) : (Right b) : S => COMPARE / a : b : S + +Operations on lists +~~~~~~~~~~~~~~~~~~~ + +- ``CONS``: Prepend an element to a list. + +:: + + :: 'a : list 'a : 'S -> list 'a : 'S + + > CONS / a : { } : S => { a ; } : S + +- ``NIL 'a``: The empty list. + +:: + + :: 'S -> list 'a : 'S + + > NIL / S => {} : S + +- ``IF_CONS bt bf``: Inspect a list. + +:: + + :: list 'a : 'A -> 'B + iff bt :: [ 'a : list 'a : 'A -> 'B] + bf :: [ 'A -> 'B] + + > IF_CONS bt bf / { a ; } : S => bt / a : { } : S + > IF_CONS bt bf / {} : S => bf / S + +- ``MAP body``: Apply the body expression to each element of the list. + The body sequence has access to the stack. + +:: + + :: (list 'elt) : 'A -> (list 'b) : 'A + iff body :: [ 'elt : 'A -> 'b : 'A ] + + > MAP body / {} : S => {} : S + > MAP body / { a ; } : S => { b ; } : S'' + where body / a : S => b : S' + and MAP body / { } : S' => { } : S'' + +- ``SIZE``: Get the number of elements in the list. + +:: + + :: list 'elt : 'S -> nat : 'S + + > SIZE / { _ ; } : S => 1 + s : S + where SIZE / { } : S => s : S + > SIZE / {} : S => 0 : S + + +- ``ITER body``: Apply the body expression to each element of a list. + The body sequence has access to the stack. + +:: + + :: (list 'elt) : 'A -> 'A + iff body :: [ 'elt : 'A -> 'A ] + > ITER body / {} : S => S + > ITER body / { a ; } : S => ITER body / { } : S' + iff body / a : S => S' + + +Domain specific data types +-------------------------- + +- ``timestamp``: Dates in the real world. + +- ``mutez``: A specific type for manipulating tokens. + +- ``address``: An untyped address (implicit account or smart contract). + +- ``contract 'param``: A contract, with the type of its code, + ``contract unit`` for implicit accounts. + +- ``operation``: An internal operation emitted by a contract. + +- ``key``: A public cryptographic key. + +- ``key_hash``: The hash of a public cryptographic key. + +- ``signature``: A cryptographic signature. + +- ``chain_id``: An identifier for a chain, used to distinguish the test and the main chains. + +- ``bls12_381_g1``, ``bls12_381_g2`` : Points on the BLS12-381 curves G\ :sub:`1`\ and G\ :sub:`2`\ , respectively. + +- ``bls12_381_fr`` : An element of the scalar field F\ :sub:`r`\ , used for scalar multiplication on the BLS12-381 curves G\ :sub:`1`\ and G\ :sub:`2`\ . + +- ``sapling_transaction ms``: A :doc:`Sapling ` transaction + +- ``sapling_state ms``: A :doc:`Sapling ` state + +- ``ticket (t)``: A ticket used to authenticate information of type ``(t)`` on-chain. + +- ``chest``: a timelocked chest containing bytes and information to open it. + see :doc:`Timelock ` . + +- ``chest_key``: used to open a chest, also contains a proof + to check the correctness of the opening. see :doc:`Timelock ` . + +- ``tx_rollup_l2_address``: An address used to identify an account in a transaction rollup ledger. It is the hash of a BLS public key, used to authenticate layer-2 operations to transfer tickets from this account. + + +Domain specific operations +-------------------------- + +Operations on timestamps +~~~~~~~~~~~~~~~~~~~~~~~~ + +Timestamps can be obtained by the ``NOW`` operation, or retrieved from +script parameters or globals. + +- ``ADD`` Increment / decrement a timestamp of the given number of + seconds. + +:: + + :: timestamp : int : 'S -> timestamp : 'S + :: int : timestamp : 'S -> timestamp : 'S + + > ADD / seconds : nat (t) : S => (seconds + t) : S + > ADD / nat (t) : seconds : S => (t + seconds) : S + +- ``SUB`` Subtract a number of seconds from a timestamp. + +:: + + :: timestamp : int : 'S -> timestamp : 'S + + > SUB / seconds : nat (t) : S => (seconds - t) : S + +- ``SUB`` Subtract two timestamps. + +:: + + :: timestamp : timestamp : 'S -> int : 'S + + > SUB / seconds(t1) : seconds(t2) : S => (t1 - t2) : S + +- ``COMPARE``: Timestamp comparison. + +:: + + :: timestamp : timestamp : 'S -> int : 'S + + > COMPARE / seconds(t1) : seconds(t2) : S => -1 : S + iff t1 < t2 + > COMPARE / seconds(t1) : seconds(t2) : S => 0 : S + iff t1 = t2 + > COMPARE / seconds(t1) : seconds(t2) : S => 1 : S + iff t1 > t2 + + +Operations on Mutez +~~~~~~~~~~~~~~~~~~~ + +Mutez (micro-Tez) are internally represented by a 64 bit signed +integers. There are restrictions to prevent creating a negative amount +of mutez. Operations are limited to prevent overflow and mixing them +with other numerical types by mistake. They are also mandatory checked +for under/overflows. + +- ``ADD`` + +:: + + :: mutez : mutez : 'S -> mutez : 'S + + > ADD / x : y : S => [FAILED] on overflow + > ADD / x : y : S => (x + y) : S + +- ``SUB_MUTEZ`` + +:: + + :: mutez : mutez : 'S -> option mutez : 'S + + > SUB_MUTEZ / x : y : S => None + iff x < y + > SUB_MUTEZ / x : y : S => Some (x - y) : S + +- ``MUL`` + +:: + + :: mutez : nat : 'S -> mutez : 'S + :: nat : mutez : 'S -> mutez : 'S + + > MUL / x : y : S => [FAILED] on overflow + > MUL / x : y : S => (x * y) : S + +- ``EDIV`` + +:: + + :: mutez : nat : 'S -> option (pair mutez mutez) : 'S + :: mutez : mutez : 'S -> option (pair nat mutez) : 'S + + > EDIV / x : 0 : S => None + > EDIV / x : y : S => Some (Pair (x / y) (x % y)) : S + iff y <> 0 + +- ``COMPARE``: Mutez comparison + +:: + + :: mutez : mutez : 'S -> int : 'S + + > COMPARE / x : y : S => -1 : S + iff x < y + > COMPARE / x : y : S => 0 : S + iff x = y + > COMPARE / x : y : S => 1 : S + iff x > y + +Operations on contracts +~~~~~~~~~~~~~~~~~~~~~~~ + +- ``CREATE_CONTRACT { storage 'g ; parameter 'p ; code ... }``: + Forge a new contract from a literal. + +:: + + :: option key_hash : mutez : 'g : 'S + -> operation : address : 'S + +Originate a contract based on a literal. The parameters are the +optional delegate, the initial amount taken from the current +contract, and the initial storage of the originated contract. +The contract is returned as a first class value (to be dropped, passed +as parameter or stored). The ``CONTRACT 'p`` instruction will fail +until it is actually originated. Note that since ``tz4`` addresses +cannot be registered as delegates, the origination operation will fail +if the delegate is a ``tz4``. + +- ``TRANSFER_TOKENS``: Forge a transaction. + +:: + + :: 'p : mutez : contract 'p : 'S -> operation : 'S + +The parameter must be consistent with the one expected by the +contract, unit for an account. + +.. _MichelsonSetDelegate_mumbai: + +- ``SET_DELEGATE``: Set or withdraw the contract's delegation. + +:: + + :: option key_hash : 'S -> operation : 'S + +Using this instruction is the only way to modify the delegation of a +smart contract. If the parameter is ``None`` then the delegation of the +current contract is withdrawn; if it is ``Some kh`` where ``kh`` is the +key hash of a registered delegate that is not the current delegate of +the contract, then this operation sets the delegate of the contract to +this registered delegate. The operation fails if ``kh`` is the current +delegate of the contract or if ``kh`` is not a registered delegate. +Note that ``tz4`` addresses cannot be registered as delegates. + +- ``BALANCE``: Push the current amount of mutez held by the executing + contract, including any mutez added by the calling transaction. + +:: + + :: 'S -> mutez : 'S + +- ``ADDRESS``: Cast the contract to its address. + +:: + + :: contract _ : 'S -> address : 'S + + > ADDRESS / addr : S => addr : S + +- ``CONTRACT 'p``: Cast the address to the given contract type if possible. + +:: + + :: address : 'S -> option (contract 'p) : 'S + + > CONTRACT / addr : S => Some addr : S + iff addr exists and is a contract of parameter type 'p + > CONTRACT / addr : S => Some addr : S + iff 'p = unit and addr is an implicit contract + > CONTRACT / addr : S => None : S + otherwise + +- ``SOURCE``: Push the contract that initiated the current + transaction, i.e. the contract that paid the fees and + storage cost, and whose manager signed the operation + that was sent on the blockchain. Note that since + ``TRANSFER_TOKENS`` instructions can be chained, + ``SOURCE`` and ``SENDER`` are not necessarily the same. + +:: + + :: 'S -> address : 'S + +- ``SENDER``: Push the contract that initiated the current + internal transaction. It may be the ``SOURCE``, but may + also be different if the source sent an order to an intermediate + smart contract, which then called the current contract. + +:: + + :: 'S -> address : 'S + +- ``SELF``: Push the current contract. + +:: + + :: 'S -> contract 'p : 'S + where contract 'p is the type of the current contract + +Note that ``SELF`` is forbidden in lambdas because it cannot be +type-checked; the type of the contract executing the lambda cannot be +known at the point of type-checking the lambda's body. + +- ``SELF_ADDRESS``: Push the address of the current contract. This is + equivalent to ``SELF; ADDRESS`` except that it is allowed in + lambdas. + +:: + + :: 'S -> address : 'S + +Note that ``SELF_ADDRESS`` inside a lambda returns the address of the +contract executing the lambda, which can be different from the address +of the contract in which the ``SELF_ADDRESS`` instruction is written. + +- ``AMOUNT``: Push the amount of the current transaction. + +:: + + :: 'S -> mutez : 'S + +- ``IMPLICIT_ACCOUNT``: Return a default contract with the given + public/private key pair. Any funds deposited in this contract can + immediately be spent by the holder of the private key. This contract + cannot execute Michelson code and will always exist on the + blockchain. + +:: + + :: key_hash : 'S -> contract unit : 'S + +- ``VOTING_POWER``: Return the voting power of a given contract. This + voting power coincides with the weight of the contract in the + voting listings, which is calculated at the beginning of every + voting period. Currently the voting power is proportional to the + full staking balance of the contract, but this might change in + future version of the protocol and developers should not rely on + this. Hence, the value returned by ``VOTING_POWER`` should only be + considered relative to the one returned by ``TOTAL_VOTING_POWER``. + +:: + + :: key_hash : 'S -> nat : 'S + +Special operations +~~~~~~~~~~~~~~~~~~ + +- ``NOW``: Push the minimal injection time for the current block, + namely the block whose validation triggered this execution. The + minimal injection time is 60 seconds after the timestamp of the + predecessor block. This value does not change during the execution + of the contract. + +:: + + :: 'S -> timestamp : 'S + +- ``CHAIN_ID``: Push the chain identifier. + +:: + + :: 'S -> chain_id : 'S + +- ``COMPARE``: Chain identifier comparison + +:: + + :: chain_id : chain_id : 'S -> int : 'S + + > COMPARE / x : y : S => -1 : S + iff x < y + > COMPARE / x : y : S => 0 : S + iff x = y + > COMPARE / x : y : S => 1 : S + iff x > y + +- ``LEVEL``: Push the level of the current transaction's block. + +:: + + :: 'S -> nat : 'S + +- ``TOTAL_VOTING_POWER``: Return the total voting power of all contracts. The total + voting power coincides with the sum of the voting power of every contract in + the voting listings (as returned by ``VOTING_POWER``). The voting listings is calculated at the beginning of every + voting period. + +:: + + :: 'S -> nat : 'S + +- ``MIN_BLOCK_TIME``: Push the current minimal block time in seconds. + +:: + + :: 'S -> nat : 'S + +Operations on bytes +~~~~~~~~~~~~~~~~~~~ + +Bytes are used for serializing data, in order to check signatures and +compute hashes on them. They can also be used to incorporate data from +the wild and untyped outside world. + +- ``PACK``: Serializes a piece of data to its optimized + binary representation. + +:: + + :: 'a : 'S -> bytes : 'S + +- ``UNPACK 'a``: Deserializes a piece of data, if valid. + +:: + + :: bytes : 'S -> option 'a : 'S + +- ``CONCAT``: Byte sequence concatenation. + +:: + + :: bytes : bytes : 'S -> bytes : 'S + + > CONCAT / s : t : S => (s ^ t) : S + + :: bytes list : 'S -> bytes : 'S + + > CONCAT / {} : S => 0x : S + > CONCAT / { s ; } : S => (s ^ r) : S + where CONCAT / { } : S => r : S + +- ``SIZE``: size of a sequence of bytes. + +:: + + :: bytes : 'S -> nat : 'S + +- ``SLICE``: Bytes access. + +:: + + :: nat : nat : bytes : 'S -> option bytes : 'S + + > SLICE / offset : length : s : S => Some ss : S + where ss is the substring of s at the given offset and of the given length + iff offset and (offset + length) are in bounds + > SLICE / offset : length : s : S => None : S + iff offset or (offset + length) are out of bounds + +- ``COMPARE``: Lexicographic comparison. + +:: + + :: bytes : bytes : 'S -> int : 'S + + > COMPARE / s : t : S => -1 : S + iff s < t + > COMPARE / s : t : S => 0 : S + iff s = t + > COMPARE / s : t : S => 1 : S + iff s > t + +Bitwise logical operators are also available on bytes. + +- ``OR`` + +:: + + :: bytes : bytes : 'S -> bytes : 'S + + > OR / x : y : S => (x | y) : S + +- ``AND`` + +:: + + :: bytes : bytes : 'S -> bytes : 'S + + > AND / x : y : S => (x & y) : S + +- ``XOR`` + +:: + + :: bytes : bytes : 'S -> bytes : 'S + + > XOR / x : y : S => (x ^ y) : S + +- ``NOT`` + +:: + + :: bytes : 'S -> bytes : 'S + + > NOT / x : S => ~x : S + +Logical shifts are also available on bytes. + +- ``LSL`` + +:: + + :: bytes : nat : 'S -> bytes : 'S + + > LSL / x : s : S => (x << s) : S + iff s <= 64000 + > LSL / x : s : S => [FAILED] + iff s > 64000 + +- ``LSR`` + +:: + + :: bytes : nat : 'S -> bytes : 'S + + > LSR / x : s : S => (x >> s) : S + iff s <= 256 + > LSR / x : s : S => [FAILED] + iff s > 256 + +Bytes can be converted to natural numbers and integers. + +- ``NAT``: Convert ``bytes`` to type ``nat`` using big-endian encoding. + The ``bytes`` are allowed to have leading zeros. + +:: + + :: bytes : 'S -> nat : 'S + + > NAT / s : S => n : S + iff s is a big-endian encoding of natural number n + +- ``INT``: Convert ``bytes`` to type ``int`` using big-endian two's complement encoding. + The ``bytes`` are allowed to have leading zeros for non-negative numbers and leading ones for negative numbers. + +:: + + :: bytes : 'S -> int : 'S + + > INT / s : S => z : S + iff s is a big-endian encoding of integer z + +- ``BYTES``: Convert a ``nat`` or an ``int`` to type ``bytes`` using big-endian encoding (and two's complement for ``int``). + +:: + + :: int : 'S -> bytes : 'S + :: nat : 'S -> bytes : 'S + + > BYTES / n : S => s : S + iff s is the shortest big-endian encoding of natural number or integer n + +Cryptographic primitives +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``HASH_KEY``: Compute the b58check of a public key. + +:: + + :: key : 'S -> key_hash : 'S + +- ``BLAKE2B``: Compute a cryptographic hash of the value contents using the + Blake2b-256 cryptographic hash function. + +:: + + :: bytes : 'S -> bytes : 'S + +- ``KECCAK``: Compute a cryptographic hash of the value contents using the + Keccak-256 cryptographic hash function. + +:: + + :: bytes : 'S -> bytes : 'S + +- ``SHA256``: Compute a cryptographic hash of the value contents using the + Sha256 cryptographic hash function. + +:: + + :: bytes : 'S -> bytes : 'S + +- ``SHA512``: Compute a cryptographic hash of the value contents using the + Sha512 cryptographic hash function. + +:: + + :: bytes : 'S -> bytes : 'S + +- ``SHA3``: Compute a cryptographic hash of the value contents using the + SHA3-256 cryptographic hash function. + +:: + + :: bytes : 'S -> bytes : 'S + +- ``CHECK_SIGNATURE``: Check that a sequence of bytes has been signed + with a given key. + +:: + + :: key : signature : bytes : 'S -> bool : 'S + +- ``COMPARE``: Key hash, key and signature comparison + +:: + + :: key_hash : key_hash : 'S -> int : 'S + :: key : key : 'S -> int : 'S + :: signature : signature : 'S -> int : 'S + + > COMPARE / x : y : S => -1 : S + iff x < y + > COMPARE / x : y : S => 0 : S + iff x = y + > COMPARE / x : y : S => 1 : S + iff x > y + +BLS12-381 primitives +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``NEG``: Negate a curve point or field element. + +:: + + :: bls12_381_g1 : 'S -> bls12_381_g1 : 'S + :: bls12_381_g2 : 'S -> bls12_381_g2 : 'S + :: bls12_381_fr : 'S -> bls12_381_fr : 'S + +- ``ADD``: Add two curve points or field elements. + +:: + + :: bls12_381_g1 : bls12_381_g1 : 'S -> bls12_381_g1 : 'S + :: bls12_381_g2 : bls12_381_g2 : 'S -> bls12_381_g2 : 'S + :: bls12_381_fr : bls12_381_fr : 'S -> bls12_381_fr : 'S + +- ``MUL``: Multiply a curve point or field element by a scalar field element. Fr + elements can be built from naturals by multiplying by the unit of Fr using ``PUSH bls12_381_fr 1; MUL``. Note + that the multiplication will be computed using the natural modulo the order + of Fr. + +:: + + :: bls12_381_g1 : bls12_381_fr : 'S -> bls12_381_g1 : 'S + :: bls12_381_g2 : bls12_381_fr : 'S -> bls12_381_g2 : 'S + :: bls12_381_fr : bls12_381_fr : 'S -> bls12_381_fr : 'S + :: nat : bls12_381_fr : 'S -> bls12_381_fr : 'S + :: int : bls12_381_fr : 'S -> bls12_381_fr : 'S + :: bls12_381_fr : nat : 'S -> bls12_381_fr : 'S + :: bls12_381_fr : int : 'S -> bls12_381_fr : 'S + +- ``INT``: Convert a field element to type ``int``. The returned value is always between ``0`` (inclusive) and the order of Fr (exclusive). + +:: + + :: bls12_381_fr : 'S -> int : 'S + +- ``PAIRING_CHECK``: + Verify that the product of pairings of the given list of points is equal to 1 in Fq12. Returns ``true`` if the list is empty. + Can be used to verify if two pairings P1 and P2 are equal by verifying P1 * P2^(-1) = 1. + +:: + + :: list (pair bls12_381_g1 bls12_381_g2) : 'S -> bool : 'S + + +Sapling operations +~~~~~~~~~~~~~~~~~~ + +Please see the :doc:`Sapling integration` page for a more +comprehensive description of the Sapling protocol. + +- ``SAPLING_VERIFY_UPDATE``: verify and apply a transaction on a Sapling state. + +:: + + :: sapling_transaction ms : sapling_state ms : 'S -> option (pair bytes (pair int (sapling_state ms))): 'S + + > SAPLING_VERIFY_UPDATE / t : s : S => Some (Pair bound_data (Pair balance s')) : S + iff the transaction t successfully applied on state s resulting + in the bound_data and the balance of the transaction and an updated state s' + > SAPLING_VERIFY_UPDATE / t : s : S => None : S + iff the transaction t is invalid with respect to the state + +- ``SAPLING_EMPTY_STATE ms``: Pushes an empty state on the stack. + + :: + + :: 'S -> sapling_state ms: 'S + + > SAPLING_EMPTY_STATE ms / S => sapling_state ms : S + with `sapling_state ms` being the empty state (ie. no one can spend tokens from it) + with memo_size `ms` + +.. _MichelsonTickets_mumbai: + +Operations on tickets +~~~~~~~~~~~~~~~~~~~~~ + +The following operations deal with tickets. Tickets are a way for smart-contracts +to authenticate data with respect to a Tezos address. This authentication can +then be used to build composable permission systems. + +A contract can create a ticket from a value and an amount. The ticket, when +inspected reveals the value, the amount, and the address of the ticketer (the contract that created the ticket). It is +impossible for a contract to “forge” a ticket that appears to have been created +by another ticketer. + +The amount is a meta-data that can be used to implement UTXOs. + +Tickets cannot be duplicated using the ``DUP`` instruction. + +For example, a ticket could represent a Non Fungible Token (NFT) or a Unspent +Transaction Output (UTXO) which can then be passed around and behave like a value. +This process can happen without the need to interact with a centralized NFT contract, +simplifying the code. + +- ``TICKET``: Create a ticket with the given content and amount. The ticketer is the address + of `SELF`. The resulting value is ``NONE`` if the amount is zero. + +:: + + :: 'a : nat : 'S -> option ticket 'a : 'S + +Type ``'a`` must be comparable (the ``COMPARE`` primitive must be defined over it). + +- ``READ_TICKET``: Retrieve the information stored in a ticket. Also return the ticket. + +:: + + :: ticket 'a : 'S -> pair address 'a nat : ticket 'a : 'S + +- ``SPLIT_TICKET``: Delete the given ticket and create two tickets with the + same content and ticketer as the original, but with the new provided amounts. + (This can be used to easily implement UTXOs.) + Return None iff the ticket's original amount is not equal to the sum of the + provided amounts, or one of the provided amounts is zero. + +:: + + :: ticket 'a : (pair nat nat) : 'S -> + option (pair (ticket 'a) (ticket 'a)) : 'S + +- ``JOIN_TICKETS``: The inverse of ``SPLIT_TICKET``. Delete the given tickets and create a ticket with an amount equal to the + sum of the amounts of the input tickets. + (This can be used to consolidate UTXOs.) + Return None iff the input tickets have a different ticketer or content. + +:: + + :: (pair (ticket 'a) (ticket 'a)) : 'S -> + option (ticket 'a) : 'S + +Operations on timelock +~~~~~~~~~~~~~~~~~~~~~~ + +- ``OPEN_CHEST``: opens a timelocked chest given its key and the time. The results can be bytes + if the opening is correct, or a boolean indicating whether the chest was incorrect, + or its opening was. See :doc:`Timelock ` for more information. + +:: + + :: chest_key : chest : nat : 'S -> or bytes bool : 'S + + +Events +~~~~~~ + +- ``EMIT %tag 'ty``: constructs an operation that will write an event into + the transaction receipt after the successful execution of this contract. + It accepts as arguments an annotation as a tag to the emitted event and + the type of data attachment. + + See :doc:`Event ` for more information. + +:: + + :: 'ty : 'S -> operation : 'S + + +Removed instructions +~~~~~~~~~~~~~~~~~~~~ + +:doc:`../protocols/005_babylon` deprecated the following instructions. Because no smart +contract used these on Mainnet before they got deprecated, they have been +removed. The Michelson type-checker will reject any contract using them. + +- ``CREATE_CONTRACT { storage 'g ; parameter 'p ; code ... }``: + Forge a new contract from a literal. + +:: + + :: key_hash : option key_hash : bool : bool : mutez : 'g : 'S + -> operation : address : 'S + +See the documentation of the new ``CREATE_CONTRACT`` instruction. The +first, third, and fourth parameters are ignored. + +- ``CREATE_ACCOUNT``: Forge an account creation operation. + +:: + + :: key_hash : option key_hash : bool : mutez : 'S + -> operation : address : 'S + +Takes as argument the manager, optional delegate, the delegatable flag +and finally the initial amount taken from the currently executed +contract. This instruction originates a contract with two entrypoints; +``%default`` of type ``unit`` that does nothing and ``%do`` of type +``lambda unit (list operation)`` that executes and returns the +parameter if the sender is the contract's manager. + +- ``STEPS_TO_QUOTA``: Push the remaining steps before the contract + execution must terminate. + +:: + + :: 'S -> nat : 'S + +.. _MichelsonViews_mumbai: + +Operations on views +~~~~~~~~~~~~~~~~~~~~ + +Views are a mechanism for contract calls that: + +- are read-only: they may depend on the storage of the contract declaring the view but cannot modify it nor emit operations (but they can call other views), +- take arguments as input in addition to the contract storage, +- return results as output, +- are synchronous: the result is immediately available on the stack of the caller contract. + +In other words, the execution of a view is included in the operation of caller's contract, but accesses the storage of the declarer's contract, in read-only mode. +Thus, in terms of execution, views are more like lambda functions rather than contract entrypoints, +Here is an example: + +:: + + code { + ...; + TRANSFER_TOKENS; + ...; + VIEW "view_ex" unit; + ...; + }; + +This contract calls a contract ``TRANSFER_TOKENS``, and, later on, a view called "view_ex". +No matter if the callee "view_ex" is defined in the same contract with this caller contract or not, +this view will be executed immediately in the current operation, +while the operations emitted by ``TRANSFER_TOKENS`` will be executed later on. +As a result, although it may seem that "view_ex" receives the storage modified by ``TRANSFER_TOKENS``, +this is not the case. +In other words, the storage of the view is the same as when the current contract was called. +In particular, in case of re-entrance, i.e., if a contract A calls a contract B that calls a view on A, the storage of the view will be the same as when B started, not when A started. + +Views are **declared** at the toplevel of the script of the contract on which they operate, +alongside the contract parameter type, storage type, and code. +To declare a view, the ``view`` keyword is used; its syntax is +``view name 'arg 'return { instr; ... }`` where: + +- ``name`` is a string of at most 31 characters matching the regular expression ``[a-zA-Z0-9_.%@]*``; it is used to identify the view, hence it must be different from the names of the other views declared in the same script; +- ``'arg`` is the type of the argument of the view; +- ``'return`` is the type of the result returned by the view; +- ``{ instr; ... }`` is a sequence of instructions of type ``lambda (pair 'arg 'storage_ty) 'return`` where ``'storage_ty`` is the type of the storage of the current contract. Certain specific instructions have different semantics in ``view``: ``BALANCE`` represents the current amount of mutez held by the contract where ``view`` is; ``SENDER`` represents the contract which is the caller of ``view``; ``SELF_ADDRESS`` represents the contract where ``view`` is; ``AMOUNT`` is always 0 mutez. + +Note that in both view input (type ``'arg``) and view output (type ``'return``), the following types are forbidden: ``ticket``, ``operation``, ``big_map`` and ``sapling_state``. + +Views are **called** using the following Michelson instruction: + +- ``VIEW name 'return``: Call the view named ``name`` from the contract whose address is the second element of the stack, sending it as input the top element of the stack. + +:: + + :: 'arg : address : 'S -> option 'return : 'S + + > VIEW name 'return / x : addr : S => Some y : S + iff addr is the address of a smart contract c with storage s + where c has a toplevel declaration of the form "view name 'arg 'return { code }" + and code / Pair x s : [] => y : [] + + > VIEW name 'return / _ : _ : S => None : S + otherwise + + + +If the given address is nonexistent or if the contract at that address does not have a view of the expected name and type, +``None`` will be returned. +Otherwise, ``Some a`` will be returned where ``a`` is the result of the view call. +Note that if a contract address containing an entrypoint ``address%entrypoint`` is provided, +only the ``address`` part will be taken. +``operation``, ``big_map`` and ``sapling_state`` and ``ticket`` types are forbidden for the ``'return`` type. + + +Here is an example using views, consisting of two contracts. +The first contract defines two views at toplevel that are named ``add_v`` and ``mul_v``. + +:: + + { parameter nat; + storage nat; + code { CAR; NIL operation ; PAIR }; + view "add_v" nat nat { UNPAIR; ADD }; + view "mul_v" nat nat { UNPAIR; MUL }; + } + + +The second contract calls the ``add_v`` view of the above contract and obtains a result immediately. + +:: + + { parameter (pair nat address) ; + storage nat ; + code { CAR ; UNPAIR; VIEW "add_v" nat ; + IF_SOME { } { FAIL }; NIL operation; PAIR }; } + +Macros +------ + +In addition to the operations above, several extensions have been added +to the language's concrete syntax. If you are interacting with the node +via RPC, bypassing the client, which expands away these macros, you will +need to desugar them yourself. + +These macros are designed to be unambiguous and reversible, meaning that +errors are reported in terms of desugared syntax. Below you'll see +these macros defined in terms of other syntactic forms. That is how +these macros are seen by the node. + +Compare +~~~~~~~ + +Syntactic sugar exists for merging ``COMPARE`` and comparison +combinators, and also for branching. + +- ``CMP{EQ|NEQ|LT|GT|LE|GE}`` + +:: + + > CMP(\op) / S => COMPARE ; (\op) / S + +- ``IF{EQ|NEQ|LT|GT|LE|GE} bt bf`` + +:: + + > IF(\op) bt bf / S => (\op) ; IF bt bf / S + +- ``IFCMP{EQ|NEQ|LT|GT|LE|GE} bt bf`` + +:: + + > IFCMP(\op) / S => COMPARE ; (\op) ; IF bt bf / S + +Fail +~~~~ + +The ``FAIL`` macros is equivalent to ``UNIT; FAILWITH`` and is callable +in any context since it does not use its input stack. + +- ``FAIL`` + +:: + + > FAIL / S => UNIT; FAILWITH / S + +Assertion macros +~~~~~~~~~~~~~~~~ + +All assertion operations are syntactic sugar for conditionals with a +``FAIL`` instruction in the appropriate branch. When possible, use them +to increase clarity about illegal states. + +- ``ASSERT`` + +:: + + > ASSERT => IF {} {FAIL} + +- ``ASSERT_{EQ|NEQ|LT|LE|GT|GE}`` + +:: + + > ASSERT_(\op) => IF(\op) {} {FAIL} + +- ``ASSERT_CMP{EQ|NEQ|LT|LE|GT|GE}`` + +:: + + > ASSERT_CMP(\op) => IFCMP(\op) {} {FAIL} + +- ``ASSERT_NONE`` + +:: + + > ASSERT_NONE => IF_NONE {} {FAIL} + +- ``ASSERT_SOME`` + +:: + + > ASSERT_SOME @x => IF_NONE {FAIL} {RENAME @x} + +- ``ASSERT_LEFT`` + +:: + + > ASSERT_LEFT @x => IF_LEFT {RENAME @x} {FAIL} + +- ``ASSERT_RIGHT`` + +:: + + > ASSERT_RIGHT @x => IF_LEFT {FAIL} {RENAME @x} + +Syntactic Conveniences +~~~~~~~~~~~~~~~~~~~~~~ + +These macros are simply more convenient syntax for various common +operations. + +- ``P(\left=A|P(\left)(\right))(\right=I|P(\left)(\right))R``: A syntactic sugar + for building nested pairs. In the case of right combs, `PAIR n` is more efficient. + +:: + + > PA(\right)R / S => DIP ((\right)R) ; PAIR / S + > P(\left)IR / S => (\left)R ; PAIR / S + > P(\left)(\right)R => (\left)R ; DIP ((\right)R) ; PAIR / S + +A good way to quickly figure which macro to use is to mentally parse the +macro as ``P`` for pair constructor, ``A`` for left leaf and ``I`` for +right leaf. The macro takes as many elements on the stack as there are +leaves and constructs a nested pair with the shape given by its name. + +Take the macro ``PAPPAIIR`` for instance: + +:: + + P A P P A I I R + ( l, ( ( l, r ), r )) + +A typing rule can be inferred: + +:: + + PAPPAIIR + :: 'a : 'b : 'c : 'd : 'S -> (pair 'a (pair (pair 'b 'c) 'd)) + +- ``UNP(\left=A|P(\left)(\right))(\right=I|P(\left)(\right))R``: A syntactic sugar + for destructing nested pairs. These macros follow the same convention + as the previous one. + +:: + + > UNPA(\right)R / S => UNPAIR ; DIP (UN(\right)R) / S + > UNP(\left)IR / S => UNPAIR ; UN(\left)R / S + > UNP(\left)(\right)R => UNPAIR ; DIP (UN(\right)R) ; UN(\left)R / S + +- ``C[AD]+R``: A syntactic sugar for accessing fields in nested pairs. In the case of right combs, ``CAR k`` and ``CDR k`` are more efficient. + +:: + + > CA(\rest=[AD]+)R / S => CAR ; C(\rest)R / S + > CD(\rest=[AD]+)R / S => CDR ; C(\rest)R / S + +- ``CAR k``: Access the ``k`` -th part of a right comb of size ``n > k + 1``. ``CAR 0`` is equivalent to ``CAR`` and in general ``CAR k`` is equivalent to ``k`` times the ``CDR`` instruction followed by once the ``CAR`` instruction. Note that this instruction cannot access the last element of a right comb; ``CDR k`` should be used for that. + +:: + + > CAR n / S => GET (2n+1) / S + +- ``CDR k``: Access the rightmost element of a right comb of size ``k``. ``CDR 0`` is a no-op, ``CDR 1`` is equivalent to ``CDR`` and in general ``CDR k`` is equivalent to ``k`` times the ``CDR`` instruction. Note that on a right comb of size ``n > k >= 2``, ``CDR k`` will return the right comb composed of the same elements but the ``k`` leftmost ones. + +:: + + > CDR n / S => GET (2n) / S + +- ``IF_SOME bt bf``: Inspect an optional value. + +:: + + > IF_SOME bt bf / S => IF_NONE bf bt / S + +- ``IF_RIGHT bt bf``: Inspect a value of a union. + +:: + + > IF_RIGHT bt bf / S => IF_LEFT bf bt / S + +- ``SET_CAR``: Set the left field of a pair. This is equivalent to ``SWAP; UPDATE 1``. + +:: + + > SET_CAR => CDR ; SWAP ; PAIR + +- ``SET_CDR``: Set the right field of a pair. This is equivalent to ``SWAP; UPDATE 2``. + +:: + + > SET_CDR => CAR ; PAIR + +- ``SET_C[AD]+R``: A syntactic sugar for setting fields in nested + pairs. In the case of right combs, `UPDATE n` is more efficient. + +:: + + > SET_CA(\rest=[AD]+)R / S => + { DUP ; DIP { CAR ; SET_C(\rest)R } ; CDR ; SWAP ; PAIR } / S + > SET_CD(\rest=[AD]+)R / S => + { DUP ; DIP { CDR ; SET_C(\rest)R } ; CAR ; PAIR } / S + +- ``MAP_CAR`` code: Transform the left field of a pair. + +:: + + > MAP_CAR code => DUP ; CDR ; DIP { CAR ; code } ; SWAP ; PAIR + +- ``MAP_CDR`` code: Transform the right field of a pair. + +:: + + > MAP_CDR code => DUP ; CDR ; code ; SWAP ; CAR ; PAIR + +- ``MAP_C[AD]+R`` code: A syntactic sugar for transforming fields in + nested pairs. + +:: + + > MAP_CA(\rest=[AD]+)R code / S => + { DUP ; DIP { CAR ; MAP_C(\rest)R code } ; CDR ; SWAP ; PAIR } / S + > MAP_CD(\rest=[AD]+)R code / S => + { DUP ; DIP { CDR ; MAP_C(\rest)R code } ; CAR ; PAIR } / S + +Concrete syntax +--------------- +.. _ConcreteSyntax_mumbai: + +The concrete language is very close to the formal notation of the +specification. Its structure is extremely simple: an expression in the +language can only be one of the five following constructs. + +1. An integer in decimal notation. +2. A character string. +3. A byte sequence in hexadecimal notation prefixed by ``0x``. +4. The application of a primitive to a sequence of expressions. +5. A sequence of expressions. + +This simple five cases notation is called :doc:`../shell/micheline`. + +In the Tezos protocol, the primitive ``constant`` with a single +character string applied has special meaning. See +:doc:`global_constants`. + +Constants +~~~~~~~~~ + +There are three kinds of constants: + +1. Integers or naturals in decimal notation. +2. Strings, with some usual escape sequences: ``\n``, ``\\``, + ``\"``. Unescaped line-breaks (both ``\n`` and ``\r``) cannot + appear in a Michelson string. Moreover, the current version of + Michelson restricts strings to be the printable subset of 7-bit + ASCII, namely characters with codes from within `[32, 126]` range, + plus the escaped characters mentioned above. +3. Byte sequences in hexadecimal notation, prefixed with ``0x``. + +Differences with the formal notation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The concrete syntax follows the same lexical conventions as the +specification: instructions are represented by uppercase identifiers, +type constructors by lowercase identifiers, and constant constructors +are capitalized. + +All domain specific constants are Micheline constants with specific +formats. Some have two variants accepted by the data type checker: a +readable one in a string, and an optimized one using a more compact +encoding. + +- ``mutez`` amounts are written as naturals. +- ``timestamp``\ s are written either using ``RFC3339`` notation + in a string (readable), or as the number of seconds since Epoch + (when positive) or before Epoch (when negative) (optimized). +- ``contract``\ s, ``address``\ es, ``key``\ s and ``signature``\ s + are written as strings, in their usual Base58 encoded versions + (readable), or as their raw bytes (optimized). +- ``bls12_381_g1``\ s and ``bls12_381_g2``\ s are written as their raw bytes, using a big-endian point encoding, `as specified here `__. +- ``bls12_381_fr``\ s are written as their raw bytes, using a little-endian encoding. + +The optimized versions should not reach the RPCs, the protocol code +will convert to optimized by itself when forging operations, storing +to the database, and before hashing to get a canonical representation +of a datum for a given type. + +To prevent errors, control flow primitives that take instructions as +parameters require sequences in the concrete syntax. + +:: + + IF { instr1_true ; instr2_true ; ... } + { instr1_false ; instr2_false ; ... } + +Main program structure +~~~~~~~~~~~~~~~~~~~~~~ + +The toplevel of a smart contract file must be an un-delimited sequence +of three primitive applications (in no particular order) that provide its +``code``, ``parameter`` and ``storage`` fields. + +See the next section for a concrete example. + +Annotations +----------- + +The annotation mechanism of Michelson provides ways to better track +data on the stack and to give additional type constraints. Except for +a single exception specified just after, annotations are only here to +add constraints, *i.e.* they cannot turn an otherwise rejected program +into an accepted one. The notable exception to this rule is for +entrypoints: the semantics of the `CONTRACT` and `SELF` instructions vary depending on +their constructor annotations, and some contract origination may fail due +to invalid entrypoint constructor annotations. + +Stack visualization tools like the Michelson's Emacs mode print +annotations associated with each type in the program, as propagated by +the typechecker as well as variable annotations on the types of elements +in the stack. This is useful as a debugging aid. + +We distinguish three kinds of annotations: + +- type annotations, written ``:type_annot``, +- variable annotations, written ``@var_annot``, +- and field or constructors annotations, written ``%field_annot``. + +Type annotations +~~~~~~~~~~~~~~~~ + +Each type can be annotated with at most one type annotation. They are +used to give names to types. For types to be equal, their unnamed +version must be equal and their names must be the same or at least one +type must be unnamed. + +For instance, the following Michelson program which put its integer +parameter in the storage is not well typed: + +.. code-block:: michelson + + parameter (int :p) ; + storage (int :s) ; + code { UNPAIR ; SWAP ; DROP ; NIL operation ; PAIR } + +Whereas this one is: + +.. code-block:: michelson + + parameter (int :p) ; + storage int ; + code { UNPAIR ; SWAP ; DROP ; NIL operation ; PAIR } + +Inner components of composed typed can also be named. + +:: + + (pair :point (int :x_pos) (int :y_pos)) + +Push-like instructions, that act as constructors, can also be given a +type annotation. The stack type will then have on top a type with a corresponding name. + +:: + + UNIT :t + :: 'A -> (unit :t) : 'A + + PAIR :t + :: 'a : 'b : 'S -> (pair :t 'a 'b) : 'S + + SOME :t + :: 'a : 'S -> (option :t 'a) : 'S + + NONE :t 'a + :: 'S -> (option :t 'a) : 'S + + LEFT :t 'b + :: 'a : 'S -> (or :t 'a 'b) : 'S + + RIGHT :t 'a + :: 'b : 'S -> (or :t 'a 'b) : 'S + + NIL :t 'a + :: 'S -> (list :t 'a) : 'S + + EMPTY_SET :t 'elt + :: 'S -> (set :t 'elt) : 'S + + EMPTY_MAP :t 'key 'val + :: 'S -> (map :t 'key 'val) : 'S + + EMPTY_BIG_MAP :t 'key 'val + :: 'S -> (big_map :t 'key 'val) : 'S + + +A no-op instruction ``CAST`` ensures the top of the stack has the +specified type, and change its type if it is compatible. In particular, +this allows to change or remove type names explicitly. + +:: + + CAST 'b + :: 'a : 'S -> 'b : 'S + iff 'a = 'b + + > CAST t / a : S => a : S + + +Variable annotations +~~~~~~~~~~~~~~~~~~~~ + +Variable annotations can only be used on instructions that produce +elements on the stack. An instruction that produces ``n`` elements on +the stack can be given at most ``n`` variable annotations. + +The stack type contains both the types of each element in the stack, as +well as an optional variable annotation for each element. In this +sub-section we note: + +- ``[]`` for the empty stack, +- ``@annot (top) : (rest)`` for the stack whose first value has type ``(top)`` and is annotated with variable annotation ``@annot`` and whose queue has stack type ``(rest)``. + +The instructions which do not accept any variable annotations are: + +:: + + DROP + SWAP + DIG + DUG + IF_NONE + IF_LEFT + IF_CONS + ITER + IF + LOOP + LOOP_LEFT + DIP + FAILWITH + +The instructions which accept at most one variable annotation are: + +:: + + DUP + PUSH + UNIT + SOME + NONE + PAIR + CAR + CDR + LEFT + RIGHT + NIL + CONS + SIZE + MAP + MEM + EMPTY_SET + EMPTY_MAP + EMPTY_BIG_MAP + UPDATE + GET + LAMBDA + LAMBDA_REC + EXEC + ADD + SUB + CONCAT + MUL + OR + AND + XOR + NOT + ABS + ISNAT + INT + NEG + EDIV + LSL + LSR + COMPARE + EQ + NEQ + LT + GT + LE + GE + ADDRESS + CONTRACT + SET_DELEGATE + IMPLICIT_ACCOUNT + NOW + LEVEL + AMOUNT + BALANCE + HASH_KEY + CHECK_SIGNATURE + BLAKE2B + SOURCE + SENDER + SELF + SELF_ADDRESS + CAST + RENAME + CHAIN_ID + NAT + BYTES + +The instructions which accept at most two variable annotations are: + +:: + + UNPAIR + CREATE_CONTRACT + +Annotations on instructions that produce multiple elements on the stack +will be used in order, where the first variable annotation is given to +the top-most element on the resulting stack. Instructions that produce +``n`` elements on the stack but are given less than ``n`` variable +annotations will see only their top-most stack type elements annotated. + +:: + + UNPAIR @first @second + :: pair 'a 'b : 'S + -> @first 'a : @second 'b : 'S + + UNPAIR @first + :: pair 'a 'b : 'S + -> @first 'a : 'b : 'S + +A no-op instruction ``RENAME`` allows to rename variables in the stack +or to erase variable annotations in the stack. + +:: + + RENAME @new + :: @old 'a ; 'S -> @new 'a : 'S + + RENAME + :: @old 'a ; 'S -> 'a : 'S + + +Field and constructor annotations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Components of pair types, option types and or types can be annotated +with a field or constructor annotation. This feature is useful to encode +records fields and constructors of sum types. + +:: + + (pair :point + (int %x) + (int %y)) + +The previous Michelson type can be used as visual aid to represent the +record type (given in OCaml-like syntax): + +:: + + type point = { x : int ; y : int } + +Similarly, + +:: + + (or :t + (int %A) + (or + (bool %B) + (pair %C + (nat %n1) + (nat %n2)))) + +can be used to represent the algebraic data type (in OCaml-like syntax): + +:: + + type t = + | A of int + | B of bool + | C of { n1 : nat ; n2 : nat } + + +Field annotations are part of the type (at the same level as type name +annotations), and so types with differing field names (if present) are +not considered equal. + +Instructions that construct elements of composed types can also be +annotated with one or multiple field annotations (in addition to type +and variable annotations). + +:: + + PAIR %fst %snd + :: 'a : 'b : 'S -> (pair ('a %fst) ('b %snd)) : 'S + + LEFT %left %right 'b + :: 'a : 'S -> (or ('a %left) ('b %right)) : 'S + + RIGHT %left %right 'a + :: 'b : 'S -> (or ('a %left) ('b %right)) : 'S + +To improve readability and robustness, instructions ``CAR`` and ``CDR`` +accept one field annotation. For the contract to type check, the name of +the accessed field in the destructed pair must match the one given here. + +:: + + CAR %fst + :: (pair ('a %fst) 'b) : S -> 'a : 'S + + CDR %snd + :: (pair 'a ('b %snd)) : S -> 'b : 'S + + +Syntax +~~~~~~ + +Primitive applications can receive one or many annotations. + +An annotation is a sequence of characters that matches the regular +expression ``@%|@%%|%@|[@:%][_0-9a-zA-Z][_0-9a-zA-Z\.%@]*``. +Note however that ``@%``, ``@%%`` and ``%@`` are +:ref:`special annotations ` and are not allowed everywhere. + +Annotations come after the primitive name and before its potential arguments. + +:: + + (prim @v :t %x arg1 arg2 ...) + + +Ordering between different kinds of annotations is not significant, but +ordering among annotations of the same kind is. Annotations of the same +kind must be grouped together. + +For instance these two annotated instructions are equivalent: + +:: + + PAIR :t @my_pair %x %y + + PAIR %x %y :t @my_pair + +An annotation can be empty, in this case it will mean *no annotation* +and can be used as a wildcard. For instance, it is useful to annotate +only the right field of a pair instruction ``PAIR % %right`` or to +ignore field access constraints, *e.g.* in the macro ``UNPPAIPAIR %x1 % +%x3 %x4``. + +Annotations and macros +~~~~~~~~~~~~~~~~~~~~~~ + +Macros also support annotations, which are propagated on their expanded +forms. As with instructions, macros that produce ``n`` values on the +stack accept ``n`` variable annotations. + +:: + + DUU+P @annot + > DUU(\rest=U*)P @annot / S => DIP (DU(\rest)P @annot) ; SWAP / S + + C[AD]+R @annot %field_name + > CA(\rest=[AD]+)R @annot %field_name / S => CAR ; C(\rest)R @annot %field_name / S + > CD(\rest=[AD]+)R @annot %field_name / S => CDR ; C(\rest)R @annot %field_name / S + + CMP{EQ|NEQ|LT|GT|LE|GE} @annot + > CMP(\op) @annot / S => COMPARE ; (\op) @annot / S + +The variable annotation on ``SET_C[AD]+R`` and ``MAP_C[AD]+R`` annotates +the resulting toplevel pair while its field annotation is used to check +that the modified field is the expected one. + +:: + + SET_C[AD]+R @var %field + > SET_CAR @var %field => CDR %field ; SWAP ; PAIR @var + > SET_CDR @var %field => CAR %field ; PAIR @var + > SET_CA(\rest=[AD]+)R @var %field / S => + { DUP ; DIP { CAR ; SET_C(\rest)R %field } ; CDR ; SWAP ; PAIR @var } / S + > SET_CD(\rest=[AD]+)R @var %field/ S => + { DUP ; DIP { CDR ; SET_C(\rest)R %field } ; CAR ; PAIR @var } / S + + MAP_C[AD]+R @var %field code + > MAP_CAR code => DUP ; CDR ; DIP { CAR %field ; code } ; SWAP ; PAIR @var + > MAP_CDR code => DUP ; CDR %field ; code ; SWAP ; CAR ; PAIR @var + > MAP_CA(\rest=[AD]+)R @var %field code / S => + { DUP ; DIP { CAR ; MAP_C(\rest)R %field code } ; CDR ; SWAP ; PAIR @var} / S + > MAP_CD(\rest=[AD]+)R @var %field code / S => + { DUP ; DIP { CDR ; MAP_C(\rest)R %field code } ; CAR ; PAIR @var} / S + +Macros for nested ``PAIR`` accept multiple annotations. Field +annotations for ``PAIR`` give names to leaves of the constructed +nested pair, in order. This next snippet gives examples instead of +generic rewrite rules for readability purposes. + +:: + + PAPPAIIR @p %x1 %x2 %x3 %x4 + :: 'a : 'b : 'c : 'd : 'S + -> @p (pair ('a %x1) (pair (pair ('b %x) ('c %x3)) ('d %x4))) : 'S + + PAPAIR @p %x1 %x2 %x3 + :: 'a : 'b : 'c : 'S -> @p (pair ('a %x1) (pair ('b %x) ('c %x3))) : 'S + +Annotations for nested ``UNPAIR`` are deprecated. + +Automatic variable and field annotations inferring +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When no annotation is provided by the Michelson programmer, the +typechecker infers some annotations in specific cases. This greatly +helps users track information in the stack for bare contracts. + +For unannotated accesses with ``CAR`` and ``CDR`` to fields that are +named will be appended (with an additional ``.`` character) to the pair +variable annotation. + +:: + + CDAR + :: @p (pair ('a %foo) (pair %bar ('b %x) ('c %y))) : 'S -> @p.bar.x 'b : 'S + +If fields are not named but the pair is still named in the stack then +``.car`` or ``.cdr`` will be appended. + +:: + + CDAR + :: @p (pair 'a (pair 'b 'c)) : 'S -> @p.cdr.car 'b : 'S + +If the original pair is not named in the stack, but a field annotation +is present in the pair type the accessed value will be annotated with a +variable annotation corresponding to the field annotation alone. + +:: + + CDAR + :: (pair ('a %foo) (pair %bar ('b %x) ('c %y))) : 'S -> @bar.x 'b : 'S + +A similar mechanism is used for context dependent instructions: + +:: + + ADDRESS :: @c contract _ : 'S -> @c.address address : 'S + + CONTRACT 'p :: @a address : 'S -> @a.contract contract 'p : 'S + + BALANCE :: 'S -> @balance mutez : 'S + + SOURCE :: 'S -> @source address : 'S + + SENDER :: 'S -> @sender address : 'S + + SELF :: 'S -> @self contract 'p : 'S + + SELF_ADDRESS :: 'S -> @self address : 'S + + AMOUNT :: 'S -> @amount mutez : 'S + + NOW :: 'S -> @now timestamp : 'S + + LEVEL :: 'S -> @level nat : 'S + +Inside nested code blocks, bound items on the stack will be given a +default variable name annotation depending on the instruction and stack +type (which can be changed). For instance the annotated typing rule for +``ITER`` on lists is: + +:: + + ITER body + :: @l (list 'e) : 'A -> 'A + iff body :: [ @l.elt e' : 'A -> 'A ] + +Special annotations +~~~~~~~~~~~~~~~~~~~ +.. _SpecialAnnotations_mumbai: + +The special variable annotations ``@%`` and ``@%%`` can be used on instructions +``CAR``, ``CDR``, and ``UNPAIR``. It means to use the accessed field name (if any) as +a name for the value on the stack. The following typing rule +demonstrates their use for instruction ``CAR``. + +:: + + CAR @% + :: @p (pair ('a %fst) ('b %snd)) : 'S -> @fst 'a : 'S + + CAR @%% + :: @p (pair ('a %fst) ('b %snd)) : 'S -> @p.fst 'a : 'S + +The special field annotation ``%@`` can be used on instructions +``PAIR``, ``LEFT`` and ``RIGHT``. It means to use the variable +name annotation in the stack as a field name for the constructed +element. Two examples with ``PAIR`` follows, notice the special +treatment of annotations with ``.``. + +:: + + PAIR %@ %@ + :: @x 'a : @y 'b : 'S -> (pair ('a %x) ('b %y)) : 'S + + PAIR %@ %@ + :: @p.x 'a : @p.y 'b : 'S -> @p (pair ('a %x) ('b %y)) : 'S + :: @p.x 'a : @q.y 'b : 'S -> (pair ('a %x) ('b %y)) : 'S + +Entrypoints +----------- + +The specification up to this point has been mostly ignoring existence +of entrypoints: a mechanism of contract level polymorphism. This +mechanism is optional, non intrusive, and transparent to smart +contracts that don't use them. This section is to be read as a patch +over the rest of the specification, introducing rules that apply only +in presence of contracts that make use of entrypoints. + +Defining and calling entrypoints +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Entrypoints piggyback on the constructor annotations. A contract with +entrypoints is basically a contract that takes a disjunctive type (a +nesting of ``or`` types) as the root of its input parameter, decorated +with constructor annotations. An extra check is performed on these +constructor annotations: a contract cannot define two entrypoints with +the same name. + +An external transaction can include an entrypoint name alongside the +parameter value. In that case, if there is a constructor annotation +with this name at any position in the nesting of ``or`` types, the +value is automatically wrapped into the according constructors. If the +transaction specifies an entrypoint, but there is no such constructor +annotation, the transaction fails. + +For instance, suppose the following input type. + +``parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))`` + +The input values will be wrapped as in the following examples. + +:: + + +------------+-----------+---------------------------------+ + | entrypoint | input | wrapped input | + +------------+-----------+---------------------------------+ + | %A | 3 | Left (Left 3) | + | %B | False | Left (Right False) | + | %C | "bob" | Right (Right "bob") | + | %Z | Unit | Right (Left Unit) | + | %maybe_C | Right "x" | Right (Right "x") | + | %maybe_C | Left Unit | Right (Left Unit) | + +------------+-----------+---------------------------------+ + | not given | value | value (untouched) | + | %BAD | _ | failure, contract not called | + +------------+-----------+---------------------------------+ + +The ``default`` entrypoint +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A special semantics is assigned to the ``default`` entrypoint. If the +contract does not explicitly declare a ``default`` entrypoint, then it +is automatically assigned to the root of the parameter +type. Conversely, if the contract is called without specifying an +entrypoint, then it is assumed to be called with the ``default`` +entrypoint. This behaviour makes the entrypoint system completely +transparent to contracts that do not use it. + +This is the case for the previous example, for instance. If a value is +passed to such a contract specifying entrypoint ``default``, then the +value is fed to the contract untouched, exactly as if no entrypoint +was given. + +A non enforced convention is to make the entrypoint ``default`` of +type unit, and to implement the crediting operation (just receive the +transferred tokens). + +A consequence of this semantics is that if the contract uses the +entrypoint system and defines a ``default`` entrypoint somewhere else +than at the root of the parameter type, then it must provide an +entrypoint for all the paths in the toplevel disjunction. Otherwise, +some parts of the contracts would be dead code. + +Another consequence of setting the entrypoint somewhere else than at +the root is that it makes it impossible to send the raw values of the +full parameter type to a contract. A trivial solution for that is to +name the root of the type. The conventional name for that is ``root``. + +Let us recapitulate this by tweaking the names of the previous example. + +``parameter (or %root (or (nat %A) (bool %B)) (or (unit %default) string))`` + +The input values will be wrapped as in the following examples. + +:: + + +------------+---------------------+-----------------------+ + | entrypoint | input | wrapped input | + +------------+---------------------+-----------------------+ + | %A | 3 | Left (Left 3) | + | %B | False | Left (Right False) | + | %default | Unit | Right (Left Unit) | + | %root | Right (Right "bob") | Right (Right "bob") | + +------------+---------------------+-----------------------+ + | not given | Unit | Right (Left Unit) | + | %BAD | _ | failure, contract not | + +------------+---------------------+-----------------------+ + +Calling entrypoints from Michelson +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Michelson code can also produce transactions to a specific entrypoint. + +For this, both types ``address`` and ``contract`` have the ability to +denote not just an address, but a pair of an address and an +entrypoint. The concrete notation is ``"address%entrypoint"``. +Note that ``"address"`` is strictly equivalent to ``"address%default"``, +and for clarity, the second variant is forbidden in the concrete syntax. + +When the ``TRANSFER_TOKENS`` instruction is called, it places the +entrypoint provided in the contract handle in the transaction. + +The ``CONTRACT t`` instruction has a variant ``CONTRACT %entrypoint +t``, that works as follows. Note that ``CONTRACT t`` is strictly +equivalent to ``CONTRACT %default t``, and for clarity, the second +variant is forbidden in the concrete syntax. + +:: + + +---------------+---------------------+------------------------------------------+ + | input address | instruction | output contract | + +---------------+---------------------+------------------------------------------+ + | "addr" | CONTRACT t | (Some "addr") if contract exists, has a | + | | | default entrypoint of type t, or has no | + | | | default entrypoint and parameter type t | + +---------------+---------------------+------------------------------------------+ + | "addr%name" | CONTRACT t | (Some "addr%name") if addr exists and | + +---------------+---------------------+ has an entrypoint %name of type t | + | "addr" | CONTRACT %name t | | + +---------------+---------------------+------------------------------------------+ + | "addr%_" | CONTRACT %_ t | None | + +---------------+---------------------+------------------------------------------+ + +Similarly, the ``SELF`` instruction has a variant ``SELF %entrypoint``, +that is only well-typed if the current contract has an entrypoint named ``%entrypoint``. + +- ``SELF %entrypoint`` + +:: + + :: 'S -> contract 'p : 'S + where contract 'p is the type of the entrypoint %entrypoint of the current contract + +Implicit accounts are considered to have a single ``default`` +entrypoint of type ``Unit``. + +JSON syntax +----------- + +Micheline expressions are encoded in JSON like this: + +- An integer ``N`` is an object with a single field ``"int"`` whose + value is the decimal representation as a string. + + ``{ "int": "N" }`` + +- A string ``"contents"`` is an object with a single field ``"string"`` + whose value is the decimal representation as a string. + + ``{ "string": "contents" }`` + +- A sequence is a JSON array. + + ``[ expr, ... ]`` + +- A primitive application is an object with two fields ``"prim"`` for + the primitive name and ``"args"`` for the arguments (that must + contain an array). A third optional field ``"annots"`` contains a + list of annotations, including their leading ``@``, ``%`` or ``:`` + sign. + + ``{ "prim": "pair", "args": [ { "prim": "nat", "args": [] }, { "prim": "nat", "args": [] } ], "annots": [":t"] }`` + +As in the concrete syntax, all domain specific constants are encoded as +strings. + +Examples +--------- + +Contracts in the system are stored as a piece of code and a global data +storage. The type of the global data of the storage is fixed for each +contract at origination time. This is ensured statically by checking on +origination that the code preserves the type of the global data. For +this, the code of the contract is checked to be of type +``lambda (pair 'arg 'global) -> (pair (list operation) 'global)`` where +``'global`` is the type of the original global store given on origination. +The contract also takes a parameter and returns a list of internal operations, +hence the complete calling convention above. The internal operations are +queued for execution when the contract returns. + +Empty contract +~~~~~~~~~~~~~~ + +The simplest contract is the contract for which the ``parameter`` and +``storage`` are all of type ``unit``. This contract is as follows: + +.. code-block:: michelson + + code { CDR ; # keep the storage + NIL operation ; # return no internal operation + PAIR }; # respect the calling convention + storage unit; + parameter unit; + + +Example contract with entrypoints +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following contract maintains a number in its storage. It has two +entrypoints ``add`` and ``sub`` to modify it, and the default +entrypoint, of type ``unit`` will reset it to ``0``. + +:: + + { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; + storage int ; + code { AMOUNT ; PUSH mutez 0 ; ASSERT_CMPEQ ; UNPAIR ; + IF_LEFT + { IF_LEFT { ADD } { SWAP ; SUB } } + { DROP ; DROP ; PUSH int 0 } ; + NIL operation ; PAIR } } + + +Example contract with recursive lambda +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following contract computes the factorial of the given parameter +using a recursive function and then saves the result in the storage. + +In Michelson regular functions start with a stack containing a single +value, the function argument. If the function is of type ``lambda int +int``, when calling the function the stack will have just an +``int``. Recursive functions start with two values, the argument and +the function itself. Therefore, if the recursive function is of type +``lambda int int`` then, when it is being called, the stack will have +an ``int`` at the top and a ``lambda int int`` at the bottom. + +In this recursive factorial we can see the first branch of the ``IF``, +this is the base case. The second one performs the recursive call. To +do that, we need to access the function. This is what the ``DUP 3`` +instruction does. Then we decrement the argument and finally make the +recursive call with ``EXEC``. + +:: + + { parameter int; + storage int; + code { CAR ; + LAMBDA_REC int int + { DUP; + EQ; + IF { PUSH int 1 } + { DUP; + DUP 3; + PUSH int 1; + DUP 4; + SUB; + EXEC; + MUL}; + DIP { DROP 2 }}; + SWAP; + EXEC; + NIL operation; + PAIR}} + +Multisig contract +~~~~~~~~~~~~~~~~~ + +The multisig is a typical access control contract. The ownership of +the multisig contract is shared between ``N`` participants represented +by their public keys in the contract's storage. Any action on the +multisig contract needs to be signed by ``K`` participants where the +threshold ``K`` is also stored in the storage. + +To avoid replay of the signatures sent to the contract, the signed +data include not only a description of the action to perform but also +the address of the multisig contract and a counter that gets +incremented at each successful call to the contract. + +The multisig commands of :ref:`Octez command line client ` +use this +smart contract. Moreover, `functional correctness of this contract has +been verified +`__ +using the Coq proof assistant. + + +.. code-block:: michelson + + parameter (pair + (pair :payload + (nat %counter) # counter, used to prevent replay attacks + (or :action # payload to sign, represents the requested action + (pair :transfer # transfer tokens + (mutez %amount) # amount to transfer + (contract %dest unit)) # destination to transfer to + (or + (option %delegate key_hash) # change the delegate to this address + (pair %change_keys # change the keys controlling the multisig + (nat %threshold) # new threshold + (list %keys key))))) # new list of keys + (list %sigs (option signature))); # signatures + + storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; + + code + { + UNPAIR ; SWAP ; DUP ; DIP { SWAP } ; + DIP + { + UNPAIR ; + # pair the payload with the current contract address, to ensure signatures + # can't be replayed across different contracts if a key is reused. + DUP ; SELF ; ADDRESS ; CHAIN_ID ; PAIR ; PAIR ; + PACK ; # form the binary payload that we expect to be signed + DIP { UNPAIR @counter ; DIP { SWAP } } ; SWAP + } ; + + # Check that the counters match + UNPAIR @stored_counter; DIP { SWAP }; + ASSERT_CMPEQ ; + + # Compute the number of valid signatures + DIP { SWAP } ; UNPAIR @threshold @keys; + DIP + { + # Running count of valid signatures + PUSH @valid nat 0; SWAP ; + ITER + { + DIP { SWAP } ; SWAP ; + IF_CONS + { + IF_SOME + { SWAP ; + DIP + { + SWAP ; DIIP { DIP { DUP } ; SWAP } ; + # Checks signatures, fails if invalid + CHECK_SIGNATURE ; ASSERT ; + PUSH nat 1 ; ADD @valid } } + { SWAP ; DROP } + } + { + # There were fewer signatures in the list + # than keys. Not all signatures must be present, but + # they should be marked as absent using the option type. + FAIL + } ; + SWAP + } + } ; + # Assert that the threshold is less than or equal to the + # number of valid signatures. + ASSERT_CMPLE ; + DROP ; DROP ; + + # Increment counter and place in storage + DIP { UNPAIR ; PUSH nat 1 ; ADD @new_counter ; PAIR} ; + + # We have now handled the signature verification part, + # produce the operation requested by the signers. + NIL operation ; SWAP ; + IF_LEFT + { # Transfer tokens + UNPAIR ; UNIT ; TRANSFER_TOKENS ; CONS } + { IF_LEFT { + # Change delegate + SET_DELEGATE ; CONS } + { + # Change set of signatures + DIP { SWAP ; CAR } ; SWAP ; PAIR ; SWAP }} ; + PAIR } + + + +Full grammar +------------ + +:: + + ::= + | + | + | + | Unit + | True + | False + | Pair ... + | Left + | Right + | Some + | None + | Lambda_rec + | { ; ... } + | { Elt ; ... } + | instruction + ::= + | [0-9]+ + ::= + | + | - + ::= + | "*" + ::= + | \" + | \r + | \n + | \t + | \b + | \\ + | [^"\] + ::= + | 0x[0-9a-fA-F]+ + ::= + | { ... } + | DROP + | DROP + | DUP + | DUP + | SWAP + | DIG + | DUG + | PUSH + | SOME + | NONE + | UNIT + | NEVER + | IF_NONE { ... } { ... } + | PAIR + | PAIR + | CAR + | CDR + | UNPAIR + | UNPAIR + | LEFT + | RIGHT + | IF_LEFT { ... } { ... } + | NIL + | CONS + | IF_CONS { ... } { ... } + | SIZE + | EMPTY_SET + | EMPTY_MAP + | EMPTY_BIG_MAP + | MAP { ... } + | ITER { ... } + | MEM + | GET + | GET + | UPDATE + | UPDATE + | IF { ... } { ... } + | LOOP { ... } + | LOOP_LEFT { ... } + | LAMBDA { ... } + | LAMBDA_REC { ... } + | EXEC + | APPLY + | DIP { ... } + | DIP { ... } + | FAILWITH + | CAST + | RENAME + | CONCAT + | SLICE + | PACK + | UNPACK + | ADD + | SUB + | MUL + | EDIV + | ABS + | ISNAT + | INT + | NEG + | LSL + | LSR + | OR + | AND + | XOR + | NOT + | COMPARE + | EQ + | NEQ + | LT + | GT + | LE + | GE + | SELF + | SELF_ADDRESS + | CONTRACT + | TRANSFER_TOKENS + | SET_DELEGATE + | CREATE_CONTRACT { ... } + | IMPLICIT_ACCOUNT + | VOTING_POWER + | NOW + | LEVEL + | AMOUNT + | BALANCE + | CHECK_SIGNATURE + | BLAKE2B + | KECCAK + | SHA3 + | SHA256 + | SHA512 + | HASH_KEY + | SOURCE + | SENDER + | ADDRESS + | CHAIN_ID + | TOTAL_VOTING_POWER + | PAIRING_CHECK + | SAPLING_EMPTY_STATE + | SAPLING_VERIFY_UPDATE + | TICKET + | READ_TICKET + | SPLIT_TICKET + | JOIN_TICKETS + | OPEN_CHEST + | BYTES + | NAT + ::= + | + | option + | list + | set + | operation + | contract + | ticket + | pair ... + | or + | lambda + | map + | big_map + | bls12_381_g1 + | bls12_381_g2 + | bls12_381_fr + | sapling_transaction + | sapling_state + | chest + | chest_key + ::= + | unit + | never + | bool + | int + | nat + | string + | chain_id + | bytes + | mutez + | key_hash + | key + | signature + | timestamp + | address + | tx_rollup_l2_address + | option + | or + | pair ... + + +Reference implementation +------------------------ + +The language is implemented in OCaml as follows: + +- The lower internal representation is written as a GADT whose type + parameters encode exactly the typing rules given in this + specification. In other words, if a program written in this + representation is accepted by OCaml's typechecker, it is guaranteed + type-safe. This is of course also valid for programs not + handwritten but generated by OCaml code, so we are sure that any + manipulated code is type-safe. + + In the end, what remains to be checked is the encoding of the typing + rules as OCaml types, which boils down to half a line of code for + each instruction. Everything else is left to the venerable and well + trusted OCaml. + +- The interpreter is basically the direct transcription of the + rewriting rules presented above. It takes an instruction, a stack and + transforms it. OCaml's typechecker ensures that the transformation + respects the pre and post stack types declared by the GADT case for + each instruction. + + The only things that remain to be reviewed are value dependent + choices, such as we did not swap true and false when + interpreting the IF instruction. + +- The input, untyped internal representation is an OCaml ADT with + only 5 grammar constructions: ``String``, ``Int``, ``Bytes``, ``Seq`` and + ``Prim``. It is the target language for the parser, since not all + parsable programs are well typed, and thus could simply not be + constructed using the GADT. + +- The typechecker is a simple function that recognizes the abstract + grammar described in section X by pattern matching, producing the + well-typed, corresponding GADT expressions. It is mostly a checker, + not a full inferrer, and thus takes some annotations (basically the + input and output of the program, of lambdas and of uninitialized maps + and sets). It works by performing a symbolic evaluation of the + program, transforming a symbolic stack. It only needs one pass over + the whole program. + + Here again, OCaml does most of the checking, the structure of the + function is very simple, what we have to check is that we transform a + ``Prim ("If", ...)`` into an ``If``, a ``Prim ("Dup", ...)`` into a + ``Dup``, etc. diff --git a/docs/mumbai/plugins.rst b/docs/mumbai/plugins.rst new file mode 100644 index 000000000000..c79eed37240e --- /dev/null +++ b/docs/mumbai/plugins.rst @@ -0,0 +1,244 @@ +Protocol Plugins +================ + +This document describes the protocol plugins implemented in Octez. + +Protocol-specific shell plugins, simply called protocol plugins, +implement extra APIs needed by the shell in order to interact with the +economic protocol, beyond the one provided by the :doc:`protocol +environment <../shell/protocol_environment>`. +This code is not strictly speaking part of the protocol +code base, so this is not subject to on-chain governance (see +:doc:`voting procedure `), but it is still protocol-dependent, +which means that it may vary with different protocols. For instance, +the plugin code for protocol Alpha is located in file +:src:`src/proto_016_PtMumbai/lib_plugin/plugin.ml`. Thus, a specific version +is included in the Octez node for each protocol version (recall that a +new release of Octez is usually delivered for each new protocol +proposal, see :doc:`../releases/releases`) + +In contrast to the Octez code, plugins are protocol-specific and as +such, know how to read the content of an operation. + +So what kind of features may a protocol plugin provide? For instance, +protocol plugins do not define the context, or restrict the validity +of operations. +In turn protocol plugins may, for example: + +- perform protocol-dependent computations that require data not available + in the amendable part of the protocol like accessing the current time + to reason on timestamps (see :ref:`consensus_filter_mumbai`); +- preserve the opacity/abstraction barrier of the protocol's internal data + by performing computations on internal data without revealing it: + e.g., there are some RPCs that can introspect the protocol-dependent + content for certain operations; +- implement some common operations that are customized for each + protocol (e.g., :ref:`prevalidator_filters_mumbai`). + +.. _prevalidator_filters_mumbai: + +Prevalidator filters +-------------------- + +**Prevalidator filters**, which are detailed in the rest of this page, enable the node to discard some +operations (that cannot be included in the next block) faster and +restrict the operations it propagates to the network. +Filters are implemented as a node plugin and a specific filter is +delivered with each protocol version. When the chain switches to a new +protocol, the node installs its corresponding filters, *in lieu of* +the filters of the previous protocol. Notice that prevalidator filters are not +mandatory, their absence does not break the Tezos blockchain protocol. + +The interface of the prevalidator plugin is described at the :package-api:`mempool plugin API +`. + +The different kinds of prevalidator filters are described below. + +.. _fees_filter_mumbai: + +Fees filter +........... + +A very affordable technique for attackers is based on flooding the +network with, valid but useless, zero-fees operations. This is why the +prevalidator filter currently restricts operations based on their +associated fees, to reject "too cheap" or "zero-fees" operations. This +can be configured via the ``minimal_fees``, +``minimal_nanotez_per_gas_unit`` and ``minimal_nanotez_per_byte`` (see +:ref:`filter RPCs`) parameters of the filter +configuration of your node. + +This filtering strategy is implemented in the ``prefilter`` (see +:doc:`../shell/prevalidation`). + +.. _consensus_filter_mumbai: + +Consensus filter +................ + +For technical reasons, the economic protocol cannot reject consensus +operations based on their timestamp. Consequently, many +consensus operations are declared as valid by the economic protocol +while being timestamped too early or too late. +The plugin filter aims to narrow down the number of consensus +operations declared as valid based on several heuristics. In +particular, the filter can use the current timestamp while the +protocol cannot. + +This filter classifies a consensus operation according to the current +block proposal as follows: + +- ``Outdated`` if it concerns a previous head at a previous level, +- ``Branch_refused`` if it concerns a previous head at the same level + but in the previous round, +- ``Branch_delayed`` if it concerns a round in the future. + + +This filtering strategy is implemented in the ``prefilter`` (see +:doc:`../shell/prevalidation`). + +.. _precheck_filter_mumbai: + +Prechecking of manager operations +................................. + +.. FIXME tezos/tezos#3938: + + This section doesn't make much sense after the pipelining project + has plugged validate into the plugin for Lima. Parts of this + section be integrated into plugin.rst, and the relevant definitions + should point to the validation entry. + +The aim of the ``precheck`` filter is to avoid fully executing manager operations +before deciding whether to gossip them to the network. + +The detailed description of this feature is given in +:doc:`./precheck`. For operations other than manager operations, the +``precheck`` filter is a no-op, which entails that these operations need to be +fully executed to decide their propagation (see :doc:`../shell/prevalidation`). + + +One manager operation per manager per block +........................................... + +The mempool filters, ``prefilter``, ``precheck`` and ``postfilter`` +also ensure that, since the last head update (the last valid block which +increased the chain's fitness), only one operation per manager is propagated. +All other received operations originating from the same manager will be classified +as ``Branch_delayed`` and will not be propagated. + +Alternatively, a user can inject an operation with the same +manager and the same counter, but with a higher fee to replace an already existing +operation in the prevalidator. Only one of the two operations will be eventually +included in a block. To be able to replace the first operation, the fee and the +"fee/gas limit" ratio of the second one is supposed to be higher than the first's +by a factor (currently fixed to 5%). In case of successful replacement, the old +operation is re-classified as ``Outdated``. + +Concretely, a user can replace a successfully prechecked manager operation in the +mempool, with the help of ``octez-client``, using two methods : + +- manually provide a higher fee to bump the "fee/gas limit" ratio by at least 5% for the new + operation, +- via option ``--replace``: In this case, ``octez-client`` will automatically + compute the minimal amount of fee for the second operation to be able to + replace the one in the mempool. + + + +Operations prioritization and ordering +...................................... + + +In addition to quick detection of operations that have no chance to be +prechecked or applied in the current context, the mempool's ``prefilter`` provides +a priority for each successfully filtered operation. Concretely, the priority is +either ``High``, ``Medium`` or ``Low`` in the current implementation, depending +on the :ref:`validation pass`.Some extra information (like the fees, or the gas/fees +ratio of manager operations) are also provided along the priorities to enable +fine-grained operations ordering. +This extra information is similar to the one used by the baker's +operations selection mechanism, that decides which operations will be included +in the next block. + + +Bounding the number of propagated manager operations +..................................................... + +Up to Hangzhou protocol (see :doc:`../protocols/011_hangzhou`), the protocol plugin +did not implement ``precheck``, so the prevalidator exclusively relies on ``apply_operation`` +to classify manager operations. As a consequence, it could also check their +total gas consumption, and thus, naturally limit the number of successfully +applied/propagated operations. + +Starting with Ithaca protocol (see :doc:`../protocols/012_ithaca`), the plugin +implements a lightweight classification function, called ``precheck``, that +doesn't check the total gas consumption. So with this modication and those of +Octez 12.0, the prevalidator, would propagate any succesfully prevalidated +operation. In order to protect nodes from potential DDoS, a new mechanism has +been added in the plugin to bound the number of successfully prechecked +operations. This mechanism works as follows: + +- Advertise the *best* ``N`` successfully prechecked manager operations + (where "best" is w.r.t. the priority described above, and N is a tunable parameter) + found in the set of pending operations to the network after a new head is + chosen and operations' classification reset. All other pending operations that + should have been prechecked are instead classified as ``Branch_delayed``; +- Once the limit ``N`` is reached, the node may still receive additional manager + operations (via the network or RPC injection) with higher priorities than + those previously prechecked/advertised. Any such operation that is + successfully prechecked is advertised, and, in turn, the previously prechecked/advertised + manager operation with the lowest priority (not necessarily from the same + source) is reclassified as ``Branch_delayed``. + +The default value of the parameter ``N`` is chosen such that a node will always propagate enough +manager operations to allow the next baker to produce a filled block (if there are +enough operations in the network). Its value is currently fixed to 5000. +Indeed, the total size occupied by manager operations in a +block is currently bounded by 512 `KiB `_, and ``unset deposits limit`` seems +to be the smallest manager operation, with 126 Bytes, so there are at most +512 * 1024 / 126 = 4161 manager operations per block. + + +.. _active_filter_rpc_mumbai: + +Filters RPCs +~~~~~~~~~~~~ + +Filters are tunable by several parameters, whose values can be +retrieved and changed by users via the following RPC calls, +respectively: + +- ``rpc get /chains//mempool/filter`` +- ``rpc post /chains//mempool/filter`` + +The following parameters can be thus inspected and modified: + +- ``minimal_fees``: type ``int``, default ``100`` +- ``minimal_nanotez_per_gas_unit``: type ``int``, default ``100`` +- ``minimal_nanotez_per_byte``: type ``int``, default ``1000`` +- ``allow_script_failure``: type ``bool``, default ``true`` +- ``clock_drift`` : type ``Period.t option``, default ``None`` +- ``max_prechecked_manager_operations`` : type ``int``, default ``5000`` +- ``replace_by_fee_factor`` : type ``rational``, default ``21/20`` (ie. ``1.05%``) + +For example, each command below modifies the provided parameter and resets all +the others to their default values:: + + octez-client rpc post /chains/main/mempool/filter with '{ "minimal_fees": "42" }' + octez-client rpc post /chains/main/mempool/filter with '{ "replace_by_fee_factor": [ "23", "20" ] }' + octez-client rpc post /chains/main/mempool/filter with '{ "max_prechecked_manager_operations": 7500 }' + +Changing filters default configuration +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Changing filters configuration may not have the expected outcome. +Because the configuration is only changed on your node, and not on all +the gossip network nodes, this will only impact how operations of your +nodes are propagated. For example, assuming there are three nodes +``A``, ``B`` and ``C`` such that ``A`` is connected to ``B`` and ``B`` +is connected to ``C``. Assume that ``A`` modifies its filter +configuration so that ``minimal_fees`` is now ``0``. Then ``A`` may +propagate an operation with ``0`` fee to ``B``. However, because ``B`` +has the default filter configuration, this operation will not be +propagated to ``C`` (so ``C`` may never see it). diff --git a/docs/mumbai/precheck.rst b/docs/mumbai/precheck.rst new file mode 100644 index 000000000000..a81febfc82e3 --- /dev/null +++ b/docs/mumbai/precheck.rst @@ -0,0 +1,111 @@ +Prechecking of manager operations +================================= + +.. FIXME tezos/tezos#3938: + + This section doesn't make much sense after the pipelining project + has plugged validate into the plugin for Lima. Parts of this + section be integrated into plugin.rst, and the relevant definitions + should point to the validation entry. + +The prevalidator of Octez prevents the propagation of non-valid +operations by trying to apply (or execute) them. +However, executing +manager operations (like complex smart contract calls) can be +time-consuming. +To ensure a high throughput of the Tezos protocol, the +propagation of operations should be as fast as possible. This calls +for a lighter approach. + +Prechecking manager operations implements such a lighter approach, by +discarding most invalid operations, without executing any of them. +This is possible because the validity of an operation (in the sense, +being able to include it in a block) +depends on its solvability (see below :ref:`solvability_mumbai`). + +Fortunately, it turns out that deciding whether an operation is solvable can be achieved without +applying it. + +However, restricting the propagation to solvable operations is not enough to +ensure resilience against DDoS attacks. +It does not ensure their validity in a direct successor of the current +head. +For instance, given two manager operations from the same source and +with the same counter, these operations can be solvable in the same +Tezos context ``C``, but none of them is solvable in the context +resulting from the application of the other operation on ``C``. +To mitigate this situation, we further restrict the propagation of +manager operations to at most one manager operation per manager per +block. +Note however that one can still inject successive operations with the +same counter using the ``replace-by-fee`` feature. + + +.. _solvability_mumbai: + +Solvable operations +------------------- + +The solvability of an operation depends on the content of the Tezos +context in which it is applied. + + +In the following, we consider the context kept by the prevalidator +(see :doc:`../shell/prevalidation`). +Checking operation solvability with this context is lighter than with +the contexts for block validation or block construction: it can be +decided without checking whether the gas announced by the operation +is below the remaining gas for the whole block. +Checking solvability consists in verifying that the +operation is well-formed and that fees can be paid: no execution +of operations (especially of smart-contract code) is done to determine +whether they would be applied in the next block with a success or a +fail status (as done by operation application). + +Roughly, a manager operation is solvable when the following conditions hold: + +- The manager can afford to pay the operation fees in the current prevalidator context; +- the operation's counter is the successor of the operation counter associated to + the manager in the current context; +- the gas limit announced is below the gas limit per operation as + defined by the economic protocol; +- for manager operations with Michelson parameters, the + gas cost of deserialisation is under the gas limit announced by the + operation; and +- the signature of the operation is valid. + + +Co-precheckable operations +-------------------------- + +Two manager operations are *compatible* if they correspond to distinct managers. + +Two manager operations are *co-precheckable* in a context if they are +compatible and solvable in this context. + +Considering two co-precheckable operations in a context, the +application of one of them preserves the solvability of the other. + +This property extends to a set of manager operations if every pair of +distinct operations is co-precheckable. +In this case, the operations could be included in the next block in +any order, modulo block limits (eg. maximum gas, block size limit, +etc). + +The precheck of a manger operation, with respect to a context and a +set of co-precheckable operations, consists in checking whether adding +the operation to the set preserves the operations of the set being +co-precheckable. + +The prevalidator (see :doc:`../shell/prevalidation`) aims at +propagating operations that could be included in a direct successor +block of the current head. +It will propagate co-precheckable operations after checking their +solvability. + +In conclusion, manager operation precheck is a simplification over the real +application of operations: the prevalidator checks whether each +manager operation would be valid in a direct successor of the +current head, as long as gas is available in that block. +In other terms, during prechecking of manager operations, they have no +effect on the prevalidator context. diff --git a/docs/mumbai/proof_of_stake.rst b/docs/mumbai/proof_of_stake.rst new file mode 100644 index 000000000000..f00b7fe61614 --- /dev/null +++ b/docs/mumbai/proof_of_stake.rst @@ -0,0 +1,170 @@ +Proof-of-stake +============== + +Overview +-------- + +:doc:`The consensus algorithm ` in Tezos is based on the +*proof-of-stake* mechanism. Proof-of-stake means that participants +in the consensus algorithm are chosen in function of their stake (the +amount of tokens a participant has). The same mechanism is used in the +Tezos :doc:`governance `. + +If one does not have enough stake to participate on its own or does not want to +set up the needed infrastructure, (s)he can use :ref:`delegation +`. Therefore, in Tezos, it is the :ref:`delegates` +that may participate in consensus. +However, at each level, not all delegates necessarily participate, and their participation weight may differ. +The selection of the delegates' participation rights at a level is done by running a +PRNG (pseudo-random number generator). +The PRNG's :ref:`seeds ` are obtained from random +data that are regularly produced and stored on the blockchain. Thus, +the procedure is deterministic in that delegates' rights are uniquely +determined from the seed; and it is random, in that its seed (and hence its results) cannot +be predicted too much in advance. + + +Delegation +---------- + +A *delegate* is any :ref:`implicit account ` registered as +such by emitting a delegate registration operation. Note that ``tz4`` accounts +cannot be registered as delegate. + +Any :ref:`account ` (implicit or originated) can specify a delegate +through a delegation operation. +Any account can change or revoke its delegate at any time. However, the change +only becomes effective after ``PRESERVED_CYCLES + 2`` :ref:`cycles `. +The value ``PRESERVED_CYCLES`` is a +:ref:`protocol constant `. + +A delegate participates in consensus and in governance with a weight +proportional with their delegated stake, which includes the balances +of all the accounts that delegate to it, and also the balance of the +delegate itself. To participate in consensus or in governance, a +delegate needs to have at least a minimal stake, which is given by the +``TOKENS_PER_ROLL`` :ref:`protocol constant +`. + +Delegates place security deposits that may be forfeited in case they do not +follow (some particular rules of) the protocol. Security deposits are deduced +from the delegates' own balance. + + +Active and passive delegates +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _active_delegate_mumbai: + +A delegate can be marked as either active or passive. A passive +delegate cannot participate in the consensus algorithm. + +A delegate is marked as active at its registration. + +A delegate becomes passive at the end of cycle ``n`` when it has +failed to participate in the consensus algorithm in +the past ``PRESERVED_CYCLES + 1`` cycles. That is, in cycles ``n``, ``n-1``, +``n-2``, ..., ``n - PRESERVED_CYCLES``. + +Delegates' rights selection +--------------------------- + +Tezos being proof-of-stake, the delegates' rights are selected at random based on their +stake. In what follows we detail the selection mechanism used in Tezos. + +.. _random_seed_mumbai: + +Random seed +^^^^^^^^^^^ + +To each cycle is associated a random number called the +seed. This seed is used within its cycle to generate pseudo-random +values in the protocol, in particular for selecting delegates to participate in consensus. + +For more information on randomness generation, see :doc:`randomness-generation`. + +.. _snapshots_mumbai: + +Stake snapshots +^^^^^^^^^^^^^^^ + +Before turning to the rights selection mechanism, we first introduce a new +terminology, *stake snapshot*, to denote the stake distribution for a given block, +as stored in the :ref:`context`. +Stake snapshots are taken (and stored) every ``BLOCKS_PER_STAKE_SNAPSHOT`` levels. +More precisely, a snapshot is taken at a level if and only if its cycle +position modulo ``BLOCKS_PER_STAKE_SNAPSHOT`` is ``BLOCKS_PER_STAKE_SNAPSHOT - 1``. +Therefore, at the end of a cycle there are ``BLOCKS_PER_CYCLE / +BLOCKS_PER_STAKE_SNAPSHOT`` stored snapshots. + +At the end of cycle ``n-1-PRESERVED_CYCLES``, the snapshot for cycle +``n`` is randomly selected from the snapshots stored in cycle +``n-1-PRESERVED_CYCLES``. The selection is done through a very simple +PRNG having as seed the :ref:`random seed` for +cycle ``n``. + +Only the stake of active delegates with the minimal stake of ``TOKENS_PER_ROLL`` is snapshot. + +.. _rights_mumbai: + +Slot selection +^^^^^^^^^^^^^^ + +Delegates' rights to participate are determined using the `alias +method `_, more precisely +using `Vose's algorithm +`_ +(see also `this more pedagogic description +`_; the algorithm is the last one listed there). +This algorithm samples from a discrete probability distribution, which is given by +the stakes in a particular stake snapshot: the probability to sample a +particular delegate is its stake in the snapshot over the total stake +in that snapshot. + +Concretely, the delegates' rights at a given level are expressed in terms of +the (quantity of) *slots* that the delegate owns at that level. +This quantity represents the delegate's weight in consensus. +We note that, in the long run (that is, on average over many levels), the number of slots is proportional to its stake. +The owner of a slot is obtained by sampling using the algorithm +mentioned above. +More precisely, given a level and a slot (which is just a non-negative integer), +the mentioned algorithm is invoked to assign a delegate to the given slot. +Its input is the probability distribution given by the :ref:`stake +snapshot` for the cycle to which the level belongs. +And whenever the algorithm needs to draw a random value, this is obtained using a +simple procedure which has as its initial state: the level, the +:ref:`random seed` for the cycle to which the +level belongs, and the slot. + + +.. _ps_constants_mumbai: + +Proof-of-stake parameters +------------------------- + +.. list-table:: + :widths: 55 25 + :header-rows: 1 + + * - Parameter name + - Parameter value + * - ``BLOCKS_PER_CYCLE`` + - 8192 blocks + * - ``PRESERVED_CYCLES`` + - 5 cycles + * - ``TOKENS_PER_ROLL`` + - 6,000 ꜩ + * - ``BLOCKS_PER_STAKE_SNAPSHOT`` + - 512 blocks + + +Further External Resources +-------------------------- + +The original design of the proof-of-stake mechanism in Tezos can be +found in the `whitepaper +`_. + +Another presentation of the Tezos' proof-of-stake mechanism can be +found in the `Tezos agora wiki entry +`_. diff --git a/docs/mumbai/protocol.rst b/docs/mumbai/protocol.rst new file mode 100644 index 000000000000..f3974f59c9c3 --- /dev/null +++ b/docs/mumbai/protocol.rst @@ -0,0 +1,102 @@ +The economic protocol +===================== + +The economic protocol provides the rules for checking the validity of the blocks and operations, and for updating the blockchain state accordingly, by applying new valid blocks and operations on the current blockchain state. These rules can be changed through voting. +Thus, the +economic protocol represents the amendable part of Tezos. + +This page groups the documentation helping developers and users in +understanding the basic concepts of the economic protocol +(Proof Of Stake, consensus, voting, etc), its features (Michelson, +Sapling, etc), and some details about its implementation. + + +.. toctree:: + :maxdepth: 2 + + protocol_overview + +.. toctree:: + :maxdepth: 2 + + proof_of_stake + +.. toctree:: + :maxdepth: 2 + + randomness_generation + +.. toctree:: + :maxdepth: 2 + + consensus + +.. toctree:: + :maxdepth: 2 + + voting + +.. toctree:: + :maxdepth: 2 + + michelson + +.. toctree:: + :maxdepth: 2 + + timelock + +.. toctree:: + :maxdepth: 2 + + sapling + +.. toctree:: + :maxdepth: 2 + + liquidity_baking + +.. toctree:: + :maxdepth: 2 + + global_constants + +.. toctree:: + :maxdepth: 2 + + token_management + +.. toctree:: + :maxdepth: 2 + + precheck + +.. toctree:: + :maxdepth: 2 + + transaction_rollups + +.. toctree:: + :maxdepth: 2 + + smart_rollups + +.. toctree:: + :maxdepth: 2 + + plugins + +.. toctree:: + :maxdepth: 2 + + event + +.. toctree:: + :maxdepth: 2 + + blocks_ops + +.. toctree:: + :maxdepth: 2 + + validation diff --git a/docs/mumbai/protocol_overview.rst b/docs/mumbai/protocol_overview.rst new file mode 100644 index 000000000000..4e849f8b02d9 --- /dev/null +++ b/docs/mumbai/protocol_overview.rst @@ -0,0 +1,183 @@ +Overview of the economic protocol +================================= + +Tezos overview +~~~~~~~~~~~~~~ + +Tezos is a distributed system in which nodes agree upon a chain of blocks of +operations. Tezos is also an account-based crypto-ledger, where an account is +associated to a public-private key pair, and has a balance, that is, a number of +tokens. Tezos is a :doc:`proof-of-stake` system in which any +account that has a minimal stake amount has the right to produce blocks, in +proportion to their balance. + +A Tezos node has mainly three roles: it validates blocks and operations, it +broadcasts them to (and retrieves them from) other nodes, and it maintains a +main chain and its associated state (i.e. the ledger), which includes accounts +and their balances, among other things. Note that, as blocks only specify a +predecessor block, exchanged blocks do not necessarily form a chain, but rather +a tree. Nodes communicate over :doc:`a gossip network<../shell/p2p>`. + +A Tezos node acts as a server, which responds to queries and requests from +clients. Such queries and requests are implemented via :doc:`RPC +calls<../developer/rpc>`. A client can query the chain’s state and can inject +blocks and operations into a node. One particular client is the :ref:`baker daemon `, +which is associated to an account. In particular the baker has access to the +account’s private key and thus can sign blocks and operations. + +The main reason for using such a client-server architecture is safety: to insulate +the component that has access to the client keys, i.e. the baker, from the +component which is exposed to the internet, i.e. the node. Indeed, the node and +the baker can sit on different computers and the baker does not need to be +exposed to the internet. So nodes manage communication and shield bakers from +network attacks, and bakers hold secrets and bake blocks into the blockchain. + +Another advantage of this architecture is that bakers can more easily have +different implementations, and this is important, for instance because different bakers may want +to implement different transaction selection strategies. + +Tezos is a self-amending blockchain, in that a large part of Tezos can be +changed through a so-called amendment procedure. To this end, as mentioned in +:ref:`the big picture`, a Tezos node consists of two +components: + +- the shell, which comprises the network and storage layer, and embeds +- the economic protocol component, which is the part that can be changed through amendment. + +The role of the economic protocol +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. FIXME tezos/tezos#3921: + + Update for pipelined validation up to Lima. + +At a very high level, a protocol must: + +- implement protocol-specific types, such as the type of operations or + protocol-specific block header data (in addition to the shell + generic header), + +- define under which conditions a block is a valid extension of the + current blockchain, and define an ordering on blocks to arbitrate + between concurrent extensions. + +Validity conditions are implemented in the ``apply`` function which is +called whenever the node processes a block---see the dedicated +:doc:`protocol validation and operation` entry for further +detail into the validation and application process for +:ref:`blocks` and their +:ref:`operations`. + +.. _shell_proto_interact_mumbai: + +Shell-protocol interaction +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In the Tezos :ref:`architecture`, the economic +protocol and the shell interact in order to ensure that the blocks +being appended to the blockchain are valid. There are mainly two rules +that the shell uses when receiving a new block: + +- The shell does not accept a branch whose fork point is in a cycle + more than ``PRESERVED_CYCLES`` in the past. More precisely, if ``n`` + is the current cycle, :ref:`the last allowed fork point` is + the first level of cycle ``n-PRESERVED_CYCLES``. The parameter + ``PRESERVED_CYCLES`` therefore plays a central role in Tezos: any + block before the last allowed fork level is immutable. +- The shell changes the head of the chain to this new block only if + the block is :doc:`valid<../shell/validation>`, and it has a higher + fitness than the current head; a block is + :ref:`valid` only if all the + operations included are also + :ref:`valid`. + +The support provided by the protocol for validating blocks can be +modulated by different :ref:`validation +modes`. They allow using this same +interface for quite different use cases, as follows: + +- being able to :ref:`apply` a block, + typically used by the shell's :doc:`validator <../shell/validation>` + component; +- being able to :ref:`construct` a block, + typically used by the baker daemon to *bake* -- that is, to produce + -- a new block; +- being able to :ref:`partially construct` + a block, typically used by the :doc:`prevalidator + <../shell/prevalidation>` to determine valid operations in the + mempool; and, +- being able to :ref:`pre-apply` a + block, typically used in the :doc:`validator <../shell/validation>` + to precheck a block, avoiding to further consider invalid blocks. + +.. _block_contents_mumbai: + +Blocks, Operations and their Validation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. FIXME tezos/tezos#3914: + + Integrate protocol-specific block parts in the blocks and ops + entry. + +A block consists of a header and operations. A block's header is +composed of two parts: :ref:`the protocol-agnostic part` +and :ref:`the protocol-specific part`. +This separation enables the shell to interact with different +protocols. Each Tezos economic protocol can specify different kinds of +operations, which are described further in detail in +:doc:`./blocks_ops`. + +The semantics of, respectively, operations and blocks is indeed also +dependent on each economic protocol. The :doc:`Validation and +Application` entry explains the internals of *validation* +-- that is, how to determine whether operations and blocks can be +safely be included in the Tezos blockchain -- and *application* -- +that is, how the effects of operations and blocks are taken into +account -- for this economic protocol. + +.. _protocol_constants_mumbai: + +Protocol constants +~~~~~~~~~~~~~~~~~~ + +Protocols are tuned by several *protocol constants*, such as the size +of a nonce, or the number of blocks per cycle. One can distinguish two +kinds of protocol constants: + +- *fixed* protocol constants, such as the size of a nonce, are values + wired in the code of a protocol, and can only be changed by protocol + amendment (that is, by adopting a new protocol) + +- *parametric* protocol constants, such as the number of blocks per + cycle, are values maintained in a read-only data structure that can + be instantiated differently, for the same protocol, from one network + to another (for instance, test networks move faster). + +The *list* of protocol constants can be found in the OCaml APIs: + +- fixed protocol constants are defined in the module + :package-api:`Constants_repr + ` +- parametric constants are defined in the module + :package-api:`Constants_parametric_repr + ` + +The *values* of protocol constants in any given protocol can be found using specific RPC calls: + +- one RPC for :ref:`all constants `, as shown in :ref:`this example ` +- one RPC for :ref:`the parametric constants `. + +Further documentation of various protocol constants can be found in the subsystems where they conceptually belong. +See, for example: + +- :ref:`proof-of-stake parameters `. +- :ref:`consensus-related parameters ` +- :ref:`randomness generation parameters `. + +See also +~~~~~~~~ + +An in-depth description of the internals of developing a new Tezos +protocol can be found in the blog post: `How to write a Tezos protocol +`_. diff --git a/docs/mumbai/randomness_generation.rst b/docs/mumbai/randomness_generation.rst new file mode 100644 index 000000000000..f166e32b4864 --- /dev/null +++ b/docs/mumbai/randomness_generation.rst @@ -0,0 +1,164 @@ +Randomness generation +===================== + +Overview +-------- +This document presents the randomness generation protocol, used to select the +delegates to participate in the consensus, as well as the cryptographic +primitives used. + +Cryptographic primitives +------------------------ +We introduce RANDAO and Verifiable Delay Functions, two cryptographic +protocols for generating random values. + +RANDAO +^^^^^^ + +RANDAO is a simple multi-party protocol used to generate a random seed based +on a ''commit and reveal'' scheme (similar in spirit with the +`RANDAO protocol `_). + +During the setup of the protocol, the cryptographic primitives and security +parameters are chosen. The members participating in the protocol can also be +chosen at this stage. + +During the first phase (the "commitment" phase) each party commits to a +random value, called the nonce, and publishes the commitment. Typically, a hash +function is used for committing. + +During the second phase, (the "nonce revelation" phase) each party +reveals their nonce. The revealed nonces are then verified with respect to the +commitments. Typically, this means checking that the hash of each revealed nonce +is equal to its corresponding commitment. If the verification fails, the nonce +is discarded, otherwise it is accepted. + +Once the revelation phase is finished, nonces are combined to generate the +seed. More precisely, the nonces are hashed together in the same order as the +commitment publication. In the case of a rolling RANDAO, the previous seed may +be used to initialize the hash. + +We make the assumption that at least one participant is honest, that is, it +has indeed chosen a random value and this value was revealed. This is a +necessary condition for the seed to be random. The randomness could however be +biased as this protocol suffers from the following low-impact weakness: +if a malicious participant can make sure she is the last revealer, then she +can choose whether to reveal its committed value, effectively choosing between +two different predetermined seeds. + +.. _vdf_mumbai: + +Verifiable Delay Function +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Verifiable Delay Functions, also called VDFs, are a recent cryptographic +primitive formalized in 2018. They can be seen as a trapdoor-less timelock: +the goal of a VDF is making sure a party cannot compute a value before a +specific time. + +This new cryptographic building block is based on modular squaring in a group +of unknown order (e.g. class groups or MPC-generated RSA groups) that is +believed to be expensive and hard to parallelize. + +More precisely, the goal of a VDF is for a user to compute a certain value +``h = g^2^T mod N ∈ G`` and a proof of correctness ``π_h`` by recursive modular +squarings of ``h``. The variables ``g``, ``h``, ``T`` and ``N`` are respectively the *challenge*, +*solution* (or *output*), the *difficulty parameter* and the -unknown- *group order*. The main +difference between VDF and timelocks is that the latter offers a backdoor to +efficiently generate the challenge from the solution. + +To this day, two main schemes exist for generating VDF proofs: +`Wesolowski `_ and +`Pietrzak `_. +The former presents shorter proofs and is based on a stronger security +assumption (adaptive root assumption) while the latter is computationally +cheaper and based on a weaker security assumption (low order assumption). + +Protocol +-------- + +.. _randomness_generation_mumbai: + +Randomness generation overview +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The randomness generation uses both RANDAO and VDF, based on class groups and +using Wesolowski proofs. It can be summed up as follows. We first use RANDAO to +produce biasable entropy which is used as a VDF challenge to generate an +unbiasable seed (given the adversary cannot compute the VDF solution before the reveal +time ends). To ensure liveness, we fallback to RANDAO entropy if no VDF output +was published and verified on-chain. + +Concretely, the random seed for cycle ``n`` is a 256-bit long number computed +at the end of cycle ``n-1-PRESERVED_CYCLES``. It is the VDF output (or, in its +absence, the RANDAO output) computed from nonces to which delegates commit +during cycle ``n-2-PRESERVED_CYCLES``. + +Every ``BLOCKS_PER_COMMITMENT`` levels, the corresponding block contains a +nonce commitment. More precisely, a block contains a commitment if and only if +its cycle position modulo ``BLOCKS_PER_COMMITMENT`` is +``BLOCKS_PER_COMMITMENT - 1``. The nonce is a 256-bit number generated by the +block proposer and its commitment is included in the block header. The +commitment is simply the hash of the nonce. + +The committed nonce must be revealed by the original block proposer during the +nonce revelation phase, that is during the first ``NONCE_REVELATION_THRESHOLD`` +blocks, of cycle ``n-1-PRESERVED_CYCLES`` under penalty of forfeiting all of +its expected endorsing rewards for that cycle. The associated security deposit +and baking rewards are not affected. The RANDAO output is then computed and +stored on-chain as the temporary seed for cycle ``n``. The RANDAO output is the +bitstring obtained by iterating through the nonces revealed in cycle ``n-1`` as +follows: initially it is the seed of cycle ``n-1``; at each iteration, the new +bitstring is the hash of the concatenation of the previous bitstring with the +iterated revealed nonce. + +A *nonce revelation* is an operation and multiple nonce revelations can thus be +included in a block. A reward ``SEED_NONCE_REVELATION_TIP`` is given for +including a revelation. Revelations are free operations which do not compete +with transactions for block space. Up to ``MAX_ANON_OPS_PER_BLOCK`` revelations, +wallet activations and denunciations can be contained in any given block. + +During the rest of the cycle, informally called the VDF revelation period, any +party can query the protocol for the *seed computation status*, which can be +one of the following:(1) the VDF revelation period has not yet started, i.e. +the nonce revelation phase is still ongoing, (2) a VDF solution has already +been successfully submitted, and (3) no VDF solution has been submitted. In +this latter case, the status also provides the information needed to compute +the VDF solution: hash seeds for computing the VDF discriminant (a prime +number defining the class group) and the VDF challenge; more precisely the +random seed of cycle ``n-1`` for the VDF discriminant and the current RANDAO +output for the VDF challenge. Any party can compute a VDF solution and publish +it on-chain together with a proof of correctness. If the verification of the +solution and proof succeeds, the seed for cycle ``n`` is then updated with the +solution: its value is set to be the hash of the RANDAO output and the VDF +solution. + + +A *VDF revelation* is an operation. A reward ``SEED_NONCE_REVELATION_TIP`` is +given for the first correct VDF revelation, subsequent VDF revelation +operations being discarded. + +.. _rg_constants_mumbai: + +Randomness generation parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. list-table:: + :widths: 55 25 + :header-rows: 1 + + * - Parameter name + - Parameter value + * - ``BLOCKS_PER_COMMITMENT`` + - 64 blocks + * - ``NONCE_REVELATION_THRESHOLD`` + - 256 blocks + * - ``MAX_ANON_OPS_PER_BLOCK`` + - 132 revelations + * - ``SEED_NONCE_REVELATION_TIP`` + - 1/8 ꜩ + * - ``VDF_DIFFICULTY`` + - 8,000,000,000 + +The variables ``BLOCKS_PER_CYCLE`` and ``PRESERVED_CYCLES`` are already defined +in the :doc:`proof of stake ` page. diff --git a/docs/mumbai/sapling.rst b/docs/mumbai/sapling.rst new file mode 100644 index 000000000000..e5122eae9228 --- /dev/null +++ b/docs/mumbai/sapling.rst @@ -0,0 +1,534 @@ +**The features described in this page are experimental and have not undergone any security review.** + +Sapling integration +=================== + +Sapling is a protocol enabling privacy-preserving transactions of fungible +tokens in a decentralised +environment. It was designed and implemented by the Electric Coin +Company as the last iteration over a series of previous protocols and +academic works starting with the `Zerocoin seminal +paper `_. + +The reference implementation of Sapling, +`librustzcash `_, was +integrated in the Tezos codebase during 2019. It will be proposed as +part of a protocol amendment during 2020. + +Librustzcash and the Tezos integration implement the protocol +described in this `specification +`_, version 2020.1.0. + + +Sapling +------- + +Keys +~~~~ + +Sapling offers a rich set of keys, each allowing different operations. +A `spending key` allows to spend tokens so if it is lost or +compromised the tokens could remain locked or be stolen. +From a spending key it is possible to derive a corresponding `viewing +key` which allows to view all incoming and outgoing transactions. +The viewing key allows the owner of the tokens to check their balance +and transaction history so if compromised there is a complete loss of +privacy. +On the other hand a viewing key can willingly be shared with a third +party, for example with an auditor for regulatory compliance purposes. + +A viewing key can also derive several diversified `addresses`. +An address can be used to receive funds, much like the address of an +implicit account. + +Additionally `proving keys` can be used to allow the creation of proofs, +thus revealing private information, without being able to spend funds. +They are useful for example in case the spending key is stored in a +hardware wallet but we'd like to use our laptop to craft the +transaction and produce the zero-knowledge proofs, which are +computationally too intensive for an embedded device. + +More details can be found in the `specification document +`_. + +Shielded transactions +~~~~~~~~~~~~~~~~~~~~~ + +Transactions use Bitcoin's UTXO model with the important difference that each +input and output, instead of containing an amount and an address, +are just cryptographic `commitments`. +In order to avoid double spends, it's important to be able to check +that a commitment has not already been spent. In Bitcoin we just need to +check if an output is also later used as an input to verify if it's +already spent. In Sapling however we can't know because inputs are not +linked to outputs. +For this reason for each input of a transaction, the owner must also +publish a `nullifier`, which invalidates it. The nullifier can only be +produced by the owner of a commitment and it's deterministic so that +everybody can check that it hasn't been already published. +Note however that it is not possible to infer which commitment has +been nullified. +Transactions of this form are privacy preserving and are referred to +as `shielded`, because they reveal neither the amount, the sender nor +the receiver. + +The existing set of transactions is referred to as the `shielded pool`. +Unlike Bitcoin, where everybody can compute the set of unspent +outputs of every user, in Sapling only the owner of a viewing key can +find their outputs and verify that they are not already spent. +For this reason, to an external +observer, the shielded pool is always increasing in size and the more +transactions are added the harder it is to pinpoint the commitments +belonging to a user. + +When we spend a commitment there is some additional information that +we need to transmit to the recipient in order for them to spend the +corresponding output. +This data is encrypted under a symmetric key resulting from a +Diffie-Hellman key exchange using the recipient address and an +ephemeral key. +In principle this `ciphertext` can be transmitted off-chain as it's +not needed to verify the integrity of the pool. For convenience, in +Tezos, it is stored together with the commitment and the nullifier on +chain. + +For reasons of efficiency the commitments are stored in an incremental +`Merkle tree `_ which +allows for compact proofs of membership. The root of the tree is all +that is needed to refer to a certain state of the shielded pool. + +In order to ensure the correctness of a transaction, given that there +is information that we wish to remain secret, the spender must also +generate proofs that various good properties are true. +Thanks to the use of `SNARKs `_ +these proofs are very succinct in size, fast to verify and they don't +reveal any private information. + +This model of transaction adapts elegantly to the case when we need to +mint or burn tokens, which is needed to shield or unshield from a +transparent token. +It suffices to add more values in the outputs than in the inputs +to mint and to have more in inputs than outputs to burn. + +Preventing Malleability +~~~~~~~~~~~~~~~~~~~~~~~ + +A Sapling transaction contains a `bound_data` field with arbitrary +bytes that gets signed by the user's Sapling key. +This field can be used to bind the transaction to another +application's logic. +For example during an unshield operation it is important to include in +the `bound_data` the Tezos account that will receive the unshielded +tokens. +Without any `bound_data`, a Sapling unshield operation authorizes any +party that submits it to claim the unshielded tokens. An adversary can +intercept the Tezos operation containing the unshield and resubmit it +using its own Tezos account. +This malleability attack is prevented by including the recipient Tezos +account in the `bound_data`, which is signed by the owner of the +Sapling keys, and that can be used by the Smart Contract to transfer +the tokens. + +**All Smart Contracts managing a Sapling shielded pool must include a +`bound_data` field in their unshield operations.** + +Note that the `bound_data` field is not encrypted and could leak +information about a transaction, therefore for a transfer (e.g. an +operation with balance 0) it should be left empty. +This is not a concern for shielding and unshielding which are already +linking a shielded and a transparent address. + +Privacy guarantees +~~~~~~~~~~~~~~~~~~ + +We explained that the shielded pool contains one commitment for each +input (spent or not), and one nullifier for each spent input. +These cryptographic commitments hide the amount and the owner of the +tokens they represent. +Additionally commitments are unlinkable meaning that we can not deduce +which input is spent to create an output. + +It should be noted that the number of inputs and outputs of a +transaction is public, which could help link a class of +transactions. This problem can be mitigated by adding any number of +dummy inputs or outputs at the cost of wasting some space. + +The shielded pool communicates with the public ledger by minting and +burning shielded tokens in exchange for public coins. +Therefore going in and out of the shielded pool is public: we know +which address shielded or unshielded and how much. +We can among other things infer the total number of shielded coins. + +Timing and network information can also help to deduce some private +information. +For example by observing the gossip network we might learn the IP +address of somebody that is submitting a shielded transaction. +This can be mitigated by using `TOR +`_. + +Good practices +~~~~~~~~~~~~~~ + +When blending in a group of people, one should always pay attention to +the size and the variety of the group. + +We recommend two good practices. First, do not originate a second +contract if another one has the same functionalities, it will split +the anonymity set. + +Second, remember that shielding and unshielding are public operations. +A typical anti-pattern is to shield from tz1-alice 15.3 tez, and then +unshield 15.3 tez to tz1-bob. It's fairly clear from timing and +amounts that Alice transferred 15.3 tez to Bob. +To decorrelate the two transfers it is important to change the +amounts, let some time pass between the two and perform the +transactions when there is traffic in the pool. +Similar problems exist in Zcash and they are illustrated in this +introductory `blog post +`_. + +There are a number of more sophisticated techniques to deanonymise +users using timing of operations, network monitoring, side-channels on +clients and analysis of number of inputs/outputs just to mention a few +(`A fistful of Bitcoins +`_ is a good +first read). +We advice users to be familiar with the use of the TOR network and to +use clients developed specifically to protect their privacy. + + +Tezos integration +----------------- + +Michelson: verify update +~~~~~~~~~~~~~~~~~~~~~~~~ + +We introduce two new Michelson types `sapling_state` and +`sapling_transaction`, and two instructions called +`SAPLING_VERIFY_UPDATE` and `SAPLING_EMPTY_STATE` +(see the :doc:`Michelson reference` +for more details). +`SAPLING_EMPTY_STATE` pushes an empty `sapling_state` on the stack. +`SAPLING_VERIFY_UPDATE` takes a transaction and a state and +returns an +option type which is Some (bound_data, balance and updated +state) if the transaction is correct, None otherwise. +A transaction has a list of inputs, outputs, a balance, +the root of the Merkle tree containing its inputs, some bound data and a signature. +The verification part checks the zero-knowledge proofs of all inputs +and outputs of the transaction, which guarantee several properties of +correctness. +It also checks a (randomised) signature associated with each input +(which guarantees that the owner forged the transaction), and the +signature that binds the whole transaction together and guarantees the +correctness of the balance. +All the signatures are over the hash of the data that we wish to sign +and the hash function used is Blake2-b, prefixed with the anti-replay string. +The anti-replay string is the the concatenation of the chain id and +the smart contract address. The same string has to be used by the client for +signing. + +Verify_update also checks that the root of the Merkle tree appears in +one of the past states and that the nullifiers are not already +present (i.e. no double spending is happening). +If one of the checks fails the instruction returns None. + +Otherwise the function adds to the new state the nullifiers given with each inputs +and adds the outputs to the Merkle tree, which will produce a new root. +It should be noted that it is possible to generate transactions +referring to an old root, as long as the inputs used were present in +the Merkle tree with that root and were not spent after. +In particular the protocol keeps 120 previous roots and guarantees +that roots are updated only once per block. +Considering 2 blocks per minute and that each block contains at least +one call to the same contract, a client has 1 hour to have its +transaction accepted before it is considered invalid. + +The nullifiers are stored in a set. The ciphertexts and other relevant +information linked to the commitment of the Merkle tree are +stored in a map indexed by the position of the commitment in the +Merkle tree. + +Lastly the instruction pushes on the stack an option with the bound +data, the balance and the updated state. + +A smart contract typically shields or unshields tokens if the balance +is positive or negative, and simply updates the state if the balance +is zero. +Additionally in case of an unshield, it must use the bound data to +authorize the transfer of unshielded tokens. +For example it could convert the bound_data to a public_key_hash and +use it as recipient address of Tezos transfer. + +Example contracts +~~~~~~~~~~~~~~~~~ + +Shielded tez +^^^^^^^^^^^^ + +An example contract to have a shielded tez with a 1 to 1 conversion to +mutez is available in the tests of the protocol at +``src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz``. + +Simple Vote Contract +^^^^^^^^^^^^^^^^^^^^ + +One might think to use Sapling to do private voting. +It is possible to adapt shielded transactions to express preferences. +**Note that this is not what Sapling is designed for and it doesn't provide the same properties as an actual private voting protocol.** +A natural naive idea is the following. +Suppose we want a set of users to express a preference for option A or +B, we can generate two Sapling keys with two addresses that are +published and represent the two options. +The contract lets each user create a token which represents one vote +that can then be transferred to address A or B. +Using the published viewing keys everyone can check the outcome of the +vote. +**However note that a transaction can be replayed and we can see the balance of A or B going up. +This system does not offer ballot privacy. +Therefore one should ensure that the vote he is casting cannot be linked to him. +It is possible that the practical situation makes this usable but we recommend in general not to use +it for any important vote.** +Note that using a random elliptic curve element as incoming viewing key allows to generate a +dummy address that cannot be spent. This eases the counting of the votes. +To ensure that the ivk does not correspond to a normal address with spending key, one +can use the Fiat-Shamir heuristic. + + +Fees issue +~~~~~~~~~~ + +We have an additional privacy issue that Z-cash doesn't have. When +interacting with a shielded pool we interact with a smart contract +with a normal transaction and therefore have to pay fees from an +implicit account. +One could guess that private transactions whose fees are paid by the +same implicit account are from the same user. +This can be mitigated by making a service that act as a proxy by +forwarding the user transactions and paying it fees. The user would +then include in the transaction a shielded output for the service that +covers the fees plus a small bonus to pay the service. +This output can be open by the service before sending the transaction +to check that there is enough money to cover its fees. As for Z-cash, +users interacting with the proxy should use TOR or mitigate network +analysis as they wish. + +Gas, storage and costs +~~~~~~~~~~~~~~~~~~~~~~ + +Gas evaluation is not yet done. + +RPCs +~~~~ + +There are two Sapling RPCs under the prefix `context/sapling`. +`get_size` returns a pair with the size of the set of commitments +and the size of the set of nullifiers. +`get_diff` takes two optional starting offsets `cm_from` and `nf_from` +and returns the sapling state that was added from the offsets to the +current size. In particular it returns three lists, commitments, +ciphertexts from position `cm_from` up to the last one added and +nullifiers, from `nf_from` to the last one added. +Additionally it returns the last computed root of the merkle tree so +that a client updating its tree using the diff can verify the +correctness of the result. + +Client +~~~~~~ + +Wallet +^^^^^^ + +octez-client supports Sapling keys and can send +shielded transactions to smart contracts. + +The client supports two ways to generate a new Sapling spending key. +It can be generated from a mnemonic using `BIP39 +`_, so +that it can be recovered in case of loss using the mnemonic. +Alternatively it is possible to derive new keys from existing ones +using `ZIP32 +`_, a Sapling +variant of `BIP32 +`_ for +hierarchical deterministic wallets. As usual, in this case it is +important to note the derivation path of the key to be able to recover +it in case of loss. +At the moment there is no hardware wallet support, keys are stored in +`~/.tezos-client/sapling_keys` by default encrypted with a password. +**Users should take care to backup this file.** + +The client can also derive addresses from viewing keys. +By default addresses are generated using an increasing counter called +the address index. Not all indexes correspond to valid addresses for +each key so it is normal to see an increasing counter that +occasionally skips a few positions. + +Because for now the only support for Sapling keys is to interact with +smart contracts, the client binds each newly generated key to a +specific smart contract address. + +Operations +^^^^^^^^^^ + +The client also facilitates the creation of shielded transactions and +their transfer as arguments of smart contracts. +For now there is seamless integration to send transactions to the +reference shielded-tez contract and we are planning to support a +larger class of contracts. + +For the shielded-tez smart contract, the client supports shielding, +unshielding and shielded transactions. +In the case of shielded transactions there are two commands, one to +forge a transaction and save it to file and one to submit it to the +smart contract. +The idea is that a user should not use their own transparent tz{1,2,3} +address to submit a shielded address but rather have a third party +inject it. + +Message argument +^^^^^^^^^^^^^^^^ +Sapling also allows to send an arbitrary encrypted message attached +to an output. +The message size has to be fixed by pool for privacy reasons. +For now it is fixed overall at eight bytes. An incorrect message length +will raise a failure in our client and the protocol will reject the +transaction. Our client adds a default zero's filled message of the +right length. If a message is provided with the --message option, +the client will pad it or truncate it if necessary. A warning message +is printed only if the user's message is truncated. + + +Code base +~~~~~~~~~ + +The current code-base is organized in three main components. +There is a core library called `lib_sapling` which binds `librustzcash`, +adds all the data structures necessary to run the sapling +protocol and includes a simple client and baker. +Under the protocol directory there is a `lib_client_sapling` library +which implements a full client capable of handling Sapling keys and +forging transactions. +Lastly in the protocol there is a efficient implementation of the +Sapling storage, in the spirit of `big_map`s, and the integration of +`SAPLING_VERIFY_UPDATE` in the Michelson interpreter. + +Protocol +^^^^^^^^ + +In order to export the Sapling library to the protocol we first need +to expose it through the environment that sandboxes the protocol. +The changes under `src/lib_protocol_environment` are simple but very +relevant as any change of the environment requires a manual update of the +Tezos node. These changes are part of version V1 of the environment +while protocols 000 to 006 depends on version V0. + +There are two main changes to Tezos' economic protocol, the storage +for Sapling and the addition of `SAPLING_VERIFY_UPDATE` to the +Michelson interpreter. + +Given that the storage of a Sapling contract can be substantially +large, it is important to provide an efficient implementation. +Similarly to what it's done for big_maps, the storage of Sapling can't +be entirely deserialized and modified in memory but only a diff of the +changes is kept by the interpreter and applied at the end of each +smart contract call. + +In the Michelson interpreter two new types are added, `sapling_state` and +`sapling_transaction`, and the instruction `SAPLING_VERIFY_UPDATE`. + +Client +^^^^^^ + +Under `lib_client_sapling` there is the client integration +with the support for Sapling keys and forging of transactions. +The main difference from the existing Tezos client is the need for the +Sapling client to keep an additional state, for each contract. +Because Sapling uses a UTXO model it is necessary for a client to +compute the set of unspent outputs in order to forge new transactions. +Computing this set requires scanning all the state of a contract which +can be expensive. +For this reason the client keeps a local state of the unspent outputs +after the last synchronization and updates it before performing any +Sapling command. +The update is done using the RPCs to recover the new updates since the +last known position. + +The state of all sapling contracts is stored in +`~/.tezos-client/sapling_states`. This file can be regenerated from +the chain in case of loss. However disclosure of this file will reveal +the balance and the unspent outputs of all viewing keys. + +Memo +^^^^^^ + +Sapling offers the possibility to add an arbitrary memo to any +created output. The memo is encrypted and available to anyone +owning the outgoing viewing key or the spending key. +For privacy reasons the size of the memo is fixed per contract +and it is chosen at origination time. +A transaction containing an output with a different memo-size +will be rejected. + +Sandbox tutorial +~~~~~~~~~~~~~~~~ + +As usual it's possible to test the system end-to-end using the +:doc:`../user/sandbox`. +After having set up the sandbox and originated the contract, a good +way to get familiar with the system is to generate keys and then +perform the full cycle of shielding, shielded transfer and +unshielding. + +:: + + # set up the sandbox + ./src/bin_node/octez-sandboxed-node.sh 1 --connections 0 & + eval `./src/bin_client/octez-init-sandboxed-client.sh 1` + octez-activate-alpha + + # originate the contract with its initial empty sapling storage, + # bake a block to include it. + # { } represents an empty Sapling state. + octez-client originate contract shielded-tez transferring 0 from bootstrap1 \ + running src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz \ + --init '{ }' --burn-cap 3 & + octez-client bake for bootstrap1 + + # as usual you can check the octez-client manual + octez-client sapling man + + # generate two shielded keys for Alice and Bob and use them for the shielded-tez contract + # the memo size has to be indicated + octez-client sapling gen key alice + octez-client sapling use key alice for contract shielded-tez --memo-size 8 + octez-client sapling gen key bob + octez-client sapling use key bob for contract shielded-tez --memo-size 8 + + # generate an address for Alice to receive shielded tokens. + octez-client sapling gen address alice + zet1AliceXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Alice's address + + + # shield 10 tez from bootstrap1 to alice + octez-client sapling shield 10 from bootstrap1 to zet1AliceXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX using shielded-tez --burn-cap 2 & + octez-client bake for bootstrap1 + octez-client sapling get balance for alice in contract shielded-tez + + # generate an address for Bob to receive shielded tokens. + octez-client sapling gen address bob + zet1BobXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Bob's address + + # forge a shielded transaction from alice to bob that is saved to a file + octez-client sapling forge transaction 10 from alice to zet1BobXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX using shielded-tez + + # submit the shielded transaction from any transparent account + octez-client sapling submit sapling_transaction from bootstrap2 using shielded-tez --burn-cap 1 & + octez-client bake for bootstrap1 + octez-client sapling get balance for bob in contract shielded-tez + + # unshield from bob to any transparent account + octez-client sapling unshield 10 from bob to bootstrap1 using shielded-tez --burn-cap 1 + ctrl+z # to put the process in background + octez-client bake for bootstrap1 + fg # to put resume the transfer diff --git a/docs/mumbai/smart_rollups.rst b/docs/mumbai/smart_rollups.rst new file mode 100644 index 000000000000..00c3a4dc3bbb --- /dev/null +++ b/docs/mumbai/smart_rollups.rst @@ -0,0 +1,1245 @@ +Smart Optimistic Rollups +======================== + +A **rollup** is a processing unit that receives, retrieves, and +interprets input messages to update its local state and to produce +output messages targetting the Tezos blockchain. In this +documentation, we will generally refer to the rollup under +consideration as the layer-2 on top of the Tezos blockchain, +considered as the layer-1. + +Rollups are a permissionless scaling solution for the Tezos +blockchain. Indeed, anyone can originate and operate one or more +rollups, allowing to (almost) arbitrarily increase the throughput of +the Tezos blockchain. + +The integration of these rollups in the Tezos protocol is +*optimistic*: this means that when an operator publishes a claim about +the state of the rollup, this claim is *a priori* trusted. However, a +refutation mechanism allows anyone to economically punish a +participant that has published an invalid claim. Therefore, thanks to +the refutation mechanism, a single honest participant is enough to +guarantee that the input messages are correctly interpreted. + +In the Tezos protocol, the subsystem of smart rollups is generic with +respect to the syntax and the semantics of input messages. This means +that any computational device can be used to implement a rollup as +long as this device can produce a proof justifying the correct +application of the official semantics for this device. In the Tezos +protocol, official semantics are implemented as **Proof-generating +Virtual Machines (PVM)**. Thus, a rollup behavior is characterized by +a given PVM. Any implementation of this device can be used to run the +rollup provided that it is compliant with the PVM defined by the +economic protocol. + +The smart rollup infrastructure can currently be instantiated with a +WebAssembly PVM (WASM) provided by the protocol. A WASM rollup runs a +WASM program named a **kernel**. The role of the kernel is to process +input messages, to update a state, and to output messages targetting +the layer-1 following a user-defined logic. Anyone can develop a +kernel or reuse existing kernels. A typical use case of WASM rollups +is to deploy a kernel that implements the Ethereum Virtual Machine +(EVM) and to get as a result an EVM-compatible layer-2 running on top +of the Tezos blockchain. WASM rollups are not limited to this use case +though: they are fully programmable, hence their names, smart +optimistic rollups, as they are very close to smart-contracts in terms +of expressivity. + +The purpose of this documentation is to give: + +#. an overview of the terminology and basic principles of smart rollups ; +#. a complete tour of smart rollups related workflows ; +#. a reference documentation for the development of a WASM kernel. + +Overview +-------- + +Just like smart-contracts, rollups are decentralized software +components. As such, any user can originate, operate, and interact +with a rollup. For the sake of clarity, we will distinguish three +kinds of users in this documentation: operators, kernel developers, +and end-users. An operator wants the rollup to make progress. A kernel +developer wants to write a kernel to be executed within a rollup. An +end-user interacts with the rollup through layer-1 operations or +layer-2 input messages. + +Address +^^^^^^^ + +Originating a smart rollup leads to a smart rollup address that +uniquely identifies the smart rollup on layer-1. A smart rollup +address starts with the prefix ``scr1`` +(see also the :ref:`kinds of address prefixes in Tezos `). + +Inputs +^^^^^^ + +There are two channels of communication to interact with smart rollups: + +#. a global **rollups inbox** allows the the layer-1 to transmit + information to all the rollups. This unique inbox contains two + kinds of messages: *external* messages are pushed through a layer-1 + manager operation while *internal* messages are pushed by layer-1 + smart-contracts or the protocol itself. More information about + these two kinds of messages can be found below. + +#. a **reveal data channel** allows the rollup to retrieve data + coming from data sources external to the layer-1. More information + about this channel can be found below. + + +External messages +""""""""""""""""" + +Anyone can push a message to the rollups inbox. This message is a mere +sequence of bytes following no particular underlying format. The +interpretation of this sequence of bytes is the responsibility of the +kernel. + +There are two ways for an end-user to push an external message to the +rollups inbox: first, she can inject the dedicated layer-1 operation +using the Octez client (see command ``send sc rollup message + from ``) ; second, she can use the batcher +of a smart rollup node. More details can be found +:ref:`sending_external_inbox_message`. + +Internal messages +""""""""""""""""" + +A rollup is identified by an address and is assigned a Michelson type +so that any layer-1 smart contract can perform a transfer to this +address with a payload of this type. By contrast to external messages +that are meant for end-users, this transfer is realized as an internal +message pushed to the rollups inbox. + +In addition, the Tezos protocol pushes a start-of-level internal +message (respectively, an end-of-level internal message) in the inbox, +at the beginning (respectively, at the end) of the validation of each +layer-1 block. + +Reveal data channel +""""""""""""""""""" + +The reveal data channel is a communication interface that allows the +rollup to request data from sources that are external to the inbox and +can be unknown to the layer-1. The rollup node has the responsibility +to answer the rollup requests: this is usually done by issuing RPC +to an octez node or by reading the contents of a local file. + +A rollup can do the following requests through the reveal data channel: + +#. **preimage requests** The rollup can request a page, that is 4kB of + data, provided that it knows a (blake2b) hash of this sequence of + bytes. The request is fulfilled by the rollup node + :ref:`populating_the_reveal_channel`. + +#. **metadata requests** The rollup can request information from the + protocol, namely the address and the origination level of the + rollup node itself. The rollup node retrieves this information + through RPCs to answer the rollup. + +Information passing through the reveal data channel does not have to +be considered by the layer-1: for this reason, the volume of +information is not limited by the bandwidth of the layer-1. Thus, the +reveal data channel can be used to upload large volume of data to the +rollup. + +Origination +^^^^^^^^^^^ +When originated, a rollup is characterized by the name of the device +it runs – the so-called Proof-generating Virtual Machine (PVM) – by +the source code of the rollup running under this device, and by the +Michelson type of the entrypoint used by layer-1 smart-contracts to +communicate with the rollup through internal messages. + +Processing +^^^^^^^^^^ +Each time a Tezos block is finalized, a rollup reacts to three kinds +of events: the beginning of the block, the input messages contained in +that block, and the end of the block. A **rollup node** implements this +reactive process: it downloads the Tezos block and interprets it +according to the semantics of the PVM. This interpretation can require +updating a state, downloading data from other sources, or performing +some cryptographic verifications. The state of the rollup contains +an **outbox**, that is a sequence of latent calls to layer-1 contracts. + +The behavior of the rollup node is deterministic and fully specified +by a reference implementation of the PVM embedded in the +protocol. Notice that the PVM implementation is meant for +verification, not performance: for this reason, a rollup node does not +normally run a PVM to process inputs but a **fast execution engine** +(e.g., WASMER for the WASM PVM in the case of the rollup node +distributed with Octez). This fast execution engine implements the +exact same semantics as the PVM. + +Commitments +^^^^^^^^^^^ + +Starting from the rollup origination level, levels are partitioned +into **commitment periods** of 30 consecutive blocks. + +A **commitment** claims that the interpretation of all inbox messages +published during a given commitment period and applied on the state of +a parent commitment led to a given new state by performing a given +number of execution steps of the PVM. Execution steps are called +**ticks** in the smart rollups terminology. A commitment must be +published on the layer-1 after each commitment period to have the rollup +progress. A commitment is always based on a parent commitment (except +for the genesis commitment that is automatically published at +origination time). + +Notice that, to publish a commitment, an operator must provide a +deposit of 10,000 tez. For this reason, the operator is said to be a +**staker**. Several users can stake on the same commitment. When a +staker publishes a new commitment based on a commitment she is staking +on, she does not have to provide a new deposit: the deposit also +applies to this new commitment. + +A commitment is optimistically trusted but it can be refuted until it +is said to be **cemented** (i.e., final, unchangeable). Indeed, right +after a commitment is published, a two-weeks refutation period +starts. During the refutation period, anyone noticing that a +commitment for a given commitment period is invalid can post a +concurrent commitment for the same commitment period to force the +removal of the invalid commitment. If no one posts such a concurrent +commitment during the refutation period, the commitment can be +cemented with a dedicated operation injected in layer-1, and the +outbox messages can be executed by the layer-1 by an explicit layer-1 +operation (see :ref:`triggering_execution_outbox_message`), typically +to transfer assets from the rollup to the layer-1. + +Refutation +^^^^^^^^^^ + +Because of concurrent commitments, a rollup is generally related to a +**commitment tree** where branches correspond to different claims +about the rollup state. + +By construction, only one view of the rollup state is valid (as the +PVM is deterministic). When two concurrent branches exist in the +commitment tree, the cementation process is stopped at the first fork +in the tree. To unfreeze the cementation process, a **refutation +game** must be started between *two concurrent stakers* of these +branches. Refutation games are automatically played by rollup nodes to +defend their stakes: honest participants are guaranteed to win these +games. Therefore, an honest participant should not have to worry about +refutation games. Finally, a running refutation game does not prevent +new commitments to be published on top of the disputed commitments. + +A refutation game is decomposed into two main steps: a dissection +mechanism and a final conflict resolution phase. During the first +phase, the two stakers exchange hashes about intermediate states of +the rollups in a way that allows them to converge to the very first +tick on which they disagree. During the final phase, the stakers must +provide a proof that they correctly interpreted this conflicting +tick. + +The layer-1 PVM then determines whether these proofs are valid. There +are only two possible outcomes: either one of the staker has provided +a valid proof, she wins the game, and is rewarded with half of the +opponent's deposit (the other half being burnt) ; or, both stakers have +provided an invalid proof and they both lose their deposit. In the +end, at most one stake will be kept in the commitment tree. When a +commitment has no more stake on it (because all stakers have lost the +related refutation games), it is removed from the tree. An honest +player must therefore play as many refutation games as there are +stakes on the commitments in conflict with her own commitment. + +Finally, notice that each player is subject to a timer similar to a +chess clock, allowing each player to play only up to one week: after +this time is elapsed, a player can be dismissed by any layer-1 user +playing a timeout operation. Thus, the refutation game played by the +two players can last at most 2 weeks. + +There is no timeout for starting a refutation game after having +published a concurrent commitment. However, assuming the existence of +a honest participant, she will start the refutation game with all +concurrent stakers to avoid the rollup being stuck. + +Workflows +--------- + +Tools +^^^^^ + +Smart rollups come with two new executable programs: the Octez +rollup node and the Octez rollup client. + +The Octez rollup node is used by a rollup operator to deploy a +rollup. The rollup node is responsible for making the rollup progress +by publishing commitments and by playing refutation games. + +Just like the Octez node, the Octez rollup node provides an RPC +interface :doc:`RPC <../api/openapi>`. The services of this interface +can be called directly with HTTP requests or indirectly using the +Octez rollup client. + +Prerequisites +^^^^^^^^^^^^^ + +To experiment with the commands described in this section, we use +the `Mondaynet `_. +In this section, we assume that ``${OPERATOR_ADDR}`` is a valid +implicit account on MondayNet owned by the reader. + +Notice that you need a specific development version of Octez to +participate to MondayNet. This version is either available from +docker images or can be compiled from sources. Please refer to the +`Mondaynet `_ website +for installation details. + +An Octez rollup node needs an Octez tezos node to run. We assume that +a rollup node has been launched locally, typically by issuing: + +.. code:: sh + + octez-node config init --data-dir "${ONODE_DIR}" --network "${NETWORK}" + octez-node run --data-dir "${ONODE_DIR}" --network "${NETWORK}" --rpc-addr 127.0.0.1 + +in a terminal where ``${NETWORK}`` is of the +form ``https://teztnets.xyz/mondaynet-YYYY-MM-DD`` +and ``${ONODE_DIR}`` is a path for the Octez node store. + +The commands will only work when ``proto_mumbai`` is activated. +This can be checked by: + +.. code:: sh + + octez-client rpc get /chains/main/blocks/head/protocols + +that must return: + +:: + + { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK", + "next_protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" } + +Finally, you need to check that your balance is greater than 10,000 +tez to make sure that staking is possible. In case your balance is not +sufficient, you can get test tokens from :ref:`a faucet `. + + +.. code:: sh + + octez-client get balance for "${OPERATOR_ADDR}" + +Origination +^^^^^^^^^^^ + +Anyone can originate a smart rollup with the following invocation of +the Octez client: + +.. code:: sh + + octez-client originate sc rollup from "${OPERATOR_ADDR}" \ + of kind wasm_2_0_0 \ + of type bytes \ + booting with "${KERNEL}" \ + -burn-cap 999 + +where ``${KERNEL}`` is a hex representation of a WebAssembly +bytecode serving as an initial program to boot on. From a +WASM bytecode file named ``kernel.wasm``, such representation +can be obtained through + +.. code:: sh + + xxd -ps -c 0 + +To experiment, we propose that you use the value ``${KERNEL}`` +defined in the :download:`given file `. + +.. code:: sh + + source sr_boot_kernel.sh # defines shell variable KERNEL + +If everything went well, the origination command results in: + +:: + + This sequence of operations was run: + Manager signed operations: + From: tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX + Fee to the baker: ꜩ0.000357 + Expected counter: 10 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX + Key: edpkukxtw4fHmffj4wtZohVKwNwUZvYm6HMog5QMe9EyYK3QwRwBjp + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX + Fee to the baker: ꜩ0.004617 + Expected counter: 11 + Gas limit: 3227 + Storage limit: 10711 bytes + Balance updates: + tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX ... -ꜩ0.004617 + payload fees(the block proposer) ....... +ꜩ0.004617 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: bytes + Boot sector Blake2B hash: '789431137a40057a39867cbc5cd7f984139360559c655c0508821b9be8047a02' + This smart contract rollup origination was successfully applied + Consumed gas: 3126.633 + Storage size: 10691 bytes + Address: scr1BBMMrm3Zhq1S2Qy2LpRXdu4ebtW9sBrtY + Genesis commitment hash: scc13y58tqmHJtWhWY5Sa3BLu7W3FUjsFZrLCyvdu78VTnmf4aEVWe + Balance updates: + tz1fp5ncDmqYwYC568fREYz9iwQTgGQuKZqX ... -ꜩ2.67275 + storage fees ........................... +ꜩ2.67275 + +The address ``scr1BBMMrm3Zhq1S2Qy2LpRXdu4ebtW9sBrtY`` is the smart rollup address. +Let's write it ``${SOR_ADDR}`` from now on. + +Deploying a rollup node +^^^^^^^^^^^^^^^^^^^^^^^ + +Now that the rollup is originated, anyone can make it progress by deploying a +rollup node. + +First, we need to decide on a directory where the rollup node stores +its data. Let us assign ``${ROLLUP_NODE_DIR}`` with this path. The +rollup node is configured with the following command: + +.. code:: sh + + octez-sc-rollup-node-alpha --base-dir "${OCLIENT_DIR}" \ + init operator config for "${SOR_ADDR}" \ + with operators "${OPERATOR_ADDR}" \ + --data-dir "${ROLLUP_NODE_DIR}" + +This creates a configuration file: + +:: + + Smart-contract rollup node configuration written in {ROLLUP_NODE_DIR}/config.json + +Here is the content of the file: + +:: + + { + "data-dir": "${ROLLUP_NODE_DIR}", + "sc-rollup-address": "${SOR_ADDR}", + "sc-rollup-node-operator": { + "publish": "${OPERATOR_ADDR}", + "add_messages": "${OPERATOR_ADDR}", + "cement": "${OPERATOR_ADDR}", + "refute": "${OPERATOR_ADDR}" + }, + "fee-parameters": {}, + "mode": "operator" + } + +Notice that distinct layer-1 adresses could be used for the layer-1 +operations issued by the rollup node simply by editing the +configuration file to set different addresses for ``publish``, +``add_messages``, ``cement``, and ``refute``. + +In addition, a rollup node can run under different modes: + +#. ``operator`` activates a full-fledged rollup node. This means that + the rollup node will do everything needed to make the rollup + progress. This includes following the layer-1 chain, reconstructing + inboxes, updating the states, publishing and cementing commitments + regularly, and playing the refutation games. In this mode, the + rollup node will accept transactions in its queue and batch them on + the layer-1. It does not include the message batching service, + either. + +#. ``batcher`` means that the rollup node will accept transactions in + its queue and batch them on the layer-1. In this mode, the rollup + node follows the layer-1 chain, but it does not update its state + and does not reconstruct inboxes. Consequently, it does not publish + commitments nor play refutation games. + + +#. ``observer`` means that the rollup node follows the layer-1 chain + to reconstruct inboxes, to update its state. However, it will + neither publish commitments, nor play a refutation game. + It does not include the message batching service, either. + + +#. ``maintenance`` is the same as the operator mode except that it does not + include the message batching service. + +The following table summarizes the operation modes, focusing on the L1 +operations which are injected by the rollup node in each mode. + ++-------------+--------------+----------+--------+--------+ +| | Add messages | Publish | Cement | Refute | ++=============+==============+==========+========+========+ +| Operator | Yes | Yes | Yes | Yes | ++-------------+--------------+----------+--------+--------+ +| Batcher | Yes | No | No | No | ++-------------+--------------+----------+--------+--------+ +| Observer | No | No | No | No | ++-------------+--------------+----------+--------+--------+ +| Maintenance | No | Yes | Yes | Yes | ++-------------+--------------+----------+--------+--------+ + +Second, the configured rollup node can be run: + +.. code:: sh + + octez-sc-rollup-node-alpha" -d "${OCLIENT_DIR}" run --data-dir ${ROLLUP_NODE_DIR} + +The log should show that the rollup node follows the layer-1 chain and +processes the inbox of each level. + +.. _sending_external_inbox_message: + +Sending an external inbox message +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _sending_internal_inbox_message: + +Sending an internal inbox message +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _triggering_execution_outbox_message: + +Triggering the execution of an outbox message +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _populating_the_reveal_channel: + +Populating the reveal channel +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +It is the responsibility of rollup node operators to get the data +passed through the reveal data channel when the rollup requested it. + +To answer a request for a page of hash ``H``, the rollup node tries to +read the content of a file ``H`` named +``${ROLLUP_NODE_DIR}/wasm_2_0_0``. + +Notice that a page cannot exceed 4KB. Hence, larger pieces of data +must be represented with multiple pages that reference each other +through hashes. It is up to the kernel to decide how to implement +this. For instance, one can classify pages into two categories: index +pages that are hashes for other pages and leaf pages that contain +actual payloads. + +Developing WASM Kernels +----------------------- + +A rollup is primarily characterized by the semantics it gives to the +input messages it processes. This semantics is provided at origination +time as a WASM program (in the case of the ``wasm_2_0_0`` kind) called +a *kernel*. More precisely, a *kernel* is a WASM module encoded in the +binary format defined by the WASM standard. + +Though compliance with the WASM standard was a key requirement for +smart rollups, there is a caveat to this claim. This is due to the +particular constraints web3 developers are very familiar with, namely +programs must be fully deterministic. As a consequence, + +#. Instructions and types related to floating-point arithmetic are not + supported. This is because IEEE floats are not deterministic, as + the standard includes undefined behaviors operations. +#. The call stack of the WASM kernel is restricted to 300. + +A valid kernel is a WASM module that satisfies the following +constraints: + +#. It exports a function ``kernel_run`` that takes no argument and + returns nothing. +#. It declares and exports exactly one memory. +#. It only imports the host functions, exported by the (virtual) + module ``smart_rollup_core``. + +For instance, the mandatory example of a ``hello, world!`` kernel is +the following WASM program in text format. + +.. code:: + + (module + (import "smart_rollup_core" "write_debug" + (func $write_debug (param i32 i32) (result i32))) + (memory 1) + (export "mem" (memory 0)) + (data (i32.const 100) "hello, world!") + (func (export "kernel_run") + (local $hello_address i32) + (local $hello_length i32) + (local.set $hello_address (i32.const 100)) + (local.set $hello_length (i32.const 13)) + (drop (call $write_debug (local.get $hello_address) + (local.get $hello_length))))) + +This program can be compiled to the WASM binary format with +general-purpose tool like +`WABT `_. + +:: + + wat2wasm hello.wat -o hello.wasm + +The contents of the resulting ``hello.wasm`` file is a valid WASM +kernel, though its relevance as a decentralized application is +debatable. + +One of the benefit of choosing WASM as the programming language for +smart rollups is that WASM has gradually become a ubiquitous +compilation target over the years. To the point where mainstream, +industrial languages like Go or Rust now natively compile to +WASM. Thus, ``cargo`` —the official Rust package manager— provides an +official target to compile Rust to ``.wasm`` binary files that are +valid WASM kernels. This means that, for this particular example, one +can build a WASM kernel while enjoying the strengths and convenience +of the Rust language and the Rust ecosystem. + +The rest of the section proceeds as follows. + +#. First, we explain the execution environment of a WASM kernel: when + it is parsed, executed, etc. +#. Then, we explain in more details the API at the disposal of WASM + kernel developers. +#. Finally, we demonstrate how Rust in particular can be used to + implement a WASM kernel. + +Though Rust has become the primary language whose WASM backend has +been tested in the context of smart rollups, the WASM VM has not been +modified in anyway to favor this language. We fully expect that other +mainstream languages like Go for instance are also good candidate to +implement WASM kernels. + +Execution Environment +^^^^^^^^^^^^^^^^^^^^^ +In a nutshell, the life cycle of a smart rollup is a never-ending +interleaving of fetching inputs from the layer-1, and executing the +``kernel_run`` function exposed by the WASM kernel. + +State +""""" + +The smart rollup carries two states: + +#. A transient state, that is reset after each call to the + ``kernel_run`` function and is akin to RAM. +#. A persistent state, that is preserved across ``kernel_run`` calls. + The persistent state consists in an *inbox* that is regularly + populated with the inputs coming from the layer-1, the *outbox* + which the kernel can populate with contract calls targeting smart + contracts in the layer-1, and a durable storage which is akin to a + file system. + +The durable storage is a persistent tree, whose contents is addressed +by path-like keys. The WASM kernel can write and read raw bytes stored +under a given path (files), but can also interact (delete, copy, move, +etc.) with subtrees (directories). The value and subtrees at key +``/readonly`` are not writable by a kernel, but can be used by the PVM +to give information to the kernel. + +Control Flow +"""""""""""" + +When a new block is published on Tezos, the inbox exposed to the smart +rollup is populated with all the inputs published on Tezos in this +block. It is important to keep in mind that all the smart rollups +which are originated on Tezos share the same inbox. As a consequence, +a WASM kernel has to filter the inputs that are relevant for its +purpose from the ones it does not need to process. + +Once the inbox has been populated with the inputs of the Tezos block, +the ``kernel_run`` function is called, from a clean “transient” +state. More precisely, the WASM kernel is parsed, linked, initialized, +then ``kernel_run`` is called. + +By default, the WASM kernel yields when ``kernel_run`` returns. In +this case, the WASM kernel execution is put on hold while the input of +the next inbox are being loaded. The inputs that were not consumed by +``kernel_run`` are dropped. ``kernel_run`` can prevent the WASM +kernel from yielding by writing arbitrary data under the path +``/kernel/env/reboot`` in its durable storage. In such a case (known +as reboot), ``kernel_run`` is called again, without dropping unread +inputs. This value is removed between each call of ``kernel_run``, +and the ``kernel_run`` function can postpone yielding at most 1,000 +reboots for each Tezos level. + +A call to ``kernel_run`` cannot take an arbitrary amount of time to +complete, because diverging computations are not compatible with the +optimistic rollup infrastructure of Tezos. To dodge the halting +problem, the reference interpreter of WASM used during the rejection +enforces a bound on the number of ticks used in a call to +``kernel_run``. Once the maximum number of ticks is reached, the +execution of ``kernel_run`` is trapped (*i.e.*, interrupted with an +error). + +The current bound is set to 11,000,000,000 ticks. ``octez-wasm-repl`` +is probably the best tool available to verify the ``kernel_run`` +function does not take more ticks than authorized. + +The direct consequence of this setup is that it might be necessary for +a WASM kernel to span a long computation across several calls to +``kernel_run``, and therefore to serialize any data it needs in the +durable storage to avoid loosing them. + +Finally, the kernel can verify if the previous ``kernel_run`` +invocation was trapped by verifying if some data are stored under the +path ``/kernel/env/stuck``. + +Host Functions +^^^^^^^^^^^^^^ + +At its core, the WASM machine defined in the WASM standard is just a +very evolved arithmetic machine. It needs to be enriched with +so-called host functions in order to be used for greater purposes. The +host functions provides an API to the WASM program to interact with an +“outer world.” In a browser, this API typically allows the WASM +program to interact with the `DOM +`_ +of the webpage. + +As for smart rollups, the host functions exposed to a WASM kernel +allows it to interact with the components of persistent state. + +``read_input`` + Loads the oldest input still present in the inbox of the smart + rollup in the transient memory of the WASM kernel. This means that + the input is lost at the next invocation of ``kernel_run`` if it is + not written in the durable storage. + +``write_output`` + Writes an in-memory buffer to the outbox of the smart rollup. If the + content of the buffer follows the expected encoding, it can be + interpreted in the layer-1 as a smart contract call, once a + commitment acknowledging the call to this host function is cemented. + +``write_debug`` + Is considered as a no-op, but can be used by the WASM kernel to log + events which can potentially be interpreted by an instrumented + rollup node. + +``store_has`` + Reports the kind of data stored under a given path in the durable + storage: a directory, a file, neither or both. + +``store_delete`` + Cuts the subtree under a given path out of the durable storage. + +``store_copy`` + Copies the subtree under a given path to another key. + +``store_move`` + Behaves as ``store_copy``, but also cuts the original subtree out of + the tree. + +``store_read`` + Loads at most 4,096 bytes from a file of the durable storage to a buffer + in the memory of the WASM kernel. + +``store_write`` + Writes at most 4,096 bytes from a buffer in the memory of the WASM + kernel to a file of the durable storage, increasing its size if + necessary. Note that files in the durable storage cannot exceed + 2,147,483,647 bytes (:math:`2^31 - 1`, around 2GB). + +``store_value_size`` + Returns the size (in bytes) of a file under a given key in the + durable storage. + +``store_list_size`` + Returns the number of child objects (either directories or files) + under a given key. + +``store_get_nth_key`` + Loads in memory at a given location the durable storage key to + access the nth child under a given key. Note that the result is not + stable w.r.t. key additions and removals. Returns the number of + bytes loaded in memory. If :math:`0` is loaded, it means there + exists a value under the key given as argument (which can be + manipulated with ``store_read`` and ``store_write``). + +``reveal_preimage`` + Loads in memory the preimage of a 32-byte Blake2B hash. + +``reveal_metadata`` + Loads in memory the address of the smart rollup (20 bytes), and the + Tezos level of its origination (4 bytes). + +These host functions use a "C-like" API. In particular, most of them +return a signed 32bit integer, where negative values are reserved for +conveying errors. + +======= ======================================================================================================= + Code Description +------- ------------------------------------------------------------------------------------------------------- + -1 Input is too large to be a valid key of the durable storage + -2 Input cannot be parsed as a valid key of the durable storage + -3 There is no file under the requested key + -4 The host functions tried to read or write an invalid section (determined by an offset and a length) of the value stored under a given key + -5 Cannot write a value beyond the 2GB size limit + -6 Invalid memory access (segmentation fault) + -7 Tried to read from the inbox or write to the outbox more than 4,096 bytes + -8 Unknown error due to an invalid access + -9 Attempt to modify a readonly value +======= ======================================================================================================= + +Implementing a WASM Kernel in Rust +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Though WASM is a good fit for writing computation intensive, arbitrary +programs, it remains a low-level, stack-based, memory unsafe language. +Fortunately, it was designed to be a compilation target, not a +language whose program would be written directly by developers. + +Rust has several advantages that makes it a good candidate to write +the kernel of a smart rollup. Not only does the Rust compiler treat +WASM as a first class citizen when it comes to compilation targets, +but its approach to memory safety eliminates large classes of bugs and +vulnerabilities that arbitrary WASM programs may suffer from. + +Setting-up Rust +""""""""""""""" + +```rustup`` `_ is the standard to get Rust. Once +``rustup`` is installed, enabling WASM as a compilation target is as +simple as running the following command. + +:: + rustup target add wasm32-unknown-unknown + +Rust also proposes the ``wasm64-unknown-unknown`` compilation +target. This target is **not** compatible with Tezos smart rollups, +which only provides a 32bit address space. + +.. note:: + + This document is not a tutorial about Rust, and familiarity with + the language and its ecosystem (*e.g.*, how Rust crates are + structured in particular) is assumed. + +The simplest kernel one can implement in Rust (the one that returns +directly after being called, without doing anything particular) is the +following. + +.. code:: rust + + #[no_mangle] + pub extern "C" fn kernel_run() { + } + +This code can be easily computed with ``cargo`` with the following +``Cargo.toml``. + +:: + + [package] + name = 'noop' + version = '0.1.0' + edition = '2021' + + [lib] + crate-type = ["cdylib"] + +The key line to spot is the ``crate-type`` definition to +``cdylib``. As a side note, when writing a library that will +eventually be consumed by a Kernel WASM crate, this line must be +modified to + +.. code:: toml + + crate-type = ["cdylib", "rlib"] + +Compiling our ``noop`` kernel is done by calling ``cargo`` with the +correct argument. + +:: + + cargo build --target wasm32-unknown-unknown + +To make the use of the ``target`` optional, it is possible to create +a ``.cargo/config.toml`` file, containing the following line. + +:: + + [build] + target = "wasm32-unknown-unknown" + + [rust] + lld = true% + +Host Functions in Rust +"""""""""""""""""""""" + +Exposing host functions exported by the WASM runtime to a Rust program +is actually really straightforward. The ``link`` pragma is used to specify the +module that exports them (in our case, ``smart_rollup_core``). + +.. code:: rust + + #[link(wasm_import_module = "smart_rollup_core")] + extern "C" { + /// Returns the number of bytes written to `dst`, or an error code. + pub fn read_input( + level: *mut i32, + id: *mut i32, + dst: *mut u8, + max_bytes: usize, + ) -> i32; + + /// Returns 0 in case of success, or an error code. + pub fn write_output(src: *const u8, num_bytes: usize) -> i32; + + /// Does nothing. Does not check the correctness of its argument. + pub fn write_debug(src: *const u8, num_bytes: usize); + + /// Returns + /// - 0 the key is missing + /// - 1 only a file is stored under the path + /// - 2 only directories under the path + /// - 3 both a file and directories + pub fn store_has(path: *const u8, path_len: usize) -> i32; + + /// Returns 0 in case of success, or an error code + pub fn store_delete(path: *const u8, path_len: usize) -> i32; + + /// Returns the number of children (file and directories) under a + /// given key. + pub fn store_list_size(path: *const u8, path_len: usize) -> i64; + + /// Returns the size of the key loaded in memory at `dst`, or an + /// error code. + pub fn store_get_nth_key( + path: *const u8, + path_len: usize, + index: i64, + dst: *mut u8, + max_size: usize, + ) -> i32; + + /// Returns 0 in case of success, or an error code. + pub fn store_copy( + src_path: *const u8, + scr_path_len: usize, + dst_path: *const u8, + dst_path_len: usize, + ) -> i32; + + /// Returns 0 in case of success, or an error code. + pub fn store_move( + src_path: *const u8, + scr_path_len: usize, + dst_path: *const u8, + dst_path_len: usize, + ) -> i32; + + /// Returns the number of bytes written to the durable storage + /// (should be equal to `num_bytes`, or an error code. + pub fn store_read( + path: *const u8, + path_len: usize, + offset: usize, + dst: *mut u8, + num_bytes: usize, + ) -> i32; + + /// Returns 0 in case of success, or an error code. + pub fn store_write( + path: *const u8, + path_len: usize, + offset: usize, + src: *const u8, + num_bytes: usize, + ) -> i32; + + /// Returns the number of bytes written at `dst`, or an error + /// code. + pub fn reveal_metadata( + dst: *mut u8, + max_bytes: usize, + ) -> i32; + + /// Returns the number of bytes written at `dst`, or an error + /// code. + pub fn reveal_preimage( + hash_addr: *const u8, + dst: *mut u8, + max_bytes: usize, + ) -> i32; + } + +These functions are marked as ``unsafe`` for Rust. It is possible to +provide safe API on top of them. For instance, the ``read_input`` host +function can be used to declare a safe function which allocates a +fresh Rust Vector to receive the input. + +.. code:: rust + + // Assuming the host functions are defined in a module `host`. + + pub const MAX_MESSAGE_SIZE: u32 = 4096u32; + + pub struct Input { + pub level: u32, + pub id: u32, + pub payload: Vec, + } + + pub fn next_input() -> Option { + let mut payload = Vec::with_capacity(MAX_MESSAGE_SIZE as usize); + + // Placeholder values + let mut level = 0i32; + let mut id = 0i32; + + let size = unsafe { + host::read_input( + &mut level, + &mut id, + payload.as_mut_ptr(), + MAX_MESSAGE_SIZE, + ) + }; + + if 0 < payload.len() { + unsafe { payload.set_len(size as usize) }; + Some(Input { + level: level as u32, + id: id as u32, + payload, + }) + } else { + None + } + } + +Coupling ``Vec::with_capacity`` along with the ``set_len`` unsafe +function is a good approach to avoid initializing the 4,096 bytes of +memory every time you want to load data of arbitrary size into the +WASM memory. + +Testing your Kernel +""""""""""""""""""" + +.. warning:: + + The ``octez-wasm-repl`` tool that is described in this section is + still under active development. A preliminary version can be found + in `the Octez repository `_. + + To get ``octez-wasm-repl``, the easiest way is to build Octez from + source. See the `usual instructions + `_. + + For now, ``octez-wasm-repl`` is **not** part of Octez, and is only + provided for developers interested in testing Tezos smart rollup + infrastructure before its release on mainnet. + +Testing kernels can be useful during its development, without relying +on starting a rollup on a test network. We provide a +*read-eval-print-loop* (REPL) as a mean to evaluate the WASM PVM +without relying on any node and network: ``octez-wasm-repl``. + +.. code:: sh + + octez-wasm-repl ${WASM_FILE} --inputs ${JSON_INPUTS} --rollup ${ROLLUP_ADDRESS} + +``octez-wasm-repl`` can take either a `.wasm` file (the binary +representation of WebAssembly modules) or a `.wast` file (its textual +representation), and actually parses and typechecks the kernel before +giving it to the PVM. It can take a file containing inboxes and a +rollup address. The expected contents of the inboxes is a JSON value, +with the following schema: + +.. code:: javascript + + [ + [ { "payload" : , + "sender" : , + "source" : + "destination" : } + .. + // or + { "external" : } + .. + ] + ] + +The contents of the input file is a JSON array of array of inputs, +which encodes a sequence of inboxes, where an inbox is a set of +messages. These inboxes are read in the same order as they appear in +the JSON file. For example, here is a valid input file that defines +two inboxes: the first array encodes an inbox containing only an +external message, while the second array encodes an inbox containing +two messages: + +.. code:: javascript + + [ + [ + { + "external": + "0000000023030b01d1a37c088a1221b636bb5fccb35e05181038ba7c000000000764656661756c74" + } + ], + [ + { + "payload" : "0", + "sender" : "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", + "source" : "tz1RjtZUVeLhADFHDL8UwDZA6vjWWhojpu5w", + "destination" : "scr1HLXM32GacPNDrhHDLAssZG88eWqCUbyLF" + }, + { "payload" : "Pair Unit False" } + ] + ] + +Note that the `sender`, `source` and `destination` fields are optional +and will be given default values by the REPL (which are the *zero* +adresses). If no input file is given it will be assumed empty. If no +rollup address is given, it will use a default address which is the +*zero* address: ``scr1AFyXAWFS3c6S2D617o8NGRvazoMJPEw6s``. + +``octez-wasm-repl`` is a REPL, as such it waits for user inputs to +continue its execution. Its initial state is exactly the same as right +after its origination. Its current state can be inspected with the +command ``show status``: + +.. code:: + + > show status + Status: Waiting for inputs + Internal state: Snapshot + +At start, internally the kernel is in snapshot mode. It means it is +not executing any WASM code, and initially it is waiting for inputs to +proceed. It needs some inputs to continue its execution. The command +``load inputs`` will load the first inbox from the file given with the +option `--input`, putting `Start_of_level` (and `End_of_level`) before +(resp. after) these inputs. + +.. code:: + + > load inputs + Loaded 3 inputs at level 0 + + > show status + Status: Evaluating + Internal state: Decode + +At this point, the internal input buffer can be inspected with the +command ``show inbox``. + +.. code:: + + > show inbox + Inbox has 3 messages: + { raw_level: 0; + counter: 0 + payload: Start_of_level } + { raw_level: 0; + counter: 1 + payload: 0000000023030b01d1a37c088a1221b636bb5fccb35e05181038ba7c000000000764656661756c74 } + { raw_level: 0; + counter: 2 + payload: End_of_level } + +The first input of an inbox at the beginning of a level is +`Start_of_level`, and is represented by the message ``\000\001`` on +the kernel side. We can now start a `kernel_run` evaluation: + +.. code:: + + > step kernel_run + Evaluation took 10000 ticks so far + Status: Evaluating + Internal state: Snapshot + + +The memory of the interpreter is flushed between two `kernel_run` +call (at the `Snapshot` internal state), however the ``durable +storage`` can be used as a persistent memory. Let's assume this kernel +wrote data at key `/store/key`: + +.. code:: + + > show key /store/key + `` + +Since the representation of values is decided by the kernel, the REPL can only +return its raw value. It is possible however to inspect the memory by stopping +the PVM before its snapshot internal state, with ``step result``, and +inspect the memory at pointer `n` and length `l`, and finaly evaluate until the +next `kernel_run`: + +.. code:: + + > step result + Evaluation took 2500 ticks so far + Status: Evaluating + Internal state: Eval (Result) + + > show memory at p for l bytes + `` + + > step kernel_run + Evaluation took 7500 ticks so far + Status: Evaluating + Internal state: Snapshot + +Once again, note that values from the memory are outputted as is, +since the representation is internal to WASM. + +Finally, it is possible to evaluate the whole inbox with ``step inbox``: + +.. code:: + + > step inbox + Evaluation took 30000 ticks + Status: Waiting for inputs + Internal state: Snapshot + +It is also possible to show the outbox for any given level (``show outbox at level 0``) + +.. code:: + + > show outbox + Outbox has N messages: + { unparsed_parameters: ..; + destination: ..; + entrypoint: ..; } + .. + + +Glossary +-------- + +#. **PVM**: A Proof-generating Virtual Machine is a reference + implementation for a device on top of which a smart rollup can be + executed. This reference implementation is part of the Tezos + protocol and is the unique source of truth regarding the semantics + of rollups. The PVM is able to produce proofs enforcing this truth. + This ability is used during the final step of refutation games. + +#. **Inbox**: A sequence of messages from the layer-1 to smart rollups. + The contents of the inbox is determined by the consensus of the + Tezos protocol. + +#. **Outbox**: A sequence of messages from a smart rollup to the layer-1. + Messages are smart contract calls, potentially containing tickets. + These calls can be triggered only when the related commitment is + cemented (hence, at least two weeks after the actual execution of + the operation). + +#. **Commitment period**: A period of 30 blocks during which all inbox + messages must be processed by the rollup node state to compute a + commitment. A commitment must be published for each commitment + period. + +#. **Refutation period**: At the end of each commitment period, a + period of two weeks starts to allow any commitment related to + this commitment period to be published. + +#. **Staker**: An implicit account that has made a deposit on a + commitment. + +#. **Refutation game**: A process by which the Tezos protocol solves + a conflict between two stakers. diff --git a/docs/mumbai/sr_boot_kernel.sh b/docs/mumbai/sr_boot_kernel.sh new file mode 100644 index 000000000000..9503276cfb9a --- /dev/null +++ b/docs/mumbai/sr_boot_kernel.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +export KERNEL="010fa03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303000d5024ff4c33df62141bd485af4154641aa9220c5dede9aed006eb5d3c88bff3b" diff --git a/docs/mumbai/timelock.rst b/docs/mumbai/timelock.rst new file mode 100644 index 000000000000..9fc225ee4c5d --- /dev/null +++ b/docs/mumbai/timelock.rst @@ -0,0 +1,138 @@ +Time-lock +========= + + +Background +---------- + +The issue of "generalized front-running", is a common attack on certain blockchain transactions. +Since a transaction can be observed before it is actually included in the chain, it +can give an advantage to one user (generally a trader) against another. More specifically, +it means block producers can extract "rent" from the system +as they have the ability to choose and order transactions within a block. + +This issue is sometimes referred to, in proof-of-work networks like Ethereum, as +`Miner Extractable Value `_ or MEV for short. +It is described in more detail +`here `__. +We refer to it as BPEV, for "Block Producer Extractable Value". +Note that the term "front-running" is misleading as it implies there is a +fiduciary relationship between block producers and transaction emitters where, +in fact, none exists unless explicitly contracted into. + +For example, upon receiving a transaction, a baker could craft a block including +this transaction and one of their own such that the sequential execution of these +two transactions guarantees a gain to the baker. + +Preventing BPEV with time-lock +------------------------------ + +BPEV can be prevented with the use of time-lock encryption +(see `Time-lock puzzles and timed release Crypto `_ +for more details). + +Time-lock encryption allows for encrypting a message so it can be +decrypted in two ways. +Either the author of the ciphertext produces a plaintext +(and a proof of correct decryption) +by providing a secret trapdoor (the factorization of an RSA modulus in our case). +Or, a sequential computation can decrypt the ciphertext after a computation +requiring ``T`` sequential operations (modular squaring in our case), +for some pre-determined constant ``T``. + +In addition, a proof of the correctness of the decryption can also be produced and checked in sub linear time (``log T`` in our case). + +By experimentally measuring the time the sequential operation takes +on available hardware using optimized implementation, one can estimate +a rough conversion (or a bound in our case) between the constant ``T`` and +wall clock time. +Note that the `VDF alliance `_ has been working on producing an ASIC for squaring in an RSA group to +ensure a level playing field in terms of computational speed. + + +General principles and usage +----------------------------- + +The typical usage pattern would be as follows: + +1. In a first period, a contract collects user-submitted and time-lock encrypted Michelson values along with some valuable deposit, such as tez. +2. In a second period, after the values are collected, the contract collects from users a decryption of the value they submitted alongside with a proof that the decryption is correct. +3. In a third period, if any value isn't decrypted, anyone can claim part of the deposit by submitting a decryption of the value, with the other part of the deposit being burnt. Different penalties can be assessed depending on whether the user merely failed to submit a decryption for their value, or if they also intentionally encrypted invalid data. Different rewards can be distributed for submitting a correct decryption. The third period needs to be long enough so that people have enough time to perform the time-lock decryption. +4. Finally, the contract can compute some function of all the decrypted data. + +There is generally no incentive for users not to provide +the decryption of their data and thus the third period generally does not need +to take place. However, the second period needs to be long enough so that bakers +cannot easily censor submission of the decryption in a bid to later claim the reward. +Burning a part of the deposit also limits grieving attacks where a user gets back +their whole deposit by providing the decryption, but in a way that delays everyone else. + +Cryptographic design +-------------------- + +The time-lock features are supported by the Tezos_crypto.Timelock `library `__. + +Users first generate a RSA modulus and a symmetric encryption key. +They use authenticated encryption to encrypt a packed Michelson value (an array of bytes computed with ``PACK``) +and encrypt that encryption key using a time-lock puzzle. +They then combine the RSA modulus, the time-locked symmetric key, the constant ``T`` +and the encrypted value as a single value as well (called ``chest`` in our library). + +A proof of decryption can be the symmetric key itself. +However, a malicious user could propose an authenticated ciphertext that does not yield a valid value +even when decrypted with the symmetric key that was indeed time locked. +To avoid this threat, an opening (called ``chest_key`` in our library) includes the symmetric key and +a proof that the symmetric key proposed is indeed the one hidden in the time-lock puzzle. +In this way one can differentiate whether the chest or the chest_key was proposed by a +malicious user. + + +Opcode and types +---------------- + +To expose the features of this library, the Michelson language provides the following types: + +- ``chest``, which represents time-locked arbitrary bytes with the + necessary public parameters to open it. +- ``chest_key``, which represents the decryption key, + alongside with a proof that the key is correct. + +and the following opcode: + +``open_chest :: chest_key → chest → time → or (bytes, bool)`` + +``open_chest`` takes a ``chest`` and ``chest_key``, and produces either the underlying plaintext +or indicates that the ``chest`` or the ``chest_key`` is malicious. + +If we open the chest with a correctly generated chest key, the instruction pushes +``Left bytes`` on top of the stack where the bytes are +cryptographically guaranteed to be the bytes the chest provider time-locked. +If the ciphertext does not decrypt under the symmetric key that was time-locked, it pushes on the stack +``Right False``. +If the provided symmetric key was not the one time-locked +(detectable due to the time-lock proof), +it pushes on the stack ``Right True``. +Note that the implementation uses an authenticated encryption scheme, +so one can detect if someone provides a wrong key while fooling the time-lock proof. +This is doable only by someone knowing the factorization of the RSA modulus. +However, this cannot prevent someone from encrypting a wrong key, or putting +a wrong message authentication code, so this is why a proof of correctness is still needed. + + +Implementation of the time-lock puzzle +-------------------------------------- + +The implementation of the time-lock puzzle +and proof scheme is located in :src:`src/lib_crypto/timelock.ml`. It is inspired by +the proof-of-concept shown +`here `__. + +The utility developed by `Completium `_ available `here `__, +allows a user to create chests and chest keys to interact with a smart contract. + + +Example +------- + +The raffle contract on Open Tezos `here `__ +gives a concrete example of using time-lock. diff --git a/docs/mumbai/token_management.rst b/docs/mumbai/token_management.rst new file mode 100644 index 000000000000..4f6348b43973 --- /dev/null +++ b/docs/mumbai/token_management.rst @@ -0,0 +1,206 @@ +Token transfers and balance updates +=================================== + +This page describes the reporting of tokens transfers in block metadata, as a sequence of balance updates. They serve among others to the Octez client to derive and print the `Balance updates` sections of the receipts reported when operations are included in blocks. + +Overview +~~~~~~~~ + +Minting, transferring or burning tokens is handled by the `Token `_ module. +The module provides functions (``Token.transfer`` and ``Token.transfer_n``) to transfer tokens from one, respectively from more accounts, to another account. +Balance updates found in block metadata are generated by these functions as a trace of the token movements having taken place. + +Balance updates indicate that either: tokens have been minted and deposited into an account, transferred from or to another account, or taken from an account and burned. +In the Json format, a balance update consists of three parts: + + - an account identification indicated by a combination of fields such as: ``kind``, ``category``, ``contract``, ... + + - the amount transferred (in mutez) indicated by the field ``change``. + A positive amount indicates that the account has been credited, and a negative amount indicates that the account has been debited. + + + - the cause of the update given by the field ``origin`` which may have the following values: + + * ``"block"`` means that the balance update originates from the application of a block + * ``"migration"`` means that the balance update originates from migration + * ``"subsidy"`` means that the balance update originates from subsidies for liquidity baking + + +A transfer of tokens is represented by a continuous and ordered sequence of (balance) updates. +That sequence starts with a series of debits, and ends with a credit matching those debits. +In block metadata, the field ``"balance updates"`` contains one or more transfers, represented by their sequences of updates, concatenated in a flat list. +Consider for example the following list: + +:: + + [ {"kind": "...", ..., "change": "-100", "origin": "block"}, + {"kind": "...", ..., "change": "100", "origin": "block"}, + {"kind": "...", ..., "change": "-125", "origin": "block"}, + {"kind": "...", ..., "change": "-75", "origin": "block"}, + {"kind": "...", ..., "change": "200", "origin": "block"} ] + +This list reports that two transfers have occurred: a transfer of ``100`` mutez from one account to another, and a transfer of ``200`` mutez from two accounts to a third. +There is one exception to this though: migration balance updates are a bit compressed to save space, so the list of balance updates in the corresponding metadata does not necessarily allow to correlate debits to a credit by analyzing the sequence. +However, for those balance updates, the ``delegate`` and ``contract`` fields can be used to establish correlations between debits and credits. + +Source, container, and sink accounts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There are three kinds of accounts: source accounts, container accounts, and sink accounts. +Tokens can be transferred from source or container accounts, to container or sink accounts. +All balance updates contain the field ``kind`` which allows to determine the kind of account it refers to. +The possible values of this field are described in the following sections (they are not simply ``"source"``, ``"container"``, and ``"sink"``). +Depending on the kind of account, more fields such as the ``category`` field may be used to identify accounts more specifically. + +Source accounts +--------------- + +Source accounts are debited whenever new tokens are minted. +A balance update refers to a source account if and only if the field ``kind`` has the value ``"minted"``. +The value of the additional field ``category`` designates one of the following fictitious accounts, each containing a virtually unlimited number of tokens: + +* ``"nonce revelation rewards"`` is the source of tokens minted to reward delegates for revealing their nonces +* ``"double signing evidence rewards"`` is the source of tokens minted to reward delegates for injecting a double signing evidence +* ``"endorsing rewards"`` is the source of tokens minted to reward delegates for endorsing blocks +* ``"baking rewards"`` is the source of tokens minted to reward delegates for creating blocks +* ``"baking bonuses"`` is the source of tokens minted to reward delegates for validating blocks and including extra endorsements +* ``"subsidy"`` is the source of tokens minted to subsidize the liquidity baking CPMM contract +* ``"invoice"`` is the source of tokens minted to compensate some users who have contributed to the betterment of the chain +* ``"commitment"`` is the source of tokens minted to match commitments made by some users to supply funds for the chain +* ``"Tx_rollup_rejection_rewards"`` is the source of tokens minted to reward an account for injecting a transaction rollup rejection operation +* ``"Sc_rollup_refutation_rewards"`` is the source of tokens minted to reward an account for winning a smart-contract rollup refutation game +* ``"bootstrap"`` is analogous to ``"commitment"`` but is for internal use or testing. + It will not be used during normal operation on mainnet, but may be used on test networks or in sandboxed mode +* ``"minted"`` is only for internal use and may be used to mint tokens for testing. + It will not be used during normal operation on mainnet, but may appear on test networks or in sandboxed mode. + +Container accounts +------------------ + +Container accounts are regular (user and smart contract) accounts, or convenience accounts that hold tokens temporarily (e.g. when parts of a delegate's funds are frozen). +The field ``kind`` allows to identify the type of container account, it can have one of the following values: + +* ``"contract"`` represents implicit or originated accounts, and comes with the additional field (also called) ``contract`` whose value is the public key hash of the implicit or originated account. +* ``"freezer"`` represents frozen accounts, and comes with the additional field ``category`` that can have one of the following values: + + - ``"legacy_deposits"``, ``"legacy_fees"``, or ``"legacy_rewards"`` represent the accounts of frozen deposits, frozen fees or frozen rewards up to protocol HANGZHOU. + Accounts in this category are further identified by the following additional fields: + + - the field ``delegate`` contains the public key hash of the delegate who owns the frozen funds + - the field ``cycle`` contains the cycle at which the funds have been deposited or granted. + + - ``"deposits"`` represents the accounts of frozen deposits in subsequent protocols (replacing the legacy container account ``"legacy_deposits"`` above). + Accounts in this category are further identified by the additional field ``delegate`` whose value is the public key hash of the delegate who owns the frozen funds. + + - ``"bonds"`` represents the accounts of frozen bonds. + Bonds are like deposits. + However, they can be associated to implicit or originated accounts, unlike deposits that only apply to implicit accounts that are also delegates. + Accounts in this category are further identified by the following additional fields: + + - the field ``contract`` contains the public key hash of the implicit account, or the contract hash of the originated account + - the field ``bond_id`` contains the identifier of the bond (e.g. a rollup hash if the bond is associated to a transaction or a smart contract rollup). +* ``"accumulator"`` represents accounts used to store tokens for some short period of time. + This type of account is further identified by the additional field ``category`` whose (only possible) value ``"block fees"`` designates the container account used to collect manager operation fees while block's operations are being applied. + Other categories may be added in the future. +* ``"commitment"`` represents the accounts of commitments awaiting activation. + This type of account is further identified by the additional field ``committer`` whose value is the encrypted public key hash of the user who has committed to provide funds. + +Sink accounts +------------- + +Sink accounts are credited whenever tokens are burned. +A balance update refers to a sink account if and only if the field ``kind`` has the value ``"burned"``. +The value of the additional field ``category`` allows to identify more specifically a fictitious account able to receive a virtually unlimited number of tokens. +The field ``category`` of a sink account may have one of the following values: + +* ``"storage fees"`` is the destination of storage fees burned for consuming storage space on the chain +* ``"punishments"`` is the destination of tokens burned as punishment for a delegate that has double baked or double endorsed +* ``"lost endorsing rewards"`` is the destination of rewards that were not distributed to a delegate. + This category comes with the following additional fields: + + - the field ``delegate`` contains the public key hash of the delegate + - the field ``participation`` has the value ``"true"`` if participation was not sufficient and has the value ``"false"`` otherwise + - the field ``revelation`` has the value ``"true"`` if the delegate has not revealed his nonce and has the value ``"false"`` otherwise. +* ``"Tx_rollup_rejection_punishments"`` is the destination of tokens burned as punishment for submitting erroneous commitments +* ``"Sc_rollup_refutation_punishments"`` is the destination of tokens burned as punishment for submitting bad commitments that have been refuted +* ``"burned"`` is only for internal use and testing. + It will not appear on mainnet, but may appear on test networks or in sandboxed mode. + +Token transfers and metadata +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Balance updates in block metadata give a complete account of all token transfers that have occurred when a block is applied. +A few cases of token transfers and the associated metadata are illustrated below. +All other cases of token transfers in the protocol follow the same pattern. +The only differences are the accounts involved. + +Origination and transaction +--------------------------- + +When an origination or transaction operation is applied, tokens are transferred from one contract to another. +Depending on whether or not storage space has been allocated on the chain by the application of the operation, storage fees may also be burned. +For example, a transaction of ``100`` mutez from address ``tz1a...`` to address ``KT1b...`` that allocates storage space for a cost of ``10`` mutez produces the following list of balance updates: + +:: + + [ {"kind": "contract", "contract": "tz1a...", "change": "-100", "origin": "block"}, + {"kind": "contract", "contract": "KT1b...", "change": "100", "origin": "block"} + {"kind": "contract", "contract": "tz1a...", "change": "-10", "origin": "block"} + {"kind": "burned", "category": "storage fees", "change": "10", "origin": "block"} ] + +Baking fees, rewards and bonuses +-------------------------------- + +When a contract pays the baking fees associated to an operation it has emitted, those fees are temporarily collected (during the processing of the block) into the container account ``"block fees"``. +For example, when a manager operation is applied, the account of the payer contract is debited with the amount of fees and the ``"block fees"`` account is credited with the same amount. Hence, for ``100`` mutez in fees, the following balance updates are generated : + +:: + + [ {"kind": "contract", "contract": "tz1x...", "change": "-100", ...}, + {"kind": "accumulator", "category": "block fees", "change": "100", ...} ] + +When all operations of a block have been applied baking fees rewards and bonuses are distributed. +The total amount of fees collected and the baking rewards are transferred from the container account ``"block fees"`` and the source account ``"baking rewards"``, respectively, to the contract of the payload producer that selected the transactions to be included in the block. +So, for a total amount of ``1000`` mutez in fees collected and an amount of ``500`` mutez in baking rewards, the following balance updates are generated: + +:: + + [ {"kind": "accumulator", "category": "block fees", "change": "-1000", ...}, + {"kind": "minted", "category": "baking rewards", "change": "-500", ...}, + {"kind": "contract", "contract": "tz1a...", "change": "1500", ...} ] + +The baking bonus go to the block proposer that signed and injected the block. +Hence the amount of the bonus is transferred from the source account ``"baking bonuses"`` to the contract of the block producer. +For example, the balance updates generated for an amount of ``100`` mutez in baking bonus are: + +:: + + [ {"kind": "minted", "category": "baking bonus", "change": "-100", ...}, + {"kind": "contract", "contract": "tz1b...", "change": "100", ...} ] + +Endorsing, double signing evidence, and nonce revelation rewards +---------------------------------------------------------------- + +Endorsing rewards are reflected in balance updates as a transfer of tokens from the ``"endorsing rewards"`` source account to the account of the delegate that receives the reward. +Hence, for a reward of ``100`` mutez, the following two balance updates are generated: + +:: + + [ {"kind": "minted", "category": "endorsing rewards", "change": "-100", ...}, + {"kind": "contract", "contract": "tz1...", "change": "100", ...} ] + +When endorsing rewards are not distributed to the delegate due to insufficient participation or for not revealing nonces, they are transferred instead to the sink account identified by the quadruple ``("lost endorsing rewards", delegate, participation, revelation)``. +For example, for an amount of ``100`` mutez in rewards not distributed due to insufficient participation, the following balance updates are generated: + +:: + + [ {"kind": "minted", "category": "endorsing rewards", "change": "-100", ...}, + {"kind": "burned", + "category": "lost endorsing rewards", + "delegate": "tz1...", + "participation": "true", + "revelation": "false", + "change": "100", ...} ] + +Double signing evidence rewards and nonce revelation rewards are analogous to endorsing rewards, except that the source accounts used are ``"double signing evidence rewards"`` and ``"nonce revelation rewards"``. + diff --git a/docs/mumbai/transaction_rollups.rst b/docs/mumbai/transaction_rollups.rst new file mode 100644 index 000000000000..7d03f884ab69 --- /dev/null +++ b/docs/mumbai/transaction_rollups.rst @@ -0,0 +1,902 @@ +Transaction Rollups +===================== + +High-frequency transactions are hard to achieve on a blockchain that +is decentralized and open. For this reason, many blockchains offer the +possibility to define "layer-2" solutions that relax some +constraints in terms of consensus to increase transaction +throughput. The **layer-1** (the main blockchain) acts as a gatekeeper +for several **layer-2** (secondary blockchains), and provides economic +incentives to prevent attacks. + +Introduction to Optimistic Rollups +---------------------------------- + +**Optimistic rollups** are a popular layer-2 solution, *e.g.*, on the +Ethereum blockchain (Boba, Arbitrum, Optimism, etc.). When it comes to +an optimistic rollup, the layer-2 operates using a logic similar to +the layer-1, but it is updated off-chain, potentially much faster, and its changes are regularly committed to layer-1. + +The layer-1 implements a decentralized ledger (called the **layer-1 +context** thereafter) that participants of the network can update +thanks to authenticated layer-1 operations. These operations are +grouped together in **layer-1 blocks** (hence the name “blockchain”). + +Similarly, the layer-2 implements a ledger (called the **layer-2 +context**), that participants can update by sending **messages** +stored in the layer-1 context in an **inbox**, with precise +semantics for the interpretation of messages on top +of a layer-2 context, resulting in the production of a new layer-2 +context. + +More precisely, an optimistic rollup works as follows: + +#. Certain layer-1 operations will append messages to the + inbox. The inbox is analogous to the layer-1 blocks. As such, the + consensus of the layer-1 decides which messages the layer-2 has to + consume, and in which order. +#. The layer-2 context is updated off-chain by a **rollup node**, using the semantics of + the messages. +#. A layer-1 operation allows the rollup node to include the hash of the layer-2 + context after the execution of the layer-2 operations in the + layer-1 context. +#. The layer-1 implements a procedure to reject erroneous hashes of + the layer-2 context (*e.g.*, submitted by an attacker). +#. After a period of time specific to each rollup implementation, and + in the absence of a dispute, the hashes of the layer-2 context + become **final**, that is, they cannot be rejected. We call + **layer-2 finality period** the time necessary for the hash of a + layer-2 context to become final. + In the meantime, new layer-1 operations may have filled the inbox with new messages that call for pursuing the same workflow. + +The layer-2 context is encoded in a Merkle tree, an ubiquitous data +structure in the blockchain universe with many interesting +properties. One of these properties is significant in the context of +optimistic rollups: it is possible to prove the presence of a value in +the tree without having to share the whole tree, by means of Merkle +proofs. This property ensures that the procedure to reject a hash does +not require to compute the whole layer-2 context. + +The rollup node is a daemon responsible for interpreting the +messages (as stored in the inbox) onto the layer-2 context, and for +posting the resulting hashes in the layer-1. In “optimistic rollup”, +the word “optimistic” refers to the assumption that at least one +honest transaction rollup node will always be active to reject +erroneous hash. +The presence of a single honest node is sufficient to guarantee the correct application of the layer-2 operations in the rollup. +In its absence, nothing prevents a rogue node to post a +maliciously tampered layer-2 context. + +Introduction to Transaction Rollups +----------------------------------- + +**Transaction Rollups** are an implementation of optimistic +rollups in Tezos, characterized by the following principles: + +#. The semantics of the messages consists of the transfer of assets represented as Michelson tickets. +#. The procedure to reject erroneous hashes allows for a finality + period of 40,000 blocks. +#. They are implemented as part of the economic protocol of Tezos + directly, not as smart contracts. + +The latter design choice, made possible by the amendment feature of +Tezos, allows for a specialized, gas- and storage-efficient +implementation of optimistic rollups. + +Note that it is possible to create any number of transaction rollups on +Tezos. They are identified with **transaction rollup addresses**, +assigned by the layer-1 at their respective creation (called +origination in Tezos to mimic the terminology used for smart +contract). They are prefixed by ``txr1`` when encoded in a base58 +alphabet (see also the :ref:`kinds of address prefixes in Tezos `). + +Workflow Overview +----------------- + +Transaction rollups allow for exchanging financial assets, encoded as +`Michelson tickets +`_, at a +higher throughput than what is possible on Tezos natively. + +Analogous to layer-1 addresses, **layer-2 addresses** identify assets +holders in the layer-2 ledger, meaning layer-2 addresses own and +exchange Michelson tickets. +They are prefixed by ``tz4`` when encoded in a base58 alphabet. + +The expected workflow proceeds as follows. + +#. Layer-1 smart contracts can **deposit** tickets to a transaction rollup for the benefit of + a layer-2 address. +#. A layer-2 address is associated with a cryptographic public key, + and the owner of the companion secret key (called “the owner of the + layer-2 address” afterwards) can sign transfer orders. These orders + are for the benefit of either another layer-2 address (meaning the + transfer order only concerns the layer-2) or a layer-1 address + (making the transfer order a withdrawal of their asset outside of + the transaction rollup). + +To be interpreted by the transaction rollup, transfer orders have to +be signed by (1) the owner of a layer-2 address, and (2) the owner of +a layer-1 address. This is because they are wrapped in a dedicated +layer-1 operation. + +While owners of layer-2 addresses who also own a layer-1 address can +submit their transfer and withdraw orders themselves, the expected +workflow is that they delegate this to a trusted transaction rollup +node, which can batch together several layer-2 operations signed by +several owners of layer-2 addresses and submit only one layer-1 +operation. + +Implementation Overview +----------------------- + +Here we examine the specific implementation of transaction rollups in +Tezos. + +Origination +*********** + +Anyone can originate a transaction rollup on Tezos, as the result of +the layer-1 operation ``Tx_rollup_origination``. In a similar manner +as contracts, transaction rollups are assigned an address, prefixed by +``txr1`` when encoded with a base58 alphabet. + +Exchanging Tickets +****************** + +The main objective of a transaction rollup is to allow Michelson +tickets to be exchanged between layer-2 addresses. Before diving into +more details on how these exchanges happen, it is necessary to discuss +how layer-2 addresses and tickets are identified in the layer-2. + +First, a layer-2 address is primarily identified by a Blake2B, +20-bytes long hash of a BLS public key (prefixed by ``tz4`` when +encoded with a base58 encoding). Besides, the layer-2 assigns an +integer to each layer-2 address, which can be used in place of the +hash of the BLS public key. This design choice allows for reducing the +size of the layer-1 operations responsible for appending messages to +the inbox of a transaction rollup, which in turn allows for publishing +more of these layer-1 operations in a layer-1 block. This is an +essential property to give transaction rollup a high throughput. + +Secondly, a similar mechanism is implemented for ticket +identifiers. By default, tickets are identified by 32-byte hashes +computed by the economic protocol. However, the layer-2 also assigns +integers to ticket hashes, to save up block space. + +Ticket Deposit +^^^^^^^^^^^^^^ + +Initially, the layer-2 ledger of the newly created transaction rollup +is empty. This ledger needs to be provisioned with tickets, which are +deposited into layer-2 by layer-1 smart contracts. They do so by +emitting layer-1 transactions to the transaction rollup address, +targeting more specifically the ``deposit`` entrypoint, whose argument +is a pair consisting of: + +#. a ticket (of any type), and +#. a layer-2 address (of type ``tx_rollup_l2_address`` in Michelson), + which can either be a natural number or a base58 encoded public key + hash. + +Only smart contracts can send tickets to rollups. + +Here is a minimal example of a smart contract depositing ``unit`` +tickets to a Transaction Rollup:: + + parameter (pair address tx_rollup_l2_address); + storage (unit); + code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %deposit (pair (ticket unit) tx_rollup_l2_address); + + IF_SOME { + SWAP; + + # amount for transferring + PUSH mutez 0; + SWAP; + + # create a ticket + PUSH nat 10; + PUSH unit Unit; + TICKET; + ASSERT_SOME; + + PAIR ; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } + +When its ``default`` entrypoint is called, this smart contract emits +an internal transaction targeting a transaction rollup in order to +deposit 10 ``unit`` tickets for the benefit of a given layer-2 +address. + +Transfers +^^^^^^^^^ + +Once a layer-2 address has been provisioned with a ticket, the owner +of this address can transfer it to other layer-2 addresses. + +Transfer orders are divided into two parts: a header, which identifies +the emitter, and one or more payloads, which specify as many transfer +orders. + +More precisely, the header consists in: + +#. The layer-2 account authoring the operation, also called its + *signer* +#. The counter associated to this layer-2 address. + +Counters are an anti-replay measure commonly used in blockchains. For +instance, Tezos uses a similar mechanism. See `the documentation +`_ for more +information. + +Then, the payload allows the signer to transfer the ownership of a +given ticket in a given quantity for the benefit of a given +address. More precisely, the payload consists in + +#. A destination address. It can either be a layer-1 address, that is + a ``tz1``, or a layer-2 address, that is a ``tz4`` or the integer + associated with this address by the layer-2. +#. A ticket hash identifying the asset to exchange, or the integer + associated with this ticket hash by the layer-2. +#. The quantity of the ticket being exchanged, encoded as an ``int64`` + value. + +The mapping between the layer-2 addresses and their associated +integers is maintained by the transaction rollup node. + +The interpretation of a transfer order will fail in the following +cases: + +#. If the signer of the operation does not own the required + quantity of the ticket. +#. If the new balance of the beneficiary of the transfer after the + application of the operation overflows. The quantity of the ticket + a layer-2 address owns is encoded using a ``int64`` value. This is + a known limitation of the transaction rollups, made necessary to + bound the size of the rejection payload so that it can fit in a + layer-1 operation. + +Transfers can be grouped inside a **transaction**. A transaction is +atomic: if any transfer of the transaction fails, then the whole +transaction fails and leaves the balances of the related addresses +unchanged. This can be useful to implement trades. For instance, two +parties can agree upon exchanging two tickets without having to trust +each other for the emission of the counter-part transfer. For a +transaction to be valid, it needs to be signed by the authors of the +transfers it encompasses. + +If a transaction fails (because a transfer within that transaction fails), +the transfers are ignored, but the counters of their +signers are updated nonetheless. This means the transaction will need +to be submitted again, with updated counters, if the error is +involuntary. + +Transactions are submitted in **batches** to the layer-1, *via* the +``Tx_rollup_submit_batch`` layer-1 operation. A batch of transactions +contains the following pieces of information: + +#. The list of transactions that are batched together. +#. A BLS signature that aggregates together all the signatures + of all the transactions contained by the batch. + +A batch of transactions is invalid if the aggregated BLS signature is incorrect (e.g., if one of the included transactions is invalid). Such an invalid +batch is discarded by the transaction rollup node, and the counters of +the signers are not incremented. This means they can be submitted +again in a batch with a valid signature. + +Numbering layer-2 inboxes +************************* + +A **rollup level** is analogous to a block of layer-1. It is +identified by a natural number, starting from zero. For a given +rollup, a rollup level is assigned for each layer-1 block in which +there is at least one message in that rollup. Each rollup maintains +its own set of levels. So, layer-1 block 24601 might correspond to +rollup level 0 for rollup A, rollup level 3 for rollup B, and no +rollup level at all for rollup C. We often speak of inboxes and +rollup levels interchangeably, as each rollup level corresponds to one +inbox. + +A batch is one sort of **message**. The other sort is a deposit. +Deposits are created by L1 operations which transfer tickets to the +rollup. + +Proofs +****** + +**Merkle proofs** allow a computation to be proven, and then verified. +The roles in the proof game are: + +#. The **prover** performs a computation, producing a Merkle proof. +#. The **verifier** is given the proof and re-runs the computation, + producing a boolean: either the proof is correct, or the proof + is incorrect. + +The details of how Merkle proofs work are too complicated to explain +in this document. The important thing to know is that the data +storage of the computation is encoded in a Merkle tree, and that the +proof includes the root node of this tree (in addition to possibly some +other nodes). + + +Commitments and rejections +************************** + +In order to ensure that layer-2 transfers and :ref:`ticket withdrawals` are +correctly computed, rollup nodes issue **commitments**. A commitment +describes (using Merkle tree hashes) the result of applying *all* the +messages of an inbox to the layer-2 state. For each message of the +inbox, the commitment includes the hash of the state, and the hash of +any :ref:`ticket withdrawals` generated by the message. + +In this section, we describe commitments primarily from the +perspective of layer-1. Rollup nodes are responsible for executing +layer-2 operations and issuing commitments (and finalization, +deletions, and rejections if necessary), but their internal +deliberations are not described in this section. The incentive design +of optimistic rollups ensures that rollup nodes will behave correctly. + +The usual lifecycle of a rollup level is: uncommitted, then committed, +then finalized, then deleted. + +#. Uncommitted: At the uncommitted stage, there is no commitment. When + a commitment for an inbox is submitted using a layer-1 operation, + the level moves to the committed stage. A commitment for an inbox + can be issued in any layer-1 block after the block containing that + inbox. + +#. Committed: During this stage, commitments can be :ref:`rejected`, moving + the inbox back to the uncommitted stage. An inbox remains in this + stage until its commitment has been **finalized** by a finalize + operation. Finalize operations are only accepted for commitments + that have survived for more than 40,000 blocks (the **finality + period**, defined in ``tx_rollup_finality_period``) without being + :ref:`rejected`. The "finalize" operation removes the inbox from the + context. + +#. Finalized: During this stage, any :ref:`dispatch tickets` + operations from this rollup level can occur. Commitments can no + longer be rejected. + +#. Deleted: Finally, after the **withdrawal period** + (``tx_rollup_withdraw_period`` = 40,000 blocks), the commitment can + be removed from the context by another layer-1 operation. Dispatch + tickets operations from this rollup level can no longer occur (since the + commitment has been removed). + +A commitment also includes the predecessor commitment's hash (except +in the case of the first commitment for a rollup) and the rollup level +of the block that it is committing to, as well as the level's inbox +hash (in case of reorganizations). For each message of the inbox, the +commitment has a hash of two hashes: the layer-2 context hash, and the +withdrawal list's hash. This saves operation size by storing only a +single hash, at the cost of more complex rejection and withdrawal +operations. There is exactly one valid commitment possible for a given +block, because the computation of the Merkle proof of the layer-2 +operations is deterministic. + +At most one commitment is stored per level. If a commitment operation +is attempted for a level that already has a non-rejected commitment, +it will fail. Commitments are stored in a compact fashion: their +message hash lists are themselves Merkelized. + +Finalization is implemented as a layer-1 operation. This allows +finalization to be carbonated. It operates on the oldest unfinalized +commitment for a rollup. The finalization period needs to be long +enough so that an attempt by 33% of bakers to steal from a rollup by +censoring rejections can be noticed, and avoided by forking the +chain. + +After finalization, a commitment sticks around for the withdrawal +period, and then can be deleted by a layer-1 **remove commitment** +operation. For the most recent commitment deleted, the context keeps the +commitment's hash and last message around in case we need to examine +them to reject its successor. + +As discussed above, the inbox for a level is deleted during commitment +finalization. If no commitments are made, it is possible for inboxes +to pile up, which violates our gas assumptions that inboxes are +temporary. To prevent this, if there are more than +``tx_rollup_max_unfinalized_levels`` = 40,100 inbox levels with messages +but without finalized commitments, no further messages are accepted on +the rollup until a commitment is finalized. + +In order to issue a commitment, a **bond** is required: Tez tokens are +temporarily frozen, and are subject to slashing in the event of a +rejection. The bond is treated just like frozen balances for the +purpose of delegation. The bond is expensive enough +(``tx_rollup_commitment_bond`` = 10,000 Tez) to discourage bad +commitments. One bond can support any number of commitments from the +same source on a single rollup. The bond is collected at the time that +a given contract creates its first commitment on a rollup. It may be +refunded by another layer-1 operation, once the last commitment on the +rollup from its creator has been removed from the context (that is, +after the finality and withdrawal period). + +.. _rejected_mumbai: + +If a commitment is wrong (that is, its Merkle proof does not +correspond to the correct execution trace of the layer-2 apply +function), it may be **rejected**. A rejection operation for a +commitment names one of the messages of the commitment, and includes a +Merkle proof of the computation. It also includes the disputed +commitment message, and the Merkle proof that the commitment exists in +the compact commitment's Merkle tree. A layer-1 node can then replay +just the transfers of a single message to determine whether the +rejection is valid. Because of the compact structure of commitments, a +rejection also must include the predecessor message's layer-2 context +hash, as a starting point to verify the proof. And the withdrawal list +must be included, so that the layer-2 context hash can be verified +against the disputed message's predecessor. A rejection must be +included in a block within the finality period of the commitment. + +It might be possible to create a message whose proof is too long to +fit into a rejection operation. The limits we have imposed are +intended to be long enough to avoid this, but it is possible that our +limits are wrong. To handle this possibility, we impose a hard limit +on proof size, ``tx_rollup_rejection_max_proof_size``, which is less +than the operation size limit. If a proof turns out to be greater than +``tx_rollup_rejection_max_proof_size``, the entire message is treated +as a no-op. To reject such a commitment, the rejection operation will +contain a truncated proof. If the commitment committed to anything +other than the state prior to applying the message, the rejection +succeeds. So such messages are always treated as no-ops. + +In the case of a valid rejection, half of the commitment bond goes to +the rejector; the rest is burned. + +.. _withdrawals_mumbai: + +Ticket withdrawals +****************** + +Withdrawing a ticket from a rollup back to layer-1 is a three-phase +operation. + +First, a layer-2 operation is submitted requesting the withdrawal. +This is actually implemented as a transfer with a destination that is +a layer-1 address. As with any other transfer, it is included in a +batch, which is included in an inbox, which gets a commitment. After +that commitment is finalized, the next phase can begin. + +Next, because commitments are stored Merkelized, a **dispatch +tickets** layer-1 operation must be sent. This includes: + +#. The rollup and level that the withdrawals are in + +#. The message index in the inbox that contains the withdrawals. + +#. A Merkle proof that the hash of these withdrawals is included in + the specified Merkelized commitment. + +#. The ticket contents and amounts for every ticket withdrawn in that + message. + +Because all of the ticket contents for every withdrawal in a message +must fit into a single layer-1 operation, there are hard limits on the +size and count of tickets. The limit on ticket size, +``tx_rollup_max_ticket_payload_size``, is enforced at deposit time. +The limit on withdraw count is ``tx_rollup_max_withdrawals_per_batch``, +and it is enforced by the layer-2 apply function. Withdrawals +beyond this limit are treated as no-ops. + +The "dispatch tickets" operation updates the table of tickets to +transfer the tickets from the rollup to a layer-1 implicit account. +It also stores a record in the layer-1 context indicating that the +tickets for a message have been dispatched, so that the same dispatch +cannot happen again. If a dispatch tickets operation is not sent +before the ``tx_rollup_withdraw_period``, the tickets withdrawn in the +corresponding inbox are destroyed irrecoverably. + +After the dispatch tickets operation, a **transfer ticket** layer-1 +operation can be sent, which will transfer the tickets to their final +smart contract. There is no deadline for this. + +Getting Started +--------------- + +.. note:: + + On ``mondaynet`` and ``dailynet``, the various protocol parameters + related to transaction rollups have been lowered in order to make + it easier to run demo. For instance, a commitment can be finalized + after 10 blocks, compared to the 40,000 necessary in production. + +.. note:: + + We use shell variable to generalize command invocations. For + instance, we write:: + + echo ${tx_rollup_address} + + to emphasis that users are expected to provide the address of their + transaction rollup. + + +Originating a Transaction Rollup +******************************** + +The ``octez-client`` has a dedicated command that any implicit account holder +can use to originate a transaction rollup. + +.. code:: sh + + octez-client originate tx rollup ${tx_rollup_allias} from ${implicit_account_alias} + +where ``tx`` is an abbreviation for transaction. + +The origination of a transaction rollup burns ꜩ1. + +A transaction rollup address is attributed to the new transaction +rollup. This address is derived from the hash of the Tezos operation with the +origination operation similarly to the smart contract origination. It is always +prefixed by ``txr1``. For instance,:: + + txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi + +is a valid transaction rollup address. + +When using the ``octez-client`` to originate a transaction rollup, it outputs +the newly created address. + +Starting a Rollup Node +********************** + +Octez does **not** provide an official transaction rollup node. That +being said, an experimental transaction rollup node is under +development for testing and demonstration purposes. + +To get the experimental transaction rollup node, one can build it from +source. Following the `official procedure +`_ +is expected to be enough: the binaries will be available at the root +of the repository after ``make``. + +Another approach is to use the Docker images provided by Octez, for +instance the ``master`` image tag (see `the Docker Hub +`_). Note that we do not provide +a specialized entrypoint to interact with the binaries. One needs to +log into a container built on top of the image to use them. + +For instance, + +.. code:: + + docker run -it --entrypoint=/bin/sh tezos/tezos:master_4435f908_20220706144700 + +provides a shell with the rollup node and client available in the +``PATH``. + +.. note:: + + Similarly to other Octez binaries like the baker, there exists a + rollup node and client for each version of the Tezos protocol. You + can use the ``alpha`` binaries on testnets like `Mondaynet or + Dailynet `_. This is the recommended way to + experiment with Transaction Rollups, as the finality period on + Mondaynet and Dailynet is significantly shorter than on mainnet or + other testnets. + +The first step towards being able to use the experimental transaction +rollup node is to prepare its configuration file. + +.. code:: sh + + octez-tx-rollup-node-alpha init ${mode} config \ + for ${tx_rollup_address_or_name} \ + --data-dir ${data_dir} \ + --rpc-addr ${rpc_address} \ + [additional options to decide which keys to use to sign which L1 operations] + +(where ``${rpc_address}`` will be the address of the RPC server +provided by the rollup node) + +The main decision to make here is to choose a mode for the rollup +node, that is the set of actions a rollup node will perform. + +At its core, the rollup node is a software component responsible for +making a given transaction rollup progress by means of a set of +dedicated Tezos layer-1 operations. + +Finally, the rollup node comes with a concept of “modes” that decide +the set of actions the rollup node is expected to perform (and, as a +consequence, requires to provides certain keys). + +For instance, the ``observer`` mode makes the rollup node passive. An +observer node computes the state of the ledger of a transaction +rollup, but does not make it progress on the layer-1. An observer mode +can be useful to get a trustworthy source of truth w.r.t. the layer-2 +context. The ``accuser`` mode is similar to the ``observer`` mode, +with the caveat that if a erroneous commitment is posted on the +layer-1, it will compute and publish a rejection operation. For the +security of a transaction rollup to be enforced, it is therefore +necessary that at least one honest accuser node is operating at all +time. The ``batcher`` mode will enable a RPC that third-parties can +use to submit layer-2 operations; the rollup node will then batch them +together and post them on the layer-1 chain. The ``operator`` mode +will enable all the features of the rollup node, including the +injection of the maintenance operations of a transaction rollup +(publishing, finalizing, removing commitments, dispatching tickets). +Finally, the ``custom`` mode will allow advanced users to decide which +set of features to enable. + +Each mode will then send a specific set of layer-1 operations. These +operations have to be signed by the public key of an implicit account +that owns enough XTZ to pay for the inclusion fees. + +These operations notably includes: + + - Submitting batches of layer-2 operations (enabled by providing the + ``--batch-signer`` command-line argument) + - Submitting commitments (enabled by providing the ``--operator`` + command-line argument) + - Finalizing (``--finalize-commitment-signer``) and removing + (``--remove-commitment-signer``) commitments + - Dispatching tickets whose withdrawals are authorized by a + finalized commitments (``--dispatch-withdrawals-signer``) + - Posting rejections (``--rejection-signer``) + +These various command-line arguments accept the Tezos implicit account +aliases registered in the ``~/.tezos-client`` directory. + +Note that the same keys can be used to sign several kind of layer-1 +operations. + +.. note:: + + For the rollup node to work better, it is a good practice to + (1) to **reveal the keys associated to these aliases before + starting the rollup node**, and (2) to use a dedicated key for + batching and submitting layer-2 operations (``--batcher-signer``). + +For instance, + +.. code:: sh + + octez-tx-rollup-node-alpha init batcher config for ${rollup} \ + --data-dir /tmp/tx-node \ + --rpc-addr ${rollup_node_rpc_server_address} \ + --batch-signer ${batcher} + +will create a configuration file in ``/tmp/tx-node``, for the +transaction rollup identified by the variable ``${rollup}``. + +The rollup node will expose a RPC server at the address +provided with the ``rpc-addr`` argument. If omitted, the default value +used by the rollup node is ``localhost:9999``. + +Once the configuration is ready, starting the rollup node is as simple as + +.. code:: sh + + octez-tx-rollup-node-alpha --endpoint ${tezos_node_address} \ + run ${mode} for ${rollup_address_or_name} \ + --data-dir ${data_dir} \ + [--allow-deposit] + +The ``--allow-deposit`` argument is required in case you want to make +the rollup node post commitment to the layer-1. This is an additional +layer of security (in addition to having to providing a signer key for +the commitment operation thanks to the ``--operator`` argument), in +order to reduce as much as possible the risk for users to have 10,000ꜩ +frozen for a long period by accident. + +The rollup node works by tracking the head of the layer-1 chain, using +a Tezos node whose addressed is provided with the ``--endpoint`` +argument. It is not possible to run a rollup node without a Tezos node +available. + +.. warning:: + + The rollup node has been developed with the assumption that it is + executed on the same machine as the Tezos node it tracks. It may + not work properly in another set-up (*e.g.*, when ``--endpoint`` is + the address of a remote, public Tezos node). + +Depositing Assets on a Rollup +***************************** + +As discussed in this document, transaction rollups allow their users +to exchange assets encoded as Michelson tickets. + +An example of a smart contract that deposit tickets to a transaction +rollup can be found in the integration tests of the feature.:: + + parameter (pair string nat tx_rollup_l2_address address); + storage unit; + code { + CAR; + UNPAIR 4; + TICKET; + ASSERT_SOME; + PAIR; + SWAP; + CONTRACT %deposit (pair (ticket string) tx_rollup_l2_address); + ASSERT_SOME; + SWAP; + PUSH mutez 0; + SWAP; + TRANSFER_TOKENS; + UNIT; + NIL operation; + DIG 2; + CONS; + PAIR; + } + +The ``%default`` entrypoint of this contract takes four arguments: (1) +the contents and (2) the quantity of a ``ticket string`` to mint, (3) +the beneficiary of the minted ticket in the layer-2, that is a ``tz4`` +address, and (4) the transaction rollup address that is the target of +the deposit. + +.. code:: sh + + octez-client originate contract ${contract_alias} \ + transferring 0 \ + from ${alias} \ + running ${path_to_contract} \ + --burn-cap 0.401 --force + +Once the contract is originated, it becomes possible to deposit +arbitrary tickets to the layer-2. + +Note that the ``octez-client`` comes with facilities to generate and +manipulate BLS keys (that are used to authenticate users on the +layer-2, and to generate layer-2 addresses). + +.. code:: sh + + # generate a pair of public and secret keys + octez-client bls gen keys ${alias} + # display the keys (including the ``tz4`` hash) + octez-client bls show address ${alias} + +So, to mint and deposit a ``ticket string`` whose contents is +``foobar``, one can make the following contract call. + +.. code:: sh + + octez-client transfer 0 from user to deposit_contract \ + --arg '(Pair "foobar" ${qty} "${tz4_address}" "${tx_rollup_address}")' \ + --burn-cap 0.068 + +Of course, more realistic use cases will require a more +business-oriented logic for their deposit contracts. For instance, +they will require the caller to provide XTZ tokens in exchange to mint +tickets. + +To deposit a ticket to a transaction rollup, a smart contract emits an +internal transaction. The ticket is assigned a hash, that the user can +retrieve in the operation metadata. This hash is used in the layer-2 +operations to identify the tickets. + +For instance, here is the metadata of the internal operation +responsible for the deposit of our ``foobar`` ticket.:: + + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: KT1D9WLMFRndmrYthHruFudcXKvQkFhmW2KM + To: txr1aDUUQK7mT31PQbTPFKXFMZgsd7qNq3YkV + Entrypoint: deposit + Parameter: { Pair (Pair 0x01321183f2d68b3ce59d2b89e40609079d132969ed00 (Pair "foobar" 100)) + 0xf4bdd875da3fc06d56f9b1f5ad9d603d82683834 ; + string } + This transaction was successfully applied + Consumed gas: 2525.576 + Ticket hash: expruTnG5XeYjtLaCBwcEku1Xj4Po8caDWcQdTDhaaXMo3FHRfzCb7 + Consumed gas: 2525.576 + +The line of interest is the penultimate line, starting with ``Ticket +hash:``. + +Exchanging Assets inside a Rollup +********************************* + +In addition to an experimental transaction rollup node, we also +provide an experimental client to interact with said node. + +In particular, the preferred way to post layer-2 operations to the +layer-1 chain is to use a node configured to batch and submit layer-2 +operations. + +We list the main commands that are of interest when it comes to +demonstsrate how rollup works. + +To inspect the balance of a layer-2 address for a given ticket hash, +the ``get balance`` command can be used. + +.. code:: sh + + octez-tx-rollup-client-alpha get balance for alice of ${ticket_hash} + +.. note:: + + There is no command to gather the list of ticket hashes a given layer-2 address owns. + +To transfer a ticket to another address on the layer-2, the +``transfer`` command can be used. + +.. code:: sh + + octez-tx-rollup-client-alpha transfer ${qty} \ + of ${ticket_hash} \ + from ${src} to ${dst} \ + [--endpoint ${tx_rollup_node_address}] + +The ``--endpoint`` argument can be omitted if the rollup node is using +the default RPC server address, that is ``localhost:9999``. + +Here, the source has to be an alias identifying a BLS pair of keys +generated with ``octez-client bls gen key``, while the destination can +either be an alias, or a ``tz4`` address directly. + +Similarly to Tezos, a transaction rollup also has a notion of L2 +blocks “levels” starting from 0. To get the content of a rollup L2 +block, one can use the following command. + +.. code:: sh + + octez-tx-rollup-client-alpha get block ${block_id} + +where ``block_id`` can either be ``head`` (the latest rollup block), a +level (0, 1, etc.), or a Tezos block hash. + +Finally, it is also possible to “withdraw” a ticket from a transaction +rollup, and to inject it back in the layer-1. + +.. code:: sh + + octez-tx-rollup-client-alpha withdraw ${qty} of ${ticket_hash} from ${l2_src} to ${l1_dst} + +Similarly to the ``transfer`` command, ``l2_src`` has to be an alias +to a BLS pair of keys, while ``l1_dst`` can either be an alias or an +implicit account address directly. + +If a rollup node is run using the mode ``operator``, then once the +commitment related to a withdraw order is finalized, the rollup node +will “dispatch” the ticket to the ``l1_dst`` address. Once this is +done, the owner of ``l1_dst`` can use a dedicated ``octez-client`` +command to transfer their tickets to a smart contract. + +To do so, it is necessary to provide the layer-1 with the actual +contents of the ticket, not just the ticket hash. + +.. code:: sh + + octez-client transfer ${qty} tickets \ + from ${src} to ${sc_dst} \ + with entrypoint ${ep} \ + and contents ${micheline_contents} \ + and type ${ty} and ticketer ${ticketer} + +For instance, to transfer the ownership of our ``foobar`` ticket, +``micheline_contents='"foobar"'`` (the quotes are necessary for it to +be interpreted as a micheline string), and ``ty=string``. + +To retrieve the values of ``micheline_contents``, ``ty`` and +``ticketer``, the following command can be used. + +.. code:: sh + + octez-tx-rollup-client-alpha rpc get "/context/head/tickets/${ticket_hash}" + +Besides, the entrypoint ``ep`` of ``sc_dst`` needs to expect a +``ticket ty`` as its input. diff --git a/docs/mumbai/validation.rst b/docs/mumbai/validation.rst new file mode 100644 index 000000000000..e36525ae4fe9 --- /dev/null +++ b/docs/mumbai/validation.rst @@ -0,0 +1,401 @@ +========================== +Validation and Application +========================== + +.. FIXME tezos/tezos#3921: + + Adapt to pipelined validation up to Lima and v7 environment + +The :doc:`economic protocol` is responsible for providing +the rules that govern the Tezos network, and for enforcing that these +rules implement a correct blockchain protocol. However, it does so +:ref:`in coordination with a Tezos shell`, who +ultimately implements these rules on its behalf. To this end, a Tezos +economic protocol must provide the shell with an interface enabling +roughly the following functionalities: + +- deciding whether an operation is *valid*, and thus can be safely + included into a new block in the blockchain; + +- deciding whether a new block is *valid*, and thus can be safely + appended to the blockchain; + +- including an operation in a block, and executing it on the + blockchain state, effectively modifying the ledger state; and, + +- appending a new block to a Tezos blockchain, and computing the + updated ledger state. + +From a higher-level, *abstract* perspective, the validation system in +the Tezos protocol implements this business logic in a functional, +state-passing machine where: + +- Its state is given by the :ref:`context`, the internal + representation of the state of the Tezos ledger at a given blockchain + level. For instance, the context contains the information of all + activated accounts and contracts, and their balances. More + generally, the context must provide enough information to determine + the validity of operations, and blocks. + +- The *apply_operation* method determines whether an operation is safe + to be executed in a given context. If so, it proceeds to execute it + and outputs the context resulting from the applied operation's + effects. + +- The *apply* method takes as input a block and a context, determines + whether the block can be safely and correctly appended to the + current head of the chain. If so, it appends the block to the chain + and outputs the resulting context, reflecting the state of the + ledger after the block has successfully been applied. *apply* relies + on (i.e., it should call) *apply_operation* to validate and apply + each operation in the block, and compute intermediate states. + +.. TODO #4155: + + When creating a new environment, update references to V in the + paragraph below. + +However, the *concrete* API exported from the Tezos economic protocol +does not implement this business logic *monolithically*, as described +above, but it rather presents a more fine-grained API. The rationale +is to provide specialized variations of the core *validation* and +*application* functionality, dubbed :ref:`Validation +modes`. For example, these modes enable the +protocol to distinguish operations "in the mempool", whose validation +is triggered by the :doc:`prevalidator<../shell/prevalidation>`, from +operations included in newly received blocks, whose validation is +triggered by the :ref:`block validator`, in order to +localize validation rules as needed. The resulting concrete API is +specified by the :package-api:`Protocol +` +module in the :doc:`protocol +environment<../shell/protocol_environment>` ``V8``, and it is +implemented by this protocol in the +:package-api:`Main` +module. + +The rest of this document is organized as follows: we first describe +the different validation modes implemented by this Tezos economic +protocol, and then we delve deeper into the particulars of validation +and application for blocks and the operations supported. + +.. _validation_modes_mumbai: + +Validation modes +================ + +The Tezos protocol provides different validation modes, intended to be +used by Tezos *shell* and *baker* software implementations when +needing to apply (or to assert the validity) of blocks and operations +under different, or specialized, circumstances -- for example, in +order to *bake* a block. For each of these validation modes, the API +specified by the protocol environment offers an entry point so that +protocol-agnostic components, the Octez shell for instance, are able +to use these different modes. + +.. _full_application_mumbai: + +Full Application +~~~~~~~~~~~~~~~~ + +The ``Full application`` mode is intended to be used to *fully* +validate and apply blocks. In particular, this mode is used to +validate and apply a **known** block, with a known operation trace. A +Tezos shell implementation should use the full application mode to +decide whether an incoming block can be safely included in the +blockchain. That is, all validity checks are enabled: the block's +signature is correct, and **all** operations included in the block are +valid; the correct amount of consensus operations have been included +in order to satisfy the consensus' threshold, etc. + +.. _full_construction_mumbai: + +Full Construction +~~~~~~~~~~~~~~~~~ + +The ``Full construction`` mode is intended to be used when a +*delegate* is trying to bake a block and therefore needs to filter the +validity of the desired operation trace, to include only valid +operations. This mode is mostly similar to the ``Full application`` +mode except that *some* global block validity checks are disabled, and +consensus operations are validated with slightly different +preconditions. For instance, since a delegate cannot sign a block +while it is being built, the signature check is disabled, and it will +be left to the baker to correctly sign the resulting block after its +construction is finalized. + +In Octez, this mode is mainly used by the baker daemon. + +.. _partial_construction_mumbai: + +Partial Construction +~~~~~~~~~~~~~~~~~~~~ + +The ``Partial construction`` mode, also known as ``Mempool mode`` is +used by the :doc:`prevalidator component<../shell/prevalidation>` of +an Octez node to validate incoming operations -- that is, those +not-yet included into blocks. This mode's business-logic is very close +to the ``Full construction`` mode, and the differences boil down to +the intended usage. The partial construction mode does not try to +fully bake a block, but rather to inform the Octez prevalidator on the +potential validity of operations (and whether they can safely included +into a block), so that the latter can **classify** incoming +operations, and further decide how to process them accordingly. + +.. _protocol_classification_mumbai: + +The protocol provides the shell with the following classification of +an operation, consisting of one valid kind -- ``Applied`` --, and +:ref:`four error kinds ` defined by the +protocol environment: + +- ``Applied``: the operation is valid and can be included in a + potential block in the current context. + +- ``Temporary``: the operation is invalid in the current context, but + it could *later* become valid -- in the context associated to a + successor block of the current head. For instance, a manager + operation whose counter value is greater than the one expected (a + *"counter-in-the-future"* error), or the manager's balance is + insufficient to pay the operation's fees, etc. + +- ``Branch``: the operation is invalid in the current context and in + any possible context from its future successors, but it might still + be valid in an alternative branch. For example: a manager operation + with a smaller counter than the one expected (a + *"counter-in-the-past"* error), an unexpected endorsement for the + current level, etc. + +- ``Permanent``: the operation is invalid in the current context, and + there isn't any plausible context where it might be or become + valid. For example, an operation carrying an invalid signature. + +- ``Outdated``: the operation is *too old* to be included in a + block. Furthermore, there might be still some value in the + information provided by an ``Outdated`` operation. An example is the + case of an endorsement which was received *too late*, but that could + still be used to form a consensus quorum. + +.. _partial_application_mumbai: + +Partial Application +~~~~~~~~~~~~~~~~~~~ + +The ``Partial application`` mode is used for :ref:`multi-pass +validation`. Its aim is to provide Tezos shell +implementations with a light-weight (read "fast") block application +mechanism, which can determine whether a block has a *chance* of being +valid or not, in a situation when the provided context is *not a +recent one*. That is, when the block candidate succeeds neither the +head of the chain, nor a close ancestor. + +This validation mode is typically used when the node receives a +significantly large branch -- for instance, while bootstrapping. To +check whether this branch is plausibly valid or potentially malicious +spam, the shell retrieves the context from the most recent common +ancestor between its current head and the announced branch, and +proceeds to "partially apply" each block of this branch using the +common ancestor's context. + +Indeed, by relying on the ancestor context, this mode can *only* +assert the validity of consensus-related preconditions (endorsing +power, block fitness, etc.), as future consensus slots are known in +advance -- how much in advance being specified by the +```` protocol constant. Thus, the `Partial +application` mode provides an over-approximation of the branch's +validity, and as a result intermediate results are not committed on +disk in order to prevent potential attacks. + +.. _block_validation_overview_mumbai: + +Block Validation +================ + +.. FIXME tezos/tezos#3921: + + Adapt to pipelined block validation up to Lima and v7 environment. + +The validity of a blocks depends on a set of precondition checks +implemented in different steps, which happen at different stages of +the application (and the construction) of a block. + +The first step in the process is to decide whether a candidate block +is *well-formed*, that is, that it has the expected "shape" of a valid +block under the current Tezos economic protocol. Given a block +candidate, the block validation process will then verify that the +candidate block declares consistent :ref:`level`, +:ref:`round`, and timestamp values; that it carries a valid +signature, etc. At this step, the block validation process will also +initialize the data-structures required for subsequent steps. + +The second step iterates over the block's operations and proceeds to +apply them sequentially. When at least one operation is found to be +invalid, under the conditions described in +:ref:`operation_validity_mumbai` further below, the whole block is +considered as invalid. + +The last step in the block validation process, known as "block +finalization", aims to verify that the collected consensus operations +constitute a sufficiently large :ref:`quorum`. That is, +it will verify that the total endorsing power present in the block is +greater than the ``CONSENSUS_THRESHOLD`` constant. + +This sequence of three steps also yields a new context -- the +resulting state of the Tezos ledger after the application of the +candidate block. The shell may decide to commit this context to disk. + +The Tezos economic protocol also offers a cheap (read "faster") +alternative to determine an over-approximation of the validity of a +block (see :ref:`partial_application_mumbai` above). This feature +allows the shell to propagate blocks faster without needing to fully +validate them, speeding-up block propagation over the network. Of +course, as this is an over-approximation, this feature cannot be +considered to provide a safe guarantee that a block will be valid: in +particular, it does not validate all kinds of operations. + +.. _operation_validity_mumbai: + +Operation Validation and Application +==================================== + +In the Tezos economic protocol, we dissociate the notion of *validity* +from the notion of *applicability* for operations. A valid operation +is an operation that can be included safely in a block without +affecting the block's validity. Applying an operation, on the other +hand, actually performs the operation's side-effects which can be: +registering a new delegate, executing a smart contract, voting for a +new protocol amendment proposal, etc. + +Note that an operation may fail during the application phase, even +though it has been checked as valid. For example, a smart contract +call that exceeds its gas limit can be included in a block even if an +error is raised at run-time. The application (that is, the operation's +side-effects) will not take effect, but fees will nonetheless be taken +from the account submitting the smart contract call. + +In the sequel we refine the validity conditions and describe the +application process for each of the different validation passes. + +.. FIXME tezos/tezos#3921: + + Expand validity and application for other validation classes. + +.. _manager_operations_validity_mumbai: + +Validity of Manager Operations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In this sub-section, we explain the conditions for manager operations +(and batches of managers operations) to be considered valid and hence +suitable for inclusion in a block. + +Validity of Individual Manager Operations +......................................... + +:ref:`Manager operation` are a class of +operations, issued by a single *manager* account which signs the +operation and pays their fees. The different manager operation kinds +share several common fields: + +- ``source``: the public key's hash of the *source* account of the + manager operation -- that is, the *manager*. +- ``fee``: the amount of tez paid to the baker which decides to + include this operation; +- ``counter``: the manager account's counter, incremented each time + this account executes a manager operation, to prevent + replay-attacks. +- ``gas_limit``: the maximum amount of gas that this operation may + consume before failing. +- ``storage_limit``: the maximum amount of storage that this operation + may require before failing. +- ``operation``: the actual operation(s) -- e.g., transfers, + smart-contract calls, originations, delegations, etc. +- ``signature``: the manager's signature used to prove its identity. + +A manager operation is **valid** if and only if all of the following +conditions hold: + +- The operation source's public key has been previously *revealed*, + unless the operation is itself a ``Reveal`` operation. +- The operation's signature is correct with regard to the manager + account's public key. +- The provided ``counter`` value is the expected one for the manager. +- Depending on the operation's kind, the ``gas_limit`` is high enough + to cover the minimal cost of parsing the operation and further + minimal treatment. +- The manager account is solvent to pay the announced fees. + +Validity of Manager Operation Batches +..................................... + +A :ref:`batch` of manager operations +includes one or more manager operations for sequential and atomic +execution. The atomicity property imposes that the validity of a batch +should entail the validity of each individual operation in the batch, +as defined above. However, it also entails some additional *global* +constraints on manager batches. + +For each of the operations present in a batch, the validation process +must check that the individual constraints above are satisfied, *with +the exception of* the signature constraint. Given that the signature +concerns the whole batch, as all operations in the batch are signed by +the same manager, it suffices to verify the signature only once. + +The **global batch validity** constraint for this economic protocol is +defined as the conjunction of the following conditions: + +- When a ``Reveal`` operation is present, **it must only occur once**, + and **it must be placed at the head** of the batch -- that is, the + ``Reveal`` operation must be the first operation in the batch. +- Every operation in the batch should declare the same `source`. +- Each of the individual operation counters must be incremented + correctly and sequentially. +- The sum of each individual operation's declared fees must be lower + than the account's balance. That is, the manager account must be + solvent to pay the announced fees for all the operations in the + batch. + +.. _manager_operations_application_mumbai: + +Application of Manager Operations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Once the validity of a manager operation (or, a batch of manager +operations) is established, the protocol proceeds to apply the +operation. This first step in this application phase is to transfer +the operation's fees to the baker that included this operation. Then, +the actual application depends on the operation kind. For instance, +this could be a smart contract execution, enacting a delegation, or +multiple actions executed as a batch. The application of a batch of +manager operations consists of the sequential application of each +operation in the batch, following their inclusion order -- the head of +the batch being the first manager operation being applied. + +The application of each individual manager operation may either +succeed -- and therefore be reported as ``Applied`` --, or indeed fail +with an error. In both cases, the fees are taken and the counter for +the operation's manager is incremented. + +When a manager operation fails, every side-effect which was previously +performed is backtracked. Moreover, the (rest of the) batch has to be +aborted. Thus, depending on the position of the manager operation in +a batch, its failure has to be propagated accordingly: + +- If there were other successfully applied operations in the batch + prior to the offending one, the effect of each of them has to be + reverted, and each of them will be reported as ``Backtracked``. + +- If there were other operations pending application after the + offending one, their application is aborted, and they are reported + as ``Skipped``. + +For example, let's consider a simple batch of three manager operations +``[op1, op2, op3]``, if ``op1`` is successful but ``op2`` fails, the +ticket result for the application of the manager operation batch will +report: + +* ``op1`` -- ``Backtracked``, ```op1`` was applied successfully, but + after ``op2`` failed, the operation was canceled; +* ``op2`` -- ``Failed``, the application of this particular operation failed; +* ``op3`` -- ``Skipped``, this operation was never executed because + ``op2`` had previously failed. diff --git a/docs/mumbai/voting.rst b/docs/mumbai/voting.rst new file mode 100644 index 000000000000..22fdd626929d --- /dev/null +++ b/docs/mumbai/voting.rst @@ -0,0 +1,343 @@ +The Amendment (and Voting) Process +================================== + +In the Tezos blockchain, the *economic protocol* can be amended. Specifically, +there is an on-chain mechanism to propose changes to the economic protocol, to +vote for-or-against these proposed changes, and, depending on the result of the +vote, to activate these changes or not. + +Note that the proposal, voting and activation processes are part of the economic +protocol itself. Consequently the amendment rules themselves are subject to +amendments. + +The rest of this page gives more details about the amendment and voting process. + +Periods +------- + +The amendment process consists of five *periods*. Each period lasts for 5 cycles +(or approximately two weeks). The periods (listed below) +typically succeed one to another for a total duration of approximately 2 months and +a half, after which the whole amendment process starts again. + +The five periods are as follows: + +- *Proposal period*: During this period, delegates can + + - submit *protocol amendment proposals* (or, simply, *proposals*) using the + ``Proposals`` operation (see below); + - upvote one or several proposals, using the same ``Proposals`` operation. + + Each delegate can submit a maximum of 20 proposals. Duplicates count towards + this total. + + At the end of a **proposal period**, if participation reaches a + :ref:`proposal quorum `, the proposal with most support is + selected and we move to an **exploration period**. Note that support is + measured in the cumulated staking power (expressed in mutez) that delegates supporting the + proposal have. E.g., a proposal supported by a single delegate with 600,000 tz of staking power + has more support than a proposal supported by two delegates with 100,000 tz + each of staking power. + + If there are no proposals, or a tie between two or more proposals, + or if participation did not reach the proposal quorum, the process + moves back to a new **proposal period**. + +- *Exploration period*: During this period delegates can cast one + Yay, Nay, or Pass ballot on the selected proposal. They do so using the + ``Ballot`` operation. + + If the voting participation reaches *quorum* and there is a *super-majority* + of Yay, the process moves to the **cooldown period**. (See below for details + on participation, quorum, and super-majority.) + + Otherwise the process moves back to the **proposal period**. + +- *Cooldown period*: On-chain nothing specific happens during this period. + Off-chain the delegates can read the proposal with more scrutiny, the + community can discuss finer points of the proposal, the developers can + perform additional tests, etc. + + At the end of this period, the process moves to the **promotion period**. + +- *Promotion period*: During this period, delegates can cast a Yay, Nay, or Pass + ballots using the ``Ballot`` operation. + + If the voting participation reaches *quorum* and there is a super-majority of + Yay, the process moves to the **adoption period**. + + Otherwise the process moves back to the **proposal period**. + +- *Adoption period*: On-chain nothing specific happens during this period except + on the very last block (see below). + + Off-chain the developers release tools that include support for the + soon-to-be activated protocol, other actors (bakers, indexers, etc.) update + their infrastructure to support the newly released tools, smart-contract + developers start working with soon-to-be-available features, etc. + + At the very end of the period, the proposal is *activated*. This means that + the last block of the period is still interpreted by the current economic + protocol, but the first block after the period is interpreted by the new + economic protocol (the one that was voted in). + + And a new **proposal period** starts. + + +Activation +---------- + +After the activation step, the blocks added to the chain are interpreted in the +newly activated protocol. As a result gas costs may differ, new operations may +be available, contracts using new opcodes may be injected, etc. + +Because the amendment process is also part of the economic protocol, the +amendment process now unfolds according to the rules of the newly activated +protocol. As a result the periods may be lengthened or shortened, a new period +might be introduced, a different selection mechanism may be used, the quorum +requirement might differ, etc. + + +Voting Power +------------ + +When supporting a proposal or casting a Yay, Nay, or Pass ballot, each delegate +has voting power equal to its *stake*. The stake is always measured in +**mutez**. + +Note that the stake of each delegate is computed at the beginning of each +period. + + +Super-majority and Quorum +------------------------- + +As mentioned above, during either of the **exploration** or **promotion** periods, +delegates can cast ballots using the ``Ballot`` operation (see below). +In both cases, delegates can cast a single Yay, Nay, or Pass ballot. A ballot +has a weight equal to the delegate's stake as detailed above. + +For either of these two periods, the process continues to the next period if the +*vote participation* reaches *quorum* and there is a *super-majority* of +Yay. + +The *vote participation* is the ratio of all the cumulated stake of cast ballots +(including Pass ballots) to the total stake. + +For the first vote, the *quorum* started at 80% of stake. The quorum is +adjusted after each vote as detailed below. This adjustment is necessary to +ensure that the amendment process can continue even if some delegates stop +participating. After each vote the new quorum is updated based on the exponential moving average of the **vote participation**:: + + new_participation_ema = 0.8 * old_participation_ema + 0.2 * participation + +with the following formula:: + + new_quorum = 0.2 + (0.7 - 0.2) * old_participation_ema + +This formula avoids establishing quorums close to 100% that would be +very difficult to attain, or, conversely, low quorums close to 0% making +little participation chronic, ensuring that the quorums are lower- and upper-bounded by :ref:`quorum_caps` (0.2 and 0.7, respectively). + +The *super-majority* is reached if the cumulated stake of Yay ballots is +greater than 8/10 of the cumulated stake of Yay and Nay ballots. + +Note that Pass ballots do not count towards or against the super-majority; +they still counts towards participation and quorum. + +More details can be found in the file +:src:`src/proto_016_PtMumbai/lib_protocol/amendment.ml`. + + +The Hash and the Protocol +------------------------- + +On the one hand, the voting part of the process revolves around the +**hash of a protocol**. Specifically, a delegate submits a hash of a +protocol, and all the delegates cast ballots on the proposed hash. +The *hash of a protocol* is the hash of the files that constitute the source +code of the protocol. + +On the other hand, the **protocol activation** (at the end of the +**adoption period**) revolves around the compiled sources of the protocol. + +Basically, the voting process works on an identifier of the protocol whilst the +activation step works on the protocol itself. Consequently, if a protocol hash +is voted in and the protocol it identifies is invalid, the activation step +fails. + +.. sidebar:: Checking a hash is of a valid protocol + + When a hash is proposed by a delegate, it is usually accompanied by some + blogposts and forum threads on :ref:`community websites `. + These should include directions for testing the proposed protocols. If you + cannot find such directions, do not hesitate to ask. + +.. sidebar:: Localised failures + + It is possible that the activation step fails on a single node or a few nodes + of the network, but succeed on the others. In this case the nodes with the + failure are stuck, but the network as a whole continues. + + The most likely cause for this is nodes that have not been updated and do not + include a new protocol environment version. + + If your node becomes stuck, you should start a fresh up-to-date node. + +A protocol is *invalid* if its code cannot be compiled (e.g., if the code is not +valid source code), if its code uses functions not present in the +:doc:`protocol environment <../shell/protocol_environment>`, or if it +downgrades the protocol environment version. + +If an invalid protocol is voted in, then the activation fails for all the nodes, +and then the chain becomes stuck. This is why it is important to vote for hashes +that designate valid protocols: ones with sources that are available and that +can be compiled. + +Operations +---------- + +There are two operations used by the delegates: **proposals** and **ballot**. + +A *proposals* operation can only be injected during a proposal period. + +:: + + Proposals : { + source: Signature.Public_key_hash.t ; + period: Voting_period_repr.t ; + proposals: Protocol_hash.t list ; } + +The ``source`` is the public key hash of the delegate, ``period`` is the unique +identifier of each voting period and ``proposals`` is a non-empty list of +maximum 20 protocol hashes. +The operation can be submitted more than once but only as long as the +cumulative length of the proposals lists is less than 20. +Duplicate proposals from the same delegate are accounted for in the +maximum number of proposals for that delegate. +However duplicates from the same delegate are not tallied at the end +of the proposal period. + +For example, a delegate submits a *proposals* operation for protocols A +and B early in the proposal period, later a new protocol C is revealed +and the delegate submits another *proposals* operation for protocols B +and C. +The list of submissions that will be tallied is [A,B,C]. + +A *ballot* operation can only be submitted during periods where a vote happens +(e.g. exploration, promotion), and only once per period. + +:: + + Ballot : { + source: Signature.Public_key_hash.t ; + period: Voting_period_repr.t ; + proposal: Protocol_hash.t ; + ballot: Vote_repr.ballot ; } + +The fields ``source`` and ``period`` are the same as above, while ``proposal`` +is the currently selected proposal and ``ballot`` is one of ``Yay``, ``Nay`` or +``Pass``. +The ``Pass`` vote allows a delegate to contribute towards the quorum without +contributing towards the super-majority. This is important because, as detailed +above, the quorum is adaptive and that low participation would lower the +quorum of the next vote. + +More details on the operations can be found in +:src:`src/proto_016_PtMumbai/lib_protocol/operation_repr.ml`. +The binary format is described by +``octez-client describe unsigned operation``. + +Client Commands +--------------- + +The Octez client, ``octez-client``, provides commands for basic exploration and +interaction with the amendment and voting process. + + +Show +~~~~ + +Tezos' client provides a command to show the status of a voting period. +It displays different information for different kind of periods, as +in the following samples:: + + $ octez-client show voting period + Current period: "proposal" + Blocks remaining until end of period: 59 + Current proposals: + PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp 2,400,000 ꜩ + + $ octez-client show voting period + Current period: "exploration" + Blocks remaining until end of period: 63 + Current proposal: PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp + Ballots: + Yay: 2,400,000 ꜩ + Nay: 0 ꜩ + Pass: 0 ꜩ + Current participation 20.00%, necessary quorum 80.00% + Current in favor 2,400,000 ꜩ, needed supermajority 1,920,000 ꜩ + + $ octez-client show voting period + Current period: "cooldown" + Blocks remaining until end of period: 64 + Current proposal: PsNa6jTtsRfbGaNSoYXNTNM5A7c3Lji22Yf2ZhpFUjQFC17iZVp + +It should be noted that the ballot number 2,400,000 ꜩ above is the stake counted in +mutez (displayed in tez). +The proposal has a total stake of 2,400,000 ꜩ, which may come from a single ballot +from a delegate having a staking balance of 2,400,000 ꜩ or it may come from multiple ballots from +delegates with a combined stake of 2,400,000 ꜩ. + + +Submit proposals +~~~~~~~~~~~~~~~~ + +During a proposal period, a list of proposals can be submitted with:: + + octez-client submit proposals for ... + +Remember that each delegate can submit a maximum of 20 protocol +hashes and that duplicates count towards this total. +Moreover each proposal is accepted only if it meets one of the +following two conditions: + +- the protocol hash was already proposed on the network. In this case + we can submit an additional proposal that "upvotes" an existing one + and our staking power are added to the ones already supporting the proposal. +- the protocol is known by the node. In particular the first proposer + of a protocol should be able to successfully inject the protocol in + its node which performs some checks, compiles and loads the + protocol. + +These are protection measures that the Octez client takes to prevent the +accidental injection of invalid protocols. As mentioned above, it is still +important to check the validity of the protocols that you vote for as they may +have been injected via different means. + + +Submit ballots +~~~~~~~~~~~~~~ + +During either of the **exploration** or **promotion** periods, +ballots can be submitted once with:: + + octez-client submit ballot for + +Further External Resources +-------------------------- + +Further details and explanations on the voting procedure can be found at: + +- `Governance on-chain `_ on Open Tezos +- `Tezos Governance `_ on Tezos Agora. + +For more details on the client commands refer to the manual at +:ref:`client_manual_mumbai`. + +For vote related RPCs check the :doc:`rpc` under the prefix +``votes/``. + +For Ledger support refer to Obsidian Systems' `documentation +`__. diff --git a/docs/protocols/016_mumbai.rst b/docs/protocols/016_mumbai.rst new file mode 100644 index 000000000000..03d19535a3dc --- /dev/null +++ b/docs/protocols/016_mumbai.rst @@ -0,0 +1,202 @@ +Protocol Alpha +============== + +This page documents the changes brought by protocol Alpha with respect +to Lima (see :ref:`naming_convention`). + +The code can be found in directory :src:`src/proto_016_PtMumbai` of the ``master`` +branch of Tezos. + +.. contents:: + +New Environment Version (V8) +---------------------------- + +This protocol requires a different protocol environment version than Lima. +It requires protocol environment V8, compared to V7 for Lima. (MR :gl:`!6439`) + +- Update data-encoding to 0.7.1. (MR :gl:`!6854`) + +- Provide only modern bytes and string combinators in environment data encoding. + (MR :gl:`!6919`) + +- Update Plonk in Environment V7 and V8. (MR :gl:`!6925`) + +- Remove Plonk from Environment V6. (MR :gl:`!6952`) + +Michelson opcodes for logical operations on bytes +------------------------------------------------- + +Michelson opcodes ``AND``, ``OR``, ``XOR``, ``NOT``, ``LSL`` and ``LSR`` +now support ``bytes``. (MR :gl:`!6055`) + +- Michelson opcodes ``NAT``, ``INT`` and ``BYTES`` for bytes-int and bytes-nat + conversions. (MR :gl:`!6681`) + +Smart Contract Optimistic Rollups (ongoing) +------------------------------------------- + +Rollups supporting execution of smart contracts. (MRs :gl:`!6118`, :gl:`!6425`, +:gl:`!6252`, :gl:`!6396`, :gl:`!6364`, :gl:`!6413`, :gl:`!6545`, :gl:`!6543`, +:gl:`!6590`, :gl:`!6623`, :gl:`!6641`, :gl:`!6549`, :gl:`!6672`, :gl:`!6500`, +:gl:`!6718`, :gl:`!6699`, :gl:`!6630`, :gl:`!6794`, :gl:`!6823`, :gl:`!6828`, +:gl:`!6676`, :gl:`!6698`, :gl:`!6507`, :gl:`!6879`, :gl:`!6860`, :gl:`!6716`, +:gl:`!6468`, :gl:`!6857`, :gl:`!6652`, :gl:`!6913`, :gl:`!6838`, :gl:`!6914`, +:gl:`!6717`, :gl:`!6560`, :gl:`!6891`, :gl:`!6726`, :gl:`!6935`, :gl:`!6951`, +:gl:`!6946`, :gl:`!6954`, :gl:`!6942`, :gl:`!6963`, :gl:`!5741`, :gl:`!6974`, +:gl:`!7013`, :gl:`!7015`, :gl:`!6980`, :gl:`!6993`, :gl:`!6949`, :gl:`!6930`, +:gl:`!6991`, :gl:`!6955`, :gl:`!6937`, :gl:`!7010`, :gl:`!7027`, :gl:`!7034`, +:gl:`!7045`, :gl:`!7036`, :gl:`!6987`, :gl:`!7016`, :gl:`!6380`) + +Zero Knowledge Rollups (ongoing) +-------------------------------- + +Rollups supporting cryptographic proofs of correct execution. (MRs :gl:`!6047`, +:gl:`!6884`, :gl:`!6836`, :gl:`!6855`, :gl:`!6839`) + +Data Availability Layer (ongoing) +--------------------------------- + +Distribution of rollup operations data off-chain. (MRs :gl:`!6174`, :gl:`!6388`, +:gl:`!6527`, :gl:`!6505`, :gl:`!6553`, :gl:`!6685`, :gl:`!6470`, :gl:`!6643`, +:gl:`!6704`, :gl:`!6683`, :gl:`!6702`, :gl:`!6728`, :gl:`!5905`, :gl:`!6762`, +:gl:`!6703`, :gl:`!6796`, :gl:`!6821`, :gl:`!6852`, :gl:`!6811`, :gl:`!6887`) + +Breaking Changes +---------------- + +RPC Changes +----------- + +- Add RPC to get contract's balance of ticket with specified ticketer, content type, and content. Can be used for both implicit and originated contracts. + ``POST /chains//blocks//context/contracts//ticket_balance``. (MR :gl:`!6488`) + +- Add RPC to get the complete list of tickets owned by a given contract by scanning the contract's storage. Can only be used for originated contracts. + ``POST /chains//blocks//context/contracts//all_ticket_balances``. (MR :gl:`!6712`) + +Operation receipts +------------------ + +Cryptography +------------ + +- Support for BLS signatures and introduction of a new account type whose + address has the prefix ``tz4`` (whose keys are BLS-MinPk key pairs). The + ``CHECK_SIGNATURE`` instruction of Michelson can also check BLS + signatures. ``tz4`` accounts are forbidden to be delegates. (MR :gl:`!5444`) + +Bug Fixes +--------- + +15s Block Times (MR :gl:`!7017`) +-------------------------------- + +Blocks times have been reduced from 30 seconds to 15 seconds. +That is, a block can be produced with a delay of 15 seconds with respect to the previous block, if both blocks have round 0. +This change comes with updating many related protocol parameters in order to match the reduced block times. +In particular, the following quantities are kept the same: + +- the minimal time period of a cycle (namely, 2 days, 20 hours, and 16 minutes), +- the length of the nonce revelation period (namely, around 2 hours and 8 minutes) +- the number of nonce commitments per cycle (namely, 128), +- the number of stake snapshots per cycle (namely, 16), +- the maximum rewards per minute (namely 80 tez), and therefore roughly the same inflation, +- the minimal "time to live" of an operation (namely, 1 hour), +- the block gas limit per minute (namely 10400000 gas), +- the ratio between the liquidity baking subsidy and the maximum rewards per block (namely, 1/16). + +.. list-table:: Changes to protocol parameters + :widths: 50 25 25 + :header-rows: 1 + + * - Parameter (unit) + - Old (Lima) value + - New value + * - ``minimal_block_delay`` (seconds) + - ``30`` + - ``15`` + * - ``delay_increment_per_round`` (seconds) + - ``15`` + - ``8`` + * - ``blocks_per_cycle`` (blocks) + - ``8192`` + - ``16384`` + * - ``blocks_per_commitment`` (blocks) + - ``64`` + - ``128`` + * - ``nonce_revelation_threshold`` (blocks) + - ``256`` + - ``512`` + * - ``blocks_per_stake_snapshot`` (blocks) + - ``512`` + - ``1024`` + * - ``max_operations_time_to_live`` (blocks) + - ``120`` + - ``240`` + * - ``hard_gas_limit_per_block`` (gas unit) + - ``5200000`` + - ``2600000`` + * - ``baking_reward_fixed_portion`` (mutez) + - ``10000000`` + - ``5000000`` + * - ``baking_reward_bonus_per_slot`` (mutez) + - ``4286`` + - ``2143`` + * - ``endorsing_reward_per_slot`` (mutez) + - ``2857`` + - ``1428`` + * - ``liquidity_baking_subsidy`` (mutez) + - ``2500000`` + - ``1250000`` + + +Minor Changes +------------- + +- Give a positive gas cost to the ``BALANCE`` instruction. (MR :gl:`!6564`) + +- Enable transferring tickets to/from implicit accounts. (MRs :gl:`!6108`, + :gl:`!6490`, :gl:`!6867`) + +Internal +-------- + +- Update migration for Lima. (MR :gl:`!6504`) + +- Introduce local context access APIs to the indexed subcontext for optimized accesses with locality. (MR :gl:`!5922`) + +- Optimized cleaning of implicit contract with 0 balance using local context accesses (MR :gl:`!5922`) + +- Improve ex_ticket_size. (MR :gl:`!6209`) + +- Clean up validation code. (MR :gl:`!6526`) + +- Remove ``Script_typed_ir.comparable_option_t``. (MR :gl:`!6513`) + +- Restrict functions to originated contracts. (MR :gl:`!6198`) + +- Minor fixes for Consensus key. (MR :gl:`!6567`) + +- Enrich execution traces with "just consumed gas". (MR :gl:`!6565`) + +- Fix ignored values. (MRs :gl:`!6577`, :gl:`!6579`, :gl:`!6583`) + +- Separate ``Generated_cost`` module. (MR :gl:`!6253`) + +- Remove unused parameter in gas model for ``SPLIT_TICKET``. (MR :gl:`!6489`) + +- Remove function for computing baking rights without cache update. + (MR :gl:`!6605`) + +- Move the definition of ``boxed_list`` to ``Script_list``. (MR :gl:`!5954`) + +- Make ``counter`` an abstract type instead of an alias of ``Z.t``. + (MRs :gl:`!6647`, :gl:`!6648`) + +- Move interpreter logging to the plugin. (MR :gl:`!5778`) + +- Use let-bindings in ticket-accounting module. (MR :gl:`!6770`) + +- Use condensed syntax modules in protocol. (MRs :gl:`!6844`, :gl:`!6864`) + +- Do not fully parse head fitness in ``Mempool.init``. (MR :gl:`!7000`) diff --git a/src/lib_protocol_compiler/final_protocol_versions b/src/lib_protocol_compiler/final_protocol_versions index 56966060f1f1..9c2aa6e19c98 100644 --- a/src/lib_protocol_compiler/final_protocol_versions +++ b/src/lib_protocol_compiler/final_protocol_versions @@ -15,4 +15,5 @@ PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg -PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW \ No newline at end of file +PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW +PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD \ No newline at end of file diff --git a/src/proto_016_PtMumbai/bin_accuser/dune b/src/proto_016_PtMumbai/bin_accuser/dune new file mode 100644 index 000000000000..bfa85eafe9cf --- /dev/null +++ b/src/proto_016_PtMumbai/bin_accuser/dune @@ -0,0 +1,30 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_accuser_alpha) + (public_name octez-accuser-alpha) + (package octez-accuser-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-client-alpha + tezos-client-commands + tezos-baking-alpha-commands + tezos-stdlib-unix + tezos-client-base-unix) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha_commands + -open Tezos_stdlib_unix + -open Tezos_client_base_unix)) diff --git a/src/proto_016_PtMumbai/bin_accuser/main_accuser_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_accuser/main_accuser_016_PtMumbai.ml new file mode 100644 index 000000000000..ebbd70c5ebed --- /dev/null +++ b/src/proto_016_PtMumbai/bin_accuser/main_accuser_016_PtMumbai.ml @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* Copyright (c) 2019 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let () = + Client_commands.register Protocol.hash @@ fun _network -> + List.map (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + @@ Baking_commands.accuser_commands () + +let select_commands _ _ = + return + (List.map + (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + (Baking_commands.accuser_commands ())) + +let () = Client_main_run.run (module Daemon_config) ~select_commands diff --git a/src/proto_016_PtMumbai/bin_baker/dune b/src/proto_016_PtMumbai/bin_baker/dune new file mode 100644 index 000000000000..68fc1d13b200 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_baker/dune @@ -0,0 +1,30 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_baker_alpha) + (public_name octez-baker-alpha) + (package octez-baker-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-client-alpha + tezos-client-commands + tezos-baking-alpha-commands + tezos-stdlib-unix + tezos-client-base-unix) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha_commands + -open Tezos_stdlib_unix + -open Tezos_client_base_unix)) diff --git a/src/proto_016_PtMumbai/bin_baker/main_baker_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_baker/main_baker_016_PtMumbai.ml new file mode 100644 index 000000000000..cd13f466fd9b --- /dev/null +++ b/src/proto_016_PtMumbai/bin_baker/main_baker_016_PtMumbai.ml @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* Copyright (c) 2019 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let () = + Client_commands.register Protocol.hash @@ fun _network -> + List.map (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + @@ Baking_commands.baker_commands () + +let select_commands _ _ = + return + (List.map + (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + (Baking_commands.baker_commands ())) + +(* This call is not strictly necessary as the parameters are initialized + lazily the first time a Sapling operation (validation or forging) is + done. This is what the client does. + For a long running binary however it is important to make sure that the + parameters files are there at the start and avoid failing much later while + validating an operation. Plus paying this cost upfront means that the first + validation will not be more expensive. *) +let () = Tezos_sapling.Core.Validator.init_params () + +let () = Client_main_run.run (module Daemon_config) ~select_commands diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/RPC.ml b/src/proto_016_PtMumbai/bin_sc_rollup_client/RPC.ml new file mode 100644 index 000000000000..98ad7f965b46 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/RPC.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let get_sc_rollup_addresses_command cctxt = + Sc_rollup_services.Global.(make_call sc_rollup_address) cctxt () () () + +let get_state_value_command cctxt block key = + Sc_rollup_services.Global.Block.(make_call1 state_value) cctxt block {key} () + +let get_outbox_proof cctxt serialized_output = + Sc_rollup_services.Global.Helpers.(make_call outbox_proof) + cctxt + () + serialized_output + () diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.ml b/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.ml new file mode 100644 index 000000000000..cd492698bdde --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.ml @@ -0,0 +1,339 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +let possible_block_ids = ["head"; "finalized"; "cemented"; ""; ""] + +let block_arg = + Tezos_clic.default_arg + ~long:"block" + ~short:'B' + ~placeholder:"block" + ~default:"head" + ~doc: + (Format.sprintf + "The block identifier for which the command applies (possible values: \ + %s)." + (String.concat ", " possible_block_ids)) + (Tezos_clic.parameter + (fun _ s -> + match Sc_rollup_services.Arg.destruct_block_id s with + | Ok b -> return b + | Error reason -> failwith "Invalid block id: %s" reason) + ~autocomplete:(fun _ -> return possible_block_ids)) + +let get_sc_rollup_addresses_command () = + Tezos_clic.command + ~desc: + "Retrieve the smart-contract rollup address the node is interacting with." + Tezos_clic.no_options + (Tezos_clic.fixed ["get"; "sc"; "rollup"; "address"]) + (fun () (cctxt : #Configuration.sc_client_context) -> + RPC.get_sc_rollup_addresses_command cctxt >>=? fun addr -> + cctxt#message "@[%a@]" Sc_rollup.Address.pp addr >>= fun () -> return_unit) + +let get_state_value_command () = + Tezos_clic.command + ~desc:"Observe a key in the PVM state." + (Tezos_clic.args1 block_arg) + (Tezos_clic.prefixes ["get"; "state"; "value"; "for"] + @@ Tezos_clic.string ~name:"key" ~desc:"The key of the state value" + @@ Tezos_clic.stop) + (fun block key (cctxt : #Configuration.sc_client_context) -> + RPC.get_state_value_command cctxt block key >>=? fun bytes -> + cctxt#message "@[%S@]" (String.of_bytes bytes) >>= fun () -> return_unit) + +(** [display_answer cctxt answer] prints an RPC answer. *) +let display_answer (cctxt : #Configuration.sc_client_context) : + Tezos_rpc.Context.generic_call_result -> unit Lwt.t = function + | `Json (`Ok json) -> cctxt#answer "%a" Json_repr.(pp (module Ezjsonm)) json + | `Binary (`Ok binary) -> cctxt#answer "%a" Hex.pp (Hex.of_string binary) + | `Json (`Error (Some error)) -> + cctxt#error + "@[Command failed: @[%a@]@]@." + (Format.pp_print_list Error_monad.pp) + (Data_encoding.Json.destruct + (Data_encoding.list Error_monad.error_encoding) + error) + | `Binary (`Error (Some error)) -> ( + match Data_encoding.Binary.of_string Error_monad.trace_encoding error with + | Ok trace -> + cctxt#error + "@[Command failed: @[%a@]@]@." + Error_monad.pp_print_trace + trace + | Error msg -> + cctxt#error + "@[Error whilst decoding the server response: @[%a@]@]@." + Data_encoding.Binary.pp_read_error + msg) + | `Json (`Not_found _) | `Binary (`Not_found _) | `Other (_, `Not_found _) -> + cctxt#error "No service found at this URL\n%!" + | `Json (`Gone _) | `Binary (`Gone _) | `Other (_, `Gone _) -> + cctxt#error + "Requested data concerns a pruned block and target resource is no \ + longer available\n\ + %!" + | `Json (`Unauthorized _) + | `Binary (`Unauthorized _) + | `Other (_, `Unauthorized _) -> + cctxt#error "@[[HTTP 403] Access denied to: %a@]@." Uri.pp cctxt#base + | _ -> cctxt#error "Unexpected server answer\n%!" + +let parse_transactions transactions = + let json = Ezjsonm.from_string transactions in + let open Ezjsonm in + let open Sc_rollup.Outbox.Message in + let open Lwt_result_syntax in + let transaction json = + let destination = + find json ["destination"] |> get_string + |> Protocol.Contract_hash.of_b58check_exn + in + let entrypoint = + try + find json ["entrypoint"] |> get_string + |> Entrypoint.of_string_strict_exn + with Not_found -> Entrypoint.default + in + let*? parameters = + Tezos_micheline.Micheline_parser.no_parsing_error + @@ (find json ["parameters"] |> get_string + |> Michelson_v1_parser.parse_expression) + in + let unparsed_parameters = parameters.expanded in + return @@ {destination; entrypoint; unparsed_parameters} + in + match json with + | `A messages -> + let* transactions = List.map_es transaction messages in + return @@ Atomic_transaction_batch {transactions} + | `O _ -> + let* transaction = transaction json in + return @@ Atomic_transaction_batch {transactions = [transaction]} + | _ -> + failwith + "An outbox message must be either a single transaction or a list of \ + transactions." + +let get_output_proof () = + Tezos_clic.command + ~desc:"Ask the rollup node for an output proof." + Tezos_clic.no_options + (Tezos_clic.prefixes ["get"; "proof"; "for"; "message"] + @@ Tezos_clic.string + ~name:"index" + ~desc:"The index of the message in the outbox" + @@ Tezos_clic.prefixes ["of"; "outbox"; "at"; "level"] + @@ Tezos_clic.string + ~name:"level" + ~desc:"The level of the rollup outbox where the message is available" + @@ Tezos_clic.prefixes ["transferring"] + @@ Tezos_clic.string + ~name:"transactions" + ~desc:"A JSON description of the transactions" + @@ Tezos_clic.stop) + (fun () index level transactions (cctxt : #Configuration.sc_client_context) -> + let open Lwt_result_syntax in + let* message = parse_transactions transactions in + let output = + Protocol.Alpha_context.Sc_rollup. + { + message_index = Z.of_string index; + outbox_level = Raw_level.of_int32_exn (Int32.of_string level); + message; + } + in + RPC.get_outbox_proof cctxt output >>=? fun (commitment_hash, proof) -> + cctxt#message + {|@[{ "proof" : "0x%a", "commitment_hash" : "%a"@]}|} + Hex.pp + (Hex.of_string proof) + Protocol.Alpha_context.Sc_rollup.Commitment.Hash.pp + commitment_hash + >>= fun () -> return_unit) + +let get_output_message_encoding () = + Tezos_clic.command + ~desc:"Get output message encoding." + Tezos_clic.no_options + (Tezos_clic.prefixes ["encode"; "outbox"; "message"] + @@ Tezos_clic.string + ~name:"transactions" + ~desc:"A JSON description of the transactions" + @@ Tezos_clic.stop) + (fun () transactions (cctxt : #Configuration.sc_client_context) -> + let open Lwt_result_syntax in + let open Protocol.Alpha_context.Sc_rollup.Outbox.Message in + let* message = parse_transactions transactions in + let encoded_message = serialize message in + (match encoded_message with + | Ok encoded_message -> + let encoded_message = unsafe_to_string encoded_message in + cctxt#message "%a" Hex.pp (Hex.of_string encoded_message) + | Error _ -> cctxt#message "Error while encoding outbox message.") + >>= fun () -> return_unit) + +let call ?body meth raw_url (cctxt : #Configuration.sc_client_context) = + let open Lwt_result_syntax in + let uri = Uri.of_string raw_url in + let body = + (* This code is similar to a piece of code in [fill_in] + function. An RPC is declared as POST, PATCH or PUT, but the + body is not given. In that case, the body should be an empty + JSON object. *) + match (meth, body) with + | _, Some _ -> body + | `DELETE, None | `GET, None -> None + | `PATCH, None | `PUT, None | `POST, None -> Some (`O []) + in + let* answer = cctxt#generic_media_type_call ?body meth uri in + let*! () = display_answer cctxt answer in + return_unit + +let call_with_json meth raw_url json (cctxt : #Configuration.sc_client_context) + = + match Ezjsonm.value_from_string_result json with + | Error err -> + cctxt#error + "Failed to parse the provided json: %s\n%!" + (Ezjsonm.read_error_description err) + | Ok body -> call meth ~body raw_url cctxt + +let call_with_file_or_json meth url maybe_file + (cctxt : #Configuration.sc_client_context) = + let open Lwt_result_syntax in + let* json = + match TzString.split ':' ~limit:1 maybe_file with + | ["file"; filename] -> + Lwt.catch + (fun () -> + Lwt_result.ok @@ Lwt_io.(with_file ~mode:Input filename read)) + (fun exn -> failwith "cannot read file (%s)" (Printexc.to_string exn)) + | _ -> return maybe_file + in + call_with_json meth url json cctxt + +let rpc_commands () = + let open Tezos_clic in + let group = {name = "rpc"; title = "Commands for the low level RPC layer"} in + [ + command + ~group + ~desc:"Call an RPC with the GET method." + no_options + (prefixes ["rpc"; "get"] @@ string ~name:"url" ~desc:"the RPC URL" @@ stop) + (fun () -> call `GET); + command + ~group + ~desc:"Call an RPC with the POST method." + no_options + (prefixes ["rpc"; "post"] + @@ string ~name:"url" ~desc:"the RPC URL" + @@ stop) + (fun () -> call `POST); + command + ~group + ~desc: + "Call an RPC with the POST method, providing input data via the \ + command line." + no_options + (prefixes ["rpc"; "post"] + @@ string ~name:"url" ~desc:"the RPC URL" + @@ prefix "with" + @@ string + ~name:"input" + ~desc: + "the raw JSON input to the RPC\n\ + For instance, use `{}` to send the empty document.\n\ + Alternatively, use `file:path` to read the JSON data from a file." + @@ stop) + (fun () -> call_with_file_or_json `POST); + ] + +module Keys = struct + open Tezos_client_base.Client_keys + + let generate_keys () = + Tezos_clic.command + ~desc:"Generate a pair of keys." + (Tezos_clic.args1 (Secret_key.force_switch ())) + (Tezos_clic.prefixes ["gen"; "unencrypted"; "keys"] + @@ Aggregate_alias.Secret_key.fresh_alias_param @@ Tezos_clic.stop) + (fun force name (cctxt : #Configuration.sc_client_context) -> + Client_keys_commands.Bls_commands.generate_keys + ~force + ~encrypted:false + name + cctxt) + + let list_keys () = + Tezos_clic.command + ~desc:"List keys." + Tezos_clic.no_options + (Tezos_clic.prefixes ["list"; "keys"] @@ Tezos_clic.stop) + (fun () (cctxt : #Configuration.sc_client_context) -> + Client_keys_commands.Bls_commands.list_keys cctxt) + + let show_address () = + Tezos_clic.command + ~desc:"Show the keys associated with an account." + Tezos_clic.no_options + (Tezos_clic.prefixes ["show"; "address"] + @@ Aggregate_alias.Public_key_hash.alias_param @@ Tezos_clic.stop) + (fun () (name, _pkh) (cctxt : #Configuration.sc_client_context) -> + Client_keys_commands.Bls_commands.show_address + ~show_private:true + name + cctxt) + + let import_secret_key () = + Tezos_clic.command + ~desc:"Add a secret key to the wallet." + (Tezos_clic.args1 (Aggregate_alias.Secret_key.force_switch ())) + (Tezos_clic.prefixes ["import"; "secret"; "key"] + @@ Aggregate_alias.Secret_key.fresh_alias_param @@ aggregate_sk_uri_param + @@ Tezos_clic.stop) + (fun force name sk_uri (cctxt : #Configuration.sc_client_context) -> + Client_keys_commands.Bls_commands.import_secret_key + ~force + name + sk_uri + cctxt) +end + +let all () = + [ + get_sc_rollup_addresses_command (); + get_state_value_command (); + get_output_proof (); + get_output_message_encoding (); + Keys.generate_keys (); + Keys.list_keys (); + Keys.show_address (); + Keys.import_secret_key (); + ] + @ rpc_commands () diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.mli b/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.mli new file mode 100644 index 000000000000..6413f745b500 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/commands.mli @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [all ()] is the list of commands recognized by the smart-contract + rollup client. These commands may depend on the client + configuration. *) +val all : unit -> Configuration.sc_client_context Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.ml b/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.ml new file mode 100644 index 000000000000..84d92b06717a --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.ml @@ -0,0 +1,112 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Lwt_result_syntax +module Base = Tezos_client_base + +type t = {base_dir : string; endpoint : Uri.t} + +let default_base_dir = + Filename.concat (Sys.getenv "HOME") ".tezos-sc-rollup-client" + +let default_endpoint = "http://localhost:8932" + +let default = + {base_dir = default_base_dir; endpoint = Uri.of_string default_endpoint} + +let valid_endpoint _configuration s = + let endpoint = Uri.of_string s in + match (Uri.scheme endpoint, Uri.query endpoint, Uri.fragment endpoint) with + | Some ("http" | "https"), [], None -> return endpoint + | _ -> failwith "Endpoint should be of the form http[s]://address:port" + +let endpoint_arg () = + Tezos_clic.arg + ~long:"endpoint" + ~short:'E' + ~placeholder:"uri" + ~doc: + (Printf.sprintf + "endpoint of the sc rollup node; e.g. '%s'" + default_endpoint) + @@ Tezos_clic.parameter valid_endpoint + +let valid_base_dir _configuration base_dir = + if not (Sys.file_exists base_dir && Sys.is_directory base_dir) then + failwith "%s does not seem to be an existing directory" base_dir + else return base_dir + +let base_dir_arg () = + Tezos_clic.arg + ~long:"base-dir" + ~short:'d' + ~placeholder:"path" + ~doc: + (Format.asprintf + "@[@[<2>Tezos smart-contract rollup client data directory@,\ + The directory where the Tezos smart-contract rollup client stores \ + its data.@,\ + If absent, its value defaults to %s@]@]@." + default_base_dir) + (Tezos_clic.parameter valid_base_dir) + +let global_options () = Tezos_clic.args2 (base_dir_arg ()) (endpoint_arg ()) + +let make (base_dir, endpoint) = + { + base_dir = Option.value base_dir ~default:default_base_dir; + endpoint = Option.value endpoint ~default:(Uri.of_string default_endpoint); + } + +let parse argv = + let* opts, argv = + Tezos_clic.parse_global_options (global_options ()) default argv + in + return (make opts, argv) + +class type sc_client_context = + object + inherit Base.Client_context.io_wallet + + inherit Tezos_rpc.Context.generic + end + +class unix_sc_client_context ~base_dir ~password_filename ~rpc_config : + sc_client_context = + object + inherit Client_context_unix.unix_io_wallet ~base_dir ~password_filename + + inherit + Tezos_rpc_http_client_unix.RPC_client_unix.http_ctxt + rpc_config + (Tezos_rpc_http.Media_type.Command_line.of_command_line + rpc_config.media_type) + end + +let make_unix_client_context {base_dir; endpoint} = + let rpc_config = + {Tezos_rpc_http_client_unix.RPC_client_unix.default_config with endpoint} + in + new unix_sc_client_context ~base_dir ~rpc_config ~password_filename:None diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.mli b/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.mli new file mode 100644 index 000000000000..2ae505153074 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/configuration.mli @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Client configuration. *) +type t = private { + base_dir : string; + (** [base_dir] is a directory where client user data is stored. *) + endpoint : Uri.t; + (** [endpoint] is used to communicate with the smart-contract rollup + node. *) +} + +(** [parse argv] parses command-line arguments to return + [(configuration, argv')] where [configuration] is deduced from the + command-line arguments and [argv'] is the rest of the command-line + arguments that have no meaning relatively to [Configuration]. *) +val parse : string list -> (t * string list) tzresult Lwt.t + +(** [global_options ()] returns the list of options that have an + influence on the configuration. *) +val global_options : + unit -> (string option * Uri.t option, 'a) Tezos_clic.options + +(** Instance of [Tezos_client_base.Client_context] that only handles IOs and + RPCs. Can be used for keys and RPCs related commands. *) +class type sc_client_context = + object + inherit Tezos_client_base.Client_context.io_wallet + + inherit Tezos_rpc.Context.generic + end + +(** Instance of [sc_client_context] for linux systems. Relies on + [Tezos_rpc_http_client_unix]. *) +class unix_sc_client_context : + base_dir:string + -> password_filename:string option + -> rpc_config:Tezos_rpc_http_client_unix.RPC_client_unix.config + -> sc_client_context + +(** [make_unix_client_context config] generates a unix_sc_client_context from + the client configuration. *) +val make_unix_client_context : t -> unix_sc_client_context diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/dune b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune new file mode 100644 index 000000000000..2efb5907ffbd --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune @@ -0,0 +1,35 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_sc_rollup_client_alpha) + (public_name octez-sc-rollup-client-alpha) + (package octez-sc-rollup-client-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-stdlib-unix + tezos-client-base-unix + tezos-rpc-http + tezos-rpc-http-client-unix + tezos-protocol-alpha + tezos-sc-rollup-alpha + uri) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_stdlib_unix + -open Tezos_client_base_unix + -open Tezos_rpc_http_client_unix + -open Tezos_protocol_alpha + -open Tezos_sc_rollup_alpha)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml new file mode 100644 index 000000000000..67306f7c9ba6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let executable_name = Filename.basename Sys.executable_name + +let argv () = Array.to_list Sys.argv |> List.tl |> Stdlib.Option.get + +let main () = + Configuration.parse (argv ()) >>=? fun (configuration, argv) -> + let cctxt = Configuration.make_unix_client_context configuration in + Tezos_client_base.Client_keys.register_aggregate_signer + (module Tezos_signer_backends.Unencrypted.Aggregate) ; + Tezos_clic.dispatch (Commands.all ()) cctxt argv + +let handle_error = function + | Ok () -> Stdlib.exit 0 + | Error [Tezos_clic.Version] -> + let version = Tezos_version.Bin_version.version_string in + Format.printf "%s\n" version ; + Stdlib.exit 0 + | Error [Tezos_clic.Help command] -> + Tezos_clic.usage + Format.std_formatter + ~executable_name + ~global_options:(Configuration.global_options ()) + (match command with None -> [] | Some c -> [c]) ; + Stdlib.exit 0 + | Error errs -> + Tezos_clic.pp_cli_errors + Format.err_formatter + ~executable_name + ~global_options:(Configuration.global_options ()) + ~default:Error_monad.pp + errs ; + Stdlib.exit 1 + +let () = Lwt_main.run (Lwt.catch main fail_with_exn) |> handle_error diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.ml new file mode 100644 index 000000000000..cc5fc58504f3 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.ml @@ -0,0 +1,592 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_rpc_http +open Tezos_rpc_http_server +open Protocol + +let get_head store = + let open Lwt_result_syntax in + let*! head = State.last_processed_head_opt store in + match head with None -> failwith "No head" | Some {hash; _} -> return hash + +let get_finalized store = + let open Lwt_result_syntax in + let*! head = State.get_finalized_head_opt store in + match head with + | None -> failwith "No finalized head" + | Some {hash; _} -> return hash + +let get_last_cemented store = + let open Lwt_result_syntax in + protect @@ fun () -> + let*! lcc_level = Store.Last_cemented_commitment_level.get store in + let*! lcc_hash = + State.hash_of_level store (Alpha_context.Raw_level.to_int32 lcc_level) + in + return lcc_hash + +let get_head_hash_opt store = + let open Lwt_option_syntax in + let+ {hash; _} = State.last_processed_head_opt store in + hash + +let get_head_level_opt store = + let open Lwt_option_syntax in + let+ {level; _} = State.last_processed_head_opt store in + level + +let get_state_info_exn store block = + let open Lwt_result_syntax in + let*! state = Store.StateInfo.get store block in + return state + +module Slot_pages_map = struct + open Protocol + open Alpha_context + include Map.Make (Dal.Slot_index) +end + +let get_dal_confirmed_slot_pages store block = + let open Lwt_result_syntax in + let*! slot_pages = + Store.Dal_slot_pages.list_secondary_keys_with_values + store + ~primary_key:block + in + (* Slot pages are sorted in lexicographic order of slot index and page + number.*) + let slot_rev_pages_map = + List.fold_left + (fun map ((index, _page), page) -> + Slot_pages_map.update + index + (function None -> Some [page] | Some pages -> Some (page :: pages)) + map) + Slot_pages_map.empty + slot_pages + in + let slot_pages_map = + Slot_pages_map.map (fun pages -> List.rev pages) slot_rev_pages_map + in + return @@ Slot_pages_map.bindings slot_pages_map + +let get_dal_slot_page store block slot_index slot_page = + let open Lwt_result_syntax in + let*! processed = + Store.Dal_processed_slots.find + store + ~primary_key:block + ~secondary_key:slot_index + in + match processed with + | None -> return ("Slot page has not been downloaded", None) + | Some `Unconfirmed -> return ("Slot was not confirmed", None) + | Some `Confirmed -> ( + let*! contents_opt = + Store.Dal_slot_pages.find + store + ~primary_key:block + ~secondary_key:(slot_index, slot_page) + in + match contents_opt with + | None -> assert false + | Some _contents -> return ("Slot page is available", contents_opt)) + +module type PARAM = sig + include Sc_rollup_services.PREFIX + + type context + + val context_of_prefix : Node_context.rw -> prefix -> context tzresult Lwt.t +end + +module Make_directory (S : PARAM) = struct + open S + + let directory : context tzresult Tezos_rpc.Directory.t ref = + ref Tezos_rpc.Directory.empty + + let register service f = + directory := Tezos_rpc.Directory.register !directory service f + + let register0 service f = + let open Lwt_result_syntax in + register (Tezos_rpc.Service.subst0 service) @@ fun ctxt query input -> + let*? ctxt = ctxt in + f ctxt query input + + let register1 service f = + let open Lwt_result_syntax in + register (Tezos_rpc.Service.subst1 service) + @@ fun (ctxt, arg) query input -> + let*? ctxt = ctxt in + f ctxt arg query input + + let build_directory node_ctxt = + !directory + |> Tezos_rpc.Directory.map (fun prefix -> + context_of_prefix node_ctxt prefix) + |> Tezos_rpc.Directory.prefix prefix +end + +module Global_directory = Make_directory (struct + include Sc_rollup_services.Global + + type context = Node_context.ro + + let context_of_prefix node_ctxt () = return (Node_context.readonly node_ctxt) +end) + +module Proof_helpers_directory = Make_directory (struct + include Sc_rollup_services.Global.Helpers + + (* The context needs to be accessed with write permissions because we need to + commit on disk to generate the proofs. *) + type context = Node_context.rw + + let context_of_prefix node_ctxt () = return node_ctxt +end) + +module Local_directory = Make_directory (struct + include Sc_rollup_services.Local + + type context = Node_context.ro + + let context_of_prefix node_ctxt () = return (Node_context.readonly node_ctxt) +end) + +module Block_directory = Make_directory (struct + include Sc_rollup_services.Global.Block + + type context = Node_context.ro * Tezos_crypto.Block_hash.t + + let context_of_prefix node_ctxt (((), block) : prefix) = + let open Lwt_result_syntax in + let+ block = + match block with + | `Head -> get_head node_ctxt.Node_context.store + | `Hash b -> return b + | `Level l -> State.hash_of_level node_ctxt.store l >>= return + | `Finalized -> get_finalized node_ctxt.Node_context.store + | `Cemented -> get_last_cemented node_ctxt.Node_context.store + in + (Node_context.readonly node_ctxt, block) +end) + +module Outbox_directory = Make_directory (struct + include Sc_rollup_services.Global.Block.Outbox + + type context = + Node_context.ro * Tezos_crypto.Block_hash.t * Alpha_context.Raw_level.t + + let context_of_prefix node_ctxt (((), block), level) = + let open Lwt_result_syntax in + let+ block = + match block with + | `Head -> get_head node_ctxt.Node_context.store + | `Hash b -> return b + | `Level l -> State.hash_of_level node_ctxt.store l >>= return + | `Finalized -> get_finalized node_ctxt.Node_context.store + | `Cemented -> get_last_cemented node_ctxt.Node_context.store + in + (Node_context.readonly node_ctxt, block, level) +end) + +module Common = struct + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.num_messages + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let+ state_info = get_state_info_exn node_ctxt.store block in + state_info.num_messages + + let () = + Global_directory.register0 Sc_rollup_services.Global.sc_rollup_address + @@ fun node_ctxt () () -> return @@ node_ctxt.rollup_address + + let () = + Global_directory.register0 Sc_rollup_services.Global.current_tezos_head + @@ fun node_ctxt () () -> get_head_hash_opt node_ctxt.store >>= return + + let () = + Global_directory.register0 Sc_rollup_services.Global.current_tezos_level + @@ fun node_ctxt () () -> get_head_level_opt node_ctxt.store >>= return + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.hash + @@ fun (_node_ctxt, block) () () -> return block + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.level + @@ fun (node_ctxt, block) () () -> State.level_of_hash node_ctxt.store block + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.inbox + @@ fun (node_ctxt, block) () () -> Inbox.inbox_of_hash node_ctxt block + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.ticks + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let+ state = get_state_info_exn node_ctxt.store block in + state.num_ticks +end + +module Make (Simulation : Simulation.S) (Batcher : Batcher.S) = struct + module PVM = Simulation.PVM + module Interpreter = Simulation.Interpreter + module Outbox = Outbox.Make (PVM) + module Free_pvm = Interpreter.Free_pvm + + let get_state (node_ctxt : _ Node_context.t) block_hash = + let open Lwt_result_syntax in + let* ctxt = Node_context.checkout_context node_ctxt block_hash in + let*! state = PVM.State.find ctxt in + match state with None -> failwith "No state" | Some state -> return state + + let simulate_messages (node_ctxt : Node_context.ro) block ~reveal_pages + messages = + let open Lwt_result_syntax in + let open Alpha_context in + let reveal_map = + match reveal_pages with + | Some pages -> + let map = + List.fold_left + (fun map page -> + let hash = + Sc_rollup_reveal_hash.(hash_string ~scheme:Blake2B [page]) + in + Sc_rollup_reveal_hash.Map.add hash page map) + Sc_rollup_reveal_hash.Map.empty + pages + in + Some map + | None -> None + in + let* level = State.level_of_hash node_ctxt.store block in + let* sim = + Simulation.start_simulation + node_ctxt + ~reveal_map + Layer1.{hash = block; level} + in + let messages = + List.map (fun m -> Sc_rollup.Inbox_message.External m) messages + in + let* sim, num_ticks_0 = + Simulation.simulate_messages node_ctxt sim messages + in + let* {state; inbox_level; _}, num_ticks_end = + Simulation.end_simulation node_ctxt sim + in + let num_ticks = Z.(num_ticks_0 + num_ticks_end) in + let*! outbox = PVM.get_outbox inbox_level state in + let output = + List.filter + (fun Sc_rollup.{outbox_level; _} -> outbox_level = inbox_level) + outbox + in + let*! state_hash = PVM.state_hash state in + let*! status = PVM.get_status state in + let status = PVM.string_of_status status in + return + Sc_rollup_services.{state_hash; status; output; inbox_level; num_ticks} + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.total_ticks + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let*! tick = PVM.get_tick state in + return tick + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.state_hash + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let*! hash = PVM.state_hash state in + return hash + + let () = + Block_directory.register0 + Sc_rollup_services.Global.Block.state_current_level + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let*! current_level = PVM.get_current_level state in + return current_level + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.state_value + @@ fun (node_ctxt, block) {key} () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let path = String.split_on_char '/' key in + let*! value = PVM.State.lookup state path in + match value with + | None -> failwith "No such key in PVM state" + | Some value -> + Format.eprintf "Encoded %S\n@.%!" (Bytes.to_string value) ; + return value + + let () = + Global_directory.register0 Sc_rollup_services.Global.last_stored_commitment + @@ fun node_ctxt () () -> + let open Lwt_result_syntax in + let*! commitment_with_hash = + Commitment.last_commitment_with_hash + (module Store.Last_stored_commitment_level) + node_ctxt.store + in + return + (commitment_with_hash + |> Option.map (fun (commitment, hash) -> (commitment, hash, None))) + + let () = + Local_directory.register0 Sc_rollup_services.Local.last_published_commitment + @@ fun node_ctxt () () -> + let open Lwt_result_syntax in + let*! result = + let open Lwt_option_syntax in + let* commitment, hash = + Commitment.last_commitment_with_hash + (module Store.Last_published_commitment_level) + node_ctxt.store + in + (* The corresponding level in Store.Commitments.published_at_level is + available only when the commitment has been published and included + in a block. *) + let*! published_at_level = + Store.Commitments_published_at_level.find node_ctxt.store hash + in + return (commitment, hash, published_at_level) + in + return result + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.status + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let*! status = PVM.get_status state in + return (PVM.string_of_status status) + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.dal_slots + @@ fun (node_ctxt, block) () () -> + let open Lwt_result_syntax in + let*! slots = + Store.Dal_slots_headers.list_values node_ctxt.store ~primary_key:block + in + return slots + + let () = + Block_directory.register0 + Sc_rollup_services.Global.Block.dal_confirmed_slot_pages + @@ fun (node_ctxt, block) () () -> + get_dal_confirmed_slot_pages node_ctxt.store block + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.dal_slot_page + @@ fun (node_ctxt, block) {index; page} () -> + get_dal_slot_page node_ctxt.store block index page + + let () = + Outbox_directory.register0 Sc_rollup_services.Global.Block.Outbox.messages + @@ fun (node_ctxt, block, outbox_level) () () -> + let open Lwt_result_syntax in + let* state = get_state node_ctxt block in + let*! outbox = PVM.get_outbox outbox_level state in + return outbox + + let () = + Proof_helpers_directory.register0 + Sc_rollup_services.Global.Helpers.outbox_proof + @@ fun node_ctxt output () -> Outbox.proof_of_output node_ctxt output + + let () = + Block_directory.register0 Sc_rollup_services.Global.Block.simulate + @@ fun (node_ctxt, block) () {messages; reveal_pages} -> + simulate_messages node_ctxt block ~reveal_pages messages + + let () = + Local_directory.register0 Sc_rollup_services.Local.injection + @@ fun _node_ctxt () messages -> Batcher.register_messages messages + + let () = + Local_directory.register0 Sc_rollup_services.Local.batcher_queue + @@ fun _node_ctxt () () -> + let open Lwt_result_syntax in + let*? queue = Batcher.get_queue () in + return queue + + (** [commitment_level_of_inbox_level node_ctxt inbox_level] returns the level + of the commitment which should include the inbox of level + [inbox_level]. + + It is computed with the following formula: + {v + commitment_level(inbox_level) = + last_commitment - + ((last_commitment - inbox_level) / commitment_period + * commitment_period) + v} + *) + let commitment_level_of_inbox_level (node_ctxt : _ Node_context.t) inbox_level + = + let open Alpha_context in + let open Lwt_option_syntax in + let+ last_published = + Store.Last_published_commitment_level.find node_ctxt.store + in + let commitment_period = + Int32.of_int + node_ctxt.protocol_constants.parametric.sc_rollup + .commitment_period_in_blocks + in + let last_published = Raw_level.to_int32 last_published in + let open Int32 in + div (sub last_published inbox_level) commitment_period + |> mul commitment_period |> sub last_published |> Raw_level.of_int32_exn + + let inbox_info_of_level (node_ctxt : _ Node_context.t) inbox_level = + let open Alpha_context in + let open Lwt_syntax in + let* lcc = Store.Last_cemented_commitment_level.find node_ctxt.store in + let+ finalized_head = State.get_finalized_head_opt node_ctxt.store in + let finalized = + match finalized_head with + | None -> false + | Some {level = finalized_level; _} -> + Compare.Int32.(inbox_level <= finalized_level) + in + let cemented = + match lcc with + | None -> false + | Some lcc -> Compare.Int32.(inbox_level <= Raw_level.to_int32 lcc) + in + Sc_rollup_services.{finalized; cemented} + + let () = + Local_directory.register1 Sc_rollup_services.Local.batcher_message + @@ fun node_ctxt hash () () -> + let open Lwt_result_syntax in + let*? batch_status = Batcher.message_status hash in + let* status = + match batch_status with + | None -> return (None, Sc_rollup_services.Unknown) + | Some (batch_status, msg) -> ( + let return status = return (Some msg, status) in + match batch_status with + | Pending_batch -> return Sc_rollup_services.Pending_batch + | Batched l1_hash -> ( + match Injector.operation_status l1_hash with + | None -> return Sc_rollup_services.Unknown + | Some (Pending op) -> + return (Sc_rollup_services.Pending_injection op) + | Some (Injected info) -> + return (Sc_rollup_services.Injected info) + | Some (Included info) -> ( + let*! inbox_info = + inbox_info_of_level node_ctxt info.l1_level + in + let*! commitment_level = + commitment_level_of_inbox_level node_ctxt info.l1_level + in + match commitment_level with + | None -> + return (Sc_rollup_services.Included (info, inbox_info)) + | Some commitment_level -> ( + let*! commitment = + Store.Commitments.find node_ctxt.store commitment_level + in + match commitment with + | None -> + (* Commitment not computed yet for inbox *) + return + (Sc_rollup_services.Included (info, inbox_info)) + | Some (commitment, commitment_hash) -> ( + (* Commitment computed *) + let*! published_at = + Store.Commitments_published_at_level.find + node_ctxt.store + commitment_hash + in + match published_at with + | None -> + (* Commitment not published yet *) + return + (Sc_rollup_services.Included (info, inbox_info)) + | Some published_at -> + (* Commitment published *) + let commitment_info = + Sc_rollup_services. + {commitment; commitment_hash; published_at} + in + return + (Sc_rollup_services.Committed + (info, inbox_info, commitment_info))))))) + in + + return status + + let register node_ctxt = + List.fold_left + (fun dir f -> Tezos_rpc.Directory.merge dir (f node_ctxt)) + Tezos_rpc.Directory.empty + [ + Global_directory.build_directory; + Local_directory.build_directory; + Block_directory.build_directory; + Proof_helpers_directory.build_directory; + Outbox_directory.build_directory; + ] + + let start node_ctxt configuration = + let open Lwt_result_syntax in + let Configuration.{rpc_addr; rpc_port; _} = configuration in + let rpc_addr = P2p_addr.of_string_exn rpc_addr in + let host = Ipaddr.V6.to_string rpc_addr in + let node = `TCP (`Port rpc_port) in + let acl = RPC_server.Acl.default rpc_addr in + let dir = register node_ctxt in + let server = + RPC_server.init_server dir ~acl ~media_types:Media_type.all_media_types + in + protect @@ fun () -> + let*! () = + RPC_server.launch + ~host + server + ~callback:(RPC_server.resto_callback server) + node + in + return server + + let shutdown = RPC_server.shutdown +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.mli new file mode 100644 index 000000000000..a5ead51ff6bf --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/RPC_server.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_rpc_http_server + +(** Functor to construct an RPC server for a given PVM with simulation. *) +module Make (Simulation : Simulation.S) (Batcher : Batcher.S) : sig + (** [start node_ctxt config] starts an RPC server listening for requests on + the port [config.rpc_port] and address [config.rpc_addr]. *) + val start : + Node_context.rw -> Configuration.t -> RPC_server.server tzresult Lwt.t + + (** Shutdown a running RPC server. When this function is called, the rollup + node will stop listening to incoming requests. *) + val shutdown : RPC_server.server -> unit Lwt.t +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/arith_pvm.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/arith_pvm.ml new file mode 100644 index 000000000000..9ddf65989c01 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/arith_pvm.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This module manifests the proof format used by the Arith PVM as defined by + the Layer 1 implementation for it. + + It is imperative that this is aligned with the protocol's implementation. +*) +module Arith_proof_format = + Context.Proof + (struct + include Sc_rollup.State_hash + + let of_context_hash = Sc_rollup.State_hash.context_hash_to_state_hash + end) + (struct + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding + end) + +module Impl : Pvm.S = struct + module PVM = Sc_rollup.ArithPVM.Make (Arith_proof_format) + include PVM + + let kind = Sc_rollup.Kind.Example_arith + + module State = Context.PVMState + + let new_dissection = Game_helpers.default_new_dissection + + let string_of_status status = + match status with + | Halted -> "Halted" + | Waiting_for_input_message -> "Waiting for input message" + | Waiting_for_reveal -> "Waiting for reveal" + | Waiting_for_metadata -> "Waiting for metadata" + | Parsing -> "Parsing" + | Evaluating -> "Evaluating" + + let eval_many ?builtins:_ ?stop_at_snapshot ~max_steps initial_state = + ignore stop_at_snapshot ; + let rec go state step = + let open Lwt.Syntax in + let* is_input_required = is_input_state state in + + if is_input_required = No_input_required && step <= max_steps then + let open Lwt.Syntax in + (* Note: This is not an efficient implementation because the state is + decoded/encoded to/from the tree at each step but for Arith PVM + it doesn't matter + *) + let* next_state = eval state in + go next_state (Int64.succ step) + else Lwt.return (state, step) + in + go initial_state 0L +end + +include Impl diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.ml new file mode 100644 index 000000000000..71cbb62d919f --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.ml @@ -0,0 +1,420 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Batcher_worker_types +module Message_queue = Hash_queue.Make (L2_message.Hash) (L2_message) + +module L2_batched_message = struct + type t = {content : string; l1_hash : L1_operation.hash} +end + +module Batched_messages = Hash_queue.Make (L2_message.Hash) (L2_batched_message) + +module type S = sig + type status = Pending_batch | Batched of L1_operation.hash + + val init : + Configuration.batcher -> + signer:public_key_hash -> + _ Node_context.t -> + unit tzresult Lwt.t + + val active : unit -> bool + + val find_message : L2_message.hash -> L2_message.t option tzresult + + val get_queue : unit -> (L2_message.hash * L2_message.t) list tzresult + + val register_messages : string list -> L2_message.hash list tzresult Lwt.t + + val batch : unit -> unit tzresult Lwt.t + + val new_head : Layer1.head -> unit tzresult Lwt.t + + val shutdown : unit -> unit Lwt.t + + val message_status : L2_message.hash -> (status * string) option tzresult +end + +module Make (Simulation : Simulation.S) : S = struct + module PVM = Simulation.PVM + + type status = Pending_batch | Batched of L1_operation.hash + + type state = { + node_ctxt : Node_context.ro; + signer : Tezos_crypto.Signature.public_key_hash; + conf : Configuration.batcher; + messages : Message_queue.t; + batched : Batched_messages.t; + mutable simulation_ctxt : Simulation.t option; + } + + let message_size s = + (* Encoded as length of s on 4 bytes + s *) + 4 + String.length s + + let inject_batch state (l2_messages : L2_message.t list) = + let open Lwt_result_syntax in + let messages = List.map L2_message.content l2_messages in + let operation = Sc_rollup_add_messages {messages} in + let+ l1_hash = + Injector.add_pending_operation ~source:state.signer operation + in + List.iter + (fun msg -> + let content = L2_message.content msg in + let hash = L2_message.hash msg in + Batched_messages.replace state.batched hash {content; l1_hash}) + l2_messages + + let inject_batches state = List.iter_es (inject_batch state) + + let get_batches state ~only_full = + let ( current_rev_batch, + current_batch_size, + current_batch_elements, + full_batches ) = + Message_queue.fold + (fun msg_hash + message + ( current_rev_batch, + current_batch_size, + current_batch_elements, + full_batches ) -> + let size = message_size (L2_message.content message) in + let new_batch_size = current_batch_size + size in + let new_batch_elements = current_batch_elements + 1 in + if + new_batch_size <= state.conf.max_batch_size + && new_batch_elements <= state.conf.max_batch_elements + then + (* We can add the message to the current batch because we are still + within the bounds. *) + ( (msg_hash, message) :: current_rev_batch, + new_batch_size, + new_batch_elements, + full_batches ) + else + (* The batch augmented with the message would be too big but it is + below the limit without it. We finalize the current batch and + create a new one for the message. NOTE: Messages in the queue are + always < [state.conf.max_batch_size] because {!on_register} only + accepts those. *) + let batch = List.rev current_rev_batch in + ([(msg_hash, message)], size, 1, batch :: full_batches)) + state.messages + ([], 0, 0, []) + in + let batches = + if + (not only_full) + || current_batch_size >= state.conf.min_batch_size + && current_batch_elements >= state.conf.min_batch_elements + then + (* We have enough to make a batch with the last non-full batch. *) + List.rev current_rev_batch :: full_batches + else full_batches + in + List.fold_left + (fun (batches, to_remove) -> function + | [] -> (batches, to_remove) + | batch -> + let msg_hashes, batch = List.split batch in + let to_remove = List.rev_append msg_hashes to_remove in + (batch :: batches, to_remove)) + ([], []) + batches + + let produce_batches state ~only_full = + let open Lwt_result_syntax in + let batches, to_remove = get_batches state ~only_full in + match batches with + | [] -> return_unit + | _ -> + let* () = inject_batches state batches in + let*! () = + Batcher_events.(emit batched) + (List.length batches, List.length to_remove) + in + List.iter + (fun tr_hash -> Message_queue.remove state.messages tr_hash) + to_remove ; + return_unit + + let on_batch state = produce_batches state ~only_full:false + + let simulate node_ctxt simulation_ctxt (messages : L2_message.t list) = + let open Lwt_result_syntax in + let ext_messages = + List.map + (fun m -> Sc_rollup.Inbox_message.External (L2_message.content m)) + messages + in + let+ simulation_ctxt, _ticks = + Simulation.simulate_messages node_ctxt simulation_ctxt ext_messages + in + simulation_ctxt + + let on_register state (messages : string list) = + let open Lwt_result_syntax in + let max_size_msg = + min + (Protocol.Constants_repr.sc_rollup_message_size_limit + + 4 (* We add 4 because [message_size] adds 4. *)) + state.conf.max_batch_size + in + let*? messages = + List.mapi_e + (fun i message -> + if message_size message > max_size_msg then + error_with "Message %d is too large (max size is %d)" i max_size_msg + else Ok (L2_message.make message)) + messages + in + let* () = + if not state.conf.simulate then return_unit + else + match state.simulation_ctxt with + | None -> failwith "Simulation context of batcher not initialized" + | Some simulation_ctxt -> + let+ simulation_ctxt = + simulate state.node_ctxt simulation_ctxt messages + in + state.simulation_ctxt <- Some simulation_ctxt + in + let*! () = Batcher_events.(emit queue) (List.length messages) in + let hashes = + List.map + (fun message -> + let msg_hash = L2_message.hash message in + Message_queue.replace state.messages msg_hash message ; + msg_hash) + messages + in + let+ () = produce_batches state ~only_full:true in + hashes + + let on_new_head state head = + let open Lwt_result_syntax in + let* simulation_ctxt = + Simulation.start_simulation ~reveal_map:None state.node_ctxt head + in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4224 + Replay with simulation may be too expensive *) + let+ simulation_ctxt, failing = + if not state.conf.simulate then return (simulation_ctxt, []) + else + (* Re-simulate one by one *) + Message_queue.fold_es + (fun msg_hash msg (simulation_ctxt, failing) -> + let*! result = simulate state.node_ctxt simulation_ctxt [msg] in + match result with + | Ok simulation_ctxt -> return (simulation_ctxt, failing) + | Error _ -> return (simulation_ctxt, msg_hash :: failing)) + state.messages + (simulation_ctxt, []) + in + state.simulation_ctxt <- Some simulation_ctxt ; + (* Forget failing messages *) + List.iter (Message_queue.remove state.messages) failing + + let init_batcher_state node_ctxt ~signer conf = + let open Lwt_syntax in + return + { + node_ctxt; + signer; + conf; + messages = Message_queue.create 100_000 (* ~ 400MB *); + batched = Batched_messages.create 100_000 (* ~ 400MB *); + simulation_ctxt = None; + } + + module Types = struct + type nonrec state = state + + type parameters = { + node_ctxt : Node_context.ro; + signer : Tezos_crypto.Signature.public_key_hash; + conf : Configuration.batcher; + } + end + + module Worker = Worker.MakeSingle (Name) (Request) (Types) + + type worker = Worker.infinite Worker.queue Worker.t + + module Handlers = struct + type self = worker + + let on_request : + type r request_error. + worker -> + (r, request_error) Request.t -> + (r, request_error) result Lwt.t = + fun w request -> + let state = Worker.state w in + match request with + | Request.Register messages -> + protect @@ fun () -> on_register state messages + | Request.Batch -> protect @@ fun () -> on_batch state + | Request.New_head head -> protect @@ fun () -> on_new_head state head + + type launch_error = error trace + + let on_launch _w () Types.{node_ctxt; signer; conf} = + let open Lwt_result_syntax in + let*! state = init_batcher_state node_ctxt ~signer conf in + return state + + let on_error (type a b) _w st (r : (a, b) Request.t) (errs : b) : + unit tzresult Lwt.t = + let open Lwt_result_syntax in + let request_view = Request.view r in + let emit_and_return_errors errs = + let*! () = + Batcher_events.(emit Worker.request_failed) (request_view, st, errs) + in + return_unit + in + match r with + | Request.Register _ -> emit_and_return_errors errs + | Request.Batch -> emit_and_return_errors errs + | Request.New_head _ -> emit_and_return_errors errs + + let on_completion _w r _ st = + match Request.view r with + | Request.View (Register _ | New_head _) -> + Batcher_events.(emit Worker.request_completed_debug) + (Request.view r, st) + | View Batch -> + Batcher_events.(emit Worker.request_completed_notice) + (Request.view r, st) + + let on_no_request _ = Lwt.return_unit + + let on_close _w = Lwt.return_unit + end + + let table = Worker.create_table Queue + + let worker_promise, worker_waker = Lwt.task () + + let init conf ~signer node_ctxt = + let open Lwt_result_syntax in + let node_ctxt = Node_context.readonly node_ctxt in + let+ worker = + Worker.launch table () {node_ctxt; signer; conf} (module Handlers) + in + Lwt.wakeup worker_waker worker + + (* This is a batcher worker for a single scoru *) + let worker = + lazy + (match Lwt.state worker_promise with + | Lwt.Return worker -> ok worker + | Lwt.Fail _ | Lwt.Sleep -> error Sc_rollup_node_errors.No_batcher) + + let active () = + match Lwt.state worker_promise with + | Lwt.Return _ -> true + | Lwt.Fail _ | Lwt.Sleep -> false + + let find_message hash = + let open Result_syntax in + let+ w = Lazy.force worker in + let state = Worker.state w in + Message_queue.find_opt state.messages hash + + let get_queue () = + let open Result_syntax in + let+ w = Lazy.force worker in + let state = Worker.state w in + Message_queue.bindings state.messages + + let handle_request_error rq = + let open Lwt_syntax in + let* rq = rq in + match rq with + | Ok res -> return_ok res + | Error (Worker.Request_error errs) -> Lwt.return_error errs + | Error (Closed None) -> Lwt.return_error [Worker_types.Terminated] + | Error (Closed (Some errs)) -> Lwt.return_error errs + | Error (Any exn) -> Lwt.return_error [Exn exn] + + let register_messages messages = + let open Lwt_result_syntax in + let*? w = Lazy.force worker in + Worker.Queue.push_request_and_wait w (Request.Register messages) + |> handle_request_error + + let batch () = + let w = Lazy.force worker in + match w with + | Error _ -> + (* There is no batcher, nothing to do *) + return_unit + | Ok w -> + Worker.Queue.push_request_and_wait w Request.Batch + |> handle_request_error + + let new_head b = + let open Lwt_result_syntax in + let w = Lazy.force worker in + match w with + | Error _ -> + (* There is no batcher, nothing to do *) + return_unit + | Ok w -> + let*! (_pushed : bool) = + Worker.Queue.push_request w (Request.New_head b) + in + return_unit + + let shutdown () = + let w = Lazy.force worker in + match w with + | Error _ -> + (* There is no batcher, nothing to do *) + Lwt.return_unit + | Ok w -> Worker.shutdown w + + let message_status state msg_hash = + match Message_queue.find_opt state.messages msg_hash with + | Some msg -> Some (Pending_batch, L2_message.content msg) + | None -> ( + match Batched_messages.find_opt state.batched msg_hash with + | Some {content; l1_hash} -> Some (Batched l1_hash, content) + | None -> None) + + let message_status msg_hash = + let open Result_syntax in + let+ w = Lazy.force worker in + let state = Worker.state w in + message_status state msg_hash +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.mli new file mode 100644 index 000000000000..3855c96e9fc1 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher.mli @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module type S = sig + (** The type for the status of messages in the batcher. *) + type status = + | Pending_batch (** The message is in the queue of the batcher. *) + | Batched of L1_operation.hash + (** The message has already been batched and sent to the injector in an + L1 operation whose hash is given. *) + + (** [init config ~signer node_ctxt] initializes and starts the batcher for + [signer]. If [config.simulation] is [true] (the default), messages added + to the batcher are simulated in an incremental simulation context. *) + val init : + Configuration.batcher -> + signer:public_key_hash -> + _ Node_context.t -> + unit tzresult Lwt.t + + (** Return [true] if the batcher was started for this node. *) + val active : unit -> bool + + (** Retrieve an L2 message from the queue. *) + val find_message : L2_message.hash -> L2_message.t option tzresult + + (** List all queued messages in the order they appear in the queue, i.e. the + message that were added first to the queue are at the end of list. *) + val get_queue : unit -> (L2_message.hash * L2_message.t) list tzresult + + (** [register_messages messages] registers new L2 [messages] in the queue of + the batcher for future injection on L1. If the batcher was initialized + with [simualte = true], the messages are evaluated the batcher's + incremental simulation context. In this case, when the application fails, + the messages are not queued. *) + val register_messages : string list -> L2_message.hash list tzresult Lwt.t + + (** Create L2 batches of operations from the queue and pack them in an L1 + batch operation. The batch operation is queued in the injector for + injection on the Tezos node. *) + val batch : unit -> unit tzresult Lwt.t + + (** Notify a new L2 head to the batcher worker. *) + val new_head : Layer1.head -> unit tzresult Lwt.t + + (** Shutdown the batcher, waiting for the ongoing request to be processed. *) + val shutdown : unit -> unit Lwt.t + + (** The status of a message in the batcher. Returns [None] if the message is + not known by the batcher (the batcher only keeps the batched status of the + last 500000 messages). *) + val message_status : L2_message.hash -> (status * string) option tzresult +end + +module Make (Simulation : Simulation.S) : S diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_events.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_events.ml new file mode 100644 index 000000000000..5d0ad969a3c0 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_events.ml @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Internal_event.Simple + +let section = ["sc_rollup_node"; "batcher"] + +let queue = + declare_1 + ~section + ~name:"queue" + ~msg:"adding {nb_messages} to queue" + ~level:Notice + ("nb_messages", Data_encoding.int31) + +let batched = + declare_2 + ~section + ~name:"batched" + ~msg:"batched {nb_messages} messages into {nb_batches} batches" + ~level:Notice + ("nb_batches", Data_encoding.int31) + ("nb_messages", Data_encoding.int31) + +module Worker = struct + open Batcher_worker_types + + let section = section @ ["worker"] + + let request_failed = + declare_3 + ~section + ~name:"request_failed" + ~msg:"request {view} failed ({worker_status}): {errors}" + ~level:Warning + ("view", Request.encoding) + ~pp1:Request.pp + ("worker_status", Worker_types.request_status_encoding) + ~pp2:Worker_types.pp_status + ("errors", Error_monad.trace_encoding) + ~pp3:Error_monad.pp_print_trace + + let request_completed_notice = + declare_2 + ~section + ~name:"request_completed_notice" + ~msg:"{view} {worker_status}" + ~level:Notice + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status + + let request_completed_debug = + declare_2 + ~section + ~name:"request_completed_debug" + ~msg:"{view} {worker_status}" + ~level:Debug + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.ml new file mode 100644 index 000000000000..ac2201e49d44 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.ml @@ -0,0 +1,90 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Request = struct + type ('a, 'b) t = + | Register : string list -> (L2_message.hash list, error trace) t + | New_head : Layer1.head -> (unit, error trace) t + | Batch : (unit, error trace) t + + type view = View : _ t -> view + + let view req = View req + + let encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Register" + (obj2 + (req "request" (constant "register")) + (req "messages" (list L2_message.content_encoding))) + (function + | View (Register messages) -> Some ((), messages) | _ -> None) + (fun ((), messages) -> View (Register messages)); + case + (Tag 1) + ~title:"New_head" + (obj2 + (req "request" (constant "new_head")) + (req "block" Layer1.head_encoding)) + (function View (New_head b) -> Some ((), b) | _ -> None) + (fun ((), b) -> View (New_head b)); + case + (Tag 2) + ~title:"Batch" + (obj1 (req "request" (constant "batch"))) + (function View Batch -> Some () | _ -> None) + (fun () -> View Batch); + ] + + let pp ppf (View r) = + match r with + | Register messages -> + Format.fprintf ppf "register %d new L2 message" (List.length messages) + | New_head {Layer1.hash; level} -> + Format.fprintf + ppf + "switching to new L1 head %a at level %ld" + Tezos_crypto.Block_hash.pp + hash + level + | Batch -> Format.pp_print_string ppf "batch" +end + +module Name = struct + (* We only have a single batcher right now *) + type t = unit + + let encoding = Data_encoding.unit + + let base = ["sc_rollup_batcher"] + + let pp _ _ = () + + let equal () () = true +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.mli new file mode 100644 index 000000000000..681291fbd22f --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/batcher_worker_types.mli @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module contains the parameters for the worker (see {!Worker}) used by + the batcher. *) + +module Request : sig + (** Type of requests accepted by the batcher worker. *) + type ('a, 'b) t = + | Register : string list -> (L2_message.hash list, error trace) t + (** Request to register new L2 messages in the queue. *) + | New_head : Layer1.head -> (unit, error trace) t + (** Request to handle a new L1 head. *) + | Batch : (unit, error trace) t (** Request to produce batches. *) + + type view = View : _ t -> view + + include + Worker_intf.REQUEST + with type ('a, 'request_error) t := ('a, 'request_error) t + and type view := view +end + +module Name : Worker_intf.NAME with type t = unit diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.ml new file mode 100644 index 000000000000..d1e3bb326c2f --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.ml @@ -0,0 +1,439 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The rollup node stores and publishes commitments for the PVM every + [Constants.sc_rollup_commitment_period_in_blocks] levels. + + Every time a finalized block is processed by the rollup node, the latter + determines whether the last commitment that the node has produced referred + to [sc_rollup.commitment_period_in_blocks] blocks earlier. For mainnet, + [sc_rollup.commitment_period_in_blocks = 30]. In this case, it computes and + stores a new commitment in a level-indexed map. + + Stored commitments are signed by the rollup node operator + and published on the layer1 chain. To ensure that commitments + produced by the rollup node are eventually published, + storing and publishing commitments are decoupled. Every time + a new head is processed, the node tries to publish the oldest + commitment that was not published already. +*) + +open Protocol +open Alpha_context + +module type Mutable_level_store = + Store_sigs.Mutable_value + with type value = Raw_level.t + and type 'a store = 'a Store.store + +(* We persist the number of ticks to be included in the + next commitment on disk, in a map that is indexed by + inbox level. Note that we do not risk to increase + these counters when the wrong branch is tracked by the rollup + node, as only finalized heads are processed to build commitments. +*) +module Number_of_ticks : + Store_sigs.Append_only_map + with type 'a store = 'a Store.store + and type key = Raw_level.t + and type value = Z.t = + Store.Make_append_only_map + (struct + let path = ["commitments"; "in_progress"; "number_of_ticks"] + end) + (struct + type key = Raw_level.t + + let to_path_representation key = Int32.to_string @@ Raw_level.to_int32 key + end) + (struct + type value = Z.t + + let name = "ticks" + + let encoding = Data_encoding.z + end) + +let sc_rollup_commitment_period node_ctxt = + Int32.of_int + @@ node_ctxt.Node_context.protocol_constants.parametric.sc_rollup + .commitment_period_in_blocks + +let sc_rollup_challenge_window node_ctxt = + Int32.of_int + node_ctxt.Node_context.protocol_constants.parametric.sc_rollup + .challenge_window_in_blocks + +let last_commitment_level (module Last_commitment_level : Mutable_level_store) + store = + Last_commitment_level.find store + +let last_commitment_with_hash + (module Last_commitment_level : Mutable_level_store) store = + let open Lwt_option_syntax in + let* last_commitment_level = + last_commitment_level (module Last_commitment_level) store + in + let*! commitment_with_hash = + Store.Commitments.get store last_commitment_level + in + return commitment_with_hash + +let next_commitment_level node_ctxt + (module Last_commitment_level : Mutable_level_store) = + let open Lwt_syntax in + let+ last_commitment_level_opt = + last_commitment_level + (module Last_commitment_level) + node_ctxt.Node_context.store + in + let last_commitment_level = + Option.value last_commitment_level_opt ~default:node_ctxt.genesis_info.level + in + Raw_level.of_int32 + @@ Int32.add + (Raw_level.to_int32 last_commitment_level) + (sc_rollup_commitment_period node_ctxt) + +let last_commitment_hash node_ctxt + (module Last_commitment_level : Mutable_level_store) = + let open Lwt_syntax in + let+ last_commitment = + last_commitment_with_hash + (module Last_commitment_level) + node_ctxt.Node_context.store + in + match last_commitment with + | Some (_commitment, hash) -> hash + | None -> node_ctxt.genesis_info.Sc_rollup.Commitment.commitment_hash + +let must_store_commitment node_ctxt current_level = + let open Lwt_result_syntax in + let+ next_commitment_level = + next_commitment_level node_ctxt (module Store.Last_stored_commitment_level) + in + + Raw_level.equal current_level next_commitment_level + +let update_last_stored_commitment store (commitment : Sc_rollup.Commitment.t) = + let open Lwt_syntax in + let commitment_hash = Sc_rollup.Commitment.hash_uncarbonated commitment in + let inbox_level = commitment.inbox_level in + let* lcc_level = Store.Last_cemented_commitment_level.get store in + (* Do not change the order of these two operations. This guarantees that + whenever `Store.Last_stored_commitment_level.get` returns `Some hash`, + then the call to `Store.Commitments.get hash` will succeed. + *) + let* () = + Store.Commitments.add store inbox_level (commitment, commitment_hash) + in + let* () = Store.Last_stored_commitment_level.set store inbox_level in + let* () = Commitment_event.commitment_stored commitment_hash commitment in + if commitment.inbox_level <= lcc_level then + Commitment_event.commitment_will_not_be_published lcc_level commitment + else return () + +module Make (PVM : Pvm.S) : Commitment_sig.S with module PVM = PVM = struct + module PVM = PVM + + let build_commitment node_ctxt block_hash = + let open Lwt_result_syntax in + let lsc = + (module Store.Last_stored_commitment_level : Mutable_level_store) + in + let*! predecessor = last_commitment_hash node_ctxt lsc in + let* inbox_level = + Lwt.map Environment.wrap_tzresult @@ next_commitment_level node_ctxt lsc + in + let* ctxt = Node_context.checkout_context node_ctxt block_hash in + let*! pvm_state = PVM.State.find ctxt in + let* compressed_state = + match pvm_state with + | Some pvm_state -> + let*! hash = PVM.state_hash pvm_state in + return hash + | None -> + failwith + "PVM state for block hash not available %s" + (Tezos_crypto.Block_hash.to_string block_hash) + in + let*! number_of_ticks = Number_of_ticks.get node_ctxt.store inbox_level in + let+ number_of_ticks = + match + Sc_rollup.Number_of_ticks.of_value @@ Z.to_int64 number_of_ticks + with + | Some number_of_ticks -> + if number_of_ticks = Sc_rollup.Number_of_ticks.zero then + failwith "A 0-tick commitment is impossible" + else return number_of_ticks + | None -> + failwith "Invalid number of ticks %s" (Z.to_string number_of_ticks) + in + Sc_rollup.Commitment. + {predecessor; inbox_level; number_of_ticks; compressed_state} + + let store_commitment_if_necessary node_ctxt current_level block_hash = + let open Lwt_result_syntax in + let* must_store_commitment = + Lwt.map Environment.wrap_tzresult + @@ must_store_commitment node_ctxt current_level + in + if must_store_commitment then + let*! () = Commitment_event.compute_commitment block_hash current_level in + let* commitment = build_commitment node_ctxt block_hash in + let*! () = update_last_stored_commitment node_ctxt.store commitment in + return_unit + else return_unit + + let update_ticks (node_ctxt : _ Node_context.t) current_level block_hash = + let open Lwt_result_syntax in + let*! last_stored_commitment_level_opt = + last_commitment_level + (module Store.Last_stored_commitment_level) + node_ctxt.store + in + let last_stored_commitment_level = + Option.value + ~default:node_ctxt.genesis_info.level + last_stored_commitment_level_opt + in + let*! previous_level_num_ticks = + match Raw_level.pred current_level with + | None -> + (* This happens if the current_level is zero: it is safe to assume + that there are 0 ticks computed so far. *) + Lwt.return Z.zero + | Some level -> + if Raw_level.(level = last_stored_commitment_level) then + (* We are at the first level of a new commitment, so the initial amount + of ticks should be 0. *) + Lwt.return Z.zero + else if Raw_level.(level < node_ctxt.genesis_info.level) then + (* If the previous level was before the genesis level, then the + number of ticks at that level should be 0. *) + Lwt.return Z.zero + else + (* Otherwise we need to increment the number of ticks from the number + of ticks for the previous level. The number of ticks for such a + level should be in the store, otherwise the state of the rollup node + is corrupted. *) + Number_of_ticks.get node_ctxt.store level + in + let*! {num_ticks; _} = Store.StateInfo.get node_ctxt.store block_hash in + Number_of_ticks.add + node_ctxt.store + current_level + (Z.add previous_level_num_ticks num_ticks) + + let process_head (node_ctxt : _ Node_context.t) Layer1.{level; hash} = + let open Lwt_result_syntax in + let current_level = Raw_level.of_int32_exn level in + let*! () = update_ticks node_ctxt current_level hash in + store_commitment_if_necessary node_ctxt current_level hash + + let sync_last_cemented_commitment_hash_with_level + ({cctxt; rollup_address; store; _} : _ Node_context.t) = + let open Lwt_result_syntax in + let* hash, inbox_level = + Plugin.RPC.Sc_rollup.last_cemented_commitment_hash_with_level + cctxt + (cctxt#chain, cctxt#block) + rollup_address + in + let*! () = Store.Last_cemented_commitment_level.set store inbox_level in + let*! () = Store.Last_cemented_commitment_hash.set store hash in + let*! () = + Commitment_event.last_cemented_commitment_updated hash inbox_level + in + return_unit + + let get_commitment_and_publish ~check_lcc_hash + ({store; _} as node_ctxt : _ Node_context.t) next_level_to_publish = + let open Lwt_result_syntax in + let*! is_commitment_available = + Store.Commitments.mem store next_level_to_publish + in + if is_commitment_available then + let*! commitment, _commitment_hash = + Store.Commitments.get store next_level_to_publish + in + let* () = + if check_lcc_hash then + let open Lwt_result_syntax in + let*! lcc_hash = Store.Last_cemented_commitment_hash.get store in + if Sc_rollup.Commitment.Hash.equal lcc_hash commitment.predecessor + then return () + else + let*! () = + Commitment_event.commitment_parent_is_not_lcc + commitment.inbox_level + commitment.predecessor + lcc_hash + in + tzfail + (Sc_rollup_node_errors.Commitment_predecessor_should_be_LCC + commitment) + else return_unit + in + let operator = Node_context.get_operator node_ctxt Publish in + match operator with + | None -> + (* Configured to not publish commitments *) + return_unit + | Some source -> + let publish_operation = + Sc_rollup_publish {rollup = node_ctxt.rollup_address; commitment} + in + let* _hash = + Injector.add_pending_operation ~source publish_operation + in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3462 + Decouple commitments from head processing + + Move the following, in a part where we know the operation is + included. *) + let*! () = + Store.Last_published_commitment_level.set + store + commitment.inbox_level + in + return_unit + else return_unit + + let publish_commitment node_ctxt = + let open Lwt_result_syntax in + (* Check level of next publishable commitment and avoid publishing if it is + on or before the last cemented commitment. + *) + let* next_lcc_level = + Lwt.map Environment.wrap_tzresult + @@ next_commitment_level + node_ctxt + (module Store.Last_cemented_commitment_level) + in + let* next_publishable_level = + Lwt.map Environment.wrap_tzresult + @@ next_commitment_level + node_ctxt + (module Store.Last_published_commitment_level) + in + let check_lcc_hash, level_to_publish = + if Raw_level.(next_publishable_level < next_lcc_level) then + (* + + This situation can happen if the rollup node has been + shutdown and the rollup has been progressing in the + meantime. In that case, the rollup node must wait to reach + [lcc_level + commitment_frequency] to publish the + commitment. ([lcc_level] is a multiple of + commitment_frequency.) + + We need to check that the published commitment comes + immediately after the last cemented commitment, otherwise + that's an invalid commitment. + + *) + (true, next_lcc_level) + else (false, next_publishable_level) + in + get_commitment_and_publish node_ctxt level_to_publish ~check_lcc_hash + + let earliest_cementing_level node_ctxt commitment_hash = + let open Lwt_option_syntax in + let+ published_at_level = + Store.Commitments_published_at_level.find + node_ctxt.Node_context.store + commitment_hash + in + Int32.add + (Raw_level.to_int32 published_at_level) + (sc_rollup_challenge_window node_ctxt) + + let can_be_cemented node_ctxt earliest_cementing_level head_level + commitment_hash = + let {Node_context.cctxt; rollup_address; _} = node_ctxt in + let open Lwt_result_syntax in + if earliest_cementing_level <= head_level then + Plugin.RPC.Sc_rollup.can_be_cemented + cctxt + (cctxt#chain, cctxt#block) + rollup_address + commitment_hash + () + else return_false + + let cement_commitment (node_ctxt : _ Node_context.t) commitment_hash = + let open Lwt_result_syntax in + let operator = Node_context.get_operator node_ctxt Cement in + match operator with + | None -> + (* Configured to not cement commitments *) + return_unit + | Some source -> + let cement_operation = + Sc_rollup_cement + {rollup = node_ctxt.rollup_address; commitment = commitment_hash} + in + let* _hash = Injector.add_pending_operation ~source cement_operation in + return_unit + + let cement_commitment_if_possible node_ctxt Layer1.{level = head_level; _} = + let open Lwt_result_syntax in + let* next_level_to_cement = + Lwt.map Environment.wrap_tzresult + @@ next_commitment_level + node_ctxt + (module Store.Last_cemented_commitment_level) + in + let*! commitment_with_hash = + Store.Commitments.find node_ctxt.store next_level_to_cement + in + match commitment_with_hash with + (* If `commitment_with_hash` is defined, the commitment to be cemented has + been stored but not necessarily published by the rollup node. *) + | Some (_commitment, commitment_hash) -> ( + let*! earliest_cementing_level = + earliest_cementing_level node_ctxt commitment_hash + in + match earliest_cementing_level with + (* If `earliest_cementing_level` is well defined, then the rollup node + has previously published `commitment`, which means that the rollup + is indirectly staked on it. *) + | Some earliest_cementing_level -> + let* green_flag = + can_be_cemented + node_ctxt + earliest_cementing_level + head_level + commitment_hash + in + if green_flag then cement_commitment node_ctxt commitment_hash + else return () + | None -> return ()) + | None -> return () + + let start () = Commitment_event.starting () +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.mli new file mode 100644 index 000000000000..2f4f72e07590 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment.mli @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The rollup node stores and publishes commitments for the PVM + every 20 levels. + + Every time a finalized block is processed by the rollup node, + the latter determines whether the last commitment that the node + has produced referred to 20 blocks earlier. In this case, it + computes and stores a new commitment in a level-indexed map. + + Stored commitments are signed by the rollup node operator + and published on the layer1 chain. To ensure that commitments + produced by the rollup node are eventually published, + storing and publishing commitments are decoupled. Every time + a new head is processed, the node tries to publish the oldest + commitment that was not published already. +*) + +open Protocol.Alpha_context + +module type Mutable_level_store = + Store_sigs.Mutable_value + with type value = Raw_level.t + and type 'a store = 'a Store.store + +(** [last_commitment_with_hash (module Last_level_module: Mutable_level_store) store] + returns the last commitment and relative hash + stored according to the value of level indicated by + [module Last_level_module]. If no commitment has been stored for the + level indicated by [module Last_level_module], then None is returned. + Two possible implementations for [module Last_level_module] are + [Store.Last_published_commitment_level] and + [Store.Last_stored_commitment_level]. + *) + +val last_commitment_with_hash : + (module Mutable_level_store) -> + _ Store.t -> + (Sc_rollup.Commitment.t * Sc_rollup.Commitment.Hash.t) option Lwt.t + +module Make (PVM : Pvm.S) : Commitment_sig.S with module PVM = PVM diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.ml new file mode 100644 index 000000000000..0b706c624e77 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.ml @@ -0,0 +1,151 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "commitment"] + + let starting = + declare_0 + ~section + ~name:"sc_rollup_commitment_publisher_starting" + ~msg:"Starting commitment publisher for the smart contract rollup node" + ~level:Notice + () + + let stopping = + declare_0 + ~section + ~name:"sc_rollup_node_commitment_publisher_stopping" + ~msg:"Stopping commitment publisher for the smart contract rollup node" + ~level:Notice + () + + let commitment_will_not_be_published = + declare_5 + ~section + ~name:"sc_rollup_node_commitment_will_not_be_published" + ~msg: + "Commitment will not be published: its inbox level is less or equal \ + than the last cemented commitment level {lcc_level} - predecessor: \ + {predecessor}, inbox_level: {inbox_level}, compressed_state: \ + {compressed_state}, number_of_ticks: {number_of_ticks}" + ~level:Notice + ("lcc_level", Raw_level.encoding) + ("predecessor", Sc_rollup.Commitment.Hash.encoding) + ("inbox_level", Raw_level.encoding) + ("compressed_state", Sc_rollup.State_hash.encoding) + ("number_of_ticks", Sc_rollup.Number_of_ticks.encoding) + + let last_cemented_commitment_updated = + declare_2 + ~section + ~name:"sc_rollup_node_lcc_updated" + ~msg: + "Last cemented commitment was updated to hash {hash} at inbox level \ + {level}" + ~level:Notice + ("hash", Sc_rollup.Commitment.Hash.encoding) + ("level", Raw_level.encoding) + + let compute_commitment = + declare_2 + ~section + ~name:"sc_rollup_node_commitment_process_head" + ~msg: + "Computing and storing new commitment for head {head} at level {level}" + ~level:Notice + ("head", Tezos_crypto.Block_hash.encoding) + ("level", Raw_level.encoding) + + let commitment_parent_is_not_lcc = + declare_3 + ~section + ~name:"sc_rollup_commitment_parent_is_not_lcc" + ~msg: + "Trying to publish a commitment at inbox level {level} whose parent is \ + the last cemented commitment, but the commitment's predecessor hash \ + {predecessor_hash} differs from the last cemented commitment hash \ + {lcc_hash}. This is a critical error, and the rollup node will be \ + terminated." + ~level:Fatal + ("level", Raw_level.encoding) + ("predecessor_hash", Sc_rollup.Commitment.Hash.encoding) + ("lcc_hash", Sc_rollup.Commitment.Hash.encoding) + + let commitment_stored = + declare_5 + ~section + ~name:"sc_rollup_node_commitment_stored" + ~msg: + "Commitment {commitment_hash} was stored - predecessor: {predecessor}, \ + inbox_level: {inbox_level}, compressed_state: {compressed_state}, \ + number_of_ticks: {number_of_ticks}" + ~level:Notice + ("commitment_hash", Sc_rollup.Commitment.Hash.encoding) + ("predecessor", Sc_rollup.Commitment.Hash.encoding) + ("inbox_level", Raw_level.encoding) + ("compressed_state", Sc_rollup.State_hash.encoding) + ("number_of_ticks", Sc_rollup.Number_of_ticks.encoding) +end + +let starting = Simple.(emit starting) + +let stopping = Simple.(emit stopping) + +open Sc_rollup.Commitment + +let emit_commitment_event f commitment_hash + {predecessor; inbox_level; compressed_state; number_of_ticks} = + Simple.( + emit + f + ( commitment_hash, + predecessor, + inbox_level, + compressed_state, + number_of_ticks )) + +let commitment_will_not_be_published lcc_level + {predecessor; inbox_level; compressed_state; number_of_ticks} = + Simple.( + emit + commitment_will_not_be_published + (lcc_level, predecessor, inbox_level, compressed_state, number_of_ticks)) + +let commitment_stored = emit_commitment_event Simple.commitment_stored + +let last_cemented_commitment_updated head level = + Simple.(emit last_cemented_commitment_updated (head, level)) + +let compute_commitment head level = + Simple.(emit compute_commitment (head, level)) + +let commitment_parent_is_not_lcc level predecessor_hash lcc_hash = + Simple.(emit commitment_parent_is_not_lcc (level, predecessor_hash, lcc_hash)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.mli new file mode 100644 index 000000000000..bdca58229142 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_event.mli @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines functions that emit the events used for the rollup node + when it is storing and publishing commitments (see {!Commitment}). *) + +open Protocol.Alpha_context + +val starting : unit -> unit Lwt.t + +val stopping : unit -> unit Lwt.t + +(** [commitment_stored commitment_hash commitment] emits the event + that the [commitment] was stored. *) +val commitment_stored : + Sc_rollup.Commitment.Hash.t -> Sc_rollup.Commitment.t -> unit Lwt.t + +(** [commitment_will_not_be_published level commitment] emits the event that + [commitment] will not be published: its inbox level is less or equal than + the last cemented commitment [level]. *) +val commitment_will_not_be_published : + Raw_level.t -> Sc_rollup.Commitment.t -> unit Lwt.t + +(** [last_cemented_commitment_updated hash level] emits the event that the last + cemented commitment was updated to the given [hash] at the given inbox + [level]. *) +val last_cemented_commitment_updated : + Sc_rollup.Commitment.Hash.t -> Raw_level.t -> unit Lwt.t + +(** [commitment_parent_is_not_lcc predecessor_hash last_cemented_commitment_hash] + emits the event that a commitment at the given inbox [level] is being + published, whose parent is the last cemented commitment, but the + commitment's [predecessor_hash] differs from the + [last_cemented_commitment_hash]. + This is a critical error, the rollup node will be terminated. *) +val commitment_parent_is_not_lcc : + Raw_level.t -> + Sc_rollup.Commitment.Hash.t -> + Sc_rollup.Commitment.Hash.t -> + unit Lwt.t + +(** [compute_commitment hash level] emits the event that a new commitment is + being computed and stored for the block of the given [hash] and at the given + [level]. *) +val compute_commitment : Tezos_crypto.Block_hash.t -> Raw_level.t -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_sig.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_sig.ml new file mode 100644 index 000000000000..3dabbe89f68e --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/commitment_sig.ml @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The rollup node stores and publishes commitments for the PVM + every `Commitment.sc_rollup_commitment_period` levels. + + Every time a finalized block is processed by the rollup node, + the latter determines whether the last commitment that the node + has produced referred to `Commitment.sc_rollup_commitment_period` blocks + earlier. In this case, it computes and stores a new commitment in a + level-indexed map. + + Stored commitments are signed by the rollup node operator + and published on the layer1 chain. To ensure that commitments + produced by the rollup node are eventually published, + storing and publishing commitments are decoupled. Every time + a new head is processed, the node tries to publish the oldest + commitment that was not published already. +*) +module type S = sig + module PVM : Pvm.S + + (** [process_head node_ctxt head] checks whether a new commitment needs to be + computed and stored, by looking at the level of [head] and checking + whether it is a multiple of `Commitment.sc_rollup_commitment_period` + levels away from [node_ctxt.initial_level]. It uses the functionalities of + [PVM] to compute the hash of to be included in the commitment. *) + val process_head : Node_context.rw -> Layer1.head -> unit tzresult Lwt.t + + (** [sync_last_cemented_commitment_hash_with_level node_ctxt] fetches and + stores information about the last cemeneted commitment in the layer1 + chain. *) + val sync_last_cemented_commitment_hash_with_level : + Node_context.rw -> unit tzresult Lwt.t + + (** [publish_commitment node_ctxt] publishes the earliest commitment + stored in [store] that has not been published yet, unless its inbox level + is below or equal to the inbox level of the last cemented commitment in + the layer1 chain. In this case, the rollup node checks whether it has + computed a commitment whose inbox level is + [sc_rollup_commitment_period] levels after the inbox level of the last + cemented commitment: + {ul + {li if the commitment is found and its predecessor hash coincides with + the hash of the LCC, the rollup node will try to publish that commitment + instead; } + {li if the commitment is found but its predecessor hash differs from the + hash of the LCC, the rollup node will stop its execution;} + {li if no commitment is found, no action is taken by the rollup node; + in particular, no commitment is published.} + } + *) + val publish_commitment : Node_context.rw -> unit tzresult Lwt.t + + (** [cement_commitment_if_possible node_ctxt head] checks whether the next + commitment to be cemented (i.e. whose inbox level is + [sc_rollup_commitment_period] levels after + [Store.Last_cemented_commitment_level store]) can be cemented. In + particular, the request to cement the commitment happens only if the + commitment is stored in [Store.Commitments store], and if + [sc_rollup_challenge_period] levels have passed since when the commitment + was originally published. *) + val cement_commitment_if_possible : + _ Node_context.t -> Layer1.head -> unit tzresult Lwt.t + + (** [start ()] only emits the event that the commitment manager + for the rollup node has started. *) + val start : unit -> unit Lwt.t +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/components.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/components.ml new file mode 100644 index 000000000000..70f7e12c8ed8 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/components.ml @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* Copyright (c) 2022 Trili Tech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Make (PVM : Pvm.S) = struct + module PVM = PVM + module Interpreter = Interpreter.Make (PVM) + module Commitment = Commitment.Make (PVM) + module Simulation = Simulation.Make (Interpreter) + module Refutation_game = Refutation_game.Make (Interpreter) + module Batcher = Batcher.Make (Simulation) + module RPC_server = RPC_server.Make (Simulation) (Batcher) +end + +let pvm_of_kind : Protocol.Alpha_context.Sc_rollup.Kind.t -> (module Pvm.S) = + function + | Example_arith -> (module Arith_pvm) + | Wasm_2_0_0 -> (module Wasm_2_0_0_pvm) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.ml new file mode 100644 index 000000000000..aa6ae6f2a6df --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.ml @@ -0,0 +1,637 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* Copyright (c) 2022 Trili Tech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +type mode = Observer | Batcher | Maintenance | Operator | Custom + +type purpose = Publish | Add_messages | Cement | Timeout | Refute + +let purposes = [Publish; Add_messages; Cement; Timeout; Refute] + +module Operator_purpose_map = Map.Make (struct + type t = purpose + + let compare = Stdlib.compare +end) + +type operators = Tezos_crypto.Signature.Public_key_hash.t Operator_purpose_map.t + +type fee_parameters = Injection.fee_parameter Operator_purpose_map.t + +type batcher = { + simulate : bool; + min_batch_elements : int; + min_batch_size : int; + max_batch_elements : int; + max_batch_size : int; +} + +type t = { + sc_rollup_address : Sc_rollup.t; + sc_rollup_node_operators : operators; + rpc_addr : string; + rpc_port : int; + metrics_addr : string option; + reconnection_delay : float; + fee_parameters : fee_parameters; + mode : mode; + loser_mode : Loser_mode.t; + dal_node_addr : string; + dal_node_port : int; + batcher : batcher; + injector_retention_period : int; +} + +let default_data_dir = + Filename.concat (Sys.getenv "HOME") ".tezos-sc-rollup-node" + +let storage_dir = "storage" + +let context_dir = "context" + +let default_storage_dir data_dir = Filename.concat data_dir storage_dir + +let default_context_dir data_dir = Filename.concat data_dir context_dir + +let config_filename ~data_dir = Filename.concat data_dir "config.json" + +let default_rpc_addr = "127.0.0.1" + +let default_rpc_port = 8932 + +let default_metrics_port = 9934 + +let default_reconnection_delay = 2.0 (* seconds *) + +let default_dal_node_addr = "127.0.0.1" + +let default_dal_node_port = 10732 + +let tez t = Tez.of_mutez_exn Int64.(mul (of_int t) 1_000_000L) + +let default_minimal_fees = Mempool.default_minimal_fees + +let default_minimal_nanotez_per_gas_unit = + Mempool.default_minimal_nanotez_per_gas_unit + +let default_minimal_nanotez_per_byte = Mempool.default_minimal_nanotez_per_byte + +let default_force_low_fee = false + +let default_fee_cap = tez 1 + +let default_burn_cap = Tez.zero + +(* The below default fee and burn limits are computed by taking into account + the worst fee found in the tests for the rollup node. + + We take as base the cost of commitment cementation, which is 719 mutez in fees: + - Commitment publishing is 1.37 times more expensive. + - Message submission is 0.7 times more expensive, so cheaper but it depends on + the size of the message. + - For refutation games: + - Open is 1.55 times more expensive. + - Dissection move is 2.31 times more expensive. + - Proof move is 1.47 times more expensive but depends on the size of the proof. + - Timeout move is 1.34 times more expensive. + + We set a fee limit of 1 tz for cementation (instead of 719 mutez) which + should be plenty enough even if the gas price or gas consumption + increases. We adjust the other limits in proportion. +*) +let default_fee = function + | Cement -> tez 1 + | Publish -> tez 2 + | Add_messages -> + (* We keep this limit even though it depends on the size of the message + because the rollup node pays the fees for messages submitted by the + **users**. *) + tez 1 + | Timeout -> tez 2 + | Refute -> + (* Should be 3 based on comment above but we want to make sure we inject + refutation moves even if the proof is large. The stake is high (we can + lose the 10k deposit or we can get the reward). *) + tez 5 + +let default_burn = function + | Publish -> + (* The first commitment can store data. *) + tez 1 + | Add_messages -> tez 0 + | Cement -> tez 0 + | Timeout -> tez 0 + | Refute -> + (* A refutation move can store data, e.g. opening a game. *) + tez 1 + +let default_fee_parameter ?purpose () = + let fee_cap, burn_cap = + match purpose with + | None -> (default_fee_cap, default_burn_cap) + | Some purpose -> (default_fee purpose, default_burn purpose) + in + { + Injection.minimal_fees = default_minimal_fees; + minimal_nanotez_per_byte = default_minimal_nanotez_per_byte; + minimal_nanotez_per_gas_unit = default_minimal_nanotez_per_gas_unit; + force_low_fee = default_force_low_fee; + fee_cap; + burn_cap; + } + +let default_fee_parameters = + List.fold_left + (fun acc purpose -> + Operator_purpose_map.add purpose (default_fee_parameter ~purpose ()) acc) + Operator_purpose_map.empty + purposes + +let default_batcher_simulate = true + +let default_batcher_min_batch_elements = 10 + +let default_batcher_min_batch_size = 10 + +let default_batcher_max_batch_elements = max_int + +let protocol_max_batch_size = + let empty_message_op : _ Operation.t = + let open Protocol in + let open Alpha_context in + let open Operation in + { + shell = {branch = Tezos_crypto.Block_hash.zero}; + protocol_data = + { + signature = Some Tezos_crypto.Signature.zero; + contents = + Single + (Manager_operation + { + source = Tezos_crypto.Signature.Public_key_hash.zero; + fee = Tez.of_mutez_exn Int64.max_int; + counter = Manager_counter.Internal_for_tests.of_int max_int; + gas_limit = + Gas.Arith.integral_of_int_exn ((max_int - 1) / 1000); + storage_limit = Z.of_int max_int; + operation = Sc_rollup_add_messages {messages = [""]}; + }); + }; + } + in + Protocol.Constants_repr.max_operation_data_length + - Data_encoding.Binary.length + Operation.encoding + (Operation.pack empty_message_op) + +let default_batcher_max_batch_size = protocol_max_batch_size + +let default_batcher = + { + simulate = default_batcher_simulate; + min_batch_elements = default_batcher_min_batch_elements; + min_batch_size = default_batcher_min_batch_size; + max_batch_elements = default_batcher_max_batch_elements; + max_batch_size = default_batcher_max_batch_size; + } + +let max_injector_retention_period = + 5 * 8192 (* Preserved cycles (5) for mainnet *) + +let default_injector_retention_period = 2048 + +let string_of_purpose = function + | Publish -> "publish" + | Add_messages -> "add_messages" + | Cement -> "cement" + | Timeout -> "timeout" + | Refute -> "refute" + +let purpose_of_string = function + | "publish" -> Some Publish + | "add_messages" -> Some Add_messages + | "cement" -> Some Cement + | "timeout" -> Some Timeout + | "refute" -> Some Refute + | _ -> None + +let purpose_of_string_exn s = + match purpose_of_string s with + | Some p -> p + | None -> invalid_arg ("purpose_of_string " ^ s) + +let add_fallbacks map fallbacks = + List.fold_left + (fun map (missing_purpose, fallback_purpose) -> + if Operator_purpose_map.mem missing_purpose map then + (* No missing purpose, don't fallback *) + map + else + match Operator_purpose_map.find fallback_purpose map with + | None -> + (* Nothing to fallback on *) + map + | Some operator -> Operator_purpose_map.add missing_purpose operator map) + map + fallbacks + +let make_purpose_map ~default bindings = + let map = Operator_purpose_map.of_seq @@ List.to_seq bindings in + let map = add_fallbacks map [(Timeout, Refute)] in + match default with + | None -> map + | Some default -> + List.fold_left + (fun map purpose -> + if Operator_purpose_map.mem purpose map then map + else Operator_purpose_map.add purpose default map) + map + purposes + +let operator_purpose_map_encoding encoding = + let open Data_encoding in + let schema = + let open Json_schema in + let v_schema p = Data_encoding.Json.schema (encoding p) in + let v_schema_r p = root (v_schema p) in + let kind = + Object + { + properties = + List.map + (fun purpose -> + (string_of_purpose purpose, v_schema_r purpose, false, None)) + purposes; + pattern_properties = []; + additional_properties = None; + min_properties = 0; + max_properties = None; + schema_dependencies = []; + property_dependencies = []; + } + in + update (element kind) (v_schema Publish (* Dummy for definitions *)) + in + conv + ~schema + (fun map -> + let fields = + Operator_purpose_map.bindings map + |> List.map (fun (p, v) -> + (string_of_purpose p, Data_encoding.Json.construct (encoding p) v)) + in + `O fields) + (function + | `O fields -> + List.map + (fun (p, v) -> + let purpose = purpose_of_string_exn p in + (purpose, Data_encoding.Json.destruct (encoding purpose) v)) + fields + |> List.to_seq |> Operator_purpose_map.of_seq + | _ -> assert false) + Data_encoding.Json.encoding + +let operators_encoding = + operator_purpose_map_encoding (fun _ -> + Tezos_crypto.Signature.Public_key_hash.encoding) + +let fee_parameter_encoding purpose = + let open Data_encoding in + conv + (fun { + Injection.minimal_fees; + minimal_nanotez_per_byte; + minimal_nanotez_per_gas_unit; + force_low_fee; + fee_cap; + burn_cap; + } -> + ( minimal_fees, + minimal_nanotez_per_byte, + minimal_nanotez_per_gas_unit, + force_low_fee, + fee_cap, + burn_cap )) + (fun ( minimal_fees, + minimal_nanotez_per_byte, + minimal_nanotez_per_gas_unit, + force_low_fee, + fee_cap, + burn_cap ) -> + { + minimal_fees; + minimal_nanotez_per_byte; + minimal_nanotez_per_gas_unit; + force_low_fee; + fee_cap; + burn_cap; + }) + (obj6 + (dft + "minimal-fees" + ~description:"Exclude operations with lower fees" + Tez.encoding + default_minimal_fees) + (dft + "minimal-nanotez-per-byte" + ~description:"Exclude operations with lower fees per byte" + Plugin.Mempool.nanotez_enc + default_minimal_nanotez_per_byte) + (dft + "minimal-nanotez-per-gas-unit" + ~description:"Exclude operations with lower gas fees" + Plugin.Mempool.nanotez_enc + default_minimal_nanotez_per_gas_unit) + (dft + "force-low-fee" + ~description: + "Don't check that the fee is lower than the estimated default" + bool + default_force_low_fee) + (dft + "fee-cap" + ~description:"The fee cap" + Tez.encoding + (default_fee purpose)) + (dft + "burn-cap" + ~description:"The burn cap" + Tez.encoding + (default_burn purpose))) + +let fee_parameters_encoding = + operator_purpose_map_encoding fee_parameter_encoding + +let modes = [Observer; Batcher; Maintenance; Operator; Custom] + +let string_of_mode = function + | Observer -> "observer" + | Batcher -> "batcher" + | Maintenance -> "maintenance" + | Operator -> "operator" + | Custom -> "custom" + +let mode_of_string = function + | "observer" -> Ok Observer + | "batcher" -> Ok Batcher + | "maintenance" -> Ok Maintenance + | "operator" -> Ok Operator + | "custom" -> Ok Custom + | _ -> Error [Exn (Failure "Invalid mode")] + +let description_of_mode = function + | Observer -> "Only follows the chain, reconstructs and interprets inboxes" + | Batcher -> + "Accepts transactions in its queue and batches them on the L1 (TODO)" + | Maintenance -> + "Follows the chain and publishes commitments, cement and refute" + | Operator -> "Equivalent to maintenance + batcher" + | Custom -> + "In this mode, only operations that have a corresponding operator/signer \ + are injected" + +let mode_encoding = + Data_encoding.string_enum + [ + ("observer", Observer); + ("batcher", Batcher); + ("maintenance", Maintenance); + ("operator", Operator); + ("custom", Custom); + ] + +let batcher_encoding = + let open Data_encoding in + conv_with_guard + (fun { + simulate; + min_batch_elements; + min_batch_size; + max_batch_elements; + max_batch_size; + } -> + ( simulate, + min_batch_elements, + min_batch_size, + max_batch_elements, + max_batch_size )) + (fun ( simulate, + min_batch_elements, + min_batch_size, + max_batch_elements, + max_batch_size ) -> + if max_batch_size > protocol_max_batch_size then + Error + (Format.sprintf + "max_batch_size must be smaller than %d" + protocol_max_batch_size) + else if min_batch_size <= 0 then Error "min_batch_size must be positive" + else if max_batch_size < min_batch_size then + Error "max_batch_size must be greater than min_batch_size" + else if min_batch_elements <= 0 then + Error "min_batch_elements must be positive" + else if max_batch_elements < min_batch_elements then + Error "max_batch_elements must be greater than min_batch_elements" + else + Ok + { + simulate; + min_batch_elements; + min_batch_size; + max_batch_elements; + max_batch_size; + }) + @@ obj5 + (dft "simulate" bool default_batcher_simulate) + (dft "min_batch_elements" int31 default_batcher_min_batch_elements) + (dft "min_batch_size" int31 default_batcher_min_batch_size) + (dft "max_batch_elements" int31 default_batcher_max_batch_elements) + (dft "max_batch_size" int31 default_batcher_max_batch_size) + +let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun { + sc_rollup_address; + sc_rollup_node_operators; + rpc_addr; + rpc_port; + metrics_addr; + reconnection_delay; + fee_parameters; + mode; + loser_mode; + dal_node_addr; + dal_node_port; + batcher; + injector_retention_period; + } -> + ( ( sc_rollup_address, + sc_rollup_node_operators, + rpc_addr, + rpc_port, + metrics_addr, + reconnection_delay, + fee_parameters, + mode, + loser_mode ), + (dal_node_addr, dal_node_port, batcher, injector_retention_period) )) + (fun ( ( sc_rollup_address, + sc_rollup_node_operators, + rpc_addr, + rpc_port, + metrics_addr, + reconnection_delay, + fee_parameters, + mode, + loser_mode ), + (dal_node_addr, dal_node_port, batcher, injector_retention_period) ) -> + if injector_retention_period > max_injector_retention_period then + Format.ksprintf + Stdlib.failwith + "injector_retention_period should be smaller than %d" + max_injector_retention_period ; + { + sc_rollup_address; + sc_rollup_node_operators; + rpc_addr; + rpc_port; + metrics_addr; + reconnection_delay; + fee_parameters; + mode; + loser_mode; + dal_node_addr; + dal_node_port; + batcher; + injector_retention_period; + }) + (merge_objs + (obj9 + (req + "sc-rollup-address" + ~description:"Smart contract rollup address" + Protocol.Alpha_context.Sc_rollup.Address.encoding) + (req + "sc-rollup-node-operator" + ~description: + "Operators that sign operations of the smart contract rollup, \ + by purpose" + operators_encoding) + (dft "rpc-addr" ~description:"RPC address" string default_rpc_addr) + (dft "rpc-port" ~description:"RPC port" int16 default_rpc_port) + (opt "metrics-addr" ~description:"Metrics address" string) + (dft + "reconnection_delay" + ~description: + "The reconnection (to the tezos node) delay in seconds" + float + default_reconnection_delay) + (dft + "fee-parameters" + ~description: + "The fee parameters for each purpose used when injecting \ + operations in L1" + fee_parameters_encoding + default_fee_parameters) + (req + ~description:"The mode for this rollup node" + "mode" + mode_encoding) + (dft + "loser-mode" + ~description: + "If enabled, the rollup node will issue wrong commitments (for \ + test only!)" + Loser_mode.encoding + Loser_mode.no_failures)) + (obj4 + (dft "DAL node address" string default_dal_node_addr) + (dft "DAL node port" int16 default_dal_node_port) + (dft "batcher" batcher_encoding default_batcher) + (dft + "injector_retention_period" + uint16 + default_injector_retention_period))) + +let check_mode config = + let open Result_syntax in + let check_purposes purposes = + let missing_operators = + List.filter + (fun p -> + not (Operator_purpose_map.mem p config.sc_rollup_node_operators)) + purposes + in + if missing_operators <> [] then + let mode = string_of_mode config.mode in + let missing_operators = List.map string_of_purpose missing_operators in + tzfail + (Sc_rollup_node_errors.Missing_mode_operators {mode; missing_operators}) + else return_unit + in + let narrow_purposes purposes = + let+ () = check_purposes purposes in + let sc_rollup_node_operators = + Operator_purpose_map.filter + (fun op_purpose _ -> List.mem ~equal:Stdlib.( = ) op_purpose purposes) + config.sc_rollup_node_operators + in + {config with sc_rollup_node_operators} + in + match config.mode with + | Observer -> narrow_purposes [] + | Batcher -> narrow_purposes [Add_messages] + | Maintenance -> narrow_purposes [Publish; Cement; Refute] + | Operator -> narrow_purposes [Publish; Cement; Add_messages; Refute] + | Custom -> return config + +let loser_warning_message config = + if config.loser_mode <> Loser_mode.no_failures then + Format.printf + {| +************ WARNING ************* +This rollup node is in loser mode. +This should be used for test only! +************ WARNING ************* +|} + +let save ~data_dir config = + loser_warning_message config ; + let open Lwt_syntax in + let json = Data_encoding.Json.construct encoding config in + let* () = Lwt_utils_unix.create_dir data_dir in + Lwt_utils_unix.Json.write_file (config_filename ~data_dir) json + +let load ~data_dir = + let open Lwt_result_syntax in + let+ json = Lwt_utils_unix.Json.read_file (config_filename ~data_dir) in + let config = Data_encoding.Json.destruct encoding json in + loser_warning_message config ; + config diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.mli new file mode 100644 index 000000000000..22058666b750 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/configuration.mli @@ -0,0 +1,174 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* Copyright (c) 2022 Trili Tech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Mode for the rollup node *) +type mode = + | Observer (** Only follows the chain and reconstructs inboxes *) + | Batcher (** Accept transactions in its queue and batches them on the L1 *) + | Maintenance (** Follows the chain and publishes commitments *) + | Operator (** Equivalent to maintenance + batcher *) + | Custom + (** This mode allows to tweak which operations are injected by selecting + the signers *) + +(** Purposes for operators, indicating the kind of operations that they sign. *) +type purpose = Publish | Add_messages | Cement | Timeout | Refute + +module Operator_purpose_map : Map.S with type key = purpose + +type operators = Tezos_crypto.Signature.Public_key_hash.t Operator_purpose_map.t + +type fee_parameters = Injection.fee_parameter Operator_purpose_map.t + +(** Configuration for the batcher. + + Invariants: + - 0 < [min_batch_size] <= [max_batch_size] <= [protocol_max_batch_size] + - 0 < [min_batch_elements] <= [max_batch_elements] +*) +type batcher = { + simulate : bool; + (** If [true], the batcher will simulate the messages it receives, in an + incremental context, before queuing them. *) + min_batch_elements : int; + (** The minimum number elements in a batch for it to be produced when the + batcher receives new messages. *) + min_batch_size : int; + (** The minimum size in bytes of a batch for it to be produced when the + batcher receives new messages. *) + max_batch_elements : int; + (** The maximum number of elements that we can put in a batch. *) + max_batch_size : int; (** The maximum size in bytes of a batch. *) +} + +type t = { + sc_rollup_address : Protocol.Alpha_context.Sc_rollup.t; + sc_rollup_node_operators : operators; + rpc_addr : string; + rpc_port : int; + metrics_addr : string option; + reconnection_delay : float; + fee_parameters : fee_parameters; + mode : mode; + loser_mode : Loser_mode.t; + (*DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3718 + Decide whether we want to handle connections to multiple + Dal nodes for different slot indexes. + *) + dal_node_addr : string; + dal_node_port : int; + batcher : batcher; + injector_retention_period : int; +} + +(** [make_purpose_map ~default purposes] constructs a purpose map from a list of + bindings [purposes], with a potential [default] value. *) +val make_purpose_map : + default:'a option -> (purpose * 'a) trace -> 'a Operator_purpose_map.t + +(** [purpose_of_string s] parses a purpose from the given string [s]. *) +val purpose_of_string : string -> purpose option + +(** [string_of_purpose p] returns a string representation of purpose [p]. *) +val string_of_purpose : purpose -> string + +(** List of possible purposes for operator specialization. *) +val purposes : purpose list + +(** [default_data_dir] is the default value for [data_dir]. *) +val default_data_dir : string + +(** [default_storage_dir] returns the default value of the storage dir + given a [data_dir]. *) +val default_storage_dir : string -> string + +(** [default_context_dir] returns the default value of the directory + for persisting the context given a [data_dir]. *) +val default_context_dir : string -> string + +(** [default_rpc_addr] is the default value for [rpc_addr]. *) +val default_rpc_addr : string + +(** [default_rpc_port] is the default value for [rpc_port]. *) +val default_rpc_port : int + +(** [default_metrics_port] is the default port for the metrics server. *) +val default_metrics_port : int + +(** [default_reconnection_delay] is the default value for [reconnection_delay]. *) +val default_reconnection_delay : float + +(** [default_fee_parameter ?purpose ()] is the default fee parameter to inject + operation on L1. If [purpose] is provided, it returns the default fee + parameter for the specific purpose. *) +val default_fee_parameter : ?purpose:purpose -> unit -> Injection.fee_parameter + +(** [default_fee_parameters] is the default fee parameters configuration build + with {!default_fee_parameter} for all purposes. *) +val default_fee_parameters : fee_parameters + +(** [default_dal_node_addr] is the default value for [dal_node_addr]. *) +val default_dal_node_addr : string + +(** [default_dal_node_port] is the default value for [dal_node_port]. *) +val default_dal_node_port : int + +(** [default_batcher] is the default configuration parameters for the batcher. *) +val default_batcher : batcher + +(** [default_injector_retention_period] is the default number of blocks the + injector will keep in memory. *) +val default_injector_retention_period : int + +(** [max_injector_retention_period] is the maximum allowed value for + [injector_retention_period]. *) +val max_injector_retention_period : int + +(** This is the list of available modes. *) +val modes : mode list + +(** [string_of_mode mode] returns a string representation of the mode [mode]. *) +val string_of_mode : mode -> string + +(** [mode_of_string s] returns the mode represented by string [s] if it exists. *) +val mode_of_string : string -> mode tzresult + +(** [description_of_mode m] returns a textual description of the mode [m]. *) +val description_of_mode : mode -> string + +(** [config_filename data_dir] returns + the configration filename from the [data_dir] *) +val config_filename : data_dir:string -> string + +(** [check_mode config] ensures the operators correspond to the chosen mode and + removes the extra ones. *) +val check_mode : t -> t tzresult + +(** [save configuration] overwrites [configuration] file from [data_dir]. *) +val save : data_dir:string -> t -> unit tzresult Lwt.t + +(** [load ~data_dir] loads a configuration stored in [data_dir]. *) +val load : data_dir:string -> t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/context.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/context.ml new file mode 100644 index 000000000000..4c711cc857d1 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/context.ml @@ -0,0 +1,203 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Store_sigs +module Context_encoding = Tezos_context_encoding.Context_binary + +(* We shadow [Tezos_context_encoding] to prevent accidentally using + [Tezos_context_encoding.Context] instead of + [Tezos_context_encoding.Context_binary] during a future + refactoring.*) +module Tezos_context_encoding = struct end + +module Maker = Irmin_pack_unix.Maker (Context_encoding.Conf) + +module IStore = struct + include Maker.Make (Context_encoding.Schema) + module Schema = Context_encoding.Schema +end + +module IStoreTree = + Tezos_context_helpers.Context.Make_tree (Context_encoding.Conf) (IStore) + +type tree = IStore.tree + +type 'a raw_index = {path : string; repo : IStore.Repo.t} + +type 'a index = 'a raw_index constraint 'a = [< `Read | `Write > `Read] + +type rw_index = [`Read | `Write] index + +type ro_index = [`Read] index + +type 'a t = {index : 'a index; tree : tree} + +type rw = [`Read | `Write] t + +type ro = [`Read] t + +type commit = IStore.commit + +type hash = IStore.hash + +type path = string list + +let hash_encoding = + let open Data_encoding in + conv + (fun h -> IStore.Hash.to_raw_string h |> Bytes.unsafe_of_string) + (fun b -> Bytes.unsafe_to_string b |> IStore.Hash.unsafe_of_raw_string) + (Fixed.bytes IStore.Hash.hash_size) + +let hash_to_raw_string = IStore.Hash.to_raw_string + +let pp_hash fmt h = + IStore.Hash.to_raw_string h + |> Hex.of_string |> Hex.show |> Format.pp_print_string fmt + +let load : type a. a mode -> string -> a raw_index Lwt.t = + fun mode data_dir -> + let open Lwt_syntax in + let open Configuration in + let path = default_context_dir data_dir in + let readonly = match mode with Read_only -> true | Read_write -> false in + let+ repo = IStore.Repo.v (Irmin_pack.config ~readonly path) in + {path; repo} + +let close ctxt = IStore.Repo.close ctxt.repo + +let readonly (index : [> `Read] index) = (index :> [`Read] index) + +let raw_commit ?(message = "") index tree = + let info = IStore.Info.v ~author:"Tezos" 0L ~message in + IStore.Commit.v index.repo ~info ~parents:[] tree + +let commit ?message ctxt = + let open Lwt_syntax in + let+ commit = raw_commit ?message ctxt.index ctxt.tree in + IStore.Commit.hash commit + +let checkout index key = + let open Lwt_syntax in + let* o = IStore.Commit.of_hash index.repo key in + match o with + | None -> return_none + | Some commit -> + let tree = IStore.Commit.tree commit in + return_some {index; tree} + +let empty index = {index; tree = IStore.Tree.empty ()} + +let is_empty ctxt = IStore.Tree.is_empty ctxt.tree + +let index context = context.index + +module Proof (Hash : sig + type t + + val of_context_hash : Tezos_crypto.Context_hash.t -> t +end) (Proof_encoding : sig + val proof_encoding : + Environment.Context.Proof.tree Environment.Context.Proof.t Data_encoding.t +end) = +struct + module IStoreProof = + Tezos_context_helpers.Context.Make_proof (IStore) (Context_encoding.Conf) + + module Tree = struct + include IStoreTree + + type t = rw_index + + type tree = IStore.tree + + type key = path + + type value = bytes + end + + type tree = Tree.tree + + type proof = IStoreProof.Proof.tree IStoreProof.Proof.t + + let hash_tree tree = Hash.of_context_hash (Tree.hash tree) + + let proof_encoding = Proof_encoding.proof_encoding + + let proof_before proof = + let (`Value hash | `Node hash) = proof.IStoreProof.Proof.before in + Hash.of_context_hash hash + + let proof_after proof = + let (`Value hash | `Node hash) = proof.IStoreProof.Proof.after in + Hash.of_context_hash hash + + let produce_proof index tree step = + let open Lwt_syntax in + (* Committing the context is required by Irmin to produce valid proofs. *) + let* _commit_key = raw_commit index tree in + match Tree.kinded_key tree with + | Some k -> + let* p = IStoreProof.produce_tree_proof index.repo k step in + return (Some p) + | None -> return None + + let verify_proof proof step = + (* The rollup node is not supposed to verify proof. We keep + this part in case this changes in the future. *) + let open Lwt_syntax in + let* result = IStoreProof.verify_tree_proof proof step in + match result with + | Ok v -> return (Some v) + | Error _ -> + (* We skip the error analysis here since proof verification is not a + job for the rollup node. *) + return None +end + +module Inbox = struct + include Sc_rollup.Inbox + module Message = Sc_rollup.Inbox_message +end + +(** State of the PVM that this rollup node deals with. *) +module PVMState = struct + type value = tree + + let key = ["pvm_state"] + + let empty () = IStore.Tree.empty () + + let find ctxt = IStore.Tree.find_tree ctxt.tree key + + let lookup tree path = IStore.Tree.find tree path + + let set ctxt state = + let open Lwt_syntax in + let+ tree = IStore.Tree.add_tree ctxt.tree key state in + {ctxt with tree} +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/context.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/context.mli new file mode 100644 index 000000000000..2f5d4de887ae --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/context.mli @@ -0,0 +1,171 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Store_sigs + +(** The type of indexed repository for contexts. The parameter indicates if the + index can be written or only read. *) +type 'a index constraint 'a = [< `Read | `Write > `Read] + +(** Read/write {!index}. *) +type rw_index = [`Read | `Write] index + +(** Read only {!index}. *) +type ro_index = [`Read] index + +(** The type of trees stored in the context, i.e. the actual data. *) +type tree + +(** The type of context with its content. *) +type 'a t constraint 'a = [< `Read | `Write > `Read] + +(** Read/write context {!t}. *) +type rw = [`Read | `Write] t + +(** Read-only context {!t}. *) +type ro = [`Read] t + +(** A context hash is the hash produced when the data of the context is + committed to disk, i.e. the {!commit} hash. *) +type hash + +(** The type of commits for the context. *) +type commit + +(** [hash_encoding] is the encoding for context hashes, of type {!hash}. *) +val hash_encoding : hash Data_encoding.t + +(** [hash_to_raw_string h] is the raw string representation for the hash [h]. *) +val hash_to_raw_string : hash -> string + +(** [pp_hash fmt h] prints the hash [h] in hexadecimal notation on the formatter + [fmt]. *) +val pp_hash : Format.formatter -> hash -> unit + +(** [load data_dir] initializes from disk a context using the [data_dir]. *) +val load : 'a mode -> string -> 'a index Lwt.t + +(** [index context] is the repository of the context [context]. *) +val index : 'a t -> 'a index + +(** [close ctxt] closes the context index [ctxt]. *) +val close : _ index -> unit Lwt.t + +(** [readonly index] returns a read-only version of the index. *) +val readonly : [> `Read] index -> [`Read] index + +(** [raw_commit ?message ctxt tree] commits the [tree] in the context repository + [ctxt] on disk, and return the commit. *) +val raw_commit : ?message:string -> [> `Write] index -> tree -> commit Lwt.t + +(** [commit ?message context] commits content of the context [context] on disk, + and return the commit hash. *) +val commit : ?message:string -> [> `Write] t -> hash Lwt.t + +(** [checkout ctxt hash] checkouts the content that corresponds to the commit + hash [hash] in the repository [ctxt] and returns the corresponding + context. If there is no commit that corresponds to [hash], it returns + [None]. *) +val checkout : 'a index -> hash -> 'a t option Lwt.t + +(** [empty ctxt] is the context with an empty content for the repository [ctxt]. *) +val empty : 'a index -> 'a t + +(** [is_empty context] returns [true] iff the context content of [context] is + empty. *) +val is_empty : _ t -> bool + +(** Module for generating and verifying proofs for a context *) +module Proof (Hash : sig + type t + + val of_context_hash : Tezos_crypto.Context_hash.t -> t +end) (Proof_encoding : sig + val proof_encoding : + Environment.Context.Proof.tree Environment.Context.Proof.t Data_encoding.t +end) : sig + (** Tree representation for proof generation. + + NOTE: The index needs to be accessed with write permissions because we + need to commit on disk to generate the proofs (e.g. in + {!Inbox.produce_proof}, {!PVM.produce_proof}. or + {!PVM.produce_output_proof}). *) + module Tree : + Tezos_context_sigs.Context.TREE + with type key = string list + and type value = bytes + and type t = rw_index + and type tree = tree + + type tree = Tree.tree + + (** See {!Sc_rollup_PVM_sem.proof} *) + type proof + + val hash_tree : tree -> Hash.t + + (** See {!Sc_rollup_PVM_sem.proof_encoding} *) + val proof_encoding : proof Data_encoding.t + + (** [proof_before proof] is the hash of the state before the step that + generated [rpoof]. *) + val proof_before : proof -> Hash.t + + (** [proof_after proof] is the hash of the state after the step that generated + [rpoof]. *) + val proof_after : proof -> Hash.t + + (** [produce_proof ctxt tree f] produces and returns a proof for the execution + of [f] on the state [tree]. *) + val produce_proof : + rw_index -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t + + (** [verify_proof proof f] verifies that [f] produces the proof [proof] and + returns the resulting [tree], or [None] if the proof cannot be + verified. *) + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t +end + +(** State of the PVM that this rollup node deals with *) +module PVMState : sig + (** The value of a PVM state *) + type value = tree + + (** [empty ()] is the empty PVM state. *) + val empty : unit -> value + + (** [find context] returns the PVM state stored in the [context], if any. *) + val find : _ t -> value option Lwt.t + + (** [lookup state path] returns the data stored for the path [path] in the PVM + state [state]. *) + val lookup : value -> string list -> bytes option Lwt.t + + (** [set context state] saves the PVM state [state] in the context and returns + the updated context. Note: [set] does not perform any write on disk, this + information must be committed using {!commit}. *) + val set : 'a t -> value -> 'a t Lwt.t +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon.ml new file mode 100644 index 000000000000..4ed068c1ed3c --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon.ml @@ -0,0 +1,485 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Make (PVM : Pvm.S) = struct + module Components = Components.Make (PVM) + open Protocol + open Alpha_context + open Apply_results + + (** Process an L1 SCORU operation (for the node's rollup) which is included + for the first time. {b Note}: this function does not process inboxes for + the rollup, which is done instead by {!Inbox.process_head}. *) + let process_included_l1_operation (type kind) (node_ctxt : Node_context.rw) + head ~source:_ (operation : kind manager_operation) + (result : kind successful_manager_operation_result) = + let open Lwt_result_syntax in + match (operation, result) with + | ( Sc_rollup_publish {commitment; _}, + Sc_rollup_publish_result {published_at_level; _} ) -> + (* Published commitment --------------------------------------------- *) + let commitment_hash = + Sc_rollup.Commitment.hash_uncarbonated commitment + in + let*! () = + Store.Commitments_published_at_level.add + node_ctxt.store + commitment_hash + published_at_level + in + return_unit + | Sc_rollup_cement {commitment; _}, Sc_rollup_cement_result {inbox_level; _} + -> + (* Cemented commitment ---------------------------------------------- *) + let*! () = + Store.Last_cemented_commitment_level.set node_ctxt.store inbox_level + in + let*! () = + Store.Last_cemented_commitment_hash.set node_ctxt.store commitment + in + return_unit + | ( Sc_rollup_refute _, + Sc_rollup_refute_result + {game_status = Ended (Loser {reason; loser}); balance_updates; _} ) + when Node_context.is_operator node_ctxt loser -> + let*? slashed_amount = + List.fold_left_e + (fun slashed -> function + | ( Receipt.Sc_rollup_refutation_punishments, + Receipt.Credited amount, + _ ) -> + Environment.wrap_tzresult Tez.(slashed +? amount) + | _ -> Ok slashed) + Tez.zero + balance_updates + in + tzfail (Sc_rollup_node_errors.Lost_game (loser, reason, slashed_amount)) + | Dal_publish_slot_header slot_header, Dal_publish_slot_header_result _ -> + let {Dal.Slot.Header.header = {id = {index; _}; _}; _} = slot_header in + let*! () = + Store.Dal_slots_headers.add + node_ctxt.store + ~primary_key:head + ~secondary_key:index + slot_header.header + in + return_unit + | _, _ -> + (* Other manager operations *) + return_unit + + (** Process an L1 SCORU operation (for the node's rollup) which is finalized + for the first time. *) + let process_finalized_l1_operation (type kind) _node_ctxt _head ~source:_ + (_operation : kind manager_operation) + (_result : kind successful_manager_operation_result) = + return_unit + + let process_l1_operation (type kind) ~finalized node_ctxt head ~source + (operation : kind manager_operation) + (result : kind Apply_results.manager_operation_result) = + let open Lwt_result_syntax in + let is_for_my_rollup : type kind. kind manager_operation -> bool = function + | Sc_rollup_add_messages _ -> true + | Sc_rollup_cement {rollup; _} + | Sc_rollup_publish {rollup; _} + | Sc_rollup_refute {rollup; _} + | Sc_rollup_timeout {rollup; _} + | Sc_rollup_execute_outbox_message {rollup; _} + | Sc_rollup_recover_bond {sc_rollup = rollup; staker = _} -> + Sc_rollup.Address.(rollup = node_ctxt.Node_context.rollup_address) + | Dal_publish_slot_header _ -> true + | Reveal _ | Transaction _ | Origination _ | Delegation _ + | Update_consensus_key _ | Register_global_constant _ + | Set_deposits_limit _ | Increase_paid_storage _ | Tx_rollup_origination + | Tx_rollup_submit_batch _ | Tx_rollup_commit _ | Tx_rollup_return_bond _ + | Tx_rollup_finalize_commitment _ | Tx_rollup_remove_commitment _ + | Tx_rollup_rejection _ | Tx_rollup_dispatch_tickets _ | Transfer_ticket _ + | Sc_rollup_originate _ | Zk_rollup_origination _ | Zk_rollup_publish _ + | Zk_rollup_update _ -> + false + in + if not (is_for_my_rollup operation) then return_unit + else + (* Only look at operations that are for the node's rollup *) + let*! () = Daemon_event.included_operation ~finalized operation result in + match result with + | Applied success_result -> + let process = + if finalized then process_finalized_l1_operation + else process_included_l1_operation + in + process node_ctxt head ~source operation success_result + | _ -> + (* No action for non successful operations *) + return_unit + + let process_l1_block_operations ~finalized node_ctxt Layer1.{hash; _} = + let open Lwt_result_syntax in + let* block = Layer1.fetch_tezos_block node_ctxt.Node_context.l1_ctxt hash in + let apply (type kind) accu ~source (operation : kind manager_operation) + result = + let open Lwt_result_syntax in + let* () = accu in + process_l1_operation ~finalized node_ctxt hash ~source operation result + in + let apply_internal (type kind) accu ~source:_ + (_operation : kind Apply_internal_results.internal_operation) + (_result : kind Apply_internal_results.internal_operation_result) = + accu + in + let* () = + Layer1_services.process_manager_operations + return_unit + block.operations + {apply; apply_internal} + in + return_unit + + let before_origination (node_ctxt : _ Node_context.t) Layer1.{level; _} = + let origination_level = Raw_level.to_int32 node_ctxt.genesis_info.level in + level < origination_level + + let rec processed_finalized_block (node_ctxt : _ Node_context.t) + Layer1.({hash; level} as block) = + let open Lwt_result_syntax in + let*! last_finalized = State.get_finalized_head_opt node_ctxt.store in + let already_finalized = + match last_finalized with + | Some Layer1.{level = finalized_level; _} -> level <= finalized_level + | None -> false + in + unless (already_finalized || before_origination node_ctxt block) + @@ fun () -> + let* predecessor = Layer1.get_predecessor_opt node_ctxt.l1_ctxt block in + let* () = + Option.iter_es (processed_finalized_block node_ctxt) predecessor + in + let*! () = Daemon_event.head_processing hash level ~finalized:true in + let* () = process_l1_block_operations ~finalized:true node_ctxt block in + let* () = Components.Commitment.process_head node_ctxt block in + (* At each block, there may be some refutation related actions to + be performed. *) + let* () = Components.Refutation_game.process block node_ctxt in + let*! () = State.mark_finalized_head node_ctxt.store block in + return_unit + + let process_head (node_ctxt : _ Node_context.t) Layer1.({hash; level} as head) + = + let open Lwt_result_syntax in + let*! () = Daemon_event.head_processing hash level ~finalized:false in + let* ctxt = Inbox.process_head node_ctxt head in + let* () = Dal_slots_tracker.process_head node_ctxt head in + let*! () = State.set_block_level_and_hash node_ctxt.store head in + let* () = process_l1_block_operations ~finalized:false node_ctxt head in + (* Avoid storing and publishing commitments if the head is not final. *) + (* Avoid triggering the pvm execution if this has been done before for + this head. *) + let* () = Components.Interpreter.process_head node_ctxt ctxt head in + let* finalized_block, _ = + Layer1.nth_predecessor + node_ctxt.l1_ctxt + node_ctxt.block_finality_time + head + in + let* () = processed_finalized_block node_ctxt finalized_block in + let*! () = State.mark_processed_head node_ctxt.store head in + (* Publishing a commitment when one is available does not depend on the + state of the current head. *) + let* () = Components.Commitment.publish_commitment node_ctxt in + let* () = + Components.Commitment.cement_commitment_if_possible node_ctxt head + in + let*! () = Daemon_event.new_head_processed hash level in + return_unit + + let notify_injector {Node_context.l1_ctxt; _} new_head + (reorg : Layer1.head Injector_common.reorg) = + let open Lwt_result_syntax in + let open Layer1 in + let* new_chain = + List.map_ep + (fun {hash; _} -> fetch_tezos_block l1_ctxt hash) + reorg.new_chain + and* old_chain = + List.map_ep + (fun {hash; _} -> fetch_tezos_block l1_ctxt hash) + reorg.old_chain + in + let*! () = Injector.new_tezos_head new_head {new_chain; old_chain} in + return_unit + + (* [on_layer_1_head node_ctxt head] processes a new head from the L1. It + also processes any missing blocks that were not processed. Every time a + head is processed we also process head~2 as finalized (which may recursively + imply the processing of head~3, etc). *) + let on_layer_1_head node_ctxt head = + let open Lwt_result_syntax in + let* () = + (* Get information about the last cemented commitment to determine the + commitment (if any) to publish next. We do this only once per + chain event to avoid spamming the layer1 node. *) + Components.Commitment.sync_last_cemented_commitment_hash_with_level + node_ctxt + in + let*! old_head = + State.last_processed_head_opt node_ctxt.Node_context.store + in + let old_head = + match old_head with + | Some old_head -> `Head old_head + | None -> + (* if no head has been processed yet, we want to handle all blocks + since, and including, the rollup origination. *) + let origination_level = + Raw_level.to_int32 node_ctxt.genesis_info.level + in + `Level (Int32.pred origination_level) + in + let* reorg = + Layer1.get_tezos_reorg_for_new_head node_ctxt.l1_ctxt old_head head + in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3348 + Rollback state information on reorganization, i.e. for + reorg.old_chain. *) + let* new_head = + Layer1.fetch_tezos_block node_ctxt.l1_ctxt head.Layer1.hash + in + let header = + Block_header.( + raw + { + shell = new_head.header.shell; + protocol_data = new_head.header.protocol_data; + }) + in + let*! () = Daemon_event.processing_heads_iteration reorg.new_chain in + let* () = List.iter_es (process_head node_ctxt) reorg.new_chain in + let* () = notify_injector node_ctxt new_head reorg in + let*! () = Daemon_event.new_heads_processed reorg.new_chain in + let* () = Components.Batcher.batch () in + let* () = Components.Batcher.new_head head in + let*! () = Injector.inject ~header () in + return_unit + + let is_connection_error trace = + TzTrace.fold + (fun yes error -> + yes + || + match error with + | Tezos_rpc_http.RPC_client_errors.( + Request_failed {error = Connection_failed _; _}) -> + true + | _ -> false) + false + trace + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2895 + Use Lwt_stream.fold_es once it is exposed. *) + let daemonize configuration (node_ctxt : _ Node_context.t) = + let open Lwt_result_syntax in + let rec loop (l1_ctxt : Layer1.t) = + let*! () = + Lwt_stream.iter_s + (fun head -> + let open Lwt_syntax in + let* res = on_layer_1_head node_ctxt head in + match res with + | Ok () -> return_unit + | Error trace when is_connection_error trace -> + Format.eprintf + "@[Connection error:@ %a@]@." + pp_print_trace + trace ; + l1_ctxt.stopper () ; + return_unit + | Error e -> + Format.eprintf "%a@.Exiting.@." pp_print_trace e ; + let* _ = Lwt_exit.exit_and_wait 1 in + return_unit) + l1_ctxt.heads + in + let*! () = Event.connection_lost () in + let* l1_ctxt = + Layer1.reconnect configuration node_ctxt.l1_ctxt node_ctxt.store + in + loop l1_ctxt + in + protect @@ fun () -> Lwt.no_cancel @@ loop node_ctxt.l1_ctxt + + let install_finalizer {Node_context.l1_ctxt; store; _} rpc_server = + let open Lwt_syntax in + Lwt_exit.register_clean_up_callback ~loc:__LOC__ @@ fun exit_status -> + let message = l1_ctxt.cctxt#message in + let* () = message "Shutting down L1@." in + let* () = Layer1.shutdown l1_ctxt in + let* () = message "Shutting down RPC server@." in + let* () = Components.RPC_server.shutdown rpc_server in + let* () = message "Shutting down Injector@." in + let* () = Injector.shutdown () in + let* () = message "Shutting down Batcher@." in + let* () = Components.Batcher.shutdown () in + let* () = message "Closing store@." in + let* () = Store.close store in + let* () = Event.shutdown_node exit_status in + Tezos_base_unix.Internal_event_unix.close () + + let check_initial_state_hash {Node_context.cctxt; rollup_address; _} = + let open Lwt_result_syntax in + let* l1_reference_initial_state_hash = + RPC.Sc_rollup.initial_pvm_state_hash + cctxt + (cctxt#chain, cctxt#block) + rollup_address + in + let*! s = PVM.initial_state ~empty:(PVM.State.empty ()) in + let*! l2_initial_state_hash = PVM.state_hash s in + if + not + Sc_rollup.State_hash.( + l1_reference_initial_state_hash = l2_initial_state_hash) + then + let*! () = + Daemon_event.wrong_initial_pvm_state_hash + l2_initial_state_hash + l1_reference_initial_state_hash + in + Lwt_exit.exit_and_raise 1 + else return_unit + + let run node_ctxt configuration = + let open Lwt_result_syntax in + let* () = check_initial_state_hash node_ctxt in + let start () = + let* rpc_server = Components.RPC_server.start node_ctxt configuration in + let (_ : Lwt_exit.clean_up_callback_id) = + install_finalizer node_ctxt rpc_server + in + let*! () = Inbox.start () in + let*! () = Components.Commitment.start () in + let signers = + Configuration.Operator_purpose_map.bindings node_ctxt.operators + |> List.fold_left + (fun acc (purpose, operator) -> + let purposes = + match + Tezos_crypto.Signature.Public_key_hash.Map.find operator acc + with + | None -> [purpose] + | Some ps -> purpose :: ps + in + Tezos_crypto.Signature.Public_key_hash.Map.add + operator + purposes + acc) + Tezos_crypto.Signature.Public_key_hash.Map.empty + |> Tezos_crypto.Signature.Public_key_hash.Map.bindings + |> List.map (fun (operator, purposes) -> + let strategy = + match purposes with + | [Configuration.Add_messages] -> `Delay_block 0.5 + | _ -> `Each_block + in + (operator, strategy, purposes)) + in + let* () = + Injector.init + node_ctxt.cctxt + (Node_context.readonly node_ctxt) + ~data_dir:node_ctxt.data_dir + ~signers + ~retention_period:configuration.injector_retention_period + in + let* () = + match + Configuration.Operator_purpose_map.find + Add_messages + node_ctxt.operators + with + | None -> return_unit + | Some signer -> + Components.Batcher.init configuration.batcher ~signer node_ctxt + in + Lwt.dont_wait + (fun () -> + let*! r = Metrics.metrics_serve configuration.metrics_addr in + match r with + | Ok () -> Lwt.return_unit + | Error err -> + Event.(metrics_ended (Format.asprintf "%a" pp_print_trace err))) + (fun exn -> Event.(metrics_ended_dont_wait (Printexc.to_string exn))) ; + + let*! () = + Event.node_is_ready + ~rpc_addr:configuration.rpc_addr + ~rpc_port:configuration.rpc_port + in + daemonize configuration node_ctxt + in + start () +end + +let run ~data_dir (configuration : Configuration.t) + (cctxt : Protocol_client_context.full) = + let open Lwt_result_syntax in + Random.self_init () (* Initialize random state (for reconnection delays) *) ; + let*! () = Event.starting_node () in + let dal_cctxt = + Dal_node_client.make_unix_cctxt + ~addr:configuration.dal_node_addr + ~port:configuration.dal_node_port + in + let open Configuration in + let* () = + (* Check that the operators are valid keys. *) + Operator_purpose_map.iter_es + (fun _purpose operator -> + let+ _pkh, _pk, _skh = Client_keys.get_key cctxt operator in + ()) + configuration.sc_rollup_node_operators + in + let*! store = + Store.load Read_write Configuration.(default_storage_dir data_dir) + in + let*! context = Context.load Read_write data_dir in + let* l1_ctxt, kind = Layer1.start configuration cctxt store in + let* node_ctxt = + Node_context.init + cctxt + dal_cctxt + ~data_dir + l1_ctxt + configuration.sc_rollup_address + kind + configuration.sc_rollup_node_operators + configuration.fee_parameters + ~loser_mode:configuration.loser_mode + store + context + in + let module Daemon = Make ((val Components.pvm_of_kind node_ctxt.kind)) in + Daemon.run node_ctxt configuration diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.ml new file mode 100644 index 000000000000..8b99312a3dce --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.ml @@ -0,0 +1,175 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "daemon"] + + let head_processing = + declare_3 + ~section + ~name:"sc_rollup_daemon_process_head" + ~msg:"Processing {finalized} head {hash} at level {level}" + ~level:Notice + ("hash", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + ("finalized", Data_encoding.bool) + ~pp3:(fun fmt finalized -> + Format.pp_print_string fmt @@ if finalized then "finalized" else "new") + + let new_head_processed = + declare_2 + ~section + ~name:"sc_rollup_node_layer_1_new_head_processed" + ~msg:"Finished processing layer 1 head {hash} at level {level}" + ~level:Notice + ("hash", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + + let processing_heads_iteration = + declare_3 + ~section + ~name:"sc_rollup_daemon_processing_heads" + ~msg: + "A new iteration of process_heads has been triggered: processing \ + {number} heads from level {from} to level {to}" + ~level:Notice + ("number", Data_encoding.int31) + ("from", Data_encoding.int32) + ("to", Data_encoding.int32) + + let new_heads_processed = + declare_3 + ~section + ~name:"sc_rollup_node_layer_1_new_heads_processed" + ~msg: + "Finished processing {number} layer 1 heads for levels {from} to {to}" + ~level:Notice + ("number", Data_encoding.int31) + ("from", Data_encoding.int32) + ("to", Data_encoding.int32) + + let included_successful_operation = + declare_1 + ~section + ~name:"sc_rollup_daemon_included_successful_operation" + ~msg:"Operation {operation} was included as successful" + ~level:Debug + ("operation", L1_operation.encoding) + ~pp1:L1_operation.pp + + let included_failed_operation = + declare_3 + ~section + ~name:"sc_rollup_daemon_included_failed_operation" + ~msg:"Operation {operation} was included as {status} with error {error}" + ~level:Warning + ("operation", L1_operation.encoding) + ( "status", + Data_encoding.( + string_enum + [ + ("failed", `Failed); + ("backtracked", `Backtracked); + ("skipped", `Skipped); + ]) ) + ("error", Data_encoding.option Environment.Error_monad.trace_encoding) + ~pp1:L1_operation.pp + ~pp3: + (fun ppf -> function + | None -> Format.pp_print_string ppf "none" + | Some e -> Environment.Error_monad.pp_trace ppf e) + + let finalized_successful_operation = + declare_1 + ~section + ~name:"sc_rollup_daemon_finalized_successful_operation" + ~msg:"Operation {operation} was finalized" + ~level:Debug + ("operation", L1_operation.encoding) + ~pp1:L1_operation.pp + + let wrong_initial_pvm_state_hash = + declare_2 + ~section + ~name:"sc_rollup_daemon_incorrect_initial_pvm_state_hash" + ~msg: + "The initial state hash produced by the PVM {actual} is not consistent\n\ + \ with the expected hash {expected}" + ~level:Notice + ("actual", Sc_rollup.State_hash.encoding) + ("expected", Sc_rollup.State_hash.encoding) +end + +let head_processing hash level ~finalized = + Simple.(emit head_processing (hash, level, finalized)) + +let new_head_processed hash level = + Simple.(emit new_head_processed (hash, level)) + +let new_heads_iteration event = function + | oldest :: rest -> + let newest = + match List.rev rest with [] -> oldest | newest :: _ -> newest + in + let number = + Int32.sub newest.Layer1.level oldest.Layer1.level + |> Int32.succ |> Int32.to_int + in + Simple.emit event (number, oldest.level, newest.level) + | [] -> Lwt.return_unit + +let processing_heads_iteration = + new_heads_iteration Simple.processing_heads_iteration + +let new_heads_processed = new_heads_iteration Simple.new_heads_processed + +let included_operation (type kind) ~finalized + (operation : kind Protocol.Alpha_context.manager_operation) + (result : kind Protocol.Apply_results.manager_operation_result) = + let operation = L1_operation.make operation in + match result with + | Applied _ when finalized -> + Simple.(emit finalized_successful_operation) operation + | _ when finalized -> + (* No events for finalized non successful operations *) + Lwt.return_unit + | Applied _ -> Simple.(emit included_successful_operation) operation + | result -> + let status, errors = + match result with + | Applied _ -> assert false + | Failed (_, e) -> (`Failed, Some e) + | Backtracked (_, e) -> (`Backtracked, e) + | Skipped _ -> (`Skipped, None) + in + Simple.(emit included_failed_operation) (operation, status, errors) + +let wrong_initial_pvm_state_hash actual_hash expected_hash = + Simple.(emit wrong_initial_pvm_state_hash (actual_hash, expected_hash)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.mli new file mode 100644 index 000000000000..36407b9ba796 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/daemon_event.mli @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This module defines functions that emit the events used by the smart + contract rollup node daemon (see {!Daemon}). *) + +(** [head_processing hash level ~finalized] emits the event that the + block of the given [hash] and at the given [level] is being processed, and + whether it is [finalized]. *) +val head_processing : + Tezos_crypto.Block_hash.t -> int32 -> finalized:bool -> unit Lwt.t + +(** [new_head_processed hash level] emits the event that the daemon has finished + processing the head of the given [hash] and at the given [level]. *) +val new_head_processed : Tezos_crypto.Block_hash.t -> int32 -> unit Lwt.t + +(** [processing_heads_iteration heads] emits the event that the [heads] are + going to be processed. *) +val processing_heads_iteration : Layer1.head list -> unit Lwt.t + +(** [new_heads_processed heads] emits the event that the [heads] were + processed. *) +val new_heads_processed : Layer1.head list -> unit Lwt.t + +(** [included_operation ~finalized op result] emits an event that an operation + for the rollup was included in a block (or finalized). *) +val included_operation : + finalized:bool -> + 'kind Protocol.Alpha_context.manager_operation -> + 'kind Protocol.Apply_results.manager_operation_result -> + unit Lwt.t + +(** [wrong_initial_pvm_state_hash actual_hash expected_hash] emits the event + that the initial state hash of the PVM [actual_hash] does not agree with + [expected_hash]. *) +val wrong_initial_pvm_state_hash : + Sc_rollup.State_hash.t -> Sc_rollup.State_hash.t -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.ml new file mode 100644 index 000000000000..2c8002f3337a --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.ml @@ -0,0 +1,226 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** If a slot, published at some level L, is expected to be confirmed at level + L+D then, once the confirmation level is over, the rollup node is supposed to: + - Download and save the content of the slot's pages in the store, if the slot + is confirmed; + - Add entries [None] for the slot's pages in the store, if the slot + is not confirmed. *) + +type error += + | Dal_slot_not_found_in_store of Dal.Slot.Header.id + | Dal_invalid_page_for_slot of Dal.Page.t + +let () = + register_error_kind + `Permanent + ~id:"dal_pages_request.dal_slot_not_found_in_store" + ~title:"Dal slot not found in store" + ~description:"The Dal slot whose ID is given is not found in the store" + ~pp:(fun ppf -> + Format.fprintf ppf "Dal slot not found in store %a" Dal.Slot.Header.pp_id) + Data_encoding.(obj1 (req "slot_id" Dal.Slot.Header.id_encoding)) + (function Dal_slot_not_found_in_store slot_id -> Some slot_id | _ -> None) + (fun slot_id -> Dal_slot_not_found_in_store slot_id) ; + register_error_kind + `Permanent + ~id:"dal_pages_request.dal_invalid_page_for_slot" + ~title:"Invalid Dal page requested for slot" + ~description:"The requested Dal page for a given slot is invalid" + ~pp:(fun ppf -> + Format.fprintf ppf "Invalid Dal page requested %a" Dal.Page.pp) + Data_encoding.(obj1 (req "page_id" Dal.Page.encoding)) + (function Dal_invalid_page_for_slot page_id -> Some page_id | _ -> None) + (fun page_id -> Dal_invalid_page_for_slot page_id) + +let store_entry_from_published_level ~dal_attestation_lag ~published_level store + = + State.hash_of_level store + @@ Int32.( + add (of_int dal_attestation_lag) (Raw_level.to_int32 published_level)) + +(* The cache allows to not fetch pages on the DAL node more than necessary. *) +module Pages_cache = + Aches_lwt.Lache.Make + (Aches.Rache.Transfer + (Aches.Rache.LRU) + (struct + include Cryptobox.Commitment + + let hash commitment = + Data_encoding.Binary.to_string_exn + Cryptobox.Commitment.encoding + commitment + |> Hashtbl.hash + end)) + +let get_slot_pages = + let pages_cache = Pages_cache.create 16 (* 130MB *) in + fun dal_cctxt commitment -> + Pages_cache.bind_or_put + pages_cache + commitment + (Dal_node_client.get_slot_pages dal_cctxt) + Lwt.return + +let check_confirmation_status_and_download + ({Node_context.store; dal_cctxt; _} as node_ctxt) ~confirmed_in_block_hash + ~published_in_block_hash index = + let open Lwt_result_syntax in + let* confirmed_in_block_level = + State.level_of_hash node_ctxt.store confirmed_in_block_hash + in + let confirmed_in_head = + Layer1.{hash = confirmed_in_block_hash; level = confirmed_in_block_level} + in + let* is_confirmed = + Dal_slots_tracker.is_slot_confirmed node_ctxt confirmed_in_head index + in + if is_confirmed then + let*! {commitment; _} = + Store.Dal_slots_headers.get + store + ~primary_key:published_in_block_hash + ~secondary_key:index + in + let* pages = get_slot_pages dal_cctxt commitment in + let save_pages node_ctxt = + Dal_slots_tracker.save_confirmed_slot + node_ctxt + confirmed_in_block_hash + index + pages + in + return (Delayed_write_monad.delay_write (Some pages) save_pages) + else + let save_slot node_ctxt = + Dal_slots_tracker.save_unconfirmed_slot + node_ctxt + confirmed_in_block_hash + index + in + return (Delayed_write_monad.delay_write None save_slot) + +let slot_pages ~dal_attestation_lag ({Node_context.store; _} as node_ctxt) + Dal.Slot.Header.{published_level; index} = + let open Lwt_result_syntax in + let*! confirmed_in_block_hash = + store_entry_from_published_level ~dal_attestation_lag ~published_level store + in + let*! processed = + Store.Dal_processed_slots.find + store + ~primary_key:confirmed_in_block_hash + ~secondary_key:index + in + match processed with + | None -> + let*! published_in_block_hash = + State.hash_of_level store (Raw_level.to_int32 published_level) + in + check_confirmation_status_and_download + node_ctxt + ~published_in_block_hash + ~confirmed_in_block_hash + index + | Some `Unconfirmed -> return (Delayed_write_monad.no_write None) + | Some `Confirmed -> + let*! pages = + Store.Dal_slot_pages.list_secondary_keys_with_values + store + ~primary_key:confirmed_in_block_hash + in + let pages = + List.filter_map + (fun ((slot_idx, _page_idx), v) -> + if Dal.Slot_index.equal index slot_idx then Some v else None) + pages + in + return (Delayed_write_monad.no_write (Some pages)) + +let page_content ~dal_attestation_lag ({Node_context.store; _} as node_ctxt) + page_id = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let Dal.Page.{slot_id; page_index} = page_id in + let Dal.Slot.Header.{published_level; index} = slot_id in + let*! confirmed_in_block_hash = + store_entry_from_published_level ~dal_attestation_lag ~published_level store + in + let*! processed = + Store.Dal_processed_slots.find + store + ~primary_key:confirmed_in_block_hash + ~secondary_key:index + in + match processed with + | None -> ( + (* In this case we know that the slot header has not been prefetched + by the rollup node. We check whether it was confirmed by looking at the + block receipt metadata, before requesting the data to the dal node. + While the current logic in `Dal_slots_tracker.donwload_and_save_slots` + guarantees that if `processed = None`, then the slot has been confirmed, + having this additional check in place ensures that we do not rely on + the logic of that function when determining the confirmation status of + a slot. *) + let*! published_in_block_hash = + State.hash_of_level store (Raw_level.to_int32 published_level) + in + let>* pages = + check_confirmation_status_and_download + node_ctxt + ~published_in_block_hash + ~confirmed_in_block_hash + index + in + match pages with + | None -> (* Slot is not confirmed *) return None + | Some (* Slot is confirmed *) pages -> ( + match List.nth_opt pages page_index with + | Some page -> return @@ Some page + | None -> tzfail @@ Dal_invalid_page_for_slot page_id)) + | Some `Unconfirmed -> return None + | Some `Confirmed -> ( + let*! page_opt = + Store.Dal_slot_pages.find + store + ~primary_key:confirmed_in_block_hash + ~secondary_key:(index, page_index) + in + match page_opt with + | Some v -> return @@ Some v + | None -> + let*! pages = + Store.Dal_slot_pages.list_secondary_keys_with_values + store + ~primary_key:confirmed_in_block_hash + in + if page_index < 0 || List.compare_length_with pages page_index <= 0 + then tzfail @@ Dal_invalid_page_for_slot page_id + else tzfail @@ Dal_slot_not_found_in_store slot_id) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.mli new file mode 100644 index 000000000000..2a9a69a71b95 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_pages_request.mli @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** Access DAL slots and pages content. + + This module is a wrapper on top of {!Store.Dal_slot_pages} module to + access DAL slots and pages' data that have been previously fetched by + the rollup node. +*) + +(** This error is returned when a slot, identified by its ID, is not found in + the store. *) +type error += Dal_slot_not_found_in_store of Dal.Slot.Header.id + +(** Retrieve the pages' content of the given slot ID's from the store. + + The function returns [Dal_slot_not_found_in_store] if no entry is found in + the store for the given ID (i.e. no page is registered with or without content). + + If the returned value is [Some pages]], the slot whose ID is given is + supposed to be confirmed and [pages] correspond to the pages of the slot. + Otherwise [None] is returned. + + The function relies on {!Store.Dal_slot_pages}'s invariants to guarantee that: + - the pages are returned in increasing order w.r.t. their indexes in the slot; + - the size of the list, in case it is not empty, is equal to the expected + number of pages in a slot. + + [dal_attestation_lag] is used to retrieve the correct entry in [store]. +*) +val slot_pages : + dal_attestation_lag:int -> + _ Node_context.t -> + Dal.slot_id -> + Dal.Page.content list option Node_context.delayed_write tzresult Lwt.t + +(** Retrieve the content of the page identified by the given ID from the store. + + The function returns [Dal_slot_not_found_in_store] if no entry is found in + the store for the given ID. It + returns [None] in case the entry is found, but the slot is not confirmed. Said + otherwise, some content is only returned for confirmed pages (slots) for + which the content has already been downloaded and saved to the store. + + [dal_attestation_lag] is used to retrieve the correct entry in [store]. +*) +val page_content : + dal_attestation_lag:int -> + _ Node_context.t -> + Dal.Page.t -> + Dal.Page.content option Node_context.delayed_write tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml new file mode 100644 index 000000000000..1279f4e636e9 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml @@ -0,0 +1,430 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +module Block_services = Block_services.Make (Protocol) (Protocol) + +type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"sc_rollup.node.cannot_read_receipt_of_block" + ~title:"Cannot read receipt of block from L1" + ~description:"The receipt of a block could not be read." + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Could not read block receipt for block with hash %a." + Tezos_crypto.Block_hash.pp + hash) + `Temporary + Data_encoding.(obj1 (req "hash" Tezos_crypto.Block_hash.encoding)) + (function Cannot_read_block_metadata hash -> Some hash | _ -> None) + (fun hash -> Cannot_read_block_metadata hash) + +let ancestor_hash ~number_of_levels {Node_context.genesis_info; l1_ctxt; _} head + = + let genesis_level = genesis_info.level in + let rec go number_of_levels (Layer1.{hash; level} as head) = + let open Lwt_result_syntax in + if level < Raw_level.to_int32 genesis_level then return_none + else if number_of_levels = 0 then return_some hash + else + let* pred_head = Layer1.get_predecessor_opt l1_ctxt head in + match pred_head with + | None -> return_none + | Some pred_head -> go (number_of_levels - 1) pred_head + in + go number_of_levels head + +(* Values of type `confirmations_info` are used to catalog the status of slots + published in a given block hash. These values record whether + the slot has been confirmed after the attestation_lag has passed. *) +type confirmations_info = { + (* The hash of the block in which the slots have been published. *) + published_block_hash : Tezos_crypto.Block_hash.t; + (* The indexes of slots that have beenp published in block + with hash `published_block_hash`, and have later been confirmed. *) + confirmed_slots_indexes : Bitset.t; +} + +(** [slots_info node_ctxt head] gathers information about the slot confirmations + of slot indexes. It reads the slot indexes that have been declared available + from [head]'s block receipt. It then returns the hash of + the block where the slot headers have been published and the list of + slot indexes that have been confirmed for that block. *) +let slots_info node_ctxt (Layer1.{hash; _} as head) = + (* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3722 + The case for protocol migrations when the lag constant has + been changed is tricky, especially if the lag is reduced. + Suppose that a slot header is published at the second last level of a + cycle, and the lag is 2. The block is expected to be confirmed at the + first level of the new cycle. However, if during the protocol migration + we reduce the lag to 1, then the slots header will never be confirmed. + *) + let open Lwt_result_syntax in + let lag = + node_ctxt.Node_context.protocol_constants.parametric.dal.attestation_lag + in + (* we are downloading endorsemented for slots at level [level], so + we need to download the data at level [level - lag]. + *) + let* published_slots_block_hash = + ancestor_hash ~number_of_levels:lag node_ctxt head + in + match published_slots_block_hash with + | None -> + (* Less then lag levels have passed from the rollup origination, and + confirmed slots should not be applied *) + return None + | Some published_block_hash -> + let* {metadata; _} = + Layer1.fetch_tezos_block node_ctxt.Node_context.l1_ctxt hash + in + let*? metadata = + Option.to_result + ~none:(TzTrace.make @@ Cannot_read_block_metadata hash) + metadata + in + (* `metadata.protocol_data.dal_attestation` is `None` if we are behind + the `Dal feature flag`: in this case we return an empty slot endorsement. + *) + let confirmed_slots = + Option.value + ~default:Dal.Attestation.empty + metadata.protocol_data.dal_attestation + in + let*! published_slots_indexes = + Store.Dal_slots_headers.list_secondary_keys + node_ctxt.store + ~primary_key:published_block_hash + in + let confirmed_slots_indexes_list = + List.filter + (Dal.Attestation.is_attested confirmed_slots) + published_slots_indexes + in + let*? confirmed_slots_indexes = + Environment.wrap_tzresult + (confirmed_slots_indexes_list + |> List.map Dal.Slot_index.to_int + |> Bitset.from_list) + in + return @@ Some {published_block_hash; confirmed_slots_indexes} + +let is_slot_confirmed node_ctxt (Layer1.{hash; _} as head) slot_index = + let open Lwt_result_syntax in + let* slots_info_opt = slots_info node_ctxt head in + match slots_info_opt with + | None -> tzfail @@ Cannot_read_block_metadata hash + | Some {confirmed_slots_indexes; _} -> + let*? is_confirmed = + Environment.wrap_tzresult + @@ Bitset.mem confirmed_slots_indexes (Dal.Slot_index.to_int slot_index) + in + return is_confirmed + +(* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3884 + avoid going back and forth between bitsets and lists of slot indexes. *) +let to_slot_index_list (constants : Constants.Parametric.t) bitset = + let open Result_syntax in + let all_slots = Misc.(0 --> (constants.dal.number_of_slots - 1)) in + let+ filtered = List.filter_e (Bitset.mem bitset) all_slots in + (* Because the maximum slot index is smaller than the number_of_slots protocol + constants, and this value is smaller than the hard limit imposed for slots, + then Dal.Slot_index.to_int will always return a defined value. See + `src/proto_alpha/lib_protocol/constants_repr.ml`. + *) + List.filter_map Dal.Slot_index.of_int filtered + +(* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/4139. + Use a shared storage between dal and rollup node to store slots data. +*) + +let save_unconfirmed_slot {Node_context.store; _} current_block_hash slot_index + = + (* No page is actually saved *) + Store.Dal_processed_slots.add + store + ~primary_key:current_block_hash + ~secondary_key:slot_index + `Unconfirmed + +let save_confirmed_slot {Node_context.store; _} current_block_hash slot_index + pages = + (* Adding multiple entries with the same primary key amounts to updating the + contents of an in-memory map, hence pages must be added sequentially. *) + let open Lwt_syntax in + let* () = + List.iteri_s + (fun page_number page -> + Store.Dal_slot_pages.add + store + ~primary_key:current_block_hash + ~secondary_key:(slot_index, page_number) + page) + pages + in + Store.Dal_processed_slots.add + store + ~primary_key:current_block_hash + ~secondary_key:slot_index + `Confirmed + +let download_and_save_slots + ({Node_context.store; dal_cctxt; protocol_constants; _} as node_context) + ~current_block_hash {published_block_hash; confirmed_slots_indexes} = + let open Lwt_result_syntax in + let*? all_slots = + Bitset.fill ~length:protocol_constants.parametric.dal.number_of_slots + |> Environment.wrap_tzresult + in + let*? not_confirmed = + Environment.wrap_tzresult + @@ to_slot_index_list protocol_constants.parametric + @@ Bitset.diff all_slots confirmed_slots_indexes + in + let*? _confirmed = + Environment.wrap_tzresult + @@ to_slot_index_list protocol_constants.parametric confirmed_slots_indexes + in + (* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/2766. + As part of the clean rollup storage workflow, we should make sure that + pages for old slots are removed from the storage when not needed anymore. + *) + (* The contents of each slot index are written to a different location on + disk, therefore calls to store contents for different slot indexes can + be parallelized. *) + let*! () = + List.iter_p + (fun s_slot -> + save_unconfirmed_slot node_context current_block_hash s_slot) + not_confirmed + in + let* () = + [] (* Preparing for the pre-fetching logic. *) + |> List.iter_ep (fun s_slot -> + (* slot_header is missing but the slot with index s_slot has been + confirmed. This scenario should not be possible. *) + let*! slot_header_is_stored = + Store.Dal_slots_headers.mem + store + ~primary_key:published_block_hash + ~secondary_key:s_slot + in + if not slot_header_is_stored then + failwith "Slot header was not found in store" + else + let*! {commitment; _} = + Store.Dal_slots_headers.get + store + ~primary_key:published_block_hash + ~secondary_key:s_slot + in + (* The slot with index s_slot is confirmed. We can + proceed retrieving it from the dal node and save it + in the store. *) + let* pages = Dal_node_client.get_slot_pages dal_cctxt commitment in + let*! () = + save_confirmed_slot node_context current_block_hash s_slot pages + in + let*! () = + Dal_slots_tracker_event.slot_has_been_confirmed + s_slot + published_block_hash + current_block_hash + in + return_unit) + in + return_unit + +module Confirmed_slots_history = struct + (** [confirmed_slots_with_headers node_ctxt confirmations_info] returns the + headers of confirmed slot indexes for the block with hash + [confirmations_info.published_block_hash]. *) + let confirmed_slots_with_headers node_ctxt + {published_block_hash; confirmed_slots_indexes; _} = + let open Lwt_result_syntax in + let*? relevant_slots_indexes = + Environment.wrap_tzresult + @@ to_slot_index_list + node_ctxt.Node_context.protocol_constants.parametric + confirmed_slots_indexes + in + let*! confirmed_slots_indexes_with_header = + List.map_p + (fun slot_index -> + Store.Dal_slots_headers.get + node_ctxt.Node_context.store + ~primary_key:published_block_hash + ~secondary_key:slot_index) + relevant_slots_indexes + in + return confirmed_slots_indexes_with_header + + let read_slots_history_from_l1 {Node_context.l1_ctxt = {cctxt; _}; _} block = + let open Lwt_result_syntax in + (* We return the empty Slots_history if DAL is not enabled. *) + let* slots_list_opt = + RPC.Dal.dal_confirmed_slots_history cctxt (cctxt#chain, `Hash (block, 0)) + in + return @@ Option.value slots_list_opt ~default:Dal.Slots_history.genesis + + (** Depending on the rollup's origination level and on the DAL's endorsement + lag, the rollup node should start processing confirmed slots and update its + slots_history and slots_history's cache entries in the store after + [origination_level + attestation_lag] blocks. This function checks if + that level is reached or not. *) + let should_process_dal_slots node_ctxt block_level = + let open Node_context in + let lag = + Int32.of_int + node_ctxt.Node_context.protocol_constants.parametric.dal.attestation_lag + in + let block_level = Raw_level.to_int32 block_level in + let genesis_level = Raw_level.to_int32 node_ctxt.genesis_info.level in + Int32.(block_level >= add lag genesis_level) + + let dal_entry_of_block_hash node_ctxt + Layer1.{hash = block_hash; level = block_level} ~entry_kind ~find ~default + = + let open Lwt_result_syntax in + let open Node_context in + let*! confirmed_slots_history_opt = find node_ctxt.store block_hash in + let block_level = Raw_level.of_int32_exn block_level in + let should_process_dal_slots = + should_process_dal_slots node_ctxt block_level + in + match (confirmed_slots_history_opt, should_process_dal_slots) with + | Some confirmed_dal_slots, true -> return confirmed_dal_slots + | None, false -> default node_ctxt block_hash + | Some _confirmed_dal_slots, false -> + failwith + "The confirmed DAL %S for block hash %a (level = %a) is not expected \ + to be found in the store, but is exists." + entry_kind + Tezos_crypto.Block_hash.pp + block_hash + Raw_level.pp + block_level + | None, true -> + failwith + "The confirmed DAL %S for block hash %a (level = %a) is expected to \ + be found in the store, but is missing." + entry_kind + Tezos_crypto.Block_hash.pp + block_hash + Raw_level.pp + block_level + + let slots_history_of_hash node_ctxt block = + dal_entry_of_block_hash + node_ctxt + block + ~entry_kind:"slots history" + ~find:Store.Dal_confirmed_slots_history.find + ~default:read_slots_history_from_l1 + + let slots_history_cache_of_hash node_ctxt block = + dal_entry_of_block_hash + node_ctxt + block + ~entry_kind:"slots history cache" + ~find:Store.Dal_confirmed_slots_histories.find + ~default:(fun node_ctxt _block -> + let num_slots = + node_ctxt.Node_context.protocol_constants.parametric.dal + .number_of_slots + in + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3788 + Put an accurate value for capacity. The value + `num_slots * 60000` below is chosen based on: + - The number of remembered L1 inboxes in their corresponding + cache (60000), + - The (max) number of slots (num_slots) that could be attested + per L1 block, + - The way the Slots_history.t skip list is implemented (one slot + per cell). *) + return + @@ Dal.Slots_history.History_cache.empty + ~capacity:(Int64.of_int @@ (num_slots * 60000))) + + let update (Node_context.{store; l1_ctxt; _} as node_ctxt) + Layer1.({hash = head_hash; _} as head) confirmation_info = + let open Lwt_result_syntax in + let* slots_to_save = + confirmed_slots_with_headers node_ctxt confirmation_info + in + let slots_to_save = + let open Dal in + List.fast_sort + (fun Slot.Header.{id = {index = a; _}; _} {id = {index = b; _}; _} -> + Slot_index.compare a b) + slots_to_save + in + let* pred = Layer1.get_predecessor l1_ctxt head in + let* slots_history = slots_history_of_hash node_ctxt pred in + let* slots_cache = slots_history_cache_of_hash node_ctxt pred in + let*? slots_history, slots_cache = + Dal.Slots_history.add_confirmed_slot_headers + slots_history + slots_cache + slots_to_save + |> Environment.wrap_tzresult + in + (* The value of [slots_history] computed here is supposed to be equal to the + one computed stored for block [head_hash] on L1, we basically re-do the + computation here because we need to build/maintain the [slots_cache] + bounded cache in case we need it for refutation game. *) + (* TODO/DAL: https://gitlab.com/tezos/tezos/-/issues/3856 + Attempt to improve this process. *) + let*! () = + Store.Dal_confirmed_slots_history.add store head_hash slots_history + in + let*! () = + Store.Dal_confirmed_slots_histories.add store head_hash slots_cache + in + return () +end + +let process_head node_ctxt (Layer1.{hash = head_hash; _} as head) = + let open Lwt_result_syntax in + let* confirmation_info = slots_info node_ctxt head in + match confirmation_info with + | None -> return_unit + | Some confirmation_info -> + let* () = + download_and_save_slots + ~current_block_hash:head_hash + node_ctxt + confirmation_info + in + Confirmed_slots_history.update node_ctxt head confirmation_info + +let slots_history_of_hash = Confirmed_slots_history.slots_history_of_hash + +let slots_history_cache_of_hash = + Confirmed_slots_history.slots_history_cache_of_hash diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli new file mode 100644 index 000000000000..c5da7b2ebcb3 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context + +(** The rollup node keeps the list of dal slots for each block it needs to + process. This is to determine whether the inbox for a given block will need + to be retrieved from the block operations, or from the data availability + layer after lag levels have passed and the slot for the block has been + declared available. + + The state of slots per block is persistent. *) + +type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t + +(** [is_slot_confirmed node_ctxt head slot_index] checks whether the slot + with index [slot_index] has been confirmed in [head]. *) +val is_slot_confirmed : + _ Node_context.t -> Layer1.head -> Dal.Slot_index.t -> bool tzresult Lwt.t + +(** [save_unconfirmed_slot node_ctxt hash slot_index] saves in [node_ctxt.store] + that [slot_index] is unconfirmed in the block with hash in [node_ctxt.store]. +*) +val save_unconfirmed_slot : + Node_context.rw -> Tezos_crypto.Block_hash.t -> Dal.Slot_index.t -> unit Lwt.t + +(** [save_confirmed_slot node_ctxt hash slot_index] saves in [node_ctxt.store] + that [slot_index] is confirmed in the block with hashin [node_ctxt.store]. + The contents of the slot are set to [pages] in [node_ctxt.store]. *) +val save_confirmed_slot : + Node_context.rw -> + Tezos_crypto.Block_hash.t -> + Dal.Slot_index.t -> + Dal.Page.content list -> + unit Lwt.t + +(** [process_head node_ctxt head] performs the following operations: + {ul + {li it reads the endorsements for headers published attestation_lag + levels preceding [head] from the block metadata, determines which + ones the rollup node will download, and stores the results in + [Store.Dal_confirmed_slots].} + } *) +val process_head : Node_context.rw -> Layer1.head -> unit tzresult Lwt.t + +(** [slots_history_of_hash node_ctxt block_hash] returns the DAL confirmed slots + history at the end of the given [block_hash] validation. *) +val slots_history_of_hash : + _ Node_context.t -> + Layer1.head -> + Protocol.Alpha_context.Dal.Slots_history.t tzresult Lwt.t + +(** [slots_history_cache_of_hash node_ctxt block_hash] returns the DAL confirmed + slots history cache at the end of the given [block_hash] validation. *) +val slots_history_cache_of_hash : + _ Node_context.t -> + Layer1.head -> + Protocol.Alpha_context.Dal.Slots_history.History_cache.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker_event.ml new file mode 100644 index 000000000000..c66573018673 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker_event.ml @@ -0,0 +1,49 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "dal_slots_tracker"] + + let slot_has_been_confirmed = + declare_3 + ~section + ~name:"dal_confirmed_slot" + ~msg: + "Slot header for index {slot_index} was published at block \ + {published_hash}. The slot header has been confirmed at \ + {confirmed_hash}. The slot contents will be downloaded." + ~level:Notice + ("slot_index", Dal.Slot_index.encoding) + ("published_hash", Tezos_crypto.Block_hash.encoding) + ("confirmed_hash", Tezos_crypto.Block_hash.encoding) +end + +let slot_has_been_confirmed slot published_hash confirmed_hash = + Simple.(emit slot_has_been_confirmed (slot, published_hash, confirmed_hash)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dune b/src/proto_016_PtMumbai/bin_sc_rollup_node/dune new file mode 100644 index 000000000000..f2aa7ccb6255 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dune @@ -0,0 +1,66 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_sc_rollup_node_alpha) + (public_name octez-sc-rollup-node-alpha) + (package octez-sc-rollup-node-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-client-commands + tezos-stdlib-unix + tezos-client-base + tezos-client-base-unix + tezos-client-alpha + tezos-context.encoding + tezos-context.helpers + tezos-protocol-alpha + tezos-protocol-plugin-alpha + tezos-protocol-alpha.parameters + tezos-rpc + tezos-rpc-http + tezos-rpc-http-server + tezos-workers + tezos_dal_node_services + tezos_dal_node_lib + tezos-shell-services + tezos-sc-rollup-alpha + tezos-layer2-utils-alpha + tezos_layer2_store + data-encoding + irmin-pack + irmin-pack.unix + irmin + aches + aches-lwt + tezos-injector-alpha + tezos-scoru-wasm-fast + tezos-crypto-dal + prometheus-app + octez-node-config) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_client_commands + -open Tezos_stdlib_unix + -open Tezos_client_base + -open Tezos_client_base_unix + -open Tezos_client_alpha + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_alpha_parameters + -open Tezos_workers + -open Tezos_dal_node_lib + -open Tezos_shell_services + -open Tezos_sc_rollup_alpha + -open Tezos_layer2_utils_alpha + -open Tezos_layer2_store + -open Tezos_injector_alpha + -open Tezos_crypto_dal)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/event.ml new file mode 100644 index 000000000000..052b8d8e14ca --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/event.ml @@ -0,0 +1,134 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"] + + let starting_node = + declare_0 + ~section + ~name:"starting_sc_rollup_node" + ~msg:"Starting the smart contract rollup node" + ~level:Notice + () + + let shutdown_node = + declare_1 + ~section + ~name:"stopping_sc_rollup_node" + ~msg:"Stopping the smart contract rollup node" + ~level:Notice + ("exit_status", Data_encoding.int8) + + let node_is_ready = + declare_2 + ~section + ~name:"sc_rollup_node_is_ready" + ~msg:"The smart contract rollup node is listening to {addr}:{port}" + ~level:Notice + ("addr", Data_encoding.string) + ("port", Data_encoding.uint16) + + let rollup_exists = + declare_2 + ~section + ~name:"sc_rollup_node_knows_its_rollup" + ~msg: + "The smart contract rollup node is interacting with rollup {addr} of \ + kind {kind}" + ~level:Notice + ("addr", Protocol.Alpha_context.Sc_rollup.Address.encoding) + ("kind", Data_encoding.string) + + let connection_lost = + declare_0 + ~section + ~name:"sc_rollup_daemon_connection_lost" + ~msg:"connection to the node has been lost" + ~level:Warning + () + + let cannot_connect = + declare_2 + ~section + ~name:"sc_rollup_daemon_cannot_connect" + ~msg:"cannot connect to Tezos node ({count}) {error}" + ~level:Warning + ("count", Data_encoding.int31) + ("error", trace_encoding) + ~pp2:pp_print_trace + + let wait_reconnect = + declare_1 + ~section + ~name:"sc_rollup_daemon_wait_reconnect" + ~msg:"Retrying to connect in {delay}s" + ~level:Warning + ("delay", Data_encoding.float) + + let starting_metrics_server = + declare_2 + ~section + ~name:"starting_metrics_server" + ~msg:"starting metrics server on {host}:{port}" + ~level:Notice + ("host", Data_encoding.string) + ("port", Data_encoding.uint16) + + let metrics_ended = + declare_1 + ~section + ~name:"metrics_ended" + ~level:Error + ~msg:"metrics server ended with error {stacktrace}" + ("stacktrace", Data_encoding.string) +end + +let starting_node = Simple.(emit starting_node) + +let shutdown_node exit_status = Simple.(emit shutdown_node exit_status) + +let node_is_ready ~rpc_addr ~rpc_port = + Simple.(emit node_is_ready (rpc_addr, rpc_port)) + +let rollup_exists ~addr ~kind = + let kind = Protocol.Alpha_context.Sc_rollup.Kind.to_string kind in + Simple.(emit rollup_exists (addr, kind)) + +let connection_lost () = Simple.(emit connection_lost) () + +let cannot_connect ~count error = Simple.(emit cannot_connect) (count, error) + +let wait_reconnect delay = Simple.(emit wait_reconnect) delay + +let starting_metrics_server ~host ~port = + Simple.(emit starting_metrics_server) (host, port) + +let metrics_ended error = Simple.(emit metrics_ended) error + +let metrics_ended_dont_wait error = + Simple.(emit__dont_wait__use_with_care metrics_ended) error diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/event.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/event.mli new file mode 100644 index 000000000000..1c299a519830 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/event.mli @@ -0,0 +1,66 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines functions that emit the events used when the smart + contract rollup node is running (see {!Daemon}). *) + +open Protocol.Alpha_context + +val starting_node : unit -> unit Lwt.t + +val node_is_ready : rpc_addr:string -> rpc_port:int -> unit Lwt.t + +(** [rollup_exists addr kind] emits the event that the smart contract rollup + node is interacting with the rollup at address [addr] and of the given + [kind]. *) +val rollup_exists : addr:Sc_rollup.t -> kind:Sc_rollup.Kind.t -> unit Lwt.t + +(** [shutdown_node exit_status] emits the event that the smart contract rollup + node is stopping with exit status [exit_status]. *) +val shutdown_node : int -> unit Lwt.t + +(** Emits the event that the connection to the Tezos node has been lost. *) +val connection_lost : unit -> unit Lwt.t + +(** [cannot_connect ~count error] emits the event that the rollup node cannot + connect to the Tezos node because of [error] for the [count]'s time. *) +val cannot_connect : count:int -> tztrace -> unit Lwt.t + +(** [wait_reconnect delay] emits the event that the rollup will wait [delay] + seconds before attempting to reconnect to the Tezos node . *) +val wait_reconnect : float -> unit Lwt.t + +(** [starting_metrics_server ~metrics_addr ~metrics_port] emits the event + that the metrics server for the rollup node is starting. *) +val starting_metrics_server : host:string -> port:int -> unit Lwt.t + +(** [metrics_ended error] emits the event that the metrics server + has ended with a failure. *) +val metrics_ended : string -> unit Lwt.t + +(** [metrics_ended error] emits the event that the metrics server + has ended with a failure. + (Doesn't wait for event to be emited. *) +val metrics_ended_dont_wait : string -> unit diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/fuel.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/fuel.ml new file mode 100644 index 000000000000..0ba889d6e61c --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/fuel.ml @@ -0,0 +1,90 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type S = sig + type t + + (** [consume consumption fuel] consumes the [consumption] amount from the + original [fuel]. It returns [None] when the [consumption] is greater + than the original [fuel] or [Some remaining_fuel]. *) + val consume : t -> t -> t option + + (** The amount of fuel required to run one PVM tick. + {[ + one_tick_consumption = of_ticks 1L + ]} + *) + val one_tick_consumption : t + + (** [of_ticks ticks] gives the amount of fuel required to execute the amount + of [ticks]. *) + val of_ticks : int64 -> t + + val is_empty : t -> bool + + (** The maximum number of ticks that can be executed with the given amount of + fuel. + {[ + max_ticks ∘ of_ticks = Fun.id + of_ticks ∘ max_ticks = Fun.id + ]} + *) + val max_ticks : t -> int64 +end + +(** Free fuel where consumption has no effect. *) +module Free : S = struct + type t = Free + + let one_tick_consumption = Free + + let of_ticks _ = Free + + let consume _ tank = Some tank + + let is_empty _ = false + + let max_ticks _ = Int64.max_int +end + +(** Accounted fuel where each tick consumes one unit of fuel. *) +module Accounted : S = struct + type t = int64 + + let of_ticks i = + assert (Int64.compare i 0L >= 0) ; + i + + let one_tick_consumption = 1L + + let consume consumption fuel = + if Int64.compare fuel consumption >= 0 then + Some (Int64.sub fuel consumption) + else None + + let is_empty fuel = Int64.compare fuel 0L <= 0 + + let max_ticks fuel_left = Int64.max 0L fuel_left +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/fueled_pvm.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/fueled_pvm.ml new file mode 100644 index 000000000000..3fa3634b52f3 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/fueled_pvm.ml @@ -0,0 +1,387 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +module Inbox = Sc_rollup.Inbox +open Protocol +open Alpha_context + +module type S = sig + module PVM : Pvm.S + + type fuel + + type eval_result = {state : PVM.state; remaining_fuel : fuel; num_ticks : Z.t} + + (** [eval_block_inbox ~fuel node_ctxt block_hash state] evaluates the + [messages] for the inbox of block [block_hash] in the given [state] of the + PVM and returns the evaluation results containing the new state, the + number of messages, the inbox level and the remaining fuel. *) + val eval_block_inbox : + fuel:fuel -> + _ Node_context.t -> + Tezos_crypto.Block_hash.t -> + PVM.state -> + (PVM.state * Z.t * Raw_level.t * fuel) Node_context.delayed_write tzresult + Lwt.t + + (** [eval_messages ?reveal_map ~fuel node_ctxt ~message_counter_offset state + inbox_level messages] evaluates the [messages] for inbox level + [inbox_level] in the given [state] of the PVM and returns the evaluation + results containing the new state, the remaining fuel, and the number of + ticks for the evaluation of these messages. [message_counter_offset] is + used when we evaluate partial inboxes, such as during simulation. When + [reveal_map] is provided, it is used as an additional source of data for + revelation ticks. *) + val eval_messages : + ?reveal_map:string Sc_rollup_reveal_hash.Map.t -> + fuel:fuel -> + _ Node_context.t -> + message_counter_offset:int -> + PVM.state -> + Raw_level.t -> + Sc_rollup.Inbox_message.t list -> + eval_result Node_context.delayed_write tzresult Lwt.t +end + +module Make (PVM : Pvm.S) = struct + module Make_fueled (F : Fuel.S) : + S with module PVM = PVM and type fuel = F.t = struct + module PVM = PVM + + type fuel = F.t + + type eval_result = { + state : PVM.state; + remaining_fuel : fuel; + num_ticks : Z.t; + } + + let get_reveal ~data_dir reveal_map hash = + let found_in_map = + match reveal_map with + | None -> None + | Some map -> Sc_rollup_reveal_hash.Map.find_opt hash map + in + match found_in_map with + | Some data -> return data + | None -> Reveals.get ~data_dir ~pvm_kind:PVM.kind ~hash + + let continue_with_fuel consumption initial_fuel state f = + let open Delayed_write_monad.Lwt_result_syntax in + match F.consume consumption initial_fuel with + | None -> return (state, initial_fuel, 0L) + | Some fuel_left -> f fuel_left state + + exception Error_wrapper of tztrace + + (** [eval_until_input node_ctxt reveal_map level message_index ~fuel + start_tick failing_ticks state] advances a PVM [state] until it wants + more inputs or there are no more [fuel] (if [Some fuel] is + specified). The evaluation is running under the processing of some + [message_index] at a given [level] and this is the [start_tick] of this + message processing. If some [failing_ticks] are planned by the loser + mode, they will be made. *) + let eval_until_input node_ctxt reveal_map level message_index ~fuel + start_tick failing_ticks state = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let metadata = Node_context.metadata node_ctxt in + let dal_attestation_lag = + node_ctxt.protocol_constants.parametric.dal.attestation_lag + in + let module Builtins = struct + let reveal_preimage hash = + let hash = + (* The payload represents the encoded [Sc_rollup_reveal_hash.t]. We must + decode it properly, instead of converting it byte-for-byte. *) + Data_encoding.Binary.of_string_exn + Sc_rollup_reveal_hash.encoding + hash + in + let*! data = + get_reveal ~data_dir:node_ctxt.data_dir reveal_map hash + in + match data with + | Error error -> + (* The [Error_wrapper] must be caught upstream and converted into a + tzresult. *) + Lwt.fail (Error_wrapper error) + | Ok data -> Lwt.return data + + let reveal_metadata () = + Lwt.return + (Data_encoding.Binary.to_string_exn + Sc_rollup.Metadata.encoding + metadata) + end in + let builtins = (module Builtins : Tezos_scoru_wasm.Builtins.S) in + let eval_tick fuel failing_ticks state = + let max_steps = F.max_ticks fuel in + let normal_eval ?(max_steps = max_steps) state = + Lwt.catch + (fun () -> + let*! state, executed_ticks = + PVM.eval_many ~builtins ~max_steps state + in + return (state, executed_ticks, failing_ticks)) + (function + | Error_wrapper error -> Lwt.return (Error error) + | exn -> raise exn) + in + let failure_insertion_eval state tick failing_ticks' = + let*! () = + Interpreter_event.intended_failure + ~level + ~message_index + ~message_tick:tick + ~internal:true + in + let*! state = PVM.Internal_for_tests.insert_failure state in + return (state, 1L, failing_ticks') + in + match failing_ticks with + | xtick :: failing_ticks' -> + let jump = Int64.(max 0L (pred xtick)) in + if Compare.Int64.(jump = 0L) then + (* Insert the failure in the first tick. *) + failure_insertion_eval state xtick failing_ticks' + else + (* Jump just before the tick where we'll insert a failure. + Nevertheless, we don't execute more than [max_steps]. *) + let max_steps = Int64.max 0L max_steps |> Int64.min max_steps in + let open Delayed_write_monad.Lwt_result_syntax in + let>* state, executed_ticks, _failing_ticks = + normal_eval ~max_steps state + in + (* Insert the failure. *) + let>* state, executed_ticks', failing_ticks' = + failure_insertion_eval state xtick failing_ticks' + in + let executed_ticks = Int64.add executed_ticks executed_ticks' in + return (state, executed_ticks, failing_ticks') + | _ -> normal_eval state + in + let rec go (fuel : fuel) current_tick failing_ticks state = + let*! input_request = PVM.is_input_state state in + if F.is_empty fuel then return (state, fuel, current_tick, failing_ticks) + else + match input_request with + | No_input_required -> ( + let>* next_state, executed_ticks, failing_ticks = + eval_tick fuel failing_ticks state + in + let fuel_executed = F.of_ticks executed_ticks in + match F.consume fuel_executed fuel with + | None -> return (state, fuel, current_tick, failing_ticks) + | Some fuel -> + go + fuel + (Int64.add current_tick executed_ticks) + failing_ticks + next_state) + | Needs_reveal (Reveal_raw_data hash) -> ( + let* data = + get_reveal ~data_dir:node_ctxt.data_dir reveal_map hash + in + let*! next_state = PVM.set_input (Reveal (Raw_data data)) state in + match F.consume F.one_tick_consumption fuel with + | None -> return (state, fuel, current_tick, failing_ticks) + | Some fuel -> + go fuel (Int64.succ current_tick) failing_ticks next_state) + | Needs_reveal Reveal_metadata -> ( + let*! next_state = + PVM.set_input (Reveal (Metadata metadata)) state + in + match F.consume F.one_tick_consumption fuel with + | None -> return (state, fuel, current_tick, failing_ticks) + | Some fuel -> + go fuel (Int64.succ current_tick) failing_ticks next_state) + | Needs_reveal (Request_dal_page page_id) -> ( + let>* content_opt = + Dal_pages_request.page_content + ~dal_attestation_lag + node_ctxt + page_id + in + let*! next_state = + PVM.set_input (Reveal (Dal_page content_opt)) state + in + match F.consume F.one_tick_consumption fuel with + | None -> return (state, fuel, current_tick, failing_ticks) + | Some fuel -> + go fuel (Int64.succ current_tick) failing_ticks next_state) + | Initial | First_after _ -> + return (state, fuel, current_tick, failing_ticks) + in + go fuel start_tick failing_ticks state + + (** [mutate input] corrupts the payload of [input] for testing purposes. *) + let mutate input = + let payload = + Sc_rollup.Inbox_message.unsafe_of_string + "\001to the cheater we promise pain and misery" + in + {input with Sc_rollup.payload} + + (** [feed_input node_ctxt reveal_map level message_index ~fuel + ~failing_ticks state input] feeds [input] (that has a given + [message_index] in inbox of [level]) to the PVM in order to advance + [state] to the next step that requires an input. This function is + controlled by some [fuel] and may introduce intended failures at some + given [failing_ticks]. *) + let feed_input node_ctxt reveal_map level message_index ~fuel ~failing_ticks + state input = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let>* state, fuel, tick, failing_ticks = + eval_until_input + node_ctxt + reveal_map + level + message_index + ~fuel + 0L + failing_ticks + state + in + continue_with_fuel F.one_tick_consumption fuel state @@ fun fuel state -> + let>* input, failing_ticks = + match failing_ticks with + | xtick :: failing_ticks' -> + if xtick = tick then + let*! () = + Interpreter_event.intended_failure + ~level + ~message_index + ~message_tick:tick + ~internal:false + in + return (mutate input, failing_ticks') + else return (input, failing_ticks) + | [] -> return (input, failing_ticks) + in + let*! state = PVM.set_input (Inbox_message input) state in + let>* state, fuel, tick, _failing_ticks = + eval_until_input + node_ctxt + reveal_map + level + message_index + ~fuel + tick + failing_ticks + state + in + return (state, fuel, tick) + + let eval_messages ~reveal_map ~fuel node_ctxt ~message_counter_offset state + inbox_level messages = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let level = Raw_level.to_int32 inbox_level |> Int32.to_int in + (* Iterate the PVM state with all the messages. *) + list_fold_left_i_es + (fun message_counter (state, fuel) message -> + let*? payload = + Sc_rollup.Inbox_message.( + message |> serialize |> Environment.wrap_tzresult) + in + let message_index = message_counter_offset + message_counter in + let message_counter = Z.of_int message_index in + let input = Sc_rollup.{inbox_level; message_counter; payload} in + let failing_ticks = + Loser_mode.is_failure + node_ctxt.Node_context.loser_mode + ~level + ~message_index + in + let>* state, fuel, _executed_ticks = + feed_input + node_ctxt + reveal_map + level + message_index + ~fuel + ~failing_ticks + state + input + in + return (state, fuel)) + (state, fuel) + messages + + let eval_block_inbox ~fuel (Node_context.{store; _} as node_ctxt) hash + (state : PVM.state) : + (PVM.state * Z.t * Raw_level.t * fuel) Node_context.delayed_write + tzresult + Lwt.t = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + (* Obtain inbox and its messages for this block. *) + let*! inbox = Store.Inboxes.find store hash in + match inbox with + | None -> failwith "There is no empty inbox" + | Some inbox -> + let inbox_level = Inbox.inbox_level inbox in + let*! messages = Store.Messages.get store hash in + let num_messages = List.length messages |> Z.of_int in + (* Evaluate all the messages for this level. *) + let>* state, fuel = + eval_messages + ~reveal_map:None + ~fuel + node_ctxt + ~message_counter_offset:0 + state + inbox_level + messages + in + return (state, num_messages, inbox_level, fuel) + + let eval_messages ?reveal_map ~fuel node_ctxt ~message_counter_offset state + inbox_level messages = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let*! initial_tick = PVM.get_tick state in + let>* state, remaining_fuel = + eval_messages + ~reveal_map + ~fuel + node_ctxt + ~message_counter_offset + state + inbox_level + messages + in + let*! final_tick = PVM.get_tick state in + let num_ticks = Sc_rollup.Tick.distance initial_tick final_tick in + return {state; remaining_fuel; num_ticks} + end + + module Free = Make_fueled (Fuel.Free) + module Accounted = Make_fueled (Fuel.Accounted) +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.ml new file mode 100644 index 000000000000..c877f60187f5 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.ml @@ -0,0 +1,265 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* module Constants will be shadowed by Alpha_context.Constansts + once we open Alpha_context, hence we we alias it to Rollup_node_constants +*) +open Protocol +open Alpha_context + +let lift promise = Lwt.map Environment.wrap_tzresult promise + +module State = struct + let add_messages = Store.Messages.add + + let add_inbox = Store.Inboxes.add + + let add_history = Store.Histories.add + + let add_messages_history = Store.Payloads_histories.add + + let level_of_hash = State.level_of_hash + + (** [inbox_of_head node_ctxt store block] returns the latest inbox at the + given [block]. This function always returns [Some inbox] for all levels + at and after the rollup genesis. *) + let inbox_of_head node_ctxt Layer1.{hash = block_hash; level = block_level} = + let open Lwt_result_syntax in + let open Node_context in + let*! possible_inbox = Store.Inboxes.find node_ctxt.store block_hash in + (* Pre-condition: forall l. (l > genesis_level) => inbox[l] <> None. *) + match possible_inbox with + | None -> + (* The inbox exists for each tezos block the rollup should care about. + That is, every block after the origination level. We then join + the bandwagon and build the inbox on top of the protocol's inbox + at the end of the origination level. *) + let genesis_level = Raw_level.to_int32 node_ctxt.genesis_info.level in + if block_level = genesis_level then + let Node_context.{cctxt; _} = node_ctxt in + Plugin.RPC.Sc_rollup.inbox cctxt (cctxt#chain, `Level genesis_level) + else if block_level > genesis_level then + (* Invariant broken, the inbox for this level should exist. *) + failwith + "The inbox for block hash %a (level = %ld) is missing." + Tezos_crypto.Block_hash.pp + block_hash + block_level + else + (* The rollup node should not care about levels before the genesis + level. *) + failwith + "Asking for the inbox before the genesis level (i.e. %ld), out of \ + the scope of the rollup's node" + block_level + | Some inbox -> return inbox + + let history_of_head node_ctxt Layer1.{hash = block_hash; level = block_level} + = + let open Lwt_result_syntax in + let open Node_context in + let*! res = Store.Histories.find node_ctxt.store block_hash in + match res with + | Some history -> return history + | None -> + (* We won't find inboxes for blocks before the rollup origination level. + Fortunately this case will only ever be called once when dealing with + the rollup origination block. After that we would always find an + inbox. *) + let genesis_level = Raw_level.to_int32 node_ctxt.genesis_info.level in + if block_level <= genesis_level then + return @@ Sc_rollup.Inbox.History.empty ~capacity:60000L + else + failwith + "The inbox history for hash %a is missing." + Tezos_crypto.Block_hash.pp + block_hash +end + +let get_messages Node_context.{l1_ctxt; _} head = + let open Lwt_result_syntax in + let* block = Layer1.fetch_tezos_block l1_ctxt head in + let apply (type kind) accu ~source:_ (operation : kind manager_operation) + _result = + let open Result_syntax in + let+ accu = accu in + match operation with + | Sc_rollup_add_messages {messages} -> + let messages = + List.map + (fun message -> Sc_rollup.Inbox_message.External message) + messages + in + List.rev_append messages accu + | _ -> accu + in + let apply_internal (type kind) accu ~source + (operation : kind Apply_internal_results.internal_operation) + (result : + kind Apply_internal_results.successful_internal_operation_result) = + let open Result_syntax in + let* accu = accu in + match (operation, result) with + | ( { + operation = Transaction {destination = Sc_rollup rollup; parameters; _}; + source = Originated sender; + _; + }, + ITransaction_result (Transaction_to_sc_rollup_result _) ) -> + let+ payload = + Environment.wrap_tzresult @@ Script_repr.force_decode parameters + in + let message = + Sc_rollup.Inbox_message.Transfer + {destination = rollup; payload; sender; source} + in + Sc_rollup.Inbox_message.Internal message :: accu + | _ -> return accu + in + let*? rev_messages = + Layer1_services.( + process_applied_manager_operations + (Ok []) + block.operations + {apply; apply_internal}) + in + let ({predecessor; _} : Block_header.shell_header) = block.header.shell in + let* {timestamp = predecessor_timestamp; _} = + Layer1.fetch_tezos_shell_header l1_ctxt predecessor + in + return (List.rev rev_messages, predecessor_timestamp, predecessor) + +let same_inbox_as_layer_1 node_ctxt head_hash inbox = + let open Lwt_result_syntax in + let head_block = `Hash (head_hash, 0) in + let Node_context.{cctxt; _} = node_ctxt in + let* layer1_inbox = + Plugin.RPC.Sc_rollup.inbox cctxt (cctxt#chain, head_block) + in + fail_unless + (Sc_rollup.Inbox.equal layer1_inbox inbox) + (Sc_rollup_node_errors.Inconsistent_inbox {layer1_inbox; inbox}) + +let add_messages ~predecessor_timestamp ~predecessor inbox history messages = + let open Lwt_result_syntax in + lift + @@ let*? ( messages_history, + history, + inbox, + _witness, + messages_with_protocol_internal_messages ) = + Sc_rollup.Inbox.add_all_messages + ~predecessor_timestamp + ~predecessor + history + inbox + messages + in + let Sc_rollup.Inbox.{hash = witness_hash; _} = + Sc_rollup.Inbox.current_level_proof inbox + in + return + ( messages_history, + witness_hash, + history, + inbox, + messages_with_protocol_internal_messages ) + +let process_head (node_ctxt : _ Node_context.t) + Layer1.({level; hash = head_hash} as head) = + let open Lwt_result_syntax in + let first_inbox_level = + Raw_level.to_int32 node_ctxt.genesis_info.level |> Int32.succ + in + if level >= first_inbox_level then + (* + + We compute the inbox of this block using the inbox of its + predecessor. That way, the computation of inboxes is robust + to chain reorganization. + + *) + let* predecessor = Layer1.get_predecessor node_ctxt.l1_ctxt head in + let* inbox = State.inbox_of_head node_ctxt predecessor in + let* history = State.history_of_head node_ctxt predecessor in + let*? level = Environment.wrap_tzresult @@ Raw_level.of_int32 level in + let* ctxt = + if Raw_level.(level <= node_ctxt.Node_context.genesis_info.level) then + (* This is before we have interpreted the boot sector, so we start + with an empty context in genesis *) + return (Context.empty node_ctxt.context) + else Node_context.checkout_context node_ctxt predecessor.hash + in + let* collected_messages, predecessor_timestamp, predecessor_hash = + get_messages node_ctxt head_hash + in + let*! () = + Inbox_event.get_messages + head_hash + (Raw_level.to_int32 level) + (List.length collected_messages) + in + let* ( messages_history, + messages_hash, + history, + inbox, + messages_with_protocol_internal_messages ) = + add_messages + ~predecessor_timestamp + ~predecessor:predecessor_hash + inbox + history + collected_messages + in + let*! () = + State.add_messages + node_ctxt.store + head_hash + messages_with_protocol_internal_messages + in + let* () = same_inbox_as_layer_1 node_ctxt head_hash inbox in + let*! () = + State.add_messages_history node_ctxt.store messages_hash messages_history + in + let*! () = State.add_inbox node_ctxt.store head_hash inbox in + let*! () = State.add_history node_ctxt.store head_hash history in + return ctxt + else return (Context.empty node_ctxt.context) + +let inbox_of_hash node_ctxt hash = + let open Lwt_result_syntax in + let* level = State.level_of_hash node_ctxt.Node_context.store hash in + State.inbox_of_head node_ctxt {hash; level} + +let history_of_hash node_ctxt hash = + let open Lwt_result_syntax in + let* level = State.level_of_hash node_ctxt.Node_context.store hash in + State.history_of_head node_ctxt {hash; level} + +let inbox_of_head = State.inbox_of_head + +let history_of_head = State.history_of_head + +let start () = Inbox_event.starting () diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.mli new file mode 100644 index 000000000000..6f3dbbebc5e6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The rollup node maintains an inbox of incoming messages. + + The incoming messages for a rollup are published on the layer 1. To + maintain the state of its inbox, a rollup node retrieves these + messages each time the tezos blockchain is updated. + + The inbox state is persistent. + +*) + +open Protocol.Alpha_context +open Sc_rollup + +(** [process_head node_ctxt head operations] changes the state of the inbox to + react to [head]. In particular, this process filters the provided + [operations] of the [head] block. *) +val process_head : Node_context.rw -> Layer1.head -> Context.rw tzresult Lwt.t + +(** [inbox_of_hash node_ctxt block_hash] returns the rollup inbox at the end of + the given validation of [block_hash]. *) +val inbox_of_hash : + _ Node_context.t -> Tezos_crypto.Block_hash.t -> Inbox.t tzresult Lwt.t + +(** [history_of_hash node_ctxt block_hash] returns the rollup inbox history at + the end of the given validation of [block_hash]. *) +val history_of_hash : + _ Node_context.t -> + Tezos_crypto.Block_hash.t -> + Inbox.History.t tzresult Lwt.t + +(** [inbox_of_head node_ctxt block_head] returns the rollup inbox at the end of + the given validation of [block_head]. *) +val inbox_of_head : _ Node_context.t -> Layer1.head -> Inbox.t tzresult Lwt.t + +(** [history_of_head node_ctxt block_head] returns the rollup inbox history at + the end of the given validation of [block_head]. *) +val history_of_head : + _ Node_context.t -> Layer1.head -> Inbox.History.t tzresult Lwt.t + +(** [start ()] initializes the inbox to track the messages being published. *) +val start : unit -> unit Lwt.t + +(** [add_messages ~timestamp ~predecessor inbox history messages] adds + [messages] to the [inbox] using {Inbox.add_all_messages}. *) +val add_messages : + predecessor_timestamp:Timestamp.time -> + predecessor:Tezos_crypto.Block_hash.t -> + Inbox.t -> + Inbox.History.t -> + Inbox_message.t list -> + (Inbox_merkelized_payload_hashes.History.t + * Inbox_merkelized_payload_hashes.Hash.t + * Inbox.History.t + * Inbox.t + * Inbox_message.t list) + tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.ml new file mode 100644 index 000000000000..96ca1e6a1394 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "inbox"] + + let starting = + declare_0 + ~section + ~name:"sc_rollup_node_inbox_starting" + ~msg:"Starting inbox tracker of the smart contract rollup node" + ~level:Notice + () + + let stopping = + declare_0 + ~section + ~name:"sc_rollup_node_inbox_stopping" + ~msg:"Stopping inbox tracker of the smart contract rollup node" + ~level:Notice + () + + let get_messages = + declare_3 + ~section + ~name:"sc_rollup_node_layer_1_get_messages" + ~msg: + "Fetching {number_of_messages} messages from block {hash} at level \ + {level}" + ~level:Notice + ("hash", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + ("number_of_messages", Data_encoding.int32) +end + +let starting = Simple.(emit starting) + +let stopping = Simple.(emit stopping) + +let get_messages hash level number_of_messages = + Simple.(emit get_messages (hash, level, Int32.of_int number_of_messages)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.mli new file mode 100644 index 000000000000..c56ea8ad6ae7 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/inbox_event.mli @@ -0,0 +1,35 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines functions that emit the events used by the rollup node + for incoming messages (see {!Inbox}). *) + +val starting : unit -> unit Lwt.t + +val stopping : unit -> unit Lwt.t + +(** [get_messages hash level n] emits the event that [n] messages are being + fetched from the block of the given [hash] at the given [level]. *) +val get_messages : Tezos_crypto.Block_hash.t -> int32 -> int -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.ml new file mode 100644 index 000000000000..87b3ef3cbdee --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.ml @@ -0,0 +1,175 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context +open Injector_sigs + +module Parameters : + PARAMETERS + with type rollup_node_state = Node_context.ro + and type Tag.t = Configuration.purpose = struct + type rollup_node_state = Node_context.ro + + let events_section = ["sc_rollup.injector"] + + module Tag : TAG with type t = Configuration.purpose = struct + type t = Configuration.purpose + + let compare = Stdlib.compare + + let equal = Stdlib.( = ) + + let hash = Hashtbl.hash + + let string_of_tag = Configuration.string_of_purpose + + let pp ppf t = Format.pp_print_string ppf (string_of_tag t) + + let encoding : t Data_encoding.t = + let open Data_encoding in + string_enum + (List.map (fun t -> (string_of_tag t, t)) Configuration.purposes) + end + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3459 + Very coarse approximation for the number of operation we + expect for each block *) + let table_estimated_size : Tag.t -> int = function + | Publish -> 1 + | Add_messages -> 100 + | Cement -> 1 + | Timeout -> 1 + | Refute -> 1 + + let operation_tag (type kind) (operation : kind manager_operation) : + Tag.t option = + match operation with + | Sc_rollup_add_messages _ -> Some Add_messages + | Sc_rollup_cement _ -> Some Cement + | Sc_rollup_publish _ -> Some Publish + | Sc_rollup_timeout _ -> Some Timeout + | Sc_rollup_refute _ -> Some Refute + | _ -> None + + let fee_parameter node_ctxt operation = + match operation_tag operation with + | None -> Configuration.default_fee_parameter () + | Some tag -> Node_context.get_fee_parameter node_ctxt tag + + (* Below are dummy values that are only used to approximate the + size. It is thus important that they remain above the real + values if we want the computed size to be an over_approximation + (without having to do a simulation first). *) + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3461 + Fee parameter per operation. + + See TORU issue: https://gitlab.com/tezos/tezos/-/issues/2812 + check the size, or compute them wrt operation kind *) + let approximate_fee_bound _ _ = + { + fee = Tez.of_mutez_exn 3_000_000L; + counter = Manager_counter.Internal_for_tests.of_int 500_000; + gas_limit = Gas.Arith.integral_of_int_exn 500_000; + storage_limit = Z.of_int 500_000; + } + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3459 + Decide if some batches must have all the operations succeed. See + {!Injector_sigs.Parameter.batch_must_succeed}. *) + let batch_must_succeed _ = `At_least_one + + let retry_unsuccessful_operation (type kind) _node_ctxt + (op : kind manager_operation) status = + let open Lwt_syntax in + match status with + | Backtracked | Skipped | Other_branch -> + (* Always retry backtracked or skipped operations, or operations that + are on another branch because of a reorg: + + - Commitments are always produced on finalized blocks. They don't + need to be recomputed, and as such are valid in another branch. + + - The cementation operations should be re-injected because the node + only keeps track of the last cemented level and the last published + commitment, without rollbacks. + + - Messages posted to an inbox should be re-emitted (i.e. re-queued) + in case of a fork. + + - Timeout should be re-submitted as the timeout may be reached as well + on the other branch. + + - Refutation should be re-submitted in case of fork. + TODO: https://gitlab.com/tezos/tezos/-/issues/3459 + maybe check if game exists on other branch as well. + *) + return Retry + | Failed error -> ( + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4071 + Think about which operations should be retried and when. *) + let is_gas_error = + TzTrace.fold + (fun found -> function + | Environment.Ecoproto_error Gas.Operation_quota_exceeded -> true + | _ -> found) + false + error + in + if is_gas_error then + (* Always retry operations which have gas errors *) + return Retry + else + match op with + | Sc_rollup_timeout _ | Sc_rollup_refute _ | Sc_rollup_cement _ + | Sc_rollup_add_messages _ -> + (* Failing timeout and refutation operations can be ignored. *) + return Forget + | Sc_rollup_publish _ -> return (Abort error) + | Reveal _ | Transaction _ | Origination _ | Delegation _ + | Update_consensus_key _ | Register_global_constant _ + | Set_deposits_limit _ | Increase_paid_storage _ + | Tx_rollup_origination | Tx_rollup_submit_batch _ + | Tx_rollup_commit _ | Tx_rollup_return_bond _ + | Tx_rollup_finalize_commitment _ | Tx_rollup_remove_commitment _ + | Tx_rollup_rejection _ | Tx_rollup_dispatch_tickets _ + | Transfer_ticket _ | Dal_publish_slot_header _ + | Sc_rollup_originate _ | Sc_rollup_execute_outbox_message _ + | Sc_rollup_recover_bond _ | Zk_rollup_origination _ + | Zk_rollup_publish _ | Zk_rollup_update _ -> + (* These operations should never be handled by this injector *) + assert false) + + let operation_tag (type kind) (operation : kind manager_operation) : + Tag.t option = + match operation with + | Sc_rollup_add_messages _ -> Some Add_messages + | Sc_rollup_cement _ -> Some Cement + | Sc_rollup_publish _ -> Some Publish + | Sc_rollup_timeout _ -> Some Timeout + | Sc_rollup_refute _ -> Some Refute + | _ -> None +end + +include Injector_functor.Make (Parameters) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.mli new file mode 100644 index 000000000000..d4b38f8ec62f --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/injector.mli @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include + Injector_sigs.S + with type rollup_node_state := Node_context.ro + and type tag := Configuration.purpose diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.ml new file mode 100644 index 000000000000..711bf576cddd --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.ml @@ -0,0 +1,280 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module type S = sig + module PVM : Pvm.S + + module Accounted_pvm : + Fueled_pvm.S with module PVM = PVM and type fuel = Fuel.Accounted.t + + module Free_pvm : + Fueled_pvm.S with module PVM = PVM and type fuel = Fuel.Free.t + + val process_head : + Node_context.rw -> Context.rw -> Layer1.head -> unit tzresult Lwt.t + + val state_of_tick : + _ Node_context.t -> + Sc_rollup.Tick.t -> + Raw_level.t -> + (PVM.state * PVM.hash) option tzresult Lwt.t + + val state_of_head : + 'a Node_context.t -> + 'a Context.t -> + Layer1.head -> + ('a Context.t * PVM.state) tzresult Lwt.t +end + +module Make (PVM : Pvm.S) : S with module PVM = PVM = struct + module PVM = PVM + module Fueled_pvm = Fueled_pvm.Make (PVM) + module Accounted_pvm = Fueled_pvm.Accounted + module Free_pvm = Fueled_pvm.Free + + (** [get_boot_sector block_hash node_ctxt] fetches the operations in the + [block_hash] and looks for the bootsector used to originate the rollup + we're following. + It must be called with [block_hash.level] = [node_ctxt.genesis_info.level]. + *) + let get_boot_sector block_hash (node_ctxt : _ Node_context.t) = + let open Lwt_result_syntax in + let exception Found_boot_sector of string in + let* block = Layer1.fetch_tezos_block node_ctxt.l1_ctxt block_hash in + let missing_boot_sector () = + failwith + "Boot sector not found in Tezos block %a" + Tezos_crypto.Block_hash.pp + block_hash + in + Lwt.catch + (fun () -> + let apply (type kind) accu ~source:_ + (operation : kind manager_operation) + (result : kind Apply_results.successful_manager_operation_result) = + match (operation, result) with + | ( Sc_rollup_originate {kind; boot_sector; _}, + Sc_rollup_originate_result {address; _} ) + when node_ctxt.rollup_address = address && node_ctxt.kind = kind -> + raise (Found_boot_sector boot_sector) + | _ -> accu + in + let apply_internal (type kind) accu ~source:_ + (_operation : kind Apply_internal_results.internal_operation) + (_result : + kind Apply_internal_results.successful_internal_operation_result) + = + accu + in + let*? () = + Layer1_services.( + process_applied_manager_operations + (Ok ()) + block.operations + {apply; apply_internal}) + in + missing_boot_sector ()) + (function + | Found_boot_sector boot_sector -> return boot_sector + | _ -> missing_boot_sector ()) + + let genesis_state block_hash node_ctxt ctxt = + let open Lwt_result_syntax in + let* boot_sector = get_boot_sector block_hash node_ctxt in + let*! initial_state = PVM.initial_state ~empty:(PVM.State.empty ()) in + let*! genesis_state = PVM.install_boot_sector initial_state boot_sector in + let*! ctxt = PVM.State.set ctxt genesis_state in + return (ctxt, genesis_state) + + let state_of_head node_ctxt ctxt Layer1.{hash; level} = + let open Lwt_result_syntax in + let genesis_level = + Raw_level.to_int32 node_ctxt.Node_context.genesis_info.level + in + if level = genesis_level then genesis_state hash node_ctxt ctxt + else + let*! state = PVM.State.find ctxt in + match state with + | None -> tzfail (Sc_rollup_node_errors.Missing_PVM_state (hash, level)) + | Some state -> return (ctxt, state) + + (** [transition_pvm node_ctxt predecessor head] runs a PVM at the + previous state from block [predecessor] by consuming as many messages + as possible from block [head]. *) + let transition_pvm node_ctxt ctxt predecessor Layer1.{hash; _} = + let open Lwt_result_syntax in + (* Retrieve the previous PVM state from store. *) + let* ctxt, predecessor_state = state_of_head node_ctxt ctxt predecessor in + let* eval_result = + Free_pvm.eval_block_inbox + ~fuel:(Fuel.Free.of_ticks 0L) + node_ctxt + hash + predecessor_state + in + let*! state, num_messages, inbox_level, _fuel = + Delayed_write_monad.apply node_ctxt eval_result + in + (* Write final state to store. *) + let*! ctxt = PVM.State.set ctxt state in + let*! context_hash = Context.commit ctxt in + let*! () = Store.Contexts.add node_ctxt.store hash context_hash in + + (* Compute extra information about the state. *) + let*! initial_tick = PVM.get_tick predecessor_state in + + let*! () = + let open Store.StateHistoryRepr in + let Layer1.{hash = predecessor_hash; _} = predecessor in + let event = + { + tick = initial_tick; + block_hash = hash; + predecessor_hash; + level = inbox_level; + } + in + Store.StateHistory.insert node_ctxt.store event + in + + let*! last_tick = PVM.get_tick state in + (* TODO: #2717 + The number of ticks should not be an arbitrarily-sized integer or + the difference between two ticks should be made an arbitrarily-sized + integer too. + *) + let num_ticks = Sc_rollup.Tick.distance initial_tick last_tick in + let*! () = + Store.StateInfo.add + node_ctxt.store + hash + {num_messages; num_ticks; initial_tick} + in + (* Produce events. *) + let*! state_hash = PVM.state_hash state in + let*! () = + Interpreter_event.transitioned_pvm + inbox_level + state_hash + last_tick + num_messages + in + + return_unit + + (** [process_head node_ctxt head] runs the PVM for the given head. *) + let process_head (node_ctxt : _ Node_context.t) ctxt head = + let open Lwt_result_syntax in + let first_inbox_level = + Raw_level.to_int32 node_ctxt.genesis_info.level |> Int32.succ + in + if head.Layer1.level >= first_inbox_level then + let* predecessor = + Layer1.get_predecessor node_ctxt.Node_context.l1_ctxt head + in + transition_pvm node_ctxt ctxt predecessor head + else if head.Layer1.level = Raw_level.to_int32 node_ctxt.genesis_info.level + then + let* ctxt, state = genesis_state head.hash node_ctxt ctxt in + (* Write final state to store. *) + let*! ctxt = PVM.State.set ctxt state in + let*! context_hash = Context.commit ctxt in + let*! () = Store.Contexts.add node_ctxt.store head.hash context_hash in + + let*! () = + Store.StateInfo.add + node_ctxt.store + head.hash + { + num_messages = Z.zero; + num_ticks = Z.zero; + initial_tick = Sc_rollup.Tick.initial; + } + in + return_unit + else return_unit + + (** [run_for_ticks node_ctxt predecessor_hash hash tick_distance] starts the + evaluation of the inbox at block [hash] for at most [tick_distance]. *) + let run_for_ticks node_ctxt predecessor_hash hash level tick_distance = + let open Lwt_result_syntax in + let open Delayed_write_monad.Lwt_result_syntax in + let pred_level = Raw_level.to_int32 level |> Int32.pred in + let* ctxt = Node_context.checkout_context node_ctxt predecessor_hash in + let* _ctxt, state = + state_of_head + node_ctxt + ctxt + Layer1.{hash = predecessor_hash; level = pred_level} + in + let>* state, _counter, _level, _fuel = + Accounted_pvm.eval_block_inbox + ~fuel:(Fuel.Accounted.of_ticks tick_distance) + node_ctxt + hash + state + in + return state + + (** [state_of_tick node_ctxt tick level] returns [Some (state, hash)] for a + given [tick] if this [tick] happened before [level]. Otherwise, returns + [None].*) + let state_of_tick node_ctxt tick level = + let open Lwt_result_syntax in + let* closest_event = + Store.StateHistory.event_of_largest_tick_before + node_ctxt.Node_context.store + tick + in + match closest_event with + | None -> return None + | Some event -> + if Raw_level.(event.level > level) then return None + else + let tick_distance = + Sc_rollup.Tick.distance tick event.tick |> Z.to_int64 + in + (* TODO: #3384 + We assume that [StateHistory] correctly stores enough + events to compute the state of any tick using + [run_for_ticks]. In particular, this assumes that + [event.block_hash] is the block where the tick + happened. We should test that this is always true because + [state_of_tick] is a critical function. *) + let* state = + run_for_ticks + node_ctxt + event.predecessor_hash + event.block_hash + event.level + tick_distance + in + let state = Delayed_write_monad.ignore state in + let*! hash = PVM.state_hash state in + return (Some (state, hash)) +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.mli new file mode 100644 index 000000000000..9f3fbc27871e --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter.mli @@ -0,0 +1,63 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +module type S = sig + module PVM : Pvm.S + + module Accounted_pvm : + Fueled_pvm.S with module PVM = PVM and type fuel = Fuel.Accounted.t + + module Free_pvm : + Fueled_pvm.S with module PVM = PVM and type fuel = Fuel.Free.t + + (** [process_head node_ctxt head] interprets the messages associated + with a [head] from a chain [event]. This requires the inbox to be updated + beforehand. *) + val process_head : + Node_context.rw -> Context.rw -> Layer1.head -> unit tzresult Lwt.t + + (** [state_of_tick node_ctxt tick level] returns [Some (state, hash)] + for a given [tick] if this [tick] happened before + [level]. Otherwise, returns [None].*) + val state_of_tick : + _ Node_context.t -> + Sc_rollup.Tick.t -> + Raw_level.t -> + (PVM.state * PVM.hash) option tzresult Lwt.t + + (** [state_of_head node_ctxt ctxt head] returns the state corresponding to the + block [head], or the state at rollup genesis if the block is before the + rollup origination. *) + val state_of_head : + 'a Node_context.t -> + 'a Context.t -> + Layer1.head -> + ('a Context.t * PVM.state) tzresult Lwt.t +end + +(** Functor to construct an interpreter for a given PVM. *) +module Make (PVM : Pvm.S) : S with module PVM = PVM diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter_event.ml new file mode 100644 index 000000000000..49152eed397a --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/interpreter_event.ml @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context.Sc_rollup + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "interpreter"] + + let transitioned_pvm = + declare_4 + ~section + ~name:"sc_rollup_node_interpreter_transitioned_pvm" + ~msg: + "Transitioned PVM at inbox level {inbox_level} to {state_hash} at tick \ + {ticks} with {num_messages} messages" + ~level:Notice + ("inbox_level", Protocol.Alpha_context.Raw_level.encoding) + ("state_hash", State_hash.encoding) + ("ticks", Tick.encoding) + ("num_messages", Data_encoding.z) + + let intended_failure = + declare_4 + ~section + ~name:"sc_rollup_node_interpreter_intended_failure" + ~msg: + "Intended failure at level {level} for message indexed {message_index} \ + and at the tick {message_tick} of message processing (internal = \ + {internal})." + ~level:Notice + ("level", Data_encoding.int31) + ("message_index", Data_encoding.int31) + ("message_tick", Data_encoding.int64) + ("internal", Data_encoding.bool) +end + +(** [transition_pvm inbox_level hash tick n] emits the event that a PVM + transition is leading to the state of the given [hash] by + processing [n] messages at [tick]. *) +let transitioned_pvm inbox_level hash tick num_messages = + Simple.(emit transitioned_pvm (inbox_level, hash, tick, num_messages)) + +(** [intended_failure level message_index message_tick internal] emits + the event that an intended failure has been injected at some given + [level], during the processing of a given [message_index] and at + tick [message_tick] during this message processing. [internal] is + [true] if the failure is injected in a PVM internal + step. [internal] is [false] if the failure is injected in the input + to the PVM. *) +let intended_failure ~level ~message_index ~message_tick ~internal = + Simple.(emit intended_failure (level, message_index, message_tick, internal)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.ml new file mode 100644 index 000000000000..95fc601d3ee6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.ml @@ -0,0 +1,325 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Configuration +open Protocol.Alpha_context +open Plugin +open Injector_common + +(** + + Errors + ====== + +*) + +type error += Cannot_find_block of Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"sc_rollup.node.cannot_find_block" + ~title:"Cannot find block from L1" + ~description:"A block couldn't be found from the L1 node" + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Block with hash %a was not found on the L1 node." + Tezos_crypto.Block_hash.pp + hash) + `Temporary + Data_encoding.(obj1 (req "hash" Tezos_crypto.Block_hash.encoding)) + (function Cannot_find_block hash -> Some hash | _ -> None) + (fun hash -> Cannot_find_block hash) + +type error += Cannot_find_predecessor of Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"sc_rollup.node.cannot_find_predecessor" + ~title:"Cannot find block predecessor from L1" + ~description:"A predecessor couldn't be found from the L1 node" + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Block with hash %a has no predecessor on the L1 node." + Tezos_crypto.Block_hash.pp + hash) + `Temporary + Data_encoding.(obj1 (req "hash" Tezos_crypto.Block_hash.encoding)) + (function Cannot_find_predecessor hash -> Some hash | _ -> None) + (fun hash -> Cannot_find_predecessor hash) + +(** + + State + ===== + +*) + +type head = {hash : Tezos_crypto.Block_hash.t; level : int32} + +let head_encoding = + Data_encoding.( + conv + (fun {hash; level} -> (hash, level)) + (fun (hash, level) -> {hash; level}) + (obj2 + (req "hash" Tezos_crypto.Block_hash.encoding) + (req "level" Data_encoding.int32))) + +module Blocks_cache = + Aches_lwt.Lache.Make_option + (Aches.Rache.Transfer (Aches.Rache.LRU) (Tezos_crypto.Block_hash)) + +type blocks_cache = + Protocol_client_context.Alpha_block_services.block_info Blocks_cache.t + +type t = { + blocks_cache : blocks_cache; + heads : head Lwt_stream.t; + cctxt : Protocol_client_context.full; + stopper : Tezos_rpc.Context.stopper; + genesis_info : Sc_rollup.Commitment.genesis_info; +} + +(** + + Helpers + ======= + +*) + +(** [predecessors_of_blocks hashes] given a list of successive hashes, + returns an associative list that associates a hash to its + predecessor in this list. *) +let predecessors_of_blocks hashes = + let rec aux next = function [] -> [] | x :: xs -> (next, x) :: aux x xs in + match hashes with [] -> [] | x :: xs -> aux x xs + +(** [get_predecessor block_hash] returns the predecessor block hash of + some [block_hash] through an RPC to the Tezos node. To limit the + number of RPCs, this information is requested for a batch of hashes + and cached locally. *) +let get_predecessor = + let max_cached = 1023 and max_read = 8 in + let module HM = + Aches.Vache.Map (Aches.Vache.FIFO_Precise) (Aches.Vache.Strong) + (Tezos_crypto.Block_hash) + in + let cache = HM.create max_cached in + fun cctxt (chain : Tezos_shell_services.Chain_services.chain) ancestor -> + let open Lwt_result_syntax in + match HM.find_opt cache ancestor with + | Some pred -> return_some pred + | None -> ( + let* blocks = + Tezos_shell_services.Chain_services.Blocks.list + cctxt + ~chain + ~heads:[ancestor] + ~length:max_read + () + in + match blocks with + | [ancestors] -> ( + List.iter + (fun (h, p) -> HM.replace cache h p) + (predecessors_of_blocks ancestors) ; + match HM.find_opt cache ancestor with + | None -> + (* We have just updated the cache with that information. *) + assert false + | Some predecessor -> return_some predecessor) + | _ -> return_none) + +let get_predecessor_opt state {level; hash} = + let open Lwt_result_syntax in + if level = 0l then return_none + else + let level = Int32.pred level in + let+ hash = get_predecessor state.cctxt state.cctxt#chain hash in + Option.map (fun hash -> {level; hash}) hash + +let get_predecessor state ({hash; _} as head) = + let open Lwt_result_syntax in + let* pred = get_predecessor_opt state head in + match pred with + | None -> tzfail (Cannot_find_predecessor hash) + | Some pred -> return pred + +let rec connect ?(count = 0) ~delay cctxt genesis_info store = + let open Lwt_syntax in + let* () = + if count = 0 then return_unit + else + let fcount = float_of_int (count - 1) in + (* Randomized exponential backoff capped to 1.5h: 1.5^count * delay ± 50% *) + let delay = delay *. (1.5 ** fcount) in + let delay = min delay 3600. in + let randomization_factor = 0.5 (* 50% *) in + let delay = + delay + +. Random.float (delay *. 2. *. randomization_factor) + -. (delay *. randomization_factor) + in + let* () = Event.wait_reconnect delay in + Lwt_unix.sleep delay + in + let* res = Tezos_shell_services.Monitor_services.heads cctxt cctxt#chain in + match res with + | Ok (heads, stopper) -> + let heads = + Lwt_stream.map_s + (fun (hash, Tezos_base.Block_header.{shell = {level; _}; _}) -> + let+ () = Layer1_event.switched_new_head hash level in + {hash; level}) + heads + in + return_ok (heads, stopper) + | Error e -> + let* () = Event.cannot_connect ~count e in + connect ~delay ~count:(count + 1) cctxt genesis_info store + +let start configuration (cctxt : Protocol_client_context.full) store = + let open Lwt_result_syntax in + let*! () = Layer1_event.starting () in + let* kind = + RPC.Sc_rollup.kind + cctxt + (cctxt#chain, cctxt#block) + configuration.sc_rollup_address + () + in + let*! () = Event.rollup_exists ~addr:configuration.sc_rollup_address ~kind in + let* genesis_info = + RPC.Sc_rollup.genesis_info + cctxt + (cctxt#chain, cctxt#block) + configuration.sc_rollup_address + in + let+ heads, stopper = + connect ~delay:configuration.reconnection_delay cctxt genesis_info store + in + ( {cctxt; heads; blocks_cache = Blocks_cache.create 32; stopper; genesis_info}, + kind ) + +let reconnect configuration l1_ctxt store = + let open Lwt_result_syntax in + let* heads, stopper = + connect + ~count:1 + ~delay:configuration.reconnection_delay + l1_ctxt.cctxt + l1_ctxt.genesis_info + store + in + return {l1_ctxt with heads; stopper} + +let shutdown state = + state.stopper () ; + Lwt.return_unit + +(** [fetch_tezos_block l1_ctxt hash] returns a block shell header of + [hash]. Looks for the block in the blocks cache first, and fetches it from + the L1 node otherwise. *) +let fetch_tezos_shell_header l1_ctxt hash = + trace (Cannot_find_block hash) + @@ fetch_tezos_shell_header + l1_ctxt.cctxt + hash + ~find_in_cache:(fun h fetch_by_rpc -> + let res = + Blocks_cache.bind l1_ctxt.blocks_cache h (function + | Some block_info -> Lwt.return_some block_info.header.shell + | None -> Lwt.return_none) + in + match res with Some lwt -> lwt | None -> fetch_by_rpc h) + +(** [fetch_tezos_block l1_ctxt hash] returns a block info given a block + hash. Looks for the block in the blocks cache first, and fetches it from the + L1 node otherwise. *) +let fetch_tezos_block l1_ctxt hash = + trace (Cannot_find_block hash) + @@ fetch_tezos_block l1_ctxt.cctxt hash ~find_in_cache:(fun h fetch_by_rpc -> + Blocks_cache.bind_or_put l1_ctxt.blocks_cache h fetch_by_rpc Lwt.return) + +let nth_predecessor l1_state n block = + let open Lwt_result_syntax in + assert (n >= 0) ; + let rec aux acc n block = + if n = 0 then return (block, acc) + else + let* pred = get_predecessor l1_state block in + (aux [@tailcall]) (block :: acc) (n - 1) pred + in + aux [] n block + +let get_tezos_reorg_for_new_head l1_state old_head new_head = + let open Lwt_result_syntax in + (* old_head and new_head must have the same level when calling aux *) + let rec aux reorg old_head new_head = + if Tezos_crypto.Block_hash.(old_head.hash = new_head.hash) then return reorg + else + let* old_head_pred = get_predecessor l1_state old_head in + let* new_head_pred = get_predecessor l1_state new_head in + let reorg = + { + old_chain = old_head :: reorg.old_chain; + new_chain = new_head :: reorg.new_chain; + } + in + aux reorg old_head_pred new_head_pred + in + (* computing partial reorganization to make old_head and new_head at same + level *) + let distance = Int32.(to_int @@ abs @@ sub new_head.level old_head.level) in + let* old_head, new_head, reorg = + if old_head.level = new_head.level then return (old_head, new_head, no_reorg) + else if old_head.level < new_head.level then + let+ new_head, new_chain = nth_predecessor l1_state distance new_head in + (old_head, new_head, {no_reorg with new_chain}) + else + let+ old_head, old_chain = nth_predecessor l1_state distance old_head in + (old_head, new_head, {no_reorg with old_chain}) + in + assert (old_head.level = new_head.level) ; + aux reorg old_head new_head + +(** Returns the reorganization of L1 blocks (if any) for [new_head]. *) +let get_tezos_reorg_for_new_head l1_state old_head new_head = + let open Lwt_result_syntax in + match old_head with + | `Level l -> + (* No known tezos head, we want all blocks from l. *) + if new_head.level < l then return no_reorg + else + let* _block_at_l, new_chain = + nth_predecessor + l1_state + (Int32.sub new_head.level l |> Int32.to_int) + new_head + in + return {old_chain = []; new_chain} + | `Head old_head -> get_tezos_reorg_for_new_head l1_state old_head new_head diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.mli new file mode 100644 index 000000000000..94457c0091f0 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1.mli @@ -0,0 +1,102 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module maintains information about the layer 1 chain. + + This module follows the evolution of the layer 1 chain by + subscribing to the head monitoring RPC offered by the Tezos node. +*) + +type head = {hash : Tezos_crypto.Block_hash.t; level : int32} + +val head_encoding : head Data_encoding.t + +(** Type of cache holding the last 32 blocks, with their operations. *) +type blocks_cache + +type t = private { + blocks_cache : blocks_cache; + heads : head Lwt_stream.t; + cctxt : Protocol_client_context.full; + stopper : Tezos_rpc.Context.stopper; + genesis_info : Protocol.Alpha_context.Sc_rollup.Commitment.genesis_info; +} + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3311 + Allow to retrieve L1 blocks through Tezos node storage locally. *) + +(** [start configuration cctxt store] returns a stream of [chain_event] obtained + from the monitoring of the Tezos node set up by the client [cctxt]. The + layer 1 state is stored in the data directory declared in + [configuration]. *) +val start : + Configuration.t -> + Protocol_client_context.full -> + _ Store.t -> + (t * Protocol.Alpha_context.Sc_rollup.Kind.t) tzresult Lwt.t + +(** [reconnect cfg l1_ctxt store] reconnects (and retries with delay) to the + Tezos node. The delay for each reconnection is increased with a randomized + exponential backoff (capped to 1.5h) . *) +val reconnect : Configuration.t -> t -> _ Store.t -> t tzresult Lwt.t + +(** [get_predecessor_opt state head] returns the predecessor of block [head], + when [head] is not the genesis block. *) +val get_predecessor_opt : t -> head -> head option tzresult Lwt.t + +(** [get_predecessor state head] returns the predecessor block of [head]. *) +val get_predecessor : t -> head -> head tzresult Lwt.t + +(** [shutdown store] properly shut the layer 1 down. *) +val shutdown : t -> unit Lwt.t + +(** [fetch_tezos_shell_header l1_ctxt hash] returns the block shell header of + [hash]. Looks for the block in the blocks cache first, and fetches it from + the L1 node otherwise. *) +val fetch_tezos_shell_header : + t -> Tezos_crypto.Block_hash.t -> Block_header.shell_header tzresult Lwt.t + +(** [fetch_tezos_block l1_ctxt hash] returns a block info given a block hash. + Looks for the block in the blocks cache first, and fetches it from the L1 + node otherwise. *) +val fetch_tezos_block : + t -> + Tezos_crypto.Block_hash.t -> + Protocol_client_context.Alpha_block_services.block_info tzresult Lwt.t + +(** [nth_predecessor l1_ctxt n head] return [block, history] where [block] is + the nth predecessor of [head] and [history] is the list of blocks between + [block] (excluded) and [head] (included) on the chain *) +val nth_predecessor : t -> int -> head -> (head * head list) tzresult Lwt.t + +(** [get_tezos_reorg_for_new_head l1_ctxt old_head new_head] returns the + reorganization of L1 blocks between [old_head] and [new_head]. If [old_head] + is [`Level l], then it returns the reorganization between [new_head] and + level [l] on the same chain. *) +val get_tezos_reorg_for_new_head : + t -> + [`Head of head | `Level of int32] -> + head -> + head Injector_common.reorg tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.ml new file mode 100644 index 000000000000..f8e2dd1edbb9 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.ml @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "layer_1"] + + let starting = + declare_0 + ~section + ~name:"sc_rollup_node_layer_1_starting" + ~msg:"Starting layer 1 tracker of the smart contract rollup node" + ~level:Notice + () + + let stopping = + declare_0 + ~section + ~name:"sc_rollup_node_layer_1_stopping" + ~msg:"Stopping layer 1 tracker of the smart contract rollup node" + ~level:Notice + () + + let switched_new_head = + declare_2 + ~section + ~name:"sc_rollup_node_layer_1_new_head" + ~msg:"Layer 1 node has switched to head {hash} at level {level}" + ~level:Notice + ("hash", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) +end + +let starting = Simple.(emit starting) + +let stopping = Simple.(emit stopping) + +let switched_new_head hash level = Simple.(emit switched_new_head (hash, level)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.mli new file mode 100644 index 000000000000..467da2e23f72 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/layer1_event.mli @@ -0,0 +1,35 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines functions that emit the events used by the layer 1 chain + (see {!Layer}). *) + +val starting : unit -> unit Lwt.t + +val stopping : unit -> unit Lwt.t + +(** [switched_new_head hash level] emits the event that the layer 1 has notified + a new head with [hash] at some given [level]. *) +val switched_new_head : Tezos_crypto.Block_hash.t -> int32 -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.ml new file mode 100644 index 000000000000..2cfbecea7baf --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.ml @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type failure = {level : int; message_index : int; message_tick : int64} + +let failure_encoding = + let open Data_encoding in + conv + (fun {level; message_index; message_tick} -> + (level, message_index, message_tick)) + (fun (level, message_index, message_tick) -> + {level; message_index; message_tick}) + (obj3 + (req "level" int31) + (req "message_index" int31) + (req "message_tick" int64)) + +let compare_failure {level; message_index; message_tick} f2 = + let open Compare.Int in + match compare level f2.level with + | 0 -> ( + match compare message_index f2.message_index with + | 0 -> Int64.compare message_tick f2.message_tick + | n -> n) + | n -> n + +type t = failure list + +let encoding = Data_encoding.list failure_encoding + +let no_failures = [] + +let make s = + let tokens = String.split_on_char ' ' s in + let rec chop = function + | [] | [""] -> [] + | level :: message_index :: message_tick :: rest -> + { + level = int_of_string level; + message_index = int_of_string message_index; + message_tick = Int64.of_string message_tick; + } + :: chop rest + | _ -> raise Not_found + in + try Some (chop tokens |> List.sort compare_failure) with _ -> None + +let is_failure failures ~level ~message_index = + List.filter_map + (fun f -> + if Compare.Int.(f.level = level && f.message_index = message_index) then + Some f.message_tick + else None) + failures diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.mli new file mode 100644 index 000000000000..24171007e6b0 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/loser_mode.mli @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A list of failures. *) +type t + +val encoding : t Data_encoding.t + +(** [no_failures] are planned. *) +val no_failures : t + +(** [make s] parses a list of integers separated by spaces that is a + periodic sequence of triple [level message_index message_tick] + representing a failure that the rollup node is supposed to make. + This function returns [None] if the input string is not syntactically + correct. *) +val make : string -> t option + +(** [is_failure failures ~level ~message_index] returns [message_ticks] + where a failure is supposed to happen at the point + of the rollup node processing of a given inbox [level], a given + [message_index] and for all [message_ticks]. Ticks are sorted by + increasing order. *) +val is_failure : t -> level:int -> message_index:int -> int64 list diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/main_sc_rollup_node_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/main_sc_rollup_node_016_PtMumbai.ml new file mode 100644 index 000000000000..86cbb3a6a06c --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/main_sc_rollup_node_016_PtMumbai.ml @@ -0,0 +1,361 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* Copyright (c) 2022 Trili Tech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let sc_rollup_address_param = + Tezos_clic.param + ~name:"sc-rollup-address" + ~desc:"The smart-contract rollup address" + (Tezos_clic.parameter (fun _ s -> + match Protocol.Alpha_context.Sc_rollup.Address.of_b58check_opt s with + | None -> failwith "Invalid smart-contract rollup address" + | Some addr -> return addr)) + +let sc_rollup_node_operator_param = + let open Lwt_result_syntax in + Tezos_clic.param + ~name:"operator" + ~desc: + (Printf.sprintf + "Public key hash, or alias, of a smart-contract rollup node operator. \ + An operator can be specialized to a particular purpose by prefixing \ + its key or alias by said purpose, e.g. publish:alias_of_my_operator. \ + The possible purposes are: %s." + (String.concat ", " + @@ Configuration.(List.map string_of_purpose purposes))) + @@ Tezos_clic.parameter + @@ fun cctxt s -> + let parse_pkh s = + let from_alias s = Client_keys.Public_key_hash.find cctxt s in + let from_key s = + match Tezos_crypto.Signature.Public_key_hash.of_b58check_opt s with + | None -> + failwith "Could not read public key hash for rollup node operator" + | Some pkh -> return pkh + in + Client_aliases.parse_alternatives + [("alias", from_alias); ("key", from_key)] + s + in + match String.split ~limit:1 ':' s with + | [_] -> + let+ pkh = parse_pkh s in + `Default pkh + | [purpose; operator_s] -> ( + match Configuration.purpose_of_string purpose with + | Some purpose -> + let+ pkh = parse_pkh operator_s in + `Purpose (purpose, pkh) + | None -> + let+ pkh = parse_pkh s in + `Default pkh) + | _ -> + (* cannot happen due to String.split's implementation. *) + assert false + +let possible_modes = List.map Configuration.string_of_mode Configuration.modes + +let mode_parameter = + Tezos_clic.parameter + ~autocomplete:(fun _ -> return possible_modes) + (fun _ m -> Lwt.return (Configuration.mode_of_string m)) + +let mode_param = + Tezos_clic.param + ~name:"mode" + ~desc: + (Format.asprintf + "@[The mode for the rollup node (%s)@,%a@]" + (String.concat ", " possible_modes) + (Format.pp_print_list (fun fmt mode -> + Format.fprintf + fmt + "- %s: %s" + (Configuration.string_of_mode mode) + (Configuration.description_of_mode mode))) + Configuration.modes) + mode_parameter + +let rpc_addr_arg = + let default = Configuration.default_rpc_addr in + Tezos_clic.arg + ~long:"rpc-addr" + ~placeholder:"rpc-address|ip" + ~doc: + (Format.sprintf + "The address the smart-contract rollup node listens to. Default value \ + is %s" + default) + Client_proto_args.string_parameter + +let metrics_addr_arg = + Tezos_clic.arg + ~long:"metrics-addr" + ~placeholder: + "ADDR:PORT or :PORT (by default ADDR is localhost and PORT is 9932)" + ~doc:"The address of the smart-contract rollup node metrics server." + Client_proto_args.string_parameter + +let dal_node_addr_arg = + let default = Configuration.default_dal_node_addr in + Tezos_clic.arg + ~long:"dal-node-addr" + ~placeholder:"dal-node-address|ip" + ~doc: + (Format.sprintf + "The address of the dal node from which the smart-contract rollup \ + node downloads slots. Default value is %s" + default) + Client_proto_args.string_parameter + +let rpc_port_arg = + let default = Configuration.default_rpc_port |> string_of_int in + Tezos_clic.arg + ~long:"rpc-port" + ~placeholder:"rpc-port" + ~doc: + (Format.sprintf + "The port the smart-contract rollup node listens to. Default value is \ + %s" + default) + Client_proto_args.int_parameter + +let dal_node_port_arg = + let default = Configuration.default_dal_node_port |> string_of_int in + Tezos_clic.arg + ~long:"dal-node-port" + ~placeholder:"dal-node-port" + ~doc: + (Format.sprintf + "The port of the dal node from which the smart-contract rollup node \ + downloads slots from. Default value is %s" + default) + Client_proto_args.int_parameter + +let data_dir_arg = + let default = Configuration.default_data_dir in + Tezos_clic.default_arg + ~long:"data-dir" + ~placeholder:"data-dir" + ~doc: + (Format.sprintf + "The path to the smart-contract rollup node data directory. Default \ + value is %s" + default) + ~default + Client_proto_args.string_parameter + +let loser_mode = + Tezos_clic.default_arg + ~long:"loser-mode" + ~placeholder:"mode" + ~default:"" + ~doc:"Set the rollup node failure points (for test only!)." + (Tezos_clic.parameter (fun _ s -> + match Loser_mode.make s with + | Some t -> return t + | None -> failwith "Invalid syntax for failure points")) + +let reconnection_delay_arg = + let default = + Format.sprintf "%.1f" Configuration.default_reconnection_delay + in + let doc = + Format.asprintf + "The first reconnection delay, in seconds, to wait before reconnecting \ + to the Tezos node. The default delay is %s.\n\ + The actual delay varies to follow a randomized exponential backoff \ + (capped to 1.5h): [1.5^reconnection_attempt * delay ± 50%%]." + default + in + Tezos_clic.arg + ~long:"reconnection-delay" + ~placeholder:"delay" + ~doc + (Tezos_clic.parameter (fun _ p -> + try return (float_of_string p) with _ -> failwith "Cannot read float")) + +let injector_retention_period_arg = + let default = + Configuration.default_injector_retention_period |> string_of_int + in + Tezos_clic.default_arg + ~long:"injector-retention-period" + ~placeholder:"blocks" + ~doc: + (Format.sprintf + "The number of blocks the injector keeps in memory. Decrease to free \ + memory, and increase to be able to query information about included \ + messages for longer. Default value is %s" + default) + ~default + @@ Tezos_clic.map_parameter Client_proto_args.int_parameter ~f:(fun p -> + if p > Configuration.max_injector_retention_period then + Format.ksprintf + Stdlib.failwith + "injector-retention-period should be smaller than %d" + Configuration.max_injector_retention_period ; + p) + +let group = + { + Tezos_clic.name = "sc_rollup.node"; + title = "Commands related to the smart-contract rollup node."; + } + +let config_init_command = + let open Lwt_result_syntax in + let open Tezos_clic in + command + ~group + ~desc:"Configure the smart-contract rollup node." + (args9 + data_dir_arg + rpc_addr_arg + rpc_port_arg + metrics_addr_arg + loser_mode + reconnection_delay_arg + dal_node_addr_arg + dal_node_port_arg + injector_retention_period_arg) + (prefix "init" @@ mode_param + @@ prefixes ["config"; "for"] + @@ sc_rollup_address_param + @@ prefixes ["with"; "operators"] + @@ seq_of_param @@ sc_rollup_node_operator_param) + (fun ( data_dir, + rpc_addr, + rpc_port, + metrics_addr, + loser_mode, + reconnection_delay, + dal_node_addr, + dal_node_port, + injector_retention_period ) + mode + sc_rollup_address + sc_rollup_node_operators + cctxt -> + let open Configuration in + let purposed_operators, default_operators = + List.partition_map + (function + | `Purpose p_operator -> Left p_operator + | `Default operator -> Right operator) + sc_rollup_node_operators + in + let default_operator = + match default_operators with + | [] -> None + | [default_operator] -> Some default_operator + | _ -> Stdlib.failwith "Multiple default operators" + in + let sc_rollup_node_operators = + Configuration.make_purpose_map + purposed_operators + ~default:default_operator + in + let config = + { + sc_rollup_address; + sc_rollup_node_operators; + rpc_addr = Option.value ~default:default_rpc_addr rpc_addr; + rpc_port = Option.value ~default:default_rpc_port rpc_port; + reconnection_delay = + Option.value ~default:default_reconnection_delay reconnection_delay; + dal_node_addr = + Option.value ~default:default_dal_node_addr dal_node_addr; + dal_node_port = + Option.value ~default:default_dal_node_port dal_node_port; + metrics_addr; + fee_parameters = Operator_purpose_map.empty; + mode; + loser_mode; + batcher = Configuration.default_batcher; + injector_retention_period; + } + in + let*? config = check_mode config in + let* () = save ~data_dir config in + let*! () = + cctxt#message + "Smart-contract rollup node configuration written in %s" + (config_filename ~data_dir) + in + return_unit) + +let run_command = + let open Tezos_clic in + let open Lwt_result_syntax in + command + ~group + ~desc:"Run the rollup daemon." + (args7 + data_dir_arg + rpc_addr_arg + rpc_port_arg + dal_node_addr_arg + dal_node_port_arg + reconnection_delay_arg + metrics_addr_arg) + (prefixes ["run"] @@ stop) + (fun ( data_dir, + rpc_addr, + rpc_port, + dal_node_addr, + dal_node_port, + reconnection_delay, + metrics_addr ) + cctxt -> + let* configuration = Configuration.load ~data_dir in + let configuration = + Configuration. + { + configuration with + rpc_addr = Option.value ~default:configuration.rpc_addr rpc_addr; + rpc_port = Option.value ~default:configuration.rpc_port rpc_port; + dal_node_addr = + Option.value ~default:configuration.dal_node_addr dal_node_addr; + dal_node_port = + Option.value ~default:configuration.dal_node_port dal_node_port; + reconnection_delay = + Option.value + ~default:configuration.reconnection_delay + reconnection_delay; + metrics_addr = Option.either metrics_addr configuration.metrics_addr; + } + in + Daemon.run ~data_dir configuration cctxt) + +let sc_rollup_commands () = + List.map + (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + [config_init_command; run_command] + +let select_commands _ _ = + return (sc_rollup_commands () @ Client_helpers_commands.commands ()) + +let () = Client_main_run.run (module Daemon_config) ~select_commands diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.ml new file mode 100644 index 000000000000..1fd5a0b376a6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.ml @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Prometheus + +let sc_rollup_node_registry = CollectorRegistry.create () + +module Cohttp (Server : Cohttp_lwt.S.Server) = struct + let callback _conn req _body = + let open Cohttp in + let open Lwt_syntax in + let uri = Request.uri req in + match (Request.meth req, Uri.path uri) with + | `GET, "/metrics" -> + let* data = CollectorRegistry.(collect sc_rollup_node_registry) in + let body = + Fmt.to_to_string Prometheus_app.TextFormat_0_0_4.output data + in + let headers = + Header.init_with "Content-Type" "text/plain; version=0.0.4" + in + Server.respond_string ~status:`OK ~headers ~body () + | _ -> Server.respond_error ~status:`Bad_request ~body:"Bad request" () +end + +module Metrics_server = Cohttp (Cohttp_lwt_unix.Server) + +let metrics_serve metrics_addr = + let open Lwt_result_syntax in + match metrics_addr with + | Some metrics_addr -> + let* addrs = + Octez_node_config.Config_file.resolve_metrics_addrs + ~default_metrics_port:Configuration.default_metrics_port + metrics_addr + in + let*! () = + List.iter_p + (fun (addr, port) -> + let host = Ipaddr.V6.to_string addr in + let*! () = Event.starting_metrics_server ~host ~port in + let*! ctx = Conduit_lwt_unix.init ~src:host () in + let ctx = Cohttp_lwt_unix.Net.init ~ctx () in + let mode = `TCP (`Port port) in + let callback = Metrics_server.callback in + Cohttp_lwt_unix.Server.create + ~ctx + ~mode + (Cohttp_lwt_unix.Server.make ~callback ())) + addrs + in + return_unit + | None -> return_unit diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.mli new file mode 100644 index 000000000000..8f1e0b33467b --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/metrics.mli @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [metrics_server metrics_addr] runs a server for the rollup metrics on [metrics_addr]. + The metrics are accessible thanks to a [/metrics] request. *) +val metrics_serve : string option -> (unit, tztrace) result Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.ml new file mode 100644 index 000000000000..8d97a3d27eba --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.ml @@ -0,0 +1,123 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type 'a t = { + cctxt : Protocol_client_context.full; + dal_cctxt : Dal_node_client.cctxt; + data_dir : string; + l1_ctxt : Layer1.t; + rollup_address : Sc_rollup.t; + operators : Configuration.operators; + genesis_info : Sc_rollup.Commitment.genesis_info; + injector_retention_period : int; + block_finality_time : int; + kind : Sc_rollup.Kind.t; + fee_parameters : Configuration.fee_parameters; + protocol_constants : Constants.t; + loser_mode : Loser_mode.t; + store : 'a Store.t; + context : 'a Context.index; +} + +type rw = [`Read | `Write] t + +type ro = [`Read] t + +let get_operator node_ctxt purpose = + Configuration.Operator_purpose_map.find purpose node_ctxt.operators + +let is_operator node_ctxt pkh = + Configuration.Operator_purpose_map.exists + (fun _ operator -> Tezos_crypto.Signature.Public_key_hash.(operator = pkh)) + node_ctxt.operators + +let get_fee_parameter node_ctxt purpose = + Configuration.Operator_purpose_map.find purpose node_ctxt.fee_parameters + |> Option.value ~default:(Configuration.default_fee_parameter ~purpose ()) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2901 + The constants are retrieved from the latest tezos block. These constants can + be different from the ones used at the creation at the rollup because of a + protocol amendment that modifies some of them. This need to be fixed when the + rollup nodes will be able to handle the migration of protocol. +*) +let retrieve_constants cctxt = + Protocol.Constants_services.all cctxt (cctxt#chain, cctxt#block) + +let init (cctxt : Protocol_client_context.full) dal_cctxt ~data_dir l1_ctxt + rollup_address kind operators fee_parameters ~loser_mode store context = + let open Lwt_result_syntax in + let+ protocol_constants = retrieve_constants cctxt in + { + cctxt; + dal_cctxt; + data_dir; + l1_ctxt; + rollup_address; + operators; + genesis_info = l1_ctxt.Layer1.genesis_info; + kind; + injector_retention_period = 0; + block_finality_time = 2; + fee_parameters; + protocol_constants; + loser_mode; + store; + context; + } + +let checkout_context node_ctxt block_hash = + let open Lwt_result_syntax in + let*! context_hash = Store.Contexts.find node_ctxt.store block_hash in + let*? context_hash = + match context_hash with + | None -> + error (Sc_rollup_node_errors.Cannot_checkout_context (block_hash, None)) + | Some context_hash -> ok context_hash + in + let*! ctxt = Context.checkout node_ctxt.context context_hash in + match ctxt with + | None -> + tzfail + (Sc_rollup_node_errors.Cannot_checkout_context + (block_hash, Some (Context.hash_to_raw_string context_hash))) + | Some ctxt -> return ctxt + +let metadata node_ctxt = + let address = node_ctxt.rollup_address in + let origination_level = node_ctxt.genesis_info.Sc_rollup.Commitment.level in + Sc_rollup.Metadata.{address; origination_level} + +let readonly (node_ctxt : _ t) = + { + node_ctxt with + store = Store.readonly node_ctxt.store; + context = Context.readonly node_ctxt.context; + } + +type 'a delayed_write = ('a, rw) Delayed_write_monad.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.mli new file mode 100644 index 000000000000..13dfca4d3c1d --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/node_context.mli @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module describes the execution context of the node. *) + +open Protocol +open Alpha_context + +type 'a t = { + cctxt : Protocol_client_context.full; + (** Client context used by the rollup node. *) + dal_cctxt : Dal_node_client.cctxt; + (** Client context to query the dal node. *) + data_dir : string; (** Node data dir. *) + l1_ctxt : Layer1.t; + (** Layer 1 context to fetch blocks and monitor heads, etc.*) + rollup_address : Sc_rollup.t; + (** Smart contract rollup tracked by the rollup node. *) + operators : Configuration.operators; + (** Addresses of the rollup node operators by purposes. *) + genesis_info : Sc_rollup.Commitment.genesis_info; + (** Origination information of the smart contract rollup. *) + injector_retention_period : int; + (** Number of blocks the injector will keep information about included + operations. *) + block_finality_time : int; + (** Deterministic block finality time for the layer 1 protocol. *) + kind : Sc_rollup.Kind.t; (** Kind of the smart contract rollup. *) + fee_parameters : Configuration.fee_parameters; + (** Fee parameters to use when injecting operations in layer 1. *) + protocol_constants : Constants.t; + (** Protocol constants retrieved from the Tezos node. *) + loser_mode : Loser_mode.t; + (** If different from [Loser_mode.no_failures], the rollup node + issues wrong commitments (for tests). *) + store : 'a Store.t; (** The store for the persistent storage. *) + context : 'a Context.index; (** The persistent context for the rollup node. *) +} + +(** Read/write node context {!t}. *) +type rw = [`Read | `Write] t + +(** Read only node context {!t}. *) +type ro = [`Read] t + +(** [get_operator cctxt purpose] returns the public key hash for the operator + who has purpose [purpose], if any. +*) +val get_operator : + _ t -> + Configuration.purpose -> + Tezos_crypto.Signature.Public_key_hash.t option + +(** [is_operator cctxt pkh] returns [true] if the public key hash [pkh] is an + operator for the node (for any purpose). *) +val is_operator : _ t -> Tezos_crypto.Signature.Public_key_hash.t -> bool + +(** [get_fee_parameter cctxt purpose] returns the fee parameter to inject an + operation for a given [purpose]. If no specific fee parameters were + configured for this purpose, returns the default fee parameter for this + purpose. +*) +val get_fee_parameter : _ t -> Configuration.purpose -> Injection.fee_parameter + +(** [init cctxt dal_cctxt ~data_dir l1_ctxt sc_rollup genesis_info kind operators fees + ~loser_mode store context] initialises the rollup representation. The rollup + origination level and kind are fetched via an RPC call to the layer1 node + that [cctxt] uses for RPC requests. +*) +val init : + Protocol_client_context.full -> + Dal_node_client.cctxt -> + data_dir:string -> + Layer1.t -> + Sc_rollup.t -> + Protocol.Alpha_context.Sc_rollup.Kind.t -> + Configuration.operators -> + Configuration.fee_parameters -> + loser_mode:Loser_mode.t -> + 'a Store.t -> + 'a Context.index -> + 'a t tzresult Lwt.t + +(** [checkout_context node_ctxt block_hash] returns the context at block + [block_hash]. *) +val checkout_context : + 'a t -> Tezos_crypto.Block_hash.t -> 'a Context.t tzresult Lwt.t + +(** [metadata node_ctxt] creates a {Sc_rollup.Metadata.t} using the information + stored in [node_ctxt]. *) +val metadata : _ t -> Sc_rollup.Metadata.t + +(** [readonly node_ctxt] returns a read only version of the node context + [node_ctxt]. *) +val readonly : _ t -> ro + +(** Monad for values with delayed write effects in the node context. *) +type 'a delayed_write = ('a, rw) Delayed_write_monad.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.ml new file mode 100644 index 000000000000..27c1f166d986 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.ml @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Node_context +open Protocol.Alpha_context + +module Make (PVM : Pvm.S) = struct + let get_state_of_lcc node_ctxt = + let open Lwt_result_syntax in + let*! lcc_level = + Store.Last_cemented_commitment_level.get node_ctxt.store + in + let*! block_hash = + State.hash_of_level node_ctxt.store (Raw_level.to_int32 lcc_level) + in + let* ctxt = Node_context.checkout_context node_ctxt block_hash in + let*! state = PVM.State.find ctxt in + return state + + let proof_of_output node_ctxt output = + let open Lwt_result_syntax in + let*! commitment_hash = + Store.Last_cemented_commitment_hash.get node_ctxt.store + in + let* state = get_state_of_lcc node_ctxt in + match state with + | None -> + (* + This case should never happen as origination creates an LCC which + must have been considered by the rollup node at startup time. + *) + failwith "Error producing outbox proof (no cemented state in the node)" + | Some state -> ( + let*! proof = PVM.produce_output_proof node_ctxt.context state output in + match proof with + | Ok proof -> + let serialized_proof = + Data_encoding.Binary.to_string_exn PVM.output_proof_encoding proof + in + return @@ (commitment_hash, serialized_proof) + | Error err -> + failwith + "Error producing outbox proof (%a)" + Environment.Error_monad.pp + err) +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.mli new file mode 100644 index 000000000000..d061ca3397c1 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/outbox.mli @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides helper to interact with PVM outboxes. *) + +open Protocol.Alpha_context + +module Make (PVM : Pvm.S) : sig + (** [proof_of_output node_ctxt output] returns the last cemented commitment + hash and the proof of the output in the LCC. *) + val proof_of_output : + Node_context.rw -> + Sc_rollup.output -> + (Store.Last_cemented_commitment_hash.value * string) tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/pvm.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/pvm.ml new file mode 100644 index 000000000000..48f308b3c3fe --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/pvm.ml @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** Desired module type of a PVM from the L2 node's perspective *) +module type S = sig + include + Sc_rollup.PVM.S + with type context = Context.rw_index + and type hash = Sc_rollup.State_hash.t + + (** Kind of the PVM (same as {!name}). *) + val kind : Sc_rollup.Kind.t + + (** [get_tick state] gets the total tick counter for the given PVM state. *) + val get_tick : state -> Sc_rollup.Tick.t Lwt.t + + (** PVM status *) + type status + + (** [get_status state] gives you the current execution status for the PVM. *) + val get_status : state -> status Lwt.t + + (** [string_of_status status] returns a string representation of [status]. *) + val string_of_status : status -> string + + (** [get_outbox outbox_level state] returns a list of outputs + available in the outbox of [state] at a given [outbox_level]. *) + val get_outbox : Raw_level.t -> state -> Sc_rollup.output list Lwt.t + + (** [eval_many ~max_steps s0] returns a state [s1] resulting from the + execution of up to [~max_steps] steps of the rollup at state [s0]. *) + val eval_many : + ?builtins:Tezos_scoru_wasm.Builtins.t -> + ?stop_at_snapshot:bool -> + max_steps:int64 -> + state -> + (state * int64) Lwt.t + + val new_dissection : + default_number_of_sections:int -> + start_chunk:Sc_rollup.Dissection_chunk.t -> + our_stop_chunk:Sc_rollup.Dissection_chunk.t -> + Sc_rollup.Tick.t list + + (** State storage for this PVM. *) + module State : sig + (** [empty ()] is the empty state. *) + val empty : unit -> state + + (** [find context] returns the PVM state stored in the [context], if any. *) + val find : _ Context.t -> state option Lwt.t + + (** [lookup state path] returns the data stored for the path [path] in the + PVM state [state]. *) + val lookup : state -> string list -> bytes option Lwt.t + + (** [set context state] saves the PVM state [state] in the context and + returns the updated context. Note: [set] does not perform any write on + disk, this information must be committed using {!Context.commit}. *) + val set : 'a Context.t -> state -> 'a Context.t Lwt.t + end +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.ml new file mode 100644 index 000000000000..e62800382478 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.ml @@ -0,0 +1,492 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module implements the refutation game logic of the rollup + node. + + When a new L1 block arises, the rollup node asks the L1 node for + the current game it is part of, if any. + + If a game is running and it is the rollup operator turn, the rollup + node injects the next move of the winning strategy. + + If a game is running and it is not the rollup operator turn, the + rollup node asks the L1 node whether the timeout is reached to play + the timeout argument if possible. + + Otherwise, if no game is running, the rollup node asks the L1 node + whether there is a conflict with one of its disputable commitments. If + there is such a conflict with a commitment C', then the rollup node + starts a game to refute C' by starting a game with one of its staker. + +*) +open Protocol + +open Alpha_context + +module type S = sig + module PVM : Pvm.S + + val process : Layer1.head -> Node_context.rw -> unit tzresult Lwt.t +end + +module Make (Interpreter : Interpreter.S) : + S with module PVM = Interpreter.PVM = struct + module PVM = Interpreter.PVM + open Sc_rollup.Game + + let node_role ~self Sc_rollup.Game.Index.{alice; bob} = + if Sc_rollup.Staker.equal alice self then Alice + else if Sc_rollup.Staker.equal bob self then Bob + else (* By validity of [ongoing_game] RPC. *) + assert false + + type role = Our_turn of {opponent : public_key_hash} | Their_turn + + let turn ~self game players = + let Sc_rollup.Game.Index.{alice; bob} = players in + match (node_role ~self players, game.turn) with + | Alice, Alice -> Our_turn {opponent = bob} + | Bob, Bob -> Our_turn {opponent = alice} + | Alice, Bob -> Their_turn + | Bob, Alice -> Their_turn + + (** [inject_next_move node_ctxt source ~refutation ~opponent] submits an L1 + operation (signed by [source]) to issue the next move in the refutation + game. *) + let inject_next_move (node_ctxt : _ Node_context.t) source ~refutation + ~opponent = + let open Lwt_result_syntax in + let refute_operation = + Sc_rollup_refute {rollup = node_ctxt.rollup_address; refutation; opponent} + in + let* _hash = Injector.add_pending_operation ~source refute_operation in + return_unit + + (** This function computes the inclusion/membership proof of the page + identified by [page_id] in the slot whose data are provided in + [slot_data]. *) + let page_membership_proof params page_index slot_data = + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/4048 + Rely on DAL node to compute page membership proof and drop + the dal-crypto dependency from the rollup node. *) + let proof = + let open Result_syntax in + (* The computation of the page's proof below can be a bit costly. In fact, + it involves initialising a cryptobox environment and some non-trivial + crypto processing. *) + let* dal = Cryptobox.make params in + let* polynomial = Cryptobox.polynomial_from_slot dal slot_data in + Cryptobox.prove_page dal polynomial page_index + in + let open Lwt_result_syntax in + match proof with + | Ok proof -> return proof + | Error e -> + failwith + "%s" + (match e with + | `Fail s -> "Fail " ^ s + | `Segment_index_out_of_range -> "Segment_index_out_of_range" + | `Slot_wrong_size s -> "Slot_wrong_size: " ^ s) + + (** When the PVM is waiting for a Dal page input, this function attempts to + retrieve the page's content from the store, the data of its slot. Then it + computes the proof that the page is part of the slot and returns the + content along with the proof. + + If the PVM is not waiting for a Dal page input, or if the slot is known to + be unconfirmed on L1, this function returns [None]. If the data of the + slot are not saved to the store, the function returns a failure + in the error monad. *) + let page_info_from_pvm_state node_ctxt ~dal_attestation_lag + (dal_params : Dal.parameters) start_state = + let open Lwt_result_syntax in + let*! input_request = PVM.is_input_state start_state in + match input_request with + | Sc_rollup.(Needs_reveal (Request_dal_page page_id)) -> ( + let Dal.Page.{slot_id; page_index} = page_id in + let* pages = + Dal_pages_request.slot_pages ~dal_attestation_lag node_ctxt slot_id + in + let*! pages = Delayed_write_monad.apply node_ctxt pages in + match pages with + | None -> return_none (* The slot is not confirmed. *) + | Some pages -> ( + let pages_per_slot = dal_params.slot_size / dal_params.page_size in + (* check invariant that pages' length is correct. *) + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/4031 + It's better to do the check when the slots are saved into disk. *) + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + This check is not resilient to dal parameters change. *) + match List.nth_opt pages page_index with + | Some content -> + let* page_proof = + page_membership_proof dal_params page_index + @@ Bytes.concat Bytes.empty pages + in + return_some (content, page_proof) + | None -> + failwith + "Page index %d too big or negative.\n\ + Number of pages in a slot is %d." + page_index + pages_per_slot)) + | _ -> return_none + + let generate_proof node_ctxt game start_state = + let open Lwt_result_syntax in + (* NOTE: [snapshot_level] and [snapshot_hash] below refer to the level + before the refutation game starts. In fact, snapshotting of inbox and Dal + slots histories at [game.start_level] takes the state of the skip list + at [pred game.start_level]. *) + let snapshot_level_int32 = + Int32.pred Raw_level.(to_int32 game.start_level) + in + let*! snapshot_hash = + State.hash_of_level node_ctxt.Node_context.store snapshot_level_int32 + in + let snapshot_head = + Layer1.{hash = snapshot_hash; level = snapshot_level_int32} + in + let* snapshot_inbox = Inbox.inbox_of_hash node_ctxt snapshot_hash in + let* snapshot_history = Inbox.history_of_hash node_ctxt snapshot_hash in + let* snapshot_ctxt = + Node_context.checkout_context node_ctxt snapshot_hash + in + let snapshot_ctxt_index = Context.index snapshot_ctxt in + let snapshot = Sc_rollup.Inbox.take_snapshot snapshot_inbox in + let* dal_slots_history = + Dal_slots_tracker.slots_history_of_hash node_ctxt snapshot_head + in + let* dal_slots_history_cache = + Dal_slots_tracker.slots_history_cache_of_hash node_ctxt snapshot_head + in + (* We fetch the value of protocol constants at block snapshot_hash + where the game started. *) + let* parametric_constants = + let cctxt = node_ctxt.cctxt in + Protocol.Constants_services.parametric + cctxt + (cctxt#chain, `Hash (snapshot_hash, 0)) + in + let dal_l1_parameters = parametric_constants.dal in + let dal_parameters = dal_l1_parameters.cryptobox_parameters in + let dal_attestation_lag = dal_l1_parameters.attestation_lag in + + let* page_info = + page_info_from_pvm_state + ~dal_attestation_lag + node_ctxt + dal_parameters + start_state + in + let module P = struct + include PVM + + let context = snapshot_ctxt_index + + let state = start_state + + let reveal hash = + let open Lwt_syntax in + let* res = + Reveals.get ~data_dir:node_ctxt.data_dir ~pvm_kind:PVM.kind ~hash + in + match res with Ok data -> return @@ Some data | Error _ -> return None + + module Inbox_with_history = struct + let inbox = snapshot + + let get_history inbox_hash = + Sc_rollup.Inbox.History.find inbox_hash snapshot_history |> Lwt.return + + let get_payloads_history = + Store.Payloads_histories.get node_ctxt.Node_context.store + end + + module Dal_with_history = struct + let confirmed_slots_history = dal_slots_history + + let get_history ptr = + Dal.Slots_history.History_cache.find ptr dal_slots_history_cache + |> Lwt.return + + let dal_attestation_lag = dal_attestation_lag + + let dal_parameters = dal_parameters + + let page_info = page_info + end + end in + let metadata = Node_context.metadata node_ctxt in + let* proof = + trace + (Sc_rollup_node_errors.Cannot_produce_proof + (snapshot_inbox, snapshot_history, game.inbox_level)) + @@ (Sc_rollup.Proof.produce ~metadata (module P) game.inbox_level + >|= Environment.wrap_tzresult) + in + let*? pvm_step = + Sc_rollup.Proof.unserialize_pvm_step ~pvm:(module PVM) proof.pvm_step + |> Environment.wrap_tzresult + in + let proof = {proof with pvm_step} in + let*! res = + Sc_rollup.Proof.valid + ~metadata + snapshot + game.inbox_level + dal_slots_history + dal_parameters + ~dal_attestation_lag + ~pvm:(module PVM) + proof + >|= Environment.wrap_tzresult + in + if Result.is_ok res then return proof else assert false + + let new_dissection ~default_number_of_sections node_ctxt last_level ok + our_view = + let open Lwt_result_syntax in + let state_hash_from_tick tick = + let* r = Interpreter.state_of_tick node_ctxt tick last_level in + return (Option.map snd r) + in + let start_hash, start_tick = ok in + let start_chunk = + Sc_rollup.Dissection_chunk. + {state_hash = Some start_hash; tick = start_tick} + in + let start_hash, start_tick = our_view in + let our_stop_chunk = + Sc_rollup.Dissection_chunk.{state_hash = start_hash; tick = start_tick} + in + Game_helpers.make_dissection + ~state_hash_from_tick + ~start_chunk + ~our_stop_chunk + @@ PVM.new_dissection + ~start_chunk + ~our_stop_chunk + ~default_number_of_sections + + (** [generate_from_dissection ~default_number_of_sections node_ctxt game + dissection] traverses the current [dissection] and returns a move which + performs a new dissection of the execution trace or provides a refutation + proof to serve as the next move of the [game]. *) + let generate_next_dissection ~default_number_of_sections node_ctxt game + dissection = + let open Lwt_result_syntax in + let rec traverse ok = function + | [] -> + (* The game invariant states that the dissection from the + opponent must contain a tick we disagree with. If the + retrieved game does not respect this, we cannot trust the + Tezos node we are connected to and prefer to stop here. *) + tzfail + Sc_rollup_node_errors + .Unreliable_tezos_node_returning_inconsistent_game + | Sc_rollup.Dissection_chunk.{state_hash = their_hash; tick} :: dissection + -> ( + let open Lwt_result_syntax in + let* our = + Interpreter.state_of_tick node_ctxt tick game.inbox_level + in + match (their_hash, our) with + | None, None -> + (* This case is absurd since: [None] can only occur at the + end and the two players disagree about the end. *) + assert false + | Some _, None | None, Some _ -> + return (ok, (Option.map snd our, tick)) + | Some their_hash, Some (_, our_hash) -> + if Sc_rollup.State_hash.equal our_hash their_hash then + traverse (their_hash, tick) dissection + else return (ok, (Some our_hash, tick))) + in + match dissection with + | Sc_rollup.Dissection_chunk.{state_hash = Some hash; tick} :: dissection -> + let* ok, ko = traverse (hash, tick) dissection in + let choice = snd ok in + let* dissection = + new_dissection + ~default_number_of_sections + node_ctxt + game.inbox_level + ok + ko + in + let chosen_section_len = Sc_rollup.Tick.distance (snd ko) choice in + return (choice, chosen_section_len, dissection) + | [] | {state_hash = None; _} :: _ -> + (* + By wellformedness of dissection. + A dissection always starts with a tick of the form [(Some hash, tick)]. + A dissection always contains strictly more than one element. + *) + tzfail + Sc_rollup_node_errors + .Unreliable_tezos_node_returning_inconsistent_game + + let next_move node_ctxt game = + let open Lwt_result_syntax in + let final_move start_tick = + let* start_state = + Interpreter.state_of_tick node_ctxt start_tick game.inbox_level + in + match start_state with + | None -> + tzfail + Sc_rollup_node_errors + .Unreliable_tezos_node_returning_inconsistent_game + | Some (start_state, _start_hash) -> + let* proof = generate_proof node_ctxt game start_state in + let*? pvm_step = + Sc_rollup.Proof.serialize_pvm_step ~pvm:(module PVM) proof.pvm_step + |> Environment.wrap_tzresult + in + let proof = {proof with pvm_step} in + let choice = start_tick in + return {choice; step = Proof proof} + in + + match game.game_state with + | Dissecting {dissection; default_number_of_sections} -> + let* choice, chosen_section_len, dissection = + generate_next_dissection + ~default_number_of_sections + node_ctxt + game + dissection + in + if Z.(equal chosen_section_len one) then final_move choice + else return {choice; step = Dissection dissection} + | Final_move {agreed_start_chunk; refuted_stop_chunk = _} -> + let choice = agreed_start_chunk.tick in + final_move choice + + let play_next_move node_ctxt game self opponent = + let open Lwt_result_syntax in + let* refutation = next_move node_ctxt game in + inject_next_move node_ctxt self ~refutation:(Some refutation) ~opponent + + let play_timeout (node_ctxt : _ Node_context.t) self stakers = + let open Lwt_result_syntax in + let timeout_operation = + Sc_rollup_timeout {rollup = node_ctxt.rollup_address; stakers} + in + let source = + Node_context.get_operator node_ctxt Timeout |> Option.value ~default:self + (* We fallback on the [Refute] operator if none is provided for [Timeout] *) + in + let* _hash = Injector.add_pending_operation ~source timeout_operation in + return_unit + + let timeout_reached ~self head_block node_ctxt players = + let open Lwt_result_syntax in + let Node_context.{rollup_address; cctxt; _} = node_ctxt in + let* game_result = + Plugin.RPC.Sc_rollup.timeout_reached + cctxt + (cctxt#chain, head_block) + rollup_address + players + () + in + let open Sc_rollup.Game in + match game_result with + | Some (Loser {loser; _}) -> + let is_it_me = Tezos_crypto.Signature.Public_key_hash.(self = loser) in + return (not is_it_me) + | _ -> return_false + + let play head_block node_ctxt self game staker1 staker2 = + let open Lwt_result_syntax in + let players = (staker1, staker2) in + let index = Sc_rollup.Game.Index.make staker1 staker2 in + match turn ~self game index with + | Our_turn {opponent} -> play_next_move node_ctxt game self opponent + | Their_turn -> + let* timeout_reached = + timeout_reached ~self head_block node_ctxt players + in + unless timeout_reached @@ fun () -> play_timeout node_ctxt self index + + let ongoing_games head_block node_ctxt self = + let Node_context.{rollup_address; cctxt; _} = node_ctxt in + Plugin.RPC.Sc_rollup.ongoing_refutation_games + cctxt + (cctxt#chain, head_block) + rollup_address + self + () + + let play_opening_move node_ctxt self conflict = + let open Lwt_syntax in + let open Sc_rollup.Refutation_storage in + let* () = Refutation_game_event.conflict_detected conflict in + inject_next_move node_ctxt self ~refutation:None ~opponent:conflict.other + + let start_game_if_conflict head_block node_ctxt self = + let open Lwt_result_syntax in + let Node_context.{rollup_address; cctxt; _} = node_ctxt in + let* conflicts = + Plugin.RPC.Sc_rollup.conflicts + cctxt + (cctxt#chain, head_block) + rollup_address + self + () + in + let*! res = List.iter_es (play_opening_move node_ctxt self) conflicts in + match res with + | Ok r -> return r + | Error + [ + Environment.Ecoproto_error + Sc_rollup_errors.Sc_rollup_game_already_started; + ] -> + (* The game may already be starting in the meantime. So we + ignore this error. *) + return_unit + | Error errs -> Lwt.return (Error errs) + + let process Layer1.{hash; _} node_ctxt = + let head_block = `Hash (hash, 0) in + let open Lwt_result_syntax in + let refute_signer = Node_context.get_operator node_ctxt Refute in + match refute_signer with + | None -> + (* Not injecting refutations, don't play refutation games *) + return_unit + | Some self -> + let* () = start_game_if_conflict head_block node_ctxt self in + let* res = ongoing_games head_block node_ctxt self in + List.iter_es + (fun (game, staker1, staker2) -> + play head_block node_ctxt self game staker1 staker2) + res +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.mli new file mode 100644 index 000000000000..12f7125221b8 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module implements the refutation game logic of the rollup + node. *) +module type S = sig + module PVM : Pvm.S + + (** [process head node_ctxt] reacts to any operations of [head] related to + refutation games. *) + val process : Layer1.head -> Node_context.rw -> unit tzresult Lwt.t +end + +module Make (Interpreter : Interpreter.S) : S with module PVM = Interpreter.PVM diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game_event.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game_event.ml new file mode 100644 index 000000000000..996b63ed080a --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/refutation_game_event.ml @@ -0,0 +1,94 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2880 + Add corresponding .mli file. *) + +module Simple = struct + include Internal_event.Simple + + let section = ["sc_rollup_node"; "refutation_game"] + + let timeout = + declare_1 + ~section + ~name:"sc_rollup_node_timeout" + ~msg: + "The rollup node has been slashed because of a timeout issued by \ + {address}" + ~level:Notice + ("address", Tezos_crypto.Signature.Public_key_hash.encoding) + + let invalid_move = + declare_0 + ~section + ~name:"sc_rollup_node_invalid_move" + ~msg: + "The rollup node is about to make an invalid move in the refutation \ + game! It is stopped to avoid being slashed. The problem should be \ + reported immediately or the rollup node should be upgraded to have a \ + chance to be back before the timeout is reached." + ~level:Notice + () + + let conflict_detected = + declare_5 + ~name:"sc_rollup_node_conflict_detected" + ~msg: + "A conflict has been found with our commitment {our_commitment_hash} \ + at level {level} with staker {other} that hash issued commitment \ + {their_commitment_hash} both based on {parent_commitment_hash}." + ~level:Notice + ("our_commitment_hash", Sc_rollup.Commitment.Hash.encoding) + ("level", Raw_level.encoding) + ("other", Sc_rollup.Staker.encoding) + ("their_commitment_hash", Sc_rollup.Commitment.Hash.encoding) + ("parent_commitment_hash", Sc_rollup.Commitment.Hash.encoding) +end + +let timeout address = Simple.(emit timeout address) + +let invalid_move () = Simple.(emit invalid_move ()) + +let conflict_detected (conflict : Sc_rollup.Refutation_storage.conflict) = + let our_commitment_hash = + Sc_rollup.Commitment.hash_uncarbonated conflict.our_commitment + in + let their_commitment_hash = + Sc_rollup.Commitment.hash_uncarbonated conflict.their_commitment + in + let parent_commitment_hash = conflict.parent_commitment in + let other = conflict.other in + let level = conflict.our_commitment.inbox_level in + Simple.( + emit + conflict_detected + ( our_commitment_hash, + level, + other, + their_commitment_hash, + parent_commitment_hash )) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.ml new file mode 100644 index 000000000000..11b80c5f948d --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.ml @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context +module Reveal_hash = Protocol.Sc_rollup_reveal_hash + +type error += + | Wrong_hash of {found : Reveal_hash.t; expected : Reveal_hash.t} + | Could_not_open_preimage_file of String.t + | Could_not_encode_raw_data + +let () = + register_error_kind + ~id:"sc_rollup.node.wrong_hash_of_reveal_preimage" + ~title:"Hash of reveal preimage is not correct" + ~description:"Hash of reveal preimage is not correct." + ~pp:(fun ppf (found, expected) -> + Format.fprintf + ppf + "The hash of reveal preimage is %a while a value of %a is expected" + Reveal_hash.pp + found + Reveal_hash.pp + expected) + `Permanent + Data_encoding.( + obj2 + (req "found" Reveal_hash.encoding) + (req "expected" Reveal_hash.encoding)) + (function + | Wrong_hash {found; expected} -> Some (found, expected) | _ -> None) + (fun (found, expected) -> Wrong_hash {found; expected}) ; + register_error_kind + ~id:"sc_rollup.node.could_not_open_reveal_preimage_file" + ~title:"Could not open reveal preimage file" + ~description:"Could not open reveal preimage file." + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Could not open file containing preimage of reveal hash %s" + hash) + `Permanent + Data_encoding.(obj1 (req "hash" string)) + (function + | Could_not_open_preimage_file filename -> Some filename | _ -> None) + (fun filename -> Could_not_open_preimage_file filename) ; + register_error_kind + ~id:"sc_rollup.node.could_not_encode_raw_data" + ~title:"Could not encode raw data to reveal" + ~description:"Could not encode raw data to reveal." + ~pp:(fun ppf () -> + Format.pp_print_string + ppf + "Could not encode raw data to reveal with the expected protocol \ + encoding") + `Permanent + Data_encoding.unit + (function Could_not_encode_raw_data -> Some () | _ -> None) + (fun () -> Could_not_encode_raw_data) + +type source = String of string | File of string + +let file_contents filename = + let open Lwt_result_syntax in + Lwt.catch + (fun () -> + let*! contents = Lwt_utils_unix.read_file filename in + return contents) + (fun _ -> tzfail @@ Could_not_open_preimage_file filename) + +let path data_dir pvm_name hash = + let hash = Format.asprintf "%a" Reveal_hash.pp hash in + Filename.(concat (concat data_dir pvm_name) hash) + +let get ~data_dir ~pvm_kind ~hash = + let open Lwt_result_syntax in + let filename = path data_dir (Sc_rollup.Kind.to_string pvm_kind) hash in + let* contents = file_contents filename in + let*? () = + let contents_hash = + Reveal_hash.hash_string ~scheme:Reveal_hash.Blake2B [contents] + in + error_unless + (Reveal_hash.equal contents_hash hash) + (Wrong_hash {found = contents_hash; expected = hash}) + in + let* _encoded = + (* Check that the reveal input can be encoded within the bounds enforced by + the protocol. *) + trace Could_not_encode_raw_data + @@ protect + @@ fun () -> + Data_encoding.Binary.to_bytes_exn + Sc_rollup.input_encoding + (Reveal (Raw_data contents)) + |> return + in + return contents diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.mli new file mode 100644 index 000000000000..56950f44c8b6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/reveals.mli @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides basic support for reveals. + + The rollup can ask for data being the reveal of some hash. This + allows transferring data directly to the rollup without going + through the L1 inbox. + + Data length must be under 4KB to be refutable in a single L1 + operation. + + Data must be made available by off-chain mechanisms: it is the + responsibility of the rollup kernel to make sure that the reveal + data is available: otherwise, there is a potential safety issue. + + For the moment, the support is basic and mostly manual as the operator + needs to explicitly import a file in the rollup node data directoy to + enable the rollup node to answer reveal requests. + +*) + +(* FIXME:https://gitlab.com/tezos/tezos/-/issues/3854 + + We should probably have a mechanism to let the kernel declare + sources of reveal data so that the rollup node can automatically + download data in advance. *) + +(** Source of data *) +type source = + | String of string (** A string containing the whole data *) + | File of string + (** A file name whose associated file contains the whole data *) + +(** [get ~data_dir ~pvm_name ~hash] retrieves the data associated with + the reveal hash [hash] from disk. May fail with: + {ul + {li [Wrong_hash {found; expected}] where [expected = hash], and + [found <> hash], if the data is retrieved and hashes to the wrong + hash [found],} + {li [Could_not_open_preimage_file filename] if the function tries to + retrieve the data from [filename], but it cannot read the contents + of the file.} + {li [Could_not_encode_raw_data] if the data is too large (more than + 4kB) to be revealed.} + } *) +val get : + data_dir:string -> + pvm_kind:Protocol.Alpha_context.Sc_rollup.Kind.t -> + hash:Protocol.Sc_rollup_reveal_hash.t -> + string tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/sc_rollup_node_errors.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/sc_rollup_node_errors.ml new file mode 100644 index 000000000000..1328c3c30f94 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/sc_rollup_node_errors.ml @@ -0,0 +1,249 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +let tez_sym = "\xEA\x9C\xA9" + +type error += + | Cannot_produce_proof of + Sc_rollup.Inbox.t * Sc_rollup.Inbox.History.t * Raw_level.t + | Missing_mode_operators of {mode : string; missing_operators : string list} + | Bad_minimal_fees of string + | Commitment_predecessor_should_be_LCC of Sc_rollup.Commitment.t + | Unreliable_tezos_node_returning_inconsistent_game + | Inconsistent_inbox of { + layer1_inbox : Sc_rollup.Inbox.t; + inbox : Sc_rollup.Inbox.t; + } + | Missing_PVM_state of Tezos_crypto.Block_hash.t * Int32.t + | Cannot_checkout_context of Tezos_crypto.Block_hash.t * string option + | No_batcher + +type error += + | Lost_game of + public_key_hash * Protocol.Alpha_context.Sc_rollup.Game.reason * Tez.t + +let () = + register_error_kind + `Permanent + ~id:"bad_minimal_fees_arg" + ~title:"Bad -minimal-fees arg" + ~description:"invalid fee threshold in -fee-threshold" + ~pp:(fun ppf literal -> + Format.fprintf ppf "invalid minimal fees '%s'" literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_minimal_fees parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_minimal_fees parameter) ; + + register_error_kind + `Permanent + ~id:"internal.commitment_should_be_next_to_lcc" + ~title: + "Internal error: The next commitment should have the LCC as predecessor" + ~description: + "Internal error: The next commitment should have the LCC as predecessor" + ~pp:(fun ppf commitment -> + Format.fprintf + ppf + "invalid commitment '%a'" + Sc_rollup.Commitment.pp + commitment) + Data_encoding.(obj1 (req "commitment" Sc_rollup.Commitment.encoding)) + (function + | Commitment_predecessor_should_be_LCC commitment -> Some commitment + | _ -> None) + (fun commitment -> Commitment_predecessor_should_be_LCC commitment) ; + + register_error_kind + `Permanent + ~id:"internal.unreliable_tezos_node" + ~title:"Internal error: Tezos node seems unreliable" + ~description: + "Internal error: The game invariant states that the dissection from the \ + opponent must contain a tick we disagree with. If the retrieved game \ + does not respect this, we cannot trust the Tezos node we are connected \ + to and prefer to stop here." + ~pp:(fun _ppf () -> ()) + Data_encoding.unit + (function + | Unreliable_tezos_node_returning_inconsistent_game -> Some () | _ -> None) + (fun () -> Unreliable_tezos_node_returning_inconsistent_game) ; + + register_error_kind + `Permanent + ~id:"internal.cannot_produce_proof" + ~title:"Internal error: rollup node cannot produce refutation proof" + ~description: + "The rollup node is in a state that prevents it from producing \ + refutation proofs." + ~pp:(fun ppf (inbox, history, level) -> + Format.fprintf + ppf + "cannot produce proof for inbox %a of level %a with history %a" + Sc_rollup.Inbox.pp + inbox + Raw_level.pp + level + Sc_rollup.Inbox.History.pp + history) + Data_encoding.( + obj3 + (req "inbox" Sc_rollup.Inbox.encoding) + (req "history" Sc_rollup.Inbox.History.encoding) + (req "level" Raw_level.encoding)) + (function + | Cannot_produce_proof (inbox, history, level) -> + Some (inbox, history, level) + | _ -> None) + (fun (inbox, history, level) -> + Cannot_produce_proof (inbox, history, level)) ; + + register_error_kind + ~id:"sc_rollup.node.missing_mode_operators" + ~title:"Missing operators for the chosen mode" + ~description:"Missing operators for the chosen mode." + ~pp:(fun ppf (mode, missing_operators) -> + Format.fprintf + ppf + "@[Missing operators %a for mode %s.@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ ") + Format.pp_print_string) + missing_operators + mode) + `Permanent + Data_encoding.( + obj2 (req "mode" string) (req "missing_operators" (list string))) + (function + | Missing_mode_operators {mode; missing_operators} -> + Some (mode, missing_operators) + | _ -> None) + (fun (mode, missing_operators) -> + Missing_mode_operators {mode; missing_operators}) ; + + register_error_kind + ~id:"internal.inconsistent_inbox" + ~title:"Internal error: Rollup node has an inconsistent inbox" + ~description: + "The rollup node inbox should be the same as the layer 1 inbox." + ~pp:(fun ppf (layer1_inbox, inbox) -> + Format.fprintf + ppf + "@[Rollup inbox:@;%a@]@;should be equal to @[Layer1 inbox:@;%a@]" + Sc_rollup.Inbox.pp + inbox + Sc_rollup.Inbox.pp + layer1_inbox) + `Permanent + Data_encoding.( + obj2 + (req "layer1_inbox" Sc_rollup.Inbox.encoding) + (req "inbox" Sc_rollup.Inbox.encoding)) + (function + | Inconsistent_inbox {layer1_inbox; inbox} -> Some (layer1_inbox, inbox) + | _ -> None) + (fun (layer1_inbox, inbox) -> Inconsistent_inbox {layer1_inbox; inbox}) ; + + register_error_kind + `Permanent + ~id:"internal.missing_pvm_state" + ~title:"Internal error: Missing PVM state" + ~description:"The rollup node cannot retrieve the state of the PVM." + ~pp:(fun ppf (block, level) -> + Format.fprintf + ppf + "Cannot retrieve PVM state for block %a at level %ld" + Tezos_crypto.Block_hash.pp + block + level) + Data_encoding.( + obj2 (req "block" Tezos_crypto.Block_hash.encoding) (req "level" int32)) + (function + | Missing_PVM_state (block, level) -> Some (block, level) | _ -> None) + (fun (block, level) -> Missing_PVM_state (block, level)) ; + + register_error_kind + `Permanent + ~id:"internal.cannot_checkout_context" + ~title:"Internal error: Cannot checkout context" + ~description: + "The rollup node cannot checkout the context registered for the block." + ~pp:(fun ppf (block, context_hash) -> + Format.fprintf + ppf + "The context %sfor block %a cannot be checkouted" + (Option.fold + ~none:"" + ~some:(fun c -> Hex.(show (of_string c))) + context_hash) + Tezos_crypto.Block_hash.pp + block) + Data_encoding.( + obj2 + (req "block" Tezos_crypto.Block_hash.encoding) + (opt "context" (conv Bytes.of_string Bytes.to_string bytes))) + (function + | Cannot_checkout_context (block, context) -> Some (block, context) + | _ -> None) + (fun (block, context) -> Cannot_checkout_context (block, context)) ; + + register_error_kind + `Permanent + ~id:"sc_rollup.node.lost_game" + ~title:"Lost refutation game" + ~description:"The rollup node lost a refutation game." + ~pp:(fun ppf (loser, reason, slashed) -> + Format.fprintf + ppf + "The rollup node lost the refutation game for operator %a and was \ + slashed %s%a, for reason: %a." + Tezos_crypto.Signature.Public_key_hash.pp + loser + tez_sym + Tez.pp + slashed + Protocol.Alpha_context.Sc_rollup.Game.pp_reason + reason) + Data_encoding.( + obj3 + (req "loser" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "reason" Protocol.Alpha_context.Sc_rollup.Game.reason_encoding) + (req "slashed" Tez.encoding)) + (function + | Lost_game (loser, reason, slashed) -> Some (loser, reason, slashed) + | _ -> None) + (fun (loser, reason, slashed) -> Lost_game (loser, reason, slashed)) ; + + register_error_kind + ~id:"sc_rollup.node.no_batcher" + ~title:"No batcher for this node" + ~description:"This node does not have a batcher" + ~pp:(fun ppf () -> + Format.fprintf ppf "This rollup node does not have batcher.") + `Permanent + Data_encoding.unit + (function No_batcher -> Some () | _ -> None) + (fun () -> No_batcher) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.ml new file mode 100644 index 000000000000..25d2ec2c3923 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.ml @@ -0,0 +1,194 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module type S = sig + module Interpreter : Interpreter.S + + module PVM = Interpreter.PVM + module Fueled_pvm = Interpreter.Free_pvm + + type level_position = Start | Middle | End + + type info_per_level = { + predecessor_timestamp : Timestamp.time; + predecessor : Tezos_crypto.Block_hash.t; + } + + type t = { + ctxt : Context.ro; + inbox_level : Raw_level.t; + state : PVM.state; + reveal_map : string Sc_rollup_reveal_hash.Map.t option; + nb_messages_inbox : int; + level_position : level_position; + info_per_level : info_per_level; + } + + val start_simulation : + Node_context.ro -> + reveal_map:string Sc_rollup_reveal_hash.Map.t option -> + Layer1.head -> + t tzresult Lwt.t + + val simulate_messages : + Node_context.ro -> + t -> + Sc_rollup.Inbox_message.t list -> + (t * Z.t) tzresult Lwt.t + + val end_simulation : Node_context.ro -> t -> (t * Z.t) tzresult Lwt.t +end + +module Make (Interpreter : Interpreter.S) : + S with module Interpreter = Interpreter = struct + module Interpreter = Interpreter + module PVM = Interpreter.PVM + module Fueled_pvm = Interpreter.Free_pvm + + type level_position = Start | Middle | End + + type info_per_level = { + predecessor_timestamp : Timestamp.time; + predecessor : Tezos_crypto.Block_hash.t; + } + + type t = { + ctxt : Context.ro; + inbox_level : Raw_level.t; + state : PVM.state; + reveal_map : string Sc_rollup_reveal_hash.Map.t option; + nb_messages_inbox : int; + level_position : level_position; + info_per_level : info_per_level; + } + + let simulate_info_per_level (node_ctxt : [`Read] Node_context.t) predecessor = + let open Lwt_result_syntax in + let* block_info = Layer1.fetch_tezos_block node_ctxt.l1_ctxt predecessor in + let predecessor_timestamp = block_info.header.shell.timestamp in + return {predecessor_timestamp; predecessor} + + let start_simulation node_ctxt ~reveal_map (Layer1.{hash; level} as head) = + let open Lwt_result_syntax in + let*? level = Environment.wrap_tzresult @@ Raw_level.of_int32 level in + let*? () = + error_unless + Raw_level.(level >= node_ctxt.Node_context.genesis_info.level) + (Exn (Failure "Cannot simulate before origination level")) + in + let first_inbox_level = Raw_level.succ node_ctxt.genesis_info.level in + let* ctxt = + if Raw_level.(level < first_inbox_level) then + (* This is before we have interpreted the boot sector, so we start + with an empty context in genesis *) + return (Context.empty node_ctxt.context) + else Node_context.checkout_context node_ctxt hash + in + let* ctxt, state = Interpreter.state_of_head node_ctxt ctxt head in + let+ info_per_level = simulate_info_per_level node_ctxt hash in + let inbox_level = Raw_level.succ level in + { + ctxt; + inbox_level; + state; + reveal_map; + nb_messages_inbox = 0; + level_position = Start; + info_per_level; + } + + let simulate_messages_no_checks (node_ctxt : Node_context.ro) + ({ + ctxt; + state; + inbox_level; + reveal_map; + nb_messages_inbox; + level_position = _; + info_per_level = _; + } as sim) messages = + let open Lwt_result_syntax in + (* Build new state *) + let* eval_result = + Fueled_pvm.eval_messages + ?reveal_map + ~fuel:(Fuel.Free.of_ticks 0L) + node_ctxt + ~message_counter_offset:nb_messages_inbox + state + inbox_level + messages + in + let Fueled_pvm.{state; num_ticks; _} = + Delayed_write_monad.ignore eval_result + in + let*! ctxt = PVM.State.set ctxt state in + let nb_messages = List.length messages in + let nb_messages_inbox = nb_messages_inbox + nb_messages in + return ({sim with ctxt; state; nb_messages_inbox}, num_ticks) + + let simulate_messages (node_ctxt : Node_context.ro) sim messages = + let open Lwt_result_syntax in + (* Build new inbox *) + let*? () = + error_when + (sim.level_position = End) + (Exn (Failure "Level for simulation is ended")) + in + let*? () = + error_when + (messages = []) + (Environment.wrap_tzerror Sc_rollup_errors.Sc_rollup_add_zero_messages) + in + let messages = + if sim.level_position = Start then + let {predecessor_timestamp; predecessor} = sim.info_per_level in + let open Sc_rollup.Inbox_message in + Internal Start_of_level + :: Internal (Info_per_level {predecessor_timestamp; predecessor}) + :: messages + else messages + in + let+ sim, num_ticks = simulate_messages_no_checks node_ctxt sim messages in + ({sim with level_position = Middle}, num_ticks) + + let end_simulation node_ctxt sim = + let open Lwt_result_syntax in + let*? () = + error_when + (sim.level_position = End) + (Exn (Failure "Level for simulation is ended")) + in + let+ sim, num_ticks = + simulate_messages_no_checks + node_ctxt + sim + [Sc_rollup.Inbox_message.Internal End_of_level] + in + ({sim with level_position = End}, num_ticks) +end diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.mli new file mode 100644 index 000000000000..49e0da506df7 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/simulation.mli @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Protocol.Alpha_context + +module type S = sig + module Interpreter : Interpreter.S + + module PVM = Interpreter.PVM + module Fueled_pvm = Interpreter.Free_pvm + + type level_position = Start | Middle | End + + type info_per_level = { + predecessor_timestamp : Timestamp.time; + predecessor : Tezos_crypto.Block_hash.t; + } + + (** Type of the state for a simulation. *) + type t = { + ctxt : Context.ro; + inbox_level : Raw_level.t; + state : PVM.state; + reveal_map : string Sc_rollup_reveal_hash.Map.t option; + nb_messages_inbox : int; + level_position : level_position; + info_per_level : info_per_level; + } + + (** [start_simulation node_ctxt reveal_source block] starts a new simulation + {e on top} of [block], i.e. for an hypothetical new inbox (level). *) + val start_simulation : + Node_context.ro -> + reveal_map:string Sc_rollup_reveal_hash.Map.t option -> + Layer1.head -> + t tzresult Lwt.t + + (** [simulate_messages node_ctxt sim messages] runs a simulation of new + [messages] in the given simulation (state) [sim] and returns a new + simulation state, the remaining fuel (when [?fuel] is provided) and the + number of ticks that happened. *) + val simulate_messages : + Node_context.ro -> + t -> + Sc_rollup.Inbox_message.t list -> + (t * Z.t) tzresult Lwt.t + + (** [end_simulation node_ctxt sim] adds and [End_of_level] message and marks + the simulation as ended. *) + val end_simulation : Node_context.ro -> t -> (t * Z.t) tzresult Lwt.t +end + +(** Functor to construct a simulator for a given PVM with interpreter. *) +module Make (Interpreter : Interpreter.S) : + S with module Interpreter = Interpreter diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/state.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/state.ml new file mode 100644 index 000000000000..ff76af338d9c --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/state.ml @@ -0,0 +1,138 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Store = struct + (** Table from blocks hashes to unit. The entry is present iff the block + identified by that hash is fully processed by the rollup node. *) + module Processed_hashes = + Store.Make_append_only_map + (struct + let path = ["tezos"; "processed_blocks"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = unit + + let name = "processed" + + let encoding = Data_encoding.unit + end) + + module Last_processed_head = + Store.Make_mutable_value + (struct + let path = ["tezos"; "processed_head"] + end) + (struct + type value = Layer1.head + + let name = "head" + + let encoding = Layer1.head_encoding + end) + + module Last_finalized_head = + Store.Make_mutable_value + (struct + let path = ["tezos"; "finalized_head"] + end) + (struct + type value = Layer1.head + + let name = "head" + + let encoding = Layer1.head_encoding + end) + + (** Table from L1 levels to blocks hashes. *) + module Levels_to_hashes = + Store.Make_updatable_map + (struct + let path = ["tezos"; "levels"] + end) + (struct + type key = int32 + + let to_path_representation = Int32.to_string + end) + (struct + type value = Tezos_crypto.Block_hash.t + + let name = "block_hash" + + let encoding = Tezos_crypto.Block_hash.encoding + end) + + (** Table from L1 blocks hashes to levels. *) + module Hashes_to_levels = + Store.Make_append_only_map + (struct + let path = ["tezos"; "blocks_hashes"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = int32 + + let name = "level" + + let encoding = Data_encoding.int32 + end) +end + +let hash_of_level store level = Store.Levels_to_hashes.get store level + +let level_of_hash store hash = + let open Lwt_result_syntax in + let*! level = Store.Hashes_to_levels.find store hash in + match level with + | None -> + failwith "No level known for block %a" Tezos_crypto.Block_hash.pp hash + | Some l -> return l + +let mark_processed_head store Layer1.({hash; level = _} as head) = + let open Lwt_syntax in + let* () = Store.Processed_hashes.add store hash () in + Store.Last_processed_head.set store head + +let is_processed store head = Store.Processed_hashes.mem store head + +let last_processed_head_opt store = Store.Last_processed_head.find store + +let mark_finalized_head store head = Store.Last_finalized_head.set store head + +let get_finalized_head_opt store = Store.Last_finalized_head.find store + +let set_block_level_and_hash store Layer1.{hash; level} = + let open Lwt_syntax in + let* () = Store.Hashes_to_levels.add store hash level in + Store.Levels_to_hashes.add store level hash diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/state.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/state.mli new file mode 100644 index 000000000000..0b6e426bf6bd --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/state.mli @@ -0,0 +1,58 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [is_processed store hash] returns [true] if the block with [hash] has + already been processed by the daemon. *) +val is_processed : _ Store.t -> Tezos_crypto.Block_hash.t -> bool Lwt.t + +(** [mark_processed_head store head] remembers that the [head] is processed. The + system should not have to come back to it. *) +val mark_processed_head : Store.rw -> Layer1.head -> unit Lwt.t + +(** [last_processed_head_opt store] returns the last processed head if it + exists. *) +val last_processed_head_opt : _ Store.t -> Layer1.head option Lwt.t + +(** [mark_finalized_head store head] remembers that the [head] is finalized. By + construction, every block whose level is smaller than [head]'s is also + finalized. *) +val mark_finalized_head : Store.rw -> Layer1.head -> unit Lwt.t + +(** [last_finalized_head_opt store] returns the last finalized head if it exists. *) +val get_finalized_head_opt : _ Store.t -> Layer1.head option Lwt.t + +(** [hash_of_level store level] returns the current block hash for a + given [level]. Raise [Invalid_argument] if [hash] does not belong + to [store]. *) +val hash_of_level : _ Store.t -> int32 -> Tezos_crypto.Block_hash.t Lwt.t + +(** [level_of_hash store hash] returns the level for Tezos block hash [hash] if + it is known by the rollup node. *) +val level_of_hash : + _ Store.t -> Tezos_crypto.Block_hash.t -> int32 tzresult Lwt.t + +(** [set_block_level_and_hash store head] registers the correspondences + [head.level |-> head.hash] and [head.hash |-> head.level] in the store. *) +val set_block_level_and_hash : Store.rw -> Layer1.head -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/store.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/store.ml new file mode 100644 index 000000000000..d4b49002017d --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/store.ml @@ -0,0 +1,494 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +include Store_sigs +include Store_utils + +(** Aggregated collection of messages from the L1 inbox *) +open Alpha_context + +module IStore = Irmin_store.Make (struct + let name = "Tezos smart-contract rollup node" +end) + +include Store_utils.Make (IStore) + +type 'a store = 'a IStore.t + +type 'a t = ([< `Read | `Write > `Read] as 'a) store + +type rw = Store_sigs.rw t + +type ro = Store_sigs.ro t + +let close = IStore.close + +let load = IStore.load + +let readonly = IStore.readonly + +type state_info = { + num_messages : Z.t; + num_ticks : Z.t; + initial_tick : Sc_rollup.Tick.t; +} + +(** Extraneous state information for the PVM *) +module StateInfo = + Make_append_only_map + (struct + let path = ["state_info"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = state_info + + let name = "state_info" + + let encoding = + let open Data_encoding in + conv + (fun {num_messages; num_ticks; initial_tick} -> + (num_messages, num_ticks, initial_tick)) + (fun (num_messages, num_ticks, initial_tick) -> + {num_messages; num_ticks; initial_tick}) + (obj3 + (req "num_messages" Data_encoding.z) + (req "num_ticks" Data_encoding.z) + (req "initial_tick" Sc_rollup.Tick.encoding)) + end) + +module StateHistoryRepr = struct + type event = { + tick : Sc_rollup.Tick.t; + block_hash : Tezos_crypto.Block_hash.t; + predecessor_hash : Tezos_crypto.Block_hash.t; + level : Raw_level.t; + } + + module TickMap = Map.Make (Sc_rollup.Tick) + + type value = event TickMap.t + + let event_encoding = + let open Data_encoding in + conv + (fun {tick; block_hash; predecessor_hash; level} -> + (tick, block_hash, predecessor_hash, level)) + (fun (tick, block_hash, predecessor_hash, level) -> + {tick; block_hash; predecessor_hash; level}) + (obj4 + (req "tick" Sc_rollup.Tick.encoding) + (req "block_hash" Tezos_crypto.Block_hash.encoding) + (req "predecessor_hash" Tezos_crypto.Block_hash.encoding) + (req "level" Raw_level.encoding)) + + let name = "state_history" + + let encoding = + let open Data_encoding in + conv + TickMap.bindings + (fun bindings -> TickMap.of_seq (List.to_seq bindings)) + (Data_encoding.list (tup2 Sc_rollup.Tick.encoding event_encoding)) +end + +module StateHistory = struct + include + Make_mutable_value + (struct + let path = ["state_history"] + end) + (StateHistoryRepr) + + let insert store event = + let open Lwt_result_syntax in + let open StateHistoryRepr in + let*! history = find store in + let history = + match history with + | None -> StateHistoryRepr.TickMap.empty + | Some history -> history + in + set store (TickMap.add event.tick event history) + + let event_of_largest_tick_before store tick = + let open Lwt_result_syntax in + let open StateHistoryRepr in + let*! history = find store in + match history with + | None -> return_none + | Some history -> ( + let events_before, opt_value, _ = TickMap.split tick history in + match opt_value with + | Some event -> return (Some event) + | None -> + return @@ Option.map snd @@ TickMap.max_binding_opt events_before) +end + +(** Unaggregated messages per block *) +module Messages = + Make_append_only_map + (struct + let path = ["messages"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Sc_rollup.Inbox_message.t list + + let name = "messages" + + let encoding = + Data_encoding.(list @@ dynamic_size Sc_rollup.Inbox_message.encoding) + end) + +(** Inbox state for each block *) +module Inboxes = + Make_append_only_map + (struct + let path = ["inboxes"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Sc_rollup.Inbox.t + + let name = "inbox" + + let encoding = Sc_rollup.Inbox.encoding + end) + +(** Message history for the inbox at a given block *) +module Histories = + Make_append_only_map + (struct + let path = ["histories"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Sc_rollup.Inbox.History.t + + let name = "inbox_history" + + let encoding = Sc_rollup.Inbox.History.encoding + end) + +(** payloads history for the inbox at a given block *) +module Payloads_histories = + Make_append_only_map + (struct + let path = ["payloads_histories"] + end) + (struct + type key = Sc_rollup.Inbox_merkelized_payload_hashes.Hash.t + + let to_path_representation = + Sc_rollup.Inbox_merkelized_payload_hashes.Hash.to_b58check + end) + (struct + let name = "payloads_history" + + type value = Sc_rollup.Inbox_merkelized_payload_hashes.History.t + + let encoding = Sc_rollup.Inbox_merkelized_payload_hashes.History.encoding + end) + +module Commitments = + Make_append_only_map + (struct + let path = ["commitments"; "computed"] + end) + (struct + type key = Raw_level.t + + let to_path_representation key = Int32.to_string @@ Raw_level.to_int32 key + end) + (struct + type value = Sc_rollup.Commitment.t * Sc_rollup.Commitment.Hash.t + + let name = "commitment_with_hash" + + let encoding = + Data_encoding.( + obj2 + (req "commitment" Sc_rollup.Commitment.encoding) + (req "hash" Sc_rollup.Commitment.Hash.encoding)) + end) + +module Last_stored_commitment_level = + Make_mutable_value + (struct + let path = ["commitments"; "last_stored_level"] + end) + (struct + type value = Raw_level.t + + let name = "raw_level" + + let encoding = Raw_level.encoding + end) + +module Last_published_commitment_level = + Make_mutable_value + (struct + let path = ["commitments"; "last_published_level"] + end) + (struct + type value = Raw_level.t + + let name = "raw_level" + + let encoding = Raw_level.encoding + end) + +module Last_cemented_commitment_level = + Make_mutable_value + (struct + let path = ["commitments"; "last_cemented_commitment"; "level"] + end) + (struct + type value = Raw_level.t + + let name = "raw_level" + + let encoding = Raw_level.encoding + end) + +module Last_cemented_commitment_hash = + Make_mutable_value + (struct + let path = ["commitments"; "last_cemented_commitment"; "hash"] + end) + (struct + type value = Sc_rollup.Commitment.Hash.t + + let name = "commitment_hash" + + let encoding = Sc_rollup.Commitment.Hash.encoding + end) + +module Commitments_published_at_level = + Make_updatable_map + (struct + let path = ["commitments"; "published_at_level"] + end) + (struct + type key = Sc_rollup.Commitment.Hash.t + + let to_path_representation = Sc_rollup.Commitment.Hash.to_b58check + end) + (struct + type value = Raw_level.t + + let name = "raw_level" + + let encoding = Raw_level.encoding + end) + +module Contexts = + Make_append_only_map + (struct + let path = ["contexts"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Context.hash + + let name = "context" + + let encoding = Context.hash_encoding + end) + +(* Published slot headers per block hash, + stored as a list of bindings from `Dal_slot_index.t` + to `Dal.Slot.t`. The encoding function converts this + list into a `Dal.Slot_index.t`-indexed map. *) +module Dal_slot_pages = + Make_nested_map + (struct + let path = ["dal"; "slot_pages"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type key = Dal.Slot_index.t * Dal.Page.Index.t + + let encoding = + Data_encoding.(tup2 Dal.Slot_index.encoding Dal.Page.Index.encoding) + + let compare (i1, p1) (i2, p2) = + Compare.or_else (Dal.Slot_index.compare i1 i2) (fun () -> + Dal.Page.Index.compare p1 p2) + + let name = "slot_index" + end) + (struct + type value = Dal.Page.content + + let encoding = Dal.Page.content_encoding + + let name = "slot_pages" + end) + +(** stores slots whose data have been considered and pages stored to disk (if + they are confirmed). *) +module Dal_processed_slots = + Make_nested_map + (struct + let path = ["dal"; "processed_slots"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type key = Dal.Slot_index.t + + let encoding = Dal.Slot_index.encoding + + let compare = Dal.Slot_index.compare + + let name = "slot_index" + end) + (struct + type value = [`Confirmed | `Unconfirmed] + + let name = "slot_processing_status" + + let encoding = + let open Data_encoding in + let mk_case constr ~tag ~title = + case + ~title + (Tag tag) + (obj1 (req "kind" (constant title))) + (fun x -> if x = constr then Some () else None) + (fun () -> constr) + in + union + ~tag_size:`Uint8 + [ + mk_case `Confirmed ~tag:0 ~title:"Confirmed"; + mk_case `Unconfirmed ~tag:1 ~title:"Unconfirmed"; + ] + end) + +module Dal_slots_headers = + Make_nested_map + (struct + let path = ["dal"; "slot_headers"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type key = Dal.Slot_index.t + + let encoding = Dal.Slot_index.encoding + + let compare = Dal.Slot_index.compare + + let name = "slot_index" + end) + (struct + type value = Dal.Slot.Header.t + + let name = "slot_header" + + let encoding = Dal.Slot.Header.encoding + end) + +(* Published slot headers per block hash, stored as a list of bindings from + `Dal_slot_index.t` to `Dal.Slot.t`. The encoding function converts this + list into a `Dal.Slot_index.t`-indexed map. Note that the block_hash + refers to the block where slots headers have been confirmed, not + the block where they have been published. +*) + +(** Confirmed DAL slots history. See documentation of + {Dal_slot_repr.Slots_history} for more details. *) +module Dal_confirmed_slots_history = + Make_append_only_map + (struct + let path = ["dal"; "confirmed_slots_history"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Dal.Slots_history.t + + let name = "dal_slot_histories" + + let encoding = Dal.Slots_history.encoding + end) + +(** Confirmed DAL slots histories cache. See documentation of + {Dal_slot_repr.Slots_history} for more details. *) +module Dal_confirmed_slots_histories = + Make_append_only_map + (struct + let path = ["dal"; "confirmed_slots_histories_cache"] + end) + (struct + type key = Tezos_crypto.Block_hash.t + + let to_path_representation = Tezos_crypto.Block_hash.to_b58check + end) + (struct + type value = Dal.Slots_history.History_cache.t + + let name = "dal_slot_history_cache" + + let encoding = Dal.Slots_history.History_cache.encoding + end) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/store.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/store.mli new file mode 100644 index 000000000000..1dc192e93323 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/store.mli @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3471 + Use indexed file for append-only instead of Irmin. *) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3739 + Refactor the store file to have functors in their own + separate module, and return errors within the Error monad. *) + +open Protocol +open Alpha_context + +type +'a store + +include Store_sigs.Store with type 'a t = 'a store + +(** Type of store. The parameter indicates if the store can be written or only + read. *) +type 'a t = ([< `Read | `Write > `Read] as 'a) store + +(** Read/write store {!t}. *) +type rw = Store_sigs.rw t + +(** Read only store {!t}. *) +type ro = Store_sigs.ro t + +type state_info = { + num_messages : Z.t; + num_ticks : Z.t; + initial_tick : Sc_rollup.Tick.t; +} + +(** [close store] closes the store. *) +val close : _ t -> unit Lwt.t + +(** [load mode directory] loads a store from the data persisted in [directory].*) +val load : 'a Store_sigs.mode -> string -> 'a store Lwt.t + +(** [readonly store] returns a read-only version of [store]. *) +val readonly : _ t -> ro + +(** Extraneous state information for the PVM *) +module StateInfo : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = state_info + and type 'a store = 'a store + +module StateHistoryRepr : sig + type event = { + tick : Sc_rollup.Tick.t; + block_hash : Tezos_crypto.Block_hash.t; + predecessor_hash : Tezos_crypto.Block_hash.t; + level : Raw_level.t; + } + + module TickMap : Map.S with type key = Sc_rollup.Tick.t + + type value = event TickMap.t +end + +(** [StateHistory] represents storage for the PVM state history: it is an + extension of [Store_utils.Mutable_value] whose values are lists of bindings + indexed by PVM tick numbers, and whose value contains information about the + block that the PVM was processing when generating the tick. +*) +module StateHistory : sig + include + Store_sigs.Mutable_value + with type value = StateHistoryRepr.value + and type 'a store = 'a store + + val insert : rw -> StateHistoryRepr.event -> unit Lwt.t + + val event_of_largest_tick_before : + _ t -> + StateHistoryRepr.TickMap.key -> + StateHistoryRepr.event option tzresult Lwt.t +end + +(** Storage for persisting messages downloaded from the L1 node, indexed by + [Tezos_crypto.Block_hash.t]. *) +module Messages : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Sc_rollup.Inbox_message.t list + and type 'a store = 'a store + +(** Aggregated collection of messages from the L1 inbox *) +module Inboxes : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Sc_rollup.Inbox.t + and type 'a store = 'a store + +(** Histories from the rollup node. **) +module Histories : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Sc_rollup.Inbox.History.t + and type 'a store = 'a store + +(** messages histories from the rollup node. Each history contains the messages + of one level. The store is indexed by a level in order to maintain a small + structure in memory. Only the message history of one level is fetched when + computing the proof. *) +module Payloads_histories : + Store_sigs.Append_only_map + with type key = Sc_rollup.Inbox_merkelized_payload_hashes.Hash.t + and type value = Sc_rollup.Inbox_merkelized_payload_hashes.History.t + and type 'a store = 'a store + +(** Storage containing commitments and corresponding commitment hashes that the + rollup node has knowledge of. *) +module Commitments : + Store_sigs.Append_only_map + with type key = Raw_level.t + and type value = Sc_rollup.Commitment.t * Sc_rollup.Commitment.Hash.t + and type 'a store = 'a store + +(** Storage containing the inbox level of the last commitment produced by the + rollup node. *) +module Last_stored_commitment_level : + Store_sigs.Mutable_value + with type value = Raw_level.t + and type 'a store = 'a store + +(** Storage contianing the inbox level of the last commitment published by the + rollup node. *) +module Last_published_commitment_level : + Store_sigs.Mutable_value + with type value = Raw_level.t + and type 'a store = 'a store + +(** Storage containing the inbox level of the last commitment cemented for the + rollup. The commitment has not been necessarily generated by this rollup + node. *) +module Last_cemented_commitment_level : + Store_sigs.Mutable_value + with type value = Raw_level.t + and type 'a store = 'a store + +(** torage containing the hash of the last commitment cemented for the rollup. + The commitment has not been necessarily generated by this rollup node. *) +module Last_cemented_commitment_hash : + Store_sigs.Mutable_value + with type value = Sc_rollup.Commitment.Hash.t + and type 'a store = 'a store + +(** Storage mapping commitment hashes to the level when they were published by + the rollup node. It only contains hashes of commitments published by this + rollup node. *) +module Commitments_published_at_level : + Store_sigs.Map + with type key = Sc_rollup.Commitment.Hash.t + and type value = Raw_level.t + and type 'a store = 'a store + +(** Storage containing the hashes of contexts retrieved from the L1 node. *) +module Contexts : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Context.hash + and type 'a store = 'a store + +(** Published slot headers per block hash, + stored as a list of bindings from [Dal_slot_index.t] + to [Dal.Slot.t]. The encoding function converts this + list into a [Dal.Slot_index.t]-indexed map. *) +module Dal_slots_headers : + Store_sigs.Nested_map + with type primary_key = Tezos_crypto.Block_hash.t + and type secondary_key = Dal.Slot_index.t + and type value = Dal.Slot.Header.t + and type 'a store = 'a store + +module Dal_confirmed_slots_history : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Dal.Slots_history.t + and type 'a store = 'a store + +(** Confirmed DAL slots histories cache. See documentation of + {Dal_slot_repr.Slots_history} for more details. *) +module Dal_confirmed_slots_histories : + Store_sigs.Append_only_map + with type key = Tezos_crypto.Block_hash.t + and type value = Dal.Slots_history.History_cache.t + and type 'a store = 'a store + +(** [Dal_slot_pages] is a [Store_utils.Nested_map] used to store the contents + of dal slots fetched by the rollup node, as a list of pages. The values of + this storage module have type `string list`. A value of the form + [page_contents] refers to a page of a slot that has been confirmed, and + whose contents are [page_contents]. +*) +module Dal_slot_pages : + Store_sigs.Nested_map + with type primary_key = Tezos_crypto.Block_hash.t + and type secondary_key = Dal.Slot_index.t * Dal.Page.Index.t + and type value = Dal.Page.content + and type 'a store = 'a store + +(** [Dal_processed_slots] is a [Store_utils.Nested_map] used to store the processing + status of dal slots content fetched by the rollup node. The values of + this storage module have type `[`Confirmed | `Unconfirmed]`, depending on + whether the content of the slot has been confirmed or not. If an entry is + not present for a [(block_hash, slot_index)], this either means that it's + not processed yet. +*) +module Dal_processed_slots : + Store_sigs.Nested_map + with type primary_key = Tezos_crypto.Block_hash.t + and type secondary_key = Dal.Slot_index.t + and type value = [`Confirmed | `Unconfirmed] + and type 'a store = 'a store diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml new file mode 100644 index 000000000000..e4fca38ca161 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml @@ -0,0 +1,94 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This module manifests the proof format used by the Wasm PVM as defined by + the Layer 1 implementation for it. + + It is imperative that this is aligned with the protocol's implementation. +*) +module Wasm_2_0_0_proof_format = + Context.Proof + (struct + include Sc_rollup.State_hash + + let of_context_hash = Sc_rollup.State_hash.context_hash_to_state_hash + end) + (struct + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding + end) + +module type TreeS = + Tezos_context_sigs.Context.TREE + with type key = string list + and type value = bytes + +module Make_backend (Tree : TreeS) = struct + type Tezos_lazy_containers.Lazy_map.tree += PVM_tree of Tree.tree + + include Tezos_scoru_wasm_fast.Pvm.Make (struct + include Tree + + let select = function + | PVM_tree t -> t + | _ -> raise Tezos_tree_encoding.Incorrect_tree_type + + let wrap t = PVM_tree t + end) +end + +module Impl : Pvm.S = struct + module PVM = + Sc_rollup.Wasm_2_0_0PVM.Make (Make_backend) (Wasm_2_0_0_proof_format) + include PVM + + let kind = Sc_rollup.Kind.Wasm_2_0_0 + + let new_dissection = Game_helpers.Wasm.new_dissection + + module State = Context.PVMState + + let string_of_status : status -> string = function + | Waiting_for_input_message -> "Waiting for input message" + | Waiting_for_reveal (Sc_rollup.Reveal_raw_data hash) -> + Format.asprintf + "Waiting for preimage reveal %a" + Sc_rollup_reveal_hash.pp + hash + | Waiting_for_reveal Sc_rollup.Reveal_metadata -> "Waiting for metadata" + | Waiting_for_reveal (Sc_rollup.Request_dal_page page_id) -> + Format.asprintf "Waiting for page data %a" Dal.Page.pp page_id + | Computing -> "Computing" + + module Backend = Make_backend (Wasm_2_0_0_proof_format.Tree) + + let eval_many = Backend.compute_step_many +end + +include Impl diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.ml b/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.ml new file mode 100644 index 000000000000..ad80ad0d1c83 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.ml @@ -0,0 +1,1002 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_client_base + +let l1_destination_parameter = + Tezos_clic.parameter (fun _ s -> + match Tezos_crypto.Signature.Public_key_hash.of_b58check_opt s with + | Some addr -> return addr + | None -> failwith "cannot parse %s to get a valid destination" s) + +let parse_file parse path = + let open Lwt_syntax in + let* contents = Lwt_utils_unix.read_file path in + parse contents + +let file_or_text_parameter ~from_text + ?(from_path = parse_file (from_text ~heuristic:false)) () = + Tezos_clic.parameter @@ fun _ p -> + match String.split ~limit:1 ':' p with + | ["text"; text] -> from_text ~heuristic:false text + | ["file"; path] -> from_path path + | _ -> if Sys.file_exists p then from_path p else from_text ~heuristic:true p + +let json_file_or_text_parameter = + let from_text ~heuristic s = + try return (Ezjsonm.from_string s) + with Ezjsonm.Parse_error _ when heuristic -> + failwith "Neither an existing file nor valid JSON: '%s'" s + in + let from_path = Lwt_utils_unix.Json.read_file in + file_or_text_parameter ~from_text ~from_path () + +let json_parameter = + let from_text ~heuristic s = + try return (Ezjsonm.from_string s) + with Ezjsonm.Parse_error _ when heuristic -> + failwith "Neither an existing file nor valid JSON: '%s'" s + in + file_or_text_parameter ~from_text () + +let alias_or_literal ~from_alias ~from_key = + Client_aliases.parse_alternatives [("alias", from_alias); ("key", from_key)] + +type wallet_entry = { + alias : string; + public_key_hash : Tezos_crypto.Bls.Public_key_hash.t; + public_key : Tezos_crypto.Bls.Public_key.t option; + secret_key_uri : Client_keys.aggregate_sk_uri option; +} + +let wallet_parameter () = + Tezos_clic.parameter (fun cctxt alias -> + let open Lwt_result_syntax in + let open Tezos_crypto.Aggregate_signature in + let* (Bls12_381 public_key_hash) = + Client_keys.Aggregate_alias.Public_key_hash.find cctxt alias + in + let* _, pk_opt = + Client_keys.Aggregate_alias.Public_key.find cctxt alias + in + let public_key = + Option.map (fun (Bls12_381 pk : public_key) -> pk) pk_opt + in + let+ secret_key_uri = + Client_keys.Aggregate_alias.Secret_key.find_opt cctxt alias + in + {alias; public_key_hash; public_key; secret_key_uri}) + +let wallet_param ?(name = "an alias for a tz4 address") + ?(desc = "an alias for a tz4 address") = + Tezos_clic.param ~name ~desc @@ wallet_parameter () + +let tezos_pkh_param = Client_keys.Public_key_hash.source_param + +let bls_pkh_parameter () = + Tezos_clic.parameter + ~autocomplete:Client_keys.Aggregate_alias.Public_key_hash.autocomplete + (fun cctxt s -> + let open Lwt_result_syntax in + let from_alias s = + let* (Bls12_381 pkh) = + Client_keys.Aggregate_alias.Public_key_hash.find cctxt s + in + return pkh + in + let from_key s = + Tezos_crypto.Bls.Public_key_hash.of_b58check s |> Lwt.return + in + alias_or_literal ~from_alias ~from_key s) + +let conv_bls_pkh_to_l2_addr pkh = + Tezos_crypto.Bls.Public_key_hash.to_b58check pkh + |> Tx_rollup_l2_address.of_b58check_exn + +let bls_pkh_param ?(name = "public key hash") + ?(desc = "bls public key hash to use") = + let desc = + String.concat + "\n" + [ + desc; "Can be an alias or a key.\nUse 'alias:name', 'key:name' to force."; + ] + in + Tezos_clic.param + ~name + ~desc + (Tezos_clic.map_parameter ~f:conv_bls_pkh_to_l2_addr (bls_pkh_parameter ())) + +let bls_sk_uri_parameter () = + Tezos_clic.parameter + ~autocomplete:Client_keys.Aggregate_alias.Secret_key.autocomplete + Client_keys.Aggregate_alias.Secret_key.find + +let bls_sk_uri_param ?(name = "secret key") ?(desc = "Bls secret key to use.") = + let desc = + String.concat + "\n" + [ + desc; "Can be an alias or a key.\nUse 'alias:name', 'key:name' to force."; + ] + in + Tezos_clic.param ~name ~desc (bls_sk_uri_parameter ()) + +let signature_parameter () = + Tezos_clic.parameter (fun _cctxt s -> + Tezos_crypto.Bls.of_b58check s |> Lwt.return) + +let signature_arg = + Tezos_clic.arg + ~doc:"aggregated signature" + ~long:"aggregated-signature" + ~placeholder:"current aggregated signature" + (signature_parameter ()) + +let transaction_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try + Data_encoding.Json.destruct + Tx_rollup_l2_batch.V1.transaction_encoding + json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid JSON for a message result path: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + +let transaction_param next = + Tezos_clic.param + ~name:"transaction" + ~desc:"Transaction" + transaction_parameter + next + +let l2_transaction_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try Data_encoding.Json.destruct L2_transaction.encoding json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid JSON for a l2 transaction: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + +let l2_transaction_param next = + Tezos_clic.param + ~name:"signed l2 transaction" + ~desc: + "Signed l2 transaction. Must be a valid json with the following format: \ + {\"transaction\": ; \"signatures\": []}" + l2_transaction_parameter + next + +let block_id_param = + let open Lwt_result_syntax in + Tezos_clic.parameter (fun _ s -> + match RPC.destruct_block_id s with + | Ok v -> return v + | Error e -> failwith "%s" e) + +let ticket_hash_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter (fun _ s -> + match Alpha_context.Ticket_hash.of_b58check_opt s with + | Some tkh -> return tkh + | None -> failwith "cannot parse %s to get a valid ticket_hash" s) + +let non_negative_param = + Tezos_clic.parameter (fun _ s -> + match int_of_string_opt s with + | Some i when i >= 0 -> return i + | _ -> failwith "Parameter should be a non-negative integer literal") + +let get_tx_address_balance_command () = + Tezos_clic.command + ~desc:"returns the balance associated to a given tz4 address and ticket" + (Tezos_clic.args1 + (Tezos_clic.default_arg + ~long:"block" + ~placeholder:"block" + ~doc:"block from which the balance is expected" + ~default:"head" + block_id_param)) + (Tezos_clic.prefixes ["get"; "balance"; "for"] + @@ bls_pkh_param + ~name:"tz4" + ~desc:"tz4 address from which the balance is queried" + @@ Tezos_clic.prefixes ["of"] + @@ Tezos_clic.param + ~name:"ticket-hash" + ~desc:"ticket from which the balance is expected" + ticket_hash_parameter + @@ Tezos_clic.stop) + (fun block tz4 ticket (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* value = RPC.balance cctxt block ticket tz4 in + let*! () = cctxt#message "@[%a@]" Tx_rollup_l2_qty.pp value in + return_unit) + +let get_tx_inbox () = + Tezos_clic.command + ~desc:"returns the inbox for a given block identifier" + Tezos_clic.no_options + (Tezos_clic.prefixes ["get"; "inbox"; "for"] + @@ Tezos_clic.param + ~name:"block" + ~desc:"block from which the inbox is requested" + block_id_param + @@ Tezos_clic.stop) + (fun () block (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* inbox = RPC.inbox cctxt block in + let json = Data_encoding.(Json.construct (option Inbox.encoding)) inbox in + let*! () = cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) in + return_unit) + +let format_flag = + Tezos_clic.default_arg + ~doc: + "Whether to return the L2 block in raw format (raw) or as a more human \ + readable version (fancy, default).\n" + ~long:"format" + ~placeholder:"FORMAT" + ~default:"fancy" + (Tezos_clic.parameter (fun (cctxt : #Client_context.printer) format -> + match format with + | "fancy" -> Lwt.return_ok `Fancy + | "raw" -> Lwt.return_ok `Raw + | _ -> + cctxt#error + "Cannot decode --format argument, use 'raw' or 'fancy'.")) + +let get_tx_block () = + Tezos_clic.command + ~desc:"returns the tx rollup block for a given block identifier" + (Tezos_clic.args1 format_flag) + (Tezos_clic.prefixes ["get"; "block"] + @@ Tezos_clic.param ~name:"block" ~desc:"block requested" block_id_param + @@ Tezos_clic.stop) + (fun format block (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* json = + match format with + | `Fancy -> + let+ block = RPC.block cctxt block in + Data_encoding.(Json.construct (option RPC.Encodings.block)) block + | `Raw -> + let+ block = RPC.raw_block cctxt block in + Data_encoding.(Json.construct (option RPC.Encodings.raw_block)) + block + in + let*! () = cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) in + return_unit) + +let craft_transfers ~counter ~signer transfers = + let contents = + List.map + (fun (qty, destination, ticket_hash) -> + Tx_rollup_l2_batch.V1.( + Transfer + { + destination = Indexable.from_value destination; + ticket_hash = Indexable.from_value ticket_hash; + qty; + })) + transfers + in + let signer = Indexable.from_value signer in + Tx_rollup_l2_batch.V1.{signer; counter; contents} + +let craft_tx ~counter ~signer ~destination ~ticket_hash ~qty = + craft_transfers ~counter ~signer [(qty, destination, ticket_hash)] + +let sign_transaction cctxt sks_uri txs = + let open Lwt_result_syntax in + let buf = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_l2_batch.V1.transaction_encoding + txs + in + List.map_ep + (fun sk -> + let* signature = Client_keys.aggregate_sign cctxt sk buf in + match signature with + | Bls12_381 signature -> return signature + | Unknown _signature -> failwith "failed to sign") + sks_uri + +let craft_withdraw ~counter ~signer ~destination ~ticket_hash ~qty = + let content = + Tx_rollup_l2_batch.V1.(Withdraw {destination; ticket_hash; qty}) + in + let signer = Indexable.from_value signer in + Tx_rollup_l2_batch.V1.{signer; counter; contents = [content]} + +let aggregate_signature signatures = + let open Result_syntax in + match Tezos_crypto.Bls.aggregate_signature_opt signatures with + | Some res -> return res + | None -> error_with "aggregate_signature" + +let craft_batch ~transactions = + let open Result_syntax in + let transactions, signatures = + List.split + (List.map + (fun L2_transaction.{transaction; signatures} -> + (transaction, signatures)) + transactions) + in + let* aggregated_signature = aggregate_signature (List.concat signatures) in + return Tx_rollup_l2_batch.V1.{aggregated_signature; contents = transactions} + +let conv_qty = + Tezos_clic.parameter (fun _ qty -> + match Tx_rollup_l2_qty.of_string qty with + | Some qty -> return qty + | None -> failwith "The given qty is invalid") + +let conv_counter = + Tezos_clic.parameter (fun _ counter -> return (Int64.of_string counter)) + +let signer_to_address : Tx_rollup_l2_batch.signer -> Tx_rollup_l2_address.t = + function + | Bls_pk pk -> Tezos_crypto.Bls.Public_key.hash pk + | L2_addr addr -> addr + +let wait_for_synchronized ?(quiet = false) + (ctxt : Configuration.tx_client_context) = + let open Lwt_result_syntax in + let display = ref false in + let first_sync_block = ref None in + Lwt.dont_wait + (fun () -> + if (not !display) && not quiet then ( + let*! () = + ctxt#message "Waiting for the rollup node to be synchronized...\n" + in + display := true ; + Lwt.return_unit) + else Lwt.return_unit) + (fun exc -> + let (_ : unit Lwt.t) = + let*! () = + ctxt#error "Uncaught exception: %s\n%!" (Printexc.to_string exc) + in + ctxt#error "Progress not monitored anymore\n%!" + in + ()) ; + let* stream, _stop = RPC.monitor_synchronized ctxt in + let*! () = + Lwt_stream.iter_s + (fun sync_status -> + match sync_status with + | `Synchronizing State.{processed_tezos_level; known_tezos_level} + when !display -> + let first_sync_block = + Option.value_f !first_sync_block ~default:(fun () -> + first_sync_block := Some processed_tezos_level ; + processed_tezos_level) + in + let total_blocks = Int32.sub known_tezos_level first_sync_block in + let synced_blocks = + Int32.sub processed_tezos_level first_sync_block + in + let progress = + if total_blocks < 0l || synced_blocks > total_blocks then 1.0 + else Int32.to_float synced_blocks /. Int32.to_float total_blocks + in + ctxt#message + "\027[A\027[G%a (%ld/%ld)" + (Progress_bar.pp ~width:40) + progress + processed_tezos_level + known_tezos_level + | `Synchronized when !display -> + ctxt#message "Rollup node is synchronized." + | _ -> Lwt.return_unit) + stream + in + return_unit + +let signer_next_counter cctxt signer counter = + let open Lwt_result_syntax in + match counter with + | Some counter -> return counter + | None -> + (* Retrieve the counter of the current head and increments it + by one. *) + let* counter = RPC.counter cctxt `Head @@ signer_to_address signer in + return (Int64.succ counter) + +let signer_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter (fun _ s -> + match Tx_rollup_l2_address.of_b58check_opt s with + | Some pkh -> return @@ Tx_rollup_l2_batch.L2_addr pkh + | None -> ( + match Tezos_crypto.Bls.Public_key.of_b58check_opt s with + | Some pk -> return @@ Tx_rollup_l2_batch.Bls_pk pk + | None -> failwith "cannot parse %s to get a valid signer" s)) + +let craft_tx_transfers () = + Tezos_clic.command + ~desc:"WIP: craft a transaction with transfers" + (Tezos_clic.args1 + (Tezos_clic.arg + ~long:"counter" + ~placeholder:"counter" + ~doc:"counter value of the destination" + conv_counter)) + (Tezos_clic.prefixes ["craft"; "tx"; "transfers"; "from"] + @@ Tezos_clic.param + ~name:"signer" + ~desc:"public key or public key hash of the signer" + signer_parameter + @@ Tezos_clic.prefix "using" + @@ Tezos_clic.param + ~name:"transfers.json" + ~desc: + "List of transfers from the signer in JSON format (from a file or \ + directly inlined). The input JSON must be an array of objects of \ + the form '[ {\"destination\": dst, \"qty\" : val, \"ticket_hash\" \ + : ticket_hash} ]'" + json_file_or_text_parameter + @@ Tezos_clic.stop) + (fun counter + signer + transfers_json + (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let transfers_encoding = + let open Data_encoding in + let transfer_encoding = + obj3 + (req "qty" string) + (req "destination" string) + (req "ticket_hash" string) + in + list transfer_encoding + in + match Data_encoding.Json.destruct transfers_encoding transfers_json with + | [] -> failwith "Empty transfer list" + | transfers -> + let transfers = + List.map + (fun (qty, destination, ticket) -> + ( Int64.of_string qty |> Tx_rollup_l2_qty.of_int64_exn, + Tx_rollup_l2_address.of_b58check_exn destination, + Alpha_context.Ticket_hash.of_b58check_exn ticket )) + transfers + in + let* () = wait_for_synchronized ~quiet:true cctxt in + let* counter = signer_next_counter cctxt signer counter in + let op = craft_transfers ~counter ~signer transfers in + let json = + Data_encoding.Json.construct + Tx_rollup_l2_batch.V1.transaction_encoding + [op] + in + let*! () = cctxt#answer "@[%a@]" Data_encoding.Json.pp json in + return_unit) + +let craft_tx_transaction () = + Tezos_clic.command + ~desc:"WIP: craft a transaction" + (Tezos_clic.args1 + (Tezos_clic.arg + ~long:"counter" + ~placeholder:"counter" + ~doc:"counter value of the destination" + conv_counter)) + (Tezos_clic.prefixes ["craft"; "tx"; "transferring"] + @@ Tezos_clic.param ~name:"qty" ~desc:"qty to transfer" conv_qty + @@ Tezos_clic.prefixes ["from"] + @@ Tezos_clic.param + ~name:"signer" + ~desc:"public key or public key hash of the signer" + signer_parameter + @@ Tezos_clic.prefixes ["to"] + @@ bls_pkh_param ~name:"dest" ~desc:"tz4 destination address" + @@ Tezos_clic.prefixes ["for"] + @@ Tezos_clic.param + ~name:"ticket" + ~desc:"ticket to transfer" + ticket_hash_parameter + @@ Tezos_clic.stop) + (fun counter + qty + signer + destination + ticket_hash + (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* () = wait_for_synchronized ~quiet:true cctxt in + let* counter = signer_next_counter cctxt signer counter in + let op = craft_tx ~counter ~signer ~destination ~ticket_hash ~qty in + let json = + Data_encoding.Json.construct + Tx_rollup_l2_batch.V1.transaction_encoding + [op] + in + let*! () = cctxt#answer "@[%a@]" Data_encoding.Json.pp json in + return_unit) + +let craft_tx_withdrawal () = + Tezos_clic.command + ~desc:"WIP: craft a withdrawal from L2 to L1" + (Tezos_clic.args1 + (Tezos_clic.arg + ~long:"counter" + ~placeholder:"counter" + ~doc:"counter value of the destination" + conv_counter)) + (Tezos_clic.prefixes ["craft"; "tx"; "withdrawing"] + @@ Tezos_clic.param ~name:"qty" ~desc:"qty to withdraw" conv_qty + @@ Tezos_clic.prefixes ["from"] + @@ Tezos_clic.param + ~name:"signer" + ~desc:"public key or public key hash of the signer" + signer_parameter + @@ Tezos_clic.prefixes ["to"] + @@ Tezos_clic.param + ~name:"dest" + ~desc:"L1 destination address" + l1_destination_parameter + @@ Tezos_clic.prefixes ["for"] + @@ Tezos_clic.param + ~name:"ticket" + ~desc:"ticket to withdraw" + ticket_hash_parameter + @@ Tezos_clic.stop) + (fun counter + qty + signer + destination + ticket_hash + (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* () = wait_for_synchronized ~quiet:true cctxt in + let* counter = signer_next_counter cctxt signer counter in + let op = craft_withdraw ~counter ~signer ~destination ~ticket_hash ~qty in + let json = + Data_encoding.Json.construct + Tx_rollup_l2_batch.V1.transaction_encoding + [op] + in + let*! () = cctxt#answer "@[%a@]" Data_encoding.Json.pp json in + return_unit) + +let craft_tx_batch () = + Tezos_clic.command + ~desc:"craft a batch from a list of signed layer-2 transactions" + (Tezos_clic.args1 + (Tezos_clic.switch + ~doc:"Bytes representation of the batch encoded in hexadecimal" + ~long:"bytes" + ())) + (Tezos_clic.prefixes ["craft"; "batch"; "with"] + @@ Tezos_clic.seq_of_param l2_transaction_param) + (fun show_bytes transactions (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let*? batch = craft_batch ~transactions in + if show_bytes then + let bytes = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_l2_batch.encoding + (Tx_rollup_l2_batch.V1 batch) + in + let*! () = cctxt#message "@[%a@]" Hex.pp (Hex.of_bytes bytes) in + return_unit + else + let json = + Data_encoding.Json.construct + Tx_rollup_l2_batch.encoding + (Tx_rollup_l2_batch.V1 batch) + in + let*! () = cctxt#message "@[%a@]" Data_encoding.Json.pp json in + return_unit) + +let get_batcher_queue () = + Tezos_clic.command + ~desc:"returns the batcher's queue of pending operations" + Tezos_clic.no_options + (Tezos_clic.prefixes ["get"; "batcher"; "queue"] @@ Tezos_clic.stop) + (fun () (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* queue = RPC.get_queue cctxt in + let json = + Data_encoding.(Json.construct (list L2_transaction.encoding) queue) + in + let*! () = cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) in + return_unit) + +let valid_transaction_hash = + Tezos_clic.parameter (fun _ s -> + match L2_transaction.Hash.of_b58check_opt s with + | Some addr -> return addr + | None -> failwith "The L2 transaction hash is invalid") + +let get_batcher_transaction () = + Tezos_clic.command + ~desc:"returns a batcher transaction for a given hash" + Tezos_clic.no_options + (Tezos_clic.prefixes ["get"; "batcher"; "transaction"] + @@ Tezos_clic.param + ~name:"hash" + ~desc:"requested transaction hash" + valid_transaction_hash + @@ Tezos_clic.stop) + (fun () hash (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* tx = RPC.get_transaction cctxt hash in + let json = + Data_encoding.(Json.construct (option L2_transaction.encoding)) tx + in + let*! () = cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) in + return_unit) + +let inject_batcher_transaction () = + Tezos_clic.command + ~desc:"injects the given transaction into the batcher's transaction queue" + Tezos_clic.no_options + (Tezos_clic.prefixes ["inject"; "batcher"; "transaction"] + @@ l2_transaction_param @@ Tezos_clic.stop) + (fun () transaction_and_sig (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* txh = RPC.inject_transaction cctxt transaction_and_sig in + let json = + Data_encoding.(Json.construct L2_transaction.Hash.encoding txh) + in + let*! () = cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) in + return_unit) + +let prepare_operation_parameters cctxt signer counter = + let open Tx_rollup_l2_batch in + let open Lwt_result_syntax in + let*? signer_pk = + match signer.public_key with + | Some pk -> ok pk + | None -> error_with "missing signer public key in the wallet" + in + let signer_addr = Tezos_crypto.Bls.Public_key.hash signer_pk in + let* () = wait_for_synchronized cctxt in + let* counter = + match counter with + | Some counter -> return counter + | None -> + let+ counter = RPC.counter cctxt `Head signer_addr in + Int64.succ counter + in + let*? sk_uri = + match signer.secret_key_uri with + | None -> error_with "missing secret key in wallet" + | Some sk_uri -> ok sk_uri + in + (* For the very first operation sent by a given account, we need + to provide the full public key; otherwise, sending the public + key hash is fine. *) + let signer = + if Compare.Int64.(counter = 1L) then Bls_pk signer_pk + else L2_addr signer_addr + in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2903 + Use an RPC to know whether or not it can be safely replaced by + an index. *) + let signer = Indexable.from_value signer in + + return (signer, sk_uri, counter) + +let transfer () = + Tezos_clic.command + ~desc:"submit a layer-2 transfer to a rollup node’s batcher" + (Tezos_clic.args1 + (Tezos_clic.arg + ~long:"counter" + ~short:'c' + ~placeholder:"counter" + ~doc:"The counter associated to the signer address" + conv_counter)) + (Tezos_clic.prefix "transfer" + @@ Tezos_clic.param ~name:"qty" ~desc:"quantity to transfer" conv_qty + @@ Tezos_clic.prefix "of" + @@ Tezos_clic.param + ~name:"ticket" + ~desc:"A ticket hash" + ticket_hash_parameter + @@ Tezos_clic.prefix "from" + @@ wallet_param ~name:"source" + @@ Tezos_clic.prefix "to" + @@ bls_pkh_param + ~name:"destination" + ~desc:"A BLS public key hash or an alias" + @@ Tezos_clic.stop) + (fun counter qty ticket_hash signer destination cctxt -> + let open Lwt_result_syntax in + let open Tx_rollup_l2_batch.V1 in + let* signer, sk_uri, counter = + prepare_operation_parameters cctxt signer counter + in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2903 + Use an RPC to know whether or not it can be safely replaced by + an index. *) + let destination = Indexable.from_value destination in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2903 + Use an RPC to know whether or not it can be safely replaced by + an index. *) + let ticket_hash = Indexable.from_value ticket_hash in + let contents = [Transfer {destination; ticket_hash; qty}] in + let operation = Tx_rollup_l2_batch.V1.{counter; signer; contents} in + let transaction = [operation] in + let* signatures = sign_transaction cctxt [sk_uri] transaction in + let* hash = RPC.inject_transaction cctxt {transaction; signatures} in + let*! () = + cctxt#message "Transaction hash: %a" L2_transaction.Hash.pp hash + in + return_unit) + +let withdraw () = + Tezos_clic.command + ~desc:"submit a layer-2 withdraw to a rollup node’s batcher" + (Tezos_clic.args1 + (Tezos_clic.arg + ~long:"counter" + ~short:'c' + ~placeholder:"counter" + ~doc:"The counter associated to the signer address" + conv_counter)) + (Tezos_clic.prefix "withdraw" + @@ Tezos_clic.param ~name:"qty" ~desc:"quantity to withdraw" conv_qty + @@ Tezos_clic.prefix "of" + @@ Tezos_clic.param + ~name:"ticket" + ~desc:"A ticket hash" + ticket_hash_parameter + @@ Tezos_clic.prefix "from" + @@ wallet_param ~name:"source" ~desc:"An alias for a tz4 address" + @@ Tezos_clic.prefix "to" + @@ tezos_pkh_param ~name:"destination" ~desc:"A L1 public key hash" + @@ Tezos_clic.stop) + (fun counter qty ticket_hash signer destination cctxt -> + let open Lwt_result_syntax in + let open Tx_rollup_l2_batch.V1 in + let* signer, sk_uri, counter = + prepare_operation_parameters cctxt signer counter + in + let contents = [Withdraw {destination; ticket_hash; qty}] in + let operation = Tx_rollup_l2_batch.V1.{counter; signer; contents} in + let transaction = [operation] in + let* signatures = sign_transaction cctxt [sk_uri] transaction in + let* hash = RPC.inject_transaction cctxt {transaction; signatures} in + let*! () = + cctxt#message "Transaction hash: %a" L2_transaction.Hash.pp hash + in + return_unit) + +let sign_transaction () = + Tezos_clic.command + ~desc:"sign a transaction" + (Tezos_clic.args2 + (Tezos_clic.switch ~doc:"aggregate signature" ~long:"aggregate" ()) + signature_arg) + (Tezos_clic.prefixes ["sign"; "transaction"] + @@ transaction_param @@ Tezos_clic.prefix "with" + @@ Tezos_clic.seq_of_param bls_sk_uri_param) + (fun (aggregate, aggregated_signature) + transactions + sks_uri + (cctxt : #Configuration.tx_client_context) -> + let open Lwt_result_syntax in + let* signatures = sign_transaction cctxt sks_uri transactions in + if aggregate then + let signatures = + match aggregated_signature with + | Some aggregated_signature -> aggregated_signature :: signatures + | None -> signatures + in + let*? aggregated_signature = aggregate_signature signatures in + + let*! () = + cctxt#message "@[%a@]" Tezos_crypto.Bls.pp aggregated_signature + in + return_unit + else + let*! () = + cctxt#message + "@[%a@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.pp_print_string ppf ";") + Tezos_crypto.Bls.pp) + signatures + in + return_unit) + +let display_answer (cctxt : #Configuration.tx_client_context) : + Tezos_rpc.Context.generic_call_result -> unit Lwt.t = function + | `Json (`Ok json) -> cctxt#answer "%a" Json_repr.(pp (module Ezjsonm)) json + | `Binary (`Ok binary) -> cctxt#answer "%a" Hex.pp (Hex.of_string binary) + | `Json (`Error (Some error)) -> + cctxt#error + "@[Command failed: @[%a@]@]@." + (Format.pp_print_list Error_monad.pp) + (Data_encoding.Json.destruct + (Data_encoding.list Error_monad.error_encoding) + error) + | `Binary (`Error (Some error)) -> ( + match Data_encoding.Binary.of_string Error_monad.trace_encoding error with + | Ok trace -> + cctxt#error + "@[Command failed: @[%a@]@]@." + Error_monad.pp_print_trace + trace + | Error msg -> + cctxt#error + "@[Error whilst decoding the server response: @[%a@]@]@." + Data_encoding.Binary.pp_read_error + msg) + | `Json (`Not_found _) | `Binary (`Not_found _) | `Other (_, `Not_found _) -> + cctxt#error "No service found at this URL\n%!" + | `Json (`Gone _) | `Binary (`Gone _) | `Other (_, `Gone _) -> + cctxt#error + "Requested data concerns a pruned block and target resource is no \ + longer available\n\ + %!" + | `Json (`Unauthorized _) + | `Binary (`Unauthorized _) + | `Other (_, `Unauthorized _) -> + cctxt#error "@[[HTTP 403] Access denied to: %a@]@." Uri.pp cctxt#base + | _ -> cctxt#error "Unexpected server answer\n%!" + +let call ?body meth raw_url (cctxt : #Configuration.tx_client_context) = + let open Lwt_result_syntax in + let uri = Uri.of_string raw_url in + let body = + (* This code is similar to a piece of code in [fill_in] + function. An RPC is declared as POST, PATCH or PUT, but the + body is not given. In that case, the body should be an empty + JSON object. *) + match (meth, body) with + | _, Some _ -> body + | `DELETE, None | `GET, None -> None + | `PATCH, None | `PUT, None | `POST, None -> Some (`O []) + in + let* answer = cctxt#generic_media_type_call ?body meth uri in + let*! () = display_answer cctxt answer in + return_unit + +let call_with_json meth raw_url json (cctxt : #Configuration.tx_client_context) + = + match Data_encoding.Json.from_string json with + | exception Assert_failure _ -> + (* Ref : https://github.com/mirage/ezjsonm/issues/31 *) + cctxt#error "Failed to parse the provided json: unwrapped JSON value.\n%!" + | Error err -> cctxt#error "Failed to parse the provided json: %s\n%!" err + | Ok body -> call meth ~body raw_url cctxt + +let call_with_file_or_json meth url maybe_file + (cctxt : #Configuration.tx_client_context) = + let open Lwt_result_syntax in + let* json = + match TzString.split ':' ~limit:1 maybe_file with + | ["file"; filename] -> + Lwt.catch + (fun () -> + Lwt_result.ok @@ Lwt_io.(with_file ~mode:Input filename read)) + (fun exn -> failwith "cannot read file (%s)" (Printexc.to_string exn)) + | _ -> return maybe_file + in + call_with_json meth url json cctxt + +let rpc_commands () = + let group = + {Tezos_clic.name = "rpc"; title = "Commands for the low level RPC layer"} + in + [ + Tezos_clic.command + ~group + ~desc:"Call an RPC with the GET method." + Tezos_clic.no_options + (Tezos_clic.prefixes ["rpc"; "get"] + @@ Tezos_clic.string ~name:"url" ~desc:"the RPC URL" + @@ Tezos_clic.stop) + (fun () -> call `GET); + Tezos_clic.command + ~group + ~desc:"Call an RPC with the POST method." + Tezos_clic.no_options + (Tezos_clic.prefixes ["rpc"; "post"] + @@ Tezos_clic.string ~name:"url" ~desc:"the RPC URL" + @@ Tezos_clic.stop) + (fun () -> call `POST); + Tezos_clic.command + ~group + ~desc: + "Call an RPC with the POST method, providing input data via the \ + command line." + Tezos_clic.no_options + (Tezos_clic.prefixes ["rpc"; "post"] + @@ Tezos_clic.string ~name:"url" ~desc:"the RPC URL" + @@ Tezos_clic.prefix "with" + @@ Tezos_clic.string + ~name:"input" + ~desc: + "the raw JSON input to the RPC\n\ + For instance, use `{}` to send the empty document.\n\ + Alternatively, use `file:path` to read the JSON data from a file." + @@ Tezos_clic.stop) + (fun () -> call_with_file_or_json `POST); + ] + +let get_message_proof () = + let open Lwt_result_syntax in + Tezos_clic.command + ~desc: + "returns the proof for a given block identifier and a message position \ + for the according inbox" + Tezos_clic.no_options + (Tezos_clic.prefixes ["get"; "proof"; "for"; "message"; "at"; "position"] + @@ Tezos_clic.param + ~name:"position" + ~desc:"message position in the inbox" + non_negative_param + @@ Tezos_clic.prefixes ["in"; "block"] + @@ Tezos_clic.param + ~name:"block" + ~desc:"block from which the message's proof is requested" + block_id_param + @@ Tezos_clic.stop) + (fun () message_position block (cctxt : #Configuration.tx_client_context) -> + RPC.get_message_proof cctxt block ~message_position >>=? fun proof -> + let json = + Data_encoding.( + Json.construct (option Tx_rollup_l2_proof.encoding) proof) + in + cctxt#message "@[%s@]" (Data_encoding.Json.to_string json) >>= fun () -> + return_unit) + +let all () = + [ + get_tx_address_balance_command (); + get_tx_inbox (); + get_tx_block (); + craft_tx_transaction (); + craft_tx_transfers (); + craft_tx_withdrawal (); + craft_tx_batch (); + sign_transaction (); + get_batcher_queue (); + get_batcher_transaction (); + inject_batcher_transaction (); + transfer (); + withdraw (); + get_message_proof (); + ] + @ rpc_commands () diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.mli b/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.mli new file mode 100644 index 000000000000..83608d10e4ed --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/commands.mli @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [all ()] is the list of commands recognized by the transaction + rollup client. These commands may depend on the client + configuration. *) + +val all : unit -> Configuration.tx_client_context Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.ml b/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.ml new file mode 100644 index 000000000000..c7ad33663412 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.ml @@ -0,0 +1,138 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Lwt_result_syntax +module Base = Tezos_client_base + +type t = {base_dir : string; wallet_dir : string; endpoint : Uri.t} + +let default_base_dir = Filename.concat (Sys.getenv "HOME") ".tezos-client" + +let default_tezos_base_dir = + Tezos_client_base_unix.Client_config.default_base_dir + +let default_endpoint = "http://localhost:9999" + +let default = + { + base_dir = default_base_dir; + wallet_dir = default_tezos_base_dir; + endpoint = Uri.of_string default_endpoint; + } + +let valid_endpoint _configuration s = + let endpoint = Uri.of_string s in + match (Uri.scheme endpoint, Uri.query endpoint, Uri.fragment endpoint) with + | Some ("http" | "https"), [], None -> return endpoint + | _ -> failwith "Endpoint should be of the form http[s]://address:port" + +let endpoint_arg () = + Tezos_clic.arg + ~long:"endpoint" + ~short:'E' + ~placeholder:"uri" + ~doc: + (Printf.sprintf + "endpoint of the tx rollup node; e.g. '%s'" + default_endpoint) + @@ Tezos_clic.parameter valid_endpoint + +let valid_dir _configuration base_dir = + match Sys.is_directory base_dir with + | true -> return base_dir + | false | (exception Sys_error _) -> + failwith "%s does not seem to be an existing directory" base_dir + +let base_dir_arg () = + Tezos_clic.arg + ~long:"base-dir" + ~short:'d' + ~placeholder:"path" + ~doc: + (Format.asprintf + "@[@[<2>Tezos transaction rollup client data directory@,\ + The directory where the Tezos transaction rollup client stores its \ + data.@,\ + If absent, its value defaults to %s@]@]@." + default_base_dir) + (Tezos_clic.parameter valid_dir) + +let wallet_dir_arg () = + Tezos_clic.arg + ~long:"wallet-dir" + ~short:'w' + ~placeholder:"path" + ~doc: + (Format.asprintf + "@[@[<2>Wallet directory@,\ + The directory where to look for known keys.@,\ + If absent, its value defaults to %s@]@]@." + default_tezos_base_dir) + (Tezos_clic.parameter valid_dir) + +let global_options () = + Tezos_clic.args3 (base_dir_arg ()) (wallet_dir_arg ()) (endpoint_arg ()) + +let make (base_dir, wallet_dir, endpoint) = + { + base_dir = Option.value base_dir ~default:default_base_dir; + wallet_dir = Option.value wallet_dir ~default:default_tezos_base_dir; + endpoint = Option.value endpoint ~default:(Uri.of_string default_endpoint); + } + +let parse argv = + let* opts, argv = + Tezos_clic.parse_global_options (global_options ()) default argv + in + return (make opts, argv) + +class type tx_client_context = + object + inherit Base.Client_context.io_wallet + + inherit Tezos_rpc.Context.generic + end + +class unix_tx_client_context ~wallet_dir ~password_filename ~rpc_config : + tx_client_context = + object + inherit + Client_context_unix.unix_io_wallet ~base_dir:wallet_dir ~password_filename + + inherit + Tezos_rpc_http_client_unix.RPC_client_unix.http_ctxt + rpc_config + (Tezos_rpc_http.Media_type.Command_line.of_command_line + rpc_config.media_type) + end + +(* for the moment the base_dir is not used but it's going to be soon when for + example we save the config *) +let make_unix_client_context {base_dir = _; wallet_dir; endpoint} = + let rpc_config = + {Tezos_rpc_http_client_unix.RPC_client_unix.default_config with endpoint} + in + + new unix_tx_client_context ~wallet_dir ~rpc_config ~password_filename:None diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.mli b/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.mli new file mode 100644 index 000000000000..0c5e5b66ad32 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/configuration.mli @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Client configuration. *) +type t = private { + base_dir : string; + (** [base_dir] is a directory where client user data is stored. *) + wallet_dir : string; + (** [base_dir] is a directory where client keys are stored. *) + endpoint : Uri.t; + (** [endpoint] is used to communicate with the transaction rollup + node. *) +} + +(** [parse argv] parses command-line arguments to return + [(configuration, argv')] where [configuration] is deduced from the + command-line arguments and [argv'] is the rest of the command-line + arguments that have no meaning relatively to [Configuration]. *) +val parse : string list -> (t * string list) tzresult Lwt.t + +(** [global_options ()] returns the list of options that have an + influence on the configuration. *) +val global_options : + unit -> (string option * string option * Uri.t option, 'a) Tezos_clic.options + +(** Instance of [Tezos_client_base.Client_context] that only handles IOs and + RPCs. Can be used for keys and RPCs related commands. *) +class type tx_client_context = + object + inherit Tezos_client_base.Client_context.io_wallet + + inherit Tezos_rpc.Context.generic + end + +(** Instance of [tx_client_context] for linux systems. Relies on + [Tezos_rpc_http_client_unix]. *) +class unix_tx_client_context : + wallet_dir:string + -> password_filename:string option + -> rpc_config:Tezos_rpc_http_client_unix.RPC_client_unix.config + -> tx_client_context + +(** [make_unix_client_context config] generates a unix_tx_client_context from + the client configuration. *) +val make_unix_client_context : t -> unix_tx_client_context diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/dune b/src/proto_016_PtMumbai/bin_tx_rollup_client/dune new file mode 100644 index 000000000000..9389a79136e2 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/dune @@ -0,0 +1,32 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_tx_rollup_client_alpha) + (public_name octez-tx-rollup-client-alpha) + (package octez-tx-rollup-client-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-client-alpha + tezos-client-alpha.commands + tezos-client-base-unix + tezos-stdlib-unix + tezos-tx-rollup-alpha + uri) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha.Protocol + -open Tezos_client_alpha + -open Tezos_client_alpha_commands + -open Tezos_client_base_unix + -open Tezos_stdlib_unix + -open Tezos_tx_rollup_alpha)) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/main_tx_rollup_client_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_tx_rollup_client/main_tx_rollup_client_016_PtMumbai.ml new file mode 100644 index 000000000000..bd688f020a2b --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/main_tx_rollup_client_016_PtMumbai.ml @@ -0,0 +1,135 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let executable_name = Filename.basename Sys.executable_name + +let argv () = Array.to_list Sys.argv |> List.tl |> Stdlib.Option.get + +let register_signers () = + Tezos_client_base.Client_keys.register_aggregate_signer + (module Tezos_signer_backends.Unencrypted.Aggregate) + +(* FIXME: https://gitlab.com/tezos/tezos/-/issues/4025 + Remove backwards compatible Tezos symlinks. *) +let warn_if_argv0_name_not_octez () = + let executable_name = + (* example: tezos-tx-rollup-client-015-PtKathma *) + Filename.basename Sys.argv.(0) + in + let old_head = "tezos-" in + let new_head = "octez-" in + match TzString.has_prefix executable_name ~prefix:old_head with + | false -> () + | true -> + let expected_name = + let len_prefix = String.length old_head in + let headless_name = + (* example: tx-rollup-client-015-PtKathma *) + String.sub + executable_name + len_prefix + (String.length executable_name - len_prefix) + in + let name_without_version name = + match headless_name |> String.starts_with ~prefix:name with + | false -> None + | true -> + let len_name = String.length name in + let version_proto = + (* example: -015-PtKathma *) + String.sub + headless_name + len_name + (String.length headless_name - len_name) + in + let num_hyphens = + (* example: 2 *) + version_proto + |> String.fold_left + (fun acc c -> match c with '-' -> acc + 1 | _ -> acc) + 0 + in + let proto = + (* example: -PtKathma *) + if num_hyphens = 2 then + String.sub version_proto 4 (String.length version_proto - 4) + else version_proto + in + Some (name ^ proto) + in + (* example: tx-rollup-client-PtKathma *) + let versionless_name = + ["accuser"; "baker"; "tx-rollup-client"; "tx-rollup-node"] + |> List.map name_without_version + |> List.find Option.is_some |> Option.join + in + (* example: octez-tx-rollup-client-PtKathma *) + new_head + ^ + match versionless_name with + | None -> headless_name + | Some versionless_name -> versionless_name + in + Format.eprintf + "@[@{@{Warning@}@}@,\ + The executable with name @{<kwd>%s@} has been renamed to @{<kwd>%s@}. \ + The name @{<kwd>%s@} is now@,\ + deprecated, and it will be removed in a future release. Please update@,\ + your scripts to use the new name.@]@\n\ + @." + executable_name + expected_name + executable_name + +let main () = + warn_if_argv0_name_not_octez () ; + Configuration.parse (argv ()) >>=? fun (configuration, argv) -> + register_signers () ; + let cctxt = Configuration.make_unix_client_context configuration in + Tezos_clic.dispatch (Commands.all ()) cctxt argv + +let handle_error = function + | Ok () -> Stdlib.exit 0 + | Error [Tezos_clic.Version] -> + let version = Tezos_version.Bin_version.version_string in + Format.printf "%s@." version ; + Stdlib.exit 0 + | Error [Tezos_clic.Help command] -> + Tezos_clic.usage + Format.std_formatter + ~executable_name + ~global_options:(Configuration.global_options ()) + (Stdlib.Option.to_list command) ; + Stdlib.exit 0 + | Error errs -> + Tezos_clic.pp_cli_errors + Format.err_formatter + ~executable_name + ~global_options:(Configuration.global_options ()) + ~default:Error_monad.pp + errs ; + Stdlib.exit 1 + +let () = Lwt_main.run (Lwt.catch main fail_with_exn) |> handle_error diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.ml b/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.ml new file mode 100644 index 000000000000..f65dc32958af --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.ml @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let progress_bar_str ~progress ~width = + (* 0 <= progress <= 1 *) + let progress = min 1. (max 0. progress) in + let filled_width = progress *. float_of_int width in + let whole_width = int_of_float filled_width in + let remainder_width = filled_width -. float_of_int whole_width in + let part_width = int_of_float (remainder_width *. 8.) in + let empty_width = width - whole_width - 1 in + let part_char = + if empty_width < 0 then "" + else + match part_width with + | 0 -> " " + | 1 -> "▏" + | 2 -> "▎" + | 3 -> "▍" + | 4 -> "▌" + | 5 -> "▋" + | 6 -> "▊" + | _ -> "▉" + in + let empty_width = max empty_width 0 in + let filled = + String.concat "" + @@ + match List.init ~when_negative_length:[] whole_width (fun _ -> "█") with + | Error _ -> [] + | Ok l -> l + in + String.concat "" ["["; filled; part_char; String.make empty_width ' '; "]"] + +let pp ppf ~width progress = + Format.fprintf + ppf + "%s %5.1f %%" + (progress_bar_str ~progress ~width) + (progress *. 100.) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.mli b/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.mli new file mode 100644 index 000000000000..cd90e836a518 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/progress_bar.mli @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [pp ppf ~width percentage] displays a progress bar of size [width] on + formatter [ppf] filled to the value specified by [percentage] (between [0.0] + and [1.0]). *) +val pp : Format.formatter -> width:int -> float -> unit diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_node/dune b/src/proto_016_PtMumbai/bin_tx_rollup_node/dune new file mode 100644 index 000000000000..7fbae62f8e39 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_node/dune @@ -0,0 +1,29 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_tx_rollup_node_alpha) + (public_name octez-tx-rollup-node-alpha) + (package octez-tx-rollup-node-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-client-alpha + tezos-client-base + tezos-client-base-unix + tezos-tx-rollup-alpha) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base + -open Tezos_protocol_alpha + -open Tezos_client_alpha + -open Tezos_client_base + -open Tezos_client_base_unix + -open Tezos_tx_rollup_alpha)) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_node/main_tx_rollup_node_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_tx_rollup_node/main_tx_rollup_node_016_PtMumbai.ml new file mode 100644 index 000000000000..4d6d99a785fe --- /dev/null +++ b/src/proto_016_PtMumbai/bin_tx_rollup_node/main_tx_rollup_node_016_PtMumbai.ml @@ -0,0 +1,487 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let force_switch = + Tezos_clic.switch + ~long:"force" + ~doc:"Overwrites the configuration file when it exists." + () + +let data_dir_doc = + Format.sprintf "The directory path to the transaction rollup node data." + +let rpc_addr_doc = + Format.asprintf + "The address and port where the node listens to RPCs. The default is %s" + +let reconnection_delay_doc = + Format.asprintf + "The reconnection delay when the connection is lost. The default delay is \ + %f" + +let data_dir_arg = + let doc = data_dir_doc in + Tezos_clic.arg + ~long:"data-dir" + ~placeholder:"data_dir" + ~doc + Client_proto_args.string_parameter + +let operator_arg = + Client_keys.Public_key_hash.source_arg + ~long:"operator" + ~placeholder:"operator" + ~doc:"The operator of the rollup" + () + +let batch_signer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"batch-signer" + ~placeholder:"batch-signer" + ~doc:"The signer for submission of batches" + () + +let finalize_commitment_signer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"finalize-commitment-signer" + ~placeholder:"finalize-commitment-signer" + ~doc:"The signer for finalization of commitments" + () + +let remove_commitment_signer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"remove-commitment-signer" + ~placeholder:"remove-commitment-signer" + ~doc:"The signer for removals of commitments" + () + +let rejection_signer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"rejection-signer" + ~placeholder:"rejection-signer" + ~doc:"The signer for rejections" + () + +let dispatch_withdrawals_signer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"dispatch-withdrawals-signer" + ~placeholder:"dispatch-withdrawals-signer" + ~doc:"The signer for dispatch withdrawals" + () + +let rollup_id_param = + let open Client_proto_rollups in + Tezos_clic.parameter ~autocomplete:TxRollupAlias.autocomplete (fun cctxt s -> + let from_alias s = TxRollupAlias.find cctxt s in + let from_key s = TxRollupAlias.of_source s in + Client_aliases.parse_alternatives + [("alias", from_alias); ("key", from_key)] + s) + +let origination_level_arg = + Tezos_clic.arg + ~long:"origination-level" + ~placeholder:"origination_level" + ~doc:"The level of the block where the rollup was originated" + (Tezos_clic.parameter (fun _ str -> + match Int32.of_string_opt str with + | None -> failwith "Invalid origination level" + | Some l -> return l)) + +let rpc_addr_arg = + let default = P2p_point.Id.to_string Node_config.default_rpc_addr in + let doc = rpc_addr_doc default in + Tezos_clic.arg + ~long:"rpc-addr" + ~placeholder:"address:port" + ~doc + (Tezos_clic.parameter (fun _ s -> + P2p_point.Id.of_string s + |> Result.map_error (fun e -> [Exn (Failure e)]) + |> Lwt.return)) + +let rpc_addr_opt_arg = + let default = P2p_point.Id.to_string Node_config.default_rpc_addr in + let doc = rpc_addr_doc default in + Tezos_clic.arg + ~long:"rpc-addr" + ~placeholder:"address:port" + ~doc + (Tezos_clic.parameter (fun _ s -> + P2p_point.Id.of_string s + |> Result.map_error (fun e -> [Exn (Failure e)]) + |> Lwt.return)) + +let cors_origins_arg = + Tezos_clic.arg + ~doc: + "CORS origins allowed by the RPC server via Access-Control-Allow-Origin" + ~placeholder:"c1, c2, ..." + ~long:"cors-origins" + @@ Tezos_clic.parameter (fun _ctxt s -> + String.split_no_empty ',' s |> List.map String.trim |> return) + +let cors_headers_arg = + Tezos_clic.arg + ~doc: + "Header reported by Access-Control-Allow-Headers reported during CORS \ + preflighting" + ~placeholder:"h1, h2, ..." + ~long:"cors-headers" + @@ Tezos_clic.parameter (fun _ctxt s -> + String.split_no_empty ',' s |> List.map String.trim |> return) + +let reconnection_delay_arg = + let default = Node_config.default_reconnection_delay in + let doc = reconnection_delay_doc default in + Tezos_clic.arg + ~long:"reconnection-delay" + ~placeholder:"delay" + ~doc + (Tezos_clic.parameter (fun _ p -> + try return (float_of_string p) with _ -> failwith "Cannot read float")) + +let possible_modes = List.map Node_config.string_of_mode Node_config.modes + +let mode_parameter = + Tezos_clic.parameter + ~autocomplete:(fun _ -> return possible_modes) + (fun _ m -> Lwt.return (Node_config.mode_of_string m)) + +let mode_param = + Tezos_clic.param + ~name:"mode" + ~desc: + (Printf.sprintf + "The mode for the rollup node (%s)" + (String.concat ", " possible_modes)) + mode_parameter + +let allow_deposit_arg = + Tezos_clic.switch + ~doc:"Allow the operator to make a first deposit for commitments" + ~long:"allow-deposit" + () + +let group = + Tezos_clic. + { + name = "tx_rollup.node"; + title = "Commands related to the transaction rollup node"; + } + +let config_from_args data_dir (rollup_id : Client_proto_rollups.TxRollupAlias.t) + mode operator batch_signer finalize_commitment_signer + remove_commitment_signer rejection_signer dispatch_withdrawals_signer + origination_level rpc_addr cors_origins cors_headers allow_deposit + reconnection_delay = + let open Lwt_syntax in + let origination_level = + Option.either rollup_id.origination_level origination_level + in + let rollup_id = rollup_id.rollup in + let+ data_dir = + match data_dir with + | Some d -> return d + | None -> Node_config.default_data_dir rollup_id + in + let rpc_addr = Option.value rpc_addr ~default:Node_config.default_rpc_addr in + let reconnection_delay = + Option.value + reconnection_delay + ~default:Node_config.default_reconnection_delay + in + Node_config. + { + data_dir; + mode; + signers = + { + operator; + submit_batch = batch_signer; + finalize_commitment = finalize_commitment_signer; + remove_commitment = remove_commitment_signer; + rejection = rejection_signer; + dispatch_withdrawals = dispatch_withdrawals_signer; + }; + rollup_id; + origination_level; + rpc_addr; + cors_origins = Option.value cors_origins ~default:[]; + cors_headers = Option.value cors_headers ~default:[]; + reconnection_delay; + allow_deposit; + l2_blocks_cache_size = default_l2_blocks_cache_size; + caps = default_caps; + batch_burn_limit = None; + } + +let patch_config_from_args config + (rollup_id : Client_proto_rollups.TxRollupAlias.t) mode operator + batch_signer finalize_commitment_signer remove_commitment_signer + rejection_signer dispatch_withdrawals_signer origination_level rpc_addr + cors_origins cors_headers allow_deposit reconnection_delay = + let origination_level = + Option.either rollup_id.origination_level origination_level + in + let rollup_id = rollup_id.rollup in + if + Protocol.Alpha_context.Tx_rollup.(rollup_id <> config.Node_config.rollup_id) + then + error_with + "Rollup node is configured for rollup %a but asked to run for rollup %a" + Protocol.Alpha_context.Tx_rollup.pp + config.Node_config.rollup_id + Protocol.Alpha_context.Tx_rollup.pp + rollup_id + else + let operator = Option.either operator config.signers.operator in + let submit_batch = Option.either batch_signer config.signers.submit_batch in + let finalize_commitment = + Option.either + finalize_commitment_signer + config.signers.finalize_commitment + in + let remove_commitment = + Option.either remove_commitment_signer config.signers.remove_commitment + in + let dispatch_withdrawals = + Option.either + dispatch_withdrawals_signer + config.signers.dispatch_withdrawals + in + let rejection = Option.either rejection_signer config.signers.rejection in + let signers = + { + Node_config.operator; + submit_batch; + finalize_commitment; + remove_commitment; + dispatch_withdrawals; + rejection; + } + in + let origination_level = + Option.either origination_level config.origination_level + in + let rpc_addr = Option.value rpc_addr ~default:config.rpc_addr in + let cors_origins = Option.value cors_origins ~default:config.cors_origins in + let cors_headers = Option.value cors_headers ~default:config.cors_headers in + let reconnection_delay = + Option.value reconnection_delay ~default:config.reconnection_delay + in + let allow_deposit = allow_deposit || config.allow_deposit in + let config = + { + config with + mode; + signers; + origination_level; + rpc_addr; + cors_origins; + cors_headers; + reconnection_delay; + allow_deposit; + } + in + ok config + +let configuration_init_command = + let open Tezos_clic in + command + ~group + ~desc:"Configure the transaction rollup daemon." + (args14 + force_switch + data_dir_arg + operator_arg + batch_signer_arg + finalize_commitment_signer_arg + remove_commitment_signer_arg + rejection_signer_arg + dispatch_withdrawals_signer_arg + origination_level_arg + rpc_addr_arg + cors_origins_arg + cors_headers_arg + allow_deposit_arg + reconnection_delay_arg) + (prefix "init" @@ mode_param + @@ prefixes ["config"; "for"] + @@ Tezos_clic.param + ~name:"rollup-id" + ~desc:"address of the rollup" + rollup_id_param + @@ stop) + (fun ( force, + data_dir, + operator, + batch_signer, + finalize_commitment_signer, + remove_commitment_signer, + rejection_signer, + dispatch_withdrawals_signer, + origination_level, + rpc_addr, + cors_origins, + cors_headers, + allow_deposit, + reconnection_delay ) + mode + rollup_id + cctxt -> + let open Lwt_result_syntax in + let*! () = Event.(emit preamble_warning) () in + let*! config = + config_from_args + data_dir + rollup_id + mode + operator + batch_signer + finalize_commitment_signer + remove_commitment_signer + rejection_signer + dispatch_withdrawals_signer + origination_level + rpc_addr + cors_origins + cors_headers + allow_deposit + reconnection_delay + in + let*? config = Node_config.check_mode config in + let* file = Node_config.save ~force config in + (* This is necessary because the node has not yet been launched, so event + listening can't be used. *) + let*! () = cctxt#message "Configuration written in %s" file in + let*! () = Event.(emit configuration_was_written) file in + return_unit) + +let run_command = + let open Lwt_result_syntax in + let open Tezos_clic in + command + ~group + ~desc:"Run the transaction rollup daemon." + (args13 + data_dir_arg + operator_arg + batch_signer_arg + finalize_commitment_signer_arg + remove_commitment_signer_arg + rejection_signer_arg + dispatch_withdrawals_signer_arg + origination_level_arg + rpc_addr_opt_arg + cors_origins_arg + cors_headers_arg + allow_deposit_arg + reconnection_delay_arg) + (prefix "run" @@ mode_param @@ prefix "for" + @@ Tezos_clic.param + ~name:"rollup-id" + ~desc:"address of the rollup" + rollup_id_param + @@ stop) + (fun ( data_dir, + operator, + batch_signer, + finalize_commitment_signer, + remove_commitment_signer, + rejection_signer, + dispatch_withdrawals_signer, + origination_level, + rpc_addr, + cors_origins, + cors_headers, + allow_deposit, + reconnection_delay ) + mode + rollup_id + cctxt -> + let*! () = Event.(emit preamble_warning) () in + let*! config_from_args = + config_from_args + data_dir + rollup_id + mode + operator + batch_signer + finalize_commitment_signer + remove_commitment_signer + rejection_signer + dispatch_withdrawals_signer + origination_level + rpc_addr + cors_origins + cors_headers + allow_deposit + reconnection_delay + in + let* config = + match data_dir with + | None -> return config_from_args + | Some data_dir -> ( + let*! disk_config = Node_config.load ~data_dir in + match disk_config with + | Error (Error.Tx_rollup_configuration_file_does_not_exists _ :: _) + -> + return config_from_args + | Error _ as err -> Lwt.return err + | Ok config -> + let*? config = + patch_config_from_args + config + rollup_id + mode + operator + batch_signer + finalize_commitment_signer + remove_commitment_signer + rejection_signer + dispatch_withdrawals_signer + origination_level + rpc_addr + cors_origins + cors_headers + allow_deposit + reconnection_delay + in + return config) + in + let*? config = Node_config.check_mode config in + Daemon.run config cctxt) + +let tx_rollup_commands () = + List.map + (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + [configuration_init_command; run_command] + +let select_commands _ _ = return (tx_rollup_commands ()) + +let () = Client_main_run.run (module Daemon_config) ~select_commands diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml b/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml new file mode 100644 index 000000000000..84b1b1f937e6 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml @@ -0,0 +1,418 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Wasm_utils +open Repl_helpers +open Tezos_scoru_wasm + +(* Possible step kinds. *) +type eval_step = + | Tick (** Tick per tick *) + | Result (** Up to Eval (Result (SK_Result _ | SK_Trap _)) *) + | Kernel_run (** Up to the end of the current `kernal_run` *) + | Inbox (** Until input requested *) + +(* Possible commands for the REPL. *) +type commands = + | Show_inbox + | Show_outbox of int32 + | Show_status + | Show_durable_storage + | Show_key of string + | Show_memory of int32 * int + | Step of eval_step + | Load_inputs + | Unknown of string + | Stop + +let parse_eval_step = function + | "tick" -> Some Tick + | "result" -> Some Result + | "kernel_run" -> Some Kernel_run + | "inbox" -> Some Inbox + | _ -> None + +let parse_commands s = + let command = String.split_no_empty ' ' (String.trim s) in + match command with + | ["show"; "inbox"] -> Show_inbox + | ["show"; "outbox"; "at"; "level"; level] -> ( + match Int32.of_string_opt level with + | Some l -> Show_outbox l + | None -> Unknown s) + | ["show"; "status"] -> Show_status + | ["show"; "durable"; "storage"] -> Show_durable_storage + | ["show"; "key"; key] -> Show_key key + | ["show"; "memory"; "at"; address; "for"; length; "bytes"] -> ( + match (Int32.of_string_opt address, int_of_string_opt length) with + | Some address, Some length -> Show_memory (address, length) + | _, _ -> Unknown s) + | ["step"; step] -> ( + match parse_eval_step step with Some s -> Step s | None -> Unknown s) + | ["load"; "inputs"] -> Load_inputs + | ["stop"] -> Stop + | _ -> Unknown s + +(* [compute_step tree] is a wrapper around [Wasm_pvm.compute_step] that also + returns the number of ticks elapsed (whi is always 1). *) +let compute_step tree = + let open Lwt_syntax in + trap_exn (fun () -> + let+ tree = Wasm.compute_step tree in + (tree, 1L)) + +(** [eval_to_result tree] tries to evaluates the PVM until the next `SK_Result` + or `SK_Trap`, and stops in case of reveal tick or input tick. It has the + property that the memory hasn't been flushed yet and can be inspected. *) +let eval_to_result tree = + let open Lwt_syntax in + let open Wasm_pvm_state in + let should_compute pvm_state = + let+ input_request_val = Wasm_vm.get_info pvm_state in + match (input_request_val.input_request, pvm_state.tick_state) with + | Reveal_required _, _ | Input_required, _ -> false + | ( No_input_required, + Eval + { + config = + { + step_kont = + Tezos_webassembly_interpreter.Eval.( + SK_Result _ | SK_Trapped _); + _; + }; + _; + } ) -> + false + | No_input_required, _ -> true + in + (* Since `compute_step_many_until` is not exported by the PVM but only the VM, + we decode and re-encode by hand. *) + trap_exn (fun () -> + let* pvm_state = + Test_encodings_util.Tree_encoding_runner.decode + Tezos_scoru_wasm.Wasm_pvm.pvm_state_encoding + tree + in + let* pvm_state, ticks = + Tezos_scoru_wasm.Wasm_vm.compute_step_many_until + ~max_steps:Int64.max_int + should_compute + pvm_state + in + let+ tree = + Test_encodings_util.Tree_encoding_runner.encode + Tezos_scoru_wasm.Wasm_pvm.pvm_state_encoding + pvm_state + tree + in + (tree, ticks)) + +(* [eval_kernel_run tree] evals up to the end of the current `kernel_run` (or + starts a new one if already at snapshot point). *) +let eval_kernel_run tree = + let open Lwt_syntax in + trap_exn (fun () -> + let* info_before = Wasm.get_info tree in + let* tree = eval_to_snapshot ~max_steps:Int64.max_int tree in + let+ info_after = Wasm.get_info tree in + ( tree, + Z.to_int64 @@ Z.sub info_after.current_tick info_before.current_tick )) + +(* Wrapper around {Wasm_utils.eval_until_input_requested}. *) +let eval_until_input_requested tree = + let open Lwt_syntax in + trap_exn (fun () -> + let* info_before = Wasm.get_info tree in + let* tree = eval_until_input_requested ~max_steps:Int64.max_int tree in + let+ info_after = Wasm.get_info tree in + ( tree, + Z.to_int64 @@ Z.sub info_after.current_tick info_before.current_tick )) + +(* Eval dispatcher. *) +let eval = function + | Tick -> compute_step + | Result -> eval_to_result + | Kernel_run -> eval_kernel_run + | Inbox -> eval_until_input_requested + +let set_raw_message_input_step level counter encoded_message tree = + Wasm.set_input_step (input_info level counter) encoded_message tree + +(* [check_input_request tree] checks the PVM is waiting for inputs, and returns + an hint to go to the next input request state otherwise. *) +let check_input_request tree = + let open Lwt_syntax in + let* info = Wasm.get_info tree in + match info.Wasm_pvm_state.input_request with + | Input_required -> return_ok_unit + | No_input_required -> + return_error + "The PVM is not expecting inputs yet. You can `step inbox` to evaluate \ + the current inbox." + | Reveal_required _ -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4208 *) + return_error + "The PVM is expecting a reveal. This command is not implemented yet." + +(* [load_inputs_gen inboxes level tree] reads the next inbox from [inboxes], set the + messages at [level] in the [tree], and returns the remaining inbox, the next + level and the tree. *) +let load_inputs_gen inboxes level tree = + let open Lwt_result_syntax in + match Seq.uncons inboxes with + | Some (inputs, inboxes) -> + let* tree = + trap_exn (fun () -> + set_full_input_step_gen set_raw_message_input_step inputs level tree) + in + let*! () = + Lwt_io.printf + "Loaded %d inputs at level %ld\n%!" + (List.length inputs) + level + in + return (tree, inboxes, Int32.succ level) + | None -> + let*! () = Lwt_io.printf "No more inputs at level %ld\n%!" level in + return (tree, inboxes, level) + +let load_inputs inboxes level tree = + let open Lwt_result_syntax in + let*! status = check_input_request tree in + match status with + | Ok () -> load_inputs_gen inboxes level tree + | Error msg -> + Format.printf "%s\n%!" msg ; + return (tree, inboxes, level) + +let pp_input_request ppf = function + | Wasm_pvm_state.No_input_required -> Format.fprintf ppf "Evaluating" + | Input_required -> Format.fprintf ppf "Waiting for input" + | Reveal_required Reveal_metadata -> Format.fprintf ppf "Waiting for metadata" + | Reveal_required (Reveal_raw_data hash) -> + Format.fprintf ppf "Waiting for reveal: %s" hash + +(* [show_status tree] show the state of the PVM. *) +let show_status tree = + let open Lwt_syntax in + let* state = Wasm.Internal_for_tests.get_tick_state tree in + let* info = Wasm.get_info tree in + Lwt_io.printf + "%s\n%!" + (Format.asprintf + "Status: %a\nInternal_status: %a" + pp_input_request + info.Wasm_pvm_state.input_request + pp_state + state) + +(* [step kind tree] evals according to the step kind and prints the number of + ticks elapsed and the new status. *) +let step kind tree = + let open Lwt_result_syntax in + let* tree, ticks = eval kind tree in + let*! () = Lwt_io.printf "Evaluation took %Ld ticks so far\n" ticks in + let*! () = show_status tree in + return tree + +(* [show_inbox tree] prints the current input buffer and the number of messages + it contains. *) +let show_inbox tree = + let open Lwt_syntax in + let* input_buffer = Wasm.Internal_for_tests.get_input_buffer tree in + let* messages = + Tezos_lazy_containers.Lazy_vector.( + Mutable.ZVector.snapshot input_buffer |> ZVector.to_list) + in + let messages_sorted = + List.sort Messages.compare_input_buffer_messages messages + in + let pp_message ppf + Tezos_webassembly_interpreter.Input_buffer. + {raw_level; message_counter; payload} = + Format.fprintf + ppf + {|{ raw_level: %ld; + counter: %s + payload: %a }|} + raw_level + (Z.to_string message_counter) + Messages.pp_input + payload + in + let pp_messages () = + Format.asprintf + "%a" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "\n") + pp_message) + messages_sorted + in + + let size = + Tezos_lazy_containers.Lazy_vector.Mutable.ZVector.num_elements input_buffer + in + Lwt_io.printf + "Inbox has %s messages:\n%s\n%!" + (Z.to_string size) + (pp_messages ()) + +(* [show_outbox_gen tree level] prints the outbox messages for a given level. *) +let show_outbox_gen tree level = + let open Lwt_syntax in + let* output_buffer = Wasm.Internal_for_tests.get_output_buffer tree in + let* level_vector = + Tezos_webassembly_interpreter.Output_buffer.get_outbox output_buffer level + in + let* messages = + Tezos_lazy_containers.Lazy_vector.( + Mutable.ZVector.snapshot level_vector |> ZVector.to_list) + in + let pp_messages () = + Format.asprintf + "%a" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "\n") + Messages.pp_output) + messages + in + let size = + Tezos_lazy_containers.Lazy_vector.Mutable.ZVector.num_elements level_vector + in + Lwt_io.printf + "Outbox has %s messages:\n%s\n%!" + (Z.to_string size) + (pp_messages ()) + +(* [show_outbox tree level] prints the outbox messages for a given level. *) +let show_outbox tree level = + Lwt.catch + (fun () -> show_outbox_gen tree level) + (fun _ -> Lwt_io.printf "No outbox found at level %ld\n%!" level) + +(* [show_durable] prints the durable storage from the tree. *) +let show_durable tree = Repl_helpers.print_durable ~depth:10 tree + +(* [show_key_gen tree key] looks for the given [key] in the durable storage and + print its value in hexadecimal format. *) +let show_key_gen tree key = + let open Lwt_syntax in + let* value = Repl_helpers.find_key_in_durable tree key in + match value with + | None -> + Format.printf "Key not found\n%!" ; + return_unit + | Some v -> + let+ str_value = Tezos_lazy_containers.Chunked_byte_vector.to_string v in + Format.printf "%a\n%!" Hex.pp (Hex.of_string str_value) + +(* [show_key tree key] looks for the given [key] in the durable storage and + print its value in hexadecimal format. Prints errors in case the key is + invalid or not existing. *) +let show_key tree key = + Lwt.catch + (fun () -> + let key = Tezos_scoru_wasm.Durable.key_of_string_exn key in + show_key_gen tree key) + (function + | Tezos_scoru_wasm.Durable.Invalid_key _ -> + Lwt_io.printf "Invalid key\n%!" + | Tezos_scoru_wasm.Durable.Value_not_found -> + Lwt_io.printf "No value found for key\n%!" + | Tezos_scoru_wasm.Durable.Tree_not_found -> + Lwt_io.printf "No tree found for key\n%!" + | exn -> + Lwt_io.printf "Unknown exception: %s\n%!" (Printexc.to_string exn)) + +exception Cannot_inspect_memory of string + +(* [load_memory tree] finds the memory module 0 from the tree, only and only if + the PVM is in an Init or Eval state. *) +let load_memory tree = + let open Lwt_syntax in + let* state = Wasm.Internal_for_tests.get_tick_state tree in + let* module_inst = + match state with + | Eval _ | Init _ -> Wasm.Internal_for_tests.get_module_instance_exn tree + | _ -> raise (Cannot_inspect_memory (Format.asprintf "%a" pp_state state)) + in + Lwt.catch + (fun () -> + Tezos_lazy_containers.Lazy_vector.Int32Vector.get 0l module_inst.memories) + (fun _ -> raise Tezos_webassembly_interpreter.Eval.Missing_memory_0_export) + +(* [show_memory tree address length] loads the [length] bytes at address + [address] in the memory, and prints it in its hexadecimal representation. *) +let show_memory tree address length = + let open Lwt_syntax in + Lwt.catch + (fun () -> + let* memory = load_memory tree in + let* value = + Tezos_webassembly_interpreter.Memory.load_bytes memory address length + in + Lwt_io.printf "%s\n%!" + @@ Format.asprintf "%a" Hex.pp (Hex.of_string value)) + (function + | Cannot_inspect_memory state -> + Lwt_io.printf + "Error: Cannot inspect memory during internal state %s\n%!" + state + | exn -> Lwt_io.printf "Error: %s\n%!" (Printexc.to_string exn)) + +(* [handle_command command tree inboxes level] dispatches the commands to their + actual implementation. *) +let handle_command c tree inboxes level = + let open Lwt_result_syntax in + let command = parse_commands c in + let return ?(tree = tree) () = return (tree, inboxes, level) in + match command with + | Load_inputs -> load_inputs inboxes level tree + | Show_status -> + let*! () = show_status tree in + return () + | Step kind -> + let* tree = step kind tree in + return ~tree () + | Show_inbox -> + let*! () = show_inbox tree in + return () + | Show_outbox level -> + let*! () = show_outbox tree level in + return () + | Show_durable_storage -> + let*! () = show_durable tree in + return () + | Show_key key -> + let*! () = show_key tree key in + return () + | Show_memory (address, length) -> + let*! () = show_memory tree address length in + return () + | Unknown s -> + let*! () = Lwt_io.eprintf "Unknown command `%s`\n%!" s in + return () + | Stop -> return () diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/config.ml b/src/proto_016_PtMumbai/bin_wasm_repl/config.ml new file mode 100644 index 000000000000..88456aeba19c --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/config.ml @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let default_sender = Protocol.Contract_hash.zero + +let default_source = Tezos_crypto.Signature.Public_key_hash.zero + +let default_destination = Protocol.Alpha_context.Sc_rollup.Address.zero + +type config = { + sender : Protocol.Contract_hash.t; + source : Tezos_crypto.Signature.public_key_hash; + destination : Protocol.Alpha_context.Sc_rollup.t; +} + +let config ?(sender = default_sender) ?(source = default_source) + ?(destination = default_destination) () = + {sender; source; destination} diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/dune b/src/proto_016_PtMumbai/bin_wasm_repl/dune new file mode 100644 index 000000000000..335edec6db1b --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/dune @@ -0,0 +1,39 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main_wasm_repl_alpha) + (public_name octez-wasm-repl-alpha) + (package octez-wasm-repl) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-tree-encoding + tezos-base.unix + tezos-context.disk + tezos-base-test-helpers + tezos-client-base + tezos-client-alpha + tezos-scoru-wasm + test_scoru_wasm_test_helpers + tezos-webassembly-interpreter + tezos-webassembly-interpreter-extra + tezos-protocol-alpha + tezos-protocol-plugin-alpha + tezos-protocol-alpha.parameters) + (preprocess (staged_pps ppx_import ppx_deriving.show)) + (link_flags + (:standard) + (:include %{workspace_root}/static-link-flags.sexp)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base_test_helpers + -open Tezos_client_alpha + -open Test_scoru_wasm_test_helpers + -open Tezos_webassembly_interpreter + -open Tezos_webassembly_interpreter_extra + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_alpha_parameters)) diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/main_wasm_repl_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_wasm_repl/main_wasm_repl_016_PtMumbai.ml new file mode 100644 index 000000000000..872c8aab6b57 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/main_wasm_repl_016_PtMumbai.ml @@ -0,0 +1,186 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Wasm_utils + +(* [parse_binary_module module_name module_stream] parses a binary encoded + module. Parsing outside of the PVM allows locations in case of errors. *) +let parse_binary_module name module_ = + let bytes = Tezos_lazy_containers.Chunked_byte_vector.of_string module_ in + Tezos_webassembly_interpreter.Decode.decode ~allow_floats:false ~name ~bytes + +(* [typecheck_module module_ast] runs the typechecker on the module, which is + not done by the PVM. *) +let typecheck_module module_ = + Repl_helpers.trap_exn (fun () -> + Tezos_webassembly_interpreter.Valid.check_module module_) + +(* [import_pvm_host_functions ()] registers the host functions of the PVM. *) +let import_pvm_host_functions () = + let lookup name = Lwt.return (Tezos_scoru_wasm.Host_funcs.lookup name) in + Repl_helpers.trap_exn (fun () -> + Lwt.return + (Tezos_webassembly_interpreter.Import.register + ~module_name:"smart_rollup_core" + lookup)) + +(* [link module_ast] checks a module actually uses the host functions with their + correct type, outside of the PVM. *) +let link module_ = + Repl_helpers.trap_exn (fun () -> + Tezos_webassembly_interpreter.Import.link module_) + +(* Starting point of the module after reading the kernel file: parsing, + typechecking and linking for safety before feeding kernel to the PVM, then + installation into a tree for the PVM interpreter. *) +let handle_module binary name module_ = + let open Lwt_result_syntax in + let open Protocol.Alpha_context.Sc_rollup in + let* ast = + Repl_helpers.trap_exn (fun () -> + if binary then parse_binary_module name module_ + else Lwt.return (parse_module module_)) + in + let* () = typecheck_module ast in + let* () = import_pvm_host_functions () in + let* _ = link ast in + let*! tree = + initial_tree + ~max_tick:(Z.to_int64 Wasm_2_0_0PVM.ticks_per_snapshot) + ~outbox_validity_period:Wasm_2_0_0PVM.outbox_validity_period + ~outbox_message_limit:Wasm_2_0_0PVM.outbox_message_limit + ~from_binary:binary + module_ + in + let*! tree = eval_until_input_requested tree in + return tree + +let start binary file = + let open Lwt_result_syntax in + let module_name = Filename.(file |> basename |> chop_extension) in + let*! buffer = Repl_helpers.read_file file in + handle_module binary module_name buffer + +(* REPL main loop: reads an input, does something out of it, then loops. *) +let repl tree inboxes level = + let open Lwt_result_syntax in + let rec loop tree inboxes level = + let*! () = Lwt_io.printf "> " in + let* input = + Lwt.catch + (fun () -> + let*! i = Lwt_io.read_line Lwt_io.stdin in + return_some i) + (fun _ -> return_none) + in + match input with + | Some command -> + let* tree, inboxes, level = + Commands.handle_command command tree inboxes level + in + loop tree inboxes level + | None -> return tree + in + loop tree (List.to_seq inboxes) level + +let file_parameter = + Tezos_clic.parameter (fun _ filename -> + Repl_helpers.(trap_exn (fun () -> read_file filename))) + +let wasm_param = + let open Lwt_result_syntax in + Tezos_clic.( + param + ~name:"module" + ~desc:"wasm or wast file" + (parameter (fun _ filename -> return filename))) + +let input_arg = + let open Tezos_clic in + arg ~doc:"input file" ~long:"inputs" ~placeholder:"inputs.json" file_parameter + +let main_command = + let open Tezos_clic in + let open Lwt_result_syntax in + command + ~desc:"Start the eval loop" + (args1 input_arg) + (wasm_param @@ stop) + (fun inputs wasm_file () -> + let config = Config.config () in + let*? binary = + if Filename.check_suffix wasm_file ".wasm" then Ok true + else if Filename.check_suffix wasm_file ".wast" then Ok false + else error_with "Kernels should have .wasm or .wast file extension" + in + let* tree = start binary wasm_file in + let* inboxes = + match inputs with + | Some inputs -> Messages.parse_inboxes inputs config + | None -> return [] + in + let+ _tree = repl tree inboxes 0l in + ()) + +(* List of program commands *) +let commands = [main_command] + +let global_options = Tezos_clic.no_options + +let dispatch initial_ctx args = + let open Lwt_result_syntax in + let* ctx, remaining_args = + Tezos_clic.parse_global_options global_options initial_ctx args + in + Tezos_clic.dispatch commands ctx remaining_args + +let () = + ignore + Tezos_clic.( + setup_formatter + Format.std_formatter + (if Unix.isatty Unix.stdout then Ansi else Plain) + Short) ; + let args = Array.to_list Sys.argv |> List.tl |> Option.value ~default:[] in + let result = Lwt_main.run (dispatch () args) in + match result with + | Ok _ -> () + | Error [Tezos_clic.Version] -> + let version = Tezos_version.Bin_version.version_string in + Format.printf "%s\n" version ; + exit 0 + | Error e -> + Format.eprintf + "%a\n%!" + Tezos_clic.( + fun ppf errs -> + pp_cli_errors + ppf + ~executable_name:"octez-wasm-repl" + ~global_options:no_options + ~default:pp + errs) + e ; + exit 1 diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/messages.ml b/src/proto_016_PtMumbai/bin_wasm_repl/messages.ml new file mode 100644 index 000000000000..cc74c059ddd4 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/messages.ml @@ -0,0 +1,188 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* Encoding reading string as Michelson data, of the form "Pair Unit...". It can + only be used for decoding however, not encoding. *) +let parsed_string_encoding = + Data_encoding.conv + (fun _ -> Stdlib.failwith "This value is not supposed to be encoded") + (fun s -> + let parsed, _ = Michelson_v1_parser.parse_expression s in + parsed.Michelson_v1_parser.expanded) + Data_encoding.string + +(* [input_encoding default_sender default_source default_destination] is an + alternative encoding for {Sc_rollup_inbox_message_repr.t} that only encodes + `Internal Transfer` and `External`. In the case of `Internal Transfer`, only + the Micheline payload is mandatory, the other field are taken from the + default one if they are missing. *) +let input_encoding default_sender default_source default_destination = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Transfer" + (obj4 + (req "payload" parsed_string_encoding) + (dft "sender" Contract_hash.encoding default_sender) + (dft + "source" + Tezos_crypto.Signature.Public_key_hash.encoding + default_source) + (dft + "destination" + Sc_rollup_repr.Address.encoding + default_destination)) + (function + | Sc_rollup.Inbox_message.( + Internal (Transfer {payload; sender; source; destination})) -> + Some (payload, sender, source, destination) + | _ -> None) + (fun (payload, sender, source, destination) -> + Internal (Transfer {payload; sender; source; destination})); + case + (Tag 1) + ~title:"External" + (obj1 (req "external" string)) + (function + | Sc_rollup.Inbox_message.External msg -> + let (`Hex msg) = Hex.of_string msg in + Some msg + | Internal _ -> None) + (fun msg -> + External (Hex.to_string (`Hex msg) |> Option.value ~default:"")); + ] + +(* Represent a set of inboxes, i.e. a set of set of inputs. The position of an + inbox in the list represents its level. *) +type inboxes = Sc_rollup.Inbox_message.t list list + +let inboxes_encoding default_sender default_source default_destination = + Data_encoding.( + list + (list (input_encoding default_sender default_source default_destination))) + +(* [parse_inboxes inputs config] parses an inbox from raw string. *) +let parse_inboxes inputs Config.{sender; source; destination} = + let open Lwt_result_syntax in + match Data_encoding.Json.from_string inputs with + | Ok json -> + let* full_inputs = + (fun () -> + Lwt.return + (Data_encoding.Json.destruct + (inboxes_encoding sender source destination) + json)) + |> Repl_helpers.trap_exn + in + List.map_es + (fun inputs -> + List.map_es + (fun input -> + Protocol.Alpha_context.Sc_rollup.Inbox_message.( + serialize input + |> Result.map unsafe_to_string + |> Environment.wrap_tzresult |> Lwt.return)) + inputs) + full_inputs + | Error e -> Error_monad.failwith "%s" e + +(* [pp_input ppf bytes] is a pretty printer for Sc_rollup.Inbox messages that + also handles deserialization from raw bytes. If the message cannot be + decoded, it prints its hexadecimal representation. *) +let pp_input ppf bytes = + let pp ppf = function + | Sc_rollup.Inbox_message.(Internal (Transfer _) as msg) -> + let json = + Data_encoding.Json.construct Sc_rollup.Inbox_message.encoding msg + in + Data_encoding.Json.pp ppf json + | Internal Start_of_level -> Format.fprintf ppf "Start_of_level" + | Internal End_of_level -> Format.fprintf ppf "End_of_level" + | Internal (Info_per_level {predecessor_timestamp; predecessor}) -> + Format.fprintf + ppf + "Info_per_level {predecessor_timestamp = %a; predecessor = %a}" + Timestamp.pp + predecessor_timestamp + Tezos_crypto.Block_hash.pp + predecessor + | External msg -> Format.fprintf ppf "%a" Hex.pp (Hex.of_string msg) + in + match + Sc_rollup.Inbox_message.( + deserialize (unsafe_of_string (Bytes.to_string bytes))) + with + | Error _ -> + Format.fprintf ppf "Unknown encoding: %a" Hex.pp (Hex.of_bytes bytes) + | Ok msg -> pp ppf msg + +let compare_input_buffer_messages i1 i2 = + let cmp_lvl = + Int32.compare + i1.Tezos_webassembly_interpreter.Input_buffer.raw_level + i2.Tezos_webassembly_interpreter.Input_buffer.raw_level + in + if cmp_lvl = 0 then Z.compare i1.message_counter i2.message_counter + else cmp_lvl + +(* [pp_output ppf bytes] is a pretty printer for Sc_rollup.Outbox messages that + also handles deserialization from raw bytes. If the message cannot be + decoded, it prints its hexadecimal representation. *) +let pp_output ppf bytes = + let pp_message ppf + Sc_rollup.Outbox.Message.{unparsed_parameters; destination; entrypoint} = + let json = + Data_encoding.Json.construct Script_repr.expr_encoding unparsed_parameters + in + Format.fprintf + ppf + "@[{ unparsed_parameters: %a@; destination: %a@; entrypoint: %a }@]" + Data_encoding.Json.pp + json + Contract_hash.pp + destination + Entrypoint.pp + entrypoint + in + let pp_batch ppf + Sc_rollup.Outbox.Message.(Atomic_transaction_batch {transactions}) = + Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "\n") + pp_message + ppf + transactions + in + match + Sc_rollup.Outbox.Message.( + deserialize (unsafe_of_string (Bytes.to_string bytes))) + with + | Error _ -> + Format.fprintf ppf "Unknown encoding: %a" Hex.pp (Hex.of_bytes bytes) + | Ok msgs -> pp_batch ppf msgs diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/repl_helpers.ml b/src/proto_016_PtMumbai/bin_wasm_repl/repl_helpers.ml new file mode 100644 index 000000000000..fdc7a87a77d7 --- /dev/null +++ b/src/proto_016_PtMumbai/bin_wasm_repl/repl_helpers.ml @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* [error loc category msg] fails with the location of an error and a message, + returned by either the parser of the typechecker of the WASM reference + interpreter. *) +let error at category msg = + failwith "%s: %s: %s\n%!" (Source.string_of_region at) category msg + +(* [trap_exn f] runs [f] and lifts it into the Lwt error monad. It traps any + exception. *) +let trap_exn f = + let open Lwt_result_syntax in + let open Tezos_webassembly_interpreter in + let open Tezos_webassembly_interpreter_extra in + let print_unknown ppf e = + Format.fprintf ppf "Unknown exception: %s" (Printexc.to_string e) + in + Lwt.catch + (fun () -> + let*! v = f () in + return v) + (function + | Decode.Code (at, msg) -> error at "decoding error" msg + | Parse.Syntax (at, msg) -> error at "syntax error" msg + | Valid.Invalid (at, msg) -> error at "invalid module" msg + | Import.Unknown (at, msg) -> error at "link failure" msg + | Eval.Link (at, msg) -> error at "link failure" msg + | Eval.Trap (at, msg) -> error at "runtime trap" msg + | Eval.Exhaustion (at, msg) -> error at "resource exhaustion" msg + | Eval.Crash (at, msg) -> error at "runtime crash" msg + | Encode.Code (at, msg) -> error at "encoding error" msg + | exn -> failwith "%a" (Data_encoding.Json.print_error ~print_unknown) exn) + +(* [read_file file] reads a file and returns its content. This version prevent + channel manipulation and takes care of opening and closing it. *) +let read_file file = + let open Lwt_syntax in + Lwt_io.( + with_file ~mode:Input file (fun ic -> + let* len = length ic in + let buffer = Bytes.make (Int64.to_int len) '\000' in + let+ () = read_into_exactly ic buffer 0 (Int64.to_int len) in + Bytes.to_string buffer)) + +(* [find_key_in_durable] retrieves the given [key] from the durable storage in + the tree. Returns `None` if the key does not exists. *) +let find_key_in_durable tree key = + let open Lwt_syntax in + let* durable = Wasm_utils.wrap_as_durable_storage tree in + let durable = Tezos_scoru_wasm.Durable.of_storage_exn durable in + Tezos_scoru_wasm.Durable.find_value durable key + +(* [print_durable ~depth tree] prints the keys from the durable storage and + their value in their hexadecimal representation. *) +let print_durable ?(depth = 10) tree = + let open Lwt_syntax in + Test_encodings_util.Context.Tree.fold + ~depth:(`Le depth) + tree + ["durable"] + ~order:`Sorted + ~init:() + ~f:(fun key tree () -> + let+ value = Test_encodings_util.Context.Tree.find tree [] in + let value = Option.value ~default:(Bytes.create 0) value in + Format.printf + "/%s\n %a\n%!" + (String.concat "/" key) + Hex.pp + (Hex.of_bytes value)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/README.md b/src/proto_016_PtMumbai/lib_benchmark/README.md new file mode 100644 index 000000000000..8adba76cbf90 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/README.md @@ -0,0 +1,42 @@ +# `Tezos_benchmark_alpha` + +This library is dedicated to sampling Michelson values and in particular +Michelson programs. + +## Architecture + +This library provides a sampling-based interface for well-typed +Michelson generation. Internally, this library is built on a sampler for an +intermediate language called Mikhailsky post-composed with a function to +map Mikhailsky terms to Michelson ones. + +### Layer 1: Mikhailsky + Mikhailsky corresponds to "Michelson with typed holes". Mikhailsky terms + are encoded inside Micheline. The library `lib_benchmark_type_inference` + provides the language definition as well as a type inference engine. + +### Layer 2: Sampling Mikhailsky terms + We sample Mikhailsky terms using a Markov chain where transitions correspond + to local rewriting rules. The state space of the Markov chain is defined + in `State_space` module. The rewriting infrastructure is provided in the + `Kernel` module by instantiating `lib_micheline_rewriting`. + Rewrites are checked to preserved well-typedness in the Mikhailsky sense + using the type inference engine provided with Mikhailsky. The `Rules` + module defines all rewriting rules, for both Mikhailsky _programs_ + (submodule `Rules.Instruction`) and _data_ + (submodule `Rules.Data_rewrite_leaves`). The function `Rules.rewriting` + performs the enumeration of possible rewritings. + + The Markov chain is biased to sample terms of a specified + size using the Metropolis-Hasting functors provided by `StaTz`. + The instantiation of this Markov chain is defined in the `Sampler` + module. + +### Layer 3: + Once we can sample Mikhaislky terms of a specified size, we need + to convert them to Michelson ones. This is performed in two steps. + - In the first step, we use the `Autocomplete` module to fill holes + in Mikhailsky terms (resp. data) with well-typed code (resp. data). + This is a relatively ad-hoc process. + - The last step is to convert Mikhaislky to Michelson using the + `Michelson` module. diff --git a/src/proto_016_PtMumbai/lib_benchmark/autocomp.ml b/src/proto_016_PtMumbai/lib_benchmark/autocomp.ml new file mode 100644 index 000000000000..a5ffb8cf0e8b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/autocomp.ml @@ -0,0 +1,380 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Autocompletion functions (removing holes from Mikhailsky terms). *) + +open Sampling_helpers + +(* ------------------------------------------------------------------------- *) +(* Helpers *) + +let rec stack_length (stack : Type.Stack.t) acc = + match stack.node with + | Empty_t -> acc + | Stack_var_t _ -> acc + 1 + | Item_t (_, tl) -> stack_length tl (acc + 1) + +(* We need to sort and remove duplicate elements + of sets and maps to make them Michelson-compatible. *) +let sort_set_elements elements = + List.sort_uniq + (Structural_compare.compare + ~prim_compare:Mikhailsky.Mikhailsky_signature.compare) + elements + +let sort_map_elements elements = + let open Micheline in + List.sort_uniq + (fun node1 node2 -> + match (node1, node2) with + | ( Prim (_, Mikhailsky_prim.D_Elt, [k1; _v1], _), + Prim (_, Mikhailsky_prim.D_Elt, [k2; _v2], _) ) -> + Structural_compare.compare + ~prim_compare:Mikhailsky.Mikhailsky_signature.compare + k1 + k2 + | _ -> Stdlib.failwith "Autocomp.sort_map_elements: invalid Michelson map") + elements + +(* ------------------------------------------------------------------------- *) +(* Error handling *) + +type error_case = + | Cannot_complete_data of Mikhailsky.node * Kernel.Path.t + | Cannot_complete_code of Mikhailsky.node * Kernel.Path.t + +exception Autocompletion_error of error_case + +let cannot_complete_data node path = + raise (Autocompletion_error (Cannot_complete_data (node, path))) + +let cannot_complete_code node path = + raise (Autocompletion_error (Cannot_complete_code (node, path))) + +(* ------------------------------------------------------------------------- *) +(* Code & data autocompletion *) + +(* By default, comparable values are unit. *) +let default_comparable_type = Type.unit + +let generate_comparable _sp = Mikhailsky.Data.unit + +(* Instantiates variables in a base type, remaining variables + are mapped to some consistent choice of ground type + (this is made complicated by comparability constraints) *) +let rec instantiate_and_set ty = + let open Inference.M in + Inference.instantiate_base ty >>= fun ty -> replace_vars ty + +and replace_vars (ty : Type.Base.t) = + let open Inference.M in + let node = ty.node in + match node with + | Type.Base.Unit_t | Type.Base.Int_t | Type.Base.Nat_t | Type.Base.Bool_t + | Type.Base.String_t | Type.Base.Bytes_t | Type.Base.Key_hash_t + | Type.Base.Timestamp_t | Type.Base.Mutez_t | Type.Base.Key_t -> + return ty + | Type.Base.Var_t v -> ( + get_repr_exn v >>= fun repr -> + match repr with + | Inference.Stack_type _ -> assert false + | Inference.Base_type {comparable = _; repr = Some _} -> assert false + | Inference.Base_type {comparable; repr = None} -> ( + match comparable with + | Inference.Comparable -> return default_comparable_type + | Inference.Unconstrained | Inference.Not_comparable -> + return Type.unit)) + | Type.Base.Option_t ty -> + replace_vars ty >>= fun ty -> return (Type.option ty) + | Type.Base.Pair_t (lt, rt) -> + replace_vars lt >>= fun lt -> + replace_vars rt >>= fun rt -> return (Type.pair lt rt) + | Type.Base.Union_t (lt, rt) -> + replace_vars lt >>= fun lt -> + replace_vars rt >>= fun rt -> return (Type.union lt rt) + | Type.Base.List_t ty -> replace_vars ty >>= fun ty -> return (Type.list ty) + | Type.Base.Set_t ty -> replace_vars ty >>= fun ty -> return (Type.set ty) + | Type.Base.Map_t (k, v) -> + replace_vars k >>= fun k -> + replace_vars v >>= fun v -> return (Type.map k v) + | Type.Base.Lambda_t (dom, range) -> + replace_vars dom >>= fun dom -> + replace_vars range >>= fun range -> return (Type.lambda dom range) + +let rec instantiate_and_set_stack (stack_ty : Type.Stack.t) = + let open Inference.M in + let node = stack_ty.node in + match node with + | Type.Stack.Empty_t -> return Type.empty + | Type.Stack.Stack_var_t _ -> return Type.empty + | Type.Stack.Item_t (hd, tl) -> + instantiate_and_set hd >>= fun hd -> + instantiate_and_set_stack tl >>= fun tl -> return (Type.item hd tl) + +(* In the following we perform computations in the composite monad + (sampler o Inference.M.t), it is convenient to define the bind and return + explicitly. *) +module SM = struct + type 'a t = 'a Inference.M.t sampler + + let ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t = + fun m f rng_state s -> + let x, s = m rng_state s in + f x rng_state s + [@@inline] + + let sample : 'a sampler -> 'a Inference.M.t sampler = + fun x rng_state st -> (x rng_state, st) + [@@inline] + + let deterministic : 'a Inference.M.t -> 'a t = fun x _rng_state -> x + + let return x _ s = (x, s) [@@inline] +end + +module Make + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) = +struct + (* Generates minimally sized random data of specified type. + Used in autocompletion. *) + (* /!\ Always call [instantiate_and_set] on the type argument of + [generate_data]. /!\ *) + let rec generate_data : Type.Base.t -> Mikhailsky.node SM.t = + fun ty -> + let open SM in + let open Type.Base in + let desc = ty.node in + match desc with + | Var_t _v -> assert false + | Unit_t -> return Mikhailsky.Data.unit + | Int_t -> + sample @@ Michelson_base.int >>= fun i -> + let i = Protocol.Script_int.to_zint i in + return (Mikhailsky.Data.big_integer i) + | Nat_t -> + sample @@ Michelson_base.nat >>= fun n -> + let n = Protocol.Script_int.to_zint n in + return (Mikhailsky.Data.big_natural n) + | Bool_t -> + sample Base_samplers.uniform_bool >>= fun b -> + if b then return Mikhailsky.Data.true_ + else return Mikhailsky.Data.false_ + | String_t -> + sample Michelson_base.string >>= fun str -> + let str = Protocol.Script_string.to_string str in + return (Mikhailsky.Data.string str) + | Bytes_t -> + sample Michelson_base.bytes >>= fun bytes -> + return (Mikhailsky.Data.bytes bytes) + | Key_hash_t -> + sample Crypto_samplers.pkh >>= fun pkh -> + return (Mikhailsky.Data.key_hash pkh) + | Timestamp_t -> + sample Michelson_base.timestamp >>= fun tstamp -> + return (Mikhailsky.Data.timestamp tstamp) + | Mutez_t -> + sample Michelson_base.tez >>= fun tz -> + return (Mikhailsky.Data.mutez tz) + | Key_t -> + sample Crypto_samplers.pk >>= fun pk -> return (Mikhailsky.Data.key pk) + | Option_t ty -> + sample Base_samplers.uniform_bool >>= fun b -> + if b then return Mikhailsky.Data.none + else generate_data ty >>= fun res -> return (Mikhailsky.Data.some res) + | Pair_t (lty, rty) -> + generate_data lty >>= fun lv -> + generate_data rty >>= fun rv -> return (Mikhailsky.Data.pair lv rv) + | Union_t (lty, rty) -> + sample Base_samplers.uniform_bool >>= fun b -> + if b then generate_data lty >>= fun v -> return (Mikhailsky.Data.left v) + else generate_data rty >>= fun v -> return (Mikhailsky.Data.right v) + | List_t _ty -> return (Mikhailsky.Data.list []) + | Set_t _ty -> return (Mikhailsky.Data.set []) + | Map_t (_kty, _vty) -> return (Mikhailsky.Data.map []) + | Lambda_t (dom, range) -> + invent_term Type.(item dom empty) Type.(item range empty) + >>= fun code -> return (Mikhailsky.Data.lambda code) + + and invent_term (bef : Type.Stack.t) (aft : Type.Stack.t) : + Mikhailsky.node list SM.t = + let open SM in + install_dummy_stack aft [] >>= fun code -> + let terms = drop_stack bef code in + return terms + + and drop_stack (stack : Type.Stack.t) code = + Mikhailsky.Instructions.dropn (stack_length stack 0) :: code + + and install_dummy_stack (stack : Type.Stack.t) (acc : Mikhailsky.node list) = + let open SM in + match stack.node with + | Empty_t -> return acc + | Stack_var_t _ -> + let acc = Mikhailsky.(Instructions.push unit_ty Data.unit) :: acc in + return acc + | Item_t (hd, tl) -> + deterministic @@ instantiate_and_set hd >>= fun hd -> + (match hd.node with + | Lambda_t (dom, range) -> + invent_term Type.(item dom empty) Type.(item range empty) + >>= fun code -> + let instr = Mikhailsky.(prim I_LAMBDA [seq code] []) in + return instr + | _ -> + generate_data hd >>= fun term -> + let ty = Mikhailsky.unparse_ty_exn hd in + return (Mikhailsky.Instructions.push ty term)) + >>= fun instr -> install_dummy_stack tl (instr :: acc) + + (* Autocomplete Mikhailsky data. + When encountering a hole, we lookup its type and instantiate + some random data of the specified type. *) + let rec complete_data : + Mikhailsky.node -> Kernel.Path.t -> Mikhailsky.node SM.t = + let open SM in + fun node path -> + match node with + | Micheline.Int (_, _) | Micheline.String (_, _) | Micheline.Bytes (_, _) + -> + return node + | Micheline.Prim (_, D_Hole, _, _) -> ( + deterministic @@ Inference.M.get_data_annot path >>= fun ty_opt -> + match ty_opt with + | None -> cannot_complete_data node path + | Some ty -> + deterministic @@ instantiate_and_set ty >>= fun ty -> + generate_data ty) + | Micheline.Prim (_, A_Set, [Micheline.Seq (_, elements)], _) -> + complete_data_list (Kernel.Path.at_index 0 path) 0 elements [] + >>= fun elements -> + let elements = sort_set_elements elements in + return (Mikhailsky.Data.set elements) + | Micheline.Prim (_, A_Map, [Micheline.Seq (_, elements)], _) -> + complete_data_list (Kernel.Path.at_index 0 path) 0 elements [] + >>= fun elements -> + let elements = sort_map_elements elements in + return (Mikhailsky.Data.map elements) + | Micheline.Prim (_, prim, subterms, _) -> + complete_data_list path 0 subterms [] >>= fun subterms -> + return (Mikhailsky.prim prim subterms []) + | Micheline.Seq (_, subterms) -> + complete_data_list path 0 subterms [] >>= fun subterms -> + return (Mikhailsky.seq subterms) + + and complete_data_list path i subterms acc = + let open SM in + match subterms with + | [] -> return (List.rev acc) + | subterm :: tl -> + let path' = Kernel.Path.at_index i path in + complete_data subterm path' >>= fun term -> + complete_data_list path (i + 1) tl (term :: acc) + + let complete_data typing node rng_state = + let root_type_opt, _ = Inference.M.get_data_annot Kernel.Path.root typing in + match root_type_opt with + | None -> Stdlib.failwith "Autocomp.complete_data: cannot get type of expr" + | Some ty -> + let _, typing = Inference.instantiate_base ty typing in + let result, _ = + try complete_data node Kernel.Path.root rng_state typing + with Autocompletion_error (Cannot_complete_data (subterm, path)) -> + Format.eprintf "Cannot complete data@." ; + Format.eprintf "at path %s@." (Kernel.Path.to_string path) ; + Format.eprintf "%a@." Mikhailsky.pp subterm ; + Stdlib.failwith "in autocomp.ml: unrecoverable failure" + in + let typ, _typing = + try Inference.infer_data_with_state result + with Inference.Ill_typed_script error -> + Format.eprintf "%a@." Inference.pp_inference_error error ; + Format.eprintf "%a@." Mikhailsky.pp result ; + assert false + in + (result, typ) + + (* Autocomplete Mikhailsky code. *) + + let rec complete_code : + Mikhailsky.node -> Kernel.Path.t -> Mikhailsky.node SM.t = + let open SM in + fun node path -> + match node with + | Micheline.Int (_, _) | Micheline.String (_, _) | Micheline.Bytes (_, _) + -> + return node + | Micheline.Prim (_, I_Hole, _, _) -> ( + deterministic @@ Inference.M.get_instr_annot path >>= function + | None -> cannot_complete_code node path + | Some {bef; aft} -> + deterministic @@ Inference.instantiate bef >>= fun bef -> + deterministic @@ Inference.instantiate aft >>= fun aft -> + invent_term bef aft >>= fun code -> return (Mikhailsky.seq code)) + | Micheline.Prim (_, prim, subterms, _) -> + complete_code_list path 0 subterms [] >>= fun subterms -> + return (Mikhailsky.prim prim subterms []) + | Micheline.Seq (_, subterms) -> + complete_code_list path 0 subterms [] >>= fun subterms -> + return (Mikhailsky.seq subterms) + + and complete_code_list path i subterms acc = + let open SM in + match subterms with + | [] -> return (List.rev acc) + | subterm :: tl -> + let path' = Kernel.Path.at_index i path in + complete_code subterm path' >>= fun term -> + complete_code_list path (i + 1) tl (term :: acc) + + let complete_code typing node rng_state = + let root_type_opt, _ = + Inference.M.get_instr_annot Kernel.Path.root typing + in + match root_type_opt with + | None -> Stdlib.failwith "Autocomp.complete_code: cannot get type of expr" + | Some {bef; aft} -> + let _, typing = Inference.instantiate bef typing in + let _, typing = Inference.instantiate aft typing in + let result, _ = + try complete_code node Kernel.Path.root rng_state typing with + | Autocompletion_error (Cannot_complete_code (subterm, path)) -> + Format.eprintf "Cannot complete code@." ; + Format.eprintf "at path %s@." (Kernel.Path.to_string path) ; + Format.eprintf "%a@." Mikhailsky.pp subterm ; + Stdlib.failwith "in autocomp.ml: unrecoverable failure" + | _ -> assert false + in + let (bef, aft), typing = + try Inference.infer_with_state result + with Inference.Ill_typed_script error -> + Format.eprintf "%a@." Inference.pp_inference_error error ; + Format.eprintf "%a@." Mikhailsky.pp result ; + assert false + in + let bef, typing = instantiate_and_set_stack bef typing in + let aft, typing = instantiate_and_set_stack aft typing in + (result, (bef, aft), typing) +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/dune b/src/proto_016_PtMumbai/lib_benchmark/dune new file mode 100644 index 000000000000..3a29e3bb29ae --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/dune @@ -0,0 +1,34 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_benchmark_alpha) + (public_name tezos-benchmark-alpha) + (libraries + tezos-stdlib + tezos-base + tezos-error-monad + tezos-micheline + tezos-micheline-rewriting + tezos-benchmark + tezos-benchmark-type-inference-alpha + tezos-protocol-alpha + tezos-crypto + tezos-protocol-alpha.parameters + hashcons + tezos-alpha-test-helpers + prbnmcn-stats) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_stdlib + -open Tezos_base + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_error_monad + -open Tezos_micheline + -open Tezos_micheline_rewriting + -open Tezos_benchmark + -open Tezos_benchmark_type_inference_alpha + -open Tezos_protocol_alpha + -open Tezos_alpha_test_helpers) + (private_modules kernel rules state_space)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/execution_context.ml b/src/proto_016_PtMumbai/lib_benchmark/execution_context.ml new file mode 100644 index 000000000000..d4089d8b67d1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/execution_context.ml @@ -0,0 +1,95 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +type context = Alpha_context.context * Script_interpreter.step_constants + +let initial_balance = 4_000_000_000_000L + +let context_init_memory ~rng_state = + Context.init_n + ~rng_state + ~bootstrap_balances: + [ + initial_balance; + initial_balance; + initial_balance; + initial_balance; + initial_balance; + ] + 5 + () + >>=? fun (block, accounts) -> + match accounts with + | [bs1; bs2; bs3; bs4; bs5] -> + return (`Mem_block (block, (bs1, bs2, bs3, bs4, bs5))) + | _ -> assert false + +let context_init ~rng_state = context_init_memory ~rng_state + +let make ~rng_state = + context_init_memory ~rng_state >>=? fun context -> + let amount = Alpha_context.Tez.one in + let chain_id = Tezos_crypto.Chain_id.zero in + let now = Script_timestamp.of_zint Z.zero in + let level = Script_int.zero_n in + let open Script_interpreter in + (match context with + | `Mem_block (block, (bs1, _, _, _, _)) -> + let source = bs1 in + let payer = Contract_helpers.default_payer in + let self = Contract_helpers.default_self in + let step_constants = + { + source; + payer; + self; + amount; + balance = Alpha_context.Tez.of_mutez_exn initial_balance; + chain_id; + now; + level; + } + in + return (block, step_constants)) + >>=? fun (block, step_constants) -> + Context.get_constants (B block) >>=? fun csts -> + let minimal_block_delay = + Protocol.Alpha_context.Period.to_seconds csts.parametric.minimal_block_delay + in + Incremental.begin_construction + ~timestamp: + (Time.Protocol.add block.header.shell.timestamp minimal_block_delay) + block + >>=? fun vs -> + let ctxt = Incremental.alpha_ctxt vs in + let ctxt = + (* Required for eg Create_contract *) + Protocol.Alpha_context.Origination_nonce.init + ctxt + Tezos_crypto.Operation_hash.zero + in + return (ctxt, step_constants) diff --git a/src/proto_016_PtMumbai/lib_benchmark/kernel.ml b/src/proto_016_PtMumbai/lib_benchmark/kernel.ml new file mode 100644 index 000000000000..0932302aa20b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/kernel.ml @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* ------------------------------------------------------------------------- *) +(* Instantiate rewriting subsystem *) + +module Lang = + Micheline_with_hash_consing.Make + (Mikhailsky.Mikhailsky_signature) + (struct + let initial_size = None + end) + +module Path = Mikhailsky.Path +module Patt = Pattern.Make (Mikhailsky.Mikhailsky_signature) (Lang) (Path) +module Rewriter = + Rewrite.Make (Mikhailsky.Mikhailsky_signature) (Lang) (Path) (Patt) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune new file mode 100644 index 000000000000..d77fee8c6414 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune @@ -0,0 +1,23 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_benchmark_type_inference_alpha) + (public_name tezos-benchmark-type-inference-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-stdlib + tezos-error-monad + tezos-crypto + tezos-micheline + tezos-micheline-rewriting + tezos-protocol-alpha + hashcons) + (flags + (:standard) + -open Tezos_stdlib + -open Tezos_error_monad + -open Tezos_crypto + -open Tezos_micheline + -open Tezos_micheline_rewriting + -open Tezos_protocol_alpha)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.ml new file mode 100644 index 000000000000..88ba95c8db0f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.ml @@ -0,0 +1,1150 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Micheline +module UF = Uf.UF + +(* The domain of comparability: + * + * Comparable Not_comparable + * ^ ^ + * \ / + * \ / + * Unconstrained + * + * The higher we go, the more information we have. + * This domain admits all glbs but not all lubs. + *) + +type comparability = Comparable | Not_comparable | Unconstrained + +let pp_comparability fmtr (cmp : comparability) = + match cmp with + | Comparable -> Format.fprintf fmtr "Comparable" + | Not_comparable -> Format.fprintf fmtr "Not_comparable" + | Unconstrained -> Format.fprintf fmtr "Unconstrained" + +let sup_comparability (c1 : comparability) (c2 : comparability) = + match (c1, c2) with + | Unconstrained, c | c, Unconstrained -> Some c + | Comparable, Comparable -> Some Comparable + | Not_comparable, Not_comparable -> Some Not_comparable + | Comparable, Not_comparable | Not_comparable, Comparable -> None + +type michelson_type = + | Base_type of {repr : Type.Base.t option; comparable : comparability} + | Stack_type of Type.Stack.t option + +type transformer = {bef : Type.Stack.t; aft : Type.Stack.t} + +let michelson_type_to_string (x : michelson_type) = + match x with + | Base_type {repr = None; comparable} -> + Format.asprintf "?::[%a]" pp_comparability comparable + | Base_type {repr = Some ty; comparable} -> + Format.asprintf "%a::[%a]" Type.Base.pp ty pp_comparability comparable + | Stack_type None -> "<?>" + | Stack_type (Some sty) -> Format.asprintf "%a" Type.Stack.pp sty + +(* ------------------------------------------------------------------------- *) +(* Typechecking errors *) + +type inference_error = + (* | Expected_data_with_ground_type of Mikhailsky.Path.t * Mikhailsky.node *) + | Unhandled_micheline of Mikhailsky.Path.t * Mikhailsky.node + | Expected_micheline_prim + | Unsatisfiable_comparability_constraint of comparability_error_witness + | Base_types_incompatible of Type.Base.t * Type.Base.t + | Stack_types_incompatible of Type.Stack.t * Type.Stack.t + | Badly_typed_arithmetic of Mikhailsky_prim.prim * Type.Base.t * Type.Base.t + | Ill_formed_arithmetic of Mikhailsky.Path.t * Mikhailsky.node + | Cyclic_stack_type + | Cyclic_base_type + | Invalid_ast of string option * Mikhailsky.Path.t * Mikhailsky.node + +and comparability_error_witness = + | Comparability_error_types of michelson_type * michelson_type + | Comparability_error_tags of Type.Base.t * comparability * comparability + +let pp_inference_error fmtr (err : inference_error) = + match err with + (* | Expected_data_with_ground_type (path, node) -> + * let path = Mikhailsky.Path.to_string path in + * let node = Mikhailsky.to_string node in + * Format.fprintf fmtr "Expected data with ground type: %s at path %s" node path *) + | Unhandled_micheline (path, node) -> + let path = Mikhailsky.Path.to_string path in + let node = Mikhailsky.to_string node in + Format.fprintf fmtr "Unhandled micheline: %s at path %s" node path + | Expected_micheline_prim -> + Format.fprintf fmtr "%s" "Expected_micheline_prim" + | Unsatisfiable_comparability_constraint + (Comparability_error_types (ty1, ty2)) -> + let ty1 = michelson_type_to_string ty1 in + let ty2 = michelson_type_to_string ty2 in + Format.fprintf + fmtr + "Unsatisfiable comparability constraint: %s # %s" + ty1 + ty2 + | Unsatisfiable_comparability_constraint + (Comparability_error_tags (ty, cmp1, cmp2)) -> + Format.fprintf + fmtr + "Unsatisfiable comparability constraint: %a :: %a # %a" + Type.Base.pp + ty + pp_comparability + cmp1 + pp_comparability + cmp2 + | Base_types_incompatible (ty1, ty2) -> + Format.fprintf + fmtr + "Base types incompatible: %a %a" + Type.Base.pp + ty1 + Type.Base.pp + ty2 + | Stack_types_incompatible (sty1, sty2) -> + Format.fprintf + fmtr + "Stack types incompatible: %a %a" + Type.Stack.pp + sty1 + Type.Stack.pp + sty2 + | Badly_typed_arithmetic (prim, ty1, ty2) -> + Format.fprintf + fmtr + "Badly typed arithmetic: %a(%a, %a)" + Mikhailsky_prim.pp + prim + Type.Base.pp + ty1 + Type.Base.pp + ty2 + | Ill_formed_arithmetic (path, node) -> + let path = Mikhailsky.Path.to_string path in + let node = Mikhailsky.to_string node in + Format.fprintf fmtr "Ill formed arithmetic: %s at path %s" node path + | Cyclic_stack_type -> Format.fprintf fmtr "Cyclic stack type" + | Cyclic_base_type -> Format.fprintf fmtr "Cyclic base type" + | Invalid_ast (msg_opt, path, node) -> ( + let path = Mikhailsky.Path.to_string path in + let node = Mikhailsky.to_string node in + match msg_opt with + | None -> Format.fprintf fmtr "Invalid ast: %s at path %s" node path + | Some msg -> + Format.fprintf fmtr "Invalid ast: %s at path %s (%s)" node path msg) + +exception Ill_typed_script of inference_error + +let unsatisfiable_comparability ty cmp1 cmp2 = + raise + (Ill_typed_script + (Unsatisfiable_comparability_constraint + (Comparability_error_tags (ty, cmp1, cmp2)))) + +let invalid_ast ?msg path node = + raise (Ill_typed_script (Invalid_ast (msg, path, node))) + +let () = + Printexc.register_printer (fun exn -> + match exn with + | Ill_typed_script error -> + Some (Format.asprintf "%a" pp_inference_error error) + | _ -> None) + +(* ------------------------------------------------------------------------- *) + +module Repr_store = + Stores.Map + (Int_map) + (struct + type key = int + + type value = michelson_type + + let key_to_string = string_of_int + + let value_to_string = michelson_type_to_string + end) + +module Repr_sm = Monads.Make_state_monad (Repr_store) +module Path_map = Map.Make (Mikhailsky.Path) + +module Annot_instr_store = + Stores.Map + (Path_map) + (struct + type key = Mikhailsky.Path.t + + type value = transformer + + let key_to_string = Mikhailsky.Path.to_string + + let value_to_string {bef; aft} = + Format.asprintf "%a => %a" Type.Stack.pp bef Type.Stack.pp aft + end) + +module Annot_instr_sm = Monads.Make_state_monad (Annot_instr_store) + +module Annot_data_store = + Stores.Map + (Path_map) + (struct + type key = Mikhailsky.Path.t + + type value = Type.Base.t + + let key_to_string = Mikhailsky.Path.to_string + + let value_to_string ty = Format.asprintf "%a" Type.Base.pp ty + end) + +module Annot_data_sm = Monads.Make_state_monad (Annot_data_store) + +type state = { + uf : UF.M.state; + repr : Repr_sm.state; + annot_instr : Annot_instr_sm.state; + annot_data : Annot_data_sm.state; +} + +module M = struct + type 'a t = state -> 'a * state + + let empty : unit -> state = + fun () -> + { + uf = UF.M.empty (); + repr = Repr_sm.empty (); + annot_instr = Annot_instr_sm.empty (); + annot_data = Annot_data_sm.empty (); + } + + let ( >>= ) m f s = + let x, s = m s in + f x s + [@@inline] + + let return x s = (x, s) + + (* let run m = fst (m (empty ())) *) + + let uf_lift : 'a UF.M.t -> 'a t = + fun computation state -> + let res, uf = computation state.uf in + (res, {state with uf}) + [@@inline] + + let repr_lift : 'a Repr_sm.t -> 'a t = + fun computation state -> + let res, repr = computation state.repr in + (res, {state with repr}) + [@@inline] + + let annot_instr_lift : 'a Annot_instr_sm.t -> 'a t = + fun computation state -> + let res, annot_instr = computation state.annot_instr in + (res, {state with annot_instr}) + [@@inline] + + let annot_data_lift : 'a Annot_data_sm.t -> 'a t = + fun computation state -> + let res, annot_data = computation state.annot_data in + (res, {state with annot_data}) + [@@inline] + + let set_repr k v = repr_lift (Repr_sm.set k v) [@@inline] + + let get_repr_exn k = + repr_lift (Repr_sm.get k) >>= function + | None -> Stdlib.failwith "get_repr_exn" + | Some res -> return res + [@@inline] + + let set_instr_annot k v = annot_instr_lift (Annot_instr_sm.set k v) [@@inline] + + let get_instr_annot k = annot_instr_lift (Annot_instr_sm.get k) [@@inline] + + let set_data_annot k v = annot_data_lift (Annot_data_sm.set k v) [@@inline] + + let get_data_annot k = annot_data_lift (Annot_data_sm.get k) [@@inline] + + let get_state state = (state, state) +end + +module S = Set.Make (Int) + +let rec instantiate (encountered : S.t) (stack_ty : Type.Stack.t) : + Type.Stack.t M.t = + let open Type.Stack in + let open M in + if S.mem stack_ty.tag encountered then + raise (Ill_typed_script Cyclic_stack_type) + else + let encountered = S.add stack_ty.tag encountered in + match stack_ty.node with + | Empty_t -> return stack_ty + | Stack_var_t x -> ( + uf_lift (UF.find x) >>= fun root -> + get_repr_exn root >>= function + | Stack_type None -> return (Type.stack_var root) + | Stack_type (Some ty) -> instantiate encountered ty + | _ -> assert false) + | Item_t (head, tail) -> + instantiate_base S.empty head >>= fun head -> + instantiate encountered tail >>= fun tail -> + return (Type.item head tail) + +and instantiate_base (encountered : S.t) (ty : Type.Base.t) : Type.Base.t M.t = + let open Type.Base in + let open M in + if S.mem ty.tag encountered then raise (Ill_typed_script Cyclic_base_type) + else + let encountered = S.add ty.tag encountered in + match ty.node with + | Unit_t | Int_t | Nat_t | Bool_t | String_t | Bytes_t | Key_hash_t | Key_t + | Timestamp_t | Mutez_t -> + return ty + | Option_t ty -> + instantiate_base encountered ty >>= fun ty -> return (Type.option ty) + | List_t ty -> + instantiate_base encountered ty >>= fun ty -> return (Type.list ty) + | Set_t ty -> + instantiate_base encountered ty >>= fun ty -> return (Type.set ty) + | Map_t (kty, vty) -> + instantiate_base encountered kty >>= fun kty -> + instantiate_base encountered vty >>= fun vty -> + return (Type.map kty vty) + | Pair_t (lty, rty) -> + instantiate_base encountered lty >>= fun lty -> + instantiate_base encountered rty >>= fun rty -> + return (Type.pair lty rty) + | Union_t (lty, rty) -> + instantiate_base encountered lty >>= fun lty -> + instantiate_base encountered rty >>= fun rty -> + return (Type.union lty rty) + | Lambda_t (dom, range) -> + instantiate_base encountered dom >>= fun dom -> + instantiate_base encountered range >>= fun range -> + return (Type.lambda dom range) + | Var_t x -> ( + uf_lift (UF.find x) >>= fun root -> + get_repr_exn root >>= function + | Base_type {repr = None; _} -> return (Type.var root) + | Base_type {repr = Some ty; _} -> instantiate_base encountered ty + | _ -> assert false) + +let instantiate_base base_ty = instantiate_base S.empty base_ty + +let instantiate stack_ty = instantiate S.empty stack_ty + +let rec unify (x : Type.Stack.t) (y : Type.Stack.t) : unit M.t = + let open Type.Stack in + let open M in + let unify_single_stack v x = + (match Type.Stack.vars x with + | None -> return () + | Some v' -> + if v = v' then raise (Ill_typed_script Cyclic_stack_type) else return ()) + >>= fun () -> + M.uf_lift (UF.find v) >>= fun root -> + get_repr_exn root >>= fun repr -> + merge_reprs (Stack_type (Some x)) repr >>= fun repr -> set_repr root repr + in + if x.tag = y.tag then return () + else + match (x.node, y.node) with + | Empty_t, Empty_t -> return () + | Stack_var_t x, Stack_var_t y -> + M.uf_lift (UF.find x) >>= fun root_x -> + M.uf_lift (UF.find y) >>= fun root_y -> + get_repr_exn root_x >>= fun repr_x -> + get_repr_exn root_y >>= fun repr_y -> + M.uf_lift (UF.union x y) >>= fun root -> + merge_reprs repr_x repr_y >>= fun repr -> set_repr root repr + | Stack_var_t v, _ -> unify_single_stack v y + | _, Stack_var_t v -> unify_single_stack v x + | Item_t (ty1, tail1), Item_t (ty2, tail2) -> + unify_base ty1 ty2 >>= fun () -> + unify tail1 tail2 >>= fun () -> return () + | _ -> raise (Ill_typed_script (Stack_types_incompatible (x, y))) + +and unify_base (x : Type.Base.t) (y : Type.Base.t) : unit M.t = + let open Type.Base in + let open M in + let unify_single_var v x = + (if List.mem v (Type.Base.vars x) then + raise (Ill_typed_script Cyclic_base_type) + else return ()) + >>= fun () -> + M.uf_lift (UF.find v) >>= fun root -> + get_repr_exn root >>= fun repr -> + get_comparability x >>= fun comparable -> + merge_reprs (Base_type {repr = Some x; comparable}) repr >>= fun repr -> + set_repr root repr + in + if x.tag = y.tag then return () + else + match (x.node, y.node) with + | Unit_t, Unit_t + | Int_t, Int_t + | Nat_t, Nat_t + | Bool_t, Bool_t + | String_t, String_t + | Bytes_t, Bytes_t + | Key_hash_t, Key_hash_t + | Timestamp_t, Timestamp_t + | Mutez_t, Mutez_t + | Key_t, Key_t -> + return () + | Option_t x, Option_t y -> unify_base x y + | List_t x, List_t y -> unify_base x y + | Set_t x, Set_t y -> unify_base x y + | Map_t (kx, vx), Map_t (ky, vy) -> + unify_base kx ky >>= fun () -> unify_base vx vy + | Pair_t (x, x'), Pair_t (y, y') -> + unify_base x y >>= fun () -> unify_base x' y' + | Union_t (x, x'), Union_t (y, y') -> + unify_base x y >>= fun () -> unify_base x' y' + | Lambda_t (x, x'), Lambda_t (y, y') -> + unify_base x y >>= fun () -> unify_base x' y' + | Var_t x, Var_t y -> + M.uf_lift (UF.find x) >>= fun root_x -> + M.uf_lift (UF.find y) >>= fun root_y -> + get_repr_exn root_x >>= fun repr_x -> + get_repr_exn root_y >>= fun repr_y -> + M.uf_lift (UF.union x y) >>= fun root -> + merge_reprs repr_x repr_y >>= fun repr -> set_repr root repr + | Var_t v, _ -> unify_single_var v y + | _, Var_t v -> unify_single_var v x + | _ -> + instantiate_base x >>= fun x -> + instantiate_base y >>= fun y -> + raise (Ill_typed_script (Base_types_incompatible (x, y))) + +and merge_reprs (repr1 : michelson_type) (repr2 : michelson_type) : + michelson_type M.t = + let open M in + match (repr1, repr2) with + | (Stack_type None as repr), Stack_type None + | (Stack_type (Some _) as repr), Stack_type None + | Stack_type None, (Stack_type (Some _) as repr) -> + return repr + | (Stack_type (Some sty1) as repr), Stack_type (Some sty2) -> + unify sty1 sty2 >>= fun () -> return repr + | ( Base_type {repr = opt1; comparable = cmp1}, + Base_type {repr = opt2; comparable = cmp2} ) -> ( + let comparable_opt = sup_comparability cmp1 cmp2 in + match comparable_opt with + | None -> + raise + (Ill_typed_script + (Unsatisfiable_comparability_constraint + (Comparability_error_types (repr1, repr2)))) + | Some comparable -> ( + match (opt1, opt2) with + | None, None -> return (Base_type {repr = None; comparable}) + | (Some ty as repr), None -> + assert_comparability comparable ty >>= fun () -> + return (Base_type {repr; comparable}) + | None, (Some ty as repr) -> + assert_comparability comparable ty >>= fun () -> + return (Base_type {repr; comparable}) + | Some ty1, Some ty2 -> + unify_base ty1 ty2 >>= fun () -> + assert_comparability comparable ty1 >>= fun () -> + assert_comparability comparable ty2 >>= fun () -> + return (Base_type {repr = opt1; comparable}))) + | _ -> assert false + +and assert_comparability comparable ty = + assert_comparability_aux comparable ty [] + +and assert_comparability_aux lower_bound (ty : Type.Base.t) + (encountered : int list) : unit M.t = + let open M in + if List.mem ty.tag encountered then raise (Ill_typed_script Cyclic_base_type) + else + let encountered = ty.tag :: encountered in + match ty.node with + | Var_t v -> ( + uf_lift (UF.find v) >>= fun root -> + get_repr_exn root >>= fun repr -> + match repr with + | Base_type {repr = None; comparable} -> ( + match sup_comparability comparable lower_bound with + | None -> unsatisfiable_comparability ty comparable lower_bound + | Some comparable -> + set_repr root (Base_type {repr = None; comparable})) + | Base_type {repr = Some ty; comparable} -> ( + match sup_comparability comparable lower_bound with + | None -> unsatisfiable_comparability ty comparable lower_bound + | Some comparable -> + assert_comparability_aux lower_bound ty encountered + >>= fun () -> + set_repr root (Base_type {repr = Some ty; comparable})) + | Stack_type _ -> assert false) + | List_t _ | Set_t _ | Map_t _ | Lambda_t _ | Key_t -> ( + match lower_bound with + | Unconstrained | Not_comparable -> return () + | Comparable -> unsatisfiable_comparability ty Unconstrained lower_bound + ) + | Unit_t | Int_t | Nat_t | Bool_t | String_t | Bytes_t | Key_hash_t + | Timestamp_t | Mutez_t -> + (* if not (le_comparability lower_bound Comparable) then + * unsatisfiable_comparability ty Comparable lower_bound + * else *) + return () + | Option_t ty -> ( + match lower_bound with + | Comparable -> assert_comparability_aux Comparable ty encountered + | Not_comparable | Unconstrained -> return ()) + | Pair_t (l, r) -> ( + match lower_bound with + | Comparable -> + assert_comparability_aux Comparable l encountered >>= fun () -> + assert_comparability_aux Comparable r encountered + | Unconstrained | Not_comparable -> return ()) + | Union_t (l, r) -> ( + match lower_bound with + | Comparable -> + assert_comparability_aux Comparable l encountered >>= fun () -> + assert_comparability_aux Comparable r encountered + | Unconstrained | Not_comparable -> return ()) + +and get_comparability (ty : Type.Base.t) : comparability M.t = + let open M in + match ty.node with + | Var_t v -> ( + get_repr_exn v >>= fun repr -> + match repr with + | Stack_type _ -> assert false + | Base_type {comparable; _} -> return comparable) + | Unit_t | Int_t | Nat_t | Bool_t | String_t | Bytes_t | Key_hash_t + | Timestamp_t | Mutez_t -> + return Comparable + | List_t _ | Set_t _ | Map_t _ | Lambda_t _ | Key_t -> return Not_comparable + | Option_t ty -> get_comparability ty + | Union_t (lt, rt) | Pair_t (lt, rt) -> ( + get_comparability lt >>= fun lc -> + get_comparability rt >>= fun rc -> + match (lc, rc) with + | Comparable, Comparable -> return Comparable + | _ -> return Unconstrained) + +let fresh = + let x = ref ~-1 in + fun () -> + incr x ; + !x + +let exists_stack : unit -> Type.Stack.t M.t = + let open M in + fun () -> + let fresh = fresh () in + uf_lift (UF.add fresh) >>= fun () -> + set_repr fresh (Stack_type None) >>= fun () -> return (Type.stack_var fresh) + +let exists : unit -> Type.Base.t M.t = + let open M in + fun () -> + let fresh = fresh () in + uf_lift (UF.add fresh) >>= fun () -> + set_repr fresh (Base_type {repr = None; comparable = Unconstrained}) + >>= fun () -> return (Type.var fresh) + +let exists_cmp : unit -> Type.Base.t M.t = + let open M in + fun () -> + let fresh = fresh () in + uf_lift (UF.add fresh) >>= fun () -> + set_repr fresh (Base_type {repr = None; comparable = Comparable}) + >>= fun () -> return (Type.var fresh) + +(* Adapted from [script_ir_translator] *) +let parse_uint30 n : int = + let max_uint30 = 0x3fffffff in + match n with + | Micheline.Int (_, n') + when Compare.Z.(Z.zero <= n') && Compare.Z.(n' <= Z.of_int max_uint30) -> + Z.to_int n' + | _ -> assert false + +(* encodes the per-instruction relationship between input and output types + of binary arithmetic operations. *) +let arith_type (instr : Mikhailsky_prim.prim) (ty1 : Type.Base.t) + (ty2 : Type.Base.t) : Type.Base.t option = + match (instr, ty1.node, ty2.node) with + | (I_ADD | I_MUL), Int_t, Int_t + | (I_ADD | I_MUL), Int_t, Nat_t + | (I_ADD | I_MUL), Nat_t, Int_t -> + Some Type.int + | (I_ADD | I_MUL), Nat_t, Nat_t -> Some Type.nat + | I_SUB, Int_t, Int_t + | I_SUB, Int_t, Nat_t + | I_SUB, Nat_t, Int_t + | I_SUB, Nat_t, Nat_t + | I_SUB, Timestamp_t, Timestamp_t -> + Some Type.int + | I_EDIV, Int_t, Int_t + | I_EDIV, Int_t, Nat_t + | I_EDIV, Nat_t, Int_t + | I_EDIV, Nat_t, Nat_t -> + Some Type.(option (pair nat nat)) + (* Timestamp *) + | I_ADD, Timestamp_t, Int_t + | I_ADD, Int_t, Timestamp_t + | I_SUB, Timestamp_t, Int_t -> + Some Type.timestamp + (* Mutez *) + | I_ADD, Mutez_t, Mutez_t + | I_SUB, Mutez_t, Mutez_t + | I_MUL, Mutez_t, Nat_t + | I_MUL, Nat_t, Mutez_t -> + Some Type.mutez + | I_EDIV, Mutez_t, Nat_t -> Some Type.(option (pair mutez mutez)) + | I_EDIV, Mutez_t, Mutez_t -> Some Type.(option (pair nat mutez)) + | _ -> None + +let rec generate_constraints (path : Mikhailsky.Path.t) (node : Mikhailsky.node) + (bef : Type.Stack.t) (aft : Type.Stack.t) : unit M.t = + let open M in + set_instr_annot path {bef; aft} >>= fun () -> + match node with + | Int (_, _) -> + assert false (* Ints should always be guarded by annotations *) + | String (_, _) | Bytes (_, _) -> + raise (Ill_typed_script Expected_micheline_prim) + (* Hole *) + | Prim (_, I_Hole, [], _) -> return () + (* Stack ops - simple cases *) + | Prim (_loc, I_DROP, [], _annot) -> + exists () >>= fun top -> unify bef (Type.item top aft) + | Prim (_loc, I_DROP, [n], _annot) -> + let n = parse_uint30 n in + generate_constraints_dropn n bef aft + | Prim (_loc, I_DUP, [], _annot) -> + exists () >>= fun top -> + exists_stack () >>= fun rest -> + unify bef Type.(item top rest) >>= fun () -> + unify aft Type.(item top (item top rest)) + | Prim (_loc, I_SWAP, [], _annot) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item b rest)) >>= fun () -> + unify aft Type.(item b (item a rest)) + | Prim (_loc, I_PUSH, [t; d], _annot) -> + let ty = + Mikhailsky.parse_ty + ~allow_big_map:false + ~allow_operation:false + ~allow_contract:false + t + in + generate_constraints_data (Mikhailsky.Path.at_index 1 path) d ty + >>= fun () -> + (* assert_data_has_ground_type (Mikhailsky.Path.at_index 1 path) d ty >>= fun () -> *) + unify aft Type.(item ty bef) + | Prim (_loc, I_UNIT, [], _annot) -> unify aft Type.(item unit bef) + | Prim (_loc, I_DIP, [code], _annot) -> + exists () >>= fun top -> + exists_stack () >>= fun bef_rest -> + exists_stack () >>= fun aft_rest -> + unify bef Type.(item top bef_rest) >>= fun () -> + unify aft Type.(item top aft_rest) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + bef_rest + aft_rest + (* TODO: DIGn, etc *) + (* Option-related instructions *) + | Prim (_, I_SOME, [], _) -> + exists () >>= fun top -> + exists_stack () >>= fun rest -> + unify bef Type.(item top rest) >>= fun () -> + unify aft Type.(item (option top) rest) + | Prim (_, I_NONE, [t], _) -> + let ty = + Mikhailsky.parse_ty + ~allow_big_map:true + ~allow_operation:true + ~allow_contract:true + t + in + unify aft Type.(item (option ty) bef) + | Prim (_, I_IF_NONE, [bt; bf], _) -> + exists () >>= fun a -> + exists_stack () >>= fun rest -> + unify bef Type.(item (option a) rest) >>= fun () -> + generate_constraints (Mikhailsky.Path.at_index 0 path) bt rest aft + >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 1 path) + bf + Type.(item a rest) + aft + (* bool-based control flow *) + | Prim (_, I_IF, [bt; bf], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item bool rest) >>= fun () -> + generate_constraints (Mikhailsky.Path.at_index 0 path) bt rest aft + >>= fun () -> + generate_constraints (Mikhailsky.Path.at_index 1 path) bf rest aft + | Prim (_, I_LOOP, [body], _) -> + unify bef Type.(item bool aft) >>= fun () -> + generate_constraints (Mikhailsky.Path.at_index 0 path) body aft bef + (* Boolean binops *) + | Prim (_, I_AND, [], _) | Prim (_, I_OR, [], _) | Prim (_, I_XOR, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item bool (item bool rest)) >>= fun () -> + unify aft Type.(item bool rest) + (* Arithmetic *) + | Prim (_, ((I_ADD | I_SUB | I_MUL | I_EDIV) as instr), [ty1; ty2], _) -> ( + let ty1 = + Mikhailsky.parse_ty + ~allow_big_map:false + ~allow_operation:false + ~allow_contract:false + ty1 + in + let ty2 = + Mikhailsky.parse_ty + ~allow_big_map:false + ~allow_operation:false + ~allow_contract:false + ty2 + in + match arith_type instr ty1 ty2 with + | None -> + raise (Ill_typed_script (Badly_typed_arithmetic (instr, ty1, ty2))) + | Some ret -> + exists_stack () >>= fun rest -> + unify bef Type.(item ty1 (item ty2 rest)) >>= fun () -> + unify aft Type.(item ret rest)) + | Prim (_, (I_ADD | I_SUB | I_MUL | I_EDIV), _, _) -> + raise (Ill_typed_script (Ill_formed_arithmetic (path, node))) + | Prim (_, I_COMPARE, [], _) -> + exists_cmp () >>= fun a -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item a rest)) >>= fun () -> + unify aft Type.(item int rest) + | Prim (_, I_ABS, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item int rest) >>= fun () -> + unify aft Type.(item nat rest) + | Prim (_, I_GT, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item int rest) >>= fun () -> + unify aft Type.(item bool rest) + (* Strings/bytes *) + | Prim (_, I_CONCAT, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item string (item string rest)) >>= fun () -> + unify aft Type.(item string rest) + | Prim (_, I_SIZE_STRING, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item string rest) >>= fun () -> + unify aft Type.(item nat rest) + | Prim (_, I_SIZE_BYTES, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item bytes rest) >>= fun () -> + unify aft Type.(item nat rest) + (* Crypto *) + | Prim (_, I_SHA256, [], _) + | Prim (_, I_SHA512, [], _) + | Prim (_, I_BLAKE2B, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item bytes rest) >>= fun () -> + unify aft Type.(item bytes rest) + | Prim (_, I_HASH_KEY, [], _) -> + exists_stack () >>= fun rest -> + unify bef Type.(item key rest) >>= fun () -> + unify aft Type.(item key_hash rest) + (* sets *) + | Prim (_, I_EMPTY_SET, [], _) -> + exists_cmp () >>= fun cmpty -> unify aft Type.(item (set cmpty) bef) + | Prim (_, I_UPDATE_SET, [], _) -> + exists_cmp () >>= fun cty -> + exists_stack () >>= fun rest -> + unify bef Type.(item cty (item bool (item (set cty) rest))) >>= fun () -> + unify aft Type.(item (set cty) rest) + | Prim (_, I_SIZE_SET, [], _) -> + exists_cmp () >>= fun cmpty -> + exists_stack () >>= fun rest -> + unify bef Type.(item (set cmpty) rest) >>= fun () -> + unify aft Type.(item nat rest) + | Prim (_, I_ITER_SET, [code], _) -> + exists_cmp () >>= fun cmpty -> + unify bef Type.(item (set cmpty) aft) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item cmpty aft) + aft + | Prim (_, I_MEM_SET, [], _) -> + exists_cmp () >>= fun cmpty -> + exists_stack () >>= fun rest -> + unify bef Type.(item cmpty (item (set cmpty) rest)) >>= fun () -> + unify aft Type.(item bool rest) + (* maps *) + | Prim (_, I_EMPTY_MAP, [], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> unify aft Type.(item (map kty vty) bef) + | Prim (_, I_UPDATE_MAP, [], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> + exists_stack () >>= fun rest -> + unify bef Type.(item kty (item (option vty) (item (map kty vty) rest))) + >>= fun () -> unify aft Type.(item (map kty vty) rest) + | Prim (_, I_SIZE_MAP, [], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> + exists_stack () >>= fun rest -> + unify bef Type.(item (map kty vty) rest) >>= fun () -> + unify aft Type.(item nat rest) + | Prim (_, I_ITER_MAP, [code], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> + unify bef Type.(item (map kty vty) aft) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item (pair kty vty) aft) + aft + | Prim (_, I_MAP_MAP, [code], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty1 -> + exists () >>= fun vty2 -> + exists_stack () >>= fun rest -> + unify bef Type.(item (map kty vty1) rest) >>= fun () -> + unify aft Type.(item (map kty vty2) rest) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item (pair kty vty1) rest) + Type.(item vty2 rest) + | Prim (_, I_MEM_MAP, [], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> + exists_stack () >>= fun rest -> + unify bef Type.(item kty (item (map kty vty) rest)) >>= fun () -> + unify aft Type.(item bool rest) + | Prim (_, I_GET_MAP, [], _) -> + exists_cmp () >>= fun kty -> + exists () >>= fun vty -> + exists_stack () >>= fun rest -> + unify bef Type.(item kty (item (map kty vty) rest)) >>= fun () -> + unify aft Type.(item (option vty) rest) + (* Pairs *) + | Prim (_, I_PAIR, [], _) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item b rest)) >>= fun () -> + unify aft Type.(item (pair a b) rest) + | Prim (_, I_CAR, [], _) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists_stack () >>= fun rest -> + unify bef Type.(item (pair a b) rest) >>= fun () -> + unify aft Type.(item a rest) + | Prim (_, I_CDR, [], _) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists_stack () >>= fun rest -> + unify bef Type.(item (pair a b) rest) >>= fun () -> + unify aft Type.(item b rest) + (* Unions *) + | Prim (_, I_LEFT, [], _) -> + exists () >>= fun lt -> + exists () >>= fun rt -> + exists_stack () >>= fun rest -> + unify bef (Type.item lt rest) >>= fun () -> + unify aft Type.(item (union lt rt) rest) >>= fun res -> return res + | Prim (_, I_RIGHT, [], _) -> + exists () >>= fun lt -> + exists () >>= fun rt -> + exists_stack () >>= fun rest -> + unify bef Type.(item rt rest) >>= fun () -> + unify aft Type.(item (union lt rt) rest) + | Prim (_, (I_LEFT | I_RIGHT), _ :: _, _) -> + invalid_ast ~msg:__LOC__ path node + | Prim (_, I_LOOP_LEFT, [body], _) -> + exists () >>= fun l -> + exists () >>= fun r -> + exists_stack () >>= fun rest -> + unify bef Type.(item (union l r) rest) >>= fun () -> + unify aft Type.(item r rest) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + body + Type.(item l rest) + bef + | Prim (_, I_IF_LEFT, [bt; bf], _) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists_stack () >>= fun rest -> + unify bef Type.(item (union a b) rest) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + bt + (Type.item a rest) + aft + >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 1 path) + bf + (Type.item b rest) + aft + (* lambdas *) + | Prim (_, I_LAMBDA, [code], _) -> + exists () >>= fun dom -> + exists () >>= fun range -> + unify aft Type.(item (lambda dom range) bef) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item dom empty) + Type.(item range empty) + | Prim (_, I_LAMBDA, _, _) -> invalid_ast ~msg:__LOC__ path node + | Prim (_, I_APPLY, [], _) -> + exists () >>= fun a -> + exists () >>= fun b -> + exists () >>= fun ret -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item (lambda (pair a b) ret) rest)) >>= fun () -> + unify aft Type.(item (lambda b ret) rest) + | Prim (_, I_EXEC, [], _) -> + exists () >>= fun a -> + exists () >>= fun ret -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item (lambda a ret) rest)) >>= fun () -> + unify aft Type.(item ret rest) + (* lists *) + | Prim (_, I_NIL, [], _) -> + exists () >>= fun a -> unify aft Type.(item (list a) bef) + | Prim (_, I_CONS, [], _) -> + exists () >>= fun a -> + exists_stack () >>= fun rest -> + unify bef Type.(item a (item (list a) rest)) >>= fun () -> + unify aft Type.(item (list a) rest) + | Prim (_, I_SIZE_LIST, [], _) -> + exists () >>= fun ty -> + exists_stack () >>= fun rest -> + unify bef Type.(item (list ty) rest) >>= fun () -> + unify aft Type.(item nat rest) + | Prim (_, I_ITER_LIST, [code], _) -> + exists () >>= fun ty -> + unify bef Type.(item (list ty) aft) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item ty aft) + aft + | Prim (_, I_MAP_LIST, [code], _) -> + exists () >>= fun ty1 -> + exists () >>= fun ty2 -> + exists_stack () >>= fun rest -> + unify bef Type.(item (list ty1) rest) >>= fun () -> + unify aft Type.(item (list ty2) rest) >>= fun () -> + generate_constraints + (Mikhailsky.Path.at_index 0 path) + code + Type.(item ty1 rest) + Type.(item ty2 rest) + (* pack/unpack*) + | Prim (_, I_PACK, [], _) -> + exists () >>= fun ty -> + exists_stack () >>= fun rest -> + unify bef Type.(item ty rest) >>= fun () -> + unify aft Type.(item bytes rest) + | Prim (_, I_UNPACK, [], _) -> + exists () >>= fun ty -> + exists_stack () >>= fun rest -> + unify bef Type.(item bytes rest) >>= fun () -> + unify aft Type.(item (option ty) rest) + (* Others *) + | Seq (_, []) -> unify bef aft + | Seq (_, [single]) -> + generate_constraints (Mikhailsky.Path.at_index 0 path) single bef aft + | Seq (_, instrs) -> generate_constraints_seq path 0 instrs bef aft + | _ -> raise (Ill_typed_script (Unhandled_micheline (path, node))) + +and generate_constraints_seq path index instrs bef aft = + let open M in + match instrs with + | [] -> assert false + | [single] -> + generate_constraints (Mikhailsky.Path.at_index index path) single bef aft + | hd :: tl -> + exists_stack () >>= fun stack_ty -> + generate_constraints (Mikhailsky.Path.at_index index path) hd bef stack_ty + >>= fun () -> generate_constraints_seq path (index + 1) tl stack_ty aft + +and generate_constraints_data (path : Mikhailsky.Path.t) + (node : Mikhailsky.node) (ty : Type.Base.t) : unit M.t = + let open M in + set_data_annot path ty >>= fun () -> + match node with + | Prim (_, D_Hole, [], _) -> return () + | Prim (_, D_Unit, [], _) -> unify_base ty Type.unit + | Prim (_, D_True, [], _) | Prim (_, D_False, [], _) -> + unify_base ty Type.bool + | String _ -> unify_base ty Type.string + | Bytes _ -> unify_base ty Type.bytes + | Prim (_, D_Pair, [vl; vr], _) -> + exists () >>= fun lty -> + exists () >>= fun rty -> + generate_constraints_data (Mikhailsky.Path.at_index 0 path) vl lty + >>= fun () -> + generate_constraints_data (Mikhailsky.Path.at_index 1 path) vr rty + >>= fun () -> unify_base ty (Type.pair lty rty) + | Prim (_, D_Left, [term], _) -> + exists () >>= fun lty -> + exists () >>= fun rty -> + generate_constraints_data (Mikhailsky.Path.at_index 0 path) term lty + >>= fun () -> unify_base ty (Type.union lty rty) + | Prim (_, D_Right, [term], _) -> + exists () >>= fun lty -> + exists () >>= fun rty -> + generate_constraints_data (Mikhailsky.Path.at_index 0 path) term rty + >>= fun () -> unify_base ty (Type.union lty rty) + | Prim (_, D_None, [], _) -> + exists () >>= fun elt_ty -> unify_base ty (Type.option elt_ty) + | Prim (_, D_Some, [v], _) -> + exists () >>= fun elt_ty -> + generate_constraints_data (Mikhailsky.Path.at_index 0 path) v elt_ty + >>= fun () -> unify_base ty (Type.option elt_ty) + | Prim (_, A_Int, [Int (_, _)], _) -> unify_base ty Type.int + | Prim (_, A_Nat, [Int (_, _)], _) -> unify_base ty Type.nat + | Prim (_, A_Timestamp, [Int (_, _)], _) -> unify_base ty Type.timestamp + | Prim (_, A_Mutez, [Int (_, _)], _) -> unify_base ty Type.mutez + | Prim (_, A_Key_hash, [Bytes (_, _)], _) -> unify_base ty Type.key_hash + | Prim (_, A_Key, [Bytes (_, _)], _) -> unify_base ty Type.key + | Prim (_, A_List, [Seq (_, subterms)], _) -> + exists () >>= fun elt_ty -> + unify_base ty Type.(list elt_ty) >>= fun () -> + (* path' accounts for the fact that the Seq is hidden under an annot. *) + let path' = Mikhailsky.Path.at_index 0 path in + generate_constraints_data_list path' 0 subterms elt_ty + | Prim (_, A_Set, [Seq (_, subterms)], _) -> + exists_cmp () >>= fun elt_ty -> + unify_base ty Type.(set elt_ty) >>= fun () -> + (* path' accounts for the fact that the Seq is hidden under an annot. *) + let path' = Mikhailsky.Path.at_index 0 path in + generate_constraints_data_set path' 0 subterms elt_ty + | Prim (_, A_Map, [Seq (_, subterms)], _) -> + exists_cmp () >>= fun k_ty -> + exists () >>= fun v_ty -> + unify_base ty Type.(map k_ty v_ty) >>= fun () -> + (* path' accounts for the fact that the Seq is hidden under an annot. *) + let path' = Mikhailsky.Path.at_index 0 path in + generate_constraints_data_map path' 0 subterms k_ty v_ty + | Prim (_, A_Lambda, [(Seq (_, _) as node)], _) -> + exists () >>= fun dom -> + exists () >>= fun range -> + unify_base ty Type.(lambda dom range) >>= fun () -> + let path' = Mikhailsky.Path.at_index 0 path in + let bef = Type.(item dom empty) in + let aft = Type.(item range empty) in + generate_constraints path' node bef aft + | Prim (_, (A_Int | A_Nat | A_List), _, _) -> + invalid_ast ~msg:__LOC__ path node + | Int _ + (* Ints should always be guarded by annotations *) + | Seq (_, _) + (* Lists, sets, maps, lambdas, should always be guarded by annotations *) + | _ -> + invalid_ast ~msg:__LOC__ path node + +(* raise (Ill_typed_script (Invalid_ast (path, node))) *) +and generate_constraints_data_list path index data ty = + let open M in + match data with + | [] -> return () + | hd :: tl -> + let hd_path = Mikhailsky.Path.at_index index path in + generate_constraints_data hd_path hd ty >>= fun () -> + generate_constraints_data_list path (index + 1) tl ty + +and generate_constraints_data_set path index data ty = + let open M in + match data with + | [] -> return () + | hd :: tl -> + let hd_path = Mikhailsky.Path.at_index index path in + generate_constraints_data hd_path hd ty >>= fun () -> + generate_constraints_data_list path (index + 1) tl ty + +and generate_constraints_data_map path index data k_ty v_ty = + let open M in + match data with + | [] -> return () + | elt :: tl -> ( + let elt_path = Mikhailsky.Path.at_index index path in + match elt with + | Prim (_, D_Elt, [k; v], _) -> + let k_path = Mikhailsky.Path.at_index 0 elt_path in + generate_constraints_data k_path k k_ty >>= fun () -> + let v_path = Mikhailsky.Path.at_index 1 elt_path in + generate_constraints_data v_path v v_ty >>= fun () -> + generate_constraints_data_map path (index + 1) tl k_ty v_ty + | _ -> invalid_ast ~msg:__LOC__ elt_path elt) + +and generate_constraints_dropn n bef aft = + let open M in + if n = 0 then unify bef aft + else + exists () >>= fun top -> + generate_constraints_dropn (n - 1) bef (Type.item top aft) + +let infer_with_state (node : Mikhailsky.node) : + (Type.Stack.t * Type.Stack.t) * state = + let open M in + ( exists_stack () >>= fun bef -> + exists_stack () >>= fun aft -> + generate_constraints Mikhailsky.Path.root node bef aft >>= fun () -> + instantiate bef >>= fun bef -> + instantiate aft >>= fun aft -> return (bef, aft) ) + (M.empty ()) + +let infer (node : Mikhailsky.node) : Type.Stack.t * Type.Stack.t = + fst (infer_with_state node) + +let infer_data_with_state (node : Mikhailsky.node) : Type.Base.t * state = + let open M in + ( exists () >>= fun ty -> + generate_constraints_data Mikhailsky.Path.root node ty >>= fun () -> + instantiate_base ty >>= fun ty -> return ty ) + (M.empty ()) + +let infer_data (node : Mikhailsky.node) : Type.Base.t = + fst (infer_data_with_state node) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.mli b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.mli new file mode 100644 index 000000000000..e44d83fab069 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/inference.mli @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Errors and their pretty-printing function *) +type inference_error + +exception Ill_typed_script of inference_error + +val pp_inference_error : Format.formatter -> inference_error -> unit + +(** Comparability tag. *) +type comparability = Comparable | Not_comparable | Unconstrained + +(** Michelson types. *) +type michelson_type = + | Base_type of {repr : Type.Base.t option; comparable : comparability} + | Stack_type of Type.Stack.t option + +type transformer = {bef : Type.Stack.t; aft : Type.Stack.t} + +(** State of the type inference module *) + +(** Store implementation for type representatives *) +module Repr_store : Stores.S with type key = int and type value = michelson_type + +(** State monad built on [Repr_store] *) +module Repr_sm : + Monads.State_sig + with type state = Repr_store.state + and type key = int + and type value = michelson_type + +(** Store implementation for instruction type representatives *) +module Annot_instr_store : + Stores.S with type key = Mikhailsky.Path.t and type value = transformer + +(** State monad handling annotations on instructions *) +module Annot_instr_sm : + Monads.State_sig + with type state = Annot_instr_store.state + and type value = transformer + and type key = Mikhailsky.Path.t + +(** Store implementation for data type representatives *) +module Annot_data_store : + Stores.S with type key = Mikhailsky.Path.t and type value = Type.Base.t + +(** State monad handling annotations on data *) +module Annot_data_sm : + Monads.State_sig + with type state = Annot_data_store.state + and type value = Type.Base.t + and type key = Mikhailsky.Path.t + +(** State of the inference module *) +type state = { + uf : Uf.UF.M.state; + repr : Repr_sm.state; + annot_instr : Annot_instr_sm.state; + annot_data : Annot_data_sm.state; +} + +(** State monad of the inference module. *) +module M : sig + type 'a t = state -> 'a * state + + val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t + + val empty : unit -> state + + val return : 'a -> 'a t + + val set_repr : int -> michelson_type -> unit t + + val get_repr_exn : int -> michelson_type t + + val get_instr_annot : Annot_data_sm.key -> transformer option t + + val get_data_annot : Annot_data_sm.key -> Type.Base.t option t + + val uf_lift : 'a Uf.UF.M.t -> 'a t + + val repr_lift : 'a Repr_sm.t -> 'a t + + val annot_instr_lift : 'a Annot_instr_sm.t -> 'a t + + val annot_data_lift : 'a Annot_data_sm.t -> 'a t + + val get_state : state t +end + +(** Unifies two stack types. *) +val unify : Type.Stack.t -> Type.Stack.t -> unit M.t + +(** Unifies two base types. *) +val unify_base : Type.Base.t -> Type.Base.t -> unit M.t + +(** Instantiate type variables with the associated terms in a base type. *) +val instantiate_base : Type.Base.t -> Type.Base.t M.t + +(** Instantiate type variables with the associated terms in a stack type. *) +val instantiate : Type.Stack.t -> Type.Stack.t M.t + +(** Get comparability flag for a base type. *) +val get_comparability : Type.Base.t -> comparability M.t + +(** Performs inference on the given Mikhailsky term and returns + its type (as a pair of [before] and [after] stack) as well as the + inference engine state. *) +val infer_with_state : Mikhailsky.node -> (Type.Stack.t * Type.Stack.t) * state + +(** Performs inference on the given Mikhailsky term and throws + the inference engine state away. *) +val infer : Mikhailsky.node -> Type.Stack.t * Type.Stack.t + +(** Performs inference on a piece of Mikhailsky [data] and + returns the inference engine state along the inferred type. *) +val infer_data_with_state : Mikhailsky.node -> Type.Base.t * state + +(** Performs inference on a piece of Mikhailsky [data] and + returns the inferred type, throwing the inference engine + state away. *) +val infer_data : Mikhailsky.node -> Type.Base.t diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/int_map.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/int_map.ml new file mode 100644 index 000000000000..e9b05fe91caa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/int_map.ml @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Map.Make (Compare.Int) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml new file mode 100644 index 000000000000..8395355273ce --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml @@ -0,0 +1,422 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +exception Term_contains_holes + +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim = struct + type t = Mikhailsky_prim.prim + + let compare (x : t) (y : t) = Stdlib.compare x y + + let hash (x : t) = Hashtbl.hash x + + let pp = Mikhailsky_prim.pp +end + +include + Micheline_with_hash_consing.Make + (Mikhailsky_signature) + (struct + let initial_size = None + end) + +module Path = Path.With_hash_consing (struct + let initial_size = None +end) + +(* Prints a Mikhailsky term. *) +let pp fmt node = + let canonical = Micheline.strip_locations node in + let printable = + Micheline_printer.printable Mikhailsky_prim.string_of_prim canonical + in + Micheline_printer.print_expr fmt printable + +let to_string node = + pp Format.str_formatter node ; + Format.flush_str_formatter () + +(* Adapted from Script_ir_translator.parse_ty *) +let rec parse_ty : + allow_big_map:bool -> + allow_operation:bool -> + allow_contract:bool -> + node -> + Type.Base.t = + fun ~allow_big_map ~allow_operation ~allow_contract node -> + match node with + | Prim (_loc, T_unit, [], _annot) -> Type.unit + | Prim (_loc, T_int, [], _annot) -> Type.int + | Prim (_loc, T_nat, [], _annot) -> Type.nat + | Prim (_loc, T_string, [], _annot) -> Type.string + | Prim (_loc, T_bytes, [], _annot) -> Type.bytes + | Prim (_loc, T_bool, [], _annot) -> Type.bool + | Prim (_loc, T_key_hash, [], _annot) -> Type.key_hash + | Prim (_loc, T_timestamp, [], _annot) -> Type.timestamp + | Prim (_loc, T_mutez, [], _annot) -> Type.mutez + | Prim (_loc, T_option, [ut], _annot) -> + let ty = parse_ty ~allow_big_map ~allow_operation ~allow_contract ut in + Type.option ty + | Prim (_loc, T_pair, [utl; utr], _annot) -> + let lty = parse_ty ~allow_big_map ~allow_operation ~allow_contract utl in + let rty = parse_ty ~allow_big_map ~allow_operation ~allow_contract utr in + Type.pair lty rty + | Prim (_loc, T_or, [utl; utr], _annot) -> + let lty = parse_ty ~allow_big_map ~allow_operation ~allow_contract utl in + let rty = parse_ty ~allow_big_map ~allow_operation ~allow_contract utr in + Type.union lty rty + | Prim (_loc, T_set, [ut], _annot) -> + let ut = parse_ty ~allow_big_map ~allow_operation ~allow_contract ut in + Type.set ut + | Prim (_loc, T_map, [uta; utb], _annot) -> + let uta = parse_ty ~allow_big_map ~allow_operation ~allow_contract uta in + let utb = parse_ty ~allow_big_map ~allow_operation ~allow_contract utb in + Type.map uta utb + | Prim (_loc, T_lambda, [dom; range], _annot) -> + let dom = parse_ty ~allow_big_map ~allow_operation ~allow_contract dom in + let range = + parse_ty ~allow_big_map ~allow_operation ~allow_contract range + in + Type.lambda dom range + | Prim (_loc, T_list, [elt], _annot) -> + let elt = parse_ty ~allow_big_map ~allow_operation ~allow_contract elt in + Type.list elt + | _ -> + let s = to_string node in + Stdlib.failwith ("Mikhailsky.parse_ty: could not parse " ^ s) + +exception Term_has_variables + +exception Ill_formed_mikhailsky + +let rec map_var f (x : Type.Base.t) = + match x.node with + | Unit_t -> prim T_unit [] [] + | Var_t v -> f v + | Int_t -> prim T_int [] [] + | Nat_t -> prim T_nat [] [] + | Bool_t -> prim T_bool [] [] + | String_t -> prim T_string [] [] + | Bytes_t -> prim T_bytes [] [] + | Key_hash_t -> prim T_key_hash [] [] + | Timestamp_t -> prim T_timestamp [] [] + | Mutez_t -> prim T_mutez [] [] + | Key_t -> prim T_key [] [] + | Option_t ty -> + let mty = map_var f ty in + prim T_option [mty] [] + | Pair_t (lty, rty) -> + let lty = map_var f lty in + let rty = map_var f rty in + prim T_pair [lty; rty] [] + | Union_t (lty, rty) -> + let lty = map_var f lty in + let rty = map_var f rty in + prim T_or [lty; rty] [] + | List_t ty -> + let mty = map_var f ty in + prim T_list [mty] [] + | Set_t ty -> + let mty = map_var f ty in + prim T_set [mty] [] + | Map_t (kty, vty) -> + let mkty = map_var f kty in + let mvty = map_var f vty in + prim T_map [mkty; mvty] [] + | Lambda_t (dom, range) -> + let dom = map_var f dom in + let range = map_var f range in + prim T_lambda [dom; range] [] + +let unparse_ty_exn (x : Type.Base.t) = + map_var (fun _ -> raise Term_has_variables) x + +let unparse_ty (x : Type.Base.t) = + try Some (unparse_ty_exn x) with Term_has_variables -> None + +(* Exports a Mikhailsky term to Michelson. Fails if term contains holes. + Erases annotations, introduces types where missing. *) +let rec to_michelson (n : node) = + match n with + | Micheline.Int (_, i) -> Micheline.Int (0, i) + | Micheline.Prim (_, head, [term], _) + when Mikhailsky_prim.kind head = Annot_kind && head <> A_Lambda -> + to_michelson term + | Micheline.Prim (_, I_Hole, _, _) -> raise Term_contains_holes + | Micheline.Prim (_, D_Hole, _, _) -> raise Term_contains_holes + | Micheline.Prim (_, head, subterms, annots) -> + let head = Mikhailsky_prim.to_michelson head in + Micheline.Prim (0, head, List.map to_michelson subterms, annots) + | Micheline.String (_, s) -> Micheline.String (0, s) + | Micheline.Bytes (_, b) -> Micheline.Bytes (0, b) + | Micheline.Seq (_, subterms) -> + Micheline.Seq (0, List.map to_michelson subterms) + +let to_michelson (n : node) : Script_repr.expr = + Micheline.strip_locations (to_michelson n) + +let rec size : node -> int = + fun node -> + match node with + | Micheline.Int (_, _) -> 1 + | Micheline.String (_, _) -> 1 + | Micheline.Bytes (_, _) -> 1 + | Micheline.Prim (_, _, subterms, _) -> + List.fold_left (fun acc n -> acc + size n) 1 subterms + | Micheline.Seq (_, subterms) -> + List.fold_left (fun acc n -> acc + size n) 1 subterms + +let instr_hole = prim I_Hole [] [] + +let data_hole = prim D_Hole [] [] + +(* types *) +let unit_ty = prim T_unit [] [] + +let bool_ty = prim T_bool [] [] + +let int_ty = prim T_int [] [] + +let nat_ty = prim T_nat [] [] + +let string_ty = prim T_string [] [] + +let bytes_ty = prim T_bytes [] [] + +let key_hash_ty = prim T_key_hash [] [] + +let option_ty x = prim T_option [x] [] + +let list_ty x = prim T_list [x] [] + +(* Unique identifier provided by hash-consing Micheline terms. *) +let tag node = + let l = label node in + l.tag + +(* hash of term *) +let hash node = + let l = label node in + l.hash + +module Instructions = struct + (* arithmetic *) + + let add ty1 ty2 = prim I_ADD [ty1; ty2] [] + + let sub ty1 ty2 = prim I_SUB [ty1; ty2] [] + + let mul ty1 ty2 = prim I_MUL [ty1; ty2] [] + + let ediv ty1 ty2 = prim I_EDIV [ty1; ty2] [] + + let abs = prim I_ABS [] [] + + let gt = prim I_GT [] [] + + (* stack ops *) + let push ty v = prim I_PUSH [ty; v] [] + + let dip code = prim I_DIP [seq [code]] [] + + let dup = prim I_DUP [] [] + + let drop = prim I_DROP [] [] + + let dropn n = prim I_DROP [int (Z.of_int n)] [] + + let swap = prim I_SWAP [] [] + + (* crypto *) + let blake2b = prim I_BLAKE2B [] [] + + let sha256 = prim I_SHA256 [] [] + + let sha512 = prim I_SHA512 [] [] + + let hash_key = prim I_HASH_KEY [] [] + + (* control *) + let if_ bt bf = prim I_IF [seq [bt]; seq [bf]] [] + + let if_left bt bf = prim I_IF_LEFT [seq [bt]; seq [bf]] [] + + let if_none bt bf = prim I_IF_NONE [seq [bt]; seq [bf]] [] + + let loop b = prim I_LOOP [seq [b]] [] + + let loop_left b = prim I_LOOP_LEFT [seq [b]] [] + + (* pairs *) + let car = prim I_CAR [] [] + + let cdr = prim I_CDR [] [] + + let pair = prim I_PAIR [] [] + + (* unions *) + + let left = prim I_LEFT [] [] + + let right = prim I_RIGHT [] [] + + (* boolean *) + let and_ = prim I_AND [] [] + + (* compare *) + let compare = prim I_COMPARE [] [] + + (* map/set *) + let empty_set = prim I_EMPTY_SET [] [] + + let update_set = prim I_UPDATE_SET [] [] + + let size_set = prim I_SIZE_SET [] [] + + let iter_set code = prim I_ITER_SET [seq code] [] + + let mem_set = prim I_MEM_SET [] [] + + let empty_map = prim I_EMPTY_MAP [] [] + + let update_map = prim I_UPDATE_MAP [] [] + + let size_map = prim I_SIZE_MAP [] [] + + let iter_map code = prim I_ITER_MAP [seq code] [] + + let map_map code = prim I_MAP_MAP [seq code] [] + + let get_map = prim I_GET_MAP [] [] + + let mem_map = prim I_MEM_MAP [] [] + + (* lists*) + let nil = prim I_NIL [] [] + + let cons = prim I_CONS [] [] + + let size_list = prim I_SIZE_LIST [] [] + + let iter_list code = prim I_ITER_LIST [seq code] [] + + let map_list code = prim I_MAP_LIST [seq code] [] + + (* strings *) + let concat = prim I_CONCAT [] [] + + let size_string = prim I_SIZE_STRING [] [] + + let size_bytes = prim I_SIZE_BYTES [] [] + + (* Lambdas *) + let lambda code = prim I_LAMBDA [seq code] [] + + let exec = prim I_EXEC [] [] + + let apply = prim I_APPLY [] [] + + (* pack/unpack *) + let pack = prim I_PACK [] [] + + let unpack = prim I_UNPACK [] [] + + (* hole *) + let hole = instr_hole +end + +(* value constructors *) +module Data = struct + let unit = prim D_Unit [] [] + + let false_ = prim D_False [] [] + + let true_ = prim D_True [] [] + + let none = prim D_None [] [] + + let some x = prim D_Some [x] [] + + let pair x y = prim D_Pair [x; y] [] + + let left x = prim D_Left [x] [] + + let right x = prim D_Right [x] [] + + let list elts = prim A_List [seq elts] [] + + let set elts = prim A_Set [seq elts] [] + + let map_elt k v = prim D_Elt [k; v] [] + + let map elts = prim A_Map [seq elts] [] + + let timestamp ts = + let z = Protocol.Script_timestamp.to_zint ts in + prim A_Timestamp [int z] [] + + let mutez (tz : Protocol.Alpha_context.Tez.tez) = + let i = Protocol.Alpha_context.Tez.to_mutez tz in + prim A_Mutez [int (Z.of_int64 i)] [] + + let key_hash kh = + let b = + Data_encoding.Binary.to_bytes_exn + Environment.Signature.Public_key_hash.encoding + kh + in + prim A_Key_hash [bytes b] [] + + let key k = + let b = + Data_encoding.Binary.to_bytes_exn + Environment.Signature.Public_key.encoding + k + in + prim A_Key [bytes b] [] + + let integer (i : int) = prim A_Int [int (Z.of_int i)] [] + + let natural (i : int) = + assert (i >= 0) ; + prim A_Nat [int (Z.of_int i)] [] + + let big_integer (i : Z.t) = prim A_Int [int i] [] + + let big_natural (i : Z.t) = + assert (Z.geq i Z.zero) ; + prim A_Nat [int i] [] + + let string = string + + let bytes = bytes + + let lambda code = prim A_Lambda [seq code] [] + + let hole = data_hole +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli new file mode 100644 index 000000000000..724bfa299074 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli @@ -0,0 +1,331 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Mikhailsky: Michelson in Micheline form, with typed holes and annotations. + Mikhailsky terms are hash-consed. *) + +(** + Michelson code is a hard to type-check and generate incrementally due to + the presence of ambiguous constructs, such as literals + like [{ 1 ; 2 ; 3 }]. Is it a list of ints? of nats? of tez? Or a set? + + Thus, we will work with Mikhailsky, a better behaved version of Michelson + allowing local reconstruction of types. + + Differences wrt Michelson: + + 1. non string/byte literals are explicitly annotated with their head type constructor. + Here is an int i: Prim (_, D_int, [Int i], _) + Here is an nat n: Prim (_, D_nat, [Int i], _) + Here is an list of something: Prim (_, D_list, michelson_list, _) + Here is a set: Prim (_, D_set, michelson_set, _) + Here is a map: Prim (_, D_map, michelson_map, _) + etc. + Projecting back from this language to Michelson is trivial. + + 2. Instructions `LEFT/RIGHT` do not need to carry the type of the other + component of the disjunction. These has to be filled in back when + generating Michelson from Mikhailsky. + + 4. The same holds for the input/output type of a lambda as specified in the + `LAMBDA` instruction. + + 3. Some instructions are annotated with the type on which they operate. + Eg if Prim (_, I_ADD, [], []) is the (ad-hoc polymorphic) addition in Michelson, + we will have the following variants in Mikhailsky: + - Prim (_, I_ADD, [ Prim (_, T_mutez, [], []), + Prim (_, T_mutez, [], []) ], []) for mutez addition + - Prim (_, I_ADD, [ Prim (_, T_int, [], []), + Prim (_, T_nat, [], []) ], []) for int+nat addition + etc. +*) + +(** The signature of Mikhailsky terms. *) +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim + +(** Elements of type [Path.t] allow to index subterms of Mikhailsky terms. *) +module Path : Path.S + +(** The following types correspond to those provided when instantiating the + functor [Micheline_with_hash_consing.Make] on [Mikhailsky_signature]. *) +type label = Micheline_with_hash_consing.hcons_info + +type head = Mikhailsky_signature.t + +type node = (label, head) Micheline.node + +exception Term_contains_holes + +exception Ill_formed_mikhailsky + +(** [parse_ty] returns a type from a Mikhailsky term. *) +val parse_ty : + allow_big_map:bool -> + allow_operation:bool -> + allow_contract:bool -> + node -> + Type.Base.t + +(** [map_var f x] maps the function f on all variables contained + in the type [x]. *) +val map_var : (int -> node) -> Type.Base.t -> node + +(** [unparse_ty] returns a Mikhailsky term representing a type. *) +val unparse_ty_exn : Type.Base.t -> node + +val unparse_ty : Type.Base.t -> node option + +(** Extracts a Michelson term from a Mikhailsky one. Raises + [Term_contains_holes] if it cannot be done. *) +val to_michelson : node -> Script_repr.expr + +(** Pretty printer. *) +val pp : Format.formatter -> node -> unit + +val to_string : node -> string + +(** Returns the number of nodes of a Mikhailsky term. *) +val size : node -> int + +(** Micheline generic constructors *) +val prim : Mikhailsky_prim.prim -> node list -> string list -> node + +val seq : node list -> node + +val string : string -> node + +val bytes : Bytes.t -> node + +(** Mikhailsky smart constructors*) + +(** Holes *) +val instr_hole : node + +val data_hole : node + +(** Types *) +val unit_ty : node + +val int_ty : node + +val nat_ty : node + +val bool_ty : node + +val string_ty : node + +val bytes_ty : node + +val key_hash_ty : node + +val option_ty : node -> node + +val list_ty : node -> node + +(** Project unique tag out of Mikhailsky node *) +val tag : node -> int + +(** Project hash out of Mikhailsky node *) +val hash : node -> int + +(** Instructions *) +module Instructions : sig + (** Arithmetic. Binary operations take the input types as extra arguments. *) + val add : node -> node -> node + + val sub : node -> node -> node + + val mul : node -> node -> node + + val ediv : node -> node -> node + + val abs : node + + val gt : node + + (** Stack *) + val push : node -> node -> node + + val dip : node -> node + + val dup : node + + val drop : node + + val dropn : int -> node + + val swap : node + + (** Crypto *) + val blake2b : node + + val sha256 : node + + val sha512 : node + + val hash_key : node + + (** Control *) + val if_ : node -> node -> node + + val if_left : node -> node -> node + + val if_none : node -> node -> node + + val loop : node -> node + + val loop_left : node -> node + + (** Pairs *) + val car : node + + val cdr : node + + val pair : node + + (** Unions *) + val left : node + + val right : node + + (** Booleans *) + val and_ : node + + (** Compare *) + val compare : node + + (** Set/Map *) + val empty_set : node + + val update_set : node + + val size_set : node + + val iter_set : node list -> node + + val mem_set : node + + val empty_map : node + + val update_map : node + + val size_map : node + + val iter_map : node list -> node + + val map_map : node list -> node + + val get_map : node + + val mem_map : node + + (** Lists *) + val nil : node + + val cons : node + + val size_list : node + + val iter_list : node list -> node + + val map_list : node list -> node + + (** Strings/bytes *) + val concat : node + + val size_string : node + + val size_bytes : node + + (** Lambdas *) + val lambda : node list -> node + + val exec : node + + val apply : node + + (** pack/unpack *) + + val pack : node + + val unpack : node + + (** Hole *) + val hole : node +end + +(** data *) +module Data : sig + val unit : node + + val false_ : node + + val true_ : node + + val none : node + + val some : node -> node + + val pair : node -> node -> node + + val left : node -> node + + val right : node -> node + + val list : node list -> node + + val set : node list -> node + + val map_elt : node -> node -> node + + val map : node list -> node + + val timestamp : Script_timestamp.t -> node + + val mutez : Alpha_context.Tez.t -> node + + val key_hash : Environment.Signature.Public_key_hash.t -> node + + val key : Environment.Signature.Public_key.t -> node + + val integer : int -> node + + val natural : int -> node + + val big_integer : Z.t -> node + + val big_natural : Z.t -> node + + val string : string -> node + + val bytes : Bytes.t -> node + + val lambda : node list -> node + + val hole : node +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky_prim.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky_prim.ml new file mode 100644 index 000000000000..362ec1eb45f2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/mikhailsky_prim.ml @@ -0,0 +1,572 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Mikhailsky primitives correspond to Michelson primitives plus special + "holes" for instructions and data. *) + +type prim = + | K_parameter + | K_storage + | K_code + | D_False + | D_Elt + | D_Left + | D_None + | D_Pair + | D_Right + | D_Some + | D_True + | D_Unit + | I_PACK + | I_UNPACK + | I_BLAKE2B + | I_SHA256 + | I_SHA512 + | I_ABS + | I_ADD + | I_AMOUNT + | I_AND + | I_BALANCE + | I_CAR + | I_CDR + | I_CHAIN_ID + | I_CHECK_SIGNATURE + | I_COMPARE + | I_CONCAT + | I_CONS + | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT + | I_IMPLICIT_ACCOUNT + | I_DIP + | I_DROP + | I_DUP + | I_EDIV + | I_EMPTY_BIG_MAP + | I_EMPTY_MAP + | I_EMPTY_SET + | I_EQ + | I_EXEC + | I_APPLY + | I_FAILWITH + | I_GE + | I_GET_MAP + | I_GET_AND_UPDATE_MAP + | I_GT + | I_HASH_KEY + | I_IF + | I_IF_CONS + | I_IF_LEFT + | I_IF_NONE + | I_INT + | I_LAMBDA + | I_LE + | I_LEFT + | I_LOOP + | I_LSL + | I_LSR + | I_LT + | I_MAP_MAP + | I_MAP_LIST + | I_MEM_SET + | I_MEM_MAP + | I_MUL + | I_NEG + | I_NEQ + | I_NIL + | I_NONE + | I_NOT + | I_NOW + | I_OR + | I_PAIR + | I_UNPAIR + | I_PUSH + | I_RIGHT + | I_SIZE_SET + | I_SIZE_MAP + | I_SIZE_LIST + | I_SIZE_STRING + | I_SIZE_BYTES + | I_SOME + | I_SOURCE + | I_SENDER + | I_SELF + | I_SLICE + | I_STEPS_TO_QUOTA + | I_SUB + | I_SWAP + | I_TRANSFER_TOKENS + | I_SET_DELEGATE + | I_UNIT + | I_UPDATE_SET + | I_UPDATE_MAP + | I_XOR + | I_ITER_MAP + | I_ITER_LIST + | I_ITER_SET + | I_LOOP_LEFT + | I_ADDRESS + | I_CONTRACT + | I_ISNAT + | I_CAST + | I_RENAME + | I_DIG + | I_DUG + | I_LEVEL + | I_SELF_ADDRESS + | I_NEVER + | I_SAPLING_EMPTY_STATE + | I_SAPLING_VERIFY_UPDATE + | I_VOTING_POWER + | I_TOTAL_VOTING_POWER + | I_KECCAK + | I_SHA3 + | I_PAIRING_CHECK + | I_TICKET + | I_READ_TICKET + | I_SPLIT_TICKET + | I_JOIN_TICKETS + | T_bool + | T_contract + | T_int + | T_key + | T_key_hash + | T_lambda + | T_list + | T_map + | T_big_map + | T_nat + | T_option + | T_or + | T_pair + | T_set + | T_signature + | T_string + | T_bytes + | T_mutez + | T_timestamp + | T_unit + | T_operation + | T_address + | T_chain_id + | T_never + | T_sapling_state + | T_sapling_transaction_deprecated + | T_bls12_381_g1 + | T_bls12_381_g2 + | T_bls12_381_fr + | T_ticket + (* Holes in programs and data. *) + | I_Hole + | D_Hole + (* Annotations. *) + | A_Int + | A_Nat + | A_Timestamp + | A_Mutez + | A_Key_hash + | A_Key + | A_List + | A_Set + | A_Map + | A_Lambda + +let relation = + [ + (K_parameter, Michelson_v1_primitives.K_parameter); + (K_storage, Michelson_v1_primitives.K_storage); + (K_code, Michelson_v1_primitives.K_code); + (D_False, Michelson_v1_primitives.D_False); + (D_Elt, Michelson_v1_primitives.D_Elt); + (D_Left, Michelson_v1_primitives.D_Left); + (D_None, Michelson_v1_primitives.D_None); + (D_Pair, Michelson_v1_primitives.D_Pair); + (D_Right, Michelson_v1_primitives.D_Right); + (D_Some, Michelson_v1_primitives.D_Some); + (D_True, Michelson_v1_primitives.D_True); + (D_Unit, Michelson_v1_primitives.D_Unit); + (I_PACK, Michelson_v1_primitives.I_PACK); + (I_UNPACK, Michelson_v1_primitives.I_UNPACK); + (I_BLAKE2B, Michelson_v1_primitives.I_BLAKE2B); + (I_SHA256, Michelson_v1_primitives.I_SHA256); + (I_SHA512, Michelson_v1_primitives.I_SHA512); + (I_ABS, Michelson_v1_primitives.I_ABS); + (I_ADD, Michelson_v1_primitives.I_ADD); + (I_AMOUNT, Michelson_v1_primitives.I_AMOUNT); + (I_AND, Michelson_v1_primitives.I_AND); + (I_BALANCE, Michelson_v1_primitives.I_BALANCE); + (I_CAR, Michelson_v1_primitives.I_CAR); + (I_CDR, Michelson_v1_primitives.I_CDR); + (I_CHAIN_ID, Michelson_v1_primitives.I_CHAIN_ID); + (I_CHECK_SIGNATURE, Michelson_v1_primitives.I_CHECK_SIGNATURE); + (I_COMPARE, Michelson_v1_primitives.I_COMPARE); + (I_CONCAT, Michelson_v1_primitives.I_CONCAT); + (I_CONS, Michelson_v1_primitives.I_CONS); + (I_CREATE_ACCOUNT, Michelson_v1_primitives.I_CREATE_ACCOUNT); + (I_CREATE_CONTRACT, Michelson_v1_primitives.I_CREATE_CONTRACT); + (I_IMPLICIT_ACCOUNT, Michelson_v1_primitives.I_IMPLICIT_ACCOUNT); + (I_DIP, Michelson_v1_primitives.I_DIP); + (I_DROP, Michelson_v1_primitives.I_DROP); + (I_DUP, Michelson_v1_primitives.I_DUP); + (I_EDIV, Michelson_v1_primitives.I_EDIV); + (I_EMPTY_BIG_MAP, Michelson_v1_primitives.I_EMPTY_BIG_MAP); + (I_EMPTY_MAP, Michelson_v1_primitives.I_EMPTY_MAP); + (I_EMPTY_SET, Michelson_v1_primitives.I_EMPTY_SET); + (I_EQ, Michelson_v1_primitives.I_EQ); + (I_EXEC, Michelson_v1_primitives.I_EXEC); + (I_APPLY, Michelson_v1_primitives.I_APPLY); + (I_FAILWITH, Michelson_v1_primitives.I_FAILWITH); + (I_GE, Michelson_v1_primitives.I_GE); + (I_GET_MAP, Michelson_v1_primitives.I_GET); + (I_GET_AND_UPDATE_MAP, Michelson_v1_primitives.I_GET_AND_UPDATE); + (I_GT, Michelson_v1_primitives.I_GT); + (I_HASH_KEY, Michelson_v1_primitives.I_HASH_KEY); + (I_IF, Michelson_v1_primitives.I_IF); + (I_IF_CONS, Michelson_v1_primitives.I_IF_CONS); + (I_IF_LEFT, Michelson_v1_primitives.I_IF_LEFT); + (I_IF_NONE, Michelson_v1_primitives.I_IF_NONE); + (I_INT, Michelson_v1_primitives.I_INT); + (I_LAMBDA, Michelson_v1_primitives.I_LAMBDA); + (I_LE, Michelson_v1_primitives.I_LE); + (I_LEFT, Michelson_v1_primitives.I_LEFT); + (I_LEVEL, Michelson_v1_primitives.I_LEVEL); + (I_LOOP, Michelson_v1_primitives.I_LOOP); + (I_LSL, Michelson_v1_primitives.I_LSL); + (I_LSR, Michelson_v1_primitives.I_LSR); + (I_LT, Michelson_v1_primitives.I_LT); + (I_MAP_MAP, Michelson_v1_primitives.I_MAP); + (I_MAP_LIST, Michelson_v1_primitives.I_MAP); + (I_MEM_SET, Michelson_v1_primitives.I_MEM); + (I_MEM_MAP, Michelson_v1_primitives.I_MEM); + (I_MUL, Michelson_v1_primitives.I_MUL); + (I_NEG, Michelson_v1_primitives.I_NEG); + (I_NEQ, Michelson_v1_primitives.I_NEQ); + (I_NIL, Michelson_v1_primitives.I_NIL); + (I_NONE, Michelson_v1_primitives.I_NONE); + (I_NOT, Michelson_v1_primitives.I_NOT); + (I_NOW, Michelson_v1_primitives.I_NOW); + (I_OR, Michelson_v1_primitives.I_OR); + (I_PAIR, Michelson_v1_primitives.I_PAIR); + (I_UNPAIR, Michelson_v1_primitives.I_UNPAIR); + (I_PUSH, Michelson_v1_primitives.I_PUSH); + (I_RIGHT, Michelson_v1_primitives.I_RIGHT); + (I_SIZE_SET, Michelson_v1_primitives.I_SIZE); + (I_SIZE_MAP, Michelson_v1_primitives.I_SIZE); + (I_SIZE_LIST, Michelson_v1_primitives.I_SIZE); + (I_SIZE_STRING, Michelson_v1_primitives.I_SIZE); + (I_SIZE_BYTES, Michelson_v1_primitives.I_SIZE); + (I_SOME, Michelson_v1_primitives.I_SOME); + (I_SOURCE, Michelson_v1_primitives.I_SOURCE); + (I_SENDER, Michelson_v1_primitives.I_SENDER); + (I_SELF, Michelson_v1_primitives.I_SELF); + (I_SELF_ADDRESS, Michelson_v1_primitives.I_SELF_ADDRESS); + (I_SLICE, Michelson_v1_primitives.I_SLICE); + (I_STEPS_TO_QUOTA, Michelson_v1_primitives.I_STEPS_TO_QUOTA); + (I_SUB, Michelson_v1_primitives.I_SUB); + (I_SWAP, Michelson_v1_primitives.I_SWAP); + (I_TRANSFER_TOKENS, Michelson_v1_primitives.I_TRANSFER_TOKENS); + (I_SET_DELEGATE, Michelson_v1_primitives.I_SET_DELEGATE); + (I_UNIT, Michelson_v1_primitives.I_UNIT); + (I_UPDATE_SET, Michelson_v1_primitives.I_UPDATE); + (I_UPDATE_MAP, Michelson_v1_primitives.I_UPDATE); + (I_XOR, Michelson_v1_primitives.I_XOR); + (I_ITER_MAP, Michelson_v1_primitives.I_ITER); + (I_ITER_LIST, Michelson_v1_primitives.I_ITER); + (I_ITER_SET, Michelson_v1_primitives.I_ITER); + (I_LOOP_LEFT, Michelson_v1_primitives.I_LOOP_LEFT); + (I_ADDRESS, Michelson_v1_primitives.I_ADDRESS); + (I_CONTRACT, Michelson_v1_primitives.I_CONTRACT); + (I_ISNAT, Michelson_v1_primitives.I_ISNAT); + (I_CAST, Michelson_v1_primitives.I_CAST); + (I_RENAME, Michelson_v1_primitives.I_RENAME); + (I_SAPLING_EMPTY_STATE, Michelson_v1_primitives.I_SAPLING_EMPTY_STATE); + (I_SAPLING_VERIFY_UPDATE, Michelson_v1_primitives.I_SAPLING_VERIFY_UPDATE); + (I_DIG, Michelson_v1_primitives.I_DIG); + (I_DUG, Michelson_v1_primitives.I_DUG); + (I_NEVER, Michelson_v1_primitives.I_NEVER); + (I_VOTING_POWER, Michelson_v1_primitives.I_VOTING_POWER); + (I_TOTAL_VOTING_POWER, Michelson_v1_primitives.I_TOTAL_VOTING_POWER); + (I_KECCAK, Michelson_v1_primitives.I_KECCAK); + (I_SHA3, Michelson_v1_primitives.I_SHA3); + (I_PAIRING_CHECK, Michelson_v1_primitives.I_PAIRING_CHECK); + (I_TICKET, Michelson_v1_primitives.I_TICKET); + (I_READ_TICKET, Michelson_v1_primitives.I_READ_TICKET); + (I_SPLIT_TICKET, Michelson_v1_primitives.I_SPLIT_TICKET); + (I_JOIN_TICKETS, Michelson_v1_primitives.I_JOIN_TICKETS); + (T_bool, Michelson_v1_primitives.T_bool); + (T_contract, Michelson_v1_primitives.T_contract); + (T_int, Michelson_v1_primitives.T_int); + (T_key, Michelson_v1_primitives.T_key); + (T_key_hash, Michelson_v1_primitives.T_key_hash); + (T_lambda, Michelson_v1_primitives.T_lambda); + (T_list, Michelson_v1_primitives.T_list); + (T_map, Michelson_v1_primitives.T_map); + (T_big_map, Michelson_v1_primitives.T_big_map); + (T_nat, Michelson_v1_primitives.T_nat); + (T_option, Michelson_v1_primitives.T_option); + (T_or, Michelson_v1_primitives.T_or); + (T_pair, Michelson_v1_primitives.T_pair); + (T_set, Michelson_v1_primitives.T_set); + (T_signature, Michelson_v1_primitives.T_signature); + (T_string, Michelson_v1_primitives.T_string); + (T_bytes, Michelson_v1_primitives.T_bytes); + (T_mutez, Michelson_v1_primitives.T_mutez); + (T_timestamp, Michelson_v1_primitives.T_timestamp); + (T_unit, Michelson_v1_primitives.T_unit); + (T_operation, Michelson_v1_primitives.T_operation); + (T_address, Michelson_v1_primitives.T_address); + ( T_sapling_transaction_deprecated, + Michelson_v1_primitives.T_sapling_transaction_deprecated ); + (T_sapling_state, Michelson_v1_primitives.T_sapling_state); + (T_chain_id, Michelson_v1_primitives.T_chain_id); + (T_never, Michelson_v1_primitives.T_never); + (T_bls12_381_g1, Michelson_v1_primitives.T_bls12_381_g1); + (T_bls12_381_g2, Michelson_v1_primitives.T_bls12_381_g2); + (T_bls12_381_fr, Michelson_v1_primitives.T_bls12_381_fr); + (T_ticket, Michelson_v1_primitives.T_ticket); + ] + +let relation_table = + let table = Hashtbl.create 269 in + List.iter + (fun (mikhailsky, michelson) -> Hashtbl.add table mikhailsky michelson) + relation ; + table + +exception Primitive_cannot_be_cast_back_to_Michelson of prim + +let to_michelson prim = + match Hashtbl.find relation_table prim with + | exception Not_found -> + raise (Primitive_cannot_be_cast_back_to_Michelson prim) + | res -> res + +let string_of_prim prim = + match prim with + | K_parameter -> "K_parameter" + | K_storage -> "K_storage" + | K_code -> "K_code" + | D_False -> "D_False" + | D_Elt -> "D_Elt" + | D_Left -> "D_Left" + | D_None -> "D_None" + | D_Pair -> "D_Pair" + | D_Right -> "D_Right" + | D_Some -> "D_Some" + | D_True -> "D_True" + | D_Unit -> "D_Unit" + | I_PACK -> "I_PACK" + | I_UNPACK -> "I_UNPACK" + | I_BLAKE2B -> "I_BLAKE2B" + | I_SHA256 -> "I_SHA256" + | I_SHA512 -> "I_SHA512" + | I_ABS -> "I_ABS" + | I_ADD -> "I_ADD" + | I_AMOUNT -> "I_AMOUNT" + | I_AND -> "I_AND" + | I_BALANCE -> "I_BALANCE" + | I_CAR -> "I_CAR" + | I_CDR -> "I_CDR" + | I_CHAIN_ID -> "I_CHAIN_ID" + | I_CHECK_SIGNATURE -> "I_CHECK_SIGNATURE" + | I_COMPARE -> "I_COMPARE" + | I_CONCAT -> "I_CONCAT" + | I_CONS -> "I_CONS" + | I_CREATE_ACCOUNT -> "I_CREATE_ACCOUNT" + | I_CREATE_CONTRACT -> "I_CREATE_CONTRACT" + | I_IMPLICIT_ACCOUNT -> "I_IMPLICIT_ACCOUNT" + | I_DIP -> "I_DIP" + | I_DROP -> "I_DROP" + | I_DUP -> "I_DUP" + | I_EDIV -> "I_EDIV" + | I_EMPTY_BIG_MAP -> "I_EMPTY_BIG_MAP" + | I_EMPTY_MAP -> "I_EMPTY_MAP" + | I_EMPTY_SET -> "I_EMPTY_SET" + | I_EQ -> "I_EQ" + | I_EXEC -> "I_EXEC" + | I_APPLY -> "I_APPLY" + | I_FAILWITH -> "I_FAILWITH" + | I_GE -> "I_GE" + | I_GET_MAP -> "I_GET_MAP" + | I_GET_AND_UPDATE_MAP -> "I_GET_AND_UPDATE_MAP" + | I_GT -> "I_GT" + | I_HASH_KEY -> "I_HASH_KEY" + | I_IF -> "I_IF" + | I_IF_CONS -> "I_IF_CONS" + | I_IF_LEFT -> "I_IF_LEFT" + | I_IF_NONE -> "I_IF_NONE" + | I_INT -> "I_INT" + | I_LAMBDA -> "I_LAMBDA" + | I_LE -> "I_LE" + | I_LEFT -> "I_LEFT" + | I_LOOP -> "I_LOOP" + | I_LSL -> "I_LSL" + | I_LSR -> "I_LSR" + | I_LT -> "I_LT" + | I_MAP_MAP -> "I_MAP_MAP" + | I_MAP_LIST -> "I_MAP_LIST" + | I_MEM_SET -> "I_MEM_SET" + | I_MEM_MAP -> "I_MEM_MAP" + | I_MUL -> "I_MUL" + | I_NEG -> "I_NEG" + | I_NEQ -> "I_NEQ" + | I_NIL -> "I_NIL" + | I_NONE -> "I_NONE" + | I_NOT -> "I_NOT" + | I_NOW -> "I_NOW" + | I_OR -> "I_OR" + | I_PAIR -> "I_PAIR" + | I_UNPAIR -> "I_UNPAIR" + | I_PUSH -> "I_PUSH" + | I_RIGHT -> "I_RIGHT" + | I_SIZE_SET -> "I_SIZE_SET" + | I_SIZE_MAP -> "I_SIZE_MAP" + | I_SIZE_LIST -> "I_SIZE_LIST" + | I_SIZE_STRING -> "I_SIZE_STRING" + | I_SIZE_BYTES -> "I_SIZE_BYTES" + | I_SOME -> "I_SOME" + | I_SOURCE -> "I_SOURCE" + | I_SENDER -> "I_SENDER" + | I_SELF -> "I_SELF" + | I_SLICE -> "I_SLICE" + | I_STEPS_TO_QUOTA -> "I_STEPS_TO_QUOTA" + | I_SUB -> "I_SUB" + | I_SWAP -> "I_SWAP" + | I_TRANSFER_TOKENS -> "I_TRANSFER_TOKENS" + | I_SET_DELEGATE -> "I_SET_DELEGATE" + | I_UNIT -> "I_UNIT" + | I_UPDATE_SET -> "I_UPDATE_SET" + | I_UPDATE_MAP -> "I_UPDATE_MAP" + | I_XOR -> "I_XOR" + | I_ITER_MAP -> "I_ITER_MAP" + | I_ITER_LIST -> "I_ITER_LIST" + | I_ITER_SET -> "I_ITER_SET" + | I_LOOP_LEFT -> "I_LOOP_LEFT" + | I_ADDRESS -> "I_ADDRESS" + | I_CONTRACT -> "I_CONTRACT" + | I_ISNAT -> "I_ISNAT" + | I_CAST -> "I_CAST" + | I_RENAME -> "I_RENAME" + | I_DIG -> "I_DIG" + | I_DUG -> "I_DUG" + | I_LEVEL -> "I_LEVEL" + | I_SELF_ADDRESS -> "I_SELF_ADDRESS" + | I_NEVER -> "I_NEVER" + | I_SAPLING_EMPTY_STATE -> "I_SAPLING_EMPTY_STATE" + | I_SAPLING_VERIFY_UPDATE -> "I_SAPLING_VERIFY_UPDATE" + | I_VOTING_POWER -> "I_VOTING_POWER" + | I_TOTAL_VOTING_POWER -> "I_TOTAL_VOTING_POWER" + | I_KECCAK -> "I_KECCAK" + | I_SHA3 -> "I_SHA3" + | I_PAIRING_CHECK -> "I_PAIRING_CHECK" + | I_TICKET -> "I_TICKET" + | I_READ_TICKET -> "I_READ_TICKET" + | I_SPLIT_TICKET -> "I_SPLIT_TICKET" + | I_JOIN_TICKETS -> "I_JOIN_TICKETS" + | T_bool -> "T_bool" + | T_contract -> "T_contract" + | T_int -> "T_int" + | T_key -> "T_key" + | T_key_hash -> "T_key_hash" + | T_lambda -> "T_lambda" + | T_list -> "T_list" + | T_map -> "T_map" + | T_big_map -> "T_big_map" + | T_nat -> "T_nat" + | T_option -> "T_option" + | T_or -> "T_or" + | T_pair -> "T_pair" + | T_set -> "T_set" + | T_signature -> "T_signature" + | T_string -> "T_string" + | T_bytes -> "T_bytes" + | T_mutez -> "T_mutez" + | T_timestamp -> "T_timestamp" + | T_unit -> "T_unit" + | T_operation -> "T_operation" + | T_address -> "T_address" + | T_chain_id -> "T_chain_id" + | T_never -> "T_never" + | T_sapling_state -> "T_sapling_state" + | T_sapling_transaction_deprecated -> "T_sapling_transaction_deprecated" + | T_bls12_381_g1 -> "T_bls12_381_g1" + | T_bls12_381_g2 -> "T_bls12_381_g2" + | T_bls12_381_fr -> "T_bls12_381_fr" + | T_ticket -> "T_ticket" + | I_Hole -> "I_Hole" + | D_Hole -> "D_Hole" + | A_Int -> "A_Int" + | A_Nat -> "A_Nat" + | A_Timestamp -> "A_Timestamp" + | A_Mutez -> "A_Mutez" + | A_Key_hash -> "A_Key_hash" + | A_Key -> "A_Key" + | A_List -> "A_List" + | A_Set -> "A_Set" + | A_Map -> "A_Map" + | A_Lambda -> "A_Lambda" + +let pp fmtr prim = Format.fprintf fmtr "%s" (string_of_prim prim) + +type kind = Data_kind | Instr_kind | Type_kind | Keyword_kind | Annot_kind + +let kind (x : prim) = + match x with + | K_parameter | K_storage | K_code -> Keyword_kind + | D_Hole | D_False | D_Elt | D_Left | D_None | D_Pair | D_Right | D_Some + | D_True | D_Unit -> + Data_kind + | I_PACK | I_UNPACK | I_BLAKE2B | I_SHA256 | I_SHA512 | I_ABS | I_ADD + | I_AMOUNT | I_AND | I_BALANCE | I_CAR | I_CDR | I_CHAIN_ID + | I_CHECK_SIGNATURE | I_COMPARE | I_CONCAT | I_CONS | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT | I_IMPLICIT_ACCOUNT | I_DIP | I_DROP | I_DUP | I_EDIV + | I_EMPTY_BIG_MAP | I_EMPTY_MAP | I_EMPTY_SET | I_EQ | I_EXEC | I_APPLY + | I_FAILWITH | I_GE | I_GET_MAP | I_GET_AND_UPDATE_MAP | I_GT | I_HASH_KEY + | I_IF | I_IF_CONS | I_IF_LEFT | I_IF_NONE | I_INT | I_LAMBDA | I_LE | I_LEFT + | I_LOOP | I_LSL | I_LSR | I_LT | I_MAP_MAP | I_MAP_LIST | I_MEM_SET + | I_MEM_MAP | I_MUL | I_NEG | I_NEQ | I_NIL | I_NONE | I_NOT | I_NOW | I_OR + | I_PAIR | I_UNPAIR | I_PUSH | I_RIGHT | I_SIZE_SET | I_SIZE_MAP | I_SIZE_LIST + | I_SIZE_STRING | I_SIZE_BYTES | I_SOME | I_SOURCE | I_SENDER | I_SELF + | I_SLICE | I_STEPS_TO_QUOTA | I_SUB | I_SWAP | I_TRANSFER_TOKENS + | I_SET_DELEGATE | I_UNIT | I_UPDATE_SET | I_UPDATE_MAP | I_XOR | I_ITER_MAP + | I_ITER_LIST | I_ITER_SET | I_LOOP_LEFT | I_ADDRESS | I_CONTRACT | I_ISNAT + | I_CAST | I_RENAME | I_DIG | I_DUG | I_LEVEL | I_SELF_ADDRESS | I_NEVER + | I_SAPLING_EMPTY_STATE | I_SAPLING_VERIFY_UPDATE | I_VOTING_POWER + | I_TOTAL_VOTING_POWER | I_KECCAK | I_SHA3 | I_PAIRING_CHECK | I_TICKET + | I_READ_TICKET | I_SPLIT_TICKET | I_JOIN_TICKETS | I_Hole -> + Instr_kind + | T_bool | T_contract | T_int | T_key | T_key_hash | T_lambda | T_list | T_map + | T_big_map | T_nat | T_option | T_or | T_pair | T_set | T_signature + | T_string | T_bytes | T_mutez | T_timestamp | T_unit | T_operation + | T_address | T_chain_id | T_never | T_sapling_state + | T_sapling_transaction_deprecated | T_bls12_381_g1 | T_bls12_381_g2 + | T_bls12_381_fr | T_ticket -> + Type_kind + (* Holes in programs and data. *) + (* Annotations. *) + | A_Int | A_Nat | A_Timestamp | A_Mutez | A_Key_hash | A_Key | A_List | A_Set + | A_Map | A_Lambda -> + Annot_kind diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/monads.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/monads.ml new file mode 100644 index 000000000000..47273406af50 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/monads.ml @@ -0,0 +1,83 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Widely used module types. *) + +module type S = sig + type 'a t + + val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t + + val return : 'a -> 'a t + + val run : 'a t -> 'a +end + +(* Signature of a state monad. *) +module type State_sig = sig + type state + + type key + + type value + + include S with type 'a t = state -> 'a * state + + val empty : unit -> state + + val set : key -> value -> unit t + + val get : key -> value option t + + val iter_list : ('a -> unit t) -> 'a list -> unit t +end + +module Make_state_monad (X : Stores.S) : + State_sig + with type state = X.state + and type key = X.key + and type value = X.value + and type 'a t = X.state -> 'a * X.state = struct + include X + + type 'a t = state -> 'a * state + + let ( >>= ) m f s = + let x, s = m s in + f x s + + let return x s = (x, s) + + let run m = fst (m (empty ())) + + let set k v s = ((), set k v s) + + let get k s = (get k s, s) + + let rec iter_list (f : 'a -> unit t) (l : 'a list) = + match l with + | [] -> return () + | elt :: tl -> f elt >>= fun () -> iter_list f tl +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/stores.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/stores.ml new file mode 100644 index 000000000000..dff87824d1b4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/stores.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Various implementations of Monads.Store_sig *) + +(* Signature of a persistent store. *) +module type S = sig + type state + + type key + + type value + + val empty : unit -> state + + val set : key -> value -> state -> state + + val get : key -> state -> value option + + val map : (value -> value) -> state -> state + + val to_string : state -> string +end + +module type Map_store_param_sig = sig + type key + + type value + + val key_to_string : key -> string + + val value_to_string : value -> string +end + +(* An implemention of [S] using maps. *) +module Map (M : Map.S) (V : Map_store_param_sig with type key = M.key) : + S with type state = V.value M.t and type key = M.key and type value = V.value = +struct + type state = V.value M.t + + type key = M.key + + type value = V.value + + let empty () = M.empty + + let set = M.add + + let get = M.find_opt + + let map = M.map + + let to_string s = + M.fold + (fun key node acc -> + Printf.sprintf + "%s\n%s |-> %s" + acc + (V.key_to_string key) + (V.value_to_string node)) + s + "" +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune new file mode 100644 index 000000000000..de2cd72795d6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune @@ -0,0 +1,26 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executables + (names test_uf test_inference) + (libraries + tezos-micheline + tezos-micheline-rewriting + tezos-benchmark-type-inference-alpha + tezos-protocol-alpha + tezos-error-monad + tezos-client-alpha) + (flags + (:standard) + -open Tezos_micheline + -open Tezos_benchmark_type_inference_alpha)) + +(rule + (alias runtest) + (package tezos-benchmark-type-inference-alpha) + (action (run %{dep:./test_uf.exe}))) + +(rule + (alias runtest) + (package tezos-benchmark-type-inference-alpha) + (action (run %{dep:./test_inference.exe}))) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml new file mode 100644 index 000000000000..4b702dd05667 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_inference.ml @@ -0,0 +1,615 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* open Tezos_rewriting *) +open Mikhailsky + +let unopt x = match x with Some x -> x | None -> assert false + +let time f = + let now = Unix.gettimeofday () in + let res = f () in + let later = Unix.gettimeofday () in + (later -. now, res) + +let add_ii = Instructions.(add Mikhailsky.int_ty Mikhailsky.int_ty) + +let add_in = Instructions.(add Mikhailsky.int_ty Mikhailsky.nat_ty) + +let mul_ii = Instructions.(mul Mikhailsky.int_ty Mikhailsky.int_ty) + +let push_int = Instructions.push int_ty (Data.big_integer (Z.of_int 100)) + +let push_nat = Instructions.push nat_ty (Data.big_natural (Z.of_int 100)) + +module Test1 = struct + open Data + open Instructions + + let program = seq [add_ii; push bool_ty false_; dip instr_hole; dip swap] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test2 = struct + open Instructions + + let program = seq [loop swap; and_] + + let () = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING FAILURE\n" ; + Format.printf "Program: %a\n" Mikhailsky.pp program ; + let exception Test_failed in + try + ignore + ( time @@ fun () -> + ignore @@ Inference.infer program ; + raise Test_failed ) + with + | Inference.Ill_typed_script error -> + Format.printf "Error:\n" ; + Format.printf "%a\n" Inference.pp_inference_error error + | Test_failed -> Format.printf "No type error: Test failed!" + + let _ = print_newline () +end + +module Test3 = struct + open Instructions + + let program = + seq + [ + dip (seq [swap; dup]); + swap; + dip cdr; + loop (seq [dip instr_hole; cdr; loop instr_hole]); + car; + car; + push int_ty (Data.integer 10); + compare; + ] + + let _ = + Format.printf "Testing rewriting and type inference\n" ; + Format.printf "Source program: %a\n" Mikhailsky.pp program + + open Tezos_micheline_rewriting + + module Lang = + Micheline_with_hash_consing.Make + (Mikhailsky.Mikhailsky_signature) + (struct + let initial_size = None + end) + + module Path = Mikhailsky.Path + module Patt = Pattern.Make (Mikhailsky.Mikhailsky_signature) (Lang) (Path) + module Rewriter = + Rewrite.Make (Mikhailsky.Mikhailsky_signature) (Lang) (Path) (Patt) + + let timing, ((bef, aft), state) = + try time @@ fun () -> Inference.infer_with_state program + with Inference.Ill_typed_script error -> + let s = Mikhailsky.to_string program in + Format.printf + "Ill-typed script:%a\n%s\n" + Inference.pp_inference_error + error + s ; + Format.printf "Test failed\n" ; + exit 1 + + let () = + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft + + let () = + try + ignore + ((let open Inference in + let open M in + M.uf_lift Uf.UF.show >>= fun uf_state -> + Inference.M.repr_lift (fun s -> (Inference.Repr_store.to_string s, s)) + >>= fun repr_state -> + Printf.printf "uf_state:\n%s\n" uf_state ; + Printf.printf "repr_state:\n%s\n" repr_state ; + let path = + Path.(at_index 2 (at_index 0 (at_index 0 (at_index 3 root)))) + in + let subterm = Rewriter.get_subterm ~term:program ~path in + Format.printf + "subterm at path %s:\n%a\n" + (Path.to_string path) + Mikhailsky.pp + subterm ; + Inference.M.annot_instr_lift (Inference.Annot_instr_sm.get path) + >>= fun typ -> + (match typ with + | None -> assert false + | Some {bef; aft} -> + Inference.instantiate bef >>= fun bef -> + Inference.instantiate aft >>= fun aft -> + Format.printf "Type of subterm:\n" ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + return ()) + >>= fun () -> return ()) + state) + with Inference.Ill_typed_script error -> + let s = Mikhailsky.to_string program in + Format.printf + "Ill-typed script:\n%a\n%s\n" + Inference.pp_inference_error + error + s + + let _ = print_newline () +end + +module Test4 = struct + open Instructions + + let program = + seq + [ + empty_set; + push Type.(unopt (unparse_ty bool)) Data.true_; + push + Type.(unopt (unparse_ty (pair int int))) + Data.(pair (integer 0) (integer 0)); + update_set; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test5 = struct + open Instructions + + let unopt x = match x with Some x -> x | None -> assert false + + let program = + seq + [ + empty_map; + push Type.(unopt (unparse_ty (option (set int)))) Data.none; + push + Type.(unopt (unparse_ty (pair int int))) + Data.(pair (integer 0) (integer 0)); + update_map; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () + + let program = + seq + [ + push + Type.(unopt (unparse_ty (map (pair int int) (set int)))) + Data.( + map + [ + map_elt + (pair (integer 0) (integer 1)) + (set [integer 42; integer 44]); + map_elt + (pair (integer 1) (integer 2)) + (set [integer 42; integer 48]); + ]); + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test6 = struct + open Instructions + + (* We remove a chunk from a well-typed program to make it ill-typed, and + expect the type inference to fail *) + let program = + seq + [ + push int_ty (Data.integer 0); + push int_ty (Data.integer 100); + swap; + drop; + drop; + drop; + push unit_ty Data.unit; + push bool_ty Data.false_; + push unit_ty Data.unit; + push int_ty (Data.integer 4073851221413541140); + push string_ty (string "n"); + push string_ty (string "k"); + push int_ty (Data.integer 1391989767887046289); + (* push int_ty (integer 100); + * abs; + * drop; *) + dip (prim I_CONCAT [] []); + compare; + ] + + let () = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING FAILURE\n" ; + Format.printf "Program: %a\n" Mikhailsky.pp program ; + let exception Test_failed in + try + ignore (Inference.infer program) ; + raise Test_failed + with + | Inference.Ill_typed_script error -> + Format.printf "Got error, as expected:\n" ; + Format.printf "%a@." Inference.pp_inference_error error + | Test_failed -> + Format.printf "No type error: Test failed!" ; + exit 1 +end + +module Test7 = struct + open Instructions + + let program = + seq + [ + push int_ty (Data.integer 42); + left; + push string_ty (Data.string "forty-two"); + right; + pair; + left; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test8 = struct + open Instructions + + let program = + seq + [ + hole; + add_ii; + push int_ty (Data.big_integer (Z.of_int 100)); + abs; + right; + dup; + push int_ty (Data.big_integer (Z.of_int 100)); + dip (loop_left hole); + push_int; + hole; + mul_ii; + hole; + loop_left left; + sha512; + push_int; + dup; + add_ii; + right; + swap; + hole; + drop; + compare; + mul_ii; + push_int; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test9 = struct + open Instructions + + let program = seq [car; if_none hole hole] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test10 = struct + open Instructions + + let program = seq [hash_key] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test11 = struct + open Instructions + + let program = + seq [lambda [dup; car; dip cdr; add_in]; push_int; apply; push_nat; exec] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test12 = struct + open Instructions + + let program = seq [dup; dup; if_none hole (seq [drop]); dup; compare] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test13 = struct + open Instructions + + let program = + seq [push Type.(unparse_ty_exn (lambda int int)) (Data.lambda [])] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test14 = struct + open Instructions + + let program = seq [nil; push_int; cons] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test15 = struct + open Instructions + + let program = seq [empty_set; size_set; empty_map; size_map; nil; size_list] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test16 = struct + open Instructions + + let program = + seq + [ + empty_set; + push bool_ty Data.true_; + push_int; + update_set; + iter_set [dup; add_ii; add_ii]; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test17 = struct + open Instructions + + let program = + seq + [ + empty_map; + push (option_ty (list_ty bool_ty)) Data.(some (list [false_; true_])); + push_int; + update_map; + map_map + [ + cdr; + map_list + [ + if_ + (seq [push bool_ty Data.false_]) + (seq [push bool_ty Data.true_]); + ]; + ]; + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end + +module Test18 = struct + open Instructions + + let program = + seq + [ + empty_map; + push (option_ty (list_ty bool_ty)) Data.(some (list [false_; true_])); + push_int; + update_map; + map_map + [ + cdr; + map_list + [ + if_ + (seq [push bool_ty Data.false_]) + (seq [push bool_ty Data.true_]); + ]; + ]; + dup; + dip push_int; + push_int; + mem_map; + if_ + (seq [get_map]) + (seq [drop; drop; push (option_ty (list_ty bool_ty)) Data.none]); + ] + + let timing, (bef, aft) = time @@ fun () -> Inference.infer program + + let _ = + Format.printf "Testing type inference\n" ; + Format.printf "EXPECTING SUCCESS\n" ; + Format.printf "Program\n" ; + Format.printf "%a\n" Mikhailsky.pp program ; + Format.printf "In %f seconds:\n" timing ; + Format.printf "bef: %a@." Type.Stack.pp bef ; + Format.printf "aft: %a@." Type.Stack.pp aft ; + print_newline () +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_uf.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_uf.ml new file mode 100644 index 000000000000..84fdd856e9ba --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/test_uf.ml @@ -0,0 +1,63 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let _ = + print_newline () ; + Printf.printf "Testing union-find algorithm\n" + +module UF = Uf.UF + +let test = + let open UF.M in + UF.add 0 >>= fun () -> + UF.add 1 >>= fun () -> + UF.add 2 >>= fun () -> + UF.add 3 >>= fun () -> + UF.add 4 >>= fun () -> + UF.find 0 >>= fun v0_repr -> + UF.find 1 >>= fun v1_repr -> + assert (v0_repr <> v1_repr) ; + UF.union 0 1 >>= fun _ -> + UF.find 0 >>= fun v0_repr -> + UF.find 1 >>= fun v1_repr -> + UF.find 2 >>= fun v2_repr -> + assert (v0_repr = v1_repr) ; + assert (v0_repr <> v2_repr) ; + UF.union 2 3 >>= fun _ -> + UF.union 0 3 >>= fun _ -> + UF.find 1 >>= fun v1_repr -> + UF.find 2 >>= fun v2_repr -> + UF.find 3 >>= fun v3_repr -> + UF.find 4 >>= fun v4_repr -> + assert (v1_repr = v2_repr) ; + UF.union 4 4 >>= fun _ -> + assert (v3_repr <> v4_repr) ; + UF.show >>= fun s -> + Printf.printf "UF state:%s\n" s ; + return () + +let () = UF.M.run test + +let _ = Printf.printf "Success.\n" diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.ml new file mode 100644 index 000000000000..5f66f6ff5e7d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.ml @@ -0,0 +1,200 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Michelson types. *) + +module Base = struct + type comparable_tag = Comparable | Maybe_not_comparable + + type t = t_node Hashcons.hash_consed + + and t_node = + | Unit_t + | Var_t of int + | Int_t + | Nat_t + | Bool_t + | String_t + | Bytes_t + | Key_hash_t + | Timestamp_t + | Mutez_t + | Key_t + | Option_t of t + | Pair_t of t * t + | Union_t of t * t + | List_t of t + | Set_t of t + | Map_t of t * t + | Lambda_t of t * t + + module Hashed = struct + type t = t_node + + let equal (t1 : t) (t2 : t) = + match (t1, t2) with + | Var_t v1, Var_t v2 -> v1 = v2 + | Unit_t, Unit_t + | Int_t, Int_t + | Nat_t, Nat_t + | Bool_t, Bool_t + | String_t, String_t + | Bytes_t, Bytes_t + | Key_hash_t, Key_hash_t + | Timestamp_t, Timestamp_t + | Mutez_t, Mutez_t + | Key_t, Key_t -> + true + | Option_t ty1, Option_t ty2 -> ty1.tag = ty2.tag + | Pair_t (l1, r1), Pair_t (l2, r2) -> l1.tag = l2.tag && r1.tag = r2.tag + | Union_t (l1, r1), Union_t (l2, r2) -> l1.tag = l2.tag && r1.tag = r2.tag + | List_t ty1, List_t ty2 -> ty1.tag = ty2.tag + | Set_t ty1, Set_t ty2 -> ty1.tag = ty2.tag + | Map_t (kty1, vty1), Map_t (kty2, vty2) -> + kty1.tag = kty2.tag && vty1.tag = vty2.tag + | Lambda_t (dom1, range1), Lambda_t (dom2, range2) -> + dom1.tag = dom2.tag && range1.tag = range2.tag + | _ -> false + + let hash (t : t) = Hashtbl.hash t + end + + module Table = Hashcons.Make (Hashed) + + let table = Table.create 101 + + let rec pp fmtr x = + match x.Hashcons.node with + | Unit_t -> Format.pp_print_string fmtr "unit" + | Var_t v -> Format.fprintf fmtr "%d" v + | Int_t -> Format.pp_print_string fmtr "int" + | Nat_t -> Format.pp_print_string fmtr "nat" + | Bool_t -> Format.pp_print_string fmtr "bool" + | String_t -> Format.pp_print_string fmtr "string" + | Bytes_t -> Format.pp_print_string fmtr "bytes" + | Key_hash_t -> Format.pp_print_string fmtr "key_hash" + | Timestamp_t -> Format.pp_print_string fmtr "timestamp" + | Mutez_t -> Format.pp_print_string fmtr "mutez" + | Key_t -> Format.pp_print_string fmtr "key" + | Option_t ty -> Format.fprintf fmtr "(option %a)" pp ty + | List_t ty -> Format.fprintf fmtr "(list %a)" pp ty + | Pair_t (lty, rty) -> Format.fprintf fmtr "(pair %a %a)" pp lty pp rty + | Union_t (lty, rty) -> Format.fprintf fmtr "(union %a %a)" pp lty pp rty + | Set_t ty -> Format.fprintf fmtr "(set %a)" pp ty + | Map_t (kty, vty) -> Format.fprintf fmtr "(map %a %a)" pp kty pp vty + | Lambda_t (dom, range) -> + Format.fprintf fmtr "(lambda %a %a)" pp dom pp range + + let rec vars x acc = + match x.Hashcons.node with + | Unit_t | Int_t | Nat_t | Bool_t | String_t | Bytes_t | Key_hash_t + | Timestamp_t | Mutez_t | Key_t -> + acc + | Var_t v -> v :: acc + | Option_t ty | List_t ty | Set_t ty -> vars ty acc + | Pair_t (lty, rty) | Union_t (lty, rty) -> vars lty (vars rty acc) + | Map_t (kty, vty) -> vars kty (vars vty acc) + | Lambda_t (dom, range) -> vars dom (vars range acc) + + let vars x = vars x [] +end + +module Stack = struct + type t = t_node Hashcons.hash_consed + + and t_node = Empty_t | Stack_var_t of int | Item_t of Base.t * t + + module Hashed = struct + type t = t_node + + let equal (t1 : t) (t2 : t) = + match (t1, t2) with + | Empty_t, Empty_t -> true + | Stack_var_t v1, Stack_var_t v2 -> v1 = v2 + | Item_t (h1, tl1), Item_t (h2, tl2) -> h1 == h2 && tl1 == tl2 + | _ -> false + + let hash (t : t) = Hashtbl.hash t + end + + module Table = Hashcons.Make (Hashed) + + let table = Table.create 101 + + let rec pp fmtr x = + match x.Hashcons.node with + | Empty_t -> Format.pp_print_string fmtr "[]" + | Stack_var_t v -> Format.fprintf fmtr "<%d>" v + | Item_t (head, tail) -> Format.fprintf fmtr "%a :: %a" Base.pp head pp tail + + let rec vars x = + match x.Hashcons.node with + | Empty_t -> None + | Stack_var_t v -> Some v + | Item_t (_head, tail) -> vars tail +end + +let unit = Base.Table.hashcons Base.table Unit_t + +let var x = Base.Table.hashcons Base.table (Var_t x) + +let int = Base.Table.hashcons Base.table Int_t + +let nat = Base.Table.hashcons Base.table Nat_t + +let bool = Base.Table.hashcons Base.table Bool_t + +let string = Base.Table.hashcons Base.table String_t + +let bytes = Base.Table.hashcons Base.table Bytes_t + +let key_hash = Base.Table.hashcons Base.table Key_hash_t + +let timestamp = Base.Table.hashcons Base.table Timestamp_t + +let mutez = Base.Table.hashcons Base.table Mutez_t + +let key = Base.Table.hashcons Base.table Key_t + +let option ty = Base.Table.hashcons Base.table (Option_t ty) + +let pair lty rty = Base.Table.hashcons Base.table (Pair_t (lty, rty)) + +let union lty rty = Base.Table.hashcons Base.table (Union_t (lty, rty)) + +let list ty = Base.Table.hashcons Base.table (List_t ty) + +let set ty = Base.Table.hashcons Base.table (Set_t ty) + +let map kty vty = Base.Table.hashcons Base.table (Map_t (kty, vty)) + +let lambda dom range = Base.Table.hashcons Base.table (Lambda_t (dom, range)) + +(* Stack smart constructors *) +let empty = Stack.Table.hashcons Stack.table Empty_t + +let stack_var x = Stack.Table.hashcons Stack.table (Stack_var_t x) + +let item head tail = Stack.Table.hashcons Stack.table (Item_t (head, tail)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.mli b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.mli new file mode 100644 index 000000000000..168ba97e4d21 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/type.mli @@ -0,0 +1,111 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Michelson types, hash-consed. *) + +(** Base types *) +module Base : sig + type comparable_tag = Comparable | Maybe_not_comparable + + type t = t_node Hashcons.hash_consed + + and t_node = private + | Unit_t + | Var_t of int + | Int_t + | Nat_t + | Bool_t + | String_t + | Bytes_t + | Key_hash_t + | Timestamp_t + | Mutez_t + | Key_t + | Option_t of t + | Pair_t of t * t + | Union_t of t * t + | List_t of t + | Set_t of t + | Map_t of t * t + | Lambda_t of t * t + + val pp : Format.formatter -> t -> unit + + val vars : t -> int list +end + +(** Stack types *) +module Stack : sig + type t = t_node Hashcons.hash_consed + + and t_node = private Empty_t | Stack_var_t of int | Item_t of Base.t * t + + val pp : Format.formatter -> t -> unit + + val vars : t -> int option +end + +(** Smart constructors *) +val unit : Base.t + +val var : int -> Base.t + +val int : Base.t + +val nat : Base.t + +val bool : Base.t + +val string : Base.t + +val bytes : Base.t + +val key_hash : Base.t + +val timestamp : Base.t + +val mutez : Base.t + +val key : Base.t + +val option : Base.t -> Base.t + +val pair : Base.t -> Base.t -> Base.t + +val union : Base.t -> Base.t -> Base.t + +val list : Base.t -> Base.t + +val set : Base.t -> Base.t + +val map : Base.t -> Base.t -> Base.t + +val lambda : Base.t -> Base.t -> Base.t + +val empty : Stack.t + +val stack_var : int -> Stack.t + +val item : Base.t -> Stack.t -> Stack.t diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/uf.ml b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/uf.ml new file mode 100644 index 000000000000..f14a166939a7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/uf.ml @@ -0,0 +1,99 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* ------------------------------------------------------------------------- *) +(* Union find parameterized over a persistent store. *) + +module type S = sig + module M : Monads.State_sig + + type key = int + + val add : key -> unit M.t + + val find : key -> key M.t + + val union : key -> key -> key M.t + + val show : string M.t +end + +module UF : S = struct + type node = T of {rank : int} | Ptr of key + + and key = int + + module S = + Stores.Map + (Int_map) + (struct + type key = int + + type value = node + + let key_to_string = string_of_int + + let value_to_string (x : value) = + match x with + | T {rank} -> Printf.sprintf "[%d]" rank + | Ptr k -> Printf.sprintf "ptr(%d)" k + end) + + module M = Monads.Make_state_monad (S) + + let add (k : key) = + let open M in + set k (T {rank = 1}) + + let rec get_root (k : key) (acc : key list) = + let open M in + get k >>= function + | None -> + let msg = Printf.sprintf "UF.get_root: invalid key %d" k in + Stdlib.failwith msg + | Some (T {rank}) -> + let ptr_to_root = Ptr k in + iter_list (fun key -> set key ptr_to_root) acc >>= fun () -> + return (k, rank) + | Some (Ptr k') -> get_root k' (k :: acc) + + let find (k : key) = + let open M in + get_root k [] >>= fun (res, _) -> return res + + let union k1 k2 = + let open M in + get_root k1 [] >>= fun (k1, rank1) -> + get_root k2 [] >>= fun (k2, rank2) -> + if k1 = k2 then return k1 + else if rank1 < rank2 then set k1 (Ptr k2) >>= fun () -> return k2 + else if rank1 > rank2 then set k2 (Ptr k1) >>= fun () -> return k1 + else + let new_root = T {rank = rank1 + 1} in + set k2 (Ptr k1) >>= fun () -> + set k1 new_root >>= fun () -> return k1 + + let show s = (S.to_string s, s) +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.ml b/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.ml new file mode 100644 index 000000000000..1e4778f856f0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.ml @@ -0,0 +1,110 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Micheline sampling. *) + +type width_function = depth:int -> int Base_samplers.sampler + +(** [Base_samplers] specifies samplers for leaves, primitives and annotations. *) +module type Base_samplers = sig + (** The type of primitives. *) + type prim + + val sample_prim : prim Base_samplers.sampler + + val sample_annots : string list Base_samplers.sampler + + val sample_string : string Base_samplers.sampler + + val sample_bytes : Bytes.t Base_samplers.sampler + + val sample_z : Z.t Base_samplers.sampler + + val width_function : width_function +end + +module type S = sig + type prim + + val sample : (int, prim) Micheline.node Base_samplers.sampler +end + +type node_kind = Int_node | String_node | Bytes_node | Seq_node | Prim_node + +(* The distribution can be skewed towards non-leaf nodes by repeating their + relevant kind in the array below. *) +let all_kinds = [|Int_node; String_node; Bytes_node; Seq_node; Prim_node|] + +let sample_kind : node_kind Base_samplers.sampler = + fun rng_state -> + let i = Random.State.int rng_state (Array.length all_kinds) in + all_kinds.(i) + +let reasonable_width_function ~depth rng_state = + (* Entirely ad-hoc *) + Base_samplers.( + sample_in_interval + ~range:{min = 0; max = 20 / (Bits.numbits depth + 1)} + rng_state) + +module Make (P : Base_samplers) : S with type prim = P.prim = struct + type prim = P.prim + + let sample (w : width_function) rng_state = + let rec sample depth rng_state k = + match sample_kind rng_state with + | Int_node -> k (Micheline.Int (0, P.sample_z rng_state)) + | String_node -> k (Micheline.String (0, P.sample_string rng_state)) + | Bytes_node -> k (Micheline.Bytes (0, P.sample_bytes rng_state)) + | Seq_node -> + let width = w ~depth rng_state in + sample_list + depth + width + [] + (fun terms -> k (Micheline.Seq (0, terms))) + rng_state + | Prim_node -> + let prim = P.sample_prim rng_state in + let annots = P.sample_annots rng_state in + let width = w ~depth rng_state in + sample_list + depth + width + [] + (fun terms -> k (Micheline.Prim (0, prim, terms, annots))) + rng_state + and sample_list depth width acc k rng_state = + if width < 0 then invalid_arg "sample_list: negative width" + else if width = 0 then k (List.rev acc) + else + sample (depth + 1) rng_state (fun x -> + sample_list depth (width - 1) (x :: acc) k rng_state) + in + sample 0 rng_state (fun x -> x) + + let sample rng_state = sample P.width_function rng_state +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.mli b/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.mli new file mode 100644 index 000000000000..97e3d4ec1e12 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/micheline_sampler.mli @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Micheline sampling. *) + +(** A [width_function] specifies the distribution of node degree as a function + of [depth]. A [width_function] {e must} be supported by the nonnegative + integers. + + Note that picking a [width_function] which doesn't converge fast enough to + the singular distribution on 0 could yield very large terms. *) +type width_function = depth:int -> int Base_samplers.sampler + +(** [reasonable_width_function] is a width function which works well + empirically. *) +val reasonable_width_function : width_function + +(** [Base_samplers] specifies samplers for leaves, primitives and annotations. *) +module type Base_samplers = sig + (** The type of primitives. *) + type prim + + val sample_prim : prim Base_samplers.sampler + + val sample_annots : string list Base_samplers.sampler + + val sample_string : string Base_samplers.sampler + + val sample_bytes : Bytes.t Base_samplers.sampler + + val sample_z : Z.t Base_samplers.sampler + + val width_function : width_function +end + +(** Applying the [Make] functor below yields a module with the following + type. *) +module type S = sig + type prim + + (** [sample w] is a Micheline sampler for the prescribed primitive + type. The sampler uses the provided width function [w]. *) + val sample : (int, prim) Micheline.node Base_samplers.sampler +end + +(** [Make] instantiates a micheline sampler. *) +module Make (P : Base_samplers) : S with type prim = P.prim diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.ml b/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.ml new file mode 100644 index 000000000000..7dc0f4edd716 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.ml @@ -0,0 +1,336 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** MCMC-based Michelson data and code samplers. *) + +open Protocol +open Stats + +type michelson_code = { + term : Script_repr.expr; + bef : Script_repr.expr list; + aft : Script_repr.expr list; +} + +type michelson_data = {term : Script_repr.expr; typ : Script_repr.expr} + +type michelson_sample = Code of michelson_code | Data of michelson_data + +let michelson_sample_list_encoding = + let open Data_encoding in + let e = Script_repr.expr_encoding in + list + @@ union + [ + case + ~title:"Code" + (Tag 0) + (tup3 e (list e) (list e)) + (function + | Code {term; bef; aft} -> Some (term, bef, aft) | _ -> None) + (fun (term, bef, aft) -> Code {term; bef; aft}); + case + ~title:"Data" + (Tag 1) + (tup2 e e) + (function Data {term; typ} -> Some (term, typ) | _ -> None) + (fun (term, typ) -> Data {term; typ}); + ] + +let save ~filename ~terms = + let str = + match + Data_encoding.Binary.to_string michelson_sample_list_encoding terms + with + | Error err -> + Format.eprintf + "Michelson_mcmc_samplers.save: encoding failed (%a); exiting" + Data_encoding.Binary.pp_write_error + err ; + exit 1 + | Ok res -> res + in + try Lwt_main.run @@ Tezos_stdlib_unix.Lwt_utils_unix.create_file filename str + with exn -> + Format.eprintf + "Michelson_mcmc_samplers.save: create_file failed (%s); exiting" + (Printexc.to_string exn) ; + exit 1 + +let load ~filename = + let open TzPervasives in + let string = + try Lwt_main.run @@ Tezos_stdlib_unix.Lwt_utils_unix.read_file filename + with exn -> + Format.eprintf + "Michelson_mcmc_samplers.load: read_file failed (%s); exiting" + (Printexc.to_string exn) ; + exit 1 + in + let bytes = Bytes.of_string string in + match Data_encoding.Binary.of_bytes michelson_sample_list_encoding bytes with + | Ok result -> result + | Error err -> + Format.eprintf + "Michelson_mcmc_samplers.load: decoding failed (%a); exiting" + Data_encoding.Binary.pp_read_error + err ; + exit 1 + +(* Helpers *) + +let base_type_to_michelson_type (typ : Type.Base.t) = + let typ = Mikhailsky.map_var (fun _ -> Mikhailsky.unit_ty) typ in + Mikhailsky.to_michelson typ + +module type Sampler_parameters_sig = sig + val initial : State_space.t + + val energy : State_space.t -> float + + val rules : Rules.rule_set list + + val infer : Mikhailsky.node -> Inference.state + + val verbosity : [`Silent | `Progress | `Trace] +end + +(* The Markov chain in state [state] *) +type mc_state = { + state : State_space.t; + jump : State_space.t Fin.Float.prb Lazy.t; +} + +module State_hashtbl = Hashtbl.Make (State_space) + +(** Generic MCMC michelson sampler (can be used for code and data) *) +module Make_generic (P : Sampler_parameters_sig) = struct + let uniform (l : State_space.t list) : State_space.t Fin.Float.prb = + match l with + | [] -> + (* This can only happen is the MCMC was driven to a coffin state, + which means that it's not reversible (this is a bug) *) + assert false + | _ -> + let arr = Array.of_list l in + let emp = Emp.of_raw_data arr in + Fin.Float.counts_of_empirical (module State_hashtbl) emp + |> Fin.Float.normalize + + let unrecoverable_failure err current result = + Format.eprintf "Error when typechecking term:@." ; + Format.eprintf "%a@." Inference.pp_inference_error err ; + Format.eprintf "Original state: @[%a@]@." State_space.pp current ; + Format.eprintf "Erroneous term: %a@." Mikhailsky.pp result ; + Stdlib.failwith "in sampler.ml: unrecoverable failure." + + let of_state : State_space.t -> mc_state = + fun state -> + { + state; + jump = + Lazy.from_fun (fun () -> + let current = state in + let rewriting_options = Rules.rewriting current P.rules in + let term = current.term in + let rewritings = + List.fold_left + (fun rewritings (path, replacement) -> + let result = Kernel.Rewriter.subst ~term ~path ~replacement in + let typing = + Lazy.from_fun (fun () -> + try P.infer result + with Inference.Ill_typed_script err -> + unrecoverable_failure err current result) + in + {State_space.typing; term = result} :: rewritings) + [] + rewriting_options + in + uniform rewritings); + } + + module MH_params : Mh.MH_parameters with type t = mc_state = struct + type t = mc_state + + let pp fmtr {state; jump = _} = State_space.pp fmtr state + + let trace state = + match P.verbosity with + | `Silent | `Progress -> () + | `Trace -> + Format.eprintf "@." ; + Format.eprintf "%a" State_space.pp state ; + Format.eprintf "energy:@." ; + Format.eprintf "%f:@." (P.energy state) + + let proposal_log_density s1 s2 = + let jump = Lazy.force s1.jump in + let p = try Fin.Float.eval_prb jump s2.state with Not_found -> 0.0 in + Log_space.of_float p + + let proposal mcmc_state rng_state = + trace mcmc_state.state ; + let dist = Lazy.force mcmc_state.jump in + let next = Fin.Float.sample (Fin.Float.as_measure dist) rng_state in + of_state next + + let log_weight state = Log_space.unsafe_cast (-.P.energy state.state) + end + + module Sampler = Mh.Make (MH_params) + + let generator ~burn_in = + P.(Sampler.mcmc ~verbosity ~initial:(of_state initial) ~burn_in) +end + +module Make_code_sampler + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) (X : sig + val rng_state : Random.State.t + + val target_size : int + + val verbosity : [`Silent | `Progress | `Trace] + end) = +struct + module Autocomp = Autocomp.Make (Michelson_base) (Crypto_samplers) + + module MCMC = Make_generic (struct + let initial = + let term = Mikhailsky.Instructions.hole in + let typing = Lazy.from_val @@ snd (Inference.infer_with_state term) in + {State_space.term; typing} + + let energy state = + let stats = State_space.statistics state in + let size_deficit = + abs_float + (float_of_int X.target_size -. float_of_int stats.State_space.size) + in + let holes_proportion = float stats.holes /. float stats.size in + let holes_deficit = + (* we want at least 1% of holes, above is ok *) + if holes_proportion < 0.01 then + (0.01 -. holes_proportion) *. size_deficit + else 0.0 + in + size_deficit +. holes_deficit + + let rules = Rules.Instruction.rules + + let infer term = snd (Inference.infer_with_state term) + + let verbosity = X.verbosity + end) + + let to_michelson {state = ({typing; term} : State_space.t); jump = _} = + let typing = Lazy.force typing in + let node, (bef, aft), state = + Autocomp.complete_code typing term X.rng_state + in + let node = + Micheline.strip_locations @@ Mikhailsky_to_michelson.convert node state + in + { + term = node; + bef = Type_helpers.stack_type_to_michelson_type_list bef; + aft = Type_helpers.stack_type_to_michelson_type_list aft; + } + + let generator ~burn_in = + Gen.map (MCMC.generator ~burn_in) @@ fun after_burn_in -> + Gen.map after_burn_in to_michelson +end + +module Make_data_sampler + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) (X : sig + val rng_state : Random.State.t + + val target_size : int + + val verbosity : [`Silent | `Progress | `Trace] + end) = +struct + module Autocomp = Autocomp.Make (Michelson_base) (Crypto_samplers) + module Rewrite_rules = + Rules.Data_rewrite_leaves (Michelson_base) (Crypto_samplers) + + module MCMC = Make_generic (struct + let initial = + let term = Mikhailsky.Data.hole in + let typing = + Lazy.from_val @@ snd (Inference.infer_data_with_state term) + in + {State_space.term; typing} + + let energy state = + let stats = State_space.statistics state in + let size_deficit = + abs_float + (float_of_int X.target_size -. float_of_int stats.State_space.size) + in + let holes_proportion = + float_of_int stats.holes /. float_of_int stats.size + in + let holes_deficit = + (* we want at least 10% of holes, above is ok *) + if holes_proportion < 0.5 then (0.5 -. holes_proportion) *. size_deficit + else 0.0 + in + let depth_deficit = + abs_float + ((0.1 *. float_of_int X.target_size) -. float_of_int stats.depth) + in + size_deficit +. holes_deficit +. depth_deficit + + let rules = Rewrite_rules.rules X.rng_state + + let infer term = snd (Inference.infer_data_with_state term) + + let verbosity = X.verbosity + end) + + let to_michelson {state = ({typing; term} : State_space.t); jump = _} = + let typing = Lazy.force typing in + let node, _ = Autocomp.complete_data typing term X.rng_state in + let typ, state = + try Inference.infer_data_with_state node + with _ -> + Format.eprintf "Bug found!@." ; + Format.eprintf "Ill-typed autocompletion. Resulting term:@." ; + Format.eprintf "%a@." Mikhailsky.pp node ; + Stdlib.failwith "in generators.ml: unrecoverable failure" + in + let node = + Micheline.strip_locations @@ Mikhailsky_to_michelson.convert node state + in + {term = node; typ = base_type_to_michelson_type typ} + + let generator ~burn_in = + Gen.map (MCMC.generator ~burn_in) @@ fun after_burn_in -> + Gen.map after_burn_in to_michelson +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.mli b/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.mli new file mode 100644 index 000000000000..bd67d13e3c16 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_mcmc_samplers.mli @@ -0,0 +1,115 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** MCMC-based Michelson data and code samplers. *) + +open Protocol + +(** MCMC samplers can either produce data or code. Note that the samplers + natively produce data and code in Micheline (ie untyped) form. *) + +type michelson_code = { + term : Script_repr.expr; + (** [term] is a typeable Michelson program in Micheline form. *) + bef : Script_repr.expr list; + (** [bef] is an input stack type for which [term] is a well-typed script. *) + aft : Script_repr.expr list; + (** [aft] is the stack type corresponding to the execution of [term] + on a stack of type [bef]. *) +} + +type michelson_data = { + term : Script_repr.expr; + (** [term] is a typeable Michelson data in Micheline form. *) + typ : Script_repr.expr; (** [typ] is the type of [term]. *) +} + +(** A [michelson_sample] is either a code sample or a data sample. *) +type michelson_sample = Code of michelson_code | Data of michelson_data + +(** Encoding used for saving or loading data. *) +val michelson_sample_list_encoding : michelson_sample list Data_encoding.t + +(** Saving a list of samples to a file. + Exits with code 1 if an error arises during encoding or file manipulation. *) +val save : filename:string -> terms:michelson_sample list -> unit + +(** Loading a list of samples from a file. + Exits with code 1 if an error arises during decoding or file manipulation. *) +val load : filename:string -> michelson_sample list + +(** [Make_code_sampler] produces a sampler for well-typed Michelson code. + The parameters of the functor are: + - a module [Michelson_base] implementing samplers for basic values + - a module [Crypto_samplers] implementing samplers for pk/pkh/sk triplets + - a module [X] containing some parameters to the Markov chain sampler: + - [rng_state] is the mutable state that will be used during sampling + - [target_size] specifies the size, in terms of Micheline nodes, of the + terms that the sampler should try to produce + - [verbosity] specifies how much information should be written on stdout + during the sampling process. + + The outcome is a [michelson_code] [generator]. The [burn_in] parameter + specifies how much samples should be thrown away before starting to + produce sample (this is used to let the underlying Markov chain reach + its stationary distribution - the value should be commensurate with + the [target_size]. + *) +module Make_code_sampler : functor + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) + (X : sig + val rng_state : Random.State.t + + val target_size : int + + val verbosity : [`Progress | `Silent | `Trace] + end) + -> sig + (** [generator ~burn_in rng_state] performs a burn-in phase consisting of sampling [burn_in] times, + throwing the results away and returns a michelson term sampler. The goal of burn-in is + to drive the underlying Markov chain to its stationary distribution, ie to sample + terms around the specified [X.target_size]. *) + val generator : burn_in:int -> Random.State.t -> michelson_code Stats.Gen.t +end + +(** See documentation for [Make_code_sampler] *) +module Make_data_sampler : functor + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) + (X : sig + val rng_state : Random.State.t + + val target_size : int + + val verbosity : [`Progress | `Silent | `Trace] + end) + -> sig + (** [generator ~burn_in rng_state] performs a burn-in phase consisting of sampling [burn_in] times, + throwing the results away and returns a michelson term sampler. The goal of burn-in is + to drive the underlying Markov chain to its stationary distribution, ie to sample + terms around the specified [X.target_size]. *) + val generator : burn_in:int -> Random.State.t -> michelson_data Stats.Gen.t +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.ml b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.ml new file mode 100644 index 000000000000..f2c1a9f96a14 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.ml @@ -0,0 +1,831 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Script_typed_ir + +type parameters = { + base_parameters : Michelson_samplers_base.parameters; + list_size : Base_samplers.range; + set_size : Base_samplers.range; + map_size : Base_samplers.range; +} + +let parameters_encoding = + let open Data_encoding in + let range_encoding = Base_samplers.range_encoding in + conv + (fun {base_parameters; list_size; set_size; map_size} -> + (base_parameters, (list_size, set_size, map_size))) + (fun (base_parameters, (list_size, set_size, map_size)) -> + {base_parameters; list_size; set_size; map_size}) + (merge_objs + Michelson_samplers_base.parameters_encoding + (obj3 + (req "list_size" range_encoding) + (req "set_size" range_encoding) + (req "map_size" range_encoding))) + +(* ------------------------------------------------------------------------- *) +(* Type names. *) + +(* We only want to generated inhabited types, hence Never is not included. *) + +type type_name = + [ `TUnit + | `TInt + | `TNat + | `TSignature + | `TString + | `TBytes + | `TMutez + | `TKey_hash + | `TKey + | `TTimestamp + | `TAddress + | `TTx_rollup_l2_address + | `TBool + | `TPair + | `TUnion + | `TLambda + | `TOption + | `TList + | `TSet + | `TMap + | `TBig_map + | `TContract + | `TSapling_transaction + | `TSapling_transaction_deprecated + | `TSapling_state + | `TOperation + | `TChain_id + | `TBls12_381_g1 + | `TBls12_381_g2 + | `TBls12_381_fr + | `TTicket ] + +type atomic_type_name = + [ `TUnit + | `TInt + | `TNat + | `TSignature + | `TString + | `TBytes + | `TMutez + | `TKey_hash + | `TKey + | `TTimestamp + | `TAddress + | `TTx_rollup_l2_address + | `TBool + | `TSapling_transaction + | `TSapling_transaction_deprecated + | `TSapling_state + | `TChain_id + | `TBls12_381_g1 + | `TBls12_381_g2 + | `TBls12_381_fr ] + +type non_atomic_type_name = + [ `TPair + | `TUnion + | `TLambda + | `TOption + | `TList + | `TSet + | `TMap + | `TBig_map + | `TContract + | `TTicket ] + +(* Ensure inclusion of atomic_type_name in type_name *) +let (_ : atomic_type_name -> type_name) = fun x -> (x :> type_name) + +(* Ensure inclusion of non_atomic_type_name in type_name *) +let (_ : non_atomic_type_name -> type_name) = fun x -> (x :> type_name) + +let all_atomic_type_names : atomic_type_name array = + [| + `TUnit; + `TInt; + `TNat; + `TSignature; + `TString; + `TBytes; + `TMutez; + `TKey_hash; + `TKey; + `TTimestamp; + `TAddress; + `TTx_rollup_l2_address; + `TBool; + `TSapling_transaction; + `TSapling_transaction_deprecated; + `TSapling_state; + `TChain_id; + `TBls12_381_g1; + `TBls12_381_g2; + `TBls12_381_fr; + |] + +let all_non_atomic_type_names : non_atomic_type_name array = + [| + `TPair; + `TUnion; + `TLambda; + `TOption; + `TList; + `TSet; + `TMap; + `TBig_map; + `TContract; + `TTicket; + |] + +type comparable_type_name = + [ `TUnit + | `TInt + | `TNat + | `TSignature + | `TString + | `TBytes + | `TMutez + | `TBool + | `TKey_hash + | `TKey + | `TTimestamp + | `TChain_id + | `TAddress + | `TTx_rollup_l2_address + | `TPair + | `TUnion + | `TOption ] + +(* Ensure inclusion of comparable_type_name in type_name *) +let (_ : comparable_type_name -> type_name) = fun x -> (x :> type_name) + +type 'a comparable_and_atomic = 'a + constraint 'a = [< comparable_type_name] constraint 'a = [< atomic_type_name] + +let all_comparable_atomic_type_names : 'a comparable_and_atomic array = + [| + `TUnit; + `TInt; + `TNat; + `TSignature; + `TString; + `TBytes; + `TMutez; + `TBool; + `TKey_hash; + `TKey; + `TTimestamp; + `TChain_id; + `TAddress; + `TTx_rollup_l2_address; + |] + +type 'a comparable_and_non_atomic = 'a + constraint 'a = [< comparable_type_name] + constraint 'a = [< non_atomic_type_name] + +let all_comparable_non_atomic_type_names : 'a comparable_and_non_atomic array = + [|`TPair; `TUnion; `TOption|] + +(* Ensure inclusion of comparable_and_atomic in type_name *) +let (_ : 'a comparable_and_atomic -> type_name) = fun x -> (x :> type_name) + +(* ------------------------------------------------------------------------- *) +(* Uniform type name generators *) + +open Sampling_helpers + +let uniform : 'a array -> 'a sampler = + fun arr rng_state -> + let i = Random.State.int rng_state (Array.length arr) in + arr.(i) + +let uniform_atomic_type_name : atomic_type_name sampler = + uniform all_atomic_type_names + +let uniform_comparable_atomic_type_name : 'a comparable_and_atomic sampler = + uniform all_comparable_atomic_type_names + +let uniform_comparable_non_atomic_type_name : + 'a comparable_and_non_atomic sampler = + uniform all_comparable_non_atomic_type_names + +(* ------------------------------------------------------------------------- *) +(* Random generation functor. *) + +module type S = sig + module Michelson_base : Michelson_samplers_base.S + + module Random_type : sig + val m_type : size:int -> Script_typed_ir.ex_ty sampler + + val m_comparable_type : + size:int -> Script_ir_translator.ex_comparable_ty sampler + end + + module Random_value : sig + val value : ('a, _) Script_typed_ir.ty -> 'a sampler + + val comparable : 'a Script_typed_ir.comparable_ty -> 'a sampler + + val stack : ('a, 'b) Script_typed_ir.stack_ty -> ('a * 'b) sampler + end +end + +exception SamplingError of string + +let fail_sampling error = raise (SamplingError error) + +module Make (P : sig + val parameters : parameters +end) +(Crypto_samplers : Crypto_samplers.Finite_key_pool_S) : S = struct + module Michelson_base = Michelson_samplers_base.Make (struct + let parameters = P.parameters.base_parameters + end) + + let memo_size = + Alpha_context.Sapling.Memo_size.parse_z Z.zero |> Result.get_ok + + (* [pick_split x] randomly splits the integer [x] into two integers [left] + and [right] such that [1 <= left], [1 <= right], and [left + right = x]. + Expects [x >= 2]. *) + let pick_split : int -> (int * int) sampler = + fun x rng_state -> + if x < 2 then invalid_arg "pick_split" + else + (* x >= 2 *) + let left = 1 + Random.State.int rng_state (x - 1) in + let right = x - left in + assert (left + right = x) ; + (left, right) + + (* Random generation of Michelson types. *) + module Random_type = struct + let type_of_atomic_type_name (at_tn : atomic_type_name) : + Script_typed_ir.ex_ty = + match at_tn with + | `TString -> Ex_ty string_t + | `TNat -> Ex_ty nat_t + | `TKey -> Ex_ty key_t + | `TBytes -> Ex_ty bytes_t + | `TBool -> Ex_ty bool_t + | `TAddress -> Ex_ty address_t + | `TTx_rollup_l2_address -> Ex_ty tx_rollup_l2_address_t + | `TTimestamp -> Ex_ty timestamp_t + | `TKey_hash -> Ex_ty key_hash_t + | `TMutez -> Ex_ty mutez_t + | `TSignature -> Ex_ty signature_t + | `TUnit -> Ex_ty unit_t + | `TInt -> Ex_ty int_t + | `TSapling_state -> Ex_ty (sapling_state_t ~memo_size) + | `TSapling_transaction -> Ex_ty (sapling_transaction_t ~memo_size) + | `TSapling_transaction_deprecated -> + Ex_ty (sapling_transaction_deprecated_t ~memo_size) + | `TChain_id -> Ex_ty chain_id_t + | `TBls12_381_g1 -> Ex_ty bls12_381_g1_t + | `TBls12_381_g2 -> Ex_ty bls12_381_g2_t + | `TBls12_381_fr -> Ex_ty bls12_381_fr_t + + let comparable_type_of_comparable_atomic_type_name + (cmp_tn : 'a comparable_and_atomic) : + Script_ir_translator.ex_comparable_ty = + match cmp_tn with + | `TString -> Ex_comparable_ty string_t + | `TNat -> Ex_comparable_ty nat_t + | `TBytes -> Ex_comparable_ty bytes_t + | `TBool -> Ex_comparable_ty bool_t + | `TAddress -> Ex_comparable_ty address_t + | `TTx_rollup_l2_address -> Ex_comparable_ty tx_rollup_l2_address_t + | `TTimestamp -> Ex_comparable_ty timestamp_t + | `TKey_hash -> Ex_comparable_ty key_hash_t + | `TMutez -> Ex_comparable_ty mutez_t + | `TInt -> Ex_comparable_ty int_t + | `TUnit -> Ex_comparable_ty unit_t + | `TSignature -> Ex_comparable_ty signature_t + | `TKey -> Ex_comparable_ty key_t + | `TChain_id -> Ex_comparable_ty chain_id_t + + let rec m_type ~size : Script_typed_ir.ex_ty sampler = + let open Script_ir_translator in + let open M in + if size <= 0 then Stdlib.failwith "m_type: size <= 0" + else if size = 1 then + (* only atomic types can have size 1 *) + let* at_tn = uniform_atomic_type_name in + return (type_of_atomic_type_name at_tn) + else if size = 2 then + bind (uniform [|`TOption; `TList; `TSet; `TTicket; `TContract|]) + @@ function + | `TOption -> ( + let* (Ex_ty t) = m_type ~size:1 in + match option_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TList -> ( + let* (Ex_ty t) = m_type ~size:1 in + match list_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TSet -> ( + let* (Ex_comparable_ty t) = m_comparable_type ~size:1 in + match set_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TTicket -> ( + let* (Ex_comparable_ty contents) = m_comparable_type ~size:1 in + match ticket_t (-1) contents with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TContract -> ( + let* (Ex_ty t) = m_type ~size:1 in + match contract_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + else + bind (uniform all_non_atomic_type_names) @@ function + | `TPair -> ( + let* lsize, rsize = pick_split (size - 1) in + let* (Ex_ty left) = m_type ~size:lsize in + let* (Ex_ty right) = m_type ~size:rsize in + match pair_t (-1) left right with + | Error _ -> assert false + | Ok (Ty_ex_c res_ty) -> return @@ Ex_ty res_ty) + | `TLambda -> ( + let* lsize, rsize = pick_split (size - 1) in + let* (Ex_ty domain) = m_type ~size:lsize in + let* (Ex_ty range) = m_type ~size:rsize in + match lambda_t (-1) domain range with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TUnion -> ( + let* lsize, rsize = pick_split (size - 1) in + let* (Ex_ty left) = m_type ~size:lsize in + let* (Ex_ty right) = m_type ~size:rsize in + match union_t (-1) left right with + | Error _ -> assert false + | Ok (Ty_ex_c res_ty) -> return @@ Ex_ty res_ty) + | `TOption -> ( + let* (Ex_ty t) = m_type ~size:(size - 1) in + match option_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TMap -> ( + let* lsize, rsize = pick_split (size - 1) in + let* (Ex_comparable_ty key) = m_comparable_type ~size:lsize in + let* (Ex_ty elt) = m_type ~size:rsize in + match map_t (-1) key elt with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TSet -> ( + let* (Ex_comparable_ty key_ty) = + m_comparable_type ~size:(size - 1) + in + match set_t (-1) key_ty with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TList -> ( + let* (Ex_ty elt) = m_type ~size:(size - 1) in + match list_t (-1) elt with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TTicket -> ( + let* (Ex_comparable_ty contents) = + m_comparable_type ~size:(size - 1) + in + match ticket_t (-1) contents with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TContract -> ( + let* (Ex_ty t) = m_type ~size:(size - 1) in + match contract_t (-1) t with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_ty res_ty) + | `TBig_map -> + (* Don't know what to do with theses. Redraw. *) + m_type ~size + + and m_comparable_type ~size : Script_ir_translator.ex_comparable_ty sampler + = + let open M in + let open Script_ir_translator in + let atomic_case () = + let* at_tn = uniform_comparable_atomic_type_name in + return (comparable_type_of_comparable_atomic_type_name at_tn) + in + let option_case size = + let size = size - 1 in + let* (Ex_comparable_ty t) = m_comparable_type ~size in + match option_t (-1) t with + | Error _ -> (* what should be done here? *) assert false + | Ok res_ty -> return @@ Ex_comparable_ty res_ty + in + let pair_case size = + let size = size - 1 in + let* size_left = + Base_samplers.sample_in_interval ~range:{min = 1; max = size - 1} + in + let size_right = size - size_left in + let* (Ex_comparable_ty l) = m_comparable_type ~size:size_left in + let* (Ex_comparable_ty r) = m_comparable_type ~size:size_right in + match comparable_pair_t (-1) l r with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_comparable_ty res_ty + in + let union_case size = + let size = size - 1 in + let* size_left = + Base_samplers.sample_in_interval ~range:{min = 1; max = size - 1} + in + let size_right = size - size_left in + let* (Ex_comparable_ty l) = m_comparable_type ~size:size_left in + let* (Ex_comparable_ty r) = m_comparable_type ~size:size_right in + match comparable_union_t (-1) l r with + | Error _ -> assert false + | Ok res_ty -> return @@ Ex_comparable_ty res_ty + in + + if size <= 1 then atomic_case () + else if size = 2 then option_case size + else + let* cmp_tn = uniform_comparable_non_atomic_type_name in + match cmp_tn with + | `TPair -> pair_case size + | `TUnion -> union_case size + | `TOption -> option_case size + end + + (* Type-directed generation of random values. *) + module Random_value : sig + val value : ('a, _) Script_typed_ir.ty -> 'a sampler + + val comparable : 'a Script_typed_ir.comparable_ty -> 'a sampler + + val stack : ('a, 'b) Script_typed_ir.stack_ty -> ('a * 'b) sampler + end = struct + let implicit = Crypto_samplers.pkh + + let originated rng_state = + (* For a description of the format, see + tezos-codec describe alpha.contract binary encoding *) + let string = + "\001" ^ Base_samplers.uniform_string ~nbytes:20 rng_state ^ "\000" + in + Data_encoding.Binary.of_string_exn + Alpha_context.Contract.originated_encoding + string + + let tx_rollup rng_state = + let string = Base_samplers.uniform_string ~nbytes:20 rng_state in + Data_encoding.Binary.of_string_exn Alpha_context.Tx_rollup.encoding string + + let sc_rollup rng_state = + let string = Base_samplers.uniform_string ~nbytes:20 rng_state in + Data_encoding.Binary.of_string_exn + Alpha_context.Sc_rollup.Address.encoding + string + + let entrypoint rng_state = + Alpha_context.Entrypoint.of_string_strict_exn + @@ Base_samplers.string ~size:{min = 1; max = 31} rng_state + + let address rng_state = + if Base_samplers.uniform_bool rng_state then + let destination = + Alpha_context.Destination.Contract (Implicit (implicit rng_state)) + in + {destination; entrypoint = Alpha_context.Entrypoint.default} + else + let destination = + Alpha_context.Destination.Contract (Originated (originated rng_state)) + in + let entrypoint = entrypoint rng_state in + {destination; entrypoint} + + let generate_originated_contract : + type arg argc. + (arg, argc) Script_typed_ir.ty -> + arg Script_typed_ir.typed_contract sampler = + fun arg_ty -> + let open M in + let* c = originated in + let* entrypoint = entrypoint in + let destination = Alpha_context.Destination.Contract (Originated c) in + return + (Typed_contract.Internal_for_tests.typed_exn + arg_ty + destination + entrypoint) + + let generate_sc_rollup_contract : + type arg argc. + (arg, argc) Script_typed_ir.ty -> + arg Script_typed_ir.typed_contract sampler = + fun arg_ty -> + let open M in + let* ru = sc_rollup in + let* entrypoint = entrypoint in + let destination = Alpha_context.Destination.Sc_rollup ru in + return + (Typed_contract.Internal_for_tests.typed_exn + arg_ty + destination + entrypoint) + + let generate_any_type_contract : + type arg argc. + (arg, argc) Script_typed_ir.ty -> + arg Script_typed_ir.typed_contract sampler = + fun arg_ty -> + let open M in + let* b = Base_samplers.uniform_bool in + if b then generate_originated_contract arg_ty + else generate_sc_rollup_contract arg_ty + + let generate_contract : + type arg argc. + (arg, argc) Script_typed_ir.ty -> + arg Script_typed_ir.typed_contract sampler = + fun arg_ty -> + let open M in + match arg_ty with + | Unit_t -> + let* b = Base_samplers.uniform_bool in + if b then + let* pkh = implicit in + let destination = + Alpha_context.Destination.Contract (Implicit pkh) + in + let entrypoint = Alpha_context.Entrypoint.default in + return + (Typed_contract.Internal_for_tests.typed_exn + arg_ty + destination + entrypoint) + else generate_any_type_contract arg_ty + | Pair_t (Ticket_t _, Tx_rollup_l2_address_t, _, _) -> + let* b = Base_samplers.uniform_bool in + if b then + let* tx_rollup = tx_rollup in + let destination = Alpha_context.Destination.Tx_rollup tx_rollup in + let entrypoint = Alpha_context.Entrypoint.deposit in + return + (Typed_contract.Internal_for_tests.typed_exn + arg_ty + destination + entrypoint) + else generate_any_type_contract arg_ty + | _ -> generate_any_type_contract arg_ty + + let tx_rollup_l2_address rng_state = + let seed = + Bytes.init 32 (fun _ -> char_of_int @@ Random.State.int rng_state 255) + in + let pkh, _pk, _sk = Tezos_crypto.Bls.generate_key ~seed () in + Tx_rollup_l2_address.Indexable.value pkh + + let chain_id rng_state = + let string = Base_samplers.uniform_string ~nbytes:4 rng_state in + Data_encoding.Binary.of_string_exn Script_chain_id.encoding string + + let signature rng_state = + Script_signature.make (Michelson_base.signature rng_state) + + let rec value : type a ac. (a, ac) Script_typed_ir.ty -> a sampler = + let open Script_typed_ir in + fun typ -> + match typ with + | Never_t -> assert false + | Unit_t -> M.return () + | Int_t -> Michelson_base.int + | Nat_t -> Michelson_base.nat + | Signature_t -> signature + | String_t -> Michelson_base.string + | Bytes_t -> Michelson_base.bytes + | Mutez_t -> Michelson_base.tez + | Key_hash_t -> Crypto_samplers.pkh + | Key_t -> Crypto_samplers.pk + | Timestamp_t -> Michelson_base.timestamp + | Bool_t -> Base_samplers.uniform_bool + | Address_t -> address + | Tx_rollup_l2_address_t -> tx_rollup_l2_address + | Pair_t (left_t, right_t, _, _) -> + M.( + let* left_v = value left_t in + let* right_v = value right_t in + return (left_v, right_v)) + | Union_t (left_t, right_t, _, _) -> + fun rng_state -> + if Base_samplers.uniform_bool rng_state then + L (value left_t rng_state) + else R (value right_t rng_state) + | Lambda_t (arg_ty, ret_ty, _) -> generate_lambda arg_ty ret_ty + | Option_t (ty, _, _) -> + fun rng_state -> + if Base_samplers.uniform_bool rng_state then None + else Some (value ty rng_state) + | List_t (elt_ty, _) -> generate_list elt_ty + | Set_t (elt_ty, _) -> generate_set elt_ty + | Map_t (key_ty, val_ty, _) -> generate_map key_ty val_ty + | Contract_t (arg_ty, _) -> generate_contract arg_ty + | Operation_t -> generate_operation + | Big_map_t (key_ty, val_ty, _) -> generate_big_map key_ty val_ty + | Chain_id_t -> chain_id + | Bls12_381_g1_t -> generate_bls12_381_g1 + | Bls12_381_g2_t -> generate_bls12_381_g2 + | Bls12_381_fr_t -> generate_bls12_381_fr + | Ticket_t (contents_ty, _) -> generate_ticket contents_ty + | Sapling_transaction_t _ -> + fail_sampling + "Michelson_samplers: sapling transactions not handled yet" + | Sapling_transaction_deprecated_t _ -> + fail_sampling + "Michelson_samplers: sapling transactions not handled yet" + | Sapling_state_t _ -> + fail_sampling "Michelson_samplers: sapling state not handled yet" + | Chest_key_t -> + fail_sampling "Michelson_samplers: chest key not handled yet" + | Chest_t -> fail_sampling "Michelson_samplers: chest not handled yet" + + and generate_lambda : + type arg argc ret retc. + (arg, argc) Script_typed_ir.ty -> + (ret, retc) Script_typed_ir.ty -> + (arg, ret) Script_typed_ir.lambda sampler = + fun _arg_ty _ret_ty _rng_state -> + fail_sampling "Michelson_samplers: lambda not handled yet" + + and generate_list : + type elt eltc. + (elt, eltc) Script_typed_ir.ty -> elt Script_list.t sampler = + fun elt_type -> + let open M in + let* _, elements = + Structure_samplers.list + ~range:P.parameters.list_size + ~sampler:(value elt_type) + in + return @@ Script_list.of_list elements + + (* Note that we might very well generate sets smaller than the specified range (consider the + case of a set of type [unit]). *) + and generate_set : + type elt. + elt Script_typed_ir.comparable_ty -> elt Script_typed_ir.set sampler = + fun elt_ty -> + let open M in + let* _, elements = + Structure_samplers.list + ~range:P.parameters.set_size + ~sampler:(value elt_ty) + in + return + @@ List.fold_left + (fun set x -> Script_set.update x true set) + (Script_set.empty elt_ty) + elements + + and generate_map : + type key elt eltc. + key Script_typed_ir.comparable_ty -> + (elt, eltc) Script_typed_ir.ty -> + (key, elt) Script_typed_ir.map sampler = + fun key_ty elt_ty rng_state -> + let size = + Base_samplers.sample_in_interval rng_state ~range:P.parameters.map_size + in + let keys = List.init size (fun _ -> value key_ty rng_state) in + let elts = List.init size (fun _ -> value elt_ty rng_state) in + List.fold_left2 + (fun map key elt -> Script_map.update key (Some elt) map) + (Script_map.empty key_ty) + keys + elts + + and generate_big_map : + type key elt eltc. + key Script_typed_ir.comparable_ty -> + (elt, eltc) Script_typed_ir.ty -> + (key, elt) Script_typed_ir.big_map sampler = + let open Script_typed_ir in + fun key_ty elt_ty rng_state -> + let open TzPervasives in + let result = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let big_map = Script_big_map.empty key_ty elt_ty in + (* Cannot have big maps under big maps *) + option_t (-1) elt_ty |> Environment.wrap_tzresult + >>?= fun opt_elt_ty -> + let map = generate_map key_ty opt_elt_ty rng_state in + Script_map.fold + (fun k v acc -> + acc >>=? fun (bm, ctxt_acc) -> + Script_big_map.update ctxt_acc k v bm) + map + (return (big_map, ctxt)) + >|= Environment.wrap_tzresult + >>=? fun (big_map, _) -> return big_map ) + in + match result with + | Ok x -> x + | Error e -> + Format.eprintf + "%a@." + (Error_monad.TzTrace.pp_print Error_monad.pp) + e ; + fail_sampling "raise_if_error" + + and generate_operation : Script_typed_ir.operation sampler = + fun rng_state -> + let transfer = generate_transfer_tokens rng_state in + Script_typed_ir.{piop = transfer; lazy_storage_diff = None} + + and generate_transfer_tokens : + Script_typed_ir.packed_internal_operation sampler = + fun _rng_state -> fail_sampling "generate_transfer_tokens: unimplemented" + + and generate_bls12_381_g1 : Script_bls.G1.t sampler = + fun rng_state -> + let b = Bls12_381.G1.(to_bytes (random ~state:rng_state ())) in + match Script_bls.G1.of_bytes_opt b with + | Some x -> x + | None -> assert false + + and generate_bls12_381_g2 : Script_bls.G2.t sampler = + fun rng_state -> + let b = Bls12_381.G2.(to_bytes (random ~state:rng_state ())) in + match Script_bls.G2.of_bytes_opt b with + | Some x -> x + | None -> assert false + + and generate_bls12_381_fr : Script_bls.Fr.t sampler = + fun rng_state -> + let b = Bls12_381.Fr.(to_bytes (random ~state:rng_state ())) in + match Script_bls.Fr.of_bytes_opt b with + | Some x -> x + | None -> assert false + + and generate_ticket : + type a ac. + (a, ac) Script_typed_ir.ty -> a Script_typed_ir.ticket sampler = + fun ty rng_state -> + let contents = value ty rng_state in + let ticketer = + Alpha_context.Contract.Implicit (Crypto_samplers.pkh rng_state) + in + let amount = + let open Ticket_amount in + match of_n (Michelson_base.nat rng_state) with + | Some amount -> add amount one + | None -> one + in + Script_typed_ir.{ticketer; contents; amount} + + let comparable ty = value ty + + (* Random stack generation. *) + let rec stack : type a b. (a, b) Script_typed_ir.stack_ty -> (a * b) sampler + = + let open M in + let open Script_typed_ir in + fun stack_ty -> + match stack_ty with + | Item_t (ty, tl) -> + let* elt = value ty in + let* tl = stack tl in + return ((elt, tl) : a * b) + | Bot_t -> return (EmptyCell, EmptyCell) + end +end + +module Internal_for_tests = struct + type nonrec type_name = type_name +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.mli b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.mli new file mode 100644 index 000000000000..c333639b79a9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers.mli @@ -0,0 +1,133 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Sampling various Michelson values. *) + +open Protocol +open Base_samplers + +(** This module exposes a functor implementing various samplers for Michelson. + These allow to sample: + - types and comparable types (given a target size), + - values and comparable values of a given Michelson type (given some more + parameters fixed at functor instantiation time) + - stacks + + Note that some kind of values might not be supported. At the time of writing, + the value sampler doesn't handle the following types: + - Sapling transaction and states + - Timelock chests and chest keys + - Operations + - Lambdas (ie code) + + For the latter, consider using the samplers in {!Michelson_mcmc_samplers}. +*) + +(** Parameters for the Michelson samplers. *) +type parameters = { + base_parameters : Michelson_samplers_base.parameters; + list_size : Base_samplers.range; + (** The range of the size, measured in number of elements, in which lists must be sampled.*) + set_size : Base_samplers.range; + (** The range of the size, measured in number of elements, in which sets must be sampled.*) + map_size : Base_samplers.range; + (** The range of the size, measured in number of bindings, in which maps must be sampled.*) +} + +(** Encoding for sampler prameters. *) +val parameters_encoding : parameters Data_encoding.t + +(** The module type produced by the [Make] functor. *) +module type S = sig + (** Basic Michelson samplers, re-exported for convenience by the functor. *) + module Michelson_base : Michelson_samplers_base.S + + (** Samplers for random Michelson types. *) + module Random_type : sig + (** [m_type ~size] samples a type containing exactly [size] constructors. *) + val m_type : size:int -> Script_typed_ir.ex_ty sampler + + (** [m_comparable_type ~size] samples a comparable type containing + exactly [size] constructors. *) + val m_comparable_type : + size:int -> Script_ir_translator.ex_comparable_ty sampler + end + + (** Samplers for random Michelson values. Restrictions apply on the + supported types as listed at the beginning of this file. *) + module Random_value : sig + (** Sample a value given its type. *) + val value : ('a, _) Script_typed_ir.ty -> 'a sampler + + (** Sample a comparable value given its type. *) + val comparable : 'a Script_typed_ir.comparable_ty -> 'a sampler + + (** Sample a stack given its type. *) + val stack : ('a, 'b) Script_typed_ir.stack_ty -> ('a * 'b) sampler + end +end + +(** Instantiate a module of type {!S}. *) +module Make : functor + (P : sig + val parameters : parameters + end) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) + -> S + +module Internal_for_tests : sig + type type_name = + [ `TAddress + | `TTx_rollup_l2_address + | `TBig_map + | `TBls12_381_fr + | `TBls12_381_g1 + | `TBls12_381_g2 + | `TBool + | `TBytes + | `TChain_id + | `TContract + | `TInt + | `TKey + | `TKey_hash + | `TLambda + | `TList + | `TMap + | `TMutez + | `TNat + | `TOperation + | `TOption + | `TPair + | `TSapling_state + | `TSapling_transaction + | `TSapling_transaction_deprecated + | `TSet + | `TSignature + | `TString + | `TTicket + | `TTimestamp + | `TUnion + | `TUnit ] +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.ml b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.ml new file mode 100644 index 000000000000..c9a9d36e0612 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.ml @@ -0,0 +1,139 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Sampling_helpers + +(** Parameters for basic samplers *) +type parameters = { + int_size : Base_samplers.range; + string_size : Base_samplers.range; + bytes_size : Base_samplers.range; +} + +(** Encoding for basic samplers parameters *) +let parameters_encoding = + let open Data_encoding in + let range = Base_samplers.range_encoding in + conv + (fun {int_size; string_size; bytes_size} -> + (int_size, string_size, bytes_size)) + (fun (int_size, string_size, bytes_size) -> + {int_size; string_size; bytes_size}) + (obj3 + (req "int_size" range) + (req "string_size" range) + (req "bytes_size" range)) + +(** A module of type [S] packs samplers used to construct basic Michelson values. *) +module type S = sig + val int : Script_int.z Script_int.num sampler + + val nat : Script_int.n Script_int.num sampler + + val signature : Tezos_crypto.Signature.t sampler + + val string : Script_string.t sampler + + val bytes : bytes sampler + + val tez : Alpha_context.Tez.tez sampler + + val timestamp : Script_timestamp.t sampler +end + +(* Samplers for basic Michelson types. *) + +module Make (P : sig + val parameters : parameters +end) : S = struct + let int rng_state = + let i = Base_samplers.int ~size:P.parameters.int_size rng_state in + Script_int.of_zint i + + let nat rng_state = + let i = Base_samplers.nat ~size:P.parameters.int_size rng_state in + Script_int.abs (Script_int.of_zint i) + + let signature rng_state = + let i = Random.State.int rng_state 5 in + match i with + | 0 -> ( + let open Tezos_crypto.Ed25519 in + let bytes = Base_samplers.uniform_bytes ~nbytes:size rng_state in + match of_bytes_opt bytes with + | None -> assert false + | Some s -> Tezos_crypto.Signature.of_ed25519 s) + | 1 -> ( + let open Tezos_crypto.Secp256k1 in + let bytes = Base_samplers.uniform_bytes ~nbytes:size rng_state in + match of_bytes_opt bytes with + | None -> assert false + | Some s -> Tezos_crypto.Signature.of_secp256k1 s) + | 2 -> ( + let open Tezos_crypto.P256 in + let bytes = Base_samplers.uniform_bytes ~nbytes:size rng_state in + match of_bytes_opt bytes with + | None -> assert false + | Some s -> Tezos_crypto.Signature.of_p256 s) + | 3 -> + (* BLS checks that signatures are on the curve so we need to generate real + ones by signing a message. *) + let open Tezos_crypto.Bls in + let msg = Base_samplers.uniform_bytes ~nbytes:32 rng_state in + let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in + let _, _, sk = generate_key ~seed () in + Tezos_crypto.Signature.of_bls (sign sk msg) + | _ -> + let open Tezos_crypto.Signature in + let bytes = + Base_samplers.uniform_bytes + ~nbytes:Tezos_crypto.Ed25519.size + rng_state + in + Unknown bytes + + let string rng_state = + let s = + Base_samplers.readable_ascii_string + ~size:P.parameters.string_size + rng_state + in + match Protocol.Script_string.of_string s with + | Ok s -> s + | Error _ -> assert false + + let bytes = Base_samplers.bytes ~size:P.parameters.bytes_size + + let tez rng_state = + let i = Random.State.int64 rng_state (Int64.of_int max_int) in + match Protocol.Alpha_context.Tez.of_mutez i with + | Some res -> res + | None -> assert false + + let timestamp rng_state = + let i = Base_samplers.int ~size:P.parameters.int_size rng_state in + Script_timestamp.of_zint i +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.mli b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.mli new file mode 100644 index 000000000000..18a150245cfc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/michelson_samplers_base.mli @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Samplers for basic Michelson values (not including pairs, unions, tickets, big maps, etc) *) + +open Protocol +open Base_samplers + +(** Parameters for basic samplers *) +type parameters = { + int_size : Base_samplers.range; + (** The range of the size, measured in bytes, in which big integers must be sampled.*) + string_size : Base_samplers.range; + (** The range of the size, measured in bytes, in which strings must be sampled.*) + bytes_size : Base_samplers.range; + (** The range of the size, measured in bytes, in which [bytes] must be sampled.*) +} + +(** Encoding for [parameters] *) +val parameters_encoding : parameters Data_encoding.t + +(** A module of type [S] packs samplers used to construct basic Michelson values. *) +module type S = sig + val int : Script_int.z Script_int.num sampler + + val nat : Script_int.n Script_int.num sampler + + val signature : Tezos_crypto.Signature.t sampler + + val string : Script_string.t sampler + + val bytes : bytes sampler + + val tez : Alpha_context.Tez.tez sampler + + val timestamp : Script_timestamp.t sampler +end + +(** The [Make] functor instantiates a module of type [S], where the + samplers satisfy the given parameters. *) +module Make : functor + (P : sig + val parameters : parameters + end) + -> S diff --git a/src/proto_016_PtMumbai/lib_benchmark/mikhailsky_to_michelson.ml b/src/proto_016_PtMumbai/lib_benchmark/mikhailsky_to_michelson.ml new file mode 100644 index 000000000000..89741cd4ca0a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/mikhailsky_to_michelson.ml @@ -0,0 +1,229 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +exception Cannot_get_type of Mikhailsky.node * Kernel.Path.t + +exception Unexpected_stack_type of string + +exception Unexpected_base_type + +let unparse_type = Mikhailsky.map_var (fun _ -> Mikhailsky.prim T_unit [] []) + +let project_top (aft : Type.Stack.t) = + match aft.node with + | Type.Stack.Empty_t -> raise (Unexpected_stack_type "empty") + | Type.Stack.Stack_var_t _ -> raise (Unexpected_stack_type "var") + | Type.Stack.Item_t (top, _) -> top + +let project_union (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with + | Type.Base.Union_t (l, r) -> (l, r) + | _ -> raise Unexpected_base_type + +let project_lambda (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with + | Type.Base.Lambda_t (dom, range) -> (dom, range) + | _ -> raise Unexpected_base_type + +let project_list (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with + | Type.Base.List_t t -> t + | _ -> raise Unexpected_base_type + +let project_set (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with Type.Base.Set_t t -> t | _ -> raise Unexpected_base_type + +let project_map (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with + | Type.Base.Map_t (k, v) -> (k, v) + | _ -> raise Unexpected_base_type + +let project_option (aft : Type.Stack.t) = + let top = project_top aft in + match top.node with + | Type.Base.Option_t t -> t + | _ -> raise Unexpected_base_type + +let rec convert_raw : Mikhailsky.node -> (int, 'a) Micheline.node = + fun node -> + match node with + | Micheline.Int (_, i) -> Micheline.Int (0, i) + | Micheline.Prim (_, head, subterms, annots) -> + let head = Mikhailsky_prim.to_michelson head in + Micheline.Prim (0, head, List.map convert_raw subterms, annots) + | Micheline.String (_, s) -> Micheline.String (0, s) + | Micheline.Bytes (_, b) -> Micheline.Bytes (0, b) + | Micheline.Seq (_, subterms) -> + Micheline.Seq (0, List.map convert_raw subterms) + +(* We assume that the term has been completed. *) +let rec convert : + Mikhailsky.node -> Kernel.Path.t -> (int, 'a) Micheline.node Inference.M.t = + fun node path -> + let open Inference.M in + match node with + | Micheline.Int (_, i) -> return (Micheline.Int (0, i)) + | Micheline.String (_, s) -> return (Micheline.String (0, s)) + | Micheline.Bytes (_, b) -> return (Micheline.Bytes (0, b)) + (* Remove annotations *) + | Micheline.Prim (_, prim, [term], _) + when Mikhailsky_prim.kind prim = Annot_kind -> + let path = Kernel.Path.at_index 0 path in + convert term path + (* Fail on holes *) + | Micheline.Prim (_, I_Hole, _, _) | Micheline.Prim (_, D_Hole, _, _) -> + raise Mikhailsky.Term_contains_holes + (* Add type information to union injections *) + | Micheline.Prim (_, I_LEFT, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let _, r = project_union aft in + Inference.instantiate_base r >>= fun r -> + Autocomp.replace_vars r >>= fun r -> + let r = unparse_type r in + let head = Mikhailsky_prim.to_michelson I_LEFT in + return (Micheline.Prim (0, head, [convert_raw r], annots))) + | Micheline.Prim (_, I_RIGHT, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let l, _ = project_union aft in + Inference.instantiate_base l >>= fun l -> + Autocomp.replace_vars l >>= fun l -> + let l = unparse_type l in + let head = Mikhailsky_prim.to_michelson I_RIGHT in + return (Micheline.Prim (0, head, [convert_raw l], annots))) + | Micheline.Prim (_, (I_LEFT | I_RIGHT), _, _) -> + raise Mikhailsky.Ill_formed_mikhailsky + (* Add type information for lambdas *) + | Micheline.Prim (_, I_LAMBDA, [code], annots) -> ( + convert code (Kernel.Path.at_index 0 path) >>= fun code -> + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let dom, range = project_lambda aft in + Inference.instantiate_base dom >>= fun dom -> + Autocomp.replace_vars dom >>= fun dom -> + Inference.instantiate_base range >>= fun range -> + Autocomp.replace_vars range >>= fun range -> + let dom = unparse_type dom in + let range = unparse_type range in + let head = Mikhailsky_prim.to_michelson I_LAMBDA in + return + (Micheline.Prim + (0, head, [convert_raw dom; convert_raw range; code], annots))) + (* Add type information for empty_set, empty_map *) + | Micheline.Prim (_, I_EMPTY_SET, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let elt = project_set aft in + Inference.instantiate_base elt >>= fun elt -> + Autocomp.replace_vars elt >>= fun elt -> + let elt = unparse_type elt in + let head = Mikhailsky_prim.to_michelson I_EMPTY_SET in + return (Micheline.Prim (0, head, [convert_raw elt], annots))) + | Micheline.Prim (_, I_EMPTY_MAP, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let k, v = project_map aft in + Inference.instantiate_base k >>= fun k -> + Autocomp.replace_vars k >>= fun k -> + Inference.instantiate_base v >>= fun v -> + Autocomp.replace_vars v >>= fun v -> + let k = convert_raw (unparse_type k) in + let v = convert_raw (unparse_type v) in + let head = Mikhailsky_prim.to_michelson I_EMPTY_MAP in + return (Micheline.Prim (0, head, [k; v], annots))) + (* Add type information for UNPACK *) + | Micheline.Prim (_, I_UNPACK, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let elt = project_option aft in + Inference.instantiate_base elt >>= fun elt -> + Autocomp.replace_vars elt >>= fun elt -> + let elt = unparse_type elt in + let head = Mikhailsky_prim.to_michelson I_UNPACK in + return (Micheline.Prim (0, head, [convert_raw elt], annots))) + (* Add type information for NIL *) + | Micheline.Prim (_, I_NIL, [], annots) -> ( + get_instr_annot path >>= fun ty_opt -> + match ty_opt with + | None -> raise (Cannot_get_type (node, path)) + | Some {aft; _} -> + Inference.instantiate aft >>= fun aft -> + let elt = project_list aft in + Inference.instantiate_base elt >>= fun elt -> + Autocomp.replace_vars elt >>= fun elt -> + let elt = unparse_type elt in + let head = Mikhailsky_prim.to_michelson I_NIL in + return (Micheline.Prim (0, head, [convert_raw elt], annots))) + | Micheline.Prim (_, I_NIL, _, _) -> raise Mikhailsky.Ill_formed_mikhailsky + (* Project out type information from arithmetic ops *) + | Prim (_, ((I_ADD | I_SUB | I_MUL | I_EDIV) as instr), [_ty1; _ty2], annots) + -> + let head = Mikhailsky_prim.to_michelson instr in + return (Micheline.Prim (0, head, [], annots)) + | Prim (_, (I_ADD | I_SUB | I_MUL | I_EDIV), _, _) -> + raise Mikhailsky.Ill_formed_mikhailsky + (* Base case *) + | Micheline.Prim (_, head, subterms, annots) -> + let head = Mikhailsky_prim.to_michelson head in + convert_list path 0 subterms [] >>= fun subterms -> + return (Micheline.Prim (0, head, subterms, annots)) + | Micheline.Seq (_, subterms) -> + convert_list path 0 subterms [] >>= fun subterms -> + return (Micheline.Seq (0, subterms)) + +and convert_list path i subterms acc = + let open Inference.M in + match subterms with + | [] -> return (List.rev acc) + | subterm :: tl -> + let path' = Kernel.Path.at_index i path in + convert subterm path' >>= fun term -> + convert_list path (i + 1) tl (term :: acc) + +let convert node state = fst (convert node Kernel.Path.root state) diff --git a/src/proto_016_PtMumbai/lib_benchmark/rules.ml b/src/proto_016_PtMumbai/lib_benchmark/rules.ml new file mode 100644 index 000000000000..ce35900d5a20 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/rules.ml @@ -0,0 +1,975 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Kernel + +type rule_set = {rule_patt : pattern; replacements : guarded_replacement list} + +and guarded_replacement = { + type_constraint : type_constraint; + replacement : replacement list; +} + +and type_constraint = + | No_cnstrnt + | Data_cnstrnt of {cnstrnt : Type.Base.t; fresh : int list} + | Instr_cnstrnt of { + cnstrnt : Inference.transformer; + fresh : var list; + fresh_stack : int list; + } + +and replacement = + | Context_aware of (Mikhailsky.node -> Mikhailsky.node) + | Context_blind of (unit -> Mikhailsky.node) + +and pattern = Pattern of Patt.t | Root + +and var = Plain of int | Cmp of int + +let stack_repr = Inference.Stack_type None + +let base_repr = + Inference.Base_type {repr = None; comparable = Inference.Unconstrained} + +let cmp_repr = + Inference.Base_type {repr = None; comparable = Inference.Comparable} + +let rec add_fresh_stack_variables vars = + let open Inference.M in + match vars with + | [] -> return () + | fresh :: tl -> + uf_lift (Uf.UF.add fresh) >>= fun () -> + set_repr fresh stack_repr >>= fun () -> add_fresh_stack_variables tl + +let rec add_fresh_data_variables vars = + let open Inference.M in + match vars with + | [] -> return () + | fresh :: tl -> + uf_lift (Uf.UF.add fresh) >>= fun () -> + set_repr fresh base_repr >>= fun () -> add_fresh_data_variables tl + +let rec add_fresh_variables vars plain_repr cmp_repr = + let open Inference.M in + match vars with + | [] -> return () + | Plain fresh :: tl -> + uf_lift (Uf.UF.add fresh) >>= fun () -> + set_repr fresh plain_repr >>= fun () -> + add_fresh_variables tl plain_repr cmp_repr + | Cmp fresh :: tl -> + uf_lift (Uf.UF.add fresh) >>= fun () -> + set_repr fresh cmp_repr >>= fun () -> + add_fresh_variables tl plain_repr cmp_repr + +let evaluate_guard_monadic guard path = + let open Inference.M in + match guard with + | No_cnstrnt -> return () + | Data_cnstrnt {cnstrnt = base_type_constraint; fresh} -> ( + add_fresh_data_variables fresh >>= fun () -> + get_data_annot path >>= fun res_opt -> + match res_opt with + | None -> assert false + | Some type_of_expr -> + Inference.unify_base type_of_expr base_type_constraint >>= fun () -> + Inference.instantiate_base type_of_expr >>= fun _ -> return ()) + | Instr_cnstrnt {cnstrnt = {bef = pre; aft = post}; fresh; fresh_stack} -> ( + (* Add base fresh type variables *) + add_fresh_variables fresh base_repr cmp_repr + >>= fun () -> + add_fresh_stack_variables fresh_stack >>= fun () -> + get_instr_annot path >>= fun res_opt -> + match res_opt with + | None -> assert false + | Some {bef; aft} -> + Inference.unify pre bef >>= fun () -> + Inference.unify post aft >>= fun () -> + Inference.instantiate bef >>= fun _bef -> + Inference.instantiate aft >>= fun _aft -> return ()) + +let evaluate_guard typing guard path = + try + let _ = evaluate_guard_monadic guard path typing in + true + with Inference.Ill_typed_script _ -> false + +let filter_matches typing guard matches = + List.filter (evaluate_guard typing guard) matches + +(* Provides a speedup but should better be done in the + rewriting module (so that not only top matches are hash-consed). *) +let matches_with_hash_consing = + let match_table : (int * int, Kernel.Path.t list) Hashtbl.t = + Hashtbl.create 97 + in + fun pattern term -> + match pattern with + | Root -> [Path.root] + | Pattern patt -> ( + let key = (Kernel.Patt.uid patt, Mikhailsky.tag term) in + match Hashtbl.find_opt match_table key with + | None -> + let res = Rewriter.all_matches patt term in + Hashtbl.add match_table key res ; + res + | Some res -> res) + +let matches_without_consing pattern term = + match pattern with + | Root -> [Path.root] + | Pattern patt -> Rewriter.all_matches patt term + +let rewriting (state : State_space.t) (rules : rule_set list) = + List.fold_left + (fun acc rule -> + let matches = matches_without_consing rule.rule_patt state.term in + List.fold_left + (fun acc guarded_replacement -> + let matches = + filter_matches + (Lazy.force state.typing) + guarded_replacement.type_constraint + matches + in + List.fold_left + (fun acc replacement -> + match replacement with + | Context_blind term -> + List.fold_left + (fun acc path -> (path, term ()) :: acc) + acc + matches + | Context_aware f -> + List.fold_left + (fun acc path -> + let term = Rewriter.get_subterm ~term:state.term ~path in + (path, f term) :: acc) + acc + matches) + acc + guarded_replacement.replacement) + acc + rule.replacements) + [] + rules + +module Instruction = struct + (* ----------------------------------------------------------------------- *) + (* Rule: replace instruction by hole. *) + + (* Matches instructions *) + let match_any_instr = + let open Patt in + Pattern + (focus + (prim_pred + (fun prim -> Mikhailsky_prim.kind prim = Mikhailsky_prim.Instr_kind) + list_any)) + + let replace_any_instr_by_hole = + let replace_by_hole = + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.instr_hole)]; + } + in + {rule_patt = match_any_instr; replacements = [replace_by_hole]} + + (* ----------------------------------------------------------------------- *) + (* Rule: replace instruction hole by instruction satisfying typing + constraints. *) + + (* Matches instruction holes *) + let match_instr_hole = + let open Patt in + Pattern (focus (prim I_Hole list_any)) + + let replacement ?(fresh = []) ?(fresh_stack = []) ~bef ~aft ~replacement () : + guarded_replacement = + { + type_constraint = Instr_cnstrnt {cnstrnt = {bef; aft}; fresh; fresh_stack}; + replacement; + } + + let instructions = + let open Type in + let module M = Mikhailsky in + let module I = Inference in + let alpha = ~-1 in + let beta = ~-2 in + let gamma = ~-3 in + let delta = ~-4 in + [ + replacement + ~fresh_stack:[alpha] + ~bef:(item bytes (stack_var alpha)) + ~aft:(item bytes (stack_var alpha)) + ~replacement: + [ + Context_blind (fun () -> M.Instructions.blake2b); + Context_blind (fun () -> M.Instructions.sha256); + Context_blind (fun () -> M.Instructions.sha512); + ] + (); + replacement + ~fresh_stack:[alpha] + ~bef:(item int (stack_var alpha)) + ~aft:(item bool (stack_var alpha)) + ~replacement:[Context_blind (fun () -> M.Instructions.gt)] + (); + replacement + ~fresh_stack:[alpha] + ~bef:(item int (stack_var alpha)) + ~aft:(item nat (stack_var alpha)) + ~replacement:[Context_blind (fun () -> M.Instructions.abs)] + (); + replacement + ~fresh_stack:[alpha] + ~bef:(item int (item int (stack_var alpha))) + ~aft:(item int (stack_var alpha)) + ~replacement: + [ + Context_blind (fun () -> M.Instructions.add M.int_ty M.int_ty); + Context_blind (fun () -> M.Instructions.mul M.int_ty M.int_ty); + ] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (pair (var alpha) (var beta)) (stack_var gamma)) + ~aft:(item (var alpha) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.car)] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (pair (var alpha) (var beta)) (stack_var gamma)) + ~aft:(item (var beta) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.cdr)] + (); + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (item (var alpha) (stack_var gamma))) + ~aft:(item int (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.compare)] + (); + replacement + ~fresh_stack:[gamma] + ~bef:(item string (item string (stack_var gamma))) + ~aft:(item string (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.concat)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[beta; gamma] + ~bef:(item (var alpha) (stack_var beta)) + ~aft:(item (var alpha) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.(dip hole))] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[beta] + ~bef:(item (var alpha) (stack_var beta)) + ~aft:(stack_var beta) + ~replacement:[Context_blind (fun () -> M.Instructions.drop)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[beta] + ~bef:(item (var alpha) (stack_var beta)) + ~aft:(item (var alpha) (item (var alpha) (stack_var beta))) + ~replacement:[Context_blind (fun () -> M.Instructions.dup)] + (); + replacement + ~fresh:[] + ~fresh_stack:[alpha] + ~bef:(stack_var alpha) + ~aft:(item int (stack_var alpha)) + ~replacement: + [ + (* TODO : push random integer? *) + Context_blind + (fun () -> M.Instructions.push M.int_ty (M.Data.integer 100)); + ] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (item (var beta) (stack_var gamma))) + ~aft:(item (var beta) (item (var alpha) (stack_var gamma))) + ~replacement:[Context_blind (fun () -> M.Instructions.swap)] + (); + (* control *) + replacement + ~fresh_stack:[alpha] + ~bef:(item bool (stack_var alpha)) + ~aft:(stack_var alpha) + ~replacement:[Context_blind (fun () -> M.Instructions.(loop hole))] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (union (var alpha) (var beta)) (stack_var gamma)) + ~aft:(item (var beta) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.(loop_left hole))] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[beta; gamma] + ~bef:(item (option (var alpha)) (stack_var beta)) + ~aft:(stack_var gamma) + ~replacement: + [Context_blind (fun () -> M.Instructions.(if_none hole hole))] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma; delta] + ~bef:(item (union (var alpha) (var beta)) (stack_var gamma)) + ~aft:(stack_var delta) + ~replacement: + [Context_blind (fun () -> M.Instructions.(if_left hole hole))] + (); + replacement + ~fresh:[] + ~fresh_stack:[alpha; beta] + ~bef:(item bool (stack_var alpha)) + ~aft:(stack_var beta) + ~replacement:[Context_blind (fun () -> M.Instructions.(if_ hole hole))] + (); + replacement + ~fresh_stack:[alpha; beta] + ~bef:(stack_var alpha) + ~aft:(stack_var beta) + ~replacement: + [ + Context_blind + (fun () -> M.seq [M.Instructions.hole; M.Instructions.hole]); + ] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (stack_var gamma)) + ~aft:(item (union (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.left)] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (var beta) (stack_var gamma)) + ~aft:(item (union (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.right)] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(stack_var gamma) + ~aft:(item (lambda (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.(lambda [hole]))] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(stack_var gamma) + ~aft:(item (lambda (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.(lambda [hole]))] + (); + (* set/map/list*) + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef: + (item + (var alpha) + (item bool (item (set (var alpha)) (stack_var gamma)))) + ~aft:(item (set (var alpha)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.update_set)] + (); + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef:(stack_var gamma) + ~aft:(item (set (var alpha)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.empty_set)] + (); + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef:(item (set (var alpha)) (stack_var gamma)) + ~aft:(stack_var gamma) + ~replacement: + [Context_blind (fun () -> M.Instructions.(iter_set [hole]))] + (); + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (item (set (var alpha)) (stack_var gamma))) + ~aft:(item bool (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.mem_set)] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef: + (item + (var alpha) + (item + (option (var beta)) + (item (map (var alpha) (var beta)) (stack_var gamma)))) + ~aft:(item (map (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.update_map)] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(stack_var gamma) + ~aft:(item (map (var alpha) (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.empty_map)] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (map (var alpha) (var beta)) (stack_var gamma)) + ~aft:(stack_var gamma) + ~replacement: + [Context_blind (fun () -> M.Instructions.(iter_map [hole]))] + (); + replacement + ~fresh:[Cmp alpha; Plain beta; Plain delta] + ~fresh_stack:[gamma] + ~bef:(item (map (var alpha) (var beta)) (stack_var gamma)) + ~aft:(item (map (var alpha) (var delta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.(map_map [hole]))] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef: + (item + (var alpha) + (item (map (var alpha) (var beta)) (stack_var gamma))) + ~aft:(item bool (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.mem_map)] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef: + (item + (var alpha) + (item (map (var alpha) (var beta)) (stack_var gamma))) + ~aft:(item (option (var beta)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.get_map)] + (); + (* lists *) + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(stack_var gamma) + ~aft:(item (list (var alpha)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.nil)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (item (list (var alpha)) (stack_var gamma))) + ~aft:(item (list (var alpha)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.cons)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(item (list (var alpha)) (stack_var gamma)) + ~aft:(stack_var gamma) + ~replacement: + [Context_blind (fun () -> M.Instructions.(iter_list [hole]))] + (); + replacement + ~fresh:[Plain alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (list (var alpha)) (stack_var gamma)) + ~aft:(item (list (var beta)) (stack_var gamma)) + ~replacement: + [Context_blind (fun () -> M.Instructions.(map_list [hole]))] + (); + (* sizes *) + replacement + ~fresh:[Cmp alpha] + ~fresh_stack:[gamma] + ~bef:(item (set (var alpha)) (stack_var gamma)) + ~aft:(item nat (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.size_set)] + (); + replacement + ~fresh:[Cmp alpha; Plain beta] + ~fresh_stack:[gamma] + ~bef:(item (map (var alpha) (var beta)) (stack_var gamma)) + ~aft:(item nat (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.size_map)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(item (list (var alpha)) (stack_var gamma)) + ~aft:(item nat (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.size_list)] + (); + replacement + ~fresh:[] + ~fresh_stack:[gamma] + ~bef:(item string (stack_var gamma)) + ~aft:(item nat (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.size_string)] + (); + replacement + ~fresh:[] + ~fresh_stack:[gamma] + ~bef:(item bytes (stack_var gamma)) + ~aft:(item nat (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.size_bytes)] + (); + (* pack/unpack *) + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(item (var alpha) (stack_var gamma)) + ~aft:(item bytes (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.pack)] + (); + replacement + ~fresh:[Plain alpha] + ~fresh_stack:[gamma] + ~bef:(item bytes (stack_var gamma)) + ~aft:(item (option (var alpha)) (stack_var gamma)) + ~replacement:[Context_blind (fun () -> M.Instructions.unpack)] + (); + ] + + let rules = + [ + replace_any_instr_by_hole; + {rule_patt = match_instr_hole; replacements = instructions}; + ] +end + +module Data_rewrite_leaves + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) = +struct + let hole_patt = + let open Patt in + prim_pred (fun prim -> prim = D_Hole) list_empty + + (* Matches a data hole *) + let match_hole = + let open Patt in + Pattern (focus hole_patt) + + (* Matches an integer literal *) + let match_int = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Int) list_any)) + + (* Matches a list literal *) + let match_list = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_List) list_any)) + + (* Matches a set literal *) + let match_set = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Set) list_any)) + + (* Matches a map literal *) + let match_map = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Map) list_any)) + + (* Matches a timestamp literal *) + let match_timestamp = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Timestamp) list_any)) + + (* Matches a mutez literal *) + let match_mutez = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Mutez) list_any)) + + (* Matches a key_hash literal *) + let match_key_hash = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_Key_hash) list_any)) + + let match_int_mutez_timestamp_key_hash_key_or_none = + let open Patt in + Pattern + (focus + (prim_pred + (function + | A_Int | A_Nat | A_Mutez | A_Timestamp | A_Key_hash | A_Key + | D_None -> + true + | _ -> false) + list_any)) + + (* Matches an empty list, set or map literal *) + let match_empty_list_set_or_map = + let open Patt in + Pattern + (focus + (prim_pred + (function A_List | A_Set | A_Map -> true | _ -> false) + (list_cons (seq list_empty) list_empty))) + + (* Matches a pair containing two holes*) + let match_empty_pair = + let open Patt in + Pattern + (focus + (prim_pred + (fun prim -> prim = D_Pair) + (list_cons hole_patt (list_cons hole_patt list_empty)))) + + (* Match a Some, Left or Right containing a hole *) + let match_empty_some_left_or_right = + let open Patt in + Pattern + (focus + (prim_pred + (function D_Left | D_Right | D_Some -> true | _ -> false) + (list_cons hole_patt list_empty))) + + (* Match a None constructor *) + let match_none = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = D_None) list_empty)) + + (* rules *) + + (* fresh type variables *) + let alpha, beta = (-1, -2) + + let replacement ~fresh ~typ ~replacement = + { + type_constraint = Data_cnstrnt {cnstrnt = typ; fresh}; + replacement = [Context_blind (fun () -> replacement)]; + } + + let replacement_gen ~fresh ~typ ~replacement = + { + type_constraint = Data_cnstrnt {cnstrnt = typ; fresh}; + replacement = [Context_blind replacement]; + } + + let fill_in_hole rng_state = + let replace_by_singleton_list = + replacement + ~fresh:[alpha] + ~typ:Type.(list (var alpha)) + ~replacement:Mikhailsky.Data.(list [hole]) + in + let replace_by_empty_pair = + replacement + ~fresh:[alpha; beta] + ~typ:Type.(pair (var alpha) (var beta)) + ~replacement:Mikhailsky.Data.(pair hole hole) + in + let replace_by_singleton_set = + replacement + ~fresh:[alpha] + ~typ:Type.(set (var alpha)) + ~replacement:Mikhailsky.Data.(set [hole]) + in + let replace_by_singleton_map = + replacement + ~fresh:[alpha; beta] + ~typ:Type.(map (var alpha) (var beta)) + ~replacement:Mikhailsky.Data.(map [map_elt hole hole]) + in + let replace_by_random_int rng_state = + let type_constraint = Data_cnstrnt {cnstrnt = Type.int; fresh = []} in + let replacement = + Context_blind + (fun () -> + Mikhailsky.Data.big_integer + (Protocol.Script_int.to_zint (Michelson_base.int rng_state))) + in + {type_constraint; replacement = [replacement]} + in + let replace_by_left = + replacement + ~fresh:[alpha; beta] + ~typ:Type.(union (var alpha) (var beta)) + ~replacement:Mikhailsky.Data.(left hole) + in + let replace_by_right = + replacement + ~fresh:[alpha; beta] + ~typ:Type.(union (var alpha) (var beta)) + ~replacement:Mikhailsky.Data.(right hole) + in + let replace_by_some = + replacement + ~fresh:[alpha] + ~typ:Type.(option (var alpha)) + ~replacement:Mikhailsky.Data.(some hole) + in + let replace_by_none = + replacement + ~fresh:[alpha] + ~typ:Type.(option (var alpha)) + ~replacement:Mikhailsky.Data.none + in + let replace_by_mutez rng_state = + replacement_gen ~fresh:[] ~typ:Type.mutez ~replacement:(fun () -> + Mikhailsky.Data.mutez (Michelson_base.tez rng_state)) + in + let replace_by_key_hash rng_state = + replacement_gen ~fresh:[] ~typ:Type.key_hash ~replacement:(fun () -> + Mikhailsky.Data.key_hash (Crypto_samplers.pkh rng_state)) + in + let replace_by_key rng_state = + replacement_gen ~fresh:[] ~typ:Type.key ~replacement:(fun () -> + Mikhailsky.Data.key (Crypto_samplers.pk rng_state)) + in + { + rule_patt = match_hole; + replacements = + [ + replace_by_singleton_list; + replace_by_empty_pair; + replace_by_singleton_set; + replace_by_singleton_map; + replace_by_random_int rng_state; + replace_by_left; + replace_by_right; + replace_by_some; + replace_by_none; + replace_by_mutez rng_state; + replace_by_key_hash rng_state; + replace_by_key rng_state; + ]; + } + + let kill_empty_pair = + { + rule_patt = match_empty_pair; + replacements = + [ + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.Data.hole)]; + }; + ]; + } + + let kill_int_mutez_timestamp_key_hash_none = + { + rule_patt = match_int_mutez_timestamp_key_hash_key_or_none; + replacements = + [ + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.Data.hole)]; + }; + ]; + } + + let kill_empty_list_set_or_map = + { + rule_patt = match_empty_list_set_or_map; + replacements = + [ + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.Data.hole)]; + }; + ]; + } + + let kill_empty_some_left_or_right = + { + rule_patt = match_empty_some_left_or_right; + replacements = + [ + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.Data.hole)]; + }; + ]; + } + + let modify_set = + let grow_ungrow_set = + { + type_constraint = No_cnstrnt; + replacement = + [ + Context_aware + (fun set -> + match set with + | Micheline.Prim (_, A_Set, [Micheline.Seq (_, elements)], _) -> + Mikhailsky.Data.(set (hole :: elements)) + | _ -> assert false); + Context_aware + (fun set -> + match set with + | Micheline.Prim (_, A_Set, [Micheline.Seq (_, elements)], _) + -> ( + match elements with + | [] -> Mikhailsky.Data.hole + | _ :: tl -> Mikhailsky.Data.set tl) + | _ -> assert false); + ]; + } + in + {rule_patt = match_set; replacements = [grow_ungrow_set]} + + let modify_map = + let grow_ungrow_map = + { + type_constraint = No_cnstrnt; + replacement = + [ + Context_aware + (fun set -> + match set with + | Micheline.Prim (_, A_Map, [Micheline.Seq (_, elements)], _) -> + Mikhailsky.Data.(map (map_elt hole hole :: elements)) + | _ -> assert false); + Context_aware + (fun set -> + match set with + | Micheline.Prim (_, A_Map, [Micheline.Seq (_, elements)], _) + -> ( + match elements with + | [] -> Mikhailsky.Data.hole + | _ :: tl -> Mikhailsky.Data.map tl) + | _ -> assert false); + ]; + } + in + {rule_patt = match_map; replacements = [grow_ungrow_map]} + + let modify_list = + let grow_ungrow_list = + { + type_constraint = No_cnstrnt; + replacement = + [ + Context_aware + (fun list -> + match list with + | Micheline.Prim (_, A_List, [Micheline.Seq (_, terms)], _) -> + Mikhailsky.Data.(list (hole :: terms)) + | _ -> assert false); + Context_aware + (fun list -> + match list with + | Micheline.Prim (_, A_List, [Micheline.Seq (_, terms)], _) -> ( + match terms with + | [] -> Mikhailsky.Data.hole + | _ :: tl -> Mikhailsky.Data.list tl) + | _ -> assert false); + ]; + } + in + {rule_patt = match_list; replacements = [grow_ungrow_list]} + + let rules rng_state = + [ + fill_in_hole rng_state; + kill_empty_pair; + kill_empty_list_set_or_map; + kill_empty_some_left_or_right; + kill_int_mutez_timestamp_key_hash_none; + modify_list; + modify_set; + modify_map; + ] +end + +module Data + (Michelson_base : Michelson_samplers_base.S) + (Crypto_samplers : Crypto_samplers.Finite_key_pool_S) = +struct + let match_data_node = + let open Patt in + Pattern + (focus + (prim_pred + (function + | Mikhailsky_prim.D_Elt | D_Hole -> false + | D_False | D_Left | D_None | D_Pair | D_Right | D_Some | D_True + | D_Unit | A_Int | A_Nat | A_Set | A_List | A_Map | A_Key_hash + | A_Mutez | A_Timestamp | A_Key -> + true + | _ -> false) + list_any)) + + let match_list = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = A_List) list_any)) + + let match_data_hole = + let open Patt in + Pattern (focus (prim_pred (fun prim -> prim = D_Hole) list_any)) + + let replace_by_hole = + let replace_by_hole = + { + type_constraint = No_cnstrnt; + replacement = [Context_blind (fun () -> Mikhailsky.Data.hole)]; + } + in + {rule_patt = match_data_node; replacements = [replace_by_hole]} + + let pack_root = + let replacement = + [ + Context_aware (fun node -> Mikhailsky.Data.list [node]); + Context_aware (fun node -> Mikhailsky.Data.(pair node hole)); + Context_aware (fun node -> Mikhailsky.Data.(pair hole node)); + ] + in + let guarded_replacements = [{type_constraint = No_cnstrnt; replacement}] in + {rule_patt = Root; replacements = guarded_replacements} + + module Data_rewrite_leaves_rules = + Data_rewrite_leaves (Michelson_base) (Crypto_samplers) + + let rules rng_state = + [ + Data_rewrite_leaves_rules.fill_in_hole rng_state; + replace_by_hole; + Data_rewrite_leaves_rules.modify_list; + Data_rewrite_leaves_rules.modify_map; + Data_rewrite_leaves_rules.modify_set; + ] +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/sampling_helpers.ml b/src/proto_016_PtMumbai/lib_benchmark/sampling_helpers.ml new file mode 100644 index 000000000000..8b36fc09e0bf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/sampling_helpers.ml @@ -0,0 +1,41 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* ------------------------------------------------------------------------- *) + +(* TODO: use Statz's def. of sampler once upstreamed. *) +type 'a sampler = Random.State.t -> 'a + +module M = struct + let ( let* ) : 'a sampler -> ('a -> 'b sampler) -> 'b sampler = + fun sampler f rng_state -> + let x = sampler rng_state in + f x rng_state + [@@inline] + + let bind = ( let* ) + + let return x _ = x +end diff --git a/src/proto_016_PtMumbai/lib_benchmark/state_space.ml b/src/proto_016_PtMumbai/lib_benchmark/state_space.ml new file mode 100644 index 000000000000..60d14970e610 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/state_space.ml @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* The state of rewriting is a typed term *) +type t = {typing : Inference.state lazy_t; term : Mikhailsky.node} + +let compare (term1 : t) (term2 : t) = + let tag1 = Mikhailsky.tag term1.term in + let tag2 = Mikhailsky.tag term2.term in + if tag1 < tag2 then -1 else if tag1 > tag2 then 1 else 0 + +let equal (term1 : t) (term2 : t) = + let tag1 = Mikhailsky.tag term1.term in + let tag2 = Mikhailsky.tag term2.term in + tag1 = tag2 + +let hash (t : t) = Mikhailsky.hash t.term + +type node_statistics = { + mutable size : int; + mutable bytes : int; + mutable holes : int; + mutable depth : int; +} + +let pp_statistics fmtr stats = + Format.fprintf + fmtr + "{ size = %d ; bytes = %d ; holes = %d }" + stats.size + stats.bytes + stats.holes + +let rec statistics stats depth (n : Mikhailsky.node) = + stats.size <- stats.size + 1 ; + stats.depth <- max depth stats.depth ; + match n with + | Micheline.Int (_, z) -> stats.bytes <- stats.bytes + (Z.numbits z / 8) + | Micheline.String (_, s) -> stats.bytes <- stats.bytes + String.length s + | Micheline.Bytes (_, b) -> stats.bytes <- stats.bytes + Bytes.length b + | Micheline.Prim (_, Mikhailsky_prim.I_Hole, _, _) + | Micheline.Prim (_, Mikhailsky_prim.D_Hole, _, _) -> + stats.holes <- stats.holes + 1 + | Micheline.Prim (_, _, subterms, _) | Micheline.Seq (_, subterms) -> + List.iter (statistics stats (depth + 1)) subterms + +let statistics {term; _} = + let stats = {size = 0; bytes = 0; holes = 0; depth = 0} in + statistics stats 0 term ; + stats + +let pp fmtr (state : t) = + Format.fprintf fmtr "current term:@." ; + Format.fprintf fmtr "%a@." Mikhailsky.pp state.term ; + Format.fprintf fmtr "stats:@." ; + Format.fprintf fmtr "%a:@." pp_statistics (statistics state) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/dune b/src/proto_016_PtMumbai/lib_benchmark/test/dune new file mode 100644 index 000000000000..6cf42fc7f09e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/dune @@ -0,0 +1,38 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executables + (names + test_sampling_data + test_sampling_code + test_autocompletion + test_distribution) + (libraries + tezos-base + tezos-micheline + tezos-micheline-rewriting + tezos-protocol-alpha + tezos-benchmark + tezos-benchmark-type-inference-alpha + tezos-benchmark-alpha + tezos-alpha-test-helpers + tezos-error-monad + alcotest-lwt + prbnmcn-stats) + (flags + (:standard) + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_micheline + -open Tezos_protocol_alpha + -open Tezos_benchmark + -open Tezos_benchmark_type_inference_alpha + -open Tezos_benchmark_alpha + -open Tezos_alpha_test_helpers)) + +(rule + (alias runtest_micheline_rewriting_data) + (action (run %{exe:test_sampling_data.exe} 1234))) + +(rule + (alias runtest_micheline_rewriting_code) + (action (run %{exe:test_sampling_code.exe} 1234))) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/test_autocompletion.ml b/src/proto_016_PtMumbai/lib_benchmark/test/test_autocompletion.ml new file mode 100644 index 000000000000..c2f3e6c74295 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/test_autocompletion.ml @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let rng_state = Random.State.make [|42; 987897; 54120|] + +module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let algo = `Default + + let size = 16 +end) + +module Michelson_base_samplers = Michelson_samplers_base.Make (struct + let parameters = + let size = {Base_samplers.min = 4; max = 32} in + { + Michelson_samplers_base.int_size = size; + string_size = size; + bytes_size = size; + } +end) + +module Autocomp = Autocomp.Make (Michelson_base_samplers) (Crypto_samplers) + +let () = Format.eprintf "===============================@.%!" + +let () = Format.eprintf "Testing dummy program generator@.%!" + +let run x = x rng_state (Inference.M.empty ()) + +let invent_term bef aft = + let term, _state = run (Autocomp.invent_term bef aft) in + Mikhailsky.seq term + +let invent_term bef aft = + Format.eprintf + "requested type: %a => %a@." + Type.Stack.pp + bef + Type.Stack.pp + aft ; + let term = invent_term bef aft in + let bef', aft' = Inference.infer term in + Format.eprintf + "generated type: %a => %a@." + Type.Stack.pp + bef' + Type.Stack.pp + aft' ; + Format.eprintf "%a@." Mikhailsky.pp term + +module T = Type + +let bef = T.(item unit (item unit (item unit empty))) + +let aft = T.(item int (item unit (item (pair nat nat) empty))) + +let () = invent_term bef aft + +let () = Format.eprintf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~@.%!" + +let () = invent_term bef aft + +let () = Format.eprintf "===============================@.%!" + +let () = Format.eprintf "Testing completion@.%!" + +let complete term = + Format.eprintf "term: %a@." Mikhailsky.pp term ; + let (bef, aft), state = Inference.infer_with_state term in + Format.eprintf "Inferred type: %a => %a@." Type.Stack.pp bef Type.Stack.pp aft ; + let term, (bef', aft'), _state = + Autocomp.complete_code state term rng_state + in + Format.eprintf "completed: %a@." Mikhailsky.pp term ; + Format.eprintf + "Inferred type after generation: %a => %a@." + Type.Stack.pp + bef' + Type.Stack.pp + aft' ; + let node = + Micheline.strip_locations @@ Mikhailsky_to_michelson.convert term state + in + let bef' = Type_helpers.stack_type_to_michelson_type_list bef' in + Test_helpers.typecheck_by_tezos bef' node + +open Mikhailsky +open Instructions + +let push_int = Instructions.push int_ty (Data.big_integer (Z.of_int 100)) + +let add_ii = Instructions.(add Mikhailsky.int_ty Mikhailsky.int_ty) + +let () = complete (lambda [if_left right (dip (seq [push_int; hole]))]) + +let () = Format.eprintf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~@.%!" + +let () = complete (seq [push_int; add_ii; lambda [dip (seq [dup; dip hole])]]) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/test_distribution.ml b/src/proto_016_PtMumbai/lib_benchmark/test/test_distribution.ml new file mode 100644 index 000000000000..7822b5b6e08c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/test_distribution.ml @@ -0,0 +1,152 @@ +open Michelson_samplers +open Protocol +open Internal_for_tests + +let pp_type_name fmtr (t : type_name) = + Format.pp_print_string fmtr + @@ + match t with + | `TString -> "string" + | `TNat -> "nat" + | `TPair -> "pair" + | `TKey -> "key" + | `TLambda -> "lambda" + | `TUnion -> "union" + | `TOperation -> "operation" + | `TOption -> "option" + | `TSapling_state -> "sapling_state" + | `TBytes -> "bytes" + | `TChain_id -> "chain_id" + | `TBool -> "bool" + | `TBls12_381_g2 -> "bls12_381_g2" + | `TTicket -> "ticket" + | `TMap -> "map" + | `TAddress -> "address" + | `TTx_rollup_l2_address -> "tx_rollup_l2_address" + | `TContract -> "contract" + | `TBls12_381_fr -> "bls12_381_fr" + | `TSapling_transaction -> "sapling_transaction" + | `TSapling_transaction_deprecated -> "sapling_transaction_deprecated" + | `TTimestamp -> "timestamp" + | `TKey_hash -> "key_hash" + | `TBig_map -> "big_map" + | `TSet -> "set" + | `TBls12_381_g1 -> "bls12_381_g1" + | `TList -> "list" + | `TMutez -> "mutez" + | `TSignature -> "signature" + | `TUnit -> "unit" + | `TInt -> "int" + +module Type_name = struct + type t = type_name + + let equal (x : t) (y : t) = x = y + + let pp = pp_type_name + + let hash = Stdlib.Hashtbl.hash +end + +module Type_name_hashtbl = Stdlib.Hashtbl.Make (Type_name) + +let rec tnames_of_type : + type a ac. (a, ac) Script_typed_ir.ty -> type_name list -> type_name list = + fun t acc -> + match t with + | Script_typed_ir.Unit_t -> `TUnit :: acc + | Script_typed_ir.Int_t -> `TInt :: acc + | Script_typed_ir.Nat_t -> `TNat :: acc + | Script_typed_ir.Signature_t -> `TSignature :: acc + | Script_typed_ir.String_t -> `TString :: acc + | Script_typed_ir.Bytes_t -> `TBytes :: acc + | Script_typed_ir.Mutez_t -> `TMutez :: acc + | Script_typed_ir.Key_hash_t -> `TKey_hash :: acc + | Script_typed_ir.Key_t -> `TKey :: acc + | Script_typed_ir.Timestamp_t -> `TTimestamp :: acc + | Script_typed_ir.Address_t -> `TAddress :: acc + | Script_typed_ir.Tx_rollup_l2_address_t -> `TTx_rollup_l2_address :: acc + | Script_typed_ir.Bool_t -> `TBool :: acc + | Script_typed_ir.Pair_t (lty, rty, _, _) -> + tnames_of_type lty (tnames_of_type rty (`TPair :: acc)) + | Script_typed_ir.Union_t (lty, rty, _, _) -> + tnames_of_type lty (tnames_of_type rty (`TUnion :: acc)) + | Script_typed_ir.Lambda_t (dom, range, _) -> + tnames_of_type dom (tnames_of_type range (`TLambda :: acc)) + | Script_typed_ir.Option_t (ty, _, _) -> tnames_of_type ty (`TOption :: acc) + | Script_typed_ir.List_t (ty, _) -> tnames_of_type ty (`TList :: acc) + | Script_typed_ir.Set_t (ty, _) -> tnames_of_type ty (`TSet :: acc) + | Script_typed_ir.Map_t (kty, vty, _) -> + tnames_of_type kty (tnames_of_type vty (`TMap :: acc)) + | Script_typed_ir.Big_map_t (kty, vty, _) -> + tnames_of_type kty (tnames_of_type vty (`TBig_map :: acc)) + | Script_typed_ir.Contract_t (ty, _) -> tnames_of_type ty (`TContract :: acc) + | Script_typed_ir.Sapling_transaction_t _ -> `TSapling_transaction :: acc + | Script_typed_ir.Sapling_transaction_deprecated_t _ -> + `TSapling_transaction_deprecated :: acc + | Script_typed_ir.Sapling_state_t _ -> `TSapling_state :: acc + | Script_typed_ir.Operation_t -> `TOperation :: acc + | Script_typed_ir.Chain_id_t -> `TChain_id :: acc + | Script_typed_ir.Never_t -> assert false + | Script_typed_ir.Bls12_381_g1_t -> `TBls12_381_g1 :: acc + | Script_typed_ir.Bls12_381_g2_t -> `TBls12_381_g2 :: acc + | Script_typed_ir.Bls12_381_fr_t -> `TBls12_381_fr :: acc + | Script_typed_ir.Ticket_t (ty, _) -> tnames_of_type ty (`TTicket :: acc) + | Script_typed_ir.Chest_key_t -> assert false + | Script_typed_ir.Chest_t -> assert false + +module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let algo = `Default + + let size = 16 +end) + +module Sampler = + Michelson_samplers.Make + (struct + let parameters = + { + base_parameters = + { + Michelson_samplers_base.int_size = {min = 8; max = 32}; + string_size = {min = 8; max = 128}; + bytes_size = {min = 8; max = 128}; + }; + list_size = {min = 10; max = 1000}; + set_size = {min = 10; max = 1000}; + map_size = {min = 10; max = 1000}; + } + end) + (Crypto_samplers) + +open Stats + +let tnames_dist : type_name list -> type_name Fin.Float.prb = + fun tnames -> + Emp.of_raw_data (Array.of_list tnames) + |> Fin.Float.counts_of_empirical (module Type_name_hashtbl) + |> Fin.Float.normalize + +let rec sample nsamples acc = + let open Sampling_helpers.M in + if nsamples = 0 then return acc + else + let* size = + Base_samplers.(sample_in_interval ~range:{min = 1; max = 1000}) + in + let* (Ex_ty ty) = Sampler.Random_type.m_type ~size in + let* acc = sample (nsamples - 1) acc in + return (tnames_of_type ty acc) + +let sample nsamples = sample nsamples [] + +let dist nsamples = + let open Sampling_helpers.M in + let* samples = sample nsamples in + return (tnames_dist samples) + +let () = + Format.printf + "stats:@.%a@." + (Fin.Float.pp_fin_mes Type_name.pp) + (Fin.Float.as_measure (dist 500 (Random.State.make [|0x1337; 0x533D|]))) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/test_helpers.ml b/src/proto_016_PtMumbai/lib_benchmark/test/test_helpers.ml new file mode 100644 index 000000000000..5677355b0bb9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/test_helpers.ml @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let rng_state = Random.State.make [|42; 987897; 54120|] + +let print_script_expr fmtr (expr : Protocol.Script_repr.expr) = + Micheline_printer.print_expr + fmtr + (Micheline_printer.printable + Protocol.Michelson_v1_primitives.string_of_prim + expr) + +let print_script_expr_list fmtr (exprs : Protocol.Script_repr.expr list) = + Format.pp_print_list + ~pp_sep:(fun fmtr () -> Format.fprintf fmtr " :: ") + print_script_expr + fmtr + exprs + +let typecheck_by_tezos = + let context_init_memory ~rng_state = + Context.init_n + ~rng_state + ~bootstrap_balances: + [ + 4_000_000_000_000L; + 4_000_000_000_000L; + 4_000_000_000_000L; + 4_000_000_000_000L; + 4_000_000_000_000L; + ] + 5 + () + >>=? fun (block, _accounts) -> + Context.get_constants (B block) >>=? fun csts -> + let minimal_block_delay = + Protocol.Alpha_context.Period.to_seconds + csts.parametric.minimal_block_delay + in + Incremental.begin_construction + ~timestamp: + (Tezos_base.Time.Protocol.add + block.header.shell.timestamp + minimal_block_delay) + block + >>=? fun vs -> + let ctxt = Incremental.alpha_ctxt vs in + (* Required for eg Create_contract *) + return + @@ Protocol.Alpha_context.Origination_nonce.init + ctxt + Tezos_crypto.Operation_hash.zero + in + fun bef node -> + Stdlib.Result.get_ok + (Lwt_main.run + ( context_init_memory ~rng_state >>=? fun ctxt -> + let (Protocol.Script_ir_translator.Ex_stack_ty bef) = + Type_helpers.michelson_type_list_to_ex_stack_ty bef ctxt + in + Protocol.Script_ir_translator.parse_instr + Protocol.Script_tc_context.data + ctxt + ~elab_conf: + (Protocol.Script_ir_translator_config.make ~legacy:false ()) + (Micheline.root node) + bef + >|= Environment.wrap_tzresult + >>=? fun _ -> return_unit )) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_code.ml b/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_code.ml new file mode 100644 index 000000000000..e5e8edf378d5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_code.ml @@ -0,0 +1,96 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Input parameter parsing *) + +let verbose = + if Array.length Sys.argv < 2 then ( + Format.eprintf "Executable expects random seed on input\n%!" ; + exit 1) + else + (Random.init (int_of_string Sys.argv.(1)) ; + List.exists (( = ) "-v")) + (Array.to_list Sys.argv) + +(* ------------------------------------------------------------------------- *) +(* Base sampler parameters *) + +let state = Random.State.make [|42; 987897; 54120|] + +module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let algo = `Default + + let size = 16 +end) + +module Michelson_base_samplers = Michelson_samplers_base.Make (struct + let parameters = + let size = {Base_samplers.min = 4; max = 32} in + { + Michelson_samplers_base.int_size = size; + string_size = size; + bytes_size = size; + } +end) + +(* ------------------------------------------------------------------------- *) +(* MCMC instantiation *) + +module Code = + Michelson_mcmc_samplers.Make_code_sampler + (Michelson_base_samplers) + (Crypto_samplers) + (struct + let rng_state = state + + let target_size = 500 + + let verbosity = if verbose then `Trace else `Silent + end) + +let start = Unix.gettimeofday () + +let generator = Code.generator ~burn_in:(500 * 7) state + +let stop = Unix.gettimeofday () + +let () = Format.printf "Burn in time: %f seconds@." (stop -. start) + +let _ = + for i = 1 to 1000 do + let Michelson_mcmc_samplers.{term = michelson; bef; aft} = + generator state + in + Test_helpers.typecheck_by_tezos bef michelson ; + if verbose then ( + Format.eprintf "result %d/1000:@." i ; + Format.eprintf + "type: %a => %a@." + Test_helpers.print_script_expr_list + bef + Test_helpers.print_script_expr_list + aft ; + Format.eprintf "%a@." Test_helpers.print_script_expr michelson) + done diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_data.ml b/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_data.ml new file mode 100644 index 000000000000..fb67a046d1ef --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/test/test_sampling_data.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Input parameter parsing *) + +let verbose = + if Array.length Sys.argv < 2 then ( + Format.eprintf "Executable expects random seed on input\n%!" ; + exit 1) + else + (Random.init (int_of_string Sys.argv.(1)) ; + List.exists (( = ) "-v")) + (Array.to_list Sys.argv) + +(* ------------------------------------------------------------------------- *) +(* MCMC instantiation *) + +let state = Random.State.make [|42; 987897; 54120|] + +module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let algo = `Default + + let size = 16 +end) + +module Michelson_base_samplers = Michelson_samplers_base.Make (struct + let parameters = + let size = {Base_samplers.min = 4; max = 32} in + { + Michelson_samplers_base.int_size = size; + string_size = size; + bytes_size = size; + } +end) + +module Data = + Michelson_mcmc_samplers.Make_data_sampler + (Michelson_base_samplers) + (Crypto_samplers) + (struct + let rng_state = state + + let target_size = 500 + + let verbosity = if verbose then `Trace else `Silent + end) + +let start = Unix.gettimeofday () + +let generator = Data.generator ~burn_in:(200 * 7) state + +let stop = Unix.gettimeofday () + +let () = Format.printf "Burn in time: %f seconds@." (stop -. start) + +let _ = + for _i = 0 to 1000 do + let Michelson_mcmc_samplers.{term = michelson; typ} = generator state in + if verbose then ( + Format.eprintf "result:@." ; + Format.eprintf "type: %a@." Test_helpers.print_script_expr typ ; + Format.eprintf "%a@." Test_helpers.print_script_expr michelson) + done diff --git a/src/proto_016_PtMumbai/lib_benchmark/type_helpers.ml b/src/proto_016_PtMumbai/lib_benchmark/type_helpers.ml new file mode 100644 index 000000000000..989ee7782901 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/type_helpers.ml @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Type conversion helpers *) + +open Protocol + +exception Type_helpers_error of string + +let helpers_error msg = raise (Type_helpers_error msg) + +(* Convert a Micheline-encoded type to its internal GADT format. *) +let michelson_type_to_ex_ty (typ : Alpha_context.Script.expr) + (ctxt : Alpha_context.t) = + Script_ir_translator.parse_ty + ctxt + ~legacy:false + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:false + ~allow_ticket:false + (Micheline.root typ) + |> Environment.wrap_tzresult + |> function + | Ok (ex_ty, _ctxt) -> ex_ty + | Error errs -> + let msg = + Format.asprintf + "Michelson_generation.michelson_type_to_ex_ty (%a)" + Error_monad.pp_print_trace + errs + in + helpers_error msg + +(* Convert a list of Micheline-encoded Michelson types to the + internal GADT format. *) +let rec michelson_type_list_to_ex_stack_ty + (stack_ty : Alpha_context.Script.expr list) ctxt = + let open Script_ir_translator in + let open Script_typed_ir in + match stack_ty with + | [] -> Ex_stack_ty Bot_t + | hd :: tl -> ( + let ex_ty = michelson_type_to_ex_ty hd ctxt in + match ex_ty with + | Ex_ty ty -> ( + let ex_stack_ty = michelson_type_list_to_ex_stack_ty tl ctxt in + match ex_stack_ty with + | Ex_stack_ty tl -> Ex_stack_ty (Item_t (ty, tl)))) + +let base_type_to_michelson_type (typ : Type.Base.t) = + let typ = Mikhailsky.map_var (fun _ -> Mikhailsky.unit_ty) typ in + Mikhailsky.to_michelson typ + +(* Convert a Mikhailsky stack to a list of Micheline-encoded types *) +let rec stack_type_to_michelson_type_list (typ : Type.Stack.t) = + let node = typ.node in + match node with + | Type.Stack.Stack_var_t _ -> + helpers_error "stack_type_to_michelson_type_list: bug found" + | Type.Stack.Empty_t -> [] + | Type.Stack.Item_t (ty, tl) -> + base_type_to_michelson_type ty :: stack_type_to_michelson_type_list tl + +let base_type_to_ex_ty ty = + michelson_type_to_ex_ty (base_type_to_michelson_type ty) diff --git a/src/proto_016_PtMumbai/lib_benchmark/type_helpers.mli b/src/proto_016_PtMumbai/lib_benchmark/type_helpers.mli new file mode 100644 index 000000000000..0cf310d3afcf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmark/type_helpers.mli @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Type conversion helpers *) + +open Protocol + +(** Exception raised in case an error occurs in this module. *) +exception Type_helpers_error of string + +(** [michelson_type_list_to_ex_stack_ty] converts a list of types in + Micheline form to a stack type in IR form. + + @raise Type_helpers_error if parsing the Michelson type fails. + *) +val michelson_type_list_to_ex_stack_ty : + Alpha_context.Script.expr list -> + Alpha_context.t -> + Script_ir_translator.ex_stack_ty + +(** [michelson_type_to_ex_ty ty ctxt] parses the type [ty]. + + @raise Type_helpers_error if an error arises during parsing. *) +val michelson_type_to_ex_ty : + Alpha_context.Script.expr -> Alpha_context.t -> Script_typed_ir.ex_ty + +(** [stack_type_to_michelson_type_list] converts a Mikhailsky stack type + to a stack represented as a list of Micheline expressions, each + element denoting a type on the stack type. + + @raise Type_helpers_error if the stack type contains variables. *) +val stack_type_to_michelson_type_list : Type.Stack.t -> Script_repr.expr list + +(** [base_type_to_ex_ty] converts a Mikhailsky type to a Michelson one. *) +val base_type_to_ex_ty : Type.Base.t -> Alpha_context.t -> Script_typed_ir.ex_ty diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml new file mode 100644 index 000000000000..0f355441a7f0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/cache_benchmarks.ml @@ -0,0 +1,197 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let ns = Namespace.make Registration_helpers.ns "cache" + +let fv s = Free_variable.of_namespace (ns s) + +(** {2 [Alpha_context.Cache]-related benchmarks} *) + +let assert_ok_lwt x = + match Lwt_main.run x with Ok x -> x | Error _ -> assert false + +let assert_ok = function Ok x -> x | Error _ -> assert false + +module Admin = Alpha_context.Cache.Admin + +(** We can't construct a dummy cache client from outside the protocol. + We'll have to benchmark the {!Environment_cache} through the interface + exposed by {!Script_cache}. *) +module Cache = Script_cache + +(** {2 Constructing a dummy cached value} *) + +let make_context ~rng_state = + Execution_context.make ~rng_state |> assert_ok_lwt |> fst + +let throwaway_context = + let rng_state = Random.State.make [|0x1337; 0x533D|] in + make_context ~rng_state + +let dummy_script : Cache.cached_contract = + let str = "{ parameter unit; storage unit; code FAILWITH }" in + let storage = + let parsed, _ = Michelson_v1_parser.parse_expression "Unit" in + Alpha_context.Script.lazy_expr parsed.expanded + in + let code = + let parsed, _ = Michelson_v1_parser.parse_expression ~check:false str in + Alpha_context.Script.lazy_expr parsed.expanded + in + let script = Alpha_context.Script.{code; storage} in + let ex_script, _ = + Script_ir_translator.parse_script + throwaway_context + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage:false + script + |> assert_ok_lwt + in + (script, ex_script) + +(** {2 Creating dummy cache value identifiers.} *) + +(** Configuration shared among all cache benchmarks. *) +module Cache_shared_config = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = {cache_cardinal : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {cache_cardinal} -> cache_cardinal) + (fun cache_cardinal -> {cache_cardinal}) + (obj1 (req "cache_cardinal" int31)) + + let tags = [Tags.cache] + + let workload_to_vector {cache_cardinal} = + Sparse_vec.String.of_list [("cache_cardinal", float_of_int cache_cardinal)] +end + +(* We can't produce a Script_cache.identifier without calling [Script_cache.find]. *) +let identifier_of_contract (c : Contract_hash.t) : Cache.identifier = + let _, id, _ = Cache.find throwaway_context c |> assert_ok_lwt in + id + +let contract_of_int i : Contract_hash.t = + Contract_hash.(of_b58check_exn (to_b58check (hash_string [string_of_int i]))) + +let identifier_of_int i = identifier_of_contract @@ contract_of_int i + +(** Prepare a context with a cache of the prescribed cardinality. A key in the domain of + the cache is returned along the context: this key is used to benchmark + (successful) cache accesses. *) +let prepare_context rng_state cache_cardinal = + assert (cache_cardinal > 0) ; + let ctxt = make_context ~rng_state in + let some_key_in_domain = identifier_of_int 0 in + let rec loop i ctxt = + if Compare.Int.(i = cache_cardinal) then ctxt + else + let key = identifier_of_int i in + loop (i + 1) (Cache.update ctxt key dummy_script 1 |> assert_ok) + in + (loop 0 ctxt, some_key_in_domain) + +(** Benchmark {!Script_cache.update}. This almost directly calls {!Environment_cache.update}. + We also use the result of this benchmark to assign a cost to {!Environment_cache.find}, + which alas can't be directly benchmarked from the interface provided by {!Script_cache}. *) +module Cache_update_benchmark : Benchmark.S = struct + include Cache_shared_config + + let name = ns "CACHE_UPDATE" + + let info = "Benchmarking the time it takes to update a key in the cache" + + (** It is expected that cache keys are non-adversarial, + ie do not share a long common prefix. This is the case for [Script_cache], + for which the keys are B58-encoded contract hashes. + + To rephrase: with high probability, comparing two keys in the domain of the cache is + a constant-time operation (two keys will differ after the first few characters). + We therefore do not take into account the length of the key in the model. *) + let model = + let affine_logn ~intercept ~coeff = + let open Model in + let module M = struct + type arg_type = int * unit + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size + + let arity = arity_1 + + let model = + lam ~name:"size" @@ fun size -> + free ~name:intercept + (free ~name:coeff * log2 (int 1 + size)) + end + end in + (module M : Model_impl with type arg_type = int * unit) + in + (* Looking at the plots, it looks like this benchmark underestimates the constant term. + In the interpreter, this would warrant a dedicated benchmark for the intercept. *) + let intercept_variable = + fv (Format.asprintf "%s_const" (Namespace.basename name)) + in + let coeff_variable = + fv (Format.asprintf "%s_coeff" (Namespace.basename name)) + in + Model.make + ~conv:(function {cache_cardinal} -> (cache_cardinal, ())) + ~model:(affine_logn ~intercept:intercept_variable ~coeff:coeff_variable) + + let models = [("cache_model", model)] + + let cache_update_benchmark ctxt some_key_in_domain cache_cardinal = + let workload = {cache_cardinal} in + let closure () = + ignore (Cache.update ctxt some_key_in_domain dummy_script 1) + in + Generator.Plain {workload; closure} + + (** At the time of writing (Protocol H) the worst case execution path for + [Cache.update] is to update a key which is already present. *) + let make_bench rng_state _cfg () = + let cache_cardinal = + Base_samplers.sample_in_interval ~range:{min = 1; max = 100_000} rng_state + in + let ctxt, some_key_in_domain = prepare_context rng_state cache_cardinal in + cache_update_benchmark ctxt some_key_in_domain cache_cardinal + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Cache_update_benchmark) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml new file mode 100644 index 000000000000..60890f8ad524 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/carbonated_map_benchmarks.ml @@ -0,0 +1,351 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_benchmark + +let ns = Namespace.make Registration_helpers.ns "carbonated_map" + +let fv s = Free_variable.of_namespace (ns s) + +let make_context ~rng_state = + match Lwt_main.run @@ Execution_context.make ~rng_state with + | Ok (ctxt, _) -> ctxt + | Error _ -> assert false + +module Config_and_workload = struct + type config = {size : int} + + let config_encoding = + let open Data_encoding in + conv (fun {size} -> size) (fun size -> {size}) (obj1 (req "size" int31)) + + let default_config = {size = 100_000} + + type workload = config + + let tags = ["carbonated_map"] + + let workload_encoding = config_encoding + + let workload_to_vector {size} = + Sparse_vec.String.of_list [("size", float_of_int size)] +end + +(** Registers a benchmark and code generation models. *) +let register (module BM : Benchmark.S) = + Registration_helpers.register (module BM : Benchmark.S) ; + BM.models + |> List.iter (fun (_, model) -> + Registration_helpers.register_for_codegen + (Namespace.basename BM.name) + (Model.For_codegen model)) + +module Alpha_context_gas = struct + type context = Alpha_context.context + + let consume = Alpha_context.Gas.consume +end + +(** + Benchmarks the [fold] functions of [Carbonated_map]. + This benchmark does not depend on the size of the keys or types of elements. +*) +module Fold_benchmark : Benchmark.S = struct + include Config_and_workload + + module Int = struct + include Int + + (** Dummy value *) + let compare_cost _ = Saturation_repr.safe_int 0 + end + + let name = ns "fold" + + let info = "Carbonated map to list" + + let fold_model = + Model.make + ~conv:(fun {size} -> (size, ())) + ~model: + (Model.affine + ~intercept:(fv "fold_const") + ~coeff:(fv "fold_cost_per_item")) + + let models = [("carbonated_map", fold_model)] + + let benchmark rng_state config () = + let module M = Carbonated_map.Make (Alpha_context_gas) (Int) in + let _, list = + let sampler rng_state = + let key = Base_samplers.int rng_state ~size:{min = 1; max = 5} in + (* Value should not be important *) + let value = () in + (Z.to_int key, value) + in + Structure_samplers.list + rng_state + ~range:{min = 1; max = config.size} + ~sampler + in + let ctxt = make_context ~rng_state in + let map = + match + M.of_list + ctxt + ~merge_overlap:(fun ctxt _left right -> Ok (right, ctxt)) + list + with + | Ok (map, _) -> map + | _ -> assert false + in + let workload = {size = M.size map} in + let closure () = + ignore @@ M.fold_e ctxt (fun ctxt _ _ _ -> ok ((), ctxt)) () map + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) +end + +(** Module type that consists of a comparable type along with a sampler + function. *) +module type COMPARABLE_SAMPLER = sig + include Compare.COMPARABLE + + val type_name : string + + val sampler : t Base_samplers.sampler +end + +(** + Functor for constructing a benchmark for the cost of comparing values. This + functor can be used to generate [compare_cost] data for a particular + key-type for [Carbonated_map] instances. +*) +module Make (CS : COMPARABLE_SAMPLER) = struct + let compare_var type_name = fv (Printf.sprintf "compare_%s" type_name) + + module Compare = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = config + + let tags = ["carbonated_map"] + + let workload_encoding = config_encoding + + let workload_to_vector () = Sparse_vec.String.of_list [] + + let name = ns @@ Printf.sprintf "compare_%s" CS.type_name + + let info = + Printf.sprintf "Carbonated map compare cost for %s keys" CS.type_name + + let models = + [ + ( "carbonated_map", + Model.make + ~conv:(fun () -> ()) + ~model: + (Model.unknown_const2 + ~const1:Builtin_benchmarks.timer_variable + ~const2:(compare_var CS.type_name)) ); + ] + + let benchmark rng_state _conf () = + let key = CS.sampler rng_state in + let workload = () in + let closure () = ignore (CS.compare key key) in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + end + + module Find = struct + include Config_and_workload + + module M = + Carbonated_map.Make + (Alpha_context_gas) + (struct + include CS + + (** Dummy cost*) + let compare_cost _ = Saturation_repr.safe_int 0 + end) + + let name = ns "find" + + let info = Printf.sprintf "Carbonated find model" + + (** + Given the cost of comparing keys, the model is used for deducing [intercept] + and [traverse_overhead] from: + + [intercept + (log2 size * compare_cost) + (log2 size * traversal_overhead)] + *) + let find_model ~intercept ~traverse_overhead = + let module M = struct + type arg_type = int * unit + + module Def (L : Costlang.S) = struct + type model_type = L.size -> L.size + + let arity = Model.arity_1 + + let model = + let open L in + lam ~name:"size" @@ fun size -> + let compare_cost = + log2 size * free ~name:(compare_var CS.type_name) + in + let traversal_overhead = log2 size * free ~name:traverse_overhead in + free ~name:Builtin_benchmarks.timer_variable + + free ~name:intercept + compare_cost + traversal_overhead + end + end in + (module M : Model.Model_impl with type arg_type = int * unit) + + let models = + [ + ( "carbonated_map", + Model.make + ~conv:(fun {size} -> (size, ())) + ~model: + (find_model + ~intercept:(fv "intercept") + ~traverse_overhead:(fv "traversal_overhead")) ); + ] + + let benchmark rng_state (config : config) () = + let _, list = + let sampler rng_state = (CS.sampler rng_state, ()) in + Structure_samplers.list + rng_state + ~range:{min = 1; max = config.size} + ~sampler + in + let ctxt = make_context ~rng_state in + let map = + match + M.of_list ctxt ~merge_overlap:(fun ctxt _ _ -> Ok ((), ctxt)) list + with + | Ok (map, _) -> map + | _ -> assert false + in + (* Pick the min binding from the map to guarantee longest path. *) + let key = + match M.to_list ctxt map with + | Ok (kvs, _) -> ( + match List.hd kvs with Some (k, _) -> k | None -> assert false) + | Error _ -> assert false + in + let workload = {size = M.size map} in + let closure () = ignore @@ M.find ctxt key map in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + end + + module Find_intercept = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = config + + let tags = ["carbonated_map"] + + let workload_encoding = config_encoding + + let workload_to_vector () = Sparse_vec.String.of_list [] + + module M = + Carbonated_map.Make + (Alpha_context_gas) + (struct + include CS + + (** Dummy cost*) + let compare_cost _ = Saturation_repr.safe_int 0 + end) + + let name = ns "find_intercept" + + let info = Printf.sprintf "Carbonated find model (intercept case)" + + let models = + [ + ( "carbonated_map", + Model.make + ~conv:(fun () -> ()) + ~model: + (Model.unknown_const2 + ~const1:Builtin_benchmarks.timer_variable + ~const2:(fv "intercept")) ); + ] + + let benchmark rng_state (_config : config) () = + let ctxt = make_context ~rng_state in + let map = M.empty in + let key = CS.sampler rng_state in + let workload = () in + let closure () = ignore @@ M.find ctxt key map in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + end +end + +(** A comparable and a sampler for [int] values. *) +module Int = struct + type t = int + + let compare = Int.compare + + let type_name = "int" + + let sampler rng_state = + Z.to_int @@ Base_samplers.int rng_state ~size:{min = 1; max = 6} +end + +module Benchmarks_int = Make (Int) + +let () = + register (module Fold_benchmark) ; + register (module Benchmarks_int.Compare) ; + register (module Benchmarks_int.Find) ; + register (module Benchmarks_int.Find_intercept) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/dune b/src/proto_016_PtMumbai/lib_benchmarks_proto/dune new file mode 100644 index 000000000000..dfcf71e1bf12 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/dune @@ -0,0 +1,45 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_benchmarks_proto_alpha) + (public_name tezos-benchmarks-proto-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + str + tezos-stdlib + tezos-base + tezos-error-monad + tezos-protocol-alpha.parameters + tezos-lazy-containers + tezos-benchmark + tezos-benchmark-alpha + tezos-benchmark-type-inference-alpha + tezos-protocol-alpha + tezos-crypto + tezos-shell-benchmarks + tezos-micheline + tezos-alpha-test-helpers + tezos-sapling + tezos-client-alpha + tezos-protocol-plugin-alpha + tezos-protocol-environment) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_stdlib + -open Tezos_base + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_error_monad + -open Tezos_protocol_alpha_parameters + -open Tezos_lazy_containers + -open Tezos_benchmark + -open Tezos_benchmark_alpha + -open Tezos_benchmark_type_inference_alpha + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha.Protocol + -open Tezos_micheline + -open Tezos_alpha_test_helpers + -open Tezos_client_alpha + -open Tezos_protocol_plugin_alpha)) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml new file mode 100644 index 000000000000..590bd5638413 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/encodings_benchmarks.ml @@ -0,0 +1,479 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Size = Gas_input_size + +let ns = Namespace.make Registration_helpers.ns "encoding" + +let fv s = Free_variable.of_namespace (ns s) + +module Micheline_common = struct + let make_printable node = + Micheline_printer.printable + Michelson_v1_primitives.string_of_prim + (Micheline.strip_locations node) + + type phase = Trace_production | In_protocol | Global + + type error = + | Bad_micheline of { + benchmark_name : Namespace.t; + micheline : Alpha_context.Script.node; + phase : phase; + } + + exception Micheline_benchmark of error + + let pp_phase fmtr (phase : phase) = + match phase with + | Trace_production -> Format.fprintf fmtr "trace production" + | In_protocol -> Format.fprintf fmtr "in protocol" + | Global -> Format.fprintf fmtr "global" + + let pp_error fmtr = function + | Bad_micheline {benchmark_name; micheline; phase} -> + Format.open_vbox 1 ; + Format.fprintf fmtr "Bad micheline:@," ; + Format.fprintf fmtr "benchmark = %a@," Namespace.pp benchmark_name ; + Format.fprintf + fmtr + "expression = @[<v 1>%a@]@," + Micheline_printer.print_expr + (make_printable micheline) ; + Format.fprintf fmtr "phase = %a@," pp_phase phase ; + Format.close_box () + + let bad_micheline benchmark_name micheline phase = + raise + (Micheline_benchmark (Bad_micheline {benchmark_name; micheline; phase})) + + type workload = {size : Size.micheline_size; bytes : int} + + let workload_encoding = + let open Data_encoding in + def "encoding_micheline_trace" + @@ conv + (fun {size; bytes} -> (size, bytes)) + (fun (size, bytes) -> {size; bytes}) + (obj2 + (req "micheline_size" Size.micheline_size_encoding) + (req "micheline_bytes" Size.encoding)) + + let workload_to_vector (workload : workload) = + let keys = + [ + ( "encoding_micheline_traversal", + float_of_int (Size.to_int workload.size.traversal) ); + ( "encoding_micheline_int_bytes", + float_of_int (Size.to_int workload.size.int_bytes) ); + ( "encoding_micheline_string_bytes", + float_of_int (Size.to_int workload.size.string_bytes) ); + ("encoding_micheline_bytes", float_of_int (Size.to_int workload.bytes)); + ] + in + Sparse_vec.String.of_list keys + + let tags = [Tags.encoding] + + let model_size name = + Model.make + ~conv:(fun {size = {Size.traversal; int_bytes; string_bytes}; _} -> + (traversal, (int_bytes, (string_bytes, ())))) + ~model: + (Model.trilinear + ~coeff1:(fv (Format.asprintf "%s_micheline_traversal" name)) + ~coeff2:(fv (Format.asprintf "%s_micheline_int_bytes" name)) + ~coeff3:(fv (Format.asprintf "%s_micheline_string_bytes" name))) + + let model_bytes name = + Model.make + ~conv:(fun {bytes; _} -> (bytes, ())) + ~model: + (Model.linear ~coeff:(fv (Format.asprintf "%s_micheline_bytes" name))) + + let models name = + [("micheline", model_size name); ("micheline_bytes", model_bytes name)] +end + +module Encoding_micheline : Benchmark.S = struct + include Translator_benchmarks.Config + include Micheline_common + + let name = ns "ENCODING_MICHELINE" + + let info = "Benchmarking strip_location + encoding of Micheline to bytes" + + let micheline_serialization_trace (micheline_node : Alpha_context.Script.node) + = + match + Data_encoding.Binary.to_string + Protocol.Script_repr.expr_encoding + (Micheline.strip_locations micheline_node) + with + | Error err -> + Format.eprintf + "micheline_serialization_trace: %a@." + Data_encoding.Binary.pp_write_error + err ; + None + | Ok str -> + let micheline_size = Size.of_micheline micheline_node in + Some {size = micheline_size; bytes = Size.string str} + + let encoding_micheline_benchmark (node : Protocol.Script_repr.expr) = + let node = Micheline.root node in + let workload = + match micheline_serialization_trace node with + | None -> Micheline_common.bad_micheline name node Trace_production + | Some trace -> trace + in + let closure () = + try + ignore + (Data_encoding.Binary.to_string_exn + Protocol.Script_repr.expr_encoding + (Micheline.strip_locations node)) + with _ -> Micheline_common.bad_micheline name node In_protocol + in + Generator.Plain {workload; closure} + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; typ = _} = + Michelson_generation.make_data_sampler rng_state cfg.generator_config + in + encoding_micheline_benchmark term + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.map + (function + | Michelson_mcmc_samplers.Data {term; typ = _} + | Michelson_mcmc_samplers.Code {term; bef = _; aft = _} -> + fun () -> encoding_micheline_benchmark term) + terms + | None -> List.repeat bench_num (make_bench rng_state config) + + let models = models (Namespace.basename name) +end + +let () = Registration_helpers.register (module Encoding_micheline) + +module Decoding_micheline : Benchmark.S = struct + include Translator_benchmarks.Config + include Micheline_common + + let name = ns "DECODING_MICHELINE" + + let info = "Decoding of bytes to Micheline" + + let micheline_deserialization_trace (micheline_str : string) = + match + Data_encoding.Binary.of_string + Protocol.Script_repr.expr_encoding + micheline_str + with + | Error err -> + Format.eprintf + "micheline_deserialization_trace: %a@." + Data_encoding.Binary.pp_read_error + err ; + None + | Ok micheline_node -> + let micheline_size = + Size.of_micheline (Micheline.root micheline_node) + in + Some {size = micheline_size; bytes = Size.string micheline_str} + + let decoding_micheline_benchmark (node : Protocol.Script_repr.expr) = + let encoded = + Data_encoding.Binary.to_string_exn Protocol.Script_repr.expr_encoding node + in + let node = Micheline.root node in + let workload = + match micheline_deserialization_trace encoded with + | None -> bad_micheline name node Trace_production + | Some trace -> trace + in + let closure () = + try + ignore + (Data_encoding.Binary.of_string_exn + Protocol.Script_repr.expr_encoding + encoded) + with _ -> bad_micheline name node In_protocol + in + Generator.Plain {workload; closure} + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; typ = _} = + Michelson_generation.make_data_sampler rng_state cfg.generator_config + in + decoding_micheline_benchmark term + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.map + (function + | Michelson_mcmc_samplers.Data {term; typ = _} + | Michelson_mcmc_samplers.Code {term; bef = _; aft = _} -> + fun () -> decoding_micheline_benchmark term) + terms + | None -> List.repeat bench_num (make_bench rng_state config) + + let models = models (Namespace.basename name) +end + +let () = Registration_helpers.register (module Decoding_micheline) + +module Timestamp = struct + let () = + Registration_helpers.register + @@ + let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers in + fixed_size_shared + ~name:"TIMESTAMP_READABLE_ENCODING" + ~generator:(fun rng_state -> + let seconds_in_year = 30_000_000 in + let offset = Random.State.int rng_state seconds_in_year in + Script_timestamp.of_zint (Z.of_int (1597764116 + offset))) + ~make_bench:(fun generator () -> + let tstamp_string = generator () in + let closure () = ignore (Script_timestamp.to_notation tstamp_string) in + Generator.Plain {workload = (); closure}) + () + + let () = + let b, b_intercept = + let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers in + nsqrtn_shared_with_intercept + ~name:"TIMESTAMP_READABLE_DECODING" + ~generator:(fun rng_state -> + let offset = + Base_samplers.nat ~size:{min = 1; max = 100_000} rng_state + in + let tstamp = + Script_timestamp.of_zint Z.(of_int 1597764116 + offset) + in + Script_timestamp.to_string tstamp) + ~make_bench:(fun generator () -> + let tstamp_string = generator () in + let bytes = String.length tstamp_string in + let closure () = ignore (Script_timestamp.of_string tstamp_string) in + Generator.Plain {workload = {bytes}; closure}) + ~generator_intercept:(fun rng_state -> + let seconds_in_year = 30_000_000 in + let offset = Random.State.int rng_state seconds_in_year in + let tstamp = + Script_timestamp.of_zint (Z.of_int (1597764116 + offset)) + in + Script_timestamp.to_string tstamp) + ~make_bench_intercept:(fun generator () -> + let tstamp_string = generator () in + let closure () = ignore (Script_timestamp.of_string tstamp_string) in + Generator.Plain {workload = {bytes = 0}; closure}) + in + Registration_helpers.register b ; + Registration_helpers.register b_intercept +end + +(* when benchmarking, compile bls12-381 without ADX, see + https://gitlab.com/dannywillems/ocaml-bls12-381/-/blob/71d0b4d467fbfaa6452d702fcc408d7a70916a80/README.md#install +*) +module BLS = struct + open Tezos_shell_benchmarks.Encoding_benchmarks_helpers + + let check () = + if not Bls12_381.built_with_blst_portable then ( + Format.eprintf + "BLS must be built without ADX to run the BLS benchmarks. Try \ + compiling again after setting the environment variable BLST_PORTABLE. \ + Aborting.@." ; + Stdlib.failwith "bls_not_built_with_blst_portable") + + let () = + Registration_helpers.register + @@ make_encode_fixed_size_to_bytes + ~check + ~name:"ENCODING_BLS_FR" + ~to_bytes:Bls12_381.Fr.to_bytes + ~generator:(fun rng_state -> Bls12_381.Fr.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ make_encode_fixed_size_to_bytes + ~check + ~name:"ENCODING_BLS_G1" + ~to_bytes:Bls12_381.G1.to_bytes + ~generator:(fun rng_state -> Bls12_381.G1.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ make_encode_fixed_size_to_bytes + ~check + ~name:"ENCODING_BLS_G2" + ~to_bytes:Bls12_381.G2.to_bytes + ~generator:(fun rng_state -> Bls12_381.G2.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ make_decode_fixed_size_from_bytes + ~check + ~name:"DECODING_BLS_FR" + ~to_bytes:Bls12_381.Fr.to_bytes + ~from_bytes:Bls12_381.Fr.of_bytes_exn + ~generator:(fun rng_state -> Bls12_381.Fr.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ make_decode_fixed_size_from_bytes + ~check + ~name:"DECODING_BLS_G1" + ~to_bytes:Bls12_381.G1.to_bytes + ~from_bytes:Bls12_381.G1.of_bytes_exn + ~generator:(fun rng_state -> Bls12_381.G1.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ make_decode_fixed_size_from_bytes + ~check + ~name:"DECODING_BLS_G2" + ~to_bytes:Bls12_381.G2.to_bytes + ~from_bytes:Bls12_381.G2.of_bytes_exn + ~generator:(fun rng_state -> Bls12_381.G2.random ~state:rng_state ()) + () + + let () = + Registration_helpers.register + @@ fixed_size_shared + ~check + ~name:"BLS_FR_FROM_Z" + ~generator:(fun rng_state -> Bls12_381.Fr.random ~state:rng_state ()) + ~make_bench:(fun generator () -> + let generated = generator () in + let z = Bls12_381.Fr.to_z generated in + let closure () = ignore (Bls12_381.Fr.of_z z) in + Generator.Plain {workload = (); closure}) + () + + let () = + Registration_helpers.register + @@ fixed_size_shared + ~check + ~name:"BLS_FR_TO_Z" + ~generator:(fun rng_state -> Bls12_381.Fr.random ~state:rng_state ()) + ~make_bench:(fun generator () -> + let generated = generator () in + let closure () = ignore (Bls12_381.Fr.to_z generated) in + Generator.Plain {workload = (); closure}) + () +end + +module Timelock = struct + open Tezos_shell_benchmarks.Encoding_benchmarks_helpers + + let generator rng_state = + let log_time = + Base_samplers.sample_in_interval ~range:{min = 0; max = 29} rng_state + in + let time = Random.State.int rng_state (Int.shift_left 1 log_time) in + let plaintext_size = + Base_samplers.sample_in_interval ~range:{min = 1; max = 10000} rng_state + in + let chest, chest_key = + Tezos_crypto.Timelock.chest_sampler ~plaintext_size ~time ~rng_state + in + ((chest, chest_key), plaintext_size) + + let () = + Registration_helpers.register + @@ make_encode_variable_size_to_string + ~name:"ENCODING_Chest" + ~to_string: + (Data_encoding.Binary.to_string_exn + Tezos_crypto.Timelock.chest_encoding) + ~generator:(fun rng_state -> + let (chest, _), plaintext_size = generator rng_state in + (chest, {bytes = plaintext_size})) + () + + let () = + Registration_helpers.register + @@ make_encode_fixed_size_to_string + ~name:"ENCODING_Chest_key" + ~to_string: + (Data_encoding.Binary.to_string_exn + Tezos_crypto.Timelock.chest_key_encoding) + ~generator:(fun rng_state -> + let (_, chest_key), _w = generator rng_state in + chest_key) + () + + let () = + Registration_helpers.register + @@ make_decode_variable_size_from_bytes + ~name:"DECODING_Chest" + ~to_bytes: + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Timelock.chest_encoding) + ~from_bytes: + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Timelock.chest_encoding) + ~generator:(fun rng_state -> + let (chest, _), _ = generator rng_state in + let b = + Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Timelock.chest_encoding + chest + in + (chest, {bytes = Bytes.length b})) + () + + let () = + Registration_helpers.register + @@ make_decode_fixed_size_from_bytes + ~name:"DECODING_Chest_key" + ~to_bytes: + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Timelock.chest_key_encoding) + ~from_bytes: + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Timelock.chest_key_encoding) + ~generator:(fun rng_state -> + let (_, chest_key), _w = generator rng_state in + chest_key) + () +end diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/gas_helpers.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/gas_helpers.ml new file mode 100644 index 000000000000..bf8bcde60256 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/gas_helpers.ml @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let set_limit ctxt = + Alpha_context.Gas.set_limit + ctxt + (Alpha_context.Gas.Arith.integral_of_int_exn 999_999_999_999) + +let fp_to_z (fp : Alpha_context.Gas.Arith.fp) = + let open Data_encoding in + Binary.to_bytes_exn Alpha_context.Gas.Arith.z_fp_encoding fp + |> Binary.of_bytes_exn z diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml new file mode 100644 index 000000000000..3d7dd43d1d37 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/global_constants_storage_benchmarks.ml @@ -0,0 +1,723 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* This module includes benchmarks for [Global_constants_storage.expand] + and [Global_constants_storage.Internal_for_tests.expr_to_address_in_context]. + The other main function exported by [Global_constants_storage] is [register]; + however, [register] calls [expand] and does little else, and thus does + not need to be further carbonated. + + In the process of creating these benchmarks, we benchmarked several OCaml + stdlib functions and [Script_expr_hash.of_b58check_opt]. While these cost + models are not used in the protocol, they are kept here to ensure the + assumptions underlying [register] and [expand] don't change out + from under us.*) + +open Tezos_benchmark +open Tezos_micheline +open Protocol + +let ns = Namespace.make Registration_helpers.ns "global_constants_storage" + +let fv s = Free_variable.of_namespace (ns s) + +let assert_ok_lwt x = + match Lwt_main.run x with + | Ok x -> x + | Error errs -> + Format.eprintf "%a" pp_print_trace errs ; + exit 1 + +let assert_ok = function + | Ok x -> x + | Error errs -> + Format.eprintf "%a" pp_print_trace errs ; + exit 1 + +(** [seq_of_n_constants n hash] generates a Seq filled + with [n] constant primitives containing [hash] *) +let seq_of_n_constants n hash = + let open Micheline in + Seq + ( -1, + Stdlib.List.init n (fun _ -> + Prim (-1, Michelson_v1_primitives.H_constant, [String (-1, hash)], [])) + ) + +(** Computes the b58check hash of a Micheline node as a string. *) +let node_to_hash node = + let expr_bytes = + Micheline.strip_locations node + |> Script_repr.lazy_expr |> Script_repr.force_bytes |> Stdlib.Result.get_ok + in + Script_expr_hash.hash_bytes [expr_bytes] |> Script_expr_hash.to_b58check + +(* An ad-hoc sampler for Micheline values. Boltzmann sampling would do well + here. + + Copied from lib_micheline and modified to use [Michelson_v1_primitives.prim]. *) +module Micheline_sampler = struct + type node = Alpha_context.Script.node + + let prims = + let open Protocol.Michelson_v1_primitives in + [| + K_parameter; + K_storage; + K_code; + D_False; + D_Elt; + D_Left; + D_None; + D_Pair; + D_Right; + D_Some; + D_True; + D_Unit; + I_PACK; + I_UNPACK; + I_BLAKE2B; + I_SHA256; + I_SHA512; + I_ABS; + I_ADD; + I_AMOUNT; + I_AND; + I_BALANCE; + I_CAR; + I_CDR; + I_CHAIN_ID; + I_CHECK_SIGNATURE; + I_COMPARE; + I_CONCAT; + I_CONS; + I_CREATE_ACCOUNT; + I_CREATE_CONTRACT; + I_IMPLICIT_ACCOUNT; + I_DIP; + I_DROP; + I_DUP; + I_EDIV; + I_EMPTY_BIG_MAP; + I_EMPTY_MAP; + I_EMPTY_SET; + I_EQ; + I_EXEC; + I_APPLY; + I_FAILWITH; + I_GE; + I_GET; + I_GET_AND_UPDATE; + I_GT; + I_HASH_KEY; + I_IF; + I_IF_CONS; + I_IF_LEFT; + I_IF_NONE; + I_INT; + I_LAMBDA; + I_LE; + I_LEFT; + I_LEVEL; + I_LOOP; + I_LSL; + I_LSR; + I_LT; + I_MAP; + I_MEM; + I_MUL; + I_NEG; + I_NEQ; + I_NIL; + I_NONE; + I_NOT; + I_NOW; + I_OR; + I_PAIR; + I_UNPAIR; + I_PUSH; + I_RIGHT; + I_SIZE; + I_SOME; + I_SOURCE; + I_SENDER; + I_SELF; + I_SELF_ADDRESS; + I_SLICE; + I_STEPS_TO_QUOTA; + I_SUB; + I_SWAP; + I_TRANSFER_TOKENS; + I_SET_DELEGATE; + I_UNIT; + I_UPDATE; + I_XOR; + I_ITER; + I_LOOP_LEFT; + I_ADDRESS; + I_CONTRACT; + I_ISNAT; + I_CAST; + I_RENAME; + I_SAPLING_EMPTY_STATE; + I_SAPLING_VERIFY_UPDATE; + I_DIG; + I_DUG; + I_NEVER; + I_VOTING_POWER; + I_TOTAL_VOTING_POWER; + I_KECCAK; + I_SHA3; + I_PAIRING_CHECK; + I_TICKET; + I_READ_TICKET; + I_SPLIT_TICKET; + I_JOIN_TICKETS; + T_bool; + T_contract; + T_int; + T_key; + T_key_hash; + T_lambda; + T_list; + T_map; + T_big_map; + T_nat; + T_option; + T_or; + T_pair; + T_set; + T_signature; + T_string; + T_bytes; + T_mutez; + T_timestamp; + T_unit; + T_operation; + T_address; + T_sapling_transaction_deprecated; + T_sapling_state; + T_chain_id; + T_never; + T_bls12_381_g1; + T_bls12_381_g2; + T_bls12_381_fr; + T_ticket + (* We don't want constants in our generator, else the constants + functions might fail because it's ill-formed. *) + (* H_constant; *); + |] + + module Sampler = Micheline_sampler.Make (struct + type prim = Michelson_v1_primitives.prim + + let sample_prim : Michelson_v1_primitives.prim Base_samplers.sampler = + fun rng_state -> + let i = Random.State.int rng_state (Array.length prims) in + prims.(i) + + let sample_annots : string list Base_samplers.sampler = fun _rng_state -> [] + + let sample_string _ = "" + + let sample_bytes _ = Bytes.empty + + let sample_z _ = Z.zero + + let width_function = Micheline_sampler.reasonable_width_function + end) + + let sample = Sampler.sample + + type size = {nodes : int; bytes : int} + + let int z = {nodes = 1; bytes = (Z.numbits z + 7) / 8} + + let string s = {nodes = 1; bytes = String.length s} + + let bytes b = {nodes = 1; bytes = Bytes.length b} + + let node = {nodes = 1; bytes = 0} + + let ( @+ ) x y = {nodes = x.nodes + y.nodes; bytes = x.bytes + y.bytes} + + let micheline_size (n : node) = + let rec micheline_size n acc = + let open Micheline in + match n with + | Int (_, i) -> acc @+ int i + | String (_, s) -> acc @+ string s + | Bytes (_, b) -> acc @+ bytes b + | Seq (_, terms) -> + List.fold_left + (fun acc term -> micheline_size term acc) + (acc @+ node) + terms + | Prim (_, _, terms, _) -> + List.fold_left + (fun acc term -> micheline_size term acc) + (acc @+ node) + terms + in + micheline_size n {nodes = 0; bytes = 0} +end + +(** Cost model and benchmarks for set element addition from the + OCaml stdlib. + + The cost model is not currently used + in the protocol, but we include the benchmarks to validate our + assumptions about functions that use this. *) +module Set_add : Benchmark.S = struct + let name = ns "Set_add" + + let info = + "Benchmarks and cost model for set element addition from OCaml stdlib." + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector : workload -> Sparse_vec.String.t = + fun size -> Sparse_vec.String.of_list [("size", float_of_int size)] + + (* As an OCaml set is a balanced binary tree, complexity is O(log n). *) + let models = + [ + ( "Set_add", + Model.( + make ~conv:(fun size -> (size, ())) ~model:(logn ~coeff:(fv "size"))) + ); + ] + + module Int_set = Set.Make (Int) + + let create_benchmark rng_state _config () = + let range : Base_samplers.range = {min = 0; max = 10_000} in + let size = Base_samplers.sample_in_interval ~range rng_state in + let set = Stdlib.List.init size Fun.id |> Int_set.of_list in + let closure () = ignore (Int_set.add (size + 1) set) in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) +end + +let () = + Registration_helpers.register (module Set_add) ; + Registration_helpers.register_for_codegen + "Set_add" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc ~equal:String.equal "Set_add" Set_add.models)) + +(** Cost model and benchmarks for set elements from the + OCaml stdlib. + + The cost model is not currently used + in the protocol, but we include the benchmarks to validate our + assumptions about functions that use this. *) +module Set_elements : Benchmark.S = struct + let name = ns "Set_elements" + + let info = "Benchmarks and cost model for set elements from OCaml stdlib." + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector : workload -> Sparse_vec.String.t = + fun size -> Sparse_vec.String.of_list [("size", float_of_int size)] + + (* Cost of retrieving all elements from the set is linear with the size + of the set.*) + let models = + [ + ( "Set_elements", + Model.( + make ~conv:(fun size -> (size, ())) ~model:(linear ~coeff:(fv "size"))) + ); + ] + + module Int_set = Set.Make (Int) + + let create_benchmark rng_state _config () = + let range : Base_samplers.range = {min = 0; max = 10_000} in + let size = Base_samplers.sample_in_interval ~range rng_state in + let set = Stdlib.List.init size (fun x -> x) |> Int_set.of_list in + let closure () = ignore (Int_set.elements set) in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) +end + +let () = + Registration_helpers.register (module Set_elements) ; + Registration_helpers.register_for_codegen + "Set_elements" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc ~equal:String.equal "Set_elements" Set_elements.models)) + +(** Cost model and benchmarks for [Script_expr_hash.of_b58_check_opt]. + Under the hood this function uses the [Blake2b] functor, which uses + the HACL* crypto library. + + The cost model is not currently used + in the protocol, but we include the benchmarks to validate our + assumptions about functions that use this. *) +module Script_expr_hash_of_b58check_opt : Benchmark.S = struct + let name = ns "Script_expr_hash_of_b58check_opt" + + let info = "Benchmark for Script_expr_hash.of_b58check_opt" + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = Micheline_sampler.size + + let workload_encoding = + let open Data_encoding in + conv + (fun Micheline_sampler.{nodes; bytes} -> (nodes, bytes)) + (fun (nodes, bytes) -> {nodes; bytes}) + (obj2 (req "nodes" int31) (req "bytes" int31)) + + let workload_to_vector Micheline_sampler.{nodes; bytes} = + Sparse_vec.String.of_list + [("nodes", float_of_int nodes); ("bytes", float_of_int bytes)] + + (* On testing we found that this function is a constant + time operation. However, to test this, we use an affine model. If + our assumption holds, the coefficient should be near zero. *) + let models = + [ + ( "Script_expr_hash_of_b58check_opt", + Model.( + make + ~conv:(fun Micheline_sampler.{nodes; _} -> (nodes, ())) + ~model: + (Model.affine ~intercept:(fv "b58_check_cost") ~coeff:(fv "size"))) + ); + ] + + (* To create realistic benchmarks, we generate a random Micheline expression, + hash it, then benchmark the cost of validating the hash. *) + let create_benchmark rng_state _config () = + let open Protocol in + let term = Micheline_sampler.sample rng_state in + let size = Micheline_sampler.micheline_size term in + let expr_encoding = Alpha_context.Script.expr_encoding in + let lazy_expr = + Data_encoding.make_lazy expr_encoding (Micheline.strip_locations term) + in + let expr_bytes = Data_encoding.force_bytes lazy_expr in + let hash = Script_expr_hash.hash_bytes [expr_bytes] in + let hash_str = Script_expr_hash.to_b58check hash in + let closure () = ignore (Script_expr_hash.of_b58check_opt hash_str) in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) +end + +let () = + Registration_helpers.register (module Script_expr_hash_of_b58check_opt) ; + Registration_helpers.register_for_codegen + "Script_expr_hash_of_b58check_opt" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:String.equal + "Script_expr_hash_of_b58check_opt" + Script_expr_hash_of_b58check_opt.models)) + +module Global_constants_storage_expr_to_address_in_context : Benchmark.S = +struct + let name = ns "Global_constants_storage_expr_to_address_in_context" + + let info = + "Benchmark for the \ + Global_constants_storage.Internal_for_tests.expr_to_address_in_context \ + function" + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector : workload -> Sparse_vec.String.t = + fun size -> Sparse_vec.String.of_list [("size", float_of_int size)] + + (** The cost of a Blake2b hashing function is linear with the size of the input *) + let models = + [ + ( "Global_constants_storage_expr_to_address_in_context", + Model.( + make ~conv:(fun size -> (size, ())) ~model:(linear ~coeff:(fv "size"))) + ); + ] + + let create_benchmark rng_state _config () = + let open Micheline in + let expr = Micheline_sampler.sample rng_state |> strip_locations in + let b = + Script_repr.lazy_expr expr |> Script_repr.force_bytes + |> Environment.wrap_tzresult |> assert_ok + in + let size = Bytes.length b in + + let closure () = ignore (Script_expr_hash.hash_bytes [b]) in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) +end + +let () = + Registration_helpers.register + (module Global_constants_storage_expr_to_address_in_context) ; + Registration_helpers.register_for_codegen + "Global_constants_storage_expr_to_address_in_context" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:String.equal + "Global_constants_storage_expr_to_address_in_context" + Global_constants_storage_expr_to_address_in_context.models)) + +(** [Global_constants_storage.expand] traverses a Micheline node, + searching for constants and replacing them with their values + retrieved from storage. + + There are three branches in the iterations of [Global_constants_storage.expand] + can take, each with different costs: + - Branch 1: The first time a particular constant is found, the hash is parsed with + [Script_expr_hash.of_b58check_opt], and its value is retrieved + from storage. This storage call (implemented [Global_constants_storage.get]) + is already carbonated and dominates the cost in this case, so do not need to + benchmark Branch 1 - the benchmarks for storage access are sufficient. + - Branch 2: If the same constant is found a subsequent time, its value is looked up + in a map. On testing we determined that the cost of [Script_expr_hash.of_b58check_opt] + dominates the cost of this branch - the cost of an OCaml map lookup is O(log 2 n), and + n has to be unreasonably large to catch up to the constant time cost of validating the + hash. + - Branch 3: When no constant is found, the cost is merely that of pattern matching + and calling the continuation (similar to that of [Micheline.strip_locations]). + + Because we don't know the full size of node being traversed ahead of time (because they + are retrieved from storage), it is impossible to calculate the full gas cost upfront. + However, each time we find a new expression to traverse, we can calculate its size upfront + and charge the cost of all Branch 3 cases. We can then do an additional charge for Branch 2 + each time we find a constant, and let storage handle charging for Branch 1. + + Below are models for Branch 2 and 3 respectively. + *) +module Global_constants_storage_expand_models = struct + module Global_constants_storage_expand_constant_branch : Benchmark.S = struct + let name = ns "Global_constants_storage_expand_constant_branch" + + let info = + "Benchmark for the constant branch Global_constants_storage.expand \ + function" + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector : workload -> Sparse_vec.String.t = + fun constants -> + Sparse_vec.String.of_list + [("number of constants", float_of_int constants)] + + (** The cost of Branch 2 is linear to the number of constants in the expression. As + discussed above, the constant time operation [Script_expr_hash.of_b58check_opt] + dominates the cost of each iteration. *) + let models = + [ + ( "Global_constants_storage_expand_constant_branch", + Model.( + make + ~conv:(fun size -> (size, ())) + ~model:(linear ~coeff:(fv "number of constants"))) ); + ] + + (* To test Branch 2 as nearly as possible, we generate a Micheline Seq + consisting of the same constant repeated n times. As n increases, + the benchmark more closely approximates the true cost of Branch 2. *) + let create_benchmark rng_state _config () = + let open Micheline in + let node = Micheline_sampler.sample rng_state in + let size = (Micheline_sampler.micheline_size node).nodes in + let registered_constant = Int (-1, Z.of_int 1) in + let hash = registered_constant |> node_to_hash in + let context, _ = Execution_context.make ~rng_state |> assert_ok_lwt in + let context, _, _ = + Alpha_context.Global_constants_storage.register + context + (strip_locations registered_constant) + >|= Environment.wrap_tzresult |> assert_ok_lwt + in + let node = seq_of_n_constants size hash in + let closure () = + ignore + (Lwt_main.run + @@ Alpha_context.Global_constants_storage.expand + context + (strip_locations node)) + in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) + end + + let () = + Registration_helpers.register + (module Global_constants_storage_expand_constant_branch) ; + Registration_helpers.register_for_codegen + "Global_constants_storage_expand_constant_branch" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:String.equal + "Global_constants_storage_expand_constant_branch" + Global_constants_storage_expand_constant_branch.models)) + + module Global_constants_storage_expand_no_constant_branch : Benchmark.S = + struct + let name = ns "Global_constants_storage_expand_no_constant_branch" + + let info = + "Benchmark for the Global_constants_storage.expand function on the case \ + without constants" + + let tags = ["global_constants"] + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector : workload -> Sparse_vec.String.t = + fun size -> + Sparse_vec.String.of_list [("number of nodes", float_of_int size)] + + (* The cost of Branch 3 is the cost of traversing a single node. It + is therefore linear to the number of nodes being traversed. This is + very similar to [Micheline.strip_locations]. + + On testing I observed that while the linear model was accurate + for small numbers of nodes, after 1000 nodes the cost seems to increase more + than linearly. I think I would have to fine tune the sampler to better test + past this amount; however, I don't think it's necessary - to get large orders + of nodes, you need to use constants, in which case the cost of + [Script_expr_hash.of_b58check_opt] will dominate. A n*log(n) model seems + accurate enough for the range of values tested. + *) + let models = + [ + ( "Global_constants_storage_expand_no_constant_branch", + Model.( + make + ~conv:(fun size -> (size, ())) + ~model:(nlogn ~intercept:(fv "cst") ~coeff:(fv "number of nodes"))) + ); + ] + + (** We benchmark this by generating a random Micheline expression without constants + and calling [expand] on it. This causes the function to spend all its time in + Branch 3. *) + let create_benchmark rng_state _config () = + let open Micheline in + let node = Micheline_sampler.sample rng_state in + let size = (Micheline_sampler.micheline_size node).nodes in + let context, _ = Execution_context.make ~rng_state |> assert_ok_lwt in + let expr = strip_locations node in + let closure () = + ignore + (Lwt_main.run + @@ Alpha_context.Global_constants_storage.expand context expr) + in + Generator.Plain {workload = size; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (create_benchmark rng_state config) + end + + let () = + Registration_helpers.register + (module Global_constants_storage_expand_no_constant_branch) ; + Registration_helpers.register_for_codegen + "Global_constants_storage_expand_no_constant_branch" + (Model.For_codegen + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:String.equal + "Global_constants_storage_expand_no_constant_branch" + Global_constants_storage_expand_no_constant_branch.models)) +end diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml new file mode 100644 index 000000000000..cf01e16da4d5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_benchmarks.ml @@ -0,0 +1,3525 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Interpreter_model.ns + +let fv = Interpreter_model.fv + +module Timelock_samplers = Tezos_crypto.Timelock +open Protocol + +(* ------------------------------------------------------------------------- *) + +type ex_stack_and_kinstr = + | Ex_stack_and_kinstr : { + stack : 'a * 'b; + stack_type : ('a, 'b) Script_typed_ir.stack_ty; + kinstr : ('a, 'b, 'c, 'd) Script_typed_ir.kinstr; + } + -> ex_stack_and_kinstr + +type ex_stack_and_continuation = + | Ex_stack_and_cont : { + stack : 'a * 'b; + stack_type : ('a, 'b) Script_typed_ir.stack_ty; + cont : ('a, 'b, 'c, 'd) Script_typed_ir.continuation; + } + -> ex_stack_and_continuation + +type ex_value = + | Ex_value : {value : 'a; ty : ('a, _) Script_typed_ir.ty} -> ex_value + +(* ------------------------------------------------------------------------- *) + +let sf = Printf.sprintf + +(* End of Stack *) +let eos = Script_typed_ir.(EmptyCell, EmptyCell) + +let info_and_name ~intercept ?(salt = "") s = + let s = s ^ salt in + if intercept then + (sf "Benchmark %s (intercept case)" s, Namespace.make ns s "intercept") + else (sf "Benchmark %s" s, ns s) + +module Default_boilerplate = struct + type workload = Interpreter_workload.t + + let workload_encoding = Interpreter_workload.encoding + + let workload_to_vector = Interpreter_workload.trace_to_sparse_vec + + let tags = [Tags.interpreter] +end + +module Default_config = struct + (* Configuration specific to sapling benchmarks *) + type sapling_config = {sapling_txs_file : string; seed : int option} + + (* Configuration specific to benchmarking Dign/Dipn/Dupn/Dropn/Combs *) + type comb_config = {max_depth : int} + + (* Configuration specific to benchmarking ICompare *) + type compare_config = {type_size : Base_samplers.range} + + type config = { + sampler : Michelson_samplers.parameters; + sapling : sapling_config; + comb : comb_config; + compare : compare_config; + } + + let default_config = + let open Michelson_samplers in + let open Michelson_samplers_base in + let sampler = + { + base_parameters = + { + int_size = {min = 8; max = 100_000}; + string_size = {min = 1 lsl 10; max = 1 lsl 17}; + bytes_size = {min = 1 lsl 10; max = 1 lsl 17}; + }; + list_size = {min = 10; max = 1000}; + set_size = {min = 10; max = 1000}; + map_size = {min = 10; max = 1000}; + } + in + { + sampler; + sapling = {sapling_txs_file = {|/no/such/file|}; seed = None}; + comb = {max_depth = 1000}; + compare = {type_size = {min = 1; max = 15}}; + } + + let sapling_config_encoding = + let open Data_encoding in + conv + (fun {sapling_txs_file; seed} -> (sapling_txs_file, seed)) + (fun (sapling_txs_file, seed) -> {sapling_txs_file; seed}) + (obj2 (req "sapling_txs_file" string) (req "seed" (option int31))) + + let comb_config_encoding = + let open Data_encoding in + conv + (fun {max_depth} -> max_depth) + (fun max_depth -> {max_depth}) + (obj1 (req "max_depth" int31)) + + let compare_config_encoding = + let open Data_encoding in + conv + (fun {type_size} -> type_size) + (fun type_size -> {type_size}) + (obj1 (req "type_size" Base_samplers.range_encoding)) + + let config_encoding = + let open Data_encoding in + conv + (fun {sampler; sapling; comb; compare} -> + (sampler, sapling, comb, compare)) + (fun (sampler, sapling, comb, compare) -> + {sampler; sapling; comb; compare}) + (obj4 + (req "sampler" Michelson_samplers.parameters_encoding) + (req "sapling" sapling_config_encoding) + (req "comb" comb_config_encoding) + (req "compare" compare_config_encoding)) +end + +let make_default_samplers ?(algo = `Default) cfg : + (module Crypto_samplers.Finite_key_pool_S) * (module Michelson_samplers.S) = + let module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let size = 16 + + let algo = algo + end) in + let module Michelson_samplers = + Michelson_samplers.Make + (struct + let parameters = cfg + end) + (Crypto_samplers) + in + ((module Crypto_samplers), (module Michelson_samplers)) + +(* ------------------------------------------------------------------------- *) +(* Helpers for creating benchmarks for the interpreter *) + +let benchmark_from_kinstr_and_stack : + ?amplification:int -> + Alpha_context.context -> + Protocol.Script_interpreter.step_constants -> + ex_stack_and_kinstr -> + Interpreter_workload.ir_sized_step list Generator.benchmark = + fun ?amplification ctxt step_constants stack_kinstr -> + let ctxt = Gas_helpers.set_limit ctxt in + match stack_kinstr with + | Ex_stack_and_kinstr {stack = bef_top, bef; stack_type; kinstr} -> + let workload, closure = + match amplification with + | None -> + let workload = + Interpreter_workload.extract_deps + ctxt + step_constants + stack_type + kinstr + (bef_top, bef) + in + let _gas_counter, outdated_ctxt = + Local_gas_counter.local_gas_counter_and_outdated_context ctxt + in + let closure () = + ignore + (* Lwt_main.run *) + (Script_interpreter.Internals.step + (outdated_ctxt, step_constants) + (Local_gas_counter 9_999_999_999) + kinstr + bef_top + bef) + in + (workload, closure) + | Some amplification_factor -> + assert (amplification_factor > 0) ; + let workload = + Interpreter_workload.extract_deps + ctxt + step_constants + stack_type + kinstr + (bef_top, bef) + in + let workload = + List.repeat amplification_factor workload |> List.flatten + in + let _gas_counter, outdated_ctxt = + Local_gas_counter.local_gas_counter_and_outdated_context ctxt + in + let closure () = + for _i = 1 to amplification_factor do + ignore + (* Lwt_main.run *) + (Script_interpreter.Internals.step + (outdated_ctxt, step_constants) + (Local_gas_counter 9_999_999_999) + kinstr + bef_top + bef) + done + in + (workload, closure) + in + Generator.Plain {workload; closure} + +let make_benchmark : + ?amplification:int -> + ?intercept:bool -> + ?salt:string -> + ?more_tags:string list -> + ?check:(unit -> unit) -> + name:Interpreter_workload.instruction_name -> + kinstr_and_stack_sampler: + (Default_config.config -> Random.State.t -> unit -> ex_stack_and_kinstr) -> + unit -> + Benchmark.t = + fun ?amplification + ?(intercept = false) + ?salt + ?(more_tags = []) + ?(check = fun () -> ()) + ~name + ~kinstr_and_stack_sampler + () -> + let module B : Benchmark.S = struct + include Default_config + include Default_boilerplate + + let tags = tags @ more_tags + + let models = + (* [intercept = true] implies there's a benchmark with [intercept = false]. + No need to register the model twice. *) + Interpreter_model.make_model + ?amplification + (if intercept then None else Some (Instr_name name)) + + let info, name = + info_and_name + ~intercept + ?salt + (Interpreter_workload.string_of_instruction_name name) + + let benchmark kinstr_and_stack_sampler ctxt step_constants () = + let stack_instr = kinstr_and_stack_sampler () in + benchmark_from_kinstr_and_stack + ?amplification + ctxt + step_constants + stack_instr + + let create_benchmarks ~rng_state ~bench_num (config : config) = + check () ; + match Lwt_main.run (Execution_context.make ~rng_state) with + | Error _errs -> assert false + | Ok (ctxt, step_constants) -> + let kinstr_and_stack_sampler = + kinstr_and_stack_sampler config rng_state + in + List.repeat + bench_num + (benchmark kinstr_and_stack_sampler ctxt step_constants) + end in + (module B : Benchmark.S) + +let make_simple_benchmark : + type bef_top bef res_top res. + ?amplification:int -> + ?intercept:bool -> + ?more_tags:string list -> + ?salt:string -> + ?check:(unit -> unit) -> + name:Interpreter_workload.instruction_name -> + stack_type:(bef_top, bef) Script_typed_ir.stack_ty -> + kinstr:(bef_top, bef, res_top, res) Script_typed_ir.kinstr -> + unit -> + Benchmark.t = + fun ?amplification + ?intercept + ?more_tags + ?salt + ?check + ~name + ~stack_type + ~kinstr + () -> + let kinstr_and_stack_sampler config rng_state = + let _, (module Samplers) = + make_default_samplers config.Default_config.sampler + in + fun () -> + Ex_stack_and_kinstr + { + stack = Samplers.Random_value.stack stack_type rng_state; + stack_type; + kinstr; + } + in + make_benchmark + ?amplification + ?intercept + ?more_tags + ?salt + ?check + ~name + ~kinstr_and_stack_sampler + () + +let benchmark ?amplification ?intercept ?more_tags ?salt ?check ~name + ~kinstr_and_stack_sampler () = + let bench = + make_benchmark + ?amplification + ?intercept + ?more_tags + ?salt + ?check + ~name + ~kinstr_and_stack_sampler + () + in + Registration_helpers.register bench + +let benchmark_with_stack_sampler ?amplification ?intercept ?more_tags ?salt + ?check ~stack_type ~name ~kinstr ~stack_sampler () = + let kinstr_and_stack_sampler config rng_state = + let stack_sampler = stack_sampler config rng_state in + fun () -> Ex_stack_and_kinstr {stack = stack_sampler (); stack_type; kinstr} + in + let bench = + make_benchmark + ?amplification + ?intercept + ?more_tags + ?salt + ?check + ~name + ~kinstr_and_stack_sampler + () + in + Registration_helpers.register bench + +let benchmark_with_fixed_stack ?amplification ?intercept ?more_tags ?salt ?check + ~name ~stack ~kinstr () = + benchmark_with_stack_sampler + ?amplification + ?intercept + ?more_tags + ?salt + ?check + ~name + ~kinstr + ~stack_sampler:(fun _cfg _rng_state () -> stack) + () + +let simple_benchmark_with_stack_sampler ?amplification ?intercept_stack ?salt + ?more_tags ?check ~name ~stack_type ~kinstr ~stack_sampler () = + benchmark_with_stack_sampler + ?amplification + ~intercept:false + ?salt + ?more_tags + ?check + ~name + ~stack_type + ~kinstr + ~stack_sampler + () ; + Option.iter + (fun stack -> + benchmark_with_fixed_stack + ?amplification + ~intercept:true + ?more_tags + ?salt + ?check + ~name + ~stack_type + ~stack + ~kinstr + ()) + intercept_stack + +let simple_benchmark ?amplification ?intercept_stack ?more_tags ?salt ?check + ~name ~stack_type ~kinstr () = + let bench = + make_simple_benchmark + ?amplification + ~intercept:false + ?more_tags + ?salt + ?check + ~name + ~stack_type + ~kinstr + () + in + Registration_helpers.register bench ; + Option.iter + (fun stack -> + benchmark_with_fixed_stack + ?amplification + ~intercept:true + ?more_tags + ?salt + ?check + ~name + ~stack_type + ~stack + ~kinstr + ()) + intercept_stack + +(* ------------------------------------------------------------------------- *) +(* Helpers for creating benchmarks for [Script_interpreter.next] *) + +let benchmark_from_continuation : + ?amplification:int -> + Alpha_context.context -> + Protocol.Script_interpreter.step_constants -> + ex_stack_and_continuation -> + Interpreter_workload.ir_sized_step list Generator.benchmark = + fun ?amplification ctxt step_constants stack_cont -> + let ctxt = Gas_helpers.set_limit ctxt in + match stack_cont with + | Ex_stack_and_cont {stack = bef_top, bef; cont; stack_type} -> + let workload, closure = + match amplification with + | None -> + let workload = + Interpreter_workload.extract_deps_continuation + ctxt + step_constants + stack_type + cont + (bef_top, bef) + in + let _gas_counter, outdated_ctxt = + Local_gas_counter.local_gas_counter_and_outdated_context ctxt + in + let closure () = + ignore + (* Lwt_main.run *) + (Script_interpreter.Internals.next + None + (outdated_ctxt, step_constants) + (Local_gas_counter 9_999_999_999) + stack_type + cont + bef_top + bef) + in + (workload, closure) + | Some amplification_factor -> + assert (amplification_factor > 0) ; + let workload = + Interpreter_workload.extract_deps_continuation + ctxt + step_constants + stack_type + cont + (bef_top, bef) + in + let workload = + List.repeat amplification_factor workload |> List.flatten + in + let _gas_counter, outdated_ctxt = + Local_gas_counter.local_gas_counter_and_outdated_context ctxt + in + let closure () = + for _i = 1 to amplification_factor do + ignore + (* Lwt_main.run *) + (Script_interpreter.Internals.next + None + (outdated_ctxt, step_constants) + (Local_gas_counter 9_999_999_999) + stack_type + cont + bef_top + bef) + done + in + (workload, closure) + in + Generator.Plain {workload; closure} + +let make_continuation_benchmark : + ?amplification:int -> + ?intercept:bool -> + ?salt:string -> + ?more_tags:string list -> + ?check:(unit -> unit) -> + name:Interpreter_workload.continuation_name -> + cont_and_stack_sampler: + (Default_config.config -> + Random.State.t -> + unit -> + ex_stack_and_continuation) -> + unit -> + Benchmark.t = + fun ?amplification + ?(intercept = false) + ?salt + ?(more_tags = []) + ?(check = fun () -> ()) + ~name + ~cont_and_stack_sampler + () -> + let module B : Benchmark.S = struct + include Default_config + include Default_boilerplate + + let tags = tags @ more_tags + + let models = + Interpreter_model.make_model + ?amplification + (if intercept then None else Some (Cont_name name)) + + let info, name = + info_and_name + ~intercept + ?salt + (Interpreter_workload.string_of_continuation_name name) + + let benchmark cont_and_stack_sampler ctxt step_constants () = + let stack_instr = cont_and_stack_sampler () in + benchmark_from_continuation ?amplification ctxt step_constants stack_instr + + let create_benchmarks ~rng_state ~bench_num (config : config) = + check () ; + match Lwt_main.run (Execution_context.make ~rng_state) with + | Error _errs -> assert false + | Ok (ctxt, step_constants) -> + let cont_and_stack_sampler = + cont_and_stack_sampler config rng_state + in + List.repeat + bench_num + (benchmark cont_and_stack_sampler ctxt step_constants) + end in + (module B : Benchmark.S) + +let continuation_benchmark ?amplification ?intercept ?salt ?more_tags ?check + ~name ~cont_and_stack_sampler () = + let bench = + make_continuation_benchmark + ?amplification + ?intercept + ?salt + ?more_tags + ?check + ~name + ~cont_and_stack_sampler + () + in + Registration_helpers.register bench + +(* ------------------------------------------------------------------------- *) +(* Sampling helpers *) + +let nat_of_positive_int (i : int) = + let open Script_int in + match is_nat (of_int i) with None -> assert false | Some x -> x + +let adversarial_ints rng_state (cfg : Default_config.config) n = + let _common_prefix, ls = + Base_samplers.Adversarial.integers + ~prefix_size:cfg.sampler.base_parameters.int_size + ~card:n + rng_state + in + List.map Script_int.of_zint ls + +(* ------------------------------------------------------------------------- *) +(* Error helpers *) + +let raise_if_error = function + | Ok x -> x + | Error e -> + Format.eprintf "%a@." (Error_monad.TzTrace.pp_print Error_monad.pp) e ; + Stdlib.failwith "raise_if_error" + +(* ------------------------------------------------------------------------- *) + +(** [Registration_section] contains all interpreter benchmarks. The goal of + a benchmark is to gather enough data to reliably estimate the parameters + of the cost model associated to each instruction. In general, it can + take several distinct benchmarks to properly cover all the execution + paths. + + In particular, for affine cost model, it is often worth estimating the + intercept separately from the size-dependent coefficients. + *) + +module Registration_section = struct + open Script_typed_ir + open Michelson_types + + let sf = Printf.sprintf + + let dummy_loc = 0 + + let halt = IHalt dummy_loc + + let () = + (* KHalt *) + simple_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_IHalt + ~stack_type:(unit @$ bot) + ~kinstr:halt + () + + module Amplification = struct + module Loop : Benchmark.S = struct + let name = ns "amplification_loop" + + let info = "Benchmarking the cost of an empty loop" + + let tags = [Tags.interpreter] + + type config = {max_iterations : int} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_iterations} -> max_iterations) + (fun max_iterations -> {max_iterations}) + (obj1 (req "max_iterations" int31)) + + let default_config = {max_iterations = 100000} + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector n = + Sparse_vec.String.of_list [("iterations", float_of_int n)] + + let models = [("interpreter", Interpreter_model.amplification_loop_model)] + + let benchmark rng_state config () = + let workload = Random.State.int rng_state config.max_iterations in + let closure () = + for _i = 1 to workload do + Sys.opaque_identity () + done + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num (config : config) = + List.repeat bench_num (benchmark rng_state config) + end + end + + let () = Registration_helpers.register (module Amplification.Loop) + + module Stack = struct + let () = + (* KDrop ; KHalt *) + simple_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_IDrop + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(IDrop (dummy_loc, halt)) + () + + let () = + (* IDup ; IHalt *) + simple_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_IDup + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(IDup (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_ISwap + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(ISwap (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_IConst + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(IConst (dummy_loc, unit, (), halt)) + () + + (* deep stack manipulation *) + + (* Constructing these instructions is made especially painful by the + fact that they include "stack preservation witnesses", which are not + exposed in Script_ir_translator. + We must go through [Script_ir_translator.parse_instr] to construct + the corresponding terms. *) + type ex_stack = + | Ex_stack : ('a, 'b) Script_typed_ir.stack_ty * ('a * 'b) -> ex_stack + + let rec make_stack (depth : int) = + if depth = 0 then assert false + else if depth = 1 then Ex_stack (unit @$ Script_typed_ir.Bot_t, ((), eos)) + else + let stack = make_stack (depth - 1) in + match stack with + | Ex_stack (stack_ty, stack) -> Ex_stack (unit @$ stack_ty, ((), stack)) + + let parse_instr rng_state node stack = + match stack with + | Ex_stack (stack_ty, stack) -> + raise_if_error + (Lwt_main.run + ( Execution_context.make ~rng_state + >>=? fun (ctxt, _step_constants) -> + Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf: + (Script_ir_translator_config.make ~legacy:false ()) + node + stack_ty + >|= Environment.wrap_tzresult + >>=? fun (judgement, _) -> + match judgement with + | Script_ir_translator.Typed descr -> + let kinstr = descr.instr.apply (IHalt dummy_loc) in + return + (Ex_stack_and_kinstr + {stack; kinstr; stack_type = descr.bef}) + | Script_ir_translator.Failed _ -> assert false )) + + open Protocol.Michelson_v1_primitives + + (* The size parameter of a deep stack instruction must fit on 10 bits. See + [Script_ir_translator.parse_uint10]. *) + let stack_size = 1023 + + let long_stack = make_stack stack_size + + let sample_depth rng_state = + Base_samplers.( + sample_in_interval rng_state ~range:{min = 0; max = stack_size - 2}) + + let () = + let dig = Micheline.(Prim (0, I_DIG, [Int (0, Z.of_int 0)], [])) in + benchmark + ~amplification:100 + ~intercept:true + ~name:Interpreter_workload.N_IDig + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dig in + parse_instr rng_state node long_stack) + () + + let () = + let dig n = Micheline.(Prim (0, I_DIG, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IDig + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dig (sample_depth rng_state) in + parse_instr rng_state node long_stack) + () + + let () = + let dug = Micheline.(Prim (0, I_DUG, [Int (0, Z.of_int 0)], [])) in + benchmark + ~intercept:true + ~name:Interpreter_workload.N_IDug + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dug in + parse_instr rng_state node long_stack) + () + + let () = + let dug n = Micheline.(Prim (0, I_DUG, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IDug + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dug (sample_depth rng_state) in + parse_instr rng_state node long_stack) + () + + let () = + let nop = Micheline.Seq (0, []) in + let dip = Micheline.(Prim (0, I_DIP, [Int (0, Z.of_int 0); nop], [])) in + benchmark + ~intercept:true + ~name:Interpreter_workload.N_IDipN + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dip in + parse_instr rng_state node long_stack) + () + + let () = + let nop = Micheline.Seq (0, []) in + let dip n = Micheline.(Prim (0, I_DIP, [Int (0, Z.of_int n); nop], [])) in + benchmark + ~name:Interpreter_workload.N_IDipN + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dip (sample_depth rng_state) in + parse_instr rng_state node long_stack) + () + + let () = + let drop = Micheline.(Prim (0, I_DROP, [Int (0, Z.of_int 0)], [])) in + benchmark + ~intercept:true + ~name:Interpreter_workload.N_IDropN + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = drop in + parse_instr rng_state node long_stack) + () + + let () = + let drop n = Micheline.(Prim (0, I_DROP, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IDropN + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = drop (sample_depth rng_state) in + parse_instr rng_state node long_stack) + () + + let () = + let pair n = Micheline.(Prim (0, I_PAIR, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IComb + ~kinstr_and_stack_sampler:(fun cfg rng_state () -> + let width = + Base_samplers.( + sample_in_interval + rng_state + ~range:{min = 2; max = cfg.comb.max_depth}) + in + let node = pair width in + parse_instr rng_state node long_stack) + () + + let rec make_comb_stack (comb_width : int) (depth : int) acc = + if depth = 0 then + match acc with + | Ex_stack (stack_ty, stack) -> ( + match make_comb comb_width (Ex_value {value = (); ty = unit}) with + | Ex_value {value; ty} -> Ex_stack (ty @$ stack_ty, (value, stack))) + else + match acc with + | Ex_stack (stack_ty, stack) -> + make_comb_stack + comb_width + (depth - 1) + (Ex_stack (unit @$ stack_ty, ((), stack))) + + and make_comb comb_width comb_acc = + if comb_width = 0 then assert false + else if comb_width = 1 then comb_acc + else + match comb_acc with + | Ex_value {value; ty} -> + let (Ty_ex_c ty) = pair unit ty in + make_comb (comb_width - 1) (Ex_value {value = ((), value); ty}) + + let () = + let unpair n = + Micheline.(Prim (0, I_UNPAIR, [Int (0, Z.of_int n)], [])) + in + benchmark + ~name:Interpreter_workload.N_IUncomb + ~kinstr_and_stack_sampler:(fun cfg rng_state () -> + let width = + Base_samplers.( + sample_in_interval + rng_state + ~range:{min = 2; max = cfg.comb.max_depth - 2}) + in + let node = unpair width in + let stack = + make_comb_stack width 1 (Ex_stack (unit @$ bot, ((), eos))) + in + parse_instr rng_state node stack) + () + + let () = + let comb_get n = Micheline.(Prim (0, I_GET, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IComb_get + ~kinstr_and_stack_sampler:(fun cfg rng_state () -> + let width = + Base_samplers.( + sample_in_interval + rng_state + ~range:{min = 2; max = cfg.comb.max_depth - 2}) + in + let index = + Base_samplers.( + sample_in_interval rng_state ~range:{min = 0; max = width}) + in + let node = comb_get index in + let stack = + make_comb_stack width 1 (Ex_stack (unit @$ bot, ((), eos))) + in + parse_instr rng_state node stack) + () + + let () = + let comb_set n = + Micheline.(Prim (0, I_UPDATE, [Int (0, Z.of_int n)], [])) + in + benchmark + ~name:Interpreter_workload.N_IComb_set + ~kinstr_and_stack_sampler:(fun cfg rng_state () -> + let width = + Base_samplers.( + sample_in_interval + rng_state + ~range:{min = 2; max = cfg.comb.max_depth - 2}) + in + let index = + Base_samplers.( + sample_in_interval rng_state ~range:{min = 0; max = width}) + in + let node = comb_set index in + let stack = + let (Ex_stack (stack_ty, stack)) = + make_comb_stack width 1 (Ex_stack (unit @$ bot, ((), eos))) + in + Ex_stack (unit @$ stack_ty, ((), stack)) + in + parse_instr rng_state node stack) + () + + let () = + let dup n = Micheline.(Prim (0, I_DUP, [Int (0, Z.of_int n)], [])) in + benchmark + ~name:Interpreter_workload.N_IDupN + ~kinstr_and_stack_sampler:(fun _cfg rng_state () -> + let node = dup (1 + sample_depth rng_state) in + parse_instr rng_state node long_stack) + () + end + + module Pairs = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICons_pair + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(ICons_pair (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICar + ~stack_type:(cpair unit unit @$ bot) + ~kinstr:(ICar (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICdr + ~stack_type:(cpair unit unit @$ bot) + ~kinstr:(ICdr (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IUnpair + ~stack_type:(cpair unit unit @$ bot) + ~kinstr:(IUnpair (dummy_loc, halt)) + () + end + + module Options = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICons_some + ~stack_type:(unit @$ bot) + ~kinstr:(ICons_some (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICons_none + ~stack_type:(unit @$ bot) + ~kinstr:(ICons_none (dummy_loc, unit, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IIf_none + ~stack_type:(option unit @$ bot) + ~kinstr: + (IIf_none + { + loc = dummy_loc; + branch_if_none = halt; + branch_if_some = IDrop (dummy_loc, halt); + k = halt; + }) + () + + let () = + benchmark_with_fixed_stack + ~name:Interpreter_workload.N_IOpt_map + ~salt:"none" + ~stack:(None, ((), eos)) + ~stack_type:(option unit @$ unit @$ bot) + ~kinstr:(IOpt_map {loc = dummy_loc; body = halt; k = halt}) + () + + let () = + benchmark_with_fixed_stack + ~name:Interpreter_workload.N_IOpt_map + ~salt:"some" + ~stack:(Some (), ((), eos)) + ~stack_type:(option unit @$ unit @$ bot) + ~kinstr:(IOpt_map {loc = dummy_loc; body = halt; k = halt}) + () + end + + module Unions = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_ILeft + ~stack_type:(unit @$ bot) + ~kinstr:(ICons_left (dummy_loc, unit, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IRight + ~stack_type:(unit @$ bot) + ~kinstr:(ICons_right (dummy_loc, unit, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IIf_left + ~stack_type:(cunion unit unit @$ bot) + ~kinstr: + (IIf_left + { + loc = dummy_loc; + branch_if_left = halt; + branch_if_right = halt; + k = halt; + }) + () + end + + module Lists = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICons_list + ~stack_type:(unit @$ list unit @$ bot) + ~kinstr:(ICons_list (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INil + ~stack_type:(unit @$ bot) + ~kinstr:(INil (dummy_loc, unit, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IIf_cons + ~stack_type:(list unit @$ unit @$ bot) + ~kinstr: + (IIf_cons + { + loc = dummy_loc; + branch_if_cons = IDrop (dummy_loc, IDrop (dummy_loc, halt)); + branch_if_nil = halt; + k = halt; + }) + () + + module Mapping = struct + let () = + (* + IList_map -> + IList_enter_body (empty case) -> + IHalt + *) + benchmark_with_fixed_stack + ~name:Interpreter_workload.N_IList_map + ~stack:(Script_list.empty, ((), eos)) + ~stack_type:(list unit @$ unit @$ bot) + ~kinstr:(IList_map (dummy_loc, halt, Some (list unit), halt)) + () + end + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IList_size + ~stack_type:(list unit @$ bot) + ~kinstr:(IList_size (dummy_loc, halt)) + () + + let () = + (* + IList_iter -> + IIter (empty case) -> + IHalt + *) + benchmark_with_fixed_stack + ~name:Interpreter_workload.N_IList_iter + ~stack:(Script_list.empty, ((), eos)) + ~stack_type:(list unit @$ unit @$ bot) + ~kinstr: + (IList_iter (dummy_loc, Some unit, IDrop (dummy_loc, halt), halt)) + () + end + + module Sets = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEmpty_set + ~stack_type:(unit @$ bot) + ~kinstr:(IEmpty_set (dummy_loc, unit, halt)) + () + + let set_iter_code = + ISet_iter (dummy_loc, Some int, IDrop (dummy_loc, halt), halt) + + let () = + (* + ISet_iter -> + (List.rev (set_fold)) -> + { + IIter -> + IDrop -> + ICons -> + ... + } + *) + simple_benchmark + ~name:Interpreter_workload.N_ISet_iter + ~intercept_stack:(Script_set.empty int, ((), eos)) + ~stack_type:(set int @$ unit @$ bot) + ~kinstr:set_iter_code + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISet_mem + ~stack_type:(int @$ set int @$ unit @$ bot) + ~kinstr:(ISet_mem (dummy_loc, halt)) + ~intercept_stack:(Script_int.zero, (Script_set.empty int, ((), eos))) + ~stack_sampler:(fun cfg rng_state () -> + assert (cfg.sampler.set_size.min >= 1) ; + let n = + Base_samplers.sample_in_interval + rng_state + ~range:cfg.sampler.set_size + in + let elts = adversarial_ints rng_state cfg n in + let set = + List.fold_left + (fun set elt -> Script_set.update elt true set) + (Script_set.empty int) + elts + in + let elt = + List.nth_opt elts (Random.State.int rng_state n) + |> WithExceptions.Option.get ~loc:__LOC__ + in + (elt, (set, ((), eos)))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISet_update + ~stack_type:(int @$ bool @$ set int @$ bot) + ~kinstr:(ISet_update (dummy_loc, halt)) + ~intercept_stack:(Script_int.zero, (false, (Script_set.empty int, eos))) + ~stack_sampler:(fun cfg rng_state () -> + assert (cfg.sampler.set_size.min >= 2) ; + let n = + Base_samplers.sample_in_interval + rng_state + ~range:cfg.sampler.set_size + in + let elts = adversarial_ints rng_state cfg (n + 1) in + let out_of_set, in_set = + match elts with [] -> assert false | hd :: tl -> (hd, tl) + in + let set = + List.fold_left + (fun set elt -> Script_set.update elt true set) + (Script_set.empty int) + in_set + in + let stack = + let flip = Random.State.bool rng_state in + if flip then + (* add an element not in the set *) + (out_of_set, (true, (set, eos))) + else + (* remove an element in the set *) + let elt = out_of_set in + let set = Script_set.update elt true set in + (elt, (flip, (set, eos))) + in + stack) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISet_size + ~stack_type:(set unit @$ bot) + ~kinstr:(ISet_size (dummy_loc, halt)) + () + end + + module Maps = struct + let generate_map_and_key_in_map (cfg : Default_config.config) rng_state = + let n = + Base_samplers.sample_in_interval rng_state ~range:cfg.sampler.set_size + in + let keys = adversarial_ints rng_state cfg n in + let map = + List.fold_left + (fun map i -> Script_map.update i (Some ()) map) + (Script_map.empty int) + keys + in + let (module M) = Script_map.get_module map in + let key = + M.OPS.fold (fun k _ -> function None -> Some k | x -> x) M.boxed None + |> WithExceptions.Option.get ~loc:__LOC__ + in + (key, map) + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEmpty_map + ~stack_type:(unit @$ bot) + ~kinstr:(IEmpty_map (dummy_loc, unit, Some unit, halt)) + () + + (* + let map_map_code = + IMap_map + ( dummy_loc, + ICdr (dummy_loc, halt_unitunit), + halt ) + *) + + let map_map_code () = + IMap_map + ( dummy_loc, + Some (map int unit), + IFailwith (dummy_loc, cpair int unit), + halt ) + + let () = + (* + Map_map (nonempty case) -> + (List.rev (map_fold nonempty_map)) -> + KMap_enter_body (nonempty case) -> + fail (early interruption) + *) + simple_benchmark + ~name:Interpreter_workload.N_IMap_map + ~intercept_stack: + (let map = Script_map.empty int in + (map, ((), eos))) + ~stack_type:(map int unit @$ unit @$ bot) + ~kinstr:(map_map_code ()) + () + + let kmap_iter_code = + IMap_iter (dummy_loc, Some (cpair int unit), IDrop (dummy_loc, halt), halt) + + let () = + (* + IMap_iter (nonempty case) -> + (List.rev (map_fold (nonempty))) -> + IIter (nonempty case) -> + ... + *) + simple_benchmark + ~name:Interpreter_workload.N_IMap_iter + ~intercept_stack: + (let map = Script_map.empty int in + (map, ((), eos))) + ~stack_type:(map int unit @$ unit @$ bot) + ~kinstr:kmap_iter_code + () + + let () = + (* + IMap_mem -> + (map_mem) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMap_mem + ~stack_type:(int @$ map int unit @$ unit @$ bot) + ~kinstr:(IMap_mem (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_map.empty int in + (Script_int.zero, (map, ((), eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_map_and_key_in_map cfg rng_state in + (key, (map, ((), eos)))) + () + + let () = + (* + IMap_get -> + (map_get) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMap_get + ~stack_type:(int @$ map int unit @$ unit @$ bot) + ~kinstr:(IMap_get (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_map.empty int in + (Script_int.zero, (map, ((), eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_map_and_key_in_map cfg rng_state in + (key, (map, ((), eos)))) + () + + let () = + (* + IMap_update -> + (map_update) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMap_update + ~stack_type:(int @$ option unit @$ map int unit @$ bot) + ~kinstr:(IMap_update (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_map.empty int in + (Script_int.zero, (None, (map, eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_map_and_key_in_map cfg rng_state in + (key, (Some (), (map, eos)))) + () + + let () = + (* + IMap_get_and_update -> + (map_update) -> + (map_get) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMap_get_and_update + ~stack_type:(int @$ option unit @$ map int unit @$ bot) + ~kinstr:(IMap_get_and_update (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_map.empty int in + (Script_int.zero, (None, (map, eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_map_and_key_in_map cfg rng_state in + (key, (Some (), (map, eos)))) + () + + let () = + (* + IMap_size -> + (map_update) -> + (map_get) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMap_size + ~stack_type:(map int unit @$ bot) + ~kinstr:(IMap_size (dummy_loc, halt)) + ~stack_sampler:(fun _cfg _rng_state -> + let map = Script_map.empty int in + fun () -> (map, eos)) + () + end + + module Big_maps = struct + let generate_big_map_and_key_in_map (cfg : Default_config.config) rng_state + = + let n = + Base_samplers.sample_in_interval rng_state ~range:cfg.sampler.set_size + in + let keys = adversarial_ints rng_state cfg n in + let map = + List.fold_left + (fun map i -> Script_map.update i (Some (Some ())) map) + (Script_map.empty int) + keys + in + let (module M) = Script_map.get_module map in + let key = + M.OPS.fold (fun k _ -> function None -> Some k | x -> x) M.boxed None + |> WithExceptions.Option.get ~loc:__LOC__ + in + let big_map = + raise_if_error + (Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let big_map = Script_big_map.empty int unit_t in + Script_map.fold + (fun k v acc -> + acc >>=? fun (bm, ctxt_acc) -> + Script_big_map.update ctxt_acc k v bm) + map + (return (big_map, ctxt)) + >|= Environment.wrap_tzresult + >>=? fun (big_map, _) -> return big_map )) + in + (key, big_map) + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEmpty_big_map + ~stack_type:(unit @$ bot) + ~kinstr:(IEmpty_big_map (dummy_loc, unit, unit, halt)) + () + + let () = + (* + IBig_map_mem -> + (update context with gas) + (big_map_mem) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBig_map_mem + ~stack_type:(int @$ big_map int unit @$ unit @$ bot) + ~kinstr:(IBig_map_mem (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_big_map_and_key_in_map cfg rng_state in + (key, (map, ((), eos)))) + () + + let () = + (* + IBig_map_get -> + (big_map_get) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBig_map_get + ~stack_type:(int @$ big_map int unit @$ unit @$ bot) + ~kinstr:(IBig_map_get (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_big_map.empty int unit in + (Script_int.zero, (map, ((), eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_big_map_and_key_in_map cfg rng_state in + (key, (map, ((), eos)))) + () + + let () = + (* + IBig_map_update -> + (big_map_update) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBig_map_update + ~stack_type:(int @$ option unit @$ big_map int unit @$ bot) + ~kinstr:(IBig_map_update (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_big_map.empty int unit in + (Script_int.zero, (None, (map, eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_big_map_and_key_in_map cfg rng_state in + (key, (Some (), (map, eos)))) + () + + let () = + (* + IBig_map_get_and_update -> + (big_map_update) -> + (big_map_get) -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBig_map_get_and_update + ~stack_type:(int @$ option unit @$ big_map int unit @$ bot) + ~kinstr:(IBig_map_get_and_update (dummy_loc, halt)) + ~intercept_stack: + (let map = Script_big_map.empty int unit in + (Script_int.zero, (None, (map, eos)))) + ~stack_sampler:(fun cfg rng_state () -> + let key, map = generate_big_map_and_key_in_map cfg rng_state in + (key, (Some (), (map, eos)))) + () + end + + module Strings = struct + open Script_string + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IConcat_string + ~intercept_stack:(Script_list.empty, eos) + ~stack_type:(list string @$ bot) + ~kinstr:(IConcat_string (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IConcat_string_pair + ~intercept_stack:(empty, (empty, eos)) + ~stack_type:(string @$ string @$ bot) + ~kinstr:(IConcat_string_pair (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISlice_string + ~stack_type:(nat @$ nat @$ string @$ bot) + ~kinstr:(ISlice_string (dummy_loc, halt)) + ~intercept_stack: + (let z = Script_int.zero_n in + (z, (z, (empty, eos)))) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let string = + Samplers.Random_value.value Script_typed_ir.string_t rng_state + in + let len = nat_of_positive_int (length string) in + (* worst case: offset = 0 *) + (nat_of_positive_int 0, (len, (string, eos)))) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IString_size + ~stack_type:(string @$ bot) + ~kinstr:(IString_size (dummy_loc, halt)) + () + end + + module Bytes = struct + (* Copy of [String] modulo renaming string to bytes. *) + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IConcat_bytes + ~intercept_stack:(Script_list.empty, eos) + ~stack_type:(list bytes @$ bot) + ~kinstr:(IConcat_bytes (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IConcat_bytes_pair + ~intercept_stack:(Bytes.empty, (Bytes.empty, eos)) + ~stack_type:(bytes @$ bytes @$ bot) + ~kinstr:(IConcat_bytes_pair (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISlice_bytes + ~stack_type:(nat @$ nat @$ bytes @$ bot) + ~kinstr:(ISlice_bytes (dummy_loc, halt)) + ~intercept_stack: + (let z = Script_int.zero_n in + (z, (z, (Bytes.empty, eos)))) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let bytes = + Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + let len = nat_of_positive_int (Bytes.length bytes) in + (* worst case: offset = 0 *) + (nat_of_positive_int 0, (len, (bytes, eos)))) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IBytes_size + ~stack_type:(bytes @$ bot) + ~kinstr:(IBytes_size (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAnd_bytes + ~intercept_stack:(Bytes.empty, (Bytes.empty, eos)) + ~stack_type:(bytes @$ bytes @$ bot) + ~kinstr:(IAnd_bytes (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IOr_bytes + ~intercept_stack:(Bytes.empty, (Bytes.empty, eos)) + ~stack_type:(bytes @$ bytes @$ bot) + ~kinstr:(IOr_bytes (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IXor_bytes + ~intercept_stack:(Bytes.empty, (Bytes.empty, eos)) + ~stack_type:(bytes @$ bytes @$ bot) + ~kinstr:(IXor_bytes (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INot_bytes + ~intercept_stack:(Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(INot_bytes (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ILsl_bytes + ~intercept_stack:(Bytes.empty, (Script_int.zero_n, eos)) + ~stack_type:(bytes @$ nat @$ bot) + ~kinstr:(ILsl_bytes (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let bytes = + Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + let shift = + Script_int.(abs (of_int (Random.State.int rng_state 64000))) + in + (bytes, (shift, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ILsr_bytes + ~intercept_stack:(Bytes.empty, (Script_int.zero_n, eos)) + ~stack_type:(bytes @$ nat @$ bot) + ~kinstr:(ILsr_bytes (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let bytes = + Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + let shift = + (* No need of samples of shift > bytes * 8 which are equivalent with + the case of shift = bytes * 8 where LSR returns empty bytes immediately *) + Script_int.( + abs + (of_int + (Random.State.int rng_state ((Bytes.length bytes * 8) + 1)))) + in + (bytes, (shift, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBytes_nat + ~stack_type:(nat @$ bot) + ~kinstr:(IBytes_nat (dummy_loc, halt)) + ~intercept_stack:(Script_int.one_n, eos) + (* Avoid the optimized case of 0 *) + ~stack_sampler:(fun cfg rng_state -> + let base_parameters = + {cfg.sampler.base_parameters with int_size = {min = 0; max = 4096}} + in + let sampler = {cfg.sampler with base_parameters} in + let _, (module Samplers) = make_default_samplers sampler in + fun () -> + let nat = + Samplers.Random_value.value Script_typed_ir.nat_t rng_state + in + (nat, eos)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_INat_bytes + ~stack_type:(bytes @$ bot) + ~kinstr:(INat_bytes (dummy_loc, halt)) + ~intercept_stack:(Bytes.empty, eos) + ~stack_sampler:(fun cfg rng_state -> + let base_parameters = + { + cfg.sampler.base_parameters with + bytes_size = {min = 0; max = 4096}; + } + in + let sampler = {cfg.sampler with base_parameters} in + let _, (module Samplers) = make_default_samplers sampler in + fun () -> + let bytes = + Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + (bytes, eos)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IBytes_int + ~stack_type:(int @$ bot) + ~kinstr:(IBytes_int (dummy_loc, halt)) + ~intercept_stack:(Script_int.one, eos) + (* Avoid the optimized case of 0 *) + ~stack_sampler:(fun cfg rng_state -> + let base_parameters = + {cfg.sampler.base_parameters with int_size = {min = 0; max = 4096}} + in + let sampler = {cfg.sampler with base_parameters} in + let _, (module Samplers) = make_default_samplers sampler in + fun () -> + let int = + Samplers.Random_value.value Script_typed_ir.int_t rng_state + in + (int, eos)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IInt_bytes + ~stack_type:(bytes @$ bot) + ~kinstr:(IInt_bytes (dummy_loc, halt)) + ~intercept_stack:(Bytes.empty, eos) + ~stack_sampler:(fun cfg rng_state -> + let base_parameters = + { + cfg.sampler.base_parameters with + bytes_size = {min = 0; max = 4096}; + } + in + let sampler = {cfg.sampler with base_parameters} in + let _, (module Samplers) = make_default_samplers sampler in + fun () -> + let bytes = + Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + (bytes, eos)) + () + end + + module Timestamps = struct + let zero_timestamp = Script_timestamp.of_zint Z.zero + + let zero_int = Script_int.zero + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAdd_seconds_to_timestamp + ~intercept_stack:(zero_int, (zero_timestamp, eos)) + ~stack_type:(int @$ timestamp @$ bot) + ~kinstr:(IAdd_seconds_to_timestamp (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAdd_timestamp_to_seconds + ~intercept_stack:(zero_timestamp, (zero_int, eos)) + ~stack_type:(timestamp @$ int @$ bot) + ~kinstr:(IAdd_timestamp_to_seconds (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISub_timestamp_seconds + ~intercept_stack:(zero_timestamp, (zero_int, eos)) + ~stack_type:(timestamp @$ int @$ bot) + ~kinstr:(ISub_timestamp_seconds (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IDiff_timestamps + ~intercept_stack:(zero_timestamp, (zero_timestamp, eos)) + ~stack_type:(timestamp @$ timestamp @$ bot) + ~kinstr:(IDiff_timestamps (dummy_loc, halt)) + () + end + + module Tez = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAdd_tez + ~stack_type:(mutez @$ mutez @$ bot) + ~kinstr:(IAdd_tez (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISub_tez + ~stack_type:(mutez @$ mutez @$ bot) + ~kinstr:(ISub_tez (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = + make_default_samplers cfg.Default_config.sampler + in + fun () -> + let a = Samplers.Random_value.value mutez rng_state in + let b = + match Alpha_context.Tez.(a /? 2L) with + | Error _ -> assert false + | Ok x -> x + in + (a, (b, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ISub_tez_legacy + ~stack_type:(mutez @$ mutez @$ bot) + ~kinstr:(ISub_tez_legacy (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = + make_default_samplers cfg.Default_config.sampler + in + fun () -> + let a = Samplers.Random_value.value mutez rng_state in + let b = + match Alpha_context.Tez.(a /? 2L) with + | Error _ -> assert false + | Ok x -> x + in + (a, (b, eos))) + () + + let sample_tez_nat (module Samplers : Michelson_samplers.S) rng_state = + let mutez = Samplers.Random_value.value mutez rng_state in + let mutez_int64 = Alpha_context.Tez.to_mutez mutez in + let int64 = Int64.(div max_int (mul mutez_int64 2L)) in + let nat = + match Script_int.(is_nat (of_int64 int64)) with + | None -> assert false + | Some nat -> nat + in + (mutez, nat) + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMul_teznat + ~stack_type:(mutez @$ nat @$ bot) + ~kinstr:(IMul_teznat (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, samplers = make_default_samplers cfg.sampler in + fun () -> + let mutez, nat = sample_tez_nat samplers rng_state in + (mutez, (nat, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IMul_nattez + ~stack_type:(nat @$ mutez @$ bot) + ~kinstr:(IMul_nattez (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, samplers = make_default_samplers cfg.sampler in + fun () -> + let mutez, nat = sample_tez_nat samplers rng_state in + (nat, (mutez, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IEdiv_teznat + ~intercept_stack:(Alpha_context.Tez.zero, (Script_int.zero_n, eos)) + ~stack_type:(mutez @$ nat @$ bot) + ~kinstr:(IEdiv_teznat (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, samplers = make_default_samplers cfg.sampler in + fun () -> + let mutez, nat = sample_tez_nat samplers rng_state in + (mutez, (nat, eos))) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEdiv_tez + ~intercept_stack:(Alpha_context.Tez.zero, (Alpha_context.Tez.zero, eos)) + ~stack_type:(mutez @$ mutez @$ bot) + ~kinstr:(IEdiv_tez (dummy_loc, halt)) + () + end + + module Booleans = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IOr + ~stack_type:(bool @$ bool @$ bot) + ~kinstr:(IOr (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAnd + ~stack_type:(bool @$ bool @$ bot) + ~kinstr:(IAnd (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IXor + ~stack_type:(bool @$ bool @$ bot) + ~kinstr:(IXor (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INot + ~stack_type:(bool @$ bot) + ~kinstr:(INot (dummy_loc, halt)) + () + end + + module Integers = struct + let zero = Script_int.zero + + let zero_n = Script_int.zero_n + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IIs_nat + ~intercept_stack:(zero, eos) + ~stack_type:(int @$ bot) + ~kinstr:(IIs_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INeg + ~intercept_stack:(zero, eos) + ~stack_type:(int @$ bot) + ~kinstr:(INeg (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IAbs_int + ~stack_type:(int @$ bot) + ~kinstr:(IAbs_int (dummy_loc, halt)) + ~intercept_stack:(zero, eos) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let x = Samplers.Michelson_base.nat rng_state in + let neg_x = Script_int.neg x in + (neg_x, eos)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IInt_nat + ~intercept_stack:(zero_n, eos) + ~stack_type:(nat @$ bot) + ~kinstr:(IInt_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAdd_int + ~intercept_stack:(zero, (zero, eos)) + ~stack_type:(int @$ int @$ bot) + ~kinstr:(IAdd_int (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAdd_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(IAdd_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISub_int + ~intercept_stack:(zero, (zero, eos)) + ~stack_type:(int @$ int @$ bot) + ~kinstr:(ISub_int (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IMul_int + ~intercept_stack:(zero, (zero, eos)) + ~stack_type:(int @$ int @$ bot) + ~kinstr:(IMul_int (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IMul_nat + ~intercept_stack:(zero_n, (zero, eos)) + ~stack_type:(nat @$ int @$ bot) + ~kinstr:(IMul_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEdiv_int + ~intercept_stack:(zero, (zero, eos)) + ~stack_type:(int @$ int @$ bot) + ~kinstr:(IEdiv_int (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEdiv_nat + ~intercept_stack:(zero_n, (zero, eos)) + ~stack_type:(nat @$ int @$ bot) + ~kinstr:(IEdiv_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ILsl_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(ILsl_nat (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let x = Samplers.Michelson_base.nat rng_state in + (* shift must be in [0;256]: 1 byte max *) + let shift = + Script_int.(abs (of_int (Random.State.int rng_state 256))) + in + (x, (shift, eos))) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ILsr_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(ILsr_nat (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let x = Samplers.Michelson_base.nat rng_state in + (* shift must be in [0;256]: 1 byte max *) + let shift = + Script_int.(abs (of_int (Random.State.int rng_state 256))) + in + (x, (shift, eos))) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IOr_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(IOr_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAnd_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(IAnd_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAnd_int_nat + ~intercept_stack:(zero, (zero_n, eos)) + ~stack_type:(int @$ nat @$ bot) + ~kinstr:(IAnd_int_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IXor_nat + ~intercept_stack:(zero_n, (zero_n, eos)) + ~stack_type:(nat @$ nat @$ bot) + ~kinstr:(IXor_nat (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INot_int + ~intercept_stack:(zero, eos) + ~stack_type:(int @$ bot) + ~kinstr:(INot_int (dummy_loc, halt)) + () + end + + module Control = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IIf + ~stack_type:(bool @$ unit @$ bot) + ~kinstr: + (IIf + { + loc = dummy_loc; + branch_if_true = halt; + branch_if_false = halt; + k = halt; + }) + () + + let () = + (* + ILoop -> + either + - IHalt (false on top of stack) + - IConst false ; IHalt (true on top of stack) + *) + let push_false = IConst (dummy_loc, bool, false, halt) in + simple_benchmark + ~name:Interpreter_workload.N_ILoop + ~stack_type:(bool @$ bot) + ~kinstr:(ILoop (dummy_loc, push_false, halt)) + () + + let () = + (* + ILoop_left -> + ICons_right -> + IHalt + *) + let cons_r = ICons_right (dummy_loc, unit, halt) in + simple_benchmark + ~name:Interpreter_workload.N_ILoop_left + ~stack_type:(cunion unit unit @$ bot) + ~kinstr:(ILoop_left (dummy_loc, cons_r, halt)) + () + + let () = + (* + IDip -> + IHalt -> + IConst -> + IHalt + *) + simple_benchmark + ~name:Interpreter_workload.N_IDip + ~stack_type:(unit @$ unit @$ bot) + ~kinstr:(IDip (dummy_loc, halt, Some unit, halt)) + () + + let dummy_lambda = + let open Script_typed_ir in + let descr = + { + kloc = dummy_loc; + kbef = unit @$ bot; + kaft = unit @$ bot; + kinstr = halt; + } + in + Lam (descr, Micheline.Int (dummy_loc, Z.zero)) + + let dummy_lambda_rec = + let open Script_typed_ir in + let descr = + { + kloc = dummy_loc; + kbef = unit @$ lambda unit unit @$ bot; + kaft = unit @$ bot; + kinstr = + IDrop + (dummy_loc, IDrop (dummy_loc, IConst (dummy_loc, unit, (), halt))); + } + in + LamRec (descr, Micheline.Int (dummy_loc, Z.zero)) + + let () = + (* + IExec -> + (switch to in-context gas-counting) -> + interp lambda code -> + IHalt + *) + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IExec + ~stack_type:(unit @$ lambda unit unit @$ bot) + ~kinstr:(IExec (dummy_loc, Some (unit @$ bot), halt)) + ~stack_sampler:(fun _cfg rng_state () -> + if Base_samplers.uniform_bool rng_state then ((), (dummy_lambda, eos)) + else ((), (dummy_lambda_rec, eos))) + () + + let () = + (* + IApply -> + unparse unit -> + unparse unit_ty -> + construct term -> + IHalt + *) + let dummy_lambda_pair = + let open Script_typed_ir in + let descr = + { + kloc = dummy_loc; + kbef = cpair unit unit @$ bot; + kaft = unit @$ bot; + kinstr = ICdr (dummy_loc, halt); + } + in + Lam (descr, Micheline.Int (dummy_loc, Z.zero)) + in + let dummy_lambda_pair_rec = + let open Script_typed_ir in + let descr = + { + kloc = dummy_loc; + kbef = cpair unit unit @$ lambda (cpair unit unit) unit @$ bot; + kaft = unit @$ bot; + kinstr = + IDrop + ( dummy_loc, + IDrop (dummy_loc, IConst (dummy_loc, unit, (), halt)) ); + } + in + LamRec (descr, Micheline.Int (dummy_loc, Z.zero)) + in + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_IApply + ~stack_type:(unit @$ lambda (cpair unit unit) unit @$ bot) + ~kinstr:(IApply (dummy_loc, unit, halt)) + ~stack_sampler:(fun _cfg rng_state () -> + if Base_samplers.uniform_bool rng_state then + ((), (dummy_lambda_pair, eos)) + else ((), (dummy_lambda_pair_rec, eos))) + () + + let () = + (* + ILambda -> + IHalt + *) + simple_benchmark + ~name:Interpreter_workload.N_ILambda + ~stack_type:(unit @$ bot) + ~kinstr:(ILambda (dummy_loc, dummy_lambda, halt)) + () + + let () = + (* + ILambda (rec) -> + IHalt + *) + simple_benchmark + ~name:Interpreter_workload.N_ILambda + ~salt:"_rec" + ~stack_type:(unit @$ bot) + ~kinstr:(ILambda (dummy_loc, dummy_lambda_rec, halt)) + () + + let () = + (* + IFailwith -> + (unparse_data Unit) -> + (strip_locations) -> + fail + *) + simple_benchmark + ~name:Interpreter_workload.N_IFailwith + ~amplification:100 + ~stack_type:(unit @$ bot) + ~kinstr:(IFailwith (dummy_loc, unit)) + () + end + + module Comparison = struct + let () = + benchmark + ~name:Interpreter_workload.N_ICompare + ~kinstr_and_stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let size = + Base_samplers.sample_in_interval + rng_state + ~range:cfg.compare.type_size + in + let (Script_ir_translator.Ex_comparable_ty ty) = + Samplers.Random_type.m_comparable_type ~size rng_state + in + let value = Samplers.Random_value.comparable ty rng_state in + let kinstr = ICompare (dummy_loc, ty, halt) in + Ex_stack_and_kinstr + { + stack = (value, (value, eos)); + stack_type = ty @$ ty @$ bot; + kinstr; + }) + () + end + + module Comparators = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEq + ~stack_type:(int @$ bot) + ~kinstr:(IEq (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INeq + ~stack_type:(int @$ bot) + ~kinstr:(INeq (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ILt + ~stack_type:(int @$ bot) + ~kinstr:(ILt (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IGt + ~stack_type:(int @$ bot) + ~kinstr:(IGt (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ILe + ~stack_type:(int @$ bot) + ~kinstr:(ILe (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IGe + ~stack_type:(int @$ bot) + ~kinstr:(IGe (dummy_loc, halt)) + () + end + + module Proto = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAddress + ~stack_type:(contract unit @$ bot) + ~kinstr:(IAddress (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IContract + ~stack_type:(address @$ bot) + ~kinstr: + (IContract (dummy_loc, unit, Alpha_context.Entrypoint.default, halt)) + () + + let () = + simple_benchmark_with_stack_sampler + ~name:Interpreter_workload.N_ITransfer_tokens + ~stack_type:(unit @$ mutez @$ contract unit @$ bot) + ~kinstr:(ITransfer_tokens (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + fun () -> + let contract = + Samplers.Random_value.value (contract unit) rng_state + in + let amount = + match contract with + | Typed_implicit _ | Typed_originated _ -> + Samplers.Random_value.value mutez rng_state + | Typed_sc_rollup _ -> Alpha_context.Tez.zero + in + ((), (amount, (contract, eos)))) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IImplicit_account + ~stack_type:(key_hash @$ bot) + ~kinstr:(IImplicit_account (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ICreate_contract + ~stack_type:(option key_hash @$ mutez @$ unit @$ bot) + ~kinstr: + (ICreate_contract + { + loc = dummy_loc; + storage_type = unit; + code = Micheline.(strip_locations @@ Seq (0, [])); + k = halt; + }) + () + + let () = + let name = + match Protocol.Script_string.of_string "view" with + | Ok s -> s + | Error _ -> assert false + in + simple_benchmark + ~name:Interpreter_workload.N_IView + ~stack_type:(unit @$ address @$ bot) + ~kinstr: + (IView + ( dummy_loc, + View_signature {name; input_ty = unit; output_ty = unit}, + Some bot, + halt )) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISet_delegate + ~stack_type:(option key_hash @$ bot) + ~kinstr:(ISet_delegate (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_INow + ~stack_type:(unit @$ bot) + ~kinstr:(INow (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IMin_block_time + ~stack_type:bot + ~kinstr:(IMin_block_time (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IBalance + ~stack_type:(unit @$ bot) + ~kinstr:(IBalance (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ILevel + ~stack_type:(unit @$ bot) + ~kinstr:(ILevel (dummy_loc, halt)) + () + + let check_signature (algo : Tezos_crypto.Signature.algo) ~for_intercept = + let name = + match algo with + | Tezos_crypto.Signature.Ed25519 -> + Interpreter_workload.N_ICheck_signature_ed25519 + | Tezos_crypto.Signature.Secp256k1 -> + Interpreter_workload.N_ICheck_signature_secp256k1 + | Tezos_crypto.Signature.P256 -> + Interpreter_workload.N_ICheck_signature_p256 + | Tezos_crypto.Signature.Bls -> + Interpreter_workload.N_ICheck_signature_bls + in + benchmark_with_stack_sampler + ~intercept:for_intercept + ~name + ~stack_type:(public_key @$ signature @$ bytes @$ bot) + ~kinstr:(ICheck_signature (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let (module Crypto_samplers), (module Samplers) = + make_default_samplers ~algo:(`Algo algo) cfg.Default_config.sampler + in + fun () -> + let _pkh, pk, sk = Crypto_samplers.all rng_state in + let unsigned_message = + if for_intercept then Environment.Bytes.empty + else Samplers.Random_value.value Script_typed_ir.bytes_t rng_state + in + let signed_message = + Tezos_crypto.Signature.sign sk unsigned_message + in + let signed_message = Script_signature.make signed_message in + (pk, (signed_message, (unsigned_message, eos)))) + () + + let check_signature algo = + check_signature algo ~for_intercept:true ; + check_signature algo ~for_intercept:false + + let () = check_signature Tezos_crypto.Signature.Ed25519 + + let () = check_signature Tezos_crypto.Signature.Secp256k1 + + let () = check_signature Tezos_crypto.Signature.P256 + + let () = check_signature Tezos_crypto.Signature.Bls + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IHash_key + ~stack_type:(public_key @$ bot) + ~kinstr:(IHash_key (dummy_loc, halt)) + () + + let () = + benchmark + ~name:Interpreter_workload.N_IPack + ~kinstr_and_stack_sampler:(fun _cfg _rng_state -> + let kinstr = IPack (dummy_loc, unit, halt) in + fun () -> + Ex_stack_and_kinstr + {stack = ((), eos); stack_type = unit @$ bot; kinstr}) + () + + let () = + benchmark + ~name:Interpreter_workload.N_IUnpack + ~kinstr_and_stack_sampler:(fun _cfg rng_state -> + let b = + raise_if_error + (Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + Script_ir_translator.pack_data ctxt unit () + >|= Environment.wrap_tzresult + >>=? fun (bytes, _) -> return bytes )) + in + let kinstr = IUnpack (dummy_loc, unit, halt) in + fun () -> + Ex_stack_and_kinstr + {stack = (b, eos); stack_type = bytes @$ bot; kinstr}) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IBlake2b + ~intercept_stack:(Environment.Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(IBlake2b (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISha256 + ~intercept_stack:(Environment.Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(ISha256 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISha512 + ~intercept_stack:(Environment.Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(ISha512 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IKeccak + ~intercept_stack:(Environment.Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(IKeccak (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISha3 + ~intercept_stack:(Environment.Bytes.empty, eos) + ~stack_type:(bytes @$ bot) + ~kinstr:(ISha3 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISource + ~stack_type:(unit @$ bot) + ~kinstr:(ISource (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISender + ~stack_type:(unit @$ bot) + ~kinstr:(ISender (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISelf + ~stack_type:(unit @$ bot) + ~kinstr: + (ISelf (dummy_loc, unit, Alpha_context.Entrypoint.default, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ISelf_address + ~stack_type:(unit @$ bot) + ~kinstr:(ISelf_address (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IAmount + ~stack_type:(unit @$ bot) + ~kinstr:(IAmount (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IChainId + ~stack_type:(unit @$ bot) + ~kinstr:(IChainId (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IVoting_power + ~stack_type:(key_hash @$ bot) + ~kinstr:(IVoting_power (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_ITotal_voting_power + ~stack_type:(unit @$ bot) + ~kinstr:(ITotal_voting_power (dummy_loc, halt)) + () + end + + let () = + let memo_size = + match Alpha_context.Sapling.Memo_size.parse_z Z.zero with + | Error _ -> assert false + | Ok sz -> sz + in + simple_benchmark + ~name:Interpreter_workload.N_ISapling_empty_state + ~stack_type:(unit @$ bot) + ~kinstr:(ISapling_empty_state (dummy_loc, memo_size, halt)) + () + + module type Type_transaction = sig + val type_transaction : Sapling_generation.type_transaction + + val suffix : string + end + + module Register_Sapling_benchmark (Type_transaction : Type_transaction) = + struct + let is_empty = + match Type_transaction.type_transaction with Empty -> true | _ -> false + + let () = + (* Note that memo_size is hardcoded to 0 in module [Sapling_generation]. *) + let memo_size = + match Alpha_context.Sapling.Memo_size.parse_z Z.zero with + | Error _ -> assert false + | Ok sz -> sz + in + let info, name = + info_and_name + ~intercept:is_empty + ("ISapling_verify_update_" ^ Type_transaction.suffix) + in + let module B : Benchmark.S = struct + let name = name + + let info = info + + include Default_config + include Default_boilerplate + + let models = + Interpreter_model.make_model + (Some (Instr_name Interpreter_workload.N_ISapling_verify_update)) + + let stack_type = + let spl_state = sapling_state memo_size in + let spl_tx = sapling_transaction memo_size in + spl_tx @$ spl_state @$ bot + + let kinstr = ISapling_verify_update (dummy_loc, halt) + + let prepare_sapling_execution_environment sapling_forge_rng_seed + sapling_transition = + let sapling_forge_rng_state = + Random.State.make + @@ Option.fold + ~none:Sapling_generation.shared_seed + ~some:(fun seed -> [|seed|]) + sapling_forge_rng_seed + in + (* Prepare context. We _must_ reuse the same seed as the one used for + the context when generating the transactions. This ensures that the + bootstrap account match and that the transactions can be replayed. *) + let result = + Lwt_main.run + ( Execution_context.make ~rng_state:sapling_forge_rng_state + >>=? fun (ctxt, step_constants) -> + (* Prepare a sapling state able to replay the transition. *) + Sapling_generation.prepare_seeded_state sapling_transition ctxt + >>=? fun (_, _, _, _, ctxt, state_id) -> + Alpha_context.Sapling.(state_from_id ctxt (Id.parse_z state_id)) + >|= Environment.wrap_tzresult + >>=? fun (state, ctxt) -> return (ctxt, state, step_constants) + ) + in + match result with + | Ok r -> r + | Error _ -> + Format.eprintf + "Error in prepare_sapling_execution_environment, aborting@." ; + Stdlib.failwith "prepare_sapling_execution_environment" + + let create_benchmarks ~rng_state ~bench_num (config : config) = + ignore rng_state ; + match config.sapling with + | {sapling_txs_file; seed} -> + let transitions = + Sapling_generation.load + ~filename:sapling_txs_file + Type_transaction.type_transaction + in + let length = List.length transitions in + if length < bench_num && not is_empty then + Format.eprintf + "ISapling_verify_update: warning, only %d available \ + transactions (requested %d)@." + length + bench_num ; + let transitions = + List.take_n (min bench_num length) transitions + in + List.map + (fun (_, transition) () -> + let ctxt, state, step_constants = + prepare_sapling_execution_environment seed transition + in + let address = + Alpha_context.Contract.( + to_b58check (Originated step_constants.self)) + in + let chain_id = + Environment.Chain_id.to_b58check step_constants.chain_id + in + let anti_replay = address ^ chain_id in + (* Checks that the transaction is correct*) + let () = + match + Sapling_validator.verify_update + (Sapling_generation.alpha_to_raw ctxt) + (Obj.magic state) + transition.sapling_tx + anti_replay + |> Lwt_main.run + with + | Ok (_, Some _) -> () + | Ok (_, None) -> + Stdlib.failwith "benchmarked transaction is incorrect" + | _ -> assert false + in + let stack_instr = + Ex_stack_and_kinstr + { + stack = (transition.sapling_tx, (state, eos)); + stack_type; + kinstr; + } + in + benchmark_from_kinstr_and_stack + ctxt + step_constants + stack_instr) + transitions + end in + Registration_helpers.register (module B) + end + + module Sapling_empty = struct + let module A = Register_Sapling_benchmark (struct + let type_transaction = Sapling_generation.Empty + + let suffix = "empty" + end) in + () + end + + module Sapling_no_inputs = struct + let module A = Register_Sapling_benchmark (struct + let type_transaction = Sapling_generation.No_inputs + + let suffix = "no_inputs" + end) in + () + end + + module Sapling_no_outputs = struct + let module A = Register_Sapling_benchmark (struct + let type_transaction = Sapling_generation.No_outputs + + let suffix = "no_output" + end) in + () + end + + module Sapling_full = struct + let module A = Register_Sapling_benchmark (struct + let type_transaction = Sapling_generation.Full_transaction + + let suffix = "full" + end) in + () + end + + (* when benchmarking, compile bls12-381-unix without ADX, see + https://gitlab.com/dannywillems/ocaml-bls12-381/-/blob/71d0b4d467fbfaa6452d702fcc408d7a70916a80/README.md#install + *) + module Bls12_381 = struct + let check () = + if not Bls12_381.built_with_blst_portable then ( + Format.eprintf + "BLS must be built without ADX to run the BLS benchmarks. Try \ + compiling again after setting the environment variable \ + BLST_PORTABLE. Aborting.@." ; + Stdlib.failwith "bls_not_built_with_blst_portable") + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IAdd_bls12_381_g1 + ~stack_type:(bls12_381_g1 @$ bls12_381_g1 @$ bot) + ~kinstr:(IAdd_bls12_381_g1 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IAdd_bls12_381_g2 + ~stack_type:(bls12_381_g2 @$ bls12_381_g2 @$ bot) + ~kinstr:(IAdd_bls12_381_g2 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IAdd_bls12_381_fr + ~stack_type:(bls12_381_fr @$ bls12_381_fr @$ bot) + ~kinstr:(IAdd_bls12_381_fr (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_g1 + ~stack_type:(bls12_381_g1 @$ bls12_381_fr @$ bot) + ~kinstr:(IMul_bls12_381_g1 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_g2 + ~stack_type:(bls12_381_g2 @$ bls12_381_fr @$ bot) + ~kinstr:(IMul_bls12_381_g2 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_fr + ~stack_type:(bls12_381_fr @$ bls12_381_fr @$ bot) + ~kinstr:(IMul_bls12_381_fr (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_z_fr + ~stack_type:(bls12_381_fr @$ int @$ bot) + ~kinstr:(IMul_bls12_381_z_fr (dummy_loc, halt)) + () + + let () = + benchmark_with_stack_sampler + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_z_fr + ~intercept:true + ~stack_type:(bls12_381_fr @$ int @$ bot) + ~kinstr:(IMul_bls12_381_z_fr (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + let fr_sampler = Samplers.Random_value.value bls12_381_fr in + let zero = Script_int.zero in + fun () -> (fr_sampler rng_state, (zero, eos))) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_fr_z + ~stack_type:(int @$ bls12_381_fr @$ bot) + ~kinstr:(IMul_bls12_381_fr_z (dummy_loc, halt)) + () + + let () = + benchmark_with_stack_sampler + ~check + ~name:Interpreter_workload.N_IMul_bls12_381_fr_z + ~intercept:true + ~stack_type:(int @$ bls12_381_fr @$ bot) + ~kinstr:(IMul_bls12_381_fr_z (dummy_loc, halt)) + ~stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + let fr_sampler = Samplers.Random_value.value bls12_381_fr in + let zero = Script_int.zero in + fun () -> (zero, (fr_sampler rng_state, eos))) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_IInt_bls12_381_z_fr + ~stack_type:(bls12_381_fr @$ bot) + ~kinstr:(IInt_bls12_381_fr (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_INeg_bls12_381_g1 + ~stack_type:(bls12_381_g1 @$ bot) + ~kinstr:(INeg_bls12_381_g1 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_INeg_bls12_381_g2 + ~stack_type:(bls12_381_g2 @$ bot) + ~kinstr:(INeg_bls12_381_g2 (dummy_loc, halt)) + () + + let () = + simple_benchmark + ~check + ~name:Interpreter_workload.N_INeg_bls12_381_fr + ~stack_type:(bls12_381_fr @$ bot) + ~kinstr:(INeg_bls12_381_fr (dummy_loc, halt)) + () + + let () = + let (Ty_ex_c p) = pair bls12_381_g1 bls12_381_g2 in + simple_benchmark + ~check + ~name:Interpreter_workload.N_IPairing_check_bls12_381 + ~stack_type:(list p @$ bot) + ~kinstr:(IPairing_check_bls12_381 (dummy_loc, halt)) + () + end + + module Tickets = struct + let () = + simple_benchmark + ~name:Interpreter_workload.N_ITicket + ~stack_type:(unit @$ nat @$ bot) + ~kinstr:(ITicket (dummy_loc, Some unit, halt)) + () + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IRead_ticket + ~stack_type:(ticket unit @$ bot) + ~kinstr:(IRead_ticket (dummy_loc, Some unit, halt)) + () + + let split_ticket_instr = ISplit_ticket (dummy_loc, halt) + + let stack_type = ticket unit @$ cpair nat nat @$ bot + + let () = + let one = Script_int.one_n in + let ticket = + { + ticketer = + Alpha_context.Contract.Implicit + Environment.Signature.Public_key_hash.zero; + contents = (); + amount = Ticket_amount.(add one one); + } + in + benchmark_with_fixed_stack + ~intercept:true + ~name:Interpreter_workload.N_ISplit_ticket + ~stack_type + ~stack:(ticket, ((one, one), eos)) + ~kinstr:split_ticket_instr + () + + let () = + benchmark + ~name:Interpreter_workload.N_ISplit_ticket + ~kinstr_and_stack_sampler:(fun config rng_state -> + let _, (module Samplers) = + make_default_samplers config.Default_config.sampler + in + fun () -> + let x_amount = + Script_int.succ_n @@ Samplers.Random_value.value nat rng_state + in + let y_amount = + Script_int.succ_n @@ Samplers.Random_value.value nat rng_state + in + let amount = Script_int.add_n x_amount y_amount in + let amount = + (* this is safe because x_amount > 0 and y_amount > 0 *) + WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_n amount + in + let ticket = Samplers.Random_value.value (ticket unit) rng_state in + let ticket = {ticket with amount} in + Ex_stack_and_kinstr + { + stack = (ticket, ((x_amount, y_amount), eos)); + stack_type; + kinstr = split_ticket_instr; + }) + () + + let join_tickets_instr = IJoin_tickets (dummy_loc, string, halt) + + let ticket_str = ticket string + + let stack_type = + let (Ty_ex_c p) = pair ticket_str ticket_str in + p @$ bot + + let () = + benchmark + ~intercept:true + ~name:Interpreter_workload.N_IJoin_tickets + ~kinstr_and_stack_sampler:(fun config rng_state -> + let _, (module Samplers) = + make_default_samplers config.Default_config.sampler + in + fun () -> + let ticket = + Samplers.Random_value.value (ticket string) rng_state + in + let ticket = + { + ticket with + contents = Script_string.empty; + amount = Ticket_amount.one; + } + in + Ex_stack_and_kinstr + { + stack = ((ticket, ticket), eos); + stack_type; + kinstr = join_tickets_instr; + }) + () + + let () = + benchmark + ~name:Interpreter_workload.N_IJoin_tickets + ~kinstr_and_stack_sampler:(fun config rng_state -> + let _, (module Samplers) = + make_default_samplers config.Default_config.sampler + in + fun () -> + let ticket = + Samplers.Random_value.value (ticket string) rng_state + in + let alt_amount = + let amount = Samplers.Random_value.value nat rng_state in + let open Ticket_amount in + match of_n amount with + | Some amount -> add amount one + | None -> one + in + let ticket' = {ticket with amount = alt_amount} in + Ex_stack_and_kinstr + { + stack = ((ticket, ticket'), eos); + stack_type; + kinstr = join_tickets_instr; + }) + () + end + + module Timelock = struct + let name = Interpreter_workload.N_IOpen_chest + + let stack_type = + Michelson_types.chest_key @$ Michelson_types.chest @$ nat @$ bot + + let kinstr = IOpen_chest (dummy_loc, halt) + + let resulting_stack chest chest_key time = + let chest = Script_timelock.make_chest chest in + let chest_key = Script_timelock.make_chest_key chest_key in + ( chest_key, + ( chest, + ( Script_int.is_nat (Script_int.of_int time) + |> WithExceptions.Option.get ~loc:"Timelock:gas benchmarks", + eos ) ) ) + + let () = + benchmark_with_stack_sampler + ~intercept:true + ~name + ~kinstr + ~stack_type + ~stack_sampler:(fun _ rng_state () -> + let chest, chest_key = + Timelock_samplers.chest_sampler ~plaintext_size:1 ~time:0 ~rng_state + in + resulting_stack chest chest_key 0) + () + + let () = + benchmark_with_stack_sampler + ~name + ~kinstr + ~stack_type + ~stack_sampler:(fun _ rng_state () -> + let log_time = + Base_samplers.sample_in_interval + ~range:{min = 0; max = 29} + rng_state + in + let time = Random.State.int rng_state (Int.shift_left 1 log_time) in + let plaintext_size = + Base_samplers.sample_in_interval + ~range:{min = 1; max = 10000} + rng_state + in + + let chest, chest_key = + Timelock_samplers.chest_sampler ~plaintext_size ~time ~rng_state + in + resulting_stack chest chest_key time) + () + end + + module Continuations = struct + let () = + (* + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KNil + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KNil in + let stack = eos in + let stack_type = bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KCons -> step + KHalt -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KCons + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KCons (halt, KNil) in + let stack = ((), eos) in + let stack_type = unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KReturn -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KReturn + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KReturn (eos, Some (unit @$ bot), KNil) in + let stack = ((), eos) in + let stack_type = unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KView_exit -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KView_exit + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let open Script_typed_ir in + let open Alpha_context in + let step_constants = + { + source = + Contract.Implicit Tezos_crypto.Signature.Public_key_hash.zero; + payer = Tezos_crypto.Signature.Public_key_hash.zero; + self = Contract_hash.zero; + amount = Tez.zero; + balance = Tez.zero; + chain_id = Tezos_crypto.Chain_id.zero; + now = Script_timestamp.of_zint Z.zero; + level = Script_int.zero_n; + } + in + let cont = KView_exit (step_constants, KNil) in + let stack = ((), eos) in + let stack_type = unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KLoop_in -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KLoop_in + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KLoop_in (IConst (dummy_loc, bool, false, halt), KNil) in + let stack = (false, ((), eos)) in + let stack_type = bool @$ unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KLoop_in_left -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KLoop_in_left + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = + KLoop_in_left (ICons_right (dummy_loc, unit, halt), KNil) + in + let stack = (R (), eos) in + let stack_type = cunion unit unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KUndip -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KUndip + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KUndip ((), Some unit, KNil) in + let stack = eos in + let stack_type = bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KIter (empty case) -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KIter + ~salt:"_empty" + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KIter (IDrop (dummy_loc, halt), Some unit, [], KNil) in + let stack = ((), eos) in + let stack_type = unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KIter (nonempty case) -> step + KDrop -> step + KHalt -> next + KIter (empty case) -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KIter + ~salt:"_nonempty" + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let cont = KIter (IDrop (dummy_loc, halt), Some unit, [()], KNil) in + let stack = ((), eos) in + let stack_type = unit @$ bot in + fun () -> Ex_stack_and_cont {stack; cont; stack_type}) + () + + let () = + (* + KList_enter_body ([()], bot accumulator case) -> step + KHalt -> next + KList_exit_body ([], []) -> + KList_enter_body ([], [()] -> + List.rev singleton + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KList_enter_body + ~salt:"_singleton_list" + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let kbody = halt in + fun () -> + let cont = + KList_enter_body + (kbody, [()], Script_list.empty, Some (list unit), 1, KNil) + in + Ex_stack_and_cont + {stack = ((), eos); stack_type = unit @$ bot; cont}) + () + + let () = + (* + KList_enter_body (empty list, nonempty accumulator case) -> + {List.rev n elements} -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KList_enter_body + ~salt:"_terminal" + ~cont_and_stack_sampler:(fun cfg rng_state -> + let _, (module Samplers) = make_default_samplers cfg.sampler in + let kbody = halt in + fun () -> + let ys = Samplers.Random_value.value (list unit) rng_state in + let cont = + KList_enter_body (kbody, [], ys, Some (list unit), ys.length, KNil) + in + Ex_stack_and_cont + {stack = ((), eos); stack_type = unit @$ bot; cont}) + () + + let () = + (* + KList_enter_body (empty list, bot accumulator case) -> + {List.rev singleton} -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~intercept:true + ~name:Interpreter_workload.N_KList_enter_body + ~salt:"_terminal" + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let kbody = halt in + fun () -> + let cont = + KList_enter_body + (kbody, [], Script_list.empty, Some (list unit), 1, KNil) + in + Ex_stack_and_cont + {stack = ((), eos); stack_type = unit @$ bot; cont}) + () + + let () = + (* + KList_exit_body (empty list) -> next + KList_enter_body -> + {List.rev 1 element} -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~intercept:true + ~name:Interpreter_workload.N_KList_exit_body + ~salt:"_terminal" + ~cont_and_stack_sampler:(fun _cfg _rng_state -> + let kbody = halt in + let cont = + KList_exit_body + (kbody, [], Script_list.empty, Some (list unit), 1, KNil) + in + fun () -> + Ex_stack_and_cont + {stack = ((), ((), eos)); stack_type = unit @$ unit @$ bot; cont}) + () + + let stack_type = cpair int unit @$ unit @$ bot + + let map_enter_body_code = + let kbody = ICdr (dummy_loc, halt) in + fun accu -> + KMap_enter_body + (kbody, accu, Script_map.empty int, Some (map int unit), KNil) + + let () = + (* + KMap_enter_body (empty case) -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~salt:"_empty" + ~name:Interpreter_workload.N_KMap_enter_body + ~cont_and_stack_sampler:(fun _cfg _rng_state () -> + Ex_stack_and_cont + { + stack = ((), eos); + stack_type = unit @$ bot; + cont = map_enter_body_code []; + }) + () + + let () = + (* + KMap_enter_body (singleton case) -> step + KCdr -> step + KHalt -> next + KMap_exit_body -> next + (map_update) + KMap_enter_body (empty case) -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~salt:"_singleton" + ~name:Interpreter_workload.N_KMap_enter_body + ~cont_and_stack_sampler:(fun _cfg _rng_state () -> + Ex_stack_and_cont + { + stack = ((), eos); + stack_type = unit @$ bot; + cont = map_enter_body_code [(Script_int.zero, ())]; + }) + () + + let () = + (* + KMap_exit_body -> + (map_update) -> next + KMap_enter_body (empty case) -> next + KNil + *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KMap_exit_body + ~cont_and_stack_sampler:(fun cfg rng_state -> + let kbody = ICdr (dummy_loc, halt) in + fun () -> + let ty = map int unit in + let key, map = Maps.generate_map_and_key_in_map cfg rng_state in + let cont = KMap_exit_body (kbody, [], map, key, Some ty, KNil) in + Ex_stack_and_cont + {stack = ((), ((), eos)); stack_type = unit @$ unit @$ bot; cont}) + () + + let () = + (* KMap_head -> KNil *) + continuation_benchmark + ~amplification:100 + ~name:Interpreter_workload.N_KMap_head + ~cont_and_stack_sampler:(fun _cfg _rng_state () -> + let cont = KMap_head (Option.some, KNil) in + Ex_stack_and_cont + {stack = ((), ((), eos)); stack_type = unit @$ unit @$ bot; cont}) + () + end + + let () = + simple_benchmark + ~name:Interpreter_workload.N_IEmit + ~stack_type:(unit_t @$ bot) + ~kinstr: + (IEmit + { + ty = unit_t; + k = halt; + loc = dummy_loc; + tag = Entrypoint_repr.default; + unparsed_ty = Script_repr.unit; + }) + () +end diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_model.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_model.ml new file mode 100644 index 000000000000..2e1ed2743ca4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_model.ml @@ -0,0 +1,563 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Namespace.make Registration_helpers.ns "interpreter" + +let fv s = Free_variable.of_namespace (ns s) + +(* ------------------------------------------------------------------------- *) + +let trace_error expected given = + let open Interpreter_workload in + let exp = string_of_instr_or_cont expected in + let given = string_of_instr_or_cont given in + let msg = + Format.asprintf + "Interpreter_model: trace error, expected %s, given %s" + exp + given + in + Stdlib.failwith msg + +let arity_error instr expected given = + let open Interpreter_workload in + let s = string_of_instr_or_cont instr in + let msg = + Format.asprintf + "Interpreter_model: arity error (%s), expected %d, given %a" + s + expected + Interpreter_workload.pp_args + given + in + Stdlib.failwith msg + +(* ------------------------------------------------------------------------- *) + +let model_0 instr model = + let open Interpreter_workload in + Model.make + ~conv:(function + | {name; args = []} -> if name = instr then () else trace_error instr name + | {args; _} -> arity_error instr 0 args) + ~model + +let model_1 instr model = + let open Interpreter_workload in + Model.make + ~conv:(function + | {name; args = [{name = _; arg}]} -> + if name = instr then (arg, ()) else trace_error instr name + | {args; _} -> arity_error instr 1 args) + ~model + +let model_2 instr model = + let open Interpreter_workload in + Model.make + ~conv:(function + | {name; args = [{name = _; arg = x}; {name = _; arg = y}]} -> + if name = instr then (x, (y, ())) else trace_error instr name + | {args; _} -> arity_error instr 2 args) + ~model + +let model_3 instr model = + let open Interpreter_workload in + Model.make + ~conv:(function + | { + name; + args = [{name = _; arg = x}; {name = _; arg = y}; {name = _; arg = z}]; + } -> + if name = instr then (x, (y, (z, ()))) else trace_error instr name + | {args; _} -> arity_error instr 3 args) + ~model + +let model_4 instr model = + let open Interpreter_workload in + Model.make + ~conv:(function + | { + name; + args = + [ + {name = _; arg = w}; + {name = _; arg = x}; + {name = _; arg = y}; + {name = _; arg = z}; + ]; + } -> + if name = instr then (w, (x, (y, (z, ())))) + else trace_error instr name + | {args; _} -> arity_error instr 4 args) + ~model + +let sf = Format.asprintf + +let division_cost name = + let const = fv (sf "%s_const" name) in + let coeff = fv (sf "%s_coeff" name) in + let module M = struct + type arg_type = int * (int * unit) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size + + let arity = Model.arity_2 + + let model = + lam ~name:"size1" @@ fun size1 -> + lam ~name:"size2" @@ fun size2 -> + let_ ~name:"q" (size1 - size2) @@ fun q -> + (free ~name:coeff * if_ (lt size2 size1) (q * size2) (int 0)) + + free ~name:const + end + end in + (module M : Model.Model_impl with type arg_type = int * (int * unit)) + +let addlogadd name = + let const = fv (sf "%s_const" name) in + let coeff = fv (sf "%s_coeff" name) in + let module M = struct + type arg_type = int * (int * unit) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size + + let arity = Model.arity_2 + + let model = + lam ~name:"size1" @@ fun size1 -> + lam ~name:"size2" @@ fun size2 -> + let_ ~name:"a" (size1 + size2) @@ fun a -> + (free ~name:coeff * (a * log2 (int 1 + a))) + free ~name:const + end + end in + (module M : Model.Model_impl with type arg_type = int * (int * unit)) + +(* Some instructions are oveloaded (eg COMPARE). In order to generate distinct + models at different types, we must specialize these models. The [specialization] + parameter acts as a mangling scheme to produce distinct models. *) +let name_of_instr_or_cont ?specialization instr_or_cont = + let spec = Option.fold ~none:"" ~some:(fun s -> "_" ^ s) specialization in + Interpreter_workload.string_of_instr_or_cont instr_or_cont ^ spec + +module Models = struct + let const1_model name = + (* For constant-time instructions *) + Model.unknown_const1 ~const:(fv (sf "%s_const" name)) + + let affine_model name = + (* For instructions with cost function + [\lambda size. const + coeff * size] *) + Model.affine + ~intercept:(fv (sf "%s_const" name)) + ~coeff:(fv (sf "%s_coeff" name)) + + let break_model name break = + Model.breakdown + ~coeff1:(fv (sf "%s_coeff1" name)) + ~coeff2:(fv (sf "%s_coeff2" name)) + ~break + + let break_model_2 name break1 break2 = + Model.breakdown2 + ~coeff1:(fv (sf "%s_coeff1" name)) + ~coeff2:(fv (sf "%s_coeff2" name)) + ~coeff3:(fv (sf "%s_coeff3" name)) + ~break1 + ~break2 + + let break_model_2_const name break1 break2 = + Model.breakdown2_const + ~coeff1:(fv (sf "%s_coeff1" name)) + ~coeff2:(fv (sf "%s_coeff2" name)) + ~coeff3:(fv (sf "%s_coeff3" name)) + ~const:(fv (sf "%s_const" name)) + ~break1 + ~break2 + + let nlogm_model name = + (* For instructions with cost function + [\lambda size1. \lambda size2. const + coeff * size1 log2(size2)] *) + Model.nlogm + ~intercept:(fv (sf "%s_const" name)) + ~coeff:(fv (sf "%s_coeff" name)) + + let concat_model name = + Model.bilinear_affine + ~intercept:(fv (sf "%s_const" name)) + ~coeff1:(fv (sf "%s_total_bytes" name)) + ~coeff2:(fv (sf "%s_list_length" name)) + + let concat_pair_model name = + Model.linear_sum + ~intercept:(fv (sf "%s_const" name)) + ~coeff:(fv (sf "%s_coeff" name)) + + let linear_max_model name = + (* For instructions with cost function + [\lambda size1. \lambda size2. const + coeff * max(size1,size2)] *) + Model.linear_max + ~intercept:(fv (sf "%s_const" name)) + ~coeff:(fv (sf "%s_coeff" name)) + + let linear_min_model name = + (* For instructions with cost function + [\lambda size1. \lambda size2. const + coeff * min(size1,size2)] *) + Model.linear_min + ~intercept:(fv (sf "%s_const" name)) + ~coeff:(fv (sf "%s_coeff" name)) + + let pack_model name = + Model.trilinear + ~coeff1:(fv (sf "%s_micheline_nodes" name)) + ~coeff2:(fv (sf "%s_micheline_int_bytes" name)) + ~coeff3:(fv (sf "%s_micheline_string_bytes" name)) + + let open_chest_model name = + let module M = struct + type arg_type = int * (int * unit) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size + + let arity = Model.arity_2 + + let model = + lam ~name:"size1" @@ fun size1 -> + lam ~name:"size2" @@ fun size2 -> + free ~name:(fv (sf "%s_const" name)) + + (free ~name:(fv (sf "%s_log_time_coeff" name)) * size1) + + (free ~name:(fv (sf "%s_plaintext_coeff" name)) * size2) + end + end in + (module M : Model.Model_impl with type arg_type = int * (int * unit)) + + let verify_update_model name = + Model.bilinear_affine + ~intercept:(fv (sf "%s_const" name)) + ~coeff1:(fv (sf "%s_inputs" name)) + ~coeff2:(fv (sf "%s_ouputs" name)) + + let list_enter_body_model name = + let module M = struct + type arg_type = int * (int * unit) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size + + let arity = Model.arity_2 + + let model = + lam ~name:"size_xs" @@ fun size_xs -> + lam ~name:"size_ys" @@ fun size_ys -> + if_ + (eq size_xs (int 0)) + (free ~name:(fv (sf "%s_const" name)) + + (free ~name:(fv (sf "%s_coeff" name)) * size_ys)) + (free ~name:(fv (sf "%s_iter" name))) + end + end in + (module M : Model.Model_impl with type arg_type = int * (int * unit)) + + let branching_model ~case_0 ~case_1 name = + let module M = struct + type arg_type = int * unit + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size + + let arity = Model.arity_1 + + let model = + lam ~name:"size" @@ fun size -> + if_ + (eq size (int 0)) + (free ~name:(fv (sf "%s_%s" name case_0))) + (free ~name:(fv (sf "%s_%s" name case_1))) + end + end in + (module M : Model.Model_impl with type arg_type = int * unit) + + let empty_branch_model name = + branching_model ~case_0:"empty" ~case_1:"nonempty" name + + let apply_model name = branching_model ~case_0:"lam" ~case_1:"lamrec" name + + let join_tickets_model name = + let module M = struct + type arg_type = int * (int * (int * (int * unit))) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size -> size -> size + + let arity = Model.Succ_arity Model.arity_3 + + let model = + lam ~name:"content_size_x" @@ fun content_size_x -> + lam ~name:"content_size_y" @@ fun content_size_y -> + lam ~name:"amount_size_x" @@ fun amount_size_x -> + lam ~name:"amount_size_y" @@ fun amount_size_y -> + free ~name:(fv (sf "%s_const" name)) + + free ~name:(fv (sf "%s_compare_coeff" name)) + * min content_size_x content_size_y + + free ~name:(fv (sf "%s_add_coeff" name)) + * max amount_size_x amount_size_y + end + end in + (module M : Model.Model_impl + with type arg_type = int * (int * (int * (int * unit)))) + + let lsl_bytes_model name = + Model.bilinear_affine + ~intercept:(fv (sf "%s_const" name)) + ~coeff1:(fv (sf "%s_bytes" name)) + ~coeff2:(fv (sf "%s_shift" name)) + + let lsr_bytes_model name = + let const = fv (sf "%s_const" name) in + let coeff = fv (sf "%s_coeff" name) in + let module M = struct + type arg_type = int * (int * unit) + + module Def (X : Costlang.S) = struct + open X + + type model_type = size -> size -> size + + let arity = Model.arity_2 + + let model = + lam ~name:"size1" @@ fun size1 -> + lam ~name:"size2" @@ fun size2 -> + let_ ~name:"q" (size1 - (size2 * float 0.125)) @@ fun q -> + free ~name:const + (free ~name:coeff * if_ (lt (int 0) q) q (int 0)) + end + end in + (module M : Model.Model_impl with type arg_type = int * (int * unit)) +end + +let ir_model ?specialization instr_or_cont = + let open Interpreter_workload in + let open Models in + let name = name_of_instr_or_cont ?specialization instr_or_cont in + match instr_or_cont with + | Instr_name instr -> ( + match instr with + | N_IDrop | N_IDup | N_ISwap | N_IConst | N_ICons_pair | N_ICar | N_ICdr + | N_ICons_some | N_ICons_none | N_IIf_none | N_IOpt_map | N_ILeft + | N_IRight | N_IIf_left | N_ICons_list | N_INil | N_IIf_cons + | N_IEmpty_set | N_IEmpty_map | N_IEmpty_big_map | N_IOr | N_IAnd | N_IXor + | N_INot | N_IIf | N_ILoop | N_ILoop_left | N_IDip | N_IExec | N_IView + | N_ILambda | N_IFailwith | N_IAddress | N_ICreate_contract + | N_ISet_delegate | N_INow | N_IMin_block_time | N_IBalance | N_IHash_key + | N_IUnpack | N_ISource | N_ISender | N_ISelf | N_IAmount | N_IChainId + | N_ILevel | N_ISelf_address | N_INever | N_IUnpair | N_IVoting_power + | N_ITotal_voting_power | N_IList_size | N_ISet_size | N_IMap_size + | N_ISapling_empty_state -> + model_0 instr_or_cont (const1_model name) + | N_ISet_mem | N_ISet_update | N_IMap_mem | N_IMap_get | N_IMap_update + | N_IBig_map_mem | N_IBig_map_get | N_IBig_map_update + | N_IMap_get_and_update | N_IBig_map_get_and_update -> + model_2 instr_or_cont (nlogm_model name) + | N_IConcat_string -> model_2 instr_or_cont (concat_model name) + | N_IConcat_string_pair -> model_2 instr_or_cont (concat_pair_model name) + | N_ISlice_string -> model_1 instr_or_cont (affine_model name) + | N_IString_size -> model_0 instr_or_cont (const1_model name) + | N_IConcat_bytes -> model_2 instr_or_cont (concat_model name) + | N_IConcat_bytes_pair -> model_2 instr_or_cont (concat_pair_model name) + | N_ISlice_bytes -> model_1 instr_or_cont (affine_model name) + | N_IBytes_size -> model_0 instr_or_cont (const1_model name) + | N_IOr_bytes -> model_2 instr_or_cont (linear_max_model name) + | N_IAnd_bytes -> model_2 instr_or_cont (linear_min_model name) + | N_IXor_bytes -> model_2 instr_or_cont (linear_max_model name) + | N_INot_bytes -> model_1 instr_or_cont (affine_model name) + | N_ILsl_bytes -> model_2 instr_or_cont (lsl_bytes_model name) + | N_ILsr_bytes -> model_2 instr_or_cont (lsr_bytes_model name) + | N_IBytes_nat -> model_1 instr_or_cont (affine_model name) + | N_INat_bytes -> model_1 instr_or_cont (affine_model name) + | N_IBytes_int -> model_1 instr_or_cont (affine_model name) + | N_IInt_bytes -> model_1 instr_or_cont (affine_model name) + | N_IAdd_seconds_to_timestamp | N_IAdd_timestamp_to_seconds + | N_ISub_timestamp_seconds | N_IDiff_timestamps -> + model_2 instr_or_cont (linear_max_model name) + | N_IAdd_tez | N_ISub_tez | N_ISub_tez_legacy | N_IEdiv_tez -> + model_0 instr_or_cont (const1_model name) + | N_IMul_teznat | N_IMul_nattez -> + model_1 instr_or_cont (affine_model name) + | N_IEdiv_teznat -> model_2 instr_or_cont (division_cost name) + | N_IIs_nat -> model_0 instr_or_cont (const1_model name) + | N_INeg -> model_1 instr_or_cont (affine_model name) + | N_IAbs_int -> model_1 instr_or_cont (affine_model name) + | N_IInt_nat -> model_0 instr_or_cont (const1_model name) + | N_IAdd_int -> model_2 instr_or_cont (linear_max_model name) + | N_IAdd_nat -> model_2 instr_or_cont (linear_max_model name) + | N_ISub_int -> model_2 instr_or_cont (linear_max_model name) + | N_IMul_int -> model_2 instr_or_cont (addlogadd name) + | N_IMul_nat -> model_2 instr_or_cont (addlogadd name) + | N_IEdiv_int -> model_2 instr_or_cont (division_cost name) + | N_IEdiv_nat -> model_2 instr_or_cont (division_cost name) + | N_ILsl_nat -> model_1 instr_or_cont (affine_model name) + | N_ILsr_nat -> model_1 instr_or_cont (affine_model name) + | N_IOr_nat -> model_2 instr_or_cont (linear_max_model name) + | N_IAnd_nat -> model_2 instr_or_cont (linear_min_model name) + | N_IAnd_int_nat -> model_2 instr_or_cont (linear_min_model name) + | N_IXor_nat -> model_2 instr_or_cont (linear_max_model name) + | N_INot_int -> model_1 instr_or_cont (affine_model name) + | N_ICompare -> model_2 instr_or_cont (linear_min_model name) + | N_IEq | N_INeq | N_ILt | N_IGt | N_ILe | N_IGe -> + model_0 instr_or_cont (const1_model name) + | N_IPack -> model_3 instr_or_cont (pack_model name) + | N_IBlake2b | N_ISha256 | N_ISha512 | N_IKeccak | N_ISha3 -> + model_1 instr_or_cont (affine_model name) + | N_ICheck_signature_ed25519 | N_ICheck_signature_secp256k1 + | N_ICheck_signature_p256 | N_ICheck_signature_bls -> + model_1 instr_or_cont (affine_model name) + | N_IContract | N_ITransfer_tokens | N_IImplicit_account -> + model_0 instr_or_cont (const1_model name) + (* The following two instructions are expected to have an affine model. However, + we observe 3 affine parts, on [0;300], [300;400] and [400;\inf[. *) + | N_IDupN -> model_1 instr_or_cont (break_model_2 name 300 400) + | N_IDropN -> model_1 instr_or_cont (break_model_2_const name 300 400) + | N_IDig | N_IDug | N_IDipN -> model_1 instr_or_cont (affine_model name) + | N_IAdd_bls12_381_g1 | N_IAdd_bls12_381_g2 | N_IAdd_bls12_381_fr + | N_IMul_bls12_381_g1 | N_IMul_bls12_381_g2 | N_IMul_bls12_381_fr + | N_INeg_bls12_381_g1 | N_INeg_bls12_381_g2 | N_INeg_bls12_381_fr + | N_IInt_bls12_381_z_fr -> + model_0 instr_or_cont (const1_model name) + | N_IMul_bls12_381_fr_z | N_IMul_bls12_381_z_fr + | N_IPairing_check_bls12_381 -> + model_1 instr_or_cont (affine_model name) + | N_IComb_get | N_IComb | N_IComb_set | N_IUncomb -> + model_1 instr_or_cont (affine_model name) + | N_ITicket | N_IRead_ticket -> model_0 instr_or_cont (const1_model name) + | N_ISplit_ticket -> model_2 instr_or_cont (linear_max_model name) + | N_IJoin_tickets -> model_4 instr_or_cont (join_tickets_model name) + | N_ISapling_verify_update -> + model_2 instr_or_cont (verify_update_model name) + | N_IList_map -> model_0 instr_or_cont (const1_model name) + | N_IList_iter -> model_0 instr_or_cont (const1_model name) + | N_IIter -> model_0 instr_or_cont (const1_model name) + | N_IMap_map -> model_1 instr_or_cont (affine_model name) + | N_IMap_iter -> model_1 instr_or_cont (affine_model name) + | N_ISet_iter -> model_1 instr_or_cont (affine_model name) + | N_IHalt -> model_0 instr_or_cont (const1_model name) + | N_IApply -> model_1 instr_or_cont (apply_model name) + | N_ILog -> model_0 instr_or_cont (const1_model name) + | N_IOpen_chest -> model_2 instr_or_cont (open_chest_model name) + | N_IEmit -> model_0 instr_or_cont (const1_model name)) + | Cont_name cont -> ( + match cont with + | N_KNil -> model_0 instr_or_cont (const1_model name) + | N_KCons -> model_0 instr_or_cont (const1_model name) + | N_KReturn -> model_0 instr_or_cont (const1_model name) + | N_KView_exit -> model_0 instr_or_cont (const1_model name) + | N_KMap_head -> model_0 instr_or_cont (const1_model name) + | N_KUndip -> model_0 instr_or_cont (const1_model name) + | N_KLoop_in -> model_0 instr_or_cont (const1_model name) + | N_KLoop_in_left -> model_0 instr_or_cont (const1_model name) + | N_KIter -> model_1 instr_or_cont (empty_branch_model name) + | N_KList_enter_body -> model_2 instr_or_cont (list_enter_body_model name) + | N_KList_exit_body -> model_0 instr_or_cont (const1_model name) + | N_KMap_enter_body -> model_1 instr_or_cont (empty_branch_model name) + | N_KMap_exit_body -> model_2 instr_or_cont (nlogm_model name) + | N_KLog -> model_0 instr_or_cont (const1_model name)) + +let amplification_loop_iteration = fv "amplification_loop_iteration" + +let amplification_loop_model = + Model.make + ~conv:(fun iterations -> (iterations, ())) + ~model:(Model.linear ~coeff:amplification_loop_iteration) + +(* The following model stitches together the per-instruction models and + adds a term corresponding to the latency induced by the timer itself. *) +let interpreter_model ?amplification ?specialization () = + Model.make_preapplied ~model:(fun trace -> + let module Def (X : Costlang.S) = struct + let applied = + let (module Timer_applied) = + Model.apply Tezos_benchmark.Builtin_benchmarks.timer_model () + in + let module Timer_result = Timer_applied (X) in + let initial = + match amplification with + | None -> Timer_result.applied + | Some amplification_factor -> + let (module Amplification_applied) = + Model.apply amplification_loop_model amplification_factor + in + let module Amplification_result = Amplification_applied (X) in + X.(Timer_result.applied + Amplification_result.applied) + in + List.fold_left + (fun (acc : X.size X.repr) instr_trace -> + let (module Applied_instr) = + Model.apply + (ir_model + ?specialization + instr_trace.Interpreter_workload.name) + instr_trace + in + let module R = Applied_instr (X) in + X.(acc + R.applied)) + initial + trace + end in + ((module Def) : Model.applied)) + +let make_model ?amplification ?specialization instr_name_opt = + match instr_name_opt with + | None -> + [("interpreter", interpreter_model ?amplification ?specialization ())] + | Some name -> + (* When generating code, we don't want to consider the terms specific to + Lwt and to the timer latency. Also, we restrict to single instructions. *) + let ir_model = ir_model ?specialization name in + let name = name_of_instr_or_cont ?specialization name in + Registration_helpers.register_for_codegen + name + (Model.For_codegen ir_model) ; + let ir_model = + Model.precompose + (function [sized_step] -> sized_step | _ -> assert false) + ir_model + in + [ + ("interpreter", interpreter_model ?amplification ?specialization ()); + ("codegen", ir_model); + ] diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_workload.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_workload.ml new file mode 100644 index 000000000000..90b96546a052 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/interpreter_workload.ml @@ -0,0 +1,1680 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Size = Gas_input_size + +(* ------------------------------------------------------------------------- *) + +type id = string + +let pp_id = Format.pp_print_string + +let equal_id = String.equal + +(* ------------------------------------------------------------------------- *) +(* Names of IR instructions together with sizes of their operands as + encountered during evaluation. *) + +type instruction_name = + (* stack ops *) + | N_IDrop + | N_IDup + | N_ISwap + | N_IConst + (* pairs *) + | N_ICons_pair + | N_ICar + | N_ICdr + | N_IUnpair + (* options *) + | N_ICons_some + | N_ICons_none + | N_IIf_none + | N_IOpt_map + (* unions *) + | N_ILeft + | N_IRight + | N_IIf_left + (* lists *) + | N_ICons_list + | N_INil + | N_IIf_cons + | N_IList_map + | N_IList_iter + | N_IIter + | N_IList_size + (* sets *) + | N_IEmpty_set + | N_ISet_iter + | N_ISet_mem + | N_ISet_update + | N_ISet_size + (* maps *) + | N_IEmpty_map + | N_IMap_map + | N_IMap_iter + | N_IMap_mem + | N_IMap_get + | N_IMap_update + | N_IMap_get_and_update + | N_IMap_size + (* big maps *) + | N_IEmpty_big_map + | N_IBig_map_mem + | N_IBig_map_get + | N_IBig_map_update + | N_IBig_map_get_and_update + (* string operations *) + | N_IConcat_string + | N_IConcat_string_pair + | N_ISlice_string + | N_IString_size + (* bytes operations *) + | N_IConcat_bytes + | N_IConcat_bytes_pair + | N_ISlice_bytes + | N_IBytes_size + | N_IOr_bytes + | N_IAnd_bytes + | N_IXor_bytes + | N_INot_bytes + | N_ILsl_bytes + | N_ILsr_bytes + | N_IBytes_nat + | N_INat_bytes + | N_IBytes_int + | N_IInt_bytes + (* timestamp operations *) + | N_IAdd_seconds_to_timestamp + | N_IAdd_timestamp_to_seconds + | N_ISub_timestamp_seconds + | N_IDiff_timestamps + (* currency operations *) + | N_IAdd_tez + | N_ISub_tez + | N_ISub_tez_legacy + | N_IMul_teznat + | N_IMul_nattez + | N_IEdiv_teznat + | N_IEdiv_tez + (* boolean operations - assumed O(1) *) + | N_IOr + | N_IAnd + | N_IXor + | N_INot + (* integer operations *) + | N_IIs_nat + | N_INeg + | N_IAbs_int + | N_IInt_nat + | N_IAdd_int + | N_IAdd_nat + | N_ISub_int + | N_IMul_int + | N_IMul_nat + | N_IEdiv_int + | N_IEdiv_nat + | N_ILsl_nat + | N_ILsr_nat + | N_IOr_nat + | N_IAnd_nat + | N_IAnd_int_nat + | N_IXor_nat + | N_INot_int + (* control *) + | N_IIf + | N_ILoop + | N_ILoop_left + | N_IDip + | N_IExec + | N_IApply + | N_ILambda + | N_IFailwith + (* comparison, warning: ad-hoc polymorphic instruction *) + | N_ICompare + (* comparators *) + | N_IEq + | N_INeq + | N_ILt + | N_IGt + | N_ILe + | N_IGe + (* protocol *) + | N_IAddress + | N_IContract + | N_ITransfer_tokens + | N_IImplicit_account + | N_ICreate_contract + | N_ISet_delegate + (* time *) + | N_INow + | N_IMin_block_time + (* other *) + | N_IBalance + | N_ILevel + | N_IView + (* We specialize the check-signature instruction for each crypto scheme. *) + | N_ICheck_signature_ed25519 + | N_ICheck_signature_secp256k1 + | N_ICheck_signature_p256 + | N_ICheck_signature_bls + | N_IHash_key + | N_IPack + | N_IUnpack + | N_IBlake2b + | N_ISha256 + | N_ISha512 + | N_ISource + | N_ISender + | N_ISelf + | N_ISelf_address + | N_IAmount + | N_ISapling_empty_state + | N_ISapling_verify_update + | N_IDig + | N_IDug + | N_IDipN + | N_IDropN + | N_IChainId + | N_INever + | N_IVoting_power + | N_ITotal_voting_power + | N_IKeccak + | N_ISha3 + (* Elliptic curves *) + | N_IAdd_bls12_381_g1 + | N_IAdd_bls12_381_g2 + | N_IAdd_bls12_381_fr + | N_IMul_bls12_381_g1 + | N_IMul_bls12_381_g2 + | N_IMul_bls12_381_fr + | N_INeg_bls12_381_g1 + | N_INeg_bls12_381_g2 + | N_INeg_bls12_381_fr + | N_IMul_bls12_381_fr_z + | N_IMul_bls12_381_z_fr + | N_IInt_bls12_381_z_fr + | N_IPairing_check_bls12_381 + (* Combs *) + | N_IComb + | N_IUncomb + | N_IComb_get + | N_IComb_set + | N_IDupN + (* Tickets *) + | N_ITicket + | N_IRead_ticket + | N_ISplit_ticket + | N_IJoin_tickets + (* Misc *) + | N_IHalt + | N_ILog + (* Timelock*) + | N_IOpen_chest + (* Event *) + | N_IEmit + +type continuation_name = + | N_KNil + | N_KCons + | N_KReturn + | N_KView_exit + | N_KMap_head + | N_KUndip + | N_KLoop_in + | N_KLoop_in_left + | N_KIter + | N_KList_enter_body + | N_KList_exit_body + | N_KMap_enter_body + | N_KMap_exit_body + | N_KLog + +and instr_or_cont_name = + | Instr_name of instruction_name + | Cont_name of continuation_name + +(* ------------------------------------------------------------------------- *) +(* Code that ought to be auto-generated *) + +let string_of_instruction_name : instruction_name -> string = + fun ir -> + match ir with + | N_IDrop -> "N_IDrop" + | N_IDup -> "N_IDup" + | N_ISwap -> "N_ISwap" + | N_IConst -> "N_IConst" + | N_ICons_pair -> "N_ICons_pair" + | N_ICar -> "N_ICar" + | N_ICdr -> "N_ICdr" + | N_ICons_some -> "N_ICons_some" + | N_ICons_none -> "N_ICons_none" + | N_IIf_none -> "N_IIf_none" + | N_IOpt_map -> "N_IOpt_map" + | N_ILeft -> "N_ILeft" + | N_IRight -> "N_IRight" + | N_IIf_left -> "N_IIf_left" + | N_ICons_list -> "N_ICons_list" + | N_INil -> "N_INil" + | N_IIf_cons -> "N_IIf_cons" + | N_IList_map -> "N_IList_map" + | N_IList_iter -> "N_IList_iter" + | N_IIter -> "N_IIter" + | N_IList_size -> "N_IList_size" + | N_IEmpty_set -> "N_IEmpty_set" + | N_ISet_iter -> "N_ISet_iter" + | N_ISet_mem -> "N_ISet_mem" + | N_ISet_update -> "N_ISet_update" + | N_ISet_size -> "N_ISet_size" + | N_IEmpty_map -> "N_IEmpty_map" + | N_IMap_map -> "N_IMap_map" + | N_IMap_iter -> "N_IMap_iter" + | N_IMap_mem -> "N_IMap_mem" + | N_IMap_get -> "N_IMap_get" + | N_IMap_update -> "N_IMap_update" + | N_IMap_size -> "N_IMap_size" + | N_IEmpty_big_map -> "N_IEmpty_big_map" + | N_IBig_map_mem -> "N_IBig_map_mem" + | N_IBig_map_get -> "N_IBig_map_get" + | N_IBig_map_update -> "N_IBig_map_update" + | N_IConcat_string -> "N_IConcat_string" + | N_IConcat_string_pair -> "N_IConcat_string_pair" + | N_ISlice_string -> "N_ISlice_string" + | N_IString_size -> "N_IString_size" + | N_IConcat_bytes -> "N_IConcat_bytes" + | N_IConcat_bytes_pair -> "N_IConcat_bytes_pair" + | N_ISlice_bytes -> "N_ISlice_bytes" + | N_IBytes_size -> "N_IBytes_size" + | N_IOr_bytes -> "N_IOr_bytes" + | N_IAnd_bytes -> "N_IAnd_bytes" + | N_IXor_bytes -> "N_IXor_bytes" + | N_INot_bytes -> "N_INot_bytes" + | N_ILsl_bytes -> "N_ILsl_bytes" + | N_ILsr_bytes -> "N_ILsr_bytes" + | N_IBytes_nat -> "N_IBytes_nat" + | N_INat_bytes -> "N_INat_bytes" + | N_IBytes_int -> "N_IBytes_int" + | N_IInt_bytes -> "N_IInt_bytes" + | N_IAdd_seconds_to_timestamp -> "N_IAdd_seconds_to_timestamp" + | N_IAdd_timestamp_to_seconds -> "N_IAdd_timestamp_to_seconds" + | N_ISub_timestamp_seconds -> "N_ISub_timestamp_seconds" + | N_IDiff_timestamps -> "N_IDiff_timestamps" + | N_IAdd_tez -> "N_IAdd_tez" + | N_ISub_tez -> "N_ISub_tez" + | N_ISub_tez_legacy -> "N_ISub_tez_legacy" + | N_IMul_teznat -> "N_IMul_teznat" + | N_IMul_nattez -> "N_IMul_nattez" + | N_IEdiv_teznat -> "N_IEdiv_teznat" + | N_IEdiv_tez -> "N_IEdiv_tez" + | N_IOr -> "N_IOr" + | N_IAnd -> "N_IAnd" + | N_IXor -> "N_IXor" + | N_INot -> "N_INot" + | N_IIs_nat -> "N_IIs_nat" + | N_INeg -> "N_INeg" + | N_IAbs_int -> "N_IAbs_int" + | N_IInt_nat -> "N_IInt_nat" + | N_IAdd_int -> "N_IAdd_int" + | N_IAdd_nat -> "N_IAdd_nat" + | N_ISub_int -> "N_ISub_int" + | N_IMul_int -> "N_IMul_int" + | N_IMul_nat -> "N_IMul_nat" + | N_IEdiv_int -> "N_IEdiv_int" + | N_IEdiv_nat -> "N_IEdiv_nat" + | N_ILsl_nat -> "N_ILsl_nat" + | N_ILsr_nat -> "N_ILsr_nat" + | N_IOr_nat -> "N_IOr_nat" + | N_IAnd_nat -> "N_IAnd_nat" + | N_IAnd_int_nat -> "N_IAnd_int_nat" + | N_IXor_nat -> "N_IXor_nat" + | N_INot_int -> "N_INot_int" + | N_IIf -> "N_IIf" + | N_ILoop -> "N_ILoop" + | N_ILoop_left -> "N_ILoop_left" + | N_IDip -> "N_IDip" + | N_IExec -> "N_IExec" + | N_IApply -> "N_IApply" + | N_ILambda -> "N_ILambda" + | N_IFailwith -> "N_IFailwith" + | N_ICompare -> "N_ICompare" + | N_IEq -> "N_IEq" + | N_INeq -> "N_INeq" + | N_ILt -> "N_ILt" + | N_IGt -> "N_IGt" + | N_ILe -> "N_ILe" + | N_IGe -> "N_IGe" + | N_IAddress -> "N_IAddress" + | N_IContract -> "N_IContract" + | N_ITransfer_tokens -> "N_ITransfer_tokens" + | N_IImplicit_account -> "N_IImplicit_account" + | N_ICreate_contract -> "N_ICreate_contract" + | N_ISet_delegate -> "N_ISet_delegate" + | N_INow -> "N_INow" + | N_IMin_block_time -> "N_IMin_block_time" + | N_IBalance -> "N_IBalance" + | N_ICheck_signature_ed25519 -> "N_ICheck_signature_ed25519" + | N_ICheck_signature_secp256k1 -> "N_ICheck_signature_secp256k1" + | N_ICheck_signature_p256 -> "N_ICheck_signature_p256" + | N_ICheck_signature_bls -> "N_ICheck_signature_bls" + | N_IHash_key -> "N_IHash_key" + | N_IPack -> "N_IPack" + | N_IUnpack -> "N_IUnpack" + | N_IBlake2b -> "N_IBlake2b" + | N_ISha256 -> "N_ISha256" + | N_ISha512 -> "N_ISha512" + | N_ISource -> "N_ISource" + | N_ISender -> "N_ISender" + | N_ISelf -> "N_ISelf" + | N_IAmount -> "N_IAmount" + | N_IDig -> "N_IDig" + | N_IDug -> "N_IDug" + | N_IDipN -> "N_IDipN" + | N_IDropN -> "N_IDropN" + | N_IDupN -> "N_IDupN" + | N_IChainId -> "N_IChainId" + | N_ILevel -> "N_ILevel" + | N_IView -> "N_IView" + | N_ISelf_address -> "N_ISelf_address" + | N_INever -> "N_INever" + | N_IUnpair -> "N_IUnpair" + | N_IVoting_power -> "N_IVoting_power" + | N_ITotal_voting_power -> "N_ITotal_voting_power" + | N_IKeccak -> "N_IKeccak" + | N_ISha3 -> "N_ISha3" + | N_IAdd_bls12_381_g1 -> "N_IAdd_bls12_381_g1" + | N_IAdd_bls12_381_g2 -> "N_IAdd_bls12_381_g2" + | N_IAdd_bls12_381_fr -> "N_IAdd_bls12_381_fr" + | N_IMul_bls12_381_g1 -> "N_IMul_bls12_381_g1" + | N_IMul_bls12_381_g2 -> "N_IMul_bls12_381_g2" + | N_IMul_bls12_381_fr -> "N_IMul_bls12_381_fr" + | N_INeg_bls12_381_g1 -> "N_INeg_bls12_381_g1" + | N_INeg_bls12_381_g2 -> "N_INeg_bls12_381_g2" + | N_INeg_bls12_381_fr -> "N_INeg_bls12_381_fr" + | N_IPairing_check_bls12_381 -> "N_IPairing_check_bls12_381" + | N_IMul_bls12_381_fr_z -> "N_IMul_bls12_381_fr_z" + | N_IMul_bls12_381_z_fr -> "N_IMul_bls12_381_z_fr" + | N_IInt_bls12_381_z_fr -> "N_IInt_bls12_381_z_fr" + | N_IComb -> "N_IComb" + | N_IUncomb -> "N_IUncomb" + | N_IComb_get -> "N_IComb_get" + | N_IComb_set -> "N_IComb_set" + | N_ITicket -> "N_ITicket" + | N_IRead_ticket -> "N_IRead_ticket" + | N_ISplit_ticket -> "N_ISplit_ticket" + | N_IJoin_tickets -> "N_IJoin_tickets" + | N_ISapling_empty_state -> "N_ISapling_empty_state" + | N_ISapling_verify_update -> "N_ISapling_verify_update" + | N_IMap_get_and_update -> "N_IMap_get_and_update" + | N_IBig_map_get_and_update -> "N_IBig_map_get_and_update" + | N_IHalt -> "N_IHalt" + | N_ILog -> "N_ILog" + | N_IOpen_chest -> "N_IOpen_chest" + | N_IEmit -> "N_IEmit" + +let string_of_continuation_name : continuation_name -> string = + fun c -> + match c with + | N_KNil -> "N_KNil" + | N_KCons -> "N_KCons" + | N_KReturn -> "N_KReturn" + | N_KView_exit -> "N_KView_exit" + | N_KMap_head -> "N_KMap_head" + | N_KUndip -> "N_KUndip" + | N_KLoop_in -> "N_KLoop_in" + | N_KLoop_in_left -> "N_KLoop_in_left" + | N_KIter -> "N_KIter" + | N_KList_enter_body -> "N_KList_enter_body" + | N_KList_exit_body -> "N_KList_exit_body" + | N_KMap_enter_body -> "N_KMap_enter_body" + | N_KMap_exit_body -> "N_KMap_exit_body" + | N_KLog -> "N_KLog" + +let string_of_instr_or_cont name = + match name with + | Instr_name instr_name -> string_of_instruction_name instr_name + | Cont_name cont_name -> string_of_continuation_name cont_name + +(* ------------------------------------------------------------------------- *) + +type args = arg list + +and arg = {name : id; arg : Size.t} + +let nullary : args = [] + +let unary xn x : args = [{name = xn; arg = x}] + +let binary xn x yn y : args = {name = xn; arg = x} :: unary yn y + +let ternary xn x yn y zn z : args = {name = xn; arg = x} :: binary yn y zn z + +let quaternary wn w xn x yn y zn z : args = + {name = wn; arg = w} :: ternary xn x yn y zn z + +let pp_arg fmtr {name; arg} = Format.fprintf fmtr "%s = %a" name Size.pp arg + +let pp_args fmtr args = + Format.pp_print_list + ~pp_sep:(fun fmtr () -> Format.fprintf fmtr ";") + pp_arg + fmtr + args + +type ir_sized_step = {name : instr_or_cont_name; args : args} + +type t = ir_sized_step list + +let ir_sized_step instr_name args = {name = Instr_name instr_name; args} + +let cont_sized_step cont_name args = {name = Cont_name cont_name; args} + +(* ------------------------------------------------------------------------- *) + +let all_instructions = + [ + N_IDrop; + N_IDup; + N_ISwap; + N_IConst; + N_ICons_pair; + N_ICar; + N_ICdr; + N_ICons_some; + N_ICons_none; + N_IIf_none; + N_IOpt_map; + N_ILeft; + N_IRight; + N_IIf_left; + N_ICons_list; + N_INil; + N_IIf_cons; + N_IList_map; + N_IList_iter; + N_IIter; + N_IList_size; + N_IEmpty_set; + N_ISet_iter; + N_ISet_mem; + N_ISet_update; + N_ISet_size; + N_IEmpty_map; + N_IMap_map; + N_IMap_iter; + N_IMap_mem; + N_IMap_get; + N_IMap_update; + N_IMap_size; + N_IEmpty_big_map; + N_IBig_map_mem; + N_IBig_map_get; + N_IBig_map_update; + N_IConcat_string; + N_IConcat_string_pair; + N_ISlice_string; + N_IString_size; + N_IConcat_bytes; + N_IConcat_bytes_pair; + N_ISlice_bytes; + N_IBytes_size; + N_IBytes_nat; + N_INat_bytes; + N_IBytes_int; + N_IInt_bytes; + N_IAdd_seconds_to_timestamp; + N_IAdd_timestamp_to_seconds; + N_ISub_timestamp_seconds; + N_IDiff_timestamps; + N_IAdd_tez; + N_ISub_tez; + N_ISub_tez_legacy; + N_IMul_teznat; + N_IMul_nattez; + N_IEdiv_teznat; + N_IEdiv_tez; + N_IOr; + N_IAnd; + N_IXor; + N_INot; + N_IIs_nat; + N_INeg; + N_IAbs_int; + N_IInt_nat; + N_IAdd_int; + N_IAdd_nat; + N_ISub_int; + N_IMul_int; + N_IMul_nat; + N_IEdiv_int; + N_IEdiv_nat; + N_ILsl_nat; + N_ILsr_nat; + N_IOr_nat; + N_IAnd_nat; + N_IAnd_int_nat; + N_IXor_nat; + N_INot_int; + N_IIf; + N_ILoop; + N_ILoop_left; + N_IDip; + N_IExec; + N_IApply; + N_ILambda; + N_IFailwith; + N_ICompare; + N_IEq; + N_INeq; + N_ILt; + N_IGt; + N_ILe; + N_IGe; + N_IAddress; + N_IContract; + N_ITransfer_tokens; + N_IImplicit_account; + N_ICreate_contract; + N_ISet_delegate; + N_INow; + N_IMin_block_time; + N_IBalance; + N_ICheck_signature_ed25519; + N_ICheck_signature_secp256k1; + N_ICheck_signature_p256; + N_ICheck_signature_bls; + N_IHash_key; + N_IPack; + N_IUnpack; + N_IBlake2b; + N_ISha256; + N_ISha512; + N_ISource; + N_ISender; + N_ISelf; + N_IAmount; + N_IDig; + N_IDug; + N_IDipN; + N_IDropN; + N_IDupN; + N_IChainId; + N_ILevel; + N_IView; + N_ISelf_address; + N_INever; + N_IUnpair; + N_IVoting_power; + N_ITotal_voting_power; + N_IKeccak; + N_ISha3; + N_IAdd_bls12_381_g1; + N_IAdd_bls12_381_g2; + N_IAdd_bls12_381_fr; + N_IMul_bls12_381_g1; + N_IMul_bls12_381_g2; + N_IMul_bls12_381_fr; + N_INeg_bls12_381_g1; + N_INeg_bls12_381_g2; + N_INeg_bls12_381_fr; + N_IPairing_check_bls12_381; + N_IMul_bls12_381_fr_z; + N_IMul_bls12_381_z_fr; + N_IInt_bls12_381_z_fr; + N_IComb; + N_IUncomb; + N_IComb_get; + N_IComb_set; + N_ITicket; + N_IRead_ticket; + N_ISplit_ticket; + N_IJoin_tickets; + N_ISapling_empty_state; + N_ISapling_verify_update; + N_IMap_get_and_update; + N_IBig_map_get_and_update; + N_IHalt; + N_ILog; + N_IOpen_chest; + N_IEmit; + N_ILsl_bytes; + N_ILsr_bytes; + N_IOr_bytes; + N_IAnd_bytes; + N_IXor_bytes; + N_INot_bytes; + ] + +let all_continuations = + [ + N_KNil; + N_KCons; + N_KReturn; + N_KView_exit; + N_KMap_head; + N_KUndip; + N_KLoop_in; + N_KLoop_in_left; + N_KIter; + N_KList_enter_body; + N_KList_exit_body; + N_KMap_enter_body; + N_KMap_exit_body; + N_KLog; + ] + +let instruction_name_encoding = + let open Data_encoding in + def "instruction_name_encoding" + @@ string_enum + (List.map + (fun instr_name -> + (string_of_instruction_name instr_name, instr_name)) + all_instructions) + +let continuation_name_encoding = + let open Data_encoding in + def "continuation_name_encoding" + @@ string_enum + (List.map + (fun cont_name -> (string_of_continuation_name cont_name, cont_name)) + all_continuations) + +let args_encoding = + let open Data_encoding in + def "args_encoding" + @@ list + (conv + (fun {name; arg} -> (name, arg)) + (fun (name, arg) -> {name; arg}) + (tup2 string Size.encoding)) + +let instr_or_cont_name_encoding = + let open Data_encoding in + def "instr_or_cont_name" + @@ union + [ + case + ~title:"instr_name" + (Tag 0) + instruction_name_encoding + (function Instr_name name -> Some name | _ -> None) + (fun name -> Instr_name name); + case + ~title:"cont_name" + (Tag 1) + continuation_name_encoding + (function Cont_name name -> Some name | _ -> None) + (fun name -> Cont_name name); + ] + +let ir_sized_step_encoding = + let open Data_encoding in + def "ir_sized_step_encoding" + @@ conv + (fun {name; args} -> (name, args)) + (fun (name, args) -> {name; args}) + (tup2 instr_or_cont_name_encoding args_encoding) + +let encoding = + let open Data_encoding in + def "interpreter_trace_encoding" @@ list ir_sized_step_encoding + +(* ------------------------------------------------------------------------- *) + +module Instructions = struct + let drop = ir_sized_step N_IDrop nullary + + let dup = ir_sized_step N_IDup nullary + + let swap = ir_sized_step N_ISwap nullary + + let const = ir_sized_step N_IConst nullary + + let cons_pair = ir_sized_step N_ICons_pair nullary + + let car = ir_sized_step N_ICar nullary + + let cdr = ir_sized_step N_ICdr nullary + + let cons_some = ir_sized_step N_ICons_some nullary + + let cons_none = ir_sized_step N_ICons_none nullary + + let if_none = ir_sized_step N_IIf_none nullary + + let opt_map = ir_sized_step N_IOpt_map nullary + + let left = ir_sized_step N_ILeft nullary + + let right = ir_sized_step N_IRight nullary + + let if_left = ir_sized_step N_IIf_left nullary + + let cons_list = ir_sized_step N_ICons_list nullary + + let nil = ir_sized_step N_INil nullary + + let if_cons = ir_sized_step N_IIf_cons nullary + + let list_map = ir_sized_step N_IList_map nullary + + let list_iter = ir_sized_step N_IList_iter nullary + + let iter = ir_sized_step N_IIter nullary + + let list_size _list = ir_sized_step N_IList_size nullary + + let empty_set = ir_sized_step N_IEmpty_set nullary + + let set_iter set = ir_sized_step N_ISet_iter (unary "set" set) + + let set_mem elt set = ir_sized_step N_ISet_mem (binary "elt" elt "set" set) + + let set_update elt set = + ir_sized_step N_ISet_update (binary "elt" elt "set" set) + + let set_size _set = ir_sized_step N_ISet_size nullary + + let empty_map = ir_sized_step N_IEmpty_map nullary + + let map_map map = ir_sized_step N_IMap_map (unary "map" map) + + let map_iter map = ir_sized_step N_IMap_iter (unary "map" map) + + let map_mem key map = ir_sized_step N_IMap_mem (binary "key" key "map" map) + + let map_get key map = ir_sized_step N_IMap_get (binary "key" key "map" map) + + let map_update key map = + ir_sized_step N_IMap_update (binary "key" key "map" map) + + let map_size _map = ir_sized_step N_IMap_size nullary + + let empty_big_map = ir_sized_step N_IEmpty_big_map nullary + + let big_map_mem key big_map = + ir_sized_step N_IBig_map_mem (binary "key" key "big_map" big_map) + + let big_map_get key big_map = + ir_sized_step N_IBig_map_get (binary "key" key "big_map" big_map) + + let big_map_update key big_map = + ir_sized_step N_IBig_map_update (binary "key" key "big_map" big_map) + + let big_map_get_and_update key big_map = + ir_sized_step N_IBig_map_get_and_update (binary "key" key "big_map" big_map) + + let concat_string total_bytes list = + ir_sized_step + N_IConcat_string + (binary "total_bytes" total_bytes "list" list) + + let concat_string_pair str1 str2 = + ir_sized_step N_IConcat_string_pair (binary "str1" str1 "str2" str2) + + let slice_string string = + ir_sized_step N_ISlice_string (unary "string" string) + + let string_size _string = ir_sized_step N_IString_size nullary + + let concat_bytes total_bytes list = + ir_sized_step N_IConcat_bytes (binary "total_bytes" total_bytes "list" list) + + let concat_bytes_pair str1 str2 = + ir_sized_step N_IConcat_bytes_pair (binary "str1" str1 "str2" str2) + + let slice_bytes bytes = ir_sized_step N_ISlice_bytes (unary "bytes" bytes) + + let bytes_size = ir_sized_step N_IBytes_size nullary + + let lsl_bytes bytes shift = + ir_sized_step N_ILsl_bytes (binary "bytes" bytes "shift" shift) + + let lsr_bytes bytes shift = + ir_sized_step N_ILsr_bytes (binary "bytes" bytes "shift" shift) + + let or_bytes bytes1 bytes2 = + ir_sized_step N_IOr_bytes (binary "bytes1" bytes1 "bytes2" bytes2) + + let and_bytes bytes1 bytes2 = + ir_sized_step N_IAnd_bytes (binary "bytes1" bytes1 "bytes2" bytes2) + + let xor_bytes bytes1 bytes2 = + ir_sized_step N_IXor_bytes (binary "bytes1" bytes1 "bytes2" bytes2) + + let not_bytes bytes = ir_sized_step N_INot_bytes (unary "bytes" bytes) + + let bytes_nat nat = ir_sized_step N_IBytes_nat (unary "nat" nat) + + let nat_bytes bytes = ir_sized_step N_INat_bytes (unary "bytes" bytes) + + let bytes_int int = ir_sized_step N_IBytes_int (unary "int" int) + + let int_bytes bytes = ir_sized_step N_IInt_bytes (unary "bytes" bytes) + + let add_seconds_to_timestamp seconds tstamp = + ir_sized_step + N_IAdd_seconds_to_timestamp + (binary "seconds" seconds "tstamp" tstamp) + + let add_timestamp_to_seconds tstamp seconds = + ir_sized_step + N_IAdd_timestamp_to_seconds + (binary "tstamp" tstamp "seconds" seconds) + + let sub_timestamp_seconds tstamp seconds = + ir_sized_step + N_ISub_timestamp_seconds + (binary "tstamp" tstamp "seconds" seconds) + + let diff_timestamps tstamp1 tstamp2 = + ir_sized_step + N_IDiff_timestamps + (binary "tstamp1" tstamp1 "tstamp2" tstamp2) + + let add_tez _tez1 _tez2 = ir_sized_step N_IAdd_tez nullary + + let sub_tez _tez1 _tez2 = ir_sized_step N_ISub_tez nullary + + let sub_tez_legacy _tez1 _tez2 = ir_sized_step N_ISub_tez_legacy nullary + + let mul_teznat _tez nat = ir_sized_step N_IMul_teznat (unary "nat" nat) + + let mul_nattez nat _tez = ir_sized_step N_IMul_nattez (unary "nat" nat) + + let ediv_teznat tez nat = + ir_sized_step N_IEdiv_teznat (binary "tez" tez "nat" nat) + + let ediv_tez _tez1 _tez2 = ir_sized_step N_IEdiv_tez nullary + + let or_ = ir_sized_step N_IOr nullary + + let and_ = ir_sized_step N_IAnd nullary + + let xor_ = ir_sized_step N_IXor nullary + + let not_ = ir_sized_step N_INot nullary + + let is_nat _int = ir_sized_step N_IIs_nat nullary + + let neg int = ir_sized_step N_INeg (unary "int" int) + + let abs_int int = ir_sized_step N_IAbs_int (unary "int" int) + + let int_nat _nat = ir_sized_step N_IInt_nat nullary + + let add_int int1 int2 = + ir_sized_step N_IAdd_int (binary "int1" int1 "int2" int2) + + let add_nat nat1 nat2 = + ir_sized_step N_IAdd_nat (binary "nat1" nat1 "nat2" nat2) + + let sub_int int1 int2 = + ir_sized_step N_ISub_int (binary "int1" int1 "int2" int2) + + let mul_int int1 int2 = + ir_sized_step N_IMul_int (binary "int1" int1 "int2" int2) + + let mul_nat nat int = ir_sized_step N_IMul_nat (binary "nat" nat "int" int) + + let ediv_int int1 int2 = + ir_sized_step N_IEdiv_int (binary "int1" int1 "int2" int2) + + let ediv_nat nat int = ir_sized_step N_IEdiv_nat (binary "nat" nat "int" int) + + let lsl_nat nat1 _shift = ir_sized_step N_ILsl_nat (unary "nat" nat1) + + let lsr_nat nat1 _shift = ir_sized_step N_ILsr_nat (unary "nat" nat1) + + let or_nat nat1 nat2 = + ir_sized_step N_IOr_nat (binary "nat1" nat1 "nat2" nat2) + + let and_nat nat1 nat2 = + ir_sized_step N_IAnd_nat (binary "nat1" nat1 "nat2" nat2) + + let and_int_nat int nat = + ir_sized_step N_IAnd_int_nat (binary "int" int "nat" nat) + + let xor_nat nat1 nat2 = + ir_sized_step N_IXor_nat (binary "nat1" nat1 "nat2" nat2) + + let not_int int = ir_sized_step N_INot_int (unary "int" int) + + let if_ = ir_sized_step N_IIf nullary + + let loop = ir_sized_step N_ILoop nullary + + let loop_left = ir_sized_step N_ILoop_left nullary + + let dip = ir_sized_step N_IDip nullary + + let exec = ir_sized_step N_IExec nullary + + let apply ~(rec_flag : bool) = + ir_sized_step N_IApply (unary "rec" (if rec_flag then 1 else 0)) + + let lambda = ir_sized_step N_ILambda nullary + + let failwith_ = ir_sized_step N_IFailwith nullary + + let compare arg1 arg2 = + ir_sized_step N_ICompare (binary "arg1" arg1 "arg2" arg2) + + let eq = ir_sized_step N_IEq nullary + + let neq = ir_sized_step N_INeq nullary + + let lt = ir_sized_step N_ILt nullary + + let gt = ir_sized_step N_IGt nullary + + let le = ir_sized_step N_ILe nullary + + let ge = ir_sized_step N_IGe nullary + + let address = ir_sized_step N_IAddress nullary + + let contract = ir_sized_step N_IContract nullary + + let transfer_tokens = ir_sized_step N_ITransfer_tokens nullary + + let implicit_account = ir_sized_step N_IImplicit_account nullary + + let create_contract = ir_sized_step N_ICreate_contract nullary + + let set_delegate = ir_sized_step N_ISet_delegate nullary + + let now = ir_sized_step N_INow nullary + + let min_block_time = ir_sized_step N_IMin_block_time nullary + + let balance = ir_sized_step N_IBalance nullary + + let check_signature_ed25519 _pk _signature message = + ir_sized_step N_ICheck_signature_ed25519 (unary "message" message) + + let check_signature_secp256k1 _pk _signature message = + ir_sized_step N_ICheck_signature_secp256k1 (unary "message" message) + + let check_signature_p256 _pk _signature message = + ir_sized_step N_ICheck_signature_p256 (unary "message" message) + + let check_signature_bls _pk _signature message = + ir_sized_step N_ICheck_signature_bls (unary "message" message) + + let hash_key = ir_sized_step N_IHash_key nullary + + let pack (micheline_size : Size.micheline_size) = + ir_sized_step + N_IPack + (ternary + "micheline_nodes" + micheline_size.traversal + "micheline_int_bytes" + micheline_size.int_bytes + "micheline_string_bytes" + micheline_size.string_bytes) + + let unpack = ir_sized_step N_IUnpack nullary + + let blake2b bytes = ir_sized_step N_IBlake2b (unary "bytes" bytes) + + let sha256 bytes = ir_sized_step N_ISha256 (unary "bytes" bytes) + + let sha512 bytes = ir_sized_step N_ISha512 (unary "bytes" bytes) + + let source = ir_sized_step N_ISource nullary + + let sender = ir_sized_step N_ISender nullary + + let self = ir_sized_step N_ISelf nullary + + let amount = ir_sized_step N_IAmount nullary + + let dig depth = ir_sized_step N_IDig (unary "depth" depth) + + let dug depth = ir_sized_step N_IDug (unary "depth" depth) + + let dipn depth = ir_sized_step N_IDipN (unary "depth" depth) + + let dropn depth = ir_sized_step N_IDropN (unary "depth" depth) + + let dupn depth = ir_sized_step N_IDupN (unary "depth" depth) + + let chain_id = ir_sized_step N_IChainId nullary + + let level = ir_sized_step N_ILevel nullary + + let view = ir_sized_step N_IView nullary + + let self_address = ir_sized_step N_ISelf_address nullary + + let never = ir_sized_step N_INever nullary + + let unpair = ir_sized_step N_IUnpair nullary + + let voting_power = ir_sized_step N_IVoting_power nullary + + let total_voting_power = ir_sized_step N_ITotal_voting_power nullary + + let keccak bytes = ir_sized_step N_IKeccak (unary "bytes" bytes) + + let sha3 bytes = ir_sized_step N_ISha3 (unary "bytes" bytes) + + let add_bls12_381_g1 = ir_sized_step N_IAdd_bls12_381_g1 nullary + + let add_bls12_381_g2 = ir_sized_step N_IAdd_bls12_381_g2 nullary + + let add_bls12_381_fr = ir_sized_step N_IAdd_bls12_381_fr nullary + + let mul_bls12_381_g1 = ir_sized_step N_IMul_bls12_381_g1 nullary + + let mul_bls12_381_g2 = ir_sized_step N_IMul_bls12_381_g2 nullary + + let mul_bls12_381_fr = ir_sized_step N_IMul_bls12_381_fr nullary + + let neg_bls12_381_g1 = ir_sized_step N_INeg_bls12_381_g1 nullary + + let neg_bls12_381_g2 = ir_sized_step N_INeg_bls12_381_g2 nullary + + let neg_bls12_381_fr = ir_sized_step N_INeg_bls12_381_fr nullary + + let pairing_check_bls12_381 length = + ir_sized_step N_IPairing_check_bls12_381 (unary "length" length) + + let mul_bls12_381_fr_z nat = + ir_sized_step N_IMul_bls12_381_fr_z (unary "nat" nat) + + let mul_bls12_381_z_fr nat = + ir_sized_step N_IMul_bls12_381_z_fr (unary "nat" nat) + + let int_bls12_381_z_fr = ir_sized_step N_IInt_bls12_381_z_fr nullary + + let comb depth = ir_sized_step N_IComb (unary "depth" depth) + + let uncomb depth = ir_sized_step N_IUncomb (unary "depth" depth) + + let comb_get key = ir_sized_step N_IComb_get (unary "key" key) + + let comb_set key = ir_sized_step N_IComb_set (unary "key" key) + + let ticket = ir_sized_step N_ITicket nullary + + let read_ticket = ir_sized_step N_IRead_ticket nullary + + let split_ticket nat1 nat2 = + ir_sized_step N_ISplit_ticket (binary "nat1" nat1 "nat2" nat2) + + let join_tickets size1 size2 size3 size4 = + ir_sized_step + N_IJoin_tickets + (quaternary + "contents1" + size1 + "contents2" + size2 + "amount1" + size3 + "amount2" + size4) + + let sapling_empty_state = ir_sized_step N_ISapling_empty_state nullary + + let sapling_verify_update inputs outputs _bound_data _state = + ir_sized_step + N_ISapling_verify_update + (binary "inputs" inputs "outputs" outputs) + + let map_get_and_update key_size map_size = + ir_sized_step + N_IMap_get_and_update + (binary "key_size" key_size "map_size" map_size) + + let halt = ir_sized_step N_IHalt nullary + + let log = ir_sized_step N_ILog nullary + + let open_chest log_time size = + ir_sized_step N_IOpen_chest (binary "log_time" log_time "size" size) + + (** cost model for the EMIT instruction *) + let emit = ir_sized_step N_IEmit nullary +end + +module Control = struct + let nil = cont_sized_step N_KNil nullary + + let cons = cont_sized_step N_KCons nullary + + let return = cont_sized_step N_KReturn nullary + + let view_exit = cont_sized_step N_KView_exit nullary + + let map_head = cont_sized_step N_KMap_head nullary + + let undip = cont_sized_step N_KUndip nullary + + let loop_in = cont_sized_step N_KLoop_in nullary + + let loop_in_left = cont_sized_step N_KLoop_in_left nullary + + let iter size = cont_sized_step N_KIter (unary "size" size) + + let list_enter_body xs_size ys_size = + cont_sized_step + N_KList_enter_body + (binary "xs_size" xs_size "ys_size" ys_size) + + let list_exit_body = cont_sized_step N_KList_exit_body nullary + + let map_enter_body size = + cont_sized_step N_KMap_enter_body (unary "size" size) + + let map_exit_body key_size map_size = + cont_sized_step N_KMap_exit_body (binary "key" key_size "map" map_size) + + let log = cont_sized_step N_KLog nullary +end + +(* ------------------------------------------------------------------------- *) + +open Script_typed_ir + +let extract_compare_sized_step : + type a. a comparable_ty -> a -> a -> ir_sized_step = + fun comparable_ty x y -> + Instructions.compare + (Size.size_of_comparable_value comparable_ty x) + (Size.size_of_comparable_value comparable_ty y) + +let extract_ir_sized_step : + type bef_top bef res_top res. + Alpha_context.t -> + (bef_top, bef, res_top, res) Script_typed_ir.kinstr -> + bef_top * bef -> + ir_sized_step = + fun ctxt instr stack -> + let open Script_typed_ir in + match (instr, stack) with + | IDrop (_, _), _ -> Instructions.drop + | IDup (_, _), _ -> Instructions.dup + | ISwap (_, _), _ -> Instructions.swap + | IConst (_, _, _, _), _ -> Instructions.const + | ICons_pair (_, _), _ -> Instructions.cons_pair + | ICar (_, _), _ -> Instructions.car + | ICdr (_, _), _ -> Instructions.cdr + | IUnpair (_, _), _ -> Instructions.unpair + | ICons_some (_, _), _ -> Instructions.cons_some + | ICons_none (_, _, _), _ -> Instructions.cons_none + | IIf_none _, _ -> Instructions.if_none + | IOpt_map _, _ -> Instructions.opt_map + | ICons_left (_, _, _), _ -> Instructions.left + | ICons_right (_, _, _), _ -> Instructions.right + | IIf_left _, _ -> Instructions.if_left + | ICons_list (_, _), _ -> Instructions.cons_list + | INil (_, _, _), _ -> Instructions.nil + | IIf_cons _, _ -> Instructions.if_cons + | IList_iter (_, _, _, _), _ -> Instructions.list_iter + | IList_map (_, _, _, _), _ -> Instructions.list_map + | IList_size (_, _), (list, _) -> Instructions.list_size (Size.list list) + | IEmpty_set (_, _, _), _ -> Instructions.empty_set + | ISet_iter _, (set, _) -> Instructions.set_iter (Size.set set) + | ISet_mem (_, _), (v, (set, _)) -> + let (module S) = Script_set.get set in + let sz = S.OPS.elt_size v in + Instructions.set_mem sz (Size.set set) + | ISet_update (_, _), (v, (_flag, (set, _))) -> + let (module S) = Script_set.get set in + let sz = S.OPS.elt_size v in + Instructions.set_update sz (Size.set set) + | ISet_size (_, _), (set, _) -> Instructions.set_size (Size.set set) + | IEmpty_map (_, _, _, _), _ -> Instructions.empty_map + | IMap_map _, (map, _) -> Instructions.map_map (Size.map map) + | IMap_iter _, (map, _) -> Instructions.map_iter (Size.map map) + | IMap_mem (_, _), (v, (map, _)) -> + let (module Map) = Script_map.get_module map in + let key_size = Map.OPS.key_size v in + Instructions.map_mem key_size (Size.map map) + | IMap_get (_, _), (v, (map, _)) -> + let (module Map) = Script_map.get_module map in + let key_size = Map.OPS.key_size v in + Instructions.map_get key_size (Size.map map) + | IMap_update (_, _), (v, (_elt_opt, (map, _))) -> + let (module Map) = Script_map.get_module map in + let key_size = Map.OPS.key_size v in + Instructions.map_update key_size (Size.map map) + | IMap_get_and_update (_, _), (v, (_elt_opt, (map, _))) -> + let (module Map) = Script_map.get_module map in + let key_size = Map.OPS.key_size v in + Instructions.map_get_and_update key_size (Size.map map) + | IMap_size (_, _), (map, _) -> Instructions.map_size (Size.map map) + | IEmpty_big_map (_, _, _, _), _ -> Instructions.empty_big_map + | IBig_map_mem (_, _), (v, (Big_map {diff = {size; _}; key_type; _}, _)) -> + let key_size = Size.size_of_comparable_value key_type v in + Instructions.big_map_mem key_size (Size.of_int size) + | IBig_map_get (_, _), (v, (Big_map {diff = {size; _}; key_type; _}, _)) -> + let key_size = Size.size_of_comparable_value key_type v in + Instructions.big_map_get key_size (Size.of_int size) + | ( IBig_map_update (_, _), + (v, (_, (Big_map {diff = {size; _}; key_type; _}, _))) ) -> + let key_size = Size.size_of_comparable_value key_type v in + Instructions.big_map_update key_size (Size.of_int size) + | ( IBig_map_get_and_update (_, _), + (v, (_, (Big_map {diff = {size; _}; key_type; _}, _))) ) -> + let key_size = Size.size_of_comparable_value key_type v in + Instructions.big_map_get_and_update key_size (Size.of_int size) + | IConcat_string (_, _), (ss, _) -> + let list_size = Size.list ss in + let total_bytes = + List.fold_left + (fun x s -> Size.(add x (script_string s))) + Size.zero + ss.elements + in + Instructions.concat_string list_size total_bytes + | IConcat_string_pair (_, _), (s1, (s2, _)) -> + Instructions.concat_string_pair + (Size.script_string s1) + (Size.script_string s2) + | ISlice_string (_, _), (_off, (_len, (s, _))) -> + Instructions.slice_string (Size.script_string s) + | IString_size (_, _), (s, _) -> + Instructions.string_size (Size.script_string s) + | IConcat_bytes (_, _), (ss, _) -> + let list_size = Size.list ss in + let total_bytes = + List.fold_left (fun x s -> Size.(add x (bytes s))) Size.zero ss.elements + in + Instructions.concat_bytes list_size total_bytes + | IConcat_bytes_pair (_, _), (s1, (s2, _)) -> + Instructions.concat_bytes_pair (Size.bytes s1) (Size.bytes s2) + | ISlice_bytes (_, _), (_off, (_len, (s, _))) -> + Instructions.slice_bytes (Size.bytes s) + | IBytes_size (_, _), _ -> Instructions.bytes_size + | IBytes_nat (_, _), (n, _) -> Instructions.bytes_nat (Size.integer n) + | INat_bytes (_, _), (b, _) -> Instructions.nat_bytes (Size.bytes b) + | IBytes_int (_, _), (n, _) -> Instructions.bytes_int (Size.integer n) + | IInt_bytes (_, _), (b, _) -> Instructions.int_bytes (Size.bytes b) + | IAdd_seconds_to_timestamp (_, _), (s, (t, _)) -> + Instructions.add_seconds_to_timestamp (Size.timestamp t) (Size.integer s) + | IAdd_timestamp_to_seconds (_, _), (t, (s, _)) -> + Instructions.add_timestamp_to_seconds (Size.timestamp t) (Size.integer s) + | ISub_timestamp_seconds (_, _), (t, (s, _)) -> + Instructions.sub_timestamp_seconds (Size.timestamp t) (Size.integer s) + | IDiff_timestamps (_, _), (t1, (t2, _)) -> + Instructions.diff_timestamps (Size.timestamp t1) (Size.timestamp t2) + | IAdd_tez (_, _), (x, (y, _)) -> + Instructions.add_tez (Size.mutez x) (Size.mutez y) + | ISub_tez (_, _), (x, (y, _)) -> + Instructions.sub_tez (Size.mutez x) (Size.mutez y) + | ISub_tez_legacy (_, _), (x, (y, _)) -> + Instructions.sub_tez_legacy (Size.mutez x) (Size.mutez y) + | IMul_teznat (_, _), (x, (y, _)) -> + Instructions.mul_teznat (Size.mutez x) (Size.integer y) + | IMul_nattez (_, _), (x, (y, _)) -> + Instructions.mul_nattez (Size.integer x) (Size.mutez y) + | IEdiv_teznat (_, _), (x, (y, _)) -> + Instructions.ediv_teznat (Size.mutez x) (Size.integer y) + | IEdiv_tez (_, _), (x, (y, _)) -> + Instructions.ediv_tez (Size.mutez x) (Size.mutez y) + | IOr (_, _), _ -> Instructions.or_ + | IAnd (_, _), _ -> Instructions.and_ + | IXor (_, _), _ -> Instructions.xor_ + | INot (_, _), _ -> Instructions.not_ + | IIs_nat (_, _), (x, _) -> Instructions.is_nat (Size.integer x) + | INeg (_, _), (x, _) -> Instructions.neg (Size.integer x) + | IAbs_int (_, _), (x, _) -> Instructions.abs_int (Size.integer x) + | IInt_nat (_, _), (x, _) -> Instructions.int_nat (Size.integer x) + | IAdd_int (_, _), (x, (y, _)) -> + Instructions.add_int (Size.integer x) (Size.integer y) + | IAdd_nat (_, _), (x, (y, _)) -> + Instructions.add_nat (Size.integer x) (Size.integer y) + | ISub_int (_, _), (x, (y, _)) -> + Instructions.sub_int (Size.integer x) (Size.integer y) + | IMul_int (_, _), (x, (y, _)) -> + Instructions.mul_int (Size.integer x) (Size.integer y) + | IMul_nat (_, _), (x, (y, _)) -> + Instructions.mul_nat (Size.integer x) (Size.integer y) + | IEdiv_int (_, _), (x, (y, _)) -> + Instructions.ediv_int (Size.integer x) (Size.integer y) + | IEdiv_nat (_, _), (x, (y, _)) -> + Instructions.ediv_nat (Size.integer x) (Size.integer y) + | ILsl_nat (_, _), (x, (y, _)) -> + Instructions.lsl_nat (Size.integer x) (Size.integer y) + | ILsr_nat (_, _), (x, (y, _)) -> + Instructions.lsr_nat (Size.integer x) (Size.integer y) + | IOr_nat (_, _), (x, (y, _)) -> + Instructions.or_nat (Size.integer x) (Size.integer y) + | IAnd_nat (_, _), (x, (y, _)) -> + Instructions.and_nat (Size.integer x) (Size.integer y) + | IAnd_int_nat (_, _), (x, (y, _)) -> + Instructions.and_int_nat (Size.integer x) (Size.integer y) + | IXor_nat (_, _), (x, (y, _)) -> + Instructions.xor_nat (Size.integer x) (Size.integer y) + | INot_int (_, _), (x, _) -> Instructions.not_int (Size.integer x) + | IIf _, _ -> Instructions.if_ + | ILoop (_, _, _), _ -> Instructions.loop + | ILoop_left (_, _, _), _ -> Instructions.loop_left + | IDip (_, _, _, _), _ -> Instructions.dip + | IExec (_, _, _), _ -> Instructions.exec + | IApply (_, _, _), (_, (l, _)) -> ( + match l with + | Lam _ -> Instructions.apply ~rec_flag:false + | LamRec _ -> Instructions.apply ~rec_flag:true) + | ILambda (_, _, _), _ -> Instructions.lambda + | IFailwith (_, _), _ -> Instructions.failwith_ + | ICompare (_, cmp_ty, _), (a, (b, _)) -> + extract_compare_sized_step cmp_ty a b + | IEq (_, _), _ -> Instructions.eq + | INeq (_, _), _ -> Instructions.neq + | ILt (_, _), _ -> Instructions.lt + | IGt (_, _), _ -> Instructions.gt + | ILe (_, _), _ -> Instructions.le + | IGe (_, _), _ -> Instructions.ge + | IAddress (_, _), _ -> Instructions.address + | IContract (_, _, _, _), _ -> Instructions.contract + | ITransfer_tokens (_, _), _ -> Instructions.transfer_tokens + | IView (_, _, _, _), _ -> Instructions.view + | IImplicit_account (_, _), _ -> Instructions.implicit_account + | ICreate_contract _, _ -> Instructions.create_contract + | ISet_delegate (_, _), _ -> Instructions.set_delegate + | INow (_, _), _ -> Instructions.now + | IBalance (_, _), _ -> Instructions.balance + | ILevel (_, _), _ -> Instructions.level + | ICheck_signature (_, _), (public_key, (_signature, (message, _))) -> ( + match public_key with + | Tezos_crypto.Signature.Ed25519 pk -> + let pk = Size.of_int (Tezos_crypto.Ed25519.Public_key.size pk) in + let signature = Size.of_int Tezos_crypto.Ed25519.size in + let message = Size.bytes message in + Instructions.check_signature_ed25519 pk signature message + | Tezos_crypto.Signature.Secp256k1 pk -> + let pk = Size.of_int (Tezos_crypto.Secp256k1.Public_key.size pk) in + let signature = Size.of_int Tezos_crypto.Secp256k1.size in + let message = Size.bytes message in + Instructions.check_signature_secp256k1 pk signature message + | Tezos_crypto.Signature.P256 pk -> + let pk = Size.of_int (Tezos_crypto.P256.Public_key.size pk) in + let signature = Size.of_int Tezos_crypto.P256.size in + let message = Size.bytes message in + Instructions.check_signature_p256 pk signature message + | Tezos_crypto.Signature.Bls pk -> + let pk = Size.of_int (Tezos_crypto.Bls.Public_key.size pk) in + let signature = Size.of_int Tezos_crypto.Bls.size in + let message = Size.bytes message in + Instructions.check_signature_bls pk signature message) + | IHash_key (_, _), _ -> Instructions.hash_key + | IPack (_, ty, _), (v, _) -> ( + let script_res = + Lwt_main.run (Script_ir_translator.unparse_data ctxt Optimized ty v) + in + match script_res with + | Ok (node, _ctxt) -> + Instructions.pack (Size.of_micheline (Micheline.root node)) + | Error _ -> Stdlib.failwith "IPack workload: could not unparse") + | IUnpack (_, _, _), _ -> Instructions.unpack + | IBlake2b (_, _), (bytes, _) -> Instructions.blake2b (Size.bytes bytes) + | ISha256 (_, _), (bytes, _) -> Instructions.sha256 (Size.bytes bytes) + | ISha512 (_, _), (bytes, _) -> Instructions.sha512 (Size.bytes bytes) + | ISource (_, _), _ -> Instructions.source + | ISender (_, _), _ -> Instructions.sender + | ISelf (_, _, _, _), _ -> Instructions.self + | ISelf_address (_, _), _ -> Instructions.self_address + | IAmount (_, _), _ -> Instructions.amount + | ISapling_empty_state (_, _, _), _ -> Instructions.sapling_empty_state + | ISapling_verify_update (_, _), (transaction, (_state, _)) -> + let inputs = Size.sapling_transaction_inputs transaction in + let outputs = Size.sapling_transaction_outputs transaction in + let bound_data = Size.sapling_transaction_bound_data transaction in + let state = Size.zero in + Instructions.sapling_verify_update inputs outputs bound_data state + | ISapling_verify_update_deprecated (_, _), (transaction, (_state, _)) -> + let inputs = List.length transaction.inputs in + let outputs = List.length transaction.outputs in + let bound_data = Size.zero in + let state = Size.zero in + Instructions.sapling_verify_update inputs outputs bound_data state + | IDig (_, n, _, _), _ -> Instructions.dig (Size.of_int n) + | IDug (_, n, _, _), _ -> Instructions.dug (Size.of_int n) + | IDipn (_, n, _, _, _), _ -> Instructions.dipn (Size.of_int n) + | IDropn (_, n, _, _), _ -> Instructions.dropn (Size.of_int n) + | IChainId (_, _), _ -> Instructions.chain_id + | INever _, _ -> . + | IVoting_power (_, _), _ -> Instructions.voting_power + | ITotal_voting_power (_, _), _ -> Instructions.total_voting_power + | IKeccak (_, _), (bytes, _) -> Instructions.keccak (Size.bytes bytes) + | ISha3 (_, _), (bytes, _) -> Instructions.sha3 (Size.bytes bytes) + | IAdd_bls12_381_g1 (_, _), _ -> Instructions.add_bls12_381_g1 + | IAdd_bls12_381_g2 (_, _), _ -> Instructions.add_bls12_381_g2 + | IAdd_bls12_381_fr (_, _), _ -> Instructions.add_bls12_381_fr + | IMul_bls12_381_g1 (_, _), _ -> Instructions.mul_bls12_381_g1 + | IMul_bls12_381_g2 (_, _), _ -> Instructions.mul_bls12_381_g2 + | IMul_bls12_381_fr (_, _), _ -> Instructions.mul_bls12_381_fr + | IMul_bls12_381_z_fr (_, _), (_fr, (z, _)) -> + Instructions.mul_bls12_381_z_fr (Size.integer z) + | IMul_bls12_381_fr_z (_, _), (z, _) -> + Instructions.mul_bls12_381_fr_z (Size.integer z) + | IInt_bls12_381_fr (_, _), _ -> Instructions.int_bls12_381_z_fr + | INeg_bls12_381_g1 (_, _), _ -> Instructions.neg_bls12_381_g1 + | INeg_bls12_381_g2 (_, _), _ -> Instructions.neg_bls12_381_g2 + | INeg_bls12_381_fr (_, _), _ -> Instructions.neg_bls12_381_fr + | IPairing_check_bls12_381 (_, _), (list, _) -> + Instructions.pairing_check_bls12_381 (Size.list list) + | IComb (_, n, _, _), _ -> Instructions.comb (Size.of_int n) + | IUncomb (_, n, _, _), _ -> Instructions.uncomb (Size.of_int n) + | IComb_get (_, n, _, _), _ -> Instructions.comb_get (Size.of_int n) + | IComb_set (_, n, _, _), _ -> Instructions.comb_set (Size.of_int n) + | IDup_n (_, n, _, _), _ -> Instructions.dupn (Size.of_int n) + | ITicket (_, _, _), _ | ITicket_deprecated (_, _, _), _ -> + Instructions.ticket + | IRead_ticket (_, _, _), _ -> Instructions.read_ticket + | ISplit_ticket (_, _), (_ticket, ((amount_a, amount_b), _)) -> + Instructions.split_ticket (Size.integer amount_a) (Size.integer amount_b) + | IJoin_tickets (_, cmp_ty, _), ((ticket1, ticket2), _) -> + let size1 = Size.size_of_comparable_value cmp_ty ticket1.contents in + let size2 = Size.size_of_comparable_value cmp_ty ticket2.contents in + let tez1 = Size.integer (ticket1.amount :> Script_int.n Script_int.num) in + let tez2 = Size.integer (ticket2.amount :> Script_int.n Script_int.num) in + Instructions.join_tickets size1 size2 tez1 tez2 + | IHalt _, _ -> Instructions.halt + | ILog _, _ -> Instructions.log + | IOpen_chest (_, _), (_, (chest, (time, _))) -> + let plaintext_size = + Script_timelock.get_plaintext_size chest - 1 |> Size.of_int + in + let log_time = Z.log2 Z.(one + Script_int.to_zint time) |> Size.of_int in + Instructions.open_chest log_time plaintext_size + | IMin_block_time _, _ -> Instructions.min_block_time + | IEmit _, _ -> Instructions.emit + | ILsl_bytes (_, _), (x, (y, _)) -> + let y = + match Script_int.to_int y with + | Some y -> y + | None -> (* overflow *) assert false + in + Instructions.lsl_bytes (Size.bytes x) y + | ILsr_bytes (_, _), (x, (y, _)) -> + let y = + match Script_int.to_int y with + | Some y -> y + | None -> (* overflow *) assert false + in + Instructions.lsr_bytes (Size.bytes x) y + | IOr_bytes (_, _), (x, (y, _)) -> + Instructions.or_bytes (Size.bytes x) (Size.bytes y) + | IAnd_bytes (_, _), (x, (y, _)) -> + Instructions.and_bytes (Size.bytes x) (Size.bytes y) + | IXor_bytes (_, _), (x, (y, _)) -> + Instructions.xor_bytes (Size.bytes x) (Size.bytes y) + | INot_bytes (_, _), (x, _) -> Instructions.not_bytes (Size.bytes x) + +let extract_control_trace (type bef_top bef aft_top aft) + (cont : (bef_top, bef, aft_top, aft) Script_typed_ir.continuation) = + match cont with + | KNil -> Control.nil + | KCons _ -> Control.cons + | KReturn _ -> Control.return + | KMap_head (_, _) -> Control.map_head + | KUndip _ -> Control.undip + | KLoop_in _ -> Control.loop_in + | KLoop_in_left _ -> Control.loop_in_left + | KIter (_, _, xs, _) -> Control.iter (Size.of_int (List.length xs)) + | KList_enter_body (_, xs, ys, _, _, _) -> + Control.list_enter_body + (Size.of_int (List.length xs)) + (Size.of_int (Script_list.length ys)) + | KList_exit_body (_, _, _, _, _, _) -> Control.list_exit_body + | KMap_enter_body (_, xs, _, _, _) -> + Control.map_enter_body (Size.of_int (List.length xs)) + | KMap_exit_body (_, _, map, k, _, _) -> + let (module Map) = Script_map.get_module map in + let key_size = Map.OPS.key_size k in + Control.map_exit_body key_size (Size.map map) + | KView_exit _ -> Control.view_exit + | KLog _ -> Control.log + +(** [Stop_bench] gets raised when a [IFailwith] would be the next instruction. + This allows us to recover the full execution trace, including the trace of + the [IFailwith]. + + The actual benchmark will follow the same execution branch, but instead will + raise an [error] which will be ignored. Thus it is safe to end a benchmark + with [IFailwith], but timings are expected to be different from ending with + [IHalt]. This means that, if we choose to include this behavior in any + benchmark, [IFailwith] must be benched. *) +exception Stop_bench + +let extract_deps (type bef_top bef aft_top aft) ctxt step_constants + (sty : (bef_top, bef) Script_typed_ir.stack_ty) + (kinstr : (bef_top, bef, aft_top, aft) Script_typed_ir.kinstr) + (stack : bef_top * bef) = + let trace = ref [] in + (* Logger definition *) + let logger = + Script_interpreter_logging.make + (module struct + let log_interp _instr _ctxt _log _stack_ty _stack = () + + let log_entry : + type a s b f. (a, s, b, f, a, s) Script_typed_ir.logging_function = + fun kinstr ctxt _loc _stack_ty stack -> + trace := extract_ir_sized_step ctxt kinstr stack :: !trace ; + match kinstr with IFailwith _ -> raise Stop_bench | _ -> () + + let log_control kont = trace := extract_control_trace kont :: !trace + + let log_exit _instr _ctxt _log _stack_ty _stack = () + + let get_log () = Environment.Error_monad.return_none + end) + in + try + let res = + Lwt_main.run + (Script_interpreter.Internals.kstep + (Some logger) + ctxt + step_constants + sty + kinstr + (fst stack) + (snd stack)) + in + match Environment.wrap_tzresult res with + | Error errs -> + Format.eprintf "%a@." Error_monad.pp_print_trace errs ; + raise (Failure "Interpreter_workload.extract_deps: error in step") + | Ok (_aft_top, _aft, _ctxt) -> + (* ((aft_top, aft), List.rev !trace, ctxt) *) + List.rev !trace + with Stop_bench -> List.rev !trace + +let extract_deps_continuation (type bef_top bef aft_top aft) ctxt step_constants + (stack_type : (bef_top, bef) stack_ty) + (cont : (bef_top, bef, aft_top, aft) Script_typed_ir.continuation) + (stack : bef_top * bef) = + let trace = ref [] in + (* Logger definition *) + let logger = + Script_interpreter_logging.make + (module struct + let log_interp _instr _ctxt _log _stack_ty _stack = () + + let log_entry : + type a s b f. (a, s, b, f, a, s) Script_typed_ir.logging_function = + fun kinstr ctxt _loc _stack_ty stack -> + trace := extract_ir_sized_step ctxt kinstr stack :: !trace ; + match kinstr with IFailwith _ -> raise Stop_bench | _ -> () + + let log_control kont = trace := extract_control_trace kont :: !trace + + let log_exit _instr _ctxt _log _stack_ty _stack = () + + let get_log () = Environment.Error_monad.return_none + end) + in + try + let res = + let _gas_counter, outdated_ctxt = + Local_gas_counter.local_gas_counter_and_outdated_context ctxt + in + Lwt_main.run + (Script_interpreter.Internals.next + (Some logger) + (outdated_ctxt, step_constants) + (Local_gas_counter 0xFF_FF_FF_FF) + stack_type + cont + (fst stack) + (snd stack)) + in + match Environment.wrap_tzresult res with + | Error errs -> + Format.eprintf "%a@." Error_monad.pp_print_trace errs ; + raise (Failure "Interpreter_workload.extract_deps: error in step") + | Ok (_aft_top, _aft, _outdated_ctxt, _gas) -> + (* ((aft_top, aft), List.rev !trace, outdated_ctxt, gas) *) + List.rev !trace + with Stop_bench -> List.rev !trace + +let sized_step_to_sparse_vec {name; args} = + let s = string_of_instr_or_cont name in + match args with + | [] -> Sparse_vec.String.of_list [(s, float_of_int 1)] + | _ -> + List.fold_left + (fun acc {name; arg} -> + Sparse_vec.String.( + add acc (of_list [(s ^ "_" ^ name, float_of_int (Size.to_int arg))]))) + Sparse_vec.String.zero + args + +let trace_to_sparse_vec trace = + List.fold_left + (fun acc step -> Sparse_vec.String.add acc (sized_step_to_sparse_vec step)) + Sparse_vec.String.zero + trace diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_commands.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_commands.ml new file mode 100644 index 000000000000..f6af0f077bc0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_commands.ml @@ -0,0 +1,207 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Michelson_generation + +let group = + { + Tezos_clic.name = "Michelson generation"; + title = "Command for generating random Michelson code and data"; + } + +module Michelson_concat_cmd = struct + let handler () file1 file2 file3 () = + let trace1 = Michelson_mcmc_samplers.load ~filename:file1 in + let trace2 = Michelson_mcmc_samplers.load ~filename:file2 in + let terms = trace1 @ trace2 in + let l1 = List.length trace1 in + let l2 = List.length trace2 in + Format.eprintf + "Loaded %d terms from %s, %d terms from %s, total %d@." + l1 + file1 + l2 + file2 + (l1 + l2) ; + Michelson_mcmc_samplers.save ~filename:file3 ~terms ; + return_unit + + let params = + Tezos_clic.( + prefixes [Protocol.name; "michelson"; "concat"; "files"] + @@ string ~name:"FILENAME" ~desc:"First file" + @@ prefixes ["and"] + @@ string ~name:"FILENAME" ~desc:"Second file" + @@ prefixes ["into"] + @@ string ~name:"FILENAME" ~desc:"Target file" + @@ stop) + + let command = + Tezos_clic.command + ~group + ~desc:"Michelson generation" + Tezos_clic.no_options + params + handler +end + +let () = Registration.add_command Michelson_concat_cmd.command + +module Michelson_gen_cmd = struct + let lift_opt f opt_arg state = + match opt_arg with None -> state | Some arg -> f arg state + + let handler (min_size, max_size, burn_in, seed) terms_count terms_kind + filename () = + let default = Michelson_generation.default_generator_config in + let min = Option.value ~default:default.target_size.min min_size in + let max = Option.value ~default:default.target_size.max max_size in + let burn_in_multiplier = + Option.value ~default:default.burn_in_multiplier burn_in + in + let rng_state = + match seed with + | None -> + Format.eprintf "Self-initialization of PRNG@." ; + let state = Random.State.make_self_init () in + Format.(eprintf "PRNG state hash: %d@." (Hashtbl.hash state)) ; + state + | Some seed -> + Format.eprintf "PRNG initialized with seed %d@." seed ; + Random.State.make [|seed|] + in + let cfg = + {Michelson_generation.target_size = {min; max}; burn_in_multiplier} + in + let terms_count = + match int_of_string terms_count with + | exception Failure _ -> + Format.eprintf "TERMS-COUNT must be an integer, exiting@." ; + exit 1 + | terms_count -> + if terms_count <= 0 then ( + Format.eprintf "TERMS-COUNT must be strictly positive, exiting@." ; + exit 1) + else terms_count + in + let progress = + Benchmark_helpers.make_progress_printer + Format.err_formatter + terms_count + "Generating term" + in + let terms = + match terms_kind with + | "data" -> + Stdlib.List.init terms_count (fun _i -> + progress () ; + Michelson_mcmc_samplers.Data + (Michelson_generation.make_data_sampler rng_state cfg)) + | "code" -> + Stdlib.List.init terms_count (fun _i -> + progress () ; + Michelson_mcmc_samplers.Code + (Michelson_generation.make_code_sampler rng_state cfg)) + | _ -> + Format.eprintf "Term kind must be either \"data\" or \"code\"@." ; + exit 1 + in + Michelson_mcmc_samplers.save ~filename ~terms ; + return_unit + + let min_size_arg = + let min_size = + Tezos_clic.parameter (fun (_ : unit) parsed -> + try return (int_of_string parsed) + with _ -> + Printf.eprintf "Error while parsing --min-size argument." ; + exit 1) + in + Tezos_clic.arg + ~doc:"Lower bound for target size of terms" + ~long:"min-size" + ~placeholder:"int" + min_size + + let max_size_arg = + let max_size = + Tezos_clic.parameter (fun (_ : unit) parsed -> + try return (int_of_string parsed) + with _ -> + Printf.eprintf "Error while parsing --max-size argument." ; + exit 1) + in + Tezos_clic.arg + ~doc:"Lower bound for target size of terms" + ~long:"max-size" + ~placeholder:"int" + max_size + + let burn_in_arg = + let target_size = + Tezos_clic.parameter (fun (_ : unit) parsed -> + try return (int_of_string parsed) + with _ -> + Printf.eprintf "Error while parsing --burn-in argument." ; + exit 1) + in + Tezos_clic.arg + ~doc:"Burn-in multiplier" + ~long:"burn-in" + ~placeholder:"int" + target_size + + let seed_arg = + let seed = + Tezos_clic.parameter (fun (_ : unit) parsed -> + try return (int_of_string parsed) + with _ -> + Printf.eprintf "Error while parsing --seed argument." ; + exit 1) + in + Tezos_clic.arg ~doc:"RNG seed" ~long:"seed" ~placeholder:"int" seed + + let options = Tezos_clic.args4 min_size_arg max_size_arg burn_in_arg seed_arg + + let params = + Tezos_clic.( + prefixes [Protocol.name; "michelson"; "generate"] + @@ string ~name:"TERMS-COUNT" ~desc:"Number of terms to generate" + @@ prefixes ["terms"; "of"; "kind"] + @@ string ~name:"{data|code}" ~desc:"Kind of term to generate" + @@ prefixes ["in"] + @@ string ~name:"FILENAME" ~desc:"File where to save Michelson terms" + @@ stop) + + let command = + Tezos_clic.command + ~group + ~desc:"Michelson generation" + options + params + handler +end + +let () = Registration.add_command Michelson_gen_cmd.command diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.ml new file mode 100644 index 000000000000..d1422930010a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.ml @@ -0,0 +1,113 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type generator_config = { + target_size : Base_samplers.range; + burn_in_multiplier : int; +} + +let default_generator_config = + {target_size = {Base_samplers.min = 100; max = 1000}; burn_in_multiplier = 5} + +let generator_config_encoding = + let open Data_encoding in + conv + (fun {target_size; burn_in_multiplier} -> (target_size, burn_in_multiplier)) + (fun (target_size, burn_in_multiplier) -> {target_size; burn_in_multiplier}) + (obj2 + (req "target_size" Base_samplers.range_encoding) + (req "burn_in_multiplier" int31)) + +(* ----------------------------------------------------------------------- *) + +(* ----------------------------------------------------------------------- *) + +module Crypto_samplers = Crypto_samplers.Make_finite_key_pool (struct + let size = 16 + + let algo = `Default +end) + +module Samplers = + Michelson_samplers.Make + (struct + let parameters = + { + Michelson_samplers.base_parameters = + { + int_size = {min = 8; max = 32}; + string_size = {min = 8; max = 128}; + bytes_size = {min = 8; max = 128}; + }; + list_size = {min = 0; max = 1000}; + set_size = {min = 0; max = 1000}; + map_size = {min = 0; max = 1000}; + } + end) + (Crypto_samplers) + +module Michelson_base_samplers = Samplers.Michelson_base + +(* ----------------------------------------------------------------------- *) + +let make_data_sampler rng_state config = + let target_size = + Base_samplers.sample_in_interval rng_state ~range:config.target_size + in + let module Data = + Michelson_mcmc_samplers.Make_data_sampler + (Michelson_base_samplers) + (Crypto_samplers) + (struct + let rng_state = rng_state + + let target_size = target_size + + let verbosity = `Silent + end) + in + let burn_in = target_size * config.burn_in_multiplier in + let generator = Data.generator ~burn_in rng_state in + generator rng_state + +let make_code_sampler rng_state config = + let target_size = + Base_samplers.sample_in_interval rng_state ~range:config.target_size + in + let module Code = + Michelson_mcmc_samplers.Make_code_sampler + (Michelson_base_samplers) + (Crypto_samplers) + (struct + let rng_state = rng_state + + let target_size = target_size + + let verbosity = `Silent + end) + in + let burn_in = target_size * config.burn_in_multiplier in + let generator = Code.generator ~burn_in rng_state in + generator rng_state diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.mli b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.mli new file mode 100644 index 000000000000..89868e6f58b1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_generation.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** {2 Wrappers around some Michelson generators and related helpers} *) + +(** [generator_config] specifies some parameters to the + {!Tezos_benchmark_alpha.Michelson_mcmc_samplers} Michelson code and data generators. *) +type generator_config = { + target_size : Base_samplers.range; + (** The target size of the terms, in number of nodes, is sampled uniformly + in [target_size]. *) + burn_in_multiplier : int; + (** The generators are based on a Markov chain, which must be + "heated-up" until it reaches its stationary state. A prefix of samples + are therefore thrown away: this is called the {e burn-in} phase. + The number of thrown away terms is proportional to [burn_in_multiplier] + and [target_size]. *) +} + +(** Default configuration for the generators. *) +val default_generator_config : generator_config + +val generator_config_encoding : generator_config Data_encoding.t + +(** Samplers *) + +(** [make_data_sampler] constructs a Michelson data sampler based on the + infrastructure available in {!Tezos_benchmark_alpha.Michelson_mcmc_samplers}. *) +val make_data_sampler : + Random.State.t -> generator_config -> Michelson_mcmc_samplers.michelson_data + +(** [make_code_sampler] constructs a Michelson code sampler based on the + infrastructure available in {!Tezos_benchmark_alpha.Michelson_mcmc_samplers}. *) +val make_code_sampler : + Random.State.t -> generator_config -> Michelson_mcmc_samplers.michelson_code + +(** [Samplers] is an instance of the direct-style (non-MCMC based) samplers + implemented in {!Tezos_benchmark_alpha.Michelson_samplers}. *) +module Samplers : Michelson_samplers.S diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_types.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_types.ml new file mode 100644 index 000000000000..95af373691cc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/michelson_types.ml @@ -0,0 +1,131 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Script_typed_ir + +[@@@ocaml.warning "-32"] + +let ( @$ ) x y = Item_t (x, y) + +let bot = Bot_t + +let unit = unit_t + +(* the type of integers *) +let int = int_t + +(* the type of naturals *) +let nat = nat_t + +(* the type of strings *) +let string = string_t + +(* the type of bytes *) +let bytes = bytes_t + +(* the type of booleans *) +let bool = bool_t + +(* the type of mutez *) +let mutez = mutez_t + +(* the type of public key *) +let public_key = key_t + +(* the type of key hashes *) +let key_hash = key_hash_t + +(* the type of signatures *) +let signature = signature_t + +(* the type of addresses *) +let address = address_t + +(* the type of chain ids *) +let chain_id = chain_id_t + +(* the type of timestamps *) +let timestamp = timestamp_t + +(* list type constructor *) +let list x = match list_t (-1) x with Error _ -> assert false | Ok t -> t + +(* option type constructor *) +let option x = match option_t (-1) x with Error _ -> assert false | Ok t -> t + +(* map type constructor*) +let map k v = match map_t (-1) k v with Error _ -> assert false | Ok t -> t + +(* map type constructor*) +let big_map k v = + match big_map_t (-1) k v with Error _ -> assert false | Ok t -> t + +(* set type constructor*) +let set k = match set_t (-1) k with Error _ -> assert false | Ok t -> t + +(* pair type constructor*) +let pair k1 k2 = + match pair_t (-1) k1 k2 with Error _ -> assert false | Ok t -> t + +(* comparable pair type constructor *) +let cpair k1 k2 = + match comparable_pair_t (-1) k1 k2 with Error _ -> assert false | Ok t -> t + +(* union type constructor*) +let union k1 k2 = + match union_t (-1) k1 k2 with Error _ -> assert false | Ok t -> t + +(* comparable union type constructor *) +let cunion k1 k2 = + match comparable_union_t (-1) k1 k2 with Error _ -> assert false | Ok t -> t + +let lambda x y = + match lambda_t (-1) x y with Error _ -> assert false | Ok t -> t + +let contract arg_ty = + match contract_t (-1) arg_ty with Error _ -> assert false | Ok t -> t + +let operation = operation_t + +let sapling_state memo_size = sapling_state_t ~memo_size + +let sapling_transaction memo_size = sapling_transaction_t ~memo_size + +let sapling_transaction_deprecated memo_size = + sapling_transaction_deprecated_t ~memo_size + +let bls12_381_g1 = bls12_381_g1_t + +let bls12_381_g2 = bls12_381_g2_t + +let bls12_381_fr = bls12_381_fr_t + +let ticket ty = + match ticket_t (-1) ty with Error _ -> assert false | Ok t -> t + +let chest_key = chest_key_t + +let chest = chest_t diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/registration_helpers.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/registration_helpers.ml new file mode 100644 index 000000000000..18586c1e2b68 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/registration_helpers.ml @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Namespace.make Namespace.root "proto" + +let ns = Namespace.make ns Protocol.name + +let register ((module Bench) : Benchmark.t) = + let module B : Benchmark.S = struct + include Bench + + let tags = Protocol.name :: tags + end in + Registration.register (module B) + +let register_for_codegen name model = + Registration.register_for_codegen (name ^ "__" ^ Protocol.name) model diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml new file mode 100644 index 000000000000..95907cd220c7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_benchmarks.ml @@ -0,0 +1,161 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Size = Gas_input_size + +let ns = Namespace.make Registration_helpers.ns "sapling" + +let fv s = Free_variable.of_namespace (ns s) + +module Apply_diff_bench : Benchmark.S = struct + include Interpreter_benchmarks.Default_config + include Interpreter_benchmarks.Default_boilerplate + + let name = ns "SAPLING_APPLY_DIFF" + + let info = "Benchmarking SAPLING_APPLY_DIFF" + + let tags = ["sapling"] + + let diff_from_tx (tx : Alpha_context.Sapling.transaction) = + let open Environment.Sapling.UTXO in + let commitments_and_ciphertexts = + List.map (fun x -> (x.cm, x.ciphertext)) tx.outputs + in + { + Protocol.Sapling_repr.commitments_and_ciphertexts; + nullifiers = List.map (fun (x : input) -> x.nf) tx.inputs; + } + + type workload = {nb_input : int; nb_output : int; nb_cm : int; nb_nf : int} + + let workload_encoding : workload Data_encoding.t = + let open Data_encoding in + def "diff_arg_encoding" + @@ conv + (fun {nb_input; nb_output; nb_cm; nb_nf} -> + (nb_input, nb_output, nb_cm, nb_nf)) + (fun (nb_input, nb_output, nb_cm, nb_nf) -> + {nb_input; nb_output; nb_cm; nb_nf}) + (tup4 Size.encoding Size.encoding Size.encoding Size.encoding) + + let workload_to_vector {nb_input; nb_output; nb_cm = _; nb_nf = _} = + let l = + [ + ("nb_input", float_of_int nb_input); + ("nb_output", float_of_int nb_output); + ] + in + Sparse_vec.String.of_list l + + let model = + Model.make + ~conv:(fun {nb_input; nb_output; _} -> (nb_input, (nb_output, ()))) + ~model: + (Model.bilinear_affine + ~intercept:(fv "apply_diff_const") + ~coeff1:(fv "apply_diff_inputs") + ~coeff2:(fv "apply_diff_outputs")) + + let models = [("apply_diff", model)] + + let benchmark_apply_diff seed sapling_transition () = + let sapling_forge_rng_state = + Random.State.make + @@ Option.fold + ~none:Sapling_generation.shared_seed + ~some:(fun seed -> [|seed|]) + seed + in + Lwt_main.run + ( Execution_context.make ~rng_state:sapling_forge_rng_state + >>=? fun (ctxt, step_constants) -> + Sapling_generation.prepare_seeded_state sapling_transition ctxt + >>=? fun (_, _, _, _, ctxt, state_id) -> + let external_state_id = Alpha_context.Sapling.Id.parse_z state_id in + let internal_state_id = + Lazy_storage_kind.Sapling_state.Id.parse_z state_id + in + Alpha_context.Sapling.(state_from_id ctxt external_state_id) + >|= Environment.wrap_tzresult + >>=? fun (state, ctxt) -> + Format.eprintf "state hash: %d@." (Hashtbl.hash state.diff) ; + Format.eprintf + "tx hash: %d@." + (Hashtbl.hash sapling_transition.sapling_tx) ; + let address = Contract_hash.to_b58check step_constants.self in + let chain_id = + Environment.Chain_id.to_b58check step_constants.chain_id + in + let anti_replay = address ^ chain_id in + Format.eprintf "anti-replay: %s@." anti_replay ; + let diff = diff_from_tx sapling_transition.sapling_tx in + let closure () = + ignore + (Lwt_main.run + (Sapling_generation.apply_diff ctxt internal_state_id diff)) + in + let workload = + { + nb_input = List.length sapling_transition.sapling_tx.inputs; + nb_output = List.length sapling_transition.sapling_tx.outputs; + nb_cm = Int64.to_int sapling_transition.commitment_count; + nb_nf = Int64.to_int sapling_transition.nullifier_count; + } + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> + Format.eprintf + "Runner.benchmarkable_from_instr_str:\n%a@." + (Format.pp_print_list Error_monad.pp) + errs ; + exit 1 + + let create_benchmarks ~rng_state ~bench_num config = + ignore rng_state ; + match config.sapling with + | {sapling_txs_file; seed} -> + let transitions = + Sapling_generation.load + ~filename:sapling_txs_file + Sapling_generation.Full_transaction + in + let length = List.length transitions in + if length < bench_num then + Format.eprintf + "KSapling_verify_update: warning, only %d available transactions \ + (requested %d)@." + length + bench_num ; + let transitions = List.take_n (min bench_num length) transitions in + List.map + (fun (_filename, tx) -> benchmark_apply_diff seed tx) + transitions +end + +let () = Registration_helpers.register (module Apply_diff_bench) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_commands.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_commands.ml new file mode 100644 index 000000000000..f6b22a22c6d9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_commands.ml @@ -0,0 +1,134 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Sapling_gen_cmd = struct + let lift_opt f opt_arg state = + match opt_arg with None -> state | Some arg -> f arg state + + (* ----------------------------------------------------------------------- *) + (* Handling options for the "generate sapling transactions" command *) + + (* Generic max-%s argument *) + let max name = + Tezos_clic.arg + ~doc:(Printf.sprintf "Maximum number of %s" name) + ~long:(Printf.sprintf "max-%s" name) + ~placeholder:"integer" + (Tezos_clic.parameter (fun (_ : unit) parsed -> + match int_of_string parsed with + | exception Failure _ -> + Format.eprintf + "Ill-formatted --max-%s option (expected integer), exiting" + name ; + exit 1 + | res when res < 0 -> + Format.eprintf + "--max-%s should be a positive integer, exiting" + name ; + exit 1 + | res -> return res)) + + (* Integer argument --seed *) + let seed_arg = + let seed = + Tezos_clic.parameter (fun (_ : unit) parsed -> + try return (int_of_string parsed) + with _ -> + Printf.eprintf "Error while parsing --seed argument." ; + exit 1) + in + Tezos_clic.arg ~doc:"RNG seed" ~long:"seed" ~placeholder:"int" seed + + let positive_param = + Tezos_clic.parameter (fun _ s -> + match int_of_string_opt s with + | Some i when i > 0 -> return i + | _ -> failwith "Parameter should be a positive integer literal") + + open Sapling_generation + + let set_max_inputs max_inputs options = {options with max_inputs} + + let set_max_outputs max_outputs options = {options with max_outputs} + + let set_max_nullifiers max_nullifiers options = {options with max_nullifiers} + + let set_max_additional_commitments max_additional_commitments options = + {options with max_additional_commitments} + + let set_seed seed (options : sapling_gen_options) = + {options with seed = Some seed} + + let sapling_handler + (max_inputs, max_outputs, max_nullifiers, max_additional_commitments, seed) + tx_count save_to () = + let sapling_gen_options = + default_sapling_gen_options + |> lift_opt set_max_inputs max_inputs + |> lift_opt set_max_outputs max_outputs + |> lift_opt set_max_nullifiers max_nullifiers + |> lift_opt set_max_additional_commitments max_additional_commitments + |> lift_opt set_seed seed + in + generate save_to tx_count sapling_gen_options ; + return () + + let options = + Tezos_clic.args5 + (max "inputs") + (max "outputs") + (max "nullifiers") + (max "additional-commitments") + seed_arg + + let params = + Tezos_clic.( + prefixes [Protocol.name; "sapling"; "generate"] + @@ param + ~name:"SAPLING-TX-COUNT" + ~desc:"Number of sapling transactions to generate" + positive_param + @@ prefixes ["transactions"; "in"] + @@ string + ~name:"SAPLING-TX-FILE" + ~desc:"File containing sapling transactions" + @@ stop) + + let group = + { + Tezos_clic.name = "Sapling tx generation"; + title = "Command for generating random sapling transactions"; + } + + let command = + Tezos_clic.command + ~group + ~desc:"Sapling transaction generation" + options + params + sapling_handler +end + +let () = Registration.add_command Sapling_gen_cmd.command diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_generation.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_generation.ml new file mode 100644 index 000000000000..9c2766e22a2f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sapling_generation.ml @@ -0,0 +1,588 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(* ------------------------------------------------------------------------- *) +type sapling_gen_options = { + max_inputs : int; + max_outputs : int; + max_nullifiers : int; + max_additional_commitments : int; + seed : int option; +} + +let default_sapling_gen_options = + { + max_inputs = 100; + max_outputs = 100; + max_nullifiers = 100; + max_additional_commitments = 50; + seed = None; + } + +(* ------------------------------------------------------------------------- *) +(* Evil incantations *) + +(* We have to break the protocol abstraction boundary quite often in this + module. Props to whoever finds a way to avoid these calls. *) + +let alpha_to_raw (x : Alpha_context.t) : Raw_context.t = Obj.magic x + +let raw_to_alpha (x : Raw_context.t) : Alpha_context.t = Obj.magic x + +(* ------------------------------------------------------------------------- *) +(* Helpers *) + +(* sample a random permutation of [0 ; ... ; n-1] *) +let fisher_yates n state = + let a = Array.init n (fun i -> i) in + for i = 0 to Array.length a - 1 do + let j = Random.State.int state (i + 1) in + let tmp = a.(j) in + a.(j) <- a.(i) ; + a.(i) <- tmp + done ; + a + +(* sample a random injection of [0 ; ... ; m-1 ] in [0 ; ... ; n - 1] *) +let random_injection m n state = + if m > n then invalid_arg "random_injection" + else + let a = fisher_yates n state in + Array.sub a 0 m + +(* ------------------------------------------------------------------------- *) +(* Sapling generation *) + +(* Sapling state spec + sapling transaction valid for that state. *) +type sapling_transition = { + state_seed : int64; + nullifier_count : int64; + commitment_count : int64; + sapling_tx : Alpha_context.Sapling.transaction; +} + +type forge_info = { + rcm : Tezos_sapling.Core.Client.Rcm.t; + position : int64; + amount : int64; + address : Tezos_sapling.Core.Client.Viewing_key.address; + nf : Tezos_sapling.Core.Client.Nullifier.t; +} + +let random_amount state sum = + Random.State.int64 + state + (Int64.sub Tezos_sapling.Core.Validator.UTXO.max_amount sum) + +let reverse diff = + Protocol.Sapling_repr. + { + diff with + commitments_and_ciphertexts = List.rev diff.commitments_and_ciphertexts; + } + +let pp_rpc_diff fmtr (diff : Protocol.Sapling_repr.diff) = + let json = + Data_encoding.Json.construct Protocol.Sapling_repr.diff_encoding diff + in + Format.fprintf fmtr "%a" Data_encoding.Json.pp json + +let random_bytes state size = + Bytes.init size (fun _ -> Char.chr (Random.State.int state 256)) + +let rec gen_rcm state = + let rcm = + Data_encoding.Binary.of_bytes_exn + Tezos_sapling.Core.Client.Rcm.encoding + (random_bytes state 32) + in + try + Tezos_sapling.Core.Client.Rcm.assert_valid rcm ; + rcm + with _ -> gen_rcm state + +(* Adds a commitment, ciphertext, cv to an rpc_diff *) +let add_input diff vk index position sum state = + let rcm = gen_rcm state in + let amount = random_amount state sum in + let new_idx, address = + Tezos_sapling.Core.Client.Viewing_key.new_address vk index + in + let cv = + Tezos_sapling.Core.Client.CV.of_bytes (random_bytes state 32) + |> WithExceptions.Option.get ~loc:__LOC__ + in + let ciphertext, cm = + Tezos_sapling.Core.Client.Forge.Output.to_ciphertext + Tezos_sapling.Core.Client.Forge.Output. + {address; amount; memo = Bytes.empty} + cv + vk + rcm + (Tezos_sapling.Core.Client.DH.esk_random ()) + in + let nf = + Tezos_sapling.Core.Client.Nullifier.compute address vk ~amount rcm ~position + in + let diff = + Protocol.Sapling_repr. + { + diff with + commitments_and_ciphertexts = + (cm, ciphertext) :: diff.commitments_and_ciphertexts; + } + in + return (diff, {rcm; position; amount; address; nf}, new_idx) + +let generate_commitments ~vk ~nb_input ~nb_cm ~nb_nf ~diff ~index state = + let inj = random_injection nb_input nb_cm state in + let use_for_input i = Array.exists (fun k -> k = i) inj in + let rec loop i cm_index nb_nf diff to_forge sum = + if i = nb_cm then return (reverse diff, to_forge) + else if use_for_input i then + (* create commitment for input *) + add_input diff vk cm_index (Int64.of_int i) sum state + >>=? fun (diff, forge_info, next_index) -> + let sum = Int64.add sum forge_info.amount in + loop (i + 1) next_index nb_nf diff (forge_info :: to_forge) sum + else + (* create commitment (not for input) *) + add_input diff vk cm_index (Int64.of_int i) sum state + >>=? fun (diff, {nf; _}, next_index) -> + (* can we use a nullifier? *) + if nb_nf = 0 then (* No. *) + loop (i + 1) next_index nb_nf diff to_forge sum + else + (* Yes! Grab it. *) + let diff = + Protocol.Sapling_repr.{diff with nullifiers = nf :: diff.nullifiers} + in + loop (i + 1) next_index (nb_nf - 1) diff to_forge sum + in + loop 0 index nb_nf diff [] 0L + +(* Add roots to the storage. One cm has to be added for every root. *) +let rec add_root nb_root ctxt id vk index size diff state = + if nb_root > 0 then + add_input Protocol.Sapling_storage.empty_diff vk index size 0L state + >>=? fun (diff_to_add, {position = size; _}, new_idx) -> + Protocol.Sapling_storage.apply_diff ctxt id diff_to_add + >|= Environment.wrap_tzresult + >>=? fun (ctxt, _) -> + (* We call it nb_root -1 because one root is already present*) + add_root + (nb_root - 1) + ctxt + id + vk + new_idx + (Int64.succ size) + Protocol.Sapling_repr. + { + diff with + commitments_and_ciphertexts = + diff.commitments_and_ciphertexts + @ diff_to_add.commitments_and_ciphertexts; + } + state + else return (ctxt, diff) + +(* Compute a state as an OCaml object to compute the witness *) +let state_from_rpc_diff rpc_diff = + Tezos_sapling.Storage.add + (Tezos_sapling.Storage.empty ~memo_size:0) + rpc_diff.Protocol.Sapling_repr.commitments_and_ciphertexts + +(* Create an (unspendable) output from a proving context and a vk *) +let output proving_ctx vk sum state = + let address = Tezos_sapling.Core.Client.Viewing_key.dummy_address () in + let amount = random_amount state sum in + let rcm = Tezos_sapling.Core.Client.Rcm.random () in + let esk = Tezos_sapling.Core.Client.DH.esk_random () in + let cv_o, proof_o = + Tezos_sapling.Core.Client.Proving.output_proof + proving_ctx + esk + address + rcm + ~amount + in + let ciphertext, cm = + Tezos_sapling.Core.Client.Forge.Output.to_ciphertext + Tezos_sapling.Core.Client.Forge.Output. + {address; amount; memo = Bytes.empty} + cv_o + vk + rcm + esk + in + (Tezos_sapling.Core.Validator.UTXO.{cm; proof_o; ciphertext}, amount) + +(* Returns a list of outputs and the sum of their amount *) +let outputs nb_output proving_ctx vk state = + let rec aux output_amount list_outputs nb_output sum = + match nb_output with + | 0 -> (output_amount, list_outputs) + | nb_output -> + let output, amount = output proving_ctx vk sum state in + assert ( + Int64.compare + amount + (Int64.sub + Int64.max_int + Tezos_sapling.Core.Validator.UTXO.max_amount) + < 0) ; + aux + (Int64.add output_amount amount) + (output :: list_outputs) + (nb_output - 1) + (Int64.add sum amount) + in + aux 0L [] nb_output 0L + +(* Create the list of inputs. To use once the merkle tree is completed. *) +let make_inputs to_forge local_state proving_ctx sk vk root anti_replay = + List.map_ep + (fun {rcm; position; amount; address; nf} -> + let witness = Tezos_sapling.Storage.get_witness local_state position in + let ar = Tezos_sapling.Core.Client.Proving.ar_random () in + let cv, rk, proof = + Tezos_sapling.Core.Client.Proving.spend_proof + proving_ctx + vk + sk + address + rcm + ar + ~amount + ~root + ~witness + in + let signature = + Tezos_sapling.Core.Client.Proving.spend_sig + sk + ar + cv + nf + rk + proof + anti_replay + in + return + Tezos_sapling.Core.Validator.UTXO. + {cv; nf; rk; proof_i = proof; signature}) + to_forge + +let init_fresh_sapling_state ctxt = + let open Environment.Error_monad in + Protocol.Lazy_storage_diff.fresh + Protocol.Lazy_storage_kind.Sapling_state + ~temporary:false + ctxt + >>=? fun (ctxt, id) -> + Protocol.Sapling_storage.init ctxt id ~memo_size:0 + (* TODO CHECK *) + >>=? fun ctxt -> return (ctxt, id) + +let generate_spending_and_viewing_keys state = + let sk = + Tezos_sapling.Core.Client.Spending_key.of_seed (random_bytes state 32) + in + let vk = Tezos_sapling.Core.Client.Viewing_key.of_sk sk in + (sk, vk) + +let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) + ~(nb_cm : int) (ctxt : Raw_context.t) (state : Random.State.t) : + (Sapling_repr.diff + * forge_info list + * Tezos_sapling.Core.Client.Spending_key.t + * Tezos_sapling.Core.Client.Viewing_key.t + * Raw_context.t + * Protocol.Lazy_storage_kind.Sapling_state.Id.t) + tzresult + Lwt.t = + init_fresh_sapling_state ctxt >|= Environment.wrap_tzresult + >>=? fun (ctxt, id) -> + let index_start = Tezos_sapling.Core.Client.Viewing_key.default_index in + let sk, vk = generate_spending_and_viewing_keys state in + generate_commitments + ~vk + ~nb_input + ~nb_cm + ~nb_nf + ~diff:Protocol.Sapling_storage.empty_diff + ~index:index_start + state + >>=? fun (diff, to_forge) -> + Protocol.Sapling_storage.apply_diff ctxt id (reverse diff) + >|= Environment.wrap_tzresult + >>=? fun (ctxt, _size) -> return (diff, to_forge, sk, vk, ctxt, id) + +let prepare_seeded_state + {state_seed; nullifier_count; commitment_count; sapling_tx} ctxt = + let rng_state = Random.State.make [|Int64.to_int state_seed|] in + prepare_seeded_state_internal + ~nb_input:(List.length sapling_tx.inputs) + ~nb_nf:(Int64.to_int nullifier_count) + ~nb_cm:(Int64.to_int commitment_count) + (alpha_to_raw ctxt) + rng_state + >>=? fun (diff, forge_info, spending_key, viewing_key, raw_ctxt, raw_id) -> + let id = Protocol.Lazy_storage_kind.Sapling_state.Id.unparse_to_z raw_id in + return (diff, forge_info, spending_key, viewing_key, raw_to_alpha raw_ctxt, id) + +let generate ~(nb_input : int) ~(nb_output : int) ~(nb_nf : int) ~(nb_cm : int) + ~(anti_replay : string) ~ctxt state = + assert (nb_input <= nb_cm) ; + assert (nb_nf <= nb_cm - nb_input) ; + prepare_seeded_state_internal ~nb_input ~nb_nf ~nb_cm ctxt state + >>=? fun (diff, to_forge, sk, vk, ctxt, id) -> + let local_state = state_from_rpc_diff diff in + let root = Tezos_sapling.Storage.get_root local_state in + Tezos_sapling.Core.Client.Proving.with_proving_ctx (fun proving_ctx -> + make_inputs to_forge local_state proving_ctx sk vk root anti_replay + >>=? fun inputs -> + let output_amount, outputs = outputs nb_output proving_ctx vk state in + let input_amount = + List.fold_left + (fun sum {amount; _} -> + assert ( + Int64.compare + sum + (Int64.sub + Int64.max_int + Tezos_sapling.Core.Validator.UTXO.max_amount) + < 0) ; + Int64.add sum amount) + 0L + to_forge + in + let balance = Int64.sub input_amount output_amount in + let bound_data = + (* The bound data are benched separately so we add + empty bound data*) + "" + in + let binding_sig = + Tezos_sapling.Core.Client.Proving.make_binding_sig + proving_ctx + inputs + outputs + ~balance + ~bound_data + anti_replay + in + let transaction = + Tezos_sapling.Core.Validator.UTXO. + {inputs; outputs; binding_sig; balance; root; bound_data} + in + return transaction) + >>=? fun transaction -> + assert (Compare.List_length_with.(transaction.inputs = nb_input)) ; + assert (Compare.List_length_with.(transaction.outputs = nb_output)) ; + return (transaction, (ctxt, id)) + +(* ------------------------------------------------------------------------- *) +(* Nicely packaging sapling generation for snoop *) + +let sapling_transition_encoding = + let open Data_encoding in + conv + (fun {state_seed; nullifier_count; commitment_count; sapling_tx} -> + (state_seed, nullifier_count, commitment_count, sapling_tx)) + (fun (state_seed, nullifier_count, commitment_count, sapling_tx) -> + {state_seed; nullifier_count; commitment_count; sapling_tx}) + (obj4 + (req "state_seed" int64) + (req "nullifier_count" int64) + (req "commitment_count" int64) + (req "sapling_tx" Alpha_context.Sapling.transaction_encoding)) + +let sapling_dataset_encoding = Data_encoding.list sapling_transition_encoding + +let save ~filename ~txs = + let str = + match Data_encoding.Binary.to_string sapling_dataset_encoding txs with + | Error err -> + Format.eprintf + "Sapling_generation.save: encoding failed (%a); exiting" + Data_encoding.Binary.pp_write_error + err ; + exit 1 + | Ok res -> res + in + ignore (* TODO handle error *) + (Lwt_main.run @@ Tezos_stdlib_unix.Lwt_utils_unix.create_file filename str) + +let load_file filename = + Lwt_main.run + @@ ( Tezos_stdlib_unix.Lwt_utils_unix.read_file filename >>= fun str -> + Format.eprintf "Sapling_generation.load: loaded %s@." filename ; + match Data_encoding.Binary.of_string sapling_dataset_encoding str with + | Ok result -> + let result = List.map (fun tx -> (filename, tx)) result in + Lwt.return result + | Error err -> + Format.eprintf + "Sapling_generation.load: can't load file (%a); exiting" + Data_encoding.Binary.pp_read_error + err ; + exit 1 ) + +let get_all_sapling_data_files directory = + let is_sapling_data file = + let regexp = Str.regexp ".*\\.sapling" in + Str.string_match regexp file 0 + in + let lift file = directory ^ "/" ^ file in + let handle = Unix.opendir directory in + let rec loop acc = + match Unix.readdir handle with + | file -> if is_sapling_data file then loop (lift file :: acc) else loop acc + | exception End_of_file -> + Unix.closedir handle ; + acc + in + loop [] + +type type_transaction = Empty | No_inputs | No_outputs | Full_transaction + +let load ~filename type_transaction = + if not (Sys.file_exists filename) then ( + Format.eprintf "Sapling_generation.load: file does not exist@." ; + Stdlib.failwith "Sapling_generation.load") + else if Sys.is_directory filename then + let () = + Format.eprintf + "Sapling_generation.load: loading all .sapling files from directory \ + %s@." + filename + in + let files = get_all_sapling_data_files filename in + List.concat_map load_file files + |> List.filter (fun (_str, transac) -> + match type_transaction with + | Empty -> + List.is_empty transac.sapling_tx.outputs + && List.is_empty transac.sapling_tx.inputs + | No_inputs -> + (not (List.is_empty transac.sapling_tx.outputs)) + && List.is_empty transac.sapling_tx.inputs + | No_outputs -> + List.is_empty transac.sapling_tx.outputs + && not (List.is_empty transac.sapling_tx.inputs) + | Full_transaction -> + (not (List.is_empty transac.sapling_tx.outputs)) + && not (List.is_empty transac.sapling_tx.inputs)) + else load_file filename + +let shared_seed = [|9798798; 217861209; 876786|] + +let generate (save_to : string) (tx_count : int) + (sapling_gen_options : sapling_gen_options) = + let result = + Lwt_main.run + (let { + max_inputs; + max_outputs; + max_nullifiers; + max_additional_commitments; + seed; + } = + sapling_gen_options + in + let rng_state = + (* /!\ This must match the seed used at benchmark time, + defined in Runner.benchmark_sapling. /!\ *) + Random.State.make + @@ Option.fold ~none:shared_seed ~some:(fun seed -> [|seed|]) seed + in + Execution_context.make ~rng_state >>=? fun (ctxt, step_constants) -> + let address = Contract_hash.to_b58check step_constants.self in + let chain_id = + Environment.Chain_id.to_b58check step_constants.chain_id + in + let anti_replay = address ^ chain_id in + let ctxt = alpha_to_raw ctxt in + (match sapling_gen_options.seed with + | None -> Random.self_init () + | Some seed -> Random.init seed) ; + let seeds = + Stdlib.List.init tx_count (fun i -> (i, Random.int 0x3FFFFFFF)) + in + let rec loop seeds acc = + match seeds with + | [] -> return acc + | (i, seed) :: tl -> + let nb_input = + if max_inputs = 0 then 0 else 1 + Random.int max_inputs + in + let nb_output = + if max_outputs = 0 then 0 else 1 + Random.int max_outputs + in + let nb_nf = 1 + Random.int max_nullifiers in + let nb_cm = + nb_input + nb_nf + Random.int max_additional_commitments + in + let () = + Format.eprintf "@." ; + Format.eprintf "generating sapling tx %i/%d@." (i + 1) tx_count ; + Format.eprintf "saving to file %s@." save_to ; + Format.eprintf "nb_input = %d@." nb_input ; + Format.eprintf "nb_output = %d@." nb_output ; + Format.eprintf "nb_nf = %d@." nb_nf ; + Format.eprintf "nb_cm = %d@." nb_cm ; + Format.eprintf "anti_replay = %s@." anti_replay + in + let state = Random.State.make [|seed|] in + generate + ~nb_input + ~nb_output + ~nb_nf + ~nb_cm + ~anti_replay + ~ctxt + state + >>=? fun (tx, (_ctxt, _state_id)) -> + let result = + { + state_seed = Int64.of_int seed; + nullifier_count = Int64.of_int nb_nf; + commitment_count = Int64.of_int nb_cm; + sapling_tx = Obj.magic tx; + } + in + loop tl (result :: acc) + in + loop seeds []) + in + match result with Ok txs -> save ~filename:save_to ~txs | Error _ -> () + +let apply_diff ctxt id diff = + let open Environment.Error_monad in + Sapling_storage.apply_diff (alpha_to_raw ctxt) id diff + >>=? fun (ctxt, size) -> return (raw_to_alpha ctxt, size) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml new file mode 100644 index 000000000000..7df3c5281247 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -0,0 +1,482 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Namespace.make Registration_helpers.ns "sc_rollup" + +let fv s = Free_variable.of_namespace (ns s) + +(** This benchmark estimates the cost of verifying an output proof for the + Wasm PVM. + The inferred cost model is [c1 + c2*proof_length]. *) +module Sc_rollup_verify_output_proof_benchmark = struct + (* This section contains preliminary definitions for building a pvm state + from scratch. *) + + module Context = Tezos_context_memory.Context_binary + + module Wasm_context = struct + type Tezos_lazy_containers.Lazy_map.tree += Tree of Context.tree + + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + + let select = function + | Tree t -> t + | _ -> raise Tezos_tree_encoding.Incorrect_tree_type + + let wrap t = Tree t + end + + type tree = Context.tree + + type proof = Context.Proof.tree Context.Proof.t + + let verify_proof p f = + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof context tree step = + let open Lwt_syntax in + let* context = Context.add_tree context [] tree in + let* _hash = Context.commit ~time:Time.Protocol.epoch context in + let index = Context.index context in + match Context.Tree.kinded_key tree with + | Some k -> + let* p = Context.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup_repr.State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = + let module Proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding + in + Proof_encoding.V2.Tree2.tree_proof_encoding + end + + let make_transaction value text contract = + let entrypoint = Entrypoint_repr.default in + let destination : Contract_hash.t = + Contract_hash.of_bytes_exn @@ Bytes.of_string contract + in + let open Tezos_micheline.Micheline in + let open Michelson_v1_primitives in + let unparsed_parameters = + strip_locations + @@ Prim + ( 0, + I_TICKET, + [ + Prim + (0, I_PAIR, [Int (0, Z.of_int32 value); String (1, text)], []); + ], + [] ) + in + Sc_rollup_outbox_message_repr.{unparsed_parameters; entrypoint; destination} + + let ( -- ) min max : Base_samplers.range = {min; max} + + let make_transactions ~rng_state ~max = + let open Base_samplers in + let n = sample_in_interval ~range:(0 -- max) rng_state in + Stdlib.List.init n (fun _ -> + let contract = uniform_string ~nbytes:20 rng_state in + let value = + Int32.of_int @@ sample_in_interval ~range:(-1000 -- 1000) rng_state + in + let text = string ~size:(0 -- 40) rng_state in + make_transaction value text contract) + + let make_outbox_message ~nb_transactions ~rng_state = + let transactions = make_transactions ~rng_state ~max:nb_transactions in + Sc_rollup_outbox_message_repr.Atomic_transaction_batch {transactions} + + let dummy_context = + let dummy = Context.init "/tmp" in + Context.empty @@ Lwt_main.run dummy + + let empty_tree = Context.Tree.empty dummy_context + + (* Build a pvm state from scratch. *) + let build_pvm_state rng_state ~nb_inbox_messages ~input_payload_size + ~nb_output_buffer_levels ~output_buffer_size ~nb_transactions ~tree_depth + ~tree_branching_factor = + let open Lwt_result_syntax in + let random_key () = + Base_samplers.readable_ascii_string ~size:(5 -- 5) rng_state + in + (* [gen_tree] Generates a tree for the given depth and branching factor. + This function is witten in CPS to avoid [stack-overflow] errors when + branching factor is 1 and tree depth is big. *) + let gen_tree () = + let bottom_tree = + let tree = empty_tree in + let key = [random_key ()] in + let value = Bytes.empty in + Context.Tree.add tree key value + in + let rec gen_tree tree_depth kont = + if tree_depth = 0 then kont bottom_tree + else + gen_tree + (tree_depth - 1) + (let rec kont' nb_subtrees acc_subtrees subtree = + let*! subtree = subtree in + let acc_subtrees = subtree :: acc_subtrees in + let nb_subtrees = nb_subtrees + 1 in + if nb_subtrees = tree_branching_factor then + let tree = empty_tree in + kont + @@ List.fold_left_s + (fun tree subtree -> + let key = [random_key ()] in + Context.Tree.add_tree tree key subtree) + tree + acc_subtrees + else gen_tree (tree_depth - 1) (kont' nb_subtrees acc_subtrees) + in + kont' 0 []) + in + gen_tree tree_depth Fun.id + in + (* Add trees of junk data in the [durable] and [wasm] parts + of the storage. *) + let*! durable_junk_tree = gen_tree () in + let*! wasm_junk_tree = gen_tree () in + let tree = empty_tree in + let*! tree = Context.Tree.add_tree tree ["durable"] durable_junk_tree in + let*! tree = Context.Tree.add_tree tree ["wasm"] wasm_junk_tree in + (* Create an output buffers and fill it with random batches of + transactions. *) + let open Tezos_webassembly_interpreter in + let open Tezos_scoru_wasm in + let module Index_Vector = Lazy_vector.Mutable.ZVector in + let module Level_Map = Lazy_map.Mutable.LwtInt32Map in + let output = + Level_Map.create + ~produce_value:(fun _ -> + Lwt.return @@ Index_Vector.create (Z.of_int output_buffer_size)) + () + in + let*! () = + let open Sc_rollup_outbox_message_repr in + List.iter_s + (fun l -> + let*! outbox = Level_Map.get (Int32.of_int l) output in + Lwt.return + @@ List.iter + (fun i -> + let out = make_outbox_message ~nb_transactions ~rng_state in + let outbox_message = + Data_encoding.Binary.to_bytes_exn encoding out + in + Index_Vector.set (Z.of_int i) outbox_message outbox) + Misc.(0 --> (output_buffer_size - 1))) + Misc.(0 --> (nb_output_buffer_levels - 1)) + in + let output = Output_buffer.Internal_for_tests.make output in + (* Create the input buffer. *) + let input = Index_Vector.create (Z.of_int nb_inbox_messages) in + let make_input_message (message_counter : int) : Input_buffer.message = + let open Base_samplers in + let random_payload () = + uniform_bytes ~nbytes:input_payload_size rng_state + in + { + raw_level = Int32.of_int message_counter; + message_counter = Z.of_int message_counter; + payload = random_payload (); + } + in + let () = + List.iter + (fun counter -> + Index_Vector.set (Z.of_int counter) (make_input_message counter) input) + Misc.(0 --> (nb_inbox_messages - 1)) + in + (* Encode the buffers and update the state of the pvm. *) + let buffers = Eval.{input; output} in + let buffers_encoding = Wasm_pvm.durable_buffers_encoding in + let module Tree_encoding_runner = + Tezos_tree_encoding.Runner.Make (Wasm_context.Tree) in + let*! tree = + Tree_encoding_runner.encode + (Tezos_tree_encoding.option buffers_encoding) + (Some buffers) + tree + in + Lwt.return (dummy_context, output, tree) + + module Full_Wasm = + Sc_rollup_wasm.V2_0_0.Make (Environment.Wasm_2_0_0.Make) (Wasm_context) + + (* Benchmark starts here. *) + + let name = ns "Sc_rollup_verify_output_proof_benchmark" + + let info = "Estimating the cost of verifying an output proof" + + let tags = ["sc_rollup"] + + type config = { + nb_inbox_messages : int; + input_payload_size : int; + nb_output_buffer_levels : int; + output_buffer_size : int; + nb_transactions : int; + tree_depth : int; + tree_branching_factor : int; + } + + let config_encoding = + let open Data_encoding in + conv + (fun { + nb_inbox_messages; + input_payload_size; + nb_output_buffer_levels; + output_buffer_size; + nb_transactions; + tree_depth; + tree_branching_factor; + } -> + ( nb_inbox_messages, + input_payload_size, + nb_output_buffer_levels, + output_buffer_size, + nb_transactions, + tree_depth, + tree_branching_factor )) + (fun ( nb_inbox_messages, + input_payload_size, + nb_output_buffer_levels, + output_buffer_size, + nb_transactions, + tree_depth, + tree_branching_factor ) -> + { + nb_inbox_messages : int; + input_payload_size : int; + nb_output_buffer_levels; + output_buffer_size; + nb_transactions; + tree_depth; + tree_branching_factor; + }) + (obj7 + (req "nb_inbox_messages" int31) + (req "input_payload_size" int31) + (req "nb_output_buffer_levels" int31) + (req "output_buffer_size" int31) + (req "nb_transactions" int31) + (req "tree_depth" int31) + (req "tree_branching_factor" int31)) + + (** The actual config used to generate the more accurate model in + [sc_rollup_costs.ml] is : + [{ + nb_inbox_messages = 1000; + input_payload_size = 4096; + nb_output_buffer_levels = 10_000; + output_buffer_size = 100; + nb_transactions = 50; + tree_depth = 10; + tree_branching_factor = 4; + }] + With the config above, the benchmark takes more than an hour. The default + config is lighter and takes a few minutes. + + The table below shows benchmarking results for different tree depths and + number of outbox levels of the pvm state. The branching factor of the + generated "junk" trees in this benchmark is 4 (i.e for a depth of 10 the + generated tree contains more than 1_000_000 nodes). A tree depth of more + than 10 or a number of outbox levels of more than 10000 reaches the + memory limit of a laptop with 16Gb of memory. All proofs generated by + these benchmarks are below 10kb. + + +-----------+---------------+-------------------------+-----------------+ + | Junk tree | Number of | Inferred model | Gas cost for a | + | depth | outbox levels | | proof 10kb long | + +-----------+---------------+-------------------------+-----------------+ + | 5 | 1000 | 7.907*size + 99291.292 | 178361 | + +-----------+---------------+-------------------------+-----------------+ + | 6 | 2000 | 9.510*size + 99516.012 | 194616 | + +-----------+---------------+-------------------------+-----------------+ + | 7 | 4000 | 11.383*size + 95445.175 | 209275 | + +-----------+---------------+-------------------------+-----------------+ + | 8 | 6000 | 11.316*size + 100760.29 | 213920 | + +-----------+---------------+-------------------------+-----------------+ + | 9 | 8000 | 11.227*size + 98748.490 | 211018 | + +-----------+---------------+-------------------------+-----------------+ + | 10 | 10000 | 11.680*size + 98707.082 | 215507 | + +-----------+---------------+-------------------------+-----------------+ + + The [nb_transactions] parameter is the max number of transactions in an + outbox message, it is set at 50 because a message with 50 transactions + approches the max size of an outbox message. Hence, this allows to + benchmark for various proof lengths. The [nb_inbox_messages] parameter is + set to correspond to the max number of messages in an inbox. And the + [input_payload_size] parameter is set to the biggest possible size of an + input message. These two parameters impact the number of nodes in the pvm + state and are stored in the "input" part of the state. We add data in this + "input" part because of its proximity with the "output" part in the pvm + state. *) + let default_config = + { + nb_inbox_messages = 1000; + input_payload_size = 4096; + nb_output_buffer_levels = 10_000; + output_buffer_size = 100; + nb_transactions = 50; + tree_depth = 10; + tree_branching_factor = 4; + } + + type workload = {proof_length : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {proof_length} -> proof_length) + (fun proof_length -> {proof_length}) + (obj1 (req "proof_length" int31)) + + let workload_to_vector {proof_length} = + Sparse_vec.String.of_list [("proof_length", float_of_int proof_length)] + + let verify_output_proof_model = + Model.make + ~conv:(fun {proof_length} -> (proof_length, ())) + ~model: + (Model.affine + ~intercept:(Free_variable.of_string "const") + ~coeff:(Free_variable.of_string "proof_length")) + + let models = [("verify_output_proof", verify_output_proof_model)] + + let pvm_state = ref None + + let benchmark rng_state conf () = + let nb_output_buffer_levels = conf.nb_output_buffer_levels in + let output_buffer_size = conf.output_buffer_size in + let prepare_benchmark_scenario () = + let open Lwt_result_syntax in + (* Build [pvm_state] and save it to be used for all benchmarks. The state + is large enough for each benchmark to be relatively random. *) + let*! context, output, initial_tree = + match !pvm_state with + | None -> + let res = + build_pvm_state + rng_state + ~nb_inbox_messages:conf.nb_inbox_messages + ~input_payload_size:conf.input_payload_size + ~nb_output_buffer_levels:conf.nb_output_buffer_levels + ~output_buffer_size:conf.output_buffer_size + ~nb_transactions:conf.nb_transactions + ~tree_depth:conf.tree_depth + ~tree_branching_factor:conf.tree_branching_factor + in + pvm_state := Some res ; + res + | Some pvm_state -> pvm_state + in + let open Base_samplers in + (* Pick a level. *) + let outbox_level = + Int32.of_int + @@ sample_in_interval + ~range:(0 -- (nb_output_buffer_levels - 1)) + rng_state + in + (* Pick a message. *) + let message_index = + Z.of_int + @@ sample_in_interval ~range:(0 -- (output_buffer_size - 1)) rng_state + in + let*! bytes_output_message = + Tezos_webassembly_interpreter.Output_buffer.get_message + output + {outbox_level; message_index} + in + let message = + Data_encoding.Binary.of_bytes_exn + Sc_rollup_outbox_message_repr.encoding + bytes_output_message + in + let*? outbox_level = + Environment.wrap_tzresult @@ Raw_level_repr.of_int32 outbox_level + in + (* Produce an output proof for the picked message, and return the proof + and its length. *) + let output = Sc_rollup_PVM_sig.{outbox_level; message_index; message} in + let*! pf = Full_Wasm.produce_output_proof context initial_tree output in + match pf with + | Ok proof -> + let proof_length = + Data_encoding.Binary.length Full_Wasm.output_proof_encoding proof + in + return (proof, proof_length) + | Error _ -> assert false + in + + let output_proof, proof_length = + match Lwt_main.run @@ prepare_benchmark_scenario () with + | Ok (proof, len) -> (proof, len) + | Error _ -> assert false + in + let workload = {proof_length} in + + let closure () = + ignore (Lwt_main.run @@ Full_Wasm.verify_output_proof output_proof) + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + + let () = + Registration.register_for_codegen + (Namespace.basename name) + (Model.For_codegen verify_output_proof_model) +end + +let () = + Registration_helpers.register (module Sc_rollup_verify_output_proof_benchmark) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml new file mode 100644 index 000000000000..90d6bf4e850c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_repr_benchmarks.ml @@ -0,0 +1,149 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let ns = Namespace.make Registration_helpers.ns "script_repr" + +let fv s = Free_variable.of_namespace (ns s) + +(** {2 [Script_repr] benchmarks} *) + +module Script_repr_shared_config = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = {micheline_nodes : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {micheline_nodes} -> micheline_nodes) + (fun micheline_nodes -> {micheline_nodes}) + (obj1 (req "micheline_nodes" int31)) + + let tags = [Tags.translator] + + let workload_to_vector {micheline_nodes} = + Sparse_vec.String.of_list [("nodes", float_of_int micheline_nodes)] +end + +module Sampler = Micheline_sampler.Make (struct + type prim = Michelson_v1_primitives.prim + + (* The runtime of the functions in [Script_repr] do not depend on the primitives. *) + let sample_prim : Michelson_v1_primitives.prim Base_samplers.sampler = + fun _rng_state -> I_ADD + + let sample_annots : string list Base_samplers.sampler = fun _rng_state -> [] + + let sample_string = Base_samplers.uniform_string ~nbytes:4 + + let sample_bytes = Base_samplers.uniform_bytes ~nbytes:4 + + let sample_z = Base_samplers.int ~size:{min = 1; max = 8} + + let width_function = Micheline_sampler.reasonable_width_function +end) + +module Micheline_nodes_benchmark : Benchmark.S = struct + include Script_repr_shared_config + + let name = ns "MICHELINE_NODES" + + let info = + "Benchmarking the time it takes to compute the number of nodes of a \ + Micheline term" + + let size_based_model = + Model.make + ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff: + (fv + (Format.asprintf + "%s_ns_per_node_coeff" + (Namespace.basename name)))) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen size_based_model) + + let models = [("size_translator_model", size_based_model)] + + let micheline_nodes_benchmark node = + let nodes = Script_repr.micheline_nodes node in + let workload = {micheline_nodes = nodes} in + let closure () = ignore (Script_repr.micheline_nodes node) in + Generator.Plain {workload; closure} + + let make_bench rng_state _cfg () = + let term = Sampler.sample rng_state in + micheline_nodes_benchmark term + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Micheline_nodes_benchmark) + +module Script_repr_strip_annotations : Benchmark.S = struct + include Script_repr_shared_config + + let name = ns "strip_annotations" + + let info = "Benchmarking Script_repr.strip_annotations" + + let strip_annotations_model = + Model.( + make + ~conv:(fun {micheline_nodes} -> (micheline_nodes, ())) + ~model:(linear ~coeff:(fv "nodes"))) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen strip_annotations_model) + + let models = [("strip_annotations_model", strip_annotations_model)] + + let create_benchmark rng_state () = + let node = Sampler.sample rng_state in + let closure () = ignore @@ Script_repr.strip_annotations node in + let micheline_nodes = Script_repr.micheline_nodes node in + Generator.Plain {workload = {micheline_nodes}; closure} + + let create_benchmarks ~rng_state ~bench_num _cfg = + List.repeat bench_num (create_benchmark rng_state) +end + +let () = Registration_helpers.register (module Script_repr_strip_annotations) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml new file mode 100644 index 000000000000..fbdddeb98d5a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/script_typed_ir_size_benchmarks.ml @@ -0,0 +1,301 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let ns = Namespace.make Registration_helpers.ns "script_typed_ir_size" + +let fv s = Free_variable.of_namespace (ns s) + +(** {2 [Script_typed_ir_size]-related benchmarks} *) + +(** Benchmarking {!Script_typed_ir_size.value_size}. *) + +let model_name = "ir_size_model" + +let strict = Script_ir_translator_config.make ~legacy:false () + +module Size_benchmarks_shared_config = struct + include Translator_benchmarks.Config + + type workload = {size : int} + + let workload_encoding : workload Data_encoding.t = + let open Data_encoding in + def "size_encoding" + @@ conv (fun {size} -> size) (fun size -> {size}) (obj1 (req "size" int31)) + + let workload_to_vector {size} = + Sparse_vec.String.of_list [("size", float_of_int size)] + + let tags = [Tags.translator] + + let size_based_model name = + let intercept_variable = fv (Format.asprintf "%s_const" name) in + let coeff_variable = fv (Format.asprintf "%s_size_coeff" name) in + Model.make + ~conv:(function {size} -> (size, ())) + ~model:(Model.affine ~intercept:intercept_variable ~coeff:coeff_variable) +end + +module Value_size_benchmark : sig + include Tezos_benchmark.Benchmark.S + + val size_based_model : string -> workload Model.t +end = struct + include Size_benchmarks_shared_config + + let name = ns "VALUE_SIZE" + + let models = [(model_name, size_based_model (Namespace.basename name))] + + let info = "Benchmarking Script_typed_ir_size.value_size" + + let value_size_benchmark rng_state (node : Protocol.Script_repr.expr) + (michelson_type : Script_repr.expr) = + (* FIXME: cleanup and factorize this code between translator benches and these ones. *) + let open Translator_benchmarks in + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_ty = Type_helpers.michelson_type_to_ex_ty michelson_type ctxt in + match ex_ty with + | Script_typed_ir.Ex_ty ty -> ( + match + Lwt_main.run + (Script_ir_translator.parse_data + ctxt + ~elab_conf:strict + ~allow_forged:false + ty + (Micheline.root node)) + with + | Error _ | (exception _) -> + bad_data name node michelson_type In_protocol + | Ok (value, _) -> + let open Script_typed_ir_size in + let open Cache_memory_helpers in + let size = Nodes.(to_int (fst (value_size ty value))) in + let workload = {size} in + let closure () = ignore (value_size ty value) in + return (Generator.Plain {workload; closure})) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; typ} = + Michelson_generation.make_data_sampler rng_state cfg.generator_config + in + value_size_benchmark rng_state term typ + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Data {term; typ} -> + Some (fun () -> value_size_benchmark rng_state term typ) + | _ -> None) + terms + | None -> + Format.eprintf "No michelson_terms_file given, generating on-the-fly@." ; + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Value_size_benchmark) + +(** Benchmarking {!Script_typed_ir_size.ty_size}. *) + +module Type_size_benchmark : Tezos_benchmark.Benchmark.S = struct + include Size_benchmarks_shared_config + + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + let name = ns "TYPE_SIZE" + + let info = + "Benchmarking the time it takes to compute Script_typed_ir_size.ty_size" + + let models = [(model_name, size_based_model (Namespace.basename name))] + + let type_size_benchmark (Script_typed_ir.Ex_ty ty) = + let open Script_typed_ir_size.Internal_for_tests in + let open Cache_memory_helpers in + let size = Nodes.(to_int (fst (ty_size ty))) in + let workload = {size} in + let closure () = ignore (ty_size ty) in + Generator.Plain {workload; closure} + + let make_bench rng_state _cfg () = + (* The [size] here is a parameter to the random sampler and does not + match the [size] returned by [type_size]. *) + let size = + Base_samplers.sample_in_interval ~range:{min = 1; max = 1000} rng_state + in + let ex_ty = + Michelson_generation.Samplers.Random_type.m_type ~size rng_state + in + type_size_benchmark ex_ty + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Type_size_benchmark) + +(** Benchmarking {!Script_typed_ir_size.kinstr_size}. *) + +module Kinstr_size_benchmark : sig + include Tezos_benchmark.Benchmark.S + + val size_based_model : string -> workload Model.t +end = struct + include Size_benchmarks_shared_config + + let name = ns "KINSTR_SIZE" + + let models = [(model_name, size_based_model (Namespace.basename name))] + + let info = "Benchmarking Script_typed_ir_size.kinstr_size" + + let kinstr_size_benchmark rng_state (expr : Protocol.Script_repr.expr) + (stack : Script_repr.expr list) = + (* FIXME: cleanup and factorize this code between translator benches and these ones. *) + let open Translator_benchmarks in + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_stack_ty = + Type_helpers.michelson_type_list_to_ex_stack_ty stack ctxt + in + let (Script_ir_translator.Ex_stack_ty bef) = ex_stack_ty in + let node = Micheline.root expr in + match + Lwt_main.run + (Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf:strict + node + bef) + with + | Error _ | (exception _) -> bad_code name expr stack In_protocol + | Ok (Failed {descr}, _) -> + let kdescr = Script_ir_translator.close_descr (descr Bot_t) in + let kinstr = kdescr.kinstr in + let open Script_typed_ir_size.Internal_for_tests in + let workload = + let open Cache_memory_helpers in + {size = Nodes.to_int @@ fst @@ kinstr_size kinstr} + in + let closure () = ignore (kinstr_size kinstr) in + return (Generator.Plain {workload; closure}) + | Ok (Typed descr, _) -> + let kdescr = Script_ir_translator.close_descr descr in + let kinstr = kdescr.kinstr in + let open Script_typed_ir_size.Internal_for_tests in + let workload = + let open Cache_memory_helpers in + {size = Nodes.to_int @@ fst @@ kinstr_size kinstr} + in + let closure () = ignore (kinstr_size kinstr) in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; bef; aft = _} = + Michelson_generation.make_code_sampler rng_state cfg.generator_config + in + kinstr_size_benchmark rng_state term bef + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Code {term; bef; aft = _} -> + Some (fun () -> kinstr_size_benchmark rng_state term bef) + | _ -> None) + terms + | None -> + Format.eprintf "No michelson_terms_file given, generating on-the-fly@." ; + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Kinstr_size_benchmark) + +module Node_size_benchmark : Benchmark.S = struct + include Script_repr_benchmarks.Script_repr_shared_config + + let name = ns "NODE_SIZE" + + let info = + "Benchmarking the time it takes to compute Script_typed_ir_size.node_size" + + let size_based_model = + Model.make + ~conv:(function {micheline_nodes} -> (micheline_nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff: + (fv + (Format.asprintf + "%s_ns_per_node_coeff" + (Namespace.basename name)))) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen size_based_model) + + let models = [(model_name, size_based_model)] + + let micheline_nodes_benchmark node = + let open Cache_memory_helpers in + let nodes = Nodes.to_int @@ fst @@ node_size node in + let workload = {micheline_nodes = nodes} in + let closure () = ignore (Script_typed_ir_size.node_size node) in + Generator.Plain {workload; closure} + + let make_bench rng_state _cfg () = + let term = Script_repr_benchmarks.Sampler.sample rng_state in + micheline_nodes_benchmark term + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Node_size_benchmark) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml new file mode 100644 index 000000000000..3758ba4ee6d4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/skip_list_benchmarks.ml @@ -0,0 +1,188 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides benchmarks for skip list operations for basis = 2. *) + +open Protocol + +let ns = Namespace.make Registration_helpers.ns "skip_list" + +let fv s = Free_variable.of_namespace (ns s) + +(** Benchmark for the [Skip_list_repr.next] function. It is used for estimating + the parameters for [Skip_list_cost_model.model_next]. *) +module Next : Benchmark.S = struct + include Skip_list_repr.Make (struct + (** The benchmarks must be run again if [basis] is changed. *) + let basis = 2 + end) + + let name = ns "next" + + let info = "Benchmark for Skip_list_repr.next" + + let tags = ["skip_list"] + + type config = {max_items : int} + + let default_config = {max_items = 10000} + + let config_encoding = + let open Data_encoding in + conv (fun {max_items} -> max_items) (fun max_items -> {max_items}) int31 + + type workload = int + + let workload_encoding = Data_encoding.int31 + + let workload_to_vector len = + Sparse_vec.String.of_list [("len", float_of_int @@ len)] + + let next_model = + let conv x = (x, ()) in + Model.make ~conv ~model:(Model.logn ~coeff:(fv "len_coeff")) + + let models = [("skip_list_next", next_model)] + + let create_skip_list_of_len len = + let rec go n cell = + if n = 0 then cell + else go (pred n) @@ next ~prev_cell:cell ~prev_cell_ptr:() () + in + go len (genesis ()) + + let create_benchmarks ~rng_state ~bench_num ({max_items} : config) = + List.repeat bench_num @@ fun () -> + let workload = + Base_samplers.sample_in_interval + rng_state + ~range:{min = 0; max = max_items} + in + let prev_cell = create_skip_list_of_len workload in + let prev_cell_ptr = () in + let closure () = ignore (next ~prev_cell ~prev_cell_ptr ()) in + Generator.Plain {workload; closure} + + let () = + Registration.register_for_codegen + (Namespace.basename name) + (Model.For_codegen next_model) +end + +(** Benchmark for the [Sc_rollup_inbox_repr.hash_skip_list_cell] + function. It is used for estimating the parameters for + [Skip_list_cost_model.model_hash_cell]. The model estimates hashing + a skip_list cell content and all its back pointers. *) +module Hash_cell = struct + let name = ns "hash_cell" + + let info = "Estimating the costs of hashing a skip list cell" + + let tags = ["skip_list"] + + module Skip_list = Skip_list_repr.Make (struct + let basis = 2 + end) + + module Hash = Sc_rollup_inbox_repr.Hash + + let hash merkelized = + let payload_hash = Skip_list.content merkelized in + let back_pointers_hashes = Skip_list.back_pointers merkelized in + Hash.to_bytes payload_hash :: List.map Hash.to_bytes back_pointers_hashes + |> Hash.hash_bytes + + type config = {max_index : int} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_index} -> max_index) + (fun max_index -> {max_index}) + (obj1 (req "max_index" int31)) + + let default_config = {max_index = 65536} + + type workload = {nb_backpointers : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {nb_backpointers} -> nb_backpointers) + (fun nb_backpointers -> {nb_backpointers}) + (obj1 (req "max_nb_backpointers" int31)) + + let workload_to_vector {nb_backpointers} = + Sparse_vec.String.of_list + [("nb_backpointers", float_of_int nb_backpointers)] + + let hash_skip_list_cell_model = + Model.make + ~conv:(fun {nb_backpointers} -> (nb_backpointers, ())) + ~model: + (Model.affine + ~intercept:(Free_variable.of_string "cost_hash_skip_list_cell") + ~coeff:(Free_variable.of_string "cost_hash_skip_list_cell_coef")) + + let models = [("skip_list_hash", hash_skip_list_cell_model)] + + let benchmark rng_state conf () = + let skip_list_len = + Base_samplers.sample_in_interval + ~range:{min = 1; max = conf.max_index} + rng_state + in + let random_hash () = + Hash.hash_string + [Base_samplers.string ~size:{min = 32; max = 32} rng_state] + in + let cell = + let rec repeat n cell = + if n = 0 then cell + else + let prev_cell = cell and prev_cell_ptr = hash cell in + repeat + (n - 1) + (Skip_list.next ~prev_cell ~prev_cell_ptr (random_hash ())) + in + repeat skip_list_len (Skip_list.genesis (random_hash ())) + in + let nb_backpointers = List.length (Skip_list.back_pointers cell) in + let workload = {nb_backpointers} in + let closure () = ignore (hash cell) in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + + let () = + Registration.register_for_codegen + (Namespace.basename name) + (Model.For_codegen hash_skip_list_cell_model) +end + +let () = Registration_helpers.register (module Next) + +let () = Registration_helpers.register (module Hash_cell) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml new file mode 100644 index 000000000000..cffa19ba6874 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/storage_benchmarks.ml @@ -0,0 +1,244 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** {2 [Storage_functors] benchmarks}. + + This module registers a benchmark [List_key_values_benchmark]. Its result + is used to fill in the corresponding value, [list_key_values_step] + defined in [Storage_costs]. + *) + +open Tezos_benchmark +open Storage_functors +open Protocol + +let ns = Namespace.make Registration_helpers.ns "storage" + +let fv s = Free_variable.of_namespace (ns s) + +(** Creates a dummy raw-context value. *) +let default_raw_context () = + let open Lwt_result_syntax in + let initial_account = Account.new_account () in + let bootstrap_account = + Account.make_bootstrap_account + ~balance:(Alpha_context.Tez.of_mutez_exn 100_000_000_000L) + initial_account + in + Block.prepare_initial_context_params () >>=? fun (constants, _, _) -> + let parameters = + Default_parameters.parameters_of_constants + ~bootstrap_accounts:[bootstrap_account] + ~commitments:[] + constants + in + let json = Default_parameters.json_of_parameters parameters in + let proto_params = + Data_encoding.Binary.to_bytes_exn Data_encoding.json json + in + let protocol_param_key = ["protocol_parameters"] in + let*! context = + Tezos_protocol_environment.Context.( + let empty = Tezos_protocol_environment.Memory_context.empty in + let*! ctxt = add empty ["version"] (Bytes.of_string "genesis") in + add ctxt protocol_param_key proto_params) + in + let typecheck ctxt script_repr = return ((script_repr, None), ctxt) in + let*! e = + Init_storage.prepare_first_block + Tezos_crypto.Chain_id.zero + context + ~level:0l + ~timestamp:(Time.Protocol.of_seconds 1643125688L) + ~predecessor:Tezos_crypto.Block_hash.zero + ~typecheck + in + Lwt.return @@ Environment.wrap_tzresult e + +module String = struct + type t = string + + let encoding = Data_encoding.string +end + +module Int32 = struct + type t = int32 + + let encoding = Data_encoding.int32 + + module Index = struct + type t = int + + let path_length = 1 + + let to_path c l = string_of_int c :: l + + let of_path = function + | [] | _ :: _ :: _ -> None + | [c] -> int_of_string_opt c + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = Environment.RPC_arg.int; + encoding = Data_encoding.int31; + compare = Compare.Int.compare; + } + end +end + +module Root_raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["benchmark_storage_functors"] + end) + +module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Root_raw_context) + (struct + let name = ["index"] + end)) + (Int32.Index) + +module Table = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["table_for_list_key_values"] + end)) + (Int32.Index) + (struct + type t = string + + let encoding = Data_encoding.string + end) + +module List_key_values_benchmark_boilerplate = struct + type config = {max_size : int} + + let name = ns "List_key_values" + + let info = "List key values" + + let config_encoding = + let open Data_encoding in + conv + (fun {max_size} -> max_size) + (fun max_size -> {max_size}) + (obj1 (req "max_size" int31)) + + let default_config = {max_size = 100_000} + + type workload = {size : int} + + let tags = ["big_map"] + + let workload_encoding = + let open Data_encoding in + conv (fun {size} -> size) (fun size -> {size}) (obj1 (req "size" int31)) + + let workload_to_vector {size} = + Sparse_vec.String.of_list [("size", float_of_int size)] + + let models = + [ + ( "list_key_values", + Model.make + ~conv:(fun {size} -> (size, ())) + ~model: + (Model.affine_split_const + ~intercept1:Builtin_benchmarks.timer_variable + ~intercept2:(fv "list_key_values_intercept") + ~coeff:(fv "list_key_values_step")) ); + ] +end + +module List_key_values_benchmark = struct + include List_key_values_benchmark_boilerplate + + let benchmark rng_state {max_size} () = + let wrap m = m >|= Environment.wrap_tzresult in + let size = + Base_samplers.sample_in_interval + ~range:{min = 1; max = max_size} + rng_state + in + let ctxt = + let fill_table = + let open Lwt_result_syntax in + let* ctxt = default_raw_context () in + List.fold_left_es + (fun ctxt (key, value) -> + let* ctxt, _, _ = wrap @@ Table.add ctxt key value in + return ctxt) + ctxt + (Stdlib.List.init size (fun key -> (key, string_of_int key))) + in + match Lwt_main.run fill_table with Ok ctxt -> ctxt | _ -> assert false + in + let workload = {size} in + let closure () = + (* We pass length [0] so that none of the steps of the fold over the + key-value pairs load any values. That is isolate the cost of iterating + over the tree without loading values. *) + Table.list_key_values ~length:0 ctxt |> Lwt_main.run |> ignore + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) +end + +module List_key_values_benchmark_intercept = struct + include List_key_values_benchmark_boilerplate + + let name = Namespace.make ns (Namespace.basename name) "intercept" + + let benchmark _rng_state _config () = + let ctxt = + match Lwt_main.run (default_raw_context ()) with + | Ok ctxt -> ctxt + | _ -> assert false + in + let workload = {size = 0} in + let closure () = + (* We pass length [0] so that none of the steps of the fold over the + key-value pairs load any values. That is isolate the cost of iterating + over the tree without loading values. *) + Table.list_key_values ~length:0 ctxt |> Lwt_main.run |> ignore + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) +end + +let () = Registration_helpers.register (module List_key_values_benchmark) + +let () = + Registration_helpers.register (module List_key_values_benchmark_intercept) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/tags.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/tags.ml new file mode 100644 index 000000000000..2748e3551ccd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/tags.ml @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let interpreter = "interpreter" + +let translator = "translator" + +let encoding = "encoding" + +let cache = "cache" diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml new file mode 100644 index 000000000000..1e05cabccde1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/ticket_benchmarks.ml @@ -0,0 +1,328 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let ns = Namespace.make Registration_helpers.ns "tickets" + +let fv s = Free_variable.of_namespace (ns s) + +module Ticket_type_shared = struct + type config = {max_size : int} + + let default_config = {max_size = Constants_repr.michelson_maximum_type_size} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_size} -> max_size) + (fun max_size -> {max_size}) + (obj1 (req "max_size" int31)) + + type workload = {nodes : int} + + let workload_encoding = + let open Data_encoding in + conv + (function {nodes} -> nodes) + (fun nodes -> {nodes}) + (obj1 (req "nodes" int31)) + + let workload_to_vector {nodes} = + Sparse_vec.String.of_list [("nodes", float_of_int nodes)] + + let tags = ["tickets"] +end + +exception + Ticket_benchmark_error of { + benchmark_name : Namespace.t; + trace : Tezos_base.TzPervasives.tztrace; + } + +(** A benchmark for {!Ticket_costs.Constants.cost_compare_ticket_hash}. *) +module Compare_ticket_hash_benchmark : Benchmark.S = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = unit + + let tags = ["tickets"] + + let workload_encoding = Data_encoding.unit + + let workload_to_vector () = Sparse_vec.String.of_list [] + + let name = ns "COMPARE_TICKET_HASH" + + let info = "Compare cost for Ticket_hash" + + let compare_model = + Model.make + ~conv:(fun () -> ()) + ~model: + (Model.unknown_const2 + ~const1:Builtin_benchmarks.timer_variable + ~const2:(fv "compare_ticket_hash")) + + let models = [("compare_tickets", compare_model)] + + let benchmark rng_state _conf () = + let bytes = Base_samplers.bytes rng_state ~size:{min = 1; max = 64} in + let hash = + Ticket_hash.of_script_expr_hash @@ Script_expr_hash.hash_bytes [bytes] + in + let hash2 = + Ticket_hash.of_script_expr_hash @@ Script_expr_hash.hash_bytes [bytes] + in + let workload = () in + let closure () = ignore (Ticket_hash.compare hash hash2) in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen compare_model) +end + +let () = Registration_helpers.register (module Compare_ticket_hash_benchmark) + +(** A benchmark for {!Ticket_costs.Constants.cost_compare_key_contract}. + + In this benchmark we only compare originated contracts; we never use + implicit contracts. This is justified partly by the fact that + currently the carbonated maps only use originated contracts as keys. + In addition, while developing this benchmark the implicit contracts were + also tested and gave almost identical timings. *) +module Compare_key_contract_benchmark : Benchmark.S = struct + type config = unit + + let config_encoding = Data_encoding.unit + + let default_config = () + + type workload = unit + + let workload_encoding = Data_encoding.unit + + let workload_to_vector () = Sparse_vec.String.of_list [] + + let tags = ["tickets"] + + let name = ns "COMPARE_CONTRACT" + + let info = "Compare cost for Contracts" + + let compare_model = + Model.make + ~conv:(fun () -> ()) + ~model: + (Model.unknown_const2 + ~const1:Builtin_benchmarks.timer_variable + ~const2:(fv "compare_contract")) + + let models = [("compare_tickets", compare_model)] + + let benchmark rng_state _conf () = + let bytes = Base_samplers.bytes rng_state ~size:{min = 32; max = 64} in + let branch = Tezos_crypto.Block_hash.hash_bytes [bytes] in + let op_hash = Operation.hash_raw {shell = {branch}; proto = bytes} in + let nonce = Origination_nonce.Internal_for_tests.initial op_hash in + let contract = Contract.Internal_for_tests.originated_contract nonce in + let contract2 = Contract.Internal_for_tests.originated_contract nonce in + let workload = () in + let closure () = ignore (Contract.compare contract contract2) in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen compare_model) +end + +let () = Registration_helpers.register (module Compare_key_contract_benchmark) + +(* A simple ticket type for use in the benchmarks. *) +let ticket_ty = + let open Script_typed_ir in + WithExceptions.Result.get_ok ~loc:__LOC__ (ticket_t (-1) int_t) + +(* A dummy type generator, sampling linear terms of a given size. + The generator always returns types of the shape: + + [pair int_or_ticket (pair int_or_ticket (pair int_or_ticket ...))] + + This is a worst case type for [type_has_tickets], though nested + unions, nested maps or nested lists would be just as bad. *) +let rec dummy_type_generator ~rng_state size = + let open Script_typed_ir in + let ticket_or_int = + if Base_samplers.uniform_bool rng_state then Ex_ty ticket_ty + else Ex_ty int_t + in + if size <= 1 then ticket_or_int + else + match (ticket_or_int, dummy_type_generator ~rng_state (size - 3)) with + | Ex_ty l, Ex_ty r -> ( + match pair_t (-1) l r with + | Error _ -> assert false + | Ok (Ty_ex_c t) -> Ex_ty t) + +(** A benchmark for {!Ticket_costs.Constants.cost_has_tickets_of_ty}. *) +module Has_tickets_type_benchmark : Benchmark.S = struct + include Ticket_type_shared + + let name = ns "TYPE_HAS_TICKETS" + + let info = "Benchmarking type_has_tickets" + + let make_bench_helper rng_state config () = + let open Result_syntax in + let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in + let ctxt = Gas_helpers.set_limit ctxt in + let size = Random.State.int rng_state config.max_size in + let (Ex_ty ty) = dummy_type_generator ~rng_state size in + let nodes = + let size = Script_typed_ir.ty_size ty in + Saturation_repr.to_int @@ Script_typed_ir.Type_size.to_int size + in + let workload = {nodes} in + let closure () = ignore (Ticket_scanner.type_has_tickets ctxt ty) in + ok (Generator.Plain {workload; closure}) + + let make_bench rng_state config () = + match make_bench_helper rng_state config () with + | Ok closure -> closure + | Error trace -> + raise (Ticket_benchmark_error {benchmark_name = name; trace}) + + let size_model = + Model.make + ~conv:(function {nodes} -> (nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff:(fv (Format.asprintf "%s_coeff" (Namespace.basename name)))) + + let models = [("size_has_tickets_model", size_model)] + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen size_model) +end + +let () = Registration_helpers.register (module Has_tickets_type_benchmark) + +let ticket_sampler rng_state = + let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in + let pkh, _, _ = + Tezos_crypto.Signature.generate_key + ~algo:Tezos_crypto.Signature.Ed25519 + ~seed + () + in + let ticketer = Alpha_context.Contract.Implicit pkh in + Script_typed_ir. + {ticketer; contents = Script_int.zero; amount = Ticket_amount.one} + +(** A benchmark for {!Ticket_costs.Constants.cost_collect_tickets_step}. *) +module Collect_tickets_benchmark : Benchmark.S = struct + include Ticket_type_shared + + let name = ns "COLLECT_TICKETS_STEP" + + let info = "Benchmarking tickets_of_value" + + let make_bench_helper rng_state config () = + let open Script_typed_ir in + let open Result_syntax in + let* ctxt, _ = Lwt_main.run (Execution_context.make ~rng_state) in + let ctxt = Gas_helpers.set_limit ctxt in + let ty = + match list_t (-1) ticket_ty with Error _ -> assert false | Ok t -> t + in + let _, elements = + Structure_samplers.list + ~range:{min = 0; max = config.max_size} + ~sampler:ticket_sampler + rng_state + in + let boxed_ticket_list = Script_list.of_list elements in + Environment.wrap_tzresult + @@ let* has_tickets, ctxt = Ticket_scanner.type_has_tickets ctxt ty in + let workload = {nodes = Script_list.length boxed_ticket_list} in + let closure () = + ignore + (Lwt_main.run + (Ticket_scanner.tickets_of_value + ctxt + ~include_lazy:true + has_tickets + boxed_ticket_list)) + in + ok (Generator.Plain {workload; closure}) + + let make_bench rng_state config () = + match make_bench_helper rng_state config () with + | Ok closure -> closure + | Error trace -> + raise (Ticket_benchmark_error {benchmark_name = name; trace}) + + let size_model = + Model.make + ~conv:(function {nodes} -> (nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff:(fv (Format.asprintf "%s_coeff" (Namespace.basename name)))) + + let models = [("size_collect_tickets_step_model", size_model)] + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen size_model) +end + +let () = Registration_helpers.register (module Collect_tickets_benchmark) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml new file mode 100644 index 000000000000..5169c2229208 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_benchmarks.ml @@ -0,0 +1,808 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Size = Gas_input_size + +let ns = Translator_model.ns + +let fv = Translator_model.fv + +(** {2 [Script_ir_translator] benchmarks} *) + +module Config = struct + type config = { + generator_config : Michelson_generation.generator_config; + michelson_terms_file : string option; + } + + let default_config = + { + generator_config = Michelson_generation.default_generator_config; + michelson_terms_file = None; + } + + let config_encoding = + let open Data_encoding in + conv + (fun {generator_config; michelson_terms_file} -> + (generator_config, michelson_terms_file)) + (fun (generator_config, michelson_terms_file) -> + {generator_config; michelson_terms_file}) + (obj2 + (req "generator_config" Michelson_generation.generator_config_encoding) + (req "michelson_terms_file" (option string))) +end + +module Default_boilerplate = struct + type workload = Translator_workload.t + + let workload_encoding = Translator_workload.encoding + + let workload_to_vector = Translator_workload.workload_to_sparse_vec + + let tags = [Tags.translator] + + let make_models t_kind code_or_data = + [ + ( "gas_translator_model", + Translator_model.gas_based_model t_kind code_or_data ); + ( "size_translator_model", + Translator_model.size_based_model t_kind code_or_data ); + ] +end + +(* ----------------------------------------------------------------------- *) +(* Error handling *) + +type phase = Workload_production | In_protocol | Global + +type error_kind = + | Global_error of { + benchmark_name : Namespace.t; + workload : Tezos_base.TzPervasives.tztrace; + } + | Bad_data of { + benchmark_name : Namespace.t; + micheline : Alpha_context.Script.expr; + expected_type : Alpha_context.Script.expr; + phase : phase; + } + | Bad_code of { + benchmark_name : Namespace.t; + micheline : Alpha_context.Script.expr; + expected_stack_type : Alpha_context.Script.expr list; + phase : phase; + } + +let pp_phase fmtr (phase : phase) = + match phase with + | Workload_production -> Format.fprintf fmtr "workload production" + | In_protocol -> Format.fprintf fmtr "in protocol" + | Global -> Format.fprintf fmtr "global" + +let report_michelson_errors fmtr errs = + Michelson_v1_error_reporter.report_errors + ~details:true + ~show_source:true + fmtr + errs + +let make_printable node = + Micheline_printer.printable Michelson_v1_primitives.string_of_prim node + +let pp_error_kind fmtr (error_kind : error_kind) = + match error_kind with + | Global_error {benchmark_name; workload} -> + Format.open_vbox 1 ; + Format.fprintf fmtr "Global error:@," ; + Format.fprintf fmtr "benchmark = %a@," Namespace.pp benchmark_name ; + Format.fprintf fmtr "workload:@," ; + report_michelson_errors fmtr workload ; + Format.close_box () + | Bad_data {benchmark_name; micheline; expected_type; phase} -> + Format.open_vbox 1 ; + Format.fprintf fmtr "Bad data:@," ; + Format.fprintf fmtr "benchmark = %a@," Namespace.pp benchmark_name ; + Format.fprintf + fmtr + "expression = @[<v 1>%a@]@," + Micheline_printer.print_expr + (make_printable micheline) ; + Format.fprintf + fmtr + "expected type = @[<v 1>%a@]@," + Micheline_printer.print_expr + (make_printable expected_type) ; + Format.fprintf fmtr "phase = %a@," pp_phase phase ; + Format.close_box () + | Bad_code {benchmark_name; micheline; expected_stack_type; phase} -> + Format.open_vbox 1 ; + Format.fprintf fmtr "Bad code:@," ; + Format.fprintf fmtr "benchmark = %a@," Namespace.pp benchmark_name ; + Format.fprintf + fmtr + "expression = @[<v 1>%a@]@," + Micheline_printer.print_expr + (make_printable micheline) ; + Format.fprintf + fmtr + "expected stack = @[<v 1>%a@]@," + (Format.pp_print_list + ~pp_sep:(fun fmtr () -> Format.fprintf fmtr "::") + (fun fmtr node -> + let printable = make_printable node in + Format.fprintf fmtr "%a" Micheline_printer.print_expr printable)) + expected_stack_type ; + Format.fprintf fmtr "phase = %a@," pp_phase phase ; + Format.close_box () + +exception Translator_benchmark_error of error_kind + +let () = + Printexc.register_printer (function + | Translator_benchmark_error err -> + Some (Format.asprintf "%a" pp_error_kind err) + | _ -> None) + +let global_error benchmark_name workload = + raise (Translator_benchmark_error (Global_error {benchmark_name; workload})) + +let bad_data benchmark_name micheline expected_type phase = + raise + (Translator_benchmark_error + (Bad_data {benchmark_name; micheline; expected_type; phase})) + +let bad_code benchmark_name micheline expected_stack_type phase = + raise + (Translator_benchmark_error + (Bad_code {benchmark_name; micheline; expected_stack_type; phase})) + +(* ----------------------------------------------------------------------- *) +(* Typechecking data (Micheline data -> typed data) *) + +let strict = Script_ir_translator_config.make ~legacy:false () + +module Typechecking_data : Benchmark.S = struct + include Config + include Default_boilerplate + + let models = make_models Translator_workload.Parsing Translator_workload.Data + + let name = ns "TYPECHECKING_DATA" + + let info = "Benchmarking typechecking of data" + + let typechecking_data_benchmark rng_state (node : Protocol.Script_repr.expr) + (michelson_type : Script_repr.expr) = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_ty = Type_helpers.michelson_type_to_ex_ty michelson_type ctxt in + let workload = + match + Translator_workload.data_typechecker_workload + ctxt + Translator_workload.Parsing + (Micheline.root node) + ex_ty + with + | None -> bad_data name node michelson_type Workload_production + | Some workload -> workload + in + match ex_ty with + | Script_typed_ir.Ex_ty ty -> + let closure () = + match + Lwt_main.run + (Script_ir_translator.parse_data + ctxt + ~elab_conf:strict + ~allow_forged:false + ty + (Micheline.root node)) + with + | Error _ | (exception _) -> + bad_data name node michelson_type In_protocol + | Ok _ -> () + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; typ} = + Michelson_generation.make_data_sampler rng_state cfg.generator_config + in + typechecking_data_benchmark rng_state term typ + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Data {term; typ} -> + Some (fun () -> typechecking_data_benchmark rng_state term typ) + | _ -> None) + terms + | None -> + Format.eprintf "No michelson_terms_file given, generating on-the-fly@." ; + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Typechecking_data) + +module Unparsing_data : Benchmark.S = struct + include Config + include Default_boilerplate + + let models = + make_models Translator_workload.Unparsing Translator_workload.Data + + let name = ns "UNPARSING_DATA" + + let info = "Benchmarking unparsing of data" + + let unparsing_data_benchmark rng_state (node : Protocol.Script_repr.expr) + (michelson_type : Protocol.Script_repr.expr) = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_ty = Type_helpers.michelson_type_to_ex_ty michelson_type ctxt in + let workload = + match + Translator_workload.data_typechecker_workload + ctxt + Translator_workload.Unparsing + (Micheline.root node) + ex_ty + with + | None -> bad_data name node michelson_type Workload_production + | Some workload -> workload + in + match ex_ty with + | Script_typed_ir.Ex_ty ty -> + Script_ir_translator.parse_data + ctxt + ~elab_conf:strict + ~allow_forged:false + ty + (Micheline.root node) + >|= Environment.wrap_tzresult + >>=? fun (typed, ctxt) -> + let closure () = + match + Lwt_main.run + (Script_ir_translator.Internal_for_benchmarking.unparse_data + ~stack_depth:0 + ctxt + Script_ir_unparser.Optimized + ty + typed) + with + | Error _ | (exception _) -> + bad_data name node michelson_type In_protocol + | Ok _ -> () + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state cfg () = + let Michelson_mcmc_samplers.{term; typ} = + Michelson_generation.make_data_sampler rng_state cfg.generator_config + in + unparsing_data_benchmark rng_state term typ + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Data {term; typ} -> + Some (fun () -> unparsing_data_benchmark rng_state term typ) + | _ -> None) + terms + | None -> + Format.eprintf "No michelson_terms_file given, generating on-the-fly@." ; + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Unparsing_data) + +module Typechecking_code : Benchmark.S = struct + include Config + include Default_boilerplate + + let models = make_models Translator_workload.Parsing Translator_workload.Code + + let name = ns "TYPECHECKING_CODE" + + let info = "Benchmarking typechecking of code" + + let typechecking_code_benchmark rng_state (node : Protocol.Script_repr.expr) + (stack : Script_repr.expr list) = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_stack_ty = + Type_helpers.michelson_type_list_to_ex_stack_ty stack ctxt + in + let workload = + match + Translator_workload.code_typechecker_workload + ctxt + Translator_workload.Parsing + (Micheline.root node) + ex_stack_ty + with + | None -> bad_code name node stack Workload_production + | Some workload -> workload + in + let (Script_ir_translator.Ex_stack_ty bef) = ex_stack_ty in + let closure () = + let result = + Lwt_main.run + (Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf:strict + (Micheline.root node) + bef) + in + match Environment.wrap_tzresult result with + | Error errs -> + Format.eprintf "%a@." Error_monad.pp_print_trace errs ; + bad_code name node stack In_protocol + | Ok _ -> () + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state (cfg : Config.config) () = + let open Michelson_generation in + let Michelson_mcmc_samplers.{term; bef; aft = _} = + make_code_sampler rng_state cfg.generator_config + in + typechecking_code_benchmark rng_state term bef + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Code {term; bef; aft = _} -> + Some (fun () -> typechecking_code_benchmark rng_state term bef) + | _ -> None) + terms + | None -> + Format.eprintf "No michelson_terms_file given, generating on-the-fly@." ; + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Typechecking_code) + +module Unparsing_code : Benchmark.S = struct + include Config + include Default_boilerplate + + let models = + make_models Translator_workload.Unparsing Translator_workload.Code + + let name = ns "UNPARSING_CODE" + + let info = "Benchmarking unparsing of code" + + let unparsing_code_benchmark rng_state (node : Protocol.Script_repr.expr) + (stack : Script_repr.expr list) = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ex_stack_ty = + Type_helpers.michelson_type_list_to_ex_stack_ty stack ctxt + in + let workload = + match + Translator_workload.code_typechecker_workload + ctxt + Translator_workload.Unparsing + (Micheline.root node) + ex_stack_ty + with + | None -> bad_code name node stack Workload_production + | Some workload -> workload + in + let (Script_ir_translator.Ex_stack_ty bef) = ex_stack_ty in + (* We parse the code just to check it is well-typed. *) + Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf:strict + (Micheline.root node) + bef + >|= Environment.wrap_tzresult + >>=? fun (_typed, ctxt) -> + let closure () = + let result = + Lwt_main.run + (Script_ir_translator.Internal_for_benchmarking.unparse_code + ~stack_depth:0 + ctxt + Optimized + (Micheline.root node)) + in + match Environment.wrap_tzresult result with + | Error errs -> + Format.eprintf "%a@." Error_monad.pp_print_trace errs ; + bad_code name node stack In_protocol + | Ok _ -> () + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state (cfg : Config.config) () = + let open Michelson_generation in + let Michelson_mcmc_samplers.{term; bef; aft = _} = + make_code_sampler rng_state cfg.generator_config + in + unparsing_code_benchmark rng_state term bef + + let create_benchmarks ~rng_state ~bench_num config = + match config.michelson_terms_file with + | Some file -> + Format.eprintf "Loading terms from %s@." file ; + let terms = Michelson_mcmc_samplers.load ~filename:file in + List.filter_map + (function + | Michelson_mcmc_samplers.Code {term; bef; aft = _} -> + Some (fun () -> unparsing_code_benchmark rng_state term bef) + | _ -> None) + terms + | None -> List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Unparsing_code) + +let rec check_printable_ascii v i = + if Compare.Int.(i < 0) then true + else + match v.[i] with + | '\n' | '\x20' .. '\x7E' -> check_printable_ascii v (i - 1) + | _ -> false + +let check_printable_benchmark = + let open Tezos_shell_benchmarks.Encoding_benchmarks_helpers in + linear_shared + ~name:"CHECK_PRINTABLE" + ~generator:(fun rng_state -> + let open Base_samplers in + let string = + readable_ascii_string rng_state ~size:{min = 1; max = 1024} + in + (string, {Shared_linear.bytes = String.length string})) + ~make_bench:(fun generator () -> + let generated, workload = generator () in + let closure () = + ignore (check_printable_ascii generated (String.length generated - 1)) + in + Generator.Plain {workload; closure}) + () + +let () = Registration_helpers.register check_printable_benchmark + +module Ty_eq : Benchmark.S = struct + type config = {max_size : int} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_size} -> max_size) + (fun max_size -> {max_size}) + (obj1 (req "max_size" int31)) + + let default_config = {max_size = 64} + + type workload = Ty_eq_workload of {nodes : int; consumed : Size.t} + + let workload_encoding = + let open Data_encoding in + conv + (function Ty_eq_workload {nodes; consumed} -> (nodes, consumed)) + (fun (nodes, consumed) -> Ty_eq_workload {nodes; consumed}) + (obj2 (req "nodes" int31) (req "consumed" int31)) + + let workload_to_vector = function + | Ty_eq_workload {nodes; consumed} -> + Sparse_vec.String.of_list + [("nodes", float_of_int nodes); ("consumed", float_of_int consumed)] + + let name = ns "TY_EQ" + + let info = "Benchmarking equating types" + + let tags = [Tags.translator] + + let intercept_var = fv (Format.asprintf "%s_const" (Namespace.basename name)) + + let coeff_var = fv (Format.asprintf "%s_coeff" (Namespace.basename name)) + + let size_model = + Model.make + ~conv:(function Ty_eq_workload {nodes; _} -> (nodes, ())) + ~model: + (Model.affine_split_const + ~intercept1:Builtin_benchmarks.timer_variable + ~intercept2:intercept_var + ~coeff:coeff_var) + + let codegen_model = + Model.make + ~conv:(function Ty_eq_workload {nodes; _} -> (nodes, ())) + ~model:(Model.affine ~intercept:intercept_var ~coeff:coeff_var) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen codegen_model) + + let models = + [("size_translator_model", size_model); ("codegen", codegen_model)] + + let ty_eq_benchmark rng_state nodes (ty : Script_typed_ir.ex_ty) = + Lwt_main.run + ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> + let ctxt = Gas_helpers.set_limit ctxt in + match ty with + | Ex_ty ty -> + let dummy_loc = 0 in + Lwt.return + (Gas_monad.run ctxt + @@ Script_ir_translator.ty_eq + ~error_details:(Informative dummy_loc) + ty + ty) + >|= Environment.wrap_tzresult + >>=? fun (_, ctxt') -> + let consumed = + Alpha_context.Gas.consumed ~since:ctxt ~until:ctxt' + in + let workload = + Ty_eq_workload + {nodes; consumed = Z.to_int (Gas_helpers.fp_to_z consumed)} + in + let closure () = + ignore + (Gas_monad.run ctxt + @@ Script_ir_translator.ty_eq + ~error_details:(Informative dummy_loc) + ty + ty) + in + return (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let make_bench rng_state (cfg : config) () = + let nodes = + Base_samplers.( + sample_in_interval ~range:{min = 1; max = cfg.max_size} rng_state) + in + let ty = + Michelson_generation.Samplers.Random_type.m_type ~size:nodes rng_state + in + ty_eq_benchmark rng_state nodes ty + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Ty_eq) + +(* A dummy type generator, sampling linear terms of a given size. + The generator always returns types of the shape: + + [pair unit (pair unit (pair unit ...))] + + This structure is the worse-case of the unparsing function for types because + an extra test is performed to determine if the comb type needs to be folded. +*) +let rec dummy_type_generator size = + let open Script_typed_ir in + if size <= 1 then Ex_ty unit_t + else + match dummy_type_generator (size - 2) with + | Ex_ty r -> ( + let l = unit_t in + match pair_t (-1) l r with + | Error _ -> assert false + | Ok (Ty_ex_c t) -> Ex_ty t) + +(* A dummy comparable type generator, sampling linear terms of a given size. *) +let rec dummy_comparable_type_generator size = + let open Script_ir_translator in + let open Script_typed_ir in + if size <= 0 then Ex_comparable_ty unit_t + else + match dummy_comparable_type_generator (size - 2) with + | Ex_comparable_ty r -> + let l = unit_t in + Ex_comparable_ty + (match comparable_pair_t (-1) l r with + | Error _ -> assert false + | Ok t -> t) + +module Parse_type_shared = struct + type config = {max_size : int} + + let default_config = {max_size = Constants_repr.michelson_maximum_type_size} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_size} -> max_size) + (fun max_size -> {max_size}) + (obj1 (req "max_size" int31)) + + type workload = Type_workload of {nodes : int; consumed : Size.t} + + let workload_encoding = + let open Data_encoding in + conv + (function Type_workload {nodes; consumed} -> (nodes, consumed)) + (fun (nodes, consumed) -> Type_workload {nodes; consumed}) + (obj2 (req "nodes" int31) (req "consumed" int31)) + + let workload_to_vector = function + | Type_workload {nodes; consumed} -> + Sparse_vec.String.of_list + [("nodes", float_of_int nodes); ("consumed", float_of_int consumed)] + + let tags = [Tags.translator] +end + +let parse_ty ctxt node = + Script_ir_translator.parse_ty + ctxt + ~legacy:true + ~allow_lazy_storage:true + ~allow_operation:true + ~allow_contract:true + ~allow_ticket:true + node + +let unparse_ty ctxt ty = Script_ir_unparser.unparse_ty ~loc:(-1) ctxt ty + +module Parse_type_benchmark : Benchmark.S = struct + include Parse_type_shared + + let name = ns "PARSE_TYPE" + + let info = "Benchmarking parse_ty" + + let make_bench rng_state config () = + ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> + let ctxt = Gas_helpers.set_limit ctxt in + let size = Random.State.int rng_state config.max_size in + let ty = dummy_type_generator size in + match ty with + | Ex_ty ty -> + Environment.wrap_tzresult @@ unparse_ty ctxt ty + >>? fun (unparsed, _) -> + Environment.wrap_tzresult @@ parse_ty ctxt unparsed + >>? fun (_, ctxt') -> + let consumed = + Z.to_int + (Gas_helpers.fp_to_z + (Alpha_context.Gas.consumed ~since:ctxt ~until:ctxt')) + in + let nodes = + let x = Script_typed_ir.ty_size ty in + Saturation_repr.to_int @@ Script_typed_ir.Type_size.to_int x + in + let workload = Type_workload {nodes; consumed} in + let closure () = ignore (parse_ty ctxt unparsed) in + ok (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let size_model = + Model.make + ~conv:(function Type_workload {nodes; consumed = _} -> (nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff:(fv (Format.asprintf "%s_coeff" (Namespace.basename name)))) + + let models = [("size_translator_model", size_model)] + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) +end + +let () = Registration_helpers.register (module Parse_type_benchmark) + +module Unparse_type_benchmark : Benchmark.S = struct + include Parse_type_shared + + let name = ns "UNPARSE_TYPE" + + let info = "Benchmarking unparse_ty" + + let make_bench rng_state config () = + ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> + let ctxt = Gas_helpers.set_limit ctxt in + let size = Random.State.int rng_state config.max_size in + let ty = dummy_type_generator size in + match ty with + | Ex_ty ty -> + Environment.wrap_tzresult @@ unparse_ty ctxt ty >>? fun (_, ctxt') -> + let consumed = + Z.to_int + (Gas_helpers.fp_to_z + (Alpha_context.Gas.consumed ~since:ctxt ~until:ctxt')) + in + let nodes = + let x = Script_typed_ir.ty_size ty in + Saturation_repr.to_int @@ Script_typed_ir.Type_size.to_int x + in + let workload = Type_workload {nodes; consumed} in + let closure () = ignore (unparse_ty ctxt ty) in + ok (Generator.Plain {workload; closure}) ) + |> function + | Ok closure -> closure + | Error errs -> global_error name errs + + let size_model = + Model.make + ~conv:(function Type_workload {nodes; consumed = _} -> (nodes, ())) + ~model: + (Model.affine + ~intercept: + (fv (Format.asprintf "%s_const" (Namespace.basename name))) + ~coeff:(fv (Format.asprintf "%s_coeff" (Namespace.basename name)))) + + let models = [("size_translator_model", size_model)] + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (make_bench rng_state config) + + let () = + Registration_helpers.register_for_codegen + (Namespace.basename name) + (Model.For_codegen size_model) +end + +let () = Registration_helpers.register (module Unparse_type_benchmark) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_model.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_model.ml new file mode 100644 index 000000000000..f7b2dd565311 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_model.ml @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Namespace.make Registration_helpers.ns "translator" + +let fv s = Free_variable.of_namespace (ns s) + +let gas_full t_kind code_or_data = + let name = + Format.asprintf + "%a_%a" + Translator_workload.pp_kind + t_kind + Translator_workload.pp_code_or_data + code_or_data + in + let intercept = fv (Format.asprintf "%s_const" name) in + let coeff = fv (Format.asprintf "%s_coeff" name) in + Model.affine ~intercept ~coeff + +let size_full t_kind code_or_data = + let name = + Format.asprintf + "%a_%a" + Translator_workload.pp_kind + t_kind + Translator_workload.pp_code_or_data + code_or_data + in + let coeff1 = fv (Format.asprintf "%s_traversal" name) in + let coeff2 = fv (Format.asprintf "%s_int_bytes" name) in + let coeff3 = fv (Format.asprintf "%s_string_bytes" name) in + Model.trilinear ~coeff1 ~coeff2 ~coeff3 + +let gas_based_model t_kind code_or_data = + Model.make + ~conv:(function + | Translator_workload.Typechecker_workload {consumed; _} -> (consumed, ())) + ~model:(gas_full t_kind code_or_data) + +let size_based_model t_kind code_or_data = + Model.make + ~conv:(function + | Translator_workload.Typechecker_workload {micheline_size; _} -> ( + match micheline_size with + | {traversal; int_bytes; string_bytes} -> + (traversal, (int_bytes, (string_bytes, ()))))) + ~model:(size_full t_kind code_or_data) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_workload.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_workload.ml new file mode 100644 index 000000000000..52207e626506 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/translator_workload.ml @@ -0,0 +1,188 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Size = Protocol.Gas_input_size + +type kind = Parsing | Unparsing + +type code_or_data = Code | Data + +type t = + | Typechecker_workload of { + t_kind : kind; + code_or_data : code_or_data; + micheline_size : Size.micheline_size; + consumed : Size.t; + } + +let kind_encoding : kind Data_encoding.t = + let open Data_encoding in + def "kind_encoding" + @@ string_enum [("parsing", Parsing); ("unparsing", Unparsing)] + +let code_or_data_encoding : code_or_data Data_encoding.t = + let open Data_encoding in + def "code_or_data_encoding" @@ string_enum [("code", Code); ("data", Data)] + +let encoding : t Data_encoding.t = + let open Data_encoding in + def "translator_trace_encoding" + @@ conv + (function + | Typechecker_workload {t_kind; code_or_data; micheline_size; consumed} + -> + (t_kind, code_or_data, micheline_size, consumed)) + (fun (t_kind, code_or_data, micheline_size, consumed) -> + Typechecker_workload {t_kind; code_or_data; micheline_size; consumed}) + (tup4 + kind_encoding + code_or_data_encoding + Size.micheline_size_encoding + Size.encoding) + +let pp_kind fmtr (kind : kind) = + match kind with + | Parsing -> Format.pp_print_string fmtr "Parsing" + | Unparsing -> Format.pp_print_string fmtr "Unparsing" + +let pp_code_or_data fmtr (x : code_or_data) = + match x with + | Code -> Format.pp_print_string fmtr "Code" + | Data -> Format.pp_print_string fmtr "Data" + +let pp fmtr (trace : t) = + match trace with + | Typechecker_workload {t_kind; code_or_data; micheline_size; consumed} -> + Format.fprintf + fmtr + "typechecker_trace { %a; %a; %a; %a }" + pp_kind + t_kind + pp_code_or_data + code_or_data + Size.pp_micheline_size + micheline_size + Size.pp + consumed + +let workload_to_sparse_vec (trace : t) = + let name, {Size.traversal; int_bytes; string_bytes}, consumed = + match trace with + | Typechecker_workload {t_kind; code_or_data; micheline_size; consumed} -> + let name = + Format.asprintf "%a_%a" pp_kind t_kind pp_code_or_data code_or_data + in + (name, micheline_size, consumed) + in + let n s = name ^ "_" ^ s in + let vars = + [ + (n "traversal", float_of_int (Size.to_int traversal)); + (n "int_bytes", float_of_int (Size.to_int int_bytes)); + (n "string_bytes", float_of_int (Size.to_int string_bytes)); + (n "gas", float_of_int (Size.to_int consumed)); + ] + in + Sparse_vec.String.of_list vars + +let data_typechecker_workload ctxt t_kind micheline_node ex_ty = + let open Protocol in + match ex_ty with + | Script_typed_ir.Ex_ty ty -> + let ctxt = Gas_helpers.set_limit ctxt in + Lwt_main.run + ( Script_ir_translator.parse_data + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:false ()) + ~allow_forged:false + ty + micheline_node + |> Lwt.map Environment.wrap_tzresult + >>= fun res -> + match res with + | Ok (_res, ctxt_after) -> + let micheline_size = Size.of_micheline micheline_node in + let consumed = + Alpha_context.Gas.consumed ~since:ctxt ~until:ctxt_after + in + let trace = + Typechecker_workload + { + t_kind; + code_or_data = Data; + micheline_size; + consumed = + Size.of_int (Z.to_int (Gas_helpers.fp_to_z consumed)); + } + in + Lwt.return (Some trace) + | Error errors -> + Michelson_v1_error_reporter.report_errors + ~details:true + ~show_source:true + Format.err_formatter + errors ; + Format.eprintf "@." ; + Lwt.return None ) + +let code_typechecker_workload (ctxt : Protocol.Alpha_context.context) + (t_kind : kind) (code : Protocol.Alpha_context.Script.node) + (bef : Protocol.Script_ir_translator.ex_stack_ty) = + let open Protocol in + let ctxt = Gas_helpers.set_limit ctxt in + let (Script_ir_translator.Ex_stack_ty stack_ty) = bef in + Lwt_main.run + ( Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:false ()) + code + stack_ty + |> Lwt.map Environment.wrap_tzresult + >>= fun res -> + match res with + | Ok (_res, ctxt_after) -> + let micheline_size = Size.of_micheline code in + let consumed = + Alpha_context.Gas.consumed ~since:ctxt ~until:ctxt_after + in + let trace = + Typechecker_workload + { + t_kind; + code_or_data = Code; + micheline_size; + consumed = Size.of_int (Z.to_int (Gas_helpers.fp_to_z consumed)); + } + in + Lwt.return (Some trace) + | Error errs -> + Michelson_v1_error_reporter.report_errors + ~details:true + ~show_source:true + Format.err_formatter + errs ; + Format.eprintf "@." ; + Lwt.return None ) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml new file mode 100644 index 000000000000..093ace757eff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -0,0 +1,642 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ns = Namespace.make Registration_helpers.ns "tx_rollup" + +let fv s = Free_variable.of_namespace (ns s) + +module Inbox_add_message : Benchmark.S = struct + open Tx_rollup_inbox_repr + + let name = ns "Inbox_add_message" + + let info = "Benchmark for Merkle.add_message" + + let tags = ["tx_rollup"; "merkle"; "inbox"; "add_message"] + + type config = {max_messages : int} + + let default_config = + { + (* Quite conservative, as in practive we will see no more + [tx_rollup_max_messages_per_inbox] messages, and that is + currently set to [1010]. *) + max_messages = 10000; + } + + let config_encoding = + let open Data_encoding in + conv + (fun {max_messages} -> max_messages) + (fun max_messages -> {max_messages}) + int31 + + (* The workload is a pair [(messages, message)]: we measure the time + necessary to [add_message (merkleize messages) message]. + + Note: we have no encoding for [Merkle.tree], and so we store the + unmerkleize message list instead. Below, after generating the + workload, we merkleize the list _before_ running benchmarking + [add_message]. + *) + type workload = + Tx_rollup_message_hash_repr.t list * Tx_rollup_message_hash_repr.t + + let workload_encoding = + let open Data_encoding in + tup2 + (list Tx_rollup_message_hash_repr.encoding) + Tx_rollup_message_hash_repr.encoding + + let workload_to_vector (messages, _) = + (* the size of each message already in the inbox and the size of + the new message is constant (a hash) and therefore we consider + only the length of the inbox in number of messages as a + parameter to the cost model. *) + Sparse_vec.String.of_list + [("n_messages", float_of_int @@ List.length messages)] + + let models = + let conv (messages, _) = (List.length messages, ()) in + [ + ( "tx_rollup", + Model.make ~conv ~model:(Model.logn ~coeff:(fv "n_message_coeff")) ); + ] + + let create_benchmarks ~rng_state ~bench_num ({max_messages} : config) = + List.repeat bench_num @@ fun () -> + let n_messages = + Base_samplers.sample_in_interval + ~range:{min = 1; max = max_messages} + rng_state + in + let message_hash rng_state : Tx_rollup_message_hash_repr.t = + let size = Tx_rollup_message_hash_repr.size in + let bytes = + Base_samplers.bytes ~size:{min = size; max = size} rng_state + in + Tx_rollup_message_hash_repr.of_bytes_exn bytes + in + + let messages = List.repeat n_messages (message_hash rng_state) in + let message = message_hash rng_state in + let workload = (messages, message) in + let tree = List.fold_left Merkle.add_message Merkle.empty messages in + let closure () = ignore (Merkle.add_message tree message : Merkle.tree) in + Generator.Plain {workload; closure} +end + +module Commitment_full_compact_bench : Benchmark.S = struct + open Tx_rollup_commitment_repr + + let name = ns "Commitment_full_compact_bench" + + let info = "Benchmark for Tx_rollup_commitment_repr.Full.compact" + + let tags = ["tx_rollup"; "merkle"; "commitment"; "compact"] + + type config = {max_messages : int} + + let default_config = {max_messages = 10000} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_messages} -> max_messages) + (fun max_messages -> {max_messages}) + int31 + + type workload = Tx_rollup_commitment_repr.Full.t + + let workload_encoding = Tx_rollup_commitment_repr.Full.encoding + + let workload_to_vector {messages; _} = + Sparse_vec.String.of_list + [("n_messages", float_of_int @@ List.length messages)] + + let models = + let conv {messages; _} = (List.length messages, ()) in + [ + ( "tx_rollup", + Model.make + ~conv + ~model: + (Model.affine + ~intercept:(fv "full_compact_bench_intercept") + ~coeff:(fv "n_messages_coeff")) ); + ] + + let create_benchmarks ~rng_state ~bench_num ({max_messages} : config) = + List.repeat bench_num @@ fun () -> + let n_messages = + Base_samplers.sample_in_interval + ~range:{min = 1; max = max_messages} + rng_state + in + let message_result_hash rng_state : Tx_rollup_message_result_hash_repr.t = + let size = Tx_rollup_message_result_hash_repr.size in + let bytes = + Base_samplers.bytes ~size:{min = size; max = size} rng_state + in + Tx_rollup_message_result_hash_repr.of_bytes_exn bytes + in + let workload = + let level = Tx_rollup_level_repr.root in + let predecessor = None in + let inbox_merkle_root = + Tx_rollup_inbox_repr.Merkle.root Tx_rollup_inbox_repr.Merkle.empty + in + (* AFAICT, the values above have no influence on the execution time of [compact] *) + let messages = List.repeat n_messages (message_result_hash rng_state) in + {level; messages; predecessor; inbox_merkle_root} + in + let closure () = + ignore + (Tx_rollup_commitment_repr.Full.compact workload + : Tx_rollup_commitment_repr.Compact.t) + in + Generator.Plain {workload; closure} +end + +module Irmin_context = Tezos_context_memory.Context_binary + +exception Error of Environment.Error_monad.error + +module Prover_storage : + Tx_rollup_l2_storage_sig.STORAGE + with type t = Irmin_context.tree + and type 'a m = 'a Lwt.t = struct + type t = Irmin_context.tree + + type 'a m = 'a Lwt.t + + module Syntax = struct + include Lwt.Syntax + + let return = Lwt.return + + let fail e = Lwt.fail (Error e) + + let catch (m : 'a m) k h = + Lwt.catch + (fun () -> m >>= k) + (function Error e -> h e | e -> Lwt.fail e) + + let list_fold_left_m = Lwt_list.fold_left_s + end + + let path k = [Bytes.to_string k] + + let get store key = Irmin_context.Tree.find store (path key) + + let set store key value = Irmin_context.Tree.add store (path key) value + + let remove store key = Irmin_context.Tree.remove store (path key) +end + +module Prover_context = Tx_rollup_l2_context.Make (Prover_storage) +module Prover_apply = Tx_rollup_l2_apply.Make (Prover_context) + +type address = { + sk : Bls12_381_signature.sk; + pk : Bls12_381_signature.MinPk.pk; + addr : Tx_rollup_l2_address.t; + index : Tx_rollup_l2_context_sig.address_index; + mutable counter : int; +} + +type ticket = { + hash : Alpha_context.Ticket_hash.t; + index : Tx_rollup_l2_context_sig.ticket_index; +} + +type couple = {addr1 : address; addr2 : address; common_tickets : ticket list} + +let address sk pk addr i = + {sk; pk; addr; index = Indexable.index_exn i; counter = 1} + +let ticket hash i = {hash; index = Indexable.index_exn i} + +let couple a b l = {addr1 = a; addr2 = b; common_tickets = l} + +let unique_ticket_id = + let x = ref 0 in + fun () -> + let ticket = Printf.sprintf "ticket%d" !x in + let () = incr x in + ticket + +let gen_l2_account rng_state = + let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in + Tezos_crypto.Bls.generate_key ~seed () + +let hash_key_exn ctxt ~ticketer ~typ ~contents ~owner = + let ticketer = Micheline.root @@ Expr.from_string ticketer in + let ty = Micheline.root @@ Expr.from_string typ in + let contents = Micheline.root @@ Expr.from_string contents in + let owner = Micheline.root @@ Expr.from_string owner in + match Alpha_context.Ticket_hash.make ctxt ~ticketer ~ty ~contents ~owner with + | Ok x -> x + | Error _ -> raise (Invalid_argument "hash_key_exn") + +let make_key ctxt content = + hash_key_exn + ctxt + ~ticketer:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~typ:"string" + ~contents:(Printf.sprintf {|"%s"|} content) + (* In practice, the owner is a rollup address, but this is important only + for the table of tickets *) + ~owner:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + +let make_ticket str = + match + Lwt_main.run + ( Context.init1 () >>=? fun (blk, _) -> + Incremental.begin_construction blk >>=? fun incr -> + let ctxt = Incremental.alpha_ctxt incr in + let ticket, _ctxt = make_key ctxt str in + return ticket ) + with + | Ok x -> x + | Error _ -> raise (Invalid_argument "make_ticket") + +let gen_ticket () = + let ticket = unique_ticket_id () in + make_ticket ticket + +(** [input ~rng_state nb_of_couple_addr nb_of_ticket_per_couple] creates + [nb_of_couple_addr] of {!couple} where each couple owns + [nb_of_ticket_per_couple] of {!ticket} in common. It can later on be used + to create transfers between addresses in the same couple of a ticket they + both own (that helps to create larger proofs). *) +let input ~rng_state nb_of_couple_addr nb_of_ticket_per_couple = + (* Prevent an infinite loop, but 0 is semantically stupid as well. *) + assert (nb_of_couple_addr >= 0) ; + assert (nb_of_ticket_per_couple >= 0) ; + let idx_addr = ref 0 in + let idx_ticket = ref 0 in + let rec fold_ticket acc = function + | 0 -> acc + | n -> + let tidx = Int32.of_int !idx_ticket in + let () = incr idx_ticket in + let ticket = ticket (gen_ticket ()) tidx in + fold_ticket (ticket :: acc) (n - 1) + in + let rec fold_couple acc = function + | 0 -> acc + | n -> + (* Generate random identities *) + let addr1, pk1, sk1 = gen_l2_account rng_state in + let addr2, pk2, sk2 = gen_l2_account rng_state in + (* Pick indexes *) + let aidx = Int32.of_int !idx_addr in + let () = incr idx_addr in + let bidx = Int32.of_int !idx_addr in + let () = incr idx_addr in + (* Build addresses *) + let a = address sk1 pk1 addr1 aidx in + let b = address sk2 pk2 addr2 bidx in + (* Generate common tickets *) + let tickets = List.rev @@ fold_ticket [] nb_of_ticket_per_couple in + (* Build the couple *) + fold_couple (couple a b tickets :: acc) (n - 1) + in + fold_couple [] nb_of_couple_addr |> List.rev + +(** [init_ctxt input] initializes a real [Irmin_context.t] context with + the abstract data generated in {!input}. *) +let init_ctxt input = + let open Prover_context in + let open Syntax in + let* index = Irmin_context.init "/tmp" in + let empty_store = Irmin_context.empty index in + let empty_tree = Irmin_context.Tree.empty empty_store in + let qty = Tx_rollup_l2_qty.of_int64_exn 1_000_000L in + let* tree = + list_fold_left_m + (fun tree couple -> + let* tree, _, idx1 = + Address_index.get_or_associate_index tree couple.addr1.addr + in + let* tree = + Address_metadata.init_with_public_key tree idx1 couple.addr1.pk + in + let* tree, _, idx2 = + Address_index.get_or_associate_index tree couple.addr2.addr + in + let* tree = + Address_metadata.init_with_public_key tree idx2 couple.addr2.pk + in + let* tree = + list_fold_left_m + (fun tree ticket -> + let* tree, _, tidx = + Ticket_index.get_or_associate_index tree ticket.hash + in + let* tree = Ticket_ledger.credit tree tidx idx1 qty in + let* tree = Ticket_ledger.credit tree tidx idx2 qty in + return tree) + tree + couple.common_tickets + in + return tree) + empty_tree + input + in + let* store = Irmin_context.add_tree empty_store [] tree in + let* _ = Irmin_context.commit ~time:Time.Protocol.epoch store in + return store + +(** [create_operation ~rng_state input senders] creates an operation based + on [input]. + The generated transfer is random in the sense that: + * A couple is randomly taken to be the source of the transfer. + * The values are randomly replaced by their indexes. + * The destination is randomly taken between: + * The source couple. + * Another address in the context. + * A new generated address. + * The transfered quantity is randomly generated and can be greater than + the source balance to make the transfer fail. +*) +let create_operation ~rng_state input senders = + let either a b = if Base_samplers.uniform_bool rng_state then a else b in + let index_or_value idx value = + let idx = Indexable.forget idx in + let value = Indexable.from_value value in + either idx value + in + let couple, source = + (* The source must be unique in the transfer. The l2 operation forbids + operation to have multiple transfers from the same source. *) + let rec pick_until_new () = + let couple = + Stdlib.List.nth + input + (Base_samplers.sample_in_interval + ~range:{min = 0; max = List.length input - 1} + rng_state) + in + let source = couple.addr1 in + if + List.mem + ~equal:(fun x y -> Tx_rollup_l2_address.( = ) x.addr y.addr) + source + senders + then pick_until_new () + else (couple, source) + in + pick_until_new () + in + let signer = + index_or_value + Indexable.(to_int32 source.index |> index_exn) + (Tx_rollup_l2_batch.Bls_pk source.pk) + in + let destination = + let x = + Base_samplers.sample_in_interval ~range:{min = 0; max = 99} rng_state + in + if x >= 0 && x < 40 then + (* couple.B, he has the ticket *) + index_or_value couple.addr2.index couple.addr2.addr + else if x >= 40 && x < 80 then + (* other couple, he does not have the ticket *) + let i = + Base_samplers.sample_in_interval + ~range:{min = 0; max = List.length input - 1} + rng_state + in + let couple = Stdlib.List.nth input i in + index_or_value couple.addr2.index couple.addr2.addr + else + (* create new address *) + let addr, _pk, _sk = gen_l2_account rng_state in + Indexable.from_value addr + in + let qty = + let x = + Base_samplers.sample_in_interval ~range:{min = 0; max = 99} rng_state + in + (* Low probably to take more than the balance and make the operation fail. *) + if x <= 2 then Tx_rollup_l2_qty.of_int64_exn 1_000_001L + else Tx_rollup_l2_qty.one + in + let {hash = ticket_hash; index = ticket_index} = + let n = List.length couple.common_tickets in + let x = + Base_samplers.sample_in_interval ~range:{min = 0; max = n - 1} rng_state + in + Stdlib.List.nth couple.common_tickets x + in + let counter = source.counter in + let () = source.counter <- counter + 1 in + let ticket_hash = index_or_value ticket_index ticket_hash in + ( Tx_rollup_l2_batch.V1. + { + signer; + counter = 1L; + contents = [Transfer {destination; ticket_hash; qty}]; + }, + source.sk, + source :: senders ) + +let create_transaction ~rng_state input nb_op = + (* Prevent an infinite loop, but 0 is semantically stupid as well. *) + assert (nb_op >= 0) ; + let rec aux acc senders = function + | 0 -> acc + | n -> + let op, signer, senders = create_operation ~rng_state input senders in + let acc = (op, signer) :: acc in + aux acc senders (n - 1) + in + let acc = [] in + let senders = [] in + aux acc senders nb_op + +let make_msg ~rng_state input nb_op = + let transaction, signers = + create_transaction ~rng_state input nb_op |> List.split + in + let buf = + (Data_encoding.Binary.to_bytes_exn + Data_encoding.Compact.( + make ~tag_size:`Uint8 Tx_rollup_l2_batch.V1.compact_transaction)) + transaction + in + let signatures = + List.map (fun sk -> Bls12_381_signature.MinPk.Aug.sign sk buf) signers + in + let aggregated_signature = + match Bls12_381_signature.MinPk.aggregate_signature_opt signatures with + | Some res -> res + | None -> assert false + in + let batch = + Tx_rollup_l2_batch.V1.{contents = [transaction]; aggregated_signature} + in + let batch_string = + Data_encoding.Binary.to_string_exn + Tx_rollup_l2_batch.encoding + Tx_rollup_l2_batch.(V1 batch) + in + Alpha_context.Tx_rollup_message.make_batch batch_string |> fst + +let get_tree_from_store store = + let open Prover_context.Syntax in + let* tree_opt = Irmin_context.find_tree store [] in + match tree_opt with Some x -> return x | None -> assert false + +let hash_tree_from_store store = + let open Prover_context.Syntax in + let+ tree = get_tree_from_store store in + Irmin_context.Tree.hash tree + +let create_proof store max_withdrawals msg = + let open Prover_context.Syntax in + let index = Irmin_context.index store in + let* hash = hash_tree_from_store store in + let* proof, _ = + Irmin_context.produce_stream_proof index (`Node hash) (fun tree -> + Prover_apply.( + catch + (apply_message + tree + Tx_rollup_l2_apply. + {tx_rollup_max_withdrawals_per_batch = max_withdrawals} + msg) + (fun (tree, _) -> return (tree, ())) + (fun _error -> + (* With the context and message generation we should not reach + this case. *) + assert false))) + in + return proof + +module Verify_proof_compute_bench : Benchmark.S = struct + let name = ns "Tx_rollup_verify_proof" + + let info = "Benchmark for Tx_rollup.verify_proof" + + let tags = ["tx_rollup"; "merkle"; "verify"; "proof"] + + type config = {max_withdrawals : int} + + let default_config = {max_withdrawals = 255} + + let config_encoding = + let open Data_encoding in + conv + (fun {max_withdrawals} -> max_withdrawals) + (fun max_withdrawals -> {max_withdrawals}) + (obj1 (req "max_withdrawals" int31)) + + type workload = {proof_size : int; message_size : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {proof_size; message_size} -> (proof_size, message_size)) + (fun (proof_size, message_size) -> {proof_size; message_size}) + (obj2 (req "proof_size" int31) (req "message_size" int31)) + + let workload_to_vector {proof_size; message_size} = + Sparse_vec.String.of_list + [ + ("proof_size", float_of_int proof_size); + ("message_size", float_of_int message_size); + ] + + let models = + let conv {proof_size; message_size} = (proof_size, (message_size, ())) in + [ + ( "tx_rollup", + Model.make + ~conv + ~model: + (Model.bilinear + ~coeff1:(fv "proof_size_coeff") + ~coeff2:(fv "message_size_coeff")) ); + ] + + let proof_size proof = + Data_encoding.Binary.length Tx_rollup_l2_proof.encoding proof + + let message_size message = + Data_encoding.Binary.length Alpha_context.Tx_rollup_message.encoding message + + let bench_verify_proof rng_state {max_withdrawals} () = + let n_couple_addr = + Base_samplers.sample_in_interval rng_state ~range:{min = 100; max = 1_000} + in + let n_ticket_per_couple = + Base_samplers.sample_in_interval rng_state ~range:{min = 1; max = 6} + in + let n_ops = + Base_samplers.sample_in_interval rng_state ~range:{min = 5; max = 30} + in + let input = input ~rng_state n_couple_addr n_ticket_per_couple in + let message = make_msg ~rng_state input n_ops in + let proof = + Lwt_main.run + @@ + let open Lwt_syntax in + let* store = init_ctxt input in + create_proof store max_withdrawals message + in + let closure () = + Lwt_main.run + @@ + let open Prover_context.Syntax in + (* Account the time it takes to calculate the length of the proof and + message done during the proof verification. *) + let (_ : int) = proof_size proof in + let (_ : int) = message_size message in + (* Account the time it takes to verify the proof *) + let _ = + Tx_rollup_l2_verifier.Internal_for_tests.verify_l2_proof + proof + Tx_rollup_l2_apply. + {tx_rollup_max_withdrawals_per_batch = max_withdrawals} + message + in + return () + in + let proof_size = proof_size proof in + let message_size = message_size message in + Generator.Plain {workload = {proof_size; message_size}; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (bench_verify_proof rng_state config) +end + +let () = Registration_helpers.register (module Inbox_add_message) + +let () = Registration_helpers.register (module Commitment_full_compact_bench) + +let () = Registration_helpers.register (module Verify_proof_compute_bench) diff --git a/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.ml b/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.ml new file mode 100644 index 000000000000..7aa1a7fc7080 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.ml @@ -0,0 +1,123 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2018-2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type _ t = + | Manager_info : { + source : Alpha_context.public_key_hash option; + fee : Tez.t Limit.t; + gas_limit : Gas.Arith.integral Limit.t; + storage_limit : Z.t Limit.t; + counter : Manager_counter.t option; + operation : 'kind manager_operation; + } + -> 'kind t + +type packed = Annotated_manager_operation : 'kind t -> packed + +type _ annotated_list = + | Single_manager : 'kind t -> 'kind annotated_list + | Cons_manager : + 'kind t * 'rest annotated_list + -> ('kind * 'rest) annotated_list + +type packed_annotated_list = + | Manager_list : 'kind annotated_list -> packed_annotated_list + +let rec manager_to_list = function + | Manager_list (Single_manager o) -> [Annotated_manager_operation o] + | Manager_list (Cons_manager (o, os)) -> + Annotated_manager_operation o :: manager_to_list (Manager_list os) + +let rec manager_of_list = function + | [] -> assert false + | [Annotated_manager_operation o] -> Manager_list (Single_manager o) + | Annotated_manager_operation o :: os -> + let (Manager_list os) = manager_of_list os in + Manager_list (Cons_manager (o, os)) + +let join_fee fee operation = + let (Manager_info c) = operation in + Limit.join ~where:__LOC__ Tez.equal fee c.fee >|? fun fee -> + Manager_info {c with fee} + +let set_fee fee (Manager_info c) = Manager_info {c with fee} + +let join_gas_limit gas_limit operation = + let (Manager_info c) = operation in + Limit.join ~where:__LOC__ Gas.Arith.equal gas_limit c.gas_limit + >|? fun gas_limit -> Manager_info {c with gas_limit} + +let set_gas_limit gas_limit (Manager_info c) = Manager_info {c with gas_limit} + +let join_storage_limit storage_limit (Manager_info c) = + Limit.join ~where:__LOC__ Z.equal storage_limit c.storage_limit + >|? fun storage_limit -> Manager_info {c with storage_limit} + +let set_storage_limit storage_limit (Manager_info c) = + Manager_info {c with storage_limit} + +let set_counter counter (Manager_info c) = + match c.counter with + | Some _ -> error_with "set_counter_annot: already set" + | None -> ok (Manager_info {c with counter = Some counter}) + +let set_source source (Manager_info c) = + match c.source with + | Some _ -> error_with "set_source_annot: already set" + | None -> ok (Manager_info {c with source = Some source}) + +let manager_from_annotated operation = + let (Manager_info {source; fee; gas_limit; storage_limit; counter; operation}) + = + operation + in + Limit.get ~when_unknown:"unknown fee" fee >>? fun fee -> + Limit.get ~when_unknown:"unknown gas limit" gas_limit >>? fun gas_limit -> + Limit.get ~when_unknown:"unknown storage limit" storage_limit + >>? fun storage_limit -> + Option.fold + ~some:ok + ~none:(error_with "manager_from_annotated: source not set") + source + >>? fun source -> + Option.fold + ~some:ok + ~none:(error_with "manager_from_annotated: counter not set") + counter + >|? fun counter -> + Manager_operation {source; fee; counter; gas_limit; storage_limit; operation} + +let rec manager_list_from_annotated : + type kind. kind annotated_list -> kind Kind.manager contents_list tzresult = + function + | Single_manager operation -> + manager_from_annotated operation >|? fun op -> Single op + | Cons_manager (operation, rest) -> + manager_list_from_annotated rest >>? fun rest -> + manager_from_annotated operation >|? fun op -> Cons (op, rest) diff --git a/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.mli b/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.mli new file mode 100644 index 000000000000..0fc7a472f842 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/annotated_manager_operation.mli @@ -0,0 +1,98 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2018 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Annotated manager operations are wrappers used to accumulate information + (especially about limits) on the operation prior to the injection. *) + +open Protocol +open Alpha_context + +type _ t = + | Manager_info : { + source : Alpha_context.public_key_hash option; + fee : Tez.t Limit.t; + gas_limit : Gas.Arith.integral Limit.t; + storage_limit : Z.t Limit.t; + counter : Manager_counter.t option; + operation : 'kind manager_operation; + } + -> 'kind t + +type packed = Annotated_manager_operation : 'kind t -> packed + +(** The [annotated_list] type helps making + [contents_list] from a list of [manager_operation]s. + Its construction mimics [contents_list] in order to keep + consistent types when calling [inject_manager_operation] + and [inject_operation].*) +type _ annotated_list = + | Single_manager : 'kind t -> 'kind annotated_list + | Cons_manager : + 'kind t * 'rest annotated_list + -> ('kind * 'rest) annotated_list + +type packed_annotated_list = + | Manager_list : 'kind annotated_list -> packed_annotated_list + +(** Convert a list of annotated operations to a list of packed annotated + operations *) +val manager_to_list : packed_annotated_list -> packed list + +(** Converse of [manager_to_list] *) +val manager_of_list : packed list -> packed_annotated_list + +(** [join_fee fee op] updates [op.fee] to [Limit.join op.fee fee] and + fails if the join fails *) +val join_fee : Tez.t Limit.t -> 'a t -> 'a t tzresult + +(** [set_fee fee op] updates [op.fee] to [fee] *) +val set_fee : Tez.t Limit.t -> 'a t -> 'a t + +(** See [join_fee] *) +val join_gas_limit : Gas.Arith.integral Limit.t -> 'a t -> 'a t tzresult + +(** See [set_fee] *) +val set_gas_limit : Gas.Arith.integral Limit.t -> 'a t -> 'a t + +(** See [join_fee] *) +val join_storage_limit : Z.t Limit.t -> 'a t -> 'a t tzresult + +(** See [set_fee] *) +val set_storage_limit : Z.t Limit.t -> 'a t -> 'a t + +(** Set the counter of the annotated operation. Fail if the counter + is already set. *) +val set_counter : Manager_counter.t -> 'a t -> 'a t tzresult + +(** Set the source of the operation. Fail if the source is already set. *) +val set_source : public_key_hash -> 'a t -> 'a t tzresult + +(** Convert an annotated manager operation to a proper manager operation. + Fail if some fields in the annotated operation are not set. *) +val manager_from_annotated : 'a t -> 'a Kind.manager contents tzresult + +val manager_list_from_annotated : + 'kind annotated_list -> 'kind Kind.manager contents_list tzresult diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_args.ml b/src/proto_016_PtMumbai/lib_client/client_proto_args.ml new file mode 100644 index 000000000000..18b1e1850401 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_args.ml @@ -0,0 +1,1152 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context + +type error += Bad_tez_arg of string * string (* Arg_name * value *) + +type error += Bad_max_priority of string + +type error += Bad_minimal_fees of string + +type error += Bad_max_waiting_time of string + +type error += Bad_endorsement_delay of string + +type error += Bad_preserved_levels of string + +type error += Forbidden_Negative_int of string + +let () = + register_error_kind + `Permanent + ~id:"badTezArg" + ~title:"Bad Tez Arg" + ~description:"Invalid \xEA\x9C\xA9 notation in parameter." + ~pp:(fun ppf (arg_name, literal) -> + Format.fprintf + ppf + "Invalid \xEA\x9C\xA9 notation in parameter %s: '%s'" + arg_name + literal) + Data_encoding.(obj2 (req "parameter" string) (req "literal" string)) + (function + | Bad_tez_arg (parameter, literal) -> Some (parameter, literal) + | _ -> None) + (fun (parameter, literal) -> Bad_tez_arg (parameter, literal)) ; + register_error_kind + `Permanent + ~id:"badMaxPriorityArg" + ~title:"Bad -max-priority arg" + ~description:"invalid priority in -max-priority" + ~pp:(fun ppf literal -> + Format.fprintf ppf "invalid priority '%s' in -max-priority" literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_max_priority parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_max_priority parameter) ; + register_error_kind + `Permanent + ~id:"badMinimalFeesArg" + ~title:"Bad -minimal-fees arg" + ~description:"invalid fee threshold in -fee-threshold" + ~pp:(fun ppf literal -> + Format.fprintf ppf "invalid minimal fees '%s'" literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_minimal_fees parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_minimal_fees parameter) ; + register_error_kind + `Permanent + ~id:"badMaxWaitingTimeArg" + ~title:"Bad -max-waiting-time arg" + ~description:"invalid duration in -max-waiting-time" + ~pp:(fun ppf literal -> + Format.fprintf + ppf + "Bad argument value for -max-waiting-time. Expected an integer, but \ + given '%s'" + literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_max_waiting_time parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_max_waiting_time parameter) ; + register_error_kind + `Permanent + ~id:"badEndorsementDelayArg" + ~title:"Bad -endorsement-delay arg" + ~description:"invalid duration in -endorsement-delay" + ~pp:(fun ppf literal -> + Format.fprintf + ppf + "Bad argument value for -endorsement-delay. Expected an integer, but \ + given '%s'" + literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_endorsement_delay parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_endorsement_delay parameter) ; + register_error_kind + `Permanent + ~id:"badPreservedLevelsArg" + ~title:"Bad -preserved-levels arg" + ~description:"invalid number of levels in -preserved-levels" + ~pp:(fun ppf literal -> + Format.fprintf + ppf + "Bad argument value for -preserved_levels. Expected a positive \ + integer, but given '%s'" + literal) + Data_encoding.(obj1 (req "parameter" string)) + (function Bad_preserved_levels parameter -> Some parameter | _ -> None) + (fun parameter -> Bad_preserved_levels parameter) ; + register_error_kind + `Permanent + ~id:"ForbiddenNegativeInt" + ~title:"Forbidden negative int" + ~description:"invalid number, must a non negative natural " + Data_encoding.(obj1 (req "invalid_natural" string)) + ~pp:(fun ppf literal -> + Format.fprintf + ppf + "Bad argument value for natural. Expected a non negative integer, but \ + given '%s'" + literal) + (function Forbidden_Negative_int str -> Some str | _ -> None) + (fun str -> Forbidden_Negative_int str) + +let string_parameter = Tezos_clic.parameter (fun _ x -> return x) + +let int_parameter = + Tezos_clic.parameter (fun _ p -> + try return (int_of_string p) with _ -> failwith "Cannot read int") + +let uri_parameter = Tezos_clic.parameter (fun _ x -> return (Uri.of_string x)) + +let bytes_of_prefixed_string s = + match + if String.length s < 2 || s.[0] <> '0' || s.[1] <> 'x' then None + else Hex.to_bytes (`Hex (String.sub s 2 (String.length s - 2))) + with + | Some s -> return s + | None -> + failwith "Invalid bytes, expecting hexadecimal notation (e.g. 0x1234abcd)" + +let bytes_parameter = + Tezos_clic.parameter (fun _ s -> bytes_of_prefixed_string s) + +let parse_file ~from_text ~read_file ~path = + let open Lwt_result_syntax in + let* content = read_file path in + from_text content + +let file_or_text ~from_text ~read_file = + Client_aliases.parse_alternatives + [ + ("file", fun path -> parse_file ~from_text ~read_file ~path); + ("text", from_text); + ] + +let file_or_text_parameter ~from_text () = + Tezos_clic.parameter (fun (cctxt : #Client_context.full) -> + file_or_text ~from_text ~read_file:cctxt#read_file) + +let json_parameter = + let from_text s = + match Data_encoding.Json.from_string s with + | Ok json -> return json + | Error err -> failwith "'%s' is not a valid JSON-encoded value: %s" s err + in + file_or_text_parameter ~from_text () + +let data_parameter = + let open Lwt_syntax in + let from_text input = + return @@ Tezos_micheline.Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression input + in + file_or_text_parameter ~from_text () + +let entrypoint_parameter = + Tezos_clic.parameter (fun _ str -> + Lwt.return @@ Environment.wrap_tzresult @@ Entrypoint.of_string_lax str) + +let init_arg = + Tezos_clic.default_arg + ~long:"init" + ~placeholder:"data" + ~doc:"initial value of the contract's storage" + ~default:"Unit" + string_parameter + +let global_constant_param ~name ~desc next = + Tezos_clic.param ~name ~desc string_parameter next + +let arg_arg = + Tezos_clic.arg + ~long:"arg" + ~placeholder:"data" + ~doc:"argument passed to the contract's script, if needed" + string_parameter + +let default_arg_arg = + Tezos_clic.arg + ~long:"default-arg" + ~placeholder:"data" + ~doc:"default argument passed to each contract's script, if needed" + string_parameter + +let delegate_arg = + Client_keys.Public_key_hash.source_arg + ~long:"delegate" + ~placeholder:"address" + ~doc:"delegate of the contract\nMust be a known address." + () + +let source_arg = + Tezos_clic.arg + ~long:"source" + ~placeholder:"address" + ~doc:"source of the deposits to be paid\nMust be a known address." + string_parameter + +let entrypoint_arg = + Tezos_clic.arg + ~long:"entrypoint" + ~placeholder:"name" + ~doc:"entrypoint of the smart contract" + entrypoint_parameter + +let default_entrypoint_arg = + Tezos_clic.arg + ~long:"default-entrypoint" + ~placeholder:"name" + ~doc:"default entrypoint of the smart contracts" + entrypoint_parameter + +let force_switch = + Tezos_clic.switch + ~long:"force" + ~short:'f' + ~doc: + "disables the node's injection checks\n\ + Force the injection of branch-invalid operation or force the injection \ + of block without a fitness greater than the current head." + () + +let no_endorse_switch = + Tezos_clic.switch + ~long:"no-endorse" + ~doc:"Do not let the client automatically endorse a block that it baked." + () + +let minimal_timestamp_switch = + Tezos_clic.switch + ~long:"minimal-timestamp" + ~doc: + "Use the minimal timestamp instead of the current date as timestamp of \ + the baked block." + () + +let tez_format = + "Text format: `DDDDDDD.DDDDDD`.\n\ + Tez and mutez and separated by a period sign. Trailing and pending zeroes \ + are allowed." + +let tez_parameter param = + Tezos_clic.parameter (fun _ s -> + match Tez.of_string s with + | Some tez -> return tez + | None -> fail (Bad_tez_arg (param, s))) + +let tez_arg ~default ~parameter ~doc = + Tezos_clic.default_arg + ~long:parameter + ~placeholder:"amount" + ~doc + ~default + (tez_parameter ("--" ^ parameter)) + +let tez_opt_arg ~parameter ~doc = + Tezos_clic.arg + ~long:parameter + ~placeholder:"amount" + ~doc + (tez_parameter ("--" ^ parameter)) + +let tez_param ~name ~desc next = + Tezos_clic.param + ~name + ~desc:(desc ^ " in \xEA\x9C\xA9\n" ^ tez_format) + (tez_parameter name) + next + +let non_negative_z_parameter = + Tezos_clic.parameter (fun _ s -> + try + let v = Z.of_string s in + error_when Compare.Z.(v < Z.zero) (Forbidden_Negative_int s) + >>?= fun () -> return v + with _ -> failwith "Invalid number, must be a non negative number.") + +let non_negative_z_param ~name ~desc next = + Tezos_clic.param ~name ~desc non_negative_z_parameter next + +let counter_parameter = + Tezos_clic.parameter (fun _ s -> + match Manager_counter.Internal_for_injection.of_string s with + | None -> failwith "Invalid counter, must be a non-negative number." + | Some c -> return c) + +let non_negative_parameter = + Tezos_clic.parameter (fun _ s -> + match int_of_string_opt s with + | Some i when i >= 0 -> return i + | _ -> failwith "Parameter should be a non-negative integer literal") + +let fee_arg = + Tezos_clic.arg + ~long:"fee" + ~placeholder:"amount" + ~doc:"fee in \xEA\x9C\xA9 to pay to the baker" + (tez_parameter "--fee") + +let default_fee_arg = + Tezos_clic.arg + ~long:"default-fee" + ~placeholder:"amount" + ~doc:"default fee in \xEA\x9C\xA9 to pay to the baker for each transaction" + (tez_parameter "--default-fee") + +let level_kind = + Tezos_clic.parameter (fun _ s -> + match Option.bind (Script_int.of_string s) Script_int.is_nat with + | Some n -> return n + | None -> failwith "invalid level (must be a positive number)") + +let level_arg = + Tezos_clic.arg + ~long:"level" + ~placeholder:"level" + ~doc:"Set the level to be returned by the LEVEL instruction" + level_kind + +let raw_level_parameter = + Tezos_clic.parameter (fun _ s -> + match Int32.of_string_opt s with + | Some i when i >= 0l -> + Lwt.return @@ Environment.wrap_tzresult (Raw_level.of_int32 i) + | _ -> + failwith + "'%s' is not a valid level (should be a non-negative int32 value)" + s) + +let timestamp_parameter = + Tezos_clic.parameter (fun _ s -> + match Script_timestamp.of_string s with + | Some time -> return time + | None -> + failwith + "invalid timestamp, must be either a RFC 3339 string or a number \ + of seconds since epoch.") + +let now_arg = + Tezos_clic.arg + ~long:"now" + ~placeholder:"timestamp" + ~doc: + "Set the timestamp to be returned by the NOW instruction. Allowed format \ + are RFC 3339 (YYYY-MM-DDTHH:MM:SSZ) or number of seconds since epoch." + timestamp_parameter + +let gas_limit_kind = + Tezos_clic.parameter (fun _ s -> + try + let v = Z.of_string s in + return (Gas.Arith.integral_exn v) + with _ -> failwith "invalid gas limit (must be a positive number)") + +let gas_limit_arg = + Tezos_clic.arg + ~long:"gas-limit" + ~short:'G' + ~placeholder:"amount" + ~doc: + "Set the gas limit of the transaction instead of letting the client \ + decide based on a simulation" + gas_limit_kind + +let default_gas_limit_arg = + Tezos_clic.arg + ~long:"default-gas-limit" + ~short:'G' + ~placeholder:"amount" + ~doc: + "Set the default gas limit for each transaction instead of letting the \ + client decide based on a simulation" + gas_limit_kind + +let run_gas_limit_arg = + Tezos_clic.arg + ~long:"gas" + ~short:'G' + ~doc:"Initial quantity of gas for typechecking and execution" + ~placeholder:"gas" + gas_limit_kind + +let unlimited_gas_arg = + Tezos_clic.switch + ~long:"unlimited-gas" + ~doc:"Allows interpretation with virtually unlimited gas" + () + +let storage_limit_kind = + Tezos_clic.parameter (fun _ s -> + try + let v = Z.of_string s in + assert (Compare.Z.(v >= Z.zero)) ; + return v + with _ -> + failwith "invalid storage limit (must be a positive number of bytes)") + +let storage_limit_arg = + Tezos_clic.arg + ~long:"storage-limit" + ~short:'S' + ~placeholder:"amount" + ~doc: + "Set the storage limit of the transaction instead of letting the client \ + decide based on a simulation" + storage_limit_kind + +let default_storage_limit_arg = + Tezos_clic.arg + ~long:"default-storage-limit" + ~short:'S' + ~placeholder:"amount" + ~doc: + "Set the default storage limit for each transaction instead of letting \ + the client decide based on a simulation" + storage_limit_kind + +let counter_arg = + Tezos_clic.arg + ~long:"counter" + ~short:'C' + ~placeholder:"counter" + ~doc:"Set the counter to be used by the transaction" + counter_parameter + +let max_priority_arg = + Tezos_clic.arg + ~long:"max-priority" + ~placeholder:"slot" + ~doc:"maximum allowed baking slot" + (Tezos_clic.parameter (fun _ s -> + try return (int_of_string s) with _ -> fail (Bad_max_priority s))) + +let default_minimal_fees = + match Tez.of_mutez 100L with None -> assert false | Some t -> t + +let default_minimal_nanotez_per_gas_unit = Q.of_int 100 + +let default_minimal_nanotez_per_byte = Q.of_int 1000 + +let minimal_fees_arg = + Tezos_clic.default_arg + ~long:"minimal-fees" + ~placeholder:"amount" + ~doc:"exclude operations with fees lower than this threshold (in tez)" + ~default:(Tez.to_string default_minimal_fees) + (Tezos_clic.parameter (fun _ s -> + match Tez.of_string s with + | Some t -> return t + | None -> fail (Bad_minimal_fees s))) + +let minimal_nanotez_per_gas_unit_arg = + Tezos_clic.default_arg + ~long:"minimal-nanotez-per-gas-unit" + ~placeholder:"amount" + ~doc: + "exclude operations with fees per gas lower than this threshold (in \ + nanotez)" + ~default:(Q.to_string default_minimal_nanotez_per_gas_unit) + (Tezos_clic.parameter (fun _ s -> + try return (Q.of_string s) with _ -> fail (Bad_minimal_fees s))) + +let minimal_nanotez_per_byte_arg = + Tezos_clic.default_arg + ~long:"minimal-nanotez-per-byte" + ~placeholder:"amount" + ~default:(Q.to_string default_minimal_nanotez_per_byte) + ~doc: + "exclude operations with fees per byte lower than this threshold (in \ + nanotez)" + (Tezos_clic.parameter (fun _ s -> + try return (Q.of_string s) with _ -> fail (Bad_minimal_fees s))) + +let replace_by_fees_arg = + Tezos_clic.switch + ~long:"replace" + ~doc: + "Replace an existing pending transaction from the same source, if any, \ + with another one with higher fees. There are no guarantees that the \ + first operation will not be included or that the second one will be. \ + But, only one of the operations at most will end in a block (in \ + precheck mode)." + () + +let successor_level_arg = + Tezos_clic.switch + ~long:"simulate-successor-level" + ~doc:"Make the simulate on the successor level of the current head." + () + +let preserved_levels_arg = + Tezos_clic.default_arg + ~long:"preserved-levels" + ~placeholder:"threshold" + ~doc:"Number of effective levels kept in the accuser's memory" + ~default:"200" + (Tezos_clic.parameter (fun _ s -> + try + let preserved_cycles = int_of_string s in + if preserved_cycles < 0 then fail (Bad_preserved_levels s) + else return preserved_cycles + with _ -> fail (Bad_preserved_levels s))) + +let no_print_source_flag = + Tezos_clic.switch + ~long:"no-print-source" + ~short:'q' + ~doc: + "don't print the source code\n\ + If an error is encountered, the client will print the contract's source \ + code by default.\n\ + This option disables this behaviour." + () + +let no_confirmation = + Tezos_clic.switch + ~long:"no-confirmation" + ~doc:"don't print wait for the operation to be confirmed." + () + +let signature_parameter = + Tezos_clic.parameter (fun _cctxt s -> + match Tezos_crypto.Signature.of_b58check_opt s with + | Some s -> return s + | None -> failwith "Not given a valid signature") + +let unparsing_mode_parameter = + Tezos_clic.parameter + ~autocomplete:(fun _cctxt -> + return ["Readable"; "Optimized"; "Optimized_legacy"]) + (fun _cctxt s -> + match s with + | "Readable" -> return Script_ir_unparser.Readable + | "Optimized" -> return Script_ir_unparser.Optimized + | "Optimized_legacy" -> return Script_ir_unparser.Optimized_legacy + | _ -> failwith "Unknown unparsing mode %s" s) + +let unparsing_mode_arg ~default = + Tezos_clic.default_arg + ~long:"unparsing-mode" + ~placeholder:"mode" + ~doc: + "Unparsing mode to use\n\ + One of \"Readable\", \"Optimized\", or \"Optimized_legacy\".\n\ + This option affects the way the values of the following Michelson types \ + are represented:\n\ + - timestamp: the Readable representation is a RFC3339 string, the \ + Optimized and Optimized_legacy representations are the number of \ + seconds since Epoch\n\ + - key, signature, key_hash, address, contract, chain_id: the Readable \ + representation is a Base58Check string, the Optimized and \ + Optimized_legacy representations are byte sequences\n\ + - nested pairs: in Readable mode, the Pair constructor is used even \ + with arity bigger than 2 such as in Pair 0 1 2; in Optimized_legacy \ + mode, the Pair constructor is always use with arity 2 such as in Pair 0 \ + (Pair 1 2); in Optimized mode, a sequence is used if there are at least \ + 4 elements and the behavior is the same as in Optimized_legacy mode \ + otherwise.\n" + ~default + unparsing_mode_parameter + +let enforce_indentation_flag = + Tezos_clic.switch + ~long:"enforce-indentation" + ~doc: + "Check that the Micheline expression passed to this command is \ + well-indented." + () + +let display_names_flag = + Tezos_clic.switch + ~long:"display-names" + ~doc:"Print names of scripts passed to this command" + () + +module Daemon = struct + let baking_switch = + Tezos_clic.switch ~long:"baking" ~short:'B' ~doc:"run the baking daemon" () + + let endorsement_switch = + Tezos_clic.switch + ~long:"endorsement" + ~short:'E' + ~doc:"run the endorsement daemon" + () + + let denunciation_switch = + Tezos_clic.switch + ~long:"denunciation" + ~short:'D' + ~doc:"run the denunciation daemon" + () +end + +module Tx_rollup = struct + let tx_rollup_address_parameter = + Tezos_clic.parameter (fun _ s -> + match Tx_rollup.of_b58check_opt s with + | Some c -> return c + | None -> + failwith + "Parameter '%s' is an invalid transaction rollup address encoded \ + in a base58 string." + s) + + let tx_rollup_address_param ?(name = "transaction rollup address") ~usage next + = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Transaction rollup address encoded in a base58 \ + string.@]@]" + usage) + tx_rollup_address_parameter + next + + let level_parameter = + Tezos_clic.parameter (fun _ s -> + match Int32.of_string_opt s with + | Some i when i >= 0l -> + Lwt.return @@ Environment.wrap_tzresult (Tx_rollup_level.of_int32 i) + | _ -> + failwith + "'%s' is not a valid transaction rollup level (should be a non \ + negative int32 value)" + s) + + let level_param ?(name = "tx rollup level") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Transaction rollup level encoded in a non negative \ + int32.@]@]" + usage) + level_parameter + next + + let context_hash_parameter = + Tezos_clic.parameter (fun _ s -> + match Tezos_crypto.Context_hash.of_b58check_opt s with + | Some hash -> return hash + | None -> + failwith + "%s is not a valid notation for a context hash encoded in a \ + base58 string" + s) + + let context_hash_param ?(name = "context hash") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Context hash encoded in a base58 string.@]@]" + usage) + context_hash_parameter + next + + let message_result_path_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try + Data_encoding.Json.destruct + Tx_rollup_commitment.Merkle.path_encoding + json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid JSON for a message result path: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + + let message_result_path_param ?(name = "message result path") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Merkle path (JSON encoded) for a message result hash \ + in a commitment.\n\ + The JSON should be a list of base58-encoded message result \ + hashes.@]@]" + usage) + message_result_path_parameter + next + + let tickets_dispatch_info_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try Data_encoding.Json.destruct Tx_rollup_reveal.encoding json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid JSON for tickets dispatch info: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + + let tickets_dispatch_info_param ?(name = "tickets information") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Tickets related information are encoded in a JSON with \ + the following format: {\"contents\": <tickets content>,\"ty\": \ + <tickets type>, \"ticketer\": <ticketer contract address>, \ + \"amount\": <withdrawn amount>, \"\"claimer\": <new owner's public \ + key hash>}@]@]" + usage) + tickets_dispatch_info_parameter + next + + let message_result_hash_parameter = + Tezos_clic.parameter (fun _ s -> + match Tx_rollup_message_result_hash.of_b58check_opt s with + | Some hash -> return hash + | None -> + failwith "%s is not a valid notation for a withdraw list hash" s) + + let message_result_hash_param ?(name = "message result hash") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Message result hash encoded in a base58 string.@]@]" + usage) + message_result_hash_parameter + next + + let withdraw_list_hash_parameter = + Tezos_clic.parameter (fun _ s -> + match Tx_rollup_withdraw_list_hash.of_b58check_opt s with + | Some hash -> return hash + | None -> + failwith "%s is not a valid notation for a withdraw list hash" s) + + let withdraw_list_hash_param ?(name = "withdraw list hash") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Withdraw list hash encoded in a base58 string.@]@]" + usage) + withdraw_list_hash_parameter + next + + let commitment_hash_parameter = + Tezos_clic.parameter (fun _ s -> + match Tx_rollup_commitment_hash.of_b58check_opt s with + | Some hash -> return hash + | None -> failwith "%s is not a valid notation for a commitment hash" s) + + let commitment_hash_param ?(name = "commitment hash") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Commitment hash encoded in a base58 string.@]@]" + usage) + commitment_hash_parameter + next + + let commitment_hash_arg ?(long = "commitment-hash") + ?(placeholder = "commitment hash") ~usage () = + Tezos_clic.arg + ~long + ~doc: + (Format.sprintf + "@[@[%s@]@.@[Commitment hash encoded in a base58 string.@]@]" + usage) + ~placeholder + commitment_hash_parameter + + let message_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try Data_encoding.Json.destruct Tx_rollup_message.encoding json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid json for a message: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + + let message_param ?(name = "message") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Message are encoded in a JSON with one of the \ + following format: {\"batch\": bytes} or {\"deposit\": {\"sender\": \ + <depositer public key hash>; \"destination\": <layer 2 destination \ + (address or index)>;\"ticket_hash\": <hash of the tickets> \ + ;\"amount\": <deposited amount> }}.@]@]" + usage) + message_parameter + next + + let message_path_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try + Data_encoding.Json.destruct Tx_rollup_inbox.Merkle.path_encoding json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid json for a message path: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + + let message_path_param ?(name = "message path") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[\n\ + Merkle path (JSON encoded) for a message in an inbox. The JSON \ + should be a list of base58-encoded message hashes.@]@]" + usage) + message_path_parameter + next + + let proof_parameter = + Tezos_clic.map_parameter + ~f:(fun json -> + try Data_encoding.Json.destruct Tx_rollup_l2_proof.encoding json + with Data_encoding.Json.Cannot_destruct (_path, exn) -> + Stdlib.failwith + (Format.asprintf + "Invalid json for a tx_rollup proof: %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn)) + json_parameter + + let proof_param ?(name = "rejection proof") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Rejection proof are stream encoded in a JSON. See \ + documentation of transaction rollup for more information.@]@]" + usage) + proof_parameter + next + + let inbox_root_hash_parameter = + Tezos_clic.parameter (fun _ s -> + match Tx_rollup_inbox.Merkle.root_of_b58check_opt s with + | Some hash -> return hash + | None -> + failwith + "%s is not a valid B58-encoded notation for an inbox merkle root" + s) + + let inbox_root_hash_param ?(name = "inbox root hash") ~usage next = + Tezos_clic.param + ~name + ~desc: + (Format.sprintf + "@[@[%s@]@.@[Root's hash of a merkelized inbox list, encoded in a \ + base58 string.@]@]" + usage) + inbox_root_hash_parameter + next +end + +module Sc_rollup_params = struct + let sc_rollup_address_parameter = + Tezos_clic.parameter (fun _ s -> + match Alpha_context.Sc_rollup.Address.of_b58check_opt s with + | Some c -> return c + | None -> + failwith + "Parameter '%s' is an invalid smart contract rollup address \ + encoded in a base58 string." + s) + + let rollup_kind_parameter = + Tezos_clic.parameter (fun _ name -> + match Sc_rollup.Kind.of_string name with + | None -> + failwith + "Parameter '%s' is not a valid rollup name (must be one of %s)" + name + (String.concat ", " Sc_rollup.Kind.(List.map to_string all)) + | Some k -> return k) + + let boot_sector_parameter = + let from_text s = + return (fun (Sc_rollup.PVM.Packed (module R)) -> + R.parse_boot_sector s |> function + | None -> failwith "Invalid kernel" + | Some boot_sector -> return boot_sector) + in + file_or_text_parameter ~from_text () + + let messages_parameter = + let open Lwt_result_syntax in + let from_json text = + try + match Ezjsonm.from_string text with + | `A messages -> return (`Json (`A (`String "raw" :: messages))) + | _ -> failwith "Expecting a list of string" + with Ezjsonm.Parse_error _ -> + failwith "Given text is not valid JSON: '%s'" text + in + let from_json_hex text = + try + match Ezjsonm.from_string text with + | `A messages -> return (`Json (`A (`String "hex" :: messages))) + | _ -> failwith "Expecting a list of hex-encoded string" + with Ezjsonm.Parse_error _ -> + failwith "Given text is not valid JSON: '%s'" text + in + let from_bin_file (cctxt : #Client_context.full) path = + let* bin = cctxt#read_file path in + return (`Bin bin) + in + let from_json_file (cctxt : #Client_context.full) path = + let* json_string = cctxt#read_file path in + from_json json_string + in + Tezos_clic.parameter (fun (cctxt : #Client_context.full) p -> + Client_aliases.parse_alternatives + [ + ("text", from_json); + ("hex", from_json_hex); + ("file", from_json_file cctxt); + ("bin", from_bin_file cctxt); + ] + p) + + let commitment_hash_parameter = + Tezos_clic.parameter (fun _ commitment_hash -> + match Sc_rollup.Commitment.Hash.of_b58check_opt commitment_hash with + | None -> + failwith + "Parameter '%s' is not a valid B58-encoded rollup commitment hash" + commitment_hash + | Some hash -> return hash) + + let unchecked_payload_parameter = file_or_text_parameter ~from_text:return () + + let compressed_state_parameter = + Tezos_clic.parameter (fun _ state_hash -> + match Sc_rollup.State_hash.of_b58check_opt state_hash with + | None -> + failwith + "Parameter '%s' is not a valid B58-encoded compressed state" + state_hash + | Some hash -> return hash) + + let number_of_ticks_parameter = + Tezos_clic.parameter (fun _ nb_of_ticks -> + match Int64.of_string_opt nb_of_ticks with + | Some nb_of_ticks -> ( + match Sc_rollup.Number_of_ticks.of_value nb_of_ticks with + | None -> + failwith + "Parameter '%Ld' is out of bounds, it should be between %Ld \ + and %Ld" + nb_of_ticks + Sc_rollup.Number_of_ticks.min_value + Sc_rollup.Number_of_ticks.max_value + | Some nb_of_ticks -> return nb_of_ticks) + | None -> + failwith "'%s' is not valid, should be a int64 value" nb_of_ticks) +end + +module Zk_rollup_params = struct + let address_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter (fun _cctxt s -> + match Zk_rollup.Address.of_b58check_opt s with + | Some c -> return c + | None -> failwith "Parameter '%s' is an invalid Epoxy address" s) + + let plonk_public_parameters_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter @@ fun cctx s -> + file_or_text + ~read_file:cctx#read_file + ~from_text:(fun s -> + match + Data_encoding.( + Binary.of_bytes_opt + Plonk.Main_protocol.verifier_public_parameters_encoding) + (Bytes.of_string s) + with + | None -> failwith "Invalid PlonK public parameter" + | Some x -> return x) + s + + let update_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter @@ fun cctx s -> + file_or_text + ~read_file:cctx#read_file + ~from_text:(fun s -> + match + Data_encoding.Binary.of_bytes_opt + Zk_rollup.Update.encoding + (Bytes.of_string s) + with + | None -> failwith "Invalid Epoxy Update parameter" + | Some u -> return u) + s + + let operations_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter @@ fun cctx s -> + file_or_text + ~read_file:cctx#read_file + ~from_text:(fun s -> + match + Data_encoding.( + Binary.of_bytes_opt + (list + @@ tup2 + Zk_rollup.Operation.encoding + (option Zk_rollup.Ticket.encoding))) + (Bytes.of_string s) + with + | None -> failwith "Invalid Epoxy Operations parameter" + | Some ops -> return ops) + s + + let state_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter @@ fun cctx s -> + file_or_text + ~read_file:cctx#read_file + ~from_text:(fun s -> + match + Data_encoding.Binary.of_bytes_opt + Zk_rollup.State.encoding + (Bytes.of_string s) + with + | None -> failwith "Invalid Epoxy State parameter" + | Some s -> return s) + s + + let circuits_info_parameter = + let open Lwt_result_syntax in + Tezos_clic.parameter @@ fun cctx s -> + file_or_text + ~read_file:cctx#read_file + ~from_text:(fun s -> + match + Data_encoding.Binary.of_bytes_opt + Zk_rollup.Account.circuits_info_encoding + (Bytes.of_string s) + with + | None -> failwith "Invalid Epoxy Circuits_info map parameter" + | Some c -> return c) + s +end + +let fee_parameter_args = + let open Tezos_clic in + let force_low_fee_arg = + switch + ~long:"force-low-fee" + ~doc:"Don't check that the fee is lower than the estimated default value" + () + in + let fee_cap_arg = + default_arg + ~long:"fee-cap" + ~placeholder:"amount" + ~default:"1.0" + ~doc:"Set the fee cap" + (parameter (fun _ s -> + match Tez.of_string s with + | Some t -> return t + | None -> failwith "Bad fee cap")) + in + let burn_cap_arg = + default_arg + ~long:"burn-cap" + ~placeholder:"amount" + ~default:"0" + ~doc:"Set the burn cap" + (parameter (fun _ s -> + match Tez.of_string s with + | Some t -> return t + | None -> failwith "Bad burn cap")) + in + Tezos_clic.map_arg + ~f: + (fun _cctxt + ( minimal_fees, + minimal_nanotez_per_byte, + minimal_nanotez_per_gas_unit, + force_low_fee, + fee_cap, + burn_cap ) -> + return + { + Injection.minimal_fees; + minimal_nanotez_per_byte; + minimal_nanotez_per_gas_unit; + force_low_fee; + fee_cap; + burn_cap; + }) + (Tezos_clic.aggregate + (Tezos_clic.args6 + minimal_fees_arg + minimal_nanotez_per_byte_arg + minimal_nanotez_per_gas_unit_arg + force_low_fee_arg + fee_cap_arg + burn_cap_arg)) diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_args.mli b/src/proto_016_PtMumbai/lib_client/client_proto_args.mli new file mode 100644 index 000000000000..bf35ce4dae9c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_args.mli @@ -0,0 +1,294 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +val entrypoint_parameter : (Entrypoint.t, full) Tezos_clic.parameter + +val init_arg : (string, full) Tezos_clic.arg + +val fee_arg : (Tez.t option, full) Tezos_clic.arg + +val default_fee_arg : (Tez.t option, full) Tezos_clic.arg + +val counter_arg : (Manager_counter.t option, full) Tezos_clic.arg + +val gas_limit_arg : (Gas.Arith.integral option, full) Tezos_clic.arg + +val default_gas_limit_arg : (Gas.Arith.integral option, full) Tezos_clic.arg + +val run_gas_limit_arg : (Gas.Arith.integral option, full) Tezos_clic.arg + +val unlimited_gas_arg : (bool, full) Tezos_clic.arg + +val storage_limit_arg : (Z.t option, full) Tezos_clic.arg + +val default_storage_limit_arg : (Z.t option, full) Tezos_clic.arg + +val arg_arg : (string option, full) Tezos_clic.arg + +val default_arg_arg : (string option, full) Tezos_clic.arg + +val source_arg : (string option, full) Tezos_clic.arg + +val entrypoint_arg : (Entrypoint.t option, full) Tezos_clic.arg + +val default_entrypoint_arg : (Entrypoint.t option, full) Tezos_clic.arg + +val delegate_arg : + (Tezos_crypto.Signature.Public_key_hash.t option, full) Tezos_clic.arg + +val max_priority_arg : (int option, full) Tezos_clic.arg + +val minimal_fees_arg : (Tez.tez, full) Tezos_clic.arg + +val minimal_nanotez_per_gas_unit_arg : (Q.t, full) Tezos_clic.arg + +val minimal_nanotez_per_byte_arg : (Q.t, full) Tezos_clic.arg + +val replace_by_fees_arg : (bool, full) Tezos_clic.arg + +val successor_level_arg : (bool, full) Tezos_clic.arg + +val force_switch : (bool, full) Tezos_clic.arg + +val no_endorse_switch : (bool, full) Tezos_clic.arg + +val minimal_timestamp_switch : (bool, full) Tezos_clic.arg + +val preserved_levels_arg : (int, full) Tezos_clic.arg + +val no_print_source_flag : (bool, full) Tezos_clic.arg + +val no_confirmation : (bool, full) Tezos_clic.arg + +val tez_arg : + default:string -> + parameter:string -> + doc:string -> + (Tez.t, full) Tezos_clic.arg + +val tez_opt_arg : + parameter:string -> doc:string -> (Tez.t option, full) Tezos_clic.arg + +val tez_param : + name:string -> + desc:string -> + ('a, full) Tezos_clic.params -> + (Tez.t -> 'a, full) Tezos_clic.params + +val non_negative_z_parameter : (Z.t, full) Tezos_clic.parameter + +val non_negative_z_param : + name:string -> + desc:string -> + ('a, full) Tezos_clic.params -> + (Z.t -> 'a, full) Tezos_clic.params + +val non_negative_parameter : (int, full) Tezos_clic.parameter + +val global_constant_param : + name:string -> + desc:string -> + ('a, full) Tezos_clic.params -> + (string -> 'a, full) Tezos_clic.params + +val signature_parameter : (Tezos_crypto.Signature.t, full) Tezos_clic.parameter + +module Daemon : sig + val baking_switch : (bool, full) Tezos_clic.arg + + val endorsement_switch : (bool, full) Tezos_clic.arg + + val denunciation_switch : (bool, full) Tezos_clic.arg +end + +val int_parameter : (int, full) Tezos_clic.parameter + +val uri_parameter : (Uri.t, full) Tezos_clic.parameter + +val string_parameter : (string, full) Tezos_clic.parameter + +val bytes_of_prefixed_string : string -> Bytes.t tzresult Lwt.t + +val bytes_parameter : (Bytes.t, full) Tezos_clic.parameter + +val file_or_text : + from_text:(string -> 'a tzresult Lwt.t) -> + read_file:(string -> string tzresult Lwt.t) -> + string -> + 'a tzresult Lwt.t + +val file_or_text_parameter : + from_text:(string -> 'a tzresult Lwt.t) -> + unit -> + ('a, full) Tezos_clic.parameter + +val json_parameter : (Data_encoding.Json.t, full) Tezos_clic.parameter + +val data_parameter : (Michelson_v1_parser.parsed, full) Tezos_clic.parameter + +val raw_level_parameter : (Raw_level.t, full) Tezos_clic.parameter + +val unparsing_mode_arg : + default:string -> (Script_ir_unparser.unparsing_mode, full) Tezos_clic.arg + +val enforce_indentation_flag : (bool, full) Tezos_clic.arg + +val display_names_flag : (bool, full) Tezos_clic.arg + +val level_arg : (Script_int.n Script_int.num option, full) Tezos_clic.arg + +val now_arg : (Script_timestamp.t option, full) Tezos_clic.arg + +module Tx_rollup : sig + val tx_rollup_address_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Alpha_context.Tx_rollup.t -> 'a, full) Tezos_clic.params + + val level_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_level.t -> 'a, full) Tezos_clic.params + + val context_hash_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tezos_crypto.Context_hash.t -> 'a, full) Tezos_clic.params + + val message_result_path_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_commitment.Merkle.path -> 'a, full) Tezos_clic.params + + val tickets_dispatch_info_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_reveal.t -> 'a, full) Tezos_clic.params + + val message_result_hash_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_message_result_hash.t -> 'a, full) Tezos_clic.params + + val withdraw_list_hash_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_withdraw_list_hash.t -> 'a, full) Tezos_clic.params + + val commitment_hash_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_commitment_hash.t -> 'a, full) Tezos_clic.params + + val commitment_hash_arg : + ?long:string -> + ?placeholder:string -> + usage:string -> + unit -> + (Tx_rollup_commitment_hash.t option, full) Tezos_clic.arg + + val message_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_message.t -> 'a, full) Tezos_clic.params + + val message_path_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_inbox.Merkle.path -> 'a, full) Tezos_clic.params + + val proof_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_l2_proof.t -> 'a, full) Tezos_clic.params + + val inbox_root_hash_param : + ?name:string -> + usage:string -> + ('a, full) Tezos_clic.params -> + (Tx_rollup_inbox.Merkle.root -> 'a, full) Tezos_clic.params +end + +module Sc_rollup_params : sig + val sc_rollup_address_parameter : (Sc_rollup.t, full) Tezos_clic.parameter + + val rollup_kind_parameter : (Sc_rollup.Kind.t, full) Tezos_clic.parameter + + val boot_sector_parameter : + (Sc_rollup.PVM.t -> string tzresult Lwt.t, full) Tezos_clic.parameter + + val messages_parameter : + ([`Bin of string | `Json of Data_encoding.json], full) Tezos_clic.parameter + + val commitment_hash_parameter : + (Sc_rollup.Commitment.Hash.t, full) Tezos_clic.parameter + + val unchecked_payload_parameter : (string, full) Tezos_clic.parameter + + val compressed_state_parameter : + (Sc_rollup.State_hash.t, full) Tezos_clic.parameter + + val number_of_ticks_parameter : + (Sc_rollup.Number_of_ticks.t, full) Tezos_clic.parameter +end + +module Zk_rollup_params : sig + val address_parameter : (Zk_rollup.t, full) Tezos_clic.parameter + + val plonk_public_parameters_parameter : + (Plonk.Main_protocol.verifier_public_parameters, full) Tezos_clic.parameter + + val update_parameter : (Zk_rollup.Update.t, full) Tezos_clic.parameter + + val operations_parameter : + ( (Zk_rollup.Operation.t * Zk_rollup.Ticket.t option) list, + full ) + Tezos_clic.parameter + + val state_parameter : (Zk_rollup.State.t, full) Tezos_clic.parameter + + val circuits_info_parameter : + ( [`Fee | `Private | `Public] Zk_rollup.Account.SMap.t, + full ) + Tezos_clic.parameter +end + +val fee_parameter_args : (Injection.fee_parameter, full) Tezos_clic.arg diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_context.ml b/src/proto_016_PtMumbai/lib_client/client_proto_context.ml new file mode 100644 index 000000000000..d3baa40fd962 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_context.ml @@ -0,0 +1,1685 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context +open Tezos_micheline +open Client_proto_contracts +open Client_keys + +let get_balance (rpc : #rpc_context) ~chain ~block contract = + Alpha_services.Contract.balance rpc (chain, block) contract + +let get_storage (rpc : #rpc_context) ~chain ~block ~unparsing_mode contract = + Plugin.RPC.Contract.get_storage_normalized + rpc + (chain, block) + ~unparsing_mode + ~contract + +let get_used_storage_space (rpc : #rpc_context) ~chain ~block contract = + Plugin.RPC.Contract.get_used_storage_space rpc (chain, block) ~contract + +let get_paid_storage_space (rpc : #rpc_context) ~chain ~block contract = + Plugin.RPC.Contract.get_paid_storage_space rpc (chain, block) ~contract + +let get_big_map_value (rpc : #rpc_context) ~chain ~block ~unparsing_mode id key + = + Plugin.RPC.Big_map.big_map_get_normalized + rpc + (chain, block) + ~unparsing_mode + id + key + +let get_contract_big_map_value (rpc : #rpc_context) ~chain ~block contract key = + Alpha_services.Contract.contract_big_map_get_opt + rpc + (chain, block) + contract + key + +let get_script (rpc : #rpc_context) ~chain ~block ~unparsing_mode + ~normalize_types contract = + Plugin.RPC.Contract.get_script_normalized + rpc + (chain, block) + ~unparsing_mode + ~normalize_types + ~contract + +let get_script_hash (rpc : #rpc_context) ~chain ~block contract = + Alpha_services.Contract.script_opt rpc (chain, block) contract + >>=? fun script_opt -> + Lwt.return @@ Environment.wrap_tzresult + @@ Option.map_e + (fun {Script.code; storage = _} -> + Script_repr.force_decode code >>? fun code -> + let bytes = + Data_encoding.Binary.to_bytes_exn Script.expr_encoding code + in + let hash = Script_expr_hash.hash_bytes [bytes] in + ok hash) + script_opt + +let get_contract_ticket_balance (rpc : #rpc_context) ~chain ~block contract key + = + Plugin.RPC.Contract.get_ticket_balance rpc (chain, block) contract key + +let get_contract_all_ticket_balances (rpc : #rpc_context) ~chain ~block contract + = + Plugin.RPC.Contract.get_all_ticket_balances rpc (chain, block) contract + +let ticket_balances_encoding = Plugin.RPC.Contract.ticket_balances_encoding + +let get_frozen_deposits_limit (rpc : #rpc_context) ~chain ~block delegate = + Alpha_services.Delegate.frozen_deposits_limit rpc (chain, block) delegate + +let parse_expression arg = + Lwt.return + (Micheline_parser.no_parsing_error + (Michelson_v1_parser.parse_expression arg)) + +let parse_arg_transfer arg = + (match arg with + | Some arg -> + parse_expression arg >>=? fun {expanded = arg; _} -> return_some arg + | None -> return_none) + >>=? fun parameters -> + return + (Option.fold ~some:Script.lazy_expr ~none:Script.unit_parameter parameters) + +let build_transaction_operation ~amount ~parameters + ?(entrypoint = Entrypoint.default) ?fee ?gas_limit ?storage_limit + destination = + let operation = Transaction {amount; parameters; destination; entrypoint} in + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation + +let transfer_with_script (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?(force = false) ?branch ?successor_level + ~source ~src_pk ~src_sk ~destination ?(entrypoint = Entrypoint.default) + ~parameters ~amount ?fee ?gas_limit ?storage_limit ?counter ~fee_parameter + ?replace_by_fees () = + let contents = + build_transaction_operation + ~amount + ~parameters + ~entrypoint + ?fee + ?gas_limit + ?storage_limit + destination + in + let contents = Annotated_manager_operation.Single_manager contents in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~force + ?branch + ?successor_level + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ?counter + ?replace_by_fees + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + Lwt.return (Injection.originated_contracts ~force result) + >>=? fun contracts -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return ((oph, op, result), contracts) + +let transfer (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?(force = false) ?branch ?successor_level + ~source ~src_pk ~src_sk ~destination ?entrypoint ?arg ~amount ?fee + ?gas_limit ?storage_limit ?counter ~fee_parameter ?replace_by_fees () = + parse_arg_transfer arg >>=? fun parameters -> + transfer_with_script + (cctxt : #full) + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~force + ?branch + ?successor_level + ~source + ~src_pk + ~src_sk + ~destination + ?entrypoint + ~parameters + ~amount + ?fee + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + ?replace_by_fees + () + +let build_reveal_operation ?fee ?gas_limit ?storage_limit pk = + let operation = Reveal pk in + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation + +let reveal cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch + ~source ~src_pk ~src_sk ?fee ~fee_parameter () = + let contents = + Annotated_manager_operation.Single_manager + (build_reveal_operation ?fee ~storage_limit:Z.zero src_pk) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?branch + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let build_delegate_operation ?fee ?gas_limit ?storage_limit delegate_opt = + let operation = Delegation delegate_opt in + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation + +let delegate_contract cctxt ~chain ~block ?branch ?confirmations ?dry_run + ?verbose_signing ?simulation ~source ~src_pk ~src_sk ?fee ~fee_parameter + delegate_opt = + let operation = + Annotated_manager_operation.Single_manager + (build_delegate_operation ?fee delegate_opt) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?branch + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let list_contract_labels cctxt ~chain ~block = + Alpha_services.Contract.list cctxt (chain, block) >>=? fun contracts -> + List.rev_map_es + (fun h -> + (match (h : Contract.t) with + | Implicit m -> ( + Public_key_hash.rev_find cctxt m >>=? function + | None -> return "" + | Some nm -> ( + RawContractAlias.find_opt cctxt nm >>=? function + | None -> return (" (known as " ^ nm ^ ")") + | Some _ -> return (" (known as key:" ^ nm ^ ")"))) + | Originated _ -> ( + RawContractAlias.rev_find cctxt h >>=? function + | None -> return "" + | Some nm -> return (" (known as " ^ nm ^ ")"))) + >>=? fun nm -> + let kind = + match h with Implicit _ -> " (implicit)" | Originated _ -> "" + in + let h_b58 = Contract.to_b58check h in + return (nm, h_b58, kind)) + contracts + >|=? List.rev + +let message_added_contract (cctxt : #full) name = + cctxt#message "Contract memorized as %s." name + +let set_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing + ?simulation ?fee contract ~src_pk ~manager_sk ~fee_parameter opt_delegate = + delegate_contract + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~source:contract + ~src_pk + ~src_sk:manager_sk + ?fee + ~fee_parameter + opt_delegate + +let build_update_consensus_key ?fee ?gas_limit ?storage_limit consensus_pk = + let operation = Update_consensus_key consensus_pk in + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation + +let register_as_delegate cctxt ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?fee ~manager_sk ~fee_parameter ?consensus_pk src_pk = + let source = Tezos_crypto.Signature.Public_key.hash src_pk in + let delegate_op = build_delegate_operation ?fee (Some source) in + match consensus_pk with + | None -> ( + let operation = Annotated_manager_operation.Single_manager delegate_op in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk:manager_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return ((oph, op, result), None)) + | Some consensus_pk -> ( + let operation = + Annotated_manager_operation.Cons_manager + ( delegate_op, + Annotated_manager_operation.Single_manager + (build_update_consensus_key ?fee consensus_pk) ) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ~successor_level:true + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk:manager_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result + (Manager_operation _, Manager_operation_result _) -> + . + | Apply_results.Cons_and_result + ( (Manager_operation _ as op1), + res1, + Single_and_result ((Manager_operation _ as op2), res2) ) -> + return ((oph, op1, res1), Some (op2, res2))) + +let update_consensus_key cctxt ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ~consensus_pk ~manager_sk ~fee_parameter + src_pk = + let source = Tezos_crypto.Signature.Public_key.hash src_pk in + let operation = build_update_consensus_key ?fee consensus_pk in + let operation = Annotated_manager_operation.Single_manager operation in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~successor_level:true + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk:manager_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let drain_delegate cctxt ~chain ~block ?confirmations ?dry_run ?verbose_signing + ?simulation ~consensus_sk ~consensus_pkh ?(destination = consensus_pkh) + ~delegate () = + let operation = + Single + (Drain_delegate {consensus_key = consensus_pkh; delegate; destination}) + in + Injection.inject_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~src_sk:consensus_sk + operation + >>=? fun (oph, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Drain_delegate _ as op), result) -> + return (oph, op, result) + +let set_deposits_limit cctxt ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee contract ~src_pk ~manager_sk + ~fee_parameter limit_opt = + let operation = Set_deposits_limit limit_opt in + let operation = + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + operation + in + let operation = Annotated_manager_operation.Single_manager operation in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~source:contract + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk:manager_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let increase_paid_storage cctxt ~chain ~block ?force ?dry_run ?verbose_signing + ?fee ?confirmations ?simulation ~source ~destination ~src_pk ~manager_sk + ~fee_parameter ~amount_in_bytes () = + let operation = Increase_paid_storage {amount_in_bytes; destination} in + let operation = + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + operation + in + let operation = Annotated_manager_operation.Single_manager operation in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?force + ?dry_run + ?verbose_signing + ?simulation + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~src_pk + ~src_sk:manager_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let save_contract ~force cctxt alias_name contract = + RawContractAlias.add ~force cctxt alias_name contract >>=? fun () -> + message_added_contract cctxt alias_name >>= fun () -> return_unit + +let check_for_timelock code = + let open Tezos_micheline.Micheline in + let rec has_timelock_opcodes = function + | Prim (_, (Script.T_chest | T_chest_key | I_OPEN_CHEST), _, _) -> true + | Seq (_, exprs) | Prim (_, _, exprs, _) -> + List.exists has_timelock_opcodes exprs + | Int _ | String _ | Bytes _ -> false + in + has_timelock_opcodes (root code) + +let build_origination_operation ?(allow_timelock = false) ?fee ?gas_limit + ?storage_limit ~initial_storage ~code ~delegate ~balance () = + (if (not allow_timelock) && check_for_timelock code then + failwith + "Origination of contracts containing time lock related instructions is \ + disabled in the client because of a vulnerability." + else return_unit) + >>=? fun () -> + (* With the change of making implicit accounts delegatable, the following + 3 arguments are being defaulted before they can be safely removed. *) + Lwt.return (Michelson_v1_parser.parse_expression initial_storage) + >>= fun result -> + Lwt.return (Micheline_parser.no_parsing_error result) + >>=? fun {Michelson_v1_parser.expanded = storage; _} -> + let code = Script.lazy_expr code and storage = Script.lazy_expr storage in + let origination = + Origination {delegate; script = {code; storage}; credit = balance} + in + return + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + origination) + +let originate_contract (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?branch ?fee ?gas_limit ?storage_limit ~delegate + ~initial_storage ~balance ~source ~src_pk ~src_sk ~code ~fee_parameter () = + build_origination_operation + ~allow_timelock:false + ?fee + ?gas_limit + ?storage_limit + ~initial_storage + ~code + ~delegate + ~balance + () + >>=? fun origination -> + let origination = Annotated_manager_operation.Single_manager origination in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?branch + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ~src_pk + ~src_sk + ~fee_parameter + origination + >>=? fun (oph, _, op, result) -> + (match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result)) + >>=? fun res -> + Lwt.return (Injection.originated_contracts ~force:false result) >>=? function + | [contract] -> return (res, Contract.Originated contract) + | contracts -> + failwith + "The origination introduced %d contracts instead of one." + (List.length contracts) + +let michelson_expression_of_string str = + Michelson_v1_parser.parse_expression str |> Micheline_parser.no_parsing_error + >>? fun {Michelson_v1_parser.expanded = v; _} -> ok @@ Script.lazy_expr v + +let build_register_global_constant ?fee ?gas_limit ?storage_limit value = + michelson_expression_of_string value >>? fun value -> + let op = Register_global_constant {value} in + ok + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + op) + +let register_global_constant (cctxt : #full) ~chain ~block ?confirmations + ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~constant () = + build_register_global_constant ?fee ?storage_limit ?gas_limit constant + >>?= fun op -> + let op = Annotated_manager_operation.Single_manager op in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +type activation_key = { + pkh : Tezos_crypto.Ed25519.Public_key_hash.t; + amount : Tez.t; + activation_code : Blinded_public_key_hash.activation_code; + mnemonic : string list; + password : string; + email : string; +} + +let raw_activation_key_encoding = + let open Data_encoding in + obj6 + (req "pkh" Tezos_crypto.Ed25519.Public_key_hash.encoding) + (req "amount" Tez.encoding) + (req "activation_code" Blinded_public_key_hash.activation_code_encoding) + (req "mnemonic" (list string)) + (req "password" string) + (req "email" string) + +let activation_key_encoding = + (* Hack: allow compatibility with older encoding *) + let open Data_encoding in + conv + (fun {pkh; amount; activation_code; mnemonic; password; email} -> + (pkh, amount, activation_code, mnemonic, password, email)) + (fun (pkh, amount, activation_code, mnemonic, password, email) -> + {pkh; amount; activation_code; mnemonic; password; email}) + @@ splitted + ~binary:raw_activation_key_encoding + ~json: + (union + [ + case + ~title:"Activation" + Json_only + raw_activation_key_encoding + (fun x -> Some x) + (fun x -> x); + case + ~title:"Deprecated_activation" + Json_only + (obj6 + (req "pkh" Tezos_crypto.Ed25519.Public_key_hash.encoding) + (req "amount" Tez.encoding) + (req + "secret" + Blinded_public_key_hash.activation_code_encoding) + (req "mnemonic" (list string)) + (req "password" string) + (req "email" string)) + (fun _ -> None) + (fun x -> x); + ]) + +type batch_transfer_operation = { + destination : string; + fee : string option; + gas_limit : Gas.Arith.integral option; + storage_limit : Z.t option; + amount : string; + arg : string option; + entrypoint : Entrypoint.t option; +} + +let batch_transfer_operation_encoding = + let open Data_encoding in + conv + (fun {destination; fee; gas_limit; storage_limit; amount; arg; entrypoint} -> + (destination, fee, gas_limit, storage_limit, amount, arg, entrypoint)) + (fun (destination, fee, gas_limit, storage_limit, amount, arg, entrypoint) -> + {destination; fee; gas_limit; storage_limit; amount; arg; entrypoint}) + (obj7 + (req "destination" string) + (opt "fee" string) + (opt "gas-limit" Gas.Arith.n_integral_encoding) + (opt "storage-limit" z) + (req "amount" string) + (opt "arg" string) + (opt "entrypoint" Entrypoint.simple_encoding)) + +let read_key key = + match Bip39.of_words key.mnemonic with + | None -> failwith "" + | Some t -> + (* TODO: unicode normalization (NFKD)... *) + let passphrase = + Bytes.(cat (of_string key.email) (of_string key.password)) + in + let sk = Bip39.to_seed ~passphrase t in + let sk = Bytes.sub sk 0 32 in + let sk : Tezos_crypto.Signature.Secret_key.t = + Ed25519 + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Ed25519.Secret_key.encoding + sk) + in + let pk = Tezos_crypto.Signature.Secret_key.to_public_key sk in + let pkh = Tezos_crypto.Signature.Public_key.hash pk in + return (pkh, pk, sk) + +let inject_activate_operation cctxt ~chain ~block ?confirmations ?dry_run alias + pkh activation_code = + let contents = Single (Activate_account {id = pkh; activation_code}) in + Injection.inject_operation + cctxt + ?confirmations + ?dry_run + ~chain + ~block + contents + >>=? fun (oph, op, result) -> + (match confirmations with + | None -> return_unit + | Some _confirmations -> + Alpha_services.Contract.balance + cctxt + (chain, block) + (Contract.Implicit (Ed25519 pkh)) + >>=? fun balance -> + cctxt#message + "Account %s (%a) activated with %s%a." + alias + Tezos_crypto.Ed25519.Public_key_hash.pp + pkh + Operation_result.tez_sym + Tez.pp + balance + >>= fun () -> return_unit) + >>=? fun () -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Activate_account _ as op), result) -> + return (oph, op, result) + +let activate_account (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?(encrypted = false) ?force key name = + read_key key >>=? fun (pkh, pk, sk) -> + fail_unless + (Tezos_crypto.Signature.Public_key_hash.equal pkh (Ed25519 key.pkh)) + (error_of_fmt + "@[<v 2>Inconsistent activation key:@ Computed pkh: %a@ Embedded pkh: \ + %a @]" + Tezos_crypto.Signature.Public_key_hash.pp + pkh + Tezos_crypto.Ed25519.Public_key_hash.pp + key.pkh) + >>=? fun () -> + let pk = Tezos_crypto.Signature.Of_V1.public_key pk in + let sk = Tezos_crypto.Signature.Of_V1.secret_key sk in + Tezos_signer_backends.Unencrypted.make_pk pk >>?= fun pk_uri -> + (if encrypted then + Tezos_signer_backends.Encrypted.prompt_twice_and_encrypt cctxt sk + else Tezos_signer_backends.Unencrypted.make_sk sk >>?= return) + >>=? fun sk_uri -> + Client_keys.register_key cctxt ?force (pkh, pk_uri, sk_uri) name + >>=? fun () -> + inject_activate_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + name + key.pkh + key.activation_code + +let activate_existing_account (cctxt : #full) ~chain ~block ?confirmations + ?dry_run alias activation_code = + Client_keys.alias_keys cctxt alias >>=? function + | Some (Ed25519 pkh, _, _) -> + inject_activate_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + alias + pkh + activation_code + | Some _ -> failwith "Only Ed25519 accounts can be activated" + | None -> failwith "Unknown account" + +type period_info = { + current_period_kind : Voting_period.kind; + position : Int32.t; + remaining : Int32.t; + current_proposal : Tezos_crypto.Protocol_hash.t option; +} + +type ballots_info = { + current_quorum : Int32.t; + participation : Int32.t; + supermajority : Int64.t; + ballots : Vote.ballots; +} + +let get_ballots_info (cctxt : #full) ~chain ~block = + (* Get the next level, not the current *) + let cb = (chain, block) in + Alpha_services.Voting.ballots cctxt cb >>=? fun ballots -> + Alpha_services.Voting.current_quorum cctxt cb >>=? fun current_quorum -> + Alpha_services.Voting.total_voting_power cctxt cb + >>=? fun max_participation -> + let all_votes = Int64.(add (add ballots.yay ballots.nay) ballots.pass) in + let participation = + Z.( + to_int32 + (div + (mul (of_int64 all_votes) (of_int 100_00)) + (of_int64 max_participation))) + in + let supermajority = Int64.(div (mul 8L (add ballots.yay ballots.nay)) 10L) in + return {current_quorum; participation; supermajority; ballots} + +let get_period_info ?(successor = false) (cctxt : #full) ~chain ~block = + let cb = (chain, block) in + (if successor then Alpha_services.Voting.successor_period + else Alpha_services.Voting.current_period) + cctxt + cb + >>=? fun voting_period -> + Alpha_services.Voting.current_proposal cctxt cb >>=? fun current_proposal -> + return + { + current_period_kind = voting_period.voting_period.kind; + position = voting_period.position; + remaining = voting_period.remaining; + current_proposal; + } + +let get_proposals (cctxt : #full) ~chain ~block = + let cb = (chain, block) in + Alpha_services.Voting.proposals cctxt cb + +let submit_proposals ?dry_run ?verbose_signing (cctxt : #full) ~chain ~block + ?confirmations ~src_sk source proposals = + Alpha_services.Voting.successor_period cctxt (chain, block) + >>=? fun {voting_period = {index; _}; _} -> + let contents = Single (Proposals {source; period = index; proposals}) in + Injection.inject_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ~src_sk + contents + ?verbose_signing + +let submit_ballot ?dry_run ?verbose_signing (cctxt : #full) ~chain ~block + ?confirmations ~src_sk source proposal ballot = + (* The user must provide the proposal explicitly to make himself sure + for what he is voting. *) + Alpha_services.Voting.successor_period cctxt (chain, block) + >>=? fun {voting_period = {index; _}; _} -> + let contents = Single (Ballot {source; period = index; proposal; ballot}) in + Injection.inject_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ~src_sk + contents + ?verbose_signing + +let pp_operation formatter (a : Alpha_block_services.operation) = + match (a.receipt, a.protocol_data) with + | Receipt (Apply_results.Operation_metadata omd), Operation_data od -> ( + match Apply_results.kind_equal_list od.contents omd.contents with + | Some Apply_results.Eq -> + Operation_result.pp_operation_result + formatter + (od.contents, omd.contents) + | None -> Stdlib.failwith "Unexpected result.") + | Empty, _ -> + Stdlib.failwith + "Pruned metadata: the operation receipt was removed accordingly to the \ + node's history mode." + | Too_large, _ -> Stdlib.failwith "Too large metadata." + | _ -> Stdlib.failwith "Unexpected result." + +let get_operation_from_block (cctxt : #full) ~chain predecessors operation_hash + = + Client_confirmations.lookup_operation_in_previous_blocks + cctxt + ~chain + ~predecessors + operation_hash + >>=? function + | None -> return_none + | Some (block, i, j) -> + cctxt#message + "Operation found in block: %a (pass: %d, offset: %d)" + Tezos_crypto.Block_hash.pp + block + i + j + >>= fun () -> + Protocol_client_context.Alpha_block_services.Operations.operation + cctxt + ~chain + ~block:(`Hash (block, 0)) + i + j + >>=? fun op' -> return_some op' + +let display_receipt_for_operation (cctxt : #full) ~chain ?(predecessors = 10) + operation_hash = + get_operation_from_block cctxt ~chain predecessors operation_hash + >>=? function + | None -> failwith "Couldn't find operation" + | Some op -> cctxt#message "%a" pp_operation op >>= fun () -> return_unit + +let cached_contracts cctxt ~chain ~block = + let cb = (chain, block) in + Alpha_services.Cache.cached_contracts cctxt cb + +let contract_rank cctxt ~chain ~block contract = + let cb = (chain, block) in + Alpha_services.Cache.contract_rank cctxt cb contract + +let contract_cache_size cctxt ~chain ~block = + let cb = (chain, block) in + Alpha_services.Cache.contract_cache_size cctxt cb + +let contract_cache_size_limit cctxt ~chain ~block = + let cb = (chain, block) in + Alpha_services.Cache.contract_cache_size_limit cctxt cb + +let originate_tx_rollup (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~src_pk ~src_sk ~fee_parameter () = + let contents : + Kind.tx_rollup_origination Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + Tx_rollup_origination) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_batch (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?burn_limit ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~content ~tx_rollup () = + let contents : + Kind.tx_rollup_submit_batch Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_submit_batch {tx_rollup; content; burn_limit})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~successor_level:true + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_commitment (cctxt : #full) ~chain ~block ?confirmations + ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~inbox_merkle_root + ~messages ~predecessor ~tx_rollup () = + let commitment : Tx_rollup_commitment.Full.t = + {level; messages; predecessor; inbox_merkle_root} + in + let contents : + Kind.tx_rollup_commit Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_commit {tx_rollup; commitment})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~successor_level:true + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_finalize_commitment (cctxt : #full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit + ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () + = + let contents : + Kind.tx_rollup_finalize_commitment + Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_finalize_commitment {tx_rollup})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_remove_commitment (cctxt : #full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit + ?storage_limit ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () + = + let contents : + Kind.tx_rollup_remove_commitment + Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_remove_commitment {tx_rollup})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_rejection (cctxt : #full) ~chain ~block ?confirmations + ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~tx_rollup ~message + ~message_position ~message_path ~message_result_hash ~message_result_path + ~previous_context_hash ~previous_withdraw_list_hash + ~previous_message_result_path ~proof () = + let previous_message_result = + Tx_rollup_message_result. + { + context_hash = previous_context_hash; + withdraw_list_hash = previous_withdraw_list_hash; + } + in + let proof = Tx_rollup_l2_proof.serialize_proof_exn proof in + let contents : + Kind.tx_rollup_rejection Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_rejection + { + tx_rollup; + level; + message; + message_position; + message_path; + message_result_hash; + message_result_path; + previous_message_result_path; + previous_message_result; + proof; + })) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let submit_tx_rollup_return_bond (cctxt : #full) ~chain ~block ?confirmations + ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~tx_rollup () = + let contents : + Kind.tx_rollup_return_bond Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_return_bond {tx_rollup})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let tx_rollup_dispatch_tickets (cctxt : #full) ~chain ~block ?confirmations + ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit + ?counter ~source ~src_pk ~src_sk ~fee_parameter ~level ~context_hash + ~message_position ~message_result_path ~tickets_info ~tx_rollup () = + let contents : + Kind.tx_rollup_dispatch_tickets Annotated_manager_operation.annotated_list + = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index = message_position; + message_result_path; + tickets_info; + })) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~successor_level:true + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let transfer_ticket (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~src_pk ~src_sk ~fee_parameter ~contents ~ty ~ticketer ~amount ~destination + ~entrypoint () = + parse_expression contents >>=? fun {expanded; _} -> + let contents = Script.lazy_expr expanded in + parse_expression ty >>=? fun {expanded; _} -> + let ty = Script.lazy_expr expanded in + let operation : + Kind.transfer_ticket Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Transfer_ticket + {contents; ty; ticketer; amount; destination; entrypoint})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~successor_level:true + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + operation + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_originate (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~kind ~boot_sector ~parameters_ty ~src_pk ~src_sk ~fee_parameter () = + Client_proto_rollups.ScRollup.origination_proof_exn ~boot_sector kind + >>= fun origination_proof -> + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_originate + {kind; boot_sector; origination_proof; parameters_ty})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_add_messages (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~messages ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_add_messages {messages})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_cement (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~rollup ~commitment ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_cement {rollup; commitment})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_publish (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~rollup ~commitment ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_publish {rollup; commitment})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_execute_outbox_message (cctxt : #full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?simulation ?fee ?gas_limit + ?storage_limit ?counter ~source ~rollup ~cemented_commitment ~output_proof + ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_execute_outbox_message + {rollup; cemented_commitment; output_proof})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_recover_bond (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~src_pk ~src_sk ~fee_parameter ~sc_rollup ~staker () = + let contents : + Kind.sc_rollup_recover_bond Annotated_manager_operation.annotated_list = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_recover_bond {sc_rollup; staker})) + in + (* TODO/Fixme: https://gitlab.com/tezos/tezos/-/issues/2609 + Decide if we should enforce ~successor_level:true for simulation. + See https://gitlab.com/tezos/tezos/-/merge_requests/5395#note_958326685 *) + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + contents + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_refute (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~rollup ~refutation ~opponent ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_refute {rollup; refutation; opponent})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let sc_rollup_timeout (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~rollup ~alice ~bob ~src_pk ~src_sk ~fee_parameter () = + let stakers = Sc_rollup.Game.Index.make alice bob in + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Sc_rollup_timeout {rollup; stakers})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let zk_rollup_originate (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~public_parameters ~circuits_info ~init_state ~nb_ops ~src_pk ~src_sk + ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Zk_rollup_origination + {public_parameters; circuits_info; init_state; nb_ops})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let zk_rollup_publish (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~zk_rollup ~ops ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Zk_rollup_publish {zk_rollup; ops})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + +let zk_rollup_update (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?fee ?gas_limit ?storage_limit ?counter ~source + ~zk_rollup ~update ~src_pk ~src_sk ~fee_parameter () = + let op = + Annotated_manager_operation.Single_manager + (Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + (Zk_rollup_update {zk_rollup; update})) + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?counter + ~source + ~fee:(Limit.of_option fee) + ~storage_limit:(Limit.of_option storage_limit) + ~gas_limit:(Limit.of_option gas_limit) + ~src_pk + ~src_sk + ~fee_parameter + op + >>=? fun (oph, _, op, result) -> + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_context.mli b/src/proto_016_PtMumbai/lib_client/client_proto_context.mli new file mode 100644 index 000000000000..22e36f72a569 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_context.mli @@ -0,0 +1,1109 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** Calls {!Tezos_protocol_alpha.Protocol.Contract_services.list}. *) +val list_contract_labels : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + (string * string * string) list tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_storage_normalized}. *) +val get_storage : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + unparsing_mode:Script_ir_unparser.unparsing_mode -> + Contract_hash.t -> + Script.expr option tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_used_storage_space}. *) +val get_used_storage_space : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + Z.t option tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_paid_storage_space}. *) +val get_paid_storage_space : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + Z.t option tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Contract_services.contract_big_map_get_opt}. *) +val get_contract_big_map_value : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + Script.expr * Script.expr -> + Script.expr option tzresult Lwt.t + +(** Calls {!Injection.prepare_manager_operation} + with [Register_global_constant constant] as operation. *) +val register_global_constant : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + constant:string -> + unit -> + (Kind.register_global_constant Kind.manager Injection.result, tztrace) result + Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Big_map.big_map_get_normalized}. *) +val get_big_map_value : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + unparsing_mode:Script_ir_unparser.unparsing_mode -> + Big_map.Id.t -> + Script_expr_hash.t -> + Script.expr tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_script_normalized}. *) +val get_script : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + unparsing_mode:Script_ir_unparser.unparsing_mode -> + normalize_types:bool -> + Contract_hash.t -> + Script.t option tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Contract_services.script_opt}. *) +val get_script_hash : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + Script_expr_hash.t option tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Contract_services.balance}. *) +val get_balance : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract.t -> + Tez.t tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_ticket_balance}. *) +val get_contract_ticket_balance : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract.t -> + Ticket_token.unparsed_token -> + Z.t tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Contract.get_all_ticket_balances}. *) +val get_contract_all_ticket_balances : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + (Ticket_token.unparsed_token * Z.t) list tzresult Lwt.t + +val ticket_balances_encoding : + (Ticket_token.unparsed_token * Z.t) list Data_encoding.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Delegate_services.frozen_deposits_limit}. *) +val get_frozen_deposits_limit : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Tezos_crypto.Signature.Public_key_hash.t -> + Tez.t option tzresult Lwt.t + +(** Calls {!Injection.prepare_manager_operation} + with {!Alpha_context.Delegation} [delegate_opt] as operation. *) +val build_delegate_operation : + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + public_key_hash option -> + Kind.delegation Annotated_manager_operation.t + +(** Calls {!Injection.inject_manager_operation} + with {!Annotated_manager_operation.Single_manager} [build_delegate_operation ?fee opt_delegate] + as operation. *) +val set_delegate : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + public_key_hash -> + src_pk:public_key -> + manager_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + public_key_hash option -> + Kind.delegation Kind.manager Injection.result tzresult Lwt.t + +val update_consensus_key : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + consensus_pk:Tezos_crypto.Signature.public_key -> + manager_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + Tezos_crypto.Signature.public_key -> + Kind.update_consensus_key Kind.manager Injection.result tzresult Lwt.t + +val drain_delegate : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + consensus_sk:Client_keys.sk_uri -> + consensus_pkh:Tezos_crypto.Signature.public_key_hash -> + ?destination:Tezos_crypto.Signature.public_key_hash -> + delegate:Tezos_crypto.Signature.public_key_hash -> + unit -> + Kind.drain_delegate Injection.result tzresult Lwt.t + +(** Calls {!Injection.inject_manager_operation} + with {!Annotated_manager_operation.Single_manager} {!Alpha_context.Set_deposits_limit} [limit_opt] + as operation. *) +val set_deposits_limit : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + public_key_hash -> + src_pk:public_key -> + manager_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + Tez.t option -> + Kind.set_deposits_limit Kind.manager Injection.result tzresult Lwt.t + +(** Calls {!Injection.inject_manager_operation} + with {!Annotated_manager_operation.Single_manager} {!Alpha_context.Increase_paid_storage} + [{amount_in_bytes; destination}] as operation. *) +val increase_paid_storage : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?force:bool -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?fee:Tez.tez -> + ?confirmations:int -> + ?simulation:bool -> + source:public_key_hash -> + destination:Contract_hash.t -> + src_pk:public_key -> + manager_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + amount_in_bytes:Z.t -> + unit -> + Kind.increase_paid_storage Kind.manager Injection.result tzresult Lwt.t + +(** Same as {!set_delegate} but the [~source] argument of {!Injection.inject_manager_operation} + is {!Tezos_crypto.Signature.Public_key.hash} [src_pk]. *) +val register_as_delegate : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?fee:Tez.tez -> + manager_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + ?consensus_pk:public_key -> + public_key -> + (Kind.delegation Kind.manager Injection.result + * (Kind.update_consensus_key Kind.manager contents + * Kind.update_consensus_key Kind.manager Apply_results.contents_result) + option) + tzresult + Lwt.t + +(** Calls {!RawContractAlias.add}. *) +val save_contract : + force:bool -> + #Protocol_client_context.full -> + string -> + Contract.t -> + unit tzresult Lwt.t + +(** Injects the origination of a script into the context. + See {!Injection.inject_manager_operation} for the injection, and + {!Protocol.Alpha_context.Origination} for the origination parameters. *) +val originate_contract : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?branch:int -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + delegate:public_key_hash option -> + initial_storage:string -> + balance:Tez.t -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + code:Script.expr -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.origination Kind.manager Injection.result * Contract.t) tzresult Lwt.t + +(** Calls {!Michelson_v1_parser.parse_expression arg}. *) +val parse_arg_transfer : string option -> Script.lazy_expr tzresult Lwt.t + +(** Calls {!Injection.prepare_manager_operation} + with {!Alpha_context.Transaction} [{amount;parameters;destinations;entrypoint}] + as operation. *) +val build_transaction_operation : + amount:Tez.t -> + parameters:Script.lazy_expr -> + ?entrypoint:Entrypoint.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + Contract.t -> + Kind.transaction Annotated_manager_operation.t + +(** Same as {!transfer}, but takes parameters as {!Script.lazy_expr} instead of + a raw string. This can be useful for commands that elaborate Micheline parameters, + such as Multisigs or FA1.2 operations. *) +val transfer_with_script : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?force:bool -> + ?branch:int -> + ?successor_level:bool -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + destination:Contract.t -> + ?entrypoint:Entrypoint.t -> + parameters:Script.lazy_expr -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + ?replace_by_fees:bool -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t + +(** Calls {!Injection.inject_manager_operation} + with {!Annotated_manager_operation.Single_manager} + [build_transaction_operation + ~amount ~parameters ~entrypoint ?fee ?gas_limit ?storage_limit destination] + as contents. *) +val transfer : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?force:bool -> + ?branch:int -> + ?successor_level:bool -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + destination:Contract.t -> + ?entrypoint:Entrypoint.t -> + ?arg:string -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + ?replace_by_fees:bool -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t + +(** Calls {!Injection.prepare_manager_operation} with [Reveal pk] as [operation] *) +val build_reveal_operation : + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + public_key -> + Kind.reveal Annotated_manager_operation.t + +(** Calls {!Injection.inject_manager_operation} + with {!Annotated_manager_operation.Single_manager} + [build_reveal_operation ?fee ~storage_limit:Z.zero src_pk] + as contents. *) +val reveal : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?branch:int -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + ?fee:Tez.t -> + fee_parameter:Injection.fee_parameter -> + unit -> + Kind.reveal Kind.manager Injection.result tzresult Lwt.t + +type activation_key = { + pkh : Tezos_crypto.Ed25519.Public_key_hash.t; + amount : Tez.t; + activation_code : Blinded_public_key_hash.activation_code; + mnemonic : string list; + password : string; + email : string; +} + +val activation_key_encoding : activation_key Data_encoding.t + +type batch_transfer_operation = { + destination : string; + fee : string option; + gas_limit : Gas.Arith.integral option; + storage_limit : Z.t option; + amount : string; + arg : string option; + entrypoint : Entrypoint.t option; +} + +val batch_transfer_operation_encoding : batch_transfer_operation Data_encoding.t + +(** Activate an account, by calling {!Injection.inject_operation}. *) +val activate_account : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?encrypted:bool -> + ?force:bool -> + activation_key -> + string -> + Kind.activate_account Injection.result tzresult Lwt.t + +(** Activate an existing account, + by calling {!Injection.inject_operation} with [activation code]. + It fails if the account is unknown or if the account is not [Tezos_crypto.Ed25519]. *) +val activate_existing_account : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + string -> + Blinded_public_key_hash.activation_code -> + Kind.activate_account Injection.result tzresult Lwt.t + +type period_info = { + current_period_kind : Voting_period.kind; + position : Int32.t; + remaining : Int32.t; + current_proposal : Tezos_crypto.Protocol_hash.t option; +} + +type ballots_info = { + current_quorum : Int32.t; + participation : Int32.t; + supermajority : Int64.t; + ballots : Vote.ballots; +} + +(** [get_period_info ~successor cctx ~chain ~block] returns the successor [period_info] if [successor], + it returns the current [period_info] otherwise. + This function uses {!Tezos_protocol_alpha.Protocol.Voting_services.successor_period} if [successor], + otherwise it calls {!Tezos_protocol_alpha.Protocol.Voting_services.current_period}. + In any case, it also uses {!Tezos_protocol_alpha.Protocol.Voting_services.current_proposal} +*) +val get_period_info : + ?successor:bool -> + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + period_info tzresult Lwt.t + +(** [get_ballots_info cctx ~chain ~block] returns the [ballots_info]. + It calls {!Tezos_protocol_alpha.Protocol.Voting_services.ballots}, + {!Tezos_protocol_alpha.Protocol.Voting_services.current_quorum} + and {!Tezos_protocol_alpha.Protocol.Voting_services.total_voting_power}. +*) +val get_ballots_info : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ballots_info tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Voting_services.proposals} *) +val get_proposals : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Int64.t Environment.Protocol_hash.Map.t tzresult Lwt.t + +(** Calls {!Injection.inject_operation} + where [contents] is {!Alpha_context.Single} [(Proposals {source; period = index; proposals})] + with [index] the result of {!Alpha_services.Voting.successor_period} *) +val submit_proposals : + ?dry_run:bool -> + ?verbose_signing:bool -> + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + src_sk:Client_keys.sk_uri -> + public_key_hash -> + Tezos_crypto.Protocol_hash.t list -> + Kind.proposals Injection.result_list tzresult Lwt.t + +(** Calls {!Injection.inject_operation} + where [contents] is {!Alpha_context.Single} [(Ballot {source; period = index; proposals})] + with [index] the result of {!Alpha_services.Voting.successor_period} *) +val submit_ballot : + ?dry_run:bool -> + ?verbose_signing:bool -> + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + src_sk:Client_keys.sk_uri -> + public_key_hash -> + Tezos_crypto.Protocol_hash.t -> + Vote.ballot -> + Kind.ballot Injection.result_list tzresult Lwt.t + +(** lookup an operation in [predecessors] previous blocks, and print the + receipt if found *) +val display_receipt_for_operation : + #Protocol_client_context.full -> + chain:Block_services.chain -> + ?predecessors:int -> + Tezos_crypto.Operation_list_hash.elt -> + unit tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Alpha_services.Cache.cached_contracts} *) +val cached_contracts : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + (Contract_hash.t * int) list tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Alpha_services.Cache.contract_rank} *) +val contract_rank : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + int option tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Alpha_services.Cache.contract_cache_size} *) +val contract_cache_size : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + int tzresult Lwt.t + +(** Calls {!Tezos_protocol_alpha.Protocol.Alpha_services.Cache.contract_cache_size_limit} *) +val contract_cache_size_limit : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + int tzresult Lwt.t + +val originate_tx_rollup : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_origination Kind.manager contents + * Kind.tx_rollup_origination Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_batch : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?burn_limit:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + content:string -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_submit_batch Kind.manager contents + * Kind.tx_rollup_submit_batch Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_commitment : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + level:Tx_rollup_level.t -> + inbox_merkle_root:Tx_rollup_inbox.Merkle.root -> + messages:Tx_rollup_message_result_hash.t list -> + predecessor:Tx_rollup_commitment_hash.t option -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_commit Kind.manager contents + * Kind.tx_rollup_commit Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_finalize_commitment : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_finalize_commitment Kind.manager contents + * Kind.tx_rollup_finalize_commitment Kind.manager + Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_remove_commitment : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_remove_commitment Kind.manager contents + * Kind.tx_rollup_remove_commitment Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_rejection : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + level:Tx_rollup_level.t -> + tx_rollup:Tx_rollup.t -> + message:Tx_rollup_message.t -> + message_position:int -> + message_path:Tx_rollup_inbox.Merkle.path -> + message_result_hash:Tx_rollup_message_result_hash.t -> + message_result_path:Tx_rollup_commitment.Merkle.path -> + previous_context_hash:Tezos_crypto.Context_hash.t -> + previous_withdraw_list_hash:Tx_rollup_withdraw_list_hash.t -> + previous_message_result_path:Tx_rollup_commitment.Merkle.path -> + proof:Tx_rollup_l2_proof.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_rejection Kind.manager contents + * Kind.tx_rollup_rejection Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val submit_tx_rollup_return_bond : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_return_bond Kind.manager contents + * Kind.tx_rollup_return_bond Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val tx_rollup_dispatch_tickets : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + level:Tx_rollup_level.t -> + context_hash:Tezos_crypto.Context_hash.t -> + message_position:int -> + message_result_path:Tx_rollup_commitment.Merkle.path -> + tickets_info:Tx_rollup_reveal.t list -> + tx_rollup:Tx_rollup.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.tx_rollup_dispatch_tickets Kind.manager contents + * Kind.tx_rollup_dispatch_tickets Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val transfer_ticket : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + contents:string -> + ty:string -> + ticketer:Contract.t -> + amount:Ticket_amount.t -> + destination:Contract.t -> + entrypoint:Entrypoint.t -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.transfer_ticket Kind.manager contents + * Kind.transfer_ticket Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_originate : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + kind:Sc_rollup.Kind.t -> + boot_sector:string -> + parameters_ty:Script.lazy_expr -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + ( Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_originate Kind.manager contents + * Kind.sc_rollup_originate Kind.manager Apply_results.contents_result, + tztrace ) + result + Lwt.t + +val sc_rollup_add_messages : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + messages:string list -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_add_messages Kind.manager contents + * Kind.sc_rollup_add_messages Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_cement : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + rollup:Alpha_context.Sc_rollup.t -> + commitment:Alpha_context.Sc_rollup.Commitment.Hash.t -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_cement Kind.manager contents + * Kind.sc_rollup_cement Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_publish : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + rollup:Alpha_context.Sc_rollup.t -> + commitment:Alpha_context.Sc_rollup.Commitment.t -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_publish Kind.manager contents + * Kind.sc_rollup_publish Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_execute_outbox_message : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + rollup:Sc_rollup.t -> + cemented_commitment:Sc_rollup.Commitment.Hash.t -> + output_proof:string -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + ( Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_execute_outbox_message Kind.manager contents + * Kind.sc_rollup_execute_outbox_message Kind.manager + Apply_results.contents_result, + tztrace ) + result + Lwt.t + +val sc_rollup_recover_bond : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.tez -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:Tezos_crypto.Signature.public_key_hash -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + sc_rollup:Sc_rollup.t -> + staker:public_key_hash -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_recover_bond Kind.manager contents + * Kind.sc_rollup_recover_bond Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_refute : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + rollup:Alpha_context.Sc_rollup.t -> + refutation:Alpha_context.Sc_rollup.Game.refutation option -> + opponent:Alpha_context.Sc_rollup.Staker.t -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_refute Kind.manager contents + * Kind.sc_rollup_refute Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val sc_rollup_timeout : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + rollup:Alpha_context.Sc_rollup.t -> + alice:Alpha_context.Sc_rollup.Staker.t -> + bob:Alpha_context.Sc_rollup.Staker.t -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Tezos_crypto.Operation_hash.t + * Kind.sc_rollup_timeout Kind.manager contents + * Kind.sc_rollup_timeout Kind.manager Apply_results.contents_result) + tzresult + Lwt.t + +val zk_rollup_originate : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + public_parameters:Environment.Plonk.public_parameters -> + circuits_info:[`Fee | `Private | `Public] Zk_rollup.Account.SMap.t -> + init_state:Bls12_381.Fr.t array -> + nb_ops:int -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + ( Tezos_crypto.Operation_hash.t + * Kind.zk_rollup_origination Kind.manager contents + * Kind.zk_rollup_origination Kind.manager Apply_results.contents_result, + tztrace ) + result + Lwt.t + +val zk_rollup_publish : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + zk_rollup:Zk_rollup.t -> + ops:(Zk_rollup.Operation.t * Zk_rollup.Ticket.t option) list -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + ( Tezos_crypto.Operation_hash.t + * Kind.zk_rollup_publish Kind.manager contents + * Kind.zk_rollup_publish Kind.manager Apply_results.contents_result, + tztrace ) + result + Lwt.t + +val zk_rollup_update : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + source:public_key_hash -> + zk_rollup:Zk_rollup.t -> + update:Zk_rollup.Update.t -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + ( Tezos_crypto.Operation_hash.t + * Kind.zk_rollup_update Kind.manager contents + * Kind.zk_rollup_update Kind.manager Apply_results.contents_result, + tztrace ) + result + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_contracts.ml b/src/proto_016_PtMumbai/lib_client/client_proto_contracts.ml new file mode 100644 index 000000000000..55ac47e920fc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_contracts.ml @@ -0,0 +1,206 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module ContractEntity = struct + include Contract (* t, Compare, encoding *) + + let of_source s = + Contract.of_b58check s |> Environment.wrap_tzresult + |> record_trace_eval (fun () -> error_of_fmt "bad contract notation") + |> Lwt.return + + let to_source s = return (Contract.to_b58check s) + + let name = "contract" +end + +module RawContractAlias = Client_aliases.Alias (ContractEntity) + +module OriginatedContractAlias = struct + let find cctxt s = + RawContractAlias.find_opt cctxt s >>=? function + | Some (Contract.Originated v) -> return v + | Some (Implicit _) -> failwith "contract %s is an implicit account" s + | None -> failwith "no contract named %s" s + + let of_literal s = + ContractEntity.of_source s >>= function + | Ok (Contract.Originated v) -> return v + | Ok (Implicit _) -> failwith "contract %s is an implicit account" s + | Error _ as err -> Lwt.return err + + let find_destination cctxt s = + match String.split ~limit:1 ':' s with + | ["alias"; alias] -> find cctxt alias + | ["text"; text] -> of_literal text + | _ -> ( + of_literal s >>= function + | Ok _ as ok_v -> Lwt.return ok_v + | Error k_errs -> ( + find cctxt s >|= function + | Ok _ as ok_v -> ok_v + | Error c_errs -> Error (c_errs @ k_errs))) + + let destination_parameter () = + Tezos_clic.parameter + ~autocomplete:RawContractAlias.autocomplete + find_destination + + let destination_param ?(name = "dst") ?(desc = "destination contract") next = + let desc = + String.concat + "\n" + [ + desc; + "Can be a literal or an alias (autodetected in order).\n\ + Use 'text:literal' or 'alias:name' to force."; + ] + in + Tezos_clic.param ~name ~desc (destination_parameter ()) next + + let destination_arg ?(name = "dst") ?(doc = "destination contract") () = + let doc = + String.concat + "\n" + [ + doc; + "Can be a literal or an alias (autodetected in order).\n\ + Use 'text:literal' or 'alias:name' to force."; + ] + in + Tezos_clic.arg ~long:name ~doc ~placeholder:name (destination_parameter ()) +end + +module ContractAlias = struct + let find cctxt s = + RawContractAlias.find_opt cctxt s >>=? function + | Some v -> return v + | None -> ( + Client_keys.Public_key_hash.find_opt cctxt s >>=? function + | Some v -> return (Contract.Implicit v) + | None -> failwith "no contract or key named %s" s) + + let find_key cctxt name = + Client_keys.Public_key_hash.find cctxt name >>=? fun v -> + return (Contract.Implicit v) + + let rev_find cctxt (c : Contract.t) = + match c with + | Implicit hash -> ( + Client_keys.Public_key_hash.rev_find cctxt hash >>=? function + | Some name -> return_some ("key:" ^ name) + | None -> return_none) + | Originated _ -> RawContractAlias.rev_find cctxt c + + let get_contract cctxt s = + match String.split ~limit:1 ':' s with + | ["key"; key] -> find_key cctxt key + | _ -> find cctxt s + + let autocomplete cctxt = + Client_keys.Public_key_hash.autocomplete cctxt >>=? fun keys -> + RawContractAlias.autocomplete cctxt >>=? fun contracts -> + return (List.map (( ^ ) "key:") keys @ contracts) + + let alias_param ?(name = "name") ?(desc = "existing contract alias") next = + let desc = + desc ^ "\n" + ^ "Can be a contract alias or a key alias (autodetected in order).\n\ + Use 'key:name' to force the later." + in + Tezos_clic.(param ~name ~desc (parameter ~autocomplete get_contract) next) + + let find_destination cctxt s = + match String.split ~limit:1 ':' s with + | ["alias"; alias] -> find cctxt alias + | ["key"; text] -> + Client_keys.Public_key_hash.find cctxt text >>=? fun v -> + return (Contract.Implicit v) + | ["text"; text] -> ContractEntity.of_source text + | _ -> ( + ContractEntity.of_source s >>= function + | Ok v -> return v + | Error c_errs -> ( + find cctxt s >>= function + | Ok v -> return v + | Error k_errs -> Lwt.return_error (c_errs @ k_errs))) + + let destination_parameter () = + Tezos_clic.parameter + ~autocomplete:(fun cctxt -> + autocomplete cctxt >>=? fun list1 -> + Client_keys.Public_key_hash.autocomplete cctxt >>=? fun list2 -> + return (list1 @ list2)) + find_destination + + let destination_param ?(name = "dst") ?(desc = "destination contract") next = + let desc = + String.concat + "\n" + [ + desc; + "Can be a literal, an alias, or a key (autodetected in order).\n\ + Use 'text:literal', 'alias:name', 'key:name' to force."; + ] + in + Tezos_clic.param ~name ~desc (destination_parameter ()) next + + let destination_arg ?(name = "dst") ?(doc = "destination contract") () = + let doc = + String.concat + "\n" + [ + doc; + "Can be a literal, an alias, or a key (autodetected in order).\n\ + Use 'text:literal', 'alias:name', 'key:name' to force."; + ] + in + Tezos_clic.arg ~long:name ~doc ~placeholder:name (destination_parameter ()) + + let name cctxt contract = + rev_find cctxt contract >>=? function + | None -> return (Contract.to_b58check contract) + | Some name -> return name +end + +let list_contracts cctxt = + RawContractAlias.load cctxt >>=? fun raw_contracts -> + let contracts = List.map (fun (n, v) -> ("", n, v)) raw_contracts in + Client_keys.Public_key_hash.load cctxt >>=? fun keys -> + (* List accounts (implicit contracts of identities) *) + List.map_es + (fun (n, v) -> + RawContractAlias.mem cctxt n >>=? fun mem -> + let p = if mem then "key:" else "" in + let v' = Contract.Implicit v in + return (p, n, v')) + keys + >>=? fun accounts -> return (contracts @ accounts) + +let get_delegate cctxt ~chain ~block source = + Alpha_services.Contract.delegate_opt cctxt (chain, block) source diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_contracts.mli b/src/proto_016_PtMumbai/lib_client/client_proto_contracts.mli new file mode 100644 index 000000000000..5417518ca4b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_contracts.mli @@ -0,0 +1,96 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module RawContractAlias : Client_aliases.Alias with type t = Contract.t + +(** Like [ContractAlias] below but restricted to originated contracts. *) +module OriginatedContractAlias : sig + val find_destination : + #Client_context.wallet -> string -> Contract_hash.t tzresult Lwt.t + + val destination_param : + ?name:string -> + ?desc:string -> + ('a, (#Client_context.wallet as 'wallet)) Tezos_clic.params -> + (Contract_hash.t -> 'a, 'wallet) Tezos_clic.params + + val destination_arg : + ?name:string -> + ?doc:string -> + unit -> + (Contract_hash.t option, #Client_context.wallet) Tezos_clic.arg +end + +module ContractAlias : sig + val get_contract : + #Client_context.wallet -> string -> Contract.t tzresult Lwt.t + + val alias_param : + ?name:string -> + ?desc:string -> + ('a, (#Client_context.wallet as 'wallet)) Tezos_clic.params -> + (Contract.t -> 'a, 'wallet) Tezos_clic.params + + val find_destination : + #Client_context.wallet -> string -> Contract.t tzresult Lwt.t + + val destination_param : + ?name:string -> + ?desc:string -> + ('a, (#Client_context.wallet as 'wallet)) Tezos_clic.params -> + (Contract.t -> 'a, 'wallet) Tezos_clic.params + + val destination_arg : + ?name:string -> + ?doc:string -> + unit -> + (Contract.t option, #Client_context.wallet) Tezos_clic.arg + + val rev_find : + #Client_context.wallet -> Contract.t -> string option tzresult Lwt.t + + val name : #Client_context.wallet -> Contract.t -> string tzresult Lwt.t + + val autocomplete : #Client_context.wallet -> string list tzresult Lwt.t +end + +(** [list_contracts cctxt] returns the concatenation of [contracts] and [accounts] + where [contracts] is the result of [RawContractAlias.load cctxt] + and [accounts] the list of accounts (implicit contracts of identities) +*) +val list_contracts : + #Client_context.wallet -> + (string * string * RawContractAlias.t) list tzresult Lwt.t + +(** Calls {!Alpha_services.Contract.delegate_opt} *) +val get_delegate : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract.t -> + public_key_hash option tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_fa12.ml b/src/proto_016_PtMumbai/lib_client/client_proto_fa12.ml new file mode 100644 index 000000000000..32a02bcda9a5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_fa12.ml @@ -0,0 +1,986 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context +open Tezos_micheline + +type error += Contract_has_no_script of Contract_hash.t + +type error += Contract_has_no_storage of Contract.t + +type error += Entrypoint_mismatch of string * (Script.expr * Script.expr) option + +type error += Action_unwrapping_error of string * Script.expr + +type error += Not_a_viewable_entrypoint of Entrypoint.t + +type error += Not_an_entrypoint of Script.expr + +type error += Not_enough_balance of Z.t * Z.t + +type error += Not_enough_allowance of Z.t * Z.t + +type error += Unsafe_allowance_change of Z.t + +type error += Unexpected_error of Script.location * Script.expr + +let entrypoint_mismatch_explanation ppf (name, ty) = + match ty with + | None -> Format.fprintf ppf "Entrypoint %s is missing" name + | Some (ty, expected) -> + Format.fprintf + ppf + "Entrypoint \"%s\" has type @[%a@], but should have type @[%a@]" + name + Michelson_v1_printer.print_expr + ty + Michelson_v1_printer.print_expr + expected + +let () = + register_error_kind + `Permanent + ~id:"fa12ContractHasNoScript" + ~title:"The given contract is not a smart contract" + ~description:"An FA1.2 command has referenced a scriptless contract." + ~pp:(fun ppf contract -> + Format.fprintf + ppf + "Contract %a is not a smart contract, it has no script." + Contract_hash.pp + contract) + Data_encoding.(obj1 (req "contract" Contract.originated_encoding)) + (function Contract_has_no_script c -> Some c | _ -> None) + (fun c -> Contract_has_no_script c) ; + register_error_kind + `Permanent + ~id:"fa12ContractHasNoStorage" + ~title:"The given contract has no storage" + ~description: + "An FA1.2 command made a call on a contract that has no storage." + ~pp:(fun ppf contract -> + Format.fprintf ppf "Contract %a has no storage." Contract.pp contract) + Data_encoding.(obj1 (req "contract" Contract.encoding)) + (function Contract_has_no_storage c -> Some c | _ -> None) + (fun c -> Contract_has_no_storage c) ; + register_error_kind + `Permanent + ~id:"entrypointMismatch" + ~title:"The given contract does not implement the FA1.2 interface" + ~description: + "An FA1.2 command has referenced a smart contract whose script does not \ + implement at least one FA1.2 entrypoint, or with an incompatible type. \ + See TZIP-7 \ + (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-7/tzip-7.md) \ + for documentation on FA1.2." + ~pp:(fun ppf (name, ty) -> + Format.fprintf + ppf + "Not a supported FA1.2 contract.@\n%a." + entrypoint_mismatch_explanation + (name, ty)) + Data_encoding.( + obj2 + (req "name" string) + (req "type" (option (tup2 Script.expr_encoding Script.expr_encoding)))) + (function Entrypoint_mismatch (n, t) -> Some (n, t) | _ -> None) + (fun (n, t) -> Entrypoint_mismatch (n, t)) ; + register_error_kind + `Permanent + ~id:"actionUnwrappingError" + ~title:"The argument is not for an FA1.2 parameter" + ~description: + "The argument's type does not correspond to that of the corresponding \ + FA1.2 entrypoint." + ~pp:(fun ppf (entrypoint, expr) -> + Format.fprintf + ppf + "Not a supported FA1.2 entrypoint argument.@\nEntrypoint: %s@\n%a." + entrypoint + Michelson_v1_printer.print_expr + expr) + Data_encoding.( + obj2 (req "entrypoint" string) (req "expr" Script.expr_encoding)) + (function Action_unwrapping_error (s, e) -> Some (s, e) | _ -> None) + (fun (s, e) -> Action_unwrapping_error (s, e)) ; + register_error_kind + `Permanent + ~id:"notAViewableEntrypoint" + ~title:"The entrypoint is not viewable" + ~description: + "A transaction made a call on an entrypoint expecting it to implement \ + the 'view' type." + ~pp:(fun ppf entrypoint -> + Format.fprintf + ppf + "Entrypoint %a is not viewable." + Entrypoint.pp + entrypoint) + Data_encoding.(obj1 (req "entrypoint" Entrypoint.simple_encoding)) + (function Not_a_viewable_entrypoint e -> Some e | _ -> None) + (fun e -> Not_a_viewable_entrypoint e) ; + register_error_kind + `Permanent + ~id:"notAnEntrypoint" + ~title:"The expression is not for an entrypoint" + ~description: + "The parameter value of the contract call refers to a non-existing \ + entrypoint." + ~pp:(fun ppf param -> + Format.fprintf + ppf + "Not a parameter for an entrypoint.@\n%a." + Michelson_v1_printer.print_expr + param) + Data_encoding.(obj1 (req "param" Script.expr_encoding)) + (function Not_an_entrypoint e -> Some e | _ -> None) + (fun e -> Not_an_entrypoint e) ; + register_error_kind + `Permanent + ~id:"notEnoughBalance" + ~title:"The sender does not have enough balance" + ~description: + "An FA1.2 transfer failed because the sender does not have enough \ + balance." + ~pp:(fun ppf (required, present) -> + Format.fprintf + ppf + "Not enough balance.@\nRequired: %a.@\nPresent: %a." + Z.pp_print + required + Z.pp_print + present) + Data_encoding.(obj2 (req "present" n) (req "required" n)) + (function Not_enough_balance (p, r) -> Some (p, r) | _ -> None) + (fun (p, r) -> Not_enough_balance (p, r)) ; + register_error_kind + `Permanent + ~id:"notEnoughAllowance" + ~title:"The sender does not have enough allowance" + ~description: + "An FA1.2 transfer failed because the receiver does not have enough \ + allowance to ask for a transfer from the sender." + ~pp:(fun ppf (required, present) -> + Format.fprintf + ppf + "Not enough allowance.@\nRequired: %a.@\nPresent: %a." + Z.pp_print + required + Z.pp_print + present) + Data_encoding.(obj2 (req "present" n) (req "required" n)) + (function Not_enough_allowance (p, r) -> Some (p, r) | _ -> None) + (fun (p, r) -> Not_enough_allowance (p, r)) ; + register_error_kind + `Permanent + ~id:"unsafeAllowanceChange" + ~title:"The allowance change is unsafe" + ~description: + "An FA1.2 non-zero allowance change failed because the current allowance \ + is non-zero. For more explanation on why such allowance change is \ + unsafe, please look at TZIP-7 \ + (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-7/tzip-7.md#approve)." + ~pp:(fun ppf previous -> + Format.fprintf + ppf + "Unsafe allowance change@\nPrevious: %a." + Z.pp_print + previous) + Data_encoding.(obj1 (req "previous" n)) + (function Unsafe_allowance_change p -> Some p | _ -> None) + (fun p -> Unsafe_allowance_change p) ; + register_error_kind + `Permanent + ~id:"fa12UnexpectedError" + ~title:"Unexpected error during FA1.2 contract interpretation" + ~description: + "An unexpected Michelson error was reached during the interpretation of \ + an FA1.2 contract." + ~pp:(fun ppf (loc, expr) -> + Format.fprintf + ppf + "An unexpected error was reached at location %d with: %a." + loc + Michelson_v1_printer.print_expr + expr) + Data_encoding.( + obj2 + (req "location" Script.location_encoding) + (req "value" Script.expr_encoding)) + (function Unexpected_error (loc, expr) -> Some (loc, expr) | _ -> None) + (fun (loc, expr) -> Unexpected_error (loc, expr)) + +let callback_encoding = + Data_encoding.( + conv + (fun (c, e) -> (c, Option.value ~default:"" e)) + (fun (c, e) -> (c, if String.equal e "" then None else Some e)) + (tup2 Contract.encoding Variable.string)) + +(** Michelson combinators *) + +let pair ~loc a b = Micheline.Prim (loc, Script.D_Pair, [a; b], []) + +let nat ~loc i = Micheline.Int (loc, i) + +let unit ~loc = Micheline.Prim (loc, Script.D_Unit, [], []) + +let bytes ~loc b = Micheline.Bytes (loc, b) + +let address ~loc addr = + bytes ~loc (Data_encoding.Binary.to_bytes_exn Contract.encoding addr) + +let callback ~loc ?entrypoint addr = + bytes + ~loc + (Data_encoding.Binary.to_bytes_exn callback_encoding (addr, entrypoint)) + +(** Types *) + +(** Michelson type combinators: produce a Michelson node of the + expected type, and a function to check another node is + syntactically equivalent. *) +type type_eq_combinator = Script.node * (Script.node -> bool) + +(** [t_pair ~loc l] takes a list of types and respective equivalence + check functions, and returns a type of n-ary pair of such types and + a function checking syntactical equivalence with another node. *) +let t_pair ~loc l : type_eq_combinator = + let values, are_ty = List.split l in + let is_pair p = + match p with + | Micheline.Prim (_, Script.T_pair, l, _) -> ( + let res = + List.for_all2 + ~when_different_lengths:() + (fun is_ty v -> is_ty v) + are_ty + l + in + match res with Ok b -> b | Error () -> false) + | _ -> false + in + (Micheline.Prim (loc, Script.T_pair, values, []), is_pair) + +(** [t_unit ~loc] returns a Micheline node for the `unit` type, and + a function checking another node is syntactically equivalent. *) +let t_unit ~loc : type_eq_combinator = + let is_unit p = + match p with Micheline.Prim (_, Script.T_unit, [], _) -> true | _ -> false + in + (Micheline.Prim (loc, Script.T_unit, [], []), is_unit) + +(** [t_nat ~loc] returns a Micheline node for the `nat` type, and + a function checking another node is syntactically equivalent. *) +let t_nat ~loc : type_eq_combinator = + let is_nat p = + match p with Micheline.Prim (_, Script.T_nat, [], _) -> true | _ -> false + in + (Micheline.Prim (loc, Script.T_nat, [], []), is_nat) + +(** [t_address ~loc] returns a Micheline node for the `address` + type, and a function checking another node is syntactically + equivalent. *) +let t_address ~loc : type_eq_combinator = + let is_address p = + match p with + | Micheline.Prim (_, Script.T_address, [], _) -> true + | _ -> false + in + (Micheline.Prim (loc, Script.T_address, [], []), is_address) + +(** [t_contract ~loc (c, is_c)] takes a node representing a Michelson + type and its own syntactical equivalence checker, and returns a + Micheline node for the type `contract c`, and a function checking + another node is syntactically equivalent. *) +let t_contract ~loc (a, is_a) : type_eq_combinator = + let is_contract c = + match c with + | Micheline.Prim (_, Script.T_contract, [a], _) -> is_a a + | _ -> false + in + (Micheline.Prim (loc, Script.T_contract, [a], []), is_contract) + +(** [t_view ~loc a b] takes two node [a] and [b] and their syntactical + equivalence checking functions, and returns a Micheline node for + the `view a b` type, and a function checking another node is + syntactically equivalent. The view type is defined by + [TZIP4](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-4/tzip-4.md). + *) +let t_view ~loc a b : type_eq_combinator = t_pair ~loc [a; t_contract ~loc b] + +(** * Actions *) + +(** Corresponds to + [TZIP7](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-7/tzip-7.md) + entrypoints. *) + +(** A callback from a view can be on a specific entrypoint of the + contract, or the default one if not specified. *) +type callback_contract = Contract.t * string option + +type action = + | Transfer of Contract.t * Contract.t * Z.t + | Approve of Contract.t * Z.t + | Get_allowance of Contract.t * Contract.t * callback_contract + | Get_balance of Contract.t * callback_contract + | Get_total_supply of callback_contract + +let print_callback_contract ppf (c, etp) = + Format.fprintf + ppf + "%a%s" + Contract.pp + c + (match etp with None | Some "" -> "" | Some etp -> "%" ^ etp) + +let print_action ppf = function + | Transfer (src, dst, amount) -> + Format.fprintf + ppf + "Transfer (%a, %a, %a)" + Contract.pp + src + Contract.pp + dst + Z.pp_print + amount + | Approve (addr, amount) -> + Format.fprintf ppf "Approve (%a, %a)" Contract.pp addr Z.pp_print amount + | Get_allowance (src, dst, callback) -> + Format.fprintf + ppf + "Get_allowance (%a, %a, %a)" + Contract.pp + src + Contract.pp + dst + print_callback_contract + callback + | Get_balance (addr, callback) -> + Format.fprintf + ppf + "Get_balance (%a, %a)" + Contract.pp + addr + print_callback_contract + callback + | Get_total_supply callback -> + Format.fprintf + ppf + "Get_total_supply (%a)" + print_callback_contract + callback + +let transfer_encoding = + Data_encoding.( + case + ~title:"transfer" + (Tag 0) + (obj3 + (req "transfer_source" Contract.encoding) + (req "transfer_destination" Contract.encoding) + (req "transfer_amount" n)) + (function + | Transfer (src, dst, amount) -> Some (src, dst, amount) | _ -> None) + (fun (src, dst, amount) -> Transfer (src, dst, amount))) + +let approve_encoding = + Data_encoding.( + case + ~title:"approve" + (Tag 1) + (obj2 (req "approve_address" Contract.encoding) (req "approve_amount" n)) + (function Approve (addr, amount) -> Some (addr, amount) | _ -> None) + (fun (addr, amount) -> Approve (addr, amount))) + +let getBalance_encoding = + Data_encoding.( + case + ~title:"getBalance" + (Tag 2) + (obj2 + (req "getBalance_address" Contract.encoding) + (req "getBalance_callback" callback_encoding)) + (function + | Get_balance (addr, callback) -> Some (addr, callback) | _ -> None) + (fun (addr, callback) -> Get_balance (addr, callback))) + +let getAllowance_encoding = + Data_encoding.( + case + ~title:"getAllowance" + (Tag 3) + (obj3 + (req "getAllowance_source" Contract.encoding) + (req "getAllowance_destination" Contract.encoding) + (req "getAllowance_callback" callback_encoding)) + (function + | Get_allowance (src, dst, callback) -> Some (src, dst, callback) + | _ -> None) + (fun (src, dst, callback) -> Get_allowance (src, dst, callback))) + +let getTotalSupply_encoding = + Data_encoding.( + case + ~title:"getTotalSupply" + (Tag 4) + (obj1 (req "getTotalSupply_callback" callback_encoding)) + (function Get_total_supply callback -> Some callback | _ -> None) + (fun callback -> Get_total_supply callback)) + +let action_encoding = + Data_encoding.union + [ + transfer_encoding; + approve_encoding; + getBalance_encoding; + getAllowance_encoding; + getTotalSupply_encoding; + ] + +let transfer_type ~loc = + t_pair ~loc [t_address ~loc; t_address ~loc; t_nat ~loc] + +let approve_type ~loc = t_pair ~loc [t_address ~loc; t_nat ~loc] + +let getAllowance_type ~loc = + t_view ~loc (t_pair ~loc [t_address ~loc; t_address ~loc]) (t_nat ~loc) + +let getBalance_type ~loc = t_view ~loc (t_address ~loc) (t_nat ~loc) + +let getTotalSupply_type ~loc = t_view ~loc (t_unit ~loc) (t_nat ~loc) + +let standard_entrypoints = + let loc = -1 in + [ + ("transfer", transfer_type ~loc); + ("approve", approve_type ~loc); + ("getAllowance", getAllowance_type ~loc); + ("getBalance", getBalance_type ~loc); + ("getTotalSupply", getTotalSupply_type ~loc); + ] + +let view_input ~loc action = + match action with + | Get_allowance (source, destination, _) -> + pair ~loc (address ~loc source) (address ~loc destination) + | Get_balance (addr, _) -> address ~loc addr + | Get_total_supply _ -> unit ~loc + | _ -> unit ~loc + +let action_to_expr ~loc action = + match action with + | Transfer (source, destination, amount) -> + pair + ~loc + (address ~loc source) + (pair ~loc (address ~loc destination) (nat ~loc amount)) + | Approve (addr, amount) -> pair ~loc (address ~loc addr) (nat ~loc amount) + | Get_allowance (_, _, (cb, entrypoint)) -> + let input = view_input ~loc action in + pair ~loc input (callback ~loc ?entrypoint cb) + | Get_balance (_, (cb, entrypoint)) -> + let input = view_input ~loc action in + pair ~loc input (callback ~loc ?entrypoint cb) + | Get_total_supply (cb, entrypoint) -> + let input = view_input ~loc action in + pair ~loc input (callback ~loc ?entrypoint cb) + +let parse_address error = function + | Micheline.Bytes (_, b) -> + ok @@ Data_encoding.Binary.of_bytes_exn Contract.encoding b + | String (_, s) -> ( + match Contract.of_b58check s with Ok c -> ok c | Error _ -> error ()) + | _ -> error () + +let parse_callback error expr = + let of_b58_check (c, entrypoint) = + match Contract.of_b58check c with + | Ok c -> ok (c, entrypoint) + | Error _ -> error () + in + match expr with + | Micheline.Bytes (_, b) -> ( + match Data_encoding.Binary.of_bytes callback_encoding b with + | Ok (c, entrypoint) -> ok (c, entrypoint) + | Error _ -> error ()) + | String (_, s) -> ( + match String.index_opt s '%' with + | None -> of_b58_check (s, None) + | Some pos -> ( + let len = String.length s - pos - 1 in + let name = String.sub s (pos + 1) len in + match (String.sub s 0 pos, name) with + | addr, "default" -> of_b58_check (addr, None) + | addr, name -> of_b58_check (addr, Some name))) + | _ -> error () + +let action_of_expr ~entrypoint expr = + let open Micheline in + let error () = + error (Action_unwrapping_error (entrypoint, Micheline.strip_locations expr)) + in + match (entrypoint, expr) with + (* Transfer operation before comb pairs. *) + | ( "transfer", + Prim + ( _, + Script.D_Pair, + [ + ((Bytes (_, _) | String (_, _)) as source); + Prim + ( _, + Script.D_Pair, + [ + ((Bytes (_, _) | String (_, _)) as destination); + Int (_, amount); + ], + _ ); + ], + _ ) ) + (* Transfer operation since Edo comb pairs are now directly interpreted as a + tuple of 3 elements instead of a pair inside a pair. *) + | ( "transfer", + Prim + ( _, + Script.D_Pair, + [ + ((Bytes (_, _) | String (_, _)) as source); + ((Bytes (_, _) | String (_, _)) as destination); + Int (_, amount); + ], + _ ) ) -> + parse_address error source >>? fun source -> + parse_address error destination >>? fun destination -> + ok (Transfer (source, destination, amount)) + | ( "approve", + Prim + ( _, + Script.D_Pair, + [((Bytes (_, _) | String (_, _)) as addr); Int (_, amount)], + _ ) ) -> + parse_address error addr >>? fun addr -> ok (Approve (addr, amount)) + | ( "getBalance", + Prim + ( _, + Script.D_Pair, + [ + ((Bytes (_, _) | String (_, _)) as addr); + ((Bytes (_, _) | String (_, _)) as cb); + ], + _ ) ) -> + parse_address error addr >>? fun addr -> + parse_callback error cb >>? fun callback -> + ok (Get_balance (addr, callback)) + | ( "getAllowance", + Prim + ( _, + Script.D_Pair, + [ + Prim + ( _, + Script.D_Pair, + [ + ((Bytes (_, _) | String (_, _)) as source); + ((Bytes (_, _) | String (_, _)) as destination); + ], + _ ); + ((Bytes (_, _) | String (_, _)) as contract); + ], + _ ) ) -> + parse_address error source >>? fun source -> + parse_address error destination >>? fun destination -> + parse_callback error contract >>? fun callback -> + ok (Get_allowance (source, destination, callback)) + | ( "getTotalSupply", + Prim + ( _, + Script.D_Pair, + [ + Prim (_, Script.D_Unit, [], _); + ((Bytes (_, _) | String (_, _)) as contract); + ], + _ ) ) -> + parse_callback error contract >>? fun callback -> + ok (Get_total_supply callback) + | _ -> error () + +let find_entrypoint_in_annot error annots expr = + match List.find_opt (fun annot -> annot.[0] = '%') annots with + | Some entrypoint -> + action_of_expr + ~entrypoint:(String.sub entrypoint 1 (String.length entrypoint - 1)) + expr + | None -> error () + +let derive_action expr t_param = + let error () = error (Not_an_entrypoint (Micheline.strip_locations expr)) in + let rec derive expr t_param = + match (expr, t_param) with + | ( Micheline.Prim (_, Script.D_Left, [left], _), + Micheline.Prim (_, Script.T_or, [t_left; _], _) ) -> + derive left t_left + | ( Micheline.Prim (_, Script.D_Right, [right], _), + Micheline.Prim (_, Script.T_or, [_; t_right], _) ) -> + derive right t_right + | _, Micheline.Prim (_, _, _, annots) -> + find_entrypoint_in_annot error annots expr + | _ -> error () + in + derive expr t_param + +let extract_parameter contract = function + | Micheline.Seq (_, l) -> ( + List.filter_map + (function + | Micheline.Prim (_, Script.K_parameter, [param], _) -> Some param + | _ -> None) + l + |> function + | param :: _ -> ok param + | _ -> error (Contract_has_no_script contract)) + | _ -> error (Contract_has_no_script contract) + +let get_contract_parameter cctxt ~chain ~block contract = + Client_proto_context.get_script + cctxt + ~chain + ~block + contract + ~unparsing_mode:Optimized + ~normalize_types:true + >>=? function + | None -> fail (Contract_has_no_script contract) + | Some {code; _} -> ( + match Script_repr.force_decode code with + | Error _ -> fail (Contract_has_no_script contract) + | Ok code -> Lwt.return (extract_parameter contract (Micheline.root code)) + ) + +let convert_wrapped_parameter_into_action cctxt ~chain ~block contract param = + get_contract_parameter cctxt ~chain ~block contract >>=? fun parameter -> + Lwt.return (derive_action param parameter) + +let check_entrypoint entrypoints (name, (expected_ty, check)) = + match List.assoc_opt ~equal:String.equal name entrypoints with + | None -> error (Entrypoint_mismatch (name, None)) + | Some ty -> + if not (check (Micheline.root ty)) then + error + (Entrypoint_mismatch + (name, Some (ty, Micheline.strip_locations expected_ty))) + else Ok () + +let action_to_entrypoint = + let transfer = Entrypoint.of_string_strict_exn "transfer" in + let approve = Entrypoint.of_string_strict_exn "approve" in + let get_allowance = Entrypoint.of_string_strict_exn "getAllowance" in + let get_balance = Entrypoint.of_string_strict_exn "getBalance" in + let get_total_supply = Entrypoint.of_string_strict_exn "getTotalSupply" in + function + | Transfer (_, _, _) -> transfer + | Approve (_, _) -> approve + | Get_allowance (_, _, _) -> get_allowance + | Get_balance (_, _) -> get_balance + | Get_total_supply _ -> get_total_supply + +let contract_has_fa12_interface : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + contract:Contract_hash.t -> + unit -> + unit tzresult Lwt.t = + fun cctxt ~chain ~block ~contract () -> + Michelson_v1_entrypoints.list_contract_entrypoints + cctxt + ~chain + ~block + ~contract + ~normalize_types:true + >>=? fun entrypoints -> + List.iter_e (check_entrypoint entrypoints) standard_entrypoints |> Lwt.return + +let translate_action_to_argument action = + let entrypoint = action_to_entrypoint action in + let expr = + Micheline.strip_locations (action_to_expr ~loc:() action) + |> Script.lazy_expr + in + (entrypoint, expr) + +let parse_error = + let open Micheline in + function + | ( "NotEnoughBalance", + Prim (_, Script.D_Pair, [Int (_, required); Int (_, present)], _) ) -> + Some (Not_enough_balance (required, present)) + | ( "NotEnoughAllowance", + Prim (_, Script.D_Pair, [Int (_, required); Int (_, present)], _) ) -> + Some (Not_enough_allowance (required, present)) + | "UnsafeAllowanceChange", Int (_, previous) -> + Some (Unsafe_allowance_change previous) + | _ -> None + +let extract_error trace = + let open Micheline in + TzTrace.fold + (fun _ error -> + match error with + | Environment.Ecoproto_error (Script_interpreter.Reject (loc, param, _)) + -> ( + match root param with + | Prim (_, Script.D_Pair, [String (_, error); res], _) -> + parse_error (error, res) + | _ -> Some (Unexpected_error (loc, param))) + | _ -> None) + None + trace + +let call_contract (cctxt : #Protocol_client_context.full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?branch ~source ~src_pk ~src_sk + ~contract ~action ~tez_amount ?fee ?gas_limit ?storage_limit ?counter + ~fee_parameter () = + contract_has_fa12_interface cctxt ~chain ~block ~contract () >>=? fun () -> + let entrypoint, parameters = translate_action_to_argument action in + Client_proto_context.transfer_with_script + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?branch + ~source + ~src_pk + ~src_sk + ~destination:(Originated contract) + ~parameters + ~amount:tez_amount + ~entrypoint + ?fee + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + ?verbose_signing + () + >>= function + | Ok res -> return res + | Error trace -> ( + match extract_error trace with + | None -> Lwt.return (Error trace) + | Some error -> fail error) + +type token_transfer = { + token_contract : string; + destination : string; + amount : Z.t; + tez_amount : string option; + fee : string option; + gas_limit : Gas.Arith.integral option; + storage_limit : Z.t option; +} + +let token_transfer_encoding = + let open Data_encoding in + conv + (fun { + token_contract; + destination; + amount; + tez_amount; + fee; + gas_limit; + storage_limit; + } -> + ( token_contract, + destination, + amount, + tez_amount, + fee, + gas_limit, + storage_limit )) + (fun ( token_contract, + destination, + amount, + tez_amount, + fee, + gas_limit, + storage_limit ) -> + { + token_contract; + destination; + amount; + tez_amount; + fee; + gas_limit; + storage_limit; + }) + (obj7 + (req "token_contract" string) + (req "destination" string) + (req "amount" z) + (opt "tez-amount" string) + (opt "fee" string) + (opt "gas-limit" Gas.Arith.n_integral_encoding) + (opt "storage-limit" z)) + +let tez_of_string_exn index field s = + match Tez.of_string s with + | Some t -> ok t + | None -> + error_with + "Invalid %s notation at entry %i, field \"%s\": %s" + Operation_result.tez_sym + index + field + s + +let tez_of_opt_string_exn index field s = + Option.map_e (tez_of_string_exn index field) s + +let build_transaction_operation ?(tez_amount = Tez.zero) ?fee ?gas_limit + ?storage_limit token action = + let entrypoint = action_to_entrypoint action in + let parameters = + Script.lazy_expr (Micheline.strip_locations (action_to_expr ~loc:() action)) + in + let operation = + Transaction + {amount = tez_amount; parameters; destination = token; entrypoint} + in + Injection.prepare_manager_operation + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + operation + +let prepare_single_token_transfer cctxt ?default_fee ?default_gas_limit + ?default_storage_limit ~chain ~block src index transfer = + Client_proto_contracts.OriginatedContractAlias.find_destination + cctxt + transfer.token_contract + >>=? fun token -> + contract_has_fa12_interface cctxt ~chain ~block ~contract:token () + >>=? fun () -> + Client_proto_contracts.ContractAlias.find_destination + cctxt + transfer.destination + >>=? fun dest -> + tez_of_opt_string_exn index "tez_amount" transfer.tez_amount + >>?= fun tez_amount -> + tez_of_opt_string_exn index "fee" transfer.fee >>?= fun transfer_fee -> + let fee = Option.either transfer_fee default_fee in + let gas_limit = Option.either transfer.gas_limit default_gas_limit in + let storage_limit = + Option.either transfer.storage_limit default_storage_limit + in + let action = Transfer (src, dest, transfer.amount) in + let operation = + build_transaction_operation + ?tez_amount + ?fee + ?gas_limit + ?storage_limit + (Originated token) + action + in + return (Annotated_manager_operation.Annotated_manager_operation operation) + +let inject_token_transfer_batch (cctxt : #Protocol_client_context.full) ~chain + ~block ?confirmations ?dry_run ?verbose_signing ~sender ~source ~src_pk + ~src_sk ~token_transfers ~fee_parameter ?counter ?default_fee + ?default_gas_limit ?default_storage_limit () = + List.mapi_ep + (prepare_single_token_transfer + cctxt + ?default_fee + ?default_gas_limit + ?default_storage_limit + ~chain + ~block + sender) + token_transfers + >>=? fun contents -> + let (Manager_list contents) = + Annotated_manager_operation.manager_of_list contents + in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ~source + ~fee:(Limit.of_option default_fee) + ~gas_limit:(Limit.of_option default_gas_limit) + ~storage_limit:(Limit.of_option default_storage_limit) + ?counter + ~src_pk + ~src_sk + ~fee_parameter + contents + >>= function + | Ok _ -> return () + | Error trace -> ( + match extract_error trace with + | None -> Lwt.return (Error trace) + | Some error -> fail error) + +let is_viewable_action action = + match action with + | Get_balance (_, _) | Get_allowance (_, _, _) | Get_total_supply _ -> + return () + | _ -> fail (Not_a_viewable_entrypoint (action_to_entrypoint action)) + +let run_view_action (cctxt : #Protocol_client_context.full) ~chain ~block + ?source ~contract ~action ?payer ?gas ~unparsing_mode () = + is_viewable_action action >>=? fun () -> + contract_has_fa12_interface cctxt ~chain ~block ~contract () >>=? fun () -> + let entrypoint = action_to_entrypoint action in + let input = Micheline.strip_locations (view_input ~loc:() action) in + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + Plugin.RPC.Scripts.run_tzip4_view + cctxt + (chain, block) + ~contract + ~input + ~chain_id + ?source + ?payer + ?gas + ~entrypoint + ~unparsing_mode + ~now:None + ~level:None + +let () = + Data_encoding.( + Registration.register + @@ def (Protocol.name ^ ".fa1.2.token_transfer") token_transfer_encoding) diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_fa12.mli b/src/proto_016_PtMumbai/lib_client/client_proto_fa12.mli new file mode 100644 index 000000000000..8dccc6bbca64 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_fa12.mli @@ -0,0 +1,162 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [Client_proto_fa12] implements built-in support for the + {{:https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-7/tzip-7.md} + FA1.2} standard. This module features functions to check whether a + contract implements the standard interface and to interact with + such contracts using high-level [actions] that model the entrypoint + calls. + + This module also provides functions to unwrap [Micheline] values + into [actions], which can be useful for indexers or applications + using this module to interpret transactions on FA1.2 contracts as + FA1.2 operations. *) + +open Protocol +open Alpha_context +open Protocol_client_context + +(** A callback contract is represented by an address and a possible + entrypoint on which the transaction is done. *) +type callback_contract = Contract.t * string option + +type action = + | Transfer of Contract.t * Contract.t * Z.t + | Approve of Contract.t * Z.t + | Get_allowance of Contract.t * Contract.t * callback_contract + | Get_balance of Contract.t * callback_contract + | Get_total_supply of callback_contract + +val print_action : Format.formatter -> action -> unit + +val action_encoding : action Data_encoding.encoding + +val action_to_expr : + loc:'loc -> action -> ('loc, Script.prim) Tezos_micheline.Micheline.node + +val action_of_expr : + entrypoint:string -> + (_, Script.prim) Tezos_micheline.Micheline.node -> + action tzresult + +(** [convert_wrapped_parameter_into_action cctxt ~chain ~block + ~contract parameter] converts a wrapped FA1.2 contract [parameter] + into the corresponding FA1.2 [action]. + + That is, it takes a contract parameter on the form [C_1 .. (C_n + ... <entrypoint argument> ))] where [C_1 ... C_n] is a sequence of + [Left]/[Right] constructors. It finds the entrypoint corresponding + to that path in [contract]'s interface. The result of the function + is the [<entrypoint arguments>] applied to the [action] + corresponding to that entrypoint. *) +val convert_wrapped_parameter_into_action : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Contract_hash.t -> + Script.node -> + action tzresult Lwt.t + +(** Check whether a contract has an FA1.2 interface. *) +val contract_has_fa12_interface : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + contract:Contract_hash.t -> + unit -> + unit tzresult Lwt.t + +val call_contract : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?branch:int -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + contract:Contract_hash.t -> + action:action -> + tez_amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t + +(** Single transfer operation. *) +type token_transfer = { + token_contract : string; + destination : string; + amount : Z.t; + tez_amount : string option; + fee : string option; + gas_limit : Gas.Arith.integral option; + storage_limit : Z.t option; +} + +val token_transfer_encoding : token_transfer Data_encoding.t + +(** Inject a batch of token transfers. *) +val inject_token_transfer_batch : + full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + sender:Contract.t -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + token_transfers:token_transfer list -> + fee_parameter:Injection.fee_parameter -> + ?counter:Manager_counter.t -> + ?default_fee:Tez.t -> + ?default_gas_limit:Gas.Arith.integral -> + ?default_storage_limit:Z.t -> + unit -> + unit tzresult Lwt.t + +(** Run the action without injecting it. Only for views. *) +val run_view_action : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?source:Contract.t -> + contract:Contract_hash.t -> + action:action -> + ?payer:Tezos_crypto.Signature.public_key_hash -> + ?gas:Gas.Arith.integral -> + unparsing_mode:Script_ir_unparser.unparsing_mode -> + unit -> + Script.expr tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_multisig.ml b/src/proto_016_PtMumbai/lib_client/client_proto_multisig.ml new file mode 100644 index 000000000000..9d8d9e8e7f7e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_multisig.ml @@ -0,0 +1,1244 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context +open Michelson_v1_helpers + +type error += Contract_has_no_script of Contract_hash.t + +type error += Not_a_supported_multisig_contract of Script_expr_hash.t + +type error += Contract_has_no_storage of Contract_hash.t + +type error += Contract_has_unexpected_storage of Contract_hash.t + +type error += Invalid_signature of signature + +type error += Not_enough_signatures of int * int + +type error += Action_deserialisation_error of Script.expr + +type error += Bytes_deserialisation_error of Bytes.t + +type error += Bad_deserialized_contract of (Contract_hash.t * Contract_hash.t) + +type error += Bad_deserialized_counter of {received : Z.t; expected : Z.t} + +type error += Non_positive_threshold of int + +type error += Threshold_too_high of int * int + +type error += Unsupported_feature_generic_call of Script.expr + +type error += Unsupported_feature_generic_call_ty of Script.expr + +type error += Unsupported_feature_lambda of string + +type error += + | Ill_typed_argument of Contract.t * Entrypoint.t * Script.expr * Script.expr + +type error += Ill_typed_lambda of Script.expr * Script.expr + +let () = + register_error_kind + `Permanent + ~id:"contractHasNoScript" + ~title: + "The given contract is not a multisig contract because it has no script" + ~description: + "A multisig command has referenced a scriptless smart contract instead \ + of a multisig smart contract." + ~pp:(fun ppf contract -> + Format.fprintf ppf "Contract has no script %a." Contract_hash.pp contract) + Data_encoding.(obj1 (req "contract" Contract.originated_encoding)) + (function Contract_has_no_script c -> Some c | _ -> None) + (fun c -> Contract_has_no_script c) ; + register_error_kind + `Permanent + ~id:"notASupportedMultisigContract" + ~title:"The given contract is not one of the supported contracts" + ~description: + "A multisig command has referenced a smart contract whose script is not \ + one of the known multisig contract scripts." + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Not a supported multisig contract.@\n\ + The hash of this script is %a, it was not found among in the list of \ + known multisig script hashes." + Script_expr_hash.pp + hash) + Data_encoding.(obj1 (req "hash" Script_expr_hash.encoding)) + (function Not_a_supported_multisig_contract h -> Some h | _ -> None) + (fun h -> Not_a_supported_multisig_contract h) ; + register_error_kind + `Permanent + ~id:"contractHasNoStorage" + ~title: + "The given contract is not a multisig contract because it has no storage" + ~description: + "A multisig command has referenced a smart contract without storage \ + instead of a multisig smart contract." + ~pp:(fun ppf contract -> + Format.fprintf ppf "Contract has no storage %a." Contract_hash.pp contract) + Data_encoding.(obj1 (req "contract" Contract.originated_encoding)) + (function Contract_has_no_storage c -> Some c | _ -> None) + (fun c -> Contract_has_no_storage c) ; + register_error_kind + `Permanent + ~id:"contractHasUnexpectedStorage" + ~title: + "The storage of the given contract is not of the shape expected for a \ + multisig contract" + ~description: + "A multisig command has referenced a smart contract whose storage is of \ + a different shape than the expected one." + ~pp:(fun ppf contract -> + Format.fprintf + ppf + "Contract has unexpected storage %a." + Contract_hash.pp + contract) + Data_encoding.(obj1 (req "contract" Contract.originated_encoding)) + (function Contract_has_unexpected_storage c -> Some c | _ -> None) + (fun c -> Contract_has_unexpected_storage c) ; + register_error_kind + `Permanent + ~id:"invalidSignature" + ~title: + "The following signature did not match a public key in the given \ + multisig contract" + ~description: + "A signature was given for a multisig contract that matched none of the \ + public keys of the contract signers" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "Invalid signature %s." + (Tezos_crypto.Signature.to_b58check s)) + Data_encoding.( + obj1 (req "invalid_signature" Tezos_crypto.Signature.encoding)) + (function Invalid_signature s -> Some s | _ -> None) + (fun s -> Invalid_signature s) ; + register_error_kind + `Permanent + ~id:"notEnoughSignatures" + ~title:"Not enough signatures were provided for this multisig action" + ~description: + "To run an action on a multisig contract, you should provide at least as \ + many signatures as indicated by the threshold stored in the multisig \ + contract." + ~pp:(fun ppf (threshold, nsigs) -> + Format.fprintf + ppf + "Not enough signatures: only %d signatures were given but the \ + threshold is currently %d" + nsigs + threshold) + Data_encoding.(obj1 (req "threshold_nsigs" (tup2 int31 int31))) + (function + | Not_enough_signatures (threshold, nsigs) -> Some (threshold, nsigs) + | _ -> None) + (fun (threshold, nsigs) -> Not_enough_signatures (threshold, nsigs)) ; + register_error_kind + `Permanent + ~id:"actionDeserialisation" + ~title:"The expression is not a valid multisig action" + ~description: + "When trying to deserialise an action from a sequence of bytes, we got \ + an expression that does not correspond to a known multisig action" + ~pp:(fun ppf e -> + Format.fprintf + ppf + "Action deserialisation error %a." + Michelson_v1_printer.print_expr + e) + Data_encoding.(obj1 (req "expr" Script.expr_encoding)) + (function Action_deserialisation_error e -> Some e | _ -> None) + (fun e -> Action_deserialisation_error e) ; + register_error_kind + `Permanent + ~id:"bytesDeserialisation" + ~title:"The byte sequence is not a valid multisig action" + ~description: + "When trying to deserialise an action from a sequence of bytes, we got \ + an error" + ~pp:(fun ppf b -> + Format.fprintf ppf "Bytes deserialisation error %s." (Bytes.to_string b)) + Data_encoding.(obj1 (req "expr" bytes)) + (function Bytes_deserialisation_error b -> Some b | _ -> None) + (fun b -> Bytes_deserialisation_error b) ; + register_error_kind + `Permanent + ~id:"badDeserializedContract" + ~title:"The byte sequence is not for the given multisig contract" + ~description: + "When trying to deserialise an action from a sequence of bytes, we got \ + an action for another multisig contract" + ~pp:(fun ppf (received, expected) -> + Format.fprintf + ppf + "Bad deserialized contract, received %a expected %a." + Contract_hash.pp + received + Contract_hash.pp + expected) + Data_encoding.( + obj1 + (req + "received_expected" + (tup2 Contract.originated_encoding Contract.originated_encoding))) + (function Bad_deserialized_contract b -> Some b | _ -> None) + (fun b -> Bad_deserialized_contract b) ; + register_error_kind + `Permanent + ~id:"Bad deserialized counter" + ~title:"Deserialized counter does not match the stored one" + ~description: + "The byte sequence references a multisig counter that does not match the \ + one currently stored in the given multisig contract" + ~pp:(fun ppf (received, expected) -> + Format.fprintf + ppf + "Bad deserialized counter, received %d expected %d." + received + expected) + Data_encoding.(obj1 (req "received_expected" (tup2 int31 int31))) + (function + | Bad_deserialized_counter {received; expected} -> + Some (Z.to_int received, Z.to_int expected) + | _ -> None) + (fun (received, expected) -> + Bad_deserialized_counter + {received = Z.of_int received; expected = Z.of_int expected}) ; + register_error_kind + `Permanent + ~id:"thresholdTooHigh" + ~title:"Given threshold is too high" + ~description: + "The given threshold is higher than the number of keys, this would lead \ + to a frozen multisig contract" + ~pp:(fun ppf (threshold, nkeys) -> + Format.fprintf + ppf + "Threshold too high: %d expected at most %d." + threshold + nkeys) + Data_encoding.(obj1 (req "received_expected" (tup2 int31 int31))) + (function Threshold_too_high (c1, c2) -> Some (c1, c2) | _ -> None) + (fun (c1, c2) -> Threshold_too_high (c1, c2)) ; + register_error_kind + `Permanent + ~id:"nonPositiveThreshold" + ~title:"Given threshold is not positive" + ~description:"A multisig threshold should be a positive number" + ~pp:(fun ppf threshold -> + Format.fprintf ppf "Multisig threshold %d should be positive." threshold) + Data_encoding.(obj1 (req "threshold" int31)) + (function Non_positive_threshold t -> Some t | _ -> None) + (fun t -> Non_positive_threshold t) ; + register_error_kind + `Permanent + ~id:"unsupportedGenericMultisigFeature" + ~title:"Unsupported multisig feature: generic call" + ~description: + "This multisig contract does not feature calling contracts with arguments" + ~pp:(fun ppf arg -> + Format.fprintf + ppf + "This multisig contract can only transfer tokens to contracts of type \ + unit; calling a contract with argument %a is not supported." + Michelson_v1_printer.print_expr + arg) + Data_encoding.(obj1 (req "arg" Script.expr_encoding)) + (function Unsupported_feature_generic_call arg -> Some arg | _ -> None) + (fun arg -> Unsupported_feature_generic_call arg) ; + register_error_kind + `Permanent + ~id:"unsupportedGenericMultisigFeatureTy" + ~title:"Unsupported multisig feature: generic call to non-unit entrypoint" + ~description: + "This multisig contract does not feature calling contracts with arguments" + ~pp:(fun ppf ty -> + Format.fprintf + ppf + "This multisig contract can only transfer tokens to contracts of type \ + unit; calling a contract of type %a is not supported." + Michelson_v1_printer.print_expr + ty) + Data_encoding.(obj1 (req "ty" Script.expr_encoding)) + (function Unsupported_feature_generic_call_ty ty -> Some ty | _ -> None) + (fun ty -> Unsupported_feature_generic_call_ty ty) ; + register_error_kind + `Permanent + ~id:"unsupportedGenericMultisigLambda" + ~title:"Unsupported multisig feature: running lambda" + ~description:"This multisig contract does not feature running lambdas" + ~pp:(fun ppf lam -> + Format.fprintf + ppf + "This multisig contract has a fixed set of actions, it cannot run the \ + following lambda: %s." + lam) + Data_encoding.(obj1 (req "lam" string)) + (function Unsupported_feature_lambda lam -> Some lam | _ -> None) + (fun lam -> Unsupported_feature_lambda lam) ; + register_error_kind + `Permanent + ~id:"illTypedArgumentForMultisig" + ~title:"Ill-typed argument in multi-signed transfer" + ~description: + "The provided argument for a transfer from a multisig contract is \ + ill-typed" + ~pp:(fun ppf (destination, entrypoint, parameter_ty, parameter) -> + Format.fprintf + ppf + "The entrypoint %a of contract %a called from a multisig contract is \ + of type %a; the provided parameter %a is ill-typed." + Entrypoint.pp + entrypoint + Contract.pp + destination + Michelson_v1_printer.print_expr + parameter_ty + Michelson_v1_printer.print_expr + parameter) + Data_encoding.( + obj4 + (req "destination" Contract.encoding) + (req "entrypoint" Entrypoint.simple_encoding) + (req "parameter_ty" Script.expr_encoding) + (req "parameter" Script.expr_encoding)) + (function + | Ill_typed_argument (destination, entrypoint, parameter_ty, parameter) -> + Some (destination, entrypoint, parameter_ty, parameter) + | _ -> None) + (fun (destination, entrypoint, parameter_ty, parameter) -> + Ill_typed_argument (destination, entrypoint, parameter_ty, parameter)) ; + register_error_kind + `Permanent + ~id:"illTypedLambdaForMultisig" + ~title:"Ill-typed lambda for multi-signed transfer" + ~description: + "The provided lambda for a transfer from a multisig contract is ill-typed" + ~pp:(fun ppf (lam, exp) -> + Format.fprintf + ppf + "The provided lambda %a for multisig contract is ill-typed; %a is \ + expected." + Michelson_v1_printer.print_expr + lam + Michelson_v1_printer.print_expr + exp) + Data_encoding.( + obj2 (req "lam" Script.expr_encoding) (req "exp" Script.expr_encoding)) + (function Ill_typed_lambda (lam, exp) -> Some (lam, exp) | _ -> None) + (fun (lam, exp) -> Ill_typed_lambda (lam, exp)) + +(* The multisig contract script written by Arthur Breitman + https://github.com/murbard/smart-contracts/blob/abdb582d8f1fe7ba7eb15975867d8862cb70acfe/multisig/michelson/generic.tz *) +let multisig_script_string = + {| +parameter (or (unit %default) + (pair %main + (pair :payload + (nat %counter) # counter, used to prevent replay attacks + (or :action # payload to sign, represents the requested action + (lambda %operation unit (list operation)) + (pair %change_keys # change the keys controlling the multisig + (nat %threshold) # new threshold + (list %keys key)))) # new list of keys + (list %sigs (option signature)))); # signatures + +storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; + +code + { + UNPAIR ; + IF_LEFT + { # Default entry point: do nothing + # This entry point can be used to send tokens to this contract + DROP ; NIL operation ; PAIR } + { # Main entry point + # Assert no token was sent: + # to send tokens, the default entry point should be used + PUSH mutez 0 ; AMOUNT ; ASSERT_CMPEQ ; + SWAP ; DUP ; DIP { SWAP } ; + DIP + { + UNPAIR ; + # pair the payload with the current contract address, to ensure signatures + # can't be replayed across different contracts if a key is reused. + DUP ; SELF ; ADDRESS ; CHAIN_ID ; PAIR ; PAIR ; + PACK ; # form the binary payload that we expect to be signed + DIP { UNPAIR @counter ; DIP { SWAP } } ; SWAP + } ; + + # Check that the counters match + UNPAIR @stored_counter; DIP { SWAP }; + ASSERT_CMPEQ ; + + # Compute the number of valid signatures + DIP { SWAP } ; UNPAIR @threshold @keys; + DIP + { + # Running count of valid signatures + PUSH @valid nat 0; SWAP ; + ITER + { + DIP { SWAP } ; SWAP ; + IF_CONS + { + IF_SOME + { SWAP ; + DIP + { + SWAP ; DIIP { DUUP } ; + # Checks signatures, fails if invalid + { DUUUP; DIP {CHECK_SIGNATURE}; SWAP; IF {DROP} {FAILWITH} }; + PUSH nat 1 ; ADD @valid } } + { SWAP ; DROP } + } + { + # There were fewer signatures in the list + # than keys. Not all signatures must be present, but + # they should be marked as absent using the option type. + FAIL + } ; + SWAP + } + } ; + # Assert that the threshold is less than or equal to the + # number of valid signatures. + ASSERT_CMPLE ; + # Assert no unchecked signature remains + IF_CONS {FAIL} {} ; + DROP ; + + # Increment counter and place in storage + DIP { UNPAIR ; PUSH nat 1 ; ADD @new_counter ; PAIR} ; + + # We have now handled the signature verification part, + # produce the operation requested by the signers. + IF_LEFT + { # Get operation + UNIT ; EXEC + } + { + # Change set of signatures + DIP { CAR } ; SWAP ; PAIR ; NIL operation + }; + PAIR } + } +|} + +(* Client_proto_context.originate expects the contract script as a Script.expr *) +let multisig_script : Script.expr = + Michelson_v1_parser.parse_toplevel ?check:(Some true) multisig_script_string + |> Tezos_micheline.Micheline_parser.no_parsing_error + |> function + | Error _ -> + assert false + (* This is a top level assertion, it is asserted when the client's process runs. *) + | Ok parsing_result -> parsing_result.Michelson_v1_parser.expanded + +let multisig_script_hash = + let bytes = + Data_encoding.Binary.to_bytes_exn Script.expr_encoding multisig_script + in + Script_expr_hash.hash_bytes [bytes] + +(* The previous multisig script is the only one that the client can + originate but the client knows how to interact with several + versions of the multisig contract. For each version, the description + indicates which features are available and how to interact with + the contract. *) + +type multisig_contract_description = { + hash : Script_expr_hash.t; + (* The hash of the contract script *) + requires_chain_id : bool; + (* The signatures should contain the chain identifier *) + main_entrypoint : Entrypoint.t option; + (* name of the main entrypoint of the multisig contract, None means use the default entrypoint *) + generic : bool; + (* False means that the contract uses a custom action type, true + means that the contract expects the action as a (lambda unit + (list operation)). *) +} + +let entrypoint_main = Entrypoint.of_string_strict_exn "main" + +(* List of known multisig contracts hashes with their kinds *) +let known_multisig_contracts : multisig_contract_description list = + [ + { + (* First supported version of the generic multisig contract. Supports incoming + transfers from unauthenticated senders and outgoing transfers of + arbitrary operation lists. + + See docs/user/multisig.rst for more details. *) + hash = multisig_script_hash; + requires_chain_id = true; + main_entrypoint = Some entrypoint_main; + generic = true; + }; + { + (* Fourth supported version of the legacy multisig contract. This script is + functionally equivalent to the third version but uses the [DUP 2] + instruction introduced in Edo instead of the macro for [DIG 2; DUP; DUG 3]. *) + hash = + Script_expr_hash.of_b58check_exn + "exprutz4BVGJ3Qms6qjmqvUF8sEk27H1cfqhRT17qpTdhEs5hEjbWm"; + requires_chain_id = true; + main_entrypoint = None; + generic = false; + }; + { + (* Third supported version of the legacy multisig contract. This script is + functionally equivalent to the second version but uses the [DIP 2] + instruction introduced in Babylon instead of the [DIIP] macro. *) + hash = + Script_expr_hash.of_b58check_exn + "exprumpS39YZd26Cn4kyKUK5ezTR3at838iGWg7i6uETv8enDeAnfb"; + requires_chain_id = true; + main_entrypoint = None; + generic = false; + }; + { + (* Second supported version of the legacy multisig contract. This script + is the one resulting from the stitching of the Babylon protocol, the + only difference with the first version is that the chain id is part of + the data to sign. *) + hash = + Script_expr_hash.of_b58check_exn + "exprtw1v4KvQN414oEXdGuA1U3eQizuCdS8cipx8QGK8TbNLRwc3qL"; + requires_chain_id = true; + main_entrypoint = None; + generic = false; + }; + { + (* First supported version of the legacy multisig contract. This script should not + be used anymore because it is subject to a small replay attack: when + the test chain is forked both instances have the same address and + counter so whatever happens on the test chain can be replayed on the + main chain. The script has been fixed during the activation of the + Babylon protocol. *) + hash = + Script_expr_hash.of_b58check_exn + "expru4Ju9kf6MQ216FxUEsb9P6j8UhkPtsFcYP8r9XhQSRb47FZGfM"; + requires_chain_id = false; + main_entrypoint = None; + generic = false; + }; + ] + +let known_multisig_hashes = + List.map (fun descr -> descr.hash) known_multisig_contracts + +let check_multisig_script_hash hash : + multisig_contract_description tzresult Lwt.t = + match + List.find_opt + (fun d -> Script_expr_hash.(d.hash = hash)) + known_multisig_contracts + with + | None -> fail (Not_a_supported_multisig_contract hash) + | Some d -> return d + +(* Returns [Ok ()] if [~contract] is an originated contract whose code + is [multisig_script] *) +let check_multisig_contract (cctxt : #Protocol_client_context.full) ~chain + ~block contract = + Client_proto_context.get_script_hash cctxt ~chain ~block contract + >>=? function + | None -> fail (Contract_has_no_script contract) + | Some hash -> check_multisig_script_hash hash + +(* Some Michelson building functions, specific to the needs of the multisig + interface.*) + +(* The type of the lambdas consumed by the generic script *) +let lambda_action_t ~loc = lambda_t ~loc (unit_t ~loc) (operations_t ~loc) + +(* Conversion functions from common types to Script_expr using the optimized representation *) +let mutez ~loc (amount : Tez.t) = int ~loc (Z.of_int64 (Tez.to_mutez amount)) + +let optimized_key_hash ~loc + (key_hash : Tezos_crypto.Signature.Public_key_hash.t) = + bytes + ~loc + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Signature.Public_key_hash.encoding + key_hash) + +let optimized_address ~loc ~(address : Contract.t) ~(entrypoint : Entrypoint.t) + = + bytes + ~loc + (Data_encoding.Binary.to_bytes_exn + Data_encoding.(tup2 Contract.encoding Entrypoint.value_encoding) + (address, entrypoint)) + +let optimized_key ~loc (key : Tezos_crypto.Signature.Public_key.t) = + bytes + ~loc + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Signature.Public_key.encoding + key) + +(** * Actions *) + +type multisig_action = + | Transfer of { + amount : Tez.t; + destination : Contract.t; + entrypoint : Entrypoint.t; + parameter_type : Script.expr; + parameter : Script.expr; + } + | Change_delegate of public_key_hash option + | Lambda of Script.expr + | Change_keys of Z.t * public_key list + +let action_to_expr_generic ~loc = function + | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> ( + match destination with + | Implicit destination -> + lambda_from_string + @@ Managed_contract.build_lambda_for_transfer_to_implicit + ~destination + ~amount + >|? left ~loc + | Originated destination -> + lambda_from_string + @@ Managed_contract.build_lambda_for_transfer_to_originated + ~destination + ~entrypoint + ~parameter_type + ~parameter + ~amount + >|? left ~loc) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Change_delegate delegate -> + lambda_from_string + @@ Managed_contract.build_lambda_for_set_delegate ~delegate + >|? left ~loc + | Change_keys (threshold, keys) -> + let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in + let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in + ok expr + +let action_to_expr_legacy ~loc = function + | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> + if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:()) + then error @@ Unsupported_feature_generic_call parameter + else if + parameter_type + <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:()) + then error @@ Unsupported_feature_generic_call_ty parameter_type + else + ok + @@ left + ~loc + (pair + ~loc + (mutez ~loc amount) + (optimized_address ~loc ~address:destination ~entrypoint)) + | Lambda _ -> error @@ Unsupported_feature_lambda "" + | Change_delegate delegate -> + let delegate_opt = + match delegate with + | None -> none ~loc () + | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) + in + ok @@ right ~loc (left ~loc delegate_opt) + | Change_keys (threshold, keys) -> + let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in + let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in + ok (right ~loc expr) + +let action_to_expr ~loc ~generic action = + if generic then action_to_expr_generic ~loc action + else action_to_expr_legacy ~loc action + +let action_of_expr_generic e = + let fail () = + fail + (Action_deserialisation_error + (Tezos_micheline.Micheline.strip_locations e)) + in + match e with + | Tezos_micheline.Micheline.Prim (_, Script.D_Left, [lam], []) -> + return @@ Lambda (Tezos_micheline.Micheline.strip_locations lam) + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Right, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Int (_, threshold); + Tezos_micheline.Micheline.Seq (_, key_bytes); + ], + [] ); + ], + [] ) -> + List.map_es + (function + | Tezos_micheline.Micheline.Bytes (_, s) -> + return + @@ Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Signature.Public_key.encoding + s + | _ -> fail ()) + key_bytes + >>=? fun keys -> return @@ Change_keys (threshold, keys) + | _ -> fail () + +let action_of_expr_not_generic e = + let fail () = + fail + (Action_deserialisation_error + (Tezos_micheline.Micheline.strip_locations e)) + in + match e with + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Left, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Int (_, i); + Tezos_micheline.Micheline.Bytes (_, s); + ], + [] ); + ], + [] ) -> ( + match Tez.of_mutez (Z.to_int64 i) with + | None -> fail () + | Some amount -> + return + @@ Transfer + { + amount; + destination = + Data_encoding.Binary.of_bytes_exn Contract.encoding s; + entrypoint = Entrypoint.default; + parameter_type = + Tezos_micheline.Micheline.strip_locations @@ unit_t ~loc:(); + parameter = + Tezos_micheline.Micheline.strip_locations @@ unit ~loc:(); + }) + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Right, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Left, + [Tezos_micheline.Micheline.Prim (_, Script.D_None, [], [])], + [] ); + ], + [] ) -> + return @@ Change_delegate None + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Right, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Left, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Some, + [Tezos_micheline.Micheline.Bytes (_, s)], + [] ); + ], + [] ); + ], + [] ) -> + return + @@ Change_delegate + (Some + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Signature.Public_key_hash.encoding + s)) + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Right, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Right, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Int (_, threshold); + Tezos_micheline.Micheline.Seq (_, key_bytes); + ], + [] ); + ], + [] ); + ], + [] ) -> + List.map_es + (function + | Tezos_micheline.Micheline.Bytes (_, s) -> + return + @@ Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Signature.Public_key.encoding + s + | _ -> fail ()) + key_bytes + >>=? fun keys -> return @@ Change_keys (threshold, keys) + | _ -> fail () + +let action_of_expr ~generic = + if generic then action_of_expr_generic else action_of_expr_not_generic + +type key_list = Tezos_crypto.Signature.Public_key.t list + +(* The relevant information that we can get about a multisig smart contract *) +type multisig_contract_information = { + counter : Z.t; + threshold : Z.t; + keys : key_list; +} + +let multisig_get_information (cctxt : #Protocol_client_context.full) ~chain + ~block contract = + let open Client_proto_context in + let open Tezos_micheline.Micheline in + get_storage cctxt ~chain ~block ~unparsing_mode:Readable contract + >>=? fun storage_opt -> + match storage_opt with + | None -> fail (Contract_has_no_storage contract) + | Some storage -> ( + match root storage with + | Prim + ( _, + D_Pair, + [Int (_, counter); Int (_, threshold); Seq (_, key_nodes)], + _ ) -> + List.map_es + (function + | String (_, key_str) -> + return + @@ Tezos_crypto.Signature.Public_key.of_b58check_exn key_str + | _ -> fail (Contract_has_unexpected_storage contract)) + key_nodes + >>=? fun keys -> return {counter; threshold; keys} + | _ -> fail (Contract_has_unexpected_storage contract)) + +let multisig_create_storage ~counter ~threshold ~keys () : + Script.expr tzresult Lwt.t = + let loc = Tezos_micheline.Micheline_parser.location_zero in + let open Tezos_micheline.Micheline in + List.map_es + (fun key -> + let key_str = Tezos_crypto.Signature.Public_key.to_b58check key in + return (String (loc, key_str))) + keys + >>=? fun l -> + return @@ strip_locations + @@ pair ~loc (int ~loc counter) (pair ~loc (int ~loc threshold) (seq ~loc l)) + +(* Client_proto_context.originate expects the initial storage as a string *) +let multisig_storage_string ~counter ~threshold ~keys () = + multisig_create_storage ~counter ~threshold ~keys () >>=? fun expr -> + return @@ Format.asprintf "%a" Michelson_v1_printer.print_expr expr + +let multisig_create_param ~counter ~generic ~action ~optional_signatures () : + Script.expr tzresult Lwt.t = + let loc = 0 in + let open Tezos_micheline.Micheline in + List.map_es + (fun sig_opt -> + match sig_opt with + | None -> return @@ none ~loc () + | Some signature -> + return + @@ some + ~loc + (String (loc, Tezos_crypto.Signature.to_b58check signature))) + optional_signatures + >>=? fun l -> + Lwt.return @@ action_to_expr ~loc ~generic action >>=? fun expr -> + return @@ strip_locations + @@ pair ~loc (pair ~loc (int ~loc counter) expr) (Seq (loc, l)) + +let multisig_param ~counter ~action ~optional_signatures ~generic () = + multisig_create_param ~counter ~action ~optional_signatures ~generic () + >>=? fun expr -> return @@ Script.lazy_expr expr + +let get_contract_address_maybe_chain_id ~descr ~loc ~chain_id contract = + let address = + bytes ~loc (Data_encoding.Binary.to_bytes_exn Contract.encoding contract) + in + if descr.requires_chain_id then + let chain_id_bytes = + bytes + ~loc + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Chain_id.encoding + chain_id) + in + pair ~loc chain_id_bytes address + else address + +let multisig_bytes ~counter ~action ~contract ~chain_id ~descr () = + let loc = 0 in + Lwt.return @@ action_to_expr ~loc ~generic:descr.generic action + >>=? fun expr -> + let triple = + pair + ~loc + (get_contract_address_maybe_chain_id ~descr ~loc ~chain_id contract) + (pair ~loc (int ~loc counter) expr) + in + let bytes = + Data_encoding.Binary.to_bytes_exn Script.expr_encoding + @@ Tezos_micheline.Micheline.strip_locations @@ triple + in + return @@ Bytes.cat (Bytes.of_string "\005") bytes + +let check_threshold ~threshold ~keys () = + let threshold = Z.to_int threshold in + if Compare.List_length_with.(keys < threshold) then + fail (Threshold_too_high (threshold, List.length keys)) + else if Compare.Int.(threshold <= 0) then + fail (Non_positive_threshold threshold) + else return_unit + +let originate_multisig (cctxt : #Protocol_client_context.full) ~chain ~block + ?confirmations ?dry_run ?branch ?fee ?gas_limit ?storage_limit + ?verbose_signing ~delegate ~threshold ~keys ~balance ~source ~src_pk ~src_sk + ~fee_parameter () = + multisig_storage_string ~counter:Z.zero ~threshold ~keys () + >>=? fun initial_storage -> + check_threshold ~threshold ~keys () >>=? fun () -> + Client_proto_context.originate_contract + cctxt + ~chain + ~block + ?branch + ?confirmations + ?dry_run + ?fee + ?gas_limit + ?storage_limit + ?verbose_signing + ~delegate + ~initial_storage + ~balance + ~source + ~src_pk + ~src_sk + ~code:multisig_script + ~fee_parameter + () + +type multisig_prepared_action = { + bytes : Bytes.t; + threshold : Z.t; + keys : public_key list; + counter : Z.t; + entrypoint : Entrypoint.t option; + generic : bool; +} + +let check_parameter_type (cctxt : #Protocol_client_context.full) ?gas ?legacy + ~destination ~entrypoint ~parameter_type ~parameter () = + trace + (Ill_typed_argument (destination, entrypoint, parameter_type, parameter)) + @@ Plugin.RPC.Scripts.typecheck_data + cctxt + (cctxt#chain, cctxt#block) + ~data:parameter + ~ty:parameter_type + ?gas + ?legacy + >>=? fun _ -> return_unit + +let check_action (cctxt : #Protocol_client_context.full) ~action ~balance ?gas + ?legacy () = + match action with + | Change_keys (threshold, keys) -> + check_threshold ~threshold ~keys () >>=? fun () -> return_unit + | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> + check_parameter_type + cctxt + ~destination + ~entrypoint + ~parameter_type + ~parameter + () + >>=? fun () -> + if Tez.(amount > balance) then + (* This is warning only because the contract can be filled + before sending the signatures or even in the same + transaction *) + Format.eprintf + "Transferred amount is bigger than current multisig balance" ; + return_unit + | Lambda code -> + let action_t = + Tezos_micheline.Micheline.strip_locations (lambda_action_t ~loc:()) + in + trace (Ill_typed_lambda (code, action_t)) + @@ Plugin.RPC.Scripts.typecheck_data + cctxt + (cctxt#chain, cctxt#block) + ~data:code + ~ty:action_t + ?gas + ?legacy + >>=? fun _remaining_gas -> return_unit + | _ -> return_unit + +let prepare_multisig_transaction (cctxt : #Protocol_client_context.full) ~chain + ~block ~multisig_contract ~action () = + let contract = multisig_contract in + check_multisig_contract cctxt ~chain ~block contract >>=? fun descr -> + multisig_get_information cctxt ~chain ~block contract + >>=? fun {counter; threshold; keys} -> + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + let contract = Contract.Originated contract in + multisig_bytes ~counter ~action ~contract ~descr ~chain_id () + >>=? fun bytes -> + Client_proto_context.get_balance + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + >>=? fun balance -> + check_action cctxt ~action ~balance () >>=? fun () -> + return + { + bytes; + threshold; + keys; + counter; + entrypoint = descr.main_entrypoint; + generic = descr.generic; + } + +let check_multisig_signatures ~bytes ~threshold ~keys signatures = + let key_array = Array.of_list keys in + let nkeys = Array.length key_array in + let opt_sigs_arr = Array.make nkeys None in + let matching_key_found = ref false in + let check_signature_against_key_number signature i key = + if Tezos_crypto.Signature.check key signature bytes then ( + matching_key_found := true ; + opt_sigs_arr.(i) <- Some signature) + in + List.iter_ep + (fun signature -> + matching_key_found := false ; + List.iteri (check_signature_against_key_number signature) keys ; + fail_unless !matching_key_found (Invalid_signature signature)) + signatures + >>=? fun () -> + let opt_sigs = Array.to_list opt_sigs_arr in + let signature_count = + List.fold_left + (fun n sig_opt -> match sig_opt with Some _ -> n + 1 | None -> n) + 0 + opt_sigs + in + let threshold_int = Z.to_int threshold in + if signature_count >= threshold_int then return opt_sigs + else fail (Not_enough_signatures (threshold_int, signature_count)) + +let call_multisig (cctxt : #Protocol_client_context.full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?branch ~source ~src_pk ~src_sk + ~multisig_contract ~action ~signatures ~amount ?fee ?gas_limit + ?storage_limit ?counter ~fee_parameter () = + prepare_multisig_transaction cctxt ~chain ~block ~multisig_contract ~action () + >>=? fun { + bytes; + threshold; + keys; + counter = stored_counter; + entrypoint; + generic; + } -> + check_multisig_signatures ~bytes ~threshold ~keys signatures + >>=? fun optional_signatures -> + multisig_param + ~counter:stored_counter + ~action + ~optional_signatures + ~generic + () + >>=? fun parameters -> + Client_proto_context.transfer_with_script + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?branch + ~source + ~src_pk + ~src_sk + ~destination:(Originated multisig_contract) + ?entrypoint + ~parameters + ~amount + ?fee + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + ?verbose_signing + () + +let action_of_bytes ~multisig_contract ~stored_counter ~descr ~chain_id bytes = + if + Compare.Int.(Bytes.length bytes >= 1) + && Compare.Int.(TzEndian.get_uint8 bytes 0 = 0x05) + then + let nbytes = Bytes.sub bytes 1 (Bytes.length bytes - 1) in + match Data_encoding.Binary.of_bytes_opt Script.expr_encoding nbytes with + | None -> fail (Bytes_deserialisation_error bytes) + | Some e -> ( + match Tezos_micheline.Micheline.root e with + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Bytes (_, contract_bytes); + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [Tezos_micheline.Micheline.Int (_, counter); e], + [] ); + ], + [] ) + when not descr.requires_chain_id -> + let contract = + Data_encoding.Binary.of_bytes_exn + Contract.originated_encoding + contract_bytes + in + if counter = stored_counter then + if Contract_hash.(multisig_contract = contract) then + action_of_expr ~generic:descr.generic e + else + fail (Bad_deserialized_contract (contract, multisig_contract)) + else + fail + (Bad_deserialized_counter + {received = counter; expected = stored_counter}) + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Bytes (_, chain_id_bytes); + Tezos_micheline.Micheline.Bytes (_, contract_bytes); + ], + [] ); + Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [Tezos_micheline.Micheline.Int (_, counter); e], + [] ); + ], + [] ) + when descr.requires_chain_id -> + let contract = + Data_encoding.Binary.of_bytes_exn + Contract.originated_encoding + contract_bytes + in + let cid = + Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Chain_id.encoding + chain_id_bytes + in + if counter = stored_counter then + if multisig_contract = contract && chain_id = cid then + action_of_expr ~generic:descr.generic e + else + fail (Bad_deserialized_contract (contract, multisig_contract)) + else + fail + (Bad_deserialized_counter + {received = counter; expected = stored_counter}) + | _ -> fail (Bytes_deserialisation_error bytes)) + else fail (Bytes_deserialisation_error bytes) + +let call_multisig_on_bytes (cctxt : #Protocol_client_context.full) ~chain ~block + ?confirmations ?dry_run ?verbose_signing ?branch ~source ~src_pk ~src_sk + ~multisig_contract ~bytes ~signatures ~amount ?fee ?gas_limit ?storage_limit + ?counter ~fee_parameter () = + multisig_get_information cctxt ~chain ~block multisig_contract + >>=? fun info -> + check_multisig_contract cctxt ~chain ~block multisig_contract + >>=? fun descr -> + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + action_of_bytes + ~multisig_contract + ~stored_counter:info.counter + ~chain_id + ~descr + bytes + >>=? fun action -> + call_multisig + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?branch + ~source + ~src_pk + ~src_sk + ~multisig_contract + ~action + ~signatures + ~amount + ?fee + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + ?verbose_signing + () diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_multisig.mli b/src/proto_016_PtMumbai/lib_client/client_proto_multisig.mli new file mode 100644 index 000000000000..cb82be9493a1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_multisig.mli @@ -0,0 +1,152 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +(* The script of the recommended version of the multisig contract. + This is the script originated by [originate_multisig]. *) +val multisig_script : Script.expr + +(* A description of the possible actions that a multisig contract can run. *) +type multisig_action = + | Transfer of { + amount : Tez.t; + destination : Contract.t; + entrypoint : Entrypoint.t; + parameter_type : Script.expr; + parameter : Script.expr; + } + | Change_delegate of public_key_hash option + | Lambda of Script.expr + | Change_keys of Z.t * public_key list + +(* A prepared action is the byte sequence that needs to be signed to run the + action together with some data that can be useful for the user and to call + the multisig contracts once enough signatures are provided. *) +type multisig_prepared_action = { + (* The sequence of bytes to be signed. *) + bytes : Bytes.t; + (* Information reported to the user so that she knows who can sign and how + many signatures are required. *) + threshold : Z.t; + keys : public_key list; + (* Information needed to execute the action ones enough signatures have been + gathered. *) + counter : Z.t; + entrypoint : Entrypoint.t option; + generic : bool; +} + +(* The client will refuse to interact with a multisig contract if the hash of + its script is not in this list. *) +val known_multisig_hashes : Script_expr_hash.t list + +(* Originate a new multisig contract *) +val originate_multisig : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?branch:int -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?verbose_signing:bool -> + delegate:public_key_hash option -> + threshold:Z.t -> + keys:public_key list -> + balance:Tez.t -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.origination Kind.manager Injection.result * Contract.t) tzresult Lwt.t + +(* Prepare an action, see [multisig_prepared_action]. *) +val prepare_multisig_transaction : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + multisig_contract:Contract_hash.t -> + action:multisig_action -> + unit -> + multisig_prepared_action tzresult Lwt.t + +(* Call a multisig contract, requesting it to run an action. *) +val call_multisig : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?branch:int -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + multisig_contract:Contract_hash.t -> + action:multisig_action -> + signatures:Tezos_crypto.Signature.t list -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t + +(* Same as [call_multisig] but the action to be performed is reconstructed from + the byte sequence that was signed. *) +val call_multisig_on_bytes : + full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?branch:int -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + multisig_contract:Contract_hash.t -> + bytes:Bytes.t -> + signatures:Tezos_crypto.Signature.t list -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_programs.ml b/src/proto_016_PtMumbai/lib_client/client_proto_programs.ml new file mode 100644 index 000000000000..3f944c498f9f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_programs.ml @@ -0,0 +1,390 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline +open Michelson_v1_printer + +module Program = Client_aliases.Alias (struct + type t = Michelson_v1_parser.parsed Micheline_parser.parsing_result + + include Compare.Make (struct + type nonrec t = t + + let compare = Micheline_parser.compare Michelson_v1_parser.compare_parsed + end) + + let encoding = + Data_encoding.conv + (fun ({Michelson_v1_parser.source; _}, _) -> source) + (fun source -> Michelson_v1_parser.parse_toplevel source) + Data_encoding.string + + let of_source source = return (Michelson_v1_parser.parse_toplevel source) + + let to_source ({Michelson_v1_parser.source; _}, _) = return source + + let name = "script" +end) + +let print_errors ?parsed (cctxt : #Protocol_client_context.full) errs + ~show_source = + Michelson_v1_error_reporter.enrich_runtime_errors + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~parsed + errs + >>= fun errs -> + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ?parsed + ~show_source) + errs + >>= fun () -> + cctxt#error "error running script" >>= fun () -> return_unit + +let print_view_result (cctxt : #Protocol_client_context.full) = function + | Ok expr -> cctxt#message "%a" print_expr expr >>= fun () -> return_unit + | Error errs -> print_errors cctxt ~show_source:false errs + +let print_run_result (cctxt : #Client_context.printer) ~show_source ~parsed = + function + | Ok (storage, operations, maybe_lazy_storage_diff) -> + cctxt#message + "@[<v 0>@[<v 2>storage@,\ + %a@]@,\ + @[<v 2>emitted operations@,\ + %a@]@,\ + @[<v 2>big_map diff@,\ + %a@]@]@." + print_expr + storage + (Format.pp_print_list Operation_result.pp_internal_operation) + operations + (fun ppf -> function + | None -> () + | Some diff -> print_big_map_diff ppf diff) + maybe_lazy_storage_diff + >>= fun () -> return_unit + | Error errs -> print_errors cctxt errs ~show_source ~parsed + +let print_trace_result (cctxt : #Client_context.printer) ~show_source ~parsed = + function + | Ok (storage, operations, trace, maybe_lazy_storage_diff) -> + cctxt#message + "@[<v 0>@[<v 2>storage@,\ + %a@]@,\ + @[<v 2>emitted operations@,\ + %a@]@,\ + @[<v 2>big_map diff@,\ + %a@]@,\ + @[<v 2>trace@,\ + %a@]@]@." + print_expr + storage + (Format.pp_print_list Operation_result.pp_internal_operation) + operations + (fun ppf -> function + | None -> () + | Some diff -> print_big_map_diff ppf diff) + maybe_lazy_storage_diff + print_execution_trace + trace + >>= fun () -> return_unit + | Error errs -> print_errors cctxt errs ~show_source ~parsed + +type simulation_params = { + input : Michelson_v1_parser.parsed; + unparsing_mode : Script_ir_unparser.unparsing_mode; + now : Script_timestamp.t option; + level : Script_int.n Script_int.num option; + source : Contract.t option; + payer : Tezos_crypto.Signature.public_key_hash option; + gas : Gas.Arith.integral option; +} + +type run_view_params = { + shared_params : simulation_params; + contract : Contract_hash.t; + entrypoint : Entrypoint.t; +} + +type run_script_view_params = { + shared_params : simulation_params; + contract : Contract_hash.t; + view : string; + unlimited_gas : bool; +} + +type run_params = { + shared_params : simulation_params; + amount : Tez.t option; + balance : Tez.t option; + program : Michelson_v1_parser.parsed; + storage : Michelson_v1_parser.parsed; + entrypoint : Entrypoint.t option; + self : Contract_hash.t option; +} + +let run_view (cctxt : #Protocol_client_context.rpc_context) + ~(chain : Chain_services.chain) ~block (params : run_view_params) = + let { + shared_params = {input; unparsing_mode; now; level; source; payer; gas}; + contract; + entrypoint; + } = + params + in + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + Plugin.RPC.Scripts.run_tzip4_view + cctxt + (chain, block) + ?gas + ~contract + ~entrypoint + ~input:input.expanded + ~chain_id + ?source + ?payer + ~unparsing_mode + ~now + ~level + +let run_script_view (cctxt : #Protocol_client_context.rpc_context) + ~(chain : Chain_services.chain) ~block (params : run_script_view_params) = + let { + shared_params = {input; unparsing_mode; now; level; source; payer; gas}; + contract; + view; + unlimited_gas; + } = + params + in + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + Plugin.RPC.Scripts.run_script_view + cctxt + (chain, block) + ?gas + ~contract + ~view + ~input:input.expanded + ~unlimited_gas + ~chain_id + ?source + ?payer + ~unparsing_mode + ~now + ~level + +let run (cctxt : #Protocol_client_context.rpc_context) + ~(chain : Chain_services.chain) ~block (params : run_params) = + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + let { + shared_params = {input; unparsing_mode; now; level; source; payer; gas}; + program; + amount; + balance; + storage; + entrypoint; + self; + } = + params + in + let amount = Option.value ~default:Tez.fifty_cents amount in + Plugin.RPC.Scripts.run_code + cctxt + (chain, block) + ?gas + ?entrypoint + ~unparsing_mode + ~script:program.expanded + ~storage:storage.expanded + ~input:input.expanded + ~amount + ?balance + ~chain_id + ~source + ~payer + ~self + ~now + ~level + +let trace (cctxt : #Protocol_client_context.rpc_context) + ~(chain : Chain_services.chain) ~block (params : run_params) = + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + let { + shared_params = {input; unparsing_mode; now; level; source; payer; gas}; + program; + amount; + balance; + storage; + entrypoint; + self; + } = + params + in + let amount = Option.value ~default:Tez.fifty_cents amount in + Plugin.RPC.Scripts.trace_code + cctxt + (chain, block) + ?gas + ?entrypoint + ~unparsing_mode + ~script:program.expanded + ~storage:storage.expanded + ~input:input.expanded + ~amount + ?balance + ~chain_id + ~source + ~payer + ~self + ~now + ~level + +let typecheck_data cctxt ~(chain : Chain_services.chain) ~block ?gas ?legacy + ~(data : Michelson_v1_parser.parsed) ~(ty : Michelson_v1_parser.parsed) () = + Plugin.RPC.Scripts.typecheck_data + cctxt + (chain, block) + ?gas + ?legacy + ~data:data.expanded + ~ty:ty.expanded + +let typecheck_program cctxt ~(chain : Chain_services.chain) ~block ?gas ?legacy + ~show_types (program : Michelson_v1_parser.parsed) = + Plugin.RPC.Scripts.typecheck_code + cctxt + (chain, block) + ?gas + ?legacy + ~script:program.expanded + ~show_types + +let script_size cctxt ~(chain : Chain_services.chain) ~block ?gas ?legacy + ~(program : Michelson_v1_parser.parsed) + ~(storage : Michelson_v1_parser.parsed) () = + Plugin.RPC.Scripts.script_size + cctxt + (chain, block) + ?gas + ?legacy + ~script:program.expanded + ~storage:storage.expanded + +let print_typecheck_result ~emacs ~show_types ~print_source_on_error program res + (cctxt : #Client_context.printer) = + if emacs then + let type_map, errs, _gas = + match res with + | Ok (type_map, gas) -> (type_map, [], Some gas) + | Error + (Environment.Ecoproto_error + (Script_tc_errors.Ill_typed_contract (_, type_map)) + :: _ as errs) -> + (type_map, errs, None) + | Error errs -> ([], errs, None) + in + cctxt#message + "(@[<v 0>(types . %a)@ (errors . %a)@])" + Michelson_v1_emacs.print_type_map + (program, type_map) + Michelson_v1_emacs.report_errors + (program, errs) + >>= fun () -> return_unit + else + match res with + | Ok (type_map, gas) -> + let program = Michelson_v1_printer.inject_types type_map program in + cctxt#message "@[<v 0>Well typed@,Gas remaining: %a@]" Gas.pp gas + >>= fun () -> + if show_types then + cctxt#message "%a" Micheline_printer.print_expr program >>= fun () -> + return_unit + else return_unit + | Error errs -> + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:show_types + ~show_source:print_source_on_error + ~parsed:program) + errs + >>= fun () -> cctxt#error "ill-typed script" + +let entrypoint_type cctxt ~(chain : Chain_services.chain) ~block + (program : Michelson_v1_parser.parsed) ~entrypoint = + Michelson_v1_entrypoints.script_entrypoint_type + cctxt + ~chain + ~block + program.expanded + ~entrypoint + +let print_entrypoint_type (cctxt : #Client_context.printer) ~emacs ?script_name + ~show_source ~parsed ~entrypoint ty = + Michelson_v1_entrypoints.print_entrypoint_type + cctxt + ~entrypoint + ~emacs + ?script_name + ~on_errors:(print_errors cctxt ~show_source ~parsed) + ty + +let list_entrypoints cctxt ~(chain : Chain_services.chain) ~block + (program : Michelson_v1_parser.parsed) = + Michelson_v1_entrypoints.list_entrypoints cctxt ~chain ~block program.expanded + +let print_entrypoints_list (cctxt : #Client_context.printer) ~emacs ?script_name + ~show_source ~parsed ty = + Michelson_v1_entrypoints.print_entrypoints_list + cctxt + ~emacs + ?script_name + ~on_errors:(print_errors cctxt ~show_source ~parsed) + ty + +let list_unreachables cctxt ~(chain : Chain_services.chain) ~block + (program : Michelson_v1_parser.parsed) = + Michelson_v1_entrypoints.list_unreachables + cctxt + ~chain + ~block + program.expanded + +let print_unreachables (cctxt : #Client_context.printer) ~emacs ?script_name + ~show_source ~parsed ty = + Michelson_v1_entrypoints.print_unreachables + cctxt + ~emacs + ?script_name + ~on_errors:(print_errors cctxt ~show_source ~parsed) + ty diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_programs.mli b/src/proto_016_PtMumbai/lib_client/client_proto_programs.mli new file mode 100644 index 000000000000..8e5c87d2ef5e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_programs.mli @@ -0,0 +1,236 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline + +module Program : + Client_aliases.Alias + with type t = Michelson_v1_parser.parsed Micheline_parser.parsing_result + +(* Parameters shared by both simulations (views, and contracts). *) +type simulation_params = { + input : Michelson_v1_parser.parsed; + unparsing_mode : Script_ir_unparser.unparsing_mode; + now : Script_timestamp.t option; + level : Script_int.n Script_int.num option; + source : Contract.t option; + payer : Tezos_crypto.Signature.public_key_hash option; + gas : Gas.Arith.integral option; +} + +(* Parameters specific to simulations of TZIP4 views *) +type run_view_params = { + shared_params : simulation_params; + contract : Contract_hash.t; + entrypoint : Entrypoint.t; +} + +(* Parameters specific to simulations of Michelson views *) +type run_script_view_params = { + shared_params : simulation_params; + contract : Contract_hash.t; + view : string; + unlimited_gas : bool; +} + +(* Parameters specific to simulations of contract calls *) +type run_params = { + shared_params : simulation_params; + amount : Tez.t option; + balance : Tez.t option; + program : Michelson_v1_parser.parsed; + storage : Michelson_v1_parser.parsed; + entrypoint : Entrypoint.t option; + self : Contract_hash.t option; +} + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.run_tzip4_view} *) +val run_view : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + run_view_params -> + Script.expr tzresult Lwt.t + +(** [run_script_view cctxt ~chain ~block params] + executes {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.run_script_view}, + the RPC to run a Michelson view offchain and returns its value. + *) +val run_script_view : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + run_script_view_params -> + Script.expr tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.run_code} *) +val run : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + run_params -> + (Script.expr + * Apply_internal_results.packed_internal_operation list + * Lazy_storage.diffs option) + tzresult + Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.trace_code} *) +val trace : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + run_params -> + (Script.expr + * Apply_internal_results.packed_internal_operation list + * Script_typed_ir.execution_trace + * Lazy_storage.diffs option) + tzresult + Lwt.t + +val print_view_result : + #Protocol_client_context.full -> + Script_repr.expr tzresult -> + unit tzresult Lwt.t + +val print_run_result : + #Protocol_client_context.full -> + show_source:bool -> + parsed:Michelson_v1_parser.parsed -> + (Script_repr.expr + * Apply_internal_results.packed_internal_operation list + * Lazy_storage.diffs option) + tzresult -> + unit tzresult Lwt.t + +val print_trace_result : + #Protocol_client_context.full -> + show_source:bool -> + parsed:Michelson_v1_parser.parsed -> + (Script_repr.expr + * Apply_internal_results.packed_internal_operation list + * Script_typed_ir.execution_trace + * Lazy_storage.diffs option) + tzresult -> + unit tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.typecheck_data} *) +val typecheck_data : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?gas:Gas.Arith.integral -> + ?legacy:bool -> + data:Michelson_v1_parser.parsed -> + ty:Michelson_v1_parser.parsed -> + unit -> + Gas.t tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.typecheck_code} *) +val typecheck_program : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?gas:Gas.Arith.integral -> + ?legacy:bool -> + show_types:bool -> + Michelson_v1_parser.parsed -> + (Script_tc_errors.type_map * Gas.t) tzresult Lwt.t + +val print_typecheck_result : + emacs:bool -> + show_types:bool -> + print_source_on_error:bool -> + Michelson_v1_parser.parsed -> + (Script_tc_errors.type_map * Gas.t) tzresult -> + #Client_context.printer -> + unit tzresult Lwt.t + +(** Calls {!Tezos_protocol_plugin_alpha.Plugin.RPC.Scripts.script_size} *) +val script_size : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?gas:Gas.Arith.integral -> + ?legacy:bool -> + program:Michelson_v1_parser.parsed -> + storage:Michelson_v1_parser.parsed -> + unit -> + int tzresult Lwt.t + +val entrypoint_type : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Michelson_v1_parser.parsed -> + entrypoint:Entrypoint.t -> + Script.expr option tzresult Lwt.t + +val print_entrypoint_type : + #Protocol_client_context.full -> + emacs:bool -> + ?script_name:string -> + show_source:bool -> + parsed:Michelson_v1_parser.parsed -> + entrypoint:Entrypoint.t -> + Script_repr.expr option tzresult -> + unit tzresult Lwt.t + +(** Calls {!Michelson_v1_entrypoints.list_entrypoints} *) +val list_entrypoints : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Michelson_v1_parser.parsed -> + (string * Script.expr) list tzresult Lwt.t + +val print_entrypoints_list : + #Protocol_client_context.full -> + emacs:bool -> + ?script_name:string -> + show_source:bool -> + parsed:Michelson_v1_parser.parsed -> + (string * Script.expr) list tzresult -> + unit tzresult Lwt.t + +val list_unreachables : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + Michelson_v1_parser.parsed -> + Michelson_v1_primitives.prim list list tzresult Lwt.t + +(** Calls {!Michelson_v1_entrypoints.print_unreachables} *) +val print_unreachables : + #Protocol_client_context.full -> + emacs:bool -> + ?script_name:string -> + show_source:bool -> + parsed:Michelson_v1_parser.parsed -> + Michelson_v1_primitives.prim list list tzresult -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_rollups.ml b/src/proto_016_PtMumbai/lib_client/client_proto_rollups.ml new file mode 100644 index 000000000000..aee31002094d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_rollups.ml @@ -0,0 +1,214 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type rollup_entity = {rollup : Tx_rollup.t; origination_level : int32 option} + +module TxRollupEntity = struct + type t = rollup_entity + + include Compare.Make (struct + type t = rollup_entity + + let compare r1 r2 = Tx_rollup.compare r1.rollup r2.rollup + end) + + let encoding = + let open Data_encoding in + union + [ + case + ~title:"rollup without origination level" + (Tag 0) + Tx_rollup.encoding + (function + | {rollup; origination_level = None} -> Some rollup | _ -> None) + (fun rollup -> {rollup; origination_level = None}); + case + ~title:"rollup with origination level" + (Tag 1) + (obj2 + (req "rollup" Tx_rollup.encoding) + (req "origination_level" int32)) + (function + | {rollup; origination_level = Some level} -> Some (rollup, level) + | _ -> None) + (fun (rollup, level) -> {rollup; origination_level = Some level}); + ] + + let of_source s = + let open Lwt_result_syntax in + let*? rollup = + Tx_rollup.of_b58check s |> Environment.wrap_tzresult + |> record_trace_eval (fun () -> + error_of_fmt "bad transaction rollup notation") + in + return {rollup; origination_level = None} + + let to_source {rollup; _} = return (Tx_rollup.to_b58check rollup) + + let name = "tx_rollup" +end + +module TxRollupAlias = Client_aliases.Alias (TxRollupEntity) + +module ScRollup = struct + module In_memory_context = struct + open Tezos_context_memory + + module Tree = struct + include Context_binary.Tree + + type tree = Context_binary.tree + + type t = Context_binary.t + + type key = string list + + type value = bytes + end + + type tree = Tree.tree + + type proof = Context.Proof.tree Context.Proof.t + + let hash_tree _ = assert false + + let verify_proof p f = + Lwt.map Result.to_option (Context_binary.verify_tree_proof p f) + + let produce_proof context state step = + let open Lwt_syntax in + let* context = Context_binary.add_tree context [] state in + let* h = Context_binary.commit ~time:Time.Protocol.epoch context in + let index = Context_binary.index context in + let* context = Context_binary.checkout_exn index h in + match Tree.kinded_key state with + | Some k -> + let index = Context_binary.index context in + let* p = Context_binary.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup.State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding + end + + module Arith_pvm : + Sc_rollup.PVM.S + with type context = In_memory_context.Tree.t + and type state = In_memory_context.tree + and type proof = + Tezos_context_memory.Context.Proof.tree + Tezos_context_memory.Context.Proof.t = + Sc_rollup.ArithPVM.Make (In_memory_context) + + module Wasm_pvm : + Sc_rollup.PVM.S + with type context = In_memory_context.Tree.t + and type state = In_memory_context.tree + and type proof = + Tezos_context_memory.Context.Proof.tree + Tezos_context_memory.Context.Proof.t = + Sc_rollup.Wasm_2_0_0PVM.Make + (Environment.Wasm_2_0_0.Make) + (In_memory_context) + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4386 + Extracted and adapted from {!Tezos_context_memory}. *) + let make_empty_context ?(root = "/tmp") () = + let open Lwt_syntax in + let context_promise = + let+ index = Tezos_context_memory.Context_binary.init root in + Tezos_context_memory.Context_binary.empty index + in + match Lwt.state context_promise with + | Lwt.Return result -> result + | Lwt.Fail exn -> raise exn + | Lwt.Sleep -> + (* The in-memory context should never block *) + assert false + + let origination_proof_exn ~boot_sector kind = + let aux = function + | Sc_rollup.Kind.Example_arith -> + let open Lwt_result_syntax in + let context = make_empty_context () in + let* proof = + Arith_pvm.produce_origination_proof context boot_sector + in + let*? proof = + Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Wasm_pvm) proof + in + return proof + | Sc_rollup.Kind.Wasm_2_0_0 -> + let open Lwt_result_syntax in + let context = make_empty_context () in + let* proof = Wasm_pvm.produce_origination_proof context boot_sector in + let*? proof = + Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Wasm_pvm) proof + in + return proof + in + let open Lwt_syntax in + let* res = aux kind in + match res with + | Ok res -> Lwt.return res + | Error _ -> + raise + (Invalid_argument + "origination_proof_exn: could not produce an origination proof") +end + +module EpoxyEntity = struct + include Zk_rollup.Address + + let of_source s = + let open Lwt_result_syntax in + let* rollup = + match Zk_rollup.Address.of_b58check_opt s with + | None -> tzfail @@ error_of_fmt "bad epoxy notation" + | Some rollup -> return rollup + in + return rollup + + let to_source rollup = return (Zk_rollup.Address.to_b58check rollup) + + let name = "epoxy" +end + +module EpoxyAlias = Client_aliases.Alias (EpoxyEntity) diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_rollups.mli b/src/proto_016_PtMumbai/lib_client/client_proto_rollups.mli new file mode 100644 index 000000000000..e8b666250611 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_rollups.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type rollup_entity = {rollup : Tx_rollup.t; origination_level : int32 option} + +module TxRollupAlias : Client_aliases.Alias with type t = rollup_entity + +module ScRollup : sig + val origination_proof_exn : + boot_sector:string -> Sc_rollup.Kind.t -> Sc_rollup.Proof.serialized Lwt.t +end + +module EpoxyAlias : Client_aliases.Alias with type t = Zk_rollup.t diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_utils.ml b/src/proto_016_PtMumbai/lib_client/client_proto_utils.ml new file mode 100644 index 000000000000..5f98e3c92286 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_utils.ml @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +let to_json_and_bytes branch message = + let op = + ( Environment.Operation.{branch}, + Contents_list (Single (Failing_noop message)) ) + in + let encoding = Operation.unsigned_encoding in + ( Data_encoding.Json.construct encoding op, + Data_encoding.Binary.to_bytes_exn encoding op ) + +let sign_message (cctxt : #full) ~src_sk ~block ~message = + let json, bytes = to_json_and_bytes block message in + cctxt#message "signed content: @[%a@]" Data_encoding.Json.pp json + >>= fun () -> + Client_keys.sign + cctxt + ~watermark:Tezos_crypto.Signature.Generic_operation + src_sk + bytes + +let check_message (cctxt : #full) ~block ~key_locator ~quiet ~message ~signature + = + let json, bytes = to_json_and_bytes block message in + (if quiet then Lwt.return_unit + else cctxt#message "checked content: @[%a@]" Data_encoding.Json.pp json) + >>= fun () -> + Client_keys.check + ~watermark:Tezos_crypto.Signature.Generic_operation + key_locator + signature + bytes diff --git a/src/proto_016_PtMumbai/lib_client/client_proto_utils.mli b/src/proto_016_PtMumbai/lib_client/client_proto_utils.mli new file mode 100644 index 000000000000..e222f1745aff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/client_proto_utils.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val sign_message : + #Protocol_client_context.full -> + src_sk:Client_keys.sk_uri -> + block:Tezos_crypto.Block_hash.t -> + message:string -> + Tezos_crypto.Signature.t tzresult Lwt.t + +val check_message : + #Protocol_client_context.full -> + block:Tezos_crypto.Block_hash.t -> + key_locator:Client_keys.pk_uri -> + quiet:bool -> + message:string -> + signature:Tezos_crypto.Signature.t -> + bool tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/dune b/src/proto_016_PtMumbai/lib_client/dune new file mode 100644 index 000000000000..438d559c06b4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/dune @@ -0,0 +1,32 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_client_alpha) + (public_name tezos-client-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-shell-services + tezos-client-base + tezos-protocol-alpha + tezos-mockup-registration + tezos-proxy + tezos-signer-backends + tezos-protocol-plugin-alpha + tezos-protocol-alpha.parameters + tezos-rpc + uri) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_alpha_parameters)) diff --git a/src/proto_016_PtMumbai/lib_client/injection.ml b/src/proto_016_PtMumbai/lib_client/injection.ml new file mode 100644 index 000000000000..307aea3af98e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/injection.ml @@ -0,0 +1,1532 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2018-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Apply_results +open Apply_operation_result +open Apply_internal_results +open Protocol_client_context + +let get_branch (rpc_config : #Protocol_client_context.full) ~chain + ~(block : Block_services.block) branch = + (* The default branch is set to HEAD~2, because with Tenderbake the + same transaction may be included again in another block candidate + at the same level, so the operation branch should not point to + the current head. It's not a good idea if it points to the head's + predecessor as well, as the predecessor hash may still change + because of potential reorgs (only the predecessor payload is + finalized, not the whole block). *) + let branch = Option.value ~default:0 branch in + (* TODO export parameter *) + (match block with + | `Head 0 -> + (* Default client's block value: we branch to head's grandfather *) + return (`Head (2 + branch)) + | `Head n -> return (`Head (n + branch)) + | `Hash (h, n) -> return (`Hash (h, n + branch)) + | `Alias (a, n) -> return (`Alias (a, n)) + | `Genesis -> return `Genesis + | `Level i -> return (`Level i)) + >>=? fun block -> + Shell_services.Blocks.hash rpc_config ~chain ~block () >>=? fun hash -> + Shell_services.Chain.chain_id rpc_config ~chain () >>=? fun chain_id -> + return (chain_id, hash) + +type 'kind preapply_result = + Tezos_crypto.Operation_hash.t * 'kind operation * 'kind operation_metadata + +type 'kind result_list = + Tezos_crypto.Operation_hash.t + * 'kind contents_list + * 'kind contents_result_list + +type 'kind result = + Tezos_crypto.Operation_hash.t * 'kind contents * 'kind contents_result + +let get_manager_operation_gas_and_fee (contents : packed_contents_list) = + let l = Operation.to_list contents in + List.fold_left + (fun acc -> function + | Contents (Manager_operation {fee; gas_limit; _}) -> ( + match acc with + | Error _ as e -> e + | Ok (total_fee, total_gas) -> ( + match Tez.(total_fee +? fee) with + | Ok total_fee -> Ok (total_fee, Gas.Arith.add total_gas gas_limit) + | Error _ as e -> e)) + | _ -> acc) + (Ok (Tez.zero, Gas.Arith.zero)) + l + +type fee_parameter = { + minimal_fees : Tez.t; + minimal_nanotez_per_byte : Q.t; + minimal_nanotez_per_gas_unit : Q.t; + force_low_fee : bool; + fee_cap : Tez.t; + burn_cap : Tez.t; +} + +(* Rounding up (see Z.cdiv) *) +let z_mutez_of_q_nanotez (ntz : Q.t) = + let q_mutez = Q.div ntz (Q.of_int 1000) in + Z.cdiv q_mutez.Q.num q_mutez.Q.den + +let check_fees : + type t. + #Protocol_client_context.full -> + fee_parameter -> + t contents_list -> + int -> + unit Lwt.t = + fun cctxt config op size -> + match Contents_list op |> get_manager_operation_gas_and_fee with + | Error _ -> assert false (* FIXME *) + | Ok (fee, gas) -> + if Tez.compare fee config.fee_cap > 0 then + cctxt#error + "The proposed fee (%s%a) are higher than the configured fee cap \ + (%s%a).@\n\ + \ Use `--fee-cap %a` to emit this operation anyway." + Operation_result.tez_sym + Tez.pp + fee + Operation_result.tez_sym + Tez.pp + config.fee_cap + Tez.pp + fee + >>= fun () -> exit 1 + else + let fees_in_nanotez = + Q.mul (Q.of_int64 (Tez.to_mutez fee)) (Q.of_int 1000) + in + let minimal_fees_in_nanotez = + Q.mul (Q.of_int64 (Tez.to_mutez config.minimal_fees)) (Q.of_int 1000) + in + let minimal_fees_for_gas_in_nanotez = + Q.mul + config.minimal_nanotez_per_gas_unit + (Q.of_bigint (Gas.Arith.integral_to_z gas)) + in + let minimal_fees_for_size_in_nanotez = + Q.mul config.minimal_nanotez_per_byte (Q.of_int size) + in + let estimated_fees_in_nanotez = + Q.add + minimal_fees_in_nanotez + (Q.add + minimal_fees_for_gas_in_nanotez + minimal_fees_for_size_in_nanotez) + in + let estimated_fees_in_mutez = + z_mutez_of_q_nanotez estimated_fees_in_nanotez + in + let estimated_fees = + match Tez.of_mutez (Z.to_int64 estimated_fees_in_mutez) with + | None -> assert false + | Some fee -> fee + in + if + (not config.force_low_fee) + && Q.compare fees_in_nanotez estimated_fees_in_nanotez < 0 + then + cctxt#error + "The proposed fee (%s%a) are lower than the fee that baker expect \ + by default (%s%a).@\n\ + \ Use `--force-low-fee` to emit this operation anyway." + Operation_result.tez_sym + Tez.pp + fee + Operation_result.tez_sym + Tez.pp + estimated_fees + >>= fun () -> exit 1 + else Lwt.return_unit + +let print_for_verbose_signing ppf ~watermark ~bytes ~branch ~contents = + let open Format in + pp_open_vbox ppf 0 ; + let item f = + pp_open_hovbox ppf 4 ; + pp_print_string ppf " * " ; + f ppf () ; + pp_close_box ppf () ; + pp_print_cut ppf () + in + let hash_pp l = + fprintf + ppf + "%s" + (Tezos_crypto.Base58.raw_encode + Tezos_crypto.Blake2B.(hash_bytes l |> to_string)) + in + item (fun ppf () -> + pp_print_text ppf "Branch: " ; + Tezos_crypto.Block_hash.pp ppf branch) ; + item (fun ppf () -> + fprintf + ppf + "Watermark: `%a` (0x%s)" + Tezos_crypto.Signature.pp_watermark + watermark + (Hex.of_bytes (Tezos_crypto.Signature.bytes_of_watermark watermark) + |> Hex.show)) ; + item (fun ppf () -> + pp_print_text ppf "Operation bytes: " ; + TzString.fold_left (* We split the bytes into lines for display: *) + (fun n c -> + pp_print_char ppf c ; + if + n < 72 + (* is the email-body standard width, ideal for copy-pasting. *) + then n + 1 + else ( + pp_print_space ppf () ; + 0)) + 0 + (Hex.of_bytes bytes |> Hex.show) + |> ignore) ; + item (fun ppf () -> + pp_print_text ppf "Blake 2B Hash (raw): " ; + hash_pp [bytes]) ; + item (fun ppf () -> + pp_print_text + ppf + "Blake 2B Hash (ledger-style, with operation watermark): " ; + hash_pp [Tezos_crypto.Signature.bytes_of_watermark watermark; bytes]) ; + let json = + Data_encoding.Json.construct + Operation.unsigned_encoding + ({branch}, Contents_list contents) + in + item (fun ppf () -> + pp_print_text ppf "JSON encoding: " ; + Data_encoding.Json.pp ppf json) ; + pp_close_box ppf () + +let preapply (type t) (cctxt : #Protocol_client_context.full) ~chain ~block + ?(verbose_signing = false) ?fee_parameter ?branch ?src_sk + (contents : t contents_list) = + get_branch cctxt ~chain ~block branch >>=? fun (_chain_id, branch) -> + let bytes = + Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + ({branch}, Contents_list contents) + in + (match src_sk with + | None -> return_none + | Some src_sk -> + let watermark = + match contents with + (* TODO-TB sign endorsement? *) + | _ -> Tezos_crypto.Signature.Generic_operation + in + (if verbose_signing then + cctxt#message + "Pre-signature information (verbose signing):@.%t%!" + (print_for_verbose_signing ~watermark ~bytes ~branch ~contents) + else Lwt.return_unit) + >>= fun () -> + Client_keys.sign cctxt ~watermark src_sk bytes >>=? fun signature -> + return_some signature) + >>=? fun signature -> + let op : _ Operation.t = + {shell = {branch}; protocol_data = {contents; signature}} + in + let oph = Operation.hash op in + let packed_op = + {shell = {branch}; protocol_data = Operation_data {contents; signature}} + in + let size = Data_encoding.Binary.length Operation.encoding packed_op in + (match fee_parameter with + | Some fee_parameter -> check_fees cctxt fee_parameter contents size + | None -> Lwt.return_unit) + >>= fun () -> + Protocol_client_context.Alpha_block_services.Helpers.Preapply.operations + cctxt + ~chain + ~block + [Operation.pack op] + >>=? function + | [(Operation_data op', Operation_metadata result)] -> ( + match + ( Operation.equal op {shell = {branch}; protocol_data = op'}, + Apply_results.kind_equal_list contents result.contents ) + with + | Some Operation.Eq, Some Apply_results.Eq -> + return ((oph, op, result) : t preapply_result) + | _ -> failwith "Unexpected result") + | _ -> failwith "Unexpected result" + +let simulate (type t) (cctxt : #Protocol_client_context.full) ~chain ~block + ?(successor_level = false) ?branch + ?(latency = Plugin.RPC.default_operation_inclusion_latency) + (contents : t contents_list) = + get_branch cctxt ~chain ~block branch >>=? fun (_chain_id, branch) -> + let op : _ Operation.t = + {shell = {branch}; protocol_data = {contents; signature = None}} + in + let oph = Operation.hash op in + Chain_services.chain_id cctxt ~chain () >>=? fun chain_id -> + Plugin.RPC.Scripts.simulate_operation + cctxt + (chain, block) + ~successor_level + ~op:(Operation.pack op) + ~chain_id + ~latency + >>=? function + | Operation_data op', Operation_metadata result -> ( + match + ( Operation.equal op {shell = {branch}; protocol_data = op'}, + Apply_results.kind_equal_list contents result.contents ) + with + | Some Operation.Eq, Some Apply_results.Eq -> + return ((oph, op, result) : t preapply_result) + | _ -> failwith "Unexpected result") + | _ -> failwith "Unexpected result" + +let estimated_gas_single (type kind) + (Manager_operation_result {operation_result; internal_operation_results; _} : + kind Kind.manager contents_result) = + let consumed_gas (type kind) (result : kind manager_operation_result) = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | Transaction_result + ( Transaction_to_contract_result {consumed_gas; _} + | Transaction_to_tx_rollup_result {consumed_gas; _} + | Transaction_to_sc_rollup_result {consumed_gas; _} + | Transaction_to_zk_rollup_result {consumed_gas; _} ) + | Origination_result {consumed_gas; _} + | Reveal_result {consumed_gas} + | Delegation_result {consumed_gas} + | Register_global_constant_result {consumed_gas; _} + | Set_deposits_limit_result {consumed_gas} + | Update_consensus_key_result {consumed_gas; _} + | Increase_paid_storage_result {consumed_gas; _} + | Tx_rollup_origination_result {consumed_gas; _} + | Tx_rollup_submit_batch_result {consumed_gas; _} + | Tx_rollup_commit_result {consumed_gas; _} + | Tx_rollup_return_bond_result {consumed_gas; _} + | Tx_rollup_finalize_commitment_result {consumed_gas; _} + | Tx_rollup_remove_commitment_result {consumed_gas; _} + | Tx_rollup_rejection_result {consumed_gas; _} + | Tx_rollup_dispatch_tickets_result {consumed_gas; _} + | Transfer_ticket_result {consumed_gas; _} + | Dal_publish_slot_header_result {consumed_gas; _} + | Sc_rollup_originate_result {consumed_gas; _} + | Sc_rollup_add_messages_result {consumed_gas; _} + | Sc_rollup_cement_result {consumed_gas; _} + | Sc_rollup_publish_result {consumed_gas; _} + | Sc_rollup_refute_result {consumed_gas; _} + | Sc_rollup_timeout_result {consumed_gas; _} + | Sc_rollup_execute_outbox_message_result {consumed_gas; _} + | Sc_rollup_recover_bond_result {consumed_gas; _} -> + Ok consumed_gas + | Zk_rollup_origination_result {consumed_gas; _} -> Ok consumed_gas + | Zk_rollup_publish_result {consumed_gas; _} -> Ok consumed_gas + | Zk_rollup_update_result {consumed_gas; _} -> Ok consumed_gas) + | Skipped _ -> + error_with "Cannot estimate gas of skipped operation" + (* There must be another error for this to happen, and it should not + surface (the force mode catches it). *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + let internal_consumed_gas (type kind) + (result : kind internal_operation_result) = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | ITransaction_result + ( Transaction_to_contract_result {consumed_gas; _} + | Transaction_to_tx_rollup_result {consumed_gas; _} + | Transaction_to_sc_rollup_result {consumed_gas; _} + | Transaction_to_zk_rollup_result {consumed_gas; _} ) + | IOrigination_result {consumed_gas; _} + | IDelegation_result {consumed_gas} + | IEvent_result {consumed_gas} -> + Ok consumed_gas) + | Skipped _ -> + Ok Gas.Arith.zero (* there must be another error for this to happen *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + consumed_gas operation_result >>? fun gas -> + List.fold_left_e + (fun acc (Internal_operation_result (_, r)) -> + internal_consumed_gas r >>? fun gas -> Ok (Gas.Arith.add acc gas)) + gas + internal_operation_results + +let estimated_storage_single (type kind) ~tx_rollup_origination_size + ~origination_size + (Manager_operation_result {operation_result; internal_operation_results; _} : + kind Kind.manager contents_result) = + let storage_size_diff (type kind) (result : kind manager_operation_result) = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | Transaction_result + (Transaction_to_contract_result + {paid_storage_size_diff; allocated_destination_contract; _}) -> + if allocated_destination_contract then + Ok (Z.add paid_storage_size_diff origination_size) + else Ok paid_storage_size_diff + | Origination_result {paid_storage_size_diff; _} -> + Ok (Z.add paid_storage_size_diff origination_size) + | Register_global_constant_result {size_of_constant; _} -> + Ok size_of_constant + | Update_consensus_key_result _ -> Ok Z.zero + | Tx_rollup_origination_result _ -> Ok tx_rollup_origination_size + | Tx_rollup_submit_batch_result {paid_storage_size_diff; _} + | Sc_rollup_execute_outbox_message_result {paid_storage_size_diff; _} + | Tx_rollup_dispatch_tickets_result {paid_storage_size_diff; _} + | Transfer_ticket_result {paid_storage_size_diff; _} + | Zk_rollup_publish_result {paid_storage_size_diff; _} + | Zk_rollup_update_result {paid_storage_size_diff; _} + | Transaction_result + (Transaction_to_zk_rollup_result {paid_storage_size_diff; _}) -> + Ok paid_storage_size_diff + | Sc_rollup_originate_result {size; _} -> Ok size + | Zk_rollup_origination_result {storage_size; _} -> Ok storage_size + | Transaction_result (Transaction_to_tx_rollup_result _) -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2339 + Storage fees for transaction rollup. + We need to charge for newly allocated storage (as we do for + Michelson’s big map). *) + Ok Z.zero + | Transaction_result (Transaction_to_sc_rollup_result _) + | Reveal_result _ | Delegation_result _ | Set_deposits_limit_result _ + | Increase_paid_storage_result _ | Tx_rollup_commit_result _ + | Tx_rollup_return_bond_result _ + | Tx_rollup_finalize_commitment_result _ + | Tx_rollup_remove_commitment_result _ | Tx_rollup_rejection_result _ + | Dal_publish_slot_header_result _ | Sc_rollup_add_messages_result _ + (* The following Sc_rollup operations have zero storage cost because we + consider them to be paid in the stake deposit. + + TODO: https://gitlab.com/tezos/tezos/-/issues/2686 + Document why this is safe. + *) + | Sc_rollup_cement_result _ | Sc_rollup_publish_result _ + | Sc_rollup_refute_result _ | Sc_rollup_timeout_result _ + | Sc_rollup_recover_bond_result _ -> + Ok Z.zero) + | Skipped _ -> + error_with "Cannot estimate storage of skipped operation" + (* There must be another error for this to happen, and it should not + surface (the force mode catches it). *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + let internal_storage_size_diff (type kind) + (result : kind internal_operation_result) = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | ITransaction_result + (Transaction_to_contract_result + {paid_storage_size_diff; allocated_destination_contract; _}) -> + if allocated_destination_contract then + Ok (Z.add paid_storage_size_diff origination_size) + else Ok paid_storage_size_diff + | IOrigination_result {paid_storage_size_diff; _} -> + Ok (Z.add paid_storage_size_diff origination_size) + | ITransaction_result (Transaction_to_tx_rollup_result _) -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2339 + Storage fees for transaction rollup. + We need to charge for newly allocated storage (as we do for + Michelson’s big map). *) + Ok Z.zero + | ITransaction_result + (Transaction_to_zk_rollup_result {paid_storage_size_diff; _}) -> + Ok paid_storage_size_diff + | ITransaction_result (Transaction_to_sc_rollup_result _) + | IDelegation_result _ | IEvent_result _ -> + Ok Z.zero) + | Skipped _ -> + Ok Z.zero (* there must be another error for this to happen *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + storage_size_diff operation_result >>? fun storage -> + List.fold_left_e + (fun acc (Internal_operation_result (_, r)) -> + internal_storage_size_diff r >>? fun storage -> Ok (Z.add acc storage)) + storage + internal_operation_results + +let estimated_storage ~tx_rollup_origination_size ~origination_size res = + let rec estimated_storage : type kind. kind contents_result_list -> _ = + function + | Single_result (Manager_operation_result _ as res) -> + estimated_storage_single + ~tx_rollup_origination_size + ~origination_size + res + | Single_result _ -> Ok Z.zero + | Cons_result (res, rest) -> + estimated_storage_single + ~tx_rollup_origination_size + ~origination_size + res + >>? fun storage1 -> + estimated_storage rest >>? fun storage2 -> Ok (Z.add storage1 storage2) + in + estimated_storage res >>? fun diff -> Ok (Z.max Z.zero diff) + +let originated_contracts_single (type kind) + (Manager_operation_result {operation_result; internal_operation_results; _} : + kind Kind.manager contents_result) = + let originated_contracts (type kind) (result : kind manager_operation_result) + = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | Transaction_result + (Transaction_to_contract_result {originated_contracts; _}) + | Origination_result {originated_contracts; _} -> + Ok originated_contracts + | Transaction_result + ( Transaction_to_tx_rollup_result _ + | Transaction_to_sc_rollup_result _ + | Transaction_to_zk_rollup_result _ ) + | Register_global_constant_result _ | Reveal_result _ + | Delegation_result _ | Set_deposits_limit_result _ + | Update_consensus_key_result _ | Increase_paid_storage_result _ + | Tx_rollup_origination_result _ | Tx_rollup_submit_batch_result _ + | Tx_rollup_commit_result _ | Tx_rollup_return_bond_result _ + | Tx_rollup_finalize_commitment_result _ + | Tx_rollup_remove_commitment_result _ | Tx_rollup_rejection_result _ + | Tx_rollup_dispatch_tickets_result _ | Transfer_ticket_result _ + | Dal_publish_slot_header_result _ | Sc_rollup_originate_result _ + | Sc_rollup_add_messages_result _ | Sc_rollup_cement_result _ + | Sc_rollup_publish_result _ | Sc_rollup_refute_result _ + | Sc_rollup_timeout_result _ | Sc_rollup_execute_outbox_message_result _ + | Sc_rollup_recover_bond_result _ | Zk_rollup_origination_result _ + | Zk_rollup_publish_result _ | Zk_rollup_update_result _ -> + Ok []) + | Skipped _ -> + error_with "Cannot know originated contracts of skipped operation" + (* There must be another error for this to happen, and it should not + surface (the force mode catches it). *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + let internal_originated_contracts (type kind) + (result : kind internal_operation_result) = + match result with + | Applied res | Backtracked (res, _) -> ( + match res with + | ITransaction_result + (Transaction_to_contract_result {originated_contracts; _}) + | IOrigination_result {originated_contracts; _} -> + Ok originated_contracts + | ITransaction_result + ( Transaction_to_tx_rollup_result _ + | Transaction_to_sc_rollup_result _ + | Transaction_to_zk_rollup_result _ ) + | IDelegation_result _ | IEvent_result _ -> + Ok []) + | Skipped _ -> Ok [] (* there must be another error for this to happen *) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + originated_contracts operation_result >>? fun contracts -> + let contracts = List.rev contracts in + List.fold_left_e + (fun acc (Internal_operation_result (_, r)) -> + internal_originated_contracts r >>? fun contracts -> + Ok (List.rev_append contracts acc)) + contracts + internal_operation_results + +let rec originated_contracts : type kind. kind contents_result_list -> _ = + function + | Single_result (Manager_operation_result _ as res) -> + originated_contracts_single res >|? List.rev + | Single_result _ -> Ok [] + | Cons_result (res, rest) -> + originated_contracts_single res >>? fun contracts1 -> + originated_contracts rest >>? fun contracts2 -> + Ok (List.rev_append contracts1 contracts2) + +let estimated_storage_single ~force ~tx_rollup_origination_size + ~origination_size result = + match + estimated_storage_single + ~tx_rollup_origination_size + ~origination_size + result + with + | Error _ when force -> Ok Z.zero + | res -> res + +let estimated_storage ~force ~tx_rollup_origination_size ~origination_size + result = + match + estimated_storage ~tx_rollup_origination_size ~origination_size result + with + | Error _ when force -> Ok Z.zero + | res -> res + +(* When --force is used, we don't want [originated_contracts] to fail as + it would stop the client before the injection of the operation. *) +let originated_contracts ~force results = + match originated_contracts results with Error _ when force -> Ok [] | e -> e + +let detect_script_failure : type kind. kind operation_metadata -> _ = + let rec detect_script_failure : type kind. kind contents_result_list -> _ = + let detect_script_failure_single (type kind) + (Manager_operation_result + {operation_result; internal_operation_results; _} : + kind Kind.manager contents_result) = + let detect_script_failure (type kind) + (result : (kind, _, _) operation_result) = + match result with + | Applied _ -> Ok () + | Skipped _ -> assert false + | Backtracked (_, None) -> + (* there must be another error for this to happen *) + Ok () + | Backtracked (_, Some errs) -> + record_trace + (error_of_fmt "The transfer simulation failed.") + (Error (Environment.wrap_tztrace errs)) + | Failed (_, errs) -> + record_trace + (error_of_fmt "The transfer simulation failed.") + (Error (Environment.wrap_tztrace errs)) + in + detect_script_failure operation_result >>? fun () -> + List.iter_e + (fun (Internal_operation_result (_, r)) -> detect_script_failure r) + internal_operation_results + in + function + | Single_result (Manager_operation_result _ as res) -> + detect_script_failure_single res + | Single_result _ -> Ok () + | Cons_result (res, rest) -> + detect_script_failure_single res >>? fun () -> + detect_script_failure rest + in + fun {contents} -> detect_script_failure contents + +let signature_size_of_algo : Tezos_crypto.Signature.algo -> int = function + | Ed25519 -> Tezos_crypto.Ed25519.size + | Secp256k1 -> Tezos_crypto.Secp256k1.size + | P256 -> Tezos_crypto.P256.size + | Bls -> + (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] + prefix and a tag [03]. *) + Tezos_crypto.Bls.size + 2 + +(* This value is used as a safety guard for gas limit. *) +let safety_guard = Gas.Arith.(integral_of_int_exn 100) + +(* + + {2 High-level description of the automatic gas patching algorithm} + + When the user wants to inject a list of operations, some of which + might have unspecified gas, fees or storage limit, the client + performs a {e simulation} to estimate those limits and assign + sensible values to them. + + The simulation works as follows: + 1. limits are assigned to dummy, high values to ensure that the operations + can be simulated + - 1.a) when a list of operations is partially specified, the algorithm + allocates to each unspecified operation an equal portion of the + maximum gas per block minus the gas consumed by the operations that + do specify their limit + 2. the algorithm retrieves the effectively consumed gas and storage from the + receipt + 3. the algorithm assigns slight over-approximations to the operation + 4. a default fee is computed and set + +*) + +let may_patch_limits (type kind) (cctxt : #Protocol_client_context.full) + ~fee_parameter ~signature_algo ~chain ~block ?successor_level ?branch + ?(force = false) ?(simulation = false) + (annotated_contents : kind Annotated_manager_operation.annotated_list) : + kind Kind.manager contents_list tzresult Lwt.t = + Tezos_client_base.Client_confirmations.wait_for_bootstrapped cctxt + >>=? fun () -> + Alpha_services.Constants.all cctxt (chain, block) + >>=? fun { + parametric = + { + hard_gas_limit_per_operation; + hard_gas_limit_per_block; + hard_storage_limit_per_operation; + origination_size; + tx_rollup = {origination_size = tx_rollup_origination_size; _}; + cost_per_byte; + _; + }; + _; + } -> + let user_gas_limit_needs_patching user_gas_limit = + Limit.fold user_gas_limit ~unknown:true ~known:(fun user_gas_limit -> + Gas.Arith.( + user_gas_limit < zero || hard_gas_limit_per_operation < user_gas_limit)) + in + let user_storage_limit_needs_patching user_storage_limit = + Limit.fold + user_storage_limit + ~unknown:true + ~known:(fun user_storage_limit -> + Z.Compare.( + user_storage_limit < Z.zero + || hard_storage_limit_per_operation < user_storage_limit)) + in + let gas_patching_stats (Annotated_manager_operation.Manager_info c) + need_patching gas_consumed = + if user_gas_limit_needs_patching c.gas_limit then + (need_patching + 1, gas_consumed) + else + ( need_patching, + Gas.Arith.add + gas_consumed + (Limit.value ~when_unknown:Gas.Arith.zero c.gas_limit) ) + in + let rec gas_patching_stats_list : + type kind. + kind Annotated_manager_operation.annotated_list -> + int -> + Gas.Arith.integral -> + int * Gas.Arith.integral = + fun op need_patching gas_consumed -> + match op with + | Single_manager minfo -> + gas_patching_stats minfo need_patching gas_consumed + | Cons_manager (minfo, rest) -> + let need_patching, gas_consumed = + gas_patching_stats minfo need_patching gas_consumed + in + gas_patching_stats_list rest need_patching gas_consumed + in + let may_need_patching_single : + type kind. + Gas.Arith.integral -> + kind Annotated_manager_operation.t -> + kind Annotated_manager_operation.t option = + fun gas_limit_per_patched_op op -> + match op with + | Manager_info c -> + let needs_patching = + Limit.is_unknown c.fee + || user_gas_limit_needs_patching c.gas_limit + || user_storage_limit_needs_patching c.storage_limit + in + if not needs_patching then None + else + (* Set limits for simulation purposes *) + let gas_limit = + if user_gas_limit_needs_patching c.gas_limit then + Limit.known gas_limit_per_patched_op + else c.gas_limit + in + let storage_limit = + if user_storage_limit_needs_patching c.storage_limit then + Limit.known hard_storage_limit_per_operation + else c.storage_limit + in + let fee = Limit.value ~when_unknown:Tez.zero c.fee in + Some + (Manager_info + {c with gas_limit; storage_limit; fee = Limit.known fee}) + in + let may_need_patching gas_limit_per_patched_op ops = + let rec loop : + type kind. + kind Annotated_manager_operation.annotated_list -> + kind Annotated_manager_operation.annotated_list option = function + | Single_manager annotated_op -> + Option.map (fun op -> Annotated_manager_operation.Single_manager op) + @@ may_need_patching_single gas_limit_per_patched_op annotated_op + | Cons_manager (annotated_op, rest) -> ( + let annotated_op_opt = + may_need_patching_single gas_limit_per_patched_op annotated_op + in + let rest_opt = loop rest in + match (annotated_op_opt, rest_opt) with + | None, None -> None + | _ -> + let op = Option.value ~default:annotated_op annotated_op_opt in + let rest = Option.value ~default:rest rest_opt in + Some (Cons_manager (op, rest))) + in + loop ops + in + (* + The recursion here handles the case where an increased fee might increase the + size of the operation, and so require a recalculation of the gas costs. + Rationale for termination: + - the fee for size increases linearly with the size of the operation. + - however, when the size of the operation increase to make space for an + increased fee, the amount of new fee that can be added without increasing + the size of the block again increases exponentially. + - hence, there will eventually be a increase of size that will fit any new + fee without having to increase the size of the operation again. + *) + let rec patch_fee : type kind. first:bool -> kind contents -> kind contents = + fun ~first -> function + | Manager_operation c as op -> ( + let size = + if first then + (WithExceptions.Option.get ~loc:__LOC__ + @@ Data_encoding.Binary.fixed_length + Tezos_base.Operation.shell_header_encoding) + + Data_encoding.Binary.length + Operation.contents_encoding + (Contents op) + + signature_size_of_algo signature_algo + else + Data_encoding.Binary.length + Operation.contents_encoding + (Contents op) + in + let minimal_fees_in_nanotez = + Q.mul + (Q.of_int64 (Tez.to_mutez fee_parameter.minimal_fees)) + (Q.of_int 1000) + in + let minimal_fees_for_gas_in_nanotez = + Q.mul + fee_parameter.minimal_nanotez_per_gas_unit + (Q.of_bigint @@ Gas.Arith.integral_to_z c.gas_limit) + in + let minimal_fees_for_size_in_nanotez = + Q.mul fee_parameter.minimal_nanotez_per_byte (Q.of_int size) + in + let fees_in_nanotez = + Q.add minimal_fees_in_nanotez + @@ Q.add + minimal_fees_for_gas_in_nanotez + minimal_fees_for_size_in_nanotez + in + let fees_in_mutez = z_mutez_of_q_nanotez fees_in_nanotez in + match Tez.of_mutez (Z.to_int64 fees_in_mutez) with + | None -> assert false + | Some fee -> + if Tez.(fee <= c.fee) then op + else patch_fee ~first (Manager_operation {c with fee})) + | c -> c + in + let patch : + type kind. + first:bool -> + kind Annotated_manager_operation.t * kind Kind.manager contents_result -> + kind Kind.manager contents tzresult Lwt.t = + fun ~first -> function + | (Manager_info c as op), (Manager_operation_result _ as result) -> + (if user_gas_limit_needs_patching c.gas_limit then + Lwt.return (estimated_gas_single result) >>= fun gas -> + match gas with + | Error _ when force -> + (* When doing a simulation, set gas to hard limit so as to not change + the error. When force injecting a failing operation, set gas to + zero to not pay fees for this operation. *) + let gas = + if simulation then hard_gas_limit_per_operation + else Gas.Arith.zero + in + return + (Annotated_manager_operation.set_gas_limit (Limit.known gas) op) + | Error _ as res -> Lwt.return res + | Ok gas -> + if Gas.Arith.(gas = zero) then + cctxt#message "Estimated gas: none" >>= fun () -> + return + (Annotated_manager_operation.set_gas_limit + (Limit.known Gas.Arith.zero) + op) + else + let safety_guard = + match c.operation with + | Transaction {destination = Implicit _; _} + | Reveal _ | Delegation _ | Set_deposits_limit _ + | Increase_paid_storage _ -> + Gas.Arith.zero + | _ -> safety_guard + in + cctxt#message + "Estimated gas: %a units (will add %a for safety)" + Gas.Arith.pp + gas + Gas.Arith.pp + safety_guard + >>= fun () -> + let safe_gas = Gas.Arith.(add (ceil gas) safety_guard) in + let patched_gas = + Gas.Arith.min safe_gas hard_gas_limit_per_operation + in + return + (Annotated_manager_operation.set_gas_limit + (Limit.known patched_gas) + op) + else return op) + >>=? fun op -> + (if user_storage_limit_needs_patching c.storage_limit then + Lwt.return + (estimated_storage_single + ~tx_rollup_origination_size:(Z.of_int tx_rollup_origination_size) + ~origination_size:(Z.of_int origination_size) + ~force + result) + >>=? fun storage -> + if Z.equal storage Z.zero then + cctxt#message "Estimated storage: no bytes added" >>= fun () -> + return + (Annotated_manager_operation.set_storage_limit + (Limit.known Z.zero) + op) + else + cctxt#message + "Estimated storage: %s bytes added (will add 20 for safety)" + (Z.to_string storage) + >>= fun () -> + let storage_limit = + Z.min + (Z.add storage (Z.of_int 20)) + hard_storage_limit_per_operation + in + return + (Annotated_manager_operation.set_storage_limit + (Limit.known storage_limit) + op) + else return op) + >>=? fun op -> + if Limit.is_unknown c.fee then + (* Setting a dummy fee is required for converting to manager op *) + let op = + Annotated_manager_operation.set_fee (Limit.known Tez.zero) op + in + Annotated_manager_operation.manager_from_annotated op >>?= fun cm -> + return (patch_fee ~first cm) + else Lwt.return (Annotated_manager_operation.manager_from_annotated op) + in + let rec patch_list : + type kind. + bool -> + kind Annotated_manager_operation.annotated_list -> + kind Kind.manager contents_result_list -> + kind Kind.manager contents_list tzresult Lwt.t = + fun first annotated_list result_list -> + match (annotated_list, result_list) with + | Single_manager annotated, Single_result res -> + patch ~first (annotated, res) >>=? fun op -> return (Single op) + | Cons_manager (annotated, annotated_rest), Cons_result (res, res_rest) -> + patch ~first (annotated, res) >>=? fun op -> + patch_list false annotated_rest res_rest >>=? fun rest -> + return (Cons (op, rest)) + | _ -> assert false + in + let gas_limit_per_patched_op = + let need_gas_patching, gas_consumed = + gas_patching_stats_list annotated_contents 0 Gas.Arith.zero + in + if need_gas_patching = 0 then hard_gas_limit_per_operation + else + let remaining_gas = Gas.Arith.sub hard_gas_limit_per_block gas_consumed in + let average_per_operation_gas = + Gas.Arith.integral_exn + @@ Z.div + (Gas.Arith.integral_to_z remaining_gas) + (Z.of_int need_gas_patching) + in + Gas.Arith.min hard_gas_limit_per_operation average_per_operation_gas + in + match may_need_patching gas_limit_per_patched_op annotated_contents with + | Some annotated_for_simulation -> + Lwt.return + (Annotated_manager_operation.manager_list_from_annotated + annotated_for_simulation) + >>=? fun contents_for_simulation -> + simulate + cctxt + ~chain + ~block + ?successor_level + ?branch + contents_for_simulation + >>=? fun (_, _, result) -> + (match detect_script_failure result with + | Ok () -> return_unit + | Error _ -> + cctxt#message + "@[<v 2>This simulation failed:@,%a@]" + Operation_result.pp_operation_result + (contents_for_simulation, result.contents) + >>= fun () -> return_unit) + >>=? fun () -> + ( Lwt.return + (estimated_storage + ~tx_rollup_origination_size:(Z.of_int tx_rollup_origination_size) + ~origination_size:(Z.of_int origination_size) + ~force + result.contents) + >>=? fun storage -> + Lwt.return + (Environment.wrap_tzresult Tez.(cost_per_byte *? Z.to_int64 storage)) + >>=? fun burn -> + if Tez.(burn > fee_parameter.burn_cap) then + cctxt#error + "The operation will burn %s%a which is higher than the configured \ + burn cap (%s%a).@\n\ + \ Use `--burn-cap %a` to emit this operation." + Operation_result.tez_sym + Tez.pp + burn + Operation_result.tez_sym + Tez.pp + fee_parameter.burn_cap + Tez.pp + burn + >>= fun () -> exit 1 + else return_unit ) + >>=? fun () -> patch_list true annotated_contents result.contents + | None -> + Lwt.return + (Annotated_manager_operation.manager_list_from_annotated + annotated_contents) + +let tenderbake_finality_confirmations = 1 + +let tenderbake_adjust_confirmations (cctxt : #Client_context.full) = function + | None -> Lwt.return_none + | Some cli_confirmations -> + if cli_confirmations > tenderbake_finality_confirmations then + cctxt#message + "Tenderbake needs at most %d confirmations for finality (%d given). \ + Using %d confirmations." + tenderbake_finality_confirmations + cli_confirmations + tenderbake_finality_confirmations + >>= fun () -> Lwt.return_some tenderbake_finality_confirmations + else Lwt.return_some cli_confirmations + +(* For Tenderbake we restrain the interval of confirmations to be [0, + tenderbake_finality_confirmations] + + Any value greater than the tenderbake_finality_confirmations is treated as if it + were tenderbake_finality_confirmations. +*) +let inject_operation_internal (type kind) cctxt ~chain ~block ?confirmations + ?(dry_run = false) ?(simulation = false) ?(force = false) ?successor_level + ?branch ?src_sk ?verbose_signing ?fee_parameter + (contents : kind contents_list) = + (if simulation then + simulate cctxt ~chain ~block ?successor_level ?branch contents + else + preapply + cctxt + ~chain + ~block + ?fee_parameter + ?verbose_signing + ?branch + ?src_sk + contents) + >>=? fun (_oph, op, result) -> + (match detect_script_failure result with + | Ok () -> return_unit + | Error _ as res -> + cctxt#message + "@[<v 2>This simulation failed (force = %b):@,%a@]" + force + Operation_result.pp_operation_result + (op.protocol_data.contents, result.contents) + >>= fun () -> if force then return_unit else Lwt.return res) + >>=? fun () -> + let bytes = + Data_encoding.Binary.to_bytes_exn Operation.encoding (Operation.pack op) + in + if dry_run || simulation then + let oph = Tezos_crypto.Operation_hash.hash_bytes [bytes] in + cctxt#message + "@[<v 0>Operation: 0x%a@,Operation hash is '%a'@]" + Hex.pp + (Hex.of_bytes bytes) + Tezos_crypto.Operation_hash.pp + oph + >>= fun () -> + cctxt#message + "@[<v 2>Simulation result:@,%a@]" + Operation_result.pp_operation_result + (op.protocol_data.contents, result.contents) + >>= fun () -> return (oph, op, result.contents) + else + Shell_services.Injection.operation cctxt ~chain bytes >>=? fun oph -> + cctxt#message "Operation successfully injected in the node." >>= fun () -> + cctxt#message "Operation hash is '%a'" Tezos_crypto.Operation_hash.pp oph + >>= fun () -> + (* Adjust user-provided confirmations with respect to Alpha protocol finality properties *) + tenderbake_adjust_confirmations cctxt confirmations >>= fun confirmations -> + (match confirmations with + | None -> + cctxt#message + "@[<v 0>NOT waiting for the operation to be included.@,\ + Use command@,\ + \ octez-client wait for %a to be included --confirmations %d \ + --branch %a@,\ + and/or an external block explorer to make sure that it has been \ + included.@]" + Tezos_crypto.Operation_hash.pp + oph + tenderbake_finality_confirmations + Tezos_crypto.Block_hash.pp + op.shell.branch + >>= fun () -> return result + | Some confirmations -> ( + cctxt#message "Waiting for the operation to be included..." + >>= fun () -> + Client_confirmations.wait_for_operation_inclusion + ~branch:op.shell.branch + ~confirmations + cctxt + ~chain + oph + >>=? fun (h, i, j) -> + Alpha_block_services.Operations.operation + cctxt + ~chain + ~block:(`Hash (h, 0)) + i + j + >>=? fun op' -> + match op'.receipt with + | Empty -> failwith "Internal error: pruned metadata." + | Too_large -> failwith "Internal error: too large metadata." + | Receipt No_operation_metadata -> + cctxt#message + "The operation metadata was not stored because it was too big, \ + thus the failure to display the receipt." + >>= fun () -> failwith "Internal error: unexpected receipt." + | Receipt (Operation_metadata receipt) -> ( + match Apply_results.kind_equal_list contents receipt.contents with + | Some Apply_results.Eq -> + return (receipt : kind operation_metadata) + | None -> failwith "Internal error: unexpected receipt."))) + >>=? fun result -> + cctxt#message + "@[<v 2>This sequence of operations was run:@,%a@]" + Operation_result.pp_operation_result + (op.protocol_data.contents, result.contents) + >>= fun () -> + Lwt.return (originated_contracts result.contents ~force) + >>=? fun contracts -> + List.iter_s + (fun c -> cctxt#message "New contract %a originated." Contract_hash.pp c) + contracts + >>= fun () -> + (match confirmations with + | None -> Lwt.return_unit + | Some number -> + if number >= tenderbake_finality_confirmations then + cctxt#message + "The operation was included in a block %d blocks ago." + number + else + cctxt#message + "@[<v 0>The operation has only been included %d blocks ago.@,\ + We recommend to wait more.@,\ + Use command@,\ + \ octez-client wait for %a to be included --confirmations %d \ + --branch %a@,\ + and/or an external block explorer.@]" + number + Tezos_crypto.Operation_hash.pp + oph + tenderbake_finality_confirmations + Tezos_crypto.Block_hash.pp + op.shell.branch) + >>= fun () -> return (oph, op, result.contents) + +let inject_operation (type kind) cctxt ~chain ~block ?confirmations + ?(dry_run = false) ?(simulation = false) ?successor_level ?branch ?src_sk + ?verbose_signing ?fee_parameter (contents : kind contents_list) = + Tezos_client_base.Client_confirmations.wait_for_bootstrapped cctxt + >>=? fun () -> + inject_operation_internal + cctxt + ~chain + ~block + ?confirmations + ~dry_run + ~simulation + ?successor_level + ?branch + ?src_sk + ?verbose_signing + ?fee_parameter + (contents : kind contents_list) + >|=? fun (oph, op, result) -> (oph, op.protocol_data.contents, result) + +let prepare_manager_operation ~fee ~gas_limit ~storage_limit operation = + Annotated_manager_operation.Manager_info + {source = None; fee; gas_limit; storage_limit; counter = None; operation} + +(* [gas_limit] must correspond to + [Michelson_v1_gas.Cost_of.manager_operation] *) +let cost_of_manager_operation = Gas.Arith.integral_of_int_exn 1_000 + +let reveal_error_message = + "Requested operation requires to perform a public key revelation beforehand.\n\ + This cannot be done automatically when a custom fee or storage limit is \ + given.\n\ + If you wish to use a custom fee or storage limit, please first perform the \ + reveal operation separately using the dedicated command.\n\ + Otherwise, please do not specify custom fee or storage parameters." + +let reveal_error (cctxt : #Protocol_client_context.full) = + cctxt#error "%s" reveal_error_message + +(* This function first gets the pending operations in the prevalidator. Then, + it filters those that have an applied status from the given src. *) +let pending_applied_operations_of_source (cctxt : #full) chain src : + packed_contents_list list Lwt.t = + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2273 + Be able to get pending/applied/prechecked operation of an implicit account. + *) + Alpha_block_services.Mempool.pending_operations cctxt ~chain () >>= function + | Error e -> + cctxt#error + "Error while fetching pending operations: %a@." + Error_monad.pp_print_trace + e + >>= fun () -> exit 1 + | Ok ops -> + Lwt.return + @@ List.fold_left + (fun acc (_oph, {protocol_data = Operation_data {contents; _}; _}) -> + match contents with + | Single (Manager_operation {source; _} as _op) + when Tezos_crypto.Signature.Public_key_hash.equal source src -> + Contents_list contents :: acc + | Cons (Manager_operation {source; _}, _rest) as _op + when Tezos_crypto.Signature.Public_key_hash.equal source src -> + Contents_list contents :: acc + | _ -> acc) + [] + ops.Alpha_block_services.Mempool.applied + +(* Given the gas and fee of an applied operation in the mempool, and the + estimated gas of a new operation to inject, this function returns + the amount of fee to put in the new operation to be able to replace + the one already in the mempool *) +let compute_replacement_fees = + let q_fee_from_tez f = Tez.to_mutez f |> Z.of_int64 |> Q.of_bigint in + let q_gas g = Gas.Arith.integral_to_z g |> Q.of_bigint in + fun (cctxt : #full) old_op_fee old_op_gas new_op_gas -> + (* convert quantities to rationals *) + let old_op_fee = q_fee_from_tez old_op_fee in + let old_op_gas = q_gas old_op_gas in + let new_op_gas = q_gas new_op_gas in + + (* compute the fee / gas ratio of the old operation *) + let old_op_ratio = Q.div old_op_fee old_op_gas in + + (* compute the equivalent (proportional) in fees of the new operation using + the old operation's ratio *) + let proportional_fee = Q.mul old_op_ratio new_op_gas in + + (* Fees cannot be smaller than estimated fees of the old or new op *) + let max_fee = Q.max proportional_fee old_op_fee in + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2274 + Get the factor 1.05% from the plugin via an RPC *) + let repl_q_fee = Q.mul max_fee (Q.make (Z.of_int 105) (Z.of_int 100)) in + let repl_z_fee = Z.cdiv (Q.num repl_q_fee) (Q.den repl_q_fee) in + try + match Z.to_int64 repl_z_fee |> Tez.of_mutez with + | Some replacement_fee -> Lwt.return replacement_fee + | None -> + cctxt#error "Tez underflow while computing replacement fee@." + >>= fun () -> exit 1 + with Z.Overflow -> + cctxt#error "Tez overflow while computing replacement fee@." >>= fun () -> + exit 1 + +(* Given an operation to inject whose gas and fee are set, and the amount + of fee the operation should pay to replace an existing applied operation + in the mempool, this function computes the delta "replacement fee - + operation's fee" and adds it to the operation. *) +let bump_manager_op_fee = + (* Internal function to bump the fee of a manager operation by a delta *) + let bump_manager (cctxt : #full) delta = function + | Manager_operation + {source; fee; counter; operation; gas_limit; storage_limit} -> + (match Tez.( +? ) fee delta with + | Error _ -> + cctxt#error "Tez overflow while computing replacement fee@." + >>= fun () -> exit 1 + | Ok new_fee -> Lwt.return new_fee) + >>= fun fee -> + Lwt.return + @@ Manager_operation + {source; fee; counter; operation; gas_limit; storage_limit} + in + fun (type kind) + (cctxt : #full) + (contents : kind Kind.manager contents_list) + new_fee + replacement_fee + ~user_fee -> + (* We compute delta replacement_fee - new_fee *) + match Tez.sub_opt replacement_fee new_fee with + | None -> + (* This can happen for instance if the user provided fee with + command-line that are higher than the replacement threshold *) + Lwt.return_ok contents + | Some delta -> + if Tez.equal delta Tez.zero then + (* This can happen for instance if the user provided fee with + command-line that are equal to the replacement threshold *) + Lwt.return_ok contents + else if Limit.is_unknown user_fee then + match contents with + | Single (Manager_operation _ as op) -> + (* We add the delta to the op in case it's a Single *) + bump_manager (cctxt : #full) delta op >>= fun op -> + Lwt.return_ok @@ Single op + | Cons ((Manager_operation _ as op), rest) -> + (* We add the delta to the first op in case it's a batch *) + bump_manager (cctxt : #full) delta op >>= fun op -> + Lwt.return_ok @@ Cons (op, rest) + else + cctxt#error + "The fee provided by the user is lower than the expected \ + replacement fee. Threshold is %a but got %a.@." + Tez.pp + replacement_fee + Tez.pp + new_fee + (* New fee in this case correspond to provided user fee *) + >>= fun () -> exit 1 + +(* Bump the fee of the given operation whose fee have been computed by + simulation, to be able to replace an existing applied operation in the + mempool from the same source *) +let replace_operation (type kind) (cctxt : #full) chain source + (contents : kind Kind.manager contents_list) ~user_fee : + kind Kind.manager contents_list tzresult Lwt.t = + let exit_err ~is_new_op e = + cctxt#error + "Unexpected error while getting gas and fees of user's %s operation.@.\n\ + Error: %a@." + (if is_new_op then "new" else "old") + Error_monad.pp_print_trace + (Environment.wrap_tztrace e) + >>= fun () -> exit 1 + in + match Contents_list contents |> get_manager_operation_gas_and_fee with + | Error e -> exit_err ~is_new_op:true e + | Ok (new_op_fee, new_op_gas) -> ( + pending_applied_operations_of_source cctxt chain source >>= function + | [] -> + cctxt#error + "Cannot replace! No applied manager operation found for %a in \ + mempool@." + Tezos_crypto.Signature.Public_key_hash.pp + source + >>= fun () -> exit 1 + | _ :: _ :: _ as l -> + cctxt#error + "More than one applied manager operation found for %a in mempool. \ + Found %d operations. Are you sure the node is in precheck mode?@." + Tezos_crypto.Signature.Public_key_hash.pp + source + (List.length l) + >>= fun () -> exit 1 + | [old_contents] -> ( + get_manager_operation_gas_and_fee old_contents |> function + | Error e -> exit_err ~is_new_op:false e + | Ok (old_op_fee, old_op_gas) -> + compute_replacement_fees cctxt old_op_fee old_op_gas new_op_gas + >>= bump_manager_op_fee cctxt contents new_op_fee ~user_fee)) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2276 + https://gitlab.com/tezos/tezos/-/issues/2276 *) +let may_replace_operation (type kind) (cctxt : #full) chain from + ~replace_by_fees ~user_fee (contents : kind Kind.manager contents_list) : + kind Kind.manager contents_list tzresult Lwt.t = + if replace_by_fees then replace_operation cctxt chain from contents ~user_fee + else (* No replace by fees requested *) + Lwt.return_ok contents + +let inject_manager_operation cctxt ~chain ~block ?successor_level ?branch + ?confirmations ?dry_run ?verbose_signing ?simulation ?force ~source + ~(src_pk : public_key) ~src_sk ~fee ~gas_limit ~storage_limit ?counter + ?(replace_by_fees = false) ~fee_parameter (type kind) + (operations : kind Annotated_manager_operation.annotated_list) : + (Tezos_crypto.Operation_hash.t + * packed_operation + * kind Kind.manager contents_list + * kind Kind.manager contents_result_list) + tzresult + Lwt.t = + (match counter with + | None -> + Alpha_services.Contract.counter cctxt (chain, block) source + >>=? fun pcounter -> + let counter = Manager_counter.succ pcounter in + return counter + | Some counter -> return counter) + >>=? fun counter -> + Alpha_services.Contract.manager_key cctxt (chain, block) source + >>=? fun key -> + (* [has_reveal] assumes that a Reveal operation only appears as the first of a batch *) + let has_reveal : + type kind. kind Annotated_manager_operation.annotated_list -> bool = + function + | Single_manager (Manager_info {operation = Reveal _; _}) -> true + | Cons_manager (Manager_info {operation = Reveal _; _}, _) -> true + | _ -> false + in + let signature_algo = + match src_pk with + | Ed25519 _ -> Tezos_crypto.Signature.Ed25519 + | Secp256k1 _ -> Secp256k1 + | P256 _ -> P256 + | Bls _ -> Bls + in + let apply_specified_options counter op = + Annotated_manager_operation.set_source source op >>? fun op -> + Annotated_manager_operation.set_counter counter op >>? fun op -> + Annotated_manager_operation.join_fee fee op >>? fun op -> + Annotated_manager_operation.join_gas_limit gas_limit op >>? fun op -> + Annotated_manager_operation.join_storage_limit storage_limit op + in + let rec build_contents : + type kind. + Manager_counter.t -> + kind Annotated_manager_operation.annotated_list -> + kind Annotated_manager_operation.annotated_list tzresult = + fun counter -> function + | Single_manager op -> + apply_specified_options counter op >|? fun op -> + Annotated_manager_operation.Single_manager op + | Cons_manager (op, rest) -> + apply_specified_options counter op >>? fun op -> + build_contents (Manager_counter.succ counter) rest >|? fun rest -> + Annotated_manager_operation.Cons_manager (op, rest) + in + match key with + | None when not (has_reveal operations) -> ( + (if not (Limit.is_unknown fee && Limit.is_unknown storage_limit) then + reveal_error cctxt + else return_unit) + >>=? fun () -> + let reveal = + prepare_manager_operation + ~fee:Limit.unknown + ~gas_limit:(Limit.known cost_of_manager_operation) + ~storage_limit:Limit.unknown + (Reveal src_pk) + in + Annotated_manager_operation.set_source source reveal >>?= fun reveal -> + Annotated_manager_operation.set_counter counter reveal >>?= fun reveal -> + build_contents (Manager_counter.succ counter) operations >>?= fun rest -> + let contents = Annotated_manager_operation.Cons_manager (reveal, rest) in + may_patch_limits + cctxt + ~fee_parameter + ~signature_algo + ~chain + ~block + ?force + ?simulation + ?successor_level + ?branch + contents + >>=? may_replace_operation + cctxt + chain + source + ~replace_by_fees + ~user_fee:fee + >>=? fun contents -> + inject_operation_internal + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?simulation + ?force + ~fee_parameter + ?verbose_signing + ?successor_level + ?branch + ~src_sk + contents + >>=? fun (oph, op, result) -> + match pack_contents_list op.protocol_data.contents result with + | Cons_and_result (_, _, rest) -> + let second_op, second_result = unpack_contents_list rest in + return (oph, Operation.pack op, second_op, second_result) + | _ -> assert false) + | Some _ when has_reveal operations -> + failwith "The manager key was previously revealed." + | _ -> + build_contents counter operations >>?= fun contents -> + may_patch_limits + cctxt + ~fee_parameter + ~signature_algo + ~chain + ~block + ?force + ?simulation + ?successor_level + ?branch + contents + >>=? may_replace_operation + cctxt + chain + source + ~replace_by_fees + ~user_fee:fee + >>=? fun contents -> + inject_operation_internal + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?force + ~fee_parameter + ?successor_level + ?branch + ~src_sk + contents + >>=? fun (oph, op, result) -> + return (oph, Operation.pack op, op.protocol_data.contents, result) diff --git a/src/proto_016_PtMumbai/lib_client/injection.mli b/src/proto_016_PtMumbai/lib_client/injection.mli new file mode 100644 index 000000000000..c9d649eeb41b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/injection.mli @@ -0,0 +1,130 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Apply_results + +type 'kind preapply_result = + Tezos_crypto.Operation_hash.t * 'kind operation * 'kind operation_metadata + +type fee_parameter = { + minimal_fees : Tez.t; + minimal_nanotez_per_byte : Q.t; + minimal_nanotez_per_gas_unit : Q.t; + force_low_fee : bool; + fee_cap : Tez.t; + burn_cap : Tez.t; +} + +val preapply : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?verbose_signing:bool -> + ?fee_parameter:fee_parameter -> + ?branch:int -> + ?src_sk:Client_keys.sk_uri -> + 'kind contents_list -> + 'kind preapply_result tzresult Lwt.t + +(** Perform simulation of the given operations and return the corresponding + [preapply_result]s. *) +val simulate : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?successor_level:bool -> + ?branch:int -> + ?latency:int -> + 'kind contents_list -> + 'kind preapply_result tzresult Lwt.t + +type 'kind result_list = + Tezos_crypto.Operation_hash.t + * 'kind contents_list + * 'kind contents_result_list + +(** /!\ [inject_operation] does not perform automatic patching of + gas, storage and fees; use [inject_manager_operation] to inject + manager operations. *) +val inject_operation : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?simulation:bool -> + ?successor_level:bool -> + ?branch:int -> + ?src_sk:Client_keys.sk_uri -> + ?verbose_signing:bool -> + ?fee_parameter:fee_parameter -> + 'kind contents_list -> + 'kind result_list tzresult Lwt.t + +type 'kind result = + Tezos_crypto.Operation_hash.t * 'kind contents * 'kind contents_result + +val prepare_manager_operation : + fee:Tez.t Limit.t -> + gas_limit:Gas.Arith.integral Limit.t -> + storage_limit:Z.t Limit.t -> + 'kind manager_operation -> + 'kind Annotated_manager_operation.t + +val inject_manager_operation : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + block:Shell_services.block -> + ?successor_level:bool -> + ?branch:int -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?force:bool -> + source:Tezos_crypto.Signature.Public_key_hash.t -> + src_pk:Tezos_crypto.Signature.public_key -> + src_sk:Client_keys.sk_uri -> + fee:Tez.t Limit.t -> + gas_limit:Gas.Arith.integral Limit.t -> + storage_limit:Z.t Limit.t -> + ?counter:Manager_counter.t -> + ?replace_by_fees:bool -> + fee_parameter:fee_parameter -> + 'kind Annotated_manager_operation.annotated_list -> + (Tezos_crypto.Operation_hash.t + * packed_operation + * 'kind Kind.manager contents_list + * 'kind Kind.manager contents_result_list) + tzresult + Lwt.t + +(** Collects the addresses of all contracts originated by a batch of operations + by looking at the operation results. Fails if an operation in the batch is + failed unless [force] is given. *) +val originated_contracts : + force:bool -> 'kind contents_result_list -> Contract_hash.t list tzresult diff --git a/src/proto_016_PtMumbai/lib_client/light.ml b/src/proto_016_PtMumbai/lib_client/light.ml new file mode 100644 index 000000000000..ebdf0142f7c8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/light.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Proof = Tezos_context_sigs.Context.Proof_types + +module M : Tezos_proxy.Light_proto.PROTO_RPCS = struct + let merkle_tree (pgi : Tezos_proxy.Proxy.proxy_getter_input) key leaf_kind = + Protocol_client_context.Alpha_block_services.Context.merkle_tree + pgi.rpc_context + ~chain:pgi.chain + ~block:pgi.block + ~holey: + (match leaf_kind with Proof.Hole -> true | Proof.Raw_context -> false) + key +end diff --git a/src/proto_016_PtMumbai/lib_client/limit.ml b/src/proto_016_PtMumbai/lib_client/limit.ml new file mode 100644 index 000000000000..71843e7bda34 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/limit.ml @@ -0,0 +1,84 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type 'a t = 'a option + +let unknown = None + +let known x = Some x + +let of_option = Fun.id + +let is_unknown = Option.is_none + +let join (type a) ~where eq (l1 : a t) (l2 : a t) = + match (l1, l2) with + | None, None -> Result.return_none + | Some x, None | None, Some x -> Result.return_some x + | Some x, Some y -> + if eq x y then Result.return_some x + else error_with "Limit.join: error (%s)" where + +let%expect_test "join" = + let pp_print_err fmt = function + | Result.Error _ -> Format.pp_print_string fmt "error" + | Ok x -> + Format.( + pp_print_option + ~none:(fun fmt () -> pp_print_string fmt "None") + pp_print_bool) + fmt + x + in + let print x = Format.fprintf Format.std_formatter "%a" pp_print_err x in + print (join ~where:__LOC__ Bool.equal (Some true) (Some true)) ; + [%expect {| true |}] ; + print (join ~where:__LOC__ Bool.equal None None) ; + [%expect {| None |}] ; + print (join ~where:__LOC__ Bool.equal None (Some true)) ; + [%expect {| true |}] ; + print (join ~where:__LOC__ Bool.equal (Some true) None) ; + [%expect {| true |}] ; + print (join ~where:__LOC__ Bool.equal (Some true) (Some false)) ; + [%expect {| error |}] + +let get ~when_unknown = function + | None -> error_with "Limit.get: %s" when_unknown + | Some x -> ok x + +let%expect_test "get" = + let pp_print_err fmt = function + | Result.Error _ -> Format.fprintf fmt "error" + | Ok b -> Format.pp_print_bool fmt b + in + let print x = Format.fprintf Format.std_formatter "%a" pp_print_err x in + print (get ~when_unknown:"" (Some true)) ; + [%expect {| true |}] ; + print (get ~when_unknown:"" None) ; + [%expect {| error |}] + +let fold ~unknown ~known x = match x with None -> unknown | Some x -> known x + +let value ~when_unknown = function None -> when_unknown | Some x -> x diff --git a/src/proto_016_PtMumbai/lib_client/limit.mli b/src/proto_016_PtMumbai/lib_client/limit.mli new file mode 100644 index 000000000000..3ce610e3450c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/limit.mli @@ -0,0 +1,49 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This helper module allows to handle partially specified limits during the + injection process. *) + +(** A value of type ['a t] is either [unknown] of [known]. *) +type 'a t + +val unknown : 'a t + +val known : 'a -> 'a t + +val of_option : 'a option -> 'a t + +val is_unknown : 'a t -> bool + +(** [join ~where eq x y] computes the order-theoretic union of [x] and [y]. + If both [x] and [y] are not [Unknown], the function fails iff their + contents are not equal according to [eq]. *) +val join : where:string -> ('a -> 'a -> bool) -> 'a t -> 'a t -> 'a t tzresult + +val fold : unknown:'a -> known:('b -> 'a) -> 'b t -> 'a + +val get : when_unknown:string -> 'a t -> 'a tzresult + +val value : when_unknown:'a -> 'a t -> 'a diff --git a/src/proto_016_PtMumbai/lib_client/managed_contract.ml b/src/proto_016_PtMumbai/lib_client/managed_contract.ml new file mode 100644 index 000000000000..3edbaae33415 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/managed_contract.ml @@ -0,0 +1,339 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context +open Protocol_client_context +open Tezos_micheline + +let return_single_manager_result (oph, _, op, result) = + match Apply_results.pack_contents_list op result with + | Apply_results.Single_and_result ((Manager_operation _ as op), result) -> + return (oph, op, result) + | _ -> assert false + +let check_smart_contract (cctxt : #full) opt_res some = + Option.fold ~none:(cctxt#error "This is not a smart contract.") ~some opt_res + +let get_contract_manager (cctxt : #full) contract = + let open Micheline in + let open Michelson_v1_primitives in + Client_proto_context.get_storage + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~unparsing_mode:Optimized + contract + >>=? fun storage -> + check_smart_contract cctxt storage @@ fun storage -> + match root storage with + | Prim (_, D_Pair, Bytes (_, bytes) :: _, _) | Bytes (_, bytes) -> ( + match + Data_encoding.Binary.of_bytes_opt + Tezos_crypto.Signature.Public_key_hash.encoding + bytes + with + | Some k -> return k + | None -> + cctxt#error + "Cannot find a manager key in contracts storage (decoding bytes \ + failed).\n\ + Transfer from scripted contract are currently only supported for \ + \"manager\" contract.") + | Prim (_, D_Pair, String (_, value) :: _, _) | String (_, value) -> ( + match Tezos_crypto.Signature.Public_key_hash.of_b58check_opt value with + | Some k -> return k + | None -> + cctxt#error + "Cannot find a manager key in contracts storage (\"%s\" is not a \ + valid key).\n\ + Transfer from scripted contract are currently only supported for \ + \"manager\" contract." + value) + | _raw_storage -> + cctxt#error + "Cannot find a manager key in contracts storage (wrong storage format \ + : @[%a@]).\n\ + Transfer from scripted contract are currently only supported for \ + \"manager\" contract." + Michelson_v1_printer.print_expr + storage + +let parse code = + Lwt.return + ( Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression code + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + +let build_lambda_for_set_delegate ~delegate = + match delegate with + | Some delegate -> + let (`Hex delegate) = + Tezos_crypto.Signature.Public_key_hash.to_hex delegate + in + Format.asprintf + "{ DROP ; NIL operation ; PUSH key_hash 0x%s ; SOME ; SET_DELEGATE ; \ + CONS }" + delegate + | None -> "{ DROP ; NIL operation ; NONE key_hash ; SET_DELEGATE ; CONS }" + +let entrypoint_do = Entrypoint.do_ + +let entrypoint_set_delegate = Entrypoint.set_delegate + +let entrypoint_remove_delegate = Entrypoint.remove_delegate + +let build_delegate_operation (cctxt : #full) ~chain ~block ?fee + contract (* the KT1 to delegate *) + (delegate : Tezos_crypto.Signature.public_key_hash option) = + let entrypoint = entrypoint_do in + (Michelson_v1_entrypoints.contract_entrypoint_type + cctxt + ~chain + ~block + ~contract + ~entrypoint + ~normalize_types:true + >>=? function + | Some _ -> + (* their is a "do" entrypoint (we could check its type here)*) + parse @@ build_lambda_for_set_delegate ~delegate >>=? fun param -> + return (param, entrypoint) + | None -> ( + (* their is no "do" entrypoint trying "set/remove_delegate" *) + let entrypoint = + match delegate with + | Some _ -> entrypoint_set_delegate + | None -> entrypoint_remove_delegate + in + Michelson_v1_entrypoints.contract_entrypoint_type + cctxt + ~chain + ~block + ~contract + ~entrypoint + ~normalize_types:true + >>=? function + | Some _ -> + (* their is a "set/remove_delegate" entrypoint *) + let delegate_data = + match delegate with + | Some delegate -> + let (`Hex delegate) = + Tezos_crypto.Signature.Public_key_hash.to_hex delegate + in + "0x" ^ delegate + | None -> "Unit" + in + parse delegate_data >>=? fun param -> return (param, entrypoint) + | None -> + cctxt#error + "Cannot find a %%do or %%set_delegate entrypoint in contract@.")) + >>=? fun (parameters, entrypoint) -> + return + (Client_proto_context.build_transaction_operation + ~amount:Tez.zero + ~parameters + ~entrypoint + ?fee + (Originated contract)) + +let set_delegate (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?branch ~fee_parameter ?fee ~source ~src_pk + ~src_sk contract (* the KT1 to delegate *) + (delegate : Tezos_crypto.Signature.public_key_hash option) = + build_delegate_operation cctxt ~chain ~block ?fee contract delegate + >>=? fun operation -> + let operation = Annotated_manager_operation.Single_manager operation in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ?branch + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:Limit.unknown + ~storage_limit:(Limit.known Z.zero) + ~src_pk + ~src_sk + ~fee_parameter + operation + >>=? return_single_manager_result + +let d_unit = + Micheline.strip_locations (Prim (0, Michelson_v1_primitives.D_Unit, [], [])) + +let t_unit = + Micheline.strip_locations (Prim (0, Michelson_v1_primitives.T_unit, [], [])) + +let build_lambda_for_transfer_to_implicit ~destination ~amount = + let (`Hex destination) = + Tezos_crypto.Signature.Public_key_hash.to_hex destination + in + Format.asprintf + "{ DROP ; NIL operation ;PUSH key_hash 0x%s; IMPLICIT_ACCOUNT;PUSH mutez \ + %Ld ;UNIT;TRANSFER_TOKENS ; CONS }" + destination + (Tez.to_mutez amount) + +let build_lambda_for_transfer_to_originated ~destination ~entrypoint ~amount + ~parameter_type ~parameter = + let destination = + Data_encoding.Binary.to_bytes_exn Contract.originated_encoding destination + in + let amount = Tez.to_mutez amount in + let (`Hex destination) = Hex.of_bytes destination in + let entrypoint = Entrypoint.to_address_suffix entrypoint in + if parameter_type = t_unit then + Format.asprintf + "{ DROP ; NIL operation ;PUSH address 0x%s; CONTRACT %s %a; \ + ASSERT_SOME;PUSH mutez %Ld ;UNIT;TRANSFER_TOKENS ; CONS }" + destination + entrypoint + Michelson_v1_printer.print_expr + parameter_type + amount + else + Format.asprintf + "{ DROP ; NIL operation ;PUSH address 0x%s; CONTRACT %s %a; \ + ASSERT_SOME;PUSH mutez %Ld ;PUSH %a %a;TRANSFER_TOKENS ; CONS }" + destination + entrypoint + Michelson_v1_printer.print_expr + parameter_type + amount + Michelson_v1_printer.print_expr + parameter_type + Michelson_v1_printer.print_expr + parameter + +let build_transaction_operation (cctxt : #full) ~chain ~block ~contract + ~(destination : Contract.t) ?(entrypoint = Entrypoint.default) ?arg ~amount + ?fee ?gas_limit ?storage_limit () = + (match destination with + | Implicit destination when Entrypoint.is_default entrypoint -> + return @@ build_lambda_for_transfer_to_implicit ~destination ~amount + | Implicit _ -> + cctxt#error + "Implicit accounts have no entrypoints. (targeted entrypoint %%%a on \ + contract %a)" + Entrypoint.pp + entrypoint + Contract.pp + destination + | Originated destination -> + (Michelson_v1_entrypoints.contract_entrypoint_type + cctxt + ~chain + ~block + ~contract:destination + ~entrypoint + ~normalize_types:true + >>=? function + | None -> + cctxt#error + "Contract %a has no entrypoint named %a" + Contract_hash.pp + destination + Entrypoint.pp + entrypoint + | Some parameter_type -> return parameter_type) + >>=? fun parameter_type -> + (match arg with + | Some arg -> + Lwt.return @@ Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression arg + >>=? fun {expanded = arg; _} -> return_some arg + | None -> return_none) + >>=? fun parameter -> + let parameter = Option.value ~default:d_unit parameter in + return + @@ build_lambda_for_transfer_to_originated + ~destination + ~entrypoint + ~amount + ~parameter_type + ~parameter) + >>=? fun lambda -> + parse lambda >>=? fun parameters -> + let entrypoint = entrypoint_do in + return + (Client_proto_context.build_transaction_operation + ~amount:Tez.zero + ~parameters + ~entrypoint + ?fee + ?gas_limit + ?storage_limit + contract) + +let transfer (cctxt : #full) ~chain ~block ?confirmations ?dry_run + ?verbose_signing ?simulation ?(force = false) ?branch ~source ~src_pk + ~src_sk ~contract ~destination ?(entrypoint = Entrypoint.default) ?arg + ~amount ?fee ?gas_limit ?storage_limit ?counter ~fee_parameter () : + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t = + build_transaction_operation + cctxt + ~chain + ~block + ~contract + ~destination + ~entrypoint + ?arg + ~amount + ?fee + ?gas_limit + ?storage_limit + () + >>=? fun operation -> + let operation = Annotated_manager_operation.Single_manager operation in + Injection.inject_manager_operation + cctxt + ~chain + ~block + ?confirmations + ?dry_run + ?verbose_signing + ?simulation + ~force + ?branch + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ?counter + ~src_pk + ~src_sk + ~fee_parameter + operation + >>=? fun ((_, _, _, result) as res) -> + Lwt.return (Injection.originated_contracts ~force result) + >>=? fun contracts -> + return_single_manager_result res >>=? fun res -> return (res, contracts) diff --git a/src/proto_016_PtMumbai/lib_client/managed_contract.mli b/src/proto_016_PtMumbai/lib_client/managed_contract.mli new file mode 100644 index 000000000000..b459230ae8b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/managed_contract.mli @@ -0,0 +1,135 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context +open Protocol_client_context + +(** [check_smart_contract cctxt opt_value f_value] returns an error if + [opt_value] is [None], and [f_value value] if [opt_value = Some value]. + It can typically be used when [opt_value] is [None] for implicit accounts + and [Some _] for smart contracts, as the message in the raised error is that + a smart contract is expected. *) +val check_smart_contract : #full -> 'a option -> ('a -> 'b Lwt.t) -> 'b Lwt.t + +(** Retrieve the manager key in a contract storage. + The storage has to be of type `pair key_hash 'a`. +*) +val get_contract_manager : + #full -> Contract_hash.t -> public_key_hash tzresult Lwt.t + +(** Builds a delegation operation ready for injection *) +val build_delegate_operation : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?fee:Tez.t -> + Contract_hash.t -> + public_key_hash option -> + Kind.transaction Annotated_manager_operation.t tzresult Lwt.t + +(** Set the delegate of a manageable contract. + For a contract with a `do`entrypoint, it builds the lambda that set + the provided delegate. + `~source` has to be the registered manager of the contract. +*) +val set_delegate : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?branch:int -> + fee_parameter:Injection.fee_parameter -> + ?fee:Tez.t -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + Contract_hash.t -> + public_key_hash option -> + Kind.transaction Kind.manager Injection.result tzresult Lwt.t + +(** Builds a transaction operation ready for injection *) +val build_transaction_operation : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + contract:Contract.t -> + destination:Contract.t -> + ?entrypoint:Entrypoint.t -> + ?arg:string -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + unit -> + Kind.transaction Annotated_manager_operation.t tzresult Lwt.t + +(** Perform a transfer on behalf of a managed contract . + For a contract with a `do`entrypoint, it builds the lambda that + does the requested operation. + `~source` has to be the registered manager of the contract. +*) +val transfer : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + ?confirmations:int -> + ?dry_run:bool -> + ?verbose_signing:bool -> + ?simulation:bool -> + ?force:bool -> + ?branch:int -> + source:public_key_hash -> + src_pk:public_key -> + src_sk:Client_keys.sk_uri -> + contract:Contract.t -> + destination:Contract.t -> + ?entrypoint:Entrypoint.t -> + ?arg:string -> + amount:Tez.t -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + fee_parameter:Injection.fee_parameter -> + unit -> + (Kind.transaction Kind.manager Injection.result * Contract_hash.t list) + tzresult + Lwt.t + +val build_lambda_for_set_delegate : delegate:public_key_hash option -> string + +val build_lambda_for_transfer_to_implicit : + destination:public_key_hash -> amount:Tez.t -> string + +val build_lambda_for_transfer_to_originated : + destination:Contract_hash.t -> + entrypoint:Entrypoint.t -> + amount:Tez.t -> + parameter_type:Script.expr -> + parameter:Script.expr -> + string diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.ml new file mode 100644 index 000000000000..6de00de8b2f1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.ml @@ -0,0 +1,230 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Tezos_micheline +open Micheline + +let print_expr ppf expr = + let print_annot ppf = function + | [] -> () + | annots -> Format.fprintf ppf " %s" (String.concat " " annots) + in + let rec print_expr ppf = function + | Int (_, value) -> Format.fprintf ppf "%s" (Z.to_string value) + | String (_, value) -> Micheline_printer.print_string ppf value + | Bytes (_, value) -> Format.fprintf ppf "0x%a" Hex.pp (Hex.of_bytes value) + | Seq (_, items) -> + Format.fprintf + ppf + "(seq %a)" + (Format.pp_print_list ~pp_sep:Format.pp_print_space print_expr) + items + | Prim (_, name, [], []) -> Format.fprintf ppf "%s" name + | Prim (_, name, items, annot) -> + Format.fprintf + ppf + "(%s%a%s%a)" + name + print_annot + annot + (if items = [] then "" else " ") + (Format.pp_print_list ~pp_sep:Format.pp_print_space print_expr) + items + in + let root = root (Michelson_v1_primitives.strings_of_prims expr) in + Format.fprintf ppf "@[<h>%a@]" print_expr root + +let print_annot_expr ppf expr = Format.fprintf ppf "(%a)" print_expr expr + +open Micheline_parser +open Script_tc_errors + +let print_type_map ppf (parsed, type_map) = + let rec print_expr_types ppf = function + | Seq (loc, []) + | Prim (loc, _, [], _) + | Int (loc, _) + | Bytes (loc, _) + | String (loc, _) -> + print_item ppf loc + | Seq (loc, items) | Prim (loc, _, items, _) -> + print_item ppf loc ; + List.iter (print_expr_types ppf) items + and print_stack ppf items = + Format.fprintf + ppf + "(%a)" + (Format.pp_print_list ~pp_sep:Format.pp_print_space print_annot_expr) + items + and print_item ppf loc = + (let ( >?? ) = Option.bind in + List.assoc ~equal:Int.equal loc parsed.Michelson_v1_parser.expansion_table + >?? fun ({start = {point = s; _}; stop = {point = e; _}}, locs) -> + let locs = List.sort Stdlib.compare locs in + List.hd locs >?? fun hd_loc -> + List.assoc ~equal:Int.equal hd_loc type_map >?? fun (bef, aft) -> + Some (s, e, bef, aft)) + |> Option.iter (fun (s, e, bef, aft) -> + Format.fprintf + ppf + "(@[<h>%d %d %a %a@])@," + s + e + print_stack + bef + print_stack + aft) + in + Format.fprintf ppf "(@[<v 0>%a@])" print_expr_types (root parsed.unexpanded) + +let first_error_location errs = + let rec find = function + | [] -> 0 + | ( Unexpected_annotation loc + | Ill_formed_type (_, _, loc) + | Invalid_arity (loc, _, _, _) + | Invalid_seq_arity (loc, _, _) + | Invalid_namespace (loc, _, _, _) + | Invalid_primitive (loc, _, _) + | Invalid_kind (loc, _, _) + | Invalid_never_expr loc + | Fail_not_in_tail_position loc + | Undefined_binop (loc, _, _, _) + | Undefined_unop (loc, _, _) + | Bad_return (loc, _, _) + | Bad_stack (loc, _, _, _) + | Unmatched_branches (loc, _, _) + | Invalid_constant (loc, _, _) + | Invalid_syntactic_constant (loc, _, _) + | Invalid_contract (loc, _) + | Comparable_type_expected (loc, _) + | Michelson_v1_primitives.Invalid_primitive_name (_, loc) ) + :: _ -> + loc + | _ :: rest -> find rest + in + find errs + +let report_errors ppf (parsed, errs) = + let eco, out = + List.fold_left + (fun (eco, out) -> function + | Environment.Ecoproto_error err -> (err :: eco, out) + | err -> (eco, err :: out)) + ([], []) + errs + in + let eco, out = (List.rev eco, List.rev out) in + Format.fprintf + ppf + "(@[<v 0>%a@,%a@])" + (fun ppf errs -> + let find_location loc = + let oloc = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:Int.equal + loc + parsed.Michelson_v1_parser.unexpansion_table + in + fst + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc ~equal:Int.equal oloc parsed.expansion_table) + in + match errs with + | top :: errs -> + let errs, loc = + ( List.map (fun e -> Environment.Ecoproto_error e) (top :: errs), + match top with + | Ill_typed_contract (expr, _) | Ill_typed_data (_, expr, _) -> + if expr = parsed.expanded then + find_location (first_error_location (top :: errs)) + else find_location 0 + | Michelson_v1_primitives.Invalid_primitive_name (expr, loc) -> + if + Micheline.strip_locations + (Michelson_v1_macros.unexpand_rec (Micheline.root expr)) + = parsed.Michelson_v1_parser.unexpanded + then find_location loc + else find_location 0 + | _ -> find_location 0 ) + in + let message = + Format.asprintf + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ~parsed) + errs + in + let {start = {point = s; _}; stop = {point = e; _}} = loc in + Format.fprintf ppf "(%d %d %S)" (s + 1) (e + 1) message + | [] -> ()) + eco + (Format.pp_print_list (fun ppf err -> + let find_location loc = + let oloc = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc + ~equal:Int.equal + loc + parsed.Michelson_v1_parser.unexpansion_table + in + fst + (WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc ~equal:Int.equal oloc parsed.expansion_table) + in + let loc = + match err with + | Invalid_utf8_sequence (point, _) + | Unexpected_character (point, _) + | Undefined_escape_sequence (point, _) + | Missing_break_after_number point -> + {start = point; stop = point} + | Unterminated_string loc + | Unterminated_integer loc + | Unterminated_comment loc + | Invalid_hex_bytes loc + | Unclosed {loc; _} + | Unexpected {loc; _} + | Extra {loc; _} -> + loc + | Misaligned node -> location node + | _ -> find_location 0 + in + let message = + Format.asprintf + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ~parsed) + [err] + in + let {start = {point = s; _}; stop = {point = e; _}} = loc in + Format.fprintf ppf "(%d %d %S)" (s + 1) (e + 1) message)) + out diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.mli new file mode 100644 index 000000000000..6694308d4b02 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_emacs.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +val print_expr : Format.formatter -> Script.expr -> unit + +val print_type_map : + Format.formatter -> + Michelson_v1_parser.parsed * Script_tc_errors.type_map -> + unit + +val report_errors : + Format.formatter -> + Michelson_v1_parser.parsed * Error_monad.error list -> + unit diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.ml new file mode 100644 index 000000000000..aeb9596dea05 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.ml @@ -0,0 +1,250 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Protocol_client_context +open Alpha_context + +type error += Contract_without_code of Contract.t + +let () = + register_error_kind + `Permanent + ~id:"contractWithoutCode" + ~title:"The given contract has no code" + ~description: + "Attempt to get the code of a contract failed because it has nocode. No \ + scriptless contract should remain." + ~pp:(fun ppf contract -> + Format.fprintf ppf "Contract has no code %a." Contract.pp contract) + Data_encoding.(obj1 (req "contract" Contract.encoding)) + (function Contract_without_code c -> Some c | _ -> None) + (fun c -> Contract_without_code c) + +let print_errors (cctxt : #Client_context.printer) errs = + cctxt#error "%a" Error_monad.pp_print_trace errs >>= fun () -> return_unit + +let script_entrypoint_type cctxt ~(chain : Chain_services.chain) ~block + (program : Script.expr) ~entrypoint = + Plugin.RPC.Scripts.entrypoint_type + cctxt + (chain, block) + ~script:program + ~entrypoint + >>= function + | Ok ty -> return_some ty + | Error + (Environment.Ecoproto_error (Script_tc_errors.No_such_entrypoint _) :: _) + -> + return None + | Error _ as err -> Lwt.return err + +let contract_entrypoint_type cctxt ~(chain : Chain_services.chain) ~block + ~contract ~entrypoint ~normalize_types = + Alpha_services.Contract.entrypoint_type + cctxt + (chain, block) + contract + entrypoint + ~normalize_types + >>= function + | Ok ty -> return_some ty + | Error (Tezos_rpc.Context.Not_found _ :: _) -> return None + | Error _ as err -> Lwt.return err + +let print_entrypoint_type (cctxt : #Client_context.printer) + ?(on_errors = print_errors cctxt) ~emacs ?contract ?script_name ~entrypoint + = function + | Ok (Some ty) -> + (if emacs then + cctxt#message + "@[<v 2>((entrypoint . %a) (type . %a))@]@." + Entrypoint.pp + entrypoint + Michelson_v1_emacs.print_expr + ty + else + cctxt#message + "@[<v 2>Entrypoint %a: %a@]@." + Entrypoint.pp + entrypoint + Michelson_v1_printer.print_expr + ty) + >>= fun () -> return_unit + | Ok None -> + cctxt#message + "@[<v 2>No entrypoint named %a%a%a@]@." + Entrypoint.pp + entrypoint + (Format.pp_print_option (fun ppf -> + Format.fprintf ppf " for contract %a" Contract_hash.pp)) + contract + (Format.pp_print_option (fun ppf -> Format.fprintf ppf " for script %s")) + script_name + >>= fun () -> return_unit + | Error errs -> on_errors errs + +let list_contract_unreachables_and_entrypoints cctxt ~chain ~block ~contract + ~normalize_types = + Alpha_services.Contract.list_entrypoints + cctxt + (chain, block) + contract + ~normalize_types + +let list_contract_unreachables cctxt ~chain ~block ~contract = + let normalize_types = + (* no need to normalize types as typed entrypoints are ignored *) + false + in + list_contract_unreachables_and_entrypoints + cctxt + ~chain + ~block + ~contract + ~normalize_types + >>=? fun (unreachables, _typed_entrypoints) -> return unreachables + +let list_contract_entrypoints cctxt ~chain ~block ~contract ~normalize_types = + list_contract_unreachables_and_entrypoints + cctxt + ~chain + ~block + ~contract + ~normalize_types + >>=? fun (_, entrypoints) -> + if not @@ List.mem_assoc ~equal:String.equal "default" entrypoints then + contract_entrypoint_type + cctxt + ~chain + ~block + ~contract + ~entrypoint:Entrypoint.default + ~normalize_types + >>= function + | Ok (Some ty) -> return (("default", ty) :: entrypoints) + | Ok None -> return entrypoints + | Error _ as err -> Lwt.return err + else return entrypoints + +let list_unreachables cctxt ~chain ~block (program : Script.expr) = + Plugin.RPC.Scripts.list_entrypoints cctxt (chain, block) ~script:program + >>=? fun (unreachables, _) -> return unreachables + +let list_entrypoints cctxt ~chain ~block (program : Script.expr) = + Plugin.RPC.Scripts.list_entrypoints cctxt (chain, block) ~script:program + >>=? fun (_, entrypoints) -> + if not @@ List.mem_assoc ~equal:String.equal "default" entrypoints then + script_entrypoint_type + cctxt + ~chain + ~block + program + ~entrypoint:Entrypoint.default + >>= function + | Ok (Some ty) -> return (("default", ty) :: entrypoints) + | Ok None -> return entrypoints + | Error _ as err -> Lwt.return err + else return entrypoints + +let print_entrypoints_list (cctxt : #Client_context.printer) + ?(on_errors = print_errors cctxt) ~emacs ?contract ?script_name = function + | Ok entrypoint_list -> + (if emacs then + cctxt#message + "@[<v 2>(@[%a@])@." + (Format.pp_print_list + ~pp_sep:Format.pp_print_cut + (fun ppf (entrypoint, ty) -> + Format.fprintf + ppf + "@[<v 2>( ( entrypoint . %s ) ( type . @[%a@]))@]" + entrypoint + Michelson_v1_emacs.print_expr + ty)) + entrypoint_list + else + cctxt#message + "@[<v 2>Entrypoints%a%a: @,%a@]@." + (Format.pp_print_option (fun ppf -> + Format.fprintf ppf " for contract %a" Contract_hash.pp)) + contract + (Format.pp_print_option (fun ppf -> + Format.fprintf ppf " for script %s")) + script_name + (Format.pp_print_list + ~pp_sep:Format.pp_print_cut + (fun ppf (entrypoint, ty) -> + Format.fprintf + ppf + "@[<v 2>%s: @[%a@]@]" + entrypoint + Michelson_v1_printer.print_expr + ty)) + entrypoint_list) + >>= fun () -> return_unit + | Error errs -> on_errors errs + +let print_unreachables (cctxt : #Client_context.printer) + ?(on_errors = print_errors cctxt) ~emacs ?contract ?script_name = function + | Ok unreachable -> + (if emacs then + cctxt#message + "@[<v 2>(@[%a@])@." + (Format.pp_print_list ~pp_sep:Format.pp_print_cut (fun ppf path -> + Format.fprintf + ppf + "@[<h>( unreachable-path . %a )@]" + (Format.pp_print_list + ~pp_sep:Format.pp_print_space + (fun ppf prim -> + Format.pp_print_string ppf + @@ Michelson_v1_primitives.string_of_prim prim)) + path)) + unreachable + else + match unreachable with + | [] -> cctxt#message "@[<v 2>None.@]@." + | _ -> + cctxt#message + "@[<v 2>Unreachable paths in the argument%a%a: @[%a@]@." + (Format.pp_print_option (fun ppf -> + Format.fprintf ppf " of contract %a" Contract_hash.pp)) + contract + (Format.pp_print_option (fun ppf -> + Format.fprintf ppf " of script %s")) + script_name + (Format.pp_print_list ~pp_sep:Format.pp_print_cut (fun ppf -> + Format.fprintf + ppf + "@[<h> %a @]" + (Format.pp_print_list + ~pp_sep:(fun ppf _ -> Format.pp_print_string ppf "/") + (fun ppf prim -> + Format.pp_print_string ppf + @@ Michelson_v1_primitives.string_of_prim prim)))) + unreachable) + >>= fun () -> return_unit + | Error errs -> on_errors errs diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.mli new file mode 100644 index 000000000000..230b8edc998b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_entrypoints.mli @@ -0,0 +1,110 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Returns [Some type] if the contract has an entrypoint of type [type]. None if it does not exists. *) +val script_entrypoint_type : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + Alpha_context.Script.expr -> + entrypoint:Alpha_context.Entrypoint.t -> + Alpha_context.Script.expr option tzresult Lwt.t + +(** Returns [Some type] if the script has an entrypoint of type [type]. None if it does not exists. *) +val contract_entrypoint_type : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + contract:Contract_hash.t -> + entrypoint:Alpha_context.Entrypoint.t -> + normalize_types:bool -> + Alpha_context.Script.expr option tzresult Lwt.t + +val print_entrypoint_type : + #Client_context.printer -> + ?on_errors:(error list -> unit tzresult Lwt.t) -> + emacs:bool -> + ?contract:Contract_hash.t -> + ?script_name:string -> + entrypoint:Alpha_context.Entrypoint.t -> + Alpha_context.Script.expr option tzresult -> + unit tzresult Lwt.t + +(** List paths of unreachable parameters. + Only useful to test the stitching, as no such parameter should be + allowed in originated contracts. *) +val list_contract_unreachables : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + contract:Contract_hash.t -> + Michelson_v1_primitives.prim list list tzresult Lwt.t + +val list_unreachables : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + Alpha_context.Script.expr -> + Michelson_v1_primitives.prim list list tzresult Lwt.t + +val print_unreachables : + #Client_context.printer -> + ?on_errors:(error list -> unit tzresult Lwt.t) -> + emacs:bool -> + ?contract:Contract_hash.t -> + ?script_name:string -> + Michelson_v1_primitives.prim list list tzresult -> + unit tzresult Lwt.t + +(** List the contract entrypoints with their types. + If their is no explicit default, th type of default entrypoint will still be given. +*) +val list_contract_entrypoints : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + contract:Contract_hash.t -> + normalize_types:bool -> + (string * Alpha_context.Script.expr) list tzresult Lwt.t + +(** List the script entrypoints with their types. *) +val list_entrypoints : + #Protocol_client_context.rpc_context -> + chain:Chain_services.chain -> + block:Block_services.block -> + Alpha_context.Script.expr -> + (string * Alpha_context.Script.expr) list tzresult Lwt.t + +(** Print the contract entrypoints with their types. *) +val print_entrypoints_list : + #Client_context.printer -> + ?on_errors:(error list -> unit tzresult Lwt.t) -> + emacs:bool -> + ?contract:Contract_hash.t -> + ?script_name:string -> + (string * Alpha_context.Script.expr) list tzresult -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.ml new file mode 100644 index 000000000000..b842cd9e82a7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.ml @@ -0,0 +1,802 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline +open Script_tc_errors +open Script_interpreter +open Michelson_v1_printer + +let print_ty ppf ty = Michelson_v1_printer.print_expr_unwrapped ppf ty + +let print_stack_ty ?(depth = max_int) ppf s = + let rec loop depth ppf = function + | [] -> () + | _ when depth <= 0 -> Format.fprintf ppf "..." + | [last] -> print_ty ppf last + | last :: rest -> + Format.fprintf ppf "%a@ :@ %a" print_ty last (loop (depth - 1)) rest + in + match s with + | [] -> Format.fprintf ppf "[]" + | sty -> Format.fprintf ppf "@[<hov 2>[ %a ]@]" (loop depth) sty + +let rec print_enumeration ppf = function + | [single] -> Format.fprintf ppf "%a" Format.pp_print_text single + | [prev; last] -> + Format.fprintf + ppf + "%a@ or@ %a" + Format.pp_print_text + prev + Format.pp_print_text + last + | first :: rest -> + Format.fprintf + ppf + "%a,@ %a" + Format.pp_print_text + first + print_enumeration + rest + | [] -> assert false + +let collect_error_locations errs = + let rec collect acc = function + | Environment.Ecoproto_error + ( Ill_formed_type (_, _, _) + | No_such_entrypoint _ | Duplicate_entrypoint _ + | Unreachable_entrypoint _ | Tx_rollup_invalid_ticket_amount _ + | Runtime_contract_error _ + | Michelson_v1_primitives.Invalid_primitive_name (_, _) + | Ill_typed_data (_, _, _) + | Ill_typed_contract (_, _) ) + :: _ + | [] -> + acc + | Environment.Ecoproto_error + ( Invalid_arity (loc, _, _, _) + | Invalid_seq_arity (loc, _, _) + | Unexpected_annotation loc + | Ungrouped_annotations loc + | Type_too_large (loc, _) + | Invalid_namespace (loc, _, _, _) + | Invalid_primitive (loc, _, _) + | Invalid_kind (loc, _, _) + | Invalid_never_expr loc + | Duplicate_field (loc, _) + | Unexpected_lazy_storage loc + | Unexpected_operation loc + | Fail_not_in_tail_position loc + | Undefined_binop (loc, _, _, _) + | Undefined_unop (loc, _, _) + | Bad_return (loc, _, _) + | Bad_stack (loc, _, _, _) + | Unmatched_branches (loc, _, _) + | Forbidden_instr_in_context (loc, _, _) + | Invalid_constant (loc, _, _) + | Invalid_syntactic_constant (loc, _, _) + | Invalid_contract (loc, _) + | Comparable_type_expected (loc, _) + | Overflow (loc, _) + | Reject (loc, _, _) + | Pair_bad_argument loc + | Unpair_bad_argument loc + | Dup_n_bad_argument loc ) + :: rest -> + collect (loc :: acc) rest + | _ :: rest -> collect acc rest + in + collect [] errs + +let string_of_context_desc = function + | Script_tc_errors.Lambda -> "lambda" + | Script_tc_errors.View -> "view" + +(* Error raised while fetching the script of a contract for error reporting when the script is not found. *) +type error += Fetch_script_not_found_meta_error of Contract_hash.t + +(* Errors raised while fetching the script of a contract for error reporting. *) +type error += Fetch_script_meta_error of error trace + +let fetch_script (cctxt : #Protocol_client_context.rpc_context) ~chain ~block + contract = + Plugin.RPC.Contract.get_script_normalized + cctxt + (chain, block) + ~unparsing_mode:Readable + ~normalize_types:true + ~contract + >>=? function + | None -> fail (Fetch_script_not_found_meta_error contract) + | Some {code; storage = _} -> + Lwt.return @@ Environment.wrap_tzresult @@ Script_repr.force_decode code + +type error += + | Rich_runtime_contract_error of Contract_hash.t * Michelson_v1_parser.parsed + +let enrich_runtime_errors cctxt ~chain ~block ~parsed = + List.map_s (function + | Environment.Ecoproto_error (Runtime_contract_error contract) -> ( + (* If we know the script already, we don't fetch it *) + match parsed with + | Some parsed -> + Lwt.return @@ Rich_runtime_contract_error (contract, parsed) + | None -> ( + fetch_script cctxt ~chain ~block contract >|= function + | Ok script -> + let parsed = Michelson_v1_printer.unparse_toplevel script in + Rich_runtime_contract_error (contract, parsed) + | Error err -> Fetch_script_meta_error err)) + | e -> Lwt.return e) + +let report_errors ~details ~show_source ?parsed ppf errs = + let rec print_trace locations errs = + let print_loc ppf loc = + match locations loc with + | None -> Format.fprintf ppf "At (unshown) location %d, " loc + | Some loc -> + Format.fprintf + ppf + "%s,@ " + (String.capitalize_ascii + (Format.asprintf "%a" Micheline_parser.print_location loc)) + in + let parsed_locations parsed loc = + let ( >?? ) = Option.bind in + List.assoc + ~equal:Int.equal + loc + parsed.Michelson_v1_parser.unexpansion_table + >?? fun oloc -> + List.assoc ~equal:Int.equal oloc parsed.expansion_table + >?? fun (ploc, _) -> Some ploc + in + let print_source ppf (parsed, _hilights) (* TODO *) = + let lines = String.split_on_char '\n' parsed.Michelson_v1_parser.source in + let cols = String.length (string_of_int (List.length lines)) in + Format.fprintf + ppf + "@[<v 0>%a@]" + (Format.pp_print_list (fun ppf (i, l) -> + Format.fprintf ppf "%0*d: %s" cols i l)) + (List.rev_mapi (fun i x -> (i + 1, x)) lines |> List.rev) + in + match errs with + | [] -> () + | Environment.Ecoproto_error + (Michelson_v1_primitives.Invalid_primitive_name (expr, loc)) + :: rest -> + let parsed = + match parsed with + | Some parsed -> + if + Micheline.strip_locations + (Michelson_v1_macros.unexpand_rec (Micheline.root expr)) + = parsed.Michelson_v1_parser.unexpanded + then parsed + else Michelson_v1_printer.unparse_invalid expr + | None -> Michelson_v1_printer.unparse_invalid expr + in + let hilights = loc :: collect_error_locations rest in + if show_source then + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>Invalid primitive:@ %a@]@]" + print_source + (parsed, hilights) + else Format.fprintf ppf "Invalid primitive." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace (parsed_locations parsed) rest + | Environment.Ecoproto_error (Ill_typed_data (name, expr, ty)) :: rest -> + let parsed = + match parsed with + | Some parsed when expr = parsed.Michelson_v1_parser.expanded -> + parsed + | Some _ | None -> Michelson_v1_printer.unparse_expression expr + in + let hilights = collect_error_locations rest in + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>Ill typed %adata:@ %a@]@ @[<hov 2>is not an \ + expression of type@ %a@]@]" + (fun ppf -> function + | None -> () + | Some s -> Format.fprintf ppf "%s " s) + name + print_source + (parsed, hilights) + print_ty + ty ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace (parsed_locations parsed) rest + | Environment.Ecoproto_error (No_such_entrypoint entrypoint) :: rest -> + Format.fprintf + ppf + "Contract has no entrypoint named %a" + Entrypoint.pp + entrypoint ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Duplicate_entrypoint entrypoint) :: rest -> + Format.fprintf + ppf + "Contract has two entrypoints named %a" + Entrypoint.pp + entrypoint ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Unreachable_entrypoint path) :: rest -> + let path = + String.concat + "/" + (List.map Michelson_v1_primitives.string_of_prim path) + in + Format.fprintf ppf "Entrypoint at path %s is not reachable" path ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Tx_rollup_bad_deposit_parameter (loc, expr)) + :: rest -> + Format.fprintf + ppf + "@[<v 2>%aTrying to call the deposit entrypoint of a transaction \ + rollup with an ill-formed parameter:@ %a@]" + print_loc + loc + print_expr + expr ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Tx_rollup_invalid_ticket_amount amount) + :: rest -> + Format.fprintf + ppf + "Amount of tickets to deposit to a transaction rollup needs to fit \ + in a 64-bit integer, but %a is too big" + Z.pp_print + amount ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Ill_formed_type (_, expr, loc)) :: rest -> + let parsed = + match parsed with + | Some parsed when expr = parsed.Michelson_v1_parser.expanded -> + parsed + | Some _ | None -> Michelson_v1_printer.unparse_expression expr + in + let hilights = loc :: collect_error_locations errs in + if show_source then + Format.fprintf + ppf + "@[<v 2>%aill formed type:@ %a@]" + print_loc + loc + print_source + (parsed, hilights) + else Format.fprintf ppf "Ill formed type." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace (parsed_locations parsed) rest + | Environment.Ecoproto_error (Ill_typed_contract (expr, type_map)) :: rest + -> + let parsed = + match parsed with + | Some parsed + when (not details) && expr = parsed.Michelson_v1_parser.expanded -> + parsed + | Some _ | None -> + Michelson_v1_printer.unparse_toplevel ~type_map expr + in + let hilights = collect_error_locations rest in + if show_source then + Format.fprintf + ppf + "@[<v 0>Ill typed contract:@, %a@]" + print_source + (parsed, hilights) + else Format.fprintf ppf "Ill typed contract." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace (parsed_locations parsed) rest + | Environment.Ecoproto_error + Validate_errors.Manager.Gas_quota_exceeded_init_deserialize + :: rest -> + Format.fprintf + ppf + "@[<v 0>Not enough gas to deserialize the operation.@,\ + Injecting such a transaction could have you banned from mempools.@]" ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Deprecated_instruction prim) :: rest -> + Format.fprintf + ppf + "@[<v 0>Use of deprecated instruction: %s@]" + (Michelson_v1_primitives.string_of_prim prim) ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error Cannot_serialize_storage :: rest -> + Format.fprintf + ppf + "Cannot serialize the resulting storage value within the provided \ + gas bounds." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Missing_field prim) :: rest -> + Format.fprintf + ppf + "@[<v 0>Missing contract field: %s@]" + (Michelson_v1_primitives.string_of_prim prim) ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Duplicate_field (loc, prim)) :: rest -> + Format.fprintf + ppf + "@[<v 0>%aduplicate contract field: %s@]" + print_loc + loc + (Michelson_v1_primitives.string_of_prim prim) ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Unexpected_lazy_storage loc) :: rest -> + Format.fprintf + ppf + "%abig_map or sapling_state type not expected here" + print_loc + loc ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Unexpected_operation loc) :: rest -> + Format.fprintf + ppf + "%aoperation type forbidden in parameter, storage and constants" + print_loc + loc ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Unexpected_contract loc) :: rest -> + Format.fprintf + ppf + "%acontract type forbidden in storage and constants" + print_loc + loc ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error (Runtime_contract_error contract) :: rest -> + Format.fprintf + ppf + "@[<v 2>Runtime error in unknown contract %a@]" + Contract_hash.pp + contract ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Rich_runtime_contract_error (contract, parsed) :: rest -> + let hilights = collect_error_locations rest in + Format.fprintf + ppf + "@[<v 2>Runtime error in contract %a:@ %a@]" + Contract_hash.pp + contract + print_source + (parsed, hilights) ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace (parsed_locations parsed) rest + | Environment.Ecoproto_error (Apply.Internal_operation_replay op) :: rest -> + Format.fprintf + ppf + "@[<v 2>Internal operation replay attempt:@,%a@]" + Operation_result.pp_internal_operation + op ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error Gas.Gas_limit_too_high :: rest -> + Format.fprintf + ppf + "Gas limit for the operation is out of the protocol hard bounds." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error Gas.Block_quota_exceeded :: rest -> + Format.fprintf + ppf + "Gas limit for the block exceeded during typechecking or execution." ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error Gas.Operation_quota_exceeded :: rest -> + Format.fprintf + ppf + "@[<v 0>Gas limit exceeded during typechecking or execution.@,\ + Try again with a higher gas limit.@]" ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | Environment.Ecoproto_error Fees.Operation_quota_exceeded :: rest -> + Format.fprintf + ppf + "@[<v 0>Storage limit exceeded during typechecking or execution.@,\ + Try again with a higher storage limit.@]" ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | [Environment.Ecoproto_error (Script_interpreter.Bad_contract_parameter c)] + -> + Format.fprintf + ppf + "@[<v 0>Account %a is not a smart contract, it does not take \ + arguments.@,\ + The `-arg' flag should not be used when transferring to an \ + account.@]" + Contract.pp + c + | Environment.Ecoproto_error err :: rest -> + (match err with + | Bad_contract_parameter c -> + Format.fprintf + ppf + "Invalid argument passed to contract %a." + Contract.pp + c + | Invalid_arity (loc, name, exp, got) -> + Format.fprintf + ppf + "%aprimitive %s expects %d arguments but is given %d." + print_loc + loc + (Michelson_v1_primitives.string_of_prim name) + exp + got + | Invalid_seq_arity (loc, exp, got) -> + Format.fprintf + ppf + "%asequence expects at least %d elements but is given %d." + print_loc + loc + exp + got + | Invalid_namespace (loc, name, exp, got) -> + let human_namespace = function + | Michelson_v1_primitives.Instr_namespace -> ("an", "instruction") + | Type_namespace -> ("a", "type name") + | Constant_namespace -> ("a", "constant constructor") + | Keyword_namespace -> ("a", "keyword") + | Constant_hash_namespace -> ("a", "constant hash") + in + Format.fprintf + ppf + "@[%aunexpected %s %s, only %s %s can be used here." + print_loc + loc + (snd (human_namespace got)) + (Michelson_v1_primitives.string_of_prim name) + (fst (human_namespace exp)) + (snd (human_namespace exp)) + | Invalid_primitive (loc, exp, got) -> + Format.fprintf + ppf + "@[%ainvalid primitive %s, only %a can be used here." + print_loc + loc + (Michelson_v1_primitives.string_of_prim got) + print_enumeration + (List.map Michelson_v1_primitives.string_of_prim exp) + | Invalid_kind (loc, exp, got) -> + let human_kind = function + | Seq_kind -> ("a", "sequence") + | Prim_kind -> ("a", "primitive") + | Int_kind -> ("an", "int") + | String_kind -> ("a", "string") + | Bytes_kind -> ("a", "byte sequence") + in + Format.fprintf + ppf + "@[%aunexpected %s, only@ %a@ can be used here." + print_loc + loc + (snd (human_kind got)) + print_enumeration + (List.map + (fun k -> + let a, n = human_kind k in + a ^ " " ^ n) + exp) + | Invalid_never_expr loc -> + Format.fprintf + ppf + "@[%athis expression should have type never but type never has \ + no inhabitant." + print_loc + loc + | Duplicate_map_keys (_, expr) -> + Format.fprintf + ppf + "@[<v 2>Map literals cannot contain duplicate keys, however a \ + duplicate key was found:@ @[%a@]" + print_expr + expr + | Unordered_map_keys (_, expr) -> + Format.fprintf + ppf + "@[<v 2>Keys in a map literal must be in strictly ascending \ + order, but they were unordered in literal:@ @[%a@]" + print_expr + expr + | Duplicate_set_values (_, expr) -> + Format.fprintf + ppf + "@[<v 2>Set literals cannot contain duplicate values, however a \ + duplicate value was found:@ @[%a@]" + print_expr + expr + | Unordered_set_values (_, expr) -> + Format.fprintf + ppf + "@[<v 2>Values in a set literal must be in strictly ascending \ + order, but they were unordered in literal:@ @[%a@]" + print_expr + expr + | Fail_not_in_tail_position loc -> + Format.fprintf + ppf + "%aThe FAIL instruction must appear in a tail position." + print_loc + loc + | Undefined_binop (loc, name, tya, tyb) -> + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>%aoperator %s is undefined between@ %a@]@ \ + @[<hov 2>and@ %a.@]@]" + print_loc + loc + (Michelson_v1_primitives.string_of_prim name) + print_ty + tya + print_ty + tyb + | Undefined_unop (loc, name, ty) -> + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>%aoperator %s is undefined on@ %a@]@]" + print_loc + loc + (Michelson_v1_primitives.string_of_prim name) + print_ty + ty + | Bad_return (loc, got, exp) -> + Format.fprintf + ppf + "@[<v 2>%awrong stack type at end of body:@,\ + - @[<v 0>expected return stack type:@ %a,@]@,\ + - @[<v 0>actual stack type:@ %a.@]@]" + print_loc + loc + (fun ppf -> print_stack_ty ppf) + [exp] + (fun ppf -> print_stack_ty ppf) + got + | Bad_stack (loc, name, depth, sty) -> + Format.fprintf + ppf + "@[<hov 2>%awrong stack type for instruction %s:@ %a.@]" + print_loc + loc + (Michelson_v1_primitives.string_of_prim name) + (print_stack_ty ~depth) + sty + | Unmatched_branches (loc, sta, stb) -> + Format.fprintf + ppf + "@[<v 2>%atwo branches don't end with the same stack type:@,\ + - @[<hov>first stack type:@ %a,@]@,\ + - @[<hov>other stack type:@ %a.@]@]" + print_loc + loc + (fun ppf -> print_stack_ty ppf) + sta + (fun ppf -> print_stack_ty ppf) + stb + | Bad_view_name loc -> + Format.fprintf + ppf + "@[<v 2>%athe name of view should be of type string @]" + print_loc + loc + | Duplicated_view_name loc -> + Format.fprintf + ppf + "@[<v 2>%athe name of view in toplevel should be unique @]" + print_loc + loc + | Ill_typed_view {loc; actual; expected} -> + Format.fprintf + ppf + "@[<v 2>%athe return of a view block did not match the expected \ + type.@,\ + - @[<hov>resulted view stack type:@ %a,@]@,\ + - @[<hov>expected view stack type:@ %a.@]@]" + print_loc + loc + (fun ppf -> print_stack_ty ppf) + actual + (fun ppf -> print_stack_ty ppf) + expected + | View_name_too_long name -> + Format.fprintf + ppf + "@[<v 2> A view name, \"%s\", exceeds the maximum length of 31 \ + characters." + name + | Inconsistent_type_sizes (size1, size2) -> + Format.fprintf + ppf + "@[<v 2>The two types have different sizes, the first one is of \ + size %d while the other one is of size %d@]" + size1 + size2 + | Unexpected_annotation loc -> + Format.fprintf ppf "@[<v 2>%aunexpected annotation." print_loc loc + | Ungrouped_annotations loc -> + Format.fprintf + ppf + "@[<v 2>%aAnnotations of the same kind must be grouped." + print_loc + loc + | Type_too_large (loc, maximum_size) -> + Format.fprintf + ppf + "@[<v 2>%atype exceeded maximum type size (%d)." + print_loc + loc + maximum_size + | Pair_bad_argument loc -> + Format.fprintf + ppf + "%aPAIR expects an argument of at least 2." + print_loc + loc + | Unpair_bad_argument loc -> + Format.fprintf + ppf + "%aUNPAIR expects an argument of at least 2." + print_loc + loc + | Dup_n_bad_argument loc -> + Format.fprintf + ppf + "%aDUP n expects an argument of at least 1 (passed 0)." + print_loc + loc + | Forbidden_instr_in_context (loc, ctxt, prim) -> + Format.fprintf + ppf + "%aThe %s instruction cannot appear in a %s." + print_loc + loc + (Michelson_v1_primitives.string_of_prim prim) + (string_of_context_desc ctxt) + | Non_dupable_type (loc, ty) -> + Format.fprintf + ppf + "%atype %a cannot be used here because it is not duplicable. \ + Only duplicable types can be used with the DUP instruction and \ + as view inputs and outputs." + print_loc + loc + print_ty + ty + | Unexpected_ticket loc -> + Format.fprintf + ppf + "%aTicket in unauthorized position (type error)." + print_loc + loc + | Bad_stack_length -> Format.fprintf ppf "Bad stack length." + | Bad_stack_item lvl -> Format.fprintf ppf "Bad stack item %d." lvl + | Unexpected_forged_value loc -> + Format.fprintf ppf "%aUnexpected forged value." print_loc loc + | Invalid_constant (loc, got, exp) -> + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>%avalue@ %a@]@ @[<hov 2>is invalid for type@ \ + %a.@]@]" + print_loc + loc + print_expr + got + print_ty + exp + | Invalid_syntactic_constant (loc, got, exp) -> + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>%avalue@ %a@]@ @[<hov 2>is invalid, expected@ \ + %s@]@]" + print_loc + loc + print_expr + got + exp + | Invalid_contract (loc, contract) -> + Format.fprintf + ppf + "%ainvalid contract %a." + print_loc + loc + Contract.pp + contract + | Comparable_type_expected (loc, ty) -> + Format.fprintf ppf "%acomparable type expected." print_loc loc ; + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>Type@ %a@]@ is not comparable.@]" + print_ty + ty + | Inconsistent_types (loc, tya, tyb) -> + Format.fprintf + ppf + "@[<hov 0>@[<hov 2>%aType@ %a@]@ @[<hov 2>is not compatible with \ + type@ %a.@]@]" + print_loc + loc + print_ty + tya + print_ty + tyb + | Reject (loc, v, trace) -> + Format.fprintf + ppf + "%ascript reached FAILWITH instruction@ @[<hov 2>with@ %a@]%a" + print_loc + loc + print_expr + v + (fun ppf -> function + | None -> () + | Some trace -> + Format.fprintf + ppf + "@,@[<v 2>trace@,%a@]" + print_execution_trace + trace) + trace + | Overflow (loc, trace) -> + Format.fprintf + ppf + "%aunexpected arithmetic overflow%a" + print_loc + loc + (fun ppf -> function + | None -> () + | Some trace -> + Format.fprintf + ppf + "@,@[<v 2>trace@,%a@]" + print_execution_trace + trace) + trace + | err -> Format.fprintf ppf "%a" Environment.Error_monad.pp err) ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + | err :: rest -> + Format.fprintf ppf "%a" Error_monad.pp err ; + if rest <> [] then Format.fprintf ppf "@," ; + print_trace locations rest + in + Format.fprintf ppf "@[<v 0>" ; + print_trace (fun _ -> None) errs ; + Format.fprintf ppf "@]" diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.mli new file mode 100644 index 000000000000..1d3df5de4b1b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_error_reporter.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val enrich_runtime_errors : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + block:Shell_services.block -> + parsed:Michelson_v1_parser.parsed option -> + Error_monad.error list -> + Error_monad.error list Lwt.t + +val report_errors : + details:bool -> + show_source:bool -> + ?parsed:Michelson_v1_parser.parsed -> + Format.formatter -> + Error_monad.error list -> + unit diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_helpers.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_helpers.ml new file mode 100644 index 000000000000..40d1698fff37 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_helpers.ml @@ -0,0 +1,60 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Generic Michelson building functions *) + +open Tezos_micheline.Micheline +open Protocol.Alpha_context.Script + +let seq ~loc l = Seq (loc, l) + +let pair ~loc a b = Prim (loc, D_Pair, [a; b], []) + +let none ~loc () = Prim (loc, D_None, [], []) + +let some ~loc a = Prim (loc, D_Some, [a], []) + +let left ~loc a = Prim (loc, D_Left, [a], []) + +let right ~loc b = Prim (loc, D_Right, [b], []) + +let int ~loc i = Int (loc, i) + +let bytes ~loc s = Bytes (loc, s) + +let unit_t ~loc = Prim (loc, T_unit, [], []) + +let unit ~loc = Prim (loc, D_Unit, [], []) + +let lambda_from_string code = + Tezos_micheline.Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression code + >|? fun parsed -> root Michelson_v1_parser.(parsed.expanded) + +let lambda_t ~loc param res = Prim (loc, T_lambda, [param; res], []) + +let operation_t ~loc = Prim (loc, T_operation, [], []) + +let operations_t ~loc = Prim (loc, T_list, [operation_t ~loc], []) diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.ml new file mode 100644 index 000000000000..3b1eaa5028d4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.ml @@ -0,0 +1,1518 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Tezos_micheline +open Micheline +module IntMap = Map.Make (Compare.Int) + +type 'l node = ('l, string) Micheline.node + +type error += Unexpected_macro_annotation of string + +type error += Sequence_expected of string + +type error += Invalid_arity of string * int * int + +let rec check_letters str i j f = + i > j || (f str.[i] && check_letters str (i + 1) j f) + +let expand_caddadr original = + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if + len > 3 + && str.[0] = 'C' + && str.[len - 1] = 'R' + && check_letters str 1 (len - 2) (function + | 'A' | 'D' -> true + | _ -> false) + then + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (str, List.length args, 0))) + >>? fun () -> + let path_annot = + List.filter (function "@%" | "@%%" -> true | _ -> false) annot + in + let rec parse i acc = + if i = 0 then Seq (loc, acc) + else + let annot = if i = len - 2 then annot else path_annot in + match str.[i] with + | 'A' -> parse (i - 1) (Prim (loc, "CAR", [], annot) :: acc) + | 'D' -> parse (i - 1) (Prim (loc, "CDR", [], annot) :: acc) + | _ -> assert false + in + ok (Some (parse (len - 2) [])) + else ok None + | _ -> ok None + +let expand_carn original = + match original with + | Prim (loc, "CAR", [Int (loc2, n)], annot) -> + ok + (Some + (Seq + ( loc, + [ + Prim + ( loc, + "GET", + [Int (loc2, Z.(of_int 1 + (n * of_int 2)))], + annot ); + ] ))) + | _ -> ok None + +let expand_cdrn original = + match original with + | Prim (loc, "CDR", [Int (loc2, n)], annot) -> + ok + (Some + (Seq (loc, [Prim (loc, "GET", [Int (loc2, Z.(n * of_int 2))], annot)]))) + | _ -> ok None + +let extract_field_annots annot = + List.partition + (fun a -> + match a.[0] with + | '%' -> true + | _ -> false + | exception Invalid_argument _ -> false) + annot + +let expand_set_caddadr original = + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if + len >= 7 + && String.sub str 0 5 = "SET_C" + && str.[len - 1] = 'R' + && check_letters str 5 (len - 2) (function + | 'A' | 'D' -> true + | _ -> false) + then + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (str, List.length args, 0))) + >>? fun () -> + (match extract_field_annots annot with + | [], annot -> ok (None, annot) + | [f], annot -> ok (Some f, annot) + | _, _ -> error (Unexpected_macro_annotation str)) + >>? fun (field_annot, annot) -> + let rec parse i acc = + if i = 4 then acc + else + let annot = if i = 5 then annot else [] in + match str.[i] with + | 'A' -> + let acc = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim + ( loc, + "DIP", + [Seq (loc, [Prim (loc, "CAR", [], ["@%%"]); acc])], + [] ); + Prim (loc, "CDR", [], ["@%%"]); + Prim (loc, "SWAP", [], []); + Prim (loc, "PAIR", [], "%@" :: "%@" :: annot); + ] ) + in + parse (i - 1) acc + | 'D' -> + let acc = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim + ( loc, + "DIP", + [Seq (loc, [Prim (loc, "CDR", [], ["@%%"]); acc])], + [] ); + Prim (loc, "CAR", [], ["@%%"]); + Prim (loc, "PAIR", [], "%@" :: "%@" :: annot); + ] ) + in + parse (i - 1) acc + | _ -> assert false + in + match str.[len - 2] with + | 'A' -> + let access_check = + match field_annot with + | None -> [] + | Some f -> + [ + Prim (loc, "DUP", [], []); + Prim (loc, "CAR", [], [f]); + Prim (loc, "DROP", [], []); + ] + in + let encoding = + [Prim (loc, "CDR", [], ["@%%"]); Prim (loc, "SWAP", [], [])] + in + let pair = + [ + Prim + ( loc, + "PAIR", + [], + [Option.value field_annot ~default:"%"; "%@"] ); + ] + in + let init = Seq (loc, access_check @ encoding @ pair) in + ok (Some (parse (len - 3) init)) + | 'D' -> + let access_check = + match field_annot with + | None -> [] + | Some f -> + [ + Prim (loc, "DUP", [], []); + Prim (loc, "CDR", [], [f]); + Prim (loc, "DROP", [], []); + ] + in + let encoding = [Prim (loc, "CAR", [], ["@%%"])] in + let pair = + [ + Prim + ( loc, + "PAIR", + [], + ["%@"; Option.value field_annot ~default:"%"] ); + ] + in + let init = Seq (loc, access_check @ encoding @ pair) in + ok (Some (parse (len - 3) init)) + | _ -> assert false + else ok None + | _ -> ok None + +let expand_map_caddadr original = + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if + len >= 7 + && String.sub str 0 5 = "MAP_C" + && str.[len - 1] = 'R' + && check_letters str 5 (len - 2) (function + | 'A' | 'D' -> true + | _ -> false) + then + (match args with + | [(Seq _ as code)] -> ok code + | [_] -> error (Sequence_expected str) + | [] | _ :: _ :: _ -> error (Invalid_arity (str, List.length args, 1))) + >>? fun code -> + (match extract_field_annots annot with + | [], annot -> ok (None, annot) + | [f], annot -> ok (Some f, annot) + | _, _ -> error (Unexpected_macro_annotation str)) + >>? fun (field_annot, annot) -> + let rec parse i acc = + if i = 4 then acc + else + let annot = if i = 5 then annot else [] in + match str.[i] with + | 'A' -> + let acc = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim + ( loc, + "DIP", + [Seq (loc, [Prim (loc, "CAR", [], ["@%%"]); acc])], + [] ); + Prim (loc, "CDR", [], ["@%%"]); + Prim (loc, "SWAP", [], []); + Prim (loc, "PAIR", [], "%@" :: "%@" :: annot); + ] ) + in + parse (i - 1) acc + | 'D' -> + let acc = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim + ( loc, + "DIP", + [Seq (loc, [Prim (loc, "CDR", [], ["@%%"]); acc])], + [] ); + Prim (loc, "CAR", [], ["@%%"]); + Prim (loc, "PAIR", [], "%@" :: "%@" :: annot); + ] ) + in + parse (i - 1) acc + | _ -> assert false + in + let cr_annot = + match field_annot with + | None -> [] + | Some f -> ["@" ^ String.sub f 1 (String.length f - 1)] + in + match str.[len - 2] with + | 'A' -> + let init = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim (loc, "CDR", [], ["@%%"]); + Prim + ( loc, + "DIP", + [Seq (loc, [Prim (loc, "CAR", [], cr_annot); code])], + [] ); + Prim (loc, "SWAP", [], []); + Prim + ( loc, + "PAIR", + [], + [Option.value field_annot ~default:"%"; "%@"] ); + ] ) + in + ok (Some (parse (len - 3) init)) + | 'D' -> + let init = + Seq + ( loc, + [ + Prim (loc, "DUP", [], []); + Prim (loc, "CDR", [], cr_annot); + code; + Prim (loc, "SWAP", [], []); + Prim (loc, "CAR", [], ["@%%"]); + Prim + ( loc, + "PAIR", + [], + ["%@"; Option.value field_annot ~default:"%"] ); + ] ) + in + ok (Some (parse (len - 3) init)) + | _ -> assert false + else ok None + | _ -> ok None + +exception Not_a_roman + +let decimal_of_roman roman = + (* http://rosettacode.org/wiki/Roman_numerals/Decode#OCaml *) + let arabic = ref 0 in + let lastval = ref 0 in + for i = String.length roman - 1 downto 0 do + let n = + match roman.[i] with + | 'M' -> 1000 + | 'D' -> 500 + | 'C' -> 100 + | 'L' -> 50 + | 'X' -> 10 + | 'V' -> 5 + | 'I' -> 1 + | _ -> raise_notrace Not_a_roman + in + if Compare.Int.(n < !lastval) then arabic := !arabic - n + else arabic := !arabic + n ; + lastval := n + done ; + !arabic + +let dip ~loc ?(annot = []) depth instr = + assert (depth >= 0) ; + if depth = 1 then Prim (loc, "DIP", [instr], annot) + else Prim (loc, "DIP", [Int (loc, Z.of_int depth); instr], annot) + +let expand_deprecated_dxiiivp original = + (* transparently expands deprecated macro [DI...IP] to instruction [DIP n] *) + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if len > 3 && str.[0] = 'D' && str.[len - 1] = 'P' then + try + let depth = decimal_of_roman (String.sub str 1 (len - 2)) in + match args with + | [(Seq (_, _) as arg)] -> ok @@ Some (dip ~loc ~annot depth arg) + | [_] -> error (Sequence_expected str) + | [] | _ :: _ :: _ -> error (Invalid_arity (str, List.length args, 1)) + with Not_a_roman -> ok None + else ok None + | _ -> ok None + +exception Not_a_pair + +type pair_item = A | I | P of int * pair_item * pair_item + +let parse_pair_substr str ~len start = + let rec parse ?left i = + if i = len - 1 then raise_notrace Not_a_pair + else if str.[i] = 'P' then + let next_i, l = parse ~left:true (i + 1) in + let next_i, r = parse ~left:false next_i in + (next_i, P (i, l, r)) + else if str.[i] = 'A' && left = Some true then (i + 1, A) + else if str.[i] = 'I' && left <> Some true then (i + 1, I) + else raise_notrace Not_a_pair + in + let last, ast = parse start in + if last <> len - 1 then raise_notrace Not_a_pair else ast + +let unparse_pair_item ast = + let rec unparse ast acc = + match ast with + | P (_, l, r) -> unparse r (unparse l ("P" :: acc)) + | A -> "A" :: acc + | I -> "I" :: acc + in + List.rev ("R" :: unparse ast []) |> String.concat "" + +let pappaiir_annots_pos ast annot = + let rec find_annots_pos p_pos ast annots acc = + match (ast, annots) with + | _, [] -> (annots, acc) + | P (i, left, right), _ -> + let annots, acc = find_annots_pos i left annots acc in + find_annots_pos i right annots acc + | A, a :: annots -> + let pos = + match IntMap.find p_pos acc with + | None -> ([a], []) + | Some (_, cdr) -> ([a], cdr) + in + (annots, IntMap.add p_pos pos acc) + | I, a :: annots -> + let pos = + match IntMap.find p_pos acc with + | None -> ([], [a]) + | Some (car, _) -> (car, [a]) + in + (annots, IntMap.add p_pos pos acc) + in + snd (find_annots_pos 0 ast annot IntMap.empty) + +let expand_pappaiir original = + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if + len > 4 + && str.[0] = 'P' + && str.[len - 1] = 'R' + && check_letters str 1 (len - 2) (function + | 'P' | 'A' | 'I' -> true + | _ -> false) + then + try + let field_annots, annot = extract_field_annots annot in + let ast = parse_pair_substr str ~len 0 in + let field_annots_pos = pappaiir_annots_pos ast field_annots in + let rec parse p (depth, acc) = + match p with + | P (i, left, right) -> + let annot = + match (i, IntMap.find i field_annots_pos) with + | 0, None -> annot + | _, None -> [] + | 0, Some ([], cdr_annot) -> ("%" :: cdr_annot) @ annot + | _, Some ([], cdr_annot) -> "%" :: cdr_annot + | 0, Some (car_annot, cdr_annot) -> + car_annot @ cdr_annot @ annot + | _, Some (car_annot, cdr_annot) -> car_annot @ cdr_annot + in + let acc = + if depth = 0 then Prim (loc, "PAIR", [], annot) :: acc + else + dip ~loc depth (Seq (loc, [Prim (loc, "PAIR", [], annot)])) + :: acc + in + (depth, acc) |> parse left |> parse right + | A | I -> (depth + 1, acc) + in + let _, expanded = parse ast (0, []) in + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (str, List.length args, 0))) + >>? fun () -> ok (Some (Seq (loc, expanded))) + with Not_a_pair -> ok None + else ok None + | _ -> ok None + +let expand_unpappaiir original = + match original with + | Prim (loc, str, args, _annot) -> + let len = String.length str in + if + len > 6 + && String.sub str 0 3 = "UNP" + && str.[len - 1] = 'R' + && check_letters str 3 (len - 2) (function + | 'P' | 'A' | 'I' -> true + | _ -> false) + then + try + let unpair = Prim (loc, "UNPAIR", [], []) in + let ast = parse_pair_substr str ~len 2 in + let rec parse p (depth, acc) = + match p with + | P (_i, left, right) -> + let acc = + if depth = 0 then unpair :: acc + else dip ~loc depth (Seq (loc, [unpair])) :: acc + in + (depth, acc) |> parse left |> parse right + | A | I -> (depth + 1, acc) + in + let _, rev_expanded = parse ast (0, []) in + let expanded = Seq (loc, List.rev rev_expanded) in + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (str, List.length args, 0))) + >>? fun () -> ok (Some expanded) + with Not_a_pair -> ok None + else ok None + | _ -> ok None + +exception Not_a_dup + +let expand_deprecated_duuuuup original = + (* transparently expands deprecated macro [DU...UP] to [{ DUP n }] *) + match original with + | Prim (loc, str, args, annot) -> + let len = String.length str in + if + len > 3 + && str.[0] = 'D' + && str.[len - 1] = 'P' + && check_letters str 1 (len - 2) (( = ) 'U') + then + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (str, List.length args, 0))) + >>? fun () -> + try + let rec parse i = + if i = 1 then + Prim (loc, "DUP", [Int (loc, Z.of_int (len - 2))], annot) + else if str.[i] = 'U' then parse (i - 1) + else raise_notrace Not_a_dup + in + ok (Some (parse (len - 2))) + with Not_a_dup -> ok None + else ok None + | _ -> ok None + +let expand_compare original = + let cmp loc is annot = + let is = + match List.rev_map (fun i -> Prim (loc, i, [], [])) is with + | Prim (loc, i, args, _) :: r -> List.rev (Prim (loc, i, args, annot) :: r) + | is -> List.rev is + in + ok (Some (Seq (loc, is))) + in + let ifcmp loc is l r annot = + let is = + List.map (fun i -> Prim (loc, i, [], [])) is + @ [Prim (loc, "IF", [l; r], annot)] + in + ok (Some (Seq (loc, is))) + in + match original with + | Prim (loc, "CMPEQ", [], annot) -> cmp loc ["COMPARE"; "EQ"] annot + | Prim (loc, "CMPNEQ", [], annot) -> cmp loc ["COMPARE"; "NEQ"] annot + | Prim (loc, "CMPLT", [], annot) -> cmp loc ["COMPARE"; "LT"] annot + | Prim (loc, "CMPGT", [], annot) -> cmp loc ["COMPARE"; "GT"] annot + | Prim (loc, "CMPLE", [], annot) -> cmp loc ["COMPARE"; "LE"] annot + | Prim (loc, "CMPGE", [], annot) -> cmp loc ["COMPARE"; "GE"] annot + | Prim + ( _, + (("CMPEQ" | "CMPNEQ" | "CMPLT" | "CMPGT" | "CMPLE" | "CMPGE") as str), + args, + [] ) -> + error (Invalid_arity (str, List.length args, 0)) + | Prim (loc, "IFCMPEQ", [l; r], annot) -> + ifcmp loc ["COMPARE"; "EQ"] l r annot + | Prim (loc, "IFCMPNEQ", [l; r], annot) -> + ifcmp loc ["COMPARE"; "NEQ"] l r annot + | Prim (loc, "IFCMPLT", [l; r], annot) -> + ifcmp loc ["COMPARE"; "LT"] l r annot + | Prim (loc, "IFCMPGT", [l; r], annot) -> + ifcmp loc ["COMPARE"; "GT"] l r annot + | Prim (loc, "IFCMPLE", [l; r], annot) -> + ifcmp loc ["COMPARE"; "LE"] l r annot + | Prim (loc, "IFCMPGE", [l; r], annot) -> + ifcmp loc ["COMPARE"; "GE"] l r annot + | Prim (loc, "IFEQ", [l; r], annot) -> ifcmp loc ["EQ"] l r annot + | Prim (loc, "IFNEQ", [l; r], annot) -> ifcmp loc ["NEQ"] l r annot + | Prim (loc, "IFLT", [l; r], annot) -> ifcmp loc ["LT"] l r annot + | Prim (loc, "IFGT", [l; r], annot) -> ifcmp loc ["GT"] l r annot + | Prim (loc, "IFLE", [l; r], annot) -> ifcmp loc ["LE"] l r annot + | Prim (loc, "IFGE", [l; r], annot) -> ifcmp loc ["GE"] l r annot + | Prim + ( _, + (( "IFCMPEQ" | "IFCMPNEQ" | "IFCMPLT" | "IFCMPGT" | "IFCMPLE" + | "IFCMPGE" | "IFEQ" | "IFNEQ" | "IFLT" | "IFGT" | "IFLE" | "IFGE" ) as + str), + args, + [] ) -> + error (Invalid_arity (str, List.length args, 2)) + | Prim + ( _, + (( "IFCMPEQ" | "IFCMPNEQ" | "IFCMPLT" | "IFCMPGT" | "IFCMPLE" + | "IFCMPGE" | "IFEQ" | "IFNEQ" | "IFLT" | "IFGT" | "IFLE" | "IFGE" ) as + str), + [], + _ :: _ ) -> + error (Unexpected_macro_annotation str) + | _ -> ok None + +let expand_asserts original = + let may_rename loc = function + | [] -> Seq (loc, []) + | annot -> Seq (loc, [Prim (loc, "RENAME", [], annot)]) + in + let fail_false ?(annot = []) loc = + [may_rename loc annot; Seq (loc, [Prim (loc, "FAIL", [], [])])] + in + let fail_true ?(annot = []) loc = + [Seq (loc, [Prim (loc, "FAIL", [], [])]); may_rename loc annot] + in + match original with + | Prim (loc, "ASSERT", [], []) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF", fail_false loc, [])])) + | Prim (loc, "ASSERT_NONE", [], []) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_NONE", fail_false loc, [])])) + | Prim (loc, "ASSERT_SOME", [], annot) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_NONE", fail_true ~annot loc, [])])) + | Prim (loc, "ASSERT_LEFT", [], annot) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_LEFT", fail_false ~annot loc, [])])) + | Prim (loc, "ASSERT_RIGHT", [], annot) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_LEFT", fail_true ~annot loc, [])])) + | Prim + ( _, + (( "ASSERT" | "ASSERT_NONE" | "ASSERT_SOME" | "ASSERT_LEFT" + | "ASSERT_RIGHT" ) as str), + args, + [] ) -> + error (Invalid_arity (str, List.length args, 0)) + | Prim (_, (("ASSERT" | "ASSERT_NONE") as str), [], _ :: _) -> + error (Unexpected_macro_annotation str) + | Prim (loc, s, args, annot) + when String.(length s > 7 && equal (sub s 0 7) "ASSERT_") -> ( + (match args with + | [] -> ok () + | _ :: _ -> error (Invalid_arity (s, List.length args, 0))) + >>? fun () -> + (match annot with + | _ :: _ -> error (Unexpected_macro_annotation s) + | [] -> ok ()) + >>? fun () -> + let remaining = String.(sub s 7 (length s - 7)) in + let remaining_prim = Prim (loc, remaining, [], []) in + match remaining with + | "EQ" | "NEQ" | "LT" | "LE" | "GE" | "GT" -> + ok + @@ Some + (Seq (loc, [remaining_prim; Prim (loc, "IF", fail_false loc, [])])) + | _ -> ( + expand_compare remaining_prim >|? function + | None -> None + | Some seq -> + Some (Seq (loc, [seq; Prim (loc, "IF", fail_false loc, [])])))) + | _ -> ok None + +let expand_if_some = function + | Prim (loc, "IF_SOME", [right; left], annot) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_NONE", [left; right], annot)])) + | Prim (_, "IF_SOME", args, _annot) -> + error (Invalid_arity ("IF_SOME", List.length args, 2)) + | _ -> ok @@ None + +let expand_if_right = function + | Prim (loc, "IF_RIGHT", [right; left], annot) -> + ok @@ Some (Seq (loc, [Prim (loc, "IF_LEFT", [left; right], annot)])) + | Prim (_, "IF_RIGHT", args, _annot) -> + error (Invalid_arity ("IF_RIGHT", List.length args, 2)) + | _ -> ok @@ None + +let expand_fail = function + | Prim (loc, "FAIL", [], []) -> + ok + @@ Some + (Seq + (loc, [Prim (loc, "UNIT", [], []); Prim (loc, "FAILWITH", [], [])])) + | _ -> ok @@ None + +let expand original = + let rec try_expansions = function + | [] -> ok @@ original + | expander :: expanders -> ( + expander original >>? function + | None -> try_expansions expanders + | Some rewritten -> ok rewritten) + in + try_expansions + [ + expand_carn; + expand_cdrn; + expand_caddadr; + expand_set_caddadr; + expand_map_caddadr; + expand_deprecated_dxiiivp; + (* expand_paaiair ; *) + expand_pappaiir; + (* expand_unpaaiair ; *) + expand_unpappaiir; + expand_deprecated_duuuuup; + expand_compare; + expand_asserts; + expand_if_some; + expand_if_right; + expand_fail; + ] + +let expand_rec expr = + let rec error_map (expanded, errors) f = function + | [] -> (List.rev expanded, List.rev errors) + | hd :: tl -> + let new_expanded, new_errors = f hd in + error_map + (new_expanded :: expanded, List.rev_append new_errors errors) + f + tl + in + let error_map = error_map ([], []) in + let rec expand_rec expr = + match expand expr with + | Ok expanded -> ( + match expanded with + | Seq (loc, items) -> + let items, errors = error_map expand_rec items in + (Seq (loc, items), errors) + | Prim (loc, name, args, annot) -> + let args, errors = error_map expand_rec args in + (Prim (loc, name, args, annot), errors) + | (Int _ | String _ | Bytes _) as atom -> (atom, [])) + | Error errors -> (expr, errors) + in + expand_rec expr + +let unexpand_carn_and_cdrn expanded = + match expanded with + | Seq (loc, [Prim (_, "GET", [Int (locn, n)], annot)]) -> + let half, parity = Z.ediv_rem n (Z.of_int 2) in + if Z.(parity = zero) then + Some (Prim (loc, "CDR", [Int (locn, half)], annot)) + else Some (Prim (loc, "CAR", [Int (locn, half)], annot)) + | _ -> None + +let unexpand_caddadr expanded = + let rec rsteps acc = function + | [] -> Some acc + | Prim (_, "CAR", [], []) :: rest -> rsteps ("A" :: acc) rest + | Prim (_, "CDR", [], []) :: rest -> rsteps ("D" :: acc) rest + | _ -> None + in + match expanded with + | Seq (loc, (Prim (_, "CAR", [], []) :: _ as nodes)) + | Seq (loc, (Prim (_, "CDR", [], []) :: _ as nodes)) -> ( + match rsteps [] nodes with + | Some steps -> + let name = String.concat "" ("C" :: List.rev ("R" :: steps)) in + Some (Prim (loc, name, [], [])) + | None -> None) + | _ -> None + +let unexpand_set_caddadr expanded = + let rec steps acc annots = function + | Seq + ( loc, + [ + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], _); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "A" :: acc, annots) + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CAR", [], [field_annot]); + Prim (_, "DROP", [], []); + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], []); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "A" :: acc, field_annot :: annots) + | Seq (loc, [Prim (_, "CAR", [], _); Prim (_, "PAIR", [], _)]) -> + Some (loc, "D" :: acc, annots) + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CDR", [], [field_annot]); + Prim (_, "DROP", [], []); + Prim (_, "CAR", [], _); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "D" :: acc, field_annot :: annots) + | Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CAR", [], _); sub])], []); + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], []); + Prim (_, "PAIR", [], pair_annots); + ] ) -> + let _, pair_annots = extract_field_annots pair_annots in + steps ("A" :: acc) (List.rev_append pair_annots annots) sub + | Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CDR", [], _); sub])], []); + Prim (_, "CAR", [], _); + Prim (_, "PAIR", [], pair_annots); + ] ) -> + let _, pair_annots = extract_field_annots pair_annots in + steps ("D" :: acc) (List.rev_append pair_annots annots) sub + | _ -> None + in + match steps [] [] expanded with + | Some (loc, steps, annots) -> + let name = String.concat "" ("SET_C" :: List.rev ("R" :: steps)) in + Some (Prim (loc, name, [], List.rev annots)) + | None -> None + +let unexpand_map_caddadr expanded = + let rec steps acc annots = function + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CAR", [], []); code])], []); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "A" :: acc, annots, code) + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], []); + Prim + ( _, + "DIP", + [Seq (_, [Prim (_, "CAR", [], [field_annot]); code])], + [] ); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "A" :: acc, field_annot :: annots, code) + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CDR", [], []); + code; + Prim (_, "SWAP", [], []); + Prim (_, "CAR", [], _); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "D" :: acc, annots, code) + | Seq + ( loc, + [ + Prim (_, "DUP", [], []); + Prim (_, "CDR", [], [field_annot]); + code; + Prim (_, "SWAP", [], []); + Prim (_, "CAR", [], _); + Prim (_, "PAIR", [], _); + ] ) -> + Some (loc, "D" :: acc, field_annot :: annots, code) + | Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CAR", [], _); sub])], []); + Prim (_, "CDR", [], _); + Prim (_, "SWAP", [], []); + Prim (_, "PAIR", [], pair_annots); + ] ) -> + let _, pair_annots = extract_field_annots pair_annots in + steps ("A" :: acc) (List.rev_append pair_annots annots) sub + | Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CDR", [], []); sub])], []); + Prim (_, "CAR", [], []); + Prim (_, "PAIR", [], pair_annots); + ] ) -> + let _, pair_annots = extract_field_annots pair_annots in + steps ("D" :: acc) (List.rev_append pair_annots annots) sub + | _ -> None + in + match steps [] [] expanded with + | Some (loc, steps, annots, code) -> + let name = String.concat "" ("MAP_C" :: List.rev ("R" :: steps)) in + Some (Prim (loc, name, [code], List.rev annots)) + | None -> None + +let unexpand_deprecated_dxiiivp expanded = + (* transparently turn the old expansion of deprecated [DI...IP] to [DIP n] *) + match expanded with + | Seq + ( loc, + [Prim (_, "DIP", [(Seq (_, [Prim (_, "DIP", [_], [])]) as sub)], [])] ) + -> + let rec count acc = function + | Seq (_, [Prim (_, "DIP", [sub], [])]) -> count (acc + 1) sub + | sub -> (acc, sub) + in + let depth, sub = count 1 sub in + Some (Prim (loc, "DIP", [Int (loc, Z.of_int depth); sub], [])) + | _ -> None + +let unexpand_dupn expanded = + match expanded with + | Seq + ( loc, + [ + Prim + (_, "DIP", [Int (_, np); Seq (_, [Prim (_, "DUP", [], annot)])], []); + Prim (_, "DIG", [Int (nloc, ng)], []); + ] ) + when Z.equal np (Z.pred ng) -> + Some (Prim (loc, "DUP", [Int (nloc, ng)], annot)) + | _ -> None + +let unexpand_deprecated_duuuuup expanded = + (* transparently turn the old expansion of deprecated [DU...UP] to [DUP n] *) + let rec expand n = function + | Seq (loc, [Prim (nloc, "DUP", [], annot)]) -> + if n = 1 then None + else Some (Prim (loc, "DUP", [Int (nloc, Z.of_int n)], annot)) + | Seq (_, [Prim (_, "DIP", [expanded'], []); Prim (_, "SWAP", [], [])]) -> + expand (n + 1) expanded' + | _ -> None + in + expand 1 expanded + +let rec normalize_pair_item ?(right = false) = function + | P (i, a, b) -> + P (i, normalize_pair_item a, normalize_pair_item ~right:true b) + | A when right -> I + | A -> A + | I -> I + +let unexpand_pappaiir expanded = + match expanded with + | Seq (_, [Prim (_, "PAIR", [], [])]) -> Some expanded + | Seq (loc, (_ :: _ as nodes)) -> ( + let rec exec stack nodes = + match (nodes, stack) with + | [], _ -> stack + (* support new expansion using [DIP n] *) + | ( Prim (ploc, "DIP", [Int (loc, n); Seq (sloc, sub)], []) :: rest, + a :: rstack ) + when Z.to_int n > 1 -> + exec + (a + :: exec + rstack + [ + Prim + (ploc, "DIP", [Int (loc, Z.pred n); Seq (sloc, sub)], []); + ]) + rest + | Prim (_, "DIP", [Int (_, n); Seq (_, sub)], []) :: rest, a :: rstack + when Z.to_int n = 1 -> + exec (a :: exec rstack sub) rest + | Prim (ploc, "DIP", [Int (loc, n); Seq (sloc, sub)], []) :: rest, [] + when Z.to_int n > 1 -> + exec + (A + :: exec + [] + [ + Prim + (ploc, "DIP", [Int (loc, Z.pred n); Seq (sloc, sub)], []); + ]) + rest + | Prim (_, "DIP", [Int (_, n); Seq (_, sub)], []) :: rest, [] + when Z.to_int n = 1 -> + exec (A :: exec [] sub) rest + (* support old expansion using [DIP] *) + | Prim (_, "DIP", [Seq (_, sub)], []) :: rest, a :: rstack -> + exec (a :: exec rstack sub) rest + | Prim (_, "DIP", [Seq (_, sub)], []) :: rest, [] -> + exec (A :: exec [] sub) rest + | Prim (_, "PAIR", [], []) :: rest, a :: b :: rstack -> + exec (P (0, a, b) :: rstack) rest + | Prim (_, "PAIR", [], []) :: rest, [a] -> exec [P (0, a, I)] rest + | Prim (_, "PAIR", [], []) :: rest, [] -> exec [P (0, A, I)] rest + | _ -> raise_notrace Not_a_pair + in + match exec [] nodes with + | [] -> None + | res :: _ -> + let res = normalize_pair_item res in + let name = unparse_pair_item res in + Some (Prim (loc, name, [], [])) + | exception Not_a_pair -> None) + | _ -> None + +let unexpand_unpappaiir expanded = + match expanded with + | Seq (loc, (_ :: _ as nodes)) -> ( + let rec exec stack nodes = + match (nodes, stack) with + | [], _ -> stack + (* support new expansion using [DIP n] *) + | ( Prim (ploc, "DIP", [Int (loc, n); Seq (sloc, sub)], []) :: rest, + a :: rstack ) + when Z.to_int n > 1 -> + exec + (a + :: exec + rstack + [ + Prim + (ploc, "DIP", [Int (loc, Z.pred n); Seq (sloc, sub)], []); + ]) + rest + | Prim (_, "DIP", [Int (_, n); Seq (_, sub)], []) :: rest, a :: rstack + when Z.to_int n = 1 -> + exec (a :: exec rstack sub) rest + | Prim (ploc, "DIP", [Int (loc, n); Seq (sloc, sub)], []) :: rest, [] + when Z.to_int n > 1 -> + exec + (A + :: exec + [] + [ + Prim + (ploc, "DIP", [Int (loc, Z.pred n); Seq (sloc, sub)], []); + ]) + rest + | Prim (_, "DIP", [Int (_, n); Seq (_, sub)], []) :: rest, [] + when Z.to_int n = 1 -> + exec (A :: exec [] sub) rest + (* support old expansion using [DIP] *) + | Prim (_, "DIP", [Seq (_, sub)], []) :: rest, a :: rstack -> + exec (a :: exec rstack sub) rest + | Prim (_, "DIP", [Seq (_, sub)], []) :: rest, [] -> + exec (A :: exec [] sub) rest + | ( Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "CAR", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CDR", [], [])])], []); + ] ) + :: rest, + a :: b :: rstack ) -> + exec (P (0, a, b) :: rstack) rest + | ( Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "CAR", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CDR", [], [])])], []); + ] ) + :: rest, + [a] ) -> + exec [P (0, a, I)] rest + | ( Seq + ( _, + [ + Prim (_, "DUP", [], []); + Prim (_, "CAR", [], []); + Prim (_, "DIP", [Seq (_, [Prim (_, "CDR", [], [])])], []); + ] ) + :: rest, + [] ) -> + exec [P (0, A, I)] rest + | _ -> raise_notrace Not_a_pair + in + match exec [] (List.rev nodes) with + | [] -> None + | res :: _ -> + let res = normalize_pair_item res in + let name = "UN" ^ unparse_pair_item res in + Some (Prim (loc, name, [], [])) + | exception Not_a_pair -> None) + | _ -> None + +let unexpand_compare expanded = + match expanded with + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "EQ", [], annot)]) -> + Some (Prim (loc, "CMPEQ", [], annot)) + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "NEQ", [], annot)]) -> + Some (Prim (loc, "CMPNEQ", [], annot)) + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "LT", [], annot)]) -> + Some (Prim (loc, "CMPLT", [], annot)) + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "GT", [], annot)]) -> + Some (Prim (loc, "CMPGT", [], annot)) + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "LE", [], annot)]) -> + Some (Prim (loc, "CMPLE", [], annot)) + | Seq (loc, [Prim (_, "COMPARE", [], _); Prim (_, "GE", [], annot)]) -> + Some (Prim (loc, "CMPGE", [], annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "EQ", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPEQ", args, annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "NEQ", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPNEQ", args, annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "LT", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPLT", args, annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "GT", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPGT", args, annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "LE", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPLE", args, annot)) + | Seq + ( loc, + [ + Prim (_, "COMPARE", [], _); + Prim (_, "GE", [], _); + Prim (_, "IF", args, annot); + ] ) -> + Some (Prim (loc, "IFCMPGE", args, annot)) + | Seq (loc, [Prim (_, "EQ", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFEQ", args, annot)) + | Seq (loc, [Prim (_, "NEQ", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFNEQ", args, annot)) + | Seq (loc, [Prim (_, "LT", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFLT", args, annot)) + | Seq (loc, [Prim (_, "GT", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFGT", args, annot)) + | Seq (loc, [Prim (_, "LE", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFLE", args, annot)) + | Seq (loc, [Prim (_, "GE", [], _); Prim (_, "IF", args, annot)]) -> + Some (Prim (loc, "IFGE", args, annot)) + | _ -> None + +let unexpand_asserts expanded = + match expanded with + | Seq + ( loc, + [ + Prim + ( _, + "IF", + [ + Seq (_, []); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT", [], [])) + | Seq + ( loc, + [ + Seq (_, [Prim (_, "COMPARE", [], []); Prim (_, comparison, [], [])]); + Prim + ( _, + "IF", + [ + Seq (_, []); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_CMP" ^ comparison, [], [])) + | Seq + ( loc, + [ + Prim (_, comparison, [], []); + Prim + ( _, + "IF", + [ + Seq (_, []); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_" ^ comparison, [], [])) + | Seq + ( loc, + [ + Prim + ( _, + "IF_NONE", + [ + Seq (_, [Prim (_, "RENAME", [], annot)]); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_NONE", [], annot)) + | Seq + ( loc, + [ + Prim + ( _, + "IF_NONE", + [ + Seq (_, []); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_NONE", [], [])) + | Seq + ( loc, + [ + Prim + ( _, + "IF_NONE", + [ + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + Seq (_, []); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_SOME", [], [])) + | Seq + ( loc, + [ + Prim + ( _, + "IF_NONE", + [ + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + Seq (_, [Prim (_, "RENAME", [], annot)]); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_SOME", [], annot)) + | Seq + ( loc, + [ + Prim + ( _, + "IF_LEFT", + [ + Seq (_, []); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_LEFT", [], [])) + | Seq + ( loc, + [ + Prim + ( _, + "IF_LEFT", + [ + Seq (_, [Prim (_, "RENAME", [], annot)]); + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_LEFT", [], annot)) + | Seq + ( loc, + [ + Prim + ( _, + "IF_LEFT", + [ + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + Seq (_, []); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_RIGHT", [], [])) + | Seq + ( loc, + [ + Prim + ( _, + "IF_LEFT", + [ + Seq + ( _, + [ + Seq + ( _, + [ + Prim (_, "UNIT", [], []); + Prim (_, "FAILWITH", [], []); + ] ); + ] ); + Seq (_, [Prim (_, "RENAME", [], annot)]); + ], + [] ); + ] ) -> + Some (Prim (loc, "ASSERT_RIGHT", [], annot)) + | _ -> None + +let unexpand_if_some = function + | Seq (loc, [Prim (_, "IF_NONE", [left; right], annot)]) -> + Some (Prim (loc, "IF_SOME", [right; left], annot)) + | _ -> None + +let unexpand_if_right = function + | Seq (loc, [Prim (_, "IF_LEFT", [left; right], annot)]) -> + Some (Prim (loc, "IF_RIGHT", [right; left], annot)) + | _ -> None + +let unexpand_fail = function + | Seq (loc, [Prim (_, "UNIT", [], []); Prim (_, "FAILWITH", [], [])]) -> + Some (Prim (loc, "FAIL", [], [])) + | _ -> None + +let unexpand original = + let try_unexpansions unexpanders = + Option.value + ~default:original + (List.fold_left + (fun acc f -> Option.either_f acc (fun () -> f original)) + None + unexpanders) + in + try_unexpansions + [ + unexpand_asserts; + unexpand_carn_and_cdrn; + unexpand_caddadr; + unexpand_set_caddadr; + unexpand_map_caddadr; + unexpand_deprecated_dxiiivp; + unexpand_pappaiir; + unexpand_unpappaiir; + unexpand_deprecated_duuuuup; + unexpand_dupn; + unexpand_compare; + unexpand_if_some; + unexpand_if_right; + unexpand_fail; + ] + +(* + If an argument of Prim is a sequence, we do not want to unexpand + its root in case the source already contains an expanded macro. In + which case unexpansion would remove surrounding braces and generate + ill-formed code. + + For example, DIIP { DIP { DUP }; SWAP } is not unexpandable but + DIIP {{ DIP { DUP }; SWAP }} (note the double braces) is unexpanded + to DIIP { DUUP }. + + unexpand_rec_but_root is the same as unexpand_rec but does not try + to unexpand at root *) + +let rec unexpand_rec expr = unexpand_rec_but_root (unexpand expr) + +and unexpand_rec_but_root = function + | Seq (loc, items) -> Seq (loc, List.map unexpand_rec items) + | Prim (loc, name, args, annot) -> + Prim (loc, name, List.map unexpand_rec_but_root args, annot) + | (Int _ | String _ | Bytes _) as atom -> atom + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"michelson.macros.unexpected_annotation" + ~title:"Unexpected annotation" + ~description: + "A macro had an annotation, but no annotation was permitted on this \ + macro." + ~pp:(fun ppf -> Format.fprintf ppf "Unexpected annotation on macro %s.") + (obj1 (req "macro_name" string)) + (function Unexpected_macro_annotation str -> Some str | _ -> None) + (fun s -> Unexpected_macro_annotation s) ; + register_error_kind + `Permanent + ~id:"michelson.macros.sequence_expected" + ~title:"Macro expects a sequence" + ~description:"An macro expects a sequence, but a sequence was not provided" + ~pp:(fun ppf name -> + Format.fprintf + ppf + "Macro %s expects a sequence, but did not receive one." + name) + (obj1 (req "macro_name" string)) + (function Sequence_expected name -> Some name | _ -> None) + (fun name -> Sequence_expected name) ; + register_error_kind + `Permanent + ~id:"michelson.macros.bas_arity" + ~title:"Wrong number of arguments to macro" + ~description:"A wrong number of arguments was provided to a macro" + ~pp:(fun ppf (name, got, exp) -> + Format.fprintf + ppf + "Macro %s expects %d arguments, was given %d." + name + exp + got) + (obj3 + (req "macro_name" string) + (req "given_number_of_arguments" uint16) + (req "expected_number_of_arguments" uint16)) + (function + | Invalid_arity (name, got, exp) -> Some (name, got, exp) | _ -> None) + (fun (name, got, exp) -> Invalid_arity (name, got, exp)) diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.mli new file mode 100644 index 000000000000..352a59b00a9e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_macros.mli @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_micheline + +type 'l node = ('l, string) Micheline.node + +type error += Unexpected_macro_annotation of string + +type error += Sequence_expected of string + +type error += Invalid_arity of string * int * int + +val expand : 'l node -> 'l node tzresult + +val expand_rec : 'l node -> 'l node * error list + +val expand_caddadr : 'l node -> 'l node option tzresult + +val expand_set_caddadr : 'l node -> 'l node option tzresult + +val expand_map_caddadr : 'l node -> 'l node option tzresult + +val expand_deprecated_dxiiivp : 'l node -> 'l node option tzresult + +val expand_pappaiir : 'l node -> 'l node option tzresult + +val expand_deprecated_duuuuup : 'l node -> 'l node option tzresult + +val expand_compare : 'l node -> 'l node option tzresult + +val expand_asserts : 'l node -> 'l node option tzresult + +val expand_unpappaiir : 'l node -> 'l node option tzresult + +val expand_if_some : 'l node -> 'l node option tzresult + +val expand_if_right : 'l node -> 'l node option tzresult + +val unexpand : 'l node -> 'l node + +val unexpand_rec : 'l node -> 'l node + +val unexpand_caddadr : 'l node -> 'l node option + +val unexpand_set_caddadr : 'l node -> 'l node option + +val unexpand_map_caddadr : 'l node -> 'l node option + +val unexpand_deprecated_dxiiivp : 'l node -> 'l node option + +val unexpand_pappaiir : 'l node -> 'l node option + +val unexpand_deprecated_duuuuup : 'l node -> 'l node option + +val unexpand_compare : 'l node -> 'l node option + +val unexpand_asserts : 'l node -> 'l node option + +val unexpand_unpappaiir : 'l node -> 'l node option + +val unexpand_if_some : 'l node -> 'l node option + +val unexpand_if_right : 'l node -> 'l node option diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.ml new file mode 100644 index 000000000000..09a8c7d5b710 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.ml @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Tezos_micheline +open Micheline_parser +open Micheline + +type parsed = { + source : string; + unexpanded : string canonical; + expanded : Michelson_v1_primitives.prim canonical; + expansion_table : (int * (Micheline_parser.location * int list)) list; + unexpansion_table : (int * int) list; +} + +let compare_parsed = Stdlib.compare + +(* Unexpanded toplevel expression should be a sequence *) +let expand_all source ast errors = + let unexpanded, loc_table = extract_locations ast in + let expanded, expansion_errors = + Michelson_v1_macros.expand_rec (root unexpanded) + in + let expanded, unexpansion_table = extract_locations expanded in + let expansion_table = + let sorted = + List.sort (fun (_, a) (_, b) -> Stdlib.compare a b) unexpansion_table + in + let grouped = + let rec group = function + | acc, [] -> acc + | [], (u, e) :: r -> group ([(e, [u])], r) + | ((pe, us) :: racc as acc), (u, e) :: r -> + if e = pe then group ((e, u :: us) :: racc, r) + else group ((e, [u]) :: acc, r) + in + group ([], sorted) + in + match + List.map2 + ~when_different_lengths:() + (fun (l, ploc) (l', elocs) -> + assert (l = l') ; + (l, (ploc, elocs))) + (List.sort Stdlib.compare loc_table) + (List.sort Stdlib.compare grouped) + with + | Ok v -> v + | Error () -> invalid_arg "Michelson_v1_parser.expand_all" + in + match Michelson_v1_primitives.prims_of_strings expanded with + | Ok expanded -> + ( {source; unexpanded; expanded; expansion_table; unexpansion_table}, + errors @ expansion_errors ) + | Error errs -> + let errs = Environment.wrap_tztrace errs in + ( { + source; + unexpanded; + expanded = Micheline.strip_locations (Seq ((), [])); + expansion_table; + unexpansion_table; + }, + errors @ expansion_errors @ errs ) + +let parse_toplevel ?check source = + let tokens, lexing_errors = Micheline_parser.tokenize source in + let asts, parsing_errors = Micheline_parser.parse_toplevel ?check tokens in + let ast = + let start = min_point asts and stop = max_point asts in + Seq ({start; stop}, asts) + in + expand_all source ast (lexing_errors @ parsing_errors) + +let parse_expression ?check source = + let tokens, lexing_errors = Micheline_parser.tokenize source in + let ast, parsing_errors = Micheline_parser.parse_expression ?check tokens in + expand_all source ast (lexing_errors @ parsing_errors) + +let expand_all ~source ~original = expand_all source original [] diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.mli new file mode 100644 index 000000000000..6aa29676741a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_parser.mli @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline + +(** The result of parsing and expanding a Michelson V1 script or data. *) +type parsed = { + source : string; (** The original source code. *) + unexpanded : string Micheline.canonical; + (** Original expression with macros. *) + expanded : Script.expr; (** Expression with macros fully expanded. *) + expansion_table : (int * (Micheline_parser.location * int list)) list; + (** Associates unexpanded nodes to their parsing locations and + the nodes expanded from it in the expanded expression. *) + unexpansion_table : (int * int) list; + (** Associates an expanded node to its source in the unexpanded + expression. *) +} + +val compare_parsed : parsed -> parsed -> int + +val parse_toplevel : + ?check:bool -> string -> parsed Micheline_parser.parsing_result + +val parse_expression : + ?check:bool -> string -> parsed Micheline_parser.parsing_result + +val expand_all : + source:string -> + original:Micheline_parser.node -> + parsed Micheline_parser.parsing_result diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.ml b/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.ml new file mode 100644 index 000000000000..d4c0eeeeb611 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.ml @@ -0,0 +1,231 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline +open Micheline +open Micheline_printer + +let anon = {comment = None} + +let print_expr ppf expr = + expr |> Michelson_v1_primitives.strings_of_prims + |> Micheline.inject_locations (fun _ -> anon) + |> print_expr ppf + +let print_expr_unwrapped ppf expr = + expr |> Michelson_v1_primitives.strings_of_prims + |> Micheline.inject_locations (fun _ -> anon) + |> print_expr_unwrapped ppf + +let print_stack ppf = function + | [] -> Format.fprintf ppf "[]" + | more -> + Format.fprintf + ppf + "@[<hov 0>[ %a ]@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "@ : ") + print_expr_unwrapped) + more + +let print_execution_trace ppf (trace : Script_typed_ir.execution_trace) = + Format.pp_print_list + (fun ppf (loc, gas, stack) -> + Format.fprintf + ppf + "- @[<v 0>location: %d (just consumed gas: %a)@,[ @[<v 0>%a ]@]@]" + loc + Gas.Arith.pp + gas + (Format.pp_print_list (fun ppf e -> + Format.fprintf ppf "@[<v 0>%a@]" print_expr e)) + stack) + ppf + trace + +let print_big_map_diff ppf lazy_storage_diff = + let diff = + Contract.Legacy_big_map_diff.of_lazy_storage_diff lazy_storage_diff + in + let pp_map ppf id = + if Compare.Z.(id < Z.zero) then + Format.fprintf ppf "temp(%s)" (Z.to_string (Z.neg id)) + else Format.fprintf ppf "map(%s)" (Z.to_string id) + in + Format.fprintf + ppf + "@[<v 0>%a@]" + (Format.pp_print_list ~pp_sep:Format.pp_print_space (fun ppf -> function + | Contract.Legacy_big_map_diff.Clear id -> + Format.fprintf ppf "Clear %a" pp_map id + | Contract.Legacy_big_map_diff.Alloc {big_map; key_type; value_type} -> + Format.fprintf + ppf + "New %a of type (big_map %a %a)" + pp_map + big_map + print_expr + key_type + print_expr + value_type + | Contract.Legacy_big_map_diff.Copy {src; dst} -> + Format.fprintf ppf "Copy %a to %a" pp_map src pp_map dst + | Contract.Legacy_big_map_diff.Update {big_map; diff_key; diff_value; _} + -> + Format.fprintf + ppf + "%s %a[%a]%a" + (match diff_value with None -> "Unset" | Some _ -> "Set") + pp_map + big_map + print_expr + diff_key + (fun ppf -> function + | None -> () + | Some x -> Format.fprintf ppf " to %a" print_expr x) + diff_value)) + (diff :> Contract.Legacy_big_map_diff.item list) + +let inject_types type_map parsed = + let rec inject_expr = function + | Seq (loc, items) -> + Seq (inject_loc `before loc, List.map inject_expr items) + | Prim (loc, name, items, annot) -> + Prim (inject_loc `after loc, name, List.map inject_expr items, annot) + | Int (loc, value) -> Int (inject_loc `after loc, value) + | String (loc, value) -> String (inject_loc `after loc, value) + | Bytes (loc, value) -> Bytes (inject_loc `after loc, value) + and inject_loc which loc = + let comment = + let ( >?? ) = Option.bind in + List.assoc ~equal:Int.equal loc parsed.Michelson_v1_parser.expansion_table + >?? fun (_, locs) -> + let locs = List.sort compare locs in + List.hd locs >?? fun head_loc -> + List.assoc ~equal:Int.equal head_loc type_map >?? fun (bef, aft) -> + let stack = match which with `before -> bef | `after -> aft in + Some (Format.asprintf "%a" print_stack stack) + in + {comment} + in + inject_expr (root parsed.unexpanded) + +let unparse ?type_map parse expanded = + let source = + match type_map with + | Some type_map -> + let unexpanded, unexpansion_table = + expanded |> Michelson_v1_primitives.strings_of_prims |> root + |> Michelson_v1_macros.unexpand_rec |> Micheline.extract_locations + in + let rec inject_expr = function + | Seq (loc, items) -> + Seq (inject_loc `before loc, List.map inject_expr items) + | Prim (loc, name, items, annot) -> + Prim + (inject_loc `after loc, name, List.map inject_expr items, annot) + | Int (loc, value) -> Int (inject_loc `after loc, value) + | String (loc, value) -> String (inject_loc `after loc, value) + | Bytes (loc, value) -> Bytes (inject_loc `after loc, value) + and inject_loc which loc = + let comment = + let ( >?? ) = Option.bind in + List.assoc ~equal:Int.equal loc unexpansion_table >?? fun loc -> + List.assoc ~equal:Int.equal loc type_map >?? fun (bef, aft) -> + let stack = match which with `before -> bef | `after -> aft in + Some (Format.asprintf "%a" print_stack stack) + in + {comment} + in + unexpanded |> root |> inject_expr + |> Format.asprintf "%a" Micheline_printer.print_expr + | None -> + expanded |> Michelson_v1_primitives.strings_of_prims |> root + |> Michelson_v1_macros.unexpand_rec |> Micheline.strip_locations + |> Micheline_printer.printable (fun n -> n) + |> Format.asprintf "%a" Micheline_printer.print_expr + in + match parse source with + | res, [] -> res + | _, _ :: _ -> Stdlib.failwith "Michelson_v1_printer.unparse" + +let unparse_toplevel ?type_map = + unparse ?type_map Michelson_v1_parser.parse_toplevel + +let unparse_expression = unparse Michelson_v1_parser.parse_expression + +let unparse_invalid expanded = + let source = + expanded |> root |> Michelson_v1_macros.unexpand_rec + |> Micheline.strip_locations + |> Micheline_printer.printable (fun n -> n) + |> Format.asprintf "%a" Micheline_printer.print_expr_unwrapped + in + fst (Michelson_v1_parser.parse_toplevel source) + +let ocaml_constructor_of_prim prim = + (* Assuming all the prim constructor prefixes match the + [[Michelson_v1_primitives.namespace]]. *) + let prefix = + Michelson_v1_primitives.(namespace prim |> string_of_namespace) + in + Format.asprintf "%s_%s" prefix @@ Michelson_v1_primitives.string_of_prim prim + +let micheline_string_of_expression ~zero_loc expression = + let string_of_list : string list -> string = + fun xs -> String.concat "; " xs |> Format.asprintf "[%s]" + in + let show_loc loc = if zero_loc then 0 else loc in + let rec string_of_node = function + | Int (loc, i) -> + let z = + match Z.to_int i with + | 0 -> "Z.zero" + | 1 -> "Z.one" + | i -> Format.asprintf "Z.of_int %d" i + in + Format.asprintf "Int (%d, %s)" (show_loc loc) z + | String (loc, s) -> Format.asprintf "String (%d, \"%s\")" (show_loc loc) s + | Bytes (loc, b) -> + Format.asprintf + "Bytes (%d, Bytes.of_string \"%s\")" + (show_loc loc) + Bytes.(escaped b |> to_string) + | Prim (loc, prim, nodes, annot) -> + Format.asprintf + "Prim (%d, %s, %s, %s)" + (show_loc loc) + (ocaml_constructor_of_prim prim) + (string_of_list @@ List.map string_of_node nodes) + (string_of_list @@ List.map (Format.asprintf "\"%s\"") annot) + | Seq (loc, nodes) -> + Format.asprintf + "Seq (%d, %s)" + (show_loc loc) + (string_of_list @@ List.map string_of_node nodes) + in + string_of_node (root expression) diff --git a/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.mli b/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.mli new file mode 100644 index 000000000000..78e200929221 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/michelson_v1_printer.mli @@ -0,0 +1,63 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline + +val print_expr : Format.formatter -> Script_repr.expr -> unit + +val print_expr_unwrapped : Format.formatter -> Script_repr.expr -> unit + +val print_execution_trace : + Format.formatter -> Script_typed_ir.execution_trace -> unit + +val print_big_map_diff : Format.formatter -> Lazy_storage.diffs -> unit + +(** Insert the type map returned by the typechecker as comments in a + printable Micheline AST. *) +val inject_types : + Script_tc_errors.type_map -> + Michelson_v1_parser.parsed -> + Micheline_printer.node + +(** Unexpand the macros and produce the result of parsing an + intermediate pretty printed source. Useful when working with + contracts extracted from the blockchain and not local files. *) +val unparse_toplevel : + ?type_map:Script_tc_errors.type_map -> + Script.expr -> + Michelson_v1_parser.parsed + +val unparse_expression : Script.expr -> Michelson_v1_parser.parsed + +(** Unexpand the macros and produce the result of parsing an + intermediate pretty printed source. Works on generic trees,for + programs that fail to be converted to a specific script version. *) +val unparse_invalid : string Micheline.canonical -> Michelson_v1_parser.parsed + +val ocaml_constructor_of_prim : Michelson_v1_primitives.prim -> string + +val micheline_string_of_expression : zero_loc:bool -> Script.expr -> string diff --git a/src/proto_016_PtMumbai/lib_client/mockup.ml b/src/proto_016_PtMumbai/lib_client/mockup.ml new file mode 100644 index 000000000000..ad1b10ea3158 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/mockup.ml @@ -0,0 +1,601 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* ------------------------------------------------------------------------- *) +(* Mockup protocol parameters *) + +(** Protocol constants overriding logic. *) +module Protocol_constants_overrides = struct + (** Equivalent of [Constants.parametric] with additionally [chain_id] and [timestamp]. *) + type t = { + parametric : Constants.Parametric.t; + chain_id : Tezos_crypto.Chain_id.t option; + timestamp : Time.Protocol.t option; + } + + let encoding = + let open Data_encoding in + conv + (fun {parametric; chain_id; timestamp} -> + (parametric, (chain_id, timestamp))) + (fun (parametric, (chain_id, timestamp)) -> + {parametric; chain_id; timestamp}) + (merge_objs + Constants.Parametric.encoding + (obj2 + (opt "chain_id" Tezos_crypto.Chain_id.encoding) + (opt "initial_timestamp" Time.Protocol.encoding))) + + let default_value (cctxt : Tezos_client_base.Client_context.full) : + t tzresult Lwt.t = + let cpctxt = new Protocol_client_context.wrap_full cctxt in + Protocol.Constants_services.all cpctxt (cpctxt#chain, cpctxt#block) + >>=? fun {parametric; _} -> + let to_chain_id_opt = function `Hash c -> Some c | _ -> None in + Shell_services.Blocks.Header.shell_header + cpctxt + ~chain:cpctxt#chain + ~block:cpctxt#block + () + >>=? fun header -> + return + { + parametric; + chain_id = to_chain_id_opt cpctxt#chain; + timestamp = Some header.timestamp; + } +end + +module Parsed_account = struct + type t = {name : string; sk_uri : Client_keys.sk_uri; amount : Tez.t} + + let pp ppf account = + let open Format in + let format_amount ppf value = fprintf ppf "amount:%a" Tez.pp value in + fprintf + ppf + "@[<v>name:%s@,sk_uri:%s@,%a@]" + account.name + (Uri.to_string (account.sk_uri :> Uri.t)) + format_amount + account.amount + + let encoding = + let open Data_encoding in + conv + (fun p -> (p.name, p.sk_uri, p.amount)) + (fun (name, sk_uri, amount) -> {name; sk_uri; amount}) + (obj3 + (req "name" string) + (req "sk_uri" Client_keys.Secret_key.encoding) + (req "amount" Tez.encoding)) + + let to_bootstrap_account repr = + Tezos_client_base.Client_keys.neuterize repr.sk_uri >>=? fun pk_uri -> + Tezos_client_base.Client_keys.public_key pk_uri >>=? fun public_key -> + let public_key_hash = Tezos_crypto.Signature.Public_key.hash public_key in + return + Parameters. + { + public_key_hash; + public_key = Some public_key; + amount = repr.amount; + delegate_to = None; + consensus_key = None; + } + + let default_to_json (cctxt : Tezos_client_base.Client_context.full) : + string tzresult Lwt.t = + let rpc_context = new Protocol_client_context.wrap_full cctxt in + let wallet = (cctxt :> Client_context.wallet) in + let parsed_account_reprs = ref [] in + let errors = ref [] in + Client_keys.list_keys wallet >>=? fun all_keys -> + List.iter_s + (function + | name, pkh, _pk_opt, Some sk_uri -> ( + let contract = Contract.Implicit pkh in + Client_proto_context.get_balance + rpc_context + ~chain:cctxt#chain + ~block:cctxt#block + contract + >>= fun tz_balance -> + match tz_balance with + | Ok balance -> ( + let tez_repr = Tez.of_mutez @@ Tez.to_mutez balance in + match tez_repr with + | None -> + (* we're reading the wallet, it's content MUST be valid *) + assert false + | Some amount -> + parsed_account_reprs := + {name; sk_uri; amount} :: !parsed_account_reprs ; + Lwt.return_unit) + | Error err -> + errors := err :: !errors ; + Lwt.return_unit) + | _ -> Lwt.return_unit) + all_keys + >>= fun () -> + match !errors with + | [] -> + let json = + Data_encoding.Json.construct + (Data_encoding.list encoding) + !parsed_account_reprs + in + return @@ Data_encoding.Json.to_string json + | errs -> Lwt.return_error @@ List.concat errs +end + +module Bootstrap_account = struct + let encoding : Parameters.bootstrap_account Data_encoding.t = + let open Data_encoding in + let open Parameters in + conv + (fun {public_key_hash; public_key; amount; delegate_to; consensus_key} -> + (public_key_hash, public_key, amount, delegate_to, consensus_key)) + (fun (public_key_hash, public_key, amount, delegate_to, consensus_key) -> + {public_key_hash; public_key; amount; delegate_to; consensus_key}) + (obj5 + (req "public_key_hash" Tezos_crypto.Signature.Public_key_hash.encoding) + (opt "public_key" Tezos_crypto.Signature.Public_key.encoding) + (req "amount" Tez.encoding) + (opt "delegate_to" Tezos_crypto.Signature.Public_key_hash.encoding) + (opt "consensus_key" Tezos_crypto.Signature.Public_key.encoding)) +end + +module Bootstrap_contract = struct + let encoding : Parameters.bootstrap_contract Data_encoding.t = + let open Data_encoding in + let open Parameters in + conv + (fun {delegate; amount; script} -> (delegate, amount, script)) + (fun (delegate, amount, script) -> {delegate; amount; script}) + (obj3 + (opt "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "amount" Tez.encoding) + (req "script" Script.encoding)) +end + +module Protocol_parameters = struct + type t = { + initial_timestamp : Time.Protocol.t; + bootstrap_accounts : Parameters.bootstrap_account list; + bootstrap_contracts : Parameters.bootstrap_contract list; + constants : Constants.Parametric.t; + } + + let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun p -> + ( p.initial_timestamp, + p.bootstrap_accounts, + p.bootstrap_contracts, + p.constants )) + (fun ( initial_timestamp, + bootstrap_accounts, + bootstrap_contracts, + constants ) -> + {initial_timestamp; bootstrap_accounts; bootstrap_contracts; constants}) + (obj4 + (req "initial_timestamp" Time.Protocol.encoding) + (req "bootstrap_accounts" (list Bootstrap_account.encoding)) + (req "bootstrap_contracts" (list Bootstrap_contract.encoding)) + (req "constants" Constants.Parametric.encoding)) + + let default_value : t = + let parameters = + Default_parameters.parameters_of_constants + Default_parameters.constants_sandbox + in + { + initial_timestamp = Time.Protocol.epoch; + bootstrap_accounts = parameters.bootstrap_accounts; + bootstrap_contracts = parameters.bootstrap_contracts; + constants = parameters.constants; + } +end + +(* This encoding extends [Protocol_constants_overrides.encoding] to allow + reading json files as produced by lib_parameters. *) +let lib_parameters_json_encoding = + Data_encoding.( + merge_objs + (obj2 + (opt "bootstrap_accounts" (list Parameters.bootstrap_account_encoding)) + (opt "commitments" (list Commitment.encoding))) + Protocol_constants_overrides.encoding) + +(* ------------------------------------------------------------------------- *) +(* Blocks *) + +type block = { + hash : Tezos_crypto.Block_hash.t; + header : Block_header.t; + operations : Operation.packed list; + context : Environment.Context.t; +} + +module Forge = struct + let default_proof_of_work_nonce = + Bytes.create Constants.proof_of_work_nonce_size + + let make_shell ~level ~predecessor ~timestamp ~fitness ~operations_hash = + Tezos_base.Block_header. + { + level; + predecessor; + timestamp; + fitness; + operations_hash; + proto_level = 0; + validation_passes = 0; + context = Tezos_crypto.Context_hash.zero; + } +end + +(* ------------------------------------------------------------------------- *) +(* RPC context *) +let genesis_block_hash = + Tezos_crypto.Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU" + +let endorsement_branch_data_encoding = + let open Data_encoding in + conv + (fun (block_hash, block_payload_hash) -> (block_hash, block_payload_hash)) + (fun (block_hash, block_payload_hash) -> (block_hash, block_payload_hash)) + (obj2 + (req "block_hash" Tezos_crypto.Block_hash.encoding) + (req "block_payload_hash" Protocol.Block_payload_hash.encoding)) + +let initial_context chain_id (header : Block_header.shell_header) + ({bootstrap_accounts; bootstrap_contracts; constants; _} : + Protocol_parameters.t) = + let parameters = + Default_parameters.parameters_of_constants + ~bootstrap_accounts + ~bootstrap_contracts + ~commitments:[] + constants + in + let json = Default_parameters.json_of_parameters parameters in + let proto_params = + Data_encoding.Binary.to_bytes_exn Data_encoding.json json + in + Tezos_protocol_environment.Context.( + let empty = Tezos_protocol_environment.Memory_context.empty in + add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> + add ctxt ["protocol_parameters"] proto_params) + >>= fun ctxt -> + Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> + Protocol.Main.init chain_id ctxt header >|= Environment.wrap_tzresult + >>=? fun {context; _} -> + let ({ + timestamp = predecessor_timestamp; + level = predecessor_level; + fitness = predecessor_fitness; + _; + } + : Block_header.shell_header) = + header + in + let timestamp = Time.System.to_protocol (Time.System.now ()) in + (* + + We need to forge a predecessor hash to pass it to [value_of_key]. + This initial context is used for RPC, hence this piece of + information is not important and does not have to be meaningful + + *) + let predecessor = + Tezos_base.Block_header.hash {shell = header; protocol_data = Bytes.empty} + in + Protocol.Main.value_of_key + ~chain_id + ~predecessor_context:context + ~predecessor_timestamp + ~predecessor_level + ~predecessor_fitness + ~predecessor + ~timestamp + >|= Environment.wrap_tzresult + >>=? fun value_of_key -> + (* + In the mockup mode, reactivity is important and there are + no constraints to be consistent with other nodes. For this + reason, the mockup mode loads the cache lazily. + See {!Environment_context.source_of_cache}. + *) + Tezos_protocol_environment.Context.load_cache + predecessor + context + `Lazy + (fun key -> value_of_key key >|= Environment.wrap_tzresult) + >>=? fun context -> return context + +let mem_init : + cctxt:Tezos_client_base.Client_context.printer -> + parameters:Protocol_parameters.t -> + constants_overrides_json:Data_encoding.json option -> + bootstrap_accounts_json:Data_encoding.json option -> + Tezos_mockup_registration.Registration.mockup_context tzresult Lwt.t = + fun ~cctxt ~parameters ~constants_overrides_json ~bootstrap_accounts_json -> + let hash = genesis_block_hash in + (* Need to read this Json file before since timestamp modification may be in + there *) + let override_protocol_parameters + (constants_overrides_json : Data_encoding.json option) + (parameters : Protocol_parameters.t) : + Protocol_constants_overrides.t tzresult Lwt.t = + (* [merge_objects v1 v2] recursively overrides [v1] with [v2], and + point-wise if [v1] and [v2] are objects. + + If [v1] and [v2] are objects, then the resulting value is an object where + - each field that is only present in either v1 and v2 is copied as is. + however, if the value in [v2] is explicitly [Some `Null], then the field is + absent in the result. + - if a field is present in both [v1] and [v2], then its value in the + result is merge recursively. *) + let rec merge_objects (v1 : Data_encoding.Json.t) + (v2 : Data_encoding.Json.t) : Data_encoding.Json.t = + match (v1, v2) with + | `O fs1, `O fs2 -> + let fields = + let tbl = String.Hashtbl.of_seq (List.to_seq fs1) in + List.iter + (fun (k2, v2) -> + match (String.Hashtbl.find_opt tbl k2, v2) with + | _, `Null -> String.Hashtbl.remove tbl k2 + | Some v1, v2 -> + String.Hashtbl.replace tbl k2 (merge_objects v1 v2) + | None, v2 -> String.Hashtbl.add tbl k2 v2) + fs2 ; + List.of_seq (String.Hashtbl.to_seq tbl) + in + `O fields + | _, v2 -> v2 + in + match constants_overrides_json with + | Some json -> + let parameters_json = + Data_encoding.Json.construct + Constants.Parametric.encoding + parameters.constants + in + let parameters_overriden = merge_objects parameters_json json in + (match + Data_encoding.Json.destruct + lib_parameters_json_encoding + parameters_overriden + with + | _, x -> return x + | exception error -> + failwith + "cannot read protocol constants overrides: %a" + (Data_encoding.Json.print_error ?print_unknown:None) + error) + >>=? fun protocol_overrides -> + let fields_with_override = match json with `O fs -> fs | _ -> [] in + let field_pp ppf (name, value) = + Format.fprintf ppf "@[<h>%s: %a@]" name Data_encoding.Json.pp value + in + (if fields_with_override <> [] then + cctxt#message + "@[<v>mockup client uses protocol overrides:@,%a@]@?" + (Format.pp_print_list field_pp) + fields_with_override + else Lwt.return_unit) + >>= fun () -> return protocol_overrides + | None -> + return + Protocol_constants_overrides. + { + parametric = parameters.constants; + timestamp = None; + chain_id = None; + } + in + override_protocol_parameters constants_overrides_json parameters + >>=? fun (protocol_overrides : Protocol_constants_overrides.t) -> + let chain_id = + Tezos_mockup_registration.Mockup_args.Chain_id.choose + ~from_config_file:protocol_overrides.chain_id + in + let default = parameters.initial_timestamp in + let timestamp = Option.value ~default protocol_overrides.timestamp in + (if not @@ Time.Protocol.equal default timestamp then + cctxt#message "@[<h>initial_timestamp: %a@]" Time.Protocol.pp_hum timestamp + else Lwt.return_unit) + >>= fun () -> + let fitness = + Protocol.Alpha_context.( + Fitness.create_without_locked_round + ~level:Raw_level.root + ~predecessor_round:Round.zero + ~round:Round.zero + |> Fitness.to_raw) + in + let shell_header = + Forge.make_shell + ~level:0l + ~predecessor:hash + ~timestamp + ~fitness + ~operations_hash:Tezos_crypto.Operation_list_list_hash.zero + in + (match bootstrap_accounts_json with + | None -> return None + | Some json -> ( + match + Data_encoding.Json.destruct + (Data_encoding.list Parsed_account.encoding) + json + with + | accounts -> + cctxt#message "@[<h>mockup client uses custom bootstrap accounts:@]" + >>= fun () -> + let open Format in + cctxt#message + "@[%a@]" + (pp_print_list + ~pp_sep:(fun ppf () -> fprintf ppf ";@ ") + Parsed_account.pp) + accounts + >>= fun () -> + List.map_es Parsed_account.to_bootstrap_account accounts + >>=? fun bootstrap_accounts -> return (Some bootstrap_accounts) + | exception error -> + failwith + "cannot read definitions of bootstrap accounts: %a" + (Data_encoding.Json.print_error ?print_unknown:None) + error)) + >>=? fun bootstrap_accounts_custom -> + initial_context + chain_id + shell_header + { + parameters with + bootstrap_accounts = + Option.value + ~default:parameters.bootstrap_accounts + bootstrap_accounts_custom; + constants = protocol_overrides.parametric; + } + >>=? fun context -> + let protocol_data = + let payload_hash = + Protocol.Block_payload_hash.hash_bytes + [ + Tezos_crypto.Block_hash.to_bytes hash; + Tezos_crypto.Operation_list_hash.(to_bytes @@ compute []); + ] + in + let open Protocol.Alpha_context.Block_header in + let _, _, sk = Tezos_crypto.Signature.generate_key () in + let proof_of_work_nonce = + Bytes.create Protocol.Alpha_context.Constants.proof_of_work_nonce_size + in + let contents = + { + payload_round = Round.zero; + payload_hash; + seed_nonce_hash = None; + proof_of_work_nonce; + (* following Baking_configuration.toggle_votes in lib_delegate *) + liquidity_baking_toggle_vote = Liquidity_baking.LB_pass; + } + in + let unsigned_bytes = + Data_encoding.Binary.to_bytes_exn + Block_header.unsigned_encoding + (shell_header, contents) + in + let signature = + Tezos_crypto.Signature.sign + ~watermark: + Protocol.Alpha_context.Block_header.( + to_watermark (Block_header chain_id)) + sk + unsigned_bytes + in + Data_encoding.Binary.to_bytes_exn + Protocol.block_header_data_encoding + {contents; signature} + in + return + Tezos_mockup_registration.Registration_intf. + { + chain = chain_id; + rpc_context = + Tezos_protocol_environment. + {block_hash = hash; block_header = shell_header; context}; + protocol_data; + } + +let migrate : + Tezos_mockup_registration.Registration.mockup_context -> + Tezos_mockup_registration.Registration.mockup_context tzresult Lwt.t = + fun {chain; rpc_context; protocol_data} -> + let Tezos_protocol_environment.{block_hash; context; block_header} = + rpc_context + in + Environment.Updater.activate context Protocol.hash >>= fun context -> + Protocol.Main.init chain context block_header >|= Environment.wrap_tzresult + >>=? fun {context; _} -> + let rpc_context = + Tezos_protocol_environment.{block_hash; block_header; context} + in + return + Tezos_mockup_registration.Registration_intf. + {chain; rpc_context; protocol_data} + +(* ------------------------------------------------------------------------- *) +(* Register mockup *) + +module M : + Tezos_mockup_registration.Registration_intf.MOCKUP + with module Protocol = Protocol_client_context.Lifted_protocol = struct + type parameters = Protocol_parameters.t + + type protocol_constants = Protocol_constants_overrides.t + + let parameters_encoding = Protocol_parameters.encoding + + let default_parameters = Protocol_parameters.default_value + + let protocol_constants_encoding = Protocol_constants_overrides.encoding + + let default_protocol_constants = Protocol_constants_overrides.default_value + + let default_bootstrap_accounts = Parsed_account.default_to_json + + let protocol_hash = Protocol.hash + + module Protocol = Protocol_client_context.Lifted_protocol + module Block_services = Protocol_client_context.Alpha_block_services + + let directory = Plugin.RPC.rpc_services + + let init ~cctxt ~parameters ~constants_overrides_json ~bootstrap_accounts_json + = + mem_init + ~cctxt:(cctxt :> Tezos_client_base.Client_context.printer) + ~parameters + ~constants_overrides_json + ~bootstrap_accounts_json + + let migrate = migrate +end + +let () = + Tezos_mockup_registration.Registration.register_mockup_environment (module M) diff --git a/src/proto_016_PtMumbai/lib_client/operation_result.ml b/src/proto_016_PtMumbai/lib_client/operation_result.ml new file mode 100644 index 000000000000..2d97ccd43046 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/operation_result.ml @@ -0,0 +1,1190 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Apply_results +open Apply_operation_result +open Apply_internal_results + +let tez_sym = "\xEA\x9C\xA9" + +let pp_micheline_expr ppf expr = + Format.fprintf ppf "@[<v 0>%a@]" Michelson_v1_printer.print_expr expr + +let pp_micheline_from_lazy_expr ppf expr = + let expr = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized micheline expression") + (Data_encoding.force_decode expr) + in + pp_micheline_expr ppf expr + +let pp_internal_operation ppf (Internal_operation {operation; source; _}) = + (* For now, try to use the same format as in [pp_manager_operation_content]. *) + Format.fprintf ppf "@[<v 2>Internal " ; + (match operation with + | Transaction {destination; amount; parameters; entrypoint} -> + Format.fprintf + ppf + "Transaction:@,Amount: %s%a@,From: %a@,To: %a" + tez_sym + Tez.pp + amount + Contract.pp + source + Destination.pp + destination ; + if not (Entrypoint.is_default entrypoint) then + Format.fprintf ppf "@,Entrypoint: %a" Entrypoint.pp entrypoint ; + if not (Script_repr.is_unit_parameter parameters) then + Format.fprintf + ppf + "@,Parameter: %a" + pp_micheline_from_lazy_expr + parameters + | Origination {delegate; credit; script = {code; storage}} -> ( + Format.fprintf + ppf + "Origination:@,From: %a@,Credit: %s%a" + Contract.pp + source + tez_sym + Tez.pp + credit ; + let code = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized code") + (Data_encoding.force_decode code) + in + let {Michelson_v1_parser.source; _} = + Michelson_v1_printer.unparse_toplevel code + in + Format.fprintf + ppf + "@,@[<hv 2>Script:@ @[<h>%a@]@,@[<hv 2>Initial storage:@ %a@]@]" + Format.pp_print_text + source + pp_micheline_from_lazy_expr + storage ; + match delegate with + | None -> Format.fprintf ppf "@,No delegate for this contract" + | Some delegate -> + Format.fprintf + ppf + "@,Delegate: %a" + Tezos_crypto.Signature.Public_key_hash.pp + delegate) + | Delegation delegate_opt -> ( + Format.fprintf ppf "Delegation:@,Contract: %a@,To: " Contract.pp source ; + match delegate_opt with + | None -> Format.pp_print_string ppf "nobody" + | Some delegate -> Tezos_crypto.Signature.Public_key_hash.pp ppf delegate) + | Event {ty; tag; payload} -> + Format.fprintf + ppf + "Event:@,From: %a@,Type: %a" + Contract.pp + source + pp_micheline_expr + ty ; + if not (Entrypoint.is_default tag) then + Format.fprintf ppf "@,Tag: %a" Entrypoint.pp tag ; + Format.fprintf ppf "@,Payload: %a" pp_micheline_expr payload) ; + Format.fprintf ppf "@]" + +let pp_manager_operation_content (type kind) source ppf + (operation : kind manager_operation) = + (* For now, try to keep formatting in sync with [pp_internal_operation]. *) + match operation with + | Transaction {destination; amount; parameters; entrypoint} -> + Format.fprintf + ppf + "Transaction:@,Amount: %s%a@,From: %a@,To: %a" + tez_sym + Tez.pp + amount + Contract.pp + source + Contract.pp + destination ; + if not (Entrypoint.is_default entrypoint) then + Format.fprintf ppf "@,Entrypoint: %a" Entrypoint.pp entrypoint ; + if not (Script_repr.is_unit_parameter parameters) then + Format.fprintf + ppf + "@,Parameter: %a" + pp_micheline_from_lazy_expr + parameters + | Origination {delegate; credit; script = {code; storage}} -> ( + Format.fprintf + ppf + "Origination:@,From: %a@,Credit: %s%a" + Contract.pp + source + tez_sym + Tez.pp + credit ; + let code = + WithExceptions.Option.to_exn + ~none:(Failure "ill-serialized code") + (Data_encoding.force_decode code) + in + let {Michelson_v1_parser.source; _} = + Michelson_v1_printer.unparse_toplevel code + in + Format.fprintf + ppf + "@,@[<hv 2>Script:@ @[<h>%a@]@,@[<hv 2>Initial storage:@ %a@]" + Format.pp_print_text + source + pp_micheline_from_lazy_expr + storage ; + match delegate with + | None -> Format.fprintf ppf "@,No delegate for this contract" + | Some delegate -> + Format.fprintf + ppf + "@,Delegate: %a" + Tezos_crypto.Signature.Public_key_hash.pp + delegate) + | Reveal key -> + Format.fprintf + ppf + "Revelation of manager public key:@,Contract: %a@,Key: %a" + Contract.pp + source + Tezos_crypto.Signature.Public_key.pp + key + | Delegation delegate_opt -> ( + Format.fprintf ppf "Delegation:@,Contract: %a@,To: " Contract.pp source ; + match delegate_opt with + | None -> Format.pp_print_string ppf "nobody" + | Some delegate -> Tezos_crypto.Signature.Public_key_hash.pp ppf delegate) + | Register_global_constant {value} -> + Format.fprintf + ppf + "Register Global:@,Value: %a" + pp_micheline_from_lazy_expr + value + | Set_deposits_limit limit_opt -> ( + Format.fprintf + ppf + "Set deposits limit:@,Delegate: %a@," + Contract.pp + source ; + match limit_opt with + | None -> Format.pp_print_string ppf "Unlimited deposits" + | Some limit -> Format.fprintf ppf "Limit: %a" Tez.pp limit) + | Increase_paid_storage {amount_in_bytes; destination} -> + Format.fprintf + ppf + "Increase paid storage:@,Increased size: %a bytes@,From: %a@,To: %a" + Z.pp_print + amount_in_bytes + Contract.pp + source + Contract_hash.pp + destination + | Update_consensus_key pk -> + Format.fprintf + ppf + "Update_consensus_key:@,Public key hash: %a" + Tezos_crypto.Signature.Public_key_hash.pp + (Tezos_crypto.Signature.Public_key.hash pk) + | Tx_rollup_origination -> + Format.fprintf + ppf + "Transaction rollup origination:@,From: %a" + Contract.pp + source + | Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _} -> + Format.fprintf + ppf + "Transaction rollup transaction:@,\ + Address:%a@,\ + Message length: %d bytes@,\ + From: %a" + Tx_rollup.pp + tx_rollup + (String.length content) + Contract.pp + source + | Tx_rollup_commit {tx_rollup; commitment} -> + Format.fprintf + ppf + "Transaction rollup commitment:@,\ + Address: %a@,\ + @[<v 2>Commitment:@,\ + %a@]@,\ + From: %a" + Tx_rollup.pp + tx_rollup + Tx_rollup_commitment.Full.pp + commitment + Contract.pp + source + | Tx_rollup_return_bond {tx_rollup} -> + Format.fprintf + ppf + "Transaction rollup recover commitment bond:@,Address: %a@,From: %a" + Tx_rollup.pp + tx_rollup + Contract.pp + source + | Tx_rollup_finalize_commitment {tx_rollup} -> + Format.fprintf + ppf + "Transaction rollup finalize commitment:@,Address: %a@,From: %a" + Tx_rollup.pp + tx_rollup + Contract.pp + source + | Tx_rollup_remove_commitment {tx_rollup; _} -> + Format.fprintf + ppf + "Transaction rollup remove commitment:@,Address: %a@,From: %a" + Tx_rollup.pp + tx_rollup + Contract.pp + source + | Tx_rollup_rejection {tx_rollup; _} -> + (* FIXME/TORU *) + Format.fprintf + ppf + "Transaction rollup rejection:@,Address: %a@,From: %a" + Tx_rollup.pp + tx_rollup + Contract.pp + source + | Tx_rollup_dispatch_tickets {tx_rollup; _} -> + Format.fprintf + ppf + "Transaction rollup dispatch tickets:@,Address: %a@,From: %a" + Tx_rollup.pp + tx_rollup + Contract.pp + source + | Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint} -> + Format.fprintf + ppf + "Transfer tickets:@,\ + Ticket content: %a@,\ + Ticket content type: %a@,\ + Ticket ticketer: %a@,\ + Ticket amount: %a@,\ + Destination: %a%a@,\ + From: %a" + pp_micheline_from_lazy_expr + contents + pp_micheline_from_lazy_expr + ty + Contract.pp + ticketer + Z.pp_print + Script_int.(to_zint (amount :> n num)) + Contract.pp + destination + (fun ppf entrypoint -> + if not (Entrypoint.is_default entrypoint) then + Format.fprintf ppf "@,Entrypoint: %a" Entrypoint.pp entrypoint) + entrypoint + Contract.pp + source + | Sc_rollup_originate + {kind; boot_sector; origination_proof = _; parameters_ty} -> + Format.fprintf + ppf + "Smart contract rollup origination:@,\ + Kind: %a@,\ + Parameter type: %a@,\ + Kernel Blake2B hash: '%a'" + Sc_rollup.Kind.pp + kind + pp_micheline_from_lazy_expr + parameters_ty + Tezos_crypto.Blake2B.pp + (Tezos_crypto.Blake2B.hash_string [boot_sector]) + | Sc_rollup_add_messages {messages = _} -> + Format.pp_print_string ppf "Smart contract rollup messages submission" + | Sc_rollup_cement {rollup; commitment} -> + Format.fprintf + ppf + "Smart contract rollup commitment cementing:@,\ + Address: %a@,\ + Commitment: %a" + Sc_rollup.Address.pp + rollup + Sc_rollup.Commitment.Hash.pp + commitment + | Sc_rollup_publish {rollup; commitment} -> + Format.fprintf + ppf + "Smart contract rollup commitment publishing:@,\ + Address: %a@,\ + @[<v 2>Commitment:@,\ + %a@]" + Sc_rollup.Address.pp + rollup + Sc_rollup.Commitment.pp + commitment + | Sc_rollup_refute {rollup; opponent; refutation} -> + Format.fprintf + ppf + "Smart contract rollup refutation move:@,\ + Address: %a@,\ + Staker: %a@,\ + Move: %a" + Sc_rollup.Address.pp + rollup + Sc_rollup.Staker.pp + opponent + (fun fmt -> function + | None -> Format.pp_print_string fmt "opening of the game" + | Some refutation -> Sc_rollup.Game.pp_refutation fmt refutation) + refutation + | Sc_rollup_timeout {rollup; stakers = {alice; bob}} -> + Format.fprintf + ppf + "Smart contract rollup refutation timeout:@,\ + Address: %a@,\ + First staker (Alice): %a@,\ + Second staker (Bob): %a" + Sc_rollup.Address.pp + rollup + Sc_rollup.Staker.pp + alice + Sc_rollup.Staker.pp + bob + | Sc_rollup_execute_outbox_message + {rollup; cemented_commitment; output_proof = _} -> + Format.fprintf + ppf + "Smart contract output message execution:@,\ + Address: %a@,\ + Cemented commitment: %a" + Sc_rollup.Address.pp + rollup + Sc_rollup.Commitment.Hash.pp + cemented_commitment + | Sc_rollup_recover_bond {sc_rollup; staker} -> + Format.fprintf + ppf + "Smart contract bond retrieval:@,Address: %a@,Staker: %a" + Sc_rollup.Address.pp + sc_rollup + Tezos_crypto.Signature.Public_key_hash.pp + staker + | Dal_publish_slot_header slot_header -> + Format.fprintf + ppf + "Data availability slot header publishing:@,Slot: %a" + Dal.Slot.Header.pp + slot_header.header + | Zk_rollup_origination _ -> + Format.fprintf ppf "Epoxy origination:@,From: %a" Contract.pp source + | Zk_rollup_publish _ -> + Format.fprintf ppf "Epoxy publish:@,From: %a" Contract.pp source + | Zk_rollup_update _ -> + Format.fprintf ppf "Epoxy update:@,From: %a" Contract.pp source + +let pp_balance_updates ppf balance_updates = + let open Receipt in + (* For dry runs, the baker's key is zero + (tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU). Instead of printing this + key hash, we want to make the result more informative. *) + let pp_baker ppf baker = + if + Tezos_crypto.Signature.Public_key_hash.equal + baker + Tezos_crypto.Signature.Public_key_hash.zero + then Format.fprintf ppf "the baker who will include this operation" + else Tezos_crypto.Signature.Public_key_hash.pp ppf baker + in + let balance_updates = + List.map + (fun (balance, update, origin) -> + let balance = + match balance with + | Contract c -> Format.asprintf "%a" Contract.pp c + | Block_fees -> "payload fees(the block proposer)" + | Deposits pkh -> Format.asprintf "deposits(%a)" pp_baker pkh + | Nonce_revelation_rewards -> "nonce revelation rewards" + | Double_signing_evidence_rewards -> "double signing evidence rewards" + | Endorsing_rewards -> "endorsing rewards" + | Baking_rewards -> "baking rewards" + | Baking_bonuses -> "baking bonuses" + | Storage_fees -> "storage fees" + | Double_signing_punishments -> "double signing punishments" + | Lost_endorsing_rewards (pkh, p, r) -> + let reason = + match (p, r) with + | false, false -> "" + | false, true -> ",revelation" + | true, false -> ",participation" + | true, true -> ",participation,revelation" + in + Format.asprintf "lost endorsing rewards(%a%s)" pp_baker pkh reason + | Liquidity_baking_subsidies -> "liquidity baking subsidies" + | Burned -> "burned" + | Commitments bpkh -> + Format.asprintf "commitment(%a)" Blinded_public_key_hash.pp bpkh + | Bootstrap -> "bootstrap" + | Invoice -> "invoices" + | Initial_commitments -> "initial commitments" + | Minted -> "minted" + | Frozen_bonds (contract, bond_id) -> + Format.asprintf + "Frozen_bonds(%a,%a)" + Contract.pp + contract + Bond_id.pp + bond_id + | Tx_rollup_rejection_rewards -> "tx rollup rejection rewards" + | Tx_rollup_rejection_punishments -> "tx rollup rejection punishments" + | Sc_rollup_refutation_punishments -> + "sc rollup refutation punishments" + | Sc_rollup_refutation_rewards -> "sc rollup refutation rewards" + in + let balance = + match origin with + | Block_application -> balance + | Protocol_migration -> Format.asprintf "migration %s" balance + | Subsidy -> Format.asprintf "subsidy %s" balance + | Simulation -> Format.asprintf "simulation %s" balance + in + (balance, update)) + balance_updates + in + let column_size = + List.fold_left + (fun acc (balance, _) -> Compare.Int.max acc (String.length balance)) + 0 + balance_updates + in + let pp_update ppf = function + | Credited amount -> Format.fprintf ppf "+%s%a" tez_sym Tez.pp amount + | Debited amount -> Format.fprintf ppf "-%s%a" tez_sym Tez.pp amount + in + let pp_one ppf (balance, update) = + let to_fill = column_size + 3 - String.length balance in + let filler = String.make to_fill '.' in + Format.fprintf ppf "%s %s %a" balance filler pp_update update + in + match balance_updates with + | [] -> () + | balance_updates -> + Format.fprintf + ppf + "@,@[<v 2>Balance updates:@,%a@]" + (Format.pp_print_list pp_one) + balance_updates + +let pp_ticket_receipt ppf ticket_receipt = + let open Ticket_receipt in + let pp_amount ppf amount = + Format.fprintf + ppf + "%s%a" + (if Z.(zero < amount) then "+" else "") + Z.pp_print + amount + in + let pp_account_update ppf {account; amount} = + Format.fprintf ppf "%a ... %a" Destination.pp account pp_amount amount + in + let pp_account_updates ppf updates = + Format.fprintf + ppf + "@[<v 2>Account updates:@,%a@]" + (Format.pp_print_list pp_account_update) + updates + in + let pp_item ppf {ticket_token; updates} = + let Ticket_token.{ticketer; contents_type; contents} = ticket_token in + Format.fprintf + ppf + "Ticketer: %a@,Content type: %a@,Content: %a@,%a" + Contract.pp + ticketer + Michelson_v1_printer.print_expr + contents_type + Michelson_v1_printer.print_expr + contents + pp_account_updates + updates + in + match ticket_receipt with + | [] -> () + | ticket_updates -> + Format.fprintf + ppf + "@,@[<v 2>Ticket updates:@,%a@]" + (Format.pp_print_list pp_item) + ticket_updates + +let pp_consumed_gas ppf consumed_gas = + Format.fprintf ppf "@,Consumed gas: %a" Gas.Arith.pp consumed_gas + +let pp_paid_storage_size_diff ppf paid_storage_size_diff = + if paid_storage_size_diff <> Z.zero then + Format.fprintf + ppf + "@,Paid storage size diff: %s bytes" + (Z.to_string paid_storage_size_diff) + +let pp_storage_size ppf storage_size = + if storage_size <> Z.zero then + Format.fprintf ppf "@,Storage size: %s bytes" (Z.to_string storage_size) + +let pp_lazy_storage_diff ppf = function + | None -> () + | Some lazy_storage_diff -> ( + let big_map_diff = + Contract.Legacy_big_map_diff.of_lazy_storage_diff lazy_storage_diff + in + match (big_map_diff :> Contract.Legacy_big_map_diff.item list) with + | [] -> () + | _ :: _ -> + (* TODO: print all lazy storage diff *) + Format.fprintf + ppf + "@,@[<v 2>Updated big_maps:@ %a@]" + Michelson_v1_printer.print_big_map_diff + lazy_storage_diff) + +let pp_origination_result ppf + { + lazy_storage_diff; + balance_updates; + consumed_gas; + originated_contracts; + storage_size; + paid_storage_size_diff; + } = + (match originated_contracts with + | [] -> () + | contracts -> + Format.fprintf + ppf + "@,@[<v 2>Originated contracts:@,%a@]" + (Format.pp_print_list Contract_hash.pp) + contracts) ; + pp_storage_size ppf storage_size ; + pp_lazy_storage_diff ppf lazy_storage_diff ; + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates + +let pp_transaction_result ppf = function + | Transaction_to_contract_result + { + balance_updates; + ticket_receipt; + consumed_gas; + storage; + originated_contracts; + storage_size; + paid_storage_size_diff; + lazy_storage_diff; + allocated_destination_contract = _; + } -> + (match originated_contracts with + | [] -> () + | contracts -> + Format.fprintf + ppf + "@,@[<v 2>Originated contracts:@,%a@]" + (Format.pp_print_list Contract_hash.pp) + contracts) ; + (match storage with + | None -> () + | Some expr -> + Format.fprintf + ppf + "@,@[<hv 2>Updated storage:@ %a@]" + Michelson_v1_printer.print_expr + expr) ; + pp_lazy_storage_diff ppf lazy_storage_diff ; + pp_storage_size ppf storage_size ; + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates ; + pp_ticket_receipt ppf ticket_receipt + | Transaction_to_tx_rollup_result + {balance_updates; consumed_gas; ticket_hash; paid_storage_size_diff} -> + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates ; + Format.fprintf ppf "@,Ticket hash: %a" Ticket_hash.pp ticket_hash ; + pp_paid_storage_size_diff ppf paid_storage_size_diff + | Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt} -> + pp_consumed_gas ppf consumed_gas ; + pp_ticket_receipt ppf ticket_receipt + | Transaction_to_zk_rollup_result + {balance_updates; consumed_gas; ticket_hash; paid_storage_size_diff} -> + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates ; + Format.fprintf ppf "@,Ticket hash: %a" Ticket_hash.pp ticket_hash ; + pp_paid_storage_size_diff ppf paid_storage_size_diff + +let pp_operation_result ~operation_name pp_operation_result ppf = function + | Skipped _ -> Format.fprintf ppf "This operation was skipped." + | Failed (_, _errs) -> Format.fprintf ppf "This operation FAILED." + | Applied op_res -> + Format.fprintf + ppf + "This %s was successfully applied" + (operation_name op_res) ; + pp_operation_result ppf op_res + | Backtracked (op_res, _errs) -> + Format.fprintf + ppf + "This %s was BACKTRACKED, its expected effects were NOT applied." + (operation_name op_res) ; + pp_operation_result ppf op_res + +let pp_manager_operation_contents_result ppf op_result = + let pp_register_global_constant_result + (Register_global_constant_result + {balance_updates; consumed_gas; size_of_constant; global_address}) = + (match balance_updates with + | [] -> + (* Not possible - register global constant operation always returns + balance updates. *) + assert false + | balance_updates -> pp_balance_updates ppf balance_updates) ; + pp_consumed_gas ppf consumed_gas ; + pp_storage_size ppf size_of_constant ; + Format.fprintf ppf "@,Global address: %a" Script_expr_hash.pp global_address + in + let pp_increase_paid_storage_result + (Increase_paid_storage_result {consumed_gas; balance_updates}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas + in + let pp_tx_rollup_origination_result + (Tx_rollup_origination_result + {balance_updates; consumed_gas; originated_tx_rollup}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas ; + Format.fprintf + ppf + "@,Originated tx rollup: %a" + Tx_rollup.pp + originated_tx_rollup + in + let pp_tx_rollup_submit_batch_result + (Tx_rollup_submit_batch_result + {balance_updates; consumed_gas; paid_storage_size_diff}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas ; + pp_paid_storage_size_diff ppf paid_storage_size_diff + in + let pp_tx_rollup_commit_result + (Tx_rollup_commit_result {balance_updates; consumed_gas}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas + in + let pp_tx_rollup_return_bond_result + (Tx_rollup_return_bond_result {balance_updates; consumed_gas}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas + in + let pp_tx_rollup_finalize_commitment_result + (Tx_rollup_finalize_commitment_result + {balance_updates; consumed_gas; level}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas ; + Format.fprintf ppf "@finalized level:@, %a" Tx_rollup_level.pp level + in + let pp_tx_rollup_remove_commitment_result + (Tx_rollup_remove_commitment_result + {balance_updates; consumed_gas; level}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas ; + Format.fprintf ppf "@finalized level:@, %a" Tx_rollup_level.pp level + in + let pp_tx_rollup_rejection_result + (Tx_rollup_rejection_result {balance_updates; consumed_gas}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas + in + let pp_tx_rollup_dispatch_tickets_result + (Tx_rollup_dispatch_tickets_result + {balance_updates; consumed_gas; paid_storage_size_diff}) = + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates + in + let pp_transfer_ticket_result + (Transfer_ticket_result + {balance_updates; ticket_receipt; consumed_gas; paid_storage_size_diff}) + = + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_ticket_receipt ppf ticket_receipt ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates + in + let pp_dal_publish_slot_header_result + (Dal_publish_slot_header_result {consumed_gas}) = + pp_consumed_gas ppf consumed_gas + in + let pp_sc_rollup_originate_result + (Sc_rollup_originate_result + {address; genesis_commitment_hash; consumed_gas; size; balance_updates}) + = + pp_consumed_gas ppf consumed_gas ; + pp_storage_size ppf size ; + Format.fprintf ppf "@,Address: %a" Sc_rollup.Address.pp address ; + Format.fprintf + ppf + "@,Genesis commitment hash: %a" + Sc_rollup.Commitment.Hash.pp + genesis_commitment_hash ; + pp_balance_updates ppf balance_updates + in + let pp_sc_rollup_add_messages_result + (Sc_rollup_add_messages_result {consumed_gas}) = + pp_consumed_gas ppf consumed_gas + in + let pp_sc_rollup_cement_result + (Sc_rollup_cement_result {consumed_gas; inbox_level}) = + pp_consumed_gas ppf consumed_gas ; + Format.fprintf ppf "@,Inbox level: %a" Raw_level.pp inbox_level + in + let pp_sc_rollup_publish_result + (Sc_rollup_publish_result + {consumed_gas; staked_hash; published_at_level; balance_updates}) = + pp_consumed_gas ppf consumed_gas ; + Format.fprintf + ppf + "@,Hash of commit: %a" + Sc_rollup.Commitment.Hash.pp + staked_hash ; + Format.fprintf + ppf + "@,Commitment published at level: %a" + Raw_level.pp + published_at_level ; + pp_balance_updates ppf balance_updates + in + let pp_sc_rollup_refute_result + (Sc_rollup_refute_result {consumed_gas; game_status; balance_updates}) = + pp_consumed_gas ppf consumed_gas ; + Format.fprintf + ppf + "@,Refutation game status: %a" + Sc_rollup.Game.pp_status + game_status ; + pp_balance_updates ppf balance_updates + in + let pp_sc_rollup_timeout_result + (Sc_rollup_timeout_result {consumed_gas; game_status; balance_updates}) = + pp_consumed_gas ppf consumed_gas ; + Format.fprintf + ppf + "@,Refutation game status: %a" + Sc_rollup.Game.pp_status + game_status ; + pp_balance_updates ppf balance_updates + in + let pp_sc_rollup_execute_outbox_message_result + (Sc_rollup_execute_outbox_message_result + {balance_updates; ticket_receipt; consumed_gas; paid_storage_size_diff}) + = + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates ; + pp_ticket_receipt ppf ticket_receipt + in + let pp_sc_rollup_recover_bond_result + (Sc_rollup_recover_bond_result {balance_updates; consumed_gas}) = + pp_balance_updates ppf balance_updates ; + pp_consumed_gas ppf consumed_gas + in + let pp_zk_rollup_origination_result + (Zk_rollup_origination_result + {consumed_gas; originated_zk_rollup; storage_size; balance_updates}) = + pp_consumed_gas ppf consumed_gas ; + pp_storage_size ppf storage_size ; + Format.fprintf ppf "@,Address: %a" Zk_rollup.Address.pp originated_zk_rollup ; + pp_balance_updates ppf balance_updates + in + let pp_zk_rollup_publish_result + (Zk_rollup_publish_result + {balance_updates; consumed_gas; paid_storage_size_diff}) = + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_consumed_gas ppf consumed_gas ; + pp_balance_updates ppf balance_updates + in + let pp_zk_rollup_update_result + (Zk_rollup_update_result + {balance_updates; consumed_gas; paid_storage_size_diff}) = + pp_consumed_gas ppf consumed_gas ; + pp_paid_storage_size_diff ppf paid_storage_size_diff ; + pp_balance_updates ppf balance_updates + in + + let manager_operation_name (type kind) + (result : kind successful_manager_operation_result) = + match result with + | Reveal_result _ -> "revelation" + | Transaction_result _ -> "transaction" + | Origination_result _ -> "origination" + | Delegation_result _ -> "delegation" + | Register_global_constant_result _ -> "global constant registration" + | Set_deposits_limit_result _ -> "deposits limit modification" + | Update_consensus_key_result _ -> "consensus key update" + | Increase_paid_storage_result _ -> "paid storage increase" + | Tx_rollup_origination_result _ -> "transaction rollup origination" + | Tx_rollup_submit_batch_result _ -> "transaction rollup batch submission" + | Tx_rollup_commit_result _ -> "transaction rollup commitment" + | Tx_rollup_return_bond_result _ -> "transaction rollup bond retrieval" + | Tx_rollup_finalize_commitment_result _ -> + "transaction rollup commitment finalization" + | Tx_rollup_remove_commitment_result _ -> + "transaction rollup commitment removal" + | Tx_rollup_rejection_result _ -> "transaction rollup commitment rejection" + | Tx_rollup_dispatch_tickets_result _ -> + "transaction rollup tickets dispatch" + | Transfer_ticket_result _ -> "tickets transfer" + | Sc_rollup_originate_result _ -> "smart contract rollup origination" + | Sc_rollup_add_messages_result _ -> + "smart contract rollup messages submission" + | Sc_rollup_cement_result _ -> "smart contract rollup commitment cementing" + | Sc_rollup_publish_result _ -> + "smart contract rollup commitment publishing" + | Sc_rollup_refute_result _ -> "smart contract rollup refutation move" + | Sc_rollup_timeout_result _ -> "smart contract rollup refutation timeout" + | Sc_rollup_execute_outbox_message_result _ -> + "smart contract output message execution" + | Sc_rollup_recover_bond_result _ -> "smart contract bond retrieval" + | Dal_publish_slot_header_result _ -> + "data availability slot header publishing" + | Zk_rollup_origination_result _ -> "epoxy originate" + | Zk_rollup_publish_result _ -> "epoxy publish" + | Zk_rollup_update_result _ -> "epoxy update" + in + let pp_manager_operation_contents_result (type kind) ppf + (result : kind successful_manager_operation_result) = + match result with + | Reveal_result {consumed_gas} -> pp_consumed_gas ppf consumed_gas + | Delegation_result {consumed_gas} -> pp_consumed_gas ppf consumed_gas + | Set_deposits_limit_result {consumed_gas} -> + pp_consumed_gas ppf consumed_gas + | Update_consensus_key_result {consumed_gas} -> + pp_consumed_gas ppf consumed_gas + | Transaction_result tx -> pp_transaction_result ppf tx + | Origination_result op_res -> pp_origination_result ppf op_res + | Register_global_constant_result _ as op -> + pp_register_global_constant_result op + | Increase_paid_storage_result _ as op -> pp_increase_paid_storage_result op + | Tx_rollup_origination_result _ as op -> pp_tx_rollup_origination_result op + | Tx_rollup_submit_batch_result _ as op -> + pp_tx_rollup_submit_batch_result op + | Tx_rollup_commit_result _ as op -> pp_tx_rollup_commit_result op + | Tx_rollup_return_bond_result _ as op -> pp_tx_rollup_return_bond_result op + | Tx_rollup_finalize_commitment_result _ as op -> + pp_tx_rollup_finalize_commitment_result op + | Tx_rollup_remove_commitment_result _ as op -> + pp_tx_rollup_remove_commitment_result op + | Tx_rollup_rejection_result _ as op -> pp_tx_rollup_rejection_result op + | Tx_rollup_dispatch_tickets_result _ as op -> + pp_tx_rollup_dispatch_tickets_result op + | Transfer_ticket_result _ as op -> pp_transfer_ticket_result op + | Sc_rollup_originate_result _ as op -> pp_sc_rollup_originate_result op + | Sc_rollup_add_messages_result _ as op -> + pp_sc_rollup_add_messages_result op + | Sc_rollup_cement_result _ as op -> pp_sc_rollup_cement_result op + | Sc_rollup_publish_result _ as op -> pp_sc_rollup_publish_result op + | Sc_rollup_refute_result _ as op -> pp_sc_rollup_refute_result op + | Sc_rollup_timeout_result _ as op -> pp_sc_rollup_timeout_result op + | Sc_rollup_execute_outbox_message_result _ as op -> + pp_sc_rollup_execute_outbox_message_result op + | Sc_rollup_recover_bond_result _ as op -> + pp_sc_rollup_recover_bond_result op + | Dal_publish_slot_header_result _ as op -> + pp_dal_publish_slot_header_result op + | Zk_rollup_origination_result _ as op -> pp_zk_rollup_origination_result op + | Zk_rollup_publish_result _ as op -> pp_zk_rollup_publish_result op + | Zk_rollup_update_result _ as op -> pp_zk_rollup_update_result op + in + pp_operation_result + ~operation_name:manager_operation_name + pp_manager_operation_contents_result + ppf + op_result + +let pp_internal_operation_and_result ppf (Internal_operation_result (op, res)) = + let internal_operation_name (type kind) : + kind successful_internal_operation_result -> string = function + | ITransaction_result _ -> "transaction" + | IOrigination_result _ -> "origination" + | IDelegation_result _ -> "delegation" + | IEvent_result _ -> "event" + in + let pp_internal_operation_result (type kind) ppf + (result : kind successful_internal_operation_result) = + match result with + | ITransaction_result tx -> pp_transaction_result ppf tx + | IOrigination_result op_res -> pp_origination_result ppf op_res + | IDelegation_result {consumed_gas} | IEvent_result {consumed_gas} -> + pp_consumed_gas ppf consumed_gas + in + Format.fprintf + ppf + "@[<v 2>%a@,%a@]" + pp_internal_operation + (Internal_operation op) + (pp_operation_result + ~operation_name:internal_operation_name + pp_internal_operation_result) + res + +let pp_internal_operation_results_list ppf = function + | [] -> () + | _ :: _ as internal_operation_results -> + Format.fprintf + ppf + "@,@[<v 2>Internal operations:@,%a@]" + (Format.pp_print_list pp_internal_operation_and_result) + internal_operation_results + +let pp_manager_operation_result ppf + ( Manager_operation + {source; fee; operation; counter; gas_limit; storage_limit}, + Manager_operation_result + {balance_updates; operation_result; internal_operation_results} ) = + Format.fprintf ppf "@[<v 2>Manager signed operations:" ; + Format.fprintf + ppf + "@,From: %a" + Tezos_crypto.Signature.Public_key_hash.pp + source ; + Format.fprintf ppf "@,Fee to the baker: %s%a" tez_sym Tez.pp fee ; + Format.fprintf ppf "@,Expected counter: %a" Manager_counter.pp counter ; + Format.fprintf ppf "@,Gas limit: %a" Gas.Arith.pp_integral gas_limit ; + Format.fprintf ppf "@,Storage limit: %a bytes" Z.pp_print storage_limit ; + pp_balance_updates ppf balance_updates ; + Format.fprintf + ppf + "@,@[<v 2>%a@,%a%a@]" + (pp_manager_operation_content (Contract.Implicit source)) + operation + pp_manager_operation_contents_result + operation_result + pp_internal_operation_results_list + internal_operation_results ; + Format.fprintf ppf "@]" + +let pp_contents_and_result : + type kind. Format.formatter -> kind contents * kind contents_result -> unit + = + fun ppf -> function + | Seed_nonce_revelation {level; nonce}, Seed_nonce_revelation_result bus -> + Format.fprintf + ppf + "@[<v 2>Seed nonce revelation:@,\ + Level: %a@,\ + Nonce (hash): %a@,\ + Balance updates:@,\ + %a@]" + Raw_level.pp + level + Nonce_hash.pp + (Nonce.hash nonce) + pp_balance_updates + bus + | Vdf_revelation {solution}, Vdf_revelation_result bus -> + Format.fprintf + ppf + "@[<v 2>Vdf revelation:@,Solution: %a@,Balance updates:@,%a@]" + Seed.pp_solution + solution + pp_balance_updates + bus + | Double_baking_evidence {bh1; bh2}, Double_baking_evidence_result bus -> + Format.fprintf + ppf + "@[<v 2>Double baking evidence:@,\ + Exhibit A: %a@,\ + Exhibit B: %a@,\ + Balance updates:@,\ + %a@]" + Tezos_crypto.Block_hash.pp + (Block_header.hash bh1) + Tezos_crypto.Block_hash.pp + (Block_header.hash bh2) + pp_balance_updates + bus + | ( Preendorsement {level; _}, + Preendorsement_result + {balance_updates; delegate; consensus_key; preendorsement_power} ) -> + Format.fprintf + ppf + "@[<v 2>Preendorsement:@,\ + Level: %a@,\ + Balance updates:%a@,\ + Delegate: %a@,\ + Preendorsement Power: %d@]" + Raw_level.pp + level + pp_balance_updates + balance_updates + Consensus_key.pp + {delegate; consensus_pkh = consensus_key} + preendorsement_power + | ( Endorsement {level; _}, + Endorsement_result + {balance_updates; delegate; consensus_key; endorsement_power} ) -> + Format.fprintf + ppf + "@[<v 2>Endorsement:@,\ + Level: %a@,\ + Balance updates:%a@,\ + Delegate: %a@,\ + Endorsement power: %d@]" + Raw_level.pp + level + pp_balance_updates + balance_updates + Consensus_key.pp + {delegate; consensus_pkh = consensus_key} + endorsement_power + | Dal_attestation _, Dal_attestation_result {delegate} -> + Format.fprintf + ppf + "@[<v 2>Slot attestation:@,Delegate: %a@]" + Tezos_crypto.Signature.Public_key_hash.pp + delegate + | ( Double_endorsement_evidence {op1; op2}, + Double_endorsement_evidence_result bus ) -> + Format.fprintf + ppf + "@[<v 2>Double endorsement evidence:@,\ + Exhibit A: %a@,\ + Exhibit B: %a@,\ + Balance updates:@,\ + \ %a@]" + Tezos_crypto.Operation_hash.pp + (Operation.hash op1) + Tezos_crypto.Operation_hash.pp + (Operation.hash op2) + pp_balance_updates + bus + | ( Double_preendorsement_evidence {op1; op2}, + Double_preendorsement_evidence_result bus ) -> + Format.fprintf + ppf + "@[<v 2>Double preendorsement evidence:@,\ + Exhibit A: %a@,\ + Exhibit B: %a@,\ + Balance updates:@,\ + \ %a@]" + Tezos_crypto.Operation_hash.pp + (Operation.hash op1) + Tezos_crypto.Operation_hash.pp + (Operation.hash op2) + pp_balance_updates + bus + | Activate_account {id; _}, Activate_account_result bus -> + Format.fprintf + ppf + "@[<v 2>Genesis account activation:@,\ + Account: %a@,\ + Balance updates:@,\ + \ %a@]" + Tezos_crypto.Ed25519.Public_key_hash.pp + id + pp_balance_updates + bus + | Proposals {source; period; proposals}, Proposals_result -> + Format.fprintf + ppf + "@[<v 2>Proposals:@,From: %a@,Period: %ld@,Protocols:@, @[<v 0>%a@]@]" + Tezos_crypto.Signature.Public_key_hash.pp + source + period + (Format.pp_print_list Tezos_crypto.Protocol_hash.pp) + proposals + | Ballot {source; period; proposal; ballot}, Ballot_result -> + Format.fprintf + ppf + "@[<v 2>Ballot:@,From: %a@,Period: %ld@,Protocol: %a@,Vote: %a@]" + Tezos_crypto.Signature.Public_key_hash.pp + source + period + Tezos_crypto.Protocol_hash.pp + proposal + Data_encoding.Json.pp + (Data_encoding.Json.construct Vote.ballot_encoding ballot) + | ( Drain_delegate {consensus_key; delegate; destination}, + Drain_delegate_result {balance_updates; allocated_destination_contract} ) + -> + Format.fprintf + ppf + "@[<v 2>Drain delegate:@,\ + Consensus key hash: %a@,\ + Delegate: %a@,\ + Destination: %a%s%a@]" + Tezos_crypto.Signature.Public_key_hash.pp + consensus_key + Tezos_crypto.Signature.Public_key_hash.pp + delegate + Tezos_crypto.Signature.Public_key_hash.pp + destination + (if allocated_destination_contract then " (allocated)" else "") + pp_balance_updates + balance_updates + | Failing_noop _arbitrary, _ -> + (* the Failing_noop operation always fails and can't have result *) + . + | (Manager_operation _ as op), (Manager_operation_result _ as res) -> + pp_manager_operation_result ppf (op, res) + +let rec pp_contents_and_result_list : + type kind. Format.formatter -> kind contents_and_result_list -> unit = + fun ppf -> function + | Single_and_result (op, res) -> pp_contents_and_result ppf (op, res) + | Cons_and_result + ((Manager_operation _ as op), (Manager_operation_result _ as res), rest) + -> + Format.fprintf + ppf + "%a@,%a" + pp_manager_operation_result + (op, res) + pp_contents_and_result_list + rest + +let pp_operation_result ppf + ((op, res) : 'kind contents_list * 'kind contents_result_list) = + let contents_and_result_list = Apply_results.pack_contents_list op res in + Format.fprintf + ppf + "@[<v 0>%a@]@." + pp_contents_and_result_list + contents_and_result_list diff --git a/src/proto_016_PtMumbai/lib_client/operation_result.mli b/src/proto_016_PtMumbai/lib_client/operation_result.mli new file mode 100644 index 000000000000..18c317ff3e2a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/operation_result.mli @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +val tez_sym : string + +val pp_internal_operation : + Format.formatter -> Apply_internal_results.packed_internal_operation -> unit + +val pp_operation_result : + Format.formatter -> + 'kind contents_list * 'kind Apply_results.contents_result_list -> + unit diff --git a/src/proto_016_PtMumbai/lib_client/protocol_client_context.ml b/src/proto_016_PtMumbai/lib_client/protocol_client_context.ml new file mode 100644 index 000000000000..595283dd48d8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/protocol_client_context.ml @@ -0,0 +1,260 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Lifted_protocol = struct + include Environment.Lift (Protocol) + + let hash = Protocol.hash +end + +module Alpha_block_services = + Block_services.Make (Lifted_protocol) (Lifted_protocol) + +(** Client RPC context *) +class type rpc_context = + object + inherit Tezos_rpc.Context.generic + + inherit + [Shell_services.chain * Shell_services.block] Environment.RPC_context + .simple + end + +(** The class [wrap_rpc_context] is a wrapper class used by the proxy + mode clients. From a general-purpose Tezos_rpc.Context.generic [t], the + class is augmented with shell services to provide RPC calls that + are protocol-dependent. *) +class wrap_rpc_context (t : Tezos_rpc.Context.generic) : rpc_context = + object + method base : Uri.t = t#base + + method generic_media_type_call = t#generic_media_type_call + + method call_service + : 'm 'p 'q 'i 'o. + (([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t -> + 'p -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + t#call_service + + method call_streamed_service + : 'm 'p 'q 'i 'o. + (([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t -> + on_chunk:('o -> unit) -> + on_close:(unit -> unit) -> + 'p -> + 'q -> + 'i -> + (unit -> unit) tzresult Lwt.t = + t#call_streamed_service + + (** Abstracts variables <chain_id> and <block_id> in protocol RPCs + prefixed by "/chains/<chain_id>/blocks/<block_id>/...". *) + inherit + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context + (t :> Tezos_rpc.Context.t) + Shell_services.Blocks.path + end + +(** The class type [full] allows to create contexts that are + explicitly used by low-level shell functions, while containing + various information (I/O services, RPCs...). Then, depending on the + usage, the type may be coerced into one of its following ascendants + to serve for explicit operations on blocks, chain or daemon for + instance. *) +class type full = + object + (** The class Client_context.full provides I/O services for the + client, the wallet, etc. *) + inherit Client_context.full + + (** Base interface provided to call RPCs, i.e., communication + with the node. A client context is defined by mapping all + RPCs protocol-generic to a specific protocol. *) + inherit + [Shell_services.chain * Shell_services.block] Environment.RPC_context + .simple + + (** Protocol RPCs exposed through the environment (using + an additional chainpath). *) + inherit + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context + end + +(** From a [Client_context.full], the class allows to call RPCs from + the node and those defined by the protocol. *) +class wrap_full (t : Client_context.full) : full = + object + inherit Client_context.proxy_context t + + inherit + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context + (t :> Tezos_rpc.Context.t) + Shell_services.Blocks.path + end + +let register_error_kind category ~id ~title ~description ?pp encoding from_error + to_error = + let id = "client." ^ Protocol.name ^ "." ^ id in + register_error_kind + category + ~id + ~title + ~description + ?pp + encoding + from_error + to_error + +(** Initialization calls that run on start-up. Register the various + protocol encodings. *) +let () = + let open Data_encoding.Registration in + register Protocol.Alpha_context.Lazy_storage.encoding ; + register ~pp:Protocol.Alpha_context.Fitness.pp + @@ Protocol.Alpha_context.Fitness.encoding ; + (* These encodings are missing a def field which we add before registering them. + These defs should be moved inside their encodings in the protocol code. *) + let def id ids ?title ?description encoding = + Data_encoding.def + (String.concat "." (Protocol.name :: id :: ids)) + ?title + ?description + encoding + in + register @@ def "parameters" [] Protocol.Parameters_repr.encoding ; + register ~pp:Protocol.Alpha_context.Tez.pp + @@ def "tez" [] Protocol.Alpha_context.Tez.encoding ; + register ~pp:Protocol.Alpha_context.Timestamp.pp + @@ def "timestamp" [] Protocol.Alpha_context.Timestamp.encoding ; + register ~pp:Protocol.Alpha_context.Raw_level.pp + @@ def "raw_level" [] Protocol.Alpha_context.Raw_level.encoding ; + register @@ def "vote" ["ballot"] Protocol.Alpha_context.Vote.ballot_encoding ; + register + @@ def "vote" ["ballots"] Protocol.Alpha_context.Vote.ballots_encoding ; + register + @@ def "vote" ["listings"] Protocol.Alpha_context.Vote.listings_encoding ; + register @@ def "seed" [] Protocol.Alpha_context.Seed.seed_encoding ; + register ~pp:Protocol.Alpha_context.Gas.pp + @@ def "gas" [] Protocol.Alpha_context.Gas.encoding ; + register ~pp:Protocol.Alpha_context.Gas.pp_cost + @@ def "gas" ["cost"] Protocol.Alpha_context.Gas.cost_encoding ; + register @@ def "script" [] Protocol.Alpha_context.Script.encoding ; + register @@ def "script" ["expr"] Protocol.Alpha_context.Script.expr_encoding ; + register @@ def "script" ["prim"] Protocol.Alpha_context.Script.prim_encoding ; + register + @@ def "script" ["lazy_expr"] Protocol.Alpha_context.Script.lazy_expr_encoding ; + register + @@ def "script" ["loc"] Protocol.Alpha_context.Script.location_encoding ; + register ~pp:Protocol.Alpha_context.Contract.pp + @@ def "contract" [] Protocol.Alpha_context.Contract.encoding ; + register + @@ def + "receipt" + ["balance_updates"] + Protocol.Alpha_context.Receipt.balance_updates_encoding ; + register ~pp:Protocol.Alpha_context.Level.pp_full + @@ def "level" [] Protocol.Alpha_context.Level.encoding ; + register @@ def "operation" [] Protocol.Alpha_context.Operation.encoding ; + register + @@ def + "operation" + ["contents"] + Protocol.Alpha_context.Operation.contents_encoding ; + register + @@ def + "operation" + ["contents_list"] + Protocol.Alpha_context.Operation.contents_list_encoding ; + register + @@ def + "operation" + ["protocol_data"] + Protocol.Alpha_context.Operation.protocol_data_encoding ; + register + @@ def "operation" ["raw"] Protocol.Alpha_context.Operation.raw_encoding ; + register + @@ def + "operation" + ["internal"] + Protocol.Apply_internal_results.internal_operation_encoding ; + register + @@ def + "operation" + ["unsigned"] + Protocol.Alpha_context.Operation.unsigned_encoding ; + register ~pp:Protocol.Alpha_context.Period.pp + @@ def "period" [] Protocol.Alpha_context.Period.encoding ; + register ~pp:Protocol.Alpha_context.Cycle.pp + @@ def "cycle" [] Protocol.Alpha_context.Cycle.encoding ; + register @@ def "constants" [] Protocol.Alpha_context.Constants.encoding ; + register + @@ def "constants" ["fixed"] Protocol.Alpha_context.Constants.fixed_encoding ; + register + @@ def + "constants" + ["parametric"] + Protocol.Alpha_context.Constants.Parametric.encoding ; + register @@ def "nonce" [] Protocol.Alpha_context.Nonce.encoding ; + register @@ def "block_header" [] Protocol.Alpha_context.Block_header.encoding ; + register + @@ def + "block_header" + ["unsigned"] + Protocol.Alpha_context.Block_header.unsigned_encoding ; + register + @@ def "block_header" ["raw"] Protocol.Alpha_context.Block_header.raw_encoding ; + register + @@ def + "block_header" + ["contents"] + Protocol.Alpha_context.Block_header.contents_encoding ; + register + @@ def + "block_header" + ["shell_header"] + Protocol.Alpha_context.Block_header.shell_header_encoding ; + register + @@ def + "block_header" + ["protocol_data"] + Protocol.Alpha_context.Block_header.protocol_data_encoding ; + register ~pp:Protocol.Alpha_context.Voting_period.pp + @@ def "voting_period" [] Protocol.Alpha_context.Voting_period.encoding ; + register + @@ def + "voting_period" + ["kind"] + Protocol.Alpha_context.Voting_period.kind_encoding ; + register + @@ def + "errors" + [] + ~description: + "The full list of RPC errors would be too long to include.It is\n\ + available through the RPC `/errors` (GET)." + error_encoding diff --git a/src/proto_016_PtMumbai/lib_client/proxy.ml b/src/proto_016_PtMumbai/lib_client/proxy.ml new file mode 100644 index 000000000000..b499c4fc1233 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/proxy.ml @@ -0,0 +1,174 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module ProtoRpc : Tezos_proxy.Proxy_proto.PROTO_RPC = struct + (** Split done only when the mode is [Tezos_proxy.Proxy.server]. Getting + an entire big map at once is useful for dapp developers that + iterate a lot on big maps and that use proxy servers in their + internal infra. *) + let split_server key = + match key with + (* matches paths like: + big_maps/index/i/contents/tail *) + | "big_maps" :: "index" :: i :: "contents" :: tail -> + Some (["big_maps"; "index"; i; "contents"], tail) + | _ -> None + + (** Split that is always done, no matter the mode *) + let split_always key = + match key with + (* matches paths like: + contracts/index/000002298c03ed7d454a101eb7022bc95f7e5f41ac78/tail *) + | "contracts" :: "index" :: i :: tail -> + Some (["contracts"; "index"; i], tail) + | "cycle" :: i :: tail -> Some (["cycle"; i], tail) + (* matches paths like: + rolls/owner/snapshot/19/1/tail *) + | "rolls" :: "owner" :: "snapshot" :: i :: j :: tail -> + Some (["rolls"; "owner"; "snapshot"; i; j], tail) + | "v1" :: tail -> Some (["v1"], tail) + | _ -> None + + let split_key (mode : Tezos_proxy.Proxy.mode) + (key : Tezos_protocol_environment.Proxy_context.M.key) : + (Tezos_protocol_environment.Proxy_context.M.key + * Tezos_protocol_environment.Proxy_context.M.key) + option = + match split_always key with + | Some _ as res -> + res (* No need to inspect the mode, this split is always done *) + | None -> ( + match mode with + | Client -> + (* There are strictly less splits in Client mode: return immediately *) + None + | Server -> split_server key) + + let failure_is_permanent = function + | ["pending_migration_balance_updates"] + | ["pending_migration_operation_results"] -> + true + | _ -> false + + let do_rpc (pgi : Tezos_proxy.Proxy.proxy_getter_input) + (key : Tezos_protocol_environment.Proxy_context.M.key) = + let chain = pgi.chain in + let block = pgi.block in + Tezos_proxy.Logger.emit + Tezos_proxy.Logger.proxy_block_rpc + ( Tezos_shell_services.Block_services.chain_to_string chain, + Tezos_shell_services.Block_services.to_string block, + key ) + >>= fun () -> + Protocol_client_context.Alpha_block_services.Context.read + pgi.rpc_context + ~chain + ~block + key + >>=? fun (raw_context : Tezos_context_sigs.Context.Proof_types.raw_context) + -> + Tezos_proxy.Logger.emit Tezos_proxy.Logger.tree_received + @@ Int64.of_int (Tezos_proxy.Proxy_getter.raw_context_size raw_context) + >>= fun () -> return raw_context +end + +let initial_context (ctx : Tezos_proxy.Proxy_getter.rpc_context_args) + (hash : Tezos_crypto.Context_hash.t) : + Tezos_protocol_environment.Context.t tzresult Lwt.t = + let open Lwt_result_syntax in + let*! () = + Tezos_proxy.Logger.emit + Tezos_proxy.Logger.proxy_getter_created + ( Tezos_shell_services.Block_services.chain_to_string ctx.chain, + Tezos_shell_services.Block_services.to_string ctx.block ) + in + let p_rpc = (module ProtoRpc : Tezos_proxy.Proxy_proto.PROTO_RPC) in + let* (module ProxyDelegation) = + Tezos_proxy.Proxy_getter.make_delegate ctx p_rpc hash + in + let empty = + Tezos_protocol_environment.Proxy_context.empty + @@ Some (module ProxyDelegation) + in + let version_value = "mumbai_016" in + let*! ctxt = + Tezos_protocol_environment.Context.add + empty + ["version"] + (Bytes.of_string version_value) + in + (* There is something fundamentally strange here. The purpose of the + proxy mode is to fetch pieces of data that are missing. Hence, + there is no need to initialize the context properly. It is + sufficient that the proxy client is connected to a node with a + valid context. However, this makes the assumption that any + interaction with the context is pure: Only the Irmin context can + be modified. The cache breaks this since initializing the cache + changes the Irmin context but also loads values into memory. If + the cache is not initialized, then any cache access will fail. + Hence, the initialization is done here. This means that the + caller needs to maintain a cache on its own. But I suspect this + is not wanted: The cache of the proxied node should be used + instead. *) + let cache_layout = + (* The order matters, be careful to maintain it correctly. *) + Default_parameters. + [ + constants_mainnet.cache_script_size; + constants_mainnet.cache_stake_distribution_cycles; + constants_mainnet.cache_sampler_state_cycles; + ] + in + Lwt_result.ok + (Tezos_protocol_environment.Context.Cache.set_cache_layout + ctxt + cache_layout) + +let round_durations (rpc_context : Tezos_rpc.Context.generic) + (chain : Tezos_shell_services.Block_services.chain) + (block : Tezos_shell_services.Block_services.block) = + let open Protocol in + let rpc_context = new Protocol_client_context.wrap_rpc_context rpc_context in + Constants_services.all rpc_context (chain, block) >>=? fun constants -> + (* Return the duration of block 0 *) + return_some + (Alpha_context.Period.to_seconds constants.parametric.minimal_block_delay) + +let () = + let open Tezos_proxy.Registration in + let module M : Proxy_sig = struct + module Protocol = Protocol_client_context.Lifted_protocol + + let protocol_hash = Protocol.hash + + let directory = Plugin.RPC.rpc_services + + let initial_context = initial_context + + let time_between_blocks = round_durations + + include Light.M + end in + register_proxy_context (module M) diff --git a/src/proto_016_PtMumbai/lib_client/test/dune b/src/proto_016_PtMumbai/lib_client/test/dune new file mode 100644 index 000000000000..d64599de9795 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/test/dune @@ -0,0 +1,47 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executables + (names + test_michelson_v1_macros + test_client_proto_contracts + test_client_proto_context + test_proxy) + (libraries + tezos-base + tezos-micheline + tezos-client-alpha + tezos-protocol-alpha + tezos-base-test-helpers + tezos-test-helpers + alcotest-lwt + qcheck-alcotest) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_micheline + -open Tezos_client_alpha + -open Tezos_protocol_alpha + -open Tezos_base_test_helpers + -open Lib_test)) + +(rule + (alias runtest) + (package tezos-client-alpha) + (action (run %{dep:./test_michelson_v1_macros.exe}))) + +(rule + (alias runtest) + (package tezos-client-alpha) + (action (run %{dep:./test_client_proto_contracts.exe}))) + +(rule + (alias runtest) + (package tezos-client-alpha) + (action (run %{dep:./test_client_proto_context.exe}))) + +(rule + (alias runtest) + (package tezos-client-alpha) + (action (run %{dep:./test_proxy.exe}))) diff --git a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml new file mode 100644 index 000000000000..65789ff0df89 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Testing + ------- + Component: Client + Invocation: dune exec src/proto_alpha/lib_client/test/test_client_proto_context.exe + Subject: Tests roundtrips of batch_transfer_operation_encoding +*) + +open Protocol +open Alpha_context +open Qcheck2_helpers + +let binary_roundtrip ?pp encoding t = + let b = Data_encoding.Binary.to_bytes_exn encoding t in + let actual = Data_encoding.Binary.of_bytes_exn encoding b in + qcheck_eq' ?pp ~expected:t ~actual () + +let gen_batch_transfer_operation_encoding = + let open QCheck2.Gen in + let gen_z = sized @@ fun n -> map Z.of_bits (string_size (return n)) in + let gen_gas_arith_integral = + map Gas.Arith.integral_of_int_exn (int_range 0 (Int.div Int.max_int 1000)) + in + let* destination = string in + let* fee = opt string in + let* gas_limit = opt gen_gas_arith_integral in + let* storage_limit = opt gen_z in + let* amount = string in + let* arg = opt string in + let* entrypoint = opt (string_size (1 -- 31)) in + let entrypoint = Option.map Entrypoint.of_string_strict_exn entrypoint in + return + Client_proto_context. + {destination; fee; gas_limit; storage_limit; amount; arg; entrypoint} + +let tests = + [ + QCheck2.Test.make + ~name:"test_batch_transfer_operation_encoding_roundtrip" + gen_batch_transfer_operation_encoding + (binary_roundtrip Client_proto_context.batch_transfer_operation_encoding); + ] + +let () = Alcotest.run "Client proto context" [("Encodings", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml new file mode 100644 index 000000000000..bb77d6ca2f0d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml @@ -0,0 +1,97 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Client + Invocation: dune exec src/proto_alpha/lib_client/test/test_client_proto_contracts.exe + Subject: Unit tests for Client_proto_contracts +*) + +(** [mock_wallet entities] is a mock of the + [Tezos_client_base.Client_context.wallet] class that only + implements the [load] method. This methods returns a key-value + association as given by the json string [entities] that should have + the form: ["[{"name": "alias", "value": "key" }, <...>]"]. *) +class mock_wallet (entities : string) : Tezos_client_base.Client_context.wallet + = + object + method load_passwords = None + + method read_file _path = failwith "mock_wallet:read_file" + + method get_base_dir = "" + + method with_lock : type a. (unit -> a Lwt.t) -> a Lwt.t = fun _f -> _f () + + method load : type a. + string -> default:a -> a Data_encoding.encoding -> a tzresult Lwt.t = + fun _alias_name ~default:_default _encoding -> + let json = (Ezjsonm.from_string entities :> Data_encoding.json) in + return @@ Data_encoding.Json.destruct _encoding json + + method write : type a. + string -> a -> a Data_encoding.encoding -> unit tzresult Lwt.t = + fun _alias_name _list _encoding -> failwith "mock_wallet:write" + + method last_modification_time : string -> float option tzresult Lwt.t = + fun _ -> Lwt_result_syntax.return_none + end + +(** + Test. + Tests different lookups of + [Client_proto_contracts.ContractAlias.find_destination]. +*) +let test_find_destination _ = + let bootstrap1 = "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" in + let wallet_json = + Format.asprintf {| [{"name": "test_alias", "value": "%s" }] |} bootstrap1 + in + let w = new mock_wallet wallet_json in + let test msg key exp_source = + Client_proto_contracts.ContractAlias.find_destination w key + >>=? fun contract -> + Client_proto_contracts.RawContractAlias.to_source contract + >>=? fun source -> + (* Alcotest equality assertion *) + Alcotest.(check string msg source exp_source) ; + return_unit + in + test "Expected alias:test_alias = bootstrap1" "alias:test_alias" bootstrap1 + >>=? fun () -> + test "Expected key:test_alias = bootstrap1" "key:test_alias" bootstrap1 + >>=? fun () -> + test "Expected bootstrap1 = bootstrap1" bootstrap1 bootstrap1 >>=? fun () -> + test "Expected test_alias bootstrap1" "test_alias" bootstrap1 + +let () = + Alcotest_lwt.run + "tezos-lib-client-proto-contracts" + [ + ( "client_proto_contracts", + [Tztest.tztest "test_find_destination" `Quick test_find_destination] ); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml b/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml new file mode 100644 index 000000000000..5057f11869ba --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml @@ -0,0 +1,1347 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Client + Invocation: dune build @src/proto_alpha/lib_client/runtest + Dependencies: src/proto_alpha/lib_client/test/assert.ml + Subject: Expansion and unexpansion of Micheline terms. +*) + +open Protocol +module Assert = Lib_test.Assert + +let pp ppf expr = + expr + |> Micheline_printer.printable (fun s -> s) + |> Format.fprintf ppf "%a" Micheline_printer.print_expr + +let to_string e = Format.asprintf "%a" pp e +(* expands : expression with macros fully expanded *) + +let assert_expands + (original : (Micheline_parser.location, string) Micheline.node) + (expanded : (Micheline_parser.location, string) Micheline.node) = + let {Michelson_v1_parser.expanded = expansion; _}, errors = + let source = to_string (Micheline.strip_locations original) in + Michelson_v1_parser.expand_all ~source ~original + in + match errors with + | [] -> + Assert.equal + ~pp + (Michelson_v1_primitives.strings_of_prims expansion) + (Micheline.strip_locations expanded) ; + ok () + | errors -> Error errors + +(****************************************************************************) + +open Micheline + +let zero_loc = Micheline_parser.location_zero + +let left_branch = Seq (zero_loc, [Prim (zero_loc, "SWAP", [], [])]) + +let right_branch = Seq (zero_loc, []) + +(***************************************************************************) +(* Test expands *) +(***************************************************************************) + +(** [prim_name] is the syntactic sugar to be expanded, while [compare_name] + is syntactic atom. *) +let assert_compare_macro prim_name compare_name = + assert_expands + (Prim (zero_loc, prim_name, [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "COMPARE", [], []); + Prim (zero_loc, compare_name, [], []); + ] )) + +(** Expand "COMP{EQ|NEQ|LT|GT|LE|GE}" + into "COMPARE ; {EQ|NEQ|LT|GT|LE|GE}". +*) +let test_compare_marco_expansion () = + assert_compare_macro "CMPEQ" "EQ" >>? fun () -> + assert_compare_macro "CMPNEQ" "NEQ" >>? fun () -> + assert_compare_macro "CMPLT" "LT" >>? fun () -> + assert_compare_macro "CMPGT" "GT" >>? fun () -> + assert_compare_macro "CMPLE" "LE" >>? fun () -> + assert_compare_macro "CMPGE" "GE" + +let assert_if_macro prim_name compare_name = + assert_expands + (Prim (zero_loc, prim_name, [left_branch; right_branch], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, compare_name, [], []); + Prim (zero_loc, "IF", [left_branch; right_branch], []); + ] )) + +(** Expand "IF{EQ|NEQ|LT|GT|LE|GE}" + into "{EQ|NEQ|LT|GT|LE|GE} ; IF" +*) +let test_if_compare_macros_expansion () = + assert_if_macro "IFEQ" "EQ" >>? fun () -> + assert_if_macro "IFNEQ" "NEQ" >>? fun () -> + assert_if_macro "IFLT" "LT" >>? fun () -> + assert_if_macro "IFGT" "GT" >>? fun () -> + assert_if_macro "IFLE" "LE" >>? fun () -> assert_if_macro "IFGE" "GE" + +let assert_if_cmp_macros prim_name compare_name = + assert_expands + (Prim (zero_loc, prim_name, [left_branch; right_branch], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "COMPARE", [], []); + Prim (zero_loc, compare_name, [], []); + Prim (zero_loc, "IF", [left_branch; right_branch], []); + ] )) + +(** Expand "IF{EQ|NEQ|LT|GT|LE|GE}" + into "{EQ|NEQ|LT|GT|LE|GE} ; IF" +*) +let test_if_cmp_macros_expansion () = + assert_if_cmp_macros "IFCMPEQ" "EQ" >>? fun () -> + assert_if_cmp_macros "IFCMPNEQ" "NEQ" >>? fun () -> + assert_if_cmp_macros "IFCMPLT" "LT" >>? fun () -> + assert_if_cmp_macros "IFCMPGT" "GT" >>? fun () -> + assert_if_cmp_macros "IFCMPLE" "LE" >>? fun () -> + assert_if_cmp_macros "IFCMPGE" "GE" + +(****************************************************************************) +(* Fail *) + +(** Expand "FAIL" + into "UNIT ; FAILWITH" +*) +let test_fail_expansion () = + assert_expands + (Prim (zero_loc, "FAIL", [], [])) + (Seq + ( zero_loc, + [Prim (zero_loc, "UNIT", [], []); Prim (zero_loc, "FAILWITH", [], [])] + )) + +(**********************************************************************) +(* assertion *) + +let seq_unit_failwith = + Seq + ( zero_loc, + [Prim (zero_loc, "UNIT", [], []); Prim (zero_loc, "FAILWITH", [], [])] ) + +(* {} {FAIL} *) +let fail_false = [Seq (zero_loc, []); Seq (zero_loc, [seq_unit_failwith])] + +(* {FAIL} {} *) +let fail_true = [Seq (zero_loc, [seq_unit_failwith]); Seq (zero_loc, [])] + +(** Expand "ASSERT" + into "IF {} {FAIL}" +*) +let test_assert_expansion () = + assert_expands + (Prim (zero_loc, "ASSERT", [], [])) + (Seq (zero_loc, [Prim (zero_loc, "IF", fail_false, [])])) + +let assert_assert_if_compare prim_name compare_name = + assert_expands + (Prim (zero_loc, prim_name, [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, compare_name, [], []); + Prim (zero_loc, "IF", fail_false, []); + ] )) + +(** Expand "ASSERT_{EQ|NEQ|LT|GT|LE|GE}" + into "{EQ|NEQ|LT|GT|LE|GE} ; IF {} {FAIL}" +*) +let test_assert_if () = + assert_assert_if_compare "ASSERT_EQ" "EQ" >>? fun () -> + assert_assert_if_compare "ASSERT_NEQ" "NEQ" >>? fun () -> + assert_assert_if_compare "ASSERT_LT" "LT" >>? fun () -> + assert_assert_if_compare "ASSERT_LE" "LE" >>? fun () -> + assert_assert_if_compare "ASSERT_GT" "GT" >>? fun () -> + assert_assert_if_compare "ASSERT_GE" "GE" + +let assert_cmp_if prim_name compare_name = + assert_expands + (Prim (zero_loc, prim_name, [], [])) + (Seq + ( zero_loc, + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "COMPARE", [], []); + Prim (zero_loc, compare_name, [], []); + ] ); + Prim (zero_loc, "IF", fail_false, []); + ] )) + +(** Expand "ASSERT_CMP{EQ|NEQ|LT|GT|LE|GE}" + into "COMPARE ; {EQ|NEQ|LT|GT|LE|GE} ; IF {} {FAIL}" +*) +let test_assert_cmp_if () = + assert_cmp_if "ASSERT_CMPEQ" "EQ" >>? fun () -> + assert_cmp_if "ASSERT_CMPNEQ" "NEQ" >>? fun () -> + assert_cmp_if "ASSERT_CMPLT" "LT" >>? fun () -> + assert_cmp_if "ASSERT_CMPLE" "LE" >>? fun () -> + assert_cmp_if "ASSERT_CMPGT" "GT" >>? fun () -> + assert_cmp_if "ASSERT_CMPGE" "GE" + +(* The work of merge request !628 + > ASSERT_LEFT @x => IF_LEFT {RENAME @x} {FAIL} + > ASSERT_RIGHT @x => IF_LEFT {FAIL} {RENAME @x} + > ASSERT_SOME @x => IF_NONE {FAIL} {RENAME @x} +*) + +let may_rename annot = Seq (zero_loc, [Prim (zero_loc, "RENAME", [], annot)]) + +let fail_false_may_rename = + [ + may_rename ["@annot"]; + Seq + ( zero_loc, + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "UNIT", [], []); + Prim (zero_loc, "FAILWITH", [], []); + ] ); + ] ); + ] + +let fail_true_may_rename = + [ + Seq + ( zero_loc, + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "UNIT", [], []); + Prim (zero_loc, "FAILWITH", [], []); + ] ); + ] ); + may_rename ["@annot"]; + ] + +(** Expand "ASSERT_SOME @annot" + into "IF_NONE { } {UNIT;FAILWITH}" + using variable annotation "@annot" +*) +let test_assert_some_annot () = + assert_expands + (Prim (zero_loc, "ASSERT_SOME", [], ["@annot"])) + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_true_may_rename, [])])) + +(** Expand "ASSERT_SOME" + into "IF_NONE { UNIT;FAILWITH } { }" +*) +let test_assert_some () = + assert_expands + (Prim (zero_loc, "ASSERT_SOME", [], [])) + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_true, [])])) + +(** Expand "ASSERT_LEFT @annot" + into "IF_LEFT { } {UNIT;FAILWITH}" + using variable annotation "@annot" +*) +let test_assert_left_annot () = + assert_expands + (Prim (zero_loc, "ASSERT_LEFT", [], ["@annot"])) + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_false_may_rename, [])])) + +(** Expand "ASSERT_LEFT" + into "IF_LEFT { } {UNIT;FAILWITH}" +*) +let test_assert_left () = + assert_expands + (Prim (zero_loc, "ASSERT_LEFT", [], [])) + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_false, [])])) + +(** Expand "ASSERT_RIGHT @annot" + into "IF_LEFT {UNIT;FAILWITH} { }" + using variable annotation "@annot" +*) +let test_assert_right_annot () = + assert_expands + (Prim (zero_loc, "ASSERT_RIGHT", [], ["@annot"])) + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_true_may_rename, [])])) + +(** Expand "ASSERT_RIGHT" + into "IF_LEFT {UNIT;FAILWITH} { }" +*) +let test_assert_right () = + assert_expands + (Prim (zero_loc, "ASSERT_RIGHT", [], [])) + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_true, [])])) + +(** Expand "ASSERT_NONE" + into "IF_NONE { } { UNIT;FAILWITH }" +*) +let test_assert_none () = + assert_expands + (Prim (zero_loc, "ASSERT_NONE", [], [])) + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_false, [])])) + +(***********************************************************************) +(*Syntactic Conveniences*) + +(* diip *) + +(** Expand "DIP" into "DIP". + Expand "DIIIIIIIIP" into "DIP 8". + Expand "DIIP" into "DIP 2". +*) +let test_diip () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_expands + (Prim (zero_loc, "DIP", [code], [])) + (Prim (zero_loc, "DIP", [code], [])) + >>? fun () -> + assert_expands + (Prim (zero_loc, "DIIIIIIIIP", [code], [])) + (Prim (zero_loc, "DIP", [Int (zero_loc, Z.of_int 8); code], [])) + >>? fun () -> + assert_expands + (Prim (zero_loc, "DIIP", [code], [])) + (Prim (zero_loc, "DIP", [Int (zero_loc, Z.of_int 2); code], [])) + +(* pair *) + +(** Expand "PAIR" + into "PAIR" +*) +let test_pair () = + assert_expands + (Prim (zero_loc, "PAIR", [], [])) + (Prim (zero_loc, "PAIR", [], [])) + +(** Expand "PAPPAIIR" + into "DIP {PAIR}; DIP {PAIR}; PAIR" +*) +let test_pappaiir () = + let pair = Prim (zero_loc, "PAIR", [], []) in + assert_expands + (Prim (zero_loc, "PAPPAIIR", [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DIP", [Seq (zero_loc, [pair])], []); + Prim (zero_loc, "DIP", [Seq (zero_loc, [pair])], []); + pair; + ] )) + +(* unpair *) + +(** Expand "UNPAIR" + into "DUP ; CAR ; DIP {CDR}" +*) +let test_unpair () = + assert_expands + (Prim (zero_loc, "UNPAIR", [], [])) + (Prim (zero_loc, "UNPAIR", [], [])) + +(* duup *) + +(** Expand "DUUP" + into "DIP {DUP} ; SWAP" +*) +let test_duup () = + assert_expands + (Prim (zero_loc, "DUUP", [], [])) + (Prim (zero_loc, "DUP", [Int (zero_loc, Z.of_int 2)], [])) + +(* car/cdr *) + +(** Expand "CAR" into "CAR" + Expand "CDR" into "CDR" + Expand "CADR" into "CAR ; CDR" + Expand "CDAR" into "CDR ; CAR" +*) +let test_caddadr_expansion () = + let car = Prim (zero_loc, "CAR", [], []) in + assert_expands (Prim (zero_loc, "CAR", [], [])) car >>? fun () -> + let cdr = Prim (zero_loc, "CDR", [], []) in + assert_expands (Prim (zero_loc, "CDR", [], [])) cdr >>? fun () -> + assert_expands (Prim (zero_loc, "CADR", [], [])) (Seq (zero_loc, [car; cdr])) + >>? fun () -> + assert_expands (Prim (zero_loc, "CDAR", [], [])) (Seq (zero_loc, [cdr; car])) + +let test_carn_cdrn_expansion () = + let car n = Prim (zero_loc, "CAR", [Int (zero_loc, Z.of_int n)], []) in + let cdr n = Prim (zero_loc, "CDR", [Int (zero_loc, Z.of_int n)], []) in + let get n = + Seq (zero_loc, [Prim (zero_loc, "GET", [Int (zero_loc, Z.of_int n)], [])]) + in + assert_expands (cdr 0) (get 0) >>? fun () -> + assert_expands (car 0) (get 1) >>? fun () -> + assert_expands (cdr 1) (get 2) >>? fun () -> + assert_expands (car 1) (get 3) >>? fun () -> assert_expands (cdr 2) (get 4) + +(* if_some *) + +(** Expand "IF_SOME { 1 } { 2 }" + into "IF_NONE { 2 } { 1 }" +*) +let test_if_some () = + assert_expands + (Prim (zero_loc, "IF_SOME", [right_branch; left_branch], [])) + (Seq + (zero_loc, [Prim (zero_loc, "IF_NONE", [left_branch; right_branch], [])])) + +(*set_caddadr*) + +(** Expand "SET_CAR" + into "CDR; SWAP; PAIR" +*) +let test_set_car_expansion () = + assert_expands + (Prim (zero_loc, "SET_CAR", [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] )) + +(** Expand "SET_CDR" + into "CAR; PAIR" +*) +let test_set_cdr_expansion () = + assert_expands + (Prim (zero_loc, "SET_CDR", [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] )) + +(** Expand "SET_CADR" + into "DUP; DIP {CAR; { CAR; PAIR }}; CDR; SWAP; PAIR" +*) +let test_set_cadr_expansion () = + let set_car = + Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ) + in + assert_expands + (Prim (zero_loc, "SET_CADR", [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); set_car])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + +(** Expand "SET_CDAR" + into "DUP; DIP {CDR; { CDR; SWAP; PAIR }}; CAR; PAIR" +*) +let test_set_cdar_expansion () = + let set_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] ) + in + assert_expands + (Prim (zero_loc, "SET_CDAR", [], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CDR", [], ["@%%"]); set_cdr])], + [] ); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + +(* TO BE CHANGE IN THE DOCUMENTATION: @MR!791 + FROM: + > MAP_CAR code => DUP ; CDR ; DIP { CAR ; code } ; SWAP ; PAIR + TO: + > MAP_CAR code => DUP ; CDR ; DIP { CAR ; {code} } ; SWAP ; PAIR +*) + +(** Expand "MAP_CAR {CAR}" + into "DUP; CDR; DIP {CAR; CAR}; SWAP; PAIR" +*) +let test_map_car () = + (* code is a sequence *) + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_expands + (Prim (zero_loc, "MAP_CAR", [code], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], []); code])], + [] ); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] )) + +(** Expand "MAP_CDR {CAR}" + into "DUP; CDR; CAR; SWAP; CAR; PAIR" +*) +let test_map_cdr () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_expands + (Prim (zero_loc, "MAP_CDR", [code], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + code; + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] )) + +(** Expand "MAP_CAADR {CAR}" + into "DUP; + DIP { CAR; + DUP; + DIP { CAR; + DUP; + CDR; + CAR; + SWAP; + CAR; + PAIR + } + CDR; + SWAP; + PAIR + }; + CDR; + SWAP; + PAIR" +*) +let test_map_caadr () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + let map_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + code; + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ) + in + let map_cadr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); map_cdr])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] ) + in + assert_expands + (Prim (zero_loc, "MAP_CAADR", [code], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); map_cadr])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + +(** Expand "MAP_CDADR" + into "DUP; + DIP { CDR; + DUP; + DIP { CAR; + DUP; + CDR; + CAR; + SWAP; + CAR; + PAIR + }; + CDR; + CAR; + PAIR + }; + CAR; + PAIR" +*) +let test_map_cdadr () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + let map_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + code; + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ) + in + let map_cadr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); map_cdr])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] ) + in + assert_expands + (Prim (zero_loc, "MAP_CDADR", [code], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CDR", [], ["@%%"]); map_cadr])], + [] ); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + +(****************************************************************************) +(* Unexpand tests *) +(****************************************************************************) + +(** Asserts that unexpanding the expression [original] conforms with + the canonical form of [ex]. + [unparse.Michelson_v1_parser.unexpanded] contains the original + expression with macros *) +let assert_unexpansion original ex = + let {Michelson_v1_parser.expanded; _}, errors = + let source = to_string (Micheline.strip_locations original) in + Michelson_v1_parser.expand_all ~source ~original + in + let unparse = Michelson_v1_printer.unparse_expression expanded in + match errors with + | [] -> + Assert.equal + ~pp + unparse.Michelson_v1_parser.unexpanded + (Micheline.strip_locations ex) ; + ok () + | _ :: _ -> Error errors + +(** Unexpanding "UNIT; FAILWITH" + yields "FAIL" +*) +let test_unexpand_fail () = + assert_unexpansion + (Seq + ( zero_loc, + [Prim (zero_loc, "UNIT", [], []); Prim (zero_loc, "FAILWITH", [], [])] + )) + (Prim (zero_loc, "FAIL", [], [])) + +(** Unexpanding "IF_LEFT { 1 } { 2 }" + yields "IF_RIGHT { 2 } { 1 }" +*) +let test_unexpand_if_right () = + assert_unexpansion + (Seq + (zero_loc, [Prim (zero_loc, "IF_LEFT", [left_branch; right_branch], [])])) + (Prim (zero_loc, "IF_RIGHT", [right_branch; left_branch], [])) + +(** IF_NONE + Unexpanding "IF_NONE { 1 } { 2 }" + yields "IF_SOME { 2 } { 1 }" +*) +let test_unexpand_if_some () = + assert_unexpansion + (Seq + (zero_loc, [Prim (zero_loc, "IF_NONE", [left_branch; right_branch], [])])) + (Prim (zero_loc, "IF_SOME", [right_branch; left_branch], [])) + +(** Unexpanding "IF {} { UNIT; FAILWITH }" + yields "ASSERT" +*) +let test_unexpand_assert () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF", fail_false, [])])) + (Prim (zero_loc, "ASSERT", [], [])) + +let assert_unexpansion_assert_if_compare compare_name prim_name = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, compare_name, [], []); + Prim (zero_loc, "IF", fail_false, []); + ] )) + (Prim (zero_loc, prim_name, [], [])) + +(** Unexpanding "{EQ|NEQ|LT|LE|GT|GE} ; IF {} {FAIL}" + yields "ASSERT_{EQ|NEQ|LT|LE|GT|GE}" +*) +let test_unexpand_assert_if () = + assert_unexpansion_assert_if_compare "EQ" "ASSERT_EQ" >>? fun () -> + assert_unexpansion_assert_if_compare "NEQ" "ASSERT_NEQ" >>? fun () -> + assert_unexpansion_assert_if_compare "LT" "ASSERT_LT" >>? fun () -> + assert_unexpansion_assert_if_compare "LE" "ASSERT_LE" >>? fun () -> + assert_unexpansion_assert_if_compare "GT" "ASSERT_GT" >>? fun () -> + assert_unexpansion_assert_if_compare "GE" "ASSERT_GE" + +let assert_unexpansion_assert_cmp_if_compare compare_name prim_name = + assert_unexpansion + (Seq + ( zero_loc, + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "COMPARE", [], []); + Prim (zero_loc, compare_name, [], []); + ] ); + Prim (zero_loc, "IF", fail_false, []); + ] )) + (Prim (zero_loc, prim_name, [], [])) + +(** Unexpanding "COMPARE; {EQ|NEQ|LT|LE|GT|GE}; IF {} {FAIL}" + yields "ASSERT_CMP{EQ|NEQ|LT|LE|GT|GE}" +*) +let test_unexpansion_assert_cmp_if () = + assert_unexpansion_assert_cmp_if_compare "EQ" "ASSERT_CMPEQ" >>? fun () -> + assert_unexpansion_assert_cmp_if_compare "NEQ" "ASSERT_CMPNEQ" >>? fun () -> + assert_unexpansion_assert_cmp_if_compare "LT" "ASSERT_CMPLT" >>? fun () -> + assert_unexpansion_assert_cmp_if_compare "LE" "ASSERT_CMPLE" >>? fun () -> + assert_unexpansion_assert_cmp_if_compare "GT" "ASSERT_CMPGT" >>? fun () -> + assert_unexpansion_assert_cmp_if_compare "GE" "ASSERT_CMPGE" + +(** Unexpanding "IF_NONE { FAIL } { RENAME @annot }" + yields "ASSERT_SOME @annot" +*) +let test_unexpand_assert_some_annot () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_true_may_rename, [])])) + (Prim (zero_loc, "ASSERT_SOME", [], ["@annot"])) + +(** Unexpanding "IF_LEFT { RENAME @annot } { FAIL }" + yields "ASSERT_LEFT @annot" +*) +let test_unexpand_assert_left_annot () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_false_may_rename, [])])) + (Prim (zero_loc, "ASSERT_LEFT", [], ["@annot"])) + +(** Unexpanding "IF_LEFT { FAIL } { RENAME @annot }" + yields "ASSERT_RIGHT @annot" +*) +let test_unexpand_assert_right_annot () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_true_may_rename, [])])) + (Prim (zero_loc, "ASSERT_RIGHT", [], ["@annot"])) + +(** Unexpanding "IF_NONE {} { FAIL }" + yields "ASSERT_NONE" +*) +let test_unexpand_assert_none () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_false, [])])) + (Prim (zero_loc, "ASSERT_NONE", [], [])) + +(** Unexpanding "IF_NONE { FAIL } {}" + yields "ASSERT_SOME" +*) +let test_unexpand_assert_some () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_NONE", fail_true, [])])) + (Prim (zero_loc, "ASSERT_SOME", [], [])) + +(** Unexpanding "IF_LEFT {} { FAIL }" + yields "ASSERT_LEFT" +*) +let test_unexpand_assert_left () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_false, [])])) + (Prim (zero_loc, "ASSERT_LEFT", [], [])) + +(** Unexpanding "IF_LEFT { FAIL } {}" + yields "ASSERT_RIGHT" +*) +let test_unexpand_assert_right () = + assert_unexpansion + (Seq (zero_loc, [Prim (zero_loc, "IF_LEFT", fail_true, [])])) + (Prim (zero_loc, "ASSERT_RIGHT", [], [])) + +(** Unexpanding "DUP; CAR; DIP { CDR }" + yields "UNPAIR" +*) +let test_unexpand_unpair () = + assert_unexpansion + (Prim (zero_loc, "UNPAIR", [], [])) + (Prim (zero_loc, "UNPAIR", [], [])) + +(** Unexpanding "PAIR" + yields "PAIR" +*) +let test_unexpand_pair () = + assert_unexpansion + (Prim (zero_loc, "PAIR", [], [])) + (Prim (zero_loc, "PAIR", [], [])) + +(** Unexpanding "DIP { PAIR }; DIP { PAIR }; PAIR" + yields "PAPPAIIR" +*) +let test_unexpand_pappaiir () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "PAIR", [], [])])], + [] ); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "PAIR", [], [])])], + [] ); + Prim (zero_loc, "PAIR", [], []); + ] )) + (Prim (zero_loc, "PAPPAIIR", [], [])) + +(** Unexpanding "DIP { DUP }; SWAP" + yields "DUP 2" +*) +let test_unexpand_duup () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "DUP", [], [])])], + [] ); + Prim (zero_loc, "SWAP", [], []); + ] )) + (Prim (zero_loc, "DUP", [Int (zero_loc, Z.of_int 2)], [])) + +(** Unexpanding "CAR" yields "CAR" + Unexpanding "CDR" yields "CDR" + Unexpanding "CAR; CDR" yields "CADR" + Unexpanding "CDR; CAR" yields "CDAR" +*) +let test_unexpand_caddadr () = + let car = Prim (zero_loc, "CAR", [], []) in + let cdr = Prim (zero_loc, "CDR", [], []) in + assert_unexpansion (Seq (zero_loc, [car])) car >>? fun () -> + assert_unexpansion (Seq (zero_loc, [cdr])) cdr >>? fun () -> + assert_unexpansion + (Seq (zero_loc, [car; cdr])) + (Prim (zero_loc, "CADR", [], [])) + >>? fun () -> + assert_unexpansion + (Seq (zero_loc, [cdr; car])) + (Prim (zero_loc, "CDAR", [], [])) + +let test_unexpand_carn_cdrn () = + let car n = Prim (zero_loc, "CAR", [Int (zero_loc, Z.of_int n)], []) in + let cdr n = Prim (zero_loc, "CDR", [Int (zero_loc, Z.of_int n)], []) in + let get n = + Seq (zero_loc, [Prim (zero_loc, "GET", [Int (zero_loc, Z.of_int n)], [])]) + in + assert_unexpansion (get 0) (cdr 0) >>? fun () -> + assert_unexpansion (get 1) (car 0) >>? fun () -> + assert_unexpansion (get 2) (cdr 1) >>? fun () -> + assert_unexpansion (get 3) (car 1) >>? fun () -> + assert_unexpansion (get 4) (cdr 2) + +(** Unexpanding "CDR; SWAP; PAIR" + yields "SET_CAR" +*) +let test_unexpand_set_car () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] )) + (Prim (zero_loc, "SET_CAR", [], [])) + +(** Unexpanding "CAR; PAIR" + yields "SET_CDR" +*) +let test_unexpand_set_cdr () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] )) + (Prim (zero_loc, "SET_CDR", [], [])) + +(** Unexpanding "DUP; CAR; DROP; CDR; SWAP; PAIR" + yields "SET_CAR" +*) +let test_unexpand_set_car_annot () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CAR", [], ["%@"]); + Prim (zero_loc, "DROP", [], []); + Prim (zero_loc, "CDR", [], []); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], []); + ] )) + (Prim (zero_loc, "SET_CAR", [], ["%@"])) + +(** Unexpanding "DUP; CDR; DROP; CAR; PAIR" + yields "SET_CDR" +*) +let test_unexpand_set_cdr_annot () = + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], ["%@"]); + Prim (zero_loc, "DROP", [], []); + Prim (zero_loc, "CAR", [], []); + Prim (zero_loc, "PAIR", [], []); + ] )) + (Prim (zero_loc, "SET_CDR", [], ["%@"])) + +(** Unexpanding "DUP; DIP { CAR; CAR; PAIR }; CDR; SWAP; PAIR" + yields "SET_CADR" +*) +let test_unexpand_set_cadr () = + let set_car = + Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ) + in + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); set_car])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + (Prim (zero_loc, "SET_CADR", [], [])) + +let test_unexpand_set_cdar () = + let set_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] ) + in + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CDR", [], ["@%%"]); set_cdr])], + [] ); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + (Prim (zero_loc, "SET_CDAR", [], [])) + +(* FIXME: Seq()(Prim): does not parse, raise an error unparse *) +let test_unexpand_map_car () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_unexpansion + (Prim (zero_loc, "MAP_CAR", [code], [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim + ( zero_loc, + "DIP", + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], []); + Prim (zero_loc, "CAR", [], []); + ] ); + ], + [] ); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%"; "%@"]); + ] )) + +(***********************************************************************) +(*BUG: the test with MAP_CDR or any map with "D" inside fail *) + +let _test_unexpand_map_cdr () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + code; + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], []); + Prim (zero_loc, "PAIR", [], []); + ] )) + (Prim (zero_loc, "MAP_CDR", [code], [])) + +let _test_unexpand_map_caadr () = + let code = [Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])])] in + let map_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ); + ] ); + ], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] ) + in + assert_unexpansion + (Prim (zero_loc, "MAP_CAAR", code, [])) + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CAR", [], ["@%%"]); map_cdr])], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + +let _test_unexpand_map_cdadr () = + let code = [Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])])] in + let map_cdr = + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [ + Seq + ( zero_loc, + [ + Prim (zero_loc, "CAR", [], ["@%%"]); + Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim (zero_loc, "CDR", [], []); + Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%"]); + ] ); + ] ); + ], + [] ); + Prim (zero_loc, "CDR", [], ["@%%"]); + Prim (zero_loc, "SWAP", [], []); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] ) + in + assert_unexpansion + (Seq + ( zero_loc, + [ + Prim (zero_loc, "DUP", [], []); + Prim + ( zero_loc, + "DIP", + [Seq (zero_loc, [Prim (zero_loc, "CDR", [], ["@%%"]); map_cdr])], + [] ); + Prim (zero_loc, "CAR", [], ["@%%"]); + Prim (zero_loc, "PAIR", [], ["%@"; "%@"]); + ] )) + (Prim (zero_loc, "MAP_CDADR", code, [])) + +let test_unexpand_diip () = + let code = Seq (zero_loc, [Prim (zero_loc, "CAR", [], [])]) in + assert_unexpansion + (Prim (zero_loc, "DIIP", [code], [])) + (Prim (zero_loc, "DIP", [Int (zero_loc, Z.of_int 2); code], [])) + +(** Unexpanding "DIP { DIP { DIP { DUP }; SWAP" + yields "DIIP { DIP { DUP }; SWAP }" +*) +let test_unexpand_diip_duup1 () = + let single code = Seq (zero_loc, [code]) in + let cst str = Prim (zero_loc, str, [], []) in + let app str code = Prim (zero_loc, str, [code], []) in + let dip = app "DIP" in + let diip code = + Prim (zero_loc, "DIP", [Int (zero_loc, Z.of_int 2); code], []) + in + let dup = cst "DUP" in + let swap = cst "SWAP" in + let dip_dup_swap = Seq (zero_loc, [dip (single dup); swap]) in + assert_unexpansion + (* { DIP { DIP { DIP { DUP }; SWAP }}} *) + (single (dip (single (dip dip_dup_swap)))) + (* DIIP { DIP { DUP }; SWAP } *) + (diip dip_dup_swap) + +(** Unexpanding "DIP { DIP {{ DIP { DUP }; SWAP" + yields "DIIP { DUUP }" +*) +let test_unexpand_diip_duup2 () = + let single code = Seq (zero_loc, [code]) in + let cst str = Prim (zero_loc, str, [], []) in + let app str code = Prim (zero_loc, str, [code], []) in + let dip = app "DIP" in + let diip code = + Prim (zero_loc, "DIP", [Int (zero_loc, Z.of_int 2); code], []) + in + let dup = cst "DUP" in + let duup = Prim (zero_loc, "DUP", [Int (zero_loc, Z.of_int 2)], []) in + let swap = cst "SWAP" in + let dip_dup_swap = Seq (zero_loc, [dip (single dup); swap]) in + assert_unexpansion + (* { DIP { DIP {{ DIP { DUP }; SWAP }}}} *) + (single (dip (single (dip (single dip_dup_swap))))) + (* DIIP { DUUP } *) + (diip (single duup)) + +(*****************************************************************************) +(* Test *) +(*****************************************************************************) + +let tests = + [ + (*compare*) + ("compare expansion", fun _ -> Lwt.return (test_compare_marco_expansion ())); + ( "if compare expansion", + fun _ -> Lwt.return (test_if_compare_macros_expansion ()) ); + ( "if compare expansion: IFCMP", + fun _ -> Lwt.return (test_if_cmp_macros_expansion ()) ); + (*fail*) + ("fail expansion", fun _ -> Lwt.return (test_fail_expansion ())); + (*assertion*) + ("assert expansion", fun _ -> Lwt.return (test_assert_expansion ())); + ("assert if expansion", fun _ -> Lwt.return (test_assert_if ())); + ("assert cmpif expansion", fun _ -> Lwt.return (test_assert_cmp_if ())); + ("assert none expansion", fun _ -> Lwt.return (test_assert_none ())); + ("assert some expansion", fun _ -> Lwt.return (test_assert_some ())); + ("assert left expansion", fun _ -> Lwt.return (test_assert_left ())); + ("assert right expansion", fun _ -> Lwt.return (test_assert_right ())); + ( "assert some annot expansion", + fun _ -> Lwt.return (test_assert_some_annot ()) ); + ( "assert left annot expansion", + fun _ -> Lwt.return (test_assert_left_annot ()) ); + ( "assert right annot expansion", + fun _ -> Lwt.return (test_assert_right_annot ()) ); + (*syntactic conveniences*) + ("diip expansion", fun _ -> Lwt.return (test_diip ())); + ("duup expansion", fun _ -> Lwt.return (test_duup ())); + ("pair expansion", fun _ -> Lwt.return (test_pair ())); + ("pappaiir expansion", fun _ -> Lwt.return (test_pappaiir ())); + ("unpair expansion", fun _ -> Lwt.return (test_unpair ())); + ("caddadr expansion", fun _ -> Lwt.return (test_caddadr_expansion ())); + ( "carn and cdrn expansion", + fun _ -> Lwt.return (test_carn_cdrn_expansion ()) ); + ("if_some expansion", fun _ -> Lwt.return (test_if_some ())); + ("set_car expansion", fun _ -> Lwt.return (test_set_car_expansion ())); + ("set_cdr expansion", fun _ -> Lwt.return (test_set_cdr_expansion ())); + ("set_cadr expansion", fun _ -> Lwt.return (test_set_cadr_expansion ())); + ("set_cdar expansion", fun _ -> Lwt.return (test_set_cdar_expansion ())); + ("map_car expansion", fun _ -> Lwt.return (test_map_car ())); + ("map_cdr expansion", fun _ -> Lwt.return (test_map_cdr ())); + ("map_caadr expansion", fun _ -> Lwt.return (test_map_caadr ())); + ("map_cdadr expansion", fun _ -> Lwt.return (test_map_cdadr ())); + (*Unexpand*) + ("fail unexpansion", fun _ -> Lwt.return (test_unexpand_fail ())); + ("if_right unexpansion", fun _ -> Lwt.return (test_unexpand_if_right ())); + ("if_some unexpansion", fun _ -> Lwt.return (test_unexpand_if_some ())); + ("assert unexpansion", fun _ -> Lwt.return (test_unexpand_assert ())); + ("assert_if unexpansion", fun _ -> Lwt.return (test_unexpand_assert_if ())); + ( "assert_cmp_if unexpansion", + fun _ -> Lwt.return (test_unexpansion_assert_cmp_if ()) ); + ( "assert_none unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_none ()) ); + ( "assert_some unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_some ()) ); + ( "assert_left unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_left ()) ); + ( "assert_right unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_right ()) ); + ( "assert_some annot unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_some_annot ()) ); + ( "assert_left annot unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_left_annot ()) ); + ( "assert_right annot unexpansion", + fun _ -> Lwt.return (test_unexpand_assert_right_annot ()) ); + ("unpair unexpansion", fun _ -> Lwt.return (test_unexpand_unpair ())); + ("pair unexpansion", fun _ -> Lwt.return (test_unexpand_pair ())); + ("pappaiir unexpansion", fun _ -> Lwt.return (test_unexpand_pappaiir ())); + ("duup unexpansion", fun _ -> Lwt.return (test_unexpand_duup ())); + ("caddadr unexpansion", fun _ -> Lwt.return (test_unexpand_caddadr ())); + ( "carn and cdrn unexpansion", + fun _ -> Lwt.return (test_unexpand_carn_cdrn ()) ); + ("set_car unexpansion", fun _ -> Lwt.return (test_unexpand_set_car ())); + ("set_cdr unexpansion", fun _ -> Lwt.return (test_unexpand_set_cdr ())); + ("set_cdar unexpansion", fun _ -> Lwt.return (test_unexpand_set_cdar ())); + ("set_cadr unexpansion", fun _ -> Lwt.return (test_unexpand_set_cadr ())); + ( "set_car annot unexpansion", + fun _ -> Lwt.return (test_unexpand_set_car_annot ()) ); + ( "set_cdr annot unexpansion", + fun _ -> Lwt.return (test_unexpand_set_cdr_annot ()) ); + ("map_car unexpansion", fun _ -> Lwt.return (test_unexpand_map_car ())); + ("diip unexpansion", fun _ -> Lwt.return (test_unexpand_diip ())); + ("diip_duup1 unexpansion", fun _ -> Lwt.return (test_unexpand_diip_duup1 ())); + ("diip_duup2 unexpansion", fun _ -> Lwt.return (test_unexpand_diip_duup2 ())) + (***********************************************************************) + (*BUG + the function in Michelson_v1_macros.unexpand_map_caddadr + failed to test the case with the character "D". + It returns an empty {} for the expand *) + (*"diip unexpansion", (fun _ -> Lwt.return (test_unexpand_diip ())) ;*) + (*"map_cdr unexpansion", (fun _ -> Lwt.return (test_unexpand_map_cdr ())) ;*) + (*"map_caadr unexpansion", (fun _ -> Lwt.return (test_unexpand_map_caadr ())) ;*) + (*"map_cdadr unexpansion", (fun _ -> Lwt.return (test_unexpand_map_cdadr ())) ;*); + ] + +let wrap (n, f) = + Alcotest_lwt.test_case n `Quick (fun _ () -> + f () >>= function + | Ok () -> Lwt.return_unit + | Error error -> + Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) + +let () = + Alcotest_lwt.run + ~argv:[|""|] + "tezos-lib-client" + [("micheline v1 macros", List.map wrap tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml b/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml new file mode 100644 index 000000000000..9db20d29907e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Client + Invocation: dune build @src/proto_alpha/lib_client/runtest + Subject: Test of --mode proxy and tezos-proxy-server heuristic +*) + +let proxy_mode_gen = QCheck2.Gen.oneofl Tezos_proxy.Proxy.[Client; Server] + +let key_gen = + (* Segments taken from the implementation of split_key in src/proto_alpha/lib_client/proxy.ml *) + let keys = + QCheck2.Gen.oneofl + [ + "big_maps"; + "index"; + "contents"; + "contracts"; + "cycle"; + "cycle"; + "rolls"; + "owner"; + "snapshot"; + "v1"; + ] + |> QCheck2.Gen.list + in + QCheck2.Gen.frequency QCheck2.Gen.[(9, keys); (1, list string)] + +(** Whether [t1] is a prefix of [t2] *) +let rec is_prefix t1 t2 = + match (t1, t2) with + | [], _ -> true + | _, [] -> false + | x1 :: rest1, x2 :: rest2 when x1 = x2 -> is_prefix rest1 rest2 + | _ -> false + +let test_split_key = + let fmt = + let pp_sep fmt () = Format.fprintf fmt "/" in + Format.pp_print_list ~pp_sep Format.pp_print_string + in + QCheck2.Test.make + ~name:"[fst (split_key s)] is a prefix of [s]" + QCheck2.Gen.(pair proxy_mode_gen key_gen) + @@ fun (mode, key) -> + match Proxy.ProtoRpc.split_key mode key with + | None -> true + | Some (shorter, _) -> + if is_prefix shorter key then true + else + QCheck2.Test.fail_reportf + "Expected result of split_key to be a prefix of the input key. But \ + %a is not a prefix of %a." + fmt + shorter + fmt + key + +let () = + Alcotest.run + "tezos-lib-client-proxy" + [("proxy", Lib_test.Qcheck2_helpers.qcheck_wrap [test_split_key])] diff --git a/src/proto_016_PtMumbai/lib_client_commands/alpha_commands_registration.ml b/src/proto_016_PtMumbai/lib_client_commands/alpha_commands_registration.ml new file mode 100644 index 000000000000..500108e385c6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/alpha_commands_registration.ml @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let () = + Client_commands.register Protocol.hash @@ fun network -> + List.map (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + @@ Client_proto_programs_commands.commands () + @ Client_proto_contracts_commands.commands () + @ Client_proto_context_commands.commands network () + @ Client_proto_multisig_commands.commands () + @ Client_proto_mockup_commands.commands () + @ Client_sapling_commands.commands () + @ Client_proto_utils_commands.commands () + @ Client_proto_stresstest_commands.commands network () + @ Client_proto_fa12_commands.commands () diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_context_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_context_commands.ml new file mode 100644 index 000000000000..2e13b52de83d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_context_commands.ml @@ -0,0 +1,3788 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Client_proto_context +open Client_proto_contracts +open Client_proto_rollups +open Client_keys +open Client_proto_args + +let save_tx_rollup ~force (cctxt : #Client_context.full) alias_name rollup + ~origination_level = + let open Lwt_result_syntax in + let* () = + TxRollupAlias.add ~force cctxt alias_name {rollup; origination_level} + in + let*! () = cctxt#message "Transaction rollup memorized as %s" alias_name in + return_unit + +let save_zk_rollup ~force (cctxt : #Client_context.full) alias_name rollup = + let open Lwt_result_syntax in + let* () = EpoxyAlias.add ~force cctxt alias_name rollup in + let*! () = cctxt#message "Epoxy rollup memorized as %s" alias_name in + return_unit + +let encrypted_switch = + Tezos_clic.switch ~long:"encrypted" ~doc:"encrypt the key on-disk" () + +let normalize_types_switch = + Tezos_clic.switch + ~long:"normalize-types" + ~doc: + "Whether types should be normalized (annotations removed, combs \ + flattened) or kept as they appeared in the original script." + () + +let report_michelson_errors ?(no_print_source = false) ~msg + (cctxt : #Client_context.full) = + let open Lwt_syntax in + function + | Error errs -> + let* errs = + Michelson_v1_error_reporter.enrich_runtime_errors + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~parsed:None + errs + in + let* () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:(not no_print_source) + ~show_source:(not no_print_source) + ?parsed:None) + errs + in + let* () = cctxt#error "%s" msg in + return_none + | Ok data -> return_some data + +let block_hash_param = + Tezos_clic.parameter (fun _ s -> + try Lwt_result_syntax.return (Tezos_crypto.Block_hash.of_b58check_exn s) + with _ -> failwith "Parameter '%s' is an invalid block hash" s) + +let group = + { + Tezos_clic.name = "context"; + title = "Block contextual commands (see option -block)"; + } + +let alphanet = {Tezos_clic.name = "alphanet"; title = "Alphanet only commands"} + +let binary_description = + {Tezos_clic.name = "description"; title = "Binary Description"} + +let tez_of_string_exn index field s = + let open Lwt_result_syntax in + match Tez.of_string s with + | Some t -> return t + | None -> + failwith + "Invalid \xEA\x9C\xA9 notation at entry %i, field \"%s\": %s" + index + field + s + +let tez_of_opt_string_exn index field s = + Option.map_es (tez_of_string_exn index field) s + +let check_smart_contract = Managed_contract.check_smart_contract + +let commands_ro () = + let open Tezos_clic in + [ + command + ~group + ~desc:"Access the timestamp of the block." + (args1 + (switch ~doc:"output time in seconds" ~short:'s' ~long:"seconds" ())) + (fixed ["get"; "timestamp"]) + (fun seconds (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* {timestamp = v; _} = + Shell_services.Blocks.Header.shell_header + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + () + in + let*! () = + if seconds then cctxt#message "%Ld" (Time.Protocol.to_seconds v) + else cctxt#message "%s" (Time.Protocol.to_notation v) + in + return_unit); + command + ~group + ~desc:"Lists all non empty contracts of the block." + no_options + (fixed ["list"; "contracts"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* contracts = + list_contract_labels cctxt ~chain:cctxt#chain ~block:cctxt#block + in + let*! () = + List.iter_s + (fun (alias, hash, kind) -> cctxt#message "%s%s%s" hash kind alias) + contracts + in + return_unit); + command + ~group + ~desc:"Lists cached contracts and their age in LRU ordering." + no_options + (prefixes ["list"; "cached"; "contracts"] @@ stop) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* keys = + cached_contracts cctxt ~chain:cctxt#chain ~block:cctxt#block + in + let*! () = + List.iter_s + (fun (key, size) -> cctxt#message "%a %d" Contract_hash.pp key size) + keys + in + return_unit); + command + ~group + ~desc:"Get the key rank of a cache key." + no_options + (prefixes ["get"; "cached"; "contract"; "rank"; "for"] + @@ OriginatedContractAlias.destination_param ~name:"src" ~desc:"contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* rank = + contract_rank cctxt ~chain:cctxt#chain ~block:cctxt#block contract + in + let*! () = + match rank with + | None -> cctxt#error "Invalid contract: %a" Contract_hash.pp contract + | Some rank -> cctxt#message "%d" rank + in + return_unit); + command + ~group + ~desc:"Get cache contract size." + no_options + (prefixes ["get"; "cache"; "contract"; "size"] @@ stop) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* t = + contract_cache_size cctxt ~chain:cctxt#chain ~block:cctxt#block + in + let*! () = cctxt#message "%d" t in + return_unit); + command + ~group + ~desc:"Get cache contract size limit." + no_options + (prefixes ["get"; "cache"; "contract"; "size"; "limit"] @@ stop) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* t = + contract_cache_size_limit cctxt ~chain:cctxt#chain ~block:cctxt#block + in + let*! () = cctxt#message "%d" t in + return_unit); + command + ~group + ~desc:"Get the balance of a contract." + no_options + (prefixes ["get"; "balance"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* amount = + get_balance cctxt ~chain:cctxt#chain ~block:cctxt#block contract + in + let*! () = + cctxt#answer "%a %s" Tez.pp amount Operation_result.tez_sym + in + return_unit); + command + ~group + ~desc:"Get the storage of a contract." + (args1 (unparsing_mode_arg ~default:"Readable")) + (prefixes ["get"; "contract"; "storage"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun unparsing_mode contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* v = + get_storage + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~unparsing_mode + contract + in + check_smart_contract cctxt v @@ fun storage -> + let*! () = + cctxt#answer "%a" Michelson_v1_printer.print_expr_unwrapped storage + in + return_unit); + command + ~group + ~desc:"Get the used storage space of a contract." + no_options + (prefixes ["get"; "contract"; "used"; "storage"; "space"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* used_space = + get_used_storage_space + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + in + check_smart_contract cctxt used_space @@ fun used_space -> + let*! () = cctxt#answer "%a" Z.pp_print used_space in + return_unit); + command + ~group + ~desc:"Get the paid storage space of a contract." + no_options + (prefixes ["get"; "contract"; "paid"; "storage"; "space"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* paid_space = + get_paid_storage_space + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + in + check_smart_contract cctxt paid_space @@ fun paid_space -> + let*! () = cctxt#answer "%a" Z.pp_print paid_space in + return_unit); + command + ~group + ~desc: + "Get the value associated to a key in the big map storage of a \ + contract (deprecated)." + no_options + (prefixes ["get"; "big"; "map"; "value"; "for"] + @@ Tezos_clic.param ~name:"key" ~desc:"the key to look for" data_parameter + @@ prefixes ["of"; "type"] + @@ Tezos_clic.param ~name:"type" ~desc:"type of the key" data_parameter + @@ prefix "in" + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun () key key_type contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* v = + get_contract_big_map_value + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + (key.expanded, key_type.expanded) + in + match v with + | None -> cctxt#error "No value associated to this key." + | Some value -> + let*! () = + cctxt#answer "%a" Michelson_v1_printer.print_expr_unwrapped value + in + return_unit); + command + ~group + ~desc:"Get a value in a big map." + (args1 (unparsing_mode_arg ~default:"Readable")) + (prefixes ["get"; "element"] + @@ Tezos_clic.param + ~name:"key" + ~desc:"the key to look for" + (Tezos_clic.parameter (fun _ s -> + Lwt_result_syntax.return (Script_expr_hash.of_b58check_exn s))) + @@ prefixes ["of"; "big"; "map"] + @@ Tezos_clic.param + ~name:"big_map" + ~desc:"identifier of the big_map" + int_parameter + @@ stop) + (fun unparsing_mode key id (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* value = + get_big_map_value + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~unparsing_mode + (Big_map.Id.parse_z (Z.of_int id)) + key + in + let*! () = + cctxt#answer "%a" Michelson_v1_printer.print_expr_unwrapped value + in + return_unit); + command + ~group + ~desc:"Get the code of a contract." + (args2 (unparsing_mode_arg ~default:"Readable") normalize_types_switch) + (prefixes ["get"; "contract"; "code"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun (unparsing_mode, normalize_types) + contract + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* v = + get_script + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~unparsing_mode + ~normalize_types + contract + in + check_smart_contract cctxt v @@ fun {code; storage = _} -> + match Script_repr.force_decode code with + | Error errs -> cctxt#error "%a" Environment.Error_monad.pp_trace errs + | Ok code -> + let {Michelson_v1_parser.source; _} = + Michelson_v1_printer.unparse_toplevel code + in + let*! () = cctxt#answer "%s" source in + return_unit); + command + ~group + ~desc:"Get the `BLAKE2B` script hash of a contract." + no_options + (prefixes ["get"; "contract"; "script"; "hash"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_syntax in + let* r = + get_script_hash cctxt ~chain:cctxt#chain ~block:cctxt#block contract + in + match r with + | Error errs -> cctxt#error "%a" pp_print_trace errs + | Ok hash -> + check_smart_contract cctxt hash @@ fun hash -> + let* () = cctxt#answer "%a" Script_expr_hash.pp hash in + return_ok_unit); + command + ~group + ~desc:"Get the type of an entrypoint of a contract." + (args1 normalize_types_switch) + (prefixes ["get"; "contract"; "entrypoint"; "type"; "of"] + @@ Tezos_clic.param + ~name:"entrypoint" + ~desc:"the entrypoint to describe" + entrypoint_parameter + @@ prefixes ["for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun normalize_types + entrypoint + contract + (cctxt : Protocol_client_context.full) -> + let open Lwt_syntax in + let* t = + Michelson_v1_entrypoints.contract_entrypoint_type + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~entrypoint + ~normalize_types + in + Michelson_v1_entrypoints.print_entrypoint_type + cctxt + ~emacs:false + ~contract + ~entrypoint + t); + command + ~group + ~desc:"Get the entrypoint list of a contract." + (args1 normalize_types_switch) + (prefixes ["get"; "contract"; "entrypoints"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun normalize_types contract (cctxt : Protocol_client_context.full) -> + let open Lwt_syntax in + let* es = + Michelson_v1_entrypoints.list_contract_entrypoints + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~normalize_types + in + Michelson_v1_entrypoints.print_entrypoints_list + cctxt + ~emacs:false + ~contract + es); + command + ~group + ~desc:"Get the list of unreachable paths in a contract's parameter type." + no_options + (prefixes ["get"; "contract"; "unreachable"; "paths"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_syntax in + let* u = + Michelson_v1_entrypoints.list_contract_unreachables + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + in + Michelson_v1_entrypoints.print_unreachables + cctxt + ~emacs:false + ~contract + u); + command + ~group + ~desc:"Get the delegate of a contract." + no_options + (prefixes ["get"; "delegate"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* v = + Client_proto_contracts.get_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + in + match v with + | None -> + let*! () = cctxt#message "none" in + return_unit + | Some delegate -> + let* mn = Public_key_hash.rev_find cctxt delegate in + let* m = Public_key_hash.to_source delegate in + let*! () = + cctxt#message + "%s (%s)" + m + (match mn with None -> "unknown" | Some n -> "known as " ^ n) + in + return_unit); + command + ~group + ~desc: + "Get contract's balance of ticket with specified ticketer, content \ + type, and content." + no_options + (prefixes ["get"; "ticket"; "balance"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"Source contract." + @@ prefixes ["with"; "ticketer"] + @@ ContractAlias.destination_param + ~name:"ticketer" + ~desc:"Ticketer contract of the ticket." + @@ prefixes ["and"; "type"] + @@ Tezos_clic.param + ~name:"ticket content type" + ~desc:"Type of the content of the ticket." + data_parameter + @@ prefixes ["and"; "content"] + @@ Tezos_clic.param + ~name:"ticket content" + ~desc:"Content of the ticket." + data_parameter + @@ stop) + (fun () contract ticketer content_type content cctxt -> + let open Lwt_result_syntax in + let* balance = + get_contract_ticket_balance + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + Ticket_token. + { + ticketer; + contents_type = content_type.expanded; + contents = content.expanded; + } + in + let*! () = cctxt#answer "%a" Z.pp_print balance in + return_unit); + command + ~group + ~desc:"Get the complete list of tickets owned by a given contract." + no_options + (prefixes ["get"; "all"; "ticket"; "balances"; "for"] + @@ OriginatedContractAlias.destination_param + ~name:"src" + ~desc:"Source contract." + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* ticket_balances = + get_contract_all_ticket_balances + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + contract + in + let pp_ticket_balance ppf + (Ticket_token.{ticketer; contents_type; contents}, amount) = + Format.fprintf + ppf + "@[<v 0>Ticketer: %a@,Content type: %a@,Content: %a@,Amount: %a@]" + Contract.pp + ticketer + Michelson_v1_printer.print_expr + contents_type + Michelson_v1_printer.print_expr + contents + Z.pp_print + amount + in + let*! () = + cctxt#answer + "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@.@.") + pp_ticket_balance) + ticket_balances + in + return_unit); + command + ~desc:"Get receipt for past operation" + (args1 + (default_arg + ~long:"check-previous" + ~placeholder:"num_blocks" + ~doc:"number of previous blocks to check" + ~default:"10" + non_negative_parameter)) + (prefixes ["get"; "receipt"; "for"] + @@ param + ~name:"operation" + ~desc:"Operation to be looked up" + (parameter (fun _ x -> + match Tezos_crypto.Operation_hash.of_b58check_opt x with + | None -> Error_monad.failwith "Invalid operation hash: '%s'" x + | Some hash -> Lwt_result_syntax.return hash)) + @@ stop) + (fun predecessors operation_hash (ctxt : Protocol_client_context.full) -> + display_receipt_for_operation + ctxt + ~chain:ctxt#chain + ~predecessors + operation_hash); + command + ~group + ~desc:"Summarize the current voting period" + no_options + (fixed ["show"; "voting"; "period"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* info = + get_period_info ~chain:cctxt#chain ~block:cctxt#block cctxt + in + let*! () = + cctxt#message + "Current period: %a\nBlocks remaining until end of period: %ld" + Data_encoding.Json.pp + (Data_encoding.Json.construct + Alpha_context.Voting_period.kind_encoding + info.current_period_kind) + info.remaining + in + let* known_protos = Shell_services.Protocol.list cctxt in + let* props = + get_proposals ~chain:cctxt#chain ~block:cctxt#block cctxt + in + let ranks = + Environment.Protocol_hash.Map.bindings props + |> List.sort (fun (_, v1) (_, v2) -> Int64.(compare v2 v1)) + in + let print_proposal = function + | None -> + cctxt#message "The current proposal has already been cleared." + (* The proposal is cleared on the last block of adoption period, and + also on the last block of the exploration and promotion + periods when the proposal is not approved *) + | Some proposal -> + cctxt#message + "Current proposal: %a" + Tezos_crypto.Protocol_hash.pp + proposal + in + match info.current_period_kind with + | Proposal -> + (* the current proposals are cleared on the last block of the + proposal period *) + let*! () = + if info.remaining <> 0l then + cctxt#answer + "Current proposals:%t" + Format.( + fun ppf -> + pp_print_cut ppf () ; + pp_open_vbox ppf 0 ; + List.iter + (fun (p, w) -> + fprintf + ppf + "* %a %a %s (%sknown by the node)@." + Tezos_crypto.Protocol_hash.pp + p + Tez.pp + (Tez.of_mutez_exn w) + Operation_result.tez_sym + (if + List.mem + ~equal:Tezos_crypto.Protocol_hash.equal + p + known_protos + then "" + else "not ")) + ranks ; + pp_close_box ppf ()) + else cctxt#message "The proposals have already been cleared." + in + return_unit + | Exploration | Promotion -> + let*! () = print_proposal info.current_proposal in + (* the ballots are cleared on the last block of these periods *) + if info.remaining <> 0l then + let* ballots_info = + get_ballots_info ~chain:cctxt#chain ~block:cctxt#block cctxt + in + let*! () = + cctxt#answer + "@[<v>Ballots:@,\ + \ Yay: %a %s@,\ + \ Nay: %a %s@,\ + \ Pass: %a %s@,\ + Current participation %.2f%%, necessary quorum %.2f%%@,\ + Current in favor %a %s, needed supermajority %a %s@]" + Tez.pp + (Tez.of_mutez_exn ballots_info.ballots.yay) + Operation_result.tez_sym + Tez.pp + (Tez.of_mutez_exn ballots_info.ballots.nay) + Operation_result.tez_sym + Tez.pp + (Tez.of_mutez_exn ballots_info.ballots.pass) + Operation_result.tez_sym + (Int32.to_float ballots_info.participation /. 100.) + (Int32.to_float ballots_info.current_quorum /. 100.) + Tez.pp + (Tez.of_mutez_exn ballots_info.ballots.yay) + Operation_result.tez_sym + Tez.pp + (Tez.of_mutez_exn ballots_info.supermajority) + Operation_result.tez_sym + in + return_unit + else + let*! () = + cctxt#message "The ballots have already been cleared." + in + return_unit + | Cooldown -> + let*! () = print_proposal info.current_proposal in + return_unit + | Adoption -> + let*! () = print_proposal info.current_proposal in + return_unit); + command + ~group:binary_description + ~desc:"Describe unsigned block header" + no_options + (fixed ["describe"; "unsigned"; "block"; "header"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*! () = + cctxt#message + "%a" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe + Alpha_context.Block_header.unsigned_encoding) + in + return_unit); + command + ~group:binary_description + ~desc:"Describe unsigned operation" + no_options + (fixed ["describe"; "unsigned"; "operation"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*! () = + cctxt#message + "%a" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe + Alpha_context.Operation.unsigned_encoding) + in + return_unit); + command + ~group + ~desc:"Get the frozen deposits limit of a delegate." + no_options + (prefixes ["get"; "deposits"; "limit"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source delegate" + @@ stop) + (fun () contract (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match contract with + | Originated _ -> + cctxt#error + "Cannot change deposits limit on contract %a. This operation is \ + invalid on originated contracts." + Contract.pp + contract + | Implicit delegate -> + let* o = + get_frozen_deposits_limit + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + delegate + in + let*! () = + match o with + | None -> cctxt#answer "unlimited" + | Some limit -> + cctxt#answer "%a %s" Tez.pp limit Operation_result.tez_sym + in + return_unit); + ] + +(* ----------------------------------------------------------------------------*) +(* After the activation of a new version of the protocol, the older protocols + are only kept in the code base to replay the history of the chain and to query + old states. + + The commands that are not useful anymore in the old protocols are removed, + this is called protocol freezing. The commands below are those that can be + removed during protocol freezing. + + The rule of thumb to know if a command should be kept at freezing is that all + commands that modify the state of the chain should be removed and conversely + all commands that are used to query the context should be kept. For this + reason, we call read-only (or RO for short) the commands that are kept and + read-write (or RW for short) the commands that are removed. + + There are some exceptions to this rule however, for example the command + "octez-client wait for <op> to be included" is classified as RW despite having + no effect on the context because it has no use case once all RW commands are + removed. + + Keeping this in mind, the developer should decide where to add a new command. + At the end of the file, RO and RW commands are concatenated into one list that + is then exported in the mli file. *) +(* ----------------------------------------------------------------------------*) + +let dry_run_switch = + Tezos_clic.switch + ~long:"dry-run" + ~short:'D' + ~doc:"don't inject the operation, just display it" + () + +let verbose_signing_switch = + Tezos_clic.switch + ~long:"verbose-signing" + ~doc:"display extra information before signing the operation" + () + +let simulate_switch = + Tezos_clic.switch + ~long:"simulation" + ~doc: + "Simulate the execution of the command, without needing any signatures." + () + +let force_switch = + Tezos_clic.switch + ~long:"force" + ~doc: + "Inject the operation even if the simulation results in a failure. This \ + switch requires --gas-limit, --storage-limit, and --fee." + () + +let transfer_command amount (source : Contract.t) destination + (cctxt : #Client_context.printer) + ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees, + successor_level ) = + let open Lwt_result_syntax in + (* When --force is used we want to inject the transfer even if it fails. + In that case we cannot rely on simulation to compute limits and fees + so we require the corresponding options to be set. *) + let check_force_dependency name = function + | None -> + cctxt#error + "When the --force switch is used, the %s option is required." + name + | _ -> Lwt.return_unit + in + let*! () = + if force && not simulation then + let*! () = check_force_dependency "--gas-limit" gas_limit in + let*! () = check_force_dependency "--storage-limit" storage_limit in + check_force_dependency "--fee" fee + else Lwt.return_unit + in + let*! r = + match source with + | Originated contract_hash -> + let contract = source in + let* source = + Managed_contract.get_contract_manager cctxt contract_hash + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + Managed_contract.transfer + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~force + ~fee_parameter + ?fee + ~contract + ~source + ~src_pk + ~src_sk + ~destination + ?entrypoint + ?arg + ~amount + ?gas_limit + ?storage_limit + ?counter + () + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + transfer + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~simulation + ~force + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~destination + ?entrypoint + ?arg + ~amount + ?gas_limit + ?storage_limit + ?counter + ~replace_by_fees + ~successor_level + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + r + in + return_unit + +let prepare_batch_operation cctxt ?arg ?fee ?gas_limit ?storage_limit + ?entrypoint (source : Contract.t) index batch = + let open Lwt_result_syntax in + let* destination = + Client_proto_contracts.ContractAlias.find_destination + cctxt + batch.destination + in + let* amount = tez_of_string_exn index "amount" batch.amount in + let* batch_fee = tez_of_opt_string_exn index "fee" batch.fee in + let fee = Option.either batch_fee fee in + let arg = Option.either batch.arg arg in + let gas_limit = Option.either batch.gas_limit gas_limit in + let storage_limit = Option.either batch.storage_limit storage_limit in + let entrypoint = Option.either batch.entrypoint entrypoint in + let* parameters = parse_arg_transfer arg in + let* operation = + match source with + | Originated _ -> + Managed_contract.build_transaction_operation + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract:source + ~destination + ?entrypoint + ?arg + ~amount + ?fee + ?gas_limit + ?storage_limit + () + | Implicit _ -> + return + (build_transaction_operation + ~amount + ~parameters + ?entrypoint + ?fee + ?gas_limit + ?storage_limit + destination) + in + return (Annotated_manager_operation.Annotated_manager_operation operation) + +let commands_network network () = + let open Tezos_clic in + match network with + | Some `Testnet | None -> + [ + command + ~group + ~desc:"Register and activate an Alphanet/Zeronet faucet account." + (args2 (Secret_key.force_switch ()) encrypted_switch) + (prefixes ["activate"; "account"] + @@ Secret_key.fresh_alias_param @@ prefixes ["with"] + @@ param + ~name:"activation_key" + ~desc: + "Activate an Alphanet/Zeronet faucet account from the JSON \ + (file or directly inlined)." + json_parameter + @@ stop) + (fun (force, encrypted) name activation_json cctxt -> + let open Lwt_result_syntax in + let* name = Secret_key.of_fresh cctxt force name in + match + Data_encoding.Json.destruct + Client_proto_context.activation_key_encoding + activation_json + with + | exception (Data_encoding.Json.Cannot_destruct _ as exn) -> + Format.kasprintf + (fun s -> failwith "%s" s) + "Invalid activation file: %a %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn + Data_encoding.Json.pp + activation_json + | key -> + let* _res = + activate_account + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~encrypted + ~force + key + name + in + return_unit); + ] + | Some `Mainnet -> + [ + command + ~group + ~desc:"Activate a fundraiser account." + (args1 dry_run_switch) + (prefixes ["activate"; "fundraiser"; "account"] + @@ Public_key_hash.alias_param @@ prefixes ["with"] + @@ param + ~name:"code" + (Tezos_clic.parameter (fun _ctx code -> + match + Blinded_public_key_hash.activation_code_of_hex code + with + | Some c -> Lwt_result_syntax.return c + | None -> failwith "Hexadecimal parsing failure")) + ~desc:"Activation code obtained from the Tezos foundation." + @@ stop) + (fun dry_run (name, _pkh) code cctxt -> + let open Lwt_result_syntax in + let* _res = + activate_existing_account + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + name + code + in + return_unit); + ] + +let commands_rw () = + let open Client_proto_programs in + let open Tezos_micheline in + let open Tezos_clic in + [ + command + ~group + ~desc:"Set the delegate of a contract." + (args5 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args) + (prefixes ["set"; "delegate"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ prefix "to" + @@ Public_key_hash.source_param + ~name:"dlgt" + ~desc:"new delegate of the contract" + @@ stop) + (fun (fee, dry_run, verbose_signing, simulation, fee_parameter) + contract + delegate + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match contract with + | Originated contract -> + let* source = + Managed_contract.get_contract_manager cctxt contract + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Managed_contract.set_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~fee_parameter + ?fee + ~source + ~src_pk + ~src_sk + contract + (Some delegate) + in + let*! (_ : + (Tezos_crypto.Operation_hash.t + * _ contents + * _ Apply_results.contents_result) + option) = + report_michelson_errors + ~no_print_source:true + ~msg:"Setting delegate through entrypoints failed." + cctxt + errors + in + return_unit + | Implicit mgr -> + let* _, src_pk, manager_sk = Client_keys.get_key cctxt mgr in + let* (_ : _ Injection.result) = + set_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~fee_parameter + ?fee + mgr + (Some delegate) + ~src_pk + ~manager_sk + in + return_unit); + command + ~group + ~desc:"Withdraw the delegate from a contract." + (args4 fee_arg dry_run_switch verbose_signing_switch fee_parameter_args) + (prefixes ["withdraw"; "delegate"; "from"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ stop) + (fun (fee, dry_run, verbose_signing, fee_parameter) + contract + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match contract with + | Originated contract -> + let* source = + Managed_contract.get_contract_manager cctxt contract + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Managed_contract.set_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ?fee + ~source + ~src_pk + ~src_sk + contract + None + in + let*! (_ : _ Injection.result option) = + report_michelson_errors + ~no_print_source:true + ~msg:"Withdrawing delegate through entrypoints failed." + cctxt + errors + in + return_unit + | Implicit mgr -> + let* _, src_pk, manager_sk = Client_keys.get_key cctxt mgr in + let*! (_ : _ Injection.result tzresult) = + set_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + mgr + None + ?fee + ~src_pk + ~manager_sk + in + return_unit); + command + ~group + ~desc:"Launch a smart contract on the blockchain." + (args10 + fee_arg + dry_run_switch + verbose_signing_switch + gas_limit_arg + storage_limit_arg + delegate_arg + (Client_keys.force_switch ()) + init_arg + no_print_source_flag + fee_parameter_args) + (prefixes ["originate"; "contract"] + @@ RawContractAlias.fresh_alias_param + ~name:"new" + ~desc:"name of the new contract" + @@ prefix "transferring" + @@ tez_param ~name:"qty" ~desc:"amount taken from source" + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "running" + @@ Program.source_param + ~name:"prg" + ~desc: + "script of the account\n\ + Combine with -init if the storage type is not unit." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + delegate, + force, + initial_storage, + no_print_source, + fee_parameter ) + alias_name + balance + source + program + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* alias_name = RawContractAlias.of_fresh cctxt force alias_name in + let* {expanded = code; _} = + Lwt.return (Micheline_parser.no_parsing_error program) + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + originate_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ?gas_limit + ?storage_limit + ~delegate + ~initial_storage + ~balance + ~source + ~src_pk + ~src_sk + ~code + ~fee_parameter + () + in + let*! o = + report_michelson_errors + ~no_print_source + ~msg:"origination simulation failed" + cctxt + errors + in + match o with + | None -> return_unit + | Some (_res, contract) -> + if dry_run then return_unit + else save_contract ~force cctxt alias_name contract); + command + ~group + ~desc: + "Execute multiple transfers from a single source account.\n\ + If one of the transfers fails, none of them get executed." + (args13 + default_fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + force_switch + default_gas_limit_arg + default_storage_limit_arg + counter_arg + default_arg_arg + no_print_source_flag + fee_parameter_args + default_entrypoint_arg + replace_by_fees_arg) + (prefixes ["multiple"; "transfers"; "from"] + @@ ContractAlias.destination_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "using" + @@ param + ~name:"transfers.json" + ~desc: + "List of operations originating from the source contract in JSON \ + format (from a file or directly inlined). The input JSON must be \ + an array of objects of the form: '[ {\"destination\": dst, \ + \"amount\": qty (, <field>: <val> ...) } (, ...) ]', where an \ + optional <field> can either be \"fee\", \"gas-limit\", \ + \"storage-limit\", \"arg\", or \"entrypoint\"." + json_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees ) + source + operations_json + cctxt -> + (* When --force is used we want to inject the transfer even if it fails. + In that case we cannot rely on simulation to compute limits and fees + so we require the corresponding options to be set. *) + let open Lwt_result_syntax in + let check_force_dependency name = function + | None -> + cctxt#error + "When the --force switch is used, the %s option is required." + name + | _ -> Lwt.return_unit + in + let*! () = + if force && not simulation then + let*! () = check_force_dependency "--gas-limit" gas_limit in + let*! () = check_force_dependency "--storage-limit" storage_limit in + check_force_dependency "--fee" fee + else Lwt.return_unit + in + let prepare i = + prepare_batch_operation + cctxt + ?arg + ?fee + ?gas_limit + ?storage_limit + ?entrypoint + source + i + in + match + Data_encoding.Json.destruct + (Data_encoding.list + Client_proto_context.batch_transfer_operation_encoding) + operations_json + with + | [] -> failwith "Empty operation list" + | operations -> + let* source = + match source with + | Originated contract -> + Managed_contract.get_contract_manager cctxt contract + | Implicit source -> return source + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* contents = List.mapi_ep prepare operations in + let (Manager_list contents) = + Annotated_manager_operation.manager_of_list contents + in + let*! errors = + Injection.inject_manager_operation + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~force + ~source + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ?counter + ~src_pk + ~src_sk + ~replace_by_fees + ~fee_parameter + contents + in + let*! (_ : + (Tezos_crypto.Operation_hash.t + * packed_operation + * _ contents_list + * _ Apply_results.contents_result_list) + option) = + report_michelson_errors + ~no_print_source + ~msg:"multiple transfers simulation failed" + cctxt + errors + in + return_unit + | exception (Data_encoding.Json.Cannot_destruct (path, exn2) as exn) + -> ( + match (path, operations_json) with + | [`Index n], `A lj -> ( + match List.nth_opt lj n with + | Some j -> + failwith + "Invalid transfer at index %i: %a %a" + n + (fun ppf -> Data_encoding.Json.print_error ppf) + exn2 + Data_encoding.Json.pp + j + | _ -> + failwith + "Invalid transfer at index %i: %a" + n + (fun ppf -> Data_encoding.Json.print_error ppf) + exn2) + | _ -> + failwith + "Invalid transfer file: %a %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn + Data_encoding.Json.pp + operations_json)); + command + ~group + ~desc:"Execute an Epoxy origination operation.\n" + (args13 + force_switch + default_fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + default_gas_limit_arg + default_storage_limit_arg + counter_arg + default_arg_arg + no_print_source_flag + fee_parameter_args + default_entrypoint_arg + replace_by_fees_arg) + (prefixes ["originate"; "epoxy"] + @@ EpoxyAlias.fresh_alias_param + ~name:"epoxy" + ~desc:"Fresh name for an Epoxy rollup" + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "public_parameters" + @@ param + ~name:"public_parameters" + ~desc:"public_parameters" + Zk_rollup_params.plonk_public_parameters_parameter + @@ prefix "init_state" + @@ param + ~name:"init_state" + ~desc:"init_state" + Zk_rollup_params.state_parameter + @@ prefix "circuits_info" + @@ param + ~name:"circuits_info" + ~desc:"circuits_info" + Zk_rollup_params.circuits_info_parameter + @@ prefix "nb_ops" + @@ param ~name:"nb_ops" ~desc:"nb_ops" int_parameter + @@ stop) + (fun ( force, + fee, + dry_run, + verbose_signing, + simulation, + gas_limit, + storage_limit, + counter, + _arg, + _no_print_source, + fee_parameter, + _entrypoint, + _replace_by_fees ) + alias + source + public_parameters + init_state + circuits_info + nb_ops + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _, _, res = + zk_rollup_originate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?gas_limit + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~public_parameters + ~circuits_info + ~init_state + ~nb_ops + () + in + let*? res = + match res with + | Apply_results.Manager_operation_result + { + operation_result = + Apply_operation_result.Applied + (Apply_results.Zk_rollup_origination_result + {originated_zk_rollup; _}); + _; + } -> + Ok originated_zk_rollup + | _ -> error_with "Epoxy rollup was not correctly originated" + in + let* alias_name = EpoxyAlias.of_fresh cctxt force alias in + save_zk_rollup ~force cctxt alias_name res); + command + ~group + ~desc:"Execute an Epoxy publish operation.\n" + (args12 + default_fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + default_gas_limit_arg + default_storage_limit_arg + counter_arg + default_arg_arg + no_print_source_flag + fee_parameter_args + default_entrypoint_arg + replace_by_fees_arg) + (prefixes ["epoxy"; "publish"; "from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "rollup" + @@ param ~name:"rollup" ~desc:"rollup" Zk_rollup_params.address_parameter + @@ prefix "ops" + @@ param ~name:"ops" ~desc:"ops" Zk_rollup_params.operations_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + gas_limit, + storage_limit, + counter, + _arg, + _no_print_source, + fee_parameter, + _entrypoint, + _replace_by_fees ) + source + zk_rollup + ops + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + zk_rollup_publish + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?gas_limit + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~zk_rollup + ~ops + () + in + return_unit); + command + ~group + ~desc:"Execute an Epoxy update operation.\n" + (args12 + default_fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + default_gas_limit_arg + default_storage_limit_arg + counter_arg + default_arg_arg + no_print_source_flag + fee_parameter_args + default_entrypoint_arg + replace_by_fees_arg) + (prefixes ["epoxy"; "update"; "from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "rollup" + @@ param ~name:"rollup" ~desc:"rollup" Zk_rollup_params.address_parameter + @@ prefix "update" + @@ param ~name:"update" ~desc:"update" Zk_rollup_params.update_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + gas_limit, + storage_limit, + counter, + _arg, + _no_print_source, + fee_parameter, + _entrypoint, + _replace_by_fees ) + source + zk_rollup + update + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + zk_rollup_update + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?gas_limit + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~zk_rollup + ~update + () + in + return_unit); + command + ~group + ~desc:"Transfer tokens / call a smart contract." + (args14 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + force_switch + gas_limit_arg + storage_limit_arg + counter_arg + arg_arg + no_print_source_flag + fee_parameter_args + entrypoint_arg + replace_by_fees_arg + successor_level_arg) + (prefixes ["transfer"] + @@ tez_param ~name:"qty" ~desc:"amount taken from source" + @@ prefix "from" + @@ ContractAlias.destination_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefix "to" + @@ ContractAlias.destination_param + ~name:"dst" + ~desc:"name/literal of the destination contract" + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees, + successor_level ) + amount + source + destination + cctxt -> + transfer_command + amount + source + destination + cctxt + ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees, + successor_level )); + command + ~group + ~desc:"Register a global constant" + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["register"; "global"; "constant"] + @@ global_constant_param + ~name:"expression" + ~desc: + "Michelson expression to register. Note the value is not \ + typechecked before registration." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the account registering the global constant" + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + global_constant_str + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + register_global_constant + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~constant:global_constant_str + () + in + let*! (_ : _ Injection.result option) = + report_michelson_errors + ~no_print_source:false + ~msg:"register global constant simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Call a smart contract (same as 'transfer 0')." + (args14 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + force_switch + gas_limit_arg + storage_limit_arg + counter_arg + arg_arg + no_print_source_flag + fee_parameter_args + entrypoint_arg + replace_by_fees_arg + successor_level_arg) + (prefixes ["call"] + @@ ContractAlias.destination_param + ~name:"dst" + ~desc:"name/literal of the destination contract" + @@ prefix "from" + @@ ContractAlias.destination_param + ~name:"src" + ~desc:"name of the source contract" + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees, + successor_level ) + destination + source + cctxt -> + let amount = Tez.zero in + transfer_command + amount + source + destination + cctxt + ( fee, + dry_run, + verbose_signing, + simulation, + force, + gas_limit, + storage_limit, + counter, + arg, + no_print_source, + fee_parameter, + entrypoint, + replace_by_fees, + successor_level )); + command + ~group + ~desc:"Reveal the public key of the contract manager." + (args4 fee_arg dry_run_switch verbose_signing_switch fee_parameter_args) + (prefixes ["reveal"; "key"; "for"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the source contract" + @@ stop) + (fun (fee, dry_run, verbose_signing, fee_parameter) source cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + reveal + cctxt + ~dry_run + ~verbose_signing + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~source + ?fee + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"Register the public key hash as a delegate." + (args4 fee_arg dry_run_switch verbose_signing_switch fee_parameter_args) + (prefixes ["register"; "key"] + @@ Public_key_hash.source_param ~name:"mgr" ~desc:"the delegate key" + @@ prefixes ["as"; "delegate"] + @@ stop) + (fun (fee, dry_run, verbose_signing, fee_parameter) src_pkh cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt src_pkh in + let*! r = + register_as_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~fee_parameter + ~verbose_signing + ?fee + ~manager_sk:src_sk + src_pk + in + match r with + | Ok _ -> return_unit + | Error + [ + Environment.Ecoproto_error + Delegate_storage.Contract.Active_delegate; + ] -> + let*! () = cctxt#message "Delegate already activated." in + return_unit + | Error el -> Lwt.return_error el); + command + ~group + ~desc:"Register the public key hash as a delegate." + (args4 fee_arg dry_run_switch verbose_signing_switch fee_parameter_args) + (prefixes ["register"; "key"] + @@ Public_key_hash.source_param ~name:"mgr" ~desc:"the delegate key" + @@ prefixes ["as"; "delegate"; "with"; "consensus"; "key"] + @@ Public_key.source_param ~name:"key" ~desc:"the consensus key" + @@ stop) + (fun (fee, dry_run, verbose_signing, fee_parameter) + src_pkh + (name_pk, consensus_pk) + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt src_pkh in + let* consensus_pk = + match consensus_pk with + | Some pk -> return pk + | None -> Client_keys.public_key name_pk + in + let*! r = + register_as_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~fee_parameter + ~verbose_signing + ?fee + ~manager_sk:src_sk + ~consensus_pk + src_pk + in + match r with + | Ok _ -> return_unit + | Error + [ + Environment.Ecoproto_error + Delegate_storage.Contract.Active_delegate; + ] -> + let*! () = cctxt#message "Delegate already activated." in + return_unit + | Error el -> Lwt.return_error el); + command + ~group + ~desc:"Update the consensus key of a delegate." + (args4 fee_arg dry_run_switch verbose_signing_switch fee_parameter_args) + (prefixes ["set"; "consensus"; "key"; "for"] + @@ Public_key_hash.source_param ~name:"mgr" ~desc:"the delegate key" + @@ prefixes ["to"] + @@ Public_key.source_param ~name:"key" ~desc:"the consensus key" + @@ stop) + (fun (fee, dry_run, verbose_signing, fee_parameter) + delegate_pkh + (name_pk, consensus_pk) + cctxt -> + let open Lwt_result_syntax in + let* _, delegate_pk, delegate_sk = + Client_keys.get_key cctxt delegate_pkh + in + let* consensus_pk = + match consensus_pk with + | Some pk -> return pk + | None -> Client_keys.public_key name_pk + in + let*! r = + update_consensus_key + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~fee_parameter + ~verbose_signing + ?fee + ~consensus_pk + ~manager_sk:delegate_sk + delegate_pk + in + match r with Ok _ -> return_unit | Error el -> Lwt.return_error el); + command + ~group + ~desc:"Drain all funds from a delegate." + (args2 dry_run_switch verbose_signing_switch) + (prefixes ["drain"; "delegate"] + @@ Public_key_hash.source_param ~name:"mgr" ~desc:"the delegate key" + @@ prefixes ["to"] + @@ Public_key_hash.source_param ~name:"dest" ~desc:"the consensus key" + @@ stop) + (fun (dry_run, verbose_signing) delegate_pkh consensus_pkh cctxt -> + let open Lwt_result_syntax in + let* _, _consensus_pk, consensus_sk = + Client_keys.get_key cctxt consensus_pkh + in + let*! r = + drain_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~consensus_pkh + ~consensus_sk + ~delegate:delegate_pkh + () + in + match r with Ok _ -> return_unit | Error el -> Lwt.return_error el); + command + ~group + ~desc:"Drain all funds from a delegate." + (args2 dry_run_switch verbose_signing_switch) + (prefixes ["drain"; "delegate"] + @@ Public_key_hash.source_param ~name:"mgr" ~desc:"the delegate key" + @@ prefixes ["to"] + @@ Public_key_hash.source_param ~name:"dest" ~desc:"the destination key" + @@ prefixes ["with"] + @@ Public_key_hash.source_param + ~name:"consensus_key" + ~desc:"the consensus key" + @@ stop) + (fun (dry_run, verbose_signing) + delegate_pkh + destination_pkh + consensus_pkh + cctxt -> + let open Lwt_result_syntax in + let* _, _consensus_pk, consensus_sk = + Client_keys.get_key cctxt consensus_pkh + in + let*! r = + drain_delegate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~consensus_pkh + ~consensus_sk + ~destination:destination_pkh + ~delegate:delegate_pkh + () + in + match r with Ok _ -> return_unit | Error el -> Lwt.return_error el); + command + ~desc:"Wait until an operation is included in a block" + (args3 + (default_arg + ~long:"confirmations" + ~placeholder:"num_blocks" + ~doc: + "wait until 'N' additional blocks after the operation appears in \ + the considered chain" + ~default:"0" + non_negative_parameter) + (default_arg + ~long:"check-previous" + ~placeholder:"num_blocks" + ~doc:"number of previous blocks to check" + ~default:"10" + non_negative_parameter) + (arg + ~long:"branch" + ~placeholder:"block_hash" + ~doc: + "hash of the oldest block where we should look for the operation" + block_hash_param)) + (prefixes ["wait"; "for"] + @@ param + ~name:"operation" + ~desc:"Operation to be included" + (parameter (fun _ x -> + match Tezos_crypto.Operation_hash.of_b58check_opt x with + | None -> Error_monad.failwith "Invalid operation hash: '%s'" x + | Some hash -> Lwt_result_syntax.return hash)) + @@ prefixes ["to"; "be"; "included"] + @@ stop) + (fun (confirmations, predecessors, branch) + operation_hash + (ctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* (_ : Tezos_crypto.Block_hash.t * int * int) = + Client_confirmations.wait_for_operation_inclusion + ctxt + ~chain:ctxt#chain + ~confirmations + ~predecessors + ?branch + operation_hash + in + return_unit); + command + ~group + ~desc:"Submit protocol proposals" + (args3 + dry_run_switch + verbose_signing_switch + (switch + ~doc: + "Do not fail when the checks that try to prevent the user from \ + shooting themselves in the foot do fail." + ~long:"force" + ())) + (prefixes ["submit"; "proposals"; "for"] + @@ Client_keys.Public_key_hash.source_param + ~name:"delegate" + ~desc:"the delegate who makes the proposal" + @@ seq_of_param + (param + ~name:"proposal" + ~desc:"the protocol hash proposal to be submitted" + (parameter (fun _ x -> + match Tezos_crypto.Protocol_hash.of_b58check_opt x with + | None -> + Error_monad.failwith "Invalid proposal hash: '%s'" x + | Some hash -> Lwt_result_syntax.return hash)))) + (fun (dry_run, verbose_signing, force) + src_pkh + proposals + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* src_name, _src_pk, src_sk = Client_keys.get_key cctxt src_pkh in + let* info = + get_period_info + (* Find period info of the successor, because the operation will + be injected on the next block at the earliest *) + ~successor:true + ~chain:cctxt#chain + ~block:cctxt#block + cctxt + in + let*! () = + match info.current_period_kind with + | Proposal -> Lwt.return_unit + | _ -> + (if force then cctxt#warning else cctxt#error) + "Not in a proposal period" + in + let* known_protos = Shell_services.Protocol.list cctxt in + let* known_proposals = + get_proposals ~chain:cctxt#chain ~block:cctxt#block cctxt + in + let* has_voting_power = + let*! r = + Alpha_services.Delegate.voting_power + cctxt + (cctxt#chain, cctxt#block) + src_pkh + in + match r with + | Ok voting_power -> return (voting_power <> 0L) + | Error + (Environment.Ecoproto_error (Delegate_services.Not_registered _) + :: _) -> + return false + | Error _ as err -> Lwt.return err + in + (* for a proposal to be valid it must either a protocol that was already + proposed by somebody else or a protocol known by the node, because + the user is the first proposer and just injected it with + tezos-admin-client *) + let check_proposals proposals : bool tzresult Lwt.t = + let errors = ref [] in + let error ppf = + Format.kasprintf (fun s -> errors := s :: !errors) ppf + in + if proposals = [] then error "Empty proposal list." ; + if + Compare.List_length_with.( + proposals > Constants.max_proposals_per_delegate) + then + error + "Too many proposals: %d > %d." + (List.length proposals) + Constants.max_proposals_per_delegate ; + (match + Base.List.find_all_dups + ~compare:Tezos_crypto.Protocol_hash.compare + proposals + with + | [] -> () + | dups -> + error + "There %s: %a." + (if Compare.List_length_with.(dups = 1) then + "is a duplicate proposal" + else "are duplicate proposals") + Format.( + pp_print_list + ~pp_sep:(fun ppf () -> pp_print_string ppf ", ") + Tezos_crypto.Protocol_hash.pp) + dups) ; + List.iter + (fun (p : Tezos_crypto.Protocol_hash.t) -> + if + List.mem ~equal:Tezos_crypto.Protocol_hash.equal p known_protos + || Environment.Protocol_hash.Map.mem p known_proposals + then () + else + error + "Protocol %a is not a known proposal." + Tezos_crypto.Protocol_hash.pp + p) + proposals ; + if not has_voting_power then + error + "Public-key-hash `%a` from account `%s` does not appear to have \ + voting rights." + Tezos_crypto.Signature.Public_key_hash.pp + src_pkh + src_name ; + if !errors <> [] then + let*! () = + cctxt#message + "There %s with the submission:%t" + (if Compare.List_length_with.(!errors = 1) then "is an issue" + else "are issues") + Format.( + fun ppf -> + pp_print_cut ppf () ; + pp_open_vbox ppf 0 ; + List.iter + (fun msg -> + pp_open_hovbox ppf 2 ; + pp_print_string ppf "* " ; + pp_print_text ppf msg ; + pp_close_box ppf () ; + pp_print_cut ppf ()) + !errors ; + pp_close_box ppf ()) + in + return_false + else return_true + in + let* all_valid = check_proposals proposals in + let*! () = + if all_valid then cctxt#message "All proposals are valid." + else if force then + cctxt#message + "Some proposals are not valid, but `--force` was used." + else cctxt#error "Submission failed because of invalid proposals." + in + let*! r = + submit_proposals + ~dry_run + ~verbose_signing + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~src_sk + src_pkh + proposals + in + match r with + | Ok _res -> return_unit + | Error errs -> + let*! () = + match errs with + | [ + Unregistered_error + (`O [("kind", `String "generic"); ("error", `String msg)]); + ] -> + cctxt#message + "Error:@[<hov>@.%a@]" + Format.pp_print_text + (String.split_on_char ' ' msg + |> List.filter (function "" | "\n" -> false | _ -> true) + |> String.concat " " + |> String.map (function '\n' | '\t' -> ' ' | c -> c)) + | el -> cctxt#message "Error:@ %a" pp_print_trace el + in + failwith "Failed to submit proposals"); + command + ~group + ~desc:"Submit a ballot" + (args3 + verbose_signing_switch + dry_run_switch + (switch + ~doc: + "Do not fail when the checks that try to prevent the user from \ + shooting themselves in the foot do fail." + ~long:"force" + ())) + (prefixes ["submit"; "ballot"; "for"] + @@ Client_keys.Public_key_hash.source_param + ~name:"delegate" + ~desc:"the delegate who votes" + @@ param + ~name:"proposal" + ~desc:"the protocol hash proposal to vote for" + (parameter (fun _ x -> + match Tezos_crypto.Protocol_hash.of_b58check_opt x with + | None -> failwith "Invalid proposal hash: '%s'" x + | Some hash -> Lwt_result_syntax.return hash)) + @@ param + ~name:"ballot" + ~desc:"the ballot value (yea/yay, nay, or pass)" + (parameter + ~autocomplete:(fun _ -> + Lwt_result_syntax.return ["yea"; "nay"; "pass"]) + (fun _ s -> + let open Lwt_result_syntax in + (* We should have [Vote.of_string]. *) + match String.lowercase_ascii s with + | "yay" | "yea" -> return Vote.Yay + | "nay" -> return Vote.Nay + | "pass" -> return Vote.Pass + | s -> failwith "Invalid ballot: '%s'" s)) + @@ stop) + (fun (verbose_signing, dry_run, force) + src_pkh + proposal + ballot + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* src_name, _src_pk, src_sk = Client_keys.get_key cctxt src_pkh in + let* info = + get_period_info + (* Find period info of the successor, because the operation will + be injected on the next block at the earliest *) + ~successor:true + ~chain:cctxt#chain + ~block:cctxt#block + cctxt + in + let* current_proposal = + Alpha_services.Voting.current_proposal cctxt (cctxt#chain, cctxt#block) + in + let* () = + match (info.current_period_kind, current_proposal) with + | (Exploration | Promotion), Some current_proposal -> + if Tezos_crypto.Protocol_hash.equal proposal current_proposal then + return_unit + else + let*! () = + (if force then cctxt#warning else cctxt#error) + "Unexpected proposal, expected: %a" + Tezos_crypto.Protocol_hash.pp + current_proposal + in + return_unit + | _ -> + let*! () = + (if force then cctxt#warning else cctxt#error) + "Not in Exploration or Promotion period" + in + return_unit + in + let* has_voting_power = + let*! r = + Alpha_services.Delegate.voting_power + cctxt + (cctxt#chain, cctxt#block) + src_pkh + in + match r with + | Ok voting_power -> return (voting_power <> 0L) + | Error + (Environment.Ecoproto_error (Delegate_services.Not_registered _) + :: _) -> + return false + | Error _ as err -> Lwt.return err + in + let*! () = + if has_voting_power then Lwt.return_unit + else + (if force then cctxt#warning else cctxt#error) + "Public-key-hash `%a` from account `%s` does not appear to have \ + voting rights." + Tezos_crypto.Signature.Public_key_hash.pp + src_pkh + src_name + in + let* _res = + submit_ballot + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~src_sk + src_pkh + ~verbose_signing + ~dry_run + proposal + ballot + in + return_unit); + command + ~group + ~desc:"Set the deposits limit of a registered delegate." + (args5 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args) + (prefixes ["set"; "deposits"; "limit"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ prefix "to" + @@ tez_param + ~name:"deposits limit" + ~desc:"the maximum amount of frozen deposits" + @@ stop) + (fun (fee, dry_run, verbose_signing, simulation, fee_parameter) + contract + limit + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match contract with + | Originated _ -> + cctxt#error + "Cannot change deposits limit on contract %a. This operation is \ + invalid on originated contracts or unregistered delegate \ + contracts." + Contract.pp + contract + | Implicit mgr -> + let* _, src_pk, manager_sk = Client_keys.get_key cctxt mgr in + let* (_ : _ Injection.result) = + set_deposits_limit + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~fee_parameter + ?fee + mgr + ~src_pk + ~manager_sk + (Some limit) + in + return_unit); + command + ~group + ~desc:"Remove the deposits limit of a registered delegate." + (args5 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args) + (prefixes ["unset"; "deposits"; "limit"; "for"] + @@ ContractAlias.destination_param ~name:"src" ~desc:"source contract" + @@ stop) + (fun (fee, dry_run, verbose_signing, simulation, fee_parameter) + contract + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match contract with + | Originated _ -> + cctxt#error + "Cannot change deposits limit on contract %a. This operation is \ + invalid on originated contracts or unregistered delegate \ + contracts." + Contract.pp + contract + | Implicit mgr -> + let* _, src_pk, manager_sk = Client_keys.get_key cctxt mgr in + let* (_ : _ Injection.result) = + set_deposits_limit + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~simulation + ~fee_parameter + ?fee + mgr + ~src_pk + ~manager_sk + None + in + return_unit); + command + ~group + ~desc:"Increase the paid storage of a smart contract." + (args6 + force_switch + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args) + (prefixes ["increase"; "the"; "paid"; "storage"; "of"] + @@ OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"name of the smart contract" + @@ prefix "by" + @@ non_negative_z_param ~name:"amount" ~desc:"amount of increase in bytes" + @@ prefixes ["bytes"; "from"] + @@ Public_key_hash.source_param + ~name:"payer" + ~desc:"payer of the storage increase" + @@ stop) + (fun (force, fee, dry_run, verbose_signing, simulation, fee_parameter) + contract + amount_in_bytes + payer + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* _, src_pk, manager_sk = Client_keys.get_key cctxt payer in + let* (_ : _ Injection.result) = + increase_paid_storage + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~force + ~dry_run + ~verbose_signing + ?fee + ?confirmations:cctxt#confirmations + ~simulation + ~source:payer + ~src_pk + ~manager_sk + ~destination:contract + ~fee_parameter + ~amount_in_bytes + () + in + return_unit); + command + ~group + ~desc:"Launch a new transaction rollup." + (args8 + force_switch + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["originate"; "tx"; "rollup"] + @@ TxRollupAlias.fresh_alias_param + ~name:"tx_rollup" + ~desc:"Fresh name for a transaction rollup" + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account originating the transaction rollup." + @@ stop) + (fun ( force, + fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + alias + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* {level = head_level; _} = + Protocol_client_context.Alpha_block_services.Header.shell_header + cctxt + () + in + let* _, _, res = + originate_tx_rollup + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + () + in + let*? res = + match res with + | Apply_results.Manager_operation_result + { + operation_result = + Apply_operation_result.Applied + (Apply_results.Tx_rollup_origination_result + {originated_tx_rollup; _}); + _; + } -> + Ok originated_tx_rollup + | _ -> error_with "transaction rollup was not correctly originated" + in + let* alias_name = TxRollupAlias.of_fresh cctxt force alias in + (* Approximate origination level, needs to be <= actual origination + level *) + let origination_level = Some head_level in + save_tx_rollup ~force cctxt alias_name res ~origination_level); + command + ~group + ~desc:"Submit a batch of transaction rollup operations." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["submit"; "tx"; "rollup"; "batch"] + @@ Tezos_clic.param + ~name:"batch" + ~desc: + "Bytes representation (hexadecimal string) of the batch. Must be \ + prefixed by '0x'." + bytes_parameter + @@ prefix "to" + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Tx rollup receiving the batch." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account submitting the transaction rollup batches." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + content + tx_rollup + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_batch + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + ~content:(Bytes.to_string content) + () + in + return_unit); + command + ~group + ~desc: + "Commit to a transaction rollup for an inbox and level.\n\n\ + The provided list of message result hash must be ordered in the same \ + way the messages were ordered in the inbox." + (args8 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg + (Tx_rollup.commitment_hash_arg + ~long:"predecessor-hash" + ~usage: + "Predecessor commitment hash, empty for the first commitment." + ())) + (prefixes ["commit"; "to"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Transaction rollup address committed to." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account committing to the transaction rollup." + @@ prefixes ["for"; "level"] + @@ Tx_rollup.level_param ~usage:"Level used for the commitment." + @@ prefixes ["with"; "inbox"; "hash"] + @@ Tx_rollup.inbox_root_hash_param ~usage:"Inbox used for the commitment." + @@ prefixes ["and"; "messages"; "result"; "hash"] + @@ seq_of_param + (Tx_rollup.message_result_hash_param + ~usage: + "Message result hash of a message from the inbox being \ + committed.")) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter, + predecessor ) + tx_rollup + source + level + inbox_merkle_root + messages + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_commitment + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + ~level + ~inbox_merkle_root + ~messages + ~predecessor + () + in + return_unit); + command + ~group + ~desc:"Finalize a commitment of a transaction rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + storage_limit_arg + fee_parameter_args + simulate_switch + counter_arg) + (prefixes ["finalize"; "commitment"; "of"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Tx rollup that have its commitment finalized." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account finalizing the commitment." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + storage_limit, + fee_parameter, + simulation, + counter ) + tx_rollup + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_finalize_commitment + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + () + in + return_unit); + command + ~group + ~desc:"Recover commitment bond from a transaction rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["recover"; "bond"; "of"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account that owns the bond." + @@ prefixes ["for"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param ~usage:"Tx rollup of the bond." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + source + tx_rollup + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_return_bond + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + () + in + return_unit); + command + ~group + ~desc:"Remove a commitment from a transaction rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["remove"; "commitment"; "of"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Tx rollup that have its commitment removed." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"name of the account removing the commitment." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + tx_rollup + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_remove_commitment + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + () + in + return_unit); + command + ~group + ~desc:"Reject a commitment of a transaction rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["reject"; "commitment"; "of"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Tx rollup that have one of its commitment rejected." + @@ prefixes ["at"; "level"] + @@ Tx_rollup.level_param ~usage:"Level of the commitment disputed." + @@ prefixes ["with"; "result"; "hash"] + @@ Tx_rollup.message_result_hash_param + ~usage:"Disputed message result hash." + @@ prefixes ["and"; "result"; "path"] + @@ Tx_rollup.message_result_path_param + ~usage:"Disputed message result path." + @@ prefixes ["for"; "message"; "at"; "position"] + @@ Tezos_clic.param + ~name:"message position" + ~desc: + "Position of the message in the inbox with the result being \ + disputed." + non_negative_parameter + @@ prefixes ["with"; "content"] + @@ Tx_rollup.message_param + ~usage:"Message content with the result being disputed." + @@ prefixes ["and"; "path"] + @@ Tx_rollup.message_path_param + ~usage:"Path of the message with the result being disputed." + @@ prefixes ["with"; "agreed"; "context"; "hash"] + @@ Tx_rollup.context_hash_param + ~usage: + (Format.sprintf + "@[Context hash of the precedent message result in the \ + commitment.@,\ + @[This must be the context hash of the last message result \ + agreed on.@]@]") + @@ prefixes ["and"; "withdraw"; "list"; "hash"] + @@ Tx_rollup.withdraw_list_hash_param + ~usage: + (Format.sprintf + "@[Withdraw list hash of the precedent message result in the \ + commitment.@,\ + @[This must be the withdraw list hash of the last message \ + result agreed on.@]@]") + @@ prefixes ["and"; "result"; "path"] + @@ Tx_rollup.message_result_path_param + ~usage:"Precedent message result path." + @@ prefixes ["using"; "proof"] + @@ Tx_rollup.proof_param + ~usage: + "Proof that the disputed message result provided is incorrect." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Account rejecting the commitment." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + tx_rollup + level + rejected_message_result_hash + rejected_message_result_path + conflicting_message_position + conflicting_message + conflicting_message_path + previous_context_hash + previous_withdraw_list_hash + previous_message_result_path + proof + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + submit_tx_rollup_rejection + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~tx_rollup + ~level + ~message:conflicting_message + ~message_position:conflicting_message_position + ~message_path:conflicting_message_path + ~message_result_hash:rejected_message_result_hash + ~message_result_path:rejected_message_result_path + ~proof + ~previous_context_hash + ~previous_withdraw_list_hash + ~previous_message_result_path + () + in + return_unit); + command + ~group + ~desc: + "Dispatch tickets withdrawn from a transaction rollup to owners. The \ + withdrawals are part of a finalized commitment of the transaction \ + rollup. Owners are implicit accounts who can then transfer the \ + tickets to smart contracts using the \"transfer tickets\" command. \ + See transaction rollups documentation for more information.\n\n\ + The provided list of ticket information must be ordered as in \ + withdrawal list computed by the application of the message." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["dispatch"; "tickets"; "of"; "tx"; "rollup"] + @@ Tx_rollup.tx_rollup_address_param + ~usage:"Tx rollup which have some tickets dispatched." + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"source" + ~desc:"Account used to dispatch tickets." + @@ prefixes ["at"; "level"] + @@ Tx_rollup.level_param + ~usage: + "Level of the finalized commitment that includes the message \ + result whose withdrawals will be dispatched." + @@ prefixes ["for"; "the"; "message"; "at"; "index"] + @@ Tezos_clic.param + ~name:"message index" + ~desc:"Index of the message whose withdrawals will be dispatched." + non_negative_parameter + @@ prefixes ["with"; "the"; "context"; "hash"] + @@ Tx_rollup.context_hash_param + ~usage: + "Context hash of the message result in the commitment whose \ + withdrawals will be dispatched." + @@ prefixes ["and"; "path"] + @@ Tx_rollup.message_result_path_param + ~usage: + "Path of the message result whose withdrawals will be dispatched." + @@ prefixes ["and"; "tickets"; "info"] + @@ seq_of_param + (Tx_rollup.tickets_dispatch_info_param + ~usage:"Information needed to dispatch tickets to its owner.")) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + tx_rollup + source + level + message_position + context_hash + message_result_path + tickets_info + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + tx_rollup_dispatch_tickets + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~level + ~context_hash + ~message_position + ~message_result_path + ~tickets_info + ~tx_rollup + () + in + return_unit); + command + ~group + ~desc: + "Transfer tickets from an implicit account to a contract or another \ + implicit account." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefix "transfer" + @@ non_negative_z_param ~name:"qty" ~desc:"Amount of tickets to transfer." + @@ prefixes ["tickets"; "from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"tickets owner" + ~desc:"Implicit account owning the tickets." + @@ prefix "to" + @@ ContractAlias.destination_param + ~name:"recipient contract" + ~desc:"Contract receiving the tickets." + @@ prefixes ["with"; "entrypoint"] + @@ Tezos_clic.param + ~name:"entrypoint" + ~desc: + "Entrypoint to use on the receiving contract or implicit account. \ + Needs to be \"default\" for implicit account destinations." + entrypoint_parameter + @@ prefixes ["and"; "contents"] + @@ Tezos_clic.param + ~name:"tickets content" + ~desc:"Content of the tickets." + Client_proto_args.string_parameter + @@ prefixes ["and"; "type"] + @@ Tezos_clic.param + ~name:"tickets type" + ~desc:"Type of the tickets." + Client_proto_args.string_parameter + @@ prefixes ["and"; "ticketer"] + @@ ContractAlias.destination_param + ~name:"tickets ticketer" + ~desc:"Ticketer contract of the tickets." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + amount + source + destination + entrypoint + contents + ty + ticketer + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + match Ticket_amount.of_zint amount with + | Some amount -> + let* _res = + transfer_ticket + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~contents + ~ty + ~ticketer + ~amount + ~destination + ~entrypoint + () + in + return_unit + | None -> cctxt#error "ticket quantity should not be zero or negative"); + command + ~group + ~desc:"Originate a new smart-contract rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["originate"; "sc"; "rollup"; "from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Name of the account originating the smart-contract rollup." + @@ prefixes ["of"; "kind"] + @@ param + ~name:"sc_rollup_kind" + ~desc:"Kind of the smart-contract rollup to be originated." + Sc_rollup_params.rollup_kind_parameter + @@ prefixes ["of"; "type"] + @@ param + ~name:"parameters_type" + ~desc: + "The interface of the smart-contract rollup including its \ + entrypoints and their signatures." + data_parameter + @@ prefixes ["with"; "kernel"] + @@ param + ~name:"kernel" + ~desc:"The kernel for the smart-contract rollup." + Sc_rollup_params.boot_sector_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + source + kind + parameters_ty + boot_sector + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let (Packed (module R) as pvm) = Sc_rollup.Kind.pvm_of kind in + let Michelson_v1_parser.{expanded; _} = parameters_ty in + let parameters_ty = Script.lazy_expr expanded in + let* boot_sector = boot_sector pvm in + let* _res = + sc_rollup_originate + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~kind + ~boot_sector + ~parameters_ty + () + in + return_unit); + command + ~group + ~desc:"Send one or more messages to a smart-contract rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["send"; "sc"; "rollup"; "message"] + @@ param + ~name:"messages" + ~desc: + "The message(s) to be sent to the rollup (syntax: \ + bin:<path_to_binary_file>|text:<json list of raw string \ + messages>|hex:<json list of hex-encoded \ + messages>|file:<json_file>)." + Sc_rollup_params.messages_parameter + @@ prefixes ["from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Name of the source contract." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + messages + source + cctxt -> + let open Lwt_result_syntax in + let* messages = + match messages with + | `Bin message -> return [message] + | `Json messages -> ( + match Data_encoding.(Json.destruct (list string) messages) with + | exception _ -> + failwith + "Could not read list of messages (expected list of bytes)" + | "raw" :: messages -> return messages + | "hex" :: messages -> + let* messages = + List.map_es + (fun message -> + match Hex.to_string (`Hex message) with + | None -> + failwith + "'%s' is not a valid hex encoded message" + message + | Some msg -> return [msg]) + messages + in + return @@ List.flatten messages + | _messages -> assert false) + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + sc_rollup_add_messages + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?dry_run:(Some dry_run) + ?verbose_signing:(Some verbose_signing) + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~messages + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"Publish a commitment for a sc rollup" + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + storage_limit_arg + counter_arg + fee_parameter_args) + (prefixes ["publish"; "commitment"] + @@ prefixes ["from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Name of the source contract." + @@ prefixes ["for"; "sc"; "rollup"] + @@ param + ~name:"sc_rollup" + ~desc: + "The address of the sc rollup where the commitment will be \ + published." + Sc_rollup_params.sc_rollup_address_parameter + @@ prefixes ["with"; "compressed"; "state"] + @@ param + ~name:"compressed_state" + ~desc:"The compressed state of the sc rollup for the commitment." + Sc_rollup_params.compressed_state_parameter + @@ prefixes ["at"; "inbox"; "level"] + @@ param + ~name:"inbox_level" + ~desc:"The inbox level for the commitment." + raw_level_parameter + @@ prefixes ["and"; "predecessor"] + @@ param + ~name:"predecessor" + ~desc:"The hash of the commitment's predecessor" + Sc_rollup_params.commitment_hash_parameter + @@ prefixes ["and"; "number"; "of"; "ticks"] + @@ param + ~name:"number_of_ticks" + ~desc:"The number of ticks for the commitment." + Sc_rollup_params.number_of_ticks_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + storage_limit, + counter, + fee_parameter ) + source + rollup + compressed_state + inbox_level + predecessor + number_of_ticks + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let commitment : Alpha_context.Sc_rollup.Commitment.t = + {compressed_state; inbox_level; predecessor; number_of_ticks} + in + let* _res = + sc_rollup_publish + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~rollup + ~commitment + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"Cement a commitment for a sc rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + storage_limit_arg + counter_arg + fee_parameter_args) + (prefixes ["cement"; "commitment"] + @@ param + ~name:"commitment" + ~desc:"The hash of the commitment to be cemented for a sc rollup." + Sc_rollup_params.commitment_hash_parameter + @@ prefixes ["from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Name of the source contract." + @@ prefixes ["for"; "sc"; "rollup"] + @@ param + ~name:"sc_rollup" + ~desc: + "The address of the sc rollup where the commitment will be \ + cemented." + Sc_rollup_params.sc_rollup_address_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + storage_limit, + counter, + fee_parameter ) + commitment + source + rollup + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + sc_rollup_cement + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~rollup + ~commitment + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"Timeout a staker from dispute on a smart-contract rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + storage_limit_arg + counter_arg + fee_parameter_args) + (prefixes ["timeout"; "dispute"; "on"; "sc"; "rollup"] + @@ param + ~name:"sc_rollup" + ~desc: + "The address of the smart-contract rollup where the staker of the \ + dispute has timed-out." + Sc_rollup_params.sc_rollup_address_parameter + @@ prefixes ["with"] + @@ Client_keys.Public_key_hash.source_param + ~name:"staker1" + ~desc:"The staker that has timed out." + @@ prefixes ["against"] + @@ Client_keys.Public_key_hash.source_param + ~name:"staker2" + ~desc:"The opponent of this staker." + @@ prefixes ["from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"Name of the source contract." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + storage_limit, + counter, + fee_parameter ) + rollup + staker1 + staker2 + source + cctxt -> + let open Lwt_result_syntax in + let* games = + Plugin.RPC.Sc_rollup.ongoing_refutation_games + cctxt + (cctxt#chain, cctxt#block) + rollup + staker1 + () + in + let* alice, bob = + let* answer = + List.find_es + (fun (_, alice, bob) -> + let stakers = Sc_rollup.Game.Index.make staker1 staker2 in + return + Tezos_crypto.Signature.Public_key_hash.( + alice = stakers.alice && bob = stakers.bob)) + games + in + match answer with + | None -> + cctxt#error + "Couldn't find an ongoing dispute for this staker on this \ + rollup." + | Some (_, alice, bob) -> return (alice, bob) + in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + sc_rollup_timeout + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~rollup + ~alice + ~bob + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"List originated smart-contract rollups." + no_options + (prefixes ["list"; "sc"; "rollups"] @@ stop) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* rollups = + Plugin.RPC.Sc_rollup.list cctxt (cctxt#chain, cctxt#block) + in + let*! () = + List.iter_s + (fun addr -> + cctxt#message "%s" (Sc_rollup.Address.to_b58check addr)) + rollups + in + return_unit); + command + ~group + ~desc: + "Execute a message from a smart-contract rollup's outbox of a cemented \ + commitment." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["execute"; "outbox"; "message"; "of"; "sc"; "rollup"] + @@ param + ~name:"rollup" + ~desc: + "The address of the smart-contract rollup where the message \ + resides." + Sc_rollup_params.sc_rollup_address_parameter + @@ prefix "from" + @@ Client_keys.Public_key_hash.source_param + ~name:"source" + ~desc:"The account used for executing the outbox message." + @@ prefixes ["for"; "commitment"; "hash"] + @@ param + ~name:"cemented commitment" + ~desc:"The hash of the cemented commitment of the rollup." + Sc_rollup_params.commitment_hash_parameter + @@ prefixes ["and"; "output"; "proof"] + @@ param + ~name:"output proof" + ~desc: + "The output proof containing the outbox level, index and message." + bytes_parameter + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + rollup + source + cemented_commitment + output_proof + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + sc_rollup_execute_outbox_message + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~rollup + ~cemented_commitment + ~output_proof:(Bytes.to_string output_proof) + ~src_pk + ~src_sk + ~fee_parameter + () + in + return_unit); + command + ~group + ~desc:"Recover commitment bond from a smart contract rollup." + (args7 + fee_arg + dry_run_switch + verbose_signing_switch + simulate_switch + fee_parameter_args + storage_limit_arg + counter_arg) + (prefixes ["recover"; "bond"; "of"] + @@ Client_keys.Public_key_hash.source_param + ~name:"staker" + ~desc:"The implicit account that owns the frozen bond." + @@ prefixes ["for"; "sc"; "rollup"] + @@ Tezos_clic.param + ~name:"smart contract rollup address" + ~desc:"The address of the smart-contract rollup of the bond." + Sc_rollup_params.sc_rollup_address_parameter + @@ prefixes ["from"] + @@ Client_keys.Public_key_hash.source_param + ~name:"src" + ~desc:"The implicit account that triggers the operation." + @@ stop) + (fun ( fee, + dry_run, + verbose_signing, + simulation, + fee_parameter, + storage_limit, + counter ) + staker + sc_rollup + source + cctxt -> + let open Lwt_result_syntax in + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* _res = + sc_rollup_recover_bond + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~dry_run + ~verbose_signing + ?fee + ?storage_limit + ?counter + ?confirmations:cctxt#confirmations + ~simulation + ~source + ~src_pk + ~src_sk + ~fee_parameter + ~sc_rollup + ~staker + () + in + return_unit); + ] + +let commands network () = + commands_rw () @ commands_network network () @ commands_ro () diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_contracts_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_contracts_commands.ml new file mode 100644 index 000000000000..080c98b052da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_contracts_commands.ml @@ -0,0 +1,98 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Client_proto_contracts + +let group = + { + Tezos_clic.name = "contracts"; + title = "Commands for managing the record of known contracts"; + } + +let commands () = + let open Tezos_clic in + [ + command + ~group + ~desc:"Add a contract to the wallet." + (args1 (RawContractAlias.force_switch ())) + (prefixes ["remember"; "contract"] + @@ RawContractAlias.fresh_alias_param @@ RawContractAlias.source_param + @@ stop) + (fun force name hash cctxt -> + let open Lwt_result_syntax in + let* name = RawContractAlias.of_fresh cctxt force name in + RawContractAlias.add ~force cctxt name hash); + command + ~group + ~desc:"Remove a contract from the wallet." + no_options + (prefixes ["forget"; "contract"] @@ RawContractAlias.alias_param @@ stop) + (fun () (name, _) cctxt -> RawContractAlias.del cctxt name); + command + ~group + ~desc:"Lists all known contracts in the wallet." + no_options + (fixed ["list"; "known"; "contracts"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* contracts = list_contracts cctxt in + let*! () = + List.iter_s + (fun (prefix, alias, contract) -> + cctxt#message + "%s%s: %s" + prefix + alias + (Contract.to_b58check contract)) + contracts + in + return_unit); + command + ~group + ~desc:"Forget the entire wallet of known contracts." + (args1 (RawContractAlias.force_switch ())) + (fixed ["forget"; "all"; "contracts"]) + (fun force cctxt -> + let open Lwt_result_syntax in + let* () = + fail_unless + force + (error_of_fmt "this can only used with option -force") + in + RawContractAlias.set cctxt []); + command + ~group + ~desc:"Display a contract from the wallet." + no_options + (prefixes ["show"; "known"; "contract"] + @@ RawContractAlias.alias_param @@ stop) + (fun () (_, contract) (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*! () = cctxt#message "%a\n%!" Contract.pp contract in + return_unit); + ] diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_fa12_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_fa12_commands.ml new file mode 100644 index 000000000000..bac3b401d30d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_fa12_commands.ml @@ -0,0 +1,698 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Client_proto_args + +let group = + { + Tezos_clic.name = "tokens"; + title = "Commands for managing FA1.2-compatible smart contracts"; + } + +let alias_param = Client_proto_contracts.ContractAlias.destination_param + +let token_contract_param () = + Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"name or address of the FA1.2-compatible contract" + +let from_param () = + alias_param ~name:"from" ~desc:"name or address of the sender" + +let to_param () = alias_param ~name:"to" ~desc:"name or address of the receiver" + +let amount_param () = + Tezos_clic.param + ~name:"amount" + ~desc:"number of tokens" + (Tezos_clic.parameter (fun _ s -> + try + let v = Z.of_string s in + assert (Compare.Z.(v >= Z.zero)) ; + Lwt_result_syntax.return v + with _ -> failwith "invalid amount (must be a non-negative number)")) + +let tez_amount_arg = + tez_arg ~default:"0" ~parameter:"tez-amount" ~doc:"amount in \xEA\x9C\xA9" + +let as_arg = + Client_proto_contracts.ContractAlias.destination_arg + ~name:"as" + ~doc:"name or address of the caller of the contract" + () + +let payer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"payer" + ~doc:"name of the payer (i.e. SOURCE) contract for the transaction" + () + +let callback_entrypoint_arg = + Tezos_clic.arg + ~doc:"Entrypoint the view should use to callback to" + ~long:"callback-entrypoint" + ~placeholder:"name" + string_parameter + +let contract_call_options = + Tezos_clic.args9 + tez_amount_arg + fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args + +let contract_view_options = + Tezos_clic.args10 + callback_entrypoint_arg + tez_amount_arg + fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args + +let view_options = + Tezos_clic.args3 + run_gas_limit_arg + payer_arg + (unparsing_mode_arg ~default:"Readable") + +let dummy_callback = + Contract.Implicit Tezos_crypto.Signature.Public_key_hash.zero + +let get_contract_caller_keys cctxt (caller : Contract.t) = + let open Lwt_result_syntax in + match caller with + | Originated _ -> + failwith "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, caller_pk, caller_sk = Client_keys.get_key cctxt source in + return (source, caller_pk, caller_sk) + +let commands_ro () : #Protocol_client_context.full Tezos_clic.command list = + Tezos_clic. + [ + command + ~group + ~desc:"Check that a contract is FA1.2-compatible." + no_options + (prefixes ["check"; "contract"] + @@ token_contract_param () + @@ prefixes ["implements"; "fa1.2"] + @@ stop) + (fun () contract (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* _ = + Client_proto_fa12.contract_has_fa12_interface + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + () + in + Format.printf + "Contract %a has an FA1.2 interface.\n%!" + Contract_hash.pp + contract ; + return_unit); + command + ~group + ~desc:"Ask for an address's balance offchain" + view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "balance"; "for"] + @@ alias_param + ~name:"from" + ~desc: + "name or address of the account to lookup (also the source \ + contract)" + @@ stop) + (fun (gas, payer, unparsing_mode) + contract + addr + (cctxt : #Protocol_client_context.full) -> + let open Lwt_syntax in + let action = + Client_proto_fa12.Get_balance (addr, (dummy_callback, None)) + in + let* res = + Client_proto_fa12.run_view_action + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ~source:addr + ?gas + ?payer + ~unparsing_mode + () + in + Client_proto_programs.print_view_result cctxt res); + command + ~group + ~desc:"Ask for an address's allowance offchain" + view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "allowance"; "on"] + @@ alias_param + ~name:"owner" + ~desc:"name or address of the account giving the allowance" + @@ prefix "as" + @@ alias_param + ~name:"operator" + ~desc:"name or address of the account receiving the allowance" + @@ stop) + (fun (gas, payer, unparsing_mode) + contract + source + destination + (cctxt : #Protocol_client_context.full) -> + let open Lwt_syntax in + let action = + Client_proto_fa12.Get_allowance + (source, destination, (dummy_callback, None)) + in + let* res = + Client_proto_fa12.run_view_action + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ~source + ?gas + ?payer + ~unparsing_mode + () + in + Client_proto_programs.print_view_result cctxt res); + command + ~group + ~desc:"Ask for the contract's total token supply offchain" + view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "total"; "supply"] + @@ stop) + (fun (gas, payer, unparsing_mode) + contract + (cctxt : #Protocol_client_context.full) -> + let open Lwt_syntax in + let action = + Client_proto_fa12.Get_total_supply (dummy_callback, None) + in + let* res = + Client_proto_fa12.run_view_action + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?gas + ?payer + ~unparsing_mode + () + in + Client_proto_programs.print_view_result cctxt res); + command + ~group + ~desc:"Ask for an address's balance using a callback contract" + contract_view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "balance"; "for"] + @@ alias_param + ~name:"from" + ~desc: + "name or address of the account to lookup (also the source \ + contract)" + @@ prefixes ["callback"; "on"] + @@ alias_param + ~name:"callback" + ~desc:"name or address of the callback contract" + @@ stop) + (fun ( callback_entrypoint, + tez_amount, + fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + contract + addr + callback + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source, src_pk, src_sk = get_contract_caller_keys cctxt addr in + let action = + Client_proto_fa12.Get_balance (addr, (callback, callback_entrypoint)) + in + let*! errors = + Client_proto_fa12.call_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ~source + ~src_pk + ~src_sk + ~tez_amount + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Ask for an address's allowance using a callback contract" + contract_view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "allowance"; "on"] + @@ alias_param + ~name:"from" + ~desc:"name or address of the account giving the allowance" + @@ prefix "as" + @@ alias_param + ~name:"to" + ~desc:"name or address of the account receiving the allowance" + @@ prefixes ["callback"; "on"] + @@ alias_param + ~name:"callback" + ~desc:"name or address of the callback contract" + @@ stop) + (fun ( callback_entrypoint, + tez_amount, + fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + contract + src + dst + callback + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source, src_pk, src_sk = get_contract_caller_keys cctxt src in + let action = + Client_proto_fa12.Get_allowance + (src, dst, (callback, callback_entrypoint)) + in + let*! errors = + Client_proto_fa12.call_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ~source + ~src_pk + ~src_sk + ~tez_amount + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc: + "Ask for a contract's total token supply using a callback contract" + contract_view_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () + @@ prefixes ["get"; "total"; "supply"; "as"] + @@ alias_param + ~name:"from" + ~desc:"name or address of the source account" + @@ prefixes ["callback"; "on"] + @@ alias_param + ~name:"callback" + ~desc:"name or address of the callback contract" + @@ stop) + (fun ( callback_entrypoint, + tez_amount, + fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + contract + addr + callback + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source, src_pk, src_sk = get_contract_caller_keys cctxt addr in + let action = + Client_proto_fa12.Get_total_supply (callback, callback_entrypoint) + in + let*! errors = + Client_proto_fa12.call_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ~source + ~src_pk + ~src_sk + ~tez_amount + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + ] + +let commands_rw () : #Protocol_client_context.full Tezos_clic.command list = + let open Client_proto_args in + Tezos_clic. + [ + command + ~group + ~desc:"Transfer tokens between two given accounts" + (Tezos_clic.args10 + as_arg + tez_amount_arg + fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args) + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () @@ prefix "transfer" @@ amount_param () + @@ prefix "from" @@ from_param () @@ prefix "to" @@ to_param () @@ stop + ) + (fun ( as_address, + tez_amount, + fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + contract + amount + src + dst + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let caller = Option.value ~default:src as_address in + let* source, caller_pk, caller_sk = + get_contract_caller_keys cctxt caller + in + let action = Client_proto_fa12.Transfer (src, dst, amount) in + let*! errors = + Client_proto_fa12.call_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ~source + ~src_pk:caller_pk + ~src_sk:caller_sk + ~tez_amount + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Allow account to transfer an amount of token" + contract_call_options + (prefixes ["from"; "fa1.2"; "contract"] + @@ token_contract_param () @@ prefix "as" + @@ alias_param ~name:"as" ~desc:"name or address of the sender" + @@ prefix "approve" @@ amount_param () @@ prefix "from" + @@ alias_param + ~name:"from" + ~desc:"name or address to approve withdrawal" + @@ stop) + (fun ( tez_amount, + fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + contract + source + amount + dst + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source, src_pk, src_sk = get_contract_caller_keys cctxt source in + let action = Client_proto_fa12.Approve (dst, amount) in + let*! errors = + Client_proto_fa12.call_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~action + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ?fee + ~source + ~src_pk + ~src_sk + ~tez_amount + ?gas_limit + ?storage_limit + ?counter + ~fee_parameter + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc: + "Execute multiple token transfers from a single source account. If \ + one of the token transfers fails, none of them are executed." + (args9 + default_fee_arg + as_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + default_gas_limit_arg + default_storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args) + (prefixes ["multiple"; "fa1.2"; "transfers"; "from"] + @@ alias_param + ~name:"src" + ~desc:"name or address of the source of the transfers" + @@ prefix "using" + @@ param + ~name:"transfers.json" + ~desc: + (Format.sprintf + "List of token transfers to inject from the source contract \ + in JSON format (as a file or string). The JSON must be an \ + array of objects of the form: '[ {\"token_contract\": \ + address or alias, \"destination\": address or alias, \ + \"amount\": non-negative integer (, <field>: <val> ...) } \ + (, ...) ]', where an optional <field> can either be \ + \"tez-amount\", \"fee\", \"gas-limit\" or \ + \"storage-limit\". The complete schema can be inspected via \ + `tezos-codec describe %s.fa1.2.token_transfer json schema`." + Protocol.name) + json_parameter + @@ stop) + (fun ( fee, + as_address, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + src + operations_json + cctxt -> + let open Lwt_result_syntax in + let caller = Option.value ~default:src as_address in + match + Data_encoding.Json.destruct + (Data_encoding.list Client_proto_fa12.token_transfer_encoding) + operations_json + with + | [] -> failwith "Empty operation list" + | operations -> + let* source, src_pk, src_sk = + get_contract_caller_keys cctxt caller + in + let*! errors = + Client_proto_fa12.inject_token_transfer_batch + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~sender:src + ~source + ~src_pk + ~src_sk + ~token_transfers:operations + ~fee_parameter + ?counter + ?default_fee:fee + ?default_gas_limit:gas_limit + ?default_storage_limit:storage_limit + () + in + let*! _ = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"multiple transfers simulation failed" + cctxt + errors + in + return_unit + | exception (Data_encoding.Json.Cannot_destruct (path, exn2) as exn) + -> ( + match (path, operations_json) with + | [`Index n], `A lj -> ( + match List.nth_opt lj n with + | Some j -> + failwith + "Invalid transfer at index %i: %a %a" + n + (fun ppf -> Data_encoding.Json.print_error ppf) + exn2 + Data_encoding.Json.pp + j + | _ -> + failwith + "Invalid transfer at index %i: %a" + n + (fun ppf -> Data_encoding.Json.print_error ppf) + exn2) + | _ -> + failwith + "Invalid transfer file: %a %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn + Data_encoding.Json.pp + operations_json)); + ] + +let commands () = commands_ro () @ commands_rw () diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.ml new file mode 100644 index 000000000000..8b0f969c2ea9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.ml @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let protocol_constants_arg = + Tezos_clic.arg + ~doc:"a JSON file that contains protocol constants to set." + ~long:"protocol-constants" + ~placeholder:"path" + (Tezos_clic.parameter (fun _ x -> Lwt_result_syntax.return x)) + +let bootstrap_accounts_arg = + Tezos_clic.arg + ~doc: + "a JSON file that contains definitions of bootstrap accounts to create." + ~long:"bootstrap-accounts" + ~placeholder:"path" + (Tezos_clic.parameter (fun _ x -> Lwt_result_syntax.return x)) + +let asynchronous_flag = + Tezos_clic.switch + ~long:"asynchronous" + ~doc:"put operations in mempool and require baking to include in the chain" + () + +let load_json_file (cctxt : Protocol_client_context.full) json_file = + let open Lwt_result_syntax in + match json_file with + | None -> return None + | Some filename -> + let* json_string = cctxt#read_file filename in + return (Some (Ezjsonm.from_string json_string :> Data_encoding.json)) + +let create_mockup_command_handler + (constants_overrides_file, bootstrap_accounts_file, asynchronous) + (cctxt : Protocol_client_context.full) = + let open Lwt_result_syntax in + let* constants_overrides_json = + load_json_file cctxt constants_overrides_file + in + let* bootstrap_accounts_json = load_json_file cctxt bootstrap_accounts_file in + let* () = + Tezos_mockup.Persistence.create_mockup + ~cctxt:(cctxt :> Tezos_client_base.Client_context.full) + ~protocol_hash:Protocol.hash + ~constants_overrides_json + ~bootstrap_accounts_json + ~asynchronous + in + Tezos_mockup_commands.Mockup_wallet.populate cctxt bootstrap_accounts_file + +let create_mockup_command : Protocol_client_context.full Tezos_clic.command = + let open Tezos_clic in + command + ~group:Tezos_mockup_commands.Mockup_commands.group + ~desc:"Create a mockup environment." + (args3 protocol_constants_arg bootstrap_accounts_arg asynchronous_flag) + (prefixes ["create"; "mockup"] @@ stop) + create_mockup_command_handler + +let commands () = [create_mockup_command] diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.mli new file mode 100644 index 000000000000..711637eadd30 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_mockup_commands.mli @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val commands : unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.ml new file mode 100644 index 000000000000..05f08ce7f464 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.ml @@ -0,0 +1,1091 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Client_proto_args +open Tezos_micheline + +let group = + { + Tezos_clic.name = "multisig"; + title = "Commands for managing a multisig smart contract"; + } + +let threshold_param () = + Tezos_clic.param + ~name:"threshold" + ~desc:"Number of required signatures" + Client_proto_args.int_parameter + +let public_key_param () = + Client_keys.Public_key.source_param + ~name:"key" + ~desc:"Each signer of the multisig contract" + +let secret_key_param () = + Client_keys.Secret_key.source_param + ~name:"key" + ~desc: + "Secret key corresponding to one of the public keys stored on the \ + multisig contract" + +let signature_param () = + Tezos_clic.param + ~name:"signature" + ~desc:"Each signer of the multisig contract" + Client_proto_args.signature_parameter + +let lambda_param () = + Tezos_clic.param + ~name:"lambda" + ~desc:"the lambda to execute, of type lambda unit (list operation)" + string_parameter + +let bytes_only_switch = + Tezos_clic.switch + ~long:"bytes-only" + ~doc:"return only the byte sequence to be signed" + () + +let bytes_param ~name ~desc = + Tezos_clic.param ~name ~desc Client_proto_args.bytes_parameter + +let transfer_options = + Tezos_clic.args10 + Client_proto_args.fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + Client_proto_args.gas_limit_arg + Client_proto_args.storage_limit_arg + Client_proto_args.counter_arg + Client_proto_args.arg_arg + Client_proto_args.no_print_source_flag + Client_proto_args.fee_parameter_args + Client_proto_args.entrypoint_arg + +let non_transfer_options = + Tezos_clic.args8 + Client_proto_args.fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_context_commands.verbose_signing_switch + Client_proto_args.gas_limit_arg + Client_proto_args.storage_limit_arg + Client_proto_args.counter_arg + Client_proto_args.no_print_source_flag + Client_proto_args.fee_parameter_args + +let prepare_command_display prepared_command bytes_only = + if bytes_only then + Format.printf + "0x%a@." + Hex.pp + (Hex.of_bytes prepared_command.Client_proto_multisig.bytes) + else + Format.printf + "%a@.%a@.%a@.%a@." + (fun ppf x -> + Format.fprintf ppf "Bytes to sign: '0x%a'" Hex.pp (Hex.of_bytes x)) + prepared_command.Client_proto_multisig.bytes + (fun ppf x -> + Format.fprintf + ppf + "Blake 2B Hash: '%s'" + (Tezos_crypto.Base58.raw_encode + Tezos_crypto.Blake2B.(hash_bytes [x] |> to_string))) + prepared_command.Client_proto_multisig.bytes + (fun ppf z -> + Format.fprintf + ppf + "Threshold (number of signatures required): %s" + (Z.to_string z)) + prepared_command.Client_proto_multisig.threshold + (fun ppf -> + Format.fprintf + ppf + "@[<2>Public keys of the signers:@ %a@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "@ ") + Tezos_crypto.Signature.Public_key.pp)) + prepared_command.Client_proto_multisig.keys + +let get_parameter_type (cctxt : #Protocol_client_context.full) + ~(destination : Contract.t) ~entrypoint = + let open Lwt_result_syntax in + match destination with + | Implicit _ -> + let open Micheline in + return @@ strip_locations @@ Prim (0, Script.T_unit, [], []) + | Originated contract -> ( + let* o = + Michelson_v1_entrypoints.contract_entrypoint_type + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~contract + ~entrypoint + ~normalize_types:true + in + match o with + | None -> + cctxt#error + "Contract %a has no entrypoint named %a" + Contract_hash.pp + contract + Entrypoint.pp + entrypoint + | Some parameter_type -> return parameter_type) + +let commands_ro () : #Protocol_client_context.full Tezos_clic.command list = + Tezos_clic. + [ + command + ~group + ~desc:"Show the hashes of the supported multisig contracts." + no_options + (fixed ["show"; "supported"; "multisig"; "hashes"]) + (fun () _cctxt -> + Format.printf "Hashes of supported multisig contracts:@." ; + List.iter + (fun h -> Format.printf "%a@." Script_expr_hash.pp h) + Client_proto_multisig.known_multisig_hashes ; + Lwt_result_syntax.return_unit); + command + ~group + ~desc:"Show the script of the recommended multisig contract." + no_options + (fixed ["show"; "multisig"; "script"]) + (fun () _cctxt -> + let {Michelson_v1_parser.source; _} = + Michelson_v1_printer.unparse_toplevel + Client_proto_multisig.multisig_script + in + Format.printf "%s@." source ; + Lwt_result_syntax.return_unit); + ] + +let commands_rw () : #Protocol_client_context.full Tezos_clic.command list = + Tezos_clic. + [ + command + ~group + ~desc:"Originate a new multisig contract." + (args9 + Client_proto_args.fee_arg + Client_proto_context_commands.dry_run_switch + Client_proto_args.gas_limit_arg + Client_proto_args.storage_limit_arg + Client_proto_args.delegate_arg + (Client_keys.force_switch ()) + Client_proto_args.no_print_source_flag + Client_proto_args.fee_parameter_args + Client_proto_context_commands.verbose_signing_switch) + (prefixes ["deploy"; "multisig"] + @@ Client_proto_contracts.RawContractAlias.fresh_alias_param + ~name:"new_multisig" + ~desc:"name of the new multisig contract" + @@ prefix "transferring" + @@ Client_proto_args.tez_param + ~name:"qty" + ~desc:"amount taken from source" + @@ prefix "from" + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"name of the source contract" + @@ prefixes ["with"; "threshold"] + @@ threshold_param () + @@ prefixes ["on"; "public"; "keys"] + @@ seq_of_param (public_key_param ())) + (fun ( fee, + dry_run, + gas_limit, + storage_limit, + delegate, + force, + no_print_source, + fee_parameter, + verbose_signing ) + alias_name + balance + source + threshold + keys + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* alias_name = + Client_proto_contracts.RawContractAlias.of_fresh + cctxt + force + alias_name + in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of an origination" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* keys = + List.map_es + (fun (pk_uri, _) -> Client_keys.public_key pk_uri) + keys + in + let*! errors = + Client_proto_multisig.originate_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ?fee + ?gas_limit + ?storage_limit + ~verbose_signing + ~delegate + ~threshold:(Z.of_int threshold) + ~keys + ~balance + ~source + ~src_pk + ~src_sk + ~fee_parameter + () + in + let*! o = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"multisig origination simulation failed" + cctxt + errors + in + unless dry_run @@ fun () -> + Option.iter_es + (fun (_res, contract) -> + Client_proto_context.save_contract + ~force + cctxt + alias_name + contract) + o); + command + ~group + ~desc:"Sign a transaction for a multisig contract." + (args2 arg_arg entrypoint_arg) + (prefixes ["sign"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefix "transferring" + @@ Client_proto_args.tez_param + ~name:"qty" + ~desc:"amount taken from source" + @@ prefix "to" + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"dst" + ~desc:"name/literal of the destination contract" + @@ prefixes ["using"; "secret"; "key"] + @@ secret_key_param () @@ stop) + (fun (parameter, entrypoint) + multisig_contract + amount + destination + sk + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let entrypoint = + Option.value ~default:Entrypoint.default entrypoint + in + let parameter = Option.value ~default:"Unit" parameter in + let*? {expanded = parameter; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression parameter + in + let* parameter_type = + get_parameter_type cctxt ~destination ~entrypoint + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action: + (Client_proto_multisig.Transfer + {amount; destination; entrypoint; parameter_type; parameter}) + () + in + let* signature = Client_keys.sign cctxt sk prepared_command.bytes in + Format.printf "%a@." Tezos_crypto.Signature.pp signature ; + return_unit); + command + ~group + ~desc:"Sign a lambda for a generic multisig contract." + no_options + (prefixes ["sign"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["running"; "lambda"] + @@ lambda_param () + @@ prefixes ["using"; "secret"; "key"] + @@ secret_key_param () @@ stop) + (fun () + multisig_contract + lambda + sk + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*? {expanded = lambda; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression lambda + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action:(Lambda lambda) + () + in + let* signature = Client_keys.sign cctxt sk prepared_command.bytes in + Format.printf "%a@." Tezos_crypto.Signature.pp signature ; + return_unit); + command + ~group + ~desc:"Sign a delegate change for a multisig contract." + no_options + (prefixes ["sign"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["setting"; "delegate"; "to"] + @@ Client_keys.Public_key_hash.source_param + ~name:"dlgt" + ~desc:"new delegate of the new multisig contract" + @@ prefixes ["using"; "secret"; "key"] + @@ secret_key_param () @@ stop) + (fun () + multisig_contract + delegate + sk + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action:(Client_proto_multisig.Change_delegate (Some delegate)) + () + in + let* signature = Client_keys.sign cctxt sk prepared_command.bytes in + Format.printf "%a@." Tezos_crypto.Signature.pp signature ; + return_unit); + command + ~group + ~desc:"Sign a delegate withdraw for a multisig contract." + no_options + (prefixes ["sign"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["withdrawing"; "delegate"] + @@ prefixes ["using"; "secret"; "key"] + @@ secret_key_param () @@ stop) + (fun () multisig_contract sk (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action:(Client_proto_multisig.Change_delegate None) + () + in + let* signature = Client_keys.sign cctxt sk prepared_command.bytes in + Format.printf "%a@." Tezos_crypto.Signature.pp signature ; + return_unit); + command + ~group + ~desc: + "Sign a change of public keys and threshold for a multisig contract." + no_options + (prefixes ["sign"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["using"; "secret"; "key"] + @@ secret_key_param () + @@ prefixes ["setting"; "threshold"; "to"] + @@ threshold_param () + @@ prefixes ["and"; "public"; "keys"; "to"] + @@ seq_of_param (public_key_param ())) + (fun () + multisig_contract + sk + new_threshold + new_keys + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* keys = + List.map_es + (fun (pk_uri, _) -> Client_keys.public_key pk_uri) + new_keys + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action: + (Client_proto_multisig.Change_keys (Z.of_int new_threshold, keys)) + () + in + let* signature = Client_keys.sign cctxt sk prepared_command.bytes in + Format.printf "%a@." Tezos_crypto.Signature.pp signature ; + return_unit); + command + ~group + ~desc:"Transfer tokens using a multisig contract." + transfer_options + (prefixes ["from"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name/literal of the multisig contract" + @@ prefix "transfer" + @@ Client_proto_args.tez_param + ~name:"qty" + ~desc:"amount taken from the multisig contract" + @@ prefix "to" + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"dst" + ~desc:"name/literal of the destination contract" + @@ prefixes ["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + parameter, + no_print_source, + fee_parameter, + entrypoint ) + multisig_contract + amount + destination + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let entrypoint = + Option.value ~default:Entrypoint.default entrypoint + in + let parameter = Option.value ~default:"Unit" parameter in + let*? {expanded = parameter; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression parameter + in + let* parameter_type = + get_parameter_type cctxt ~destination ~entrypoint + in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Client_proto_multisig.call_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~action: + (Client_proto_multisig.Transfer + { + amount; + destination; + entrypoint; + parameter_type; + parameter; + }) + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Run a lambda on a generic multisig contract." + non_transfer_options + (prefixes ["from"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name/literal of the multisig contract" + @@ prefixes ["run"; "lambda"] + @@ lambda_param () + @@ prefixes ["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + multisig_contract + lambda + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*? {expanded = lambda; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression lambda + in + let*! errors = + Client_proto_multisig.call_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~action:(Client_proto_multisig.Lambda lambda) + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Change the delegate of a multisig contract." + non_transfer_options + (prefixes ["set"; "delegate"; "of"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefix "to" + @@ Client_keys.Public_key_hash.source_param + ~name:"dlgt" + ~desc:"new delegate of the new multisig contract" + @@ prefixes ["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + multisig_contract + delegate + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Client_proto_multisig.call_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~action: + (Client_proto_multisig.Change_delegate (Some delegate)) + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Withdraw the delegate of a multisig contract." + non_transfer_options + (prefixes ["withdraw"; "delegate"; "of"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + multisig_contract + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Client_proto_multisig.call_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~action:(Client_proto_multisig.Change_delegate None) + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc:"Change public keys and threshold for a multisig contract." + non_transfer_options + (prefixes ["set"; "threshold"; "of"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["to"] @@ threshold_param () + @@ prefixes ["and"; "public"; "keys"; "to"] + @@ non_terminal_seq (public_key_param ()) ~suffix:["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + multisig_contract + new_threshold + new_keys + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let* keys = + List.map_es + (fun (pk_uri, _) -> Client_keys.public_key pk_uri) + new_keys + in + let*! errors = + Client_proto_multisig.call_multisig + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~action: + (Client_proto_multisig.Change_keys + (Z.of_int new_threshold, keys)) + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + (* This command is no longer necessary as Tezos_clic now supports non terminal + lists of parameters, however, it is kept for compatibility. *) + command + ~group + ~desc: + "Run a transaction described by a sequence of bytes on a multisig \ + contract." + non_transfer_options + (prefixes ["run"; "transaction"] + @@ bytes_param + ~name:"bytes" + ~desc: + "the sequence of bytes to deserialize as a multisig action, can \ + be obtained by one of the \"prepare multisig transaction\" \ + commands" + @@ prefixes ["on"; "multisig"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["on"; "behalf"; "of"] + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"src" + ~desc:"source calling the multisig contract" + @@ prefixes ["with"; "signatures"] + @@ seq_of_param (signature_param ())) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + bytes + multisig_contract + source + signatures + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith + "only implicit accounts can be the source of a contract call" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let*! errors = + Client_proto_multisig.call_multisig_on_bytes + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run + ~verbose_signing + ~fee_parameter + ~source + ?fee + ~src_pk + ~src_sk + ~multisig_contract + ~bytes + ~signatures + ~amount:Tez.zero + ?gas_limit + ?storage_limit + ?counter + () + in + let*! (_ : (_ Injection.result * Contract_hash.t list) option) = + Client_proto_context_commands.report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + in + return_unit); + command + ~group + ~desc: + "Display the threshold, public keys, and byte sequence to sign for a \ + multisigned transfer." + (args3 bytes_only_switch arg_arg entrypoint_arg) + (prefixes ["prepare"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefix "transferring" + @@ Client_proto_args.tez_param + ~name:"qty" + ~desc:"amount taken from source" + @@ prefix "to" + @@ Client_proto_contracts.ContractAlias.destination_param + ~name:"dst" + ~desc:"name/literal of the destination contract" + @@ stop) + (fun (bytes_only, parameter, entrypoint) + multisig_contract + amount + destination + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let entrypoint = + Option.value ~default:Entrypoint.default entrypoint + in + let parameter = Option.value ~default:"Unit" parameter in + let*? {expanded = parameter; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression parameter + in + let* parameter_type = + get_parameter_type cctxt ~destination ~entrypoint + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action: + (Client_proto_multisig.Transfer + {amount; destination; entrypoint; parameter_type; parameter}) + () + in + return @@ prepare_command_display prepared_command bytes_only); + command + ~group + ~desc: + "Display the threshold, public keys, and byte sequence to sign for a \ + multisigned lambda execution in a generic multisig contract." + (args1 bytes_only_switch) + (prefixes ["prepare"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["running"; "lambda"] + @@ lambda_param () @@ stop) + (fun bytes_only + multisig_contract + lambda + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*? {expanded = lambda; _} = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression lambda + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action:(Client_proto_multisig.Lambda lambda) + () + in + return @@ prepare_command_display prepared_command bytes_only); + command + ~group + ~desc: + "Display the threshold, public keys, and byte sequence to sign for a \ + multisigned delegate change." + (args1 bytes_only_switch) + (prefixes ["prepare"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["setting"; "delegate"; "to"] + @@ Client_keys.Public_key_hash.source_param + ~name:"dlgt" + ~desc:"new delegate of the new multisig contract" + @@ stop) + (fun bytes_only + multisig_contract + new_delegate + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action: + (Client_proto_multisig.Change_delegate (Some new_delegate)) + () + in + return @@ prepare_command_display prepared_command bytes_only); + command + ~group + ~desc: + "Display the threshold, public keys, and byte sequence to sign for a \ + multisigned delegate withdraw." + (args1 bytes_only_switch) + (prefixes ["prepare"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["withdrawing"; "delegate"] + @@ stop) + (fun bytes_only + multisig_contract + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action:(Client_proto_multisig.Change_delegate None) + () + in + return @@ prepare_command_display prepared_command bytes_only); + command + ~group + ~desc: + "Display the threshold, public keys, and byte sequence to sign for a \ + multisigned change of keys and threshold." + (args1 bytes_only_switch) + (prefixes ["prepare"; "multisig"; "transaction"; "on"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"multisig" + ~desc:"name or address of the originated multisig contract" + @@ prefixes ["setting"; "threshold"; "to"] + @@ threshold_param () + @@ prefixes ["and"; "public"; "keys"; "to"] + @@ seq_of_param (public_key_param ())) + (fun bytes_only + multisig_contract + new_threshold + new_keys + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* keys = + List.map_es + (fun (pk_uri, _) -> Client_keys.public_key pk_uri) + new_keys + in + let* prepared_command = + Client_proto_multisig.prepare_multisig_transaction + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~multisig_contract + ~action: + (Client_proto_multisig.Change_keys (Z.of_int new_threshold, keys)) + () + in + return @@ prepare_command_display prepared_command bytes_only); + ] + +let commands () = commands_ro () @ commands_rw () diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.mli new file mode 100644 index 000000000000..7cd3668e789d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_multisig_commands.mli @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val commands : unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.ml new file mode 100644 index 000000000000..df0b2eec95f3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.ml @@ -0,0 +1,1160 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let group = + { + Tezos_clic.name = "scripts"; + title = "Commands for managing the library of known scripts"; + } + +open Tezos_micheline +open Client_proto_programs +open Client_proto_args +open Client_proto_contracts + +let safe_decode_json (cctxt : Protocol_client_context.full) encoding json = + match Data_encoding.Json.destruct encoding json with + | exception Data_encoding.Json.Cannot_destruct (_, exc) -> + cctxt#error + "could not decode json (%a)" + (Data_encoding.Json.print_error ~print_unknown:(fun fmt exc -> + Format.fprintf fmt "%s" (Printexc.to_string exc))) + exc + | exception ((Stack_overflow | Out_of_memory) as exc) -> raise exc + | exception exc -> + cctxt#error "could not decode json (%s)" (Printexc.to_string exc) + | expr -> Lwt_result_syntax.return expr + +let commands () = + let open Tezos_clic in + let show_types_switch = + switch + ~long:"details" + ~short:'v' + ~doc:"show the types of each instruction" + () + in + let emacs_mode_switch = + switch + ~long:"emacs" + ?short:None + ~doc:"output in `michelson-mode.el` compatible format" + () + in + let trace_stack_switch = + switch ~long:"trace-stack" ~doc:"show the stack after each step" () + in + let zero_loc_switch = + switch ~short:'z' ~long:"zero-loc" ~doc:"replace location with \"0\"" () + in + let legacy_switch = + switch + ~long:"legacy" + ~doc:"typecheck in legacy mode as if the data was taken from the chain" + () + in + let amount_arg = + Client_proto_args.tez_arg + ~parameter:"amount" + ~doc:"amount of the transfer in \xEA\x9C\xA9" + ~default:"0.05" + in + let source_arg = + ContractAlias.destination_arg + ~name:"source" + ~doc:"name of the source (i.e. SENDER) contract for the transaction" + () + in + let payer_arg = + Client_keys.Public_key_hash.source_arg + ~long:"payer" + ~doc:"name of the payer (i.e. SOURCE) contract for the transaction" + () + in + let self_arg = + OriginatedContractAlias.destination_arg + ~name:"self-address" + ~doc:"address of the contract (i.e. SELF_ADDRESS) for the transaction" + () + in + let balance_arg = + Client_proto_args.tez_opt_arg + ~parameter:"balance" + ~doc:"balance of run contract in \xEA\x9C\xA9" + in + let now_arg = Client_proto_args.now_arg in + let level_arg = Client_proto_args.level_arg in + let resolve_max_gas cctxt block = + let open Lwt_result_syntax in + function + | None -> + let* {parametric = {hard_gas_limit_per_operation; _}; _} = + Alpha_services.Constants.all cctxt (cctxt#chain, block) + in + return hard_gas_limit_per_operation + | Some gas -> return gas + in + let parse_expr expr = + Lwt.return @@ Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression expr + in + let data_type_arg = + arg + ~doc:"the given data will be type-checked against this type" + ~short:'t' + ~long:"type" + ~placeholder:"unit" + data_parameter + in + let bytes_parameter ~name ~desc = + param ~name ~desc Client_proto_args.bytes_parameter + in + let signature_parameter = + parameter (fun _cctxt s -> + match Tezos_crypto.Signature.of_b58check_opt s with + | Some s -> Lwt_result_syntax.return s + | None -> failwith "Not given a valid signature") + in + let convert_input_format_param = + let open Lwt_result_syntax in + param + ~name:"input_format" + ~desc:"format of the input for conversion" + (parameter + ~autocomplete:(fun _ -> return ["michelson"; "json"; "binary"]) + (fun _ s -> + match String.lowercase_ascii s with + | "michelson" -> return `Michelson + | "json" -> return `JSON + | "binary" -> return `Binary + | _ -> + failwith + "invalid input format, expecting one of \"michelson\", \ + \"json\" or \"binary\".")) + in + let convert_output_format_param = + let open Lwt_result_syntax in + param + ~name:"output_format" + ~desc:"format of the conversion output" + (parameter + ~autocomplete:(fun _ -> + return ["michelson"; "json"; "binary"; "ocaml"]) + (fun _ s -> + match String.lowercase_ascii s with + | "michelson" -> return `Michelson + | "json" -> return `JSON + | "binary" -> return `Binary + | "ocaml" -> return `OCaml + | _ -> + failwith + "invalid output format, expecting one of \"michelson\", \ + \"json\", \"binary\" or \"ocaml\".")) + in + let file_or_literal_param () = + param + ~name:"source" + ~desc:"literal or a path to a file" + (parameter (fun cctxt s -> + let open Lwt_result_syntax in + let*! r = cctxt#read_file s in + match r with + | Ok v -> return (Some s, v) + | Error _ -> return (None, s))) + in + let handle_parsing_error label (cctxt : Protocol_client_context.full) + (emacs_mode, no_print_source) program body = + let open Lwt_result_syntax in + match program with + | program, [] -> body program + | res_with_errors when emacs_mode -> + let*! () = + cctxt#message + "(@[<v 0>(%s . ())@ (errors . %a)@])" + label + Michelson_v1_emacs.report_errors + res_with_errors + in + return_unit + | parsed, errors -> + let*! () = + cctxt#message + "%a" + (fun ppf () -> + Michelson_v1_error_reporter.report_errors + ~details:(not no_print_source) + ~parsed + ~show_source:(not no_print_source) + ppf + errors) + () + in + cctxt#error "syntax error in program" + in + [ + command + ~group + ~desc:"Lists all scripts in the library." + no_options + (fixed ["list"; "known"; "scripts"]) + (fun () (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* list = Program.load cctxt in + let*! () = List.iter_s (fun (n, _) -> cctxt#message "%s" n) list in + return_unit); + command + ~group + ~desc:"Add a script to the library." + (args1 (Program.force_switch ())) + (prefixes ["remember"; "script"] + @@ Program.fresh_alias_param @@ Program.source_param @@ stop) + (fun force name hash cctxt -> + let open Lwt_result_syntax in + let* name = Program.of_fresh cctxt force name in + Program.add ~force cctxt name hash); + command + ~group + ~desc:"Remove a script from the library." + no_options + (prefixes ["forget"; "script"] @@ Program.alias_param @@ stop) + (fun () (name, _) cctxt -> Program.del cctxt name); + command + ~group + ~desc:"Display a script from the library." + no_options + (prefixes ["show"; "known"; "script"] @@ Program.alias_param @@ stop) + (fun () (_, program) (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source = Program.to_source program in + let*! () = cctxt#message "%s\n" source in + return_unit); + command + ~group + ~desc:"Ask the node to run a script." + (args12 + trace_stack_switch + amount_arg + balance_arg + source_arg + payer_arg + self_arg + no_print_source_flag + run_gas_limit_arg + entrypoint_arg + (unparsing_mode_arg ~default:"Readable") + now_arg + level_arg) + (prefixes ["run"; "script"] + @@ Program.source_param + @@ prefixes ["on"; "storage"] + @@ param ~name:"storage" ~desc:"the storage data" data_parameter + @@ prefixes ["and"; "input"] + @@ param ~name:"input" ~desc:"the input data" data_parameter + @@ stop) + (fun ( trace_exec, + amount, + balance, + source, + payer, + self, + no_print_source, + gas, + entrypoint, + unparsing_mode, + now, + level ) + program + storage + input + cctxt -> + let open Lwt_result_syntax in + let*? program = Micheline_parser.no_parsing_error program in + let show_source = not no_print_source in + if trace_exec then + let*! res = + trace + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + { + amount = Some amount; + balance; + program; + storage; + shared_params = + {input; unparsing_mode; now; level; source; payer; gas}; + entrypoint; + self; + } + in + print_trace_result cctxt ~show_source ~parsed:program res + else + let*! res = + run + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + { + amount = Some amount; + balance; + program; + storage; + shared_params = + {input; unparsing_mode; now; level; source; payer; gas}; + entrypoint; + self; + } + in + print_run_result cctxt ~show_source ~parsed:program res); + command + ~group + ~desc:"Ask the node to compute the size of a script." + (args4 + emacs_mode_switch + no_print_source_flag + run_gas_limit_arg + legacy_switch) + (prefixes ["compute"; "size"; "for"; "script"] + @@ Program.source_param + @@ prefixes ["on"; "storage"] + @@ param ~name:"storage" ~desc:"the storage data" data_parameter + @@ stop) + (fun (emacs_mode, no_print_source, original_gas, legacy) + program + storage + cctxt -> + let open Lwt_result_syntax in + let setup = (emacs_mode, no_print_source) in + let* original_gas = resolve_max_gas cctxt cctxt#block original_gas in + handle_parsing_error "size" cctxt setup program @@ fun program -> + let* code_size = + script_size + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~gas:original_gas + ~legacy + ~program + ~storage + () + in + let*! () = cctxt#message "%d" code_size in + return_unit); + command + ~group + ~desc:"Ask the node to typecheck a script." + (args5 + show_types_switch + emacs_mode_switch + no_print_source_flag + run_gas_limit_arg + legacy_switch) + (prefixes ["typecheck"; "script"] @@ Program.source_param @@ stop) + (fun (show_types, emacs_mode, no_print_source, original_gas, legacy) + program + cctxt -> + let open Lwt_result_syntax in + let setup = (emacs_mode, no_print_source) in + handle_parsing_error "types" cctxt setup program @@ fun program -> + let* original_gas = resolve_max_gas cctxt cctxt#block original_gas in + let*! res = + typecheck_program + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~gas:original_gas + ~legacy + ~show_types + program + in + print_typecheck_result + ~emacs:emacs_mode + ~show_types + ~print_source_on_error:(not no_print_source) + program + res + cctxt); + command + ~group + ~desc:"Ask the node to typecheck a data expression." + (args3 no_print_source_flag run_gas_limit_arg legacy_switch) + (prefixes ["typecheck"; "data"] + @@ param ~name:"data" ~desc:"the data to typecheck" data_parameter + @@ prefixes ["against"; "type"] + @@ param ~name:"type" ~desc:"the expected type" data_parameter + @@ stop) + (fun (no_print_source, custom_gas, legacy) data ty cctxt -> + let open Lwt_result_syntax in + let* original_gas = resolve_max_gas cctxt cctxt#block custom_gas in + let*! r = + Client_proto_programs.typecheck_data + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~gas:original_gas + ~legacy + ~data + ~ty + () + in + match r with + | Ok gas -> + let*! () = + cctxt#message + "@[<v 0>Well typed@,Gas remaining: %a@]" + Alpha_context.Gas.pp + gas + in + return_unit + | Error errs -> + let*! () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:(not no_print_source) + ?parsed:None) + errs + in + cctxt#error "ill-typed data"); + command + ~group + ~desc: + "Ask the node to pack a data expression.\n\ + The returned hash is the same as what Michelson instruction `PACK` \ + would have produced.\n\ + Also displays the result of hashing this packed data with `BLAKE2B`, \ + `SHA256` or `SHA512` instruction." + (args2 run_gas_limit_arg (Tezos_clic_unix.Scriptable.clic_arg ())) + (prefixes ["hash"; "data"] + @@ param ~name:"data" ~desc:"the data to hash" data_parameter + @@ prefixes ["of"; "type"] + @@ param ~name:"type" ~desc:"type of the data" data_parameter + @@ stop) + (fun (custom_gas, scriptable) data typ cctxt -> + let open Lwt_result_syntax in + let* original_gas = resolve_max_gas cctxt cctxt#block custom_gas in + let*! r = + Plugin.RPC.Scripts.pack_data + cctxt + (cctxt#chain, cctxt#block) + ~gas:original_gas + ~data:data.expanded + ~ty:typ.expanded + in + match r with + | Ok (bytes, remaining_gas) -> + let hash = Script_expr_hash.hash_bytes [bytes] in + let name_value_rows = + Format. + [ + ( "Raw packed data", + asprintf "0x%a" Hex.pp (Hex.of_bytes bytes) ); + ( "Script-expression-ID-Hash", + asprintf "%a" Script_expr_hash.pp hash ); + ( "Raw Script-expression-ID-Hash", + asprintf + "0x%a" + Hex.pp + (Hex.of_bytes (Script_expr_hash.to_bytes hash)) ); + ( "Ledger Blake2b hash", + Tezos_crypto.Base58.raw_encode + Tezos_crypto.Blake2B.(hash_bytes [bytes] |> to_string) ); + ( "Raw Sha256 hash", + asprintf + "0x%a" + Hex.pp + (Hex.of_bytes (Environment.Raw_hashes.sha256 bytes)) ); + ( "Raw Sha512 hash", + asprintf + "0x%a" + Hex.pp + (Hex.of_bytes (Environment.Raw_hashes.sha512 bytes)) ); + ( "Gas remaining", + asprintf "%a" Alpha_context.Gas.pp remaining_gas ); + ] + in + Tezos_clic_unix.Scriptable.output + scriptable + ~for_human:(fun () -> + let*! () = + List.iter_s + (fun (name, value) -> cctxt#message "%s: %s" name value) + name_value_rows + in + return_unit) + ~for_script:(fun () -> + name_value_rows |> List.map (fun (name, value) -> [name; value])) + | Error errs -> + let*! () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ?parsed:None) + errs + in + cctxt#error "ill-formed data"); + command + ~group + ~desc:"Ask the node to hash a Michelson script with `BLAKE2B`." + (args3 + enforce_indentation_flag + display_names_flag + (Tezos_clic_unix.Scriptable.clic_arg ())) + (prefixes ["hash"; "script"] @@ seq_of_param @@ file_or_literal_param ()) + (fun (check, display_names, scriptable) + expr_strings + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + if List.compare_length_with expr_strings 0 = 0 then + let*! () = + cctxt#warning "No scripts were specified on the command line" + in + return_unit + else + let* hash_name_rows = + List.mapi_ep + (fun i (src, expr_string) -> + let program = + Michelson_v1_parser.parse_toplevel ~check expr_string + in + let*? program = Micheline_parser.no_parsing_error program in + let code = program.expanded in + let bytes = + Data_encoding.Binary.to_bytes_exn + Alpha_context.Script.expr_encoding + code + in + let hash = + Format.asprintf + "%a" + Script_expr_hash.pp + (Script_expr_hash.hash_bytes [bytes]) + in + let name = + Option.value + src + ~default:("Literal script " ^ string_of_int (i + 1)) + in + return (hash, name)) + expr_strings + in + Tezos_clic_unix.Scriptable.output + scriptable + ~for_human:(fun () -> + let*! () = + List.iter_s + (fun (hash, name) -> + if display_names then cctxt#answer "%s\t%s" hash name + else cctxt#answer "%s" hash) + hash_name_rows + in + return_unit) + ~for_script:(fun () -> + List.map + (fun (hash, name) -> + if display_names then [hash; name] else [hash]) + hash_name_rows)); + command + ~group + ~desc: + "Parse a byte sequence (in hexadecimal notation) as a data expression, \ + as per Michelson instruction `UNPACK`." + no_options + (prefixes ["unpack"; "michelson"; "data"] + @@ bytes_parameter ~name:"bytes" ~desc:"the packed data to parse" + @@ stop) + (fun () bytes cctxt -> + let open Lwt_result_syntax in + let* () = + if Bytes.get bytes 0 != '\005' then + failwith + "Not a piece of packed Michelson data (must start with `0x05`)" + else return_unit + in + (* Remove first byte *) + let bytes = Bytes.sub bytes 1 (Bytes.length bytes - 1) in + match + Data_encoding.Binary.of_bytes_opt + Alpha_context.Script.expr_encoding + bytes + with + | None -> failwith "Could not decode bytes" + | Some expr -> + let*! () = + cctxt#message "%a" Michelson_v1_printer.print_expr_unwrapped expr + in + return_unit); + command + ~group + ~desc:"Ask the node to normalize a script." + (args1 (unparsing_mode_arg ~default:"Readable")) + (prefixes ["normalize"; "script"] @@ Program.source_param @@ stop) + (fun unparsing_mode program cctxt -> + let open Lwt_result_syntax in + let*? program = Micheline_parser.no_parsing_error program in + let*! r = + Plugin.RPC.Scripts.normalize_script + cctxt + (cctxt#chain, cctxt#block) + ~script:program.expanded + ~unparsing_mode + in + match r with + | Ok program -> + let*! () = + cctxt#message + "%a" + (fun ppf () : unit -> + Michelson_v1_printer.print_expr_unwrapped ppf program) + () + in + return_unit + | Error errs -> + let*! () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ?parsed:None) + errs + in + cctxt#error "ill-typed script"); + command + ~group + ~desc:"Ask the node to normalize a data expression." + (args2 (unparsing_mode_arg ~default:"Readable") legacy_switch) + (prefixes ["normalize"; "data"] + @@ param + ~name:"data" + ~desc:"the data expression to normalize" + data_parameter + @@ prefixes ["of"; "type"] + @@ param ~name:"type" ~desc:"type of the data expression" data_parameter + @@ stop) + (fun (unparsing_mode, legacy) data typ cctxt -> + let open Lwt_result_syntax in + let*! r = + Plugin.RPC.Scripts.normalize_data + cctxt + (cctxt#chain, cctxt#block) + ~legacy + ~data:data.expanded + ~ty:typ.expanded + ~unparsing_mode + in + match r with + | Ok expr -> + let*! () = + cctxt#message "%a" Michelson_v1_printer.print_expr_unwrapped expr + in + return_unit + | Error errs -> + let*! () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ?parsed:None) + errs + in + cctxt#error "ill-typed data expression"); + command + ~group + ~desc:"Ask the node to normalize a type." + no_options + (prefixes ["normalize"; "type"] + @@ param + ~name:"typ" + ~desc:"the Michelson type to normalize" + data_parameter + @@ stop) + (fun () typ cctxt -> + let open Lwt_result_syntax in + let*! r = + Plugin.RPC.Scripts.normalize_type + cctxt + (cctxt#chain, cctxt#block) + ~ty:typ.expanded + in + match r with + | Ok expr -> + let*! () = + cctxt#message "%a" Michelson_v1_printer.print_expr_unwrapped expr + in + return_unit + | Error errs -> + let*! () = + cctxt#warning + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ?parsed:None) + errs + in + cctxt#error "ill-formed type"); + command + ~group + ~desc: + "Sign a raw sequence of bytes and display it using the format expected \ + by Michelson instruction `CHECK_SIGNATURE`." + no_options + (prefixes ["sign"; "bytes"] + @@ bytes_parameter ~name:"data" ~desc:"the raw data to sign" + @@ prefixes ["for"] @@ Client_keys.Secret_key.source_param @@ stop) + (fun () bytes sk cctxt -> + let open Lwt_result_syntax in + let* signature = Client_keys.sign cctxt sk bytes in + let*! () = + cctxt#message "Signature: %a" Tezos_crypto.Signature.pp signature + in + return_unit); + command + ~group + ~desc: + "Check the signature of a byte sequence as per Michelson instruction \ + `CHECK_SIGNATURE`." + (args1 (switch ~doc:"Use only exit codes" ~short:'q' ~long:"quiet" ())) + (prefixes ["check"; "that"; "bytes"] + @@ bytes_parameter ~name:"bytes" ~desc:"the signed data" + @@ prefixes ["were"; "signed"; "by"] + @@ Client_keys.Public_key.alias_param ~name:"key" + @@ prefixes ["to"; "produce"] + @@ param + ~name:"signature" + ~desc:"the signature to check" + signature_parameter + @@ stop) + (fun quiet + bytes + (_, (key_locator, _)) + signature + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* check = Client_keys.check key_locator signature bytes in + if check then + if quiet then return_unit + else + let*! () = cctxt#message "Signature check successful." in + return_unit + else cctxt#error "invalid signature"); + command + ~group + ~desc:"Ask the type of an entrypoint of a script." + (args2 emacs_mode_switch no_print_source_flag) + (prefixes ["get"; "script"; "entrypoint"; "type"; "of"] + @@ param + ~name:"entrypoint" + ~desc:"the entrypoint to describe" + entrypoint_parameter + @@ prefixes ["for"] @@ Program.source_param @@ stop) + (fun ((emacs_mode, no_print_source) as setup) entrypoint program cctxt -> + let open Lwt_syntax in + handle_parsing_error "entrypoint" cctxt setup program @@ fun program -> + let* entrypoint_type = + entrypoint_type + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + program + ~entrypoint + in + print_entrypoint_type + ~emacs:emacs_mode + ~show_source:(not no_print_source) + ~parsed:program + ~entrypoint + cctxt + entrypoint_type); + command + ~group + ~desc:"Ask the node to list the entrypoints of a script." + (args2 emacs_mode_switch no_print_source_flag) + (prefixes ["get"; "script"; "entrypoints"; "for"] + @@ Program.source_param @@ stop) + (fun ((emacs_mode, no_print_source) as setup) program cctxt -> + let open Lwt_syntax in + handle_parsing_error "entrypoints" cctxt setup program @@ fun program -> + let* entrypoints = + list_entrypoints cctxt ~chain:cctxt#chain ~block:cctxt#block program + in + print_entrypoints_list + ~emacs:emacs_mode + ~show_source:(not no_print_source) + ~parsed:program + cctxt + entrypoints); + command + ~group + ~desc: + "Ask the node to list the unreachable paths in a script's parameter \ + type." + (args2 emacs_mode_switch no_print_source_flag) + (prefixes ["get"; "script"; "unreachable"; "paths"; "for"] + @@ Program.source_param @@ stop) + (fun ((emacs_mode, no_print_source) as setup) program cctxt -> + let open Lwt_syntax in + handle_parsing_error "entrypoints" cctxt setup program @@ fun program -> + let* entrypoints = + list_unreachables cctxt ~chain:cctxt#chain ~block:cctxt#block program + in + print_unreachables + ~emacs:emacs_mode + ~show_source:(not no_print_source) + ~parsed:program + cctxt + entrypoints); + command + ~group + ~desc:"Ask the node to expand the Michelson macros in a script." + no_options + (prefixes ["expand"; "macros"; "in"] @@ Program.source_param @@ stop) + (fun () program (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let*? program = Micheline_parser.no_parsing_error program in + let*! () = + cctxt#message + "%a" + (fun ppf () : unit -> + Michelson_v1_printer.print_expr_unwrapped ppf program.expanded) + () + in + return_unit); + command + ~desc: + "Conversion of Michelson script from Micheline, JSON or binary to \ + Micheline, JSON, binary or OCaml" + (args3 zero_loc_switch legacy_switch enforce_indentation_flag) + (prefixes ["convert"; "script"] + @@ file_or_literal_param () @@ prefix "from" @@ convert_input_format_param + @@ prefix "to" @@ convert_output_format_param @@ stop) + (fun (zero_loc, legacy, check) + (_, expr_string) + from_format + to_format + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* (expression : Alpha_context.Script.expr) = + match from_format with + | `Michelson -> + let program = + Michelson_v1_parser.parse_toplevel ~check expr_string + in + let*? program = Micheline_parser.no_parsing_error program in + let* () = + let*! r = + typecheck_program + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~legacy + ~show_types:true + program + in + match r with + | Error _ as res -> + print_typecheck_result + ~emacs:false + ~show_types:true + ~print_source_on_error:true + program + res + cctxt + | Ok _ -> return_unit + in + return program.expanded + | `JSON -> ( + match Data_encoding.Json.from_string expr_string with + | Error err -> cctxt#error "%s" err + | Ok json -> + safe_decode_json cctxt Alpha_context.Script.expr_encoding json + ) + | `Binary -> ( + let* bytes = bytes_of_prefixed_string expr_string in + match + Data_encoding.Binary.of_bytes_opt + Alpha_context.Script.expr_encoding + bytes + with + | None -> failwith "Could not decode bytes" + | Some expr -> return expr) + in + let output = + match to_format with + | `Michelson -> + Micheline_printer.printable + Michelson_v1_primitives.string_of_prim + expression + |> Format.asprintf "%a" Micheline_printer.print_expr + | `JSON -> + Data_encoding.Json.( + construct Alpha_context.Script.expr_encoding expression + |> to_string) + | `Binary -> + Format.asprintf + "0x%s" + (Data_encoding.Binary.( + to_bytes_exn Alpha_context.Script.expr_encoding expression) + |> Hex.of_bytes |> Hex.show) + | `OCaml -> + Michelson_v1_printer.micheline_string_of_expression + ~zero_loc + expression + in + let*! () = cctxt#message "%s" output in + return_unit); + command + ~desc: + "Conversion of Micheline expression from Micheline, JSON or binary to \ + Micheline, JSON, binary or OCaml" + (args2 zero_loc_switch data_type_arg) + (prefixes ["convert"; "data"] + @@ file_or_literal_param () @@ prefix "from" @@ convert_input_format_param + @@ prefix "to" @@ convert_output_format_param @@ stop) + (fun (zero_loc, data_ty) + (_, data_string) + from_format + to_format + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let micheline_of_expr expr = + Micheline_printer.printable + Michelson_v1_primitives.string_of_prim + expr + |> Format.asprintf "%a" Micheline_printer.print_expr + in + let typecheck_parsed ~data ~ty = + let*! r = + Client_proto_programs.typecheck_data + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~data + ~ty + () + in + match r with + | Error errs -> + failwith + "%a" + (Michelson_v1_error_reporter.report_errors + ~details:false + ~show_source:false + ?parsed:None) + errs + | Ok _gas -> return data.expanded + in + let typecheck_expr ~expr ~ty = + let data_string = micheline_of_expr expr in + let* data = parse_expr data_string in + typecheck_parsed ~data ~ty + in + let* (expression : Alpha_context.Script.expr) = + match from_format with + | `Michelson -> ( + let* data = parse_expr data_string in + match data_ty with + | Some ty -> typecheck_parsed ~data ~ty + | None -> return data.expanded) + | `JSON -> ( + match Data_encoding.Json.from_string data_string with + | Error err -> cctxt#error "%s" err + | Ok json -> ( + let* expr = + safe_decode_json + cctxt + Alpha_context.Script.expr_encoding + json + in + match data_ty with + | None -> return expr + | Some ty -> typecheck_expr ~expr ~ty)) + | `Binary -> ( + let* bytes = bytes_of_prefixed_string data_string in + match + Data_encoding.Binary.of_bytes_opt + Alpha_context.Script.expr_encoding + bytes + with + | None -> failwith "Could not decode bytes" + | Some expr -> ( + match data_ty with + | None -> return expr + | Some ty -> typecheck_expr ~expr ~ty)) + in + let output = + match to_format with + | `Michelson -> micheline_of_expr expression + | `JSON -> + Data_encoding.Json.( + construct Alpha_context.Script.expr_encoding expression + |> to_string) + | `Binary -> + Format.asprintf + "0x%s" + (Data_encoding.Binary.( + to_bytes_exn Alpha_context.Script.expr_encoding expression) + |> Hex.of_bytes |> Hex.show) + | `OCaml -> + Michelson_v1_printer.micheline_string_of_expression + ~zero_loc + expression + in + let*! () = cctxt#message "%s" output in + return_unit); + command + ~group + ~desc:"Ask the node to run a TZIP-4 view." + (args6 + source_arg + payer_arg + run_gas_limit_arg + (unparsing_mode_arg ~default:"Readable") + now_arg + level_arg) + (prefixes ["run"; "tzip4"; "view"] + @@ param + ~name:"entrypoint" + ~desc:"the name of the view" + entrypoint_parameter + @@ prefixes ["on"; "contract"] + @@ OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"viewed contract" + @@ prefixes ["with"; "input"] + @@ param ~name:"input" ~desc:"the input data" data_parameter + @@ stop) + (fun (source, payer, gas, unparsing_mode, now, level) + entrypoint + contract + input + cctxt -> + let open Lwt_syntax in + let* res = + Client_proto_programs.run_view + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + { + shared_params = + {input; unparsing_mode; now; level; source; payer; gas}; + contract; + entrypoint; + } + in + print_view_result cctxt res); + command + ~group + ~desc:"Ask the node to run a Michelson view with Unit as input." + (args7 + source_arg + payer_arg + run_gas_limit_arg + unlimited_gas_arg + (unparsing_mode_arg ~default:"Readable") + now_arg + level_arg) + (prefixes ["run"; "view"] + @@ param ~name:"view" ~desc:"the name of the view" string_parameter + @@ prefixes ["on"; "contract"] + @@ OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"the contract containing the view" + @@ stop) + (fun (source, payer, gas, unlimited_gas, unparsing_mode, now, level) + view + contract + cctxt -> + let open Lwt_result_syntax in + let*? input = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_expression "Unit" + in + let*! res = + Client_proto_programs.run_script_view + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + { + shared_params = + {input; unparsing_mode; now; level; source; payer; gas}; + contract; + view; + unlimited_gas; + } + in + print_view_result cctxt res); + command + ~group + ~desc:"Ask the node to run a Michelson view." + (args7 + source_arg + payer_arg + run_gas_limit_arg + unlimited_gas_arg + (unparsing_mode_arg ~default:"Readable") + now_arg + level_arg) + (prefixes ["run"; "view"] + @@ param ~name:"view" ~desc:"the name of the view" string_parameter + @@ prefixes ["on"; "contract"] + @@ OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"the contract containing the view" + @@ prefixes ["with"; "input"] + @@ param + ~name:"input" + ~desc:"the argument provided to the view" + data_parameter + @@ stop) + (fun (source, payer, gas, unlimited_gas, unparsing_mode, now, level) + view + contract + input + cctxt -> + let open Lwt_syntax in + let* res = + Client_proto_programs.run_script_view + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + { + shared_params = + {input; unparsing_mode; now; level; source; payer; gas}; + contract; + view; + unlimited_gas; + } + in + print_view_result cctxt res); + ] diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.mli new file mode 100644 index 000000000000..4cfc1bea7d2b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_programs_commands.mli @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val commands : unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.ml new file mode 100644 index 000000000000..c98cd68feaa3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.ml @@ -0,0 +1,1985 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +module Smart_contracts = Client_proto_stresstest_contracts + +type transfer_strategy = + | Fixed_amount of {mutez : Tez.t} (** Amount to transfer *) + | Evaporation of {fraction : float} + (** Maximum fraction of current wealth to transfer. + Minimum amount is 1 mutez regardless of total wealth. *) + +type limit = + | Abs of int (** Absolute level at which we should stop *) + | Rel of int (** Relative number of levels before stopping *) + +type parameters = { + seed : int; + fresh_probability : float; + (** Per-transfer probability that the destination will be fresh *) + tps : float; (** Transaction per seconds target *) + strategy : transfer_strategy; + regular_transfer_fee : Tez.t; + (** fees for each transfer (except for transfers to smart contracts), in mutez *) + regular_transfer_gas_limit : Gas.Arith.integral; + (** gas limit per operation (except for transfers to smart contracts) *) + storage_limit : Z.t; (** storage limit per operation *) + account_creation_storage : Z.t; + (** upper bound on bytes consumed when creating a tz1 account *) + total_transfers : int option; + (** total number of transfers to perform; unbounded if None *) + level_limit : limit option; + (** total number of levels during which the stresstest is run; unbounded if None *) + smart_contracts : Smart_contracts.t; + (** An opaque type that stores all the information that is necessary for + efficient sampling of smart contract calls. *) +} + +type origin = Explicit | Wallet_pkh | Wallet_alias of string + +type source = { + pkh : public_key_hash; + pk : public_key; + sk : Tezos_crypto.Signature.secret_key; +} + +type source_with_uri = { + pkh : public_key_hash; + pk : public_key; + pk_uri : Client_keys.pk_uri; + sk : Tezos_crypto.Signature.secret_key; + sk_uri : Client_keys.sk_uri; +} + +type input_source = + | Explicit of source + | Wallet_alias of string + | Wallet_pkh of public_key_hash + +type source_origin = {source : source; origin : origin} + +(** Destination of a call: either an implicit contract or an originated one + with all the necessary data (entrypoint and the argument). *) +type destination = + | Implicit of Tezos_crypto.Signature.Public_key_hash.t + | Originated of Smart_contracts.invocation_parameters + +type transfer = { + src : source; + dst : destination; + fee : Tez.t; + gas_limit : Gas.Arith.integral; + amount : Tez.t; + counter : Manager_counter.t option; + fresh_dst : bool; +} + +type state = { + rng_state : Random.State.t; + current_head_on_start : Tezos_crypto.Block_hash.t; + mutable pool : source_origin list; + mutable pool_size : int; + mutable shuffled_pool : source list; + mutable revealed : Tezos_crypto.Signature.Public_key_hash.Set.t; + mutable last_block : Tezos_crypto.Block_hash.t; + mutable last_level : int; + mutable target_block : Tezos_crypto.Block_hash.t; + (** The block on top of which we are injecting transactions (HEAD~2). *) + new_block_condition : unit Lwt_condition.t; + injected_operations : + Tezos_crypto.Operation_hash.t list Tezos_crypto.Block_hash.Table.t; +} + +(** Cost estimations for every kind of transaction used in the stress test. + *) +type transaction_costs = { + regular : Gas.Arith.integral; (** Cost of a regular transaction. *) + smart_contracts : (string * Gas.Arith.integral) list; + (** Cost of a smart contract call (per contract alias). *) +} + +type verbosity = Notice | Info | Debug + +let verbosity = ref Notice + +let log level msg = + match (level, !verbosity) with + | Notice, _ | Info, Info | Info, Debug | Debug, Debug -> msg () + | _ -> Lwt.return_unit + +let pp_sep ppf () = Format.fprintf ppf ",@ " + +let default_parameters = + { + seed = 0x533D; + fresh_probability = 0.001; + tps = 5.0; + strategy = Fixed_amount {mutez = Tez.one}; + regular_transfer_fee = Tez.of_mutez_exn 2_000L; + regular_transfer_gas_limit = Gas.Arith.integral_of_int_exn 1_600; + (* [gas_limit] corresponds to a slight overapproximation of the + gas needed to inject an operation. It was obtained by simulating + the operation using the client. *) + storage_limit = Z.zero; + account_creation_storage = Z.of_int 300; + (* [account_creation_storage] corresponds to a slight overapproximation + of the storage consumed when allocating a new implicit account. + It was obtained by simulating the operation using the client. *) + total_transfers = None; + level_limit = None; + smart_contracts = Smart_contracts.no_contracts; + } + +let input_source_encoding = + let open Data_encoding in + union + [ + case + ~title:"explicit" + (Tag 0) + (obj3 + (req "pkh" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "pk" Tezos_crypto.Signature.Public_key.encoding) + (req "sk" Tezos_crypto.Signature.Secret_key.encoding)) + (function Explicit {pkh; pk; sk} -> Some (pkh, pk, sk) | _ -> None) + (fun (pkh, pk, sk) -> Explicit {pkh; pk; sk}); + case + ~title:"alias" + (Tag 1) + (obj1 (req "alias" Data_encoding.string)) + (function Wallet_alias alias -> Some alias | _ -> None) + (fun alias -> Wallet_alias alias); + case + ~title:"pkh" + (Tag 2) + (obj1 (req "pkh" Tezos_crypto.Signature.Public_key_hash.encoding)) + (function Wallet_pkh pkh -> Some pkh | _ -> None) + (fun pkh -> Wallet_pkh pkh); + ] + +let input_source_list_encoding = Data_encoding.list input_source_encoding + +let injected_operations_encoding = + let open Data_encoding in + list + (obj2 + (req "block_hash_when_injected" Tezos_crypto.Block_hash.encoding) + (req "operation_hashes" (list Tezos_crypto.Operation_hash.encoding))) + +let transaction_costs_encoding = + let open Data_encoding in + conv + (fun {regular; smart_contracts} -> (regular, smart_contracts)) + (fun (regular, smart_contracts) -> {regular; smart_contracts}) + (obj2 + (req "regular" Gas.Arith.n_integral_encoding) + (req "smart_contracts" (assoc Gas.Arith.n_integral_encoding))) + +let destination_to_contract dst = + match dst with + | Implicit x -> Contract.Implicit x + | Originated x -> x.destination + +let parse_strategy s = + match String.split ~limit:1 ':' s with + | ["fixed"; parameter] -> ( + match int_of_string parameter with + | exception _ -> Error "invalid integer literal" + | mutez when mutez <= 0 -> Error "negative amount" + | mutez -> ( + match Tez.of_mutez (Int64.of_int mutez) with + | None -> Error "invalid mutez" + | Some mutez -> Ok (Fixed_amount {mutez}))) + | ["evaporation"; parameter] -> ( + match float_of_string parameter with + | exception _ -> Error "invalid float literal" + | fraction when fraction < 0.0 || fraction > 1.0 -> + Error "invalid evaporation rate" + | fraction -> Ok (Evaporation {fraction})) + | _ -> Error "invalid argument" + +(** This command uses two different data structures for sources: + - The in-output files one, + - The normalized one. + + The data structure used for in-output files does not directly contain the + data required to forge operations. For efficiency purposes, the sources are + converted into a normalized data structure that contains all the required + data to forge operations and the format originally used to be able to + revert this conversion. *) + +(** [normalize_source cctxt src] converts [src] from in-output data structure + to normalized one. If the conversion fails, [None] is returned and a + warning message is printed in [cctxt]. + + Only unencrypted and encrypted sources from the wallet of [cctxt] are + supported. *) +let normalize_source cctxt = + let open Lwt_syntax in + let sk_of_sk_uri sk_uri = + match + Tezos_crypto.Signature.Secret_key.of_b58check + (Uri.path (sk_uri : Client_keys.sk_uri :> Uri.t)) + with + | Ok sk -> Lwt.return_some sk + | Error _ -> + let+ r = Tezos_signer_backends.Encrypted.decrypt cctxt sk_uri in + let sk = Option.of_result r in + Option.bind sk Tezos_crypto.Signature.Of_V_latest.secret_key + in + let key_from_alias alias = + let warning msg alias = + let* () = cctxt#warning msg alias in + return_none + in + let* key = + let* r = Client_keys.alias_keys cctxt alias in + match r with + | Error _ | Ok None -> + warning "Alias \"%s\" not found in the wallet" alias + | Ok (Some (_, None, _)) | Ok (Some (_, _, None)) -> + warning + "Alias \"%s\" does not contain public or secret key and could not \ + be used for stresstest" + alias + | Ok (Some (pkh, Some pk, Some sk_uri)) -> ( + let* o = sk_of_sk_uri sk_uri in + match o with + | None -> + warning + "Cannot extract the secret key form the alias \"%s\" of the \ + wallet" + alias + | Some sk -> + Lwt.return_some + {source = {pkh; pk; sk}; origin = Wallet_alias alias}) + in + match key with + | None -> warning "Source given as alias \"%s\" ignored" alias + | key -> Lwt.return key + in + let key_from_wallet pkh = + let warning msg pkh = + let* () = + cctxt#warning msg Tezos_crypto.Signature.Public_key_hash.pp pkh + in + return_none + in + let* key = + let* r = Client_keys.get_key cctxt pkh in + match r with + | Error _ -> warning "Pkh \"%a\" not found in the wallet" pkh + | Ok (alias, pk, sk_uri) -> ( + let* o = sk_of_sk_uri sk_uri in + match o with + | None -> + let* () = + cctxt#warning + "Cannot extract the secret key form the pkh \"%a\" (alias: \ + \"%s\") of the wallet" + Tezos_crypto.Signature.Public_key_hash.pp + pkh + alias + in + Lwt.return_none + | Some sk -> + Lwt.return_some {source = {pkh; pk; sk}; origin = Wallet_pkh}) + in + match key with + | None -> warning "Source given as pkh \"%a\" ignored" pkh + | key -> Lwt.return key + in + function + | Explicit source -> Lwt.return_some {source; origin = Explicit} + | Wallet_alias alias -> key_from_alias alias + | Wallet_pkh pkh -> key_from_wallet pkh + +(** [unnormalize_source src_org] converts [src_org] from normalized data + structure to in-output one. *) +let unnormalize_source src_org = + match src_org.origin with + | Explicit -> Explicit src_org.source + | Wallet_pkh -> Wallet_pkh src_org.source.pkh + | Wallet_alias alias -> Wallet_alias alias + +(** Samples from [state.pool]. Used to generate the destination of a + transfer. *) +let sample_any_source_from_pool state = + let idx = Random.State.int state.rng_state state.pool_size in + match List.nth state.pool idx with + | None -> assert false + | Some src_org -> Lwt.return src_org.source + +(** Takes and returns a source from [state.shuffled_pool]. Waits for a + new block if no source is available. *) +let rec get_source_from_shuffled_pool state + (cctxt : Protocol_client_context.full) = + let open Lwt_syntax in + match state.shuffled_pool with + | source :: l -> + state.shuffled_pool <- l ; + let* () = + log Debug (fun () -> + cctxt#message + "sample_transfer: %d unused sources for the block next to %a" + (List.length l) + Tezos_crypto.Block_hash.pp + state.last_block) + in + Lwt.return source + | [] -> + let* () = + cctxt#message + "all available sources have been used for block next to %a" + Tezos_crypto.Block_hash.pp + state.last_block + in + let* () = Lwt_condition.wait state.new_block_condition in + get_source_from_shuffled_pool state cctxt + +let random_seed rng = + Bytes.init 32 (fun _ -> Char.chr (Random.State.int rng 256)) + +let generate_fresh_source state = + let seed = random_seed state.rng_state in + let pkh, pk, sk = Tezos_crypto.Signature.generate_key ~seed () in + let fresh = {source = {pkh; pk; sk}; origin = Explicit} in + state.pool <- fresh :: state.pool ; + state.pool_size <- state.pool_size + 1 ; + fresh.source + +(* [heads_iter cctxt f] calls [f head] each time there is a new head received + by the streamed RPC /monitor/heads/main and returns [promise, stopper]. + [promise] resolved when the stream is closed. [stopper ()] closes the + stream. *) +let heads_iter (cctxt : Protocol_client_context.full) + (f : + Tezos_crypto.Block_hash.t * Tezos_base.Block_header.t -> + unit tzresult Lwt.t) : + (unit tzresult Lwt.t * Tezos_rpc.Context.stopper) tzresult Lwt.t = + let open Lwt_result_syntax in + let* heads_stream, stopper = Shell_services.Monitor.heads cctxt `Main in + let rec loop () : unit tzresult Lwt.t = + let*! block_hash_and_header = Lwt_stream.get heads_stream in + match block_hash_and_header with + | None -> Error_monad.failwith "unexpected end of block stream@." + | Some ((new_block_hash, _block_header) as block_hash_and_header) -> + Lwt.catch + (fun () -> + let*! () = + log Debug (fun () -> + cctxt#message + "heads_iter: new block received %a@." + Tezos_crypto.Block_hash.pp + new_block_hash) + in + let* protocols = + Shell_services.Blocks.protocols + cctxt + ~block:(`Hash (new_block_hash, 0)) + () + in + if + Tezos_crypto.Protocol_hash.( + protocols.current_protocol = Protocol.hash) + then + let* () = f block_hash_and_header in + loop () + else + let*! () = + log Debug (fun () -> + cctxt#message + "heads_iter: new block on protocol %a. Stopping \ + iteration.@." + Tezos_crypto.Protocol_hash.pp + protocols.current_protocol) + in + return_unit) + (fun exn -> + Error_monad.failwith + "An exception occurred on a function bound on new heads : %s@." + (Printexc.to_string exn)) + in + let promise = loop () in + let*! () = + log Debug (fun () -> + cctxt#message + "head iteration for proto %a stopped@." + Tezos_crypto.Protocol_hash.pp + Protocol.hash) + in + return (promise, stopper) + +let sample_smart_contracts smart_contracts rng_state = + let smart_contract = + Smart_contracts.select smart_contracts (Random.State.float rng_state 1.0) + in + Option.map + (fun invocation_parameters -> + ( Originated invocation_parameters, + invocation_parameters.fee, + invocation_parameters.gas_limit )) + smart_contract + +(* We perform rejection sampling of valid sources. + We could maintain a local cache of existing contracts with sufficient balance. *) +let rec sample_transfer (cctxt : Protocol_client_context.full) chain block + (parameters : parameters) (state : state) = + let open Lwt_result_syntax in + let*! src = get_source_from_shuffled_pool state cctxt in + let* tez = + Alpha_services.Contract.balance + cctxt + (chain, block) + (Contract.Implicit src.pkh) + in + if Tez.(tez = zero) then + let*! () = + log Debug (fun () -> + cctxt#message + "sample_transfer: invalid balance %a" + Tezos_crypto.Signature.Public_key_hash.pp + src.pkh) + in + (* Sampled source has zero balance: the transfer that created that + address was not included yet. Retry *) + sample_transfer cctxt chain block parameters state + else + let fresh = + Random.State.float state.rng_state 1.0 < parameters.fresh_probability + in + let* dst, fee, gas_limit = + match + sample_smart_contracts parameters.smart_contracts state.rng_state + with + | None -> + let*! dest = + if fresh then Lwt.return (generate_fresh_source state) + else sample_any_source_from_pool state + in + return + ( Implicit dest.pkh, + parameters.regular_transfer_fee, + parameters.regular_transfer_gas_limit ) + | Some v -> return v + in + let amount = + match parameters.strategy with + | Fixed_amount {mutez} -> mutez + | Evaporation {fraction} -> + let mutez = Int64.to_float (Tez.to_mutez tez) in + let max_fraction = Int64.of_float (mutez *. fraction) in + let amount = + if max_fraction = 0L then 1L + else max 1L (Random.State.int64 state.rng_state max_fraction) + in + Tez.of_mutez_exn amount + in + return {src; dst; fee; gas_limit; amount; counter = None; fresh_dst = fresh} + +let inject_contents (cctxt : Protocol_client_context.full) branch sk contents = + let bytes = + Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + ({branch}, Contents_list contents) + in + let signature = + Some + (Tezos_crypto.Signature.sign + ~watermark:Tezos_crypto.Signature.Generic_operation + sk + bytes) + in + let op : _ Operation.t = + {shell = {branch}; protocol_data = {contents; signature}} + in + let bytes = + Data_encoding.Binary.to_bytes_exn Operation.encoding (Operation.pack op) + in + Shell_services.Injection.operation cctxt bytes + +(* counter _must_ be set before calling this function *) +let manager_op_of_transfer parameters + {src; dst; fee; gas_limit; amount; counter; fresh_dst} = + let source = src.pkh in + let storage_limit = + if fresh_dst then + Z.add parameters.account_creation_storage parameters.storage_limit + else parameters.storage_limit + in + let operation = + let parameters = + let open Tezos_micheline in + Script.lazy_expr + (match dst with + | Implicit _ -> + Micheline.strip_locations + (Prim (0, Michelson_v1_primitives.D_Unit, [], [])) + | Originated x -> x.arg) + in + let entrypoint = + match dst with + | Implicit _ -> Entrypoint.default + | Originated x -> x.entrypoint + in + let destination = destination_to_contract dst in + Transaction {amount; parameters; entrypoint; destination} + in + match counter with + | None -> assert false + | Some counter -> + Manager_operation + {source; fee; counter; operation; gas_limit; storage_limit} + +let cost_of_manager_operation = Gas.Arith.integral_of_int_exn 1_000 + +let inject_transfer (cctxt : Protocol_client_context.full) parameters state + transfer = + let open Lwt_result_syntax in + let* branch = Shell_services.Blocks.hash cctxt () in + let* current_counter = + Alpha_services.Contract.counter cctxt (`Main, `Head 0) transfer.src.pkh + in + let* already_revealed = + if + Tezos_crypto.Signature.Public_key_hash.Set.mem + transfer.src.pkh + state.revealed + then return true + else ( + (* Either the [manager_key] RPC tells us the key is already + revealed, or we immediately inject a reveal operation: in any + case the key is revealed in the end. *) + state.revealed <- + Tezos_crypto.Signature.Public_key_hash.Set.add + transfer.src.pkh + state.revealed ; + let* pk_opt = + Alpha_services.Contract.manager_key + cctxt + (`Main, `Head 0) + transfer.src.pkh + in + return (Option.is_some pk_opt)) + in + let*! r = + if not already_revealed then + let reveal_counter = Manager_counter.succ current_counter in + let transf_counter = Manager_counter.succ reveal_counter in + let reveal = + Manager_operation + { + source = transfer.src.pkh; + fee = Tez.zero; + counter = reveal_counter; + gas_limit = cost_of_manager_operation; + storage_limit = Z.zero; + operation = Reveal transfer.src.pk; + } + in + let manager_op = + manager_op_of_transfer + parameters + {transfer with counter = Some transf_counter} + in + let list = Cons (reveal, Single manager_op) in + let*! () = + log Info (fun () -> + cctxt#message + "injecting reveal+transfer from %a (counters=%a,%a) to %a" + Tezos_crypto.Signature.Public_key_hash.pp + transfer.src.pkh + Manager_counter.pp + reveal_counter + Manager_counter.pp + transf_counter + Contract.pp + (destination_to_contract transfer.dst)) + in + (* NB: regardless of our best efforts to keep track of counters, injection can fail with + "counter in the future" if a block switch happens in between the moment we + get the branch and the moment we inject, and the new block does not include + all the operations we injected. *) + inject_contents cctxt state.target_block transfer.src.sk list + else + let transf_counter = Manager_counter.succ current_counter in + let manager_op = + manager_op_of_transfer + parameters + {transfer with counter = Some transf_counter} + in + let list = Single manager_op in + let*! () = + log Info (fun () -> + cctxt#message + "injecting transfer from %a (counter=%a) to %a" + Tezos_crypto.Signature.Public_key_hash.pp + transfer.src.pkh + Manager_counter.pp + transf_counter + Contract.pp + (destination_to_contract transfer.dst)) + in + (* See comment above. *) + inject_contents cctxt state.target_block transfer.src.sk list + in + match r with + | Ok op_hash -> + let*! () = + log Debug (fun () -> + cctxt#message + "inject_transfer: op injected %a" + Tezos_crypto.Operation_hash.pp + op_hash) + in + let ops = + Option.value + ~default:[] + (Tezos_crypto.Block_hash.Table.find state.injected_operations branch) + in + Tezos_crypto.Block_hash.Table.replace + state.injected_operations + branch + (op_hash :: ops) ; + return_unit + | Error e -> + let*! () = + log Debug (fun () -> + cctxt#message + "inject_transfer: error, op not injected: %a" + Error_monad.pp_print_trace + e) + in + return_unit + +let save_injected_operations (cctxt : Protocol_client_context.full) state = + let open Lwt_syntax in + let json = + Data_encoding.Json.construct + injected_operations_encoding + (Tezos_crypto.Block_hash.Table.fold + (fun k v acc -> (k, v) :: acc) + state.injected_operations + []) + in + let path = + Filename.temp_file "client-stresstest-injected_operations-" ".json" + in + let* () = cctxt#message "writing injected operations in file %s" path in + let* r = Lwt_utils_unix.Json.write_file path json in + match r with + | Error e -> + cctxt#message + "could not write injected operations json file: %a" + Error_monad.pp_print_trace + e + | Ok _ -> Lwt.return_unit + +let stat_on_exit (cctxt : Protocol_client_context.full) state = + let open Lwt_result_syntax in + let ratio_injected_included_op () = + let* current_head_on_exit = Shell_services.Blocks.hash cctxt () in + let inter_cardinal s1 s2 = + Tezos_crypto.Operation_hash.Set.cardinal + (Tezos_crypto.Operation_hash.Set.inter + (Tezos_crypto.Operation_hash.Set.of_list s1) + (Tezos_crypto.Operation_hash.Set.of_list s2)) + in + let get_included_ops older_block = + let rec get_included_ops block acc_included_ops = + if block = older_block then return acc_included_ops + else + let* included_ops = + Shell_services.Chain.Blocks.Operation_hashes + .operation_hashes_in_pass + cctxt + ~chain:`Main + ~block:(`Hash (block, 0)) + 3 + in + let* bs = + Shell_services.Blocks.list + cctxt + ~chain:`Main + ~heads:[block] + ~length:2 + () + in + match bs with + | [[current; predecessor]] when current = block -> + get_included_ops + predecessor + (List.append acc_included_ops included_ops) + | _ -> cctxt#error "Error while computing stats: invalid block list" + in + get_included_ops current_head_on_exit [] + in + let injected_ops = + Tezos_crypto.Block_hash.Table.fold + (fun k l acc -> + (* The operations injected during the last block are ignored because + they should not be currently included. *) + if current_head_on_exit <> k then List.append acc l else acc) + state.injected_operations + [] + in + let* included_ops = get_included_ops state.current_head_on_start in + let included_ops_count = inter_cardinal injected_ops included_ops in + let*! () = + log Debug (fun () -> + cctxt#message + "injected : [%a]@.included: [%a]" + (Format.pp_print_list ~pp_sep Tezos_crypto.Operation_hash.pp) + injected_ops + (Format.pp_print_list ~pp_sep Tezos_crypto.Operation_hash.pp) + included_ops) + in + let injected_ops_count = List.length injected_ops in + let*! () = + cctxt#message + "%s of the injected operations have been included (%d injected, %d \ + included). Note that the operations injected during the last block \ + are ignored because they should not be currently included." + (if Int.equal injected_ops_count 0 then "N/A" + else + Format.sprintf "%d%%" (included_ops_count * 100 / injected_ops_count)) + injected_ops_count + included_ops_count + in + return_unit + in + ratio_injected_included_op () + +let launch (cctxt : Protocol_client_context.full) (parameters : parameters) + state save_pool_callback = + let injected = ref 0 in + let target_level = + match parameters.level_limit with + | None -> None + | Some (Abs target) -> Some target + | Some (Rel offset) -> Some (state.last_level + offset) + in + let dt = 1. /. parameters.tps in + let terminated () = + let open Lwt_syntax in + if + match parameters.total_transfers with + | None -> false + | Some bound -> bound <= !injected + then + let* () = + cctxt#message + "Stopping after %d injections (target %a)." + !injected + Format.(pp_print_option pp_print_int) + parameters.total_transfers + in + Lwt.return_true + else + match target_level with + | None -> Lwt.return_false + | Some target -> + if target <= state.last_level then + let* () = + cctxt#message + "Stopping at level %d (target level: %d)." + state.last_level + target + in + Lwt.return_true + else Lwt.return_false + in + + let rec loop () = + let open Lwt_result_syntax in + let*! terminated = terminated () in + if terminated then + let*! () = save_pool_callback () in + let*! () = save_injected_operations cctxt state in + stat_on_exit cctxt state + else + let start = Mtime_clock.elapsed () in + let*! () = + log Debug (fun () -> + cctxt#message "launch.loop: invoke sample_transfer") + in + let* transfer = + sample_transfer cctxt cctxt#chain cctxt#block parameters state + in + let*! () = + log Debug (fun () -> + cctxt#message "launch.loop: invoke inject_transfer") + in + let* () = inject_transfer cctxt parameters state transfer in + incr injected ; + let stop = Mtime_clock.elapsed () in + let elapsed = Mtime.Span.(to_s stop -. to_s start) in + let remaining = dt -. elapsed in + let*! () = + if remaining <= 0.0 then + cctxt#warning + "warning: tps target could not be reached, consider using a lower \ + value for --tps" + else Lwt_unix.sleep remaining + in + loop () + in + let on_new_head : + Tezos_crypto.Block_hash.t * Tezos_base.Block_header.t -> + unit tzresult Lwt.t = + (* Because of how Tenderbake works the target block should stay 2 + blocks in the past because this guarantees that we are targeting a + block that is decided. *) + let open Lwt_result_syntax in + let update_target_block () = + let* target_block = + Shell_services.Blocks.hash cctxt ~block:(`Head 2) () + in + state.target_block <- target_block ; + return_unit + in + fun (new_block_hash, new_block_header) -> + let* () = update_target_block () in + if not (Tezos_crypto.Block_hash.equal new_block_hash state.last_block) + then ( + state.last_block <- new_block_hash ; + state.last_level <- Int32.to_int new_block_header.shell.level ; + state.shuffled_pool <- + List.shuffle + ~rng:state.rng_state + (List.map (fun src_org -> src_org.source) state.pool)) ; + Lwt_condition.broadcast state.new_block_condition () ; + return_unit + in + let open Lwt_result_syntax in + let* heads_iteration, stopper = heads_iter cctxt on_new_head in + (* The head iteration stops at protocol change. *) + let* () = Lwt.pick [loop (); heads_iteration] in + (match Lwt.state heads_iteration with Lwt.Return _ -> () | _ -> stopper ()) ; + return_unit + +let group = + Tezos_clic. + {name = "stresstest"; title = "Commands for stress-testing the network"} + +type pool_source = + | From_string of {json : Ezjsonm.value} + | From_file of {path : string; json : Ezjsonm.value} + +let json_of_pool_source = function + | From_string {json} | From_file {json; _} -> json + +let json_file_or_text_parameter = + Tezos_clic.parameter (fun _ p -> + let open Lwt_result_syntax in + match String.split ~limit:1 ':' p with + | ["text"; text] -> return (From_string {json = Ezjsonm.from_string text}) + | ["file"; path] -> + let+ json = Lwt_utils_unix.Json.read_file path in + From_file {path; json} + | _ -> ( + if Sys.file_exists p then + let+ json = Lwt_utils_unix.Json.read_file p in + From_file {path = p; json} + else + try return (From_string {json = Ezjsonm.from_string p}) + with Ezjsonm.Parse_error _ -> + failwith "Neither an existing file nor valid JSON: '%s'" p)) + +let seed_arg = + let open Tezos_clic in + arg + ~long:"seed" + ~placeholder:"int" + ~doc:"random seed" + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match int_of_string s with + | exception _ -> + cctxt#error + "While parsing --seed: could not convert argument to int" + | i -> Lwt_result_syntax.return i)) + +let tps_arg = + let open Tezos_clic in + arg + ~long:"tps" + ~placeholder:"float" + ~doc:"transactions per seconds target" + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match float_of_string s with + | exception _ -> + cctxt#error + "While parsing --tps: could not convert argument to float" + | f when f < 0.0 -> + cctxt#error "While parsing --tps: negative argument" + | f -> Lwt_result_syntax.return f)) + +let fresh_probability_arg = + let open Tezos_clic in + arg + ~long:"fresh-probability" + ~placeholder:"float in [0;1]" + ~doc: + (Format.sprintf + "Probability for each transaction's destination to be a fresh \ + account. The default value is %g. This new account may then be used \ + as source or destination of subsequent transactions, just like the \ + accounts that were initially provided to the command. Note that when \ + [--single-op-per-pkh-per-block] is set, the new account will not be \ + used as source until the head changes." + default_parameters.fresh_probability) + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match float_of_string s with + | exception _ -> + cctxt#error + "While parsing --fresh-probability: could not convert argument \ + to float" + | f when f < 0.0 || f > 1.0 -> + cctxt#error "While parsing --fresh-probability: invalid argument" + | f -> Lwt_result_syntax.return f)) + +let smart_contract_parameters_arg = + let open Tezos_clic in + arg + ~long:"smart-contract-parameters" + ~placeholder:"JSON file with smart contract parameters" + ~doc: + (Format.sprintf + "A JSON object that maps smart contract aliases to objects with three \ + fields: probability in [0;1], invocation_fee, and \ + invocation_gas_limit.") + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match Data_encoding.Json.from_string s with + | Ok json -> + Lwt_result_syntax.return + (Data_encoding.Json.destruct + Smart_contracts.contract_parameters_collection_encoding + json) + | Error _ -> + cctxt#error + "While parsing --smart-contract-parameters: invalid JSON %s" + s)) + +let strategy_arg = + let open Tezos_clic in + arg + ~long:"strategy" + ~placeholder:"fixed:mutez | evaporation:[0;1]" + ~doc:"wealth redistribution strategy" + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match parse_strategy s with + | Error msg -> cctxt#error "While parsing --strategy: %s" msg + | Ok strategy -> Lwt_result_syntax.return strategy)) + +let gas_limit_arg = + let open Tezos_clic in + let gas_limit_kind = + parameter (fun _ s -> + try + let v = Z.of_string s in + Lwt_result_syntax.return (Gas.Arith.integral_exn v) + with _ -> failwith "invalid gas limit (must be a positive number)") + in + arg + ~long:"gas-limit" + ~short:'G' + ~placeholder:"amount" + ~doc: + (Format.asprintf + "Set the gas limit of the transaction instead of using the default \ + value of %a" + Gas.Arith.pp_integral + default_parameters.regular_transfer_gas_limit) + gas_limit_kind + +let storage_limit_arg = + let open Tezos_clic in + let storage_limit_kind = + parameter (fun _ s -> + try + let v = Z.of_string s in + assert (Compare.Z.(v >= Z.zero)) ; + Lwt_result_syntax.return v + with _ -> + failwith "invalid storage limit (must be a positive number of bytes)") + in + arg + ~long:"storage-limit" + ~short:'S' + ~placeholder:"amount" + ~doc: + (Format.asprintf + "Set the storage limit of the transaction instead of using the \ + default value of %a" + Z.pp_print + default_parameters.storage_limit) + storage_limit_kind + +let transfers_arg = + let open Tezos_clic in + arg + ~long:"transfers" + ~placeholder:"integer" + ~doc:"total number of transfers to perform, unbounded if not specified" + (parameter (fun (cctxt : Protocol_client_context.full) s -> + match int_of_string s with + | exception _ -> + cctxt#error "While parsing --transfers: invalid integer literal" + | i when i <= 0 -> + cctxt#error "While parsing --transfers: negative integer" + | i -> Lwt_result_syntax.return i)) + +let level_limit_arg = + let open Tezos_clic in + arg + ~long:"level-limit" + ~placeholder:"integer | +integer" + ~doc: + "Level at which the stresstest will stop (if prefixed by '+', the level \ + is relative to the current head)" + (parameter (fun (cctxt : Protocol_client_context.full) s -> + let open Lwt_result_syntax in + match int_of_string s with + | exception _ -> + cctxt#error "While parsing --levels: invalid integer literal" + | i when i <= 0 -> + cctxt#error "While parsing --levels: negative integer or zero" + | i -> if String.get s 0 = '+' then return (Rel i) else return (Abs i))) + +let verbose_arg = + Tezos_clic.switch + ~long:"verbose" + ~short:'v' + ~doc:"Display detailed logs of the injected operations" + () + +let debug_arg = + Tezos_clic.switch ~long:"debug" ~short:'V' ~doc:"Display debug logs" () + +let set_option opt f x = Option.fold ~none:x ~some:(f x) opt + +let save_pool_callback (cctxt : Protocol_client_context.full) pool_source state + = + let json = + Data_encoding.Json.construct + input_source_list_encoding + (List.map unnormalize_source state.pool) + in + let catch_write_error = function + | Error e -> + cctxt#message + "could not write back json file: %a" + Error_monad.pp_print_trace + e + | Ok () -> Lwt.return_unit + in + let open Lwt_syntax in + match pool_source with + | From_string _ -> + (* If the initial pool was given directly as json, save pool to + a temp file. *) + let path = Filename.temp_file "client-stresstest-pool-" ".json" in + let* () = cctxt#message "writing back address pool in file %s" path in + let* r = Lwt_utils_unix.Json.write_file path json in + catch_write_error r + | From_file {path; _} -> + (* If the pool specification was a json file, save pool to + the same file. *) + let* () = cctxt#message "writing back address pool in file %s" path in + let* r = Lwt_utils_unix.Json.write_file path json in + catch_write_error r + +let generate_random_transactions = + let open Tezos_clic in + command + ~group + ~desc:"Generate random transactions" + (args12 + seed_arg + tps_arg + fresh_probability_arg + smart_contract_parameters_arg + strategy_arg + Client_proto_args.fee_arg + gas_limit_arg + storage_limit_arg + transfers_arg + level_limit_arg + verbose_arg + debug_arg) + (prefixes ["stresstest"; "transfer"; "using"] + @@ param + ~name:"sources.json" + ~desc: + {|List of accounts from which to perform transfers in JSON format. The input JSON must be an array of objects of the form {"pkh":"<pkh>","pk":"<pk>","sk":"<sk>"} or {"alias":"<alias from wallet>"} or {"pkh":"<pkh from wallet>"} with the pkh, pk and sk encoded in B58 form."|} + json_file_or_text_parameter + @@ stop) + (fun ( seed, + tps, + freshp, + smart_contract_parameters, + strat, + fee, + gas_limit, + storage_limit, + transfers, + level_limit, + verbose_flag, + debug_flag ) + sources_json + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + (verbosity := + match (debug_flag, verbose_flag) with + | true, _ -> Debug + | false, true -> Info + | false, false -> Notice) ; + let* smart_contracts = + Smart_contracts.init + cctxt + (Option.value ~default:[] smart_contract_parameters) + in + let parameters = + {default_parameters with smart_contracts} + |> set_option seed (fun parameter seed -> {parameter with seed}) + |> set_option tps (fun parameter tps -> {parameter with tps}) + |> set_option freshp (fun parameter fresh_probability -> + {parameter with fresh_probability}) + |> set_option strat (fun parameter strategy -> + {parameter with strategy}) + |> set_option fee (fun parameter regular_transfer_fee -> + {parameter with regular_transfer_fee}) + |> set_option gas_limit (fun parameter regular_transfer_gas_limit -> + {parameter with regular_transfer_gas_limit}) + |> set_option storage_limit (fun parameter storage_limit -> + {parameter with storage_limit}) + |> set_option transfers (fun parameter transfers -> + {parameter with total_transfers = Some transfers}) + |> set_option level_limit (fun parameter level_limit -> + {parameter with level_limit = Some level_limit}) + in + match + Data_encoding.Json.destruct + input_source_list_encoding + (json_of_pool_source sources_json) + with + | exception _ -> cctxt#error "Could not decode list of sources" + | [] -> cctxt#error "It is required to provide sources" + | sources -> + let*! () = + log Info (fun () -> cctxt#message "starting to normalize sources") + in + let*! sources = List.filter_map_s (normalize_source cctxt) sources in + let*! () = + log Info (fun () -> + cctxt#message "all sources have been normalized") + in + let sources = + List.sort_uniq + (fun src1 src2 -> + Tezos_crypto.Signature.Secret_key.compare + src1.source.sk + src2.source.sk) + sources + in + let rng_state = Random.State.make [|parameters.seed|] in + let* current_head_on_start = Shell_services.Blocks.hash cctxt () in + let* header_on_start = + Shell_services.Blocks.Header.shell_header cctxt () + in + let* () = + if header_on_start.level <= 2l then + cctxt#error + "The level of the head (%a) needs to be greater than 2 and is \ + actually %ld." + Tezos_crypto.Block_hash.pp + current_head_on_start + header_on_start.level + else return_unit + in + let* current_target_block = + Shell_services.Blocks.hash cctxt ~block:(`Head 2) () + in + let state = + { + rng_state; + current_head_on_start; + pool = sources; + pool_size = List.length sources; + shuffled_pool = + List.shuffle + ~rng:rng_state + (List.map (fun src_org -> src_org.source) sources); + revealed = Tezos_crypto.Signature.Public_key_hash.Set.empty; + last_block = current_head_on_start; + last_level = Int32.to_int header_on_start.level; + target_block = current_target_block; + new_block_condition = Lwt_condition.create (); + injected_operations = Tezos_crypto.Block_hash.Table.create 1023; + } + in + let exit_callback_id = + Lwt_exit.register_clean_up_callback ~loc:__LOC__ (fun _retcode -> + let*! r = stat_on_exit cctxt state in + match r with + | Ok () -> Lwt.return_unit + | Error e -> + cctxt#message "Error: %a" Error_monad.pp_print_trace e) + in + let save_pool () = save_pool_callback cctxt sources_json state in + (* Register a callback for saving the pool when the tool is interrupted + through ctrl-c *) + let exit_callback_id = + Lwt_exit.register_clean_up_callback + ~loc:__LOC__ + ~after:[exit_callback_id] + (fun _retcode -> save_pool ()) + in + let save_injected_operations () = + save_injected_operations cctxt state + in + ignore + (Lwt_exit.register_clean_up_callback + ~loc:__LOC__ + ~after:[exit_callback_id] + (fun _retcode -> save_injected_operations ())) ; + launch cctxt parameters state save_pool) + +let estimate_transaction_cost ?smart_contracts + (cctxt : Protocol_client_context.full) : Gas.Arith.integral tzresult Lwt.t = + let open Lwt_result_syntax in + let*! src = normalize_source cctxt (Wallet_alias "bootstrap1") in + let*! dst = normalize_source cctxt (Wallet_alias "bootstrap2") in + let rng_state = Random.State.make [|default_parameters.seed|] in + let* src, dst = + match (src, dst) with + | Some src, Some dst -> return (src, dst) + | _ -> + cctxt#error + "Cannot find bootstrap1 or bootstrap2 accounts in the wallet." + in + let chain = cctxt#chain in + let block = cctxt#block in + let selected_smart_contract = + Option.bind smart_contracts (fun smart_contracts -> + sample_smart_contracts smart_contracts rng_state) + in + let dst, fee, gas_limit = + Option.value + selected_smart_contract + ~default: + ( Implicit dst.source.pkh, + default_parameters.regular_transfer_fee, + default_parameters.regular_transfer_gas_limit ) + in + let* current_counter = + Alpha_services.Contract.counter cctxt (chain, block) src.source.pkh + in + let transf_counter = Manager_counter.succ current_counter in + let transfer = + { + src = src.source; + dst; + fee; + gas_limit; + amount = Tez.of_mutez_exn (Int64.of_int 1); + counter = Some transf_counter; + fresh_dst = false; + } + in + let manager_op = + manager_op_of_transfer + { + default_parameters with + regular_transfer_gas_limit = + Default_parameters.constants_mainnet.hard_gas_limit_per_operation; + } + transfer + in + let* _oph, op, result = + Injection.simulate cctxt ~chain ~block (Single manager_op) + in + match result.contents with + | Single_result (Manager_operation_result {operation_result; _}) -> ( + match operation_result with + | Applied + (Transaction_result + (Transaction_to_contract_result {consumed_gas; _})) -> + return (Gas.Arith.ceil consumed_gas) + | _ -> + (match operation_result with + | Failed (_, errors) -> + Error_monad.pp_print_trace + Format.err_formatter + (Environment.wrap_tztrace errors) + | _ -> assert false) ; + cctxt#error + "@[<v 2>Simulation result:@,%a@]" + Operation_result.pp_operation_result + (op.protocol_data.contents, result.contents)) + +let estimate_transaction_costs : Protocol_client_context.full Tezos_clic.command + = + let open Tezos_clic in + command + ~group + ~desc:"Output gas estimations for transactions that stresstest uses" + no_options + (prefixes ["stresstest"; "estimate"; "gas"] @@ stop) + (fun () cctxt -> + let open Lwt_result_syntax in + let* regular = estimate_transaction_cost cctxt in + let* smart_contracts = + Smart_contracts.with_every_known_smart_contract + cctxt + (fun smart_contracts -> + estimate_transaction_cost ~smart_contracts cctxt) + in + let transaction_costs : transaction_costs = {regular; smart_contracts} in + let json = + Data_encoding.Json.construct + transaction_costs_encoding + transaction_costs + in + Format.printf "%a" Data_encoding.Json.pp json ; + return_unit) + +(* Returns a list of transfers from each element of [sources]. *) +let generate_transfers ~sources ~amount ~parameters ~entrypoint ~fee ~gas_limit + ~storage_limit = + List.map + (fun dst -> + let destination = Contract.Implicit dst.pkh in + let transfer = + Client_proto_context.build_transaction_operation + ~amount + ~parameters + ~entrypoint + ~fee + ~gas_limit + ~storage_limit + destination + in + Annotated_manager_operation.Annotated_manager_operation transfer) + sources + +(* Returns a list of reveals from each element of [sources]. *) +let generate_reveals ~sources ~fee ~gas_limit ~storage_limit = + List.map + (fun dst -> + let reveal = + Client_proto_context.build_reveal_operation + ~fee + ~gas_limit + ~storage_limit + dst.pk + in + (dst, Annotated_manager_operation.Annotated_manager_operation reveal)) + sources + +(* Given a list of [sources], it returns + - a list of batches of transfers where each batch has a maximum of + [batch_size] operation, for each element of [sources], + - a list of reveals, for each element of [sources]. + + [sources] is the list of "starter" accounts, used to fund all + accounts in a exponential way. +*) +let generate_starter_ops ~sources ~amount ~batch_size = + let fee = Tez.of_mutez_exn 1_000L in + let gas_limit = Gas.Arith.integral_of_int_exn 1_040 in + let storage_limit = Z.of_int 257 in + let parameters = + let open Tezos_micheline in + Script.lazy_expr + (Micheline.strip_locations + (Prim (0, Michelson_v1_primitives.D_Unit, [], []))) + in + let entrypoint = Entrypoint.default in + let txs_ops = + generate_transfers + ~sources + ~amount + ~parameters + ~entrypoint + ~fee + ~gas_limit + ~storage_limit + in + let reveal_ops = generate_reveals ~sources ~fee ~gas_limit ~storage_limit in + let rec split n acc = function + | [] -> acc + | l -> + let current, next = List.rev_split_n n l in + let batch = Annotated_manager_operation.manager_of_list current in + split n (batch :: acc) next + in + (* Split the list of transfers into N batches containing a maximum + of [batch_size] operations. *) + let txs_batch_l = split batch_size [] txs_ops in + (txs_batch_l, reveal_ops) + +(* Returns a list of list of batch. A list of batch consists of N + batches, depending on the number of [starter_sources]. The top + level list can be seen a block partition, so that the 1M + restriction is ensured. *) +let generate_account_funding_batches (starter_sources : source_with_uri list) + (empty_accounts : source_with_uri list) ~batch_size ~amount = + let open Lwt_result_syntax in + let nb_sources = List.length starter_sources in + let fee = Tez.of_mutez_exn 1_000L in + let gas_limit = Gas.Arith.integral_of_int_exn 1_040 in + let storage_limit = Z.of_int 257 in + let parameters = + let open Tezos_micheline in + Script.lazy_expr + (Micheline.strip_locations + (Prim (0, Michelson_v1_primitives.D_Unit, [], []))) + in + let entrypoint = Entrypoint.default in + let to_batch candidates emiters = + (* For each [emiters], it generates [batch_size] transactions from + it, and to [batch_size] candidates.*) + let rec aux acc (candidates : source_with_uri list) + (emiters : source_with_uri list) = + match emiters with + | [] -> return acc + | source :: next_sources -> + let current, next_candidates = + List.rev_split_n batch_size candidates + in + let txs = + generate_transfers + ~sources:current + ~amount + ~parameters + ~entrypoint + ~fee + ~gas_limit + ~storage_limit + in + let batch = Annotated_manager_operation.manager_of_list txs in + (*Avoid the generation of empty batches*) + if next_candidates = [] then return ((source, batch) :: acc) + else aux ((source, batch) :: acc) next_candidates next_sources + in + aux [] candidates emiters + in + let rec aux acc = function + | [] -> return acc + | empty_accounts -> + let candidates, rest = + List.rev_split_n (batch_size * nb_sources) empty_accounts + in + let* batch = to_batch candidates starter_sources in + aux (batch :: acc) rest + in + let* res = aux [] empty_accounts in + return res + +(* Loads a wallet by reading directly the files to speed up things. *) +let load_wallet cctxt ~source_pkh = + let open Lwt_result_syntax in + let* keys = Client_keys.get_keys cctxt in + (* Convert loaded and filter identities. We want to ban activator + and bootstrap<1-5> in sandbox, as well as the "faucet source" on + test networks. *) + let to_ban = + ["activator"; "bootstrap"] + @ WithExceptions.Result.get_ok + ~loc:__LOC__ + (List.init ~when_negative_length:"error" 5 (fun i -> + Format.sprintf "bootstrap%d" (i + 1))) + in + let rec aux acc = function + | [] -> return acc + | (alias, pkh, _, _) :: tl + when List.exists (String.equal alias) to_ban + || Tezos_crypto.Signature.Public_key_hash.equal pkh source_pkh -> + aux acc tl + | (_, pkh, pk, sk_uri) :: tl -> + let* pk_uri = Client_keys.neuterize sk_uri in + let payload = + Uri.path (sk_uri : Tezos_signer_backends.Unencrypted.sk_uri :> Uri.t) + in + let sk = Tezos_crypto.Signature.Secret_key.of_b58check_exn payload in + aux ({pkh; pk; pk_uri; sk; sk_uri} :: acc) tl + in + aux [] keys + +let source_key_arg = + let open Tezos_clic in + param + ~name:"source_key_arg" + ~desc: + "Source key public key hash from which the tokens will be transferred to \ + start the funding." + (parameter (fun _ s -> + let r = Tezos_crypto.Signature.Public_key_hash.of_b58check s in + match r with + | Ok pkh -> Lwt_result_syntax.return pkh + | Error e -> + failwith + "Cannot read public key hash: %a" + Error_monad.pp_print_trace + e)) + +let batch_size_arg = + let open Tezos_clic in + default_arg + ~long:"batch-size" + ~placeholder:"integer" + ~doc: + "Maximum number of operations that can be put into a single batch (250 \ + by default)" + ~default:"250" + (parameter (fun _ s -> + match int_of_string_opt s with + | Some i when i > 0 -> Lwt_result_syntax.return i + | Some _ -> failwith "Integer must be positive." + | None -> failwith "Cannot read integer")) + +let batches_per_block_arg = + let open Tezos_clic in + default_arg + ~long:"batches-per-block" + ~placeholder:"integer" + ~doc: + "Maximum number of batches that can be put into a single block (100 by \ + default)" + ~default:"100" + (parameter (fun _ s -> + match int_of_string_opt s with + | Some i when i > 0 -> Lwt_result_syntax.return i + | Some _ -> failwith "Integer must be positive." + | None -> failwith "Cannot read integer")) + +let initial_amount_arg = + let open Tezos_clic in + default_arg + ~long:"initial-amount" + ~placeholder:"integer" + ~doc: + "Number of token, in μtz, that will be funded on each of the accounts to \ + fund (1 by default)" + ~default:"1_000_000" + (parameter (fun _ s -> + match Int64.of_string_opt s with + | Some i when i > 0L -> ( + try Lwt_result_syntax.return (Tez.of_mutez_exn i) + with e -> + failwith "Cannot convert to Tez.t:%s" (Printexc.to_string e)) + | Some _ -> failwith "Integer must be positive." + | None -> failwith "Cannot read integer")) + +(* Monitors the node's head to inject transaction batches. *) +let inject_batched_txs cctxt (source_pkh, source_pk, source_sk) + ~(starter_batch : Annotated_manager_operation.packed_annotated_list list) + ~fee ~gas_limit ~storage_limit ~fee_parameter batches_per_block = + let open Lwt_result_syntax in + let chain = cctxt#chain in + let* heads_stream, stop = Shell_services.Monitor.heads cctxt chain in + let rec aux stream + (sources_ops : Annotated_manager_operation.packed_annotated_list list) = + let*! v = Lwt_stream.get stream in + match v with + | Some (_block_hash, _) -> ( + match sources_ops with + | [] -> + stop () ; + return [] + | sources_ops -> + let now, next = List.rev_split_n batches_per_block sources_ops in + let* () = + List.iter_ep + (fun batch -> + let (Annotated_manager_operation.Manager_list contents) = + batch + in + let* _results = + Injection.inject_manager_operation + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run:false + ~verbose_signing:false + ~simulation:false + ~force:false + ~source:source_pkh + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ~src_pk:source_pk + ~src_sk:source_sk + ~replace_by_fees:false + ~fee_parameter + contents + in + return_unit) + now + in + aux stream next) + | None -> + let*! () = Lwt_unix.sleep 0.5 in + aux stream sources_ops + in + let* _ = aux heads_stream starter_batch in + return_unit + +(* Monitors the node's head to inject reveal batches. *) +let inject_batched_reveals cctxt + ~(starter_reveals : + (source_with_uri * Annotated_manager_operation.packed) list) ~fee + ~gas_limit ~storage_limit ~fee_parameter batches_per_block = + let open Lwt_result_syntax in + let chain = cctxt#chain in + let* heads_stream, stop = Shell_services.Monitor.heads cctxt chain in + let rec aux stream + (sources_ops : + (source_with_uri * Annotated_manager_operation.packed) list) = + let*! v = Lwt_stream.get stream in + match v with + | Some (_block_hash, _) -> ( + match sources_ops with + | [] -> + stop () ; + return [] + | sources_ops -> + let now, next = List.rev_split_n batches_per_block sources_ops in + let* () = + List.iter_ep + (fun (source, op) -> + let (Annotated_manager_operation.Manager_list contents) = + Annotated_manager_operation.manager_of_list [op] + in + let* _ = + Injection.inject_manager_operation + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run:false + ~verbose_signing:false + ~simulation:false + ~force:false + ~source:source.pkh + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ~src_pk:source.pk + ~src_sk:source.sk_uri + ~replace_by_fees:false + ~fee_parameter + contents + in + return_unit) + now + in + aux stream next) + | None -> + let*! () = Lwt_unix.sleep 0.5 in + aux stream sources_ops + in + let* _ = aux heads_stream starter_reveals in + return_unit + +(* Monitors the node's head to inject transaction batches. *) +let inject_funding_batches cctxt + ~(funding_batches : + (source_with_uri * Annotated_manager_operation.packed_annotated_list) + list + list) ~fee ~gas_limit ~storage_limit ~fee_parameter batches_per_block = + let open Lwt_result_syntax in + let chain = cctxt#chain in + let* heads_stream, stop = Shell_services.Monitor.heads cctxt chain in + let rec aux stream + (sources_ops : + (source_with_uri * Annotated_manager_operation.packed_annotated_list) + list + list) = + let*! v = Lwt_stream.get stream in + match v with + | Some (_block_hash, _) -> ( + match sources_ops with + | [] -> + stop () ; + return [] + | block_ops :: tl -> + let now, next = List.rev_split_n batches_per_block block_ops in + let* () = + List.iter_ep + (fun (source, batch) -> + let (Annotated_manager_operation.Manager_list contents) = + batch + in + let* _results = + Injection.inject_manager_operation + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ?confirmations:cctxt#confirmations + ~dry_run:false + ~verbose_signing:false + ~simulation:false + ~force:false + ~source:source.pkh + ~fee:(Limit.of_option fee) + ~gas_limit:(Limit.of_option gas_limit) + ~storage_limit:(Limit.of_option storage_limit) + ~src_pk:source.pk + ~src_sk:source.sk_uri + ~replace_by_fees:false + ~fee_parameter + contents + in + return_unit) + now + in + if next = [] then aux stream tl else aux stream (next :: tl)) + | None -> + let*! () = Lwt_unix.sleep 0.5 in + aux stream sources_ops + in + let* _ = aux heads_stream funding_batches in + return_unit + +(* This command aims to fund accounts to be used in pair with the + stresstest transfer command. To do so, it will proceed in the + following steps: + - takes all the identities found in a given wallet, + - chooses [batch_size] identities as starters , + - funds the starters with some funds (using source account), + - reveal the starters (using source account), + - makes and injects batches so that the starters uses their funds to + fund the [nb_identities - nb_starters] remaining accounts. + + These steps allows to minimize the number of + transfers/operations/blocks to fund many accounts. + + As parameters, it is possible to chose: + - batch_size: number of operations into a single batch, + - batches_per_block: number of batches/operations per block, + - initial_amount: number of token distributed to each accounts. + It also allows to define additional parameters, such as fee, gas + and storage limit. +*) +let fund_accounts_from_source : Protocol_client_context.full Tezos_clic.command + = + let open Tezos_clic in + command + ~group + ~desc:"Funds all the given accounts" + (args7 + batch_size_arg + batches_per_block_arg + initial_amount_arg + Client_proto_args.default_fee_arg + Client_proto_args.default_gas_limit_arg + Client_proto_args.default_storage_limit_arg + Client_proto_args.fee_parameter_args) + (prefixes ["stresstest"; "fund"; "accounts"; "from"] + @@ source_key_arg @@ stop) + (fun ( batch_size, + batches_per_block, + initial_amount, + fee, + gas_limit, + storage_limit, + fee_parameter ) + source_pkh + (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* source_pk, source_sk = + let* _, src_pk, src_sk = Client_keys.get_key cctxt source_pkh in + return (src_pk, src_sk) + in + let*! () = log Notice (fun () -> cctxt#message "@.") in + let*! () = + log Notice (fun () -> + cctxt#message + "Starting funding from %a with parameters:@.- batch_size %d@.- \ + batches_per_block %d@.- initial_amount %a@." + Tezos_crypto.Signature.Public_key_hash.pp + source_pkh + batch_size + batches_per_block + Tez.pp + initial_amount) + in + (* All generated sources *) + let* new_sources = load_wallet cctxt ~source_pkh in + (* Starter sources used to initiate the "exponential" + funding. *) + let nb_starters = + let l = List.length new_sources in + (l / batch_size) + if l mod batch_size = 0 then 0 else 1 + in + let starter_sources, empty_accounts = + List.rev_split_n nb_starters new_sources + in + let*! () = + log Notice (fun () -> + cctxt#message + "Funding %d accounts using %d starters@." + (List.length new_sources) + nb_starters) + in + (* Initial amount that is sent to starters to allow them to fund + other accounts. This is an over approximation. *) + let starter_initial_amount = + (* over approximation of the max number of operation that a + starter may inject. We add one to leave the starter account + with it's own initial amount. *) + let max_nb_transfers = batch_size + 1 in + (* Fees are: reveal + max_nb_transfers * manager_fees + = reveal + max_nb_transfers * (storage_fees + tx fees) + = 0.001tz + max_nb_transfers * (0.06425tz + 0.001tz) + =~ max_nb_transfers * 0.1 tz *) + let fees_approx = Tez.of_mutez_exn 100_000L in + let amount = + WithExceptions.Result.get_ok + ~loc:__LOC__ + Tez.(initial_amount +? fees_approx) + in + Tez.mul_exn amount max_nb_transfers + in + let*! () = + log Notice (fun () -> + cctxt#message + "Sending %a tz to starter accounts@." + Tez.pp + starter_initial_amount) + in + let* source_balance = + Alpha_services.Contract.balance + cctxt + (cctxt#chain, cctxt#block) + (Contract.Implicit source_pkh) + in + let* () = + let req_balance = Tez.mul_exn starter_initial_amount nb_starters in + if Tez.(source_balance < req_balance) then + failwith + "Not enough funds to init starter accounts: %a are needed, only %a \ + is available on %a@." + Tez.pp + source_balance + Tez.pp + req_balance + Tezos_crypto.Signature.Public_key_hash.pp + source_pkh + else + let*! () = + log Notice (fun () -> + cctxt#message + "Transfering %a tz from %a (out of %a)@." + Tez.pp + req_balance + Tezos_crypto.Signature.Public_key_hash.pp + source_pkh + Tez.pp + source_balance) + in + return_unit + in + let*! () = + log Notice (fun () -> + cctxt#message "Generating starter transactions and reveals@.") + in + let starter_batch, starter_reveals = + generate_starter_ops + ~sources:starter_sources + ~amount:starter_initial_amount + ~batch_size + in + (* Inject generated batches and reveals for the starters. *) + let*! () = + log Notice (fun () -> + cctxt#message "Injecting starter transfer batches@.") + in + let* () = + inject_batched_txs + cctxt + (source_pkh, source_pk, source_sk) + ~starter_batch + ~fee + ~gas_limit + ~storage_limit + ~fee_parameter + batches_per_block + in + let*! () = + log Notice (fun () -> + cctxt#message "Injecting starter reveal batches@.") + in + let* () = + inject_batched_reveals + cctxt + ~starter_reveals + ~fee + ~gas_limit + ~storage_limit + ~fee_parameter + batches_per_block + in + let*! () = + log Notice (fun () -> cctxt#message "Generating funding batches@.") + in + let* funding_batches = + generate_account_funding_batches + starter_sources + empty_accounts + ~batch_size + ~amount:initial_amount + in + let*! () = + log Notice (fun () -> cctxt#message "Injecting funding batches@.") + in + let* () = + inject_funding_batches + cctxt + ~funding_batches + ~fee + ~gas_limit + ~storage_limit + ~fee_parameter + batches_per_block + in + let*! () = log Notice (fun () -> cctxt#message "Done.@.") in + return_unit) + +let commands = + [ + generate_random_transactions; + estimate_transaction_costs; + Smart_contracts.originate_command; + fund_accounts_from_source; + ] + +let commands network () = + match network with Some `Mainnet -> [] | Some `Testnet | None -> commands diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.mli new file mode 100644 index 000000000000..c272f2c4a642 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_commands.mli @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val commands : + [`Mainnet | `Testnet] option -> + unit -> + Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.ml new file mode 100644 index 000000000000..8d67a8cc13ac --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.ml @@ -0,0 +1,263 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type contract_parameters = { + probability : float; + invocation_fee : Tez.t; + invocation_gas_limit : Gas.Arith.integral; +} + +let contract_parameters_encoding = + let open Data_encoding in + conv + (fun {probability; invocation_fee; invocation_gas_limit} -> + (probability, invocation_fee, invocation_gas_limit)) + (fun (probability, invocation_fee, invocation_gas_limit) -> + {probability; invocation_fee; invocation_gas_limit}) + (obj3 + (req "probability" float) + (req "invocation_fee" Tez.encoding) + (req "invocation_gas_limit" Gas.Arith.n_integral_encoding)) + +let contract_parameters_collection_encoding = + let open Data_encoding in + assoc contract_parameters_encoding + +(** Internal representation of a supported smart contract. *) +type smart_contract = { + alias : string; (** Human-readable alias of the contract *) + mainnet_address : string; (** Address this contract has on Mainnet *) + initial_storage : string; (** Initial storage (used for origination) *) + origination_fee_cap : Tez.t; (** Origination fee cap *) + origination_burn_cap : Tez.t; (** Origination burn cap *) + code : Script.expr; (** Code of the smart contract *) + invocation_arg : Script.expr; + (** Argument for invocations during the stress test *) + invocation_entrypoint : Entrypoint_repr.t; + (** Entrypoint for invocations during the stress test *) +} + +type t = (contract_parameters * Contract.t * smart_contract) list + +let no_contracts = [] + +let parse_michelson_expr_exn expr = + let open Tezos_micheline in + match + Micheline_parser.no_parsing_error + (Michelson_v1_parser.parse_expression expr) + with + | Ok x -> x.expanded + | Error _ -> Stdlib.failwith "parse_michelson_expr_exn" + +let parse_michelson_toplevel_exn expr = + let open Tezos_micheline in + match + Micheline_parser.no_parsing_error + (Michelson_v1_parser.parse_toplevel ?check:(Some true) expr) + with + | Ok x -> x.expanded + | Error _ -> Stdlib.failwith "parse_michelson_toplevel_exn" + +let hic_et_nunc = + { + alias = "hic_et_nunc"; + mainnet_address = "KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton"; + initial_storage = + {| (Pair (Pair "tz1invkmrRJev6TvH9CvhpLN4auk4cik8G5Y" (Pair 1 {Elt (Pair "tz1invkmrRJev6TvH9CvhpLN4auk4cik8G5Y" 0) 1}))(Pair (Pair {} {})(Pair False {Elt 0 (Pair 0 {})}))) +|}; + code = + parse_michelson_toplevel_exn + {| + storage ( pair ( pair ( address %administrator ) ( pair ( nat %all_tokens ) ( big_map %ledger ( pair address nat ) nat ) ) ) ( pair ( pair ( big_map %metadata string bytes ) ( big_map %operators ( pair ( address %owner ) ( pair ( address %operator ) ( nat %token_id ) ) ) unit ) ) ( pair ( bool %paused ) ( big_map %token_metadata nat ( pair ( nat %token_id ) ( map %token_info string bytes ) ) ) ) ) ) ; + parameter (or (or (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (list %hDAO_batch (pair (nat %amount) (address %to_)))) (or (pair %mint (pair (address %address) (nat %amount)) (pair (nat %token_id) (map %token_info string bytes))) (address %set_administrator))) (or (or (bool %set_pause) (pair %token_metadata (list %token_ids nat) (lambda %handler (list (pair (nat %token_id) (map %token_info string bytes)))unit))) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_Hunitoperators (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id)))))))); + code { DUP ; CDR ; SWAP ; CAR ; IF_LEFT { IF_LEFT { IF_LEFT { SWAP ; DUP ; DUG 2 ; CDR ; CDR ; CAR ; IF { PUSH int 722 ; FAILWITH } {} ; DUP ; CAR ; MAP { DIG 2 ; DUP ; DUG 3 ; CDR ; CDR ; CDR ; SWAP ; DUP ; DUG 2 ; CDR ; MEM ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DIG 2 ; DUP ; DUG 3 ; CAR ; CDR ; CDR ; SWAP ; DUP ; CDR ; SWAP ; DUP ; DUG 3 ; CAR ; PAIR ; MEM ; IF { DIG 2 ; DUP ; DUG 3 ; CAR ; CDR ; CDR ; SWAP ; DUP ; CDR ; SWAP ; DUP ; DUG 3 ; CAR ; PAIR ; GET ; IF_NONE { PUSH int 729 ; FAILWITH } {} ; SWAP ; PAIR %request %balance } { PUSH nat 0 ; SWAP ; PAIR %request %balance } } ; NIL operation ; DIG 2 ; CDR ; PUSH mutez 0 ; DIG 3 ; TRANSFER_TOKENS ; CONS } { SWAP ; DUP ; DUG 2 ; CAR ; CAR ; SENDER ; COMPARE ; EQ ; IF {} { PUSH int 776 ; FAILWITH } ; DUP ; ITER { DIG 2 ; DUP ; DUG 3 ; CAR ; CDR ; CDR ; PUSH nat 0 ; DIG 2 ; DUP ; DUG 3 ; CDR ; PAIR ; MEM ; IF { DIG 2 ; DUP ; DUG 3 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; PUSH nat 0 ; DIG 6 ; DUP ; DUG 7 ; CDR ; PAIR ; DUP ; DUG 2 ; GET ; IF_NONE { PUSH int 781 ; FAILWITH } { DROP } ; DIG 5 ; DUP ; DUG 6 ; CAR ; DIG 8 ; CAR ; CDR ; CDR ; PUSH nat 0 ; DIG 8 ; CDR ; PAIR ; GET ; IF_NONE { PUSH int 781 ; FAILWITH } {} ; ADD ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } { DIG 2 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; CAR ; SOME ; PUSH nat 0 ; DIG 6 ; CDR ; PAIR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } ; SWAP ; DUP ; DUG 2 ; CDR ; CDR ; CDR ; PUSH nat 0 ; MEM ; IF {} { SWAP ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; EMPTY_MAP string bytes ; PUSH string "ipfs://QmSVsfwH8es7Ur2eqto9hVpcd2dfWASmEaNxTPpcymuJzg" ; PACK ; SOME ; PUSH string "" ; UPDATE ; PUSH nat 0 ; PAIR %token_id %token_info ; SOME ; PUSH nat 0 ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP } } ; DROP ; NIL operation } } { IF_LEFT { SWAP ; DUP ; DUG 2 ; CAR ; CAR ; SENDER ; COMPARE ; NEQ ; IF {} { PUSH int 820 ; FAILWITH } ; SWAP ; DUP ; DUG 2 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; CDR ; DIG 4 ; CAR ; CDR ; CAR ; DUP ; PUSH nat 1 ; DIG 6 ; DUP ; DUG 7 ; CDR ; CAR ; ADD ; DUP ; DUG 2 ; COMPARE ; LE ; IF { DROP } { SWAP ; DROP } ; PAIR ; SWAP ; PAIR ; PAIR ; DUP ; DUG 2 ; CAR ; CDR ; CDR ; SWAP ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 3 ; CAR ; CAR ; PAIR ; MEM ; IF { SWAP ; DUP ; DUG 2 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 7 ; CAR ; CAR ; PAIR ; DUP ; DUG 2 ; GET ; IF_NONE { PUSH int 832 ; FAILWITH } { DROP } ; DIG 5 ; DUP ; DUG 6 ; CAR ; CDR ; DIG 7 ; CAR ; CDR ; CDR ; DIG 7 ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 9 ; CAR ; CAR ; PAIR ; GET ; IF_NONE { PUSH int 832 ; FAILWITH } {} ; ADD ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } { SWAP ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; CAR ; CDR ; SOME ; DIG 5 ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 7 ; CAR ; CAR ; PAIR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; SWAP } ; SWAP ; DUP ; DUG 2 ; CDR ; CDR ; CDR ; SWAP ; DUP ; DUG 2 ; CDR ; CAR ; MEM ; IF { DROP } { SWAP ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; CDR ; CDR ; SWAP ; DUP ; DUG 6 ; CDR ; CAR ; PAIR %token_id %token_info ; SOME ; DIG 5 ; CDR ; CAR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR } } { SWAP ; DUP ; DUG 2 ; CAR ; CAR ; SENDER ; COMPARE ; EQ ; IF {} { PUSH int 805 ; FAILWITH } ; SWAP ; DUP ; CDR ; SWAP ; CAR ; CDR ; DIG 2 ; PAIR ; PAIR } ; NIL operation } } { IF_LEFT { IF_LEFT { SWAP ; DUP ; DUG 2 ; CAR ; CAR ; SENDER ; COMPARE ; EQ ; IF {} { PUSH int 814 ; FAILWITH } ; SWAP ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; CDR ; DIG 3 ; PAIR ; SWAP ; PAIR ; SWAP ; PAIR } { SWAP ; DUP ; DUG 2 ; CDR ; CDR ; CAR ; IF { PUSH int 855 ; FAILWITH } {} ; DUP ; CDR ; SWAP ; DUP ; DUG 2 ; CAR ; MAP { DIG 3 ; DUP ; DUG 4 ; CDR ; CDR ; CDR ; SWAP ; GET ; IF_NONE { PUSH int 865 ; FAILWITH } {} } ; DIG 2 ; DROP ; EXEC ; DROP } } { IF_LEFT { SWAP ; DUP ; DUG 2 ; CDR ; CDR ; CAR ; IF { PUSH int 679 ; FAILWITH } {} ; DUP ; ITER { DUP ; CDR ; ITER { DIG 3 ; DUP ; DUG 4 ; CAR ; CAR ; SENDER ; COMPARE ; NEQ ; IF { PUSH bool True } { SENDER ; DIG 2 ; DUP ; DUG 3 ; CAR ; COMPARE ; EQ } ; IF { PUSH bool True } { DIG 3 ; DUP ; DUG 4 ; CDR ; CAR ; CDR ; SWAP ; DUP ; DUG 2 ; CDR ; CAR ; SENDER ; PAIR %operator %token_id ; DIG 3 ; DUP ; DUG 4 ; CAR ; PAIR %owner ; MEM } ; IF {} { PUSH string "FA2_NOT_OPERATOR" ; FAILWITH } ; DIG 3 ; DUP ; DUG 4 ; CDR ; CDR ; CDR ; SWAP ; DUP ; DUG 2 ; CDR ; CAR ; MEM ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DUP ; CDR ; CDR ; PUSH nat 0 ; COMPARE ; LT ; IF { DUP ; CDR ; CDR ; DIG 4 ; DUP ; DUG 5 ; CAR ; CDR ; CDR ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; DUP ; DUG 5 ; CAR ; PAIR ; GET ; IF_NONE { PUSH int 706 ; FAILWITH } {} ; COMPARE ; GE ; IF {} { PUSH string "FA2_INSUFFICIENT_BALANCE" ; FAILWITH } ; DIG 3 ; DUP ; DUG 4 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; DUG 6 ; CDR ; CAR ; DIG 7 ; DUP ; DUG 8 ; CAR ; PAIR ; DUP ; DUG 2 ; GET ; IF_NONE { PUSH int 710 ; FAILWITH } { DROP } ; DIG 5 ; DUP ; DUG 6 ; CDR ; CDR ; DIG 9 ; CAR ; CDR ; CDR ; DIG 7 ; DUP ; DUG 8 ; CDR ; CAR ; DIG 9 ; DUP ; DUG 10 ; CAR ; PAIR ; GET ; IF_NONE { PUSH int 710 ; FAILWITH } {} ; SUB ; ISNAT ; IF_NONE { PUSH int 710 ; FAILWITH } {} ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUP ; DUG 4 ; CAR ; CDR ; CDR ; SWAP ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 3 ; CAR ; PAIR ; MEM ; IF { DIG 3 ; DUP ; DUG 4 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DUP ; DIG 5 ; DUP ; CDR ; CAR ; SWAP ; DUP ; DUG 7 ; CAR ; PAIR ; DUP ; DUG 2 ; GET ; IF_NONE { PUSH int 713 ; FAILWITH } { DROP } ; DIG 5 ; DUP ; DUG 6 ; CDR ; CDR ; DIG 9 ; CAR ; CDR ; CDR ; DIG 7 ; DUP ; CDR ; CAR ; SWAP ; CAR ; PAIR ; GET ; IF_NONE { PUSH int 713 ; FAILWITH } {} ; ADD ; SOME ; SWAP ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUG 2 } { DIG 3 ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; DUP ; CAR ; SWAP ; CDR ; DIG 4 ; DUP ; DUG 5 ; CDR ; CDR ; SOME ; DIG 5 ; DUP ; CDR ; CAR ; SWAP ; CAR ; PAIR ; UPDATE ; SWAP ; PAIR ; SWAP ; PAIR ; PAIR ; DUG 2 } } { DROP } } ; DROP } ; DROP } { DUP ; ITER { IF_LEFT { DUP ; CAR ; SENDER ; COMPARE ; EQ ; IF { PUSH bool True } { DIG 2 ; DUP ; DUG 3 ; CAR ; CAR ; SENDER ; COMPARE ; EQ } ; IF {} { PUSH int 758 ; FAILWITH } ; DIG 2 ; DUP ; CAR ; SWAP ; CDR ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; PUSH ( option unit ) ( Some Unit ) ; DIG 5 ; DUP ; CDR ; CDR ; SWAP ; DUP ; DUG 7 ; CDR ; CAR ; PAIR %operator %token_id ; DIG 6 ; CAR ; PAIR %owner ; UPDATE ; SWAP ; PAIR ; PAIR ; SWAP ; PAIR ; SWAP } { DUP ; CAR ; SENDER ; COMPARE ; EQ ; IF { PUSH bool True } { DIG 2 ; DUP ; DUG 3 ; CAR ; CAR ; SENDER ; COMPARE ; EQ } ; IF {} { PUSH int 765 ; FAILWITH } ; DIG 2 ; DUP ; CAR ; SWAP ; CDR ; DUP ; CDR ; SWAP ; CAR ; DUP ; CAR ; SWAP ; CDR ; NONE unit ; DIG 5 ; DUP ; CDR ; CDR ; SWAP ; DUP ; DUG 7 ; CDR ; CAR ; PAIR %operator %token_id ; DIG 6 ; CAR ; PAIR %owner ; UPDATE ; SWAP ; PAIR ; PAIR ; SWAP ; PAIR ; SWAP } } ; DROP } } ; NIL operation } ; PAIR} + |}; + origination_fee_cap = Tez.of_mutez_exn 5_000L; + origination_burn_cap = Tez.of_mutez_exn 1_500_000L; + invocation_arg = + parse_michelson_expr_exn + {|{ Pair "tz1invkmrRJev6TvH9CvhpLN4auk4cik8G5Y" { Pair "tz1invkmrRJev6TvH9CvhpLN4auk4cik8G5Y" ( Pair 0 1 ) } } |}; + invocation_entrypoint = Entrypoint_repr.of_string_strict_exn "transfer"; + } + +(** This is the list of all supported smart contracts. If you wish to add + support for a new smart contract all you need to do is to extend this + list. *) +let all_contracts = [hic_et_nunc] + +let init (cctxt : Protocol_client_context.full) + (contract_parameters : (string * contract_parameters) list) : + t tzresult Lwt.t = + let open Lwt_result_syntax in + let sum_of_probabilities = + List.fold_left + (fun acc (_, {probability; _}) -> acc +. probability) + 0.0 + contract_parameters + in + let* () = + if sum_of_probabilities > 1.0 then + failwith "sum of smart contract call probabilities is greater than 1.0!" + else return_unit + in + let init_one (alias, params) = + let* contract = + Client_proto_contracts.ContractAlias.get_contract cctxt alias + in + let* smart_contract = + match List.find (fun x -> String.equal alias x.alias) all_contracts with + | None -> failwith "unknown smart contract alias: %s" alias + | Some x -> return x + in + return (params, contract, smart_contract) + in + List.map_es init_one contract_parameters + +type invocation_parameters = { + destination : Contract.t; + entrypoint : Entrypoint_repr.t; + arg : Script.expr; + fee : Tez.t; + gas_limit : Gas.Arith.integral; +} + +let select (smart_contracts : t) (q : float) : invocation_parameters option = + let rec go xs0 x = + match xs0 with + | [] -> None + | (params, contract, smart_contract) :: xs1 -> + if x < params.probability then + Some + { + destination = contract; + entrypoint = smart_contract.invocation_entrypoint; + arg = smart_contract.invocation_arg; + fee = params.invocation_fee; + gas_limit = params.invocation_gas_limit; + } + else go xs1 (x -. params.probability) + in + go smart_contracts q + +let originate_command = + let open Tezos_clic in + let open Client_proto_context in + let open Client_proto_contracts in + let open Client_proto_context_commands in + command + ~group + ~desc:"Originate all supported smart contracts for use in the stresstest." + no_options + (prefixes ["stresstest"; "originate"; "smart"; "contracts"; "from"] + @@ ContractAlias.destination_param + ~name:"src" + ~desc:"name of the source contract" + @@ stop) + (fun () source (cctxt : Protocol_client_context.full) -> + let open Lwt_result_syntax in + match source with + | Originated _ -> + failwith "only implicit accounts can be the source of an origination" + | Implicit source -> + let* _, src_pk, src_sk = Client_keys.get_key cctxt source in + let originate_one (scontract : smart_contract) = + let fee_parameter = + { + Injection.minimal_fees = Tez.of_mutez_exn 100L; + minimal_nanotez_per_byte = Q.of_int 1000; + minimal_nanotez_per_gas_unit = Q.of_int 100; + force_low_fee = false; + fee_cap = scontract.origination_fee_cap; + burn_cap = scontract.origination_burn_cap; + } + in + let*! errors = + originate_contract + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~delegate:None + ~initial_storage:scontract.initial_storage + ~balance:Tez.zero (* initial balance *) + ~source + ~src_pk + ~src_sk + ~code:scontract.code + ~fee_parameter + () + in + let*! r = + report_michelson_errors + ~no_print_source:true + ~msg:"origination simulation failed" + cctxt + errors + in + match r with + | None -> return_unit + | Some (_res, contract) -> + save_contract ~force:false cctxt scontract.alias contract + in + List.iter_es originate_one all_contracts) + +let with_every_known_smart_contract cctxt callback = + let open Lwt_result_syntax in + let items = + List.map + (fun x -> + ( x.alias, + { + probability = 0.0; + invocation_fee = Tez.zero; + invocation_gas_limit = + Default_parameters.constants_mainnet.hard_gas_limit_per_operation; + } )) + all_contracts + in + let* smart_contracts = init cctxt items in + let rec go xs0 = + match xs0 with + | [] -> return [] + | (contract_parameters, contract, smart_contract) :: xs1 -> + let* r = + callback + [ + ( {contract_parameters with probability = 1.0}, + contract, + smart_contract ); + ] + in + let* rs = go xs1 in + return ((smart_contract.alias, r) :: rs) + in + go smart_contracts + +let mainnet_address_to_alias address = + List.find (fun x -> String.equal x.mainnet_address address) all_contracts + |> Option.map (fun x -> x.alias) diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.mli new file mode 100644 index 000000000000..774cf49f383a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_stresstest_contracts.mli @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** The information that the user has to provide for every smart contract + they want to call during the stress test. *) +type contract_parameters = { + probability : float; (** The probability of calling this smart contract *) + invocation_fee : Tez.t; + (** Fee to use for invocations during the stress test *) + invocation_gas_limit : Gas.Arith.integral; + (** Gas limit to use for invocations during the stress test *) +} + +(** Encoding of [contract_parameters]. *) +val contract_parameters_encoding : contract_parameters Data_encoding.t + +(** Contract parameters collection encoding. *) +val contract_parameters_collection_encoding : + (string * contract_parameters) list Data_encoding.t + +(** An opaque type that stores all the information that is necessary for + efficient sampling of smart contract calls. *) +type t + +(** A value with no smart contracts. *) +val no_contracts : t + +(** Convert a map of probabilities per smart contract alias to a [t] value. + *) +val init : + Protocol_client_context.full -> + (string * contract_parameters) list -> + t tzresult Lwt.t + +(** All information that is necessary for performing a smart contract call + during the stress test. *) +type invocation_parameters = { + destination : Contract.t; + entrypoint : Entrypoint_repr.t; + arg : Script.expr; + fee : Tez.t; + gas_limit : Gas.Arith.integral; +} + +(** Given [t] initialized earlier and a [float] in [0;1], decide + which smart contract is going to be chosen for the next call, if any. *) +val select : t -> float -> invocation_parameters option + +(** A ready-to-use command that originates all supported smart contracts. *) +val originate_command : Protocol_client_context.full Tezos_clic.command + +(** Call the callback function once per supported smart contract by passing + it [t] that only selects that smart contract. Collect the + results and pair them with the respective smart contract aliases. This + is used for e.g. gas estimations. *) +val with_every_known_smart_contract : + Protocol_client_context.full -> + (t -> 'a tzresult Lwt.t) -> + (string * 'a) list tzresult Lwt.t + +(** Return the alias that corresponds to the smart contract address on the + Mainnet. Return [None] if the given address is not supported. *) +val mainnet_address_to_alias : string -> string option diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.ml b/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.ml new file mode 100644 index 000000000000..837defaed600 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.ml @@ -0,0 +1,184 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Client_proto_utils + +let group = {Tezos_clic.name = "utilities"; title = "Utility Commands"} + +let unsigned_block_header_param = + let open Tezos_clic in + param + ~name:"unsigned block header" + ~desc:"A hex or JSON encoded unsigned block header" + @@ parameter (fun _ s -> + let open Lwt_result_syntax in + let bytes_opt = `Hex s |> Hex.to_bytes in + let enc = Protocol.Alpha_context.Block_header.unsigned_encoding in + Option.bind bytes_opt (Data_encoding.Binary.of_bytes_opt enc) + |> function + | Some s -> return s + | None -> ( + let error = + Exn + (Failure + "Cannot decode unsigned block header: is it valid JSON or \ + hexadecimal?") + in + let open Data_encoding.Json in + from_string s |> function + | Error _ -> tzfail error + | Ok json -> ( + try destruct enc json |> return with _ -> tzfail error))) + +let commands () = + let open Tezos_clic in + let string_param ~name ~desc = + param ~name ~desc Client_proto_args.string_parameter + in + let block_arg = + default_arg + ~long:"branch" + ~short:'b' + ~placeholder:"hash|tag" + ~doc: + "Block hash used to create the no-op operation to sign (possible tags \ + are 'head' and 'genesis'). Defaults to 'genesis'. Note that the the \ + genesis block hash is network-dependent." + ~default:(Block_services.to_string `Genesis) + (Client_config.block_parameter ()) + in + [ + command + ~group + ~desc: + "Sign a message and display it using the failing_noop operation. This \ + operation is not executable in the protocol. Please note that \ + signing/checking an arbitrary message in itself is not sufficient to \ + verify a key ownership" + (args1 block_arg) + (prefixes ["sign"; "message"] + @@ string_param ~name:"message" ~desc:"message to sign" + @@ prefixes ["for"] + @@ Client_keys.Secret_key.source_param + ~name:"src" + ~desc:"name of the signer contract" + @@ stop) + (fun block_head message src_sk cctxt -> + let open Lwt_result_syntax in + let* block = + Shell_services.Blocks.hash + cctxt + ~chain:cctxt#chain + ~block:block_head + () + in + let* signature = sign_message cctxt ~src_sk ~block ~message in + let*! () = + cctxt#message "Signature: %a" Tezos_crypto.Signature.pp signature + in + return_unit); + command + ~group + ~desc: + "Check the signature of an arbitrary message using the failing_noop \ + operation. Please note that signing/checking an arbitrary message in \ + itself is not sufficient to verify a key ownership." + (args2 + block_arg + (switch ~doc:"Use only exit codes" ~short:'q' ~long:"quiet" ())) + (prefixes ["check"; "that"; "message"] + @@ string_param ~name:"message" ~desc:"signed message" + @@ prefixes ["was"; "signed"; "by"] + @@ Client_keys.Public_key.alias_param + ~name:"signer" + ~desc:"name of the signer contract" + @@ prefixes ["to"; "produce"] + @@ param + ~name:"signature" + ~desc:"the signature to check" + Client_proto_args.signature_parameter + @@ stop) + (fun (block_head, quiet) + message + (_, (key_locator, _)) + signature + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let* block = + Shell_services.Blocks.hash + cctxt + ~chain:cctxt#chain + ~block:block_head + () + in + let* check = + check_message cctxt ~key_locator ~block ~quiet ~message ~signature + in + if check then + if quiet then return_unit + else + let*! () = cctxt#message "Signature check successful" in + return_unit + else cctxt#error "invalid signature"); + command + ~group + ~desc: + "Sign an arbitrary unsigned block header for a given delegate and \ + return the signed block." + no_options + (prefixes ["sign"; "block"] + @@ unsigned_block_header_param @@ prefixes ["for"] + @@ Client_keys.Public_key_hash.source_param + ~name:"delegate" + ~desc:"signing delegate" + @@ stop) + (fun () + unsigned_block_header + delegate + (cctxt : #Protocol_client_context.full) -> + let open Lwt_result_syntax in + let unsigned_header = + Data_encoding.Binary.to_bytes_exn + Protocol.Alpha_context.Block_header.unsigned_encoding + unsigned_block_header + in + let* chain_id = + Shell_services.Chain.chain_id cctxt ~chain:cctxt#chain () + in + let* _, _, sk = Client_keys.get_key cctxt delegate in + let* s = + Client_keys.sign + cctxt + ~watermark: + (Protocol.Alpha_context.Block_header.to_watermark + (Block_header chain_id)) + sk + unsigned_header + in + let*! () = + cctxt#message "%a" Hex.pp (Tezos_crypto.Signature.to_hex s) + in + return_unit); + ] diff --git a/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.mli b/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.mli new file mode 100644 index 000000000000..110ad45cdffd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/client_proto_utils_commands.mli @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val commands : unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_commands/dune b/src/proto_016_PtMumbai/lib_client_commands/dune new file mode 100644 index 000000000000..695b2495f0f6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_commands/dune @@ -0,0 +1,72 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_client_alpha_commands) + (public_name tezos-client-alpha.commands) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-protocol-alpha.parameters + tezos-stdlib-unix + tezos-protocol-environment + tezos-shell-services + tezos-mockup + tezos-mockup-registration + tezos-mockup-commands + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-rpc + tezos-client-base-unix + tezos-protocol-plugin-alpha + uri) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha_parameters + -open Tezos_stdlib_unix + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_client_base_unix + -open Tezos_protocol_plugin_alpha) + (modules (:standard \ alpha_commands_registration))) + +(library + (name tezos_client_alpha_commands_registration) + (public_name tezos-client-alpha.commands-registration) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-protocol-alpha + tezos-protocol-alpha.parameters + tezos-protocol-environment + tezos-shell-services + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-client-alpha.commands + tezos-client-alpha.sapling + tezos-rpc + tezos-protocol-plugin-alpha) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha_parameters + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_client_alpha_commands + -open Tezos_client_sapling_alpha + -open Tezos_protocol_plugin_alpha) + (modules alpha_commands_registration)) diff --git a/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.ml b/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.ml new file mode 100644 index 000000000000..4c8cbdab0c9f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.ml @@ -0,0 +1,751 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Client_keys +open Tezos_sapling.Core.Client + +let json_switch = Tezos_clic.switch ~long:"json" ~doc:"Use JSON format" () + +let save_json_to_file json file = + let output_channel = open_out_bin file in + let ppf = Format.formatter_of_out_channel output_channel in + Data_encoding.Json.pp ppf json ; + Format.pp_print_flush ppf () ; + close_out output_channel + +let group = + { + Tezos_clic.name = "sapling"; + title = "Commands for working with Sapling transactions"; + } + +let keys_of_implicit_account cctxt (source : Protocol.Alpha_context.Contract.t) + = + match source with + | Originated _ -> assert false + | Implicit src -> + Client_keys.get_key cctxt src >>=? fun (_, pk, sk) -> return (src, pk, sk) + +let viewing_key_of_string s = + let exception Unknown_sapling_address in + let encoding = Viewing_key.address_b58check_encoding in + WithExceptions.Option.to_exn + ~none:Unknown_sapling_address + (Tezos_crypto.Base58.simple_decode encoding s) + +(** All signatures are done with an anti-replay string. + In Tezos' protocol this string is set to be chain_id + KT1. **) +let anti_replay cctxt contract = + Tezos_shell_services.Chain_services.chain_id cctxt ~chain:cctxt#chain () + >>=? fun chain_id -> + let address = Protocol.Contract_hash.to_b58check contract in + let chain_id = Tezos_crypto.Chain_id.to_b58check chain_id in + return (address ^ chain_id) + +(** The shielded tez contract expects the recipient pkh encoded in Micheline + in the bound_data of an unshield operation. *) +let bound_data_of_public_key_hash cctxt dst = + let open Tezos_micheline in + let open Protocol.Michelson_v1_primitives in + let pkh_bytes = + Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Signature.Public_key_hash.encoding + dst + in + let micheline_bytes = Micheline.(Bytes (0, pkh_bytes) |> strip_locations) in + let micheline_pkh_type = + Micheline.(Prim (0, T_key_hash, [], []) |> strip_locations) + in + Plugin.RPC.Scripts.pack_data + cctxt + (cctxt#chain, cctxt#block) + ~data:micheline_bytes + ~ty:micheline_pkh_type + >>=? fun (bound_data, _) -> return (Bytes.to_string bound_data) + +let do_unshield cctxt contract src_name stez dst = + anti_replay cctxt contract >>=? fun anti_replay -> + Wallet.new_address cctxt src_name None >>=? fun (src, _, backdst) -> + Context.Client_state.sync_and_scan cctxt contract >>=? fun contract_state -> + bound_data_of_public_key_hash cctxt dst >>=? fun bound_data -> + Lwt.return + @@ Context.unshield ~src ~bound_data ~backdst stez contract_state anti_replay + +let do_shield cctxt ?message contract utez dst = + anti_replay cctxt contract >>=? fun anti_replay -> + Context.Client_state.sync_and_scan cctxt contract >>=? fun contract_state -> + let dst = viewing_key_of_string dst in + Context.shield cctxt ~dst ?message utez contract_state anti_replay + +let do_sapling_transfer cctxt ?message contract src_name amount dst = + anti_replay cctxt contract >>=? fun anti_replay -> + Wallet.new_address cctxt src_name None >>=? fun (src, _, backdst) -> + Context.Client_state.sync_and_scan cctxt contract >>=? fun contract_state -> + let dst = viewing_key_of_string dst in + Context.transfer + cctxt + ~src + ~dst + ~backdst + ?message + amount + contract_state + anti_replay + +let message_arg = + let open Tezos_clic in + arg + ~long:"message" + ~placeholder:"" + ~doc:"Message for Sapling transaction" + (parameter (fun _ x -> return @@ Bytes.of_string x)) + +let memo_size_arg = + let open Tezos_clic in + arg + ~long:"memo-size" + ~placeholder:"memo-size" + ~doc:"Expected length for message of Sapling transaction" + (parameter (fun _ s -> + match + let i = int_of_string s in + assert (i >= 0 && i <= 65535) ; + i + with + | i -> return i + | exception _ -> + failwith "invalid memo-size (must be between 0 and 65535)")) + +let shield_cmd = + let open Client_proto_args in + let open Client_proto_context_commands in + let open Protocol.Alpha_context in + let open Client_proto_contracts in + Tezos_clic.command + ~group + ~desc:"Shield tokens from an implicit account to a Sapling address." + (Tezos_clic.args9 + fee_arg + dry_run_switch + verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args + message_arg) + (Tezos_clic.prefixes ["sapling"; "shield"] + @@ tez_param + ~name:"qty" + ~desc:"Amount taken from transparent wallet of source." + @@ Tezos_clic.prefix "from" + @@ ContractAlias.destination_param + ~name:"src-tz" + ~desc:"Transparent source account." + @@ Tezos_clic.prefix "to" + @@ Tezos_clic.string ~name:"dst-sap" ~desc:"Sapling address of destination." + @@ Tezos_clic.prefix "using" + @@ OriginatedContractAlias.destination_param + ~name:"sapling contract" + ~desc:"Smart contract to submit this transaction to." + @@ Tezos_clic.stop) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter, + message ) + amount + source + sapling_dst + contract_dst + cctxt -> + keys_of_implicit_account cctxt source >>=? fun (pkh, src_pk, src_sk) -> + let open Context in + cctxt#warning + "Shielding %a from %a to %s@ entails a loss of privacy@." + Tez.pp + amount + Contract.pp + source + sapling_dst + >>= fun () -> + do_shield cctxt ?message contract_dst amount sapling_dst + >>=? fun sapling_input -> + let arg = sapling_transaction_as_arg sapling_input in + Client_proto_context.transfer + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~fee_parameter + ~amount + ~src_pk + ~src_sk + ~destination:(Originated contract_dst) + ~source:pkh + ~arg + ?confirmations:cctxt#confirmations + ?fee + ~dry_run + ~verbose_signing + ?gas_limit + ?storage_limit + ?counter + () + >>= fun errors -> + report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + >>= function + | None -> return_unit + | Some (_res, _contracts) -> return_unit) + +let unshield_cmd = + let open Client_proto_args in + let open Client_proto_context_commands in + let open Protocol.Alpha_context in + let open Client_proto_contracts in + Tezos_clic.command + ~group + ~desc:"Unshield tokens from a Sapling address to an implicit account." + (Tezos_clic.args8 + fee_arg + dry_run_switch + verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args) + (Tezos_clic.prefixes ["sapling"; "unshield"] + @@ tez_param + ~name:"qty" + ~desc:"Amount taken from shielded wallet of source." + @@ Tezos_clic.prefix "from" + @@ Sapling_key.alias_param + ~name:"src-sap" + ~desc:"Sapling account of source." + @@ Tezos_clic.prefix "to" + @@ ContractAlias.destination_param + ~name:"dst-tz" + ~desc:"Transparent destination account." + @@ Tezos_clic.prefix "using" + @@ OriginatedContractAlias.destination_param + ~name:"sapling contract" + ~desc:"Smart contract to submit this transaction to." + @@ Tezos_clic.stop) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter ) + amount + (name, _sapling_uri) + tz_dst + contract_dst + cctxt -> + let open Context in + let stez = Shielded_tez.of_tez amount in + cctxt#warning + "Unshielding %a from %s to %a@ entails a loss of privacy@." + Shielded_tez.pp + stez + name + Contract.pp + tz_dst + >>= fun () -> + keys_of_implicit_account cctxt tz_dst >>=? fun (source, src_pk, src_sk) -> + do_unshield cctxt contract_dst name stez source >>=? fun sapling_input -> + let arg = sapling_transaction_as_arg sapling_input in + Client_proto_context.transfer + cctxt + ~chain:cctxt#chain + ~block:cctxt#block + ~fee_parameter + ~amount:Tez.zero + ~src_sk + ~src_pk + ~destination:(Originated contract_dst) + ~source + ~arg + ?confirmations:cctxt#confirmations + ?fee + ~dry_run + ~verbose_signing + ?gas_limit + ?storage_limit + ?counter + () + >>= fun errors -> + report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + >>= function + | None -> return_unit + | Some (_res, _contracts) -> return_unit) + +(* Default name for Sapling transaction file *) +let sapling_transaction_file = "sapling_transaction" + +let file_arg default_filename = + let open Tezos_clic in + arg + ~long:"file" + ~placeholder:default_filename + ~doc:"file name" + (parameter (fun _ x -> return x)) + +(** Shielded transaction are first forged and printed in a file. + Then they are submitted with the next command. **) +let forge_shielded_cmd = + let open Client_proto_args in + let open Client_proto_context_commands in + let open Client_proto_contracts in + Tezos_clic.command + ~group + ~desc:"Forge a sapling transaction and save it to a file." + (Tezos_clic.args11 + fee_arg + dry_run_switch + verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args + message_arg + (file_arg sapling_transaction_file) + json_switch) + (Tezos_clic.prefixes ["sapling"; "forge"; "transaction"] + @@ tez_param + ~name:"qty" + ~desc:"Amount taken from shielded wallet of source." + @@ Tezos_clic.prefix "from" + @@ Sapling_key.alias_param + ~name:"src-sap" + ~desc:"Sapling account of source." + @@ Tezos_clic.prefix "to" + @@ Tezos_clic.string ~name:"dst-sap" ~desc:"Sapling address of destination." + @@ Tezos_clic.prefix "using" + @@ OriginatedContractAlias.destination_param + ~name:"sapling contract" + ~desc:"Smart contract to submit this transaction to." + @@ Tezos_clic.stop) + (fun ( _fee, + _dry_run, + _verbose_signing, + _gas_limit, + _storage_limit, + _counter, + _no_print_source, + _fee_parameter, + message, + file, + use_json_format ) + amount + (name, _sapling_uri) + destination + contract_dst + cctxt -> + let open Context in + let stez = Shielded_tez.of_tez amount in + do_sapling_transfer cctxt ?message contract_dst name stez destination + >>=? fun transaction -> + let file = Option.value ~default:sapling_transaction_file file in + cctxt#message "Writing transaction to %s@." file >>= fun () -> + (if use_json_format then + save_json_to_file + (Data_encoding.Json.construct UTXO.transaction_encoding transaction) + file + else + let bytes = + Hex.of_bytes + (Data_encoding.Binary.to_bytes_exn + UTXO.transaction_encoding + transaction) + in + let file = open_out_bin file in + Printf.fprintf file "0x%s" (Hex.show bytes) ; + close_out file) ; + return_unit) + +let submit_shielded_cmd = + let open Client_proto_context_commands in + let open Client_proto_args in + let open Client_proto_contracts in + Tezos_clic.command + ~group + ~desc:"Submit a forged sapling transaction." + (Tezos_clic.args9 + fee_arg + dry_run_switch + verbose_signing_switch + gas_limit_arg + storage_limit_arg + counter_arg + no_print_source_flag + fee_parameter_args + json_switch) + (Tezos_clic.prefixes ["sapling"; "submit"] + (* TODO: Add a dedicated abstracted Tezos_clic element to parse filenames, + potentially using Sys.file_exists *) + @@ Tezos_clic.string + ~name:"file" + ~desc:"Filename of the forged transaction." + @@ Tezos_clic.prefix "from" + @@ ContractAlias.destination_param + ~name:"alias-tz" + ~desc:"Transparent account paying the fees." + @@ Tezos_clic.prefix "using" + @@ OriginatedContractAlias.destination_param + ~name:"sapling contract" + ~desc:"Smart contract to submit this transaction to." + @@ Tezos_clic.stop) + (fun ( fee, + dry_run, + verbose_signing, + gas_limit, + storage_limit, + counter, + no_print_source, + fee_parameter, + use_json_format ) + filename + source + destination + (cctxt : Protocol_client_context.full) -> + cctxt#message + "Reading forge transaction from file %s -- sending it to %a@." + filename + Protocol.Contract_hash.pp + destination + >>= fun () -> + let open Context in + (if use_json_format then + Lwt_utils_unix.Json.read_file filename >>=? fun json -> + return @@ Data_encoding.Json.destruct UTXO.transaction_encoding json + else + Lwt_utils_unix.read_file filename >>= fun hex -> + let hex = + (* remove 0x *) + String.sub hex 2 (String.length hex - 2) + in + return + @@ Data_encoding.Binary.of_bytes_exn + UTXO.transaction_encoding + Hex.(to_bytes_exn (`Hex hex))) + >>=? fun transaction -> + return (sapling_transaction_as_arg transaction) >>=? fun contract_input -> + let chain = cctxt#chain and block = cctxt#block in + keys_of_implicit_account cctxt source >>=? fun (source, src_pk, src_sk) -> + Client_proto_context.transfer + cctxt + ~chain + ~block + ~fee_parameter + ~amount:Tez.zero + ~src_pk + ~src_sk + ~destination:(Originated destination) + ~source + ~arg:contract_input + ?confirmations:cctxt#confirmations + ?fee + ~dry_run + ~verbose_signing + ?gas_limit + ?storage_limit + ?counter + () + >>= fun errors -> + report_michelson_errors + ~no_print_source + ~msg:"transfer simulation failed" + cctxt + errors + >>= function + | None -> return_unit + | Some (_res, _contracts) -> return_unit) + +let for_contract_arg = + Client_proto_contracts.OriginatedContractAlias.destination_arg + ~name:"for-contract" + ~doc:"name of the contract to associate new key with" + () + +let unencrypted_switch () = + Tezos_clic.switch + ~long:"unencrypted" + ~doc:"Do not encrypt the key on-disk (for testing and debugging)." + () + +let generate_key_cmd = + Tezos_clic.command + ~group + ~desc:"Generate a new sapling key." + (Tezos_clic.args2 (Sapling_key.force_switch ()) (unencrypted_switch ())) + (Tezos_clic.prefixes ["sapling"; "gen"; "key"] + @@ Sapling_key.fresh_alias_param @@ Tezos_clic.stop) + (fun (force, unencrypted) name (cctxt : Protocol_client_context.full) -> + Sapling_key.of_fresh cctxt force name >>=? fun name -> + let mnemonic = Mnemonic.new_random in + cctxt#message + "It is important to save this mnemonic in a secure place:@\n\ + @\n\ + %a@\n\ + @\n\ + The mnemonic can be used to recover your spending key.@." + Mnemonic.words_pp + (Bip39.to_words mnemonic) + >>= fun () -> + Wallet.register cctxt ~force ~unencrypted mnemonic name >>=? fun _vk -> + return_unit) + +let use_key_for_contract_cmd = + Tezos_clic.command + ~group + ~desc:"Use a sapling key for a contract." + (Tezos_clic.args1 memo_size_arg) + (Tezos_clic.prefixes ["sapling"; "use"; "key"] + @@ Sapling_key.alias_param + ~name:"sapling-key" + ~desc:"Sapling key to use for the contract." + @@ Tezos_clic.prefixes ["for"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"Contract the key will be used on." + @@ Tezos_clic.stop) + (fun default_memo_size + (name, _sapling_uri) + contract + (cctxt : Protocol_client_context.full) -> + Wallet.find_vk cctxt name >>=? fun vk -> + Context.Client_state.register + cctxt + ~default_memo_size + ~force:false + contract + vk) + +let import_key_cmd = + Tezos_clic.command + ~group + ~desc:"Restore a sapling key from mnemonic." + (Tezos_clic.args3 + (Sapling_key.force_switch ()) + (unencrypted_switch ()) + (Tezos_clic.arg + ~long:"mnemonic" + ~placeholder:"mnemonic" + ~doc:"Mnemonic as an option, only used for testing and debugging." + Client_proto_args.string_parameter)) + (Tezos_clic.prefixes ["sapling"; "import"; "key"] + @@ Sapling_key.fresh_alias_param @@ Tezos_clic.stop) + (fun (force, unencrypted, mnemonic_opt) + fresh_name + (cctxt : Protocol_client_context.full) -> + (match mnemonic_opt with + | None -> + let rec loop_words (acc : string list) i = + if i > 23 then return (List.rev acc) + else + cctxt#prompt_password "Enter word %d: " i >>=? fun word_raw -> + let word = Bytes.to_string word_raw in + match Bip39.index_of_word word with + | None -> loop_words acc i + | Some _ -> loop_words (word :: acc) (succ i) + in + loop_words [] 0 + | Some mnemonic -> return (String.split_on_char ' ' mnemonic)) + >>=? fun words -> + match Bip39.of_words words with + | None -> failwith "Not a valid mnemonic" + | Some mnemonic -> + Sapling_key.of_fresh cctxt force fresh_name >>=? fun name -> + Wallet.register cctxt ~force ~unencrypted mnemonic name >>=? fun _ -> + return_unit) + +let commands () = + let child_index_param = + Tezos_clic.param + ~name:"child-index" + ~desc:"Index of the child to derive." + Client_proto_args.int_parameter + in + let index_arg = + Tezos_clic.arg + ~doc:"index of the address to generate" + ~long:"address-index" + ~placeholder:"idx" + Client_proto_args.int_parameter + in + [ + generate_key_cmd; + use_key_for_contract_cmd; + import_key_cmd; + Tezos_clic.command + ~group + ~desc:"Derive a key from an existing one using zip32." + (Tezos_clic.args4 + (Sapling_key.force_switch ()) + for_contract_arg + (unencrypted_switch ()) + memo_size_arg) + (Tezos_clic.prefixes ["sapling"; "derive"; "key"] + @@ Sapling_key.fresh_alias_param @@ Tezos_clic.prefix "from" + @@ Sapling_key.alias_param + @@ Tezos_clic.prefixes ["at"; "index"] + @@ child_index_param @@ Tezos_clic.stop) + (fun (force, contract_opt, unencrypted, default_memo_size) + fresh_name + (existing_name, _existing_uri) + child_index + (cctxt : Protocol_client_context.full) -> + Sapling_key.of_fresh cctxt force fresh_name >>=? fun new_name -> + Wallet.derive + cctxt + ~force + ~unencrypted + existing_name + new_name + child_index + >>=? fun (path, vk) -> + cctxt#message + "Derived new key %s from %s with path %s@." + new_name + existing_name + path + >>= fun () -> + (* TODO must pass contract address for now *) + let contract = WithExceptions.Option.get ~loc:__LOC__ contract_opt in + Context.Client_state.register + cctxt + ~default_memo_size + ~force + contract + vk); + Tezos_clic.command + ~group + ~desc:"Generate an address for a key referenced by alias." + (Tezos_clic.args1 index_arg) + (Tezos_clic.prefixes ["sapling"; "gen"; "address"] + @@ Sapling_key.alias_param @@ Tezos_clic.stop) + (fun index_opt (name, _sapling_uri) (cctxt : Protocol_client_context.full) -> + Wallet.new_address cctxt name index_opt + >>=? fun (_, corrected_index, address) -> + let address_b58 = + Tezos_crypto.Base58.simple_encode + Viewing_key.address_b58check_encoding + address + in + cctxt#message + "Generated address:@.%s@.at index %Ld" + address_b58 + (Viewing_key.index_to_int64 corrected_index) + >>= fun () -> return_unit); + Tezos_clic.command + ~group + ~desc:"Save a sapling viewing key in a JSON file." + Tezos_clic.no_options + (Tezos_clic.prefixes ["sapling"; "export"; "key"] + @@ Sapling_key.alias_param @@ Tezos_clic.prefix "in" + @@ Tezos_clic.param + ~name:"file" + ~desc:"Filename." + Client_proto_args.string_parameter + @@ Tezos_clic.stop) + (fun () (name, _sapling_uri) file (cctxt : Protocol_client_context.full) -> + Wallet.export_vk cctxt name >>=? fun vk_json -> + return (save_json_to_file vk_json file)); + Tezos_clic.command + ~group + ~desc:"Get balance associated with given sapling key and contract" + (Tezos_clic.args1 + (Tezos_clic.switch + ~doc:"Print the collection of non-spent inputs." + ~short:'v' + ~long:"verbose" + ())) + (Tezos_clic.prefixes ["sapling"; "get"; "balance"; "for"] + @@ Sapling_key.alias_param + ~name:"sapling-key" + ~desc:"Sapling key we get balance for." + @@ Tezos_clic.prefixes ["in"; "contract"] + @@ Client_proto_contracts.OriginatedContractAlias.destination_param + ~name:"contract" + ~desc:"Contract we get balance from." + @@ Tezos_clic.stop) + (fun verbose + (name, _sapling_uri) + contract + (cctxt : Protocol_client_context.full) -> + Wallet.find_vk cctxt name >>= function + | Error _ -> cctxt#error "Account %s not found" name + | Ok vk -> ( + Context.Client_state.sync_and_scan cctxt contract + >>=? fun contract_state -> + Context.Contract_state.find_account vk contract_state |> function + | None -> cctxt#error "Account %s not found" name + | Some account -> + (if verbose then + cctxt#answer + "@[<v 2>Received Sapling transactions for %s@,@[<v>%a@]@]" + name + Context.Account.pp_unspent + account + else Lwt.return_unit) + >>= fun () -> + cctxt#answer + "Total Sapling funds %a%s" + Context.Shielded_tez.pp + (Context.Account.balance account) + Operation_result.tez_sym + >>= fun () -> return_unit)); + Tezos_clic.command + ~group + ~desc:"List sapling keys." + Tezos_clic.no_options + (Tezos_clic.fixed ["sapling"; "list"; "keys"]) + (fun () (cctxt : Protocol_client_context.full) -> + Sapling_key.load cctxt >>=? fun l -> + List.iter_s + (fun (s, _) -> cctxt#message "%s" s) + (List.sort (fun (s1, _) (s2, _) -> String.compare s1 s2) l) + >>= fun () -> return_unit); + shield_cmd; + unshield_cmd; + forge_shielded_cmd; + submit_shielded_cmd; + ] diff --git a/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.mli b/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.mli new file mode 100644 index 000000000000..913abf8596b1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/client_sapling_commands.mli @@ -0,0 +1,23 @@ +(* The MIT License (MIT) + * + * Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. *) + +val commands : unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_client_sapling/context.ml b/src/proto_016_PtMumbai/lib_client_sapling/context.ml new file mode 100644 index 000000000000..1122de030c3a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/context.ml @@ -0,0 +1,520 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_sapling.Core.Client + +let _ = Random.self_init () + +module Tez = Protocol.Alpha_context.Tez + +module Shielded_tez : sig + type t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val of_mutez : int64 -> t option + + val to_mutez : t -> int64 + + val of_tez : Tez.t -> t + + val ( +? ) : t -> t -> t tzresult + + val ( -? ) : t -> t -> t tzresult +end = struct + include Tez + + let ( +? ) a b = a +? b |> Environment.wrap_tzresult + + let ( -? ) a b = a -? b |> Environment.wrap_tzresult + + let of_tez t = + let i = Tez.to_mutez t in + assert (UTXO.valid_amount i) ; + WithExceptions.Option.get ~loc:__LOC__ @@ of_mutez i +end + +let sapling_transaction_as_arg t = + let pp_michelson ppf t = + let open Tezos_micheline in + let list_of_transactions_expr = + let transaction_expr = + Micheline.Bytes + (0, Data_encoding.Binary.to_bytes_exn UTXO.transaction_encoding t) + in + Micheline.strip_locations @@ Micheline.Seq (0, [transaction_expr]) + in + Michelson_v1_printer.print_expr ppf list_of_transactions_expr + in + Format.asprintf "%a" pp_michelson t + +(** The inputs and outputs are shuffled to prevent meta-data analysis. **) +module Shuffle = struct + let list l = + let a = Array.of_list l in + let len = Array.length a in + for i = len downto 2 do + let idx = Random.int i in + let swp_idx = i - 1 in + let tmp = a.(swp_idx) in + a.(swp_idx) <- a.(idx) ; + a.(idx) <- tmp + done ; + Array.to_list a + + let pair x y = if Random.bool () then [y; x] else [x; y] +end + +type error += Balance_too_low of Shielded_tez.t * Shielded_tez.t + +let register_error_kind category ~id ~title ~description ?pp encoding from_error + to_error = + let id = "client_sapling." ^ Protocol.name ^ "." ^ id in + register_error_kind + category + ~id + ~title + ~description + ?pp + encoding + from_error + to_error + +let () = + register_error_kind + `Temporary + ~id:"balance_too_low" + ~title:"Balance too low" + ~description:"The sender contract does not have enough tokens." + ~pp:(fun ppf (balance, amount) -> + Format.fprintf + ppf + "@[<h>Balance too low (%a) to spend %a@]" + Shielded_tez.pp + balance + Shielded_tez.pp + amount) + Data_encoding.( + obj2 + (req "actual_balance" Shielded_tez.encoding) + (req "amount" Shielded_tez.encoding)) + (function + | Balance_too_low (balance, amount) -> Some (balance, amount) | _ -> None) + (fun (balance, amount) -> Balance_too_low (balance, amount)) + +module Storage = Tezos_sapling.Storage +module F = Tezos_sapling.Forge + +module Input_set = struct + include Set.Make (F.Input) + + let to_list = elements + + let pp_f pp i = + Format.fprintf + pp + "@[<h>%s %Ld@]" + (Tezos_crypto.Base58.simple_encode + Viewing_key.address_b58check_encoding + (F.Input.address i)) + (F.Input.amount i) +end + +module Account = struct + type t = { + vk : Viewing_key.t; + unspents : Input_set.t; + balance : Shielded_tez.t; + } + + let encoding = + let open Data_encoding in + conv + (fun cs -> (cs.vk, Input_set.to_list cs.unspents, cs.balance)) + (fun (vk, unspents, balance) -> + {vk; unspents = Input_set.of_list unspents; balance}) + (obj3 + (req "vk" Viewing_key.encoding) + (req "unspents" (list F.Input.encoding)) + (req "balance" Shielded_tez.encoding)) + + let create vk = {vk; unspents = Input_set.empty; balance = Shielded_tez.zero} + + let balance c = c.balance + + let add_unspent c input = + let amount = + WithExceptions.Option.get ~loc:__LOC__ + @@ Shielded_tez.of_mutez (F.Input.amount input) + in + match Shielded_tez.(c.balance +? amount) with + | Error _ -> assert false (* overflow *) + | Ok balance -> + let unspents = Input_set.add input c.unspents in + {c with balance; unspents} + + let remove_unspent c input = + let amount = + WithExceptions.Option.get ~loc:__LOC__ + @@ Shielded_tez.of_mutez (F.Input.amount input) + in + match Shielded_tez.(c.balance -? amount) with + | Error _ -> assert false (* negative balance *) + | Ok balance -> + let unspents = Input_set.remove input c.unspents in + {c with balance; unspents} + + let filter_spent account storage = + Input_set.fold + (fun input acc -> + if F.Input.is_spent input storage account.vk then + remove_unspent acc input + else acc) + account.unspents + account + + let pick_input c = + let ( >?| ) x f = Option.map f x in + Input_set.choose c.unspents >?| fun unspent -> + let c = remove_unspent c unspent in + (unspent, c) + + let pp_unspent : Format.formatter -> t -> unit = + fun ppf a -> + (Format.pp_print_list ~pp_sep:Format.pp_print_cut Input_set.pp_f ppf) + (Input_set.elements a.unspents) +end + +module Contract_state = struct + module Accounts = struct + include Set.Make (struct + type t = Account.t + + let compare a b = + let open Account in + Bytes.compare (Viewing_key.to_bytes a.vk) (Viewing_key.to_bytes b.vk) + end) + + let replace a set = add a (remove a set) + + let find vk accounts = find (Account.create vk) accounts + end + + let accounts_encoding = + let open Data_encoding in + conv + Accounts.elements + (List.fold_left (fun m e -> Accounts.add e m) Accounts.empty) + (list Account.encoding) + + type t = {accounts : Accounts.t; storage : Storage.state} + + let encoding = + let open Data_encoding in + conv + (fun t -> (t.accounts, t.storage)) + (fun (accounts, storage) -> {accounts; storage}) + (obj2 + (req "accounts" accounts_encoding) + (req "storage" Storage.state_encoding)) + + let empty ~memo_size = + {accounts = Accounts.empty; storage = Storage.empty ~memo_size} + + let find_account vk contract_state = Accounts.find vk contract_state.accounts + + let init ~force vk state = + Accounts.find vk state.accounts |> function + | None -> + let accounts = Accounts.add (Account.create vk) state.accounts in + return {state with accounts} + | Some _ -> + if force then + let accounts = Accounts.add (Account.create vk) state.accounts in + return {state with accounts} + else failwith "vk already present" + + let add_unspent vk input accounts = + let account = + Accounts.find vk accounts |> WithExceptions.Option.get ~loc:__LOC__ + in + let account = Account.add_unspent account input in + Accounts.replace account accounts + + (** Scan the Sapling storage of a smart contract and update the accounts of + all known viewing keys for that contract *) + let scan state storage = + (* remove newly spent inputs *) + let accounts = + Accounts.map + (fun account -> Account.filter_spent account storage) + state.accounts + in + (* get all the vks that need to be scanned for *) + let vks = + Accounts.fold (fun account acc -> Account.(account.vk) :: acc) accounts [] + in + let size, _ = Storage.size storage in + let rec aux pos accounts = + if pos < size then + (* try to decrypt each inputs with all vks *) + List.fold_left + (fun acc vk -> + match F.Input.get storage pos vk with + | None -> acc + | Some input -> (vk, input) :: acc) + [] + vks + |> function + | [] -> aux (Int64.succ pos) accounts + | [(vk, (_message, forge_input))] -> + let is_spent = F.Input.is_spent forge_input storage vk in + if is_spent then aux (Int64.succ pos) accounts + else aux (Int64.succ pos) (add_unspent vk forge_input accounts) + | _ -> assert false (* got more than one decrypting key *) + else accounts + in + let current_size, _ = Storage.size state.storage in + let accounts = aux current_size accounts in + {accounts; storage} + + (** Update the Sapling storage of a smart contract using a diff, checking that + the resulting Merkle tree has a root equal to the one in the diff. *) + let update_storage contract_state (root, diff) = + let open Protocol.Alpha_context.Sapling in + let storage = + Tezos_sapling.Storage.add + contract_state.storage + diff.commitments_and_ciphertexts + in + let computed_root = Storage.get_root storage in + if computed_root <> root then + Stdlib.failwith "Commitment tree inconsistent wrt to node." + else + let storage = + List.fold_left + (fun s nf -> Storage.add_nullifier s nf) + storage + diff.nullifiers + in + scan contract_state storage +end + +module Client_state = struct + module Map = Map.Make (Protocol.Contract_hash) + + type t = Contract_state.t Map.t + + let encoding = + let open Data_encoding in + conv + Map.bindings + (List.fold_left (fun m (k, v) -> Map.add k v m) Map.empty) + (list + (obj2 + (req "contract" Protocol.Alpha_context.Contract.originated_encoding) + (req "state" Contract_state.encoding))) + + let filename = "sapling_state" + + let load (cctxt : #Client_context.wallet) = + cctxt#load filename ~default:Map.empty encoding + + let write (cctxt : #Client_context.wallet) t = cctxt#write filename t encoding + + let get_or_init ~default_memo_size contract client_state = + Map.find contract client_state |> function + | None -> ( + match default_memo_size with + | None -> + failwith + "Unknown memo size for contract %s and none was provided in \ + options" + @@ Protocol.Contract_hash.to_b58check contract + | Some memo_size -> + let contract_state = Contract_state.empty ~memo_size in + let client_state = Map.add contract contract_state client_state in + return (contract_state, client_state)) + | Some contract_state -> return (contract_state, client_state) + + let register cctxt ~force ~default_memo_size contract vk = + load cctxt >>=? fun client_state -> + get_or_init ~default_memo_size contract client_state + >>=? fun (contract_state, client_state) -> + Contract_state.init ~force vk contract_state >>=? fun contract_state -> + let client_state = Map.add contract contract_state client_state in + write cctxt client_state + + let find (cctxt : #Client_context.full) contract state = + Map.find contract state |> function + | None -> + cctxt#error + "Contract %s not found" + (Protocol.Contract_hash.to_b58check contract) + | Some v -> return v + + (** Call the node RPC to obtain the storage diff of a contract *) + let get_diff cctxt contract offset_commitment offset_nullifier = + Protocol.Alpha_services.Contract.single_sapling_get_diff + cctxt + (cctxt#chain, cctxt#block) + contract + ~offset_commitment + ~offset_nullifier + () + + let sync_and_scan cctxt contract = + load cctxt >>=? fun state -> + find cctxt contract state >>=? fun contract_state -> + let cm_pos, nf_pos = Storage.size contract_state.storage in + get_diff cctxt contract cm_pos nf_pos >>=? fun diff -> + let contract_state = Contract_state.update_storage contract_state diff in + let state = Map.add contract contract_state state in + write cctxt state >>=? fun () -> return contract_state +end + +(** Truncate or pad the message to fit the memo_size *) +let adjust_message_length (cctxt : #Client_context.full) ?message memo_size = + match message with + | None -> + cctxt#warning + "no message provided, adding a zeroes filled message of the required \ + length: %d " + memo_size + >|= fun () -> Bytes.make memo_size '\000' + | Some message -> + let message_length = Bytes.length message in + if message_length = memo_size then Lwt.return message + else if message_length > memo_size then + cctxt#warning + "Your message is too long (%d bytes) and will therefore be truncated \ + to %d bytes" + message_length + memo_size + >|= fun () -> Bytes.sub message 0 memo_size + else + cctxt#warning + "Your message is too short (%d bytes) and will therefore be \ + right-padded with zero bytes to reach a %d-byte length" + message_length + memo_size + >|= fun () -> + Bytes.cat message (Bytes.make (memo_size - message_length) '\000') + +let create_payment ~message dst amount = + let amount = Shielded_tez.to_mutez amount in + F.make_output dst amount message + +(** Return a list of inputs belonging to an account sufficient to cover an + amount, together with the change remaining. *) +let get_shielded_amount amount account = + let balance = Account.balance account in + error_unless (balance >= amount) (Balance_too_low (balance, amount)) + >|? fun () -> + let to_pay = Shielded_tez.to_mutez amount in + let inputs_to_spend = [] in + let rec loop to_pay chosen_inputs account = + if Int64.(compare to_pay zero) > 0 then + Account.pick_input account |> function + | None -> + Stdlib.failwith "Not enough inputs" (* TODO raise a proper error *) + | Some (next_in, account) -> + let next_val = F.Input.amount next_in in + let rest_to_pay = Int64.sub to_pay next_val in + loop rest_to_pay (next_in :: chosen_inputs) account + else + let change = + WithExceptions.Option.get ~loc:__LOC__ + @@ Shielded_tez.of_mutez @@ Int64.abs to_pay + in + (chosen_inputs, change) + in + loop to_pay inputs_to_spend account + +let create_payback ~memo_size address amount = + let plaintext_message = Bytes.make memo_size '\000' in + let amount = Shielded_tez.to_mutez amount in + F.make_output address amount plaintext_message + +(* The caller should check that the account exists already *) +let unshield ~src ~bound_data ~backdst amount (state : Contract_state.t) + anti_replay = + let vk = Viewing_key.of_sk src in + let account = + Contract_state.find_account vk state + |> WithExceptions.Option.get ~loc:__LOC__ + in + get_shielded_amount amount account >|? fun (inputs, change) -> + let memo_size = Storage.get_memo_size state.storage in + let payback = create_payback ~memo_size backdst change in + F.forge_transaction + (Shuffle.list inputs) + [payback] + src + anti_replay + ~bound_data + state.storage + +let shield cctxt ~dst ?message amount (state : Contract_state.t) anti_replay = + let shielded_amount = Shielded_tez.of_tez amount in + let memo_size = Storage.get_memo_size Contract_state.(state.storage) in + adjust_message_length cctxt ?message memo_size >>= fun message -> + let payment = create_payment ~message dst shielded_amount in + let negative_amount = Int64.neg (Tez.to_mutez amount) in + return + @@ F.forge_shield_transaction + [payment] + negative_amount + anti_replay + ~bound_data:"" + Contract_state.(state.storage) + +(* The caller should check that the account exists already *) +let transfer cctxt ~src ~dst ~backdst ?message amount (state : Contract_state.t) + anti_replay = + let vk = Viewing_key.of_sk src in + let account = + Contract_state.find_account vk state + |> WithExceptions.Option.get ~loc:__LOC__ + in + let memo_size = Storage.get_memo_size state.storage in + adjust_message_length cctxt ?message memo_size >|= fun message -> + get_shielded_amount amount account >|? fun (inputs, change) -> + let payment = create_payment ~message dst amount in + let payback = create_payback ~memo_size backdst change in + let sapling_transaction = + F.forge_transaction + (Shuffle.list inputs) + (Shuffle.pair payback payment) + src + anti_replay + ~bound_data:"" + state.storage + in + sapling_transaction diff --git a/src/proto_016_PtMumbai/lib_client_sapling/context.mli b/src/proto_016_PtMumbai/lib_client_sapling/context.mli new file mode 100644 index 000000000000..5520393c1402 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/context.mli @@ -0,0 +1,147 @@ +(* The MIT License (MIT) + * + * Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. *) + +(** + This module allows the creation of Sapling transactions: shield, unshield and + transfer. + Because Sapling uses an UTXO model, it is necessary for the client to + maintain locally the set of unspent outputs for each viewing key, for each + smart contract. This operation is called scanning. + This local cache is updated downloading from the node only the difference + from the last scanned state. +*) + +open Tezos_sapling.Core.Client + +module Tez : module type of Protocol.Alpha_context.Tez + +(** This module is used to represent any shielded token to avoid confusing it + with Tez. *) +module Shielded_tez : sig + type t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val of_mutez : int64 -> t option + + val to_mutez : t -> int64 + + val of_tez : Tez.t -> t + + val ( +? ) : t -> t -> t tzresult +end + +(** Convert a Sapling transaction to a suitable argument for the Smart Contract. *) +val sapling_transaction_as_arg : UTXO.transaction -> string + +(** Account corresponding to a contract and a viewing key *) +module Account : sig + type t + + val balance : t -> Shielded_tez.t + + val pp_unspent : Format.formatter -> t -> unit +end + +(** State of a contract, potentially involving several viewing keys *) +module Contract_state : sig + type t + + val find_account : Viewing_key.t -> t -> Account.t option +end + +module Client_state : sig + type t + + val find : + Protocol_client_context.full -> + Protocol.Contract_hash.t -> + t -> + Contract_state.t tzresult Lwt.t + + val register : + Protocol_client_context.full -> + force:bool -> + default_memo_size:int option -> + Protocol.Contract_hash.t -> + Viewing_key.t -> + unit tzresult Lwt.t + + (** Synchronise our local state with the blockchain's. + The state must be recent enough to craft correct transactions. + The limit enforced by the protocol if 120 blocks. + Also scans, ie. checks for incoming payments and add + them to our balance. + **) + val sync_and_scan : + Protocol_client_context.full -> + Protocol.Contract_hash.t -> + Contract_state.t tzresult Lwt.t +end + +(** [shield ~message ~dst tez cstate anti-replay] returns a transaction + shielding [tez] tez to a sapling address [dst] using a sapling + storage [cstate] and the anti-replay string. *) +val shield : + #Client_context.full -> + dst:Viewing_key.address -> + ?message:bytes -> + Tez.t -> + Contract_state.t -> + string -> + UTXO.transaction tzresult Lwt.t + +(** [unshield ~src_name ~src ~dst ~backdst stez cstate storage] returns + a transaction unshielding [stez] shielded tokens from a sapling wallet + [src] to a transparent tezos address [dst], sending the change back to + [backdst] and using a Sapling storage [cstate] and a anti-replay string. + The transaction is refused if there is an insufficient amount of shielded + tez in the wallet [src], the error is raised with [src_name]. + *) +val unshield : + src:Spending_key.t -> + bound_data:string -> + backdst:Viewing_key.address -> + Shielded_tez.t -> + Contract_state.t -> + string -> + UTXO.transaction tzresult + +(** [transfer ~message ~src ~dst ~backdst amount cstate anti-replay] creates a + Sapling transaction of [amount] shielded tez from Sapling wallet [src] to + Sapling address [dst], sending the change to [backdst], using a Sapling + storage [cstate] and a anti-replay string. + [~message] is a message that will be uploaded encrypted on chain. *) +val transfer : + #Client_context.full -> + src:Spending_key.t -> + dst:Viewing_key.address -> + backdst:Viewing_key.address -> + ?message:bytes -> + Shielded_tez.t -> + Contract_state.t -> + string -> + UTXO.transaction tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_client_sapling/dune b/src/proto_016_PtMumbai/lib_client_sapling/dune new file mode 100644 index 000000000000..63e26f9de414 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/dune @@ -0,0 +1,29 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_client_sapling_alpha) + (public_name tezos-client-alpha.sapling) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-crypto + tezos-stdlib-unix + tezos-client-base + tezos-signer-backends + tezos-client-alpha + tezos-client-alpha.commands + tezos-protocol-alpha + tezos-protocol-plugin-alpha) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_stdlib_unix + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_alpha_commands + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha)) diff --git a/src/proto_016_PtMumbai/lib_client_sapling/wallet.ml b/src/proto_016_PtMumbai/lib_client_sapling/wallet.ml new file mode 100644 index 000000000000..ab43f45d3889 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/wallet.ml @@ -0,0 +1,100 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Client_keys +open Tezos_sapling.Core.Client + +(* Transform a spending key to an uri, encrypted or not. *) +let to_uri unencrypted cctxt sapling_key = + if unencrypted then + Tezos_signer_backends.Unencrypted.make_sapling_key sapling_key >>?= return + else Tezos_signer_backends.Encrypted.encrypt_sapling_key cctxt sapling_key + +(** Transform an uri into a spending key, asking for a password if the uri was + encrypted. *) +let from_uri (cctxt : #Client_context.full) uri = + Tezos_signer_backends.Encrypted.decrypt_sapling_key cctxt uri + +let register (cctxt : #Client_context.full) ?(force = false) + ?(unencrypted = false) mnemonic name = + let sk = Spending_key.of_seed @@ Mnemonic.to_32_bytes mnemonic in + to_uri unencrypted cctxt sk >>=? fun sk_uri -> + let key = + { + sk = sk_uri; + path = [Spending_key.child_index sk]; + address_index = Viewing_key.default_index; + } + in + Sapling_key.add ~force cctxt name key >>=? fun () -> + return @@ Viewing_key.of_sk sk + +let derive (cctxt : #Client_context.full) ?(force = false) + ?(unencrypted = false) src_name dst_name child_index = + Sapling_key.find cctxt src_name >>=? fun k -> + from_uri cctxt k.sk >>=? fun src_sk -> + let child_index = Int32.of_int child_index in + let dst_sk = Spending_key.derive_key src_sk child_index in + to_uri unencrypted cctxt dst_sk >>=? fun dst_sk_uri -> + let dst_key = + { + sk = dst_sk_uri; + path = child_index :: k.path; + address_index = Viewing_key.default_index; + } + in + (* TODO check this force *) + let _ = force in + Sapling_key.add ~force:true cctxt dst_name dst_key >>=? fun () -> + let path = + String.concat "/" (List.map Int32.to_string (List.rev dst_key.path)) + in + return (path, Viewing_key.of_sk dst_sk) + +let find_vk cctxt name = + Sapling_key.find cctxt name >>=? fun k -> + from_uri cctxt k.sk >>=? fun sk -> return (Viewing_key.of_sk sk) + +let new_address (cctxt : #Client_context.full) name index_opt = + Sapling_key.find cctxt name >>=? fun k -> + let index = + match index_opt with + | None -> k.address_index + | Some i -> Viewing_key.index_of_int64 (Int64.of_int i) + in + from_uri cctxt k.sk >>=? fun sk -> + return (Viewing_key.of_sk sk) >>=? fun vk -> + (* Viewing_key.new_address finds the smallest index greater or equal to + [index] that generates a correct address. *) + let corrected_index, address = Viewing_key.new_address vk index in + Sapling_key.update + cctxt + name + {k with address_index = Viewing_key.index_succ corrected_index} + >>=? fun () -> return (sk, corrected_index, address) + +let export_vk cctxt name = + find_vk cctxt name >>=? fun vk -> + return (Data_encoding.Json.construct Viewing_key.encoding vk) diff --git a/src/proto_016_PtMumbai/lib_client_sapling/wallet.mli b/src/proto_016_PtMumbai/lib_client_sapling/wallet.mli new file mode 100644 index 000000000000..5e1238067f77 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_client_sapling/wallet.mli @@ -0,0 +1,66 @@ +(* The MIT License (MIT) + * + * Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. *) + +open Tezos_sapling.Core.Client + +(** Add to the wallet a new spending key derived from a mnemonic and identified + by an alias. The wallet is updated and the corresponding viewing key is + returned. + If [force] it will overwrite an existing alias. *) +val register : + #Client_context.full -> + ?force:bool -> + ?unencrypted:bool -> + Bip39.t -> + string -> + Viewing_key.t tzresult Lwt.t + +(** [derive parent child index] derives a key with alias [child] from an + existing key with alias [parent] at [index] using ZIP32. + If a new index is required the state of the wallet is updated. + The path and viewing key corresponding to the generated key are returned. *) +val derive : + #Client_context.full -> + ?force:bool -> + ?unencrypted:bool -> + string -> + string -> + int -> + (string * Viewing_key.t) tzresult Lwt.t + +val find_vk : #Client_context.full -> string -> Viewing_key.t tzresult Lwt.t + +(** Generate a new address. + If an optional index is provided, try to derive the address at this index, + otherwise use the first viable one. + Not all indexes correspond to a valid address so successive ones are tried. + Once a valid index is found it is recorded in the wallet. + Return also the corresponding sk and vk to avoid asking the user multiple + times for the description password. *) +val new_address : + #Client_context.full -> + string -> + int option -> + (Spending_key.t * Viewing_key.index * Viewing_key.address) tzresult Lwt.t + +val export_vk : + #Client_context.full -> string -> Data_encoding.Json.json tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_dal/RPC.ml b/src/proto_016_PtMumbai/lib_dal/RPC.ml new file mode 100644 index 000000000000..30caa6e1eb58 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/RPC.ml @@ -0,0 +1,183 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Environment +open Error_monad + +type error += + | Cannot_construct_external_message + | Cannot_deserialize_external_message + +let () = + register_error_kind + `Permanent + ~id:"dac_cannot_construct_external_message" + ~title:"External rollup message could not be constructed" + ~description:"External rollup message could not be constructed" + ~pp:(fun ppf () -> + Format.fprintf ppf "External rollup message could not be constructed") + Data_encoding.unit + (function Cannot_construct_external_message -> Some () | _ -> None) + (fun () -> Cannot_construct_external_message) ; + register_error_kind + `Permanent + ~id:"dac_cannot_deserialize_rollup_external_message" + ~title:"External rollup message could not be deserialized" + ~description:"External rollup message could not be deserialized" + ~pp:(fun ppf () -> + Format.fprintf ppf "External rollup message could not be deserialized") + Data_encoding.unit + (function Cannot_deserialize_external_message -> Some () | _ -> None) + (fun () -> Cannot_deserialize_external_message) + +module Registration = struct + let register0_noctxt ~chunked s f dir = + RPC_directory.register ~chunked dir s (fun _rpc_ctxt q i -> f q i) +end + +module DAC = struct + module Hash_storage = Dac_preimage_data_manager.Reveal_hash + + let store_preimage_request_encoding = + Data_encoding.( + obj2 + (req "payload" Data_encoding.(bytes Hex)) + (req "pagination_scheme" Dac_pages_encoding.pagination_scheme_encoding)) + + let store_preimage_response_encoding = + Data_encoding.( + obj2 + (req "root_hash" Protocol.Sc_rollup_reveal_hash.encoding) + (req "external_message" (bytes Hex))) + + let external_message_query = + let open RPC_query in + query (fun hex_string -> hex_string) + |+ opt_field "external_message" RPC_arg.string (fun s -> s) + |> seal + + module S = struct + let dac_store_preimage = + RPC_service.put_service + ~description:"Split DAC reveal data" + ~query:RPC_query.empty + ~input:store_preimage_request_encoding + ~output:store_preimage_response_encoding + RPC_path.(open_root / "dac" / "store_preimage") + + (* DAC/FIXME: https://gitlab.com/tezos/tezos/-/issues/4263 + remove this endpoint once end-to-end tests are in place. *) + let verify_external_message_signature = + RPC_service.get_service + ~description:"Verify signature of an external message to inject in L1" + ~query:external_message_query + ~output:Data_encoding.bool + RPC_path.(open_root / "dac" / "verify_signature") + end + + let handle_serialize_dac_store_preimage cctxt dac_sk_uris reveal_data_dir + (data, pagination_scheme) = + let open Lwt_result_syntax in + let open Dac_pages_encoding in + let for_each_page (hash, page_contents) = + Dac_manager.Reveal_hash.Storage.save_bytes + reveal_data_dir + hash + page_contents + in + let* root_hash = + match pagination_scheme with + | Merkle_tree_V0 -> + let size = + Protocol.Alpha_context.Constants.sc_rollup_message_size_limit + in + Merkle_tree.V0.serialize_payload + ~max_page_size:size + data + ~for_each_page + | Hash_chain_V0 -> Hash_chain.V0.serialize_payload ~for_each_page data + in + let* signature, witnesses = + Dac_manager.Reveal_hash.Signatures.sign_root_hash + cctxt + dac_sk_uris + root_hash + in + let*? external_message = + match + Dac_manager.Reveal_hash.External_message.make + root_hash + signature + witnesses + with + | Ok external_message -> Ok external_message + | Error _ -> Error_monad.error Cannot_construct_external_message + in + return (root_hash, external_message) + + let handle_verify_external_message_signature public_keys_opt + encoded_l1_message = + let open Lwt_result_syntax in + let open Dac_manager.Reveal_hash in + let external_message = + let open Option_syntax in + let* encoded_l1_message = encoded_l1_message in + let* as_bytes = Hex.to_bytes @@ `Hex encoded_l1_message in + External_message.of_bytes as_bytes + in + match external_message with + | None -> tzfail @@ Cannot_deserialize_external_message + | Some (External_message.Dac_message {root_hash; signature; witnesses}) -> + Signatures.verify ~public_keys_opt root_hash signature witnesses + + let register_serialize_dac_store_preimage cctxt dac_sk_uris reveal_data_dir = + Registration.register0_noctxt + ~chunked:false + S.dac_store_preimage + (fun () input -> + handle_serialize_dac_store_preimage + cctxt + dac_sk_uris + reveal_data_dir + input) + + let register_verify_external_message_signature public_keys_opt = + Registration.register0_noctxt + ~chunked:false + S.verify_external_message_signature + (fun external_message () -> + handle_verify_external_message_signature + public_keys_opt + external_message) + + let register reveal_data_dir cctxt dac_public_keys_opt dac_sk_uris = + (RPC_directory.empty : unit RPC_directory.t) + |> register_serialize_dac_store_preimage cctxt dac_sk_uris reveal_data_dir + |> register_verify_external_message_signature dac_public_keys_opt +end + +let rpc_services ~reveal_data_dir cctxt dac_public_keys_opt dac_sk_uris + _threshold = + DAC.register reveal_data_dir cctxt dac_public_keys_opt dac_sk_uris diff --git a/src/proto_016_PtMumbai/lib_dal/dac_external_message_manager.ml b/src/proto_016_PtMumbai/lib_dal/dac_external_message_manager.ml new file mode 100644 index 000000000000..2076f79b31a2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dac_external_message_manager.ml @@ -0,0 +1,114 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment.Error_monad + +type error += Could_not_serialize_rollup_external_message of string + +let () = + register_error_kind + `Permanent + ~id:"dac_could_not_serialize_rollup_external_message" + ~title:"Could not serialize rollup external message" + ~description: + "Serialization of rollup external message containing Dac root page hash \ + failed" + ~pp:(fun ppf b58_hash -> + Format.fprintf + ppf + "Serialization of rollup external message containing Dac root page \ + hash %sfailed" + b58_hash) + Data_encoding.(obj1 (req "hash" string)) + (function + | Could_not_serialize_rollup_external_message b58_hash -> Some b58_hash + | _ -> None) + (fun b58_hash -> Could_not_serialize_rollup_external_message b58_hash) + +module type REVEAL_HASH = module type of Sc_rollup_reveal_hash + +module Make + (Hashing_scheme : REVEAL_HASH) (Encoding_metadata : sig + val tag : int + + val title : string + end) = +struct + type dac_message = + | Dac_message of { + root_hash : Hashing_scheme.t; + signature : Tezos_crypto.Aggregate_signature.t; + witnesses : Bitset.t; + } + + let untagged_encoding = + Data_encoding.( + conv + (function + | Dac_message {root_hash; signature; witnesses} -> + (root_hash, signature, witnesses)) + (fun (root_hash, signature, witnesses) -> + Dac_message {root_hash; signature; witnesses}) + (obj3 + (req "root_hash" Hashing_scheme.encoding) + (req "signature" Tezos_crypto.Aggregate_signature.encoding) + (req "witnesses" Bitset.encoding))) + + let dac_message_encoding = + Data_encoding.( + union + ~tag_size:`Uint8 + [ + case + ~title:("dac_message_" ^ Encoding_metadata.title) + (Tag Encoding_metadata.tag) + untagged_encoding + (fun msg -> Some msg) + (fun msg -> msg); + ]) + + let make root_hash signature witnesses = + let message = Dac_message {root_hash; signature; witnesses} in + let res = Data_encoding.Binary.to_bytes dac_message_encoding message in + match res with + | Ok bytes -> Ok bytes + | Error _ -> + error + @@ Could_not_serialize_rollup_external_message + (Hashing_scheme.to_b58check root_hash) + + let of_bytes encoded_message = + Data_encoding.Binary.of_bytes_opt dac_message_encoding encoded_message +end + +module Reveal_hash = + Make + (Sc_rollup_reveal_hash) + (struct + let tag = 42 + + let title = "reveal_hash_v0" + end) diff --git a/src/proto_016_PtMumbai/lib_dal/dac_manager.ml b/src/proto_016_PtMumbai/lib_dal/dac_manager.ml new file mode 100644 index 000000000000..cbf068e1ffdd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dac_manager.ml @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Reveal_hash = struct + module Storage = Dac_preimage_data_manager.Reveal_hash + module Signatures = Dac_signature_manager.Reveal_hash + module External_message = Dac_external_message_manager.Reveal_hash +end diff --git a/src/proto_016_PtMumbai/lib_dal/dac_pages_encoding.ml b/src/proto_016_PtMumbai/lib_dal/dac_pages_encoding.ml new file mode 100644 index 000000000000..710a3f0f5f05 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dac_pages_encoding.ml @@ -0,0 +1,475 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* DAC/FIXME: https://gitlab.com/tezos/tezos/-/issues/4088 + Add .mli file. *) + +(** Library for encoding payloads of arbitrary size in formats that can be + decoded by the Sc-rollup kernels. + *) + +open Protocol +open Environment.Error_monad + +type error += + | Payload_cannot_be_empty + | Cannot_serialize_page_payload + | Cannot_deserialize_page + | Non_positive_size_of_payload + | Merkle_tree_branching_factor_not_high_enough + +type pagination_scheme = Merkle_tree_V0 | Hash_chain_V0 + +let pagination_scheme_encoding = + Data_encoding.string_enum + [("Merkle_tree_V0", Merkle_tree_V0); ("Hash_chain_V0", Hash_chain_V0)] + +let () = + register_error_kind + `Permanent + ~id:"cannot_deserialize_dac_page_payload" + ~title:"DAC payload could not be deserialized" + ~description:"Error when recovering DAC payload payload from binary" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Error when recovering DAC payload from list of data chunks") + Data_encoding.(unit) + (function Cannot_deserialize_page -> Some () | _ -> None) + (fun () -> Cannot_deserialize_page) ; + register_error_kind + `Permanent + ~id:"cannot_serialize_dac_page" + ~title:"DAC page could not be serialized" + ~description:"Error when serializing DAC page" + ~pp:(fun ppf () -> Format.fprintf ppf "Error when serializing DAC page") + Data_encoding.(unit) + (function Cannot_serialize_page_payload -> Some () | _ -> None) + (fun () -> Cannot_serialize_page_payload) ; + register_error_kind + `Permanent + ~id:"non_positive_payload_size" + ~title:"Non positive size for dac payload" + ~description:"Dac page payload (excluded preamble) are non positive" + ~pp:(fun ppf () -> + Format.fprintf ppf "Dac page payload (excluded preamble) are non positive") + Data_encoding.(unit) + (function Non_positive_size_of_payload -> Some () | _ -> None) + (fun () -> Non_positive_size_of_payload) ; + register_error_kind + `Permanent + ~id:"dac_payload_cannot_be_empty" + ~title:"Cannot serialize empty DAC payload" + ~description:"Cannot serialize empty DAC payload" + ~pp:(fun ppf () -> Format.fprintf ppf "Cannot serialize empty DAC payload") + Data_encoding.(unit) + (function Payload_cannot_be_empty -> Some () | _ -> None) + (fun () -> Payload_cannot_be_empty) ; + register_error_kind + `Permanent + ~id:"merkle_tree_branching_factor_not_high_enough" + ~title:"Merkle tree branching factor must be at least 2" + ~description:"Merkle tree branching factor must be at least 2" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Cannot serialize DAC payload: pages must be able to contain at least \ + two hashes") + Data_encoding.(unit) + (function + | Merkle_tree_branching_factor_not_high_enough -> Some () | _ -> None) + (fun () -> Merkle_tree_branching_factor_not_high_enough) + +(** Encoding of DAC payload as a Merkle tree with an arbitrary branching + factor greater or equal to 2. The serialization process works as follows: + {ul + {li A large sequence of bytes, the payload, is split into several pages + of fixed size, each of which is prefixed with a small sequence + of bytes (also of fixed size), which is referred to as the preamble + of the page. Pages obtained directly from the original payload + are referred to as `Contents pages`. Contents pages constitute the + leaves of the Merkle tree being built, + } + {li Each contents page (each of which is a sequence of bytes consisting + of the preamble followed by the actual contents from the original + payload) is then hashed. The size of each hash is fixed. The hashes are + concatenated together, and the resulting sequence of bytes is split + into pages of the same size of `Hashes pages`, each of which is + prefixed with a preamble whose size is the same as in Contents pages. + Hashes pages correspond to nodes of the Merkle tree being built, and + the children of a hash page are the (either Payload or Hashes) pages + whose hash appear into the former, + } + {li Hashes pages are hashed using the same process described above, leading + to a smaller list of hashes pages. To guarantee that the list of hashes + pages is actually smaller than the original list of pages being hashed, + we require the size of pages to be large enough to contain at least two + hashes. + } + } + + Merkle tree encodings of DAC pages are versioned, to allow for multiple + hashing schemes to be used. + *) +module Merkle_tree = struct + type version = int + + (** A page is either a `Contents page`, containing a chunk of the payload + that needs to be serialized, or a `Hashes page`, containing a list + of hashes. The size of contents and hashes pages is not fixed. + *) + type 'a page = Contents of bytes | Hashes of 'a list + + let max_version = 127 + + module type VERSION = sig + val contents_version_tag : version + + val hashes_version_tag : version + end + + (* Even numbers are used for versioning Contents pages, odd numbers are used + for versioning Hashes pages. *) + module Make_version (V : sig + val contents_version : int + + val hashes_version : int + end) = + struct + let contents_version_tag = 2 * V.contents_version + + let hashes_version_tag = (2 * V.hashes_version) + 1 + end + + module Make (Hashing_scheme : sig + include Dac_preimage_data_manager.REVEAL_HASH + + val scheme : supported_hashes + end) + (V : VERSION) = + struct + let hash bytes = Hashing_scheme.hash_bytes [bytes] + + let hash_encoding = Hashing_scheme.encoding + + let hashes_encoding = Data_encoding.list hash_encoding + + let to_b58check = Hashing_scheme.to_b58check + + (* The preamble of a serialized page contains 1 byte denoting the version, + and 4 bytes encoding the size of the rest of the page. In total, 5 + bytes. *) + let page_preamble_size = 5 + + let hash_bytes_size = Hashing_scheme.size ~scheme:Hashing_scheme.scheme + + (** Payload pages are encoded as follows: the first byte is an integer, + which is corresponds to either `payload_version` (for payload pages) or + `hashes_version` (for hashes pages). The next four bytes will contain + the size of the rest of the page; the remainder of the page is either a + list of raw bytes (in the case of a payload page), or a list of hashes, + which occupy 32 bytes each. *) + let page_encoding = + Data_encoding.( + union + ~tag_size:`Uint8 + [ + case + ~title:"contents" + (Tag V.contents_version_tag) + bytes + (function Contents payload -> Some payload | _ -> None) + (fun payload -> Contents payload); + case + ~title:"hashes" + (Tag V.hashes_version_tag) + hashes_encoding + (function Hashes hashes -> Some hashes | _ -> None) + (fun hashes -> Hashes hashes); + ]) + + (** Serialization function for a single page. It converts a page to a + sequence of bytes using [page_encoding]. It also checks that the + serialized page does not exceed [page_size] bytes. *) + let serialize_page ~max_page_size page = + match + Data_encoding.Binary.to_bytes + (Data_encoding.check_size max_page_size page_encoding) + page + with + | Ok raw_page -> Ok raw_page + | Error _ -> error Cannot_serialize_page_payload + + let split_hashes ~max_page_size hashes = + (* 1 byte for the version size, 4 bytes for the length of the list. *) + let number_of_hashes = + (max_page_size - page_preamble_size) / hash_bytes_size + in + (* Requiring a branching factor of at least 2 is necessary to ensure that + the serialization process terminates. If only one hash were stored per page, then + the number of pages at height `n-1` could be potentially equal to the number of + pages at height `n`. *) + if number_of_hashes < 2 then + error Merkle_tree_branching_factor_not_high_enough + else + let rec go aux list = + match list with + | [] -> List.rev aux + | list -> + let chunk, rest = List.split_n number_of_hashes list in + (go [@tailcall]) (chunk :: aux) rest + in + Ok (go [] hashes) + + let split_contents ~max_page_size page = + let open Result_syntax in + (* 1 byte for the version size, 4 bytes for the size of the payload. *) + let actual_page_size = max_page_size - page_preamble_size in + if actual_page_size <= 0 then error Non_positive_size_of_payload + else + let+ pages = String.chunk_bytes actual_page_size page in + List.map String.to_bytes pages + + (* Splits a page into smaller pages whose serialization does + not exceed [page_size] bytes. *) + let split_page ~max_page_size page = + let open Result_syntax in + match page with + | Contents contents -> + let+ pages = split_contents ~max_page_size contents in + List.map (fun page_contents -> Contents page_contents) pages + | Hashes hashes -> + let+ pages = split_hashes ~max_page_size hashes in + List.map (fun page_hashes -> Hashes page_hashes) pages + + (* DAC/FIXME: https://gitlab.com/tezos/tezos/-/issues/4014 + Improve performance of the functions below. Currently we load in memory + the whole payload to be split in pages. This is not ideal if the size + of the payload is large. *) + + (** Main function for computing the pages of a Merkle tree from a sequence + of bytes. Each page is processed using the function [for_each_page] + provided in input, which is responsible for ensuring that the original + payload can be reconstructed from the Merkle tree root; this can be + achieved, for example, by letting [for_each_page] persist a serialized + page to disk using the page hash as its filename. + The function [serialize_payload] returns the root hash of the Merkle + tree constructed. *) + let serialize_payload ~max_page_size payload ~for_each_page = + let open Lwt_result_syntax in + let* () = + fail_unless (Bytes.length payload > 0) Payload_cannot_be_empty + in + let rec go payload = + let*? pages = split_page ~max_page_size payload in + let*? serialized_pages = + List.map_e (serialize_page ~max_page_size) pages + in + (* Hashes are computed from raw pages, each of which consists of a + preamble of 5 bytes followed by a page payload - a raw sequence + of bytes from the original payload for Contents pages, and a + a sequence of serialized hashes for hashes pages. The preamble + bytes is part of the sequence of bytes which is hashed. + + Hashes are stored in reverse order in memory for performance + reasons. They are reversed again before the recursive tailcall + is performed.*) + let hashes_with_serialized_pages = + List.rev_map + (fun page -> (hash ~scheme:Hashing_scheme.scheme page, page)) + serialized_pages + in + + let* () = + List.iter_es + (fun (hash, page) -> for_each_page (hash, page)) + hashes_with_serialized_pages + in + + match hashes_with_serialized_pages with + | [(hash, _page)] -> return hash + | hashes_with_raw_pages -> + let hashes = + (* Hashes_with_raw_pages stores the hash of pages in reverse + order. We use `List.rev_map` to recover the original order + of hashes. *) + List.rev_map (fun (hash, _page) -> hash) hashes_with_raw_pages + in + (go [@tailcall]) (Hashes hashes) + in + go (Contents payload) + + (** Deserialization function for a single page. A sequence of bytes is + converted to a page using [page_encoding]. *) + let deserialize_page raw_page = + match Data_encoding.Binary.of_bytes page_encoding raw_page with + | Ok page -> Ok page + | Error _ -> error Cannot_deserialize_page + + (** Deserialization function for reconstructing the original payload from + its Merkle tree root hash. The function [retrieve_page_from_hash] + passed in input is responsible for determining how to retrieve the + serialized page from its hash. For example, if the page has been + persisted to disk using the page hash as its filename, + [retrieve_page_from_hash] simply loads the corresponding file from + disk to memory. The function [deserialize_payload] returns the + original payload that was used to compute the Merkle tree root hash. + This function is guaranteed to terminate if the directed graph induced + by the retrieved pages (that is, the graph where there is an edge + from one page to another if and only if the former contains the hash + of the latter) is acyclic. This property is guaranteed if the root + hash and pages are computed using the serialized_payload function + outlined above, but it is not guaranteed in more general cases. + *) + let deserialize_payload root_hash ~retrieve_page_from_hash = + let rec go retrieved_hashes retrieved_contents = + let open Lwt_result_syntax in + match retrieved_hashes with + | [] -> return @@ Bytes.concat Bytes.empty retrieved_contents + | hash :: hashes -> ( + let* serialized_page = retrieve_page_from_hash hash in + let*? page = deserialize_page serialized_page in + match page with + | Hashes page_hashes -> + (* Hashes are saved in reverse order. *) + (go [@tailcall]) + (List.rev_append page_hashes hashes) + retrieved_contents + | Contents contents -> + (* Because hashes are saved in reversed order, content pages + will be retrieved in reverse order. By always appending a + conetent page to the list of retrieved content pages, + we ensure that pages are saved in `retrieved_contents` in + their original order. *) + (go [@tailcall]) hashes (contents :: retrieved_contents)) + in + go [root_hash] [] + end + + module V0 = + Make + (struct + include Sc_rollup_reveal_hash + + let scheme = Sc_rollup_reveal_hash.Blake2B + end) + (Make_version (struct + (* Cntents_version_tag used in contents pages is 0. *) + let contents_version = 0 + + (* Hashes_version_tag used in hashes pages is 1. *) + let hashes_version = 0 + end)) +end + +module Hash_chain = struct + module type PAGE_FMT = sig + type h + + type page = {succ_hash : h; content : string} + + val content_limit : int + + val serialize_hash : h -> string + + (** Serializes a single page (an element in the hash link). *) + val serialize_page : page -> string + end + + module Make (Hashing_scheme : sig + include Dac_preimage_data_manager.REVEAL_HASH + + val scheme : supported_hashes + end) + (P : PAGE_FMT with type h = Hashing_scheme.t) = + struct + let hash bytes = + Hashing_scheme.hash_bytes ~scheme:Hashing_scheme.scheme [bytes] + + let to_b58check = Hashing_scheme.to_b58check + + let link_chunks chunks : (Hashing_scheme.t * bytes) list = + let rec link_chunks_rev linked_pages rev_pages = + match rev_pages with + | [] -> linked_pages + | chunk :: rev_chunks -> + let page = + match linked_pages with + | [] -> chunk + | (succ_hash, _) :: _ -> + P.serialize_page {succ_hash; content = chunk} + in + let page = Bytes.of_string page in + let hash = hash page in + (link_chunks_rev [@tailcall]) + ((hash, page) :: linked_pages) + rev_chunks + in + let rev_chunks = List.rev chunks in + link_chunks_rev [] rev_chunks + + let make_hash_chain data = + let open Result_syntax in + let+ chunks = String.chunk_bytes P.content_limit data in + link_chunks chunks + + (** Main function for computing a hash chain from a byte sequence. Returns the + chain head hash.[for_each_page] may be supplied to run post processing + tasks on each page, for example, to persisit a serialized page to disk. + *) + let serialize_payload ~for_each_page payload = + let open Lwt_result_syntax in + let* () = + fail_unless (Bytes.length payload > 0) Payload_cannot_be_empty + in + let*? hash_chain = make_hash_chain payload in + let+ () = List.iter_es for_each_page hash_chain in + Stdlib.List.hd hash_chain |> fst + end + + module V0 = + Make + (struct + include Sc_rollup_reveal_hash + + let scheme = Sc_rollup_reveal_hash.Blake2B + end) + (struct + type h = Sc_rollup_reveal_hash.t + + type page = {succ_hash : h; content : string} + + let content_limit = + (4 * 1024) - 100 (* We reserve 100 bytes for the continuation hash. *) + + let serialize_hash = Sc_rollup_reveal_hash.to_b58check + + let serialize_page page = + Format.asprintf + "%s hash:%s" + page.content + (serialize_hash page.succ_hash) + end) +end diff --git a/src/proto_016_PtMumbai/lib_dal/dac_preimage_data_manager.ml b/src/proto_016_PtMumbai/lib_dal/dac_preimage_data_manager.ml new file mode 100644 index 000000000000..1cd86db1b405 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dac_preimage_data_manager.ml @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment.Error_monad + +type error += Cannot_write_dac_page_to_disk of string + +let () = + register_error_kind + `Permanent + ~id:"cannot_write_dac_page_to_disk" + ~title:"Cannot write Dac page to disk" + ~description:"Cannot write Dac page to disk" + ~pp:(fun ppf b58_hash -> + Format.fprintf ppf "Could not write dac page for hash %s" b58_hash) + Data_encoding.(obj1 (req "hash" string)) + (function + | Cannot_write_dac_page_to_disk b58_hash -> Some b58_hash | _ -> None) + (fun b58_hash -> Cannot_write_dac_page_to_disk b58_hash) + +module type REVEAL_HASH = module type of Sc_rollup_reveal_hash + +module Make (Hash : REVEAL_HASH) = struct + let path data_dir hash = Filename.(concat data_dir @@ Hash.to_b58check hash) + + let save_bytes data_dir hash page_contents = + let open Lwt_result_syntax in + let path = path data_dir hash in + let*! result = + Lwt_utils_unix.with_atomic_open_out path @@ fun chan -> + Lwt_utils_unix.write_bytes chan page_contents + in + match result with + | Ok () -> return () + | Error _ -> tzfail @@ Cannot_write_dac_page_to_disk (Hash.to_b58check hash) +end + +module Reveal_hash = Make (Sc_rollup_reveal_hash) diff --git a/src/proto_016_PtMumbai/lib_dal/dac_signature_manager.ml b/src/proto_016_PtMumbai/lib_dal/dac_signature_manager.ml new file mode 100644 index 000000000000..394a7b786463 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dac_signature_manager.ml @@ -0,0 +1,180 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment +open Error_monad + +type error += + | Cannot_convert_root_page_hash_to_bytes of string + | Cannot_compute_aggregate_signature of string + | Public_key_for_witness_not_available of int * string + +let () = + register_error_kind + `Permanent + ~id:"cannot_extract_root_page_hash_to_sign" + ~title:"Cannot convert root hash page to byte sequence" + ~description:"Cannot convert root hash page to byte sequence" + ~pp:(fun ppf b58_hash -> + Format.fprintf + ppf + "Cannot convert root hash page to byte sequence: %s" + b58_hash) + Data_encoding.(obj1 (req "hash" (string Plain))) + (function + | Cannot_convert_root_page_hash_to_bytes b58_hash -> Some b58_hash + | _ -> None) + (fun b58_hash -> Cannot_convert_root_page_hash_to_bytes b58_hash) ; + register_error_kind + `Permanent + ~id:"cannot_compute_root_hash_aggregate_signature" + ~title:"Cannot compute aggregate signature of root page hash" + ~description:"Cannot compute aggregate signature of root page hash" + ~pp:(fun ppf b58_hash -> + Format.fprintf + ppf + "Cannot compute aggregate signature of root page hash: %s" + b58_hash) + Data_encoding.(obj1 (req "hash" (string Plain))) + (function + | Cannot_compute_aggregate_signature b58_hash -> Some b58_hash | _ -> None) + (fun b58_hash -> Cannot_compute_aggregate_signature b58_hash) ; + register_error_kind + `Permanent + ~id:"public_key_of_witness_not_available" + ~title: + "Public key of witness dac member not available for verifying signature" + ~description: + "Public key of witness dac member not available for verifying signature" + ~pp:(fun ppf (witness_index, b58_hash) -> + Format.fprintf + ppf + "Public key of dac member %d not available for verifying signature of \ + root page hash %s" + witness_index + b58_hash) + Data_encoding.(obj2 (req "witness_index" int31) (req "hash" (string Plain))) + (function + | Public_key_for_witness_not_available (index, hash) -> Some (index, hash) + | _ -> None) + (fun (index, hash) -> Public_key_for_witness_not_available (index, hash)) + +module type REVEAL_HASH = module type of Sc_rollup_reveal_hash + +module Make (Hashing_scheme : REVEAL_HASH) = struct + let bind_es (f : 'a -> 'b option tzresult Lwt.t) v_opt = + let open Lwt_result_syntax in + match v_opt with None -> return None | Some v -> f v + + let rev_collect_indexed_signatures cctxt dac_sk_uris bytes_to_sign = + let open Lwt_result_syntax in + List.rev_mapi_es + (fun index sk_uri_opt -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4306 + Implement Option.bind_es and revisit this. *) + bind_es + (fun sk_uri -> + let*! signature_res = + Tezos_client_base.Client_keys.aggregate_sign + cctxt + sk_uri + bytes_to_sign + in + let signature_opt = Result.to_option signature_res in + return + @@ Option.map (fun signature -> (index, signature)) signature_opt) + sk_uri_opt) + dac_sk_uris + + let compute_signatures_with_witnesses rev_indexed_signatures = + let open Lwt_result_syntax in + List.fold_left_es + (fun (signatures, witnesses) signature_opt -> + match signature_opt with + | None -> return (signatures, witnesses) + | Some (index, signature) -> + let*? bitmap = Bitset.add witnesses index in + return (signature :: signatures, bitmap)) + ([], Bitset.empty) + rev_indexed_signatures + + let sign_root_hash cctxt dac_sk_uris root_hash = + let open Lwt_result_syntax in + let bytes_to_sign = + Data_encoding.Binary.to_bytes_opt Hashing_scheme.encoding root_hash + in + let b58_root_hash = Hashing_scheme.to_b58check root_hash in + match bytes_to_sign with + | None -> tzfail @@ Cannot_convert_root_page_hash_to_bytes b58_root_hash + | Some bytes_to_sign -> ( + let* rev_indexed_signatures = + rev_collect_indexed_signatures cctxt dac_sk_uris bytes_to_sign + in + let* signatures, witnesses = + compute_signatures_with_witnesses rev_indexed_signatures + in + let final_signature = + Tezos_crypto.Aggregate_signature.aggregate_signature_opt signatures + in + match final_signature with + | None -> tzfail @@ Cannot_compute_aggregate_signature b58_root_hash + | Some signature -> return @@ (signature, witnesses)) + + let verify ~public_keys_opt root_page_hash signature witnesses = + let open Lwt_result_syntax in + let hash_as_bytes = + Data_encoding.Binary.to_bytes_opt Hashing_scheme.encoding root_page_hash + in + match hash_as_bytes with + | None -> + tzfail + @@ Cannot_convert_root_page_hash_to_bytes + (Hashing_scheme.to_b58check root_page_hash) + | Some bytes -> + let* pk_msg_list = + public_keys_opt + |> List.mapi (fun i public_key_opt -> (i, public_key_opt)) + |> List.filter_map_es (fun (i, public_key_opt) -> + let*? is_witness = Bitset.mem witnesses i in + + match public_key_opt with + | None -> + if is_witness then + tzfail + @@ Public_key_for_witness_not_available + (i, Hashing_scheme.to_b58check root_page_hash) + else return None + | Some public_key -> + if is_witness then return @@ Some (public_key, None, bytes) + else return None) + in + return + @@ Tezos_crypto.Aggregate_signature.aggregate_check + pk_msg_list + signature +end + +module Reveal_hash = Make (Sc_rollup_reveal_hash) diff --git a/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml new file mode 100644 index 000000000000..7c3a450b8c9f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Plugin = struct + module Proto = Registerer.Registered + + let get_constants chain block ctxt = + let cpctxt = new Protocol_client_context.wrap_full ctxt in + let open Lwt_result_syntax in + let* constants = Protocol.Constants_services.all cpctxt (chain, block) in + return constants.parametric.dal.cryptobox_parameters + + (* Turn the given value of type {!Protocol.Apply_operation_result.operation_result} + into a value of type {!Dal_plugin.operation_application_result}. *) + let status_of_result = function + | Protocol.Apply_operation_result.Applied _ -> Dal_plugin.Succeeded + | _ -> Dal_plugin.Failed + + let get_published_slot_headers block ctxt = + let open Lwt_result_syntax in + let open Protocol.Alpha_context in + let cpctxt = new Protocol_client_context.wrap_full ctxt in + let* block = + Protocol_client_context.Alpha_block_services.info + cpctxt + ~block + ~metadata:`Always + () + in + let apply_internal acc ~source:_ _op _res = acc in + let apply (type kind) acc ~source:_ (op : kind manager_operation) + (result : (kind, _, _) Protocol.Apply_operation_result.operation_result) + = + match op with + | Dal_publish_slot_header slot_header -> + (slot_header.header, status_of_result result) :: acc + | _ -> acc + in + Layer1_services.( + process_manager_operations [] block.operations {apply; apply_internal}) + |> List.map_es (fun (slot, status) -> + return + Dal_plugin. + ( { + published_level = + Raw_level.to_int32 slot.Dal.Slot.Header.id.published_level; + slot_index = + Dal.Slot_index.to_int slot.Dal.Slot.Header.id.index; + commitment = slot.Dal.Slot.Header.commitment; + }, + status )) + + module RPC = RPC +end + +let () = Dal_plugin.register (module Plugin) diff --git a/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.ml b/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.ml new file mode 100644 index 000000000000..f89360351623 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.ml @@ -0,0 +1,257 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +type error += + | Slot_size_is_too_big of {actual_size : int; max_size : int} + | Wrong_slot_frame_version of {expected : int; provided : int} + | Could_not_deserialize_slot + +let () = + register_error_kind + `Permanent + ~id:"slot_size_is_too_big" + ~title:"Slot size is too big" + ~description:"Slot cannot fit in maximum size" + ~pp:(fun ppf (actual_size, max_size) -> + Format.fprintf + ppf + "Actual size: %d, Maximum size: %d" + actual_size + max_size) + Data_encoding.(obj2 (req "actual_size" int31) (req "maximum_size" int31)) + (function + | Slot_size_is_too_big {actual_size; max_size} -> + Some (actual_size, max_size) + | _ -> None) + (fun (actual_size, max_size) -> + Slot_size_is_too_big {actual_size; max_size}) ; + register_error_kind + `Permanent + ~id:"wrong_slot_frame_version" + ~title:"Wrong slot frame version" + ~description:"Wrong slot frame version" + ~pp:(fun ppf (expected, provided) -> + Format.fprintf + ppf + "Version expected: %d, Version provided: %d" + expected + provided) + Data_encoding.( + obj2 (req "version_expected" uint8) (req "version_provided" uint8)) + (function + | Wrong_slot_frame_version {expected; provided} -> + Some (expected, provided) + | _ -> None) + (fun (expected, provided) -> Wrong_slot_frame_version {expected; provided}) ; + register_error_kind + `Permanent + ~id:"could_not_deserialize_slot" + ~title:"Slot could not be deserialized" + ~description:"Error when recovering slot contents from binary" + ~pp:(fun ppf () -> + Format.fprintf ppf "Error when recovering slot contents from binary") + Data_encoding.(unit) + (function Could_not_deserialize_slot -> Some () | _ -> None) + (fun () -> Could_not_deserialize_slot) + +type version = int + +type message = string + +module Rollups_map = Map.Make (Sc_rollup.Address) + +type t = message list Rollups_map.t + +module type Slot_version = sig + val version_prefix : version + + val expected_slot_size : t -> int + + val serialize : max_size:int -> t -> string tzresult Lwt.t + + val deserialize : max_size:int -> string -> t tzresult Lwt.t +end + +let version_encoding = Data_encoding.uint8 + +module V0 = struct + let version_prefix = 0 + + (* Binary representation of string uses 4 bytes as a header, + containing the string length. This conforms to the specification + given for messages. *) + let message_encoding = Data_encoding.string + + (* Binary representation of lists uses 4 bytes as a header, containing + the length of the list in bytes. This conforms to the + specification given for messages frames. *) + let messages_frame_encoding = Data_encoding.(list message_encoding) + + (* Binary representation of lists uses 4 bytes as a header, containing + the size of the encoded list contents in bytes. + `all_messages_frame_encoding` encodes not only the encoded messages + frames, but also the 4 bytes containing the length of all messages + frames that separate the rollups frame from the messages frame. + *) + let all_messages_frames_encoding = + Data_encoding.(list messages_frame_encoding) + + (* Binary representation of a [Sc_rollup.Address.t] uses 20 bytes, + while the encoding of a [int32] uses 4 bytes. These are + concatenated together by `rollup_offset_entry_encoding`. *) + let rollup_offset_entry_encoding = + Data_encoding.(tup2 Sc_rollup.Address.encoding int32) + + (* Binary representation of lists uses 4 bytes as a header, containing + the size of the encoded list contents in bytes. + the size in bytes of the rollups frame. containing + the length of the list in bytes. Thus the rollups_frame_encoding + conforms to the specification given*) + let rollups_frame_encoding = Data_encoding.(list rollup_offset_entry_encoding) + + let slot_encoding ~max_size = + Data_encoding.( + check_size max_size + @@ tup3 + version_encoding + rollups_frame_encoding + all_messages_frames_encoding) + + module Internal = struct + let size_of_opt size = match size with None -> assert false | Some n -> n + + let message_size = Data_encoding.Binary.length message_encoding + + let messages_frame_size = + Data_encoding.Binary.length messages_frame_encoding + + let all_messages_frames_size = + Data_encoding.Binary.length all_messages_frames_encoding + + let frame_prefix_size = + size_of_opt Data_encoding.(Binary.fixed_length int32) + + let frame_version_size = + size_of_opt Data_encoding.(Binary.fixed_length uint8) + + let rollup_entry_size = + size_of_opt + @@ Data_encoding.Binary.fixed_length rollup_offset_entry_encoding + + let rollups_frame_size number_of_rollups = + (rollup_entry_size * number_of_rollups) + frame_prefix_size + end + + let expected_slot_size all_rollups_messages = + let bindings = Rollups_map.bindings all_rollups_messages in + let number_of_rollups = bindings |> List.length in + let messages = List.map snd bindings in + Internal.( + frame_version_size + + rollups_frame_size number_of_rollups + + all_messages_frames_size messages) + + let serialize ~max_size all_rollups_messages = + let open Lwt_result_syntax in + let first_messages_frame_offset = + Internal.( + frame_version_size + + rollups_frame_size + (Rollups_map.bindings all_rollups_messages |> List.length) + + frame_prefix_size) + in + let rev_rollups_frame, rev_messages_frames, expected_slot_size = + Rollups_map.fold + (fun rollup messages (rollups_frame, messages_frames, next_offset) -> + let rollups_frame = + (rollup, Int32.of_int next_offset) :: rollups_frame + in + let messages_frames = messages :: messages_frames in + let next_offset = + next_offset + Internal.messages_frame_size messages + in + (rollups_frame, messages_frames, next_offset)) + all_rollups_messages + ([], [], first_messages_frame_offset) + in + let* () = + fail_unless + (expected_slot_size <= max_size) + (Slot_size_is_too_big {actual_size = expected_slot_size; max_size}) + in + let rollups_frame = List.rev rev_rollups_frame in + let messages_frames = List.rev rev_messages_frames in + let*? result = + Data_encoding.Binary.to_string + (slot_encoding ~max_size) + (version_prefix, rollups_frame, messages_frames) + |> Result.map_error (fun _ -> assert false) + in + return result + + (* Deserialization of slot contents will be done by WASM PVM kernels, as + per #3374. However, we should still provide a function to + deserialize the contents of a slot, as other components other than the + PVM kernel may need to inspect it. *) + let deserialize ~max_size serialized = + let open Lwt_result_syntax in + let actual_size = String.length serialized in + let* () = + fail_unless + (actual_size <= max_size) + (Slot_size_is_too_big {actual_size; max_size}) + in + let version_prefix, rollups_frame, messages_frames = + Data_encoding.Binary.of_string_exn (slot_encoding ~max_size) serialized + in + let* () = + fail_when + (version_prefix <> 0) + (Wrong_slot_frame_version {expected = 0; provided = version_prefix}) + in + let* () = + fail_when + (List.compare_length_with messages_frames @@ List.length rollups_frame + <> 0) + Could_not_deserialize_slot + in + let*? deserialized = + List.map2 + ~when_different_lengths:[] + (fun (rollup, _offset) messages -> (rollup, messages)) + rollups_frame + messages_frames + |> Result.map_error (fun _ -> [Could_not_deserialize_slot]) + |> Result.map (fun rollups_with_messages -> + Rollups_map.add_seq + (List.to_seq rollups_with_messages) + Rollups_map.empty) + in + return deserialized +end diff --git a/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.mli b/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.mli new file mode 100644 index 000000000000..2b6134c2b089 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dal_slot_frame_encoding.mli @@ -0,0 +1,182 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Library for encoding messages from distinct rollups into a slot. This + library contains encoding and decoding functions for different versions of + the slot-frame encoding. Currently, only one version, V0, exists. As the + structure of slot-frame progresses, new versions will be added. *) + +open Protocol +open Alpha_context + +type error += + | Slot_size_is_too_big of {actual_size : int; max_size : int} + | Wrong_slot_frame_version of {expected : int; provided : int} + | Could_not_deserialize_slot + +type version = int + +module Rollups_map : Map.S with type key = Sc_rollup.Address.t + +type message = string + +(* The type that will be used to serialize and deserialize a slot into a + slot-frame. It consists of a map from rollup addresses to list of + messages. *) +type t = message list Rollups_map.t + +(* Common interface for all slot versions. *) +module type Slot_version = sig + (* [version_prefix] denotes the version of the slot-frame encoding. + It must be a value between 0 and 255, and two different slot-frame + econdings cannot have the same version prefix. *) + val version_prefix : version + + (* [expected_slot_size rollups_messages] returns the value of the + size (in bytes) of a slot-frame that includes all the messages + in [rollups_messages]. It must satisfy the following property: + `expected_slot_size rollups_messages = + String.length @@ serialize rollups_messages`. + *) + val expected_slot_size : t -> int + + (* [serialize ~max_size rollups_messages] returns the encoding + of [rollups_messages] as a string, provided that the result + does not occupy more then [~max_size] byted. + When it succeeds, it must satisfy the following property: + `deserialize ~max_size @@ serialize ~max_size rollups_messages = + rollups_messages` + + May fail with: + {ul + {li [Slot_size_is_too_big {actual_size; max_size}] if the encoding of the + slot would take [actual_size] bytes, where `actual_size > max_size`} + } + *) + val serialize : max_size:int -> t -> string tzresult Lwt.t + + (* [deserialize ~max_size slot_frame] returns the rollup-address indexed map + of messages whose encoding corresponds to [slot_frame], as long as the + [slot_frame] does not occupy more then [~max_size] bytes, and [slot_frame] + contains the correct version_prefix, i.e. the first byte [slot_frame] + is set to `\000`. When it succeeds, it must satisfy the following property: + `serialize ~max_size @@ deserialize ~max_size slot_frame = + slot_frame` + + May fail with: + {ul + {li [Slot_size_is_too_big {actual_size; max_size}] if + [String.length slot_frame = actual_size], where + `actual_size > max_size`. + } + {li [Wrong_slot_frame_version of {expected; provided = 0}] if the first + byte of [slot_frame] is set to the binary encoding of [expected]. + } + {li [Could_not_deserialize_slot] if [slot_frame] does not correspond to + the serialization of a valid rollup-address indexed map of messages. + } + } + *) + val deserialize : max_size:int -> string -> t tzresult Lwt.t +end + +(*'V0' version of the slot-frame encoding. + Suppose that we want to include messages from rollups `r_1, ..., r_n`. + Specifically, for `i=1, ..., n`, suppose that rollup `r_i` wants to include + an arbitrary number j of messages `[m_{i,1}; ... m_{i, j} ]` into the slot. + The number of messages j to be included in a slot may be different for each + rollup. The encoded slot will consist of a string where: + {ul + {li The first byte contains the slot-frame version, currently set to `0x00`,} + {li The next `n * 24 + 4` bytes contain the `rollups-frame`, which contains + the information about where the messages for the rollups + `r_1, .., r_n` are stored. Specifically, the first 4 bytes denote the + length (in bytes) of the remaining part of the rollups-frame, which is + `n * 24`. This is followed by `n` entries of `24` bytes each. For each + entry, the first `20` bytes contain the encoded address of the rollup + node, while the other `4` contain the offset - from the start of the + slot - to the start of the rollup's messages-frame (described next). + } + {li The `4` bytes following the rollups frame contain the length of the + rest of the encoded slot, } + {li Next, there are n messages-frames, one for each rollup. For + `i = 1, ..., n`, the size of the i-th messages-frame is + `4 * n_i + (\sum_{j=1}^{n_i} |m_{i, j}|) + 4` bytes. The first four + bytes denote the length of the messages-frame. Then we have the + sequence of the encoded messages `m_{i,1}, ..., m_{i, j}`. The encoded + message `m_{i,j}` consists of 4 bytes representing `|m_{i,j}|`, + followed by `m_{i,j}` itself. + } + } + + As an example, suppose that we have two rollups `r1` and `r2`. For + simplicity, let's assume that the binary represenation of `r1` and `r2` are + `ROLLUP_ADDRESS_1XXXX` and `ROLLUP_ADDRESS_2YYYY`. Suppose that we want to + include in the slot messages [["hello"; "world"]] from `r1`, and messages + [["CAFEBABE"; "CAFEDEAD"]] from `r2` (in this order). The overall encoded + frame will be + "\000 + \000\000\000\048 + ROLLUP_ADDRESS_1XXXX\000\000\000\057 + ROLLUP_ADDRESS_2YYYY\000\000\000\079 + \000\000\000\050 + \000\000\000\018\000\000\000\005hello\000\000\000\005world + \000\000\000\024\000\000\000\008CAFEBABE\000\000\000\008CAFEDEAD". +*) +module V0 : sig + include Slot_version + + (* Functions used internally by the V0 version of the slot. These functions + are exposed so that they can be used in tests. This is necessary as we + will have implementations of the deserialization for the slot functions in + different programming languages. Checking the values returned by these + functions in tests will serve as documentation for developers wanting to + implement their own version of the V0 slot-frame deserialization. *) + module Internal : sig + (* [messages_size message] returns the size in bytes that [message] + would take in a slot-frame. *) + val message_size : message -> int + + (* [messages_frame_size messages] returns the size in bytes that the + encoding of messages as a messages frame would take in a slot-frame. *) + val messages_frame_size : message list -> int + + (* [all_messages_frame all_messages] returns the size in bytes + that the encoding of [all_messages] would take in a slot-frame. + This value includes the 4 bytes that separate the rollups-frame + from the rest of the slot frame in the encoding. *) + val all_messages_frames_size : message list list -> int + + (* [rollup_entry_size] returns the size in bytes + that one rollup would take in the rollups-frame. + *) + val rollup_entry_size : int + + (* [rollups_frame_size number_of_rollups] returns the size + in bytes that the rollups-frame would take in a slot-frame, + if the latter contains messages for [number_of_rollups] rollups. *) + val rollups_frame_size : int -> int + end +end diff --git a/src/proto_016_PtMumbai/lib_dal/dune b/src/proto_016_PtMumbai/lib_dal/dune new file mode 100644 index 000000000000..9f21d8ff282e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/dune @@ -0,0 +1,30 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_dal_alpha) + (public_name tezos-dal-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + octez-protocol-compiler.registerer + tezos-stdlib-unix + tezos_dal_node_lib + tezos-client-alpha + tezos-embedded-protocol-alpha + tezos-layer2-utils-alpha + tezos-protocol-alpha) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_registerer + -open Tezos_stdlib_unix + -open Tezos_dal_node_lib + -open Tezos_client_alpha + -open Tezos_embedded_protocol_alpha + -open Tezos_layer2_utils_alpha + -open Tezos_protocol_alpha)) diff --git a/src/proto_016_PtMumbai/lib_dal/test/dune b/src/proto_016_PtMumbai/lib_dal/test/dune new file mode 100644 index 000000000000..e5272d58827c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/test/dune @@ -0,0 +1,25 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + tezos-base + tezos-dal-alpha + tezos-protocol-alpha + tezos-base-test-helpers + tezos-alpha-test-helpers + alcotest-lwt) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_dal_alpha + -open Tezos_protocol_alpha + -open Tezos_base_test_helpers + -open Tezos_alpha_test_helpers)) + +(rule + (alias runtest) + (package tezos-dal-alpha) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_dal/test/main.ml b/src/proto_016_PtMumbai/lib_dal/test/main.ml new file mode 100644 index 000000000000..e79b23050e17 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/test/main.ml @@ -0,0 +1,56 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Unit_test : sig + (** + * Example: [spec "Slot_framing_protocol.ml" Test_dal_slot_frame_encoding.test_cases] + * Unit tests needs tag in log (like "[UNIT] some test description here...") + * This function handles such meta data *) + val spec : + string -> + unit Alcotest_lwt.test_case list -> + string * unit Alcotest_lwt.test_case list + + (** Tests with description string without [Unit] are skipped *) + val _skip : + string -> + unit Alcotest_lwt.test_case list -> + string * unit Alcotest_lwt.test_case list +end = struct + let spec unit_name test_cases = ("[Unit] " ^ unit_name, test_cases) + + let _skip unit_name test_cases = ("[SKIPPED] " ^ unit_name, test_cases) +end + +let () = + Alcotest_lwt.run + "protocol > unit" + [ + Unit_test.spec + "Slot_framing_protocol.ml" + Test_dal_slot_frame_encoding.tests; + Unit_test.spec "Dac_pages_encoding.ml" Test_dac_pages_encoding.tests; + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_dal/test/test_dac_pages_encoding.ml b/src/proto_016_PtMumbai/lib_dal/test/test_dac_pages_encoding.ml new file mode 100644 index 000000000000..0b82b4c87ffa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/test/test_dac_pages_encoding.ml @@ -0,0 +1,623 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Dal_node Slot_frame_encoding + Invocation: dune exec src/proto_alpha/lib_dal/test/main.exe \ + -- test "^\[Unit\] Dac_pages_encoding.ml$" + Subject: Tests for the SCORU storage module +*) + +(** DAC/FIXME: https://gitlab.com/tezos/tezos/-/issues/4021 + Add tests to check actual (sequences of) bytes in serialized pages. *) + +open Protocol + +let lift f = Lwt.map Environment.wrap_tzresult f + +(* Tests are run against a mock storage backend where a Hash-indexed/Bytes-valued Map + is used to simulate adding and retrieving files to a directory. +*) +module Hashes_map = Sc_rollup_reveal_hash.Map + +type hashes_map = bytes Hashes_map.t + +let long_payload = + (* Inferno, Canto I (Dante Alighieri). Size in bytes: 5226. *) + {|Nel mezzo del cammin di nostra vita +mi ritrovai per una selva oscura +ché la diritta via era smarrita. +Ahi quanto a dir qual era è cosa dura +esta selva selvaggia e aspra e forte +che nel pensier rinova la paura! +Tant’è amara che poco è più morte; +ma per trattar del ben ch’i’ vi trovai, +dirò de l’altre cose ch’i’ v’ho scorte. +Io non so ben ridir com’i’ v’intrai, +tant’era pien di sonno a quel punto +che la verace via abbandonai. +Ma poi ch’i’ fui al piè d’un colle giunto, +là dove terminava quella valle +che m’avea di paura il cor compunto, +guardai in alto, e vidi le sue spalle +vestite già de’ raggi del pianeta +che mena dritto altrui per ogne calle. +Allor fu la paura un poco queta +che nel lago del cor m’era durata +la notte ch’i’ passai con tanta pieta. +E come quei che con lena affannata +uscito fuor del pelago a la riva +si volge a l’acqua perigliosa e guata, +così l’animo mio, ch’ancor fuggiva, +si volse a retro a rimirar lo passo +che non lasciò già mai persona viva. +Poi ch’èi posato un poco il corpo lasso, +ripresi via per la piaggia diserta, +sì che ’l piè fermo sempre era ’l più basso. +Ed ecco, quasi al cominciar de l’erta, +una lonza leggera e presta molto, +che di pel macolato era coverta; +e non mi si partia dinanzi al volto, +anzi ’mpediva tanto il mio cammino, +ch’i’ fui per ritornar più volte vòlto. +Temp’era dal principio del mattino, +e ’l sol montava ’n sù con quelle stelle +ch’eran con lui quando l’amor divino +mosse di prima quelle cose belle; +sì ch’a bene sperar m’era cagione +di quella fiera a la gaetta pelle +l’ora del tempo e la dolce stagione; +ma non sì che paura non mi desse +la vista che m’apparve d’un leone. +Questi parea che contra me venisse +con la test’alta e con rabbiosa fame, +sì che parea che l’aere ne tremesse. +Ed una lupa, che di tutte brame +sembiava carca ne la sua magrezza, +e molte genti fé già viver grame, +questa mi porse tanto di gravezza +con la paura ch’uscia di sua vista, +ch’io perdei la speranza de l’altezza. +E qual è quei che volontieri acquista, +e giugne ’l tempo che perder lo face, +che ’n tutt’i suoi pensier piange e s’attrista; +tal mi fece la bestia sanza pace, +che, venendomi ’ncontro, a poco a poco +mi ripigneva là dove ’l sol tace. +Mentre ch’i’ rovinava in basso loco, +dinanzi a li occhi mi si fu offerto +chi per lungo silenzio parea fioco. +Quando vidi costui nel gran diserto, +«Miserere di me», gridai a lui, +«qual che tu sii, od ombra od omo certo!». +Rispuosemi: «Non omo, omo già fui, +e li parenti miei furon lombardi, +mantoani per patria ambedui. +Nacqui sub Iulio, ancor che fosse tardi, +e vissi a Roma sotto ’l buono Augusto +nel tempo de li dèi falsi e bugiardi. +Poeta fui, e cantai di quel giusto +figliuol d’Anchise che venne di Troia, +poi che ’l superbo Ilión fu combusto. +Ma tu perché ritorni a tanta noia? +perché non sali il dilettoso monte +ch’è principio e cagion di tutta gioia?». +«Or se’ tu quel Virgilio e quella fonte +che spandi di parlar sì largo fiume?», +rispuos’io lui con vergognosa fronte. +«O de li altri poeti onore e lume +vagliami ’l lungo studio e ’l grande amore +che m’ha fatto cercar lo tuo volume. +Tu se’ lo mio maestro e ’l mio autore; +tu se’ solo colui da cu’ io tolsi +lo bello stilo che m’ha fatto onore. +Vedi la bestia per cu’ io mi volsi: +aiutami da lei, famoso saggio, +ch’ella mi fa tremar le vene e i polsi». +«A te convien tenere altro viaggio», +rispuose poi che lagrimar mi vide, +«se vuo’ campar d’esto loco selvaggio: +ché questa bestia, per la qual tu gride, +non lascia altrui passar per la sua via, +ma tanto lo ’mpedisce che l’uccide; +e ha natura sì malvagia e ria, +che mai non empie la bramosa voglia, +e dopo ’l pasto ha più fame che pria. +Molti son li animali a cui s’ammoglia, +e più saranno ancora, infin che ’l veltro +verrà, che la farà morir con doglia. +Questi non ciberà terra né peltro, +ma sapienza, amore e virtute, +e sua nazion sarà tra feltro e feltro. +Di quella umile Italia fia salute +per cui morì la vergine Cammilla, +Eurialo e Turno e Niso di ferute. +Questi la caccerà per ogne villa, +fin che l’avrà rimessa ne lo ’nferno, +là onde ’nvidia prima dipartilla. +Ond’io per lo tuo me’ penso e discerno +che tu mi segui, e io sarò tua guida, +e trarrotti di qui per loco etterno, +ove udirai le disperate strida, +vedrai li antichi spiriti dolenti, +ch’a la seconda morte ciascun grida; +e vederai color che son contenti +nel foco, perché speran di venire +quando che sia a le beate genti. +A le quai poi se tu vorrai salire, +anima fia a ciò più di me degna: +con lei ti lascerò nel mio partire; +ché quello imperador che là sù regna, +perch’i’ fu’ ribellante a la sua legge, +non vuol che ’n sua città per me si vegna. +In tutte parti impera e quivi regge; +quivi è la sua città e l’alto seggio: +oh felice colui cu’ ivi elegge!». +E io a lui: «Poeta, io ti richeggio +per quello Dio che tu non conoscesti, +acciò ch’io fugga questo male e peggio, +che tu mi meni là dov’or dicesti, +sì ch’io veggia la porta di san Pietro +e color cui tu fai cotanto mesti». +Allor si mosse, e io li tenni dietro.|} + +module type BACKEND = sig + type h + + val save_page : h * bytes -> (unit, error trace) result Lwt.t + + val load_page : h -> (bytes, error trace) result Lwt.t + + val number_of_pages : unit -> int +end + +module type Hashes_Map_backend = functor () -> + BACKEND with type h = Hashes_map.key + +module Hashes_Map_backend () = struct + open Environment.Error_monad + + type error += + | Page_already_saved of Sc_rollup_reveal_hash.t + | Page_is_missing of Sc_rollup_reveal_hash.t + + let backend = ref Hashes_map.empty + + let save_page (hash, bytes) = + let open Lwt_result_syntax in + match Hashes_map.find hash !backend with + | None -> + let () = backend := Hashes_map.add hash bytes !backend in + return_unit + | Some old_bytes -> + if Bytes.equal old_bytes bytes then return_unit + else tzfail @@ Page_already_saved hash + + let load_page hash = + let open Lwt_result_syntax in + let bytes = Hashes_map.find hash !backend in + match bytes with + | None -> tzfail @@ Page_is_missing hash + | Some bytes -> return bytes + + let number_of_pages () = List.length @@ Hashes_map.bindings !backend +end + +let assert_equal_bytes ~loc msg = + Assert.equal ~loc Bytes.equal msg String.pp_bytes_hex + +let assert_fails_with ~loc k expected_err = + let open Lwt_result_syntax in + let*! res = k in + let res = Environment.wrap_tzresult res in + Assert.error ~loc res (( = ) (Environment.wrap_tzerror expected_err)) + +module Merkle_tree = struct + module V0 = struct + open Dac_pages_encoding.Merkle_tree.V0 + + (* We use 50 bytes as the size of a page. Of these, 5 bytes are used for + the preamble, which leaves 45 bytes of space for storing hashes in a + page. The size of a hash is 32 bytes, therefore only floor(45/2) = 1 + hashes can be stored for each page. Because the serialization process + requires a page size that can contain at least two hashes, the + serialization of any content will fail in this case. + *) + + let serialize_one_hash_per_page_fails () = + let module Backend = Hashes_Map_backend () in + let payload = + List.repeat 195 (Bytes.of_string "a") |> Bytes.concat Bytes.empty + in + assert_fails_with + ~loc:__LOC__ + (serialize_payload + ~max_page_size:50 + payload + ~for_each_page:Backend.save_page) + Dac_pages_encoding.Merkle_tree_branching_factor_not_high_enough + + let serialize_empty_payload_fails () = + let module Backend = Hashes_Map_backend () in + (* Limit the number of hashes stored per page to 2. Because hashes + have a fixed size of 32 bytes, and 5 bytes are used for the preamble, + we need 32 * 2 + 5 = 69 bytes to store two hashes in a page. We round + this value to 70. *) + let max_page_size = 70 in + let payload = Bytes.empty in + + assert_fails_with + ~loc:__LOC__ + (serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page) + Dac_pages_encoding.Payload_cannot_be_empty + + let one_page_roundtrip () = + let open Lwt_result_syntax in + let module Backend = Hashes_Map_backend () in + (* Limit the number of hashes stored per page to 2. Because hashes + have a fixed size of 32 bytes, and 5 bytes are used for the preamble, + we need 32 * 2 + 5 = 69 bytes to store two hashes in a page. We round + this value to 70. *) + let max_page_size = 70 in + let payload = Bytes.of_string "Hello payload" in + let* hash = + lift + @@ serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page + in + let* retrieved_payload = + lift + @@ deserialize_payload hash ~retrieve_page_from_hash:Backend.load_page + in + let map_size = Backend.number_of_pages () in + let* () = Assert.equal_int ~loc:__LOC__ map_size 1 in + assert_equal_bytes + ~loc:__LOC__ + "Deserialized payload do not match with original" + payload + retrieved_payload + + let multiple_pages_roundtrip_heterogeneous_payload () = + (* Each page in tests contains at most 80 bytes, of which 5 are reserved + for the page prefix. This leaves 75 bytes to store the payload to be + serialized in a page. It also means that a `Hashes` page can contain + at most 2 hashes of size 33 bytes each. If we try to serialize a + payload between 151 and 225 bytes (included), then the serialized + payload should be spread among a total of 6 pages. Of these, + 225/75 = 3 pages are used to store the payload, ceil(3/2) = 2 pages + are used for storing the 3 hashes of the 3 payload pages, and + ceil(2/2) = 1 page is used for storing the 2 hashes of the previous + pages. *) + let open Lwt_result_syntax in + let module Backend = Hashes_Map_backend () in + (* Limit the number of hashes stored per page to 2. Because hashes + have a fixed size of 32 bytes, and 5 bytes are used for the preamble, + we need 32 * 2 + 5 = 69 bytes to store two hashes in a page. We round + this value to 70. *) + let max_page_size = 80 in + let payload = + Bytes.of_string + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \ + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim \ + ad minim veniam, quis nostrud exercitation ullamco" + in + let* hash = + lift + @@ serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page + in + let* retrieved_payload = + lift + @@ deserialize_payload hash ~retrieve_page_from_hash:Backend.load_page + in + let map_size = Backend.number_of_pages () in + let* () = Assert.equal_int ~loc:__LOC__ map_size 6 in + assert_equal_bytes + ~loc:__LOC__ + "Deserialized payload do not match with original" + payload + retrieved_payload + + let multiple_pages_roundtrip_homogeneous_payload () = + (* Each page in tests contains at most 80 bytes, of which 5 are reserved + for the page prefix. This leaves 75 bytes to store the contents to be + serialized in a page. It also means that a `Hashes` page can contain + at most 2 hashes of size 32 bytes each. If we try to serialize a + payload of 225 repetitions of the same character, then only one + payload page will be produced. However, the hash of this page will be + repeated three times across two pages represent nodes of the Merkle + tree. Finally, another page will be used for storing the Merkle tree + root page, which contains the two hashes of the Merkle tree nodes + above. In total, the serialization should be spread among 4 pages. *) + let module Backend = Hashes_Map_backend () in + let open Lwt_result_syntax in + (* Limit the number of hashes stored per page to 2. Because hashes + have a fixed size of 32 bytes, and 5 bytes are used for the preamble, + we need 32 * 2 + 5 = 69 bytes to store two hashes in a page. We round + this value to 70. *) + let max_page_size = 80 in + let payload = + List.repeat 225 (Bytes.of_string "a") |> Bytes.concat Bytes.empty + in + let* hash = + lift + @@ serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page + in + let* retrieved_payload = + lift + @@ deserialize_payload hash ~retrieve_page_from_hash:Backend.load_page + in + let map_size = Backend.number_of_pages () in + let* () = Assert.equal_int ~loc:__LOC__ map_size 4 in + assert_equal_bytes + ~loc:__LOC__ + "Deserialized payload do not match with original" + payload + retrieved_payload + + let multiple_pages_roundtrip_do_not_exceed_page_size () = + (* Check that a bug related to the size of hashes has been fixed. + Before the bug was fixed: the `Sc_rollup.Reveal_hash` module borrowed + the size function from the underlying hash module, meaning that it + would return `31` for the size, rather than the actual hash size + which is `32`. For a page that is exactly `98` bytes long, this would + mean that the serialization algorithm will compute the number of + hashes per page to be `(98-5)/31 = 3`, but the actual hash pages will + have size `32 * 3 + 5 = 101` bytes. This will cause the check on a page + size to fail, when serializing a page. With 98 bytes per page, 93 + bytes will be reserved for the payload in content pages. + Before the patch was applied, trying to + serialize a payload of `93 * 3 = 279` bytes with a page size of + 98 bytes would have caused to try to serialize a page containing + 3 hashes of 32 bytes each, resulting in a page of `101 bytes` and + causing the serialization to fail. + *) + let open Lwt_result_syntax in + let module Backend = Hashes_Map_backend () in + let max_page_size = 98 in + (* 279 bytes of payload *) + let payload = + Bytes.of_string + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \ + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim \ + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \ + aliquip ex ea commodo consequat. Duis aute irure dolor in \ + reprehenderit in volup" + in + let* hash = + lift + @@ serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page + in + let* retrieved_payload = + lift + @@ deserialize_payload hash ~retrieve_page_from_hash:Backend.load_page + in + assert_equal_bytes + ~loc:__LOC__ + "Deserialized payload do not match with original" + payload + retrieved_payload + + let long_content_roundtrip () = + (* To ensure that the serialization and deserialization process work as + expected, we test a roundtrip for a reasonably long text. We also + increase the page size to allow for more than two hashes in a page. *) + let module Backend = Hashes_Map_backend () in + let open Lwt_result_syntax in + (* The page size is set to 150. Of these, 5 bytes are used for the page + preamble, and the reset will contain hashes which are 32 bytes long + each. The number of hashes that can fit into a page is + floor((150 - 5)/32) = 4. *) + let max_page_size = 150 in + let payload = Bytes.of_string long_payload in + let* hash = + lift + @@ serialize_payload + ~max_page_size + payload + ~for_each_page:Backend.save_page + in + let* retrieved_payload = + lift + @@ deserialize_payload hash ~retrieve_page_from_hash:Backend.load_page + in + assert_equal_bytes + ~loc:__LOC__ + "Deserialized payload do not match with original" + payload + retrieved_payload + end +end + +module Hash_chain = struct + (* Return substring of [str] after the first [n] char. Returns the original string + if n <= 0. Returns an empty string if n > String.length str *) + let take_after str n = + let n = max 0 n in + String.sub str (min (String.length str) n) (max 0 (String.length str - n)) + + module V0 = struct + module Pagination_scheme = Dac_pages_encoding.Hash_chain.V0 + + let deserialize_page page : + [`Node of Sc_rollup_reveal_hash.t * string | `Leaf of string] = + if String.length page > 3996 then + let content = String.sub page 0 3996 in + let hash = + Stdlib.Option.get + @@ Sc_rollup_reveal_hash.of_b58check_opt + (take_after page (3996 + String.length " hash:")) + in + `Node (hash, content) + else `Leaf page + + let rec retrieve_content ~get_page ?(result = "") page_hash = + let open Lwt_result_syntax in + let* page = get_page page_hash in + let* res = return @@ deserialize_page (Bytes.to_string page) in + match res with + | `Node (succ_hash, content) -> + (retrieve_content [@tailcall]) + ~get_page + ~result:(String.cat result content) + succ_hash + | `Leaf content -> return @@ String.cat result content + + let test_make_chain_hash_one_page () = + let open Lwt_result_syntax in + let payload = Bytes.of_string "simple payload" in + let*? pages = Pagination_scheme.make_hash_chain payload in + let* () = Assert.equal_int ~loc:__LOC__ 1 (List.length pages) in + let actual_hash, content = Stdlib.List.hd pages in + let* () = + assert_equal_bytes ~loc:__LOC__ "Contents not equal" payload content + in + let expected_hash = + Pagination_scheme.to_b58check @@ Pagination_scheme.hash content + in + Assert.equal_string + ~loc:__LOC__ + expected_hash + (Pagination_scheme.to_b58check actual_hash) + + let test_make_chain_hash_long () = + let open Lwt_result_syntax in + let payload = Bytes.of_string long_payload in + let*? pages = Pagination_scheme.make_hash_chain payload in + let* () = Assert.equal_int ~loc:__LOC__ 2 (List.length pages) in + let head_succ = + Stdlib.List.hd pages |> snd |> fun byt -> + take_after (String.of_bytes byt) (3996 + String.length " hash:") + in + let next_hash, content = Stdlib.List.nth pages 1 in + let* () = + Assert.equal_string + ~loc:__LOC__ + (Pagination_scheme.to_b58check next_hash) + head_succ + in + Assert.equal_string + ~loc:__LOC__ + (Pagination_scheme.to_b58check next_hash) + (Pagination_scheme.to_b58check @@ Pagination_scheme.hash content) + + let test_serialize () = + let module Backend = Hashes_Map_backend () in + let open Lwt_result_syntax in + let payload = Bytes.of_string long_payload in + let* root_hash = + lwt_map_error Environment.wrap_tztrace + @@ Pagination_scheme.serialize_payload + ~for_each_page:Backend.save_page + payload + in + let* () = Assert.equal_int ~loc:__LOC__ (Backend.number_of_pages ()) 2 in + let* content = + lwt_map_error Environment.wrap_tztrace + @@ retrieve_content ~get_page:Backend.load_page root_hash + in + Assert.equal_string ~loc:__LOC__ long_payload content + + let test_serialize_empty_payload_fails () = + let module Backend = Hashes_Map_backend () in + let payload = Bytes.of_string "" in + let result = + Pagination_scheme.serialize_payload + ~for_each_page:Backend.save_page + payload + in + assert_fails_with + ~loc:__LOC__ + result + Dac_pages_encoding.Payload_cannot_be_empty + end +end + +let tests = + [ + Tztest.tztest + "Storing only one hash per page causes serialization to fail (Merkle \ + tree, v0)" + `Quick + Merkle_tree.V0.serialize_one_hash_per_page_fails; + Tztest.tztest + "Serializing empty payload returns an error (Merkle tree, v0)" + `Quick + Merkle_tree.V0.serialize_empty_payload_fails; + Tztest.tztest + "Contents fitting in one page can be retrieved after being saved (Merkle \ + tree, v0)" + `Quick + Merkle_tree.V0.one_page_roundtrip; + Tztest.tztest + "Contents fitting in more pages can be retrieved after being saved - no \ + repeated pages (Merkle tree, V0)" + `Quick + Merkle_tree.V0.multiple_pages_roundtrip_heterogeneous_payload; + Tztest.tztest + "Contents fitting in more pages can be retrieved after being saved - \ + repeated pages (Merkle tree, V0)" + `Quick + Merkle_tree.V0.multiple_pages_roundtrip_homogeneous_payload; + Tztest.tztest + "Serialization and deserialization of very long contents is correct." + `Quick + Merkle_tree.V0.long_content_roundtrip; + Tztest.tztest + "Hashes pages are not larger than expected" + `Quick + Merkle_tree.V0.multiple_pages_roundtrip_do_not_exceed_page_size; + Tztest.tztest + "Constructing hash chain (V0) for single page content is correct" + `Quick + Hash_chain.V0.test_make_chain_hash_one_page; + Tztest.tztest + "Constructing hash chain (V0) for multi page content is correct" + `Quick + Hash_chain.V0.test_make_chain_hash_long; + Tztest.tztest + "Serializing an empty payload returns an error (Hash chain)" + `Quick + Hash_chain.V0.test_serialize_empty_payload_fails; + Tztest.tztest + "Contents fitting in more pages can be retrieved after being saved - \ + repeated pages (Hash chain, V0)" + `Quick + Hash_chain.V0.test_serialize; + ] diff --git a/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml b/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml new file mode 100644 index 000000000000..e83ac778d13f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml @@ -0,0 +1,413 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Dal_node Slot_frame_encoding + Invocation: dune exec src/proto_alpha/lib_dal/test/main.exe \ + -- test "^\[Unit\] Slot_framing_protocol.ml$" + Subject: Tests for the SCORU storage module +*) + +(* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3421 + Property based tests to check basic invariants of slot-frame encoding V0. *) + +open Protocol +open Alpha_context +module Rollup_messages_map = Dal_slot_frame_encoding.Rollups_map +module V0 = Dal_slot_frame_encoding.V0 + +(* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3339 + Fetch this value from protocol default constants *) +let max_size = 1_048_576 + +let assert_fails_with ~loc k expected_err = + let open Lwt_result_syntax in + let*! res = k in + Assert.error ~loc res (( = ) expected_err) + +module Compare_list_string = Compare.List (String) +module Compare_list_list_string = Compare.List (Compare_list_string) +module Compare_list_rollup = Compare.List (Sc_rollup.Address) + +let assert_equal_bytes ~loc msg = + Assert.equal ~loc Bytes.equal msg String.pp_bytes_hex + +let assert_equal_list_string ~loc msg = + Assert.equal + ~loc + Compare_list_string.equal + msg + (Format.pp_print_list Format.pp_print_string) + +let assert_equal_list_list_string ~loc msg = + Assert.equal + ~loc + Compare_list_list_string.equal + msg + (Format.pp_print_list (Format.pp_print_list Format.pp_print_string)) + +let assert_equal_list_rollups ~loc msg = + Assert.equal + ~loc + Compare_list_rollup.equal + msg + (Format.pp_print_list Sc_rollup.Address.pp) + +let sc_rollup_1 = + Sc_rollup.Address.of_b58check_exn "sr1BAwv191dVYeZg44ZxVy8dFwfRQKW6bSqc" + +let sc_rollup_2 = + Sc_rollup.Address.of_b58check_exn "sr1Fq8fPi2NjhWUXtcXBggbL6zFjZctGkmso" + +let slot_frame_encoding_size_correct_single_v0 () = + let open Lwt_result_syntax in + let messages_rollup_1 = + ["hello"; "is"; "it"; "me"; "you"; "are"; "looking"; "for"] + in + (* One rollup with offset should take 24 bytes *) + let entry_size = V0.Internal.rollup_entry_size in + let* () = Assert.equal_int ~loc:__LOC__ entry_size 24 in + (* 1 byte for version *) + let expected_version_size = 1 in + (* 20 bytes for one rollup address + 4 bytes of offset + 4 bytes for frame length = 28 bytes *) + let computed_rollups_frame_size = V0.Internal.rollups_frame_size 1 in + let expected_rollups_frame_size = 28 in + let* () = + Assert.equal_int + ~loc:__LOC__ + computed_rollups_frame_size + expected_rollups_frame_size + in + (*27 bytes total messages + + 4 * 8 = 32 bytes message length prefixes + + 4 bytes list length prefix + + 63 bytes for messages frame *) + let computed_messages_frame_size = + V0.Internal.messages_frame_size messages_rollup_1 + in + let expected_messages_frame_size = 63 in + let* () = + Assert.equal_int + ~loc:__LOC__ + computed_messages_frame_size + expected_messages_frame_size + in + (* 4 bytes of list length prefix + + 63 bytes of messages_frame_size = 67 bytes for all messages frames *) + let computed_all_messages_frames_size = + V0.Internal.all_messages_frames_size [messages_rollup_1] + in + let expected_all_messages_frames_size = 4 + expected_messages_frame_size in + let* () = + Assert.equal_int + ~loc:__LOC__ + computed_all_messages_frames_size + expected_all_messages_frames_size + in + let expected_size = + expected_version_size + expected_rollups_frame_size + + expected_all_messages_frames_size + in + let map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + in + let computed_size = V0.expected_slot_size map in + Assert.equal_int ~loc:__LOC__ expected_size computed_size + +let slot_frame_encoding_size_correct_multiple_v0 () = + let open Lwt_result_syntax in + let messages_rollup_1 = ["Summer"; "loving"; "had"; "me"; "a"; "blast"] in + let messages_rollup_2 = ["Summer"; "loving"; "happened"; "so"; "fast"] in + (* 1 byte for version *) + let expected_version_size = 1 in + (* 24 * 2 = 48 bytes for two rollup entries + + 4 bytes for frame length prefix = 52 bytes + *) + let computed_rollups_frame_size = V0.Internal.rollups_frame_size 2 in + let expected_rollups_frame_size = 52 in + let* () = + Assert.equal_int + ~loc:__LOC__ + computed_rollups_frame_size + expected_rollups_frame_size + in + (* Frame 1: + 6 + 6 + 3 + 2 + 1 + 5 = 23 bytes for messages + + 4 * 6 = 24 bytes for message length prefix for 6 messages + + 4 bytes for message frame prefix = + 51 bytes for the messages frame for rollup1. + Frame 2: + 6 + 6 + 8 + 2 + 4 = 26 bytes for messages + + 4 * 5 = 20 bytes for message length prefix for 6 messages + + 4 bytes for message frame prefix = + 50 bytes for the messages frame for rollup2. + Messages frame length: + 51 bytes for rollup1 messages frame + + 50 bytes for rollup2 messages frame + + 4 bytes prefix length for all messages frames = + 105 bytes + *) + let computed_all_messages_frames_size = + V0.Internal.all_messages_frames_size [messages_rollup_1; messages_rollup_2] + in + let expected_all_messages_frames_size = 105 in + let* () = + Assert.equal_int + ~loc:__LOC__ + computed_all_messages_frames_size + expected_all_messages_frames_size + in + let expected_size = + expected_version_size + expected_rollups_frame_size + + expected_all_messages_frames_size + in + let map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let computed_size = V0.expected_slot_size map in + Assert.equal_int ~loc:__LOC__ expected_size computed_size + +let slot_frame_encoding_decoding_correct_single_v0 () = + let open Lwt_result_syntax in + let messages_rollup_1 = + ["hello"; "is"; "it"; "me"; "you"; "are"; "looking"; "for"] + in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + in + let* serialized = V0.serialize ~max_size messages_map in + let* () = + Assert.equal_int + ~loc:__LOC__ + (String.length serialized) + (V0.expected_slot_size messages_map) + in + let* deserialized = V0.deserialize ~max_size serialized in + let rollups_with_messages = Rollup_messages_map.bindings deserialized in + let* () = + assert_equal_list_rollups + ~loc:__LOC__ + "Deserialized rollups are different from originals" + [sc_rollup_1] + (List.map fst rollups_with_messages) + in + assert_equal_list_list_string + ~loc:__LOC__ + "Messages frames are different from originals" + [messages_rollup_1] + (List.map snd rollups_with_messages) + +let slot_frame_encoding_decoding_correct_multiple_v0 () = + let open Lwt_result_syntax in + let messages_rollup_1 = ["Summer"; "loving"; "had"; "me"; "a"; "blast"] in + let messages_rollup_2 = ["Summer"; "loving"; "happened"; "so"; "fast"] in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let* serialized = V0.serialize ~max_size messages_map in + let* () = + Assert.equal_int + ~loc:__LOC__ + (String.length serialized) + (V0.expected_slot_size messages_map) + in + let* deserialized = V0.deserialize ~max_size serialized in + let rollups_with_messages = Rollup_messages_map.bindings deserialized in + let* () = + assert_equal_list_rollups + ~loc:__LOC__ + "Deserialized rollups are different from originals" + [sc_rollup_1; sc_rollup_2] + (List.map fst rollups_with_messages) + in + assert_equal_list_list_string + ~loc:__LOC__ + "Messages frames are different from originals" + [messages_rollup_1; messages_rollup_2] + (List.map snd rollups_with_messages) + +let slot_frame_encoding_fails_if_too_big () = + let messages_rollup_1 = ["Summer"; "loving"; "had"; "me"; "a"; "blast"] in + let messages_rollup_2 = ["Summer"; "loving"; "happened"; "so"; "fast"] in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let actual_size = V0.expected_slot_size messages_map in + let max_size = actual_size - 1 in + assert_fails_with + ~loc:__LOC__ + (V0.serialize ~max_size messages_map) + (Dal_slot_frame_encoding.Slot_size_is_too_big {actual_size; max_size}) + +let slot_frame_decoding_fails_if_too_big () = + let open Lwt_result_syntax in + let messages_rollup_1 = ["Summer"; "loving"; "had"; "me"; "a"; "blast"] in + let messages_rollup_2 = ["Summer"; "loving"; "happened"; "so"; "fast"] in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let actual_size = V0.expected_slot_size messages_map in + let* serialized = V0.serialize ~max_size:actual_size messages_map in + let max_size = actual_size - 1 in + assert_fails_with + ~loc:__LOC__ + (V0.deserialize ~max_size serialized) + (Dal_slot_frame_encoding.Slot_size_is_too_big {actual_size; max_size}) + +let slot_frame_decoding_fails_if_wrong_version () = + let open Lwt_result_syntax in + let messages_rollup_1 = ["Summer"; "loving"; "had"; "me"; "a"; "blast"] in + let messages_rollup_2 = ["Summer"; "loving"; "happened"; "so"; "fast"] in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let* serialized = + Dal_slot_frame_encoding.V0.serialize ~max_size messages_map + in + let serialized_wrong_version = + "\001" ^ String.sub serialized 1 (String.length serialized - 1) + in + assert_fails_with + ~loc:__LOC__ + (V0.deserialize ~max_size serialized_wrong_version) + (Dal_slot_frame_encoding.Wrong_slot_frame_version + {expected = 0; provided = 1}) + +let slot_frame_encoding_correct_offsets () = + let open Lwt_result_syntax in + let messages_rollup_1 = ["hello"; "world"] in + let messages_rollup_2 = ["CAFEBABE"; "CAFEDEAD"] in + let messages_map = + Rollup_messages_map.empty + |> Rollup_messages_map.add sc_rollup_1 messages_rollup_1 + |> Rollup_messages_map.add sc_rollup_2 messages_rollup_2 + in + let* serialized = V0.serialize ~max_size messages_map in + (* the value of the offset that denotes where the messages frame for + sc_rollup_1 starts can be found at offset 25 until 29 (excluded): + 1 byte for version + + 4 bytes for rollups frame prefix + + 20 bytes for rollup address = 25. + *) + let first_offset = + String.sub serialized 25 4 |> Data_encoding.(Binary.of_string_exn int32) + in + (* the value of the offset should be 57l: + 1 byte for version number + 4 bytes for rollups frame prefix + + 2 * 24 bytes for rollups frame + + 4 bytes for messages frames prefix = 57. *) + let* () = Assert.equal_int32 ~loc:__LOC__ first_offset 57l in + (* The length of the first messages frame should be 22 bytes: + 4 bytes for the messages frame prefix + + 4 + 5 bytes for the encoding of the message "hello" + + 4 + 5 bytes for the encoding of the message "world" = 22. + *) + let first_messages_frame = + Data_encoding.(Binary.of_string_exn @@ list string) + @@ String.sub serialized 57 22 + in + let* () = + assert_equal_list_string + ~loc:__LOC__ + "Messages frame for sc_rollup_1 is not as expected" + first_messages_frame + ["hello"; "world"] + in + (* The value of the offset that denotes where the messages frame for + sc_rollup_2 STARTS can be found at bytes 49 until 53 (excluded): + 29 offset where the entry for sc_rollup_2 starts + + 20 bytes for the encoding of sc_rollup_2 = 49. + *) + let second_offset = + String.sub serialized 49 4 |> Data_encoding.(Binary.of_string_exn int32) + in + (* the value of the second offset should be 79 + 57 offset where the messages frame for sc_rollup_1 starts + + 22 bytes length of the first messages frame = 79 + *) + let* () = Assert.equal_int32 ~loc:__LOC__ second_offset 79l in + (* The length of the first messages frame should be 28: + 4 bytes for the messages frame prefix + + 4 + 8 bytes for the encoding of the message "CAFEBABE" + + 4 + 8 bytes for the encoding of the message "CAFEDEAD" = 28 + *) + let second_messages_frame = + Data_encoding.(Binary.of_string_exn @@ list string) + @@ String.sub serialized 79 28 + in + assert_equal_list_string + ~loc:__LOC__ + "Messages frame for sc_rollup_1 is not as expected" + second_messages_frame + ["CAFEBABE"; "CAFEDEAD"] + +let tests = + [ + Tztest.tztest + "Encoded slot has expected size (V0, 1 rollup)" + `Quick + slot_frame_encoding_size_correct_single_v0; + Tztest.tztest + "Encoded slot has expected size (V0, 2 rollups)" + `Quick + slot_frame_encoding_size_correct_multiple_v0; + Tztest.tztest + "Encoded slot can be decoded (V0, 1 rollup)" + `Quick + slot_frame_encoding_decoding_correct_single_v0; + Tztest.tztest + "Encoded slot can be decoded (V0, 2 rollups)" + `Quick + slot_frame_encoding_decoding_correct_multiple_v0; + Tztest.tztest + "Encoding of a slot over maximum size fails (V0)" + `Quick + slot_frame_encoding_fails_if_too_big; + Tztest.tztest + "Offsets of messages frames are correct (V0)" + `Quick + slot_frame_encoding_correct_offsets; + Tztest.tztest + "Slot decoding fails when slot size is too big (V0)" + `Quick + slot_frame_decoding_fails_if_too_big; + Tztest.tztest + "Slot decoding fails when first byte has wrong version (V0)" + `Quick + slot_frame_decoding_fails_if_wrong_version; + ] diff --git a/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.ml b/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.ml new file mode 100644 index 000000000000..50954c9da376 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + checkout_fun : + Tezos_crypto.Context_hash.t -> + Tezos_protocol_environment.Context.t option Lwt.t; + finalize_fun : unit -> unit Lwt.t; +} + +let abstract index = + { + checkout_fun = Shell_context.checkout index; + finalize_fun = (fun () -> Context.close index); + } diff --git a/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.mli b/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.mli new file mode 100644 index 000000000000..2d0533b7067b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/abstract_context_index.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + checkout_fun : + Tezos_crypto.Context_hash.t -> + Tezos_protocol_environment.Context.t option Lwt.t; + finalize_fun : unit -> unit Lwt.t; +} + +val abstract : Context.index -> t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_actions.ml b/src/proto_016_PtMumbai/lib_delegate/baking_actions.ml new file mode 100644 index 000000000000..b8a6e51d07a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_actions.ml @@ -0,0 +1,636 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Baking_state +module Events = Baking_events.Actions + +module Operations_source = struct + type error += + | Failed_operations_fetch of { + path : string; + reason : string; + details : Data_encoding.json option; + } + + let operations_encoding = + Data_encoding.(list (dynamic_size Operation.encoding)) + + let retrieve = function + | None -> Lwt.return_none + | Some operations -> ( + let fail reason details = + let path = + match operations with + | Baking_configuration.Operations_source.Local {filename} -> + filename + | Baking_configuration.Operations_source.Remote {uri; _} -> + Uri.to_string uri + in + fail (Failed_operations_fetch {path; reason; details}) + in + let decode_operations json = + protect + ~on_error:(fun _ -> + fail "cannot decode the received JSON into operations" (Some json)) + (fun () -> + return (Data_encoding.Json.destruct operations_encoding json)) + in + match operations with + | Baking_configuration.Operations_source.Local {filename} -> + if Sys.file_exists filename then + Tezos_stdlib_unix.Lwt_utils_unix.Json.read_file filename + >>= function + | Error _ -> + Events.(emit invalid_json_file filename) >>= fun () -> + Lwt.return_none + | Ok json -> ( + decode_operations json >>= function + | Ok operations -> Lwt.return_some operations + | Error errs -> + Events.(emit cannot_fetch_operations errs) >>= fun () -> + Lwt.return_none) + else + Events.(emit no_operations_found_in_file filename) >>= fun () -> + Lwt.return_none + | Baking_configuration.Operations_source.Remote {uri; http_headers} -> ( + ( ((with_timeout + (Systime_os.sleep (Time.System.Span.of_seconds_exn 5.)) + (fun _ -> + Tezos_rpc_http_client_unix.RPC_client_unix + .generic_media_type_call + ~accept:[Media_type.json] + ?headers:http_headers + `GET + uri) + >>=? function + | `Json json -> return json + | _ -> fail "json not returned" None) + >>=? function + | `Ok json -> return json + | `Unauthorized json -> fail "unauthorized request" json + | `Gone json -> fail "gone" json + | `Error json -> fail "error" json + | `Not_found json -> fail "not found" json + | `Forbidden json -> fail "forbidden" json + | `Conflict json -> fail "conflict" json) + >>=? fun json -> decode_operations json ) + >>= function + | Ok operations -> Lwt.return_some operations + | Error errs -> + Events.(emit cannot_fetch_operations errs) >>= fun () -> + Lwt.return_none)) +end + +type block_kind = + | Fresh of Operation_pool.pool + | Reproposal of { + consensus_operations : packed_operation list; + payload_hash : Block_payload_hash.t; + payload_round : Round.t; + payload : Operation_pool.payload; + } + +type block_to_bake = { + predecessor : block_info; + round : Round.t; + delegate : Baking_state.consensus_key_and_delegate; + kind : block_kind; +} + +type action = + | Do_nothing + | Inject_block of {block_to_bake : block_to_bake; updated_state : state} + | Inject_preendorsements of { + preendorsements : (consensus_key_and_delegate * consensus_content) list; + updated_state : state; + } + | Inject_endorsements of { + endorsements : (consensus_key_and_delegate * consensus_content) list; + updated_state : state; + } + | Update_to_level of level_update + | Synchronize_round of round_update + +and level_update = { + new_level_proposal : proposal; + compute_new_state : + current_round:Round.t -> + delegate_slots:delegate_slots -> + next_level_delegate_slots:delegate_slots -> + (state * action) Lwt.t; +} + +and round_update = { + new_round_proposal : proposal; + handle_proposal : state -> (state * action) Lwt.t; +} + +type t = action + +let pp_action fmt = function + | Do_nothing -> Format.fprintf fmt "do nothing" + | Inject_block _ -> Format.fprintf fmt "inject block" + | Inject_preendorsements _ -> Format.fprintf fmt "inject preendorsements" + | Inject_endorsements _ -> Format.fprintf fmt "inject endorsements" + | Update_to_level _ -> Format.fprintf fmt "update to level" + | Synchronize_round _ -> Format.fprintf fmt "synchronize round" + +let generate_seed_nonce_hash config delegate level = + if level.Level.expected_commitment then + Baking_nonces.generate_seed_nonce config delegate level.level + >>=? fun seed_nonce -> return_some seed_nonce + else return_none + +let sign_block_header state proposer unsigned_block_header = + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + let force = state.global_state.config.force in + let {Block_header.shell; protocol_data = {contents; _}} = + unsigned_block_header + in + let unsigned_header = + Data_encoding.Binary.to_bytes_exn + Alpha_context.Block_header.unsigned_encoding + (shell, contents) + in + let level = shell.level in + Baking_state.round_of_shell_header shell >>?= fun round -> + let open Baking_highwatermarks in + cctxt#with_lock (fun () -> + let block_location = + Baking_files.resolve_location ~chain_id `Highwatermarks + in + may_sign_block + cctxt + block_location + ~delegate:proposer.public_key_hash + ~level + ~round + >>=? function + | true -> + record_block + cctxt + block_location + ~delegate:proposer.public_key_hash + ~level + ~round + >>=? fun () -> return_true + | false -> + Events.(emit potential_double_baking (level, round)) >>= fun () -> + return force) + >>=? function + | false -> fail (Block_previously_baked {level; round}) + | true -> + Client_keys.sign + cctxt + proposer.secret_key_uri + ~watermark:Block_header.(to_watermark (Block_header chain_id)) + unsigned_header + >>=? fun signature -> + return {Block_header.shell; protocol_data = {contents; signature}} + +let inject_block ~state_recorder state block_to_bake ~updated_state = + let {predecessor; round; delegate = (consensus_key, _) as delegate; kind} = + block_to_bake + in + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + let simulation_mode = state.global_state.validation_mode in + let round_durations = state.global_state.round_durations in + Environment.wrap_tzresult + (Round.timestamp_of_round + round_durations + ~predecessor_timestamp:predecessor.shell.timestamp + ~predecessor_round:predecessor.round + ~round) + >>?= fun timestamp -> + let external_operation_source = state.global_state.config.extra_operations in + Operations_source.retrieve external_operation_source >>= fun extern_ops -> + let simulation_kind, payload_round = + match kind with + | Fresh pool -> + let pool = + let node_pool = Operation_pool.Prioritized.of_pool pool in + match extern_ops with + | None -> node_pool + | Some ops -> + Operation_pool.Prioritized.merge_external_operations node_pool ops + in + (Block_forge.Filter pool, round) + | Reproposal {consensus_operations; payload_hash; payload_round; payload} -> + ( Block_forge.Apply + { + ordered_pool = + Operation_pool.ordered_pool_of_payload + ~consensus_operations + payload; + payload_hash; + }, + payload_round ) + in + Events.( + emit forging_block (Int32.succ predecessor.shell.level, round, delegate)) + >>= fun () -> + Plugin.RPC.current_level + cctxt + ~offset:1l + (`Hash state.global_state.chain_id, `Hash (predecessor.hash, 0)) + >>=? fun injection_level -> + generate_seed_nonce_hash + state.global_state.config.Baking_configuration.nonce + consensus_key + injection_level + >>=? fun seed_nonce_opt -> + let seed_nonce_hash = Option.map fst seed_nonce_opt in + let user_activated_upgrades = + state.global_state.config.user_activated_upgrades + in + (* Set liquidity_baking_toggle_vote for this block *) + let default = state.global_state.config.liquidity_baking_toggle_vote in + let per_block_vote_file = state.global_state.config.per_block_vote_file in + (match per_block_vote_file with + | None -> Lwt.return default + | Some per_block_vote_file -> + Liquidity_baking_vote_file.read_liquidity_baking_toggle_vote_no_fail + ~default + ~per_block_vote_file) + >>= fun liquidity_baking_toggle_vote -> + (* Cache last toggle vote to use in case of vote file errors *) + let updated_state = + { + updated_state with + global_state = + { + updated_state.global_state with + config = + { + updated_state.global_state.config with + liquidity_baking_toggle_vote; + }; + }; + } + in + Events.(emit vote_for_liquidity_baking_toggle) liquidity_baking_toggle_vote + >>= fun () -> + Block_forge.forge + cctxt + ~chain_id + ~pred_info:predecessor + ~timestamp + ~seed_nonce_hash + ~payload_round + ~liquidity_baking_toggle_vote + ~user_activated_upgrades + state.global_state.config.fees + simulation_mode + simulation_kind + state.global_state.constants.parametric + >>=? fun {unsigned_block_header; operations} -> + sign_block_header state consensus_key unsigned_block_header + >>=? fun signed_block_header -> + (match seed_nonce_opt with + | None -> + (* Nothing to do *) + return_unit + | Some (_, nonce) -> + let block_hash = Block_header.hash signed_block_header in + Baking_nonces.register_nonce cctxt ~chain_id block_hash nonce) + >>=? fun () -> + state_recorder ~new_state:updated_state >>=? fun () -> + Events.( + emit injecting_block (signed_block_header.shell.level, round, delegate)) + >>= fun () -> + Node_rpc.inject_block + cctxt + ~force:state.global_state.config.force + ~chain:(`Hash state.global_state.chain_id) + signed_block_header + operations + >>=? fun bh -> + Events.( + emit block_injected (bh, signed_block_header.shell.level, round, delegate)) + >>= fun () -> return updated_state + +let inject_preendorsements ~state_recorder state ~preendorsements ~updated_state + = + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + (* N.b. signing a lot of operations may take some time *) + (* Don't parallelize signatures: the signer might not be able to + handle concurrent requests *) + let block_location = + Baking_files.resolve_location ~chain_id `Highwatermarks + in + List.filter_map_es + (fun (((consensus_key, _) as delegate), consensus_content) -> + Events.(emit signing_preendorsement delegate) >>= fun () -> + let shell = + { + Tezos_base.Operation.branch = + state.level_state.latest_proposal.predecessor.hash; + } + in + let contents = Single (Preendorsement consensus_content) in + let level = Raw_level.to_int32 consensus_content.level in + let round = consensus_content.round in + let sk_uri = consensus_key.secret_key_uri in + cctxt#with_lock (fun () -> + Baking_highwatermarks.may_sign_preendorsement + cctxt + block_location + ~delegate:consensus_key.public_key_hash + ~level + ~round + >>=? function + | true -> + Baking_highwatermarks.record_preendorsement + cctxt + block_location + ~delegate:consensus_key.public_key_hash + ~level + ~round + >>=? fun () -> return_true + | false -> return state.global_state.config.force) + >>=? fun may_sign -> + (if may_sign then + let unsigned_operation = (shell, Contents_list contents) in + let watermark = Operation.(to_watermark (Preendorsement chain_id)) in + let unsigned_operation_bytes = + Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + unsigned_operation + in + Client_keys.sign cctxt ~watermark sk_uri unsigned_operation_bytes + else + fail (Baking_highwatermarks.Block_previously_preendorsed {round; level})) + >>= function + | Error err -> + Events.(emit skipping_preendorsement (delegate, err)) >>= fun () -> + return_none + | Ok signature -> + let protocol_data = + Operation_data {contents; signature = Some signature} + in + let operation : Operation.packed = {shell; protocol_data} in + return_some (delegate, operation)) + preendorsements + >>=? fun signed_operations -> + state_recorder ~new_state:updated_state >>=? fun () -> + (* TODO: add a RPC to inject multiple operations *) + List.iter_ep + (fun (delegate, operation) -> + let encoded_op = + Data_encoding.Binary.to_bytes_exn Operation.encoding operation + in + protect + ~on_error:(fun err -> + Events.(emit failed_to_inject_preendorsement (delegate, err)) + >>= fun () -> return_unit) + (fun () -> + Shell_services.Injection.operation + cctxt + ~chain:(`Hash chain_id) + encoded_op + >>=? fun oph -> + Events.(emit preendorsement_injected (oph, delegate)) >>= fun () -> + return_unit)) + signed_operations + >>=? fun () -> return updated_state + +let sign_endorsements state endorsements = + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + (* N.b. signing a lot of operations may take some time *) + (* Don't parallelize signatures: the signer might not be able to + handle concurrent requests *) + let block_location = + Baking_files.resolve_location ~chain_id `Highwatermarks + in + List.filter_map_es + (fun (((consensus_key, _) as delegate), consensus_content) -> + Events.(emit signing_endorsement delegate) >>= fun () -> + let shell = + { + Tezos_base.Operation.branch = + state.level_state.latest_proposal.predecessor.hash; + } + in + let contents = + (* No preendorsements are included *) + Single (Endorsement consensus_content) + in + let level = Raw_level.to_int32 consensus_content.level in + let round = consensus_content.round in + let sk_uri = consensus_key.secret_key_uri in + cctxt#with_lock (fun () -> + Baking_highwatermarks.may_sign_endorsement + cctxt + block_location + ~delegate:consensus_key.public_key_hash + ~level + ~round + >>=? function + | true -> + Baking_highwatermarks.record_endorsement + cctxt + block_location + ~delegate:consensus_key.public_key_hash + ~level + ~round + >>=? fun () -> return_true + | false -> return state.global_state.config.force) + >>=? fun may_sign -> + (if may_sign then + let watermark = Operation.(to_watermark (Endorsement chain_id)) in + let unsigned_operation = (shell, Contents_list contents) in + let unsigned_operation_bytes = + Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + unsigned_operation + in + Client_keys.sign cctxt ~watermark sk_uri unsigned_operation_bytes + else fail (Baking_highwatermarks.Block_previously_endorsed {round; level})) + >>= function + | Error err -> + Events.(emit skipping_endorsement (delegate, err)) >>= fun () -> + return_none + | Ok signature -> + let protocol_data = + Operation_data {contents; signature = Some signature} + in + let operation : Operation.packed = {shell; protocol_data} in + return_some (delegate, operation)) + endorsements + +let inject_endorsements ~state_recorder state ~endorsements ~updated_state = + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + sign_endorsements state endorsements >>=? fun signed_operations -> + state_recorder ~new_state:updated_state >>=? fun () -> + (* TODO: add a RPC to inject multiple operations *) + List.iter_ep + (fun (delegate, signed_operation) -> + let encoded_op = + Data_encoding.Binary.to_bytes_exn Operation.encoding signed_operation + in + Shell_services.Injection.operation + cctxt + ~chain:(`Hash chain_id) + encoded_op + >>=? fun oph -> + Events.(emit endorsement_injected (oph, delegate)) >>= fun () -> + return_unit) + signed_operations + >>=? fun () -> return updated_state + +let prepare_waiting_for_quorum state = + let consensus_threshold = + state.global_state.constants.parametric.consensus_threshold + in + let get_consensus_operation_voting_power ~slot = + match + SlotMap.find slot state.level_state.delegate_slots.all_delegate_slots + with + | None -> + (* cannot happen if the map is correctly populated *) + 0 + | Some {endorsing_power; _} -> endorsing_power + in + let latest_proposal = state.level_state.latest_proposal.block in + (* assert (latest_proposal.block.round = state.round_state.current_round) ; *) + let candidate = + { + Operation_worker.hash = latest_proposal.hash; + round_watched = latest_proposal.round; + payload_hash_watched = latest_proposal.payload_hash; + } + in + (consensus_threshold, get_consensus_operation_voting_power, candidate) + +let start_waiting_for_preendorsement_quorum state = + let consensus_threshold, get_preendorsement_voting_power, candidate = + prepare_waiting_for_quorum state + in + let operation_worker = state.global_state.operation_worker in + Operation_worker.monitor_preendorsement_quorum + operation_worker + ~consensus_threshold + ~get_preendorsement_voting_power + candidate + +let start_waiting_for_endorsement_quorum state = + let consensus_threshold, get_endorsement_voting_power, candidate = + prepare_waiting_for_quorum state + in + let operation_worker = state.global_state.operation_worker in + Operation_worker.monitor_endorsement_quorum + operation_worker + ~consensus_threshold + ~get_endorsement_voting_power + candidate + +let compute_round proposal round_durations = + let open Protocol in + let open Baking_state in + let timestamp = Time.System.now () |> Time.System.to_protocol in + let predecessor_block = proposal.predecessor in + Environment.wrap_tzresult + @@ Alpha_context.Round.round_of_timestamp + round_durations + ~predecessor_timestamp:predecessor_block.shell.timestamp + ~predecessor_round:predecessor_block.round + ~timestamp + +let update_to_level state level_update = + let {new_level_proposal; compute_new_state} = level_update in + let cctxt = state.global_state.cctxt in + let delegates = state.global_state.delegates in + let new_level = new_level_proposal.block.shell.level in + let chain = `Hash state.global_state.chain_id in + (if Int32.(new_level = succ state.level_state.current_level) then + return state.level_state.next_level_delegate_slots + else + Baking_state.compute_delegate_slots cctxt delegates ~level:new_level ~chain) + >>=? fun delegate_slots -> + Baking_state.compute_delegate_slots + cctxt + delegates + ~level:(Int32.succ new_level) + ~chain + >>=? fun next_level_delegate_slots -> + let round_durations = state.global_state.round_durations in + compute_round new_level_proposal round_durations >>?= fun current_round -> + compute_new_state ~current_round ~delegate_slots ~next_level_delegate_slots + >>= return + +let synchronize_round state {new_round_proposal; handle_proposal} = + Events.(emit synchronizing_round new_round_proposal.predecessor.hash) + >>= fun () -> + let round_durations = state.global_state.round_durations in + compute_round new_round_proposal round_durations >>?= fun current_round -> + if Round.(current_round < new_round_proposal.block.round) then + (* impossible *) + failwith + "synchronize_round: current round (%a) is behind the new proposal's \ + round (%a)" + Round.pp + current_round + Round.pp + new_round_proposal.block.round + else + let new_round_state = {current_round; current_phase = Idle} in + let new_state = {state with round_state = new_round_state} in + handle_proposal new_state >>= return + +let rec perform_action ~state_recorder state (action : action) = + match action with + | Do_nothing -> state_recorder ~new_state:state >>=? fun () -> return state + | Inject_block {block_to_bake; updated_state} -> + inject_block state ~state_recorder block_to_bake ~updated_state + | Inject_preendorsements {preendorsements; updated_state} -> + inject_preendorsements + ~state_recorder + state + ~preendorsements + ~updated_state + >>=? fun new_state -> + (* We wait for preendorsements to trigger the + [Prequorum_reached] event *) + start_waiting_for_preendorsement_quorum state >>= fun () -> + return new_state + | Inject_endorsements {endorsements; updated_state} -> + inject_endorsements ~state_recorder state ~endorsements ~updated_state + >>=? fun new_state -> + (* We wait for endorsements to trigger the [Quorum_reached] + event *) + start_waiting_for_endorsement_quorum state >>= fun () -> return new_state + | Update_to_level level_update -> + update_to_level state level_update >>=? fun (new_state, new_action) -> + perform_action ~state_recorder new_state new_action + | Synchronize_round round_update -> + synchronize_round state round_update >>=? fun (new_state, new_action) -> + perform_action ~state_recorder new_state new_action diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_actions.mli b/src/proto_016_PtMumbai/lib_delegate/baking_actions.mli new file mode 100644 index 000000000000..da181cda8c32 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_actions.mli @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Baking_state + +type block_kind = + | Fresh of Operation_pool.pool + | Reproposal of { + consensus_operations : packed_operation list; + payload_hash : Block_payload_hash.t; + payload_round : Round.t; + payload : Operation_pool.payload; + } + +type block_to_bake = { + predecessor : block_info; + round : Round.t; + delegate : consensus_key_and_delegate; + kind : block_kind; +} + +type action = + | Do_nothing + | Inject_block of {block_to_bake : block_to_bake; updated_state : state} + | Inject_preendorsements of { + preendorsements : (consensus_key_and_delegate * consensus_content) list; + updated_state : state; + } + | Inject_endorsements of { + endorsements : (consensus_key_and_delegate * consensus_content) list; + updated_state : state; + } + | Update_to_level of level_update + | Synchronize_round of round_update + +and level_update = { + new_level_proposal : proposal; + compute_new_state : + current_round:Round.t -> + delegate_slots:delegate_slots -> + next_level_delegate_slots:delegate_slots -> + (state * action) Lwt.t; +} + +and round_update = { + new_round_proposal : proposal; + handle_proposal : state -> (state * action) Lwt.t; +} + +type t = action + +val generate_seed_nonce_hash : + Baking_configuration.nonce_config -> + consensus_key -> + Level.t -> + (Nonce_hash.t * Nonce.t) option tzresult Lwt.t + +val inject_block : + state_recorder:(new_state:state -> unit tzresult Lwt.t) -> + state -> + block_to_bake -> + updated_state:state -> + state tzresult Lwt.t + +val inject_preendorsements : + state_recorder:(new_state:state -> unit tzresult Lwt.t) -> + state -> + preendorsements:(consensus_key_and_delegate * consensus_content) list -> + updated_state:state -> + state tzresult Lwt.t + +val sign_endorsements : + state -> + (consensus_key_and_delegate * consensus_content) list -> + (consensus_key_and_delegate * packed_operation) list tzresult Lwt.t + +val inject_endorsements : + state_recorder:(new_state:state -> unit tzresult Lwt.t) -> + state -> + endorsements:(consensus_key_and_delegate * consensus_content) list -> + updated_state:state -> + state tzresult Lwt.t + +val prepare_waiting_for_quorum : + state -> int * (slot:Slot.t -> int) * Operation_worker.candidate + +val start_waiting_for_preendorsement_quorum : state -> unit Lwt.t + +val start_waiting_for_endorsement_quorum : state -> unit Lwt.t + +val update_to_level : state -> level_update -> (state * t) tzresult Lwt.t + +val pp_action : Format.formatter -> t -> unit + +val compute_round : proposal -> Round.round_durations -> Round.t tzresult + +val perform_action : + state_recorder:(new_state:state -> unit tzresult Lwt.t) -> + state -> + t -> + state tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_cache.ml b/src/proto_016_PtMumbai/lib_delegate/baking_cache.ml new file mode 100644 index 000000000000..1d5ffa81cdd2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_cache.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Cache structures used to memoize costly RPCs/computations. *) + +open Protocol.Alpha_context + +type round = Round.t + +module Block_cache = + Aches.Vache.Map (Aches.Vache.LRU_Precise) (Aches.Vache.Strong) + (Tezos_crypto.Block_hash) + +(** The [Timestamp_of_round_tbl] module allows to create memoization tables + to store function calls of [Round.timestamp_of_round]. *) +module Timestamp_of_round_cache = + Aches.Vache.Map (Aches.Vache.LRU_Precise) (Aches.Vache.Strong) + (struct + (* The type of keys is a tuple that corresponds to the arguments + of [Round.timestamp_of_round]. *) + type t = Timestamp.time * round * round + + let hash k = Hashtbl.hash k + + let equal (ts, r1, r2) (ts', r1', r2') = + Timestamp.(ts = ts') && Round.(r1 = r1') && Round.(r2 = r2') + end) + +module Round_cache_key = struct + type ts_interval = Timestamp.time * Timestamp.time + + (** The values that are intended to be used here are the + arguments are: predecessor_timestamp * predecessor_round * + timestamp_interval *) + type t = { + predecessor_timestamp : Timestamp.time; + predecessor_round : round; + time_interval : ts_interval; + } + + let hash {predecessor_timestamp; predecessor_round; _} = + Stdlib.Hashtbl.hash (predecessor_timestamp, predecessor_round) + + let equal + { + predecessor_timestamp = pred_t; + predecessor_round = pred_r; + time_interval = t_beg, t_end; + } + { + predecessor_timestamp = pred_t'; + predecessor_round = pred_r'; + time_interval = t_beg', t_end'; + } = + Timestamp.(pred_t = pred_t') + && Round.(pred_r = pred_r') + && Timestamp.(t_beg' <= t_beg) + && Timestamp.(t_end < t_end') +end + +module Round_timestamp_interval_cache = + Aches.Vache.Map (Aches.Vache.LRU_Precise) (Aches.Vache.Strong) + (Round_cache_key) diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_commands.ml b/src/proto_016_PtMumbai/lib_delegate/baking_commands.ml new file mode 100644 index 000000000000..9d76b8745fff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_commands.ml @@ -0,0 +1,416 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Client_proto_args + +let pidfile_arg = + Tezos_clic.arg + ~doc:"write process id in file" + ~short:'P' + ~long:"pidfile" + ~placeholder:"filename" + (Tezos_clic.parameter (fun _ s -> return s)) + +let may_lock_pidfile pidfile_opt f = + match pidfile_opt with + | None -> f () + | Some pidfile -> + Lwt_lock_file.try_with_lock + ~when_locked:(fun () -> + failwith "Failed to create the pidfile: %s" pidfile) + ~filename:pidfile + f + +let http_headers_env_variable = + "TEZOS_CLIENT_REMOTE_OPERATIONS_POOL_HTTP_HEADERS" + +let http_headers = + match Sys.getenv_opt http_headers_env_variable with + | None -> None + | Some contents -> + let lines = String.split_on_char '\n' contents in + Some + (List.fold_left + (fun acc line -> + match String.index_opt line ':' with + | None -> + invalid_arg + (Printf.sprintf + "Http headers: invalid %s environment variable, missing \ + colon" + http_headers_env_variable) + | Some pos -> + let header = String.trim (String.sub line 0 pos) in + let header = String.lowercase_ascii header in + if header <> "host" then + invalid_arg + (Printf.sprintf + "Http headers: invalid %s environment variable, only \ + 'host' headers are supported" + http_headers_env_variable) ; + let value = + String.trim + (String.sub line (pos + 1) (String.length line - pos - 1)) + in + (header, value) :: acc) + [] + lines) + +let operations_arg = + Tezos_clic.arg + ~long:"operations-pool" + ~placeholder:"file|uri" + ~doc: + (Printf.sprintf + "When specified, the baker will try to fetch operations from this \ + file (or uri) and to include retrieved operations in the block. The \ + expected format of the contents is a list of operations [ \ + alpha.operation ]. Environment variable '%s' may also be specified \ + to add headers to the requests (only 'host' headers are supported). \ + If the resource cannot be retrieved, e.g., if the file is absent, \ + unreadable, or the web service returns a 404 error, the resource is \ + simply ignored." + http_headers_env_variable) + (Tezos_clic.map_parameter + ~f:(fun uri -> + let open Baking_configuration in + match Uri.scheme uri with + | Some "http" | Some "https" -> + Operations_source.(Remote {uri; http_headers}) + | None | Some _ -> + (* acts as if it were file even though it might no be *) + Operations_source.(Local {filename = Uri.to_string uri})) + uri_parameter) + +let context_path_arg = + Tezos_clic.arg + ~long:"context" + ~placeholder:"path" + ~doc: + "When specified, the client will read in the local context at the \ + provided path in order to build the block, instead of relying on the \ + 'preapply' RPC." + string_parameter + +let endorsement_force_switch_arg = + Tezos_clic.switch + ~long:"force" + ~short:'f' + ~doc: + "Disable consistency, injection and double signature checks for \ + (pre)endorsements." + () + +let do_not_monitor_node_mempool_arg = + Tezos_clic.switch + ~long:"ignore-node-mempool" + ~doc: + "Ignore mempool operations from the node and do not subsequently monitor \ + them. Use in conjunction with --operations option to restrict the \ + observed operations to those of the mempool file." + () + +let keep_alive_arg = + Tezos_clic.switch + ~doc: + "Keep the daemon process alive: when the connection with the node is \ + lost, the daemon periodically tries to reach it." + ~short:'K' + ~long:"keep-alive" + () + +let liquidity_baking_toggle_vote_parameter = + Tezos_clic.parameter + ~autocomplete:(fun _ctxt -> return ["on"; "off"; "pass"]) + (let open Protocol.Alpha_context.Liquidity_baking in + fun _ctxt -> function + | "on" -> return LB_on + | "off" -> return LB_off + | "pass" -> return LB_pass + | s -> + failwith + "unexpected vote: %s, expected either \"on\", \"off\", or \"pass\"." + s) + +let liquidity_baking_toggle_vote_arg = + Tezos_clic.arg + ~doc: + "Vote to continue or end the liquidity baking subsidy. The possible \ + values for this option are: \"off\" to request ending the subsidy, \ + \"on\" to request continuing or restarting the subsidy, and \"pass\" to \ + abstain. Note that this \"option\" is mandatory!" + ~long:"liquidity-baking-toggle-vote" + ~placeholder:"vote" + liquidity_baking_toggle_vote_parameter + +let get_delegates (cctxt : Protocol_client_context.full) + (pkhs : Tezos_crypto.Signature.public_key_hash list) = + let proj_delegate (alias, public_key_hash, public_key, secret_key_uri) = + { + Baking_state.alias = Some alias; + public_key_hash; + public_key; + secret_key_uri; + } + in + (if pkhs = [] then + Client_keys.get_keys cctxt >>=? fun keys -> + List.map proj_delegate keys |> return + else + List.map_es + (fun pkh -> + Client_keys.get_key cctxt pkh >>=? function + | alias, pk, sk_uri -> return (proj_delegate (alias, pkh, pk, sk_uri))) + pkhs) + >>=? fun delegates -> + Tezos_signer_backends.Encrypted.decrypt_list + cctxt + (List.filter_map + (function + | {Baking_state.alias = Some alias; _} -> Some alias | _ -> None) + delegates) + >>=? fun () -> + let delegates_no_duplicates = List.sort_uniq compare delegates in + (if List.compare_lengths delegates delegates_no_duplicates <> 0 then + cctxt#warning + "Warning: the list of public key hash aliases contains duplicate hashes, \ + which are ignored" + else Lwt.return ()) + >>= fun () -> return delegates_no_duplicates + +let sources_param = + Tezos_clic.seq_of_param + (Client_keys.Public_key_hash.source_param + ~name:"baker" + ~desc: + "name of the delegate owning the endorsement/baking right or name of \ + the consensus key signing on the delegate's behalf") + +let delegate_commands () : Protocol_client_context.full Tezos_clic.command list + = + let open Tezos_clic in + let group = + {name = "delegate.client"; title = "Tenderbake client commands"} + in + [ + command + ~group + ~desc:"Forge and inject block using the delegates' rights." + (args8 + minimal_fees_arg + minimal_nanotez_per_gas_unit_arg + minimal_nanotez_per_byte_arg + minimal_timestamp_switch + force_switch + operations_arg + context_path_arg + do_not_monitor_node_mempool_arg) + (prefixes ["bake"; "for"] @@ sources_param) + (fun ( minimal_fees, + minimal_nanotez_per_gas_unit, + minimal_nanotez_per_byte, + minimal_timestamp, + force, + extra_operations, + context_path, + do_not_monitor_node_mempool ) + pkhs + cctxt -> + get_delegates cctxt pkhs >>=? fun delegates -> + Baking_lib.bake + cctxt + ~minimal_nanotez_per_gas_unit + ~minimal_timestamp + ~minimal_nanotez_per_byte + ~minimal_fees + ~force + ~monitor_node_mempool:(not do_not_monitor_node_mempool) + ?extra_operations + ?context_path + delegates); + command + ~group + ~desc:"Forge and inject an endorsement operation." + (args1 endorsement_force_switch_arg) + (prefixes ["endorse"; "for"] @@ sources_param) + (fun force pkhs cctxt -> + get_delegates cctxt pkhs >>=? fun delegates -> + Baking_lib.endorse ~force cctxt delegates); + command + ~group + ~desc:"Forge and inject a preendorsement operation." + (args1 endorsement_force_switch_arg) + (prefixes ["preendorse"; "for"] @@ sources_param) + (fun force pkhs cctxt -> + get_delegates cctxt pkhs >>=? fun delegates -> + Baking_lib.preendorse ~force cctxt delegates); + command + ~group + ~desc:"Send a Tenderbake proposal" + (args7 + minimal_fees_arg + minimal_nanotez_per_gas_unit_arg + minimal_nanotez_per_byte_arg + minimal_timestamp_switch + force_switch + operations_arg + context_path_arg) + (prefixes ["propose"; "for"] @@ sources_param) + (fun ( minimal_fees, + minimal_nanotez_per_gas_unit, + minimal_nanotez_per_byte, + minimal_timestamp, + force, + extra_operations, + context_path ) + sources + cctxt -> + get_delegates cctxt sources >>=? fun delegates -> + Baking_lib.propose + cctxt + ~minimal_nanotez_per_gas_unit + ~minimal_timestamp + ~minimal_nanotez_per_byte + ~minimal_fees + ~force + ?extra_operations + ?context_path + delegates); + ] + +let directory_parameter = + Tezos_clic.parameter (fun _ p -> + if not (Sys.file_exists p && Sys.is_directory p) then + failwith "Directory doesn't exist: '%s'" p + else return p) + +let per_block_vote_file_arg = + Tezos_clic.arg + ~doc:"read per block votes as json file" + ~short:'V' + ~long:"votefile" + ~placeholder:"filename" + (Tezos_clic.parameter (fun _ s -> return s)) + +let baker_commands () : Protocol_client_context.full Tezos_clic.command list = + let open Tezos_clic in + let group = + { + Tezos_clic.name = "delegate.baker"; + title = "Commands related to the baker daemon."; + } + in + [ + command + ~group + ~desc:"Launch the baker daemon." + (args8 + pidfile_arg + minimal_fees_arg + minimal_nanotez_per_gas_unit_arg + minimal_nanotez_per_byte_arg + keep_alive_arg + liquidity_baking_toggle_vote_arg + per_block_vote_file_arg + operations_arg) + (prefixes ["run"; "with"; "local"; "node"] + @@ param + ~name:"node_data_path" + ~desc:"Path to the node data directory (e.g. $HOME/.tezos-node)" + directory_parameter + @@ sources_param) + (fun ( pidfile, + minimal_fees, + minimal_nanotez_per_gas_unit, + minimal_nanotez_per_byte, + keep_alive, + liquidity_baking_toggle_vote, + per_block_vote_file, + extra_operations ) + node_data_path + sources + cctxt -> + let per_block_vote_file_or_default = + match per_block_vote_file with + | None -> Baking_configuration.default_per_block_vote_file + | Some arg -> arg + in + (* We don't let the user run the baker without providing some option (CLI, file path, or file in default location) for the toggle vote. *) + Liquidity_baking_vote_file.read_liquidity_baking_toggle_vote_on_startup + ~default:liquidity_baking_toggle_vote + ~per_block_vote_file:per_block_vote_file_or_default + >>=? fun (liquidity_baking_toggle_vote, vote_file_present) -> + let per_block_vote_file = + match (per_block_vote_file, vote_file_present) with + | Some _, _ | None, true -> Some per_block_vote_file_or_default + | None, false -> None + in + may_lock_pidfile pidfile @@ fun () -> + get_delegates cctxt sources >>=? fun delegates -> + let context_path = Filename.Infix.(node_data_path // "context") in + Client_daemon.Baker.run + cctxt + ~minimal_fees + ~minimal_nanotez_per_gas_unit + ~minimal_nanotez_per_byte + ~liquidity_baking_toggle_vote + ?per_block_vote_file + ?extra_operations + ~chain:cctxt#chain + ~context_path + ~keep_alive + delegates); + command + ~group + ~desc:"Launch the VDF daemon" + (* no_options *) + (args1 keep_alive_arg) + (prefixes ["run"; "vdf"] @@ stop) + (fun keep_alive cctxt -> + Client_daemon.VDF.run cctxt ~chain:cctxt#chain ~keep_alive); + ] + +let accuser_commands () = + let open Tezos_clic in + let group = + { + Tezos_clic.name = "delegate.accuser"; + title = "Commands related to the accuser daemon."; + } + in + [ + command + ~group + ~desc:"Launch the accuser daemon" + (args3 pidfile_arg Client_proto_args.preserved_levels_arg keep_alive_arg) + (prefixes ["run"] @@ stop) + (fun (pidfile, preserved_levels, keep_alive) cctxt -> + may_lock_pidfile pidfile @@ fun () -> + Client_daemon.Accuser.run + cctxt + ~chain:cctxt#chain + ~preserved_levels + ~keep_alive); + ] diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_commands.mli b/src/proto_016_PtMumbai/lib_delegate/baking_commands.mli new file mode 100644 index 000000000000..02e2819da4b9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_commands.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val delegate_commands : + unit -> Protocol_client_context.full Tezos_clic.command list + +val baker_commands : + unit -> Protocol_client_context.full Tezos_clic.command list + +val accuser_commands : + unit -> Protocol_client_context.full Tezos_clic.command list diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_commands_registration.ml b/src/proto_016_PtMumbai/lib_delegate/baking_commands_registration.ml new file mode 100644 index 000000000000..7a1b3cd90c68 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_commands_registration.ml @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let () = + Client_commands.register Protocol.hash @@ fun _network -> + List.map (Tezos_clic.map_command (new Protocol_client_context.wrap_full)) + @@ Baking_commands.delegate_commands () diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_configuration.ml b/src/proto_016_PtMumbai/lib_delegate/baking_configuration.ml new file mode 100644 index 000000000000..db13c684bf3c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_configuration.ml @@ -0,0 +1,317 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Operations_source = struct + type t = + | Local of {filename : string} + | Remote of {uri : Uri.t; http_headers : (string * string) list option} + + let pp ppf = function + | Local {filename} -> Format.pp_print_string ppf filename + | Remote {uri; _} -> Format.fprintf ppf "%a" Uri.pp uri + + let encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + (Tag 1) + ~title:"Local" + (obj2 (req "filename" string) (req "kind" (constant "Local"))) + (function Local {filename} -> Some (filename, ()) | _ -> None) + (fun (filename, ()) -> Local {filename}); + case + (Tag 2) + ~title:"Remote" + (obj3 + (req "uri" string) + (opt "http_headers" (list (tup2 string string))) + (req "kind" (constant "Remote"))) + (function + | Remote {uri; http_headers} -> + Some (Uri.to_string uri, http_headers, ()) + | _ -> None) + (fun (uri_str, http_headers, ()) -> + Remote {uri = Uri.of_string uri_str; http_headers}); + ] +end + +open Protocol.Alpha_context + +type fees_config = { + minimal_fees : Tez.t; + minimal_nanotez_per_gas_unit : Q.t; + minimal_nanotez_per_byte : Q.t; +} + +type validation_config = + | Local of {context_path : string} + | Node + | ContextIndex of Abstract_context_index.t + +type nonce_config = Deterministic | Random + +type state_recorder_config = Filesystem | Disabled + +type t = { + fees : fees_config; + nonce : nonce_config; + validation : validation_config; + retries_on_failure : int; + user_activated_upgrades : (int32 * Tezos_crypto.Protocol_hash.t) list; + liquidity_baking_toggle_vote : + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote; + per_block_vote_file : string option; + force : bool; + state_recorder : state_recorder_config; + extra_operations : Operations_source.t option; +} + +let default_fees_config = + { + minimal_fees = + (match Tez.of_mutez 100L with None -> assert false | Some t -> t); + minimal_nanotez_per_gas_unit = Q.of_int 100; + minimal_nanotez_per_byte = Q.of_int 1000; + } + +let default_validation_config = Node + +(* Unclear if determinist nonces, and more importantly, if + [supports_deterministic_nonces] is supported. *) +let default_nonce_config = Random + +let default_retries_on_failure_config = 5 + +let default_user_activated_upgrades = [] + +let default_liquidity_baking_toggle_vote = + Protocol.Alpha_context.Liquidity_baking.LB_pass + +let default_force = false + +let default_state_recorder_config = Filesystem + +let default_extra_operations = None + +let default_per_block_vote_file = "per_block_votes.json" + +let default_config = + { + fees = default_fees_config; + nonce = default_nonce_config; + validation = default_validation_config; + retries_on_failure = default_retries_on_failure_config; + user_activated_upgrades = default_user_activated_upgrades; + liquidity_baking_toggle_vote = default_liquidity_baking_toggle_vote; + force = default_force; + state_recorder = default_state_recorder_config; + extra_operations = default_extra_operations; + per_block_vote_file = None; + } + +let make ?(minimal_fees = default_fees_config.minimal_fees) + ?(minimal_nanotez_per_gas_unit = + default_fees_config.minimal_nanotez_per_gas_unit) + ?(minimal_nanotez_per_byte = default_fees_config.minimal_nanotez_per_byte) + ?(nonce = default_nonce_config) ?context_path + ?(retries_on_failure = default_retries_on_failure_config) + ?(user_activated_upgrades = default_user_activated_upgrades) + ?(liquidity_baking_toggle_vote = default_liquidity_baking_toggle_vote) + ?per_block_vote_file ?(force = default_force) + ?(state_recorder = default_state_recorder_config) ?extra_operations () = + let fees = + {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte} + in + let validation = + match context_path with + | None -> Node + | Some context_path -> Local {context_path} + in + { + fees; + validation; + nonce; + retries_on_failure; + user_activated_upgrades; + liquidity_baking_toggle_vote; + per_block_vote_file; + force; + state_recorder; + extra_operations; + } + +let fees_config_encoding : fees_config Data_encoding.t = + let open Data_encoding in + let q_encoding = + conv (fun q -> Q.to_string q) (fun s -> Q.of_string s) string + in + conv + (fun {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte} -> + (minimal_fees, minimal_nanotez_per_gas_unit, minimal_nanotez_per_byte)) + (fun (minimal_fees, minimal_nanotez_per_gas_unit, minimal_nanotez_per_byte) -> + {minimal_fees; minimal_nanotez_per_gas_unit; minimal_nanotez_per_byte}) + (obj3 + (req "minimal_fees" Tez.encoding) + (req "minimal_nanotez_per_gas_unit" q_encoding) + (req "minimal_nanotez_per_byte" q_encoding)) + +let validation_config_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Local" + (Tag 0) + (obj1 (req "local" string)) + (function Local {context_path} -> Some context_path | _ -> None) + (fun context_path -> Local {context_path}); + case + ~title:"Node" + (Tag 1) + (constant "node") + (function Node -> Some () | _ -> None) + (fun () -> Node); + ] + +let nonce_config_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Deterministic" + (Tag 0) + (constant "deterministic") + (function Deterministic -> Some () | _ -> None) + (fun () -> Deterministic); + case + ~title:"Random" + (Tag 1) + (constant "Random") + (function Random -> Some () | _ -> None) + (fun () -> Random); + ] + +let retries_on_failure_config_encoding = Data_encoding.int31 + +let user_activate_upgrades_config_encoding = + let open Data_encoding in + list (tup2 int32 Tezos_crypto.Protocol_hash.encoding) + +let liquidity_baking_toggle_vote_config_encoding = + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote_encoding + +let force_config_encoding = Data_encoding.bool + +let state_recorder_config_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Filesystem" + (Tag 0) + (constant "filesystem") + (function Filesystem -> Some () | _ -> None) + (fun () -> Filesystem); + case + ~title:"Disabled" + (Tag 1) + (constant "disabled") + (function Disabled -> Some () | _ -> None) + (fun () -> Disabled); + ] + +let encoding : t Data_encoding.t = + let open Data_encoding in + def + (String.concat "." [Protocol.name; "baking_configuration"]) + ~title:"Baking configuration" + ~description:"Baking configuration" + @@ conv + (fun { + fees; + validation; + nonce; + retries_on_failure; + user_activated_upgrades; + liquidity_baking_toggle_vote; + per_block_vote_file; + force; + state_recorder; + extra_operations; + } -> + ( fees, + validation, + nonce, + retries_on_failure, + user_activated_upgrades, + liquidity_baking_toggle_vote, + per_block_vote_file, + force, + state_recorder, + extra_operations )) + (fun ( fees, + validation, + nonce, + retries_on_failure, + user_activated_upgrades, + liquidity_baking_toggle_vote, + per_block_vote_file, + force, + state_recorder, + extra_operations ) -> + { + fees; + validation; + nonce; + retries_on_failure; + user_activated_upgrades; + liquidity_baking_toggle_vote; + per_block_vote_file; + force; + state_recorder; + extra_operations; + }) + (obj10 + (req "fees" fees_config_encoding) + (req "validation" validation_config_encoding) + (req "nonce" nonce_config_encoding) + (req "retries_on_failure" retries_on_failure_config_encoding) + (req "user_activated_upgrades" user_activate_upgrades_config_encoding) + (req + "liquidity_baking_toggle_vote" + liquidity_baking_toggle_vote_config_encoding) + (opt "per_block_vote_file" Data_encoding.string) + (req "force" force_config_encoding) + (req "state_recorder" state_recorder_config_encoding) + (opt "extra_operations" Operations_source.encoding)) + +let pp fmt t = + let json = Data_encoding.Json.construct encoding t in + Format.fprintf fmt "%a" Data_encoding.Json.pp json diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_configuration.mli b/src/proto_016_PtMumbai/lib_delegate/baking_configuration.mli new file mode 100644 index 000000000000..cd5b5a445f41 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_configuration.mli @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +(** {1 Operations_source abstraction} *) +module Operations_source : sig + type t = + | Local of {filename : string} + (** local mempool resource located in [filename] *) + | Remote of {uri : Uri.t; http_headers : (string * string) list option} + (** remote resource located a [uri], with additional [http_headers] + parameters *) + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +type fees_config = { + minimal_fees : Protocol.Alpha_context.Tez.t; + minimal_nanotez_per_gas_unit : Q.t; + minimal_nanotez_per_byte : Q.t; +} + +type validation_config = + | Local of {context_path : string} + | Node + | ContextIndex of Abstract_context_index.t + +type nonce_config = Deterministic | Random + +type state_recorder_config = Filesystem | Disabled + +type t = { + fees : fees_config; + nonce : nonce_config; + validation : validation_config; + retries_on_failure : int; + user_activated_upgrades : (int32 * Tezos_crypto.Protocol_hash.t) list; + liquidity_baking_toggle_vote : + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote; + per_block_vote_file : string option; + force : bool; + state_recorder : state_recorder_config; + extra_operations : Operations_source.t option; +} + +val default_fees_config : fees_config + +val default_validation_config : validation_config + +val default_nonce_config : nonce_config + +val default_retries_on_failure_config : int + +val default_user_activated_upgrades : + (int32 * Tezos_crypto.Protocol_hash.t) list + +val default_liquidity_baking_toggle_vote : + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote + +val default_force : bool + +val default_state_recorder_config : state_recorder_config + +val default_extra_operations : Operations_source.t option + +val default_per_block_vote_file : string + +val default_config : t + +val make : + ?minimal_fees:Protocol.Alpha_context.Tez.t -> + ?minimal_nanotez_per_gas_unit:Q.t -> + ?minimal_nanotez_per_byte:Q.t -> + ?nonce:nonce_config -> + ?context_path:string -> + ?retries_on_failure:int -> + ?user_activated_upgrades:(int32 * Tezos_crypto.Protocol_hash.t) list -> + ?liquidity_baking_toggle_vote: + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote -> + ?per_block_vote_file:string -> + ?force:bool -> + ?state_recorder:state_recorder_config -> + ?extra_operations:Operations_source.t -> + unit -> + t + +val fees_config_encoding : fees_config Data_encoding.t + +val validation_config_encoding : validation_config Data_encoding.t + +val nonce_config_encoding : nonce_config Data_encoding.t + +val retries_on_failure_config_encoding : int Data_encoding.t + +val user_activate_upgrades_config_encoding : + (int32 * Tezos_crypto.Protocol_hash.t) list Data_encoding.t + +val liquidity_baking_toggle_vote_config_encoding : + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote + Data_encoding.t + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_errors.ml b/src/proto_016_PtMumbai/lib_delegate/baking_errors.ml new file mode 100644 index 000000000000..0332e0b7e510 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_errors.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Cannot_open_context_index of {context_path : string} + +type error += Node_connection_lost + +type error += Cannot_load_local_file of string + +let make_id id = String.concat "." [Protocol.name; id] + +let () = + Error_monad.register_error_kind + `Temporary + ~id:(make_id "cannot_open_context_index") + ~title:"Cannot open context index" + ~description:"Failed to open the context index at the given location" + ~pp:(fun fmt path -> + Format.fprintf fmt "Cannot open context index at %s" path) + Data_encoding.(obj1 (req "cannot_open_context_index" Data_encoding.string)) + (function + | Cannot_open_context_index {context_path} -> Some context_path + | _ -> None) + (fun context_path -> Cannot_open_context_index {context_path}) ; + register_error_kind + `Temporary + ~id:(make_id "baking_scheduling.node_connection_lost") + ~title:"Node connection lost" + ~description:"The connection with the node was lost." + ~pp:(fun fmt () -> Format.fprintf fmt "Lost connection with the node") + Data_encoding.empty + (function Node_connection_lost -> Some () | _ -> None) + (fun () -> Node_connection_lost) ; + register_error_kind + `Temporary + ~id:(make_id "baking_scheduling.cannot_load_local_file") + ~title:"Cannot load local file" + ~description:"Cannot load local file." + ~pp:(fun fmt filename -> + Format.fprintf fmt "Cannot load the local file %s" filename) + Data_encoding.(obj1 (req "file" string)) + (function Cannot_load_local_file s -> Some s | _ -> None) + (fun s -> Cannot_load_local_file s) diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_events.ml b/src/proto_016_PtMumbai/lib_delegate/baking_events.ml new file mode 100644 index 000000000000..2f1383b08951 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_events.ml @@ -0,0 +1,932 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let section = [Protocol.name; "baker"] + +let pp_int32 fmt n = Format.fprintf fmt "%ld" n + +let pp_int64 fmt n = Format.fprintf fmt "%Ld" n + +module State_transitions = struct + include Internal_event.Simple + + let section = section @ ["transitions"] + + let new_head = + declare_3 + ~section + ~name:"new_head" + ~level:Notice + ~msg:"received new head {block} at level {level}, round {round}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block", Tezos_crypto.Block_hash.encoding) + ~pp2:pp_int32 + ("level", Data_encoding.int32) + ~pp3:Round.pp + ("round", Round.encoding) + + let new_head_with_increasing_level = + declare_0 + ~section + ~name:"new_head_with_increasing_level" + ~level:Info + ~msg:"received new head with level increasing" + () + + let no_proposal_slot = + declare_3 + ~section + ~name:"no_proposal_slot" + ~level:Info + ~msg: + "end of round {current_round}; no proposal slot at level {level}, \ + round {next_round}" + ~pp1:Round.pp + ("current_round", Round.encoding) + ~pp2:pp_int32 + ("level", Data_encoding.int32) + ~pp3:Round.pp + ("next_round", Round.encoding) + + let proposal_slot = + declare_4 + ~section + ~name:"proposal_slot" + ~level:Info + ~msg: + "end of round {current_round}; proposal slot at level {level}, round \ + {next_round} for {delegate}" + ~pp1:Round.pp + ("current_round", Round.encoding) + ~pp2:pp_int32 + ("level", Data_encoding.int32) + ~pp3:Round.pp + ("next_round", Round.encoding) + ~pp4:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let new_head_while_waiting_for_qc = + declare_0 + ~section + ~name:"new_head_while_waiting_for_qc" + ~level:Info + ~msg:"received new head while waiting for a quorum" + () + + let unexpected_proposal_round = + declare_2 + ~section + ~name:"unexpected_proposal_round" + ~level:Info + ~msg: + "unexpected proposal round, expected: {expected_round}, got: \ + {proposal_round}" + ~pp1:Round.pp + ("expected_round", Round.encoding) + ~pp2:Round.pp + ("proposal_round", Round.encoding) + + let proposal_for_round_already_seen = + declare_3 + ~section + ~name:"proposal_for_round_already_seen" + ~level:Warning + ~msg: + "proposal {new_proposal} for current round ({current_round}) has \ + already been seen {previous_proposal}" + ~pp1:Tezos_crypto.Block_hash.pp + ("new_proposal", Tezos_crypto.Block_hash.encoding) + ~pp2:Round.pp + ("current_round", Round.encoding) + ~pp3:Tezos_crypto.Block_hash.pp + ("previous_proposal", Tezos_crypto.Block_hash.encoding) + + let updating_latest_proposal = + declare_1 + ~section + ~name:"updating_latest_proposal" + ~msg:"updating latest proposal to {block_hash}" + ~level:Info + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) + + let baker_is_ahead_of_node = + declare_2 + ~section + ~name:"baker_is_ahead" + ~level:Info + ~msg: + "baker (level: {baker_level}) is ahead of the node (level: \ + {node_level})" + ~pp1:pp_int32 + ("baker_level", Data_encoding.int32) + ~pp2:pp_int32 + ("node_level", Data_encoding.int32) + + let new_proposal_is_on_another_branch = + declare_2 + ~section + ~name:"new_proposal_is_on_another_branch" + ~level:Info + ~msg: + "received a proposal on another branch - current: current \ + pred{current_branch}, new pred {new_branch}" + ~pp1:Tezos_crypto.Block_hash.pp + ("current_branch", Tezos_crypto.Block_hash.encoding) + ~pp2:Tezos_crypto.Block_hash.pp + ("new_branch", Tezos_crypto.Block_hash.encoding) + + let switching_branch = + declare_0 + ~section + ~name:"switching_branch" + ~level:Info + ~msg:"switching branch" + () + + let branch_proposal_has_better_fitness = + declare_0 + ~section + ~name:"branch_proposal_has_better_fitness" + ~level:Info + ~msg:"different branch proposal has a better fitness than us" + () + + let branch_proposal_has_no_prequorum = + declare_0 + ~section + ~name:"branch_proposal_has_no_prequorum" + ~level:Info + ~msg:"different branch proposal has no prequorum but we do" + () + + let branch_proposal_has_lower_prequorum = + declare_0 + ~section + ~name:"branch_proposal_has_lower_prequorum" + ~level:Info + ~msg:"different branch proposal has a lower prequorum than us" + () + + let branch_proposal_has_better_prequorum = + declare_0 + ~section + ~name:"branch_proposal_has_better_prequorum" + ~level:Info + ~msg:"different branch proposal has a better prequorum" + () + + let branch_proposal_has_same_prequorum = + declare_0 + ~section + ~name:"branch_proposal_has_same_prequorum" + ~level:Error + ~msg:"different branch proposal has the same prequorum" + () + + let attempting_preendorse_proposal = + declare_1 + ~section + ~name:"attempting_preendorsing_proposal" + ~level:Info + ~msg:"attempting to preendorse proposal {block_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) + + let skipping_invalid_proposal = + declare_0 + ~section + ~name:"skipping_invalid_proposal" + ~level:Info + ~msg:"invalid proposal, skipping" + () + + let outdated_proposal = + declare_1 + ~section + ~name:"outdated_proposal" + ~level:Debug + ~msg:"outdated proposal {block_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) + + let proposing_fresh_block = + declare_2 + ~section + ~name:"proposing_fresh_block" + ~level:Info + ~msg:"proposing fresh block for {delegate} at round {round}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + ~pp2:Round.pp + ("round", Round.encoding) + + let no_endorsable_payload_fresh_block = + declare_0 + ~section + ~name:"no_endorsable_payload_fresh_block" + ~level:Info + ~msg:"no endorsable payload, proposing fresh block" + () + + let repropose_block = + declare_1 + ~section + ~name:"repropose_block" + ~level:Info + ~msg:"repropose block with payload {payload}" + ~pp1:Block_payload_hash.pp + ("payload", Block_payload_hash.encoding) + + let unexpected_prequorum_received = + declare_2 + ~section + ~name:"unexpected_prequorum_received" + ~level:Info + ~msg: + "unexpected prequorum received for {received_hash} instead of \ + {expected_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("received_hash", Tezos_crypto.Block_hash.encoding) + ~pp2:Tezos_crypto.Block_hash.pp + ("expected_hash", Tezos_crypto.Block_hash.encoding) + + let unexpected_quorum_received = + declare_2 + ~section + ~name:"unexpected_quorum_received" + ~level:Info + ~msg: + "unexpected quorum received for {received_hash} instead of \ + {expected_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("received_hash", Tezos_crypto.Block_hash.encoding) + ~pp2:Tezos_crypto.Block_hash.pp + ("expected_hash", Tezos_crypto.Block_hash.encoding) + + let step_current_phase = + declare_2 + ~section + ~name:"step_current_phase" + ~level:Debug + ~msg:"automaton step: current phase {phase}, event {event}" + ~pp1:Baking_state.pp_phase + ("phase", Baking_state.phase_encoding) + ~pp2:Baking_state.pp_event + ("event", Baking_state.event_encoding) +end + +module Node_rpc = struct + include Internal_event.Simple + + let section = section @ ["rpc"] + + let error_while_monitoring_heads = + declare_1 + ~section + ~name:"error_while_monitoring_heads" + ~level:Error + ~msg:"error while monitoring heads {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let raw_info = + declare_2 + ~section + ~name:"raw_info" + ~level:Debug + ~msg:"raw info for {block_hash} at level {level}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) + ~pp2:pp_int32 + ("level", Data_encoding.int32) +end + +module Scheduling = struct + include Internal_event.Simple + + let section = section @ ["scheduling"] + + let error_while_baking = + declare_1 + ~section + ~name:"error_while_baking" + ~level:Warning + ~msg:"error while baking {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let waiting_for_new_head = + declare_0 + ~section + ~name:"waiting_for_new_head" + ~level:Info + ~msg:"no possible timeout, waiting for a new head to arrive..." + () + + let compute_next_timeout_elected_block = + declare_2 + ~section + ~name:"compute_next_timeout_elected_block" + ~level:Debug + ~msg: + "found an elected block at level {level}, round {round}... checking \ + baking rights" + ~pp1:pp_int32 + ("level", Data_encoding.int32) + ~pp2:Round.pp + ("round", Round.encoding) + + let proposal_already_injected = + declare_0 + ~section + ~name:"proposal_already_injected" + ~level:Debug + ~msg:"proposal already injected for next level, skipping..." + () + + let next_potential_slot = + declare_4 + ~section + ~name:"next_potential_slot" + ~level:Info + ~msg: + "next potential slot for level {level} is at round {round} at \ + {timestamp} for {delegate}" + ~pp1:pp_int32 + ("level", Data_encoding.int32) + ~pp2:Round.pp + ("round", Round.encoding) + ~pp3:Timestamp.pp + ("timestamp", Timestamp.encoding) + ~pp4:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let waiting_end_of_round = + declare_3 + ~section + ~name:"waiting_end_of_round" + ~level:Info + ~msg:"waiting {timespan} until end of round {round} at {timestamp}" + ~pp1:Ptime.Span.pp + ("timespan", Time.System.Span.encoding) + ~pp2:pp_int32 + ("round", Data_encoding.int32) + ~pp3:Timestamp.pp + ("timestamp", Timestamp.encoding) + + let waiting_delayed_end_of_round = + declare_4 + ~section + ~name:"waiting_delayed_end_of_round" + ~level:Info + ~msg: + "waiting {timespan} until {timestamp} (end of round {round} plus \ + {delay}s delay)" + ~pp1:Ptime.Span.pp + ("timespan", Time.System.Span.encoding) + ~pp2:pp_int32 + ("round", Data_encoding.int32) + ~pp3:Timestamp.pp + ("timestamp", Timestamp.encoding) + ~pp4:pp_int64 + ("delay", Data_encoding.int64) + + let waiting_time_to_bake = + declare_2 + ~section + ~name:"waiting_time_to_bake" + ~level:Info + ~msg:"waiting {timespan} until it's time to bake at {timestamp}" + ~pp1:Ptime.Span.pp + ("timespan", Time.System.Span.encoding) + ~pp2:Timestamp.pp + ("timestamp", Timestamp.encoding) + + let no_need_to_wait_for_proposal = + declare_0 + ~section + ~name:"no_need_to_wait_for_proposal" + ~level:Info + ~msg:"no need to wait to propose a block" + () + + let state_synchronized_to_round = + declare_1 + ~section + ~name:"state_synchronized_to_round" + ~level:Debug + ~msg:"state synchronized to round {round}" + ~pp1:Round.pp + ("round", Round.encoding) + + let proposal_in_the_future = + declare_1 + ~section + ~name:"proposal_in_the_future" + ~level:Debug + ~msg:"received proposal in the future {block_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) + + let process_proposal_in_the_future = + declare_1 + ~section + ~name:"process_proposal_in_the_future" + ~level:Debug + ~msg:"process proposal received in the future with hash {block_hash}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block_hash", Tezos_crypto.Block_hash.encoding) +end + +module Lib = struct + include Internal_event.Simple + + let section = section @ ["lib"] + + let attempting_preendorse_proposal = + declare_1 + ~section + ~name:"attempting_preendorsing_proposal" + ~level:Debug + ~msg:"attempting to preendorse proposal {proposal}" + ~pp1:Baking_state.pp_proposal + ("proposal", Baking_state.proposal_encoding) + + let attempting_endorse_proposal = + declare_1 + ~section + ~name:"attempting_endorsing_proposal" + ~level:Debug + ~msg:"attempting to endorse proposal {proposal}" + ~pp1:Baking_state.pp_proposal + ("proposal", Baking_state.proposal_encoding) +end + +module Actions = struct + include Internal_event.Simple + + let section = section @ ["actions"] + + let skipping_preendorsement = + declare_2 + ~section + ~name:"skipping_preendorsement" + ~level:Error + ~msg:"skipping preendorsement for {delegate} -- {trace}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + ~pp2:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let skipping_endorsement = + declare_2 + ~section + ~name:"skipping_endorsement" + ~level:Error + ~msg:"skipping endorsement for {delegate} -- {trace}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + ~pp2:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let failed_to_inject_preendorsement = + declare_2 + ~section + ~name:"failed_to_inject_preendorsement" + ~level:Error + ~msg:"failed to inject preendorsement for {delegate} -- {trace}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + ~pp2:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let potential_double_baking = + declare_2 + ~section + ~name:"potential_double_baking" + ~level:Warning + ~msg:"potential double baking detected at level {level}, round {round}" + ~pp1:pp_int32 + ~pp2:Round.pp + ("level", Data_encoding.int32) + ("round", Round.encoding) + + let preendorsement_injected = + declare_2 + ~section + ~name:"preendorsement_injected" + ~level:Notice + ~msg:"injected preendorsement {ophash} for {delegate}" + ~pp1:Tezos_crypto.Operation_hash.pp + ("ophash", Tezos_crypto.Operation_hash.encoding) + ~pp2:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let endorsement_injected = + declare_2 + ~section + ~name:"endorsement_injected" + ~level:Notice + ~msg:"injected endorsement {ophash} for {delegate}" + ~pp1:Tezos_crypto.Operation_hash.pp + ("ophash", Tezos_crypto.Operation_hash.encoding) + ~pp2:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let synchronizing_round = + declare_1 + ~section + ~name:"synchronizing_round" + ~level:Info + ~msg:"synchronizing round after block {block}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block", Tezos_crypto.Block_hash.encoding) + + let forging_block = + declare_3 + ~section + ~name:"forging_block" + ~level:Info + ~msg:"forging block at level {level}, round {round} for {delegate}" + ~pp1:pp_int32 + ~pp2:Round.pp + ~pp3:Baking_state.pp_consensus_key_and_delegate + ("level", Data_encoding.int32) + ("round", Round.encoding) + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let injecting_block = + declare_3 + ~section + ~name:"injecting_block" + ~level:Debug + ~msg:"injecting block at level {level}, round {round} for {delegate}" + ~pp1:pp_int32 + ~pp2:Round.pp + ~pp3:Baking_state.pp_consensus_key_and_delegate + ("level", Data_encoding.int32) + ("round", Round.encoding) + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let block_injected = + declare_4 + ~section + ~name:"block_injected" + ~level:Notice + ~msg: + "block {block} at level {level}, round {round} injected for {delegate}" + ~pp1:Tezos_crypto.Block_hash.pp + ~pp2:pp_int32 + ~pp3:Round.pp + ~pp4:Baking_state.pp_consensus_key_and_delegate + ("block", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + ("round", Round.encoding) + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let signing_preendorsement = + declare_1 + ~section + ~name:"signing_preendorsement" + ~level:Info + ~msg:"signing preendorsement for {delegate}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let signing_endorsement = + declare_1 + ~section + ~name:"signing_endorsement" + ~level:Info + ~msg:"signing endorsement for {delegate}" + ~pp1:Baking_state.pp_consensus_key_and_delegate + ("delegate", Baking_state.consensus_key_and_delegate_encoding) + + let invalid_json_file = + declare_1 + ~section + ~name:"invalid_json_file" + ~level:Warning + ~msg:"{filename} is not a valid JSON file" + ("filename", Data_encoding.string) + + let no_operations_found_in_file = + declare_1 + ~section + ~name:"no_operations_found_in_file" + ~level:Warning + ~msg:"no operations found in file {filename}" + ("filename", Data_encoding.string) + + let cannot_fetch_operations = + declare_1 + ~section + ~name:"cannot_fetch_operations" + ~level:Error + ~msg:"cannot fetch operations: {errs}" + ("errs", Error_monad.(TzTrace.encoding error_encoding)) + + let vote_for_liquidity_baking_toggle = + declare_1 + ~section + ~name:"vote_for_liquidity_baking_toggle" + ~level:Notice + ~msg:"Voting {value} for liquidity baking toggle vote" + ( "value", + Protocol.Alpha_context.Liquidity_baking + .liquidity_baking_toggle_vote_encoding ) +end + +module VDF = struct + include Internal_event.Simple + + let section = section @ ["vdf"] + + let vdf_revelation_injected = + declare_3 + ~section + ~name:"vdf_revelation_injected" + ~level:Notice + ~msg: + "injected VDF revelation for cycle {cycle} (chain {chain} with \ + operation {ophash})" + ~pp1:pp_int32 + ("cycle", Data_encoding.int32) + ~pp2:Format.pp_print_string + ("chain", Data_encoding.string) + ~pp3:Tezos_crypto.Operation_hash.pp + ("ophash", Tezos_crypto.Operation_hash.encoding) + + let vdf_daemon_start = + declare_1 + ~section + ~level:Info + ~name:"vdf_daemon_start" + ~msg:"starting {worker} VDF daemon" + ("worker", Data_encoding.string) + + let vdf_daemon_error = + declare_2 + ~section + ~level:Error + ~name:"vdf_daemon_error" + ~msg:"{worker}: error while running VDF daemon: {errors}" + ~pp2:pp_print_top_error_of_trace + ("worker", Data_encoding.string) + ("errors", Error_monad.(TzTrace.encoding error_encoding)) + + let vdf_daemon_connection_lost = + declare_1 + ~section + ~level:Error + ~name:"vdf_daemon_connection_lost" + ~msg:"connection to node lost, VDF daemon {worker} exiting" + ("worker", Data_encoding.string) + + let vdf_info = + declare_1 + ~section + ~name:"vdf_internal" + ~level:Notice + ~msg:"{msg}" + ("msg", Data_encoding.string) +end + +module Nonces = struct + include Internal_event.Simple + + let section = section @ ["nonces"] + + let found_nonce_to_reveal = + declare_2 + ~section + ~name:"found_nonce_to_reveal" + ~level:Notice + ~msg:"found nonce to reveal for block {block}, level {level}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block", Tezos_crypto.Block_hash.encoding) + ~pp2:pp_int32 + ("level", Data_encoding.int32) + + let revealing_nonce = + declare_3 + ~section + ~name:"revealing_nonce" + ~level:Notice + ~msg: + "revealing nonce of level {level} (chain {chain} with operation \ + {ophash})" + ~pp1:pp_int32 + ("level", Data_encoding.int32) + ~pp2:Format.pp_print_string + ("chain", Data_encoding.string) + ~pp3:Tezos_crypto.Operation_hash.pp + ("ophash", Tezos_crypto.Operation_hash.encoding) + + let cannot_fetch_chain_head_level = + declare_0 + ~section + ~name:"cannot_fetch_chain_head_level" + ~level:Error + ~msg:"cannot fetch chain head level, aborting nonces filtering" + () + + let incoherent_nonce = + declare_1 + ~section + ~name:"incoherent_nonce" + ~level:Error + ~msg:"incoherent nonce for level {level}" + ~pp1:pp_int32 + ("level", Data_encoding.int32) + + let cannot_read_nonces = + declare_1 + ~section + ~name:"cannot_read_nonces" + ~level:Error + ~msg:"cannot read nonces {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let cannot_retrieve_unrevealed_nonces = + declare_1 + ~section + ~name:"cannot_retrieve_unrevealed_nonces" + ~level:Error + ~msg:"cannot retrieve unrevealed nonces {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let cannot_inject_nonces = + declare_1 + ~section + ~name:"cannot_inject_nonces" + ~level:Error + ~msg:"cannot inject nonces {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let cant_retrieve_block_header_for_nonce = + declare_2 + ~section + ~name:"cant_retrieve_block_header_for_nonce" + ~level:Warning + ~msg:"cannot retrieve block header {header} associated with nonce {trace}" + ("header", Data_encoding.string) + ~pp2:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let too_many_nonces = + declare_1 + ~section + ~name:"too_many_nonces" + ~level:Warning + ~msg: + "too many nonces associated with blocks unknown by node in \ + '$TEZOS_CLIENT/{filename}'. After checking that these blocks were \ + never included in the chain (e.g., via a block explorer), consider \ + using `octez-client filter orphan nonces` to clear them." + ("filename", Data_encoding.string) + + let registering_nonce = + declare_1 + ~section + ~name:"registering_nonce" + ~level:Info + ~msg:"registering nonce for block {block}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block", Tezos_crypto.Block_hash.encoding) + + let nothing_to_reveal = + declare_1 + ~section + ~name:"nothing_to_reveal" + ~level:Info + ~msg:"nothing to reveal for block {block}" + ~pp1:Tezos_crypto.Block_hash.pp + ("block", Tezos_crypto.Block_hash.encoding) + + let revelation_worker_started = + declare_0 + ~section + ~name:"revelation_worker_started" + ~level:Info + ~msg:"revelation worker started" + () +end + +module Liquidity_baking = struct + include Internal_event.Simple + + let reading_per_block = + declare_1 + ~section + ~name:"reading_per_block" + ~level:Notice + ~msg:"reading per block vote file path: {path}" + ("path", Data_encoding.string) + + let per_block_vote_file_notice = + declare_1 + ~section + ~name:"per_block_vote_file_notice" + ~level:Notice + ~msg:"per block vote file {event}" + ("event", Data_encoding.string) + + let reading_liquidity_baking = + declare_0 + ~section + ~name:"reading_liquidity_baking" + ~level:Notice + ~msg:"reading liquidity baking toggle vote" + () + + let liquidity_baking_toggle_vote = + declare_1 + ~section + ~name:"liquidity_baking_toggle_vote" + ~level:Notice + ~msg:"liquidity baking toggle vote = {value}" + ( "value", + Protocol.Alpha_context.Liquidity_baking + .liquidity_baking_toggle_vote_encoding ) + + let per_block_vote_file_fail = + declare_1 + ~section + ~name:"per_block_vote_file_error" + ~level:Notice + ~msg:"Error reading the block vote file: {errors}" + ~pp1:pp_print_top_error_of_trace + ("errors", Error_monad.(TzTrace.encoding error_encoding)) + + let liquidity_baking_off = + declare_0 + ~section + ~name:"liquidity_baking_off" + ~level:Notice + ~msg:"Will vote to stop Liquidity Baking" + () + + let liquidity_baking_on = + declare_0 + ~section + ~name:"liquidity_baking_on" + ~level:Notice + ~msg:"Will vote to continue or restart Liquidity Baking" + () +end + +module Selection = struct + include Internal_event.Simple + + let section = section @ ["operation_selection"] + + let invalid_operation_filtered = + declare_2 + ~section + ~name:"invalid_operation_filtered" + ~level:Warning + ~msg:"filtered invalid operation {op}: {errors}" + ~pp1:Tezos_crypto.Operation_hash.pp + ("op", Tezos_crypto.Operation_hash.encoding) + ~pp2:pp_print_top_error_of_trace + ("errors", Error_monad.(TzTrace.encoding error_encoding)) + + let cannot_serialize_operation_metadata = + declare_1 + ~section + ~name:"cannot_serialize_operation_metadata" + ~level:Warning + ~msg:"cannot serialize operation {op} metadata" + ~pp1:Tezos_crypto.Operation_hash.pp + ("op", Tezos_crypto.Operation_hash.encoding) +end diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_files.ml b/src/proto_016_PtMumbai/lib_delegate/baking_files.ml new file mode 100644 index 000000000000..67ef0c7ea0d4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_files.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type _ location = string + +let resolve_location ~chain_id (kind : 'a) : 'a location = + let basename = + match kind with + | `Highwatermarks -> "highwatermark" + | `State -> "baker_state" + | `Nonce -> "nonce" + in + Format.asprintf "%a_%s" Tezos_crypto.Chain_id.pp_short chain_id basename + +let filename x = x diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_files.mli b/src/proto_016_PtMumbai/lib_delegate/baking_files.mli new file mode 100644 index 000000000000..82940952da05 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_files.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type _ location + +val resolve_location : + chain_id:Tezos_crypto.Chain_id.t -> + ([< `Highwatermarks | `Nonce | `State] as 'kind) -> + 'kind location + +val filename : [< `Highwatermarks | `Nonce | `State] location -> string diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.ml b/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.ml new file mode 100644 index 000000000000..4af172f183fe --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.ml @@ -0,0 +1,233 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol.Alpha_context + +type highwatermark = {round : Round.t; level : int32} + +let highwatermark_encoding : highwatermark Data_encoding.t = + let open Data_encoding in + conv + (fun {round; level} -> (round, level)) + (fun (round, level) -> {round; level}) + (obj2 + (req "round" Protocol.Alpha_context.Round.encoding) + (req "level" int32)) + +let pp_highwatermark fmt {round; level} = + Format.fprintf fmt "level: %ld, round: %a" level Round.pp round + +type error += Block_previously_baked of highwatermark + +type error += Block_previously_preendorsed of highwatermark + +type error += Block_previously_endorsed of highwatermark + +let () = + register_error_kind + `Permanent + ~id:"highwatermarks.block_previously_baked" + ~title:"Block previously baked" + ~description:"Trying to bake a block at a level previously baked" + ~pp:(fun ppf highwatermark -> + Format.fprintf + ppf + "A block with a higher watermark than the current one (%a) was \ + previously baked." + pp_highwatermark + highwatermark) + highwatermark_encoding + (function + | Block_previously_baked highwatermark -> Some highwatermark | _ -> None) + (fun highwatermark -> Block_previously_baked highwatermark) ; + register_error_kind + `Permanent + ~id:"highwatermarks.block_previously_preendorsed" + ~title:"Block previously preendorsed" + ~description: + "Trying to preendorse a block at a level previously preendorsed" + ~pp:(fun ppf highwatermark -> + Format.fprintf + ppf + "A preendorsement with a higher watermark than the current one (%a) \ + was already produced." + pp_highwatermark + highwatermark) + highwatermark_encoding + (function + | Block_previously_preendorsed highwatermark -> Some highwatermark + | _ -> None) + (fun highwatermark -> Block_previously_preendorsed highwatermark) ; + register_error_kind + `Permanent + ~id:"highwatermarks.block_previously_endorsed" + ~title:"Block previously endorsed" + ~description:"Trying to endorse a block at a level previously endorsed" + ~pp:(fun ppf highwatermark -> + Format.fprintf + ppf + "An endorsement with a higher watermark than the current one (%a) was \ + already produced." + pp_highwatermark + highwatermark) + highwatermark_encoding + (function + | Block_previously_endorsed highwatermark -> Some highwatermark + | _ -> None) + (fun highwatermark -> Block_previously_endorsed highwatermark) + +module DelegateMap = Map.Make (struct + type t = Tezos_crypto.Signature.Public_key_hash.t + + let compare = Tezos_crypto.Signature.Public_key_hash.compare +end) + +let highwatermark_delegate_map_encoding = + let open Data_encoding in + conv + DelegateMap.bindings + DelegateMap.( + fun l -> List.fold_left (fun map (k, v) -> add k v map) empty l) + (list + (obj2 + (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "highwatermark" highwatermark_encoding))) + +type highwatermarks = { + blocks : highwatermark DelegateMap.t; + preendorsements : highwatermark DelegateMap.t; + endorsements : highwatermark DelegateMap.t; +} + +type t = highwatermarks + +let encoding = + let open Data_encoding in + conv + (fun {blocks; preendorsements; endorsements} -> + (blocks, preendorsements, endorsements)) + (fun (blocks, preendorsements, endorsements) -> + {blocks; preendorsements; endorsements}) + (obj3 + (req "blocks" highwatermark_delegate_map_encoding) + (req "preendorsements" highwatermark_delegate_map_encoding) + (req "endorsements" highwatermark_delegate_map_encoding)) + +let empty = + { + blocks = DelegateMap.empty; + preendorsements = DelegateMap.empty; + endorsements = DelegateMap.empty; + } + +(* We do not lock these functions. The caller will be already locked. *) +let load (cctxt : #Protocol_client_context.full) location : t tzresult Lwt.t = + protect (fun () -> + cctxt#load (Baking_files.filename location) encoding ~default:empty) + +let save_highwatermarks (cctxt : #Protocol_client_context.full) filename + highwatermarks : unit tzresult Lwt.t = + protect (fun () -> + (* TODO: improve the backend so we don't write partial informations *) + cctxt#write filename highwatermarks encoding) + +let may_sign highwatermarks ~delegate ~level ~round = + match DelegateMap.find delegate highwatermarks with + | None -> true + | Some highwatermark -> + if Compare.Int32.(highwatermark.level < level) then true + else if Compare.Int32.(highwatermark.level = level) then + Round.(highwatermark.round < round) + else false + +let may_sign_block cctxt (location : [`Highwatermarks] Baking_files.location) + ~delegate ~level ~round = + load cctxt location >>=? fun all_highwatermarks -> + return @@ may_sign all_highwatermarks.blocks ~delegate ~level ~round + +let may_sign_preendorsement cctxt location ~delegate ~level ~round = + load cctxt location >>=? fun all_highwatermarks -> + return @@ may_sign all_highwatermarks.preendorsements ~delegate ~level ~round + +let may_sign_endorsement cctxt location ~delegate ~level ~round = + load cctxt location >>=? fun all_highwatermarks -> + return @@ may_sign all_highwatermarks.endorsements ~delegate ~level ~round + +let record map ~delegate ~new_level ~new_round = + DelegateMap.update + delegate + (function + | None -> Some {level = new_level; round = new_round} + | Some ({level; round} as prev) -> + if Compare.Int32.(new_level > level) then + Some {level = new_level; round = new_round} + else if Compare.Int32.(new_level = level) then + if Round.(new_round > round) then + Some {level = new_level; round = new_round} + else Some prev + else Some prev) + map + +let record_block (cctxt : #Protocol_client_context.full) location ~delegate + ~level ~round = + let filename = Baking_files.filename location in + load cctxt location >>=? fun highwatermarks -> + let new_blocks = + record highwatermarks.blocks ~delegate ~new_level:level ~new_round:round + in + save_highwatermarks cctxt filename {highwatermarks with blocks = new_blocks} + +let record_preendorsement (cctxt : #Protocol_client_context.full) location + ~delegate ~level ~round = + let filename = Baking_files.filename location in + load cctxt location >>=? fun highwatermarks -> + let new_preendorsements = + record + highwatermarks.preendorsements + ~delegate + ~new_level:level + ~new_round:round + in + save_highwatermarks + cctxt + filename + {highwatermarks with preendorsements = new_preendorsements} + +let record_endorsement (cctxt : #Protocol_client_context.full) location + ~delegate ~level ~round = + let filename = Baking_files.filename location in + load cctxt location >>=? fun highwatermarks -> + let new_endorsements = + record + highwatermarks.endorsements + ~delegate + ~new_level:level + ~new_round:round + in + save_highwatermarks + cctxt + filename + {highwatermarks with endorsements = new_endorsements} diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.mli b/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.mli new file mode 100644 index 000000000000..30d4d6f4ea3e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_highwatermarks.mli @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +type highwatermark = {round : Round.t; level : int32} + +type error += Block_previously_baked of highwatermark + +type error += Block_previously_preendorsed of highwatermark + +type error += Block_previously_endorsed of highwatermark + +type t + +val encoding : t Data_encoding.t + +val load : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + t tzresult Lwt.t + +val may_sign_block : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + bool tzresult Lwt.t + +val may_sign_preendorsement : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + bool tzresult Lwt.t + +val may_sign_endorsement : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + bool tzresult Lwt.t + +val record_block : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + unit tzresult Lwt.t + +val record_preendorsement : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + unit tzresult Lwt.t + +val record_endorsement : + #Protocol_client_context.full -> + [`Highwatermarks] Baking_files.location -> + delegate:Tezos_crypto.Signature.public_key_hash -> + level:int32 -> + round:Round.t -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_lib.ml b/src/proto_016_PtMumbai/lib_delegate/baking_lib.ml new file mode 100644 index 000000000000..f1b23c4582c1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_lib.ml @@ -0,0 +1,543 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Baking_state + +let create_state cctxt ?synchronize ?monitor_node_mempool ~config + ~current_proposal delegates = + let open Lwt_result_syntax in + let chain = cctxt#chain in + let monitor_node_operations = monitor_node_mempool in + let*! operation_worker = + Operation_worker.create ?monitor_node_operations cctxt + in + Baking_scheduling.create_initial_state + cctxt + ?synchronize + ~chain + config + operation_worker + ~current_proposal + delegates + +let get_current_proposal cctxt = + let open Lwt_result_syntax in + let* block_stream, _block_stream_stopper = + Node_rpc.monitor_proposals cctxt ~chain:cctxt#chain () + in + Lwt_stream.peek block_stream >>= function + | Some current_head -> return (block_stream, current_head) + | None -> failwith "head stream unexpectedly ended" + +module Events = Baking_events.Lib + +let preendorse (cctxt : Protocol_client_context.full) ?(force = false) delegates + = + let open State_transitions in + let open Lwt_result_syntax in + let* _, current_proposal = get_current_proposal cctxt in + let config = Baking_configuration.make ~force () in + let* state = create_state cctxt ~config ~current_proposal delegates in + let proposal = state.level_state.latest_proposal in + let*! () = + Events.( + emit attempting_preendorse_proposal state.level_state.latest_proposal) + in + let* () = + if force then return_unit + else + is_acceptable_proposal_for_current_level state proposal >>= function + | Invalid -> cctxt#error "Cannot preendorse an invalid proposal" + | Outdated_proposal -> + cctxt#error "Cannot preendorse an outdated proposal" + | Valid_proposal -> return_unit + in + let consensus_list = make_consensus_list state proposal in + let*! () = + cctxt#message + "@[<v 2>Preendorsing for:@ %a@]" + Format.( + pp_print_list + ~pp_sep:pp_print_space + Baking_state.pp_consensus_key_and_delegate) + (List.map fst consensus_list) + in + let state_recorder ~new_state = + Baking_state.may_record_new_state ~previous_state:state ~new_state + in + let* _ = + Baking_actions.inject_preendorsements + ~state_recorder + state + ~preendorsements:consensus_list + ~updated_state:state + in + return_unit + +let endorse (cctxt : Protocol_client_context.full) ?(force = false) delegates = + let open State_transitions in + let open Lwt_result_syntax in + let* _, current_proposal = get_current_proposal cctxt in + let config = Baking_configuration.make ~force () in + create_state cctxt ~config ~current_proposal delegates >>=? fun state -> + let proposal = state.level_state.latest_proposal in + let*! () = + Events.(emit attempting_endorse_proposal state.level_state.latest_proposal) + in + let* () = + if force then return_unit + else + is_acceptable_proposal_for_current_level state proposal >>= function + | Invalid -> cctxt#error "Cannot endorse an invalid proposal" + | Outdated_proposal -> cctxt#error "Cannot endorse an outdated proposal" + | Valid_proposal -> return_unit + in + let consensus_list = make_consensus_list state proposal in + let*! () = + cctxt#message + "@[<v 2>Endorsing for:@ %a@]" + Format.( + pp_print_list + ~pp_sep:pp_print_space + Baking_state.pp_consensus_key_and_delegate) + (List.map fst consensus_list) + in + let state_recorder ~new_state = + Baking_state.may_record_new_state ~previous_state:state ~new_state + in + let* _ = + Baking_actions.inject_endorsements + ~state_recorder + state + ~endorsements:consensus_list + ~updated_state:state + in + return_unit + +let bake_at_next_level state = + let open Lwt_result_syntax in + let cctxt = state.global_state.cctxt in + Baking_scheduling.compute_next_potential_baking_time_at_next_level state + >>= function + | None -> cctxt#error "No baking slot found for the delegates" + | Some (timestamp, round) -> + let*! () = + cctxt#message + "Waiting until %a for round %a" + Timestamp.pp + timestamp + Round.pp + round + in + let*! () = + Option.value + ~default:Lwt.return_unit + (Baking_scheduling.sleep_until timestamp) + in + return (Baking_state.Timeout (Time_to_bake_next_level {at_round = round})) + +(* Simulate the end of the current round to bootstrap the automaton + or endorse the block if necessary *) +let first_automaton_event state = + match state.level_state.elected_block with + | None -> Lwt.return (Baking_scheduling.compute_bootstrap_event state) + | Some _elected_block -> + (* If there is an elected block we can directly bake at next + level after waiting its date *) + bake_at_next_level state + +let endorsements_endorsing_power state endorsements = + let get_endorsement_voting_power {slot; _} = + match + SlotMap.find slot state.level_state.delegate_slots.all_delegate_slots + with + | None -> assert false + | Some {endorsing_power; _} -> endorsing_power + in + List.sort_uniq compare endorsements + |> List.fold_left + (fun power endorsement -> + power + get_endorsement_voting_power endorsement) + 0 + +let generic_endorsing_power (filter : packed_operation list -> 'a list) + (extract : 'a -> consensus_content) state = + let current_mempool = + Operation_worker.get_current_operations state.global_state.operation_worker + in + let latest_proposal = state.level_state.latest_proposal in + let block_round = latest_proposal.block.round in + let shell_level = latest_proposal.block.shell.level in + let endorsements = + filter (Operation_pool.Operation_set.elements current_mempool.consensus) + in + let endorsements_in_mempool = + List.filter_map + (fun v -> + let consensus_content = extract v in + if + Round.(consensus_content.round = block_round) + && Compare.Int32.( + Raw_level.to_int32 consensus_content.level = shell_level) + then Some consensus_content + else None) + endorsements + in + let power = endorsements_endorsing_power state endorsements_in_mempool in + (power, endorsements) + +let state_endorsing_power = + generic_endorsing_power + Operation_pool.filter_endorsements + (fun + ({ + protocol_data = {contents = Single (Endorsement consensus_content); _}; + _; + } : + Kind.endorsement operation) + -> consensus_content) + +let do_action (state, action) = + let state_recorder ~new_state = + Baking_state.may_record_new_state ~previous_state:state ~new_state + in + Baking_actions.perform_action ~state_recorder state action + +let propose_at_next_level ~minimal_timestamp state = + let open Lwt_result_syntax in + let cctxt = state.global_state.cctxt in + assert (Option.is_some state.level_state.elected_block) ; + if minimal_timestamp then + let* minimal_round, delegate = + match + Baking_scheduling.first_potential_round_at_next_level + state + ~earliest_round:Round.zero + with + | None -> cctxt#error "No potential baking slot for the given delegates." + | Some first_potential_round -> return first_potential_round + in + let pool = + Operation_worker.get_current_operations + state.global_state.operation_worker + in + let kind = Baking_actions.Fresh pool in + let block_to_bake : Baking_actions.block_to_bake = + { + Baking_actions.predecessor = state.level_state.latest_proposal.block; + round = minimal_round; + delegate; + kind; + } + in + let state_recorder ~new_state = + Baking_state.may_record_new_state ~previous_state:state ~new_state + in + let* state = + Baking_actions.perform_action + ~state_recorder + state + (Inject_block {block_to_bake; updated_state = state}) + in + let*! () = + cctxt#message + "Proposed block at round %a on top of %a " + Round.pp + block_to_bake.round + Tezos_crypto.Block_hash.pp + block_to_bake.predecessor.hash + in + return state + else + let* event = bake_at_next_level state in + let* state = State_transitions.step state event >>= do_action in + cctxt#message "Proposal injected" >>= fun () -> return state + +let endorsement_quorum state = + let power, endorsements = state_endorsing_power state in + if + Compare.Int.( + power >= state.global_state.constants.parametric.consensus_threshold) + then Some (power, endorsements) + else None + +(* Here's the sketch of the algorithm: + Do I have an endorsement quorum for the current block or an elected block? + - Yes :: wait and propose at next level + - No :: + Is the current proposal at the right round? + - Yes :: fail propose + - No :: + Is there a preendorsement quorum or does the last proposal contain a prequorum? + - Yes :: repropose block with right payload and preendorsements for current round + - No :: repropose fresh block for current round *) +let propose (cctxt : Protocol_client_context.full) ?minimal_fees + ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?force + ?(minimal_timestamp = false) ?extra_operations ?context_path delegates = + let open Lwt_result_syntax in + let* _block_stream, current_proposal = get_current_proposal cctxt in + let config = + Baking_configuration.make + ?minimal_fees + ?minimal_nanotez_per_gas_unit + ?minimal_nanotez_per_byte + ?context_path + ?force + ?extra_operations + () + in + let* state = create_state cctxt ~config ~current_proposal delegates in + let* _ = + match state.level_state.elected_block with + | Some _ -> propose_at_next_level ~minimal_timestamp state + | None -> ( + match endorsement_quorum state with + | Some (voting_power, endorsement_qc) -> + let state = + { + state with + round_state = + { + state.round_state with + current_phase = Baking_state.Awaiting_endorsements; + }; + } + in + let latest_proposal = state.level_state.latest_proposal.block in + let candidate = + { + Operation_worker.hash = latest_proposal.hash; + round_watched = latest_proposal.round; + payload_hash_watched = latest_proposal.payload_hash; + } + in + let* state = + State_transitions.step + state + (Baking_state.Quorum_reached + (candidate, voting_power, endorsement_qc)) + >>= do_action + (* this will register the elected block *) + in + propose_at_next_level ~minimal_timestamp state + | None -> ( + Baking_scheduling.compute_bootstrap_event state >>?= fun event -> + let*! state, _action = State_transitions.step state event in + let latest_proposal = state.level_state.latest_proposal in + let open State_transitions in + let round = state.round_state.current_round in + is_acceptable_proposal_for_current_level state latest_proposal + >>= function + | Invalid | Outdated_proposal -> ( + let slotmap = + state.level_state.delegate_slots.own_delegate_slots + in + match State_transitions.round_proposer state slotmap round with + | Some (delegate, _) -> + let*! action = + State_transitions.propose_block_action + state + delegate + round + state.level_state.latest_proposal + in + do_action (state, action) >>=? fun state -> + let*! () = + cctxt#message + "Reproposed block at level %ld on round %a" + state.level_state.current_level + Round.pp + state.round_state.current_round + in + return state + | None -> cctxt#error "No slots for current round") + | Valid_proposal -> + cctxt#error + "Cannot propose: there's already a valid proposal for the \ + current round %a" + Round.pp + round)) + in + return_unit + +let bake_using_automaton config state block_stream = + let open Lwt_result_syntax in + let cctxt = state.global_state.cctxt in + let* initial_event = first_automaton_event state in + let current_level = state.level_state.latest_proposal.block.shell.level in + let loop_state = + Baking_scheduling.create_loop_state + block_stream + state.global_state.operation_worker + in + let stop_on_next_level_block = function + | New_proposal proposal -> + Compare.Int32.(proposal.block.shell.level >= Int32.succ current_level) + | _ -> false + in + Baking_scheduling.automaton_loop + ~stop_on_event:stop_on_next_level_block + ~config + ~on_error:(fun err -> Lwt.return (Error err)) + loop_state + state + initial_event + >>=? function + | Some (New_proposal proposal) -> + let*! () = + cctxt#message + "Block %a (%ld) injected" + Tezos_crypto.Block_hash.pp + proposal.block.hash + proposal.block.shell.level + in + return_unit + | _ -> cctxt#error "Baking loop unexpectedly ended" + +(* endorse the latest proposal and bake with it *) +let baking_minimal_timestamp state = + let open Lwt_result_syntax in + let cctxt = state.global_state.cctxt in + let latest_proposal = state.level_state.latest_proposal in + let own_endorsements = + State_transitions.make_consensus_list state latest_proposal + in + let current_mempool = + Operation_worker.get_current_operations state.global_state.operation_worker + in + let endorsements_in_mempool = + Operation_pool.( + filter_endorsements (Operation_set.elements current_mempool.consensus)) + |> List.filter_map + (fun + ({ + protocol_data = + {contents = Single (Endorsement consensus_content); _}; + _; + } : + Kind.endorsement operation) + -> + if + Round.(consensus_content.round = latest_proposal.block.round) + && Compare.Int32.( + Raw_level.to_int32 consensus_content.level + = latest_proposal.block.shell.level) + then Some consensus_content + else None) + in + let total_voting_power = + List.fold_left + (fun endorsements own -> snd own :: endorsements) + endorsements_in_mempool + own_endorsements + |> endorsements_endorsing_power state + in + let consensus_threshold = + state.global_state.constants.parametric.consensus_threshold + in + let* () = + if Compare.Int.(total_voting_power < consensus_threshold) then + cctxt#error + "Delegates do not have enough voting power. Only %d is available while \ + %d is required." + total_voting_power + consensus_threshold + else return_unit + in + let* minimal_round, delegate = + match + Baking_scheduling.first_potential_round_at_next_level + state + ~earliest_round:Round.zero + with + | None -> cctxt#error "No potential baking slot for the given delegates." + | Some first_potential_round -> return first_potential_round + in + let* signed_endorsements = + Baking_actions.sign_endorsements state own_endorsements + in + let pool = + Operation_pool.add_operations + current_mempool + (List.map snd signed_endorsements) + in + let kind = Baking_actions.Fresh pool in + let block_to_bake : Baking_actions.block_to_bake = + { + Baking_actions.predecessor = latest_proposal.block; + round = minimal_round; + delegate; + kind; + } + in + let state_recorder ~new_state = + Baking_state.may_record_new_state ~previous_state:state ~new_state + in + let* _ = + Baking_actions.perform_action + ~state_recorder + state + (Inject_block {block_to_bake; updated_state = state}) + in + let*! () = cctxt#message "Injected block at minimal timestamp" in + return_unit + +let bake (cctxt : Protocol_client_context.full) ?minimal_fees + ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?force + ?(minimal_timestamp = false) ?extra_operations + ?(monitor_node_mempool = true) ?context_path delegates = + let open Lwt_result_syntax in + let config = + Baking_configuration.make + ?minimal_fees + ?minimal_nanotez_per_gas_unit + ?minimal_nanotez_per_byte + ?context_path + ?force + ?extra_operations + () + in + let* block_stream, current_proposal = get_current_proposal cctxt in + let* state = + create_state + cctxt + ~monitor_node_mempool + ~synchronize:(not minimal_timestamp) + ~config + ~current_proposal + delegates + in + let* () = + when_ monitor_node_mempool (fun () -> + (* Make sure the operation worker is populated to avoid empty + blocks being baked *) + Operation_worker.retrieve_pending_operations + cctxt + state.global_state.operation_worker) + in + if not minimal_timestamp then bake_using_automaton config state block_stream + else baking_minimal_timestamp state diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_lib.mli b/src/proto_016_PtMumbai/lib_delegate/baking_lib.mli new file mode 100644 index 000000000000..e37f01ac7bb5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_lib.mli @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(** {1 API} *) + +val bake : + Protocol_client_context.full -> + ?minimal_fees:Tez.t -> + ?minimal_nanotez_per_gas_unit:Q.t -> + ?minimal_nanotez_per_byte:Q.t -> + ?force:bool -> + ?minimal_timestamp:bool -> + ?extra_operations:Baking_configuration.Operations_source.t -> + ?monitor_node_mempool:bool -> + ?context_path:string -> + Baking_state.consensus_key list -> + unit tzresult Lwt.t + +val preendorse : + Protocol_client_context.full -> + ?force:bool -> + Baking_state.consensus_key list -> + unit tzresult Lwt.t + +val endorse : + Protocol_client_context.full -> + ?force:bool -> + Baking_state.consensus_key list -> + unit tzresult Lwt.t + +val propose : + Protocol_client_context.full -> + ?minimal_fees:Tez.t -> + ?minimal_nanotez_per_gas_unit:Q.t -> + ?minimal_nanotez_per_byte:Q.t -> + ?force:bool -> + ?minimal_timestamp:bool -> + ?extra_operations:Baking_configuration.Operations_source.t -> + ?context_path:string -> + Baking_state.consensus_key list -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_nonces.ml b/src/proto_016_PtMumbai/lib_delegate/baking_nonces.ml new file mode 100644 index 000000000000..3acc87f16377 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_nonces.ml @@ -0,0 +1,345 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +module Events = Baking_events.Nonces + +type state = { + cctxt : Protocol_client_context.full; + chain : Chain_services.chain; + constants : Constants.t; + config : Baking_configuration.nonce_config; + nonces_location : [`Nonce] Baking_files.location; + mutable last_predecessor : Tezos_crypto.Block_hash.t; +} + +type t = state + +type nonces = Nonce.t Tezos_crypto.Block_hash.Map.t + +let empty = Tezos_crypto.Block_hash.Map.empty + +let encoding = + let open Data_encoding in + def "seed_nonce" + @@ conv + (fun m -> + Tezos_crypto.Block_hash.Map.fold + (fun hash nonce acc -> (hash, nonce) :: acc) + m + []) + (fun l -> + List.fold_left + (fun map (hash, nonce) -> + Tezos_crypto.Block_hash.Map.add hash nonce map) + Tezos_crypto.Block_hash.Map.empty + l) + @@ list + (obj2 + (req "block" Tezos_crypto.Block_hash.encoding) + (req "nonce" Nonce.encoding)) + +let may_migrate (wallet : Protocol_client_context.full) location = + let base_dir = wallet#get_base_dir in + let current_file = + Filename.Infix.((base_dir // Baking_files.filename location) ^ "s") + in + Lwt_unix.file_exists current_file >>= function + | true -> + (* Migration already occured *) + Lwt.return_unit + | false -> ( + let legacy_file = Filename.Infix.(base_dir // "nonces") in + Lwt_unix.file_exists legacy_file >>= function + | false -> + (* Do nothing *) + Lwt.return_unit + | true -> Lwt_utils_unix.copy_file ~src:legacy_file ~dst:current_file) + +let load (wallet : #Client_context.wallet) location = + wallet#load (Baking_files.filename location) ~default:empty encoding + +let save (wallet : #Client_context.wallet) location nonces = + wallet#write (Baking_files.filename location) nonces encoding + +let mem nonces hash = Tezos_crypto.Block_hash.Map.mem hash nonces + +let find_opt nonces hash = Tezos_crypto.Block_hash.Map.find hash nonces + +let add nonces hash nonce = Tezos_crypto.Block_hash.Map.add hash nonce nonces + +let remove nonces hash = Tezos_crypto.Block_hash.Map.remove hash nonces + +let remove_all nonces nonces_to_remove = + Tezos_crypto.Block_hash.Map.fold + (fun hash _ acc -> remove acc hash) + nonces_to_remove + nonces + +let get_block_level_opt cctxt ~chain ~block = + Shell_services.Blocks.Header.shell_header cctxt ~chain ~block () >>= function + | Ok {level; _} -> Lwt.return_some level + | Error errs -> + Events.( + emit + cant_retrieve_block_header_for_nonce + (Block_services.to_string block, errs)) + >>= fun () -> Lwt.return_none + +let get_outdated_nonces {cctxt; constants; chain; _} nonces = + let {Constants.parametric = {blocks_per_cycle; preserved_cycles; _}; _} = + constants + in + get_block_level_opt cctxt ~chain ~block:(`Head 0) >>= function + | None -> + Events.(emit cannot_fetch_chain_head_level ()) >>= fun () -> + return (empty, empty) + | Some current_level -> + let current_cycle = Int32.(div current_level blocks_per_cycle) in + let is_older_than_preserved_cycles block_level = + let block_cycle = Int32.(div block_level blocks_per_cycle) in + Int32.sub current_cycle block_cycle > Int32.of_int preserved_cycles + in + Tezos_crypto.Block_hash.Map.fold + (fun hash nonce acc -> + acc >>=? fun (orphans, outdated) -> + get_block_level_opt cctxt ~chain ~block:(`Hash (hash, 0)) >>= function + | Some level -> + if is_older_than_preserved_cycles level then + return (orphans, add outdated hash nonce) + else acc + | None -> return (add orphans hash nonce, outdated)) + nonces + (return (empty, empty)) + +let filter_outdated_nonces state nonces = + get_outdated_nonces state nonces >>=? fun (orphans, outdated_nonces) -> + when_ + (Tezos_crypto.Block_hash.Map.cardinal orphans >= 50) + (fun () -> + Events.( + emit too_many_nonces (Baking_files.filename state.nonces_location ^ "s")) + >>= fun () -> return_unit) + >>=? fun () -> return (remove_all nonces outdated_nonces) + +let blocks_from_current_cycle {cctxt; chain; _} block ?(offset = 0l) () = + Plugin.RPC.levels_in_current_cycle cctxt ~offset (chain, block) >>= function + | Error (Tezos_rpc.Context.Not_found _ :: _) -> return_nil + | Error _ as err -> Lwt.return err + | Ok (first, last) -> ( + Shell_services.Blocks.hash cctxt ~chain ~block () >>=? fun hash -> + Shell_services.Blocks.Header.shell_header cctxt ~chain ~block () + >>=? fun {level; _} -> + (* FIXME: crappy algorithm, change this *) + (* Compute how many blocks below current level we should ask for *) + let length = Int32.to_int (Int32.sub level (Raw_level.to_int32 first)) in + Shell_services.Blocks.list cctxt ~chain ~heads:[hash] ~length () + (* Looks like this function call retrieves a list of blocks ordered from + latest to earliest - decreasing order of insertion in the chain *) + >>=? + function + | [blocks] -> + if Int32.equal level (Raw_level.to_int32 last) then + (* We have just retrieved a block list of the right size starting at + first until last *) + return blocks + else + (* Remove all the latest blocks from last up to length*) + List.drop_n + (length - Int32.to_int (Raw_level.diff last first)) + blocks + |> return + | l -> + failwith + "Baking_nonces.blocks_from_current_cycle: unexpected block list of \ + size %d (expected 1)" + (List.length l)) + +let get_unrevealed_nonces ({cctxt; chain; _} as state) nonces = + blocks_from_current_cycle state (`Head 0) ~offset:(-1l) () >>=? fun blocks -> + List.filter_map_es + (fun hash -> + match find_opt nonces hash with + | None -> return_none + | Some nonce -> ( + get_block_level_opt cctxt ~chain ~block:(`Hash (hash, 0)) >>= function + | Some level -> ( + Lwt.return (Environment.wrap_tzresult (Raw_level.of_int32 level)) + >>=? fun level -> + Alpha_services.Nonce.get cctxt (chain, `Head 0) level + >>=? function + | Missing nonce_hash when Nonce.check_hash nonce nonce_hash -> + Events.( + emit found_nonce_to_reveal (hash, Raw_level.to_int32 level)) + >>= fun () -> return_some (level, nonce) + | Missing _nonce_hash -> + Events.(emit incoherent_nonce (Raw_level.to_int32 level)) + >>= fun () -> return_none + | Forgotten -> return_none + | Revealed _ -> return_none) + | None -> return_none)) + blocks + +(* Nonce creation *) + +let generate_seed_nonce (nonce_config : Baking_configuration.nonce_config) + (delegate : Baking_state.consensus_key) level = + (match nonce_config with + | Deterministic -> + let data = Data_encoding.Binary.to_bytes_exn Raw_level.encoding level in + Client_keys.deterministic_nonce delegate.secret_key_uri data + >>=? fun nonce -> + return (Data_encoding.Binary.of_bytes_exn Nonce.encoding nonce) + | Random -> ( + match + Nonce.of_bytes (Tezos_crypto.Rand.generate Constants.nonce_length) + with + | Error _errs -> assert false + | Ok nonce -> return nonce)) + >>=? fun nonce -> return (Nonce.hash nonce, nonce) + +let register_nonce (cctxt : #Protocol_client_context.full) ~chain_id block_hash + nonce = + Events.(emit registering_nonce block_hash) >>= fun () -> + (* Register the nonce *) + let nonces_location = Baking_files.resolve_location ~chain_id `Nonce in + cctxt#with_lock @@ fun () -> + load cctxt nonces_location >>=? fun nonces -> + let nonces = add nonces block_hash nonce in + save cctxt nonces_location nonces >>=? fun () -> return_unit + +let inject_seed_nonce_revelation (cctxt : #Protocol_client_context.full) ~chain + ~block ~branch nonces = + match nonces with + | [] -> Events.(emit nothing_to_reveal branch) >>= fun () -> return_unit + | _ -> + List.iter_es + (fun (level, nonce) -> + Plugin.RPC.Forge.seed_nonce_revelation + cctxt + (chain, block) + ~branch + ~level + ~nonce + () + >>=? fun bytes -> + let bytes = + Tezos_crypto.Signature.concat bytes Tezos_crypto.Signature.zero + in + Shell_services.Injection.operation ~async:true cctxt ~chain bytes + >>=? fun oph -> + Events.( + emit + revealing_nonce + (Raw_level.to_int32 level, Chain_services.to_string chain, oph)) + >>= fun () -> return_unit) + nonces + +(** [reveal_potential_nonces] reveal registered nonces *) +let reveal_potential_nonces state new_proposal = + let {cctxt; chain; nonces_location; last_predecessor; _} = state in + let new_predecessor_hash = new_proposal.Baking_state.predecessor.hash in + if + Tezos_crypto.Block_hash.(last_predecessor <> new_predecessor_hash) + && Tezos_crypto.Protocol_hash.( + new_proposal.predecessor.protocol = Protocol.hash) + then ( + (* only try revealing nonces when the proposal's predecessor is a new one *) + state.last_predecessor <- new_predecessor_hash ; + let block = `Head 0 in + let branch = new_predecessor_hash in + (* improve concurrency *) + cctxt#with_lock @@ fun () -> + load cctxt nonces_location >>= function + | Error err -> + Events.(emit cannot_read_nonces err) >>= fun () -> return_unit + | Ok nonces -> ( + get_unrevealed_nonces state nonces >>= function + | Error err -> + Events.(emit cannot_retrieve_unrevealed_nonces err) >>= fun () -> + return_unit + | Ok [] -> return_unit + | Ok nonces_to_reveal -> ( + inject_seed_nonce_revelation + cctxt + ~chain + ~block + ~branch + nonces_to_reveal + >>= function + | Error err -> + Events.(emit cannot_inject_nonces err) >>= fun () -> return_unit + | Ok () -> + (* If some nonces are to be revealed it means: + - We entered a new cycle and we can clear old nonces ; + - A revelation was not included yet in the cycle beginning. + So, it is safe to only filter outdated_nonces there *) + filter_outdated_nonces state nonces >>=? fun live_nonces -> + save cctxt nonces_location live_nonces >>=? fun () -> + return_unit))) + else return_unit + +(* We suppose that the block stream is cloned by the caller *) +let start_revelation_worker cctxt config chain_id constants block_stream = + let nonces_location = Baking_files.resolve_location ~chain_id `Nonce in + may_migrate cctxt nonces_location >>= fun () -> + let chain = `Hash chain_id in + let canceler = Lwt_canceler.create () in + let should_shutdown = ref false in + let state = + { + cctxt; + chain; + constants; + config; + nonces_location; + last_predecessor = Tezos_crypto.Block_hash.zero; + } + in + let rec worker_loop () = + Lwt_canceler.on_cancel canceler (fun () -> + should_shutdown := true ; + Lwt.return_unit) ; + Lwt_stream.get block_stream >>= function + | None -> + (* The head stream closed meaning that the connection + with the node was interrupted: exit *) + return_unit + | Some new_proposal -> + if !should_shutdown then return_unit + else + reveal_potential_nonces state new_proposal >>=? fun () -> + worker_loop () + in + Lwt.dont_wait + (fun () -> + Lwt.finalize + (fun () -> + Events.(emit revelation_worker_started ()) >>= fun () -> + worker_loop () >>= fun _ -> (* never ending loop *) Lwt.return_unit) + (fun () -> (* TODO *) Lwt.return_unit)) + (fun _exn -> ()) ; + Lwt.return canceler diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_nonces.mli b/src/proto_016_PtMumbai/lib_delegate/baking_nonces.mli new file mode 100644 index 000000000000..df34657eb901 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_nonces.mli @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type state = { + cctxt : Protocol_client_context.full; + chain : Chain_services.chain; + constants : Constants.t; + config : Baking_configuration.nonce_config; + nonces_location : [`Nonce] Baking_files.location; + mutable last_predecessor : Tezos_crypto.Block_hash.t; +} + +type t = state + +type nonces = Nonce.t Tezos_crypto.Block_hash.Map.t + +val empty : Nonce.t Tezos_crypto.Block_hash.Map.t + +val encoding : Nonce.t Tezos_crypto.Block_hash.Map.t Data_encoding.t + +val load : + #Client_context.wallet -> + [< `Highwatermarks | `Nonce | `State] Baking_files.location -> + Nonce.t Tezos_crypto.Block_hash.Map.t tzresult Lwt.t + +val save : + #Client_context.wallet -> + [< `Highwatermarks | `Nonce | `State] Baking_files.location -> + Nonce.t Tezos_crypto.Block_hash.Map.t -> + unit tzresult Lwt.t + +val mem : + Nonce.t Tezos_crypto.Block_hash.Map.t -> Tezos_crypto.Block_hash.t -> bool + +val find_opt : + Nonce.t Tezos_crypto.Block_hash.Map.t -> + Tezos_crypto.Block_hash.t -> + Nonce.t option + +val get_block_level_opt : + #Tezos_rpc.Context.simple -> + chain:Block_services.chain -> + block:Block_services.block -> + int32 option Lwt.t + +val get_outdated_nonces : + t -> + Nonce.t Tezos_crypto.Block_hash.Map.t -> + (Nonce.t Tezos_crypto.Block_hash.Map.t + * Nonce.t Tezos_crypto.Block_hash.Map.t) + tzresult + Lwt.t + +val filter_outdated_nonces : + t -> + Nonce.t Tezos_crypto.Block_hash.Map.t -> + Nonce.t Tezos_crypto.Block_hash.Map.t tzresult Lwt.t + +val blocks_from_current_cycle : + t -> + Block_services.block -> + ?offset:int32 -> + unit -> + Tezos_crypto.Block_hash.t list tzresult Lwt.t + +val get_unrevealed_nonces : + t -> + Nonce.t Tezos_crypto.Block_hash.Map.t -> + (Raw_level.t * Nonce.t) list tzresult Lwt.t + +val generate_seed_nonce : + Baking_configuration.nonce_config -> + Baking_state.consensus_key -> + Raw_level.t -> + (Nonce_hash.t * Nonce.t) tzresult Lwt.t + +val register_nonce : + #Protocol_client_context.full -> + chain_id:Tezos_crypto.Chain_id.t -> + Tezos_crypto.Block_hash.t -> + Nonce.t -> + unit tzresult Lwt.t + +val inject_seed_nonce_revelation : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + block:Block_services.block -> + branch:Tezos_crypto.Block_hash.t -> + (Raw_level.t * Nonce.t) list -> + unit tzresult Lwt.t + +val reveal_potential_nonces : t -> Baking_state.proposal -> unit tzresult Lwt.t + +val start_revelation_worker : + Protocol_client_context.full -> + Baking_configuration.nonce_config -> + Tezos_crypto.Chain_id.t -> + Constants.t -> + Baking_state.proposal Lwt_stream.t -> + Lwt_canceler.t Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml b/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml new file mode 100644 index 000000000000..d5d4d4be293b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let default_constant = "\x00\x00\x00\x05" + +let is_updated_constant = + let commit_hash = + match Hex.to_string (`Hex Tezos_version.Current_git_info.commit_hash) with + | None -> Tezos_version.Current_git_info.commit_hash + | Some s -> s + in + if String.length commit_hash >= 4 then String.sub commit_hash 0 4 + else default_constant + +let is_updated_constant_len = String.length is_updated_constant + +(* add a version to the pow *) +let init_proof_of_work_nonce () = + let buf = + Bytes.make Alpha_context.Constants.proof_of_work_nonce_size '\000' + in + Bytes.blit_string is_updated_constant 0 buf 0 is_updated_constant_len ; + let max_z_len = + Alpha_context.Constants.proof_of_work_nonce_size - is_updated_constant_len + in + let rec aux z = + let z_len = (Z.numbits z + 7) / 8 in + if z_len > max_z_len then Seq.Nil + else ( + Bytes.blit_string (Z.to_bits z) 0 buf is_updated_constant_len z_len ; + Seq.Cons (buf, fun () -> aux (Z.succ z))) + in + aux Z.zero + +(* This was used before November 2018 *) +(* (\* Random proof of work *\) + * let generate_proof_of_work_nonce () = + * Tezos_crypto.Rand.generate Alpha_context.Constants.proof_of_work_nonce_size *) + +let empty_proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '\000' + +let mine ~proof_of_work_threshold shell builder = + let rec loop nonce_seq = + match nonce_seq with + | Seq.Nil -> + failwith + "Client_baking_pow.mine: couldn't find nonce for required proof of \ + work" + | Seq.Cons (nonce, seq) -> + let block = builder nonce in + if + Alpha_context.Block_header.Proof_of_work + .check_header_proof_of_work_stamp + shell + block + proof_of_work_threshold + then return block + else loop (seq ()) + in + loop (init_proof_of_work_nonce ()) diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_pow.mli b/src/proto_016_PtMumbai/lib_delegate/baking_pow.mli new file mode 100644 index 000000000000..ad5975c9190c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_pow.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** A null proof-of-work nonce. This should only be used to nonsensical blocks + of the correct size and shape. *) +val empty_proof_of_work_nonce : Bytes.t + +(** [mine ~proof_of_work_threshold chain block header builder] returns a block with a valid + proof-of-work nonce. The function [builder], provided by the caller, is used + to make the block. All the internal logic of generating nonces and checking + for the proof-of-work threshold is handled by [mine]. *) +val mine : + proof_of_work_threshold:int64 -> + Block_header.shell_header -> + (Bytes.t -> Alpha_context.Block_header.contents) -> + Alpha_context.Block_header.contents tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.ml b/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.ml new file mode 100644 index 000000000000..bca851f697d8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.ml @@ -0,0 +1,804 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context +module Events = Baking_events.Scheduling +open Baking_state + +type loop_state = { + block_stream : Baking_state.proposal Lwt_stream.t; + qc_stream : Operation_worker.event Lwt_stream.t; + future_block_stream : proposal Lwt_stream.t; + push_future_block : proposal -> unit; + mutable last_get_head_event : [`New_proposal of proposal option] Lwt.t option; + mutable last_future_block_event : + [`New_future_block of Baking_state.proposal] Lwt.t option; + mutable last_get_qc_event : + [`QC_reached of Operation_worker.event option] Lwt.t option; +} + +type events = + [ `New_future_block of proposal + | `New_proposal of proposal option + | `QC_reached of Operation_worker.event option + | `Termination + | `Timeout of timeout_kind ] + Lwt.t + +let create_loop_state block_stream operation_worker = + let future_block_stream, push_future_block = Lwt_stream.create () in + { + block_stream; + qc_stream = Operation_worker.get_quorum_event_stream operation_worker; + future_block_stream; + push_future_block = (fun x -> push_future_block (Some x)); + last_get_head_event = None; + last_future_block_event = None; + last_get_qc_event = None; + } + +let find_in_known_round_intervals known_round_intervals ~predecessor_timestamp + ~predecessor_round ~now = + let open Baking_cache in + Round_timestamp_interval_cache.( + find_opt + known_round_intervals + {predecessor_timestamp; predecessor_round; time_interval = (now, now)}) + +(** Memoization wrapper for [Round.timestamp_of_round]. *) +let timestamp_of_round known_timestamps round_durations ~predecessor_timestamp + ~predecessor_round ~round = + let open Baking_cache in + match + Timestamp_of_round_cache.find_opt + known_timestamps + (predecessor_timestamp, predecessor_round, round) + with + (* Compute and register the timestamp if not already existing. *) + | None -> + Protocol.Alpha_context.Round.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round + >>? fun ts -> + Timestamp_of_round_cache.replace + known_timestamps + (predecessor_timestamp, predecessor_round, round) + ts ; + ok ts + (* If it already exists, just fetch from the memoization table. *) + | Some ts -> ok ts + +(** The function is blocking until it is [time]. *) +let sleep_until time = + (* Sleeping is a system op, baking is a protocol op, this is where we convert *) + let time = Time.System.of_protocol_exn time in + let delay = Ptime.diff time (Time.System.now ()) in + if Ptime.Span.compare delay Ptime.Span.zero < 0 then None + else Some (Lwt_unix.sleep (Ptime.Span.to_float_s delay)) + +(* Only allocate once the termination promise *) +let terminated = Lwt_exit.clean_up_starts >|= fun _ -> `Termination + +let rec wait_next_event ~timeout loop_state = + (* TODO? should we prioritize head events/timeouts to resynchronize if needs be ? *) + let get_head_event () = + (* n.b. we should also consume the available elements in the + block_stream before starting baking. *) + match loop_state.last_get_head_event with + | None -> + let t = + Lwt_stream.get loop_state.block_stream >|= fun e -> `New_proposal e + in + loop_state.last_get_head_event <- Some t ; + t + | Some t -> t + in + let get_future_block_event () = + (* n.b. we should also consume the available elements in the + block_stream before starting baking. *) + match loop_state.last_future_block_event with + | None -> + let t = + Lwt_stream.get loop_state.future_block_stream >|= function + | None -> + (* unreachable, we never close the stream *) + assert false + | Some proposal -> `New_future_block proposal + in + loop_state.last_future_block_event <- Some t ; + t + | Some t -> t + in + let get_qc_event () = + match loop_state.last_get_qc_event with + | None -> + let t = + Lwt_stream.get loop_state.qc_stream >|= fun e -> `QC_reached e + in + loop_state.last_get_qc_event <- Some t ; + t + | Some t -> t + in + (* event construction *) + let open Baking_state in + Lwt.choose + [ + terminated; + (get_head_event () :> events); + (get_future_block_event () :> events); + (get_qc_event () :> events); + (timeout :> events); + ] + >>= function + (* event matching *) + | `Termination -> + (* Exit the loop *) + return_none + | `New_proposal None -> + (* Node connection lost *) + loop_state.last_get_head_event <- None ; + fail Baking_errors.Node_connection_lost + | `QC_reached None -> + (* Not supposed to happen: exit the loop *) + loop_state.last_get_qc_event <- None ; + return_none + | `New_proposal (Some proposal) -> ( + loop_state.last_get_head_event <- None ; + (* Is the block in the future? *) + match sleep_until proposal.block.shell.timestamp with + | Some waiter -> + (* If so, wait until its timestamp is reached before advertising it *) + Events.(emit proposal_in_the_future proposal.block.hash) >>= fun () -> + Lwt.dont_wait + (fun () -> + waiter >>= fun () -> + loop_state.push_future_block proposal ; + Lwt.return_unit) + (fun _exn -> ()) ; + wait_next_event ~timeout loop_state + | None -> return_some (New_proposal proposal)) + | `New_future_block proposal -> + Events.(emit process_proposal_in_the_future proposal.block.hash) + >>= fun () -> + loop_state.last_future_block_event <- None ; + return_some (New_proposal proposal) + | `QC_reached + (Some + (Operation_worker.Prequorum_reached + (candidate, voting_power, preendorsement_qc))) -> + loop_state.last_get_qc_event <- None ; + return_some + (Prequorum_reached (candidate, voting_power, preendorsement_qc)) + | `QC_reached + (Some + (Operation_worker.Quorum_reached + (candidate, voting_power, endorsement_qc))) -> + loop_state.last_get_qc_event <- None ; + return_some (Quorum_reached (candidate, voting_power, endorsement_qc)) + | `Timeout e -> return_some (Timeout e) + +(** From the current [state], the function returns an optional + association pair, which consists of the next round timestamp and its + round. *) +let compute_next_round_time state = + let open Baking_state in + let proposal = + match state.level_state.endorsable_payload with + | None -> state.level_state.latest_proposal + | Some {proposal; _} -> proposal + in + if + Tezos_crypto.Protocol_hash.( + proposal.predecessor.next_protocol <> Protocol.hash) + then None + else + match state.level_state.next_level_proposed_round with + | Some _proposed_round -> + (* TODO? do something, if we don't, we won't be able to + repropose a block at next level. *) + None + | None -> ( + let first_round_duration = + state.global_state.constants.parametric.minimal_block_delay + in + let delay_increment_per_round = + state.global_state.constants.parametric.delay_increment_per_round + in + match + Round.Durations.create_opt + ~first_round_duration + ~delay_increment_per_round + with + | Some round_durations -> ( + let predecessor_timestamp = proposal.predecessor.shell.timestamp in + let predecessor_round = proposal.predecessor.round in + let next_round = Round.succ state.round_state.current_round in + match + timestamp_of_round + state.global_state.cache.known_timestamps + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round:next_round + with + | Ok timestamp -> Some (timestamp, next_round) + | _ -> assert false) + | None -> assert false) + +(** [first_potential_round_at_next_level state ~earliest_round] yields + an optional pair of the earliest possible round (at or after + [earliest_round]), along with the delegate having the slot to + propose. + + In particular when the required round value is higher than the + consensus committee size, an Euclidean division allows to + recycle. Then, the earliest round when it exists is extracted. This + is meant to be multiplied back again to find the round value. *) +let first_potential_round_at_next_level state ~earliest_round = + let open Baking_state in + let slots = state.level_state.next_level_delegate_slots.own_delegate_slots in + let rounds = + state.level_state.next_level_delegate_slots.all_slots_by_round + |> Array.to_seqi + |> Seq.fold_left + (fun acc (round, slot) -> + if SlotMap.mem slot slots then (round, slot) :: acc else acc) + [] + |> List.rev + in + match Round.to_int earliest_round with + | Error _ -> None + | Ok earliest_round -> ( + let consensus_committee_size = + state.global_state.constants.parametric.consensus_committee_size + in + let q = earliest_round / consensus_committee_size in + let r = earliest_round mod consensus_committee_size in + let first_round = List.find (fun (round, _) -> round >= r) rounds in + match first_round with + | None -> None + | Some (round, slot) -> ( + SlotMap.find slot slots |> function + | None -> None + | Some (delegate, _) -> ( + (* TODO? check with [Node_rpc.first_proposer_round] if we also need the q+1 *) + match Round.of_int ((q * consensus_committee_size) + round) with + | Error _ -> None + | Ok first_potential_round -> + Some (first_potential_round, delegate)))) + +(** From the current [state], the function returns an optional + association pair, which consists of the next baking timestamp and + its baking round. In that case, an elected block must exist. *) +let compute_next_potential_baking_time_at_next_level state = + let open Protocol.Alpha_context in + let open Baking_state in + match state.level_state.elected_block with + | None -> Lwt.return_none + | Some elected_block -> ( + Events.( + emit + compute_next_timeout_elected_block + ( elected_block.proposal.block.shell.level, + elected_block.proposal.block.round )) + >>= fun () -> + (* Do we have baking rights for the next level ? *) + (* Determine the round for the next level *) + let predecessor_timestamp = + elected_block.proposal.block.shell.timestamp + in + let predecessor_round = elected_block.proposal.block.round in + let now = Time.System.now () |> Time.System.to_protocol in + (* Lookup the next slot information if already stored in the + memoization table [Round_timestamp_interval_tbl]. *) + match + find_in_known_round_intervals + state.global_state.cache.round_timestamps + ~predecessor_timestamp + ~predecessor_round + ~now + with + | Some (first_potential_baking_time, first_potential_round, delegate) -> ( + (* Check if we already have proposed something at next + level *) + match state.level_state.next_level_proposed_round with + | Some proposed_round + when Round.(proposed_round >= first_potential_round) -> + Events.(emit proposal_already_injected ()) >>= fun () -> + Lwt.return_none + | None | Some _ -> + Events.( + emit + next_potential_slot + ( Int32.succ state.level_state.current_level, + first_potential_round, + first_potential_baking_time, + delegate )) + >>= fun () -> + Lwt.return_some + (first_potential_baking_time, first_potential_round)) + | None -> ( + let round_durations = state.global_state.round_durations in + (* Compute the timestamp at which the new level will start at + round 0.*) + Round.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round:Round.zero + |> function + | Error _ -> Lwt.return_none + | Ok min_possible_time -> ( + (* If this timestamp exists and is not yet outdated, the + earliest round to bake is thereby 0. Otherwise, we + compute the round from the current timestamp. This + possibly means the baker has been late. *) + (if Time.Protocol.(now < min_possible_time) then ok Round.zero + else + Environment.wrap_tzresult + @@ Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp:now) + |> function + | Error _ -> Lwt.return_none + | Ok earliest_round -> ( + (* There does not necessarily exists a slot that is + equal to [earliest_round]. We must find the earliest + slot after this value for which a validator is + designated to propose. *) + match + first_potential_round_at_next_level state ~earliest_round + with + | None -> Lwt.return_none + | Some (first_potential_round, delegate) -> ( + (* Check if we already have proposed something at next + level. If so, we can skip. Otherwise, we recompute + the timestamp for the + [first_potential_round]. Finally, from this + [first_potential_baking_time], we can return. *) + match state.level_state.next_level_proposed_round with + | Some proposed_round + when Round.(proposed_round >= first_potential_round) -> + Events.(emit proposal_already_injected ()) + >>= fun () -> Lwt.return_none + | None | Some _ -> ( + timestamp_of_round + state.global_state.cache.known_timestamps + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round:first_potential_round + |> function + | Error _ -> Lwt.return_none + | Ok first_potential_baking_time -> + Events.( + emit + next_potential_slot + ( Int32.succ state.level_state.current_level, + first_potential_round, + first_potential_baking_time, + delegate )) + >>= fun () -> + (* memoize this *) + let () = + let this_round_duration = + Round.round_duration + round_durations + first_potential_round + in + let end_first_potential_baking_time = + Timestamp.( + first_potential_baking_time + +? this_round_duration) + |> function + | Ok x -> x + | Error _ -> assert false + in + Baking_cache.( + Round_timestamp_interval_cache.replace + state.global_state.cache.round_timestamps + { + predecessor_timestamp; + predecessor_round; + time_interval = + ( first_potential_baking_time, + end_first_potential_baking_time ); + } + ( first_potential_baking_time, + first_potential_round, + delegate )) + in + Lwt.return_some + ( first_potential_baking_time, + first_potential_round ))))))) + +(** From the current [state], the function returns an Lwt promise that + fulfills once the nearest timeout is expired and at which the state + machine will react. + + Both subfunctions [wait_baking_time] and [wait_end_of_round] are + using the blocking function + [Baking_scheduling.sleep_until]. However, this call is binded into + a Lwt promise. Hence, it just won't get fulfilled until sleep time + has elapsed. Once the promise is fulfilled, + [Baking_scheduling.wait_next_event] handles with [Lwt.choose] to + react and trigger event [Timeout]. *) +let compute_next_timeout state : Baking_state.timeout_kind Lwt.t tzresult Lwt.t + = + (* FIXME: this function (may) try to instantly repropose a block *) + let open Baking_state in + let wait_end_of_round ?(delta = 0L) (next_round_time, next_round) = + let next_time = Time.Protocol.add next_round_time delta in + let now = Time.System.now () in + let delay = Ptime.diff (Time.System.of_protocol_exn next_time) now in + let current_round = Int32.pred @@ Round.to_int32 next_round in + (if delta = 0L then + Events.(emit waiting_end_of_round (delay, current_round, next_time)) + else + Events.( + emit + waiting_delayed_end_of_round + (delay, current_round, next_time, delta))) + >>= fun () -> + let end_of_round = + Lwt.return + @@ End_of_round {ending_round = state.round_state.current_round} + in + match sleep_until next_time with + | None -> return end_of_round + | Some t -> return (t >>= fun () -> end_of_round) + in + let wait_baking_time_next_level (next_baking_time, next_baking_round) = + let now = Time.System.now () in + let delay = Ptime.diff (Time.System.of_protocol_exn next_baking_time) now in + Events.(emit waiting_time_to_bake (delay, next_baking_time)) >>= fun () -> + match sleep_until next_baking_time with + | None -> + Events.(emit no_need_to_wait_for_proposal ()) >>= fun () -> + return + (Lwt.return (Time_to_bake_next_level {at_round = next_baking_round})) + | Some t -> + return + ( t >>= fun () -> + Lwt.return (Time_to_bake_next_level {at_round = next_baking_round}) + ) + in + let delay_next_round_timeout next_round = + (* we only delay if it's our turn to bake *) + match + State_transitions.round_proposer + state + state.level_state.delegate_slots.own_delegate_slots + (snd next_round) + with + | Some _ -> + let delta = + state.global_state.constants.parametric.minimal_block_delay + |> Period.to_seconds + |> fun d -> Int64.div d 5L + in + (* NB: this means 6 seconds delay, if the first round duration is + 30. *) + wait_end_of_round ~delta next_round + | None -> wait_end_of_round next_round + in + (* TODO: re-use what has been done in round_synchronizer.ml *) + (* Compute the timestamp of the next possible round. *) + let next_round = compute_next_round_time state in + compute_next_potential_baking_time_at_next_level state >>= fun next_baking -> + match (next_round, next_baking) with + | None, None -> + Events.(emit waiting_for_new_head ()) >>= fun () -> + return (Lwt_utils.never_ending () >>= fun () -> assert false) + (* We have no slot at the next level in the near future, we will + patiently wait for the next round. *) + | Some next_round, None -> ( + (* If there is an elected block, then we make the assumption + that the bakers at the next level have also received an + endorsement quorum, and we delay a bit injecting at the next + round, so that there are not two blocks injected at the same + time. *) + match state.level_state.elected_block with + | None -> wait_end_of_round next_round + | Some _elected_block -> delay_next_round_timeout next_round) + (* There is no timestamp for a successor round but there is for a + future baking slot, we will wait to bake. *) + | None, Some next_baking -> wait_baking_time_next_level next_baking + (* We choose the earliest timestamp between waiting to bake and + waiting for the next round. *) + | ( Some ((next_round_time, next_round) as next_round_info), + Some ((next_baking_time, _) as next_baking) ) -> + (* If we can bake at the next level before the end of the next + round, then do so. This is because the proposed block will have + a smaller timestamp than the earliest block at next level built + on top of the proposal made at the next round (at the current + level). *) + let round_durations = state.global_state.round_durations in + let next_round_duration = + Round.round_duration round_durations next_round |> Period.to_seconds + in + if + Time.Protocol.( + next_baking_time < add next_round_time next_round_duration) + then wait_baking_time_next_level next_baking + else + (* same observation is in the [(Some next_round, None)] case *) + delay_next_round_timeout next_round_info + +(* initialises endorsable_payload with the PQC included in the latest block + if there is one and if it's more recent than the one loaded from disk + if any *) +let may_initialise_with_latest_proposal_pqc state = + let p = state.level_state.latest_proposal in + match p.block.prequorum with + | None -> return state + | Some pqc -> ( + match state.level_state.endorsable_payload with + | Some ep when ep.prequorum.round >= pqc.round -> + (*do not change the endorsable_payload loaded from disk if it's + more recent *) + return state + | Some _ | None -> + return + { + state with + level_state = + { + state.level_state with + endorsable_payload = Some {prequorum = pqc; proposal = p}; + }; + }) + +let create_round_durations constants = + let first_round_duration = + constants.Constants.parametric.minimal_block_delay + in + let delay_increment_per_round = + constants.parametric.delay_increment_per_round + in + Environment.wrap_tzresult + (Round.Durations.create ~first_round_duration ~delay_increment_per_round) + +let create_initial_state cctxt ?(synchronize = true) ~chain config + operation_worker ~(current_proposal : Baking_state.proposal) delegates = + (* FIXME? consider saved endorsable value *) + let open Protocol in + let open Baking_state in + Shell_services.Chain.chain_id cctxt ~chain () >>=? fun chain_id -> + Alpha_services.Constants.all cctxt (`Hash chain_id, `Head 0) + >>=? fun constants -> + create_round_durations constants >>?= fun round_durations -> + Baking_state.( + match config.Baking_configuration.validation with + | Node -> return Node + | Local {context_path} -> + Baking_simulator.load_context ~context_path >>=? fun index -> + return (Local index) + | ContextIndex index -> return (Local index)) + >>=? fun validation_mode -> + let cache = Baking_state.create_cache () in + let global_state = + { + cctxt; + chain_id; + config; + constants; + round_durations; + operation_worker; + validation_mode; + delegates; + cache; + } + in + let chain = `Hash chain_id in + let current_level = current_proposal.block.shell.level in + Baking_state.compute_delegate_slots + cctxt + delegates + ~level:current_level + ~chain + >>=? fun delegate_slots -> + Baking_state.compute_delegate_slots + cctxt + delegates + ~level:(Int32.succ current_level) + ~chain + >>=? fun next_level_delegate_slots -> + let elected_block = + if + Tezos_crypto.Protocol_hash.( + current_proposal.block.protocol <> Protocol.hash + && current_proposal.block.next_protocol = Protocol.hash) + then + (* If the last block is a protocol transition, we admit it as a + final block *) + Some {proposal = current_proposal; endorsement_qc = []} + else None + in + let level_state = + { + current_level = current_proposal.block.shell.level; + latest_proposal = current_proposal; + locked_round = None; + endorsable_payload = None; + elected_block; + delegate_slots; + next_level_delegate_slots; + next_level_proposed_round = None; + } + in + (if synchronize then + let round_durations = + Stdlib.Option.get + @@ Round.Durations.create_opt + ~first_round_duration:constants.parametric.minimal_block_delay + ~delay_increment_per_round: + constants.parametric.delay_increment_per_round + in + Baking_actions.compute_round current_proposal round_durations + >>? fun current_round -> ok {current_round; current_phase = Idle} + else ok {Baking_state.current_round = Round.zero; current_phase = Idle}) + >>?= fun round_state -> + let state = {global_state; level_state; round_state} in + (* Try loading locked round and endorsable round from disk *) + Baking_state.may_load_endorsable_data state >>=? fun state -> + may_initialise_with_latest_proposal_pqc state + +let compute_bootstrap_event state = + let open Baking_state in + (* Check if we are in the current round *) + if + Round.( + state.level_state.latest_proposal.block.round + = state.round_state.current_round) + then + (* If so, then trigger the new proposal event to possibly preendorse *) + ok @@ Baking_state.New_proposal state.level_state.latest_proposal + else + (* Otherwise, trigger the end of round to check whether we + need to propose at this level or not *) + Environment.wrap_tzresult @@ Round.pred state.round_state.current_round + >>? fun ending_round -> + ok @@ Baking_state.Timeout (End_of_round {ending_round}) + +let rec automaton_loop ?(stop_on_event = fun _ -> false) ~config ~on_error + loop_state state event = + let state_recorder ~new_state = + match config.Baking_configuration.state_recorder with + | Baking_configuration.Filesystem -> + Baking_state.may_record_new_state ~previous_state:state ~new_state + | Baking_configuration.Disabled -> return_unit + in + State_transitions.step state event >>= fun (state', action) -> + (Baking_actions.perform_action ~state_recorder state' action >>= function + | Ok state'' -> return state'' + | Error error -> + on_error error >>=? fun () -> + (* Still try to record the intermediate state; ignore potential + errors. *) + state_recorder ~new_state:state' >>= fun _ -> return state') + >>=? fun state'' -> + compute_next_timeout state'' >>=? fun next_timeout -> + wait_next_event ~timeout:(next_timeout >|= fun e -> `Timeout e) loop_state + >>=? function + | None -> + (* Termination *) + return_none + | Some event -> + if stop_on_event event then return_some event + else + automaton_loop ~stop_on_event ~config ~on_error loop_state state'' event + +let perform_sanity_check cctxt ~chain_id = + let open Baking_errors in + let prefix_base_dir f = Filename.Infix.(cctxt#get_base_dir // f) in + let nonces_location = Baking_files.resolve_location ~chain_id `Nonce in + Baking_nonces.load cctxt nonces_location + |> trace + (Cannot_load_local_file + (prefix_base_dir (Baking_files.filename nonces_location) ^ "s")) + >>=? fun _ -> + let highwatermarks_location = + Baking_files.resolve_location ~chain_id `Highwatermarks + in + Baking_highwatermarks.load cctxt highwatermarks_location + |> trace + (Cannot_load_local_file + (prefix_base_dir (Baking_files.filename highwatermarks_location) ^ "s")) + >>=? fun _ -> + let state_location = Baking_files.resolve_location ~chain_id `State in + Baking_state.load_endorsable_data cctxt state_location + |> trace + (Cannot_load_local_file + (prefix_base_dir (Baking_files.filename state_location))) + >>=? fun _ -> return_unit + +let run cctxt ?canceler ?(stop_on_event = fun _ -> false) + ?(on_error = fun _ -> return_unit) ~chain config delegates = + Shell_services.Chain.chain_id cctxt ~chain () >>=? fun chain_id -> + perform_sanity_check cctxt ~chain_id >>=? fun () -> + Node_rpc.monitor_proposals cctxt ~chain () + >>=? fun (block_stream, _block_stream_stopper) -> + (Lwt_stream.get block_stream >>= function + | Some current_head -> return current_head + | None -> failwith "head stream unexpectedly ended") + >>=? fun current_proposal -> + Operation_worker.create cctxt >>= fun operation_worker -> + Option.iter + (fun canceler -> + Lwt_canceler.on_cancel canceler (fun () -> + Operation_worker.shutdown_worker operation_worker >>= fun _ -> + Lwt.return_unit)) + canceler ; + create_initial_state + cctxt + ~chain + config + operation_worker + ~current_proposal + delegates + >>=? fun initial_state -> + let cloned_block_stream = Lwt_stream.clone block_stream in + Baking_nonces.start_revelation_worker + cctxt + initial_state.global_state.config.nonce + initial_state.global_state.chain_id + initial_state.global_state.constants + cloned_block_stream + >>= fun revelation_worker_canceler -> + Option.iter + (fun canceler -> + Lwt_canceler.on_cancel canceler (fun () -> + Lwt_canceler.cancel revelation_worker_canceler >>= fun _ -> + Lwt.return_unit)) + canceler ; + + let loop_state = + create_loop_state block_stream initial_state.global_state.operation_worker + in + let on_error err = + Events.(emit error_while_baking err) >>= fun () -> + (* TODO? retry a bounded number of time *) + (* let retries = config.Baking_configuration.retries_on_failure in *) + on_error err + in + compute_bootstrap_event initial_state >>?= fun initial_event -> + protect + ~on_error:(fun err -> + Option.iter_es Lwt_canceler.cancel canceler >>= fun _ -> + Lwt.return_error err) + (fun () -> + automaton_loop + ~stop_on_event + ~config + ~on_error + loop_state + initial_state + initial_event + >>=? fun _ignored_event -> return_unit) diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.mli b/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.mli new file mode 100644 index 000000000000..83e167cfcf34 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_scheduling.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Baking_state +open Protocol.Alpha_context + +type loop_state + +val create_loop_state : + proposal Lwt_stream.t -> Operation_worker.t -> loop_state + +val sleep_until : Time.Protocol.t -> unit Lwt.t option + +(** An event monitor using the streams in [loop_state] (to create + promises) and a timeout promise [timeout]. The function reacts to a + promise being fulfilled by firing an event [Baking_state.event]. *) +val wait_next_event : + timeout:[`Timeout of timeout_kind] Lwt.t -> + loop_state -> + (event option, error trace) result Lwt.t + +val compute_next_round_time : state -> (Time.Protocol.t * Round.t) option + +val first_potential_round_at_next_level : + state -> + earliest_round:Round.t -> + (Round.t * consensus_key_and_delegate) option + +val compute_next_potential_baking_time_at_next_level : + state -> (Time.Protocol.t * Round.t) option Lwt.t + +val compute_next_timeout : state -> timeout_kind Lwt.t tzresult Lwt.t + +val create_initial_state : + Protocol_client_context.full -> + ?synchronize:bool -> + chain:Chain_services.chain -> + Baking_configuration.t -> + Operation_worker.t -> + current_proposal:proposal -> + consensus_key list -> + state tzresult Lwt.t + +val compute_bootstrap_event : state -> event tzresult + +val automaton_loop : + ?stop_on_event:(event -> bool) -> + config:Baking_configuration.t -> + on_error:(tztrace -> (unit, tztrace) result Lwt.t) -> + loop_state -> + state -> + event -> + event option tzresult Lwt.t + +val run : + Protocol_client_context.full -> + ?canceler:Lwt_canceler.t -> + ?stop_on_event:(event -> bool) -> + ?on_error:(tztrace -> unit tzresult Lwt.t) -> + chain:Chain_services.chain -> + Baking_configuration.t -> + consensus_key list -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_simulator.ml b/src/proto_016_PtMumbai/lib_delegate/baking_simulator.ml new file mode 100644 index 000000000000..c4bcd1aa80dc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_simulator.ml @@ -0,0 +1,158 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context + +type error += Failed_to_checkout_context + +type error += Invalid_context + +let () = + register_error_kind + `Permanent + ~id:"Client_baking_simulator.failed_to_checkout_context" + ~title:"Failed to checkout context" + ~description:"The given context hash does not exists in the context." + ~pp:(fun ppf () -> Format.fprintf ppf "Failed to checkout the context") + Data_encoding.unit + (function Failed_to_checkout_context -> Some () | _ -> None) + (fun () -> Failed_to_checkout_context) ; + register_error_kind + `Permanent + ~id:"Client_baking_simulator.invalid_context" + ~title:"Invalid context" + ~description:"Occurs when the context is inconsistent." + ~pp:(fun ppf () -> Format.fprintf ppf "The given context is invalid.") + Data_encoding.unit + (function Invalid_context -> Some () | _ -> None) + (fun () -> Invalid_context) + +type incremental = { + predecessor : Baking_state.block_info; + context : Tezos_protocol_environment.Context.t; + state : Protocol.validation_state * Protocol.application_state; + rev_operations : Operation.packed list; + header : Tezos_base.Block_header.shell_header; +} + +let load_context ~context_path = + protect (fun () -> + Context.init ~readonly:true context_path >>= fun index -> + return (Abstract_context_index.abstract index)) + +let check_context_consistency (abstract_index : Abstract_context_index.t) + context_hash = + protect (fun () -> + (* Hypothesis : the version key exists *) + let version_key = ["version"] in + abstract_index.checkout_fun context_hash >>= function + | None -> fail Failed_to_checkout_context + | Some context -> ( + Context_ops.mem context version_key >>= function + | true -> return_unit + | false -> fail Invalid_context)) + +let begin_construction ~timestamp ~protocol_data + (abstract_index : Abstract_context_index.t) predecessor chain_id = + protect (fun () -> + let { + Baking_state.shell = pred_shell; + hash = pred_hash; + resulting_context_hash; + _; + } = + predecessor + in + abstract_index.checkout_fun resulting_context_hash >>= function + | None -> fail Failed_to_checkout_context + | Some context -> + let header : Tezos_base.Block_header.shell_header = + Tezos_base.Block_header. + { + predecessor = pred_hash; + proto_level = pred_shell.proto_level; + validation_passes = 0; + fitness = pred_shell.fitness; + timestamp; + level = pred_shell.level; + context = Tezos_crypto.Context_hash.zero (* fake context hash *); + operations_hash = + Tezos_crypto.Operation_list_list_hash.zero (* fake op hash *); + } + in + let mode = + Lifted_protocol.Construction + { + predecessor_hash = predecessor.hash; + timestamp; + block_header_data = protocol_data; + } + in + Lifted_protocol.begin_validation + context + chain_id + mode + ~predecessor:pred_shell + ~cache:`Lazy + >>=? fun validation_state -> + Lifted_protocol.begin_application + context + chain_id + mode + ~predecessor:pred_shell + ~cache:`Lazy + >>=? fun application_state -> + let state = (validation_state, application_state) in + return {predecessor; context; state; rev_operations = []; header}) + +let ( let** ) x k = + let open Lwt_result_syntax in + let*! x = x in + let*? x = Environment.wrap_tzresult x in + k x + +let add_operation st (op : Operation.packed) = + protect (fun () -> + let validation_state, application_state = st.state in + let oph = Operation.hash_packed op in + let** validation_state = + Protocol.validate_operation validation_state oph op + in + let** application_state, receipt = + Protocol.apply_operation application_state oph op + in + let state = (validation_state, application_state) in + return ({st with state; rev_operations = op :: st.rev_operations}, receipt)) + +let finalize_construction inc = + protect (fun () -> + let validation_state, application_state = inc.state in + let** () = Protocol.finalize_validation validation_state in + let** result = + Protocol.finalize_application application_state (Some inc.header) + in + return result) diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_simulator.mli b/src/proto_016_PtMumbai/lib_delegate/baking_simulator.mli new file mode 100644 index 000000000000..d6d45255028e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_simulator.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type incremental = { + predecessor : Baking_state.block_info; + context : Tezos_protocol_environment.Context.t; + state : validation_state * application_state; + rev_operations : Operation.packed list; + header : Tezos_base.Block_header.shell_header; +} + +val load_context : + context_path:string -> Abstract_context_index.t tzresult Lwt.t + +(** Make sure that the given context is consistent by trying to read in it *) +val check_context_consistency : + Abstract_context_index.t -> Tezos_crypto.Context_hash.t -> unit tzresult Lwt.t + +val begin_construction : + timestamp:Time.Protocol.t -> + protocol_data:block_header_data -> + Abstract_context_index.t -> + Baking_state.block_info -> + Tezos_crypto.Chain_id.t -> + incremental tzresult Lwt.t + +val add_operation : + incremental -> + Operation.packed -> + (incremental * operation_receipt) tzresult Lwt.t + +val finalize_construction : + incremental -> + (Tezos_protocol_environment.validation_result * block_header_metadata) + tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_state.ml b/src/proto_016_PtMumbai/lib_delegate/baking_state.ml new file mode 100644 index 000000000000..a5cb4ae67159 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_state.ml @@ -0,0 +1,1044 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +(** A consensus key (aka, a validator) is identified by its alias name, its + public key, its public key hash, and its secret key. *) +type consensus_key = { + alias : string option; + public_key : Tezos_crypto.Signature.Public_key.t; + public_key_hash : Tezos_crypto.Signature.Public_key_hash.t; + secret_key_uri : Client_keys.sk_uri; +} + +let consensus_key_encoding = + let open Data_encoding in + conv + (fun {alias; public_key; public_key_hash; secret_key_uri} -> + ( alias, + public_key, + public_key_hash, + Uri.to_string (secret_key_uri :> Uri.t) )) + (fun (alias, public_key, public_key_hash, secret_key_uri) -> + { + alias; + public_key; + public_key_hash; + secret_key_uri = + (match Client_keys.make_sk_uri (Uri.of_string secret_key_uri) with + | Ok sk -> sk + | Error e -> Format.kasprintf Stdlib.failwith "%a" pp_print_trace e); + }) + (obj4 + (req "alias" (option string)) + (req "public_key" Tezos_crypto.Signature.Public_key.encoding) + (req "public_key_hash" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "secret_key_uri" string)) + +let pp_consensus_key fmt {alias; public_key_hash; _} = + match alias with + | None -> + Format.fprintf + fmt + "%a" + Tezos_crypto.Signature.Public_key_hash.pp + public_key_hash + | Some alias -> + Format.fprintf + fmt + "%s (%a)" + alias + Tezos_crypto.Signature.Public_key_hash.pp + public_key_hash + +type consensus_key_and_delegate = + consensus_key * Tezos_crypto.Signature.Public_key_hash.t + +let consensus_key_and_delegate_encoding = + let open Data_encoding in + merge_objs + consensus_key_encoding + (obj1 (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding)) + +let pp_consensus_key_and_delegate fmt (consensus_key, delegate) = + if + Tezos_crypto.Signature.Public_key_hash.equal + consensus_key.public_key_hash + delegate + then pp_consensus_key fmt consensus_key + else + Format.fprintf + fmt + "%a@,on behalf of %a" + pp_consensus_key + consensus_key + Tezos_crypto.Signature.Public_key_hash.pp + delegate + +type validation_mode = Node | Local of Abstract_context_index.t + +type prequorum = { + level : int32; + round : Round.t; + block_payload_hash : Block_payload_hash.t; + preendorsements : Kind.preendorsement operation list; +} + +type block_info = { + hash : Tezos_crypto.Block_hash.t; + shell : Block_header.shell_header; + resulting_context_hash : Tezos_crypto.Context_hash.t; + payload_hash : Block_payload_hash.t; + payload_round : Round.t; + round : Round.t; + protocol : Tezos_crypto.Protocol_hash.t; + next_protocol : Tezos_crypto.Protocol_hash.t; + prequorum : prequorum option; + quorum : Kind.endorsement operation list; + payload : Operation_pool.payload; + live_blocks : Tezos_crypto.Block_hash.Set.t; +} + +type cache = { + known_timestamps : Timestamp.time Baking_cache.Timestamp_of_round_cache.t; + round_timestamps : + (Timestamp.time * Round.t * consensus_key_and_delegate) + Baking_cache.Round_timestamp_interval_cache.t; +} + +type global_state = { + (* client context *) + cctxt : Protocol_client_context.full; + (* chain id *) + chain_id : Tezos_crypto.Chain_id.t; + (* baker configuration *) + config : Baking_configuration.t; + (* protocol constants *) + constants : Constants.t; + (* round durations *) + round_durations : Round.round_durations; + (* worker that monitor and aggregates new operations *) + operation_worker : Operation_worker.t; + (* the validation mode used by the baker*) + validation_mode : validation_mode; + (* the delegates on behalf of which the baker is running *) + delegates : consensus_key list; + cache : cache; +} + +let prequorum_encoding = + let open Data_encoding in + conv + (fun {level; round; block_payload_hash; preendorsements} -> + (level, round, block_payload_hash, List.map Operation.pack preendorsements)) + (fun (level, round, block_payload_hash, preendorsements) -> + { + level; + round; + block_payload_hash; + preendorsements = + List.filter_map Operation_pool.unpack_preendorsement preendorsements; + }) + (obj4 + (req "level" int32) + (req "round" Round.encoding) + (req "block_payload_hash" Block_payload_hash.encoding) + (req "preendorsements" (list (dynamic_size Operation.encoding)))) + +let block_info_encoding = + let open Data_encoding in + conv + (fun { + hash; + shell; + resulting_context_hash; + payload_hash; + payload_round; + round; + protocol; + next_protocol; + prequorum; + quorum; + payload; + live_blocks; + } -> + ( ( hash, + shell, + resulting_context_hash, + payload_hash, + payload_round, + round, + protocol, + next_protocol, + prequorum, + List.map Operation.pack quorum ), + (payload, live_blocks) )) + (fun ( ( hash, + shell, + resulting_context_hash, + payload_hash, + payload_round, + round, + protocol, + next_protocol, + prequorum, + quorum ), + (payload, live_blocks) ) -> + { + hash; + shell; + resulting_context_hash; + payload_hash; + payload_round; + round; + protocol; + next_protocol; + prequorum; + quorum = List.filter_map Operation_pool.unpack_endorsement quorum; + payload; + live_blocks; + }) + (merge_objs + (obj10 + (req "hash" Tezos_crypto.Block_hash.encoding) + (req "shell" Block_header.shell_header_encoding) + (req "resulting_context_hash" Tezos_crypto.Context_hash.encoding) + (req "payload_hash" Block_payload_hash.encoding) + (req "payload_round" Round.encoding) + (req "round" Round.encoding) + (req "protocol" Tezos_crypto.Protocol_hash.encoding) + (req "next_protocol" Tezos_crypto.Protocol_hash.encoding) + (req "prequorum" (option prequorum_encoding)) + (req "quorum" (list (dynamic_size Operation.encoding)))) + (obj2 + (req "payload" Operation_pool.payload_encoding) + (req "live_blocks" Tezos_crypto.Block_hash.Set.encoding))) + +let round_of_shell_header shell_header = + Environment.wrap_tzresult + @@ Fitness.from_raw shell_header.Tezos_base.Block_header.fitness + >>? fun fitness -> ok (Fitness.round fitness) + +module SlotMap : Map.S with type key = Slot.t = Map.Make (Slot) + +(** An endorsing slot consists of the public key hash of a delegate, a + list of slots (i.e., a list of position indexes in the slot map, in + other words the list of rounds when it will be the proposer), and + its endorsing power. *) +type endorsing_slot = {slots : Slot.t list; endorsing_power : int} + +(* FIXME: determine if the slot map should contain all slots or just + the first one *) +(* We also use the delegate slots as proposal slots *) +(* TODO: make sure that this is correct *) +type delegate_slots = { + (* be careful not to duplicate endorsing slots with different slots + keys: always use the first slot in the slots list *) + own_delegate_slots : (consensus_key_and_delegate * endorsing_slot) SlotMap.t; + all_delegate_slots : endorsing_slot SlotMap.t; + all_slots_by_round : Slot.t array; +} + +type proposal = {block : block_info; predecessor : block_info} + +let proposal_encoding = + let open Data_encoding in + conv + (fun {block; predecessor} -> (block, predecessor)) + (fun (block, predecessor) -> {block; predecessor}) + (obj2 + (req "block" block_info_encoding) + (req "predecessor" block_info_encoding)) + +type locked_round = {payload_hash : Block_payload_hash.t; round : Round.t} + +let locked_round_encoding = + let open Data_encoding in + conv + (fun {payload_hash; round} -> (payload_hash, round)) + (fun (payload_hash, round) -> {payload_hash; round}) + (obj2 + (req "payload_hash" Block_payload_hash.encoding) + (req "round" Round.encoding)) + +type endorsable_payload = {proposal : proposal; prequorum : prequorum} + +let endorsable_payload_encoding = + let open Data_encoding in + conv + (fun {proposal; prequorum} -> (proposal, prequorum)) + (fun (proposal, prequorum) -> {proposal; prequorum}) + (obj2 + (req "proposal" proposal_encoding) + (req "prequorum" prequorum_encoding)) + +type elected_block = { + proposal : proposal; + endorsement_qc : Kind.endorsement Operation.t list; +} + +(* Updated only when we receive a block at a different level. + + N.B. it may be our own: implying that we should not update unless + we already baked a block *) +type level_state = { + current_level : int32; + latest_proposal : proposal; + (* Last proposal received where we injected an endorsement (thus we + have seen 2f+1 preendorsements) *) + locked_round : locked_round option; + (* Latest payload where we've seen a proposal reach 2f+1 preendorsements *) + endorsable_payload : endorsable_payload option; + (* Block for which we've seen 2f+1 endorsements and that we may bake onto *) + elected_block : elected_block option; + delegate_slots : delegate_slots; + next_level_delegate_slots : delegate_slots; + next_level_proposed_round : Round.t option; +} + +type phase = Idle | Awaiting_preendorsements | Awaiting_endorsements + +let phase_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Idle" + (Tag 0) + unit + (function Idle -> Some () | _ -> None) + (fun () -> Idle); + case + ~title:"Awaiting_preendorsements" + (Tag 1) + unit + (function Awaiting_preendorsements -> Some () | _ -> None) + (fun () -> Awaiting_preendorsements); + case + ~title:"Awaiting_endorsements" + (Tag 2) + unit + (function Awaiting_endorsements -> Some () | _ -> None) + (fun () -> Awaiting_endorsements); + ] + +type round_state = {current_round : Round.t; current_phase : phase} + +type state = { + global_state : global_state; + level_state : level_state; + round_state : round_state; +} + +type t = state + +type timeout_kind = + | End_of_round of {ending_round : Round.t} + | Time_to_bake_next_level of {at_round : Round.t} + +let timeout_kind_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"End_of_round" + Round.encoding + (function + | End_of_round {ending_round} -> Some ending_round | _ -> None) + (fun ending_round -> End_of_round {ending_round}); + case + (Tag 1) + ~title:"Time_to_bake_next_level" + Round.encoding + (function + | Time_to_bake_next_level {at_round} -> Some at_round | _ -> None) + (fun at_round -> Time_to_bake_next_level {at_round}); + ] + +type voting_power = int + +type event = + | New_proposal of proposal + | Prequorum_reached of + Operation_worker.candidate + * voting_power + * Kind.preendorsement operation list + | Quorum_reached of + Operation_worker.candidate + * voting_power + * Kind.endorsement operation list + | Timeout of timeout_kind + +let event_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"New_proposal" + proposal_encoding + (function New_proposal p -> Some p | _ -> None) + (fun p -> New_proposal p); + case + (Tag 1) + ~title:"Prequorum_reached" + (tup3 + Operation_worker.candidate_encoding + Data_encoding.int31 + (Data_encoding.list (dynamic_size Operation.encoding))) + (function + | Prequorum_reached (candidate, voting_power, ops) -> + Some (candidate, voting_power, List.map Operation.pack ops) + | _ -> None) + (fun (candidate, voting_power, ops) -> + Prequorum_reached + (candidate, voting_power, Operation_pool.filter_preendorsements ops)); + case + (Tag 2) + ~title:"Quorum_reached" + (tup3 + Operation_worker.candidate_encoding + Data_encoding.int31 + (Data_encoding.list (dynamic_size Operation.encoding))) + (function + | Quorum_reached (candidate, voting_power, ops) -> + Some (candidate, voting_power, List.map Operation.pack ops) + | _ -> None) + (fun (candidate, voting_power, ops) -> + Quorum_reached + (candidate, voting_power, Operation_pool.filter_endorsements ops)); + case + (Tag 3) + ~title:"Timeout" + timeout_kind_encoding + (function Timeout tk -> Some tk | _ -> None) + (fun tk -> Timeout tk); + ] + +(* Legacy disk state support: this will only be used when migrating + from a baker using the previous format to the new one and will + happen once. *) + +type legacy_block_info = { + legacy_hash : Tezos_crypto.Block_hash.t; + legacy_shell : Block_header.shell_header; + legacy_payload_hash : Block_payload_hash.t; + legacy_payload_round : Round.t; + legacy_round : Round.t; + legacy_protocol : Tezos_crypto.Protocol_hash.t; + legacy_next_protocol : Tezos_crypto.Protocol_hash.t; + legacy_prequorum : prequorum option; + legacy_quorum : Kind.endorsement operation list; + legacy_payload : Operation_pool.payload; + legacy_live_blocks : Tezos_crypto.Block_hash.Set.t; +} + +let legacy_block_info_encoding : legacy_block_info Data_encoding.t = + let open Data_encoding in + conv + (fun ({ + legacy_hash; + legacy_shell; + legacy_payload_hash; + legacy_payload_round; + legacy_round; + legacy_protocol; + legacy_next_protocol; + legacy_prequorum; + legacy_quorum; + legacy_payload; + legacy_live_blocks; + } : + legacy_block_info) -> + ( ( legacy_hash, + legacy_shell, + legacy_payload_hash, + legacy_payload_round, + legacy_round, + legacy_protocol, + legacy_next_protocol, + legacy_prequorum, + List.map Operation.pack legacy_quorum, + legacy_payload ), + legacy_live_blocks )) + (fun ( ( legacy_hash, + legacy_shell, + legacy_payload_hash, + legacy_payload_round, + legacy_round, + legacy_protocol, + legacy_next_protocol, + legacy_prequorum, + legacy_quorum, + legacy_payload ), + legacy_live_blocks ) -> + { + legacy_hash; + legacy_shell; + legacy_payload_hash; + legacy_payload_round; + legacy_round; + legacy_protocol; + legacy_next_protocol; + legacy_prequorum; + legacy_quorum = + List.filter_map Operation_pool.unpack_endorsement legacy_quorum; + legacy_payload; + legacy_live_blocks; + }) + (merge_objs + (obj10 + (req "hash" Tezos_crypto.Block_hash.encoding) + (req "shell" Block_header.shell_header_encoding) + (req "payload_hash" Block_payload_hash.encoding) + (req "payload_round" Round.encoding) + (req "round" Round.encoding) + (req "protocol" Tezos_crypto.Protocol_hash.encoding) + (req "next_protocol" Tezos_crypto.Protocol_hash.encoding) + (req "prequorum" (option prequorum_encoding)) + (req "quorum" (list (dynamic_size Operation.encoding))) + (req "payload" Operation_pool.payload_encoding)) + (obj1 (req "live_blocks" Tezos_crypto.Block_hash.Set.encoding))) + +type legacy_proposal = { + legacy_block : legacy_block_info; + legacy_predecessor : legacy_block_info; +} + +let legacy_proposal_encoding = + let open Data_encoding in + conv + (fun {legacy_block; legacy_predecessor} -> + (legacy_block, legacy_predecessor)) + (fun (legacy_block, legacy_predecessor) -> + {legacy_block; legacy_predecessor}) + (obj2 + (req "block" legacy_block_info_encoding) + (req "predecessor" legacy_block_info_encoding)) + +type legacy_endorsable_payload = { + legacy_proposal : legacy_proposal; + prequorum : prequorum; +} + +let legacy_endorsable_payload_encoding = + let open Data_encoding in + conv + (fun {legacy_proposal; prequorum} -> (legacy_proposal, prequorum)) + (fun (legacy_proposal, prequorum) -> {legacy_proposal; prequorum}) + (obj2 + (req "proposal" legacy_proposal_encoding) + (req "prequorum" prequorum_encoding)) + +type legacy_state_data = { + level_data : int32; + locked_round_data : locked_round option; + legacy_endorsable_payload_data : legacy_endorsable_payload option; +} + +let legacy_state_data_encoding = + let open Data_encoding in + conv + (fun {level_data; locked_round_data; legacy_endorsable_payload_data} -> + (level_data, locked_round_data, legacy_endorsable_payload_data)) + (fun (level_data, locked_round_data, legacy_endorsable_payload_data) -> + {level_data; locked_round_data; legacy_endorsable_payload_data}) + (obj3 + (req "level" int32) + (req "locked_round" (option locked_round_encoding)) + (req "endorsable_payload" (option legacy_endorsable_payload_encoding))) + +type state_data = { + level_data : int32; + locked_round_data : locked_round option; + endorsable_payload_data : endorsable_payload option; +} + +let update_legacy_state_data raw_data = + (* "Upgrade" the file format by dumping the legacy + endorsable data. It is sound as the new baker + cannot start (i.e. load the preexisting state) + until the new protocol activates. + + Note: the new encoding is not backward compatible + (unless the endorsable_payload_data is [None]). *) + let legacy_state_data = + Data_encoding.Binary.of_string_exn legacy_state_data_encoding raw_data + in + { + level_data = legacy_state_data.level_data; + locked_round_data = None; + endorsable_payload_data = None; + } + +(* Disk state *) + +let state_data_encoding = + let open Data_encoding in + conv + (fun {level_data; locked_round_data; endorsable_payload_data} -> + (level_data, locked_round_data, endorsable_payload_data)) + (fun (level_data, locked_round_data, endorsable_payload_data) -> + {level_data; locked_round_data; endorsable_payload_data}) + (obj3 + (req "level" int32) + (req "locked_round" (option locked_round_encoding)) + (req "endorsable_payload" (option endorsable_payload_encoding))) + +let record_state (state : state) = + let cctxt = state.global_state.cctxt in + let location = + Baking_files.resolve_location ~chain_id:state.global_state.chain_id `State + in + let filename = + Filename.Infix.(cctxt#get_base_dir // Baking_files.filename location) + in + protect @@ fun () -> + cctxt#with_lock @@ fun () -> + let level_data = state.level_state.current_level in + let locked_round_data = state.level_state.locked_round in + let endorsable_payload_data = state.level_state.endorsable_payload in + let bytes = + Data_encoding.Binary.to_bytes_exn + state_data_encoding + {level_data; locked_round_data; endorsable_payload_data} + in + let filename_tmp = filename ^ "_tmp" in + Lwt_io.with_file + ~flags:[Unix.O_CREAT; O_WRONLY; O_TRUNC; O_CLOEXEC; O_SYNC] + ~mode:Output + filename_tmp + (fun channel -> + Lwt_io.write_from_exactly channel bytes 0 (Bytes.length bytes)) + >>= fun () -> + Lwt_unix.rename filename_tmp filename >>= fun () -> return_unit + +type error += Broken_locked_values_invariant + +let () = + register_error_kind + `Permanent + ~id:"Baking_state.broken_locked_values_invariant" + ~title:"Broken locked values invariant" + ~description: + "The expected consistency invariant on locked values does not hold" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The expected consistency invariant on locked values does not hold") + Data_encoding.unit + (function Broken_locked_values_invariant -> Some () | _ -> None) + (fun () -> Broken_locked_values_invariant) + +let may_record_new_state ~previous_state ~new_state = + let { + current_level = previous_current_level; + locked_round = previous_locked_round; + endorsable_payload = previous_endorsable_payload; + _; + } = + previous_state.level_state + in + let { + current_level = new_current_level; + locked_round = new_locked_round; + endorsable_payload = new_endorsable_payload; + _; + } = + new_state.level_state + in + let is_new_state_consistent = + Compare.Int32.(new_current_level > previous_current_level) + || new_current_level = previous_current_level + && + if Compare.Int32.(new_current_level = previous_current_level) then + let is_new_locked_round_consistent = + match (new_locked_round, previous_locked_round) with + | None, None -> true + | Some _, None -> true + | None, Some _ -> false + | Some new_locked_round, Some previous_locked_round -> + Round.(new_locked_round.round >= previous_locked_round.round) + in + let is_new_endorsable_payload_consistent = + match (new_endorsable_payload, previous_endorsable_payload) with + | None, None -> true + | Some _, None -> true + | None, Some _ -> false + | Some new_endorsable_payload, Some previous_endorsable_payload -> + Round.( + new_endorsable_payload.proposal.block.round + >= previous_endorsable_payload.proposal.block.round) + in + is_new_locked_round_consistent && is_new_endorsable_payload_consistent + else true + in + fail_unless is_new_state_consistent Broken_locked_values_invariant + >>=? fun () -> + let has_not_changed = + previous_state.level_state.current_level + == new_state.level_state.current_level + && previous_state.level_state.locked_round + == new_state.level_state.locked_round + && previous_state.level_state.endorsable_payload + == new_state.level_state.endorsable_payload + in + if has_not_changed then return_unit else record_state new_state + +let load_endorsable_data cctxt location = + protect (fun () -> + let filename = + Filename.Infix.(cctxt#get_base_dir // Baking_files.filename location) + in + Lwt_unix.file_exists filename >>= function + | false -> return_none + | true -> + Lwt_io.with_file + ~flags:[Unix.O_EXCL; O_RDONLY; O_CLOEXEC] + ~mode:Input + filename + (fun channel -> + Lwt_io.read channel >>= fun str -> + match + Data_encoding.Binary.of_string_opt state_data_encoding str + with + | Some state_data -> Lwt.return state_data + | None -> Lwt.return (update_legacy_state_data str)) + >>= return_some) + +let may_load_endorsable_data state = + let cctxt = state.global_state.cctxt in + let chain_id = state.global_state.chain_id in + let location = Baking_files.resolve_location ~chain_id `State in + protect ~on_error:(fun _ -> return state) @@ fun () -> + cctxt#with_lock @@ fun () -> + load_endorsable_data cctxt location >>=? function + | None -> return state + | Some {level_data; locked_round_data; endorsable_payload_data} -> + if Compare.Int32.(state.level_state.current_level = level_data) then + let loaded_level_state = + { + state.level_state with + locked_round = locked_round_data; + endorsable_payload = endorsable_payload_data; + } + in + return {state with level_state = loaded_level_state} + else return state + +(* Helpers *) + +module DelegateSet = struct + include Set.Make (struct + type t = consensus_key + + let compare {public_key_hash = pkh; _} {public_key_hash = pkh'; _} = + Tezos_crypto.Signature.Public_key_hash.compare pkh pkh' + end) + + let find_pkh pkh s = + let exception Found of elt in + try + iter + (fun ({public_key_hash; _} as delegate) -> + if Tezos_crypto.Signature.Public_key_hash.equal pkh public_key_hash + then raise (Found delegate) + else ()) + s ; + None + with Found d -> Some d +end + +let cache_size_limit = 100 + +let compute_delegate_slots (cctxt : Protocol_client_context.full) + ?(block = `Head 0) ~level ~chain delegates = + let own_delegates = DelegateSet.of_list delegates in + Environment.wrap_tzresult (Raw_level.of_int32 level) >>?= fun level -> + Plugin.RPC.Validators.get cctxt (chain, block) ~levels:[level] + >>=? fun endorsing_rights -> + let own_delegate_slots, all_delegate_slots = + List.fold_left + (fun (own_map, all_map) slot -> + let {Plugin.RPC.Validators.consensus_key; delegate; slots; _} = slot in + let endorsing_slot = {endorsing_power = List.length slots; slots} in + let all_map = + List.fold_left + (fun all_map slot -> SlotMap.add slot endorsing_slot all_map) + all_map + slots + in + let own_map = + match DelegateSet.find_pkh consensus_key own_delegates with + | Some consensus_key -> + List.fold_left + (fun own_map slot -> + SlotMap.add + slot + ((consensus_key, delegate), endorsing_slot) + own_map) + own_map + slots + | None -> own_map + in + (own_map, all_map)) + (SlotMap.empty, SlotMap.empty) + endorsing_rights + in + let all_slots_by_round = + all_delegate_slots |> SlotMap.bindings |> List.split |> fst |> Array.of_list + in + return {own_delegate_slots; all_delegate_slots; all_slots_by_round} + +let create_cache () = + let open Baking_cache in + { + known_timestamps = Timestamp_of_round_cache.create cache_size_limit; + round_timestamps = Round_timestamp_interval_cache.create cache_size_limit; + } + +(* Pretty-printers *) + +let pp_validation_mode fmt = function + | Node -> Format.fprintf fmt "node" + | Local _ -> Format.fprintf fmt "local" + +let pp_global_state fmt {chain_id; config; validation_mode; delegates; _} = + Format.fprintf + fmt + "@[<v 2>Global state:@ chain_id: %a@ @[<v 2>config:@ %a@]@ \ + validation_mode: %a@ @[<v 2>delegates:@ %a@]@]" + Tezos_crypto.Chain_id.pp + chain_id + Baking_configuration.pp + config + pp_validation_mode + validation_mode + Format.(pp_print_list pp_consensus_key) + delegates + +let pp_option pp fmt = function + | None -> Format.fprintf fmt "none" + | Some v -> Format.fprintf fmt "%a" pp v + +let pp_prequorum fmt {level; round; block_payload_hash; preendorsements} = + Format.fprintf + fmt + "level: %ld, round: %a, payload_hash: %a, preendorsements: %d" + level + Round.pp + round + Block_payload_hash.pp_short + block_payload_hash + (List.length preendorsements) + +let pp_block_info fmt + { + hash; + shell; + payload_hash; + round; + protocol; + next_protocol; + prequorum; + quorum; + payload; + _; + } = + Format.fprintf + fmt + "@[<v 2>Block:@ hash: %a@ payload_hash: %a@ level: %ld@ round: %a@ \ + protocol: %a@ next protocol: %a@ prequorum: %a@ quorum: %d endorsements@ \ + payload: %a@]" + Tezos_crypto.Block_hash.pp + hash + Block_payload_hash.pp_short + payload_hash + shell.level + Round.pp + round + Tezos_crypto.Protocol_hash.pp_short + protocol + Tezos_crypto.Protocol_hash.pp_short + next_protocol + (pp_option pp_prequorum) + prequorum + (List.length quorum) + Operation_pool.pp_payload + payload + +let pp_proposal fmt {block; _} = pp_block_info fmt block + +let pp_locked_round fmt ({payload_hash; round} : locked_round) = + Format.fprintf + fmt + "payload hash: %a, round: %a" + Block_payload_hash.pp_short + payload_hash + Round.pp + round + +let pp_endorsable_payload fmt {proposal; prequorum} = + Format.fprintf + fmt + "proposal: %a, prequorum: %a" + Tezos_crypto.Block_hash.pp + proposal.block.hash + pp_prequorum + prequorum + +let pp_elected_block fmt {proposal; endorsement_qc} = + Format.fprintf + fmt + "@[<v 2>%a@ nb quorum endorsements: %d@]" + pp_block_info + proposal.block + (List.length endorsement_qc) + +let pp_endorsing_slot fmt (consensus_key_and_delegate, {slots; endorsing_power}) + = + Format.fprintf + fmt + "slots: @[<h>[%a]@],@ delegate: %a,@ endorsing_power: %d" + Format.(pp_print_list ~pp_sep:pp_print_space Slot.pp) + slots + pp_consensus_key_and_delegate + consensus_key_and_delegate + endorsing_power + +let pp_delegate_slots fmt {own_delegate_slots; _} = + Format.fprintf + fmt + "@[<v>%a@]" + Format.( + pp_print_list ~pp_sep:pp_print_cut (fun fmt (slot, endorsing_slot) -> + Format.fprintf + fmt + "slot: %a, %a" + Slot.pp + slot + pp_endorsing_slot + endorsing_slot)) + (SlotMap.bindings own_delegate_slots) + +let pp_level_state fmt + { + current_level; + latest_proposal; + locked_round; + endorsable_payload; + elected_block; + delegate_slots; + next_level_delegate_slots; + next_level_proposed_round; + } = + Format.fprintf + fmt + "@[<v 2>Level state:@ current level: %ld@ @[<v 2>proposal:@ %a@]@ locked \ + round: %a@ endorsable payload: %a@ elected block: %a@ @[<v 2>own delegate \ + slots:@ %a@]@ @[<v 2>next level own delegate slots:@ %a@]@ next level \ + proposed round: %a@]" + current_level + pp_proposal + latest_proposal + (pp_option pp_locked_round) + locked_round + (pp_option pp_endorsable_payload) + endorsable_payload + (pp_option pp_elected_block) + elected_block + pp_delegate_slots + delegate_slots + pp_delegate_slots + next_level_delegate_slots + (pp_option Round.pp) + next_level_proposed_round + +let pp_phase fmt = function + | Idle -> Format.fprintf fmt "idle" + | Awaiting_preendorsements -> Format.fprintf fmt "awaiting preendorsements" + | Awaiting_endorsements -> Format.fprintf fmt "awaiting endorsements" + +let pp_round_state fmt {current_round; current_phase} = + Format.fprintf + fmt + "@[<v 2>Round state:@ round: %a@ phase: %a@]" + Round.pp + current_round + pp_phase + current_phase + +let pp fmt {global_state; level_state; round_state} = + Format.fprintf + fmt + "@[<v 2>State:@ %a@ %a@ %a@]" + pp_global_state + global_state + pp_level_state + level_state + pp_round_state + round_state + +let pp_timeout_kind fmt = function + | End_of_round {ending_round} -> + Format.fprintf fmt "end of round %a" Round.pp ending_round + | Time_to_bake_next_level {at_round} -> + Format.fprintf fmt "time to bake next level at round %a" Round.pp at_round + +let pp_event fmt = function + | New_proposal proposal -> + Format.fprintf + fmt + "new proposal received: %a" + pp_block_info + proposal.block + | Prequorum_reached (candidate, voting_power, preendos) -> + Format.fprintf + fmt + "pre-quorum reached with %d preendorsements (power: %d) for %a at \ + round %a" + (List.length preendos) + voting_power + Tezos_crypto.Block_hash.pp + candidate.Operation_worker.hash + Round.pp + candidate.round_watched + | Quorum_reached (candidate, voting_power, endos) -> + Format.fprintf + fmt + "quorum reached with %d endorsements (power: %d) for %a at round %a" + (List.length endos) + voting_power + Tezos_crypto.Block_hash.pp + candidate.Operation_worker.hash + Round.pp + candidate.round_watched + | Timeout kind -> + Format.fprintf fmt "timeout reached: %a" pp_timeout_kind kind diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_state.mli b/src/proto_016_PtMumbai/lib_delegate/baking_state.mli new file mode 100644 index 000000000000..bf7caa0ff186 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_state.mli @@ -0,0 +1,235 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type consensus_key = { + alias : string option; + public_key : Tezos_crypto.Signature.public_key; + public_key_hash : Tezos_crypto.Signature.public_key_hash; + secret_key_uri : Client_keys.sk_uri; +} + +val consensus_key_encoding : consensus_key Data_encoding.t + +val pp_consensus_key : Format.formatter -> consensus_key -> unit + +type consensus_key_and_delegate = + consensus_key * Tezos_crypto.Signature.Public_key_hash.t + +val consensus_key_and_delegate_encoding : + consensus_key_and_delegate Data_encoding.t + +val pp_consensus_key_and_delegate : + Format.formatter -> consensus_key_and_delegate -> unit + +type validation_mode = Node | Local of Abstract_context_index.t + +type prequorum = { + level : int32; + round : Round.t; + block_payload_hash : Block_payload_hash.t; + preendorsements : Kind.preendorsement operation list; +} + +type block_info = { + hash : Tezos_crypto.Block_hash.t; + shell : Block_header.shell_header; + resulting_context_hash : Tezos_crypto.Context_hash.t; + payload_hash : Block_payload_hash.t; + payload_round : Round.t; + round : Round.t; + protocol : Tezos_crypto.Protocol_hash.t; + next_protocol : Tezos_crypto.Protocol_hash.t; + prequorum : prequorum option; + quorum : Kind.endorsement operation list; + payload : Operation_pool.payload; + live_blocks : Tezos_crypto.Block_hash.Set.t; + (** Set of live blocks for this block that is used to filter + old or too recent operations. *) +} + +type cache = { + known_timestamps : Timestamp.time Baking_cache.Timestamp_of_round_cache.t; + round_timestamps : + (Timestamp.time * Round.t * consensus_key_and_delegate) + Baking_cache.Round_timestamp_interval_cache.t; +} + +type global_state = { + cctxt : Protocol_client_context.full; + chain_id : Tezos_crypto.Chain_id.t; + config : Baking_configuration.t; + constants : Constants.t; + round_durations : Round.round_durations; + operation_worker : Operation_worker.t; + validation_mode : validation_mode; + delegates : consensus_key list; + cache : cache; +} + +val block_info_encoding : block_info Data_encoding.t + +val round_of_shell_header : Block_header.shell_header -> Round.t tzresult + +module SlotMap : Map.S with type key = Slot.t + +type endorsing_slot = {slots : Slot.t list; endorsing_power : int} + +type delegate_slots = { + own_delegate_slots : (consensus_key_and_delegate * endorsing_slot) SlotMap.t; + all_delegate_slots : endorsing_slot SlotMap.t; + all_slots_by_round : Slot.t array; +} + +type proposal = {block : block_info; predecessor : block_info} + +val proposal_encoding : proposal Data_encoding.t + +type locked_round = {payload_hash : Block_payload_hash.t; round : Round.t} + +val locked_round_encoding : locked_round Data_encoding.t + +type endorsable_payload = {proposal : proposal; prequorum : prequorum} + +val endorsable_payload_encoding : endorsable_payload Data_encoding.t + +type elected_block = { + proposal : proposal; + endorsement_qc : Kind.endorsement operation list; +} + +type level_state = { + current_level : int32; + latest_proposal : proposal; + locked_round : locked_round option; + endorsable_payload : endorsable_payload option; + elected_block : elected_block option; + delegate_slots : delegate_slots; + next_level_delegate_slots : delegate_slots; + next_level_proposed_round : Round.t option; +} + +type phase = Idle | Awaiting_preendorsements | Awaiting_endorsements + +val phase_encoding : phase Data_encoding.t + +type round_state = {current_round : Round.t; current_phase : phase} + +type state = { + global_state : global_state; + level_state : level_state; + round_state : round_state; +} + +type t = state + +type timeout_kind = + | End_of_round of {ending_round : Round.t} + | Time_to_bake_next_level of {at_round : Round.t} + +val timeout_kind_encoding : timeout_kind Data_encoding.t + +type voting_power = int + +type event = + | New_proposal of proposal + | Prequorum_reached of + Operation_worker.candidate + * voting_power + * Kind.preendorsement operation list + | Quorum_reached of + Operation_worker.candidate + * voting_power + * Kind.endorsement operation list + | Timeout of timeout_kind + +val event_encoding : event Data_encoding.t + +type state_data = { + level_data : int32; + locked_round_data : locked_round option; + endorsable_payload_data : endorsable_payload option; +} + +val state_data_encoding : state_data Data_encoding.t + +val record_state : t -> unit tzresult Lwt.t + +val may_record_new_state : + previous_state:t -> new_state:t -> unit tzresult Lwt.t + +val load_endorsable_data : + Protocol_client_context.full -> + [`State] Baking_files.location -> + state_data option tzresult Lwt.t + +val may_load_endorsable_data : t -> t tzresult Lwt.t + +(** @param block default to [`Head 0]*) +val compute_delegate_slots : + Protocol_client_context.full -> + ?block:Block_services.block -> + level:int32 -> + chain:Shell_services.chain -> + consensus_key list -> + delegate_slots tzresult Lwt.t + +val create_cache : unit -> cache + +val pp_validation_mode : Format.formatter -> validation_mode -> unit + +val pp_global_state : Format.formatter -> global_state -> unit + +val pp_option : + (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a option -> unit + +val pp_block_info : Format.formatter -> block_info -> unit + +val pp_proposal : Format.formatter -> proposal -> unit + +val pp_locked_round : Format.formatter -> locked_round -> unit + +val pp_endorsable_payload : Format.formatter -> endorsable_payload -> unit + +val pp_elected_block : Format.formatter -> elected_block -> unit + +val pp_endorsing_slot : + Format.formatter -> consensus_key_and_delegate * endorsing_slot -> unit + +val pp_delegate_slots : Format.formatter -> delegate_slots -> unit + +val pp_level_state : Format.formatter -> level_state -> unit + +val pp_phase : Format.formatter -> phase -> unit + +val pp_round_state : Format.formatter -> round_state -> unit + +val pp : Format.formatter -> t -> unit + +val pp_timeout_kind : Format.formatter -> timeout_kind -> unit + +val pp_event : Format.formatter -> event -> unit diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_vdf.ml b/src/proto_016_PtMumbai/lib_delegate/baking_vdf.ml new file mode 100644 index 000000000000..6dc6d5e9abb1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_vdf.ml @@ -0,0 +1,357 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Client_baking_blocks +module Events = Baking_events.VDF +module D_Events = Delegate_events.Denunciator + +type vdf_solution = Seed_repr.vdf_solution + +type vdf_setup = Seed_repr.vdf_setup + +type status = + | Not_started + | Started + | Finished of vdf_solution + | Injected + | Invalid + +type 'a state = { + cctxt : Protocol_client_context.full; + constants : Constants.t; + mutable block_stream : (block_info, 'a) result Lwt_stream.t; + mutable stream_stopper : Tezos_rpc.Context.stopper option; + mutable cycle : Cycle.t option; + mutable computation_status : status; + mutable vdf_setup : vdf_setup option; +} + +let init_block_stream_with_stopper cctxt chain = + Client_baking_blocks.monitor_valid_blocks + ~next_protocols:(Some [Protocol.hash]) + cctxt + ~chains:[chain] + () + +let stop_block_stream state = + Option.iter + (fun stopper -> + stopper () ; + state.stream_stopper <- None) + state.stream_stopper + +let restart_block_stream cctxt chain state = + let open Lwt_result_syntax in + stop_block_stream state ; + let retries_on_failure = 10 in + let rec try_start_block_stream retries_on_failure = + let*! p = init_block_stream_with_stopper cctxt chain in + match p with + | Ok (block_stream, stream_stopper) -> + state.block_stream <- block_stream ; + state.stream_stopper <- Some stream_stopper ; + return_unit + | Error e -> + if retries_on_failure > 0 then + let*! () = Lwt_unix.sleep 10. in + try_start_block_stream (retries_on_failure - 1) + else fail e + in + let* () = try_start_block_stream retries_on_failure in + return_unit + +let log_errors_and_continue ~name p = + let open Lwt_syntax in + let* p = p in + match p with + | Ok () -> return_unit + | Error errs -> Events.(emit vdf_daemon_error) (name, errs) + +let get_seed_computation cctxt chain_id hash = + let chain = `Hash chain_id in + let block = `Hash (hash, 0) in + Alpha_services.Seed_computation.get cctxt (chain, block) + +let get_level_info cctxt level = + let open Lwt_result_syntax in + let level = Raw_level.to_int32 level in + let* {protocol_data = {level_info; _}; _} = + Protocol_client_context.Alpha_block_services.metadata + cctxt + ~chain:cctxt#chain + ~block:(`Level level) + () + in + return level_info + +let is_in_nonce_revelation_period state (level_info : Level.t) = + let open Lwt_result_syntax in + let {Constants.parametric = {nonce_revelation_threshold; _}; _} = + state.constants + in + let position_in_cycle = level_info.cycle_position in + return (Int32.compare position_in_cycle nonce_revelation_threshold < 0) + +let check_new_cycle state (level_info : Level.t) = + let open Lwt_result_syntax in + let current_cycle = level_info.cycle in + match state.cycle with + | None -> + state.cycle <- Some current_cycle ; + return_unit + | Some cycle -> + if Cycle.(succ cycle <= current_cycle) then ( + (* The cycle of this block is different from the cycle of the last + * processed block. Emit an event if the VDF for the previous cycle + * has not been injected and reset the computation status. *) + let* () = + match state.computation_status with + | Injected -> return_unit + | _ -> + let cycle_str = Int32.to_string (Cycle.to_int32 cycle) in + let*! () = + Events.(emit vdf_info) + ("VDF revelation was NOT injected for cycle " ^ cycle_str) + in + return_unit + in + state.cycle <- Some current_cycle ; + state.computation_status <- Not_started ; + return_unit) + else return_unit + +let inject_vdf_revelation cctxt hash chain_id solution = + let open Lwt_result_syntax in + let chain = `Hash chain_id in + let block = `Hash (hash, 0) in + let* bytes = + Plugin.RPC.Forge.vdf_revelation + cctxt + (chain, block) + ~branch:hash + ~solution + () + in + let bytes = Tezos_crypto.Signature.concat bytes Tezos_crypto.Signature.zero in + Shell_services.Injection.operation cctxt ~chain bytes + +(* Checks if the VDF setup saved in the state is equal to the one computed + from a seed *) +let eq_vdf_setup state seed_discriminant seed_challenge = + let open Environment.Vdf in + match state.vdf_setup with + | None -> assert false + | Some (saved_discriminant, saved_challenge) -> + let discriminant, challenge = + Seed.generate_vdf_setup ~seed_discriminant ~seed_challenge + in + Bytes.equal + (discriminant_to_bytes discriminant) + (discriminant_to_bytes saved_discriminant) + && Bytes.equal + (challenge_to_bytes challenge) + (challenge_to_bytes saved_challenge) + +let process_new_block (cctxt : #Protocol_client_context.full) state + {hash; chain_id; protocol; next_protocol; level; _} = + let open Lwt_result_syntax in + let* level_info = get_level_info cctxt level in + let level_str = Int32.to_string (Raw_level.to_int32 level) in + let* () = check_new_cycle state level_info in + if Tezos_crypto.Protocol_hash.(protocol <> next_protocol) then + let*! () = D_Events.(emit protocol_change_detected) () in + return_unit + else + let* out = is_in_nonce_revelation_period state level_info in + if out then + let*! () = + Events.(emit vdf_info) + ("Skipping, still in nonce revelation period (level " ^ level_str + ^ ")") + in + return_unit + (* enter main loop if we are not in the nonce revelation period and + the expected protocol has been activated *) + else + match state.computation_status with + | Started -> + let*! () = + Events.(emit vdf_info) + ("Skipping, already started VDF (level " ^ level_str ^ ")") + in + return_unit + | Not_started -> ( + let chain = `Hash chain_id in + let* seed_computation = get_seed_computation cctxt chain_id hash in + match seed_computation with + | Vdf_revelation_stage {seed_discriminant; seed_challenge} -> + state.computation_status <- Started ; + let*! () = + Events.(emit vdf_info) + ("Started to compute VDF (level " ^ level_str ^ ")") + in + let vdf_setup = + Seed.generate_vdf_setup ~seed_discriminant ~seed_challenge + in + state.vdf_setup <- Some vdf_setup ; + stop_block_stream state ; + let* () = + Lwt.catch + (fun () -> + let discriminant, challenge = vdf_setup in + (* `Vdf.prove` is a long computation. We reset the block + * stream in order to not process all the blocks added + * to the chain during this time and skip straight to + * the current head. *) + let solution = + Environment.Vdf.prove + discriminant + challenge + state.constants.parametric.vdf_difficulty + in + state.computation_status <- Finished solution ; + let*! () = Events.(emit vdf_info) "VDF solution computed" in + return_unit) + (fun _ -> + (* VDF computation failed with an error thrown by the external + * library. We set the status back to Not_started in order to + * retry computing it if still possible. *) + state.computation_status <- Not_started ; + let*! () = + Events.(emit vdf_info) + ("Failed to compute VDF solution (level " ^ level_str + ^ ")") + in + return_unit) + in + restart_block_stream cctxt chain state + | Nonce_revelation_stage | Computation_finished -> + (* Daemon started too early or too late in a cycle, skipping. *) + return_unit) + | Finished solution -> ( + let*! () = + Events.(emit vdf_info) ("Finished VDF (level " ^ level_str ^ ")") + in + let chain = `Hash chain_id in + let* seed_computation = get_seed_computation cctxt chain_id hash in + match seed_computation with + | Vdf_revelation_stage {seed_discriminant; seed_challenge} -> + (* If a solution has been computed that is consistent with the VDF + * setup for the current cycle and we are still in the VDF + * revelation stage, inject the operation. *) + if eq_vdf_setup state seed_discriminant seed_challenge then ( + let* op_hash = + inject_vdf_revelation cctxt hash chain_id solution + in + state.computation_status <- Injected ; + let*! () = + Events.(emit vdf_revelation_injected) + ( Cycle.to_int32 level_info.cycle, + Chain_services.to_string chain, + op_hash ) + in + return_unit) + else ( + state.computation_status <- Invalid ; + let*! () = + Events.(emit vdf_info) + ("Error injecting VDF: setup has been updated (level " + ^ level_str ^ ")") + in + return_unit) + | Nonce_revelation_stage -> + state.computation_status <- Not_started ; + let*! () = + Events.(emit vdf_info) + ("Error injecting VDF: new cycle started (level " ^ level_str + ^ ")") + in + return_unit + | Computation_finished -> + state.computation_status <- Injected ; + let*! () = + Events.(emit vdf_info) + ("Error injecting VDF: already injected (level " ^ level_str + ^ ")") + in + return_unit) + | Injected -> + let*! () = + Events.(emit vdf_info) + ("Skipping, already injected VDF (level " ^ level_str ^ ")") + in + return_unit + | Invalid -> + let*! () = + Events.(emit vdf_info) + ("Skipping, failed to compute VDF (level " ^ level_str ^ ")") + in + return_unit + +let start_vdf_worker (cctxt : Protocol_client_context.full) ~canceler constants + chain = + let open Lwt_result_syntax in + let* block_stream, stream_stopper = + init_block_stream_with_stopper cctxt chain + in + let state = + { + cctxt; + constants; + block_stream; + stream_stopper = Some stream_stopper; + cycle = None; + computation_status = Not_started; + vdf_setup = None; + } + in + Lwt_canceler.on_cancel canceler (fun () -> + stop_block_stream state ; + Lwt.return_unit) ; + let rec worker_loop () = + let*! b = + Lwt.choose + [ + (Lwt_exit.clean_up_starts >|= fun _ -> `Termination); + (Lwt_stream.get state.block_stream >|= fun e -> `Block e); + ] + in + match b with + | `Termination -> return_unit + | `Block (None | Some (Error _)) -> + (* exit when the node is unavailable *) + stop_block_stream state ; + let*! () = Events.(emit vdf_daemon_connection_lost) name in + tzfail Baking_errors.Node_connection_lost + | `Block (Some (Ok bi)) -> + let*! () = + log_errors_and_continue ~name @@ process_new_block cctxt state bi + in + worker_loop () + in + let*! () = Events.(emit vdf_daemon_start) name in + worker_loop () diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_vdf.mli b/src/proto_016_PtMumbai/lib_delegate/baking_vdf.mli new file mode 100644 index 000000000000..84751f723af8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/baking_vdf.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +val start_vdf_worker : + Protocol_client_context.full -> + canceler:Lwt_canceler.t -> + Constants.t -> + Chain_services.chain -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/block_forge.ml b/src/proto_016_PtMumbai/lib_delegate/block_forge.ml new file mode 100644 index 000000000000..0df28bfea484 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/block_forge.ml @@ -0,0 +1,396 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type unsigned_block = { + unsigned_block_header : Block_header.t; + operations : Tezos_base.Operation.t list list; +} + +type simulation_kind = + | Filter of Operation_pool.Prioritized.t + | Apply of { + ordered_pool : Operation_pool.ordered_pool; + payload_hash : Block_payload_hash.t; + } + +type simulation_mode = Local of Context.index | Node + +let forge_faked_protocol_data ?(payload_hash = Block_payload_hash.zero) + ~payload_round ~seed_nonce_hash ~liquidity_baking_toggle_vote () = + Block_header. + { + contents = + { + payload_hash; + payload_round; + seed_nonce_hash; + proof_of_work_nonce = Baking_pow.empty_proof_of_work_nonce; + liquidity_baking_toggle_vote; + }; + signature = Tezos_crypto.Signature.zero; + } + +let convert_operation (op : packed_operation) : Tezos_base.Operation.t = + { + shell = op.shell; + proto = + Data_encoding.Binary.to_bytes_exn + Alpha_context.Operation.protocol_data_encoding + op.protocol_data; + } + +(* Build the block header : mimics node prevalidation *) +let finalize_block_header shell_header timestamp validation_result + operations_hash predecessor_block_metadata_hash + predecessor_ops_metadata_hash predecessor_resulting_context = + let {Tezos_protocol_environment.context; fitness; message; _} = + validation_result + in + let validation_passes = List.length Main.validation_passes in + (Context_ops.get_test_chain context >>= function + | Not_running -> return context + | Running {expiration; _} -> + if Time.Protocol.(expiration <= timestamp) then + Context_ops.add_test_chain context Not_running >>= fun context -> + return context + else return context + | Forking _ -> assert false) + >>=? fun context -> + (match predecessor_block_metadata_hash with + | Some predecessor_block_metadata_hash -> + Context_ops.add_predecessor_block_metadata_hash + context + predecessor_block_metadata_hash + | None -> Lwt.return context) + >>= fun context -> + (match predecessor_ops_metadata_hash with + | Some predecessor_ops_metadata_hash -> + Context_ops.add_predecessor_ops_metadata_hash + context + predecessor_ops_metadata_hash + | None -> Lwt.return context) + >>= fun context -> + let context = Context_ops.hash ~time:timestamp ?message context in + (* For the time being, we still fully build the block while we build + confidence to fully unplug the baker validation. The resulting + context hash is ignored as it is not necessary to craft a block. + See: https://gitlab.com/tezos/tezos/-/issues/4285 *) + ignore context ; + let header = + Tezos_base.Block_header. + { + shell_header with + level = Int32.succ shell_header.level; + validation_passes; + operations_hash; + fitness; + context = predecessor_resulting_context; + } + in + return header + +let retain_live_operations_only ~live_blocks operation_pool = + Operation_pool.Prioritized.filter + (fun ({shell; _} : packed_operation) -> + Tezos_crypto.Block_hash.Set.mem shell.branch live_blocks) + operation_pool + +let forge (cctxt : #Protocol_client_context.full) ~chain_id ~pred_info + ~timestamp ~liquidity_baking_toggle_vote ~user_activated_upgrades + fees_config ~seed_nonce_hash ~payload_round simulation_mode simulation_kind + constants = + let predecessor_block = (pred_info : Baking_state.block_info) in + let hard_gas_limit_per_block = + constants.Constants.Parametric.hard_gas_limit_per_block + in + let chain = `Hash chain_id in + let check_protocol_changed + ~(validation_result : Tezos_protocol_environment.validation_result) = + Context_ops.get_protocol validation_result.context >>= fun next_protocol -> + let next_protocol = + match + Tezos_base.Block_header.get_forced_protocol_upgrade + ~user_activated_upgrades + ~level:(Int32.succ predecessor_block.shell.level) + with + | None -> next_protocol + | Some hash -> hash + in + return Tezos_crypto.Protocol_hash.(Protocol.hash <> next_protocol) + in + let filter_via_node ~operation_pool = + let filtered_operations = + Operation_selection.filter_operations_without_simulation + fees_config + ~hard_gas_limit_per_block + operation_pool + in + let faked_protocol_data = + forge_faked_protocol_data + ~payload_round + ~seed_nonce_hash + ~liquidity_baking_toggle_vote + () + in + Node_rpc.preapply_block + cctxt + ~chain + ~head:predecessor_block.hash + ~timestamp + ~protocol_data:faked_protocol_data + filtered_operations + >>=? fun (shell_header, preapply_result) -> + (* only retain valid operations *) + let operations = + List.map (fun l -> List.map snd l.Preapply_result.applied) preapply_result + in + let payload_hash = + let operation_hashes = + Stdlib.List.tl operations |> List.flatten + |> List.map Tezos_base.Operation.hash + in + Block_payload.hash + ~predecessor_hash:shell_header.predecessor + ~payload_round + operation_hashes + in + return (shell_header, operations, payload_hash) + in + let filter_with_context ~context_index ~operation_pool = + let faked_protocol_data = + forge_faked_protocol_data + ~payload_round + ~seed_nonce_hash + ~liquidity_baking_toggle_vote + () + in + Baking_simulator.begin_construction + ~timestamp + ~protocol_data:faked_protocol_data + context_index + predecessor_block + chain_id + >>=? fun incremental -> + Operation_selection.filter_operations_with_simulation + incremental + fees_config + ~hard_gas_limit_per_block + operation_pool + >>=? fun { + Operation_selection.operations; + validation_result; + operations_hash; + _; + } -> + check_protocol_changed ~validation_result >>=? fun changed -> + if changed then + (* Fallback to processing via node, which knows both old and new protocol. *) + filter_via_node ~operation_pool + else + protect + ~on_error:(fun _ -> return_none) + (fun () -> + Shell_services.Blocks.metadata_hash + cctxt + ~block:(`Hash (predecessor_block.hash, 0)) + ~chain + () + >>=? fun pred_block_metadata_hash -> + return (Some pred_block_metadata_hash)) + >>=? fun pred_block_metadata_hash -> + protect + ~on_error:(fun _ -> return_none) + (fun () -> + Shell_services.Blocks.Operation_metadata_hashes.root + cctxt + ~block:(`Hash (predecessor_block.hash, 0)) + ~chain + () + >>=? fun pred_op_metadata_hash -> return (Some pred_op_metadata_hash)) + >>=? fun pred_op_metadata_hash -> + finalize_block_header + incremental.header + timestamp + validation_result + operations_hash + pred_block_metadata_hash + pred_op_metadata_hash + predecessor_block.resulting_context_hash + >>=? fun shell_header -> + let operations = List.map (List.map convert_operation) operations in + let payload_hash = + let operation_hashes = + Stdlib.List.tl operations |> List.flatten + |> List.map Tezos_base.Operation.hash + in + Block_payload.hash + ~predecessor_hash:shell_header.predecessor + ~payload_round + operation_hashes + in + return (shell_header, operations, payload_hash) + in + let apply_via_node ~ordered_pool ~payload_hash = + let operations = Operation_pool.ordered_to_list_list ordered_pool in + let faked_protocol_data = + forge_faked_protocol_data + ~seed_nonce_hash + ~liquidity_baking_toggle_vote + ~payload_hash + ~payload_round + () + in + Node_rpc.preapply_block + cctxt + ~chain + ~head:predecessor_block.hash + ~timestamp + ~protocol_data:faked_protocol_data + operations + >>=? fun (shell_header, _preapply_result) -> + let operations = List.map (List.map convert_operation) operations in + return (shell_header, operations, payload_hash) + in + let apply_with_context ~context_index ~ordered_pool ~payload_hash = + let faked_protocol_data = + forge_faked_protocol_data + ~seed_nonce_hash + ~liquidity_baking_toggle_vote + ~payload_hash + ~payload_round + () + in + Shell_services.Chain.chain_id cctxt ~chain () >>=? fun chain_id -> + Baking_simulator.begin_construction + ~timestamp + ~protocol_data:faked_protocol_data + context_index + predecessor_block + chain_id + >>=? fun incremental -> + (* We still need to filter endorsements. Two endorsements could be + referring to the same slot. *) + Operation_selection.filter_consensus_operations_only + incremental + ordered_pool + >>=? fun (incremental, ordered_pool) -> + let operations = Operation_pool.ordered_to_list_list ordered_pool in + let operations_hash = + Tezos_crypto.Operation_list_list_hash.compute + (List.map + (fun sl -> + Tezos_crypto.Operation_list_hash.compute + (List.map Operation.hash_packed sl)) + operations) + in + (* We need to compute the final [operations_hash] before + finalizing the block because it will be used in the cache's nonce. *) + let incremental = + {incremental with header = {incremental.header with operations_hash}} + in + Baking_simulator.finalize_construction incremental + >>=? fun (validation_result, _) -> + check_protocol_changed ~validation_result >>=? fun changed -> + if changed then + (* Fallback to processing via node, which knows both old and new protocol. *) + apply_via_node ~ordered_pool ~payload_hash + else + protect + ~on_error:(fun _ -> return_none) + (fun () -> + Shell_services.Blocks.metadata_hash + cctxt + ~block:(`Hash (predecessor_block.hash, 0)) + ~chain + () + >>=? fun pred_block_metadata_hash -> + return (Some pred_block_metadata_hash)) + >>=? fun pred_block_metadata_hash -> + protect + ~on_error:(fun _ -> return_none) + (fun () -> + Shell_services.Blocks.Operation_metadata_hashes.root + cctxt + ~block:(`Hash (predecessor_block.hash, 0)) + ~chain + () + >>=? fun pred_op_metadata_hash -> return (Some pred_op_metadata_hash)) + >>=? fun pred_op_metadata_hash -> + finalize_block_header + incremental.header + timestamp + validation_result + operations_hash + pred_block_metadata_hash + pred_op_metadata_hash + predecessor_block.resulting_context_hash + >>=? fun shell_header -> + let operations = List.map (List.map convert_operation) operations in + return (shell_header, operations, payload_hash) + in + let simulation_kind = + match simulation_kind with + | Filter operation_pool -> + (* We cannot include operations that are not live with respect + to our predecessor otherwise the node would reject the block. *) + let filtered_pool = + retain_live_operations_only + ~live_blocks:pred_info.live_blocks + operation_pool + in + Filter filtered_pool + | Apply _ as x -> x + in + (match (simulation_mode, simulation_kind) with + | Baking_state.Node, Filter operation_pool -> filter_via_node ~operation_pool + | Node, Apply {ordered_pool; payload_hash} -> + apply_via_node ~ordered_pool ~payload_hash + | Local context_index, Filter operation_pool -> + filter_with_context ~context_index ~operation_pool + | Local context_index, Apply {ordered_pool; payload_hash} -> + apply_with_context ~context_index ~ordered_pool ~payload_hash) + >>=? fun (shell_header, operations, payload_hash) -> + Baking_pow.mine + ~proof_of_work_threshold:constants.proof_of_work_threshold + shell_header + (fun proof_of_work_nonce -> + { + Block_header.payload_hash; + payload_round; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_toggle_vote; + }) + >>=? fun contents -> + let unsigned_block_header = + { + Block_header.shell = shell_header; + protocol_data = {contents; signature = Tezos_crypto.Signature.zero}; + } + in + return {unsigned_block_header; operations} diff --git a/src/proto_016_PtMumbai/lib_delegate/block_forge.mli b/src/proto_016_PtMumbai/lib_delegate/block_forge.mli new file mode 100644 index 000000000000..abf60c86d8f4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/block_forge.mli @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type unsigned_block = { + unsigned_block_header : Block_header.t; + operations : Tezos_base.Operation.t list list; +} + +type simulation_kind = + | Filter of Operation_pool.Prioritized.t + | Apply of { + ordered_pool : Operation_pool.ordered_pool; + payload_hash : Block_payload_hash.t; + } + +type simulation_mode = Local of Context.index | Node + +val forge_faked_protocol_data : + ?payload_hash:Block_payload_hash.t -> + payload_round:Round.t -> + seed_nonce_hash:Nonce_hash.t option -> + liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + unit -> + block_header_data + +val forge : + #Protocol_client_context.full -> + chain_id:Tezos_crypto.Chain_id.t -> + pred_info:Baking_state.block_info -> + timestamp:Time.Protocol.t -> + liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + user_activated_upgrades:User_activated.upgrades -> + Baking_configuration.fees_config -> + seed_nonce_hash:Nonce_hash.t option -> + payload_round:Round.t -> + Baking_state.validation_mode -> + simulation_kind -> + Constants.Parametric.t -> + unsigned_block tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.ml b/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.ml new file mode 100644 index 000000000000..e192aa649a72 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.ml @@ -0,0 +1,233 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context + +type block_info = { + hash : Tezos_crypto.Block_hash.t; + chain_id : Tezos_crypto.Chain_id.t; + predecessor : Tezos_crypto.Block_hash.t; + fitness : Bytes.t list; + timestamp : Time.Protocol.t; + protocol : Tezos_crypto.Protocol_hash.t; + next_protocol : Tezos_crypto.Protocol_hash.t; + proto_level : int; + level : Raw_level.t; + context : Tezos_crypto.Context_hash.t; +} + +let raw_info cctxt ?(chain = `Main) hash shell_header = + let block = `Hash (hash, 0) in + Shell_services.Chain.chain_id cctxt ~chain () >>=? fun chain_id -> + Shell_services.Blocks.protocols cctxt ~chain ~block () + >>=? fun {current_protocol = protocol; next_protocol} -> + let { + Tezos_base.Block_header.predecessor; + fitness; + timestamp; + level; + context; + proto_level; + _; + } = + shell_header + in + match Raw_level.of_int32 level with + | Ok level -> + return + { + hash; + chain_id; + predecessor; + fitness; + timestamp; + protocol; + next_protocol; + proto_level; + level; + context; + } + | Error _ -> failwith "Cannot convert level into int32" + +let info cctxt ?(chain = `Main) block = + Shell_services.Blocks.hash cctxt ~chain ~block () >>=? fun hash -> + Shell_services.Blocks.Header.shell_header cctxt ~chain ~block () + >>=? fun shell_header -> raw_info cctxt ~chain hash shell_header + +module Block_seen_event = struct + type t = { + hash : Tezos_crypto.Block_hash.t; + header : Tezos_base.Block_header.t; + occurrence : [`Valid_blocks of Tezos_crypto.Chain_id.t | `Heads]; + } + + let make hash header occurrence = {hash; header; occurrence} + + module Definition = struct + let section = None + + let name = "block-seen-" ^ Protocol.name + + type nonrec t = t + + let encoding = + let open Data_encoding in + let v0_encoding = + conv + (function {hash; header; occurrence} -> (hash, occurrence, header)) + (fun (hash, occurrence, header) -> make hash header occurrence) + (obj3 + (req "hash" Tezos_crypto.Block_hash.encoding) + (* Occurrence has to come before header, because: + (Invalid_argument + "Cannot merge two objects when the left element is of + variable length and the right one of dynamic + length. You should use the reverse order, or wrap the + second one with Data_encoding.dynamic_size.") *) + (req + "occurrence" + (union + [ + case + ~title:"heads" + (Tag 0) + (obj1 (req "occurrence-kind" (constant "heads"))) + (function `Heads -> Some () | _ -> None) + (fun () -> `Heads); + case + ~title:"valid-blocks" + (Tag 1) + (obj2 + (req "occurrence-kind" (constant "valid-blocks")) + (req "chain-id" Tezos_crypto.Chain_id.encoding)) + (function + | `Valid_blocks ch -> Some ((), ch) | _ -> None) + (fun ((), ch) -> `Valid_blocks ch); + ])) + (req "header" Tezos_base.Block_header.encoding)) + in + With_version.(encoding ~name (first_version v0_encoding)) + + let pp ~short:_ ppf {hash; _} = + Format.fprintf ppf "Saw block %a" Tezos_crypto.Block_hash.pp_short hash + + let doc = "Block observed while monitoring a blockchain." + + let level = Internal_event.Info + end + + module Event = Internal_event.Make (Definition) +end + +let monitor_valid_blocks cctxt ?chains ?protocols ~next_protocols () = + Monitor_services.valid_blocks cctxt ?chains ?protocols ?next_protocols () + >>=? fun (block_stream, stop) -> + return + ( Lwt_stream.map_s + (fun ((chain, block), header) -> + Block_seen_event.( + Event.emit (make block header (`Valid_blocks chain))) + >>=? fun () -> + raw_info + cctxt + ~chain:(`Hash chain) + block + header.Tezos_base.Block_header.shell) + block_stream, + stop ) + +let monitor_heads cctxt ~next_protocols chain = + Monitor_services.heads cctxt ?next_protocols chain + >>=? fun (block_stream, _stop) -> + return + (Lwt_stream.map_s + (fun (block, ({Tezos_base.Block_header.shell; _} as header)) -> + Block_seen_event.(Event.emit (make block header `Heads)) >>=? fun () -> + raw_info cctxt ~chain block shell) + block_stream) + +type error += + | Unexpected_empty_block_list of { + chain : string; + block_hash : Tezos_crypto.Block_hash.t; + length : int; + } + +let () = + register_error_kind + `Permanent + ~id:"Client_baking_blocks.unexpected_empty_block_list" + ~title:"Unexpected empty blocklist" + ~description: + "The block list retrieved by Shell_services.Blocks.list is empty" + ~pp:(fun ppf (chain, block_hash, length) -> + Format.fprintf + ppf + "Unexpected empty block list retrieved from chain %s at block %a, \ + length %d" + chain + Tezos_crypto.Block_hash.pp + block_hash + length) + Data_encoding.( + obj3 + (req "chain" string) + (req "block_hash" Tezos_crypto.Block_hash.encoding) + (req "length" int31)) + (function + | Unexpected_empty_block_list {chain; block_hash; length} -> + Some (chain, block_hash, length) + | _ -> None) + (fun (chain, block_hash, length) -> + Unexpected_empty_block_list {chain; block_hash; length}) + +let blocks_from_current_cycle cctxt ?(chain = `Main) block ?(offset = 0l) () = + Shell_services.Blocks.hash cctxt ~chain ~block () >>=? fun hash -> + Shell_services.Blocks.Header.shell_header cctxt ~chain ~block () + >>=? fun {level; _} -> + Plugin.RPC.levels_in_current_cycle cctxt ~offset (chain, block) >>= function + | Error (Tezos_rpc.Context.Not_found _ :: _) -> return_nil + | Error _ as err -> Lwt.return err + | Ok (first, last) -> + let length = Int32.to_int (Int32.sub level (Raw_level.to_int32 first)) in + (Shell_services.Blocks.list cctxt ~chain ~heads:[hash] ~length () + >>=? function + | hd :: _ -> return hd + | [] -> + fail + (Unexpected_empty_block_list + { + chain = Block_services.chain_to_string chain; + block_hash = hash; + length; + })) + >>=? fun head -> + let blocks = + List.drop_n (length - Int32.to_int (Raw_level.diff last first)) head + in + if Int32.equal level (Raw_level.to_int32 last) then return (hash :: blocks) + else return blocks diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.mli b/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.mli new file mode 100644 index 000000000000..07d582b6ed9b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_blocks.mli @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type block_info = { + hash : Tezos_crypto.Block_hash.t; + chain_id : Tezos_crypto.Chain_id.t; + predecessor : Tezos_crypto.Block_hash.t; + fitness : Bytes.t list; + timestamp : Time.Protocol.t; + protocol : Tezos_crypto.Protocol_hash.t; + next_protocol : Tezos_crypto.Protocol_hash.t; + proto_level : int; + level : Raw_level.t; + context : Tezos_crypto.Context_hash.t; +} + +val info : + #Protocol_client_context.rpc_context -> + ?chain:Chain_services.chain -> + Block_services.block -> + block_info tzresult Lwt.t + +val monitor_valid_blocks : + #Protocol_client_context.rpc_context -> + ?chains:Chain_services.chain list -> + ?protocols:Tezos_crypto.Protocol_hash.t list -> + next_protocols:Tezos_crypto.Protocol_hash.t list option -> + unit -> + (block_info tzresult Lwt_stream.t * Tezos_rpc.Context.stopper) tzresult Lwt.t + +val monitor_heads : + #Protocol_client_context.rpc_context -> + next_protocols:Tezos_crypto.Protocol_hash.t list option -> + Chain_services.chain -> + block_info tzresult Lwt_stream.t tzresult Lwt.t + +val blocks_from_current_cycle : + #Protocol_client_context.rpc_context -> + ?chain:Chain_services.chain -> + Block_services.block -> + ?offset:int32 -> + unit -> + Tezos_crypto.Block_hash.t list tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.ml b/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.ml new file mode 100644 index 000000000000..21b58428d339 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.ml @@ -0,0 +1,488 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context +open Client_baking_blocks +module Events = Delegate_events.Denunciator +module B_Events = Delegate_events.Baking_scheduling + +module HLevel = Hashtbl.Make (struct + type t = Tezos_crypto.Chain_id.t * Raw_level.t * Round.t + + let equal (c, l, r) (c', l', r') = + Tezos_crypto.Chain_id.equal c c' && Raw_level.equal l l' && Round.equal r r' + + let hash (c, lvl, r) = Hashtbl.hash (c, lvl, r) +end) + +(* Blocks are associated to the delegates who baked them *) +module Delegate_Map = Map.Make (Tezos_crypto.Signature.Public_key_hash) + +(* (pre)endorsements are associated to the slot they are injected + with; we rely on the fact that there is a unique canonical slot + identifying a (pre)endorser. *) +module Slot_Map = Slot.Map + +(* type of operations stream, as returned by monitor_operations RPC *) +type ops_stream = + ((Tezos_crypto.Operation_hash.t * packed_operation) * error trace option) list + Lwt_stream.t + +type 'a state = { + (* Endorsements seen so far *) + endorsements_table : Kind.endorsement operation Slot_Map.t HLevel.t; + (* Preendorsements seen so far *) + preendorsements_table : Kind.preendorsement operation Slot_Map.t HLevel.t; + (* Blocks received so far *) + blocks_table : Tezos_crypto.Block_hash.t Delegate_Map.t HLevel.t; + (* Maximum delta of level to register *) + preserved_levels : int; + (* Highest level seen in a block *) + mutable highest_level_encountered : Raw_level.t; + (* This constant allows to set at which frequency (expressed in blocks levels) + the tables above are cleaned. Cleaning the table means removing information + stored about old levels up to + 'highest_level_encountered - preserved_levels'. + *) + clean_frequency : int; + (* the decreasing cleaning countdown for the next cleaning *) + mutable cleaning_countdown : int; + (* stream of all valid blocks *) + blocks_stream : (block_info, 'a) result Lwt_stream.t; + (* operations stream. Reset on new heads flush *) + mutable ops_stream : ops_stream; + (* operatons stream stopper. Used when a q new *) + mutable ops_stream_stopper : unit -> unit; +} + +let create_state ~preserved_levels blocks_stream ops_stream ops_stream_stopper = + let clean_frequency = max 1 (preserved_levels / 10) in + Lwt.return + { + endorsements_table = HLevel.create preserved_levels; + preendorsements_table = HLevel.create preserved_levels; + blocks_table = HLevel.create preserved_levels; + preserved_levels; + highest_level_encountered = Raw_level.root (* 0l *); + clean_frequency; + cleaning_countdown = clean_frequency; + blocks_stream; + ops_stream; + ops_stream_stopper; + } + +(* We choose a previous offset (5 blocks from head) to ensure that the + injected operation is branched from a valid + predecessor. Denunciation operations can be emitted when the + consensus is under attack and may occur so you want to inject the + operation from a block which is considered "final". *) +let get_block_offset level = + match Raw_level.of_int32 5l with + | Ok min_level -> + let offset = Raw_level.diff level min_level in + if Compare.Int32.(offset >= 0l) then Lwt.return (`Head 5) + else + (* offset < 0l *) + let negative_offset = Int32.to_int offset in + (* We cannot inject at at level 0 : this is the genesis + level. We inject starting from level 1 thus the '- 1'. *) + Lwt.return (`Head (5 + negative_offset - 1)) + | Error errs -> + Events.(emit invalid_level_conversion) (Environment.wrap_tztrace errs) + >>= fun () -> Lwt.return (`Head 0) + +let get_payload_hash (type kind) (op_kind : kind consensus_operation_type) + (op : kind Operation.t) = + match (op_kind, op.protocol_data.contents) with + | Preendorsement, Single (Preendorsement consensus_content) + | Endorsement, Single (Endorsement consensus_content) -> + consensus_content.block_payload_hash + | _ -> . + +let double_consensus_op_evidence (type kind) : + kind consensus_operation_type -> + #Protocol_client_context.full -> + 'a -> + branch:Tezos_crypto.Block_hash.t -> + op1:kind Alpha_context.operation -> + op2:kind Alpha_context.operation -> + unit -> + bytes Environment.Error_monad.shell_tzresult Lwt.t = function + | Endorsement -> Plugin.RPC.Forge.double_endorsement_evidence + | Preendorsement -> Plugin.RPC.Forge.double_preendorsement_evidence + +let process_consensus_op (type kind) cctxt + (op_kind : kind consensus_operation_type) (new_op : kind Operation.t) + chain_id level round slot ops_table = + let map = + Option.value ~default:Slot_Map.empty + @@ HLevel.find ops_table (chain_id, level, round) + in + (* If a previous endorsement made by this pkh (the slot determines the pkh) + is found for the same level we inject a double_(pre)endorsement *) + match Slot_Map.find slot map with + | None -> + return + @@ HLevel.add + ops_table + (chain_id, level, round) + (Slot_Map.add slot new_op map) + | Some existing_op + when Block_payload_hash.( + get_payload_hash op_kind existing_op + <> get_payload_hash op_kind new_op) -> + (* same level and round, and different payload hash for this slot *) + let new_op_hash, existing_op_hash = + (Operation.hash new_op, Operation.hash existing_op) + in + let op1, op2 = + if Tezos_crypto.Operation_hash.(new_op_hash < existing_op_hash) then + (new_op, existing_op) + else (existing_op, new_op) + in + get_block_offset level >>= fun block -> + let chain = `Hash chain_id in + Alpha_block_services.hash cctxt ~chain ~block () >>=? fun block_hash -> + double_consensus_op_evidence + op_kind + cctxt + (`Hash chain_id, block) + ~branch:block_hash + ~op1 + ~op2 + () + >>=? fun bytes -> + let bytes = + Tezos_crypto.Signature.concat bytes Tezos_crypto.Signature.zero + in + let double_op_detected, double_op_denounced = + Events.( + match op_kind with + | Endorsement -> + (double_endorsement_detected, double_endorsement_denounced) + | Preendorsement -> + (double_preendorsement_detected, double_preendorsement_denounced)) + in + Events.(emit double_op_detected) (new_op_hash, existing_op_hash) + >>= fun () -> + HLevel.replace + ops_table + (chain_id, level, round) + (Slot_Map.add slot new_op map) ; + Shell_services.Injection.operation cctxt ~chain bytes >>=? fun op_hash -> + Events.(emit double_op_denounced) (op_hash, bytes) >>= fun () -> + return_unit + | _ -> return_unit + +let process_operations (cctxt : #Protocol_client_context.full) state + (endorsements : 'a list) ~packed_op chain_id = + List.iter_es + (fun op -> + let {shell; protocol_data; _} = packed_op op in + match protocol_data with + | Operation_data + ({contents = Single (Preendorsement {round; slot; level; _}); _} as + protocol_data) -> + let new_preendorsement : Kind.preendorsement Alpha_context.operation = + {shell; protocol_data} + in + process_consensus_op + cctxt + Preendorsement + new_preendorsement + chain_id + level + round + slot + state.preendorsements_table + | Operation_data + ({contents = Single (Endorsement {round; slot; level; _}); _} as + protocol_data) -> + let new_endorsement : Kind.endorsement Alpha_context.operation = + {shell; protocol_data} + in + process_consensus_op + cctxt + Endorsement + new_endorsement + chain_id + level + round + slot + state.endorsements_table + | _ -> + (* not a consensus operation *) + return_unit) + endorsements + +let context_block_header cctxt ~chain b_hash = + Alpha_block_services.header cctxt ~chain ~block:(`Hash (b_hash, 0)) () + >>=? fun ({shell; protocol_data; _} : Alpha_block_services.block_header) -> + return {Alpha_context.Block_header.shell; protocol_data} + +let process_block (cctxt : #Protocol_client_context.full) state + (header : Alpha_block_services.block_info) = + match header with + | {hash; metadata = None; _} -> + Events.(emit unexpected_pruned_block) hash >>= fun () -> return_unit + | { + Alpha_block_services.chain_id; + hash = new_hash; + metadata = Some {protocol_data = {baker; level_info = {level; _}; _}; _}; + header = {shell = {fitness; _}; _}; + _; + } -> ( + let fitness = Fitness.from_raw fitness in + Lwt.return + (match fitness with + | Ok fitness -> Ok (Fitness.round fitness) + | Error errs -> Error (Environment.wrap_tztrace errs)) + >>=? fun round -> + let chain = `Hash chain_id in + let map = + Option.value ~default:Delegate_Map.empty + @@ HLevel.find state.blocks_table (chain_id, level, round) + in + match Delegate_Map.find baker.delegate map with + | None -> + return + @@ HLevel.add + state.blocks_table + (chain_id, level, round) + (Delegate_Map.add baker.delegate new_hash map) + | Some existing_hash + when Tezos_crypto.Block_hash.(existing_hash = new_hash) -> + (* This case should never happen *) + Events.(emit double_baking_but_not) () >>= fun () -> + return + @@ HLevel.replace + state.blocks_table + (chain_id, level, round) + (Delegate_Map.add baker.delegate new_hash map) + | Some existing_hash -> + (* If a previous block made by this pkh is found for + the same (level, round) we inject a double_baking_evidence *) + context_block_header cctxt ~chain existing_hash >>=? fun bh1 -> + context_block_header cctxt ~chain new_hash >>=? fun bh2 -> + let hash1 = Block_header.hash bh1 in + let hash2 = Block_header.hash bh2 in + let bh1, bh2 = + if Tezos_crypto.Block_hash.(hash1 < hash2) then (bh1, bh2) + else (bh2, bh1) + in + (* If the blocks are on different chains then skip it *) + get_block_offset level >>= fun block -> + Alpha_block_services.hash cctxt ~chain ~block () + >>=? fun block_hash -> + Plugin.RPC.Forge.double_baking_evidence + cctxt + (chain, block) + ~branch:block_hash + ~bh1 + ~bh2 + () + >>=? fun bytes -> + let bytes = + Tezos_crypto.Signature.concat bytes Tezos_crypto.Signature.zero + in + Events.(emit double_baking_detected) () >>= fun () -> + Shell_services.Injection.operation cctxt ~chain bytes + >>=? fun op_hash -> + Events.(emit double_baking_denounced) (op_hash, bytes) >>= fun () -> + return + @@ HLevel.replace + state.blocks_table + (chain_id, level, round) + (Delegate_Map.add baker.delegate new_hash map)) + +(* Remove levels that are lower than the + [highest_level_encountered] minus [preserved_levels] *) +let cleanup_old_operations state = + state.cleaning_countdown <- state.cleaning_countdown - 1 ; + if state.cleaning_countdown < 0 then ( + (* It's time to remove old levels *) + state.cleaning_countdown <- state.clean_frequency ; + let highest_level_encountered = + Int32.to_int (Raw_level.to_int32 state.highest_level_encountered) + in + let diff = highest_level_encountered - state.preserved_levels in + let threshold = + if diff < 0 then Raw_level.root + else + Raw_level.of_int32 (Int32.of_int diff) |> function + | Ok threshold -> threshold + | Error _ -> Raw_level.root + in + let filter hmap = + HLevel.filter_map_inplace + (fun (_, level, _) x -> + if Raw_level.(level < threshold) then None else Some x) + hmap + in + filter state.preendorsements_table ; + filter state.endorsements_table ; + filter state.blocks_table) + +(* Each new block is processed : + - Checking that every baker injected only once at this level + - Checking that every (pre)endorser operated only once at this level +*) +let process_new_block (cctxt : #Protocol_client_context.full) state + {hash; chain_id; level; protocol; next_protocol; _} = + if Tezos_crypto.Protocol_hash.(protocol <> next_protocol) then + Events.(emit protocol_change_detected) () >>= fun () -> return_unit + else + Events.(emit accuser_saw_block) (level, hash) >>= fun () -> + let chain = `Hash chain_id in + let block = `Hash (hash, 0) in + state.highest_level_encountered <- + Raw_level.max level state.highest_level_encountered ; + (* Processing blocks *) + (Alpha_block_services.info cctxt ~chain ~block () >>= function + | Ok block_info -> ( + process_block cctxt state block_info >>=? fun () -> + (* Processing (pre)endorsements in the block *) + match block_info.operations with + | consensus_ops :: _ -> + let packed_op {Alpha_block_services.shell; protocol_data; _} = + {shell; protocol_data} + in + process_operations cctxt state consensus_ops ~packed_op chain_id + | _ -> + (* Should not happen as a block should contain 4 lists of + operations, the first list being dedicated to consensus + operations. *) + Events.(emit fetch_operations_error hash) >>= fun () -> return_unit + ) + | Error errs -> + Events.(emit accuser_block_error) (hash, errs) >>= fun () -> + return_unit) + >>=? fun () -> + cleanup_old_operations state ; + return_unit + +let process_new_block cctxt state bi = + process_new_block cctxt state bi >>= function + | Ok () -> Events.(emit accuser_processed_block) bi.hash >>= Lwt.return + | Error errs -> + Events.(emit accuser_block_error) (bi.hash, errs) >>= Lwt.return + +let rec wait_for_first_block ~name stream = + Lwt_stream.get stream >>= function + | None | Some (Error _) -> + B_Events.(emit cannot_fetch_event) name >>= fun () -> + (* NOTE: this is not a tight loop because of Lwt_stream.get *) + wait_for_first_block ~name stream + | Some (Ok bi) -> Lwt.return bi + +let log_errors_and_continue ~name p = + p >>= function + | Ok () -> Lwt.return_unit + | Error errs -> B_Events.(emit daemon_error) (name, errs) + +let start_ops_monitor cctxt = + Alpha_block_services.Mempool.monitor_operations + cctxt + ~chain:cctxt#chain + ~applied:true + ~branch_delayed:true + ~branch_refused:true + ~refused:true + ~outdated:true + () + +let create (cctxt : #Protocol_client_context.full) ?canceler ~preserved_levels + valid_blocks_stream = + B_Events.(emit daemon_setup) name >>= fun () -> + start_ops_monitor cctxt >>=? fun (ops_stream, ops_stream_stopper) -> + create_state + ~preserved_levels + valid_blocks_stream + ops_stream + ops_stream_stopper + >>= fun state -> + Option.iter + (fun canceler -> + Lwt_canceler.on_cancel canceler (fun () -> + state.ops_stream_stopper () ; + Lwt.return_unit)) + canceler ; + wait_for_first_block ~name state.blocks_stream >>= fun _first_event -> + let last_get_block = ref None in + let get_block () = + match !last_get_block with + | None -> + let t = Lwt_stream.get state.blocks_stream >|= fun e -> `Block e in + last_get_block := Some t ; + t + | Some t -> t + in + let last_get_ops = ref None in + let get_ops () = + match !last_get_ops with + | None -> + let t = Lwt_stream.get state.ops_stream >|= fun e -> `Operations e in + last_get_ops := Some t ; + t + | Some t -> t + in + Chain_services.chain_id cctxt () >>=? fun chain_id -> + (* main loop *) + (* Only allocate once the termination promise *) + let terminated = Lwt_exit.clean_up_starts >|= fun _ -> `Termination in + let rec worker_loop () = + Lwt.choose [terminated; get_block (); get_ops ()] >>= function + (* event matching *) + | `Termination -> return_unit + | `Block (None | Some (Error _)) -> + (* exit when the node is unavailable *) + last_get_block := None ; + B_Events.(emit daemon_connection_lost) name >>= fun () -> + fail Baking_errors.Node_connection_lost + | `Block (Some (Ok bi)) -> + last_get_block := None ; + process_new_block cctxt state bi >>= fun () -> worker_loop () + | `Operations None -> + (* restart a new operations monitor stream *) + last_get_ops := None ; + state.ops_stream_stopper () ; + start_ops_monitor cctxt >>=? fun (ops_stream, ops_stream_stopper) -> + state.ops_stream <- ops_stream ; + state.ops_stream_stopper <- ops_stream_stopper ; + worker_loop () + | `Operations (Some ops) -> + last_get_ops := None ; + log_errors_and_continue ~name + @@ process_operations + cctxt + state + ops + ~packed_op:(fun ((_h, op), _errl) -> op) + chain_id + >>= fun () -> worker_loop () + in + B_Events.(emit daemon_start) name >>= fun () -> worker_loop () diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.mli b/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.mli new file mode 100644 index 000000000000..46e784d132b4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_denunciation.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val create : + #Protocol_client_context.full -> + ?canceler:Lwt_canceler.t -> + preserved_levels:int -> + Client_baking_blocks.block_info tzresult Lwt_stream.t -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.ml b/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.ml new file mode 100644 index 000000000000..f34bf9da1c20 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.ml @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Events = Delegate_events.Baking_scheduling + +let sleep_until time = + (* Sleeping is a system op, baking is a protocol op, this is where we convert *) + let time = Time.System.of_protocol_exn time in + let delay = Ptime.diff time (Time.System.now ()) in + if Ptime.Span.compare delay Ptime.Span.zero < 0 then None + else Some (Lwt_unix.sleep (Ptime.Span.to_float_s delay)) diff --git a/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.mli b/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.mli new file mode 100644 index 000000000000..ae4a323ca1cc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_baking_scheduling.mli @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val sleep_until : Time.Protocol.t -> unit Lwt.t option + +(* val wait_for_first_event : + * name:string -> 'event tzresult Lwt_stream.t -> 'event Lwt.t + * + * val main : + * name:string -> + * cctxt:(#Protocol_client_context.full as 'a) -> + * stream:'event tzresult Lwt_stream.t -> + * state_maker:('event -> 'state tzresult Lwt.t) -> + * pre_loop:('a -> 'state -> 'event -> unit tzresult Lwt.t) -> + * compute_timeout:('state -> 'timesup Lwt.t) -> + * timeout_k:('a -> 'state -> 'timesup -> unit tzresult Lwt.t) -> + * event_k:('a -> 'state -> 'event -> unit tzresult Lwt.t) -> + * finalizer:('state -> unit Lwt.t) -> + * unit tzresult Lwt.t *) + +(** [main ~name ~cctxt ~stream ~state_maker ~pre_loop ~timeout_maker ~timeout_k + ~event_k] is an infinitely running loop that + monitors new events arriving on [stream]. The loop exits when the + [stream] gives an error. + + The function [pre_loop] is called before the loop starts. + + The loop maintains a state (of type ['state]) initialized by [state_maker] + and passed to the callbacks [timeout_maker] (used to set up waking-up + timeouts), [timeout_k] (when a computed timeout happens), and [event_k] + (when a new event arrives on the stream). +*) diff --git a/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml b/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml new file mode 100644 index 000000000000..836c95f1ad9a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml @@ -0,0 +1,188 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let rec retry (cctxt : #Protocol_client_context.full) ?max_delay ~delay ~factor + ~tries f x = + f x >>= function + | Ok _ as r -> Lwt.return r + | Error + (RPC_client_errors.Request_failed {error = Connection_failed _; _} :: _) + as err + when tries > 0 -> ( + cctxt#message "Connection refused, retrying in %.2f seconds..." delay + >>= fun () -> + Lwt.pick + [ + (Lwt_unix.sleep delay >|= fun () -> `Continue); + (Lwt_exit.clean_up_starts >|= fun _ -> `Killed); + ] + >>= function + | `Killed -> Lwt.return err + | `Continue -> + let next_delay = delay *. factor in + let delay = + Option.fold + ~none:next_delay + ~some:(fun max_delay -> Float.min next_delay max_delay) + max_delay + in + retry cctxt ?max_delay ~delay ~factor ~tries:(tries - 1) f x) + | Error _ as err -> Lwt.return err + +let rec retry_on_disconnection (cctxt : #Protocol_client_context.full) f = + f () >>= function + | Ok () -> return_unit + | Error (Baking_errors.Node_connection_lost :: _) -> + cctxt#warning + "Lost connection with the node. Retrying to establish connection..." + >>= fun () -> + (* Wait forever when the node stops responding... *) + Client_confirmations.wait_for_bootstrapped + ~retry:(retry cctxt ~max_delay:10. ~delay:1. ~factor:1.5 ~tries:max_int) + cctxt + >>=? fun () -> retry_on_disconnection cctxt f + | Error err -> + cctxt#error "Unexpected error: %a. Exiting..." pp_print_trace err + +module Baker = struct + let run (cctxt : Protocol_client_context.full) ?minimal_fees + ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte + ?liquidity_baking_toggle_vote ?per_block_vote_file ?extra_operations + ~chain ~context_path ~keep_alive delegates = + let process () = + Config_services.user_activated_upgrades cctxt + >>=? fun user_activated_upgrades -> + let config = + Baking_configuration.make + ?minimal_fees + ?minimal_nanotez_per_gas_unit + ?minimal_nanotez_per_byte + ?liquidity_baking_toggle_vote + ?per_block_vote_file + ?extra_operations + ~context_path + ~user_activated_upgrades + () + in + cctxt#message + "Baker v%a (%s) for %a started." + Tezos_version.Version.pp + Tezos_version.Current_git_info.version + Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_crypto.Protocol_hash.pp_short + Protocol.hash + >>= fun () -> + let canceler = Lwt_canceler.create () in + let _ = + Lwt_exit.register_clean_up_callback ~loc:__LOC__ (fun _ -> + cctxt#message "Shutting down the baker..." >>= fun () -> + Lwt_canceler.cancel canceler >>= fun _ -> Lwt.return_unit) + in + Baking_scheduling.run cctxt ~canceler ~chain config delegates + in + Client_confirmations.wait_for_bootstrapped + ~retry:(retry cctxt ~delay:1. ~factor:1.5 ~tries:5) + cctxt + >>=? fun () -> + cctxt#message "Waiting for protocol %s to start..." Protocol.name + >>= fun () -> + Node_rpc.await_protocol_activation cctxt ~chain () >>=? fun () -> + if keep_alive then retry_on_disconnection cctxt process else process () +end + +module Accuser = struct + let run (cctxt : #Protocol_client_context.full) ~chain ~preserved_levels + ~keep_alive = + let process () = + cctxt#message + "Accuser v%a (%s) for %a started." + Tezos_version.Version.pp + Tezos_version.Current_git_info.version + Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_crypto.Protocol_hash.pp_short + Protocol.hash + >>= fun () -> + Client_baking_blocks.monitor_valid_blocks + ~next_protocols:(Some [Protocol.hash]) + cctxt + ~chains:[chain] + () + >>=? fun (valid_blocks_stream, _) -> + let canceler = Lwt_canceler.create () in + let _ = + Lwt_exit.register_clean_up_callback ~loc:__LOC__ (fun _ -> + cctxt#message "Shutting down the accuser..." >>= fun () -> + Lwt_canceler.cancel canceler >>= fun _ -> Lwt.return_unit) + in + Client_baking_denunciation.create + cctxt + ~canceler + ~preserved_levels + valid_blocks_stream + in + Client_confirmations.wait_for_bootstrapped + ~retry:(retry cctxt ~delay:1. ~factor:1.5 ~tries:5) + cctxt + >>=? fun () -> + if keep_alive then retry_on_disconnection cctxt process else process () +end + +module VDF = struct + let run (cctxt : Protocol_client_context.full) ~chain ~keep_alive = + let open Lwt_result_syntax in + let process () = + let*! () = + cctxt#message + "VDF daemon v%a (%s) for %a started." + Tezos_version.Version.pp + Tezos_version.Current_git_info.version + Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_crypto.Protocol_hash.pp_short + Protocol.hash + in + let* chain_id = Shell_services.Chain.chain_id cctxt ~chain () in + let* constants = + Protocol.Alpha_services.Constants.all cctxt (`Hash chain_id, `Head 0) + in + let canceler = Lwt_canceler.create () in + let _ = + Lwt_exit.register_clean_up_callback ~loc:__LOC__ (fun _ -> + let*! () = cctxt#message "Shutting down the VDF daemon..." in + let*! _ = Lwt_canceler.cancel canceler in + Lwt.return_unit) + in + Baking_vdf.start_vdf_worker cctxt ~canceler constants chain + in + let* () = + Client_confirmations.wait_for_bootstrapped + ~retry:(retry cctxt ~delay:1. ~factor:1.5 ~tries:5) + cctxt + in + let*! () = + cctxt#message "Waiting for protocol %s to start..." Protocol.name + in + let* () = Node_rpc.await_protocol_activation cctxt ~chain () in + if keep_alive then retry_on_disconnection cctxt process else process () +end diff --git a/src/proto_016_PtMumbai/lib_delegate/client_daemon.mli b/src/proto_016_PtMumbai/lib_delegate/client_daemon.mli new file mode 100644 index 000000000000..751db5058857 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/client_daemon.mli @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Daemons directly supported by lib_delegate *) + +(** {1 Baker daemon} *) +module Baker : sig + val run : + Protocol_client_context.full -> + ?minimal_fees:Protocol.Alpha_context.Tez.t -> + ?minimal_nanotez_per_gas_unit:Q.t -> + ?minimal_nanotez_per_byte:Q.t -> + ?liquidity_baking_toggle_vote: + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote -> + ?per_block_vote_file:string -> + ?extra_operations:Baking_configuration.Operations_source.t -> + chain:Shell_services.chain -> + context_path:string -> + keep_alive:bool -> + Baking_state.consensus_key list -> + unit tzresult Lwt.t +end + +(** {1 Accuser daemon} *) + +module Accuser : sig + val run : + #Protocol_client_context.full -> + chain:Chain_services.chain -> + preserved_levels:int -> + keep_alive:bool -> + unit tzresult Lwt.t +end + +(** {1 VDF computation daemon} *) + +module VDF : sig + val run : + Protocol_client_context.full -> + chain:Chain_services.chain -> + keep_alive:bool -> + unit tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_delegate/delegate_events.ml b/src/proto_016_PtMumbai/lib_delegate/delegate_events.ml new file mode 100644 index 000000000000..ca4361b2dc96 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/delegate_events.ml @@ -0,0 +1,226 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <marcin.pastudzki@tqtezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let level = Internal_event.Notice + +(* Ignore the value in the output. *) +let pp_ignore fmt _ = Format.pp_print_string fmt "" + +module Denunciator = struct + include Internal_event.Simple + + let section = [Protocol.name; "delegate"; "denunciation"] + + let invalid_level_conversion = + declare_1 + ~section + ~level:Error + ~name:"invalid_level_conversion" + ~msg:"invalid level conversion: {errors}" + ~pp1:pp_print_top_error_of_trace + ("errors", Error_monad.(TzTrace.encoding error_encoding)) + + let double_endorsement_detected = + declare_2 + ~section + ~level + ~name:"double_endorsement_detected" + ~msg:"double endorsement detected" + ("existing_endorsement", Tezos_crypto.Operation_hash.encoding) + ("new_endorsement", Tezos_crypto.Operation_hash.encoding) + + let double_endorsement_denounced = + declare_2 + ~section + ~level + ~name:"double_endorsement_denounced" + ~msg:"double endorsement evidence injected: {hash}" + ("hash", Tezos_crypto.Operation_hash.encoding) + ~pp2:pp_ignore + ("bytes", Data_encoding.bytes) + + let double_preendorsement_detected = + declare_2 + ~section + ~level + ~name:"double_preendorsement_detected" + ~msg:"double preendorsement detected" + ("existing_preendorsement", Tezos_crypto.Operation_hash.encoding) + ("new_preendorsement", Tezos_crypto.Operation_hash.encoding) + + let double_preendorsement_denounced = + declare_2 + ~section + ~level + ~name:"double_preendorsement_denounced" + ~msg:"double preendorsement evidence injected: {hash}" + ("hash", Tezos_crypto.Operation_hash.encoding) + ~pp2:pp_ignore + ("bytes", Data_encoding.bytes) + + let inconsistent_endorsement = + declare_1 + ~section + ~level:Error + ~name:"inconsistent_endorsement" + ~msg:"inconsistent endorsement found {hash}" + ("hash", Tezos_crypto.Operation_hash.encoding) + + let unexpected_pruned_block = + declare_1 + ~section + ~level:Error + ~name:"unexpected_pruned_block" + ~msg:"unexpected pruned block: {hash}" + ("hash", Tezos_crypto.Block_hash.encoding) + + let double_baking_but_not = + declare_0 + ~section + ~level:Debug + ~name:"double_baking_but_not" + ~msg:"double baking detected but block hashes are equivalent; skipping" + () + + let double_baking_detected = + declare_0 + ~section + ~level + ~name:"double_baking_detected" + ~msg:"double baking detected" + () + + let double_baking_denounced = + declare_2 + ~section + ~level + ~name:"double_baking_denounced" + ~msg:"double baking evidence injected {hash}" + ("hash", Tezos_crypto.Operation_hash.encoding) + ~pp2:pp_ignore + ("bytes", Data_encoding.bytes) + + let protocol_change_detected = + declare_0 + ~section + ~level:Error + ~name:"protocol_change_detected" + ~msg:"protocol changing detected; skipping the block" + () + + let accuser_saw_block = + declare_2 + ~section + ~level:Debug + ~name:"accuser_saw_block" + ~msg:"block level: {level}" + ("level", Alpha_context.Raw_level.encoding) + ("hash", Tezos_crypto.Block_hash.encoding) + + let fetch_operations_error = + declare_1 + ~section + ~level:Error + ~name:"fetch_operations_error" + ~msg:"error while fetching operations of block {hash}" + ("hash", Tezos_crypto.Block_hash.encoding) + ~pp1:Tezos_crypto.Block_hash.pp + + let accuser_processed_block = + declare_1 + ~section + ~level + ~name:"accuser_processed_block" + ~msg:"block {hash} registered" + ("hash", Tezos_crypto.Block_hash.encoding) + + let accuser_block_error = + declare_2 + ~section + ~level:Error + ~name:"accuser_block_error" + ~msg:"error while processing block {hash} {errors}" + ~pp2:pp_print_top_error_of_trace + ("hash", Tezos_crypto.Block_hash.encoding) + ("errors", Error_monad.(TzTrace.encoding error_encoding)) +end + +module Baking_scheduling = struct + include Internal_event.Simple + + let section = [Protocol.name; "delegate"; "baking-scheduling"] + + let cannot_fetch_event = + declare_1 + ~section + ~level:Info + ~name:"cannot_fetch_event" + ~msg:"{worker}: can't fetch the current event; waiting for new event" + ("worker", Data_encoding.string) + + let daemon_error = + declare_2 + ~section + ~level:Error + ~name:"daemon_error" + ~msg:"{worker}: error while baking: {errors}" + ~pp2:pp_print_top_error_of_trace + ("worker", Data_encoding.string) + ("errors", Error_monad.(TzTrace.encoding error_encoding)) + + let daemon_setup = + declare_1 + ~section + ~level:Info + ~name:"daemon_setup" + ~msg:"setting up before the {worker} can start" + ("worker", Data_encoding.string) + + let daemon_connection_lost = + declare_1 + ~section + ~level:Error + ~name:"daemon_connection_lost" + ~msg:"connection to node lost, {worker} exiting" + ("worker", Data_encoding.string) + + let daemon_wakeup = + declare_1 + ~section + ~level:Debug + ~name:"daemon_wakeup" + ~msg:"waking up for {worker}" + ("worker", Data_encoding.string) + + let daemon_start = + declare_1 + ~section + ~level:Info + ~name:"daemon_start" + ~msg:"starting {worker} daemon" + ("worker", Data_encoding.string) +end diff --git a/src/proto_016_PtMumbai/lib_delegate/dune b/src/proto_016_PtMumbai/lib_delegate/dune new file mode 100644 index 000000000000..f12049506044 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/dune @@ -0,0 +1,106 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_baking_alpha) + (public_name tezos-baking-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-clic + tezos-version + tezos-protocol-alpha + tezos-protocol-plugin-alpha + tezos-protocol-environment + tezos-shell-services + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-stdlib + tezos-stdlib-unix + tezos-shell-context + tezos-context + tezos-context.memory + tezos-rpc-http-client-unix + tezos-context-ops + tezos-rpc + tezos-rpc-http + lwt-canceler + lwt-exit + uri) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_stdlib + -open Tezos_stdlib_unix + -open Tezos_shell_context + -open Tezos_context + -open Tezos_context_ops + -open Tezos_rpc_http) + (modules (:standard \ Baking_commands Baking_commands_registration))) + +(library + (name tezos_baking_alpha_commands) + (public_name tezos-baking-alpha-commands) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-alpha + tezos-stdlib-unix + tezos-protocol-environment + tezos-shell-services + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-baking-alpha + tezos-rpc + uri) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_stdlib_unix + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha) + (modules Baking_commands)) + +(library + (name tezos_baking_alpha_commands_registration) + (public_name tezos-baking-alpha-commands.registration) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-alpha + tezos-protocol-environment + tezos-shell-services + tezos-client-base + tezos-client-alpha + tezos-client-commands + tezos-baking-alpha + tezos-baking-alpha-commands + tezos-rpc) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha + -open Tezos_shell_services + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha + -open Tezos_baking_alpha_commands) + (modules Baking_commands_registration)) diff --git a/src/proto_016_PtMumbai/lib_delegate/liquidity_baking_vote_file.ml b/src/proto_016_PtMumbai/lib_delegate/liquidity_baking_vote_file.ml new file mode 100644 index 000000000000..ef730e091f7e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/liquidity_baking_vote_file.ml @@ -0,0 +1,200 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +module Events = Baking_events.Liquidity_baking + +type per_block_votes = { + liquidity_baking_toggle_vote : + Protocol.Alpha_context.Liquidity_baking.liquidity_baking_toggle_vote option; +} + +let per_block_votes_encoding = + let open Data_encoding in + def "per_block_votes.alpha" + @@ conv + (fun {liquidity_baking_toggle_vote} -> liquidity_baking_toggle_vote) + (fun liquidity_baking_toggle_vote -> {liquidity_baking_toggle_vote}) + (obj1 + (opt + "liquidity_baking_toggle_vote" + Protocol.Alpha_context.Liquidity_baking + .liquidity_baking_toggle_vote_encoding)) + +type error += Block_vote_file_not_found of string + +type error += Block_vote_file_invalid of string + +type error += Block_vote_file_wrong_content of string + +type error += Block_vote_file_missing_liquidity_baking_toggle_vote of string + +type error += Missing_vote_on_startup + +let () = + register_error_kind + `Permanent + ~id:"Client_baking_forge.block_vote_file_not_found" + ~title: + "The provided block vote file path does not point to an existing file." + ~description: + "A block vote file path was provided on the command line but the path \ + does not point to an existing file." + ~pp:(fun ppf file_path -> + Format.fprintf + ppf + "@[The provided block vote file path \"%s\" does not point to an \ + existing file.@]" + file_path) + Data_encoding.(obj1 (req "file_path" string)) + (function + | Block_vote_file_not_found file_path -> Some file_path | _ -> None) + (fun file_path -> Block_vote_file_not_found file_path) ; + register_error_kind + `Permanent + ~id:"Client_baking_forge.block_vote_file_invalid" + ~title: + "The provided block vote file path does not point to a valid JSON file." + ~description: + "A block vote file path was provided on the command line but the path \ + does not point to a valid JSON file." + ~pp:(fun ppf file_path -> + Format.fprintf + ppf + "@[The provided block vote file path \"%s\" does not point to a valid \ + JSON file. The file exists but its content is not valid JSON.@]" + file_path) + Data_encoding.(obj1 (req "file_path" string)) + (function Block_vote_file_invalid file_path -> Some file_path | _ -> None) + (fun file_path -> Block_vote_file_invalid file_path) ; + register_error_kind + `Permanent + ~id:"Client_baking_forge.block_vote_file_wrong_content" + ~title:"The content of the provided block vote file is unexpected." + ~description: + "The block vote file is valid JSON but its content is not the expected \ + one." + ~pp:(fun ppf file_path -> + Format.fprintf + ppf + "@[The provided block vote file \"%s\" is a valid JSON file but its \ + content is unexpected. Expecting a JSON file containing either \ + '{\"liquidity_baking_toggle_vote\": \"on\"}', or \ + '{\"liquidity_baking_toggle_vote\": \"off\"}', or \ + '{\"liquidity_baking_toggle_vote\": \"pass\"}'.@]" + file_path) + Data_encoding.(obj1 (req "file_path" string)) + (function + | Block_vote_file_wrong_content file_path -> Some file_path | _ -> None) + (fun file_path -> Block_vote_file_wrong_content file_path) ; + register_error_kind + `Permanent + ~id: + "Client_baking_forge.block_vote_file_missing_liquidity_baking_toggle_vote" + ~title: + "In the provided block vote file, no entry for liquidity baking toggle \ + vote was found" + ~description: + "In the provided block vote file, no entry for liquidity baking toggle \ + vote was found." + ~pp:(fun ppf file_path -> + Format.fprintf + ppf + "@[In the provided block vote file \"%s\", the \ + \"liquidity_baking_toggle_vote\" boolean field is missing. Expecting \ + a JSON file containing either '{\"liquidity_baking_toggle_vote\": \ + \"on\"}', or '{\"liquidity_baking_toggle_vote\": \"off\"}', or \ + '{\"liquidity_baking_toggle_vote\": \"pass\"}'.@]" + file_path) + Data_encoding.(obj1 (req "file_path" string)) + (function + | Block_vote_file_missing_liquidity_baking_toggle_vote file_path -> + Some file_path + | _ -> None) + (fun file_path -> + Block_vote_file_missing_liquidity_baking_toggle_vote file_path) ; + register_error_kind + `Permanent + ~id:"Client_baking_forge.missing_vote_on_startup" + ~title:"Missing vote on startup" + ~description: + "No CLI flag, file path, or vote file in default location provided on \ + startup" + ~pp:(fun fmt () -> + Format.fprintf + fmt + "Missing liquidity baking toggle vote, please use either the \ + --liquidity-baking-toggle-vote or --per_block_vote_file option or a \ + vote file in the default location: per_block_votes.json in the \ + current working directory.") + Data_encoding.empty + (function Missing_vote_on_startup -> Some () | _ -> None) + (fun () -> Missing_vote_on_startup) + +let traced_option_to_result ~error = + Option.fold ~some:ok ~none:(Result_syntax.tzfail error) + +let check_file_exists file = + if Sys.file_exists file then Result.return_unit + else error (Block_vote_file_not_found file) + +let read_liquidity_baking_toggle_vote ~per_block_vote_file = + Events.(emit reading_per_block) per_block_vote_file >>= fun () -> + check_file_exists per_block_vote_file >>?= fun () -> + trace (Block_vote_file_invalid per_block_vote_file) + @@ Lwt_utils_unix.Json.read_file per_block_vote_file + >>=? fun votes_json -> + Events.(emit per_block_vote_file_notice) "found" >>= fun () -> + trace (Block_vote_file_wrong_content per_block_vote_file) + @@ Error_monad.protect (fun () -> + return + @@ Data_encoding.Json.destruct per_block_votes_encoding votes_json) + >>=? fun votes -> + Events.(emit per_block_vote_file_notice) "JSON decoded" >>= fun () -> + traced_option_to_result + ~error: + (Block_vote_file_missing_liquidity_baking_toggle_vote per_block_vote_file) + votes.liquidity_baking_toggle_vote + >>?= fun liquidity_baking_toggle_vote -> + Events.(emit reading_liquidity_baking) () >>= fun () -> + Events.(emit liquidity_baking_toggle_vote) liquidity_baking_toggle_vote + >>= fun () -> return liquidity_baking_toggle_vote + +let read_liquidity_baking_toggle_vote_no_fail ~default ~per_block_vote_file = + read_liquidity_baking_toggle_vote ~per_block_vote_file >>= function + | Ok vote -> Lwt.return vote + | Error errs -> + Events.(emit per_block_vote_file_fail) errs >>= fun () -> + Lwt.return default + +let read_liquidity_baking_toggle_vote_on_startup ~default ~per_block_vote_file = + read_liquidity_baking_toggle_vote ~per_block_vote_file >>= function + | Ok vote -> return (vote, true) + | Error errs -> ( + match default with + | None -> + Events.(emit per_block_vote_file_fail) errs >>= fun () -> + fail Missing_vote_on_startup + | Some vote -> return (vote, false)) diff --git a/src/proto_016_PtMumbai/lib_delegate/logging.ml b/src/proto_016_PtMumbai/lib_delegate/logging.ml new file mode 100644 index 000000000000..6756e73e07e6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/logging.ml @@ -0,0 +1,167 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let timestamp_tag = + Tag.def ~doc:"Timestamp when event occurred" "timestamp" Time.System.pp_hum + +let valid_ops = Tag.def ~doc:"Valid Operations" "valid_ops" Format.pp_print_int + +let op_count = + Tag.def ~doc:"Number of operations" "op_count" Format.pp_print_int + +let refused_ops = + Tag.def ~doc:"Refused Operations" "refused_ops" Format.pp_print_int + +let bake_priority_tag = + Tag.def ~doc:"Baking priority" "bake_priority" Format.pp_print_int + +let fitness_tag = Tag.def ~doc:"Fitness" "fitness" Fitness.pp + +let current_slots_tag = + Tag.def + ~doc:"Number of baking slots that can be baked at this time" + "current_slots" + Format.pp_print_int + +let future_slots_tag = + Tag.def + ~doc:"Number of baking slots in the foreseeable future but not yet bakeable" + "future_slots" + Format.pp_print_int + +let timespan_tag = Tag.def ~doc:"Timespan in seconds" "timespan" Ptime.Span.pp + +let filename_tag = Tag.def ~doc:"Filename" "filename" Format.pp_print_text + +let signed_header_tag = + Tag.def ~doc:"Signed header" "signed_header" (fun fmt x -> + Hex.pp fmt (Hex.of_bytes x)) + +let signed_operation_tag = + Tag.def ~doc:"Signed operation" "signed_operation" (fun fmt x -> + Hex.pp fmt (Hex.of_bytes x)) + +let operations_tag = + Tag.def + ~doc:"Block Operations" + "operations" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf "+") + (fun ppf operations -> Format.fprintf ppf "%d" (List.length operations))) + +let raw_operations_tag = + Tag.def ~doc:"Raw operations" "raw_operations" (fun fmt raw_ops -> + let pp_op fmt op = + let json = Data_encoding.Json.construct Operation.raw_encoding op in + Format.fprintf fmt "%a" Data_encoding.Json.pp json + in + Format.fprintf + fmt + "@[<v>%a@]" + (Format.pp_print_list ~pp_sep:Format.pp_print_cut pp_op) + raw_ops) + +let bake_op_count_tag = + Tag.def ~doc:"Bake Operation Count" "operation_count" Format.pp_print_int + +let endorsement_slot_tag = + Tag.def ~doc:"Endorsement Slot" "endorsement_slot" Format.pp_print_int + +let endorsement_slots_tag = + Tag.def + ~doc:"Endorsement Slots" + "endorsement_slots" + Format.(fun ppf v -> pp_print_int ppf (List.length v)) + +let denounced_endorsements_slots_tag = + Tag.def + ~doc:"Endorsement Slots" + "denounced_endorsement_slots" + Format.(pp_print_list pp_print_int) + +let denouncement_source_tag = + Tag.def ~doc:"Denounce Source" "source" Format.pp_print_text + +let level_tag = Tag.def ~doc:"Level" "level" Raw_level.pp + +let nonce_tag = + Tag.def + ~doc:"Nonce" + "nonce" + Data_encoding.Json.( + fun ppf nonce -> pp ppf (construct Nonce.encoding nonce)) + +let chain_tag = + Tag.def + ~doc:"Chain selector" + "chain" + Format.( + fun ppf chain -> + pp_print_string ppf @@ Block_services.chain_to_string chain) + +let block_tag = + Tag.def + ~doc:"Block selector" + "block" + Format.( + fun ppf block -> pp_print_string ppf @@ Block_services.to_string block) + +let worker_tag = + Tag.def ~doc:"Worker in which event occurred" "worker" Format.pp_print_text + +let block_header_tag = + Tag.def ~doc:"Raw block header" "block_header" (fun ppf _ -> + Format.fprintf ppf "[raw block header]") + +let conflicting_endorsements_tag = + Tag.def + ~doc:"Two conflicting endorsements signed by the same key" + "conflicting_endorsements" + Format.( + fun ppf (a, b) -> + fprintf + ppf + "%a / %a" + Tezos_crypto.Operation_hash.pp + (Operation.hash a) + Tezos_crypto.Operation_hash.pp + (Operation.hash b)) + +let conflicting_preendorsements_tag = + Tag.def + ~doc:"Two conflicting preendorsements signed by the same key" + "conflicting_preendorsements" + Format.( + fun ppf (a, b) -> + fprintf + ppf + "%a / %a" + Tezos_crypto.Operation_hash.pp + (Operation.hash a) + Tezos_crypto.Operation_hash.pp + (Operation.hash b)) diff --git a/src/proto_016_PtMumbai/lib_delegate/logging.mli b/src/proto_016_PtMumbai/lib_delegate/logging.mli new file mode 100644 index 000000000000..5e10680ae612 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/logging.mli @@ -0,0 +1,83 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +val timestamp_tag : Time.System.t Tag.def + +val valid_ops : int Tag.def + +val op_count : int Tag.def + +val refused_ops : int Tag.def + +val bake_priority_tag : int Tag.def + +val fitness_tag : Fitness.t Tag.def + +val current_slots_tag : int Tag.def + +val future_slots_tag : int Tag.def + +val timespan_tag : Time.System.Span.t Tag.def + +val filename_tag : string Tag.def + +val signed_header_tag : Bytes.t Tag.def + +val signed_operation_tag : Bytes.t Tag.def + +val operations_tag : Tezos_base.Operation.t list list Tag.def + +val raw_operations_tag : Operation.raw list Tag.def + +val bake_op_count_tag : int Tag.def + +val endorsement_slot_tag : int Tag.def + +val endorsement_slots_tag : int list Tag.def + +val denounced_endorsements_slots_tag : int list Tag.def + +val denouncement_source_tag : string Tag.def + +val level_tag : Raw_level.t Tag.def + +val nonce_tag : Nonce.t Tag.def + +val chain_tag : Block_services.chain Tag.def + +val block_tag : Block_services.block Tag.def + +val worker_tag : string Tag.def + +val block_header_tag : Block_header.t Tag.def + +val conflicting_endorsements_tag : + (Kind.endorsement operation * Kind.endorsement operation) Tag.def + +val conflicting_preendorsements_tag : + (Kind.preendorsement operation * Kind.preendorsement operation) Tag.def diff --git a/src/proto_016_PtMumbai/lib_delegate/node_rpc.ml b/src/proto_016_PtMumbai/lib_delegate/node_rpc.ml new file mode 100644 index 000000000000..94be468c039b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/node_rpc.ml @@ -0,0 +1,218 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +module Block_services = Block_services.Make (Protocol) (Protocol) +module Events = Baking_events.Node_rpc + +let inject_block cctxt ?(force = false) ~chain signed_block_header operations = + let signed_shell_header_bytes = + Data_encoding.Binary.to_bytes_exn Block_header.encoding signed_block_header + in + Shell_services.Injection.block + cctxt + ~chain + ~force + signed_shell_header_bytes + operations + +let preapply_block cctxt ~chain ~head ~timestamp ~protocol_data operations = + Block_services.Helpers.Preapply.block + cctxt + ~chain + ~timestamp + ~block:(`Hash (head, 0)) + operations + ~protocol_data + +let extract_prequorum preendorsements = + match preendorsements with + | h :: _ as l -> + let ({protocol_data = {contents = Single (Preendorsement content); _}; _}) + = + (h : Kind.preendorsement Operation.t) + in + Some + { + Baking_state.level = Raw_level.to_int32 content.level; + round = content.round; + block_payload_hash = content.block_payload_hash; + preendorsements = l; + } + | _ -> None + +let raw_info cctxt ~chain ~block_hash shell resulting_context_hash payload_hash + payload_round current_protocol next_protocol live_blocks = + Events.(emit raw_info (block_hash, shell.Tezos_base.Block_header.level)) + >>= fun () -> + let open Protocol_client_context in + let block = `Hash (block_hash, 0) in + let is_in_protocol = + Tezos_crypto.Protocol_hash.(current_protocol = Protocol.hash) + in + (if is_in_protocol then + Alpha_block_services.Operations.operations cctxt ~chain ~block () + >>=? fun operations -> + let operations = + List.map + (fun l -> + List.map + (fun {Alpha_block_services.shell; protocol_data; _} -> + {Alpha_context.shell; protocol_data}) + l) + operations + in + match Operation_pool.extract_operations_of_list_list operations with + | None -> failwith "Unexpected operation list size" + | Some operations -> return operations + else + (* If we are not in the current protocol, do no consider operations *) + return (None, [], Operation_pool.empty_payload)) + >>=? fun (preendorsements, quorum, payload) -> + (match Baking_state.round_of_shell_header shell with + | Ok round -> ok round + | _ -> + (* this can occur if the protocol has just changed and the + previous protocol does not have a concept of round + (e.g. Genesis) *) + ok Round.zero) + >>?= fun round -> + let prequorum = Option.bind preendorsements extract_prequorum in + return + { + Baking_state.hash = block_hash; + shell; + resulting_context_hash; + payload_hash; + payload_round; + round; + protocol = current_protocol; + next_protocol; + prequorum; + quorum; + payload; + live_blocks; + } + +let dummy_payload_hash = Block_payload_hash.zero + +let info cctxt ~chain ~block () = + let open Protocol_client_context in + (* Fails if the block's protocol is not the current one *) + Shell_services.Blocks.protocols cctxt ~chain ~block () + >>=? fun {current_protocol; next_protocol} -> + Shell_services.Blocks.resulting_context_hash cctxt ~chain ~block () + >>=? fun resulting_context_hash -> + (if Tezos_crypto.Protocol_hash.(current_protocol <> Protocol.hash) then + Block_services.Header.shell_header cctxt ~chain ~block () >>=? fun shell -> + Chain_services.Blocks.Header.raw_protocol_data cctxt ~chain ~block () + >>=? fun protocol_data -> + let hash = + Tezos_base.Block_header.hash {Tezos_base.Block_header.shell; protocol_data} + in + (* /!\ We decode [protocol_data] with the current protocol's + encoding, while we should use the previous protocol's + [protocol_data] encoding. For now, this works because the + encoding has not changed. *) + let payload_hash, payload_round = + match + Data_encoding.Binary.of_bytes_opt + Protocol.block_header_data_encoding + protocol_data + with + | Some {contents = {payload_hash; payload_round; _}; _} -> + (payload_hash, payload_round) + | None -> (dummy_payload_hash, Round.zero) + in + return (hash, shell, resulting_context_hash, payload_hash, payload_round) + else + Alpha_block_services.header cctxt ~chain ~block () + >>=? fun {hash; shell; protocol_data; _} -> + return + ( hash, + shell, + resulting_context_hash, + protocol_data.contents.payload_hash, + protocol_data.contents.payload_round )) + >>=? fun (hash, shell, resulting_context_hash, payload_hash, payload_round) -> + (Chain_services.Blocks.live_blocks cctxt ~chain ~block () >>= function + | Error _ -> + (* The RPC might fail when a block's metadata is not available *) + Lwt.return Tezos_crypto.Block_hash.Set.empty + | Ok live_blocks -> Lwt.return live_blocks) + >>= fun live_blocks -> + raw_info + cctxt + ~chain + ~block_hash:hash + shell + resulting_context_hash + payload_hash + payload_round + current_protocol + next_protocol + live_blocks + +let find_in_cache_or_fetch cctxt ?cache ~chain block_hash = + let open Baking_cache in + let fetch () = info cctxt ~chain ~block:(`Hash (block_hash, 0)) () in + match cache with + | None -> fetch () + | Some block_cache -> ( + match Block_cache.find_opt block_cache block_hash with + | Some block_info -> return block_info + | None -> + fetch () >>=? fun block_info -> + Block_cache.replace block_cache block_hash block_info ; + return block_info) + +let proposal cctxt ?cache ~chain block_hash = + find_in_cache_or_fetch cctxt ~chain ?cache block_hash >>=? fun block -> + let predecessor_hash = block.shell.predecessor in + find_in_cache_or_fetch cctxt ~chain ?cache predecessor_hash + >>=? fun predecessor -> return {Baking_state.block; predecessor} + +let monitor_proposals cctxt ~chain () = + let cache = Baking_cache.Block_cache.create 100 in + Monitor_services.heads cctxt ~next_protocols:[Protocol.hash] chain + >>=? fun (block_stream, stopper) -> + return + ( Lwt_stream.filter_map_s + (fun (block_hash, _) -> + protect (fun () -> proposal cctxt ~cache ~chain block_hash) + >>= function + | Ok proposal -> Lwt.return_some proposal + | Error err -> + Events.(emit error_while_monitoring_heads err) >>= fun () -> + Lwt.return_none) + block_stream, + stopper ) + +let await_protocol_activation cctxt ~chain () = + Monitor_services.heads cctxt ~next_protocols:[Protocol.hash] chain + >>=? fun (_block_stream, stop) -> + stop () ; + return_unit diff --git a/src/proto_016_PtMumbai/lib_delegate/node_rpc.mli b/src/proto_016_PtMumbai/lib_delegate/node_rpc.mli new file mode 100644 index 000000000000..55694e129b55 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/node_rpc.mli @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** Inject a block. + + @param force defaults to [false] + @return block hash of the newly injected block +*) +val inject_block : + #Protocol_client_context.full -> + ?force:bool -> + chain:Shell_services.chain -> + Block_header.t -> + Tezos_base.Operation.t list list -> + Tezos_crypto.Block_hash.t tzresult Lwt.t + +(** Preapply a block using the node validation mechanism.*) +val preapply_block : + #Protocol_client_context.full -> + chain:Shell_services.chain -> + head:Tezos_crypto.Block_hash.t -> + timestamp:Time.Protocol.t -> + protocol_data:Protocol.block_header_data -> + packed_operation list list -> + (Tezos_base.Block_header.shell_header * error Preapply_result.t list) tzresult + Lwt.t + +(** Fetch a proposal from the node. + + @param cache is unset by default +*) +val proposal : + #Tezos_rpc.Context.simple -> + ?cache:Baking_state.block_info Baking_cache.Block_cache.t -> + chain:Shell_services.chain -> + Tezos_crypto.Block_hash.t -> + Baking_state.proposal tzresult Lwt.t + +(** Monitor proposals from the node.*) +val monitor_proposals : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + unit -> + (Baking_state.proposal Lwt_stream.t * (unit -> unit)) tzresult Lwt.t + +(** Await the current protocol to be activated. *) +val await_protocol_activation : + #Protocol_client_context.rpc_context -> + chain:Shell_services.chain -> + unit -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_pool.ml b/src/proto_016_PtMumbai/lib_delegate/operation_pool.ml new file mode 100644 index 000000000000..16ec9eda7cdb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_pool.ml @@ -0,0 +1,397 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* Should we use a better ordering ? *) + +type 'collection t = { + consensus : 'collection; + votes : 'collection; + anonymous : 'collection; + managers : 'collection; +} + +let compare_op op1 op2 = + try Stdlib.compare op1 op2 + with _ -> + (* FIXME some operations (e.g. tx_rollup_rejection) pack + functional values which could raise an exception. In this + specific case, we default to comparing their hashes. *) + Tezos_crypto.Operation_hash.compare + (Alpha_context.Operation.hash_packed op1) + (Alpha_context.Operation.hash_packed op2) + +module Prioritized_operation = struct + (* Higher priority operations will be included first *) + type t = Prioritized of int * packed_operation | Low of packed_operation + + let extern ?(priority = 1) op = Prioritized (priority, op) + + let node op = Low op + + let packed = function Prioritized (_, op) | Low op -> op + + let compare_priority t1 t2 = + match (t1, t2) with + | Prioritized _, Low _ -> 1 + | Low _, Prioritized _ -> -1 + | Low _, Low _ -> 0 + | Prioritized (p0, _), Prioritized (p1, _) -> Compare.Int.compare p0 p1 + + let compare a b = + let c = compare_priority a b in + if c <> 0 then c else compare_op (packed a) (packed b) +end + +module Operation_set = Set.Make (struct + type t = packed_operation + + let compare = compare_op +end) + +module Prioritized_operation_set = struct + include Set.Make (struct + type t = Prioritized_operation.t + + let compare = Prioritized_operation.compare + end) + + let operations set = elements set |> List.map Prioritized_operation.packed +end + +(* TODO refine this: unpack operations *) +type pool = Operation_set.t t + +(* TODO refine this: unpack operations *) +type ordered_pool = packed_operation list t + +let ordered_pool_encoding = + let open Data_encoding in + conv + (fun {consensus; votes; anonymous; managers} -> + (consensus, votes, anonymous, managers)) + (fun (consensus, votes, anonymous, managers) -> + {consensus; votes; anonymous; managers}) + (obj4 + (req "ordered_consensus" (list (dynamic_size Operation.encoding))) + (req "ordered_votes" (list (dynamic_size Operation.encoding))) + (req "ordered_anonymouns" (list (dynamic_size Operation.encoding))) + (req "ordered_managers" (list (dynamic_size Operation.encoding)))) + +type payload = { + votes_payload : packed_operation list; + anonymous_payload : packed_operation list; + managers_payload : packed_operation list; +} + +let empty_payload = + {votes_payload = []; anonymous_payload = []; managers_payload = []} + +let payload_encoding = + let open Data_encoding in + conv + (fun {votes_payload; anonymous_payload; managers_payload} -> + (votes_payload, anonymous_payload, managers_payload)) + (fun (votes_payload, anonymous_payload, managers_payload) -> + {votes_payload; anonymous_payload; managers_payload}) + (obj3 + (req "votes_payload" (list (dynamic_size Operation.encoding))) + (req "anonymous_payload" (list (dynamic_size Operation.encoding))) + (req "managers_payload" (list (dynamic_size Operation.encoding)))) + +let pp_payload fmt {votes_payload; anonymous_payload; managers_payload} = + Format.fprintf + fmt + "[votes: %d, anonymous: %d, managers: %d]" + (List.length votes_payload) + (List.length anonymous_payload) + (List.length managers_payload) + +let empty = + { + consensus = Operation_set.empty; + votes = Operation_set.empty; + anonymous = Operation_set.empty; + managers = Operation_set.empty; + } + +let empty_ordered = {consensus = []; votes = []; anonymous = []; managers = []} + +let pp_pool fmt {consensus; votes; anonymous; managers} = + Format.fprintf + fmt + "[consensus: %d, votes: %d, anonymous: %d, managers: %d]" + (Operation_set.cardinal consensus) + (Operation_set.cardinal votes) + (Operation_set.cardinal anonymous) + (Operation_set.cardinal managers) + +let pp_ordered_pool fmt {consensus; votes; anonymous; managers} = + Format.fprintf + fmt + "[consensus: %d, votes: %d, anonymous: %d, managers: %d]" + (List.length consensus) + (List.length votes) + (List.length anonymous) + (List.length managers) + +let classify op = + (* Hypothesis: acceptable passes on an ill-formed operation returns + None. *) + let pass = Main.acceptable_pass op in + match pass with + | None -> `Bad + | Some pass -> + let open Operation_repr in + if pass = consensus_pass then `Consensus + (* TODO filter outdated consensus ops ? *) + else if pass = voting_pass then `Votes + else if pass = anonymous_pass then `Anonymous + else if pass = manager_pass then `Managers + else `Bad + +let add_operation_to_pool add classify pool operation = + match classify operation with + | `Consensus -> + let consensus = add operation pool.consensus in + {pool with consensus} + | `Votes -> + let votes = add operation pool.votes in + {pool with votes} + | `Anonymous -> + let anonymous = add operation pool.anonymous in + {pool with anonymous} + | `Managers -> + let managers = add operation pool.managers in + {pool with managers} + | `Bad -> pool + +let add_operation = add_operation_to_pool Operation_set.add classify + +let add_operations pool ops = List.fold_left add_operation pool ops + +type consensus_filter = { + level : int32; + round : Round.t; + payload_hash : Block_payload_hash.t; +} + +(** From a pool of operations [operation_pool], the function filters + out the endorsements that are different from the [current_level], + the [current_round] or the optional [current_block_payload_hash], + as well as preendorsements. *) +let filter_with_relevant_consensus_ops ~(endorsement_filter : consensus_filter) + ~(preendorsement_filter : consensus_filter option) operation_set = + Operation_set.filter + (fun {protocol_data; _} -> + match (protocol_data, preendorsement_filter) with + (* 1a. Remove preendorsements. *) + | Operation_data {contents = Single (Preendorsement _); _}, None -> false + (* 1b. Filter preendorsements. *) + | ( Operation_data + { + contents = + Single (Preendorsement {level; round; block_payload_hash; _}); + _; + }, + Some + {level = level'; round = round'; payload_hash = block_payload_hash'} + ) -> + Compare.Int32.(Raw_level.to_int32 level = level') + && Round.(round = round') + && Block_payload_hash.(block_payload_hash = block_payload_hash') + (* 2. Filter endorsements. *) + | ( Operation_data + { + contents = + Single (Endorsement {level; round; block_payload_hash; _}); + _; + }, + _ ) -> + Compare.Int32.(Raw_level.to_int32 level = endorsement_filter.level) + && Round.(round = endorsement_filter.round) + && Block_payload_hash.( + block_payload_hash = endorsement_filter.payload_hash) + (* 3. Preserve all non-consensus operations. *) + | _ -> true) + operation_set + +let unpack_preendorsement packed_preendorsement = + let {shell; protocol_data = Operation_data data} = packed_preendorsement in + match data with + | {contents = Single (Preendorsement _); _} -> + Some ({shell; protocol_data = data} : Kind.preendorsement Operation.t) + | _ -> None + +let unpack_endorsement packed_endorsement = + let {shell; protocol_data = Operation_data data} = packed_endorsement in + match data with + | {contents = Single (Endorsement _); _} -> + Some ({shell; protocol_data = data} : Kind.endorsement Operation.t) + | _ -> None + +let filter_preendorsements ops = + List.filter_map + (function + | { + shell = {branch}; + protocol_data = + Operation_data + ({contents = Single (Preendorsement _); _} as content); + _; + } -> + Some + ({shell = {branch}; protocol_data = content} + : Kind.preendorsement operation) + | _ -> None) + ops + +let filter_endorsements ops = + List.filter_map + (function + | { + shell = {branch}; + protocol_data = + Operation_data ({contents = Single (Endorsement _); _} as content); + _; + } -> + Some + ({shell = {branch}; protocol_data = content} + : Kind.endorsement operation) + | _ -> None) + ops + +let ordered_to_list_list {consensus; votes; anonymous; managers} = + [consensus; votes; anonymous; managers] + +let ordered_of_list_list = function + | [consensus; votes; anonymous; managers] -> + Some {consensus; votes; anonymous; managers} + | _ -> None + +let payload_of_ordered_pool {votes; anonymous; managers; _} = + { + votes_payload = votes; + anonymous_payload = anonymous; + managers_payload = managers; + } + +let ordered_pool_of_payload ~consensus_operations + {votes_payload; anonymous_payload; managers_payload} = + { + consensus = consensus_operations; + votes = votes_payload; + anonymous = anonymous_payload; + managers = managers_payload; + } + +let extract_operations_of_list_list = function + | [consensus; votes_payload; anonymous_payload; managers_payload] -> + let preendorsements, endorsements = + List.fold_left + (fun ( (preendorsements : Kind.preendorsement Operation.t list), + (endorsements : Kind.endorsement Operation.t list) ) + packed_op -> + let {shell; protocol_data = Operation_data data} = packed_op in + match data with + | {contents = Single (Preendorsement _); _} -> + ({shell; protocol_data = data} :: preendorsements, endorsements) + | {contents = Single (Endorsement _); _} -> + (preendorsements, {shell; protocol_data = data} :: endorsements) + | _ -> + (* unreachable *) + (preendorsements, endorsements)) + ([], []) + consensus + (* N.b. the order doesn't matter *) + in + let preendorsements = + if preendorsements = [] then None else Some preendorsements + in + let payload = {votes_payload; anonymous_payload; managers_payload} in + Some (preendorsements, endorsements, payload) + | _ -> None + +let filter_pool p {consensus; votes; anonymous; managers} = + { + consensus = Operation_set.filter p consensus; + votes = Operation_set.filter p votes; + anonymous = Operation_set.filter p anonymous; + managers = Operation_set.filter p managers; + } + +module Prioritized = struct + type nonrec t = Prioritized_operation_set.t t + + let of_operation_set (operation_set : Operation_set.t) = + Operation_set.fold + (fun elt set -> + Prioritized_operation_set.add (Prioritized_operation.node elt) set) + operation_set + Prioritized_operation_set.empty + + let of_pool (pool : pool) : t = + { + consensus = of_operation_set pool.consensus; + votes = of_operation_set pool.votes; + anonymous = of_operation_set pool.anonymous; + managers = of_operation_set pool.managers; + } + + let add_operation = + add_operation_to_pool Prioritized_operation_set.add (fun op -> + classify (Prioritized_operation.packed op)) + + let add_external_operation pool priority operation = + add_operation pool (Prioritized_operation.extern ~priority operation) + + let add_operations prioritized_pool operations = + List.fold_left add_operation prioritized_pool operations + + (* [merge_external_operations] considers that the list of operation + represents an ordererd list of operation with the head having the highest + prioritiy. + *) + let merge_external_operations pool + (external_operations : packed_operation list) = + List.fold_left_i + (fun i pool op -> add_external_operation pool (-i) op) + pool + external_operations + + let filter p {consensus; votes; anonymous; managers} = + let filter = + Prioritized_operation_set.filter (fun pop -> + p (Prioritized_operation.packed pop)) + in + { + consensus = filter consensus; + votes = filter votes; + anonymous = filter anonymous; + managers = filter managers; + } +end diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_pool.mli b/src/proto_016_PtMumbai/lib_delegate/operation_pool.mli new file mode 100644 index 000000000000..4586eef4814c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_pool.mli @@ -0,0 +1,168 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Operation_set : Set.S with type elt = packed_operation + +(** Generic base type for pools *) +type 'collection t = { + consensus : 'collection; + votes : 'collection; + anonymous : 'collection; + managers : 'collection; +} + +(** A pool of operations for a single origin, or undifferenciated origin, + typically used for operations coming from the node *) +type pool = Operation_set.t t + +(** A pool of operations for a single origin, or undifferenciated origin, + typically used for operations coming from the node *) + +(** on pool *) +val empty : pool + +val pp_pool : Format.formatter -> pool -> unit + +val filter_pool : (packed_operation -> bool) -> pool -> pool + +val add_operation : pool -> packed_operation -> pool + +val add_operations : pool -> packed_operation list -> pool + +(** {2 Ordered pool of operations} *) +type ordered_pool = packed_operation list t + +val ordered_pool_encoding : ordered_pool Data_encoding.t + +val empty_ordered : ordered_pool + +val pp_ordered_pool : Format.formatter -> ordered_pool -> unit + +type payload = { + votes_payload : packed_operation list; + anonymous_payload : packed_operation list; + managers_payload : packed_operation list; +} + +val empty_payload : payload + +val payload_encoding : payload Data_encoding.t + +val pp_payload : Format.formatter -> payload -> unit + +val payload_of_ordered_pool : ordered_pool -> payload + +val ordered_pool_of_payload : + consensus_operations:packed_operation list -> payload -> ordered_pool + +type consensus_filter = { + level : int32; + round : Round.t; + payload_hash : Block_payload_hash.t; +} + +val filter_with_relevant_consensus_ops : + endorsement_filter:consensus_filter -> + preendorsement_filter:consensus_filter option -> + Operation_set.t -> + Operation_set.t + +val unpack_preendorsement : + packed_operation -> Kind.preendorsement operation option + +val unpack_endorsement : packed_operation -> Kind.endorsement operation option + +val filter_preendorsements : + packed_operation list -> Kind.preendorsement operation list + +val filter_endorsements : + packed_operation list -> Kind.endorsement operation list + +val ordered_to_list_list : ordered_pool -> packed_operation list list + +val ordered_of_list_list : packed_operation list list -> ordered_pool option + +(** [preendorsements] <> None => (List.length preendorsements > 0) *) +val extract_operations_of_list_list : + packed_operation list list -> + (Kind.preendorsement operation list option + * Kind.endorsement operation list + * payload) + option + +module Prioritized_operation : sig + type t + + (** prioritize operations coming from an external source (file, uri, ...). + An operation with higher [priority] (aka a bigger integer) will be + included before others with lower [priority]. *) + val extern : ?priority:int -> packed_operation -> t + + (** prioritize operations coming from a node *) + val node : packed_operation -> t + + (** [packed t] retrieves the [packed_operation] wrapped inside [t] *) + val packed : t -> packed_operation + + (** [compare_priority o1 o2] compares whether [o1] has higher priority than [o2] *) + val compare_priority : t -> t -> int + + (** [compare] is [compare_priority] when non-zero. This is suitable to + construct sets of prioritized operations **) + val compare : t -> t -> int +end + +module Prioritized_operation_set : sig + include Set.S with type elt = Prioritized_operation.t + + (** [operations set] is [elements set |> List.map Prioritized_operation.packed]*) + val operations : t -> packed_operation list +end + +(** Pool of prioritized operations *) +module Prioritized : sig + (** Same record fields as [type pool], but with a different set base *) + type nonrec t = Prioritized_operation_set.t t + + (** [of_pool pool] transforms [pool] into a prioritized pool of operations of + low priority. *) + val of_pool : pool -> t + + (** [merge_external_operations ?initial_priority pool extern_ops] creates a prioritized pool + from a [pool] and [extern_ops] coming from an external source, which we + prioritize. + + Priorities for these operations is given according to the order of the + list. The first element of the list has highest priority. + *) + val merge_external_operations : t -> packed_operation list -> t + + val filter : (packed_operation -> bool) -> t -> t + + val add_operations : t -> Prioritized_operation.t list -> t +end diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_selection.ml b/src/proto_016_PtMumbai/lib_delegate/operation_selection.ml new file mode 100644 index 000000000000..83543149b056 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_selection.ml @@ -0,0 +1,341 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Operation_pool +module Events = Baking_events.Selection + +let quota = Main.validation_passes + +let consensus_quota = Stdlib.List.nth quota Operation_repr.consensus_pass + +let votes_quota = Stdlib.List.nth quota Operation_repr.voting_pass + +let anonymous_quota = Stdlib.List.nth quota Operation_repr.anonymous_pass + +let managers_quota = Stdlib.List.nth quota Operation_repr.manager_pass + +type prioritized_manager = { + op : Prioritized_operation.t; + size : int; + fee : Tez.t; + gas : Fixed_point_repr.integral_tag Gas.Arith.t; + weight : Q.t; + source : public_key_hash; + counter : Manager_counter.t; +} + +module PrioritizedManagerSet = Set.Make (struct + type t = prioritized_manager + + (* We order the operations by their weights except if they belong + to the same manager, if they do, we order them by their + counter. *) + let compare {source; counter; weight; op; _} + {source = source'; counter = counter'; weight = weight'; op = op'; _} = + (* Be careful with the [compare] *) + let cmp_src = + Tezos_crypto.Signature.Public_key_hash.compare source source' + in + if cmp_src = 0 then + (* we want the smallest counter first *) + let c = Manager_counter.compare counter counter' in + if c <> 0 then c + else + let c = Prioritized_operation.compare_priority op' op in + if c <> 0 then c else Q.compare weight' weight + (* if same counter, biggest weight first *) + else + let c = Prioritized_operation.compare_priority op' op in + if c <> 0 then c + else + (* We want the biggest weight first *) + let c = Q.compare weight' weight in + if c <> 0 then c else cmp_src +end) + +(* Note: This weight is also used by the plugin and the prevalidator to sort + operations in the pending mempool. + See {!Tezos_protocol_plugin_alpha.Plugin.Mempool.weight_manager_operation}. *) +let prioritize_manager ~max_size ~hard_gas_limit_per_block ~minimal_fees + ~minimal_nanotez_per_gas_unit ~minimal_nanotez_per_byte operation = + let op = Operation_pool.Prioritized_operation.packed operation in + let {protocol_data = Operation_data {contents; _}; _} = op in + let open Operation in + let l = to_list (Contents_list contents) in + List.fold_left_e + (fun ((first_source, first_counter, total_fee, total_gas) as acc) -> + function + | Contents (Manager_operation {source; counter; fee; gas_limit; _}) -> + (Environment.wrap_tzresult @@ Tez.(total_fee +? fee)) + >>? fun total_fee -> + (* There is only one unique source per packed transaction *) + let first_source = Option.value ~default:source first_source in + (* We only care about the first counter *) + let first_counter = Option.value ~default:counter first_counter in + ok + ( Some first_source, + Some first_counter, + total_fee, + Gas.Arith.add total_gas gas_limit ) + | _ -> ok acc) + (None, None, Tez.zero, Gas.Arith.zero) + l + |> function + | Ok (Some source, Some counter, fee, gas) -> + if Tez.(fee < minimal_fees) then None + else + let size = Data_encoding.Binary.length Operation.encoding op in + let size_f = Q.of_int size in + let gas_f = Q.of_bigint (Gas.Arith.integral_to_z gas) in + let fee_f = Q.of_int64 (Tez.to_mutez fee) in + let size_ratio = Q.(size_f / Q.of_int max_size) in + let gas_ratio = + Q.( + gas_f + / Q.of_bigint (Gas.Arith.integral_to_z hard_gas_limit_per_block)) + in + let weight = Q.(fee_f / max size_ratio gas_ratio) in + let fees_in_nanotez = + Q.mul (Q.of_int64 (Tez.to_mutez fee)) (Q.of_int 1000) + in + let enough_fees_for_gas = + let minimal_fees_in_nanotez = + Q.mul + minimal_nanotez_per_gas_unit + (Q.of_bigint @@ Gas.Arith.integral_to_z gas) + in + Q.compare minimal_fees_in_nanotez fees_in_nanotez <= 0 + in + let enough_fees_for_size = + let minimal_fees_in_nanotez = + Q.mul minimal_nanotez_per_byte (Q.of_int size) + in + Q.compare minimal_fees_in_nanotez fees_in_nanotez <= 0 + in + if enough_fees_for_size && enough_fees_for_gas then + Some {op = operation; size; weight; fee; gas; source; counter} + else None + | _ -> None + +let prioritize_managers ~hard_gas_limit_per_block ~minimal_fees + ~minimal_nanotez_per_gas_unit ~minimal_nanotez_per_byte managers = + Prioritized_operation_set.fold + (fun op acc -> + match + prioritize_manager + ~max_size:managers_quota.max_size + ~hard_gas_limit_per_block + ~minimal_fees + ~minimal_nanotez_per_gas_unit + ~minimal_nanotez_per_byte + op + with + | None -> acc + | Some w_op -> PrioritizedManagerSet.add w_op acc) + managers + PrioritizedManagerSet.empty + +(** Simulation *) + +type simulation_result = { + validation_result : Tezos_protocol_environment.validation_result; + block_header_metadata : block_header_metadata; + operations : packed_operation list list; + operations_hash : Tezos_crypto.Operation_list_list_hash.t; +} + +let validate_operation inc op = + Baking_simulator.add_operation inc op >>= function + | Error errs -> + Events.(emit invalid_operation_filtered) (Operation.hash_packed op, errs) + >>= fun () -> Lwt.return_none + | Ok (resulting_state, receipt) -> ( + (* Check that the metadata are serializable/deserializable *) + let encoding_result = + let enc = Protocol.operation_receipt_encoding in + Option.bind + (Data_encoding.Binary.to_bytes_opt enc receipt) + (Data_encoding.Binary.of_bytes_opt enc) + in + match encoding_result with + | None -> + Events.(emit cannot_serialize_operation_metadata) + (Operation.hash_packed op) + >>= fun () -> Lwt.return_none + | Some _b -> Lwt.return_some resulting_state) + +let filter_valid_operations_up_to_quota inc (ops, quota) = + let {Tezos_protocol_environment.max_size; max_op} = quota in + let exception Full of (Baking_simulator.incremental * packed_operation list) + in + try + List.fold_left_s + (fun (inc, curr_size, nb_ops, acc) op -> + let op_size = + Data_encoding.Binary.length Alpha_context.Operation.encoding op + in + let new_size = curr_size + op_size in + if new_size > max_size then Lwt.return (inc, curr_size, nb_ops, acc) + else ( + Option.iter + (fun max_op -> if max_op = nb_ops + 1 then raise (Full (inc, acc))) + max_op ; + validate_operation inc op >>= function + | None -> Lwt.return (inc, curr_size, nb_ops, acc) + | Some inc' -> Lwt.return (inc', new_size, nb_ops + 1, op :: acc))) + (inc, 0, 0, []) + ops + >>= fun (inc, _, _, l) -> Lwt.return (inc, List.rev l) + with Full (inc, l) -> Lwt.return (inc, List.rev l) + +let filter_operations_with_simulation initial_inc fees_config + ~hard_gas_limit_per_block {consensus; votes; anonymous; managers} = + let { + Baking_configuration.minimal_fees; + minimal_nanotez_per_gas_unit; + minimal_nanotez_per_byte; + } = + fees_config + in + filter_valid_operations_up_to_quota + initial_inc + (Prioritized_operation_set.operations consensus, consensus_quota) + >>= fun (inc, consensus) -> + filter_valid_operations_up_to_quota + inc + (Prioritized_operation_set.operations votes, votes_quota) + >>= fun (inc, votes) -> + filter_valid_operations_up_to_quota + inc + (Prioritized_operation_set.operations anonymous, anonymous_quota) + >>= fun (inc, anonymous) -> + (* Sort the managers *) + let prioritized_managers = + prioritize_managers + ~hard_gas_limit_per_block + ~minimal_fees + ~minimal_nanotez_per_gas_unit + ~minimal_nanotez_per_byte + managers + in + filter_valid_operations_up_to_quota + inc + ( PrioritizedManagerSet.elements prioritized_managers + |> List.map (fun {op; _} -> Prioritized_operation.packed op), + managers_quota ) + >>= fun (inc, managers) -> + let operations = [consensus; votes; anonymous; managers] in + let operations_hash = + Tezos_crypto.Operation_list_list_hash.compute + (List.map + (fun sl -> + Tezos_crypto.Operation_list_hash.compute + (List.map Operation.hash_packed sl)) + operations) + in + let inc = {inc with header = {inc.header with operations_hash}} in + Baking_simulator.finalize_construction inc + >>=? fun (validation_result, block_header_metadata) -> + return {validation_result; block_header_metadata; operations; operations_hash} + +let filter_valid_operations_up_to_quota_without_simulation (ops, quota) = + let {Tezos_protocol_environment.max_size; max_op} = quota in + let exception Full of packed_operation list in + try + List.fold_left + (fun (curr_size, nb_ops, acc) op -> + let op_size = + Data_encoding.Binary.length Alpha_context.Operation.encoding op + in + let new_size = curr_size + op_size in + if new_size > max_size then (curr_size, nb_ops, acc) + else ( + Option.iter + (fun max_op -> if max_op = nb_ops + 1 then raise (Full acc)) + max_op ; + (new_size, nb_ops + 1, op :: acc))) + (0, 0, []) + ops + |> fun (_, _, l) -> List.rev l + with Full l -> List.rev l + +let filter_operations_without_simulation fees_config ~hard_gas_limit_per_block + {consensus; votes; anonymous; managers} = + let consensus = + filter_valid_operations_up_to_quota_without_simulation + (Prioritized_operation_set.operations consensus, consensus_quota) + in + let votes = + filter_valid_operations_up_to_quota_without_simulation + (Prioritized_operation_set.operations votes, votes_quota) + in + let anonymous = + filter_valid_operations_up_to_quota_without_simulation + (Prioritized_operation_set.operations anonymous, anonymous_quota) + in + let { + Baking_configuration.minimal_fees; + minimal_nanotez_per_gas_unit; + minimal_nanotez_per_byte; + } = + fees_config + in + (* Sort the managers *) + let prioritized_managers = + prioritize_managers + ~hard_gas_limit_per_block + ~minimal_fees + ~minimal_nanotez_per_gas_unit + ~minimal_nanotez_per_byte + managers + in + let managers = + filter_valid_operations_up_to_quota_without_simulation + ( PrioritizedManagerSet.elements prioritized_managers + |> List.map (fun {op; _} -> Prioritized_operation.packed op), + managers_quota ) + in + let operations = [consensus; votes; anonymous; managers] in + operations + +let filter_consensus_operations_only inc + ({consensus; votes; anonymous; managers} as ordered_pool) = + filter_valid_operations_up_to_quota inc (consensus, consensus_quota) + >>= fun (incremental, filtered_consensus) -> + let payload = Operation_pool.payload_of_ordered_pool ordered_pool in + List.fold_left_es + (fun inc op -> + Baking_simulator.add_operation inc op >>=? fun (inc, _) -> return inc) + incremental + (List.flatten [votes; anonymous; managers]) + >>=? fun incremental -> + let filtered_pool = + Operation_pool.ordered_pool_of_payload + ~consensus_operations:filtered_consensus + payload + in + return (incremental, filtered_pool) diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_selection.mli b/src/proto_016_PtMumbai/lib_delegate/operation_selection.mli new file mode 100644 index 000000000000..3ab72a91347c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_selection.mli @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_protocol_environment + +type simulation_result = { + validation_result : validation_result; + block_header_metadata : Apply_results.block_metadata; + operations : packed_operation list list; + operations_hash : Tezos_crypto.Operation_list_list_hash.t; +} + +val filter_operations_with_simulation : + Baking_simulator.incremental -> + Baking_configuration.fees_config -> + hard_gas_limit_per_block:Gas.Arith.integral -> + Operation_pool.Prioritized.t -> + simulation_result tzresult Lwt.t + +val filter_operations_without_simulation : + Baking_configuration.fees_config -> + hard_gas_limit_per_block:Gas.Arith.integral -> + Operation_pool.Prioritized.t -> + packed_operation list list + +val filter_consensus_operations_only : + Baking_simulator.incremental -> + Operation_pool.ordered_pool -> + (Baking_simulator.incremental * Operation_pool.ordered_pool) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_worker.ml b/src/proto_016_PtMumbai/lib_delegate/operation_worker.ml new file mode 100644 index 000000000000..5589f585649f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_worker.ml @@ -0,0 +1,548 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* TODO: + add events + + running state introspection to recover/restart on failure + + Do we need a mutex ? +*) + +open Protocol_client_context +open Protocol +open Alpha_context + +module Events = struct + include Internal_event.Simple + + let section = [Protocol.name; "baker"; "operation_worker"] + + let pp_int = Format.pp_print_int + + let loop_failed = + declare_1 + ~section + ~name:"loop_failed" + ~level:Error + ~msg:"loop failed with {trace}" + ~pp1:Error_monad.pp_print_trace + ("trace", Error_monad.trace_encoding) + + let ended = + declare_1 + ~section + ~name:"ended" + ~level:Error + ~msg:"ended with error {stacktrace}" + ("stacktrace", Data_encoding.string) + + let pqc_reached = + declare_2 + ~section + ~name:"pqc_reached" + ~level:Debug + ~msg: + "pre-quorum reached (voting power: {voting_power}, {preendorsements} \ + preendorsements)" + ~pp1:pp_int + ("voting_power", Data_encoding.int31) + ~pp2:pp_int + ("preendorsements", Data_encoding.int31) + + let preendorsements_received = + declare_4 + ~section + ~name:"preendorsements_received" + ~level:Debug + ~msg: + "received {count} preendorsements (power: {delta_power}) (total voting \ + power: {voting_power}, {preendorsements} preendorsements)" + ~pp1:pp_int + ("count", Data_encoding.int31) + ~pp2:pp_int + ("delta_power", Data_encoding.int31) + ~pp3:pp_int + ("voting_power", Data_encoding.int31) + ~pp4:pp_int + ("preendorsements", Data_encoding.int31) + + let qc_reached = + declare_2 + ~section + ~name:"qc_reached" + ~level:Debug + ~msg: + "quorum reached (voting power: {voting_power}, {endorsements} \ + endorsements)" + ~pp1:pp_int + ("voting_power", Data_encoding.int31) + ~pp2:pp_int + ("endorsements", Data_encoding.int31) + + let endorsements_received = + declare_4 + ~section + ~name:"endorsements_received" + ~level:Debug + ~msg: + "received {count} endorsements (power: {delta_power}) (total voting \ + power: {voting_power}, {endorsements} endorsements)" + ~pp1:pp_int + ("count", Data_encoding.int31) + ~pp2:pp_int + ("delta_power", Data_encoding.int31) + ~pp3:pp_int + ("voting_power", Data_encoding.int31) + ~pp4:pp_int + ("endorsements", Data_encoding.int31) + + let starting_new_monitoring = + declare_0 + ~section + ~name:"starting_new_monitoring" + ~level:Debug + ~msg:"starting new monitoring" + () + + let end_of_stream = + declare_0 + ~section + ~name:"end_of_stream" + ~level:Debug + ~msg:"end of stream" + () + + (* info messages *) + let shutting_down = + declare_0 + ~section + ~name:"shutting_down" + ~level:Info + ~msg:"shutting down operation worker" + () +end + +type candidate = { + hash : Tezos_crypto.Block_hash.t; + round_watched : Round.t; + payload_hash_watched : Block_payload_hash.t; +} + +let candidate_encoding = + let open Data_encoding in + conv + (fun {hash; round_watched; payload_hash_watched} -> + (hash, round_watched, payload_hash_watched)) + (fun (hash, round_watched, payload_hash_watched) -> + {hash; round_watched; payload_hash_watched}) + (obj3 + (req "hash" Tezos_crypto.Block_hash.encoding) + (req "round_watched" Round.encoding) + (req "payload_hash_watched" Block_payload_hash.encoding)) + +type voting_power = int + +type event = + | Prequorum_reached of + candidate * voting_power * Kind.preendorsement operation list + | Quorum_reached of candidate * voting_power * Kind.endorsement operation list + +type pqc_watched = { + candidate_watched : candidate; + get_preendorsement_voting_power : slot:Slot.t -> int; + consensus_threshold : int; + mutable current_voting_power : int; + mutable preendorsements_received : Kind.preendorsement operation list; + mutable preendorsements_count : int; +} + +type qc_watched = { + candidate_watched : candidate; + get_endorsement_voting_power : slot:Slot.t -> int; + consensus_threshold : int; + mutable current_voting_power : int; + mutable endorsements_received : Kind.endorsement operation list; + mutable endorsements_count : int; +} + +type watch_kind = Pqc_watch of pqc_watched | Qc_watch of qc_watched + +type quorum_event_stream = { + stream : event Lwt_stream.t; + push : event option -> unit; +} + +type t = { + mutable operation_pool : Operation_pool.pool; + mutable canceler : Lwt_canceler.t; + mutable proposal_watched : watch_kind option; + qc_event_stream : quorum_event_stream; + lock : Lwt_mutex.t; + monitor_node_operations : bool; (* Keep on monitoring node operations *) +} + +let monitor_operations (cctxt : #Protocol_client_context.full) = + Alpha_block_services.Mempool.monitor_operations + cctxt + ~chain:cctxt#chain + ~applied:true + ~branch_delayed:true + ~branch_refused:false + ~refused:false + () + >>=? fun (operation_stream, stream_stopper) -> + let operation_stream = + Lwt_stream.map + (fun ops -> List.map (fun ((_, op), _) -> op) ops) + operation_stream + in + Shell_services.Blocks.Header.shell_header + cctxt + ~chain:cctxt#chain + ~block:(`Head 0) + () + >>=? fun shell_header -> + let round = + match Fitness.(round_from_raw shell_header.fitness) with + | Ok r -> r + | Error _ -> Round.zero + in + return ((shell_header.level, round), operation_stream, stream_stopper) + +let make_initial_state ?(monitor_node_operations = true) () = + let qc_event_stream = + let stream, push = Lwt_stream.create () in + {stream; push} + in + let canceler = Lwt_canceler.create () in + let operation_pool = Operation_pool.empty in + let lock = Lwt_mutex.create () in + { + operation_pool; + canceler; + proposal_watched = None; + qc_event_stream; + lock; + monitor_node_operations; + } + +let is_valid_consensus_content (candidate : candidate) consensus_content = + let {hash = _; round_watched; payload_hash_watched} = candidate in + Round.equal consensus_content.round round_watched + && Block_payload_hash.equal + consensus_content.block_payload_hash + payload_hash_watched + +let cancel_monitoring state = state.proposal_watched <- None + +let update_monitoring ?(should_lock = true) state ops = + (if should_lock then Lwt_mutex.with_lock state.lock else fun f -> f ()) + @@ fun () -> + (* If no block is watched, don't do anything *) + match state.proposal_watched with + | None -> Lwt.return_unit + | Some + (Pqc_watch + ({ + candidate_watched; + get_preendorsement_voting_power; + consensus_threshold; + _; + } as proposal_watched)) -> + let preendorsements = Operation_pool.filter_preendorsements ops in + let preendorsements_count, voting_power = + List.fold_left + (fun (count, power) (op : Kind.preendorsement Operation.t) -> + let { + shell = _; + protocol_data = + {contents = Single (Preendorsement consensus_content); _}; + _; + } = + op + in + if is_valid_consensus_content candidate_watched consensus_content + then ( + let op_power = + get_preendorsement_voting_power ~slot:consensus_content.slot + in + proposal_watched.current_voting_power <- + proposal_watched.current_voting_power + op_power ; + proposal_watched.preendorsements_received <- + op :: proposal_watched.preendorsements_received ; + proposal_watched.preendorsements_count <- + proposal_watched.preendorsements_count + 1 ; + (count + 1, power + op_power)) + else (count, power)) + (0, 0) + preendorsements + in + if proposal_watched.current_voting_power >= consensus_threshold then ( + Events.( + emit + pqc_reached + ( proposal_watched.current_voting_power, + proposal_watched.preendorsements_count )) + >>= fun () -> + state.qc_event_stream.push + (Some + (Prequorum_reached + ( candidate_watched, + proposal_watched.current_voting_power, + List.rev proposal_watched.preendorsements_received ))) ; + (* Once the event has been emitted, we cancel the monitoring *) + cancel_monitoring state ; + Lwt.return_unit) + else + Events.( + emit + preendorsements_received + ( preendorsements_count, + voting_power, + proposal_watched.current_voting_power, + proposal_watched.preendorsements_count )) + | Some + (Qc_watch + ({ + candidate_watched; + get_endorsement_voting_power; + consensus_threshold; + _; + } as proposal_watched)) -> + let endorsements = Operation_pool.filter_endorsements ops in + let endorsements_count, voting_power = + List.fold_left + (fun (count, power) (op : Kind.endorsement Operation.t) -> + let { + shell = _; + protocol_data = + {contents = Single (Endorsement consensus_content); _}; + _; + } = + op + in + if is_valid_consensus_content candidate_watched consensus_content + then ( + let op_power = + get_endorsement_voting_power ~slot:consensus_content.slot + in + proposal_watched.current_voting_power <- + proposal_watched.current_voting_power + op_power ; + proposal_watched.endorsements_received <- + op :: proposal_watched.endorsements_received ; + proposal_watched.endorsements_count <- + proposal_watched.endorsements_count + 1 ; + (count + 1, power + op_power)) + else (count, power)) + (0, 0) + endorsements + in + if proposal_watched.current_voting_power >= consensus_threshold then ( + Events.( + emit + qc_reached + ( proposal_watched.current_voting_power, + proposal_watched.endorsements_count )) + >>= fun () -> + state.qc_event_stream.push + (Some + (Quorum_reached + ( candidate_watched, + proposal_watched.current_voting_power, + List.rev proposal_watched.endorsements_received ))) ; + (* Once the event has been emitted, we cancel the monitoring *) + cancel_monitoring state ; + Lwt.return_unit) + else + Events.( + emit + endorsements_received + ( endorsements_count, + voting_power, + proposal_watched.current_voting_power, + proposal_watched.endorsements_count )) + +let monitor_quorum state new_proposal_watched = + Lwt_mutex.with_lock state.lock @@ fun () -> + (* if a previous monitoring was registered, we cancel it *) + if state.proposal_watched <> None then cancel_monitoring state ; + state.proposal_watched <- new_proposal_watched ; + let current_consensus_operations = + Operation_pool.Operation_set.elements state.operation_pool.consensus + in + (* initialize with the currently present consensus operations *) + update_monitoring ~should_lock:false state current_consensus_operations + +let monitor_preendorsement_quorum state ~consensus_threshold + ~get_preendorsement_voting_power candidate_watched = + let new_proposal = + Some + (Pqc_watch + { + candidate_watched; + get_preendorsement_voting_power; + consensus_threshold; + current_voting_power = 0; + preendorsements_received = []; + preendorsements_count = 0; + }) + in + monitor_quorum state new_proposal + +let monitor_endorsement_quorum state ~consensus_threshold + ~get_endorsement_voting_power candidate_watched = + let new_proposal = + Some + (Qc_watch + { + candidate_watched; + get_endorsement_voting_power; + consensus_threshold; + current_voting_power = 0; + endorsements_received = []; + endorsements_count = 0; + }) + in + monitor_quorum state new_proposal + +let shutdown_worker state = + Events.(emit shutting_down ()) >>= fun () -> + Lwt_canceler.cancel state.canceler + +(* Each time a new head is received, the operation_pool field of the state is + cleaned/reset by this function. Instead of emptying it completely, we keep + the endorsements of at most 5 rounds and 1 level in the past, to be able to + include as much endorsements as possible in the next block if this baker is + the proposer. This allows to handle the following situations: + + - The baker observes an EQC for (L, R), but a proposal arrived for (L, R+1). + After the flush, extra endorsements on top of (L, R) are 'Branch_refused', + and are not re-sent by the node. If the baker proposes at (L+1, 1), he should + be able to include these extra endorsements. Hence the cache for old rounds. + + - The baker receives a head at (L+1, 0) on top of (L, 0), but this head + didn't reach consensus. If the baker who proposes at (L+1, 1) observed some + extra endorsements for (L, 0) that are not included in (L+1, 0), he may want + to add them. But these endorsements become 'Outdated' in the mempool once + (L+1, 0) is received. Hence the cache for previous level. +*) +let update_operations_pool state (head_level, head_round) = + let endorsements = + let head_round_i32 = Round.to_int32 head_round in + let head_level_i32 = head_level in + Operation_pool.Operation_set.filter + (function + | { + protocol_data = + Operation_data + {contents = Single (Endorsement {round; level; _}); _}; + _; + } -> + let round_i32 = Round.to_int32 round in + let level_i32 = Raw_level.to_int32 level in + let delta_round = Int32.sub head_round_i32 round_i32 in + let delta_level = Int32.sub head_level_i32 level_i32 in + (* Only retain endorsements that are maximum 5 rounds old and + 1 level in the last *) + Compare.Int32.(delta_round <= 5l && delta_level <= 1l) + | _ -> false) + state.operation_pool.consensus + in + let operation_pool = {Operation_pool.empty with consensus = endorsements} in + state.operation_pool <- operation_pool + +let create ?(monitor_node_operations = true) + (cctxt : #Protocol_client_context.full) = + let state = make_initial_state ~monitor_node_operations () in + (* TODO should we continue forever ? *) + let rec worker_loop () = + monitor_operations cctxt >>= function + | Error err -> Events.(emit loop_failed err) + | Ok (head, operation_stream, op_stream_stopper) -> + (* request distant mempools (note: the node might not have + received the full mempools, but just the deltas with respect + to the last time the mempools where sent) *) + Alpha_block_services.Mempool.request_operations cctxt () >>= fun _ -> + Events.(emit starting_new_monitoring ()) >>= fun () -> + state.canceler <- Lwt_canceler.create () ; + Lwt_canceler.on_cancel state.canceler (fun () -> + op_stream_stopper () ; + cancel_monitoring state ; + Lwt.return_unit) ; + update_operations_pool state head ; + let rec loop () = + Lwt_stream.get operation_stream >>= function + | None -> + (* When the stream closes, it means a new head has been set, + we cancel the monitoring and flush current operations *) + Events.(emit end_of_stream ()) >>= fun () -> + op_stream_stopper () ; + cancel_monitoring state ; + worker_loop () + | Some ops -> + state.operation_pool <- + Operation_pool.add_operations state.operation_pool ops ; + update_monitoring state ops >>= fun () -> loop () + in + loop () + in + Lwt.dont_wait + (fun () -> + Lwt.finalize + (fun () -> + if state.monitor_node_operations then worker_loop () + else Lwt.return_unit) + (fun () -> shutdown_worker state >>= fun _ -> Lwt.return_unit)) + (fun exn -> + Events.(emit__dont_wait__use_with_care ended (Printexc.to_string exn))) ; + Lwt.return state + +let retrieve_pending_operations cctxt state = + let open Protocol_client_context in + Alpha_block_services.Mempool.pending_operations + cctxt + ~chain:cctxt#chain + ~applied:true + ~branch_delayed:true + ~branch_refused:false + ~refused:false + ~outdated:false + () + >>=? fun pending_mempool -> + state.operation_pool <- + Operation_pool.add_operations state.operation_pool + @@ List.rev_map snd pending_mempool.applied ; + state.operation_pool <- + Operation_pool.add_operations + state.operation_pool + (List.rev_map + (fun (_, (op, _)) -> op) + (Tezos_crypto.Operation_hash.Map.bindings + pending_mempool.branch_delayed)) ; + return_unit + +let get_current_operations state = state.operation_pool + +let get_quorum_event_stream state = state.qc_event_stream.stream diff --git a/src/proto_016_PtMumbai/lib_delegate/operation_worker.mli b/src/proto_016_PtMumbai/lib_delegate/operation_worker.mli new file mode 100644 index 000000000000..ab66270bfd91 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/operation_worker.mli @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Launch processes to gather operations from the mempool and make them + available for the baker. *) + +open Protocol +open Alpha_context + +(** {1 Datatypes}*) + +type t + +type candidate = { + hash : Tezos_crypto.Block_hash.t; + round_watched : Round.t; + payload_hash_watched : Block_payload_hash.t; +} + +val candidate_encoding : candidate Data_encoding.t + +type voting_power = int + +type event = + | Prequorum_reached of + candidate * voting_power * Kind.preendorsement operation list + | Quorum_reached of candidate * voting_power * Kind.endorsement operation list + +(** {1 Constructors}*) + +(** [create ?monitor_node_operations cctxt] creates a monitoring process to + fetch operations for the baker to process. + + @param monitor_node_operations monitor operations on the node (defaults: + [true]). Set [monitor_node_operations] to [false] to only consider + externally provided (non-node) operations. *) +val create : + ?monitor_node_operations:bool -> #Protocol_client_context.full -> t Lwt.t + +(** {1 Utilities} *) + +val retrieve_pending_operations : + #Protocol_client_context.full -> t -> unit tzresult Lwt.t + +(** {1 Accessors}*) + +val get_current_operations : t -> Operation_pool.pool + +val get_quorum_event_stream : t -> event Lwt_stream.t + +(** {1 Observers} *) + +val monitor_preendorsement_quorum : + t -> + consensus_threshold:int -> + get_preendorsement_voting_power:(slot:Slot.t -> int) -> + candidate -> + unit Lwt.t + +val monitor_endorsement_quorum : + t -> + consensus_threshold:int -> + get_endorsement_voting_power:(slot:Slot.t -> int) -> + candidate -> + unit Lwt.t + +val cancel_monitoring : t -> unit + +val shutdown_worker : t -> (unit, exn list) result Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/state_transitions.ml b/src/proto_016_PtMumbai/lib_delegate/state_transitions.ml new file mode 100644 index 000000000000..71c79251fe67 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/state_transitions.ml @@ -0,0 +1,740 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Baking_state +open Baking_actions +module Events = Baking_events.State_transitions + +let do_nothing state = Lwt.return (state, Do_nothing) + +type proposal_acceptance = Invalid | Outdated_proposal | Valid_proposal + +let is_acceptable_proposal_for_current_level state + (proposal : Baking_state.proposal) = + let current_round = state.round_state.current_round in + if Round.(current_round < proposal.block.round) then + Events.( + emit unexpected_proposal_round (current_round, proposal.block.round)) + >>= fun () -> Lwt.return Invalid + else if Round.(current_round > proposal.block.round) then + Lwt.return Outdated_proposal + else + (* current_round = proposal.round *) + let previous_proposal = state.level_state.latest_proposal in + if + Round.(proposal.block.round = previous_proposal.block.round) + && Tezos_crypto.Block_hash.( + proposal.block.hash <> previous_proposal.block.hash) + && Tezos_crypto.Block_hash.( + proposal.predecessor.hash = previous_proposal.predecessor.hash) + then + (* An existing proposal was found at the same round: the + proposal is bad and should be punished by the accuser *) + Events.( + emit + proposal_for_round_already_seen + (proposal.block.hash, current_round, previous_proposal.block.hash)) + >>= fun () -> Lwt.return Invalid + else + (* current_round = proposal.block.round ∧ + proposal.block.round <> previous_proposal.block.round + => + proposal.block.round > previous_proposal.block.round + + The proposal has the expected round and the previous proposal + is a predecessor therefore the proposal is valid *) + Lwt.return Valid_proposal + +let make_consensus_list state proposal = + (* TODO efficiently iterate on the slot map instead of removing + duplicate endorsements *) + let level = + Raw_level.of_int32 state.level_state.current_level |> function + | Ok l -> l + | _ -> assert false + in + let round = proposal.block.round in + let block_payload_hash = proposal.block.payload_hash in + SlotMap.fold + (fun _slot (consensus_key_and_delegate, slots) acc -> + ( consensus_key_and_delegate, + {slot = Stdlib.List.hd slots.slots; level; round; block_payload_hash} ) + :: acc) + state.level_state.delegate_slots.own_delegate_slots + [] + |> List.sort_uniq compare + +(* If we do not have any slots, we won't inject any operation but we + will still participate to determine an elected block *) +let make_preendorse_action state proposal = + let updated_state = + let round_state = + {state.round_state with current_phase = Awaiting_preendorsements} + in + {state with round_state} + in + let preendorsements : (consensus_key_and_delegate * consensus_content) list = + make_consensus_list state proposal + in + Inject_preendorsements {preendorsements; updated_state} + +let update_proposal state proposal = + Events.(emit updating_latest_proposal proposal.block.hash) >>= fun () -> + let new_level_state = {state.level_state with latest_proposal = proposal} in + Lwt.return {state with level_state = new_level_state} + +let may_update_proposal state (proposal : proposal) = + assert ( + Compare.Int32.( + state.level_state.latest_proposal.block.shell.level + = proposal.block.shell.level)) ; + if + Round.(state.level_state.latest_proposal.block.round < proposal.block.round) + then update_proposal state proposal + else Lwt.return state + +let preendorse state proposal = + if + Tezos_crypto.Protocol_hash.( + proposal.block.protocol <> proposal.block.next_protocol) + then + (* We do not preendorse the first transition block *) + let new_round_state = {state.round_state with current_phase = Idle} in + let new_state = {state with round_state = new_round_state} in + Lwt.return (new_state, Do_nothing) + else + Events.(emit attempting_preendorse_proposal proposal.block.hash) + >>= fun () -> Lwt.return (state, make_preendorse_action state proposal) + +let extract_pqc state (new_proposal : proposal) = + match new_proposal.block.prequorum with + | None -> None + | Some pqc -> + let add_voting_power acc (op : Kind.preendorsement Operation.t) = + let open Protocol.Alpha_context.Operation in + let { + shell = _; + protocol_data = {contents = Single (Preendorsement {slot; _}); _}; + _; + } = + op + in + match + SlotMap.find slot state.level_state.delegate_slots.all_delegate_slots + with + | None -> + (* cannot happen if the map is correctly populated *) + acc + | Some {endorsing_power; _} -> acc + endorsing_power + in + let voting_power = + List.fold_left add_voting_power 0 pqc.preendorsements + in + let consensus_threshold = + state.global_state.constants.parametric.consensus_threshold + in + if Compare.Int.(voting_power >= consensus_threshold) then + Some (pqc.preendorsements, pqc.round) + else None + +let may_update_endorsable_payload_with_internal_pqc state + (new_proposal : proposal) = + match + (new_proposal.block.prequorum, state.level_state.endorsable_payload) + with + | None, _ -> + (* The proposal does not contain a PQC: no need to update *) + state + | Some {round = new_round; _}, Some {prequorum = {round = old_round; _}; _} + when Round.(new_round < old_round) -> + (* The proposal pqc is outdated, do not update *) + state + | Some better_prequorum, _ -> + assert ( + Block_payload_hash.( + better_prequorum.block_payload_hash = new_proposal.block.payload_hash)) ; + assert ( + Compare.Int32.(better_prequorum.level = new_proposal.block.shell.level)) ; + let new_endorsable_payload = + Some {proposal = new_proposal; prequorum = better_prequorum} + in + let new_level_state = + {state.level_state with endorsable_payload = new_endorsable_payload} + in + {state with level_state = new_level_state} + +let rec handle_new_proposal state (new_proposal : proposal) = + let current_level = state.level_state.current_level in + let new_proposal_level = new_proposal.block.shell.level in + if Compare.Int32.(current_level > new_proposal_level) then + (* The baker is ahead, a reorg may have happened. Do nothing: + wait for the node to send us the branch's head. This new head + should have a fitness that is greater than our current + proposal and thus, its level should be at least the same as + our current proposal's level. *) + Events.(emit baker_is_ahead_of_node (current_level, new_proposal_level)) + >>= fun () -> Lwt.return (state, Do_nothing) + else if Compare.Int32.(current_level = new_proposal_level) then + (* The received head is a new proposal for the current level: + let's check if it's a valid one for us. *) + let current_proposal = state.level_state.latest_proposal in + if + Tezos_crypto.Block_hash.( + current_proposal.predecessor.hash <> new_proposal.predecessor.hash) + then + Events.( + emit + new_proposal_is_on_another_branch + (current_proposal.predecessor.hash, new_proposal.predecessor.hash)) + >>= fun () -> may_switch_branch state new_proposal + else + is_acceptable_proposal_for_current_level state new_proposal >>= function + | Invalid -> + (* The proposal is invalid: we ignore it *) + Events.(emit skipping_invalid_proposal ()) >>= fun () -> + do_nothing state + | Outdated_proposal -> + (* Check whether we need to update our endorsable payload *) + let state = + may_update_endorsable_payload_with_internal_pqc state new_proposal + in + (* The proposal is outdated: we update to be able to extract + its included endorsements but we do not endorse it *) + Events.(emit outdated_proposal new_proposal.block.hash) >>= fun () -> + may_update_proposal state new_proposal >>= fun state -> + do_nothing state + | Valid_proposal -> ( + (* Valid_proposal => proposal.round = current_round *) + (* Check whether we need to update our endorsable payload *) + let new_state = + may_update_endorsable_payload_with_internal_pqc state new_proposal + in + may_update_proposal new_state new_proposal >>= fun new_state -> + (* The proposal is valid but maybe we already locked on a payload *) + match new_state.level_state.locked_round with + | Some locked_round -> ( + if + Block_payload_hash.( + locked_round.payload_hash = new_proposal.block.payload_hash) + then + (* when the new head has the same payload as our + [locked_round], we accept it and preendorse *) + preendorse new_state new_proposal + else + (* The payload is different *) + match new_proposal.block.prequorum with + | Some {round; _} when Round.(locked_round.round < round) -> + (* This PQC is above our locked_round, we can preendorse it *) + preendorse new_state new_proposal + | _ -> Lwt.return (new_state, Do_nothing)) + | None -> + (* Otherwise, we did not lock on any payload, thus we can + preendorse it *) + preendorse new_state new_proposal) + else + (* new_proposal.level > current_level *) + (* Possible scenarios: + - we received a block for a next level + - we received our own block + This is where we update our [level_state] (and our [round_state]) *) + Events.(emit new_head_with_increasing_level ()) >>= fun () -> + let new_level = new_proposal.block.shell.level in + let compute_new_state ~current_round ~delegate_slots + ~next_level_delegate_slots = + let round_state = {current_round; current_phase = Idle} in + let level_state = + { + current_level = new_level; + latest_proposal = new_proposal; + (* Unlock values *) + locked_round = None; + endorsable_payload = None; + elected_block = None; + delegate_slots; + next_level_delegate_slots; + next_level_proposed_round = None; + } + in + (* recursive call with the up-to-date state to handle the new + level proposals *) + handle_new_proposal {state with level_state; round_state} new_proposal + in + let action = + Update_to_level {new_level_proposal = new_proposal; compute_new_state} + in + Lwt.return (state, action) + +and may_switch_branch state new_proposal = + let switch_branch state = + Events.(emit switching_branch ()) >>= fun () -> + (* If we are on a different branch, we also need to update our + [round_state] accordingly. + The recursive call to [handle_new_proposal] cannot end up + with an invalid proposal as it's on a different branch, thus + there is no need to backtrack to the former state as the new + proposal must end up being the new [latest_proposal]. That's + why we update it here. *) + let round_update = + { + Baking_actions.new_round_proposal = new_proposal; + handle_proposal = (fun state -> handle_new_proposal state new_proposal); + } + in + update_proposal state new_proposal >>= fun new_state -> + (* TODO if the branch proposal is outdated, we should + trigger an [End_of_round] to participate *) + Lwt.return (new_state, Synchronize_round round_update) + in + let current_endorsable_payload = state.level_state.endorsable_payload in + match (current_endorsable_payload, new_proposal.block.prequorum) with + | None, Some _ | None, None -> + Events.(emit branch_proposal_has_better_fitness ()) >>= fun () -> + (* The new branch contains a PQC (and we do not) or a better + fitness, we switch. *) + switch_branch state + | Some _, None -> + (* We have a better PQC, we don't switch as we are able to + propose a better chain if we stay on our current one. *) + Events.(emit branch_proposal_has_no_prequorum ()) >>= fun () -> + do_nothing state + | Some {prequorum = current_pqc; _}, Some new_pqc -> + if Round.(current_pqc.round > new_pqc.round) then + Events.(emit branch_proposal_has_lower_prequorum ()) >>= fun () -> + (* The other's branch PQC is lower than ours, do not + switch *) + do_nothing state + else if Round.(current_pqc.round < new_pqc.round) then + Events.(emit branch_proposal_has_better_prequorum ()) >>= fun () -> + (* Their PQC is better than ours: we switch *) + switch_branch state + else + (* current_pqc.round = new_pqc *) + (* There is a PQC on two branches with the same round and + the same level but not the same predecessor : it's + impossible unless if there was some double-baking. This + shouldn't happen but do nothing anyway. *) + Events.(emit branch_proposal_has_same_prequorum ()) >>= fun () -> + do_nothing state + +(** In the association map [delegate_slots], the function returns an + optional pair ([delegate], [endorsing_slot]) if for the current + [round], the validator [delegate] has a endorsing slot. *) +let round_proposer state delegate_slots round = + (* TODO: make sure that for each slots all rounds in the map are filled *) + (* !FIXME! Endorsers and proposer are differents sets *) + (* !FIXME! the slotmap may be inconsistent & may sure to document + the invariants *) + let round_mod = + Int32.to_int (Round.to_int32 round) + mod state.global_state.constants.parametric.consensus_committee_size + in + SlotMap.find + state.level_state.delegate_slots.all_slots_by_round.(round_mod) + delegate_slots + +(** Inject a fresh block proposal containing the current operations of + the mempool in [state] and the additional [endorsements] for + [delegate] at round [round]. *) +let propose_fresh_block_action ~endorsements ?last_proposal + ~(predecessor : block_info) state delegate round = + (* TODO check if there is a trace where we could not have updated the level *) + (* The block to bake embeds the operations gathered by the + worker. However, consensus operations that are not relevant for + this block are filtered out. In the case of proposing a new fresh + block, the block is supposed to carry only endorsements for the + previous level. *) + let operation_pool = + (* 1. Fetch operations from the mempool. *) + let current_mempool = + let pool = + Operation_worker.get_current_operations + state.global_state.operation_worker + in + (* Considered the operations in the previous proposal as well *) + match last_proposal with + | Some proposal -> + let { + Operation_pool.votes_payload; + anonymous_payload; + managers_payload; + } = + proposal.payload + in + List.fold_left + Operation_pool.add_operations + pool + [votes_payload; anonymous_payload; managers_payload] + | None -> pool + in + (* 2. Filter and only retain relevant endorsements. *) + let relevant_consensus_operations = + let endorsement_filter = + { + Operation_pool.level = predecessor.shell.level; + round = predecessor.round; + payload_hash = predecessor.payload_hash; + } + in + Operation_pool.filter_with_relevant_consensus_ops + ~endorsement_filter + ~preendorsement_filter:None + current_mempool.consensus + in + let filtered_mempool = + {current_mempool with consensus = relevant_consensus_operations} + in + (* 3. Add the additional given [endorsements]. + N.b. this is a set: there won't be duplicates *) + Operation_pool.add_operations + filtered_mempool + (List.map Operation.pack endorsements) + in + let kind = Fresh operation_pool in + Events.(emit proposing_fresh_block (delegate, round)) >>= fun () -> + let block_to_bake = {predecessor; round; delegate; kind} in + let updated_state = + let new_round_state = {state.round_state with current_phase = Idle} in + {state with round_state = new_round_state} + in + Lwt.return @@ Inject_block {block_to_bake; updated_state} + +let propose_block_action state delegate round (proposal : proposal) = + (* Possible cases: + 1. There was a proposal but the PQC was not reached. + 2. There was a proposal and the PQC was reached. We repropose the + [endorsable_payload] if it exists, not the [locked_round] as it + may be older. *) + match state.level_state.endorsable_payload with + | None -> + Events.(emit no_endorsable_payload_fresh_block ()) >>= fun () -> + (* For case 1, we may re-inject with the same payload or a fresh + one. We make the choice of baking a fresh one: the previous + proposal may have been rejected because the block may have been + valid but may be considered "bad" (censored operations, empty + block, etc.) by the other validators. *) + (* Invariant: there is no locked round if there is no endorsable + payload *) + assert (state.level_state.locked_round = None) ; + let last_proposal_consensus_ops = proposal.block.quorum in + propose_fresh_block_action + ~endorsements:last_proposal_consensus_ops + state + ~last_proposal:proposal.block + ~predecessor:proposal.predecessor + delegate + round + | Some {proposal; prequorum} -> + Events.(emit repropose_block proposal.block.payload_hash) >>= fun () -> + (* For case 2, we re-inject the same block as [endorsable_round] + but we may add some left-overs endorsements. Therefore, the + operations we need to include are: + - the proposal's included endorsements + - the potential missing new endorsements for the + previous block + - the PQC of the endorsable payload *) + let consensus_operations = + (* Fetch preendorsements and endorsements from the mempool + (that could be missing from the proposal), filter, then add + consensus operations of the proposal itself, and convert + into [packed_operation trace]. *) + let mempool_consensus_operations = + (Operation_worker.get_current_operations + state.global_state.operation_worker) + .consensus + in + let all_consensus_operations = + (* Add the proposal and pqc consensus operations to the + mempool *) + List.fold_left + (fun set op -> Operation_pool.Operation_set.add op set) + mempool_consensus_operations + (List.map Operation.pack proposal.block.quorum + @ List.map Operation.pack prequorum.preendorsements) + in + let endorsement_filter = + { + Operation_pool.level = proposal.predecessor.shell.level; + round = proposal.predecessor.round; + payload_hash = proposal.predecessor.payload_hash; + } + in + let preendorsement_filter = + Some + { + Operation_pool.level = prequorum.level; + round = prequorum.round; + payload_hash = prequorum.block_payload_hash; + } + in + Operation_pool.( + filter_with_relevant_consensus_ops + ~endorsement_filter + ~preendorsement_filter + all_consensus_operations + |> Operation_set.elements) + in + let payload_hash = proposal.block.payload_hash in + let payload_round = proposal.block.payload_round in + let payload = proposal.block.payload in + let kind = + Reproposal {consensus_operations; payload_hash; payload_round; payload} + in + let block_to_bake = + {predecessor = proposal.predecessor; round; delegate; kind} + in + let updated_state = + let new_round_state = {state.round_state with current_phase = Idle} in + {state with round_state = new_round_state} + in + Lwt.return @@ Inject_block {block_to_bake; updated_state} + +let end_of_round state current_round = + let new_round = Round.succ current_round in + let new_round_state = {state.round_state with current_round = new_round} in + let new_state = {state with round_state = new_round_state} in + (* we need to check if we need to bake for this round or not *) + match + round_proposer + new_state + new_state.level_state.delegate_slots.own_delegate_slots + new_state.round_state.current_round + with + | None -> + Events.( + emit + no_proposal_slot + (current_round, state.level_state.current_level, new_round)) + >>= fun () -> + (* We don't have any delegate that may propose a new block for + this round -- We will wait for preendorsements when the next + level block arrive. Meanwhile, we are idle *) + let new_round_state = {new_state.round_state with current_phase = Idle} in + let new_state = {state with round_state = new_round_state} in + do_nothing new_state + | Some (delegate, _) -> + let last_proposal = state.level_state.latest_proposal.block in + if Tezos_crypto.Protocol_hash.(last_proposal.protocol <> Protocol.hash) + then + (* Do not inject a block for the previous protocol! (Let the + baker of the previous protocol do it.) *) + do_nothing new_state + else + Events.( + emit + proposal_slot + (current_round, state.level_state.current_level, new_round, delegate)) + >>= fun () -> + (* We have a delegate, we need to determine what to inject *) + propose_block_action + new_state + delegate + new_round + state.level_state.latest_proposal + >>= fun action -> Lwt.return (new_state, action) + +let time_to_bake state at_round = + (* It is now time to update the state level *) + (* We need to keep track for which block we have 2f+1 *endorsements*, that is, + which will become the new predecessor_block *) + (* Invariant: endorsable_round >= round(elected block) >= locked_round *) + let round_proposer_opt = + round_proposer + state + state.level_state.next_level_delegate_slots.own_delegate_slots + at_round + in + match (state.level_state.elected_block, round_proposer_opt) with + | None, _ | _, None -> + (* Unreachable: the [Time_to_bake_next_level] event can only be + triggered when we have a slot and an elected block *) + assert false + | Some elected_block, Some (delegate, _) -> + let endorsements = elected_block.endorsement_qc in + let new_level_state = + {state.level_state with next_level_proposed_round = Some at_round} + in + let new_state = {state with level_state = new_level_state} in + propose_fresh_block_action + ~endorsements + ~predecessor:elected_block.proposal.block + new_state + delegate + at_round + >>= fun action -> Lwt.return (new_state, action) + +let update_locked_round state round payload_hash = + let locked_round = Some {payload_hash; round} in + let new_level_state = {state.level_state with locked_round} in + {state with level_state = new_level_state} + +let make_endorse_action state proposal = + let updated_state = + let new_round_state = + {state.round_state with current_phase = Awaiting_endorsements} + in + let new_state = {state with round_state = new_round_state} in + update_locked_round + new_state + proposal.block.round + proposal.block.payload_hash + in + let endorsements : (consensus_key_and_delegate * consensus_content) list = + make_consensus_list state proposal + in + Inject_endorsements {endorsements; updated_state} + +let prequorum_reached_when_awaiting_preendorsements state candidate + preendorsements = + let latest_proposal = state.level_state.latest_proposal in + if + Tezos_crypto.Block_hash.( + candidate.Operation_worker.hash <> latest_proposal.block.hash) + then + Events.( + emit + unexpected_prequorum_received + (candidate.hash, latest_proposal.block.hash)) + >>= fun () -> do_nothing state + else + let prequorum = + { + level = latest_proposal.block.shell.level; + round = latest_proposal.block.round; + block_payload_hash = latest_proposal.block.payload_hash; + preendorsements + (* preendorsements may be nil when [consensus_threshold] is 0 *); + } + in + let new_endorsable_payload = {proposal = latest_proposal; prequorum} in + let new_level_state = + let level_state_with_new_payload = + { + state.level_state with + endorsable_payload = Some new_endorsable_payload; + } + in + match state.level_state.endorsable_payload with + | None -> level_state_with_new_payload + | Some endorsable_payload -> + if + Round.( + endorsable_payload.prequorum.round + < new_endorsable_payload.prequorum.round) + then level_state_with_new_payload + else state.level_state + in + let new_state = {state with level_state = new_level_state} in + Lwt.return (new_state, make_endorse_action new_state latest_proposal) + +let quorum_reached_when_waiting_endorsements state candidate endorsement_qc = + let latest_proposal = state.level_state.latest_proposal in + if + Tezos_crypto.Block_hash.( + candidate.Operation_worker.hash <> latest_proposal.block.hash) + then + Events.( + emit + unexpected_quorum_received + (candidate.hash, latest_proposal.block.hash)) + >>= fun () -> do_nothing state + else + let new_level_state = + match state.level_state.elected_block with + | None -> + let elected_block = + Some {proposal = latest_proposal; endorsement_qc} + in + {state.level_state with elected_block} + | Some _ -> + (* If we already have an elected block, do not update it: the + earliest, the better. *) + state.level_state + in + let new_round_state = {state.round_state with current_phase = Idle} in + let new_state = + {state with round_state = new_round_state; level_state = new_level_state} + in + do_nothing new_state + +(* Hypothesis: + - The state is not to be modified outside this module + + - new_proposal's received blocks are expected to belong to our current + round + + - [Prequorum_reached] can only be received when we've seen a new head + + - [Quorum_reached] can only be received when we've seen a + [Prequorum_reached] *) +let step (state : Baking_state.t) (event : Baking_state.event) : + (Baking_state.t * Baking_actions.t) Lwt.t = + let phase = state.round_state.current_phase in + Events.(emit step_current_phase (phase, event)) >>= fun () -> + match (phase, event) with + (* Handle timeouts *) + | _, Timeout (End_of_round {ending_round}) -> + (* If the round is ending, stop everything currently going on and + increment the round. *) + end_of_round state ending_round + | _, Timeout (Time_to_bake_next_level {at_round}) -> + (* If it is time to bake the next level, stop everything currently + going on and propose the next level block *) + time_to_bake state at_round + | Idle, New_proposal block_info -> + Events.( + emit + new_head + ( block_info.block.hash, + block_info.block.shell.level, + block_info.block.round )) + >>= fun () -> handle_new_proposal state block_info + | Awaiting_endorsements, New_proposal block_info + | Awaiting_preendorsements, New_proposal block_info -> + Events.( + emit + new_head + ( block_info.block.hash, + block_info.block.shell.level, + block_info.block.round )) + >>= fun () -> + Events.(emit new_head_while_waiting_for_qc ()) >>= fun () -> + handle_new_proposal state block_info + | ( Awaiting_preendorsements, + Prequorum_reached (candidate, _voting_power, preendorsement_qc) ) -> + prequorum_reached_when_awaiting_preendorsements + state + candidate + preendorsement_qc + | ( Awaiting_endorsements, + Quorum_reached (candidate, _voting_power, endorsement_qc) ) -> + quorum_reached_when_waiting_endorsements state candidate endorsement_qc + (* Unreachable cases *) + | Idle, (Prequorum_reached _ | Quorum_reached _) + | Awaiting_preendorsements, Quorum_reached _ + | Awaiting_endorsements, Prequorum_reached _ -> + (* This cannot/should not happen *) + do_nothing state diff --git a/src/proto_016_PtMumbai/lib_delegate/state_transitions.mli b/src/proto_016_PtMumbai/lib_delegate/state_transitions.mli new file mode 100644 index 000000000000..9dde0efaf02b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/state_transitions.mli @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Baking_state +open Baking_actions + +val do_nothing : state -> (state * action) Lwt.t + +type proposal_acceptance = Invalid | Outdated_proposal | Valid_proposal + +val is_acceptable_proposal_for_current_level : + state -> proposal -> proposal_acceptance Lwt.t + +val make_consensus_list : + state -> proposal -> (consensus_key_and_delegate * consensus_content) list + +val make_preendorse_action : state -> proposal -> action + +val may_update_proposal : state -> proposal -> state Lwt.t + +val preendorse : state -> proposal -> (state * action) Lwt.t + +val extract_pqc : + state -> proposal -> (Kind.preendorsement operation list * Round.t) option + +val handle_new_proposal : state -> proposal -> (state * action) Lwt.t + +val round_proposer : + state -> + (consensus_key_and_delegate * endorsing_slot) SlotMap.t -> + Round.t -> + (consensus_key_and_delegate * endorsing_slot) option + +val propose_fresh_block_action : + endorsements:Kind.endorsement Operation.t list -> + ?last_proposal:block_info -> + predecessor:block_info -> + state -> + consensus_key_and_delegate -> + Round.t -> + action Lwt.t + +val propose_block_action : + state -> consensus_key_and_delegate -> Round.t -> proposal -> action Lwt.t + +(** Increase the current round and propose at the new round (same + level), if the baker has a proposer slot. *) +val end_of_round : state -> Round.t -> (state * action) Lwt.t + +(** Propose (if possible) for the first time at a new level. *) +val time_to_bake : state -> Round.t -> (state * action) Lwt.t + +val update_locked_round : state -> Round.t -> Block_payload_hash.t -> state + +val make_endorse_action : state -> proposal -> action + +val prequorum_reached_when_awaiting_preendorsements : + state -> + Operation_worker.candidate -> + Kind.preendorsement operation list -> + (state * action) Lwt.t + +val quorum_reached_when_waiting_endorsements : + state -> + Operation_worker.candidate -> + Kind.endorsement operation list -> + (state * action) Lwt.t + +val step : state -> event -> (state * action) Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/test/README.md b/src/proto_016_PtMumbai/lib_delegate/test/README.md new file mode 100644 index 000000000000..6b745df188f9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/README.md @@ -0,0 +1,127 @@ +# Testing Tenderbake via mockup-based simulations + +This test suite contains tests that check the baker. A notable feature that +distinguishes these tests from simple unit tests is that the baker is +examined as a whole with all its components working together. We do not run +a node, instead, we run a mockup node that allows us to create an illusion +for the baker that it talks to a real node. Thus, we have full control of +how the mockup node behaves, how the proposals and operations propagate, and +what the baker sees when it calls RPCs. + +Pros: + +* Integrates naturally with the existing testing setup and CI. No external + binaries or setup needed. +* Fast. The round time is currently constant and equal to 3 seconds. 2 + second was also tried, but that resulted in deviations from expected + behavior in about 10% of cases. Upon closer inspection it was found out + that round timeouts happen before a key event in the scenario. Supposedly, + this depends on the time the test is started as all other parameters are + set and deterministic. Switching 3 seconds solved the issue. +* Uses the same code as the baker, so people who are familiar with the + existing Tezos will benefit from their knowledge. +* Various assertions and checks can be expressed to ensure that the scenario + in question progresses exactly as it supposed to. +* Many details of how the baker sees the world can be tightly controlled. + +Cons: + +* Hard to see the logic of the scenario because it has to be written as a + collection of hooks. + +## Running the tests + +The tests can be run like this from the `src/proto_alpha/lib_delegate/test`: + +``` +$ dune exec ./main.exe -- -v +``` + +## Writing a test + +See the examples in `test_scenario.ml` for inspiration. Start writing a +scenario by deciding how many bakers you need and how many delegates each of +them will have (see the docs for `Mockup_simulator.run`): + +```ocaml + let open Mockup_simulator in + run [(3, (module Default_hooks)); (2, (module Default_hooks))] +``` + +* Set `debug` to `true` in `Mockup_simulator.default_config` and pass it to + `Mockup_simulator.run`. When `debug` is enabled baker logs will be printed. + This is the main instrument for observing what happens in the scenario. +* Consider setting `timeout` to an appropriate value. By default it is 10 + seconds, which should be fine for short scenarios, but may be insufficient + for longer ones. Timeout is a safety mechanism that prevents scenarios + from hanging and non-termination. +* It is also possible to control round durations, but it recommended to + use at least 3 seconds (the default). +* Finally, proposal slots can be controlled with the `delegate_selection` + field. The nested lists specify slot owners per level and + round. Note that if not provided, a seed nonce will be bruteforced + to obtain the desired delegate selection. + + +```ocaml + let open Mockup_simulator in + let config = + { + default_config with + debug = true; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap3); + (1l, bootstrap4); + (2l, bootstrap2); + (3l, bootstrap1); + ] ); + ( 2l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + timeout = 15; + } + in + run ~config [(3, (module Default_hooks)); (2, (module Default_hooks))] +``` + +Note that delegate selection affects both (pre-)endorsing and voting power. +Delegates that do not have proposer slots will not be able to (pre-)endorse. +Voting power of delegates who have proposer slots will be proportional to +the number of slots they have. + +Next step is writing hook modules per baker that control its mockup mode and +execute assertions. In most cases there is no need to implement all hooks, +so the `Default_hooks` module can be reused, e.g.: + +```ocaml + let module Hooks : Mockup_simulator.Hooks = struct + include Mockup_simulator.Default_hooks + + let stop_on_event = function + | Baking_state.New_proposal {block; _} -> + (* Stop the node as soon as we receive a proposal with a level + higher than 5. *) + block.shell.level > 5l + | _ -> false + end in +``` + +Other hooks can be used to implement assertions using `failwith` and to set +mutable variable to track progress of a scenario. + +### Termination + +A scenario runs till all bakers terminate or till the scenario times out. A +baker can terminate successfully or unsuccessfully. Successful termination +happens when `stop_on_event` returns `true`. Unsuccessful termination occurs +when any of the hooks executes `failwith`. If at least one baker fails its +error message propagates and is displayed by the testing framework +(Alcotest). diff --git a/src/proto_016_PtMumbai/lib_delegate/test/dune b/src/proto_016_PtMumbai/lib_delegate/test/dune new file mode 100644 index 000000000000..e2d734e974fb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/dune @@ -0,0 +1,32 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + tezos-base + tezos-micheline + tezos-client-alpha + tezos-protocol-alpha + tezos-base-test-helpers + tezos-baking-alpha.mockup-simulator + tezos-baking-alpha + tezos-protocol-alpha.parameters + tezos-crypto + alcotest-lwt + uri) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_micheline + -open Tezos_client_alpha + -open Tezos_protocol_alpha + -open Tezos_base_test_helpers + -open Tezos_alpha_mockup_simulator + -open Tezos_baking_alpha)) + +(rule + (alias runtest) + (package tezos-baking-alpha) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/main.ml b/src/proto_016_PtMumbai/lib_delegate/test/main.ml new file mode 100644 index 000000000000..f05f721ebebb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/main.ml @@ -0,0 +1,10 @@ +(** Testing + ------- + Component: Baking + Invocation: dune build @src/proto_alpha/lib_delegate/runtest + Subject: Entrypoint + *) + +let () = + Lwt_main.run + (Alcotest_lwt.run "protocol_alpha" [("scenario", Test_scenario.tests)]) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/broadcast_services.ml b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/broadcast_services.ml new file mode 100644 index 000000000000..1a8c0a3ad8f3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/broadcast_services.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = struct + open Data_encoding + + let path = Tezos_rpc.Path.(root / "broadcast") + + let dests_query = + let open Tezos_rpc.Query in + query (fun dests -> + object + method dests = dests + end) + |+ multi_field "dests" Tezos_rpc.Arg.int (fun t -> t#dests) + |> seal + + (* copied from lib_shell_services/injection_services.ml *) + let block_param = + obj2 + (req "block" (dynamic_size Block_header.encoding)) + (req + "operations" + (list (dynamic_size (list (dynamic_size Operation.encoding))))) + + let block = + Tezos_rpc.Service.post_service + ~description:"Broadcast a block." + ~query:dests_query + ~input:block_param + ~output:unit + Tezos_rpc.Path.(path / "block") + + let operation = + Tezos_rpc.Service.post_service + ~description:"Broadcast an operation." + ~query:dests_query + ~input:Alpha_context.Operation.encoding + ~output:unit + Tezos_rpc.Path.(path / "operation") +end + +open Tezos_rpc.Context + +let block ctxt ?(dests = []) raw operations = + make_call + S.block + ctxt + () + (object + method dests = dests + end) + (raw, operations) + +let operation ctxt ?(dests = []) operation = + make_call + S.operation + ctxt + () + (object + method dests = dests + end) + operation diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune new file mode 100644 index 000000000000..c459c163af1f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune @@ -0,0 +1,32 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_alpha_mockup_simulator) + (public_name tezos-baking-alpha.mockup-simulator) + (libraries + tezos-base + tezos-protocol-alpha + tezos-client-alpha + tezos-client-commands + tezos-baking-alpha + tezos-stdlib-unix + tezos-client-base-unix + tezos-protocol-alpha.parameters + tezos-mockup + tezos-mockup-proxy + tezos-mockup-commands + tezos-baking-alpha.tenderbrute) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha.Protocol + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha + -open Tezos_stdlib_unix + -open Tezos_client_base_unix + -open Tezos_protocol_alpha_parameters + -open Tenderbrute_alpha)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_client_context.ml b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_client_context.ml new file mode 100644 index 000000000000..cc090580cdb0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_client_context.ml @@ -0,0 +1,174 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tezos_client_base + +let logger = + let log _channel msg = Lwt_fmt.printf "%s@." msg in + new Client_context.simple_printer log + +class dummy_prompter : Client_context.prompter = + object + method prompt : type a. (a, string tzresult) Client_context.lwt_format -> a + = + fun _msg -> assert false + + method prompt_password : type a. + (a, Bytes.t tzresult) Client_context.lwt_format -> a = + fun _msg -> assert false + + method multiple_password_retries = false + end + +let log _channel msg = + print_endline msg ; + Lwt.return_unit + +class faked_ctxt (hooks : Faked_services.hooks) + (chain_id : Tezos_crypto.Chain_id.t) : Tezos_rpc.Context.generic = + let local_ctxt = + let module Services = Faked_services.Make ((val hooks)) in + Tezos_mockup_proxy.RPC_client.local_ctxt (Services.directory chain_id) + in + object + method base = local_ctxt#base + + method generic_media_type_call meth ?body uri = + local_ctxt#generic_media_type_call meth ?body uri + + method call_service + : 'm 'p 'q 'i 'o. + (([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t -> + 'p -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + fun service params query body -> + local_ctxt#call_service service params query body + + method call_streamed_service + : 'm 'p 'q 'i 'o. + (([< Resto.meth] as 'm), unit, 'p, 'q, 'i, 'o) Tezos_rpc.Service.t -> + on_chunk:('o -> unit) -> + on_close:(unit -> unit) -> + 'p -> + 'q -> + 'i -> + (unit -> unit) tzresult Lwt.t = + fun service ~on_chunk ~on_close params query body -> + local_ctxt#call_streamed_service + service + ~on_chunk + ~on_close + params + query + body + end + +class faked_wallet ~base_dir ~filesystem : Client_context.wallet = + object (self) + method load_passwords = None + + method read_file fname = + match String.Hashtbl.find filesystem fname with + | None -> failwith "faked_wallet: cannot read file (%s)" fname + | Some (content, _mtime) -> return content + + method private filename alias_name = + Filename.concat + base_dir + (String.map (function ' ' -> '_' | c -> c) alias_name ^ "s") + + val lock_mutex = Lwt_mutex.create () + + method with_lock : type a. (unit -> a Lwt.t) -> a Lwt.t = + fun f -> Lwt_mutex.with_lock lock_mutex f + + method get_base_dir = base_dir + + method load : type a. + string -> default:a -> a Data_encoding.encoding -> a tzresult Lwt.t = + fun alias_name ~default encoding -> + let filename = self#filename alias_name in + if not (String.Hashtbl.mem filesystem filename) then return default + else + self#read_file filename >>=? fun content -> + let json = (Ezjsonm.from_string content :> Data_encoding.json) in + match Data_encoding.Json.destruct encoding json with + | exception e -> + failwith + "did not understand the %s alias file %s : %s" + alias_name + filename + (Printexc.to_string e) + | data -> return data + + method write : type a. + string -> a -> a Data_encoding.encoding -> unit tzresult Lwt.t = + fun alias_name list encoding -> + let filename = self#filename alias_name in + let json = Data_encoding.Json.construct encoding list in + let str = Ezjsonm.value_to_string (json :> Ezjsonm.value) in + String.Hashtbl.replace + filesystem + filename + (str, Some (Ptime.to_float_s (Ptime_clock.now ()))) ; + return_unit + + method last_modification_time : string -> float option tzresult Lwt.t = + let open Lwt_result_syntax in + fun alias_name -> + let filename = self#filename alias_name in + let file = String.Hashtbl.find_opt filesystem filename in + match file with + | None -> return_none + | Some (_content, mtime) -> return mtime + end + +class faked_io_wallet ~base_dir ~filesystem : Client_context.io_wallet = + object + inherit Client_context.simple_printer log + + inherit dummy_prompter + + inherit faked_wallet ~base_dir ~filesystem + end + +class unix_faked ~base_dir ~filesystem ~chain_id ~hooks : Client_context.full = + object + inherit faked_io_wallet ~base_dir ~filesystem + + inherit faked_ctxt hooks chain_id + + inherit Client_context_unix.unix_ui + + method chain = `Hash chain_id + + method block = `Head 0 + + method confirmations = None + + method verbose_rpc_error_diagnostics = false + end diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_daemon.ml b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_daemon.ml new file mode 100644 index 000000000000..1319d3df51d9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_daemon.ml @@ -0,0 +1,29 @@ +module Baker = struct + let run ~(cctxt : #Protocol_client_context.full) ~stop_on_event ~chain_id + ~(context_index : Abstract_context_index.t) ~delegates = + let chain = `Hash chain_id in + let baking_configuration = + let open Baking_configuration in + { + default_config with + validation = ContextIndex context_index; + state_recorder = Disabled; + } + in + (* By default errors are simply printed but the baker won't stop + because of them. This is not what we want for testing. Here we force + the baker to terminate unsuccessfully if an error occurs. *) + let canceler = Lwt_canceler.create () in + let on_error (err : error trace) = + Lwt_canceler.cancel canceler >>= fun _ -> + failwith "%a" Error_monad.pp_print_trace err + in + Baking_scheduling.run + cctxt + ~canceler + ~stop_on_event + ~on_error + ~chain + baking_configuration + delegates +end diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_services.ml b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_services.ml new file mode 100644 index 000000000000..ff2b7871d752 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/faked_services.ml @@ -0,0 +1,316 @@ +open Tezos_shell_services +module Directory = Tezos_rpc.Directory +module Chain_services = Tezos_shell_services.Chain_services +module Block_services = Tezos_shell_services.Block_services +module Block_services_alpha = Protocol_client_context.Alpha_block_services + +module type Mocked_services_hooks = sig + type mempool = Mockup.M.Block_services.Mempool.t + + (** The baker and endorser rely on this stream to be notified of new + blocks. *) + val monitor_heads : + unit -> (Tezos_crypto.Block_hash.t * Block_header.t) Tezos_rpc.Answer.stream + + (** Returns current and next protocol for a block. *) + val protocols : + Block_services.block -> Block_services.protocols tzresult Lwt.t + + (** [header] returns the block header of the block associated to the given + block specification. *) + val header : + Block_services.block -> Mockup.M.Block_services.block_header tzresult Lwt.t + + (** [resulting_context_hash] returns the context resulting hash of the given block. *) + val resulting_context_hash : + Block_services.block -> Tezos_crypto.Context_hash.t tzresult Lwt.t + + (** [operations] returns all operations included in the block. *) + val operations : + Block_services.block -> + Mockup.M.Block_services.operation list list tzresult Lwt.t + + (** [inject_block_callback] is called when an RPC is performed on + [Tezos_shell_services.Injection_services.S.block], after checking that + the block header can be deserialized. *) + val inject_block : + Tezos_crypto.Block_hash.t -> + Block_header.t -> + Operation.t trace trace -> + unit tzresult Lwt.t + + (** [inject_operation] is used by the endorser (or the client) to inject + operations, including endorsements. *) + val inject_operation : + Operation.t -> Tezos_crypto.Operation_hash.t tzresult Lwt.t + + (** [pending_operations] returns the current contents of the mempool. It + is used by the baker to fetch operations to potentially include in the + block being baked. These operations might include endorsements. If + there aren't enough endorsements, the baker waits on + [monitor_operations]. *) + val pending_operations : unit -> mempool Lwt.t + + (** Return a stream of list of operations. Used by the baker to wait on + endorsements. Invariant: the stream becomes empty when the node changes + head. *) + val monitor_operations : + applied:bool -> + branch_delayed:bool -> + branch_refused:bool -> + refused:bool -> + ((Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) + * error trace option) + list + Tezos_rpc.Answer.stream + + (** Lists block hashes from the chain, up to the last checkpoint, sorted + with decreasing fitness. Without arguments it returns the head of the + chain. Optional arguments allow to return the list of predecessors of a + given block or of a set of blocks. *) + val list_blocks : + heads:Tezos_crypto.Block_hash.t list -> + length:int option -> + min_date:Time.Protocol.t option -> + Tezos_crypto.Block_hash.t list list tzresult Lwt.t + + (** List the ancestors of the given block which, if referred to as + the branch in an operation header, are recent enough for that + operation to be included in the current block. *) + val live_blocks : + Block_services.block -> Tezos_crypto.Block_hash.Set.t tzresult Lwt.t + + (** [rpc_context_callback] is used in the implementations of several + RPCs (see local_services.ml). It should correspond to the + rpc_context constructed from the context at the requested block. *) + val rpc_context_callback : + Block_services.block -> + Tezos_protocol_environment.rpc_context tzresult Lwt.t + + (** Return raw protocol data as a block. *) + val raw_protocol_data : Block_services.block -> Bytes.t tzresult Lwt.t + + (** Broadcast block manually to nodes [dests] (given by their + number, starting from 0). If [dests] is not provided, broadcast + to all nodes. *) + val broadcast_block : + ?dests:int list -> + Tezos_crypto.Block_hash.t -> + Block_header.t -> + Operation.t trace trace -> + unit tzresult Lwt.t + + (** Broadcast operation manually to nodes [dests] (given by their + number, starting from 0). If [dests] is not provided, broadcast + to all nodes. *) + val broadcast_operation : + ?dests:int list -> Alpha_context.packed_operation -> unit tzresult Lwt.t + + (** Simulate waiting for the node to be bootstrapped. Because the + simulated node is already bootstrapped, returns the current head + immediately. *) + val monitor_bootstrapped : + unit -> + (Tezos_crypto.Block_hash.t * Time.Protocol.t) Tezos_rpc.Answer.stream +end + +type hooks = (module Mocked_services_hooks) + +module Make (Hooks : Mocked_services_hooks) = struct + let monitor_heads = + Directory.gen_register1 + Directory.empty + Monitor_services.S.heads + (fun _chain _next_protocol () -> + Tezos_rpc.Answer.return_stream (Hooks.monitor_heads ())) + + let monitor_bootstrapped = + Directory.gen_register0 + Directory.empty + Monitor_services.S.bootstrapped + (fun () () -> + Tezos_rpc.Answer.return_stream (Hooks.monitor_bootstrapped ())) + + let protocols = + let path = + let open Tezos_rpc.Path in + prefix Block_services.chain_path Block_services.path + in + let service = + Tezos_rpc.Service.prefix path Block_services.Empty.S.protocols + in + Directory.register Directory.empty service (fun (_, block) () () -> + Hooks.protocols block) + + let header = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Mockup.M.Block_services.S.header + (fun (((), _chain), block) _ _ -> Hooks.header block) + + let resulting_context_hash = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Mockup.M.Block_services.S.resulting_context_hash + (fun (((), _chain), block) _ _ -> Hooks.resulting_context_hash block) + + let operations = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Mockup.M.Block_services.S.Operations.operations + (fun (((), _chain), block) _ () -> Hooks.operations block) + + let hash = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Block_services.Empty.S.hash + (fun (((), _chain), block) () () -> + Hooks.header block >>=? fun x -> return x.hash) + + let shell_header = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Mockup.M.Block_services.S.Header.shell_header + (fun (((), _chain), block) _ _ -> + Hooks.header block >>=? fun x -> return x.shell) + + let chain chain_id = + Directory.prefix + Chain_services.path + (Directory.register + Directory.empty + Chain_services.S.chain_id + (fun _chain () () -> return chain_id)) + + let inject_block = + Directory.register + Directory.empty + Injection_services.S.block + (fun () _chain (bytes, operations) -> + match Block_header.of_bytes bytes with + | None -> failwith "faked_services.inject_block: can't deserialize" + | Some block_header -> + let block_hash = Tezos_crypto.Block_hash.hash_bytes [bytes] in + Hooks.inject_block block_hash block_header operations >>=? fun () -> + return block_hash) + + let inject_operation = + Directory.register + Directory.empty + Injection_services.S.operation + (fun () _chain bytes -> + match Data_encoding.Binary.of_bytes_opt Operation.encoding bytes with + | None -> failwith "faked_services.inject_operation: can't deserialize" + | Some operation -> Hooks.inject_operation operation) + + let broadcast_block = + Directory.register + Directory.empty + Broadcast_services.S.block + (fun () dests (block_header, operations) -> + let bytes = Block_header.to_bytes block_header in + let block_hash = Tezos_crypto.Block_hash.hash_bytes [bytes] in + let dests = match dests#dests with [] -> None | dests -> Some dests in + Hooks.broadcast_block ?dests block_hash block_header operations) + + let broadcast_operation = + Directory.register + Directory.empty + Broadcast_services.S.operation + (fun () dests operation -> + let dests = match dests#dests with [] -> None | dests -> Some dests in + Hooks.broadcast_operation ?dests operation) + + let pending_operations = + Directory.gen_register + Directory.empty + (Mockup.M.Block_services.S.Mempool.pending_operations + @@ Block_services.mempool_path Block_services.chain_path) + (fun ((), _chain) _params () -> + Hooks.pending_operations () >>= fun mempool -> + Mockup.M.Block_services.Mempool.pending_operations_version_dispatcher + ~version:1 + mempool) + + let monitor_operations = + Directory.gen_register + Directory.empty + (Block_services_alpha.S.Mempool.monitor_operations + @@ Block_services.mempool_path Block_services.chain_path) + (fun ((), _chain) flags () -> + let stream = + Hooks.monitor_operations + ~applied:flags#applied + ~branch_delayed:flags#branch_delayed + ~branch_refused:flags#branch_refused + ~refused:flags#refused + in + Tezos_rpc.Answer.return_stream stream) + + let list_blocks = + Directory.prefix + Chain_services.path + (Directory.register + Directory.empty + Chain_services.S.Blocks.list + (fun ((), _chain) flags () -> + Hooks.list_blocks + ~heads:flags#heads + ~length:flags#length + ~min_date:flags#min_date)) + + let live_blocks = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Block_services.Empty.S.live_blocks + (fun (_, block) _ () -> Hooks.live_blocks block) + + let raw_protocol_data = + Directory.prefix + (Tezos_rpc.Path.prefix Chain_services.path Block_services.path) + @@ Directory.register + Directory.empty + Block_services.Empty.S.Header.raw_protocol_data + (fun (_, block) () () -> Hooks.raw_protocol_data block) + + let shell_directory chain_id = + let merge = Directory.merge in + Directory.empty |> merge monitor_heads |> merge protocols |> merge header + |> merge operations |> merge hash |> merge shell_header + |> merge resulting_context_hash + |> merge (chain chain_id) + |> merge inject_block |> merge inject_operation |> merge monitor_operations + |> merge list_blocks |> merge live_blocks |> merge raw_protocol_data + |> merge broadcast_block |> merge broadcast_operation + |> merge monitor_bootstrapped + + let directory chain_id = + let proto_directory = + Directory.prefix + Chain_services.path + (Directory.prefix + Block_services.path + (Directory.map + (fun (((), _chain), block) -> + Hooks.rpc_context_callback block >>= function + | Error _ -> assert false + | Ok rpc_context -> Lwt.return rpc_context) + Mockup.M.directory)) + in + let base = Directory.merge (shell_directory chain_id) proto_directory in + Tezos_rpc.Directory.register_describe_directory_service + base + Tezos_rpc.Service.description_service +end diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.ml b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.ml new file mode 100644 index 000000000000..671df850a7df --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.ml @@ -0,0 +1,1414 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type block = { + rpc_context : Tezos_protocol_environment.rpc_context; + protocol_data : Protocol.Alpha_context.Block_header.protocol_data; + raw_protocol_data : Bytes.t; + operations : Mockup.M.Block_services.operation list list; + resulting_context_hash : Tezos_crypto.Context_hash.t; +} + +type chain = block list + +(** As new blocks and operations are received they are pushed to an Lwt_pipe + wrapped into this type. *) +type broadcast = + | Broadcast_block of + Tezos_crypto.Block_hash.t * Block_header.t * Operation.t list list + | Broadcast_op of + Tezos_crypto.Operation_hash.t * Alpha_context.packed_operation + +(** The state of a mockup node. *) +type state = { + instance_index : int; + (** Index of this node. Indices go from 0 to N-1 where N is the total + number of bakers in the simulation. *) + live_depth : int; + (** How many blocks (counting from the head into the past) are considered live? *) + mutable chain : chain; (** The chain as seen by this fake "node". *) + mutable mempool : + (Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list; + (** Mempool of this fake "node". *) + chain_table : chain Tezos_crypto.Block_hash.Table.t; + (** The chain table of this fake "node". It maps from block hashes to + blocks. *) + global_chain_table : block Tezos_crypto.Block_hash.Table.t; + (** The global chain table that allows us to look up blocks that may be + missing in [chain_table], i.e. not known to this particular node. This + is used to find unknown predecessors. The real node can ask about an + unknown block and receive it on request, this is supposed to emulate + that functionality. *) + ctxt_table : + Tezos_protocol_environment.rpc_context Tezos_crypto.Context_hash.Table.t; + (** The context table allows us to look up rpc_context by its hash. *) + heads_pipe : + (Tezos_crypto.Block_hash.t * Block_header.t) Lwt_pipe.Unbounded.t; + (** [heads_pipe] is used to implement the [monitor_heads] RPC. *) + operations_pipe : + (Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) option + Lwt_pipe.Unbounded.t; + (** [operations_pipe] is used to implement the [operations_pipe] RPC. *) + mutable streaming_operations : bool; + (** A helper flag used to implement the monitor operations RPC. *) + broadcast_pipes : broadcast Lwt_pipe.Unbounded.t list; + (** Broadcast pipes per node. *) + genesis_block_true_hash : Tezos_crypto.Block_hash.t; + (** True hash of the genesis + block as calculated by the + [Block_header.hash] function. *) +} + +let accounts = Mockup.Protocol_parameters.default_value.bootstrap_accounts + +let chain_id = Tezos_crypto.Chain_id.of_string_exn "main" + +let genesis_block_hash = + Tezos_crypto.Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU" + +let genesis_predecessor_block_hash = Tezos_crypto.Block_hash.zero + +type propagation = Block | Pass | Delay of float + +type propagation_vector = propagation list + +module type Hooks = sig + val on_inject_block : + level:int32 -> + round:int32 -> + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + operations:Operation.t list list -> + protocol_data:Alpha_context.Block_header.protocol_data -> + (Tezos_crypto.Block_hash.t + * Block_header.t + * Operation.t list list + * propagation_vector) + tzresult + Lwt.t + + val on_inject_operation : + op_hash:Tezos_crypto.Operation_hash.t -> + op:Alpha_context.packed_operation -> + (Tezos_crypto.Operation_hash.t + * Alpha_context.packed_operation + * propagation_vector) + tzresult + Lwt.t + + val on_new_head : + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + (Tezos_crypto.Block_hash.t * Block_header.t) option Lwt.t + + val on_new_operation : + Tezos_crypto.Operation_hash.t * Alpha_context.packed_operation -> + (Tezos_crypto.Operation_hash.t * Alpha_context.packed_operation) option + Lwt.t + + val check_block_before_processing : + level:int32 -> + round:int32 -> + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + protocol_data:Alpha_context.Block_header.protocol_data -> + unit tzresult Lwt.t + + val check_chain_after_processing : + level:int32 -> round:int32 -> chain:chain -> unit tzresult Lwt.t + + val check_mempool_after_processing : + mempool:(Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list -> + unit tzresult Lwt.t + + val stop_on_event : Baking_state.event -> bool + + val on_start_baker : + baker_position:int -> + delegates:Baking_state.consensus_key list -> + cctxt:Protocol_client_context.full -> + unit Lwt.t + + val check_chain_on_success : chain:chain -> unit tzresult Lwt.t +end + +(** Return a series of blocks starting from the block with the given + identifier. *) +let locate_blocks (state : state) + (block : Tezos_shell_services.Block_services.block) : + block list tzresult Lwt.t = + match block with + | `Hash (hash, rel) -> ( + match Tezos_crypto.Block_hash.Table.find state.chain_table hash with + | None -> + failwith + "locate_blocks: can't find the block %a" + Tezos_crypto.Block_hash.pp + hash + | Some chain0 -> + let _, chain = List.split_n rel chain0 in + return chain) + | `Head rel -> + let _, chain = List.split_n rel state.chain in + return chain + | `Level _ -> failwith "locate_blocks: `Level block spec not handled" + | `Genesis -> failwith "locate_blocks: `Genesis block spec net handled" + | `Alias _ -> failwith "locate_blocks: `Alias block spec not handled" + +(** Similar to [locate_blocks], but only returns the first block. *) +let locate_block (state : state) + (block : Tezos_shell_services.Block_services.block) : block tzresult Lwt.t = + locate_blocks state block >>=? function + | [] -> failwith "locate_block: can't find the block" + | x :: _ -> return x + +(** Return the collection of live blocks for a given block identifier. *) +let live_blocks (state : state) block = + locate_blocks state block >>=? fun chain -> + let segment, _ = List.split_n state.live_depth chain in + return + (List.fold_left + (fun set ({rpc_context; _} : block) -> + let hash = rpc_context.Tezos_protocol_environment.block_hash in + Tezos_crypto.Block_hash.Set.add hash set) + (Tezos_crypto.Block_hash.Set.singleton state.genesis_block_true_hash) + segment) + +(** Extract the round number from raw fitness. *) +let round_from_raw_fitness raw_fitness = + match Protocol.Alpha_context.Fitness.from_raw raw_fitness with + | Ok fitness -> + return + (Alpha_context.Round.to_int32 + (Protocol.Alpha_context.Fitness.round fitness)) + | Error _ -> failwith "round_from_raw_fitness: cannot parse fitness" + +(** Extract level from a block header. *) +let get_block_level (block_header : Block_header.t) = + return block_header.shell.level + +(** Extract round from a block header. *) +let get_block_round (block_header : Block_header.t) = + round_from_raw_fitness block_header.shell.fitness + +(** Parse protocol data. *) +let parse_protocol_data (protocol_data : Bytes.t) = + match + Data_encoding.Binary.of_bytes_opt + Protocol.Alpha_context.Block_header.protocol_data_encoding + protocol_data + with + | None -> failwith "can't parse protocol data of a block" + | Some parsed_protocol_data -> return parsed_protocol_data + +(** Broadcast an operation or block according to the given propagation + vector. *) +let handle_propagation msg propagation_vector broadcast_pipes = + List.iter_s + (fun (propagation, pipe) -> + match propagation with + | Block -> Lwt.return () + | Pass -> + Lwt_pipe.Unbounded.push pipe msg ; + Lwt.return_unit + | Delay s -> + Lwt.dont_wait + (fun () -> + Lwt_unix.sleep s >>= fun () -> + Lwt_pipe.Unbounded.push pipe msg ; + Lwt.return_unit) + (fun _exn -> ()) ; + Lwt.return ()) + (List.combine_drop propagation_vector broadcast_pipes) + >>= fun () -> return () + +(** Use the [user_hooks] to produce a module of functions that will perform + the heavy lifting for the RPC implementations. *) +let make_mocked_services_hooks (state : state) (user_hooks : (module Hooks)) : + Faked_services.hooks = + let module User_hooks = (val user_hooks : Hooks) in + let module Impl : Faked_services.Mocked_services_hooks = struct + type mempool = Mockup.M.Block_services.Mempool.t + + let monitor_heads () = + let next () = + let rec pop_until_ok () = + Lwt_pipe.Unbounded.pop state.heads_pipe + >>= fun (block_hash, block_header) -> + User_hooks.on_new_head ~block_hash ~block_header >>= function + | None -> pop_until_ok () + | Some head -> Lwt.return_some head + in + pop_until_ok () + in + let shutdown () = () in + Tezos_rpc.Answer.{next; shutdown} + + let monitor_bootstrapped () = + let first_run = ref true in + let next () = + if !first_run then ( + first_run := false ; + let b = match state.chain with [] -> assert false | b :: _ -> b in + let head_hash = b.rpc_context.block_hash in + let timestamp = b.rpc_context.block_header.timestamp in + Lwt.return_some (head_hash, timestamp)) + else Lwt.return_none + in + let shutdown () = () in + Tezos_rpc.Answer.{next; shutdown} + + let protocols (block : Tezos_shell_services.Block_services.block) = + locate_block state block >>=? fun x -> + let hash = x.rpc_context.block_hash in + let is_predecessor_of_genesis = + match block with + | `Hash (requested_hash, rel) -> + Int.equal rel 0 + && Tezos_crypto.Block_hash.equal + requested_hash + genesis_predecessor_block_hash + | _ -> false + in + (* It is important to tell the baker that the genesis block is not in + the alpha protocol (we use Tezos_crypto.Protocol_hash.zero). This will make the + baker not try to propose alternatives to that block and just accept + it as final in that Tezos_crypto.Protocol_hash.zero protocol. The same for + predecessor of genesis, it should be in Tezos_crypto.Protocol_hash.zero. *) + return + Tezos_shell_services.Block_services. + { + current_protocol = + (if + Tezos_crypto.Block_hash.equal hash genesis_block_hash + || is_predecessor_of_genesis + then Tezos_crypto.Protocol_hash.zero + else Protocol.hash); + next_protocol = + (if is_predecessor_of_genesis then Tezos_crypto.Protocol_hash.zero + else Protocol.hash); + } + + let header (block : Tezos_shell_services.Block_services.block) : + Mockup.M.Block_services.block_header tzresult Lwt.t = + locate_block state block >>=? fun x -> + return + { + Mockup.M.Block_services.hash = x.rpc_context.block_hash; + chain_id; + shell = x.rpc_context.block_header; + protocol_data = x.protocol_data; + } + + let resulting_context_hash + (block : Tezos_shell_services.Block_services.block) : + Tezos_crypto.Context_hash.t tzresult Lwt.t = + locate_block state block >>=? fun x -> return x.resulting_context_hash + + let operations block = + locate_block state block >>=? fun x -> return x.operations + + let inject_block block_hash (block_header : Block_header.t) operations = + parse_protocol_data block_header.protocol_data >>=? fun protocol_data -> + get_block_level block_header >>=? fun level -> + get_block_round block_header >>=? fun round -> + User_hooks.on_inject_block + ~level + ~round + ~block_hash + ~block_header + ~operations + ~protocol_data + >>=? fun (block_hash1, block_header1, operations1, propagation_vector) -> + handle_propagation + (Broadcast_block (block_hash1, block_header1, operations1)) + propagation_vector + state.broadcast_pipes + + let all_pipes_or_select = function + | None -> return state.broadcast_pipes + | Some l -> + List.map_es + (fun n -> + match List.nth_opt state.broadcast_pipes n with + | None -> + failwith + "Node number %d is out of range (max is %d)" + n + (List.length state.broadcast_pipes - 1) + | Some pipe -> return pipe) + l + + let broadcast_block ?dests block_hash (block_header : Block_header.t) + operations = + all_pipes_or_select dests >>=? fun pipes -> + List.iter_s + (fun pipe -> + Lwt_pipe.Unbounded.push + pipe + (Broadcast_block (block_hash, block_header, operations)) ; + Lwt.return ()) + pipes + >>= return + + let inject_operation (Operation.{shell; proto} as op) = + let op_hash = Operation.hash op in + let proto_op_opt = + Data_encoding.Binary.of_bytes Protocol.operation_data_encoding proto + in + match proto_op_opt with + | Error _ -> failwith "inject_operation: cannot parse operation" + | Ok protocol_data -> + let op : Protocol.Alpha_context.packed_operation = + {shell; protocol_data} + in + User_hooks.on_inject_operation ~op_hash ~op + >>=? fun (op_hash1, op1, propagation_vector) -> + handle_propagation + (Broadcast_op (op_hash1, op1)) + propagation_vector + state.broadcast_pipes + >>=? fun () -> return op_hash1 + + let broadcast_operation ?dests + (op : Protocol.Alpha_context.packed_operation) = + all_pipes_or_select dests >>=? fun pipes -> + let op_hash = Alpha_context.Operation.hash_packed op in + List.iter_s + (fun pipe -> + Lwt_pipe.Unbounded.push pipe (Broadcast_op (op_hash, op)) ; + Lwt.return ()) + pipes + >>= return + + let pending_operations () = + let ops = state.mempool in + Lwt.return + Mockup.M.Block_services.Mempool. + { + applied = ops; + refused = Tezos_crypto.Operation_hash.Map.empty; + outdated = Tezos_crypto.Operation_hash.Map.empty; + branch_refused = Tezos_crypto.Operation_hash.Map.empty; + branch_delayed = Tezos_crypto.Operation_hash.Map.empty; + unprocessed = Tezos_crypto.Operation_hash.Map.empty; + } + + let monitor_operations ~applied ~branch_delayed ~branch_refused ~refused = + ignore applied ; + ignore branch_delayed ; + ignore branch_refused ; + ignore refused ; + let streamed = ref false in + state.streaming_operations <- true ; + let next () = + let rec pop_until_ok () = + Lwt_pipe.Unbounded.pop state.operations_pipe >>= function + | None when !streamed -> Lwt.return None + | None -> + streamed := true ; + Lwt.return (Some []) + | Some op -> ( + User_hooks.on_new_operation op >>= function + | None when !streamed -> pop_until_ok () + | None -> + streamed := true ; + Lwt.return (Some []) + | Some (oph, op) -> + streamed := true ; + Lwt.return (Some [((oph, op), None)])) + in + pop_until_ok () + in + let shutdown () = () in + Tezos_rpc.Answer.{next; shutdown} + + let rpc_context_callback block = + locate_block state block >>=? fun x -> return x.rpc_context + + let list_blocks ~heads ~length ~min_date:_ = + let compare_block_fitnesses block0 block1 = + Fitness.compare + block0.rpc_context.block_header.fitness + block1.rpc_context.block_header.fitness + in + let hash_of_block block = block.rpc_context.block_hash in + let lookup_head head = + locate_blocks state (`Hash (head, 0)) >>=? fun xs -> + let segment = + match length with None -> xs | Some n -> List.take_n n xs + in + return + (List.map hash_of_block (List.sort compare_block_fitnesses segment)) + in + List.map_es lookup_head heads + + let live_blocks block = live_blocks state block + + let raw_protocol_data block = + locate_block state block >>=? fun x -> return x.raw_protocol_data + end in + (module Impl) + +(** Return the current head. *) +let head {chain; _} = + match List.hd chain with + | None -> failwith "mockup_simulator.ml: empty chain" + | Some hd -> return hd + +(** Clear from the mempool operations whose branch does not point to + a live block with respect to the current head. *) +let clear_mempool state = + head state >>=? fun head -> + let included_ops_hashes = + List.map + (fun (op : Mockup.M.Block_services.operation) -> op.hash) + (List.flatten head.operations) + in + live_blocks state (`Head 0) >>=? fun live_set -> + let mempool = + List.filter + (fun (_oph, (op : Mockup.M.Protocol.operation)) -> + let included_in_head = + List.mem + ~equal:Tezos_crypto.Operation_hash.equal + (Alpha_context.Operation.hash_packed op) + included_ops_hashes + in + Tezos_crypto.Block_hash.Set.mem op.shell.branch live_set + && not included_in_head) + state.mempool + in + state.mempool <- mempool ; + return_unit + +let begin_validation_and_application ctxt chain_id mode ~predecessor ~cache = + let open Lwt_result_syntax in + let* validation_state = + Mockup.M.Protocol.begin_validation ctxt chain_id mode ~predecessor ~cache + in + let* application_state = + Mockup.M.Protocol.begin_application ctxt chain_id mode ~predecessor ~cache + in + return (validation_state, application_state) + +let validate_and_apply_operation (validation_state, application_state) oph op = + let open Lwt_result_syntax in + let* validation_state = + Mockup.M.Protocol.validate_operation validation_state oph op + in + let* application_state, receipt = + Mockup.M.Protocol.apply_operation application_state oph op + in + return ((validation_state, application_state), receipt) + +let finalize_validation_and_application (validation_state, application_state) + shell_header = + let open Lwt_result_syntax in + let* () = Mockup.M.Protocol.finalize_validation validation_state in + Mockup.M.Protocol.finalize_application application_state shell_header + +(** Apply a block to the given [rpc_context]. *) +let reconstruct_context (rpc_context : Tezos_protocol_environment.rpc_context) + (operations : Operation.t list list) (block_header : Block_header.t) = + let predecessor = rpc_context.block_header in + let predecessor_context = rpc_context.context in + parse_protocol_data block_header.protocol_data >>=? fun protocol_data -> + begin_validation_and_application + predecessor_context + chain_id + (Application {shell = block_header.shell; protocol_data}) + ~predecessor + ~cache:`Lazy + >>=? fun state -> + let i = ref 0 in + List.fold_left_es + (List.fold_left_es (fun (state, results) op -> + incr i ; + let oph = Operation.hash op in + let operation_data = + Data_encoding.Binary.of_bytes_exn + Mockup.M.Protocol.operation_data_encoding + op.Operation.proto + in + let op = + {Mockup.M.Protocol.shell = op.shell; protocol_data = operation_data} + in + validate_and_apply_operation state oph op >>=? fun (state, receipt) -> + return (state, receipt :: results))) + (state, []) + operations + >>=? fun (state, _) -> finalize_validation_and_application state None + +(** Process an incoming block. If validation succeeds: + - update the current head to this new block + - cleanup outdated operations + - cleanup listener table + Note that this implementation does not handle concurrent branches. *) +let rec process_block state block_hash (block_header : Block_header.t) + operations = + let get_predecessor () = + let predecessor_hash = block_header.Block_header.shell.predecessor in + head state >>=? fun head -> + match + Tezos_crypto.Block_hash.Table.find state.chain_table predecessor_hash + with + | None | Some [] -> ( + (* Even if the predecessor is not known locally, it might be known by + some node in the network. The code below "requests" information + about the block by its hash. *) + match + Tezos_crypto.Block_hash.Table.find + state.global_chain_table + predecessor_hash + with + | None -> failwith "get_predecessor: unknown predecessor block" + | Some predecessor -> + let predecessor_block_header = + Block_header. + { + shell = predecessor.rpc_context.block_header; + protocol_data = predecessor.raw_protocol_data; + } + in + let predecessor_ops = + List.map + (fun xs -> + List.map + (fun (op : Mockup.M.Block_services.operation) -> + Operation. + { + shell = op.shell; + proto = + Data_encoding.Binary.to_bytes_exn + Protocol.operation_data_encoding + op.protocol_data; + }) + xs) + predecessor.operations + in + (* If the block is found, apply it before proceeding. *) + process_block + state + predecessor.rpc_context.block_hash + predecessor_block_header + predecessor_ops + >>=? fun () -> return predecessor) + | Some (predecessor :: _) -> + if + Int32.sub + head.rpc_context.block_header.level + predecessor.rpc_context.block_header.level + <= 2l + then return predecessor + else failwith "get_predecessor: the predecessor block is too old" + in + match Tezos_crypto.Block_hash.Table.find state.chain_table block_hash with + | Some _ -> + (* The block is already known. *) + return_unit + | None -> + get_predecessor () >>=? fun predecessor -> + head state >>=? fun head -> + reconstruct_context predecessor.rpc_context operations block_header + >>=? fun ({context; message; _}, _) -> + let resulting_context_hash = + Tezos_context_ops.Context_ops.hash + ~time:block_header.shell.timestamp + ?message + context + in + let rpc_context = + Tezos_protocol_environment. + {context; block_hash; block_header = block_header.shell} + in + let operations = + List.map + (fun pass -> + List.map + (fun (Operation.{shell; proto} as op) -> + let hash : Tezos_crypto.Operation_hash.t = Operation.hash op in + let protocol_data : Alpha_context.packed_protocol_data = + Data_encoding.Binary.of_bytes_exn + Protocol.operation_data_encoding + proto + in + { + Mockup.M.Block_services.chain_id; + hash; + shell; + protocol_data; + receipt = Empty; + }) + pass) + operations + in + parse_protocol_data block_header.protocol_data >>=? fun protocol_data -> + let new_block = + { + rpc_context; + protocol_data; + raw_protocol_data = block_header.protocol_data; + operations; + resulting_context_hash; + } + in + let predecessor_hash = block_header.Block_header.shell.predecessor in + let tail = + Tezos_crypto.Block_hash.Table.find state.chain_table predecessor_hash + |> WithExceptions.Option.get ~loc:__LOC__ + in + let new_chain = new_block :: tail in + Tezos_crypto.Block_hash.Table.replace + state.chain_table + block_hash + new_chain ; + Tezos_crypto.Block_hash.Table.replace + state.global_chain_table + block_hash + new_block ; + Tezos_crypto.Context_hash.Table.replace + state.ctxt_table + resulting_context_hash + rpc_context ; + if + Fitness.( + block_header.shell.fitness > head.rpc_context.block_header.fitness) + then ( + state.chain <- new_chain ; + clear_mempool state >>=? fun () -> + (* The head has changed, the messages in the operations pipe are no + good anymore. *) + ignore (Lwt_pipe.Unbounded.pop_all_now state.operations_pipe) ; + (if state.streaming_operations then ( + state.streaming_operations <- false ; + Lwt_pipe.Unbounded.push state.operations_pipe None ; + Lwt.return ()) + else Lwt.return ()) + >>= fun () -> + (* Put back in the pipe operations that are still alive. *) + List.iter_s + (fun op -> + Lwt_pipe.Unbounded.push state.operations_pipe (Some op) ; + Lwt.return ()) + state.mempool + >>= fun () -> return_unit) + else return_unit + +(** This process listens to broadcast block and operations and incorporates + them in the context of the fake node. *) +let rec listener ~(user_hooks : (module Hooks)) ~state ~broadcast_pipe = + let module User_hooks = (val user_hooks : Hooks) in + Lwt_pipe.Unbounded.pop broadcast_pipe >>= function + | Broadcast_op (operation_hash, packed_operation) -> + state.mempool <- (operation_hash, packed_operation) :: state.mempool ; + Lwt_pipe.Unbounded.push + state.operations_pipe + (Some (operation_hash, packed_operation)) ; + User_hooks.check_mempool_after_processing ~mempool:state.mempool + >>=? fun () -> listener ~user_hooks ~state ~broadcast_pipe + | Broadcast_block (block_hash, block_header, operations) -> + get_block_level block_header >>=? fun level -> + get_block_round block_header >>=? fun round -> + parse_protocol_data block_header.protocol_data >>=? fun protocol_data -> + User_hooks.check_block_before_processing + ~level + ~round + ~block_hash + ~block_header + ~protocol_data + >>=? fun () -> + process_block state block_hash block_header operations >>=? fun () -> + User_hooks.check_chain_after_processing ~level ~round ~chain:state.chain + >>=? fun () -> + Lwt_pipe.Unbounded.push state.heads_pipe (block_hash, block_header) ; + listener ~user_hooks ~state ~broadcast_pipe + +(** Create a fake node state. *) +let create_fake_node_state ~i ~live_depth + ~(genesis_block : Block_header.t * Tezos_protocol_environment.rpc_context) + ~global_chain_table ~broadcast_pipes = + let block_header0, rpc_context0 = genesis_block in + parse_protocol_data block_header0.protocol_data >>=? fun protocol_data -> + let genesis0 = + { + rpc_context = rpc_context0; + protocol_data; + raw_protocol_data = block_header0.protocol_data; + operations = [[]; []; []; []]; + resulting_context_hash = block_header0.shell.context; + } + in + let chain0 = [genesis0] in + let heads_pipe = Lwt_pipe.Unbounded.create () in + let operations_pipe = Lwt_pipe.Unbounded.create () in + let genesis_block_true_hash = + Block_header.hash + { + shell = rpc_context0.block_header; + protocol_data = block_header0.protocol_data; + } + in + Lwt_pipe.Unbounded.push heads_pipe (rpc_context0.block_hash, block_header0) ; + return + { + instance_index = i; + live_depth; + mempool = []; + chain = chain0; + chain_table = + Tezos_crypto.Block_hash.Table.of_seq + (List.to_seq + [ + (rpc_context0.block_hash, chain0); + (genesis_block_true_hash, chain0); + (genesis_predecessor_block_hash, chain0); + ]); + global_chain_table; + ctxt_table = + Tezos_crypto.Context_hash.Table.of_seq + (List.to_seq + [ + ( rpc_context0.Tezos_protocol_environment.block_header + .Block_header.context, + rpc_context0 ); + ]); + heads_pipe; + operations_pipe; + streaming_operations = false; + broadcast_pipes; + genesis_block_true_hash; + } + +(** Start baker process. *) +let baker_process ~(delegates : Baking_state.consensus_key list) ~base_dir + ~(genesis_block : Block_header.t * Tezos_protocol_environment.rpc_context) + ~i ~global_chain_table ~broadcast_pipes ~(user_hooks : (module Hooks)) = + let broadcast_pipe = + List.nth broadcast_pipes i |> WithExceptions.Option.get ~loc:__LOC__ + in + create_fake_node_state + ~i + ~live_depth:60 + ~genesis_block + ~global_chain_table + ~broadcast_pipes + >>=? fun state -> + let filesystem = String.Hashtbl.create 10 in + let wallet = new Faked_client_context.faked_io_wallet ~base_dir ~filesystem in + let cctxt = + let hooks = make_mocked_services_hooks state user_hooks in + new Protocol_client_context.wrap_full + (new Faked_client_context.unix_faked + ~base_dir + ~filesystem + ~chain_id + ~hooks) + in + let module User_hooks = (val user_hooks : Hooks) in + User_hooks.on_start_baker ~baker_position:i ~delegates ~cctxt >>= fun () -> + List.iter_es + (fun ({alias; public_key; public_key_hash; secret_key_uri} : + Baking_state.consensus_key) -> + let open Tezos_client_base in + let name = alias |> WithExceptions.Option.get ~loc:__LOC__ in + Client_keys.neuterize secret_key_uri >>=? fun public_key_uri -> + Client_keys.register_key + wallet + ~force:false + (public_key_hash, public_key_uri, secret_key_uri) + ~public_key + name) + delegates + >>=? fun () -> + let context_index = + let open Abstract_context_index in + { + checkout_fun = + (fun hash -> + Tezos_crypto.Context_hash.Table.find state.ctxt_table hash + |> Option.map (fun Tezos_protocol_environment.{context; _} -> context) + |> Lwt.return); + finalize_fun = Lwt.return; + } + in + let module User_hooks = (val user_hooks : Hooks) in + let listener_process () = listener ~user_hooks ~state ~broadcast_pipe in + let stop_on_event event = User_hooks.stop_on_event event in + let baker_process () = + Faked_daemon.Baker.run + ~cctxt + ~stop_on_event + ~chain_id + ~context_index + ~delegates + in + Lwt.pick [listener_process (); baker_process ()] >>=? fun () -> + User_hooks.check_chain_on_success ~chain:state.chain + +let genesis_protocol_data (baker_sk : Tezos_crypto.Signature.secret_key) + (predecessor_hash : Tezos_crypto.Block_hash.t) + (block_header : Block_header.shell_header) : Bytes.t = + let proof_of_work_nonce = + Bytes.create Protocol.Alpha_context.Constants.proof_of_work_nonce_size + in + let payload_hash = + Protocol.Alpha_context.Block_payload.hash + ~predecessor_hash + ~payload_round:Alpha_context.Round.zero + [] + in + let contents = + Protocol.Alpha_context.Block_header. + { + payload_hash; + payload_round = Alpha_context.Round.zero; + proof_of_work_nonce; + seed_nonce_hash = None; + liquidity_baking_toggle_vote = + Baking_configuration.default_liquidity_baking_toggle_vote; + } + in + let unsigned_header = + Data_encoding.Binary.to_bytes_exn + Protocol.Alpha_context.Block_header.unsigned_encoding + (block_header, contents) + in + let signature = + Tezos_crypto.Signature.sign + ~watermark: + Alpha_context.Block_header.(to_watermark (Block_header chain_id)) + baker_sk + unsigned_header + in + Data_encoding.Binary.to_bytes_exn + Protocol.Alpha_context.Block_header.protocol_data_encoding + {contents; signature} + +(** Figure out who should be the signer for the genesis block. *) +let deduce_baker_sk + (accounts_with_secrets : + (Protocol.Alpha_context.Parameters.bootstrap_account + * Tezos_mockup_commands.Mockup_wallet.bootstrap_secret) + list) (total_accounts : int) (level : int) : + Tezos_crypto.Signature.secret_key tzresult Lwt.t = + (match (total_accounts, level) with + | _, 0 -> return 0 (* apparently this doesn't really matter *) + | _ -> + failwith + "cannot deduce baker for a genesis block, total accounts = %d, level = \ + %d" + total_accounts + level) + >>=? fun baker_index -> + let _, secret = + List.nth accounts_with_secrets baker_index + |> WithExceptions.Option.get ~loc:__LOC__ + in + let secret_key = + Tezos_crypto.Signature.Secret_key.of_b58check_exn + (Uri.path (secret.sk_uri :> Uri.t)) + in + return secret_key + +(** Generate the two initial genesis blocks. *) +let make_genesis_context ~delegate_selection ~initial_seed ~round0 ~round1 + ~consensus_committee_size ~consensus_threshold accounts_with_secrets + (total_accounts : int) = + let default_constants = Mockup.Protocol_parameters.default_value.constants in + let round_durations = + let open Alpha_context in + Stdlib.Option.get + (Round.Durations.create_opt + ~first_round_duration:(Period.of_seconds_exn round0) + ~delay_increment_per_round: + (Period.of_seconds_exn (Int64.sub round1 round0))) + in + let constants = + { + default_constants with + initial_seed; + consensus_committee_size; + consensus_threshold; + minimal_block_delay = Alpha_context.Period.of_seconds_exn (max 1L round0); + delay_increment_per_round = + Alpha_context.Period.of_seconds_exn Int64.(max 1L (sub round1 round0)); + } + in + let from_bootstrap_account i + ( (account : Protocol.Alpha_context.Parameters.bootstrap_account), + (secret : Tezos_mockup_commands.Mockup_wallet.bootstrap_secret) ) : + Mockup.Parsed_account.t = + { + name = Format.sprintf "bootstrap%d" (i + 1); + sk_uri = secret.sk_uri; + amount = account.amount; + } + in + let bootstrap_accounts = + Data_encoding.Json.construct + (Data_encoding.list Mockup.Parsed_account.encoding) + (List.mapi from_bootstrap_account accounts_with_secrets) + in + List.map_e + (fun (level, round_delegates) -> + Raw_level_repr.of_int32 level >>? fun level -> + List.map_e + (fun (round, delegate) -> + Round_repr.of_int32 round >|? fun round -> (round, delegate)) + round_delegates + >|? fun round_delegates -> (level, round_delegates)) + delegate_selection + |> Environment.wrap_tzresult + >>?= fun delegate_selection -> + (match (delegate_selection, constants.initial_seed) with + | [], seed_opt -> return seed_opt + | selection, (Some _ as seed) -> ( + Faked_client_context.logger#warning "Checking provided seed." + >>= fun () -> + Tenderbrute.check_seed + ~bootstrap_accounts_json:bootstrap_accounts + ~parameters:Mockup.Protocol_parameters.{default_value with constants} + ~seed + selection + >>=? function + | true -> return seed + | false -> + failwith "Provided initial seed does not match delegate selection") + | _, None -> + Faked_client_context.logger#warning + "No initial seed provided, bruteforcing." + >>= fun () -> + Tenderbrute.bruteforce + ~max:100_000_000_000 + ~bootstrap_accounts_json:bootstrap_accounts + ~parameters:Mockup.Protocol_parameters.{default_value with constants} + delegate_selection) + >>=? fun initial_seed -> + (match initial_seed with + | None -> Lwt.return_unit + | _ when initial_seed = constants.initial_seed -> Lwt.return_unit + | Some seed -> + Faked_client_context.logger#warning + "Bruteforced seed is %a, please save into your test." + State_hash.pp + seed) + >>= fun () -> + let constants = {constants with initial_seed} in + let common_parameters = + Mockup.Protocol_parameters.{default_value with constants} + in + let make_block0 initial_timestamp = + let parameters = {common_parameters with initial_timestamp} in + let reencoded_parameters = + Data_encoding.Binary.of_bytes_exn Mockup.M.parameters_encoding + @@ Data_encoding.Binary.to_bytes_exn + Mockup.Protocol_parameters.encoding + parameters + in + Mockup.M.init + ~cctxt:Faked_client_context.logger + ~parameters:reencoded_parameters + ~constants_overrides_json:None + ~bootstrap_accounts_json:(Some bootstrap_accounts) + >>=? fun {chain = _; rpc_context = rpc_context0; protocol_data = _} -> + let block_header0 = + { + rpc_context0.block_header with + predecessor = genesis_predecessor_block_hash; + } + in + let rpc_context = {rpc_context0 with block_header = block_header0} in + deduce_baker_sk accounts_with_secrets total_accounts 0 >>=? fun baker_sk -> + let protocol_data = + genesis_protocol_data + baker_sk + genesis_predecessor_block_hash + rpc_context.block_header + in + let block_header = + Block_header.{shell = rpc_context.block_header; protocol_data} + in + return (block_header, rpc_context) + in + + let level0_round0_duration = + Protocol.Alpha_context.Round.round_duration + round_durations + Alpha_context.Round.zero + in + let timestamp0 = + Time.Protocol.of_seconds + Int64.( + sub + (of_float (Unix.time ())) + (Alpha_context.Period.to_seconds level0_round0_duration)) + in + make_block0 timestamp0 + +(** By default, propagate every message everywhere. *) +let default_propagation_vector = List.repeat 5 Pass + +module Default_hooks : Hooks = struct + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, default_propagation_vector) + + let on_inject_operation ~op_hash ~op = + return (op_hash, op, default_propagation_vector) + + let on_new_head ~block_hash ~block_header = + Lwt.return (Some (block_hash, block_header)) + + let on_new_operation x = Lwt.return_some x + + let check_block_before_processing ~level:_ ~round:_ ~block_hash:_ + ~block_header:_ ~protocol_data:_ = + return_unit + + let check_chain_after_processing ~level:_ ~round:_ ~chain:_ = return_unit + + let check_mempool_after_processing ~mempool:_ = return_unit + + let stop_on_event _ = false + + let on_start_baker ~baker_position:_ ~delegates:_ ~cctxt:_ = Lwt.return_unit + + let check_chain_on_success ~chain:_ = return_unit +end + +type config = { + debug : bool; + round0 : int64; + round1 : int64; + timeout : int; + delegate_selection : + (int32 * (int32 * Tezos_crypto.Signature.public_key_hash) list) list; + initial_seed : State_hash.t option; + consensus_committee_size : int; + consensus_threshold : int; +} + +let default_config = + { + debug = false; + round0 = 2L; + (* Rounds should be long enough for the bakers to + exchange all the necessary messages. *) + round1 = 3L (* No real need to increase round durations. *); + timeout = 30; + delegate_selection = []; + initial_seed = None; + consensus_committee_size = + Default_parameters.constants_mainnet.consensus_committee_size; + consensus_threshold = + Default_parameters.constants_mainnet.consensus_threshold; + } + +let make_baking_delegate + ( (account : Alpha_context.Parameters.bootstrap_account), + (secret : Tezos_mockup_commands.Mockup_wallet.bootstrap_secret) ) : + Baking_state.consensus_key = + Baking_state. + { + alias = Some secret.name; + public_key = account.public_key |> WithExceptions.Option.get ~loc:__LOC__; + public_key_hash = account.public_key_hash; + secret_key_uri = secret.sk_uri; + } + +let run ?(config = default_config) bakers_spec = + Tezos_client_base.Client_keys.register_signer + (module Tezos_signer_backends.Unencrypted) ; + let total_accounts = + List.fold_left (fun acc (n, _) -> acc + n) 0 bakers_spec + in + if total_accounts = 0 then + failwith "the simulation should use at least one delegate" + else if total_accounts > 5 then + failwith "only up to 5 bootstrap accounts are available" + else + (* When logging is enabled it may cause non-termination: + + https://gitlab.com/nomadic-labs/tezos/-/issues/546 + + In particular, it seems that when logging is enabled the baker + process can get cancelled without executing its Lwt finalizer. *) + (if config.debug then Tezos_base_unix.Internal_event_unix.init () + else Lwt.return_unit) + >>= fun () -> + let total_bakers = List.length bakers_spec in + (List.init ~when_negative_length:() total_bakers (fun _ -> + Lwt_pipe.Unbounded.create ()) + |> function + | Error () -> failwith "impossible: negative length of the baker spec" + | Ok xs -> return xs) + >>=? fun broadcast_pipes -> + let global_chain_table = Tezos_crypto.Block_hash.Table.create 10 in + Tezos_mockup_commands.Mockup_wallet.default_bootstrap_accounts + >>=? fun bootstrap_secrets -> + let accounts_with_secrets = + List.combine_drop (List.take_n total_accounts accounts) bootstrap_secrets + in + let all_delegates = List.map make_baking_delegate accounts_with_secrets in + make_genesis_context + ~delegate_selection:config.delegate_selection + ~initial_seed:config.initial_seed + ~round0:config.round0 + ~round1:config.round1 + ~consensus_committee_size:config.consensus_committee_size + ~consensus_threshold:config.consensus_threshold + accounts_with_secrets + total_accounts + >>=? fun genesis_block -> + let take_third (_, _, x) = x in + let timeout_process () = + Lwt_unix.sleep (Float.of_int config.timeout) >>= fun () -> + failwith "the test is taking longer than %d seconds@." config.timeout + in + Lwt.pick + [ + timeout_process (); + Lwt_result_syntax.tzjoin + (take_third + (List.fold_left + (fun (i, delegates_acc, ms) (n, user_hooks) -> + let delegates, leftover_delegates = + List.split_n n delegates_acc + in + let m = + baker_process + ~delegates + ~base_dir:"dummy" + ~genesis_block + ~i + ~global_chain_table + ~broadcast_pipes + ~user_hooks + in + (i + 1, leftover_delegates, m :: ms)) + (0, all_delegates, []) + bakers_spec)); + ] + +let get_account_pk i = + match List.nth accounts i with + | None -> assert false + | Some acc -> acc.public_key |> WithExceptions.Option.get ~loc:__LOC__ + +let bootstrap1 = get_account_pk 0 + +let bootstrap2 = get_account_pk 1 + +let bootstrap3 = get_account_pk 2 + +let bootstrap4 = get_account_pk 3 + +let bootstrap5 = get_account_pk 4 + +let check_block_signature ~block_hash ~(block_header : Block_header.t) + ~public_key = + let (protocol_data : Protocol.Alpha_context.Block_header.protocol_data) = + Data_encoding.Binary.of_bytes_exn + Protocol.Alpha_context.Block_header.protocol_data_encoding + block_header.protocol_data + in + let unsigned_header = + Data_encoding.Binary.to_bytes_exn + Protocol.Alpha_context.Block_header.unsigned_encoding + (block_header.shell, protocol_data.contents) + in + if + Tezos_crypto.Signature.check + ~watermark: + Alpha_context.Block_header.(to_watermark (Block_header chain_id)) + public_key + protocol_data.signature + unsigned_header + then return_unit + else + failwith + "unexpected signature for %a; tried with %a@." + Tezos_crypto.Block_hash.pp + block_hash + Tezos_crypto.Signature.Public_key.pp + public_key + +type op_predicate = + Tezos_crypto.Operation_hash.t -> + Alpha_context.packed_operation -> + bool tzresult Lwt.t + +let mempool_count_ops ~mempool ~predicate = + List.map_es (fun (op_hash, op) -> predicate op_hash op) mempool + >>=? fun results -> + return + (List.fold_left + (fun acc result -> if result then acc + 1 else acc) + 0 + results) + +let mempool_has_op ~mempool ~predicate = + mempool_count_ops ~mempool ~predicate >>=? fun n -> return (n > 0) + +let mempool_has_op_ref ~mempool ~predicate ~var = + mempool_has_op ~mempool ~predicate >>=? fun result -> + if result then var := true ; + return_unit + +let op_is_signed_by ~public_key (op_hash : Tezos_crypto.Operation_hash.t) + (op : Alpha_context.packed_operation) = + match op.protocol_data with + | Operation_data d -> ( + (match d.contents with + | Single op_contents -> + return + (match op_contents with + | Endorsement _ -> + Alpha_context.Operation.to_watermark (Endorsement chain_id) + | Preendorsement _ -> + Alpha_context.Operation.to_watermark (Preendorsement chain_id) + | _ -> Tezos_crypto.Signature.Generic_operation) + | _ -> + failwith + "unexpected contents in %a@." + Tezos_crypto.Operation_hash.pp + op_hash) + >>=? fun watermark -> + match d.signature with + | None -> + failwith + "did not find a signature for op %a@." + Tezos_crypto.Operation_hash.pp + op_hash + | Some signature -> + let unsigned_operation_bytes = + Data_encoding.Binary.to_bytes_exn + Protocol.Alpha_context.Operation.unsigned_encoding + (op.shell, Contents_list d.contents) + in + return + (Tezos_crypto.Signature.check + ~watermark + public_key + signature + unsigned_operation_bytes)) + +let op_is_preendorsement ?level ?round (op_hash : Tezos_crypto.Operation_hash.t) + (op : Alpha_context.packed_operation) = + match op.protocol_data with + | Operation_data d -> ( + match d.contents with + | Single op_contents -> ( + match op_contents with + | Preendorsement consensus_content -> + let right_level = + match level with + | None -> true + | Some expected_level -> + Int32.equal + (Alpha_context.Raw_level.to_int32 consensus_content.level) + expected_level + in + let right_round = + match round with + | None -> true + | Some expected_round -> + Int32.equal + (Alpha_context.Round.to_int32 consensus_content.round) + expected_round + in + return (right_level && right_round) + | _ -> return false) + | _ -> + failwith + "unexpected contents in %a@." + Tezos_crypto.Operation_hash.pp + op_hash) + +let op_is_endorsement ?level ?round (op_hash : Tezos_crypto.Operation_hash.t) + (op : Alpha_context.packed_operation) = + match op.protocol_data with + | Operation_data d -> ( + match d.contents with + | Single op_contents -> ( + match op_contents with + | Endorsement consensus_content -> + let right_level = + match level with + | None -> true + | Some expected_level -> + Int32.equal + (Alpha_context.Raw_level.to_int32 consensus_content.level) + expected_level + in + let right_round = + match round with + | None -> true + | Some expected_round -> + Int32.equal + (Alpha_context.Round.to_int32 consensus_content.round) + expected_round + in + return (right_level && right_round) + | _ -> return false) + | _ -> + failwith + "unexpected contents in %a@." + Tezos_crypto.Operation_hash.pp + op_hash) + +let op_is_both f g op_hash op = + f op_hash op >>=? fun f_result -> + if f_result then g op_hash op else return false + +let save_proposal_payload + ~(protocol_data : Alpha_context.Block_header.protocol_data) ~var = + var := + Some + (protocol_data.contents.payload_hash, protocol_data.contents.payload_round) ; + return_unit + +let verify_payload_hash + ~(protocol_data : Alpha_context.Block_header.protocol_data) + ~original_proposal ~message = + match !original_proposal with + | None -> + failwith + "verify_payload_hash: expected to have observed a proposal by now" + | Some (original_hash, original_round) -> + if + Protocol.Block_payload_hash.equal + original_hash + protocol_data.contents.payload_hash + && Protocol.Alpha_context.Round.equal + original_round + protocol_data.contents.payload_round + then return_unit + else failwith "verify_payload_hash: %s" message + +let get_block_round block = + round_from_raw_fitness block.rpc_context.block_header.fitness diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.mli b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.mli new file mode 100644 index 000000000000..ef4db4d8b7cb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/mockup_simulator.mli @@ -0,0 +1,257 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Representation of a block in the simulator. *) +type block = { + rpc_context : Tezos_protocol_environment.rpc_context; + protocol_data : Protocol.Alpha_context.Block_header.protocol_data; + raw_protocol_data : Bytes.t; + operations : Mockup.M.Block_services.operation list list; + resulting_context_hash : Tezos_crypto.Context_hash.t; +} + +(** Chain is a list of blocks. *) +type chain = block list + +(** How an operation or block should propagate through the network. *) +type propagation = + | Block (** Block the operation/block, it'll never be delivered. *) + | Pass (** Pass the operation/block as is. *) + | Delay of float + (** Delay the operation/block for the given number of seconds. *) + +(** Values of this type specify to which bakers a block or operation should + be delivered. *) +type propagation_vector = propagation list + +(** The way to control behavior of a mockup node. *) +module type Hooks = sig + (** This function is called on injection of a block by a particular baker. + It allows us to inspect, change, or discard the block. Calling the + injection RPC and actually updating the state of the mockup node are + two different operations. Normally the first entails the latter, but + not always. In particular, the [propagation_vector] controls what + bakers will see and incorporate the block. *) + val on_inject_block : + level:int32 -> + round:int32 -> + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + operations:Operation.t list list -> + protocol_data:Alpha_context.Block_header.protocol_data -> + (Tezos_crypto.Block_hash.t + * Block_header.t + * Operation.t list list + * propagation_vector) + tzresult + Lwt.t + + (** This function is called on injection of an operation. It is similar + to [on_inject_block], which see. *) + val on_inject_operation : + op_hash:Tezos_crypto.Operation_hash.t -> + op:Alpha_context.packed_operation -> + (Tezos_crypto.Operation_hash.t + * Alpha_context.packed_operation + * propagation_vector) + tzresult + Lwt.t + + (** This is called when a new head is going to be sent as the response to + a "monitor heads" RPC call. Returning [None] here terminates the + process for the baker. *) + val on_new_head : + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + (Tezos_crypto.Block_hash.t * Block_header.t) option Lwt.t + + (** This is called when a new operation is going to be sent as the + response to a "monitor operations" RPC call. Returning [None] here + indicates that the node has advanced to the next level. *) + val on_new_operation : + Tezos_crypto.Operation_hash.t * Alpha_context.packed_operation -> + (Tezos_crypto.Operation_hash.t * Alpha_context.packed_operation) option + Lwt.t + + (** Check a block before processing it in the mockup. *) + val check_block_before_processing : + level:int32 -> + round:int32 -> + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + protocol_data:Alpha_context.Block_header.protocol_data -> + unit tzresult Lwt.t + + (** Check the chain after processing a proposal. *) + val check_chain_after_processing : + level:int32 -> round:int32 -> chain:chain -> unit tzresult Lwt.t + + (** Check operations in the mempool after injecting an operation. *) + val check_mempool_after_processing : + mempool:(Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list -> + unit tzresult Lwt.t + + (** This hook is used to decide when the baker is supposed to shut down. + It is triggered by receiving an event. *) + val stop_on_event : Baking_state.event -> bool + + (** This hook is used to gather information on the baker when it is + started (usually recording for later use). The first argument + [baker_position], is the position of the baker in the list of + bakers that were started for this run. *) + val on_start_baker : + baker_position:int -> + delegates:Baking_state.consensus_key list -> + cctxt:Protocol_client_context.full -> + unit Lwt.t + + (** Check to run on the chain upon successful termination. *) + val check_chain_on_success : chain:chain -> unit tzresult Lwt.t +end + +(** The default hook implementation. *) +module Default_hooks : Hooks + +(** Simulation configuration. *) +type config = { + debug : bool; + (** Whether to initialize the event system in order to display + information about the progress of the simulation. *) + round0 : int64; (** Duration of the round 0 in seconds. *) + round1 : int64; (** Duration of the round 1 in seconds. *) + timeout : int; + (** Maximal duration of the test. If the test takes + longer to terminate it'll be aborted with an + error. *) + delegate_selection : + (int32 * (int32 * Tezos_crypto.Signature.public_key_hash) list) list; + (** Desired selection of delegates per level/round *) + initial_seed : State_hash.t option; + (** Optional initial seed for protocol (used to control delegate selection) *) + consensus_committee_size : int; + (** Size of the committee for tenderbake in number of slots *) + consensus_threshold : int; + (** Threshold, in number of slots, for the quorum to be considered + reached. Should be [2 * consensus_committee_size / 3 + 1] in + usual setting for tenderbake. *) +} + +(** Default configuration. *) +val default_config : config + +(** [run spec] runs a simulation according to the [spec]. Elements of [spec] + describe bakers: how many delegate each baker has and how it behaves. The + total number of delegates cannot exceed 5 for now (it is easy to increase + this limit). The delegates are assigned in order, gradually exhausting + the standard bootstrap accounts. For example, if the first baker has 3 + delegates and the second one has 2 delegates, we have the following + distribution of bootstrap accounts: + + Baker no. 1: bootstrap1, bootstrap2, bootstrap3 + + Baker no. 2: bootstrap4, bootstrap5 + + A simulation continues till all nodes finish either with an error or + successfully. If at least one node finishes with an error, it propagates + to the final result. *) +val run : ?config:config -> (int * (module Hooks)) list -> unit tzresult Lwt.t + +val bootstrap1 : Tezos_crypto.Signature.public_key + +val bootstrap2 : Tezos_crypto.Signature.public_key + +val bootstrap3 : Tezos_crypto.Signature.public_key + +val bootstrap4 : Tezos_crypto.Signature.public_key + +val bootstrap5 : Tezos_crypto.Signature.public_key + +(** Check if a block header is signed by a given delegate. *) +val check_block_signature : + block_hash:Tezos_crypto.Block_hash.t -> + block_header:Block_header.t -> + public_key:Tezos_crypto.Signature.public_key -> + unit tzresult Lwt.t + +(** A shortcut type for predicates on operations. *) +type op_predicate = + Tezos_crypto.Operation_hash.t -> + Alpha_context.packed_operation -> + bool tzresult Lwt.t + +(** Count the number of operations in the mempool that satisfy the given + predicate. *) +val mempool_count_ops : + mempool:(Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list -> + predicate:op_predicate -> + int tzresult Lwt.t + +(** Check if the mempool has at least one operation that satisfies the given + predicate. *) +val mempool_has_op : + mempool:(Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list -> + predicate:op_predicate -> + bool tzresult Lwt.t + +(** Similar to [mempool_has_op] but instead of returning a [bool] it sets + the given [bool ref]. *) +val mempool_has_op_ref : + mempool:(Tezos_crypto.Operation_hash.t * Mockup.M.Protocol.operation) list -> + predicate:op_predicate -> + var:bool ref -> + unit tzresult Lwt.t + +(** Check if an operation is signed by the given delegate. *) +val op_is_signed_by : + public_key:Tezos_crypto.Signature.public_key -> op_predicate + +(** Check that an operation is a preendorsement. *) +val op_is_preendorsement : ?level:int32 -> ?round:int32 -> op_predicate + +(** Check that an operation is an endorsement. *) +val op_is_endorsement : ?level:int32 -> ?round:int32 -> op_predicate + +(** Combine two predicates. *) +val op_is_both : op_predicate -> op_predicate -> op_predicate + +(** Set the given variable to save payload hash and payload round. *) +val save_proposal_payload : + protocol_data:Alpha_context.Block_header.protocol_data -> + var:(Block_payload_hash.t * Alpha_context.Round.t) option ref -> + unit tzresult Lwt.t + +(** Check that payload hashes match, fail if it is not the case. *) +val verify_payload_hash : + protocol_data:Alpha_context.Block_header.protocol_data -> + original_proposal:(Block_payload_hash.t * Alpha_context.Round.t) option ref -> + message:string -> + unit tzresult Lwt.t + +(** Parse protocol data. *) +val parse_protocol_data : + Bytes.t -> Alpha_context.Block_header.protocol_data tzresult Lwt.t + +(** Get round of a block. *) +val get_block_round : block -> int32 tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune new file mode 100644 index 000000000000..aec676a97675 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune @@ -0,0 +1,22 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name tenderbrute_main) + (libraries + tezos-base + tezos-client-base + tezos-client-alpha + tezos-protocol-alpha + tezos-baking-alpha.tenderbrute) + (link_flags + (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base + -open Tezos_client_base + -open Tezos_client_alpha + -open Tezos_protocol_alpha + -open Tenderbrute_alpha)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune new file mode 100644 index 000000000000..bdeb6478d39c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune @@ -0,0 +1,22 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tenderbrute_alpha) + (public_name tezos-baking-alpha.tenderbrute) + (libraries + data-encoding + tezos-base + tezos-base.unix + tezos-protocol-alpha + tezos-client-base + tezos-client-alpha) + (flags + (:standard) + -open Data_encoding + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base + -open Tezos_protocol_alpha + -open Tezos_client_base + -open Tezos_client_alpha)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.ml b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.ml new file mode 100644 index 000000000000..fdc0a6dc5abb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.ml @@ -0,0 +1,202 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +type delegate_selection = + (Raw_level_repr.t + * (Round_repr.t * Tezos_crypto.Signature.public_key_hash) list) + list + +module LevelRoundMap = Map.Make (struct + type t = Level_repr.t * Round_repr.t + + let compare (l1, r1) (l2, r2) = + Stdlib.compare + (Raw_level_repr.to_int32 l1.Level_repr.level, Round_repr.to_int32 r1) + (Raw_level_repr.to_int32 l2.Level_repr.level, Round_repr.to_int32 r2) +end) + +let _ = Client_keys.register_signer (module Tezos_signer_backends.Unencrypted) + +(* Initialize a context in memory with the Mockup *) +let init_context ?constants_overrides_json ?bootstrap_accounts_json parameters = + let parameters = + Data_encoding.Binary.of_bytes_exn Mockup.M.parameters_encoding + @@ Data_encoding.Binary.to_bytes_exn + Mockup.Protocol_parameters.encoding + parameters + in + Mockup.M.init + ~cctxt:Client_context.null_printer + ~parameters + ~constants_overrides_json + ~bootstrap_accounts_json + >>=? fun mockup_init -> + let ctxt = mockup_init.rpc_context.context in + let timestamp = Time.Protocol.of_seconds 0L in + (* The timestamp is irrelevant for the rights *) + Raw_context.prepare ctxt ~level:1l ~predecessor_timestamp:timestamp ~timestamp + >|= Environment.wrap_tzresult + +(* Change the initial seed for the first preserved cycles. This suppose that the + seeds for these cycles are already set, which is the case because this + function is always called after {!init_context}. *) +let change_seed ?initial_seed ctxt = + let preserved = Constants_storage.preserved_cycles ctxt in + List.fold_left_es + (fun (c, ctxt) seed -> + let cycle = Cycle_repr.of_int32_exn (Int32.of_int c) in + Storage.Seed.For_cycle.remove_existing ctxt cycle >>=? fun ctxt -> + Storage.Seed.For_cycle.init ctxt cycle seed >|=? fun ctxt -> (c + 1, ctxt)) + (0, ctxt) + (Seed_repr.initial_seeds ?initial_seed (preserved + 2)) + >|=? snd + +let init ?constants_overrides_json ?bootstrap_accounts_json parameters = + init_context ?constants_overrides_json ?bootstrap_accounts_json parameters + >>=? fun ctxt -> + let blocks_per_cycle = Constants_storage.blocks_per_cycle ctxt in + let blocks_per_commitment = Constants_storage.blocks_per_commitment ctxt in + let cycle_eras = + [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 0l; + first_cycle = Cycle_repr.root; + blocks_per_cycle; + blocks_per_commitment; + }; + ] + in + Level_repr.create_cycle_eras cycle_eras |> Environment.wrap_tzresult + >>?= fun cycle_eras -> return (ctxt, cycle_eras) + +(* Check if the given selection correponds to the baking rights assigned by the + protocol (with the initial seeds registered in the context). Returns [true] + when the selection is the one of the protocol or [false] otherwise. *) +let check ctxt ~selection = + Lwt.catch + (fun () -> + LevelRoundMap.fold_es + (fun (level, round) delegate ctxt -> + Delegate_sampler.baking_rights_owner ctxt level ~round + >|= Environment.wrap_tzresult + >>=? fun (ctxt, _, pk) -> + if + not + (Tezos_crypto.Signature.Public_key_hash.equal + delegate + pk.delegate) + then raise Exit + else return ctxt) + selection + ctxt + >>=? fun _ctxt -> return_true) + (function Exit -> return_false | e -> raise e) + +(* Create random 32 bytes *) +let rnd_bytes32 () = + let b1 = Random.int64 Int64.max_int in + let b2 = Random.int64 Int64.max_int in + let b3 = Random.int64 Int64.max_int in + let b4 = Random.int64 Int64.max_int in + let b = Bytes.make 32 '\000' in + TzEndian.set_int64 b 0 b1 ; + TzEndian.set_int64 b 8 b2 ; + TzEndian.set_int64 b 16 b3 ; + TzEndian.set_int64 b 24 b4 ; + b + +let mk_selection_map cycle_eras selection = + List.fold_left + (fun acc (level, round_delegates) -> + let level = Level_repr.level_from_raw ~cycle_eras level in + List.fold_left + (fun acc (round, delegate) -> + if LevelRoundMap.mem (level, round) acc then + Stdlib.failwith "Duplicate level/round" ; + LevelRoundMap.add (level, round) delegate acc) + acc + round_delegates) + LevelRoundMap.empty + selection + +(* Bruteforce an initial seed nonce for the desired delegate selection *) +let bruteforce ?(show_progress = false) ?(random_seed = 0) ?max + ?(parameters = Mockup.Protocol_parameters.default_value) + ?constants_overrides_json ?bootstrap_accounts_json selection = + Random.init random_seed ; + init ?constants_overrides_json ?bootstrap_accounts_json parameters + >>=? fun (ctxt, cycle_eras) -> + let selection = mk_selection_map cycle_eras selection in + let last_nb_chars = ref 0 in + let frames = + [| + "( ● )"; + "( ● )"; + "( ● )"; + "( ● )"; + "( ●)"; + "( ● )"; + "( ● )"; + "( ● )"; + "( ● )"; + "(● )"; + |] + in + let nframes = Array.length frames in + let frame n = frames.(n mod nframes) in + let rec loop n = + if show_progress && n <> 0 && n mod 10_000 = 0 then ( + Format.eprintf "%s" (String.make !last_nb_chars '\b') ; + let s = frame (n / 10_000) ^ " " ^ string_of_int n in + last_nb_chars := String.length s ; + Format.eprintf "%s%!" s) ; + match max with + | Some max when n > max -> failwith "Did not find seed nonce" + | _ -> ( + let initial_seed = + if n = 0 then None + else Some (State_hash.of_bytes_exn (rnd_bytes32 ())) + in + change_seed ?initial_seed ctxt >|= Environment.wrap_tzresult + >>=? fun ctxt -> + check ctxt ~selection >>=? function + | true -> + Format.eprintf "%s%!" (String.make !last_nb_chars '\b') ; + return initial_seed + | false -> loop (n + 1)) + in + loop 0 + +(* Check that an initial seed corresonds to the desired delegate selection *) +let check_seed ?(parameters = Mockup.Protocol_parameters.default_value) + ?constants_overrides_json ?bootstrap_accounts_json ~seed selection = + init ?constants_overrides_json ?bootstrap_accounts_json parameters + >>=? fun (ctxt, cycle_eras) -> + let selection = mk_selection_map cycle_eras selection in + change_seed ?initial_seed:seed ctxt >|= Environment.wrap_tzresult + >>=? fun ctxt -> check ctxt ~selection diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.mli b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.mli new file mode 100644 index 000000000000..c13cc23edb60 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/tenderbrute.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** The type of desired delegate selection. For each level, and each round, + one can provide a public key hash that would be the proposer. All non- + specified level and rounds are not constrained. *) +type delegate_selection = + (Raw_level_repr.t + * (Round_repr.t * Tezos_crypto.Signature.public_key_hash) list) + list + +(** Brute-force an initial seed nonce for the desired delegate selection. + When found, the seed nonce is returned as a byte sequence of size 32. If + no nonce is necessary to obtain the desired selection, [None] is returned + (there won't be any brute-forcing then). + + {b Note}: When using this function in your tests, take care of saving the + nonce once it is found locallty (in this case call {!check_seed_nonce} to + ensure it yields the desired selection) to avoid unnecessary computation + (in particular this function should not be called in the CI). + + @param show_progress if [true], display a spinner and the number of iterations + on the output (stderr) while [brutefore] is running. + @param random_seed initialize OCaml's random number generator with this seed + (by default [0]). This is useful to spawn multiple bruteforce in + parallel or on multiple machines. + @param constants_overrides_json JSON representation of some constants that are + to be overwritten for the in-memory context. The most useful change is to + set the size of cycles (which directly impacts the attribution of rights) or + the committee size with {i e.g.} + {[ { "blocks_per_cycle" : 8, "consensus_committee_size" : 25 } ]} + @param bootstrap_accounts_json JSON representation of bootstrap accounts of + the form: + {[ + [ { "name" : "bootstrap1" + "sk_uri": "unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh", + "amount": "3000000000000" }, + ...] + ]} + @param parameters parameters of the protocol (optional). + @param selection is the desired delegate selection. See {!delegate_selection}. + *) +val bruteforce : + ?show_progress:bool -> + ?random_seed:int -> + ?max:int -> + ?parameters:Mockup.Protocol_parameters.t -> + ?constants_overrides_json:json -> + ?bootstrap_accounts_json:json -> + delegate_selection -> + State_hash.t option tzresult Lwt.t + +(** Check that an initial seed nonce yields to the desired delegate selection. + See {!bruteforce} for the arguments. *) +val check_seed : + ?parameters:Mockup.Protocol_parameters.t -> + ?constants_overrides_json:json -> + ?bootstrap_accounts_json:json -> + seed:State_hash.t option -> + delegate_selection -> + bool tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/tenderbrute_main.ml b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/tenderbrute_main.ml new file mode 100644 index 000000000000..123db4e59248 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/tenderbrute_main.ml @@ -0,0 +1,169 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let bootstrap_accounts = ref None + +let constants_overrides = ref None + +let selection = ref [] + +let max = ref None + +let random_seed = ref None + +let report_err res = + match res with + | Error e -> + Format.eprintf "\n%a@." Error_monad.pp_print_trace e ; + exit 2 + | Ok res -> res + +let delegate_encoding = + let open Data_encoding in + union + [ + case + ~title:"Public key hash" + (Tag 0) + Tezos_crypto.Signature.Public_key_hash.encoding + (function `Pkh p -> Some p | _ -> None) + (fun p -> `Pkh p); + case + ~title:"Alias" + (Tag 1) + string + (function `Alias a -> Some a | _ -> None) + (fun a -> `Alias a); + ] + +let selection_encoding = + let open Data_encoding in + list + (tup2 + Raw_level_repr.encoding + (list (tup2 Round_repr.encoding delegate_encoding))) + +let mk_bootstrap_aliases bootstrap_accounts_json = + let parameters = Mockup.Protocol_parameters.default_value in + let open Alpha_context.Parameters in + match bootstrap_accounts_json with + | None -> + List.mapi + (fun i a -> (Format.sprintf "bootstrap%d" i, a.public_key_hash)) + parameters.bootstrap_accounts + |> return + | Some j -> + let open Data_encoding in + let accounts = Json.destruct (list Mockup.Parsed_account.encoding) j in + List.map_ep + (fun a -> + Mockup.Parsed_account.to_bootstrap_account a >|=? fun acc -> + (a.name, acc.public_key_hash)) + accounts + +let selection_to_pkhs bootstrap_accounts_json selection = + mk_bootstrap_aliases bootstrap_accounts_json >|=? fun bootstrap_aliases -> + List.map + (fun (level, l) -> + ( level, + List.map + (fun (round, d) -> + ( round, + match d with + | `Pkh d -> d + | `Alias a -> ( + match List.assoc ~equal:String.equal a bootstrap_aliases with + | None -> Stdlib.failwith @@ "Unknown alias " ^ a + | Some d -> d) )) + l )) + selection + +let parse_json_or_file s = + Tezos_stdlib_unix.Lwt_utils_unix.Json.read_file s >|= function + | Ok json -> Ok json + | Error errs -> ( + match Data_encoding.Json.from_string s with + | Ok json -> Ok json + | Error e -> Error (Exn (Failure e) :: errs)) + +let set_selection s = + Lwt_main.run + ( parse_json_or_file s >|= report_err >|= fun json -> + selection := Data_encoding.Json.destruct selection_encoding json ) + +let main () = + let thread = + (match !bootstrap_accounts with + | None -> return_none + | Some read -> read >|=? Option.some) + >>=? fun bootstrap_accounts_json -> + (match !constants_overrides with + | None -> return_none + | Some read -> read >|=? Option.some) + >>=? fun constants_overrides_json -> + selection_to_pkhs bootstrap_accounts_json !selection >>=? fun selection -> + Tenderbrute.bruteforce + ~show_progress:true + ?max:!max + ?random_seed:!random_seed + ?bootstrap_accounts_json + ?constants_overrides_json + selection + in + Lwt_main.run + ( thread >|= report_err >|= fun seed -> + let seed_str = + match seed with None -> "None" | Some s -> State_hash.to_b58check s + in + Format.printf "%s@." seed_str ) + +let specs = + [ + ( "--max", + Arg.Int (fun m -> max := Some m), + "<m> set maximum number of tries to <m>" ); + ( "--random-seed", + Arg.Int (fun i -> random_seed := Some i), + "<i> initialize the random generator with <i> (useful to spawn mutliple \ + instances)" ); + ( "--constants-overrides", + Arg.String (fun s -> constants_overrides := Some (parse_json_or_file s)), + "<json|file> set overrides for constants in protocol parameters (e.g. \ + blocks_per_cycle)" ); + ( "--bootstrap-accounts", + Arg.String (fun s -> bootstrap_accounts := Some (parse_json_or_file s)), + "<json|file> set bootstrap accounts of protocol" ); + ] + +let usage = + Format.sprintf + {|usage: %s '[[1, [[0, "tz1..."], [1, "tz1..."]]], [2, [[0, "tz1..."]]]]'|} + Sys.argv.(0) + +let () = + Arg.parse (Arg.align specs) set_selection usage ; + main () diff --git a/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml new file mode 100644 index 000000000000..f10b60904c24 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml @@ -0,0 +1,1479 @@ +open Mockup_simulator + +let bootstrap1 = Tezos_crypto.Signature.Public_key.hash bootstrap1 + +let bootstrap2 = Tezos_crypto.Signature.Public_key.hash bootstrap2 + +let bootstrap3 = Tezos_crypto.Signature.Public_key.hash bootstrap3 + +let bootstrap4 = Tezos_crypto.Signature.Public_key.hash bootstrap4 + +let bootstrap5 = Tezos_crypto.Signature.Public_key.hash bootstrap5 + +let some_seed s = Some (Protocol.State_hash.of_b58check_exn s) + +(* + +Test that the chain reaches the 5th level. + +*) + +let test_level_5 () = + let level_to_reach = 5l in + let module Hooks : Hooks = struct + include Default_hooks + + let stop_on_event = function + | Baking_state.New_proposal {block; _} -> + (* Stop the node as soon as we receive a proposal with a level + higher than [level_to_reach]. *) + block.shell.level > level_to_reach + | _ -> false + + let check_chain_on_success ~chain = + (* Make sure that all decided blocks have been decided at round 0. *) + let round_is_zero block = + let level = block.rpc_context.block_header.level in + get_block_round block >>=? fun round -> + if Int32.equal round 0l then return () + else failwith "block at level %ld was selected at round %ld" level round + in + List.iter_es round_is_zero chain + end in + (* Here we start two bakers, one with 3 delegates (bootstrap1, bootstrap2, + bootstrap3) and the other with 2 delegates (bootstrap4, bootstrap5). + The simulation continues till both nodes stop, see [stop_on_event] + above. *) + let config = + { + default_config with + timeout = Int32.to_int level_to_reach * 3 * 2; + round0 = 2L; + round1 = 3L; + } + in + run ~config [(3, (module Hooks)); (2, (module Hooks))] + +(* + +Scenario T1 + +1. Node A proposes at the round 0. +2. Both node A and node B preendorse. +3. Node A stops. +4. Node B endorses in the round 0 and locks. No decision is taken at the + round 0 because A did not endorse. +5. We check that in round 1 (the next slot for B), B proposes the same + value as A proposed in the round 0, not a new proposal. +*) + +let test_scenario_t1 () = + let original_proposal = ref None in + let a_preendorsed = ref false in + let b_preendorsed = ref false in + let b_endorsed = ref false in + let b_reproposed = ref false in + (* Here we use custom hooks to make each node/baker behave according to + its role in the scenario. *) + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let check_mempool_after_processing ~mempool = + mempool_has_op_ref + ~mempool + ~predicate: + (op_is_both + (op_is_signed_by ~public_key:Mockup_simulator.bootstrap1) + (op_is_preendorsement ~level:1l ~round:0l)) + ~var:a_preendorsed + + let stop_on_event _ = !a_preendorsed + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let check_block_before_processing ~level ~round ~block_hash ~block_header + ~(protocol_data : Protocol.Alpha_context.Block_header.protocol_data) = + (match (!b_endorsed, level, round) with + | false, 1l, 0l -> + (* If any of the checks fails the whole scenario will fail. *) + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap1 + >>=? fun () -> + save_proposal_payload ~protocol_data ~var:original_proposal + | true, 1l, 1l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap2 + >>=? fun () -> + verify_payload_hash + ~protocol_data + ~original_proposal + ~message:"a new block proposed instead of reproposal" + >>=? fun () -> + b_reproposed := true ; + return_unit + | _ -> failwith "unexpected level = %ld / round = %ld" level round) + >>=? fun () -> return_unit + + let check_mempool_after_processing ~mempool = + mempool_has_op_ref + ~mempool + ~predicate: + (op_is_both + (op_is_signed_by ~public_key:Mockup_simulator.bootstrap2) + (op_is_preendorsement ~level:1l ~round:0l)) + ~var:b_preendorsed + >>=? fun () -> + mempool_has_op_ref + ~mempool + ~predicate: + (op_is_both + (op_is_signed_by ~public_key:Mockup_simulator.bootstrap2) + (op_is_preendorsement ~level:1l ~round:0l)) + ~var:b_endorsed + + let stop_on_event _ = !b_reproposed + end in + let config = + { + default_config with + initial_seed = None; + delegate_selection = [(1l, [(0l, bootstrap1); (1l, bootstrap2)])]; + } + in + run ~config [(1, (module Node_a_hooks)); (1, (module Node_b_hooks))] + +(* + +Scenario T2 + +1. Node A should propose at the round 0, but it is dead. +2. Node B waits til it has its proposal slot at round 1 and proposes then. + +*) + +let test_scenario_t2 () = + let b_proposed = ref false in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let stop_on_event _ = true (* Node A stops immediately. *) + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let check_block_before_processing ~level ~round ~block_hash ~block_header + ~protocol_data:_ = + (* Here we test that the only block that B observes is its own + proposal for level 1 at round 1. *) + match (level, round) with + | 1l, 1l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap2 + >>=? fun () -> + b_proposed := true ; + return_unit + | _ -> failwith "unexpected level = %ld / round = %ld" level round + + let stop_on_event _ = + (* Stop as soon as B has proposed. This ends the test. *) + !b_proposed + end in + let config = + { + default_config with + initial_seed = None; + delegate_selection = [(1l, [(0l, bootstrap1); (1l, bootstrap2)])]; + } + in + run ~config [(1, (module Node_a_hooks)); (1, (module Node_b_hooks))] + +(* + +Scenario T3 + +1. There are four nodes: A, B, C, and D. +2. C is the proposer at the round 0. It sends the proposal, which is + received by all bakers except for D. +3. Due to how the messages propagate, only B sees 3 preendorsements. It + endorses and locks. Other nodes all see fewer than 3 preendorsements. + + A -> A and B + B -> B + C -> C and B + +4. D proposes at the round 1. Its message reaches 3 nodes, including B. + + D -> D, B, C + +5. B does not preendorse because it is locked. +6. No decision is taken at the round 1. +7. B proposes at the round 2. There are no more problems with propagation of + messages, so a decision is reached. + +*) + +let test_scenario_t3 () = + let b_observed_pqc = ref false in + let original_proposal = ref None in + let we_are_done = ref false in + let stop_on_event0 _ = !we_are_done in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_operation ~op_hash ~op = + if !b_observed_pqc then return (op_hash, op, [Pass; Pass; Pass; Pass]) + else + op_is_preendorsement ~level:1l ~round:0l op_hash op + >>=? fun is_preendorsement -> + if is_preendorsement then + return (op_hash, op, [Pass; Pass; Block; Block]) + else failwith "unexpected operation from the node D" + + let stop_on_event = stop_on_event0 + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~(protocol_data : Protocol.Alpha_context.Block_header.protocol_data) = + match (level, round) with + | 1l, 2l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap2 + >>=? fun () -> + we_are_done := true ; + verify_payload_hash + ~protocol_data + ~original_proposal + ~message:"a new block proposed instead of reproposal" + >>=? fun () -> + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + | _ -> + failwith + "unexpected injection on the node B, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + if !b_observed_pqc then return (op_hash, op, [Pass; Pass; Pass; Pass]) + else + op_is_preendorsement ~level:1l ~round:0l op_hash op + >>=? fun is_preendorsement -> + if is_preendorsement then + return (op_hash, op, [Block; Pass; Block; Block]) + else failwith "unexpected operation from the node B" + + let check_mempool_after_processing ~mempool = + let predicate op_hash op = + op_is_preendorsement ~level:1l ~round:0l op_hash op + in + mempool_count_ops ~mempool ~predicate >>=? fun n -> + if n > 3 then + failwith "B received too many preendorsements, expected to see only 3" + else if n = 3 then ( + b_observed_pqc := true ; + return_unit) + else return_unit + + let stop_on_event = stop_on_event0 + end in + let module Node_c_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~(protocol_data : Protocol.Alpha_context.Block_header.protocol_data) = + match (level, round) with + | 1l, 0l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap3 + >>=? fun () -> + save_proposal_payload ~protocol_data ~var:original_proposal + >>=? fun () -> + return + (block_hash, block_header, operations, [Pass; Pass; Pass; Block]) + | _ -> + failwith + "unexpected injection on the node C, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + if !b_observed_pqc then return (op_hash, op, [Pass; Pass; Pass; Pass]) + else + op_is_preendorsement ~level:1l ~round:0l op_hash op + >>=? fun is_preendorsement -> + if is_preendorsement then + return (op_hash, op, [Block; Pass; Pass; Block]) + else failwith "unexpected operation from the node C" + + let stop_on_event = stop_on_event0 + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (level, round) with + | 1l, 1l -> + return + (block_hash, block_header, operations, [Block; Pass; Pass; Pass]) + | _ -> + failwith + "unexpected injection on the node D, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + if !b_observed_pqc then return (op_hash, op, [Pass; Pass; Pass; Pass]) + else return (op_hash, op, [Block; Block; Block; Block]) + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngFtAUcm1EneHCCrxxSWAaxSukwEhSPvpTnFjVdKLEjgkapUy1pP"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap3); + (1l, bootstrap4); + (2l, bootstrap2); + (3l, bootstrap1); + ] ); + ( 2l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Node_c_hooks)); + (1, (module Node_d_hooks)); + ] + +(* + +Scenario F1 + +1. Node C (bootstrap3) proposes at level 1 round 0, its proposal reaches all + nodes. +2. Propagation of preendorsements happens in such a way that only Node A + (bootstrap1) observes PQC: + + A -> A + B -> B and A + C -> C and A + D -> D and A + + Node A locks. + +3. At the level 1 round 1 node D (bootstrap4) proposes. Propagation of + messages is normal. + +4. Node A (bootstrap1) should propose at level 2 round 0. + +*) + +let test_scenario_f1 () = + let c_proposed_l1_r0 = ref false in + let d_proposed_l1_r1 = ref false in + let a_proposed_l2_r0 = ref false in + let stop_on_event0 _ = !a_proposed_l2_r0 in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (!c_proposed_l1_r0, !d_proposed_l1_r1, level, round) with + | true, true, 2l, 0l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap1 + >>=? fun () -> + (a_proposed_l2_r0 := true ; + return_unit) + >>=? fun () -> + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + | _ -> + failwith + "unexpected injection on the node A, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + match (!c_proposed_l1_r0, !d_proposed_l1_r1) with + | true, false -> return (op_hash, op, [Pass; Block; Block; Block]) + | _ -> return (op_hash, op, [Pass; Pass; Pass; Pass]) + + let stop_on_event = stop_on_event0 + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let on_inject_operation ~op_hash ~op = + match (!c_proposed_l1_r0, !d_proposed_l1_r1) with + | true, false -> return (op_hash, op, [Pass; Pass; Block; Block]) + | _ -> return (op_hash, op, [Pass; Pass; Pass; Pass]) + + let stop_on_event = stop_on_event0 + end in + let module Node_c_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (!c_proposed_l1_r0, !d_proposed_l1_r1, level, round) with + | false, false, 1l, 0l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap3 + >>=? fun () -> + (c_proposed_l1_r0 := true ; + return_unit) + >>=? fun () -> + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + | _ -> + failwith + "unexpected injection on the node C, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + match (!c_proposed_l1_r0, !d_proposed_l1_r1) with + | true, false -> return (op_hash, op, [Pass; Block; Pass; Block]) + | _ -> return (op_hash, op, [Pass; Pass; Pass; Pass]) + + let stop_on_event = stop_on_event0 + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (!d_proposed_l1_r1, level, round) with + | false, 1l, 1l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap4 + >>=? fun () -> + (d_proposed_l1_r1 := true ; + return_unit) + >>=? fun () -> + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + | _ -> + failwith + "unexpected injection on the node D, level = %ld / round = %ld" + level + round + + let on_inject_operation ~op_hash ~op = + match (!c_proposed_l1_r0, !d_proposed_l1_r1) with + | true, false -> return (op_hash, op, [Pass; Block; Block; Pass]) + | _ -> return (op_hash, op, [Pass; Pass; Pass; Pass]) + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGohKUZjXzv69sxvDqAYRd4XPDQSxDoEpP72znu2jduBuhcYiSE"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap3); + (1l, bootstrap4); + (2l, bootstrap1); + (3l, bootstrap2); + ] ); + ( 2l, + [ + (0l, bootstrap1); + (1l, bootstrap4); + (2l, bootstrap2); + (3l, bootstrap3); + ] ); + ]; + timeout = 60; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Node_c_hooks)); + (1, (module Node_d_hooks)); + ] + +(* + +Scenario F2 + +1. There are four nodes: A, B, C, and D. +2. A proposes at 1.0 and observes EQC. +3. A has the slot at 2.0 but somehow it doesn't propose or its proposal is lost. +4. B, C, and D have the rounds 1, 2, and 3 respectively, but they also do not propose. +5. A should still propose at 2.4. + +*) + +let test_scenario_f2 () = + let proposal_2_4_observed = ref false in + let module Hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + match (level, round) with + | 1l, 0l -> [Pass; Pass; Pass; Pass] + | 2l, 0l -> [Pass; Block; Block; Block] + | 2l, 4l -> + proposal_2_4_observed := true ; + [Pass; Pass; Pass; Pass] + | _ -> [Block; Block; Block; Block] + in + return (block_hash, block_header, operations, propagation_vector) + + let stop_on_event _ = !proposal_2_4_observed + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGPSm87ZqWxJmZu7rewiLiyKY72ffCQQvxDuWmFBw59dWAL5VTB"; + delegate_selection = + [ + (1l, [(0l, bootstrap1)]); + ( 2l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + (4l, bootstrap1); + ] ); + ]; + timeout = 60; + round0 = 2L; + round1 = 3L; + } + in + run + ~config + [ + (1, (module Hooks)); + (1, (module Hooks)); + (1, (module Hooks)); + (1, (module Hooks)); + ] + +(* + +Scenario M1 + +1. Four nodes start, each with 1 delegate. +2. As soon as 2nd level is proposed all communication between nodes becomes + impossible. +3. The situation continues for 5 seconds. +4. After communication is resumed the bakers must continue making progress. + +*) + +let test_scenario_m1 () = + let observed_level2_timestamp = ref None in + let network_down_sec = 5. in + let module Hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + match !observed_level2_timestamp with + | None -> + if Compare.Int32.(level >= 2l) then ( + observed_level2_timestamp := Some (Unix.time ()) ; + [Pass; Pass; Pass; Pass]) + else [Pass; Pass; Pass; Pass] + | Some level2_observed -> + if Unix.time () -. level2_observed < network_down_sec then + [Block; Block; Block; Block] + else [Pass; Pass; Pass; Pass] + in + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation ~op_hash ~op = + let propagation_vector = + match !observed_level2_timestamp with + | None -> [Pass; Pass; Pass; Pass] + | Some level2_observed -> + if Unix.time () -. level2_observed < network_down_sec then + [Block; Block; Block; Block] + else [Pass; Pass; Pass; Pass] + in + return (op_hash, op, propagation_vector) + + let stop_on_event = function + | Baking_state.New_proposal {block; _} -> block.shell.level > 4l + | _ -> false + end in + let config = {default_config with timeout = 60} in + run + ~config + [ + (1, (module Hooks)); + (1, (module Hooks)); + (1, (module Hooks)); + (1, (module Hooks)); + ] + +(* + +Scenario M2 + +1. Five nodes start (single delegate per node). +2. They decide level 1. +3. However, the node that has the slot for level 2 round 0 is not there + to participate. +4. We check that the chain continues advancing despite that. + +*) + +let test_scenario_m2 () = + let module Normal_node : Hooks = struct + include Default_hooks + + let stop_on_event = function + | Baking_state.New_proposal {block; _} -> block.shell.level > 5l + | _ -> false + end in + let module Missing_node : Hooks = struct + include Default_hooks + + let stop_on_event _ = true (* stop immediately *) + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGo77zNC59bYiQMk2M14aDZZu4KXG8BV1C8pi7afjJ7cXyqB3M1"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ( 2l, + [ + (0l, bootstrap5); + (1l, bootstrap1); + (2l, bootstrap2); + (3l, bootstrap3); + (4l, bootstrap4); + ] ); + ]; + round0 = 2L; + round1 = 3L; + timeout = 60; + } + in + run + ~config + [ + (1, (module Normal_node)); + (1, (module Normal_node)); + (1, (module Normal_node)); + (1, (module Normal_node)); + (1, (module Missing_node)); + ] + +(* + +Scenario M3 + +1. There are four nodes: A, B, C, and D. +2. A and B propose in turns. Messages from A reach every node, but messages + from other nodes only go to A. +3. The chain should not make progress. Since we have both bootstrap1 and + bootstrap2 in delegate selection they have equal voting power. Therefore + it is necessary to have 2 votes for pre-quorums (which is achieved when A + is proposing) and 2 votes for quorums (impossible because B has no way to + obtain PQC and thus cannot send endorsements). + +*) + +let test_scenario_m3 () = + let stop_on_event0 = function + | Baking_state.New_proposal {block; _} -> + block.shell.level = 1l + && Protocol.Alpha_context.Round.to_int32 block.round = 6l + | _ -> false + in + + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let stop_on_event = stop_on_event0 + end in + let module Other_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, [Pass; Block; Block; Block]) + + let on_inject_operation ~op_hash ~op = + return (op_hash, op, [Pass; Block; Block; Block]) + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGaxNJcwEVJLgQXmnN8KN5skn6fhU4Awtu8zVDKViTd5gsfT51M"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap1); + (3l, bootstrap2); + (4l, bootstrap1); + (5l, bootstrap2); + (6l, bootstrap1); + ] ); + ]; + round0 = 2L; + round1 = 3L; + timeout = 60; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Other_hooks)); + (1, (module Other_hooks)); + (1, (module Other_hooks)); + ] + +(* + +Scenario M4 + +1. There are four bakers: A, B, C, and D. +2. A proposes at level 1 round 0. Its proposal reaches A, B, C, and D, but + with a delay of 0.5 seconds. +3. 3 votes are enough for consensus, because voting powers of all delegates + are equal. Preendorsements propagate freely, however endorsements from C + are blocked. +4. Check that at level 1 round 0 quorum is reached (from the point of view + of A). This means that D sends an endorsement despite receiving + preendorsements before the proposal. + +*) + +let test_scenario_m4 () = + let a_observed_qc = ref false in + let stop_on_event0 _ = !a_observed_qc in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (level, round) with + | 1l, 0l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap1 + >>=? fun () -> + return + (block_hash, block_header, operations, [Pass; Pass; Pass; Delay 0.5]) + | _ -> + failwith + "unexpected injection on the node A, level = %ld / round = %ld" + level + round + + let check_mempool_after_processing ~mempool = + let predicate op_hash op = + op_is_endorsement ~level:1l ~round:0l op_hash op + in + mempool_count_ops ~mempool ~predicate >>=? fun n -> + if n > 3 then + failwith "A received too many endorsements, expected to see only 3" + else if n = 3 then ( + a_observed_qc := true ; + return_unit) + else return_unit + + let stop_on_event = stop_on_event0 + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let stop_on_event = stop_on_event0 + end in + let module Node_c_hooks : Hooks = struct + include Default_hooks + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_endorsement -> + return + ( op_hash, + op, + if is_endorsement then [Block; Block; Block; Block] + else [Pass; Pass; Pass; Pass] ) + + let stop_on_event = stop_on_event0 + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGJmwLi7kPvGwV2LR3kjNQ6xamGPCZ9ooep9QcafbqRXZhYEciT"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Node_c_hooks)); + (1, (module Node_d_hooks)); + ] + +(* + +Scenario M5 + +1. There are four bakers: A, B, C, and D. +2. A proposes at level 1 round 0. Its proposal reaches A, B, C, and D, but with + a delay of 1 second. There are no problems with propagation of + preendorsements and endorsements. +3. At the level 1 all four bakers have proposer slots, however we block possible + proposals from B and C at higher rounds. +4. Check that D proposes at the level 2 round 0, which means that it has + observed QC. + +*) + +let test_scenario_m5 () = + let stop_on_event0 = function + | Baking_state.New_proposal {block; _} -> block.shell.level >= 2l + | _ -> false + in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + match (level, round) with + | 1l, 0l -> + check_block_signature + ~block_hash + ~block_header + ~public_key:Mockup_simulator.bootstrap1 + >>=? fun () -> + return + (block_hash, block_header, operations, [Pass; Pass; Pass; Delay 1.0]) + | _ -> + failwith + "unexpected injection on the node A, level = %ld / round = %ld" + level + round + + let stop_on_event = stop_on_event0 + end in + let module Other_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, [Block; Block; Block; Block]) + + let stop_on_event = stop_on_event0 + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGJmwLi7kPvGwV2LR3kjNQ6xamGPCZ9ooep9QcafbqRXZhYEciT"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + round0 = 3L; + round1 = 4L; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Other_hooks)); + (1, (module Other_hooks)); + (1, (module Node_d_hooks)); + ] + +(* + +Scenario M6 + +1. There are four bakers: A, B, C, and D. +2. A proposes at level 1 round 0. Its proposal reaches all nodes, and they + observe PQC. Only A observes a QC. +3. At level 1 round 1 it is B's turn to propose. Since it has observed the + PQC, it reproposes A's proposal. A does not see it. +4. B observes PQC and QC for its proposal. +5. A proposes at level 2 round 0. No one sees the proposal. +6. B proposes at level 2 round 1. A sees B's proposal and switches its branch. +7. We wait 2 more levels before checking A's chain to verify that it has + adopted B's proposal. + +*) + +let test_scenario_m6 () = + let b_proposal_2_1 = ref None in + let stop_on_event0 = function + | Baking_state.New_proposal {block; _} -> block.shell.level > 4l + | _ -> false + in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + match (level, round) with + | 2l, 0l -> [Pass; Block; Block; Block] + | _ -> [Pass; Pass; Pass; Pass] + in + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + return + ( op_hash, + op, + if is_a10_endorsement then [Pass; Block; Block; Block] + else [Pass; Pass; Pass; Pass] ) + + let stop_on_event = stop_on_event0 + + let check_chain_on_success ~chain = + match List.nth (List.rev chain) 2 with + | None -> failwith "Node A has empty chain" + | Some (block : block) -> + verify_payload_hash + ~protocol_data:block.protocol_data + ~original_proposal:b_proposal_2_1 + ~message:"A did not switch to B's proposal (level 2, round 1)" + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data = + (match (level, round) with + | 1l, 1l -> return [Block; Delay 0.1; Delay 0.1; Delay 0.1] + | 2l, 1l -> + save_proposal_payload ~protocol_data ~var:b_proposal_2_1 + >>=? fun () -> return [Pass; Pass; Pass; Pass] + | _ -> return [Pass; Pass; Pass; Pass]) + >>=? fun propagation_vector -> + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + return + ( op_hash, + op, + if is_a10_endorsement then [Pass; Block; Block; Block] + else [Pass; Pass; Pass; Pass] ) + + let stop_on_event = stop_on_event0 + end in + let module Other_node : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + return + ( op_hash, + op, + if is_a10_endorsement then [Pass; Block; Block; Block] + else [Pass; Pass; Pass; Pass] ) + + let stop_on_event = stop_on_event0 + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGnwG2gApiRzo1kdbCgQheqtZroUsAjsJzyw2RBbtg3gtTeMQ9F"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ( 2l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + timeout = 60; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Other_node)); + (1, (module Other_node)); + ] + +(* + +Scenario M7 + +The same as M6, but: + +5. B proposes at level 2 round 0 (A does not see the proposal). +6. A proposes at 2.1. B switches to A's branch when it receives 2.1. +7. We wait 2 more levels before checking everyone's chain to verify that + A's proposal has been selected. + +*) + +let test_scenario_m7 () = + let a_proposal_2_1 = ref None in + let c_received_2_1 = ref false in + let d_received_2_1 = ref false in + let stop_on_event0 = function + | Baking_state.New_proposal {block; _} -> block.shell.level > 4l + | _ -> false + in + let check_chain_on_success0 node_label ~chain = + match List.nth (List.rev chain) 2 with + | None -> failwith "Node %s has empty chain" node_label + | Some (block : block) -> + verify_payload_hash + ~protocol_data:block.protocol_data + ~original_proposal:a_proposal_2_1 + ~message: + (Format.sprintf + "%s did not switch to A's proposal (level 2, round 1)" + node_label) + in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data = + (match (level, round) with + | 2l, 1l -> save_proposal_payload ~protocol_data ~var:a_proposal_2_1 + | _ -> return_unit) + >>=? fun () -> + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + return + ( op_hash, + op, + if is_a10_endorsement then [Pass; Block; Block; Block] + else [Pass; Pass; Pass; Pass] ) + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "A" + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + (match (level, round) with + | 1l, 1l -> return [Block; Delay 0.1; Delay 0.1; Delay 0.1] + | 2l, 0l -> return [Block; Pass; Pass; Pass] + | _ -> return [Pass; Pass; Pass; Pass]) + >>=? fun propagation_vector -> + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + op_is_preendorsement ~level:2l op_hash op + >>=? fun level2_preendorsement -> + op_is_endorsement ~level:2l op_hash op >>=? fun level2_endorsement -> + let propagation_vector = + match + (is_a10_endorsement, level2_preendorsement, level2_endorsement) + with + | true, _, _ -> [Pass; Block; Block; Block] + | _, true, _ | _, _, true -> [Block; Block; Block; Block] + | _, _, _ -> [Pass; Pass; Pass; Pass] + in + return (op_hash, op, propagation_vector) + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "B" + end in + let module Node_c_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + if !c_received_2_1 then [Pass; Pass; Pass; Pass] + else [Block; Block; Block; Block] + in + return (block_hash, block_header, operations, propagation_vector) + + let check_chain_after_processing ~level ~round ~chain:_ = + match (level, round) with + | 2l, 1l -> + c_received_2_1 := true ; + return_unit + | _ -> return_unit + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + op_is_preendorsement ~level:2l op_hash op + >>=? fun level2_preendorsement -> + op_is_endorsement ~level:2l op_hash op >>=? fun level2_endorsement -> + let propagation_vector = + match + ( is_a10_endorsement, + !c_received_2_1, + level2_preendorsement, + level2_endorsement ) + with + | true, _, _, _ -> [Pass; Block; Block; Block] + | _, false, true, _ | _, false, _, true -> [Block; Block; Block; Block] + | _, _, _, _ -> [Pass; Pass; Pass; Pass] + in + return (op_hash, op, propagation_vector) + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "C" + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + if !d_received_2_1 then [Pass; Pass; Pass; Pass] + else [Block; Block; Block; Block] + in + return (block_hash, block_header, operations, propagation_vector) + + let check_chain_after_processing ~level ~round ~chain:_ = + match (level, round) with + | 2l, 1l -> + d_received_2_1 := true ; + return_unit + | _ -> return_unit + + let on_inject_operation ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + op_is_preendorsement ~level:2l op_hash op + >>=? fun level2_preendorsement -> + op_is_endorsement ~level:2l op_hash op >>=? fun level2_endorsement -> + let propagation_vector = + match + ( is_a10_endorsement, + !d_received_2_1, + level2_preendorsement, + level2_endorsement ) + with + | true, _, _, _ -> [Pass; Block; Block; Block] + | _, false, true, _ | _, false, _, true -> [Block; Block; Block; Block] + | _, _, _, _ -> [Pass; Pass; Pass; Pass] + in + return (op_hash, op, propagation_vector) + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "D" + end in + let config = + { + default_config with + initial_seed = + some_seed "rngGJ7ReXwsjWuzpeqCgHAjudFwJtxdYz44Genz1FnyJ8R226hoKh"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ( 2l, + [ + (0l, bootstrap2); + (1l, bootstrap1); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ]; + timeout = 60; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Node_c_hooks)); + (1, (module Node_d_hooks)); + ] + +(* + +Scenario M8 + +5. B proposes at 2.0 and observes PQC but not QC. +6. C re-proposes at 2.1 and similarly observes PQC but not QC. +7. A proposes at 2.2. B, C, and D do not switch to A's branch; moreover A + switches to their branch when it receives the next proposal (2.3). This + happens because B, C, and D have PQC despite A having a higher round (2 > 1). +8. We wait 2 more levels before checking everyone's chain to verify that + B's proposal has been selected. + +*) + +let test_scenario_m8 () = + let b_proposal_2_0 = ref None in + let stop_on_event0 = function + | Baking_state.New_proposal {block; _} -> block.shell.level > 4l + | _ -> false + in + let on_inject_operation0 ~op_hash ~op = + op_is_endorsement ~level:1l ~round:0l op_hash op + >>=? fun is_a10_endorsement -> + op_is_endorsement ~level:2l ~round:0l op_hash op + >>=? fun is_b20_endorsement -> + op_is_endorsement ~level:2l ~round:1l op_hash op + >>=? fun is_c21_endorsement -> + let propagation_vector = + if is_a10_endorsement then [Pass; Block; Block; Block] + else if is_b20_endorsement || is_c21_endorsement then + [Block; Block; Block; Block] + else [Pass; Pass; Pass; Pass] + in + return (op_hash, op, propagation_vector) + in + let check_chain_on_success0 node_label ~chain = + match List.nth (List.rev chain) 2 with + | None -> failwith "Node %s has empty chain" node_label + | Some (block : block) -> + verify_payload_hash + ~protocol_data:block.protocol_data + ~original_proposal:b_proposal_2_0 + ~message: + (Format.sprintf + "%s did not switch to B's proposal (level 2, round 0)" + node_label) + in + let module Node_a_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + + let on_inject_operation = on_inject_operation0 + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "A" + end in + let module Node_b_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data = + (match (level, round) with + | 1l, 1l -> return [Block; Delay 0.1; Delay 0.1; Delay 0.1] + | 2l, 0l -> + save_proposal_payload ~protocol_data ~var:b_proposal_2_0 + >>=? fun () -> return [Block; Pass; Pass; Pass] + | _ -> return [Pass; Pass; Pass; Pass]) + >>=? fun propagation_vector -> + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation = on_inject_operation0 + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "B" + end in + let module Node_c_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level ~round ~block_hash ~block_header ~operations + ~protocol_data:_ = + let propagation_vector = + match (level, round) with + | 2l, 1l -> [Block; Pass; Pass; Pass] + | _ -> [Pass; Pass; Pass; Pass] + in + return (block_hash, block_header, operations, propagation_vector) + + let on_inject_operation = on_inject_operation0 + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "C" + end in + let module Node_d_hooks : Hooks = struct + include Default_hooks + + let on_inject_block ~level:_ ~round:_ ~block_hash ~block_header ~operations + ~protocol_data:_ = + return (block_hash, block_header, operations, [Pass; Pass; Pass; Pass]) + + let on_inject_operation = on_inject_operation0 + + let stop_on_event = stop_on_event0 + + let check_chain_on_success = check_chain_on_success0 "D" + end in + let config = + { + default_config with + initial_seed = + some_seed "rngFy2zFmgg25SXrE6aawqQVhD1kdw9eCCRxc843RLQjz5MZ6MGER"; + delegate_selection = + [ + ( 1l, + [ + (0l, bootstrap1); + (1l, bootstrap2); + (2l, bootstrap3); + (3l, bootstrap4); + ] ); + ( 2l, + [ + (0l, bootstrap2); + (1l, bootstrap3); + (2l, bootstrap1); + (3l, bootstrap4); + ] ); + ]; + timeout = 60; + } + in + run + ~config + [ + (1, (module Node_a_hooks)); + (1, (module Node_b_hooks)); + (1, (module Node_c_hooks)); + (1, (module Node_d_hooks)); + ] + +let tests = + let open Tezos_base_test_helpers.Tztest in + [ + tztest "reaches level 5" `Quick test_level_5; + tztest "scenario t1" `Quick test_scenario_t1; + tztest "scenario t2" `Quick test_scenario_t2; + tztest "scenario t3" `Quick test_scenario_t3; + (* See issue https://gitlab.com/nomadic-labs/tezos/-/issues/518 *) + (* tztest "scenario f1" `Quick test_scenario_f1; *) + tztest "scenario f2" `Quick test_scenario_f2; + tztest "scenario m1" `Quick test_scenario_m1; + tztest "scenario m2" `Quick test_scenario_m2; + tztest "scenario m3" `Quick test_scenario_m3; + tztest "scenario m4" `Quick test_scenario_m4; + tztest "scenario m5" `Quick test_scenario_m5; + tztest "scenario m6" `Quick test_scenario_m6; + tztest "scenario m7" `Quick test_scenario_m7; + tztest "scenario m8" `Quick test_scenario_m8; + ] diff --git a/src/proto_016_PtMumbai/lib_injector/disk_persistence.ml b/src/proto_016_PtMumbai/lib_injector/disk_persistence.ml new file mode 100644 index 000000000000..f8585e929ff4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/disk_persistence.ml @@ -0,0 +1,395 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Cannot_write_file of string + | Cannot_create_dir of string + | Cannot_delete_file of string + | Cannot_read_file of string + | Io_error of [`Close | `Open] Lwt_utils_unix.io_error + | Unix_error of Unix.error + | Decoding_error of Data_encoding.Binary.read_error + +let () = + register_error_kind + ~id:"rollups.injector.cannot_write_file" + ~title:"Cannot write file" + ~description:"An element for a persistent table could not be written" + ~pp:(fun ppf s -> + Format.fprintf ppf "The persistent element %s could not be written" s) + `Temporary + Data_encoding.(obj1 (req "file" string)) + (function Cannot_write_file s -> Some s | _ -> None) + (fun s -> Cannot_write_file s) ; + register_error_kind + ~id:"rollups.injector.cannot_create_dir" + ~title:"Cannot create directory" + ~description:"Directory for persistent data structure could not be created" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "Directory %s for persistent data structure could not be created" + s) + `Temporary + Data_encoding.(obj1 (req "directory" string)) + (function Cannot_create_dir s -> Some s | _ -> None) + (fun s -> Cannot_create_dir s) ; + register_error_kind + ~id:"rollups.injector.cannot_delete_file" + ~title:"Cannot delete file" + ~description:"An element for a persistent table could not be deleted" + ~pp:(fun ppf s -> + Format.fprintf ppf "The persistent element %s could not be deleted" s) + `Temporary + Data_encoding.(obj1 (req "file" string)) + (function Cannot_delete_file s -> Some s | _ -> None) + (fun s -> Cannot_delete_file s) ; + register_error_kind + ~id:"rollups.injector.cannot_read_file" + ~title:"Cannot read file" + ~description:"A file for a persistent element could not be read" + ~pp:(fun ppf s -> + Format.fprintf ppf "The persistent element %s could not be read" s) + `Temporary + Data_encoding.(obj1 (req "file" string)) + (function Cannot_read_file s -> Some s | _ -> None) + (fun s -> Cannot_read_file s) ; + register_error_kind + ~id:"rollups.injector.io_error" + ~title:"IO error" + ~description:"IO error" + ~pp:(fun ppf (_action, unix_code, caller, arg) -> + Format.fprintf + ppf + "IO error in %s(%s): %s)" + caller + arg + (Unix.error_message unix_code)) + `Temporary + Data_encoding.( + obj4 + (req "action" (string_enum [("close", `Close); ("open", `Open)])) + (req "unix_code" Tezos_stdlib_unix.Unix_error.encoding) + (req "caller" string) + (req "arg" string)) + (function + | Io_error Lwt_utils_unix.{action; unix_code; caller; arg} -> + Some (action, unix_code, caller, arg) + | _ -> None) + (fun (action, unix_code, caller, arg) -> + Io_error Lwt_utils_unix.{action; unix_code; caller; arg}) ; + register_error_kind + ~id:"rollups.injector.unix_error" + ~title:"Unix error" + ~description:"Unix error" + ~pp:(fun ppf error -> + Format.fprintf ppf "Unix error: %s" (Unix.error_message error)) + `Temporary + Data_encoding.(obj1 (req "error" Tezos_stdlib_unix.Unix_error.encoding)) + (function Unix_error e -> Some e | _ -> None) + (fun e -> Unix_error e) ; + register_error_kind + ~id:"rollups.injector.decoding_error" + ~title:"Cannot decode file" + ~description:"A file for a persistent element could not be decoded" + ~pp:(fun ppf error -> + Format.fprintf + ppf + "Decoding error: %a" + Data_encoding.Json.pp + (Data_encoding.Json.construct + Data_encoding.Binary.read_error_encoding + error)) + `Permanent + Data_encoding.(obj1 (req "error" Data_encoding.Binary.read_error_encoding)) + (function Decoding_error e -> Some e | _ -> None) + (fun e -> Decoding_error e) ; + () + +module type H = sig + include Hashtbl.SeededS + + type value + + val name : string + + val string_of_key : key -> string + + val key_of_string : string -> key option + + val value_encoding : value Data_encoding.t +end + +let create_dir dir = + trace (Cannot_create_dir dir) + @@ protect + @@ fun () -> + let open Lwt_result_syntax in + let*! () = Lwt_utils_unix.create_dir dir in + return_unit + +let read_value file encoding = + let open Lwt_syntax in + trace (Cannot_read_file file) + @@ Lwt.catch + (fun () -> + Lwt_io.with_file ~flags:[Unix.O_RDONLY; O_CLOEXEC] ~mode:Input file + @@ fun channel -> + let+ bytes = Lwt_io.read channel in + Result.map_error (fun e -> [Decoding_error e]) + @@ Data_encoding.Binary.of_bytes + encoding + (Bytes.unsafe_of_string bytes)) + (function + | Unix.Unix_error (e, _, _) -> fail (Unix_error e) | e -> fail (Exn e)) + +let maybe_read_value ~warn file encoding = + let open Lwt_syntax in + let* v = read_value file encoding in + match v with + | Error e -> + let+ () = warn file e in + None + | Ok v -> return_some v + +let write_value file encoding value = + trace (Cannot_write_file file) + @@ protect + @@ fun () -> + Lwt_result.map_error (fun e -> [Io_error e]) + @@ Lwt_utils_unix.with_open_out ~overwrite:true file + @@ fun fd -> + let block_bytes = Data_encoding.Binary.to_bytes_exn encoding value in + Lwt_utils_unix.write_bytes fd block_bytes + +let delete_file file = + trace (Cannot_delete_file file) + @@ protect + @@ fun () -> + let open Lwt_result_syntax in + let*! () = Lwt_unix.unlink file in + return_unit + +module Make_table (H : H) = struct + type key = H.key + + type value = H.value + + type t = {path : string; table : value H.t} + + let filedata t k = Filename.concat t.path (H.string_of_key k) + + let create ~data_dir n = + let open Lwt_result_syntax in + let table = H.create n in + let path = Filename.concat data_dir H.name in + let+ () = create_dir path in + {path; table} + + let replace t k v = + H.replace t.table k v ; + write_value (filedata t k) H.value_encoding v + + let remove t k = + H.remove t.table k ; + delete_file (filedata t k) + + let find t k = H.find t.table k + + let mem t k = H.mem t.table k + + let iter_s f t = H.iter_s f t.table + + let iter_es f t = H.iter_es f t.table + + let length t = H.length t.table + + let replace_seq t seq = + H.replace_seq t.table seq ; + Seq.iter_es + (fun (k, v) -> write_value (filedata t k) H.value_encoding v) + seq + + let load_from_disk ~warn_unreadable ~initial_size ~data_dir ~filter = + let open Lwt_result_syntax in + let* t = create ~data_dir initial_size in + let*! d = Lwt_unix.opendir t.path in + let rec browse () = + let*! filename = + let open Lwt_syntax in + Lwt.catch + (fun () -> + let+ f = Lwt_unix.readdir d in + Some f) + (function End_of_file -> return_none | e -> raise e) + in + match filename with + | None -> return_unit + | Some filename -> + let* () = + match H.key_of_string filename with + | None -> return_unit + | Some k -> ( + let+ v = + match warn_unreadable with + | None -> + let+ v = read_value (filedata t k) H.value_encoding in + Some v + | Some warn -> + let*! v = + maybe_read_value ~warn (filedata t k) H.value_encoding + in + return v + in + match v with + | None -> () + | Some v -> if filter v then H.add t.table k v) + in + browse () + in + let+ () = browse () in + t +end + +module Make_queue (N : sig + val name : string +end) +(K : Tezos_crypto.S.HASH) (V : sig + type t + + val encoding : t Data_encoding.t +end) = +struct + module Q = Hash_queue.Make (K) (V) + + type t = {path : string; metadata_path : string; queue : Q.t} + + let counter = ref min_int + + let filedata q k = Filename.concat q.path (K.to_b58check k) + + let filemetadata q k = Filename.concat q.metadata_path (K.to_b58check k) + + let create ~data_dir n = + let open Lwt_result_syntax in + let queue = Q.create n in + let path = Filename.concat data_dir N.name in + let metadata_path = Filename.concat path "metadata" in + let* () = create_dir path in + let+ () = create_dir metadata_path in + {path; metadata_path; queue} + + let remove q k = + let open Lwt_result_syntax in + Q.remove q.queue k ; + let* () = delete_file (filedata q k) + and* () = delete_file (filemetadata q k) in + return_unit + + let create_metadata () = + let time = Time.System.now () in + let d, ps = Ptime.to_span time |> Ptime.Span.to_d_ps in + let c = !counter in + incr counter ; + (d, ps, c) + + let metadata_encoding = + let open Data_encoding in + conv + (fun (d, ps, c) -> (Int64.of_int d, ps, Int64.of_int c)) + (fun (d, ps, c) -> (Int64.to_int d, ps, Int64.to_int c)) + @@ tup3 int64 int64 int64 + + let replace q k v = + let open Lwt_result_syntax in + Q.replace q.queue k v ; + let* () = write_value (filedata q k) V.encoding v + and* () = + write_value (filemetadata q k) metadata_encoding (create_metadata ()) + in + return_unit + + let fold f q = Q.fold f q.queue + + let length q = Q.length q.queue + + let find_opt q k = Q.find_opt q.queue k + + let load_from_disk ~warn_unreadable ~capacity ~data_dir ~filter = + let open Lwt_result_syntax in + let* q = create ~data_dir capacity in + let*! d = Lwt_unix.opendir q.path in + let rec browse acc = + let*! filename = + let open Lwt_syntax in + Lwt.catch + (fun () -> + let+ f = Lwt_unix.readdir d in + Some f) + (function End_of_file -> return_none | e -> raise e) + in + match filename with + | None -> return acc + | Some filename -> + let* acc = + match K.of_b58check_opt filename with + | None -> return acc + | Some k -> ( + let+ v_meta = + match warn_unreadable with + | None -> + let* v = read_value (filedata q k) V.encoding + and* meta = + read_value (filemetadata q k) metadata_encoding + in + return_some (v, meta) + | Some warn -> + let open Lwt_syntax in + let* v = maybe_read_value ~warn (filedata q k) V.encoding + and* meta = + maybe_read_value + ~warn + (filemetadata q k) + metadata_encoding + in + return_ok @@ Option.bind v + @@ fun v -> Option.bind meta @@ fun meta -> Some (v, meta) + in + match v_meta with + | None -> acc + | Some (v, meta) -> + if filter v then (k, v, meta) :: acc else acc) + in + browse acc + in + let* list = browse [] in + let list = + List.fast_sort + (fun (_, _, meta1) (_, _, meta2) -> Stdlib.compare meta1 meta2) + list + in + List.iter (fun (k, v, _) -> Q.replace q.queue k v) list ; + return q +end diff --git a/src/proto_016_PtMumbai/lib_injector/disk_persistence.mli b/src/proto_016_PtMumbai/lib_injector/disk_persistence.mli new file mode 100644 index 000000000000..048ec2a1309f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/disk_persistence.mli @@ -0,0 +1,149 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Cannot_write_file of string + | Cannot_create_dir of string + | Cannot_read_file of string + | Io_error of [`Close | `Open] Lwt_utils_unix.io_error + | Unix_error of Unix.error + | Decoding_error of Data_encoding.Binary.read_error + +(** Signature for hash tables with additional information *) +module type H = sig + include Hashtbl.SeededS + + (** Type of values *) + type value + + (** Name used to derive a path (relative to [data_dir] in [load_from_disk]) of + where to store the persistent information for this hash table. *) + val name : string + + (** String version of key (used for filenames). *) + val string_of_key : key -> string + + (** Parse a key. We must have [key_of_string (string_of_key k) = k]. *) + val key_of_string : string -> key option + + (** Encoding for values (only the binary encoding is used *) + val value_encoding : value Data_encoding.t +end + +(** Create an on-disk persistent version of {!Hashtbl}. *) +module Make_table (H : H) : sig + type key = H.key + + type value = H.value + + (** Type of persistent hash tables *) + type t + + (** Persistent version of {!H.replace} *) + val replace : t -> key -> value -> unit tzresult Lwt.t + + (** Persistent version of {!H.remove} *) + val remove : t -> key -> unit tzresult Lwt.t + + (** Same as {!H.find} *) + val find : t -> key -> value option + + (** Same as {!H.mem} *) + val mem : t -> key -> bool + + (** Same as {!H.iter_s} *) + val iter_s : (key -> value -> unit Lwt.t) -> t -> unit Lwt.t + + (** Same as {!H.iter_es} *) + val iter_es : + (key -> value -> unit tzresult Lwt.t) -> t -> unit tzresult Lwt.t + + (** Same as {!H.length} *) + val length : t -> int + + (** Persistent version of {!H.replace_seq} *) + val replace_seq : t -> (key * value) Seq.t -> unit tzresult Lwt.t + + (** [load_from_disk ~warn_unreadable ~initial_size ~data_dir] creates a hash + table of size [initial_size]. The hash table is populated by persistent + elements present in [data_dir/H.name] which pass the [filter] (the + directory is created if it does not exist). If [warn_unreadable] is [Some + warn], unreadable files are ignored but a warning is printed with [warn], + otherwise the loading fails on the first unreadable file. *) + val load_from_disk : + warn_unreadable:(string -> error trace -> unit Lwt.t) option -> + initial_size:int -> + data_dir:string -> + filter:(value -> bool) -> + t tzresult Lwt.t +end + +(** Create an on-disk persistent version of the {!Hash_queue} data structure. *) +module Make_queue (N : sig + (** Name used to derive a path (relative to [data_dir] in [load_from_disk]) of where + to store the persistent information for this queue. *) + val name : string +end) +(K : Tezos_crypto.S.HASH) (V : sig + type t + + val encoding : t Data_encoding.t +end) : sig + type t + + (** [remove q k] removes the binding from [k] in [q]. If [k] is not bound in + [c], it does nothing. The removal is persisted on disk. *) + val remove : t -> K.t -> unit tzresult Lwt.t + + (** [replace q k v] binds the key [k] to the value [v] in the queue [q]. This + may or may not cause another binding to be removed, depending on the + number of bindings already present in [q]. The addition (or replacement) + is persisted on disk. *) + val replace : t -> K.t -> V.t -> unit tzresult Lwt.t + + (** [fold f q init] folds the function [f] over the bindings + of [q] (in memory). The elements are iterated from oldest to newest. *) + val fold : (K.t -> V.t -> 'a -> 'a) -> t -> 'a -> 'a + + (** [find_opt q k] is [Some v] if [k] is bound to [v] in [q]. It is [None] + otherwise. *) + val find_opt : t -> K.t -> V.t option + + (** [length q] is the number of bindings held by [q]. *) + val length : t -> int + + (** [load_from_disk ~warn_unreadable ~capacity ~data_dir ~filter] creates a + bounded hash queue of capacity [capacity]. The queue is populated by + persistent elements present in [data_dir/N.name] which pass the [filter] + (the directory is created if it does not exist). If [warn_unreadable] is + [Some warn], unreadable files are ignored but a warning is printed with + [warn], otherwise the loading fails on the first unreadable file. *) + val load_from_disk : + warn_unreadable:(string -> error trace -> unit Lwt.t) option -> + capacity:int -> + data_dir:string -> + filter:(V.t -> bool) -> + t tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_injector/dune b/src/proto_016_PtMumbai/lib_injector/dune new file mode 100644 index 000000000000..8fe34ddecfc3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/dune @@ -0,0 +1,34 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_injector_alpha) + (public_name tezos-injector-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-base.unix + tezos-stdlib-unix + tezos-crypto + tezos-protocol-alpha + tezos-micheline + tezos-client-alpha + tezos-client-base + tezos-workers + tezos-shell + tezos-layer2-utils-alpha) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base + -open Tezos_stdlib_unix + -open Tezos_protocol_alpha + -open Tezos_micheline + -open Tezos_client_alpha + -open Tezos_client_base + -open Tezos_workers + -open Tezos_layer2_utils_alpha)) diff --git a/src/proto_016_PtMumbai/lib_injector/injector_common.ml b/src/proto_016_PtMumbai/lib_injector/injector_common.ml new file mode 100644 index 000000000000..e6db79b79345 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_common.ml @@ -0,0 +1,149 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context + +type signer = { + alias : string; + pkh : Tezos_crypto.Signature.public_key_hash; + pk : Tezos_crypto.Signature.public_key; + sk : Client_keys.sk_uri; +} + +let get_signer cctxt pkh = + let open Lwt_result_syntax in + let* alias, pk, sk = Client_keys.get_key cctxt pkh in + return {alias; pkh; pk; sk} + +type 'block reorg = {old_chain : 'block list; new_chain : 'block list} + +let no_reorg = {old_chain = []; new_chain = []} + +let reorg_encoding block_encoding = + let open Data_encoding in + conv + (fun {old_chain; new_chain} -> (old_chain, new_chain)) + (fun (old_chain, new_chain) -> {old_chain; new_chain}) + @@ obj2 + (req "old_chain" (list block_encoding)) + (req "new_chain" (list block_encoding)) + +let fetch_tezos_shell_header ~find_in_cache (cctxt : #full) hash : + (Block_header.shell_header, error trace) result Lwt.t = + let open Lwt_syntax in + let errors = ref None in + let fetch hash = + let* shell_header = + Tezos_shell_services.Shell_services.Blocks.Header.shell_header + cctxt + ~chain:cctxt#chain + ~block:(`Hash (hash, 0)) + () + in + match shell_header with + | Error errs -> + errors := Some errs ; + return_none + | Ok shell_header -> return_some shell_header + in + let+ shell_header = find_in_cache hash fetch in + match (shell_header, !errors) with + | None, None -> + (* This should not happen if {!find_in_cache} behaves correctly, + i.e. calls {!fetch} for cache misses. *) + error_with + "Fetching Tezos block %a failed unexpectedly" + Tezos_crypto.Block_hash.pp + hash + | None, Some errs -> Error errs + | Some shell_header, _ -> Ok shell_header + +let fetch_tezos_block ~find_in_cache (cctxt : #full) hash : + (Alpha_block_services.block_info, error trace) result Lwt.t = + let open Lwt_syntax in + let errors = ref None in + let fetch hash = + let* block = + Alpha_block_services.info + cctxt + ~chain:cctxt#chain + ~block:(`Hash (hash, 0)) + ~metadata:`Always + () + in + match block with + | Error errs -> + errors := Some errs ; + return_none + | Ok block -> return_some block + in + let+ block = find_in_cache hash fetch in + match (block, !errors) with + | None, None -> + (* This should not happen if {!find_in_cache} behaves correctly, + i.e. calls {!fetch} for cache misses. *) + error_with + "Fetching Tezos block %a failed unexpectedly" + Tezos_crypto.Block_hash.pp + hash + | None, Some errs -> Error errs + | Some block, _ -> Ok block + +(* Compute the reorganization of L1 blocks from the chain whose head is + [old_head_hash] and the chain whose head [new_head_hash]. *) +let tezos_reorg fetch_tezos_block ~old_head_hash ~new_head_hash = + let open Alpha_block_services in + let open Lwt_result_syntax in + let rec loop old_chain new_chain old_head_hash new_head_hash = + if Tezos_crypto.Block_hash.(old_head_hash = new_head_hash) then + return {old_chain = List.rev old_chain; new_chain = List.rev new_chain} + else + let* new_head = fetch_tezos_block new_head_hash in + let* old_head = fetch_tezos_block old_head_hash in + let old_level = old_head.header.shell.level in + let new_level = new_head.header.shell.level in + let diff = Int32.sub new_level old_level in + let old_chain, new_chain, old, new_ = + if diff = 0l then + (* Heads at same level *) + let new_chain = new_head :: new_chain in + let old_chain = old_head :: old_chain in + let new_head_hash = new_head.header.shell.predecessor in + let old_head_hash = old_head.header.shell.predecessor in + (old_chain, new_chain, old_head_hash, new_head_hash) + else if diff > 0l then + (* New chain is longer *) + let new_chain = new_head :: new_chain in + let new_head_hash = new_head.header.shell.predecessor in + (old_chain, new_chain, old_head_hash, new_head_hash) + else + (* Old chain was longer *) + let old_chain = old_head :: old_chain in + let old_head_hash = old_head.header.shell.predecessor in + (old_chain, new_chain, old_head_hash, new_head_hash) + in + loop old_chain new_chain old new_ + in + loop [] [] old_head_hash new_head_hash diff --git a/src/proto_016_PtMumbai/lib_injector/injector_common.mli b/src/proto_016_PtMumbai/lib_injector/injector_common.mli new file mode 100644 index 000000000000..7d4dd86089ee --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_common.mli @@ -0,0 +1,94 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context + +(** The type of signers for operations injected by the injector *) +type signer = { + alias : string; + pkh : Tezos_crypto.Signature.public_key_hash; + pk : Tezos_crypto.Signature.public_key; + sk : Client_keys.sk_uri; +} + +(** Type of chain reorganizations. *) +type 'block reorg = { + old_chain : 'block list; + (** The blocks that were in the old chain and which are not in the new one. *) + new_chain : 'block list; + (** The blocks that are now in the new chain. The length of [old_chain] and + [new_chain] may be different. *) +} + +(** Retrieve a signer from the client wallet. *) +val get_signer : + #Client_context.wallet -> + Tezos_crypto.Signature.public_key_hash -> + signer tzresult Lwt.t + +val no_reorg : 'a reorg + +val reorg_encoding : 'a Data_encoding.t -> 'a reorg Data_encoding.t + +type block_info := Alpha_block_services.block_info + +type shell_header := Block_header.shell_header + +(** [fetch_tezos_shell_header ~find_in_cache cctxt hash] returns [Some + shell_header] given a block hash. Looks for the block using [find_in_cache] + first, and fetches it from the L1 node otherwise. Returns [None] if no such + block hash exists. [find_in_cache] should be from an instance of + {!Aches_lwt.Lache.MAP_RESULT}. *) +val fetch_tezos_shell_header : + find_in_cache: + (Tezos_crypto.Block_hash.t -> + (Tezos_crypto.Block_hash.t -> shell_header option Lwt.t) -> + shell_header option Lwt.t) -> + #full -> + Tezos_crypto.Block_hash.t -> + shell_header tzresult Lwt.t + +(** [fetch_tezos_block ~find_in_cache cctxt hash] returns [Some block_info] + given a block hash. Looks for the block using [find_in_cache] first, and + fetches it from the L1 node otherwise. Returns [None] if no such block hash + exists. [find_in_cache] should be from an instance of + {!Aches_lwt.Lache.MAP_RESULT}. *) +val fetch_tezos_block : + find_in_cache: + (Tezos_crypto.Block_hash.t -> + (Tezos_crypto.Block_hash.t -> block_info option Lwt.t) -> + block_info option Lwt.t) -> + #full -> + Tezos_crypto.Block_hash.t -> + block_info tzresult Lwt.t + +(** [tezos_reorg fetch ~old_head_hash ~new_head_hash] computes the + reorganization of L1 blocks from the chain whose head is [old_head_hash] and + the chain whose head [new_head_hash]. *) +val tezos_reorg : + (Tezos_crypto.Block_hash.t -> block_info tzresult Lwt.t) -> + old_head_hash:Tezos_crypto.Block_hash.t -> + new_head_hash:Tezos_crypto.Block_hash.t -> + block_info reorg tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_injector/injector_errors.ml b/src/proto_016_PtMumbai/lib_injector/injector_errors.ml new file mode 100644 index 000000000000..b2e5b98bebc3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_errors.ml @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += No_worker_for_source of Tezos_crypto.Signature.Public_key_hash.t + +let () = + register_error_kind + ~id:"rollups.injector.no_worker_for_source" + ~title:"No injecting queue for source" + ~description: + "An L1 operation could not be queued because its source has no worker." + ~pp:(fun ppf s -> + Format.fprintf + ppf + "No worker for source %a" + Tezos_crypto.Signature.Public_key_hash.pp + s) + `Permanent + Data_encoding.( + obj1 (req "source" Tezos_crypto.Signature.Public_key_hash.encoding)) + (function No_worker_for_source s -> Some s | _ -> None) + (fun s -> No_worker_for_source s) + +type error += No_worker_for_tag of string + +let () = + register_error_kind + ~id:"rollups.injector.no_worker_for_tag" + ~title:"No injecting queue for tag" + ~description: + "An L1 operation could not be queued because its tag has no worker." + ~pp:(fun ppf t -> Format.fprintf ppf "No worker for tag %s" t) + `Permanent + Data_encoding.(obj1 (req "tag" Data_encoding.string)) + (function No_worker_for_tag t -> Some t | _ -> None) + (fun t -> No_worker_for_tag t) + +type error += No_worker_for_operation of L1_operation.t + +let () = + register_error_kind + ~id:"rollups.injector.no_worker_for_operation" + ~title:"This operation is not supported by injector" + ~description: + "An L1 operation could not be queued because the injector does not \ + handle it." + ~pp:(fun ppf op -> + Format.fprintf ppf "No worker for operation %a" L1_operation.pp op) + `Permanent + Data_encoding.(obj1 (req "operation" L1_operation.encoding)) + (function No_worker_for_operation op -> Some op | _ -> None) + (fun op -> No_worker_for_operation op) + +type error += Step_failed of string + +let () = + register_error_kind + ~id:"rollups.injector.step_failed" + ~title:"A step failed in the injector" + ~description:"A step failed in the injector." + ~pp:(fun ppf step -> + Format.fprintf ppf "%s failed in injector" (String.capitalize_ascii step)) + `Temporary + Data_encoding.(obj1 (req "step" string)) + (function Step_failed s -> Some s | _ -> None) + (fun s -> Step_failed s) diff --git a/src/proto_016_PtMumbai/lib_injector/injector_errors.mli b/src/proto_016_PtMumbai/lib_injector/injector_errors.mli new file mode 100644 index 000000000000..1c39b4ffc53a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_errors.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Error when the injector has no worker for the source which must inject an + operation. *) +type error += No_worker_for_source of Tezos_crypto.Signature.Public_key_hash.t + +(** Error when the injector has no worker for the tag of the operation to be + injected. *) +type error += No_worker_for_tag of string + +(** Error when the injector does not handle the operation. *) +type error += No_worker_for_operation of L1_operation.t + +(** Error when a step of the injector failed. *) +type error += Step_failed of string diff --git a/src/proto_016_PtMumbai/lib_injector/injector_events.ml b/src/proto_016_PtMumbai/lib_injector/injector_events.ml new file mode 100644 index 000000000000..256903f6a5e9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_events.ml @@ -0,0 +1,248 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Injector_worker_types + +module Make (Rollup : Injector_sigs.PARAMETERS) = struct + module Tags = Injector_tags.Make (Rollup.Tag) + include Internal_event.Simple + + let section = Rollup.events_section + + let declare_1 ~name ~msg ~level ?pp1 enc1 = + declare_3 + ~section + ~name + ~msg:("[{signer}: {tags}] " ^ msg) + ~level + ("signer", Tezos_crypto.Signature.Public_key_hash.encoding) + ("tags", Tags.encoding) + enc1 + ~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short + ~pp2:Tags.pp + ?pp3:pp1 + + let declare_2 ~name ~msg ~level ?pp1 ?pp2 enc1 enc2 = + declare_4 + ~section + ~name + ~msg:("[{signer}: {tags}] " ^ msg) + ~level + ("signer", Tezos_crypto.Signature.Public_key_hash.encoding) + ("tags", Tags.encoding) + enc1 + enc2 + ~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short + ~pp2:Tags.pp + ?pp3:pp1 + ?pp4:pp2 + + let declare_3 ~name ~msg ~level ?pp1 ?pp2 ?pp3 enc1 enc2 enc3 = + declare_5 + ~section + ~name + ~msg:("[{signer}: {tags}] " ^ msg) + ~level + ("signer", Tezos_crypto.Signature.Public_key_hash.encoding) + ("tags", Tags.encoding) + enc1 + enc2 + enc3 + ~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short + ~pp2:Tags.pp + ?pp3:pp1 + ?pp4:pp2 + ?pp5:pp3 + + let request_failed = + declare_3 + ~name:"request_failed" + ~msg:"request {view} failed ({worker_status}): {errors}" + ~level:Warning + ("view", Request.encoding) + ~pp1:Request.pp + ("worker_status", Worker_types.request_status_encoding) + ~pp2:Worker_types.pp_status + ("errors", Error_monad.trace_encoding) + ~pp3:Error_monad.pp_print_trace + + let request_completed_notice = + declare_2 + ~name:"request_completed_notice" + ~msg:"{view} {worker_status}" + ~level:Notice + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status + + let request_completed_debug = + declare_2 + ~name:"request_completed_debug" + ~msg:"{view} {worker_status}" + ~level:Debug + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status + + let new_tezos_head = + declare_1 + ~name:"new_tezos_head" + ~msg:"processing new Tezos head {head}" + ~level:Debug + ("head", Tezos_crypto.Block_hash.encoding) + + let injecting_pending = + declare_1 + ~name:"injecting_pending" + ~msg:"Injecting {count} pending operations" + ~level:Notice + ("count", Data_encoding.int31) + + let pp_operations_list ppf operations = + Format.fprintf + ppf + "@[%a@]" + (Format.pp_print_list L1_operation.pp) + operations + + let pp_operations_hash_list ppf operations = + Format.fprintf + ppf + "@[%a@]" + (Format.pp_print_list L1_operation.Hash.pp) + operations + + let injecting_operations = + declare_1 + ~name:"injecting_operations" + ~msg:"Injecting operations: {operations}" + ~level:Notice + ("operations", Data_encoding.list L1_operation.encoding) + ~pp1:pp_operations_list + + let simulating_operations = + declare_2 + ~name:"simulating_operations" + ~msg:"Simulating operations (force = {force}): {operations}" + ~level:Debug + ("operations", Data_encoding.list L1_operation.encoding) + ("force", Data_encoding.bool) + ~pp1:pp_operations_list + + let dropping_operation = + declare_2 + ~name:"dropping_operation" + ~msg:"Dropping operation {operation} failing with {error}" + ~level:Notice + ("operation", L1_operation.encoding) + ~pp1:L1_operation.pp + ("error", Environment.Error_monad.trace_encoding) + ~pp2:Environment.Error_monad.pp_trace + + let injected = + declare_2 + ~name:"injected" + ~msg:"Injected {nb} operations in {oph}" + ~level:Notice + ("nb", Data_encoding.int31) + ("oph", Tezos_crypto.Operation_hash.encoding) + + let add_pending = + declare_1 + ~name:"add_pending" + ~msg:"Add {operation} to pending" + ~level:Notice + ("operation", L1_operation.encoding) + ~pp1:L1_operation.pp + + let retry_operation = + declare_1 + ~name:"retry_operation" + ~msg:"Retry {operation}" + ~level:Notice + ("operation", L1_operation.encoding) + ~pp1:L1_operation.pp + + let included = + declare_3 + ~name:"included" + ~msg:"Included operations of {block} at level {level}: {operations}" + ~level:Notice + ("block", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + ("operations", Data_encoding.list L1_operation.Hash.encoding) + ~pp3:pp_operations_hash_list + + let revert_operations = + declare_1 + ~name:"revert_operations" + ~msg:"Reverting operations: {operations}" + ~level:Notice + ("operations", Data_encoding.list L1_operation.Hash.encoding) + ~pp1:pp_operations_hash_list + + let confirmed_level = + declare_1 + ~name:"confirmed_level" + ~msg:"Confirmed Tezos level {level}" + ~level:Notice + ("level", Data_encoding.int32) + + let confirmed_operations = + declare_2 + ~name:"confirmed_operations" + ~msg:"Confirmed operations of level {level}: {operations}" + ~level:Notice + ("level", Data_encoding.int32) + ("operations", Data_encoding.list L1_operation.Hash.encoding) + ~pp2:pp_operations_hash_list + + let loaded_from_disk = + declare_2 + ~name:"loaded_from_disk" + ~msg:"Loaded {nb} elements in {kind} from disk" + ~level:Notice + ("nb", Data_encoding.int31) + ("kind", Data_encoding.string) + + let corrupted_operation_on_disk = + declare_2 + ~name:"corrupted_operation_on_disk" + ~msg:"Ignoring unreadable file {file} on disk: {error}" + ~level:Warning + ("file", Data_encoding.string) + ("error", Error_monad.trace_encoding) + ~pp1:Format.pp_print_string + ~pp2:Error_monad.pp_print_trace + + let inject_wait = + declare_1 + ~name:"inject_wait" + ~msg:"Waiting {delay} seconds to trigger injection" + ~level:Notice + ("delay", Data_encoding.float) +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_functor.ml b/src/proto_016_PtMumbai/lib_injector/injector_functor.ml new file mode 100644 index 000000000000..1af48370900a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_functor.ml @@ -0,0 +1,1211 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context +open Injector_common +open Injector_worker_types +open Injector_sigs +open Injector_errors + +(* This is the Tenderbake finality for blocks. *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2815 + Centralize this and maybe make it configurable. *) +let confirmations = 2 + +type injection_strategy = [`Each_block | `Delay_block of float] + +(* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2755 + Persist injector data on disk *) + +(** Builds a client context from another client context but uses logging instead + of printing on stdout directly. This client context cannot make the injector + exit. *) +let injector_context (cctxt : #Protocol_client_context.full) = + let log _channel msg = Logs_lwt.info (fun m -> m "%s" msg) in + object + inherit + Protocol_client_context.wrap_full + (new Client_context.proxy_context (cctxt :> Client_context.full)) + + inherit! Client_context.simple_printer log + + method! exit code = + Format.ksprintf Stdlib.failwith "Injector client wants to exit %d" code + end + +module Make (Rollup : PARAMETERS) = struct + module Tags = Injector_tags.Make (Rollup.Tag) + module Tags_table = Hashtbl.Make (Rollup.Tag) + + module Op_queue = + Disk_persistence.Make_queue + (struct + let name = "operations_queue" + end) + (L1_operation.Hash) + (L1_operation) + + module Injected_operations = Disk_persistence.Make_table (struct + include L1_operation.Hash.Table + + type value = injected_info + + let name = "injected_operations" + + let string_of_key = L1_operation.Hash.to_b58check + + let key_of_string = L1_operation.Hash.of_b58check_opt + + let value_encoding = injected_info_encoding + end) + + module Injected_ophs = Disk_persistence.Make_table (struct + include Tezos_crypto.Operation_hash.Table + + type value = L1_operation.Hash.t list + + let name = "injected_ophs" + + let string_of_key = Tezos_crypto.Operation_hash.to_b58check + + let key_of_string = Tezos_crypto.Operation_hash.of_b58check_opt + + let value_encoding = Data_encoding.list L1_operation.Hash.encoding + end) + + (** The part of the state which gathers information about injected + operations (but not included). *) + type injected_state = { + injected_operations : Injected_operations.t; + (** A table mapping L1 manager operation hashes to the injection info for that + operation. *) + injected_ophs : Injected_ophs.t; + (** A mapping of all L1 manager operations contained in a L1 batch (i.e. an L1 + operation). *) + } + + module Included_operations = Disk_persistence.Make_table (struct + include L1_operation.Hash.Table + + type value = included_info + + let name = "included_operations" + + let string_of_key = L1_operation.Hash.to_b58check + + let key_of_string = L1_operation.Hash.of_b58check_opt + + let value_encoding = included_info_encoding + end) + + module Included_in_blocks = Disk_persistence.Make_table (struct + include Tezos_crypto.Block_hash.Table + + type value = int32 * L1_operation.Hash.t list + + let name = "included_in_blocks" + + let string_of_key = Tezos_crypto.Block_hash.to_b58check + + let key_of_string = Tezos_crypto.Block_hash.of_b58check_opt + + let value_encoding = + let open Data_encoding in + obj2 (req "level" int32) (req "l1_ops" (list L1_operation.Hash.encoding)) + end) + + (** The part of the state which gathers information about + operations which are included in the L1 chain (but not confirmed). *) + type included_state = { + included_operations : Included_operations.t; + included_in_blocks : Included_in_blocks.t; + } + + (** The internal state of each injector worker. *) + type state = { + cctxt : Protocol_client_context.full; + (** The client context which is used to perform the injections. *) + constants : Constants.t; (** The constants of the protocol. *) + signer : signer; (** The signer for this worker. *) + tags : Tags.t; + (** The tags of this worker, for both informative and identification + purposes. *) + strategy : injection_strategy; + (** The strategy of this worker for injecting the pending operations. *) + save_dir : string; (** Path to where save persistent state *) + queue : Op_queue.t; + (** The queue of pending operations for this injector. *) + injected : injected_state; + (** The information about injected operations. *) + included : included_state; + (** The information about included operations. {b Note}: Operations which + are confirmed are simply removed from the state and do not appear + anymore. *) + rollup_node_state : Rollup.rollup_node_state; + (** The state of the rollup node. *) + retention_period : int; + (** Number of blocks for which the injector keeps the included + information. *) + } + + module Event = struct + include Injector_events.Make (Rollup) + + let emit1 e state x = emit e (state.signer.pkh, state.tags, x) + + let emit2 e state x y = emit e (state.signer.pkh, state.tags, x, y) + + let emit3 e state x y z = emit e (state.signer.pkh, state.tags, x, y, z) + end + + let init_injector cctxt constants ~data_dir rollup_node_state + ~retention_period ~signer strategy tags = + let open Lwt_result_syntax in + let* signer = get_signer cctxt signer in + let data_dir = Filename.concat data_dir "injector" in + let*! () = Lwt_utils_unix.create_dir data_dir in + let filter op_proj op = + let {L1_operation.manager_operation = Manager op; _} = op_proj op in + match Rollup.operation_tag op with + | None -> false + | Some t -> Tags.mem t tags + in + let warn_unreadable = + (* Warn of corrupted files but don't fail *) + Some + (fun file error -> + Event.(emit corrupted_operation_on_disk) + (signer.pkh, tags, file, error)) + in + let emit_event_loaded kind nb = + Event.(emit loaded_from_disk) (signer.pkh, tags, nb, kind) + in + let* queue = + Op_queue.load_from_disk + ~warn_unreadable + ~capacity:50_000 + ~data_dir + ~filter:(filter (fun op -> op)) + in + let*! () = emit_event_loaded "operations_queue" @@ Op_queue.length queue in + (* Very coarse approximation for the number of operation we expect for each + block *) + let n = + Tags.fold (fun t acc -> acc + Rollup.table_estimated_size t) tags 0 + in + let* injected_operations = + Injected_operations.load_from_disk + ~warn_unreadable + ~initial_size:n + ~data_dir + ~filter:(filter (fun (i : injected_info) -> i.op)) + in + let*! () = + emit_event_loaded "injected_operations" + @@ Injected_operations.length injected_operations + in + + let* included_operations = + Included_operations.load_from_disk + ~warn_unreadable + ~initial_size:((confirmations + retention_period) * n) + ~data_dir + ~filter:(filter (fun (i : included_info) -> i.op)) + in + let*! () = + emit_event_loaded "included_operations" + @@ Included_operations.length included_operations + in + let* injected_ophs = + Injected_ophs.load_from_disk + ~warn_unreadable + ~initial_size:n + ~data_dir + ~filter:(List.exists (Injected_operations.mem injected_operations)) + in + let*! () = + emit_event_loaded "injected_ophs" @@ Injected_ophs.length injected_ophs + in + let* included_in_blocks = + Included_in_blocks.load_from_disk + ~warn_unreadable + ~initial_size:((confirmations + retention_period) * n) + ~data_dir + ~filter:(fun (_, ops) -> + List.exists (Included_operations.mem included_operations) ops) + in + let*! () = + emit_event_loaded "included_in_blocks" + @@ Included_in_blocks.length included_in_blocks + in + + return + { + cctxt = injector_context (cctxt :> #Protocol_client_context.full); + constants; + signer; + tags; + strategy; + save_dir = data_dir; + queue; + injected = {injected_operations; injected_ophs}; + included = {included_operations; included_in_blocks}; + rollup_node_state; + retention_period; + } + + (** Add an operation to the pending queue corresponding to the signer for this + operation. *) + let add_pending_operation ?(retry = false) state op = + let open Lwt_result_syntax in + let*! () = + Event.(emit1 (if retry then retry_operation else add_pending)) state op + in + Op_queue.replace state.queue op.L1_operation.hash op + + (** Mark operations as injected (in [oph]). *) + let add_injected_operations state oph operations = + let open Lwt_result_syntax in + let infos = + List.map (fun op -> (op.L1_operation.hash, {op; oph})) operations + in + let* () = + Injected_operations.replace_seq + state.injected.injected_operations + (List.to_seq infos) + in + Injected_ophs.replace state.injected.injected_ophs oph (List.map fst infos) + + (** [add_included_operations state oph l1_block l1_level operations] marks the + [operations] as included (in the L1 batch [oph]) in the Tezos block + [l1_block] of level [l1_level]. *) + let add_included_operations state oph l1_block l1_level operations = + let open Lwt_result_syntax in + let*! () = + Event.(emit3 included) + state + l1_block + l1_level + (List.map (fun o -> o.L1_operation.hash) operations) + in + let infos = + List.map + (fun op -> (op.L1_operation.hash, {op; oph; l1_block; l1_level})) + operations + in + let* () = + Included_operations.replace_seq + state.included.included_operations + (List.to_seq infos) + in + Included_in_blocks.replace + state.included.included_in_blocks + l1_block + (l1_level, List.map fst infos) + + (** [remove state oph] removes the operations that correspond to the L1 batch + [oph] from the injected operations in the injector state. This function is + used to move operations from injected to included. *) + let remove_injected_operation state oph = + let open Lwt_result_syntax in + match Injected_ophs.find state.injected.injected_ophs oph with + | None -> + (* Nothing removed *) + return [] + | Some mophs -> + let* () = Injected_ophs.remove state.injected.injected_ophs oph in + let+ removed = + List.fold_left_es + (fun removed moph -> + match + Injected_operations.find state.injected.injected_operations moph + with + | None -> return removed + | Some info -> + let+ () = + Injected_operations.remove + state.injected.injected_operations + moph + in + info :: removed) + [] + mophs + in + List.rev removed + + (** [forget_block state block] removes the included operations that correspond + to all the L1 batches included in [block]. This function is used, + e.g. when [block] is on an alternative chain in the case of a + reorganization. *) + let forget_block state block = + let open Lwt_result_syntax in + match Included_in_blocks.find state.included.included_in_blocks block with + | None -> + (* Nothing removed *) + return [] + | Some (_level, mophs) -> + let* () = + Included_in_blocks.remove state.included.included_in_blocks block + in + List.fold_left_es + (fun removed moph -> + match + Included_operations.find state.included.included_operations moph + with + | None -> return removed + | Some info -> + let+ () = + Included_operations.remove + state.included.included_operations + moph + in + info :: removed) + [] + mophs + + let fee_parameter_of_operations state ops = + List.fold_left + (fun acc {L1_operation.manager_operation = Manager op; _} -> + let param = Rollup.fee_parameter state op in + Injection. + { + minimal_fees = Tez.max acc.minimal_fees param.minimal_fees; + minimal_nanotez_per_byte = + Q.max acc.minimal_nanotez_per_byte param.minimal_nanotez_per_byte; + minimal_nanotez_per_gas_unit = + Q.max + acc.minimal_nanotez_per_gas_unit + param.minimal_nanotez_per_gas_unit; + force_low_fee = acc.force_low_fee || param.force_low_fee; + fee_cap = + WithExceptions.Result.get_ok + ~loc:__LOC__ + Tez.(acc.fee_cap +? param.fee_cap); + burn_cap = + WithExceptions.Result.get_ok + ~loc:__LOC__ + Tez.(acc.burn_cap +? param.burn_cap); + }) + Injection. + { + minimal_fees = Tez.zero; + minimal_nanotez_per_byte = Q.zero; + minimal_nanotez_per_gas_unit = Q.zero; + force_low_fee = false; + fee_cap = Tez.zero; + burn_cap = Tez.zero; + } + ops + + (** Returns the first half of the list [ops] if there is more than two + elements, or [None] otherwise. *) + let keep_half ops = + let total = List.length ops in + if total <= 1 then None else Some (List.take_n (total / 2) ops) + + (** [simulate_operations ~must_succeed state operations] simulates the + injection of [operations] and returns a triple [(op, ops, results)] where + [op] is the packed operation with the adjusted limits, [ops] is the prefix + of [operations] which was considered (because it did not exceed the + quotas) and [results] are the results of the simulation. See + {!inject_operations} for the specification of [must_succeed]. *) + let rec simulate_operations ~must_succeed state + (operations : L1_operation.t list) = + let open Lwt_result_syntax in + let open Annotated_manager_operation in + let force = + match operations with + | [] -> assert false + | [_] -> + (* If there is only one operation, fail when simulation fails *) + false + | _ -> ( + (* We want to see which operation failed in the batch if not all must + succeed *) + match must_succeed with `All -> false | `At_least_one -> true) + in + let*! () = Event.(emit2 simulating_operations) state operations force in + let fee_parameter = + fee_parameter_of_operations state.rollup_node_state operations + in + let annotated_operations = + List.map + (fun {L1_operation.manager_operation = Manager operation; _} -> + Annotated_manager_operation + (Injection.prepare_manager_operation + ~fee:Limit.unknown + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + operation)) + operations + in + let (Manager_list annot_op) = + Annotated_manager_operation.manager_of_list annotated_operations + in + let*! simulation_result = + Injection.inject_manager_operation + state.cctxt + ~simulation:true (* Only simulation here *) + ~force + ~chain:state.cctxt#chain + ~block:(`Head 0) + ~source:state.signer.pkh + ~src_pk:state.signer.pk + ~src_sk:state.signer.sk + ~successor_level:true + (* Needed to simulate tx_rollup operations in the next block *) + ~fee:Limit.unknown + ~gas_limit:Limit.unknown + ~storage_limit:Limit.unknown + ~fee_parameter + annot_op + in + match simulation_result with + | Error trace -> + let exceeds_quota = + TzTrace.fold + (fun exceeds -> function + | Environment.Ecoproto_error + (Gas.Block_quota_exceeded | Gas.Operation_quota_exceeded) -> + true + | _ -> exceeds) + false + trace + in + if exceeds_quota then + (* We perform a dichotomy by injecting the first half of the + operations (we are not looking to maximize the number of operations + injected because of the cost of simulation). Only the operations + which are actually injected will be removed from the queue so the + other half will be reconsidered later. *) + match keep_half operations with + | None -> fail trace + | Some operations -> + simulate_operations ~must_succeed state operations + else fail trace + | Ok (_, op, _, result) -> + return (op, operations, Apply_results.Contents_result_list result) + + let inject_on_node state ~nb + {shell; protocol_data = Operation_data {contents; _}} = + let open Lwt_result_syntax in + let unsigned_op = (shell, Contents_list contents) in + let unsigned_op_bytes = + Data_encoding.Binary.to_bytes_exn Operation.unsigned_encoding unsigned_op + in + let* signature = + Client_keys.sign + state.cctxt + ~watermark:Tezos_crypto.Signature.Generic_operation + state.signer.sk + unsigned_op_bytes + in + let op : _ Operation.t = + {shell; protocol_data = {contents; signature = Some signature}} + in + let op_bytes = + Data_encoding.Binary.to_bytes_exn Operation.encoding (Operation.pack op) + in + Tezos_shell_services.Shell_services.Injection.operation + state.cctxt + ~chain:state.cctxt#chain + op_bytes + >>=? fun oph -> + let*! () = Event.(emit2 injected) state nb oph in + return oph + + (** Inject the given [operations] in an L1 batch. If [must_succeed] is [`All] + then all the operations must succeed in the simulation of injection. If + [must_succeed] is [`At_least_one] at least one operation in the list + [operations] must be successful in the simulation. In any case, only + operations which are known as successful will be included in the injected L1 + batch. {b Note}: [must_succeed = `At_least_one] allows to incrementally build + "or-batches" by iteratively removing operations that fail from the desired + batch. *) + let rec inject_operations ~must_succeed state + (operations : L1_operation.t list) = + let open Lwt_result_syntax in + let* packed_op, operations, result = + trace (Step_failed "simulation") + @@ simulate_operations ~must_succeed state operations + in + let results = Apply_results.to_list result in + let failure = ref false in + let* rev_non_failing_operations = + List.fold_left2_s + ~when_different_lengths: + [ + Exn + (Failure + "Unexpected error: length of operations and result differ in \ + simulation"); + ] + (fun acc op (Apply_results.Contents_result result) -> + match result with + | Apply_results.Manager_operation_result + { + operation_result = + Failed (_, error) | Backtracked (_, Some error); + _; + } -> + let*! () = Event.(emit2 dropping_operation) state op error in + failure := true ; + Lwt.return acc + | Apply_results.Manager_operation_result + { + operation_result = Applied _ | Backtracked (_, None) | Skipped _; + _; + } -> + (* Not known to be failing *) + Lwt.return (op :: acc) + | _ -> + (* Only manager operations *) + assert false) + [] + operations + results + in + if !failure then + (* Invariant: must_succeed = `At_least_one, otherwise the simulation would have + returned an error. We try to inject without the failing operation. *) + let operations = List.rev rev_non_failing_operations in + inject_operations ~must_succeed state operations + else + (* Inject on node for real *) + let+ oph = + trace (Step_failed "injection") + @@ inject_on_node ~nb:(List.length operations) state packed_op + in + (oph, operations) + + (** Returns the (upper bound on) the size of an L1 batch of operations composed + of the manager operations [rev_ops]. *) + let size_l1_batch state rev_ops = + let contents_list = + List.map + (fun (op : L1_operation.t) -> + let (Manager operation) = op.manager_operation in + let {fee; counter; gas_limit; storage_limit} = + Rollup.approximate_fee_bound state.rollup_node_state operation + in + let contents = + Manager_operation + { + source = state.signer.pkh; + operation; + fee; + counter; + gas_limit; + storage_limit; + } + in + Contents contents) + rev_ops + in + let (Contents_list contents) = + match Operation.of_list contents_list with + | Error _ -> + (* Cannot happen: rev_ops is non empty and contains only manager + operations *) + assert false + | Ok packed_contents_list -> packed_contents_list + in + let signature = Tezos_crypto.Signature.zero in + let branch = Tezos_crypto.Block_hash.zero in + let operation = + { + shell = {branch}; + protocol_data = Operation_data {contents; signature = Some signature}; + } + in + Data_encoding.Binary.length Operation.encoding operation + + (** Retrieve as many operations from the queue while remaining below the size + limit. *) + let get_operations_from_queue ~size_limit state = + let exception Reached_limit of L1_operation.t list in + let rev_ops = + try + Op_queue.fold + (fun _oph op ops -> + let new_ops = op :: ops in + let new_size = size_l1_batch state new_ops in + if new_size > size_limit then raise (Reached_limit ops) ; + new_ops) + state.queue + [] + with Reached_limit ops -> ops + in + List.rev rev_ops + + (* Ignore operations that are allowed to fail. *) + let ignore_ignorable_failing_operations state operations = function + | Ok res -> return (`Injected res) + | Error err -> + let open Lwt_result_syntax in + let+ operations_to_drop = + List.fold_left_es + (fun to_drop op -> + let (Manager operation) = op.L1_operation.manager_operation in + let*! retry = + Rollup.retry_unsuccessful_operation + state.rollup_node_state + operation + (Failed err) + in + match retry with + | Abort err -> fail err + | Retry -> return to_drop + | Forget -> return (op :: to_drop)) + [] + operations + in + `Ignored operations_to_drop + + (** [inject_pending_operations_for ~size_limit state pending] injects + operations from the pending queue [pending], whose total size does + not exceed [size_limit]. Upon successful injection, the + operations are removed from the queue and marked as injected. *) + let inject_pending_operations + ?(size_limit = Constants.max_operation_data_length) state = + let open Lwt_result_syntax in + (* Retrieve and remove operations from pending *) + let operations_to_inject = get_operations_from_queue ~size_limit state in + match operations_to_inject with + | [] -> return_unit + | _ -> ( + let*! () = + Event.(emit1 injecting_pending) + state + (List.length operations_to_inject) + in + let must_succeed = + Rollup.batch_must_succeed + @@ List.map + (fun op -> op.L1_operation.manager_operation) + operations_to_inject + in + let*! res = + inject_operations ~must_succeed state operations_to_inject + in + let* res = + ignore_ignorable_failing_operations state operations_to_inject res + in + match res with + | `Injected (oph, injected_operations) -> + (* Injection succeeded, remove from pending and add to injected *) + let* () = + List.iter_es + (fun op -> Op_queue.remove state.queue op.L1_operation.hash) + injected_operations + in + add_injected_operations state oph injected_operations + | `Ignored operations_to_drop -> + (* Injection failed but we ignore the failure. *) + let* () = + List.iter_es + (fun op -> Op_queue.remove state.queue op.L1_operation.hash) + operations_to_drop + in + return_unit) + + (** [register_included_operation state block level op] marks the manager + operations contained in the L1 batch [op] as being included in the [block] + of level [level], by moving the successful ones from the "injected" state + to the "included" state, and re-queuing the operations that should be + retried. *) + let register_included_operation state block level + (operation : Alpha_block_services.operation) = + let open Lwt_result_syntax in + let* injected_infos = remove_injected_operation state operation.hash in + match injected_infos with + | [] -> + (* No operations injected by us *) + return_unit + | _ -> + let apply (type kind) acc ~source:_ (op : kind manager_operation) + (result : kind Apply_results.manager_operation_result) = + match op with + | Reveal _ -> + (* Ignore public key revelations because, when present, they are + added by the injection function automatically. If we don't + ignore them, we may have more operations than we think we + injected (and end up in the assert false below). *) + acc + | _ -> ( + let* (injected : injected_info list), included, to_retry = acc in + let info, injected = + match injected with + | [] -> assert false + (* We should have the same number of injected operations and + included operations. *) + | i :: rest -> (i, rest) + in + match result with + | Applied _ -> return (injected, info.op :: included, to_retry) + | _ -> ( + let status = + match result with + | Applied _ -> assert false + | Backtracked (_, _) -> Backtracked + | Skipped _ -> Skipped + | Failed (_, err) -> Failed (Environment.wrap_tztrace err) + in + let*! retry = + Rollup.retry_unsuccessful_operation + state.rollup_node_state + op + status + in + match retry with + | Retry -> return (injected, included, info.op :: to_retry) + | Forget -> return (injected, included, to_retry) + | Abort err -> fail err)) + in + let apply_internal acc ~source:_ _op _result = acc in + let* unhandled_injected, included, to_retry = + Layer1_services.process_manager_operations + (return (injected_infos, [], [])) + [[operation]] + {apply; apply_internal} + in + assert (unhandled_injected = []) ; + let* () = + add_included_operations + state + operation.hash + block + level + (List.rev included) + in + List.iter_es + (add_pending_operation ~retry:true state) + (List.rev to_retry) + + (** [register_included_operations state block level oph] marks the known (by + this injector) manager operations contained in [block] as being included. *) + let register_included_operations state + (block : Alpha_block_services.block_info) = + List.iter_es + (List.iter_es (fun (op : Alpha_block_services.operation) -> + register_included_operation + state + block.hash + block.header.shell.level + op)) + block.Alpha_block_services.operations + + (** [revert_included_operations state block] marks the known (by this injector) + manager operations contained in [block] as not being included any more, + typically in the case of a reorganization where [block] is on an alternative + chain. The operations are put back in the pending queue. *) + let revert_included_operations state block = + let open Lwt_result_syntax in + let* revert_infos = forget_block state block in + let*! () = + Event.(emit1 revert_operations) + state + (List.map (fun o -> o.op.hash) revert_infos) + in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2814 + maybe put at the front of the queue for re-injection. *) + List.iter_es + (fun {op; _} -> + let {L1_operation.manager_operation = Manager mop; _} = op in + let*! requeue = + Rollup.retry_unsuccessful_operation + state.rollup_node_state + mop + Other_branch + in + match requeue with + | Retry -> add_pending_operation ~retry:true state op + | _ -> return_unit) + revert_infos + + (** [register_confirmed_level state confirmed_level] is called when the level + [confirmed_level] is known as confirmed. In this case, the operations of + block which are below this level are also considered as confirmed and are + removed from the "included" state. These operations cannot be part of a + reorganization so there will be no need to re-inject them anymore. *) + let register_confirmed_level state confirmed_level = + let open Lwt_result_syntax in + let*! () = + Event.(emit confirmed_level) + (state.signer.pkh, state.tags, confirmed_level) + in + Included_in_blocks.iter_es + (fun block (level, _operations) -> + if + level + <= Int32.sub confirmed_level (Int32.of_int state.retention_period) + then + let* _removed_ops = forget_block state block in + return_unit + else return_unit) + state.included.included_in_blocks + + (** [on_new_tezos_head state head reorg] is called when there is a new Tezos + head (with a potential reorganization [reorg]). It first reverts any blocks + that are in the alternative branch of the reorganization and then registers + the effect of the new branch (the newly included operation and confirmed + operations). *) + let on_new_tezos_head state (head : Alpha_block_services.block_info) + (reorg : Alpha_block_services.block_info reorg) = + let open Lwt_result_syntax in + let*! () = Event.(emit1 new_tezos_head) state head.hash in + let* () = + List.iter_es + (fun removed_block -> + revert_included_operations + state + removed_block.Alpha_block_services.hash) + (List.rev reorg.old_chain) + in + let* () = + List.iter_es + (fun added_block -> register_included_operations state added_block) + reorg.new_chain + in + (* Head is already included in the reorganization, so no need to process it + separately. *) + let confirmed_level = + Int32.sub + head.Alpha_block_services.header.shell.level + (Int32.of_int confirmations) + in + if confirmed_level >= 0l then register_confirmed_level state confirmed_level + else return_unit + + (* The request {Request.Inject} triggers an injection of the operations + the pending queue. *) + let on_inject state = inject_pending_operations state + + module Types = struct + type nonrec state = state + + type parameters = { + cctxt : Protocol_client_context.full; + constants : Constants.t; + data_dir : string; + rollup_node_state : Rollup.rollup_node_state; + retention_period : int; + strategy : injection_strategy; + tags : Tags.t; + } + end + + (* The worker for the injector. *) + module Worker = Worker.MakeSingle (Name) (Request) (Types) + + (* The queue for the requests to the injector worker is infinite. *) + type worker = Worker.infinite Worker.queue Worker.t + + let table = Worker.create_table Queue + + let tags_table = Tags_table.create 7 + + module Handlers = struct + type self = worker + + let on_request : + type r request_error. + worker -> + (r, request_error) Request.t -> + (r, request_error) result Lwt.t = + fun w request -> + let state = Worker.state w in + match request with + | Request.Add_pending op -> + (* The execution of the request handler is protected to avoid stopping the + worker in case of an exception. *) + protect @@ fun () -> add_pending_operation state op + | Request.New_tezos_head (head, reorg) -> + protect @@ fun () -> on_new_tezos_head state head reorg + | Request.Inject -> protect @@ fun () -> on_inject state + + type launch_error = error trace + + let on_launch _w signer + Types. + { + cctxt; + constants; + data_dir; + rollup_node_state; + retention_period; + strategy; + tags; + } = + trace (Step_failed "initialization") + @@ init_injector + cctxt + constants + ~data_dir + rollup_node_state + ~retention_period + ~signer + strategy + tags + + let on_error (type a b) w st (r : (a, b) Request.t) (errs : b) : + unit tzresult Lwt.t = + let open Lwt_result_syntax in + let state = Worker.state w in + let request_view = Request.view r in + let emit_and_return_errors errs = + (* Errors do not stop the worker but emit an entry in the log. *) + let*! () = Event.(emit3 request_failed) state request_view st errs in + return_unit + in + match r with + | Request.Add_pending _ -> emit_and_return_errors errs + | Request.New_tezos_head _ -> emit_and_return_errors errs + | Request.Inject -> emit_and_return_errors errs + + let on_completion w r _ st = + let state = Worker.state w in + match Request.view r with + | Request.View (Add_pending _ | New_tezos_head _) -> + Event.(emit2 request_completed_debug) state (Request.view r) st + | View Inject -> + Event.(emit2 request_completed_notice) state (Request.view r) st + + let on_no_request _ = Lwt.return_unit + + let on_close w = + let state = Worker.state w in + Tags.iter (Tags_table.remove tags_table) state.tags ; + Lwt.return_unit + end + + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2754 + Injector worker in a separate process *) + let init (cctxt : #Protocol_client_context.full) ~data_dir + ?(retention_period = 0) rollup_node_state ~signers = + let open Lwt_result_syntax in + assert (retention_period >= 0) ; + let signers_map = + List.fold_left + (fun acc (signer, strategy, tags) -> + let tags = Tags.of_list tags in + let strategy, tags = + match + Tezos_crypto.Signature.Public_key_hash.Map.find_opt signer acc + with + | None -> (strategy, tags) + | Some (other_strategy, other_tags) -> + let strategy = + match (strategy, other_strategy) with + | `Each_block, `Each_block -> `Each_block + | `Delay_block f, _ | _, `Delay_block f -> + (* Delay_block strategy takes over because we can always wait a + little bit more to inject operation which are to be injected + "each block". *) + `Delay_block f + in + (strategy, Tags.union other_tags tags) + in + Tezos_crypto.Signature.Public_key_hash.Map.add + signer + (strategy, tags) + acc) + Tezos_crypto.Signature.Public_key_hash.Map.empty + signers + in + let* constants = + Protocol.Constants_services.all cctxt (cctxt#chain, cctxt#block) + in + Tezos_crypto.Signature.Public_key_hash.Map.iter_es + (fun signer (strategy, tags) -> + let+ worker = + Worker.launch + table + signer + { + cctxt = (cctxt :> Protocol_client_context.full); + constants; + data_dir; + rollup_node_state; + retention_period; + strategy; + tags; + } + (module Handlers) + in + ignore worker) + signers_map + + let worker_of_signer signer_pkh = + match Worker.find_opt table signer_pkh with + | None -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2818 + maybe lazily start worker here *) + error (No_worker_for_source signer_pkh) + | Some worker -> ok worker + + let worker_of_tag tag = + match Tags_table.find_opt tags_table tag with + | None -> + Format.kasprintf + (fun s -> error (No_worker_for_tag s)) + "%a" + Rollup.Tag.pp + tag + | Some worker -> ok worker + + let add_pending_operation ?source op = + let open Lwt_result_syntax in + let l1_operation = L1_operation.make op in + let*? w = + match source with + | Some source -> worker_of_signer source + | None -> ( + match Rollup.operation_tag op with + | None -> error (No_worker_for_operation l1_operation) + | Some tag -> worker_of_tag tag) + in + let*! (_pushed : bool) = + Worker.Queue.push_request w (Request.Add_pending l1_operation) + in + return l1_operation.hash + + let new_tezos_head h reorg = + let open Lwt_syntax in + let workers = Worker.list table in + List.iter_p + (fun (_signer, w) -> + let* (_pushed : bool) = + Worker.Queue.push_request w (Request.New_tezos_head (h, reorg)) + in + return_unit) + workers + + let has_tag_in ~tags state = + match tags with + | None -> + (* Not filtering on tags *) + true + | Some tags -> not (Tags.disjoint state.tags tags) + + let time_until_next_block constants (header : Tezos_base.Block_header.t) = + let open Result_syntax in + let Constants.Parametric.{minimal_block_delay; delay_increment_per_round; _} + = + constants.Constants.parametric + in + let next_level_timestamp = + let* durations = + Round.Durations.create + ~first_round_duration:minimal_block_delay + ~delay_increment_per_round + in + let* predecessor_round = Fitness.round_from_raw header.shell.fitness in + Round.timestamp_of_round + durations + ~predecessor_timestamp:header.shell.timestamp + ~predecessor_round + ~round:Round.zero + in + let next_level_timestamp = + Result.value + next_level_timestamp + ~default: + (WithExceptions.Result.get_ok + ~loc:__LOC__ + Timestamp.(header.shell.timestamp +? minimal_block_delay)) + in + Ptime.diff + (Time.System.of_protocol_exn next_level_timestamp) + (Time.System.now ()) + + let delay_stategy state header f = + let open Lwt_syntax in + match state.strategy with + | `Each_block -> f () + | `Delay_block delay_factor -> + let time_until_next_block = + match header with + | None -> + state.constants.Constants.parametric.minimal_block_delay + |> Period.to_seconds |> Int64.to_float + | Some header -> + time_until_next_block state.constants header + |> Ptime.Span.to_float_s + in + let delay = time_until_next_block *. delay_factor in + if delay <= 0. then f () + else + let promise = + let* () = Event.(emit1 inject_wait) state delay in + let* () = Lwt_unix.sleep delay in + f () + in + ignore promise ; + return_unit + + let inject ?tags ?header () = + let workers = Worker.list table in + let tags = Option.map Tags.of_list tags in + List.iter_p + (fun (_signer, w) -> + let open Lwt_syntax in + let worker_state = Worker.state w in + if has_tag_in ~tags worker_state then + delay_stategy worker_state header @@ fun () -> + let* _pushed = Worker.Queue.push_request w Request.Inject in + return_unit + else Lwt.return_unit) + workers + + let shutdown () = + let workers = Worker.list table in + List.iter_p (fun (_signer, w) -> Worker.shutdown w) workers + + let op_status_in_worker state l1_hash = + match Op_queue.find_opt state.queue l1_hash with + | Some op -> Some (Pending op) + | None -> ( + match + Injected_operations.find state.injected.injected_operations l1_hash + with + | Some info -> Some (Injected info) + | None -> ( + match + Included_operations.find + state.included.included_operations + l1_hash + with + | Some info -> Some (Included info) + | None -> None)) + + let operation_status l1_hash = + let workers = Worker.list table in + List.find_map + (fun (_signer, w) -> op_status_in_worker (Worker.state w) l1_hash) + workers +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_functor.mli b/src/proto_016_PtMumbai/lib_injector/injector_functor.mli new file mode 100644 index 000000000000..183066b02a9a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_functor.mli @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Injector_sigs + +module Make (P : PARAMETERS) : + S with type rollup_node_state := P.rollup_node_state and type tag := P.Tag.t diff --git a/src/proto_016_PtMumbai/lib_injector/injector_sigs.ml b/src/proto_016_PtMumbai/lib_injector/injector_sigs.ml new file mode 100644 index 000000000000..1f19298c3703 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_sigs.ml @@ -0,0 +1,250 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(** Type to represent {e appoximate upper-bounds} for the fee and limits, used + to compute an upper bound on the size (in bytes) of an operation. *) +type approximate_fee_bound = { + fee : Tez.t; + counter : Manager_counter.t; + gas_limit : Gas.Arith.integral; + storage_limit : Z.t; +} + +type injection_strategy = + [ `Each_block (** Inject pending operations after each new L1 block *) + | `Delay_block of float + (** [`Delay_block f] strategy waits for [f] * the next block time to be + elapsed before injecting pending operations. This strategy allows for + maximizing the number of the same kind of operations to include in a + block. *) + ] + +(** Explanation for unsuccessful operations (that are included in a block). *) +type unsuccessful_status = + | Other_branch + (** The operation is included in a block that is not on the main chain + anymore, because of a reorganization. *) + | Backtracked + (** The operation is backtracked because of a further failing operation in + the same batch. *) + | Skipped + (** The operation is skipped because of a previous failing operation in + the same batch. *) + | Failed of error trace (** The operation failed with the provided error. *) + +(** Action to be taken for unsuccessful operation. *) +type retry_action = + | Retry (** The operation is retried by being re-queued for injection. *) + | Forget (** The operation is forgotten without error. *) + | Abort of error trace + (** The error for the failing operation should be propagated at a higher + level. *) + +(** Information stored about an L1 operation that was injected on a Tezos + node. *) +type injected_info = { + op : L1_operation.t; (** The L1 manager operation. *) + oph : Tezos_crypto.Operation_hash.t; + (** The hash of the operation which contains [op] (this can be an L1 batch + of several manager operations). *) +} + +(** Information stored about an L1 operation that was included in a Tezos + block. *) +type included_info = { + op : L1_operation.t; (** The L1 manager operation. *) + oph : Tezos_crypto.Operation_hash.t; + (** The hash of the operation which contains [op] (this can be an L1 batch + of several manager operations). *) + l1_block : Tezos_crypto.Block_hash.t; + (** The hash of the L1 block in which the operation was included. *) + l1_level : int32; (** The level of [l1_block]. *) +} + +(** Status of an operation in the injector. *) +type status = + | Pending of L1_operation.t (** The operation is pending injection. *) + | Injected of injected_info + (** The operation has been injected successfully in the. node *) + | Included of included_info + (** The operation has been included in a L1 block. *) + +let injected_info_encoding = + let open Data_encoding in + conv + (fun ({op; oph} : injected_info) -> (op, oph)) + (fun (op, oph) -> {op; oph}) + @@ merge_objs + L1_operation.encoding + (obj1 + (req + "layer1" + (obj1 (req "operation_hash" Tezos_crypto.Operation_hash.encoding)))) + +let included_info_encoding = + let open Data_encoding in + conv + (fun {op; oph; l1_block; l1_level} -> (op, (oph, l1_block, l1_level))) + (fun (op, (oph, l1_block, l1_level)) -> {op; oph; l1_block; l1_level}) + @@ merge_objs + L1_operation.encoding + (obj1 + (req + "layer1" + (obj3 + (req "operation_hash" Tezos_crypto.Operation_hash.encoding) + (req "block_hash" Tezos_crypto.Block_hash.encoding) + (req "level" int32)))) + +(** Signature for tags used in injector *) +module type TAG = sig + include Stdlib.Set.OrderedType + + include Stdlib.Hashtbl.HashedType with type t := t + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t +end + +(** Module type for parameter of functor {!Injector_functor.Make}. *) +module type PARAMETERS = sig + (** The type of the state for the rollup node that the injector can access *) + type rollup_node_state + + (** A module which contains the different tags for the injector *) + module Tag : TAG + + (** Where to put the events for this injector *) + val events_section : string list + + (** Coarse approximation for the number of operation of each tag we expect to + inject for each block. *) + val table_estimated_size : Tag.t -> int + + (** Action (see {!retry_action}) to be taken on unsuccessful operation (see + {!unsuccessful_status}). *) + val retry_unsuccessful_operation : + rollup_node_state -> + 'a manager_operation -> + unsuccessful_status -> + retry_action Lwt.t + + (** [ignore_failing_operation op] specifies if the injector should + ignore this operation when its simulation fails when trying to inject. + Returns: + - [`Ignore_keep] if the operation should be ignored but kept in the + pending queue, + - [`Ignore_drop] if the operation should be ignored and dropped from the + pending queue, + - [`Don't_ignore] if the failing operation should not be ignored and the + failure reported. + *) + + (** The tag of a manager operation. This is used to send operations to the + correct queue automatically (when signer is not provided) and to recover + persistent information. *) + val operation_tag : 'a manager_operation -> Tag.t option + + (** Returns the {e appoximate upper-bounds} for the fee and limits of an + operation, used to compute an upper bound on the size (in bytes) for this + operation. *) + val approximate_fee_bound : + rollup_node_state -> 'a manager_operation -> approximate_fee_bound + + (** Returns the fee_parameter (to compute fee w.r.t. gas, size, etc.) and the + caps of fee and burn for each operation. *) + val fee_parameter : + rollup_node_state -> 'a manager_operation -> Injection.fee_parameter + + (** When injecting the given [operations] in an L1 batch, if + [batch_must_succeed operations] returns [`All] then all the operations must + succeed in the simulation of injection. If it returns [`At_least_one], at + least one operation in the list [operations] must be successful in the + simulation. In any case, only operations which are known as successful will + be included in the injected L1 batch. {b Note}: Returning [`At_least_one] + allows to incrementally build "or-batches" by iteratively removing + operations that fail from the desired batch. *) + val batch_must_succeed : + packed_manager_operation list -> [`All | `At_least_one] +end + +(** Output signature for functor {!Injector_functor.Make}. *) +module type S = sig + type rollup_node_state + + type tag + + (** Initializes the injector with the rollup node state, for a list of + signers, and start the workers. Each signer has its own worker with a + queue of operations to inject. + + [retention_period] is the number of blocks for which the injector keeps + the included information for, must be positive or zero. By default (when + [0]), the injector will not keep information longer than necessary. It can + be useful to set this value to something [> 0] if we want to retrieve + information about operations included on L1 for a given period. *) + val init : + #Protocol_client_context.full -> + data_dir:string -> + ?retention_period:int -> + rollup_node_state -> + signers:(public_key_hash * injection_strategy * tag list) list -> + unit tzresult Lwt.t + + (** Add an operation as pending injection in the injector. If the source is + not provided, the operation is queued to the worker which handles the + corresponding tag. It returns the hash of the operation in the injector + queue. *) + val add_pending_operation : + ?source:public_key_hash -> + 'a manager_operation -> + L1_operation.hash tzresult Lwt.t + + (** Notify the injector of a new Tezos head. The injector marks the operations + appropriately (for instance reverted operations that are part of a + reorganization are put back in the pending queue). When an operation is + considered as {e confirmed}, it disappears from the injector. *) + val new_tezos_head : + Protocol_client_context.Alpha_block_services.block_info -> + Protocol_client_context.Alpha_block_services.block_info + Injector_common.reorg -> + unit Lwt.t + + (** Trigger an injection of the pending operations for all workers. If [tags] + is given, only the workers which have a tag in [tags] inject their pending + operations. [header] must be provided for the [`Delay_block] strategy to + compute the next block timestamp. *) + val inject : + ?tags:tag list -> ?header:Tezos_base.Block_header.t -> unit -> unit Lwt.t + + (** Shutdown the injectors, waiting for the ongoing request to be processed. *) + val shutdown : unit -> unit Lwt.t + + (** The status of an operation in the injector. *) + val operation_status : L1_operation.hash -> status option +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_tags.ml b/src/proto_016_PtMumbai/lib_injector/injector_tags.ml new file mode 100644 index 000000000000..1e92ff5de2cb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_tags.ml @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Make (Tag : Injector_sigs.TAG) = struct + include Set.Make (Tag) + + let pp ppf tags = + Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ ") + Tag.pp + ppf + (elements tags) + + let encoding = + let open Data_encoding in + conv elements of_list (list Tag.encoding) +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_tags.mli b/src/proto_016_PtMumbai/lib_injector/injector_tags.mli new file mode 100644 index 000000000000..9efa6842376a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_tags.mli @@ -0,0 +1,35 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Make a set of tags given a module for tags. *) +module Make (Tag : Injector_sigs.TAG) : sig + include Set.S with type elt = Tag.t + + (** Pretty print a set of tags *) + val pp : Format.formatter -> t -> unit + + (** Encoding for sets of tags *) + val encoding : t Data_encoding.t +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_worker_types.ml b/src/proto_016_PtMumbai/lib_injector/injector_worker_types.ml new file mode 100644 index 000000000000..7f86e158a775 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_worker_types.ml @@ -0,0 +1,108 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context +open Injector_common + +module Request = struct + type ('a, 'b) t = + | Add_pending : L1_operation.t -> (unit, error trace) t + | New_tezos_head : + Alpha_block_services.block_info * Alpha_block_services.block_info reorg + -> (unit, error trace) t + | Inject : (unit, error trace) t + + type view = View : _ t -> view + + let view req = View req + + let encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Add_pending" + (merge_objs + (obj1 (req "request" (constant "add_pending"))) + L1_operation.encoding) + (function View (Add_pending op) -> Some ((), op) | _ -> None) + (fun ((), op) -> View (Add_pending op)); + case + (Tag 1) + ~title:"New_tezos_head" + (obj3 + (req "request" (constant "new_tezos_head")) + (req "head" Alpha_block_services.block_info_encoding) + (req + "reorg" + (reorg_encoding Alpha_block_services.block_info_encoding))) + (function + | View (New_tezos_head (b, r)) -> Some ((), b, r) | _ -> None) + (fun ((), b, r) -> View (New_tezos_head (b, r))); + case + (Tag 2) + ~title:"Inject" + (obj1 (req "request" (constant "inject"))) + (function View Inject -> Some () | _ -> None) + (fun () -> View Inject); + ] + + let pp ppf (View r) = + match r with + | Add_pending op -> + Format.fprintf + ppf + "request add %a to pending queue" + L1_operation.Hash.pp + op.hash + | New_tezos_head (b, r) -> + Format.fprintf + ppf + "switching to new Tezos head %a" + Tezos_crypto.Block_hash.pp + b.Alpha_block_services.hash ; + if r.old_chain <> [] || r.new_chain <> [] then + Format.fprintf + ppf + ", with reorg of -%d +%d" + (List.length r.old_chain) + (List.length r.new_chain) + | Inject -> Format.fprintf ppf "injection" +end + +module Name = struct + type t = public_key_hash + + let encoding = Tezos_crypto.Signature.Public_key_hash.encoding + + let base = ["tx_rollup_injector"] + + let pp = Tezos_crypto.Signature.Public_key_hash.pp_short + + let equal = Tezos_crypto.Signature.Public_key_hash.equal +end diff --git a/src/proto_016_PtMumbai/lib_injector/injector_worker_types.mli b/src/proto_016_PtMumbai/lib_injector/injector_worker_types.mli new file mode 100644 index 000000000000..28c23d0a517d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/injector_worker_types.mli @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol_client_context +open Protocol +open Alpha_context +open Injector_common + +module Request : sig + type ('a, 'b) t = + | Add_pending : L1_operation.t -> (unit, error trace) t + | New_tezos_head : + Alpha_block_services.block_info * Alpha_block_services.block_info reorg + -> (unit, error trace) t + | Inject : (unit, error trace) t + + type view = View : _ t -> view + + include + Worker_intf.REQUEST + with type ('a, 'request_error) t := ('a, 'request_error) t + and type view := view +end + +module Name : Worker_intf.NAME with type t = public_key_hash diff --git a/src/proto_016_PtMumbai/lib_injector/l1_operation.ml b/src/proto_016_PtMumbai/lib_injector/l1_operation.ml new file mode 100644 index 000000000000..c140f9901087 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/l1_operation.ml @@ -0,0 +1,232 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Manager_operation = struct + type t = packed_manager_operation + + let encoding : t Data_encoding.t = + let open Data_encoding in + let open Operation.Encoding.Manager_operations in + let make (MCase {tag; name; encoding; select; proj; inj}) = + case + (Tag tag) + ~title:name + (merge_objs (obj1 (req "kind" (constant name))) encoding) + (fun o -> + match select o with None -> None | Some o -> Some ((), proj o)) + (fun ((), x) -> Manager (inj x)) + in + def "manager_operation" + @@ union + [ + make reveal_case; + make transaction_case; + make origination_case; + make delegation_case; + make set_deposits_limit_case; + make increase_paid_storage_case; + make register_global_constant_case; + make tx_rollup_origination_case; + make tx_rollup_submit_batch_case; + make tx_rollup_commit_case; + make tx_rollup_return_bond_case; + make tx_rollup_finalize_commitment_case; + make tx_rollup_remove_commitment_case; + make tx_rollup_rejection_case; + make tx_rollup_dispatch_tickets_case; + make transfer_ticket_case; + make dal_publish_slot_header_case; + make sc_rollup_originate_case; + make sc_rollup_add_messages_case; + make sc_rollup_cement_case; + make sc_rollup_publish_case; + make sc_rollup_refute_case; + make sc_rollup_timeout_case; + make sc_rollup_execute_outbox_message_case; + make sc_rollup_recover_bond_case; + ] + + let get_case : + type kind. + kind manager_operation -> kind Operation.Encoding.Manager_operations.case + = + let open Operation.Encoding.Manager_operations in + function + | Reveal _ -> reveal_case + | Transaction _ -> transaction_case + | Origination _ -> origination_case + | Delegation _ -> delegation_case + | Register_global_constant _ -> register_global_constant_case + | Set_deposits_limit _ -> set_deposits_limit_case + | Increase_paid_storage _ -> increase_paid_storage_case + | Update_consensus_key _ -> update_consensus_key_case + | Tx_rollup_origination -> tx_rollup_origination_case + | Tx_rollup_submit_batch _ -> tx_rollup_submit_batch_case + | Tx_rollup_commit _ -> tx_rollup_commit_case + | Tx_rollup_return_bond _ -> tx_rollup_return_bond_case + | Tx_rollup_finalize_commitment _ -> tx_rollup_finalize_commitment_case + | Tx_rollup_remove_commitment _ -> tx_rollup_remove_commitment_case + | Tx_rollup_rejection _ -> tx_rollup_rejection_case + | Tx_rollup_dispatch_tickets _ -> tx_rollup_dispatch_tickets_case + | Transfer_ticket _ -> transfer_ticket_case + | Dal_publish_slot_header _ -> dal_publish_slot_header_case + | Sc_rollup_originate _ -> sc_rollup_originate_case + | Sc_rollup_add_messages _ -> sc_rollup_add_messages_case + | Sc_rollup_cement _ -> sc_rollup_cement_case + | Sc_rollup_publish _ -> sc_rollup_publish_case + | Sc_rollup_refute _ -> sc_rollup_refute_case + | Sc_rollup_timeout _ -> sc_rollup_timeout_case + | Sc_rollup_execute_outbox_message _ -> + sc_rollup_execute_outbox_message_case + | Sc_rollup_recover_bond _ -> sc_rollup_recover_bond_case + | Zk_rollup_origination _ -> zk_rollup_origination_case + | Zk_rollup_publish _ -> zk_rollup_publish_case + | Zk_rollup_update _ -> zk_rollup_update_case + + let pp_kind ppf op = + let open Operation.Encoding.Manager_operations in + let (MCase {name; _}) = get_case op in + Format.pp_print_string ppf name + + let pp ppf (Manager op) = + match op with + | Tx_rollup_commit {commitment = {level; _}; _} -> + Format.fprintf + ppf + "commitment for rollup level %a" + Tx_rollup_level.pp + level + | Tx_rollup_rejection {level; message_position; _} -> + Format.fprintf + ppf + "rejection for commitment at level %a for message %d" + Tx_rollup_level.pp + level + message_position + | Tx_rollup_dispatch_tickets {level; tickets_info; _} -> + let pp_rollup_reveal ppf + Tx_rollup_reveal.{contents; ty; amount; ticketer; claimer; _} = + let pp_lazy_expr ppf e = + Michelson_v1_printer.print_expr_unwrapped + ppf + (Result.value + (Script_repr.force_decode e) + ~default:(Micheline.strip_locations (Micheline.Seq ((), [])))) + in + Format.fprintf + ppf + "%a tickets (%a, %a, %a) to %a" + Tx_rollup_l2_qty.pp + amount + Contract.pp + ticketer + pp_lazy_expr + ty + pp_lazy_expr + contents + Tezos_crypto.Signature.Public_key_hash.pp + claimer + in + Format.fprintf + ppf + "@[<v 2>dispatch withdrawals at rollup level %a: %a@]" + Tx_rollup_level.pp + level + (Format.pp_print_list pp_rollup_reveal) + tickets_info + | Sc_rollup_add_messages {messages} -> + Format.fprintf + ppf + "publishing %d messages to smart rollups' inbox" + (List.length messages) + | Sc_rollup_cement {rollup; commitment} -> + Format.fprintf + ppf + "cementing commitment %a of rollup %a" + Sc_rollup.Commitment.Hash.pp + commitment + Sc_rollup.Address.pp + rollup + | Sc_rollup_publish + {rollup; commitment = Sc_rollup.Commitment.{inbox_level; _}} -> + Format.fprintf + ppf + "publish commitment for level %a of rollup %a" + Raw_level.pp + inbox_level + Sc_rollup.Address.pp + rollup + | _ -> pp_kind ppf op +end + +module Hash = + Tezos_crypto.Blake2B.Make + (Tezos_crypto.Base58) + (struct + let name = "manager_operation_hash" + + let title = "A manager operation hash" + + let b58check_prefix = "\068\160\013" (* mop(53) *) + + let size = None + end) + +let () = + Tezos_crypto.Base58.check_encoded_prefix Hash.b58check_encoding "mop" 53 + +type hash = Hash.t + +type t = {hash : hash; manager_operation : packed_manager_operation} + +let hash_manager_operation op = + Hash.hash_bytes + [Data_encoding.Binary.to_bytes_exn Manager_operation.encoding op] + +let make manager_operation = + let manager_operation = Manager manager_operation in + let hash = hash_manager_operation manager_operation in + {hash; manager_operation} + +let encoding = + let open Data_encoding in + conv + (fun {hash; manager_operation} -> (hash, manager_operation)) + (fun (hash, manager_operation) -> {hash; manager_operation}) + @@ obj2 + (req "hash" Hash.encoding) + (req "manager_operation" Manager_operation.encoding) + +let pp ppf {hash; manager_operation} = + Format.fprintf + ppf + "%a (%a)" + Manager_operation.pp + manager_operation + Hash.pp + hash diff --git a/src/proto_016_PtMumbai/lib_injector/l1_operation.mli b/src/proto_016_PtMumbai/lib_injector/l1_operation.mli new file mode 100644 index 000000000000..21b13fbf32ff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_injector/l1_operation.mli @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(** Hash with b58check encoding mop(53), for hashes of L1 manager operations *) +module Hash : Tezos_crypto.S.HASH + +(** Alias for L1 operations hashes *) +type hash = Hash.t + +(** The type of L1 operations that are injected on Tezos by the rollup node *) +type t = private { + hash : hash; (** The hash of the L1 manager operation (without the source) *) + manager_operation : packed_manager_operation; (** The manager operation *) +} + +(** [make op] returns an L1 operation with the corresponding hash. *) +val make : 'a manager_operation -> t + +(** Encoding for L1 operations *) +val encoding : t Data_encoding.t + +(** Pretty printer for L1 operations. Only the relevant part for the rollup node + is printed. *) +val pp : Format.formatter -> t -> unit diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/dune b/src/proto_016_PtMumbai/lib_layer2_utils/dune new file mode 100644 index 000000000000..0caa6c78b11b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_layer2_utils/dune @@ -0,0 +1,19 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_layer2_utils_alpha) + (public_name tezos-layer2-utils-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-alpha + tezos-client-alpha) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha + -open Tezos_client_alpha)) diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml new file mode 100644 index 000000000000..22773e17db82 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml @@ -0,0 +1,129 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Apply_results +open Protocol_client_context.Alpha_block_services + +type 'accu successful_operation_processor = { + apply : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind manager_operation -> + 'kind Apply_results.successful_manager_operation_result -> + 'accu; + apply_internal : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind Apply_internal_results.internal_operation -> + 'kind Apply_internal_results.successful_internal_operation_result -> + 'accu; +} + +type 'accu operation_processor = { + apply : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind manager_operation -> + 'kind Apply_results.manager_operation_result -> + 'accu; + apply_internal : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind Apply_internal_results.internal_operation -> + 'kind Apply_internal_results.internal_operation_result -> + 'accu; +} + +let process_manager_operations operations accu f = + let rec on_operation_and_result : + type kind. _ -> kind Apply_results.contents_and_result_list -> _ = + fun accu -> function + | Single_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _} ) -> + let accu = f.apply accu ~source operation operation_result in + on_internal_operations accu source internal_operation_results + | Single_and_result (_, _) -> accu + | Cons_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _}, + rest ) -> + let accu = f.apply accu ~source operation operation_result in + let accu = + on_internal_operations accu source internal_operation_results + in + on_operation_and_result accu rest + and on_internal_operations accu source internal_operation_results = + let open Apply_internal_results in + List.fold_left + (fun accu (Internal_operation_result (operation, result)) -> + f.apply_internal accu ~source operation result) + accu + internal_operation_results + in + let process_contents accu + ({protocol_data = Operation_data {contents; _}; receipt; _} : operation) = + match receipt with + | Empty | Too_large | Receipt No_operation_metadata -> + (* This should case should not happen between [operations] is supposed + to be retrieved with `force_metadata:true` and assuming that the + tezos node is running in archive mode. *) + assert false + | Receipt (Operation_metadata {contents = results; _}) -> ( + match Apply_results.kind_equal_list contents results with + | Some Eq -> + on_operation_and_result accu + @@ Apply_results.pack_contents_list contents results + | None -> + (* Should not happen *) + assert false) + in + let process_operations = List.fold_left process_contents in + List.fold_left process_operations operations accu + +let process_applied_manager_operations operations accu + (f : _ successful_operation_processor) = + let apply (type kind) accu ~source (operation : kind manager_operation) + (result : kind Apply_results.manager_operation_result) = + match result with + | Applied result -> f.apply accu ~source operation result + | _ -> accu + in + let apply_internal (type kind) accu ~source + (operation : kind Apply_internal_results.internal_operation) + (result : kind Apply_internal_results.internal_operation_result) = + match result with + | Applied result -> f.apply_internal accu ~source operation result + | _ -> accu + in + process_manager_operations operations accu {apply; apply_internal} diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli new file mode 100644 index 000000000000..bbcf372491af --- /dev/null +++ b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli @@ -0,0 +1,74 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Protocol_client_context.Alpha_block_services + +type 'accu successful_operation_processor = { + apply : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind manager_operation -> + 'kind Apply_results.successful_manager_operation_result -> + 'accu; + apply_internal : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind Apply_internal_results.internal_operation -> + 'kind Apply_internal_results.successful_internal_operation_result -> + 'accu; +} + +type 'accu operation_processor = { + apply : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind manager_operation -> + 'kind Apply_results.manager_operation_result -> + 'accu; + apply_internal : + 'kind. + 'accu -> + source:public_key_hash -> + 'kind Apply_internal_results.internal_operation -> + 'kind Apply_internal_results.internal_operation_result -> + 'accu; +} + +(** [process_manager_operations accu operations operator] folds over the list of + manager operations in [operations] applying [operator] to transform [accu] + along the way. *) +val process_manager_operations : + 'a -> operation list list -> 'a operation_processor -> 'a + +(** [process_applied_manager_operations accu operations operator] folds over the + list of applied manager operations in [operations] applying [operator] to + transform [accu] along the way. *) +val process_applied_manager_operations : + 'a -> operation list list -> 'a successful_operation_processor -> 'a diff --git a/src/proto_016_PtMumbai/lib_parameters/default_parameters.ml b/src/proto_016_PtMumbai/lib_parameters/default_parameters.ml new file mode 100644 index 000000000000..e6a7a7e83825 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_parameters/default_parameters.ml @@ -0,0 +1,436 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +let tx_rollup_finality_period = 40_000 + +(** The challenge window is about a week with 30s block-time (604800s / 30s). + WARNING: changing this value also impacts + [sc_rollup_max_active_outbox_levels]. See below. *) +let sc_rollup_challenge_window_in_blocks = 20_160 + +(** Number of active levels kept for executing outbox messages. + + WARNING: Changing this value impacts the storage charge for + applying messages from the outbox. It also requires migration for + remapping existing active outbox levels to new indices. *) +let sc_rollup_max_active_outbox_levels = + Int32.of_int sc_rollup_challenge_window_in_blocks + +(** Maximum number of outbox messages per level. + + WARNING: changing this value impacts the storage size a rollup has to + pay for at origination time. *) +let sc_rollup_max_outbox_messages_per_level = 100 + +(** The timeout period is about a week with 30s block-time (604800s / 30s). + + It suffers from the same risk of censorship as + {!sc_rollup_challenge_windows_in_blocks} so we use the same value. +*) +let sc_rollup_timeout_period_in_blocks = 20_160 + +(* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3177 + + Think harder about those values. *) +let default_cryptobox_parameters = + { + Dal.page_size = 4096; + slot_size = 1 lsl 20; + redundancy_factor = 16; + number_of_shards = 2048; + } + +let default_dal = + Constants.Parametric. + { + feature_enable = false; + number_of_slots = 256; + attestation_lag = 1; + availability_threshold = 50; + cryptobox_parameters = default_cryptobox_parameters; + } + +let constants_mainnet = + let consensus_committee_size = 7000 in + let block_time = 15 in + let Constants.Generated. + { + consensus_threshold; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + } = + Constants.Generated.generate + ~consensus_committee_size + ~blocks_per_minute:{numerator = 60; denominator = block_time} + in + { + Constants.Parametric.preserved_cycles = 5; + blocks_per_cycle = 16384l; + blocks_per_commitment = 128l; + nonce_revelation_threshold = 512l; + blocks_per_stake_snapshot = 1024l; + cycles_per_voting_period = 5l; + hard_gas_limit_per_operation = Gas.Arith.(integral_of_int_exn 1_040_000); + hard_gas_limit_per_block = Gas.Arith.(integral_of_int_exn 2_600_000); + proof_of_work_threshold = Int64.(sub (shift_left 1L 46) 1L); + minimal_stake = Tez.(mul_exn one 6_000); + (* VDF's difficulty must be a multiple of `nonce_revelation_threshold` times + the block time. At the moment it is equal to 8B = 8000 * 5 * .2M with + - 8000 ~= 512 * 15 that is nonce_revelation_threshold * block time + - .2M ~= number of modular squaring per second on benchmark machine + with 2.8GHz CPU + - 5: security factor (strictly higher than the ratio between highest CPU + clock rate and benchmark machine that is 8.43/2.8 ~= 3 *) + vdf_difficulty = 8_000_000_000L; + seed_nonce_revelation_tip = + (match Tez.(one /? 8L) with Ok c -> c | Error _ -> assert false); + origination_size = 257; + baking_reward_fixed_portion (* 5_000_000 mutez *); + baking_reward_bonus_per_slot (* 2_143 mutez *); + endorsing_reward_per_slot (* 1_428 mutez *); + hard_storage_limit_per_operation = Z.of_int 60_000; + cost_per_byte = Tez.of_mutez_exn 250L; + quorum_min = 20_00l; + quorum_max = 70_00l; + min_proposal_quorum = 5_00l; + (* liquidity_baking_subsidy is 1/16th of maximum total rewards for a block *) + liquidity_baking_subsidy (* 1_250_000 mutez *); + (* 1/2 window size of 2000 blocks with precision of 1_000_000 + for integer computation *) + liquidity_baking_toggle_ema_threshold = 1_000_000_000l; + (* The rationale behind the value of this constant is that an + operation should be considered alive for about one hour: + + minimal_block_delay * max_operations_time_to_live = 3600 + + The unit for this value is a block. + *) + max_operations_time_to_live = 240; + minimal_block_delay = Period.of_seconds_exn (Int64.of_int block_time); + delay_increment_per_round = Period.of_seconds_exn 8L; + consensus_committee_size; + consensus_threshold; + (* 4667 slots *) + minimal_participation_ratio = {numerator = 2; denominator = 3}; + max_slashing_period = 2; + frozen_deposits_percentage = 10; + double_baking_punishment = Tez.(mul_exn one 640); + ratio_of_frozen_deposits_slashed_per_double_endorsement = + {numerator = 1; denominator = 2}; + (* The `testnet_dictator` should absolutely be None on mainnet *) + testnet_dictator = None; + initial_seed = None; + (* A cache for contract source code and storage. Its size has been + chosen not too exceed 100 000 000 bytes. *) + cache_script_size = 100_000_000; + (* A cache for the stake distribution for all cycles stored at any + moment: preserved_cycles + max_slashing_period + 1 = 8 currently. *) + cache_stake_distribution_cycles = 8; + (* One for the sampler state for all cycles stored at any moment (as above). *) + cache_sampler_state_cycles = 8; + tx_rollup = + { + enable = true; + (* Based on how storage burn is implemented for + transaction rollups, this means that a rollup operator + can create 100 inboxes (40 bytes per inbox) before + having to pay storage burn. *) + origination_size = 4_000; + (* Considering an average size of layer-2 operations of + 20, this gives a TPS per rollup higher than 400, and + the capability to have two rollups at full speed on + mainnet (as long as they do not reach scalability + issues related to proof size). *) + hard_size_limit_per_inbox = 500_000; + hard_size_limit_per_message = 5_000; + commitment_bond = Tez.of_mutez_exn 10_000_000_000L; + finality_period = tx_rollup_finality_period; + max_inboxes_count = tx_rollup_finality_period + 100; + (* [60_000] blocks is about two weeks. *) + withdraw_period = tx_rollup_finality_period; + max_messages_per_inbox = 1_010; + (* Must be greater than the withdraw period. *) + max_commitments_count = (2 * tx_rollup_finality_period) + 100; + cost_per_byte_ema_factor = 120; + (* Tickets are transmitted in batches in the + [Tx_rollup_dispatch_tickets] operation. + + The semantics is that this operation is used to + concretize the withdraw orders emitted by the layer-2, + one layer-1 operation per messages of an + inbox. Therefore, it is of significant importance that + a valid batch does not produce a list of withdraw + orders which could not fit in a layer-1 operation. + + With these values, at least 2048 bytes remain available + to store the rest of the operands of + [Tx_rollup_dispatch_tickets] (in practice, even more, + because we overapproximate the size of tickets). So we + are safe. *) + max_withdrawals_per_batch = 15; + max_ticket_payload_size = 2_048; + (* Must be smaller than maximum limit of a manager operation + (minus overhead), since we need to limit our proofs to those + that can fit in an operation. *) + rejection_max_proof_size = 30000; + (* This is the first block of cycle 618, which is expected to + be about one year after the activation of protocol J. See + https://tzstats.com/cycle/618 *) + sunset_level = 3_473_409l; + }; + dal = default_dal; + sc_rollup = + (let commitment_period_in_blocks = 30 in + { + enable = false; + (* The following value is chosen to prevent spam. *) + origination_size = 6_314; + challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + commitment_period_in_blocks; + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2756 + The following constants need to be refined. *) + stake_amount = Tez.of_mutez_exn 10_000_000_000L; + max_lookahead_in_blocks = 30_000l; + max_active_outbox_levels = sc_rollup_max_active_outbox_levels; + max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; + (* The default number of required sections in a dissection *) + number_of_sections_in_dissection = 32; + timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; + (* We store multiple cemented commitments because we want to + allow the execution of outbox messages against cemented + commitments that are older than the last cemented commitment. + The execution of an outbox message is a manager operation, + and manager operations are kept in the mempool for one + hour. Hence we only need to ensure that an outbox message + can be validated against a cemented commitment produced in the + last hour. If we assume that the rollup is operating without + issues, that is no commitments are being refuted and commitments + are published and cemented regularly by one rollup node, we can + expect commitments to be cemented approximately every 15 + minutes, or equivalently we can expect 5 commitments to be + published in one hour (at minutes 0, 15, 30, 45 and 60). + Therefore, we need to keep 5 cemented commitments to guarantee + that the execution of an outbox operation can always be + validated against a cemented commitment while it is in the + mempool. *) + max_number_of_stored_cemented_commitments = 5; + max_number_of_parallel_games = 32; + }); + zk_rollup = + { + enable = false; + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3726 + The following constants need to be refined. *) + origination_size = 4_000; + min_pending_to_process = 10; + }; + } + +(* Sandbox and test networks's Dal cryptobox are computed by this function: + - Redundancy_factor is provided as a parameter; + - The other fields are derived from mainnet's values, as divisions by the + provided factor. *) +let derive_cryptobox_parameters ~redundancy_factor ~mainnet_constants_divider = + let m = default_cryptobox_parameters in + { + Dal.redundancy_factor; + page_size = m.page_size / mainnet_constants_divider; + slot_size = m.slot_size / mainnet_constants_divider; + number_of_shards = m.number_of_shards / mainnet_constants_divider; + } + +let constants_sandbox = + let consensus_committee_size = 256 in + let block_time = 1 in + let Constants.Generated. + { + consensus_threshold = _; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + } = + Constants.Generated.generate + ~consensus_committee_size + ~blocks_per_minute:{numerator = 60; denominator = block_time} + in + { + constants_mainnet with + dal = + Constants.Parametric. + { + constants_mainnet.dal with + number_of_slots = 16; + cryptobox_parameters = + derive_cryptobox_parameters + ~redundancy_factor:8 + ~mainnet_constants_divider:32; + }; + Constants.Parametric.preserved_cycles = 2; + blocks_per_cycle = 8l; + blocks_per_commitment = 4l; + nonce_revelation_threshold = 4l; + blocks_per_stake_snapshot = 4l; + cycles_per_voting_period = 8l; + proof_of_work_threshold = Int64.of_int (-1); + vdf_difficulty = 50_000L; + liquidity_baking_subsidy; + minimal_block_delay = Period.of_seconds_exn (Int64.of_int block_time); + delay_increment_per_round = Period.one_second; + consensus_committee_size = 256; + consensus_threshold = 0; + baking_reward_fixed_portion (* 333_333 mutez *); + baking_reward_bonus_per_slot (* 3_921 mutez *); + endorsing_reward_per_slot (* 2_604 mutez *); + max_slashing_period = 2; + frozen_deposits_percentage = 5; + } + +let constants_test = + let consensus_committee_size = 25 in + let Constants.Generated. + { + consensus_threshold; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + } = + Constants.Generated.generate + ~consensus_committee_size + ~blocks_per_minute:{numerator = 2; denominator = 1} + in + { + constants_mainnet with + dal = + Constants.Parametric. + { + constants_mainnet.dal with + number_of_slots = 8; + cryptobox_parameters = + derive_cryptobox_parameters + ~redundancy_factor:4 + ~mainnet_constants_divider:64; + }; + Constants.Parametric.preserved_cycles = 3; + blocks_per_cycle = 12l; + blocks_per_commitment = 4l; + nonce_revelation_threshold = 4l; + blocks_per_stake_snapshot = 4l; + cycles_per_voting_period = 2l; + proof_of_work_threshold = Int64.of_int (-1); + vdf_difficulty = 50_000L; + liquidity_baking_subsidy; + consensus_committee_size; + consensus_threshold (* 17 slots *); + max_slashing_period = 2; + baking_reward_fixed_portion (* 10 tez *); + baking_reward_bonus_per_slot (* 1.25 tez *); + endorsing_reward_per_slot (* 0.8 tez *); + frozen_deposits_percentage = + 5 + (* not 10 so that multiplication and + divisions do not easily get + intermingled *); + } + +let test_commitments = + lazy + (List.map + (fun (bpkh, amount) -> + let blinded_public_key_hash = + Protocol.Blinded_public_key_hash.of_b58check_exn bpkh + in + let amount = Protocol.Alpha_context.Tez.of_mutez_exn amount in + {Protocol.Alpha_context.Commitment.blinded_public_key_hash; amount}) + [ + ("btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", 23932454669343L); + ("btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", 72954577464032L); + ("btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", 217487035428348L); + ("btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", 4092742372031L); + ("btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", 17590039016550L); + ("btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", 26322312350555L); + ("btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", 244951387881443L); + ("btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", 80065050465525L); + ("btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", 3569618927693L); + ("btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", 9034781424478L); + ]) + +let bootstrap_accounts_strings = + [ + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"; + "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9"; + "edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV"; + "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU"; + "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n"; + ] + +let bootstrap_balance = Tez.of_mutez_exn 4_000_000_000_000L + +let compute_accounts = + List.map (fun s -> + let public_key = Tezos_crypto.Signature.Public_key.of_b58check_exn s in + let public_key_hash = Tezos_crypto.Signature.Public_key.hash public_key in + Parameters. + { + public_key_hash; + public_key = Some public_key; + amount = bootstrap_balance; + delegate_to = None; + consensus_key = None; + }) + +let bootstrap_accounts = compute_accounts bootstrap_accounts_strings + +let make_bootstrap_account (pkh, pk, amount, delegate_to, consensus_key) = + Parameters. + { + public_key_hash = pkh; + public_key = Some pk; + amount; + delegate_to; + consensus_key; + } + +let parameters_of_constants ?(bootstrap_accounts = bootstrap_accounts) + ?(bootstrap_contracts = []) ?(commitments = []) constants = + Parameters. + { + bootstrap_accounts; + bootstrap_contracts; + commitments; + constants; + security_deposit_ramp_up_cycles = None; + no_reward_cycles = None; + } + +let json_of_parameters parameters = + Data_encoding.Json.construct Parameters.encoding parameters diff --git a/src/proto_016_PtMumbai/lib_parameters/default_parameters.mli b/src/proto_016_PtMumbai/lib_parameters/default_parameters.mli new file mode 100644 index 000000000000..f930bc38fd87 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_parameters/default_parameters.mli @@ -0,0 +1,52 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +val constants_mainnet : Constants.Parametric.t + +val constants_sandbox : Constants.Parametric.t + +val constants_test : Constants.Parametric.t + +val test_commitments : Commitment.t list lazy_t + +val make_bootstrap_account : + Tezos_crypto.Signature.public_key_hash + * Tezos_crypto.Signature.public_key + * Tez.t + * Tezos_crypto.Signature.public_key_hash option + * Tezos_crypto.Signature.public_key option -> + Parameters.bootstrap_account + +val parameters_of_constants : + ?bootstrap_accounts:Parameters.bootstrap_account list -> + ?bootstrap_contracts:Parameters.bootstrap_contract list -> + ?commitments:Commitment.t list -> + Constants.Parametric.t -> + Parameters.t + +val json_of_parameters : Parameters.t -> Data_encoding.json diff --git a/src/proto_016_PtMumbai/lib_parameters/dune b/src/proto_016_PtMumbai/lib_parameters/dune new file mode 100644 index 000000000000..ba6228fc1b09 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_parameters/dune @@ -0,0 +1,52 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_protocol_alpha_parameters) + (public_name tezos-protocol-alpha.parameters) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-environment + tezos-protocol-alpha) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha) + (modules (:standard \ gen))) + +(executable + (name gen) + (libraries + tezos-base + tezos-protocol-alpha.parameters + tezos-protocol-alpha) + (link_flags + (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha_parameters + -open Tezos_protocol_alpha) + (modules gen)) + +(rule + (targets sandbox-parameters.json) + (deps gen.exe) + (action (run %{deps} --sandbox))) + +(rule + (targets test-parameters.json) + (deps gen.exe) + (action (run %{deps} --test))) + +(rule + (targets mainnet-parameters.json) + (deps gen.exe) + (action (run %{deps} --mainnet))) + +(install + (package tezos-protocol-alpha) + (section lib) + (files sandbox-parameters.json test-parameters.json mainnet-parameters.json)) diff --git a/src/proto_016_PtMumbai/lib_parameters/gen.ml b/src/proto_016_PtMumbai/lib_parameters/gen.ml new file mode 100644 index 000000000000..8fcc504044e5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_parameters/gen.ml @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Prints the json encoding of the parametric constants of protocol alpha. + $ dune utop src/proto_alpha/lib_protocol/test/helpers/ constants.ml +*) + +let () = + let print_usage_and_fail s = + Printf.eprintf "Usage: %s [ --sandbox | --test | --mainnet ]" Sys.argv.(0) ; + raise (Invalid_argument s) + in + let dump parameters file = + let str = + Data_encoding.Json.to_string + (Default_parameters.json_of_parameters parameters) + in + let fd = open_out file in + output_string fd str ; + close_out fd + in + if Array.length Sys.argv < 2 then print_usage_and_fail "" + else + match Sys.argv.(1) with + | "--sandbox" -> + dump + Default_parameters.(parameters_of_constants constants_sandbox) + "sandbox-parameters.json" + | "--test" -> + dump + Default_parameters.( + parameters_of_constants + ~commitments:(Lazy.force test_commitments) + constants_sandbox) + "test-parameters.json" + | "--mainnet" -> + dump + Default_parameters.(parameters_of_constants constants_mainnet) + "mainnet-parameters.json" + | s -> print_usage_and_fail s diff --git a/src/proto_016_PtMumbai/lib_plugin/RPC.ml b/src/proto_016_PtMumbai/lib_plugin/RPC.ml new file mode 100644 index 000000000000..8302e417096d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/RPC.ml @@ -0,0 +1,3496 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment +open Alpha_context +open Environment.Error_monad + +(** The assumed number of blocks between operation-creation time and + the actual time when the operation is included in a block. *) +let default_operation_inclusion_latency = 3 + +let parse_operation (op : Operation.raw) = + match + Data_encoding.Binary.of_bytes_opt Operation.protocol_data_encoding op.proto + with + | Some protocol_data -> ok {shell = op.shell; protocol_data} + | None -> error Plugin_errors.Cannot_parse_operation + +let path = RPC_path.(open_root / "helpers") + +let elab_conf = + Script_ir_translator_config.make + ~keep_extra_types_for_interpreter_logging:true + +module Registration = struct + let patched_services = + ref (RPC_directory.empty : Updater.rpc_context RPC_directory.t) + + let register0_fullctxt ~chunked s f = + patched_services := + RPC_directory.register ~chunked !patched_services s (fun ctxt q i -> + Services_registration.rpc_init ctxt `Head_level >>=? fun ctxt -> + f ctxt q i) + + let register0 ~chunked s f = + register0_fullctxt ~chunked s (fun {context; _} -> f context) + + let register0_fullctxt_successor_level ~chunked s f = + patched_services := + RPC_directory.register ~chunked !patched_services s (fun ctxt q i -> + let mode = + if q#successor_level then `Successor_level else `Head_level + in + Services_registration.rpc_init ctxt mode >>=? fun ctxt -> f ctxt q i) + + let register0_successor_level ~chunked s f = + register0_fullctxt_successor_level ~chunked s (fun {context; _} -> + f context) + + let register0_noctxt ~chunked s f = + patched_services := + RPC_directory.register ~chunked !patched_services s (fun _ q i -> f q i) + + let opt_register0_fullctxt ~chunked s f = + patched_services := + RPC_directory.opt_register ~chunked !patched_services s (fun ctxt q i -> + Services_registration.rpc_init ctxt `Head_level >>=? fun ctxt -> + f ctxt q i) + + let opt_register0 ~chunked s f = + opt_register0_fullctxt ~chunked s (fun {context; _} -> f context) + + let register1_fullctxt ~chunked s f = + patched_services := + RPC_directory.register + ~chunked + !patched_services + s + (fun (ctxt, arg) q i -> + Services_registration.rpc_init ctxt `Head_level >>=? fun ctxt -> + f ctxt arg q i) + + let opt_register1_fullctxt ~chunked s f = + patched_services := + RPC_directory.opt_register + ~chunked + !patched_services + s + (fun (ctxt, arg) q i -> + Services_registration.rpc_init ctxt `Head_level >>=? fun ctxt -> + f ctxt arg q i) + + let register1 ~chunked s f = + register1_fullctxt ~chunked s (fun {context; _} x -> f context x) + + let opt_register1 ~chunked s f = + opt_register1_fullctxt ~chunked s (fun {context; _} x -> f context x) + + let register2_fullctxt ~chunked s f = + patched_services := + RPC_directory.register + ~chunked + !patched_services + s + (fun ((ctxt, arg1), arg2) q i -> + Services_registration.rpc_init ctxt `Head_level >>=? fun ctxt -> + f ctxt arg1 arg2 q i) + + let register2 ~chunked s f = + register2_fullctxt ~chunked s (fun {context; _} a1 a2 q i -> + f context a1 a2 q i) +end + +let unparsing_mode_encoding = + let open Script_ir_unparser in + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Readable" + (constant "Readable") + (function Readable -> Some () | Optimized | Optimized_legacy -> None) + (fun () -> Readable); + case + (Tag 1) + ~title:"Optimized" + (constant "Optimized") + (function Optimized -> Some () | Readable | Optimized_legacy -> None) + (fun () -> Optimized); + case + (Tag 2) + ~title:"Optimized_legacy" + (constant "Optimized_legacy") + (function Optimized_legacy -> Some () | Readable | Optimized -> None) + (fun () -> Optimized_legacy); + ] + +module Scripts = struct + module S = struct + open Data_encoding + + let path = RPC_path.(path / "scripts") + + let run_code_input_encoding = + merge_objs + (obj10 + (req "script" Script.expr_encoding) + (req "storage" Script.expr_encoding) + (req "input" Script.expr_encoding) + (req "amount" Tez.encoding) + (opt "balance" Tez.encoding) + (req "chain_id" Tezos_crypto.Chain_id.encoding) + (opt "source" Contract.encoding) + (opt "payer" Contract.implicit_encoding) + (opt "self" Contract.originated_encoding) + (dft "entrypoint" Entrypoint.simple_encoding Entrypoint.default)) + (obj4 + (opt "unparsing_mode" unparsing_mode_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (opt "now" Script_timestamp.encoding) + (opt "level" Script_int.n_encoding)) + + let run_code_output_encoding = + conv + (fun (storage, operations, lazy_storage_diff) -> + (storage, operations, lazy_storage_diff)) + (fun (storage, operations, lazy_storage_diff) -> + (storage, operations, lazy_storage_diff)) + (obj3 + (req "storage" Script.expr_encoding) + (req + "operations" + (list Apply_internal_results.internal_operation_encoding)) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + + let trace_code_input_encoding = run_code_input_encoding + + let trace_encoding : Script_typed_ir.execution_trace encoding = + def "scripted.trace" @@ list + @@ obj3 + (req "location" Script.location_encoding) + (req "gas" Gas.Arith.z_fp_encoding) + (req "stack" (list Script.expr_encoding)) + + let trace_code_output_encoding = + conv + (fun (storage, operations, trace, lazy_storage_diff) -> + (storage, operations, trace, lazy_storage_diff)) + (fun (storage, operations, trace, lazy_storage_diff) -> + (storage, operations, trace, lazy_storage_diff)) + (obj4 + (req "storage" Script.expr_encoding) + (req + "operations" + (list Apply_internal_results.internal_operation_encoding)) + (req "trace" trace_encoding) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + + let run_tzip4_view_encoding = + let open Data_encoding in + obj10 + (req "contract" Contract.originated_encoding) + (req "entrypoint" Entrypoint.simple_encoding) + (req "input" Script.expr_encoding) + (req "chain_id" Tezos_crypto.Chain_id.encoding) + (opt "source" Contract.encoding) + (opt "payer" Contract.implicit_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (req "unparsing_mode" unparsing_mode_encoding) + (opt "now" Script_timestamp.encoding) + (opt "level" Script_int.n_encoding) + + let run_script_view_encoding = + let open Data_encoding in + merge_objs + (obj10 + (req "contract" Contract.originated_encoding) + (req "view" (string Plain)) + (req "input" Script.expr_encoding) + (dft "unlimited_gas" bool false) + (req "chain_id" Tezos_crypto.Chain_id.encoding) + (opt "source" Contract.encoding) + (opt "payer" Contract.implicit_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (req "unparsing_mode" unparsing_mode_encoding) + (opt "now" Script_timestamp.encoding)) + (obj1 (opt "level" Script_int.n_encoding)) + + let run_code = + RPC_service.post_service + ~description:"Run a piece of code in the current context" + ~query:RPC_query.empty + ~input:run_code_input_encoding + ~output:run_code_output_encoding + RPC_path.(path / "run_code") + + let trace_code = + RPC_service.post_service + ~description: + "Run a piece of code in the current context, keeping a trace" + ~query:RPC_query.empty + ~input:trace_code_input_encoding + ~output:trace_code_output_encoding + RPC_path.(path / "trace_code") + + let run_tzip4_view = + RPC_service.post_service + ~description: + "Simulate a call to a view following the TZIP-4 standard. See \ + https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints." + ~input:run_tzip4_view_encoding + ~output:(obj1 (req "data" Script.expr_encoding)) + ~query:RPC_query.empty + (* This path should be deprecated in the future *) + RPC_path.(path / "run_view") + + let run_script_view = + RPC_service.post_service + ~description:"Simulate a call to a michelson view" + ~input:run_script_view_encoding + ~output:(obj1 (req "data" Script.expr_encoding)) + ~query:RPC_query.empty + RPC_path.(path / "run_script_view") + + let typecheck_code = + RPC_service.post_service + ~description:"Typecheck a piece of code in the current context" + ~query:RPC_query.empty + ~input: + (obj4 + (req "program" Script.expr_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (opt "legacy" bool) + (opt "show_types" bool)) + ~output: + (obj2 + (req "type_map" Script_tc_errors_registration.type_map_enc) + (req "gas" Gas.encoding)) + RPC_path.(path / "typecheck_code") + + let script_size = + RPC_service.post_service + ~description:"Compute the size of a script in the current context" + ~query:RPC_query.empty + ~input: + (obj4 + (req "program" Script.expr_encoding) + (req "storage" Script.expr_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (opt "legacy" bool)) + ~output:(obj1 (req "script_size" int31)) + RPC_path.(path / "script_size") + + let typecheck_data = + RPC_service.post_service + ~description: + "Check that some data expression is well formed and of a given type \ + in the current context" + ~query:RPC_query.empty + ~input: + (obj4 + (req "data" Script.expr_encoding) + (req "type" Script.expr_encoding) + (opt "gas" Gas.Arith.z_integral_encoding) + (opt "legacy" bool)) + ~output:(obj1 (req "gas" Gas.encoding)) + RPC_path.(path / "typecheck_data") + + let pack_data = + RPC_service.post_service + ~description: + "Computes the serialized version of some data expression using the \ + same algorithm as script instruction PACK" + ~input: + (obj3 + (req "data" Script.expr_encoding) + (req "type" Script.expr_encoding) + (opt "gas" Gas.Arith.z_integral_encoding)) + ~output:(obj2 (req "packed" (bytes Hex)) (req "gas" Gas.encoding)) + ~query:RPC_query.empty + RPC_path.(path / "pack_data") + + let normalize_data = + RPC_service.post_service + ~description: + "Normalizes some data expression using the requested unparsing mode" + ~input: + (obj4 + (req "data" Script.expr_encoding) + (req "type" Script.expr_encoding) + (req "unparsing_mode" unparsing_mode_encoding) + (opt "legacy" bool)) + ~output:(obj1 (req "normalized" Script.expr_encoding)) + ~query:RPC_query.empty + RPC_path.(path / "normalize_data") + + let normalize_script = + RPC_service.post_service + ~description: + "Normalizes a Michelson script using the requested unparsing mode" + ~input: + (obj2 + (req "script" Script.expr_encoding) + (req "unparsing_mode" unparsing_mode_encoding)) + ~output:(obj1 (req "normalized" Script.expr_encoding)) + ~query:RPC_query.empty + RPC_path.(path / "normalize_script") + + let normalize_type = + RPC_service.post_service + ~description: + "Normalizes some Michelson type by expanding `pair a b c` as `pair a \ + (pair b c)" + ~input:(obj1 (req "type" Script.expr_encoding)) + ~output:(obj1 (req "normalized" Script.expr_encoding)) + ~query:RPC_query.empty + RPC_path.(path / "normalize_type") + + let run_operation = + RPC_service.post_service + ~description: + "Run an operation with the context of the given block and without \ + signature checks. Return the operation application result, \ + including the consumed gas. This RPC does not support consensus \ + operations." + ~query:RPC_query.empty + ~input: + (obj2 + (req "operation" Operation.encoding) + (req "chain_id" Tezos_crypto.Chain_id.encoding)) + ~output:Apply_results.operation_data_and_metadata_encoding + RPC_path.(path / "run_operation") + + let simulate_query = + let open RPC_query in + query (fun successor_level -> + object + method successor_level = successor_level + end) + |+ flag + ~descr: + "If true, the simulation is done on the successor level of the \ + current context." + "successor_level" + (fun t -> t#successor_level) + |> seal + + let simulate_operation = + RPC_service.post_service + ~description: + "Simulate running an operation at some future moment (based on the \ + number of blocks given in the `latency` argument), and return the \ + operation application result. The result is the same as \ + run_operation except for the consumed gas, which depends on the \ + contents of the cache at that future moment. This RPC estimates \ + future gas consumption by trying to predict the state of the cache \ + using some heuristics." + ~query:simulate_query + ~input: + (obj4 + (opt "blocks_before_activation" int32) + (req "operation" Operation.encoding) + (req "chain_id" Tezos_crypto.Chain_id.encoding) + (dft "latency" int16 default_operation_inclusion_latency)) + ~output:Apply_results.operation_data_and_metadata_encoding + RPC_path.(path / "simulate_operation") + + let simulate_tx_rollup_operation = + RPC_service.post_service + ~description:"Simulate a tx rollup operation" + ~query:RPC_query.empty + ~input: + (obj4 + (opt "blocks_before_activation" int32) + (req "operation" Operation.encoding) + (req "chain_id" Tezos_crypto.Chain_id.encoding) + (dft "latency" int16 default_operation_inclusion_latency)) + ~output:Apply_results.operation_data_and_metadata_encoding + RPC_path.(path / "simulate_tx_rollup_operation") + + let entrypoint_type = + RPC_service.post_service + ~description:"Return the type of the given entrypoint" + ~query:RPC_query.empty + ~input: + (obj2 + (req "script" Script.expr_encoding) + (dft "entrypoint" Entrypoint.simple_encoding Entrypoint.default)) + ~output:(obj1 (req "entrypoint_type" Script.expr_encoding)) + RPC_path.(path / "entrypoint") + + let list_entrypoints = + RPC_service.post_service + ~description:"Return the list of entrypoints of the given script" + ~query:RPC_query.empty + ~input:(obj1 (req "script" Script.expr_encoding)) + ~output: + (obj2 + (dft + "unreachable" + (Data_encoding.list + (obj1 + (req + "path" + (Data_encoding.list + Michelson_v1_primitives.prim_encoding)))) + []) + (req "entrypoints" (assoc Script.expr_encoding))) + RPC_path.(path / "entrypoints") + end + + module type UNPARSING_MODE = sig + val unparsing_mode : Script_ir_unparser.unparsing_mode + end + + module Traced_interpreter (Unparsing_mode : UNPARSING_MODE) = struct + type log_element = + | Log : + context + * Script.location + * ('a * 's) + * ('a, 's) Script_typed_ir.stack_ty + -> log_element + + let unparse_stack ctxt (stack, stack_ty) = + (* We drop the gas limit as this function is only used for debugging/errors. *) + let ctxt = Gas.set_unlimited ctxt in + let rec unparse_stack : + type a s. + (a, s) Script_typed_ir.stack_ty * (a * s) -> + Script.expr list tzresult Lwt.t = function + | Bot_t, (EmptyCell, EmptyCell) -> return_nil + | Item_t (ty, rest_ty), (v, rest) -> + Script_ir_translator.unparse_data + ctxt + Unparsing_mode.unparsing_mode + ty + v + >>=? fun (data, _ctxt) -> + unparse_stack (rest_ty, rest) >|=? fun rest -> data :: rest + in + unparse_stack (stack_ty, stack) + + let trace_logger ctxt : Script_typed_ir.logger = + Script_interpreter_logging.make + (module struct + let log : log_element list ref = ref [] + + let log_interp _ ctxt loc sty stack = + log := Log (ctxt, loc, stack, sty) :: !log + + let log_entry _ _ctxt _loc _sty _stack = () + + let log_exit _ ctxt loc sty stack = + log := Log (ctxt, loc, stack, sty) :: !log + + let log_control _ = () + + let get_log () = + List.fold_left_es + (fun (old_ctxt, l) (Log (ctxt, loc, stack, stack_ty)) -> + let consumed_gas = Gas.consumed ~since:old_ctxt ~until:ctxt in + trace + Plugin_errors.Cannot_serialize_log + (unparse_stack ctxt (stack, stack_ty)) + >>=? fun stack -> return (ctxt, (loc, consumed_gas, stack) :: l)) + (ctxt, []) + (List.rev !log) + >>=? fun (_ctxt, res) -> return (Some (List.rev res)) + end) + + let execute ctxt step_constants ~script ~entrypoint ~parameter = + let logger = trace_logger ctxt in + Script_interpreter.execute + ~logger + ~cached_script:None + ctxt + Unparsing_mode.unparsing_mode + step_constants + ~script + ~entrypoint + ~parameter + ~internal:true + >>=? fun res -> + logger.get_log () >|=? fun trace -> + let trace = Option.value ~default:[] trace in + (res, trace) + end + + let typecheck_data : + legacy:bool -> + context -> + Script.expr * Script.expr -> + context tzresult Lwt.t = + fun ~legacy ctxt (data, exp_ty) -> + record_trace + (Script_tc_errors.Ill_formed_type (None, exp_ty, 0)) + (Script_ir_translator.parse_passable_ty + ctxt + ~legacy + (Micheline.root exp_ty)) + >>?= fun (Ex_ty exp_ty, ctxt) -> + trace_eval + (fun () -> + let exp_ty = Script_ir_unparser.serialize_ty_for_error exp_ty in + Script_tc_errors.Ill_typed_data (None, data, exp_ty)) + (let allow_forged = + true + (* Safe since we ignore the value afterwards. *) + in + Script_ir_translator.parse_data + ctxt + ~elab_conf:(elab_conf ~legacy ()) + ~allow_forged + exp_ty + (Micheline.root data)) + >|=? fun (_, ctxt) -> ctxt + + module Unparse_types = struct + (* Same as the unparsing functions for types in Script_ir_translator but + does not consume gas and never folds (pair a (pair b c)) *) + + open Micheline + open Michelson_v1_primitives + open Script_typed_ir + + let unparse_memo_size ~loc memo_size = + let z = Alpha_context.Sapling.Memo_size.unparse_to_z memo_size in + Int (loc, z) + + let rec unparse_ty : + type a ac loc. + loc:loc -> (a, ac) ty -> (loc, Script.prim) Micheline.node = + fun ~loc ty -> + let return (name, args, annot) = Prim (loc, name, args, annot) in + match ty with + | Unit_t -> return (T_unit, [], []) + | Int_t -> return (T_int, [], []) + | Nat_t -> return (T_nat, [], []) + | Signature_t -> return (T_signature, [], []) + | String_t -> return (T_string, [], []) + | Bytes_t -> return (T_bytes, [], []) + | Mutez_t -> return (T_mutez, [], []) + | Bool_t -> return (T_bool, [], []) + | Key_hash_t -> return (T_key_hash, [], []) + | Key_t -> return (T_key, [], []) + | Timestamp_t -> return (T_timestamp, [], []) + | Address_t -> return (T_address, [], []) + | Tx_rollup_l2_address_t -> return (T_tx_rollup_l2_address, [], []) + | Operation_t -> return (T_operation, [], []) + | Chain_id_t -> return (T_chain_id, [], []) + | Never_t -> return (T_never, [], []) + | Bls12_381_g1_t -> return (T_bls12_381_g1, [], []) + | Bls12_381_g2_t -> return (T_bls12_381_g2, [], []) + | Bls12_381_fr_t -> return (T_bls12_381_fr, [], []) + | Contract_t (ut, _meta) -> + let t = unparse_ty ~loc ut in + return (T_contract, [t], []) + | Pair_t (utl, utr, _meta, _) -> + let annot = [] in + let tl = unparse_ty ~loc utl in + let tr = unparse_ty ~loc utr in + return (T_pair, [tl; tr], annot) + | Union_t (utl, utr, _meta, _) -> + let annot = [] in + let tl = unparse_ty ~loc utl in + let tr = unparse_ty ~loc utr in + return (T_or, [tl; tr], annot) + | Lambda_t (uta, utr, _meta) -> + let ta = unparse_ty ~loc uta in + let tr = unparse_ty ~loc utr in + return (T_lambda, [ta; tr], []) + | Option_t (ut, _meta, _) -> + let annot = [] in + let ut = unparse_ty ~loc ut in + return (T_option, [ut], annot) + | List_t (ut, _meta) -> + let t = unparse_ty ~loc ut in + return (T_list, [t], []) + | Ticket_t (ut, _meta) -> + let t = unparse_ty ~loc ut in + return (T_ticket, [t], []) + | Set_t (ut, _meta) -> + let t = unparse_ty ~loc ut in + return (T_set, [t], []) + | Map_t (uta, utr, _meta) -> + let ta = unparse_ty ~loc uta in + let tr = unparse_ty ~loc utr in + return (T_map, [ta; tr], []) + | Big_map_t (uta, utr, _meta) -> + let ta = unparse_ty ~loc uta in + let tr = unparse_ty ~loc utr in + return (T_big_map, [ta; tr], []) + | Sapling_transaction_t memo_size -> + return (T_sapling_transaction, [unparse_memo_size ~loc memo_size], []) + | Sapling_transaction_deprecated_t memo_size -> + return + ( T_sapling_transaction_deprecated, + [unparse_memo_size ~loc memo_size], + [] ) + | Sapling_state_t memo_size -> + return (T_sapling_state, [unparse_memo_size ~loc memo_size], []) + | Chest_t -> return (T_chest, [], []) + | Chest_key_t -> return (T_chest_key, [], []) + end + + let rec pp_instr_name : + type a b c d. + Format.formatter -> (a, b, c, d) Script_typed_ir.kinstr -> unit = + let open Script_typed_ir in + let open Format in + fun fmt -> function + | IDrop _ -> pp_print_string fmt "DROP" + | IDup _ -> pp_print_string fmt "DUP" + | ISwap _ -> pp_print_string fmt "SWAP" + | IConst _ -> pp_print_string fmt "CONST" + | ICons_pair _ -> pp_print_string fmt "PAIR" + | ICar _ -> pp_print_string fmt "CAR" + | ICdr _ -> pp_print_string fmt "CDR" + | IUnpair _ -> pp_print_string fmt "UNPAIR" + | ICons_some _ -> pp_print_string fmt "SOME" + | ICons_none _ -> pp_print_string fmt "NONE" + | IIf_none _ -> pp_print_string fmt "IF_NONE" + | IOpt_map _ -> pp_print_string fmt "MAP" + | ICons_left _ -> pp_print_string fmt "LEFT" + | ICons_right _ -> pp_print_string fmt "RIGHT" + | IIf_left _ -> pp_print_string fmt "IF_LEFT" + | ICons_list _ -> pp_print_string fmt "CONS" + | INil _ -> pp_print_string fmt "NIL" + | IIf_cons _ -> pp_print_string fmt "IF_CONS" + | IList_map _ -> pp_print_string fmt "MAP" + | IList_iter _ -> pp_print_string fmt "ITER" + | IList_size _ -> pp_print_string fmt "SIZE" + | IEmpty_set _ -> pp_print_string fmt "EMPTY_SET" + | ISet_iter _ -> pp_print_string fmt "ITER" + | ISet_mem _ -> pp_print_string fmt "MEM" + | ISet_update _ -> pp_print_string fmt "UPDATE" + | ISet_size _ -> pp_print_string fmt "SIZE" + | IEmpty_map _ -> pp_print_string fmt "EMPTY_MAP" + | IMap_map _ -> pp_print_string fmt "MAP" + | IMap_iter _ -> pp_print_string fmt "ITER" + | IMap_mem _ -> pp_print_string fmt "MEM" + | IMap_get _ -> pp_print_string fmt "GET" + | IMap_update _ -> pp_print_string fmt "UPDATE" + | IMap_get_and_update _ -> pp_print_string fmt "GET_AND_UPDATE" + | IMap_size _ -> pp_print_string fmt "SIZE" + | IEmpty_big_map _ -> pp_print_string fmt "EMPTY_BIG_MAP" + | IBig_map_mem _ -> pp_print_string fmt "MEM" + | IBig_map_get _ -> pp_print_string fmt "GET" + | IBig_map_update _ -> pp_print_string fmt "UPDATE" + | IBig_map_get_and_update _ -> pp_print_string fmt "GET_AND_UPDATE" + | IConcat_string _ -> pp_print_string fmt "CONCAT" + | IConcat_string_pair _ -> pp_print_string fmt "CONCAT" + | ISlice_string _ -> pp_print_string fmt "SLICE" + | IString_size _ -> pp_print_string fmt "SIZE" + | IConcat_bytes _ -> pp_print_string fmt "CONCAT" + | IConcat_bytes_pair _ -> pp_print_string fmt "CONCAT" + | ISlice_bytes _ -> pp_print_string fmt "SLICE" + | IBytes_size _ -> pp_print_string fmt "SIZE" + | IBytes_nat _ -> pp_print_string fmt "BYTES" + | INat_bytes _ -> pp_print_string fmt "NAT" + | IBytes_int _ -> pp_print_string fmt "BYTES" + | IInt_bytes _ -> pp_print_string fmt "INT" + | IAdd_seconds_to_timestamp _ -> pp_print_string fmt "ADD" + | IAdd_timestamp_to_seconds _ -> pp_print_string fmt "ADD" + | ISub_timestamp_seconds _ -> pp_print_string fmt "SUB" + | IDiff_timestamps _ -> pp_print_string fmt "DIFF" + | IAdd_tez _ -> pp_print_string fmt "ADD" + | ISub_tez _ -> pp_print_string fmt "SUB_MUTEZ" + | ISub_tez_legacy _ -> pp_print_string fmt "SUB" + | IMul_teznat _ | IMul_nattez _ -> pp_print_string fmt "MUL" + | IEdiv_teznat _ -> pp_print_string fmt "EDIV" + | IEdiv_tez _ -> pp_print_string fmt "EDIV" + | IOr _ -> pp_print_string fmt "OR" + | IAnd _ -> pp_print_string fmt "AND" + | IXor _ -> pp_print_string fmt "XOR" + | INot _ -> pp_print_string fmt "NOT" + | IIs_nat _ -> pp_print_string fmt "ISNAT" + | INeg _ -> pp_print_string fmt "NEG" + | IAbs_int _ -> pp_print_string fmt "ABS" + | IInt_nat _ -> pp_print_string fmt "INT" + | IAdd_int _ | IAdd_nat _ -> pp_print_string fmt "ADD" + | ISub_int _ -> pp_print_string fmt "SUB" + | IMul_int _ | IMul_nat _ -> pp_print_string fmt "MUL" + | IEdiv_int _ | IEdiv_nat _ -> pp_print_string fmt "EDIV" + | ILsl_nat _ -> pp_print_string fmt "LSL" + | ILsl_bytes _ -> pp_print_string fmt "LSL" + | ILsr_nat _ -> pp_print_string fmt "LSR" + | ILsr_bytes _ -> pp_print_string fmt "LSR" + | IOr_nat _ -> pp_print_string fmt "OR" + | IOr_bytes _ -> pp_print_string fmt "OR" + | IAnd_nat _ -> pp_print_string fmt "AND" + | IAnd_int_nat _ -> pp_print_string fmt "AND" + | IAnd_bytes _ -> pp_print_string fmt "AND" + | IXor_nat _ -> pp_print_string fmt "XOR" + | IXor_bytes _ -> pp_print_string fmt "XOR" + | INot_int _ -> pp_print_string fmt "NOT" + | INot_bytes _ -> pp_print_string fmt "NOT" + | IIf _ -> pp_print_string fmt "IF" + | ILoop _ -> pp_print_string fmt "LOOP" + | ILoop_left _ -> pp_print_string fmt "LOOP_LEFT" + | IDip _ -> pp_print_string fmt "DIP" + | IExec _ -> pp_print_string fmt "EXEC" + | IApply _ -> pp_print_string fmt "APPLY" + | ILambda (_, Lam _, _) -> pp_print_string fmt "LAMBDA" + | ILambda (_, LamRec _, _) -> pp_print_string fmt "LAMBDA_REC" + | IFailwith _ -> pp_print_string fmt "FAILWITH" + | ICompare _ -> pp_print_string fmt "COMPARE" + | IEq _ -> pp_print_string fmt "EQ" + | INeq _ -> pp_print_string fmt "NEQ" + | ILt _ -> pp_print_string fmt "LT" + | IGt _ -> pp_print_string fmt "GT" + | ILe _ -> pp_print_string fmt "LE" + | IGe _ -> pp_print_string fmt "GE" + | IAddress _ -> pp_print_string fmt "ADDRESS" + | IContract _ -> pp_print_string fmt "CONTACT" + | IView _ -> pp_print_string fmt "VIEW" + | ITransfer_tokens _ -> pp_print_string fmt "TRANSFER_TOKENS" + | IImplicit_account _ -> pp_print_string fmt "IMPLICIT_ACCOUNT" + | ICreate_contract _ -> pp_print_string fmt "CREATE_CONTRACT" + | ISet_delegate _ -> pp_print_string fmt "SET_DELEGATE" + | INow _ -> pp_print_string fmt "NOW" + | IMin_block_time _ -> pp_print_string fmt "MIN_BLOCK_TIME" + | IBalance _ -> pp_print_string fmt "BALANCE" + | ILevel _ -> pp_print_string fmt "LEVEL" + | ICheck_signature _ -> pp_print_string fmt "CHECK_SIGNATURE" + | IHash_key _ -> pp_print_string fmt "HASH_KEY" + | IPack _ -> pp_print_string fmt "PACK" + | IBlake2b _ -> pp_print_string fmt "BLAKE2B" + | ISha3 _ -> pp_print_string fmt "SHA3" + | ISha256 _ -> pp_print_string fmt "SHA256" + | ISha512 _ -> pp_print_string fmt "SHA512" + | IUnpack _ -> pp_print_string fmt "UNPACK" + | ISource _ -> pp_print_string fmt "SOURCE" + | ISender _ -> pp_print_string fmt "SENDER" + | ISelf _ -> pp_print_string fmt "SELF" + | ISelf_address _ -> pp_print_string fmt "SELF_ADDRESS" + | IAmount _ -> pp_print_string fmt "AMOUNT" + | ISapling_empty_state _ -> pp_print_string fmt "SAPLING_EMPTY_STATE" + | ISapling_verify_update _ | ISapling_verify_update_deprecated _ -> + pp_print_string fmt "SAPLING_VERIFY_UPDATE" + | IDig _ -> pp_print_string fmt "DIG" + | IDug _ -> pp_print_string fmt "DUG" + | IDipn _ -> pp_print_string fmt "DIP" + | IDropn _ -> pp_print_string fmt "DROP" + | IChainId _ -> pp_print_string fmt "CHAIN_ID" + | INever _ -> pp_print_string fmt "NEVER" + | IVoting_power _ -> pp_print_string fmt "VOTING_POWER" + | ITotal_voting_power _ -> pp_print_string fmt "TOTAL_VOTING_POWER" + | IKeccak _ -> pp_print_string fmt "KECCAK" + | IAdd_bls12_381_g1 _ | IAdd_bls12_381_g2 _ | IAdd_bls12_381_fr _ -> + pp_print_string fmt "ADD" + | IMul_bls12_381_g1 _ | IMul_bls12_381_g2 _ | IMul_bls12_381_fr _ + | IMul_bls12_381_z_fr _ | IMul_bls12_381_fr_z _ -> + pp_print_string fmt "MUL" + | IInt_bls12_381_fr _ -> pp_print_string fmt "INT" + | INeg_bls12_381_g1 _ | INeg_bls12_381_g2 _ | INeg_bls12_381_fr _ -> + pp_print_string fmt "NEG" + | IPairing_check_bls12_381 _ -> pp_print_string fmt "PAIRING_CHECK" + | IComb _ -> pp_print_string fmt "PAIR" + | IUncomb _ -> pp_print_string fmt "UNPAIR" + | IComb_get _ -> pp_print_string fmt "GET" + | IComb_set _ -> pp_print_string fmt "UPDATE" + | IDup_n _ -> pp_print_string fmt "DUP" + | ITicket _ -> pp_print_string fmt "TICKET" + | ITicket_deprecated _ -> pp_print_string fmt "TICKET_DEPRECATED" + | IRead_ticket _ -> pp_print_string fmt "READ_TICKET" + | ISplit_ticket _ -> pp_print_string fmt "SPLIT_TICKET" + | IJoin_tickets _ -> pp_print_string fmt "JOIN_TICKETS" + | IOpen_chest _ -> pp_print_string fmt "OPEN_CHEST" + | IEmit _ -> pp_print_string fmt "EMIT" + | IHalt _ -> pp_print_string fmt "[halt]" + | ILog (_, _, _, _, instr) -> + Format.fprintf fmt "log/%a" pp_instr_name instr + + type error += Run_operation_does_not_support_consensus_operations + + let () = + let description = + "The run_operation RPC does not support consensus operations." + in + register_error_kind + `Permanent + ~id:"run_operation_does_not_support_consensus_operations" + ~title:"Run operation does not support consensus operations" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function + | Run_operation_does_not_support_consensus_operations -> Some () + | _ -> None) + (fun () -> Run_operation_does_not_support_consensus_operations) + + (** Validate and apply the operation but skip signature checks; do + not support consensus operations. + + Return the unchanged operation protocol data, and the operation + receipt ie. metadata containing balance updates, consumed gas, + application success or failure, etc. *) + let run_operation_service rpc_ctxt () (packed_operation, chain_id) = + let {Services_registration.context; block_header; _} = rpc_ctxt in + (match packed_operation.protocol_data with + | Operation_data {contents = Single (Preendorsement _); _} + | Operation_data {contents = Single (Endorsement _); _} + | Operation_data {contents = Single (Dal_attestation _); _} -> + error Run_operation_does_not_support_consensus_operations + | _ -> ok ()) + >>?= fun () -> + let oph = Operation.hash_packed packed_operation in + let validity_state = Validate.begin_no_predecessor_info context chain_id in + Validate.validate_operation + ~check_signature:false + validity_state + oph + packed_operation + >>=? fun _validate_operation_state -> + Raw_level.of_int32 block_header.level >>?= fun predecessor_level -> + let application_mode = + Apply.Partial_construction + {predecessor_level; predecessor_fitness = block_header.fitness} + in + let application_state = + Apply. + { + ctxt = context; + chain_id; + mode = application_mode; + op_count = 0; + migration_balance_updates = []; + liquidity_baking_toggle_ema = Liquidity_baking.Toggle_EMA.zero; + implicit_operations_results = []; + } + in + Apply.apply_operation application_state oph packed_operation + >|=? fun (_ctxt, op_metadata) -> + (packed_operation.protocol_data, op_metadata) + + (* + + The execution of an operation depends on the state of the + cache. In particular, gas consumption is usually impacted by + cache hits and misses. + + Unfortunately, the state of the cache is different between the + context at operation-creation time and the context when is + included in a block. + + Therefore, the simulation tries to predict the state of the + cache in a [time_in_blocks] assumed to be close to the inclusion + time of the operation. + + *) + let simulate_operation_service rpc_ctxt + (_simulate_query : < successor_level : bool >) + (blocks_before_activation, op, chain_id, time_in_blocks) = + let {Services_registration.context; _} = rpc_ctxt in + Cache.Admin.future_cache_expectation + context + ~time_in_blocks + ?blocks_before_activation + >>=? fun context -> + run_operation_service {rpc_ctxt with context} () (op, chain_id) + + let default_from_context ctxt get = function + | None -> get ctxt + | Some x -> return x + + (* A convenience type for return values of [ensure_contracts_exist] below. *) + type run_code_config = { + balance : Tez.t; + self : Contract_hash.t; + payer : Tezos_crypto.Signature.public_key_hash; + source : Contract.t; + } + + (* 4_000_000 ꜩ *) + let default_balance = Tez.of_mutez_exn 4_000_000_000_000L + + let register () = + let originate_dummy_contract ctxt script balance = + let ctxt = Origination_nonce.init ctxt Tezos_crypto.Operation_hash.zero in + Contract.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, dummy_contract_hash) -> + let dummy_contract = Contract.Originated dummy_contract_hash in + Contract.raw_originate + ctxt + ~prepaid_bootstrap_storage:false + dummy_contract_hash + ~script:(script, None) + >>=? fun ctxt -> + Token.transfer + ~origin:Simulation + ctxt + `Minted + (`Contract dummy_contract) + balance + >>=? fun (ctxt, _) -> return (ctxt, dummy_contract_hash) + in + let source_and_payer ~src_opt ~pay_opt ~default_src = + match (src_opt, pay_opt) with + | None, None -> + ( Contract.Originated default_src, + Tezos_crypto.Signature.Public_key_hash.zero ) + | Some c, None -> (c, Tezos_crypto.Signature.Public_key_hash.zero) + | None, Some c -> (Contract.Implicit c, c) + | Some src, Some pay -> (src, pay) + in + let configure_contracts ctxt script balance ~src_opt ~pay_opt ~self_opt = + (match self_opt with + | None -> + let balance = Option.value ~default:default_balance balance in + originate_dummy_contract ctxt script balance >>=? fun (ctxt, addr) -> + return (ctxt, addr, balance) + | Some addr -> + default_from_context + ctxt + (fun c -> Contract.get_balance c @@ Contract.Originated addr) + balance + >>=? fun bal -> return (ctxt, addr, bal)) + >>=? fun (ctxt, self, balance) -> + let source, payer = + source_and_payer ~src_opt ~pay_opt ~default_src:self + in + return (ctxt, {balance; self; source; payer}) + in + let script_entrypoint_type ctxt expr entrypoint = + let ctxt = Gas.set_unlimited ctxt in + let legacy = false in + let open Script_ir_translator in + parse_toplevel ctxt ~legacy expr >>=? fun ({arg_type; _}, ctxt) -> + Lwt.return + ( parse_parameter_ty_and_entrypoints ctxt ~legacy arg_type + >>? fun (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, _) -> + Gas_monad.run ctxt + @@ Script_ir_translator.find_entrypoint + ~error_details:(Informative ()) + arg_type + entrypoints + entrypoint + >>? fun (r, _ctxt) -> + r >|? fun (Ex_ty_cstr {original_type_expr; _}) -> + Micheline.strip_locations original_type_expr ) + in + let script_view_type ctxt contract expr view = + let ctxt = Gas.set_unlimited ctxt in + let legacy = false in + let open Script_ir_translator in + parse_toplevel ctxt ~legacy expr >>=? fun ({views; _}, _) -> + Lwt.return + ( Script_string.of_string view >>? fun view_name -> + match Script_map.get view_name views with + | None -> error (View_helpers.View_not_found (contract, view)) + | Some Script_typed_ir.{input_ty; output_ty; _} -> + ok (input_ty, output_ty) ) + in + Registration.register0 + ~chunked:true + S.run_code + (fun + ctxt + () + ( ( code, + storage, + parameter, + amount, + balance, + chain_id, + src_opt, + pay_opt, + self_opt, + entrypoint ), + (unparsing_mode, gas, now, level) ) + -> + let unparsing_mode = Option.value ~default:Readable unparsing_mode in + let storage = Script.lazy_expr storage in + let code = Script.lazy_expr code in + configure_contracts + ctxt + {storage; code} + balance + ~src_opt + ~pay_opt + ~self_opt + >>=? fun (ctxt, {self; source; payer; balance}) -> + let gas = + match gas with + | Some gas -> gas + | None -> Constants.hard_gas_limit_per_operation ctxt + in + let ctxt = Gas.set_limit ctxt gas in + let now = + match now with None -> Script_timestamp.now ctxt | Some t -> t + in + let level = + match level with + | None -> + (Level.current ctxt).level |> Raw_level.to_int32 + |> Script_int.of_int32 |> Script_int.abs + | Some z -> z + in + let step_constants = + let open Script_interpreter in + {source; payer; self; amount; balance; chain_id; now; level} + in + Script_interpreter.execute + ctxt + unparsing_mode + step_constants + ~cached_script:None + ~script:{storage; code} + ~entrypoint + ~parameter + ~internal:true + >|=? fun ( { + script = _; + code_size = _; + Script_interpreter.storage; + operations; + lazy_storage_diff; + ticket_diffs = _; + ticket_receipt = _; + }, + _ ) -> + ( storage, + Apply_internal_results.packed_internal_operations operations, + lazy_storage_diff )) ; + Registration.register0 + ~chunked:true + S.trace_code + (fun + ctxt + () + ( ( code, + storage, + parameter, + amount, + balance, + chain_id, + src_opt, + pay_opt, + self_opt, + entrypoint ), + (unparsing_mode, gas, now, level) ) + -> + let unparsing_mode = Option.value ~default:Readable unparsing_mode in + let storage = Script.lazy_expr storage in + let code = Script.lazy_expr code in + configure_contracts + ctxt + {storage; code} + balance + ~src_opt + ~pay_opt + ~self_opt + >>=? fun (ctxt, {self; source; payer; balance}) -> + let gas = + match gas with + | Some gas -> gas + | None -> Constants.hard_gas_limit_per_operation ctxt + in + let ctxt = Gas.set_limit ctxt gas in + let now = + match now with None -> Script_timestamp.now ctxt | Some t -> t + in + let level = + match level with + | None -> + (Level.current ctxt).level |> Raw_level.to_int32 + |> Script_int.of_int32 |> Script_int.abs + | Some z -> z + in + let step_constants = + let open Script_interpreter in + {source; payer; self; amount; balance; chain_id; now; level} + in + let module Unparsing_mode = struct + let unparsing_mode = unparsing_mode + end in + let module Interp = Traced_interpreter (Unparsing_mode) in + Interp.execute + ctxt + step_constants + ~script:{storage; code} + ~entrypoint + ~parameter + >|=? fun ( ( { + script = _; + code_size = _; + Script_interpreter.storage; + operations; + lazy_storage_diff; + ticket_diffs = _; + ticket_receipt = _; + }, + _ctxt ), + trace ) -> + ( storage, + Apply_internal_results.packed_internal_operations operations, + trace, + lazy_storage_diff )) ; + Registration.register0 + ~chunked:true + S.run_tzip4_view + (fun + ctxt + () + ( contract_hash, + entrypoint, + input, + chain_id, + src_opt, + pay_opt, + gas, + unparsing_mode, + now, + level ) + -> + Contract.get_script ctxt contract_hash >>=? fun (ctxt, script_opt) -> + Option.fold + ~some:ok + ~none:(error View_helpers.Viewed_contract_has_no_script) + script_opt + >>?= fun script -> + Script_repr.(force_decode script.code) >>?= fun decoded_script -> + script_entrypoint_type ctxt decoded_script entrypoint + >>=? fun view_ty -> + View_helpers.extract_view_output_type entrypoint view_ty >>?= fun ty -> + let contract = Contract.Originated contract_hash in + Contract.get_balance ctxt contract >>=? fun balance -> + Error_monad.trace View_helpers.View_callback_origination_failed + @@ originate_dummy_contract + ctxt + (View_helpers.make_tzip4_viewer_script ty) + Tez.zero + >>=? fun (ctxt, viewer_contract) -> + let source, payer = + source_and_payer ~src_opt ~pay_opt ~default_src:contract_hash + in + let gas = + Option.value + ~default:(Constants.hard_gas_limit_per_operation ctxt) + gas + in + let ctxt = Gas.set_limit ctxt gas in + let now = + match now with None -> Script_timestamp.now ctxt | Some t -> t + in + let level = + match level with + | None -> + (Level.current ctxt).level |> Raw_level.to_int32 + |> Script_int.of_int32 |> Script_int.abs + | Some z -> z + in + let step_constants = + let open Script_interpreter in + { + source; + payer; + self = contract_hash; + amount = Tez.zero; + balance; + chain_id; + now; + level; + } + in + let parameter = + View_helpers.make_view_parameter + (Micheline.root input) + (Contract.Originated viewer_contract) + in + Script_interpreter.execute + ctxt + unparsing_mode + step_constants + ~script + ~cached_script:None + ~entrypoint + ~parameter + ~internal:true + >>=? fun ( { + Script_interpreter.operations; + script = _; + code_size = _; + storage = _; + lazy_storage_diff = _; + ticket_diffs = _; + ticket_receipt = _; + }, + _ctxt ) -> + Lwt.return + (View_helpers.extract_parameter_from_operations + entrypoint + operations + viewer_contract)) ; + Registration.register0 + ~chunked:true + S.run_script_view + (fun + ctxt + () + ( ( contract_hash, + view, + input, + unlimited_gas, + chain_id, + src_opt, + pay_opt, + gas, + unparsing_mode, + now ), + level ) + -> + Contract.get_script ctxt contract_hash >>=? fun (ctxt, script_opt) -> + Option.fold + ~some:ok + ~none:(Error_monad.error View_helpers.Viewed_contract_has_no_script) + script_opt + >>?= fun script -> + Script_repr.(force_decode script.code) >>?= fun decoded_script -> + let contract = Contract.Originated contract_hash in + script_view_type ctxt contract_hash decoded_script view + >>=? fun (input_ty, output_ty) -> + Contract.get_balance ctxt contract >>=? fun balance -> + let source, payer = + source_and_payer ~src_opt ~pay_opt ~default_src:contract_hash + in + let now = + match now with None -> Script_timestamp.now ctxt | Some t -> t + in + (* Using [Gas.set_unlimited] won't work, since the interpreter doesn't + use this mode (see !4034#note_774734253) and still consumes gas. + Our best shot to emulate this is to use the maximum amount of + milligas possible which is represented by [2^62 - 1] according to + [Saturation_repr.saturated], which is [max_int]. *) + let max_gas = Gas.fp_of_milligas_int max_int in + let gas = + Option.value + ~default:(Constants.hard_gas_limit_per_operation ctxt) + gas + in + let ctxt = + if unlimited_gas then Gas.set_limit ctxt max_gas + else Gas.set_limit ctxt gas + in + let level = + Option.value + level + ~default: + ((Level.current ctxt).level |> Raw_level.to_int32 + |> Script_int.of_int32 |> Script_int.abs) + in + let step_constants = + { + Script_interpreter.source; + payer; + self = contract_hash; + amount = Tez.zero; + balance; + chain_id; + now; + level; + } + in + let viewer_script = + View_helpers.make_michelson_viewer_script + contract + view + input + input_ty + output_ty + in + let parameter = + Micheline.(strip_locations (Prim (0, Script.D_Unit, [], []))) + in + Script_interpreter.execute + ctxt + unparsing_mode + step_constants + ~script:viewer_script + ~cached_script:None + ~entrypoint:Entrypoint.default + ~parameter + ~internal:true + >>=? fun ( { + Script_interpreter.operations = _; + script = _; + code_size = _; + storage; + lazy_storage_diff = _; + ticket_diffs = _; + ticket_receipt = _; + }, + _ctxt ) -> + View_helpers.extract_value_from_storage storage >>?= fun value -> + return (Micheline.strip_locations value)) ; + Registration.register0 + ~chunked:false + S.typecheck_code + (fun ctxt () (expr, maybe_gas, legacy, show_types) -> + let legacy = Option.value ~default:false legacy in + let show_types = Option.value ~default:true show_types in + let ctxt = + match maybe_gas with + | None -> Gas.set_unlimited ctxt + | Some gas -> Gas.set_limit ctxt gas + in + Script_ir_translator.typecheck_code ~legacy ~show_types ctxt expr + >|=? fun (res, ctxt) -> (res, Gas.level ctxt)) ; + Registration.register0 + ~chunked:false + S.script_size + (fun ctxt () (expr, storage, maybe_gas, legacy) -> + let legacy = Option.value ~default:false legacy in + let ctxt = + match maybe_gas with + | None -> Gas.set_unlimited ctxt + | Some gas -> Gas.set_limit ctxt gas + in + let elab_conf = elab_conf ~legacy () in + let code = Script.lazy_expr expr in + Script_ir_translator.parse_code ~elab_conf ctxt ~code + >>=? fun ( Ex_code + (Code + { + code; + arg_type; + storage_type; + views; + entrypoints; + code_size; + }), + ctxt ) -> + Script_ir_translator.parse_data + ~elab_conf + ~allow_forged:true + ctxt + storage_type + (Micheline.root storage) + >>=? fun (storage, _) -> + let script = + Script_ir_translator.Ex_script + (Script + { + code; + arg_type; + storage_type; + views; + entrypoints; + code_size; + storage; + }) + in + let size, cost = Script_ir_translator.script_size script in + Gas.consume ctxt cost >>?= fun _ctxt -> return @@ size) ; + + Registration.register0 + ~chunked:false + S.typecheck_data + (fun ctxt () (data, ty, maybe_gas, legacy) -> + let legacy = Option.value ~default:false legacy in + let ctxt = + match maybe_gas with + | None -> Gas.set_unlimited ctxt + | Some gas -> Gas.set_limit ctxt gas + in + typecheck_data ~legacy ctxt (data, ty) >|=? fun ctxt -> Gas.level ctxt) ; + Registration.register0 + ~chunked:true + S.pack_data + (fun ctxt () (expr, typ, maybe_gas) -> + let open Script_ir_translator in + let ctxt = + match maybe_gas with + | None -> Gas.set_unlimited ctxt + | Some gas -> Gas.set_limit ctxt gas + in + parse_packable_ty ctxt ~legacy:true (Micheline.root typ) + >>?= fun (Ex_ty typ, ctxt) -> + parse_data + ctxt + ~elab_conf:(elab_conf ~legacy:true ()) + ~allow_forged:true + typ + (Micheline.root expr) + >>=? fun (data, ctxt) -> + Script_ir_translator.pack_data ctxt typ data >|=? fun (bytes, ctxt) -> + (bytes, Gas.level ctxt)) ; + Registration.register0 + ~chunked:true + S.normalize_data + (fun ctxt () (expr, typ, unparsing_mode, legacy) -> + let open Script_ir_translator in + let legacy = Option.value ~default:false legacy in + let ctxt = Gas.set_unlimited ctxt in + Script_ir_translator.parse_any_ty ctxt ~legacy (Micheline.root typ) + >>?= fun (Ex_ty typ, ctxt) -> + parse_data + ctxt + ~elab_conf:(elab_conf ~legacy ()) + ~allow_forged:true + typ + (Micheline.root expr) + >>=? fun (data, ctxt) -> + Script_ir_translator.unparse_data ctxt unparsing_mode typ data + >|=? fun (normalized, _ctxt) -> normalized) ; + Registration.register0 + ~chunked:true + S.normalize_script + (fun ctxt () (script, unparsing_mode) -> + let ctxt = Gas.set_unlimited ctxt in + Script_ir_translator.unparse_code + ctxt + unparsing_mode + (Micheline.root script) + >|=? fun (normalized, _ctxt) -> normalized) ; + Registration.register0 ~chunked:true S.normalize_type (fun ctxt () typ -> + let open Script_typed_ir in + let ctxt = Gas.set_unlimited ctxt in + (* Unfortunately, Script_ir_translator.parse_any_ty is not exported *) + Script_ir_translator.parse_ty + ctxt + ~legacy:true + ~allow_lazy_storage:true + ~allow_operation:true + ~allow_contract:true + ~allow_ticket:true + (Micheline.root typ) + >>?= fun (Ex_ty typ, _ctxt) -> + let normalized = Unparse_types.unparse_ty ~loc:() typ in + return @@ Micheline.strip_locations normalized) ; + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3364 + + Should [run_operation] be registered at successor level? *) + Registration.register0_fullctxt + ~chunked:true + S.run_operation + run_operation_service ; + Registration.register0_fullctxt_successor_level + ~chunked:true + S.simulate_operation + simulate_operation_service ; + Registration.register0 + ~chunked:true + S.entrypoint_type + (fun ctxt () (expr, entrypoint) -> + script_entrypoint_type ctxt expr entrypoint) ; + Registration.register0 ~chunked:true S.list_entrypoints (fun ctxt () expr -> + let ctxt = Gas.set_unlimited ctxt in + let legacy = false in + let open Script_ir_translator in + parse_toplevel ~legacy ctxt expr >>=? fun ({arg_type; _}, ctxt) -> + Lwt.return + ( parse_parameter_ty_and_entrypoints ctxt ~legacy arg_type + >|? fun (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, _) + -> + let unreachable_entrypoint, map = + Script_ir_translator.list_entrypoints_uncarbonated + arg_type + entrypoints + in + ( unreachable_entrypoint, + Entrypoint.Map.fold + (fun entry (_ex_ty, original_type_expr) acc -> + ( Entrypoint.to_string entry, + Micheline.strip_locations original_type_expr ) + :: acc) + map + [] ) )) + + let run_code ?unparsing_mode ?gas ?(entrypoint = Entrypoint.default) ?balance + ~script ~storage ~input ~amount ~chain_id ~source ~payer ~self ~now ~level + ctxt block = + RPC_context.make_call0 + S.run_code + ctxt + block + () + ( ( script, + storage, + input, + amount, + balance, + chain_id, + source, + payer, + self, + entrypoint ), + (unparsing_mode, gas, now, level) ) + + let trace_code ?unparsing_mode ?gas ?(entrypoint = Entrypoint.default) + ?balance ~script ~storage ~input ~amount ~chain_id ~source ~payer ~self + ~now ~level ctxt block = + RPC_context.make_call0 + S.trace_code + ctxt + block + () + ( ( script, + storage, + input, + amount, + balance, + chain_id, + source, + payer, + self, + entrypoint ), + (unparsing_mode, gas, now, level) ) + + let run_tzip4_view ?gas ~contract ~entrypoint ~input ~chain_id ~now ~level + ?source ?payer ~unparsing_mode ctxt block = + RPC_context.make_call0 + S.run_tzip4_view + ctxt + block + () + ( contract, + entrypoint, + input, + chain_id, + source, + payer, + gas, + unparsing_mode, + now, + level ) + + (** [run_script_view] is an helper function to call the corresponding + RPC. [unlimited_gas] is set to [false] by default. *) + let run_script_view ?gas ~contract ~view ~input ?(unlimited_gas = false) + ~chain_id ~now ~level ?source ?payer ~unparsing_mode ctxt block = + RPC_context.make_call0 + S.run_script_view + ctxt + block + () + ( ( contract, + view, + input, + unlimited_gas, + chain_id, + source, + payer, + gas, + unparsing_mode, + now ), + level ) + + let typecheck_code ?gas ?legacy ~script ?show_types ctxt block = + RPC_context.make_call0 + S.typecheck_code + ctxt + block + () + (script, gas, legacy, show_types) + + let script_size ?gas ?legacy ~script ~storage ctxt block = + RPC_context.make_call0 + S.script_size + ctxt + block + () + (script, storage, gas, legacy) + + let typecheck_data ?gas ?legacy ~data ~ty ctxt block = + RPC_context.make_call0 S.typecheck_data ctxt block () (data, ty, gas, legacy) + + let pack_data ?gas ~data ~ty ctxt block = + RPC_context.make_call0 S.pack_data ctxt block () (data, ty, gas) + + let normalize_data ?legacy ~data ~ty ~unparsing_mode ctxt block = + RPC_context.make_call0 + S.normalize_data + ctxt + block + () + (data, ty, unparsing_mode, legacy) + + let normalize_script ~script ~unparsing_mode ctxt block = + RPC_context.make_call0 + S.normalize_script + ctxt + block + () + (script, unparsing_mode) + + let normalize_type ~ty ctxt block = + RPC_context.make_call0 S.normalize_type ctxt block () ty + + let run_operation ~op ~chain_id ctxt block = + RPC_context.make_call0 S.run_operation ctxt block () (op, chain_id) + + let simulate_operation ~op ~chain_id ~latency ?(successor_level = false) + ?blocks_before_activation ctxt block = + RPC_context.make_call0 + S.simulate_operation + ctxt + block + (object + method successor_level = successor_level + end) + (blocks_before_activation, op, chain_id, latency) + + let entrypoint_type ~script ~entrypoint ctxt block = + RPC_context.make_call0 S.entrypoint_type ctxt block () (script, entrypoint) + + let list_entrypoints ctxt block ~script = + RPC_context.make_call0 S.list_entrypoints ctxt block () script +end + +module Contract = struct + let ticket_balances_encoding = + let open Data_encoding in + list + (merge_objs Ticket_token.unparsed_token_encoding (obj1 (req "amount" n))) + + module S = struct + let path = + (RPC_path.(open_root / "context" / "contracts") + : RPC_context.t RPC_path.context) + + let get_storage_normalized = + let open Data_encoding in + RPC_service.post_service + ~description: + "Access the data of the contract and normalize it using the \ + requested unparsing mode." + ~input:(obj1 (req "unparsing_mode" unparsing_mode_encoding)) + ~query:RPC_query.empty + ~output:(option Script.expr_encoding) + RPC_path.(path /: Contract.rpc_arg / "storage" / "normalized") + + let get_script_normalized = + let open Data_encoding in + RPC_service.post_service + ~description: + "Access the script of the contract and normalize it using the \ + requested unparsing mode." + ~input: + (obj2 + (req "unparsing_mode" unparsing_mode_encoding) + (dft "normalize_types" bool false)) + ~query:RPC_query.empty + ~output:(option Script.encoding) + RPC_path.(path /: Contract.rpc_arg / "script" / "normalized") + + let get_used_storage_space = + let open Data_encoding in + RPC_service.get_service + ~description:"Access the used storage space of the contract." + ~query:RPC_query.empty + ~output:(option z) + RPC_path.(path /: Contract.rpc_arg / "storage" / "used_space") + + let get_paid_storage_space = + let open Data_encoding in + RPC_service.get_service + ~description:"Access the paid storage space of the contract." + ~query:RPC_query.empty + ~output:(option z) + RPC_path.(path /: Contract.rpc_arg / "storage" / "paid_space") + + let ticket_balance = + let open Data_encoding in + RPC_service.post_service + ~description: + "Access the contract's balance of ticket with specified ticketer, \ + content type, and content." + ~query:RPC_query.empty + ~input:Ticket_token.unparsed_token_encoding + ~output:n + RPC_path.(path /: Contract.rpc_arg / "ticket_balance") + + let all_ticket_balances = + RPC_service.get_service + ~description: + "Access the complete list of tickets owned by the given contract by \ + scanning the contract's storage." + ~query:RPC_query.empty + ~output:ticket_balances_encoding + RPC_path.(path /: Contract.rpc_arg / "all_ticket_balances") + end + + let get_contract contract f = + match contract with + | Contract.Implicit _ -> return_none + | Contract.Originated contract -> f contract + + let register () = + (* Patched RPC: get_storage *) + Registration.register1 + ~chunked:true + S.get_storage_normalized + (fun ctxt contract () unparsing_mode -> + get_contract contract @@ fun contract -> + Contract.get_script ctxt contract >>=? fun (ctxt, script) -> + match script with + | None -> return_none + | Some script -> + let ctxt = Gas.set_unlimited ctxt in + let open Script_ir_translator in + parse_script + ctxt + ~elab_conf:(elab_conf ~legacy:true ()) + ~allow_forged_in_storage:true + script + >>=? fun (Ex_script (Script {storage; storage_type; _}), ctxt) -> + unparse_data ctxt unparsing_mode storage_type storage + >|=? fun (storage, _ctxt) -> Some storage) ; + (* Patched RPC: get_script *) + Registration.register1 + ~chunked:true + S.get_script_normalized + (fun ctxt contract () (unparsing_mode, normalize_types) -> + get_contract contract @@ fun contract -> + Contract.get_script ctxt contract >>=? fun (ctxt, script) -> + match script with + | None -> return_none + | Some script -> + let ctxt = Gas.set_unlimited ctxt in + Script_ir_translator.parse_and_unparse_script_unaccounted + ctxt + ~legacy:true + ~allow_forged_in_storage:true + unparsing_mode + ~normalize_types + script + >>=? fun (script, _ctxt) -> return_some script) ; + Registration.register1 + ~chunked:false + S.get_used_storage_space + (fun ctxt contract () () -> + get_contract contract @@ fun _ -> + Contract.used_storage_space ctxt contract >>=? return_some) ; + Registration.register1 + ~chunked:false + S.get_paid_storage_space + (fun ctxt contract () () -> + get_contract contract @@ fun _ -> + Contract.paid_storage_space ctxt contract >>=? return_some) ; + Registration.register1 + ~chunked:false + S.ticket_balance + (fun ctxt contract () Ticket_token.{ticketer; contents_type; contents} -> + let open Lwt_result_syntax in + let* ticket_hash, ctxt = + Ticket_balance_key.make + ctxt + ~owner:(Contract contract) + ~ticketer + ~contents_type:(Micheline.root contents_type) + ~contents:(Micheline.root contents) + in + let* amount, _ctxt = Ticket_balance.get_balance ctxt ticket_hash in + return @@ Option.value amount ~default:Z.zero) ; + Registration.opt_register1 + ~chunked:false + S.all_ticket_balances + (fun ctxt contract () () -> + get_contract contract @@ fun contract -> + let open Lwt_result_syntax in + let* ctxt, script = Contract.get_script ctxt contract in + match script with + | None -> return_none + | Some script -> + let* Ex_script (Script {storage; storage_type; _}), ctxt = + Script_ir_translator.parse_script + ctxt + ~elab_conf:(elab_conf ~legacy:true ()) + ~allow_forged_in_storage:true + script + in + let*? has_tickets, ctxt = + Ticket_scanner.type_has_tickets ctxt storage_type + in + let* ticket_token_map, ctxt = + Ticket_accounting.ticket_balances_of_value + ctxt + ~include_lazy:true + has_tickets + storage + in + let* ticket_balances, _ctxt = + Ticket_token_map.fold_es + ctxt + (fun ctxt acc ex_token amount -> + let* unparsed_token, ctxt = + Ticket_token_unparser.unparse ctxt ex_token + in + return ((unparsed_token, amount) :: acc, ctxt)) + [] + ticket_token_map + in + return_some ticket_balances) + + let get_storage_normalized ctxt block ~contract ~unparsing_mode = + RPC_context.make_call1 + S.get_storage_normalized + ctxt + block + (Contract.Originated contract) + () + unparsing_mode + + let get_script_normalized ctxt block ~contract ~unparsing_mode + ~normalize_types = + RPC_context.make_call1 + S.get_script_normalized + ctxt + block + (Contract.Originated contract) + () + (unparsing_mode, normalize_types) + + let get_used_storage_space ctxt block ~contract = + RPC_context.make_call1 + S.get_used_storage_space + ctxt + block + (Contract.Originated contract) + () + () + + let get_paid_storage_space ctxt block ~contract = + RPC_context.make_call1 + S.get_paid_storage_space + ctxt + block + (Contract.Originated contract) + () + () + + let get_ticket_balance ctxt block contract key = + RPC_context.make_call1 S.ticket_balance ctxt block contract () key + + let get_all_ticket_balances ctxt block contract = + RPC_context.make_call1 + S.all_ticket_balances + ctxt + block + (Contract.Originated contract) + () + () +end + +module Big_map = struct + module S = struct + let path = + (RPC_path.(open_root / "context" / "big_maps") + : RPC_context.t RPC_path.context) + + let big_map_get_normalized = + let open Data_encoding in + RPC_service.post_service + ~description: + "Access the value associated with a key in a big map, normalize the \ + output using the requested unparsing mode." + ~query:RPC_query.empty + ~input:(obj1 (req "unparsing_mode" unparsing_mode_encoding)) + ~output:Script.expr_encoding + RPC_path.( + path /: Big_map.Id.rpc_arg /: Script_expr_hash.rpc_arg / "normalized") + end + + let register () = + Registration.register2 + ~chunked:true + S.big_map_get_normalized + (fun ctxt id key () unparsing_mode -> + let open Script_ir_translator in + let ctxt = Gas.set_unlimited ctxt in + Big_map.exists ctxt id >>=? fun (ctxt, types) -> + match types with + | None -> raise Not_found + | Some (_, value_type) -> ( + parse_big_map_value_ty ctxt ~legacy:true (Micheline.root value_type) + >>?= fun (Ex_ty value_type, ctxt) -> + Big_map.get_opt ctxt id key >>=? fun (_ctxt, value) -> + match value with + | None -> raise Not_found + | Some value -> + parse_data + ctxt + ~elab_conf:(elab_conf ~legacy:true ()) + ~allow_forged:true + value_type + (Micheline.root value) + >>=? fun (value, ctxt) -> + unparse_data ctxt unparsing_mode value_type value + >|=? fun (value, _ctxt) -> value)) + + let big_map_get_normalized ctxt block id key ~unparsing_mode = + RPC_context.make_call2 + S.big_map_get_normalized + ctxt + block + id + key + () + unparsing_mode +end + +module Sc_rollup = struct + open Data_encoding + + module S = struct + let prefix : RPC_context.t RPC_path.context = + RPC_path.(open_root / "context" / "sc_rollups") + + let path_sc_rollup : (RPC_context.t, RPC_context.t * Sc_rollup.t) RPC_path.t + = + RPC_path.(prefix / "sc_rollup" /: Sc_rollup.Address.rpc_arg) + + let path_sc_rollups : RPC_context.t RPC_path.context = + RPC_path.(prefix / "all") + + let kind = + RPC_service.get_service + ~description:"Kind of smart-contract rollup" + ~query:RPC_query.empty + ~output:Sc_rollup.Kind.encoding + RPC_path.(path_sc_rollup / "kind") + + let initial_pvm_state_hash = + RPC_service.get_service + ~description:"Initial PVM state hash of smart-contract rollup" + ~query:RPC_query.empty + ~output:Sc_rollup.State_hash.encoding + RPC_path.(path_sc_rollup / "initial_pvm_state_hash") + + let genesis_info = + RPC_service.get_service + ~description: + "Genesis information (level and commitment hash) for a \ + smart-contract rollup" + ~query:RPC_query.empty + ~output:Sc_rollup.Commitment.genesis_info_encoding + RPC_path.(path_sc_rollup / "genesis_info") + + let last_cemented_commitment_hash_with_level = + RPC_service.get_service + ~description: + "Level and hash of the last cemented commitment for a smart-contract \ + rollup" + ~query:RPC_query.empty + ~output: + (obj2 + (req "hash" Sc_rollup.Commitment.Hash.encoding) + (req "level" Raw_level.encoding)) + RPC_path.(path_sc_rollup / "last_cemented_commitment_hash_with_level") + + let staked_on_commitment = + RPC_service.get_service + ~description: + "The hash of the commitment on which the operator has staked on for \ + a smart-contract rollup" + ~query:RPC_query.empty + ~output:(obj1 (req "hash" Sc_rollup.Commitment.Hash.encoding)) + RPC_path.( + path_sc_rollup / "staker" /: Sc_rollup.Staker.rpc_arg + / "staked_on_commitment") + + let commitment = + RPC_service.get_service + ~description:"Commitment for a smart contract rollup from its hash" + ~query:RPC_query.empty + ~output:Sc_rollup.Commitment.encoding + RPC_path.( + path_sc_rollup / "commitment" /: Sc_rollup.Commitment.Hash.rpc_arg) + + let dal_slot_subscriptions = + RPC_service.get_service + ~description: + "List of slot indices to which a rollup is subscribed to at a given \ + level" + ~query:RPC_query.empty + ~output:(Data_encoding.list Dal.Slot_index.encoding) + RPC_path.( + path_sc_rollup / "dal_slot_subscriptions" /: Raw_level.rpc_arg) + + let ongoing_refutation_games = + let query = + let open RPC_query in + query Sc_rollup.Staker.of_b58check_exn + |+ field "staker" RPC_arg.string "" (fun x -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |> seal + in + let output = + Sc_rollup.( + Data_encoding.( + list + (obj3 + (req "game" Game.encoding) + (req "alice" Staker.encoding) + (req "bob" Staker.encoding)))) + in + RPC_service.get_service + ~description:"Ongoing refufation games for a given staker" + ~query + ~output + RPC_path.(path_sc_rollup / "games") + + let stakers_commitments = + let output = + Sc_rollup.( + Data_encoding.( + list + (obj2 + (req "staker" Staker.encoding) + (req "commitment" Commitment.Hash.encoding)))) + in + RPC_service.get_service + ~description: + "List of stakers for a given rollup, associated to the commitments \ + they are staked on" + ~query:RPC_query.empty + ~output + RPC_path.(path_sc_rollup / "stakers_commitments") + + let conflicts = + let query = + let open RPC_query in + query Sc_rollup.Staker.of_b58check_exn + |+ field "staker" RPC_arg.string "" (fun x -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |> seal + in + let output = + Sc_rollup.(Data_encoding.list Refutation_storage.conflict_encoding) + in + RPC_service.get_service + ~description:"List of stakers in conflict with the given staker" + ~query + ~output + RPC_path.(path_sc_rollup / "conflicts") + + let timeout = + let query = + let open RPC_query in + query (fun x y -> + Sc_rollup.Staker.(of_b58check_exn x, of_b58check_exn y)) + |+ field "staker1" RPC_arg.string "" (fun (x, _) -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |+ field "staker2" RPC_arg.string "" (fun (_, x) -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |> seal + in + let output = Data_encoding.option Sc_rollup.Game.timeout_encoding in + RPC_service.get_service + ~description:"Returns the timeout of players." + ~query + ~output + RPC_path.(path_sc_rollup / "timeout") + + let timeout_reached = + let query = + let open RPC_query in + query (fun x y -> + Sc_rollup.Staker.(of_b58check_exn x, of_b58check_exn y)) + |+ field "staker1" RPC_arg.string "" (fun (x, _) -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |+ field "staker2" RPC_arg.string "" (fun (_, x) -> + Format.asprintf "%a" Sc_rollup.Staker.pp x) + |> seal + in + let output = Data_encoding.option Sc_rollup.Game.game_result_encoding in + RPC_service.get_service + ~description: + "Returns whether the timeout creates a result for the game." + ~query + ~output + RPC_path.(path_sc_rollup / "timeout_reached") + + let can_be_cemented = + let query = + let open RPC_query in + query Sc_rollup.Commitment.Hash.of_b58check_exn + |+ field "commitment" RPC_arg.string "" (fun x -> + Format.asprintf "%a" Sc_rollup.Commitment.Hash.pp x) + |> seal + in + let output = Data_encoding.bool in + RPC_service.get_service + ~description: + "Returns true if and only if the provided commitment can be cemented." + ~query + ~output + RPC_path.(path_sc_rollup / "can_be_cemented") + + let root = + RPC_service.get_service + ~description:"List of all originated smart contract rollups" + ~query:RPC_query.empty + ~output:(Data_encoding.list Sc_rollup.Address.encoding) + path_sc_rollups + + let inbox = + RPC_service.get_service + ~description:"Inbox for the smart contract rollups" + ~query:RPC_query.empty + ~output:Sc_rollup.Inbox.encoding + RPC_path.(path_sc_rollups / "inbox") + end + + let kind ctxt block sc_rollup_address = + RPC_context.make_call1 S.kind ctxt block sc_rollup_address () + + let register_inbox () = + Registration.register0 ~chunked:true S.inbox (fun ctxt () () -> + Sc_rollup.Inbox.get_inbox ctxt >>=? fun (inbox, _ctxt) -> return inbox) + + let register_kind () = + Registration.opt_register1 ~chunked:true S.kind @@ fun ctxt address () () -> + Alpha_context.Sc_rollup.kind ctxt address >|=? fun (_ctxt, kind) -> + Some kind + + let register_initial_pvm_state_hash () = + Registration.opt_register1 ~chunked:true S.initial_pvm_state_hash + @@ fun ctxt address () () -> + Alpha_context.Sc_rollup.kind ctxt address >|=? fun (_ctxt, kind) -> + match kind with + | Sc_rollup.Kind.Example_arith -> + Some Sc_rollup.ArithPVM.reference_initial_state_hash + | Sc_rollup.Kind.Wasm_2_0_0 -> + Some Sc_rollup.Wasm_2_0_0PVM.reference_initial_state_hash + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2688 *) + let register_genesis_info () = + let open Lwt_result_syntax in + Registration.register1 ~chunked:true S.genesis_info + @@ fun ctxt address () () -> + let+ _ctxt, genesis_info = + Alpha_context.Sc_rollup.genesis_info ctxt address + in + genesis_info + + let register_last_cemented_commitment_hash_with_level () = + Registration.register1 + ~chunked:false + S.last_cemented_commitment_hash_with_level + @@ fun ctxt address () () -> + let open Lwt_result_syntax in + let+ last_cemented_commitment, level, _ctxt = + Alpha_context.Sc_rollup.Commitment + .last_cemented_commitment_hash_with_level + ctxt + address + in + (last_cemented_commitment, level) + + let register_staked_on_commitment () = + Registration.register2 ~chunked:false S.staked_on_commitment + @@ fun ctxt address staker () () -> + let open Lwt_result_syntax in + let+ branch, _ctxt = + Alpha_context.Sc_rollup.Stake_storage.find_staker ctxt address staker + in + branch + + let register_commitment () = + Registration.register2 ~chunked:false S.commitment + @@ fun ctxt address commitment_hash () () -> + let open Lwt_result_syntax in + let+ commitment, _ = + Alpha_context.Sc_rollup.Commitment.get_commitment + ctxt + address + commitment_hash + in + commitment + + let register_root () = + Registration.register0 ~chunked:true S.root (fun context () () -> + Sc_rollup.list_unaccounted context) + + let register_ongoing_refutation_games () = + Registration.register1 + ~chunked:false + S.ongoing_refutation_games + (fun context rollup staker () -> + let open Lwt_result_syntax in + let open Sc_rollup.Game.Index in + let open Sc_rollup.Refutation_storage in + let* game, _ = get_ongoing_games_for_staker context rollup staker in + let game = + List.map (fun (game, index) -> (game, index.alice, index.bob)) game + in + return game) + + let register_stakers_commitments () = + Registration.register1 + ~chunked:false + S.stakers_commitments + (fun context rollup () () -> + Sc_rollup.Storage.stakers_commitments_uncarbonated context rollup) + + let register_conflicts () = + Registration.register1 + ~chunked:false + S.conflicts + (fun context rollup staker () -> + Sc_rollup.Refutation_storage.conflicting_stakers_uncarbonated + context + rollup + staker) + + let register_timeout () = + Registration.register1 + ~chunked:false + S.timeout + (fun context rollup (staker1, staker2) () -> + let open Lwt_result_syntax in + let index = Sc_rollup.Game.Index.make staker1 staker2 in + let*! res = + Sc_rollup.Refutation_storage.get_timeout context rollup index + in + match res with + | Ok (timeout, _context) -> return_some timeout + | Error _ -> return_none) + + let register_timeout_reached () = + Registration.register1 + ~chunked:false + S.timeout_reached + (fun context rollup (staker1, staker2) () -> + let open Lwt_result_syntax in + let index = Sc_rollup.Game.Index.make staker1 staker2 in + let*! res = Sc_rollup.Refutation_storage.timeout context rollup index in + match res with + | Ok (game_result, _context) -> return_some game_result + | Error _ -> return_none) + + let register_can_be_cemented () = + Registration.register1 + ~chunked:false + S.can_be_cemented + (fun context rollup commitment_hash () -> + let open Lwt_result_syntax in + let*! res = + Sc_rollup.Stake_storage.cement_commitment + context + rollup + commitment_hash + in + match res with Ok _context -> return_true | Error _ -> return_false) + + let register () = + register_kind () ; + register_inbox () ; + register_genesis_info () ; + register_last_cemented_commitment_hash_with_level () ; + register_staked_on_commitment () ; + register_commitment () ; + register_root () ; + register_ongoing_refutation_games () ; + register_stakers_commitments () ; + register_conflicts () ; + register_timeout () ; + register_timeout_reached () ; + register_can_be_cemented () ; + register_initial_pvm_state_hash () + + let list ctxt block = RPC_context.make_call0 S.root ctxt block () () + + let inbox ctxt block = RPC_context.make_call0 S.inbox ctxt block () () + + let genesis_info ctxt block sc_rollup_address = + RPC_context.make_call1 S.genesis_info ctxt block sc_rollup_address () () + + let last_cemented_commitment_hash_with_level ctxt block sc_rollup_address = + RPC_context.make_call1 + S.last_cemented_commitment_hash_with_level + ctxt + block + sc_rollup_address + () + () + + let commitment ctxt block sc_rollup_address commitment_hash = + RPC_context.make_call2 + S.commitment + ctxt + block + sc_rollup_address + commitment_hash + () + () + + let ongoing_refutation_games ctxt block sc_rollup_address staker = + RPC_context.make_call1 + S.ongoing_refutation_games + ctxt + block + sc_rollup_address + staker + + let stakers_commitments ctxt rollup = + RPC_context.make_call1 S.stakers_commitments ctxt rollup + + let conflicts ctxt block sc_rollup_address staker = + RPC_context.make_call1 S.conflicts ctxt block sc_rollup_address staker + + let timeout_reached ctxt block sc_rollup_address staker1 staker2 = + RPC_context.make_call1 + S.timeout_reached + ctxt + block + sc_rollup_address + staker1 + staker2 + + let initial_pvm_state_hash ctxt block sc_rollup_address = + RPC_context.make_call1 + S.initial_pvm_state_hash + ctxt + block + sc_rollup_address + () + () + + let can_be_cemented ctxt block sc_rollup_address commitment_hash = + RPC_context.make_call1 + S.can_be_cemented + ctxt + block + sc_rollup_address + commitment_hash +end + +module Dal = struct + let path : RPC_context.t RPC_path.context = + RPC_path.(open_root / "context" / "dal") + + module S = struct + let dal_confirmed_slot_headers_history = + let output = Data_encoding.option Dal.Slots_history.encoding in + let query = RPC_query.(seal @@ query ()) in + RPC_service.get_service + ~description: + "Returns the value of the DAL confirmed slots history skip list if \ + DAL is enabled, or [None] otherwise." + ~output + ~query + RPC_path.(path / "confirmed_slot_headers_history") + + let shards_query = + RPC_query.( + query (fun level -> level) + |+ opt_field "level" Raw_level.rpc_arg (fun t -> t) + |> seal) + + let shards = + RPC_service.get_service + ~description:"Get the shard assignements for a given level" + ~query:shards_query + ~output: + Data_encoding.( + list (tup2 Signature.Public_key_hash.encoding (tup2 int16 int16))) + RPC_path.(path / "shards") + end + + let register_dal_confirmed_slot_headers_history () = + Registration.register0 + ~chunked:false + S.dal_confirmed_slot_headers_history + (fun ctxt () () -> + if (Constants.parametric ctxt).dal.feature_enable then + Dal.Slots_storage.get_slot_headers_history ctxt >|=? Option.some + else return None) + + let dal_confirmed_slots_history ctxt block = + RPC_context.make_call0 S.dal_confirmed_slot_headers_history ctxt block () () + + let register_shards () = + Registration.register0 ~chunked:true S.shards @@ fun ctxt level () -> + let level = Option.value level ~default:(Raw_level.of_int32_exn 0l) in + Dal_services.shards ctxt ~level + + let register () = + register_dal_confirmed_slot_headers_history () ; + register_shards () +end + +module Tx_rollup = struct + open Data_encoding + + module S = struct + let path : RPC_context.t RPC_path.context = + RPC_path.(open_root / "context" / "tx_rollup") + + let has_bond = + RPC_service.get_service + ~description: + "Returns true if the public key hash already deposited a bond for \ + the given rollup" + ~query:RPC_query.empty + ~output:bool + RPC_path.( + path /: Tx_rollup.rpc_arg / "has_bond" + /: Signature.Public_key_hash.rpc_arg) + end + + let register_has_bond () = + Registration.register2 + ~chunked:false + S.has_bond + (fun ctxt rollup operator () () -> + Tx_rollup_commitment.has_bond ctxt rollup operator + >>=? fun (_ctxt, has_bond) -> return has_bond) + + let register () = register_has_bond () + + let has_bond ctxt block rollup operator = + RPC_context.make_call2 S.has_bond ctxt block rollup operator () () +end + +module Forge = struct + module S = struct + open Data_encoding + + let path = RPC_path.(path / "forge") + + let operations = + RPC_service.post_service + ~description:"Forge an operation" + ~query:RPC_query.empty + ~input:Operation.unsigned_encoding + ~output:(bytes Hex) + RPC_path.(path / "operations") + + let empty_proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '\000' + + let protocol_data = + RPC_service.post_service + ~description:"Forge the protocol-specific part of a block header" + ~query:RPC_query.empty + ~input: + (obj5 + (req "payload_hash" Block_payload_hash.encoding) + (req "payload_round" Round.encoding) + (opt "nonce_hash" Nonce_hash.encoding) + (dft + "proof_of_work_nonce" + (Fixed.bytes + Hex + Alpha_context.Constants.proof_of_work_nonce_size) + empty_proof_of_work_nonce) + Liquidity_baking.( + dft + "liquidity_baking_toggle_vote" + liquidity_baking_toggle_vote_encoding + LB_pass)) + ~output:(obj1 (req "protocol_data" (bytes Hex))) + RPC_path.(path / "protocol_data") + + module Tx_rollup = struct + open Data_encoding + + let path = RPC_path.(path / "tx_rollup") + + module Inbox = struct + let path = RPC_path.(path / "inbox") + + let message_hash = + RPC_service.post_service + ~description:"Compute the hash of a message" + ~query:RPC_query.empty + ~input:(obj1 (req "message" Tx_rollup_message.encoding)) + ~output:(obj1 (req "hash" Tx_rollup_message_hash.encoding)) + RPC_path.(path / "message_hash") + + let merkle_tree_hash = + RPC_service.post_service + ~description:"Compute the merkle tree hash of an inbox" + ~query:RPC_query.empty + ~input: + (obj1 + (req "message_hashes" (list Tx_rollup_message_hash.encoding))) + ~output:(obj1 (req "hash" Tx_rollup_inbox.Merkle.root_encoding)) + RPC_path.(path / "merkle_tree_hash") + + let merkle_tree_path = + RPC_service.post_service + ~description:"Compute a path of an inbox message in a merkle tree" + ~query:RPC_query.empty + ~input: + (obj2 + (req "message_hashes" (list Tx_rollup_message_hash.encoding)) + (req "position" int16)) + ~output:(obj1 (req "path" Tx_rollup_inbox.Merkle.path_encoding)) + RPC_path.(path / "merkle_tree_path") + end + + module Commitment = struct + let path = RPC_path.(path / "commitment") + + let merkle_tree_hash = + RPC_service.post_service + ~description:"Compute the merkle tree hash of a commitment" + ~query:RPC_query.empty + ~input: + (obj1 + (req + "message_result_hashes" + (list Tx_rollup_message_result_hash.encoding))) + ~output: + (obj1 (req "hash" Tx_rollup_commitment.Merkle_hash.encoding)) + RPC_path.(path / "merkle_tree_hash") + + let merkle_tree_path = + RPC_service.post_service + ~description: + "Compute a path of a message result hash in the commitment \ + merkle tree" + ~query:RPC_query.empty + ~input: + (obj2 + (req + "message_result_hashes" + (list Tx_rollup_message_result_hash.encoding)) + (req "position" int16)) + ~output: + (obj1 (req "path" Tx_rollup_commitment.Merkle.path_encoding)) + RPC_path.(path / "merkle_tree_path") + + let message_result_hash = + RPC_service.post_service + ~description:"Compute the message result hash" + ~query:RPC_query.empty + ~input:Tx_rollup_message_result.encoding + ~output:(obj1 (req "hash" Tx_rollup_message_result_hash.encoding)) + RPC_path.(path / "message_result_hash") + end + + module Withdraw = struct + let path = RPC_path.(path / "withdraw") + + let withdraw_list_hash = + RPC_service.post_service + ~description:"Compute the hash of a withdraw list" + ~query:RPC_query.empty + ~input: + (obj1 (req "withdraw_list" (list Tx_rollup_withdraw.encoding))) + ~output:(obj1 (req "hash" Tx_rollup_withdraw_list_hash.encoding)) + RPC_path.(path / "withdraw_list_hash") + end + end + end + + let register () = + Registration.register0_noctxt + ~chunked:true + S.operations + (fun () (shell, proto) -> + return + (Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + (shell, proto))) ; + Registration.register0_noctxt + ~chunked:true + S.protocol_data + (fun + () + ( payload_hash, + payload_round, + seed_nonce_hash, + proof_of_work_nonce, + liquidity_baking_toggle_vote ) + -> + return + (Data_encoding.Binary.to_bytes_exn + Block_header.contents_encoding + { + payload_hash; + payload_round; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_toggle_vote; + })) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Inbox.message_hash + (fun () message -> + return (Tx_rollup_message_hash.hash_uncarbonated message)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Inbox.merkle_tree_hash + (fun () message_hashes -> + return (Tx_rollup_inbox.Merkle.merklize_list message_hashes)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Inbox.merkle_tree_path + (fun () (message_hashes, position) -> + Lwt.return (Tx_rollup_inbox.Merkle.compute_path message_hashes position)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Commitment.merkle_tree_hash + (fun () message_result_hashes -> + let open Tx_rollup_commitment.Merkle in + let tree = List.fold_left snoc nil message_result_hashes in + return (root tree)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Commitment.merkle_tree_path + (fun () (message_result_hashes, position) -> + let open Tx_rollup_commitment.Merkle in + let tree = List.fold_left snoc nil message_result_hashes in + Lwt.return (compute_path tree position)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Commitment.message_result_hash + (fun () message_result -> + return (Tx_rollup_message_result_hash.hash_uncarbonated message_result)) ; + Registration.register0_noctxt + ~chunked:true + S.Tx_rollup.Withdraw.withdraw_list_hash + (fun () withdrawals -> + return (Tx_rollup_withdraw_list_hash.hash_uncarbonated withdrawals)) + + module Manager = struct + let operations ctxt block ~branch ~source ?sourcePubKey ~counter ~fee + ~gas_limit ~storage_limit operations = + Contract_services.manager_key ctxt block source >>= function + | Error _ as e -> Lwt.return e + | Ok revealed -> + let ops = + List.map + (fun (Manager operation) -> + Contents + (Manager_operation + {source; counter; operation; fee; gas_limit; storage_limit})) + operations + in + let ops = + match (sourcePubKey, revealed) with + | None, _ | _, Some _ -> ops + | Some pk, None -> + let operation = Reveal pk in + Contents + (Manager_operation + {source; counter; operation; fee; gas_limit; storage_limit}) + :: ops + in + Environment.wrap_tzresult @@ Operation.of_list ops >>?= fun ops -> + RPC_context.make_call0 S.operations ctxt block () ({branch}, ops) + + let reveal ctxt block ~branch ~source ~sourcePubKey ~counter ~fee () = + operations + ctxt + block + ~branch + ~source + ~sourcePubKey + ~counter + ~fee + ~gas_limit:Gas.Arith.zero + ~storage_limit:Z.zero + [] + + let transaction ctxt block ~branch ~source ?sourcePubKey ~counter ~amount + ~destination ?(entrypoint = Entrypoint.default) ?parameters ~gas_limit + ~storage_limit ~fee () = + let parameters = + Option.fold + ~some:Script.lazy_expr + ~none:Script.unit_parameter + parameters + in + operations + ctxt + block + ~branch + ~source + ?sourcePubKey + ~counter + ~fee + ~gas_limit + ~storage_limit + [Manager (Transaction {amount; parameters; destination; entrypoint})] + + let origination ctxt block ~branch ~source ?sourcePubKey ~counter ~balance + ?delegatePubKey ~script ~gas_limit ~storage_limit ~fee () = + operations + ctxt + block + ~branch + ~source + ?sourcePubKey + ~counter + ~fee + ~gas_limit + ~storage_limit + [ + Manager + (Origination {delegate = delegatePubKey; script; credit = balance}); + ] + + let delegation ctxt block ~branch ~source ?sourcePubKey ~counter ~fee + delegate = + operations + ctxt + block + ~branch + ~source + ?sourcePubKey + ~counter + ~fee + ~gas_limit:Gas.Arith.zero + ~storage_limit:Z.zero + [Manager (Delegation delegate)] + end + + let operation ctxt block ~branch operation = + RPC_context.make_call0 + S.operations + ctxt + block + () + ({branch}, Contents_list (Single operation)) + + let endorsement ctxt b ~branch ~consensus_content () = + operation ctxt b ~branch (Endorsement consensus_content) + + let proposals ctxt b ~branch ~source ~period ~proposals () = + operation ctxt b ~branch (Proposals {source; period; proposals}) + + let ballot ctxt b ~branch ~source ~period ~proposal ~ballot () = + operation ctxt b ~branch (Ballot {source; period; proposal; ballot}) + + let failing_noop ctxt b ~branch ~message () = + operation ctxt b ~branch (Failing_noop message) + + let seed_nonce_revelation ctxt block ~branch ~level ~nonce () = + operation ctxt block ~branch (Seed_nonce_revelation {level; nonce}) + + let vdf_revelation ctxt block ~branch ~solution () = + operation ctxt block ~branch (Vdf_revelation {solution}) + + let double_baking_evidence ctxt block ~branch ~bh1 ~bh2 () = + operation ctxt block ~branch (Double_baking_evidence {bh1; bh2}) + + let double_endorsement_evidence ctxt block ~branch ~op1 ~op2 () = + operation ctxt block ~branch (Double_endorsement_evidence {op1; op2}) + + let double_preendorsement_evidence ctxt block ~branch ~op1 ~op2 () = + operation ctxt block ~branch (Double_preendorsement_evidence {op1; op2}) + + let empty_proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '\000' + + let protocol_data ctxt block ?(payload_hash = Block_payload_hash.zero) + ?(payload_round = Round.zero) ?seed_nonce_hash + ?(proof_of_work_nonce = empty_proof_of_work_nonce) + ~liquidity_baking_toggle_vote () = + RPC_context.make_call0 + S.protocol_data + ctxt + block + () + ( payload_hash, + payload_round, + seed_nonce_hash, + proof_of_work_nonce, + liquidity_baking_toggle_vote ) +end + +module Parse = struct + module S = struct + open Data_encoding + + let path = RPC_path.(path / "parse") + + let operations = + RPC_service.post_service + ~description:"Parse operations" + ~query:RPC_query.empty + ~input: + (obj2 + (req "operations" (list (dynamic_size Operation.raw_encoding))) + (opt "check_signature" bool)) + ~output:(list (dynamic_size Operation.encoding)) + RPC_path.(path / "operations") + + let block = + RPC_service.post_service + ~description:"Parse a block" + ~query:RPC_query.empty + ~input:Block_header.raw_encoding + ~output:Block_header.protocol_data_encoding + RPC_path.(path / "block") + end + + let parse_protocol_data protocol_data = + match + Data_encoding.Binary.of_bytes_opt + Block_header.protocol_data_encoding + protocol_data + with + | None -> Stdlib.failwith "Cant_parse_protocol_data" + | Some protocol_data -> protocol_data + + let register () = + Registration.register0 + ~chunked:true + S.operations + (fun _ctxt () (operations, check) -> + List.map_es + (fun raw -> + parse_operation raw >>?= fun op -> + (match check with + | Some true -> return_unit (* FIXME *) + (* I.check_signature ctxt *) + (* op.protocol_data.signature op.shell op.protocol_data.contents *) + | Some false | None -> return_unit) + >|=? fun () -> op) + operations) ; + Registration.register0_noctxt ~chunked:false S.block (fun () raw_block -> + return @@ parse_protocol_data raw_block.protocol_data) + + let operations ctxt block ?check operations = + RPC_context.make_call0 S.operations ctxt block () (operations, check) + + let block ctxt block shell protocol_data = + RPC_context.make_call0 + S.block + ctxt + block + () + ({shell; protocol_data} : Block_header.raw) +end + +(* Compute the estimated starting time of a [round] at a future + [level], given the head's level [current_level], timestamp + [current_timestamp], and round [current_round]. Assumes blocks at + intermediate levels are produced at round 0. *) +let estimated_time round_durations ~current_level ~current_round + ~current_timestamp ~level ~round = + if Level.(level <= current_level) then Result.return_none + else + Round.timestamp_of_round + round_durations + ~round + ~predecessor_timestamp:current_timestamp + ~predecessor_round:current_round + >>? fun round_start_at_next_level -> + let step = Round.round_duration round_durations Round.zero in + let diff = Level.diff level current_level in + Period.mult (Int32.pred diff) step >>? fun delay -> + Timestamp.(round_start_at_next_level +? delay) >>? fun timestamp -> + Result.return_some timestamp + +let requested_levels ~default_level ctxt cycles levels = + match (levels, cycles) with + | [], [] -> [default_level] + | levels, cycles -> + (* explicitly fail when requested levels or cycle are in the past... + or too far in the future... + TODO: https://gitlab.com/tezos/tezos/-/issues/2335 + this old comment (from version Alpha) conflicts with + the specification of the RPCs that use this code. + *) + List.sort_uniq + Level.compare + (List.rev_append + (List.rev_map (Level.from_raw ctxt) levels) + (List.concat_map (Level.levels_in_cycle ctxt) cycles)) + +module Baking_rights = struct + type t = { + level : Raw_level.t; + delegate : public_key_hash; + consensus_key : public_key_hash; + round : Round.t; + timestamp : Timestamp.t option; + } + + let encoding = + let open Data_encoding in + conv + (fun {level; delegate; consensus_key; round; timestamp} -> + (level, delegate, round, timestamp, consensus_key)) + (fun (level, delegate, round, timestamp, consensus_key) -> + {level; delegate; consensus_key; round; timestamp}) + (obj5 + (req "level" Raw_level.encoding) + (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "round" Round.encoding) + (opt "estimated_time" Timestamp.encoding) + (req "consensus_key" Tezos_crypto.Signature.Public_key_hash.encoding)) + + let default_max_round = 64 + + module S = struct + open Data_encoding + + let path = RPC_path.(open_root / "helpers" / "baking_rights") + + type baking_rights_query = { + levels : Raw_level.t list; + cycle : Cycle.t option; + delegates : Tezos_crypto.Signature.Public_key_hash.t list; + consensus_keys : Tezos_crypto.Signature.Public_key_hash.t list; + max_round : int option; + all : bool; + } + + let baking_rights_query = + let open RPC_query in + query (fun levels cycle delegates consensus_keys max_round all -> + {levels; cycle; delegates; consensus_keys; max_round; all}) + |+ multi_field "level" Raw_level.rpc_arg (fun t -> t.levels) + |+ opt_field "cycle" Cycle.rpc_arg (fun t -> t.cycle) + |+ multi_field "delegate" Signature.Public_key_hash.rpc_arg (fun t -> + t.delegates) + |+ multi_field "consensus_key" Signature.Public_key_hash.rpc_arg (fun t -> + t.consensus_keys) + |+ opt_field "max_round" RPC_arg.uint (fun t -> t.max_round) + |+ flag "all" (fun t -> t.all) + |> seal + + let baking_rights = + RPC_service.get_service + ~description: + (Format.sprintf + "Retrieves the list of delegates allowed to bake a block.\n\ + By default, it gives the best baking opportunities (in terms of \ + rounds) for bakers that have at least one opportunity below the \ + %dth round for the next block.\n\ + Parameters `level` and `cycle` can be used to specify the \ + (valid) level(s) in the past or future at which the baking \ + rights have to be returned.\n\ + Parameter `delegate` can be used to restrict the results to the \ + given delegates. Parameter `consensus_key` can be used to \ + restrict the results to the given consensus_keys. If parameter \ + `all` is set, all the baking opportunities for each baker at \ + each level are returned, instead of just the first one.\n\ + Returns the list of baking opportunities up to round %d. Also \ + returns the minimal timestamps that correspond to these \ + opportunities. The timestamps are omitted for levels in the \ + past, and are only estimates for levels higher that the next \ + block's, based on the hypothesis that all predecessor blocks \ + were baked at the first round." + default_max_round + default_max_round) + ~query:baking_rights_query + ~output:(list encoding) + path + end + + let baking_rights_at_level ctxt max_round level = + Round.get ctxt >>=? fun current_round -> + let current_level = Level.current ctxt in + let current_timestamp = Timestamp.current ctxt in + let round_durations = Alpha_context.Constants.round_durations ctxt in + let rec loop ctxt acc round = + if Round.(round > max_round) then + (* returns the ctxt with an updated cache of slot holders *) + return (ctxt, List.rev acc) + else + Stake_distribution.baking_rights_owner ctxt level ~round + >>=? fun ( ctxt, + _slot, + {Consensus_key.consensus_pkh; delegate; consensus_pk = _} ) + -> + estimated_time + round_durations + ~current_level + ~current_round + ~current_timestamp + ~level + ~round + >>?= fun timestamp -> + let acc = + { + level = level.level; + delegate; + consensus_key = consensus_pkh; + round; + timestamp; + } + :: acc + in + loop ctxt acc (Round.succ round) + in + loop ctxt [] Round.zero + + let remove_duplicated_delegates rights = + List.rev @@ fst + @@ List.fold_left + (fun (acc, previous) r -> + if + Tezos_crypto.Signature.Public_key_hash.Set.exists + (Tezos_crypto.Signature.Public_key_hash.equal r.delegate) + previous + then (acc, previous) + else + ( r :: acc, + Tezos_crypto.Signature.Public_key_hash.Set.add + r.delegate + previous )) + ([], Tezos_crypto.Signature.Public_key_hash.Set.empty) + rights + + let register () = + Registration.register0 ~chunked:true S.baking_rights (fun ctxt q () -> + let cycles = match q.cycle with None -> [] | Some cycle -> [cycle] in + let levels = + requested_levels + ~default_level:(Level.succ ctxt (Level.current ctxt)) + ctxt + cycles + q.levels + in + Round.of_int + (match q.max_round with + | None -> default_max_round + | Some max_round -> + Compare.Int.min + max_round + (Constants.consensus_committee_size ctxt)) + >>?= fun max_round -> + List.fold_left_map_es + (fun ctxt l -> baking_rights_at_level ctxt max_round l) + ctxt + levels + >|=? fun (_ctxt, rights) -> + let rights = + if q.all then List.concat rights + else List.concat_map remove_duplicated_delegates rights + in + let rights = + match q.delegates with + | [] -> rights + | _ :: _ as delegates -> + let is_requested p = + List.exists + (Tezos_crypto.Signature.Public_key_hash.equal p.delegate) + delegates + in + List.filter is_requested rights + in + let rights = + match q.consensus_keys with + | [] -> rights + | _ :: _ as delegates -> + let is_requested p = + List.exists + (Tezos_crypto.Signature.Public_key_hash.equal p.consensus_key) + delegates + in + List.filter is_requested rights + in + rights) + + let get ctxt ?(levels = []) ?cycle ?(delegates = []) ?(consensus_keys = []) + ?(all = false) ?max_round block = + RPC_context.make_call0 + S.baking_rights + ctxt + block + {levels; cycle; delegates; consensus_keys; max_round; all} + () +end + +module Endorsing_rights = struct + type delegate_rights = { + delegate : Tezos_crypto.Signature.Public_key_hash.t; + consensus_key : Tezos_crypto.Signature.Public_key_hash.t; + first_slot : Slot.t; + endorsing_power : int; + } + + type t = { + level : Raw_level.t; + delegates_rights : delegate_rights list; + estimated_time : Time.t option; + } + + let delegate_rights_encoding = + let open Data_encoding in + conv + (fun {delegate; consensus_key; first_slot; endorsing_power} -> + (delegate, first_slot, endorsing_power, consensus_key)) + (fun (delegate, first_slot, endorsing_power, consensus_key) -> + {delegate; first_slot; endorsing_power; consensus_key}) + (obj4 + (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "first_slot" Slot.encoding) + (req "endorsing_power" uint16) + (req "consensus_key" Tezos_crypto.Signature.Public_key_hash.encoding)) + + let encoding = + let open Data_encoding in + conv + (fun {level; delegates_rights; estimated_time} -> + (level, delegates_rights, estimated_time)) + (fun (level, delegates_rights, estimated_time) -> + {level; delegates_rights; estimated_time}) + (obj3 + (req "level" Raw_level.encoding) + (req "delegates" (list delegate_rights_encoding)) + (opt "estimated_time" Timestamp.encoding)) + + module S = struct + open Data_encoding + + let path = RPC_path.(path / "endorsing_rights") + + type endorsing_rights_query = { + levels : Raw_level.t list; + cycle : Cycle.t option; + delegates : Tezos_crypto.Signature.Public_key_hash.t list; + consensus_keys : Tezos_crypto.Signature.Public_key_hash.t list; + } + + let endorsing_rights_query = + let open RPC_query in + query (fun levels cycle delegates consensus_keys -> + {levels; cycle; delegates; consensus_keys}) + |+ multi_field "level" Raw_level.rpc_arg (fun t -> t.levels) + |+ opt_field "cycle" Cycle.rpc_arg (fun t -> t.cycle) + |+ multi_field "delegate" Signature.Public_key_hash.rpc_arg (fun t -> + t.delegates) + |+ multi_field "consensus_key" Signature.Public_key_hash.rpc_arg (fun t -> + t.consensus_keys) + |> seal + + let endorsing_rights = + RPC_service.get_service + ~description: + "Retrieves the delegates allowed to endorse a block.\n\ + By default, it gives the endorsing power for delegates that have at \ + least one endorsing slot for the next block.\n\ + Parameters `level` and `cycle` can be used to specify the (valid) \ + level(s) in the past or future at which the endorsing rights have \ + to be returned. Parameter `delegate` can be used to restrict the \ + results to the given delegates.\n\ + Parameter `consensus_key` can be used to restrict the results to \ + the given consensus_keys. \n\ + Returns the smallest endorsing slots and the endorsing power. Also \ + returns the minimal timestamp that corresponds to endorsing at the \ + given level. The timestamps are omitted for levels in the past, and \ + are only estimates for levels higher that the next block's, based \ + on the hypothesis that all predecessor blocks were baked at the \ + first round." + ~query:endorsing_rights_query + ~output:(list encoding) + path + end + + let endorsing_rights_at_level ctxt level = + Baking.endorsing_rights_by_first_slot ctxt level >>=? fun (ctxt, rights) -> + Round.get ctxt >>=? fun current_round -> + let current_level = Level.current ctxt in + let current_timestamp = Timestamp.current ctxt in + let round_durations = Alpha_context.Constants.round_durations ctxt in + estimated_time + round_durations + ~current_level + ~current_round + ~current_timestamp + ~level + ~round:Round.zero + >>?= fun estimated_time -> + let rights = + Slot.Map.fold + (fun first_slot + ( { + Consensus_key.delegate; + consensus_pk = _; + consensus_pkh = consensus_key; + }, + endorsing_power ) + acc -> + {delegate; consensus_key; first_slot; endorsing_power} :: acc) + rights + [] + in + (* returns the ctxt with an updated cache of slot holders *) + return + (ctxt, {level = level.level; delegates_rights = rights; estimated_time}) + + let register () = + Registration.register0 ~chunked:true S.endorsing_rights (fun ctxt q () -> + let cycles = match q.cycle with None -> [] | Some cycle -> [cycle] in + let levels = + requested_levels + ~default_level:(Level.current ctxt) + ctxt + cycles + q.levels + in + List.fold_left_map_es endorsing_rights_at_level ctxt levels + >|=? fun (_ctxt, rights_per_level) -> + let rights_per_level = + match q.consensus_keys with + | [] -> rights_per_level + | _ :: _ as consensus_keys -> + List.filter_map + (fun rights_at_level -> + let is_requested p = + List.exists + (Tezos_crypto.Signature.Public_key_hash.equal + p.consensus_key) + consensus_keys + in + match + List.filter is_requested rights_at_level.delegates_rights + with + | [] -> None + | delegates_rights -> + Some {rights_at_level with delegates_rights}) + rights_per_level + in + rights_per_level) + + let get ctxt ?(levels = []) ?cycle ?(delegates = []) ?(consensus_keys = []) + block = + RPC_context.make_call0 + S.endorsing_rights + ctxt + block + {levels; cycle; delegates; consensus_keys} + () +end + +module Validators = struct + type t = { + level : Raw_level.t; + delegate : Tezos_crypto.Signature.Public_key_hash.t; + consensus_key : Tezos_crypto.Signature.public_key_hash; + slots : Slot.t list; + } + + let encoding = + let open Data_encoding in + conv + (fun {level; delegate; consensus_key; slots} -> + (level, delegate, slots, consensus_key)) + (fun (level, delegate, slots, consensus_key) -> + {level; delegate; consensus_key; slots}) + (obj4 + (req "level" Raw_level.encoding) + (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) + (req "slots" (list Slot.encoding)) + (req "consensus_key" Tezos_crypto.Signature.Public_key_hash.encoding)) + + module S = struct + open Data_encoding + + let path = RPC_path.(path / "validators") + + type validators_query = { + levels : Raw_level.t list; + delegates : Tezos_crypto.Signature.Public_key_hash.t list; + consensus_keys : Tezos_crypto.Signature.Public_key_hash.t list; + } + + let validators_query = + let open RPC_query in + query (fun levels delegates consensus_keys -> + {levels; delegates; consensus_keys}) + |+ multi_field "level" Raw_level.rpc_arg (fun t -> t.levels) + |+ multi_field "delegate" Signature.Public_key_hash.rpc_arg (fun t -> + t.delegates) + |+ multi_field "consensus_key" Signature.Public_key_hash.rpc_arg (fun t -> + t.consensus_keys) + |> seal + + let validators = + RPC_service.get_service + ~description: + "Retrieves the level, the endorsement slots and the public key hash \ + of each delegate allowed to endorse a block.\n\ + By default, it provides this information for the next level.\n\ + Parameter `level` can be used to specify the (valid) level(s) in \ + the past or future at which the endorsement rights have to be \ + returned. Parameter `delegate` can be used to restrict the results \ + results to the given delegates. Parameter `consensus_key` can be \ + used to restrict the results to the given consensus_keys.\n" + ~query:validators_query + ~output:(list encoding) + path + end + + let add_endorsing_slots_at_level (ctxt, acc) level = + Baking.endorsing_rights ctxt level >|=? fun (ctxt, rights) -> + ( ctxt, + Signature.Public_key_hash.Map.fold + (fun _pkh {Baking.delegate; consensus_key; slots} acc -> + {level = level.level; delegate; consensus_key; slots} :: acc) + rights + acc ) + + let register () = + Registration.register0 ~chunked:true S.validators (fun ctxt q () -> + let levels = + requested_levels ~default_level:(Level.current ctxt) ctxt [] q.levels + in + List.fold_left_es + add_endorsing_slots_at_level + (ctxt, []) + (List.rev levels) + >|=? fun (_ctxt, rights) -> + let rights = + match q.delegates with + | [] -> rights + | _ :: _ as delegates -> + let is_requested p = + List.exists + (Tezos_crypto.Signature.Public_key_hash.equal p.delegate) + delegates + in + List.filter is_requested rights + in + let rights = + match q.consensus_keys with + | [] -> rights + | _ :: _ as delegates -> + let is_requested p = + List.exists + (Tezos_crypto.Signature.Public_key_hash.equal p.consensus_key) + delegates + in + List.filter is_requested rights + in + rights) + + let get ctxt ?(levels = []) ?(delegates = []) ?(consensus_keys = []) block = + RPC_context.make_call0 + S.validators + ctxt + block + {levels; delegates; consensus_keys} + () +end + +module S = struct + open Data_encoding + + type level_query = {offset : int32} + + let level_query : level_query RPC_query.t = + let open RPC_query in + query (fun offset -> {offset}) + |+ field "offset" RPC_arg.int32 0l (fun t -> t.offset) + |> seal + + let current_level = + RPC_service.get_service + ~description: + "Returns the level of the interrogated block, or the one of a block \ + located `offset` blocks after it in the chain. For instance, the next \ + block if `offset` is 1. The offset cannot be negative." + ~query:level_query + ~output:Level.encoding + RPC_path.(path / "current_level") + + let levels_in_current_cycle = + RPC_service.get_service + ~description:"Levels of a cycle" + ~query:level_query + ~output: + (obj2 (req "first" Raw_level.encoding) (req "last" Raw_level.encoding)) + RPC_path.(path / "levels_in_current_cycle") + + let round = + RPC_service.get_service + ~description: + "Returns the round of the interrogated block, or the one of a block \ + located `offset` blocks after in the chain (or before when negative). \ + For instance, the next block if `offset` is 1." + ~query:RPC_query.empty + ~output:Round.encoding + RPC_path.(path / "round") +end + +type Environment.Error_monad.error += Negative_level_offset + +let () = + Environment.Error_monad.register_error_kind + `Permanent + ~id:"negative_level_offset" + ~title:"The specified level offset is negative" + ~description:"The specified level offset is negative" + ~pp:(fun ppf () -> + Format.fprintf ppf "The specified level offset should be positive.") + Data_encoding.unit + (function Negative_level_offset -> Some () | _ -> None) + (fun () -> Negative_level_offset) + +let register () = + Scripts.register () ; + Forge.register () ; + Parse.register () ; + Contract.register () ; + Big_map.register () ; + Baking_rights.register () ; + Endorsing_rights.register () ; + Validators.register () ; + Sc_rollup.register () ; + Dal.register () ; + Tx_rollup.register () ; + Registration.register0 ~chunked:false S.current_level (fun ctxt q () -> + if q.offset < 0l then tzfail Negative_level_offset + else + Lwt.return + (Level.from_raw_with_offset + ctxt + ~offset:q.offset + (Level.current ctxt).level)) ; + Registration.opt_register0 + ~chunked:true + S.levels_in_current_cycle + (fun ctxt q () -> + let rev_levels = Level.levels_in_current_cycle ctxt ~offset:q.offset () in + match rev_levels with + | [] -> return_none + | [level] -> return (Some (level.level, level.level)) + | last :: default_first :: rest -> + (* The [rev_levels] list is reversed, the last level is the head *) + let first = List.last default_first rest in + return (Some (first.level, last.level))) ; + Registration.register0 ~chunked:false S.round (fun ctxt () () -> + Round.get ctxt) + +let current_level ctxt ?(offset = 0l) block = + RPC_context.make_call0 S.current_level ctxt block {offset} () + +let levels_in_current_cycle ctxt ?(offset = 0l) block = + RPC_context.make_call0 S.levels_in_current_cycle ctxt block {offset} () + +let rpc_services = + register () ; + RPC_directory.merge rpc_services !Registration.patched_services diff --git a/src/proto_016_PtMumbai/lib_plugin/dune b/src/proto_016_PtMumbai/lib_plugin/dune new file mode 100644 index 000000000000..148f8d0e9c9c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/dune @@ -0,0 +1,34 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_protocol_plugin_alpha) + (public_name tezos-protocol-plugin-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-alpha) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_alpha) + (modules (:standard \ Plugin_registerer))) + +(library + (name tezos_protocol_plugin_alpha_registerer) + (public_name tezos-protocol-plugin-alpha-registerer) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-embedded-protocol-alpha + tezos-protocol-plugin-alpha + tezos-shell) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_embedded_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_shell) + (modules Plugin_registerer)) diff --git a/src/proto_016_PtMumbai/lib_plugin/mempool.ml b/src/proto_016_PtMumbai/lib_plugin/mempool.ml new file mode 100644 index 000000000000..2c578221bfdc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/mempool.ml @@ -0,0 +1,1394 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type error_classification = + [ `Branch_delayed of tztrace + | `Branch_refused of tztrace + | `Refused of tztrace + | `Outdated of tztrace ] + +type nanotez = Q.t + +let nanotez_enc : nanotez Data_encoding.t = + let open Data_encoding in + def + "nanotez" + ~title:"A thousandth of a mutez" + ~description:"One thousand nanotez make a mutez (1 tez = 1e9 nanotez)" + (conv + (fun q -> (q.Q.num, q.Q.den)) + (fun (num, den) -> {Q.num; den}) + (tup2 z z)) + +let manager_op_replacement_factor_enc : Q.t Data_encoding.t = + let open Data_encoding in + def + "manager operation replacement factor" + ~title:"A manager operation's replacement factor" + ~description:"The fee and fee/gas ratio of an operation to replace another" + (conv + (fun q -> (q.Q.num, q.Q.den)) + (fun (num, den) -> {Q.num; den}) + (tup2 z z)) + +type config = { + minimal_fees : Tez.t; + minimal_nanotez_per_gas_unit : nanotez; + minimal_nanotez_per_byte : nanotez; + allow_script_failure : bool; + (** If [true], this makes [post_filter_manager] unconditionally return + [`Passed_postfilter filter_state], no matter the operation's + success. *) + clock_drift : Period.t option; + replace_by_fee_factor : Q.t; + (** This field determines the amount of additional fees (given as a + factor of the declared fees) a manager should add to an operation + in order to (eventually) replace an existing (prechecked) one + in the mempool. Note that other criteria, such as the gas ratio, + are also taken into account to decide whether to accept the + replacement or not. *) + max_prechecked_manager_operations : int; + (** Maximal number of prechecked operations to keep. The mempool only + keeps the [max_prechecked_manager_operations] operations with the + highest fee/gas and fee/size ratios. *) +} + +let default_minimal_fees = + match Tez.of_mutez 100L with None -> assert false | Some t -> t + +let default_minimal_nanotez_per_gas_unit = Q.of_int 100 + +let default_minimal_nanotez_per_byte = Q.of_int 1000 + +let quota = Main.validation_passes + +let managers_index = 3 (* in Main.validation_passes *) + +let managers_quota = Stdlib.List.nth quota managers_index + +(* If the drift is not specified, it will be the duration of round zero. + It allows only to spam with one future round. + + /!\ Warning /!\ : current plugin implementation implies that this drift + cumulates with the accepted drift regarding the current head's timestamp. +*) +let default_config = + { + minimal_fees = default_minimal_fees; + minimal_nanotez_per_gas_unit = default_minimal_nanotez_per_gas_unit; + minimal_nanotez_per_byte = default_minimal_nanotez_per_byte; + allow_script_failure = true; + clock_drift = None; + replace_by_fee_factor = + Q.make (Z.of_int 105) (Z.of_int 100) + (* Default value of [replace_by_fee_factor] is set to 5% *); + max_prechecked_manager_operations = 5_000; + } + +let config_encoding : config Data_encoding.t = + let open Data_encoding in + conv + (fun { + minimal_fees; + minimal_nanotez_per_gas_unit; + minimal_nanotez_per_byte; + allow_script_failure; + clock_drift; + replace_by_fee_factor; + max_prechecked_manager_operations; + } -> + ( minimal_fees, + minimal_nanotez_per_gas_unit, + minimal_nanotez_per_byte, + allow_script_failure, + clock_drift, + replace_by_fee_factor, + max_prechecked_manager_operations )) + (fun ( minimal_fees, + minimal_nanotez_per_gas_unit, + minimal_nanotez_per_byte, + allow_script_failure, + clock_drift, + replace_by_fee_factor, + max_prechecked_manager_operations ) -> + { + minimal_fees; + minimal_nanotez_per_gas_unit; + minimal_nanotez_per_byte; + allow_script_failure; + clock_drift; + replace_by_fee_factor; + max_prechecked_manager_operations; + }) + (obj7 + (dft "minimal_fees" Tez.encoding default_config.minimal_fees) + (dft + "minimal_nanotez_per_gas_unit" + nanotez_enc + default_config.minimal_nanotez_per_gas_unit) + (dft + "minimal_nanotez_per_byte" + nanotez_enc + default_config.minimal_nanotez_per_byte) + (dft "allow_script_failure" bool default_config.allow_script_failure) + (opt "clock_drift" Period.encoding) + (dft + "replace_by_fee_factor" + manager_op_replacement_factor_enc + default_config.replace_by_fee_factor) + (dft + "max_prechecked_manager_operations" + int31 + default_config.max_prechecked_manager_operations)) + +(** An Alpha_context manager operation, packed so that the type is not + parametrized by ['kind]. *) +type manager_op = Manager_op : 'kind Kind.manager operation -> manager_op + +(** Information stored for each prechecked manager operation. + + Note that this record does not include the operation hash because + it is instead used as key in the map that stores this information + in the [state] below. *) +type manager_op_info = { + manager_op : manager_op; + (** Used when we want to remove the operation with + {!Validate.remove_manager_operation}. *) + fee : Tez.t; + gas_limit : Fixed_point_repr.integral_tag Gas.Arith.t; + (** Both [fee] and [gas_limit] are used to determine whether a new + operation from the same manager should replace this one. *) + weight : Q.t; + (** Used to update [ops_prechecked] and [min_prechecked_op_weight] + in [state] when appropriate. *) +} + +type manager_op_weight = { + operation_hash : Tezos_crypto.Operation_hash.t; + weight : Q.t; +} + +(** Build a {!manager_op_weight} from operation hash and {!manager_op_info}. *) +let mk_op_weight oph (info : manager_op_info) = + {operation_hash = oph; weight = info.weight} + +let compare_manager_op_weight op1 op2 = + let c = Q.compare op1.weight op2.weight in + if c <> 0 then c + else Tezos_crypto.Operation_hash.compare op1.operation_hash op2.operation_hash + +module ManagerOpWeightSet = Set.Make (struct + type t = manager_op_weight + + (* Sort by weight *) + let compare = compare_manager_op_weight +end) + +(** Static information to store in the filter state. *) +type state_info = { + grandparent_level_start : Timestamp.t; + round_zero_duration : Period.t; + proposal_round : Round.t; + alpha_ctxt : Alpha_context.t; + (** Protocol context at the initialization of the mempool filter. + Note that it never gets updated. *) +} + +type state = { + state_info : state_info option; + prechecked_manager_op_count : int; + (** Number of prechecked manager operations. + Invariants: + - [prechecked_manager_op_count + = Tezos_crypto.Operation_hash.Map.cardinal prechecked_manager_ops + = ManagerOpWeightSet.cardinal prechecked_op_weights] + - [prechecked_manager_op_count <= max_prechecked_manager_operations] *) + prechecked_manager_ops : manager_op_info Tezos_crypto.Operation_hash.Map.t; + (** All prechecked manager operations. See {!manager_op_info}. *) + prechecked_op_weights : ManagerOpWeightSet.t; + (** The {!manager_op_weight} of all prechecked manager operations. *) + min_prechecked_op_weight : manager_op_weight option; + (** The prechecked operation in [op_prechecked_managers], if any, with + the minimal weight. + Invariant: + - [min_prechecked_op_weight = min { x | x \in prechecked_op_weights }] *) +} + +let empty : state = + { + state_info = None; + prechecked_manager_op_count = 0; + prechecked_manager_ops = Tezos_crypto.Operation_hash.Map.empty; + prechecked_op_weights = ManagerOpWeightSet.empty; + min_prechecked_op_weight = None; + } + +let init config ?(validation_state : validation_state option) ~predecessor () = + ignore config ; + (match validation_state with + | None -> return empty + | Some validation_state -> + let ctxt = Validate.get_initial_ctxt validation_state in + let { + Tezos_base.Block_header.fitness = predecessor_fitness; + timestamp = predecessor_timestamp; + _; + } = + predecessor.Tezos_base.Block_header.shell + in + Alpha_context.Fitness.predecessor_round_from_raw predecessor_fitness + >>?= fun grandparent_round -> + Alpha_context.Fitness.round_from_raw predecessor_fitness + >>?= fun predecessor_round -> + let round_durations = Constants.round_durations ctxt in + let round_zero_duration = + Round.round_duration round_durations Round.zero + in + Round.level_offset_of_round + round_durations + ~round:Round.(succ grandparent_round) + >>?= fun proposal_level_offset -> + Round.level_offset_of_round round_durations ~round:predecessor_round + >>?= fun proposal_round_offset -> + Period.(add proposal_level_offset proposal_round_offset) + >>?= fun proposal_offset -> + let state_info = + { + grandparent_level_start = + Timestamp.(predecessor_timestamp - proposal_offset); + round_zero_duration; + proposal_round = predecessor_round; + alpha_ctxt = ctxt; + } + in + return {empty with state_info = Some state_info}) + >|= Environment.wrap_tzresult + +let manager_prio p = `Low p + +let consensus_prio = `High + +let other_prio = `Medium + +let on_flush config filter_state ?(validation_state : validation_state option) + ~predecessor () = + ignore (filter_state : state) ; + init config ?validation_state ~predecessor () + +let get_manager_operation_gas_and_fee contents = + let open Operation in + let l = to_list (Contents_list contents) in + List.fold_left + (fun acc -> function + | Contents (Manager_operation {fee; gas_limit; _}) -> ( + match acc with + | Error _ as e -> e + | Ok (total_fee, total_gas) -> ( + match Tez.(total_fee +? fee) with + | Ok total_fee -> Ok (total_fee, Gas.Arith.add total_gas gas_limit) + | Error _ as e -> e)) + | _ -> acc) + (Ok (Tez.zero, Gas.Arith.zero)) + l + +type Environment.Error_monad.error += Fees_too_low + +let () = + Environment.Error_monad.register_error_kind + `Permanent + ~id:"prefilter.fees_too_low" + ~title:"Operation fees are too low" + ~description:"Operation fees are too low" + ~pp:(fun ppf () -> Format.fprintf ppf "Operation fees are too low") + Data_encoding.unit + (function Fees_too_low -> Some () | _ -> None) + (fun () -> Fees_too_low) + +type Environment.Error_monad.error += + | Manager_restriction of {oph : Tezos_crypto.Operation_hash.t; fee : Tez.t} + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"prefilter.manager_restriction" + ~title:"Only one manager operation per manager per block allowed" + ~description:"Only one manager operation per manager per block allowed" + ~pp:(fun ppf (oph, fee) -> + Format.fprintf + ppf + "Only one manager operation per manager per block allowed (found %a \ + with %atez fee. You may want to use --replace to provide adequate fee \ + and replace it)." + Tezos_crypto.Operation_hash.pp + oph + Tez.pp + fee) + Data_encoding.( + obj2 + (req "operation_hash" Tezos_crypto.Operation_hash.encoding) + (req "operation_fee" Tez.encoding)) + (function Manager_restriction {oph; fee} -> Some (oph, fee) | _ -> None) + (fun (oph, fee) -> Manager_restriction {oph; fee}) + +type Environment.Error_monad.error += + | Manager_operation_replaced of { + old_hash : Tezos_crypto.Operation_hash.t; + new_hash : Tezos_crypto.Operation_hash.t; + } + +let () = + Environment.Error_monad.register_error_kind + `Permanent + ~id:"plugin.manager_operation_replaced" + ~title:"Manager operation replaced" + ~description:"The manager operation has been replaced" + ~pp:(fun ppf (old_hash, new_hash) -> + Format.fprintf + ppf + "The manager operation %a has been replaced with %a" + Tezos_crypto.Operation_hash.pp + old_hash + Tezos_crypto.Operation_hash.pp + new_hash) + (Data_encoding.obj2 + (Data_encoding.req "old_hash" Tezos_crypto.Operation_hash.encoding) + (Data_encoding.req "new_hash" Tezos_crypto.Operation_hash.encoding)) + (function + | Manager_operation_replaced {old_hash; new_hash} -> + Some (old_hash, new_hash) + | _ -> None) + (fun (old_hash, new_hash) -> + Manager_operation_replaced {old_hash; new_hash}) + +type Environment.Error_monad.error += Fees_too_low_for_mempool of Tez.t + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"prefilter.fees_too_low_for_mempool" + ~title:"Operation fees are too low to be considered in full mempool" + ~description:"Operation fees are too low to be considered in full mempool" + ~pp:(fun ppf required_fees -> + Format.fprintf + ppf + "The mempool is full, the number of prechecked manager operations has \ + reached the limit max_prechecked_manager_operations set by the \ + filter. Increase operation fees to at least %atz for the operation to \ + be considered and propagated by THIS node. Note that the operations \ + with the minimum fees in the mempool risk being removed if better \ + ones are received." + Tez.pp + required_fees) + Data_encoding.(obj1 (req "required_fees" Tez.encoding)) + (function + | Fees_too_low_for_mempool required_fees -> Some required_fees | _ -> None) + (fun required_fees -> Fees_too_low_for_mempool required_fees) + +type Environment.Error_monad.error += Removed_fees_too_low_for_mempool + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"plugin.removed_fees_too_low_for_mempool" + ~title:"Operation removed because fees are too low for full mempool" + ~description:"Operation removed because fees are too low for full mempool" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The mempool is full, the number of prechecked manager operations has \ + reached the limit max_prechecked_manager_operations set by the \ + filter. Operation was removed because another operation with a better \ + fees/gas-size ratio was received and accepted by the mempool.") + Data_encoding.unit + (function Removed_fees_too_low_for_mempool -> Some () | _ -> None) + (fun () -> Removed_fees_too_low_for_mempool) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2238 + Write unit tests for the feature 'replace-by-fee' and for other changes + introduced by other MRs in the plugin. *) +(* In order to decide if the new operation can replace an old one from the + same manager, we check if its fees (resp. fees/gas ratio) are greater than + (or equal to) the old operations's fees (resp. fees/gas ratio), bumped by + the factor [config.replace_by_fee_factor]. +*) +let better_fees_and_ratio = + let bump config q = Q.mul q config.replace_by_fee_factor in + fun config old_gas old_fee new_gas new_fee -> + let old_fee = Tez.to_mutez old_fee |> Z.of_int64 |> Q.of_bigint in + let old_gas = Gas.Arith.integral_to_z old_gas |> Q.of_bigint in + let new_fee = Tez.to_mutez new_fee |> Z.of_int64 |> Q.of_bigint in + let new_gas = Gas.Arith.integral_to_z new_gas |> Q.of_bigint in + let old_ratio = Q.div old_fee old_gas in + let new_ratio = Q.div new_fee new_gas in + Q.compare new_ratio (bump config old_ratio) >= 0 + && Q.compare new_fee (bump config old_fee) >= 0 + +let size_of_operation op = + (WithExceptions.Option.get ~loc:__LOC__ + @@ Data_encoding.Binary.fixed_length + Tezos_base.Operation.shell_header_encoding) + + Data_encoding.Binary.length Operation.protocol_data_encoding op + +(** Returns the weight and resources consumption of an operation. The weight + corresponds to the one implemented by the baker, to decide which operations + to put in a block first (the code is largely duplicated). + See {!Tezos_baking_alpha.Operation_selection.weight_manager} *) +let weight_and_resources_manager_operation ~validation_state ?size ~fee ~gas op + = + let hard_gas_limit_per_block = + Constants.hard_gas_limit_per_block + (Validate.get_initial_ctxt validation_state) + in + let max_size = managers_quota.max_size in + let size = match size with None -> size_of_operation op | Some s -> s in + let size_f = Q.of_int size in + let gas_f = Q.of_bigint (Gas.Arith.integral_to_z gas) in + let fee_f = Q.of_int64 (Tez.to_mutez fee) in + let size_ratio = Q.(size_f / Q.of_int max_size) in + let gas_ratio = + Q.(gas_f / Q.of_bigint (Gas.Arith.integral_to_z hard_gas_limit_per_block)) + in + let resources = Q.max size_ratio gas_ratio in + (Q.(fee_f / resources), resources) + +(** Returns the weight of an operation, i.e. the fees w.r.t the gas and size + consumption in the block. *) +let weight_manager_operation ~validation_state ?size ~fee ~gas op = + let weight, _resources = + weight_and_resources_manager_operation ~validation_state ?size ~fee ~gas op + in + weight + +(** Return fee for an operation that consumes [op_resources] for its weight to + be strictly greater than [min_weight]. *) +let required_fee_manager_operation_weight ~op_resources ~min_weight = + let req_mutez_q = Q.((min_weight * op_resources) + Q.one) in + Tez.of_mutez_exn @@ Q.to_int64 req_mutez_q + +(** Check if an operation as a weight (fees w.r.t gas and size) large enough to + be prechecked and return said weight. In the case where the prechecked + mempool is full, return an error if the weight is too small, or return the + operation to be replaced otherwise. *) +let check_minimal_weight ?validation_state config filter_state ~fee ~gas_limit + op = + match validation_state with + | None -> `Weight_ok (`No_replace, []) + | Some validation_state -> ( + let weight, op_resources = + weight_and_resources_manager_operation + ~validation_state + ~fee + ~gas:gas_limit + op + in + if + filter_state.prechecked_manager_op_count + < config.max_prechecked_manager_operations + then + (* The precheck mempool is not full yet *) + `Weight_ok (`No_replace, [weight]) + else + match filter_state.min_prechecked_op_weight with + | None -> + (* The precheck mempool is empty *) + `Weight_ok (`No_replace, [weight]) + | Some {weight = min_weight; operation_hash = min_oph} -> + if Q.(weight > min_weight) then + (* The operation has a weight greater than the minimal + prechecked operation, replace the latest with the new one *) + `Weight_ok (`Replace min_oph, [weight]) + else + (* Otherwise fail and give indication as to what to fee should + be for the operation to be prechecked *) + let required_fee = + required_fee_manager_operation_weight ~op_resources ~min_weight + in + `Fail + (`Branch_delayed + [ + Environment.wrap_tzerror + (Fees_too_low_for_mempool required_fee); + ])) + +let pre_filter_manager : + type t. + config -> + state -> + validation_state_before:validation_state option -> + Operation.packed_protocol_data -> + t Kind.manager contents_list -> + [ `Passed_prefilter of Q.t list + | `Branch_refused of tztrace + | `Branch_delayed of tztrace + | `Refused of tztrace + | `Outdated of tztrace ] = + fun config filter_state ~validation_state_before packed_op op -> + let size = size_of_operation packed_op in + let check_gas_and_fee fee gas_limit = + let fees_in_nanotez = + Q.mul (Q.of_int64 (Tez.to_mutez fee)) (Q.of_int 1000) + in + let minimal_fees_in_nanotez = + Q.mul (Q.of_int64 (Tez.to_mutez config.minimal_fees)) (Q.of_int 1000) + in + let minimal_fees_for_gas_in_nanotez = + Q.mul + config.minimal_nanotez_per_gas_unit + (Q.of_bigint @@ Gas.Arith.integral_to_z gas_limit) + in + let minimal_fees_for_size_in_nanotez = + Q.mul config.minimal_nanotez_per_byte (Q.of_int size) + in + if + Q.compare + fees_in_nanotez + (Q.add + minimal_fees_in_nanotez + (Q.add + minimal_fees_for_gas_in_nanotez + minimal_fees_for_size_in_nanotez)) + >= 0 + then `Fees_ok + else `Refused [Environment.wrap_tzerror Fees_too_low] + in + match get_manager_operation_gas_and_fee op with + | Error err -> `Refused (Environment.wrap_tztrace err) + | Ok (fee, gas_limit) -> ( + match check_gas_and_fee fee gas_limit with + | `Refused _ as err -> err + | `Fees_ok -> ( + match + check_minimal_weight + ?validation_state:validation_state_before + config + filter_state + ~fee + ~gas_limit + packed_op + with + | `Fail errs -> errs + | `Weight_ok (_, weight) -> `Passed_prefilter weight)) + +type Environment.Error_monad.error += Wrong_operation + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"prefilter.wrong_operation" + ~title:"Wrong operation" + ~description:"Failing_noop operations are not accepted in the mempool." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Failing_noop operations are not accepted in the mempool") + Data_encoding.unit + (function Wrong_operation -> Some () | _ -> None) + (fun () -> Wrong_operation) + +type Environment.Error_monad.error += Consensus_operation_in_far_future + +let () = + Environment.Error_monad.register_error_kind + `Branch + ~id:"prefilter.Consensus_operation_in_far_future" + ~title:"Consensus operation in far future" + ~description:"Consensus operation too far in the future are not accepted." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Consensus operation too far in the future are not accepted.") + Data_encoding.unit + (function Consensus_operation_in_far_future -> Some () | _ -> None) + (fun () -> Consensus_operation_in_far_future) + +(** {2 consensus operation filtering} + + In Tenderbake, we increased a lot the number of consensus + operations, therefore it seems necessary to be able to filter consensus + operations that could be produced by a Byzantine baker mis-using + its right to produce operations in future rounds or levels. + + We consider the situation where the head is at level [h_l], + round [h_r], and with timestamp [h_ts], with the predecessor of the head + being at round [hp_r]. + We receive at a time [now] a consensus operation for level [op_l] and + round [op_r]. + + A consensus operation is considered too far in the future, and therefore filtered, + if the earliest possible starting time of its round is greater than the + current time plus a safety margin of [config.clock_drift]. + + To consider potential level 2 reorgs, we first compute the expected + timestamp of round zero at previous level [hp0_ts], + + All ops at level p_l and round r' such that time(r') is greater than (now + drift) are + deemed too far in the future: + + h_r op_ts now+drift (h_l,r') + hp0_ts h_0 h_l | | | + +----+-----+---------+-------------------+--+-----+--------------+----------- + | | | | | | | + | h_ts h_r end time | now | earliest expected + | | | | time of round r' + |<----op_r rounds duration -------->| | + | + |<--------------- operations kept ---->|<-rejected----------... + | + |<-----------operations considered by the filter -----------... + + For an operation on a proposal at the next level, we consider the minimum + starting time of the operation's round, obtained by assuming that the proposal + at the next level was built on top of a proposal at round 0 for the current + level, itself based on a proposal at round 0 of previous level. + Operations on proposal with higher levels are treated similarly. + + All ops at the next level and round r' such that timestamp(r') > now+drift + are deemed too far in the future. + + r=0 r=1 h_r now now+drift (h_l+1,r') + hp0_ts h_0 h_l h_l | | | + +----+---- |-------+----+---------+----------+----------+---------- + | | | | | + | t0 | h_ts earliest expected + | | | | time of round r' + |<--- | earliest| | + | next level| | + | |<---------------------------------->| + round_offset(r') + + *) + +(** At a given level a consensus operation is acceptable if its earliest + expected timestamp, [op_earliest_ts] is below the current clock with an + accepted drift for the clock given by a configuration. *) +let acceptable ~drift ~op_earliest_ts ~now_timestamp = + Timestamp.( + now_timestamp +? drift >|? fun now_drifted -> op_earliest_ts <= now_drifted) + +(** Check that an operation with the given [op_round], at level [op_level] + is likely to be correct, meaning it could have been produced before + now (+ the safety margin from configuration). + + Given an operation at level greater or equal than/to the current level, we + compute the expected timestamp of the operation's round. If the operation + is at a greater level, we assume that it is based on the proposal at round + zero of the current level. + + All operations whose (level, round) is lower than or equal to the current + head are deemed valid. + Note that in case where their is a high drift in the computer clock, they + might not have been considered valid by comparing their expected timestamp + to the clock. + + This is a stricter than necessary filter as it will reject operations that + could be valid in the current timeframe if the proposal they endorse is + built over a predecessor of the current proposal that would be of lower + round than the current one. + + What can we do that would be smarter: get current head's predecessor round + and timestamp to compute the timestamp t0 of a predecessor that would have + been proposed at round 0. + + Timestamp of round at current level for an alternative head that would be + based on such proposal would be computed based on t0. + For level higher than current head, compute the round's earliest timestamp + if all proposal passed at round 0 starting from t0. + *) +let acceptable_op ~config ~round_durations ~round_zero_duration ~proposal_level + ~proposal_round ~proposal_timestamp + ~(proposal_predecessor_level_start : Timestamp.t) ~op_level ~op_round + ~now_timestamp = + if + Raw_level.(succ op_level < proposal_level) + || (op_level = proposal_level && op_round <= proposal_round) + then + (* Past and current round operations are not in the future *) + (* This case could be handled directly in `pre_filter_far_future_consensus_ops` + for a (slightly) better performance. *) + Ok true + else + (* If, by some tolerance on local clock drift, the timestamp of the + current head is itself in the future, we use this time instead of + now_timestamp *) + let now_timestamp = Timestamp.(max now_timestamp proposal_timestamp) in + (* Computing when the current level started. *) + let drift = Option.value ~default:round_zero_duration config.clock_drift in + (* We compute the earliest timestamp possible [op_earliest_ts] for the + operation's (level,round), as if all proposals were accepted at round 0 + since the previous level. *) + (* Invariant: [op_level + 1 >= proposal_level] *) + let level_offset = Raw_level.(diff (succ op_level) proposal_level) in + Period.mult level_offset round_zero_duration >>? fun time_shift -> + Timestamp.(proposal_predecessor_level_start +? time_shift) + >>? fun earliest_op_level_start -> + (* computing the operations's round start from it's earliest + possible level start *) + Round.timestamp_of_another_round_same_level + round_durations + ~current_round:Round.zero + ~current_timestamp:earliest_op_level_start + ~considered_round:op_round + >>? fun op_earliest_ts -> + (* We finally check that the expected time of the operation is + acceptable *) + acceptable ~drift ~op_earliest_ts ~now_timestamp + +let pre_filter_far_future_consensus_ops config ~filter_state + ({level = op_level; round = op_round; _} : consensus_content) : bool Lwt.t = + match filter_state.state_info with + | None -> Lwt.return_true + | Some state_info -> ( + (let proposal_timestamp = Timestamp.predecessor state_info.alpha_ctxt in + let now_timestamp = Time.System.now () |> Time.System.to_protocol in + let Level.{level; _} = Level.current state_info.alpha_ctxt in + let proposal_level = + match Raw_level.pred level with + | None -> + (* mempool level is set to the successor of the current head *) + assert false + | Some proposal_level -> proposal_level + in + let round_durations = Constants.round_durations state_info.alpha_ctxt in + Lwt.return + @@ acceptable_op + ~config + ~round_durations + ~round_zero_duration:state_info.round_zero_duration + ~proposal_level + ~proposal_round:state_info.proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start:state_info.grandparent_level_start + ~op_level + ~op_round + ~now_timestamp) + >>= function + | Ok b -> Lwt.return b + | _ -> Lwt.return_false) + +(** A quasi infinite amount of "valid" (pre)endorsements could be + sent by a committee member, one for each possible round number. + + This filter rejects (pre)endorsements that refer to a round + that could not have been reached within the time span between + the last head's timestamp and the current local clock. + + We add [config.clock_drift] time as a safety margin. + *) +let pre_filter config ~(filter_state : state) ?validation_state_before + ({shell = _; protocol_data = Operation_data {contents; _} as op} : + Main.operation) = + let prefilter_manager_op manager_op = + Lwt.return + @@ + match + pre_filter_manager + config + filter_state + ~validation_state_before + op + manager_op + with + | `Passed_prefilter prio -> `Passed_prefilter (manager_prio prio) + | (`Branch_refused _ | `Branch_delayed _ | `Refused _ | `Outdated _) as err + -> + err + in + match contents with + | Single (Failing_noop _) -> + Lwt.return (`Refused [Environment.wrap_tzerror Wrong_operation]) + | Single (Preendorsement consensus_content) + | Single (Endorsement consensus_content) -> + pre_filter_far_future_consensus_ops ~filter_state config consensus_content + >>= fun keep -> + if keep then Lwt.return @@ `Passed_prefilter consensus_prio + else + Lwt.return + (`Branch_refused + [Environment.wrap_tzerror Consensus_operation_in_far_future]) + | Single (Dal_attestation _) + | Single (Seed_nonce_revelation _) + | Single (Double_preendorsement_evidence _) + | Single (Double_endorsement_evidence _) + | Single (Double_baking_evidence _) + | Single (Activate_account _) + | Single (Proposals _) + | Single (Vdf_revelation _) + | Single (Drain_delegate _) + | Single (Ballot _) -> + Lwt.return @@ `Passed_prefilter other_prio + | Single (Manager_operation _) as op -> prefilter_manager_op op + | Cons (Manager_operation _, _) as op -> prefilter_manager_op op + +(** Call the protocol's {!Validate.validate_operation} and + return either: + + - the updated {!validation_state} when the validation is + successful, or + + - the protocol error trace converted to an [error trace], together + with the corresponding {!error_classification}. + + The signature check is skipped when the operation has previously + been validated successfully, ie. [nb_successful_prechecks > 0]. *) +let proto_validate_operation validation_state oph ~nb_successful_prechecks + (operation : packed_operation) : + (validation_state, error trace * error_classification) result Lwt.t = + let open Lwt_result_syntax in + let*! res = + Validate.validate_operation + ~check_signature:(nb_successful_prechecks <= 0) + validation_state + oph + operation + in + match res with + | Ok validation_state -> return validation_state + | Error tztrace -> + let err = Environment.wrap_tztrace tztrace in + let error_classification = + match classify_trace err with + | Branch -> `Branch_refused err + | Permanent -> `Refused err + | Temporary -> `Branch_delayed err + | Outdated -> `Outdated err + in + fail (err, error_classification) + +(** Call the protocol's {!Validate.validate_operation} on a + manager operation and return: + + - [`Success] containing the updated [validation_state] when the + validation is successful; + + - [`Conflict] containing the hash of the conflicting operation, + and the {!error_classification} corresponding to the protocol error + trace, when the validation fails because of the + one-manager-operation-per-manager-per-block restriction; + + - an error containing the relevant {!error_classification} when + the validation fails with any other protocol error. + + The signature check is skipped when the operation has previously + been validated successfully, ie. [nb_successful_prechecks > 0]. *) +let proto_validate_manager_operation validation_state oph + ~nb_successful_prechecks + (operation : 'a Kind.manager Alpha_context.operation) : + ( [> `Success of validation_state + | `Conflict of Tezos_crypto.Operation_hash.t * error_classification ], + error_classification ) + result + Lwt.t = + let open Lwt_result_syntax in + let*! res = + proto_validate_operation + validation_state + oph + ~nb_successful_prechecks + (Operation.pack operation) + in + match res with + | Ok validation_state -> return (`Success validation_state) + | Error (err, error_classification) -> ( + match err with + | Environment.Ecoproto_error + (Validate_errors.Manager.Manager_restriction + { + source = _manager; + conflict = Operation_conflict {existing; new_operation = _}; + }) + :: _ -> + return (`Conflict (existing, error_classification)) + | _ -> fail error_classification) + +(** Remove a manager operation from the protocol's [validation_state]. *) +let remove_from_validation_state validation_state (Manager_op op) = + let operation_state = + Validate.remove_operation validation_state.Validate.operation_state op + in + {validation_state with operation_state} + +(** Call the protocol validation on a manager operation and handle + potential conflicts: if either the 1M restriction is triggered or + the mempool exceeds the maximal number of prechecked operations, + then this function is responsible for either discarding the new + operation, or removing an old operation to free up space for the + new operation. + + Return the updated protocol [validation_state] and, when + applicable, the replaced operation accompanied by its new + classification. + + Note that this function does not handle the update of the + [filter_state]. *) +let validate_manager_operation_and_handle_conflicts config filter_state + validation_state oph ~nb_successful_prechecks fee gas_limit + (operation : 'manager_kind Kind.manager operation) : + ( validation_state + * [ `No_replace + | `Replace of Tezos_crypto.Operation_hash.t * error_classification ], + error_classification ) + result + Lwt.t = + let open Lwt_result_syntax in + let* proto_validation_outcome = + proto_validate_manager_operation + validation_state + oph + ~nb_successful_prechecks + operation + in + match proto_validation_outcome with + | `Success validation_state -> ( + (* The operation has been successfully validated and there is no + 1M conflict. We now need to ensure that the mempool does not + exceed its maximal number of prechecked manager operations. *) + match + check_minimal_weight + ~validation_state + config + filter_state + ~fee + ~gas_limit + (Operation_data operation.protocol_data) + with + | `Weight_ok (`No_replace, _weight) -> + (* The mempool is not full: no need to replace any operation. *) + return (validation_state, `No_replace) + | `Weight_ok (`Replace min_weight_oph, _weight) -> ( + (* The mempool is full yet the new operation has enough weight + to be included: the old operation with the lowest weight is + reclassified as [Branch_delayed]. *) + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2347 The + branch_delayed ring is bounded to 1000, so we may loose + operations. We can probably do better. *) + match + Tezos_crypto.Operation_hash.Map.find + min_weight_oph + filter_state.prechecked_manager_ops + with + | None -> + (* This only occurs for a [Drain_delegate] + operation: it has a higher priority than a manager + therefore we keep the drain delegate *) + return (validation_state, `No_replace) + | Some {manager_op; _} -> + let validation_state = + remove_from_validation_state validation_state manager_op + in + let replace_err = + Environment.wrap_tzerror Removed_fees_too_low_for_mempool + in + let replacement = + `Replace (min_weight_oph, `Branch_delayed [replace_err]) + in + return (validation_state, replacement)) + | `Fail err -> + (* The mempool is full and the weight of the new operation is + too low: raise the error returned by {!check_minimal_weight}. *) + fail err) + | `Conflict (old_oph, _proto_error) -> ( + (* The protocol [validation_state] already contains an operation + from the same manager. We look at the fees and gas limits of + both operations to decide whether to replace the old one. *) + match + Tezos_crypto.Operation_hash.Map.find + old_oph + filter_state.prechecked_manager_ops + with + | None -> + (* This only occurs for a [Drain_delegate] operation: it has + a higher priority than a manager therefore we keep the + drain delegate *) + return (validation_state, `No_replace) + | Some old_info -> + if + better_fees_and_ratio + config + old_info.gas_limit + old_info.fee + gas_limit + fee + then + (* The new operation is better and replaces the old one from + the same manager. Note that there is no need to check the + number of prechecked operations in the mempool + here. Indeed, the removal of the old operation frees up a + spot in the mempool anyway. *) + let validation_state = + remove_from_validation_state validation_state old_info.manager_op + in + let* proto_validation_outcome2 = + proto_validate_manager_operation + validation_state + oph + ~nb_successful_prechecks + operation + in + match proto_validation_outcome2 with + | `Success validation_state -> + let replace_err = + Environment.wrap_tzerror + (Manager_operation_replaced + {old_hash = old_oph; new_hash = oph}) + in + let replacement = `Replace (old_oph, `Outdated [replace_err]) in + return (validation_state, replacement) + | `Conflict (_oph, conflict_proto_error) -> + (* This should not happen: a manager operation should not + conflict with multiple operations. *) + fail conflict_proto_error + else + (* The new operation is not interesting enough so it is rejected. *) + let err = Manager_restriction {oph = old_oph; fee = old_info.fee} in + fail (`Branch_delayed [Environment.wrap_tzerror err])) + +(** Remove a manager operation hash from the filter state. + Do nothing if the operation was not in the state. *) +let remove ~filter_state oph = + match + Tezos_crypto.Operation_hash.Map.find oph filter_state.prechecked_manager_ops + with + | None -> + (* Not present in the filter_state: nothing to do. *) + filter_state + | Some info -> + let prechecked_manager_ops = + Tezos_crypto.Operation_hash.Map.remove + oph + filter_state.prechecked_manager_ops + in + let prechecked_manager_op_count = + filter_state.prechecked_manager_op_count - 1 + in + let prechecked_op_weights = + ManagerOpWeightSet.remove + (mk_op_weight oph info) + filter_state.prechecked_op_weights + in + let min_prechecked_op_weight = + match filter_state.min_prechecked_op_weight with + | None -> None + | Some min_op_weight -> + if + Tezos_crypto.Operation_hash.equal min_op_weight.operation_hash oph + then ManagerOpWeightSet.min_elt prechecked_op_weights + else Some min_op_weight + in + { + filter_state with + prechecked_manager_op_count; + prechecked_manager_ops; + prechecked_op_weights; + min_prechecked_op_weight; + } + +(** Add a manager operation hash and information to the filter state. + Do nothing if the operation is already present in the state. *) +let add_manager_op filter_state oph info replacement = + let filter_state = + match replacement with + | `No_replace -> filter_state + | `Replace (oph, _classification) -> remove ~filter_state oph + in + if Tezos_crypto.Operation_hash.Map.mem oph filter_state.prechecked_manager_ops + then (* Already present in the filter_state: nothing to do. *) + filter_state + else + let prechecked_manager_op_count = + filter_state.prechecked_manager_op_count + 1 + in + let prechecked_manager_ops = + Tezos_crypto.Operation_hash.Map.add + oph + info + filter_state.prechecked_manager_ops + in + let op_weight = mk_op_weight oph info in + let prechecked_op_weights = + ManagerOpWeightSet.add op_weight filter_state.prechecked_op_weights + in + let min_prechecked_op_weight = + match filter_state.min_prechecked_op_weight with + | Some old_min when compare_manager_op_weight old_min op_weight <= 0 -> + Some old_min + | _ -> Some op_weight + in + { + filter_state with + prechecked_manager_op_count; + prechecked_manager_ops; + prechecked_op_weights; + min_prechecked_op_weight; + } + +(** Call {!validate_manager_operation_and_handle_conflicts} then + update the [filter_state] by adding the newly validated operation, + and removing the replaced one one when applicable. + + Return either the updated [filter_state], updated + [validation_state], and operation replacement, or an error + containing the appropriate classification. *) +let precheck_manager_result config filter_state validation_state oph + ~nb_successful_prechecks (operation : 'manager_kind Kind.manager operation) + : + ( state + * validation_state + * [ `No_replace + | `Replace of Tezos_crypto.Operation_hash.t * error_classification ], + error_classification ) + result + Lwt.t = + let open Lwt_result_syntax in + let*? fee, gas_limit = + Result.map_error + (fun err -> `Refused (Environment.wrap_tztrace err)) + (get_manager_operation_gas_and_fee operation.protocol_data.contents) + in + let* validation_state, replacement = + validate_manager_operation_and_handle_conflicts + config + filter_state + validation_state + oph + ~nb_successful_prechecks + fee + gas_limit + operation + in + let weight = + weight_manager_operation + ~validation_state + ~fee + ~gas:gas_limit + (Operation_data operation.protocol_data) + in + let info = {manager_op = Manager_op operation; gas_limit; fee; weight} in + let filter_state = add_manager_op filter_state oph info replacement in + return (filter_state, validation_state, replacement) + +(** Call {!precheck_manager_result} then convert its error monad + result into the appropriate return type for [precheck]. *) +let precheck_manager config filter_state validation_state oph + ~nb_successful_prechecks operation : + [> `Passed_precheck of + state + * validation_state + * [ `No_replace + | `Replace of Tezos_crypto.Operation_hash.t * error_classification ] + | error_classification ] + Lwt.t = + precheck_manager_result + config + filter_state + validation_state + oph + ~nb_successful_prechecks + operation + >>= function + | Ok (filter_state, validation_state, replacement) -> + Lwt.return + (`Passed_precheck (filter_state, validation_state, replacement)) + | Error + ((`Refused _ | `Branch_delayed _ | `Branch_refused _ | `Outdated _) as + err) -> + Lwt.return err + +(** Call the protocol's {!Validate.validate_operation}. If + successful, return the updated [validation_state], the unchanged + [filter_state], and no operation replacement. Otherwise, return the + classification associated with the protocol error. Note that when + there is a conflict with a previously validated operation, the new + operation is always discarded. As it does not allow for any fee + market, this function is designed for non-manager operations. *) +let precheck_non_manager filter_state validation_state oph + ~nb_successful_prechecks operation = + proto_validate_operation + validation_state + oph + ~nb_successful_prechecks + operation + >>= function + | Ok validation_state -> + Lwt.return + (`Passed_precheck (filter_state, validation_state, `No_replace)) + | Error + ( _err, + ((`Refused _ | `Branch_delayed _ | `Branch_refused _ | `Outdated _) as + error_classification) ) -> + Lwt.return error_classification + +(* Now that [precheck] uses {!Validate.validate_operation} + for every kind of operation, it must never return + [`Undecided]. Indeed, this would cause the prevalidator to call + {!Apply.apply_operation}, which relies on updates to the alpha + context to detect incompatible operations, whereas + [validate_operation] only updates the + {!Validate.validate_operation_state}. Therefore, it would + be possible for the mempool to accept conflicting operations. *) +let precheck : + config -> + filter_state:state -> + validation_state:validation_state -> + Tezos_crypto.Operation_hash.t -> + Main.operation -> + nb_successful_prechecks:int -> + [ `Passed_precheck of + state + * validation_state + * [ `No_replace + | `Replace of Tezos_crypto.Operation_hash.t * error_classification ] + | `Undecided + | error_classification ] + Lwt.t = + fun config + ~filter_state + ~validation_state + oph + operation + ~nb_successful_prechecks -> + let {protocol_data = Operation_data protocol_data; _} = operation in + let call_precheck_manager (protocol_data : _ Kind.manager protocol_data) = + precheck_manager + config + filter_state + validation_state + oph + ~nb_successful_prechecks + {shell = operation.shell; protocol_data} + in + match protocol_data.contents with + | Single (Manager_operation _) -> call_precheck_manager protocol_data + | Cons (Manager_operation _, _) -> call_precheck_manager protocol_data + | Single _ -> + precheck_non_manager + filter_state + validation_state + oph + ~nb_successful_prechecks + operation + +open Apply_results + +type Environment.Error_monad.error += Skipped_operation + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"postfilter.skipped_operation" + ~title:"The operation has been skipped by the protocol" + ~description:"The operation has been skipped by the protocol" + ~pp:(fun ppf () -> + Format.fprintf ppf "The operation has been skipped by the protocol") + Data_encoding.unit + (function Skipped_operation -> Some () | _ -> None) + (fun () -> Skipped_operation) + +type Environment.Error_monad.error += Backtracked_operation + +let () = + Environment.Error_monad.register_error_kind + `Temporary + ~id:"postfilter.backtracked_operation" + ~title:"The operation has been backtracked by the protocol" + ~description:"The operation has been backtracked by the protocol" + ~pp:(fun ppf () -> + Format.fprintf ppf "The operation has been backtracked by the protocol") + Data_encoding.unit + (function Backtracked_operation -> Some () | _ -> None) + (fun () -> Backtracked_operation) + +let rec post_filter_manager : + type t. + Alpha_context.t -> + state -> + t Kind.manager contents_result_list -> + config -> + [`Passed_postfilter of state | `Refused of tztrace] = + fun ctxt filter_state result config -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2181 + This function should be unit tested. + The errors that can be raised if allow_script_failure is enable should + be tested. *) + match result with + | Single_result (Manager_operation_result {operation_result; _}) -> ( + let check_allow_script_failure errs = + if config.allow_script_failure then `Passed_postfilter filter_state + else `Refused errs + in + match operation_result with + | Applied _ -> `Passed_postfilter filter_state + | Skipped _ -> + check_allow_script_failure + [Environment.wrap_tzerror Skipped_operation] + | Failed (_, errors) -> + check_allow_script_failure (Environment.wrap_tztrace errors) + | Backtracked (_, errors) -> + check_allow_script_failure + (match errors with + | Some e -> Environment.wrap_tztrace e + | None -> [Environment.wrap_tzerror Backtracked_operation])) + | Cons_result (Manager_operation_result res, rest) -> ( + post_filter_manager + ctxt + filter_state + (Single_result (Manager_operation_result res)) + config + |> function + | `Passed_postfilter filter_state -> + post_filter_manager ctxt filter_state rest config + | `Refused _ as errs -> errs) + +let post_filter config ~(filter_state : state) ~validation_state_before:_ + ~validation_state_after (_op, receipt) = + match receipt with + | No_operation_metadata -> assert false (* only for multipass validator *) + | Operation_metadata {contents} -> ( + let handle_manager result = + let ctxt = Validate.get_initial_ctxt validation_state_after in + Lwt.return (post_filter_manager ctxt filter_state result config) + in + match contents with + | Single_result (Preendorsement_result _) + | Single_result (Endorsement_result _) + | Single_result (Dal_attestation_result _) + | Single_result (Seed_nonce_revelation_result _) + | Single_result (Double_preendorsement_evidence_result _) + | Single_result (Double_endorsement_evidence_result _) + | Single_result (Double_baking_evidence_result _) + | Single_result (Activate_account_result _) + | Single_result Proposals_result + | Single_result (Vdf_revelation_result _) + | Single_result (Drain_delegate_result _) + | Single_result Ballot_result -> + Lwt.return (`Passed_postfilter filter_state) + | Single_result (Manager_operation_result _) as result -> + handle_manager result + | Cons_result (Manager_operation_result _, _) as result -> + handle_manager result) diff --git a/src/proto_016_PtMumbai/lib_plugin/metrics_plugin.ml b/src/proto_016_PtMumbai/lib_plugin/metrics_plugin.ml new file mode 100644 index 000000000000..832711680a54 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/metrics_plugin.ml @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let update_metrics ~protocol_metadata (fitness : Tezos_base.Fitness.t) + update_metrics_callback = + Alpha_context.Fitness.round_from_raw fitness + >>?= (fun round -> + let proto_metrics = + match + Data_encoding.Binary.of_bytes_opt + Protocol.block_header_metadata_encoding + protocol_metadata + with + | None -> + (* this is the case of the genesis block and the activation block + in a sandbox environment *) + None + | Some protocol_data -> + let cycle = + Int32.to_float (Cycle.to_int32 protocol_data.level_info.cycle) + in + let consumed_gas = + Z.to_float + (Gas.Arith.integral_to_z + (Gas.Arith.ceil protocol_data.consumed_gas)) + in + Some (cycle, consumed_gas) + in + match proto_metrics with + | Some (cycle, consumed_gas) -> + return + @@ update_metrics_callback + ~cycle + ~consumed_gas + ~round:(Int32.to_float (Round.to_int32 round)) + | None -> return_unit) + >|= Environment.wrap_tzresult + >>= function + | _ -> Lwt.return_unit diff --git a/src/proto_016_PtMumbai/lib_plugin/plugin.ml b/src/proto_016_PtMumbai/lib_plugin/plugin.ml new file mode 100644 index 000000000000..8fb75ce08aad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/plugin.ml @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Mempool = Mempool +module View_helpers = View_helpers +module RPC = RPC +module Metrics = Metrics_plugin +module Script_interpreter_logging = Script_interpreter_logging diff --git a/src/proto_016_PtMumbai/lib_plugin/plugin_errors.ml b/src/proto_016_PtMumbai/lib_plugin/plugin_errors.ml new file mode 100644 index 000000000000..61179616fdd3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/plugin_errors.ml @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type Environment.Error_monad.error += Cannot_parse_operation (* `Branch *) + +type Environment.Error_monad.error += Cannot_serialize_log + +type Environment.Error_monad.error += Cannot_retrieve_predecessor_level + +let () = + Environment.Error_monad.register_error_kind + `Branch + ~id:"operation.cannot_parse" + ~title:"Cannot parse operation" + ~description:"The operation is ill-formed or for another protocol version" + ~pp:(fun ppf () -> Format.fprintf ppf "The operation cannot be parsed") + Data_encoding.unit + (function Cannot_parse_operation -> Some () | _ -> None) + (fun () -> Cannot_parse_operation) ; + (* Cannot serialize log *) + Environment.Error_monad.register_error_kind + `Temporary + ~id:"michelson_v1.cannot_serialize_log" + ~title:"Not enough gas to serialize execution trace" + ~description: + "Execution trace with stacks was to big to be serialized with the \ + provided gas" + Data_encoding.empty + (function Cannot_serialize_log -> Some () | _ -> None) + (fun () -> Cannot_serialize_log) ; + Environment.Error_monad.register_error_kind + `Temporary + ~id:"cannot_retrieve_predecessor_level" + ~title:"Cannot retrieve predecessor level" + ~description:"Cannot retrieve predecessor level." + Data_encoding.empty + (function Cannot_retrieve_predecessor_level -> Some () | _ -> None) + (fun () -> Cannot_retrieve_predecessor_level) diff --git a/src/proto_016_PtMumbai/lib_plugin/plugin_registerer.ml b/src/proto_016_PtMumbai/lib_plugin/plugin_registerer.ml new file mode 100644 index 000000000000..1cf730f38b8d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/plugin_registerer.ml @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Development. <contact@tezcore.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Filter = struct + module Proto = Registerer.Registered + module Mempool = Plugin.Mempool +end + +module RPC = struct + module Proto = Registerer.Registered + include Plugin.RPC +end + +module Metrics = struct + include Plugin.Metrics + + let hash = Registerer.Registered.hash +end + +let () = Shell_plugin.register_filter (module Filter) + +let () = Shell_plugin.register_rpc (module RPC) + +let () = Shell_plugin.register_metrics (module Metrics) diff --git a/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.ml b/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.ml new file mode 100644 index 000000000000..ac496687e854 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.ml @@ -0,0 +1,2317 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment +open Error_monad +open Alpha_context +open Script_typed_ir + +module Stack_utils = struct + type kinstr_rewritek = { + apply : + 'b 'u 'r 'f. + ('b, 'u) stack_ty -> ('b, 'u, 'r, 'f) kinstr -> ('b, 'u, 'r, 'f) kinstr; + } + [@@ocaml.unboxed] + + (* An existential wrapper around failed [kinstr], whose final stack type + is hidden as it is irrelevant. *) + type ('a, 's) failed_kinstr_cast = {cast : 'b 'u. ('a, 's, 'b, 'u) kinstr} + [@@ocaml.unboxed] + + (* This is a view on a deconstructed [kinstr]. Its type parameters refer to + the type of the viewed [kinstr], while existentials inside describe types of + [kinstr]'s components. The [reconstruct] field in each record stores a + function which reconstructs the original instruction from its components. *) + type ('a, 's, 'r, 'f) ex_split_kinstr = + | Ex_split_kinstr : { + cont_init_stack : ('b, 'u) stack_ty; + continuation : ('b, 'u, 'r, 'f) kinstr; + reconstruct : ('b, 'u, 'r, 'f) kinstr -> ('a, 's, 'r, 'f) kinstr; + } + -> ('a, 's, 'r, 'f) ex_split_kinstr + | Ex_split_log : { + stack : ('a, 's) stack_ty; + continuation : ('a, 's, 'r, 'f) kinstr; + reconstruct : ('a, 's, 'r, 'f) kinstr -> ('a, 's, 'r, 'f) kinstr; + } + -> ('a, 's, 'r, 'f) ex_split_kinstr + | Ex_split_loop_may_fail : { + body_init_stack : ('b, 'u) stack_ty; + body : ('b, 'u, 'r, 'f) kinstr; + cont_init_stack : ('c, 'v) stack_ty; + continuation : ('c, 'v, 't, 'g) kinstr; + reconstruct : + ('b, 'u, 'r, 'f) kinstr -> + ('c, 'v, 't, 'g) kinstr -> + ('a, 's, 't, 'g) kinstr; + } + -> ('a, 's, 't, 'g) ex_split_kinstr + | Ex_split_loop_may_not_fail : { + body_init_stack : ('b, 'u) stack_ty; + body : ('b, 'u, 'r, 'f) kinstr; + continuation : ('c, 'v, 't, 'g) kinstr; + aft_body_stack_transform : + ('r, 'f) stack_ty -> ('c, 'v) stack_ty tzresult; + reconstruct : + ('b, 'u, 'r, 'f) kinstr -> + ('c, 'v, 't, 'g) kinstr -> + ('a, 's, 't, 'g) kinstr; + } + -> ('a, 's, 't, 'g) ex_split_kinstr + | Ex_split_if : { + left_init_stack : ('b, 'u) stack_ty; + left_branch : ('b, 'u, 'r, 'f) kinstr; + right_init_stack : ('c, 'v) stack_ty; + right_branch : ('c, 'v, 'r, 'f) kinstr; + continuation : ('r, 'f, 't, 'g) kinstr; + reconstruct : + ('b, 'u, 'r, 'f) kinstr -> + ('c, 'v, 'r, 'f) kinstr -> + ('r, 'f, 't, 'g) kinstr -> + ('a, 's, 't, 'g) kinstr; + } + -> ('a, 's, 't, 'g) ex_split_kinstr + | Ex_split_halt : Script.location -> ('a, 's, 'a, 's) ex_split_kinstr + | Ex_split_failwith : { + location : Script.location; + arg_ty : ('a, _) ty; + cast : ('a, 's) failed_kinstr_cast; + } + -> ('a, 's, 'r, 'f) ex_split_kinstr + + (** An existential container for an instruction paired with its + initial stack type. This is used internally to pack together + execution branches with different initial stack types but + the same final stack type (which we want to compute). *) + type ('r, 'f) ex_init_stack_ty = + | Ex_init_stack_ty : + ('a, 's) stack_ty * ('a, 's, 'r, 'f) kinstr + -> ('r, 'f) ex_init_stack_ty + + let rec stack_prefix_preservation_witness_split_input : + type a s b t c u d v. + (b, t, c, u, a, s, d, v) stack_prefix_preservation_witness -> + (a, s) stack_ty -> + (b, t) stack_ty = + fun w s -> + match (w, s) with + | KPrefix (_, _, w), Item_t (_, s) -> + stack_prefix_preservation_witness_split_input w s + | KRest, s -> s + + let rec stack_prefix_preservation_witness_split_output : + type a s b t c u d v. + (b, t, c, u, a, s, d, v) stack_prefix_preservation_witness -> + (c, u) stack_ty -> + (d, v) stack_ty = + fun w s -> + match (w, s) with + | KPrefix (_, a, w), s -> + Item_t (a, stack_prefix_preservation_witness_split_output w s) + | KRest, s -> s + + (* We apply this function to optional type information which must be present + if functions from this module were called. Use with care. *) + let assert_some = function None -> assert false | Some x -> x + + let kinstr_split : + type a s r f. + (a, s) stack_ty -> + (a, s, r, f) kinstr -> + (a, s, r, f) ex_split_kinstr tzresult = + fun s i -> + let dummy = Micheline.dummy_location in + match (i, s) with + | IDrop (loc, k), Item_t (_a, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDrop (loc, k)); + } + | IDup (loc, k), Item_t (a, s) -> + let s = Item_t (a, Item_t (a, s)) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDup (loc, k)); + } + | ISwap (loc, k), Item_t (a, Item_t (b, s)) -> + let s = Item_t (b, Item_t (a, s)) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISwap (loc, k)); + } + | IConst (loc, a, x, k), s -> + let s = Item_t (a, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IConst (loc, a, x, k)); + } + | ICons_pair (loc, k), Item_t (a, Item_t (b, s)) -> + pair_t dummy a b >|? fun (Ty_ex_c c) -> + let s = Item_t (c, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_pair (loc, k)); + } + | ICar (loc, k), Item_t (Pair_t (a, _b, _meta, _), s) -> + let s = Item_t (a, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICar (loc, k)); + } + | ICdr (loc, k), Item_t (Pair_t (_a, b, _meta, _), s) -> + let s = Item_t (b, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICdr (loc, k)); + } + | IUnpair (loc, k), Item_t (Pair_t (a, b, _meta, _), s) -> + let s = Item_t (a, Item_t (b, s)) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IUnpair (loc, k)); + } + | ICons_some (loc, k), Item_t (a, s) -> + option_t dummy a >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_some (loc, k)); + } + | ICons_none (loc, a, k), s -> + option_t dummy a >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_none (loc, a, k)); + } + | ( IIf_none {loc; branch_if_none; branch_if_some; k}, + Item_t (Option_t (a, _meta, _), s) ) -> + ok + @@ Ex_split_if + { + left_init_stack = s; + left_branch = branch_if_none; + right_init_stack = Item_t (a, s); + right_branch = branch_if_some; + continuation = k; + reconstruct = + (fun branch_if_none branch_if_some k -> + IIf_none {loc; branch_if_none; branch_if_some; k}); + } + | IOpt_map {loc; body; k}, Item_t (Option_t (a, _meta, _), s) -> + ok + @@ Ex_split_loop_may_not_fail + { + body_init_stack = Item_t (a, s); + body; + continuation = k; + aft_body_stack_transform = + (function + | Item_t (b, s) -> option_t dummy b >|? fun o -> Item_t (o, s)); + reconstruct = (fun body k -> IOpt_map {loc; body; k}); + } + | ICons_left (loc, b, k), Item_t (a, s) -> + union_t dummy a b >|? fun (Ty_ex_c c) -> + let s = Item_t (c, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_left (loc, b, k)); + } + | ICons_right (loc, a, k), Item_t (b, s) -> + union_t dummy a b >|? fun (Ty_ex_c c) -> + let s = Item_t (c, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_right (loc, a, k)); + } + | ( IIf_left {loc; branch_if_left; branch_if_right; k}, + Item_t (Union_t (a, b, _meta, _), s) ) -> + ok + @@ Ex_split_if + { + left_init_stack = Item_t (a, s); + left_branch = branch_if_left; + right_init_stack = Item_t (b, s); + right_branch = branch_if_right; + continuation = k; + reconstruct = + (fun branch_if_left branch_if_right k -> + IIf_left {loc; branch_if_left; branch_if_right; k}); + } + | ICons_list (loc, k), Item_t (_a, Item_t (l, s)) -> + let s = Item_t (l, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICons_list (loc, k)); + } + | INil (loc, a, k), s -> + list_t dummy a >|? fun l -> + let s = Item_t (l, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INil (loc, a, k)); + } + | ( IIf_cons {loc; branch_if_cons; branch_if_nil; k}, + Item_t ((List_t (a, _meta) as l), s) ) -> + ok + @@ Ex_split_if + { + left_init_stack = Item_t (a, Item_t (l, s)); + left_branch = branch_if_cons; + right_init_stack = s; + right_branch = branch_if_nil; + continuation = k; + reconstruct = + (fun branch_if_cons branch_if_nil k -> + IIf_cons {loc; branch_if_cons; branch_if_nil; k}); + } + | IList_map (loc, body, ty, k), Item_t (List_t (a, _meta), s) -> + let s = Item_t (a, s) in + ok + @@ Ex_split_loop_may_not_fail + { + body_init_stack = s; + body; + continuation = k; + aft_body_stack_transform = + (function + | Item_t (b, s) -> list_t dummy b >|? fun l -> Item_t (l, s)); + reconstruct = (fun body k -> IList_map (loc, body, ty, k)); + } + | IList_iter (loc, ty, body, k), Item_t (List_t (a, _meta), s) -> + ok + @@ Ex_split_loop_may_fail + { + body_init_stack = Item_t (a, s); + body; + cont_init_stack = s; + continuation = k; + reconstruct = (fun body k -> IList_iter (loc, ty, body, k)); + } + | IList_size (loc, k), Item_t (_l, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IList_size (loc, k)); + } + | IEmpty_set (loc, a, k), s -> + set_t dummy a >|? fun b -> + let s = Item_t (b, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEmpty_set (loc, a, k)); + } + | ISet_iter (loc, a, body, k), Item_t (_b, s) -> + ok + @@ Ex_split_loop_may_fail + { + body_init_stack = Item_t (assert_some a, s); + body; + cont_init_stack = s; + continuation = k; + reconstruct = (fun body k -> ISet_iter (loc, a, body, k)); + } + | ISet_mem (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISet_mem (loc, k)); + } + | ISet_update (loc, k), Item_t (_, Item_t (_, s)) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISet_update (loc, k)); + } + | ISet_size (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISet_size (loc, k)); + } + | IEmpty_map (loc, cty, vty, k), s -> + map_t dummy cty (assert_some vty) >|? fun m -> + let s = Item_t (m, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEmpty_map (loc, cty, vty, k)); + } + | IMap_map (loc, ty, body, k), Item_t (Map_t (kty, vty, _meta), s) -> + let (Map_t (key_ty, _, _)) = assert_some ty in + pair_t dummy key_ty vty >|? fun (Ty_ex_c p) -> + Ex_split_loop_may_not_fail + { + body_init_stack = Item_t (p, s); + body; + continuation = k; + aft_body_stack_transform = + (fun (Item_t (b, s)) -> + map_t dummy kty b >|? fun m -> Item_t (m, s)); + reconstruct = (fun body k -> IMap_map (loc, ty, body, k)); + } + | IMap_iter (loc, kvty, body, k), Item_t (_, stack) -> + ok + @@ Ex_split_loop_may_fail + { + body_init_stack = Item_t (assert_some kvty, stack); + body; + cont_init_stack = stack; + continuation = k; + reconstruct = (fun body k -> IMap_iter (loc, kvty, body, k)); + } + | IMap_mem (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMap_mem (loc, k)); + } + | IMap_get (loc, k), Item_t (_, Item_t (Map_t (_kty, vty, _meta), s)) -> + option_t dummy vty >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMap_get (loc, k)); + } + | IMap_update (loc, k), Item_t (_, Item_t (_, s)) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMap_update (loc, k)); + } + | IMap_get_and_update (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMap_get_and_update (loc, k)); + } + | IMap_size (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMap_size (loc, k)); + } + | IEmpty_big_map (loc, cty, ty, k), s -> + big_map_t dummy cty ty >|? fun b -> + let s = Item_t (b, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEmpty_big_map (loc, cty, ty, k)); + } + | IBig_map_mem (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBig_map_mem (loc, k)); + } + | IBig_map_get (loc, k), Item_t (_, Item_t (Big_map_t (_kty, vty, _meta), s)) + -> + option_t dummy vty >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBig_map_get (loc, k)); + } + | IBig_map_update (loc, k), Item_t (_, Item_t (_, s)) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBig_map_update (loc, k)); + } + | IBig_map_get_and_update (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBig_map_get_and_update (loc, k)); + } + | IConcat_string (loc, k), Item_t (_, s) -> + let s = Item_t (string_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IConcat_string (loc, k)); + } + | IConcat_string_pair (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IConcat_string_pair (loc, k)); + } + | ISlice_string (loc, k), Item_t (_, Item_t (_, Item_t (_, s))) -> + let s = Item_t (option_string_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISlice_string (loc, k)); + } + | IString_size (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IString_size (loc, k)); + } + | IConcat_bytes (loc, k), Item_t (_, s) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IConcat_bytes (loc, k)); + } + | IConcat_bytes_pair (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IConcat_bytes_pair (loc, k)); + } + | ISlice_bytes (loc, k), Item_t (_, Item_t (_, Item_t (_, s))) -> + let s = Item_t (option_bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISlice_bytes (loc, k)); + } + | IBytes_size (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBytes_size (loc, k)); + } + | ILsl_bytes (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILsl_bytes (loc, k)); + } + | ILsr_bytes (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILsr_bytes (loc, k)); + } + | IOr_bytes (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IOr_bytes (loc, k)); + } + | IAnd_bytes (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAnd_bytes (loc, k)); + } + | IXor_bytes (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IXor_bytes (loc, k)); + } + | INot_bytes (loc, k), Item_t (_, s) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INot_bytes (loc, k)); + } + | IBytes_nat (loc, k), Item_t (_, s) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBytes_nat (loc, k)); + } + | INat_bytes (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INat_bytes (loc, k)); + } + | IBytes_int (loc, k), Item_t (_, s) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBytes_int (loc, k)); + } + | IInt_bytes (loc, k), Item_t (_, s) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IInt_bytes (loc, k)); + } + | IAdd_seconds_to_timestamp (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_seconds_to_timestamp (loc, k)); + } + | IAdd_timestamp_to_seconds (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (timestamp_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_timestamp_to_seconds (loc, k)); + } + | ISub_timestamp_seconds (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (timestamp_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISub_timestamp_seconds (loc, k)); + } + | IDiff_timestamps (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDiff_timestamps (loc, k)); + } + | IAdd_tez (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_tez (loc, k)); + } + | ISub_tez (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (option_mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISub_tez (loc, k)); + } + | ISub_tez_legacy (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISub_tez_legacy (loc, k)); + } + | IMul_teznat (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_teznat (loc, k)); + } + | IMul_nattez (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_nattez (loc, k)); + } + | IEdiv_teznat (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (option_pair_mutez_mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEdiv_teznat (loc, k)); + } + | IEdiv_tez (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (option_pair_nat_mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEdiv_tez (loc, k)); + } + | IOr (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IOr (loc, k)); + } + | IAnd (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAnd (loc, k)); + } + | IXor (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IXor (loc, k)); + } + | INot (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INot (loc, k)); + } + | IIs_nat (loc, k), Item_t (_, s) -> + let s = Item_t (option_nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IIs_nat (loc, k)); + } + | INeg (loc, k), Item_t (_, s) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INeg (loc, k)); + } + | IAbs_int (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAbs_int (loc, k)); + } + | IInt_nat (loc, k), Item_t (_, s) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IInt_nat (loc, k)); + } + | IAdd_int (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_int (loc, k)); + } + | IAdd_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_nat (loc, k)); + } + | ISub_int (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISub_int (loc, k)); + } + | IMul_int (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_int (loc, k)); + } + | IMul_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_nat (loc, k)); + } + | IEdiv_int (loc, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (option_pair_int_nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEdiv_int (loc, k)); + } + | IEdiv_nat (loc, k), Item_t (_, Item_t (a, s)) -> + pair_t dummy a nat_t >>? fun (Ty_ex_c p) -> + option_t dummy p >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEdiv_nat (loc, k)); + } + | ILsl_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILsl_nat (loc, k)); + } + | ILsr_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILsr_nat (loc, k)); + } + | IOr_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IOr_nat (loc, k)); + } + | IAnd_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAnd_nat (loc, k)); + } + | IAnd_int_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAnd_int_nat (loc, k)); + } + | IXor_nat (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IXor_nat (loc, k)); + } + | INot_int (loc, k), Item_t (_, s) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INot_int (loc, k)); + } + | IIf {loc; branch_if_true; branch_if_false; k}, Item_t (_, s) -> + ok + @@ Ex_split_if + { + left_init_stack = s; + left_branch = branch_if_true; + right_init_stack = s; + right_branch = branch_if_false; + continuation = k; + reconstruct = + (fun branch_if_true branch_if_false k -> + IIf {loc; branch_if_true; branch_if_false; k}); + } + | ILoop (loc, body, k), Item_t (_, s) -> + ok + @@ Ex_split_loop_may_fail + { + body_init_stack = s; + body; + cont_init_stack = s; + continuation = k; + reconstruct = (fun body k -> ILoop (loc, body, k)); + } + | ILoop_left (loc, kl, kr), Item_t (Union_t (a, b, _meta, _), s) -> + ok + @@ Ex_split_loop_may_fail + { + body_init_stack = Item_t (a, s); + body = kl; + cont_init_stack = Item_t (b, s); + continuation = kr; + reconstruct = (fun kl kr -> ILoop_left (loc, kl, kr)); + } + | IDip (loc, body, ty, k), Item_t (a, s) -> + ok + @@ Ex_split_loop_may_not_fail + { + body_init_stack = s; + body; + continuation = k; + aft_body_stack_transform = (fun s -> ok @@ Item_t (a, s)); + reconstruct = (fun body k -> IDip (loc, body, ty, k)); + } + | IExec (loc, sty, k), Item_t (_, Item_t (Lambda_t (_, b, _meta), s)) -> + let s = Item_t (b, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IExec (loc, sty, k)); + } + | ( IApply (loc, ty, k), + Item_t (_, Item_t (Lambda_t (Pair_t (_, a, _, _), b, _), s)) ) -> + lambda_t dummy a b >|? fun l -> + let s = Item_t (l, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IApply (loc, ty, k)); + } + | ILambda (loc, (Lam (desc, _) as l), k), s -> + let (Item_t (a, Bot_t)) = desc.kbef in + let (Item_t (b, Bot_t)) = desc.kaft in + lambda_t dummy a b >|? fun lam -> + let s = Item_t (lam, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILambda (loc, l, k)); + } + | ILambda (loc, (LamRec (desc, _) as l), k), s -> + let (Item_t (a, Item_t (Lambda_t _, Bot_t))) = desc.kbef in + let (Item_t (b, Bot_t)) = desc.kaft in + lambda_t dummy a b >|? fun lam -> + let s = Item_t (lam, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILambda (loc, l, k)); + } + | IFailwith (location, arg_ty), _ -> + ok + @@ Ex_split_failwith + {location; arg_ty; cast = {cast = IFailwith (location, arg_ty)}} + | ICompare (loc, ty, k), Item_t (_, Item_t (_, s)) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICompare (loc, ty, k)); + } + | IEq (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEq (loc, k)); + } + | INeq (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INeq (loc, k)); + } + | ILt (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILt (loc, k)); + } + | IGt (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IGt (loc, k)); + } + | ILe (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILe (loc, k)); + } + | IGe (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IGe (loc, k)); + } + | IAddress (loc, k), Item_t (_, s) -> + let s = Item_t (address_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAddress (loc, k)); + } + | IContract (loc, ty, code, k), Item_t (_, s) -> + contract_t dummy ty >>? fun c -> + option_t dummy c >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IContract (loc, ty, code, k)); + } + | ITransfer_tokens (loc, k), Item_t (_, Item_t (_, Item_t (_, s))) -> + let s = Item_t (operation_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ITransfer_tokens (loc, k)); + } + | ( IView (loc, (View_signature {output_ty; _} as view_signature), sty, k), + Item_t (_, Item_t (_, s)) ) -> + option_t dummy output_ty >|? fun b -> + let s = Item_t (b, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IView (loc, view_signature, sty, k)); + } + | IImplicit_account (loc, k), Item_t (_, s) -> + let s = Item_t (contract_unit_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IImplicit_account (loc, k)); + } + | ( ICreate_contract {loc; storage_type; code; k}, + Item_t (_, Item_t (_, Item_t (_, s))) ) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = Item_t (operation_t, Item_t (address_t, s)); + continuation = k; + reconstruct = + (fun k -> ICreate_contract {loc; storage_type; code; k}); + } + | ISet_delegate (loc, k), Item_t (_, s) -> + let s = Item_t (operation_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISet_delegate (loc, k)); + } + | INow (loc, k), s -> + let s = Item_t (timestamp_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INow (loc, k)); + } + | IBalance (loc, k), s -> + let s = Item_t (mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBalance (loc, k)); + } + | ILevel (loc, k), s -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ILevel (loc, k)); + } + | ICheck_signature (loc, k), Item_t (_, Item_t (_, Item_t (_, s))) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ICheck_signature (loc, k)); + } + | IHash_key (loc, k), Item_t (_, s) -> + let s = Item_t (key_hash_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IHash_key (loc, k)); + } + | IPack (loc, ty, k), Item_t (_, s) -> + let s = Item_t (bytes_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IPack (loc, ty, k)); + } + | IUnpack (loc, ty, k), Item_t (_, s) -> + option_t dummy ty >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IUnpack (loc, ty, k)); + } + | IBlake2b (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IBlake2b (loc, k)); + } + | ISha256 (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISha256 (loc, k)); + } + | ISha512 (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISha512 (loc, k)); + } + | ISource (loc, k), s -> + let s = Item_t (address_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISource (loc, k)); + } + | ISender (loc, k), s -> + let s = Item_t (address_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISender (loc, k)); + } + | ISelf (loc, ty, ep, k), s -> + contract_t dummy ty >|? fun c -> + let s = Item_t (c, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISelf (loc, ty, ep, k)); + } + | ISelf_address (loc, k), s -> + let s = Item_t (address_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISelf_address (loc, k)); + } + | IAmount (loc, k), s -> + let s = Item_t (mutez_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAmount (loc, k)); + } + | ISapling_empty_state (loc, memo_size, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = Item_t (sapling_state_t ~memo_size, s); + continuation = k; + reconstruct = (fun k -> ISapling_empty_state (loc, memo_size, k)); + } + | ( ISapling_verify_update_deprecated (loc, k), + Item_t (_, Item_t (state_ty, s)) ) -> + pair_t dummy int_t state_ty >>? fun (Ty_ex_c pair_ty) -> + option_t dummy pair_ty >|? fun ty -> + Ex_split_kinstr + { + cont_init_stack = Item_t (ty, s); + continuation = k; + reconstruct = (fun k -> ISapling_verify_update_deprecated (loc, k)); + } + | ISapling_verify_update (loc, k), Item_t (_, Item_t (state_ty, s)) -> + pair_t dummy int_t state_ty >>? fun (Ty_ex_c int_state_ty) -> + pair_t dummy bytes_t int_state_ty >>? fun (Ty_ex_c pair_ty) -> + option_t dummy pair_ty >|? fun ty -> + let s = Item_t (ty, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISapling_verify_update (loc, k)); + } + | IDig (loc, n, p, k), s -> + let (Item_t (b, s)) = + stack_prefix_preservation_witness_split_input p s + in + let s = stack_prefix_preservation_witness_split_output p s in + let s = Item_t (b, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDig (loc, n, p, k)); + } + | IDug (loc, n, p, k), Item_t (a, s) -> + let s = stack_prefix_preservation_witness_split_input p s in + let s = Item_t (a, s) in + let s = stack_prefix_preservation_witness_split_output p s in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDug (loc, n, p, k)); + } + | IDipn (loc, n, p, k1, k2), s -> + ok + @@ Ex_split_loop_may_not_fail + { + body_init_stack = + stack_prefix_preservation_witness_split_input p s; + body = k1; + continuation = k2; + aft_body_stack_transform = + (fun s -> + ok @@ stack_prefix_preservation_witness_split_output p s); + reconstruct = (fun k1 k2 -> IDipn (loc, n, p, k1, k2)); + } + | IDropn (loc, n, p, k), s -> + let s = stack_prefix_preservation_witness_split_input p s in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDropn (loc, n, p, k)); + } + | IChainId (loc, k), s -> + let s = Item_t (chain_id_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IChainId (loc, k)); + } + | INever location, Item_t (arg_ty, _) -> + ok + @@ Ex_split_failwith {location; arg_ty; cast = {cast = INever location}} + | IVoting_power (loc, k), Item_t (_, s) -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IVoting_power (loc, k)); + } + | ITotal_voting_power (loc, k), s -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ITotal_voting_power (loc, k)); + } + | IKeccak (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IKeccak (loc, k)); + } + | ISha3 (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISha3 (loc, k)); + } + | IAdd_bls12_381_g1 (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_bls12_381_g1 (loc, k)); + } + | IAdd_bls12_381_g2 (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_bls12_381_g2 (loc, k)); + } + | IAdd_bls12_381_fr (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IAdd_bls12_381_fr (loc, k)); + } + | IMul_bls12_381_g1 (loc, k), Item_t (g1, Item_t (_, s)) -> + let s = Item_t (g1, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_bls12_381_g1 (loc, k)); + } + | IMul_bls12_381_g2 (loc, k), Item_t (g2, Item_t (_, s)) -> + let s = Item_t (g2, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_bls12_381_g2 (loc, k)); + } + | IMul_bls12_381_fr (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_bls12_381_fr (loc, k)); + } + | IMul_bls12_381_z_fr (loc, k), Item_t (fr, Item_t (_, s)) -> + let s = Item_t (fr, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_bls12_381_z_fr (loc, k)); + } + | IMul_bls12_381_fr_z (loc, k), Item_t (_, s) -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMul_bls12_381_fr_z (loc, k)); + } + | IInt_bls12_381_fr (loc, k), Item_t (_, s) -> + let s = Item_t (int_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IInt_bls12_381_fr (loc, k)); + } + | INeg_bls12_381_g1 (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INeg_bls12_381_g1 (loc, k)); + } + | INeg_bls12_381_g2 (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INeg_bls12_381_g2 (loc, k)); + } + | INeg_bls12_381_fr (loc, k), s -> + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> INeg_bls12_381_fr (loc, k)); + } + | IPairing_check_bls12_381 (loc, k), Item_t (_, s) -> + let s = Item_t (bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IPairing_check_bls12_381 (loc, k)); + } + | IComb (loc, n, p, k), s -> + let rec aux : + type a b s c d t. + (a, b * s) stack_ty -> + (a, b, s, c, d, t) comb_gadt_witness -> + (c, d * t) stack_ty tzresult = + fun s w -> + match (w, s) with + | Comb_one, s -> ok s + | Comb_succ w, Item_t (a, s) -> + aux s w >>? fun (Item_t (c, t)) -> + pair_t dummy a c >|? fun (Ty_ex_c p) -> Item_t (p, t) + in + aux s p >|? fun s -> + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IComb (loc, n, p, k)); + } + | IUncomb (loc, n, p, k), s -> + let rec aux : + type a b s c d t. + (a, b * s) stack_ty -> + (a, b, s, c, d, t) uncomb_gadt_witness -> + (c, d * t) stack_ty = + fun s w -> + match (w, s) with + | Uncomb_one, s -> s + | Uncomb_succ w, Item_t (Pair_t (a, b, _meta, _), s) -> + let s = aux (Item_t (b, s)) w in + Item_t (a, s) + in + let s = aux s p in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IUncomb (loc, n, p, k)); + } + | IComb_get (loc, n, p, k), Item_t (c, s) -> + let rec aux : + type c cc a. (c, cc) ty -> (c, a) comb_get_gadt_witness -> a ty_ex_c + = + fun c w -> + match (w, c) with + | Comb_get_zero, c -> Ty_ex_c c + | Comb_get_one, Pair_t (hd, _tl, _meta, _) -> Ty_ex_c hd + | Comb_get_plus_two w, Pair_t (_hd, tl, _meta, _) -> aux tl w + in + let s = + let (Ty_ex_c ty) = aux c p in + Item_t (ty, s) + in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IComb_get (loc, n, p, k)); + } + | IComb_set (loc, n, p, k), Item_t (a, Item_t (b, s)) -> + let rec aux : + type a b c ca cb. + (a, ca) ty -> + (b, cb) ty -> + (a, b, c) comb_set_gadt_witness -> + c ty_ex_c tzresult = + fun a b w -> + match (w, b) with + | Comb_set_zero, _ -> ok (Ty_ex_c a) + | Comb_set_one, Pair_t (_hd, tl, _meta, _) -> pair_t dummy a tl + | Comb_set_plus_two w, Pair_t (hd, tl, _meta, _) -> + aux a tl w >>? fun (Ty_ex_c c) -> pair_t dummy hd c + in + aux a b p >|? fun (Ty_ex_c c) -> + let s = Item_t (c, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IComb_set (loc, n, p, k)); + } + | IDup_n (loc, n, p, k), s -> + let rec aux : + type a b s t. + (a, b * s) stack_ty -> (a, b, s, t) dup_n_gadt_witness -> t ty_ex_c + = + fun s w -> + match (w, s) with + | Dup_n_succ w, Item_t (_, s) -> aux s w + | Dup_n_zero, Item_t (a, _) -> Ty_ex_c a + in + let s = + let (Ty_ex_c ty) = aux s p in + Item_t (ty, s) + in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IDup_n (loc, n, p, k)); + } + | ITicket (loc, cty, k), Item_t (_, Item_t (_, s)) -> + ticket_t dummy (assert_some cty) >>? option_t loc >|? fun t -> + let s = Item_t (t, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ITicket (loc, cty, k)); + } + | ITicket_deprecated (loc, cty, k), Item_t (_, Item_t (_, s)) -> + ticket_t dummy (assert_some cty) >|? fun t -> + let s = Item_t (t, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ITicket_deprecated (loc, cty, k)); + } + | IRead_ticket (loc, a, k), s -> + pair_t dummy (assert_some a) nat_t >>? fun (Ty_ex_c p) -> + pair_t dummy address_t p >|? fun (Ty_ex_c t) -> + let s = Item_t (t, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IRead_ticket (loc, a, k)); + } + | ISplit_ticket (loc, k), Item_t (t, Item_t (_, s)) -> + pair_t dummy t t >>? fun (Ty_ex_c p) -> + option_t dummy p >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> ISplit_ticket (loc, k)); + } + | IJoin_tickets (loc, ty, k), Item_t (Pair_t (t, _t, _meta, _), s) -> + option_t dummy t >|? fun o -> + let s = Item_t (o, s) in + Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IJoin_tickets (loc, ty, k)); + } + | IOpen_chest (loc, k), Item_t (_, Item_t (_, Item_t (_, s))) -> + let s = Item_t (union_bytes_bool_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IOpen_chest (loc, k)); + } + | IMin_block_time (loc, k), s -> + let s = Item_t (nat_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IMin_block_time (loc, k)); + } + | IEmit {loc; ty; unparsed_ty; tag; k}, Item_t (_, s) -> + let s = Item_t (operation_t, s) in + ok + @@ Ex_split_kinstr + { + cont_init_stack = s; + continuation = k; + reconstruct = (fun k -> IEmit {loc; ty; unparsed_ty; tag; k}); + } + | IEmit _, Bot_t -> . + | IHalt loc, _s -> ok @@ Ex_split_halt loc + | ILog (loc, _stack_ty, event, logger, continuation), stack -> + ok + @@ Ex_split_log + { + stack; + continuation; + reconstruct = (fun k -> ILog (loc, s, event, logger, k)); + } + + (* [kinstr_final_stack_type sty instr] computes the stack type after + [instr] has been executed, assuming [sty] is the type of the stack + prior to execution. For the rare instructions which can return stacks + of any type ([FAILWITH] and [NEVER]), this function returns [None]. *) + let rec kinstr_final_stack_type : + type a s r f. + (a, s) stack_ty -> (a, s, r, f) kinstr -> (r, f) stack_ty option tzresult + = + fun s i -> + kinstr_split s i >>? function + | Ex_split_kinstr {cont_init_stack; continuation; _} -> + kinstr_final_stack_type cont_init_stack continuation + | Ex_split_log {stack; continuation; _} -> + kinstr_final_stack_type stack continuation + | Ex_split_loop_may_fail {cont_init_stack; continuation; _} -> + kinstr_final_stack_type cont_init_stack continuation + | Ex_split_loop_may_not_fail + {body_init_stack; body; continuation; aft_body_stack_transform; _} -> ( + kinstr_final_stack_type body_init_stack body >>? function + | Some after_body -> + aft_body_stack_transform after_body >>? fun before_k -> + kinstr_final_stack_type before_k continuation + | None -> ok None) + | Ex_split_if + { + left_init_stack; + left_branch; + right_init_stack; + right_branch; + continuation; + _; + } -> ( + kinstr_final_stack_type left_init_stack left_branch >>? function + | Some after_branch_a -> + kinstr_final_stack_type after_branch_a continuation + | None -> ( + kinstr_final_stack_type right_init_stack right_branch >>? function + | Some after_branch_b -> + kinstr_final_stack_type after_branch_b continuation + | None -> ok None)) + | Ex_split_halt _ -> ok @@ Some s + | Ex_split_failwith {cast = {cast = _}; _} -> ok None + + (* The same as [kinstr_final_stack_type], but selects from multiple + possible execution branches. If the first instr ends with FAILWITH, + it will try the next and so on. Note that all instructions must + result in the same stack type. *) + let rec branched_final_stack_type : + type r f. (r, f) ex_init_stack_ty list -> (r, f) stack_ty option tzresult + = function + | [] -> ok None + | Ex_init_stack_ty (init_sty, branch) :: bs -> ( + kinstr_final_stack_type init_sty branch >>? function + | Some _ as sty -> ok sty + | None -> branched_final_stack_type bs) + + let kinstr_rewritek : + type a s r f. + (a, s) stack_ty -> + (a, s, r, f) kinstr -> + kinstr_rewritek -> + (a, s, r, f) kinstr tzresult = + fun s i f -> + kinstr_split s i >>? function + | Ex_split_kinstr {cont_init_stack; continuation; reconstruct} -> + ok @@ reconstruct (f.apply cont_init_stack continuation) + | Ex_split_log {continuation; reconstruct; _} -> + ok @@ reconstruct continuation + | Ex_split_loop_may_fail + {body_init_stack; body; cont_init_stack; continuation; reconstruct} -> + ok + @@ reconstruct + (f.apply body_init_stack body) + (f.apply cont_init_stack continuation) + | Ex_split_loop_may_not_fail + { + body_init_stack; + body; + continuation; + aft_body_stack_transform; + reconstruct; + } -> + (kinstr_final_stack_type body_init_stack body >>? function + | Some after_body -> + aft_body_stack_transform after_body >|? fun before_k -> + f.apply before_k continuation + | None -> ok continuation) + >|? fun k -> reconstruct (f.apply body_init_stack body) k + | Ex_split_if + { + left_init_stack; + left_branch; + right_init_stack; + right_branch; + continuation; + reconstruct; + } -> + (kinstr_final_stack_type left_init_stack left_branch >>? function + | Some after_left_branch -> + ok @@ f.apply after_left_branch continuation + | None -> ( + kinstr_final_stack_type right_init_stack right_branch >>? function + | Some after_right_branch -> + ok @@ f.apply after_right_branch continuation + | None -> ok continuation)) + >|? fun k -> + reconstruct + (f.apply left_init_stack left_branch) + (f.apply right_init_stack right_branch) + k + | Ex_split_halt loc -> ok @@ IHalt loc + | Ex_split_failwith {location; arg_ty; _} -> + ok @@ IFailwith (location, arg_ty) + + (** [dipn_stack_ty witness stack_ty] returns the type of the stack + on which instructions inside dipped block will be operating. *) + let rec dipn_stack_ty : + type a s e z c u d w. + (a, s, e, z, c, u, d, w) stack_prefix_preservation_witness -> + (c, u) stack_ty -> + (a, s) stack_ty = + fun witness stack -> + match (witness, stack) with + | KPrefix (_, _, witness'), Item_t (_, sty) -> dipn_stack_ty witness' sty + | KRest, sty -> sty + + (** [instrument_cont logger sty] creates a function instrumenting + continuations starting from the stack type described by [sty]. + Instrumentation consists in wrapping inner continuations in + [KLog] continuation so that logging continues. *) + let instrument_cont : + type a b c d. + logger -> + (a, b) stack_ty -> + (a, b, c, d) continuation -> + (a, b, c, d) continuation = + fun logger sty -> function KLog _ as k -> k | k -> KLog (k, sty, logger) +end + +module type Logger_base = sig + val log_interp : ('a, 's, 'b, 'f, 'c, 'u) logging_function + + val log_entry : ('a, 's, 'b, 'f, 'a, 's) logging_function + + val log_control : ('a, 's, 'b, 'f) continuation -> unit + + val log_exit : ('a, 's, 'b, 'f, 'c, 'u) logging_function + + val get_log : unit -> execution_trace option tzresult Lwt.t +end + +module Logger (Base : Logger_base) = struct + open Stack_utils + open Local_gas_counter + open Script_interpreter_defs + open Script_interpreter.Internals.Raw + + (** [log_entry ctxt gas instr sty accu stack] simply calls the + [Base.log_entry] function with the appropriate arguments. *) + let log_entry ctxt gas k sty accu stack = + let ctxt = Local_gas_counter.update_context gas ctxt in + Base.log_entry k ctxt (kinstr_location k) sty (accu, stack) + + (** [log_exit ctxt gas loc instr sty accu stack] simply calls the + [Base.log_exit] function with the appropriate arguments. *) + let log_exit ctxt gas loc_prev k sty accu stack = + let ctxt = Local_gas_counter.update_context gas ctxt in + Base.log_exit k ctxt loc_prev sty (accu, stack) + + (** [log_control continuation] simply calls the [Base.log_control] + function with the appropriate arguments. *) + let log_control ks = Base.log_control ks + + (** [log_kinstr logger sty instr] returns [instr] prefixed by an + [ILog] instruction to log the first instruction in [instr]. *) + let log_kinstr logger sty i = + ILog (kinstr_location i, sty, LogEntry, logger, i) + + (* [log_next_kinstr logger i] instruments the next instruction of [i] + with [ILog] instructions to make sure it will be logged. + This instrumentation has a performance cost, but importantly, it is + only ever paid when logging is enabled. Otherwise, the possibility + to instrument the script is costless. + + Notice that the instrumentation breaks the sharing of continuations + that is normally enforced between branches of conditionals. This + has a performance cost. Anyway, the instrumentation allocates many + new [ILog] instructions and [KLog] continuations which makes + the execution of instrumented code significantly slower than + non-instrumented code. "Zero-cost logging" means that the normal + non-instrumented execution is not impacted by the ability to + instrument it, not that the logging itself has no cost. + *) + let log_next_kinstr logger sty i = + let apply sty k = + ILog + ( kinstr_location k, + sty, + LogExit (kinstr_location i), + logger, + log_kinstr logger sty k ) + in + kinstr_rewritek sty i {apply} + + (** [log_next_continuation logger sty cont] instruments the next + continuation in [cont] with [KLog] continuations to ensure + logging. + + This instrumentation has a performance cost, but importantly, it + is only ever paid when logging is enabled. Otherwise, the + possibility to instrument the script is costless. *) + let log_next_continuation : + type a b c d. + logger -> + (a, b) stack_ty -> + (a, b, c, d) continuation -> + (a, b, c, d) continuation tzresult = + fun logger stack_ty cont -> + let enable_log sty ki = log_kinstr logger sty ki in + match cont with + | KCons (ki, k) -> ( + let ki' = enable_log stack_ty ki in + kinstr_final_stack_type stack_ty ki >|? function + | None -> KCons (ki', k) + | Some sty -> KCons (ki', instrument_cont logger sty k)) + | KLoop_in (ki, k) -> + let (Item_t (Bool_t, sty)) = stack_ty in + ok @@ KLoop_in (enable_log sty ki, instrument_cont logger sty k) + | KReturn (stack, sty, k) -> + let k' = instrument_cont logger (assert_some sty) k in + ok @@ KReturn (stack, sty, k') + | KLoop_in_left (ki, k) -> + let (Item_t (Union_t (a_ty, b_ty, _, _), rest)) = stack_ty in + let ki' = enable_log (Item_t (a_ty, rest)) ki in + let k' = instrument_cont logger (Item_t (b_ty, rest)) k in + ok @@ KLoop_in_left (ki', k') + | KUndip (x, ty, k) -> + let k' = instrument_cont logger (Item_t (assert_some ty, stack_ty)) k in + ok @@ KUndip (x, ty, k') + | KIter (body, xty, xs, k) -> + let body' = enable_log (Item_t (assert_some xty, stack_ty)) body in + let k' = instrument_cont logger stack_ty k in + ok @@ KIter (body', xty, xs, k') + | KList_enter_body (body, xs, ys, ty, len, k) -> + let k' = instrument_cont logger (Item_t (assert_some ty, stack_ty)) k in + ok @@ KList_enter_body (body, xs, ys, ty, len, k') + | KList_exit_body (body, xs, ys, ty, len, k) -> + let (Item_t (_, sty)) = stack_ty in + let k' = instrument_cont logger (Item_t (assert_some ty, sty)) k in + ok @@ KList_exit_body (body, xs, ys, ty, len, k') + | KMap_enter_body (body, xs, ys, ty, k) -> + let k' = instrument_cont logger (Item_t (assert_some ty, stack_ty)) k in + ok @@ KMap_enter_body (body, xs, ys, ty, k') + | KMap_exit_body (body, xs, ys, yk, ty, k) -> + let (Item_t (_, sty)) = stack_ty in + let k' = instrument_cont logger (Item_t (assert_some ty, sty)) k in + ok @@ KMap_exit_body (body, xs, ys, yk, ty, k') + | KMap_head (_, _) + | KView_exit (_, _) + | KLog _ (* This case should never happen. *) | KNil -> + ok cont + + (* + + Zero-cost logging + ================= + + *) + + (* + + The following functions insert a logging instruction to continue + the logging process in the next execution steps. + + There is a special treatment of instructions that generate fresh + continuations: we pass a constructor as argument to their + evaluation rules so that they can instrument these fresh + continuations by themselves. Instructions that create continuations + without calling specialized functions have their branches from [step] + function duplicated and adjusted here. + + This on-the-fly instrumentation of the execution allows zero-cost + logging since logging instructions are only introduced if an + initial logging continuation is pushed in the initial continuation + that starts the evaluation. + + *) + let ilog : + type a s b t r f. + logger -> logging_event -> (a, s) stack_ty -> (a, s, b, t, r, f) step_type + = + fun logger event sty ((ctxt, _) as g) gas k ks accu stack -> + (match (k, event) with + | ILog _, LogEntry -> () + | _, LogEntry -> log_entry ctxt gas k sty accu stack + | _, LogExit prev_loc -> log_exit ctxt gas prev_loc k sty accu stack) ; + log_next_kinstr logger sty k >>?= fun k -> + (* We need to match on instructions that create continuations so + that we can instrument those continuations with [KLog] (see + comment above). For functions that don't do this, we simply call + [step], as they don't require any special treatment. *) + match k with + | IIf_none {branch_if_none; branch_if_some; k; _} -> ( + let (Item_t (Option_t (ty, _, _), rest)) = sty in + branched_final_stack_type + [ + Ex_init_stack_ty (rest, branch_if_none); + Ex_init_stack_ty (Item_t (ty, rest), branch_if_some); + ] + >>?= fun sty_opt -> + let ks' = + match sty_opt with + | None -> KCons (k, ks) + | Some sty' -> instrument_cont logger sty' @@ KCons (k, ks) + in + match accu with + | None -> + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas branch_if_none ks' accu stack + | Some v -> (step [@ocaml.tailcall]) g gas branch_if_some ks' v stack) + | IOpt_map {body; k; loc = _} -> ( + match accu with + | None -> (step [@ocaml.tailcall]) g gas k ks None stack + | Some v -> + let (Item_t (Option_t (ty, _, _), rest)) = sty in + let bsty = Item_t (ty, rest) in + let kmap_head = KMap_head (Option.some, KCons (k, ks)) in + kinstr_final_stack_type bsty body >>?= fun sty_opt -> + let ks' = + match sty_opt with + | None -> kmap_head + | Some sty' -> instrument_cont logger sty' kmap_head + in + (step [@ocaml.tailcall]) g gas body ks' v stack) + | IIf_left {branch_if_left; branch_if_right; k; _} -> ( + let (Item_t (Union_t (lty, rty, _, _), rest)) = sty in + branched_final_stack_type + [ + Ex_init_stack_ty (Item_t (lty, rest), branch_if_left); + Ex_init_stack_ty (Item_t (rty, rest), branch_if_right); + ] + >>?= fun sty_opt -> + let k' = + match sty_opt with + | None -> KCons (k, ks) + | Some sty' -> instrument_cont logger sty' @@ KCons (k, ks) + in + match accu with + | L v -> (step [@ocaml.tailcall]) g gas branch_if_left k' v stack + | R v -> (step [@ocaml.tailcall]) g gas branch_if_right k' v stack) + | IIf_cons {branch_if_cons; branch_if_nil; k; _} -> ( + let (Item_t ((List_t (elty, _) as lty), rest)) = sty in + branched_final_stack_type + [ + Ex_init_stack_ty (rest, branch_if_nil); + Ex_init_stack_ty (Item_t (elty, Item_t (lty, rest)), branch_if_cons); + ] + >>?= fun sty' -> + let k' = + match sty' with + | None -> KCons (k, ks) + | Some sty' -> instrument_cont logger sty' @@ KCons (k, ks) + in + match Script_list.uncons accu with + | None -> + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas branch_if_nil k' accu stack + | Some (hd, tl) -> + (step [@ocaml.tailcall]) g gas branch_if_cons k' hd (tl, stack)) + | IList_map (_, body, ty, k) -> + let (Item_t (_, sty')) = sty in + let instrument = instrument_cont logger sty' in + (ilist_map [@ocaml.tailcall]) instrument g gas body k ks ty accu stack + | IList_iter (_, ty, body, k) -> + let (Item_t (_, sty')) = sty in + let instrument = instrument_cont logger sty' in + (ilist_iter [@ocaml.tailcall]) instrument g gas body ty k ks accu stack + | ISet_iter (_, ty, body, k) -> + let (Item_t (_, rest)) = sty in + let instrument = instrument_cont logger rest in + (iset_iter [@ocaml.tailcall]) instrument g gas body ty k ks accu stack + | IMap_map (_, ty, body, k) -> + let (Item_t (_, rest)) = sty in + let instrument = instrument_cont logger rest in + (imap_map [@ocaml.tailcall]) instrument g gas body k ks ty accu stack + | IMap_iter (_, kvty, body, k) -> + let (Item_t (_, rest)) = sty in + let instrument = instrument_cont logger rest in + (imap_iter [@ocaml.tailcall]) instrument g gas body kvty k ks accu stack + | IMul_teznat (loc, k) -> + (imul_teznat [@ocaml.tailcall]) (Some logger) g gas loc k ks accu stack + | IMul_nattez (loc, k) -> + (imul_nattez [@ocaml.tailcall]) (Some logger) g gas loc k ks accu stack + | ILsl_nat (loc, k) -> + (ilsl_nat [@ocaml.tailcall]) (Some logger) g gas loc k ks accu stack + | ILsr_nat (loc, k) -> + (ilsr_nat [@ocaml.tailcall]) (Some logger) g gas loc k ks accu stack + | IIf {branch_if_true; branch_if_false; k; _} -> + let (Item_t (Bool_t, rest)) = sty in + branched_final_stack_type + [ + Ex_init_stack_ty (rest, branch_if_true); + Ex_init_stack_ty (rest, branch_if_false); + ] + >>?= fun sty' -> + let k' = + match sty' with + | None -> KCons (k, ks) + | Some sty' -> instrument_cont logger sty' @@ KCons (k, ks) + in + let res, stack = stack in + if accu then (step [@ocaml.tailcall]) g gas branch_if_true k' res stack + else (step [@ocaml.tailcall]) g gas branch_if_false k' res stack + | ILoop (_, body, k) -> + let ks = instrument_cont logger sty @@ KLoop_in (body, KCons (k, ks)) in + (next [@ocaml.tailcall]) g gas ks accu stack + | ILoop_left (_, bl, br) -> + let ks = + instrument_cont logger sty @@ KLoop_in_left (bl, KCons (br, ks)) + in + (next [@ocaml.tailcall]) g gas ks accu stack + | IDip (_, b, ty, k) -> + let (Item_t (_, rest)) = sty in + kinstr_final_stack_type rest b >>?= fun rest' -> + let ign = accu in + let ks = + match rest' with + | None -> KUndip (ign, ty, KCons (k, ks)) + | Some rest' -> + instrument_cont logger rest' (KUndip (ign, ty, KCons (k, ks))) + in + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas b ks accu stack + | IExec (_, stack_ty, k) -> + let (Item_t (_, Item_t (Lambda_t (_, ret, _), _))) = sty in + let sty' = Item_t (ret, Bot_t) in + let instrument = instrument_cont logger sty' in + iexec instrument (Some logger) g gas stack_ty k ks accu stack + | IFailwith (kloc, tv) -> + let {ifailwith} = ifailwith in + (ifailwith [@ocaml.tailcall]) (Some logger) g gas kloc tv accu + | IDipn (_, _n, n', b, k) -> + let accu, stack, restore_prefix = kundip n' accu stack k in + let dipped_sty = dipn_stack_ty n' sty in + kinstr_final_stack_type dipped_sty b >>?= fun sty' -> + let ks = + match sty' with + | None -> KCons (restore_prefix, ks) + | Some sty' -> + instrument_cont logger sty' @@ KCons (restore_prefix, ks) + in + (step [@ocaml.tailcall]) g gas b ks accu stack + | IView (_, (View_signature {output_ty; _} as view_signature), stack_ty, k) + -> + let sty' = Item_t (output_ty, Bot_t) in + let instrument = instrument_cont logger sty' in + (iview [@ocaml.tailcall]) + instrument + g + gas + view_signature + stack_ty + k + ks + accu + stack + | _ -> (step [@ocaml.tailcall]) g gas k ks accu stack + [@@inline] + + let klog : + type a s r f. + logger -> + outdated_context * step_constants -> + local_gas_counter -> + (a, s) stack_ty -> + (a, s, r, f) continuation -> + (a, s, r, f) continuation -> + a -> + s -> + (r * f * outdated_context * local_gas_counter) tzresult Lwt.t = + fun logger g gas stack_ty k0 ks accu stack -> + let ty_for_logging_unsafe = function + (* This function is only called when logging is enabled. If + that's the case, the elaborator must have been called with + [logging_enabled] option, which ensures that this will not be + [None]. Realistically, it can happen that the [logging_enabled] + option was omitted, resulting in a crash here. But this is + acceptable, because logging is never enabled during block + validation, so the layer 1 is safe. *) + | None -> assert false + | Some ty -> ty + in + (match ks with KLog _ -> () | _ -> log_control ks) ; + log_next_continuation logger stack_ty ks >>?= function + | KCons (ki, k) -> (step [@ocaml.tailcall]) g gas ki k accu stack + | KLoop_in (ki, k) -> (kloop_in [@ocaml.tailcall]) g gas k0 ki k accu stack + | KReturn (_, _, _) as k -> (next [@ocaml.tailcall]) g gas k accu stack + | KLoop_in_left (ki, k) -> + (kloop_in_left [@ocaml.tailcall]) g gas k0 ki k accu stack + | KUndip (_, _, _) as k -> (next [@ocaml.tailcall]) g gas k accu stack + | KIter (body, xty, xs, k) -> + let instrument = instrument_cont logger stack_ty in + (kiter [@ocaml.tailcall]) instrument g gas body xty xs k accu stack + | KList_enter_body (body, xs, ys, ty_opt, len, k) -> + let instrument = + let ty = ty_for_logging_unsafe ty_opt in + let (List_t (vty, _)) = ty in + let sty = Item_t (vty, stack_ty) in + instrument_cont logger sty + in + (klist_enter [@ocaml.tailcall]) + instrument + g + gas + body + xs + ys + ty_opt + len + k + accu + stack + | KList_exit_body (body, xs, ys, ty_opt, len, k) -> + let (Item_t (_, rest)) = stack_ty in + let instrument = instrument_cont logger rest in + (klist_exit [@ocaml.tailcall]) + instrument + g + gas + body + xs + ys + ty_opt + len + k + accu + stack + | KMap_enter_body (body, xs, ys, ty_opt, k) -> + let instrument = + let ty = ty_for_logging_unsafe ty_opt in + let (Map_t (_, vty, _)) = ty in + let sty = Item_t (vty, stack_ty) in + instrument_cont logger sty + in + (kmap_enter [@ocaml.tailcall]) + instrument + g + gas + body + xs + ty_opt + ys + k + accu + stack + | KMap_exit_body (body, xs, ys, yk, ty_opt, k) -> + let (Item_t (_, rest)) = stack_ty in + let instrument = instrument_cont logger rest in + (kmap_exit [@ocaml.tailcall]) + instrument + g + gas + body + xs + ty_opt + ys + yk + k + accu + stack + | KMap_head (f, k) -> (next [@ocaml.tailcall]) g gas k (f accu) stack + | KView_exit (scs, k) -> + (next [@ocaml.tailcall]) (fst g, scs) gas k accu stack + | KLog _ as k -> + (* This case should never happen. *) + (next [@ocaml.tailcall]) g gas k accu stack + | KNil as k -> (next [@ocaml.tailcall]) g gas k accu stack + [@@inline] +end + +let make (module Base : Logger_base) = + let module Logger = Logger (Base) in + let open Logger in + let open Base in + {log_interp; get_log; log_kinstr; klog; ilog} diff --git a/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.mli b/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.mli new file mode 100644 index 000000000000..0492bab3c312 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/script_interpreter_logging.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Environment +open Error_monad +open Script_typed_ir + +module type Logger_base = sig + val log_interp : ('a, 's, 'b, 'f, 'c, 'u) logging_function + + val log_entry : ('a, 's, 'b, 'f, 'a, 's) logging_function + + val log_control : ('a, 's, 'b, 'f) continuation -> unit + + val log_exit : ('a, 's, 'b, 'f, 'c, 'u) logging_function + + val get_log : unit -> execution_trace option tzresult Lwt.t +end + +val make : (module Logger_base) -> logger diff --git a/src/proto_016_PtMumbai/lib_plugin/test/dune b/src/proto_016_PtMumbai/lib_plugin/test/dune new file mode 100644 index 000000000000..8217d9534bc0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/dune @@ -0,0 +1,44 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executables + (names test_consensus_filter test_filter_state test_plugin) + (libraries + tezos-base + tezos-base-test-helpers + tezos-base.unix + alcotest-lwt + tezos-test-helpers + qcheck-alcotest + tezos-stdlib-unix + tezos-micheline + tezos-protocol-plugin-alpha + tezos-protocol-alpha + tezos-protocol-alpha.parameters + tezos-alpha-test-helpers) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base_test_helpers + -open Tezos_micheline + -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_alpha + -open Tezos_protocol_alpha.Protocol + -open Tezos_protocol_alpha_parameters + -open Tezos_alpha_test_helpers)) + +(rule + (alias runtest) + (package tezos-protocol-plugin-alpha-tests) + (action (run %{dep:./test_consensus_filter.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-plugin-alpha-tests) + (action (run %{dep:./test_filter_state.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-plugin-alpha-tests) + (action (run %{dep:./test_plugin.exe}))) diff --git a/src/proto_016_PtMumbai/lib_plugin/test/generators.ml b/src/proto_016_PtMumbai/lib_plugin/test/generators.ml new file mode 100644 index 000000000000..7cf916779239 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/generators.ml @@ -0,0 +1,150 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Mempool = Plugin.Mempool + +let string_gen = QCheck2.Gen.small_string ?gen:None + +let public_key_hash_gen : + (Tezos_crypto.Signature.public_key_hash + * Tezos_crypto.Signature.public_key + * Tezos_crypto.Signature.secret_key) + QCheck2.Gen.t = + let open QCheck2.Gen in + let+ seed = string_size (32 -- 64) in + let seed = Bytes.of_string seed in + Tezos_crypto.Signature.generate_key ~seed () + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2407 + move this function to an helper file? *) +let operation_hash_gen : Tezos_crypto.Operation_hash.t QCheck2.Gen.t = + let open QCheck2.Gen in + let+ s = QCheck2.Gen.string_size (return 32) in + Tezos_crypto.Operation_hash.of_string_exn s + +let dummy_manager_op_info = + let fee = Alpha_context.Tez.zero in + let gas_limit = Alpha_context.Gas.Arith.zero in + let manager_op = + let open Alpha_context in + let source = Tezos_crypto.Signature.Public_key_hash.zero in + let counter = Manager_counter.Internal_for_tests.of_int 0 in + let storage_limit = Z.zero in + let operation = Set_deposits_limit None in + let contents = + Manager_operation + {source; fee; counter; operation; gas_limit; storage_limit} + in + let contents = Single contents in + let protocol_data = + {contents; signature = Some Tezos_crypto.Signature.zero} + in + let branch = Tezos_crypto.Block_hash.zero in + Mempool.Manager_op {shell = {branch}; protocol_data} + in + Mempool.{manager_op; fee; gas_limit; weight = Q.zero} + +let oph_and_info_gen = + let open QCheck2.Gen in + let+ oph = operation_hash_gen in + (oph, dummy_manager_op_info) + +let filter_state_gen : Plugin.Mempool.state QCheck2.Gen.t = + let open QCheck2.Gen in + let open Plugin.Mempool in + let+ ops = small_list oph_and_info_gen in + List.fold_left + (fun state (oph, info) -> + if Tezos_crypto.Operation_hash.Map.mem oph state.prechecked_manager_ops + then state + else + let prechecked_manager_op_count = + state.prechecked_manager_op_count + 1 + in + let op_weight = mk_op_weight oph info in + let min_prechecked_op_weight = + match state.min_prechecked_op_weight with + | Some old_min + when Mempool.compare_manager_op_weight old_min op_weight <= 0 -> + Some old_min + | Some _ | None -> Some op_weight + in + { + state with + prechecked_manager_op_count; + prechecked_manager_ops = + Tezos_crypto.Operation_hash.Map.add + oph + info + state.prechecked_manager_ops; + prechecked_op_weights = + ManagerOpWeightSet.add op_weight state.prechecked_op_weights; + min_prechecked_op_weight; + }) + Plugin.Mempool.empty + ops + +(** Generate a pair of operation hash and manager_op_info, that has + even odds of belonging to the given filter_state or being fresh. *) +let with_filter_state_operation_gen : + Plugin.Mempool.state -> + (Tezos_crypto.Operation_hash.t * Plugin.Mempool.manager_op_info) + QCheck2.Gen.t = + fun state -> + let open QCheck2.Gen in + let* use_fresh = bool in + if + use_fresh + || Tezos_crypto.Operation_hash.Map.is_empty state.prechecked_manager_ops + then oph_and_info_gen + else + oneofl + (Tezos_crypto.Operation_hash.Map.bindings state.prechecked_manager_ops) + +(** Generate both a filter_state, and a pair of operation hash and + manager_op_info. The pair has even odds of belonging to the + filter_state or being fresh. *) +let filter_state_with_operation_gen : + (Plugin.Mempool.state + * (Tezos_crypto.Operation_hash.t * Plugin.Mempool.manager_op_info)) + QCheck2.Gen.t = + let open QCheck2.Gen in + filter_state_gen >>= fun state -> + pair (return state) (with_filter_state_operation_gen state) + +(** Generate a filter_state, and two pairs of operation hash and + manager_op_info. The pairs have indepedent, even odds of belonging + to the filter_state or being fresh. *) +let filter_state_with_two_operations_gen : + (Plugin.Mempool.state + * (Tezos_crypto.Operation_hash.t * Plugin.Mempool.manager_op_info) + * (Tezos_crypto.Operation_hash.t * Plugin.Mempool.manager_op_info)) + QCheck2.Gen.t = + let open QCheck2.Gen in + let* filter_state = filter_state_gen in + triple + (return filter_state) + (with_filter_state_operation_gen filter_state) + (with_filter_state_operation_gen filter_state) diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml new file mode 100644 index 000000000000..746ca41ac6fc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml @@ -0,0 +1,448 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Lib_test.Qcheck2_helpers +open Plugin.Mempool +open Alpha_context +open Test_utils + +(** {2. Conversion helpers} *) + +let timestamp_of_int32 ts = Timestamp.of_seconds (Int64.of_int32 ts) + +(** Data Generators *) +module Generator = struct + open QCheck2.Gen + + let decorate ?(prefix = "") ?(suffix = "") printer d = + prefix ^ printer d ^ suffix + + let config = + let+ x = opt small_nat in + config x + + let print_config = + decorate ~prefix:"clock_drift " (fun config -> + Option.fold + ~none:"round_0 duration" + ~some:(fun drift -> Int64.to_string @@ Period.to_seconds drift) + config.clock_drift) + + let of_result = Result.value_f ~default:(fun _ -> assert false) + + let small_nat_32 = + let+ small_nat = small_nat in + Int32.of_int small_nat + + let small_signed_32 = + let+ small_signed_int = small_signed_int in + Int32.of_int small_signed_int + + let dup gen = + let+ x = gen in + (x, x) + + let round = + let+ x = map (fun i32 -> Round.of_int32 i32) small_nat_32 in + of_result x + + let print_round = Format.asprintf "%a" Round.pp + + let same_rounds = dup round + + let level = + let+ x = map Raw_level.of_int32 small_nat_32 in + of_result x + + let print_level = Format.asprintf "%a" Raw_level.pp + + let same_levels = dup level + + let timestamp = + let+ i32 = int32 in + timestamp_of_int32 i32 + + let print_timestamp = Timestamp.to_notation + + let near_timestamps = + let+ i, diff = pair int32 small_signed_32 in + timestamp_of_int32 i |> fun ts1 -> + timestamp_of_int32 Int32.(add i diff) |> fun ts2 -> (ts1, ts2) + + let successive_timestamp = + let+ ts, (diff : int) = pair timestamp small_nat in + let x = + Period.of_seconds (Int64.of_int diff) >>? fun diff -> + Timestamp.(ts +? diff) >>? fun ts2 -> Ok (ts, ts2) + in + of_result x + + let param_acceptable ?(rounds = pair round round) ?(levels = pair level level) + ?(timestamps = near_timestamps) () = + pair config (pair (pair rounds levels) timestamps) + + let print_param_acceptable = + let open QCheck2.Print in + let print_levels = pair print_level print_level in + let print_timestamps = pair print_timestamp print_timestamp in + let print_rounds = pair print_round print_round in + pair print_config (pair (pair print_rounds print_levels) print_timestamps) +end + +let assert_no_error d = match d with Error _ -> assert false | Ok d -> d + +(** Constants : + This could be generated but it would largely increase the search space. *) +let round_durations : Round.round_durations = + assert_no_error + @@ Round.Durations.create + ~first_round_duration:Period.(of_seconds_exn 4L) + ~delay_increment_per_round:Period.(of_seconds_exn 10L) + +let round_zero_duration = Round.round_duration round_durations Round.zero + +(** Don't allow test to fail *) +let no_error = function + | Ok b -> b + | Error errs -> + Format.printf + "test fail due to error : %a@." + Error_monad.pp_print_trace + (Environment.wrap_tztrace errs) ; + false + +(** Helper to compute *) +let durations round_durations start stop = + List.map_e + (fun round -> + Round.of_int round >|? fun round -> + Round.round_duration round_durations round |> Period.to_seconds) + Tezos_stdlib.Utils.Infix.(start -- stop) + +(** Expected timestamp for the begining of a round at same level that + the proposal. + + It has been developped before the Round.timestamp_of_round_same_level and has a + different implementation. + +*) +let timestamp_of_round round_durations ~proposal_timestamp ~proposal_round + ~round = + (let iproposal_round = Int32.to_int @@ Round.to_int32 proposal_round in + let iround = Int32.to_int @@ Round.to_int32 round in + if Round.(proposal_round = round) then ok (Period.zero, proposal_timestamp) + else if Round.(proposal_round < round) then + durations round_durations iproposal_round (iround - 1) >>? fun durations -> + Period.of_seconds @@ List.fold_left Int64.add Int64.zero durations + >>? fun rounds_duration -> + Timestamp.(proposal_timestamp +? rounds_duration) >|? fun ts -> + (rounds_duration, ts) + else + durations round_durations iround (iproposal_round - 1) >>? fun durations -> + List.fold_left Int64.add Int64.zero durations |> fun rounds_duration -> + Timestamp.of_seconds + @@ Int64.sub (Timestamp.to_seconds proposal_timestamp) rounds_duration + |> fun ts -> + Period.of_seconds rounds_duration >|? fun rounds_duration -> + (rounds_duration, ts)) + >>? fun (_rnd_dur, exp_ts) -> ok exp_ts + +let drift_of = + let r0_dur = Round.round_duration round_durations Round.zero in + fun clock_drift -> Option.value ~default:r0_dur clock_drift + +(** [max_ts] computes the upper bound on future timestamps given the + accepted round drift. +*) +let max_ts clock_drift prop_ts now = + Timestamp.(max prop_ts now +? drift_of clock_drift) + +let predecessor_start proposal_timestamp proposal_round grandparent_round = + assert_no_error + @@ ( Round.level_offset_of_round + round_durations + ~round:Round.(succ grandparent_round) + >>? fun proposal_level_offset -> + Round.level_offset_of_round round_durations ~round:proposal_round + >>? fun proposal_round_offset -> + Period.(add proposal_level_offset proposal_round_offset) + >>? fun proposal_offset -> + Ok Timestamp.(proposal_timestamp - proposal_offset) ) + +(** {2. Tests} *) + +(** Test past operations that are accepted whatever the current timestamp is: + strictly before the predecessor level or at the current level and with a + strictly lower round than the head. *) + +let test_acceptable_past_level = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"acceptable past op " + (Generator.param_acceptable ()) + (fun + ( config, + ( ((proposal_round, op_round), (proposal_level, op_level)), + (proposal_timestamp, now_timestamp) ) ) + -> + Raw_level.( + proposal_level > succ op_level + || (proposal_level = op_level && Round.(proposal_round > op_round))) + ==> no_error + @@ acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start + proposal_timestamp + proposal_round + Round.zero) + ~op_level + ~op_round + ~now_timestamp) + +(** Test acceptable operations at current level, current round, i.e. on the + currently considered proposal *) +let test_acceptable_current_level_current_round = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"same round, same level " + Generator.(param_acceptable ~rounds:same_rounds ~levels:same_levels ()) + (fun ( config, + (((op_round, _), (_, op_level)), (proposal_timestamp, now_timestamp)) + ) -> + let proposal_level = op_level in + let proposal_round = op_round in + no_error + @@ acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start proposal_timestamp proposal_round Round.zero) + ~op_level + ~op_round + ~now_timestamp) + +(** Test operations at same level, different round, with an acceptable expected + timestamp for the operation. *) +let test_acceptable_current_level = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"same level, different round, acceptable op" + Generator.(param_acceptable ~levels:same_levels ()) + (fun ( config, + ( ((proposal_round, op_round), (_, op_level)), + (proposal_timestamp, now_timestamp) ) ) -> + let proposal_level = op_level in + no_error + ( timestamp_of_round + round_durations + ~proposal_timestamp + ~proposal_round + ~round:op_round + >>? fun expected_time -> + max_ts config.clock_drift proposal_timestamp now_timestamp + >>? fun max_timestamp -> ok Timestamp.(expected_time <= max_timestamp) + ) + ==> no_error + @@ acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start + proposal_timestamp + proposal_round + Round.zero) + ~op_level + ~op_round + ~now_timestamp) + +(** Test operations at same level, different round, with a too high expected + timestamp for the operation, and not at current round (which is always accepted). *) +let test_not_acceptable_current_level = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"same level, different round, too far" + Generator.(param_acceptable ~levels:same_levels ()) + (fun ( config, + ( ((proposal_round, op_round), (_, op_level)), + (proposal_timestamp, now_timestamp) ) ) -> + let proposal_level = op_level in + no_error + ( timestamp_of_round + round_durations + ~proposal_timestamp + ~proposal_round + ~round:op_round + >>? fun expected_time -> + max_ts config.clock_drift proposal_timestamp now_timestamp + >>? fun max_timestamp -> + ok + Timestamp.( + expected_time > max_timestamp + && Round.(proposal_round <> op_round)) ) + ==> no_error + (acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start + proposal_timestamp + proposal_round + Round.zero) + ~op_level + ~op_round + ~now_timestamp + >|? not)) + +(** Test operations at next level, different round, with an acceptable timestamp for + the operation. *) +let test_acceptable_next_level = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"next level, acceptable op" + Generator.(param_acceptable ~levels:same_levels ()) + (fun ( config, + ( ((proposal_round, op_round), (proposal_level, _)), + (proposal_timestamp, now_timestamp) ) ) -> + let op_level = Raw_level.succ proposal_level in + no_error + ( timestamp_of_round + round_durations + ~proposal_timestamp + ~proposal_round + ~round:Round.zero + >>? fun current_level_start -> + Round.timestamp_of_round + round_durations + ~predecessor_timestamp:current_level_start + ~predecessor_round:Round.zero + ~round:op_round + >>? fun expected_time -> + max_ts config.clock_drift proposal_timestamp now_timestamp + >>? fun max_timestamp -> ok Timestamp.(expected_time <= max_timestamp) + ) + ==> no_error + @@ acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start + proposal_timestamp + proposal_round + Round.zero) + ~op_level + ~op_round + ~now_timestamp) + +(** Test operations at next level, different round, with a too high timestamp + for the operation. *) +let test_not_acceptable_next_level = + let open QCheck2 in + Test.make + ~print:Generator.print_param_acceptable + ~name:"next level, too far" + Generator.( + param_acceptable ~levels:same_levels ~timestamps:successive_timestamp ()) + (fun ( config, + ( ((proposal_round, op_round), (proposal_level, _)), + (proposal_timestamp, now_timestamp) ) ) -> + let op_level = Raw_level.succ proposal_level in + QCheck2.assume + @@ no_error + ( timestamp_of_round + round_durations + ~proposal_timestamp + ~proposal_round + ~round:Round.zero + >>? fun current_level_start -> + Round.timestamp_of_round + round_durations + ~predecessor_timestamp:current_level_start + ~predecessor_round:Round.zero + ~round:op_round + >>? fun expected_time -> + Timestamp.( + proposal_timestamp + +? Round.round_duration round_durations proposal_round) + >>? fun next_level_ts -> + max_ts config.clock_drift next_level_ts now_timestamp + >>? fun max_timestamp -> + ok Timestamp.(expected_time > max_timestamp) ) ; + no_error + @@ (acceptable_op + ~config + ~round_durations + ~round_zero_duration + ~proposal_level + ~proposal_round + ~proposal_timestamp + ~proposal_predecessor_level_start: + (predecessor_start proposal_timestamp proposal_round Round.zero) + ~op_level + ~op_round + ~now_timestamp + >|? not)) + +let () = + Alcotest.run + "Filter" + [ + ( "pre_filter", + qcheck_wrap + [ + test_acceptable_past_level; + test_acceptable_current_level_current_round; + test_acceptable_current_level; + test_not_acceptable_current_level; + test_acceptable_next_level; + test_not_acceptable_next_level; + ] ); + ] diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml new file mode 100644 index 000000000000..7f112195af83 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml @@ -0,0 +1,199 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Shell (Plugin) + Invocation: dune exec src/proto_alpha/lib_plugin/test/test_filter_state.exe + Subject: Unit tests the filter state functions of the plugin +*) + +open Lib_test.Qcheck2_helpers +open Plugin.Mempool +open Test_utils + +let count = 1000 + +let check_filter_state_invariants filter_state = + qcheck_cond + ~pp:(fun fmt filter_state -> + Format.fprintf + fmt + "The following filter_state breaks invariants:@.%a" + pp_state + filter_state) + ~cond:(fun filter_state -> + filter_state.prechecked_manager_op_count + = Tezos_crypto.Operation_hash.Map.cardinal + filter_state.prechecked_manager_ops + && filter_state.prechecked_manager_op_count + = ManagerOpWeightSet.cardinal filter_state.prechecked_op_weights + && ManagerOpWeightSet.for_all + (fun {operation_hash; weight} -> + match + Tezos_crypto.Operation_hash.Map.find + operation_hash + filter_state.prechecked_manager_ops + with + | None -> false + | Some info -> Q.equal weight info.weight) + filter_state.prechecked_op_weights + && eq_op_weight_opt + (ManagerOpWeightSet.min_elt filter_state.prechecked_op_weights) + filter_state.min_prechecked_op_weight) + filter_state + () + +(** Test that [add_manager_op] adds the given operation to the filter + state, and removes the replaced operation if applicable. *) +let test_add_manager_op = + let open QCheck2 in + Test.make + ~count + ~name:"Add a manager operation" + (Gen.pair Generators.filter_state_with_two_operations_gen Gen.bool) + (fun ((filter_state, (oph, op_info), (oph_to_replace, _)), should_replace) + -> + (* Both [oph] and [oph_to_replace] have even odds of being + already present in [filter_state] or fresh. *) + let replacement = + if should_replace then ( + assume (not (Tezos_crypto.Operation_hash.equal oph_to_replace oph)) ; + `Replace (oph_to_replace, ())) + else `No_replace + in + let filter_state = add_manager_op filter_state oph op_info replacement in + check_filter_state_invariants filter_state + && qcheck_cond + ~pp:(fun fmt set -> + Format.fprintf + fmt + "%a was not found in prechecked_manager_ops: %a" + Tezos_crypto.Operation_hash.pp + oph + pp_prechecked_manager_ops + set) + ~cond:(Tezos_crypto.Operation_hash.Map.mem oph) + filter_state.prechecked_manager_ops + () + && + if should_replace then + qcheck_cond + ~pp:(fun fmt () -> + Format.fprintf + fmt + "%a should have been removed from prechecked_manager_ops." + Tezos_crypto.Operation_hash.pp + oph_to_replace) + ~cond:(fun () -> + not + (Tezos_crypto.Operation_hash.Map.mem + oph_to_replace + filter_state.prechecked_manager_ops)) + () + () + else true) + +(** Test that [remove] removes the operation from the filter state if + it was present, and that adding then removing is the same as doing + nothing but removing the replaced operation if there is one. *) +let test_remove_present = + let open QCheck2 in + Test.make + ~count + ~name:"Remove an existing operation hash" + (Gen.triple + Generators.filter_state_with_operation_gen + Generators.oph_and_info_gen + Gen.bool) + (fun ((initial_state, (oph_to_replace, _)), (oph, op_info), should_replace) + -> + (* Add a fresh operation [oph] to the state. *) + assume + (not + (Tezos_crypto.Operation_hash.Map.mem + oph + initial_state.prechecked_manager_ops)) ; + let replacement = + if should_replace then `Replace (oph_to_replace, ()) else `No_replace + in + let filter_state = add_manager_op initial_state oph op_info replacement in + (* Remove [oph] from the state, in which it was present. *) + let filter_state = remove ~filter_state oph in + let (_ : bool) = + (* Check that the state invariants are preserved and that + [oph] has been removed. *) + check_filter_state_invariants filter_state + && qcheck_cond + ~pp:(fun fmt () -> + Format.fprintf + fmt + "%a should have been removed from prechecked_manager_ops." + Tezos_crypto.Operation_hash.pp + oph) + ~cond:(fun () -> + not + (Tezos_crypto.Operation_hash.Map.mem + oph + filter_state.prechecked_manager_ops)) + () + () + in + (* Check that adding a fresh operation then removing it is the + same as doing nothing except removing any replaced operation. *) + let initial_state_without_replaced_op = + if should_replace then remove ~filter_state:initial_state oph_to_replace + else initial_state + in + qcheck_eq + ~pp:pp_state + ~eq:eq_state + initial_state_without_replaced_op + filter_state) + +(** Test that [remove] leaves the filter state intact if the operation + hash is unknown. *) +let test_remove_unknown = + let open QCheck2 in + Test.make + ~count + ~name:"Remove an unknown operation hash" + (Gen.pair Generators.filter_state_gen Generators.operation_hash_gen) + (fun (initial_state, oph) -> + assume + (not + (Tezos_crypto.Operation_hash.Map.mem + oph + initial_state.prechecked_manager_ops)) ; + let filter_state = remove ~filter_state:initial_state oph in + qcheck_eq ~pp:pp_state ~eq:eq_state initial_state filter_state) + +let () = + Alcotest.run + "Filter_state" + [ + ("add_manager_op", qcheck_wrap [test_add_manager_op]); + ("remove", qcheck_wrap [test_remove_present; test_remove_unknown]); + ] diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml new file mode 100644 index 000000000000..9a2251f2ecfa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml @@ -0,0 +1,95 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Shell (Plugin) + Invocation: dune exec src/proto_alpha/lib_plugin/test/test_plugin.exe + Subject: Unit tests the plugin +*) + +open Plugin.Mempool +open Test_utils + +let count = Some 1000 + +(** This test checks that the filter state is cleared (prechecked related + values are reseted) [on_flush] whether a [validation_state] is given or not + *) +let test_flush () = + let l = + QCheck2.Gen.generate + ~n:(Option.value ~default:1 count) + (QCheck2.Gen.pair + Generators.filter_state_with_operation_gen + QCheck2.Gen.bool) + in + List.iter_es + (fun ( (filter_state, (oph, (op_info : manager_op_info))), + with_validation_state ) -> + let filter_state = add_manager_op filter_state oph op_info `No_replace in + Context.init1 () >>= function + | Error e -> + failwith "Error at context initialisation: %a" pp_print_trace e + | Ok (b, _contract) -> ( + let predecessor = + Block_header. + {shell = b.header.shell; protocol_data = Bytes.make 10 ' '} + in + (if with_validation_state then + Incremental.begin_construction b >>= function + | Error e -> + failwith + "Error at begin_construction of the incremental state: %a" + pp_print_trace + e + | Ok inc -> return_some (Incremental.validation_state inc) + else return_none) + >>=? fun validation_state -> + on_flush default_config ?validation_state filter_state ~predecessor () + >>= function + | Error e -> failwith "Error during on_flush: %a" pp_print_trace e + | Ok flushed_state -> + if eq_state flushed_state empty then return_unit + else + failwith + "Flushed state is not empty : %a" + pp_state + flushed_state)) + l + +let () = + Alcotest_lwt.run + "Plugin" + [ + ( "on_flush", + [ + Tztest.tztest + "[on_flush ~validation_state ...] yields an empty state " + `Quick + test_flush; + ] ); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_utils.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_utils.ml new file mode 100644 index 000000000000..0b92f1f4ca4c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_utils.ml @@ -0,0 +1,118 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Plugin.Mempool +open Alpha_context + +let config drift_opt = + { + default_config with + clock_drift = + Option.map + (fun drift -> Period.of_seconds_exn (Int64.of_int drift)) + drift_opt; + replace_by_fee_factor = Q.make (Z.of_int 105) (Z.of_int 100); + } + +let pp_prechecked_manager_ops fmt set = + Format.fprintf + fmt + "[%a]" + (Format.pp_print_list (fun ppf (oph, (op_info : manager_op_info)) -> + Format.fprintf + ppf + "(%a -> {fee: %a; gas: %a; weight: %a})" + Tezos_crypto.Operation_hash.pp + oph + Alpha_context.Tez.pp + op_info.fee + Alpha_context.Gas.Arith.pp + op_info.gas_limit + Q.pp_print + op_info.weight)) + (Tezos_crypto.Operation_hash.Map.bindings set) + +let pp_manager_op_weight fmt weight = + Format.fprintf + fmt + "{oph: %a; weight: %a}" + Tezos_crypto.Operation_hash.pp + weight.operation_hash + Q.pp_print + weight.weight + +let pp_prechecked_op_weights fmt set = + Format.fprintf + fmt + "[%a]" + (Format.pp_print_list (fun ppf manager_op_weight -> + pp_manager_op_weight ppf manager_op_weight)) + (ManagerOpWeightSet.elements set) + +let pp_op_weight_opt fmt = function + | None -> Format.fprintf fmt "None" + | Some op_weight -> + Format.fprintf fmt "Some %a" pp_manager_op_weight op_weight + +let pp_state fmt state = + Format.fprintf + fmt + "@[<v 0>state:@,\ + {@,\ + prechecked_manager_op_count: %d@,\ + prechecked_manager_ops: %a;@,\ + prechecked_op_weights: %a;@,\ + min_prechecked_op_weight: %a@,\ + }@]" + state.prechecked_manager_op_count + pp_prechecked_manager_ops + state.prechecked_manager_ops + pp_prechecked_op_weights + state.prechecked_op_weights + pp_op_weight_opt + state.min_prechecked_op_weight + +let eq_prechecked_manager_ops = + Tezos_crypto.Operation_hash.Map.equal + (fun + {manager_op = _; fee = fee1; gas_limit = gas1; weight = w1} + {manager_op = _; fee = fee2; gas_limit = gas2; weight = w2} + -> Tez.equal fee1 fee2 && Gas.Arith.equal gas1 gas2 && Q.equal w1 w2) + +let eq_op_weight_opt = + Option.equal (fun op_weight1 op_weight2 -> + Tezos_crypto.Operation_hash.equal + op_weight1.operation_hash + op_weight2.operation_hash + && Q.equal op_weight1.weight op_weight2.weight) + +(* This function needs to be updated if the filter state is extended *) +let eq_state s1 s2 = + s1.prechecked_manager_op_count = s2.prechecked_manager_op_count + && eq_prechecked_manager_ops + s1.prechecked_manager_ops + s2.prechecked_manager_ops + && ManagerOpWeightSet.equal s1.prechecked_op_weights s2.prechecked_op_weights + && eq_op_weight_opt s1.min_prechecked_op_weight s2.min_prechecked_op_weight diff --git a/src/proto_016_PtMumbai/lib_plugin/view_helpers.ml b/src/proto_016_PtMumbai/lib_plugin/view_helpers.ml new file mode 100644 index 000000000000..29074e758af2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_plugin/view_helpers.ml @@ -0,0 +1,293 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Tezos_micheline + +type Environment.Error_monad.error += Viewed_contract_has_no_script + +type Environment.Error_monad.error += View_callback_origination_failed + +type Environment.Error_monad.error += + | Illformed_view_type of Entrypoint.t * Script.expr + +type Environment.Error_monad.error += + | View_never_returns of Entrypoint.t * Contract_hash.t + +type Environment.Error_monad.error += + | View_unexpected_return of Entrypoint.t * Contract_hash.t + +type Environment.Error_monad.error += View_not_found of Contract_hash.t * string + +type Environment.Error_monad.error += Viewer_unexpected_storage + +let () = + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewedContractHasNoScript" + ~title:"Viewed contract has no script" + ~description:"A view was called on a contract with no script." + ~pp:(fun ppf () -> + Format.fprintf ppf "A view was called on a contract with no script.") + Data_encoding.(unit) + (function Viewed_contract_has_no_script -> Some () | _ -> None) + (fun () -> Viewed_contract_has_no_script) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewCallbackOriginationFailed" + ~title:"View callback origination failed" + ~description:"View callback origination failed" + ~pp:(fun ppf () -> + Format.fprintf ppf "Error during origination of view callback contract.") + Data_encoding.(unit) + (function View_callback_origination_failed -> Some () | _ -> None) + (fun () -> View_callback_origination_failed) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"illformedViewType" + ~title:"An entrypoint type is incompatible with TZIP-4 view type." + ~description:"An entrypoint type is incompatible with TZIP-4 view type." + ~pp:(fun ppf (entrypoint, typ) -> + Format.fprintf + ppf + "The view %a has type %a, it is not compatible with a TZIP-4 view type." + Entrypoint.pp + entrypoint + Micheline_printer.print_expr + (Micheline_printer.printable + (fun x -> x) + (Michelson_v1_primitives.strings_of_prims typ))) + Data_encoding.( + obj2 + (req "entrypoint" Entrypoint.simple_encoding) + (req "type" Script.expr_encoding)) + (function Illformed_view_type (etp, exp) -> Some (etp, exp) | _ -> None) + (fun (etp, exp) -> Illformed_view_type (etp, exp)) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewNeverReturns" + ~title:"A view never returned a transaction to the given callback contract" + ~description: + "A view never initiated a transaction to the given callback contract." + ~pp:(fun ppf (entrypoint, callback) -> + Format.fprintf + ppf + "The view %a never initiated a transaction to the given callback \ + contract %a." + Entrypoint.pp + entrypoint + Contract_hash.pp + callback) + Data_encoding.( + obj2 + (req "entrypoint" Entrypoint.simple_encoding) + (req "callback" Contract.originated_encoding)) + (function View_never_returns (e, c) -> Some (e, c) | _ -> None) + (fun (e, c) -> View_never_returns (e, c)) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewUnexpectedReturn" + ~title:"A view returned an unexpected list of operations" + ~description: + "A view initiated a list of operations while the TZIP-4 standard expects \ + only a transaction to the given callback contract." + ~pp:(fun ppf (entrypoint, callback) -> + Format.fprintf + ppf + "The view %a initiated a list of operations while the TZIP-4 standard \ + expects only a transaction to the given callback contract %a." + Entrypoint.pp + entrypoint + Contract_hash.pp + callback) + Data_encoding.( + obj2 + (req "entrypoint" Entrypoint.simple_encoding) + (req "callback" Contract.originated_encoding)) + (function View_unexpected_return (e, c) -> Some (e, c) | _ -> None) + (fun (e, c) -> View_unexpected_return (e, c)) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewNotFound" + ~title:"A view could not be found" + ~description:"The contract does not have a view of the given name." + ~pp:(fun ppf (contract, name) -> + Format.fprintf + ppf + "The contract %a does not have a view named `%s`." + Contract_hash.pp + contract + name) + Data_encoding.( + obj2 (req "contract" Contract.originated_encoding) (req "view" string)) + (function View_not_found (k, n) -> Some (k, n) | _ -> None) + (fun (k, n) -> View_not_found (k, n)) ; + Environment.Error_monad.register_error_kind + `Permanent + ~id:"viewerUnexpectedStorage" + ~title:"A VIEW instruction returned an unexpected value" + ~description:"A VIEW instruction returned an unexpected value." + ~pp:(fun ppf () -> + Format.fprintf ppf "The simulated view returned an unexpected value.") + Data_encoding.unit + (function Viewer_unexpected_storage -> Some () | _ -> None) + (fun () -> Viewer_unexpected_storage) + +(* This script is actually never run, its usage is to ensure a + contract that has the type `contract <ty>` is originated, which + will be required as callback of the view. *) +let make_tzip4_viewer_script ty : Script.t = + let loc = 0 in + let ty = Micheline.root ty in + let code = + Micheline.strip_locations + @@ Micheline.Seq + ( loc, + [ + Micheline.Prim (loc, Script.K_parameter, [ty], []); + Micheline.Prim + ( loc, + Script.K_storage, + [Micheline.Prim (loc, Script.T_unit, [], [])], + [] ); + Micheline.Prim + ( loc, + Script.K_code, + [Micheline.Prim (loc, Script.I_FAILWITH, [], [])], + [] ); + ] ) + in + let storage = + Micheline.strip_locations (Micheline.Prim (loc, Script.D_Unit, [], [])) + in + {code = Script.lazy_expr code; storage = Script.lazy_expr storage} + +let make_view_parameter input callback = + let loc = 0 in + Micheline.strip_locations + (Micheline.Prim + ( loc, + Script.D_Pair, + [ + input; + Micheline.Bytes + (loc, Data_encoding.Binary.to_bytes_exn Contract.encoding callback); + ], + [] )) + +let extract_view_output_type entrypoint ty = + match Micheline.root ty with + | Micheline.Prim + (_, Script.T_pair, [_; Micheline.Prim (_, Script.T_contract, [ty], _)], _) + -> + ok (Micheline.strip_locations ty) + | _ -> Environment.Error_monad.error (Illformed_view_type (entrypoint, ty)) + +(* 'view' entrypoints returns their value by calling a callback contract, thus + the expected result is a unique internal transaction to this callback. *) +let extract_parameter_from_operations entrypoint operations callback = + let unexpected_return = + Environment.Error_monad.error + @@ View_unexpected_return (entrypoint, callback) + in + match operations with + | [ + Script_typed_ir.Internal_operation + { + operation = + Transaction_to_smart_contract + { + destination; + unparsed_parameters; + entrypoint = _; + amount = _; + parameters = _; + parameters_ty = _; + location = _; + }; + source = _; + nonce = _; + }; + ] + when Contract_hash.equal destination callback -> + ok unparsed_parameters + | [] -> + Environment.Error_monad.error (View_never_returns (entrypoint, callback)) + | _ -> unexpected_return + +(* [make_michelson_viewer_script contract view input input_ty output_ty] + generates a script that calls a view from a given contract, and stores the + result in its storage. *) +let make_michelson_viewer_script address view input input_ty output_ty : + Script.t = + let loc = 0 in + let address = Micheline.String (loc, Contract.to_b58check address) in + let push ty value = Micheline.Prim (loc, Script.I_PUSH, [ty; value], []) in + let storage_decl = Micheline.Prim (loc, Script.T_option, [output_ty], []) in + let body = + Micheline.Seq + ( loc, + [ + Micheline.Prim (loc, Script.I_DROP, [], []); + push (Micheline.Prim (loc, Script.T_address, [], [])) address; + push input_ty (Micheline.root input); + Micheline.Prim + (loc, Script.I_VIEW, [Micheline.String (loc, view); output_ty], []); + Micheline.Prim + ( loc, + Script.I_NIL, + [Micheline.Prim (loc, Script.T_operation, [], [])], + [] ); + Micheline.Prim (loc, Script.I_PAIR, [], []); + ] ) + in + let code = + Micheline.strip_locations + @@ Micheline.Seq + ( loc, + [ + Micheline.Prim + ( loc, + Script.K_parameter, + [Micheline.Prim (loc, Script.T_unit, [], [])], + [] ); + Micheline.Prim (loc, Script.K_storage, [storage_decl], []); + Micheline.Prim (loc, Script.K_code, [body], []); + ] ) + in + let storage = + Micheline.strip_locations (Micheline.Prim (loc, Script.D_None, [], [])) + in + {code = Script.lazy_expr code; storage = Script.lazy_expr storage} + +(* Extracts the value from the mock script generated by + [make_michelson_viewer_script]. *) +let extract_value_from_storage (storage : Script.expr) = + match Micheline.root storage with + | Micheline.Prim (_, Script.D_Some, [value], []) -> ok value + | _ -> Environment.Error_monad.error @@ Viewer_unexpected_storage diff --git a/src/proto_016_PtMumbai/lib_protocol/TEZOS_PROTOCOL b/src/proto_016_PtMumbai/lib_protocol/TEZOS_PROTOCOL new file mode 100644 index 000000000000..24e0390a2014 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/TEZOS_PROTOCOL @@ -0,0 +1,273 @@ +{ + "expected_env_version": 8, + "hash": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "modules": [ + "Misc", + "Non_empty_string", + "Path_encoding", + "Storage_description", + "State_hash", + "Nonce_hash", + "Script_expr_hash", + "Origination_nonce", + "Contract_hash", + "Blinded_public_key_hash", + "Block_payload_hash", + "Tx_rollup_prefixes", + "Sc_rollup_reveal_hash", + "Merkle_list", + "Bitset", + "Bounded_history_repr", + "Skip_list_repr", + "Context_binary_proof", + + + "Michelson_v1_primitives", + "Slot_repr", + "Tez_repr", + "Period_repr", + "Time_repr", + "Ratio_repr", + "Round_repr", + "Block_payload_repr", + "Fixed_point_repr", + "Saturation_repr", + "Gas_limit_repr", + "Constants_parametric_repr", + "Constants_parametric_previous_repr", + "Constants_repr", + "Raw_level_repr", + "Fitness_repr", + "Cycle_repr", + "Level_repr", + "Script_repr", + "Cache_memory_helpers", + "Seed_repr", + "Sampler", + "Voting_period_repr", + "Ticket_hash_repr", + "Manager_counter_repr", + "Contract_repr", + "Indexable", + "Entrypoint_repr", + + "Dal_slot_repr", + "Dal_attestation_repr", + + "Sc_rollup_repr", + "Sc_rollup_metadata_repr", + "Sc_rollup_tick_repr", + "Sc_rollup_inbox_message_repr", + "Sc_rollup_inbox_merkelized_payload_hashes_repr", + "Sc_rollup_outbox_message_repr", + "Sc_rollup_dissection_chunk_repr", + "Sc_rollup_PVM_sig", + "Sc_rollup_arith", + "Sc_rollup_wasm", + "Sc_rollups", + "Sc_rollup_data_version_sig", + "Sc_rollup_inbox_repr", + "Sc_rollup_commitment_repr", + "Sc_rollup_proof_repr", + "Skip_list_costs", + "Sc_rollup_costs", + "Sc_rollup_game_repr", + "Tx_rollup_level_repr", + "Tx_rollup_l2_proof", + "Tx_rollup_l2_address", + "Tx_rollup_l2_qty", + "Tx_rollup_l2_context_hash", + "Tx_rollup_repr", + "Tx_rollup_withdraw_repr", + "Tx_rollup_withdraw_list_hash_repr", + "Tx_rollup_reveal_repr", + "Tx_rollup_message_repr", + "Tx_rollup_message_hash_repr", + "Tx_rollup_inbox_repr", + "Tx_rollup_message_result_repr", + "Tx_rollup_message_result_hash_repr", + "Tx_rollup_commitment_repr", + "Tx_rollup_errors_repr", + "Tx_rollup_state_repr", + + "Dal_errors_repr", + + "Zk_rollup_scalar", + "Zk_rollup_repr", + "Zk_rollup_state_repr", + "Zk_rollup_account_repr", + "Zk_rollup_ticket_repr", + "Zk_rollup_operation_repr", + "Zk_rollup_update_repr", + "Zk_rollup_circuit_public_inputs_repr", + + "Bond_id_repr", + "Vote_repr", + "Liquidity_baking_repr", + "Block_header_repr", + "Destination_repr", + "Script_int", + "Ticket_amount", + "Operation_repr", + "Manager_repr", + "Commitment_repr", + "Parameters_repr", + "Sapling_repr", + "Lazy_storage_kind", + "Receipt_repr", + "Migration_repr", + "Carbonated_map_costs", + "Carbonated_map", + + "Raw_context_intf", + "Raw_context", + + "Storage_costs", + "Storage_sigs", + "Storage_functors", + "Storage", + + "Ticket_hash_builder", + "Constants_storage", + "Tx_rollup_gas", + "Tx_rollup_hash_builder", + "Level_storage", + "Nonce_storage", + "Seed_storage", + "Contract_manager_storage", + "Delegate_activation_storage", + "Frozen_deposits_storage", + "Sapling_storage", + "Lazy_storage_diff", + "Commitment_storage", + "Voting_period_storage", + "Cache_repr", + + "Zk_rollup_storage", + + "Contract_delegate_storage", + "Stake_storage", + "Contract_storage", + "Token", + "Fees_storage", + "Delegate_consensus_key", + "Delegate_storage", + "Delegate_sampler", + "Delegate_missed_endorsements_storage", + "Delegate_slashed_deposits_storage", + "Delegate_cycles", + "Bootstrap_storage", + + "Vote_storage", + "Ticket_storage", + "Liquidity_baking_storage", + "Liquidity_baking_cpmm", + "Liquidity_baking_lqt", + "Liquidity_baking_migration", + + "Sc_rollup_errors", + "Sc_rollup_inbox_storage", + + "Legacy_script_patches", + "Init_storage", + "Sapling_validator", + + "Global_constants_costs", + "Global_constants_storage", + "Tx_rollup_state_storage", + "Tx_rollup_reveal_storage", + "Tx_rollup_inbox_storage", + "Tx_rollup_commitment_storage", + "Tx_rollup_storage", + "Sc_rollup_commitment_storage", + "Sc_rollup_outbox_storage", + "Sc_rollup_stake_storage", + "Sc_rollup_storage", + "Dal_slot_storage", + "Sc_rollup_refutation_storage", + "Zk_rollup_errors", + + + "Alpha_context", + "Script_string", + "Script_timestamp", + "Script_bytes", + + "Tx_rollup_l2_storage_sig", + "Tx_rollup_l2_context_sig", + "Tx_rollup_l2_context", + "Tx_rollup_l2_batch", + "Tx_rollup_l2_apply", + "Tx_rollup_l2_verifier", + + "Local_gas_counter", + "Script_tc_errors", + "Gas_monad", + "Script_ir_annot", + "Dependent_bool", + "Script_list", + "Script_typed_ir", + "Script_comparable", + "Gas_comparable_input_size", + "Script_set", + "Script_map", + "Gas_input_size", + "Script_typed_ir_size", + "Script_typed_ir_size_costs", + "Michelson_v1_gas_costs_generated", + "Michelson_v1_gas_costs", + "Michelson_v1_gas", + "Script_tc_context", + "Ticket_token", + "Ticket_receipt", + "Apply_operation_result", + "Apply_internal_results", + "Apply_results", + "Script_ir_translator_config", + "Script_ir_unparser", + "Script_ir_translator", + "Script_big_map", + "Script_cache", + "Script_tc_errors_registration", + "Ticket_token_unparser", + "Ticket_costs", + "Ticket_scanner", + "Ticket_balance_key", + "Ticket_lazy_storage_diff", + + "Tx_rollup_parameters", + "Zk_rollup_parameters", + + "Ticket_token_map", + "Ticket_operations_diff", + "Ticket_accounting", + "Ticket_transfer", + + "Script_interpreter_defs", + "Script_interpreter", + "Sc_rollup_management_protocol", + "Sc_rollup_operations", + + "Dal_apply", + "Zk_rollup_apply", + + "Baking", + "Validate_errors", + "Amendment", + "Validate", + "Mempool_validation", + "Apply", + + "Services_registration", + "Constants_services", + "Sapling_services", + "Contract_services", + "Delegate_services", + "Voting_services", + "Tx_rollup_services", + "Dal_services", + "Alpha_services", + + "Main" + ] +} diff --git a/src/proto_016_PtMumbai/lib_protocol/alpha_context.ml b/src/proto_016_PtMumbai/lib_protocol/alpha_context.ml new file mode 100644 index 000000000000..64179fc18249 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/alpha_context.ml @@ -0,0 +1,648 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Raw_context.t + +type context = t + +module type BASIC_DATA = sig + type t + + include Compare.S with type t := t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +module Tez = Tez_repr +module Period = Period_repr + +module Timestamp = struct + include Time_repr + + let current = Raw_context.current_timestamp + + let predecessor = Raw_context.predecessor_timestamp +end + +module Slot = Slot_repr +module Sc_rollup_repr = Sc_rollup_repr + +module Sc_rollup = struct + module Tick = Sc_rollup_tick_repr + include Sc_rollup_repr + module Metadata = Sc_rollup_metadata_repr + module Dissection_chunk = Sc_rollup_dissection_chunk_repr + include Sc_rollup_PVM_sig + module ArithPVM = Sc_rollup_arith + module Wasm_2_0_0PVM = Sc_rollup_wasm.V2_0_0 + module Inbox_message = Sc_rollup_inbox_message_repr + module Inbox_merkelized_payload_hashes = + Sc_rollup_inbox_merkelized_payload_hashes_repr + + module Inbox = struct + include Sc_rollup_inbox_repr + include Sc_rollup_inbox_storage + + module Internal_for_tests = struct + include Sc_rollup_inbox_repr.Internal_for_tests + include Sc_rollup_inbox_storage.Internal_for_tests + end + end + + module Proof = Sc_rollup_proof_repr + module Game = Sc_rollup_game_repr + + module Commitment = struct + include Sc_rollup_commitment_repr + include Sc_rollup_commitment_storage + end + + module Stake_storage = struct + include Sc_rollup_stake_storage + end + + module Storage = struct + let stakers_commitments_uncarbonated context rollup = + Storage.Sc_rollup.stakers context rollup + >>=? fun (_ctxt, stakers_commitments) -> return stakers_commitments + end + + module Refutation_storage = Sc_rollup_refutation_storage + include Sc_rollup_storage + include Sc_rollups + + module Outbox = struct + include Sc_rollup_outbox_storage + module Message = Sc_rollup_outbox_message_repr + end + + module Errors = Sc_rollup_errors +end + +module Dal = struct + include Dal_slot_repr + + module Slot_index = struct + include Dal_slot_repr.Index + end + + module Attestation = struct + include Dal_attestation_repr + include Raw_context.Dal + end + + type slot_id = Dal_slot_repr.Header.id = { + published_level : Raw_level_repr.t; + index : Dal_slot_repr.Index.t; + } + + module Page = struct + include Dal_slot_repr.Page + end + + module Slot = struct + include Dal_slot_repr + include Dal_slot_storage + include Raw_context.Dal + end + + module Slots_history = Dal_slot_repr.History + module Slots_storage = Dal_slot_storage +end + +module Dal_errors = Dal_errors_repr + +module Zk_rollup = struct + include Zk_rollup_repr + module State = Zk_rollup_state_repr + module Account = Zk_rollup_account_repr + module Operation = Zk_rollup_operation_repr + module Ticket = Zk_rollup_ticket_repr + module Errors = Zk_rollup_errors + module Circuit_public_inputs = Zk_rollup_circuit_public_inputs_repr + module Update = Zk_rollup_update_repr + include Zk_rollup_storage +end + +module Entrypoint = Entrypoint_repr +module Manager_counter = Manager_counter_repr +include Operation_repr + +module Operation = struct + type 'kind t = 'kind operation = { + shell : Operation.shell_header; + protocol_data : 'kind protocol_data; + } + + type packed = packed_operation + + let unsigned_encoding = unsigned_operation_encoding + + include Operation_repr +end + +module Block_header = Block_header_repr + +module Vote = struct + include Vote_repr + include Vote_storage +end + +module Block_payload = struct + include Block_payload_repr +end + +module First_level_of_protocol = struct + let get = Storage.Tenderbake.First_level_of_protocol.get +end + +module Ratio = Ratio_repr + +module Raw_level = struct + include Raw_level_repr + + module Internal_for_tests = struct + let add = add + + let sub = sub + end +end + +module Cycle = Cycle_repr +module Fees = Fees_storage + +type public_key = Signature.Public_key.t + +type public_key_hash = Signature.Public_key_hash.t + +type signature = Signature.t + +module Constants = struct + include Constants_repr + include Constants_storage + module Parametric = Constants_parametric_repr + + let round_durations ctxt = Raw_context.round_durations ctxt + + let all ctxt = all_of_parametric (parametric ctxt) +end + +module Voting_period = struct + include Voting_period_repr + include Voting_period_storage +end + +module Round = struct + include Round_repr + module Durations = Durations + + type round_durations = Durations.t + + let pp_round_durations = Durations.pp + + let round_durations_encoding = Durations.encoding + + let round_duration = Round_repr.Durations.round_duration + + let update ctxt round = Storage.Block_round.update ctxt round + + let get ctxt = Storage.Block_round.get ctxt +end + +module Gas = struct + include Gas_limit_repr + + type error += Block_quota_exceeded = Raw_context.Block_quota_exceeded + + type error += Operation_quota_exceeded = Raw_context.Operation_quota_exceeded + + let set_limit = Raw_context.set_gas_limit + + let consume_limit_in_block = Raw_context.consume_gas_limit_in_block + + let set_unlimited = Raw_context.set_gas_unlimited + + let consume = Raw_context.consume_gas + + let consume_from available_gas cost = + match raw_consume available_gas cost with + | Some remaining_gas -> ok remaining_gas + | None -> error Operation_quota_exceeded + + let remaining_operation_gas = Raw_context.remaining_operation_gas + + let update_remaining_operation_gas = + Raw_context.update_remaining_operation_gas + + let reset_block_gas ctxt = + let gas = Arith.fp @@ Constants.hard_gas_limit_per_block ctxt in + Raw_context.update_remaining_block_gas ctxt gas + + let level = Raw_context.gas_level + + let consumed = Raw_context.gas_consumed + + let block_level = Raw_context.block_gas_level + + (* Necessary to inject costs for Storage_costs into Gas.cost *) + let cost_of_repr cost = cost +end + +module Script = struct + include Michelson_v1_primitives + include Script_repr + + type consume_deserialization_gas = Always | When_needed + + let force_decode_in_context ~consume_deserialization_gas ctxt lexpr = + let gas_cost = + match consume_deserialization_gas with + | Always -> Script_repr.stable_force_decode_cost lexpr + | When_needed -> Script_repr.force_decode_cost lexpr + in + Raw_context.consume_gas ctxt gas_cost >>? fun ctxt -> + Script_repr.force_decode lexpr >|? fun v -> (v, ctxt) + + let force_bytes_in_context ctxt lexpr = + Raw_context.consume_gas ctxt (Script_repr.force_bytes_cost lexpr) + >>? fun ctxt -> + Script_repr.force_bytes lexpr >|? fun v -> (v, ctxt) + + let consume_decoding_gas available_gas lexpr = + let gas_cost = Script_repr.stable_force_decode_cost lexpr in + Gas.consume_from available_gas gas_cost +end + +module Level = struct + include Level_repr + include Level_storage +end + +module Lazy_storage = struct + module Kind = Lazy_storage_kind + module IdSet = Kind.IdSet + include Lazy_storage_diff +end + +module Origination_nonce = struct + let init = Raw_context.init_origination_nonce + + let unset = Raw_context.unset_origination_nonce + + module Internal_for_tests = Origination_nonce +end + +module Destination = Destination_repr + +module Contract = struct + include Contract_repr + include Contract_storage + + let is_manager_key_revealed = Contract_manager_storage.is_manager_key_revealed + + let check_public_key = Contract_manager_storage.check_public_key + + let reveal_manager_key = Contract_manager_storage.reveal_manager_key + + let get_manager_key = Contract_manager_storage.get_manager_key + + module Delegate = struct + let find = Contract_delegate_storage.find + + include Delegate_storage.Contract + end + + module Internal_for_tests = struct + include Contract_repr + include Contract_storage + end +end + +module Tx_rollup_level = Tx_rollup_level_repr +module Tx_rollup_commitment_hash = Tx_rollup_commitment_repr.Hash +module Tx_rollup_message_result_hash = Tx_rollup_message_result_hash_repr + +module Tx_rollup = struct + include Tx_rollup_repr + include Tx_rollup_storage + module Internal_for_tests = Tx_rollup_repr +end + +module Tx_rollup_state = struct + include Tx_rollup_state_repr + include Tx_rollup_state_storage + + module Internal_for_tests = struct + include Tx_rollup_state_repr + include Tx_rollup_state_repr.Internal_for_tests + end +end + +module Tx_rollup_withdraw = Tx_rollup_withdraw_repr +module Tx_rollup_withdraw_list_hash = Tx_rollup_withdraw_list_hash_repr +module Tx_rollup_message_result = Tx_rollup_message_result_repr + +module Tx_rollup_reveal = struct + include Tx_rollup_reveal_repr + include Tx_rollup_reveal_storage +end + +module Tx_rollup_message = struct + include Tx_rollup_message_repr + + let make_message msg = (msg, size msg) + + let make_batch string = make_message @@ Batch string + + let make_deposit sender destination ticket_hash amount = + make_message @@ Deposit {sender; destination; ticket_hash; amount} +end + +module Tx_rollup_message_hash = Tx_rollup_message_hash_repr + +module Tx_rollup_inbox = struct + include Tx_rollup_inbox_repr + include Tx_rollup_inbox_storage +end + +module Tx_rollup_commitment = struct + include Tx_rollup_commitment_repr + include Tx_rollup_commitment_storage +end + +module Tx_rollup_hash = Tx_rollup_hash_builder +module Tx_rollup_errors = Tx_rollup_errors_repr +module Global_constants_storage = Global_constants_storage + +module Big_map = struct + module Big_map = Lazy_storage_kind.Big_map + + module Id = struct + type t = Big_map.Id.t + + let encoding = Big_map.Id.encoding + + let rpc_arg = Big_map.Id.rpc_arg + + let parse_z = Big_map.Id.parse_z + + let unparse_to_z = Big_map.Id.unparse_to_z + end + + let fresh ~temporary c = Lazy_storage.fresh Big_map ~temporary c + + let mem c m k = Storage.Big_map.Contents.mem (c, m) k + + let get_opt c m k = Storage.Big_map.Contents.find (c, m) k + + let list_key_values ?offset ?length c m = + Storage.Big_map.Contents.list_key_values ?offset ?length (c, m) + + let exists c id = + Raw_context.consume_gas c (Gas_limit_repr.read_bytes_cost 0) >>?= fun c -> + Storage.Big_map.Key_type.find c id >>=? fun kt -> + match kt with + | None -> return (c, None) + | Some kt -> + Storage.Big_map.Value_type.get c id >|=? fun kv -> (c, Some (kt, kv)) + + type update = Big_map.update = { + key : Script_repr.expr; + key_hash : Script_expr_hash.t; + value : Script_repr.expr option; + } + + type updates = Big_map.updates + + type alloc = Big_map.alloc = { + key_type : Script_repr.expr; + value_type : Script_repr.expr; + } +end + +module Sapling = struct + module Sapling_state = Lazy_storage_kind.Sapling_state + + module Id = struct + type t = Sapling_state.Id.t + + let encoding = Sapling_state.Id.encoding + + let rpc_arg = Sapling_state.Id.rpc_arg + + let parse_z = Sapling_state.Id.parse_z + + let unparse_to_z = Sapling_state.Id.unparse_to_z + end + + include Sapling_repr + include Sapling_storage + include Sapling_validator + + let fresh ~temporary c = Lazy_storage.fresh Sapling_state ~temporary c + + type updates = Sapling_state.updates + + type alloc = Sapling_state.alloc = {memo_size : Sapling_repr.Memo_size.t} + + module Legacy = struct + include Sapling.UTXO.Legacy + + let transaction_get_memo_size transaction = + match transaction.outputs with + | [] -> None + | {ciphertext; _} :: _ -> + (* Encoding ensures all ciphertexts have the same memo size. *) + Some (Sapling.Ciphertext.get_memo_size ciphertext) + + let transaction_in_memory_size transaction = + transaction_in_memory_size (cast transaction) + + let verify_update ctxt state transaction key = + verify_update ctxt state (cast transaction) key + end +end + +module Bond_id = struct + include Bond_id_repr + module Internal_for_tests = Contract_storage +end + +module Receipt = Receipt_repr +module Consensus_key = Delegate_consensus_key + +module Delegate = struct + include Delegate_storage + include Delegate_missed_endorsements_storage + include Delegate_slashed_deposits_storage + include Delegate_cycles + + type deposits = Storage.deposits = { + initial_amount : Tez.t; + current_amount : Tez.t; + } + + let last_cycle_before_deactivation = + Delegate_activation_storage.last_cycle_before_deactivation + + let prepare_stake_distribution = Stake_storage.prepare_stake_distribution + + let check_not_tz4 = Contract_delegate_storage.check_not_tz4 + + let delegated_contracts = Contract_delegate_storage.delegated_contracts + + let deactivated = Delegate_activation_storage.is_inactive + + module Consensus_key = Delegate_consensus_key +end + +module Stake_distribution = struct + let snapshot = Stake_storage.snapshot + + let compute_snapshot_index = Delegate_sampler.compute_snapshot_index + + let baking_rights_owner = Delegate_sampler.baking_rights_owner + + let slot_owner = Delegate_sampler.slot_owner +end + +module Nonce = Nonce_storage + +module Seed = struct + include Seed_repr + include Seed_storage +end + +module Fitness = struct + type raw = Fitness.t + + include Fitness_repr +end + +module Bootstrap = Bootstrap_storage + +module Commitment = struct + include Commitment_repr + include Commitment_storage +end + +module Migration = Migration_repr + +module Consensus = struct + include Raw_context.Consensus + + let load_endorsement_branch ctxt = + Storage.Tenderbake.Endorsement_branch.find ctxt >>=? function + | Some endorsement_branch -> + Raw_context.Consensus.set_endorsement_branch ctxt endorsement_branch + |> return + | None -> return ctxt + + let store_endorsement_branch ctxt branch = + let ctxt = set_endorsement_branch ctxt branch in + Storage.Tenderbake.Endorsement_branch.add ctxt branch + + let load_grand_parent_branch ctxt = + Storage.Tenderbake.Grand_parent_branch.find ctxt >>=? function + | Some grand_parent_branch -> + Raw_context.Consensus.set_grand_parent_branch ctxt grand_parent_branch + |> return + | None -> return ctxt + + let store_grand_parent_branch ctxt branch = + let ctxt = set_grand_parent_branch ctxt branch in + Storage.Tenderbake.Grand_parent_branch.add ctxt branch +end + +let prepare_first_block = Init_storage.prepare_first_block + +let prepare ctxt ~level ~predecessor_timestamp ~timestamp = + Init_storage.prepare ctxt ~level ~predecessor_timestamp ~timestamp + >>=? fun (ctxt, balance_updates, origination_results) -> + Consensus.load_endorsement_branch ctxt >>=? fun ctxt -> + Consensus.load_grand_parent_branch ctxt >>=? fun ctxt -> + return (ctxt, balance_updates, origination_results) + +let finalize ?commit_message:message c fitness = + let context = Raw_context.recover c in + { + Updater.context; + fitness; + message; + max_operations_ttl = (Raw_context.constants c).max_operations_time_to_live; + last_allowed_fork_level = + Raw_level.to_int32 @@ Level.last_allowed_fork_level c; + } + +let current_context c = Raw_context.recover c + +let record_non_consensus_operation_hash = + Raw_context.record_non_consensus_operation_hash + +let non_consensus_operations = Raw_context.non_consensus_operations + +let record_dictator_proposal_seen = Raw_context.record_dictator_proposal_seen + +let dictator_proposal_seen = Raw_context.dictator_proposal_seen + +let activate = Raw_context.activate + +let reset_internal_nonce = Raw_context.reset_internal_nonce + +let fresh_internal_nonce = Raw_context.fresh_internal_nonce + +let record_internal_nonce = Raw_context.record_internal_nonce + +let internal_nonce_already_recorded = + Raw_context.internal_nonce_already_recorded + +let description = Raw_context.description + +module Parameters = Parameters_repr + +module Liquidity_baking = struct + include Liquidity_baking_repr + include Liquidity_baking_storage +end + +module Ticket_hash = struct + include Ticket_hash_repr + include Ticket_hash_builder +end + +module Ticket_balance = struct + include Ticket_storage +end + +module Token = Token +module Cache = Cache_repr + +module Internal_for_tests = struct + let to_raw x = x +end diff --git a/src/proto_016_PtMumbai/lib_protocol/alpha_context.mli b/src/proto_016_PtMumbai/lib_protocol/alpha_context.mli new file mode 100644 index 000000000000..073242aeef40 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/alpha_context.mli @@ -0,0 +1,5347 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** An [Alpha_context.t] is an immutable snapshot of the ledger state at some block + height, preserving + {{:https://tezos.gitlab.io/developer/entering_alpha.html#the-big-abstraction-barrier-alpha-context} + type-safety and invariants} of the ledger state. + + {2 Implementation} + + [Alpha_context.t] is a wrapper over [Raw_context.t], which in turn is a + wrapper around [Context.t] from the Protocol Environment. + + {2 Lifetime of an Alpha_context} + + - Creation, using [prepare] or [prepare_first_block] + + - Modification, using the operations defined in this signature + + - Finalization, using [finalize] + *) + +module type BASIC_DATA = sig + type t + + include Compare.S with type t := t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +type t + +type context = t + +type public_key = Signature.Public_key.t + +type public_key_hash = Signature.Public_key_hash.t + +type signature = Signature.t + +(** This module re-exports definitions from {!Slot_repr}. *) +module Slot : sig + type t + + type slot = t + + include Compare.S with type t := t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val succ : t -> t tzresult + + val of_int_do_not_use_except_for_parameters : int -> t + + val encoding : t Data_encoding.encoding + + module Range : sig + type t + + val create : min:int -> count:int -> t tzresult + + val fold : ('a -> slot -> 'a) -> 'a -> t -> 'a + + val fold_es : + ('a -> slot -> 'a tzresult Lwt.t) -> 'a -> t -> 'a tzresult Lwt.t + + val rev_fold_es : + ('a -> slot -> 'a tzresult Lwt.t) -> 'a -> t -> 'a tzresult Lwt.t + end + + module Map : Map.S with type key = t + + module Set : Set.S with type elt = t + + module Internal_for_tests : sig + val of_int : int -> t tzresult + end +end + +(** This module re-exports definitions from {!Tez_repr}. *) +module Tez : sig + type repr + + type t = Tez_tag of repr [@@ocaml.unboxed] + + include BASIC_DATA with type t := t + + type tez = t + + val zero : tez + + val one_mutez : tez + + val one_cent : tez + + val fifty_cents : tez + + val one : tez + + val ( -? ) : tez -> tez -> tez tzresult + + val sub_opt : tez -> tez -> tez option + + val ( +? ) : tez -> tez -> tez tzresult + + val ( *? ) : tez -> int64 -> tez tzresult + + val ( /? ) : tez -> int64 -> tez tzresult + + val of_string : string -> tez option + + val to_string : tez -> string + + val of_mutez : int64 -> tez option + + val to_mutez : tez -> int64 + + val of_mutez_exn : int64 -> t + + val mul_exn : t -> int -> t + + val div_exn : t -> int -> t +end + +(** This module re-exports definitions from {!Period_repr}. *) +module Period : sig + include BASIC_DATA + + type period = t + + val rpc_arg : period RPC_arg.arg + + val of_seconds : int64 -> period tzresult + + val of_seconds_exn : int64 -> period + + val to_seconds : period -> int64 + + val add : period -> period -> period tzresult + + val mult : int32 -> period -> period tzresult + + val zero : period + + val one_second : period + + val one_minute : period + + val one_hour : period + + val compare : period -> period -> int +end + +(** This module re-exports definitions from {!Time_repr}. *) +module Timestamp : sig + include BASIC_DATA with type t = Time.t + + type time = t + + val ( +? ) : time -> Period.t -> time tzresult + + val ( -? ) : time -> time -> Period.t tzresult + + val ( - ) : time -> Period.t -> time + + val of_notation : string -> time option + + val to_notation : time -> string + + val of_seconds : int64 -> time + + val to_seconds : time -> int64 + + val of_seconds_string : string -> time option + + val to_seconds_string : time -> string + + (** See {!Raw_context.current_timestamp}. *) + val current : context -> time + + (** See {!Raw_context.predecessor_timestamp}. *) + val predecessor : context -> time +end + +(** This module re-exports definitions from {!Ratio_repr}. *) +module Ratio : sig + type t = {numerator : int; denominator : int} + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +(** This module re-exports definitions from {!Raw_level_repr}. *) +module Raw_level : sig + include BASIC_DATA + + type raw_level = t + + val rpc_arg : raw_level RPC_arg.arg + + val diff : raw_level -> raw_level -> int32 + + val root : raw_level + + val succ : raw_level -> raw_level + + val pred : raw_level -> raw_level option + + val to_int32 : raw_level -> int32 + + val of_int32 : int32 -> raw_level tzresult + + val of_int32_exn : int32 -> raw_level + + module Set : Set.S with type elt = raw_level + + module Map : Map.S with type key = raw_level + + module Internal_for_tests : sig + val add : raw_level -> int -> raw_level + + val sub : raw_level -> int -> raw_level option + end +end + +(** This module re-exports definitions from {!Cycle_repr}. *) +module Cycle : sig + include BASIC_DATA + + type cycle = t + + val rpc_arg : cycle RPC_arg.arg + + val root : cycle + + val succ : cycle -> cycle + + val pred : cycle -> cycle option + + val add : cycle -> int -> cycle + + val sub : cycle -> int -> cycle option + + val to_int32 : cycle -> int32 + + module Map : Map.S with type key = cycle +end + +(** This module re-exports definitions from {!Round_repr}. *) +module Round : sig + (* A round represents an iteration of the single-shot consensus algorithm. + This mostly simply re-exports [Round_repr]. See [Round_repr] for + additional documentation of this module *) + + type t + + val zero : t + + val succ : t -> t + + val pred : t -> t tzresult + + val to_int32 : t -> int32 + + val of_int32 : int32 -> t tzresult + + val of_int : int -> t tzresult + + val to_int : t -> int tzresult + + val to_slot : t -> committee_size:int -> Slot.t tzresult + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + include Compare.S with type t := t + + module Map : Map.S with type key = t + + (** See {!Round_repr.Durations.t}. *) + type round_durations + + (** See {!Round_repr.Durations.pp}. *) + val pp_round_durations : Format.formatter -> round_durations -> unit + + (** See {!Round_repr.Durations.encoding}. *) + val round_durations_encoding : round_durations Data_encoding.t + + (** See {!Round_repr.Durations.round_duration}. *) + val round_duration : round_durations -> t -> Period.t + + module Durations : sig + val create : + first_round_duration:Period.t -> + delay_increment_per_round:Period.t -> + round_durations tzresult + + val create_opt : + first_round_duration:Period.t -> + delay_increment_per_round:Period.t -> + round_durations option + end + + val level_offset_of_round : round_durations -> round:t -> Period.t tzresult + + val timestamp_of_round : + round_durations -> + predecessor_timestamp:Time.t -> + predecessor_round:t -> + round:t -> + Time.t tzresult + + val timestamp_of_another_round_same_level : + round_durations -> + current_timestamp:Time.t -> + current_round:t -> + considered_round:t -> + Time.t tzresult + + val round_of_timestamp : + round_durations -> + predecessor_timestamp:Time.t -> + predecessor_round:t -> + timestamp:Time.t -> + t tzresult + + (* retrieve a round from the context *) + val get : context -> t tzresult Lwt.t + + (* store a round in context *) + val update : context -> t -> context tzresult Lwt.t +end + +module Gas : sig + (** This module implements the gas subsystem of the context. + + Gas reflects the computational cost of each operation to limit + the cost of operations and, by extension, the cost of blocks. + + There are two gas quotas: one for operation and one for + block. For this reason, we maintain two gas levels -- one for + operations and another one for blocks -- that correspond to the + remaining amounts of gas, initialized with the quota + limits and decreased each time gas is consumed. + + *) + + module Arith : + Fixed_point_repr.Safe + with type 'a t = private Saturation_repr.may_saturate Saturation_repr.t + + (** For maintenance operations or for testing, gas can be + [Unaccounted]. Otherwise, the computation is [Limited] by the + [remaining] gas in the context. *) + type t = private Unaccounted | Limited of {remaining : Arith.fp} + + val encoding : t Data_encoding.encoding + + val pp : Format.formatter -> t -> unit + + (** [set_limit ctxt limit] returns a context with a given + [limit] level of gas allocated for an operation. *) + val set_limit : context -> 'a Arith.t -> context + + (** [set_unlimited] allows unlimited gas consumption. *) + val set_unlimited : context -> context + + (** [remaining_operation_gas ctxt] returns the current gas level in + the context [ctxt] for the current operation. If gas is + [Unaccounted], an arbitrary value will be returned. *) + val remaining_operation_gas : context -> Arith.fp + + (** [reset_block_gas ctxt] returns a context where the remaining gas + in the block is reset to the constant [hard_gas_limit_per_block], + i.e., as if no operations have been included in the block. + + /!\ Do not call this function unless you want to validate + operations on their own (like in the mempool). *) + val reset_block_gas : context -> context + + (** [level ctxt] is the current gas level in [ctxt] for the current + operation. *) + val level : context -> t + + (** [update_remaining_operation_gas ctxt remaining] sets the current + gas level for operations to [remaining]. *) + val update_remaining_operation_gas : context -> Arith.fp -> context + + (** [consumed since until] is the operation gas level difference + between context [since] and context [until]. This function + returns [Arith.zero] if any of the two contexts allows for an + unlimited gas consumption. This function also returns + [Arith.zero] if [since] has less gas than [until]. *) + val consumed : since:context -> until:context -> Arith.fp + + (** [block_level ctxt] returns the block gas level in context [ctxt]. *) + val block_level : context -> Arith.fp + + (** Costs are computed using a saturating arithmetic. See + {!Saturation_repr}. *) + type cost = Saturation_repr.may_saturate Saturation_repr.t + + val cost_encoding : cost Data_encoding.encoding + + val pp_cost : Format.formatter -> cost -> unit + + val pp_cost_as_gas : Format.formatter -> cost -> unit + + type error += Operation_quota_exceeded (* `Temporary *) + + (** [consume ctxt cost] subtracts [cost] to the current operation + gas level in [ctxt]. This operation may fail with + [Operation_quota_exceeded] if the operation gas level would + go below zero. *) + val consume : context -> cost -> context tzresult + + (** [consume_from available_gas cost] subtracts [cost] from + [available_gas] and returns the remaining gas. + + @return [Error Operation_quota_exceeded] if the remaining gas + would fall below [0]. *) + val consume_from : Arith.fp -> cost -> Arith.fp tzresult + + type error += Block_quota_exceeded (* `Temporary *) + + type error += Gas_limit_too_high (* `Permanent *) + + (** See {!Raw_context.consume_gas_limit_in_block}. *) + val consume_limit_in_block : context -> 'a Arith.t -> context tzresult + + (** Check that [gas_limit] is a valid operation gas limit: at most + [hard_gas_limit_per_operation] and nonnegative. + + @return [Error Gas_limit_too_high] if [gas_limit] is greater + than [hard_gas_limit_per_operation] or negative. *) + val check_gas_limit : + hard_gas_limit_per_operation:Arith.integral -> + gas_limit:Arith.integral -> + unit tzresult + + (** The cost of free operation is [0]. *) + val free : cost + + (** Convert a fixed-point amount of gas to a cost. *) + val cost_of_gas : 'a Arith.t -> cost + + (** Convert an amount of milligas expressed as an int to Arith.fp. *) + val fp_of_milligas_int : int -> Arith.fp + + (** [atomic_step_cost x] corresponds to [x] milliunit of gas. *) + val atomic_step_cost : _ Saturation_repr.t -> cost + + (** [step_cost x] corresponds to [x] units of gas. *) + val step_cost : _ Saturation_repr.t -> cost + + (** Cost of allocating qwords of storage. + [alloc_cost n] estimates the cost of allocating [n] qwords of storage. *) + val alloc_cost : _ Saturation_repr.t -> cost + + (** Cost of allocating bytes in the storage. + [alloc_bytes_cost b] estimates the cost of allocating [b] bytes of + storage. *) + val alloc_bytes_cost : int -> cost + + (** Cost of allocating bytes in the storage. + + [alloc_mbytes_cost b] estimates the cost of allocating [b] bytes of + storage and the cost of an header to describe these bytes. *) + val alloc_mbytes_cost : int -> cost + + (** Cost of reading the storage. + [read_bytes_cost n] estimates the cost of reading [n] bytes of storage. *) + val read_bytes_cost : int -> cost + + (** Cost of writing to storage. + [write_bytes_const n] estimates the cost of writing [n] bytes to the + storage. *) + val write_bytes_cost : int -> cost + + (** Multiply a cost by a factor. Both arguments are saturated arithmetic values, + so no negative numbers are involved. *) + val ( *@ ) : _ Saturation_repr.t -> cost -> cost + + (** Add two costs together. *) + val ( +@ ) : cost -> cost -> cost + + (** [cost_of_repr] is an internal operation needed to inject costs + for Storage_costs into Gas.cost. *) + val cost_of_repr : Gas_limit_repr.cost -> cost +end + +module Entrypoint : module type of Entrypoint_repr + +(** This module re-exports definitions from {!Script_repr} and + {!Michelson_v1_primitives}. *) +module Script : sig + type error += Lazy_script_decode + + type prim = Michelson_v1_primitives.prim = + | K_parameter + | K_storage + | K_code + | K_view + | D_False + | D_Elt + | D_Left + | D_None + | D_Pair + | D_Right + | D_Some + | D_True + | D_Unit + | D_Lambda_rec + | I_PACK + | I_UNPACK + | I_BLAKE2B + | I_SHA256 + | I_SHA512 + | I_ABS + | I_ADD + | I_AMOUNT + | I_AND + | I_BALANCE + | I_CAR + | I_CDR + | I_CHAIN_ID + | I_CHECK_SIGNATURE + | I_COMPARE + | I_CONCAT + | I_CONS + | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT + | I_IMPLICIT_ACCOUNT + | I_DIP + | I_DROP + | I_DUP + | I_VIEW + | I_EDIV + | I_EMPTY_BIG_MAP + | I_EMPTY_MAP + | I_EMPTY_SET + | I_EQ + | I_EXEC + | I_APPLY + | I_FAILWITH + | I_GE + | I_GET + | I_GET_AND_UPDATE + | I_GT + | I_HASH_KEY + | I_IF + | I_IF_CONS + | I_IF_LEFT + | I_IF_NONE + | I_INT + | I_LAMBDA + | I_LAMBDA_REC + | I_LE + | I_LEFT + | I_LEVEL + | I_LOOP + | I_LSL + | I_LSR + | I_LT + | I_MAP + | I_MEM + | I_MUL + | I_NEG + | I_NEQ + | I_NIL + | I_NONE + | I_NOT + | I_NOW + | I_MIN_BLOCK_TIME + | I_OR + | I_PAIR + | I_UNPAIR + | I_PUSH + | I_RIGHT + | I_SIZE + | I_SOME + | I_SOURCE + | I_SENDER + | I_SELF + | I_SELF_ADDRESS + | I_SLICE + | I_STEPS_TO_QUOTA + | I_SUB + | I_SUB_MUTEZ + | I_SWAP + | I_TRANSFER_TOKENS + | I_SET_DELEGATE + | I_UNIT + | I_UPDATE + | I_XOR + | I_ITER + | I_LOOP_LEFT + | I_ADDRESS + | I_CONTRACT + | I_ISNAT + | I_CAST + | I_RENAME + | I_SAPLING_EMPTY_STATE + | I_SAPLING_VERIFY_UPDATE + | I_DIG + | I_DUG + | I_NEVER + | I_VOTING_POWER + | I_TOTAL_VOTING_POWER + | I_KECCAK + | I_SHA3 + | I_PAIRING_CHECK + | I_TICKET + | I_TICKET_DEPRECATED + | I_READ_TICKET + | I_SPLIT_TICKET + | I_JOIN_TICKETS + | I_OPEN_CHEST + | I_EMIT + | I_BYTES + | I_NAT + | T_bool + | T_contract + | T_int + | T_key + | T_key_hash + | T_lambda + | T_list + | T_map + | T_big_map + | T_nat + | T_option + | T_or + | T_pair + | T_set + | T_signature + | T_string + | T_bytes + | T_mutez + | T_timestamp + | T_unit + | T_operation + | T_address + | T_tx_rollup_l2_address + | T_sapling_transaction + | T_sapling_transaction_deprecated + | T_sapling_state + | T_chain_id + | T_never + | T_bls12_381_g1 + | T_bls12_381_g2 + | T_bls12_381_fr + | T_ticket + | T_chest_key + | T_chest + | H_constant + + type location = Micheline.canonical_location + + type annot = Micheline.annot + + type expr = prim Micheline.canonical + + type lazy_expr = expr Data_encoding.lazy_t + + val lazy_expr : expr -> lazy_expr + + type 'location michelson_node = ('location, prim) Micheline.node + + type node = location michelson_node + + type t = {code : lazy_expr; storage : lazy_expr} + + val location_encoding : location Data_encoding.t + + val expr_encoding : expr Data_encoding.t + + val prim_encoding : prim Data_encoding.t + + val encoding : t Data_encoding.t + + val lazy_expr_encoding : lazy_expr Data_encoding.t + + val deserialization_cost_estimated_from_bytes : int -> Gas.cost + + val deserialized_cost : expr -> Gas.cost + + val micheline_serialization_cost : expr -> Gas.cost + + val bytes_node_cost : bytes -> Gas.cost + + (** Mode of deserialization gas consumption in {!force_decode}: + + - {!Always}: the gas is taken independently of the internal state of the + [lazy_expr] + - {!When_needed}: the gas is consumed only if the [lazy_expr] has never + been deserialized before. *) + type consume_deserialization_gas = Always | When_needed + + (** Decode an expression in the context after consuming the deserialization + gas cost (see {!consume_deserialization_gas}). *) + val force_decode_in_context : + consume_deserialization_gas:consume_deserialization_gas -> + context -> + lazy_expr -> + (expr * context) tzresult + + (** Decode an expression in the context after consuming the deserialization + gas cost. *) + val force_bytes_in_context : + context -> lazy_expr -> (bytes * context) tzresult + + (** [consume_decoding_gas available_gas lexpr] subtracts (a lower + bound on) the cost to deserialize [lexpr] from [available_gas]. + The cost does not depend on the internal state of the lazy_expr. + + @return [Error Operation_quota_exceeded] if the remaining gas + would fall below [0]. + + This mimics the gas consuming part of {!force_decode_in_context} + called with [consume_deserialization_gas:Always]. *) + val consume_decoding_gas : Gas.Arith.fp -> lazy_expr -> Gas.Arith.fp tzresult + + val unit_parameter : lazy_expr + + val strip_locations_cost : _ michelson_node -> Gas.cost + + val strip_annotations_cost : node -> Gas.cost + + val strip_annotations : node -> node +end + +(** This module re-exports definitions from {!Constants_repr} and + {!Constants_storage}. *) +module Constants : sig + (** Fixed constants *) + type fixed + + val fixed_encoding : fixed Data_encoding.t + + val mainnet_id : Chain_id.t + + val proof_of_work_nonce_size : int + + val nonce_length : int + + val max_anon_ops_per_block : int + + val max_operation_data_length : int + + val max_proposals_per_delegate : int + + val michelson_maximum_type_size : int + + val sc_rollup_message_size_limit : int + + val sc_rollup_max_number_of_messages_per_level : Z.t + + (** Constants parameterized by context. See {!Constants_parametric_repr}. *) + module Parametric : sig + type dal = { + feature_enable : bool; + number_of_slots : int; + attestation_lag : int; + availability_threshold : int; + cryptobox_parameters : Dal.parameters; + } + + val dal_encoding : dal Data_encoding.t + + type tx_rollup = { + enable : bool; + origination_size : int; + hard_size_limit_per_inbox : int; + hard_size_limit_per_message : int; + commitment_bond : Tez.t; + finality_period : int; + withdraw_period : int; + max_inboxes_count : int; + max_messages_per_inbox : int; + max_commitments_count : int; + cost_per_byte_ema_factor : int; + max_ticket_payload_size : int; + max_withdrawals_per_batch : int; + rejection_max_proof_size : int; + sunset_level : int32; + } + + type sc_rollup = { + enable : bool; + origination_size : int; + challenge_window_in_blocks : int; + stake_amount : Tez.t; + commitment_period_in_blocks : int; + max_lookahead_in_blocks : int32; + max_active_outbox_levels : int32; + max_outbox_messages_per_level : int; + number_of_sections_in_dissection : int; + timeout_period_in_blocks : int; + max_number_of_stored_cemented_commitments : int; + max_number_of_parallel_games : int; + } + + type zk_rollup = { + enable : bool; + origination_size : int; + min_pending_to_process : int; + } + + type t = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + nonce_revelation_threshold : int32; + blocks_per_stake_snapshot : int32; + cycles_per_voting_period : int32; + hard_gas_limit_per_operation : Gas.Arith.integral; + hard_gas_limit_per_block : Gas.Arith.integral; + proof_of_work_threshold : int64; + minimal_stake : Tez.t; + vdf_difficulty : int64; + seed_nonce_revelation_tip : Tez.t; + origination_size : int; + baking_reward_fixed_portion : Tez.t; + baking_reward_bonus_per_slot : Tez.t; + endorsing_reward_per_slot : Tez.t; + cost_per_byte : Tez.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + liquidity_baking_subsidy : Tez.t; + liquidity_baking_toggle_ema_threshold : int32; + max_operations_time_to_live : int; + minimal_block_delay : Period.t; + delay_increment_per_round : Period.t; + minimal_participation_ratio : Ratio.t; + consensus_committee_size : int; + consensus_threshold : int; + max_slashing_period : int; + frozen_deposits_percentage : int; + double_baking_punishment : Tez.t; + ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio.t; + testnet_dictator : public_key_hash option; + initial_seed : State_hash.t option; + cache_script_size : int; + cache_stake_distribution_cycles : int; + cache_sampler_state_cycles : int; + tx_rollup : tx_rollup; + dal : dal; + sc_rollup : sc_rollup; + zk_rollup : zk_rollup; + } + + val encoding : t Data_encoding.t + end + + module Generated : sig + type t = { + consensus_threshold : int; + baking_reward_fixed_portion : Tez.t; + baking_reward_bonus_per_slot : Tez.t; + endorsing_reward_per_slot : Tez.t; + liquidity_baking_subsidy : Tez.t; + } + + val generate : + consensus_committee_size:int -> blocks_per_minute:Ratio.t -> t + end + + val parametric : context -> Parametric.t + + val tx_rollup : context -> Parametric.tx_rollup + + val sc_rollup : context -> Parametric.sc_rollup + + val preserved_cycles : context -> int + + val blocks_per_cycle : context -> int32 + + val blocks_per_commitment : context -> int32 + + val nonce_revelation_threshold : context -> int32 + + val blocks_per_stake_snapshot : context -> int32 + + val cycles_per_voting_period : context -> int32 + + val hard_gas_limit_per_operation : context -> Gas.Arith.integral + + val hard_gas_limit_per_block : context -> Gas.Arith.integral + + val cost_per_byte : context -> Tez.t + + val hard_storage_limit_per_operation : context -> Z.t + + val proof_of_work_threshold : context -> int64 + + val minimal_stake : context -> Tez.t + + val vdf_difficulty : context -> int64 + + val seed_nonce_revelation_tip : context -> Tez.t + + val origination_size : context -> int + + val baking_reward_fixed_portion : context -> Tez.t + + val baking_reward_bonus_per_slot : context -> Tez.t + + val endorsing_reward_per_slot : context -> Tez.t + + val quorum_min : context -> int32 + + val quorum_max : context -> int32 + + val min_proposal_quorum : context -> int32 + + val liquidity_baking_subsidy : context -> Tez.t + + val liquidity_baking_toggle_ema_threshold : context -> int32 + + val minimal_block_delay : context -> Period.t + + val delay_increment_per_round : context -> Period.t + + (** See {!Raw_context.round_durations}. *) + val round_durations : context -> Round.round_durations + + val consensus_committee_size : context -> int + + val consensus_threshold : context -> int + + val minimal_participation_ratio : context -> Ratio.t + + val max_slashing_period : context -> int + + val frozen_deposits_percentage : context -> int + + val double_baking_punishment : context -> Tez.t + + val ratio_of_frozen_deposits_slashed_per_double_endorsement : + context -> Ratio.t + + val testnet_dictator : context -> public_key_hash option + + val tx_rollup_enable : context -> bool + + val tx_rollup_origination_size : context -> int + + val tx_rollup_hard_size_limit_per_inbox : context -> int + + val tx_rollup_hard_size_limit_per_message : context -> int + + val tx_rollup_max_withdrawals_per_batch : context -> int + + val tx_rollup_commitment_bond : context -> Tez.t + + val tx_rollup_finality_period : context -> int + + val tx_rollup_max_inboxes_count : context -> int + + val tx_rollup_max_messages_per_inbox : context -> int + + val tx_rollup_max_commitments_count : context -> int + + val tx_rollup_max_ticket_payload_size : context -> int + + val tx_rollup_rejection_max_proof_size : context -> int + + val tx_rollup_sunset_level : context -> int32 + + val sc_rollup_enable : context -> bool + + val dal_enable : context -> bool + + val sc_rollup_origination_size : context -> int + + val sc_rollup_stake_amount : t -> Tez.t + + val sc_rollup_commitment_period_in_blocks : t -> int + + val sc_rollup_max_lookahead_in_blocks : t -> int32 + + val sc_rollup_max_active_outbox_levels : context -> int32 + + val sc_rollup_max_outbox_messages_per_level : context -> int + + val sc_rollup_number_of_sections_in_dissection : context -> int + + val max_number_of_stored_cemented_commitments : context -> int + + val zk_rollup_enable : context -> bool + + val zk_rollup_min_pending_to_process : context -> int + + (** All constants: fixed and parametric *) + type t = private {fixed : fixed; parametric : Parametric.t} + + val all : context -> t + + val encoding : t Data_encoding.t +end + +(** See the definitions inside the module. *) +module Global_constants_storage : sig + type error += Expression_too_deep + + type error += Expression_already_registered + + (** A constant is the prim of the literal characters "constant". + A constant must have a single argument, being a string with a + well formed hash of a Micheline expression (i.e generated by + [Script_expr_hash.to_b58check]). *) + type error += Badly_formed_constant_expression + + type error += Nonexistent_global + + (** [get context hash] retrieves the Micheline value with the given hash. + + Fails with [Nonexistent_global] if no value is found at the given hash. + + Fails with [Storage_error Corrupted_data] if the deserialisation fails. + + Consumes [Gas_repr.read_bytes_cost <size of the value>]. *) + val get : t -> Script_expr_hash.t -> (t * Script.expr) tzresult Lwt.t + + (** [register context value] Register a constant in the global table of constants, + returning the hash and storage bytes consumed. + + Does not type-check the Micheline code being registered, allow potentially + ill-typed Michelson values (see note at top of module in global_constants_storage.mli). + + The constant is stored unexpanded, but it is temporarily expanded at registration + time only to check the expanded version respects the following limits. + + Fails with [Expression_too_deep] if, after fully, expanding all constants, + the expression would contain too many nested levels, that is more than + [Constants_repr.max_allowed_global_constant_depth]. + + Fails with [Badly_formed_constant_expression] if constants are not + well-formed (see declaration of [Badly_formed_constant_expression]) or with + [Nonexistent_global] if a referenced constant does not exist in the table. + + Consumes serialization cost. + Consumes [Gas_repr.write_bytes_cost <size>] where size is the number + of bytes in the binary serialization provided by [Script.expr_encoding].*) + val register : + t -> Script.expr -> (t * Script_expr_hash.t * Z.t) tzresult Lwt.t + + (** [expand context expr] Replaces every constant in the + given Michelson expression with its value stored in the global table. + + The expansion is applied recursively so that the returned expression + contains no constant. + + Fails with [Badly_formed_constant_expression] if constants are not + well-formed (see declaration of [Badly_formed_constant_expression]) or + with [Nonexistent_global] if a referenced constant does not exist in + the table. *) + val expand : t -> Script.expr -> (t * Script.expr) tzresult Lwt.t + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + (** [node_too_large node] returns true if: + - The number of sub-nodes in the [node] + exceeds [Global_constants_storage.node_size_limit]. + - The sum of the bytes in String, Int, + and Bytes sub-nodes of [node] exceeds + [Global_constants_storage.bytes_size_limit]. + + Otherwise returns false. *) + val node_too_large : Script.node -> bool + + (** [bottom_up_fold_cps initial_accumulator node initial_k f] + folds [node] and all its sub-nodes if any, starting from + [initial_accumulator], using an initial continuation [initial_k]. + At each node, [f] is called to transform the continuation [k] into + the next one. This explicit manipulation of the continuation + is typically useful to short-circuit. + + Notice that a common source of bug is to forget to properly call the + continuation in `f`. *) + val bottom_up_fold_cps : + 'accumulator -> + 'loc Script.michelson_node -> + ('accumulator -> 'loc Script.michelson_node -> 'return) -> + ('accumulator -> + 'loc Script.michelson_node -> + ('accumulator -> 'loc Script.michelson_node -> 'return) -> + 'return) -> + 'return + + (** [expr_to_address_in_context context expr] converts [expr] + into a unique hash represented by a [Script_expr_hash.t]. + + Consumes gas corresponding to the cost of converting [expr] + to bytes and hashing the bytes. *) + val expr_to_address_in_context : + t -> Script.expr -> (t * Script_expr_hash.t) tzresult + end +end + +(** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) +module Internal_for_tests : sig + val to_raw : context -> Raw_context.t +end + +(** This module re-exports definitions from {!Level_repr} and + {!Level_storage}. *) +module Level : sig + type t = private { + level : Raw_level.t; + level_position : int32; + cycle : Cycle.t; + cycle_position : int32; + expected_commitment : bool; + } + + include BASIC_DATA with type t := t + + val pp_full : Format.formatter -> t -> unit + + type level = t + + val root : context -> level + + val succ : context -> level -> level + + val pred : context -> level -> level option + + val from_raw : context -> Raw_level.t -> level + + (** Fails with [Negative_level_and_offset_sum] if the sum of the raw_level and the offset is negative. *) + val from_raw_with_offset : + context -> offset:int32 -> Raw_level.t -> level tzresult + + (** [add c level i] i must be positive *) + val add : context -> level -> int -> level + + (** [sub c level i] i must be positive *) + val sub : context -> level -> int -> level option + + val diff : level -> level -> int32 + + val current : context -> level + + val last_level_in_cycle : context -> Cycle.t -> level + + val levels_in_cycle : context -> Cycle.t -> level list + + val levels_in_current_cycle : context -> ?offset:int32 -> unit -> level list + + val last_allowed_fork_level : context -> Raw_level.t + + val dawn_of_a_new_cycle : context -> Cycle.t option + + val may_snapshot_stake_distribution : context -> bool + + val may_compute_randao : context -> bool +end + +(** This module re-exports definitions from {!Fitness_repr}. *) +module Fitness : sig + type error += Invalid_fitness | Wrong_fitness | Outdated_fitness + + type raw = Fitness.t + + type t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val create : + level:Raw_level.t -> + locked_round:Round.t option -> + predecessor_round:Round.t -> + round:Round.t -> + t tzresult + + val create_without_locked_round : + level:Raw_level.t -> predecessor_round:Round.t -> round:Round.t -> t + + val to_raw : t -> raw + + val from_raw : raw -> t tzresult + + val round_from_raw : raw -> Round.t tzresult + + val predecessor_round_from_raw : raw -> Round.t tzresult + + val level : t -> Raw_level.t + + val round : t -> Round.t + + val locked_round : t -> Round.t option + + val predecessor_round : t -> Round.t +end + +(** This module re-exports definitions from {!Nonce_storage}. *) +module Nonce : sig + type t + + type nonce = t + + val encoding : nonce Data_encoding.t + + type unrevealed = {nonce_hash : Nonce_hash.t; delegate : public_key_hash} + + val record_hash : context -> unrevealed -> context tzresult Lwt.t + + (** See {!Nonce_storage.check_unrevealed}. *) + val check_unrevealed : context -> Level.t -> nonce -> unit tzresult Lwt.t + + val reveal : context -> Level.t -> nonce -> context tzresult Lwt.t + + type status = Unrevealed of unrevealed | Revealed of nonce + + val get : context -> Level.t -> status tzresult Lwt.t + + val of_bytes : bytes -> nonce tzresult + + val hash : nonce -> Nonce_hash.t + + val check_hash : nonce -> Nonce_hash.t -> bool +end + +(** This module re-exports definitions from {!Seed_repr} and {!Seed_storage}. *) +module Seed : sig + type seed + + val seed_encoding : seed Data_encoding.t + + type vdf_solution = Vdf.result * Vdf.proof + + val vdf_solution_encoding : vdf_solution Data_encoding.t + + val pp_solution : Format.formatter -> vdf_solution -> unit + + type vdf_setup = Vdf.discriminant * Vdf.challenge + + type error += + | Unknown of {oldest : Cycle.t; cycle : Cycle.t; latest : Cycle.t} + | Already_accepted + | Unverified_vdf + | Too_early_revelation + + val generate_vdf_setup : + seed_discriminant:seed -> seed_challenge:seed -> vdf_setup + + (** See {!Seed_storage.check_vdf}. *) + val check_vdf : context -> vdf_solution -> unit tzresult Lwt.t + + (** See {!Seed_storage.update_seed}. *) + val update_seed : context -> vdf_solution -> context tzresult Lwt.t + + (** See {!Seed_repr.compare_vdf_solution}. *) + val compare_vdf_solution : vdf_solution -> vdf_solution -> int + + val compute_randao : context -> context tzresult Lwt.t + + (* RPC *) + type seed_computation_status = + | Nonce_revelation_stage + | Vdf_revelation_stage of {seed_discriminant : seed; seed_challenge : seed} + | Computation_finished + + val for_cycle : context -> Cycle.t -> seed tzresult Lwt.t + + val get_seed_computation_status : + context -> seed_computation_status tzresult Lwt.t +end + +(** Big maps are a data structure storing key-value associations, just like + regular maps, but here the whole content of the structure is not loaded in + memory when interacting with it. + They are thus suitable for a Michelson contract, for instance, when there are a + lot of bindings, but only a few items are accessed at each contract call. *) +module Big_map : sig + (** A big map is referenced in the storage by its identifier. *) + module Id : sig + type t = Lazy_storage_kind.Big_map.Id.t + + val encoding : t Data_encoding.t + + (** Big map argument for a RPC call. *) + val rpc_arg : t RPC_arg.arg + + (** In the protocol, to be used in parse_data only *) + val parse_z : Z.t -> t + + (** In the protocol, to be used in unparse_data only *) + val unparse_to_z : t -> Z.t + end + + (** Create a fresh big map in the context. *) + val fresh : temporary:bool -> context -> (context * Id.t) tzresult Lwt.t + + (** Carbonated membership of a key (from its hash) in a big map. *) + val mem : + context -> Id.t -> Script_expr_hash.t -> (context * bool) tzresult Lwt.t + + (** Carbonated retrieval of the value associated to a key (from its hash) in + a big map, if any. *) + val get_opt : + context -> + Id.t -> + Script_expr_hash.t -> + (context * Script.expr option) tzresult Lwt.t + + (** Carbonated retrieval of the key and value types of the bindings in a big + map referenced by its identifier, if this identifier is actually bound to a big map in the context. *) + val exists : + context -> + Id.t -> + (context * (Script.expr * Script.expr) option) tzresult Lwt.t + + (** [list_key_values ?offset ?length ctxt id] lists the key hash and value for + each entry in big map [id]. The first [offset] values are ignored (if + passed). Negative offsets are treated as [0]. There will be no more than + [length] values in the result list (if passed). Negative values are + treated as [0]. + + The returned {!context} takes into account gas consumption of traversing + the keys and loading values. *) + val list_key_values : + ?offset:int -> + ?length:int -> + context -> + Id.t -> + (context * (Script_expr_hash.t * Script.expr) list) tzresult Lwt.t + + (** The type of big map updates. When [value = None], the potential binding + associated to the [key] will be removed. *) + type update = { + key : Script_repr.expr; + (** The key is ignored by an update but is shown in the receipt. *) + key_hash : Script_expr_hash.t; + value : Script_repr.expr option; + } + + type updates = update list + + (** The types of keys and values in a big map. *) + type alloc = {key_type : Script_repr.expr; value_type : Script_repr.expr} +end + +(** This module re-exports definitions from {!Sapling_repr}, {!Sapling_storage} + and {!Sapling_validator}. *) +module Sapling : sig + (** See {!Sapling_state.Id}. *) + module Id : sig + type t + + val encoding : t Data_encoding.t + + val rpc_arg : t RPC_arg.arg + + val parse_z : Z.t -> t (* To be used in parse_data only *) + + val unparse_to_z : t -> Z.t (* To be used in unparse_data only *) + end + + (** Create a fresh sapling state in the context. *) + val fresh : temporary:bool -> context -> (context * Id.t) tzresult Lwt.t + + type diff = private { + commitments_and_ciphertexts : + (Sapling.Commitment.t * Sapling.Ciphertext.t) list; + nullifiers : Sapling.Nullifier.t list; + } + + val diff_encoding : diff Data_encoding.t + + module Memo_size : sig + type t + + val encoding : t Data_encoding.t + + val equal : t -> t -> bool + + val parse_z : Z.t -> (t, string) result + + val unparse_to_z : t -> Z.t + + val in_memory_size : t -> Cache_memory_helpers.sint + end + + type state = private {id : Id.t option; diff : diff; memo_size : Memo_size.t} + + (** + Returns a [state] with fields filled accordingly. + [id] should only be used by [extract_lazy_storage_updates]. + *) + val empty_state : ?id:Id.t -> memo_size:Memo_size.t -> unit -> state + + type transaction = Sapling.UTXO.transaction + + val transaction_encoding : transaction Data_encoding.t + + val transaction_get_memo_size : transaction -> Memo_size.t option + + (** + Tries to fetch a state from the storage. + *) + val state_from_id : context -> Id.t -> (state * context) tzresult Lwt.t + + val rpc_arg : Id.t RPC_arg.t + + type root = Sapling.Hash.t + + val root_encoding : root Data_encoding.t + + (* Function exposed as RPC. Returns the root and a diff of a state starting + from an optional offset which is zero by default. *) + val get_diff : + context -> + Id.t -> + ?offset_commitment:Int64.t -> + ?offset_nullifier:Int64.t -> + unit -> + (root * diff) tzresult Lwt.t + + val verify_update : + context -> + state -> + transaction -> + string -> + (context * (Int64.t * state) option) tzresult Lwt.t + + (** See {!Lazy_storage_kind.Sapling_state.alloc}. *) + type alloc = {memo_size : Memo_size.t} + + type updates = diff + + val transaction_in_memory_size : transaction -> Cache_memory_helpers.sint + + val diff_in_memory_size : diff -> Cache_memory_helpers.sint + + module Legacy : sig + type transaction = Sapling.UTXO.Legacy.transaction + + val transaction_encoding : transaction Data_encoding.t + + val transaction_get_memo_size : transaction -> Memo_size.t option + + val transaction_in_memory_size : + transaction -> Saturation_repr.may_saturate Saturation_repr.t + + val verify_update : + context -> + state -> + transaction -> + string -> + (context * (Int64.t * state) option) tzresult Lwt.t + end +end + +(** This module re-exports definitions from {!Lazy_storage_diff}. *) +module Lazy_storage : sig + (** This module re-exports definitions from {!Lazy_storage_kind}. *) + module Kind : sig + type ('id, 'alloc, 'updates) t = + | Big_map : (Big_map.Id.t, Big_map.alloc, Big_map.updates) t + | Sapling_state : (Sapling.Id.t, Sapling.alloc, Sapling.updates) t + end + + (** This module re-exports definitions from {!Lazy_storage_kind.IdSet}. *) + module IdSet : sig + type t + + type 'acc fold_f = {f : 'i 'a 'u. ('i, 'a, 'u) Kind.t -> 'i -> 'acc -> 'acc} + + val empty : t + + val mem : ('i, 'a, 'u) Kind.t -> 'i -> t -> bool + + val add : ('i, 'a, 'u) Kind.t -> 'i -> t -> t + + val diff : t -> t -> t + + val fold : ('i, 'a, 'u) Kind.t -> ('i -> 'acc -> 'acc) -> t -> 'acc -> 'acc + + val fold_all : 'acc fold_f -> t -> 'acc -> 'acc + end + + type ('id, 'alloc) init = Existing | Copy of {src : 'id} | Alloc of 'alloc + + type ('id, 'alloc, 'updates) diff = + | Remove + | Update of {init : ('id, 'alloc) init; updates : 'updates} + + type diffs_item = private + | Item : + ('i, 'a, 'u) Lazy_storage_kind.t * 'i * ('i, 'a, 'u) diff + -> diffs_item + + val make : ('i, 'a, 'u) Kind.t -> 'i -> ('i, 'a, 'u) diff -> diffs_item + + type diffs = diffs_item list + + val encoding : diffs Data_encoding.t + + val diffs_in_memory_size : diffs -> Cache_memory_helpers.nodes_and_size + + val cleanup_temporaries : context -> context Lwt.t + + val apply : t -> diffs -> (t * Z.t) tzresult Lwt.t +end + +(** See the definitions inside the module. *) +module Origination_nonce : sig + (** See {!Raw_context.init_origination_nonce}. *) + val init : context -> Operation_hash.t -> context + + (** See {!Raw_context.unset_origination_nonce}. *) + val unset : context -> context + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. See {!Origination_nonce}. *) + module Internal_for_tests : sig + type t + + val initial : Operation_hash.t -> t + + val incr : t -> t + end +end + +(** This module re-exports definitions from {!Ticket_hash_repr}. *) +module Ticket_hash : sig + type t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val of_script_expr_hash : Script_expr_hash.t -> t + + val to_b58check : t -> string + + val of_b58check_opt : string -> t option + + val of_b58check_exn : string -> t + + val of_bytes_exn : bytes -> t + + val of_bytes_opt : bytes -> t option + + val equal : t -> t -> bool + + val compare : t -> t -> int + + val make : + context -> + ticketer:Script.node -> + ty:Script.node -> + contents:Script.node -> + owner:Script.node -> + (t * context) tzresult + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + val make_uncarbonated : + ticketer:Script.node -> + ty:Script.node -> + contents:Script.node -> + owner:Script.node -> + t tzresult + end +end + +(** This module re-exports definitions from {!Manager_counter_repr}. *) +module Manager_counter : sig + include Compare.S + + val succ : t -> t + + val pp : Format.formatter -> t -> unit + + val encoding_for_RPCs : t Data_encoding.t + + module Internal_for_injection : sig + val of_string : string -> t option + end + + module Internal_for_tests : sig + val of_int : int -> t + + val to_int : t -> int + + val add : t -> int -> t + end +end + +(** This module re-exports definitions from {!Contract_repr} and + {!Contract_storage}. *) +module Contract : sig + type t = Implicit of public_key_hash | Originated of Contract_hash.t + + (** Functions related to contracts address. *) + + type error += Non_existing_contract of t + + include BASIC_DATA with type t := t + + val implicit_encoding : public_key_hash Data_encoding.t + + val originated_encoding : Contract_hash.t Data_encoding.t + + val in_memory_size : t -> Cache_memory_helpers.sint + + val rpc_arg : t RPC_arg.arg + + val to_b58check : t -> string + + val of_b58check : string -> t tzresult + + (** Functions related to contracts existence. *) + + val exists : context -> t -> bool Lwt.t + + val must_exist : context -> t -> unit tzresult Lwt.t + + val allocated : context -> t -> bool Lwt.t + + val must_be_allocated : context -> t -> unit tzresult Lwt.t + + val list : context -> t list Lwt.t + + (** Functions related to both implicit accounts and originated contracts. *) + + (** See {!Contract_storage.get_balance}. *) + val get_balance : context -> t -> Tez.t tzresult Lwt.t + + val get_balance_carbonated : context -> t -> (context * Tez.t) tzresult Lwt.t + + val get_frozen_bonds : context -> t -> Tez.t tzresult Lwt.t + + val get_balance_and_frozen_bonds : context -> t -> Tez.t tzresult Lwt.t + + (** Functions related to implicit accounts. *) + + (** See {!Contract_manager_storage.get_manager_key}. *) + val get_manager_key : + ?error:error -> context -> public_key_hash -> public_key tzresult Lwt.t + + (** See {!Contract_manager_storage.is_manager_key_revealed}. *) + val is_manager_key_revealed : + context -> public_key_hash -> bool tzresult Lwt.t + + (** See {!Contract_manager_storage.check_public_key}. *) + val check_public_key : public_key -> public_key_hash -> unit tzresult + + (** See {!Contract_manager_storage.reveal_manager_key}. *) + val reveal_manager_key : + ?check_consistency:bool -> + context -> + public_key_hash -> + public_key -> + context tzresult Lwt.t + + val get_counter : + context -> public_key_hash -> Manager_counter.t tzresult Lwt.t + + val increment_counter : context -> public_key_hash -> context tzresult Lwt.t + + val check_counter_increment : + context -> public_key_hash -> Manager_counter.t -> unit tzresult Lwt.t + + (** See {!Contract_storage.check_allocated_and_get_balance}. *) + val check_allocated_and_get_balance : + context -> public_key_hash -> Tez.t tzresult Lwt.t + + (** See {!Contract_storage.simulate_spending}. *) + val simulate_spending : + context -> + balance:Tez.t -> + amount:Tez.t -> + public_key_hash -> + (Tez.t * bool) tzresult Lwt.t + + (** Functions related to smart contracts. *) + + val get_script_code : + context -> + Contract_hash.t -> + (context * Script.lazy_expr option) tzresult Lwt.t + + val get_script : + context -> Contract_hash.t -> (context * Script.t option) tzresult Lwt.t + + val get_storage : + context -> Contract_hash.t -> (context * Script.expr option) tzresult Lwt.t + + val used_storage_space : context -> t -> Z.t tzresult Lwt.t + + val paid_storage_space : context -> t -> Z.t tzresult Lwt.t + + val increase_paid_storage : + context -> Contract_hash.t -> amount_in_bytes:Z.t -> context tzresult Lwt.t + + val fresh_contract_from_current_nonce : + context -> (context * Contract_hash.t) tzresult + + val originated_from_current_nonce : + since:context -> until:context -> Contract_hash.t list tzresult Lwt.t + + val update_script_storage : + context -> + Contract_hash.t -> + Script.expr -> + Lazy_storage.diffs option -> + context tzresult Lwt.t + + val raw_originate : + context -> + prepaid_bootstrap_storage:bool -> + Contract_hash.t -> + script:Script.t * Lazy_storage.diffs option -> + context tzresult Lwt.t + + module Legacy_big_map_diff : sig + type item = private + | Update of { + big_map : Z.t; + diff_key : Script.expr; + diff_key_hash : Script_expr_hash.t; + diff_value : Script.expr option; + } + | Clear of Z.t + | Copy of {src : Z.t; dst : Z.t} + | Alloc of { + big_map : Z.t; + key_type : Script.expr; + value_type : Script.expr; + } + + type t = private item list + + val of_lazy_storage_diff : Lazy_storage.diffs -> t + end + + (** Functions for handling the delegate of a contract.*) + module Delegate : sig + (** See {!Contract_delegate_storage.find}. *) + val find : context -> t -> public_key_hash option tzresult Lwt.t + + (** See {!Delegate_storage.Contract.init}. *) + val init : context -> t -> public_key_hash -> context tzresult Lwt.t + + (** See {!Delegate_storage.Contract.set}. *) + val set : context -> t -> public_key_hash option -> context tzresult Lwt.t + end + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + (** See {!Contract_repr.originated_contract}. *) + val originated_contract : Origination_nonce.Internal_for_tests.t -> t + + val paid_storage_space : context -> t -> Z.t tzresult Lwt.t + end +end + +(** This module re-exports definitions from {!Tx_rollup_level_repr}. *) +module Tx_rollup_level : sig + include BASIC_DATA + + type level = t + + val rpc_arg : level RPC_arg.arg + + val diff : level -> level -> int32 + + val root : level + + val succ : level -> level + + val pred : level -> level option + + val to_int32 : level -> int32 + + val of_int32 : int32 -> level tzresult +end + +(** This module re-exports definitions from {!Tx_rollup_repr} and + {!Tx_rollup_storage}. *) +module Tx_rollup : sig + include BASIC_DATA + + val in_memory_size : t -> Cache_memory_helpers.sint + + val rpc_arg : t RPC_arg.arg + + val to_b58check : t -> string + + val of_b58check : string -> t tzresult + + val of_b58check_opt : string -> t option + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val originate : context -> (context * t) tzresult Lwt.t + + module Set : Set.S with type elt = t + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + (** See {!Tx_rollup_repr.originated_tx_rollup}. *) + val originated_tx_rollup : Origination_nonce.Internal_for_tests.t -> t + end +end + +(** This module re-exports definitions from {!Tx_rollup_withdraw_repr}. *) +module Tx_rollup_withdraw : sig + type order = { + claimer : public_key_hash; + ticket_hash : Ticket_hash.t; + amount : Tx_rollup_l2_qty.t; + } + + type t = order + + val encoding : t Data_encoding.t +end + +(** This module re-exports definitions from + {!Tx_rollup_withdraw_list_hash_repr}. *) +module Tx_rollup_withdraw_list_hash : sig + include S.HASH + + val hash_uncarbonated : Tx_rollup_withdraw.t list -> t + + val empty : t +end + +(** This module re-exports definitions from {!Tx_rollup_message_result_repr}. *) +module Tx_rollup_message_result : sig + type t = { + context_hash : Context_hash.t; + withdraw_list_hash : Tx_rollup_withdraw_list_hash.t; + } + + val encoding : t Data_encoding.t + + val empty_l2_context_hash : Context_hash.t + + val init : t +end + +(** This module re-exports definitions from + {!Tx_rollup_message_result_hash_repr}. *) +module Tx_rollup_message_result_hash : sig + include S.HASH + + val hash_uncarbonated : Tx_rollup_message_result.t -> t + + val init : t +end + +(** This module re-exports definitions from {!Tx_rollup_commitment_repr.Hash}. +*) +module Tx_rollup_commitment_hash : sig + val commitment_hash : string + + include S.HASH +end + +(** This module re-exports definitions from {!Tx_rollup_state_repr} + and {!Tx_rollup_state_storage}. *) +module Tx_rollup_state : sig + type t + + val initial_state : pre_allocated_storage:Z.t -> t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val find : context -> Tx_rollup.t -> (context * t option) tzresult Lwt.t + + val get : context -> Tx_rollup.t -> (context * t) tzresult Lwt.t + + val update : context -> Tx_rollup.t -> t -> context tzresult Lwt.t + + val burn_cost : limit:Tez.t option -> t -> int -> Tez.t tzresult + + val assert_exist : context -> Tx_rollup.t -> context tzresult Lwt.t + + val head_levels : t -> (Tx_rollup_level.t * Raw_level.t) option + + val check_level_can_be_rejected : t -> Tx_rollup_level.t -> unit tzresult + + val last_removed_commitment_hashes : + t -> (Tx_rollup_message_result_hash.t * Tx_rollup_commitment_hash.t) option + + val adjust_storage_allocation : t -> delta:Z.t -> (t * Z.t) tzresult + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + val make : + ?burn_per_byte:Tez.t -> + ?inbox_ema:int -> + ?last_removed_commitment_hashes: + Tx_rollup_message_result_hash.t * Tx_rollup_commitment_hash.t -> + ?finalized_commitments:Tx_rollup_level.t * Tx_rollup_level.t -> + ?unfinalized_commitments:Tx_rollup_level.t * Tx_rollup_level.t -> + ?uncommitted_inboxes:Tx_rollup_level.t * Tx_rollup_level.t -> + ?commitment_newest_hash:Tx_rollup_commitment_hash.t -> + ?tezos_head_level:Raw_level.t -> + ?occupied_storage:Z.t -> + ?commitments_watermark:Tx_rollup_level.t -> + allocated_storage:Z.t -> + unit -> + t + + val update_burn_per_byte : + t -> elapsed:int -> factor:int -> final_size:int -> hard_limit:int -> t + + val get_inbox_ema : t -> int + + val record_inbox_deletion : t -> Tx_rollup_level.t -> t tzresult + + val get_occupied_storage : t -> Z.t + + val set_occupied_storage : Z.t -> t -> t + + val get_allocated_storage : t -> Z.t + + val set_allocated_storage : Z.t -> t -> t + + val next_commitment_level : t -> Raw_level.t -> Tx_rollup_level.t tzresult + + val uncommitted_inboxes_count : t -> int + + val reset_commitments_watermark : t -> t + + val get_commitments_watermark : t -> Tx_rollup_level.t option + end +end + +(** This module re-exports definitions from {!Tx_rollup_reveal_repr} and + {!Tx_rollup_reveal_storage}. *) +module Tx_rollup_reveal : sig + type t = { + contents : Script.lazy_expr; + ty : Script.lazy_expr; + ticketer : Contract.t; + amount : Tx_rollup_l2_qty.t; + claimer : public_key_hash; + } + + val encoding : t Data_encoding.t + + val record : + context -> + Tx_rollup.t -> + Tx_rollup_level.t -> + message_position:int -> + context tzresult Lwt.t + + val mem : + context -> + Tx_rollup.t -> + Tx_rollup_level.t -> + message_position:int -> + (context * bool) tzresult Lwt.t + + val remove : + context -> Tx_rollup.t -> Tx_rollup_level.t -> context tzresult Lwt.t +end + +(** This module re-exports definitions from {!Tx_rollup_message_repr}. *) +module Tx_rollup_message : sig + type deposit = { + sender : public_key_hash; + destination : Tx_rollup_l2_address.Indexable.value; + ticket_hash : Ticket_hash.t; + amount : Tx_rollup_l2_qty.t; + } + + type t = private Batch of string | Deposit of deposit + + (** [make_batch batch] creates a new [Batch] message to be added that can be + added to an inbox, along with its size in bytes. See + {!Tx_rollup_message_repr.size}. *) + val make_batch : string -> t * int + + (** [make_deposit destination ticket_hash qty] creates a new + [Deposit] message to be added that can be added to an inbox, + along with its size in bytes. See + {!Tx_rollup_message_repr.size}. *) + val make_deposit : + public_key_hash -> + Tx_rollup_l2_address.t Indexable.value -> + Ticket_hash.t -> + Tx_rollup_l2_qty.t -> + t * int + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +(** This module re-exports definitions from {!Tx_rollup_message_hash_repr}. *) +module Tx_rollup_message_hash : sig + include S.HASH + + val hash_uncarbonated : Tx_rollup_message.t -> t +end + +(** This module re-exports definitions from {!Tx_rollup_inbox_repr} and + {!Tx_rollup_inbox_storage}. *) +module Tx_rollup_inbox : sig + module Merkle : sig + type root + + type path + + val path_encoding : path Data_encoding.t + + val root_encoding : root Data_encoding.t + + val root_of_b58check_opt : string -> root option + + val compute_path : Tx_rollup_message_hash.t list -> int -> path tzresult + + val merklize_list : Tx_rollup_message_hash.t list -> root + + val path_depth : path -> int + end + + type t = {inbox_length : int; cumulated_size : int; merkle_root : Merkle.root} + + val size : Z.t + + val ( = ) : t -> t -> bool + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val append_message : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Tx_rollup_message.t -> + (context * Tx_rollup_state.t * Z.t) tzresult Lwt.t + + val get : + context -> Tx_rollup_level.t -> Tx_rollup.t -> (context * t) tzresult Lwt.t + + val find : + context -> + Tx_rollup_level.t -> + Tx_rollup.t -> + (context * t option) tzresult Lwt.t + + val check_message_hash : + context -> + Tx_rollup_level.t -> + Tx_rollup.t -> + position:int -> + Tx_rollup_message.t -> + Merkle.path -> + context tzresult Lwt.t +end + +(** This module re-exports definitions from {!Tx_rollup_commitment_repr}. *) +module Tx_rollup_commitment : sig + module Merkle_hash : S.HASH + + module Merkle : + Merkle_list.T + with type elt = Tx_rollup_message_result_hash.t + and type h = Merkle_hash.t + + type 'a template = { + level : Tx_rollup_level.t; + messages : 'a; + predecessor : Tx_rollup_commitment_hash.t option; + inbox_merkle_root : Tx_rollup_inbox.Merkle.root; + } + + module Compact : sig + type excerpt = { + count : int; + root : Merkle.h; + last_result_message_hash : Tx_rollup_message_result_hash.t; + } + + type t = excerpt template + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val hash : t -> Tx_rollup_commitment_hash.t + end + + module Submitted_commitment : sig + type nonrec t = { + commitment : Compact.t; + commitment_hash : Tx_rollup_commitment_hash.t; + committer : public_key_hash; + submitted_at : Raw_level.t; + finalized_at : Raw_level.t option; + } + + val encoding : t Data_encoding.t + end + + module Full : sig + type t = Tx_rollup_message_result_hash.t list template + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val compact : t -> Compact.t + end + + val check_message_result : + context -> + Compact.t -> + [ `Hash of Tx_rollup_message_result_hash.t + | `Result of Tx_rollup_message_result.t ] -> + path:Merkle.path -> + index:int -> + context tzresult + + val add_commitment : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + public_key_hash -> + Full.t -> + (context * Tx_rollup_state.t * public_key_hash option) tzresult Lwt.t + + val find : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Tx_rollup_level.t -> + (context * Submitted_commitment.t option) tzresult Lwt.t + + val get : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Tx_rollup_level.t -> + (context * Submitted_commitment.t) tzresult Lwt.t + + val check_agreed_and_disputed_results : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Submitted_commitment.t -> + agreed_result:Tx_rollup_message_result.t -> + agreed_result_path:Merkle.path -> + disputed_result:Tx_rollup_message_result_hash.t -> + disputed_position:int -> + disputed_result_path:Merkle.path -> + context tzresult Lwt.t + + val get_finalized : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Tx_rollup_level.t -> + (context * Submitted_commitment.t) tzresult Lwt.t + + val pending_bonded_commitments : + context -> Tx_rollup.t -> public_key_hash -> (context * int) tzresult Lwt.t + + val has_bond : + context -> Tx_rollup.t -> public_key_hash -> (context * bool) tzresult Lwt.t + + val finalize_commitment : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + (context * Tx_rollup_state.t * Tx_rollup_level.t) tzresult Lwt.t + + val remove_commitment : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + (context * Tx_rollup_state.t * Tx_rollup_level.t) tzresult Lwt.t + + val remove_bond : + context -> Tx_rollup.t -> public_key_hash -> context tzresult Lwt.t + + val slash_bond : + context -> Tx_rollup.t -> public_key_hash -> (context * bool) tzresult Lwt.t + + val reject_commitment : + context -> + Tx_rollup.t -> + Tx_rollup_state.t -> + Tx_rollup_level.t -> + (context * Tx_rollup_state.t) tzresult Lwt.t +end + +(** This module re-exports definitions from {!Tx_rollup_hash_builder}. *) +module Tx_rollup_hash : sig + val message_result : + context -> + Tx_rollup_message_result.t -> + (context * Tx_rollup_message_result_hash.t) tzresult + + val compact_commitment : + context -> + Tx_rollup_commitment.Compact.t -> + (context * Tx_rollup_commitment_hash.t) tzresult + + val withdraw_list : + context -> + Tx_rollup_withdraw.t list -> + (context * Tx_rollup_withdraw_list_hash.t) tzresult +end + +(** This module re-exports definitions from {!Tx_rollup_errors_repr}. *) +module Tx_rollup_errors : sig + type error += + | Tx_rollup_already_exists of Tx_rollup.t + | Tx_rollup_does_not_exist of Tx_rollup.t + | Submit_batch_burn_exceeded of {burn : Tez.t; limit : Tez.t} + | Inbox_does_not_exist of Tx_rollup.t * Tx_rollup_level.t + | Inbox_size_would_exceed_limit of Tx_rollup.t + | Inbox_count_would_exceed_limit of Tx_rollup.t + | Message_size_exceeds_limit + | Too_many_inboxes + | Too_many_commitments + | Too_many_withdrawals + | Wrong_batch_count + | Commitment_too_early of { + provided : Tx_rollup_level.t; + expected : Tx_rollup_level.t; + } + | Level_already_has_commitment of Tx_rollup_level.t + | Wrong_inbox_hash + | Bond_does_not_exist of public_key_hash + | Bond_in_use of public_key_hash + | No_uncommitted_inbox + | No_commitment_to_finalize + | No_commitment_to_remove + | Invalid_committer + | Remove_commitment_too_early + | Commitment_does_not_exist of Tx_rollup_level.t + | Wrong_predecessor_hash of { + provided : Tx_rollup_commitment_hash.t option; + expected : Tx_rollup_commitment_hash.t option; + } + | Internal_error of string + | Wrong_message_position of { + level : Tx_rollup_level.t; + position : int; + length : int; + } + | Wrong_path_depth of { + kind : [`Inbox | `Commitment]; + provided : int; + limit : int; + } + | Wrong_message_path of {expected : Tx_rollup_inbox.Merkle.root} + | No_finalized_commitment_for_level of { + level : Tx_rollup_level.t; + window : (Tx_rollup_level.t * Tx_rollup_level.t) option; + } + | Withdraw_invalid_path + | Withdraw_already_consumed + | Withdrawals_invalid_path + | Withdrawals_already_dispatched + | Cannot_reject_level of { + provided : Tx_rollup_level.t; + accepted_range : (Tx_rollup_level.t * Tx_rollup_level.t) option; + } + | Wrong_rejection_hash of { + provided : Tx_rollup_message_result_hash.t; + expected : + [ `Valid_path of Tx_rollup_commitment.Merkle.h * int + | `Hash of Tx_rollup_message_result_hash.t ]; + } + | Proof_undecodable + | Proof_failed_to_reject + | Proof_produced_rejected_state + | Proof_invalid_before of { + agreed : Context_hash.t; + provided : Context_hash.t; + } + | No_withdrawals_to_dispatch + + val check_path_depth : + [`Inbox | `Commitment] -> int -> count_limit:int -> unit tzresult +end + +(** This is a forward declaration to avoid circular dependencies. + Use module [Sc_rollup] instead whenever possible. + TODO : find a better way to resolve the circular dependency + https://gitlab.com/tezos/tezos/-/issues/3147 *) +module Sc_rollup_repr : sig + module Address : S.HASH + + type t = Address.t +end + +(** This module re-exports definitions from {!Bond_id_repr}. *) +module Bond_id : sig + type t = + | Tx_rollup_bond_id of Tx_rollup.t + | Sc_rollup_bond_id of Sc_rollup_repr.t + + val pp : Format.formatter -> t -> unit + + val compare : t -> t -> int + + (** This module discloses definitions that are only useful for tests and must + not be used otherwise. *) + module Internal_for_tests : sig + val fold_on_bond_ids : + context -> + Contract.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(t -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + end +end + +(** This module re-exports definitions from {!Zk_rollup_repr} and + {!Zk_rollup_storage}. *) +module Zk_rollup : sig + module Address : S.HASH + + type t = Address.t + + type scalar := Bls.Primitive.Fr.t + + val to_scalar : t -> scalar + + (** This module re-exports definitions from {!Zk_rollup_state_repr}. *) + module State : sig + type t = scalar array + + val encoding : t Data_encoding.t + end + + (** This module re-exports definitions from {!Zk_rollup_account_repr}. *) + module Account : sig + module SMap : Map.S with type key = string + + type static = { + public_parameters : Plonk.public_parameters; + state_length : int; + circuits_info : [`Public | `Private | `Fee] SMap.t; + nb_ops : int; + } + + type dynamic = { + state : State.t; + paid_l2_operations_storage_space : Z.t; + used_l2_operations_storage_space : Z.t; + } + + type t = {static : static; dynamic : dynamic} + + val encoding : t Data_encoding.t + + val circuits_info_encoding : + [`Public | `Private | `Fee] SMap.t Data_encoding.t + end + + (** This module re-exports definitions from {!Zk_rollup_operation_repr}. *) + module Operation : sig + type price = {id : Ticket_hash.t; amount : Z.t} + + type t = { + op_code : int; + price : price; + l1_dst : Signature.Public_key_hash.t; + rollup_id : Address.t; + payload : scalar array; + } + + val encoding : t Data_encoding.t + + val to_scalar_array : t -> scalar array + end + + module Ticket : sig + type t = {contents : Script.expr; ty : Script.expr; ticketer : Contract.t} + + val encoding : t Data_encoding.t + end + + module Circuit_public_inputs : sig + type pending_op_public_inputs = { + old_state : State.t; + new_state : State.t; + fee : scalar; + exit_validity : bool; + zk_rollup : t; + l2_op : Operation.t; + } + + type private_batch_public_inputs = { + old_state : State.t; + new_state : State.t; + fees : scalar; + zk_rollup : t; + } + + type fee_public_inputs = { + old_state : State.t; + new_state : State.t; + fees : scalar; + } + + type t = + | Pending_op of pending_op_public_inputs + | Private_batch of private_batch_public_inputs + | Fee of fee_public_inputs + + val to_scalar_array : t -> scalar array + end + + module Update : sig + type op_pi = {new_state : State.t; fee : scalar; exit_validity : bool} + + type private_inner_pi = {new_state : State.t; fees : scalar} + + type fee_pi = {new_state : State.t} + + type t = { + pending_pis : (string * op_pi) list; + private_pis : (string * private_inner_pi) list; + fee_pi : fee_pi; + proof : Plonk.proof; + } + + val encoding : t Data_encoding.t + end + + type pending_list = + | Empty of {next_index : int64} + | Pending of {next_index : int64; length : int} + + val pending_list_encoding : pending_list Data_encoding.t + + val in_memory_size : t -> Cache_memory_helpers.sint + + val originate : + context -> + Account.static -> + init_state:State.t -> + (context * Address.t * Z.t) tzresult Lwt.t + + val add_to_pending : + context -> + Address.t -> + (Operation.t * Ticket_hash.t option) list -> + (context * Z.t) tzresult Lwt.t + + val get_pending_length : + context -> Address.t -> (context * int) tzresult Lwt.t + + val get_prefix : + context -> + Address.t -> + int -> + (context * (Operation.t * Ticket_hash.t option) list) tzresult Lwt.t + + val update : + context -> + Address.t -> + pending_to_drop:int -> + new_account:Account.t -> + context tzresult Lwt.t + + val account : context -> t -> (context * Account.t) tzresult Lwt.t + + val pending_list : context -> t -> (context * pending_list) tzresult Lwt.t + + val pending_op : + context -> + t -> + Int64.t -> + (context * (Operation.t * Ticket_hash.t option)) tzresult Lwt.t + + val assert_exist : context -> t -> context tzresult Lwt.t + + val exists : context -> t -> (context * bool) tzresult Lwt.t + + module Errors : sig + type error += + | Deposit_as_external + | Invalid_deposit_amount + | Invalid_deposit_ticket + | Wrong_deposit_parameters + | Ticket_payload_size_limit_exceeded of { + payload_size : Saturation_repr.may_saturate Saturation_repr.t; + limit : int; + } + | Invalid_verification + | Invalid_circuit + | Inconsistent_state_update + | Pending_bound + end + + module Internal_for_tests : sig + val originated_zk_rollup : Origination_nonce.Internal_for_tests.t -> t + end +end + +(** This module re-exports definitions from {!Receipt_repr}. *) +module Receipt : sig + type balance = + | Contract of Contract.t + | Block_fees + | Deposits of public_key_hash + | Nonce_revelation_rewards + | Double_signing_evidence_rewards + | Endorsing_rewards + | Baking_rewards + | Baking_bonuses + | Storage_fees + | Double_signing_punishments + | Lost_endorsing_rewards of public_key_hash * bool * bool + | Liquidity_baking_subsidies + | Burned + | Commitments of Blinded_public_key_hash.t + | Bootstrap + | Invoice + | Initial_commitments + | Minted + | Frozen_bonds of Contract.t * Bond_id.t + | Tx_rollup_rejection_punishments + | Tx_rollup_rejection_rewards + | Sc_rollup_refutation_punishments + | Sc_rollup_refutation_rewards + + val compare_balance : balance -> balance -> int + + type balance_update = Debited of Tez.t | Credited of Tez.t + + type update_origin = + | Block_application + | Protocol_migration + | Subsidy + | Simulation + + val compare_update_origin : update_origin -> update_origin -> int + + type balance_updates = (balance * balance_update * update_origin) list + + val balance_updates_encoding : balance_updates Data_encoding.t + + val group_balance_updates : balance_updates -> balance_updates tzresult +end + +(** This module re-exports definitions from {!Delegate_consensus_key}. *) +module Consensus_key : sig + type pk = { + delegate : Signature.Public_key_hash.t; + consensus_pk : Signature.Public_key.t; + consensus_pkh : Signature.Public_key_hash.t; + } + + type t = { + delegate : Signature.Public_key_hash.t; + consensus_pkh : Signature.Public_key_hash.t; + } + + val zero : t + + val pp : Format.formatter -> t -> unit + + val pkh : pk -> t +end + +(** This module re-exports definitions from {!Delegate_storage}, + {!Delegate_consensus_key}, {!Delegate_missed_endorsements_storage}, + {!Delegate_slashed_deposits_storage}, {!Delegate_cycles}. *) +module Delegate : sig + val check_not_tz4 : Signature.public_key_hash -> unit tzresult + + val frozen_deposits_limit : + context -> public_key_hash -> Tez.t option tzresult Lwt.t + + val set_frozen_deposits_limit : + context -> public_key_hash -> Tez.t option -> context Lwt.t + + val fold : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(public_key_hash -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + val list : context -> public_key_hash list Lwt.t + + val drain : + context -> + delegate:public_key_hash -> + destination:public_key_hash -> + (context * bool * Tez.t * Receipt.balance_updates) tzresult Lwt.t + + type participation_info = { + expected_cycle_activity : int; + minimal_cycle_activity : int; + missed_slots : int; + missed_levels : int; + remaining_allowed_missed_slots : int; + expected_endorsing_rewards : Tez.t; + } + + val participation_info : + context -> public_key_hash -> participation_info tzresult Lwt.t + + val cycle_end : + context -> + Cycle.t -> + (context * Receipt.balance_updates * public_key_hash list) tzresult Lwt.t + + val already_slashed_for_double_endorsing : + context -> public_key_hash -> Level.t -> bool tzresult Lwt.t + + val already_slashed_for_double_baking : + context -> public_key_hash -> Level.t -> bool tzresult Lwt.t + + val punish_double_endorsing : + context -> + public_key_hash -> + Level.t -> + (context * Tez.t * Receipt.balance_updates) tzresult Lwt.t + + val punish_double_baking : + context -> + public_key_hash -> + Level.t -> + (context * Tez.t * Receipt.balance_updates) tzresult Lwt.t + + val full_balance : context -> public_key_hash -> Tez.t tzresult Lwt.t + + type level_participation = Participated | Didn't_participate + + val record_baking_activity_and_pay_rewards_and_fees : + context -> + payload_producer:public_key_hash -> + block_producer:public_key_hash -> + baking_reward:Tez.t -> + reward_bonus:Tez.t option -> + (context * Receipt.balance_updates) tzresult Lwt.t + + val record_endorsing_participation : + context -> + delegate:public_key_hash -> + participation:level_participation -> + endorsing_power:int -> + context tzresult Lwt.t + + type deposits = {initial_amount : Tez.t; current_amount : Tez.t} + + val frozen_deposits : context -> public_key_hash -> deposits tzresult Lwt.t + + val staking_balance : context -> public_key_hash -> Tez.t tzresult Lwt.t + + (** See {!Contract_delegate_storage.delegated_contracts}. *) + val delegated_contracts : context -> public_key_hash -> Contract.t list Lwt.t + + val delegated_balance : context -> public_key_hash -> Tez.t tzresult Lwt.t + + val registered : context -> public_key_hash -> bool Lwt.t + + val deactivated : context -> public_key_hash -> bool tzresult Lwt.t + + (** See {!Delegate_activation_storage.last_cycle_before_deactivation}. *) + val last_cycle_before_deactivation : + context -> public_key_hash -> Cycle.t tzresult Lwt.t + + module Consensus_key : sig + val check_not_tz4 : Signature.public_key -> unit tzresult + + val active_pubkey : + context -> public_key_hash -> Consensus_key.pk tzresult Lwt.t + + val pending_updates : + context -> + public_key_hash -> + (Cycle.t * public_key_hash) list tzresult Lwt.t + + val register_update : + context -> public_key_hash -> public_key -> context tzresult Lwt.t + end + + (** See {!Stake_storage.prepare_stake_distribution}. *) + val prepare_stake_distribution : context -> context tzresult Lwt.t +end + +(** This module re-exports definitions from {!Voting_period_repr} and + {!Voting_period_storage}. *) +module Voting_period : sig + type kind = Proposal | Exploration | Cooldown | Promotion | Adoption + + val kind_encoding : kind Data_encoding.encoding + + val pp_kind : Format.formatter -> kind -> unit + + (* This type should be abstract *) + type voting_period = private { + index : int32; + kind : kind; + start_position : int32; + } + + type t = voting_period + + include BASIC_DATA with type t := t + + val encoding : voting_period Data_encoding.t + + val pp : Format.formatter -> voting_period -> unit + + val reset : context -> context tzresult Lwt.t + + val succ : context -> context tzresult Lwt.t + + val get_current : context -> voting_period tzresult Lwt.t + + val get_current_kind : context -> kind tzresult Lwt.t + + val is_last_block : context -> bool tzresult Lwt.t + + type info = {voting_period : t; position : int32; remaining : int32} + + val info_encoding : info Data_encoding.t + + val pp_info : Format.formatter -> info -> unit + + val get_rpc_current_info : context -> info tzresult Lwt.t + + val get_rpc_succ_info : context -> info tzresult Lwt.t + + module Testnet_dictator : sig + (** See {!Voting_period_storage.Testnet_dictator.overwrite_current_kind}. *) + val overwrite_current_kind : + context -> Chain_id.t -> Voting_period_repr.kind -> context tzresult Lwt.t + end +end + +(** This module re-exports definitions from {!Vote_repr} and {!Vote_storage}. *) +module Vote : sig + type proposal = Protocol_hash.t + + (** See {!Vote_storage.get_delegate_proposal_count}. *) + val get_delegate_proposal_count : + context -> public_key_hash -> int tzresult Lwt.t + + (** See {!Vote_storage.set_delegate_proposal_count}. *) + val set_delegate_proposal_count : + context -> public_key_hash -> int -> context Lwt.t + + (** See {!Vote_storage.has_proposed}. *) + val has_proposed : context -> public_key_hash -> proposal -> bool Lwt.t + + (** See {!Vote_storage.add_proposal}. *) + val add_proposal : context -> public_key_hash -> proposal -> context Lwt.t + + val get_proposals : context -> int64 Protocol_hash.Map.t tzresult Lwt.t + + val clear_proposals : context -> context Lwt.t + + val listings_encoding : (public_key_hash * int64) list Data_encoding.t + + val update_listings : context -> context tzresult Lwt.t + + val in_listings : context -> public_key_hash -> bool Lwt.t + + val get_listings : context -> (public_key_hash * int64) list Lwt.t + + type ballot = Yay | Nay | Pass + + val equal_ballot : ballot -> ballot -> bool + + val pp_ballot : Format.formatter -> ballot -> unit + + type delegate_info = { + voting_power : Int64.t option; + current_ballot : ballot option; + current_proposals : Protocol_hash.t list; + remaining_proposals : int; + } + + val pp_delegate_info : Format.formatter -> delegate_info -> unit + + val delegate_info_encoding : delegate_info Data_encoding.t + + val get_delegate_info : + context -> public_key_hash -> delegate_info tzresult Lwt.t + + val get_voting_power_free : context -> public_key_hash -> int64 tzresult Lwt.t + + val get_voting_power : + context -> public_key_hash -> (context * int64) tzresult Lwt.t + + val get_total_voting_power_free : context -> int64 tzresult Lwt.t + + val get_total_voting_power : context -> (context * int64) tzresult Lwt.t + + val ballot_encoding : ballot Data_encoding.t + + type ballots = {yay : int64; nay : int64; pass : int64} + + (** See {!Vote_storage.ballots_zero}. *) + val ballots_zero : ballots + + (** See {!Vote_storage.ballots_encoding} *) + val ballots_encoding : ballots Data_encoding.t + + (** See {!Vote_storage.equal_ballots}. *) + val equal_ballots : ballots -> ballots -> bool + + (** See {!Vote_storage.pp_ballots}. *) + val pp_ballots : Format.formatter -> ballots -> unit + + val has_recorded_ballot : context -> public_key_hash -> bool Lwt.t + + val record_ballot : + context -> public_key_hash -> ballot -> context tzresult Lwt.t + + val get_ballots : context -> ballots tzresult Lwt.t + + val get_ballot_list : context -> (public_key_hash * ballot) list Lwt.t + + val clear_ballots : context -> context Lwt.t + + val get_current_quorum : context -> int32 tzresult Lwt.t + + val get_participation_ema : context -> int32 tzresult Lwt.t + + val set_participation_ema : context -> int32 -> context tzresult Lwt.t + + (** See {!Vote_storage.current_proposal_exists}. *) + val current_proposal_exists : context -> bool Lwt.t + + (** See {!Vote_storage.get_current_proposal}. *) + val get_current_proposal : context -> proposal tzresult Lwt.t + + (** See {!Vote_storage.find_current_proposal}. *) + val find_current_proposal : context -> proposal option tzresult Lwt.t + + (** See {!Vote_storage.init_current_proposal}. *) + val init_current_proposal : context -> proposal -> context tzresult Lwt.t + + (** See {!Vote_storage.clear_current_proposal}. *) + val clear_current_proposal : context -> context Lwt.t +end + +(** This module exposes definitions for the data-availability layer. *) +module Dal : sig + type parameters = Dal.parameters = { + redundancy_factor : int; + page_size : int; + slot_size : int; + number_of_shards : int; + } + + (** This module re-exports definitions from {!Dal_slot_repr.Index}. *) + module Slot_index : sig + type t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val encoding : t Data_encoding.t + + val of_int : int -> t option + + val to_int : t -> int + + val compare : t -> t -> int + + val equal : t -> t -> bool + end + + (** This module re-exports definitions from {!Dal_attestation_repr} and + {!Raw_context.Dal}. *) + module Attestation : sig + type t + + type operation = { + attestor : public_key_hash; + attestation : t; + level : Raw_level.t; + } + + type shard_index = int + + module Shard_map : Map.S with type key = shard_index + + val encoding : t Data_encoding.t + + val empty : t + + val is_attested : t -> Slot_index.t -> bool + + val occupied_size_in_bits : t -> int + + val expected_size_in_bits : max_index:Slot_index.t -> int + + val shards_of_attestor : + context -> attestor:public_key_hash -> shard_index list option + + val record_available_shards : context -> t -> int list -> context + + type committee = { + pkh_to_shards : (shard_index * int) Signature.Public_key_hash.Map.t; + shard_to_pkh : Signature.Public_key_hash.t Shard_map.t; + } + + val compute_committee : + context -> + (Slot.t -> (context * Signature.Public_key_hash.t) tzresult Lwt.t) -> + committee tzresult Lwt.t + + val init_committee : context -> committee -> context + end + + type slot_id = {published_level : Raw_level.t; index : Slot_index.t} + + module Page : sig + type content = bytes + + val pages_per_slot : parameters -> int + + module Index : sig + type t = int + + val encoding : int Data_encoding.t + + val pp : Format.formatter -> int -> unit + + val compare : int -> int -> int + + val equal : int -> int -> bool + end + + type t = {slot_id : slot_id; page_index : Index.t} + + val content_encoding : content Data_encoding.t + + type proof = Dal.page_proof + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val equal : t -> t -> bool + end + + (** This module re-exports definitions from {!Dal_slot_repr}, + {!Dal_slot_storage} and {!Raw_context.Dal}. *) + module Slot : sig + (** This module re-exports definitions from {!Dal_slot_repr.Header}. *) + module Commitment : sig + type t = Dal.commitment + + val encoding : t Data_encoding.t + + val zero : t + end + + module Commitment_proof : sig + type t = Dal.commitment_proof + + val encoding : t Data_encoding.t + + val zero : t + end + + module Header : sig + type id = slot_id = {published_level : Raw_level.t; index : Slot_index.t} + + type t = {id : id; commitment : Commitment.t} + + type operation = {header : t; proof : Commitment_proof.t} + + val id_encoding : id Data_encoding.t + + val encoding : t Data_encoding.t + + val pp_id : Format.formatter -> id -> unit + + val pp : Format.formatter -> t -> unit + + val equal : t -> t -> bool + + val verify_commitment : parameters -> operation -> bool tzresult + end + + val register_slot_header : context -> Header.t -> (context * bool) tzresult + + val find_slot_headers : + context -> Raw_level.t -> Header.t list option tzresult Lwt.t + + val finalize_current_slot_headers : context -> context Lwt.t + + val finalize_pending_slot_headers : + context -> (context * Attestation.t) tzresult Lwt.t + end + + module Slots_history : sig + type t + + type hash + + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3766 + Do we need to export this? *) + val genesis : t + + val equal : t -> t -> bool + + val encoding : t Data_encoding.t + + val hash : t -> hash + + module History_cache : + Bounded_history_repr.S with type key = hash and type value = t + + val add_confirmed_slot_headers_no_cache : + t -> Slot.Header.t list -> t tzresult + + val add_confirmed_slot_headers : + t -> + History_cache.t -> + Slot.Header.t list -> + (t * History_cache.t) tzresult + + type proof + end + + module Slots_storage : sig + val get_slot_headers_history : t -> Slots_history.t tzresult Lwt.t + end +end + +(** This module re-exports definitions from {!Dal_errors_repr}. *) +module Dal_errors : sig + (* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3168 + do not expose these errors and return them in functions + from Dal_slot_repr or Dal_attestation_repr. *) + type error += + | Dal_feature_disabled + | Dal_slot_index_above_hard_limit + | Dal_attestation_unexpected_size of {expected : int; got : int} + | Dal_publish_slot_header_future_level of { + provided : Raw_level.t; + expected : Raw_level.t; + } + | Dal_publish_slot_header_past_level of { + provided : Raw_level.t; + expected : Raw_level.t; + } + | Dal_publish_slot_header_invalid_index of { + given : Dal.Slot_index.t; + maximum : Dal.Slot_index.t; + } + | Dal_publish_slot_header_candidate_with_low_fees of {proposed_fees : Tez.t} + | Dal_attestation_size_limit_exceeded of {maximum_size : int; got : int} + | Dal_publish_slot_header_duplicate of {slot_header : Dal.Slot.Header.t} + | Dal_publish_slot_header_invalid_proof of { + slot_header : Dal.Slot.Header.operation; + } + | Dal_data_availibility_attestor_not_in_committee of { + attestor : Signature.Public_key_hash.t; + level : Level.t; + } + | Dal_operation_for_old_level of { + current : Raw_level.t; + given : Raw_level.t; + } + | Dal_operation_for_future_level of { + current : Raw_level.t; + given : Raw_level.t; + } +end + +(** This module re-exports definitions from {!Sc_rollup_storage} and + {!Sc_rollup_repr}. *) +module Sc_rollup : sig + (** See {!Sc_rollup_tick_repr}. *) + module Tick : sig + type t + + val initial : t + + val next : t -> t + + val jump : t -> Z.t -> t + + val distance : t -> t -> Z.t + + val of_int : int -> t option + + val to_int : t -> int option + + val of_z : Z.t -> t + + val to_z : t -> Z.t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + include Compare.S with type t := t + + module Map : Map.S with type key = t + end + + module Address = Sc_rollup_repr.Address + + type t = Sc_rollup_repr.t + + type rollup := t + + val in_memory_size : t -> Cache_memory_helpers.sint + + module Staker : S.SIGNATURE_PUBLIC_KEY_HASH with type t = public_key_hash + + module State_hash : sig + include S.HASH + + val context_hash_to_state_hash : Context_hash.t -> t + + type unreachable = | + + val hash_bytes : unreachable -> t + + val hash_string : unreachable -> t + end + + (** See {!Sc_rollup_metadata_repr}. *) + module Metadata : sig + type t = {address : rollup; origination_level : Raw_level.t} + + val pp : Format.formatter -> t -> unit + + val equal : t -> t -> bool + + val encoding : t Data_encoding.t + end + + (** See {!Sc_rollup_inbox_message_repr}. *) + module Inbox_message : sig + type internal_inbox_message = + | Transfer of { + payload : Script.expr; + sender : Contract_hash.t; + source : public_key_hash; + destination : t; + } + | Start_of_level + | End_of_level + | Info_per_level of { + predecessor_timestamp : Time.t; + predecessor : Block_hash.t; + } + + type t = Internal of internal_inbox_message | External of string + + type serialized + + val encoding : t Data_encoding.t + + val unsafe_of_string : string -> serialized + + val unsafe_to_string : serialized -> string + + val serialize : t -> serialized tzresult + + val deserialize : serialized -> t tzresult + + module Hash : S.HASH + + val hash_serialized_message : serialized -> Hash.t + end + + module Inbox_merkelized_payload_hashes : sig + module Hash : S.HASH + + type t + + val encoding : t Data_encoding.t + + val equal : t -> t -> bool + + val hash : t -> Hash.t + + val get_payload_hash : t -> Inbox_message.Hash.t + + val get_index : t -> Z.t + + type merkelized_and_payload = { + merkelized : t; + payload : Inbox_message.serialized; + } + + module History : sig + include + Bounded_history_repr.S + with type key = Hash.t + and type value = merkelized_and_payload + + val no_history : t + end + + val genesis : + History.t -> Inbox_message.serialized -> (History.t * t) tzresult + + val add_payload : + History.t -> t -> Inbox_message.serialized -> (History.t * t) tzresult + + type proof + + val proof_encoding : proof Data_encoding.t + + val produce_proof : + History.t -> index:Z.t -> t -> (merkelized_and_payload * proof) option + + val verify_proof : proof -> (t * t) tzresult + + module Internal_for_tests : sig + val find_predecessor_payload : History.t -> index:Z.t -> t -> t option + end + end + + type inbox_message = { + inbox_level : Raw_level.t; + message_counter : Z.t; + payload : Inbox_message.serialized; + } + + type reveal_data = + | Raw_data of string + | Metadata of Metadata.t + | Dal_page of Dal.Page.content option + + type input = Inbox_message of inbox_message | Reveal of reveal_data + + val pp_inbox_message : Format.formatter -> inbox_message -> unit + + val inbox_message_equal : inbox_message -> inbox_message -> bool + + val pp_reveal_data : Format.formatter -> reveal_data -> unit + + val pp_input : Format.formatter -> input -> unit + + val input_equal : input -> input -> bool + + val input_encoding : input Data_encoding.t + + module Input_hash : S.HASH + + type reveal = + | Reveal_raw_data of Sc_rollup_reveal_hash.t + | Reveal_metadata + | Request_dal_page of Dal.Page.t + + type input_request = + | No_input_required + | Initial + | First_after of Raw_level.t * Z.t + | Needs_reveal of reveal + + val input_request_encoding : input_request Data_encoding.t + + val input_request_equal : input_request -> input_request -> bool + + val pp_input_request : Format.formatter -> input_request -> unit + + module Inbox : sig + type t + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val equal : t -> t -> bool + + val inbox_level : t -> Raw_level.t + + type history_proof + + val old_levels_messages : t -> history_proof + + val equal_history_proof : history_proof -> history_proof -> bool + + val pp_history_proof : Format.formatter -> history_proof -> unit + + module Hash : S.HASH + + module History : + Bounded_history_repr.S + with type key = Hash.t + and type value = history_proof + + type level_proof = private { + hash : Inbox_merkelized_payload_hashes.Hash.t; + level : Raw_level.t; + } + + val current_level_proof : t -> level_proof + + type serialized_proof + + val serialized_proof_encoding : serialized_proof Data_encoding.t + + val add_all_messages : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + History.t -> + t -> + Inbox_message.t list -> + (Inbox_merkelized_payload_hashes.History.t + * History.t + * t + * Inbox_merkelized_payload_hashes.t + * Inbox_message.t list) + tzresult + + val add_messages_no_history : + Inbox_message.serialized list -> + Inbox_merkelized_payload_hashes.t -> + Inbox_merkelized_payload_hashes.t tzresult + + val take_snapshot : t -> history_proof + + type inclusion_proof + + val inclusion_proof_encoding : inclusion_proof Data_encoding.t + + val pp_inclusion_proof : Format.formatter -> inclusion_proof -> unit + + val number_of_proof_steps : inclusion_proof -> int + + val verify_inclusion_proof : + inclusion_proof -> history_proof -> history_proof tzresult + + type proof + + val pp_proof : Format.formatter -> proof -> unit + + val to_serialized_proof : proof -> serialized_proof + + val of_serialized_proof : serialized_proof -> proof option + + val verify_proof : + Raw_level.t * Z.t -> + history_proof -> + proof -> + inbox_message option tzresult + + val produce_proof : + get_payloads_history: + (Inbox_merkelized_payload_hashes.Hash.t -> + Inbox_merkelized_payload_hashes.History.t Lwt.t) -> + get_history:(Hash.t -> history_proof option Lwt.t) -> + history_proof -> + Raw_level.t * Z.t -> + (proof * inbox_message option) tzresult Lwt.t + + val finalize_inbox_level_no_history : + t -> Inbox_merkelized_payload_hashes.t -> t tzresult + + val init_witness_no_history : Inbox_merkelized_payload_hashes.t + + val add_info_per_level_no_history : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + Inbox_merkelized_payload_hashes.t -> + Inbox_merkelized_payload_hashes.t tzresult + + val genesis : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + Raw_level.t -> + t tzresult + + module Internal_for_tests : sig + val produce_inclusion_proof : + (Hash.t -> history_proof option Lwt.t) -> + history_proof -> + Raw_level.t -> + (inclusion_proof * history_proof) tzresult Lwt.t + + val serialized_proof_of_string : string -> serialized_proof + + val add_start_of_level : context -> context tzresult Lwt.t + + val add_end_of_level : context -> context tzresult Lwt.t + + val add_info_per_level : + context -> Time.t -> Block_hash.t -> context tzresult Lwt.t + end + + val add_external_messages : context -> string list -> context tzresult Lwt.t + + val add_deposit : + context -> + payload:Script.expr -> + sender:Contract_hash.t -> + source:public_key_hash -> + destination:rollup -> + context tzresult Lwt.t + + val finalize_inbox_level : context -> context Lwt.t + + val add_info_per_level : + predecessor:Block_hash.t -> context -> context Lwt.t + + val get_inbox : context -> (t * context) tzresult Lwt.t + end + + module Outbox : sig + (** See {!Sc_rollup_outbox_message_repr}. *) + module Message : sig + type transaction = { + unparsed_parameters : Script.expr; + destination : Contract_hash.t; + entrypoint : Entrypoint.t; + } + + type t = Atomic_transaction_batch of {transactions : transaction list} + + type serialized + + val unsafe_of_string : string -> serialized + + val unsafe_to_string : serialized -> string + + val deserialize : serialized -> t tzresult + + val serialize : t -> serialized tzresult + end + + val record_applied_message : + context -> + t -> + Raw_level.t -> + message_index:int -> + (Z.t * context) tzresult Lwt.t + end + + type output = { + outbox_level : Raw_level.t; + message_index : Z.t; + message : Outbox.Message.t; + } + + val output_encoding : output Data_encoding.t + + module Dissection_chunk : sig + type t = {state_hash : State_hash.t option; tick : Tick.t} + + val equal : t -> t -> bool + + val pp : Format.formatter -> t -> unit + + type error += + | Dissection_number_of_sections_mismatch of {expected : Z.t; given : Z.t} + | Dissection_invalid_number_of_sections of Z.t + | Dissection_start_hash_mismatch of { + expected : State_hash.t option; + given : State_hash.t option; + } + | Dissection_stop_hash_mismatch of State_hash.t option + | Dissection_edge_ticks_mismatch of { + dissection_start_tick : Tick.t; + dissection_stop_tick : Tick.t; + chunk_start_tick : Tick.t; + chunk_stop_tick : Tick.t; + } + | Dissection_ticks_not_increasing + | Dissection_invalid_distribution of Z.t + | Dissection_invalid_successive_states_shape + end + + module PVM : sig + type boot_sector = string + + module type S = sig + val parse_boot_sector : string -> boot_sector option + + val pp_boot_sector : Format.formatter -> boot_sector -> unit + + type state + + val pp : state -> (Format.formatter -> unit -> unit) Lwt.t + + type context + + type hash = State_hash.t + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_start_state : proof -> hash + + val proof_stop_state : proof -> hash + + val state_hash : state -> hash Lwt.t + + val initial_state : empty:state -> state Lwt.t + + val install_boot_sector : state -> string -> state Lwt.t + + val is_input_state : state -> input_request Lwt.t + + val set_input : input -> state -> state Lwt.t + + val eval : state -> state Lwt.t + + val verify_proof : input option -> proof -> input_request tzresult Lwt.t + + val produce_proof : + context -> input option -> state -> proof tzresult Lwt.t + + val verify_origination_proof : proof -> string -> bool Lwt.t + + val produce_origination_proof : context -> string -> proof tzresult Lwt.t + + type output_proof + + val output_proof_encoding : output_proof Data_encoding.t + + val output_of_output_proof : output_proof -> output + + val state_of_output_proof : output_proof -> State_hash.t + + val verify_output_proof : output_proof -> bool Lwt.t + + val produce_output_proof : + context -> state -> output -> (output_proof, error) result Lwt.t + + val check_dissection : + default_number_of_sections:int -> + start_chunk:Dissection_chunk.t -> + stop_chunk:Dissection_chunk.t -> + Dissection_chunk.t list -> + unit tzresult + + val get_current_level : state -> Raw_level.t option Lwt.t + + module Internal_for_tests : sig + val insert_failure : state -> state Lwt.t + end + end + + type ('state, 'proof, 'output) implementation = + (module S + with type state = 'state + and type proof = 'proof + and type output_proof = 'output) + + type t = Packed : ('state, 'proof, 'output) implementation -> t + [@@unboxed] + end + + module Kind : sig + type t = Example_arith | Wasm_2_0_0 + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val pvm_of : t -> PVM.t + + val all : t list + + val of_string : string -> t option + + val to_string : t -> string + end + + module ArithPVM : sig + module type P = sig + module Tree : + Context.TREE with type key = string list and type value = bytes + + type tree = Tree.tree + + val hash_tree : tree -> State_hash.t + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> State_hash.t + + val proof_after : proof -> State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> + tree -> + (tree -> (tree * 'a) Lwt.t) -> + (proof * 'a) option Lwt.t + end + + module Make (C : P) : sig + include + PVM.S + with type context = C.Tree.t + and type state = C.tree + and type proof = C.proof + + val get_tick : state -> Tick.t Lwt.t + + type status = + | Halted + | Waiting_for_input_message + | Waiting_for_reveal + | Waiting_for_metadata + | Parsing + | Evaluating + + val get_status : state -> status Lwt.t + + val get_outbox : Raw_level.t -> state -> output list Lwt.t + end + + val reference_initial_state_hash : State_hash.t + + module Protocol_implementation : + PVM.S + with type context = Context.t + and type state = Context.tree + and type proof = Context.Proof.tree Context.Proof.t + end + + module Wasm_2_0_0PVM : sig + val ticks_per_snapshot : Z.t + + val outbox_validity_period : int32 + + val outbox_message_limit : Z.t + + val well_known_reveal_preimage : string + + val well_known_reveal_hash : Sc_rollup_reveal_hash.t + + module type P = sig + module Tree : + Context.TREE with type key = string list and type value = bytes + + type tree = Tree.tree + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> State_hash.t + + val proof_after : proof -> State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> + tree -> + (tree -> (tree * 'a) Lwt.t) -> + (proof * 'a) option Lwt.t + end + + module type Make_wasm = module type of Wasm_2_0_0.Make + + module Make (Wasm_backend : Make_wasm) (C : P) : sig + include + PVM.S + with type context = C.Tree.t + and type state = C.tree + and type proof = C.proof + + val get_tick : state -> Tick.t Lwt.t + + type status = + | Computing + | Waiting_for_input_message + | Waiting_for_reveal of reveal + + val get_status : state -> status Lwt.t + + val get_outbox : Raw_level.t -> state -> output list Lwt.t + + val produce_proof : + context -> input option -> state -> proof tzresult Lwt.t + end + + module Protocol_implementation : + PVM.S + with type context = Context.t + and type state = Context.tree + and type proof = Context.Proof.tree Context.Proof.t + + val reference_initial_state_hash : State_hash.t + end + + module Number_of_ticks : sig + include Bounded.S with type ocaml_type := int64 + + val zero : t + end + + module Commitment : sig + module Hash : S.HASH + + type t = { + compressed_state : State_hash.t; + inbox_level : Raw_level.t; + predecessor : Hash.t; + number_of_ticks : Number_of_ticks.t; + } + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val hash_uncarbonated : t -> Hash.t + + val hash : context -> t -> (context * Hash.t) tzresult + + val genesis_commitment : + origination_level:Raw_level.t -> genesis_state_hash:State_hash.t -> t + + type genesis_info = {level : Raw_level.t; commitment_hash : Hash.t} + + val genesis_info_encoding : genesis_info Data_encoding.t + + val get_commitment : + context -> rollup -> Hash.t -> (t * context) tzresult Lwt.t + + val last_cemented_commitment_hash_with_level : + context -> rollup -> (Hash.t * Raw_level.t * context) tzresult Lwt.t + + val check_if_commitments_are_related : + context -> + rollup -> + descendant:Hash.t -> + ancestor:Hash.t -> + (bool * context) tzresult Lwt.t + end + + module Storage : sig + val stakers_commitments_uncarbonated : + context -> t -> (Staker.t * Commitment.Hash.t) list tzresult Lwt.t + end + + val originate : + context -> + kind:Kind.t -> + parameters_ty:Script.lazy_expr -> + genesis_commitment:Commitment.t -> + (t * Z.t * Commitment.Hash.t * context) tzresult Lwt.t + + val parameters_type : + context -> t -> (Script.lazy_expr option * context) tzresult Lwt.t + + val kind : context -> t -> (context * Kind.t) tzresult Lwt.t + + module Errors : sig + type error += Sc_rollup_does_not_exist of t + end + + module Proof : sig + type reveal_proof = + | Raw_data_proof of string + | Metadata_proof + | Dal_page_proof of { + page_id : Dal.Page.t; + proof : Dal.Slots_history.proof; + } + + type input_proof = + | Inbox_proof of { + level : Raw_level.t; + message_counter : Z.t; + proof : Inbox.serialized_proof; + } + | Reveal_proof of reveal_proof + | First_inbox_message + + type 'proof t = {pvm_step : 'proof; input_proof : input_proof option} + + type serialized = private string + + val serialize_pvm_step : + pvm:('state, 'proof, 'output) PVM.implementation -> + 'proof -> + serialized tzresult + + val unserialize_pvm_step : + pvm:('state, 'proof, 'output) PVM.implementation -> + serialized -> + 'proof tzresult + + val serialized_encoding : serialized Data_encoding.t + + val encoding : serialized t Data_encoding.t + + module type PVM_with_context_and_state = sig + include PVM.S + + val context : context + + val state : state + + val proof_encoding : proof Data_encoding.t + + val reveal : Sc_rollup_reveal_hash.t -> string option Lwt.t + + module Inbox_with_history : sig + val inbox : Inbox.history_proof + + val get_history : Inbox.Hash.t -> Inbox.history_proof option Lwt.t + + val get_payloads_history : + Inbox_merkelized_payload_hashes.Hash.t -> + Inbox_merkelized_payload_hashes.History.t Lwt.t + end + + module Dal_with_history : sig + val confirmed_slots_history : Dal.Slots_history.t + + val get_history : + Dal.Slots_history.hash -> Dal.Slots_history.t option Lwt.t + + val page_info : (Dal.Page.content * Dal.Page.proof) option + + val dal_parameters : Dal.parameters + + val dal_attestation_lag : int + end + end + + type error += Sc_rollup_proof_check of string + + val valid : + pvm:('state, 'proof, 'output) PVM.implementation -> + metadata:Metadata.t -> + Inbox.history_proof -> + Raw_level.t -> + Dal.Slots_history.t -> + Dal.parameters -> + dal_attestation_lag:int -> + 'proof t -> + (input option * input_request) tzresult Lwt.t + + val produce : + metadata:Metadata.t -> + (module PVM_with_context_and_state) -> + Raw_level.t -> + serialized t tzresult Lwt.t + end + + module Game : sig + type player = Alice | Bob + + val player_equal : player -> player -> bool + + val player_encoding : player Data_encoding.t + + type dissection_chunk = Dissection_chunk.t + + type game_state = + | Dissecting of { + dissection : dissection_chunk list; + default_number_of_sections : int; + } + | Final_move of { + agreed_start_chunk : dissection_chunk; + refuted_stop_chunk : dissection_chunk; + } + + val game_state_encoding : game_state Data_encoding.t + + val game_state_equal : game_state -> game_state -> bool + + type t = { + turn : player; + inbox_snapshot : Inbox.history_proof; + dal_snapshot : Dal.Slots_history.t; + start_level : Raw_level.t; + inbox_level : Raw_level.t; + game_state : game_state; + } + + val pp_dissection : Format.formatter -> dissection_chunk list -> unit + + val pp : Format.formatter -> t -> unit + + module Index : sig + type t = private {alice : Staker.t; bob : Staker.t} + + val encoding : t Data_encoding.t + + val make : Staker.t -> Staker.t -> t + end + + val encoding : t Data_encoding.t + + val opponent : player -> player + + type step = + | Dissection of dissection_chunk list + | Proof of Proof.serialized Proof.t + + type refutation = {choice : Tick.t; step : step} + + val refutation_encoding : refutation Data_encoding.t + + val pp_refutation : Format.formatter -> refutation -> unit + + type reason = Conflict_resolved | Timeout + + val pp_reason : Format.formatter -> reason -> unit + + val reason_encoding : reason Data_encoding.t + + type game_result = Loser of {reason : reason; loser : Staker.t} | Draw + + val pp_game_result : Format.formatter -> game_result -> unit + + val game_result_encoding : game_result Data_encoding.t + + type status = Ongoing | Ended of game_result + + val pp_status : Format.formatter -> status -> unit + + val status_encoding : status Data_encoding.t + + val loser_of_results : alice_result:bool -> bob_result:bool -> player option + + val initial : + Inbox.history_proof -> + Dal.Slots_history.t -> + start_level:Raw_level.t -> + parent:Commitment.t -> + child:Commitment.t -> + refuter:Staker.t -> + defender:Staker.t -> + default_number_of_sections:int -> + t + + val play : + Kind.t -> + Dal.parameters -> + dal_attestation_lag:int -> + stakers:Index.t -> + Metadata.t -> + t -> + refutation -> + (game_result, t) Either.t tzresult Lwt.t + + type timeout = {alice : int; bob : int; last_turn_level : Raw_level.t} + + val timeout_encoding : timeout Data_encoding.t + + type error += + | Dissection_choice_not_found of Tick.t + | Proof_unexpected_section_size of Z.t + | Proof_start_state_hash_mismatch of { + start_state_hash : State_hash.t option; + start_proof : State_hash.t; + } + | Proof_stop_state_hash_failed_to_refute of { + stop_state_hash : State_hash.t option; + stop_proof : State_hash.t option; + } + | Proof_stop_state_hash_failed_to_validate of { + stop_state_hash : State_hash.t option; + stop_proof : State_hash.t option; + } + | Dissecting_during_final_move + + module Internal_for_tests : sig + val check_dissection : + default_number_of_sections:int -> + start_chunk:dissection_chunk -> + stop_chunk:dissection_chunk -> + dissection_chunk list -> + unit tzresult + end + end + + module Stake_storage : sig + val find_staker : + context -> t -> Staker.t -> (Commitment.Hash.t * context) tzresult Lwt.t + + val publish_commitment : + context -> + t -> + Staker.t -> + Commitment.t -> + (Commitment.Hash.t * Raw_level.t * context * Receipt.balance_updates) + tzresult + Lwt.t + + val cement_commitment : + context -> + t -> + Commitment.Hash.t -> + (context * Commitment.t) tzresult Lwt.t + + val withdraw_stake : + context -> + t -> + Staker.t -> + (context * Receipt.balance_updates) tzresult Lwt.t + end + + module Refutation_storage : sig + type point = {commitment : Commitment.t; hash : Commitment.Hash.t} + + type conflict_point = point * point + + type conflict = { + other : Staker.t; + their_commitment : Commitment.t; + our_commitment : Commitment.t; + parent_commitment : Commitment.Hash.t; + } + + val conflict_encoding : conflict Data_encoding.t + + val conflicting_stakers_uncarbonated : + context -> t -> Staker.t -> conflict list tzresult Lwt.t + + val get_ongoing_games_for_staker : + context -> + t -> + Staker.t -> + ((Game.t * Game.Index.t) list * context) tzresult Lwt.t + + val start_game : + context -> + t -> + player:public_key_hash -> + opponent:public_key_hash -> + context tzresult Lwt.t + + val game_move : + context -> + t -> + player:Staker.t -> + opponent:Staker.t -> + Game.refutation -> + (Game.game_result option * context) tzresult Lwt.t + + val get_timeout : + context -> t -> Game.Index.t -> (Game.timeout * context) tzresult Lwt.t + + val timeout : + context -> + t -> + Game.Index.t -> + (Game.game_result * context) tzresult Lwt.t + + val apply_game_result : + context -> + t -> + Game.Index.t -> + Game.game_result -> + (Game.status * context * Receipt.balance_updates) tzresult Lwt.t + end + + val rpc_arg : t RPC_arg.t + + val list_unaccounted : context -> t list tzresult Lwt.t + + val genesis_info : + context -> rollup -> (context * Commitment.genesis_info) tzresult Lwt.t + + (** This module discloses definitions that are only useful for tests and + must not be used otherwise. *) + module Internal_for_tests : sig + val originated_sc_rollup : Origination_nonce.Internal_for_tests.t -> t + end +end + +(** This module re-exports definitions from {!Destination_repr}. *) +module Destination : sig + type t = + | Contract of Contract.t + | Tx_rollup of Tx_rollup.t + | Sc_rollup of Sc_rollup.t + | Zk_rollup of Zk_rollup.t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val compare : t -> t -> int + + val equal : t -> t -> bool + + val to_b58check : t -> string + + val of_b58check : string -> t tzresult + + val in_memory_size : t -> Cache_memory_helpers.sint + + type error += Invalid_destination_b58check of string +end + +(** See {!Block_payload_repr}. *) +module Block_payload : sig + (** See {!Block_payload_repr.hash}. *) + val hash : + predecessor_hash:Block_hash.t -> + payload_round:Round.t -> + Operation_list_hash.elt list -> + Block_payload_hash.t +end + +(** This module re-exports definitions from {!Block_header_repr}. *) +module Block_header : sig + type contents = { + payload_hash : Block_payload_hash.t; + payload_round : Round.t; + seed_nonce_hash : Nonce_hash.t option; + proof_of_work_nonce : bytes; + liquidity_baking_toggle_vote : + Liquidity_baking_repr.liquidity_baking_toggle_vote; + } + + type protocol_data = {contents : contents; signature : signature} + + type t = {shell : Block_header.shell_header; protocol_data : protocol_data} + + type block_header = t + + type raw = Block_header.t + + type shell_header = Block_header.shell_header + + type block_watermark = Block_header of Chain_id.t + + val to_watermark : block_watermark -> Signature.watermark + + val of_watermark : Signature.watermark -> block_watermark option + + module Proof_of_work : sig + val check_hash : Block_hash.t -> int64 -> bool + + val check_header_proof_of_work_stamp : + shell_header -> contents -> int64 -> bool + + val check_proof_of_work_stamp : + proof_of_work_threshold:int64 -> block_header -> unit tzresult + end + + val raw : block_header -> raw + + val hash : block_header -> Block_hash.t + + val hash_raw : raw -> Block_hash.t + + val encoding : block_header Data_encoding.encoding + + val raw_encoding : raw Data_encoding.t + + val contents_encoding : contents Data_encoding.t + + val unsigned_encoding : (shell_header * contents) Data_encoding.t + + val protocol_data_encoding : protocol_data Data_encoding.encoding + + val shell_header_encoding : shell_header Data_encoding.encoding + + (** The maximum size of block headers in bytes *) + val max_header_length : int + + type error += Invalid_stamp + + val check_timestamp : + Round.round_durations -> + timestamp:Time.t -> + round:Round.t -> + predecessor_timestamp:Time.t -> + predecessor_round:Round.t -> + unit tzresult + + val check_signature : t -> Chain_id.t -> public_key -> unit tzresult + + val begin_validate_block_header : + block_header:t -> + chain_id:Chain_id.t -> + predecessor_timestamp:Time.t -> + predecessor_round:Round.t -> + fitness:Fitness.t -> + timestamp:Time.t -> + delegate_pk:public_key -> + round_durations:Round.round_durations -> + proof_of_work_threshold:int64 -> + expected_commitment:bool -> + unit tzresult + + type locked_round_evidence = { + preendorsement_round : Round.t; + preendorsement_count : int; + } + + type checkable_payload_hash = + | No_check + | Expected_payload_hash of Block_payload_hash.t + + val finalize_validate_block_header : + block_header_contents:contents -> + round:Round.t -> + fitness:Fitness.t -> + checkable_payload_hash:checkable_payload_hash -> + locked_round_evidence:locked_round_evidence option -> + consensus_threshold:int -> + unit tzresult +end + +(** This module re-exports definitions from {!Cache_repr}. *) +module Cache : sig + type size = int + + type index = int + + type cache_nonce + + module Admin : sig + type key + + type value + + val pp : Format.formatter -> context -> unit + + val sync : context -> cache_nonce -> context Lwt.t + + val future_cache_expectation : + ?blocks_before_activation:int32 -> + context -> + time_in_blocks:int -> + context tzresult Lwt.t + + val cache_size : context -> cache_index:int -> size option + + val cache_size_limit : context -> cache_index:int -> size option + + val value_of_key : + context -> Context.Cache.key -> Context.Cache.value tzresult Lwt.t + end + + type namespace = private string + + val create_namespace : string -> namespace + + type identifier = string + + module type CLIENT = sig + type cached_value + + val cache_index : index + + val namespace : namespace + + val value_of_identifier : + context -> identifier -> cached_value tzresult Lwt.t + end + + module type INTERFACE = sig + type cached_value + + val update : + context -> identifier -> (cached_value * size) option -> context tzresult + + val find : context -> identifier -> cached_value option tzresult Lwt.t + + val list_identifiers : context -> (string * int) list + + val identifier_rank : context -> string -> int option + + val size : context -> int + + val size_limit : context -> int + end + + val register_exn : + (module CLIENT with type cached_value = 'a) -> + (module INTERFACE with type cached_value = 'a) + + val cache_nonce_from_block_header : + Block_header.shell_header -> Block_header.contents -> cache_nonce +end + +(** This module re-exports definitions from {!Lazy_storage_kind}. *) +module Kind : sig + type preendorsement_consensus_kind = Preendorsement_consensus_kind + + type endorsement_consensus_kind = Endorsement_consensus_kind + + type 'a consensus = + | Preendorsement_kind : preendorsement_consensus_kind consensus + | Endorsement_kind : endorsement_consensus_kind consensus + + type preendorsement = preendorsement_consensus_kind consensus + + type endorsement = endorsement_consensus_kind consensus + + type dal_attestation = Dal_attestation_kind + + type seed_nonce_revelation = Seed_nonce_revelation_kind + + type vdf_revelation = Vdf_revelation_kind + + type 'a double_consensus_operation_evidence = + | Double_consensus_operation_evidence + + type double_endorsement_evidence = + endorsement_consensus_kind double_consensus_operation_evidence + + type double_preendorsement_evidence = + preendorsement_consensus_kind double_consensus_operation_evidence + + type double_baking_evidence = Double_baking_evidence_kind + + type activate_account = Activate_account_kind + + type proposals = Proposals_kind + + type ballot = Ballot_kind + + type reveal = Reveal_kind + + type transaction = Transaction_kind + + type origination = Origination_kind + + type delegation = Delegation_kind + + type event = Event_kind + + type set_deposits_limit = Set_deposits_limit_kind + + type increase_paid_storage = Increase_paid_storage_kind + + type update_consensus_key = Update_consensus_key_kind + + type drain_delegate = Drain_delegate_kind + + type failing_noop = Failing_noop_kind + + type register_global_constant = Register_global_constant_kind + + type tx_rollup_origination = Tx_rollup_origination_kind + + type tx_rollup_submit_batch = Tx_rollup_submit_batch_kind + + type tx_rollup_commit = Tx_rollup_commit_kind + + type tx_rollup_return_bond = Tx_rollup_return_bond_kind + + type tx_rollup_finalize_commitment = Tx_rollup_finalize_commitment_kind + + type tx_rollup_remove_commitment = Tx_rollup_remove_commitment_kind + + type tx_rollup_rejection = Tx_rollup_rejection_kind + + type tx_rollup_dispatch_tickets = Tx_rollup_dispatch_tickets_kind + + type transfer_ticket = Transfer_ticket_kind + + type dal_publish_slot_header = Dal_publish_slot_header_kind + + type sc_rollup_originate = Sc_rollup_originate_kind + + type sc_rollup_add_messages = Sc_rollup_add_messages_kind + + type sc_rollup_cement = Sc_rollup_cement_kind + + type sc_rollup_publish = Sc_rollup_publish_kind + + type sc_rollup_refute = Sc_rollup_refute_kind + + type sc_rollup_timeout = Sc_rollup_timeout_kind + + type sc_rollup_execute_outbox_message = + | Sc_rollup_execute_outbox_message_kind + + type sc_rollup_recover_bond = Sc_rollup_recover_bond_kind + + type zk_rollup_origination = Zk_rollup_origination_kind + + type zk_rollup_publish = Zk_rollup_publish_kind + + type zk_rollup_update = Zk_rollup_update_kind + + type 'a manager = + | Reveal_manager_kind : reveal manager + | Transaction_manager_kind : transaction manager + | Origination_manager_kind : origination manager + | Delegation_manager_kind : delegation manager + | Event_manager_kind : event manager + | Register_global_constant_manager_kind : register_global_constant manager + | Set_deposits_limit_manager_kind : set_deposits_limit manager + | Increase_paid_storage_manager_kind : increase_paid_storage manager + | Update_consensus_key_manager_kind : update_consensus_key manager + | Tx_rollup_origination_manager_kind : tx_rollup_origination manager + | Tx_rollup_submit_batch_manager_kind : tx_rollup_submit_batch manager + | Tx_rollup_commit_manager_kind : tx_rollup_commit manager + | Tx_rollup_return_bond_manager_kind : tx_rollup_return_bond manager + | Tx_rollup_finalize_commitment_manager_kind + : tx_rollup_finalize_commitment manager + | Tx_rollup_remove_commitment_manager_kind + : tx_rollup_remove_commitment manager + | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_dispatch_tickets_manager_kind + : tx_rollup_dispatch_tickets manager + | Transfer_ticket_manager_kind : transfer_ticket manager + | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Sc_rollup_originate_manager_kind : sc_rollup_originate manager + | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager + | Sc_rollup_cement_manager_kind : sc_rollup_cement manager + | Sc_rollup_publish_manager_kind : sc_rollup_publish manager + | Sc_rollup_refute_manager_kind : sc_rollup_refute manager + | Sc_rollup_timeout_manager_kind : sc_rollup_timeout manager + | Sc_rollup_execute_outbox_message_manager_kind + : sc_rollup_execute_outbox_message manager + | Sc_rollup_recover_bond_manager_kind : sc_rollup_recover_bond manager + | Zk_rollup_origination_manager_kind : zk_rollup_origination manager + | Zk_rollup_publish_manager_kind : zk_rollup_publish manager + | Zk_rollup_update_manager_kind : zk_rollup_update manager +end + +(** All the definitions below are re-exported from {!Operation_repr}. *) + +type 'a consensus_operation_type = + | Endorsement : Kind.endorsement consensus_operation_type + | Preendorsement : Kind.preendorsement consensus_operation_type + +val pp_operation_kind : + Format.formatter -> 'kind consensus_operation_type -> unit + +type consensus_content = { + slot : Slot.t; + level : Raw_level.t; + (* The level is not required to validate an endorsement when it corresponds + to the current payload, but if we want to filter endorsements, we need + the level. *) + round : Round.t; + block_payload_hash : Block_payload_hash.t; +} + +val consensus_content_encoding : consensus_content Data_encoding.t + +val pp_consensus_content : Format.formatter -> consensus_content -> unit + +type 'kind operation = { + shell : Operation.shell_header; + protocol_data : 'kind protocol_data; +} + +and 'kind protocol_data = { + contents : 'kind contents_list; + signature : signature option; +} + +and _ contents_list = + | Single : 'kind contents -> 'kind contents_list + | Cons : + 'kind Kind.manager contents * 'rest Kind.manager contents_list + -> ('kind * 'rest) Kind.manager contents_list + +and _ contents = + | Preendorsement : consensus_content -> Kind.preendorsement contents + | Endorsement : consensus_content -> Kind.endorsement contents + | Dal_attestation : Dal.Attestation.operation -> Kind.dal_attestation contents + | Seed_nonce_revelation : { + level : Raw_level.t; + nonce : Nonce.t; + } + -> Kind.seed_nonce_revelation contents + | Vdf_revelation : { + solution : Seed.vdf_solution; + } + -> Kind.vdf_revelation contents + | Double_preendorsement_evidence : { + op1 : Kind.preendorsement operation; + op2 : Kind.preendorsement operation; + } + -> Kind.double_preendorsement_evidence contents + | Double_endorsement_evidence : { + op1 : Kind.endorsement operation; + op2 : Kind.endorsement operation; + } + -> Kind.double_endorsement_evidence contents + | Double_baking_evidence : { + bh1 : Block_header.t; + bh2 : Block_header.t; + } + -> Kind.double_baking_evidence contents + | Activate_account : { + id : Ed25519.Public_key_hash.t; + activation_code : Blinded_public_key_hash.activation_code; + } + -> Kind.activate_account contents + | Proposals : { + source : public_key_hash; + period : int32; + proposals : Protocol_hash.t list; + } + -> Kind.proposals contents + | Ballot : { + source : public_key_hash; + period : int32; + proposal : Protocol_hash.t; + ballot : Vote.ballot; + } + -> Kind.ballot contents + | Drain_delegate : { + consensus_key : Signature.Public_key_hash.t; + delegate : Signature.Public_key_hash.t; + destination : Signature.Public_key_hash.t; + } + -> Kind.drain_delegate contents + | Failing_noop : string -> Kind.failing_noop contents + | Manager_operation : { + source : public_key_hash; + fee : Tez.tez; + counter : Manager_counter.t; + operation : 'kind manager_operation; + gas_limit : Gas.Arith.integral; + storage_limit : Z.t; + } + -> 'kind Kind.manager contents + +and _ manager_operation = + | Reveal : public_key -> Kind.reveal manager_operation + | Transaction : { + amount : Tez.tez; + parameters : Script.lazy_expr; + entrypoint : Entrypoint.t; + destination : Contract.t; + } + -> Kind.transaction manager_operation + | Origination : { + delegate : public_key_hash option; + script : Script.t; + credit : Tez.tez; + } + -> Kind.origination manager_operation + | Delegation : public_key_hash option -> Kind.delegation manager_operation + | Register_global_constant : { + value : Script.lazy_expr; + } + -> Kind.register_global_constant manager_operation + | Set_deposits_limit : + Tez.t option + -> Kind.set_deposits_limit manager_operation + | Increase_paid_storage : { + amount_in_bytes : Z.t; + destination : Contract_hash.t; + } + -> Kind.increase_paid_storage manager_operation + | Update_consensus_key : + Signature.Public_key.t + -> Kind.update_consensus_key manager_operation + | Tx_rollup_origination : Kind.tx_rollup_origination manager_operation + | Tx_rollup_submit_batch : { + tx_rollup : Tx_rollup.t; + content : string; + burn_limit : Tez.tez option; + } + -> Kind.tx_rollup_submit_batch manager_operation + | Tx_rollup_commit : { + tx_rollup : Tx_rollup.t; + commitment : Tx_rollup_commitment.Full.t; + } + -> Kind.tx_rollup_commit manager_operation + | Tx_rollup_return_bond : { + tx_rollup : Tx_rollup.t; + } + -> Kind.tx_rollup_return_bond manager_operation + | Tx_rollup_finalize_commitment : { + tx_rollup : Tx_rollup.t; + } + -> Kind.tx_rollup_finalize_commitment manager_operation + | Tx_rollup_remove_commitment : { + tx_rollup : Tx_rollup.t; + } + -> Kind.tx_rollup_remove_commitment manager_operation + | Tx_rollup_rejection : { + tx_rollup : Tx_rollup.t; + level : Tx_rollup_level.t; + message : Tx_rollup_message.t; + message_position : int; + message_path : Tx_rollup_inbox.Merkle.path; + message_result_hash : Tx_rollup_message_result_hash.t; + message_result_path : Tx_rollup_commitment.Merkle.path; + previous_message_result : Tx_rollup_message_result.t; + previous_message_result_path : Tx_rollup_commitment.Merkle.path; + proof : Tx_rollup_l2_proof.serialized; + } + -> Kind.tx_rollup_rejection manager_operation + | Tx_rollup_dispatch_tickets : { + tx_rollup : Tx_rollup.t; + level : Tx_rollup_level.t; + context_hash : Context_hash.t; + message_index : int; + message_result_path : Tx_rollup_commitment.Merkle.path; + tickets_info : Tx_rollup_reveal.t list; + } + -> Kind.tx_rollup_dispatch_tickets manager_operation + | Transfer_ticket : { + contents : Script.lazy_expr; + ty : Script.lazy_expr; + ticketer : Contract.t; + amount : Ticket_amount.t; + destination : Contract.t; + entrypoint : Entrypoint.t; + } + -> Kind.transfer_ticket manager_operation + | Dal_publish_slot_header : + Dal.Slot.Header.operation + -> Kind.dal_publish_slot_header manager_operation + | Sc_rollup_originate : { + kind : Sc_rollup.Kind.t; + boot_sector : string; + origination_proof : Sc_rollup.Proof.serialized; + parameters_ty : Script.lazy_expr; + } + -> Kind.sc_rollup_originate manager_operation + | Sc_rollup_add_messages : { + messages : string list; + } + -> Kind.sc_rollup_add_messages manager_operation + | Sc_rollup_cement : { + rollup : Sc_rollup.t; + commitment : Sc_rollup.Commitment.Hash.t; + } + -> Kind.sc_rollup_cement manager_operation + | Sc_rollup_publish : { + rollup : Sc_rollup.t; + commitment : Sc_rollup.Commitment.t; + } + -> Kind.sc_rollup_publish manager_operation + | Sc_rollup_refute : { + rollup : Sc_rollup.t; + opponent : Sc_rollup.Staker.t; + refutation : Sc_rollup.Game.refutation option; + } + -> Kind.sc_rollup_refute manager_operation + | Sc_rollup_timeout : { + rollup : Sc_rollup.t; + stakers : Sc_rollup.Game.Index.t; + } + -> Kind.sc_rollup_timeout manager_operation + | Sc_rollup_execute_outbox_message : { + rollup : Sc_rollup.t; + cemented_commitment : Sc_rollup.Commitment.Hash.t; + output_proof : string; + } + -> Kind.sc_rollup_execute_outbox_message manager_operation + | Sc_rollup_recover_bond : { + sc_rollup : Sc_rollup.t; + staker : Signature.Public_key_hash.t; + } + -> Kind.sc_rollup_recover_bond manager_operation + | Zk_rollup_origination : { + public_parameters : Plonk.public_parameters; + circuits_info : [`Public | `Private | `Fee] Zk_rollup.Account.SMap.t; + init_state : Zk_rollup.State.t; + nb_ops : int; + } + -> Kind.zk_rollup_origination manager_operation + | Zk_rollup_publish : { + zk_rollup : Zk_rollup.t; + ops : (Zk_rollup.Operation.t * Zk_rollup.Ticket.t option) list; + } + -> Kind.zk_rollup_publish manager_operation + | Zk_rollup_update : { + zk_rollup : Zk_rollup.t; + update : Zk_rollup.Update.t; + } + -> Kind.zk_rollup_update manager_operation + +type packed_manager_operation = + | Manager : 'kind manager_operation -> packed_manager_operation + +type packed_contents = Contents : 'kind contents -> packed_contents + +type packed_contents_list = + | Contents_list : 'kind contents_list -> packed_contents_list + +type packed_protocol_data = + | Operation_data : 'kind protocol_data -> packed_protocol_data + +type packed_operation = { + shell : Operation.shell_header; + protocol_data : packed_protocol_data; +} + +val manager_kind : 'kind manager_operation -> 'kind Kind.manager + +(** This module re-exports definitions from {!Operation_repr}. *) +module Operation : sig + type nonrec 'kind contents = 'kind contents + + type nonrec packed_contents = packed_contents + + val contents_encoding : packed_contents Data_encoding.t + + type nonrec 'kind protocol_data = 'kind protocol_data + + type nonrec packed_protocol_data = packed_protocol_data + + type consensus_watermark = + | Endorsement of Chain_id.t + | Preendorsement of Chain_id.t + | Dal_attestation of Chain_id.t + + val to_watermark : consensus_watermark -> Signature.watermark + + val of_watermark : Signature.watermark -> consensus_watermark option + + val protocol_data_encoding : packed_protocol_data Data_encoding.t + + val unsigned_encoding : + (Operation.shell_header * packed_contents_list) Data_encoding.t + + type raw = Operation.t = {shell : Operation.shell_header; proto : bytes} + + val raw_encoding : raw Data_encoding.t + + val contents_list_encoding : packed_contents_list Data_encoding.t + + type 'kind t = 'kind operation = { + shell : Operation.shell_header; + protocol_data : 'kind protocol_data; + } + + type nonrec packed = packed_operation + + val encoding : packed Data_encoding.t + + val raw : _ operation -> raw + + val hash : _ operation -> Operation_hash.t + + val hash_raw : raw -> Operation_hash.t + + val hash_packed : packed_operation -> Operation_hash.t + + val acceptable_pass : packed_operation -> int option + + val compare_by_passes : packed_operation -> packed_operation -> int + + type error += Missing_signature (* `Permanent *) + + type error += Invalid_signature (* `Permanent *) + + val check_signature : public_key -> Chain_id.t -> _ operation -> unit tzresult + + val pack : 'kind operation -> packed_operation + + val compare : + Operation_hash.t * packed_operation -> + Operation_hash.t * packed_operation -> + int + + type ('a, 'b) eq = Eq : ('a, 'a) eq + + val equal : 'a operation -> 'b operation -> ('a, 'b) eq option + + module Encoding : sig + type 'b case = + | Case : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_contents -> 'b contents option; + proj : 'b contents -> 'a; + inj : 'a -> 'b contents; + } + -> 'b case + + val preendorsement_case : Kind.preendorsement case + + val endorsement_case : Kind.endorsement case + + val dal_attestation_case : Kind.dal_attestation case + + val seed_nonce_revelation_case : Kind.seed_nonce_revelation case + + val vdf_revelation_case : Kind.vdf_revelation case + + val double_preendorsement_evidence_case : + Kind.double_preendorsement_evidence case + + val double_endorsement_evidence_case : Kind.double_endorsement_evidence case + + val double_baking_evidence_case : Kind.double_baking_evidence case + + val activate_account_case : Kind.activate_account case + + val proposals_case : Kind.proposals case + + val ballot_case : Kind.ballot case + + val drain_delegate_case : Kind.drain_delegate case + + val failing_noop_case : Kind.failing_noop case + + val reveal_case : Kind.reveal Kind.manager case + + val transaction_case : Kind.transaction Kind.manager case + + val origination_case : Kind.origination Kind.manager case + + val delegation_case : Kind.delegation Kind.manager case + + val update_consensus_key_case : Kind.update_consensus_key Kind.manager case + + val tx_rollup_origination_case : + Kind.tx_rollup_origination Kind.manager case + + val tx_rollup_submit_batch_case : + Kind.tx_rollup_submit_batch Kind.manager case + + val tx_rollup_commit_case : Kind.tx_rollup_commit Kind.manager case + + val tx_rollup_return_bond_case : + Kind.tx_rollup_return_bond Kind.manager case + + val tx_rollup_finalize_commitment_case : + Kind.tx_rollup_finalize_commitment Kind.manager case + + val tx_rollup_remove_commitment_case : + Kind.tx_rollup_remove_commitment Kind.manager case + + val tx_rollup_rejection_case : Kind.tx_rollup_rejection Kind.manager case + + val tx_rollup_dispatch_tickets_case : + Kind.tx_rollup_dispatch_tickets Kind.manager case + + val transfer_ticket_case : Kind.transfer_ticket Kind.manager case + + val dal_publish_slot_header_case : + Kind.dal_publish_slot_header Kind.manager case + + val register_global_constant_case : + Kind.register_global_constant Kind.manager case + + val set_deposits_limit_case : Kind.set_deposits_limit Kind.manager case + + val increase_paid_storage_case : + Kind.increase_paid_storage Kind.manager case + + val sc_rollup_originate_case : Kind.sc_rollup_originate Kind.manager case + + val sc_rollup_add_messages_case : + Kind.sc_rollup_add_messages Kind.manager case + + val sc_rollup_cement_case : Kind.sc_rollup_cement Kind.manager case + + val sc_rollup_publish_case : Kind.sc_rollup_publish Kind.manager case + + val sc_rollup_refute_case : Kind.sc_rollup_refute Kind.manager case + + val sc_rollup_timeout_case : Kind.sc_rollup_timeout Kind.manager case + + val sc_rollup_execute_outbox_message_case : + Kind.sc_rollup_execute_outbox_message Kind.manager case + + val sc_rollup_recover_bond_case : + Kind.sc_rollup_recover_bond Kind.manager case + + val zk_rollup_origination_case : + Kind.zk_rollup_origination Kind.manager case + + val zk_rollup_publish_case : Kind.zk_rollup_publish Kind.manager case + + val zk_rollup_update_case : Kind.zk_rollup_update Kind.manager case + + module Manager_operations : sig + type 'b case = + | MCase : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_manager_operation -> 'kind manager_operation option; + proj : 'kind manager_operation -> 'a; + inj : 'a -> 'kind manager_operation; + } + -> 'kind case + + val reveal_case : Kind.reveal case + + val transaction_case : Kind.transaction case + + val origination_case : Kind.origination case + + val delegation_case : Kind.delegation case + + val update_consensus_key_tag : int + + val update_consensus_key_case : Kind.update_consensus_key case + + val register_global_constant_case : Kind.register_global_constant case + + val set_deposits_limit_case : Kind.set_deposits_limit case + + val increase_paid_storage_case : Kind.increase_paid_storage case + + val tx_rollup_origination_case : Kind.tx_rollup_origination case + + val tx_rollup_submit_batch_case : Kind.tx_rollup_submit_batch case + + val tx_rollup_commit_case : Kind.tx_rollup_commit case + + val tx_rollup_return_bond_case : Kind.tx_rollup_return_bond case + + val tx_rollup_finalize_commitment_case : + Kind.tx_rollup_finalize_commitment case + + val tx_rollup_remove_commitment_case : + Kind.tx_rollup_remove_commitment case + + val tx_rollup_rejection_case : Kind.tx_rollup_rejection case + + val tx_rollup_dispatch_tickets_case : Kind.tx_rollup_dispatch_tickets case + + val transfer_ticket_case : Kind.transfer_ticket case + + val dal_publish_slot_header_case : Kind.dal_publish_slot_header case + + val sc_rollup_originate_case : Kind.sc_rollup_originate case + + val sc_rollup_add_messages_case : Kind.sc_rollup_add_messages case + + val sc_rollup_cement_case : Kind.sc_rollup_cement case + + val sc_rollup_publish_case : Kind.sc_rollup_publish case + + val sc_rollup_refute_case : Kind.sc_rollup_refute case + + val sc_rollup_timeout_case : Kind.sc_rollup_timeout case + + val sc_rollup_execute_outbox_message_case : + Kind.sc_rollup_execute_outbox_message case + + val sc_rollup_recover_bond_case : Kind.sc_rollup_recover_bond case + + val zk_rollup_origination_case : Kind.zk_rollup_origination case + + val zk_rollup_publish_case : Kind.zk_rollup_publish case + + val zk_rollup_update_case : Kind.zk_rollup_update case + end + end + + val of_list : packed_contents list -> packed_contents_list tzresult + + val to_list : packed_contents_list -> packed_contents list +end + +(** This module re-exports definitions from {!Stake_storage}, + {!Delegate_storage} and {!Delegate}. *) +module Stake_distribution : sig + val snapshot : context -> context tzresult Lwt.t + + val compute_snapshot_index : + context -> Cycle.t -> max_snapshot_index:int -> int tzresult Lwt.t + + val baking_rights_owner : + context -> + Level.t -> + round:Round.t -> + (context * Slot.t * Consensus_key.pk) tzresult Lwt.t + + val slot_owner : + context -> Level.t -> Slot.t -> (context * Consensus_key.pk) tzresult Lwt.t +end + +(** This module re-exports definitions from {!Commitment_repr} and, + {!Commitment_storage}. *) +module Commitment : sig + type t = { + blinded_public_key_hash : Blinded_public_key_hash.t; + amount : Tez.tez; + } + + (** See {!Commitment_storage.exists}. *) + val exists : context -> Blinded_public_key_hash.t -> bool Lwt.t + + val encoding : t Data_encoding.t +end + +(** This module re-exports definitions from {!Bootstrap_storage}. *) +module Bootstrap : sig + val cycle_end : context -> Cycle.t -> context tzresult Lwt.t +end + +(** This module re-exports definitions from {!Migration_repr}. *) +module Migration : sig + type origination_result = { + balance_updates : Receipt.balance_updates; + originated_contracts : Contract_hash.t list; + storage_size : Z.t; + paid_storage_size_diff : Z.t; + } +end + +(** Create an [Alpha_context.t] from an untyped context (first block in the chain only). *) +val prepare_first_block : + Chain_id.t -> + Context.t -> + typecheck: + (context -> + Script.t -> + ((Script.t * Lazy_storage.diffs option) * context) tzresult Lwt.t) -> + level:Int32.t -> + timestamp:Time.t -> + predecessor:Block_hash.t -> + context tzresult Lwt.t + +(** Create an [Alpha_context.t] from an untyped context. *) +val prepare : + Context.t -> + level:Int32.t -> + predecessor_timestamp:Time.t -> + timestamp:Time.t -> + (context * Receipt.balance_updates * Migration.origination_result list) + tzresult + Lwt.t + +(** All the definitions below are re-exported from {!Raw_context}. *) + +val activate : context -> Protocol_hash.t -> context Lwt.t + +val reset_internal_nonce : context -> context + +val fresh_internal_nonce : context -> (context * int) tzresult + +val record_internal_nonce : context -> int -> context + +val internal_nonce_already_recorded : context -> int -> bool + +val description : context Storage_description.t + +val record_non_consensus_operation_hash : context -> Operation_hash.t -> context + +val non_consensus_operations : context -> Operation_hash.t list + +val record_dictator_proposal_seen : t -> t + +val dictator_proposal_seen : t -> bool + +(** Finalize an {{!t} [Alpha_context.t]}, producing a [validation_result]. + *) +val finalize : + ?commit_message:string -> context -> Fitness.raw -> Updater.validation_result + +(** Should only be used by [Main.current_context] to return a context usable for RPCs *) +val current_context : context -> Context.t + +(** This module re-exports definitions from {!Parameters_repr}. *) +module Parameters : sig + type bootstrap_account = { + public_key_hash : public_key_hash; + public_key : public_key option; + amount : Tez.t; + delegate_to : public_key_hash option; + consensus_key : public_key option; + } + + type bootstrap_contract = { + delegate : public_key_hash option; + amount : Tez.t; + script : Script.t; + } + + type t = { + bootstrap_accounts : bootstrap_account list; + bootstrap_contracts : bootstrap_contract list; + commitments : Commitment.t list; + constants : Constants.Parametric.t; + security_deposit_ramp_up_cycles : int option; + no_reward_cycles : int option; + } + + val bootstrap_account_encoding : bootstrap_account Data_encoding.t + + val encoding : t Data_encoding.t +end + +(** This module re-exports definitions from {!Liquidity_baking_repr} and + {!Liquidity_baking_storage}. *) +module Liquidity_baking : sig + type liquidity_baking_toggle_vote = + Liquidity_baking_repr.liquidity_baking_toggle_vote = + | LB_on + | LB_off + | LB_pass + + val liquidity_baking_toggle_vote_encoding : + liquidity_baking_toggle_vote Data_encoding.encoding + + val get_cpmm_address : context -> Contract_hash.t tzresult Lwt.t + + module Toggle_EMA : sig + type t + + val zero : t + + val to_int32 : t -> Int32.t + + val encoding : t Data_encoding.t + end + + val on_subsidy_allowed : + context -> + toggle_vote:liquidity_baking_toggle_vote -> + (context -> Contract_hash.t -> (context * 'a list) tzresult Lwt.t) -> + (context * 'a list * Toggle_EMA.t) tzresult Lwt.t +end + +(** This module re-exports definitions from {!Ticket_storage}. *) +module Ticket_balance : sig + type error += + | Negative_ticket_balance of {key : Ticket_hash.t; balance : Z.t} + | Used_storage_space_underflow + + val adjust_balance : + context -> Ticket_hash.t -> delta:Z.t -> (Z.t * context) tzresult Lwt.t + + val adjust_storage_space : + context -> storage_diff:Z.t -> (Z.t * context) tzresult Lwt.t + + val get_balance : + context -> Ticket_hash.t -> (Z.t option * context) tzresult Lwt.t + + (** This module discloses definitions that are only useful for tests and + must not be used otherwise. *) + module Internal_for_tests : sig + val used_storage_space : context -> Z.t tzresult Lwt.t + + val paid_storage_space : context -> Z.t tzresult Lwt.t + end +end + +module First_level_of_protocol : sig + (** Get the level of the first block of this protocol. *) + val get : context -> Raw_level.t tzresult Lwt.t +end + +(** This module re-exports definitions from {!Raw_context.Consensus}. *) +module Consensus : sig + include + Raw_context.CONSENSUS + with type t := t + and type slot := Slot.t + and type 'a slot_map := 'a Slot.Map.t + and type slot_set := Slot.Set.t + and type round := Round.t + and type consensus_pk := Consensus_key.pk + + (** [store_endorsement_branch context branch] sets the "endorsement branch" + (see {!Storage.Tenderbake.Endorsement_branch} to [branch] in both the disk + storage and RAM. *) + val store_endorsement_branch : + context -> Block_hash.t * Block_payload_hash.t -> context Lwt.t + + (** [store_grand_parent_branch context branch] sets the "grand-parent branch" + (see {!Storage.Tenderbake.Grand_parent_branch} to [branch] in both the + disk storage and RAM. *) + val store_grand_parent_branch : + context -> Block_hash.t * Block_payload_hash.t -> context Lwt.t +end + +(** This module re-exports definitions from {!Token}. *) +module Token : sig + type container = + [ `Contract of Contract.t + | `Collected_commitments of Blinded_public_key_hash.t + | `Delegate_balance of public_key_hash + | `Frozen_deposits of public_key_hash + | `Block_fees + | `Frozen_bonds of Contract.t * Bond_id.t ] + + type source = + [ `Invoice + | `Bootstrap + | `Initial_commitments + | `Revelation_rewards + | `Double_signing_evidence_rewards + | `Endorsing_rewards + | `Baking_rewards + | `Baking_bonuses + | `Minted + | `Liquidity_baking_subsidies + | `Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards + | container ] + + type sink = + [ `Storage_fees + | `Double_signing_punishments + | `Lost_endorsing_rewards of public_key_hash * bool * bool + | `Burned + | `Tx_rollup_rejection_punishments + | `Sc_rollup_refutation_punishments + | container ] + + val allocated : context -> container -> (context * bool) tzresult Lwt.t + + val balance : context -> container -> (context * Tez.t) tzresult Lwt.t + + val transfer_n : + ?origin:Receipt.update_origin -> + context -> + ([< source] * Tez.t) list -> + [< sink] -> + (context * Receipt.balance_updates) tzresult Lwt.t + + val transfer : + ?origin:Receipt.update_origin -> + context -> + [< source] -> + [< sink] -> + Tez.t -> + (context * Receipt.balance_updates) tzresult Lwt.t +end + +(** This module re-exports definitions from {!Fees_storage}. *) +module Fees : sig + val record_paid_storage_space : + context -> Contract_hash.t -> (context * Z.t * Z.t) tzresult Lwt.t + + val record_global_constant_storage_space : context -> Z.t -> context * Z.t + + val burn_storage_fees : + ?origin:Receipt.update_origin -> + context -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (context * Z.t * Receipt.balance_updates) tzresult Lwt.t + + val burn_storage_increase_fees : + ?origin:Receipt_repr.update_origin -> + context -> + payer:Token.source -> + Z.t -> + (context * Receipt.balance_updates) tzresult Lwt.t + + val burn_origination_fees : + ?origin:Receipt.update_origin -> + context -> + storage_limit:Z.t -> + payer:Token.source -> + (context * Z.t * Receipt.balance_updates) tzresult Lwt.t + + val burn_tx_rollup_origination_fees : + ?origin:Receipt.update_origin -> + context -> + storage_limit:Z.t -> + payer:Token.source -> + (context * Z.t * Receipt.balance_updates) tzresult Lwt.t + + val burn_sc_rollup_origination_fees : + ?origin:Receipt.update_origin -> + context -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (context * Z.t * Receipt.balance_updates) tzresult Lwt.t + + val burn_zk_rollup_origination_fees : + ?origin:Receipt.update_origin -> + context -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (context * Z.t * Receipt.balance_updates) tzresult Lwt.t + + type error += Cannot_pay_storage_fee (* `Temporary *) + + type error += Operation_quota_exceeded (* `Temporary *) + + type error += Storage_limit_too_high (* `Permanent *) + + val check_storage_limit : context -> storage_limit:Z.t -> unit tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/alpha_services.ml b/src/proto_016_PtMumbai/lib_protocol/alpha_services.ml new file mode 100644 index 000000000000..b2f703214956 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/alpha_services.ml @@ -0,0 +1,313 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let custom_root = RPC_path.open_root + +module Seed_computation = struct + module S = struct + let seed_computation_status_encoding = + let open Seed in + Data_encoding.( + union + [ + case + (Tag 0) + ~title:"Nonce revelation stage" + (obj1 (req "nonce_revelation_stage" unit)) + (function Nonce_revelation_stage -> Some () | _ -> None) + (fun () -> Nonce_revelation_stage); + case + (Tag 1) + ~title:"VDF revelation stage" + (obj2 + (req "seed_discriminant" Seed.seed_encoding) + (req "seed_challenge" Seed.seed_encoding)) + (function + | Vdf_revelation_stage {seed_discriminant; seed_challenge} -> + Some (seed_discriminant, seed_challenge) + | _ -> None) + (fun (seed_discriminant, seed_challenge) -> + Vdf_revelation_stage {seed_discriminant; seed_challenge}); + case + (Tag 2) + ~title:"Computation finished" + (obj1 (req "computation_finished" unit)) + (function Computation_finished -> Some () | _ -> None) + (fun () -> Computation_finished); + ]) + + let seed_computation = + RPC_service.get_service + ~description:"Seed computation status" + ~query:RPC_query.empty + ~output:seed_computation_status_encoding + RPC_path.(custom_root / "context" / "seed_computation") + end + + let () = + let open Services_registration in + register0 ~chunked:false S.seed_computation (fun ctxt () () -> + Seed.get_seed_computation_status ctxt) + + let get ctxt block = + RPC_context.make_call0 S.seed_computation ctxt block () () +end + +module Seed = struct + module S = struct + open Data_encoding + + let seed = + RPC_service.post_service + ~description:"Seed of the cycle to which the block belongs." + ~query:RPC_query.empty + ~input:empty + ~output:Seed.seed_encoding + RPC_path.(custom_root / "context" / "seed") + end + + let () = + let open Services_registration in + register0 ~chunked:false S.seed (fun ctxt () () -> + let l = Level.current ctxt in + Seed.for_cycle ctxt l.cycle) + + let get ctxt block = RPC_context.make_call0 S.seed ctxt block () () +end + +module Nonce = struct + type info = Revealed of Nonce.t | Missing of Nonce_hash.t | Forgotten + + let info_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Revealed" + (obj1 (req "nonce" Nonce.encoding)) + (function Revealed nonce -> Some nonce | _ -> None) + (fun nonce -> Revealed nonce); + case + (Tag 1) + ~title:"Missing" + (obj1 (req "hash" Nonce_hash.encoding)) + (function Missing nonce -> Some nonce | _ -> None) + (fun nonce -> Missing nonce); + case + (Tag 2) + ~title:"Forgotten" + empty + (function Forgotten -> Some () | _ -> None) + (fun () -> Forgotten); + ] + + module S = struct + let get = + RPC_service.get_service + ~description:"Info about the nonce of a previous block." + ~query:RPC_query.empty + ~output:info_encoding + RPC_path.(custom_root / "context" / "nonces" /: Raw_level.rpc_arg) + end + + let register () = + let open Services_registration in + register1 ~chunked:false S.get (fun ctxt raw_level () () -> + let level = Level.from_raw ctxt raw_level in + Nonce.get ctxt level >|= function + | Ok (Revealed nonce) -> ok (Revealed nonce) + | Ok (Unrevealed {nonce_hash; _}) -> ok (Missing nonce_hash) + | Error _ -> ok Forgotten) + + let get ctxt block level = RPC_context.make_call1 S.get ctxt block level () () +end + +type error += No_available_snapshots of {min_cycle : int32} + +let () = + Error_monad.register_error_kind + `Permanent + ~id:"no_available_snapshots" + ~title:"No available snapshots" + ~description:"No available snapshots" + ~pp:(fun ppf min_cycle -> + Format.fprintf ppf "No available snapshots until cycle %ld" min_cycle) + Data_encoding.(obj1 (req "min_cycle" int32)) + (function + | No_available_snapshots {min_cycle} -> Some min_cycle | _ -> None) + (fun min_cycle -> No_available_snapshots {min_cycle}) + +module Snapshot_index = struct + module S = struct + let cycle_query : Cycle.t option RPC_query.t = + let open RPC_query in + query (fun x -> x) + |+ opt_field "cycle" Cycle.rpc_arg (fun cycle -> cycle) + |> seal + + let selected_snapshot = + RPC_service.get_service + ~description: + "Returns the index of the selected snapshot for the current cycle or \ + for the specific `cycle` passed as argument, if any." + ~query:cycle_query + ~output:Data_encoding.int31 + RPC_path.(custom_root / "context" / "selected_snapshot") + end + + let register () = + let open Services_registration in + register0 ~chunked:false S.selected_snapshot (fun ctxt cycle () -> + (* max_snapshot_index can be determined using constants only *) + let blocks_per_stake_snapshot = + Alpha_context.Constants.blocks_per_stake_snapshot ctxt + in + let blocks_per_cycle = Alpha_context.Constants.blocks_per_cycle ctxt in + let preserved_cycles = + Int32.of_int (Alpha_context.Constants.preserved_cycles ctxt) + in + let cycle = + match cycle with + | None -> Level.(current ctxt).cycle + | Some cycle -> cycle + in + if Compare.Int32.(Cycle.to_int32 cycle <= Int32.succ preserved_cycles) + then + (* Early cycles are corner cases, fail if requested *) + tzfail + (No_available_snapshots {min_cycle = Int32.add preserved_cycles 2l}) + else + let max_snapshot_index = + Int32.div blocks_per_cycle blocks_per_stake_snapshot |> Int32.to_int + in + Alpha_context.Stake_distribution.compute_snapshot_index + ctxt + cycle + ~max_snapshot_index) + + let get ctxt block ?cycle () = + RPC_context.make_call0 S.selected_snapshot ctxt block cycle () +end + +module Contract = Contract_services +module Constants = Constants_services +module Delegate = Delegate_services +module Voting = Voting_services +module Sapling = Sapling_services +module Tx_rollup = Tx_rollup_services + +module Liquidity_baking = struct + module S = struct + let get_cpmm_address = + RPC_service.get_service + ~description:"Liquidity baking CPMM address" + ~query:RPC_query.empty + ~output:Alpha_context.Contract.originated_encoding + RPC_path.(custom_root / "context" / "liquidity_baking" / "cpmm_address") + end + + let register () = + let open Services_registration in + register0 ~chunked:false S.get_cpmm_address (fun ctxt () () -> + Alpha_context.Liquidity_baking.get_cpmm_address ctxt) + + let get_cpmm_address ctxt block = + RPC_context.make_call0 S.get_cpmm_address ctxt block () () +end + +module Cache = struct + module S = struct + let cached_contracts = + RPC_service.get_service + ~description:"Return the list of cached contracts" + ~query:RPC_query.empty + ~output:Data_encoding.(list @@ tup2 Contract_hash.encoding int31) + RPC_path.(custom_root / "context" / "cache" / "contracts" / "all") + + let contract_cache_size = + RPC_service.get_service + ~description:"Return the size of the contract cache" + ~query:RPC_query.empty + ~output:Data_encoding.int31 + RPC_path.(custom_root / "context" / "cache" / "contracts" / "size") + + let contract_cache_size_limit = + RPC_service.get_service + ~description:"Return the size limit of the contract cache" + ~query:RPC_query.empty + ~output:Data_encoding.int31 + RPC_path.( + custom_root / "context" / "cache" / "contracts" / "size_limit") + + let contract_rank = + RPC_service.post_service + ~description: + "Return the number of cached contracts older than the provided \ + contract" + ~query:RPC_query.empty + ~input:Alpha_context.Contract.originated_encoding + ~output:Data_encoding.(option int31) + RPC_path.(custom_root / "context" / "cache" / "contracts" / "rank") + end + + let register () = + let open Services_registration in + register0 ~chunked:true S.cached_contracts (fun ctxt () () -> + Script_cache.entries ctxt |> Lwt.return) ; + register0 ~chunked:false S.contract_cache_size (fun ctxt () () -> + Script_cache.size ctxt |> return) ; + register0 ~chunked:false S.contract_cache_size_limit (fun ctxt () () -> + Script_cache.size_limit ctxt |> return) ; + register0 ~chunked:false S.contract_rank (fun ctxt () contract -> + Script_cache.contract_rank ctxt contract |> return) + + let cached_contracts ctxt block = + RPC_context.make_call0 S.cached_contracts ctxt block () () + + let contract_cache_size ctxt block = + RPC_context.make_call0 S.contract_cache_size ctxt block () () + + let contract_cache_size_limit ctxt block = + RPC_context.make_call0 S.contract_cache_size_limit ctxt block () () + + let contract_rank ctxt block contract = + RPC_context.make_call0 S.contract_rank ctxt block () contract +end + +let register () = + Contract.register () ; + Constants.register () ; + Delegate.register () ; + Nonce.register () ; + Snapshot_index.register () ; + Voting.register () ; + Sapling.register () ; + Liquidity_baking.register () ; + Cache.register () ; + Tx_rollup.register () diff --git a/src/proto_016_PtMumbai/lib_protocol/alpha_services.mli b/src/proto_016_PtMumbai/lib_protocol/alpha_services.mli new file mode 100644 index 000000000000..14235f19a699 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/alpha_services.mli @@ -0,0 +1,95 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This declares Protocol RPC services. + + Protocol RPC services are read-only, and support querying the state of the + ledger (including information such as existing contracts, delegation, + voting, and so on), at a given block height. + + This is a mostly internal module used from [rpc_services] in [Main]. + *) + +open Alpha_context + +module Seed_computation : sig + val get : + 'a #RPC_context.simple -> + 'a -> + Seed.seed_computation_status shell_tzresult Lwt.t +end + +module Seed : sig + val get : 'a #RPC_context.simple -> 'a -> Seed.seed shell_tzresult Lwt.t +end + +module Nonce : sig + type info = Revealed of Nonce.t | Missing of Nonce_hash.t | Forgotten + + val get : + 'a #RPC_context.simple -> 'a -> Raw_level.t -> info shell_tzresult Lwt.t +end + +module Snapshot_index : sig + val get : + 'a #RPC_context.simple -> + 'a -> + ?cycle:Cycle.t -> + unit -> + int shell_tzresult Lwt.t +end + +module Contract = Contract_services +module Constants = Constants_services +module Delegate = Delegate_services +module Voting = Voting_services +module Sapling = Sapling_services + +module Liquidity_baking : sig + val get_cpmm_address : + 'a #RPC_context.simple -> 'a -> Contract_hash.t shell_tzresult Lwt.t +end + +module Cache : sig + val cached_contracts : + 'a #RPC_context.simple -> + 'a -> + (Contract_hash.t * int) list shell_tzresult Lwt.t + + val contract_cache_size : + 'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t + + val contract_cache_size_limit : + 'a #RPC_context.simple -> 'a -> int shell_tzresult Lwt.t + + val contract_rank : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + int option shell_tzresult Lwt.t +end + +val register : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/amendment.ml b/src/proto_016_PtMumbai/lib_protocol/amendment.ml new file mode 100644 index 000000000000..6fd95d922bf5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/amendment.ml @@ -0,0 +1,221 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** Returns the proposal submitted by the most delegates. + Returns None in case of a tie, if proposal quorum is below required + minimum or if there are no proposals. *) +let select_winning_proposal ctxt = + Vote.get_proposals ctxt >>=? fun proposals -> + let merge proposal vote winners = + match winners with + | None -> Some ([proposal], vote) + | Some (winners, winners_vote) as previous -> + if Compare.Int64.(vote = winners_vote) then + Some (proposal :: winners, winners_vote) + else if Compare.Int64.(vote > winners_vote) then Some ([proposal], vote) + else previous + in + match Protocol_hash.Map.fold merge proposals None with + | Some ([proposal], vote) -> + Vote.get_total_voting_power_free ctxt >>=? fun max_vote -> + let min_proposal_quorum = + Z.of_int32 (Constants.min_proposal_quorum ctxt) + in + let min_vote_to_pass = + Z.( + to_int64 + (div (mul min_proposal_quorum (of_int64 max_vote)) (of_int 100_00))) + in + if Compare.Int64.(vote >= min_vote_to_pass) then return_some proposal + else return_none + | _ -> return_none + +(* in case of a tie, let's do nothing. *) + +(** A proposal is approved if it has supermajority and the participation reaches + the current quorum. + Supermajority means the yays are more 8/10 of casted votes. + The participation is the ratio of all received votes, including passes, with + respect to the number of possible votes. + The participation EMA (exponential moving average) uses the last + participation EMA and the current participation./ + The expected quorum is calculated using the last participation EMA, capped + by the min/max quorum protocol constants. *) +let approval_and_participation_ema (ballots : Vote.ballots) ~maximum_vote + ~participation_ema ~expected_quorum = + (* Note overflows: considering a maximum of 1e9 tokens (around 2^30), + hence 1e15 mutez (around 2^50) + In 'participation' a Z is used because in the worst case 'all_votes is + 1e15 and after the multiplication is 1e19 (around 2^64). + *) + let casted_votes = Int64.add ballots.yay ballots.nay in + let all_votes = Int64.add casted_votes ballots.pass in + let supermajority = Int64.div (Int64.mul 8L casted_votes) 10L in + let participation = + (* in centile of percentage *) + Z.( + to_int32 + (div + (mul (Z.of_int64 all_votes) (Z.of_int 100_00)) + (Z.of_int64 maximum_vote))) + in + let approval = + Compare.Int32.(participation >= expected_quorum) + && Compare.Int64.(ballots.yay >= supermajority) + in + let new_participation_ema = + Int32.(div (add (mul 8l participation_ema) (mul 2l participation)) 10l) + in + (approval, new_participation_ema) + +let get_approval_and_update_participation_ema ctxt = + Vote.get_ballots ctxt >>=? fun ballots -> + Vote.get_total_voting_power_free ctxt >>=? fun maximum_vote -> + Vote.get_participation_ema ctxt >>=? fun participation_ema -> + Vote.get_current_quorum ctxt >>=? fun expected_quorum -> + Vote.clear_ballots ctxt >>= fun ctxt -> + let approval, new_participation_ema = + approval_and_participation_ema + ballots + ~maximum_vote + ~participation_ema + ~expected_quorum + in + Vote.set_participation_ema ctxt new_participation_ema >|=? fun ctxt -> + (ctxt, approval) + +(** Implements the state machine of the amendment procedure. Note that + [update_listings], that computes the vote weight of each delegate, is run at + the end of each voting period. This state-machine prepare the voting_period + for the next block. *) +let start_new_voting_period ctxt = + (* any change related to the storage in this function must probably + be replicated in `record_testnet_dictator_proposals` *) + Voting_period.get_current_kind ctxt >>=? fun kind -> + (match kind with + | Proposal -> ( + select_winning_proposal ctxt >>=? fun proposal -> + Vote.clear_proposals ctxt >>= fun ctxt -> + match proposal with + | None -> Voting_period.reset ctxt + | Some proposal -> + Vote.init_current_proposal ctxt proposal >>=? Voting_period.succ) + | Exploration -> + get_approval_and_update_participation_ema ctxt + >>=? fun (ctxt, approved) -> + if approved then Voting_period.succ ctxt + else + Vote.clear_current_proposal ctxt >>= fun ctxt -> + Voting_period.reset ctxt + | Cooldown -> Voting_period.succ ctxt + | Promotion -> + get_approval_and_update_participation_ema ctxt + >>=? fun (ctxt, approved) -> + if approved then Voting_period.succ ctxt + else Vote.clear_current_proposal ctxt >>= Voting_period.reset + | Adoption -> + Vote.get_current_proposal ctxt >>=? fun proposal -> + activate ctxt proposal >>= fun ctxt -> + Vote.clear_current_proposal ctxt >>= Voting_period.reset) + >>=? fun ctxt -> Vote.update_listings ctxt + +let may_start_new_voting_period ctxt = + Voting_period.is_last_block ctxt >>=? fun is_last -> + if is_last then start_new_voting_period ctxt else return ctxt + +(** {2 Application of voting operations} *) + +let get_testnet_dictator ctxt chain_id = + (* This function should always, ALWAYS, return None on mainnet!!!! *) + match Constants.testnet_dictator ctxt with + | Some pkh when Chain_id.(chain_id <> Constants.mainnet_id) -> Some pkh + | _ -> None + +let is_testnet_dictator ctxt chain_id delegate = + (* This function should always, ALWAYS, return false on mainnet!!!! *) + match get_testnet_dictator ctxt chain_id with + | Some pkh -> Signature.Public_key_hash.equal pkh delegate + | _ -> false + +(** Apply a [Proposals] operation from a registered dictator of a test + chain. This forcibly updates the voting period, changing the + current voting period kind and the current proposal if + applicable. Of course, there must never be such a dictator on + mainnet: see {!is_testnet_dictator}. *) +let apply_testnet_dictator_proposals ctxt chain_id proposals = + let open Lwt_result_syntax in + let*! ctxt = Vote.clear_ballots ctxt in + let*! ctxt = Vote.clear_proposals ctxt in + let*! ctxt = Vote.clear_current_proposal ctxt in + let ctxt = record_dictator_proposal_seen ctxt in + match proposals with + | [] -> + Voting_period.Testnet_dictator.overwrite_current_kind + ctxt + chain_id + Proposal + | [proposal] -> + let* ctxt = Vote.init_current_proposal ctxt proposal in + Voting_period.Testnet_dictator.overwrite_current_kind + ctxt + chain_id + Adoption + | _ :: _ :: _ -> + (* This case should not be possible if the operation has been + previously validated by {!Validate.validate_operation}. *) + tzfail Validate_errors.Voting.Testnet_dictator_multiple_proposals + +let apply_proposals ctxt chain_id (Proposals {source; period = _; proposals}) = + let open Lwt_result_syntax in + let* ctxt = + if is_testnet_dictator ctxt chain_id source then + apply_testnet_dictator_proposals ctxt chain_id proposals + else if dictator_proposal_seen ctxt then + (* Noop if dictator voted *) + return ctxt + else + let* count = Vote.get_delegate_proposal_count ctxt source in + let new_count = count + List.length proposals in + let*! ctxt = Vote.set_delegate_proposal_count ctxt source new_count in + let*! ctxt = + List.fold_left_s + (fun ctxt proposal -> Vote.add_proposal ctxt source proposal) + ctxt + proposals + in + return ctxt + in + return (ctxt, Apply_results.Single_result Proposals_result) + +let apply_ballot ctxt (Ballot {source; period = _; proposal = _; ballot}) = + let open Lwt_result_syntax in + let* ctxt = + if dictator_proposal_seen ctxt then (* Noop if dictator voted *) return ctxt + else Vote.record_ballot ctxt source ballot + in + return (ctxt, Apply_results.Single_result Ballot_result) diff --git a/src/proto_016_PtMumbai/lib_protocol/amendment.mli b/src/proto_016_PtMumbai/lib_protocol/amendment.mli new file mode 100644 index 000000000000..6bbc74d2f069 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/amendment.mli @@ -0,0 +1,133 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + Amendments and proposals. + + Only delegates having the minimal required stake take part in the amendment + procedure. It works as follows: + + - Proposal period: delegates can submit protocol amendment + proposals using the proposal operation. At the end of a proposal + period, the proposal with most supporters is selected and we move + to an exploration period. If there are no proposals, or a tie + between proposals, a new proposal period starts. + + - Exploration period: delegates can cast votes to test or not the + winning proposal using the ballot operation. At the end of an + exploration period if participation reaches the quorum and the + proposal has a supermajority in favor, we proceed to a cooldown + period. Otherwise we go back to a proposal period. In any case, if + there is enough participation the quorum is updated. + + - Cooldown period: business as usual for the main chain. This + period is only a time gap between exploration and promotion + periods intended to provide the community with extra time to + continue testing the new protocol proposal, and start adapting + their infrastructure in advance. At the end of the Cooldown + period we move to the Promotion period. + + - Promotion period: delegates can cast votes to promote or not the + proposal using the ballot operation. At the end of a promotion + period if participation reaches the quorum and the proposal has a + supermajority in favor, we move to an adoption period. Otherwise we + go back to a proposal period. In any case, if there is enough + participation the quorum is updated. + + - Adoption period: At the end of an adoption period, the proposal + is activated as the new protocol. + + The current protocol parameters are documented in + src/proto_alpha/lib_parameters/default_parameters.ml + + In practice, the real constants used are defined in the + migration code. In src/proto_alpha/lib_protocol/init_storage.ml, + function [prepare_first_block] introduces new constants and + redefines the existing ones. +*) + +open Alpha_context + +(** If at the end of a voting period, moves to the next one following + the state machine of the amendment procedure. *) +val may_start_new_voting_period : context -> context tzresult Lwt.t + +(** Return the registered testchain dictator, if any. This function will always + return None on mainnet. *) +val get_testnet_dictator : context -> Chain_id.t -> public_key_hash option + +(** Check whether the given public key hash corresponds to the + registered testchain dictator, if any. This function will always + return false on mainnet. *) +val is_testnet_dictator : context -> Chain_id.t -> public_key_hash -> bool + +(** {2 Application of voting operations} + + There are two kinds of voting operations: + + - Proposals: A delegate submits a list of protocol amendment + proposals. This operation is only accepted during a Proposal period + (see above). + + - Ballot: A delegate casts a vote for/against the current proposal + (or pass). This operation is only accepted during an Exploration + or Promotion period (see above). *) + +(** Update the [context] with the effects of a Proposals operation: + + - Its proposals are added to the source's recorded proposals. + + - The recorded proposal count of the source is increased by the + number of proposals in the operation. + + Note that a Proposals operation from a testnet dictator (which may + be set up when a test chain is initialized) has completely + different effects: + + - If the operation contains no proposal, then the current voting + period is immediately and forcibly set to a Proposal period. + + - If the operation contains exactly one proposal, then the current + voting period is immediately and forcibly set to an Adoption period + for this proposal. + + {!validate_proposals} must have been called beforehand, and is + responsible for ensuring that [apply_proposals] cannot fail. *) +val apply_proposals : + context -> + Chain_id.t -> + Kind.proposals contents -> + (context * Kind.proposals Apply_results.contents_result_list) tzresult Lwt.t + +(** Update the [context] with the effects of a Ballot operation: + + The couple (source of the operation, submitted ballot) is recorded. + + {!validate_ballot} must have been called beforehand, and is + responsible for ensuring that [apply_ballot] cannot fail. *) +val apply_ballot : + context -> + Kind.ballot contents -> + (context * Kind.ballot Apply_results.contents_result_list) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/apply.ml b/src/proto_016_PtMumbai/lib_protocol/apply.ml new file mode 100644 index 000000000000..e6b4b42e08d5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply.ml @@ -0,0 +1,3036 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Main Entry Points *) + +open Alpha_context + +type error += + | Not_enough_endorsements of {required : int; provided : int} + | Faulty_validation_wrong_slot + | Set_deposits_limit_on_unregistered_delegate of Signature.Public_key_hash.t + | Set_deposits_limit_too_high of {limit : Tez.t; max_limit : Tez.t} + | Error_while_taking_fees + | Update_consensus_key_on_unregistered_delegate of Signature.Public_key_hash.t + | Empty_transaction of Contract.t + | Tx_rollup_feature_disabled + | Tx_rollup_invalid_transaction_ticket_amount + | Sc_rollup_feature_disabled + | Internal_operation_replay of + Apply_internal_results.packed_internal_operation + | Multiple_revelation + | Zero_frozen_deposits of Signature.Public_key_hash.t + | Invalid_transfer_to_sc_rollup_from_implicit_account + +let () = + register_error_kind + `Permanent + ~id:"operation.not_enough_endorsements" + ~title:"Not enough endorsements" + ~description: + "The block being validated does not include the required minimum number \ + of endorsements." + ~pp:(fun ppf (required, provided) -> + Format.fprintf + ppf + "Wrong number of endorsements (%i), at least %i are expected" + provided + required) + Data_encoding.(obj2 (req "required" int31) (req "provided" int31)) + (function + | Not_enough_endorsements {required; provided} -> Some (required, provided) + | _ -> None) + (fun (required, provided) -> Not_enough_endorsements {required; provided}) ; + let description = + "The consensus operation uses an invalid slot. This error should not \ + happen: the operation validation should have failed earlier." + in + register_error_kind + `Permanent + ~id:"operation.faulty_validation_wrong_slot" + ~title:"Faulty validation (wrong slot for consensus operation)" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Faulty_validation_wrong_slot -> Some () | _ -> None) + (fun () -> Faulty_validation_wrong_slot) ; + register_error_kind + `Temporary + ~id:"operation.set_deposits_limit_on_unregistered_delegate" + ~title:"Set deposits limit on an unregistered delegate" + ~description:"Cannot set deposits limit on an unregistered delegate." + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Cannot set a deposits limit on the unregistered delegate %a." + Signature.Public_key_hash.pp + c) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function + | Set_deposits_limit_on_unregistered_delegate c -> Some c | _ -> None) + (fun c -> Set_deposits_limit_on_unregistered_delegate c) ; + register_error_kind + `Permanent + ~id:"operation.set_deposits_limit_too_high" + ~title:"Set deposits limit to a too high value" + ~description: + "Cannot set deposits limit such that the active stake overflows." + ~pp:(fun ppf (limit, max_limit) -> + Format.fprintf + ppf + "Cannot set deposits limit to %a as it is higher the allowed maximum \ + %a." + Tez.pp + limit + Tez.pp + max_limit) + Data_encoding.( + obj2 (req "limit" Tez.encoding) (req "max_limit" Tez.encoding)) + (function + | Set_deposits_limit_too_high {limit; max_limit} -> Some (limit, max_limit) + | _ -> None) + (fun (limit, max_limit) -> Set_deposits_limit_too_high {limit; max_limit}) ; + + let error_while_taking_fees_description = + "There was an error while taking the fees, which should not happen and \ + means that the operation's validation was faulty." + in + register_error_kind + `Permanent + ~id:"operation.error_while_taking_fees" + ~title:"Error while taking the fees of a manager operation" + ~description:error_while_taking_fees_description + ~pp:(fun ppf () -> + Format.fprintf ppf "%s" error_while_taking_fees_description) + Data_encoding.unit + (function Error_while_taking_fees -> Some () | _ -> None) + (fun () -> Error_while_taking_fees) ; + + register_error_kind + `Temporary + ~id:"operation.update_consensus_key_on_unregistered_delegate" + ~title:"Update consensus key on an unregistered delegate" + ~description:"Cannot update consensus key an unregistered delegate." + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Cannot update the consensus key on the unregistered delegate %a." + Signature.Public_key_hash.pp + c) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function + | Update_consensus_key_on_unregistered_delegate c -> Some c | _ -> None) + (fun c -> Update_consensus_key_on_unregistered_delegate c) ; + register_error_kind + `Branch + ~id:"contract.empty_transaction" + ~title:"Empty transaction" + ~description:"Forbidden to credit 0ꜩ to a contract without code." + ~pp:(fun ppf contract -> + Format.fprintf + ppf + "Transactions of 0ꜩ towards a contract without code are forbidden (%a)." + Contract.pp + contract) + Data_encoding.(obj1 (req "contract" Contract.encoding)) + (function Empty_transaction c -> Some c | _ -> None) + (fun c -> Empty_transaction c) ; + + register_error_kind + `Permanent + ~id:"operation.tx_rollup_is_disabled" + ~title:"Tx rollup is disabled" + ~description:"Cannot originate a tx rollup as it is disabled." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Cannot apply a tx rollup operation as it is disabled. This feature \ + will be enabled in a future proposal") + Data_encoding.unit + (function Tx_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Tx_rollup_feature_disabled) ; + + register_error_kind + `Permanent + ~id:"operation.tx_rollup_invalid_transaction_ticket_amount" + ~title:"Amount of transferred ticket is too high" + ~description: + "The ticket amount of a rollup transaction must fit in a signed 64-bit \ + integer." + ~pp:(fun ppf () -> + Format.fprintf ppf "Amount of transferred ticket is too high.") + Data_encoding.unit + (function + | Tx_rollup_invalid_transaction_ticket_amount -> Some () | _ -> None) + (fun () -> Tx_rollup_invalid_transaction_ticket_amount) ; + + let description = + "Smart contract rollups will be enabled in a future proposal." + in + register_error_kind + `Permanent + ~id:"operation.sc_rollup_disabled" + ~title:"Smart contract rollups are disabled" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Sc_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Sc_rollup_feature_disabled) ; + + register_error_kind + `Permanent + ~id:"internal_operation_replay" + ~title:"Internal operation replay" + ~description:"An internal operation was emitted twice by a script" + ~pp:(fun ppf (Apply_internal_results.Internal_operation {nonce; _}) -> + Format.fprintf + ppf + "Internal operation %d was emitted twice by a script" + nonce) + Apply_internal_results.internal_operation_encoding + (function Internal_operation_replay op -> Some op | _ -> None) + (fun op -> Internal_operation_replay op) ; + register_error_kind + `Permanent + ~id:"block.multiple_revelation" + ~title:"Multiple revelations were included in a manager operation" + ~description: + "A manager operation should not contain more than one revelation" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Multiple revelations were included in a manager operation") + Data_encoding.empty + (function Multiple_revelation -> Some () | _ -> None) + (fun () -> Multiple_revelation) ; + register_error_kind + `Permanent + ~id:"delegate.zero_frozen_deposits" + ~title:"Zero frozen deposits" + ~description:"The delegate has zero frozen deposits." + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "Delegate %a has zero frozen deposits; it is not allowed to \ + bake/preendorse/endorse." + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Zero_frozen_deposits delegate -> Some delegate | _ -> None) + (fun delegate -> Zero_frozen_deposits delegate) ; + register_error_kind + `Permanent + ~id:"operations.invalid_transfer_to_sc_rollup_from_implicit_account" + ~title:"Invalid transfer to sc rollup" + ~description:"Invalid transfer to sc rollup from implicit account" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Invalid source for transfer operation to smart-contract rollup. Only \ + originated accounts are allowed") + Data_encoding.empty + (function + | Invalid_transfer_to_sc_rollup_from_implicit_account -> Some () + | _ -> None) + (fun () -> Invalid_transfer_to_sc_rollup_from_implicit_account) + +open Apply_results +open Apply_operation_result +open Apply_internal_results + +let assert_tx_rollup_feature_enabled ctxt = + let open Result_syntax in + let level = (Level.current ctxt).level in + let* sunset = Raw_level.of_int32 @@ Constants.tx_rollup_sunset_level ctxt in + let* () = error_when Raw_level.(sunset <= level) Tx_rollup_feature_disabled in + error_unless (Constants.tx_rollup_enable ctxt) Tx_rollup_feature_disabled + +let assert_sc_rollup_feature_enabled ctxt = + error_unless (Constants.sc_rollup_enable ctxt) Sc_rollup_feature_disabled + +let update_script_storage_and_ticket_balances ctxt ~self_contract storage + lazy_storage_diff ticket_diffs operations = + Contract.update_script_storage ctxt self_contract storage lazy_storage_diff + >>=? fun ctxt -> + let self_contract = Contract.Originated self_contract in + Ticket_accounting.update_ticket_balances + ctxt + ~self_contract + ~ticket_diffs + operations + +let apply_delegation ~ctxt ~source ~delegate ~before_operation = + Contract.Delegate.set ctxt source delegate >|=? fun ctxt -> + (ctxt, Gas.consumed ~since:before_operation ~until:ctxt, []) + +type 'loc execution_arg = + | Typed_arg : 'loc * ('a, _) Script_typed_ir.ty * 'a -> 'loc execution_arg + | Untyped_arg : Script.expr -> _ execution_arg + +let apply_transaction_to_implicit ~ctxt ~source ~amount ~pkh ~before_operation = + let contract = Contract.Implicit pkh in + (* Transfers of zero to implicit accounts are forbidden. *) + error_when Tez.(amount = zero) (Empty_transaction contract) >>?= fun () -> + (* If the implicit contract is not yet allocated at this point then + the next transfer of tokens will allocate it. *) + Contract.allocated ctxt contract >>= fun already_allocated -> + Token.transfer ctxt (`Contract source) (`Contract contract) amount + >>=? fun (ctxt, balance_updates) -> + let result = + Transaction_to_contract_result + { + storage = None; + lazy_storage_diff = None; + balance_updates; + ticket_receipt = []; + originated_contracts = []; + consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt; + storage_size = Z.zero; + paid_storage_size_diff = Z.zero; + allocated_destination_contract = not already_allocated; + } + in + return (ctxt, result, []) + +let apply_transaction_to_implicit_with_ticket ~source ~destination ~ty ~ticket + ~amount ~before_operation ctxt = + let destination = Contract.Implicit destination in + Contract.allocated ctxt destination >>= fun already_allocated -> + let ex_token, ticket_amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket + @@ Ticket_scanner.Ex_ticket (ty, ticket) + in + Ticket_token_unparser.unparse ctxt ex_token >>=? fun (ticket_token, ctxt) -> + Token.transfer ctxt (`Contract source) (`Contract destination) amount + >>=? fun (ctxt, balance_updates) -> + let ticket_receipt = + Ticket_receipt. + [ + { + ticket_token; + updates = + [ + { + account = Destination.Contract destination; + amount = Script_int.(to_zint (ticket_amount :> n num)); + }; + ]; + }; + ] + in + return + ( ctxt, + Transaction_to_contract_result + { + storage = None; + lazy_storage_diff = None; + balance_updates; + ticket_receipt; + originated_contracts = []; + consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt; + storage_size = Z.zero; + paid_storage_size_diff = Z.zero; + allocated_destination_contract = not already_allocated; + }, + [] ) + +let apply_transaction_to_smart_contract ~ctxt ~source ~contract_hash ~amount + ~entrypoint ~before_operation ~payer ~chain_id ~internal ~parameter = + let contract = Contract.Originated contract_hash in + (* Since the contract is originated, nothing will be allocated or this + transfer of tokens will fail. [Token.transfer] will succeed even on + non-existing contracts, if the amount is zero. Then if the destination + does not exist, [Script_cache.find] will signal that by returning [None] + and we'll fail. + *) + Token.transfer ctxt (`Contract source) (`Contract contract) amount + >>=? fun (ctxt, balance_updates) -> + Script_cache.find ctxt contract_hash >>=? fun (ctxt, cache_key, script) -> + match script with + | None -> tzfail (Contract.Non_existing_contract contract) + | Some (script, script_ir) -> + (* Token.transfer which is being called before already loads this value into + the Irmin cache, so no need to burn gas for it. *) + Contract.get_balance ctxt contract >>=? fun balance -> + let now = Script_timestamp.now ctxt in + let level = + (Level.current ctxt).level |> Raw_level.to_int32 |> Script_int.of_int32 + |> Script_int.abs + in + let step_constants = + let open Script_interpreter in + { + source; + payer; + self = contract_hash; + amount; + chain_id; + balance; + now; + level; + } + in + let execute = + match parameter with + | Untyped_arg parameter -> Script_interpreter.execute ~parameter + | Typed_arg (location, parameter_ty, parameter) -> + Script_interpreter.execute_with_typed_parameter + ~location + ~parameter_ty + ~parameter + in + let cached_script = Some script_ir in + execute + ctxt + ~cached_script + Optimized + step_constants + ~script + ~entrypoint + ~internal + >>=? fun ( { + script = updated_cached_script; + code_size = updated_size; + storage; + lazy_storage_diff; + operations; + ticket_diffs; + ticket_receipt; + }, + ctxt ) -> + update_script_storage_and_ticket_balances + ctxt + ~self_contract:contract_hash + storage + lazy_storage_diff + ticket_diffs + operations + >>=? fun (ticket_table_size_diff, ctxt) -> + Ticket_balance.adjust_storage_space + ctxt + ~storage_diff:ticket_table_size_diff + >>=? fun (ticket_paid_storage_diff, ctxt) -> + Fees.record_paid_storage_space ctxt contract_hash + >>=? fun (ctxt, new_size, contract_paid_storage_size_diff) -> + Contract.originated_from_current_nonce ~since:before_operation ~until:ctxt + >>=? fun originated_contracts -> + Lwt.return + ( Script_cache.update + ctxt + cache_key + ( {script with storage = Script.lazy_expr storage}, + updated_cached_script ) + updated_size + >|? fun ctxt -> + let result = + Transaction_to_contract_result + { + storage = Some storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + originated_contracts; + consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt; + storage_size = new_size; + paid_storage_size_diff = + Z.add contract_paid_storage_size_diff ticket_paid_storage_diff; + allocated_destination_contract = false; + } + in + (ctxt, result, operations) ) + +let apply_transaction_to_tx_rollup ~ctxt ~parameters_ty ~parameters ~payer + ~dst_rollup ~since = + assert_tx_rollup_feature_enabled ctxt >>?= fun () -> + (* If the ticket deposit fails on L2 for some reason + (e.g. [Balance_overflow] in the recipient), then it is + returned to [payer]. As [payer] is implicit, it cannot own + tickets directly. Therefore, erroneous deposits are + returned using the L2 withdrawal mechanism: a failing + deposit emits a withdrawal that can be executed by + [payer]. *) + let Tx_rollup_parameters.{ex_ticket; l2_destination} = + Tx_rollup_parameters.get_deposit_parameters parameters_ty parameters + in + Ticket_scanner.ex_ticket_size ctxt ex_ticket >>=? fun (ticket_size, ctxt) -> + let limit = Constants.tx_rollup_max_ticket_payload_size ctxt in + fail_when + Saturation_repr.(ticket_size >! limit) + (Tx_rollup_errors_repr.Ticket_payload_size_limit_exceeded + {payload_size = ticket_size; limit}) + >>=? fun () -> + let ex_token, ticket_amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ex_ticket + in + Ticket_balance_key.of_ex_token ctxt ~owner:(Tx_rollup dst_rollup) ex_token + >>=? fun (ticket_hash, ctxt) -> + Option.value_e + ~error: + (Error_monad.trace_of_error Tx_rollup_invalid_transaction_ticket_amount) + (Option.bind + (Script_int.to_int64 (ticket_amount :> Script_int.n Script_int.num)) + Tx_rollup_l2_qty.of_int64) + >>?= fun ticket_amount -> + error_when + Tx_rollup_l2_qty.(ticket_amount <= zero) + Script_tc_errors.Forbidden_zero_ticket_quantity + >>?= fun () -> + let deposit, message_size = + Tx_rollup_message.make_deposit + payer + l2_destination + ticket_hash + ticket_amount + in + Tx_rollup_state.get ctxt dst_rollup >>=? fun (ctxt, state) -> + Tx_rollup_state.burn_cost ~limit:None state message_size >>?= fun cost -> + Token.transfer ctxt (`Contract (Contract.Implicit payer)) `Burned cost + >>=? fun (ctxt, balance_updates) -> + Tx_rollup_inbox.append_message ctxt dst_rollup state deposit + >>=? fun (ctxt, state, paid_storage_size_diff) -> + Tx_rollup_state.update ctxt dst_rollup state >>=? fun ctxt -> + let result = + ITransaction_result + (Transaction_to_tx_rollup_result + { + balance_updates; + consumed_gas = Gas.consumed ~since ~until:ctxt; + ticket_hash; + paid_storage_size_diff; + }) + in + return (ctxt, result, []) + +let apply_origination ~ctxt ~storage_type ~storage ~unparsed_code + ~contract:contract_hash ~delegate ~source ~credit ~before_operation = + Script_ir_translator.collect_lazy_storage ctxt storage_type storage + >>?= fun (to_duplicate, ctxt) -> + let to_update = Script_ir_translator.no_lazy_storage_id in + Script_ir_translator.extract_lazy_storage_diff + ctxt + Optimized + storage_type + storage + ~to_duplicate + ~to_update + ~temporary:false + >>=? fun (storage, lazy_storage_diff, ctxt) -> + Script_ir_translator.unparse_data ctxt Optimized storage_type storage + >>=? fun (storage, ctxt) -> + let storage = Script.lazy_expr storage in + (* Normalize code to avoid #843 *) + Script_ir_translator.unparse_code + ctxt + Optimized + (Micheline.root unparsed_code) + >>=? fun (code, ctxt) -> + let code = Script.lazy_expr code in + let script = {Script.code; storage} in + Contract.raw_originate + ctxt + ~prepaid_bootstrap_storage:false + contract_hash + ~script:(script, lazy_storage_diff) + >>=? fun ctxt -> + let contract = Contract.Originated contract_hash in + (match delegate with + | None -> return ctxt + | Some delegate -> Contract.Delegate.init ctxt contract delegate) + >>=? fun ctxt -> + Token.transfer ctxt (`Contract source) (`Contract contract) credit + >>=? fun (ctxt, balance_updates) -> + Fees.record_paid_storage_space ctxt contract_hash + >|=? fun (ctxt, size, paid_storage_size_diff) -> + let result = + { + lazy_storage_diff; + balance_updates; + originated_contracts = [contract_hash]; + consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt; + storage_size = size; + paid_storage_size_diff; + } + in + (ctxt, result, []) + +(** + + Retrieving the source code of a contract from its address is costly + because it requires I/Os. For this reason, we put the corresponding + Micheline expression in the cache. + + Elaborating a Micheline node into the well-typed script abstract + syntax tree is also a costly operation. The result of this operation + is cached as well. + +*) + +let apply_internal_operation_contents : + type kind. + context -> + payer:public_key_hash -> + source:Contract.t -> + chain_id:Chain_id.t -> + kind Script_typed_ir.internal_operation_contents -> + (context + * kind successful_internal_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t = + fun ctxt_before_op ~payer ~source ~chain_id operation -> + Contract.must_exist ctxt_before_op source >>=? fun () -> + Gas.consume ctxt_before_op Michelson_v1_gas.Cost_of.manager_operation + >>?= fun ctxt -> + (* Note that [ctxt_before_op] will be used again later to compute + gas consumption and originations for the operation result (by + comparing it with the [ctxt] we will have at the end of the + application). *) + match operation with + | Transaction_to_implicit {destination = pkh; amount} -> + apply_transaction_to_implicit + ~ctxt + ~source + ~amount + ~pkh + ~before_operation:ctxt_before_op + >|=? fun (ctxt, res, ops) -> + ( ctxt, + (ITransaction_result res : kind successful_internal_operation_result), + ops ) + | Transaction_to_implicit_with_ticket + { + destination; + ticket_ty = Script_typed_ir.Ticket_t (ty, _ty_metadata); + ticket; + amount; + unparsed_ticket = _; + } -> + apply_transaction_to_implicit_with_ticket + ~source + ~destination + ~ty + ~ticket + ~amount + ~before_operation:ctxt_before_op + ctxt + >|=? fun (ctxt, res, ops) -> + ( ctxt, + (ITransaction_result res : kind successful_internal_operation_result), + ops ) + | Transaction_to_smart_contract + { + amount; + destination = contract_hash; + entrypoint; + location; + parameters_ty; + parameters = typed_parameters; + unparsed_parameters = _; + } -> + apply_transaction_to_smart_contract + ~ctxt + ~source + ~contract_hash + ~amount + ~entrypoint + ~before_operation:ctxt_before_op + ~payer + ~chain_id + ~internal:true + ~parameter:(Typed_arg (location, parameters_ty, typed_parameters)) + >|=? fun (ctxt, res, ops) -> (ctxt, ITransaction_result res, ops) + | Transaction_to_tx_rollup + {destination; unparsed_parameters = _; parameters_ty; parameters} -> + apply_transaction_to_tx_rollup + ~ctxt + ~parameters_ty + ~parameters + ~payer + ~dst_rollup:destination + ~since:ctxt_before_op + | Transaction_to_sc_rollup + { + destination; + entrypoint = _; + parameters_ty; + parameters; + unparsed_parameters = payload; + } -> + assert_sc_rollup_feature_enabled ctxt >>?= fun () -> + (* TODO: #3242 + We could rather change the type of [source] in + {!Script_type_ir.internal_operation}. Only originated accounts should + be allowed anyway for internal operations. + *) + (match source with + | Contract.Implicit _ -> + error Invalid_transfer_to_sc_rollup_from_implicit_account + | Originated hash -> ok hash) + >>?= fun sender -> + (* Adding the message to the inbox. Note that it is safe to ignore the + size diff since only its hash and meta data are stored in the context. + See #3232. *) + Sc_rollup.Inbox.add_deposit + ctxt + ~destination + ~payload + ~sender + ~source:payer + >>=? fun ctxt -> + Ticket_scanner.type_has_tickets ctxt parameters_ty + >>?= fun (has_tickets, ctxt) -> + Ticket_accounting.ticket_balances_of_value + ctxt + ~include_lazy:true + has_tickets + parameters + >>=? fun (ticket_token_map, ctxt) -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4354 + Factor out function for constructing a ticket receipt. + There are multiple places where we compute the receipt from a + ticket-token-map. We should factor out and reuse this logic. *) + Ticket_token_map.fold_es + ctxt + (fun ctxt acc ex_token amount -> + Ticket_token_unparser.unparse ctxt ex_token + >>=? fun (ticket_token, ctxt) -> + let item = + Ticket_receipt. + { + ticket_token; + updates = + [{account = Destination.Sc_rollup destination; amount}]; + } + in + return (item :: acc, ctxt)) + [] + ticket_token_map + >|=? fun (ticket_receipt, ctxt) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt} + in + (ctxt, ITransaction_result result, []) + | Event {ty = _; unparsed_data = _; tag = _} -> + return + ( ctxt, + IEvent_result + {consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt}, + [] ) + | Transaction_to_zk_rollup + {destination; unparsed_parameters = _; parameters_ty; parameters} -> + Zk_rollup_apply.transaction_to_zk_rollup + ~ctxt + ~parameters_ty + ~parameters + ~dst_rollup:destination + ~since:ctxt_before_op + | Origination + { + delegate; + code = unparsed_code; + unparsed_storage = _; + credit; + preorigination; + storage_type; + storage; + } -> + apply_origination + ~ctxt + ~storage_type + ~storage + ~unparsed_code + ~contract:preorigination + ~delegate + ~source + ~credit + ~before_operation:ctxt_before_op + >|=? fun (ctxt, origination_result, ops) -> + (ctxt, IOrigination_result origination_result, ops) + | Delegation delegate -> + apply_delegation ~ctxt ~source ~delegate ~before_operation:ctxt_before_op + >|=? fun (ctxt, consumed_gas, ops) -> + (ctxt, IDelegation_result {consumed_gas}, ops) + +let apply_manager_operation : + type kind. + context -> + source:public_key_hash -> + chain_id:Chain_id.t -> + kind manager_operation -> + (context + * kind successful_manager_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t = + fun ctxt_before_op ~source ~chain_id operation -> + let source_contract = Contract.Implicit source in + Gas.consume ctxt_before_op Michelson_v1_gas.Cost_of.manager_operation + >>?= fun ctxt -> + (* Note that [ctxt_before_op] will be used again later to compute + gas consumption and originations for the operation result (by + comparing it with the [ctxt] we will have at the end of the + application). *) + let consume_deserialization_gas = + (* Note that we used to set this to [Script.When_needed] because + the deserialization gas was accounted for in the gas consumed + by precheck. However, we no longer have access to this precheck + gas, so we want to always consume the deserialization gas + again, independently of the internal state of the lazy_exprs in + the arguments. *) + Script.Always + in + match operation with + | Reveal pk -> + (* TODO #2603 + + Even if [precheck_manager_contents] has already asserted that + the implicit contract is allocated, we must re-do this check in + case the manager has been emptied while collecting fees. This + should be solved by forking out [validate_operation] from + [apply_operation]. *) + Contract.must_be_allocated ctxt source_contract >>=? fun () -> + (* TODO tezos/tezos#3070 + + We have already asserted the consistency of the supplied public + key during precheck, so we avoid re-checking that precondition + with [?check_consistency=false]. This optional parameter is + temporary, to avoid breaking compatibility with external legacy + usage of [Contract.reveal_manager_key]. However, the pattern of + using [Contract.check_public_key] and this usage of + [Contract.reveal_manager_key] should become the standard. *) + Contract.reveal_manager_key ~check_consistency:false ctxt source pk + >>=? fun ctxt -> + return + ( ctxt, + (Reveal_result + {consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt} + : kind successful_manager_operation_result), + [] ) + | Transaction {amount; parameters; destination = Implicit pkh; entrypoint} -> + Script.force_decode_in_context + ~consume_deserialization_gas + ctxt + parameters + >>?= fun (parameters, ctxt) -> + (* Only allow [Unit] parameter to implicit accounts. *) + (match Micheline.root parameters with + | Prim (_, Michelson_v1_primitives.D_Unit, [], _) -> Result.return_unit + | _ -> error (Script_interpreter.Bad_contract_parameter source_contract)) + >>?= fun () -> + (if Entrypoint.is_default entrypoint then Result.return_unit + else error (Script_tc_errors.No_such_entrypoint entrypoint)) + >>?= fun () -> + apply_transaction_to_implicit + ~ctxt + ~source:source_contract + ~amount + ~pkh + ~before_operation:ctxt_before_op + >|=? fun (ctxt, res, ops) -> (ctxt, Transaction_result res, ops) + | Transaction + {amount; parameters; destination = Originated contract_hash; entrypoint} + -> + Script.force_decode_in_context + ~consume_deserialization_gas + ctxt + parameters + >>?= fun (parameters, ctxt) -> + apply_transaction_to_smart_contract + ~ctxt + ~source:source_contract + ~contract_hash + ~amount + ~entrypoint + ~before_operation:ctxt_before_op + ~payer:source + ~chain_id + ~internal:false + ~parameter:(Untyped_arg parameters) + >|=? fun (ctxt, res, ops) -> (ctxt, Transaction_result res, ops) + | Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + message_result_path; + tickets_info; + } -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_commitment.get_finalized ctxt tx_rollup state level + >>=? fun (ctxt, commitment) -> + Tx_rollup_reveal.mem ctxt tx_rollup level ~message_position:message_index + >>=? fun (ctxt, already_revealed) -> + error_when + already_revealed + Tx_rollup_errors.Withdrawals_already_dispatched + >>?= fun () -> + (* The size of the list [tickets_info] is bounded by a + parametric constant, and checked in precheck. *) + List.fold_left_es + (fun (acc_withdraw, acc, ctxt) + Tx_rollup_reveal.{contents; ty; ticketer; amount; claimer} -> + error_when + Tx_rollup_l2_qty.(amount <= zero) + Script_tc_errors.Forbidden_zero_ticket_quantity + >>?= fun () -> + Ticket_transfer.parse_ticket + ~consume_deserialization_gas + ~ticketer + ~contents + ~ty + ctxt + >>=? fun (ctxt, ticket_token) -> + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Tx_rollup tx_rollup) + ticket_token + >>=? fun (ticket_hash, ctxt) -> + let withdrawal = Tx_rollup_withdraw.{claimer; ticket_hash; amount} in + return + (withdrawal :: acc_withdraw, (withdrawal, ticket_token) :: acc, ctxt)) + ([], [], ctxt) + tickets_info + >>=? fun (rev_withdraw_list, rev_ex_token_and_hash_list, ctxt) -> + Tx_rollup_hash.withdraw_list ctxt (List.rev rev_withdraw_list) + >>?= fun (ctxt, withdraw_list_hash) -> + Tx_rollup_commitment.check_message_result + ctxt + commitment.commitment + (`Result {context_hash; withdraw_list_hash}) + ~path:message_result_path + ~index:message_index + >>?= fun ctxt -> + Tx_rollup_reveal.record + ctxt + tx_rollup + level + ~message_position:message_index + >>=? fun ctxt -> + let adjust_ticket_balance (ctxt, acc_diff) + ( Tx_rollup_withdraw. + {claimer; amount; ticket_hash = tx_rollup_ticket_hash}, + ticket_token ) = + Tx_rollup_l2_qty.to_z amount + |> Ticket_amount.of_zint + |> Option.value_e + ~error: + (Error_monad.trace_of_error + Script_tc_errors.Forbidden_zero_ticket_quantity) + >>?= fun amount -> + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract (Contract.Implicit claimer)) + ticket_token + >>=? fun (claimer_ticket_hash, ctxt) -> + Ticket_transfer.transfer_ticket_with_hashes + ctxt + ~src_hash:tx_rollup_ticket_hash + ~dst_hash:claimer_ticket_hash + amount + >>=? fun (ctxt, diff) -> return (ctxt, Z.(add acc_diff diff)) + in + List.fold_left_es + adjust_ticket_balance + (ctxt, Z.zero) + rev_ex_token_and_hash_list + >>=? fun (ctxt, paid_storage_size_diff) -> + let result = + Tx_rollup_dispatch_tickets_result + { + balance_updates = []; + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + paid_storage_size_diff; + } + in + return (ctxt, result, []) + | Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint} + -> ( + match destination with + | Implicit _ -> + error_unless + Entrypoint.(entrypoint = default) + (Script_tc_errors.No_such_entrypoint entrypoint) + >>?= fun () -> + Ticket_transfer.parse_ticket + ~consume_deserialization_gas + ~ticketer + ~contents + ~ty + ctxt + >>=? fun (ctxt, ticket) -> + Ticket_transfer.transfer_ticket + ctxt + ~src:(Contract source_contract) + ~dst:(Contract destination) + ticket + amount + >>=? fun (ctxt, paid_storage_size_diff) -> + Ticket_token_unparser.unparse ctxt ticket + >>=? fun (ticket_token, ctxt) -> + let amount = Script_int.(to_zint (amount :> n num)) in + let ticket_receipt = + Ticket_receipt. + [ + { + ticket_token; + updates = + [ + {account = Contract source_contract; amount = Z.neg amount}; + {account = Contract destination; amount}; + ]; + }; + ] + in + return + ( ctxt, + Transfer_ticket_result + { + balance_updates = []; + ticket_receipt; + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + paid_storage_size_diff; + }, + [] ) + | Originated destination_hash -> + Ticket_transfer.parse_ticket_and_operation + ~consume_deserialization_gas + ~ticketer + ~contents + ~ty + ~source:source_contract + ~destination:destination_hash + ~entrypoint + ~amount + ctxt + >>=? fun (ctxt, token, op) -> + Ticket_transfer.transfer_ticket + ctxt + ~src:(Contract source_contract) + ~dst:(Contract destination) + token + amount + >>=? fun (ctxt, paid_storage_size_diff) -> + Ticket_token_unparser.unparse ctxt token + >>=? fun (ticket_token, ctxt) -> + let amount = Script_int.(to_zint (amount :> n num)) in + let ticket_receipt = + Ticket_receipt. + [ + { + ticket_token; + updates = + [ + {account = Contract source_contract; amount = Z.neg amount} + (* The transfer of the ticket to [destination] is part of the internal operation [op]. *); + ]; + }; + ] + in + return + ( ctxt, + Transfer_ticket_result + { + balance_updates = []; + ticket_receipt; + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + paid_storage_size_diff; + }, + [op] )) + | Origination {delegate; script; credit} -> + (* Internal originations have their address generated in the interpreter + so that the script can use it immediately. + The address of external originations is generated here. *) + Contract.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, contract) -> + Script.force_decode_in_context + ~consume_deserialization_gas + ctxt + script.Script.storage + >>?= fun (_unparsed_storage, ctxt) -> + Script.force_decode_in_context + ~consume_deserialization_gas + ctxt + script.Script.code + >>?= fun (unparsed_code, ctxt) -> + Script_ir_translator.parse_script + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + ~allow_forged_in_storage:false + script + >>=? fun (Ex_script parsed_script, ctxt) -> + let (Script {storage_type; views; storage; _}) = parsed_script in + let views_result = + Script_ir_translator.parse_views + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + storage_type + views + in + trace + (Script_tc_errors.Ill_typed_contract (unparsed_code, [])) + views_result + >>=? fun (_typed_views, ctxt) -> + apply_origination + ~ctxt + ~storage_type + ~storage + ~unparsed_code + ~contract + ~delegate + ~source:source_contract + ~credit + ~before_operation:ctxt_before_op + >|=? fun (ctxt, origination_result, ops) -> + (ctxt, Origination_result origination_result, ops) + | Delegation delegate -> + apply_delegation + ~ctxt + ~source:source_contract + ~delegate + ~before_operation:ctxt_before_op + >|=? fun (ctxt, consumed_gas, ops) -> + (ctxt, Delegation_result {consumed_gas}, ops) + | Register_global_constant {value} -> + (* Decode the value and consume gas appropriately *) + Script.force_decode_in_context ~consume_deserialization_gas ctxt value + >>?= fun (expr, ctxt) -> + (* Set the key to the value in storage. *) + Global_constants_storage.register ctxt expr + >>=? fun (ctxt, address, size) -> + (* The burn and the reporting of the burn are calculated differently. + + [Fees.record_global_constant_storage_space] does the actual burn + based on the size of the constant registered, and this causes a + change in account balance. + + On the other hand, the receipt is calculated + with the help of [Fees.cost_of_bytes], and is included in block metadata + and the client output. The receipt is also used during simulation, + letting the client automatically set an appropriate storage limit. + TODO : is this concern still honored by the token management + refactoring ? *) + let ctxt, paid_size = + Fees.record_global_constant_storage_space ctxt size + in + let result = + Register_global_constant_result + { + balance_updates = []; + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + size_of_constant = paid_size; + global_address = address; + } + in + return (ctxt, result, []) + | Set_deposits_limit limit -> + (match limit with + | None -> Result.return_unit + | Some limit -> + let frozen_deposits_percentage = + Constants.frozen_deposits_percentage ctxt + in + let max_limit = + Tez.of_mutez_exn + Int64.( + mul (of_int frozen_deposits_percentage) Int64.(div max_int 100L)) + in + error_when + Tez.(limit > max_limit) + (Set_deposits_limit_too_high {limit; max_limit})) + >>?= fun () -> + Delegate.registered ctxt source >>= fun is_registered -> + error_unless + is_registered + (Set_deposits_limit_on_unregistered_delegate source) + >>?= fun () -> + Delegate.set_frozen_deposits_limit ctxt source limit >>= fun ctxt -> + return + ( ctxt, + Set_deposits_limit_result + {consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt}, + [] ) + | Increase_paid_storage {amount_in_bytes; destination} -> + Contract.increase_paid_storage ctxt destination ~amount_in_bytes + >>=? fun ctxt -> + let payer = `Contract (Contract.Implicit source) in + Fees.burn_storage_increase_fees ctxt ~payer amount_in_bytes + >|=? fun (ctxt, storage_bus) -> + let result = + Increase_paid_storage_result + { + balance_updates = storage_bus; + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + } + in + (ctxt, result, []) + | Update_consensus_key pk -> + Delegate.registered ctxt source >>= fun is_registered -> + error_unless + is_registered + (Update_consensus_key_on_unregistered_delegate source) + >>?= fun () -> + Delegate.Consensus_key.register_update ctxt source pk >>=? fun ctxt -> + return + ( ctxt, + Update_consensus_key_result + {consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt}, + [] ) + | Tx_rollup_origination -> + Tx_rollup.originate ctxt >>=? fun (ctxt, originated_tx_rollup) -> + let result = + Tx_rollup_origination_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + originated_tx_rollup; + balance_updates = []; + } + in + return (ctxt, result, []) + | Tx_rollup_submit_batch {tx_rollup; content; burn_limit} -> + let message, message_size = Tx_rollup_message.make_batch content in + Tx_rollup_gas.hash_cost message_size >>?= fun cost -> + Gas.consume ctxt cost >>?= fun ctxt -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_inbox.append_message ctxt tx_rollup state message + >>=? fun (ctxt, state, paid_storage_size_diff) -> + Tx_rollup_state.burn_cost ~limit:burn_limit state message_size + >>?= fun cost -> + Token.transfer ctxt (`Contract source_contract) `Burned cost + >>=? fun (ctxt, balance_updates) -> + Tx_rollup_state.update ctxt tx_rollup state >>=? fun ctxt -> + let result = + Tx_rollup_submit_batch_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates; + paid_storage_size_diff; + } + in + return (ctxt, result, []) + | Tx_rollup_commit {tx_rollup; commitment} -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + ( Tx_rollup_commitment.has_bond ctxt tx_rollup source + >>=? fun (ctxt, pending) -> + if not pending then + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + Token.transfer + ctxt + (`Contract source_contract) + (`Frozen_bonds (source_contract, bond_id)) + (Constants.tx_rollup_commitment_bond ctxt) + else return (ctxt, []) ) + >>=? fun (ctxt, balance_updates) -> + Tx_rollup_commitment.add_commitment ctxt tx_rollup state source commitment + >>=? fun (ctxt, state, to_slash) -> + (match to_slash with + | Some pkh -> + let committer = Contract.Implicit pkh in + Tx_rollup_commitment.slash_bond ctxt tx_rollup pkh + >>=? fun (ctxt, slashed) -> + if slashed then + let bid = Bond_id.Tx_rollup_bond_id tx_rollup in + Token.balance ctxt (`Frozen_bonds (committer, bid)) + >>=? fun (ctxt, burn) -> + Token.transfer + ctxt + (`Frozen_bonds (committer, bid)) + `Tx_rollup_rejection_punishments + burn + else return (ctxt, []) + | None -> return (ctxt, [])) + >>=? fun (ctxt, burn_update) -> + Tx_rollup_state.update ctxt tx_rollup state >>=? fun ctxt -> + let result = + Tx_rollup_commit_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates = burn_update @ balance_updates; + } + in + return (ctxt, result, []) + | Tx_rollup_return_bond {tx_rollup} -> + Tx_rollup_commitment.remove_bond ctxt tx_rollup source >>=? fun ctxt -> + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + Token.balance ctxt (`Frozen_bonds (source_contract, bond_id)) + >>=? fun (ctxt, bond) -> + Token.transfer + ctxt + (`Frozen_bonds (source_contract, bond_id)) + (`Contract source_contract) + bond + >>=? fun (ctxt, balance_updates) -> + let result = + Tx_rollup_return_bond_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates; + } + in + return (ctxt, result, []) + | Tx_rollup_finalize_commitment {tx_rollup} -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_commitment.finalize_commitment ctxt tx_rollup state + >>=? fun (ctxt, state, level) -> + Tx_rollup_state.update ctxt tx_rollup state >>=? fun ctxt -> + let result = + Tx_rollup_finalize_commitment_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates = []; + level; + } + in + return (ctxt, result, []) + | Tx_rollup_remove_commitment {tx_rollup} -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_commitment.remove_commitment ctxt tx_rollup state + >>=? fun (ctxt, state, level) -> + Tx_rollup_state.update ctxt tx_rollup state >>=? fun ctxt -> + let result = + Tx_rollup_remove_commitment_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates = []; + level; + } + in + return (ctxt, result, []) + | Tx_rollup_rejection + { + proof; + tx_rollup; + level; + message; + message_position; + message_path; + message_result_hash; + message_result_path; + previous_message_result; + previous_message_result_path; + } -> ( + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + (* Check [level] *) + Tx_rollup_state.check_level_can_be_rejected state level >>?= fun () -> + Tx_rollup_commitment.get ctxt tx_rollup state level + >>=? fun (ctxt, commitment) -> + (* Check [message] *) + error_when + Compare.Int.( + message_position < 0 + || commitment.commitment.messages.count <= message_position) + (Tx_rollup_errors.Wrong_message_position + { + level = commitment.commitment.level; + position = message_position; + length = commitment.commitment.messages.count; + }) + >>?= fun () -> + Tx_rollup_inbox.check_message_hash + ctxt + level + tx_rollup + ~position:message_position + message + message_path + >>=? fun ctxt -> + (* Check message result paths *) + Tx_rollup_commitment.check_agreed_and_disputed_results + ctxt + tx_rollup + state + commitment + ~agreed_result:previous_message_result + ~agreed_result_path:previous_message_result_path + ~disputed_result:message_result_hash + ~disputed_result_path:message_result_path + ~disputed_position:message_position + >>=? fun ctxt -> + (* Check [proof] *) + let parameters = + Tx_rollup_l2_apply. + { + tx_rollup_max_withdrawals_per_batch = + Constants.tx_rollup_max_withdrawals_per_batch ctxt; + } + in + let proof_length = Tx_rollup_l2_proof.length proof in + match Tx_rollup_l2_proof.proof_of_serialized_opt proof with + | Some proof -> + Tx_rollup_l2_verifier.verify_proof + ctxt + parameters + message + proof + ~proof_length + ~agreed:previous_message_result + ~rejected:message_result_hash + ~max_proof_size:(Constants.tx_rollup_rejection_max_proof_size ctxt) + >>=? fun ctxt -> + (* Proof is correct, removing *) + Tx_rollup_commitment.reject_commitment ctxt tx_rollup state level + >>=? fun (ctxt, state) -> + (* Bond slashing, and removing *) + Tx_rollup_commitment.slash_bond ctxt tx_rollup commitment.committer + >>=? fun (ctxt, slashed) -> + (if slashed then + let committer = Contract.Implicit commitment.committer in + let bid = Bond_id.Tx_rollup_bond_id tx_rollup in + Token.balance ctxt (`Frozen_bonds (committer, bid)) + >>=? fun (ctxt, burn) -> + Tez.(burn /? 2L) >>?= fun reward -> + Token.transfer + ctxt + (`Frozen_bonds (committer, bid)) + `Tx_rollup_rejection_punishments + burn + >>=? fun (ctxt, burn_update) -> + Token.transfer + ctxt + `Tx_rollup_rejection_rewards + (`Contract source_contract) + reward + >>=? fun (ctxt, reward_update) -> + return (ctxt, burn_update @ reward_update) + else return (ctxt, [])) + >>=? fun (ctxt, balance_updates) -> + (* Update state and conclude *) + Tx_rollup_state.update ctxt tx_rollup state >>=? fun ctxt -> + let result = + Tx_rollup_rejection_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates; + } + in + return (ctxt, result, []) + | None -> tzfail Tx_rollup_errors.Proof_undecodable) + | Dal_publish_slot_header slot_header -> + Dal_apply.apply_publish_slot_header ctxt slot_header >>?= fun ctxt -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = Dal_publish_slot_header_result {consumed_gas} in + return (ctxt, result, []) + | Sc_rollup_originate {kind; boot_sector; origination_proof; parameters_ty} -> + Sc_rollup_operations.originate + ctxt + ~kind + ~boot_sector + ~origination_proof + ~parameters_ty + >>=? fun ({address; size; genesis_commitment_hash}, ctxt) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_originate_result + { + address; + genesis_commitment_hash; + consumed_gas; + size; + balance_updates = []; + } + in + return (ctxt, result, []) + | Sc_rollup_add_messages {messages} -> + Sc_rollup.Inbox.add_external_messages ctxt messages >>=? fun ctxt -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = Sc_rollup_add_messages_result {consumed_gas} in + return (ctxt, result, []) + | Sc_rollup_cement {rollup; commitment} -> + Sc_rollup.Stake_storage.cement_commitment ctxt rollup commitment + >>=? fun (ctxt, commitment) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_cement_result + {consumed_gas; inbox_level = commitment.inbox_level} + in + return (ctxt, result, []) + | Sc_rollup_publish {rollup; commitment} -> + Sc_rollup.Stake_storage.publish_commitment ctxt rollup source commitment + >>=? fun (staked_hash, published_at_level, ctxt, balance_updates) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_publish_result + {staked_hash; consumed_gas; published_at_level; balance_updates} + in + return (ctxt, result, []) + | Sc_rollup_refute {rollup; opponent; refutation} -> + let open Sc_rollup.Refutation_storage in + let player = source in + (match refutation with + | None -> + start_game ctxt rollup ~player ~opponent >>=? fun ctxt -> + return (None, ctxt) + | Some refutation -> game_move ctxt rollup ~player ~opponent refutation) + >>=? fun (game_result, ctxt) -> + (match game_result with + | None -> return (Sc_rollup.Game.Ongoing, ctxt, []) + | Some game_result -> + let stakers = Sc_rollup.Game.Index.make source opponent in + Sc_rollup.Refutation_storage.apply_game_result + ctxt + rollup + stakers + game_result) + >>=? fun (game_status, ctxt, balance_updates) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_refute_result {game_status; consumed_gas; balance_updates} + in + return (ctxt, result, []) + | Sc_rollup_timeout {rollup; stakers} -> + Sc_rollup.Refutation_storage.timeout ctxt rollup stakers + >>=? fun (game_result, ctxt) -> + Sc_rollup.Refutation_storage.apply_game_result + ctxt + rollup + stakers + game_result + >>=? fun (game_status, ctxt, balance_updates) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_timeout_result {game_status; consumed_gas; balance_updates} + in + return (ctxt, result, []) + | Sc_rollup_execute_outbox_message {rollup; cemented_commitment; output_proof} + -> + Sc_rollup_operations.execute_outbox_message + ctxt + rollup + ~cemented_commitment + ~source + ~output_proof + >|=? fun ( { + Sc_rollup_operations.paid_storage_size_diff; + ticket_receipt; + operations; + }, + ctxt ) -> + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Sc_rollup_execute_outbox_message_result + { + paid_storage_size_diff; + ticket_receipt; + balance_updates = []; + consumed_gas; + } + in + (ctxt, result, operations) + | Sc_rollup_recover_bond {sc_rollup; staker} -> + Sc_rollup.Stake_storage.withdraw_stake ctxt sc_rollup staker + >>=? fun (ctxt, balance_updates) -> + let result = + Sc_rollup_recover_bond_result + { + consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt; + balance_updates; + } + in + return (ctxt, result, []) + | Zk_rollup_origination {public_parameters; circuits_info; init_state; nb_ops} + -> + Zk_rollup_apply.originate + ~ctxt_before_op + ~ctxt + ~public_parameters + ~circuits_info + ~init_state + ~nb_ops + | Zk_rollup_publish {zk_rollup; ops} -> + Zk_rollup_apply.publish ~ctxt_before_op ~ctxt ~zk_rollup ~l2_ops:ops + | Zk_rollup_update {zk_rollup; update} -> + Zk_rollup_apply.update ~ctxt_before_op ~ctxt ~zk_rollup ~update + +type success_or_failure = Success of context | Failure + +let apply_internal_operations ctxt ~payer ~chain_id ops = + let rec apply ctxt applied worklist = + match worklist with + | [] -> Lwt.return (Success ctxt, List.rev applied) + | Script_typed_ir.Internal_operation ({source; operation; nonce} as op) + :: rest -> ( + (if internal_nonce_already_recorded ctxt nonce then + let op_res = Apply_internal_results.internal_operation op in + tzfail (Internal_operation_replay (Internal_operation op_res)) + else + let ctxt = record_internal_nonce ctxt nonce in + apply_internal_operation_contents + ctxt + ~source + ~payer + ~chain_id + operation) + >>= function + | Error errors -> + let result = + pack_internal_operation_result + op + (Failed (Script_typed_ir.manager_kind op.operation, errors)) + in + let skipped = + List.rev_map + (fun (Script_typed_ir.Internal_operation op) -> + pack_internal_operation_result + op + (Skipped (Script_typed_ir.manager_kind op.operation))) + rest + in + Lwt.return (Failure, List.rev (skipped @ (result :: applied))) + | Ok (ctxt, result, emitted) -> + apply + ctxt + (pack_internal_operation_result op (Applied result) :: applied) + (emitted @ rest)) + in + apply ctxt [] ops + +let burn_transaction_storage_fees ctxt trr ~storage_limit ~payer = + match trr with + | Transaction_to_contract_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >>=? fun (ctxt, storage_limit, storage_bus) -> + (if payload.allocated_destination_contract then + Fees.burn_origination_fees ctxt ~storage_limit ~payer + else return (ctxt, storage_limit, [])) + >>=? fun (ctxt, storage_limit, origination_bus) -> + let balance_updates = + storage_bus @ payload.balance_updates @ origination_bus + in + return + ( ctxt, + storage_limit, + Transaction_to_contract_result + { + storage = payload.storage; + lazy_storage_diff = payload.lazy_storage_diff; + balance_updates; + ticket_receipt = payload.ticket_receipt; + originated_contracts = payload.originated_contracts; + consumed_gas = payload.consumed_gas; + storage_size = payload.storage_size; + paid_storage_size_diff = payload.paid_storage_size_diff; + allocated_destination_contract = + payload.allocated_destination_contract; + } ) + | Transaction_to_tx_rollup_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >>=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + return + ( ctxt, + storage_limit, + Transaction_to_tx_rollup_result {payload with balance_updates} ) + | Transaction_to_sc_rollup_result _ -> return (ctxt, storage_limit, trr) + | Transaction_to_zk_rollup_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >>=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + return + ( ctxt, + storage_limit, + Transaction_to_zk_rollup_result {payload with balance_updates} ) + +let burn_origination_storage_fees ctxt + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + } ~storage_limit ~payer = + let consumed = paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >>=? fun (ctxt, storage_limit, storage_bus) -> + Fees.burn_origination_fees ctxt ~storage_limit ~payer + >>=? fun (ctxt, storage_limit, origination_bus) -> + let balance_updates = storage_bus @ origination_bus @ balance_updates in + return + ( ctxt, + storage_limit, + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + } ) + +(** [burn_manager_storage_fees ctxt smopr storage_limit payer] burns the + storage fees associated to an external operation result [smopr]. + Returns an updated context, an updated storage limit with the space consumed + by the operation subtracted, and [smopr] with the relevant balance updates + included. *) +let burn_manager_storage_fees : + type kind. + context -> + kind successful_manager_operation_result -> + storage_limit:Z.t -> + payer:public_key_hash -> + (context * Z.t * kind successful_manager_operation_result) tzresult Lwt.t = + fun ctxt smopr ~storage_limit ~payer -> + let payer = `Contract (Contract.Implicit payer) in + match smopr with + | Transaction_result transaction_result -> + burn_transaction_storage_fees + ctxt + transaction_result + ~storage_limit + ~payer + >>=? fun (ctxt, storage_limit, transaction_result) -> + return (ctxt, storage_limit, Transaction_result transaction_result) + | Origination_result origination_result -> + burn_origination_storage_fees + ctxt + origination_result + ~storage_limit + ~payer + >>=? fun (ctxt, storage_limit, origination_result) -> + return (ctxt, storage_limit, Origination_result origination_result) + | Reveal_result _ | Delegation_result _ -> return (ctxt, storage_limit, smopr) + | Register_global_constant_result payload -> + let consumed = payload.size_of_constant in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + ( ctxt, + storage_limit, + Register_global_constant_result + { + balance_updates; + consumed_gas = payload.consumed_gas; + size_of_constant = payload.size_of_constant; + global_address = payload.global_address; + } ) + | Set_deposits_limit_result _ | Update_consensus_key_result _ -> + return (ctxt, storage_limit, smopr) + | Increase_paid_storage_result _ -> return (ctxt, storage_limit, smopr) + | Tx_rollup_origination_result payload -> + Fees.burn_tx_rollup_origination_fees ctxt ~storage_limit ~payer + >|=? fun (ctxt, storage_limit, origination_bus) -> + let balance_updates = origination_bus @ payload.balance_updates in + ( ctxt, + storage_limit, + Tx_rollup_origination_result {payload with balance_updates} ) + | Tx_rollup_return_bond_result _ | Tx_rollup_remove_commitment_result _ + | Tx_rollup_rejection_result _ | Tx_rollup_finalize_commitment_result _ + | Tx_rollup_commit_result _ -> + return (ctxt, storage_limit, smopr) + | Transfer_ticket_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = payload.balance_updates @ storage_bus in + ( ctxt, + storage_limit, + Transfer_ticket_result {payload with balance_updates} ) + | Tx_rollup_submit_batch_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + ( ctxt, + storage_limit, + Tx_rollup_submit_batch_result {payload with balance_updates} ) + | Tx_rollup_dispatch_tickets_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + ( ctxt, + storage_limit, + Tx_rollup_dispatch_tickets_result {payload with balance_updates} ) + | Dal_publish_slot_header_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_originate_result payload -> + Fees.burn_sc_rollup_origination_fees + ctxt + ~storage_limit + ~payer + payload.size + >|=? fun (ctxt, storage_limit, balance_updates) -> + let result = Sc_rollup_originate_result {payload with balance_updates} in + (ctxt, storage_limit, result) + | Sc_rollup_add_messages_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_cement_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_publish_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_refute_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_timeout_result _ -> return (ctxt, storage_limit, smopr) + | Sc_rollup_execute_outbox_message_result + ({paid_storage_size_diff; balance_updates; _} as payload) -> + let consumed = paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ balance_updates in + ( ctxt, + storage_limit, + Sc_rollup_execute_outbox_message_result {payload with balance_updates} + ) + | Sc_rollup_recover_bond_result _ -> return (ctxt, storage_limit, smopr) + | Zk_rollup_origination_result payload -> + Fees.burn_zk_rollup_origination_fees + ctxt + ~storage_limit + ~payer + payload.storage_size + >>=? fun (ctxt, storage_limit, balance_updates) -> + let result = + Zk_rollup_origination_result {payload with balance_updates} + in + return (ctxt, storage_limit, result) + | Zk_rollup_publish_result payload -> + let consumed = payload.paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ payload.balance_updates in + ( ctxt, + storage_limit, + Zk_rollup_publish_result {payload with balance_updates} ) + | Zk_rollup_update_result + ({paid_storage_size_diff; balance_updates; _} as payload) -> + let consumed = paid_storage_size_diff in + Fees.burn_storage_fees ctxt ~storage_limit ~payer consumed + >|=? fun (ctxt, storage_limit, storage_bus) -> + let balance_updates = storage_bus @ balance_updates in + ( ctxt, + storage_limit, + Zk_rollup_update_result {payload with balance_updates} ) + +(** [burn_internal_storage_fees ctxt smopr storage_limit payer] burns the + storage fees associated to an internal operation result [smopr]. + Returns an updated context, an updated storage limit with the space consumed + by the operation subtracted, and [smopr] with the relevant balance updates + included. *) +let burn_internal_storage_fees : + type kind. + context -> + kind successful_internal_operation_result -> + storage_limit:Z.t -> + payer:public_key_hash -> + (context * Z.t * kind successful_internal_operation_result) tzresult Lwt.t = + fun ctxt smopr ~storage_limit ~payer -> + let payer = `Contract (Contract.Implicit payer) in + match smopr with + | ITransaction_result transaction_result -> + burn_transaction_storage_fees + ctxt + transaction_result + ~storage_limit + ~payer + >|=? fun (ctxt, storage_limit, transaction_result) -> + (ctxt, storage_limit, ITransaction_result transaction_result) + | IOrigination_result origination_result -> + burn_origination_storage_fees + ctxt + origination_result + ~storage_limit + ~payer + >|=? fun (ctxt, storage_limit, origination_result) -> + (ctxt, storage_limit, IOrigination_result origination_result) + | IDelegation_result _ -> return (ctxt, storage_limit, smopr) + | IEvent_result _ -> return (ctxt, storage_limit, smopr) + +let apply_manager_contents (type kind) ctxt chain_id + (op : kind Kind.manager contents) : + (success_or_failure + * kind manager_operation_result + * packed_internal_operation_result list) + Lwt.t = + let (Manager_operation {source; operation; gas_limit; storage_limit; _}) = + op + in + (* We do not expose the internal scaling to the users. Instead, we multiply + the specified gas limit by the internal scaling. *) + let ctxt = Gas.set_limit ctxt gas_limit in + apply_manager_operation ctxt ~source ~chain_id operation >>= function + | Ok (ctxt, operation_results, internal_operations) -> ( + apply_internal_operations ctxt ~payer:source ~chain_id internal_operations + >>= function + | Success ctxt, internal_operations_results -> ( + burn_manager_storage_fees + ctxt + operation_results + ~storage_limit + ~payer:source + >>= function + | Ok (ctxt, storage_limit, operation_results) -> ( + List.fold_left_es + (fun (ctxt, storage_limit, res) imopr -> + let (Internal_operation_result (op, mopr)) = imopr in + match mopr with + | Applied smopr -> + burn_internal_storage_fees + ctxt + smopr + ~storage_limit + ~payer:source + >>=? fun (ctxt, storage_limit, smopr) -> + let imopr = + Internal_operation_result (op, Applied smopr) + in + return (ctxt, storage_limit, imopr :: res) + | _ -> return (ctxt, storage_limit, imopr :: res)) + (ctxt, storage_limit, []) + internal_operations_results + >|= function + | Ok (ctxt, _, internal_operations_results) -> + ( Success ctxt, + Applied operation_results, + List.rev internal_operations_results ) + | Error errors -> + ( Failure, + Backtracked (operation_results, Some errors), + internal_operations_results )) + | Error errors -> + Lwt.return + ( Failure, + Backtracked (operation_results, Some errors), + internal_operations_results )) + | Failure, internal_operations_results -> + Lwt.return + (Failure, Applied operation_results, internal_operations_results)) + | Error errors -> + Lwt.return (Failure, Failed (manager_kind operation, errors), []) + +(** An individual manager operation (either standalone or inside a + batch) together with the balance update corresponding to the + transfer of its fee. *) +type 'kind fees_updated_contents = { + contents : 'kind contents; + balance_updates : Receipt.balance_updates; +} + +type _ fees_updated_contents_list = + | FeesUpdatedSingle : + 'kind fees_updated_contents + -> 'kind fees_updated_contents_list + | FeesUpdatedCons : + 'kind Kind.manager fees_updated_contents + * 'rest Kind.manager fees_updated_contents_list + -> ('kind * 'rest) Kind.manager fees_updated_contents_list + +let rec mark_skipped : + type kind. + payload_producer:Consensus_key.t -> + Level.t -> + kind Kind.manager fees_updated_contents_list -> + kind Kind.manager contents_result_list = + fun ~payload_producer level fees_updated_contents_list -> + match fees_updated_contents_list with + | FeesUpdatedSingle + {contents = Manager_operation {operation; _}; balance_updates} -> + Single_result + (Manager_operation_result + { + balance_updates; + operation_result = Skipped (manager_kind operation); + internal_operation_results = []; + }) + | FeesUpdatedCons + ({contents = Manager_operation {operation; _}; balance_updates}, rest) -> + Cons_result + ( Manager_operation_result + { + balance_updates; + operation_result = Skipped (manager_kind operation); + internal_operation_results = []; + }, + mark_skipped ~payload_producer level rest ) + +(** Return balance updates for fees, and an updated context that + accounts for: + + - fees spending, + + - counter incrementation, + + - consumption of each operation's [gas_limit] from the available + block gas. + + The operation should already have been validated by + {!Validate.validate_operation}. The latter is responsible for ensuring that + the operation is solvable, i.e. its fees can be taken, i.e. + [take_fees] cannot return an error. *) +let take_fees ctxt contents_list = + let open Lwt_result_syntax in + let rec take_fees_rec : + type kind. + context -> + kind Kind.manager contents_list -> + (context * kind Kind.manager fees_updated_contents_list) tzresult Lwt.t = + fun ctxt contents_list -> + let contents_effects contents = + let (Manager_operation {source; fee; gas_limit; _}) = contents in + let*? ctxt = Gas.consume_limit_in_block ctxt gas_limit in + let* ctxt = Contract.increment_counter ctxt source in + let+ ctxt, balance_updates = + Token.transfer + ctxt + (`Contract (Contract.Implicit source)) + `Block_fees + fee + in + (ctxt, {contents; balance_updates}) + in + match contents_list with + | Single contents -> + let+ ctxt, fees_updated_contents = contents_effects contents in + (ctxt, FeesUpdatedSingle fees_updated_contents) + | Cons (contents, rest) -> + let* ctxt, fees_updated_contents = contents_effects contents in + let+ ctxt, result_rest = take_fees_rec ctxt rest in + (ctxt, FeesUpdatedCons (fees_updated_contents, result_rest)) + in + let*! result = take_fees_rec ctxt contents_list in + Lwt.return (record_trace Error_while_taking_fees result) + +let rec apply_manager_contents_list_rec : + type kind. + context -> + payload_producer:Consensus_key.t -> + Chain_id.t -> + kind Kind.manager fees_updated_contents_list -> + (success_or_failure * kind Kind.manager contents_result_list) Lwt.t = + fun ctxt ~payload_producer chain_id fees_updated_contents_list -> + let level = Level.current ctxt in + match fees_updated_contents_list with + | FeesUpdatedSingle {contents = Manager_operation _ as op; balance_updates} -> + apply_manager_contents ctxt chain_id op + >|= fun (ctxt_result, operation_result, internal_operation_results) -> + let result = + Manager_operation_result + {balance_updates; operation_result; internal_operation_results} + in + (ctxt_result, Single_result result) + | FeesUpdatedCons + ({contents = Manager_operation _ as op; balance_updates}, rest) -> ( + apply_manager_contents ctxt chain_id op >>= function + | Failure, operation_result, internal_operation_results -> + let result = + Manager_operation_result + {balance_updates; operation_result; internal_operation_results} + in + Lwt.return + ( Failure, + Cons_result (result, mark_skipped ~payload_producer level rest) ) + | Success ctxt, operation_result, internal_operation_results -> + let result = + Manager_operation_result + {balance_updates; operation_result; internal_operation_results} + in + apply_manager_contents_list_rec ctxt ~payload_producer chain_id rest + >|= fun (ctxt_result, results) -> + (ctxt_result, Cons_result (result, results))) + +let mark_backtracked results = + let mark_results : + type kind. + kind Kind.manager contents_result -> kind Kind.manager contents_result = + fun results -> + let mark_manager_operation_result : + type kind. + kind manager_operation_result -> kind manager_operation_result = + function + | (Failed _ | Skipped _ | Backtracked _) as result -> result + | Applied result -> Backtracked (result, None) + in + let mark_internal_operation_result : + type kind. + kind internal_operation_result -> kind internal_operation_result = + function + | (Failed _ | Skipped _ | Backtracked _) as result -> result + | Applied result -> Backtracked (result, None) + in + let mark_internal_operation_results + (Internal_operation_result (kind, result)) = + Internal_operation_result (kind, mark_internal_operation_result result) + in + match results with + | Manager_operation_result op -> + Manager_operation_result + { + balance_updates = op.balance_updates; + operation_result = mark_manager_operation_result op.operation_result; + internal_operation_results = + List.map + mark_internal_operation_results + op.internal_operation_results; + } + in + let rec traverse_apply_results : + type kind. + kind Kind.manager contents_result_list -> + kind Kind.manager contents_result_list = function + | Single_result res -> Single_result (mark_results res) + | Cons_result (res, rest) -> + Cons_result (mark_results res, traverse_apply_results rest) + in + traverse_apply_results results + +type mode = + | Application of { + block_header : Block_header.t; + fitness : Fitness.t; + payload_producer : Consensus_key.t; + block_producer : Consensus_key.t; + predecessor_level : Level.t; + predecessor_round : Round.t; + } + | Full_construction of { + block_data_contents : Block_header.contents; + predecessor_hash : Block_hash.t; + payload_producer : Consensus_key.t; + block_producer : Consensus_key.t; + round : Round.t; + predecessor_level : Level.t; + predecessor_round : Round.t; + } + | Partial_construction of { + predecessor_level : Raw_level.t; + predecessor_fitness : Fitness.raw; + } + +type application_state = { + ctxt : t; + chain_id : Chain_id.t; + mode : mode; + op_count : int; + migration_balance_updates : Receipt.balance_updates; + liquidity_baking_toggle_ema : Liquidity_baking.Toggle_EMA.t; + implicit_operations_results : + Apply_results.packed_successful_manager_operation_result list; +} + +let record_operation (type kind) ctxt hash (operation : kind operation) : + context = + match operation.protocol_data.contents with + | Single (Preendorsement _) -> ctxt + | Single (Endorsement _) -> ctxt + | Single (Dal_attestation _) -> ctxt + | Single + ( Failing_noop _ | Proposals _ | Ballot _ | Seed_nonce_revelation _ + | Vdf_revelation _ | Double_endorsement_evidence _ + | Double_preendorsement_evidence _ | Double_baking_evidence _ + | Activate_account _ | Drain_delegate _ | Manager_operation _ ) + | Cons (Manager_operation _, _) -> + record_non_consensus_operation_hash ctxt hash + +let record_preendorsement ctxt (mode : mode) (content : consensus_content) : + (context * Kind.preendorsement contents_result_list) tzresult = + let open Result_syntax in + let ctxt = + match mode with + | Full_construction _ -> ( + match Consensus.get_preendorsements_quorum_round ctxt with + | None -> Consensus.set_preendorsements_quorum_round ctxt content.round + | Some _ -> ctxt) + | Application _ | Partial_construction _ -> ctxt + in + match Slot.Map.find content.slot (Consensus.allowed_preendorsements ctxt) with + | None -> + (* This should not happen: operation validation should have failed. *) + error Faulty_validation_wrong_slot + | Some ({delegate; consensus_pkh; _}, preendorsement_power) -> + let* ctxt = + Consensus.record_preendorsement + ctxt + ~initial_slot:content.slot + ~power:preendorsement_power + content.round + in + return + ( ctxt, + Single_result + (Preendorsement_result + { + balance_updates = []; + delegate; + consensus_key = consensus_pkh; + preendorsement_power; + }) ) + +let is_grandparent_endorsement mode content = + match mode with + | Partial_construction {predecessor_level; _} -> + Raw_level.(succ content.level = predecessor_level) + | _ -> false + +let record_endorsement ctxt (mode : mode) (content : consensus_content) : + (context * Kind.endorsement contents_result_list) tzresult Lwt.t = + let open Lwt_result_syntax in + let mk_endorsement_result {Consensus_key.delegate; consensus_pkh} + endorsement_power = + Single_result + (Endorsement_result + { + balance_updates = []; + delegate; + consensus_key = consensus_pkh; + endorsement_power; + }) + in + if is_grandparent_endorsement mode content then + let level = Level.from_raw ctxt content.level in + let* ctxt, ({delegate; _} as consensus_key) = + Stake_distribution.slot_owner ctxt level content.slot + in + let*? ctxt = Consensus.record_grand_parent_endorsement ctxt delegate in + return (ctxt, mk_endorsement_result (Consensus_key.pkh consensus_key) 0) + else + match Slot.Map.find content.slot (Consensus.allowed_endorsements ctxt) with + | None -> + (* This should not happen: operation validation should have failed. *) + tzfail Faulty_validation_wrong_slot + | Some (consensus_key, power) -> + let*? ctxt = + Consensus.record_endorsement ctxt ~initial_slot:content.slot ~power + in + return + (ctxt, mk_endorsement_result (Consensus_key.pkh consensus_key) power) + +let apply_manager_contents_list ctxt ~payload_producer chain_id + fees_updated_contents_list = + apply_manager_contents_list_rec + ctxt + ~payload_producer + chain_id + fees_updated_contents_list + >>= fun (ctxt_result, results) -> + match ctxt_result with + | Failure -> Lwt.return (ctxt (* backtracked *), mark_backtracked results) + | Success ctxt -> + Lazy_storage.cleanup_temporaries ctxt >|= fun ctxt -> (ctxt, results) + +let apply_manager_operations ctxt ~payload_producer chain_id ~mempool_mode + contents_list = + let open Lwt_result_syntax in + let ctxt = if mempool_mode then Gas.reset_block_gas ctxt else ctxt in + let* ctxt, fees_updated_contents_list = take_fees ctxt contents_list in + let*! ctxt, contents_result_list = + apply_manager_contents_list + ctxt + ~payload_producer + chain_id + fees_updated_contents_list + in + return (ctxt, contents_result_list) + +let punish_delegate ctxt delegate level mistake mk_result ~payload_producer = + let punish = + match mistake with + | `Double_baking -> Delegate.punish_double_baking + | `Double_endorsing -> Delegate.punish_double_endorsing + in + punish ctxt delegate level >>=? fun (ctxt, burned, punish_balance_updates) -> + (match Tez.(burned /? 2L) with + | Ok reward -> + Token.transfer + ctxt + `Double_signing_evidence_rewards + (`Contract (Contract.Implicit payload_producer.Consensus_key.delegate)) + reward + | Error _ -> (* reward is Tez.zero *) return (ctxt, [])) + >|=? fun (ctxt, reward_balance_updates) -> + let balance_updates = reward_balance_updates @ punish_balance_updates in + (ctxt, Single_result (mk_result balance_updates)) + +let punish_double_endorsement_or_preendorsement (type kind) ctxt + ~(op1 : kind Kind.consensus Operation.t) ~payload_producer : + (context + * kind Kind.double_consensus_operation_evidence contents_result_list) + tzresult + Lwt.t = + let mk_result (balance_updates : Receipt.balance_updates) : + kind Kind.double_consensus_operation_evidence contents_result = + match op1.protocol_data.contents with + | Single (Preendorsement _) -> + Double_preendorsement_evidence_result balance_updates + | Single (Endorsement _) -> + Double_endorsement_evidence_result balance_updates + in + match op1.protocol_data.contents with + | Single (Preendorsement e1) | Single (Endorsement e1) -> + let level = Level.from_raw ctxt e1.level in + Stake_distribution.slot_owner ctxt level e1.slot + >>=? fun (ctxt, consensus_pk1) -> + punish_delegate + ctxt + consensus_pk1.delegate + level + `Double_endorsing + mk_result + ~payload_producer + +let punish_double_baking ctxt (bh1 : Block_header.t) ~payload_producer = + Fitness.from_raw bh1.shell.fitness >>?= fun bh1_fitness -> + let round1 = Fitness.round bh1_fitness in + Raw_level.of_int32 bh1.shell.level >>?= fun raw_level -> + let level = Level.from_raw ctxt raw_level in + let committee_size = Constants.consensus_committee_size ctxt in + Round.to_slot round1 ~committee_size >>?= fun slot1 -> + Stake_distribution.slot_owner ctxt level slot1 + >>=? fun (ctxt, consensus_pk1) -> + punish_delegate + ctxt + consensus_pk1.delegate + level + `Double_baking + ~payload_producer + (fun balance_updates -> Double_baking_evidence_result balance_updates) + +let apply_contents_list (type kind) ctxt chain_id (mode : mode) + ~payload_producer (contents_list : kind contents_list) : + (context * kind contents_result_list) tzresult Lwt.t = + let mempool_mode = + match mode with + | Partial_construction _ -> true + | Full_construction _ | Application _ -> false + in + match contents_list with + | Single (Preendorsement consensus_content) -> + record_preendorsement ctxt mode consensus_content |> Lwt.return + | Single (Endorsement consensus_content) -> + record_endorsement ctxt mode consensus_content + | Single (Dal_attestation op) -> + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3115 + + This is a temporary operation. We do no check for the + moment. In particular, this means we do not check the + signature. Consequently, it is really important to ensure this + operation cannot be included into a block when the feature flag + is not set. This is done in order to avoid modifying the + endorsement encoding. However, once the DAL will be ready, this + operation should be merged with an endorsement or at least + refined. *) + Dal_apply.apply_attestation ctxt op >>?= fun ctxt -> + return + (ctxt, Single_result (Dal_attestation_result {delegate = op.attestor})) + | Single (Seed_nonce_revelation {level; nonce}) -> + let level = Level.from_raw ctxt level in + Nonce.reveal ctxt level nonce >>=? fun ctxt -> + let tip = Constants.seed_nonce_revelation_tip ctxt in + let contract = + Contract.Implicit payload_producer.Consensus_key.delegate + in + Token.transfer ctxt `Revelation_rewards (`Contract contract) tip + >|=? fun (ctxt, balance_updates) -> + (ctxt, Single_result (Seed_nonce_revelation_result balance_updates)) + | Single (Vdf_revelation {solution}) -> + Seed.update_seed ctxt solution >>=? fun ctxt -> + let tip = Constants.seed_nonce_revelation_tip ctxt in + let contract = + Contract.Implicit payload_producer.Consensus_key.delegate + in + Token.transfer ctxt `Revelation_rewards (`Contract contract) tip + >|=? fun (ctxt, balance_updates) -> + (ctxt, Single_result (Vdf_revelation_result balance_updates)) + | Single (Double_preendorsement_evidence {op1; op2 = _}) -> + punish_double_endorsement_or_preendorsement ctxt ~op1 ~payload_producer + | Single (Double_endorsement_evidence {op1; op2 = _}) -> + punish_double_endorsement_or_preendorsement ctxt ~op1 ~payload_producer + | Single (Double_baking_evidence {bh1; bh2 = _}) -> + punish_double_baking ctxt bh1 ~payload_producer + | Single (Activate_account {id = pkh; activation_code}) -> + let blinded_pkh = + Blinded_public_key_hash.of_ed25519_pkh activation_code pkh + in + let src = `Collected_commitments blinded_pkh in + let contract = Contract.Implicit (Signature.Ed25519 pkh) in + Token.balance ctxt src >>=? fun (ctxt, amount) -> + Token.transfer ctxt src (`Contract contract) amount + >>=? fun (ctxt, bupds) -> + return (ctxt, Single_result (Activate_account_result bupds)) + | Single (Proposals _ as contents) -> + Amendment.apply_proposals ctxt chain_id contents + | Single (Ballot _ as contents) -> Amendment.apply_ballot ctxt contents + | Single (Drain_delegate {delegate; destination; consensus_key = _}) -> + Delegate.drain ctxt ~delegate ~destination + >>=? fun ( ctxt, + allocated_destination_contract, + fees, + drain_balance_updates ) -> + Token.transfer + ctxt + (`Contract (Contract.Implicit delegate)) + (`Contract (Contract.Implicit payload_producer.Consensus_key.delegate)) + fees + >>=? fun (ctxt, fees_balance_updates) -> + let balance_updates = drain_balance_updates @ fees_balance_updates in + return + ( ctxt, + Single_result + (Drain_delegate_result + {balance_updates; allocated_destination_contract}) ) + | Single (Failing_noop _) -> + (* This operation always fails. It should already have been + rejected by {!Validate.validate_operation}. *) + tzfail Validate_errors.Failing_noop_error + | Single (Manager_operation _) -> + apply_manager_operations + ctxt + ~payload_producer + chain_id + ~mempool_mode + contents_list + | Cons (Manager_operation _, _) -> + apply_manager_operations + ctxt + ~payload_producer + chain_id + ~mempool_mode + contents_list + +let apply_operation application_state operation_hash operation = + let open Lwt_result_syntax in + let apply_operation application_state packed_operation ~payload_producer = + let {shell; protocol_data = Operation_data unpacked_protocol_data} = + packed_operation + in + let operation : _ Operation.t = + {shell; protocol_data = unpacked_protocol_data} + in + let ctxt = Origination_nonce.init application_state.ctxt operation_hash in + let ctxt = record_operation ctxt operation_hash operation in + let* ctxt, result = + apply_contents_list + ctxt + application_state.chain_id + application_state.mode + ~payload_producer + operation.protocol_data.contents + in + let ctxt = Gas.set_unlimited ctxt in + let ctxt = Origination_nonce.unset ctxt in + let op_count = succ application_state.op_count in + return + ( {application_state with ctxt; op_count}, + Operation_metadata {contents = result} ) + in + match application_state.mode with + | Application {payload_producer; _} -> + apply_operation application_state operation ~payload_producer + | Full_construction {payload_producer; _} -> + apply_operation application_state operation ~payload_producer + | Partial_construction _ -> + apply_operation + application_state + operation + ~payload_producer:Consensus_key.zero + +let may_start_new_cycle ctxt = + match Level.dawn_of_a_new_cycle ctxt with + | None -> return (ctxt, [], []) + | Some last_cycle -> + Delegate.cycle_end ctxt last_cycle + >>=? fun (ctxt, balance_updates, deactivated) -> + Bootstrap.cycle_end ctxt last_cycle >|=? fun ctxt -> + (ctxt, balance_updates, deactivated) + +let apply_liquidity_baking_subsidy ctxt ~toggle_vote = + Liquidity_baking.on_subsidy_allowed + ctxt + ~toggle_vote + (fun ctxt liquidity_baking_cpmm_contract_hash -> + let liquidity_baking_cpmm_contract = + Contract.Originated liquidity_baking_cpmm_contract_hash + in + let ctxt = + (* We set a gas limit of 1/20th the block limit, which is ~10x + actual usage here in Granada. Gas consumed is reported in + the Transaction receipt, but not counted towards the block + limit. The gas limit is reset to unlimited at the end of + this function.*) + Gas.set_limit + ctxt + (Gas.Arith.integral_exn + (Z.div + (Gas.Arith.integral_to_z + (Constants.hard_gas_limit_per_block ctxt)) + (Z.of_int 20))) + in + let backtracking_ctxt = ctxt in + (let liquidity_baking_subsidy = Constants.liquidity_baking_subsidy ctxt in + (* credit liquidity baking subsidy to CPMM contract *) + Token.transfer + ~origin:Subsidy + ctxt + `Liquidity_baking_subsidies + (`Contract liquidity_baking_cpmm_contract) + liquidity_baking_subsidy + >>=? fun (ctxt, balance_updates) -> + Script_cache.find ctxt liquidity_baking_cpmm_contract_hash + >>=? fun (ctxt, cache_key, script) -> + match script with + | None -> tzfail (Script_tc_errors.No_such_entrypoint Entrypoint.default) + | Some (script, script_ir) -> ( + (* Token.transfer which is being called above already loads this + value into the Irmin cache, so no need to burn gas for it. *) + Contract.get_balance ctxt liquidity_baking_cpmm_contract + >>=? fun balance -> + let now = Script_timestamp.now ctxt in + let level = + (Level.current ctxt).level |> Raw_level.to_int32 + |> Script_int.of_int32 |> Script_int.abs + in + let step_constants = + let open Script_interpreter in + (* Using dummy values for source, payer, and chain_id + since they are not used within the CPMM default + entrypoint. *) + { + source = liquidity_baking_cpmm_contract; + payer = Signature.Public_key_hash.zero; + self = liquidity_baking_cpmm_contract_hash; + amount = liquidity_baking_subsidy; + balance; + chain_id = Chain_id.zero; + now; + level; + } + in + (* + Call CPPM default entrypoint with parameter Unit. + This is necessary for the CPMM's xtz_pool in storage to + increase since it cannot use BALANCE due to a transfer attack. + + Mimicks a transaction. + + There is no: + - storage burn (extra storage is free) + - fees (the operation is mandatory) + *) + Script_interpreter.execute_with_typed_parameter + ctxt + Optimized + step_constants + ~script + ~parameter:() + ~parameter_ty:Unit_t + ~cached_script:(Some script_ir) + ~location:Micheline.dummy_location + ~entrypoint:Entrypoint.default + ~internal:false + >>=? fun ( { + script = updated_cached_script; + code_size = updated_size; + storage; + lazy_storage_diff; + operations; + ticket_diffs; + ticket_receipt; + }, + ctxt ) -> + match operations with + | _ :: _ -> + (* No internal operations are expected here. Something bad may be happening. *) + return (backtracking_ctxt, []) + | [] -> + (* update CPMM storage *) + update_script_storage_and_ticket_balances + ctxt + ~self_contract:liquidity_baking_cpmm_contract_hash + storage + lazy_storage_diff + ticket_diffs + operations + >>=? fun (ticket_table_size_diff, ctxt) -> + Fees.record_paid_storage_space + ctxt + liquidity_baking_cpmm_contract_hash + >>=? fun (ctxt, new_size, paid_storage_size_diff) -> + Ticket_balance.adjust_storage_space + ctxt + ~storage_diff:ticket_table_size_diff + >>=? fun (ticket_paid_storage_diff, ctxt) -> + let consumed_gas = + Gas.consumed ~since:backtracking_ctxt ~until:ctxt + in + Script_cache.update + ctxt + cache_key + ( {script with storage = Script.lazy_expr storage}, + updated_cached_script ) + updated_size + >>?= fun ctxt -> + let result = + Transaction_result + (Transaction_to_contract_result + { + storage = Some storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + (* At this point in application the + origination nonce has not been initialized + so it's not possible to originate new + contracts. We've checked above that none + were originated. *) + originated_contracts = []; + consumed_gas; + storage_size = new_size; + paid_storage_size_diff = + Z.add paid_storage_size_diff ticket_paid_storage_diff; + allocated_destination_contract = false; + }) + in + let ctxt = Gas.set_unlimited ctxt in + return (ctxt, [Successful_manager_result result]))) + >|= function + | Ok (ctxt, results) -> Ok (ctxt, results) + | Error _ -> + (* Do not fail if something bad happens during CPMM contract call. *) + let ctxt = Gas.set_unlimited backtracking_ctxt in + Ok (ctxt, [])) + +let are_endorsements_required ctxt ~level = + First_level_of_protocol.get ctxt >|=? fun first_level -> + (* NB: the first level is the level of the migration block. There + are no endorsements for this block. Therefore the block at the + next level cannot contain endorsements. *) + let level_position_in_protocol = Raw_level.diff level first_level in + Compare.Int32.(level_position_in_protocol > 1l) + +let record_endorsing_participation ctxt = + let validators = Consensus.allowed_endorsements ctxt in + Slot.Map.fold_es + (fun initial_slot ((consensus_pk : Consensus_key.pk), power) ctxt -> + let participation = + if Slot.Set.mem initial_slot (Consensus.endorsements_seen ctxt) then + Delegate.Participated + else Delegate.Didn't_participate + in + Delegate.record_endorsing_participation + ctxt + ~delegate:consensus_pk.delegate + ~participation + ~endorsing_power:power) + validators + ctxt + +let begin_application ctxt chain_id ~migration_balance_updates + ~migration_operation_results ~(predecessor_fitness : Fitness.raw) + (block_header : Block_header.t) : application_state tzresult Lwt.t = + let open Lwt_result_syntax in + let*? fitness = Fitness.from_raw block_header.shell.fitness in + let level = block_header.shell.level in + let*? predecessor_round = Fitness.round_from_raw predecessor_fitness in + let*? predecessor_level = Raw_level.of_int32 (Int32.pred level) in + let predecessor_level = Level.from_raw ctxt predecessor_level in + let round = Fitness.round fitness in + let current_level = Level.current ctxt in + let* ctxt, _slot, block_producer = + Stake_distribution.baking_rights_owner ctxt current_level ~round + in + let* ctxt, _slot, payload_producer = + Stake_distribution.baking_rights_owner + ctxt + current_level + ~round:block_header.protocol_data.contents.payload_round + in + let toggle_vote = + block_header.Block_header.protocol_data.contents + .liquidity_baking_toggle_vote + in + let* ctxt, liquidity_baking_operations_results, liquidity_baking_toggle_ema = + apply_liquidity_baking_subsidy ctxt ~toggle_vote + in + let*! ctxt = + Sc_rollup.Inbox.add_info_per_level + ~predecessor:block_header.shell.predecessor + ctxt + in + let mode = + Application + { + block_header; + fitness; + predecessor_round; + predecessor_level; + payload_producer = Consensus_key.pkh payload_producer; + block_producer = Consensus_key.pkh block_producer; + } + in + return + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results = + Apply_results.pack_migration_operation_results + migration_operation_results + @ liquidity_baking_operations_results; + } + +let begin_full_construction ctxt chain_id ~migration_balance_updates + ~migration_operation_results ~predecessor_timestamp ~predecessor_level + ~predecessor_round ~predecessor_hash ~timestamp + (block_data_contents : Block_header.contents) = + let open Lwt_result_syntax in + let round_durations = Constants.round_durations ctxt in + let*? round = + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp + in + (* The endorsement/preendorsement validation rules for construction are the + same as for application. *) + let current_level = Level.current ctxt in + let* ctxt, _slot, block_producer = + Stake_distribution.baking_rights_owner ctxt current_level ~round + in + let* ctxt, _slot, payload_producer = + Stake_distribution.baking_rights_owner + ctxt + current_level + ~round:block_data_contents.payload_round + in + let toggle_vote = block_data_contents.liquidity_baking_toggle_vote in + let* ctxt, liquidity_baking_operations_results, liquidity_baking_toggle_ema = + apply_liquidity_baking_subsidy ctxt ~toggle_vote + in + let*! ctxt = + Sc_rollup.Inbox.add_info_per_level ~predecessor:predecessor_hash ctxt + in + let mode = + Full_construction + { + block_data_contents; + predecessor_hash; + payload_producer = Consensus_key.pkh payload_producer; + block_producer = Consensus_key.pkh block_producer; + round; + predecessor_round; + predecessor_level; + } + in + return + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results = + Apply_results.pack_migration_operation_results + migration_operation_results + @ liquidity_baking_operations_results; + } + +let begin_partial_construction ctxt chain_id ~migration_balance_updates + ~migration_operation_results ~predecessor_level ~predecessor_hash + ~(predecessor_fitness : Fitness.raw) : application_state tzresult Lwt.t = + let open Lwt_result_syntax in + let toggle_vote = Liquidity_baking.LB_pass in + let* ctxt, liquidity_baking_operations_results, liquidity_baking_toggle_ema = + apply_liquidity_baking_subsidy ctxt ~toggle_vote + in + let* ctxt = + (* The mode [Partial_construction] is used in simulation. We try to + put a realistic value of the block's timestamp. Even though, it should + not have an impact on the simulation of the following smart rollup + operations. + *) + let predecessor = predecessor_hash in + let*! ctxt = Sc_rollup.Inbox.add_info_per_level ~predecessor ctxt in + return ctxt + in + let mode = Partial_construction {predecessor_level; predecessor_fitness} in + return + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results = + Apply_results.pack_migration_operation_results + migration_operation_results + @ liquidity_baking_operations_results; + } + +let finalize_application ctxt block_data_contents ~round ~predecessor_hash + ~liquidity_baking_toggle_ema ~implicit_operations_results + ~migration_balance_updates ~(block_producer : Consensus_key.t) + ~(payload_producer : Consensus_key.t) = + let open Lwt_result_syntax in + let level = Level.current ctxt in + let endorsing_power = Consensus.current_endorsement_power ctxt in + let* required_endorsements = + are_endorsements_required ctxt ~level:level.level + in + let block_payload_hash = + Block_payload.hash + ~predecessor_hash + ~payload_round:block_data_contents.Block_header.payload_round + (non_consensus_operations ctxt) + in + (* from this point nothing should fail *) + (* We mark the endorsement branch as the grand parent branch when + accessible. This will not be present before the first two blocks + of tenderbake. *) + let level = Level.current ctxt in + let*! ctxt = + match Consensus.endorsement_branch ctxt with + | Some predecessor_branch -> + Consensus.store_grand_parent_branch ctxt predecessor_branch + | None -> Lwt.return ctxt + in + (* We mark the current payload hash as the predecessor one => this + will only be accessed by the successor block now. *) + let*! ctxt = + Consensus.store_endorsement_branch + ctxt + (predecessor_hash, block_payload_hash) + in + let* ctxt = Round.update ctxt round in + (* end of level *) + let* ctxt = + match block_data_contents.Block_header.seed_nonce_hash with + | None -> return ctxt + | Some nonce_hash -> + Nonce.record_hash ctxt {nonce_hash; delegate = block_producer.delegate} + in + let* ctxt, reward_bonus = + if required_endorsements then + let* ctxt = record_endorsing_participation ctxt in + let*? rewards_bonus = Baking.bonus_baking_reward ctxt ~endorsing_power in + return (ctxt, Some rewards_bonus) + else return (ctxt, None) + in + let baking_reward = Constants.baking_reward_fixed_portion ctxt in + let* ctxt, baking_receipts = + Delegate.record_baking_activity_and_pay_rewards_and_fees + ctxt + ~payload_producer:payload_producer.delegate + ~block_producer:block_producer.delegate + ~baking_reward + ~reward_bonus + in + (* if end of nonce revelation period, compute seed *) + let* ctxt = + if Level.may_compute_randao ctxt then Seed.compute_randao ctxt + else return ctxt + in + let* ctxt = + if Level.may_snapshot_stake_distribution ctxt then + Stake_distribution.snapshot ctxt + else return ctxt + in + let* ctxt, cycle_end_balance_updates, deactivated = + may_start_new_cycle ctxt + in + let* ctxt = Amendment.may_start_new_voting_period ctxt in + let* ctxt, dal_attestation = Dal_apply.finalisation ctxt in + let*! ctxt = Sc_rollup.Inbox.finalize_inbox_level ctxt in + let balance_updates = + migration_balance_updates @ baking_receipts @ cycle_end_balance_updates + in + let consumed_gas = + Gas.Arith.sub + (Gas.Arith.fp @@ Constants.hard_gas_limit_per_block ctxt) + (Gas.block_level ctxt) + in + let+ voting_period_info = Voting_period.get_rpc_current_info ctxt in + let receipt = + Apply_results. + { + proposer = payload_producer; + baker = block_producer; + level_info = level; + voting_period_info; + nonce_hash = block_data_contents.seed_nonce_hash; + consumed_gas; + deactivated; + balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results; + dal_attestation; + } + in + (ctxt, receipt) + +type error += Missing_shell_header + +let () = + register_error_kind + `Permanent + ~id:"apply.missing_shell_header" + ~title:"Missing shell_header during finalisation of a block" + ~description: + "During finalisation of a block header in Application mode or Full \ + construction mode, a shell header should be provided so that a cache \ + nonce can be computed." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "No shell header provided during the finalisation of a block.") + Data_encoding.unit + (function Missing_shell_header -> Some () | _ -> None) + (fun () -> Missing_shell_header) + +let finalize_with_commit_message ctxt ~cache_nonce fitness round op_count = + let open Lwt_syntax in + let* ctxt = Cache.Admin.sync ctxt cache_nonce in + let raw_level = Raw_level.to_int32 (Level.current ctxt).level in + let commit_message = + Format.asprintf + "lvl %ld, fit:%a, round %a, %d ops" + raw_level + Fitness.pp + fitness + Round.pp + round + op_count + in + let validation_result = + finalize ~commit_message ctxt (Fitness.to_raw fitness) + in + return validation_result + +let finalize_block (application_state : application_state) shell_header_opt = + let open Lwt_result_syntax in + let { + ctxt; + liquidity_baking_toggle_ema; + implicit_operations_results; + migration_balance_updates; + op_count; + _; + } = + application_state + in + match application_state.mode with + | Full_construction + { + block_data_contents; + predecessor_hash; + predecessor_level = _; + predecessor_round; + block_producer; + payload_producer; + round; + } -> + let*? (shell_header : Block_header.shell_header) = + Option.value_e + shell_header_opt + ~error:(Error_monad.trace_of_error Missing_shell_header) + in + let cache_nonce = + Cache.cache_nonce_from_block_header shell_header block_data_contents + in + let locked_round_evidence = + Option.map + (fun (preendorsement_round, preendorsement_count) -> + Block_header.{preendorsement_round; preendorsement_count}) + (Consensus.locked_round_evidence ctxt) + in + let locked_round = + match locked_round_evidence with + | None -> None + | Some {preendorsement_round; _} -> Some preendorsement_round + in + let level = (Level.current ctxt).level in + let*? fitness = + Fitness.create ~level ~round ~predecessor_round ~locked_round + in + let* ctxt, receipt = + finalize_application + ctxt + block_data_contents + ~round + ~predecessor_hash + ~liquidity_baking_toggle_ema + ~implicit_operations_results + ~migration_balance_updates + ~block_producer + ~payload_producer + in + let*! result = + finalize_with_commit_message ctxt ~cache_nonce fitness round op_count + in + return (result, receipt) + | Partial_construction {predecessor_fitness; _} -> + let* voting_period_info = Voting_period.get_rpc_current_info ctxt in + let level_info = Level.current ctxt in + let result = finalize ctxt predecessor_fitness in + return + ( result, + Apply_results. + { + proposer = Consensus_key.zero; + baker = Consensus_key.zero; + level_info; + voting_period_info; + nonce_hash = None; + consumed_gas = Gas.Arith.zero; + deactivated = []; + balance_updates = migration_balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results; + dal_attestation = None; + } ) + | Application + { + fitness; + block_header = {shell; protocol_data}; + payload_producer; + block_producer; + _; + } -> + let round = Fitness.round fitness in + let cache_nonce = + Cache.cache_nonce_from_block_header shell protocol_data.contents + in + let* ctxt, receipt = + finalize_application + ctxt + protocol_data.contents + ~round + ~predecessor_hash:shell.predecessor + ~liquidity_baking_toggle_ema + ~implicit_operations_results + ~migration_balance_updates + ~block_producer + ~payload_producer + in + let*! result = + finalize_with_commit_message ctxt ~cache_nonce fitness round op_count + in + return (result, receipt) + +let value_of_key ctxt k = Cache.Admin.value_of_key ctxt k diff --git a/src/proto_016_PtMumbai/lib_protocol/apply.mli b/src/proto_016_PtMumbai/lib_protocol/apply.mli new file mode 100644 index 000000000000..5a8c0489b647 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply.mli @@ -0,0 +1,166 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module supports advancing the ledger state by applying [operation]s. + + Each operation application takes and returns an [application_state], representing + the old and new state, respectively. + + The [Main] module provides wrappers for the functionality in this module, + satisfying the Protocol signature. + *) + +open Alpha_context + +type error += + | Internal_operation_replay of + Apply_internal_results.packed_internal_operation + | Tx_rollup_feature_disabled + | Tx_rollup_invalid_transaction_ticket_amount + | Sc_rollup_feature_disabled + | Empty_transaction of Contract.t + +type mode = + | Application of { + block_header : Block_header.t; + fitness : Fitness.t; + payload_producer : Consensus_key.t; + block_producer : Consensus_key.t; + predecessor_level : Level.t; + predecessor_round : Round.t; + } + | Full_construction of { + block_data_contents : Block_header.contents; + predecessor_hash : Block_hash.t; + payload_producer : Consensus_key.t; + block_producer : Consensus_key.t; + round : Round.t; + predecessor_level : Level.t; + predecessor_round : Round.t; + } + | Partial_construction of { + predecessor_level : Raw_level.t; + predecessor_fitness : Fitness.raw; + } (** This mode is mainly intended to be used by a mempool. *) + +type application_state = { + ctxt : context; + chain_id : Chain_id.t; + mode : mode; + op_count : int; + migration_balance_updates : Receipt.balance_updates; + liquidity_baking_toggle_ema : Liquidity_baking.Toggle_EMA.t; + implicit_operations_results : + Apply_results.packed_successful_manager_operation_result list; +} + +(** Initialize an {!application_state} for the application of an + existing block. *) +val begin_application : + context -> + Chain_id.t -> + migration_balance_updates:Receipt.balance_updates -> + migration_operation_results:Migration.origination_result list -> + predecessor_fitness:Fitness.raw -> + Block_header.t -> + application_state tzresult Lwt.t + +(** Initialize an {!application_state} for the construction of a + fresh block. *) +val begin_full_construction : + context -> + Chain_id.t -> + migration_balance_updates:Receipt.balance_updates -> + migration_operation_results:Migration.origination_result list -> + predecessor_timestamp:Time.t -> + predecessor_level:Level.t -> + predecessor_round:Round.t -> + predecessor_hash:Block_hash.t -> + timestamp:Time.t -> + Block_header.contents -> + application_state tzresult Lwt.t + +(** Initialize an {!application_state} for the partial construction of + a block. This is similar to construction but less information is + required as this will not yield a final valid block. *) +val begin_partial_construction : + context -> + Chain_id.t -> + migration_balance_updates:Receipt.balance_updates -> + migration_operation_results:Migration.origination_result list -> + predecessor_level:Raw_level.t -> + predecessor_hash:Block_hash.t -> + predecessor_fitness:Fitness.raw -> + application_state tzresult Lwt.t + +(** Apply an operation, i.e. update the given context in accordance + with the operation's semantic (or return an error if the operation + is not applicable). + + For non-manager operations, the application of a validated + operation should always fully succeed. + + For manager operations, the application has two stages. The first + stage consists in updating the context to: + + - take the fees; + + - increment the account's counter; + + - decrease of the available block gas by operation's [gas_limit]. + + These updates are mandatory. In particular, taking the fees is + critically important. The {!Validate} module is responsible for + ensuring that the operation is solvable, i.e. that fees can be + taken, i.e. that the first stage of manager operation application + cannot fail. If this stage fails nevertheless, the function returns + an error. + + The second stage of this function (still in the case of a manager + operation) consists in applying all the other effects, in + accordance with the semantic of the operation's kind. + + An error may happen during this second phase: in that case, the + function returns the context obtained at the end of the first + stage, and metadata that contain the error. This means that the + operation has no other effects than those described above during + the first phase. *) +val apply_operation : + application_state -> + Operation_hash.t -> + packed_operation -> + (application_state * Apply_results.packed_operation_metadata) tzresult Lwt.t + +(** Finalize the application of a block depending on its mode. *) +val finalize_block : + application_state -> + Block_header.shell_header option -> + (Updater.validation_result * Apply_results.block_metadata) tzresult Lwt.t + +(** [value_of_key ctxt k] builds a value identified by key [k] + so that it can be put into the cache. *) +val value_of_key : + context -> Context.Cache.key -> Context.Cache.value tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.ml b/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.ml new file mode 100644 index 000000000000..1ec806a0aa1c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.ml @@ -0,0 +1,723 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Data_encoding +open Apply_operation_result + +type 'kind internal_operation_contents = + | Transaction : { + amount : Tez.tez; + parameters : Script.lazy_expr; + entrypoint : Entrypoint.t; + destination : Destination.t; + } + -> Kind.transaction internal_operation_contents + | Origination : { + delegate : Signature.Public_key_hash.t option; + script : Script.t; + credit : Tez.tez; + } + -> Kind.origination internal_operation_contents + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation internal_operation_contents + | Event : { + ty : Script.expr; + tag : Entrypoint.t; + payload : Script.expr; + } + -> Kind.event internal_operation_contents + +type packed_internal_operation_contents = + | Internal_operation_contents : + 'kind internal_operation_contents + -> packed_internal_operation_contents + +type 'kind internal_operation = { + source : Contract.t; + operation : 'kind internal_operation_contents; + nonce : int; +} + +type packed_internal_operation = + | Internal_operation : 'kind internal_operation -> packed_internal_operation + +let internal_operation (type kind) + ({source; operation; nonce} : kind Script_typed_ir.internal_operation) : + kind internal_operation = + let operation : kind internal_operation_contents = + match operation with + | Transaction_to_implicit {destination; amount} -> + Transaction + { + destination = Contract (Implicit destination); + amount; + entrypoint = Entrypoint.default; + parameters = Script.unit_parameter; + } + | Transaction_to_implicit_with_ticket + {destination; unparsed_ticket; amount; ticket_ty = _; ticket = _} -> + Transaction + { + destination = Contract (Implicit destination); + amount; + entrypoint = Entrypoint.default; + parameters = unparsed_ticket; + } + | Transaction_to_smart_contract + {destination; amount; entrypoint; unparsed_parameters; _} -> + Transaction + { + destination = Contract (Originated destination); + amount; + entrypoint; + parameters = Script.lazy_expr unparsed_parameters; + } + | Transaction_to_tx_rollup {destination; unparsed_parameters; _} -> + Transaction + { + destination = Tx_rollup destination; + (* Dummy amount used for the external untyped view of internal transactions *) + amount = Tez.zero; + entrypoint = Entrypoint.deposit; + parameters = Script.lazy_expr unparsed_parameters; + } + | Transaction_to_sc_rollup {destination; entrypoint; unparsed_parameters; _} + -> + Transaction + { + destination = Sc_rollup destination; + amount = Tez.zero; + entrypoint; + parameters = Script.lazy_expr unparsed_parameters; + } + | Event {ty; tag; unparsed_data} -> Event {ty; tag; payload = unparsed_data} + | Transaction_to_zk_rollup {destination; unparsed_parameters; _} -> + Transaction + { + destination = Zk_rollup destination; + amount = Tez.zero; + entrypoint = Entrypoint.deposit; + parameters = Script.lazy_expr unparsed_parameters; + } + | Origination {delegate; code; unparsed_storage; credit; _} -> + let script = + { + Script.code = Script.lazy_expr code; + storage = Script.lazy_expr unparsed_storage; + } + in + Origination {delegate; script; credit} + | Delegation delegate -> Delegation delegate + in + {source; operation; nonce} + +let packed_internal_operation (Script_typed_ir.Internal_operation op) = + Internal_operation (internal_operation op) + +let packed_internal_operations = List.map packed_internal_operation + +type successful_transaction_result = + | Transaction_to_contract_result of { + storage : Script.expr option; + lazy_storage_diff : Lazy_storage.diffs option; + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + originated_contracts : Contract_hash.t list; + consumed_gas : Gas.Arith.fp; + storage_size : Z.t; + paid_storage_size_diff : Z.t; + allocated_destination_contract : bool; + } + | Transaction_to_tx_rollup_result of { + ticket_hash : Ticket_hash.t; + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + | Transaction_to_sc_rollup_result of { + consumed_gas : Gas.Arith.fp; + ticket_receipt : Ticket_receipt.t; + } + | Transaction_to_zk_rollup_result of { + ticket_hash : Ticket_hash.t; + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + +type successful_origination_result = { + lazy_storage_diff : Lazy_storage.diffs option; + balance_updates : Receipt.balance_updates; + originated_contracts : Contract_hash.t list; + consumed_gas : Gas.Arith.fp; + storage_size : Z.t; + paid_storage_size_diff : Z.t; +} + +(** Result of applying an internal operation. *) +type _ successful_internal_operation_result = + | ITransaction_result : + successful_transaction_result + -> Kind.transaction successful_internal_operation_result + | IOrigination_result : + successful_origination_result + -> Kind.origination successful_internal_operation_result + | IDelegation_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.delegation successful_internal_operation_result + | IEvent_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.event successful_internal_operation_result + +type packed_successful_internal_operation_result = + | Successful_internal_operation_result : + 'kind successful_internal_operation_result + -> packed_successful_internal_operation_result + +type 'kind internal_operation_result = + ( 'kind, + 'kind Kind.manager, + 'kind successful_internal_operation_result ) + operation_result + +type packed_internal_operation_result = + | Internal_operation_result : + 'kind internal_operation * 'kind internal_operation_result + -> packed_internal_operation_result + +let pack_internal_operation_result (type kind) + (internal_op : kind Script_typed_ir.internal_operation) + (manager_op : kind internal_operation_result) = + let internal_op = internal_operation internal_op in + Internal_operation_result (internal_op, manager_op) + +type 'kind iselect = + packed_internal_operation_result -> + ('kind internal_operation * 'kind internal_operation_result) option + +module Internal_operation = struct + open Data_encoding + + type 'kind case = + | MCase : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + iselect : 'kind iselect; + select : + packed_internal_operation_contents -> + 'kind internal_operation_contents option; + proj : 'kind internal_operation_contents -> 'a; + inj : 'a -> 'kind internal_operation_contents; + } + -> 'kind case + + let transaction_contract_variant_cases = + union + [ + case + ~title:"To_contract" + (Tag 0) + (obj9 + (opt "storage" Script.expr_encoding) + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "ticket_receipt" Ticket_receipt.encoding []) + (dft "originated_contracts" (list Contract.originated_encoding) []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "storage_size" z Z.zero) + (dft "paid_storage_size_diff" z Z.zero) + (dft "allocated_destination_contract" bool false) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + (function + | Transaction_to_contract_result + { + storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + allocated_destination_contract; + } -> + Some + ( storage, + balance_updates, + ticket_receipt, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + allocated_destination_contract, + lazy_storage_diff ) + | _ -> None) + (fun ( storage, + balance_updates, + ticket_receipt, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + allocated_destination_contract, + lazy_storage_diff ) -> + Transaction_to_contract_result + { + storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + allocated_destination_contract; + }); + case + ~title:"To_tx_rollup" + (Tag 1) + (obj4 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "ticket_hash" Ticket_hash.encoding) + (req "paid_storage_size_diff" n)) + (function + | Transaction_to_tx_rollup_result + { + balance_updates; + consumed_gas; + ticket_hash; + paid_storage_size_diff; + } -> + Some + ( balance_updates, + consumed_gas, + ticket_hash, + paid_storage_size_diff ) + | _ -> None) + (fun ( balance_updates, + consumed_gas, + ticket_hash, + paid_storage_size_diff ) -> + Transaction_to_tx_rollup_result + { + balance_updates; + consumed_gas; + ticket_hash; + paid_storage_size_diff; + }); + case + ~title:"To_sc_rollup" + (Tag 2) + (obj2 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "ticket_receipt" Ticket_receipt.encoding)) + (function + | Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt} -> + Some (consumed_gas, ticket_receipt) + | _ -> None) + (function + | consumed_gas, ticket_receipt -> + Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt}); + ] + + let transaction_case = + MCase + { + (* This value should be changed with care: maybe receipts are read by + external tools such as indexers. *) + tag = 1; + name = "transaction"; + encoding = + obj3 + (req "amount" Tez.encoding) + (req "destination" Destination.encoding) + (opt + "parameters" + (obj2 + (req "entrypoint" Entrypoint.smart_encoding) + (req "value" Script.lazy_expr_encoding))); + iselect : Kind.transaction iselect = + (function + | Internal_operation_result + (({operation = Transaction _; _} as op), res) -> + Some (op, res) + | _ -> None); + select = + (function + | Internal_operation_contents (Transaction _ as op) -> Some op + | _ -> None); + proj = + (function + | Transaction {amount; destination; parameters; entrypoint} -> + let parameters = + if + Script_repr.is_unit_parameter parameters + && Entrypoint.is_default entrypoint + then None + else Some (entrypoint, parameters) + in + (amount, destination, parameters)); + inj = + (fun (amount, destination, parameters) -> + let entrypoint, parameters = + match parameters with + | None -> (Entrypoint.default, Script.unit_parameter) + | Some (entrypoint, value) -> (entrypoint, value) + in + Transaction {amount; destination; parameters; entrypoint}); + } + + let origination_case = + MCase + { + (* This value should be changed with care: maybe receipts are read by + external tools such as indexers. *) + tag = 2; + name = "origination"; + encoding = + obj3 + (req "balance" Tez.encoding) + (opt "delegate" Signature.Public_key_hash.encoding) + (req "script" Script.encoding); + iselect : Kind.origination iselect = + (function + | Internal_operation_result + (({operation = Origination _; _} as op), res) -> + Some (op, res) + | _ -> None); + select = + (function + | Internal_operation_contents (Origination _ as op) -> Some op + | _ -> None); + proj = + (function + | Origination {credit; delegate; script} -> (credit, delegate, script)); + inj = + (fun (credit, delegate, script) -> + Origination {credit; delegate; script}); + } + + let delegation_case = + MCase + { + (* This value should be changed with care: maybe receipts are read by + external tools such as indexers. *) + tag = 3; + name = "delegation"; + encoding = obj1 (opt "delegate" Signature.Public_key_hash.encoding); + iselect : Kind.delegation iselect = + (function + | Internal_operation_result + (({operation = Delegation _; _} as op), res) -> + Some (op, res) + | _ -> None); + select = + (function + | Internal_operation_contents (Delegation _ as op) -> Some op + | _ -> None); + proj = (function Delegation key -> key); + inj = (fun key -> Delegation key); + } + + let event_case = + MCase + { + (* This value should be changed with care: maybe receipts are read by + external tools such as indexers. *) + tag = 4; + name = "event"; + encoding = + obj3 + (req "type" Script.expr_encoding) + (opt "tag" Entrypoint.smart_encoding) + (opt "payload" Script.expr_encoding); + iselect : Kind.event iselect = + (function + | Internal_operation_result (({operation = Event _; _} as op), res) -> + Some (op, res) + | _ -> None); + select = + (function + | Internal_operation_contents (Event _ as op) -> Some op | _ -> None); + proj = + (function + | Event {ty; tag; payload} -> + let tag = if Entrypoint.is_default tag then None else Some tag in + let payload = + if Script_repr.is_unit payload then None else Some payload + in + (ty, tag, payload)); + inj = + (fun (ty, tag, payload) -> + let tag = Option.value ~default:Entrypoint.default tag in + let payload = Option.value ~default:Script_repr.unit payload in + Event {ty; tag; payload}); + } + + let case tag name args proj inj = + case + tag + ~title:(String.capitalize_ascii name) + (merge_objs (obj1 (req "kind" (constant name))) args) + (fun x -> match proj x with None -> None | Some x -> Some ((), x)) + (fun ((), x) -> inj x) + + let encoding = + let make (MCase {tag; name; encoding; iselect = _; select; proj; inj}) = + case + (Tag tag) + name + encoding + (fun o -> match select o with None -> None | Some o -> Some (proj o)) + (fun x -> Internal_operation_contents (inj x)) + in + union + ~tag_size:`Uint8 + [ + make transaction_case; + make origination_case; + make delegation_case; + make event_case; + ] +end + +let internal_operation_encoding : packed_internal_operation Data_encoding.t = + def "apply_internal_results.alpha.operation_result" + @@ conv + (fun (Internal_operation {source; operation; nonce}) -> + ((source, nonce), Internal_operation_contents operation)) + (fun ((source, nonce), Internal_operation_contents operation) -> + Internal_operation {source; operation; nonce}) + (merge_objs + (obj2 (req "source" Contract.encoding) (req "nonce" uint16)) + Internal_operation.encoding) + +module Internal_operation_result = struct + type 'kind case = + | MCase : { + op_case : 'kind Internal_operation.case; + encoding : 'a Data_encoding.t; + kind : 'kind Kind.manager; + select : + packed_successful_internal_operation_result -> + 'kind successful_internal_operation_result option; + proj : 'kind successful_internal_operation_result -> 'a; + inj : 'a -> 'kind successful_internal_operation_result; + t : 'kind internal_operation_result Data_encoding.t; + } + -> 'kind case + + let make ~op_case ~encoding ~kind ~select ~proj ~inj = + let (Internal_operation.MCase {name; _}) = op_case in + let t = + def (Format.asprintf "operation.alpha.internal_operation_result.%s" name) + @@ union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Applied" + (merge_objs (obj1 (req "status" (constant "applied"))) encoding) + (fun o -> + match o with + | Skipped _ | Failed _ | Backtracked _ -> None + | Applied o -> ( + match select (Successful_internal_operation_result o) with + | None -> None + | Some o -> Some ((), proj o))) + (fun ((), x) -> Applied (inj x)); + case + (Tag 1) + ~title:"Failed" + (obj2 + (req "status" (constant "failed")) + (req "errors" trace_encoding)) + (function Failed (_, errs) -> Some ((), errs) | _ -> None) + (fun ((), errs) -> Failed (kind, errs)); + case + (Tag 2) + ~title:"Skipped" + (obj1 (req "status" (constant "skipped"))) + (function Skipped _ -> Some () | _ -> None) + (fun () -> Skipped kind); + case + (Tag 3) + ~title:"Backtracked" + (merge_objs + (obj2 + (req "status" (constant "backtracked")) + (opt "errors" trace_encoding)) + encoding) + (fun o -> + match o with + | Skipped _ | Failed _ | Applied _ -> None + | Backtracked (o, errs) -> ( + match select (Successful_internal_operation_result o) with + | None -> None + | Some o -> Some (((), errs), proj o))) + (fun (((), errs), x) -> Backtracked (inj x, errs)); + ] + in + MCase {op_case; encoding; kind; select; proj; inj; t} + + let transaction_case = + make + ~op_case:Internal_operation.transaction_case + ~encoding:Internal_operation.transaction_contract_variant_cases + ~select:(function + | Successful_internal_operation_result (ITransaction_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Transaction_manager_kind + ~proj:(function ITransaction_result x -> x) + ~inj:(fun x -> ITransaction_result x) + + let origination_case = + make + ~op_case:Internal_operation.origination_case + ~encoding: + (obj6 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "originated_contracts" (list Contract.originated_encoding) []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "storage_size" z Z.zero) + (dft "paid_storage_size_diff" z Z.zero) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + ~select:(function + | Successful_internal_operation_result (IOrigination_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | IOrigination_result + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + } -> + (* There used to be a [legacy_lazy_storage_diff] returned as the + first component of the tuple below, and the non-legacy one + returned as the last component. The legacy one has been removed, + but it was chosen to keep the non-legacy one at its position, + hence the order difference with regards to the record above. *) + ( balance_updates, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + lazy_storage_diff )) + ~kind:Kind.Origination_manager_kind + ~inj: + (fun ( balance_updates, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + lazy_storage_diff ) -> + IOrigination_result + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + }) + + let delegation_case = + make + ~op_case:Internal_operation.delegation_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_internal_operation_result (IDelegation_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Delegation_manager_kind + ~proj:(function IDelegation_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> IDelegation_result {consumed_gas}) + + let event_case = + make + ~op_case:Internal_operation.event_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_internal_operation_result (IEvent_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Event_manager_kind + ~proj:(function IEvent_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> IEvent_result {consumed_gas}) +end + +let internal_operation_result_encoding : + packed_internal_operation_result Data_encoding.t = + let make (type kind) + (Internal_operation_result.MCase res_case : + kind Internal_operation_result.case) + (Internal_operation.MCase ires_case : kind Internal_operation.case) = + let (Internal_operation.MCase op_case) = res_case.op_case in + case + (Tag op_case.tag) + ~title:op_case.name + (merge_objs + (obj3 + (req "kind" (constant op_case.name)) + (req "source" Contract.encoding) + (req "nonce" uint16)) + (merge_objs ires_case.encoding (obj1 (req "result" res_case.t)))) + (fun op -> + match ires_case.iselect op with + | Some (op, res) -> + Some (((), op.source, op.nonce), (ires_case.proj op.operation, res)) + | None -> None) + (fun (((), source, nonce), (op, res)) -> + let op = {source; operation = ires_case.inj op; nonce} in + Internal_operation_result (op, res)) + in + def "apply_internal_results.alpha.operation_result" + @@ union + [ + make + Internal_operation_result.transaction_case + Internal_operation.transaction_case; + make + Internal_operation_result.origination_case + Internal_operation.origination_case; + make + Internal_operation_result.delegation_case + Internal_operation.delegation_case; + make Internal_operation_result.event_case Internal_operation.event_case; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.mli b/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.mli new file mode 100644 index 000000000000..14cb07a7bf1a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_internal_results.mli @@ -0,0 +1,157 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Types representing results of applying an internal operation. + + These are used internally by [Apply]. +*) + +open Alpha_context + +(** [internal_operation_contents] are the internal operations as output in + receipts. + The type simply weakens {!Script_typed_ir.internal_operation_contents} so + that it is easier to define an encoding for it (i.e. we remove the typed + parameter). *) +type 'kind internal_operation_contents = + | Transaction : { + amount : Tez.tez; + parameters : Script.lazy_expr; + entrypoint : Entrypoint.t; + destination : Destination.t; + } + -> Kind.transaction internal_operation_contents + | Origination : { + delegate : Signature.Public_key_hash.t option; + script : Script.t; + credit : Tez.tez; + } + -> Kind.origination internal_operation_contents + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation internal_operation_contents + | Event : { + ty : Script.expr; + tag : Entrypoint.t; + payload : Script.expr; + } + -> Kind.event internal_operation_contents + +type 'kind internal_operation = { + source : Contract.t; + operation : 'kind internal_operation_contents; + nonce : int; +} + +type packed_internal_operation = + | Internal_operation : 'kind internal_operation -> packed_internal_operation + +val packed_internal_operation : + Script_typed_ir.packed_internal_operation -> packed_internal_operation + +val packed_internal_operations : + Script_typed_ir.packed_internal_operation list -> + packed_internal_operation list + +(** Result of applying an internal transaction. *) +type successful_transaction_result = + | Transaction_to_contract_result of { + storage : Script.expr option; + lazy_storage_diff : Lazy_storage.diffs option; + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + originated_contracts : Contract_hash.t list; + consumed_gas : Gas.Arith.fp; + storage_size : Z.t; + paid_storage_size_diff : Z.t; + allocated_destination_contract : bool; + } + | Transaction_to_tx_rollup_result of { + ticket_hash : Ticket_hash.t; + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + | Transaction_to_sc_rollup_result of { + consumed_gas : Gas.Arith.fp; + ticket_receipt : Ticket_receipt.t; + } + | Transaction_to_zk_rollup_result of { + ticket_hash : Ticket_hash.t; + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + +(** Result of applying an internal origination. *) +type successful_origination_result = { + lazy_storage_diff : Lazy_storage.diffs option; + balance_updates : Receipt.balance_updates; + originated_contracts : Contract_hash.t list; + consumed_gas : Gas.Arith.fp; + storage_size : Z.t; + paid_storage_size_diff : Z.t; +} + +(** Result of applying a {!Script_typed_ir.internal_operation_contents}. *) +type _ successful_internal_operation_result = + | ITransaction_result : + successful_transaction_result + -> Kind.transaction successful_internal_operation_result + | IOrigination_result : + successful_origination_result + -> Kind.origination successful_internal_operation_result + | IDelegation_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.delegation successful_internal_operation_result + | IEvent_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.event successful_internal_operation_result + +type 'kind internal_operation_result = + ( 'kind, + 'kind Kind.manager, + 'kind successful_internal_operation_result ) + Apply_operation_result.operation_result + +type packed_internal_operation_result = + | Internal_operation_result : + 'kind internal_operation * 'kind internal_operation_result + -> packed_internal_operation_result + +val internal_operation : + 'kind Script_typed_ir.internal_operation -> 'kind internal_operation + +val pack_internal_operation_result : + 'kind Script_typed_ir.internal_operation -> + 'kind internal_operation_result -> + packed_internal_operation_result + +val internal_operation_encoding : packed_internal_operation Data_encoding.t + +val internal_operation_result_encoding : + packed_internal_operation_result Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.ml b/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.ml new file mode 100644 index 000000000000..d5763a4a8050 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.ml @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Data_encoding + +type ('kind, 'manager, 'successful) operation_result = + | Applied of 'successful + | Backtracked of 'successful * error trace option + | Failed : + 'manager * error trace + -> ('kind, 'manager, 'successful) operation_result + | Skipped : 'manager -> ('kind, 'manager, 'successful) operation_result + +let error_encoding = + def + "error" + ~description: + "The full list of RPC errors would be too long to include.\n\ + It is available at RPC `/errors` (GET).\n\ + Errors specific to protocol Alpha have an id that starts with \ + `proto.alpha`." + @@ splitted + ~json: + (conv + (fun err -> + Data_encoding.Json.construct Error_monad.error_encoding err) + (fun json -> + Data_encoding.Json.destruct Error_monad.error_encoding json) + json) + ~binary:Error_monad.error_encoding + +let trace_encoding = make_trace_encoding error_encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.mli b/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.mli new file mode 100644 index 000000000000..e48842e3ca71 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_operation_result.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The result of an operation in the queue. [Skipped] ones should + always be at the tail, and after a single [Failed]. + * The ['kind] parameter is the operation kind (a transaction, an + origination, etc.). + * The ['manager] parameter is the type of manager kinds. + * The ['successful] parameter is the type of successful operations. + The ['kind] parameter is used to make the type a GADT, but ['manager] and + ['successful] are used to share [operation_result] between internal and + external operation results, and are instantiated for each case. *) +type ('kind, 'manager, 'successful) operation_result = + | Applied of 'successful + | Backtracked of 'successful * error trace option + | Failed : + 'manager * error trace + -> ('kind, 'manager, 'successful) operation_result + | Skipped : 'manager -> ('kind, 'manager, 'successful) operation_result + +val trace_encoding : error trace Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_results.ml b/src/proto_016_PtMumbai/lib_protocol/apply_results.ml new file mode 100644 index 000000000000..0211dee13f9e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_results.ml @@ -0,0 +1,3170 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Data_encoding +open Apply_operation_result +open Apply_internal_results + +type successful_transaction_result = + Apply_internal_results.successful_transaction_result + +type successful_origination_result = + Apply_internal_results.successful_origination_result + +type _ successful_manager_operation_result = + | Reveal_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.reveal successful_manager_operation_result + | Transaction_result : + successful_transaction_result + -> Kind.transaction successful_manager_operation_result + | Origination_result : + successful_origination_result + -> Kind.origination successful_manager_operation_result + | Delegation_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.delegation successful_manager_operation_result + | Register_global_constant_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + size_of_constant : Z.t; + global_address : Script_expr_hash.t; + } + -> Kind.register_global_constant successful_manager_operation_result + | Set_deposits_limit_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.set_deposits_limit successful_manager_operation_result + | Increase_paid_storage_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.increase_paid_storage successful_manager_operation_result + | Update_consensus_key_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.update_consensus_key successful_manager_operation_result + | Tx_rollup_origination_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + originated_tx_rollup : Tx_rollup.t; + } + -> Kind.tx_rollup_origination successful_manager_operation_result + | Tx_rollup_submit_batch_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.tx_rollup_submit_batch successful_manager_operation_result + | Tx_rollup_commit_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_commit successful_manager_operation_result + | Tx_rollup_return_bond_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_return_bond successful_manager_operation_result + | Tx_rollup_finalize_commitment_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + level : Tx_rollup_level.t; + } + -> Kind.tx_rollup_finalize_commitment successful_manager_operation_result + | Tx_rollup_remove_commitment_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + level : Tx_rollup_level.t; + } + -> Kind.tx_rollup_remove_commitment successful_manager_operation_result + | Tx_rollup_rejection_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_rejection successful_manager_operation_result + | Tx_rollup_dispatch_tickets_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.tx_rollup_dispatch_tickets successful_manager_operation_result + | Transfer_ticket_result : { + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.transfer_ticket successful_manager_operation_result + | Dal_publish_slot_header_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.dal_publish_slot_header successful_manager_operation_result + | Sc_rollup_originate_result : { + balance_updates : Receipt.balance_updates; + address : Sc_rollup.Address.t; + genesis_commitment_hash : Sc_rollup.Commitment.Hash.t; + consumed_gas : Gas.Arith.fp; + size : Z.t; + } + -> Kind.sc_rollup_originate successful_manager_operation_result + | Sc_rollup_add_messages_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.sc_rollup_add_messages successful_manager_operation_result + | Sc_rollup_cement_result : { + consumed_gas : Gas.Arith.fp; + inbox_level : Raw_level.t; + } + -> Kind.sc_rollup_cement successful_manager_operation_result + | Sc_rollup_publish_result : { + consumed_gas : Gas.Arith.fp; + staked_hash : Sc_rollup.Commitment.Hash.t; + published_at_level : Raw_level.t; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_publish successful_manager_operation_result + | Sc_rollup_refute_result : { + consumed_gas : Gas.Arith.fp; + game_status : Sc_rollup.Game.status; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_refute successful_manager_operation_result + | Sc_rollup_timeout_result : { + consumed_gas : Gas.Arith.fp; + game_status : Sc_rollup.Game.status; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_timeout successful_manager_operation_result + | Sc_rollup_execute_outbox_message_result : { + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.sc_rollup_execute_outbox_message + successful_manager_operation_result + | Sc_rollup_recover_bond_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.sc_rollup_recover_bond successful_manager_operation_result + | Zk_rollup_origination_result : { + balance_updates : Receipt.balance_updates; + originated_zk_rollup : Zk_rollup.t; + consumed_gas : Gas.Arith.fp; + storage_size : Z.t; + } + -> Kind.zk_rollup_origination successful_manager_operation_result + | Zk_rollup_publish_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.zk_rollup_publish successful_manager_operation_result + | Zk_rollup_update_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.zk_rollup_update successful_manager_operation_result + +let migration_origination_result_to_successful_manager_operation_result + ({ + balance_updates; + originated_contracts; + storage_size; + paid_storage_size_diff; + } : + Migration.origination_result) = + Origination_result + { + lazy_storage_diff = None; + balance_updates; + originated_contracts; + consumed_gas = Gas.Arith.zero; + storage_size; + paid_storage_size_diff; + } + +type packed_successful_manager_operation_result = + | Successful_manager_result : + 'kind successful_manager_operation_result + -> packed_successful_manager_operation_result + +let pack_migration_operation_results results = + List.map + (fun el -> + Successful_manager_result + (migration_origination_result_to_successful_manager_operation_result el)) + results + +type 'kind manager_operation_result = + ( 'kind, + 'kind Kind.manager, + 'kind successful_manager_operation_result ) + operation_result + +module Manager_result = struct + type 'kind case = + | MCase : { + op_case : 'kind Operation.Encoding.Manager_operations.case; + encoding : 'a Data_encoding.t; + kind : 'kind Kind.manager; + select : + packed_successful_manager_operation_result -> + 'kind successful_manager_operation_result option; + proj : 'kind successful_manager_operation_result -> 'a; + inj : 'a -> 'kind successful_manager_operation_result; + t : 'kind manager_operation_result Data_encoding.t; + } + -> 'kind case + + let make ~op_case ~encoding ~kind ~select ~proj ~inj = + let (Operation.Encoding.Manager_operations.MCase {name; _}) = op_case in + let t = + def (Format.asprintf "operation.alpha.operation_result.%s" name) + @@ union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Applied" + (merge_objs (obj1 (req "status" (constant "applied"))) encoding) + (fun o -> + match o with + | Skipped _ | Failed _ | Backtracked _ -> None + | Applied o -> ( + match select (Successful_manager_result o) with + | None -> None + | Some o -> Some ((), proj o))) + (fun ((), x) -> Applied (inj x)); + case + (Tag 1) + ~title:"Failed" + (obj2 + (req "status" (constant "failed")) + (req "errors" trace_encoding)) + (function Failed (_, errs) -> Some ((), errs) | _ -> None) + (fun ((), errs) -> Failed (kind, errs)); + case + (Tag 2) + ~title:"Skipped" + (obj1 (req "status" (constant "skipped"))) + (function Skipped _ -> Some () | _ -> None) + (fun () -> Skipped kind); + case + (Tag 3) + ~title:"Backtracked" + (merge_objs + (obj2 + (req "status" (constant "backtracked")) + (opt "errors" trace_encoding)) + encoding) + (fun o -> + match o with + | Skipped _ | Failed _ | Applied _ -> None + | Backtracked (o, errs) -> ( + match select (Successful_manager_result o) with + | None -> None + | Some o -> Some (((), errs), proj o))) + (fun (((), errs), x) -> Backtracked (inj x, errs)); + ] + in + MCase {op_case; encoding; kind; select; proj; inj; t} + + let reveal_case = + make + ~op_case:Operation.Encoding.Manager_operations.reveal_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Reveal_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Reveal_manager_kind + ~proj:(function Reveal_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> Reveal_result {consumed_gas}) + + let transaction_contract_variant_cases = + union + [ + case + ~title:"To_contract" + (Tag 0) + (obj9 + (opt "storage" Script.expr_encoding) + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "ticket_updates" Ticket_receipt.encoding []) + (dft "originated_contracts" (list Contract.originated_encoding) []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "storage_size" z Z.zero) + (dft "paid_storage_size_diff" z Z.zero) + (dft "allocated_destination_contract" bool false) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + (function + | Transaction_to_contract_result + { + storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + allocated_destination_contract; + } -> + Some + ( storage, + balance_updates, + ticket_receipt, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + allocated_destination_contract, + lazy_storage_diff ) + | _ -> None) + (fun ( storage, + balance_updates, + ticket_receipt, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + allocated_destination_contract, + lazy_storage_diff ) -> + Transaction_to_contract_result + { + storage; + lazy_storage_diff; + balance_updates; + ticket_receipt; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + allocated_destination_contract; + }); + case + ~title:"To_tx_rollup" + (Tag 1) + (obj4 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "ticket_hash" Ticket_hash.encoding) + (req "paid_storage_size_diff" n)) + (function + | Transaction_to_tx_rollup_result + { + balance_updates; + consumed_gas; + ticket_hash; + paid_storage_size_diff; + } -> + Some + ( balance_updates, + consumed_gas, + ticket_hash, + paid_storage_size_diff ) + | _ -> None) + (fun ( balance_updates, + consumed_gas, + ticket_hash, + paid_storage_size_diff ) -> + Transaction_to_tx_rollup_result + { + balance_updates; + consumed_gas; + ticket_hash; + paid_storage_size_diff; + }); + case + ~title:"To_sc_rollup" + (Tag 2) + (obj2 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "ticket_updates" Ticket_receipt.encoding)) + (function + | Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt} -> + Some (consumed_gas, ticket_receipt) + | _ -> None) + (function + | consumed_gas, ticket_receipt -> + Transaction_to_sc_rollup_result {consumed_gas; ticket_receipt}); + ] + + let transaction_case = + make + ~op_case:Operation.Encoding.Manager_operations.transaction_case + ~encoding:transaction_contract_variant_cases + ~select:(function + | Successful_manager_result (Transaction_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Transaction_manager_kind + ~proj:(function Transaction_result x -> x) + ~inj:(fun x -> Transaction_result x) + + let origination_case = + make + ~op_case:Operation.Encoding.Manager_operations.origination_case + ~encoding: + (obj6 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "originated_contracts" (list Contract.originated_encoding) []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "storage_size" z Z.zero) + (dft "paid_storage_size_diff" z Z.zero) + (opt "lazy_storage_diff" Lazy_storage.encoding)) + ~select:(function + | Successful_manager_result (Origination_result _ as op) -> Some op + | _ -> None) + ~proj:(function + | Origination_result + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + } -> + (* There used to be a [legacy_lazy_storage_diff] returned as the + first component of the tuple below, and the non-legacy one + returned as the last component. The legacy one has been removed, + but it was chosen to keep the non-legacy one at its position, + hence the order difference with regards to the record above. *) + ( balance_updates, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + lazy_storage_diff )) + ~kind:Kind.Origination_manager_kind + ~inj: + (fun ( balance_updates, + originated_contracts, + consumed_gas, + storage_size, + paid_storage_size_diff, + lazy_storage_diff ) -> + Origination_result + { + lazy_storage_diff; + balance_updates; + originated_contracts; + consumed_gas; + storage_size; + paid_storage_size_diff; + }) + + let register_global_constant_case = + make + ~op_case: + Operation.Encoding.Manager_operations.register_global_constant_case + ~encoding: + (obj4 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "storage_size" z Z.zero) + (req "global_address" Script_expr_hash.encoding)) + ~select:(function + | Successful_manager_result (Register_global_constant_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Register_global_constant_result + {balance_updates; consumed_gas; size_of_constant; global_address} -> + (balance_updates, consumed_gas, size_of_constant, global_address)) + ~kind:Kind.Register_global_constant_manager_kind + ~inj: + (fun (balance_updates, consumed_gas, size_of_constant, global_address) -> + Register_global_constant_result + {balance_updates; consumed_gas; size_of_constant; global_address}) + + let delegation_case = + make + ~op_case:Operation.Encoding.Manager_operations.delegation_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Delegation_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Delegation_manager_kind + ~proj:(function Delegation_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> Delegation_result {consumed_gas}) + + let update_consensus_key_case = + make + ~op_case:Operation.Encoding.Manager_operations.update_consensus_key_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Update_consensus_key_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Update_consensus_key_manager_kind + ~proj:(function + | Update_consensus_key_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> Update_consensus_key_result {consumed_gas}) + + let set_deposits_limit_case = + make + ~op_case:Operation.Encoding.Manager_operations.set_deposits_limit_case + ~encoding: + Data_encoding.( + obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Set_deposits_limit_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Set_deposits_limit_manager_kind + ~proj:(function + | Set_deposits_limit_result {consumed_gas} -> consumed_gas) + ~inj:(fun consumed_gas -> Set_deposits_limit_result {consumed_gas}) + + let increase_paid_storage_case = + make + ~op_case:Operation.Encoding.Manager_operations.increase_paid_storage_case + ~encoding: + Data_encoding.( + obj2 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Increase_paid_storage_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Increase_paid_storage_manager_kind + ~proj:(function + | Increase_paid_storage_result {balance_updates; consumed_gas} -> + (balance_updates, consumed_gas)) + ~inj:(fun (balance_updates, consumed_gas) -> + Increase_paid_storage_result {balance_updates; consumed_gas}) + + let tx_rollup_origination_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_origination_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "originated_rollup" Tx_rollup.encoding)) + ~select:(function + | Successful_manager_result (Tx_rollup_origination_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_origination_manager_kind + ~proj:(function + | Tx_rollup_origination_result + {balance_updates; consumed_gas; originated_tx_rollup} -> + (balance_updates, consumed_gas, originated_tx_rollup)) + ~inj:(fun (balance_updates, consumed_gas, originated_tx_rollup) -> + Tx_rollup_origination_result + {balance_updates; consumed_gas; originated_tx_rollup}) + + let tx_rollup_submit_batch_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_submit_batch_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "paid_storage_size_diff" n)) + ~select:(function + | Successful_manager_result (Tx_rollup_submit_batch_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_submit_batch_manager_kind + ~proj:(function + | Tx_rollup_submit_batch_result + {balance_updates; consumed_gas; paid_storage_size_diff} -> + (balance_updates, consumed_gas, paid_storage_size_diff)) + ~inj:(fun (balance_updates, consumed_gas, paid_storage_size_diff) -> + Tx_rollup_submit_batch_result + {balance_updates; consumed_gas; paid_storage_size_diff}) + + let tx_rollup_commit_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_commit_case + ~encoding: + Data_encoding.( + obj2 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Tx_rollup_commit_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Tx_rollup_commit_manager_kind + ~proj:(function + | Tx_rollup_commit_result {balance_updates; consumed_gas} -> + (balance_updates, consumed_gas)) + ~inj:(fun (balance_updates, consumed_gas) -> + Tx_rollup_commit_result {balance_updates; consumed_gas}) + + let tx_rollup_return_bond_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_return_bond_case + ~encoding: + Data_encoding.( + obj2 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Tx_rollup_return_bond_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_return_bond_manager_kind + ~proj:(function + | Tx_rollup_return_bond_result {balance_updates; consumed_gas} -> + (balance_updates, consumed_gas)) + ~inj:(fun (balance_updates, consumed_gas) -> + Tx_rollup_return_bond_result {balance_updates; consumed_gas}) + + let tx_rollup_finalize_commitment_case = + make + ~op_case: + Operation.Encoding.Manager_operations.tx_rollup_finalize_commitment_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "level" Tx_rollup_level.encoding)) + ~select:(function + | Successful_manager_result + (Tx_rollup_finalize_commitment_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_finalize_commitment_manager_kind + ~proj:(function + | Tx_rollup_finalize_commitment_result + {balance_updates; consumed_gas; level} -> + (balance_updates, consumed_gas, level)) + ~inj:(fun (balance_updates, consumed_gas, level) -> + Tx_rollup_finalize_commitment_result + {balance_updates; consumed_gas; level}) + + let tx_rollup_remove_commitment_case = + make + ~op_case: + Operation.Encoding.Manager_operations.tx_rollup_remove_commitment_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "level" Tx_rollup_level.encoding)) + ~select:(function + | Successful_manager_result (Tx_rollup_remove_commitment_result _ as op) + -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_remove_commitment_manager_kind + ~proj:(function + | Tx_rollup_remove_commitment_result + {balance_updates; consumed_gas; level} -> + (balance_updates, consumed_gas, level)) + ~inj:(fun (balance_updates, consumed_gas, level) -> + Tx_rollup_remove_commitment_result + {balance_updates; consumed_gas; level}) + + let tx_rollup_rejection_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_rejection_case + ~encoding: + Data_encoding.( + obj2 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Tx_rollup_rejection_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_rejection_manager_kind + ~proj:(function + | Tx_rollup_rejection_result {balance_updates; consumed_gas} -> + (balance_updates, consumed_gas)) + ~inj:(fun (balance_updates, consumed_gas) -> + Tx_rollup_rejection_result {balance_updates; consumed_gas}) + + let tx_rollup_dispatch_tickets_case = + make + ~op_case: + Operation.Encoding.Manager_operations.tx_rollup_dispatch_tickets_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "paid_storage_size_diff" z Z.zero)) + ~select:(function + | Successful_manager_result (Tx_rollup_dispatch_tickets_result _ as op) + -> + Some op + | _ -> None) + ~kind:Kind.Tx_rollup_dispatch_tickets_manager_kind + ~proj:(function + | Tx_rollup_dispatch_tickets_result + {balance_updates; consumed_gas; paid_storage_size_diff} -> + (balance_updates, consumed_gas, paid_storage_size_diff)) + ~inj:(fun (balance_updates, consumed_gas, paid_storage_size_diff) -> + Tx_rollup_dispatch_tickets_result + {balance_updates; consumed_gas; paid_storage_size_diff}) + + let transfer_ticket_case = + make + ~op_case:Operation.Encoding.Manager_operations.transfer_ticket_case + ~encoding: + Data_encoding.( + obj4 + (req "balance_updates" Receipt.balance_updates_encoding) + (req "ticket_updates" Ticket_receipt.encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "paid_storage_size_diff" z Z.zero)) + ~select:(function + | Successful_manager_result (Transfer_ticket_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Transfer_ticket_manager_kind + ~proj:(function + | Transfer_ticket_result + { + balance_updates; + ticket_receipt; + consumed_gas; + paid_storage_size_diff; + } -> + ( balance_updates, + ticket_receipt, + consumed_gas, + paid_storage_size_diff )) + ~inj: + (fun ( balance_updates, + ticket_receipt, + consumed_gas, + paid_storage_size_diff ) -> + Transfer_ticket_result + { + balance_updates; + ticket_receipt; + consumed_gas; + paid_storage_size_diff; + }) + + let dal_publish_slot_header_case = + make + ~op_case: + Operation.Encoding.Manager_operations.dal_publish_slot_header_case + ~encoding: + (obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Dal_publish_slot_header_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Dal_publish_slot_header_result {consumed_gas} -> consumed_gas) + ~kind:Kind.Dal_publish_slot_header_manager_kind + ~inj:(fun consumed_gas -> Dal_publish_slot_header_result {consumed_gas}) + + let zk_rollup_origination_case = + make + ~op_case:Operation.Encoding.Manager_operations.zk_rollup_origination_case + ~encoding: + Data_encoding.( + obj4 + (req "balance_updates" Receipt.balance_updates_encoding) + (req "originated_zk_rollup" Zk_rollup.Address.encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "size" z)) + ~select:(function + | Successful_manager_result (Zk_rollup_origination_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Zk_rollup_origination_manager_kind + ~proj:(function + | Zk_rollup_origination_result + {balance_updates; originated_zk_rollup; consumed_gas; storage_size} + -> + (balance_updates, originated_zk_rollup, consumed_gas, storage_size)) + ~inj: + (fun (balance_updates, originated_zk_rollup, consumed_gas, storage_size) -> + Zk_rollup_origination_result + {balance_updates; originated_zk_rollup; consumed_gas; storage_size}) + + let zk_rollup_publish_case = + make + ~op_case:Operation.Encoding.Manager_operations.zk_rollup_publish_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "size" z)) + ~select:(function + | Successful_manager_result (Zk_rollup_publish_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Zk_rollup_publish_manager_kind + ~proj:(function + | Zk_rollup_publish_result + {balance_updates; consumed_gas; paid_storage_size_diff} -> + (balance_updates, consumed_gas, paid_storage_size_diff)) + ~inj:(fun (balance_updates, consumed_gas, paid_storage_size_diff) -> + Zk_rollup_publish_result + {balance_updates; consumed_gas; paid_storage_size_diff}) + + let zk_rollup_update_case = + make + ~op_case:Operation.Encoding.Manager_operations.zk_rollup_update_case + ~encoding: + Data_encoding.( + obj3 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "paid_storage_size_diff" z Z.zero)) + ~select:(function + | Successful_manager_result (Zk_rollup_update_result _ as op) -> Some op + | _ -> None) + ~kind:Kind.Zk_rollup_update_manager_kind + ~proj:(function + | Zk_rollup_update_result + {balance_updates; consumed_gas; paid_storage_size_diff} -> + (balance_updates, consumed_gas, paid_storage_size_diff)) + ~inj:(fun (balance_updates, consumed_gas, paid_storage_size_diff) -> + Zk_rollup_update_result + {balance_updates; consumed_gas; paid_storage_size_diff}) + + let sc_rollup_originate_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_originate_case + ~encoding: + (obj5 + (req "balance_updates" Receipt.balance_updates_encoding) + (req "address" Sc_rollup.Address.encoding) + (req "genesis_commitment_hash" Sc_rollup.Commitment.Hash.encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "size" z)) + ~select:(function + | Successful_manager_result (Sc_rollup_originate_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Sc_rollup_originate_result + { + balance_updates; + address; + genesis_commitment_hash; + consumed_gas; + size; + } -> + ( balance_updates, + address, + genesis_commitment_hash, + consumed_gas, + size )) + ~kind:Kind.Sc_rollup_originate_manager_kind + ~inj: + (fun ( balance_updates, + address, + genesis_commitment_hash, + consumed_gas, + size ) -> + Sc_rollup_originate_result + { + balance_updates; + address; + genesis_commitment_hash; + consumed_gas; + size; + }) + + let sc_rollup_add_messages_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_add_messages_case + ~encoding: + (obj1 (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Sc_rollup_add_messages_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Sc_rollup_add_messages_result {consumed_gas} -> consumed_gas) + ~kind:Kind.Sc_rollup_add_messages_manager_kind + ~inj:(fun consumed_gas -> Sc_rollup_add_messages_result {consumed_gas}) + + let sc_rollup_cement_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_cement_case + ~encoding: + (obj2 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "inbox_level" Raw_level.encoding)) + ~select:(function + | Successful_manager_result (Sc_rollup_cement_result _ as op) -> Some op + | _ -> None) + ~proj:(function + | Sc_rollup_cement_result {consumed_gas; inbox_level} -> + (consumed_gas, inbox_level)) + ~kind:Kind.Sc_rollup_cement_manager_kind + ~inj:(fun (consumed_gas, inbox_level) -> + Sc_rollup_cement_result {consumed_gas; inbox_level}) + + let sc_rollup_publish_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_publish_case + ~encoding: + (obj4 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "staked_hash" Sc_rollup.Commitment.Hash.encoding) + (req "published_at_level" Raw_level.encoding) + (req "balance_updates" Receipt.balance_updates_encoding)) + ~select:(function + | Successful_manager_result (Sc_rollup_publish_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Sc_rollup_publish_result + {consumed_gas; staked_hash; published_at_level; balance_updates} -> + (consumed_gas, staked_hash, published_at_level, balance_updates)) + ~kind:Kind.Sc_rollup_publish_manager_kind + ~inj: + (fun (consumed_gas, staked_hash, published_at_level, balance_updates) -> + Sc_rollup_publish_result + {consumed_gas; staked_hash; published_at_level; balance_updates}) + + let sc_rollup_refute_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_refute_case + ~encoding: + Data_encoding.( + obj3 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "game_status" Sc_rollup.Game.status_encoding) + (req "balance_updates" Receipt.balance_updates_encoding)) + ~select:(function + | Successful_manager_result (Sc_rollup_refute_result _ as op) -> Some op + | _ -> None) + ~proj:(function + | Sc_rollup_refute_result {consumed_gas; game_status; balance_updates} + -> + (consumed_gas, game_status, balance_updates)) + ~kind:Kind.Sc_rollup_refute_manager_kind + ~inj:(fun (consumed_gas, game_status, balance_updates) -> + Sc_rollup_refute_result {consumed_gas; game_status; balance_updates}) + + let sc_rollup_timeout_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_timeout_case + ~encoding: + (obj3 + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (req "game_status" Sc_rollup.Game.status_encoding) + (req "balance_updates" Receipt.balance_updates_encoding)) + ~select:(function + | Successful_manager_result (Sc_rollup_timeout_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Sc_rollup_timeout_result {consumed_gas; game_status; balance_updates} + -> + (consumed_gas, game_status, balance_updates)) + ~kind:Kind.Sc_rollup_timeout_manager_kind + ~inj:(fun (consumed_gas, game_status, balance_updates) -> + Sc_rollup_timeout_result {consumed_gas; game_status; balance_updates}) + + let sc_rollup_execute_outbox_message_case = + make + ~op_case: + Operation.Encoding.Manager_operations + .sc_rollup_execute_outbox_message_case + ~encoding: + Data_encoding.( + obj4 + (req "balance_updates" Receipt.balance_updates_encoding) + (req "ticket_updates" Ticket_receipt.encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero) + (dft "paid_storage_size_diff" z Z.zero)) + ~select:(function + | Successful_manager_result + (Sc_rollup_execute_outbox_message_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Sc_rollup_execute_outbox_message_manager_kind + ~proj:(function + | Sc_rollup_execute_outbox_message_result + { + balance_updates; + ticket_receipt; + consumed_gas; + paid_storage_size_diff; + } -> + ( balance_updates, + ticket_receipt, + consumed_gas, + paid_storage_size_diff )) + ~inj: + (fun ( balance_updates, + ticket_receipt, + consumed_gas, + paid_storage_size_diff ) -> + Sc_rollup_execute_outbox_message_result + { + balance_updates; + ticket_receipt; + consumed_gas; + paid_storage_size_diff; + }) + + let sc_rollup_recover_bond_case = + make + ~op_case:Operation.Encoding.Manager_operations.sc_rollup_recover_bond_case + ~encoding: + Data_encoding.( + obj2 + (req "balance_updates" Receipt.balance_updates_encoding) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~select:(function + | Successful_manager_result (Sc_rollup_recover_bond_result _ as op) -> + Some op + | _ -> None) + ~kind:Kind.Sc_rollup_recover_bond_manager_kind + ~proj:(function + | Sc_rollup_recover_bond_result {balance_updates; consumed_gas} -> + (balance_updates, consumed_gas)) + ~inj:(fun (balance_updates, consumed_gas) -> + Sc_rollup_recover_bond_result {balance_updates; consumed_gas}) +end + +let successful_manager_operation_result_encoding : + packed_successful_manager_operation_result Data_encoding.t = + let make (type kind) + (Manager_result.MCase res_case : kind Manager_result.case) = + let (Operation.Encoding.Manager_operations.MCase op_case) = + res_case.op_case + in + case + (Tag op_case.tag) + ~title:op_case.name + (merge_objs (obj1 (req "kind" (constant op_case.name))) res_case.encoding) + (fun res -> + match res_case.select res with + | Some res -> Some ((), res_case.proj res) + | None -> None) + (fun ((), res) -> Successful_manager_result (res_case.inj res)) + in + def "operation.alpha.successful_manager_operation_result" + @@ union + [ + make Manager_result.reveal_case; + make Manager_result.transaction_case; + make Manager_result.origination_case; + make Manager_result.delegation_case; + make Manager_result.update_consensus_key_case; + make Manager_result.set_deposits_limit_case; + make Manager_result.increase_paid_storage_case; + make Manager_result.sc_rollup_originate_case; + ] + +type 'kind contents_result = + | Preendorsement_result : { + balance_updates : Receipt.balance_updates; + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + preendorsement_power : int; + } + -> Kind.preendorsement contents_result + | Endorsement_result : { + balance_updates : Receipt.balance_updates; + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + endorsement_power : int; + } + -> Kind.endorsement contents_result + | Dal_attestation_result : { + delegate : Signature.Public_key_hash.t; + } + -> Kind.dal_attestation contents_result + | Seed_nonce_revelation_result : + Receipt.balance_updates + -> Kind.seed_nonce_revelation contents_result + | Vdf_revelation_result : + Receipt.balance_updates + -> Kind.vdf_revelation contents_result + | Double_endorsement_evidence_result : + Receipt.balance_updates + -> Kind.double_endorsement_evidence contents_result + | Double_preendorsement_evidence_result : + Receipt.balance_updates + -> Kind.double_preendorsement_evidence contents_result + | Double_baking_evidence_result : + Receipt.balance_updates + -> Kind.double_baking_evidence contents_result + | Activate_account_result : + Receipt.balance_updates + -> Kind.activate_account contents_result + | Proposals_result : Kind.proposals contents_result + | Ballot_result : Kind.ballot contents_result + | Drain_delegate_result : { + balance_updates : Receipt.balance_updates; + allocated_destination_contract : bool; + } + -> Kind.drain_delegate contents_result + | Manager_operation_result : { + balance_updates : Receipt.balance_updates; + operation_result : 'kind manager_operation_result; + internal_operation_results : packed_internal_operation_result list; + } + -> 'kind Kind.manager contents_result + +type packed_contents_result = + | Contents_result : 'kind contents_result -> packed_contents_result + +type packed_contents_and_result = + | Contents_and_result : + 'kind Operation.contents * 'kind contents_result + -> packed_contents_and_result + +type ('a, 'b) eq = Eq : ('a, 'a) eq + +let equal_manager_kind : + type a b. a Kind.manager -> b Kind.manager -> (a, b) eq option = + fun ka kb -> + match (ka, kb) with + | Kind.Reveal_manager_kind, Kind.Reveal_manager_kind -> Some Eq + | Kind.Reveal_manager_kind, _ -> None + | Kind.Transaction_manager_kind, Kind.Transaction_manager_kind -> Some Eq + | Kind.Transaction_manager_kind, _ -> None + | Kind.Origination_manager_kind, Kind.Origination_manager_kind -> Some Eq + | Kind.Origination_manager_kind, _ -> None + | Kind.Delegation_manager_kind, Kind.Delegation_manager_kind -> Some Eq + | Kind.Delegation_manager_kind, _ -> None + | ( Kind.Update_consensus_key_manager_kind, + Kind.Update_consensus_key_manager_kind ) -> + Some Eq + | Kind.Update_consensus_key_manager_kind, _ -> None + | ( Kind.Register_global_constant_manager_kind, + Kind.Register_global_constant_manager_kind ) -> + Some Eq + | Kind.Event_manager_kind, Kind.Event_manager_kind -> Some Eq + | Kind.Event_manager_kind, _ -> None + | Kind.Register_global_constant_manager_kind, _ -> None + | Kind.Set_deposits_limit_manager_kind, Kind.Set_deposits_limit_manager_kind + -> + Some Eq + | Kind.Set_deposits_limit_manager_kind, _ -> None + | ( Kind.Increase_paid_storage_manager_kind, + Kind.Increase_paid_storage_manager_kind ) -> + Some Eq + | Kind.Increase_paid_storage_manager_kind, _ -> None + | ( Kind.Tx_rollup_origination_manager_kind, + Kind.Tx_rollup_origination_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_origination_manager_kind, _ -> None + | ( Kind.Tx_rollup_submit_batch_manager_kind, + Kind.Tx_rollup_submit_batch_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_submit_batch_manager_kind, _ -> None + | Kind.Tx_rollup_commit_manager_kind, Kind.Tx_rollup_commit_manager_kind -> + Some Eq + | Kind.Tx_rollup_commit_manager_kind, _ -> None + | ( Kind.Tx_rollup_return_bond_manager_kind, + Kind.Tx_rollup_return_bond_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_return_bond_manager_kind, _ -> None + | ( Kind.Tx_rollup_finalize_commitment_manager_kind, + Kind.Tx_rollup_finalize_commitment_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_finalize_commitment_manager_kind, _ -> None + | ( Kind.Tx_rollup_remove_commitment_manager_kind, + Kind.Tx_rollup_remove_commitment_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_remove_commitment_manager_kind, _ -> None + | Kind.Tx_rollup_rejection_manager_kind, Kind.Tx_rollup_rejection_manager_kind + -> + Some Eq + | Kind.Tx_rollup_rejection_manager_kind, _ -> None + | ( Kind.Tx_rollup_dispatch_tickets_manager_kind, + Kind.Tx_rollup_dispatch_tickets_manager_kind ) -> + Some Eq + | Kind.Tx_rollup_dispatch_tickets_manager_kind, _ -> None + | Kind.Transfer_ticket_manager_kind, Kind.Transfer_ticket_manager_kind -> + Some Eq + | Kind.Transfer_ticket_manager_kind, _ -> None + | ( Kind.Dal_publish_slot_header_manager_kind, + Kind.Dal_publish_slot_header_manager_kind ) -> + Some Eq + | Kind.Dal_publish_slot_header_manager_kind, _ -> None + | Kind.Sc_rollup_originate_manager_kind, Kind.Sc_rollup_originate_manager_kind + -> + Some Eq + | Kind.Sc_rollup_originate_manager_kind, _ -> None + | ( Kind.Sc_rollup_add_messages_manager_kind, + Kind.Sc_rollup_add_messages_manager_kind ) -> + Some Eq + | Kind.Sc_rollup_add_messages_manager_kind, _ -> None + | Kind.Sc_rollup_cement_manager_kind, Kind.Sc_rollup_cement_manager_kind -> + Some Eq + | Kind.Sc_rollup_cement_manager_kind, _ -> None + | Kind.Sc_rollup_publish_manager_kind, Kind.Sc_rollup_publish_manager_kind -> + Some Eq + | Kind.Sc_rollup_publish_manager_kind, _ -> None + | Kind.Sc_rollup_refute_manager_kind, Kind.Sc_rollup_refute_manager_kind -> + Some Eq + | Kind.Sc_rollup_refute_manager_kind, _ -> None + | Kind.Sc_rollup_timeout_manager_kind, Kind.Sc_rollup_timeout_manager_kind -> + Some Eq + | Kind.Sc_rollup_timeout_manager_kind, _ -> None + | ( Kind.Sc_rollup_execute_outbox_message_manager_kind, + Kind.Sc_rollup_execute_outbox_message_manager_kind ) -> + Some Eq + | Kind.Sc_rollup_execute_outbox_message_manager_kind, _ -> None + | ( Kind.Sc_rollup_recover_bond_manager_kind, + Kind.Sc_rollup_recover_bond_manager_kind ) -> + Some Eq + | Kind.Sc_rollup_recover_bond_manager_kind, _ -> None + | ( Kind.Zk_rollup_origination_manager_kind, + Kind.Zk_rollup_origination_manager_kind ) -> + Some Eq + | Kind.Zk_rollup_origination_manager_kind, _ -> None + | Kind.Zk_rollup_publish_manager_kind, Kind.Zk_rollup_publish_manager_kind -> + Some Eq + | Kind.Zk_rollup_publish_manager_kind, _ -> None + | Kind.Zk_rollup_update_manager_kind, Kind.Zk_rollup_update_manager_kind -> + Some Eq + | Kind.Zk_rollup_update_manager_kind, _ -> None + +module Encoding = struct + type 'kind case = + | Case : { + op_case : 'kind Operation.Encoding.case; + encoding : 'a Data_encoding.t; + select : packed_contents_result -> 'kind contents_result option; + mselect : + packed_contents_and_result -> + ('kind contents * 'kind contents_result) option; + proj : 'kind contents_result -> 'a; + inj : 'a -> 'kind contents_result; + } + -> 'kind case + + let tagged_case tag name args proj inj = + let open Data_encoding in + case + tag + ~title:(String.capitalize_ascii name) + (merge_objs (obj1 (req "kind" (constant name))) args) + (fun x -> match proj x with None -> None | Some x -> Some ((), x)) + (fun ((), x) -> inj x) + + let preendorsement_case = + Case + { + op_case = Operation.Encoding.preendorsement_case; + encoding = + obj4 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (req "delegate" Signature.Public_key_hash.encoding) + (req "preendorsement_power" int31) + (req "consensus_key" Signature.Public_key_hash.encoding); + select = + (function + | Contents_result (Preendorsement_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Preendorsement _ as op), res) -> Some (op, res) + | _ -> None); + proj = + (function + | Preendorsement_result + {balance_updates; delegate; consensus_key; preendorsement_power} + -> + (balance_updates, delegate, preendorsement_power, consensus_key)); + inj = + (fun (balance_updates, delegate, preendorsement_power, consensus_key) -> + Preendorsement_result + {balance_updates; delegate; consensus_key; preendorsement_power}); + } + + let endorsement_case = + Case + { + op_case = Operation.Encoding.endorsement_case; + encoding = + obj4 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (req "delegate" Signature.Public_key_hash.encoding) + (req "endorsement_power" int31) + (req "consensus_key" Signature.Public_key_hash.encoding); + select = + (function + | Contents_result (Endorsement_result _ as op) -> Some op | _ -> None); + mselect = + (function + | Contents_and_result ((Endorsement _ as op), res) -> Some (op, res) + | _ -> None); + proj = + (function + | Endorsement_result + {balance_updates; delegate; consensus_key; endorsement_power} -> + (balance_updates, delegate, endorsement_power, consensus_key)); + inj = + (fun (balance_updates, delegate, endorsement_power, consensus_key) -> + Endorsement_result + {balance_updates; delegate; consensus_key; endorsement_power}); + } + + let dal_attestation_case = + Case + { + op_case = Operation.Encoding.dal_attestation_case; + encoding = obj1 (req "delegate" Signature.Public_key_hash.encoding); + select = + (function + | Contents_result (Dal_attestation_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Dal_attestation _ as op), res) -> + Some (op, res) + | _ -> None); + proj = (function Dal_attestation_result {delegate} -> delegate); + inj = (fun delegate -> Dal_attestation_result {delegate}); + } + + let seed_nonce_revelation_case = + Case + { + op_case = Operation.Encoding.seed_nonce_revelation_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Seed_nonce_revelation_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Seed_nonce_revelation _ as op), res) -> + Some (op, res) + | _ -> None); + proj = (fun (Seed_nonce_revelation_result bus) -> bus); + inj = (fun bus -> Seed_nonce_revelation_result bus); + } + + let vdf_revelation_case = + Case + { + op_case = Operation.Encoding.vdf_revelation_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Vdf_revelation_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Vdf_revelation _ as op), res) -> Some (op, res) + | _ -> None); + proj = (fun (Vdf_revelation_result bus) -> bus); + inj = (fun bus -> Vdf_revelation_result bus); + } + + let double_endorsement_evidence_case = + Case + { + op_case = Operation.Encoding.double_endorsement_evidence_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Double_endorsement_evidence_result _ as op) -> + Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Double_endorsement_evidence _ as op), res) -> + Some (op, res) + | _ -> None); + proj = (fun (Double_endorsement_evidence_result bus) -> bus); + inj = (fun bus -> Double_endorsement_evidence_result bus); + } + + let double_preendorsement_evidence_case = + Case + { + op_case = Operation.Encoding.double_preendorsement_evidence_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Double_preendorsement_evidence_result _ as op) -> + Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Double_preendorsement_evidence _ as op), res) + -> + Some (op, res) + | _ -> None); + proj = (fun (Double_preendorsement_evidence_result bus) -> bus); + inj = (fun bus -> Double_preendorsement_evidence_result bus); + } + + let double_baking_evidence_case = + Case + { + op_case = Operation.Encoding.double_baking_evidence_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Double_baking_evidence_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Double_baking_evidence _ as op), res) -> + Some (op, res) + | _ -> None); + proj = (fun (Double_baking_evidence_result bus) -> bus); + inj = (fun bus -> Double_baking_evidence_result bus); + } + + let activate_account_case = + Case + { + op_case = Operation.Encoding.activate_account_case; + encoding = + obj1 (dft "balance_updates" Receipt.balance_updates_encoding []); + select = + (function + | Contents_result (Activate_account_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Activate_account _ as op), res) -> + Some (op, res) + | _ -> None); + proj = (fun (Activate_account_result bus) -> bus); + inj = (fun bus -> Activate_account_result bus); + } + + let proposals_case = + Case + { + op_case = Operation.Encoding.proposals_case; + encoding = Data_encoding.empty; + select = + (function + | Contents_result (Proposals_result as op) -> Some op | _ -> None); + mselect = + (function + | Contents_and_result ((Proposals _ as op), res) -> Some (op, res) + | _ -> None); + proj = (fun Proposals_result -> ()); + inj = (fun () -> Proposals_result); + } + + let ballot_case = + Case + { + op_case = Operation.Encoding.ballot_case; + encoding = Data_encoding.empty; + select = + (function + | Contents_result (Ballot_result as op) -> Some op | _ -> None); + mselect = + (function + | Contents_and_result ((Ballot _ as op), res) -> Some (op, res) + | _ -> None); + proj = (fun Ballot_result -> ()); + inj = (fun () -> Ballot_result); + } + + let drain_delegate_case = + Case + { + op_case = Operation.Encoding.drain_delegate_case; + encoding = + Data_encoding.( + obj2 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (dft "allocated_destination_contract" bool false)); + select = + (function + | Contents_result (Drain_delegate_result _ as op) -> Some op + | _ -> None); + mselect = + (function + | Contents_and_result ((Drain_delegate _ as op), res) -> Some (op, res) + | _ -> None); + proj = + (function + | Drain_delegate_result + {balance_updates; allocated_destination_contract} -> + (balance_updates, allocated_destination_contract)); + inj = + (fun (balance_updates, allocated_destination_contract) -> + Drain_delegate_result + {balance_updates; allocated_destination_contract}); + } + + let make_manager_case (type kind) + (Operation.Encoding.Case op_case : + kind Kind.manager Operation.Encoding.case) + (Manager_result.MCase res_case : kind Manager_result.case) mselect = + Case + { + op_case = Operation.Encoding.Case op_case; + encoding = + obj3 + (dft "balance_updates" Receipt.balance_updates_encoding []) + (req "operation_result" res_case.t) + (dft + "internal_operation_results" + (list internal_operation_result_encoding) + []); + select = + (function + | Contents_result + (Manager_operation_result + ({operation_result = Applied res; _} as op)) -> ( + match res_case.select (Successful_manager_result res) with + | Some res -> + Some + (Manager_operation_result + {op with operation_result = Applied res}) + | None -> None) + | Contents_result + (Manager_operation_result + ({operation_result = Backtracked (res, errs); _} as op)) -> ( + match res_case.select (Successful_manager_result res) with + | Some res -> + Some + (Manager_operation_result + {op with operation_result = Backtracked (res, errs)}) + | None -> None) + | Contents_result + (Manager_operation_result + ({operation_result = Skipped kind; _} as op)) -> ( + match equal_manager_kind kind res_case.kind with + | None -> None + | Some Eq -> + Some + (Manager_operation_result + {op with operation_result = Skipped kind})) + | Contents_result + (Manager_operation_result + ({operation_result = Failed (kind, errs); _} as op)) -> ( + match equal_manager_kind kind res_case.kind with + | None -> None + | Some Eq -> + Some + (Manager_operation_result + {op with operation_result = Failed (kind, errs)})) + | Contents_result (Preendorsement_result _) -> None + | Contents_result (Endorsement_result _) -> None + | Contents_result (Dal_attestation_result _) -> None + | Contents_result Ballot_result -> None + | Contents_result (Seed_nonce_revelation_result _) -> None + | Contents_result (Vdf_revelation_result _) -> None + | Contents_result (Double_endorsement_evidence_result _) -> None + | Contents_result (Double_preendorsement_evidence_result _) -> None + | Contents_result (Double_baking_evidence_result _) -> None + | Contents_result (Activate_account_result _) -> None + | Contents_result (Drain_delegate_result _) -> None + | Contents_result Proposals_result -> None); + mselect; + proj = + (fun (Manager_operation_result + { + balance_updates = bus; + operation_result = r; + internal_operation_results = rs; + }) -> + (bus, r, rs)); + inj = + (fun (bus, r, rs) -> + Manager_operation_result + { + balance_updates = bus; + operation_result = r; + internal_operation_results = rs; + }); + } + + let reveal_case = + make_manager_case + Operation.Encoding.reveal_case + Manager_result.reveal_case + (function + | Contents_and_result + ((Manager_operation {operation = Reveal _; _} as op), res) -> + Some (op, res) + | _ -> None) + + let transaction_case = + make_manager_case + Operation.Encoding.transaction_case + Manager_result.transaction_case + (function + | Contents_and_result + ((Manager_operation {operation = Transaction _; _} as op), res) -> + Some (op, res) + | _ -> None) + + let origination_case = + make_manager_case + Operation.Encoding.origination_case + Manager_result.origination_case + (function + | Contents_and_result + ((Manager_operation {operation = Origination _; _} as op), res) -> + Some (op, res) + | _ -> None) + + let delegation_case = + make_manager_case + Operation.Encoding.delegation_case + Manager_result.delegation_case + (function + | Contents_and_result + ((Manager_operation {operation = Delegation _; _} as op), res) -> + Some (op, res) + | _ -> None) + + let update_consensus_key_case = + make_manager_case + Operation.Encoding.update_consensus_key_case + Manager_result.update_consensus_key_case + (function + | Contents_and_result + ( (Manager_operation {operation = Update_consensus_key _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let register_global_constant_case = + make_manager_case + Operation.Encoding.register_global_constant_case + Manager_result.register_global_constant_case + (function + | Contents_and_result + ( (Manager_operation {operation = Register_global_constant _; _} as + op), + res ) -> + Some (op, res) + | _ -> None) + + let set_deposits_limit_case = + make_manager_case + Operation.Encoding.set_deposits_limit_case + Manager_result.set_deposits_limit_case + (function + | Contents_and_result + ( (Manager_operation {operation = Set_deposits_limit _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let increase_paid_storage_case = + make_manager_case + Operation.Encoding.increase_paid_storage_case + Manager_result.increase_paid_storage_case + (function + | Contents_and_result + ( (Manager_operation {operation = Increase_paid_storage _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_origination_case = + make_manager_case + Operation.Encoding.tx_rollup_origination_case + Manager_result.tx_rollup_origination_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_origination; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_submit_batch_case = + make_manager_case + Operation.Encoding.tx_rollup_submit_batch_case + Manager_result.tx_rollup_submit_batch_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_submit_batch _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_commit_case = + make_manager_case + Operation.Encoding.tx_rollup_commit_case + Manager_result.tx_rollup_commit_case + (function + | Contents_and_result + ((Manager_operation {operation = Tx_rollup_commit _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let tx_rollup_return_bond_case = + make_manager_case + Operation.Encoding.tx_rollup_return_bond_case + Manager_result.tx_rollup_return_bond_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_return_bond _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_finalize_commitment_case = + make_manager_case + Operation.Encoding.tx_rollup_finalize_commitment_case + Manager_result.tx_rollup_finalize_commitment_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_finalize_commitment _; _} + as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_remove_commitment_case = + make_manager_case + Operation.Encoding.tx_rollup_remove_commitment_case + Manager_result.tx_rollup_remove_commitment_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_remove_commitment _; _} + as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_rejection_case = + make_manager_case + Operation.Encoding.tx_rollup_rejection_case + Manager_result.tx_rollup_rejection_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_rejection _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let tx_rollup_dispatch_tickets_case = + make_manager_case + Operation.Encoding.tx_rollup_dispatch_tickets_case + Manager_result.tx_rollup_dispatch_tickets_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_dispatch_tickets _; _} + as op), + res ) -> + Some (op, res) + | _ -> None) + + let transfer_ticket_case = + make_manager_case + Operation.Encoding.transfer_ticket_case + Manager_result.transfer_ticket_case + (function + | Contents_and_result + ((Manager_operation {operation = Transfer_ticket _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let dal_publish_slot_header_case = + make_manager_case + Operation.Encoding.dal_publish_slot_header_case + Manager_result.dal_publish_slot_header_case + (function + | Contents_and_result + ( (Manager_operation {operation = Dal_publish_slot_header _; _} as + op), + res ) -> + Some (op, res) + | _ -> None) + + let sc_rollup_originate_case = + make_manager_case + Operation.Encoding.sc_rollup_originate_case + Manager_result.sc_rollup_originate_case + (function + | Contents_and_result + ( (Manager_operation {operation = Sc_rollup_originate _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let sc_rollup_add_messages_case = + make_manager_case + Operation.Encoding.sc_rollup_add_messages_case + Manager_result.sc_rollup_add_messages_case + (function + | Contents_and_result + ( (Manager_operation {operation = Sc_rollup_add_messages _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let sc_rollup_cement_case = + make_manager_case + Operation.Encoding.sc_rollup_cement_case + Manager_result.sc_rollup_cement_case + (function + | Contents_and_result + ((Manager_operation {operation = Sc_rollup_cement _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let sc_rollup_publish_case = + make_manager_case + Operation.Encoding.sc_rollup_publish_case + Manager_result.sc_rollup_publish_case + (function + | Contents_and_result + ((Manager_operation {operation = Sc_rollup_publish _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let sc_rollup_refute_case = + make_manager_case + Operation.Encoding.sc_rollup_refute_case + Manager_result.sc_rollup_refute_case + (function + | Contents_and_result + ((Manager_operation {operation = Sc_rollup_refute _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let sc_rollup_timeout_case = + make_manager_case + Operation.Encoding.sc_rollup_timeout_case + Manager_result.sc_rollup_timeout_case + (function + | Contents_and_result + ((Manager_operation {operation = Sc_rollup_timeout _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let sc_rollup_execute_outbox_message_case = + make_manager_case + Operation.Encoding.sc_rollup_execute_outbox_message_case + Manager_result.sc_rollup_execute_outbox_message_case + (function + | Contents_and_result + ( (Manager_operation + {operation = Sc_rollup_execute_outbox_message _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let sc_rollup_recover_bond_case = + make_manager_case + Operation.Encoding.sc_rollup_recover_bond_case + Manager_result.sc_rollup_recover_bond_case + (function + | Contents_and_result + ( (Manager_operation {operation = Sc_rollup_recover_bond _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let zk_rollup_origination_case = + make_manager_case + Operation.Encoding.zk_rollup_origination_case + Manager_result.zk_rollup_origination_case + (function + | Contents_and_result + ( (Manager_operation {operation = Zk_rollup_origination _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + + let zk_rollup_publish_case = + make_manager_case + Operation.Encoding.zk_rollup_publish_case + Manager_result.zk_rollup_publish_case + (function + | Contents_and_result + ((Manager_operation {operation = Zk_rollup_publish _; _} as op), res) + -> + Some (op, res) + | _ -> None) + + let zk_rollup_update_case = + make_manager_case + Operation.Encoding.zk_rollup_update_case + Manager_result.zk_rollup_update_case + (function + | Contents_and_result + ((Manager_operation {operation = Zk_rollup_update _; _} as op), res) + -> + Some (op, res) + | _ -> None) +end + +let contents_result_encoding = + let open Encoding in + let make + (Case + { + op_case = Operation.Encoding.Case {tag; name; _}; + encoding; + mselect = _; + select; + proj; + inj; + }) = + let proj x = match select x with None -> None | Some x -> Some (proj x) in + let inj x = Contents_result (inj x) in + tagged_case (Tag tag) name encoding proj inj + in + def "operation.alpha.contents_result" + @@ union + [ + make seed_nonce_revelation_case; + make vdf_revelation_case; + make endorsement_case; + make preendorsement_case; + make dal_attestation_case; + make double_preendorsement_evidence_case; + make double_endorsement_evidence_case; + make double_baking_evidence_case; + make activate_account_case; + make proposals_case; + make ballot_case; + make drain_delegate_case; + make reveal_case; + make transaction_case; + make origination_case; + make delegation_case; + make register_global_constant_case; + make set_deposits_limit_case; + make increase_paid_storage_case; + make update_consensus_key_case; + make tx_rollup_origination_case; + make tx_rollup_submit_batch_case; + make tx_rollup_commit_case; + make tx_rollup_return_bond_case; + make tx_rollup_finalize_commitment_case; + make tx_rollup_remove_commitment_case; + make tx_rollup_rejection_case; + make tx_rollup_dispatch_tickets_case; + make transfer_ticket_case; + make dal_publish_slot_header_case; + make sc_rollup_originate_case; + make sc_rollup_add_messages_case; + make sc_rollup_cement_case; + make sc_rollup_publish_case; + make sc_rollup_refute_case; + make sc_rollup_timeout_case; + make sc_rollup_execute_outbox_message_case; + make sc_rollup_recover_bond_case; + make zk_rollup_origination_case; + make zk_rollup_publish_case; + make zk_rollup_update_case; + ] + +let contents_and_result_encoding = + let open Encoding in + let make + (Case + { + op_case = Operation.Encoding.Case {tag; name; encoding; proj; inj; _}; + mselect; + encoding = meta_encoding; + proj = meta_proj; + inj = meta_inj; + _; + }) = + let proj c = + match mselect c with + | Some (op, res) -> Some (proj op, meta_proj res) + | _ -> None + in + let inj (op, res) = Contents_and_result (inj op, meta_inj res) in + let encoding = merge_objs encoding (obj1 (req "metadata" meta_encoding)) in + tagged_case (Tag tag) name encoding proj inj + in + def "operation.alpha.operation_contents_and_result" + @@ union + [ + make seed_nonce_revelation_case; + make vdf_revelation_case; + make endorsement_case; + make preendorsement_case; + make dal_attestation_case; + make double_preendorsement_evidence_case; + make double_endorsement_evidence_case; + make double_baking_evidence_case; + make activate_account_case; + make proposals_case; + make ballot_case; + make reveal_case; + make transaction_case; + make origination_case; + make delegation_case; + make register_global_constant_case; + make set_deposits_limit_case; + make increase_paid_storage_case; + make update_consensus_key_case; + make drain_delegate_case; + make tx_rollup_origination_case; + make tx_rollup_submit_batch_case; + make tx_rollup_commit_case; + make tx_rollup_return_bond_case; + make tx_rollup_finalize_commitment_case; + make tx_rollup_remove_commitment_case; + make tx_rollup_rejection_case; + make transfer_ticket_case; + make dal_publish_slot_header_case; + make tx_rollup_dispatch_tickets_case; + make sc_rollup_originate_case; + make sc_rollup_add_messages_case; + make sc_rollup_cement_case; + make sc_rollup_publish_case; + make sc_rollup_refute_case; + make sc_rollup_timeout_case; + make sc_rollup_execute_outbox_message_case; + make sc_rollup_recover_bond_case; + make zk_rollup_origination_case; + make zk_rollup_publish_case; + make zk_rollup_update_case; + ] + +type 'kind contents_result_list = + | Single_result : 'kind contents_result -> 'kind contents_result_list + | Cons_result : + 'kind Kind.manager contents_result + * 'rest Kind.manager contents_result_list + -> ('kind * 'rest) Kind.manager contents_result_list + +type packed_contents_result_list = + | Contents_result_list : + 'kind contents_result_list + -> packed_contents_result_list + +let contents_result_list_encoding = + let rec to_list = function + | Contents_result_list (Single_result o) -> [Contents_result o] + | Contents_result_list (Cons_result (o, os)) -> + Contents_result o :: to_list (Contents_result_list os) + in + let rec of_list = function + | [] -> Error "cannot decode empty operation result" + | [Contents_result o] -> Ok (Contents_result_list (Single_result o)) + | Contents_result o :: os -> ( + of_list os >>? fun (Contents_result_list os) -> + match (o, os) with + | Manager_operation_result _, Single_result (Manager_operation_result _) + -> + Ok (Contents_result_list (Cons_result (o, os))) + | Manager_operation_result _, Cons_result _ -> + Ok (Contents_result_list (Cons_result (o, os))) + | _ -> Error "cannot decode ill-formed operation result") + in + def "operation.alpha.contents_list_result" + @@ conv_with_guard to_list of_list (list contents_result_encoding) + +type 'kind contents_and_result_list = + | Single_and_result : + 'kind Alpha_context.contents * 'kind contents_result + -> 'kind contents_and_result_list + | Cons_and_result : + 'kind Kind.manager Alpha_context.contents + * 'kind Kind.manager contents_result + * 'rest Kind.manager contents_and_result_list + -> ('kind * 'rest) Kind.manager contents_and_result_list + +type packed_contents_and_result_list = + | Contents_and_result_list : + 'kind contents_and_result_list + -> packed_contents_and_result_list + +let contents_and_result_list_encoding = + let rec to_list = function + | Contents_and_result_list (Single_and_result (op, res)) -> + [Contents_and_result (op, res)] + | Contents_and_result_list (Cons_and_result (op, res, rest)) -> + Contents_and_result (op, res) :: to_list (Contents_and_result_list rest) + in + let rec of_list = function + | [] -> Error "cannot decode empty combined operation result" + | [Contents_and_result (op, res)] -> + Ok (Contents_and_result_list (Single_and_result (op, res))) + | Contents_and_result (op, res) :: rest -> ( + of_list rest >>? fun (Contents_and_result_list rest) -> + match (op, rest) with + | Manager_operation _, Single_and_result (Manager_operation _, _) -> + Ok (Contents_and_result_list (Cons_and_result (op, res, rest))) + | Manager_operation _, Cons_and_result (_, _, _) -> + Ok (Contents_and_result_list (Cons_and_result (op, res, rest))) + | _ -> Error "cannot decode ill-formed combined operation result") + in + conv_with_guard to_list of_list (Variable.list contents_and_result_encoding) + +type 'kind operation_metadata = {contents : 'kind contents_result_list} + +type packed_operation_metadata = + | Operation_metadata : 'kind operation_metadata -> packed_operation_metadata + | No_operation_metadata : packed_operation_metadata + +let operation_metadata_encoding = + def "operation.alpha.result" + @@ union + [ + case + (Tag 0) + ~title:"Operation_metadata" + contents_result_list_encoding + (function + | Operation_metadata {contents} -> + Some (Contents_result_list contents) + | _ -> None) + (fun (Contents_result_list contents) -> + Operation_metadata {contents}); + case + (Tag 1) + ~title:"No_operation_metadata" + empty + (function No_operation_metadata -> Some () | _ -> None) + (fun () -> No_operation_metadata); + ] + +let kind_equal : + type kind kind2. + kind contents -> kind2 contents_result -> (kind, kind2) eq option = + fun op res -> + match (op, res) with + | Endorsement _, Endorsement_result _ -> Some Eq + | Endorsement _, _ -> None + | Preendorsement _, Preendorsement_result _ -> Some Eq + | Preendorsement _, _ -> None + | Dal_attestation _, Dal_attestation_result _ -> Some Eq + | Dal_attestation _, _ -> None + | Seed_nonce_revelation _, Seed_nonce_revelation_result _ -> Some Eq + | Seed_nonce_revelation _, _ -> None + | Vdf_revelation _, Vdf_revelation_result _ -> Some Eq + | Vdf_revelation _, _ -> None + | Double_preendorsement_evidence _, Double_preendorsement_evidence_result _ -> + Some Eq + | Double_preendorsement_evidence _, _ -> None + | Double_endorsement_evidence _, Double_endorsement_evidence_result _ -> + Some Eq + | Double_endorsement_evidence _, _ -> None + | Double_baking_evidence _, Double_baking_evidence_result _ -> Some Eq + | Double_baking_evidence _, _ -> None + | Activate_account _, Activate_account_result _ -> Some Eq + | Activate_account _, _ -> None + | Proposals _, Proposals_result -> Some Eq + | Proposals _, _ -> None + | Ballot _, Ballot_result -> Some Eq + | Ballot _, _ -> None + | Drain_delegate _, Drain_delegate_result _ -> Some Eq + | Drain_delegate _, _ -> None + | Failing_noop _, _ -> + (* the Failing_noop operation always fails and can't have result *) + None + | ( Manager_operation {operation = Reveal _; _}, + Manager_operation_result {operation_result = Applied (Reveal_result _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Reveal _; _}, + Manager_operation_result + {operation_result = Backtracked (Reveal_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Reveal _; _}, + Manager_operation_result + { + operation_result = Failed (Alpha_context.Kind.Reveal_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Reveal _; _}, + Manager_operation_result + {operation_result = Skipped Alpha_context.Kind.Reveal_manager_kind; _} ) + -> + Some Eq + | Manager_operation {operation = Reveal _; _}, _ -> None + | ( Manager_operation {operation = Transaction _; _}, + Manager_operation_result + {operation_result = Applied (Transaction_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Transaction _; _}, + Manager_operation_result + {operation_result = Backtracked (Transaction_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Transaction _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Transaction_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Transaction _; _}, + Manager_operation_result + { + operation_result = Skipped Alpha_context.Kind.Transaction_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Transaction _; _}, _ -> None + | ( Manager_operation {operation = Origination _; _}, + Manager_operation_result + {operation_result = Applied (Origination_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Origination _; _}, + Manager_operation_result + {operation_result = Backtracked (Origination_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Origination _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Origination_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Origination _; _}, + Manager_operation_result + { + operation_result = Skipped Alpha_context.Kind.Origination_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Origination _; _}, _ -> None + | ( Manager_operation {operation = Delegation _; _}, + Manager_operation_result + {operation_result = Applied (Delegation_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Delegation _; _}, + Manager_operation_result + {operation_result = Backtracked (Delegation_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Delegation _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Delegation_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Delegation _; _}, + Manager_operation_result + { + operation_result = Skipped Alpha_context.Kind.Delegation_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Delegation _; _}, _ -> None + | ( Manager_operation {operation = Update_consensus_key _; _}, + Manager_operation_result + {operation_result = Applied (Update_consensus_key_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Update_consensus_key _; _}, + Manager_operation_result + {operation_result = Backtracked (Update_consensus_key_result _, _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Update_consensus_key _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Update_consensus_key_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Update_consensus_key _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Update_consensus_key_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Update_consensus_key _; _}, _ -> None + | ( Manager_operation {operation = Register_global_constant _; _}, + Manager_operation_result + {operation_result = Applied (Register_global_constant_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Register_global_constant _; _}, + Manager_operation_result + { + operation_result = Backtracked (Register_global_constant_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Register_global_constant _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Register_global_constant_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Register_global_constant _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Register_global_constant_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Register_global_constant _; _}, _ -> None + | ( Manager_operation {operation = Set_deposits_limit _; _}, + Manager_operation_result + {operation_result = Applied (Set_deposits_limit_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Set_deposits_limit _; _}, + Manager_operation_result + {operation_result = Backtracked (Set_deposits_limit_result _, _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Set_deposits_limit _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Set_deposits_limit_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Set_deposits_limit _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Set_deposits_limit_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Set_deposits_limit _; _}, _ -> None + | ( Manager_operation {operation = Increase_paid_storage _; _}, + Manager_operation_result + {operation_result = Applied (Increase_paid_storage_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Increase_paid_storage _; _}, + Manager_operation_result + {operation_result = Backtracked (Increase_paid_storage_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Increase_paid_storage _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Increase_paid_storage_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Increase_paid_storage _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Increase_paid_storage_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Increase_paid_storage _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_origination; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_origination_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_origination; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_origination_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_origination; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_origination_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_origination; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_origination_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_origination; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_submit_batch _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_submit_batch_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_submit_batch _; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_submit_batch_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_submit_batch _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_submit_batch_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_submit_batch _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_submit_batch_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_submit_batch _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_commit _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_commit_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_commit _; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_commit_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_commit _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_commit_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_commit _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_commit_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_commit _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_return_bond _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_return_bond_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_return_bond _; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_return_bond_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_return_bond _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_return_bond_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_return_bond _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_return_bond_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_return_bond _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_recover_bond _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_recover_bond_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_recover_bond _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_recover_bond_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_recover_bond _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_recover_bond_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_recover_bond _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_recover_bond_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_recover_bond _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_finalize_commitment _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_finalize_commitment_result _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_finalize_commitment _; _}, + Manager_operation_result + { + operation_result = + Backtracked (Tx_rollup_finalize_commitment_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_finalize_commitment _; _}, + Manager_operation_result + { + operation_result = + Failed + (Alpha_context.Kind.Tx_rollup_finalize_commitment_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_finalize_commitment _; _}, + Manager_operation_result + { + operation_result = + Skipped + Alpha_context.Kind.Tx_rollup_finalize_commitment_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_finalize_commitment _; _}, _ -> + None + | ( Manager_operation {operation = Tx_rollup_remove_commitment _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_remove_commitment_result _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_remove_commitment _; _}, + Manager_operation_result + { + operation_result = + Backtracked (Tx_rollup_remove_commitment_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_remove_commitment _; _}, + Manager_operation_result + { + operation_result = + Failed + (Alpha_context.Kind.Tx_rollup_remove_commitment_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_remove_commitment _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_remove_commitment_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_remove_commitment _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_rejection _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_rejection_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_rejection _; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_rejection_result _, _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_rejection _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_rejection_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_rejection _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_rejection_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_rejection _; _}, _ -> None + | ( Manager_operation {operation = Tx_rollup_dispatch_tickets _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_dispatch_tickets_result _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_dispatch_tickets _; _}, + Manager_operation_result + { + operation_result = Backtracked (Tx_rollup_dispatch_tickets_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_dispatch_tickets _; _}, + Manager_operation_result + { + operation_result = + Failed + (Alpha_context.Kind.Tx_rollup_dispatch_tickets_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_dispatch_tickets _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_dispatch_tickets_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Tx_rollup_dispatch_tickets _; _}, _ -> None + | ( Manager_operation {operation = Transfer_ticket _; _}, + Manager_operation_result + {operation_result = Applied (Transfer_ticket_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Transfer_ticket _; _}, + Manager_operation_result + {operation_result = Backtracked (Transfer_ticket_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Transfer_ticket _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Transfer_ticket_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Transfer_ticket _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Transfer_ticket_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Transfer_ticket _; _}, _ -> None + | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + Manager_operation_result + {operation_result = Applied (Dal_publish_slot_header_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + Manager_operation_result + { + operation_result = Backtracked (Dal_publish_slot_header_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Dal_publish_slot_header_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Dal_publish_slot_header _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Dal_publish_slot_header_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Dal_publish_slot_header _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_originate _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_originate_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_originate _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_originate_result _, _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_originate _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_originate_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_originate _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_originate_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_originate _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_add_messages _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_add_messages_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_add_messages _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_add_messages_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_add_messages _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_add_messages_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_add_messages _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_add_messages_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_add_messages _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_cement _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_cement_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_cement _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_cement_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_cement _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_cement_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_cement _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_cement_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_cement _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_publish _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_publish_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_publish _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_publish_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_publish _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_publish_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_publish _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_publish_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_publish _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_refute _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_refute_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_refute _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_refute_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_refute _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_refute_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_refute _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_refute_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_refute _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_timeout _; _}, + Manager_operation_result + {operation_result = Applied (Sc_rollup_timeout_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_timeout _; _}, + Manager_operation_result + {operation_result = Backtracked (Sc_rollup_timeout_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_timeout _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Sc_rollup_timeout_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_timeout _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Sc_rollup_timeout_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_timeout _; _}, _ -> None + | ( Manager_operation {operation = Sc_rollup_execute_outbox_message _; _}, + Manager_operation_result + { + operation_result = Applied (Sc_rollup_execute_outbox_message_result _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_execute_outbox_message _; _}, + Manager_operation_result + { + operation_result = + Backtracked (Sc_rollup_execute_outbox_message_result _, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_execute_outbox_message _; _}, + Manager_operation_result + { + operation_result = + Failed + ( Alpha_context.Kind.Sc_rollup_execute_outbox_message_manager_kind, + _ ); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Sc_rollup_execute_outbox_message _; _}, + Manager_operation_result + { + operation_result = + Skipped + Alpha_context.Kind.Sc_rollup_execute_outbox_message_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Sc_rollup_execute_outbox_message _; _}, _ -> + None + | ( Manager_operation {operation = Zk_rollup_origination _; _}, + Manager_operation_result + {operation_result = Applied (Zk_rollup_origination_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_origination _; _}, + Manager_operation_result + {operation_result = Backtracked (Zk_rollup_origination_result _, _); _} + ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_origination _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Zk_rollup_origination_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_origination _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Zk_rollup_origination_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Zk_rollup_origination _; _}, _ -> None + | ( Manager_operation {operation = Zk_rollup_publish _; _}, + Manager_operation_result + {operation_result = Applied (Zk_rollup_publish_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_publish _; _}, + Manager_operation_result + {operation_result = Backtracked (Zk_rollup_publish_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_publish _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Zk_rollup_publish_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_publish _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Zk_rollup_publish_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Zk_rollup_publish _; _}, _ -> None + | ( Manager_operation {operation = Zk_rollup_update _; _}, + Manager_operation_result + {operation_result = Applied (Zk_rollup_update_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_update _; _}, + Manager_operation_result + {operation_result = Backtracked (Zk_rollup_update_result _, _); _} ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_update _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Zk_rollup_update_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Zk_rollup_update _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Zk_rollup_update_manager_kind; + _; + } ) -> + Some Eq + | Manager_operation {operation = Zk_rollup_update _; _}, _ -> None + +let rec kind_equal_list : + type kind kind2. + kind contents_list -> kind2 contents_result_list -> (kind, kind2) eq option + = + fun contents res -> + match (contents, res) with + | Single op, Single_result res -> ( + match kind_equal op res with None -> None | Some Eq -> Some Eq) + | Cons (op, ops), Cons_result (res, ress) -> ( + match kind_equal op res with + | None -> None + | Some Eq -> ( + match kind_equal_list ops ress with + | None -> None + | Some Eq -> Some Eq)) + | _ -> None + +let rec pack_contents_list : + type kind. + kind contents_list -> + kind contents_result_list -> + kind contents_and_result_list = + fun contents res -> + match (contents, res) with + | Single op, Single_result res -> Single_and_result (op, res) + | Cons (op, ops), Cons_result (res, ress) -> + Cons_and_result (op, res, pack_contents_list ops ress) + | ( Single (Manager_operation _), + Cons_result (Manager_operation_result _, Single_result _) ) -> + . + | ( Cons (_, _), + Single_result (Manager_operation_result {operation_result = Failed _; _}) + ) -> + . + | ( Cons (_, _), + Single_result (Manager_operation_result {operation_result = Skipped _; _}) + ) -> + . + | ( Cons (_, _), + Single_result (Manager_operation_result {operation_result = Applied _; _}) + ) -> + . + | ( Cons (_, _), + Single_result + (Manager_operation_result {operation_result = Backtracked _; _}) ) -> + . + | Single _, Cons_result _ -> . + +let rec unpack_contents_list : + type kind. + kind contents_and_result_list -> + kind contents_list * kind contents_result_list = function + | Single_and_result (op, res) -> (Single op, Single_result res) + | Cons_and_result (op, res, rest) -> + let ops, ress = unpack_contents_list rest in + (Cons (op, ops), Cons_result (res, ress)) + +let rec to_list = function + | Contents_result_list (Single_result o) -> [Contents_result o] + | Contents_result_list (Cons_result (o, os)) -> + Contents_result o :: to_list (Contents_result_list os) + +let operation_data_and_metadata_encoding = + def "operation.alpha.operation_with_metadata" + @@ union + [ + case + (Tag 0) + ~title:"Operation_with_metadata" + (obj2 + (req "contents" (dynamic_size contents_and_result_list_encoding)) + (opt "signature" Signature.encoding)) + (function + | Operation_data _, No_operation_metadata -> None + | Operation_data op, Operation_metadata res -> ( + match kind_equal_list op.contents res.contents with + | None -> + Pervasives.failwith + "cannot decode inconsistent combined operation result" + | Some Eq -> + Some + ( Contents_and_result_list + (pack_contents_list op.contents res.contents), + op.signature ))) + (fun (Contents_and_result_list contents, signature) -> + let op_contents, res_contents = unpack_contents_list contents in + ( Operation_data {contents = op_contents; signature}, + Operation_metadata {contents = res_contents} )); + case + (Tag 1) + ~title:"Operation_without_metadata" + (obj2 + (req "contents" (dynamic_size Operation.contents_list_encoding)) + (opt "signature" Signature.encoding)) + (function + | Operation_data op, No_operation_metadata -> + Some (Contents_list op.contents, op.signature) + | Operation_data _, Operation_metadata _ -> None) + (fun (Contents_list contents, signature) -> + (Operation_data {contents; signature}, No_operation_metadata)); + ] + +type block_metadata = { + proposer : Consensus_key.t; + baker : Consensus_key.t; + level_info : Level.t; + voting_period_info : Voting_period.info; + nonce_hash : Nonce_hash.t option; + consumed_gas : Gas.Arith.fp; + deactivated : Signature.Public_key_hash.t list; + balance_updates : Receipt.balance_updates; + liquidity_baking_toggle_ema : Liquidity_baking.Toggle_EMA.t; + implicit_operations_results : packed_successful_manager_operation_result list; + dal_attestation : Dal.Attestation.t option; +} + +let block_metadata_encoding = + let open Data_encoding in + def "block_header.alpha.metadata" + @@ conv + (fun { + proposer = + {delegate = proposer; consensus_pkh = proposer_active_key}; + baker = {delegate = baker; consensus_pkh = baker_active_key}; + level_info; + voting_period_info; + nonce_hash; + consumed_gas; + deactivated; + balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results; + dal_attestation; + } -> + ( ( proposer, + baker, + level_info, + voting_period_info, + nonce_hash, + deactivated, + balance_updates, + liquidity_baking_toggle_ema, + implicit_operations_results ), + (proposer_active_key, baker_active_key, consumed_gas, dal_attestation) + )) + (fun ( ( proposer, + baker, + level_info, + voting_period_info, + nonce_hash, + deactivated, + balance_updates, + liquidity_baking_toggle_ema, + implicit_operations_results ), + ( proposer_active_key, + baker_active_key, + consumed_gas, + dal_attestation ) ) -> + { + proposer = {delegate = proposer; consensus_pkh = proposer_active_key}; + baker = {delegate = baker; consensus_pkh = baker_active_key}; + level_info; + voting_period_info; + nonce_hash; + consumed_gas; + deactivated; + balance_updates; + liquidity_baking_toggle_ema; + implicit_operations_results; + dal_attestation; + }) + (merge_objs + (obj9 + (req "proposer" Signature.Public_key_hash.encoding) + (req "baker" Signature.Public_key_hash.encoding) + (req "level_info" Level.encoding) + (req "voting_period_info" Voting_period.info_encoding) + (req "nonce_hash" (option Nonce_hash.encoding)) + (req "deactivated" (list Signature.Public_key_hash.encoding)) + (dft "balance_updates" Receipt.balance_updates_encoding []) + (req + "liquidity_baking_toggle_ema" + Liquidity_baking.Toggle_EMA.encoding) + (req + "implicit_operations_results" + (list successful_manager_operation_result_encoding))) + (obj4 + (req "proposer_consensus_key" Signature.Public_key_hash.encoding) + (req "baker_consensus_key" Signature.Public_key_hash.encoding) + (req "consumed_milligas" Gas.Arith.n_fp_encoding) + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3119 + This varopt is here while the DAL is behind a feature + flag. This should be replaced by a required field once + the feature flag will be activated. *) + (varopt "dal_attestation" Dal.Attestation.encoding))) diff --git a/src/proto_016_PtMumbai/lib_protocol/apply_results.mli b/src/proto_016_PtMumbai/lib_protocol/apply_results.mli new file mode 100644 index 000000000000..85016d476741 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/apply_results.mli @@ -0,0 +1,368 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Types representing results of applying an operation. + + These are used internally by [Apply], and can be used for experimenting + with protocol updates, by clients to print out a summary of the + operation at pre-injection simulation and at confirmation time, + and by block explorers. + *) + +open Alpha_context +open Apply_operation_result +open Apply_internal_results + +(** Result of applying a {!Operation.t}. Follows the same structure. *) +type 'kind operation_metadata = {contents : 'kind contents_result_list} + +and packed_operation_metadata = + | Operation_metadata : 'kind operation_metadata -> packed_operation_metadata + | No_operation_metadata : packed_operation_metadata + +(** Result of applying a {!Operation.contents_list}. Follows the same structure. *) +and 'kind contents_result_list = + | Single_result : 'kind contents_result -> 'kind contents_result_list + | Cons_result : + 'kind Kind.manager contents_result + * 'rest Kind.manager contents_result_list + -> ('kind * 'rest) Kind.manager contents_result_list + +and packed_contents_result_list = + | Contents_result_list : + 'kind contents_result_list + -> packed_contents_result_list + +(** Result of applying an {!Operation.contents}. Follows the same structure. *) +and 'kind contents_result = + | Preendorsement_result : { + balance_updates : Receipt.balance_updates; + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + preendorsement_power : int; + } + -> Kind.preendorsement contents_result + | Endorsement_result : { + balance_updates : Receipt.balance_updates; + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + endorsement_power : int; + } + -> Kind.endorsement contents_result + | Dal_attestation_result : { + delegate : Signature.Public_key_hash.t; + } + -> Kind.dal_attestation contents_result + | Seed_nonce_revelation_result : + Receipt.balance_updates + -> Kind.seed_nonce_revelation contents_result + | Vdf_revelation_result : + Receipt.balance_updates + -> Kind.vdf_revelation contents_result + | Double_endorsement_evidence_result : + Receipt.balance_updates + -> Kind.double_endorsement_evidence contents_result + | Double_preendorsement_evidence_result : + Receipt.balance_updates + -> Kind.double_preendorsement_evidence contents_result + | Double_baking_evidence_result : + Receipt.balance_updates + -> Kind.double_baking_evidence contents_result + | Activate_account_result : + Receipt.balance_updates + -> Kind.activate_account contents_result + | Proposals_result : Kind.proposals contents_result + | Ballot_result : Kind.ballot contents_result + | Drain_delegate_result : { + balance_updates : Receipt.balance_updates; + allocated_destination_contract : bool; + } + -> Kind.drain_delegate contents_result + | Manager_operation_result : { + balance_updates : Receipt.balance_updates; + operation_result : 'kind manager_operation_result; + internal_operation_results : packed_internal_operation_result list; + } + -> 'kind Kind.manager contents_result + +and packed_contents_result = + | Contents_result : 'kind contents_result -> packed_contents_result + +and 'kind manager_operation_result = + ( 'kind, + 'kind Kind.manager, + 'kind successful_manager_operation_result ) + operation_result + +(** Result of applying a transaction. *) +and successful_transaction_result = + Apply_internal_results.successful_transaction_result + +(** Result of applying an origination. *) +and successful_origination_result = + Apply_internal_results.successful_origination_result + +(** Result of applying an external {!manager_operation_content}. *) +and _ successful_manager_operation_result = + | Reveal_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.reveal successful_manager_operation_result + | Transaction_result : + successful_transaction_result + -> Kind.transaction successful_manager_operation_result + | Origination_result : + successful_origination_result + -> Kind.origination successful_manager_operation_result + | Delegation_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.delegation successful_manager_operation_result + | Register_global_constant_result : { + (* The manager submitting the operation must pay + the cost of storage for the registered value. + We include the balance update here. *) + balance_updates : Receipt.balance_updates; + (* Gas consumed while validating and storing the registered + value. *) + consumed_gas : Gas.Arith.fp; + (* The size of the registered value in bytes. + Currently, this is simply the number of bytes in the binary + serialization of the Micheline value. *) + size_of_constant : Z.t; + (* The address of the newly registered value, being + the hash of its binary serialization. This could be + calulated on demand but we include it here in the + receipt for flexibility in the future. *) + global_address : Script_expr_hash.t; + } + -> Kind.register_global_constant successful_manager_operation_result + | Set_deposits_limit_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.set_deposits_limit successful_manager_operation_result + | Increase_paid_storage_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.increase_paid_storage successful_manager_operation_result + | Update_consensus_key_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.update_consensus_key successful_manager_operation_result + | Tx_rollup_origination_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + originated_tx_rollup : Tx_rollup.t; + } + -> Kind.tx_rollup_origination successful_manager_operation_result + | Tx_rollup_submit_batch_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.tx_rollup_submit_batch successful_manager_operation_result + | Tx_rollup_commit_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_commit successful_manager_operation_result + | Tx_rollup_return_bond_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_return_bond successful_manager_operation_result + | Tx_rollup_finalize_commitment_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + level : Tx_rollup_level.t; + } + -> Kind.tx_rollup_finalize_commitment successful_manager_operation_result + | Tx_rollup_remove_commitment_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + level : Tx_rollup_level.t; + } + -> Kind.tx_rollup_remove_commitment successful_manager_operation_result + | Tx_rollup_rejection_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_rejection successful_manager_operation_result + | Tx_rollup_dispatch_tickets_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.tx_rollup_dispatch_tickets successful_manager_operation_result + | Transfer_ticket_result : { + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.transfer_ticket successful_manager_operation_result + | Dal_publish_slot_header_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.dal_publish_slot_header successful_manager_operation_result + | Sc_rollup_originate_result : { + balance_updates : Receipt.balance_updates; + address : Sc_rollup.Address.t; + genesis_commitment_hash : Sc_rollup.Commitment.Hash.t; + consumed_gas : Gas.Arith.fp; + size : Z.t; + } + -> Kind.sc_rollup_originate successful_manager_operation_result + | Sc_rollup_add_messages_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.sc_rollup_add_messages successful_manager_operation_result + | Sc_rollup_cement_result : { + consumed_gas : Gas.Arith.fp; + inbox_level : Raw_level.t; + } + -> Kind.sc_rollup_cement successful_manager_operation_result + | Sc_rollup_publish_result : { + consumed_gas : Gas.Arith.fp; + staked_hash : Sc_rollup.Commitment.Hash.t; + published_at_level : Raw_level.t; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_publish successful_manager_operation_result + | Sc_rollup_refute_result : { + consumed_gas : Gas.Arith.fp; + game_status : Sc_rollup.Game.status; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_refute successful_manager_operation_result + | Sc_rollup_timeout_result : { + consumed_gas : Gas.Arith.fp; + game_status : Sc_rollup.Game.status; + balance_updates : Receipt.balance_updates; + } + -> Kind.sc_rollup_timeout successful_manager_operation_result + | Sc_rollup_execute_outbox_message_result : { + balance_updates : Receipt.balance_updates; + ticket_receipt : Ticket_receipt.t; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.sc_rollup_execute_outbox_message + successful_manager_operation_result + | Sc_rollup_recover_bond_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + } + -> Kind.sc_rollup_recover_bond successful_manager_operation_result + | Zk_rollup_origination_result : { + balance_updates : Receipt.balance_updates; + originated_zk_rollup : Zk_rollup.t; + consumed_gas : Gas.Arith.fp; + (* Number of bytes allocated by the ZKRU origination. + Used to burn storage fees. *) + storage_size : Z.t; + } + -> Kind.zk_rollup_origination successful_manager_operation_result + | Zk_rollup_publish_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.zk_rollup_publish successful_manager_operation_result + | Zk_rollup_update_result : { + balance_updates : Receipt.balance_updates; + consumed_gas : Gas.Arith.fp; + paid_storage_size_diff : Z.t; + } + -> Kind.zk_rollup_update successful_manager_operation_result + +and packed_successful_manager_operation_result = + | Successful_manager_result : + 'kind successful_manager_operation_result + -> packed_successful_manager_operation_result + +val pack_migration_operation_results : + Migration.origination_result list -> + packed_successful_manager_operation_result list + +(** Serializer for {!packed_operation_result}. *) +val operation_metadata_encoding : packed_operation_metadata Data_encoding.t + +val operation_data_and_metadata_encoding : + (Operation.packed_protocol_data * packed_operation_metadata) Data_encoding.t + +type 'kind contents_and_result_list = + | Single_and_result : + 'kind Alpha_context.contents * 'kind contents_result + -> 'kind contents_and_result_list + | Cons_and_result : + 'kind Kind.manager Alpha_context.contents + * 'kind Kind.manager contents_result + * 'rest Kind.manager contents_and_result_list + -> ('kind * 'rest) Kind.manager contents_and_result_list + +type packed_contents_and_result_list = + | Contents_and_result_list : + 'kind contents_and_result_list + -> packed_contents_and_result_list + +val contents_and_result_list_encoding : + packed_contents_and_result_list Data_encoding.t + +val pack_contents_list : + 'kind contents_list -> + 'kind contents_result_list -> + 'kind contents_and_result_list + +val unpack_contents_list : + 'kind contents_and_result_list -> + 'kind contents_list * 'kind contents_result_list + +val to_list : packed_contents_result_list -> packed_contents_result list + +type ('a, 'b) eq = Eq : ('a, 'a) eq + +val kind_equal_list : + 'kind contents_list -> + 'kind2 contents_result_list -> + ('kind, 'kind2) eq option + +type block_metadata = { + proposer : Consensus_key.t; + baker : Consensus_key.t; + level_info : Level.t; + voting_period_info : Voting_period.info; + nonce_hash : Nonce_hash.t option; + consumed_gas : Gas.Arith.fp; + deactivated : Signature.Public_key_hash.t list; + balance_updates : Receipt.balance_updates; + liquidity_baking_toggle_ema : Liquidity_baking.Toggle_EMA.t; + implicit_operations_results : packed_successful_manager_operation_result list; + dal_attestation : Dal.Attestation.t option; +} + +val block_metadata_encoding : block_metadata Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/baking.ml b/src/proto_016_PtMumbai/lib_protocol/baking.ml new file mode 100644 index 000000000000..3f5e1468a516 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/baking.ml @@ -0,0 +1,136 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += + | (* `Permanent *) + Insufficient_endorsing_power of { + endorsing_power : int; + consensus_threshold : int; + } + +let () = + register_error_kind + `Permanent + ~id:"baking.insufficient_endorsing_power" + ~title:"Insufficient endorsing power" + ~description: + "The endorsing power is insufficient to satisfy the consensus threshold." + ~pp:(fun ppf (endorsing_power, consensus_threshold) -> + Format.fprintf + ppf + "The endorsing power (%d) is insufficient to satisfy the consensus \ + threshold (%d)." + endorsing_power + consensus_threshold) + Data_encoding.( + obj2 (req "endorsing_power" int31) (req "consensus_threshold" int31)) + (function + | Insufficient_endorsing_power {endorsing_power; consensus_threshold} -> + Some (endorsing_power, consensus_threshold) + | _ -> None) + (fun (endorsing_power, consensus_threshold) -> + Insufficient_endorsing_power {endorsing_power; consensus_threshold}) + +let bonus_baking_reward ctxt ~endorsing_power = + let consensus_threshold = Constants.consensus_threshold ctxt in + let baking_reward_bonus_per_slot = + Constants.baking_reward_bonus_per_slot ctxt + in + let extra_endorsing_power = endorsing_power - consensus_threshold in + error_when + Compare.Int.(extra_endorsing_power < 0) + (Insufficient_endorsing_power {endorsing_power; consensus_threshold}) + >>? fun () -> + Tez.(baking_reward_bonus_per_slot *? Int64.of_int extra_endorsing_power) + +type ordered_slots = { + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + slots : Slot.t list; +} + +(* Slots returned by this function are assumed by consumers to be in increasing + order, hence the use of [Slot.Range.rev_fold_es]. *) +let endorsing_rights (ctxt : t) level = + let consensus_committee_size = Constants.consensus_committee_size ctxt in + Slot.Range.create ~min:0 ~count:consensus_committee_size >>?= fun slots -> + Slot.Range.rev_fold_es + (fun (ctxt, map) slot -> + Stake_distribution.slot_owner ctxt level slot + >>=? fun (ctxt, consensus_pk) -> + let map = + Signature.Public_key_hash.Map.update + consensus_pk.delegate + (function + | None -> + Some + { + delegate = consensus_pk.delegate; + consensus_key = consensus_pk.consensus_pkh; + slots = [slot]; + } + | Some slots -> Some {slots with slots = slot :: slots.slots}) + map + in + return (ctxt, map)) + (ctxt, Signature.Public_key_hash.Map.empty) + slots + +let endorsing_rights_by_first_slot ctxt level = + Slot.Range.create ~min:0 ~count:(Constants.consensus_committee_size ctxt) + >>?= fun slots -> + Slot.Range.fold_es + (fun (ctxt, (delegates_map, slots_map)) slot -> + Stake_distribution.slot_owner ctxt level slot + >|=? fun (ctxt, consensus_pk) -> + let initial_slot, delegates_map = + match + Signature.Public_key_hash.Map.find consensus_pk.delegate delegates_map + with + | None -> + ( slot, + Signature.Public_key_hash.Map.add + consensus_pk.delegate + slot + delegates_map ) + | Some initial_slot -> (initial_slot, delegates_map) + in + (* [slots_map]'keys are the minimal slots of delegates because + we fold on slots in increasing order *) + let slots_map = + Slot.Map.update + initial_slot + (function + | None -> Some (consensus_pk, 1) + | Some (consensus_pk, count) -> Some (consensus_pk, count + 1)) + slots_map + in + (ctxt, (delegates_map, slots_map))) + (ctxt, (Signature.Public_key_hash.Map.empty, Slot.Map.empty)) + slots + >>=? fun (ctxt, (_, slots_map)) -> return (ctxt, slots_map) diff --git a/src/proto_016_PtMumbai/lib_protocol/baking.mli b/src/proto_016_PtMumbai/lib_protocol/baking.mli new file mode 100644 index 000000000000..a20a009f1097 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/baking.mli @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += + | (* `Permanent *) + Insufficient_endorsing_power of { + endorsing_power : int; + consensus_threshold : int; + } + +type ordered_slots = private { + delegate : Signature.public_key_hash; + consensus_key : Signature.public_key_hash; + slots : Slot.t list; +} + +(** For a given level computes who has the right to include an endorsement in + the next block. + + @return map from delegates with such rights to their endorsing slots, in + increasing order. + + This function is only used by the 'validators' RPC. *) +val endorsing_rights : + context -> + Level.t -> + (context * ordered_slots Signature.Public_key_hash.Map.t) tzresult Lwt.t + +(** Computes endorsing rights for a given level. + + @return map from allocated first slots to their owner's public key, public key + hash, and endorsing power. *) +val endorsing_rights_by_first_slot : + context -> + Level.t -> + (context * (Consensus_key.pk * int) Slot.Map.t) tzresult Lwt.t + +(** Computes the bonus baking reward depending on the endorsing power. *) +val bonus_baking_reward : context -> endorsing_power:int -> Tez.t tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/bitset.ml b/src/proto_016_PtMumbai/lib_protocol/bitset.ml new file mode 100644 index 000000000000..6a1511e9336e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bitset.ml @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Z.t + +type error += Invalid_position of int + +let encoding = Data_encoding.z + +let empty = Z.zero + +let mem field pos = + error_when Compare.Int.(pos < 0) (Invalid_position pos) >>? fun () -> + ok @@ Z.testbit field pos + +let add field pos = + error_when Compare.Int.(pos < 0) (Invalid_position pos) >>? fun () -> + ok @@ Z.logor field Z.(shift_left one pos) + +let from_list positions = List.fold_left_e add empty positions + +let fill ~length = + error_when Compare.Int.(length < 0) (Invalid_position length) >>? fun () -> + ok Z.(pred (shift_left one length)) + +let inter = Z.logand + +let diff b1 b2 = Z.logand b1 (Z.lognot b2) + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"bitfield_invalid_position" + ~title:"Invalid bitfield’s position" + ~description:"Bitfields does not accept negative positions" + (obj1 (req "position" int31)) + (function Invalid_position i -> Some i | _ -> None) + (fun i -> Invalid_position i) + +let occupied_size_in_bits = Z.numbits + +module Internal_for_tests = struct + let to_z z = z +end diff --git a/src/proto_016_PtMumbai/lib_protocol/bitset.mli b/src/proto_016_PtMumbai/lib_protocol/bitset.mli new file mode 100644 index 000000000000..1c4a69db2d13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bitset.mli @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A bitset is a compact structure to store a set of integers. *) +type t + +type error += Invalid_position of int + +val encoding : t Data_encoding.t + +(** A bitset encoding the empty set. *) +val empty : t + +(** [mem field i] returns [true] iff [i] has been added in [field]. + + This functions returns [Invalid_input i] if [i] is negative. *) +val mem : t -> int -> bool tzresult + +(** [add field i] returns a new bitset which contains [i] in + addition to the previous integers of [field]. + + This functions returns [Invalid_input i] if [i] is negative. *) +val add : t -> int -> t tzresult + +(** [from_list positions] folds [add] over the [positions] starting from [empty]. + This function returns [Invalid_input i] if [i] is negative and appears in + [positions]. *) +val from_list : int list -> t tzresult + +(** [fill ~length] is equivalent to setting all bits for positions in + [0, length - 1] to [one]. i.e., to [from_list (0 -- size -1)] or to + [(2 ^ length) - 1]. But it's more efficient than folding on individual + positions to set them. + + The function returns [Invalid_position length] if [length] is negative. +*) +val fill : length:int -> t tzresult + +(** [inter set_l set_r] returns [set] which is result of the + intersection of [set_l] and [set_r]. *) +val inter : t -> t -> t + +(** [diff set_l set_r] returns a [set] containing fiels in [set_l] + that are not in [set_r]. *) +val diff : t -> t -> t + +(** [occupied_size_in_bits bitset] returns the current number of bits + occupied by the [bitset]. *) +val occupied_size_in_bits : t -> int + +module Internal_for_tests : sig + val to_z : t -> Z.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.ml b/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.ml new file mode 100644 index 000000000000..005e8d3d365b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.ml @@ -0,0 +1,60 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module H = + Blake2B.Make + (Base58) + (struct + let name = "Blinded public key hash" + + let title = "A blinded public key hash" + + let b58check_prefix = "\001\002\049\223" + + let size = Some Ed25519.Public_key_hash.size + end) + +module Index : Storage_description.INDEX with type t = H.t = struct + include H + include Path_encoding.Make_hex (H) +end + +include H + +let () = Base58.check_encoded_prefix b58check_encoding "btz1" 37 + +let of_ed25519_pkh activation_code pkh = + hash_bytes ~key:activation_code [Ed25519.Public_key_hash.to_bytes pkh] + +type activation_code = bytes + +let activation_code_size = Ed25519.Public_key_hash.size + +let activation_code_encoding = + Data_encoding.Fixed.(bytes Hex) activation_code_size + +let activation_code_of_hex h = + if Compare.Int.(String.length h <> activation_code_size * 2) then None + else Hex.to_bytes (`Hex h) diff --git a/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.mli b/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.mli new file mode 100644 index 000000000000..9be85a79d08d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/blinded_public_key_hash.mli @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module handles hashes of implicit contract addresses used for + commitments in the origin block. + + This module is needed because for legal reasons, when the blockchain is + activated, the btz1 addresses of participants to the fundraising are not + listed directly but instead their hashes are listed, together with their + balances. Thus, the listed accounts can be activated and credited in the + activation block. *) + +include S.HASH + +type activation_code + +val activation_code_encoding : activation_code Data_encoding.t + +val of_ed25519_pkh : activation_code -> Ed25519.Public_key_hash.t -> t + +val activation_code_of_hex : string -> activation_code option + +module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_016_PtMumbai/lib_protocol/block_header_repr.ml b/src/proto_016_PtMumbai/lib_protocol/block_header_repr.ml new file mode 100644 index 000000000000..41b5988a7f9b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_header_repr.ml @@ -0,0 +1,505 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Block header *) + +type contents = { + payload_hash : Block_payload_hash.t; + payload_round : Round_repr.t; + seed_nonce_hash : Nonce_hash.t option; + proof_of_work_nonce : bytes; + liquidity_baking_toggle_vote : + Liquidity_baking_repr.liquidity_baking_toggle_vote; +} + +type protocol_data = {contents : contents; signature : Signature.t} + +type t = {shell : Block_header.shell_header; protocol_data : protocol_data} + +type block_header = t + +type raw = Block_header.t + +type shell_header = Block_header.shell_header + +let raw_encoding = Block_header.encoding + +let shell_header_encoding = Block_header.shell_header_encoding + +type block_watermark = Block_header of Chain_id.t + +let bytes_of_block_watermark = function + | Block_header chain_id -> + Bytes.cat (Bytes.of_string "\x11") (Chain_id.to_bytes chain_id) + +let to_watermark b = Signature.Custom (bytes_of_block_watermark b) + +let of_watermark = function + | Signature.Custom b -> + if Compare.Int.(Bytes.length b > 0) then + match Bytes.get b 0 with + | '\x11' -> + Option.map + (fun chain_id -> Block_header chain_id) + (Chain_id.of_bytes_opt (Bytes.sub b 1 (Bytes.length b - 1))) + | _ -> None + else None + | _ -> None + +let contents_encoding = + let open Data_encoding in + def "block_header.alpha.unsigned_contents" + @@ conv + (fun { + payload_hash; + payload_round; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_toggle_vote; + } -> + ( payload_hash, + payload_round, + proof_of_work_nonce, + seed_nonce_hash, + liquidity_baking_toggle_vote )) + (fun ( payload_hash, + payload_round, + proof_of_work_nonce, + seed_nonce_hash, + liquidity_baking_toggle_vote ) -> + { + payload_hash; + payload_round; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_toggle_vote; + }) + (obj5 + (req "payload_hash" Block_payload_hash.encoding) + (req "payload_round" Round_repr.encoding) + (req + "proof_of_work_nonce" + (Fixed.bytes Hex Constants_repr.proof_of_work_nonce_size)) + (opt "seed_nonce_hash" Nonce_hash.encoding) + (req + "liquidity_baking_toggle_vote" + Liquidity_baking_repr.liquidity_baking_toggle_vote_encoding)) + +let protocol_data_encoding = + let open Data_encoding in + def "block_header.alpha.signed_contents" + @@ conv + (fun {contents; signature} -> (contents, signature)) + (fun (contents, signature) -> {contents; signature}) + (merge_objs + contents_encoding + (obj1 (req "signature" Signature.encoding))) + +let raw {shell; protocol_data} = + let protocol_data = + Data_encoding.Binary.to_bytes_exn protocol_data_encoding protocol_data + in + {Block_header.shell; protocol_data} + +let unsigned_encoding = + let open Data_encoding in + merge_objs Block_header.shell_header_encoding contents_encoding + +let encoding = + let open Data_encoding in + def "block_header.alpha.full_header" + @@ conv + (fun {shell; protocol_data} -> (shell, protocol_data)) + (fun (shell, protocol_data) -> {shell; protocol_data}) + (merge_objs Block_header.shell_header_encoding protocol_data_encoding) + +(** Constants *) + +let max_header_length = + let fake_level = Raw_level_repr.root in + let fake_round = Round_repr.zero in + let fake_fitness = + Fitness_repr.create_without_locked_round + ~level:fake_level + ~predecessor_round:fake_round + ~round:fake_round + in + let fake_shell = + { + Block_header.level = 0l; + proto_level = 0; + predecessor = Block_hash.zero; + timestamp = Time.of_seconds 0L; + validation_passes = 0; + operations_hash = Operation_list_list_hash.zero; + fitness = Fitness_repr.to_raw fake_fitness; + context = Context_hash.zero; + } + and fake_contents = + { + payload_hash = Block_payload_hash.zero; + payload_round = Round_repr.zero; + proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '0'; + seed_nonce_hash = Some Nonce_hash.zero; + liquidity_baking_toggle_vote = LB_pass; + } + in + Data_encoding.Binary.length + encoding + { + shell = fake_shell; + protocol_data = {contents = fake_contents; signature = Signature.zero}; + } + +(** Header parsing entry point *) + +let hash_raw = Block_header.hash + +let hash {shell; protocol_data} = + Block_header.hash + { + shell; + protocol_data = + Data_encoding.Binary.to_bytes_exn protocol_data_encoding protocol_data; + } + +type locked_round_evidence = { + preendorsement_round : Round_repr.t; + preendorsement_count : int; +} + +type error += + | (* Permanent *) + Invalid_block_signature of + Block_hash.t * Signature.Public_key_hash.t + | (* Permanent *) Invalid_stamp + | (* Permanent *) + Invalid_payload_hash of { + expected : Block_payload_hash.t; + provided : Block_payload_hash.t; + } + | (* Permanent *) + Locked_round_after_block_round of { + locked_round : Round_repr.t; + round : Round_repr.t; + } + | (* Permanent *) + Invalid_payload_round of { + payload_round : Round_repr.t; + round : Round_repr.t; + } + | (* Permanent *) + Insufficient_locked_round_evidence of { + voting_power : int; + consensus_threshold : int; + } + | (* Permanent *) Invalid_commitment of {expected : bool} + | (* Permanent *) Wrong_timestamp of Time.t * Time.t + +let () = + register_error_kind + `Permanent + ~id:"block_header.invalid_block_signature" + ~title:"Invalid block signature" + ~description:"A block was not signed with the expected private key." + ~pp:(fun ppf (block, pkh) -> + Format.fprintf + ppf + "Invalid signature for block %a. Expected: %a." + Block_hash.pp_short + block + Signature.Public_key_hash.pp_short + pkh) + Data_encoding.( + obj2 + (req "block" Block_hash.encoding) + (req "expected" Signature.Public_key_hash.encoding)) + (function + | Invalid_block_signature (block, pkh) -> Some (block, pkh) | _ -> None) + (fun (block, pkh) -> Invalid_block_signature (block, pkh)) ; + register_error_kind + `Permanent + ~id:"block_header.invalid_stamp" + ~title:"Insufficient block proof-of-work stamp" + ~description:"The block's proof-of-work stamp is insufficient" + ~pp:(fun ppf () -> Format.fprintf ppf "Insufficient proof-of-work stamp") + Data_encoding.empty + (function Invalid_stamp -> Some () | _ -> None) + (fun () -> Invalid_stamp) ; + register_error_kind + `Permanent + ~id:"block_header.invalid_payload_hash" + ~title:"Invalid payload hash" + ~description:"Invalid payload hash." + ~pp:(fun ppf (expected, provided) -> + Format.fprintf + ppf + "Invalid payload hash (expected: %a, provided: %a)." + Block_payload_hash.pp_short + expected + Block_payload_hash.pp_short + provided) + Data_encoding.( + obj2 + (req "expected" Block_payload_hash.encoding) + (req "provided" Block_payload_hash.encoding)) + (function + | Invalid_payload_hash {expected; provided} -> Some (expected, provided) + | _ -> None) + (fun (expected, provided) -> Invalid_payload_hash {expected; provided}) ; + () ; + register_error_kind + `Permanent + ~id:"block_header.locked_round_after_block_round" + ~title:"Locked round after block round" + ~description:"Locked round after block round." + ~pp:(fun ppf (locked_round, round) -> + Format.fprintf + ppf + "Locked round (%a) is after the block round (%a)." + Round_repr.pp + locked_round + Round_repr.pp + round) + Data_encoding.( + obj2 + (req "locked_round" Round_repr.encoding) + (req "round" Round_repr.encoding)) + (function + | Locked_round_after_block_round {locked_round; round} -> + Some (locked_round, round) + | _ -> None) + (fun (locked_round, round) -> + Locked_round_after_block_round {locked_round; round}) ; + () ; + register_error_kind + `Permanent + ~id:"block_header.invalid_payload_round" + ~title:"Invalid payload round" + ~description:"The given payload round is invalid." + ~pp:(fun ppf (payload_round, round) -> + Format.fprintf + ppf + "The provided payload round (%a) is after the block round (%a)." + Round_repr.pp + payload_round + Round_repr.pp + round) + Data_encoding.( + obj2 + (req "payload_round" Round_repr.encoding) + (req "round" Round_repr.encoding)) + (function + | Invalid_payload_round {payload_round; round} -> + Some (payload_round, round) + | _ -> None) + (fun (payload_round, round) -> Invalid_payload_round {payload_round; round}) ; + register_error_kind + `Permanent + ~id:"block_header.insufficient_locked_round_evidence" + ~title:"Insufficient locked round evidence" + ~description:"Insufficient locked round evidence." + ~pp:(fun ppf (voting_power, consensus_threshold) -> + Format.fprintf + ppf + "The provided locked round evidence is not sufficient: provided %d \ + voting power but was expecting at least %d." + voting_power + consensus_threshold) + Data_encoding.( + obj2 (req "voting_power" int31) (req "consensus_threshold" int31)) + (function + | Insufficient_locked_round_evidence {voting_power; consensus_threshold} + -> + Some (voting_power, consensus_threshold) + | _ -> None) + (fun (voting_power, consensus_threshold) -> + Insufficient_locked_round_evidence {voting_power; consensus_threshold}) ; + register_error_kind + `Permanent + ~id:"block_header.invalid_commitment" + ~title:"Invalid commitment in block header" + ~description:"The block header has invalid commitment." + ~pp:(fun ppf expected -> + if expected then + Format.fprintf ppf "Missing seed's nonce commitment in block header." + else + Format.fprintf ppf "Unexpected seed's nonce commitment in block header.") + Data_encoding.(obj1 (req "expected" bool)) + (function Invalid_commitment {expected} -> Some expected | _ -> None) + (fun expected -> Invalid_commitment {expected}) ; + register_error_kind + `Permanent + ~id:"block_header.wrong_timestamp" + ~title:"Wrong timestamp" + ~description:"Block timestamp not the expected one." + ~pp:(fun ppf (block_ts, expected_ts) -> + Format.fprintf + ppf + "Wrong timestamp: block timestamp (%a) not the expected one (%a)" + Time.pp_hum + block_ts + Time.pp_hum + expected_ts) + Data_encoding.( + obj2 + (req "block_timestamp" Time.encoding) + (req "expected_timestamp" Time.encoding)) + (function Wrong_timestamp (t1, t2) -> Some (t1, t2) | _ -> None) + (fun (t1, t2) -> Wrong_timestamp (t1, t2)) + +let check_signature (block : t) (chain_id : Chain_id.t) + (key : Signature.Public_key.t) = + let check_signature key ({shell; protocol_data = {contents; signature}} : t) = + let unsigned_header = + Data_encoding.Binary.to_bytes_exn unsigned_encoding (shell, contents) + in + Signature.check + ~watermark:(to_watermark (Block_header chain_id)) + key + signature + unsigned_header + in + if check_signature key block then ok () + else + error (Invalid_block_signature (hash block, Signature.Public_key.hash key)) + +let check_payload_round ~round ~payload_round = + error_when + Round_repr.(payload_round > round) + (Invalid_payload_round {payload_round; round}) + +let check_timestamp round_durations ~timestamp ~round ~predecessor_timestamp + ~predecessor_round = + Round_repr.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round + >>? fun expected_timestamp -> + if Time_repr.(expected_timestamp = timestamp) then Error_monad.ok () + else error (Wrong_timestamp (timestamp, expected_timestamp)) + +module Proof_of_work = struct + let check_hash hash stamp_threshold = + let bytes = Block_hash.to_bytes hash in + let word = TzEndian.get_int64 bytes 0 in + Compare.Uint64.(word <= stamp_threshold) + + let check_header_proof_of_work_stamp shell contents stamp_threshold = + let hash = + hash {shell; protocol_data = {contents; signature = Signature.zero}} + in + check_hash hash stamp_threshold + + let check_proof_of_work_stamp ~proof_of_work_threshold block = + if + check_header_proof_of_work_stamp + block.shell + block.protocol_data.contents + proof_of_work_threshold + then ok () + else error Invalid_stamp +end + +let begin_validate_block_header ~(block_header : t) ~(chain_id : Chain_id.t) + ~(predecessor_timestamp : Time.t) ~(predecessor_round : Round_repr.t) + ~(fitness : Fitness_repr.t) ~(timestamp : Time.t) + ~(delegate_pk : Signature.Public_key.t) + ~(round_durations : Round_repr.Durations.t) + ~(proof_of_work_threshold : int64) ~(expected_commitment : bool) = + (* Level relationship between current node and the predecessor is + done by the shell. We know that level is predecessor level + 1. + The predecessor block hash is guaranteed by the shell to be the + one in the shell header. The operations are guaranteed to + correspond to the shell_header.operations_hash by the shell *) + let {payload_round; seed_nonce_hash; _} = + block_header.protocol_data.contents + in + let raw_level = block_header.shell.level in + Proof_of_work.check_proof_of_work_stamp ~proof_of_work_threshold block_header + >>? fun () -> + Raw_level_repr.of_int32 raw_level >>? fun level -> + check_signature block_header chain_id delegate_pk >>? fun () -> + let round = Fitness_repr.round fitness in + check_payload_round ~round ~payload_round >>? fun () -> + check_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp + ~round + >>? fun () -> + Fitness_repr.check_except_locked_round fitness ~level ~predecessor_round + >>? fun () -> + let has_commitment = + match seed_nonce_hash with None -> false | Some _ -> true + in + error_unless + Compare.Bool.(has_commitment = expected_commitment) + (Invalid_commitment {expected = expected_commitment}) + +type checkable_payload_hash = + | No_check + | Expected_payload_hash of Block_payload_hash.t + +let finalize_validate_block_header ~(block_header_contents : contents) + ~(round : Round_repr.t) + ~(* We have to check the round because in the construction case it was + deduced from the time *) + (fitness : Fitness_repr.t) + ~(checkable_payload_hash : checkable_payload_hash) + ~(locked_round_evidence : locked_round_evidence option) + ~(consensus_threshold : int) = + let { + payload_hash = actual_payload_hash; + seed_nonce_hash = _; + proof_of_work_nonce = _; + _; + } = + block_header_contents + in + (match checkable_payload_hash with + | No_check -> Result.return_unit + | Expected_payload_hash bph -> + error_unless + (Block_payload_hash.equal actual_payload_hash bph) + (Invalid_payload_hash {expected = bph; provided = actual_payload_hash})) + >>? fun () -> + (match locked_round_evidence with + | None -> ok None + | Some {preendorsement_count; preendorsement_round} -> + error_when + Round_repr.(preendorsement_round >= round) + (Locked_round_after_block_round + {locked_round = preendorsement_round; round}) + >>? fun () -> + error_when + Compare.Int.(preendorsement_count < consensus_threshold) + (Insufficient_locked_round_evidence + {voting_power = preendorsement_count; consensus_threshold}) + >>? fun () -> ok (Some preendorsement_round)) + >>? fun locked_round -> Fitness_repr.check_locked_round fitness ~locked_round diff --git a/src/proto_016_PtMumbai/lib_protocol/block_header_repr.mli b/src/proto_016_PtMumbai/lib_protocol/block_header_repr.mli new file mode 100644 index 000000000000..a84761403288 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_header_repr.mli @@ -0,0 +1,134 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Representation of block headers. *) + +type contents = { + payload_hash : Block_payload_hash.t; + payload_round : Round_repr.t; + seed_nonce_hash : Nonce_hash.t option; + proof_of_work_nonce : bytes; + liquidity_baking_toggle_vote : + Liquidity_baking_repr.liquidity_baking_toggle_vote; +} + +type protocol_data = {contents : contents; signature : Signature.t} + +type t = {shell : Block_header.shell_header; protocol_data : protocol_data} + +type block_header = t + +type raw = Block_header.t + +type shell_header = Block_header.shell_header + +val raw : block_header -> raw + +val encoding : block_header Data_encoding.encoding + +val raw_encoding : raw Data_encoding.t + +val contents_encoding : contents Data_encoding.t + +val unsigned_encoding : (Block_header.shell_header * contents) Data_encoding.t + +val protocol_data_encoding : protocol_data Data_encoding.encoding + +val shell_header_encoding : shell_header Data_encoding.encoding + +type block_watermark = Block_header of Chain_id.t + +val to_watermark : block_watermark -> Signature.watermark + +val of_watermark : Signature.watermark -> block_watermark option + +(** The maximum size of block headers in bytes *) +val max_header_length : int + +val hash : block_header -> Block_hash.t + +val hash_raw : raw -> Block_hash.t + +type error += (* Permanent *) Invalid_stamp + +(** Checks if the header that would be built from the given components + is valid for the given difficulty. The signature is not passed as + it is does not impact the proof-of-work stamp. The stamp is checked + on the hash of a block header whose signature has been + zeroed-out. *) +module Proof_of_work : sig + val check_hash : Block_hash.t -> int64 -> bool + + val check_header_proof_of_work_stamp : + shell_header -> contents -> int64 -> bool + + val check_proof_of_work_stamp : + proof_of_work_threshold:int64 -> block_header -> unit tzresult +end + +(** [check_timestamp ctxt timestamp round predecessor_timestamp + predecessor_round] verifies that the block's timestamp and round + are coherent with the predecessor block's timestamp and + round. Fails with an error if that is not the case. *) +val check_timestamp : + Round_repr.Durations.t -> + timestamp:Time.t -> + round:Round_repr.t -> + predecessor_timestamp:Time.t -> + predecessor_round:Round_repr.t -> + unit tzresult + +val check_signature : t -> Chain_id.t -> Signature.Public_key.t -> unit tzresult + +val begin_validate_block_header : + block_header:t -> + chain_id:Chain_id.t -> + predecessor_timestamp:Time.t -> + predecessor_round:Round_repr.t -> + fitness:Fitness_repr.t -> + timestamp:Time.t -> + delegate_pk:Signature.public_key -> + round_durations:Round_repr.Durations.t -> + proof_of_work_threshold:int64 -> + expected_commitment:bool -> + unit tzresult + +type locked_round_evidence = { + preendorsement_round : Round_repr.t; + preendorsement_count : int; +} + +type checkable_payload_hash = + | No_check + | Expected_payload_hash of Block_payload_hash.t + +val finalize_validate_block_header : + block_header_contents:contents -> + round:Round_repr.t -> + fitness:Fitness_repr.t -> + checkable_payload_hash:checkable_payload_hash -> + locked_round_evidence:locked_round_evidence option -> + consensus_threshold:int -> + unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.ml b/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.ml new file mode 100644 index 000000000000..724dec25f8b1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.ml @@ -0,0 +1,42 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* 32 *) +let prefix = "\001\106\242" (* vh(52) *) + +include + Blake2B.Make + (Base58) + (struct + let name = "value_hash" + + let title = "Hash of a consensus value" + + let b58check_prefix = prefix + + let size = None + end) + +let () = Base58.check_encoded_prefix b58check_encoding "vh" 52 diff --git a/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.mli b/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.mli new file mode 100644 index 000000000000..90280546e53c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_payload_hash.mli @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing block's payloads. *) + +include S.HASH diff --git a/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.ml b/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.ml new file mode 100644 index 000000000000..1765e1612958 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.ml @@ -0,0 +1,42 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Value on which validators try to reach a consensus. + + Consensus at a given level is reached on a sequence of operations. However, + to differentiate between two blocks having the same sequence of operations, + assuming that could ever happen (for instance, two empty blocks), we also + include the hash of the block that precedes the block where these operations + should be included. *) + +let hash ~predecessor_hash ~payload_round operations = + let operations_hash = Operation_list_hash.compute operations in + let open Data_encoding in + let predecessor = Binary.to_bytes_exn Block_hash.encoding predecessor_hash in + let round = Binary.to_bytes_exn Round_repr.encoding payload_round in + let operations_hash = + Binary.to_bytes_exn Operation_list_hash.encoding operations_hash + in + Block_payload_hash.hash_bytes [predecessor; round; operations_hash] diff --git a/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.mli b/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.mli new file mode 100644 index 000000000000..8f65862e6f55 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/block_payload_repr.mli @@ -0,0 +1,41 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Value on which validators try to reach a consensus. + + Consensus at a given level is reached on a sequence of operations. However, + to differentiate between two blocks having the same sequence of operations, + assuming that could ever happen (for instance, two empty blocks), we also + include the hash of the block that precedes the block where these operations + should be included. *) + +(** Create a payload hash from the predecessor block hash, the first + round at which the payload was proposed, and the hashes of + non-consensus operations. *) +val hash : + predecessor_hash:Block_hash.t -> + payload_round:Round_repr.t -> + Operation_list_hash.elt list -> + Block_payload_hash.t diff --git a/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.ml b/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.ml new file mode 100644 index 000000000000..0feb48847f17 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.ml @@ -0,0 +1,129 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = + | Tx_rollup_bond_id of Tx_rollup_repr.t + | Sc_rollup_bond_id of Sc_rollup_repr.t + +include Compare.Make (struct + type nonrec t = t + + let compare id1 id2 = + match (id1, id2) with + | Tx_rollup_bond_id id1, Tx_rollup_bond_id id2 -> + Tx_rollup_repr.compare id1 id2 + | Sc_rollup_bond_id id1, Sc_rollup_bond_id id2 -> + Sc_rollup_repr.Address.compare id1 id2 + | Tx_rollup_bond_id _, Sc_rollup_bond_id _ -> -1 + | Sc_rollup_bond_id _, Tx_rollup_bond_id _ -> 1 +end) + +let encoding = + let open Data_encoding in + def "bond_id" + @@ union + [ + case + (Tag 0) + ~title:"Tx_rollup_bond_id" + (obj1 (req "tx_rollup" Tx_rollup_repr.encoding)) + (function Tx_rollup_bond_id id -> Some id | _ -> None) + (fun id -> Tx_rollup_bond_id id); + case + (Tag 1) + ~title:"Sc_rollup_bond_id" + (obj1 (req "sc_rollup" Sc_rollup_repr.encoding)) + (function Sc_rollup_bond_id id -> Some id | _ -> None) + (fun id -> Sc_rollup_bond_id id); + ] + +let pp ppf = function + | Tx_rollup_bond_id id -> Tx_rollup_repr.pp ppf id + | Sc_rollup_bond_id id -> Sc_rollup_repr.pp ppf id + +let destruct id = + (* String.starts_with from the stdlib 4.14, with [unsafe_get] replaced by + [get], comparators replaced by their versions in [Compare.*]. *) + let starts_with ~prefix s = + let open String in + let len_s = length s and len_pre = length prefix in + let rec aux i = + if Compare.Int.(i = len_pre) then true + else if Compare.Char.(get s i <> get prefix i) then false + else aux (i + 1) + in + Compare.Int.(len_s >= len_pre) && aux 0 + in + if starts_with ~prefix:Tx_rollup_prefixes.rollup_address.prefix id then + match Tx_rollup_repr.of_b58check_opt id with + | Some id -> Result.ok (Tx_rollup_bond_id id) + | None -> Result.error "Cannot parse transaction rollup id" + else if starts_with ~prefix:Sc_rollup_repr.Address.prefix id then + match Sc_rollup_repr.Address.of_b58check_opt id with + | Some id -> Result.ok (Sc_rollup_bond_id id) + | None -> Result.error "Cannot parse smart contract rollup id" + else Result.error "Cannot parse rollup id" + +let construct = function + | Tx_rollup_bond_id id -> Tx_rollup_repr.to_b58check id + | Sc_rollup_bond_id id -> Sc_rollup_repr.Address.to_b58check id + +let rpc_arg = + RPC_arg.make + ~descr:"A bond identifier." + ~name:"bond_id" + ~construct + ~destruct + () + +module Internal_for_test = struct + let destruct = destruct + + let construct = construct +end + +module Index = struct + type nonrec t = t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt encoding) + | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end diff --git a/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.mli b/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.mli new file mode 100644 index 000000000000..67298a9b1746 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bond_id_repr.mli @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines identifiers for frozen bonds. *) + +type t = + | Tx_rollup_bond_id of Tx_rollup_repr.t + | Sc_rollup_bond_id of Sc_rollup_repr.t + +val pp : Format.formatter -> t -> unit + +val encoding : t Data_encoding.t + +include Compare.S with type t := t + +module Internal_for_test : sig + val destruct : string -> (t, string) result + + val construct : t -> string +end + +module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.ml b/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.ml new file mode 100644 index 000000000000..7c3de02badec --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.ml @@ -0,0 +1,152 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Unrevealed_public_key of Signature.Public_key_hash.t + +let () = + register_error_kind + `Permanent + ~id:"bootstrap.unrevealed_public_key" + ~title:"Forbidden delegation from unrevealed public key" + ~description:"Tried to delegate from an unrevealed public key" + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "Delegation from an unrevealed public key (for %a) is forbidden." + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegator" Signature.Public_key_hash.encoding)) + (function Unrevealed_public_key pkh -> Some pkh | _ -> None) + (fun pkh -> Unrevealed_public_key pkh) + +let init_account (ctxt, balance_updates) + ({public_key_hash; public_key; amount; delegate_to; consensus_key} : + Parameters_repr.bootstrap_account) = + let contract = Contract_repr.Implicit public_key_hash in + Token.transfer + ~origin:Protocol_migration + ctxt + `Bootstrap + (`Contract contract) + amount + >>=? fun (ctxt, new_balance_updates) -> + (match public_key with + | Some public_key -> ( + Contract_manager_storage.reveal_manager_key + ctxt + public_key_hash + public_key + >>=? fun ctxt -> + Delegate_storage.Contract.set + ctxt + contract + (Some (Option.value ~default:public_key_hash delegate_to)) + >>=? fun ctxt -> + match consensus_key with + | None -> return ctxt + | Some consensus_key -> + Delegate_consensus_key.init ctxt public_key_hash consensus_key) + | None -> + fail_when + (Option.is_some delegate_to) + (Unrevealed_public_key public_key_hash) + >>=? fun () -> return ctxt) + >|=? fun ctxt -> (ctxt, new_balance_updates @ balance_updates) + +let init_contract ~typecheck (ctxt, balance_updates) + ({delegate; amount; script} : Parameters_repr.bootstrap_contract) = + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, contract_hash) -> + typecheck ctxt script >>=? fun (script, ctxt) -> + Contract_storage.raw_originate + ctxt + ~prepaid_bootstrap_storage:true + contract_hash + ~script + >>=? fun ctxt -> + let contract = Contract_repr.Originated contract_hash in + (match delegate with + | None -> return ctxt + | Some delegate -> Delegate_storage.Contract.init ctxt contract delegate) + >>=? fun ctxt -> + let origin = Receipt_repr.Protocol_migration in + Token.transfer ~origin ctxt `Bootstrap (`Contract contract) amount + >|=? fun (ctxt, new_balance_updates) -> + (ctxt, new_balance_updates @ balance_updates) + +let init ctxt ~typecheck ?no_reward_cycles accounts contracts = + let nonce = Operation_hash.hash_string ["Un festival de GADT."] in + let ctxt = Raw_context.init_origination_nonce ctxt nonce in + List.fold_left_es init_account (ctxt, []) accounts + >>=? fun (ctxt, balance_updates) -> + List.fold_left_es (init_contract ~typecheck) (ctxt, balance_updates) contracts + >>=? fun (ctxt, balance_updates) -> + (match no_reward_cycles with + | None -> return ctxt + | Some cycles -> + (* Store pending ramp ups. *) + let constants = Raw_context.constants ctxt in + (* Start without rewards *) + Raw_context.patch_constants ctxt (fun c -> + { + c with + baking_reward_fixed_portion = Tez_repr.zero; + baking_reward_bonus_per_slot = Tez_repr.zero; + endorsing_reward_per_slot = Tez_repr.zero; + }) + >>= fun ctxt -> + (* Store the final reward. *) + Storage.Ramp_up.( + Rewards.init + ctxt + (Cycle_repr.of_int32_exn (Int32.of_int cycles)) + { + baking_reward_fixed_portion = constants.baking_reward_fixed_portion; + baking_reward_bonus_per_slot = + constants.baking_reward_bonus_per_slot; + endorsing_reward_per_slot = constants.endorsing_reward_per_slot; + })) + >|=? fun ctxt -> (ctxt, balance_updates) + +let cycle_end ctxt last_cycle = + let next_cycle = Cycle_repr.succ last_cycle in + Storage.Ramp_up.Rewards.find ctxt next_cycle >>=? function + | None -> return ctxt + | Some + Storage.Ramp_up. + { + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + } -> + Storage.Ramp_up.Rewards.remove_existing ctxt next_cycle >>=? fun ctxt -> + Raw_context.patch_constants ctxt (fun c -> + { + c with + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + }) + >|= ok diff --git a/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.mli b/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.mli new file mode 100644 index 000000000000..91cfc6967c61 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bootstrap_storage.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides functions that can be used in a private network to + delay initial rewarding, typically when waiting for more bakers to join the + network. *) + +val init : + Raw_context.t -> + typecheck: + (Raw_context.t -> + Script_repr.t -> + ((Script_repr.t * Lazy_storage_diff.diffs option) * Raw_context.t) tzresult + Lwt.t) -> + ?no_reward_cycles:int -> + Parameters_repr.bootstrap_account list -> + Parameters_repr.bootstrap_contract list -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +val cycle_end : Raw_context.t -> Cycle_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.ml b/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.ml new file mode 100644 index 000000000000..d5cf89fea002 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.ml @@ -0,0 +1,277 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type NAME = sig + val name : string +end + +module type KEY = sig + type t + + val compare : t -> t -> int + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t +end + +module type VALUE = sig + type t + + val equal : t -> t -> bool + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t +end + +module type S = sig + type t + + type key + + type value + + val empty : capacity:int64 -> t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val find : key -> t -> value option + + type error += + | Key_bound_to_different_value of { + key : key; + existing_value : value; + given_value : value; + } + + val remember : key -> value -> t -> t tzresult + + module Internal_for_tests : sig + val empty : capacity:int64 -> next_index:int64 -> t + + val keys : t -> key list + end +end + +module Make (Name : NAME) (Key : KEY) (Value : VALUE) : + S with type key = Key.t and type value = Value.t = struct + type key = Key.t + + type value = Value.t + + module Int64_map = Map.Make (Int64) + module Map = Map.Make (Key) + + type t = { + events : value Map.t; + (** Values stored in the structure, indexes with the keys. *) + sequence : key Int64_map.t; + (** An additional map from int64 indexes to keys, to be able + to remove old entries when the structure is full. *) + capacity : int64; + (** The max number of the entries in the structure. Once the maximum size + is reached, older entries are deleted to free space for new ones. *) + next_index : int64; + (** The index to use for the next entry to add in the structure. *) + oldest_index : int64; + (** The oldest index of the (oldest) entry that has been added to the + data structure. If the structure is empty, [oldest_index] is + equal to [next_index]. *) + size : int64; + (** Counts the number of entries that are stored in history. It + satisfies the invariant: `0 <= size <= capacity` *) + } + + let encoding : t Data_encoding.t = + let open Data_encoding in + let events_encoding = + Data_encoding.conv + Map.bindings + (fun l -> Map.add_seq (List.to_seq l) Map.empty) + Data_encoding.(list (tup2 Key.encoding Value.encoding)) + in + let sequence_encoding = + conv + Int64_map.bindings + (List.fold_left (fun m (k, v) -> Int64_map.add k v m) Int64_map.empty) + (list (tup2 int64 Key.encoding)) + in + conv + (fun {events; sequence; capacity; next_index; oldest_index; size} -> + (events, sequence, capacity, next_index, oldest_index, size)) + (fun (events, sequence, capacity, next_index, oldest_index, size) -> + {events; sequence; capacity; next_index; oldest_index; size}) + (obj6 + (req "events" events_encoding) + (req "sequence" sequence_encoding) + (req "capacity" int64) + (req "next_index" int64) + (req "oldest_index" int64) + (req "size" int64)) + + let pp fmt {events; sequence; capacity; size; oldest_index; next_index} = + Map.bindings events |> fun bindings -> + Int64_map.bindings sequence |> fun sequence_bindings -> + let pp_binding fmt (hash, history_proof) = + Format.fprintf fmt "@[%a -> %a@;@]" Key.pp hash Value.pp history_proof + in + let pp_sequence_binding fmt (counter, hash) = + Format.fprintf fmt "@[%s -> %a@;@]" (Int64.to_string counter) Key.pp hash + in + Format.fprintf + fmt + "@[<hov 2>History:@;\ + \ { capacity: %Ld;@;\ + \ current size: %Ld;@;\ + \ oldest index: %Ld;@;\ + \ next_index : %Ld;@;\ + \ bindings: %a;@;\ + \ sequence: %a; }@]" + capacity + size + oldest_index + next_index + (Format.pp_print_list pp_binding) + bindings + (Format.pp_print_list pp_sequence_binding) + sequence_bindings + + let empty ~capacity = + let next_index = 0L in + { + events = Map.empty; + sequence = Int64_map.empty; + capacity; + next_index; + oldest_index = next_index; + size = 0L; + } + + type error += + | Key_bound_to_different_value of { + key : key; + existing_value : value; + given_value : value; + } + + let () = + assert (not (String.equal Name.name "")) ; + register_error_kind + `Temporary + ~id: + (Format.sprintf + "Bounded_history_repr.%s.key_bound_to_different_value" + Name.name) + ~title:(Name.name ^ ": Key already bound to a different value.") + ~description: + (Name.name + ^ ": Remember called with a key that is already bound to a different\n\ + \ value.") + Data_encoding.( + obj3 + (req "key" Key.encoding) + (req "existing_value" Value.encoding) + (req "given_value" Value.encoding)) + (function + | Key_bound_to_different_value {key; existing_value; given_value} -> + Some (key, existing_value, given_value) + | _ -> None) + (fun (key, existing_value, given_value) -> + Key_bound_to_different_value {key; existing_value; given_value}) + + let remember key value t = + let open Result_syntax in + if Compare.Int64.(t.capacity <= 0L) then return t + else + match Map.find key t.events with + | Some value' when not (Value.equal value value') -> + error + @@ Key_bound_to_different_value + {key; existing_value = value'; given_value = value} + | _ -> ( + let events = Map.add key value t.events in + let current_index = t.next_index in + let next_index = Int64.succ current_index in + let t = + { + events; + sequence = Int64_map.add current_index key t.sequence; + capacity = t.capacity; + next_index; + oldest_index = t.oldest_index; + size = Int64.succ t.size; + } + in + (* A negative size means that [t.capacity] is set to [Int64.max_int] + and that the structure is full, so adding a new entry makes the size + overflows. In this case, we remove an element in the else branch to + keep the size of the structure equal to [Int64.max_int] at most. *) + if Compare.Int64.(t.size > 0L && t.size <= t.capacity) then return t + else + let l = t.oldest_index in + match Int64_map.find l t.sequence with + | None -> + (* If t.size > t.capacity > 0, there is necessarily + an entry whose index is t.oldest_index in [sequence]. *) + assert false + | Some h -> + let sequence = Int64_map.remove l t.sequence in + let events = Map.remove h events in + return + { + next_index = t.next_index; + capacity = t.capacity; + size = t.capacity; + oldest_index = Int64.succ t.oldest_index; + sequence; + events; + }) + + let find key t = Map.find_opt key t.events + + module Internal_for_tests = struct + let empty ~capacity ~next_index = + {(empty ~capacity) with next_index; oldest_index = next_index} + + let keys {sequence; oldest_index; _} = + let l = Int64_map.bindings sequence in + (* All entries with an index greater than oldest_index are well ordered. + There are put in the [lp] list. Entries with an index smaller than + oldest_index are also well ordered, but they should come after + elements in [lp]. This happens in theory when the index reaches + max_int and then overflows. *) + let ln, lp = + List.partition_map + (fun (n, h) -> + if Compare.Int64.(n < oldest_index) then Left h else Right h) + l + in + (* do a tail recursive concatenation lp @ ln *) + List.rev_append (List.rev lp) ln + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.mli b/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.mli new file mode 100644 index 000000000000..7195bb86169c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/bounded_history_repr.mli @@ -0,0 +1,118 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A bounded cache associating values to keys. + +This data structure is basically a bounded association table that stores +(a finite number of) given [(key, value)], with the following properties: +{ul +{li The insertion ordering is remembered / important. When the structure is full, + older entries are removed to insert new ones;} +{li Stored keys are unique in the data-structure.} +} +*) + +module type NAME = sig + val name : string +end + +(** The required interface for keys stored in the table. *) +module type KEY = sig + type t + + val compare : t -> t -> int + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t +end + +(** The required interface for values stored in the table. *) +module type VALUE = sig + type t + + val equal : t -> t -> bool + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t +end + +(** The exported interface of the data structure. *) +module type S = sig + type t + + type key + + type value + + (** [empty ~capacity] returns a new table whose maximum capacity is given. *) + val empty : capacity:int64 -> t + + (** Encoding for values of type {!t} *) + val encoding : t Data_encoding.t + + (** Pretty-printer for values of type {!t} *) + val pp : Format.formatter -> t -> unit + + (** [find key t] returns [Some value] if there exists some [value] associated + to [key] in the table, and [None] otherwise. *) + val find : key -> t -> value option + + type error += + | Key_bound_to_different_value of { + key : key; + existing_value : value; + given_value : value; + } + + (** [remember key value t] inserts a new entry [(key |-> value)] in [t]. + + If [key] already exists in [t], its associated binding [value'] should + be equal to [value]. In this case, [t] is returned unchanged. Otherwise, + an error [Key_bound_to_different_value] is returned. + + If [key] is not already present in [t], the new binding (key |-> value) is + inserted in [t]. If the number of elements would exceed [t]'s capacity + after the insertion of the new binding, the oldest binding is removed + from [t]. + + The structure [t] is returned unchanged if its [capacity] is negative or + null. + *) + val remember : key -> value -> t -> t tzresult + + module Internal_for_tests : sig + (** A more flexible [empty] function for testing purpose. *) + val empty : capacity:int64 -> next_index:int64 -> t + + (** [keys t] returns the keys of the entries stored in [t] in the order of + their insertion. *) + val keys : t -> key list + end +end + +module Make (Name : NAME) (Key : KEY) (Value : VALUE) : + S with type key = Key.t and type value = Value.t diff --git a/src/proto_016_PtMumbai/lib_protocol/cache_memory_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/cache_memory_helpers.ml new file mode 100644 index 000000000000..137f19977931 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/cache_memory_helpers.ml @@ -0,0 +1,185 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type SNodes = sig + type t = private int + + val zero : t + + val one : t [@@ocaml.warning "-32"] + + val succ : t -> t + + val add : t -> t -> t + + val to_int : t -> int +end + +(** The [Nodes] module is used to count the number of computation steps + performed when evaluating the size of the in-memory graph corresponding + to an OCaml value. + + In first approximation, the value of type [Nodes.t] threaded through + {!expr_size} below and through the module {!Script_typed_ir_size} + is meant to match the number of recursive calls in the [traverse] + functions of {!Script_typed_ir} and in that of {!node_size}. + + The assumption is that there's a bounded amount of work performed between + two such recursive calls, hence that the total work is bounded above + by something proportional to the [Nodes.t] accumulator. + + Computations on values of type [Nodes.t] do not overflow, as they + are bounded above by the number of nodes traversed when computing + an OCaml value. + *) +module Nodes : SNodes = struct + type t = int + + let zero = 0 + + let one = 1 + + let succ x = x + 1 + + let add x y = x + y + + let to_int x = x +end + +(** {2 Helpers to deal with computing the in-memory size of values} *) + +type sint = Saturation_repr.may_saturate Saturation_repr.t + +type nodes_and_size = Nodes.t * sint + +let ( !! ) = Saturation_repr.safe_int + +let ( +! ) = Saturation_repr.add + +let ( +? ) s x = Saturation_repr.add s !!x + +let ( *? ) s x = Saturation_repr.mul s !!x + +let ( /? ) s x = Saturation_repr.ediv s !!x + +let ( ++ ) (n1, s1) (n2, s2) = (Nodes.add n1 n2, s1 +! s2) + +let zero = (Nodes.zero, !!0) + +let word_size = !!8 + +let header_size = word_size + +let int32_size = header_size +! word_size + +let int64_size = header_size +! (word_size *? 2) + +let h1w = header_size +! word_size + +let h2w = header_size +! (word_size *? 2) + +let h3w = header_size +! (word_size *? 3) + +let h4w = header_size +! (word_size *? 4) + +let h5w = header_size +! (word_size *? 5) + +let hh3w = (word_size *? 3) +! (header_size *? 2) + +let hh6w = (word_size *? 6) +! (header_size *? 2) + +let hh8w = (word_size *? 8) +! (header_size *? 2) + +let z_size z = + let numbits = Z.numbits z in + (* + Z does not seem to have a canonical representation of numbers. + Hence, even though we observed that 24 works in many cases we + sometimes meet numbers with a larger size, hence we use 32 instead + of 24 in the following formula. + *) + if Compare.Int.(numbits <= 62) then !!0 else (word_size *? Z.size z) +? 32 + +let string_size_gen len = header_size +? (len + (8 - (len mod 8))) + +let bytes_size b = string_size_gen (Bytes.length b) + +let string_size s = string_size_gen (String.length s) + +let blake2b_hash_size = h1w +! string_size_gen 20 + +let public_key_hash_in_memory_size = h1w +! blake2b_hash_size + +let ret_adding (nodes, size) added = (nodes, size +! added) + +let ret_succ_adding (nodes, size) added = (Nodes.succ nodes, size +! added) + +let ret_succ (nodes, size) = (Nodes.succ nodes, size) + +let option_size some x = + let some x = h1w +! some x in + Option.fold ~none:!!0 ~some x + +let option_size_vec some x = + let some x = ret_adding (some x) h1w in + Option.fold ~none:zero ~some x + +let list_cell_size elt_size = header_size +! word_size +! word_size +! elt_size + [@@ocaml.inline always] + +let list_fold_size elt_size list = + List.fold_left + (fun accu elt -> ret_succ_adding (accu ++ elt_size elt) h2w) + zero + list + +let boxed_tup2 x y = header_size +! word_size +! word_size +! x +! y + [@@ocaml.inline always] + +let node_size = + let open Micheline in + (* An OCaml list item occupies 3 words of memory: one for the (::) + constructor, one for the item itself (head) and one for the + remainder of the list (tail). *) + let list_size sns = word_size *? (List.length sns * 3) in + let annotation_size a = + List.fold_left + (fun accu s -> ret_succ_adding accu (h2w +! string_size s)) + zero + a + in + let internal_node_size = function + | Int (_, z) -> (Nodes.one, h2w +! z_size z) + | String (_, s) -> (Nodes.one, h2w +! string_size s) + | Bytes (_, s) -> (Nodes.one, h2w +! bytes_size s) + | Prim (_, _, args, a) -> + ret_succ_adding (annotation_size a) (list_size args +! h4w) + | Seq (_, terms) -> (Nodes.one, list_size terms +! h2w) + in + fun node -> + Script_repr.fold node zero @@ fun accu node -> + accu ++ internal_node_size node + +let expr_size expr = node_size (Micheline.root expr) diff --git a/src/proto_016_PtMumbai/lib_protocol/cache_repr.ml b/src/proto_016_PtMumbai/lib_protocol/cache_repr.ml new file mode 100644 index 000000000000..2850ff2c9c52 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/cache_repr.ml @@ -0,0 +1,320 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Cache_costs = struct + module S = Saturation_repr + + (* Computed by typing the contract + "{parameter unit; storage unit; code FAILWITH}" + and evaluating + [(8 * Obj.reachable_words (Obj.repr typed_script))] + where [typed_script] is of type [ex_script] *) + let minimal_size_of_typed_contract_in_bytes = 688 + + let approximate_cardinal bytes = + S.safe_int (bytes / minimal_size_of_typed_contract_in_bytes) + + let log2 x = S.safe_int (1 + S.numbits x) + + let cache_update_constant = S.safe_int 600 + + let cache_update_coeff = S.safe_int 43 + + (* Cost of calling [Environment_cache.update]. *) + let cache_update ~cache_size_in_bytes = + let approx_card = approximate_cardinal cache_size_in_bytes in + Gas_limit_repr.atomic_step_cost + S.(add cache_update_constant (mul cache_update_coeff (log2 approx_card))) + + (* Cost of calling [Environment_cache.find]. + This overapproximates [cache_find] slightly. *) + let cache_find = cache_update +end + +type index = int + +type size = int + +type identifier = string + +type namespace = string + +type cache_nonce = Bytes.t + +let compare_namespace = Compare.String.compare + +type internal_identifier = {namespace : namespace; id : identifier} + +let separator = '@' + +let sanitize namespace = + if String.contains namespace separator then + invalid_arg + (Format.asprintf + "Invalid cache namespace: '%s'. Character %c is forbidden." + namespace + separator) + else namespace + +let create_namespace = sanitize + +let string_of_internal_identifier {namespace; id} = + namespace ^ String.make 1 separator ^ id + +let internal_identifier_of_string raw = + match String.index_opt raw separator with + | None -> assert false + | Some index -> + { + (* We do not need to call sanitize here since we stop at the first '@' + from index 0. It is a guarantee that there is no '@' between 0 and + (index - 1 ). *) + namespace = String.sub raw 0 index; + id = + (let delim_idx = index + 1 in + String.sub raw delim_idx (String.length raw - delim_idx)); + } + +let internal_identifier_of_key key = + let raw = Raw_context.Cache.identifier_of_key key in + internal_identifier_of_string raw + +let key_of_internal_identifier ~cache_index identifier = + let raw = string_of_internal_identifier identifier in + Raw_context.Cache.key_of_identifier ~cache_index raw + +let make_key = + let namespaces = ref [] in + fun ~cache_index ~namespace -> + if List.mem ~equal:String.equal namespace !namespaces then + invalid_arg + (Format.sprintf "Cache key namespace %s already exist." namespace) + else ( + namespaces := namespace :: !namespaces ; + fun ~id -> + let identifier = {namespace; id} in + key_of_internal_identifier ~cache_index identifier) + +module NamespaceMap = Map.Make (struct + type t = namespace + + let compare = compare_namespace +end) + +type partial_key_handler = + Raw_context.t -> string -> Context.Cache.value tzresult Lwt.t + +let value_of_key_handlers : partial_key_handler NamespaceMap.t ref = + ref NamespaceMap.empty + +module Admin = struct + include Raw_context.Cache + + let future_cache_expectation ?blocks_before_activation ctxt ~time_in_blocks = + let time_in_blocks' = Int32.of_int time_in_blocks in + let blocks_per_voting_period = + Int32.( + mul + (Constants_storage.cycles_per_voting_period ctxt) + (Constants_storage.blocks_per_cycle ctxt)) + in + (match blocks_before_activation with + | None -> Voting_period_storage.blocks_before_activation ctxt + | Some block -> return_some block) + >>=? function + | Some block + when Compare.Int32.( + (Compare.Int32.(block >= 0l) && block <= time_in_blocks') + || blocks_per_voting_period < time_in_blocks') -> + (* + + At each protocol activation, the cache is clear. + + For this reason, if the future block considered for the + prediction is after the activation, the predicted cache + is set to empty. That way, the predicted gas consumption + is guaranteed to be an overapproximation of the actual + gas consumption. + + This function implicitly assumes that [time_in_blocks] + is less than [blocks_per_voting_period]. (The default + value in the simulate_operation RPC is set to 3, and + therefore satisfies this condition.) As a defensive + protection, we clear the cache if this assumption is + not satisfied with user-provided values. Notice that + high user-provided values for [time_in_blocks] do not + make much sense as the cache prediction only works for + blocks in the short-term future. + + *) + return @@ Raw_context.Cache.clear ctxt + | _ -> + return + @@ Raw_context.Cache.future_cache_expectation ctxt ~time_in_blocks + + let list_keys context ~cache_index = + Raw_context.Cache.list_keys context ~cache_index + + let key_rank context key = Raw_context.Cache.key_rank context key + + let value_of_key ctxt key = + (* [value_of_key] is a maintenance operation: it is typically run + when a node reboots. For this reason, this operation is not + carbonated. *) + let ctxt = Raw_context.set_gas_unlimited ctxt in + let {namespace; id} = internal_identifier_of_key key in + match NamespaceMap.find namespace !value_of_key_handlers with + | Some value_of_key -> value_of_key ctxt id + | None -> + failwith + (Format.sprintf "No handler for key `%s%c%s'" namespace separator id) +end + +module type CLIENT = sig + val cache_index : int + + val namespace : namespace + + type cached_value + + val value_of_identifier : + Raw_context.t -> identifier -> cached_value tzresult Lwt.t +end + +module type INTERFACE = sig + type cached_value + + val update : + Raw_context.t -> + identifier -> + (cached_value * int) option -> + Raw_context.t tzresult + + val find : Raw_context.t -> identifier -> cached_value option tzresult Lwt.t + + val list_identifiers : Raw_context.t -> (identifier * int) list + + val identifier_rank : Raw_context.t -> identifier -> int option + + val size : Raw_context.t -> size + + val size_limit : Raw_context.t -> size +end + +let register_exn (type cvalue) + (module C : CLIENT with type cached_value = cvalue) : + (module INTERFACE with type cached_value = cvalue) = + if + Compare.Int.(C.cache_index < 0) + || Compare.Int.(Constants_repr.cache_layout_size <= C.cache_index) + then invalid_arg "Cache index is invalid" ; + let mk = make_key ~cache_index:C.cache_index ~namespace:C.namespace in + (module struct + type cached_value = C.cached_value + + type Admin.value += K of cached_value + + let () = + let voi ctxt i = + C.value_of_identifier ctxt i >>=? fun v -> return (K v) + in + value_of_key_handlers := + NamespaceMap.add C.namespace voi !value_of_key_handlers + + let size ctxt = + Option.value ~default:max_int + @@ Admin.cache_size ctxt ~cache_index:C.cache_index + + let size_limit ctxt = + Option.value ~default:0 + @@ Admin.cache_size_limit ctxt ~cache_index:C.cache_index + + let update ctxt id v = + let cache_size_in_bytes = size ctxt in + Raw_context.consume_gas + ctxt + (Cache_costs.cache_update ~cache_size_in_bytes) + >|? fun ctxt -> + let v = Option.map (fun (v, size) -> (K v, size)) v in + Admin.update ctxt (mk ~id) v + + let find ctxt id = + let cache_size_in_bytes = size ctxt in + Raw_context.consume_gas ctxt (Cache_costs.cache_find ~cache_size_in_bytes) + >>?= fun ctxt -> + Admin.find ctxt (mk ~id) >>= function + | None -> return None + | Some (K v) -> return (Some v) + | _ -> + (* This execution path is impossible because all the keys of + C's namespace (which is unique to C) are constructed with + [K]. This [assert false] could have been pushed into the + environment in exchange for extra complexity. The + argument that justifies this [assert false] seems + simple enough to keep the current design though. *) + assert false + + let list_identifiers ctxt = + Admin.list_keys ctxt ~cache_index:C.cache_index |> function + | None -> + (* `cache_index` is valid. *) + assert false + | Some list -> + List.filter_map + (fun (key, age) -> + let {namespace; id} = internal_identifier_of_key key in + if String.equal namespace C.namespace then Some (id, age) + else None) + list + + let identifier_rank ctxt id = Admin.key_rank ctxt (mk ~id) + end) + +let cache_nonce_from_block_header (shell : Block_header.shell_header) contents : + cache_nonce = + let open Block_header_repr in + let shell : Block_header.shell_header = + { + level = 0l; + proto_level = 0; + predecessor = shell.predecessor; + timestamp = Time.of_seconds 0L; + validation_passes = 0; + operations_hash = shell.operations_hash; + fitness = []; + context = Context_hash.zero; + } + in + let contents = + { + contents with + payload_hash = Block_payload_hash.zero; + proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '0'; + } + in + let protocol_data = {signature = Signature.zero; contents} in + let x = {shell; protocol_data} in + Block_hash.to_bytes (hash x) diff --git a/src/proto_016_PtMumbai/lib_protocol/cache_repr.mli b/src/proto_016_PtMumbai/lib_protocol/cache_repr.mli new file mode 100644 index 000000000000..2d026d423601 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/cache_repr.mli @@ -0,0 +1,244 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + + Frequently used data should be kept in memory and persisted along a + chain of blocks. The caching mechanism allows the economic protocol + to declare such data and to rely on a Least Recently Used strategy + to keep the cache size under a fixed limit. + + Take a look at {!Environment_cache} and {!Environment_context} + for additional implementation details about the protocol cache. + + The protocol has two main kinds of interaction with the cache: + + 1. It is responsible for setting up the cache with appropriate + parameter values and callbacks. It must also compute cache nonces + to give the shell enough information to properly synchronize the + in-memory cache with the block contexts and protocol upgrades. + A typical place where this happens is {!Apply}. + This aspect must be implemented using {!Cache.Admin}. + + 2. It can exploit the cache to retrieve, to insert, and to update + cached values from the in-memory cache. The basic idea is to + avoid recomputing values from scratch at each block when they are + frequently used. {!Script_cache} is an example of such usage. + This aspect must be implemented using {!Cache.Interface}. + + *) + +(** Size for subcaches and values of the cache. *) +type size = int + +(** Index type to index caches. *) +type index = int + +(** Type used to identifies the block that introduced new cache + entries *) +type cache_nonce + +(** + + The following module acts on the whole cache, not on a specific + sub-cache, unlike {!Interface}. It is used to administrate the + protocol cache, e.g., to maintain the cache in a consistent state + with respect to the chain. This module is typically used by + low-level layers of the protocol and by the shell. + +*) +module Admin : sig + (** A key uniquely identifies a cached [value] in some subcache. *) + type key + + (** Cached values. *) + type value + + (** [pp fmt ctxt] is a pretty printer for the [cache] of [ctxt]. *) + val pp : Format.formatter -> Raw_context.t -> unit + + (** [sync ctxt cache_nonce] updates the context with the domain of + the cache computed so far. Such function is expected to be called + at the end of the validation of a block, when there is no more + accesses to the cache. + + [cache_nonce] identifies the block that introduced new cache + entries. The nonce should identify uniquely the block which + modifies this value. It cannot be the block hash for circularity + reasons: The value of the nonce is stored onto the context and + consequently influences the context hash of the very same + block. Such nonce cannot be determined by the shell and its + computation is delegated to the economic protocol. *) + val sync : Raw_context.t -> cache_nonce -> Raw_context.t Lwt.t + + (** {3 Cache helpers for RPCs} *) + + (** [future_cache_expectation ?blocks_before_activation ctxt + ~time_in_blocks] returns [ctxt] except that the entries of the + caches that are presumably too old to still be in the caches in + [n_blocks] are removed. + + This function is based on a heuristic. The context maintains the + median of the number of removed entries: this number is multiplied + by `n_blocks` to determine the entries that are likely to be + removed in `n_blocks`. + + If [blocks_before_activation] is set to [Some n], + then the cache is considered empty if [0 <= n <= time_in_blocks]. + Otherwise, if [blocks_before_activation] is set to [None] and + if the voting period is the adoption, the cache is considered + empty if [blocks <= time_in_blocks remaining for adoption phase]. *) + val future_cache_expectation : + ?blocks_before_activation:int32 -> + Raw_context.t -> + time_in_blocks:int -> + Raw_context.t tzresult Lwt.t + + (** [cache_size ctxt ~cache_index] returns an overapproximation of + the size of the cache. Returns [None] if [cache_index] is + greater than the number of subcaches declared by the cache + layout. *) + val cache_size : Raw_context.t -> cache_index:int -> size option + + (** [cache_size_limit ctxt ~cache_index] returns the maximal size of + the cache indexed by [cache_index]. Returns [None] if + [cache_index] is greater than the number of subcaches declared + by the cache layout. *) + val cache_size_limit : Raw_context.t -> cache_index:int -> size option + + (** [value_of_key ctxt k] interprets the functions introduced by + [register] to construct a cacheable value for a key [k]. + + [value_of_key] is a maintenance operation: it is typically run + when a node reboots. For this reason, this operation is not + carbonated. *) + val value_of_key : + Raw_context.t -> Context.Cache.key -> Context.Cache.value tzresult Lwt.t +end + +(** A client uses a unique namespace (represented as a string + without '@') to avoid collision with the keys of other + clients. *) +type namespace = private string + +(** [create_namespace str] creates a valid namespace from [str] + + @raise Invalid_argument if [str] contains '@' + *) +val create_namespace : string -> namespace + +(** A key is fully determined by a namespace and an identifier. *) +type identifier = string + +(** + To use the cache, a client must implement the [CLIENT] + interface. + + *) +module type CLIENT = sig + (** The type of value to be stored in the cache. *) + type cached_value + + (** The client must declare the index of the subcache where its + values shall live. [cache_index] must be between [0] and + [List.length Constants_repr.cache_layout - 1]. *) + val cache_index : index + + (** The client must declare a namespace. This namespace must + be unique. Otherwise, the program stops. + A namespace cannot contain '@'. *) + val namespace : namespace + + (** [value_of_identifier id] builds the cached value identified by + [id]. This function is called when the subcache is loaded into + memory from the on-disk representation of its domain. + + An error during the execution of this function is fatal as + witnessed by its type: an error embedded in a [tzresult] is not + supposed to be caught by the protocol. *) + val value_of_identifier : + Raw_context.t -> identifier -> cached_value tzresult Lwt.t +end + +(** + + An [INTERFACE] to the subcache where keys live in a given [namespace]. + + *) +module type INTERFACE = sig + (** The type of value to be stored in the cache. *) + type cached_value + + (** [update ctxt i (Some (e, size))] returns a context where the + value [e] of given [size] is associated to identifier [i] in + the subcache. If [i] is already in the subcache, the cache + entry is updated. + + [update ctxt i None] removes [i] from the subcache. *) + val update : + Raw_context.t -> + identifier -> + (cached_value * size) option -> + Raw_context.t tzresult + + (** [find ctxt i = Some v] if [v] is the value associated to [i] + in the subcache. Returns [None] if there is no such value in + the subcache. This function is in the Lwt monad because if the + value may have not been constructed (see the lazy loading + mode in {!Environment_context}), it is constructed on the fly. *) + val find : Raw_context.t -> identifier -> cached_value option tzresult Lwt.t + + (** [list_identifiers ctxt] returns the list of the + identifiers of the cached values along with their respective + size. The returned list is sorted in terms of their age in the + cache, the oldest coming first. *) + val list_identifiers : Raw_context.t -> (string * int) list + + (** [identifier_rank ctxt identifier] returns the number of cached values + older than the one of [identifier]; or, [None] if the [identifier] has + no associated value in the subcache. *) + val identifier_rank : Raw_context.t -> string -> int option + + (** [size ctxt] returns an overapproximation of the subcache size. + Note that the size unit is subcache specific. *) + val size : Raw_context.t -> int + + (** [size_limit ctxt] returns the maximal size of the subcache. + Note that the size unit is subcache specific. *) + val size_limit : Raw_context.t -> int +end + +(** [register_exn client] produces an [Interface] specific to a + given [client]. This function can fail if [client] does not + respect the invariant declared in the documentation of + {!CLIENT}. *) +val register_exn : + (module CLIENT with type cached_value = 'a) -> + (module INTERFACE with type cached_value = 'a) + +(** [cache_nonce_from_block_header shell_header contents] computes a + {!cache_nonce} from the [shell_header] and its [contents]. *) +val cache_nonce_from_block_header : + Block_header_repr.shell_header -> Block_header_repr.contents -> cache_nonce diff --git a/src/proto_016_PtMumbai/lib_protocol/carbonated_map.ml b/src/proto_016_PtMumbai/lib_protocol/carbonated_map.ml new file mode 100644 index 000000000000..95f246ce27dc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/carbonated_map.ml @@ -0,0 +1,234 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type S = sig + type 'a t + + type key + + type context + + val empty : 'a t + + val singleton : key -> 'a -> 'a t + + val size : 'a t -> int + + val find : context -> key -> 'a t -> ('a option * context) tzresult + + val update : + context -> + key -> + (context -> 'a option -> ('a option * context) tzresult) -> + 'a t -> + ('a t * context) tzresult + + val to_list : context -> 'a t -> ((key * 'a) list * context) tzresult + + val of_list : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context) tzresult) -> + (key * 'a) list -> + ('a t * context) tzresult + + val merge : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context) tzresult) -> + 'a t -> + 'a t -> + ('a t * context) tzresult + + val map_e : + context -> + (context -> key -> 'a -> ('b * context) tzresult) -> + 'a t -> + ('b t * context) tzresult + + val fold_e : + context -> + (context -> 'state -> key -> 'value -> ('state * context) tzresult) -> + 'state -> + 'value t -> + ('state * context) tzresult + + val fold_es : + context -> + (context -> 'state -> key -> 'value -> ('state * context) tzresult Lwt.t) -> + 'state -> + 'value t -> + ('state * context) tzresult Lwt.t +end + +module type GAS = sig + type context + + val consume : + context -> + Saturation_repr.may_saturate Saturation_repr.t -> + context tzresult +end + +module type COMPARABLE = sig + include Compare.COMPARABLE + + (** [compare_cost k] returns the cost of comparing the given key [k] with + another value of the same type. *) + val compare_cost : t -> Saturation_repr.may_saturate Saturation_repr.t +end + +module Make_builder (C : COMPARABLE) = struct + module M = Map.Make (C) + + type 'a t = {map : 'a M.t; size : int} + + module Make (G : GAS) : + S with type key = C.t and type context = G.context and type 'a t := 'a t = + struct + type key = C.t + + type context = G.context + + let empty = {map = M.empty; size = 0} + + let singleton key value = {map = M.singleton key value; size = 1} + + let size {size; _} = size + + let find_cost ~key ~size = + Carbonated_map_costs.find_cost + ~compare_key_cost:(C.compare_cost key) + ~size + + let update_cost ~key ~size = + Carbonated_map_costs.update_cost + ~compare_key_cost:(C.compare_cost key) + ~size + + let find ctxt key {map; size} = + G.consume ctxt (find_cost ~key ~size) >|? fun ctxt -> + (M.find key map, ctxt) + + let update ctxt key f {map; size} = + let find_cost = find_cost ~key ~size in + let update_cost = update_cost ~key ~size in + (* Consume gas for looking up the old value *) + G.consume ctxt find_cost >>? fun ctxt -> + let old_val_opt = M.find key map in + (* The call to [f] must also account for gas *) + f ctxt old_val_opt >>? fun (new_val_opt, ctxt) -> + match (old_val_opt, new_val_opt) with + | Some _, Some new_val -> + (* Consume gas for adding to the map *) + G.consume ctxt update_cost >|? fun ctxt -> + ({map = M.add key new_val map; size}, ctxt) + | Some _, None -> + (* Consume gas for removing from the map *) + G.consume ctxt update_cost >|? fun ctxt -> + ({map = M.remove key map; size = size - 1}, ctxt) + | None, Some new_val -> + (* Consume gas for adding to the map *) + G.consume ctxt update_cost >|? fun ctxt -> + ({map = M.add key new_val map; size = size + 1}, ctxt) + | None, None -> ok ({map; size}, ctxt) + + let to_list ctxt {map; size} = + G.consume ctxt (Carbonated_map_costs.fold_cost ~size) >|? fun ctxt -> + (M.bindings map, ctxt) + + let add ctxt ~merge_overlap key value {map; size} = + (* Consume gas for looking up the element *) + G.consume ctxt (find_cost ~key ~size) >>? fun ctxt -> + (* Consume gas for adding the element *) + G.consume ctxt (update_cost ~key ~size) >>? fun ctxt -> + match M.find key map with + | Some old_val -> + (* Invoking [merge_overlap] must also account for gas *) + merge_overlap ctxt old_val value >|? fun (new_value, ctxt) -> + ({map = M.add key new_value map; size}, ctxt) + | None -> Ok ({map = M.add key value map; size = size + 1}, ctxt) + + let add_key_values_to_map ctxt ~merge_overlap map key_values = + let accum (map, ctxt) (key, value) = + add ctxt ~merge_overlap key value map + in + (* Gas is paid at each step of the fold. *) + List.fold_left_e accum (map, ctxt) key_values + + let of_list ctxt ~merge_overlap = + add_key_values_to_map ctxt ~merge_overlap empty + + let merge ctxt ~merge_overlap map1 {map; size} = + (* To be on the safe side, pay an upfront gas cost for traversing the + map. Each step of the fold is accounted for separately. + *) + G.consume ctxt (Carbonated_map_costs.fold_cost ~size) >>? fun ctxt -> + M.fold_e + (fun key value (map, ctxt) -> add ctxt ~merge_overlap key value map) + map + (map1, ctxt) + + let fold_e ctxt f empty {map; size} = + G.consume ctxt (Carbonated_map_costs.fold_cost ~size) >>? fun ctxt -> + M.fold_e + (fun key value (acc, ctxt) -> + (* Invoking [f] must also account for gas. *) + f ctxt acc key value) + map + (empty, ctxt) + + let fold_es ctxt f empty {map; size} = + G.consume ctxt (Carbonated_map_costs.fold_cost ~size) >>?= fun ctxt -> + M.fold_es + (fun key value (acc, ctxt) -> + (* Invoking [f] must also account for gas. *) + f ctxt acc key value) + map + (empty, ctxt) + + let map_e ctxt f {map; size} = + (* We cannot use the standard map function because [f] also meters the gas + cost at each invocation. *) + fold_e + ctxt + (fun ctxt map key value -> + (* Invoking [f] must also account for gas. *) + f ctxt key value >>? fun (value, ctxt) -> + (* Consume gas for adding the element. *) + G.consume ctxt (update_cost ~key ~size) >|? fun ctxt -> + (M.add key value map, ctxt)) + M.empty + {map; size} + >|? fun (map, ctxt) -> ({map; size}, ctxt) + end +end + +module Make (G : GAS) (C : COMPARABLE) : + S with type key = C.t and type context = G.context = struct + module M = Make_builder (C) + + type 'a t = 'a M.t + + include M.Make (G) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/carbonated_map.mli b/src/proto_016_PtMumbai/lib_protocol/carbonated_map.mli new file mode 100644 index 000000000000..745a74514b7b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/carbonated_map.mli @@ -0,0 +1,167 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** An in-memory data-structure for a key-value map where all operations + account for gas costs. + *) + +module type S = sig + type 'a t + + (** The type of keys in the map. *) + type key + + (** The type used for the context. *) + type context + + (** [empty] an empty map. *) + val empty : 'a t + + (** [singleton k v] returns a map with a single key [k] and value [v] pair. *) + val singleton : key -> 'a -> 'a t + + (** [size m] returns the number of elements of the map [m] in constant time. *) + val size : 'a t -> int + + (** [find ctxt k m] looks up the value with key [k] in the given map [m] and + also consumes the gas associated with the lookup. The complexity is + logarithmic in the size of the map. *) + val find : context -> key -> 'a t -> ('a option * context) tzresult + + (** [update ctxt k f map] updates or adds the value of the key [k] using [f]. + The function accounts for the gas cost for finding the element. The updating + function [f] should also account for its own gas cost. The complexity is + logarithmic in the size of the map. *) + val update : + context -> + key -> + (context -> 'a option -> ('a option * context) tzresult) -> + 'a t -> + ('a t * context) tzresult + + (** [to_list m] transforms a map [m] into a list. It also accounts for the + gas cost for traversing the elements. The complexity is linear in the size + of the map. *) + val to_list : context -> 'a t -> ((key * 'a) list * context) tzresult + + (** [of_list ctxt ~merge_overlaps m] creates a map from a list of key-value + pairs. In case there are overlapping keys, their values are combined + using the [merge_overlap] function. The function accounts for gas for + traversing the elements. [merge_overlap] should account for its own gas + cost. The complexity is [n * log n] in the size of the list. + *) + val of_list : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context) tzresult) -> + (key * 'a) list -> + ('a t * context) tzresult + + (** [merge ctxt ~merge_overlap m1 m2] merges the maps [m1] and [m2]. In case + there are overlapping keys, their values are combined using the + [merge_overlap] function. Gas costs for traversing all elements from both + maps are accounted for. [merge_overlap] should account for its own gas + cost. The complexity is [n * log n], where [n] + is [size m1 + size m2]. *) + val merge : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context) tzresult) -> + 'a t -> + 'a t -> + ('a t * context) tzresult + + (** [map_e ctxt f m] maps over all key-value pairs in the map [m] using the + function [f]. It accounts for gas costs associated with traversing the + elements. The mapping function [f] should also account for its own gas + cost. The complexity is linear in the size of the map [m]. *) + val map_e : + context -> + (context -> key -> 'a -> ('b * context) tzresult) -> + 'a t -> + ('b t * context) tzresult + + (** [fold_e ctxt f z m] folds over the key-value pairs of the given map [m], + accumulating values using [f], with [z] as the initial state. The function + [f] must account for its own gas cost. The complexity is linear in the + size of the map [m]. *) + val fold_e : + context -> + (context -> 'state -> key -> 'value -> ('state * context) tzresult) -> + 'state -> + 'value t -> + ('state * context) tzresult + + (** Lwt-aware variant of {!fold_e}. *) + val fold_es : + context -> + (context -> 'state -> key -> 'value -> ('state * context) tzresult Lwt.t) -> + 'state -> + 'value t -> + ('state * context) tzresult Lwt.t +end + +(** This module is used to provide the function for consuming gas when + constructing carbonated maps. *) +module type GAS = sig + (* The context type. *) + type context + + (** [consume ctxt cost] returns a context where [cost] has been consumed. *) + val consume : + context -> + Saturation_repr.may_saturate Saturation_repr.t -> + context tzresult +end + +(** Standard [Compare.COMPARE] extended with a [compare_cost] function + specifying the cost for comparing values. *) +module type COMPARABLE = sig + include Compare.COMPARABLE + + (** [compare_cost k] returns the cost of comparing the given key [k] with + another value of the same type. *) + val compare_cost : t -> Saturation_repr.may_saturate Saturation_repr.t +end + +(** A functor for exposing the type of a carbonated map before + the carbonated make is created. This is useful in scenarios where + the map that will need to be carbonated is defined before the + gas consuming functions for the carbonation are available. + See for example [Raw_context]. +*) +module Make_builder (C : COMPARABLE) : sig + type 'a t + + module Make (G : GAS) : + S with type key = C.t and type context = G.context and type 'a t := 'a t +end + +(** A functor for building gas metered maps. When building a gas metered map via + [Make(G)(C)], [C] is a [COMPARABLE] required to construct a the map while + [G] is a module providing the gas consuming functions. The type of the + context on which the gas consuming function operates is + determined by [G.context]. +*) +module Make (G : GAS) (C : COMPARABLE) : + S with type key = C.t and type context = G.context diff --git a/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.ml b/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.ml new file mode 100644 index 000000000000..b484552e6916 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.ml @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr +open Gas_limit_repr + +type cost = Saturation_repr.may_saturate Saturation_repr.t + +(** This is a good enough approximation *) +let log2 x = S.safe_int (1 + S.numbits x) + +(** Collect benchmark from [Carbonated_map_benchmarks.Find_benchmark]. + + The model is similar to the gas model as from [Michelson_v1_gas.map_get]. + The user is responsible for providing the [compare_key_cost] which depends + on the size of the [key]. See [Carbonated_map_benchmarks.Find_benchmark] for + an example. + The rational for the model is: + - [intercept] is for paying a fixed cost regardless of size. + - [compare_key_cost] is for the log2 of steps comparing keys + - [traversal_overhead] is for the overhead of log2 steps walking the tree + *) +let find_cost ~compare_key_cost ~size = + let intercept = S.safe_int 50 in + let size = S.safe_int size in + let compare_cost = log2 size *@ compare_key_cost in + let traversal_overhead = log2 size *@ S.safe_int 2 in + intercept +@ compare_cost +@ traversal_overhead + +(** + Modelling the precise overhead of update compared with [find] is tricky. + The cost of [find] depends on the cost of comparing keys. When the tree + is recreated, after looking up the element, this cost is no longer a factor. + On the other hand, if the old map is no longer used, some nodes are going to + be garbage collected at a later stage which incurs an extra cost. + + We here use the same model as in [Michelson_v1_gas.map_update]. That is + providing an overestimate by doubling the cost of [find]. + *) +let update_cost ~compare_key_cost ~size = + S.safe_int 2 *@ find_cost ~compare_key_cost ~size + +(** Collect benchmark from [Carbonated_map_benchmarks.Fold_benchmark]. + + The cost of producing a list of elements is linear in the size of the map + and does not depend on the size of the elements nor keys. +*) +let fold_cost ~size = S.safe_int 50 +@ (S.safe_int 24 *@ S.safe_int size) diff --git a/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.mli b/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.mli new file mode 100644 index 000000000000..c40a26465e8d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/carbonated_map_costs.mli @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The type of the cost.*) +type cost = Saturation_repr.may_saturate Saturation_repr.t + +(** The [Carbonated_map_costs] module contains gas cost functions for + [Carbonated_map]. + *) + +(** [find_cost ~compare_key_cost ~size] returns the gas cost for looking up an + element from a map of size [size]. The user of this function is responsible + for providing a correct value of [compare_key_cost], representing the cost + of comparing elements with a given key. + *) +val find_cost : compare_key_cost:cost -> size:int -> cost + +(** [update_cost ~compare_key_cost ~size] returns the gas cost for updating an + element in a map of size [size]. The user of this function is responsible + for providing a correct value of [compare_key_cost], representing the cost + of comparing elements with a given key. *) +val update_cost : compare_key_cost:cost -> size:int -> cost + +(** [fold_cost ~size] returns the cost of folding over a list of size [size]. *) +val fold_cost : size:int -> cost diff --git a/src/proto_016_PtMumbai/lib_protocol/commitment_repr.ml b/src/proto_016_PtMumbai/lib_protocol/commitment_repr.ml new file mode 100644 index 000000000000..38f114120c35 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/commitment_repr.ml @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + blinded_public_key_hash : Blinded_public_key_hash.t; + amount : Tez_repr.t; +} + +let encoding = + let open Data_encoding in + conv + (fun {blinded_public_key_hash; amount} -> (blinded_public_key_hash, amount)) + (fun (blinded_public_key_hash, amount) -> {blinded_public_key_hash; amount}) + (tup2 Blinded_public_key_hash.encoding Tez_repr.encoding) diff --git a/src/proto_016_PtMumbai/lib_protocol/commitment_repr.mli b/src/proto_016_PtMumbai/lib_protocol/commitment_repr.mli new file mode 100644 index 000000000000..e9a5d5db3103 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/commitment_repr.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This type represents a commitment to an amount of tokens which can be claimed + by a fund raiser after the blockchain is deployed. *) +type t = { + blinded_public_key_hash : Blinded_public_key_hash.t; + amount : Tez_repr.t; +} + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/commitment_storage.ml b/src/proto_016_PtMumbai/lib_protocol/commitment_storage.ml new file mode 100644 index 000000000000..272702a4ae67 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/commitment_storage.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let exists = Storage.Commitments.mem + +let committed_amount ctxt bpkh = + Storage.Commitments.find ctxt bpkh >>=? fun balance -> + return (Option.value ~default:Tez_repr.zero balance) + +let increase_commitment_only_call_from_token ctxt bpkh amount = + if Tez_repr.(amount = zero) then return ctxt + else + committed_amount ctxt bpkh >>=? fun balance -> + Tez_repr.(amount +? balance) >>?= fun new_balance -> + Storage.Commitments.add ctxt bpkh new_balance >|= ok + +let decrease_commitment_only_call_from_token ctxt bpkh amount = + committed_amount ctxt bpkh >>=? fun balance -> + Tez_repr.(balance -? amount) >>?= fun new_balance -> + if Tez_repr.(new_balance = Tez_repr.zero) then + Storage.Commitments.remove ctxt bpkh >|= ok + else Storage.Commitments.add ctxt bpkh new_balance >|= ok diff --git a/src/proto_016_PtMumbai/lib_protocol/commitment_storage.mli b/src/proto_016_PtMumbai/lib_protocol/commitment_storage.mli new file mode 100644 index 000000000000..6c74e56a076a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/commitment_storage.mli @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [exists ctxt bpkh] returns true iff [bpkh] is associated to a non null + commitment. *) +val exists : Raw_context.t -> Blinded_public_key_hash.t -> bool Lwt.t + +(** [committed_amount ctxt bpkh] return the commitment associated to [bpkh], or + [Tez_repr.zero] if [bpkh] has no associated commitment. *) +val committed_amount : + Raw_context.t -> Blinded_public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +val increase_commitment_only_call_from_token : + Raw_context.t -> + Blinded_public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +val decrease_commitment_only_call_from_token : + Raw_context.t -> + Blinded_public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.ml b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.ml new file mode 100644 index 000000000000..7f009a5d9a47 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.ml @@ -0,0 +1,516 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type dal = { + feature_enable : bool; + number_of_slots : int; + number_of_shards : int; + endorsement_lag : int; + availability_threshold : int; + slot_size : int; + redundancy_factor : int; + page_size : int; +} + +let dal_encoding = + let open Data_encoding in + conv + (fun { + feature_enable; + number_of_slots; + number_of_shards; + endorsement_lag; + availability_threshold; + slot_size; + redundancy_factor; + page_size; + } -> + ( feature_enable, + number_of_slots, + number_of_shards, + endorsement_lag, + availability_threshold, + slot_size, + redundancy_factor, + page_size )) + (fun ( feature_enable, + number_of_slots, + number_of_shards, + endorsement_lag, + availability_threshold, + slot_size, + redundancy_factor, + page_size ) -> + { + feature_enable; + number_of_slots; + number_of_shards; + endorsement_lag; + availability_threshold; + slot_size; + redundancy_factor; + page_size; + }) + (obj8 + (req "feature_enable" Data_encoding.bool) + (req "number_of_slots" Data_encoding.int16) + (req "number_of_shards" Data_encoding.int16) + (req "endorsement_lag" Data_encoding.int16) + (req "availability_threshold" Data_encoding.int16) + (req "slot_size" Data_encoding.int31) + (req "redundancy_factor" Data_encoding.uint8) + (req "page_size" Data_encoding.uint16)) + +(* The encoded representation of this type is stored in the context as + bytes. Changing the encoding, or the value of these constants from + the previous protocol may break the context migration, or (even + worse) yield an incorrect context after migration. + + If you change this encoding compared to `Constants_parametric_previous_repr.t`, + you should ensure that there is a proper migration of the constants + during context migration. See: `Raw_context.prepare_first_block` *) + +type tx_rollup = { + enable : bool; + origination_size : int; + hard_size_limit_per_inbox : int; + hard_size_limit_per_message : int; + commitment_bond : Tez_repr.t; + finality_period : int; + withdraw_period : int; + max_inboxes_count : int; + max_messages_per_inbox : int; + max_commitments_count : int; + cost_per_byte_ema_factor : int; + max_ticket_payload_size : int; + max_withdrawals_per_batch : int; + rejection_max_proof_size : int; + sunset_level : int32; +} + +type sc_rollup = { + enable : bool; + origination_size : int; + challenge_window_in_blocks : int; + max_number_of_messages_per_commitment_period : int; + stake_amount : Tez_repr.t; + commitment_period_in_blocks : int; + max_lookahead_in_blocks : int32; + max_active_outbox_levels : int32; + max_outbox_messages_per_level : int; + number_of_sections_in_dissection : int; + timeout_period_in_blocks : int; + max_number_of_stored_cemented_commitments : int; +} + +type zk_rollup = { + enable : bool; + origination_size : int; + min_pending_to_process : int; +} + +type t = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + nonce_revelation_threshold : int32; + blocks_per_stake_snapshot : int32; + cycles_per_voting_period : int32; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + minimal_stake : Tez_repr.t; + vdf_difficulty : int64; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_toggle_ema_threshold : int32; + max_operations_time_to_live : int; + minimal_block_delay : Period_repr.t; + delay_increment_per_round : Period_repr.t; + minimal_participation_ratio : Ratio_repr.t; + consensus_committee_size : int; + consensus_threshold : int; + max_slashing_period : int; + frozen_deposits_percentage : int; + double_baking_punishment : Tez_repr.t; + ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + testnet_dictator : Signature.Public_key_hash.t option; + initial_seed : State_hash.t option; + (* If a new cache is added, please also modify the + [cache_layout_size] value. *) + cache_script_size : int; + cache_stake_distribution_cycles : int; + cache_sampler_state_cycles : int; + tx_rollup : tx_rollup; + dal : dal; + sc_rollup : sc_rollup; + zk_rollup : zk_rollup; +} + +let tx_rollup_encoding = + let open Data_encoding in + conv + (fun (c : tx_rollup) -> + ( ( c.enable, + c.origination_size, + c.hard_size_limit_per_inbox, + c.hard_size_limit_per_message, + c.max_withdrawals_per_batch, + c.commitment_bond, + c.finality_period, + c.withdraw_period, + c.max_inboxes_count, + c.max_messages_per_inbox ), + ( c.max_commitments_count, + c.cost_per_byte_ema_factor, + c.max_ticket_payload_size, + c.rejection_max_proof_size, + c.sunset_level ) )) + (fun ( ( tx_rollup_enable, + tx_rollup_origination_size, + tx_rollup_hard_size_limit_per_inbox, + tx_rollup_hard_size_limit_per_message, + tx_rollup_max_withdrawals_per_batch, + tx_rollup_commitment_bond, + tx_rollup_finality_period, + tx_rollup_withdraw_period, + tx_rollup_max_inboxes_count, + tx_rollup_max_messages_per_inbox ), + ( tx_rollup_max_commitments_count, + tx_rollup_cost_per_byte_ema_factor, + tx_rollup_max_ticket_payload_size, + tx_rollup_rejection_max_proof_size, + tx_rollup_sunset_level ) ) -> + { + enable = tx_rollup_enable; + origination_size = tx_rollup_origination_size; + hard_size_limit_per_inbox = tx_rollup_hard_size_limit_per_inbox; + hard_size_limit_per_message = tx_rollup_hard_size_limit_per_message; + max_withdrawals_per_batch = tx_rollup_max_withdrawals_per_batch; + commitment_bond = tx_rollup_commitment_bond; + finality_period = tx_rollup_finality_period; + withdraw_period = tx_rollup_withdraw_period; + max_inboxes_count = tx_rollup_max_inboxes_count; + max_messages_per_inbox = tx_rollup_max_messages_per_inbox; + max_commitments_count = tx_rollup_max_commitments_count; + cost_per_byte_ema_factor = tx_rollup_cost_per_byte_ema_factor; + max_ticket_payload_size = tx_rollup_max_ticket_payload_size; + rejection_max_proof_size = tx_rollup_rejection_max_proof_size; + sunset_level = tx_rollup_sunset_level; + }) + (merge_objs + (obj10 + (req "tx_rollup_enable" bool) + (req "tx_rollup_origination_size" int31) + (req "tx_rollup_hard_size_limit_per_inbox" int31) + (req "tx_rollup_hard_size_limit_per_message" int31) + (req "tx_rollup_max_withdrawals_per_batch" int31) + (req "tx_rollup_commitment_bond" Tez_repr.encoding) + (req "tx_rollup_finality_period" int31) + (req "tx_rollup_withdraw_period" int31) + (req "tx_rollup_max_inboxes_count" int31) + (req "tx_rollup_max_messages_per_inbox" int31)) + (obj5 + (req "tx_rollup_max_commitments_count" int31) + (req "tx_rollup_cost_per_byte_ema_factor" int31) + (req "tx_rollup_max_ticket_payload_size" int31) + (req "tx_rollup_rejection_max_proof_size" int31) + (req "tx_rollup_sunset_level" int32))) + +let sc_rollup_encoding = + let open Data_encoding in + conv + (fun (c : sc_rollup) -> + ( ( c.enable, + c.origination_size, + c.challenge_window_in_blocks, + c.max_number_of_messages_per_commitment_period, + c.stake_amount, + c.commitment_period_in_blocks, + c.max_lookahead_in_blocks, + c.max_active_outbox_levels, + c.max_outbox_messages_per_level, + c.number_of_sections_in_dissection ), + (c.timeout_period_in_blocks, c.max_number_of_stored_cemented_commitments) + )) + (fun ( ( sc_rollup_enable, + sc_rollup_origination_size, + sc_rollup_challenge_window_in_blocks, + sc_rollup_max_number_of_messages_per_commitment_period, + sc_rollup_stake_amount, + sc_rollup_commitment_period_in_blocks, + sc_rollup_max_lookahead_in_blocks, + sc_rollup_max_active_outbox_levels, + sc_rollup_max_outbox_messages_per_level, + sc_rollup_number_of_sections_in_dissection ), + ( sc_rollup_timeout_period_in_blocks, + sc_rollup_max_number_of_cemented_commitments ) ) -> + { + enable = sc_rollup_enable; + origination_size = sc_rollup_origination_size; + challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + max_number_of_messages_per_commitment_period = + sc_rollup_max_number_of_messages_per_commitment_period; + stake_amount = sc_rollup_stake_amount; + commitment_period_in_blocks = sc_rollup_commitment_period_in_blocks; + max_lookahead_in_blocks = sc_rollup_max_lookahead_in_blocks; + max_active_outbox_levels = sc_rollup_max_active_outbox_levels; + max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; + number_of_sections_in_dissection = + sc_rollup_number_of_sections_in_dissection; + timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; + max_number_of_stored_cemented_commitments = + sc_rollup_max_number_of_cemented_commitments; + }) + (merge_objs + (obj10 + (req "sc_rollup_enable" bool) + (req "sc_rollup_origination_size" int31) + (req "sc_rollup_challenge_window_in_blocks" int31) + (req "sc_rollup_max_number_of_messages_per_commitment_period" int31) + (req "sc_rollup_stake_amount" Tez_repr.encoding) + (req "sc_rollup_commitment_period_in_blocks" int31) + (req "sc_rollup_max_lookahead_in_blocks" int32) + (req "sc_rollup_max_active_outbox_levels" int32) + (req "sc_rollup_max_outbox_messages_per_level" int31) + (req "sc_rollup_number_of_sections_in_dissection" uint8)) + (obj2 + (req "sc_rollup_timeout_period_in_blocks" int31) + (req "sc_rollup_max_number_of_cemented_commitments" int31))) + +let zk_rollup_encoding = + let open Data_encoding in + conv + (fun ({enable; origination_size; min_pending_to_process} : zk_rollup) -> + (enable, origination_size, min_pending_to_process)) + (fun ( zk_rollup_enable, + zk_rollup_origination_size, + zk_rollup_min_pending_to_process ) -> + { + enable = zk_rollup_enable; + origination_size = zk_rollup_origination_size; + min_pending_to_process = zk_rollup_min_pending_to_process; + }) + (obj3 + (req "zk_rollup_enable" bool) + (req "zk_rollup_origination_size" int31) + (req "zk_rollup_min_pending_to_process" int31)) + +let encoding = + let open Data_encoding in + conv + (fun c -> + ( ( c.preserved_cycles, + c.blocks_per_cycle, + c.blocks_per_commitment, + c.nonce_revelation_threshold, + c.blocks_per_stake_snapshot, + c.cycles_per_voting_period, + c.hard_gas_limit_per_operation, + c.hard_gas_limit_per_block, + c.proof_of_work_threshold, + c.minimal_stake ), + ( ( c.vdf_difficulty, + c.seed_nonce_revelation_tip, + c.origination_size, + c.baking_reward_fixed_portion, + c.baking_reward_bonus_per_slot, + c.endorsing_reward_per_slot, + c.cost_per_byte, + c.hard_storage_limit_per_operation, + c.quorum_min ), + ( ( c.quorum_max, + c.min_proposal_quorum, + c.liquidity_baking_subsidy, + c.liquidity_baking_toggle_ema_threshold, + c.max_operations_time_to_live, + c.minimal_block_delay, + c.delay_increment_per_round, + c.consensus_committee_size, + c.consensus_threshold ), + ( ( c.minimal_participation_ratio, + c.max_slashing_period, + c.frozen_deposits_percentage, + c.double_baking_punishment, + c.ratio_of_frozen_deposits_slashed_per_double_endorsement, + c.testnet_dictator, + c.initial_seed ), + ( ( c.cache_script_size, + c.cache_stake_distribution_cycles, + c.cache_sampler_state_cycles ), + (c.tx_rollup, (c.dal, (c.sc_rollup, c.zk_rollup))) ) ) ) ) )) + (fun ( ( preserved_cycles, + blocks_per_cycle, + blocks_per_commitment, + nonce_revelation_threshold, + blocks_per_stake_snapshot, + cycles_per_voting_period, + hard_gas_limit_per_operation, + hard_gas_limit_per_block, + proof_of_work_threshold, + minimal_stake ), + ( ( vdf_difficulty, + seed_nonce_revelation_tip, + origination_size, + baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot, + cost_per_byte, + hard_storage_limit_per_operation, + quorum_min ), + ( ( quorum_max, + min_proposal_quorum, + liquidity_baking_subsidy, + liquidity_baking_toggle_ema_threshold, + max_operations_time_to_live, + minimal_block_delay, + delay_increment_per_round, + consensus_committee_size, + consensus_threshold ), + ( ( minimal_participation_ratio, + max_slashing_period, + frozen_deposits_percentage, + double_baking_punishment, + ratio_of_frozen_deposits_slashed_per_double_endorsement, + testnet_dictator, + initial_seed ), + ( ( cache_script_size, + cache_stake_distribution_cycles, + cache_sampler_state_cycles ), + (tx_rollup, (dal, (sc_rollup, zk_rollup))) ) ) ) ) ) -> + { + preserved_cycles; + blocks_per_cycle; + blocks_per_commitment; + nonce_revelation_threshold; + blocks_per_stake_snapshot; + cycles_per_voting_period; + hard_gas_limit_per_operation; + hard_gas_limit_per_block; + proof_of_work_threshold; + minimal_stake; + vdf_difficulty; + seed_nonce_revelation_tip; + origination_size; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + cost_per_byte; + hard_storage_limit_per_operation; + quorum_min; + quorum_max; + min_proposal_quorum; + liquidity_baking_subsidy; + liquidity_baking_toggle_ema_threshold; + max_operations_time_to_live; + minimal_block_delay; + delay_increment_per_round; + minimal_participation_ratio; + max_slashing_period; + consensus_committee_size; + consensus_threshold; + frozen_deposits_percentage; + double_baking_punishment; + ratio_of_frozen_deposits_slashed_per_double_endorsement; + testnet_dictator; + initial_seed; + cache_script_size; + cache_stake_distribution_cycles; + cache_sampler_state_cycles; + tx_rollup; + dal; + sc_rollup; + zk_rollup; + }) + (merge_objs + (obj10 + (req "preserved_cycles" uint8) + (req "blocks_per_cycle" int32) + (req "blocks_per_commitment" int32) + (req "nonce_revelation_threshold" int32) + (req "blocks_per_stake_snapshot" int32) + (req "cycles_per_voting_period" int32) + (req + "hard_gas_limit_per_operation" + Gas_limit_repr.Arith.z_integral_encoding) + (req + "hard_gas_limit_per_block" + Gas_limit_repr.Arith.z_integral_encoding) + (req "proof_of_work_threshold" int64) + (req "minimal_stake" Tez_repr.encoding)) + (merge_objs + (obj9 + (req "vdf_difficulty" int64) + (req "seed_nonce_revelation_tip" Tez_repr.encoding) + (req "origination_size" int31) + (req "baking_reward_fixed_portion" Tez_repr.encoding) + (req "baking_reward_bonus_per_slot" Tez_repr.encoding) + (req "endorsing_reward_per_slot" Tez_repr.encoding) + (req "cost_per_byte" Tez_repr.encoding) + (req "hard_storage_limit_per_operation" z) + (req "quorum_min" int32)) + (merge_objs + (obj9 + (req "quorum_max" int32) + (req "min_proposal_quorum" int32) + (req "liquidity_baking_subsidy" Tez_repr.encoding) + (req "liquidity_baking_toggle_ema_threshold" int32) + (req "max_operations_time_to_live" int16) + (req "minimal_block_delay" Period_repr.encoding) + (req "delay_increment_per_round" Period_repr.encoding) + (req "consensus_committee_size" int31) + (req "consensus_threshold" int31)) + (merge_objs + (obj7 + (req "minimal_participation_ratio" Ratio_repr.encoding) + (req "max_slashing_period" int31) + (req "frozen_deposits_percentage" int31) + (req "double_baking_punishment" Tez_repr.encoding) + (req + "ratio_of_frozen_deposits_slashed_per_double_endorsement" + Ratio_repr.encoding) + (opt "testnet_dictator" Signature.Public_key_hash.encoding) + (opt "initial_seed" State_hash.encoding)) + (merge_objs + (obj3 + (req "cache_script_size" int31) + (req "cache_stake_distribution_cycles" int8) + (req "cache_sampler_state_cycles" int8)) + (merge_objs + tx_rollup_encoding + (merge_objs + (obj1 (req "dal_parametric" dal_encoding)) + (merge_objs sc_rollup_encoding zk_rollup_encoding)))))))) diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.mli b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.mli new file mode 100644 index 000000000000..db5c1c5ab07a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_previous_repr.mli @@ -0,0 +1,194 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type dal = { + feature_enable : bool; + number_of_slots : int; + number_of_shards : int; + endorsement_lag : int; + availability_threshold : int; + slot_size : int; + redundancy_factor : int; + page_size : int; +} + +val dal_encoding : dal Data_encoding.t + +type tx_rollup = { + enable : bool; + origination_size : int; + (* the maximum amount of bytes messages can allocate in an inbox *) + hard_size_limit_per_inbox : int; + (* the maximum amount of bytes one batch can allocate in an inbox *) + hard_size_limit_per_message : int; + (* the amount of tez to bond a tx rollup commitment *) + commitment_bond : Tez_repr.t; + (* the number of blocks before a tx rollup block is final *) + finality_period : int; + (* the maximum number of levels that can be left unfinalized + before we stop accepting new inboxes for a tx rollup *) + (* the minimum number of blocks to wait before removing a finalised + commitment from the context. *) + withdraw_period : int; + max_inboxes_count : int; + (* the maximum number of messages in an inbox. This bounds the + size of a commitment. *) + max_messages_per_inbox : int; + (* the maximum number of finalized commitments, to ensure that + remove_commitment is ever called *) + max_commitments_count : int; + (* The number of blocks used to compute the ema factor determining + the cost per byte for new messages in the inbox. *) + cost_per_byte_ema_factor : int; + (* Tickets are transmitted in batches in the + [Tx_rollup_dispatch_tickets] operation. + + The semantics is that this operation is used to + concretize the withdraw orders emitted by the layer-2, + one layer-1 operation per messages of an + inbox. Therefore, it is of significant importance that + a valid batch does not produce a list of withdraw + orders which could not fit in a layer-1 operation. + + With these values, at least 2048 bytes remain available + to store the rest of the operands of + [Tx_rollup_dispatch_tickets] (in practice, even more, + because we overapproximate the size of tickets). So we + are safe. *) + max_ticket_payload_size : int; + max_withdrawals_per_batch : int; + (* The maximum size, in bytes, of a Merkle proof. Operations which would + require proofs larger than this should be no-ops. *) + rejection_max_proof_size : int; + sunset_level : int32; +} + +type sc_rollup = { + enable : bool; + origination_size : int; + challenge_window_in_blocks : int; + max_number_of_messages_per_commitment_period : int; + stake_amount : Tez_repr.t; + (* The period with which commitments are made. *) + commitment_period_in_blocks : int; + (* The maximum depth of a staker's position - chosen alongside + [commitment_period_in_blocks] to prevent the cost + of a staker's commitments' storage being greater than their deposit. *) + max_lookahead_in_blocks : int32; + (* Maximum number of active outbox levels allowed. An outbox level is active + if it has an associated record of applied messages. *) + max_active_outbox_levels : int32; + max_outbox_messages_per_level : int; + (* The default number of required sections in a dissection *) + number_of_sections_in_dissection : int; + (* The timeout period for a player in a refutation game. + + Timeout logic is similar to a chess clock. Each player starts with the same + timeout = [timeout_period_in_blocks]. Each game move updates the timeout of + the current player by decreasing it by the amount of time she took to play, + i.e. number of blocks since the opponent last move. See + {!Sc_rollup_game_repr.timeout} and + {!Sc_rollup_refutation_storage.game_move} to see the implementation. + + Because of that [timeout_period_in_blocks] must be at least half the upper + bound number of blocks needed for a game to finish. This bound is + correlated to the maximum distance allowed between the first and last tick + of a dissection. For example, when the maximum distance allowed is half the + total distance [(last_tick - last_tick) / 2] then bound is [Log^2 + (Int64.max_int) + 2 = 65]. See {!Sc_rollup_game_repr.check_dissection} for + more information on the dissection logic. *) + timeout_period_in_blocks : int; + (* The maximum number of cemented commitments stored for a sc rollup. *) + max_number_of_stored_cemented_commitments : int; +} + +type zk_rollup = { + enable : bool; + origination_size : int; + (* Minimum number of pending operations that can be processed by a ZKRU + update, if available. + If the length of the pending list is less than [min_pending_to_process], + then an update needs to process all pending operations to be valid. + That is, every update must process at least + [min(length pending_list, min_pending_to_process)] pending operations. *) + min_pending_to_process : int; +} + +type t = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + nonce_revelation_threshold : int32; + blocks_per_stake_snapshot : int32; + cycles_per_voting_period : int32; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + minimal_stake : Tez_repr.t; + vdf_difficulty : int64; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + (* in centile of a percentage *) + quorum_max : int32; + min_proposal_quorum : int32; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_toggle_ema_threshold : int32; + max_operations_time_to_live : int; + minimal_block_delay : Period_repr.t; + delay_increment_per_round : Period_repr.t; + minimal_participation_ratio : Ratio_repr.t; + consensus_committee_size : int; + (* in slots *) + consensus_threshold : int; + (* in slots *) + max_slashing_period : int; + (* in cycles *) + frozen_deposits_percentage : int; + (* that is, (100 * delegated tz / own tz) *) + double_baking_punishment : Tez_repr.t; + ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + testnet_dictator : Signature.Public_key_hash.t option; + initial_seed : State_hash.t option; + cache_script_size : int; + (* in bytes *) + cache_stake_distribution_cycles : int; + (* in cycles *) + cache_sampler_state_cycles : int; + (* in cycles *) + tx_rollup : tx_rollup; + dal : dal; + sc_rollup : sc_rollup; + zk_rollup : zk_rollup; +} + +val encoding : t Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.ml b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.ml new file mode 100644 index 000000000000..a95a8e78c031 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.ml @@ -0,0 +1,498 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type dal = { + feature_enable : bool; + number_of_slots : int; + attestation_lag : int; + availability_threshold : int; + cryptobox_parameters : Dal.parameters; +} + +let dal_encoding = + let open Data_encoding in + conv + (fun { + feature_enable; + number_of_slots; + attestation_lag; + availability_threshold; + cryptobox_parameters; + } -> + ( ( feature_enable, + number_of_slots, + attestation_lag, + availability_threshold ), + cryptobox_parameters )) + (fun ( ( feature_enable, + number_of_slots, + attestation_lag, + availability_threshold ), + cryptobox_parameters ) -> + { + feature_enable; + number_of_slots; + attestation_lag; + availability_threshold; + cryptobox_parameters; + }) + (merge_objs + (obj4 + (req "feature_enable" bool) + (req "number_of_slots" int16) + (req "attestation_lag" int16) + (req "availability_threshold" int16)) + Dal.parameters_encoding) + +(* The encoded representation of this type is stored in the context as + bytes. Changing the encoding, or the value of these constants from + the previous protocol may break the context migration, or (even + worse) yield an incorrect context after migration. + + If you change this encoding compared to `Constants_parametric_previous_repr.t`, + you should ensure that there is a proper migration of the constants + during context migration. See: `Raw_context.prepare_first_block` *) + +type tx_rollup = { + enable : bool; + origination_size : int; + hard_size_limit_per_inbox : int; + hard_size_limit_per_message : int; + commitment_bond : Tez_repr.t; + finality_period : int; + withdraw_period : int; + max_inboxes_count : int; + max_messages_per_inbox : int; + max_commitments_count : int; + cost_per_byte_ema_factor : int; + max_ticket_payload_size : int; + max_withdrawals_per_batch : int; + rejection_max_proof_size : int; + sunset_level : int32; +} + +type sc_rollup = { + enable : bool; + origination_size : int; + challenge_window_in_blocks : int; + stake_amount : Tez_repr.t; + commitment_period_in_blocks : int; + max_lookahead_in_blocks : int32; + max_active_outbox_levels : int32; + max_outbox_messages_per_level : int; + number_of_sections_in_dissection : int; + timeout_period_in_blocks : int; + max_number_of_stored_cemented_commitments : int; + max_number_of_parallel_games : int; +} + +type zk_rollup = { + enable : bool; + origination_size : int; + min_pending_to_process : int; +} + +type t = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + nonce_revelation_threshold : int32; + blocks_per_stake_snapshot : int32; + cycles_per_voting_period : int32; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + minimal_stake : Tez_repr.t; + vdf_difficulty : int64; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_toggle_ema_threshold : int32; + max_operations_time_to_live : int; + minimal_block_delay : Period_repr.t; + delay_increment_per_round : Period_repr.t; + minimal_participation_ratio : Ratio_repr.t; + consensus_committee_size : int; + consensus_threshold : int; + max_slashing_period : int; + frozen_deposits_percentage : int; + double_baking_punishment : Tez_repr.t; + ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + testnet_dictator : Signature.Public_key_hash.t option; + initial_seed : State_hash.t option; + (* If a new cache is added, please also modify the + [cache_layout_size] value. *) + cache_script_size : int; + cache_stake_distribution_cycles : int; + cache_sampler_state_cycles : int; + tx_rollup : tx_rollup; + dal : dal; + sc_rollup : sc_rollup; + zk_rollup : zk_rollup; +} + +let tx_rollup_encoding = + let open Data_encoding in + conv + (fun (c : tx_rollup) -> + ( ( c.enable, + c.origination_size, + c.hard_size_limit_per_inbox, + c.hard_size_limit_per_message, + c.max_withdrawals_per_batch, + c.commitment_bond, + c.finality_period, + c.withdraw_period, + c.max_inboxes_count, + c.max_messages_per_inbox ), + ( c.max_commitments_count, + c.cost_per_byte_ema_factor, + c.max_ticket_payload_size, + c.rejection_max_proof_size, + c.sunset_level ) )) + (fun ( ( tx_rollup_enable, + tx_rollup_origination_size, + tx_rollup_hard_size_limit_per_inbox, + tx_rollup_hard_size_limit_per_message, + tx_rollup_max_withdrawals_per_batch, + tx_rollup_commitment_bond, + tx_rollup_finality_period, + tx_rollup_withdraw_period, + tx_rollup_max_inboxes_count, + tx_rollup_max_messages_per_inbox ), + ( tx_rollup_max_commitments_count, + tx_rollup_cost_per_byte_ema_factor, + tx_rollup_max_ticket_payload_size, + tx_rollup_rejection_max_proof_size, + tx_rollup_sunset_level ) ) -> + { + enable = tx_rollup_enable; + origination_size = tx_rollup_origination_size; + hard_size_limit_per_inbox = tx_rollup_hard_size_limit_per_inbox; + hard_size_limit_per_message = tx_rollup_hard_size_limit_per_message; + max_withdrawals_per_batch = tx_rollup_max_withdrawals_per_batch; + commitment_bond = tx_rollup_commitment_bond; + finality_period = tx_rollup_finality_period; + withdraw_period = tx_rollup_withdraw_period; + max_inboxes_count = tx_rollup_max_inboxes_count; + max_messages_per_inbox = tx_rollup_max_messages_per_inbox; + max_commitments_count = tx_rollup_max_commitments_count; + cost_per_byte_ema_factor = tx_rollup_cost_per_byte_ema_factor; + max_ticket_payload_size = tx_rollup_max_ticket_payload_size; + rejection_max_proof_size = tx_rollup_rejection_max_proof_size; + sunset_level = tx_rollup_sunset_level; + }) + (merge_objs + (obj10 + (req "tx_rollup_enable" bool) + (req "tx_rollup_origination_size" int31) + (req "tx_rollup_hard_size_limit_per_inbox" int31) + (req "tx_rollup_hard_size_limit_per_message" int31) + (req "tx_rollup_max_withdrawals_per_batch" int31) + (req "tx_rollup_commitment_bond" Tez_repr.encoding) + (req "tx_rollup_finality_period" int31) + (req "tx_rollup_withdraw_period" int31) + (req "tx_rollup_max_inboxes_count" int31) + (req "tx_rollup_max_messages_per_inbox" int31)) + (obj5 + (req "tx_rollup_max_commitments_count" int31) + (req "tx_rollup_cost_per_byte_ema_factor" int31) + (req "tx_rollup_max_ticket_payload_size" int31) + (req "tx_rollup_rejection_max_proof_size" int31) + (req "tx_rollup_sunset_level" int32))) + +let sc_rollup_encoding = + let open Data_encoding in + conv + (fun (c : sc_rollup) -> + ( ( c.enable, + c.origination_size, + c.challenge_window_in_blocks, + c.stake_amount, + c.commitment_period_in_blocks, + c.max_lookahead_in_blocks, + c.max_active_outbox_levels, + c.max_outbox_messages_per_level, + c.number_of_sections_in_dissection ), + ( c.timeout_period_in_blocks, + c.max_number_of_stored_cemented_commitments, + c.max_number_of_parallel_games ) )) + (fun ( ( sc_rollup_enable, + sc_rollup_origination_size, + sc_rollup_challenge_window_in_blocks, + sc_rollup_stake_amount, + sc_rollup_commitment_period_in_blocks, + sc_rollup_max_lookahead_in_blocks, + sc_rollup_max_active_outbox_levels, + sc_rollup_max_outbox_messages_per_level, + sc_rollup_number_of_sections_in_dissection ), + ( sc_rollup_timeout_period_in_blocks, + sc_rollup_max_number_of_cemented_commitments, + sc_rollup_max_number_of_parallel_games ) ) -> + { + enable = sc_rollup_enable; + origination_size = sc_rollup_origination_size; + challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + stake_amount = sc_rollup_stake_amount; + commitment_period_in_blocks = sc_rollup_commitment_period_in_blocks; + max_lookahead_in_blocks = sc_rollup_max_lookahead_in_blocks; + max_active_outbox_levels = sc_rollup_max_active_outbox_levels; + max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; + number_of_sections_in_dissection = + sc_rollup_number_of_sections_in_dissection; + timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; + max_number_of_stored_cemented_commitments = + sc_rollup_max_number_of_cemented_commitments; + max_number_of_parallel_games = sc_rollup_max_number_of_parallel_games; + }) + (merge_objs + (obj9 + (req "sc_rollup_enable" bool) + (req "sc_rollup_origination_size" int31) + (req "sc_rollup_challenge_window_in_blocks" int31) + (req "sc_rollup_stake_amount" Tez_repr.encoding) + (req "sc_rollup_commitment_period_in_blocks" int31) + (req "sc_rollup_max_lookahead_in_blocks" int32) + (req "sc_rollup_max_active_outbox_levels" int32) + (req "sc_rollup_max_outbox_messages_per_level" int31) + (req "sc_rollup_number_of_sections_in_dissection" uint8)) + (obj3 + (req "sc_rollup_timeout_period_in_blocks" int31) + (req "sc_rollup_max_number_of_cemented_commitments" int31) + (req "sc_rollup_max_number_of_parallel_games" int31))) + +let zk_rollup_encoding = + let open Data_encoding in + conv + (fun ({enable; origination_size; min_pending_to_process} : zk_rollup) -> + (enable, origination_size, min_pending_to_process)) + (fun ( zk_rollup_enable, + zk_rollup_origination_size, + zk_rollup_min_pending_to_process ) -> + { + enable = zk_rollup_enable; + origination_size = zk_rollup_origination_size; + min_pending_to_process = zk_rollup_min_pending_to_process; + }) + (obj3 + (req "zk_rollup_enable" bool) + (req "zk_rollup_origination_size" int31) + (req "zk_rollup_min_pending_to_process" int31)) + +let encoding = + let open Data_encoding in + conv + (fun c -> + ( ( c.preserved_cycles, + c.blocks_per_cycle, + c.blocks_per_commitment, + c.nonce_revelation_threshold, + c.blocks_per_stake_snapshot, + c.cycles_per_voting_period, + c.hard_gas_limit_per_operation, + c.hard_gas_limit_per_block, + c.proof_of_work_threshold, + c.minimal_stake ), + ( ( c.vdf_difficulty, + c.seed_nonce_revelation_tip, + c.origination_size, + c.baking_reward_fixed_portion, + c.baking_reward_bonus_per_slot, + c.endorsing_reward_per_slot, + c.cost_per_byte, + c.hard_storage_limit_per_operation, + c.quorum_min ), + ( ( c.quorum_max, + c.min_proposal_quorum, + c.liquidity_baking_subsidy, + c.liquidity_baking_toggle_ema_threshold, + c.max_operations_time_to_live, + c.minimal_block_delay, + c.delay_increment_per_round, + c.consensus_committee_size, + c.consensus_threshold ), + ( ( c.minimal_participation_ratio, + c.max_slashing_period, + c.frozen_deposits_percentage, + c.double_baking_punishment, + c.ratio_of_frozen_deposits_slashed_per_double_endorsement, + c.testnet_dictator, + c.initial_seed ), + ( ( c.cache_script_size, + c.cache_stake_distribution_cycles, + c.cache_sampler_state_cycles ), + (c.tx_rollup, (c.dal, (c.sc_rollup, c.zk_rollup))) ) ) ) ) )) + (fun ( ( preserved_cycles, + blocks_per_cycle, + blocks_per_commitment, + nonce_revelation_threshold, + blocks_per_stake_snapshot, + cycles_per_voting_period, + hard_gas_limit_per_operation, + hard_gas_limit_per_block, + proof_of_work_threshold, + minimal_stake ), + ( ( vdf_difficulty, + seed_nonce_revelation_tip, + origination_size, + baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot, + cost_per_byte, + hard_storage_limit_per_operation, + quorum_min ), + ( ( quorum_max, + min_proposal_quorum, + liquidity_baking_subsidy, + liquidity_baking_toggle_ema_threshold, + max_operations_time_to_live, + minimal_block_delay, + delay_increment_per_round, + consensus_committee_size, + consensus_threshold ), + ( ( minimal_participation_ratio, + max_slashing_period, + frozen_deposits_percentage, + double_baking_punishment, + ratio_of_frozen_deposits_slashed_per_double_endorsement, + testnet_dictator, + initial_seed ), + ( ( cache_script_size, + cache_stake_distribution_cycles, + cache_sampler_state_cycles ), + (tx_rollup, (dal, (sc_rollup, zk_rollup))) ) ) ) ) ) -> + { + preserved_cycles; + blocks_per_cycle; + blocks_per_commitment; + nonce_revelation_threshold; + blocks_per_stake_snapshot; + cycles_per_voting_period; + hard_gas_limit_per_operation; + hard_gas_limit_per_block; + proof_of_work_threshold; + minimal_stake; + vdf_difficulty; + seed_nonce_revelation_tip; + origination_size; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + cost_per_byte; + hard_storage_limit_per_operation; + quorum_min; + quorum_max; + min_proposal_quorum; + liquidity_baking_subsidy; + liquidity_baking_toggle_ema_threshold; + max_operations_time_to_live; + minimal_block_delay; + delay_increment_per_round; + minimal_participation_ratio; + max_slashing_period; + consensus_committee_size; + consensus_threshold; + frozen_deposits_percentage; + double_baking_punishment; + ratio_of_frozen_deposits_slashed_per_double_endorsement; + testnet_dictator; + initial_seed; + cache_script_size; + cache_stake_distribution_cycles; + cache_sampler_state_cycles; + tx_rollup; + dal; + sc_rollup; + zk_rollup; + }) + (merge_objs + (obj10 + (req "preserved_cycles" uint8) + (req "blocks_per_cycle" int32) + (req "blocks_per_commitment" int32) + (req "nonce_revelation_threshold" int32) + (req "blocks_per_stake_snapshot" int32) + (req "cycles_per_voting_period" int32) + (req + "hard_gas_limit_per_operation" + Gas_limit_repr.Arith.z_integral_encoding) + (req + "hard_gas_limit_per_block" + Gas_limit_repr.Arith.z_integral_encoding) + (req "proof_of_work_threshold" int64) + (req "minimal_stake" Tez_repr.encoding)) + (merge_objs + (obj9 + (req "vdf_difficulty" int64) + (req "seed_nonce_revelation_tip" Tez_repr.encoding) + (req "origination_size" int31) + (req "baking_reward_fixed_portion" Tez_repr.encoding) + (req "baking_reward_bonus_per_slot" Tez_repr.encoding) + (req "endorsing_reward_per_slot" Tez_repr.encoding) + (req "cost_per_byte" Tez_repr.encoding) + (req "hard_storage_limit_per_operation" z) + (req "quorum_min" int32)) + (merge_objs + (obj9 + (req "quorum_max" int32) + (req "min_proposal_quorum" int32) + (req "liquidity_baking_subsidy" Tez_repr.encoding) + (req "liquidity_baking_toggle_ema_threshold" int32) + (req "max_operations_time_to_live" int16) + (req "minimal_block_delay" Period_repr.encoding) + (req "delay_increment_per_round" Period_repr.encoding) + (req "consensus_committee_size" int31) + (req "consensus_threshold" int31)) + (merge_objs + (obj7 + (req "minimal_participation_ratio" Ratio_repr.encoding) + (req "max_slashing_period" int31) + (req "frozen_deposits_percentage" int31) + (req "double_baking_punishment" Tez_repr.encoding) + (req + "ratio_of_frozen_deposits_slashed_per_double_endorsement" + Ratio_repr.encoding) + (opt "testnet_dictator" Signature.Public_key_hash.encoding) + (opt "initial_seed" State_hash.encoding)) + (merge_objs + (obj3 + (req "cache_script_size" int31) + (req "cache_stake_distribution_cycles" int8) + (req "cache_sampler_state_cycles" int8)) + (merge_objs + tx_rollup_encoding + (merge_objs + (obj1 (req "dal_parametric" dal_encoding)) + (merge_objs sc_rollup_encoding zk_rollup_encoding)))))))) diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.mli b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.mli new file mode 100644 index 000000000000..0ce06811885f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_parametric_repr.mli @@ -0,0 +1,192 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type dal = { + feature_enable : bool; + number_of_slots : int; + attestation_lag : int; + availability_threshold : int; + cryptobox_parameters : Dal.parameters; +} + +val dal_encoding : dal Data_encoding.t + +type tx_rollup = { + enable : bool; + origination_size : int; + (* the maximum amount of bytes messages can allocate in an inbox *) + hard_size_limit_per_inbox : int; + (* the maximum amount of bytes one batch can allocate in an inbox *) + hard_size_limit_per_message : int; + (* the amount of tez to bond a tx rollup commitment *) + commitment_bond : Tez_repr.t; + (* the number of blocks before a tx rollup block is final *) + finality_period : int; + (* the maximum number of levels that can be left unfinalized + before we stop accepting new inboxes for a tx rollup *) + (* the minimum number of blocks to wait before removing a finalised + commitment from the context. *) + withdraw_period : int; + max_inboxes_count : int; + (* the maximum number of messages in an inbox. This bounds the + size of a commitment. *) + max_messages_per_inbox : int; + (* the maximum number of finalized commitments, to ensure that + remove_commitment is ever called *) + max_commitments_count : int; + (* The number of blocks used to compute the ema factor determining + the cost per byte for new messages in the inbox. *) + cost_per_byte_ema_factor : int; + (* Tickets are transmitted in batches in the + [Tx_rollup_dispatch_tickets] operation. + + The semantics is that this operation is used to + concretize the withdraw orders emitted by the layer-2, + one layer-1 operation per messages of an + inbox. Therefore, it is of significant importance that + a valid batch does not produce a list of withdraw + orders which could not fit in a layer-1 operation. + + With these values, at least 2048 bytes remain available + to store the rest of the operands of + [Tx_rollup_dispatch_tickets] (in practice, even more, + because we overapproximate the size of tickets). So we + are safe. *) + max_ticket_payload_size : int; + max_withdrawals_per_batch : int; + (* The maximum size, in bytes, of a Merkle proof. Operations which would + require proofs larger than this should be no-ops. *) + rejection_max_proof_size : int; + sunset_level : int32; +} + +type sc_rollup = { + enable : bool; + origination_size : int; + challenge_window_in_blocks : int; + stake_amount : Tez_repr.t; + (* The period with which commitments are made. *) + commitment_period_in_blocks : int; + (* The maximum depth of a staker's position - chosen alongside + [commitment_period_in_blocks] to prevent the cost + of a staker's commitments' storage being greater than their deposit. *) + max_lookahead_in_blocks : int32; + (* Maximum number of active outbox levels allowed. An outbox level is active + if it has an associated record of applied messages. *) + max_active_outbox_levels : int32; + max_outbox_messages_per_level : int; + (* The default number of required sections in a dissection *) + number_of_sections_in_dissection : int; + (* The timeout period for a player in a refutation game. + + Timeout logic is similar to a chess clock. Each player starts with the same + timeout = [timeout_period_in_blocks]. Each game move updates the timeout of + the current player by decreasing it by the amount of time she took to play, + i.e. number of blocks since the opponent last move. See + {!Sc_rollup_game_repr.timeout} and + {!Sc_rollup_refutation_storage.game_move} to see the implementation. + + Because of that [timeout_period_in_blocks] must be at least half the upper + bound number of blocks needed for a game to finish. This bound is + correlated to the maximum distance allowed between the first and last tick + of a dissection. For example, when the maximum distance allowed is half the + total distance [(last_tick - last_tick) / 2] then bound is [Log^2 + (Int64.max_int) + 2 = 65]. See {!Sc_rollup_game_repr.check_dissection} for + more information on the dissection logic. *) + timeout_period_in_blocks : int; + (* The maximum number of cemented commitments stored for a sc rollup. *) + max_number_of_stored_cemented_commitments : int; + (* The maximum number of parallel games played by a given staker. *) + max_number_of_parallel_games : int; +} + +type zk_rollup = { + enable : bool; + origination_size : int; + (* Minimum number of pending operations that can be processed by a ZKRU + update, if available. + If the length of the pending list is less than [min_pending_to_process], + then an update needs to process all pending operations to be valid. + That is, every update must process at least + [min(length pending_list, min_pending_to_process)] pending operations. *) + min_pending_to_process : int; +} + +type t = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + nonce_revelation_threshold : int32; + blocks_per_stake_snapshot : int32; + cycles_per_voting_period : int32; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + minimal_stake : Tez_repr.t; + vdf_difficulty : int64; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + (* in centile of a percentage *) + quorum_max : int32; + min_proposal_quorum : int32; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_toggle_ema_threshold : int32; + max_operations_time_to_live : int; + minimal_block_delay : Period_repr.t; + delay_increment_per_round : Period_repr.t; + minimal_participation_ratio : Ratio_repr.t; + consensus_committee_size : int; + (* in slots *) + consensus_threshold : int; + (* in slots *) + max_slashing_period : int; + (* in cycles *) + frozen_deposits_percentage : int; + (* that is, (100 * delegated tz / own tz) *) + double_baking_punishment : Tez_repr.t; + ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + testnet_dictator : Signature.Public_key_hash.t option; + initial_seed : State_hash.t option; + cache_script_size : int; + (* in bytes *) + cache_stake_distribution_cycles : int; + (* in cycles *) + cache_sampler_state_cycles : int; + (* in cycles *) + tx_rollup : tx_rollup; + dal : dal; + sc_rollup : sc_rollup; + zk_rollup : zk_rollup; +} + +val encoding : t Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_repr.ml b/src/proto_016_PtMumbai/lib_protocol/constants_repr.ml new file mode 100644 index 000000000000..32d83c860752 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_repr.ml @@ -0,0 +1,383 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let mainnet_id = Chain_id.of_b58check_exn "NetXdQprcVkpaWU" + +(* The fitness version number was: + - "\000" until and including proto 004 + - "\001" until and including proto 010 +*) +let fitness_version_number = "\002" + +let proof_of_work_nonce_size = 8 + +let nonce_length = 32 + +let max_anon_ops_per_block = 132 + +let max_proposals_per_delegate = 20 + +let max_operation_data_length = 32 * 1024 (* 32kB *) + +let max_micheline_node_count = 50_000 + +let max_micheline_bytes_limit = 50_000 + +let max_allowed_global_constant_depth = 10_000 + +(* In previous versions of the protocol, this + [michelson_maximum_type_size] limit was set to 1000 but + the contract input types (pair <parameter_type> <storage_type>) + were not checked. Both components, <parameter_type> and + <storage_type> where however checked hence it was possible to build + types as big as 2001. *) +let michelson_maximum_type_size = 2001 + +(* This constant declares the number of subcaches used by the cache + mechanism (see {Context.Cache}). *) +let cache_layout_size = 3 + +(* The {!Sc_rollups.wrapped_proof_encoding} uses unbounded sub-encodings. + To avoid attacks through too large proofs and long decoding times on public + nodes, we put another layer of security by restricting the maximum_size + to [30Kb]. + + Even if the operation size limit is currently [32Kb] (see + {!Constants_repr.max_operation_data_length}) the node's mempool can still + be spammed with larger proofs before detecting that the operations are + indeed larger than the limit. + + By design, the proofs should be created and verified for a single tick + which should limit the number of read/writes in the Merkle tree, and thefore, + limit the total size of a proof. Thus, [30Kb] can be lowered once we + have empirically observed that a valid proof can not be that large. + + Note that an encoded proof that is [30Kb] might still be not included + in a valid L1 operation. The refutation operation also contains other + information such as an inbox proof. We only put here an upper bound + for the size. +*) +let sc_max_wrapped_proof_binary_size = 30_000 + +(* A limit on the size of the binary encoding of sc rollup messages. This limit + depends on the assumed overhead of the proof and metadata in a manager + operation justifying the existence of some chunk of data in the rollup state. + The value of this constant reflects the global constant of 4KB in the WASM + PVM specification chosen for the limit of chunks that are embedded in proofs. +*) +let sc_rollup_message_size_limit = 4_096 + +(** A limit on the number of messages per inbox level. + + Benchmarks have shown that proving the inclusion of the element at + index 0 in a skip list of [1_000_000] elements is ~=6Kb large. +*) +let sc_rollup_max_number_of_messages_per_level = Z.of_int 1_000_000 + +type fixed = unit + +let fixed_encoding = + let open Data_encoding in + conv + (fun () -> + ( ( proof_of_work_nonce_size, + nonce_length, + max_anon_ops_per_block, + max_operation_data_length, + max_proposals_per_delegate, + max_micheline_node_count, + max_micheline_bytes_limit, + max_allowed_global_constant_depth, + cache_layout_size, + michelson_maximum_type_size ), + ( sc_max_wrapped_proof_binary_size, + sc_rollup_message_size_limit, + sc_rollup_max_number_of_messages_per_level ) )) + (fun ( ( _proof_of_work_nonce_size, + _nonce_length, + _max_anon_ops_per_block, + _max_operation_data_length, + _max_proposals_per_delegate, + _max_micheline_node_count, + _max_micheline_bytes_limit, + _max_allowed_global_constant_depth, + _cache_layout_size, + _michelson_maximum_type_size ), + ( _sc_max_wrapped_proof_binary_size, + _sc_rollup_message_size_limit, + _sc_rollup_number_of_messages_per_level ) ) -> ()) + (merge_objs + (obj10 + (req "proof_of_work_nonce_size" uint8) + (req "nonce_length" uint8) + (req "max_anon_ops_per_block" uint8) + (req "max_operation_data_length" int31) + (req "max_proposals_per_delegate" uint8) + (req "max_micheline_node_count" int31) + (req "max_micheline_bytes_limit" int31) + (req "max_allowed_global_constants_depth" int31) + (req "cache_layout_size" uint8) + (req "michelson_maximum_type_size" uint16)) + (obj3 + (req "sc_max_wrapped_proof_binary_size" int31) + (req "sc_rollup_message_size_limit" int31) + (req "sc_rollup_max_number_of_messages_per_level" n))) + +let fixed = () + +type t = {fixed : fixed; parametric : Constants_parametric_repr.t} + +let all_of_parametric parametric = {fixed; parametric} + +let encoding = + let open Data_encoding in + conv + (fun {fixed; parametric} -> (fixed, parametric)) + (fun (fixed, parametric) -> {fixed; parametric}) + (merge_objs fixed_encoding Constants_parametric_repr.encoding) + +type error += Invalid_protocol_constants of string (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"constants.invalid_protocol_constants" + ~title:"Invalid protocol constants" + ~description:"The provided protocol constants are not coherent." + ~pp:(fun ppf reason -> + Format.fprintf ppf "Invalid protocol constants: %s" reason) + Data_encoding.(obj1 (req "reason" @@ string Plain)) + (function Invalid_protocol_constants reason -> Some reason | _ -> None) + (fun reason -> Invalid_protocol_constants reason) + +let check_constants constants = + let open Constants_parametric_repr in + error_unless + Period_repr.(constants.minimal_block_delay > zero) + (Invalid_protocol_constants + "The minimal block delay must be greater than zero") + >>? fun () -> + error_unless + Period_repr.(constants.delay_increment_per_round > zero) + (Invalid_protocol_constants + "The delay increment per round must be greater than zero") + >>? fun () -> + error_unless + Compare.Int.(constants.consensus_committee_size > 0) + (Invalid_protocol_constants + "The consensus committee size must be strictly greater than 0.") + >>? fun () -> + error_unless + Compare.Int.( + constants.consensus_threshold >= 0 + && constants.consensus_threshold <= constants.consensus_committee_size) + (Invalid_protocol_constants + "The consensus threshold must be greater than or equal to 0 and less \ + than or equal to the consensus commitee size.") + >>? fun () -> + error_unless + (let Ratio_repr.{numerator; denominator} = + constants.minimal_participation_ratio + in + Compare.Int.(numerator >= 0 && denominator > 0)) + (Invalid_protocol_constants + "The minimal participation ratio must be a non-negative valid ratio.") + >>? fun () -> + error_unless + Compare.Int.( + constants.minimal_participation_ratio.numerator + <= constants.minimal_participation_ratio.denominator) + (Invalid_protocol_constants + "The minimal participation ratio must be less than or equal to 100%.") + >>? fun () -> + error_unless + Compare.Int.(constants.max_slashing_period > 0) + (Invalid_protocol_constants + "The unfreeze delay must be strictly greater than 0.") + >>? fun () -> + (* The [frozen_deposits_percentage] should be a percentage *) + error_unless + Compare.Int.( + constants.frozen_deposits_percentage > 0 + && constants.frozen_deposits_percentage <= 100) + (Invalid_protocol_constants + "The frozen percentage ratio must be strictly greater than 0 and less \ + or equal than 100.") + >>? fun () -> + error_unless + Tez_repr.(constants.double_baking_punishment >= zero) + (Invalid_protocol_constants + "The double baking punishment must be non-negative.") + >>? fun () -> + error_unless + (let Ratio_repr.{numerator; denominator} = + constants.ratio_of_frozen_deposits_slashed_per_double_endorsement + in + Compare.Int.(numerator >= 0 && denominator > 0)) + (Invalid_protocol_constants + "The ratio of frozen deposits ratio slashed per double endorsement must \ + be a non-negative valid ratio.") + >>? fun () -> + error_unless + (let snapshot_frequence = + Int32.div constants.blocks_per_cycle constants.blocks_per_stake_snapshot + in + Compare.Int32.( + snapshot_frequence > Int32.zero + && snapshot_frequence < Int32.of_int (1 lsl 16))) + (Invalid_protocol_constants + "The ratio blocks_per_cycle per blocks_per_stake_snapshot should be \ + between 1 and 65535") + >>? fun () -> + error_unless + Compare.Int32.( + constants.nonce_revelation_threshold > Int32.zero + && constants.nonce_revelation_threshold < constants.blocks_per_cycle) + (Invalid_protocol_constants + "The nonce revelation threshold must be strictly smaller than \ + blocks_per_cycle and strictly positive.") + >>? fun () -> + error_unless + Compare.Int64.( + let threshold = Int64.of_int32 constants.nonce_revelation_threshold in + let block = Period_repr.to_seconds constants.minimal_block_delay in + let ips = + (* We reduce the ips for short blocks_per_commitment so that we have + low difficulty during tests *) + if Compare.Int32.(constants.blocks_per_commitment > 32l) then + Int64.of_int 200_000 + else Int64.one + in + let factor = Int64.of_int 5 in + let difficulty = Int64.(mul (mul ips factor) (mul threshold block)) in + constants.vdf_difficulty > difficulty) + (Invalid_protocol_constants + "The VDF difficulty must be strictly greater than the product of the \ + nonce_revelation_threshold, the minimial_block_delay, a benchmark of \ + modulo squaring in class groups and a security threshold.") + >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.origination_size >= 0) + (Invalid_protocol_constants + "The smart contract rollup origination size must be non-negative.") + >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.challenge_window_in_blocks >= 0) + (Invalid_protocol_constants + "The smart contract rollup challenge window in blocks must be \ + non-negative.") + >>? fun () -> + error_unless + Tez_repr.(constants.sc_rollup.stake_amount >= zero) + (Invalid_protocol_constants + "The smart contract rollup max stake amount must be non-negative.") + >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.commitment_period_in_blocks > 0) + (Invalid_protocol_constants + "The smart contract rollup commitment period in blocks must be strictly \ + greater than 0.") + >>? fun () -> + error_unless + (let sc_rollup_max_lookahead_in_blocks = + constants.sc_rollup.max_lookahead_in_blocks + in + Compare.Int32.( + sc_rollup_max_lookahead_in_blocks + > Int32.of_int constants.sc_rollup.commitment_period_in_blocks + && (* Check that [sc_rollup_challenge_window_in_blocks < + sc_rollup_max_lookahead_in_blocks]. Otherwise committers would be + forced to commit at an artificially slow rate, affecting the + throughput of the rollup. *) + sc_rollup_max_lookahead_in_blocks + > Int32.of_int constants.sc_rollup.challenge_window_in_blocks)) + (Invalid_protocol_constants + "The smart contract rollup max lookahead in blocks must be greater than \ + [sc_rollup_commitment_period_in_blocks] and \ + [sc_rollup_challenge_window_in_blocks].") + >>? fun () -> + error_unless + Compare.Int.( + constants.dal.number_of_slots > 0 && constants.dal.number_of_slots <= 256) + (Invalid_protocol_constants + "The number of data availability slot must be between 1 and 256") + >>? fun () -> + error_unless + Compare.Int.( + constants.sc_rollup.max_number_of_stored_cemented_commitments > 0) + (Invalid_protocol_constants + "The number of maximum stored cemented commitments must be strictly \ + positive") + >>? fun () -> Result.return_unit + +module Generated = struct + type t = { + consensus_threshold : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + liquidity_baking_subsidy : Tez_repr.t; + } + + let generate ~consensus_committee_size ~blocks_per_minute = + let consensus_threshold = (consensus_committee_size * 2 / 3) + 1 in + (* As in previous protocols, we set the maximum total rewards per minute to + be 80 tez. *) + let rewards_per_minute = Tez_repr.(mul_exn one 80) in + let rewards_per_block = + Ratio_repr.( + Tez_repr.( + div_exn + (mul_exn rewards_per_minute blocks_per_minute.denominator) + blocks_per_minute.numerator)) + in + let rewards_half = Tez_repr.(div_exn rewards_per_block 2) in + let rewards_quarter = Tez_repr.(div_exn rewards_per_block 4) in + let bonus_committee_size = consensus_committee_size - consensus_threshold in + { + consensus_threshold; + baking_reward_fixed_portion = + (if Compare.Int.(bonus_committee_size <= 0) then + (* a fortiori, consensus_committee_size < 4 *) + rewards_half + else rewards_quarter); + baking_reward_bonus_per_slot = + (if Compare.Int.(bonus_committee_size <= 0) then Tez_repr.zero + else Tez_repr.div_exn rewards_quarter bonus_committee_size); + endorsing_reward_per_slot = + Tez_repr.div_exn rewards_half consensus_committee_size; + liquidity_baking_subsidy = Tez_repr.div_exn rewards_per_block 16; + } +end + +let cache_layout p = + Constants_parametric_repr. + [ + p.cache_script_size; + p.cache_stake_distribution_cycles; + p.cache_sampler_state_cycles; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_repr.mli b/src/proto_016_PtMumbai/lib_protocol/constants_repr.mli new file mode 100644 index 000000000000..18dd739e62ea --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_repr.mli @@ -0,0 +1,130 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val mainnet_id : Chain_id.t + +val fitness_version_number : string + +val proof_of_work_nonce_size : int + +val nonce_length : int + +val max_anon_ops_per_block : int + +val max_proposals_per_delegate : int + +val max_operation_data_length : int + +(** A global size limit on the size of Micheline expressions + after expansion. + + We want to prevent constants from being + used to create huge values that could potentially do damage + if ever printed or sent over the network. We arrived at this + number by finding the largest possible contract in terms of + number of nodes. The number of nodes is constrained by the + current "max_operation_data_length" (32768) to be ~10,000 ( + see "large_flat_contract.tz" in the tezt suite for the largest + contract with constants that can be originated). As a first + approximation, we set the node size limit to 5 times this amount. *) +val max_micheline_node_count : int + +(** Same as [max_micheline_node_count] but for limiting the combined + bytes of the strings, ints and bytes in a expanded Micheline + expression. *) +val max_micheline_bytes_limit : int + +(** Represents the maximum depth of an expression stored + in the table after all references to other constants have + (recursively) been expanded, where depth refers to the + nesting of [Prim] and/or [Seq] nodes. + + The size was chosen arbitrarily to match the typechecker + in [Script_ir_translator]. *) +val max_allowed_global_constant_depth : int + +(** A global size limit on the size of Michelson types. + + The size of a type is the number of nodes in its AST + representation. See [Script_typed_ir.TYPE_SIZE]. + *) +val michelson_maximum_type_size : int + +(** A size limit for {!Sc_rollups.wrapped_proof} binary encoding. *) +val sc_max_wrapped_proof_binary_size : int + +(** A limit on the size of the binary encoding for sc rollup messages: + {!Sc_rollup_inbox_message_repr.t} and {!Sc_rollup_outbox_message_repr.t} +*) +val sc_rollup_message_size_limit : int + +(** A limit on the number of messages in a inbox level enforced in + {!Sc_rollup_inbox_repr.t}. *) +val sc_rollup_max_number_of_messages_per_level : Z.t + +type fixed + +val fixed_encoding : fixed Data_encoding.encoding + +type t = private {fixed : fixed; parametric : Constants_parametric_repr.t} + +val all_of_parametric : Constants_parametric_repr.t -> t + +val encoding : t Data_encoding.encoding + +type error += (* `Permanent *) Invalid_protocol_constants of string + +(** performs some consistency checks on the protocol parameters *) +val check_constants : Constants_parametric_repr.t -> unit tzresult + +module Generated : sig + type t = { + consensus_threshold : int; + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + liquidity_baking_subsidy : Tez_repr.t; + } + + (* This function is meant to be used just in lib_parameters and in the + migration code to be sure that the parameters are consistent. *) + val generate : + consensus_committee_size:int -> blocks_per_minute:Ratio_repr.t -> t +end + +(** For each subcache, a size limit needs to be declared once. However, + depending how the protocol will be instantiated (sandboxed mode, + test network, ...) we may want to change this limit. For each + subcache, a parametric constant can be used to change the limit + (see {!parametric}). + + The number of subcaches and the limits for all those subcaches form + together what is called the [cache_layout]. *) +val cache_layout_size : int + +(** The [cache_layout] depends on parametric constants. *) +val cache_layout : Constants_parametric_repr.t -> int list diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_services.ml b/src/proto_016_PtMumbai/lib_protocol/constants_services.ml new file mode 100644 index 000000000000..b28b1bac2e79 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_services.ml @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let custom_root = + (RPC_path.(open_root / "context" / "constants") + : RPC_context.t RPC_path.context) + +module S = struct + open Data_encoding + + let errors = + RPC_service.get_service + ~description:"Schema for all the RPC errors from this protocol version" + ~query:RPC_query.empty + ~output:json_schema + RPC_path.(custom_root / "errors") + + let all = + RPC_service.get_service + ~description:"All constants" + ~query:RPC_query.empty + ~output:Alpha_context.Constants.encoding + custom_root + + let parametric = + RPC_service.get_service + ~description:"Parametric constants" + ~query:RPC_query.empty + ~output:Alpha_context.Constants.Parametric.encoding + RPC_path.(custom_root / "parametric") +end + +let register () = + let open Services_registration in + register0_noctxt ~chunked:true S.errors (fun () () -> + return Data_encoding.Json.(schema error_encoding)) ; + register0 ~chunked:false S.all (fun ctxt () () -> + return @@ Constants.all ctxt) ; + register0 ~chunked:false S.parametric (fun ctxt () () -> + return @@ Constants.parametric ctxt) + +let errors ctxt block = RPC_context.make_call0 S.errors ctxt block () () + +let all ctxt block = RPC_context.make_call0 S.all ctxt block () () + +let parametric ctxt block = RPC_context.make_call0 S.parametric ctxt block () () diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_services.mli b/src/proto_016_PtMumbai/lib_protocol/constants_services.mli new file mode 100644 index 000000000000..97294ab20ad2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_services.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +val errors : + 'a #RPC_context.simple -> 'a -> Data_encoding.json_schema shell_tzresult Lwt.t + +(** Returns all the constants of the protocol *) +val all : 'a #RPC_context.simple -> 'a -> Constants.t shell_tzresult Lwt.t + +(** Returns the parametric constants of the protocol *) +val parametric : + 'a #RPC_context.simple -> 'a -> Constants.Parametric.t shell_tzresult Lwt.t + +val register : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/constants_storage.ml new file mode 100644 index 000000000000..2bbd285e00c1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_storage.ml @@ -0,0 +1,291 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let preserved_cycles c = + let constants = Raw_context.constants c in + constants.preserved_cycles + +let blocks_per_cycle c = + let constants = Raw_context.constants c in + constants.blocks_per_cycle + +let blocks_per_commitment c = + let constants = Raw_context.constants c in + constants.blocks_per_commitment + +let nonce_revelation_threshold c = + let constants = Raw_context.constants c in + constants.nonce_revelation_threshold + +let blocks_per_stake_snapshot c = + let constants = Raw_context.constants c in + constants.blocks_per_stake_snapshot + +let cycles_per_voting_period c = + let constants = Raw_context.constants c in + constants.cycles_per_voting_period + +let hard_gas_limit_per_operation c = + let constants = Raw_context.constants c in + constants.hard_gas_limit_per_operation + +let hard_gas_limit_per_block c = + let constants = Raw_context.constants c in + constants.hard_gas_limit_per_block + +let cost_per_byte c = + let constants = Raw_context.constants c in + constants.cost_per_byte + +let hard_storage_limit_per_operation c = + let constants = Raw_context.constants c in + constants.hard_storage_limit_per_operation + +let proof_of_work_threshold c = + let constants = Raw_context.constants c in + constants.proof_of_work_threshold + +let minimal_stake c = + let constants = Raw_context.constants c in + constants.minimal_stake + +let vdf_difficulty c = + let constants = Raw_context.constants c in + constants.vdf_difficulty + +let seed_nonce_revelation_tip c = + let constants = Raw_context.constants c in + constants.seed_nonce_revelation_tip + +let origination_size c = + let constants = Raw_context.constants c in + constants.origination_size + +let baking_reward_fixed_portion c = + let constants = Raw_context.constants c in + constants.baking_reward_fixed_portion + +let baking_reward_bonus_per_slot c = + let constants = Raw_context.constants c in + constants.baking_reward_bonus_per_slot + +let endorsing_reward_per_slot c = + let constants = Raw_context.constants c in + constants.endorsing_reward_per_slot + +let quorum_min c = + let constants = Raw_context.constants c in + constants.quorum_min + +let quorum_max c = + let constants = Raw_context.constants c in + constants.quorum_max + +let min_proposal_quorum c = + let constants = Raw_context.constants c in + constants.min_proposal_quorum + +let liquidity_baking_subsidy c = + let constants = Raw_context.constants c in + constants.liquidity_baking_subsidy + +let liquidity_baking_toggle_ema_threshold c = + let constants = Raw_context.constants c in + constants.liquidity_baking_toggle_ema_threshold + +let parametric c = Raw_context.constants c + +let tx_rollup c = (Raw_context.constants c).tx_rollup + +let sc_rollup c = (Raw_context.constants c).sc_rollup + +let minimal_block_delay c = + let constants = Raw_context.constants c in + constants.minimal_block_delay + +let delay_increment_per_round c = + let constants = Raw_context.constants c in + constants.delay_increment_per_round + +let consensus_committee_size c = + let constants = Raw_context.constants c in + constants.consensus_committee_size + +let consensus_threshold c = + let constants = Raw_context.constants c in + constants.consensus_threshold + +let minimal_participation_ratio c = + let constants = Raw_context.constants c in + constants.minimal_participation_ratio + +let max_slashing_period c = + let constants = Raw_context.constants c in + constants.max_slashing_period + +let frozen_deposits_percentage c = + let constants = Raw_context.constants c in + constants.frozen_deposits_percentage + +let double_baking_punishment c = + let constants = Raw_context.constants c in + constants.double_baking_punishment + +let tx_rollup_enable c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.enable + +let tx_rollup_sunset_level c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.sunset_level + +let tx_rollup_origination_size c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.origination_size + +let tx_rollup_hard_size_limit_per_inbox c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.hard_size_limit_per_inbox + +let tx_rollup_hard_size_limit_per_message c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.hard_size_limit_per_message + +let tx_rollup_max_withdrawals_per_batch c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.max_withdrawals_per_batch + +let tx_rollup_commitment_bond c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.commitment_bond + +let tx_rollup_finality_period c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.finality_period + +let tx_rollup_withdraw_period c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.withdraw_period + +let tx_rollup_max_inboxes_count c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.max_inboxes_count + +let tx_rollup_max_messages_per_inbox c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.max_messages_per_inbox + +let tx_rollup_max_commitments_count c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.max_commitments_count + +let tx_rollup_cost_per_byte_ema_factor c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.cost_per_byte_ema_factor + +let tx_rollup_max_ticket_payload_size c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.max_ticket_payload_size + +let tx_rollup_rejection_max_proof_size c = + let tx_rollup = Raw_context.tx_rollup c in + tx_rollup.rejection_max_proof_size + +let ratio_of_frozen_deposits_slashed_per_double_endorsement c = + let constants = Raw_context.constants c in + constants.ratio_of_frozen_deposits_slashed_per_double_endorsement + +let testnet_dictator c = + let constants = Raw_context.constants c in + constants.testnet_dictator + +let sc_rollup_enable c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.enable + +let sc_rollup_origination_size c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.origination_size + +let sc_rollup_challenge_window_in_blocks c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.challenge_window_in_blocks + +let sc_rollup_stake_amount c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.stake_amount + +let sc_rollup_commitment_period_in_blocks c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.commitment_period_in_blocks + +let sc_rollup_max_lookahead_in_blocks c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_lookahead_in_blocks + +let sc_rollup_max_active_outbox_levels c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_active_outbox_levels + +let sc_rollup_max_outbox_messages_per_level c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_outbox_messages_per_level + +let sc_rollup_number_of_sections_in_dissection c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.number_of_sections_in_dissection + +let sc_rollup_timeout_period_in_blocks c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.timeout_period_in_blocks + +let sc_rollup_max_number_of_parallel_games c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_number_of_parallel_games + +let max_number_of_stored_cemented_commitments c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_number_of_stored_cemented_commitments + +let dal_number_of_slots c = + let constants = Raw_context.constants c in + constants.dal.number_of_slots + +let dal_enable c = + let constants = Raw_context.constants c in + constants.dal.feature_enable + +let zk_rollup_enable c = + let zk_rollup = Raw_context.zk_rollup c in + zk_rollup.enable + +let zk_rollup_min_pending_to_process c = + let zk_rollup = Raw_context.zk_rollup c in + zk_rollup.min_pending_to_process + +let zk_rollup_origination_size c = + let zk_rollup = Raw_context.zk_rollup c in + zk_rollup.origination_size diff --git a/src/proto_016_PtMumbai/lib_protocol/constants_storage.mli b/src/proto_016_PtMumbai/lib_protocol/constants_storage.mli new file mode 100644 index 000000000000..a5d47a9143cd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/constants_storage.mli @@ -0,0 +1,168 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides functions to extract the value of protocol parameters + from the context. + See {!Constant_repr.parametric} for more details about these values. *) + +val preserved_cycles : Raw_context.t -> int + +val blocks_per_cycle : Raw_context.t -> int32 + +val blocks_per_commitment : Raw_context.t -> int32 + +val nonce_revelation_threshold : Raw_context.t -> int32 + +val blocks_per_stake_snapshot : Raw_context.t -> int32 + +val cycles_per_voting_period : Raw_context.t -> int32 + +val hard_gas_limit_per_operation : + Raw_context.t -> Gas_limit_repr.Arith.integral + +val hard_gas_limit_per_block : Raw_context.t -> Gas_limit_repr.Arith.integral + +val cost_per_byte : Raw_context.t -> Tez_repr.t + +val hard_storage_limit_per_operation : Raw_context.t -> Z.t + +val proof_of_work_threshold : Raw_context.t -> int64 + +val minimal_stake : Raw_context.t -> Tez_repr.t + +val vdf_difficulty : Raw_context.t -> int64 + +val seed_nonce_revelation_tip : Raw_context.t -> Tez_repr.t + +val origination_size : Raw_context.t -> int + +val baking_reward_fixed_portion : Raw_context.t -> Tez_repr.t + +val baking_reward_bonus_per_slot : Raw_context.t -> Tez_repr.t + +val endorsing_reward_per_slot : Raw_context.t -> Tez_repr.t + +val quorum_min : Raw_context.t -> int32 + +val quorum_max : Raw_context.t -> int32 + +val min_proposal_quorum : Raw_context.t -> int32 + +val liquidity_baking_subsidy : Raw_context.t -> Tez_repr.t + +val liquidity_baking_toggle_ema_threshold : Raw_context.t -> int32 + +val parametric : Raw_context.t -> Constants_parametric_repr.t + +val tx_rollup : Raw_context.t -> Constants_parametric_repr.tx_rollup + +val sc_rollup : Raw_context.t -> Constants_parametric_repr.sc_rollup + +val consensus_committee_size : Raw_context.t -> int + +val consensus_threshold : Raw_context.t -> int + +val minimal_participation_ratio : Raw_context.t -> Ratio_repr.t + +val max_slashing_period : Raw_context.t -> int + +val frozen_deposits_percentage : Raw_context.t -> int + +val double_baking_punishment : Raw_context.t -> Tez_repr.t + +val tx_rollup_enable : Raw_context.t -> bool + +val tx_rollup_origination_size : Raw_context.t -> int + +val tx_rollup_hard_size_limit_per_inbox : Raw_context.t -> int + +val tx_rollup_hard_size_limit_per_message : Raw_context.t -> int + +val tx_rollup_max_withdrawals_per_batch : Raw_context.t -> int + +val tx_rollup_commitment_bond : Raw_context.t -> Tez_repr.t + +val tx_rollup_finality_period : Raw_context.t -> int + +val tx_rollup_withdraw_period : Raw_context.t -> int + +val tx_rollup_max_inboxes_count : Raw_context.t -> int + +val tx_rollup_max_messages_per_inbox : Raw_context.t -> int + +val tx_rollup_max_commitments_count : Raw_context.t -> int + +val tx_rollup_cost_per_byte_ema_factor : Raw_context.t -> int + +val tx_rollup_max_ticket_payload_size : Raw_context.t -> int + +val tx_rollup_rejection_max_proof_size : Raw_context.t -> int + +val tx_rollup_sunset_level : Raw_context.t -> int32 + +val ratio_of_frozen_deposits_slashed_per_double_endorsement : + Raw_context.t -> Ratio_repr.t + +val testnet_dictator : Raw_context.t -> Signature.Public_key_hash.t option + +val minimal_block_delay : Raw_context.t -> Period_repr.t + +val delay_increment_per_round : Raw_context.t -> Period_repr.t + +val sc_rollup_enable : Raw_context.t -> bool + +val sc_rollup_origination_size : Raw_context.t -> int + +val sc_rollup_challenge_window_in_blocks : Raw_context.t -> int + +val sc_rollup_stake_amount : Raw_context.t -> Tez_repr.t + +val sc_rollup_commitment_period_in_blocks : Raw_context.t -> int + +val sc_rollup_max_lookahead_in_blocks : Raw_context.t -> int32 + +val sc_rollup_max_active_outbox_levels : Raw_context.t -> int32 + +val sc_rollup_max_outbox_messages_per_level : Raw_context.t -> int + +val sc_rollup_number_of_sections_in_dissection : Raw_context.t -> int + +val sc_rollup_max_number_of_parallel_games : Raw_context.t -> int + +val max_number_of_stored_cemented_commitments : Raw_context.t -> int + +val sc_rollup_timeout_period_in_blocks : Raw_context.t -> int + +val dal_number_of_slots : Raw_context.t -> int + +val dal_enable : Raw_context.t -> bool + +val zk_rollup_enable : Raw_context.t -> bool + +val zk_rollup_min_pending_to_process : Raw_context.t -> int + +val zk_rollup_origination_size : Raw_context.t -> int diff --git a/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.ml b/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.ml new file mode 100644 index 000000000000..18f243ec7446 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.ml @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Expected_binary_proof + +let () = + register_error_kind + `Permanent + ~id:"Expected_binary_proof" + ~title:"Expected binary proof" + ~description:"An invalid proof has been submitted" + Data_encoding.empty + (function Expected_binary_proof -> Some () | _ -> None) + (fun () -> Expected_binary_proof) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/4386 Extracted and + adapted from {!Tezos_context_memory}. Ideally, this function should + be exported there. + + In a nutshell, the context library exposed by the environment is + implemented such that it can verify proofs generated by both + [Context] and [Context_binary], and the only thing that + differentiate these proofs from its perspective is the second bit + of the [version] field of the proof. + + To ensure we only consider proofs computed against a binary tree, + we check said bit. This prevents a 32-ary proof to be accepted by + the protocol in the case where a given key-value store has the same + hash with both [Context] and [Context_binary] (something that + happens when the tree contains only one entry). *) +let check_is_binary proof = + let extract_bit v mask = Compare.Int.(v land mask <> 0) in + let binary_mask = 0b10 in + let is_binary = extract_bit proof.Context.Proof.version binary_mask in + error_unless is_binary Expected_binary_proof diff --git a/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.mli b/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.mli new file mode 100644 index 000000000000..2a2f10fb349b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/context_binary_proof.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Expected_binary_proof + +(** [is_binary proof] will fail if [proof] does not claim to be a + Merkle proof of a binary tree compatible with the one defined in + [Context_binary]. + + {b Note:} It is very important to systematically check this before + calling the [verify_proof] exposed in the protocol, since this + function does not discriminate between binary and 32-ary + proofs. *) +val check_is_binary : Context.Proof.tree Context.Proof.t -> unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.ml b/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.ml new file mode 100644 index 000000000000..2050e7bcacdc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.ml @@ -0,0 +1,77 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += (* `Permanent *) Forbidden_tz4_delegate of Bls.Public_key_hash.t + +let () = + register_error_kind + `Branch + ~id:"delegate.forbidden_tz4" + ~title:"Forbidden delegate" + ~description:"Delegates are forbidden to be tz4 (BLS) accounts." + ~pp:(fun ppf implicit -> + Format.fprintf + ppf + "The delegate %a is forbidden as it is a BLS public key hash." + Bls.Public_key_hash.pp + implicit) + Data_encoding.(obj1 (req "delegate" Bls.Public_key_hash.encoding)) + (function Forbidden_tz4_delegate d -> Some d | _ -> None) + (fun d -> Forbidden_tz4_delegate d) + +let check_not_tz4 : Signature.Public_key_hash.t -> unit tzresult = function + | Bls tz4 -> error (Forbidden_tz4_delegate tz4) + | Ed25519 _ | Secp256k1 _ | P256 _ -> Ok () + +let find = Storage.Contract.Delegate.find + +let init ctxt contract delegate = + check_not_tz4 delegate >>?= fun () -> + Storage.Contract.Delegate.init ctxt contract delegate >>=? fun ctxt -> + let delegate_contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegated.add (ctxt, delegate_contract) contract >|= ok + +let unlink ctxt contract = + Storage.Contract.Delegate.find ctxt contract >>=? function + | None -> return ctxt + | Some delegate -> + let delegate_contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegated.remove (ctxt, delegate_contract) contract + >|= ok + +let delete ctxt contract = + unlink ctxt contract >>=? fun ctxt -> + Storage.Contract.Delegate.remove ctxt contract >|= ok + +let set ctxt contract delegate = + check_not_tz4 delegate >>?= fun () -> + unlink ctxt contract >>=? fun ctxt -> + Storage.Contract.Delegate.add ctxt contract delegate >>= fun ctxt -> + let delegate_contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegated.add (ctxt, delegate_contract) contract >|= ok + +let delegated_contracts ctxt delegate = + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegated.elements (ctxt, contract) diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.mli b/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.mli new file mode 100644 index 000000000000..59131fb09b0c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_delegate_storage.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module deals with the delegates of a contract. It is + responsible for maintaining the tables {!Storage.Contract.Delegate} + and {!Storage.Contract.Delegated}. *) + +type error += + | (* `Permanent *) + Forbidden_tz4_delegate of Bls.Public_key_hash.t + (** Delegates cannot be tz4 accounts (i.e. BLS public key hashes). This + error is returned when we try to register such a delegate. *) + +(** [check_not_tz4 pkh] checks that [pkh] is not a BLS address. *) +val check_not_tz4 : Signature.public_key_hash -> unit tzresult + +(** [find ctxt contract] returns the delegate associated to [contract], or [None] + if [contract] has no delegate. *) +val find : + Raw_context.t -> + Contract_repr.t -> + Signature.Public_key_hash.t option tzresult Lwt.t + +(** [init ctxt contract delegate] sets the [delegate] associated to [contract]. + + This function assumes that [contract] does not have a delegate already. *) +val init : + Raw_context.t -> + Contract_repr.t -> + Signature.Public_key_hash.t -> + Raw_context.t tzresult Lwt.t + +(** [unlink ctxt contract] removes [contract] from the list of contracts that + delegated to [find ctxt contract], i.e. the output of [delegated_contracts]. + This function does not affect the value of the expression + [find ctxt contract]. + + This function assumes that [contract] is allocated. *) +val unlink : Raw_context.t -> Contract_repr.t -> Raw_context.t tzresult Lwt.t + +(** [delete ctxt contract] behaves as [unlink ctxt contract], but in addition + removes the association of the [contract] to its current delegate, leaving + the former without delegate. + + This function assumes that [contract] is allocated. *) +val delete : Raw_context.t -> Contract_repr.t -> Raw_context.t tzresult Lwt.t + +(** [set ctxt contract delegate] updates the [delegate] associated to [contract]. + + This function assumes that [contract] is allocated and has a delegate. *) +val set : + Raw_context.t -> + Contract_repr.t -> + Signature.Public_key_hash.t -> + Raw_context.t tzresult Lwt.t + +(** [delegated_contracts ctxt delegate] returns the list of contracts (implicit + or originated) that delegated to [delegate]. *) +val delegated_contracts : + Raw_context.t -> Signature.Public_key_hash.t -> Contract_repr.t list Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_hash.ml b/src/proto_016_PtMumbai/lib_protocol/contract_hash.ml new file mode 100644 index 000000000000..8583c1839303 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_hash.ml @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* 20 *) +let contract_hash = "\002\090\121" (* KT1(36) *) + +module H = + Blake2B.Make + (Base58) + (struct + let name = "Contract_hash" + + let title = "A contract ID" + + let b58check_prefix = contract_hash + + let size = Some 20 + end) + +include H +include Path_encoding.Make_hex (H) + +let () = Base58.check_encoded_prefix b58check_encoding "KT1" 36 + +let of_nonce nonce = + let data = + Data_encoding.Binary.to_bytes_exn Origination_nonce.encoding nonce + in + hash_bytes [data] diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_hash.mli b/src/proto_016_PtMumbai/lib_protocol/contract_hash.mli new file mode 100644 index 000000000000..45a9f23cdf32 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_hash.mli @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing contract identifiers. *) + +include S.HASH + +(** [of_nonce nonce] is the contract address originated from [nonce]. *) +val of_nonce : Origination_nonce.t -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.ml b/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.ml new file mode 100644 index 000000000000..a40e1aba1861 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.ml @@ -0,0 +1,164 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Branch *) Unrevealed_manager_key of Contract_repr.t + | (* `Permanent *) + Inconsistent_hash of { + public_key : Signature.Public_key.t; + expected_hash : Signature.Public_key_hash.t; + provided_hash : Signature.Public_key_hash.t; + } + | (* `Branch *) Previously_revealed_key of Contract_repr.t + | (* `Branch *) Missing_manager_contract of Contract_repr.t + +let () = + register_error_kind + `Branch + ~id:"contract.unrevealed_key" + ~title:"Manager operation precedes key revelation" + ~description: + "One tried to apply a manager operation without revealing the manager \ + public key" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "Unrevealed manager key for contract %a." + Contract_repr.pp + s) + Data_encoding.(obj1 (req "contract" Contract_repr.encoding)) + (function Unrevealed_manager_key s -> Some s | _ -> None) + (fun s -> Unrevealed_manager_key s) ; + register_error_kind + `Permanent + ~id:"contract.manager.inconsistent_hash" + ~title:"Inconsistent public key hash" + ~description: + "A revealed manager public key is inconsistent with the announced hash" + ~pp:(fun ppf (k, eh, ph) -> + Format.fprintf + ppf + "The hash of the manager public key %s is not %a as announced but %a" + (Signature.Public_key.to_b58check k) + Signature.Public_key_hash.pp + ph + Signature.Public_key_hash.pp + eh) + Data_encoding.( + obj3 + (req "public_key" Signature.Public_key.encoding) + (req "expected_hash" Signature.Public_key_hash.encoding) + (req "provided_hash" Signature.Public_key_hash.encoding)) + (function + | Inconsistent_hash {public_key; expected_hash; provided_hash} -> + Some (public_key, expected_hash, provided_hash) + | _ -> None) + (fun (public_key, expected_hash, provided_hash) -> + Inconsistent_hash {public_key; expected_hash; provided_hash}) ; + register_error_kind + `Branch + ~id:"contract.previously_revealed_key" + ~title:"Manager operation already revealed" + ~description:"One tried to reveal twice a manager public key" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "Previously revealed manager key for contract %a." + Contract_repr.pp + s) + Data_encoding.(obj1 (req "contract" Contract_repr.encoding)) + (function Previously_revealed_key s -> Some s | _ -> None) + (fun s -> Previously_revealed_key s) ; + register_error_kind + `Branch + ~id:"contract.missing_manager_contract" + ~title:"Missing manager contract" + ~description:"The manager contract is missing from the storage" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "The contract %a is missing from the storage." + Contract_repr.pp + s) + Data_encoding.(obj1 (req "contract" Contract_repr.encoding)) + (function Missing_manager_contract s -> Some s | _ -> None) + (fun s -> Missing_manager_contract s) + +let init = Storage.Contract.Manager.init + +let is_manager_key_revealed c manager = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Manager.find c contract >>=? function + | None -> return_false + | Some (Manager_repr.Hash _) -> return_false + | Some (Manager_repr.Public_key _) -> return_true + +let check_public_key public_key expected_hash = + let provided_hash = Signature.Public_key.hash public_key in + error_unless + (Signature.Public_key_hash.equal provided_hash expected_hash) + (Inconsistent_hash {public_key; expected_hash; provided_hash}) + +let reveal_manager_key ?(check_consistency = true) c manager public_key = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Manager.get c contract >>=? function + | Public_key _ -> tzfail (Previously_revealed_key contract) + | Hash expected_hash -> + (* Ensure that the manager is equal to the retrieved hash. *) + error_unless + (Signature.Public_key_hash.equal manager expected_hash) + (Inconsistent_hash {public_key; expected_hash; provided_hash = manager}) + >>?= fun () -> + (* TODO tezos/tezos#3078 + + We keep the consistency check and the optional argument to + preserve the semantics of reveal_manager_key prior to + tezos/tezos!5182, when called outside the scope of + [apply_operation]. + + Inside appply.ml, it is used with + ?check_consistency=false. Ultimately this parameter should go + away, and the split check_publick_key / reveal_manager_key + pattern has to be exported to usage outside apply.ml *) + when_ check_consistency (fun () -> + Lwt.return @@ check_public_key public_key expected_hash) + >>=? fun () -> + let pk = Manager_repr.Public_key public_key in + Storage.Contract.Manager.update c contract pk + +let get_manager_key ?error ctxt pkh = + let contract = Contract_repr.Implicit pkh in + Storage.Contract.Manager.find ctxt contract >>=? function + | None -> ( + match error with + | None -> tzfail (Missing_manager_contract contract) + | Some error -> tzfail error) + | Some (Manager_repr.Hash _) -> ( + match error with + | None -> tzfail (Unrevealed_manager_key contract) + | Some error -> tzfail error) + | Some (Manager_repr.Public_key pk) -> return pk + +let remove_existing = Storage.Contract.Manager.remove_existing diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.mli b/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.mli new file mode 100644 index 000000000000..6c3f74941dc3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_manager_storage.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Branch *) Unrevealed_manager_key of Contract_repr.t + | (* `Permanent *) + Inconsistent_hash of { + public_key : Signature.Public_key.t; + expected_hash : Signature.Public_key_hash.t; + provided_hash : Signature.Public_key_hash.t; + } + | (* `Branch *) Previously_revealed_key of Contract_repr.t + | (* `Branch *) Missing_manager_contract of Contract_repr.t + +(** [init ctxt contract manager] associates [manager] to [contract]. This + function is undefined if [contract] has already a manager associated to it. +*) +val init : + Raw_context.t -> + Contract_repr.t -> + Manager_repr.manager_key -> + Raw_context.t tzresult Lwt.t + +val is_manager_key_revealed : + Raw_context.t -> Signature.Public_key_hash.t -> bool tzresult Lwt.t + +(** [check_publick_key pk pkh] asserts that the provided [pk] is + consistent with the expected public key hash [pkh], otherwise + fails with an [Inconsistent_hash] error. *) +val check_public_key : + Signature.Public_key.t -> Signature.Public_key_hash.t -> unit tzresult + +(** [reveal_manager_key ?check_consistency ctxt manager pk] reveals + the public key [pk] for a given unrevealed [manager]. If the + optional [?check_consistency] flag is set (and it is set by + default), it will re-check the same consistency checks than + [check_public_key] above, otherwise it will assume [manager] is + indeed the hash of [pk]. It is expected to fail with + [Previously_revealed_key contract] if [manager] was already + revealed, and with [Inconsistent_hash] if the (unrevealed) [manager] + doesn't match the expected hash of the implicit contract associated + to [pk]. *) +val reveal_manager_key : + ?check_consistency:bool -> + Raw_context.t -> + Signature.Public_key_hash.t -> + Signature.Public_key.t -> + Raw_context.t tzresult Lwt.t + +(** [get_manager_key ?error ctxt pkh] returns the revealed manager key of the + contract represented by [pkh]. When [error] is not provided this function + fails with "get_manager_key" error if [pkh] does not have a manager, and + with [Unrevealed_manager_key] error if the manager has not revealed its key. + When [error] is provided, the function fails with the provided [error] in + both cases. *) +val get_manager_key : + ?error:error -> + Raw_context.t -> + Signature.Public_key_hash.t -> + Signature.Public_key.t tzresult Lwt.t + +val remove_existing : + Raw_context.t -> Contract_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_repr.ml b/src/proto_016_PtMumbai/lib_protocol/contract_repr.ml new file mode 100644 index 000000000000..43624de9dc71 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_repr.ml @@ -0,0 +1,233 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = + | Implicit of Signature.Public_key_hash.t + | Originated of Contract_hash.t + +include Compare.Make (struct + type nonrec t = t + + let compare l1 l2 = + match (l1, l2) with + | Implicit pkh1, Implicit pkh2 -> + Signature.Public_key_hash.compare pkh1 pkh2 + | Originated h1, Originated h2 -> Contract_hash.compare h1 h2 + | Implicit _, Originated _ -> -1 + | Originated _, Implicit _ -> 1 +end) + +let in_memory_size = + let open Cache_memory_helpers in + function + | Implicit _ -> h1w +! public_key_hash_in_memory_size + | Originated _ -> h1w +! blake2b_hash_size + +type error += Invalid_contract_notation of string (* `Permanent *) + +let to_b58check = function + | Implicit pbk -> Signature.Public_key_hash.to_b58check pbk + | Originated h -> Contract_hash.to_b58check h + +let implicit_of_b58data : Base58.data -> Signature.public_key_hash option = + function + | Ed25519.Public_key_hash.Data h -> Some (Signature.Ed25519 h) + | Secp256k1.Public_key_hash.Data h -> Some (Signature.Secp256k1 h) + | P256.Public_key_hash.Data h -> Some (Signature.P256 h) + | Bls.Public_key_hash.Data h -> Some (Signature.Bls h) + | _ -> None + +let originated_of_b58data = function + | Contract_hash.Data h -> Some h + | _ -> None + +let contract_of_b58data data = + match implicit_of_b58data data with + | Some pkh -> Some (Implicit pkh) + | None -> ( + match originated_of_b58data data with + | Some contract_hash -> Some (Originated contract_hash) + | None -> None) + +let of_b58check_gen ~of_b58data s = + match Base58.decode s with + | Some data -> ( + match of_b58data data with + | Some c -> ok c + | None -> error (Invalid_contract_notation s)) + | None -> error (Invalid_contract_notation s) + +let of_b58check = of_b58check_gen ~of_b58data:contract_of_b58data + +let pp ppf = function + | Implicit pbk -> Signature.Public_key_hash.pp ppf pbk + | Originated h -> Contract_hash.pp ppf h + +let pp_short ppf = function + | Implicit pbk -> Signature.Public_key_hash.pp_short ppf pbk + | Originated h -> Contract_hash.pp_short ppf h + +let implicit_case ~proj ~inj = + let open Data_encoding in + case (Tag 0) ~title:"Implicit" Signature.Public_key_hash.encoding proj inj + +let originated_case ~proj ~inj = + let open Data_encoding in + case + (Tag 1) + (Fixed.add_padding Contract_hash.encoding 1) + ~title:"Originated" + proj + inj + +let cases is_contract to_contract = + [ + implicit_case + ~proj:(fun k -> + match is_contract k with Some (Implicit k) -> Some k | _ -> None) + ~inj:(fun k -> to_contract (Implicit k)); + originated_case + ~proj:(fun k -> + match is_contract k with Some (Originated k) -> Some k | _ -> None) + ~inj:(fun k -> to_contract (Originated k)); + ] + +let encoding_gen ~id_extra ~title_extra ~can_be ~cases ~to_b58check ~of_b58data + = + let open Data_encoding in + def + ("contract_id" ^ id_extra) + ~title:("A contract handle" ^ title_extra) + ~description: + ("A contract notation as given to an RPC or inside scripts. Can be a \ + base58 " ^ can_be) + @@ splitted + ~binary:(union ~tag_size:`Uint8 @@ cases (fun x -> Some x) (fun x -> x)) + ~json: + (conv + to_b58check + (fun s -> + match of_b58check_gen ~of_b58data s with + | Ok s -> s + | Error _ -> Json.cannot_destruct "Invalid contract notation.") + (string Plain)) + +let encoding = + encoding_gen + ~id_extra:"" + ~title_extra:"" + ~can_be:"implicit contract hash or a base58 originated contract hash." + ~cases + ~to_b58check + ~of_b58data:contract_of_b58data + +let implicit_encoding = + encoding_gen + ~id_extra:".implicit" + ~title_extra:" -- implicit account" + ~can_be:"implicit contract hash." + ~cases:(fun proj inj -> [implicit_case ~proj ~inj]) + ~to_b58check:Signature.Public_key_hash.to_b58check + ~of_b58data:implicit_of_b58data + +let originated_encoding = + encoding_gen + ~id_extra:".originated" + ~title_extra:" -- originated account" + ~can_be:"originated contract hash." + ~cases:(fun proj inj -> [originated_case ~proj ~inj]) + ~to_b58check:Contract_hash.to_b58check + ~of_b58data:originated_of_b58data + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"contract.invalid_contract_notation" + ~title:"Invalid contract notation" + ~pp:(fun ppf x -> Format.fprintf ppf "Invalid contract notation %S" x) + ~description: + "A malformed contract notation was given to an RPC or in a script." + (obj1 (req "notation" (string Plain))) + (function Invalid_contract_notation loc -> Some loc | _ -> None) + (fun loc -> Invalid_contract_notation loc) + +let originated_contract nonce = Originated (Contract_hash.of_nonce nonce) + +let originated_contracts + ~since: + Origination_nonce.{origination_index = first; operation_hash = first_hash} + ~until: + (Origination_nonce.{origination_index = last; operation_hash = last_hash} + as origination_nonce) = + assert (Operation_hash.equal first_hash last_hash) ; + let rec contracts acc origination_index = + if Compare.Int32.(origination_index < first) then acc + else + let origination_nonce = {origination_nonce with origination_index} in + let acc = Contract_hash.of_nonce origination_nonce :: acc in + contracts acc (Int32.pred origination_index) + in + contracts [] (Int32.pred last) + +let rpc_arg = + let construct = to_b58check in + let destruct hash = + Result.map_error (fun _ -> "Cannot parse contract id") (of_b58check hash) + in + RPC_arg.make + ~descr:"A contract identifier encoded in b58check." + ~name:"contract_id" + ~construct + ~destruct + () + +module Index = struct + type nonrec t = t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt encoding) + | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end + +(* Renamed exports. *) + +let of_b58data = contract_of_b58data diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_repr.mli b/src/proto_016_PtMumbai/lib_protocol/contract_repr.mli new file mode 100644 index 000000000000..61d57acf48a1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_repr.mli @@ -0,0 +1,97 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines identifiers for two basic types of contracts. It also + specifies how to compute originated contract's hash from origination + nonce. *) + +(** A contract is simply an account on the blockchain ledger. There are two + types of contracts: + - implicit contracts represent accounts of users of the blockchain; + - originated are special accounts with a Michelson script attached to + them. Every time a transaction is sent to an originated account, its + associated script is run in order to trigger some action in response. + + An implicit account is identified by the hash of the public key which was + used to create it. The owner of the corresponding private key is the + holder of the account. An originated contract's hash is derived from its + origination nonce (see below). *) +type t = + | Implicit of Signature.Public_key_hash.t + | Originated of Contract_hash.t + +include Compare.S with type t := t + +val in_memory_size : t -> Cache_memory_helpers.sint + +(** {2 Originated contracts} *) + +(** [originated_contract nonce] is the contract address originated from [nonce]. +*) +val originated_contract : Origination_nonce.t -> t + +(** [originated_contracts ~since ~until] is the contract addresses originated + from [since] until [until]. The operation hash of nonce [since] and [until] + must be the same or it will fail with an [assert]. [since] < [until] or the + returned list is empty *) +val originated_contracts : + since:Origination_nonce.t -> until:Origination_nonce.t -> Contract_hash.t list + +(** {2 Human readable notation} *) + +type error += Invalid_contract_notation of string (* `Permanent *) + +val to_b58check : t -> string + +val of_b58check : string -> t tzresult + +val of_b58data : Base58.data -> t option + +val pp : Format.formatter -> t -> unit + +val pp_short : Format.formatter -> t -> unit + +(** {2 Serializers} *) + +val encoding : t Data_encoding.t + +(** [implicit_encoding] is an encoding for public key hashes that is + compatible with the [encoding] of contracts for implicit accounts. *) +val implicit_encoding : Signature.Public_key_hash.t Data_encoding.t + +(** [originated_encoding] is an encoding for contract hashes that is + compatible with the [encoding] of contracts for originated accounts. *) +val originated_encoding : Contract_hash.t Data_encoding.t + +(** [cases f g] exports the {!Data_encoding.cases} used to define {!encoding}. + + The only reason why we export that is to let {!Destination_repr.encoding} + use it. This allows the latter to be compatible with {!encoding}, which + is of key importance for backward compatibility reasons. *) +val cases : ('a -> t option) -> (t -> 'a) -> 'a Data_encoding.case list + +val rpc_arg : t RPC_arg.arg + +module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_services.ml b/src/proto_016_PtMumbai/lib_protocol/contract_services.ml new file mode 100644 index 000000000000..0708612f1b4c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_services.ml @@ -0,0 +1,653 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let custom_root = + (RPC_path.(open_root / "context" / "contracts") + : RPC_context.t RPC_path.context) + +let big_map_root = + (RPC_path.(open_root / "context" / "big_maps") + : RPC_context.t RPC_path.context) + +type info = { + balance : Tez.t; + delegate : public_key_hash option; + counter : Manager_counter.t option; + script : Script.t option; +} + +let info_encoding = + let open Data_encoding in + conv + (fun {balance; delegate; script; counter} -> + (balance, delegate, script, counter)) + (fun (balance, delegate, script, counter) -> + {balance; delegate; script; counter}) + @@ obj4 + (req "balance" Tez.encoding) + (opt "delegate" Signature.Public_key_hash.encoding) + (opt "script" Script.encoding) + (opt "counter" Manager_counter.encoding_for_RPCs) + +let legacy = Script_ir_translator_config.make ~legacy:true () + +module S = struct + open Data_encoding + + let balance = + RPC_service.get_service + ~description: + "Access the spendable balance of a contract, excluding frozen bonds." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(custom_root /: Contract.rpc_arg / "balance") + + let frozen_bonds = + RPC_service.get_service + ~description:"Access the frozen bonds of a contract." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(custom_root /: Contract.rpc_arg / "frozen_bonds") + + let balance_and_frozen_bonds = + RPC_service.get_service + ~description: + "Access the sum of the spendable balance and frozen bonds of a \ + contract. This sum is part of the contract's stake, and it is exactly \ + the contract's stake if the contract is not a delegate." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(custom_root /: Contract.rpc_arg / "balance_and_frozen_bonds") + + let manager_key = + RPC_service.get_service + ~description:"Access the manager of an implicit contract." + ~query:RPC_query.empty + ~output:(option Signature.Public_key.encoding) + RPC_path.(custom_root /: Contract.rpc_arg / "manager_key") + + let delegate = + RPC_service.get_service + ~description:"Access the delegate of a contract, if any." + ~query:RPC_query.empty + ~output:Signature.Public_key_hash.encoding + RPC_path.(custom_root /: Contract.rpc_arg / "delegate") + + let counter = + RPC_service.get_service + ~description:"Access the counter of a contract, if any." + ~query:RPC_query.empty + ~output:Manager_counter.encoding_for_RPCs + RPC_path.(custom_root /: Contract.rpc_arg / "counter") + + let script = + RPC_service.get_service + ~description:"Access the code and data of the contract." + ~query:RPC_query.empty + ~output:Script.encoding + RPC_path.(custom_root /: Contract.rpc_arg / "script") + + let storage = + RPC_service.get_service + ~description:"Access the data of the contract." + ~query:RPC_query.empty + ~output:Script.expr_encoding + RPC_path.(custom_root /: Contract.rpc_arg / "storage") + + type normalize_types_query = {normalize_types : bool} + + let normalize_types_query : normalize_types_query RPC_query.t = + let open RPC_query in + query (fun normalize_types -> {normalize_types}) + |+ flag + ~descr: + "Whether types should be normalized (annotations removed, combs \ + flattened) or kept as they appeared in the original script." + "normalize_types" + (fun t -> t.normalize_types) + |> seal + + let entrypoint_type = + RPC_service.get_service + ~description:"Return the type of the given entrypoint of the contract" + ~query:normalize_types_query + ~output:Script.expr_encoding + RPC_path.( + custom_root /: Contract.rpc_arg / "entrypoints" /: Entrypoint.rpc_arg) + + let list_entrypoints = + RPC_service.get_service + ~description:"Return the list of entrypoints of the contract" + ~query:normalize_types_query + ~output: + (obj2 + (dft + "unreachable" + (Data_encoding.list + (obj1 + (req + "path" + (Data_encoding.list + Michelson_v1_primitives.prim_encoding)))) + []) + (req "entrypoints" (assoc Script.expr_encoding))) + RPC_path.(custom_root /: Contract.rpc_arg / "entrypoints") + + let contract_big_map_get_opt = + RPC_service.post_service + ~description: + "Access the value associated with a key in a big map of the contract \ + (deprecated)." + ~query:RPC_query.empty + ~input: + (obj2 + (req "key" Script.expr_encoding) + (req "type" Script.expr_encoding)) + ~output:(option Script.expr_encoding) + RPC_path.(custom_root /: Contract.rpc_arg / "big_map_get") + + let big_map_get = + RPC_service.get_service + ~description:"Access the value associated with a key in a big map." + ~query:RPC_query.empty + ~output:Script.expr_encoding + RPC_path.(big_map_root /: Big_map.Id.rpc_arg /: Script_expr_hash.rpc_arg) + + type big_map_get_all_query = {offset : int option; length : int option} + + let rpc_arg_uint : int RPC_arg.t = + let int_of_string s = + int_of_string_opt s + |> Option.to_result + ~none:(Format.sprintf "Cannot parse integer value %s" s) + >>? fun i -> + if Compare.Int.(i < 0) then + Error (Format.sprintf "Negative integer: %d" i) + else Ok i + in + RPC_arg.make + ~name:"uint" + ~descr:"A non-negative integer (greater than or equal to 0)." + ~destruct:int_of_string + ~construct:string_of_int + () + + let big_map_get_all_query : big_map_get_all_query RPC_query.t = + let open RPC_query in + query (fun offset length -> {offset; length}) + |+ opt_field + ~descr: + "Skip the first [offset] values. Useful in combination with \ + [length] for pagination." + "offset" + rpc_arg_uint + (fun t -> t.offset) + |+ opt_field + ~descr: + "Only retrieve [length] values. Useful in combination with [offset] \ + for pagination." + "length" + rpc_arg_uint + (fun t -> t.length) + |> seal + + let big_map_get_all = + RPC_service.get_service + ~description: + "Get the (optionally paginated) list of values in a big map. Order of \ + values is unspecified, but is guaranteed to be consistent." + ~query:big_map_get_all_query + ~output:(list Script.expr_encoding) + RPC_path.(big_map_root /: Big_map.Id.rpc_arg) + + let info = + RPC_service.get_service + ~description:"Access the complete status of a contract." + ~query:normalize_types_query + ~output:info_encoding + RPC_path.(custom_root /: Contract.rpc_arg) + + let list = + RPC_service.get_service + ~description: + "All existing contracts (excluding empty implicit contracts)." + ~query:RPC_query.empty + ~output:(list Contract.encoding) + custom_root + + module Sapling = struct + (* + Sapling: these RPCs are like Sapling RPCs (sapling_services.ml) + specialized for contracts containing a single sapling state. + *) + + let single_sapling_get_id ctxt contract_id = + Contract.get_script ctxt contract_id >>=? fun (ctxt, script) -> + match script with + | None -> return (None, ctxt) + | Some script -> + let ctxt = Gas.set_unlimited ctxt in + Script_ir_translator.parse_script + ctxt + ~elab_conf:legacy + ~allow_forged_in_storage:true + script + >|= fun tzresult -> + tzresult >>? fun (Ex_script (Script script), ctxt) -> + Script_ir_translator.get_single_sapling_state + ctxt + script.storage_type + script.storage + + let make_service + Sapling_services.S.Args.{name; description; query; output; f} = + let name = "single_sapling_" ^ name in + let path = RPC_path.(custom_root /: Contract.rpc_arg / name) in + let service = RPC_service.get_service ~description ~query ~output path in + ( service, + fun ctxt contract_id q () -> + match (contract_id : Contract.t) with + | Implicit _ -> return_none + | Originated contract_id -> + single_sapling_get_id ctxt contract_id + >>=? fun (sapling_id, ctxt) -> + Option.map_es (fun sapling_id -> f ctxt sapling_id q) sapling_id + ) + + let get_diff = make_service Sapling_services.S.Args.get_diff + + let register () = + let reg chunked (service, f) = + Services_registration.opt_register1 ~chunked service f + in + reg false get_diff + + let mk_call1 (service, _f) ctxt block id q = + RPC_context.make_call1 service ctxt block id q () + end +end + +let register () = + let open Services_registration in + register0 ~chunked:true S.list (fun ctxt () () -> Contract.list ctxt >|= ok) ; + let register_field_gen ~filter_contract ~wrap_result ~chunked s f = + opt_register1 ~chunked s (fun ctxt contract () () -> + filter_contract contract @@ fun filtered_contract -> + Contract.exists ctxt contract >>= function + | true -> f ctxt filtered_contract |> wrap_result + | false -> return_none) + in + let register_field_with_query_gen ~filter_contract ~wrap_result ~chunked s f = + opt_register1 ~chunked s (fun ctxt contract query () -> + filter_contract contract @@ fun filtered_contract -> + Contract.exists ctxt contract >>= function + | true -> f ctxt filtered_contract query |> wrap_result + | false -> return_none) + in + let register_field s = + register_field_gen + ~filter_contract:(fun c k -> k c) + ~wrap_result:(fun res -> res >|=? Option.some) + s + in + let register_field_with_query s = + register_field_with_query_gen + ~filter_contract:(fun c k -> k c) + ~wrap_result:(fun res -> res >|=? Option.some) + s + in + let register_opt_field s = + register_field_gen + ~filter_contract:(fun c k -> k c) + ~wrap_result:(fun res -> res) + s + in + let register_originated_opt_field s = + register_field_gen + ~filter_contract:(fun c k -> + match (c : Contract.t) with + | Implicit _ -> return_none + | Originated c -> k c) + ~wrap_result:(fun res -> res) + s + in + let do_big_map_get ctxt id key = + let open Script_ir_translator in + let ctxt = Gas.set_unlimited ctxt in + Big_map.exists ctxt id >>=? fun (ctxt, types) -> + match types with + | None -> return_none + | Some (_, value_type) -> ( + parse_big_map_value_ty ctxt ~legacy:true (Micheline.root value_type) + >>?= fun (Ex_ty value_type, ctxt) -> + Big_map.get_opt ctxt id key >>=? fun (_ctxt, value) -> + match value with + | None -> return_none + | Some value -> + parse_data + ctxt + ~elab_conf:legacy + ~allow_forged:true + value_type + (Micheline.root value) + >>=? fun (value, ctxt) -> + unparse_data ctxt Readable value_type value + >|=? fun (value, _ctxt) -> Some value) + in + let do_big_map_get_all ?offset ?length ctxt id = + let open Script_ir_translator in + let ctxt = Gas.set_unlimited ctxt in + Big_map.exists ctxt id >>=? fun (ctxt, types) -> + match types with + | None -> raise Not_found + | Some (_, value_type) -> + parse_big_map_value_ty ctxt ~legacy:true (Micheline.root value_type) + >>?= fun (Ex_ty value_type, ctxt) -> + Big_map.list_key_values ?offset ?length ctxt id + >>=? fun (ctxt, key_values) -> + List.fold_left_s + (fun acc (_key_hash, value) -> + acc >>?= fun (ctxt, rev_values) -> + parse_data + ctxt + ~elab_conf:legacy + ~allow_forged:true + value_type + (Micheline.root value) + >>=? fun (value, ctxt) -> + unparse_data ctxt Readable value_type value + >|=? fun (value, ctxt) -> (ctxt, value :: rev_values)) + (Ok (ctxt, [])) + key_values + >|=? fun (_ctxt, rev_values) -> List.rev rev_values + in + register_field ~chunked:false S.balance Contract.get_balance ; + register_field ~chunked:false S.frozen_bonds Contract.get_frozen_bonds ; + register_field + ~chunked:false + S.balance_and_frozen_bonds + Contract.get_balance_and_frozen_bonds ; + opt_register1 ~chunked:false S.manager_key (fun ctxt contract () () -> + match contract with + | Originated _ -> return_none + | Implicit mgr -> ( + Contract.is_manager_key_revealed ctxt mgr >>=? function + | false -> return_some None + | true -> + Contract.get_manager_key ctxt mgr >|=? fun key -> Some (Some key))) ; + register_opt_field ~chunked:false S.delegate Contract.Delegate.find ; + opt_register1 ~chunked:false S.counter (fun ctxt contract () () -> + match contract with + | Originated _ -> return_none + | Implicit mgr -> + Contract.get_counter ctxt mgr >|=? fun counter -> Some counter) ; + register_originated_opt_field ~chunked:true S.script (fun c v -> + Contract.get_script c v >|=? fun (_, v) -> v) ; + register_originated_opt_field ~chunked:true S.storage (fun ctxt contract -> + Contract.get_script ctxt contract >>=? fun (ctxt, script) -> + match script with + | None -> return_none + | Some script -> + let ctxt = Gas.set_unlimited ctxt in + let open Script_ir_translator in + parse_script + ctxt + ~elab_conf:legacy + ~allow_forged_in_storage:true + script + >>=? fun (Ex_script (Script {storage; storage_type; _}), ctxt) -> + unparse_data ctxt Readable storage_type storage + >|=? fun (storage, _ctxt) -> Some storage) ; + opt_register2 + ~chunked:true + S.entrypoint_type + (fun ctxt v entrypoint {normalize_types} () -> + match (v : Contract.t) with + | Implicit _ -> return_none + | Originated v -> ( + Contract.get_script_code ctxt v >>=? fun (_, expr) -> + match expr with + | None -> return_none + | Some expr -> + let ctxt = Gas.set_unlimited ctxt in + let legacy = true in + let open Script_ir_translator in + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + expr + >>?= fun (expr, _) -> + parse_toplevel ctxt ~legacy expr >>=? fun ({arg_type; _}, ctxt) -> + Lwt.return + ( parse_parameter_ty_and_entrypoints ctxt ~legacy arg_type + >>? fun ( Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, + _ ) -> + Gas_monad.run ctxt + @@ Script_ir_translator.find_entrypoint + ~error_details:(Informative ()) + arg_type + entrypoints + entrypoint + >>? fun (r, ctxt) -> + r |> function + | Ok (Ex_ty_cstr {ty; original_type_expr; _}) -> + if normalize_types then + Script_ir_unparser.unparse_ty ~loc:() ctxt ty + >|? fun (ty_node, _ctxt) -> + Some (Micheline.strip_locations ty_node) + else + ok (Some (Micheline.strip_locations original_type_expr)) + | Error _ -> Result.return_none ))) ; + opt_register1 + ~chunked:true + S.list_entrypoints + (fun ctxt v {normalize_types} () -> + match (v : Contract.t) with + | Implicit _ -> return_none + | Originated v -> ( + Contract.get_script_code ctxt v >>=? fun (_, expr) -> + match expr with + | None -> return_none + | Some expr -> + let ctxt = Gas.set_unlimited ctxt in + let legacy = true in + let open Script_ir_translator in + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + expr + >>?= fun (expr, _) -> + parse_toplevel ctxt ~legacy expr >>=? fun ({arg_type; _}, ctxt) -> + Lwt.return + ( parse_parameter_ty_and_entrypoints ctxt ~legacy arg_type + >>? fun ( Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, + _ ) -> + let unreachable_entrypoint, map = + Script_ir_translator.list_entrypoints_uncarbonated + arg_type + entrypoints + in + Entrypoint.Map.fold_e + (fun entry + (Script_typed_ir.Ex_ty ty, original_type_expr) + (acc, ctxt) -> + (if normalize_types then + Script_ir_unparser.unparse_ty ~loc:() ctxt ty + >|? fun (ty_node, ctxt) -> + (Micheline.strip_locations ty_node, ctxt) + else + ok (Micheline.strip_locations original_type_expr, ctxt)) + >|? fun (ty_expr, ctxt) -> + ((Entrypoint.to_string entry, ty_expr) :: acc, ctxt)) + map + ([], ctxt) + >|? fun (entrypoint_types, _ctxt) -> + Some (unreachable_entrypoint, entrypoint_types) ))) ; + opt_register1 + ~chunked:true + S.contract_big_map_get_opt + (fun ctxt contract () (key, key_type) -> + match (contract : Contract.t) with + | Implicit _ -> return_none + | Originated contract -> ( + Contract.get_script ctxt contract >>=? fun (ctxt, script) -> + let key_type_node = Micheline.root key_type in + Script_ir_translator.parse_comparable_ty ctxt key_type_node + >>?= fun (Ex_comparable_ty key_type, ctxt) -> + Script_ir_translator.parse_comparable_data + ctxt + key_type + (Micheline.root key) + >>=? fun (key, ctxt) -> + Script_ir_translator.hash_comparable_data ctxt key_type key + >>=? fun (key, ctxt) -> + match script with + | None -> return_none + | Some script -> ( + let ctxt = Gas.set_unlimited ctxt in + let open Script_ir_translator in + parse_script + ctxt + ~elab_conf:legacy + ~allow_forged_in_storage:true + script + >>=? fun (Ex_script (Script script), ctxt) -> + Script_ir_translator.collect_lazy_storage + ctxt + script.storage_type + script.storage + >>?= fun (ids, _ctxt) -> + match Script_ir_translator.list_of_big_map_ids ids with + | [] | _ :: _ :: _ -> return_some None + | [id] -> do_big_map_get ctxt id key >|=? Option.some))) ; + opt_register2 ~chunked:true S.big_map_get (fun ctxt id key () () -> + do_big_map_get ctxt id key) ; + register1 ~chunked:true S.big_map_get_all (fun ctxt id {offset; length} () -> + do_big_map_get_all ?offset ?length ctxt id) ; + register_field_with_query + ~chunked:false + S.info + (fun ctxt contract {normalize_types} -> + Contract.get_balance ctxt contract >>=? fun balance -> + Contract.Delegate.find ctxt contract >>=? fun delegate -> + match contract with + | Implicit manager -> + Contract.get_counter ctxt manager >|=? fun counter -> + {balance; delegate; script = None; counter = Some counter} + | Originated contract -> ( + Contract.get_script ctxt contract >>=? fun (ctxt, script) -> + match script with + | None -> return {balance; delegate; script = None; counter = None} + | Some script -> + let ctxt = Gas.set_unlimited ctxt in + Script_ir_translator.parse_and_unparse_script_unaccounted + ctxt + ~legacy:true + ~allow_forged_in_storage:true + Readable + ~normalize_types + script + >|=? fun (script, _ctxt) -> + {balance; delegate; script = Some script; counter = None})) ; + S.Sapling.register () + +let list ctxt block = RPC_context.make_call0 S.list ctxt block () () + +let info ctxt block contract ~normalize_types = + RPC_context.make_call1 S.info ctxt block contract {normalize_types} () + +let balance ctxt block contract = + RPC_context.make_call1 S.balance ctxt block contract () () + +let frozen_bonds ctxt block contract = + RPC_context.make_call1 S.frozen_bonds ctxt block contract () () + +let balance_and_frozen_bonds ctxt block contract = + RPC_context.make_call1 S.balance_and_frozen_bonds ctxt block contract () () + +let manager_key ctxt block mgr = + RPC_context.make_call1 S.manager_key ctxt block (Contract.Implicit mgr) () () + +let delegate ctxt block contract = + RPC_context.make_call1 S.delegate ctxt block contract () () + +let delegate_opt ctxt block contract = + RPC_context.make_opt_call1 S.delegate ctxt block contract () () + +let counter ctxt block mgr = + RPC_context.make_call1 S.counter ctxt block (Contract.Implicit mgr) () () + +let script ctxt block contract = + let contract = Contract.Originated contract in + RPC_context.make_call1 S.script ctxt block contract () () + +let script_opt ctxt block contract = + let contract = Contract.Originated contract in + RPC_context.make_opt_call1 S.script ctxt block contract () () + +let storage ctxt block contract = + let contract = Contract.Originated contract in + RPC_context.make_call1 S.storage ctxt block contract () () + +let entrypoint_type ctxt block contract entrypoint ~normalize_types = + RPC_context.make_call2 + S.entrypoint_type + ctxt + block + (Contract.Originated contract) + entrypoint + {normalize_types} + () + +let list_entrypoints ctxt block contract ~normalize_types = + RPC_context.make_call1 + S.list_entrypoints + ctxt + block + (Contract.Originated contract) + {normalize_types} + () + +let storage_opt ctxt block contract = + let contract = Contract.Originated contract in + RPC_context.make_opt_call1 S.storage ctxt block contract () () + +let big_map_get ctxt block id key = + RPC_context.make_call2 S.big_map_get ctxt block id key () () + +let contract_big_map_get_opt ctxt block contract key = + let contract = Contract.Originated contract in + RPC_context.make_call1 S.contract_big_map_get_opt ctxt block contract () key + +let single_sapling_get_diff ctxt block id ?offset_commitment ?offset_nullifier + () = + S.Sapling.(mk_call1 get_diff) + ctxt + block + (Contract.Originated id) + Sapling_services.{offset_commitment; offset_nullifier} diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_services.mli b/src/proto_016_PtMumbai/lib_protocol/contract_services.mli new file mode 100644 index 000000000000..7ea8996b24ab --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_services.mli @@ -0,0 +1,148 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines RPC services to access the information associated to + contracts (balance, delegate, script, etc.). +*) + +open Alpha_context + +val list : 'a #RPC_context.simple -> 'a -> Contract.t list shell_tzresult Lwt.t + +type info = { + balance : Tez.t; + delegate : public_key_hash option; + counter : Manager_counter.t option; + script : Script.t option; +} + +val info_encoding : info Data_encoding.t + +val info : + 'a #RPC_context.simple -> + 'a -> + Contract.t -> + normalize_types:bool -> + info shell_tzresult Lwt.t + +val balance : + 'a #RPC_context.simple -> 'a -> Contract.t -> Tez.t shell_tzresult Lwt.t + +val frozen_bonds : + 'a #RPC_context.simple -> 'a -> Contract.t -> Tez.t shell_tzresult Lwt.t + +val balance_and_frozen_bonds : + 'a #RPC_context.simple -> 'a -> Contract.t -> Tez.t shell_tzresult Lwt.t + +val manager_key : + 'a #RPC_context.simple -> + 'a -> + public_key_hash -> + public_key option shell_tzresult Lwt.t + +val delegate : + 'a #RPC_context.simple -> + 'a -> + Contract.t -> + public_key_hash shell_tzresult Lwt.t + +val delegate_opt : + 'a #RPC_context.simple -> + 'a -> + Contract.t -> + public_key_hash option shell_tzresult Lwt.t + +val counter : + 'a #RPC_context.simple -> + 'a -> + public_key_hash -> + Manager_counter.t shell_tzresult Lwt.t + +val script : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Script.t shell_tzresult Lwt.t + +val script_opt : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Script.t option shell_tzresult Lwt.t + +val storage : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Script.expr shell_tzresult Lwt.t + +val entrypoint_type : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Entrypoint.t -> + normalize_types:bool -> + Script.expr shell_tzresult Lwt.t + +val list_entrypoints : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + normalize_types:bool -> + (Michelson_v1_primitives.prim list list * (string * Script.expr) list) + shell_tzresult + Lwt.t + +val storage_opt : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Script.expr option shell_tzresult Lwt.t + +val big_map_get : + 'a #RPC_context.simple -> + 'a -> + Big_map.Id.t -> + Script_expr_hash.t -> + Script.expr shell_tzresult Lwt.t + +val contract_big_map_get_opt : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + Script.expr * Script.expr -> + Script.expr option shell_tzresult Lwt.t + +val single_sapling_get_diff : + 'a #RPC_context.simple -> + 'a -> + Contract_hash.t -> + ?offset_commitment:int64 -> + ?offset_nullifier:int64 -> + unit -> + (Sapling.root * Sapling.diff) shell_tzresult Lwt.t + +val register : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_storage.ml b/src/proto_016_PtMumbai/lib_protocol/contract_storage.ml new file mode 100644 index 000000000000..324b38ac02c0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_storage.ml @@ -0,0 +1,792 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Temporary *) + Balance_too_low of Contract_repr.t * Tez_repr.t * Tez_repr.t + | (* `Temporary *) + Counter_in_the_past of { + contract : Contract_repr.t; + expected : Manager_counter_repr.t; + found : Manager_counter_repr.t; + } + | (* `Branch *) + Counter_in_the_future of { + contract : Contract_repr.t; + expected : Manager_counter_repr.t; + found : Manager_counter_repr.t; + } + | (* `Temporary *) + Non_existing_contract of Contract_repr.t + | (* `Branch *) + Empty_implicit_contract of Signature.Public_key_hash.t + | (* `Branch *) + Empty_implicit_delegated_contract of + Signature.Public_key_hash.t + | (* `Permanent *) + Inconsistent_public_key of + Signature.Public_key.t * Signature.Public_key.t + | (* `Permanent *) Failure of string + +type error += + | (* `Permanent *) + Frozen_bonds_must_be_spent_at_once of + Contract_repr.t * Bond_id_repr.t + +let () = + register_error_kind + `Temporary + ~id:"contract.balance_too_low" + ~title:"Balance too low" + ~description:"An operation tried to spend more tokens than the contract has" + ~pp:(fun ppf (c, b, a) -> + Format.fprintf + ppf + "Balance of contract %a too low (%a) to spend %a" + Contract_repr.pp + c + Tez_repr.pp + b + Tez_repr.pp + a) + Data_encoding.( + obj3 + (req "contract" Contract_repr.encoding) + (req "balance" Tez_repr.encoding) + (req "amount" Tez_repr.encoding)) + (function Balance_too_low (c, b, a) -> Some (c, b, a) | _ -> None) + (fun (c, b, a) -> Balance_too_low (c, b, a)) ; + register_error_kind + `Temporary + ~id:"contract.counter_in_the_future" + ~title:"Invalid counter (not yet reached) in a manager operation" + ~description:"An operation assumed a contract counter in the future" + ~pp:(fun ppf (contract, exp, found) -> + Format.fprintf + ppf + "Counter %a not yet reached for contract %a (expected %a)" + Manager_counter_repr.pp + found + Contract_repr.pp + contract + Manager_counter_repr.pp + exp) + Data_encoding.( + obj3 + (req "contract" Contract_repr.encoding) + (req "expected" Manager_counter_repr.encoding_for_errors) + (req "found" Manager_counter_repr.encoding_for_errors)) + (function + | Counter_in_the_future {contract; expected; found} -> + Some (contract, expected, found) + | _ -> None) + (fun (contract, expected, found) -> + Counter_in_the_future {contract; expected; found}) ; + register_error_kind + `Branch + ~id:"contract.counter_in_the_past" + ~title:"Invalid counter (already used) in a manager operation" + ~description:"An operation assumed a contract counter in the past" + ~pp:(fun ppf (contract, exp, found) -> + Format.fprintf + ppf + "Counter %a already used for contract %a (expected %a)" + Manager_counter_repr.pp + found + Contract_repr.pp + contract + Manager_counter_repr.pp + exp) + Data_encoding.( + obj3 + (req "contract" Contract_repr.encoding) + (req "expected" Manager_counter_repr.encoding_for_errors) + (req "found" Manager_counter_repr.encoding_for_errors)) + (function + | Counter_in_the_past {contract; expected; found} -> + Some (contract, expected, found) + | _ -> None) + (fun (contract, expected, found) -> + Counter_in_the_past {contract; expected; found}) ; + register_error_kind + `Temporary + ~id:"contract.non_existing_contract" + ~title:"Non existing contract" + ~description: + "A contract handle is not present in the context (either it never was or \ + it has been destroyed)" + ~pp:(fun ppf contract -> + Format.fprintf ppf "Contract %a does not exist" Contract_repr.pp contract) + Data_encoding.(obj1 (req "contract" Contract_repr.encoding)) + (function Non_existing_contract c -> Some c | _ -> None) + (fun c -> Non_existing_contract c) ; + register_error_kind + `Permanent + ~id:"contract.manager.inconsistent_public_key" + ~title:"Inconsistent public key" + ~description: + "A provided manager public key is different with the public key stored \ + in the contract" + ~pp:(fun ppf (eh, ph) -> + Format.fprintf + ppf + "Expected manager public key %s but %s was provided" + (Signature.Public_key.to_b58check ph) + (Signature.Public_key.to_b58check eh)) + Data_encoding.( + obj2 + (req "public_key" Signature.Public_key.encoding) + (req "expected_public_key" Signature.Public_key.encoding)) + (function Inconsistent_public_key (eh, ph) -> Some (eh, ph) | _ -> None) + (fun (eh, ph) -> Inconsistent_public_key (eh, ph)) ; + register_error_kind + `Permanent + ~id:"contract.failure" + ~title:"Contract storage failure" + ~description:"Unexpected contract storage error" + ~pp:(fun ppf s -> Format.fprintf ppf "Contract_storage.Failure %S" s) + Data_encoding.(obj1 (req "message" @@ string Plain)) + (function Failure s -> Some s | _ -> None) + (fun s -> Failure s) ; + register_error_kind + `Branch + ~id:"implicit.empty_implicit_contract" + ~title:"Empty implicit contract" + ~description: + "No manager operations are allowed on an empty implicit contract." + ~pp:(fun ppf implicit -> + Format.fprintf + ppf + "Empty implicit contract (%a)" + Signature.Public_key_hash.pp + implicit) + Data_encoding.(obj1 (req "implicit" Signature.Public_key_hash.encoding)) + (function Empty_implicit_contract c -> Some c | _ -> None) + (fun c -> Empty_implicit_contract c) ; + register_error_kind + `Branch + ~id:"implicit.empty_implicit_delegated_contract" + ~title:"Empty implicit delegated contract" + ~description:"Emptying an implicit delegated account is not allowed." + ~pp:(fun ppf implicit -> + Format.fprintf + ppf + "Emptying implicit delegated contract (%a)" + Signature.Public_key_hash.pp + implicit) + Data_encoding.(obj1 (req "implicit" Signature.Public_key_hash.encoding)) + (function Empty_implicit_delegated_contract c -> Some c | _ -> None) + (fun c -> Empty_implicit_delegated_contract c) ; + register_error_kind + `Permanent + ~id:"frozen_bonds.must_be_spent_at_once" + ~title:"Partial spending of frozen bonds" + ~description:"Frozen bonds must be spent at once." + ~pp:(fun ppf (contract, bond_id) -> + Format.fprintf + ppf + "The frozen funds for contract (%a) and bond (%a) are not allowed to \ + be partially withdrawn. The amount withdrawn must be equal to the \ + entire deposit for the said bond." + Contract_repr.pp + contract + Bond_id_repr.pp + bond_id) + Data_encoding.( + obj2 + (req "contract" Contract_repr.encoding) + (req "bond_id" Bond_id_repr.encoding)) + (function + | Frozen_bonds_must_be_spent_at_once (c, b) -> Some (c, b) | _ -> None) + (fun (c, b) -> Frozen_bonds_must_be_spent_at_once (c, b)) + +let failwith msg = tzfail (Failure msg) + +module Legacy_big_map_diff = struct + (* + Big_map_diff receipt as it was represented in 006 and earlier. + It is kept here for now for backward compatibility of tools. *) + + type item = + | Update of { + big_map : Z.t; + diff_key : Script_repr.expr; + diff_key_hash : Script_expr_hash.t; + diff_value : Script_repr.expr option; + } + | Clear of Z.t + | Copy of {src : Z.t; dst : Z.t} + | Alloc of { + big_map : Z.t; + key_type : Script_repr.expr; + value_type : Script_repr.expr; + } + + type t = item list + + let item_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"update" + (obj5 + (req "action" (constant "update")) + (req "big_map" z) + (req "key_hash" Script_expr_hash.encoding) + (req "key" Script_repr.expr_encoding) + (opt "value" Script_repr.expr_encoding)) + (function + | Update {big_map; diff_key_hash; diff_key; diff_value} -> + Some ((), big_map, diff_key_hash, diff_key, diff_value) + | _ -> None) + (fun ((), big_map, diff_key_hash, diff_key, diff_value) -> + Update {big_map; diff_key_hash; diff_key; diff_value}); + case + (Tag 1) + ~title:"remove" + (obj2 (req "action" (constant "remove")) (req "big_map" z)) + (function Clear big_map -> Some ((), big_map) | _ -> None) + (fun ((), big_map) -> Clear big_map); + case + (Tag 2) + ~title:"copy" + (obj3 + (req "action" (constant "copy")) + (req "source_big_map" z) + (req "destination_big_map" z)) + (function Copy {src; dst} -> Some ((), src, dst) | _ -> None) + (fun ((), src, dst) -> Copy {src; dst}); + case + (Tag 3) + ~title:"alloc" + (obj4 + (req "action" (constant "alloc")) + (req "big_map" z) + (req "key_type" Script_repr.expr_encoding) + (req "value_type" Script_repr.expr_encoding)) + (function + | Alloc {big_map; key_type; value_type} -> + Some ((), big_map, key_type, value_type) + | _ -> None) + (fun ((), big_map, key_type, value_type) -> + Alloc {big_map; key_type; value_type}); + ] + + let encoding = Data_encoding.list item_encoding + + let to_lazy_storage_diff legacy_diffs = + let rev_head (diffs : (_ * (_, _, _) Lazy_storage_diff.diff) list) = + match diffs with + | [] -> [] + | (_, Remove) :: _ -> diffs + | (id, Update {init; updates}) :: rest -> + (id, Update {init; updates = List.rev updates}) :: rest + in + (* Invariant: + Updates are collected one by one, in reverse order, on the head diff + item. So only and exactly the head diff item has its updates reversed. + *) + List.fold_left + (fun (new_diff : (_ * (_, _, _) Lazy_storage_diff.diff) list) item -> + match item with + | Clear id -> (id, Lazy_storage_diff.Remove) :: rev_head new_diff + | Copy {src; dst} -> + let src = + Lazy_storage_kind.Big_map.Id + .of_legacy_USE_ONLY_IN_Legacy_big_map_diff + src + in + (dst, Lazy_storage_diff.Update {init = Copy {src}; updates = []}) + :: rev_head new_diff + | Alloc {big_map; key_type; value_type} -> + ( big_map, + Lazy_storage_diff.( + Update + { + init = Alloc Lazy_storage_kind.Big_map.{key_type; value_type}; + updates = []; + }) ) + :: rev_head new_diff + | Update + { + big_map; + diff_key = key; + diff_key_hash = key_hash; + diff_value = value; + } -> ( + match new_diff with + | (id, diff) :: rest when Compare.Z.(id = big_map) -> + let diff = + match diff with + | Remove -> assert false + | Update {init; updates} -> + let updates = + Lazy_storage_kind.Big_map.{key; key_hash; value} + :: updates + in + Lazy_storage_diff.Update {init; updates} + in + (id, diff) :: rest + | new_diff -> + let updates = + [Lazy_storage_kind.Big_map.{key; key_hash; value}] + in + (big_map, Update {init = Existing; updates}) + :: rev_head new_diff)) + [] + legacy_diffs + |> rev_head + |> List.rev_map (fun (id, diff) -> + let id = + Lazy_storage_kind.Big_map.Id + .of_legacy_USE_ONLY_IN_Legacy_big_map_diff + id + in + Lazy_storage_diff.make Lazy_storage_kind.Big_map id diff) + + let of_lazy_storage_diff diffs = + List.fold_left + (fun legacy_diffs (Lazy_storage_diff.Item (kind, id, diff)) -> + let diffs = + match kind with + | Lazy_storage_kind.Big_map -> ( + let id = + Lazy_storage_kind.Big_map.Id + .to_legacy_USE_ONLY_IN_Legacy_big_map_diff + id + in + match diff with + | Remove -> [Clear id] + | Update {init; updates} -> ( + let updates = + List.rev_map + (fun {Lazy_storage_kind.Big_map.key; key_hash; value} -> + Update + { + big_map = id; + diff_key = key; + diff_key_hash = key_hash; + diff_value = value; + }) + updates + in + match init with + | Existing -> updates + | Copy {src} -> + let src = + Lazy_storage_kind.Big_map.Id + .to_legacy_USE_ONLY_IN_Legacy_big_map_diff + src + in + Copy {src; dst = id} :: updates + | Alloc {key_type; value_type} -> + Alloc {big_map = id; key_type; value_type} :: updates)) + | _ -> (* Not a Big_map *) [] + in + diffs :: legacy_diffs) + [] + diffs + |> List.rev |> List.flatten +end + +let update_script_lazy_storage c = function + | None -> return (c, Z.zero) + | Some diffs -> Lazy_storage_diff.apply c diffs + +let raw_originate c ~prepaid_bootstrap_storage + (* Free space for bootstrap contracts *) contract ~script = + let contract = Contract_repr.Originated contract in + Storage.Contract.Spendable_balance.init c contract Tez_repr.zero >>=? fun c -> + let {Script_repr.code; storage}, lazy_storage_diff = script in + Storage.Contract.Code.init c contract code >>=? fun (c, code_size) -> + Storage.Contract.Storage.init c contract storage >>=? fun (c, storage_size) -> + update_script_lazy_storage c lazy_storage_diff + >>=? fun (c, lazy_storage_size) -> + let total_size = + Z.add (Z.add (Z.of_int code_size) (Z.of_int storage_size)) lazy_storage_size + in + assert (Compare.Z.(total_size >= Z.zero)) ; + let prepaid_bootstrap_storage = + if prepaid_bootstrap_storage then total_size else Z.zero + in + Storage.Contract.Paid_storage_space.init c contract prepaid_bootstrap_storage + >>=? fun c -> Storage.Contract.Used_storage_space.init c contract total_size + +let create_implicit c manager ~balance = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Global_counter.get c >>=? fun counter -> + Storage.Contract.Counter.init c contract counter >>=? fun c -> + Storage.Contract.Spendable_balance.init c contract balance >>=? fun c -> + Contract_manager_storage.init c contract (Manager_repr.Hash manager) + +let delete c contract = + match contract with + | Contract_repr.Originated _ -> + (* For non implicit contract Big_map should be cleared *) + failwith "Non implicit contracts cannot be removed" + | Implicit _ -> + (* Implicit contract do not have: [Code], [Storage], + [Paid_storage_space] and [Used_storage_space]. We do not need + to delete them. Futhermore, these storages space are + carbonated, thus, require gas to be deleted (even when they + do not exist). An implicit contract deletion should not cost + extra gas. *) + Contract_delegate_storage.unlink c contract >>=? fun c -> + let update local = + Storage.Contract.Spendable_balance.Local.remove_existing local + >>=? fun local -> + Storage.Contract.Manager.Local.remove_existing local >>=? fun local -> + Storage.Contract.Counter.Local.remove_existing local + in + Storage.Contract.with_local_context c contract (fun local -> + update local >|=? fun local -> (local, ())) + >|=? fun (c, ()) -> c + +let allocated c contract = Storage.Contract.Spendable_balance.mem c contract + +let exists c contract = + match contract with + | Contract_repr.Implicit _ -> Lwt.return_true + | Originated _ -> allocated c contract + +let must_exist c contract = + exists c contract >>= function + | true -> return_unit + | false -> tzfail (Non_existing_contract contract) + +let must_be_allocated c contract = + allocated c contract >>= function + | true -> return_unit + | false -> ( + match contract with + | Implicit pkh -> tzfail (Empty_implicit_contract pkh) + | Originated _ -> tzfail (Non_existing_contract contract)) + +let list c = Storage.Contract.list c + +let fresh_contract_from_current_nonce c = + Raw_context.increment_origination_nonce c >|? fun (c, nonce) -> + (c, Contract_hash.of_nonce nonce) + +let originated_from_current_nonce ~since:ctxt_since ~until:ctxt_until = + Raw_context.get_origination_nonce ctxt_since >>?= fun since -> + Raw_context.get_origination_nonce ctxt_until >>?= fun until -> + List.filter_s + (fun contract -> exists ctxt_until (Contract_repr.Originated contract)) + (Contract_repr.originated_contracts ~since ~until) + >|= ok + +let check_counter_increment c manager counter = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Counter.get c contract >>=? fun contract_counter -> + let expected = Manager_counter_repr.succ contract_counter in + if Manager_counter_repr.(expected = counter) then return_unit + else if Manager_counter_repr.(expected > counter) then + tzfail (Counter_in_the_past {contract; expected; found = counter}) + else tzfail (Counter_in_the_future {contract; expected; found = counter}) + +let increment_counter c manager = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Global_counter.get c >>=? fun global_counter -> + Storage.Contract.Global_counter.update + c + (Manager_counter_repr.succ global_counter) + >>=? fun c -> + Storage.Contract.Counter.get c contract >>=? fun contract_counter -> + Storage.Contract.Counter.update + c + contract + (Manager_counter_repr.succ contract_counter) + +let get_script_code c contract_hash = + let contract = Contract_repr.Originated contract_hash in + Storage.Contract.Code.find c contract + +let get_script c contract_hash = + let contract = Contract_repr.Originated contract_hash in + Storage.Contract.Code.find c contract >>=? fun (c, code) -> + Storage.Contract.Storage.find c contract >>=? fun (c, storage) -> + match (code, storage) with + | None, None -> return (c, None) + | Some code, Some storage -> return (c, Some {Script_repr.code; storage}) + | None, Some _ | Some _, None -> failwith "get_script" + +let get_storage ctxt contract_hash = + let contract = Contract_repr.Originated contract_hash in + Storage.Contract.Storage.find ctxt contract >>=? function + | ctxt, None -> return (ctxt, None) + | ctxt, Some storage -> + Raw_context.consume_gas ctxt (Script_repr.force_decode_cost storage) + >>?= fun ctxt -> + Script_repr.force_decode storage >>?= fun storage -> + return (ctxt, Some storage) + +let get_counter c manager = + let contract = Contract_repr.Implicit manager in + Storage.Contract.Counter.find c contract >>=? function + | None -> ( + match contract with + | Contract_repr.Implicit _ -> Storage.Contract.Global_counter.get c + | Originated _ -> failwith "get_counter") + | Some v -> return v + +let get_balance c contract = + Storage.Contract.Spendable_balance.find c contract >>=? function + | None -> ( + match contract with + | Implicit _ -> return Tez_repr.zero + | Originated _ -> failwith "get_balance") + | Some v -> return v + +let get_balance_carbonated c contract = + (* Reading an int64 from /contracts/index/<hash>/balance *) + Raw_context.consume_gas + c + (Storage_costs.read_access ~path_length:4 ~read_bytes:8) + >>?= fun c -> + get_balance c contract >>=? fun balance -> return (c, balance) + +let check_allocated_and_get_balance c pkh = + let open Lwt_result_syntax in + let* balance_opt = + Storage.Contract.Spendable_balance.find c (Contract_repr.Implicit pkh) + in + match balance_opt with + | None -> tzfail (Empty_implicit_contract pkh) + | Some balance -> return balance + +let update_script_storage c contract_hash storage lazy_storage_diff = + let contract = Contract_repr.Originated contract_hash in + let storage = Script_repr.lazy_expr storage in + update_script_lazy_storage c lazy_storage_diff + >>=? fun (c, lazy_storage_size_diff) -> + Storage.Contract.Storage.update c contract storage >>=? fun (c, size_diff) -> + Storage.Contract.Used_storage_space.get c contract >>=? fun previous_size -> + let new_size = + Z.add previous_size (Z.add lazy_storage_size_diff (Z.of_int size_diff)) + in + Storage.Contract.Used_storage_space.update c contract new_size + +let spend_from_balance contract balance amount = + record_trace + (Balance_too_low (contract, balance, amount)) + Tez_repr.(balance -? amount) + +let check_emptiable c contract = + let open Lwt_result_syntax in + match contract with + | Contract_repr.Originated _ -> return_unit + | Implicit pkh -> ( + let* delegate = Contract_delegate_storage.find c contract in + match delegate with + | Some pkh' -> + if Signature.Public_key_hash.equal pkh pkh' then return_unit + else + (* Delegated implicit accounts cannot be emptied *) + Lwt.return (error (Empty_implicit_delegated_contract pkh)) + | None -> return_unit) + +let spend_only_call_from_token c contract amount = + let open Lwt_result_syntax in + let* balance = Storage.Contract.Spendable_balance.find c contract in + let balance = Option.value balance ~default:Tez_repr.zero in + let*? new_balance = spend_from_balance contract balance amount in + let* c = Storage.Contract.Spendable_balance.update c contract new_balance in + let* c = Stake_storage.remove_contract_stake c contract amount in + let+ () = + when_ + Tez_repr.(new_balance <= Tez_repr.zero) + (fun () -> check_emptiable c contract) + in + c + +(* [Tez_repr.(amount <> zero)] is a precondition of this function. It ensures that + no entry associating a null balance to an implicit contract exists in the map + [Storage.Contract.Spendable_balance]. *) +let credit_only_call_from_token c contract amount = + Storage.Contract.Spendable_balance.find c contract >>=? function + | None -> ( + match contract with + | Originated _ -> tzfail (Non_existing_contract contract) + | Implicit manager -> create_implicit c manager ~balance:amount) + | Some balance -> + Tez_repr.(amount +? balance) >>?= fun balance -> + Storage.Contract.Spendable_balance.update c contract balance >>=? fun c -> + Stake_storage.add_contract_stake c contract amount + +let init c = + Storage.Contract.Global_counter.init c Manager_counter_repr.init >>=? fun c -> + Lazy_storage_diff.init c + +let used_storage_space c contract = + Storage.Contract.Used_storage_space.find c contract + >|=? Option.value ~default:Z.zero + +let paid_storage_space c contract = + Storage.Contract.Paid_storage_space.find c contract + >|=? Option.value ~default:Z.zero + +let set_paid_storage_space_and_return_fees_to_pay c contract new_storage_space = + Storage.Contract.Paid_storage_space.get c contract + >>=? fun already_paid_space -> + if Compare.Z.(already_paid_space >= new_storage_space) then return (Z.zero, c) + else + let to_pay = Z.sub new_storage_space already_paid_space in + Storage.Contract.Paid_storage_space.update c contract new_storage_space + >|=? fun c -> (to_pay, c) + +let increase_paid_storage c contract_hash ~amount_in_bytes:storage_incr = + let contract = Contract_repr.Originated contract_hash in + Storage.Contract.Paid_storage_space.get c contract + >>=? fun already_paid_space -> + let new_storage_space = Z.add already_paid_space storage_incr in + Storage.Contract.Paid_storage_space.update c contract new_storage_space + +let update_balance ctxt contract f amount = + Storage.Contract.Spendable_balance.get ctxt contract >>=? fun balance -> + f balance amount >>?= fun new_balance -> + Storage.Contract.Spendable_balance.update ctxt contract new_balance + +let increase_balance_only_call_from_token ctxt contract amount = + update_balance ctxt contract Tez_repr.( +? ) amount + +let decrease_balance_only_call_from_token ctxt contract amount = + update_balance ctxt contract Tez_repr.( -? ) amount + +let get_frozen_bonds ctxt contract = + Storage.Contract.Total_frozen_bonds.find ctxt contract + >|=? Option.value ~default:Tez_repr.zero + +let get_balance_and_frozen_bonds ctxt contract = + Storage.Contract.Spendable_balance.get ctxt contract >>=? fun balance -> + get_frozen_bonds ctxt contract >>=? fun total_bonds -> + Lwt.return Tez_repr.(balance +? total_bonds) + +let bond_allocated ctxt contract bond_id = + Storage.Contract.Frozen_bonds.mem (ctxt, contract) bond_id + +let find_bond ctxt contract bond_id = + Storage.Contract.Frozen_bonds.find (ctxt, contract) bond_id + +(** PRE : [amount > 0], fulfilled by unique caller [Token.transfer]. *) +let spend_bond_only_call_from_token ctxt contract bond_id amount = + fail_when Tez_repr.(amount = zero) (Failure "Expecting : [amount > 0]") + >>=? fun () -> + Stake_storage.remove_contract_stake ctxt contract amount >>=? fun ctxt -> + Storage.Contract.Frozen_bonds.get (ctxt, contract) bond_id + >>=? fun (ctxt, frozen_bonds) -> + error_when + Tez_repr.(frozen_bonds <> amount) + (Frozen_bonds_must_be_spent_at_once (contract, bond_id)) + >>?= fun () -> + Storage.Contract.Frozen_bonds.remove_existing (ctxt, contract) bond_id + >>=? fun (ctxt, _) -> + Storage.Contract.Total_frozen_bonds.get ctxt contract >>=? fun total -> + Tez_repr.(total -? amount) >>?= fun new_total -> + if Tez_repr.(new_total = zero) then + Storage.Contract.Total_frozen_bonds.remove_existing ctxt contract + else Storage.Contract.Total_frozen_bonds.update ctxt contract new_total + +(** PRE : [amount > 0], fulfilled by unique caller [Token.transfer]. *) +let credit_bond_only_call_from_token ctxt contract bond_id amount = + fail_when Tez_repr.(amount = zero) (Failure "Expecting : [amount > 0]") + >>=? fun () -> + Stake_storage.add_contract_stake ctxt contract amount >>=? fun ctxt -> + ( Storage.Contract.Frozen_bonds.find (ctxt, contract) bond_id + >>=? fun (ctxt, frozen_bonds_opt) -> + match frozen_bonds_opt with + | None -> Storage.Contract.Frozen_bonds.init (ctxt, contract) bond_id amount + | Some frozen_bonds -> + Tez_repr.(frozen_bonds +? amount) >>?= fun new_amount -> + Storage.Contract.Frozen_bonds.update (ctxt, contract) bond_id new_amount + ) + >>=? fun (ctxt, _) -> + Storage.Contract.Total_frozen_bonds.find ctxt contract >>=? function + | None -> Storage.Contract.Total_frozen_bonds.init ctxt contract amount + | Some total -> + Tez_repr.(total +? amount) >>?= fun new_total -> + Storage.Contract.Total_frozen_bonds.update ctxt contract new_total + +let has_frozen_bonds ctxt contract = + Storage.Contract.Total_frozen_bonds.mem ctxt contract >|= ok + +let fold_on_bond_ids ctxt contract = + Storage.Contract.fold_bond_ids (ctxt, contract) + +(** Indicate whether the given implicit contract should avoid deletion + when it is emptied. *) +let should_keep_empty_implicit_contract ctxt contract = + let open Lwt_result_syntax in + let* has_frozen_bonds = has_frozen_bonds ctxt contract in + if has_frozen_bonds then return_true + else + (* full balance of contract is zero. *) + Contract_delegate_storage.find ctxt contract >>=? function + | Some _ -> + (* Here, we know that the contract delegates to itself. + Indeed, it does not delegate to a different one, because + the balance of such contracts cannot be zero (see + {!spend_only_call_from_token}), hence the stake of such + contracts cannot be zero either. *) + return_true + | None -> + (* Delete empty implicit contract. *) + return_false + +let ensure_deallocated_if_empty ctxt contract = + let open Lwt_result_syntax in + match contract with + | Contract_repr.Originated _ -> + return ctxt (* Never delete originated contracts *) + | Implicit _ -> ( + let* balance_opt = + Storage.Contract.Spendable_balance.find ctxt contract + in + match balance_opt with + | None -> + (* Nothing to do, contract is not allocated. *) + return ctxt + | Some balance -> + if Tez_repr.(balance <> zero) then return ctxt + else + let* keep_contract = + should_keep_empty_implicit_contract ctxt contract + in + if keep_contract then return ctxt else delete ctxt contract) + +let simulate_spending ctxt ~balance ~amount source = + let open Lwt_result_syntax in + let contract = Contract_repr.Implicit source in + let*? new_balance = spend_from_balance contract balance amount in + let* still_allocated = + if Tez_repr.(new_balance > zero) then return_true + else + let* () = check_emptiable ctxt contract in + should_keep_empty_implicit_contract ctxt contract + in + return (new_balance, still_allocated) diff --git a/src/proto_016_PtMumbai/lib_protocol/contract_storage.mli b/src/proto_016_PtMumbai/lib_protocol/contract_storage.mli new file mode 100644 index 000000000000..23c062aad53b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contract_storage.mli @@ -0,0 +1,337 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Low-level handlers of raw contexts for base operations on + contracts. *) + +type error += + | (* `Temporary *) + Balance_too_low of Contract_repr.t * Tez_repr.t * Tez_repr.t + | (* `Temporary *) + Counter_in_the_past of { + contract : Contract_repr.t; + expected : Manager_counter_repr.t; + found : Manager_counter_repr.t; + } + | (* `Branch *) + Counter_in_the_future of { + contract : Contract_repr.t; + expected : Manager_counter_repr.t; + found : Manager_counter_repr.t; + } + | (* `Temporary *) + Non_existing_contract of Contract_repr.t + | (* `Permanent *) + Inconsistent_public_key of + Signature.Public_key.t * Signature.Public_key.t + | (* `Permanent *) Failure of string + | (* `Branch *) + Empty_implicit_contract of Signature.Public_key_hash.t + | (* `Branch *) + Empty_implicit_delegated_contract of + Signature.Public_key_hash.t + +(** [allocated ctxt contract] returns [true] if and only if the + contract is stored in {!Storage.Contract.Spendable_balance}. *) +val allocated : Raw_context.t -> Contract_repr.t -> bool Lwt.t + +(** [exists ctxt contract] returns [true] if and only if either the + contract is originated or it is (implicit and) "allocated". *) +val exists : Raw_context.t -> Contract_repr.t -> bool Lwt.t + +(** [must_exist ctxt contract] fails with the [Non_existing_contract] error if + [exists ctxt contract] returns [false]. Even though this function is + gas-free, it is always called in a context where some gas consumption is + guaranteed whenever necessary. The first context is that of a transfer + operation, and in that case the base cost of a manager operation + ([Micheclson_v1_gas.Cost_of.manager_operation]) is consumed. The second + context is that of an activation operation, and in that case no gas needs to + be consumed since that operation is not a manager operation. *) +val must_exist : Raw_context.t -> Contract_repr.t -> unit tzresult Lwt.t + +(** [must_be_allocated ctxt contract] fails when the contract is not + allocated. It fails with [Non_existing_contract] if the contract is + originated, and it fails with [Empty_implicit_contract] if the + contract is implicit. *) +val must_be_allocated : Raw_context.t -> Contract_repr.t -> unit tzresult Lwt.t + +val list : Raw_context.t -> Contract_repr.t list Lwt.t + +val check_counter_increment : + Raw_context.t -> + Signature.Public_key_hash.t -> + Manager_counter_repr.t -> + unit tzresult Lwt.t + +val increment_counter : + Raw_context.t -> Signature.Public_key_hash.t -> Raw_context.t tzresult Lwt.t + +(** [get_balance ctxt contract] returns the balance of spendable tez owned by + [contract] given raw context [ctxt]. This does not include the contract's + frozen balances. *) +val get_balance : Raw_context.t -> Contract_repr.t -> Tez_repr.t tzresult Lwt.t + +val get_balance_carbonated : + Raw_context.t -> + Contract_repr.t -> + (Raw_context.t * Tez_repr.t) tzresult Lwt.t + +(** Return the balance of spendable tez owned by the Implicit contract + of the given [public_key_hash]. + + @return [Error Empty_implicit_contract] if the contract is not + allocated in {!Storage.Contract.Spendable_balance}. + + This function is a fusion of {!must_be_allocated} and + {!get_balance} for Implicit contracts exclusively. *) +val check_allocated_and_get_balance : + Raw_context.t -> Signature.public_key_hash -> Tez_repr.t tzresult Lwt.t + +val get_counter : + Raw_context.t -> + Signature.Public_key_hash.t -> + Manager_counter_repr.t tzresult Lwt.t + +val get_script_code : + Raw_context.t -> + Contract_hash.t -> + (Raw_context.t * Script_repr.lazy_expr option) tzresult Lwt.t + +val get_script : + Raw_context.t -> + Contract_hash.t -> + (Raw_context.t * Script_repr.t option) tzresult Lwt.t + +val get_storage : + Raw_context.t -> + Contract_hash.t -> + (Raw_context.t * Script_repr.expr option) tzresult Lwt.t + +module Legacy_big_map_diff : sig + type item = private + | Update of { + big_map : Z.t; + diff_key : Script_repr.expr; + diff_key_hash : Script_expr_hash.t; + diff_value : Script_repr.expr option; + } + | Clear of Z.t + | Copy of {src : Z.t; dst : Z.t} + | Alloc of { + big_map : Z.t; + key_type : Script_repr.expr; + value_type : Script_repr.expr; + } + + type t = item list + + val encoding : t Data_encoding.t + + val to_lazy_storage_diff : t -> Lazy_storage_diff.diffs + + val of_lazy_storage_diff : Lazy_storage_diff.diffs -> t +end + +val update_script_storage : + Raw_context.t -> + Contract_hash.t -> + Script_repr.expr -> + Lazy_storage_diff.diffs option -> + Raw_context.t tzresult Lwt.t + +val credit_only_call_from_token : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + +val spend_only_call_from_token : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + +(** [raw_originate ctxt ~prepaid_bootstrap_storage contract ~script] + originates the [contract] parameter. The [storage] space allocated by this + origination is considered to be free of charge or to have been already paid + for by the user, if and only if [prepaid_bootstrap_storage] is [true]. In + particular, the amount of space allocated by this origination will be part + of the consumed space to pay for returned by the next call to + [Fees_storage.record_paid_storage_space ctxt contract], if and only if + [prepaid_bootstrap_storage] is [false]. *) +val raw_originate : + Raw_context.t -> + prepaid_bootstrap_storage:bool -> + Contract_hash.t -> + script:Script_repr.t * Lazy_storage_diff.diffs option -> + Raw_context.t tzresult Lwt.t + +val fresh_contract_from_current_nonce : + Raw_context.t -> (Raw_context.t * Contract_hash.t) tzresult + +val originated_from_current_nonce : + since:Raw_context.t -> + until:Raw_context.t -> + Contract_hash.t list tzresult Lwt.t + +val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + +val used_storage_space : Raw_context.t -> Contract_repr.t -> Z.t tzresult Lwt.t + +val paid_storage_space : Raw_context.t -> Contract_repr.t -> Z.t tzresult Lwt.t + +val set_paid_storage_space_and_return_fees_to_pay : + Raw_context.t -> + Contract_repr.t -> + Z.t -> + (Z.t * Raw_context.t) tzresult Lwt.t + +(** Enable a payer to increase the paid storage of a contract by some amount. *) +val increase_paid_storage : + Raw_context.t -> + Contract_hash.t -> + amount_in_bytes:Z.t -> + Raw_context.t tzresult Lwt.t + +(** Increases the balance of a contract. Calling this function directly may + break important invariants. Consider calling [credit] instead. *) +val increase_balance_only_call_from_token : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + +(** Decreases the balance of a contract. Calling this function directly may + break important invariants. Consider calling [spend] instead. *) +val decrease_balance_only_call_from_token : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + +(** [get_balance_and_frozen_bonds ctxt contract] returns the sum of the + (spendable) balance and the frozen bonds associated to [contract]. *) +val get_balance_and_frozen_bonds : + Raw_context.t -> Contract_repr.t -> Tez_repr.t tzresult Lwt.t + +(** This error is raised when [spend_bond_only_call_from_token] is called with + an amount that is not equal to the deposit associated to the given contract + and bond id. *) +type error += + | (* `Permanent *) + Frozen_bonds_must_be_spent_at_once of + Contract_repr.t * Bond_id_repr.t + +(** [bond_allocated ctxt contract bond_id] returns a new context because of an + access to carbonated data, and [true] if there is a bond associated to + [contract] and [bond_id], or [false] otherwise. *) +val bond_allocated : + Raw_context.t -> + Contract_repr.t -> + Bond_id_repr.t -> + (Raw_context.t * bool) tzresult Lwt.t + +(** [find_bond ctxt contract bond_id] returns a new context because of an access + to carbonated data, and the bond associated to [(contract, bond_id)] if + there is one, or [None] otherwise. *) +val find_bond : + Raw_context.t -> + Contract_repr.t -> + Bond_id_repr.t -> + (Raw_context.t * Tez_repr.t option) tzresult Lwt.t + +(** [spend_bond ctxt contract bond_id amount] withdraws the given [amount] from + the value of the bond associated to [contract] and [bond_id]. + + The argument [amount] is required to be strictly positive. + + @raise a [Storage_Error Missing_key] error when there is no bond associated + to [contract] and [bond_id]. + + @raise a [Frozen_bonds_must_be_spent_at_once (contract, bond_id)] + error when the amount is different from the bond associated to [contract] + and [bond_id]. *) +val spend_bond_only_call_from_token : + Raw_context.t -> + Contract_repr.t -> + Bond_id_repr.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [credit_bond ctxt contract bond_id amount] adds the given [amount] to the + bond associated to [contract] and [bond_id]. If no bond exists, one whose + value is [amount] is created. + + The argument [amount] is required to be strictly positive. + + @raise a [Addition_overflow] error when + [(find ctxt contract bond_id) + amount > Int64.max_int]. *) +val credit_bond_only_call_from_token : + Raw_context.t -> + Contract_repr.t -> + Bond_id_repr.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [has_frozen_bonds ctxt contract] returns [true] if there are frozen bonds + associated to [contract], and returns [false] otherwise. *) +val has_frozen_bonds : Raw_context.t -> Contract_repr.t -> bool tzresult Lwt.t + +(** [get_frozen_bonds ctxt contract] returns the total amount of bonds associated + to [contract]. *) +val get_frozen_bonds : + Raw_context.t -> Contract_repr.t -> Tez_repr.t tzresult Lwt.t + +(** [fold_on_bond_ids ctxt contract order init f] folds [f] on all bond + identifiers associated to [contract]. *) +val fold_on_bond_ids : + Raw_context.t -> + Contract_repr.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(Bond_id_repr.t -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + +(** [ensure_deallocated_if_empty ctxt contract] de-allocates [contract] if its + full balance is zero, and it does not delegate. *) +val ensure_deallocated_if_empty : + Raw_context.t -> Contract_repr.t -> Raw_context.t tzresult Lwt.t + +(** [simulate_spending ctxt ~balance ~amount source] removes [amount] + from [balance] as if it were the balance of the implicit contract + associated with [source]. It returns the resulting [new_balance], + and a boolean [still_allocated] that indicates whether this + contract would still exist. + + [still_allocated] is always [true] when [new_balance] is + positive. When [new_balance] is zero, it depends on the contract's + delegated status and frozen bonds (cf {!spend_only_call_from_token} + and {!ensure_deallocated_if_empty}). + + Note that this function does not retrieve the actual balance of + the contract, nor does it update or delete it. Indeed, its purpose + is to simulate the spending of fees when validating operations, + without actually spending them. + + @return [Error Balance_too_low] if [balance] is smaller than + [amount]. + + @return [Error Empty_implicit_delegated_contract] if [new_balance] + would be zero and the contract has a delegate that is not the + contract's own manager. *) +val simulate_spending : + Raw_context.t -> + balance:Tez_repr.t -> + amount:Tez_repr.t -> + Signature.public_key_hash -> + (Tez_repr.t * bool) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.bin b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.bin new file mode 100644 index 000000000000..c4e455868ecb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.bin @@ -0,0 +1 @@ +0x02000011c405000764076407640865046e00000006256f776e6572076504620000000d256d696e4c71744d696e7465640765046200000013256d6178546f6b656e734465706f7369746564046b0000000925646561646c696e650000000d256164644c6971756964697479046c000000082564656661756c7407640865046e0000000325746f076504620000000a256c71744275726e65640765046a00000010256d696e58747a57697468647261776e0765046200000013256d696e546f6b656e7357697468647261776e046b0000000925646561646c696e65000000102572656d6f76654c69717569646974790865046e00000015256f7574707574446578746572436f6e74726163740765046200000010256d696e546f6b656e73426f756768740765046e0000000325746f076504620000000b25746f6b656e73536f6c64046b0000000925646561646c696e650000000d25746f6b656e546f546f6b656e07640865046e0000000325746f076504620000000b25746f6b656e73536f6c640765046a0000000d256d696e58747a426f75676874046b0000000925646561646c696e650000000b25746f6b656e546f58747a0865046e0000000325746f0765046200000010256d696e546f6b656e73426f75676874046b0000000925646561646c696e650000000b2578747a546f546f6b656e0501076504620000000a25746f6b656e506f6f6c0765046a000000082578747a506f6f6c0765046200000009256c7174546f74616c0765046e0000000d25746f6b656e41646472657373046e0000000b256c71744164647265737305020200000f7203210317034c0316072e02000009d1072e020000035a072e020000032603210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200004074303620003032702000002ea0743036a000105700004032105710005031703160322072f0200000013074303680100000008444956206279203003270200000000031603130743036a0001034c0322072f02000000130743036801000000084449562062792030032702000000000316034c0321057100020570000603210571000703170317031605700002032105710003033a0322072f020000001307430368010000000844495620627920300327020000000003160570000205700006032105710007031605700003033a0322072f020000001307430368010000000844495620627920300327020000002a03210317034c03160743036200000570000203190325072c02000000000200000008074303620001031205700002034c0321057100020319032a072c020000000c05200005074303620004032702000001b60571000203210571000303190337072c020000000c0520000407430362000503270200000190057000030321057100040317031703170570000203210571000305700005032105710006031703170316031203420570000403210571000503170316034205700004032105710005031603420317034c032105710002057000050321057100060316031203420321031703170313057000060317031603120342034c03160342034c03490354034203480342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d05700002033005700003034205700002032105710003034c03210317034c031605700002031703170317031706550765045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e072f020000000807430362000c032702000000000743036a000005700002057000030342034d05700002053d036d05700002031b05700002031b0342020000002803200321031703170313057000020321057100030317031603120342034c03160342053d036d0342020000066b072e020000038d03210317034c0316034c03210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200005074303620003032702000003470743036a000003130319032a072c020000000c0520000507430362000a03270200000323057000040321057100050317031703160743036a000105700006032105710007031703160322072f0200000013074303680100000008444956206279203003270200000000031605700004032105710005033a0322072f020000001307430368010000000844495620627920300327020000000003160743036a0001034c033a0570000503210571000603170317031605700006032105710007031605700005032105710006033a0322072f02000000130743036801000000084449562062792030032702000000000316057000030570000203210571000303190337072c020000000c0520000607430362000b0327020000022e05700002034c03210571000203190337072c020000000c0520000507430362000d032702000002060570000203210571000305700005032105710006031703170316034b0356072f020000000807430362000e03270200000000034c032105710002057000060321057100070316034b0356072f020000000807430362000f03270200000000057000040743035b0000034b0348034205700006032105710007034c03210317034c031605700002031703170317031706550765045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e072f020000000807430362000c032702000000000743036a000005700002057000030342034d0570000305700005032105710006034203490354034205700006032105710007034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d05700004032105710005057000060555036c072f020000000807430362000903270200000000034c0743036c030b034d0570000603210571000703170317057000060570000703210571000803170316034b034205700006031603420321031703170317057000060342034c032105710002031703160342034c031603420317057000040342053d036d05700002031b05700002031b05700002031b034202000002d203210317034c0316034c03210317034c0316034c03210317034c0316034c03210317034c03160570000406550765046e0000000325746f0765046200000010256d696e546f6b656e73426f75676874046b0000000925646561646c696e650000000b2578747a546f546f6b656e072f020000000807430362001f032702000000000743036a000003130319032a072c020000000c0520000607430362000a0327020000022d05700002032105710003034003190328072c020000000c05200006074303620003032702000002050743036200a70f05700002032105710003033a0743036200a80f057000070321057100080316033a031205700006032105710007031703160743036200a70f05700004032105710005033a033a0322072f020000001307430368010000000844495620627920300327020000000003160743036200a80f0743036200a70f05700002032105710003033a0322072f02000000130743036801000000084449562062792030032702000000000316057000070321057100080317057000040321057100050570000903210571000a031603120342032103170317057000030321057100040570000a03170316034b0342034c031603420570000403490354034203480342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d057000040570000303210571000405700006057000080342057000070342034d0570000305700004034b0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d05700003053d036d05700002031b05700002031b05700002031b0342020000058d072e02000002cc03210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200004074303620003032702000002900743036a000003130319032a072c020000000c0520000407430362000a0327020000026c0743036200a70f05700002032105710003033a0743036200a80f057000050321057100060316033a03120743036a000105700005032105710006031703160322072f020000001307430368010000000844495620627920300327020000000003160743036200a70f05700004032105710005033a033a0322072f020000001307430368010000000844495620627920300327020000000003160743036a0001034c033a0743036200a80f0743036200a70f05700002032105710003033a0322072f0200000013074303680100000008444956206279203003270200000000031605700002034c03210571000203190337072c020000000a032007430362000803270200000000057000020321057100030349035403420348034205700005032105710006034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d034c032105710002057000050555036c072f020000000807430362000903270200000000034c0743036c030b034d0570000503210571000603170570000505700006032105710007031603120342032103170317057000050321057100060570000703170316034b0342034c031603420570000305700004034b0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d034c053d036d05700002031b05700002031b05700002031b034202000002b503210317034c0316034c03210317034c0316034c034003190328072c020000000c05200003074303620003032702000002830743036a000105700003032105710004031703160322072f0200000013074303680100000008444956206279203003270200000000031603130743036a0001034c0322072f020000001307430368010000000844495620627920300327020000000003160743036200a80f0743036200a70f05700002032105710003033a0322072f02000000130743036801000000084449562062792030032702000000000316032105700002034b03110743036200a70f05700002032105710003033a0743036200a80f05700004033a03120570000503210571000603160743036200a70f05700004032105710005033a033a0322072f0200000013074303680100000008444956206279203003270200000000031605700003034c03210571000203190337072c020000000a0320074303620012032702000000000321057000050321057100060316034b0356072f02000000080743036200130327020000000005700005032105710006031703170743036a000105700005033a05700006032105710007031703160312034205700005031603420317034c0342034c057000030342034903540342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d0743036a000105700003033a0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d05700002053d036d05700002031b05700002031b0342 diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.mligo b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.mligo new file mode 100644 index 000000000000..37213e25a216 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.mligo @@ -0,0 +1,388 @@ +// ============================================================================= +// Entrypoints +// ============================================================================= + +type add_liquidity = + [@layout:comb] + { owner : address ; + minLqtMinted : nat ; + maxTokensDeposited : nat ; + deadline : timestamp ; + } + +type remove_liquidity = + [@layout:comb] + { [@annot:to] to_ : address ; // recipient of the liquidity redemption + lqtBurned : nat ; // amount of lqt owned by sender to burn + minXtzWithdrawn : tez ; // minimum amount of tez to withdraw + minTokensWithdrawn : nat ; // minimum amount of tokens to whitdw + deadline : timestamp ; // the time before which the request must be completed + } + +type xtz_to_token = + [@layout:comb] + { [@annot:to] to_ : address ; + minTokensBought : nat ; + deadline : timestamp ; + } + +type token_to_xtz = + [@layout:comb] + { [@annot:to] to_ : address ; + tokensSold : nat ; + minXtzBought : tez ; + deadline : timestamp ; + } + +type token_to_token = + [@layout:comb] + { outputDexterContract : address ; + minTokensBought : nat ; + [@annot:to] to_ : address ; + tokensSold : nat ; + deadline : timestamp ; + } + +type entrypoint = +| AddLiquidity of add_liquidity +| RemoveLiquidity of remove_liquidity +| XtzToToken of xtz_to_token +| TokenToXtz of token_to_xtz +| Default of unit +| TokenToToken of token_to_token + + +// ============================================================================= +// Storage +// ============================================================================= + +type storage = + [@layout:comb] + { tokenPool : nat ; + xtzPool : tez ; + lqtTotal : nat ; + tokenAddress : address ; + lqtAddress : address ; + } + +// ============================================================================= +// Type Synonyms +// ============================================================================= + +type result = operation list * storage + +// FA1.2 +type token_contract_transfer = address * (address * nat) +type get_balance = address * (nat contract) + +// custom entrypoint for LQT FA1.2 +type mintOrBurn = + [@layout:comb] + { quantity : int ; + target : address } + +// ============================================================================= +// Error codes +// ============================================================================= + +[@inline] let error_TOKEN_CONTRACT_MUST_HAVE_A_TRANSFER_ENTRYPOINT = 0n +(* 1n *) +[@inline] let error_SELF_IS_UPDATING_TOKEN_POOL_MUST_BE_FALSE = 2n +[@inline] let error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE = 3n +[@inline] let error_MAX_TOKENS_DEPOSITED_MUST_BE_GREATER_THAN_OR_EQUAL_TO_TOKENS_DEPOSITED = 4n +[@inline] let error_LQT_MINTED_MUST_BE_GREATER_THAN_MIN_LQT_MINTED = 5n +(* 6n *) +(* 7n *) +[@inline] let error_XTZ_BOUGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_XTZ_BOUGHT = 8n +[@inline] let error_INVALID_TO_ADDRESS = 9n +[@inline] let error_AMOUNT_MUST_BE_ZERO = 10n +[@inline] let error_THE_AMOUNT_OF_XTZ_WITHDRAWN_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_XTZ_WITHDRAWN = 11n +[@inline] let error_LQT_CONTRACT_MUST_HAVE_A_MINT_OR_BURN_ENTRYPOINT = 12n +[@inline] let error_THE_AMOUNT_OF_TOKENS_WITHDRAWN_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_TOKENS_WITHDRAWN = 13n +[@inline] let error_CANNOT_BURN_MORE_THAN_THE_TOTAL_AMOUNT_OF_LQT = 14n +[@inline] let error_TOKEN_POOL_MINUS_TOKENS_WITHDRAWN_IS_NEGATIVE = 15n +(* 16n *) +(* 17n *) +[@inline] let error_TOKENS_BOUGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_TOKENS_BOUGHT = 18n +[@inline] let error_TOKEN_POOL_MINUS_TOKENS_BOUGHT_IS_NEGATIVE = 19n +[@inline] let error_ONLY_MANAGER_CAN_SET_BAKER = 20n +[@inline] let error_ONLY_MANAGER_CAN_SET_MANAGER = 21n +[@inline] let error_BAKER_PERMANENTLY_FROZEN = 22n +[@inline] let error_ONLY_MANAGER_CAN_SET_LQT_ADRESS = 23n +[@inline] let error_LQT_ADDRESS_ALREADY_SET = 24n +[@inline] let error_CALL_NOT_FROM_AN_IMPLICIT_ACCOUNT = 25n +(* 26n *) +(* 27n *) +#if FA2 +[@inline] let error_INVALID_FA2_TOKEN_CONTRACT_MISSING_BALANCE_OF = 28n +#else +[@inline] let error_INVALID_FA12_TOKEN_CONTRACT_MISSING_GETBALANCE = 28n +#endif +[@inline] let error_THIS_ENTRYPOINT_MAY_ONLY_BE_CALLED_BY_GETBALANCE_OF_TOKENADDRESS = 29n +(* 30n *) +[@inline] let error_INVALID_INTERMEDIATE_CONTRACT = 31n +[@inline] let error_INVALID_FA2_BALANCE_RESPONSE = 32n +[@inline] let error_UNEXPECTED_REENTRANCE_IN_UPDATE_TOKEN_POOL = 33n + + +// ============================================================================= +// Functions +// ============================================================================= + +[@inline] +let fee = 999n + +[@inline] let null_address = ("tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" : address) + +(* this is slightly inefficient to inline, but, nice to have a clean stack for + the entrypoints for the Coq verification *) +[@inline] +let mutez_to_natural (a: tez) : nat = a / 1mutez + +[@inline] +let natural_to_mutez (a: nat): tez = a * 1mutez + +[@inline] +let is_a_nat (i : int) : nat option = Michelson.is_nat i + +let ceildiv (numerator : nat) (denominator : nat) : nat = + match (ediv numerator denominator) with + | None -> (failwith("DIV by 0") : nat) + | Some v -> let (q, r) = v in if r = 0n then q else q + 1n + +[@inline] +let mint_or_burn (storage : storage) (target : address) (quantity : int) : operation = + let lqt_admin : mintOrBurn contract = + match (Tezos.get_entrypoint_opt "%mintOrBurn" storage.lqtAddress : mintOrBurn contract option) with + | None -> (failwith error_LQT_CONTRACT_MUST_HAVE_A_MINT_OR_BURN_ENTRYPOINT : mintOrBurn contract) + | Some contract -> contract in + Tezos.transaction {quantity = quantity ; target = target} 0mutez lqt_admin + +[@inline] +let token_transfer (storage : storage) (from : address) (to_ : address) (token_amount : nat) : operation = + let token_contract: token_contract_transfer contract = + match (Tezos.get_entrypoint_opt "%transfer" storage.tokenAddress : token_contract_transfer contract option) with + | None -> (failwith error_TOKEN_CONTRACT_MUST_HAVE_A_TRANSFER_ENTRYPOINT : token_contract_transfer contract) + | Some contract -> contract in + Tezos.transaction (from, (to_, token_amount)) 0mutez token_contract + +[@inline] +let xtz_transfer (to_ : address) (amount_ : tez) : operation = + let to_contract : unit contract = + match (Tezos.get_contract_opt to_ : unit contract option) with + | None -> (failwith error_INVALID_TO_ADDRESS : unit contract) + | Some c -> c in + Tezos.transaction () amount_ to_contract + +// ============================================================================= +// Entrypoint Functions +// ============================================================================= + +// We assume the contract is originated with at least one liquidity +// provider set up already, so lqtTotal, xtzPool and tokenPool will +// always be positive after the initial setup, unless all liquidity is +// removed, at which point the contract is considered dead and stops working +// properly. (To prevent this, at least one address should keep at least a +// small amount of liquidity in the contract forever.) + +let add_liquidity (param : add_liquidity) (storage: storage) : result = + let { owner = owner ; + minLqtMinted = minLqtMinted ; + maxTokensDeposited = maxTokensDeposited ; + deadline = deadline } = param in + + if Tezos.now >= deadline then + (failwith error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE : result) + else + // the contract is initialized, use the existing exchange rate + // mints nothing if the contract has been emptied, but that's OK + let xtzPool : nat = mutez_to_natural storage.xtzPool in + let nat_amount : nat = mutez_to_natural Tezos.amount in + let lqt_minted : nat = nat_amount * storage.lqtTotal / xtzPool in + let tokens_deposited : nat = ceildiv (nat_amount * storage.tokenPool) xtzPool in + + if tokens_deposited > maxTokensDeposited then + (failwith error_MAX_TOKENS_DEPOSITED_MUST_BE_GREATER_THAN_OR_EQUAL_TO_TOKENS_DEPOSITED : result) + else if lqt_minted < minLqtMinted then + (failwith error_LQT_MINTED_MUST_BE_GREATER_THAN_MIN_LQT_MINTED : result) + else + let storage = {storage with + lqtTotal = storage.lqtTotal + lqt_minted ; + tokenPool = storage.tokenPool + tokens_deposited ; + xtzPool = storage.xtzPool + Tezos.amount} in + + // send tokens from sender to exchange + let op_token = token_transfer storage Tezos.sender Tezos.self_address tokens_deposited in + // mint lqt tokens for them + let op_lqt = mint_or_burn storage owner (int lqt_minted) in + ([op_token; op_lqt], storage) + +let remove_liquidity (param : remove_liquidity) (storage : storage) : result = + let { to_ = to_ ; + lqtBurned = lqtBurned ; + minXtzWithdrawn = minXtzWithdrawn ; + minTokensWithdrawn = minTokensWithdrawn ; + deadline = deadline } = param in + + if Tezos.now >= deadline then + (failwith error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE : result) + else if Tezos.amount > 0mutez then + (failwith error_AMOUNT_MUST_BE_ZERO : result) + else begin + let xtz_withdrawn : tez = natural_to_mutez ((lqtBurned * (mutez_to_natural storage.xtzPool)) / storage.lqtTotal) in + let tokens_withdrawn : nat = lqtBurned * storage.tokenPool / storage.lqtTotal in + + // Check that minimum withdrawal conditions are met + if xtz_withdrawn < minXtzWithdrawn then + (failwith error_THE_AMOUNT_OF_XTZ_WITHDRAWN_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_XTZ_WITHDRAWN : result) + else if tokens_withdrawn < minTokensWithdrawn then + (failwith error_THE_AMOUNT_OF_TOKENS_WITHDRAWN_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_TOKENS_WITHDRAWN : result) + // Proceed to form the operations and update the storage + else begin + // calculate lqtTotal, convert int to nat + let new_lqtTotal = match (is_a_nat ( storage.lqtTotal - lqtBurned)) with + // This check should be unecessary, the fa12 logic normally takes care of it + | None -> (failwith error_CANNOT_BURN_MORE_THAN_THE_TOTAL_AMOUNT_OF_LQT : nat) + | Some n -> n in + // Calculate tokenPool, convert int to nat + let new_tokenPool = match is_a_nat (storage.tokenPool - tokens_withdrawn) with + | None -> (failwith error_TOKEN_POOL_MINUS_TOKENS_WITHDRAWN_IS_NEGATIVE : nat) + | Some n -> n in + + let op_lqt = mint_or_burn storage Tezos.sender (0 - lqtBurned) in + let op_token = token_transfer storage Tezos.self_address to_ tokens_withdrawn in + let op_xtz = xtz_transfer to_ xtz_withdrawn in + let storage = {storage with xtzPool = storage.xtzPool - xtz_withdrawn ; lqtTotal = new_lqtTotal ; tokenPool = new_tokenPool} in + ([op_lqt; op_token; op_xtz], storage) + end + end + + +let xtz_to_token (param : xtz_to_token) (storage : storage) = + let { to_ = to_ ; + minTokensBought = minTokensBought ; + deadline = deadline } = param in + + if Tezos.now >= deadline then + (failwith error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE : result) + else begin + // we don't check that xtzPool > 0, because that is impossible + // unless all liquidity has been removed + let xtzPool = mutez_to_natural storage.xtzPool in + let nat_amount = mutez_to_natural Tezos.amount in + + let amount_net_burn = (nat_amount * 999n) / 1000n in + let burn_amount = abs (nat_amount - amount_net_burn) in + + let tokens_bought = + (let bought = (amount_net_burn * fee * storage.tokenPool) / (xtzPool * 1000n + (amount_net_burn * fee)) in + if bought < minTokensBought then + (failwith error_TOKENS_BOUGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_TOKENS_BOUGHT : nat) + else + bought) + in + let new_tokenPool = (match is_nat (storage.tokenPool - tokens_bought) with + | None -> (failwith error_TOKEN_POOL_MINUS_TOKENS_BOUGHT_IS_NEGATIVE : nat) + | Some difference -> difference) in + + // update xtzPool + let storage = {storage with + xtzPool = storage.xtzPool + (natural_to_mutez amount_net_burn); + tokenPool = new_tokenPool } in + // send tokens_withdrawn to to address + // if tokens_bought is greater than storage.tokenPool, this will fail + let op = token_transfer storage Tezos.self_address to_ tokens_bought in + let op_burn = xtz_transfer null_address (natural_to_mutez burn_amount) in + ([ op ; op_burn], storage) + end + + +let token_to_xtz (param : token_to_xtz) (storage : storage) = + let { to_ = to_ ; + tokensSold = tokensSold ; + minXtzBought = minXtzBought ; + deadline = deadline } = param in + + if Tezos.now >= deadline then + (failwith error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE : result) + else if Tezos.amount > 0mutez then + (failwith error_AMOUNT_MUST_BE_ZERO : result) + else + // we don't check that tokenPool > 0, because that is impossible + // unless all liquidity has been removed + let xtz_bought = natural_to_mutez (((tokensSold * fee * (mutez_to_natural storage.xtzPool)) / (storage.tokenPool * 1000n + (tokensSold * fee)))) in + + let xtz_bought_net_burn = + let bought = (xtz_bought * 999n) / 1000n in + if bought < minXtzBought then (failwith error_XTZ_BOUGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO_MIN_XTZ_BOUGHT : tez) else bought in + + let op_token = token_transfer storage Tezos.sender Tezos.self_address tokensSold in + let op_tez = xtz_transfer to_ xtz_bought_net_burn in + let storage = {storage with tokenPool = storage.tokenPool + tokensSold ; + xtzPool = storage.xtzPool - xtz_bought } in + + let burn_amount = xtz_bought - xtz_bought_net_burn in + let op_burn = xtz_transfer null_address burn_amount in + ([op_token ; op_tez; op_burn], storage) + +// entrypoint to allow depositing funds +let default_ (storage : storage) : result = + // update xtzPool + let storage = {storage with xtzPool = storage.xtzPool + Tezos.amount } in + (([] : operation list), storage) + +let token_to_token (param : token_to_token) (storage : storage) : result = + let { outputDexterContract = outputDexterContract ; + minTokensBought = minTokensBought ; + to_ = to_ ; + tokensSold = tokensSold ; + deadline = deadline } = param in + + let outputDexterContract_contract: xtz_to_token contract = + (match (Tezos.get_entrypoint_opt "%xtzToToken" outputDexterContract : xtz_to_token contract option) with + | None -> (failwith error_INVALID_INTERMEDIATE_CONTRACT : xtz_to_token contract) + | Some c -> c) in + + if Tezos.amount > 0mutez then + (failwith error_AMOUNT_MUST_BE_ZERO : result) + else if Tezos.now >= deadline then + (failwith error_THE_CURRENT_TIME_MUST_BE_LESS_THAN_THE_DEADLINE : result) + else + // we don't check that tokenPool > 0, because that is impossible unless all liquidity has been removed + let xtz_bought = (tokensSold * fee * storage.xtzPool) / (storage.tokenPool * 1000n + (tokensSold * fee)) in + + let xtz_bought_net_burn = (xtz_bought * 999n) / 1000n in + + let storage = {storage with + tokenPool = storage.tokenPool + tokensSold ; + xtzPool = storage.xtzPool - xtz_bought } in + + let op1 = token_transfer storage Tezos.sender Tezos.self_address tokensSold in + let op2 = + Tezos.transaction + {to_ = to_; minTokensBought = minTokensBought; deadline = deadline} + xtz_bought_net_burn + outputDexterContract_contract in + + let burn_amount = xtz_bought - xtz_bought_net_burn in + let op_burn = xtz_transfer null_address burn_amount in + ([op1 ; op2; op_burn], storage) + +// ============================================================================= +// Main +// ============================================================================= + +let main ((entrypoint, storage) : entrypoint * storage) : result = + match entrypoint with + | AddLiquidity param -> + add_liquidity param storage + | RemoveLiquidity param -> + remove_liquidity param storage + | Default -> + default_ storage + | XtzToToken param -> + xtz_to_token param storage + | TokenToXtz param -> + token_to_xtz param storage + | TokenToToken param -> + token_to_token param storage \ No newline at end of file diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.tz b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.tz new file mode 100644 index 000000000000..15a0819c52e8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/cpmm.tz @@ -0,0 +1,929 @@ +{ parameter + (or (or (or (pair %addLiquidity + (address %owner) + (pair (nat %minLqtMinted) (pair (nat %maxTokensDeposited) (timestamp %deadline)))) + (unit %default)) + (or (pair %removeLiquidity + (address %to) + (pair (nat %lqtBurned) + (pair (mutez %minXtzWithdrawn) (pair (nat %minTokensWithdrawn) (timestamp %deadline))))) + (pair %tokenToToken + (address %outputDexterContract) + (pair (nat %minTokensBought) + (pair (address %to) (pair (nat %tokensSold) (timestamp %deadline))))))) + (or (pair %tokenToXtz + (address %to) + (pair (nat %tokensSold) (pair (mutez %minXtzBought) (timestamp %deadline)))) + (pair %xtzToToken (address %to) (pair (nat %minTokensBought) (timestamp %deadline))))) ; + storage + (pair (nat %tokenPool) + (pair (mutez %xtzPool) + (pair (nat %lqtTotal) (pair (address %tokenAddress) (address %lqtAddress))))) ; + code { DUP ; + CDR ; + SWAP ; + CAR ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + NOW ; + COMPARE ; + GE ; + IF { DROP 4 ; PUSH nat 3 ; FAILWITH } + { PUSH mutez 1 ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CAR ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + AMOUNT ; + PUSH mutez 1 ; + SWAP ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + SWAP ; + DUP ; + DUG 2 ; + DIG 6 ; + DUP ; + DUG 7 ; + CDR ; + CDR ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 2 ; + DIG 6 ; + DUP ; + DUG 7 ; + CAR ; + DIG 3 ; + MUL ; + EDIV ; + IF_NONE + { PUSH string "DIV by 0" ; FAILWITH } + { DUP ; + CDR ; + SWAP ; + CAR ; + PUSH nat 0 ; + DIG 2 ; + COMPARE ; + EQ ; + IF {} { PUSH nat 1 ; ADD } } ; + DIG 2 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + GT ; + IF { DROP 5 ; PUSH nat 4 ; FAILWITH } + { DUG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + LT ; + IF { DROP 4 ; PUSH nat 5 ; FAILWITH } + { DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + CDR ; + DIG 2 ; + DUP ; + DUG 3 ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + CDR ; + CAR ; + ADD ; + PAIR ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CAR ; + PAIR ; + DIG 4 ; + DUP ; + DUG 5 ; + CAR ; + PAIR ; + CDR ; + SWAP ; + DUP ; + DUG 2 ; + DIG 5 ; + DUP ; + DUG 6 ; + CAR ; + ADD ; + PAIR ; + DUP ; + CDR ; + CDR ; + AMOUNT ; + DIG 6 ; + CDR ; + CAR ; + ADD ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + SWAP ; + SELF ; + ADDRESS ; + PAIR ; + SENDER ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + CAR ; + CONTRACT %transfer (pair address (pair address nat)) ; + IF_NONE { PUSH nat 0 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 3 ; + DIG 3 ; + PAIR ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 2 ; + INT ; + DIG 3 ; + PAIR ; + DIG 2 ; + DUP ; + DUG 3 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 2 ; + CDR ; + CDR ; + CDR ; + CDR ; + CONTRACT %mintOrBurn (pair (int %quantity) (address %target)) ; + IF_NONE { PUSH nat 12 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 2 ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 2 ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } } } + { DROP ; + DUP ; + CDR ; + CDR ; + AMOUNT ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CAR ; + ADD ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } } + { IF_LEFT + { DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + NOW ; + COMPARE ; + GE ; + IF { DROP 5 ; PUSH nat 3 ; FAILWITH } + { PUSH mutez 0 ; + AMOUNT ; + COMPARE ; + GT ; + IF { DROP 5 ; PUSH nat 10 ; FAILWITH } + { DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CDR ; + CAR ; + PUSH mutez 1 ; + DIG 6 ; + DUP ; + DUG 7 ; + CDR ; + CAR ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 4 ; + DUP ; + DUG 5 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + PUSH mutez 1 ; + SWAP ; + MUL ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + CDR ; + CAR ; + DIG 6 ; + DUP ; + DUG 7 ; + CAR ; + DIG 5 ; + DUP ; + DUG 6 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 3 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + LT ; + IF { DROP 6 ; PUSH nat 11 ; FAILWITH } + { DIG 2 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + LT ; + IF { DROP 5 ; PUSH nat 13 ; FAILWITH } + { DIG 2 ; + DUP ; + DUG 3 ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + CDR ; + CAR ; + SUB ; + ISNAT ; + IF_NONE { PUSH nat 14 ; FAILWITH } {} ; + SWAP ; + DUP ; + DUG 2 ; + DIG 6 ; + DUP ; + DUG 7 ; + CAR ; + SUB ; + ISNAT ; + IF_NONE { PUSH nat 15 ; FAILWITH } {} ; + DIG 4 ; + PUSH int 0 ; + SUB ; + SENDER ; + PAIR ; + DIG 6 ; + DUP ; + DUG 7 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 2 ; + CDR ; + CDR ; + CDR ; + CDR ; + CONTRACT %mintOrBurn (pair (int %quantity) (address %target)) ; + IF_NONE { PUSH nat 12 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 2 ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 3 ; + DIG 5 ; + DUP ; + DUG 6 ; + PAIR ; + SELF ; + ADDRESS ; + PAIR ; + DIG 6 ; + DUP ; + DUG 7 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + CAR ; + CONTRACT %transfer (pair address (pair address nat)) ; + IF_NONE { PUSH nat 0 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 3 ; + DIG 3 ; + PAIR ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 4 ; + DUP ; + DUG 5 ; + DIG 6 ; + CONTRACT unit ; + IF_NONE { PUSH nat 9 ; FAILWITH } {} ; + SWAP ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + DIG 6 ; + DUP ; + DUG 7 ; + CDR ; + CDR ; + DIG 6 ; + DIG 7 ; + DUP ; + DUG 8 ; + CDR ; + CAR ; + SUB ; + PAIR ; + DIG 6 ; + CAR ; + PAIR ; + DUP ; + CDR ; + CDR ; + CDR ; + DIG 6 ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + CDR ; + DIG 4 ; + PAIR ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } } } } + { DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 4 ; + CONTRACT %xtzToToken + (pair (address %to) (pair (nat %minTokensBought) (timestamp %deadline))) ; + IF_NONE { PUSH nat 31 ; FAILWITH } {} ; + PUSH mutez 0 ; + AMOUNT ; + COMPARE ; + GT ; + IF { DROP 6 ; PUSH nat 10 ; FAILWITH } + { DIG 2 ; + DUP ; + DUG 3 ; + NOW ; + COMPARE ; + GE ; + IF { DROP 6 ; PUSH nat 3 ; FAILWITH } + { PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + PUSH nat 1000 ; + DIG 7 ; + DUP ; + DUG 8 ; + CAR ; + MUL ; + ADD ; + DIG 6 ; + DUP ; + DUG 7 ; + CDR ; + CAR ; + PUSH nat 999 ; + DIG 4 ; + DUP ; + DUG 5 ; + MUL ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + PUSH nat 1000 ; + PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 7 ; + DUP ; + DUG 8 ; + CDR ; + DIG 4 ; + DUP ; + DUG 5 ; + DIG 9 ; + DUP ; + DUG 10 ; + CAR ; + ADD ; + PAIR ; + DUP ; + CDR ; + CDR ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 10 ; + CDR ; + CAR ; + SUB ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + DIG 4 ; + SELF ; + ADDRESS ; + PAIR ; + SENDER ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + CAR ; + CONTRACT %transfer (pair address (pair address nat)) ; + IF_NONE { PUSH nat 0 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 3 ; + DIG 3 ; + PAIR ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 4 ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 6 ; + DIG 8 ; + PAIR ; + DIG 7 ; + PAIR ; + TRANSFER_TOKENS ; + DIG 3 ; + DIG 4 ; + SUB ; + PUSH address "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" ; + CONTRACT unit ; + IF_NONE { PUSH nat 9 ; FAILWITH } {} ; + SWAP ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + DIG 3 ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } } } } + { IF_LEFT + { DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + NOW ; + COMPARE ; + GE ; + IF { DROP 4 ; PUSH nat 3 ; FAILWITH } + { PUSH mutez 0 ; + AMOUNT ; + COMPARE ; + GT ; + IF { DROP 4 ; PUSH nat 10 ; FAILWITH } + { PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + PUSH nat 1000 ; + DIG 5 ; + DUP ; + DUG 6 ; + CAR ; + MUL ; + ADD ; + PUSH mutez 1 ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + CAR ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + PUSH nat 999 ; + DIG 4 ; + DUP ; + DUG 5 ; + MUL ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + PUSH mutez 1 ; + SWAP ; + MUL ; + PUSH nat 1000 ; + PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 2 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + LT ; + IF { DROP ; PUSH nat 8 ; FAILWITH } {} ; + DIG 2 ; + DUP ; + DUG 3 ; + SELF ; + ADDRESS ; + PAIR ; + SENDER ; + PAIR ; + DIG 5 ; + DUP ; + DUG 6 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + CAR ; + CONTRACT %transfer (pair address (pair address nat)) ; + IF_NONE { PUSH nat 0 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 3 ; + DIG 3 ; + PAIR ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + SWAP ; + DUP ; + DUG 2 ; + DIG 5 ; + CONTRACT unit ; + IF_NONE { PUSH nat 9 ; FAILWITH } {} ; + SWAP ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + DIG 5 ; + DIG 6 ; + DUP ; + DUG 7 ; + CAR ; + ADD ; + PAIR ; + DUP ; + CDR ; + CDR ; + DIG 5 ; + DUP ; + DUG 6 ; + DIG 7 ; + CDR ; + CAR ; + SUB ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + DIG 3 ; + DIG 4 ; + SUB ; + PUSH address "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" ; + CONTRACT unit ; + IF_NONE { PUSH nat 9 ; FAILWITH } {} ; + SWAP ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + SWAP ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } } + { DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + NOW ; + COMPARE ; + GE ; + IF { DROP 3 ; PUSH nat 3 ; FAILWITH } + { PUSH mutez 1 ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CAR ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + AMOUNT ; + PUSH mutez 1 ; + SWAP ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + PUSH nat 1000 ; + PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DUP ; + DIG 2 ; + SUB ; + ABS ; + PUSH nat 999 ; + DIG 2 ; + DUP ; + DUG 3 ; + MUL ; + PUSH nat 1000 ; + DIG 4 ; + MUL ; + ADD ; + DIG 5 ; + DUP ; + DUG 6 ; + CAR ; + PUSH nat 999 ; + DIG 4 ; + DUP ; + DUG 5 ; + MUL ; + MUL ; + EDIV ; + IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; + CAR ; + DIG 3 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + LT ; + IF { DROP ; PUSH nat 18 ; FAILWITH } {} ; + DUP ; + DIG 5 ; + DUP ; + DUG 6 ; + CAR ; + SUB ; + ISNAT ; + IF_NONE { PUSH nat 19 ; FAILWITH } {} ; + DIG 5 ; + DUP ; + DUG 6 ; + CDR ; + CDR ; + PUSH mutez 1 ; + DIG 5 ; + MUL ; + DIG 6 ; + DUP ; + DUG 7 ; + CDR ; + CAR ; + ADD ; + PAIR ; + DIG 5 ; + CAR ; + PAIR ; + CDR ; + SWAP ; + PAIR ; + SWAP ; + DIG 3 ; + PAIR ; + SELF ; + ADDRESS ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + SWAP ; + DUP ; + CDR ; + SWAP ; + CAR ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + CAR ; + CONTRACT %transfer (pair address (pair address nat)) ; + IF_NONE { PUSH nat 0 ; FAILWITH } {} ; + PUSH mutez 0 ; + DIG 3 ; + DIG 3 ; + PAIR ; + DIG 3 ; + PAIR ; + TRANSFER_TOKENS ; + PUSH mutez 1 ; + DIG 3 ; + MUL ; + PUSH address "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" ; + CONTRACT unit ; + IF_NONE { PUSH nat 9 ; FAILWITH } {} ; + SWAP ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + DIG 2 ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } } } } + diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.bin b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.bin new file mode 100644 index 000000000000..4fa01f58526f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.bin @@ -0,0 +1 @@ +0x020000070005000764076407640865046e00000008257370656e6465720462000000062576616c75650000000825617070726f766508650865046e00000006256f776e6572046e00000008257370656e646572000000082572657175657374065a0362000000092563616c6c6261636b0000000d25676574416c6c6f77616e636507640865046e00000006256f776e6572065a0362000000092563616c6c6261636b0000000b2567657442616c616e63650865046c000000082572657175657374065a0362000000092563616c6c6261636b0000000f25676574546f74616c537570706c7907640865045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e0865046e000000052566726f6d0765046e0000000325746f0462000000062576616c756500000009257472616e73666572050107650861036e03620000000725746f6b656e73076508610765046e00000006256f776e6572046e00000008257370656e64657203620000000b25616c6c6f77616e6365730765046e000000062561646d696e04620000000d25746f74616c5f737570706c7905020200000552032103170743036a000003130319033c072c020000001607430368010000000b446f6e7453656e6454657a03270200000000034c0316072e02000001b2072e0200000132072e02000000e2034c03210571000203170316034c0321057100020316034803420743036200000570000303210571000403170319032a07430362000005700003032105710004057000030321057100040329072f020000000607430362000002000000000319032a0314072c0200000020074303680100000015556e73616665416c6c6f77616e63654368616e676503270200000000057000030321057100040317031705700002057000030317074303620000034c03210571000203190325072c02000000060320053e0362020000000203460570000303500342034c03160342053d036d03420200000044034c032105700002053d036d034c03210571000203170743036a000005700004031703160570000403160329072f02000000060743036200000200000000034d031b03420200000074072e0200000042034c032105700002053d036d034c03210571000203170743036a00000570000403160570000403160329072f02000000060743036200000200000000034d031b03420200000026034c032105700002053d036d034c03170743036a000005700003031703170317034d031b0342020000035e072e020000013c034c03210571000203170317031603480319033c072c02000000140743036801000000094f6e6c7941646d696e03270200000000032103160570000203210571000303160570000203210571000303170329072f0200000006074303620000020000000003120356072f020000003607430368010000002b43616e6e6f74206275726e206d6f7265207468616e207468652074617267657427732062616c616e63652e03270200000000034c032105710002031605700003032105710004031703170317031203110570000303210571000403170570000403160743036200000570000403210571000503190325072c020000000a057000030320053e03620200000006057000030346057000040317035003420321057100020317031703160342034c032105710002031703160342034c03160342053d036d03420200000216034c03210571000203170316057000020321057100030316057000020321057100030316034803190325072c0200000002034c02000000a903480570000303210571000403160342057000030321057100040317031705700003032105710004057000020321057100030329072f02000000060743036200000200000000034b0356072f020000001d0743036801000000124e6f74456e6f756768416c6c6f77616e636503270200000000057000030743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c03460570000203500570000203210571000303170317057000020321057100030570000403210571000503160329072f02000000060743036200000200000000034b0356072f020000001b0743036801000000104e6f74456e6f75676842616c616e636503270200000000057000020743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c034605700003032105710004031603500570000203210571000303170317034c03210571000205700004032105710005031703160329072f020000000607430362000002000000000312034c0743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c034605700003031703160350057000020317034c0342032103170317057000020342034c03160342053d036d0342 diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.mligo b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.mligo new file mode 100644 index 000000000000..7c2fa5012d1e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.mligo @@ -0,0 +1,164 @@ +type transfer = + [@layout:comb] + { [@annot:from] address_from : address; + [@annot:to] address_to : address; + value : nat } + +type approve = + [@layout:comb] + { spender : address; + value : nat } + +type mintOrBurn = + [@layout:comb] + { quantity : int ; + target : address } + +type allowance_key = + [@layout:comb] + { owner : address; + spender : address } + +type getAllowance = + [@layout:comb] + { request : allowance_key; + callback : nat contract } + +type getBalance = + [@layout:comb] + { owner : address; + callback : nat contract } + +type getTotalSupply = + [@layout:comb] + { request : unit ; + callback : nat contract } + +type tokens = (address, nat) big_map +type allowances = (allowance_key, nat) big_map + +type storage = + [@layout:comb] + { tokens : tokens; + allowances : allowances; + admin : address; + total_supply : nat; + } + +type parameter = + | Transfer of transfer + | Approve of approve + | MintOrBurn of mintOrBurn + | GetAllowance of getAllowance + | GetBalance of getBalance + | GetTotalSupply of getTotalSupply + +type result = operation list * storage + +[@inline] +let maybe (n : nat) : nat option = + if n = 0n + then (None : nat option) + else Some n + +let transfer (param : transfer) (storage : storage) : result = + let allowances = storage.allowances in + let tokens = storage.tokens in + let allowances = + if Tezos.sender = param.address_from + then allowances + else + let allowance_key = { owner = param.address_from ; spender = Tezos.sender } in + let authorized_value = + match Big_map.find_opt allowance_key allowances with + | Some value -> value + | None -> 0n in + let authorized_value = + match is_nat (authorized_value - param.value) with + | None -> (failwith "NotEnoughAllowance" : nat) + | Some authorized_value -> authorized_value in + Big_map.update allowance_key (maybe authorized_value) allowances in + let tokens = + let from_balance = + match Big_map.find_opt param.address_from tokens with + | Some value -> value + | None -> 0n in + let from_balance = + match is_nat (from_balance - param.value) with + | None -> (failwith "NotEnoughBalance" : nat) + | Some from_balance -> from_balance in + Big_map.update param.address_from (maybe from_balance) tokens in + let tokens = + let to_balance = + match Big_map.find_opt param.address_to tokens with + | Some value -> value + | None -> 0n in + let to_balance = to_balance + param.value in + Big_map.update param.address_to (maybe to_balance) tokens in + (([] : operation list), { storage with tokens = tokens; allowances = allowances }) + +let approve (param : approve) (storage : storage) : result = + let allowances = storage.allowances in + let allowance_key = { owner = Tezos.sender ; spender = param.spender } in + let previous_value = + match Big_map.find_opt allowance_key allowances with + | Some value -> value + | None -> 0n in + begin + if previous_value > 0n && param.value > 0n + then (failwith "UnsafeAllowanceChange") + else (); + let allowances = Big_map.update allowance_key (maybe param.value) allowances in + (([] : operation list), { storage with allowances = allowances }) + end + +let mintOrBurn (param : mintOrBurn) (storage : storage) : result = + begin + if Tezos.sender <> storage.admin + then failwith "OnlyAdmin" + else (); + let tokens = storage.tokens in + let old_balance = + match Big_map.find_opt param.target tokens with + | None -> 0n + | Some bal -> bal in + let new_balance = + match is_nat (old_balance + param.quantity) with + | None -> (failwith "Cannot burn more than the target's balance." : nat) + | Some bal -> bal in + let tokens = Big_map.update param.target (maybe new_balance) storage.tokens in + let total_supply = abs (storage.total_supply + param.quantity) in + (([] : operation list), { storage with tokens = tokens ; total_supply = total_supply }) + end + +let getAllowance (param : getAllowance) (storage : storage) : operation list = + let value = + match Big_map.find_opt param.request storage.allowances with + | Some value -> value + | None -> 0n in + [Tezos.transaction value 0mutez param.callback] + +let getBalance (param : getBalance) (storage : storage) : operation list = + let value = + match Big_map.find_opt param.owner storage.tokens with + | Some value -> value + | None -> 0n in + [Tezos.transaction value 0mutez param.callback] + +let getTotalSupply (param : getTotalSupply) (storage : storage) : operation list = + let total = storage.total_supply in + [Tezos.transaction total 0mutez param.callback] + +let main (param, storage : parameter * storage) : result = + begin + if Tezos.amount <> 0mutez + then failwith "DontSendTez" + else (); + match param with + | Transfer param -> transfer param storage + | Approve param -> approve param storage + | MintOrBurn param -> mintOrBurn param storage + | GetAllowance param -> (getAllowance param storage, storage) + | GetBalance param -> (getBalance param storage, storage) + | GetTotalSupply param -> (getTotalSupply param storage, storage) + end diff --git a/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.tz b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.tz new file mode 100644 index 000000000000..d0f5f45fd05f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/contracts/lqt.tz @@ -0,0 +1,327 @@ +{ parameter + (or (or (or (pair %approve (address %spender) (nat %value)) + (pair %getAllowance + (pair %request (address %owner) (address %spender)) + (contract %callback nat))) + (or (pair %getBalance (address %owner) (contract %callback nat)) + (pair %getTotalSupply (unit %request) (contract %callback nat)))) + (or (pair %mintOrBurn (int %quantity) (address %target)) + (pair %transfer (address %from) (pair (address %to) (nat %value))))) ; + storage + (pair (big_map %tokens address nat) + (pair (big_map %allowances (pair (address %owner) (address %spender)) nat) + (pair (address %admin) (nat %total_supply)))) ; + code { DUP ; + CDR ; + PUSH mutez 0 ; + AMOUNT ; + COMPARE ; + NEQ ; + IF { PUSH string "DontSendTez" ; FAILWITH } {} ; + SWAP ; + CAR ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + SWAP ; + DUP ; + DUG 2 ; + CAR ; + SENDER ; + PAIR ; + PUSH nat 0 ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + COMPARE ; + GT ; + PUSH nat 0 ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 3 ; + DUP ; + DUG 4 ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + COMPARE ; + GT ; + AND ; + IF { PUSH string "UnsafeAllowanceChange" ; FAILWITH } {} ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + DIG 2 ; + DIG 3 ; + CDR ; + PUSH nat 0 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + EQ ; + IF { DROP ; NONE nat } { SOME } ; + DIG 3 ; + UPDATE ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + PUSH mutez 0 ; + DIG 4 ; + CDR ; + CAR ; + DIG 4 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + TRANSFER_TOKENS ; + CONS ; + PAIR } } + { IF_LEFT + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + PUSH mutez 0 ; + DIG 4 ; + CAR ; + DIG 4 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + TRANSFER_TOKENS ; + CONS ; + PAIR } + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + CDR ; + PUSH mutez 0 ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + TRANSFER_TOKENS ; + CONS ; + PAIR } } } + { IF_LEFT + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CDR ; + CAR ; + SENDER ; + COMPARE ; + NEQ ; + IF { PUSH string "OnlyAdmin" ; FAILWITH } {} ; + DUP ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + ADD ; + ISNAT ; + IF_NONE + { PUSH string "Cannot burn more than the target's balance." ; FAILWITH } + {} ; + SWAP ; + DUP ; + DUG 2 ; + CAR ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + CDR ; + ADD ; + ABS ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + DIG 4 ; + CAR ; + PUSH nat 0 ; + DIG 4 ; + DUP ; + DUG 5 ; + COMPARE ; + EQ ; + IF { DIG 3 ; DROP ; NONE nat } { DIG 3 ; SOME } ; + DIG 4 ; + CDR ; + UPDATE ; + PAIR ; + DUP ; + DUG 2 ; + CDR ; + CDR ; + CAR ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + SENDER ; + COMPARE ; + EQ ; + IF { SWAP } + { SENDER ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + PAIR ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 2 ; + DUP ; + DUG 3 ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + SUB ; + ISNAT ; + IF_NONE { PUSH string "NotEnoughAllowance" ; FAILWITH } {} ; + DIG 3 ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 2 ; + UPDATE } ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CDR ; + DIG 2 ; + DUP ; + DUG 3 ; + DIG 4 ; + DUP ; + DUG 5 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + SUB ; + ISNAT ; + IF_NONE { PUSH string "NotEnoughBalance" ; FAILWITH } {} ; + DIG 2 ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + UPDATE ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CDR ; + SWAP ; + DUP ; + DUG 2 ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + ADD ; + SWAP ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 3 ; + CDR ; + CAR ; + UPDATE ; + DIG 2 ; + CDR ; + SWAP ; + PAIR ; + DUP ; + CDR ; + CDR ; + DIG 2 ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } } } } + diff --git a/src/proto_016_PtMumbai/lib_protocol/cycle_repr.ml b/src/proto_016_PtMumbai/lib_protocol/cycle_repr.ml new file mode 100644 index 000000000000..b1a4b8bc6e0b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/cycle_repr.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = int32 + +type cycle = t + +let encoding = Data_encoding.int32 + +let rpc_arg = RPC_arg.like RPC_arg.uint31 ~descr:"A cycle integer" "block_cycle" + +let pp ppf cycle = Format.fprintf ppf "%ld" cycle + +include (Compare.Int32 : Compare.S with type t := t) + +module Map = Map.Make (Compare.Int32) + +let root = 0l + +let succ = Int32.succ + +let pred = function 0l -> None | i -> Some (Int32.pred i) + +let add c i = + assert (Compare.Int.(i >= 0)) ; + Int32.add c (Int32.of_int i) + +let sub c i = + assert (Compare.Int.(i >= 0)) ; + let r = Int32.sub c (Int32.of_int i) in + if Compare.Int32.(r < 0l) then None else Some r + +let diff = Int32.sub + +let to_int32 i = i + +let of_int32_exn l = + if Compare.Int32.(l >= 0l) then l else invalid_arg "Cycle_repr.of_int32_exn" + +let of_string_exn s = + let int32_opt = Int32.of_string_opt s in + match int32_opt with + | None -> invalid_arg "Cycle_repr.of_string_exn" + | Some int32 -> of_int32_exn int32 + +let ( ---> ) = Misc.( ---> ) + +module Index = struct + type t = cycle + + let path_length = 1 + + let to_path c l = Int32.to_string (to_int32 c) :: l + + let of_path = function [s] -> Int32.of_string_opt s | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end diff --git a/src/proto_016_PtMumbai/lib_protocol/cycle_repr.mli b/src/proto_016_PtMumbai/lib_protocol/cycle_repr.mli new file mode 100644 index 000000000000..7ff7a730bb82 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/cycle_repr.mli @@ -0,0 +1,66 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides a type and functions to manipulate cycle numbers. + + Invariant: cycle numbers are always positive. *) + +type t + +type cycle = t + +include Compare.S with type t := t + +val encoding : cycle Data_encoding.t + +val rpc_arg : cycle RPC_arg.arg + +val pp : Format.formatter -> cycle -> unit + +val root : cycle + +val pred : cycle -> cycle option + +val add : cycle -> int -> cycle + +val sub : cycle -> int -> cycle option + +val succ : cycle -> cycle + +val diff : cycle -> cycle -> int32 + +(** a ---> b = [a; ...; b] *) +val ( ---> ) : cycle -> cycle -> cycle list + +val to_int32 : cycle -> int32 + +val of_int32_exn : int32 -> cycle + +val of_string_exn : string -> cycle + +module Map : Map.S with type key = cycle + +module Index : Storage_description.INDEX with type t = cycle diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_apply.ml b/src/proto_016_PtMumbai/lib_protocol/dal_apply.ml new file mode 100644 index 000000000000..25a71055138e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_apply.ml @@ -0,0 +1,172 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Every function of this file should check the feature flag. *) + +open Alpha_context +open Dal_errors + +let assert_dal_feature_enabled ctxt = + let open Constants in + let Parametric.{dal = {feature_enable; _}; _} = parametric ctxt in + error_unless Compare.Bool.(feature_enable = true) Dal_feature_disabled + +let only_if_dal_feature_enabled ctxt ~default f = + let open Constants in + let Parametric.{dal = {feature_enable; _}; _} = parametric ctxt in + if feature_enable then f ctxt else default ctxt + +let slot_of_int_e n = + let open Result_syntax in + match Dal.Slot_index.of_int n with + | None -> tzfail Dal_errors.Dal_slot_index_above_hard_limit + | Some slot_index -> return slot_index + +let validate_attestation ctxt op = + assert_dal_feature_enabled ctxt >>? fun () -> + let open Result_syntax in + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/4163 + check the signature of the attestor as well *) + let Dal.Attestation.{attestor = _; attestation; level = given} = op in + let* max_index = + slot_of_int_e @@ ((Constants.parametric ctxt).dal.number_of_slots - 1) + in + let maximum_size = Dal.Attestation.expected_size_in_bits ~max_index in + let size = Dal.Attestation.occupied_size_in_bits attestation in + let* () = + error_unless + Compare.Int.(size <= maximum_size) + (Dal_attestation_size_limit_exceeded {maximum_size; got = size}) + in + let current = Level.(current ctxt).level in + let delta_levels = Raw_level.diff current given in + let* () = + error_when + Compare.Int32.(delta_levels > 0l) + (Dal_operation_for_old_level {current; given}) + in + error_when + Compare.Int32.(delta_levels < 0l) + (Dal_operation_for_future_level {current; given}) + +let apply_attestation ctxt op = + assert_dal_feature_enabled ctxt >>? fun () -> + let Dal.Attestation.{attestor; attestation; level = _} = op in + match Dal.Attestation.shards_of_attestor ctxt ~attestor with + | None -> + let level = Level.current ctxt in + error (Dal_data_availibility_attestor_not_in_committee {attestor; level}) + | Some shards -> + Ok (Dal.Attestation.record_available_shards ctxt attestation shards) + +let validate_publish_slot_header ctxt operation = + assert_dal_feature_enabled ctxt >>? fun () -> + let open Result_syntax in + let open Constants in + let Dal.Slot.Header.{id = {index; published_level}; _} = + operation.Dal.Slot.Header.header + in + let Parametric.{dal = {number_of_slots; cryptobox_parameters; _}; _} = + parametric ctxt + in + let* number_of_slots = slot_of_int_e (number_of_slots - 1) in + let* () = + error_unless + Compare.Int.( + Dal.Slot_index.compare index number_of_slots <= 0 + && Dal.Slot_index.compare index Dal.Slot_index.zero >= 0) + (Dal_publish_slot_header_invalid_index + {given = index; maximum = number_of_slots}) + in + let current_level = (Level.current ctxt).level in + let* () = + error_when + Raw_level.(current_level < published_level) + (Dal_publish_slot_header_future_level + {provided = published_level; expected = current_level}) + in + let* () = + error_when + Raw_level.(current_level > published_level) + (Dal_publish_slot_header_past_level + {provided = published_level; expected = current_level}) + in + let* proof_ok = + Dal.Slot.Header.verify_commitment cryptobox_parameters operation + in + error_unless + proof_ok + (Dal_publish_slot_header_invalid_proof {slot_header = operation}) + +let apply_publish_slot_header ctxt operation = + assert_dal_feature_enabled ctxt >>? fun () -> + Dal.Slot.register_slot_header ctxt operation.Dal.Slot.Header.header + >>? fun (ctxt, updated) -> + if updated then ok ctxt + else + error (Dal_publish_slot_header_duplicate {slot_header = operation.header}) + +let finalisation ctxt = + only_if_dal_feature_enabled + ctxt + ~default:(fun ctxt -> return (ctxt, None)) + (fun ctxt -> + Dal.Slot.finalize_current_slot_headers ctxt >>= fun ctxt -> + (* The fact that slots confirmation is done at finalization is very + important for the assumptions made by the Dal refutation game. In fact: + - {!Dal.Slot.finalize_current_slot_headers} updates the Dal skip list + at block finalization, by inserting newly confirmed slots; + - {!Sc_rollup.Game.initial}, called when applying a manager operation + that starts a refutation game, makes a snapshot of the Dal skip list + to use it as a reference if the refutation proof involves a Dal input. + + If confirmed Dal slots are inserted into the skip list during operations + application, adapting how refutation games are made might be needed + to e.g., + - use the same snapshotted skip list as a reference by L1 and rollup-node; + - disallow proofs involving pages of slots that have been confirmed at the + level where the game started. + *) + Dal.Slot.finalize_pending_slot_headers ctxt + >|=? fun (ctxt, attestation) -> (ctxt, Some attestation)) + +let initialisation ctxt ~level = + let open Lwt_result_syntax in + only_if_dal_feature_enabled + ctxt + ~default:(fun ctxt -> return ctxt) + (fun ctxt -> + let pkh_from_tenderbake_slot slot = + Stake_distribution.slot_owner ctxt level slot + >|=? fun (ctxt, consensus_pk1) -> (ctxt, consensus_pk1.delegate) + in + (* This committee is cached because it is the one we will use + for the validation of the DAL attestations. *) + let* committee = + Alpha_context.Dal.Attestation.compute_committee + ctxt + pkh_from_tenderbake_slot + in + return (Alpha_context.Dal.Attestation.init_committee ctxt committee)) diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_apply.mli b/src/proto_016_PtMumbai/lib_protocol/dal_apply.mli new file mode 100644 index 000000000000..28daea642838 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_apply.mli @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This modules handles all the validation/application/finalisation + of any operation related to the DAL. *) + +open Alpha_context + +(** [validate_attestation ctxt op] ensures that [op.attestation] is + valid and cannot prevent an operation containing [op.attestation] + to be refused on top of [ctxt]. If an [Error _] is returned, the + [op.attestation] is not valid. *) +val validate_attestation : t -> Dal.Attestation.operation -> unit tzresult + +(** [apply_attestation ctxt op] applies [op.attestation] into the + [ctxt] assuming [op.attestor] issued those attestations. *) +val apply_attestation : t -> Dal.Attestation.operation -> t tzresult + +(** [validate_publish_slot_header ctxt slot] ensures that [slot_header] is + valid and cannot prevent an operation containing [slot_header] to be + refused on top of [ctxt]. If an [Error _] is returned, the [slot_header] + is not valid. *) +val validate_publish_slot_header : + t -> Dal.Slot.Header.operation -> unit tzresult + +(** [apply_publish_slot_header ctxt slot_header] applies the publication of + slot header [slot_header] on top of [ctxt]. Fails if the slot contains + already a slot header. *) +val apply_publish_slot_header : t -> Dal.Slot.Header.operation -> t tzresult + +(** [finalisation ctxt] should be executed at block finalisation + time. A set of slots attested at level [ctxt.current_level - lag] + is returned encapsulated into the attestation data-structure. + + [lag] is a parametric constant specific to the data-availability + layer. *) +val finalisation : t -> (t * Dal.Attestation.t option) tzresult Lwt.t + +(** [initialize ctxt ~level] should be executed at block + initialisation time. It allows to cache the committee for [level] + in memory so that every time we need to use this committee, there + is no need to recompute it again. *) +val initialisation : t -> level:Level.t -> t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.ml new file mode 100644 index 000000000000..a3b68922fada --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.ml @@ -0,0 +1,148 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3103 + + This may be a bit heavy in practice. We could also assume that in + practice, many bits in this bitfield will be set to one. Hence, we + could consider a better encoding which is smaller in the optimistic + case. For example: + + 1. When all the slots are attested, the encoding can be represented + in one bit. + + 2. Otherwise, we can pack slots by [8]. Have a header of [slots/8] + which is [1] if all the slots in this set are [1], [0] + otherwise. For all pack with a bit set to [0], we give the explicit + representation. Hence, if there are [256] slots, and [2] are not + attested, this representation will be of size [32] bits + [16] bits + = [48] bits which is better than [256] bits. *) +type t = Bitset.t + +type attested_slots = t + +type operation = { + attestor : Signature.Public_key_hash.t; + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/4165 + Compute the endorser from the attested slots in [slot_attestation] below, + or provide a field `min_endorser_slot : int / int32` *) + attestation : t; + level : Raw_level_repr.t; +} + +let encoding = Bitset.encoding + +let empty = Bitset.empty + +let is_attested t index = + let open Dal_slot_repr.Index in + match Bitset.mem t (to_int index) with + | Ok b -> b + | Error _ -> + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3104 + + Should we do something here? *) + false + +let commit t index = + let open Dal_slot_repr.Index in + match Bitset.add t (to_int index) with + | Ok t -> t + | Error _ -> + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3104 + + Should we do something here? *) + t + +let occupied_size_in_bits = Bitset.occupied_size_in_bits + +let expected_size_in_bits ~max_index = + (* We compute an encoding of the data-availability attestations + which is a (tight) upper bound of what we expect. *) + let open Bitset in + let open Dal_slot_repr.Index in + match add empty @@ to_int max_index with + | Error _ -> (* Happens if max_index < 1 *) 0 + | Ok t -> occupied_size_in_bits t + +type shard_index = int + +module Shard_map = Map.Make (struct + type t = shard_index + + let compare = Compare.Int.compare +end) + +module Accountability = struct + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3109 + + Think hard about this data structure and whether it needs to be + optimized. + *) + type t = Bitset.t list + + let init ~length = + let l = + List.init + ~when_negative_length: + "Dal_attestation_repr.Accountability.init: length cannot be negative" + length + (fun _ -> Bitset.empty) + in + match l with Error msg -> invalid_arg msg | Ok l -> l + + let record_slot_shard_availability bitset shards = + List.fold_left + (fun bitset shard -> + Bitset.add bitset shard |> Result.value ~default:bitset) + bitset + shards + + let record_shards_availability shard_bitset_per_slot slots shards = + List.mapi + (fun slot bitset -> + match Bitset.mem slots slot with + | Error _ -> + (* slot index is above the length provided at initialisation *) + bitset + | Ok slot_available -> + if slot_available then record_slot_shard_availability bitset shards + else bitset) + shard_bitset_per_slot + + let is_slot_available shard_bitset_per_slot ~threshold ~number_of_shards index + = + match List.nth shard_bitset_per_slot (Dal_slot_repr.Index.to_int index) with + | None -> false + | Some bitset -> + let acc = ref 0 in + List.iter + (fun x -> + match Bitset.mem bitset x with + | Error _ | Ok false -> () + | Ok true -> incr acc) + Misc.(0 --> (number_of_shards - 1)) ; + Compare.Int.(!acc >= threshold * number_of_shards / 100) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.mli b/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.mli new file mode 100644 index 000000000000..7d1ebed02e72 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_attestation_repr.mli @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Slot attestation representation for the data-availability layer. + + {1 Overview} + + For the data-availability layer, the layer 1 provides a list of + slots at every level (see {!Dal_slot_repr}). Slots are not posted + directly onto L1 blocks. Stakeholders, called attestors in this + context, can commit on the availability of the data (via + endorsements or attestation operations, see + https://gitlab.com/tezos/tezos/-/issues/3115). + + The slot is uniformly split into shards. Each attestor commits, + for every slot, on the availability of all shards they are assigned + to. + + This module encapsulates the representation of this commitment + that aims to be provided with endorsement operations. To avoid + overloading the network, this representation should be compact. *) + +type t + +type attested_slots = t + +(** The shape of Dal attestation operations injected by delegates. *) +type operation = { + attestor : Signature.Public_key_hash.t; + (** The account who attests the availability of the slots. *) + attestation : t; + (** The bitset of slots that are attested to be available. *) + level : Raw_level_repr.t; + (** The level at which the operation is valid. It should be equal to the + attested slot's published level plus the DAL attestation lag. *) +} + +val encoding : t Data_encoding.t + +(** [empty] returns an empty [slot_attestation] which commits that + every slot are unavailable. *) +val empty : t + +(** [is_attested slot_attestation ~index] returns [true] if the + [slot_attestation] commits that the slot at [index] is + available. *) +val is_attested : t -> Dal_slot_repr.Index.t -> bool + +(** [commit slot_attestation index] commits into [slot_attestation] + that the [index] is available. *) +val commit : t -> Dal_slot_repr.Index.t -> t + +(** [occupied_size_in_bits slot_attestation] returns the size in bits of an attestation. *) +val occupied_size_in_bits : t -> int + +(** [expected_size_in_bits ~max_index] returns the expected size (in + bits) of an attestation considering the maximum index for a slot is + [max_index]. *) +val expected_size_in_bits : max_index:Dal_slot_repr.Index.t -> int + +(** A shard_index aims to be a positive number. *) +type shard_index = int + +module Shard_map : Map.S with type key = shard_index + +(** This module is used to record the various data-availability + attestations. + + For each attestor, a list of shards is associated. For each + attested slot (see {!type:t}) we record that those shards were + deemed available. + + This information will be used at the end of block finalisation to + have the protocol declaring whether the slot is available. *) +module Accountability : sig + (** The data-structure used to record the shards-slots availability. *) + type t + + (** DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3145 + + Consider using the [Bounded] module. In particular, change the + semantics of [is_slot_available] accordingly. *) + + (** [init ~length] initialises a new accountability data-structure + with at most [length] slots and where for every slot, no shard is + available. *) + val init : length:int -> t + + (** [record_shards_availability t slots shards] records that for all + slots declared available in [slots], shard indices in [shards] + are available. It is the responsibility of the caller to ensure + the shard indices are positive numbers. A negative shard index is + ignored. *) + val record_shards_availability : t -> attested_slots -> shard_index list -> t + + (** [is_slot_available t ~threshold ~number_of_shards slot] returns + [true] if the number of shards recorded in [t] for the [slot] is + above the [threshold] with respect to the total number of shards + specified by [number_of_shards]. Returns [false] otherwise or if + the [index] is out of the interval [0;length] where [length] is + the value provided to the [init] function. *) + val is_slot_available : + t -> threshold:int -> number_of_shards:int -> Dal_slot_repr.Index.t -> bool +end diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_errors_repr.ml b/src/proto_016_PtMumbai/lib_protocol/dal_errors_repr.ml new file mode 100644 index 000000000000..69b73ca4b017 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_errors_repr.ml @@ -0,0 +1,313 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Dal_feature_disabled + | Dal_slot_index_above_hard_limit + | Dal_attestation_unexpected_size of {expected : int; got : int} + | Dal_publish_slot_header_future_level of { + provided : Raw_level_repr.t; + expected : Raw_level_repr.t; + } + | Dal_publish_slot_header_past_level of { + provided : Raw_level_repr.t; + expected : Raw_level_repr.t; + } + | Dal_publish_slot_header_invalid_index of { + given : Dal_slot_repr.Index.t; + maximum : Dal_slot_repr.Index.t; + } + | Dal_publish_slot_header_candidate_with_low_fees of { + proposed_fees : Tez_repr.t; + } + | Dal_attestation_size_limit_exceeded of {maximum_size : int; got : int} + | Dal_publish_slot_header_duplicate of {slot_header : Dal_slot_repr.Header.t} + | Dal_publish_slot_header_invalid_proof of { + slot_header : Dal_slot_repr.Header.operation; + } + | Dal_data_availibility_attestor_not_in_committee of { + attestor : Signature.Public_key_hash.t; + level : Level_repr.t; + } + | Dal_operation_for_old_level of { + current : Raw_level_repr.t; + given : Raw_level_repr.t; + } + | Dal_operation_for_future_level of { + current : Raw_level_repr.t; + given : Raw_level_repr.t; + } + +let () = + let open Data_encoding in + let description = + "Data-availability layer will be enabled in a future proposal." + in + register_error_kind + `Permanent + ~id:"operation.dal_disabled" + ~title:"DAL is disabled" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Dal_feature_disabled -> Some () | _ -> None) + (fun () -> Dal_feature_disabled) ; + + let description = + "The attestation for data availability has a different size" + in + register_error_kind + `Permanent + ~id:"dal_attestation_unexpected_size" + ~title:"DAL attestation unexpected size" + ~description + ~pp:(fun ppf (expected, got) -> + Format.fprintf ppf "%s: Expected %d. Got %d." description expected got) + (obj2 (req "expected_size" int31) (req "got" int31)) + (function + | Dal_attestation_unexpected_size {expected; got} -> Some (expected, got) + | _ -> None) + (fun (expected, got) -> Dal_attestation_unexpected_size {expected; got}) ; + let description = "Slot index above hard limit" in + register_error_kind + `Permanent + ~id:"dal_slot_index_negative_orabove_hard_limit" + ~title:"DAL slot index negative or above hard limit" + ~description + ~pp:(fun ppf () -> + Format.fprintf + ppf + "%s: Maximum allowed %a." + description + Dal_slot_repr.Index.pp + Dal_slot_repr.Index.max_value) + Data_encoding.unit + (function Dal_slot_index_above_hard_limit -> Some () | _ -> None) + (fun () -> Dal_slot_index_above_hard_limit) ; + let description = "Unexpected level in the future in slot header" in + register_error_kind + `Temporary + ~id:"dal_publish_slot_header_future_level" + ~title:"DAL slot header future level" + ~description + ~pp:(fun ppf (provided, expected) -> + Format.fprintf + ppf + "%s: Provided %a. Expected %a." + description + Raw_level_repr.pp + provided + Raw_level_repr.pp + expected) + (obj2 + (req "provided" Raw_level_repr.encoding) + (req "got" Raw_level_repr.encoding)) + (function + | Dal_publish_slot_header_future_level {provided; expected} -> + Some (provided, expected) + | _ -> None) + (fun (provided, expected) -> + Dal_publish_slot_header_future_level {provided; expected}) ; + let description = "Unexpected level in the past in slot header" in + register_error_kind + `Branch + ~id:"dal_publish_slot_header_past_level" + ~title:"DAL slot header past level" + ~description + ~pp:(fun ppf (provided, expected) -> + Format.fprintf + ppf + "%s: Provided %a. Expected %a." + description + Raw_level_repr.pp + provided + Raw_level_repr.pp + expected) + (obj2 + (req "provided" Raw_level_repr.encoding) + (req "got" Raw_level_repr.encoding)) + (function + | Dal_publish_slot_header_past_level {provided; expected} -> + Some (provided, expected) + | _ -> None) + (fun (provided, expected) -> + Dal_publish_slot_header_past_level {provided; expected}) ; + let description = "Bad index for slot header" in + register_error_kind + `Permanent + ~id:"dal_publish_slot_header_invalid_index" + ~title:"DAL slot header invalid index" + ~description + ~pp:(fun ppf (given, maximum) -> + Format.fprintf + ppf + "%s: Given %a. Maximum %a." + description + Dal_slot_repr.Index.pp + given + Dal_slot_repr.Index.pp + maximum) + (obj2 + (req "given" Dal_slot_repr.Index.encoding) + (req "got" Dal_slot_repr.Index.encoding)) + (function + | Dal_publish_slot_header_invalid_index {given; maximum} -> + Some (given, maximum) + | _ -> None) + (fun (given, maximum) -> + Dal_publish_slot_header_invalid_index {given; maximum}) ; + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3114 + Better error message *) + let description = "Slot header with too low fees" in + register_error_kind + `Permanent + ~id:"dal_publish_slot_header_with_low_fees" + ~title:"DAL slot header with low fees" + ~description + ~pp:(fun ppf proposed -> + Format.fprintf + ppf + "%s: Proposed fees %a." + description + Tez_repr.pp + proposed) + (obj1 (req "proposed" Tez_repr.encoding)) + (function + | Dal_publish_slot_header_candidate_with_low_fees {proposed_fees} -> + Some proposed_fees + | _ -> None) + (fun proposed_fees -> + Dal_publish_slot_header_candidate_with_low_fees {proposed_fees}) ; + let description = "The attestation for data availability is a too big" in + register_error_kind + `Permanent + ~id:"dal_attestation_size_limit_exceeded" + ~title:"DAL attestation exceeded the limit" + ~description + ~pp:(fun ppf (maximum_size, got) -> + Format.fprintf + ppf + "%s: Maximum is %d. Got %d." + description + maximum_size + got) + (obj2 (req "maximum_size" int31) (req "got" int31)) + (function + | Dal_attestation_size_limit_exceeded {maximum_size; got} -> + Some (maximum_size, got) + | _ -> None) + (fun (maximum_size, got) -> + Dal_attestation_size_limit_exceeded {maximum_size; got}) ; + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3114 + Better error message. *) + let description = "A slot header for this slot was already proposed" in + register_error_kind + `Permanent + ~id:"dal_publish_slot_heade_duplicate" + ~title:"DAL publish slot header duplicate" + ~description + ~pp:(fun ppf _proposed -> Format.fprintf ppf "%s" description) + (obj1 (req "proposed" Dal_slot_repr.Header.encoding)) + (function + | Dal_publish_slot_header_duplicate {slot_header} -> Some slot_header + | _ -> None) + (fun slot_header -> Dal_publish_slot_header_duplicate {slot_header}) ; + let description = "The slot header's commitment proof does not check" in + register_error_kind + `Permanent + ~id:"dal_publish_slot_header_invalid_proof" + ~title:"DAL publish slot header invalid proof" + ~description + ~pp:(fun ppf _proposed -> Format.fprintf ppf "%s" description) + Dal_slot_repr.Header.operation_encoding + (function + | Dal_publish_slot_header_invalid_proof {slot_header} -> Some slot_header + | _ -> None) + (fun slot_header -> Dal_publish_slot_header_invalid_proof {slot_header}) ; + register_error_kind + `Outdated + ~id:"Dal_operation_for_old_level" + ~title:"Dal operation for an old level" + ~description:"The Dal operation targets an old level" + ~pp:(fun ppf (current_lvl, given_lvl) -> + Format.fprintf + ppf + "Dal operation targets an old level %a. Current level is %a." + Raw_level_repr.pp + given_lvl + Raw_level_repr.pp + current_lvl) + Data_encoding.( + obj2 + (req "current_level" Raw_level_repr.encoding) + (req "given_level" Raw_level_repr.encoding)) + (function + | Dal_operation_for_old_level {current; given} -> Some (current, given) + | _ -> None) + (fun (current, given) -> Dal_operation_for_old_level {current; given}) ; + register_error_kind + `Temporary + ~id:"Dal_operation_for_future_level" + ~title:"Dal operation for a future level" + ~description:"The Dal operation target a future level" + ~pp:(fun ppf (current_lvl, given_lvl) -> + Format.fprintf + ppf + "Dal operation targets a future level %a. Current level is %a." + Raw_level_repr.pp + given_lvl + Raw_level_repr.pp + current_lvl) + Data_encoding.( + obj2 + (req "current_level" Raw_level_repr.encoding) + (req "given_level" Raw_level_repr.encoding)) + (function + | Dal_operation_for_future_level {current; given} -> Some (current, given) + | _ -> None) + (fun (current, given) -> Dal_operation_for_future_level {current; given}) ; + register_error_kind + `Permanent + ~id:"Dal_data_availibility_attestor_not_in_committee" + ~title:"The attestor is not part of the DAL committee for this level" + ~description:"The attestor is not part of the DAL committee for this level" + ~pp:(fun ppf (attestor, level) -> + Format.fprintf + ppf + "The attestor %a is not part of the DAL committee for the level %a" + Signature.Public_key_hash.pp + attestor + Level_repr.pp + level) + Data_encoding.( + obj2 + (req "attestor" Signature.Public_key_hash.encoding) + (req "level" Level_repr.encoding)) + (function + | Dal_data_availibility_attestor_not_in_committee {attestor; level} -> + Some (attestor, level) + | _ -> None) + (fun (attestor, level) -> + Dal_data_availibility_attestor_not_in_committee {attestor; level}) diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_services.ml b/src/proto_016_PtMumbai/lib_protocol/dal_services.ml new file mode 100644 index 000000000000..660f6783ec7f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_services.ml @@ -0,0 +1,49 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let assert_dal_feature_enabled ctxt = + let open Constants in + let Parametric.{dal = {feature_enable; _}; _} = parametric ctxt in + error_unless + Compare.Bool.(feature_enable = true) + Dal_errors.Dal_feature_disabled + +let shards ctxt ~level = + let open Lwt_result_syntax in + let open Dal.Attestation in + assert_dal_feature_enabled ctxt >>?= fun () -> + let level = Level.from_raw ctxt level in + let pkh_from_tenderbake_slot slot = + Stake_distribution.slot_owner ctxt level slot + >|=? fun (ctxt, consensus_key) -> (ctxt, consensus_key.delegate) + in + (* We do not cache this committee. This function being used by RPCs + to know the DAL committee at some particular level. *) + let* committee = + Dal.Attestation.compute_committee ctxt pkh_from_tenderbake_slot + in + Signature.Public_key_hash.Map.bindings committee.pkh_to_shards |> return diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_services.mli b/src/proto_016_PtMumbai/lib_protocol/dal_services.mli new file mode 100644 index 000000000000..d6394f128dec --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_services.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [shards ctxt ~level] returns the DAL committee as an association + list that associates to the public key hash [pkh] of the member of + the committee an interval [(s,n)], meaning that the slots + [s;s+1;...;s+n-1] belongs to [pkh]. It is guaranteed that [n>0]. *) +val shards : + Alpha_context.t -> + level:Alpha_context.Raw_level.t -> + (Signature.Public_key_hash.t * (int * int)) list tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.ml b/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.ml new file mode 100644 index 000000000000..cf43da6693c9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.ml @@ -0,0 +1,983 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type parameters = Dal.parameters = { + redundancy_factor : int; + page_size : int; + slot_size : int; + number_of_shards : int; +} + +let parameters_encoding = Dal.parameters_encoding + +module Commitment = struct + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3389 + + It is not clear whether the size of the slot associated to the + commitment should be given here. *) + type t = Dal.commitment + + let equal = Dal.Commitment.equal + + let encoding = Dal.Commitment.encoding + + let pp = Dal.Commitment.pp + + let zero = Dal.Commitment.zero +end + +module Commitment_proof = struct + type t = Dal.commitment_proof + + let encoding = Dal.Commitment_proof.encoding + + let zero = Dal.Commitment_proof.zero +end + +module Index = struct + type t = int + + let max_value = 255 + + let encoding = Data_encoding.uint8 + + let pp = Format.pp_print_int + + let zero = 0 + + let of_int slot_index = + if Compare.Int.(slot_index <= max_value && slot_index >= zero) then + Some slot_index + else None + + let to_int slot_index = slot_index [@@ocaml.inline always] + + let compare = Compare.Int.compare + + let equal = Compare.Int.equal +end + +module Header = struct + type id = {published_level : Raw_level_repr.t; index : Index.t} + + type t = {id : id; commitment : Commitment.t} + + type operation = {header : t; proof : Commitment_proof.t} + + let slot_id_equal {published_level; index} s2 = + Raw_level_repr.equal published_level s2.published_level + && Index.equal index s2.index + + let equal {id; commitment} s2 = + slot_id_equal id s2.id && Commitment.equal commitment s2.commitment + + let compare_slot_id {published_level; index} s2 = + let c = Raw_level_repr.compare published_level s2.published_level in + if Compare.Int.(c <> 0) then c else Index.compare index s2.index + + let zero_id = + { + (* We don't expect to have any published slot at level + Raw_level_repr.root. *) + published_level = Raw_level_repr.root; + index = Index.zero; + } + + let zero = {id = zero_id; commitment = Commitment.zero} + + let id_encoding = + let open Data_encoding in + conv + (fun {published_level; index} -> (published_level, index)) + (fun (published_level, index) -> {published_level; index}) + (obj2 + (req "level" Raw_level_repr.encoding) + (req "index" Data_encoding.uint8)) + + let encoding = + let open Data_encoding in + conv + (fun {id; commitment} -> (id, commitment)) + (fun (id, commitment) -> {id; commitment}) + (merge_objs id_encoding (obj1 (req "commitment" Commitment.encoding))) + + let operation_encoding = + let open Data_encoding in + conv + (fun {header = {id; commitment}; proof} -> (id, (commitment, proof))) + (fun (id, (commitment, proof)) -> {header = {id; commitment}; proof}) + (merge_objs + id_encoding + (obj2 + (req "commitment" Commitment.encoding) + (req "commitment_proof" Commitment_proof.encoding))) + + let pp_id fmt {published_level; index} = + Format.fprintf + fmt + "published_level: %a, index: %a" + Raw_level_repr.pp + published_level + Format.pp_print_int + index + + let pp fmt {id; commitment = c} = + Format.fprintf fmt "id:(%a), commitment: %a" pp_id id Commitment.pp c + + type error += Dal_commitment_proof_error of string + + let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"dal_slot_repr.dal_commitment_proof_error" + ~title:"Dal commitment proof error" + ~description:"Error occurred during Dal commitment proof validation" + ~pp:(fun ppf e -> Format.fprintf ppf "Dal commitment proof error: %s" e) + (obj1 (req "error" (string Plain))) + (function Dal_commitment_proof_error e -> Some e | _ -> None) + (fun e -> Dal_commitment_proof_error e) + + let verify_commitment dal_params {header = {commitment; _}; proof} = + let open Result_syntax in + let* dal = + match Dal.make dal_params with + | Ok dal -> return dal + | Error (`Fail s) -> error (Dal_commitment_proof_error s) + in + return @@ Dal.verify_commitment dal commitment proof +end + +module Slot_index = Index + +module Page = struct + type content = Bytes.t + + type slot_index = Index.t + + let pages_per_slot = Dal.pages_per_slot + + module Index = struct + type t = int + + let zero = 0 + + let encoding = Data_encoding.int16 + + let pp = Format.pp_print_int + + let compare = Compare.Int.compare + + let equal = Compare.Int.equal + end + + type t = {slot_id : Header.id; page_index : Index.t} + + type proof = Dal.page_proof + + let encoding = + let open Data_encoding in + conv + (fun {slot_id = {published_level; index}; page_index} -> + (published_level, index, page_index)) + (fun (published_level, index, page_index) -> + {slot_id = {published_level; index}; page_index}) + (obj3 + (req "published_level" Raw_level_repr.encoding) + (req "slot_index" Slot_index.encoding) + (req "page_index" Index.encoding)) + + let equal {slot_id; page_index} p = + Header.slot_id_equal slot_id p.slot_id + && Index.equal page_index p.page_index + + let proof_encoding = Dal.page_proof_encoding + + let content_encoding = Data_encoding.(bytes Hex) + + let pp fmt {slot_id = {published_level; index}; page_index} = + Format.fprintf + fmt + "(published_level: %a, slot_index: %a, page_index: %a)" + Raw_level_repr.pp + published_level + Slot_index.pp + index + Index.pp + page_index + + let pp_proof fmt proof = + Data_encoding.Json.pp + fmt + (Data_encoding.Json.construct proof_encoding proof) +end + +module Slot_market = struct + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3108 + + Think harder about this data structure and whether it can be + optimized. *) + + module Slot_index_map = Map.Make (Index) + + type t = {length : int; slot_headers : Header.t Slot_index_map.t} + + let init ~length = + if Compare.Int.(length < 0) then + invalid_arg "Dal_slot_repr.Slot_market.init: length cannot be negative" ; + let slot_headers = Slot_index_map.empty in + {length; slot_headers} + + let length {length; _} = length + + let register t new_slot_header = + let open Header in + if + not + Compare.Int.( + 0 <= new_slot_header.id.index && new_slot_header.id.index < t.length) + then None + else + let has_changed = ref false in + let update = function + | None -> + has_changed := true ; + Some new_slot_header + | Some x -> Some x + in + let slot_headers = + Slot_index_map.update new_slot_header.id.index update t.slot_headers + in + let t = {t with slot_headers} in + Some (t, !has_changed) + + let candidates t = + t.slot_headers |> Slot_index_map.to_seq |> Seq.map snd |> List.of_seq +end + +module History = struct + (* History is represented via a skip list. The content of the cell + is the hash of a merkle proof. *) + + (* A leaf of the merkle tree is a slot. *) + module Leaf = struct + type t = Header.t + + let to_bytes = Data_encoding.Binary.to_bytes_exn Header.encoding + end + + module Content_prefix = struct + let (_prefix : string) = "dash1" + + (* 32 *) + let b58check_prefix = "\002\224\072\094\219" (* dash1(55) *) + + let size = Some 32 + + let name = "dal_skip_list_content" + + let title = "A hash to represent the content of a cell in the skip list" + end + + module Content_hash = Blake2B.Make (Base58) (Content_prefix) + module Merkle_list = Merkle_list.Make (Leaf) (Content_hash) + + (* Pointers of the skip lists are used to encode the content and the + backpointers. *) + module Pointer_prefix = struct + let (_prefix : string) = "dask1" + + (* 32 *) + let b58check_prefix = "\002\224\072\115\035" (* dask1(55) *) + + let size = Some 32 + + let name = "dal_skip_list_pointer" + + let title = "A hash that represents the skip list pointers" + end + + module Pointer_hash = Blake2B.Make (Base58) (Pointer_prefix) + + module Skip_list_parameters = struct + let basis = 2 + end + + type error += Add_element_in_slots_skip_list_violates_ordering + + let () = + register_error_kind + `Temporary + ~id:"Dal_slot_repr.add_element_in_slots_skip_list_violates_ordering" + ~title:"Add an element in slots skip list that violates ordering" + ~description: + "Attempting to add an element on top of the Dal confirmed slots skip \ + list that violates the ordering." + Data_encoding.unit + (function + | Add_element_in_slots_skip_list_violates_ordering -> Some () + | _ -> None) + (fun () -> Add_element_in_slots_skip_list_violates_ordering) + + module Skip_list = struct + include Skip_list_repr.Make (Skip_list_parameters) + + (** All confirmed DAL slots will be stored in a skip list, where only the + last cell is remembered in the L1 context. The skip list is used in + the proof phase of a refutation game to verify whether a given slot + exists (i.e., confirmed) or not in the skip list. The skip list is + supposed to be sorted, as its 'search' function explicitly uses a given + `compare` function during the list traversal to quickly (in log(size)) + reach the target if any. + + In our case, we will store one slot per cell in the skip list and + maintain that the list is well sorted (and without redundancy) w.r.t. + the [compare_slot_id] function. + + Below, we redefine the [next] function (that allows adding elements + on top of the list) to enforce that the constructed skip list is + well-sorted. We also define a wrapper around the search function to + guarantee that it can only be called with the adequate compare function. + *) + + let next ~prev_cell ~prev_cell_ptr elt = + let open Result_syntax in + let* () = + error_when + (Compare.Int.( <= ) + (Header.compare_slot_id + elt.Header.id + (content prev_cell).Header.id) + 0) + Add_element_in_slots_skip_list_violates_ordering + in + return @@ next ~prev_cell ~prev_cell_ptr elt + + let search ~deref ~cell ~target_id = + Lwt.search ~deref ~cell ~compare:(fun slot -> + Header.compare_slot_id slot.Header.id target_id) + end + + module V1 = struct + (* The content of a cell is the hash of all the slot commitments + represented as a merkle list. *) + (* TODO/DAL: https://gitlab.com/tezos/tezos/-/issues/3765 + Decide how to store attested slots in the skip list's content. *) + type content = Header.t + + (* A pointer to a cell is the hash of its content and all the back + pointers. *) + type hash = Pointer_hash.t + + type history = (content, hash) Skip_list.cell + + type t = history + + let history_encoding = + Skip_list.encoding Pointer_hash.encoding Header.encoding + + let equal_history : history -> history -> bool = + Skip_list.equal Pointer_hash.equal Header.equal + + let encoding = history_encoding + + let equal : t -> t -> bool = equal_history + + let genesis : t = Skip_list.genesis Header.zero + + let hash cell = + let current_slot = Skip_list.content cell in + let back_pointers_hashes = Skip_list.back_pointers cell in + Data_encoding.Binary.to_bytes_exn Header.encoding current_slot + :: List.map Pointer_hash.to_bytes back_pointers_hashes + |> Pointer_hash.hash_bytes + + let pp_history fmt (history : history) = + let history_hash = hash history in + Format.fprintf + fmt + "@[hash : %a@;%a@]" + Pointer_hash.pp + history_hash + (Skip_list.pp ~pp_content:Header.pp ~pp_ptr:Pointer_hash.pp) + history + + module History_cache = + Bounded_history_repr.Make + (struct + let name = "dal_slots_cache" + end) + (Pointer_hash) + (struct + type t = history + + let encoding = history_encoding + + let pp = pp_history + + let equal = equal_history + end) + + let add_confirmed_slot_header (t, cache) slot_header = + let open Result_syntax in + let prev_cell_ptr = hash t in + let* cache = History_cache.remember prev_cell_ptr t cache in + let* new_cell = Skip_list.next ~prev_cell:t ~prev_cell_ptr slot_header in + return (new_cell, cache) + + let add_confirmed_slot_headers (t : t) cache slot_headers = + List.fold_left_e add_confirmed_slot_header (t, cache) slot_headers + + let add_confirmed_slot_headers_no_cache = + let no_cache = History_cache.empty ~capacity:0L in + fun t slots -> + List.fold_left_e add_confirmed_slot_header (t, no_cache) slots >|? fst + + (* Dal proofs section *) + + (** An inclusion proof, for a page ID, is a list of the slots' history + skip list's cells that encodes a minimal path: + - from a starting cell, which serves as a reference. It is usually called + 'snapshot' below, + - to a final cell, that is either the exact target cell in case the slot + of the page is confirmed, or a cell whose slot ID is the smallest + that directly follows the page's slot id, in case the target slot + is not confirmed. + + Using the starting cell as a trustable starting point (i.e. maintained + and provided by L1), and combined with the extra information stored in + the {!proof} type below, one can verify if a slot (and then a page of + that slot) is confirmed on L1 or not. *) + type inclusion_proof = history list + + (** (See the documentation in the mli file to understand what we want to + prove in game refutation involving Dal and why.) + + A Dal proof is an algebraic datatype with two cases, where we basically + prove that a Dal page is confirmed on L1 or not. Being 'not confirmed' + here includes the case where the slot's header is not published and the + case where the slot's header is published, but the endorsers didn't + confirm the availability of its data. + + To produce a proof representation for a page (see function {!produce_proof_repr} + below), we assume given: + + - [page_id], identifies the page; + + - [slots_history], a current/recent cell of the slots history skip list. + Typically, it should be the skip list cell snapshotted when starting the + refutation game; + + - [history_cache], a sufficiently large slots history cache, to navigate + back through the successive cells of the skip list. Typically, + the cache should at least contain the cell whose slot ID is [page_id.slot_id] + in case the page is confirmed, or the cell whose slot ID is immediately + after [page_id.slot_id] in case of an unconfirmed page. Indeed, + inclusion proofs encode paths through skip lists' cells where the head + is the reference/snapshot cell and the last element is the target slot + in or the nearest upper slot (w.r.t [page_id]'s slot id and to + skip list elements ordering) ; + + - [page_info], that provides the page's information (the content and + the slot membership proof) for page_id. In case the page is supposed + to be confirmed, this argument should contain the page's content and + the proof that the page is part of the (confirmed) slot whose ID is + given in [page_id]. In case we want to show that the page is not confirmed, + the value [page_info] should be [None]. + + [dal_parameters] is used when verifying that/if the page is part of + the candidate slot (if any). + + +*) + type proof_repr = + | Page_confirmed of { + target_cell : history; + (** [target_cell] is a cell whose content contains the slot to + which the page belongs to. *) + inc_proof : inclusion_proof; + (** [inc_proof] is a (minimal) path in the skip list that proves + cells inclusion. The head of the list is the [slots_history] + provided to produce the proof. The last cell's content is + the slot containing the page identified by [page_id], + that is: [target_cell]. *) + page_data : Page.content; + (** [page_data] is the content of the page. *) + page_proof : Page.proof; + (** [page_proof] is the proof that the page whose content is + [page_data] is actually the [page_id.page_index]th page of + the slot stored in [target_cell] and identified by + page_id.slot_id. *) + } (** The case where the slot's page is confirmed/attested on L1. *) + | Page_unconfirmed of { + prev_cell : history; + (** [prev_cell] is the cell of the skip list containing a + (confirmed) slot, and whose ID is the biggest (w.r.t. to skip + list elements ordering), but smaller than [page_id.slot_id]. *) + next_cell_opt : history option; + (** [next_cell_opt] is the cell that immediately follows [prev_cell] + in the skip list, if [prev_cell] is not the latest element in + the list. Otherwise, it's set to [None]. *) + next_inc_proof : inclusion_proof; + (** [inc_proof] is a (minimal) path in the skip list that proves + cells inclusion. In case, [next_cell_opt] contains some cell + 'next_cell', the head of the list is the [slots_history] + provided to produce the proof, and the last cell is + 'next_cell'. In case [next_cell_opt] is [None], the list is + empty. + + We maintain the following invariant in case the inclusion + proof is not empty: + ``` + (content next_cell).id > page_id.slot_id > (content prev_cell).id AND + hash prev_cell = back_pointer next_cell 0 AND + Some next_cell = next_cell_opt AND + head next_inc_proof = slots_history + ``` + + Said differently, `next_cell` and `prev_cell` are two consecutive + cells of the skip list whose contents' IDs surround the page's + slot ID. Moreover, the head of the list should be equal to + the initial (snapshotted) slots_history skip list. + + The case of an empty inclusion proof happens when the inputs + are such that: `page_id.slot_id > (content slots_history).id`. + The returned proof statement implies the following property in this case: + + ``` + next_cell_opt = None AND prev_cell = slots_history + ``` + *) + } + (** The case where the slot's page doesn't exist or is not + confirmed on L1. *) + + let proof_repr_encoding = + let open Data_encoding in + let case_page_confirmed = + case + ~title:"confirmed dal page proof representation" + (Tag 0) + (obj5 + (req "kind" (constant "confirmed")) + (req "target_cell" history_encoding) + (req "inc_proof" (list history_encoding)) + (req "page_data" (bytes Hex)) + (req "page_proof" Page.proof_encoding)) + (function + | Page_confirmed {target_cell; inc_proof; page_data; page_proof} -> + Some ((), target_cell, inc_proof, page_data, page_proof) + | _ -> None) + (fun ((), target_cell, inc_proof, page_data, page_proof) -> + Page_confirmed {target_cell; inc_proof; page_data; page_proof}) + and case_page_unconfirmed = + case + ~title:"unconfirmed dal page proof representation" + (Tag 1) + (obj4 + (req "kind" (constant "unconfirmed")) + (req "prev_cell" history_encoding) + (req "next_cell_opt" (option history_encoding)) + (req "next_inc_proof" (list history_encoding))) + (function + | Page_unconfirmed {prev_cell; next_cell_opt; next_inc_proof} -> + Some ((), prev_cell, next_cell_opt, next_inc_proof) + | _ -> None) + (fun ((), prev_cell, next_cell_opt, next_inc_proof) -> + Page_unconfirmed {prev_cell; next_cell_opt; next_inc_proof}) + in + + union [case_page_confirmed; case_page_unconfirmed] + + (** Proof's type is set to bytes and not a structural datatype because + when a proof appears in a tezos operation or in an rpc, a user can not + reasonably understand the proof, thus it eases the work of people decoding + the proof by only supporting bytes and not the whole structured proof. *) + + type proof = bytes + + (** DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/4084 + DAL proof's encoding should be bounded *) + let proof_encoding = Data_encoding.(bytes Hex) + + type error += Dal_invalid_proof_serialization + + let () = + register_error_kind + `Permanent + ~id:"Dal_slot_repr.invalid_proof_serialization" + ~title:"Dal invalid proof serialization" + ~description:"Error occured during dal proof serialization" + Data_encoding.unit + (function Dal_invalid_proof_serialization -> Some () | _ -> None) + (fun () -> Dal_invalid_proof_serialization) + + let serialize_proof proof = + match Data_encoding.Binary.to_bytes_opt proof_repr_encoding proof with + | None -> error Dal_invalid_proof_serialization + | Some serialized_proof -> ok serialized_proof + + type error += Dal_invalid_proof_deserialization + + let () = + register_error_kind + `Permanent + ~id:"Dal_slot_repr.invalid_proof_deserialization" + ~title:"Dal invalid proof deserialization" + ~description:"Error occured during dal proof deserialization" + Data_encoding.unit + (function Dal_invalid_proof_deserialization -> Some () | _ -> None) + (fun () -> Dal_invalid_proof_deserialization) + + let deserialize_proof proof = + match Data_encoding.Binary.of_bytes_opt proof_repr_encoding proof with + | None -> error Dal_invalid_proof_deserialization + | Some deserialized_proof -> ok deserialized_proof + + let pp_inclusion_proof = Format.pp_print_list pp_history + + let pp_history_opt = Format.pp_print_option pp_history + + let pp_proof ~serialized fmt p = + if serialized then Format.pp_print_string fmt (Bytes.to_string p) + else + match deserialize_proof p with + | Error msg -> Error_monad.pp_trace fmt msg + | Ok proof -> ( + match proof with + | Page_confirmed {target_cell; inc_proof; page_data; page_proof} -> + Format.fprintf + fmt + "Page_confirmed (target_cell=%a, data=%s,@ \ + inc_proof:[size=%d |@ path=%a]@ page_proof:%a)" + pp_history + target_cell + (Bytes.to_string page_data) + (List.length inc_proof) + pp_inclusion_proof + inc_proof + Page.pp_proof + page_proof + | Page_unconfirmed {prev_cell; next_cell_opt; next_inc_proof} -> + Format.fprintf + fmt + "Page_unconfirmed (prev_cell = %a | next_cell = %a | \ + prev_inc_proof:[size=%d@ | path=%a])" + pp_history + prev_cell + pp_history_opt + next_cell_opt + (List.length next_inc_proof) + pp_inclusion_proof + next_inc_proof) + + type error += + | Dal_proof_error of string + | Unexpected_page_size of {expected_size : int; page_size : int} + + let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"dal_slot_repr.slots_history.dal_proof_error" + ~title:"Dal proof error" + ~description:"Error occurred during Dal proof production or validation" + ~pp:(fun ppf e -> Format.fprintf ppf "Dal proof error: %s" e) + (obj1 (req "error" (string Plain))) + (function Dal_proof_error e -> Some e | _ -> None) + (fun e -> Dal_proof_error e) + + let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"dal_slot_repr.slots_history.unexpected_page_size" + ~title:"Unexpected page size" + ~description: + "The size of the given page content doesn't match the expected one." + ~pp:(fun ppf (expected, size) -> + Format.fprintf + ppf + "The size of a Dal page is expected to be %d bytes. The given one \ + has %d" + expected + size) + (obj2 (req "expected_size" int16) (req "page_size" int16)) + (function + | Unexpected_page_size {expected_size; page_size} -> + Some (expected_size, page_size) + | _ -> None) + (fun (expected_size, page_size) -> + Unexpected_page_size {expected_size; page_size}) + + let dal_proof_error reason = Dal_proof_error reason + + let proof_error reason = error @@ dal_proof_error reason + + let check_page_proof dal_params proof data ({Page.page_index; _} as pid) + commitment = + let open Result_syntax in + let* dal = + match Dal.make dal_params with + | Ok dal -> return dal + | Error (`Fail s) -> proof_error s + in + let fail_with_error_msg what = + Format.kasprintf proof_error "%s (page id=%a)." what Page.pp pid + in + match Dal.verify_page dal commitment ~page_index data proof with + | Ok true -> return () + | Ok false -> + fail_with_error_msg + "Wrong page content for the given page index and slot commitment" + | Error `Segment_index_out_of_range -> + fail_with_error_msg "Segment_index_out_of_range" + | Error `Page_length_mismatch -> + tzfail + @@ Unexpected_page_size + { + expected_size = dal_params.page_size; + page_size = Bytes.length data; + } + + let produce_proof_repr dal_params page_id ~page_info ~get_history slots_hist + = + let open Lwt_result_syntax in + let Page.{slot_id; page_index = _} = page_id in + (* We search for a slot whose ID is equal to target_id. *) + let*! search_result = + Skip_list.search ~deref:get_history ~target_id:slot_id ~cell:slots_hist + in + match (page_info, search_result.Skip_list.last_cell) with + | _, Deref_returned_none -> + tzfail + @@ dal_proof_error + "Skip_list.search returned 'Deref_returned_none': Slots history \ + cache is ill-formed or has too few entries." + | _, No_exact_or_lower_ptr -> + tzfail + @@ dal_proof_error + "Skip_list.search returned 'No_exact_or_lower_ptr', while it is \ + initialized with a min elt (slot zero)." + | Some (page_data, page_proof), Found target_cell -> + (* The slot to which the page is supposed to belong is found. *) + let Header.{id; commitment} = Skip_list.content target_cell in + (* We check that the slot is not the dummy slot. *) + let*? () = + error_when + Compare.Int.(Header.compare_slot_id id Header.zero.id = 0) + (dal_proof_error + "Skip_list.search returned 'Found <zero_slot>': No existence \ + proof should be constructed with the slot zero.") + in + let*? () = + check_page_proof dal_params page_proof page_data page_id commitment + in + let inc_proof = List.rev search_result.Skip_list.rev_path in + let*? () = + error_when + (List.is_empty inc_proof) + (dal_proof_error "The inclusion proof cannot be empty") + in + (* All checks succeeded. We return a `Page_confirmed` proof. *) + return + ( Page_confirmed {inc_proof; target_cell; page_data; page_proof}, + Some page_data ) + | None, Nearest {lower = prev_cell; upper = next_cell_opt} -> + (* There is no previously confirmed slot in the skip list whose ID + corresponds to the {published_level; slot_index} information + given in [page_id]. But, `search` returned a skip list [prev_cell] + (and possibly [next_cell_opt]) such that: + - the ID of [prev_cell]'s slot is the biggest immediately smaller than + the page's information {published_level; slot_index} + - if not equal to [None], the ID of [next_cell_opt]'s slot is the smallest + immediately bigger than the page's slot id `slot_id`. + - if [next_cell_opt] is [None] then, [prev_cell] should be equal to + the given history_proof cell. *) + let* next_inc_proof = + match search_result.Skip_list.rev_path with + | [] -> assert false (* Not reachable *) + | prev :: rev_next_inc_proof -> + let*? () = + error_unless + (equal_history prev prev_cell) + (dal_proof_error + "Internal error: search's Nearest result is \ + inconsistent.") + in + return @@ List.rev rev_next_inc_proof + in + return + (Page_unconfirmed {prev_cell; next_cell_opt; next_inc_proof}, None) + | None, Found _ -> + tzfail + @@ dal_proof_error + "The page ID's slot is confirmed, but no page content and proof \ + are provided." + | Some _, Nearest _ -> + tzfail + @@ dal_proof_error + "The page ID's slot is not confirmed, but page content and \ + proof are provided." + + let produce_proof dal_params page_id ~page_info ~get_history slots_hist = + let open Lwt_result_syntax in + let* proof_repr, page_data = + produce_proof_repr dal_params page_id ~page_info ~get_history slots_hist + in + let*? serialized_proof = serialize_proof proof_repr in + return (serialized_proof, page_data) + + (* Given a starting cell [snapshot] and a (final) [target], this function + checks that the provided [inc_proof] encodes a minimal path from + [snapshot] to [target]. *) + let verify_inclusion_proof inc_proof ~src:snapshot ~dest:target = + let assoc = List.map (fun c -> (hash c, c)) inc_proof in + let path = List.split assoc |> fst in + let deref = + let open Map.Make (Pointer_hash) in + let map = of_seq (List.to_seq assoc) in + fun ptr -> find_opt ptr map + in + let snapshot_ptr = hash snapshot in + let target_ptr = hash target in + error_unless + (Skip_list.valid_back_path + ~equal_ptr:Pointer_hash.equal + ~deref + ~cell_ptr:snapshot_ptr + ~target_ptr + path) + (dal_proof_error "verify_proof_repr: invalid inclusion Dal proof.") + + let verify_proof_repr dal_params page_id snapshot proof = + let open Result_syntax in + let Page.{slot_id; page_index = _} = page_id in + match proof with + | Page_confirmed {target_cell; page_data; page_proof; inc_proof} -> + (* If the page is supposed to be confirmed, the last cell in + [inc_proof] should store the slot of the page. *) + let Header.{id; commitment} = Skip_list.content target_cell in + let* () = + error_when + Compare.Int.(Header.compare_slot_id id Header.zero.id = 0) + (dal_proof_error + "verify_proof_repr: cannot construct a confirmation page \ + proof with 'zero' as target slot.") + in + let* () = + verify_inclusion_proof inc_proof ~src:snapshot ~dest:target_cell + in + (* We check that the page indeed belongs to the target slot at the + given page index. *) + let* () = + check_page_proof dal_params page_proof page_data page_id commitment + in + (* If all checks succeed, we return the data/content of the page. *) + return_some page_data + | Page_unconfirmed {prev_cell; next_cell_opt; next_inc_proof} -> + (* The page's slot is supposed to be unconfirmed. *) + let ( < ) a b = Compare.Int.(Header.compare_slot_id a b < 0) in + (* We retrieve the last cell of the inclusion proof to be able to + call {!verify_inclusion_proof}. We also do some well-formedness on + the shape of the inclusion proof (see the case [Page_unconfirmed] + of type {!proof}). *) + let* () = + match next_cell_opt with + | None -> + let* () = + error_unless + (List.is_empty next_inc_proof) + (dal_proof_error + "verify_proof_repr: invalid next_inc_proof") + in + (* In case the inclusion proof has no elements, we check that: + - the prev_cell slot's id is smaller than the unconfirmed slot's ID + - the snapshot is equal to the [prev_cell] skip list. + + This way, and since the skip list is sorted wrt. + {!compare_slot_id}, we are sure that the skip list whose head + is [snapshot] = [prev_cell] cannot contain a slot whose ID is + [slot_id]. *) + error_unless + ((Skip_list.content prev_cell).id < slot_id + && equal_history snapshot prev_cell) + (dal_proof_error "verify_proof_repr: invalid next_inc_proof") + | Some next_cell -> + (* In case the inclusion proof has at least one element, + we check that: + - the [prev_cell] slot's id is smaller than [slot_id] + - the [next_cell] slot's id is greater than [slot_id] + - the [next_cell] cell is a direct successor of the + [prev_cell] cell. + - the [next_cell] cell is a predecessor of [snapshot] + + Since the skip list is sorted wrt. {!compare_slot_id}, and + if the call to {!verify_inclusion_proof} succeeds, we are + sure that the skip list whose head is [snapshot] cannot + contain a slot whose ID is [slot_id]. *) + let* () = + error_unless + ((Skip_list.content prev_cell).id < slot_id + && slot_id < (Skip_list.content next_cell).id + && + let prev_cell_pointer = + Skip_list.back_pointer next_cell 0 + in + match prev_cell_pointer with + | None -> false + | Some prev_ptr -> + Pointer_hash.equal prev_ptr (hash prev_cell)) + (dal_proof_error + "verify_proof_repr: invalid next_inc_proof") + in + verify_inclusion_proof + next_inc_proof + ~src:snapshot + ~dest:next_cell + in + return_none + + let verify_proof dal_params page_id snapshot serialized_proof = + let open Result_syntax in + let* proof_repr = deserialize_proof serialized_proof in + verify_proof_repr dal_params page_id snapshot proof_repr + + module Internal_for_tests = struct + let content = Skip_list.content + + let proof_statement_is serialized_proof expected = + match deserialize_proof serialized_proof with + | Error _ -> false + | Ok proof -> ( + match (expected, proof) with + | `Confirmed, Page_confirmed _ | `Unconfirmed, Page_unconfirmed _ -> + true + | _ -> false) + end + end + + include V1 +end diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.mli b/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.mli new file mode 100644 index 000000000000..b4db6978446c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_slot_repr.mli @@ -0,0 +1,357 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** To verify the proof of a page membership in its associated slot, the + Cryptobox module needs the following Dal parameters. These are part of the + protocol's parameters. See {!Default_parameters.default_dal}. *) +type parameters = Dal.parameters = { + redundancy_factor : int; + page_size : int; + slot_size : int; + number_of_shards : int; +} + +(** An encoding for values of type {!parameters}. *) +val parameters_encoding : parameters Data_encoding.t + +(** Slot header representation for the data-availability layer. + + {1 Overview} + + For the data-availability layer, the L1 provides a list of slots + at every level. A slot is a blob of data that can be interpreted by + the users of the data-availability layer (such as SCORU). + + The purpose of the data-availability layer is to increase the + bandwidth of the layer 1 thanks to the distribution of "slots". A + slot is never posted directly onto the layer 1 blocks but on the + data-availability layer. The producer of a slot still has to post a + slot header onto the layer 1. A slot header is an abstract datatype + certifying that the corresponding slot has some maximum size + (provided by the layer 1). In other words, the whole data contained + into the slot cannot exceed some fixed size. This is to avoid + attacks where a slot header would be posted onto the layer 1 block, + declared available by the protocol, but actually the slot size + would be too large to be refuted a posteriori. + + The slot header can also be used to prove that a blob of data is a + portion of the initial slot. *) + +module Commitment : sig + (** A slot commitment is provided via the environment. *) + type t = Dal.commitment + + val encoding : t Data_encoding.t + + (** A dummy value for a commitment. This commitment does not + correspond to any valid pre-image. *) + val zero : t +end + +module Commitment_proof : sig + (** A slot commitment proof is provided via the environment. *) + type t = Dal.commitment_proof + + val encoding : t Data_encoding.t + + (** A dummy value for a commitment proof. *) + val zero : t +end + +(** An `Index.t` is a possible value for a slot index. We assume this value + to be a positive 8-bit integer. Note that this is a hard constraint, + which is independent of protocol constants. If a choice is ever made to + increase the size of available slots in the protocol, we also need + to change this module to accommodate for higher values. +*) +module Index : sig + type t + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val zero : t + + val max_value : t + + (** [of_int n] constructs a`Slot_index.t` *) + val of_int : int -> t option + + val to_int : t -> int + + val compare : t -> t -> int + + val equal : t -> t -> bool +end + +module Header : sig + (** For Layer-1, a slot is identified by the level at which it is published + and the slot's index. *) + type id = {published_level : Raw_level_repr.t; index : Index.t} + + (** For Layer-1, a slot is described by its slot {!id} and the + slot's commitment. *) + type t = {id : id; commitment : Commitment.t} + + (** A "publish slot header" operation contains a slot header + together with a proof that the slot size is smaller than + [slot_size]. *) + type operation = {header : t; proof : Commitment_proof.t} + + (** encoding for values of type {!id}. *) + val id_encoding : id Data_encoding.t + + (** encoding for values of type {!t}. *) + val encoding : t Data_encoding.t + + (** encoding for values of type {!operation}. *) + val operation_encoding : operation Data_encoding.t + + (** pretty-printer for values of type {!id}. *) + val pp_id : Format.formatter -> id -> unit + + (** pretty-printer for values of type {!t}. *) + val pp : Format.formatter -> t -> unit + + (** equal function for values of type {!t}. *) + val equal : t -> t -> bool + + (** check that for the given slot header operation, the commitment + proof is correct wrt the commitment *) + val verify_commitment : parameters -> operation -> bool tzresult +end + +(** A DAL slot is decomposed to a successive list of pages with fixed content + size. The size is chosen so that it's possible to inject a page in a Tezos + L1 operation if needed during the proof phase of a refutation game. +*) +module Page : sig + type content = Bytes.t + + type slot_index = Index.t + + val pages_per_slot : Dal.parameters -> int + + module Index : sig + type t = int + + val zero : int + + val encoding : int Data_encoding.t + + val pp : Format.formatter -> int -> unit + + val compare : int -> int -> int + + val equal : int -> int -> bool + end + + (** Encoding for page contents. *) + val content_encoding : content Data_encoding.t + + (** A page is identified by its slot ID and by its own index in the list + of pages of the slot. *) + type t = {slot_id : Header.id; page_index : Index.t} + + type proof = Dal.page_proof + + (** equal function for values of type {!t}. *) + val equal : t -> t -> bool + + (** encoding for values of type {!t}. *) + val encoding : t Data_encoding.t + + (** encoding for values of type {!proof}. *) + val proof_encoding : proof Data_encoding.t + + (** pretty-printer for values of type {!t}. *) + val pp : Format.formatter -> t -> unit +end + +(** Only one slot header is accepted per slot index. If two slots + headers are included into a block, the second one will fail. + + Consequently, we rely on the order of operations which is done + thanks to the fee market. + + This is encapsulated in the following module. *) +module Slot_market : sig + (** Represent the fee market for a list of slots. *) + type t + + (** [init ~length] encodes a list of [length] slots without + candidates. *) + val init : length:int -> t + + (** [length t] returns the [length] provided at initialisation time + (see {!val:init}). *) + val length : t -> int + + (** [register t index fees] updates the candidate associated to + index [index]. Returns [Some (_, true)] if the candidate is + registered. Returns [Some (_, false)] otherwise. Returns [None] + if the [index] is not in the interval [0;length] where [length] + is the value provided to the [init] function. *) + val register : t -> Header.t -> (t * bool) option + + (** [candidates t] returns a list of slot header candidates. *) + val candidates : t -> Header.t list +end + +(** This module provides an abstract data structure (type {!t}) that represents a + skip list used to store successive DAL slots confirmed on L1. There is one + slot per cell in the skip list. The slots are sorted in increasing order by + level, and by slot index, for the slots of the same level. + + This module also defines a bounded history cache (type {History_cache.t}) + that allows to remember recent values of a skip list of type {!t} + (indexed by the skip lists' hashes). This structure is meant to be + maintained and used by the rollup node to produce refutation proofs + involving DAL slot inputs. +*) +module History : sig + (** Abstract representation of a skip list specialized for + confirmed slot headers. *) + type t + + (** Type of hashes of history. *) + type hash + + (** Encoding of the datatype. *) + val encoding : t Data_encoding.t + + (** First cell of this skip list. *) + val genesis : t + + (** Returns the hash of an history. *) + val hash : t -> hash + + (** The [History_cache.t] structure is basically a bounded lookup table of + {!t} skip lists. (See {!Bounded_history_repr.S}). In the L1 layer, the + capacity (bound) is set to zero (nothing is remembered). By contrast, + the rollup node uses a history cache with a (sufficiently) large capacity + to participate in all potential refutation games occurring during the + challenge period. Indeed, the successive recent skip-lists stored in + the cache are needed to produce proofs involving slots' pages. *) + module History_cache : + Bounded_history_repr.S with type key = hash and type value = t + + (** [add_confirmed_slots hist cache slot_headers] updates the given structure + [hist] with the list of [slot_headers]. The given [cache] is also updated to + add successive values of [cell] to it. *) + val add_confirmed_slot_headers : + t -> History_cache.t -> Header.t list -> (t * History_cache.t) tzresult + + (** [add_confirmed_slot_headers_no_cache cell slot_headers] same as + {!add_confirmed_slot_headers}, but no cache is updated. *) + val add_confirmed_slot_headers_no_cache : t -> Header.t list -> t tzresult + + (** [equal a b] returns true iff a is equal to b. *) + val equal : t -> t -> bool + + (** {1 Dal slots/pages proofs} *) + + (** When a SCORU kernel's inputs come from the DAL, they are provided as + pages' content for confirmed slots, or None in case the slot doesn't + exist or is not confirmed. + + In a refutation game involving an import tick of a Dal page input, a + honest user should be able to provide: + + - When the PVM is requesting a page of a confirmed slot: a proof that the + slot is confirmed, in addition to needed information to check that the + page (whose id and content are given) is part of the slot; + + - When the opponent pretends that the PVM is requesting a page of some + unconfirmed slot, but that slot is not published or not confirmed on L1: + a proof that the slot (whose id is given via the page's id) cannot be + confirmed on L1. + + See the documentation in the ml file for more technical details. *) + type proof + + (** Encoding for {!proof}. *) + val proof_encoding : proof Data_encoding.t + + (** Pretty-printer for {!proof}. If [serialized] is [false] it will print + the abstracted proof representation, otherwise if it's [true] it will + print the serialized version of the proof (i.e. a sequence of bytes). *) + val pp_proof : serialized:bool -> Format.formatter -> proof -> unit + + (** [produce_proof dal_parameters page_id page_info ~get_history slots_hist] + produces a proof that either: + - there exists a confirmed slot in the skip list that contains + the page identified by [page_id] whose data and slot inclusion proof + are given by [page_info], or + - there cannot exist a confirmed slot in the skip list (whose head is + given by [slots_hist]) containing the page identified by [page_id]. + + In the first case above, [page_info] should contain the page's content + and the proof that the page is part of the (confirmed) slot whose + id is given in [page_id]. In the second case, no page content or proof + should be provided, as they are not needed to construct a non-confirmation + proof. + + [dal_parameters] is used when verifying that/if the page is part of + the candidate slot (if any). + *) + val produce_proof : + parameters -> + Page.t -> + page_info:(Page.content * Page.proof) option -> + get_history:(hash -> t option Lwt.t) -> + t -> + (proof * Page.content option) tzresult Lwt.t + + (** [verify_proof dal_params page_id snapshot proof] verifies that the given + [proof] is a valid proof to show that either: + - the page identified by [page_id] belongs to a confirmed slot stored in + the skip list whose head is [snapshot], or + - there is not confirmed slot in the skip list (whose head is) [snapshot] + that could contain the page identified by [page_id]. + + [dal_parameters] is used when verifying that/if the page is part of + the candidate slot (if any). + *) + val verify_proof : + parameters -> Page.t -> t -> proof -> Page.content option tzresult + + type error += Add_element_in_slots_skip_list_violates_ordering + + type error += + | Dal_proof_error of string + | Unexpected_page_size of {expected_size : int; page_size : int} + + module Internal_for_tests : sig + val content : t -> Header.t + + (** [proof_statement_is serialized_proof expected] will return [true] if + the deserialized proof and the [expected] proof shape match and [false] + otherwise. + Note that it will also return [false] if deserialization fails. *) + val proof_statement_is : proof -> [`Confirmed | `Unconfirmed] -> bool + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.ml b/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.ml new file mode 100644 index 000000000000..d271b3cf228e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.ml @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let find_slot_headers ctxt level = Storage.Dal.Slot.Headers.find ctxt level + +let finalize_current_slot_headers ctxt = + let current_level = Raw_context.current_level ctxt in + let slot_headers = Raw_context.Dal.candidates ctxt in + match slot_headers with + | [] -> Lwt.return ctxt + | _ :: _ -> Storage.Dal.Slot.Headers.add ctxt current_level.level slot_headers + +let compute_available_slot_headers ctxt seen_slot_headers = + let open Dal_slot_repr in + let fold_available_slots (rev_slot_headers, available_slot_headers) slot = + if Raw_context.Dal.is_slot_index_available ctxt slot.Header.id.index then + ( slot :: rev_slot_headers, + Dal_attestation_repr.commit available_slot_headers slot.Header.id.index + ) + else (rev_slot_headers, available_slot_headers) + in + List.fold_left + fold_available_slots + ([], Dal_attestation_repr.empty) + seen_slot_headers + +let get_slot_headers_history ctxt = + Storage.Dal.Slot.History.find ctxt >|=? function + | None -> Dal_slot_repr.History.genesis + | Some slots_history -> slots_history + +let update_skip_list ctxt ~confirmed_slot_headers = + get_slot_headers_history ctxt >>=? fun slots_history -> + Lwt.return + @@ Dal_slot_repr.History.add_confirmed_slot_headers_no_cache + slots_history + confirmed_slot_headers + >>=? fun slots_history -> + Storage.Dal.Slot.History.add ctxt slots_history >|= ok + +let finalize_pending_slot_headers ctxt = + let {Level_repr.level = raw_level; _} = Raw_context.current_level ctxt in + let Constants_parametric_repr.{dal; _} = Raw_context.constants ctxt in + match Raw_level_repr.(sub raw_level dal.attestation_lag) with + | None -> return (ctxt, Dal_attestation_repr.empty) + | Some level_attested -> ( + Storage.Dal.Slot.Headers.find ctxt level_attested >>=? function + | None -> return (ctxt, Dal_attestation_repr.empty) + | Some seen_slots -> + let rev_confirmed_slot_headers, available_slot_headers = + compute_available_slot_headers ctxt seen_slots + in + let confirmed_slot_headers = List.rev rev_confirmed_slot_headers in + update_skip_list ctxt ~confirmed_slot_headers >>=? fun ctxt -> + Storage.Dal.Slot.Headers.remove ctxt level_attested >>= fun ctxt -> + return (ctxt, available_slot_headers)) diff --git a/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.mli b/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.mli new file mode 100644 index 000000000000..ad4ac8317e93 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dal_slot_storage.mli @@ -0,0 +1,72 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Storage management of slots for the data-availability layer. + + {1 Overview} + + This module is an interface for the slot storage for the layer 1. + + Depending on the current level of the context and the [lag] (a + constant given by the context), the status of the slot may differ: + + - For every level in the interval [current_level; current_level + + lag -1] the slot is [Pending]. This means a slot header was + proposed but was not declared available yet. + + - For every level above [current_level + lag], the slot may be + [confirmed]. For any slot confirmed by the protocol (i.e. indices + returned by [finalize_pending_slots]), subscribers of the DAL + should take into account the corresponding slots. + + - For every level below [current_level - lag], there should not be + any slot in the storage. *) + +(** [find_slot_headers ctxt level] returns [Some slot_headers] where [slot_headers] + are pending slots at level [level]. [None] is returned if no + [slot_header] was registered at this level. The function fails if + the reading into the context fails. *) +val find_slot_headers : + Raw_context.t -> + Raw_level_repr.t -> + Dal_slot_repr.Header.t list option tzresult Lwt.t + +(** [finalize_current_slot_headers ctxt] finalizes the current slot + headers posted on this block and marks them as pending into the + context. *) +val finalize_current_slot_headers : Raw_context.t -> Raw_context.t Lwt.t + +(** [finalize_pending_slot_headers ctxt] finalizes pending slot + headers which are old enough (i.e. registered at level + [current_level - lag]). All slots marked as available are + returned. All the pending slots at [current_level - lag] level are + removed from the context. *) +val finalize_pending_slot_headers : + Raw_context.t -> (Raw_context.t * Dal_attestation_repr.t) tzresult Lwt.t + +(** [get_slot_headers_history ctxt] returns the current value of slots_history stored + in [ctxt], or Slots_history.genesis if no value is stored yet. *) +val get_slot_headers_history : + Raw_context.t -> Dal_slot_repr.History.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.ml new file mode 100644 index 000000000000..e7aead3a4515 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.ml @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let is_inactive ctxt delegate = + Storage.Contract.Inactive_delegate.mem ctxt (Contract_repr.Implicit delegate) + >>= fun inactive -> + if inactive then return inactive + else + Storage.Contract.Delegate_last_cycle_before_deactivation.find + ctxt + (Contract_repr.Implicit delegate) + >|=? function + | Some last_active_cycle -> + let ({Level_repr.cycle = current_cycle; _} : Level_repr.t) = + Raw_context.current_level ctxt + in + Cycle_repr.(last_active_cycle < current_cycle) + | None -> + (* This case is only when called from `set_active`, when creating + a contract. *) + false + +let last_cycle_before_deactivation ctxt delegate = + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegate_last_cycle_before_deactivation.get ctxt contract + +let set_inactive ctxt delegate = + Storage.Contract.Inactive_delegate.add ctxt (Contract_repr.Implicit delegate) + +let set_active ctxt delegate = + is_inactive ctxt delegate >>=? fun inactive -> + let current_cycle = (Raw_context.current_level ctxt).cycle in + let preserved_cycles = Constants_storage.preserved_cycles ctxt in + (* We allow a number of cycles before a delegate is deactivated as follows: + - if the delegate is active, we give it at least `1 + preserved_cycles` + after the current cycle before to be deactivated. + - if the delegate is new or inactive, we give it additionally + `preserved_cycles` because the delegate needs this number of cycles to + receive rights, so `1 + 2 * preserved_cycles` in total. *) + let delegate_contract = Contract_repr.Implicit delegate in + Storage.Contract.Delegate_last_cycle_before_deactivation.find + ctxt + delegate_contract + >>=? fun current_last_active_cycle -> + let last_active_cycle = + match current_last_active_cycle with + | None -> Cycle_repr.add current_cycle (1 + (2 * preserved_cycles)) + | Some current_last_active_cycle -> + let delay = + if inactive then 1 + (2 * preserved_cycles) else 1 + preserved_cycles + in + let updated = Cycle_repr.add current_cycle delay in + Cycle_repr.max current_last_active_cycle updated + in + Storage.Contract.Delegate_last_cycle_before_deactivation.add + ctxt + delegate_contract + last_active_cycle + >>= fun ctxt -> + if not inactive then return (ctxt, inactive) + else + Storage.Contract.Inactive_delegate.remove ctxt delegate_contract + >>= fun ctxt -> return (ctxt, inactive) diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.mli new file mode 100644 index 000000000000..390d37cbef2f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_activation_storage.mli @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module deals with delegates' activity. Typically, the provided + functions can be used to deactivate a delegate that has not shown activity + for a certain number of cycles, and to reactivate it when appropriate. + + This module is responsible for maintaining the following tables: + - {!Storage.Contract.Inactive_delegate} + - {!Storage.Contract.Delegate_last_cycle_before_deactivation} *) + +val is_inactive : + Raw_context.t -> Signature.Public_key_hash.t -> bool tzresult Lwt.t + +(** [last_cycle_before_deactivation ctxt delegate] is the cycle at which + the delegate is scheduled to become inactive. *) +val last_cycle_before_deactivation : + Raw_context.t -> Signature.Public_key_hash.t -> Cycle_repr.t tzresult Lwt.t + +(** [set_inactive context delegate] adds [delegate] to the set of inactive + contracts. *) +val set_inactive : + Raw_context.t -> Signature.Public_key_hash.t -> Raw_context.t Lwt.t + +(** [set_active ctxt delegate] returns a pair [(new_ctxt, is_inactive)] where: + - [new_ctxt] is a new context, updated from [ctxt], where the [delegate]'s + last active cycle has been updated + - [is_inactive] represents the state of [delegate], prior to the update. + *) +val set_active : + Raw_context.t -> + Signature.Public_key_hash.t -> + (Raw_context.t * bool) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.ml new file mode 100644 index 000000000000..f981f386e287 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.ml @@ -0,0 +1,236 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Invalid_consensus_key_update_noop of Cycle_repr.t + | Invalid_consensus_key_update_active + | Invalid_consensus_key_update_tz4 of Bls.Public_key.t + +let () = + register_error_kind + `Permanent + ~id:"delegate.consensus_key.invalid_noop" + ~title:"Invalid key for consensus key update" + ~description:"Tried to update the consensus key with the active key" + ~pp:(fun ppf cycle -> + Format.fprintf + ppf + "Invalid key while updating a consensus key (already active since %a)." + Cycle_repr.pp + cycle) + Data_encoding.(obj1 (req "cycle" Cycle_repr.encoding)) + (function Invalid_consensus_key_update_noop c -> Some c | _ -> None) + (fun c -> Invalid_consensus_key_update_noop c) ; + register_error_kind + `Permanent + ~id:"delegate.consensus_key.active" + ~title:"Active consensus key" + ~description: + "The delegate consensus key is already used by another delegate" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The delegate consensus key is already used by another delegate") + Data_encoding.empty + (function Invalid_consensus_key_update_active -> Some () | _ -> None) + (fun () -> Invalid_consensus_key_update_active) ; + register_error_kind + `Permanent + ~id:"delegate.consensus_key.tz4" + ~title:"Consensus key cannot be a tz4" + ~description:"Consensus key cannot be a tz4 (BLS public key)." + ~pp:(fun ppf pk -> + Format.fprintf + ppf + "The consensus key %a is forbidden as it is a BLS public key." + Bls.Public_key_hash.pp + (Bls.Public_key.hash pk)) + Data_encoding.(obj1 (req "delegate_pk" Bls.Public_key.encoding)) + (function Invalid_consensus_key_update_tz4 pk -> Some pk | _ -> None) + (fun pk -> Invalid_consensus_key_update_tz4 pk) + +type pk = Raw_context.consensus_pk = { + delegate : Signature.Public_key_hash.t; + consensus_pk : Signature.Public_key.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +type t = { + delegate : Signature.Public_key_hash.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +let pkh {delegate; consensus_pkh; consensus_pk = _} = {delegate; consensus_pkh} + +let zero = + { + consensus_pkh = Signature.Public_key_hash.zero; + delegate = Signature.Public_key_hash.zero; + } + +let pp ppf {delegate; consensus_pkh} = + Format.fprintf ppf "@[<v 2>%a" Signature.Public_key_hash.pp delegate ; + if not (Signature.Public_key_hash.equal delegate consensus_pkh) then + Format.fprintf + ppf + "@,Active key: %a" + Signature.Public_key_hash.pp + consensus_pkh ; + Format.fprintf ppf "@]" + +(* Invariant: + No two delegates use the same active consensus key at a given time. + + To ensure that, {!Storage.Consensus_keys} contains keys that will be active + at cycle `current + preserved_cycles + 1`. +*) + +let check_unused ctxt pkh = + let open Lwt_result_syntax in + let*! is_active = Storage.Consensus_keys.mem ctxt pkh in + fail_when is_active Invalid_consensus_key_update_active + +let check_not_tz4 : Signature.Public_key.t -> unit tzresult = function + | Bls pk -> error (Invalid_consensus_key_update_tz4 pk) + | Ed25519 _ | Secp256k1 _ | P256 _ -> Ok () + +let set_unused = Storage.Consensus_keys.remove + +let set_used = Storage.Consensus_keys.add + +let init ctxt delegate pk = + let open Lwt_result_syntax in + let*? () = check_not_tz4 pk in + let pkh = Signature.Public_key.hash pk in + let* () = check_unused ctxt pkh in + let*! ctxt = set_used ctxt pkh in + Storage.Contract.Consensus_key.init ctxt (Contract_repr.Implicit delegate) pk + +let active_pubkey ctxt delegate = + let open Lwt_result_syntax in + let* pk = + Storage.Contract.Consensus_key.get ctxt (Contract_repr.Implicit delegate) + in + let pkh = Signature.Public_key.hash pk in + return {consensus_pk = pk; consensus_pkh = pkh; delegate} + +let active_key ctxt delegate = + let open Lwt_result_syntax in + let* pk = active_pubkey ctxt delegate in + return (pkh pk) + +let raw_pending_updates ctxt delegate = + let open Lwt_result_syntax in + let*! pendings = + Storage.Contract.Pending_consensus_keys.bindings + (ctxt, Contract_repr.Implicit delegate) + in + return pendings + +let pending_updates ctxt delegate = + let open Lwt_result_syntax in + let* updates = raw_pending_updates ctxt delegate in + let updates = + List.sort (fun (c1, _) (c2, _) -> Cycle_repr.compare c1 c2) updates + in + return (List.map (fun (c, pk) -> (c, Signature.Public_key.hash pk)) updates) + +let raw_active_pubkey_for_cycle ctxt delegate cycle = + let open Lwt_result_syntax in + let* pendings = raw_pending_updates ctxt delegate in + let* active = active_pubkey ctxt delegate in + let current_level = Raw_context.current_level ctxt in + let active_for_cycle = + List.fold_left + (fun (c1, active) (c2, pk) -> + if Cycle_repr.(c1 < c2 && c2 <= cycle) then (c2, pk) else (c1, active)) + (current_level.cycle, active.consensus_pk) + pendings + in + return active_for_cycle + +let active_pubkey_for_cycle ctxt delegate cycle = + let open Lwt_result_syntax in + let* _, consensus_pk = raw_active_pubkey_for_cycle ctxt delegate cycle in + return + { + consensus_pk; + consensus_pkh = Signature.Public_key.hash consensus_pk; + delegate; + } + +let register_update ctxt delegate pk = + let open Lwt_result_syntax in + let update_cycle = + let current_level = Raw_context.current_level ctxt in + let preserved_cycles = Constants_storage.preserved_cycles ctxt in + Cycle_repr.add current_level.cycle (preserved_cycles + 1) + in + let* () = + let* first_active_cycle, active_pubkey = + raw_active_pubkey_for_cycle ctxt delegate update_cycle + in + fail_when + Signature.Public_key.(pk = active_pubkey) + (Invalid_consensus_key_update_noop first_active_cycle) + in + let*? () = check_not_tz4 pk in + let pkh = Signature.Public_key.hash pk in + let* () = check_unused ctxt pkh in + let*! ctxt = set_used ctxt pkh in + let* {consensus_pkh = old_pkh; _} = + active_pubkey_for_cycle ctxt delegate update_cycle + in + let*! ctxt = set_unused ctxt old_pkh in + let*! ctxt = + Storage.Contract.Pending_consensus_keys.add + (ctxt, Contract_repr.Implicit delegate) + update_cycle + pk + in + return ctxt + +let activate ctxt ~new_cycle = + let open Lwt_result_syntax in + Storage.Delegates.fold + ctxt + ~order:`Undefined + ~init:(ok ctxt) + ~f:(fun delegate ctxt -> + let*? ctxt = ctxt in + let delegate = Contract_repr.Implicit delegate in + let* update = + Storage.Contract.Pending_consensus_keys.find (ctxt, delegate) new_cycle + in + match update with + | None -> return ctxt + | Some pk -> + let*! ctxt = Storage.Contract.Consensus_key.add ctxt delegate pk in + let*! ctxt = + Storage.Contract.Pending_consensus_keys.remove + (ctxt, delegate) + new_cycle + in + return ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.mli new file mode 100644 index 000000000000..914f02ed7f86 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_consensus_key.mli @@ -0,0 +1,97 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Management of a delegate's consensus key, the one used to sign + blocks and consensus operations. It is responsible for maintaining + the tables {!Storage.Consensus_keys}, + {!Storage.Contract.Consensus_key}, and + {!Storage.Contract.Pending_consensus_keys}. *) + +type error += + | Invalid_consensus_key_update_noop of Cycle_repr.t + | Invalid_consensus_key_update_active + | Invalid_consensus_key_update_tz4 of Bls.Public_key.t + +(** The public key of a consensus key and the associated delegate. *) +type pk = Raw_context.consensus_pk = { + delegate : Signature.Public_key_hash.t; + consensus_pk : Signature.Public_key.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +(** The public key hash of a consensus key and the associated delegate. *) +type t = { + delegate : Signature.Public_key_hash.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +val zero : t + +val pp : Format.formatter -> t -> unit + +val pkh : pk -> t + +(** [check_not_tz4 pk] checks that [pk] is not a BLS address. *) +val check_not_tz4 : Signature.public_key -> unit tzresult + +(** Initialize the consensus key when registering a delegate. *) +val init : + Raw_context.t -> + Signature.Public_key_hash.t -> + Signature.Public_key.t -> + Raw_context.t tzresult Lwt.t + +(** Returns the active consensus key for the current cycle. *) +val active_pubkey : + Raw_context.t -> Signature.Public_key_hash.t -> pk tzresult Lwt.t + +(** Returns the active consensus key for the current cycle. *) +val active_key : + Raw_context.t -> Signature.Public_key_hash.t -> t tzresult Lwt.t + +(** Returns the active consensus key for the given cycle. *) +val active_pubkey_for_cycle : + Raw_context.t -> + Signature.Public_key_hash.t -> + Cycle_repr.t -> + pk tzresult Lwt.t + +(** Returns the list of pending consensus-key updates in upcoming cycles. *) +val pending_updates : + Raw_context.t -> + Signature.Public_key_hash.t -> + (Cycle_repr.t * Signature.Public_key_hash.t) list tzresult Lwt.t + +(** Register a consensus-key update. *) +val register_update : + Raw_context.t -> + Signature.Public_key_hash.t -> + Signature.Public_key.t -> + Raw_context.t tzresult Lwt.t + +(** Activate consensus keys at the beginning of cycle [new_cycle]. + This function iterates on all registered delegates. *) +val activate : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.ml new file mode 100644 index 000000000000..943467e4155d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.ml @@ -0,0 +1,282 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let update_activity ctxt last_cycle = + let preserved = Constants_storage.preserved_cycles ctxt in + match Cycle_repr.sub last_cycle preserved with + | None -> return (ctxt, []) + | Some _unfrozen_cycle -> + Stake_storage.fold_on_active_delegates_with_minimal_stake + ctxt + ~order:`Sorted + ~init:(Ok (ctxt, [])) + ~f:(fun delegate () acc -> + acc >>?= fun (ctxt, deactivated) -> + Delegate_activation_storage.last_cycle_before_deactivation + ctxt + delegate + >>=? fun cycle -> + if Cycle_repr.(cycle <= last_cycle) then + Stake_storage.set_inactive ctxt delegate >>= fun ctxt -> + return (ctxt, delegate :: deactivated) + else return (ctxt, deactivated)) + >|=? fun (ctxt, deactivated) -> (ctxt, deactivated) + +(* Return a map from delegates (with active stake at some cycle + in the cycle window [from_cycle, to_cycle]) to the maximum + of the stake to be deposited for each such cycle (which is just the + [frozen_deposits_percentage] of the active stake at that cycle). Also + return the delegates that have fallen out of the sliding window. *) +let max_frozen_deposits_and_delegates_to_remove ctxt ~from_cycle ~to_cycle = + let frozen_deposits_percentage = + Constants_storage.frozen_deposits_percentage ctxt + in + let cycles = Cycle_repr.(from_cycle ---> to_cycle) in + (match Cycle_repr.pred from_cycle with + | None -> return Signature.Public_key_hash.Set.empty + | Some cleared_cycle -> ( + Stake_storage.find_selected_distribution ctxt cleared_cycle + >|=? fun cleared_cycle_delegates -> + match cleared_cycle_delegates with + | None -> Signature.Public_key_hash.Set.empty + | Some delegates -> + List.fold_left + (fun set (d, _) -> Signature.Public_key_hash.Set.add d set) + Signature.Public_key_hash.Set.empty + delegates)) + >>=? fun cleared_cycle_delegates -> + List.fold_left_es + (fun (maxima, delegates_to_remove) (cycle : Cycle_repr.t) -> + Stake_storage.get_selected_distribution ctxt cycle + >|=? fun active_stakes -> + List.fold_left + (fun (maxima, delegates_to_remove) (delegate, stake) -> + let stake_to_be_deposited = + Tez_repr.(div_exn (mul_exn stake frozen_deposits_percentage) 100) + in + let maxima = + Signature.Public_key_hash.Map.update + delegate + (function + | None -> Some stake_to_be_deposited + | Some maximum -> + Some (Tez_repr.max maximum stake_to_be_deposited)) + maxima + in + let delegates_to_remove = + Signature.Public_key_hash.Set.remove delegate delegates_to_remove + in + (maxima, delegates_to_remove)) + (maxima, delegates_to_remove) + active_stakes) + (Signature.Public_key_hash.Map.empty, cleared_cycle_delegates) + cycles + +let freeze_deposits ?(origin = Receipt_repr.Block_application) ctxt ~new_cycle + ~balance_updates = + let max_slashable_period = Constants_storage.max_slashing_period ctxt in + (* We want to be able to slash for at most [max_slashable_period] *) + (match Cycle_repr.(sub new_cycle (max_slashable_period - 1)) with + | None -> + Storage.Tenderbake.First_level_of_protocol.get ctxt + >>=? fun first_level_of_protocol -> + let cycle_eras = Raw_context.cycle_eras ctxt in + let level = + Level_repr.level_from_raw ~cycle_eras first_level_of_protocol + in + return level.cycle + | Some cycle -> return cycle) + >>=? fun from_cycle -> + let preserved_cycles = Constants_storage.preserved_cycles ctxt in + let to_cycle = Cycle_repr.(add new_cycle preserved_cycles) in + max_frozen_deposits_and_delegates_to_remove ctxt ~from_cycle ~to_cycle + >>=? fun (maxima, delegates_to_remove) -> + Signature.Public_key_hash.Map.fold_es + (fun delegate maximum_stake_to_be_deposited (ctxt, balance_updates) -> + (* Here we make sure to preserve the following invariant : + maximum_stake_to_be_deposited <= frozen_deposits + balance + See select_distribution_for_cycle *) + let delegate_contract = Contract_repr.Implicit delegate in + Frozen_deposits_storage.update_initial_amount + ctxt + delegate_contract + maximum_stake_to_be_deposited + >>=? fun ctxt -> + Frozen_deposits_storage.get ctxt delegate_contract >>=? fun deposits -> + let current_amount = deposits.current_amount in + if Tez_repr.(current_amount > maximum_stake_to_be_deposited) then + Tez_repr.(current_amount -? maximum_stake_to_be_deposited) + >>?= fun to_reimburse -> + Token.transfer + ~origin + ctxt + (`Frozen_deposits delegate) + (`Delegate_balance delegate) + to_reimburse + >|=? fun (ctxt, bupds) -> (ctxt, bupds @ balance_updates) + else if Tez_repr.(current_amount < maximum_stake_to_be_deposited) then + Tez_repr.(maximum_stake_to_be_deposited -? current_amount) + >>?= fun desired_to_freeze -> + Delegate_storage.spendable_balance ctxt delegate >>=? fun balance -> + (* In case the delegate hasn't been slashed in this cycle, + the following invariant holds: + maximum_stake_to_be_deposited <= frozen_deposits + balance + See select_distribution_for_cycle + + If the delegate has been slashed during the cycle, the invariant + above doesn't necessarily hold. In this case, we freeze the max + we can for the delegate. *) + let to_freeze = Tez_repr.(min balance desired_to_freeze) in + Token.transfer + ~origin + ctxt + (`Delegate_balance delegate) + (`Frozen_deposits delegate) + to_freeze + >|=? fun (ctxt, bupds) -> (ctxt, bupds @ balance_updates) + else return (ctxt, balance_updates)) + maxima + (ctxt, balance_updates) + >>=? fun (ctxt, balance_updates) -> + (* Unfreeze deposits (that is, set them to zero) for delegates that + were previously in the relevant window (and therefore had some + frozen deposits) but are not in the new window; because that means + that such a delegate had no active stake in the relevant cycles, + and therefore it should have no frozen deposits. *) + Signature.Public_key_hash.Set.fold_es + (fun delegate (ctxt, balance_updates) -> + let delegate_contract = Contract_repr.Implicit delegate in + Frozen_deposits_storage.update_initial_amount + ctxt + delegate_contract + Tez_repr.zero + >>=? fun ctxt -> + Frozen_deposits_storage.get ctxt delegate_contract + >>=? fun frozen_deposits -> + if Tez_repr.(frozen_deposits.current_amount > zero) then + Token.transfer + ~origin + ctxt + (`Frozen_deposits delegate) + (`Delegate_balance delegate) + frozen_deposits.current_amount + >|=? fun (ctxt, bupds) -> (ctxt, bupds @ balance_updates) + else return (ctxt, balance_updates)) + delegates_to_remove + (ctxt, balance_updates) + +let delegate_has_revealed_nonces delegate unrevelead_nonces_set = + not (Signature.Public_key_hash.Set.mem delegate unrevelead_nonces_set) + +let distribute_endorsing_rewards ctxt last_cycle unrevealed_nonces = + let endorsing_reward_per_slot = + Constants_storage.endorsing_reward_per_slot ctxt + in + let unrevealed_nonces_set = + List.fold_left + (fun set {Storage.Seed.nonce_hash = _; delegate} -> + Signature.Public_key_hash.Set.add delegate set) + Signature.Public_key_hash.Set.empty + unrevealed_nonces + in + Stake_storage.get_total_active_stake ctxt last_cycle + >>=? fun total_active_stake -> + Stake_storage.get_selected_distribution ctxt last_cycle >>=? fun delegates -> + List.fold_left_es + (fun (ctxt, balance_updates) (delegate, active_stake) -> + let delegate_contract = Contract_repr.Implicit delegate in + Delegate_missed_endorsements_storage + .check_and_reset_delegate_participation + ctxt + delegate + >>=? fun (ctxt, sufficient_participation) -> + let has_revealed_nonces = + delegate_has_revealed_nonces delegate unrevealed_nonces_set + in + let expected_slots = + Delegate_missed_endorsements_storage + .expected_slots_for_given_active_stake + ctxt + ~total_active_stake + ~active_stake + in + let rewards = Tez_repr.mul_exn endorsing_reward_per_slot expected_slots in + if sufficient_participation && has_revealed_nonces then + (* Sufficient participation: we pay the rewards *) + Token.transfer + ctxt + `Endorsing_rewards + (`Contract delegate_contract) + rewards + >|=? fun (ctxt, payed_rewards_receipts) -> + (ctxt, payed_rewards_receipts @ balance_updates) + else + (* Insufficient participation or unrevealed nonce: no rewards *) + Token.transfer + ctxt + `Endorsing_rewards + (`Lost_endorsing_rewards + (delegate, not sufficient_participation, not has_revealed_nonces)) + rewards + >|=? fun (ctxt, payed_rewards_receipts) -> + (ctxt, payed_rewards_receipts @ balance_updates)) + (ctxt, []) + delegates + +let cycle_end ctxt last_cycle = + Seed_storage.cycle_end ctxt last_cycle >>=? fun (ctxt, unrevealed_nonces) -> + let new_cycle = Cycle_repr.add last_cycle 1 in + Delegate_sampler.select_new_distribution_at_cycle_end ctxt ~new_cycle + >>=? fun ctxt -> + Delegate_consensus_key.activate ctxt ~new_cycle >>=? fun ctxt -> + Delegate_slashed_deposits_storage.clear_outdated_slashed_deposits + ctxt + ~new_cycle + >>= fun ctxt -> + distribute_endorsing_rewards ctxt last_cycle unrevealed_nonces + >>=? fun (ctxt, balance_updates) -> + freeze_deposits ctxt ~new_cycle ~balance_updates + >>=? fun (ctxt, balance_updates) -> + Stake_storage.clear_at_cycle_end ctxt ~new_cycle >>=? fun ctxt -> + Delegate_sampler.clear_outdated_sampling_data ctxt ~new_cycle >>=? fun ctxt -> + update_activity ctxt last_cycle >>=? fun (ctxt, deactivated_delagates) -> + return (ctxt, balance_updates, deactivated_delagates) + +let init_first_cycles ctxt ~origin = + let preserved = Constants_storage.preserved_cycles ctxt in + List.fold_left_es + (fun ctxt c -> + let cycle = Cycle_repr.of_int32_exn (Int32.of_int c) in + Stake_storage.snapshot ctxt >>=? fun ctxt -> + (* NB: we need to take several snapshots because + select_distribution_for_cycle deletes the snapshots *) + Delegate_sampler.select_distribution_for_cycle ctxt cycle) + ctxt + Misc.(0 --> preserved) + >>=? fun ctxt -> + let cycle = (Raw_context.current_level ctxt).cycle in + freeze_deposits ~origin ~new_cycle:cycle ~balance_updates:[] ctxt diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.mli new file mode 100644 index 000000000000..1b7f8a87bad6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_cycles.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Per-cycle management of delegates. *) + +(** Trigger the context maintenance at the end of cycle 'n', i.e.: + unfreeze the endorsing rewards, potentially deactivate delegates. + Return the corresponding balances updates and the list of + deactivated delegates. *) +val cycle_end : + Raw_context.t -> + Cycle_repr.t -> + (Raw_context.t + * Receipt_repr.balance_updates + * Signature.Public_key_hash.t list) + tzresult + Lwt.t + +(** [init_first_cycles ctxt ~origin] computes and records the distribution of + the total active stake among active delegates. This concerns the total + active stake involved in the calculation of baking rights for all cycles + in the range [0, preserved_cycles]. It also freezes the deposits for all + the active delegates. *) +val init_first_cycles : + Raw_context.t -> + origin:Receipt_repr.update_origin -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.ml new file mode 100644 index 000000000000..48d3be9240d5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.ml @@ -0,0 +1,214 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let expected_slots_for_given_active_stake ctxt ~total_active_stake ~active_stake + = + let blocks_per_cycle = + Int32.to_int (Constants_storage.blocks_per_cycle ctxt) + in + let consensus_committee_size = + Constants_storage.consensus_committee_size ctxt + in + let number_of_endorsements_per_cycle = + blocks_per_cycle * consensus_committee_size + in + Z.to_int + (Z.div + (Z.mul + (Z.of_int64 (Tez_repr.to_mutez active_stake)) + (Z.of_int number_of_endorsements_per_cycle)) + (Z.of_int64 (Tez_repr.to_mutez total_active_stake))) + +type level_participation = Participated | Didn't_participate + +(* Note that the participation for the last block of a cycle is + recorded in the next cycle. *) +let record_endorsing_participation ctxt ~delegate ~participation + ~endorsing_power = + match participation with + | Participated -> Stake_storage.set_active ctxt delegate + | Didn't_participate -> ( + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Missed_endorsements.find ctxt contract >>=? function + | Some {remaining_slots; missed_levels} -> + let remaining_slots = remaining_slots - endorsing_power in + Storage.Contract.Missed_endorsements.update + ctxt + contract + {remaining_slots; missed_levels = missed_levels + 1} + | None -> ( + let level = Level_storage.current ctxt in + Raw_context.stake_distribution_for_current_cycle ctxt + >>?= fun stake_distribution -> + match + Signature.Public_key_hash.Map.find delegate stake_distribution + with + | None -> + (* This happens when the block is the first one in a + cycle, and therefore the endorsements are for the last + block of the previous cycle, and when the delegate does + not have an active stake at the current cycle; in this + case its participation is simply ignored. *) + assert (Compare.Int32.(level.cycle_position = 0l)) ; + return ctxt + | Some active_stake -> + Stake_storage.get_total_active_stake ctxt level.cycle + >>=? fun total_active_stake -> + let expected_slots = + expected_slots_for_given_active_stake + ctxt + ~total_active_stake + ~active_stake + in + let Ratio_repr.{numerator; denominator} = + Constants_storage.minimal_participation_ratio ctxt + in + let minimal_activity = expected_slots * numerator / denominator in + let maximal_inactivity = expected_slots - minimal_activity in + let remaining_slots = maximal_inactivity - endorsing_power in + Storage.Contract.Missed_endorsements.init + ctxt + contract + {remaining_slots; missed_levels = 1})) + +let record_baking_activity_and_pay_rewards_and_fees ctxt ~payload_producer + ~block_producer ~baking_reward ~reward_bonus = + Stake_storage.set_active ctxt payload_producer >>=? fun ctxt -> + (if not (Signature.Public_key_hash.equal payload_producer block_producer) then + Stake_storage.set_active ctxt block_producer + else return ctxt) + >>=? fun ctxt -> + let pay_payload_producer ctxt delegate = + let contract = Contract_repr.Implicit delegate in + Token.balance ctxt `Block_fees >>=? fun (ctxt, block_fees) -> + Token.transfer_n + ctxt + [(`Block_fees, block_fees); (`Baking_rewards, baking_reward)] + (`Contract contract) + in + let pay_block_producer ctxt delegate bonus = + let contract = Contract_repr.Implicit delegate in + Token.transfer ctxt `Baking_bonuses (`Contract contract) bonus + in + pay_payload_producer ctxt payload_producer + >>=? fun (ctxt, balance_updates_payload_producer) -> + (match reward_bonus with + | Some bonus -> pay_block_producer ctxt block_producer bonus + | None -> return (ctxt, [])) + >>=? fun (ctxt, balance_updates_block_producer) -> + return + (ctxt, balance_updates_payload_producer @ balance_updates_block_producer) + +let check_and_reset_delegate_participation ctxt delegate = + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Missed_endorsements.find ctxt contract >>=? fun missed -> + match missed with + | None -> return (ctxt, true) + | Some missed_endorsements -> + Storage.Contract.Missed_endorsements.remove ctxt contract >>= fun ctxt -> + return (ctxt, Compare.Int.(missed_endorsements.remaining_slots >= 0)) + +type participation_info = { + expected_cycle_activity : int; + minimal_cycle_activity : int; + missed_slots : int; + missed_levels : int; + remaining_allowed_missed_slots : int; + expected_endorsing_rewards : Tez_repr.t; +} + +(* Inefficient, only for RPC *) +let participation_info ctxt delegate = + let level = Level_storage.current ctxt in + Stake_storage.get_selected_distribution ctxt level.cycle + >>=? fun stake_distribution -> + match + List.assoc_opt + ~equal:Signature.Public_key_hash.equal + delegate + stake_distribution + with + | None -> + (* delegate does not have an active stake at the current cycle *) + return + { + expected_cycle_activity = 0; + minimal_cycle_activity = 0; + missed_slots = 0; + missed_levels = 0; + remaining_allowed_missed_slots = 0; + expected_endorsing_rewards = Tez_repr.zero; + } + | Some active_stake -> + Stake_storage.get_total_active_stake ctxt level.cycle + >>=? fun total_active_stake -> + let expected_cycle_activity = + expected_slots_for_given_active_stake + ctxt + ~total_active_stake + ~active_stake + in + let Ratio_repr.{numerator; denominator} = + Constants_storage.minimal_participation_ratio ctxt + in + let endorsing_reward_per_slot = + Constants_storage.endorsing_reward_per_slot ctxt + in + let minimal_cycle_activity = + expected_cycle_activity * numerator / denominator + in + let maximal_cycle_inactivity = + expected_cycle_activity - minimal_cycle_activity + in + let expected_endorsing_rewards = + Tez_repr.mul_exn endorsing_reward_per_slot expected_cycle_activity + in + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Missed_endorsements.find ctxt contract + >>=? fun missed_endorsements -> + let missed_slots, missed_levels, remaining_allowed_missed_slots = + match missed_endorsements with + | None -> (0, 0, maximal_cycle_inactivity) + | Some {remaining_slots; missed_levels} -> + ( maximal_cycle_inactivity - remaining_slots, + missed_levels, + Compare.Int.max 0 remaining_slots ) + in + let expected_endorsing_rewards = + match missed_endorsements with + | Some r when Compare.Int.(r.remaining_slots < 0) -> Tez_repr.zero + | _ -> expected_endorsing_rewards + in + return + { + expected_cycle_activity; + minimal_cycle_activity; + missed_slots; + missed_levels; + remaining_allowed_missed_slots; + expected_endorsing_rewards; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.mli new file mode 100644 index 000000000000..e3950661ddc1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_missed_endorsements_storage.mli @@ -0,0 +1,99 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This modules deals with delegates' participation in consensus. + + This module is responsible for maintaining the + {!Storage.Contract.Missed_endorsements} table. *) + +val expected_slots_for_given_active_stake : + Raw_context.t -> + total_active_stake:Tez_repr.t -> + active_stake:Tez_repr.t -> + int + +type level_participation = Participated | Didn't_participate + +(** Record the participation of a delegate as a validator. *) +val record_endorsing_participation : + Raw_context.t -> + delegate:Signature.Public_key_hash.t -> + participation:level_participation -> + endorsing_power:int -> + Raw_context.t tzresult Lwt.t + +(** Sets the payload and block producer as active. Pays the baking + reward and the fees to the payload producer and the reward bonus to + the payload producer (if the reward_bonus is not None).*) +val record_baking_activity_and_pay_rewards_and_fees : + Raw_context.t -> + payload_producer:Signature.Public_key_hash.t -> + block_producer:Signature.Public_key_hash.t -> + baking_reward:Tez_repr.t -> + reward_bonus:Tez_repr.t option -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** Check that a delegate participated enough in the last cycle + (returns [true] if it did), and then reset the participation for + preparing the next cycle. *) +val check_and_reset_delegate_participation : + Raw_context.t -> + Signature.Public_key_hash.t -> + (Raw_context.t * bool) tzresult Lwt.t + +(** Participation information. We denote by: + - "static" information that does not change during the cycle + - "dynamic" information that may change during the cycle *) +type participation_info = { + expected_cycle_activity : int; + (** The total expected slots to be endorsed in the cycle. (static) *) + minimal_cycle_activity : int; + (** The minimal endorsing slots in the cycle to get endorsing + rewards. (static) *) + missed_slots : int; + (** The number of missed endorsing slots in the cycle. (dynamic) *) + missed_levels : int; + (** The number of missed endorsing levels in the cycle. (dynamic) *) + remaining_allowed_missed_slots : int; + (** Remaining amount of endorsing slots that can be missed in the + cycle before forfeiting the rewards. (dynamic) *) + expected_endorsing_rewards : Tez_repr.t; + (** Endorsing rewards that will be distributed at the end of the + cycle if activity at that point will be greater than the minimal + required. If the activity is already known to be below the + required minimum, then the rewards are zero. (dynamic) *) +} + +(** Only use this function for RPC: this is expensive. + + [delegate_participation_info] and [!val:check_delegate] forms the + implementation of RPC call "/context/delegates/<pkh>/participation". + *) +val participation_info : + Raw_context.t -> + Signature.Public_key_hash.t -> + participation_info tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.ml new file mode 100644 index 000000000000..0040d65f71e7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.ml @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Delegate_sampler_state = struct + module Cache_client = struct + type cached_value = Delegate_consensus_key.pk Sampler.t + + let namespace = Cache_repr.create_namespace "sampler_state" + + let cache_index = 2 + + let value_of_identifier ctxt identifier = + let cycle = Cycle_repr.of_string_exn identifier in + Storage.Delegate_sampler_state.get ctxt cycle + end + + module Cache = (val Cache_repr.register_exn (module Cache_client)) + + let identifier_of_cycle cycle = Format.asprintf "%a" Cycle_repr.pp cycle + + let init ctxt cycle sampler_state = + let id = identifier_of_cycle cycle in + Storage.Delegate_sampler_state.init ctxt cycle sampler_state + >>=? fun ctxt -> + let size = 1 (* that's symbolic: 1 cycle = 1 entry *) in + Cache.update ctxt id (Some (sampler_state, size)) >>?= fun ctxt -> + return ctxt + + let get ctxt cycle = + let id = identifier_of_cycle cycle in + Cache.find ctxt id >>=? function + | None -> Storage.Delegate_sampler_state.get ctxt cycle + | Some v -> return v + + let remove_existing ctxt cycle = + let id = identifier_of_cycle cycle in + Cache.update ctxt id None >>?= fun ctxt -> + Storage.Delegate_sampler_state.remove_existing ctxt cycle +end + +module Random = struct + (* [init_random_state] initialize a random sequence drawing state + that's unique for a given (seed, level, index) triple. Elements + from this sequence are drawn using [take_int64], updating the + state for the next draw. The initial state is the Blake2b hash of + the three randomness sources, and an offset set to zero + (indicating that zero bits of randomness have been + consumed). When drawing random elements, bits are extracted from + the state until exhaustion (256 bits), at which point the state + is rehashed and the offset reset to 0. *) + + let init_random_state seed level index = + ( Raw_hashes.blake2b + (Data_encoding.Binary.to_bytes_exn + Data_encoding.(tup3 Seed_repr.seed_encoding int32 int32) + (seed, level.Level_repr.cycle_position, Int32.of_int index)), + 0 ) + + let take_int64 bound state = + let drop_if_over = + (* This function draws random values in [0-(bound-1)] by drawing + in [0-(2^63-1)] (64-bit) and computing the value modulo + [bound]. For the application of [mod bound] to preserve + uniformity, the input space must be of the form + [0-(n*bound-1)]. We enforce this by rejecting 64-bit samples + above this limit (in which case, we draw a new 64-sample from + the sequence and try again). *) + Int64.sub Int64.max_int (Int64.rem Int64.max_int bound) + in + let rec loop (bytes, n) = + let consumed_bytes = 8 in + let state_size = Bytes.length bytes in + if Compare.Int.(n > state_size - consumed_bytes) then + loop (Raw_hashes.blake2b bytes, 0) + else + let r = TzEndian.get_int64 bytes n in + (* The absolute value of min_int is min_int. Also, every + positive integer is represented twice (positive and negative), + but zero is only represented once. We fix both problems at + once. *) + let r = if Compare.Int64.(r = Int64.min_int) then 0L else Int64.abs r in + if Compare.Int64.(r >= drop_if_over) then + loop (bytes, n + consumed_bytes) + else + let v = Int64.rem r bound in + (v, (bytes, n + consumed_bytes)) + in + loop state + + (** [sampler_for_cycle ctxt cycle] reads the sampler for [cycle] from + [ctxt] if it has been previously inited. Otherwise it initializes + the sampler and caches it in [ctxt] with + [Raw_context.set_sampler_for_cycle]. *) + let sampler_for_cycle ctxt cycle = + let read ctxt = + Seed_storage.for_cycle ctxt cycle >>=? fun seed -> + Delegate_sampler_state.get ctxt cycle >>=? fun state -> + return (seed, state) + in + Raw_context.sampler_for_cycle ~read ctxt cycle + + let owner c (level : Level_repr.t) offset = + let cycle = level.Level_repr.cycle in + sampler_for_cycle c cycle >>=? fun (c, seed, state) -> + let sample ~int_bound ~mass_bound = + let state = init_random_state seed level offset in + let i, state = take_int64 (Int64.of_int int_bound) state in + let elt, _ = take_int64 mass_bound state in + (Int64.to_int i, elt) + in + let pk = Sampler.sample state sample in + return (c, pk) +end + +let slot_owner c level slot = Random.owner c level (Slot_repr.to_int slot) + +let baking_rights_owner c (level : Level_repr.t) ~round = + Round_repr.to_int round >>?= fun round -> + let consensus_committee_size = Constants_storage.consensus_committee_size c in + Slot_repr.of_int (round mod consensus_committee_size) >>?= fun slot -> + slot_owner c level slot >>=? fun (ctxt, pk) -> return (ctxt, slot, pk) + +let get_stakes_for_selected_index ctxt index = + Stake_storage.fold_snapshot + ctxt + ~index + ~f:(fun (delegate, staking_balance) (acc, total_stake) -> + let delegate_contract = Contract_repr.Implicit delegate in + let open Tez_repr in + let open Lwt_result_syntax in + let* frozen_deposits_limit = + Delegate_storage.frozen_deposits_limit ctxt delegate + in + let* balance_and_frozen_bonds = + Contract_storage.get_balance_and_frozen_bonds ctxt delegate_contract + in + let* frozen_deposits = + Frozen_deposits_storage.get ctxt delegate_contract + in + let*? total_balance = + balance_and_frozen_bonds +? frozen_deposits.current_amount + in + let* stake_for_cycle = + let frozen_deposits_percentage = + Int64.of_int @@ Constants_storage.frozen_deposits_percentage ctxt + in + let max_mutez = of_mutez_exn Int64.max_int in + let frozen_deposits_limit = + match frozen_deposits_limit with Some fdp -> fdp | None -> max_mutez + in + let aux = min total_balance frozen_deposits_limit in + let*? overflow_bound = max_mutez /? 100L in + if aux <= overflow_bound then + let*? aux = aux *? 100L in + let*? v = aux /? frozen_deposits_percentage in + return (min v staking_balance) + else + let*? sbal = staking_balance /? 100L in + let*? a = aux /? frozen_deposits_percentage in + if sbal <= a then return staking_balance + else + let*? r = max_mutez /? frozen_deposits_percentage in + return r + in + let*? total_stake = Tez_repr.(total_stake +? stake_for_cycle) in + return ((delegate, stake_for_cycle) :: acc, total_stake)) + ~init:([], Tez_repr.zero) + +let compute_snapshot_index_for_seed ~max_snapshot_index seed = + let rd = Seed_repr.initialize_new seed [Bytes.of_string "stake_snapshot"] in + let seq = Seed_repr.sequence rd 0l in + Seed_repr.take_int32 seq (Int32.of_int max_snapshot_index) + |> fst |> Int32.to_int |> return + +let compute_snapshot_index ctxt cycle ~max_snapshot_index = + Seed_storage.for_cycle ctxt cycle >>=? fun seed -> + compute_snapshot_index_for_seed ~max_snapshot_index seed + +let select_distribution_for_cycle ctxt cycle = + Stake_storage.max_snapshot_index ctxt >>=? fun max_snapshot_index -> + Seed_storage.raw_for_cycle ctxt cycle >>=? fun seed -> + compute_snapshot_index_for_seed ~max_snapshot_index seed + >>=? fun selected_index -> + get_stakes_for_selected_index ctxt selected_index + >>=? fun (stakes, total_stake) -> + Stake_storage.set_selected_distribution_for_cycle + ctxt + cycle + stakes + total_stake + >>=? fun ctxt -> + List.fold_left_es + (fun acc (pkh, stake) -> + Delegate_consensus_key.active_pubkey_for_cycle ctxt pkh cycle + >|=? fun pk -> (pk, Tez_repr.to_mutez stake) :: acc) + [] + stakes + >>=? fun stakes_pk -> + let state = Sampler.create stakes_pk in + Delegate_sampler_state.init ctxt cycle state >>=? fun ctxt -> + (* pre-allocate the sampler *) + Lwt.return (Raw_context.init_sampler_for_cycle ctxt cycle seed state) + +let select_new_distribution_at_cycle_end ctxt ~new_cycle = + let preserved = Constants_storage.preserved_cycles ctxt in + let for_cycle = Cycle_repr.add new_cycle preserved in + select_distribution_for_cycle ctxt for_cycle + +let clear_outdated_sampling_data ctxt ~new_cycle = + let max_slashing_period = Constants_storage.max_slashing_period ctxt in + match Cycle_repr.sub new_cycle max_slashing_period with + | None -> return ctxt + | Some outdated_cycle -> + Delegate_sampler_state.remove_existing ctxt outdated_cycle + >>=? fun ctxt -> Seed_storage.remove_for_cycle ctxt outdated_cycle diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.mli new file mode 100644 index 000000000000..b398a9ca9464 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_sampler.mli @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module draws random values for a cycle based on the {!Seed_repr.seed} + associated that cycle. These random values are: + - delegates associated with slots + - snapshot indexes. + The selection of delegates is done by {i sampling} from a particular + distribution of the stake among the active delegates. + + This module is responsible for maintaining the table + {!Storage.Delegate_sampler_state}. *) + +(** Participation slots potentially associated to accounts. The + accounts that didn't place a deposit will be excluded from this + list. This function should only be used to compute the deposits to + freeze or initialize the protocol while stitching. RPCs can use this + function to predict an approximation of long term future slot + allocations. It shouldn't be used in the baker. *) +val slot_owner : + Raw_context.t -> + Level_repr.t -> + Slot_repr.t -> + (Raw_context.t * Delegate_consensus_key.pk) tzresult Lwt.t + +val baking_rights_owner : + Raw_context.t -> + Level_repr.t -> + round:Round_repr.round -> + (Raw_context.t * Slot_repr.t * Delegate_consensus_key.pk) tzresult Lwt.t + +(** [compute_snapshot_index ctxt cycle max_snapshot_index] Returns the index of + the selected snapshot for the [cycle] passed as argument, and for the max + index of snapshots taken so far, [max_snapshot_index] (see + [Stake_storage.max_snapshot_index]. *) +val compute_snapshot_index : + Raw_context.t -> Cycle_repr.t -> max_snapshot_index:int -> int tzresult Lwt.t + +val select_new_distribution_at_cycle_end : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t tzresult Lwt.t + +val clear_outdated_sampling_data : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t tzresult Lwt.t + +val select_distribution_for_cycle : + Raw_context.t -> Cycle_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_services.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_services.ml new file mode 100644 index 000000000000..db989a7a0ba5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_services.ml @@ -0,0 +1,549 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += Balance_rpc_non_delegate of public_key_hash + +type error += (* `Temporary *) Not_registered of Signature.Public_key_hash.t + +let () = + register_error_kind + `Temporary + ~id:"delegate.not_registered" + ~title:"Not a registered delegate" + ~description: + "The provided public key hash is not the address of a registered \ + delegate." + ~pp:(fun ppf pkh -> + Format.fprintf + ppf + "The provided public key hash (%a) is not the address of a registered \ + delegate. If you own this account and want to register it as a \ + delegate, use a delegation operation to delegate the account to \ + itself." + Signature.Public_key_hash.pp + pkh) + Data_encoding.(obj1 (req "pkh" Signature.Public_key_hash.encoding)) + (function Not_registered pkh -> Some pkh | _ -> None) + (fun pkh -> Not_registered pkh) + +let () = + register_error_kind + `Temporary + ~id:"delegate_service.balance_rpc_on_non_delegate" + ~title:"Balance request for an unregistered delegate" + ~description:"The account whose balance was requested is not a delegate." + ~pp:(fun ppf pkh -> + Format.fprintf + ppf + "The implicit account (%a) whose balance was requested is not a \ + registered delegate. To get the balance of this account you can use \ + the ../context/contracts/%a/balance RPC." + Signature.Public_key_hash.pp + pkh + Signature.Public_key_hash.pp + pkh) + Data_encoding.(obj1 (req "pkh" Signature.Public_key_hash.encoding)) + (function Balance_rpc_non_delegate pkh -> Some pkh | _ -> None) + (fun pkh -> Balance_rpc_non_delegate pkh) + +type info = { + full_balance : Tez.t; + current_frozen_deposits : Tez.t; + frozen_deposits : Tez.t; + staking_balance : Tez.t; + frozen_deposits_limit : Tez.t option; + delegated_contracts : Contract.t list; + delegated_balance : Tez.t; + deactivated : bool; + grace_period : Cycle.t; + voting_info : Vote.delegate_info; + active_consensus_key : Signature.Public_key_hash.t; + pending_consensus_keys : (Cycle.t * Signature.Public_key_hash.t) list; +} + +let info_encoding = + let open Data_encoding in + conv + (fun { + full_balance; + current_frozen_deposits; + frozen_deposits; + staking_balance; + frozen_deposits_limit; + delegated_contracts; + delegated_balance; + deactivated; + grace_period; + voting_info; + active_consensus_key; + pending_consensus_keys; + } -> + ( ( full_balance, + current_frozen_deposits, + frozen_deposits, + staking_balance, + frozen_deposits_limit, + delegated_contracts, + delegated_balance, + deactivated, + grace_period ), + (voting_info, (active_consensus_key, pending_consensus_keys)) )) + (fun ( ( full_balance, + current_frozen_deposits, + frozen_deposits, + staking_balance, + frozen_deposits_limit, + delegated_contracts, + delegated_balance, + deactivated, + grace_period ), + (voting_info, (active_consensus_key, pending_consensus_keys)) ) -> + { + full_balance; + current_frozen_deposits; + frozen_deposits; + staking_balance; + frozen_deposits_limit; + delegated_contracts; + delegated_balance; + deactivated; + grace_period; + voting_info; + active_consensus_key; + pending_consensus_keys; + }) + (merge_objs + (obj9 + (req "full_balance" Tez.encoding) + (req "current_frozen_deposits" Tez.encoding) + (req "frozen_deposits" Tez.encoding) + (req "staking_balance" Tez.encoding) + (opt "frozen_deposits_limit" Tez.encoding) + (req "delegated_contracts" (list Contract.encoding)) + (req "delegated_balance" Tez.encoding) + (req "deactivated" bool) + (req "grace_period" Cycle.encoding)) + (merge_objs + Vote.delegate_info_encoding + (obj2 + (req "active_consensus_key" Signature.Public_key_hash.encoding) + (dft + "pending_consensus_keys" + (list + (obj2 + (req "cycle" Cycle.encoding) + (req "pkh" Signature.Public_key_hash.encoding))) + [])))) + +let participation_info_encoding = + let open Data_encoding in + conv + (fun { + Delegate.expected_cycle_activity; + minimal_cycle_activity; + missed_slots; + missed_levels; + remaining_allowed_missed_slots; + expected_endorsing_rewards; + } -> + ( expected_cycle_activity, + minimal_cycle_activity, + missed_slots, + missed_levels, + remaining_allowed_missed_slots, + expected_endorsing_rewards )) + (fun ( expected_cycle_activity, + minimal_cycle_activity, + missed_slots, + missed_levels, + remaining_allowed_missed_slots, + expected_endorsing_rewards ) -> + { + expected_cycle_activity; + minimal_cycle_activity; + missed_slots; + missed_levels; + remaining_allowed_missed_slots; + expected_endorsing_rewards; + }) + (obj6 + (req "expected_cycle_activity" int31) + (req "minimal_cycle_activity" int31) + (req "missed_slots" int31) + (req "missed_levels" int31) + (req "remaining_allowed_missed_slots" int31) + (req "expected_endorsing_rewards" Tez.encoding)) + +module S = struct + let raw_path = RPC_path.(open_root / "context" / "delegates") + + open Data_encoding + + type list_query = { + active : bool; + inactive : bool; + with_minimal_stake : bool; + without_minimal_stake : bool; + } + + let list_query : list_query RPC_query.t = + let open RPC_query in + query (fun active inactive with_minimal_stake without_minimal_stake -> + {active; inactive; with_minimal_stake; without_minimal_stake}) + |+ flag "active" (fun t -> t.active) + |+ flag "inactive" (fun t -> t.inactive) + |+ flag "with_minimal_stake" (fun t -> t.with_minimal_stake) + |+ flag "without_minimal_stake" (fun t -> t.without_minimal_stake) + |> seal + + let list_delegate = + RPC_service.get_service + ~description: + "Lists all registered delegates by default. The arguments `active`, \ + `inactive`, `with_minimal_stake`, and `without_minimal_stake` allow \ + to enumerate only the delegates that are active, inactive, have at \ + least a minimal stake to participate in consensus and in governance, \ + or do not have such a minimal stake, respectively. Note, setting \ + these arguments to false has no effect." + ~query:list_query + ~output:(list Signature.Public_key_hash.encoding) + raw_path + + let path = RPC_path.(raw_path /: Signature.Public_key_hash.rpc_arg) + + let info = + RPC_service.get_service + ~description:"Everything about a delegate." + ~query:RPC_query.empty + ~output:info_encoding + path + + let full_balance = + RPC_service.get_service + ~description: + "Returns the full balance (in mutez) of a given delegate, including \ + the frozen deposits and the frozen bonds. It does not include its \ + delegated balance." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "full_balance") + + let current_frozen_deposits = + RPC_service.get_service + ~description: + "Returns the current amount of the frozen deposits (in mutez)." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "current_frozen_deposits") + + let frozen_deposits = + RPC_service.get_service + ~description: + "Returns the initial amount (that is, at the beginning of a cycle) of \ + the frozen deposits (in mutez). This amount is the same as the \ + current amount of the frozen deposits, unless the delegate has been \ + punished." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "frozen_deposits") + + let staking_balance = + RPC_service.get_service + ~description: + "Returns the total amount of tokens (in mutez) delegated to a given \ + delegate. This includes the balances of all the contracts that \ + delegate to it, but also the balance of the delegate itself, its \ + frozen deposits, and its frozen bonds." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "staking_balance") + + let frozen_deposits_limit = + RPC_service.get_service + ~description: + "Returns the frozen deposits limit for the given delegate or none if \ + no limit is set." + ~query:RPC_query.empty + ~output:(Data_encoding.option Tez.encoding) + RPC_path.(path / "frozen_deposits_limit") + + let delegated_contracts = + RPC_service.get_service + ~description: + "Returns the list of contracts that delegate to a given delegate." + ~query:RPC_query.empty + ~output:(list Contract.encoding) + RPC_path.(path / "delegated_contracts") + + let delegated_balance = + RPC_service.get_service + ~description: + "Returns the sum (in mutez) of all balances of all the contracts that \ + delegate to a given delegate. This excludes the delegate's own \ + balance, its frozen deposits and its frozen bonds." + ~query:RPC_query.empty + ~output:Tez.encoding + RPC_path.(path / "delegated_balance") + + let deactivated = + RPC_service.get_service + ~description: + "Tells whether the delegate is currently tagged as deactivated or not." + ~query:RPC_query.empty + ~output:bool + RPC_path.(path / "deactivated") + + let grace_period = + RPC_service.get_service + ~description: + "Returns the cycle by the end of which the delegate might be \ + deactivated if she fails to execute any delegate action. A \ + deactivated delegate might be reactivated (without loosing any stake) \ + by simply re-registering as a delegate. For deactivated delegates, \ + this value contains the cycle at which they were deactivated." + ~query:RPC_query.empty + ~output:Cycle.encoding + RPC_path.(path / "grace_period") + + let voting_power = + RPC_service.get_service + ~description:"The voting power in the vote listings for a given delegate." + ~query:RPC_query.empty + ~output:Data_encoding.int64 + RPC_path.(path / "voting_power") + + let voting_info = + RPC_service.get_service + ~description: + "Returns the delegate info (e.g. voting power) found in the listings \ + of the current voting period." + ~query:RPC_query.empty + ~output:Vote.delegate_info_encoding + RPC_path.(path / "voting_info") + + let consensus_key = + RPC_service.get_service + ~description: + "The active consensus key for a given delegate and the pending \ + consensus keys." + ~query:RPC_query.empty + ~output: + Data_encoding.( + obj2 + (req "active" Signature.Public_key_hash.encoding) + (dft + "pendings" + (list + (obj2 + (req "cycle" Cycle.encoding) + (req "pkh" Signature.Public_key_hash.encoding))) + [])) + RPC_path.(path / "consensus_key") + + let participation = + RPC_service.get_service + ~description: + "Returns cycle and level participation information. In particular this \ + indicates, in the field 'expected_cycle_activity', the number of \ + slots the delegate is expected to have in the cycle based on its \ + active stake. The field 'minimal_cycle_activity' indicates the \ + minimal endorsing slots in the cycle required to get endorsing \ + rewards. It is computed based on 'expected_cycle_activity. The fields \ + 'missed_slots' and 'missed_levels' indicate the number of missed \ + endorsing slots and missed levels (for endorsing) in the cycle so \ + far. 'missed_slots' indicates the number of missed endorsing slots in \ + the cycle so far. The field 'remaining_allowed_missed_slots' \ + indicates the remaining amount of endorsing slots that can be missed \ + in the cycle before forfeiting the rewards. Finally, \ + 'expected_endorsing_rewards' indicates the endorsing rewards that \ + will be distributed at the end of the cycle if activity at that point \ + will be greater than the minimal required; if the activity is already \ + known to be below the required minimum, then the rewards are zero." + ~query:RPC_query.empty + ~output:participation_info_encoding + RPC_path.(path / "participation") +end + +let check_delegate_registered ctxt pkh = + Delegate.registered ctxt pkh >>= function + | true -> return_unit + | false -> tzfail (Not_registered pkh) + +let register () = + let open Services_registration in + register0 ~chunked:true S.list_delegate (fun ctxt q () -> + Delegate.list ctxt >>= fun delegates -> + (match q with + | {active = true; inactive = false; _} -> + List.filter_es + (fun pkh -> Delegate.deactivated ctxt pkh >|=? not) + delegates + | {active = false; inactive = true; _} -> + List.filter_es (fun pkh -> Delegate.deactivated ctxt pkh) delegates + | {active = false; inactive = false; _} + (* This case is counter-intuitive, but it represents the default behavior, when no arguments are given *) + | {active = true; inactive = true; _} -> + return delegates) + >>=? fun delegates -> + let minimal_stake = Constants.minimal_stake ctxt in + match q with + | {with_minimal_stake = true; without_minimal_stake = false; _} -> + List.filter_es + (fun pkh -> + Delegate.staking_balance ctxt pkh >|=? fun staking_balance -> + Tez.(staking_balance >= minimal_stake)) + delegates + | {with_minimal_stake = false; without_minimal_stake = true; _} -> + List.filter_es + (fun pkh -> + Delegate.staking_balance ctxt pkh >|=? fun staking_balance -> + Tez.(staking_balance < minimal_stake)) + delegates + | {with_minimal_stake = true; without_minimal_stake = true; _} + | {with_minimal_stake = false; without_minimal_stake = false; _} -> + return delegates) ; + register1 ~chunked:false S.info (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.full_balance ctxt pkh >>=? fun full_balance -> + Delegate.frozen_deposits ctxt pkh >>=? fun frozen_deposits -> + Delegate.staking_balance ctxt pkh >>=? fun staking_balance -> + Delegate.frozen_deposits_limit ctxt pkh >>=? fun frozen_deposits_limit -> + Delegate.delegated_contracts ctxt pkh >>= fun delegated_contracts -> + Delegate.delegated_balance ctxt pkh >>=? fun delegated_balance -> + Delegate.deactivated ctxt pkh >>=? fun deactivated -> + Delegate.last_cycle_before_deactivation ctxt pkh >>=? fun grace_period -> + Vote.get_delegate_info ctxt pkh >>=? fun voting_info -> + Delegate.Consensus_key.active_pubkey ctxt pkh >>=? fun consensus_key -> + Delegate.Consensus_key.pending_updates ctxt pkh >|=? fun pendings -> + { + full_balance; + current_frozen_deposits = frozen_deposits.current_amount; + frozen_deposits = frozen_deposits.initial_amount; + staking_balance; + frozen_deposits_limit; + delegated_contracts; + delegated_balance; + deactivated; + grace_period; + voting_info; + active_consensus_key = consensus_key.consensus_pkh; + pending_consensus_keys = pendings; + }) ; + register1 ~chunked:false S.full_balance (fun ctxt pkh () () -> + trace (Balance_rpc_non_delegate pkh) (check_delegate_registered ctxt pkh) + >>=? fun () -> Delegate.full_balance ctxt pkh) ; + register1 ~chunked:false S.current_frozen_deposits (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.frozen_deposits ctxt pkh >>=? fun deposits -> + return deposits.current_amount) ; + register1 ~chunked:false S.frozen_deposits (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.frozen_deposits ctxt pkh >>=? fun deposits -> + return deposits.initial_amount) ; + register1 ~chunked:false S.staking_balance (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.staking_balance ctxt pkh) ; + register1 ~chunked:false S.frozen_deposits_limit (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.frozen_deposits_limit ctxt pkh) ; + register1 ~chunked:true S.delegated_contracts (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.delegated_contracts ctxt pkh >|= ok) ; + register1 ~chunked:false S.delegated_balance (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.delegated_balance ctxt pkh) ; + register1 ~chunked:false S.deactivated (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.deactivated ctxt pkh) ; + register1 ~chunked:false S.grace_period (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.last_cycle_before_deactivation ctxt pkh) ; + register1 ~chunked:false S.voting_power (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Vote.get_voting_power_free ctxt pkh) ; + register1 ~chunked:false S.voting_info (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Vote.get_delegate_info ctxt pkh) ; + register1 ~chunked:false S.consensus_key (fun ctxt pkh () () -> + Delegate.Consensus_key.active_pubkey ctxt pkh >>=? fun pk -> + Delegate.Consensus_key.pending_updates ctxt pkh >>=? fun pendings -> + return (pk.consensus_pkh, pendings)) ; + register1 ~chunked:false S.participation (fun ctxt pkh () () -> + check_delegate_registered ctxt pkh >>=? fun () -> + Delegate.participation_info ctxt pkh) + +let list ctxt block ?(active = true) ?(inactive = false) + ?(with_minimal_stake = true) ?(without_minimal_stake = false) () = + RPC_context.make_call0 + S.list_delegate + ctxt + block + {active; inactive; with_minimal_stake; without_minimal_stake} + () + +let info ctxt block pkh = RPC_context.make_call1 S.info ctxt block pkh () () + +let full_balance ctxt block pkh = + RPC_context.make_call1 S.full_balance ctxt block pkh () () + +let current_frozen_deposits ctxt block pkh = + RPC_context.make_call1 S.current_frozen_deposits ctxt block pkh () () + +let frozen_deposits ctxt block pkh = + RPC_context.make_call1 S.frozen_deposits ctxt block pkh () () + +let staking_balance ctxt block pkh = + RPC_context.make_call1 S.staking_balance ctxt block pkh () () + +let frozen_deposits_limit ctxt block pkh = + RPC_context.make_call1 S.frozen_deposits_limit ctxt block pkh () () + +let delegated_contracts ctxt block pkh = + RPC_context.make_call1 S.delegated_contracts ctxt block pkh () () + +let delegated_balance ctxt block pkh = + RPC_context.make_call1 S.delegated_balance ctxt block pkh () () + +let deactivated ctxt block pkh = + RPC_context.make_call1 S.deactivated ctxt block pkh () () + +let grace_period ctxt block pkh = + RPC_context.make_call1 S.grace_period ctxt block pkh () () + +let voting_power ctxt block pkh = + RPC_context.make_call1 S.voting_power ctxt block pkh () () + +let voting_info ctxt block pkh = + RPC_context.make_call1 S.voting_info ctxt block pkh () () + +let consensus_key ctxt block pkh = + RPC_context.make_call1 S.consensus_key ctxt block pkh () () + +let participation ctxt block pkh = + RPC_context.make_call1 S.participation ctxt block pkh () () diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_services.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_services.mli new file mode 100644 index 000000000000..d1d235e47f57 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_services.mli @@ -0,0 +1,146 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines RPC services to access the information associated to + delegates (who they are, their delegators, their different kinds of balances, their activity, etc.). +*) + +open Alpha_context + +type error += (* `Temporary *) Not_registered of Signature.Public_key_hash.t + +val list : + 'a #RPC_context.simple -> + 'a -> + ?active:bool -> + ?inactive:bool -> + ?with_minimal_stake:bool -> + ?without_minimal_stake:bool -> + unit -> + Signature.Public_key_hash.t list shell_tzresult Lwt.t + +type info = { + full_balance : Tez.t; (** Balance + Frozen balance *) + current_frozen_deposits : Tez.t; + frozen_deposits : Tez.t; + staking_balance : Tez.t; + frozen_deposits_limit : Tez.t option; + delegated_contracts : Contract.t list; + delegated_balance : Tez.t; + deactivated : bool; + grace_period : Cycle.t; + voting_info : Vote.delegate_info; + active_consensus_key : Signature.Public_key_hash.t; + pending_consensus_keys : (Cycle.t * Signature.Public_key_hash.t) list; +} + +val info_encoding : info Data_encoding.t + +val info : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + info shell_tzresult Lwt.t + +val full_balance : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t shell_tzresult Lwt.t + +val current_frozen_deposits : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t shell_tzresult Lwt.t + +val frozen_deposits : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t shell_tzresult Lwt.t + +val staking_balance : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t shell_tzresult Lwt.t + +val frozen_deposits_limit : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t option shell_tzresult Lwt.t + +val delegated_contracts : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Contract.t list shell_tzresult Lwt.t + +val delegated_balance : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Tez.t shell_tzresult Lwt.t + +val deactivated : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + bool shell_tzresult Lwt.t + +val grace_period : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + Cycle.t shell_tzresult Lwt.t + +val voting_power : + 'a #RPC_context.simple -> 'a -> public_key_hash -> int64 shell_tzresult Lwt.t + +val voting_info : + 'a #RPC_context.simple -> + 'a -> + public_key_hash -> + Vote.delegate_info shell_tzresult Lwt.t + +val consensus_key : + 'a #RPC_context.simple -> + 'a -> + Signature.Public_key_hash.t -> + (Signature.Public_key_hash.t * (Cycle.t * Signature.Public_key_hash.t) list) + shell_tzresult + Lwt.t + +val participation : + 'a #RPC_context.simple -> + 'a -> + public_key_hash -> + Delegate.participation_info shell_tzresult Lwt.t + +val register : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.ml new file mode 100644 index 000000000000..7479491e0ccf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.ml @@ -0,0 +1,123 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let already_slashed_for_double_endorsing ctxt delegate (level : Level_repr.t) = + Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) + >>=? function + | None -> return_false + | Some slashed -> return slashed.for_double_endorsing + +let already_slashed_for_double_baking ctxt delegate (level : Level_repr.t) = + Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) + >>=? function + | None -> return_false + | Some slashed -> return slashed.for_double_baking + +let punish_double_endorsing ctxt delegate (level : Level_repr.t) = + let open Lwt_result_syntax in + let* slashed = + Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) + in + let updated_slashed = + match slashed with + | None -> {Storage.for_double_endorsing = true; for_double_baking = false} + | Some slashed -> + assert (Compare.Bool.(slashed.for_double_endorsing = false)) ; + {slashed with for_double_endorsing = true} + in + let delegate_contract = Contract_repr.Implicit delegate in + let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in + let slashing_ratio : Ratio_repr.t = + Constants_storage.ratio_of_frozen_deposits_slashed_per_double_endorsement + ctxt + in + let punish_value = + Tez_repr.( + div_exn + (mul_exn frozen_deposits.initial_amount slashing_ratio.numerator) + slashing_ratio.denominator) + in + let amount_to_burn = + Tez_repr.(min frozen_deposits.current_amount punish_value) + in + let* ctxt, balance_updates = + Token.transfer + ctxt + (`Frozen_deposits delegate) + `Double_signing_punishments + amount_to_burn + in + let* ctxt = Stake_storage.remove_stake ctxt delegate amount_to_burn in + let*! ctxt = + Storage.Slashed_deposits.add + (ctxt, level.cycle) + (level.level, delegate) + updated_slashed + in + return (ctxt, amount_to_burn, balance_updates) + +let punish_double_baking ctxt delegate (level : Level_repr.t) = + let open Lwt_result_syntax in + let* slashed = + Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) + in + let updated_slashed = + match slashed with + | None -> {Storage.for_double_baking = true; for_double_endorsing = false} + | Some slashed -> + assert (Compare.Bool.(slashed.for_double_baking = false)) ; + {slashed with for_double_baking = true} + in + let delegate_contract = Contract_repr.Implicit delegate in + let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in + let slashing_for_one_block = + Constants_storage.double_baking_punishment ctxt + in + let amount_to_burn = + Tez_repr.(min frozen_deposits.current_amount slashing_for_one_block) + in + let* ctxt, balance_updates = + Token.transfer + ctxt + (`Frozen_deposits delegate) + `Double_signing_punishments + amount_to_burn + in + let* ctxt = Stake_storage.remove_stake ctxt delegate amount_to_burn in + let*! ctxt = + Storage.Slashed_deposits.add + (ctxt, level.cycle) + (level.level, delegate) + updated_slashed + in + return (ctxt, amount_to_burn, balance_updates) + +let clear_outdated_slashed_deposits ctxt ~new_cycle = + let max_slashable_period = Constants_storage.max_slashing_period ctxt in + match Cycle_repr.(sub new_cycle max_slashable_period) with + | None -> Lwt.return ctxt + | Some outdated_cycle -> Storage.Slashed_deposits.clear (ctxt, outdated_cycle) diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.mli new file mode 100644 index 000000000000..9dfb7c314b92 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_slashed_deposits_storage.mli @@ -0,0 +1,77 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module maintains the storage related to slashing of delegates for + double signing. In particular, it is responsible for maintaining the + {!Storage.Slashed_deposits} table. *) + +(** Returns true if the given delegate has already been slashed + for double baking for the given level. *) +val already_slashed_for_double_baking : + Raw_context.t -> + Signature.Public_key_hash.t -> + Level_repr.t -> + bool tzresult Lwt.t + +(** Returns true if the given delegate has already been slashed + for double preendorsing or double endorsing for the given level. *) +val already_slashed_for_double_endorsing : + Raw_context.t -> + Signature.Public_key_hash.t -> + Level_repr.t -> + bool tzresult Lwt.t + +(** Burn some frozen deposit for a delegate at a given level and + record in the context that the given delegate has now been slashed + for double endorsing for the given level. + + Returns the burned amount. + + Fails with [Unrequired_denunciation] if the given delegate has + already been slashed for double endorsing for the given level. *) +val punish_double_endorsing : + Raw_context.t -> + Signature.Public_key_hash.t -> + Level_repr.t -> + (Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** Burn some frozen deposit for a delegate at a given level and + record in the context that the given delegate has now been slashed + for double baking for the given level. + + Returns the burned amount. + + Fails with [Unrequired_denunciation] if the given delegate has + already been slashed for double baking for the given level. *) +val punish_double_baking : + Raw_context.t -> + Signature.Public_key_hash.t -> + Level_repr.t -> + (Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates) tzresult Lwt.t + +val clear_outdated_slashed_deposits : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_storage.ml b/src/proto_016_PtMumbai/lib_protocol/delegate_storage.ml new file mode 100644 index 000000000000..9e7f049b724e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_storage.ml @@ -0,0 +1,281 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Permanent *) Unregistered_delegate of Signature.Public_key_hash.t + +let () = + (* Unregistered delegate *) + register_error_kind + `Permanent + ~id:"contract.manager.unregistered_delegate" + ~title:"Unregistered delegate" + ~description:"A contract cannot be delegated to an unregistered delegate" + ~pp:(fun ppf k -> + Format.fprintf + ppf + "The provided public key (with hash %a) is not registered as valid \ + delegate key." + Signature.Public_key_hash.pp + k) + Data_encoding.(obj1 (req "hash" Signature.Public_key_hash.encoding)) + (function Unregistered_delegate k -> Some k | _ -> None) + (fun k -> Unregistered_delegate k) + +let registered = Storage.Delegates.mem + +module Contract = struct + let init ctxt contract delegate = + Contract_manager_storage.is_manager_key_revealed ctxt delegate + >>=? fun known_delegate -> + error_unless known_delegate (Unregistered_delegate delegate) >>?= fun () -> + registered ctxt delegate >>= fun is_registered -> + error_unless is_registered (Unregistered_delegate delegate) >>?= fun () -> + Contract_delegate_storage.init ctxt contract delegate >>=? fun ctxt -> + Contract_storage.get_balance_and_frozen_bonds ctxt contract + >>=? fun balance_and_frozen_bonds -> + Stake_storage.add_stake ctxt delegate balance_and_frozen_bonds + + type error += + | (* `Temporary *) Active_delegate + | (* `Permanent *) Empty_delegate_account of Signature.Public_key_hash.t + + let () = + register_error_kind + `Temporary + ~id:"delegate.already_active" + ~title:"Delegate already active" + ~description:"Useless delegate reactivation" + ~pp:(fun ppf () -> + Format.fprintf ppf "The delegate is still active, no need to refresh it") + Data_encoding.empty + (function Active_delegate -> Some () | _ -> None) + (fun () -> Active_delegate) ; + register_error_kind + `Permanent + ~id:"delegate.empty_delegate_account" + ~title:"Empty delegate account" + ~description: + "Cannot register a delegate when its implicit account is empty" + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "Delegate registration is forbidden when the delegate\n\ + \ implicit account is empty (%a)" + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Empty_delegate_account c -> Some c | _ -> None) + (fun c -> Empty_delegate_account c) + + let set_self_delegate c delegate = + let open Lwt_result_syntax in + let*! is_registered = registered c delegate in + if is_registered then + let* () = + let* is_inactive = Delegate_activation_storage.is_inactive c delegate in + fail_unless is_inactive Active_delegate + in + Stake_storage.set_active c delegate + else + let contract = Contract_repr.Implicit delegate in + let* pk = + Contract_manager_storage.get_manager_key + c + ~error:(Unregistered_delegate delegate) + delegate + in + let* () = + let*! is_allocated = Contract_storage.allocated c contract in + fail_unless is_allocated (Empty_delegate_account delegate) + in + let* balance_and_frozen_bonds = + Contract_storage.get_balance_and_frozen_bonds c contract + in + let* c = + Stake_storage.remove_contract_stake c contract balance_and_frozen_bonds + in + let* c = Contract_delegate_storage.set c contract delegate in + let* c = Stake_storage.add_stake c delegate balance_and_frozen_bonds in + let*! c = Storage.Delegates.add c delegate in + let* c = Delegate_consensus_key.init c delegate pk in + let* c = Stake_storage.set_active c delegate in + return c + + type error += + | (* `Permanent *) No_deletion of Signature.Public_key_hash.t + | (* `Temporary *) Current_delegate + + let () = + register_error_kind + `Permanent + ~id:"delegate.no_deletion" + ~title:"Forbidden delegate deletion" + ~description:"Tried to unregister a delegate" + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "Delegate deletion is forbidden (%a)" + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function No_deletion c -> Some c | _ -> None) + (fun c -> No_deletion c) ; + register_error_kind + `Temporary + ~id:"delegate.unchanged" + ~title:"Unchanged delegated" + ~description:"Contract already delegated to the given delegate" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The contract is already delegated to the same delegate") + Data_encoding.empty + (function Current_delegate -> Some () | _ -> None) + (fun () -> Current_delegate) + + let set_delegate c contract delegate = + let open Lwt_result_syntax in + let* () = + match contract with + | Contract_repr.Originated _ -> return_unit + | Implicit pkh -> + let*! is_registered = registered c pkh in + fail_when is_registered (No_deletion pkh) + in + let* () = + let* current_delegate = Contract_delegate_storage.find c contract in + match (delegate, current_delegate) with + | None, None -> + (* we don't fail in this case in order not to risk breaking + existing smart contracts. *) + return_unit + | Some delegate, Some current_delegate + when Signature.Public_key_hash.equal delegate current_delegate -> + tzfail Current_delegate + | _ -> return_unit + in + let* balance_and_frozen_bonds = + Contract_storage.get_balance_and_frozen_bonds c contract + in + let* c = + Stake_storage.remove_contract_stake c contract balance_and_frozen_bonds + in + match delegate with + | None -> + let* c = Contract_delegate_storage.delete c contract in + return c + | Some delegate -> + let* () = + let*! is_delegate_registered = registered c delegate in + fail_when + (not is_delegate_registered) + (Unregistered_delegate delegate) + in + let* c = Contract_delegate_storage.set c contract delegate in + let* c = Stake_storage.add_stake c delegate balance_and_frozen_bonds in + return c + + let set c contract delegate = + match (delegate, contract) with + | Some delegate, Contract_repr.Implicit source + when Signature.Public_key_hash.equal source delegate -> + set_self_delegate c delegate + | _ -> set_delegate c contract delegate +end + +let fold = Storage.Delegates.fold + +let list = Storage.Delegates.elements + +let frozen_deposits_limit ctxt delegate = + Storage.Contract.Frozen_deposits_limit.find + ctxt + (Contract_repr.Implicit delegate) + +let set_frozen_deposits_limit ctxt delegate limit = + Storage.Contract.Frozen_deposits_limit.add_or_remove + ctxt + (Contract_repr.Implicit delegate) + limit + +let frozen_deposits ctxt delegate = + Frozen_deposits_storage.get ctxt (Contract_repr.Implicit delegate) + +let spendable_balance ctxt delegate = + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Spendable_balance.get ctxt contract + +let staking_balance ctxt delegate = + registered ctxt delegate >>= fun is_registered -> + if is_registered then Stake_storage.get_staking_balance ctxt delegate + else return Tez_repr.zero + +let full_balance ctxt delegate = + frozen_deposits ctxt delegate >>=? fun frozen_deposits -> + let delegate_contract = Contract_repr.Implicit delegate in + Contract_storage.get_balance_and_frozen_bonds ctxt delegate_contract + >>=? fun balance_and_frozen_bonds -> + Lwt.return + Tez_repr.(frozen_deposits.current_amount +? balance_and_frozen_bonds) + +let delegated_balance ctxt delegate = + staking_balance ctxt delegate >>=? fun staking_balance -> + full_balance ctxt delegate >>=? fun self_staking_balance -> + Lwt.return Tez_repr.(staking_balance -? self_staking_balance) + +let drain ctxt ~delegate ~destination = + let open Lwt_result_syntax in + let destination_contract = Contract_repr.Implicit destination in + let*! is_destination_allocated = + Contract_storage.allocated ctxt destination_contract + in + let delegate_contract = Contract_repr.Implicit delegate in + let* ctxt, _, balance_updates1 = + if not is_destination_allocated then + Fees_storage.burn_origination_fees + ctxt + ~storage_limit:(Z.of_int (Constants_storage.origination_size ctxt)) + ~payer:(`Contract delegate_contract) + else return (ctxt, Z.zero, []) + in + let* manager_balance = spendable_balance ctxt delegate in + let*? one_percent = Tez_repr.(manager_balance /? 100L) in + let fees = Tez_repr.(max one one_percent) in + let*? transferred = Tez_repr.(manager_balance -? fees) in + let* ctxt, balance_updates2 = + Token.transfer + ctxt + (`Contract delegate_contract) + (`Contract destination_contract) + transferred + in + return + ( ctxt, + not is_destination_allocated, + fees, + balance_updates1 @ balance_updates2 ) diff --git a/src/proto_016_PtMumbai/lib_protocol/delegate_storage.mli b/src/proto_016_PtMumbai/lib_protocol/delegate_storage.mli new file mode 100644 index 000000000000..9d809e266605 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/delegate_storage.mli @@ -0,0 +1,152 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module groups everything related to delegate registration. + For the invariants maintained, see the submodule {!Contract}. + + It also groups "trivial" getters/setters related to delegates. + + It is responsible for maintaining the following tables: + - {!Storage.Contract.Frozen_deposits_limit} + - {!Storage.Delegates} +*) + +type error += + | (* `Permanent *) Unregistered_delegate of Signature.Public_key_hash.t + +(** This module ensures the following invariants: + - registered delegates (i.e. those that appear in {!Storage.Delegates}) are + self-delegated, that is a delegate's implicit account delegates to itself + (i.e. {!Contract_delegate_storage.find} [delegate] returns [delegate]), + - registered delegates have their public keys revealed, + - registered delegates cannot change their delegation, + - stake is properly moved when changing delegation. +*) +module Contract : sig + type error += + | (* `Temporary *) Active_delegate + | (* `Permanent *) Empty_delegate_account of Signature.Public_key_hash.t + | (* `Permanent *) No_deletion of Signature.Public_key_hash.t + | (* `Temporary *) Current_delegate + + (** [init ctxt contract delegate] registers a delegate when + creating a contract. + + This functions assumes that [contract] is allocated. + + This function returns the {!Unregistered_delegate} error + if [contract] already has a delegate or + if [delegate] is not a registered delegate. *) + val init : + Raw_context.t -> + Contract_repr.t -> + Signature.Public_key_hash.t -> + Raw_context.t tzresult Lwt.t + + (** [set ctxt contract delegate_opt] allows to set the + delegate of a contract to [delegate] when [delegate_opt = Some delegate] + or to unset the delegate when [delegate_opt = None]. + When [delegate_opt = Some contract] (aka self-delegation), + the function also registers the contract as a delegate and + sets the delegate as {{!module:Delegate_activation_storage}active}. + + It returns the {!Unregistered_delegate} error when self-delegating and when the public key is not yet revealed. + It returns the {!Empty_delegate_account} error when self-delegating and the implicit account is not {{!Contract_storage.allocated}allocated}. + It returns the {!Active_delegate} error when self-delegating and the delegate is already active. + It returns the {!Unregistered_delegate} error when trying to set the delegate to an unregistered delegate. + It returns the {!Current_delegate} error when contract is already delegated to the same delegate. + It returns the {!No_deletion} error when trying to unset or change the delegate of a registered delegate. *) + val set : + Raw_context.t -> + Contract_repr.t -> + Signature.Public_key_hash.t option -> + Raw_context.t tzresult Lwt.t +end + +(** Has a delegate been registered in the delegate table? *) +val registered : Raw_context.t -> Signature.Public_key_hash.t -> bool Lwt.t + +(** Iterate on all registered delegates. *) +val fold : + Raw_context.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(Signature.Public_key_hash.t -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + +(** List all registered delegates. *) +val list : Raw_context.t -> Signature.Public_key_hash.t list Lwt.t + +val frozen_deposits_limit : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t option tzresult Lwt.t + +val set_frozen_deposits_limit : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t option -> + Raw_context.t Lwt.t + +(** Returns a delegate's frozen deposits, both the current amount and + the initial freezed amount. + + A delegate's frozen balance is only composed of frozen deposits; + rewards and fees are not frozen, but simply credited at the right + moment. *) +val frozen_deposits : + Raw_context.t -> + Signature.Public_key_hash.t -> + Storage.deposits tzresult Lwt.t + +val spendable_balance : + Raw_context.t -> Signature.public_key_hash -> Tez_repr.tez tzresult Lwt.t + +val staking_balance : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +(** Returns the full 'balance' of the implicit contract associated to + a given key, i.e. the sum of the spendable balance (given by [balance] or + [Contract_storage.get_balance]) and of the frozen balance. The frozen + balance is composed of all frozen bonds associated to the contract (given by + [Contract_storage.get_frozen_bonds]) and of the frozen deposits (given by + [frozen_deposits]). + + Only use this function for RPCs: this is expensive. *) +val full_balance : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +(** Only use this function for RPCs: this is expensive. *) +val delegated_balance : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +val drain : + Raw_context.t -> + delegate:Signature.Public_key_hash.t -> + destination:Signature.Public_key_hash.t -> + (Raw_context.t * bool * Tez_repr.t * Receipt_repr.balance_updates) tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/dependent_bool.ml b/src/proto_016_PtMumbai/lib_protocol/dependent_bool.ml new file mode 100644 index 000000000000..26d5bd7a9b5e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dependent_bool.ml @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type no = private DNo + +type yes = private DYes + +type _ dbool = No : no dbool | Yes : yes dbool + +type ('a, 'b, 'r) dand = + | NoNo : (no, no, no) dand + | NoYes : (no, yes, no) dand + | YesNo : (yes, no, no) dand + | YesYes : (yes, yes, yes) dand + +type ('a, 'b) ex_dand = Ex_dand : ('a, 'b, _) dand -> ('a, 'b) ex_dand +[@@unboxed] + +let dand : type a b. a dbool -> b dbool -> (a, b) ex_dand = + fun a b -> + match (a, b) with + | No, No -> Ex_dand NoNo + | No, Yes -> Ex_dand NoYes + | Yes, No -> Ex_dand YesNo + | Yes, Yes -> Ex_dand YesYes + +let dbool_of_dand : type a b r. (a, b, r) dand -> r dbool = function + | NoNo -> No + | NoYes -> No + | YesNo -> No + | YesYes -> Yes + +type (_, _) eq = Eq : ('a, 'a) eq + +let merge_dand : + type a b c1 c2. (a, b, c1) dand -> (a, b, c2) dand -> (c1, c2) eq = + fun w1 w2 -> + match (w1, w2) with + | NoNo, NoNo -> Eq + | NoYes, NoYes -> Eq + | YesNo, YesNo -> Eq + | YesYes, YesYes -> Eq diff --git a/src/proto_016_PtMumbai/lib_protocol/dependent_bool.mli b/src/proto_016_PtMumbai/lib_protocol/dependent_bool.mli new file mode 100644 index 000000000000..54416d9fd9c3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dependent_bool.mli @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Dependent booleans *) + +type no = private DNo + +type yes = private DYes + +(** + ['b dbool] is a boolean whose value depends on its type parameter ['b]. + [yes dbool] can only be [Yes]. [no dbool] can only be [No]. +*) +type _ dbool = No : no dbool | Yes : yes dbool + +(** + [('a, 'b, 'r) dand] is a witness of the logical conjunction of dependent + booleans. ['r] is the result of ['a] and ['b]. +*) +type ('a, 'b, 'r) dand = + | NoNo : (no, no, no) dand + | NoYes : (no, yes, no) dand + | YesNo : (yes, no, no) dand + | YesYes : (yes, yes, yes) dand + +type ('a, 'b) ex_dand = Ex_dand : ('a, 'b, _) dand -> ('a, 'b) ex_dand +[@@unboxed] + +(** Logical conjunction of dependent booleans. *) +val dand : 'a dbool -> 'b dbool -> ('a, 'b) ex_dand + +(** Result of the logical conjunction of dependent booleans. *) +val dbool_of_dand : ('a, 'b, 'r) dand -> 'r dbool + +(** Type equality witness. *) +type (_, _) eq = Eq : ('a, 'a) eq + +(** + [merge_dand] proves that the type [dand] represents a function, i.e. that + there is a unique ['r] such that [('a, 'b, 'r) dand] is inhabited for a + given ['a] and a given ['b]. +*) +val merge_dand : ('a, 'b, 'c1) dand -> ('a, 'b, 'c2) dand -> ('c1, 'c2) eq diff --git a/src/proto_016_PtMumbai/lib_protocol/destination_repr.ml b/src/proto_016_PtMumbai/lib_protocol/destination_repr.ml new file mode 100644 index 000000000000..4c2859e2134e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/destination_repr.ml @@ -0,0 +1,163 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = + | Contract of Contract_repr.t + | Tx_rollup of Tx_rollup_repr.t + | Sc_rollup of Sc_rollup_repr.t + | Zk_rollup of Zk_rollup_repr.t + +(* If you add more cases to this type, please update the + [test_compare_destination] test in + [test/unit/test_destination_repr.ml] to ensure that the compare + function keeps its expected behavior to distinguish between + implicit accounts and smart contracts. *) + +include Compare.Make (struct + type nonrec t = t + + let compare l1 l2 = + match (l1, l2) with + | Contract k1, Contract k2 -> Contract_repr.compare k1 k2 + | Tx_rollup k1, Tx_rollup k2 -> Tx_rollup_repr.compare k1 k2 + | Sc_rollup k1, Sc_rollup k2 -> Sc_rollup_repr.Address.compare k1 k2 + | Zk_rollup k1, Zk_rollup k2 -> Zk_rollup_repr.Address.compare k1 k2 + (* This function is used by the Michelson interpreter to compare + addresses. It is of significant importance to remember that in + Michelson, address comparison is used to distinguish between + KT1 and tz1. As a consequence, we want to preserve that [tz1 < + KT1 < others], which the two following lines ensure. The + wildcards are therefore here for a reason, and should not be + modified when new constructors are added to [t]. *) + | Contract _, _ -> -1 + | _, Contract _ -> 1 + | Tx_rollup _, _ -> -1 + | _, Tx_rollup _ -> 1 + | Sc_rollup _, _ -> -1 + | _, Sc_rollup _ -> 1 +end) + +let to_b58check = function + | Contract k -> Contract_repr.to_b58check k + | Tx_rollup k -> Tx_rollup_repr.to_b58check k + | Sc_rollup k -> Sc_rollup_repr.Address.to_b58check k + | Zk_rollup k -> Zk_rollup_repr.Address.to_b58check k + +type error += Invalid_destination_b58check of string + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"destination_repr.invalid_b58check" + ~title:"Destination decoding failed" + ~description: + "Failed to read a valid destination from a b58check_encoding data" + (obj1 (req "input" (string Plain))) + (function Invalid_destination_b58check x -> Some x | _ -> None) + (fun x -> Invalid_destination_b58check x) + +let of_b58data data = + let decode_on_none decode wrap = function + | Some x -> Some x + | None -> Option.map wrap @@ decode data + in + None + |> decode_on_none Contract_repr.of_b58data (fun c -> Contract c) + |> decode_on_none Tx_rollup_repr.of_b58data (fun t -> Tx_rollup t) + |> decode_on_none Sc_rollup_repr.Address.of_b58data (fun s -> Sc_rollup s) + |> decode_on_none Zk_rollup_repr.Address.of_b58data (fun z -> Zk_rollup z) + +let of_b58check_opt s = Option.bind (Base58.decode s) of_b58data + +let of_b58check s = + match of_b58check_opt s with + | None -> error (Invalid_destination_b58check s) + | Some dest -> Ok dest + +let encoding = + let open Data_encoding in + def + "transaction_destination" + ~title:"A destination of a transaction" + ~description: + "A destination notation compatible with the contract notation as given \ + to an RPC or inside scripts. Can be a base58 implicit contract hash, a \ + base58 originated contract hash, a base58 originated transaction \ + rollup, or a base58 originated smart-contract rollup." + @@ splitted + ~binary: + (union + ~tag_size:`Uint8 + (Contract_repr.cases + (function Contract x -> Some x | _ -> None) + (fun x -> Contract x) + @ [ + case + (Tag 2) + (Fixed.add_padding Tx_rollup_repr.encoding 1) + ~title:"Tx_rollup" + (function Tx_rollup k -> Some k | _ -> None) + (fun k -> Tx_rollup k); + case + (Tag 3) + (Fixed.add_padding Sc_rollup_repr.Address.encoding 1) + ~title:"Sc_rollup" + (function Sc_rollup k -> Some k | _ -> None) + (fun k -> Sc_rollup k); + case + (Tag 4) + (Fixed.add_padding Zk_rollup_repr.Address.encoding 1) + ~title:"Zk_rollup" + (function Zk_rollup k -> Some k | _ -> None) + (fun k -> Zk_rollup k); + ])) + ~json: + (conv + to_b58check + (fun s -> + match of_b58check s with + | Ok s -> s + | Error _ -> + Data_encoding.Json.cannot_destruct + "Invalid destination notation.") + (string Plain)) + +let pp : Format.formatter -> t -> unit = + fun fmt -> function + | Contract k -> Contract_repr.pp fmt k + | Tx_rollup k -> Tx_rollup_repr.pp fmt k + | Sc_rollup k -> Sc_rollup_repr.pp fmt k + | Zk_rollup k -> Zk_rollup_repr.Address.pp fmt k + +let in_memory_size = + let open Cache_memory_helpers in + function + | Contract k -> h1w +! Contract_repr.in_memory_size k + | Tx_rollup k -> h1w +! Tx_rollup_repr.in_memory_size k + | Sc_rollup k -> h1w +! Sc_rollup_repr.in_memory_size k + | Zk_rollup k -> h1w +! Zk_rollup_repr.in_memory_size k diff --git a/src/proto_016_PtMumbai/lib_protocol/destination_repr.mli b/src/proto_016_PtMumbai/lib_protocol/destination_repr.mli new file mode 100644 index 000000000000..2bb07891b4fd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/destination_repr.mli @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The type of the [destination] argument of the + {!Operation_repr.Transaction} manager operation. + + The introduction of this type allows to interact with emerging + layer-2 solutions using the API Tezos users and tooling + are already used to: contract calls to entrypoint. These solutions + cannot be integrated to {!Contract_repr.t} directly, because + values of this type are given a balance, which has an impact on + the delegation system. *) + +(** This type is a superset of the set of contracts ({!Contract_repr.t}). + + {b Note:} It is of key importance that the encoding of this type + remains compatible with {!Contract_repr.encoding}, for the + introduction to this type to remain transparent from the existing + tooling perspective. *) +type t = + | Contract of Contract_repr.t + | Tx_rollup of Tx_rollup_repr.t + | Sc_rollup of Sc_rollup_repr.t + | Zk_rollup of Zk_rollup_repr.t + +include Compare.S with type t := t + +val to_b58check : t -> string + +val of_b58check : string -> t tzresult + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +(** [in_memory_size contract] returns the number of bytes that are + allocated in the RAM for [contract]. *) +val in_memory_size : t -> Cache_memory_helpers.sint + +type error += Invalid_destination_b58check of string diff --git a/src/proto_016_PtMumbai/lib_protocol/dune b/src/proto_016_PtMumbai/lib_protocol/dune new file mode 100644 index 000000000000..d9b296a01344 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/dune @@ -0,0 +1,1088 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_protocol_environment_alpha) + (public_name tezos-protocol-016-PtMumbai.environment) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment) + (library_flags (:standard -linkall)) + (modules Tezos_protocol_environment_alpha)) + +(rule + (targets tezos_protocol_environment_alpha.ml) + (action + (write-file + %{targets} + "module Name = struct let name = \"alpha\" end\ninclude Tezos_protocol_environment.V8.Make(Name)()\n"))) + +(library + (name tezos_raw_protocol_016_PtMumbai) + (public_name tezos-protocol-016-PtMumbai.raw) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-016-PtMumbai.environment) + (library_flags (:standard -linkall)) + (flags + (:standard) + -nostdlib + -nopervasives + -open Tezos_protocol_environment_alpha + -open Tezos_protocol_environment_alpha.Pervasives + -open Tezos_protocol_environment_alpha.Error_monad) + (modules + Misc + Non_empty_string + Path_encoding + Storage_description + State_hash + Nonce_hash + Script_expr_hash + Origination_nonce + Contract_hash + Blinded_public_key_hash + Block_payload_hash + Tx_rollup_prefixes + Sc_rollup_reveal_hash + Merkle_list + Bitset + Bounded_history_repr + Skip_list_repr + Context_binary_proof + Michelson_v1_primitives + Slot_repr + Tez_repr + Period_repr + Time_repr + Ratio_repr + Round_repr + Block_payload_repr + Fixed_point_repr + Saturation_repr + Gas_limit_repr + Constants_parametric_repr + Constants_parametric_previous_repr + Constants_repr + Raw_level_repr + Fitness_repr + Cycle_repr + Level_repr + Script_repr + Cache_memory_helpers + Seed_repr + Sampler + Voting_period_repr + Ticket_hash_repr + Manager_counter_repr + Contract_repr + Indexable + Entrypoint_repr + Dal_slot_repr + Dal_attestation_repr + Sc_rollup_repr + Sc_rollup_metadata_repr + Sc_rollup_tick_repr + Sc_rollup_inbox_message_repr + Sc_rollup_inbox_merkelized_payload_hashes_repr + Sc_rollup_outbox_message_repr + Sc_rollup_dissection_chunk_repr + Sc_rollup_PVM_sig + Sc_rollup_arith + Sc_rollup_wasm + Sc_rollups + Sc_rollup_data_version_sig + Sc_rollup_inbox_repr + Sc_rollup_commitment_repr + Sc_rollup_proof_repr + Skip_list_costs + Sc_rollup_costs + Sc_rollup_game_repr + Tx_rollup_level_repr + Tx_rollup_l2_proof + Tx_rollup_l2_address + Tx_rollup_l2_qty + Tx_rollup_l2_context_hash + Tx_rollup_repr + Tx_rollup_withdraw_repr + Tx_rollup_withdraw_list_hash_repr + Tx_rollup_reveal_repr + Tx_rollup_message_repr + Tx_rollup_message_hash_repr + Tx_rollup_inbox_repr + Tx_rollup_message_result_repr + Tx_rollup_message_result_hash_repr + Tx_rollup_commitment_repr + Tx_rollup_errors_repr + Tx_rollup_state_repr + Dal_errors_repr + Zk_rollup_scalar + Zk_rollup_repr + Zk_rollup_state_repr + Zk_rollup_account_repr + Zk_rollup_ticket_repr + Zk_rollup_operation_repr + Zk_rollup_update_repr + Zk_rollup_circuit_public_inputs_repr + Bond_id_repr + Vote_repr + Liquidity_baking_repr + Block_header_repr + Destination_repr + Script_int + Ticket_amount + Operation_repr + Manager_repr + Commitment_repr + Parameters_repr + Sapling_repr + Lazy_storage_kind + Receipt_repr + Migration_repr + Carbonated_map_costs + Carbonated_map + Raw_context_intf + Raw_context + Storage_costs + Storage_sigs + Storage_functors + Storage + Ticket_hash_builder + Constants_storage + Tx_rollup_gas + Tx_rollup_hash_builder + Level_storage + Nonce_storage + Seed_storage + Contract_manager_storage + Delegate_activation_storage + Frozen_deposits_storage + Sapling_storage + Lazy_storage_diff + Commitment_storage + Voting_period_storage + Cache_repr + Zk_rollup_storage + Contract_delegate_storage + Stake_storage + Contract_storage + Token + Fees_storage + Delegate_consensus_key + Delegate_storage + Delegate_sampler + Delegate_missed_endorsements_storage + Delegate_slashed_deposits_storage + Delegate_cycles + Bootstrap_storage + Vote_storage + Ticket_storage + Liquidity_baking_storage + Liquidity_baking_cpmm + Liquidity_baking_lqt + Liquidity_baking_migration + Sc_rollup_errors + Sc_rollup_inbox_storage + Legacy_script_patches + Init_storage + Sapling_validator + Global_constants_costs + Global_constants_storage + Tx_rollup_state_storage + Tx_rollup_reveal_storage + Tx_rollup_inbox_storage + Tx_rollup_commitment_storage + Tx_rollup_storage + Sc_rollup_commitment_storage + Sc_rollup_outbox_storage + Sc_rollup_stake_storage + Sc_rollup_storage + Dal_slot_storage + Sc_rollup_refutation_storage + Zk_rollup_errors + Alpha_context + Script_string + Script_timestamp + Script_bytes + Tx_rollup_l2_storage_sig + Tx_rollup_l2_context_sig + Tx_rollup_l2_context + Tx_rollup_l2_batch + Tx_rollup_l2_apply + Tx_rollup_l2_verifier + Local_gas_counter + Script_tc_errors + Gas_monad + Script_ir_annot + Dependent_bool + Script_list + Script_typed_ir + Script_comparable + Gas_comparable_input_size + Script_set + Script_map + Gas_input_size + Script_typed_ir_size + Script_typed_ir_size_costs + Michelson_v1_gas_costs_generated + Michelson_v1_gas_costs + Michelson_v1_gas + Script_tc_context + Ticket_token + Ticket_receipt + Apply_operation_result + Apply_internal_results + Apply_results + Script_ir_translator_config + Script_ir_unparser + Script_ir_translator + Script_big_map + Script_cache + Script_tc_errors_registration + Ticket_token_unparser + Ticket_costs + Ticket_scanner + Ticket_balance_key + Ticket_lazy_storage_diff + Tx_rollup_parameters + Zk_rollup_parameters + Ticket_token_map + Ticket_operations_diff + Ticket_accounting + Ticket_transfer + Script_interpreter_defs + Script_interpreter + Sc_rollup_management_protocol + Sc_rollup_operations + Dal_apply + Zk_rollup_apply + Baking + Validate_errors + Amendment + Validate + Mempool_validation + Apply + Services_registration + Constants_services + Sapling_services + Contract_services + Delegate_services + Voting_services + Tx_rollup_services + Dal_services + Alpha_services + Main)) + +(library + (name tezos_protocol_016_PtMumbai) + (public_name tezos-protocol-016-PtMumbai) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment + tezos-protocol-environment.sigs + tezos-protocol-016-PtMumbai.raw) + (flags + (:standard) + -nopervasives) + (modules Protocol Tezos_protocol_016_PtMumbai)) + +(install + (package tezos-protocol-016-PtMumbai) + (section lib) + (files (TEZOS_PROTOCOL as raw/TEZOS_PROTOCOL))) + +(rule + (targets protocol.ml) + (action + (write-file + %{targets} + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\"\nlet name = Tezos_protocol_environment_alpha.Name.name\ninclude Tezos_raw_protocol_016_PtMumbai\ninclude Tezos_raw_protocol_alpha.Main\n"))) + +(rule + (targets tezos_protocol_016_PtMumbai.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_alpha\nmodule Protocol = Protocol\n"))) + +(rule + (alias runtest_compile_protocol) + (deps + misc.ml misc.mli + non_empty_string.ml non_empty_string.mli + path_encoding.ml path_encoding.mli + storage_description.ml storage_description.mli + state_hash.ml state_hash.mli + nonce_hash.ml nonce_hash.mli + script_expr_hash.ml script_expr_hash.mli + origination_nonce.ml origination_nonce.mli + contract_hash.ml contract_hash.mli + blinded_public_key_hash.ml blinded_public_key_hash.mli + block_payload_hash.ml block_payload_hash.mli + tx_rollup_prefixes.ml tx_rollup_prefixes.mli + sc_rollup_reveal_hash.ml sc_rollup_reveal_hash.mli + merkle_list.ml merkle_list.mli + bitset.ml bitset.mli + bounded_history_repr.ml bounded_history_repr.mli + skip_list_repr.ml skip_list_repr.mli + context_binary_proof.ml context_binary_proof.mli + michelson_v1_primitives.ml michelson_v1_primitives.mli + slot_repr.ml slot_repr.mli + tez_repr.ml tez_repr.mli + period_repr.ml period_repr.mli + time_repr.ml time_repr.mli + ratio_repr.ml ratio_repr.mli + round_repr.ml round_repr.mli + block_payload_repr.ml block_payload_repr.mli + fixed_point_repr.ml fixed_point_repr.mli + saturation_repr.ml saturation_repr.mli + gas_limit_repr.ml gas_limit_repr.mli + constants_parametric_repr.ml constants_parametric_repr.mli + constants_parametric_previous_repr.ml + constants_parametric_previous_repr.mli + constants_repr.ml constants_repr.mli + raw_level_repr.ml raw_level_repr.mli + fitness_repr.ml fitness_repr.mli + cycle_repr.ml cycle_repr.mli + level_repr.ml level_repr.mli + script_repr.ml script_repr.mli + cache_memory_helpers.ml + seed_repr.ml seed_repr.mli + sampler.ml sampler.mli + voting_period_repr.ml voting_period_repr.mli + ticket_hash_repr.ml ticket_hash_repr.mli + manager_counter_repr.ml manager_counter_repr.mli + contract_repr.ml contract_repr.mli + indexable.ml indexable.mli + entrypoint_repr.ml entrypoint_repr.mli + dal_slot_repr.ml dal_slot_repr.mli + dal_attestation_repr.ml dal_attestation_repr.mli + sc_rollup_repr.ml sc_rollup_repr.mli + sc_rollup_metadata_repr.ml sc_rollup_metadata_repr.mli + sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli + sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli + sc_rollup_inbox_merkelized_payload_hashes_repr.ml + sc_rollup_inbox_merkelized_payload_hashes_repr.mli + sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli + sc_rollup_dissection_chunk_repr.ml sc_rollup_dissection_chunk_repr.mli + sc_rollup_PVM_sig.ml + sc_rollup_arith.ml sc_rollup_arith.mli + sc_rollup_wasm.ml sc_rollup_wasm.mli + sc_rollups.ml sc_rollups.mli + sc_rollup_data_version_sig.ml + sc_rollup_inbox_repr.ml sc_rollup_inbox_repr.mli + sc_rollup_commitment_repr.ml sc_rollup_commitment_repr.mli + sc_rollup_proof_repr.ml sc_rollup_proof_repr.mli + skip_list_costs.ml skip_list_costs.mli + sc_rollup_costs.ml sc_rollup_costs.mli + sc_rollup_game_repr.ml sc_rollup_game_repr.mli + tx_rollup_level_repr.ml tx_rollup_level_repr.mli + tx_rollup_l2_proof.ml tx_rollup_l2_proof.mli + tx_rollup_l2_address.ml tx_rollup_l2_address.mli + tx_rollup_l2_qty.ml tx_rollup_l2_qty.mli + tx_rollup_l2_context_hash.ml tx_rollup_l2_context_hash.mli + tx_rollup_repr.ml tx_rollup_repr.mli + tx_rollup_withdraw_repr.ml tx_rollup_withdraw_repr.mli + tx_rollup_withdraw_list_hash_repr.ml tx_rollup_withdraw_list_hash_repr.mli + tx_rollup_reveal_repr.ml tx_rollup_reveal_repr.mli + tx_rollup_message_repr.ml tx_rollup_message_repr.mli + tx_rollup_message_hash_repr.ml tx_rollup_message_hash_repr.mli + tx_rollup_inbox_repr.ml tx_rollup_inbox_repr.mli + tx_rollup_message_result_repr.ml tx_rollup_message_result_repr.mli + tx_rollup_message_result_hash_repr.ml + tx_rollup_message_result_hash_repr.mli + tx_rollup_commitment_repr.ml tx_rollup_commitment_repr.mli + tx_rollup_errors_repr.ml + tx_rollup_state_repr.ml tx_rollup_state_repr.mli + dal_errors_repr.ml + zk_rollup_scalar.ml zk_rollup_scalar.mli + zk_rollup_repr.ml zk_rollup_repr.mli + zk_rollup_state_repr.ml zk_rollup_state_repr.mli + zk_rollup_account_repr.ml zk_rollup_account_repr.mli + zk_rollup_ticket_repr.ml zk_rollup_ticket_repr.mli + zk_rollup_operation_repr.ml zk_rollup_operation_repr.mli + zk_rollup_update_repr.ml zk_rollup_update_repr.mli + zk_rollup_circuit_public_inputs_repr.ml + zk_rollup_circuit_public_inputs_repr.mli + bond_id_repr.ml bond_id_repr.mli + vote_repr.ml vote_repr.mli + liquidity_baking_repr.ml liquidity_baking_repr.mli + block_header_repr.ml block_header_repr.mli + destination_repr.ml destination_repr.mli + script_int.ml script_int.mli + ticket_amount.ml ticket_amount.mli + operation_repr.ml operation_repr.mli + manager_repr.ml manager_repr.mli + commitment_repr.ml commitment_repr.mli + parameters_repr.ml parameters_repr.mli + sapling_repr.ml + lazy_storage_kind.ml lazy_storage_kind.mli + receipt_repr.ml receipt_repr.mli + migration_repr.ml migration_repr.mli + carbonated_map_costs.ml carbonated_map_costs.mli + carbonated_map.ml carbonated_map.mli + raw_context_intf.ml + raw_context.ml raw_context.mli + storage_costs.ml storage_costs.mli + storage_sigs.ml + storage_functors.ml storage_functors.mli + storage.ml storage.mli + ticket_hash_builder.ml ticket_hash_builder.mli + constants_storage.ml constants_storage.mli + tx_rollup_gas.ml tx_rollup_gas.mli + tx_rollup_hash_builder.ml + level_storage.ml level_storage.mli + nonce_storage.ml nonce_storage.mli + seed_storage.ml seed_storage.mli + contract_manager_storage.ml contract_manager_storage.mli + delegate_activation_storage.ml delegate_activation_storage.mli + frozen_deposits_storage.ml frozen_deposits_storage.mli + sapling_storage.ml + lazy_storage_diff.ml lazy_storage_diff.mli + commitment_storage.ml commitment_storage.mli + voting_period_storage.ml voting_period_storage.mli + cache_repr.ml cache_repr.mli + zk_rollup_storage.ml zk_rollup_storage.mli + contract_delegate_storage.ml contract_delegate_storage.mli + stake_storage.ml stake_storage.mli + contract_storage.ml contract_storage.mli + token.ml token.mli + fees_storage.ml fees_storage.mli + delegate_consensus_key.ml delegate_consensus_key.mli + delegate_storage.ml delegate_storage.mli + delegate_sampler.ml delegate_sampler.mli + delegate_missed_endorsements_storage.ml + delegate_missed_endorsements_storage.mli + delegate_slashed_deposits_storage.ml delegate_slashed_deposits_storage.mli + delegate_cycles.ml delegate_cycles.mli + bootstrap_storage.ml bootstrap_storage.mli + vote_storage.ml vote_storage.mli + ticket_storage.ml ticket_storage.mli + liquidity_baking_storage.ml liquidity_baking_storage.mli + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_migration.ml liquidity_baking_migration.mli + sc_rollup_errors.ml + sc_rollup_inbox_storage.ml sc_rollup_inbox_storage.mli + legacy_script_patches.ml + init_storage.ml init_storage.mli + sapling_validator.ml + global_constants_costs.ml global_constants_costs.mli + global_constants_storage.ml global_constants_storage.mli + tx_rollup_state_storage.ml tx_rollup_state_storage.mli + tx_rollup_reveal_storage.ml tx_rollup_reveal_storage.mli + tx_rollup_inbox_storage.ml tx_rollup_inbox_storage.mli + tx_rollup_commitment_storage.ml tx_rollup_commitment_storage.mli + tx_rollup_storage.ml tx_rollup_storage.mli + sc_rollup_commitment_storage.ml sc_rollup_commitment_storage.mli + sc_rollup_outbox_storage.ml sc_rollup_outbox_storage.mli + sc_rollup_stake_storage.ml sc_rollup_stake_storage.mli + sc_rollup_storage.ml sc_rollup_storage.mli + dal_slot_storage.ml dal_slot_storage.mli + sc_rollup_refutation_storage.ml sc_rollup_refutation_storage.mli + zk_rollup_errors.ml + alpha_context.ml alpha_context.mli + script_string.ml script_string.mli + script_timestamp.ml script_timestamp.mli + script_bytes.ml script_bytes.mli + tx_rollup_l2_storage_sig.ml + tx_rollup_l2_context_sig.ml + tx_rollup_l2_context.ml + tx_rollup_l2_batch.ml tx_rollup_l2_batch.mli + tx_rollup_l2_apply.ml tx_rollup_l2_apply.mli + tx_rollup_l2_verifier.ml tx_rollup_l2_verifier.mli + local_gas_counter.ml local_gas_counter.mli + script_tc_errors.ml + gas_monad.ml gas_monad.mli + script_ir_annot.ml script_ir_annot.mli + dependent_bool.ml dependent_bool.mli + script_list.ml script_list.mli + script_typed_ir.ml script_typed_ir.mli + script_comparable.ml script_comparable.mli + gas_comparable_input_size.ml gas_comparable_input_size.mli + script_set.ml script_set.mli + script_map.ml script_map.mli + gas_input_size.ml gas_input_size.mli + script_typed_ir_size.ml script_typed_ir_size.mli + script_typed_ir_size_costs.ml script_typed_ir_size_costs.mli + michelson_v1_gas_costs_generated.ml + michelson_v1_gas_costs.ml + michelson_v1_gas.ml michelson_v1_gas.mli + script_tc_context.ml script_tc_context.mli + ticket_token.ml ticket_token.mli + ticket_receipt.ml ticket_receipt.mli + apply_operation_result.ml apply_operation_result.mli + apply_internal_results.ml apply_internal_results.mli + apply_results.ml apply_results.mli + script_ir_translator_config.ml + script_ir_unparser.ml script_ir_unparser.mli + script_ir_translator.ml script_ir_translator.mli + script_big_map.ml script_big_map.mli + script_cache.ml script_cache.mli + script_tc_errors_registration.ml script_tc_errors_registration.mli + ticket_token_unparser.ml ticket_token_unparser.mli + ticket_costs.ml ticket_costs.mli + ticket_scanner.ml ticket_scanner.mli + ticket_balance_key.ml ticket_balance_key.mli + ticket_lazy_storage_diff.ml ticket_lazy_storage_diff.mli + tx_rollup_parameters.ml tx_rollup_parameters.mli + zk_rollup_parameters.ml zk_rollup_parameters.mli + ticket_token_map.ml ticket_token_map.mli + ticket_operations_diff.ml ticket_operations_diff.mli + ticket_accounting.ml ticket_accounting.mli + ticket_transfer.ml ticket_transfer.mli + script_interpreter_defs.ml + script_interpreter.ml script_interpreter.mli + sc_rollup_management_protocol.ml sc_rollup_management_protocol.mli + sc_rollup_operations.ml sc_rollup_operations.mli + dal_apply.ml dal_apply.mli + zk_rollup_apply.ml zk_rollup_apply.mli + baking.ml baking.mli + validate_errors.ml validate_errors.mli + amendment.ml amendment.mli + validate.ml validate.mli + mempool_validation.ml mempool_validation.mli + apply.ml apply.mli + services_registration.ml services_registration.mli + constants_services.ml constants_services.mli + sapling_services.ml + contract_services.ml contract_services.mli + delegate_services.ml delegate_services.mli + voting_services.ml voting_services.mli + tx_rollup_services.ml tx_rollup_services.mli + dal_services.ml dal_services.mli + alpha_services.ml alpha_services.mli + main.ml main.mli + (:src_dir TEZOS_PROTOCOL)) + (action (run %{bin:octez-protocol-compiler} -no-hash-check -warn-error +a .))) + +(library + (name tezos_protocol_016_PtMumbai_functor) + (libraries + tezos-protocol-environment + tezos-protocol-environment.sigs) + (flags + (:standard) + -nopervasives) + (modules Functor)) + +(rule + (targets functor.ml) + (deps + misc.ml misc.mli + non_empty_string.ml non_empty_string.mli + path_encoding.ml path_encoding.mli + storage_description.ml storage_description.mli + state_hash.ml state_hash.mli + nonce_hash.ml nonce_hash.mli + script_expr_hash.ml script_expr_hash.mli + origination_nonce.ml origination_nonce.mli + contract_hash.ml contract_hash.mli + blinded_public_key_hash.ml blinded_public_key_hash.mli + block_payload_hash.ml block_payload_hash.mli + tx_rollup_prefixes.ml tx_rollup_prefixes.mli + sc_rollup_reveal_hash.ml sc_rollup_reveal_hash.mli + merkle_list.ml merkle_list.mli + bitset.ml bitset.mli + bounded_history_repr.ml bounded_history_repr.mli + skip_list_repr.ml skip_list_repr.mli + context_binary_proof.ml context_binary_proof.mli + michelson_v1_primitives.ml michelson_v1_primitives.mli + slot_repr.ml slot_repr.mli + tez_repr.ml tez_repr.mli + period_repr.ml period_repr.mli + time_repr.ml time_repr.mli + ratio_repr.ml ratio_repr.mli + round_repr.ml round_repr.mli + block_payload_repr.ml block_payload_repr.mli + fixed_point_repr.ml fixed_point_repr.mli + saturation_repr.ml saturation_repr.mli + gas_limit_repr.ml gas_limit_repr.mli + constants_parametric_repr.ml constants_parametric_repr.mli + constants_parametric_previous_repr.ml + constants_parametric_previous_repr.mli + constants_repr.ml constants_repr.mli + raw_level_repr.ml raw_level_repr.mli + fitness_repr.ml fitness_repr.mli + cycle_repr.ml cycle_repr.mli + level_repr.ml level_repr.mli + script_repr.ml script_repr.mli + cache_memory_helpers.ml + seed_repr.ml seed_repr.mli + sampler.ml sampler.mli + voting_period_repr.ml voting_period_repr.mli + ticket_hash_repr.ml ticket_hash_repr.mli + manager_counter_repr.ml manager_counter_repr.mli + contract_repr.ml contract_repr.mli + indexable.ml indexable.mli + entrypoint_repr.ml entrypoint_repr.mli + dal_slot_repr.ml dal_slot_repr.mli + dal_attestation_repr.ml dal_attestation_repr.mli + sc_rollup_repr.ml sc_rollup_repr.mli + sc_rollup_metadata_repr.ml sc_rollup_metadata_repr.mli + sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli + sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli + sc_rollup_inbox_merkelized_payload_hashes_repr.ml + sc_rollup_inbox_merkelized_payload_hashes_repr.mli + sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli + sc_rollup_dissection_chunk_repr.ml sc_rollup_dissection_chunk_repr.mli + sc_rollup_PVM_sig.ml + sc_rollup_arith.ml sc_rollup_arith.mli + sc_rollup_wasm.ml sc_rollup_wasm.mli + sc_rollups.ml sc_rollups.mli + sc_rollup_data_version_sig.ml + sc_rollup_inbox_repr.ml sc_rollup_inbox_repr.mli + sc_rollup_commitment_repr.ml sc_rollup_commitment_repr.mli + sc_rollup_proof_repr.ml sc_rollup_proof_repr.mli + skip_list_costs.ml skip_list_costs.mli + sc_rollup_costs.ml sc_rollup_costs.mli + sc_rollup_game_repr.ml sc_rollup_game_repr.mli + tx_rollup_level_repr.ml tx_rollup_level_repr.mli + tx_rollup_l2_proof.ml tx_rollup_l2_proof.mli + tx_rollup_l2_address.ml tx_rollup_l2_address.mli + tx_rollup_l2_qty.ml tx_rollup_l2_qty.mli + tx_rollup_l2_context_hash.ml tx_rollup_l2_context_hash.mli + tx_rollup_repr.ml tx_rollup_repr.mli + tx_rollup_withdraw_repr.ml tx_rollup_withdraw_repr.mli + tx_rollup_withdraw_list_hash_repr.ml tx_rollup_withdraw_list_hash_repr.mli + tx_rollup_reveal_repr.ml tx_rollup_reveal_repr.mli + tx_rollup_message_repr.ml tx_rollup_message_repr.mli + tx_rollup_message_hash_repr.ml tx_rollup_message_hash_repr.mli + tx_rollup_inbox_repr.ml tx_rollup_inbox_repr.mli + tx_rollup_message_result_repr.ml tx_rollup_message_result_repr.mli + tx_rollup_message_result_hash_repr.ml + tx_rollup_message_result_hash_repr.mli + tx_rollup_commitment_repr.ml tx_rollup_commitment_repr.mli + tx_rollup_errors_repr.ml + tx_rollup_state_repr.ml tx_rollup_state_repr.mli + dal_errors_repr.ml + zk_rollup_scalar.ml zk_rollup_scalar.mli + zk_rollup_repr.ml zk_rollup_repr.mli + zk_rollup_state_repr.ml zk_rollup_state_repr.mli + zk_rollup_account_repr.ml zk_rollup_account_repr.mli + zk_rollup_ticket_repr.ml zk_rollup_ticket_repr.mli + zk_rollup_operation_repr.ml zk_rollup_operation_repr.mli + zk_rollup_update_repr.ml zk_rollup_update_repr.mli + zk_rollup_circuit_public_inputs_repr.ml + zk_rollup_circuit_public_inputs_repr.mli + bond_id_repr.ml bond_id_repr.mli + vote_repr.ml vote_repr.mli + liquidity_baking_repr.ml liquidity_baking_repr.mli + block_header_repr.ml block_header_repr.mli + destination_repr.ml destination_repr.mli + script_int.ml script_int.mli + ticket_amount.ml ticket_amount.mli + operation_repr.ml operation_repr.mli + manager_repr.ml manager_repr.mli + commitment_repr.ml commitment_repr.mli + parameters_repr.ml parameters_repr.mli + sapling_repr.ml + lazy_storage_kind.ml lazy_storage_kind.mli + receipt_repr.ml receipt_repr.mli + migration_repr.ml migration_repr.mli + carbonated_map_costs.ml carbonated_map_costs.mli + carbonated_map.ml carbonated_map.mli + raw_context_intf.ml + raw_context.ml raw_context.mli + storage_costs.ml storage_costs.mli + storage_sigs.ml + storage_functors.ml storage_functors.mli + storage.ml storage.mli + ticket_hash_builder.ml ticket_hash_builder.mli + constants_storage.ml constants_storage.mli + tx_rollup_gas.ml tx_rollup_gas.mli + tx_rollup_hash_builder.ml + level_storage.ml level_storage.mli + nonce_storage.ml nonce_storage.mli + seed_storage.ml seed_storage.mli + contract_manager_storage.ml contract_manager_storage.mli + delegate_activation_storage.ml delegate_activation_storage.mli + frozen_deposits_storage.ml frozen_deposits_storage.mli + sapling_storage.ml + lazy_storage_diff.ml lazy_storage_diff.mli + commitment_storage.ml commitment_storage.mli + voting_period_storage.ml voting_period_storage.mli + cache_repr.ml cache_repr.mli + zk_rollup_storage.ml zk_rollup_storage.mli + contract_delegate_storage.ml contract_delegate_storage.mli + stake_storage.ml stake_storage.mli + contract_storage.ml contract_storage.mli + token.ml token.mli + fees_storage.ml fees_storage.mli + delegate_consensus_key.ml delegate_consensus_key.mli + delegate_storage.ml delegate_storage.mli + delegate_sampler.ml delegate_sampler.mli + delegate_missed_endorsements_storage.ml + delegate_missed_endorsements_storage.mli + delegate_slashed_deposits_storage.ml delegate_slashed_deposits_storage.mli + delegate_cycles.ml delegate_cycles.mli + bootstrap_storage.ml bootstrap_storage.mli + vote_storage.ml vote_storage.mli + ticket_storage.ml ticket_storage.mli + liquidity_baking_storage.ml liquidity_baking_storage.mli + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_migration.ml liquidity_baking_migration.mli + sc_rollup_errors.ml + sc_rollup_inbox_storage.ml sc_rollup_inbox_storage.mli + legacy_script_patches.ml + init_storage.ml init_storage.mli + sapling_validator.ml + global_constants_costs.ml global_constants_costs.mli + global_constants_storage.ml global_constants_storage.mli + tx_rollup_state_storage.ml tx_rollup_state_storage.mli + tx_rollup_reveal_storage.ml tx_rollup_reveal_storage.mli + tx_rollup_inbox_storage.ml tx_rollup_inbox_storage.mli + tx_rollup_commitment_storage.ml tx_rollup_commitment_storage.mli + tx_rollup_storage.ml tx_rollup_storage.mli + sc_rollup_commitment_storage.ml sc_rollup_commitment_storage.mli + sc_rollup_outbox_storage.ml sc_rollup_outbox_storage.mli + sc_rollup_stake_storage.ml sc_rollup_stake_storage.mli + sc_rollup_storage.ml sc_rollup_storage.mli + dal_slot_storage.ml dal_slot_storage.mli + sc_rollup_refutation_storage.ml sc_rollup_refutation_storage.mli + zk_rollup_errors.ml + alpha_context.ml alpha_context.mli + script_string.ml script_string.mli + script_timestamp.ml script_timestamp.mli + script_bytes.ml script_bytes.mli + tx_rollup_l2_storage_sig.ml + tx_rollup_l2_context_sig.ml + tx_rollup_l2_context.ml + tx_rollup_l2_batch.ml tx_rollup_l2_batch.mli + tx_rollup_l2_apply.ml tx_rollup_l2_apply.mli + tx_rollup_l2_verifier.ml tx_rollup_l2_verifier.mli + local_gas_counter.ml local_gas_counter.mli + script_tc_errors.ml + gas_monad.ml gas_monad.mli + script_ir_annot.ml script_ir_annot.mli + dependent_bool.ml dependent_bool.mli + script_list.ml script_list.mli + script_typed_ir.ml script_typed_ir.mli + script_comparable.ml script_comparable.mli + gas_comparable_input_size.ml gas_comparable_input_size.mli + script_set.ml script_set.mli + script_map.ml script_map.mli + gas_input_size.ml gas_input_size.mli + script_typed_ir_size.ml script_typed_ir_size.mli + script_typed_ir_size_costs.ml script_typed_ir_size_costs.mli + michelson_v1_gas_costs_generated.ml + michelson_v1_gas_costs.ml + michelson_v1_gas.ml michelson_v1_gas.mli + script_tc_context.ml script_tc_context.mli + ticket_token.ml ticket_token.mli + ticket_receipt.ml ticket_receipt.mli + apply_operation_result.ml apply_operation_result.mli + apply_internal_results.ml apply_internal_results.mli + apply_results.ml apply_results.mli + script_ir_translator_config.ml + script_ir_unparser.ml script_ir_unparser.mli + script_ir_translator.ml script_ir_translator.mli + script_big_map.ml script_big_map.mli + script_cache.ml script_cache.mli + script_tc_errors_registration.ml script_tc_errors_registration.mli + ticket_token_unparser.ml ticket_token_unparser.mli + ticket_costs.ml ticket_costs.mli + ticket_scanner.ml ticket_scanner.mli + ticket_balance_key.ml ticket_balance_key.mli + ticket_lazy_storage_diff.ml ticket_lazy_storage_diff.mli + tx_rollup_parameters.ml tx_rollup_parameters.mli + zk_rollup_parameters.ml zk_rollup_parameters.mli + ticket_token_map.ml ticket_token_map.mli + ticket_operations_diff.ml ticket_operations_diff.mli + ticket_accounting.ml ticket_accounting.mli + ticket_transfer.ml ticket_transfer.mli + script_interpreter_defs.ml + script_interpreter.ml script_interpreter.mli + sc_rollup_management_protocol.ml sc_rollup_management_protocol.mli + sc_rollup_operations.ml sc_rollup_operations.mli + dal_apply.ml dal_apply.mli + zk_rollup_apply.ml zk_rollup_apply.mli + baking.ml baking.mli + validate_errors.ml validate_errors.mli + amendment.ml amendment.mli + validate.ml validate.mli + mempool_validation.ml mempool_validation.mli + apply.ml apply.mli + services_registration.ml services_registration.mli + constants_services.ml constants_services.mli + sapling_services.ml + contract_services.ml contract_services.mli + delegate_services.ml delegate_services.mli + voting_services.ml voting_services.mli + tx_rollup_services.ml tx_rollup_services.mli + dal_services.ml dal_services.mli + alpha_services.ml alpha_services.mli + main.ml main.mli (:src_dir TEZOS_PROTOCOL)) + (action + (with-stdout-to + %{targets} + (chdir + %{workspace_root} + (run %{bin:octez-protocol-compiler.octez-protocol-packer} %{src_dir}))))) + +(library + (name tezos_embedded_protocol_016_PtMumbai) + (public_name tezos-embedded-protocol-016-PtMumbai) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-016-PtMumbai + tezos-protocol-updater + tezos-protocol-environment) + (library_flags (:standard -linkall)) + (modules Registerer)) + +(rule + (targets registerer.ml) + (deps + misc.ml misc.mli + non_empty_string.ml non_empty_string.mli + path_encoding.ml path_encoding.mli + storage_description.ml storage_description.mli + state_hash.ml state_hash.mli + nonce_hash.ml nonce_hash.mli + script_expr_hash.ml script_expr_hash.mli + origination_nonce.ml origination_nonce.mli + contract_hash.ml contract_hash.mli + blinded_public_key_hash.ml blinded_public_key_hash.mli + block_payload_hash.ml block_payload_hash.mli + tx_rollup_prefixes.ml tx_rollup_prefixes.mli + sc_rollup_reveal_hash.ml sc_rollup_reveal_hash.mli + merkle_list.ml merkle_list.mli + bitset.ml bitset.mli + bounded_history_repr.ml bounded_history_repr.mli + skip_list_repr.ml skip_list_repr.mli + context_binary_proof.ml context_binary_proof.mli + michelson_v1_primitives.ml michelson_v1_primitives.mli + slot_repr.ml slot_repr.mli + tez_repr.ml tez_repr.mli + period_repr.ml period_repr.mli + time_repr.ml time_repr.mli + ratio_repr.ml ratio_repr.mli + round_repr.ml round_repr.mli + block_payload_repr.ml block_payload_repr.mli + fixed_point_repr.ml fixed_point_repr.mli + saturation_repr.ml saturation_repr.mli + gas_limit_repr.ml gas_limit_repr.mli + constants_parametric_repr.ml constants_parametric_repr.mli + constants_parametric_previous_repr.ml + constants_parametric_previous_repr.mli + constants_repr.ml constants_repr.mli + raw_level_repr.ml raw_level_repr.mli + fitness_repr.ml fitness_repr.mli + cycle_repr.ml cycle_repr.mli + level_repr.ml level_repr.mli + script_repr.ml script_repr.mli + cache_memory_helpers.ml + seed_repr.ml seed_repr.mli + sampler.ml sampler.mli + voting_period_repr.ml voting_period_repr.mli + ticket_hash_repr.ml ticket_hash_repr.mli + manager_counter_repr.ml manager_counter_repr.mli + contract_repr.ml contract_repr.mli + indexable.ml indexable.mli + entrypoint_repr.ml entrypoint_repr.mli + dal_slot_repr.ml dal_slot_repr.mli + dal_attestation_repr.ml dal_attestation_repr.mli + sc_rollup_repr.ml sc_rollup_repr.mli + sc_rollup_metadata_repr.ml sc_rollup_metadata_repr.mli + sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli + sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli + sc_rollup_inbox_merkelized_payload_hashes_repr.ml + sc_rollup_inbox_merkelized_payload_hashes_repr.mli + sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli + sc_rollup_dissection_chunk_repr.ml sc_rollup_dissection_chunk_repr.mli + sc_rollup_PVM_sig.ml + sc_rollup_arith.ml sc_rollup_arith.mli + sc_rollup_wasm.ml sc_rollup_wasm.mli + sc_rollups.ml sc_rollups.mli + sc_rollup_data_version_sig.ml + sc_rollup_inbox_repr.ml sc_rollup_inbox_repr.mli + sc_rollup_commitment_repr.ml sc_rollup_commitment_repr.mli + sc_rollup_proof_repr.ml sc_rollup_proof_repr.mli + skip_list_costs.ml skip_list_costs.mli + sc_rollup_costs.ml sc_rollup_costs.mli + sc_rollup_game_repr.ml sc_rollup_game_repr.mli + tx_rollup_level_repr.ml tx_rollup_level_repr.mli + tx_rollup_l2_proof.ml tx_rollup_l2_proof.mli + tx_rollup_l2_address.ml tx_rollup_l2_address.mli + tx_rollup_l2_qty.ml tx_rollup_l2_qty.mli + tx_rollup_l2_context_hash.ml tx_rollup_l2_context_hash.mli + tx_rollup_repr.ml tx_rollup_repr.mli + tx_rollup_withdraw_repr.ml tx_rollup_withdraw_repr.mli + tx_rollup_withdraw_list_hash_repr.ml tx_rollup_withdraw_list_hash_repr.mli + tx_rollup_reveal_repr.ml tx_rollup_reveal_repr.mli + tx_rollup_message_repr.ml tx_rollup_message_repr.mli + tx_rollup_message_hash_repr.ml tx_rollup_message_hash_repr.mli + tx_rollup_inbox_repr.ml tx_rollup_inbox_repr.mli + tx_rollup_message_result_repr.ml tx_rollup_message_result_repr.mli + tx_rollup_message_result_hash_repr.ml + tx_rollup_message_result_hash_repr.mli + tx_rollup_commitment_repr.ml tx_rollup_commitment_repr.mli + tx_rollup_errors_repr.ml + tx_rollup_state_repr.ml tx_rollup_state_repr.mli + dal_errors_repr.ml + zk_rollup_scalar.ml zk_rollup_scalar.mli + zk_rollup_repr.ml zk_rollup_repr.mli + zk_rollup_state_repr.ml zk_rollup_state_repr.mli + zk_rollup_account_repr.ml zk_rollup_account_repr.mli + zk_rollup_ticket_repr.ml zk_rollup_ticket_repr.mli + zk_rollup_operation_repr.ml zk_rollup_operation_repr.mli + zk_rollup_update_repr.ml zk_rollup_update_repr.mli + zk_rollup_circuit_public_inputs_repr.ml + zk_rollup_circuit_public_inputs_repr.mli + bond_id_repr.ml bond_id_repr.mli + vote_repr.ml vote_repr.mli + liquidity_baking_repr.ml liquidity_baking_repr.mli + block_header_repr.ml block_header_repr.mli + destination_repr.ml destination_repr.mli + script_int.ml script_int.mli + ticket_amount.ml ticket_amount.mli + operation_repr.ml operation_repr.mli + manager_repr.ml manager_repr.mli + commitment_repr.ml commitment_repr.mli + parameters_repr.ml parameters_repr.mli + sapling_repr.ml + lazy_storage_kind.ml lazy_storage_kind.mli + receipt_repr.ml receipt_repr.mli + migration_repr.ml migration_repr.mli + carbonated_map_costs.ml carbonated_map_costs.mli + carbonated_map.ml carbonated_map.mli + raw_context_intf.ml + raw_context.ml raw_context.mli + storage_costs.ml storage_costs.mli + storage_sigs.ml + storage_functors.ml storage_functors.mli + storage.ml storage.mli + ticket_hash_builder.ml ticket_hash_builder.mli + constants_storage.ml constants_storage.mli + tx_rollup_gas.ml tx_rollup_gas.mli + tx_rollup_hash_builder.ml + level_storage.ml level_storage.mli + nonce_storage.ml nonce_storage.mli + seed_storage.ml seed_storage.mli + contract_manager_storage.ml contract_manager_storage.mli + delegate_activation_storage.ml delegate_activation_storage.mli + frozen_deposits_storage.ml frozen_deposits_storage.mli + sapling_storage.ml + lazy_storage_diff.ml lazy_storage_diff.mli + commitment_storage.ml commitment_storage.mli + voting_period_storage.ml voting_period_storage.mli + cache_repr.ml cache_repr.mli + zk_rollup_storage.ml zk_rollup_storage.mli + contract_delegate_storage.ml contract_delegate_storage.mli + stake_storage.ml stake_storage.mli + contract_storage.ml contract_storage.mli + token.ml token.mli + fees_storage.ml fees_storage.mli + delegate_consensus_key.ml delegate_consensus_key.mli + delegate_storage.ml delegate_storage.mli + delegate_sampler.ml delegate_sampler.mli + delegate_missed_endorsements_storage.ml + delegate_missed_endorsements_storage.mli + delegate_slashed_deposits_storage.ml delegate_slashed_deposits_storage.mli + delegate_cycles.ml delegate_cycles.mli + bootstrap_storage.ml bootstrap_storage.mli + vote_storage.ml vote_storage.mli + ticket_storage.ml ticket_storage.mli + liquidity_baking_storage.ml liquidity_baking_storage.mli + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_migration.ml liquidity_baking_migration.mli + sc_rollup_errors.ml + sc_rollup_inbox_storage.ml sc_rollup_inbox_storage.mli + legacy_script_patches.ml + init_storage.ml init_storage.mli + sapling_validator.ml + global_constants_costs.ml global_constants_costs.mli + global_constants_storage.ml global_constants_storage.mli + tx_rollup_state_storage.ml tx_rollup_state_storage.mli + tx_rollup_reveal_storage.ml tx_rollup_reveal_storage.mli + tx_rollup_inbox_storage.ml tx_rollup_inbox_storage.mli + tx_rollup_commitment_storage.ml tx_rollup_commitment_storage.mli + tx_rollup_storage.ml tx_rollup_storage.mli + sc_rollup_commitment_storage.ml sc_rollup_commitment_storage.mli + sc_rollup_outbox_storage.ml sc_rollup_outbox_storage.mli + sc_rollup_stake_storage.ml sc_rollup_stake_storage.mli + sc_rollup_storage.ml sc_rollup_storage.mli + dal_slot_storage.ml dal_slot_storage.mli + sc_rollup_refutation_storage.ml sc_rollup_refutation_storage.mli + zk_rollup_errors.ml + alpha_context.ml alpha_context.mli + script_string.ml script_string.mli + script_timestamp.ml script_timestamp.mli + script_bytes.ml script_bytes.mli + tx_rollup_l2_storage_sig.ml + tx_rollup_l2_context_sig.ml + tx_rollup_l2_context.ml + tx_rollup_l2_batch.ml tx_rollup_l2_batch.mli + tx_rollup_l2_apply.ml tx_rollup_l2_apply.mli + tx_rollup_l2_verifier.ml tx_rollup_l2_verifier.mli + local_gas_counter.ml local_gas_counter.mli + script_tc_errors.ml + gas_monad.ml gas_monad.mli + script_ir_annot.ml script_ir_annot.mli + dependent_bool.ml dependent_bool.mli + script_list.ml script_list.mli + script_typed_ir.ml script_typed_ir.mli + script_comparable.ml script_comparable.mli + gas_comparable_input_size.ml gas_comparable_input_size.mli + script_set.ml script_set.mli + script_map.ml script_map.mli + gas_input_size.ml gas_input_size.mli + script_typed_ir_size.ml script_typed_ir_size.mli + script_typed_ir_size_costs.ml script_typed_ir_size_costs.mli + michelson_v1_gas_costs_generated.ml + michelson_v1_gas_costs.ml + michelson_v1_gas.ml michelson_v1_gas.mli + script_tc_context.ml script_tc_context.mli + ticket_token.ml ticket_token.mli + ticket_receipt.ml ticket_receipt.mli + apply_operation_result.ml apply_operation_result.mli + apply_internal_results.ml apply_internal_results.mli + apply_results.ml apply_results.mli + script_ir_translator_config.ml + script_ir_unparser.ml script_ir_unparser.mli + script_ir_translator.ml script_ir_translator.mli + script_big_map.ml script_big_map.mli + script_cache.ml script_cache.mli + script_tc_errors_registration.ml script_tc_errors_registration.mli + ticket_token_unparser.ml ticket_token_unparser.mli + ticket_costs.ml ticket_costs.mli + ticket_scanner.ml ticket_scanner.mli + ticket_balance_key.ml ticket_balance_key.mli + ticket_lazy_storage_diff.ml ticket_lazy_storage_diff.mli + tx_rollup_parameters.ml tx_rollup_parameters.mli + zk_rollup_parameters.ml zk_rollup_parameters.mli + ticket_token_map.ml ticket_token_map.mli + ticket_operations_diff.ml ticket_operations_diff.mli + ticket_accounting.ml ticket_accounting.mli + ticket_transfer.ml ticket_transfer.mli + script_interpreter_defs.ml + script_interpreter.ml script_interpreter.mli + sc_rollup_management_protocol.ml sc_rollup_management_protocol.mli + sc_rollup_operations.ml sc_rollup_operations.mli + dal_apply.ml dal_apply.mli + zk_rollup_apply.ml zk_rollup_apply.mli + baking.ml baking.mli + validate_errors.ml validate_errors.mli + amendment.ml amendment.mli + validate.ml validate.mli + mempool_validation.ml mempool_validation.mli + apply.ml apply.mli + services_registration.ml services_registration.mli + constants_services.ml constants_services.mli + sapling_services.ml + contract_services.ml contract_services.mli + delegate_services.ml delegate_services.mli + voting_services.ml voting_services.mli + tx_rollup_services.ml tx_rollup_services.mli + dal_services.ml dal_services.mli + alpha_services.ml alpha_services.mli + main.ml main.mli (:src_dir TEZOS_PROTOCOL)) + (action + (with-stdout-to + %{targets} + (chdir + %{workspace_root} + (run %{bin:octez-embedded-protocol-packer} %{src_dir} alpha))))) diff --git a/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.ml b/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.ml new file mode 100644 index 000000000000..7931a57a42c4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.ml @@ -0,0 +1,241 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Pre_entrypoint : sig + (** Invariants on the string: 1 <= length <= 31 *) + type t = private Non_empty_string.t + + val of_non_empty_string : Non_empty_string.t -> t option +end = struct + type t = Non_empty_string.t + + let of_non_empty_string (str : Non_empty_string.t) = + if Compare.Int.(String.length (str :> string) > 31) then None else Some str +end + +type t = Pre_entrypoint.t + +let compare (x : t) (y : t) = + Non_empty_string.compare (x :> Non_empty_string.t) (y :> Non_empty_string.t) + +let ( = ) (x : t) (y : t) = + Non_empty_string.( = ) (x :> Non_empty_string.t) (y :> Non_empty_string.t) + +type error += Name_too_long of string + +let () = + (* Entrypoint name too long *) + register_error_kind + `Permanent + ~id:"michelson_v1.entrypoint_name_too_long" + ~title:"Entrypoint name too long (type error)" + ~description: + "An entrypoint name exceeds the maximum length of 31 characters." + Data_encoding.(obj1 (req "name" @@ string Plain)) + (function Name_too_long entrypoint -> Some entrypoint | _ -> None) + (fun entrypoint -> Name_too_long entrypoint) + +type error += Unexpected_default of Script_repr.location + +let () = + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_default_entrypoint" + ~title: + "The annotation 'default' was encountered where an entrypoint is expected" + ~description: + "A node in the syntax tree was improperly annotated. An annotation used \ + to designate an entrypoint cannot be exactly 'default'." + Data_encoding.(obj1 (req "location" Script_repr.location_encoding)) + (function Unexpected_default loc -> Some loc | _ -> None) + (fun loc -> Unexpected_default loc) + +let default = + match + Pre_entrypoint.of_non_empty_string + @@ Non_empty_string.of_string_exn "default" + with + | None -> assert false + | Some res -> res + +let is_default name = name = default + +type of_string_result = + | Ok of t + | Too_long (** length > 31 *) + | Got_default + (** Got exactly "default", which can be an error in some cases or OK in others *) + +let of_non_empty_string (str : Non_empty_string.t) = + match Pre_entrypoint.of_non_empty_string str with + | None -> Too_long + | Some str -> if is_default str then Got_default else Ok str + +let of_string str = + match Non_empty_string.of_string str with + | None (* empty string *) -> + (* The empty string always means the default entrypoint *) + Ok default + | Some str -> of_non_empty_string str + +let of_string_strict ~loc str = + match of_string str with + | Too_long -> error (Name_too_long str) + | Got_default -> error (Unexpected_default loc) + | Ok name -> Ok name + +let of_string_strict' str = + match of_string str with + | Too_long -> Error "Entrypoint name too long" + | Got_default -> Error "Unexpected annotation: default" + | Ok name -> Ok name + +let of_string_strict_exn str = + match of_string_strict' str with Ok v -> v | Error err -> invalid_arg err + +let of_annot_strict ~loc a = + match of_non_empty_string a with + | Too_long -> error (Name_too_long (a :> string)) + | Got_default -> error (Unexpected_default loc) + | Ok name -> Ok name + +let of_annot_lax_opt a = + match of_non_empty_string a with + | Too_long -> None + | Got_default -> Some default + | Ok name -> Some name + +let of_string_lax_opt str = + match of_string str with + | Too_long -> None + | Got_default -> Some default + | Ok name -> Some name + +let of_string_lax str = + match of_string_lax_opt str with + | None -> error (Name_too_long str) + | Some name -> Ok name + +let of_annot_lax a = + match of_non_empty_string a with + | Too_long -> error (Name_too_long (a :> string)) + | Got_default -> Ok default + | Ok name -> Ok name + +let of_string_lax' str = + match of_string_lax_opt str with + | None -> Error ("Entrypoint name too long \"" ^ str ^ "\"") + | Some name -> Ok name + +let root = of_string_strict_exn "root" + +let do_ = of_string_strict_exn "do" + +let set_delegate = of_string_strict_exn "set_delegate" + +let remove_delegate = of_string_strict_exn "remove_delegate" + +let deposit = of_string_strict_exn "deposit" + +let is_deposit = ( = ) deposit + +let is_root = ( = ) root + +let to_non_empty_string (name : t) = (name :> Non_empty_string.t) + +let to_string (name : t) = (name :> string) + +let to_address_suffix (name : t) = + if is_default name then "" else "%" ^ (name :> string) + +let unparse_as_field_annot (name : t) = "%" ^ (name :> string) + +let of_string_lax_exn str = + match of_string_lax' str with Ok name -> name | Error err -> invalid_arg err + +let pp fmt (name : t) = Format.pp_print_string fmt (name :> string) + +let simple_encoding = + Data_encoding.conv_with_guard + (fun (name : t) -> (name :> string)) + of_string_lax' + Data_encoding.(string Plain) + +let value_encoding = + Data_encoding.conv_with_guard + (fun name -> if is_default name then "" else (name :> string)) + of_string_strict' + Data_encoding.Variable.(string Plain) + +let smart_encoding = + let open Data_encoding in + def + ~title:"entrypoint" + ~description:"Named entrypoint to a Michelson smart contract" + "entrypoint" + @@ + let builtin_case tag (name : Pre_entrypoint.t) = + case + (Tag tag) + ~title:(name :> string) + (constant (name :> string)) + (fun n -> if n = name then Some () else None) + (fun () -> name) + in + union + [ + builtin_case 0 default; + builtin_case 1 root; + builtin_case 2 do_; + builtin_case 3 set_delegate; + builtin_case 4 remove_delegate; + builtin_case 5 deposit; + case + (Tag 255) + ~title:"named" + (Bounded.string Plain 31) + (fun (name : Pre_entrypoint.t) -> Some (name :> string)) + of_string_lax_exn; + ] + +let rpc_arg = + RPC_arg.make + ~descr:"A Michelson entrypoint (string of length < 32)" + ~name:"entrypoint" + ~construct:(fun (name : t) -> (name :> string)) + ~destruct:of_string_lax' + () + +let in_memory_size (name : t) = + Cache_memory_helpers.string_size_gen (String.length (name :> string)) + +module T = struct + type nonrec t = t + + let compare = compare +end + +module Set = Set.Make (T) +module Map = Map.Make (T) diff --git a/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.mli b/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.mli new file mode 100644 index 000000000000..cef8b2a63f21 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/entrypoint_repr.mli @@ -0,0 +1,137 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** An entrypoint is a non-empty string of at most 31 characters *) +type t + +(** Total ordering of entrypoints *) +val compare : t -> t -> int + +(** Equality of entrypoints *) +val ( = ) : t -> t -> bool + +(** Default entrypoint "default" *) +val default : t + +(** Checks whether an entrypoint is the default entrypoint *) +val is_default : t -> bool + +(** Root entrypoint "root" *) +val root : t + +(** Checks whether an entrypoint is the root entrypoint *) +val is_root : t -> bool + +(** Entrypoint "do" *) +val do_ : t + +(** Entrypoint "set_delegate" *) +val set_delegate : t + +(** Entrypoint "remove_delegate" *) +val remove_delegate : t + +(** Deposit entrypoint "deposit" *) +val deposit : t + +(** Checks whether an entrypoint is the deposit entrypoint *) +val is_deposit : t -> bool + +(** Converts an annot to an entrypoint. + Returns an error if the string is too long or is "default". *) +val of_annot_strict : + loc:Script_repr.location -> Non_empty_string.t -> t tzresult + +(** Converts a string to an entrypoint. + Returns an error if the string is too long or is "default". + Converts "" to "default". *) +val of_string_strict : loc:Script_repr.location -> string -> t tzresult + +(** Converts a string to an entrypoint. + Fails with [Invalid_arg] if the string is too long or is "default". + Converts "" to "default". *) +val of_string_strict_exn : string -> t + +(** Converts an annot to an entrypoint. + Returns an error if the string is too long. + Accepts "default". *) +val of_annot_lax : Non_empty_string.t -> t tzresult + +(** Converts an annot to an entrypoint. + Returns [None] if the string is too long. + Accepts "default". *) +val of_annot_lax_opt : Non_empty_string.t -> t option + +(** Converts a string to an entrypoint. + Returns an error if the string is too long. + Accepts "default" and converts "" to "default". *) +val of_string_lax : string -> t tzresult + +(** Converts an entrypoint to a non-empty string. + "default" is kept as is. *) +val to_non_empty_string : t -> Non_empty_string.t + +(** Converts an entrypoint to a string. + "default" is kept as is. *) +val to_string : t -> string + +(** Converts an entrypoint to a string used as an address suffix. + For the default entrypoint, the result is the empty string. + Otherwise it is "%" followed by the entrypoint. *) +val to_address_suffix : t -> string + +(** Converts an entrypoint to a string used as a field annotation of a + parameter union type. It is "%" followed by the entrypoint. + The default entrypoint is converted to "%default". *) +val unparse_as_field_annot : t -> string + +(** Pretty-print an entrypoint *) +val pp : Format.formatter -> t -> unit + +(** An encoding of entrypoints reusing the lax semantics. + Decoding fails if the string is too long. "" is decoded into "default". + "default" is encoded into "default". *) +val simple_encoding : t Data_encoding.t + +(** An encoding of entrypoints reusing the strict semantics. + Decoding fails if the string is too long or is "default". + "" is decoded into "default". + "default" is encoded into "". *) +val value_encoding : t Data_encoding.t + +(** An optimized encoding of entrypoints, used for operations. *) +val smart_encoding : t Data_encoding.t + +(** Entrypoint RPC arg. *) +val rpc_arg : t RPC_arg.t + +(** In-memory size of an entrypoint *) +val in_memory_size : t -> Saturation_repr.may_saturate Saturation_repr.t + +(** Set of entrypoints *) +module Set : Set.S with type elt = t + +(** Map of entrypoints *) +module Map : Map.S with type key = t diff --git a/src/proto_016_PtMumbai/lib_protocol/fees_storage.ml b/src/proto_016_PtMumbai/lib_protocol/fees_storage.ml new file mode 100644 index 000000000000..fd345d65b4e4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fees_storage.ml @@ -0,0 +1,159 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Cannot_pay_storage_fee (* `Temporary *) + +type error += Negative_storage_input (* `Temporary *) + +type error += Operation_quota_exceeded (* `Temporary *) + +type error += Storage_limit_too_high (* `Permanent *) + +let () = + let open Data_encoding in + register_error_kind + `Temporary + ~id:"contract.cannot_pay_storage_fee" + ~title:"Cannot pay storage fee" + ~description:"The storage fee is higher than the contract balance" + ~pp:(fun ppf () -> Format.fprintf ppf "Cannot pay storage fee") + Data_encoding.empty + (function Cannot_pay_storage_fee -> Some () | _ -> None) + (fun () -> Cannot_pay_storage_fee) ; + register_error_kind + `Temporary + ~id:"contract.negative_storage_input" + ~title:"Negative storage input" + ~description:"The storage amount asked for an operation is null or negative" + ~pp:(fun ppf () -> Format.fprintf ppf "Null or negative storage input") + Data_encoding.empty + (function Negative_storage_input -> Some () | _ -> None) + (fun () -> Negative_storage_input) ; + register_error_kind + `Temporary + ~id:"storage_exhausted.operation" + ~title:"Storage quota exceeded for the operation" + ~description: + "A script or one of its callee wrote more bytes than the operation said \ + it would" + Data_encoding.empty + (function Operation_quota_exceeded -> Some () | _ -> None) + (fun () -> Operation_quota_exceeded) ; + register_error_kind + `Permanent + ~id:"storage_limit_too_high" + ~title:"Storage limit out of protocol hard bounds" + ~description:"A transaction tried to exceed the hard limit on storage" + empty + (function Storage_limit_too_high -> Some () | _ -> None) + (fun () -> Storage_limit_too_high) + +let record_global_constant_storage_space context size = + (* Following the precedent of big_map, a key in the + global table of constants costs 65 bytes (see + [Lazy_storage_diff.Big_map.bytes_size_for_big_map_key])*) + let cost_of_key = Z.of_int 65 in + let to_be_paid = Z.add size cost_of_key in + (context, to_be_paid) + +let record_paid_storage_space ctxt contract_hash = + let contract = Contract_repr.Originated contract_hash in + (* Get the new size of the contract's storage. *) + Contract_storage.used_storage_space ctxt contract >>=? fun new_storage_size -> + Contract_storage.set_paid_storage_space_and_return_fees_to_pay + ctxt + contract + new_storage_size + >>=? fun (to_be_paid, c) -> return (c, new_storage_size, to_be_paid) + +let source_must_exist c src = + match src with + | `Contract src -> Contract_storage.must_exist c src + | _ -> return_unit + +let burn_storage_fees ?(origin = Receipt_repr.Block_application) c + ~storage_limit ~payer consumed = + let remaining = Z.sub storage_limit consumed in + if Compare.Z.(remaining < Z.zero) then tzfail Operation_quota_exceeded + else + let cost_per_byte = Constants_storage.cost_per_byte c in + Tez_repr.(cost_per_byte *? Z.to_int64 consumed) >>?= fun to_burn -> + (* Burning the fees... *) + if Tez_repr.(to_burn = Tez_repr.zero) then + (* If the payer was deleted by transferring all its balance, and no space + was used, burning zero would fail *) + return (c, remaining, []) + else + trace + Cannot_pay_storage_fee + ( source_must_exist c payer >>=? fun () -> + Token.transfer ~origin c payer `Storage_fees to_burn + >>=? fun (ctxt, balance_updates) -> + return (ctxt, remaining, balance_updates) ) + +let burn_storage_increase_fees ?(origin = Receipt_repr.Block_application) c + ~payer amount_in_bytes = + if Compare.Z.(amount_in_bytes <= Z.zero) then tzfail Negative_storage_input + else + let cost_per_byte = Constants_storage.cost_per_byte c in + Tez_repr.(cost_per_byte *? Z.to_int64 amount_in_bytes) >>?= fun to_burn -> + (* Burning the fees... *) + trace + Cannot_pay_storage_fee + ( source_must_exist c payer >>=? fun () -> + Token.transfer ~origin c payer `Storage_fees to_burn ) + +let burn_origination_fees ?(origin = Receipt_repr.Block_application) c + ~storage_limit ~payer = + let origination_size = Constants_storage.origination_size c in + burn_storage_fees ~origin c ~storage_limit ~payer (Z.of_int origination_size) + +let burn_tx_rollup_origination_fees ?(origin = Receipt_repr.Block_application) c + ~storage_limit ~payer = + let tx_rollup_origination_size = + Constants_storage.tx_rollup_origination_size c + in + burn_storage_fees + ~origin + c + ~storage_limit + ~payer + (Z.of_int tx_rollup_origination_size) + +let burn_sc_rollup_origination_fees ?(origin = Receipt_repr.Block_application) c + ~storage_limit ~payer consumed = + burn_storage_fees ~origin c ~storage_limit ~payer consumed + +let burn_zk_rollup_origination_fees ?(origin = Receipt_repr.Block_application) c + ~storage_limit ~payer consumed = + burn_storage_fees ~origin c ~storage_limit ~payer consumed + +let check_storage_limit c ~storage_limit = + if + Compare.Z.( + storage_limit > (Raw_context.constants c).hard_storage_limit_per_operation) + || Compare.Z.(storage_limit < Z.zero) + then error Storage_limit_too_high + else Result.return_unit diff --git a/src/proto_016_PtMumbai/lib_protocol/fees_storage.mli b/src/proto_016_PtMumbai/lib_protocol/fees_storage.mli new file mode 100644 index 000000000000..78a13395d977 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fees_storage.mli @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Cannot_pay_storage_fee (* `Temporary *) + +type error += Negative_storage_input (* `Temporary *) + +type error += Operation_quota_exceeded (* `Temporary *) + +type error += Storage_limit_too_high (* `Permanent *) + +(** [record_global_constant_storage_space ctxt size] records + paid storage space for registering a new global constant. + Cost is <size> in bytes + 65 additional bytes for the key + hash of the expression. Returns new context and the cost. +*) +val record_global_constant_storage_space : + Raw_context.t -> Z.t -> Raw_context.t * Z.t + +(** [record_paid_storage_space ctxt contract] updates the amount of + storage consumed by the [contract]. This total size is considered + as accounted for as far as future payment is concerned. + + Returns a new context, the total space consumed by the [contract], + and the additional (and unpaid) space consumed since the last call + of this function on this [contract]. *) +val record_paid_storage_space : + Raw_context.t -> Contract_hash.t -> (Raw_context.t * Z.t * Z.t) tzresult Lwt.t + +(** [check_storage_limit ctxt ~storage_limit] raises the [Storage_limit_too_high] + error iff [storage_limit] is negative or greater the constant + [hard_storage_limit_per_operation]. *) +val check_storage_limit : Raw_context.t -> storage_limit:Z.t -> unit tzresult + +(** [burn_storage_fees ctxt ~storage_limit ~payer consumed] takes funds from the + [payer] to pay the cost of the [consumed] storage. This function has an + optional parameter [~origin] that allows to set the origin of returned + balance updates (by default the parameter is set to [Block_application]). + Returns an updated context, an updated storage limit equal to + [storage_limit - consumed], and the relevant balance updates. + Raises the [Operation_quota_exceeded] error if [storage_limit < consumed]. + Raises the [Cannot_pay_storage_fee] error if the funds from the [payer] are + not sufficient to pay the storage fees. *) +val burn_storage_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (Raw_context.t * Z.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** [burn_storage_increase_fees ctxt ~payer amount_in_bytes] takes funds from the + [payer] to pay the cost of the [amount_in_bytes] storage. This function has an + optional parameter [~origin] that allows to set the origin of returned + balance updates (by default the parameter is set to [Block_application]). + Returns an updated context and the relevant balance updates. + Raises the [Negative_storage_input] error if the amount_in_bytes is null or negative. + Raises the [Cannot_pay_storage_fee] error if the funds from the [payer] are + not sufficient to pay the storage fees. *) +val burn_storage_increase_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + payer:Token.source -> + Z.t -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** Calls [burn_storage_fees] with the parameter [consumed] mapped to the + constant [origination_size]. *) +val burn_origination_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + storage_limit:Z.t -> + payer:Token.source -> + (Raw_context.t * Z.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** Calls [burn_storage_fees] with the parameter [consumed] mapped to the + constant [tx_rollup_origination_size]. *) +val burn_tx_rollup_origination_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + storage_limit:Z.t -> + payer:Token.source -> + (Raw_context.t * Z.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** [burn_sc_rollup_origination_fees ~origin ctxt ~storage_limit ~payer consumed] + burns the storage fees for smart contract rollup creation fees. *) +val burn_sc_rollup_origination_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (Raw_context.t * Z.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** [burn_zk_rollup_origination_fees ~origin ctxt ~storage_limit ~payer consumed] + burns the storage fees for ZK rollup origination fees. *) +val burn_zk_rollup_origination_fees : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + storage_limit:Z.t -> + payer:Token.source -> + Z.t -> + (Raw_context.t * Z.t * Receipt_repr.balance_updates) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/fitness_repr.ml b/src/proto_016_PtMumbai/lib_protocol/fitness_repr.ml new file mode 100644 index 000000000000..8abc162cf542 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fitness_repr.ml @@ -0,0 +1,289 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + level : Raw_level_repr.t; + locked_round : Round_repr.t option; + predecessor_round : Round_repr.t; + (* by convention, predecessor_round is 0 in case of protocol migration *) + round : Round_repr.t; +} + +let encoding = + let open Data_encoding in + def + "fitness" + (conv_with_guard + (fun {level; locked_round; predecessor_round; round} -> + (level, locked_round, predecessor_round, round)) + (fun (level, locked_round, predecessor_round, round) -> + match locked_round with + | None -> ok {level; locked_round; predecessor_round; round} + | Some locked_round_val -> + if Round_repr.(round <= locked_round_val) then + Error "Locked round must be smaller than round." + else ok {level; locked_round; predecessor_round; round}) + (obj4 + (req "level" Raw_level_repr.encoding) + (req "locked_round" (option Round_repr.encoding)) + (req "predecessor_round" Round_repr.encoding) + (req "round" Round_repr.encoding))) + +let pp ppf f = + let minus_sign = + if Round_repr.(f.predecessor_round = Round_repr.zero) then "" else "-" + in + let locked_round ppf locked_round = + match locked_round with + | None -> Format.pp_print_string ppf "unlocked" + | Some round -> Format.fprintf ppf "locked: %a" Round_repr.pp round + in + Format.fprintf + ppf + "(%a, %a, %s%a, %a)" + Raw_level_repr.pp + f.level + locked_round + f.locked_round + minus_sign + Round_repr.pp + f.predecessor_round + Round_repr.pp + f.round + +type error += + | (* `Permanent *) Invalid_fitness + | (* `Permanent *) Wrong_fitness + | (* `Permanent *) Outdated_fitness + | (* `Permanent *) + Locked_round_not_less_than_round of { + round : Round_repr.t; + locked_round : Round_repr.t; + } + +let () = + register_error_kind + `Permanent + ~id:"invalid_fitness" + ~title:"Invalid fitness" + ~description: + "Fitness representation should be exactly 4 times 4 bytes long." + ~pp:(fun ppf () -> Format.fprintf ppf "Invalid fitness") + Data_encoding.empty + (function Invalid_fitness -> Some () | _ -> None) + (fun () -> Invalid_fitness) ; + register_error_kind + `Permanent + ~id:"wrong_fitness" + ~title:"Wrong fitness" + ~description:"Wrong fitness." + ~pp:(fun ppf () -> Format.fprintf ppf "Wrong fitness.") + Data_encoding.empty + (function Wrong_fitness -> Some () | _ -> None) + (fun () -> Wrong_fitness) ; + register_error_kind + `Permanent + ~id:"outdated_fitness" + ~title:"Outdated fitness" + ~description:"Outdated fitness: referring to a previous version" + ~pp:(fun ppf () -> + Format.fprintf ppf "Outdated fitness: referring to a previous version.") + Data_encoding.empty + (function Outdated_fitness -> Some () | _ -> None) + (fun () -> Outdated_fitness) ; + register_error_kind + `Permanent + ~id:"locked_round_not_less_than_round" + ~title:"Locked round not smaller than round" + ~description:"The round is smaller than or equal to the locked round." + ~pp:(fun ppf (round, locked_round) -> + Format.fprintf + ppf + "Incorrect fitness: round %a is less than or equal to locked round %a." + Round_repr.pp + round + Round_repr.pp + locked_round) + Data_encoding.( + obj2 + (req "round" Round_repr.encoding) + (req "locked_round" Round_repr.encoding)) + (function + | Locked_round_not_less_than_round {round; locked_round} -> + Some (round, locked_round) + | _ -> None) + (fun (round, locked_round) -> + Locked_round_not_less_than_round {round; locked_round}) + +let create_without_locked_round ~level ~predecessor_round ~round = + {level; locked_round = None; predecessor_round; round} + +let create ~level ~locked_round ~predecessor_round ~round = + match locked_round with + | None -> ok {level; locked_round; predecessor_round; round} + | Some locked_round_val -> + error_when + Round_repr.(round <= locked_round_val) + (Locked_round_not_less_than_round + {round; locked_round = locked_round_val}) + >>? fun () -> ok {level; locked_round; predecessor_round; round} + +let int32_to_bytes i = + let b = Bytes.make 4 '\000' in + TzEndian.set_int32 b 0 i ; + b + +let int32_of_bytes b = + if Compare.Int.(Bytes.length b <> 4) then error Invalid_fitness + else ok (TzEndian.get_int32 b 0) + +(* Locked round is an option. And we want None to be smaller than any other + value. The way the shell handles the order makes the empty Bytes smaller + than any other *) +let locked_round_to_bytes = function + | None -> Bytes.empty + | Some locked_round -> int32_to_bytes (Round_repr.to_int32 locked_round) + +let locked_round_of_bytes b = + match Bytes.length b with + | 0 -> ok None + | 4 -> Round_repr.of_int32 (TzEndian.get_int32 b 0) >>? fun r -> ok (Some r) + | _ -> error Invalid_fitness + +let predecessor_round_of_bytes neg_predecessor_round = + int32_of_bytes neg_predecessor_round >>? fun neg_predecessor_round -> + Round_repr.of_int32 @@ Int32.pred (Int32.neg neg_predecessor_round) + +let round_of_bytes round = int32_of_bytes round >>? Round_repr.of_int32 + +let to_raw {level; locked_round; predecessor_round; round} = + [ + Bytes.of_string Constants_repr.fitness_version_number; + int32_to_bytes (Raw_level_repr.to_int32 level); + locked_round_to_bytes locked_round; + int32_to_bytes + (Int32.pred (Int32.neg (Round_repr.to_int32 predecessor_round))); + int32_to_bytes (Round_repr.to_int32 round); + ] + +let from_raw = function + | [version; level; locked_round; neg_predecessor_round; round] + when Compare.String.( + Bytes.to_string version = Constants_repr.fitness_version_number) -> + int32_of_bytes level >>? Raw_level_repr.of_int32 >>? fun level -> + locked_round_of_bytes locked_round >>? fun locked_round -> + predecessor_round_of_bytes neg_predecessor_round + >>? fun predecessor_round -> + round_of_bytes round >>? fun round -> + create ~level ~locked_round ~predecessor_round ~round + | [version; _] + when Compare.String.( + Bytes.to_string version < Constants_repr.fitness_version_number) -> + error Outdated_fitness + | [] (* genesis fitness *) -> error Outdated_fitness + | _ -> error Invalid_fitness + +let round_from_raw = function + | [version; _level; _locked_round; _neg_predecessor_round; round] + when Compare.String.( + Bytes.to_string version = Constants_repr.fitness_version_number) -> + round_of_bytes round + | [version; _] + when Compare.String.( + Bytes.to_string version < Constants_repr.fitness_version_number) -> + ok Round_repr.zero + | [] (* genesis fitness *) -> ok Round_repr.zero + | _ -> error Invalid_fitness + +let predecessor_round_from_raw = function + | [version; _level; _locked_round; neg_predecessor_round; _round] + when Compare.String.( + Bytes.to_string version = Constants_repr.fitness_version_number) -> + predecessor_round_of_bytes neg_predecessor_round + | [version; _] + when Compare.String.( + Bytes.to_string version < Constants_repr.fitness_version_number) -> + ok Round_repr.zero + | [] (* genesis fitness *) -> ok Round_repr.zero + | _ -> error Invalid_fitness + +let check_except_locked_round fitness ~level ~predecessor_round = + let { + level = expected_level; + locked_round = _; + predecessor_round = expected_predecessor_round; + round = _; + } = + fitness + in + let correct = + Raw_level_repr.(level = expected_level) + && Round_repr.(predecessor_round = expected_predecessor_round) + in + error_unless correct Wrong_fitness + +let check_locked_round fitness ~locked_round = + let { + level = _; + locked_round = expected_locked_round; + predecessor_round = _; + round = _; + } = + fitness + in + let correct = + match (locked_round, expected_locked_round) with + | None, None -> true + | Some _, None | None, Some _ -> false + | Some v, Some v' -> Round_repr.(v = v') + in + error_unless correct Wrong_fitness + +let level fitness = fitness.level + +let round fitness = fitness.round + +let locked_round fitness = fitness.locked_round + +let predecessor_round fitness = fitness.predecessor_round + +module Internal_for_tests = struct + module ListInt32Compare = Compare.List (Compare.Int32) + + let compare f ff = + let unopt l = + match l with Some l -> Round_repr.to_int32 l | None -> -1l + in + let to_list {level; locked_round; predecessor_round; round} = + Int32. + [ + Raw_level_repr.to_int32 level; + unopt locked_round; + neg (Round_repr.to_int32 predecessor_round); + Round_repr.to_int32 round; + ] + in + ListInt32Compare.compare (to_list f) (to_list ff) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/fitness_repr.mli b/src/proto_016_PtMumbai/lib_protocol/fitness_repr.mli new file mode 100644 index 000000000000..7a3ebaa8afe4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fitness_repr.mli @@ -0,0 +1,96 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Permanent *) Invalid_fitness + | (* `Permanent *) Wrong_fitness + | (* `Permanent *) Outdated_fitness + | (* `Permanent *) + Locked_round_not_less_than_round of { + round : Round_repr.t; + locked_round : Round_repr.t; + } + +type t + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +val create : + level:Raw_level_repr.t -> + locked_round:Round_repr.t option -> + predecessor_round:Round_repr.t -> + round:Round_repr.t -> + t tzresult + +val create_without_locked_round : + level:Raw_level_repr.t -> + predecessor_round:Round_repr.t -> + round:Round_repr.t -> + t + +val to_raw : t -> Fitness.t + +(** Returns the corresponding protocol fitness if the shell fitness has + the expected version, given by + Constants_repr.fitness_version_number. If the fitness' version is + from a previous protocol version, then it raises an "outdated + fitness" error. If the fitness version is higher then + it raises an "invalid fitness" error. *) +val from_raw : Fitness.t -> t tzresult + +(** Returns the round from a raw fitness. If the fitness is from a + previous protocol, the returned value will be Round.zero. *) +val round_from_raw : Fitness.t -> Round_repr.t tzresult + +(** Returns the predecessor round from a raw fitness. If the fitness + is from a previous protocol, the returned value will be Round.zero. *) +val predecessor_round_from_raw : Fitness.t -> Round_repr.t tzresult + +(** Validate only the part of the fitness for which information are + available during begin_application *) +val check_except_locked_round : + t -> level:Raw_level_repr.t -> predecessor_round:Round_repr.t -> unit tzresult + +(** Validate the locked_round component of the fitness, which could + not be validated during begin_application. *) +val check_locked_round : t -> locked_round:Round_repr.t option -> unit tzresult + +val level : t -> Raw_level_repr.t + +val round : t -> Round_repr.t + +val locked_round : t -> Round_repr.t option + +val predecessor_round : t -> Round_repr.t + +(**/**) + +module Internal_for_tests : sig + (** uses a lexicographic order relation for [level, locked_round, + -predecessor_round, round] *) + val compare : t -> t -> int +end diff --git a/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.ml b/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.ml new file mode 100644 index 000000000000..079c86443109 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.ml @@ -0,0 +1,94 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type fp_tag (* Tag for fixed point computations *) + +type integral_tag (* Tag for integral computations *) + +module type Safe = sig + type 'a t + + type fp = fp_tag t + + type integral = integral_tag t + + val integral_exn : Z.t -> integral + + val integral_of_int_exn : int -> integral + + val integral_to_z : integral -> Z.t + + val zero : 'a t + + val add : 'a t -> 'a t -> 'a t + + val sub : 'a t -> 'a t -> 'a t + + val ceil : fp -> integral + + val floor : fp -> integral + + val fp : 'a t -> fp + + val ( = ) : 'a t -> 'b t -> bool + + val ( <> ) : 'a t -> 'b t -> bool + + val ( < ) : 'a t -> 'b t -> bool + + val ( <= ) : 'a t -> 'b t -> bool + + val ( >= ) : 'a t -> 'b t -> bool + + val ( > ) : 'a t -> 'b t -> bool + + val compare : 'a t -> 'b t -> int + + val equal : 'a t -> 'b t -> bool + + val max : 'a t -> 'a t -> 'a t + + val min : 'a t -> 'a t -> 'a t + + val pp : Format.formatter -> 'a t -> unit + + val pp_integral : Format.formatter -> integral -> unit + + val n_fp_encoding : fp Data_encoding.t + + val n_integral_encoding : integral Data_encoding.t + + val z_fp_encoding : fp Data_encoding.t + + val z_integral_encoding : integral Data_encoding.t +end + +module type Full = sig + type 'a t + + include Safe with type 'a t := 'a t + + val unsafe_fp : Z.t -> fp +end diff --git a/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.mli b/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.mli new file mode 100644 index 000000000000..a5f513fe4dbe --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/fixed_point_repr.mli @@ -0,0 +1,105 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines a standard signature for modules providing fixed-point + arithmetic. *) + +type fp_tag (* Tag for fixed point computations *) + +type integral_tag (* Tag for integral computations *) + +(** A signature for modules implementing a fixed-point arithmetic. + + Fixed-point types come in two flavours: + - integral (marked with [integral_tag]), behaving like integers; + - fp (marked with [fp_tag]), allowing for fractions. + + Such numbers represent standard arithmetic, rounding (converting fp + flavour to integral one) and comparisons (which can work across flavours). *) +module type Safe = sig + type 'a t + + type fp = fp_tag t + + type integral = integral_tag t + + val integral_exn : Z.t -> integral + + val integral_of_int_exn : int -> integral + + val integral_to_z : integral -> Z.t + + val zero : 'a t + + val add : 'a t -> 'a t -> 'a t + + val sub : 'a t -> 'a t -> 'a t + + val ceil : fp -> integral + + val floor : fp -> integral + + val fp : 'a t -> fp + + val ( = ) : 'a t -> 'b t -> bool + + val ( <> ) : 'a t -> 'b t -> bool + + val ( < ) : 'a t -> 'b t -> bool + + val ( <= ) : 'a t -> 'b t -> bool + + val ( >= ) : 'a t -> 'b t -> bool + + val ( > ) : 'a t -> 'b t -> bool + + val compare : 'a t -> 'b t -> int + + val equal : 'a t -> 'b t -> bool + + val max : 'a t -> 'a t -> 'a t + + val min : 'a t -> 'a t -> 'a t + + val pp : Format.formatter -> 'a t -> unit + + val pp_integral : Format.formatter -> integral -> unit + + val n_fp_encoding : fp Data_encoding.t + + val n_integral_encoding : integral Data_encoding.t + + val z_fp_encoding : fp Data_encoding.t + + val z_integral_encoding : integral Data_encoding.t +end + +module type Full = sig + type 'a t + + include Safe with type 'a t := 'a t + + val unsafe_fp : Z.t -> fp +end diff --git a/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.ml b/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.ml new file mode 100644 index 000000000000..7dc89b2e24f3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.ml @@ -0,0 +1,58 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let init ctxt delegate = + Storage.Contract.Frozen_deposits.init + ctxt + (Contract_repr.Implicit delegate) + {initial_amount = Tez_repr.zero; current_amount = Tez_repr.zero} + +let allocated = Storage.Contract.Frozen_deposits.mem + +let get = Storage.Contract.Frozen_deposits.get + +let find = Storage.Contract.Frozen_deposits.find + +let update_balance ctxt delegate f amount = + let delegate_contract = Contract_repr.Implicit delegate in + get ctxt delegate_contract >>=? fun frozen_deposits -> + f frozen_deposits.current_amount amount >>?= fun new_amount -> + Storage.Contract.Frozen_deposits.update + ctxt + delegate_contract + {frozen_deposits with current_amount = new_amount} + +let credit_only_call_from_token ctxt delegate amount = + update_balance ctxt delegate Tez_repr.( +? ) amount + +let spend_only_call_from_token ctxt delegate amount = + update_balance ctxt delegate Tez_repr.( -? ) amount + +let update_initial_amount ctxt delegate_contract deposits_cap = + get ctxt delegate_contract >>=? fun frozen_deposits -> + Storage.Contract.Frozen_deposits.update + ctxt + delegate_contract + {frozen_deposits with initial_amount = deposits_cap} diff --git a/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.mli b/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.mli new file mode 100644 index 000000000000..d59f705a3ded --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/frozen_deposits_storage.mli @@ -0,0 +1,71 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Simple abstraction from low-level storage to handle frozen deposits. + + This module is responsible for maintaining the + {!Storage.Contract.Frozen_deposits} table. *) + +(** [init ctxt delegate] returns a new context from [ctxt] where the frozen + deposits of the implicit contract represented by [delegate] have been initialized to + {!val:Tez_repr.zero}. *) +val init : + Raw_context.t -> Signature.Public_key_hash.t -> Raw_context.t tzresult Lwt.t + +(** [allocated ctxt contract] checks whether [contract] has frozen deposits in + [ctxt]. *) +val allocated : Raw_context.t -> Contract_repr.t -> bool Lwt.t + +(** [get ctxt contract] retrieves the frozen deposits of [contract] in [ctxt]. *) +val get : Raw_context.t -> Contract_repr.t -> Storage.deposits tzresult Lwt.t + +(** [find ctxt contract] retrieves the frozen deposits of [contract] in + [ctxt], if any. *) +val find : + Raw_context.t -> Contract_repr.t -> Storage.deposits option tzresult Lwt.t + +(** [credit_only_call_from_token ctxt delegate tez] returns a new context from + [ctxt] where the amount of frozen deposits for the implicit contract + represented by [delegate] increases by [tez]. *) +val credit_only_call_from_token : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [spend_only_call_from_token ctxt delegate tez] returns a new context from + [ctxt] where the amount of frozen deposits for the implicit contract + represented by [delegate] decreases by [tez].*) +val spend_only_call_from_token : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [update_initial_amount ctxt contract tez] returns a new context from [ctxt] + where the initial_amount of the frozen deposits for [contract] is set to + [tez]. *) +val update_initial_amount : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.ml b/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.ml new file mode 100644 index 000000000000..4a5cb467e4dc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.ml @@ -0,0 +1,141 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = int + +type micheline_size = {traversal : t; int_bytes : t; string_bytes : t} + +(* ------------------------------------------------------------------------- *) +(* encoding *) + +let encoding : t Data_encoding.encoding = + let open Data_encoding in + conv (fun i -> Int64.of_int i) (fun l -> Int64.to_int l) int64 + +let micheline_size_encoding : micheline_size Data_encoding.encoding = + let open Data_encoding in + conv + (fun {traversal; int_bytes; string_bytes} -> + (traversal, int_bytes, string_bytes)) + (fun (traversal, int_bytes, string_bytes) -> + {traversal; int_bytes; string_bytes}) + (tup3 encoding encoding encoding) + +(* ------------------------------------------------------------------------- *) + +let zero = 0 + +let add = ( + ) + +let pp = Format.pp_print_int + +let pp_micheline_size fmtr {traversal; int_bytes; string_bytes} = + Format.fprintf + fmtr + "@[{ traversal = %a;@; int_bytes = %a;@; string_bytes = %a;@,}@]" + pp + traversal + pp + int_bytes + pp + string_bytes + +let to_int x = x + +let of_int x = x + +let unit : t = 1 + +let integer (i : 'a Script_int.num) : t = Z.numbits (Script_int.to_zint i) / 8 + +let string = String.length + +let script_string = Script_string.length + +let bytes (b : Bytes.t) : t = Bytes.length b + +let mutez (_tez : Alpha_context.Tez.tez) : t = + (* Up to now, mutez are stored on 8 bytes (int64). *) + 8 + +let bool (_ : bool) : t = 1 + +let signature (signature : Script_typed_ir.Script_signature.t) : t = + Script_typed_ir.Script_signature.size signature + +let key_hash (_keyhash : Signature.public_key_hash) : t = + Signature.Public_key_hash.size + +let public_key (public_key : Signature.public_key) : t = + Signature.Public_key.size public_key + +let chain_id (_chain_id : Script_typed_ir.Script_chain_id.t) : t = + Script_typed_ir.Script_chain_id.size + +let address (addr : Script_typed_ir.address) : t = + let entrypoint = addr.entrypoint in + Signature.Public_key_hash.size + + String.length (Alpha_context.Entrypoint.to_string entrypoint) + +let tx_rollup_l2_address x = + Tx_rollup_l2_address.Indexable.size @@ Indexable.forget x + +let timestamp (tstamp : Script_timestamp.t) : t = + Z.numbits (Script_timestamp.to_zint tstamp) / 8 + +let rec size_of_comparable_value : + type a. a Script_typed_ir.comparable_ty -> a -> t = + fun (type a) (wit : a Script_typed_ir.comparable_ty) (v : a) -> + match wit with + | Never_t -> ( match v with _ -> .) + | Unit_t -> unit + | Int_t -> integer v + | Nat_t -> integer v + | String_t -> script_string v + | Bytes_t -> bytes v + | Mutez_t -> mutez v + | Bool_t -> bool v + | Key_hash_t -> key_hash v + | Timestamp_t -> timestamp v + | Address_t -> address v + | Tx_rollup_l2_address_t -> tx_rollup_l2_address v + | Pair_t (leaf, node, _, YesYes) -> + let lv, rv = v in + let size = + size_of_comparable_value leaf lv + size_of_comparable_value node rv + in + size + 1 + | Union_t (left, right, _, YesYes) -> + let size = + match v with + | L v -> size_of_comparable_value left v + | R v -> size_of_comparable_value right v + in + size + 1 + | Option_t (ty, _, Yes) -> ( + match v with None -> 1 | Some x -> size_of_comparable_value ty x + 1) + | Signature_t -> signature v + | Key_t -> public_key v + | Chain_id_t -> chain_id v diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.mli b/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.mli new file mode 100644 index 000000000000..85c1dfbb5825 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_comparable_input_size.mli @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [Gas_input_size] includes the definitions for the different sizes used + in the gas models of the protocol. They do not always represent memory + sizes, but rather they can be seen as an information size. They are + tailored to the models that use them, and should not be used for anything + other than gas computation. + + [Gas_comparable_input_size] is the restriction of [Gas_input_size] to + comparable types. + *) + +type t = int + +type micheline_size = {traversal : t; int_bytes : t; string_bytes : t} + +(* ------------------------------------------------------------------------- *) +(* encoding *) + +val encoding : t Data_encoding.encoding + +val micheline_size_encoding : micheline_size Data_encoding.encoding + +(* ------------------------------------------------------------------------- *) + +val zero : t + +val add : t -> t -> t + +val pp : Format.formatter -> t -> unit + +val pp_micheline_size : Format.formatter -> micheline_size -> unit + +val to_int : t -> int + +val of_int : int -> t + +val integer : 'a Script_int.num -> t + +val string : string -> t + +val script_string : Script_string.t -> t + +val bytes : Bytes.t -> t + +val mutez : Alpha_context.Tez.tez -> t + +val timestamp : Script_timestamp.t -> t + +val size_of_comparable_value : 'a Script_typed_ir.comparable_ty -> 'a -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_input_size.ml b/src/proto_016_PtMumbai/lib_protocol/gas_input_size.ml new file mode 100644 index 000000000000..d4105ef06ca1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_input_size.ml @@ -0,0 +1,79 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Gas_comparable_input_size + +let list (list : 'a Script_list.t) : t = list.Script_list.length + +let set (set : 'a Script_typed_ir.set) : t = + let res = Script_int.to_int (Script_set.size set) in + match res with None -> assert false | Some x -> x + +let map (map : ('a, 'b) Script_typed_ir.map) : t = + let res = Script_int.to_int (Script_map.size map) in + match res with None -> assert false | Some x -> x + +(* ------------------------------------------------------------------------- *) +(* Micheline/Michelson-related *) + +let micheline_zero = {traversal = 0; int_bytes = 0; string_bytes = 0} + +let ( ++ ) x y = + { + traversal = x.traversal + y.traversal; + int_bytes = x.int_bytes + y.int_bytes; + string_bytes = x.string_bytes + y.string_bytes; + } + +let node leaves = + let r = List.fold_left ( ++ ) micheline_zero leaves in + {r with traversal = r.traversal + 1} + +let rec of_micheline (x : ('a, 'b) Micheline.node) = + match x with + | Micheline.Int (_loc, z) -> + let int_bytes = integer (Script_int.of_zint z) in + {traversal = 1; int_bytes; string_bytes = 0} + | Micheline.String (_loc, s) -> + let string_bytes = String.length s in + {traversal = 1; int_bytes = 0; string_bytes} + | Micheline.Bytes (_loc, b) -> + let string_bytes = bytes b in + {traversal = 1; int_bytes = 0; string_bytes} + | Micheline.Prim (_loc, _prim, subterms, _annot) -> + node (List.map of_micheline subterms) + | Micheline.Seq (_loc, subterms) -> node (List.map of_micheline subterms) + +(* ------------------------------------------------------------------------- *) +(* Sapling-related *) + +let sapling_transaction_inputs : Alpha_context.Sapling.transaction -> t = + fun tx -> List.length tx.inputs + +let sapling_transaction_outputs : Alpha_context.Sapling.transaction -> t = + fun tx -> List.length tx.outputs + +let sapling_transaction_bound_data : Alpha_context.Sapling.transaction -> t = + fun tx -> String.length tx.bound_data diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_input_size.mli b/src/proto_016_PtMumbai/lib_protocol/gas_input_size.mli new file mode 100644 index 000000000000..6d3ba74fa43f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_input_size.mli @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [Gas_input_size] includes the definitions for the different sizes used + in the gas models of the protocol. They do not always represent memory + sizes, but rather they can be seen as an information size. They are + tailored to the models that use them, and should not be used for anything + other than gas computation. + *) + +include module type of Gas_comparable_input_size + +(* ------------------------------------------------------------------------- *) + +val list : 'a Script_list.t -> t + +val set : 'a Script_typed_ir.set -> t + +val map : ('a, 'b) Script_typed_ir.map -> t + +(* ------------------------------------------------------------------------- *) +(* Micheline/Michelson-related *) + +val of_micheline : ('a, 'b) Micheline.node -> micheline_size + +(* ------------------------------------------------------------------------- *) +(* Sapling-related *) + +val sapling_transaction_inputs : Alpha_context.Sapling.transaction -> t + +val sapling_transaction_outputs : Alpha_context.Sapling.transaction -> t + +val sapling_transaction_bound_data : Alpha_context.Sapling.transaction -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.ml b/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.ml new file mode 100644 index 000000000000..a6a8f428496a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.ml @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let decimals = 3 + +type fp_tag + +type integral_tag + +module S = Saturation_repr + +(* 1 gas unit *) +let scaling_factor = 1000 + +let mul_scaling_factor = S.mul_safe_of_int_exn scaling_factor + +module Arith = struct + type 'a t = S.may_saturate S.t + + type fp = fp_tag t + + type integral = integral_tag t + + let mul_scaling_factor = mul_scaling_factor + + let sub = S.sub + + let add = S.add + + let zero = S.zero + + let min = S.min + + let max = S.max + + let compare = S.compare + + let ( < ) = S.( < ) + + let ( <> ) = S.( <> ) + + let ( > ) = S.( > ) + + let ( <= ) = S.( <= ) + + let ( >= ) = S.( >= ) + + let ( = ) = S.( = ) + + let equal = S.equal + + let of_int_opt = S.of_int_opt + + let fatally_saturated_int i = + failwith (string_of_int i ^ " should not be saturated.") + + let fatally_saturated_z z = + failwith (Z.to_string z ^ " should not be saturated.") + + let integral_of_int_exn i = + S.( + match of_int_opt i with + | None -> fatally_saturated_int i + | Some i' -> + let r = scale_fast mul_scaling_factor i' in + if r = saturated then fatally_saturated_int i else r) + + let integral_exn z = + match Z.to_int z with + | i -> integral_of_int_exn i + | exception Z.Overflow -> fatally_saturated_z z + + let integral_to_z (i : integral) : Z.t = S.(to_z (ediv i mul_scaling_factor)) + + let ceil x = + let r = S.erem x mul_scaling_factor in + if r = zero then x else add x (sub mul_scaling_factor r) + + let floor x = sub x (S.erem x mul_scaling_factor) + + let fp x = x + + let pp fmtr fp = + let q = S.(ediv fp mul_scaling_factor |> to_int) in + let r = S.(erem fp mul_scaling_factor |> to_int) in + if Compare.Int.(r = 0) then Format.fprintf fmtr "%d" q + else Format.fprintf fmtr "%d.%0*d" q decimals r + + let pp_integral = pp + + let n_fp_encoding : fp Data_encoding.t = S.n_encoding + + let z_fp_encoding : fp Data_encoding.t = S.z_encoding + + let n_integral_encoding : integral Data_encoding.t = + Data_encoding.conv integral_to_z integral_exn Data_encoding.n + + let z_integral_encoding : integral Data_encoding.t = + Data_encoding.conv integral_to_z integral_exn Data_encoding.z + + let unsafe_fp x = + match of_int_opt (Z.to_int x) with + | Some int -> int + | None -> fatally_saturated_z x + + let sub_opt = S.sub_opt +end + +type t = Unaccounted | Limited of {remaining : Arith.fp} + +type cost = S.may_saturate S.t + +let encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Limited" + Arith.z_fp_encoding + (function Limited {remaining} -> Some remaining | _ -> None) + (fun remaining -> Limited {remaining}); + case + (Tag 1) + ~title:"Unaccounted" + (constant "unaccounted") + (function Unaccounted -> Some () | _ -> None) + (fun () -> Unaccounted); + ] + +let pp ppf = function + | Unaccounted -> Format.fprintf ppf "unaccounted" + | Limited {remaining} -> + Format.fprintf ppf "%a units remaining" Arith.pp remaining + +let cost_encoding = S.z_encoding + +let pp_cost fmt z = S.pp fmt z + +let pp_cost_as_gas fmt z = + Format.pp_print_int fmt (S.to_int (Arith.ceil z) / scaling_factor) + +(* 2 units of gas *) +let allocation_weight = + S.(mul_fast mul_scaling_factor (S.mul_safe_of_int_exn 2)) |> S.mul_safe_exn + +let step_weight = mul_scaling_factor + +(* 100 units of gas *) +let read_base_weight = + S.(mul_fast mul_scaling_factor (S.mul_safe_of_int_exn 100)) |> S.mul_safe_exn + +(* 160 units of gas *) +let write_base_weight = + S.(mul_fast mul_scaling_factor (S.mul_safe_of_int_exn 160)) |> S.mul_safe_exn + +(* 10 units of gas *) +let byte_read_weight = + S.(mul_fast mul_scaling_factor (S.mul_safe_of_int_exn 10)) |> S.mul_safe_exn + +(* 15 units of gas *) +let byte_written_weight = + S.(mul_fast mul_scaling_factor (S.mul_safe_of_int_exn 15)) |> S.mul_safe_exn + +let cost_to_milligas (cost : cost) : Arith.fp = cost + +let raw_consume gas_counter cost = + let gas = cost_to_milligas cost in + Arith.sub_opt gas_counter gas + +let alloc_cost n = + S.scale_fast allocation_weight S.(add n (S.mul_safe_of_int_exn 1)) + +let alloc_bytes_cost n = alloc_cost (S.safe_int ((n + 7) / 8)) + +let atomic_step_cost : 'a S.t -> cost = S.may_saturate + +let step_cost n = S.scale_fast step_weight n + +let free = S.zero + +let cost_of_gas (gas : 'a Arith.t) = (gas :> cost) + +let fp_of_milligas_int milligas = + (Saturation_repr.safe_int milligas :> Arith.fp) + +let read_bytes_cost n = + S.add read_base_weight (S.scale_fast byte_read_weight (S.safe_int n)) + +let write_bytes_cost n = + S.add write_base_weight (S.scale_fast byte_written_weight (S.safe_int n)) + +let ( +@ ) x y = S.add x y + +let ( *@ ) x y = S.mul x y + +let alloc_mbytes_cost n = + alloc_cost (S.mul_safe_of_int_exn 12) +@ alloc_bytes_cost n + +type error += Gas_limit_too_high (* `Permanent *) + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"gas_limit_too_high" + ~title:"Gas limit out of protocol hard bounds" + ~description:"A transaction tried to exceed the hard limit on gas" + empty + (function Gas_limit_too_high -> Some () | _ -> None) + (fun () -> Gas_limit_too_high) + +let check_gas_limit ~(hard_gas_limit_per_operation : Arith.integral) + ~(gas_limit : Arith.integral) = + error_unless + Arith.(gas_limit <= hard_gas_limit_per_operation && gas_limit >= zero) + Gas_limit_too_high diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.mli b/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.mli new file mode 100644 index 000000000000..891fd46f1c0b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_limit_repr.mli @@ -0,0 +1,130 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Internal representation of the gas limit available to the node baking a new + block. It should be proportional to the time and energy required to perform a + computation. + + This protects the bakers from performing exceedingly costly computations + while baking and also allows them to select cheaper-to-compute operations to + include in their blocks, as their reward for baking a block is not directly + related to the resources consumed by the machine performing the operation. + + It can be [Unaccounted] (unlimited) or [Limited] to some fixed-point value + (see [Fixed_point_repr] for the details). The value is represented with 3 + decimal places of precision. + + All computations on gas are performed in saturation arithmetic (see + [Saturation_repr]) bounded between [0] and [2 ^ 62 - 1]*) + +module Arith : + Fixed_point_repr.Full + with type 'a t = private Saturation_repr.may_saturate Saturation_repr.t + +type t = Unaccounted | Limited of {remaining : Arith.fp} + +val encoding : t Data_encoding.encoding + +val pp : Format.formatter -> t -> unit + +(** Represents a gas cost of an operation. The gas model is constructed such + that the cost of each operation is roughly proportional to the time required + to perform the operation. If the gas cost of an operation exceeds the + available limit, such an operation is rejected. This is especially meant to + protect bakers against DoS attacks. *) +type cost = Saturation_repr.may_saturate Saturation_repr.t + +val cost_encoding : cost Data_encoding.encoding + +val pp_cost : Format.formatter -> cost -> unit + +(** Print the gas cost as gas unit *) +val pp_cost_as_gas : Format.formatter -> cost -> unit + +(** Subtracts the cost from the current limit. Returns [None] if the limit + would fall below [0]. *) +val raw_consume : Arith.fp -> cost -> Arith.fp option + +(** The cost of free operation is [0]. *) +val free : cost + +(** Convert a fixed-point amount of gas to a cost. *) +val cost_of_gas : 'a Arith.t -> cost + +(** Convert an amount of milligas expressed as a value of type [int] to [Arith.fp]. *) +val fp_of_milligas_int : int -> Arith.fp + +(** [atomic_step_cost x] corresponds to [x] milliunit of gas. *) +val atomic_step_cost : _ Saturation_repr.t -> cost + +(** [step_cost x] corresponds to [x] units of gas. *) +val step_cost : _ Saturation_repr.t -> cost + +(** Cost of allocating qwords of storage. + + [alloc_cost n] estimates the cost of allocating [n] qwords of storage. *) +val alloc_cost : _ Saturation_repr.t -> cost + +(** Cost of allocating bytes in the storage. + + [alloc_bytes_cost b] estimates the cost of allocating [b] bytes of + storage. *) +val alloc_bytes_cost : int -> cost + +(** Cost of allocating bytes in the storage. + + [alloc_mbytes_cost b] estimates the cost of allocating [b] bytes of + storage and the cost of a header to describe these bytes. *) +val alloc_mbytes_cost : int -> cost + +(** Cost of reading the storage. + + [read_bytes_const n] estimates the cost of reading [n] bytes of storage. *) +val read_bytes_cost : int -> cost + +(** Cost of writing to storage. + + [write_bytes_const n] estimates the cost of writing [n] bytes to the + storage. *) +val write_bytes_cost : int -> cost + +(** Multiply a cost by a factor. Both arguments are saturated arithmetic values, + so no negative numbers are involved. *) +val ( *@ ) : _ Saturation_repr.t -> cost -> cost + +(** Add two costs together. *) +val ( +@ ) : cost -> cost -> cost + +(** Ill-formed [gas_limit]: see {!check_gas_limit}. *) +type error += Gas_limit_too_high (* `Permanent *) + +(** Check that [gas_limit] is well-formed, i.e. it is at most the + given [hard_gas_limit_per_operation], and it is nonnegative. + + @return [Error Gas_limit_too_high] otherwise. *) +val check_gas_limit : + hard_gas_limit_per_operation:Arith.integral -> + gas_limit:'a Arith.t -> + unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_monad.ml b/src/proto_016_PtMumbai/lib_protocol/gas_monad.ml new file mode 100644 index 000000000000..3597f4bfa47f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_monad.ml @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(* The outer option is for gas exhaustion. The inner [result] is for all other + errors. *) +type ('a, 'trace) t = + Local_gas_counter.local_gas_counter -> + (('a, 'trace) result * Local_gas_counter.local_gas_counter) option + +type ('a, 'trace) gas_monad = ('a, 'trace) t + +let of_result x gas = Some (x, gas) [@@ocaml.inline always] + +let return x = of_result (ok x) [@@ocaml.inline always] + +let return_unit = return () + +(* Inlined [Option.bind] for performance. *) +let ( >>?? ) m f = match m with None -> None | Some x -> f x + [@@ocaml.inline always] + +let bind m f gas = + m gas >>?? fun (res, gas) -> + match res with Ok y -> f y gas | Error _ as err -> of_result err gas + [@@ocaml.inline always] + +let map f m gas = m gas >>?? fun (x, gas) -> of_result (x >|? f) gas + [@@ocaml.inline always] + +let bind_result m f = bind (of_result m) f [@@ocaml.inline always] + +let bind_recover m f gas = m gas >>?? fun (x, gas) -> f x gas + [@@ocaml.inline always] + +let consume_gas cost gas = + match Local_gas_counter.consume_opt gas cost with + | None -> None + | Some gas -> Some (ok (), gas) + +let run ctxt m = + let open Local_gas_counter in + match Gas.level ctxt with + | Gas.Unaccounted -> ( + match m (Local_gas_counter (Saturation_repr.saturated :> int)) with + | Some (res, _new_gas_counter) -> ok (res, ctxt) + | None -> error Gas.Operation_quota_exceeded) + | Limited {remaining = _} -> ( + let gas_counter, outdated_ctxt = + local_gas_counter_and_outdated_context ctxt + in + match m gas_counter with + | Some (res, new_gas_counter) -> + let ctxt = update_context new_gas_counter outdated_ctxt in + ok (res, ctxt) + | None -> error Gas.Operation_quota_exceeded) + +let record_trace_eval : + type error_trace error_context. + error_details:(error_context, error_trace) Script_tc_errors.error_details -> + (error_context -> error) -> + ('a, error_trace) t -> + ('a, error_trace) t = + fun ~error_details -> + match error_details with + | Fast -> fun _f m -> m + | Informative err_ctxt -> + fun f m gas -> + m gas >>?? fun (x, gas) -> + of_result (record_trace_eval (fun () -> f err_ctxt) x) gas + +let fail e = of_result (Error e) [@@ocaml.inline always] + +module Syntax = struct + let return = return + + let return_unit = return_unit + + let return_none = return None + + let return_some x = return (Some x) + + let return_nil = return [] + + let return_true = return true + + let return_false = return false + + let fail = fail + + let ( let* ) = bind + + let ( let+ ) m f = map f m + + let ( let*? ) = bind_result +end diff --git a/src/proto_016_PtMumbai/lib_protocol/gas_monad.mli b/src/proto_016_PtMumbai/lib_protocol/gas_monad.mli new file mode 100644 index 000000000000..159499a0066e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/gas_monad.mli @@ -0,0 +1,119 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This monad combines: + - a state monad where the state is the context + - two levels of error monad to distinguish gas exhaustion from other errors + + It is useful for backtracking on type checking errors without backtracking + the consumed gas. +*) +type ('a, 'trace) t + +(** Alias of [('a, 'trace) t] to avoid confusion when the module is open *) +type ('a, 'trace) gas_monad = ('a, 'trace) t + +(** [return x] returns a value in the gas-monad. *) +val return : 'a -> ('a, 'trace) t + +(** [map f m] maps over successful results of [m] using [f]. *) +val map : ('a -> 'b) -> ('a, 'trace) t -> ('b, 'trace) t + +(** [bind m f] binds successful results of [m] and feeds it to [f]. *) +val bind : ('a, 'trace) t -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t + +(** [bind_recover m f] binds the result of [m] and feeds it to [f]. It's another + variant of [bind] that allows recovery from inner errors. *) +val bind_recover : + ('a, 'trace) t -> (('a, 'trace) result -> ('b, 'trace') t) -> ('b, 'trace') t + +(** [of_result r] is a gas-free embedding of the result [r] into the gas monad. *) +val of_result : ('a, 'trace) result -> ('a, 'trace) t + +(** [consume_gas c] consumes c amounts of gas. It's a wrapper around + [Gas.consume]. If that fails, the whole computation within the gas-monad + returns an error. See the {!Alpha_context.Gas module} for details.*) +val consume_gas : Alpha_context.Gas.cost -> (unit, 'trace) t + +(** [run ctxt m] runs [m] using the given context and returns the result along + with the new context with updated gas. The given context has [unlimited] + mode enabled, through [Gas.set_unlimited], no gas is consumed. *) +val run : + Alpha_context.context -> + ('a, 'trace) t -> + (('a, 'trace) result * Alpha_context.context) tzresult + +(** [record_trace_level ~error_details f m] returns a new gas-monad value that + when run, records trace levels using [f]. This function has no effect in + the case of a gas-exhaustion error or if [error_details] is [Fast]. *) +val record_trace_eval : + error_details:('error_context, 'error_trace) Script_tc_errors.error_details -> + ('error_context -> error) -> + ('a, 'error_trace) t -> + ('a, 'error_trace) t + +(** [fail e] is [return (Error e)] . *) +val fail : 'trace -> ('a, 'trace) t + +(** Syntax module for the {!Gas_monad}. This is intended to be opened locally in + functions. Within the scope of this module, the code can include binding + operators, leading to a [let]-style syntax. Similar to {!Lwt_result_syntax} + and other syntax modules. *) +module Syntax : sig + (** [return x] returns a value in the gas-monad. *) + val return : 'a -> ('a, 'trace) t + + (** [return_unit] is [return ()] . *) + val return_unit : (unit, 'trace) t + + (** [return_none] is [return None] . *) + val return_none : ('a option, 'trace) t + + (** [return_some x] is [return (Some x)] . *) + val return_some : 'a -> ('a option, 'trace) t + + (** [return_nil] is [return []] . *) + val return_nil : ('a list, 'trace) t + + (** [return_true] is [return true] . *) + val return_true : (bool, 'trace) t + + (** [return_false] is [return false] . *) + val return_false : (bool, 'trace) t + + (** [fail e] is [return (Error e)] . *) + val fail : 'trace -> ('a, 'trace) t + + (** [let*] is a binding operator alias for {!bind}. *) + val ( let* ) : ('a, 'trace) t -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t + + (** [let+] is a binding operator alias for {!map}. *) + val ( let+ ) : ('a, 'trace) t -> ('a -> 'b) -> ('b, 'trace) t + + (** [let*?] is for binding the value from result-only expressions into the + gas-monad. *) + val ( let*? ) : + ('a, 'trace) result -> ('a -> ('b, 'trace) t) -> ('b, 'trace) t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.ml b/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.ml new file mode 100644 index 000000000000..61bbab15e6b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.ml @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr + +let log2 x = S.safe_int (1 + S.numbits x) + +let ( + ) = S.add + +let ( lsr ) = S.shift_right + +(* Approximating 200 + 1.266960 * number of bytes *) +let expr_to_address_in_context_cost bytes = + let v0 = Bytes.length bytes |> S.safe_int in + S.safe_int 200 + (v0 + (v0 lsr 2)) |> Gas_limit_repr.atomic_step_cost + +let expand_constants_branch_cost = + Gas_limit_repr.atomic_step_cost @@ S.safe_int 4095 + +(* Approximating 100 + 4.639474 * n*log(n) *) +let expand_no_constants_branch_cost node = + let v0 = Script_repr.micheline_nodes node |> S.safe_int in + let v0 = S.mul v0 (log2 v0) in + S.safe_int 100 + S.mul (S.safe_int 4) v0 + (v0 lsr 1) + (v0 lsr 3) + |> Gas_limit_repr.atomic_step_cost diff --git a/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.mli b/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.mli new file mode 100644 index 000000000000..9f24e8b34d39 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/global_constants_costs.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Costs function for the global table of constants. *) + +(** Cost of calling [Global_constats_storage.expr_to_address_in_context]. *) +val expr_to_address_in_context_cost : bytes -> Gas_limit_repr.cost + +(** Step costs for [Global_constats_storage.expand_node]. *) +val expand_constants_branch_cost : Gas_limit_repr.cost + +val expand_no_constants_branch_cost : Script_repr.node -> Gas_limit_repr.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.ml new file mode 100644 index 000000000000..e34c04c0bb08 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.ml @@ -0,0 +1,269 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Micheline +open Michelson_v1_primitives + +(* + + See [expand] for an example. + + TODO: https://gitlab.com/tezos/tezos/-/issues/1609 + Move function to lib_micheline. + + On our next opportunity to update the environment, we + should move this function to lib_micheline. + +*) +let bottom_up_fold_cps initial_accumulator node initial_k f = + let rec traverse_node accu node k = + f accu node @@ fun accu node -> + match node with + | String _ | Int _ | Bytes _ -> k accu node + | Prim (loc, prim, args, annot) -> + (traverse_nodes [@ocaml.tailcall]) accu args (fun accu args -> + f accu (Prim (loc, prim, args, annot)) k) + | Seq (loc, elts) -> + (traverse_nodes [@ocaml.tailcall]) accu elts (fun accu elts -> + f accu (Seq (loc, elts)) k) + and traverse_nodes accu nodes k = + match nodes with + | [] -> k accu [] + | node :: nodes -> + (traverse_node [@ocaml.tailcall]) accu node (fun accu node -> + (traverse_nodes [@ocaml.tailcall]) accu nodes (fun accu nodes -> + k accu (node :: nodes))) + in + traverse_node initial_accumulator node initial_k + +module Gas_costs = Global_constants_costs +module Expr_hash_map = Map.Make (Script_expr_hash) + +type error += Expression_too_deep + +type error += Expression_already_registered + +type error += Badly_formed_constant_expression + +type error += Nonexistent_global + +type error += Expression_too_large + +let () = + let description = + "Attempted to register an expression that, after fully expanding all \ + referenced global constants, would result in too many levels of nesting." + in + register_error_kind + `Branch + ~id:"Expression_too_deep" + ~title:"Expression too deep" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Expression_too_deep -> Some () | _ -> None) + (fun () -> Expression_too_deep) ; + let description = + "Attempted to register an expression as global constant that has already \ + been registered." + in + register_error_kind + `Branch + ~id:"Expression_already_registered" + ~title:"Expression already registered" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Expression_already_registered -> Some () | _ -> None) + (fun () -> Expression_already_registered) ; + let description = + "Found a badly formed constant expression. The 'constant' primitive must \ + always be followed by a string of the hash of the expression it points \ + to." + in + register_error_kind + `Branch + ~id:"Badly_formed_constant_expression" + ~title:"Badly formed constant expression" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Badly_formed_constant_expression -> Some () | _ -> None) + (fun () -> Badly_formed_constant_expression) ; + let description = + "No registered global was found at the given hash in storage." + in + register_error_kind + `Branch + ~id:"Nonexistent_global" + ~title:"Tried to look up nonexistent global" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Nonexistent_global -> Some () | _ -> None) + (fun () -> Nonexistent_global) ; + let description = + "Encountered an expression that, after expanding all constants, is larger \ + than the expression size limit." + in + register_error_kind + `Branch + ~id:"Expression_too_large" + ~title:"Expression too large" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Expression_too_large -> Some () | _ -> None) + (fun () -> Expression_too_large) + +let get context hash = + Storage.Global_constants.Map.find context hash >>=? fun (context, value) -> + match value with + | None -> tzfail Nonexistent_global + | Some value -> return (context, value) + +let expr_to_address_in_context context expr = + let lexpr = Script_repr.lazy_expr expr in + Raw_context.consume_gas context @@ Script_repr.force_bytes_cost lexpr + >>? fun context -> + Script_repr.force_bytes lexpr >>? fun b -> + Raw_context.consume_gas context @@ Gas_costs.expr_to_address_in_context_cost b + >|? fun context -> (context, Script_expr_hash.hash_bytes [b]) + +let node_too_large node = + let node_size = Script_repr.Micheline_size.of_node node in + let nodes = Saturation_repr.to_int node_size.nodes in + let string_bytes = Saturation_repr.to_int node_size.string_bytes in + let z_bytes = Saturation_repr.to_int node_size.z_bytes in + Compare.Int.( + nodes > Constants_repr.max_micheline_node_count + || string_bytes + z_bytes > Constants_repr.max_micheline_bytes_limit) + +let expand_node context node = + (* We charge for traversing the top-level node at the beginning. + Inside the loop, we charge for traversing each new constant + that gets expanded. *) + Raw_context.consume_gas + context + (Gas_costs.expand_no_constants_branch_cost node) + >>?= fun context -> + bottom_up_fold_cps + (* We carry a Boolean representing whether we + had to do any expansions or not. *) + (context, Expr_hash_map.empty, false) + node + (fun (context, _, did_expansion) node -> + return (context, node, did_expansion)) + (fun (context, map, did_expansion) node k -> + match node with + | Prim (_, H_constant, args, annot) -> ( + (* Charge for validating the b58check hash. *) + Raw_context.consume_gas context Gas_costs.expand_constants_branch_cost + >>?= fun context -> + match (args, annot) with + (* A constant Prim should always have a single String argument, + being a properly formatted hash. *) + | [String (_, address)], [] -> ( + match Script_expr_hash.of_b58check_opt address with + | None -> tzfail Badly_formed_constant_expression + | Some hash -> ( + match Expr_hash_map.find hash map with + | Some node -> + (* Charge traversing the newly retrieved node *) + Raw_context.consume_gas + context + (Gas_costs.expand_no_constants_branch_cost node) + >>?= fun context -> k (context, map, true) node + | None -> + get context hash >>=? fun (context, expr) -> + (* Charge traversing the newly retrieved node *) + let node = root expr in + Raw_context.consume_gas + context + (Gas_costs.expand_no_constants_branch_cost node) + >>?= fun context -> + k (context, Expr_hash_map.add hash node map, true) node)) + | _ -> tzfail Badly_formed_constant_expression) + | Int _ | String _ | Bytes _ | Prim _ | Seq _ -> + k (context, map, did_expansion) node) + >>=? fun (context, node, did_expansion) -> + if did_expansion then + (* Gas charged during expansion is at least proportional to the size of the + resulting node so the execution time of [node_too_large] is already + covered. *) + if node_too_large node then tzfail Expression_too_large + else return (context, node) + else return (context, node) + +let expand context expr = + expand_node context (root expr) >|=? fun (context, node) -> + (context, strip_locations node) + +(** Computes the maximum depth of a Micheline node. Fails + with [Expression_too_deep] if greater than + [max_allowed_global_constant_depth].*) +let check_depth node = + let rec advance node depth k = + if Compare.Int.(depth > Constants_repr.max_allowed_global_constant_depth) + then error Expression_too_deep + else + match node with + | Int _ | String _ | Bytes _ | Prim (_, _, [], _) | Seq (_, []) -> + (k [@tailcall]) (depth + 1) + | Prim (loc, _, hd :: tl, _) | Seq (loc, hd :: tl) -> + (advance [@tailcall]) hd (depth + 1) (fun dhd -> + (advance [@tailcall]) + (* Because [depth] doesn't care about the content + of the expression, we can safely throw away information + about primitives and replace them with the [Seq] constructor.*) + (Seq (loc, tl)) + depth + (fun dtl -> (k [@tailcall]) (Compare.Int.max dhd dtl))) + in + advance node 0 (fun x -> Ok x) + +let register context value = + (* To calculate the total depth, we first expand all constants + in the expression. This may fail with [Expression_too_large]. + + Though the stored expression is the unexpanded version. + *) + expand_node context (root value) >>=? fun (context, node) -> + (* We do not need to carbonate [check_depth]. [expand_node] and + [Storage.Global_constants.Map.init] are already carbonated + with gas at least proportional to the size of the expanded node + and the computation cost of [check_depth] is of the same order. *) + check_depth node >>?= fun (_depth : int) -> + expr_to_address_in_context context value >>?= fun (context, key) -> + trace Expression_already_registered + @@ Storage.Global_constants.Map.init context key value + >|=? fun (context, size) -> (context, key, Z.of_int size) + +module Internal_for_tests = struct + let node_too_large = node_too_large + + let bottom_up_fold_cps = bottom_up_fold_cps + + let expr_to_address_in_context = expr_to_address_in_context +end diff --git a/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.mli b/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.mli new file mode 100644 index 000000000000..096143c3c2af --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/global_constants_storage.mli @@ -0,0 +1,150 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module represents access to a global table of constant + Micheline values. Users may register a Micheline value in the + table, paying the cost of storage. Once stored, contracts source code may + reference this value by its hash. + + Note: the table does not typecheck the values stored in it. + Instead, any place that uses constants must first call [expand] + before typechecking the code. This decision was made to make it as + easy as possible for users to register values to the table, and also + to allow maximum flexibility in the use of constants for different + parts of a Michelson script (code, types, data, etc.). *) + +type error += Expression_too_deep + +type error += Expression_already_registered + +(** A constant is the prim of the literal characters "constant". + A constant must have a single argument, being a string with a + well formed hash of a Micheline expression (i.e generated by + [Script_expr_hash.to_b58check]). *) +type error += Badly_formed_constant_expression + +type error += Nonexistent_global + +(** [get context hash] retrieves the Micheline value with the given hash. + + Fails with [Nonexistent_global] if no value is found at the given hash. + + Fails with [Storage_error Corrupted_data] if the deserialisation fails. + + Consumes [Gas_repr.read_bytes_cost <size of the value>]. *) +val get : + Raw_context.t -> + Script_expr_hash.t -> + (Raw_context.t * Script_repr.expr) tzresult Lwt.t + +(** [register context value] registers a constant in the global table of constants, + returning the hash and storage bytes consumed. + + Does not type-check the Micheline code being registered, allow potentially + ill-typed Michelson values to be stored in the table (see note at top of module). + + The constant is stored unexpanded, but it is temporarily expanded at registration + time only to check the expanded version respects the following limits. + This also ensures there are no cyclic dependencies between constants. + + Fails with [Expression_too_deep] if, after fully expanding all constants, + the expression would have a depth greater than [Constant_repr.max_allowed_global_constant_depth]. + + Fails with [Badly_formed_constant_expression] if constants are not + well-formed (see declaration of [Badly_formed_constant_expression]) or with + [Nonexistent_global] if a referenced constant does not exist in the table. + + Consumes serialization cost. + Consumes [Gas_repr.write_bytes_cost <size>] where size is the number + of bytes in the binary serialization provided by [Script_repr.expr_encoding]. *) +val register : + Raw_context.t -> + Script_repr.expr -> + (Raw_context.t * Script_expr_hash.t * Z.t) tzresult Lwt.t + +(** [expand context expr] replaces every constant in the + given Michelson expression with its value stored in the global table. + + The expansion is applied recursively so that the returned expression + contains no constant. + + Fails with [Badly_formed_constant_expression] if constants are not + well-formed (see declaration of [Badly_formed_constant_expression]) or + with [Nonexistent_global] if a referenced constant does not exist in + the table. *) +val expand : + Raw_context.t -> + Script_repr.expr -> + (Raw_context.t * Script_repr.expr) tzresult Lwt.t + +module Internal_for_tests : sig + (** [node_too_large node] returns true if: + - The number of sub-nodes in the [node] + exceeds [Global_constants_storage.node_size_limit]. + - The sum of the bytes in String, Int, + and Bytes sub-nodes of [node] exceeds + [Global_constants_storage.bytes_size_limit]. + + Otherwise returns false. *) + val node_too_large : Script_repr.node -> bool + + (** [bottom_up_fold_cps initial_accumulator node initial_k f] + folds [node] and all its sub-nodes if any, starting from + [initial_accumulator], using an initial continuation [initial_k]. + At each node, [f] is called to transform the continuation [k] into + the next one. This explicit manipulation of the continuation + is typically useful to short-circuit. + + Notice that a common source of bug is to forget to properly call the + continuation in `f`. + + See [Global_constants_storage.expand] for an example. + + TODO: https://gitlab.com/tezos/tezos/-/issues/1609 + Move function to lib_micheline. + + On our next opportunity to update the environment, we + should move this function to lib_micheline. + *) + val bottom_up_fold_cps : + 'accumulator -> + 'loc Script_repr.michelson_node -> + ('accumulator -> 'loc Script_repr.michelson_node -> 'return) -> + ('accumulator -> + 'loc Script_repr.michelson_node -> + ('accumulator -> 'loc Script_repr.michelson_node -> 'return) -> + 'return) -> + 'return + + (* [expr_to_address_in_context context expr] converts [expr] + into a unique hash represented by a [Script_expr_hash.t]. + + Consumes gas corresponding to the cost of converting [expr] + to bytes and hashing the bytes. *) + val expr_to_address_in_context : + Raw_context.t -> + Script_repr.expr -> + (Raw_context.t * Script_expr_hash.t) tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/indexable.ml b/src/proto_016_PtMumbai/lib_protocol/indexable.ml new file mode 100644 index 000000000000..0dce5fd663ed --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/indexable.ml @@ -0,0 +1,199 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type index_only = Index_only + +type value_only = Value_only + +type unknown = Unknown + +type (_, 'a) t = + | Value : 'a -> (value_only, 'a) t + | Hidden_value : 'a -> (unknown, 'a) t + | Index : int32 -> (index_only, 'a) t + | Hidden_index : int32 -> (unknown, 'a) t + +type error += Index_cannot_be_negative of int32 + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"indexable.index_cannot_be_negative" + ~title:"Index of values cannot be negative" + ~description:"A negative integer cannot be used as an index for a value." + ~pp:(fun ppf wrong_id -> + Format.fprintf + ppf + "%ld cannot be used as an index because it is negative." + wrong_id) + (obj1 (req "wrong_index" int32)) + (function Index_cannot_be_negative wrong_id -> Some wrong_id | _ -> None) + (fun wrong_id -> Index_cannot_be_negative wrong_id) + +type 'a value = (value_only, 'a) t + +type 'a index = (index_only, 'a) t + +type 'a either = (unknown, 'a) t + +let value : 'a -> 'a value = fun v -> Value v + +let from_value : 'a -> 'a either = fun v -> Hidden_value v + +let index : int32 -> 'a index tzresult = + fun i -> + if Compare.Int32.(0l <= i) then ok (Index i) + else error (Index_cannot_be_negative i) + +let from_index : int32 -> 'a either tzresult = + fun i -> + if Compare.Int32.(0l <= i) then ok (Hidden_index i) + else error (Index_cannot_be_negative i) + +let index_exn : int32 -> 'a index = + fun i -> + match index i with + | Ok x -> x + | Error _ -> raise (Invalid_argument "Indexable.index_exn") + +let from_index_exn : int32 -> 'a either = + fun i -> + match from_index i with + | Ok x -> x + | Error _ -> raise (Invalid_argument "Indexable.from_index_exn") + +let destruct : type state a. (state, a) t -> (a index, a) Either.t = function + | Hidden_value x | Value x -> Right x + | Hidden_index x | Index x -> Left (Index x) + +let forget : type state a. (state, a) t -> (unknown, a) t = function + | Hidden_value x | Value x -> Hidden_value x + | Hidden_index x | Index x -> Hidden_index x + +let to_int32 = function Index x -> x + +let to_value = function Value x -> x + +let is_value_e : error:'trace -> ('state, 'a) t -> ('a, 'trace) result = + fun ~error v -> + match destruct v with Left _ -> Result.error error | Right v -> Result.ok v + +let compact val_encoding = + Data_encoding.Compact.( + conv + (function Hidden_index x -> Either.Left x | Hidden_value x -> Right x) + (function Left x -> Hidden_index x | Right x -> Hidden_value x) + @@ or_int32 ~int32_title:"index" ~alt_title:"value" val_encoding) + +let encoding : 'a Data_encoding.t -> 'a either Data_encoding.t = + fun val_encoding -> + Data_encoding.Compact.make ~tag_size:`Uint8 @@ compact val_encoding + +let pp : + type state a. + (Format.formatter -> a -> unit) -> Format.formatter -> (state, a) t -> unit + = + fun ppv fmt -> function + | Hidden_index x | Index x -> Format.(fprintf fmt "#%ld" x) + | Hidden_value x | Value x -> Format.(fprintf fmt "%a" ppv x) + +let in_memory_size : + type state a. + (a -> Cache_memory_helpers.sint) -> + (state, a) t -> + Cache_memory_helpers.sint = + fun ims -> + let open Cache_memory_helpers in + function + | Hidden_value x | Value x -> header_size +! word_size +! ims x + | Hidden_index _ | Index _ -> header_size +! word_size +! int32_size + +let size : type state a. (a -> int) -> (state, a) t -> int = + fun s -> function + | Hidden_value x | Value x -> 1 + s x + | Hidden_index _ | Index _ -> (* tag + int32 *) 1 + 4 + +let compare : + type state state' a. (a -> a -> int) -> (state, a) t -> (state', a) t -> int + = + fun c x y -> + match (x, y) with + | (Hidden_index x | Index x), (Hidden_index y | Index y) -> + Compare.Int32.compare x y + | (Hidden_value x | Value x), (Hidden_value y | Value y) -> c x y + | (Hidden_index _ | Index _), (Hidden_value _ | Value _) -> -1 + | (Hidden_value _ | Value _), (Hidden_index _ | Index _) -> 1 + +let compare_values c : 'a value -> 'a value -> int = + fun (Value x) (Value y) -> c x y + +let compare_indexes : 'a index -> 'a index -> int = + fun (Index x) (Index y) -> Compare.Int32.compare x y + +module type VALUE = sig + type t + + val encoding : t Data_encoding.t + + val compare : t -> t -> int + + val pp : Format.formatter -> t -> unit +end + +module Make (V : VALUE) = struct + type nonrec 'state t = ('state, V.t) t + + type nonrec index = V.t index + + type nonrec value = V.t value + + type nonrec either = V.t either + + let value = value + + let index = index + + let index_exn = index_exn + + let compact = compact V.encoding + + let encoding = encoding V.encoding + + let index_encoding : index Data_encoding.t = + Data_encoding.( + conv (fun (Index x) -> x) (fun x -> Index x) Data_encoding.int32) + + let value_encoding : value Data_encoding.t = + Data_encoding.(conv (fun (Value x) -> x) (fun x -> Value x) V.encoding) + + let pp : Format.formatter -> 'state t -> unit = fun fmt x -> pp V.pp fmt x + + let compare_values = compare_values V.compare + + let compare_indexes = compare_indexes + + let compare : 'state t -> 'state' t -> int = fun x y -> compare V.compare x y +end diff --git a/src/proto_016_PtMumbai/lib_protocol/indexable.mli b/src/proto_016_PtMumbai/lib_protocol/indexable.mli new file mode 100644 index 000000000000..cc921e802f1f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/indexable.mli @@ -0,0 +1,197 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** In transaction rollups, some values can be replaced by indexes in + the messages sent from the layer-1 to the layer-2. + + This module provides various type-safe helpers to manipulate these + particular values. *) + +type value_only = Value_only + +type index_only = Index_only + +type unknown = Unknown + +(** An indexable value is a value which can be replaced by an + integer. The first type parameter determines whether or not this + replacement has happened already. *) +type (_, 'a) t = private + | Value : 'a -> (value_only, 'a) t + | Hidden_value : 'a -> (unknown, 'a) t + | Index : int32 -> (index_only, 'a) t + | Hidden_index : int32 -> (unknown, 'a) t + +(** The type of indexable values identified as not being indexes. *) +type 'a value = (value_only, 'a) t + +(** The type of indexable values identified as being indexes. *) +type 'a index = (index_only, 'a) t + +(** The type of indexable values whose content is still unknown. *) +type 'a either = (unknown, 'a) t + +(** [value v] wraps [v] into an indexable value identified as not + being an index. *) +val value : 'a -> 'a value + +(** [from_value v] wraps [v] into an indexable value, but forget about + the nature of the content of the result. *) +val from_value : 'a -> 'a either + +(** [index i] wraps [i] into an indexable value identified as being an + index. + + Returns the error [Index_cannot_be_negative] iff [i <= 0l]. *) +val index : int32 -> 'a index tzresult + +(** [from_index i] wraps [i] into an indexable value, but forget about the + nature of the content of the result. + + Returns the error [Index_cannot_be_negative] iff [i <= 0l]. *) +val from_index : int32 -> 'a either tzresult + +(** [index_exn i] wraps [i] into an indexable value identified as + being an index. + + @raise Invalid_argument iff [i <= 0l]. *) +val index_exn : int32 -> 'a index + +(** [from_index_exn i] wraps [i] into an indexable value, but forget + about the nature of the content of the result. + + @raise Invalid_argument iff [i <= 0l]. *) +val from_index_exn : int32 -> 'a either + +(** [compact val_encoding] is a combinator to derive a compact + encoding for an indexable value of type ['a] from an encoding for + ['a]. It uses two bits in the shared tag. [00] is used for indexes + fitting in one byte, [01] for indexes fitting in two bytes, [10] + for indexes fitting in four bytes, and [11] for the values of type + ['a]. *) +val compact : 'a Data_encoding.t -> (unknown, 'a) t Data_encoding.Compact.t + +val encoding : 'a Data_encoding.t -> (unknown, 'a) t Data_encoding.t + +val pp : + (Format.formatter -> 'a -> unit) -> Format.formatter -> ('state, 'a) t -> unit + +(** [destruct x] returns either the index or the (unwrapped) value + contained in [x]. + + {b Note:} If you want to manipulate a value of type ['a value], + you can use {!value}. *) +val destruct : ('state, 'a) t -> ('a index, 'a) Either.t + +(** [forget x] returns an indexable value whose kind of contents has + been forgotten. *) +val forget : ('state, 'a) t -> (unknown, 'a) t + +(** [to_int32 x] unwraps and returns the integer behind [x]. *) +val to_int32 : 'a index -> int32 + +(** [to_value x] unwraps and returns the value behind [x]. *) +val to_value : 'a value -> 'a + +(** [is_value_e err x] unwraps and returns the value behind [x], and + throws an [err] if [x] is an index. *) +val is_value_e : error:'trace -> ('state, 'a) t -> ('a, 'trace) result + +(** [in_memory_size a] returns the number of bytes allocated in RAM for [a]. *) +val in_memory_size : + ('a -> Cache_memory_helpers.sint) -> + ('state, 'a) t -> + Cache_memory_helpers.sint + +(** [size a] returns the number of bytes allocated in an inbox to store [a]. *) +val size : ('a -> int) -> ('state, 'a) t -> int + +(** [compare f x y] is a total order on indexable values, which + proceeds as follows. + + {ul {li If both [x] and [y] are a value, then use [f] to compare them.} + {li If both [x] and [y] are indexes, then uses the + [Int32.compare] function to compare them.} + {li Finally, if [x] and [y] have not the same kind, the logic + is that indexes are smaller than values.}} + + {b Note:} This can be dangerous, as you may end up comparing two + things that are equivalent (a value and its index) but declare + they are not equal. *) +val compare : ('a -> 'a -> int) -> ('state, 'a) t -> ('state', 'a) t -> int + +(** [compare_values f x y] compares the value [x] and [y] using [f], + and relies on the type system of OCaml to ensure that [x] and [y] + are indeed both values. *) +val compare_values : ('a -> 'a -> int) -> 'a value -> 'a value -> int + +(** [compare_indexes x y] compares the indexes [x] and [y], and relies + on the type system of OCaml to ensure that [x] and [y] are indeed + both indexes. *) +val compare_indexes : 'a index -> 'a index -> int + +module type VALUE = sig + type t + + val encoding : t Data_encoding.t + + val compare : t -> t -> int + + val pp : Format.formatter -> t -> unit +end + +module Make (V : VALUE) : sig + type nonrec 'state t = ('state, V.t) t + + type nonrec index = V.t index + + type nonrec value = V.t value + + type nonrec either = V.t either + + val value : V.t -> value + + val index : int32 -> index tzresult + + val index_exn : int32 -> index + + val compact : either Data_encoding.Compact.t + + val encoding : either Data_encoding.t + + val index_encoding : index Data_encoding.t + + val value_encoding : value Data_encoding.t + + val compare : 'state t -> 'state' t -> int + + val compare_values : value -> value -> int + + val compare_indexes : index -> index -> int + + val pp : Format.formatter -> 'state t -> unit +end + +type error += Index_cannot_be_negative of int32 diff --git a/src/proto_016_PtMumbai/lib_protocol/init_storage.ml b/src/proto_016_PtMumbai/lib_protocol/init_storage.ml new file mode 100644 index 000000000000..0cdd0afeac34 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/init_storage.ml @@ -0,0 +1,182 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* + To add invoices, you can use a helper function like this one: + +(** Invoice a contract at a given address with a given amount. Returns the + updated context and a balance update receipt (singleton list). The address + must be a valid base58 hash, otherwise this is no-op and returns an empty + receipts list. + + Do not fail if something goes wrong. +*) + +let invoice_contract ctxt ~address ~amount_mutez = + match Tez_repr.of_mutez amount_mutez with + | None -> Lwt.return (ctxt, []) + | Some amount -> ( + ( Contract_repr.of_b58check address >>?= fun recipient -> + Token.transfer + ~origin:Protocol_migration + ctxt + `Invoice + (`Contract recipient) + amount ) + >|= function + | Ok res -> res + | Error _ -> (ctxt, [])) +*) + +(* + To patch code of legacy contracts you can add a helper function here and call + it at the end of prepare_first_block. + + See !3730 for an example. +*) + +let patch_script (address, hash, patched_code) ctxt = + Contract_repr.of_b58check address >>?= fun contract -> + Storage.Contract.Code.find ctxt contract >>=? fun (ctxt, code_opt) -> + Logging.log Notice "Patching %s... " address ; + match code_opt with + | Some old_code -> + let old_bin = Data_encoding.force_bytes old_code in + let old_hash = Script_expr_hash.hash_bytes [old_bin] in + if Script_expr_hash.equal old_hash hash then ( + let new_code = Script_repr.lazy_expr patched_code in + Storage.Contract.Code.update ctxt contract new_code + >>=? fun (ctxt, size_diff) -> + Logging.log Notice "Contract %s successfully patched" address ; + let size_diff = Z.of_int size_diff in + Storage.Contract.Used_storage_space.get ctxt contract + >>=? fun prev_size -> + let new_size = Z.add prev_size size_diff in + Storage.Contract.Used_storage_space.update ctxt contract new_size + >>=? fun ctxt -> + if Z.(gt size_diff zero) then + Storage.Contract.Paid_storage_space.get ctxt contract + >>=? fun prev_paid_size -> + let paid_size = Z.add prev_paid_size size_diff in + Storage.Contract.Paid_storage_space.update ctxt contract paid_size + else return ctxt) + else ( + Logging.log + Error + "Patching %s was skipped because its script does not have the \ + expected hash (expected: %a, found: %a)" + address + Script_expr_hash.pp + hash + Script_expr_hash.pp + old_hash ; + return ctxt) + | None -> + Logging.log + Error + "Patching %s was skipped because no script was found for it in the \ + context." + address ; + return ctxt + +let prepare_first_block _chain_id ctxt ~typecheck ~level ~timestamp ~predecessor + = + Raw_context.prepare_first_block ~level ~timestamp ctxt + >>=? fun (previous_protocol, ctxt) -> + let parametric = Raw_context.constants ctxt in + ( Raw_context.Cache.set_cache_layout + ctxt + (Constants_repr.cache_layout parametric) + >|= fun ctxt -> Raw_context.Cache.clear ctxt ) + >>= fun ctxt -> + (match previous_protocol with + | Genesis param -> + (* This is the genesis protocol: initialise the state *) + Raw_level_repr.of_int32 level >>?= fun level -> + Storage.Tenderbake.First_level_of_protocol.init ctxt level + >>=? fun ctxt -> + Storage.Block_round.init ctxt Round_repr.zero >>=? fun ctxt -> + let init_commitment (ctxt, balance_updates) + Commitment_repr.{blinded_public_key_hash; amount} = + Token.transfer + ctxt + `Initial_commitments + (`Collected_commitments blinded_public_key_hash) + amount + >>=? fun (ctxt, new_balance_updates) -> + return (ctxt, new_balance_updates @ balance_updates) + in + List.fold_left_es init_commitment (ctxt, []) param.commitments + >>=? fun (ctxt, commitments_balance_updates) -> + Storage.Stake.Last_snapshot.init ctxt 0 >>=? fun ctxt -> + Seed_storage.init ?initial_seed:param.constants.initial_seed ctxt + >>=? fun ctxt -> + Contract_storage.init ctxt >>=? fun ctxt -> + Bootstrap_storage.init + ctxt + ~typecheck + ?no_reward_cycles:param.no_reward_cycles + param.bootstrap_accounts + param.bootstrap_contracts + >>=? fun (ctxt, bootstrap_balance_updates) -> + Delegate_cycles.init_first_cycles ctxt ~origin:Protocol_migration + >>=? fun (ctxt, deposits_balance_updates) -> + Vote_storage.init + ctxt + ~start_position:(Level_storage.current ctxt).level_position + >>=? fun ctxt -> + Vote_storage.update_listings ctxt >>=? fun ctxt -> + (* Must be called after other originations since it unsets the origination nonce. *) + Liquidity_baking_migration.init ctxt ~typecheck + >>=? fun (ctxt, operation_results) -> + Storage.Pending_migration.Operation_results.init ctxt operation_results + >>=? fun ctxt -> + Sc_rollup_inbox_storage.init_inbox ~predecessor ctxt >>= fun ctxt -> + return + ( ctxt, + commitments_balance_updates @ bootstrap_balance_updates + @ deposits_balance_updates ) + | Lima_015 + (* Please update [next_protocol] and [previous_protocol] in + [tezt/lib_tezos/protocol.ml] when you update this value. *) -> + (* TODO (#2704): possibly handle endorsements for migration block (in bakers); + if that is done, do not set Storage.Tenderbake.First_level_of_protocol. *) + Raw_level_repr.of_int32 level >>?= fun level -> + Storage.Tenderbake.First_level_of_protocol.update ctxt level + >>=? fun ctxt -> + Sc_rollup_inbox_storage.init_inbox ~predecessor ctxt >>= fun ctxt -> + return (ctxt, [])) + >>=? fun (ctxt, balance_updates) -> + List.fold_right_es patch_script Legacy_script_patches.addresses_to_patch ctxt + >>=? fun ctxt -> + Receipt_repr.group_balance_updates balance_updates >>?= fun balance_updates -> + Storage.Pending_migration.Balance_updates.add ctxt balance_updates + >>= fun ctxt -> return ctxt + +let prepare ctxt ~level ~predecessor_timestamp ~timestamp = + Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ctxt + >>=? fun ctxt -> Storage.Pending_migration.remove ctxt diff --git a/src/proto_016_PtMumbai/lib_protocol/init_storage.mli b/src/proto_016_PtMumbai/lib_protocol/init_storage.mli new file mode 100644 index 000000000000..9a8a079a17e9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/init_storage.mli @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Functions to setup storage. Used by [Alpha_context.prepare]. + + If you have defined a new type of storage, you should add relevant + setups here. + *) + +(* This is the genesis protocol: initialise the state *) +val prepare_first_block : + Chain_id.t -> + Context.t -> + typecheck: + (Raw_context.t -> + Script_repr.t -> + ((Script_repr.t * Lazy_storage_diff.diffs option) * Raw_context.t) + Error_monad.tzresult + Lwt.t) -> + level:int32 -> + timestamp:Time.t -> + predecessor:Block_hash.t -> + (Raw_context.t, Error_monad.error Error_monad.trace) Pervasives.result Lwt.t + +val prepare : + Context.t -> + level:Int32.t -> + predecessor_timestamp:Time.t -> + timestamp:Time.t -> + (Raw_context.t + * Receipt_repr.balance_updates + * Migration_repr.origination_result list) + Error_monad.tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.ml new file mode 100644 index 000000000000..791b3f828448 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.ml @@ -0,0 +1,433 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type Next = sig + type id + + val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + + val incr : Raw_context.t -> (Raw_context.t * id) tzresult Lwt.t +end + +module type Total_bytes = sig + type id + + val init : Raw_context.t -> id -> Z.t -> Raw_context.t tzresult Lwt.t + + val get : Raw_context.t -> id -> Z.t tzresult Lwt.t + + val update : Raw_context.t -> id -> Z.t -> Raw_context.t tzresult Lwt.t +end + +(** Operations to be defined on a lazy storage type. *) +module type OPS = sig + module Id : Lazy_storage_kind.ID + + type alloc + + type updates + + val title : string + + val alloc_encoding : alloc Data_encoding.t + + val updates_encoding : updates Data_encoding.t + + val alloc_in_memory_size : alloc -> Cache_memory_helpers.nodes_and_size + + val updates_in_memory_size : updates -> Cache_memory_helpers.nodes_and_size + + val bytes_size_for_empty : Z.t + + val alloc : Raw_context.t -> id:Id.t -> alloc -> Raw_context.t tzresult Lwt.t + + val apply_updates : + Raw_context.t -> id:Id.t -> updates -> (Raw_context.t * Z.t) tzresult Lwt.t + + module Next : Next with type id := Id.t + + module Total_bytes : Total_bytes with type id := Id.t + + (** Deep copy. *) + val copy : + Raw_context.t -> from:Id.t -> to_:Id.t -> Raw_context.t tzresult Lwt.t + + (** Deep deletion. *) + val remove : Raw_context.t -> Id.t -> Raw_context.t Lwt.t +end + +module Big_map = struct + include Lazy_storage_kind.Big_map + + let alloc_in_memory_size {key_type; value_type} = + let open Cache_memory_helpers in + ret_adding + (expr_size key_type ++ expr_size value_type) + (header_size +! (word_size *? 2)) + + let updates_in_memory_size updates = + let open Cache_memory_helpers in + let update_size {key; key_hash = _; value} = + ret_adding + (expr_size key ++ option_size_vec expr_size value) + (header_size +! (word_size *? 3) +? Script_expr_hash.size) + in + list_fold_size update_size updates + + let bytes_size_for_big_map_key = 65 + + let bytes_size_for_empty = + let bytes_size_for_big_map = 33 in + Z.of_int bytes_size_for_big_map + + let alloc ctxt ~id {key_type; value_type} = + (* Annotations are erased to allow sharing on [Copy]. The types from the + contract code are used, these ones are only used to make sure they are + compatible during transmissions between contracts, and only need to be + compatible, annotations notwithstanding. *) + let key_type = + Micheline.strip_locations + (Script_repr.strip_annotations (Micheline.root key_type)) + in + let value_type = + Micheline.strip_locations + (Script_repr.strip_annotations (Micheline.root value_type)) + in + Storage.Big_map.Key_type.init ctxt id key_type >>=? fun ctxt -> + Storage.Big_map.Value_type.init ctxt id value_type + + let apply_update ctxt ~id + { + key = _key_is_shown_only_on_the_receipt_in_print_big_map_diff; + key_hash; + value; + } = + match value with + | None -> + Storage.Big_map.Contents.remove (ctxt, id) key_hash + >|=? fun (ctxt, freed, existed) -> + let freed = + if existed then freed + bytes_size_for_big_map_key else freed + in + (ctxt, Z.of_int ~-freed) + | Some v -> + Storage.Big_map.Contents.add (ctxt, id) key_hash v + >|=? fun (ctxt, size_diff, existed) -> + let size_diff = + if existed then size_diff else size_diff + bytes_size_for_big_map_key + in + (ctxt, Z.of_int size_diff) + + let apply_updates ctxt ~id updates = + List.fold_left_es + (fun (ctxt, size) update -> + apply_update ctxt ~id update >|=? fun (ctxt, added_size) -> + (ctxt, Z.add size added_size)) + (ctxt, Z.zero) + updates + + include Storage.Big_map +end + +type ('id, 'alloc, 'updates) ops = + (module OPS + with type Id.t = 'id + and type alloc = 'alloc + and type updates = 'updates) + +module Sapling_state = struct + include Lazy_storage_kind.Sapling_state + + let alloc_in_memory_size {memo_size = (_ : int)} = + let open Cache_memory_helpers in + (Nodes.zero, header_size +! word_size) + + let updates_in_memory_size update = + (Cache_memory_helpers.Nodes.zero, Sapling_repr.diff_in_memory_size update) + + let bytes_size_for_empty = Z.of_int 33 + + let alloc ctxt ~id {memo_size} = Sapling_storage.init ctxt id ~memo_size + + let apply_updates ctxt ~id updates = + Sapling_storage.apply_diff ctxt id updates + + include Storage.Sapling +end + +(* + To add a new lazy storage kind here, you only need to create a module similar + to [Big_map] above and add a case to [get_ops] below. +*) + +let get_ops : type i a u. (i, a, u) Lazy_storage_kind.t -> (i, a, u) ops = + function + | Big_map -> (module Big_map) + | Sapling_state -> (module Sapling_state) + +type ('id, 'alloc) init = Existing | Copy of {src : 'id} | Alloc of 'alloc + +type ('id, 'alloc, 'updates) diff = + | Remove + | Update of {init : ('id, 'alloc) init; updates : 'updates} + +let diff_encoding : type i a u. (i, a, u) ops -> (i, a, u) diff Data_encoding.t + = + fun (module OPS) -> + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"update" + (obj2 + (req "action" (constant "update")) + (req "updates" OPS.updates_encoding)) + (function + | Update {init = Existing; updates} -> Some ((), updates) | _ -> None) + (fun ((), updates) -> Update {init = Existing; updates}); + case + (Tag 1) + ~title:"remove" + (obj1 (req "action" (constant "remove"))) + (function Remove -> Some () | _ -> None) + (fun () -> Remove); + case + (Tag 2) + ~title:"copy" + (obj3 + (req "action" (constant "copy")) + (req "source" OPS.Id.encoding) + (req "updates" OPS.updates_encoding)) + (function + | Update {init = Copy {src}; updates} -> Some ((), src, updates) + | _ -> None) + (fun ((), src, updates) -> Update {init = Copy {src}; updates}); + case + (Tag 3) + ~title:"alloc" + (merge_objs + (obj2 + (req "action" (constant "alloc")) + (req "updates" OPS.updates_encoding)) + OPS.alloc_encoding) + (function + | Update {init = Alloc alloc; updates} -> Some (((), updates), alloc) + | _ -> None) + (fun (((), updates), alloc) -> Update {init = Alloc alloc; updates}); + ] + +let init_size : + type i a u. + (i, a, u) ops -> (i, a) init -> Cache_memory_helpers.nodes_and_size = + fun (module OPS) init -> + let open Cache_memory_helpers in + match init with + | Existing -> zero + | Copy {src = _id_is_a_Z_fitting_in_an_int_for_a_long_time} -> + (Nodes.zero, header_size +! word_size) + | Alloc alloc -> + ret_adding (OPS.alloc_in_memory_size alloc) (header_size +! word_size) + +let updates_size : + type i a u. (i, a, u) ops -> u -> Cache_memory_helpers.nodes_and_size = + fun (module OPS) updates -> OPS.updates_in_memory_size updates + +let diff_in_memory_size kind diff = + let open Cache_memory_helpers in + match diff with + | Remove -> zero + | Update {init; updates} -> + let ops = get_ops kind in + ret_adding (init_size ops init ++ updates_size ops updates) h2w + +(** + [apply_updates ctxt ops ~id init] applies the updates [updates] on lazy + storage [id] on storage context [ctxt] using operations [ops] and returns the + updated storage context and the added size in bytes (may be negative). +*) +let apply_updates : + type i a u. + Raw_context.t -> + (i, a, u) ops -> + id:i -> + u -> + (Raw_context.t * Z.t) tzresult Lwt.t = + fun ctxt (module OPS) ~id updates -> + OPS.apply_updates ctxt ~id updates >>=? fun (ctxt, updates_size) -> + if Z.(equal updates_size zero) then return (ctxt, updates_size) + else + OPS.Total_bytes.get ctxt id >>=? fun size -> + OPS.Total_bytes.update ctxt id (Z.add size updates_size) >|=? fun ctxt -> + (ctxt, updates_size) + +(** + [apply_init ctxt ops ~id init] applies the initialization [init] on lazy + storage [id] on storage context [ctxt] using operations [ops] and returns the + updated storage context and the added size in bytes (may be negative). + + If [id] represents a temporary lazy storage, the added size may be wrong. +*) +let apply_init : + type i a u. + Raw_context.t -> + (i, a, u) ops -> + id:i -> + (i, a) init -> + (Raw_context.t * Z.t) tzresult Lwt.t = + fun ctxt (module OPS) ~id init -> + match init with + | Existing -> return (ctxt, Z.zero) + | Copy {src} -> + OPS.copy ctxt ~from:src ~to_:id >>=? fun ctxt -> + if OPS.Id.is_temp id then return (ctxt, Z.zero) + else + OPS.Total_bytes.get ctxt src >>=? fun copy_size -> + return (ctxt, Z.add copy_size OPS.bytes_size_for_empty) + | Alloc alloc -> + OPS.Total_bytes.init ctxt id Z.zero >>=? fun ctxt -> + OPS.alloc ctxt ~id alloc >>=? fun ctxt -> + return (ctxt, OPS.bytes_size_for_empty) + +(** + [apply_diff ctxt ops ~id diff] applies the diff [diff] on lazy storage [id] + on storage context [ctxt] using operations [ops] and returns the updated + storage context and the added size in bytes (may be negative). + + If [id] represents a temporary lazy storage, the added size may be wrong. +*) +let apply_diff : + type i a u. + Raw_context.t -> + (i, a, u) ops -> + id:i -> + (i, a, u) diff -> + (Raw_context.t * Z.t) tzresult Lwt.t = + fun ctxt ((module OPS) as ops) ~id diff -> + match diff with + | Remove -> + if OPS.Id.is_temp id then + OPS.remove ctxt id >|= fun ctxt -> ok (ctxt, Z.zero) + else + OPS.Total_bytes.get ctxt id >>=? fun size -> + OPS.remove ctxt id >>= fun ctxt -> + return (ctxt, Z.neg (Z.add size OPS.bytes_size_for_empty)) + | Update {init; updates} -> + apply_init ctxt ops ~id init >>=? fun (ctxt, init_size) -> + apply_updates ctxt ops ~id updates >>=? fun (ctxt, updates_size) -> + return (ctxt, Z.add init_size updates_size) + +type diffs_item = + | Item : + ('i, 'a, 'u) Lazy_storage_kind.t * 'i * ('i, 'a, 'u) diff + -> diffs_item + +let make : + type i a u. + (i, a, u) Lazy_storage_kind.t -> i -> (i, a, u) diff -> diffs_item = + fun k id diff -> Item (k, id, diff) + +let item_encoding = + let open Data_encoding in + union + @@ List.map + (fun (tag, Lazy_storage_kind.Ex_Kind k) -> + let ops = get_ops k in + let (module OPS) = ops in + let title = OPS.title in + case + (Tag tag) + ~title + (obj3 + (req "kind" (constant title)) + (req "id" OPS.Id.encoding) + (req "diff" (diff_encoding ops))) + (fun (Item (kind, id, diff)) -> + match Lazy_storage_kind.equal k kind with + | Eq -> Some ((), id, diff) + | Neq -> None) + (fun ((), id, diff) -> Item (k, id, diff))) + Lazy_storage_kind.all + +let item_in_memory_size + (Item + ( kind (* kinds are constant tags *), + _id_is_a_Z_fitting_in_an_int_for_a_long_time, + diff )) = + let open Cache_memory_helpers in + ret_adding (diff_in_memory_size kind diff) h3w + +type diffs = diffs_item list + +let diffs_in_memory_size diffs = + Cache_memory_helpers.list_fold_size item_in_memory_size diffs + +let encoding = + let open Data_encoding in + def "lazy_storage_diff" @@ list item_encoding + +let apply ctxt diffs = + List.fold_left_es + (fun (ctxt, total_size) (Item (k, id, diff)) -> + let ops = get_ops k in + apply_diff ctxt ops ~id diff >|=? fun (ctxt, added_size) -> + let (module OPS) = ops in + ( ctxt, + if OPS.Id.is_temp id then total_size else Z.add total_size added_size )) + (ctxt, Z.zero) + diffs + +let fresh : + type i a u. + (i, a, u) Lazy_storage_kind.t -> + temporary:bool -> + Raw_context.t -> + (Raw_context.t * i) tzresult Lwt.t = + fun kind ~temporary ctxt -> + if temporary then + return + (Raw_context.fold_map_temporary_lazy_storage_ids ctxt (fun temp_ids -> + Lazy_storage_kind.Temp_ids.fresh kind temp_ids)) + else + let (module OPS) = get_ops kind in + OPS.Next.incr ctxt + +let init ctxt = + List.fold_left_es + (fun ctxt (_tag, Lazy_storage_kind.Ex_Kind k) -> + let (module OPS) = get_ops k in + OPS.Next.init ctxt) + ctxt + Lazy_storage_kind.all + +let cleanup_temporaries ctxt = + Raw_context.map_temporary_lazy_storage_ids_s ctxt (fun temp_ids -> + List.fold_left_s + (fun ctxt (_tag, Lazy_storage_kind.Ex_Kind k) -> + let (module OPS) = get_ops k in + Lazy_storage_kind.Temp_ids.fold_s k OPS.remove temp_ids ctxt) + ctxt + Lazy_storage_kind.all + >|= fun ctxt -> (ctxt, Lazy_storage_kind.Temp_ids.init)) diff --git a/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.mli b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.mli new file mode 100644 index 000000000000..17637213d75b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_diff.mli @@ -0,0 +1,71 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining 'a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + See [Lazy_storage_kind] for an introduction on lazy storage. + + This module defines operations on lazy storage types and diffs. +*) + +type ('id, 'alloc) init = Existing | Copy of {src : 'id} | Alloc of 'alloc + +type ('id, 'alloc, 'updates) diff = + | Remove + | Update of {init : ('id, 'alloc) init; updates : 'updates} + +(* Exposing this type is needed only for legacy big map diff. *) +type diffs_item = private + | Item : + ('i, 'a, 'u) Lazy_storage_kind.t * 'i * ('i, 'a, 'u) diff + -> diffs_item + +val make : + ('i, 'a, 'u) Lazy_storage_kind.t -> 'i -> ('i, 'a, 'u) diff -> diffs_item + +type diffs = diffs_item list + +val diffs_in_memory_size : diffs -> Cache_memory_helpers.nodes_and_size + +val encoding : diffs Data_encoding.t + +(** + The returned [Z.t] is the size added by the application of the diffs. +*) +val apply : Raw_context.t -> diffs -> (Raw_context.t * Z.t) tzresult Lwt.t + +val fresh : + ('id, _, _) Lazy_storage_kind.t -> + temporary:bool -> + Raw_context.t -> + (Raw_context.t * 'id) tzresult Lwt.t + +(** + Initializes the storage for all lazy storage kind. + This is useful for genesis only. + Protocol updates need to initialize new lazy storage kinds. +*) +val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + +val cleanup_temporaries : Raw_context.t -> Raw_context.t Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.ml b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.ml new file mode 100644 index 000000000000..03655e7e956e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.ml @@ -0,0 +1,318 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type TEMP_ID = sig + type t + + val equal : t -> t -> bool + + val init : t + + val next : t -> t +end + +module type ID = sig + type t + + val compare : t -> t -> int + + val encoding : t Data_encoding.t + + val rpc_arg : t RPC_arg.arg + + val init : t + + (** In the protocol, to be used in parse_data only *) + val parse_z : Z.t -> t + + (** In the protocol, to be used in unparse_data only *) + val unparse_to_z : t -> Z.t + + val next : t -> t + + val is_temp : t -> bool + + val of_legacy_USE_ONLY_IN_Legacy_big_map_diff : Z.t -> t + + val to_legacy_USE_ONLY_IN_Legacy_big_map_diff : t -> Z.t + + include Path_encoding.S with type t := t +end + +module type Title = sig + val title : string +end + +module type TitleWithId = sig + val title : string + + module Id : ID + + module Temp_id : TEMP_ID with type t = private Id.t + + module IdSet : Set.S with type elt = Id.t +end + +module MakeId (Title : Title) : TitleWithId = struct + let title = Title.title + + let title_words = String.map (function '_' -> ' ' | c -> c) title + + let rpc_arg_error = Format.sprintf "Cannot parse %s id" title_words + + let description = Format.sprintf "A %s identifier" title_words + + let name = title ^ "_id" + + let encoding_title = String.capitalize_ascii title_words ^ " identifier" + + module Id = struct + type t = Z.t + + let compare = Z.compare + + let encoding = + Data_encoding.def name ~title:encoding_title ~description Data_encoding.z + + let rpc_arg = + let construct = Z.to_string in + let destruct hash = + Result.catch_f (fun () -> Z.of_string hash) (fun _ -> rpc_arg_error) + in + RPC_arg.make ~descr:description ~name ~construct ~destruct () + + let init = Z.zero + + let parse_z (z : Z.t) : t = z + + let unparse_to_z (z : t) : Z.t = z + + let next = Z.succ + + let of_legacy_USE_ONLY_IN_Legacy_big_map_diff (z : Z.t) : t = z + + let to_legacy_USE_ONLY_IN_Legacy_big_map_diff (z : t) : Z.t = z + + let is_temp z = Compare.Z.(z < Z.zero) + + let path_length = 1 + + let to_path z l = Z.to_string z :: l + + let of_path = function + | [] | _ :: _ :: _ -> None + | [z] -> Some (Z.of_string z) + end + + module Temp_id = struct + type t = Id.t + + let equal = Z.equal + + let init = Z.of_int ~-1 + + let next z = Z.sub z Z.one + end + + module IdSet = Set.Make (Id) +end + +module Big_map = struct + include MakeId (struct + let title = "big_map" + end) + + type alloc = {key_type : Script_repr.expr; value_type : Script_repr.expr} + + type update = { + key : Script_repr.expr; + (** The key is ignored by [apply_update] but is shown in the receipt, + as specified in [print_big_map_diff]. *) + key_hash : Script_expr_hash.t; + value : Script_repr.expr option; + } + + type updates = update list + + let alloc_encoding = + let open Data_encoding in + conv + (fun {key_type; value_type} -> (key_type, value_type)) + (fun (key_type, value_type) -> {key_type; value_type}) + (obj2 + (req "key_type" Script_repr.expr_encoding) + (req "value_type" Script_repr.expr_encoding)) + + let update_encoding = + let open Data_encoding in + conv + (fun {key_hash; key; value} -> (key_hash, key, value)) + (fun (key_hash, key, value) -> {key_hash; key; value}) + (obj3 + (req "key_hash" Script_expr_hash.encoding) + (req "key" Script_repr.expr_encoding) + (opt "value" Script_repr.expr_encoding)) + + let updates_encoding = Data_encoding.list update_encoding +end + +module Sapling_state = struct + include MakeId (struct + let title = "sapling_state" + end) + + type alloc = {memo_size : Sapling_repr.Memo_size.t} + + type updates = Sapling_repr.diff + + let alloc_encoding = + let open Data_encoding in + conv + (fun {memo_size} -> memo_size) + (fun memo_size -> {memo_size}) + (obj1 (req "memo_size" Sapling_repr.Memo_size.encoding)) + + let updates_encoding = Sapling_repr.diff_encoding +end + +(* + When adding cases to this type, grep for [new lazy storage kind] in the code + for locations to update. + It must be: + - the value [all] right below, + - modules [Temp_ids], [IdSet] below, + - the rest should be guided by type errors. +*) +type ('id, 'alloc, 'updates) t = + | Big_map : (Big_map.Id.t, Big_map.alloc, Big_map.updates) t + | Sapling_state + : (Sapling_state.Id.t, Sapling_state.alloc, Sapling_state.updates) t + +type ex = Ex_Kind : (_, _, _) t -> ex + +(* /!\ Don't forget to add new lazy storage kinds here. /!\ *) +let all = [(0, Ex_Kind Big_map); (1, Ex_Kind Sapling_state)] + +type (_, _) cmp = Eq : ('a, 'a) cmp | Neq + +let equal : + type i1 a1 u1 i2 a2 u2. + (i1, a1, u1) t -> (i2, a2, u2) t -> (i1 * a1 * u1, i2 * a2 * u2) cmp = + fun k1 k2 -> + match (k1, k2) with + | Big_map, Big_map -> Eq + | Sapling_state, Sapling_state -> Eq + | Big_map, _ -> Neq + | _, Big_map -> Neq + +type ('i, 'a, 'u) kind = ('i, 'a, 'u) t + +module Temp_ids = struct + type t = { + big_map : Big_map.Temp_id.t; + sapling_state : Sapling_state.Temp_id.t; + } + + let init = + {big_map = Big_map.Temp_id.init; sapling_state = Sapling_state.Temp_id.init} + + let fresh : type i a u. (i, a, u) kind -> t -> t * i = + fun kind temp_ids -> + match kind with + | Big_map -> + let big_map = Big_map.Temp_id.next temp_ids.big_map in + ({temp_ids with big_map}, (temp_ids.big_map :> Big_map.Id.t)) + | Sapling_state -> + let sapling_state = Sapling_state.Temp_id.next temp_ids.sapling_state in + ( {temp_ids with sapling_state}, + (temp_ids.sapling_state :> Sapling_state.Id.t) ) + + let fold_s : + type i a u. + (i, a, u) kind -> ('acc -> i -> 'acc Lwt.t) -> t -> 'acc -> 'acc Lwt.t = + fun kind f temp_ids acc -> + let helper (type j) (module Temp_id : TEMP_ID with type t = j) ~last f = + let rec aux acc id = + if Temp_id.equal id last then Lwt.return acc + else f acc id >>= fun acc -> aux acc (Temp_id.next id) + in + aux acc Temp_id.init + in + match kind with + | Big_map -> + helper + (module Big_map.Temp_id) + ~last:temp_ids.big_map + (fun acc temp_id -> f acc (temp_id :> i)) + | Sapling_state -> + helper + (module Sapling_state.Temp_id) + ~last:temp_ids.sapling_state + (fun acc temp_id -> f acc (temp_id :> i)) +end + +module IdSet = struct + type t = {big_map : Big_map.IdSet.t; sapling_state : Sapling_state.IdSet.t} + + type 'acc fold_f = {f : 'i 'a 'u. ('i, 'a, 'u) kind -> 'i -> 'acc -> 'acc} + + let empty = + {big_map = Big_map.IdSet.empty; sapling_state = Sapling_state.IdSet.empty} + + let mem (type i a u) (kind : (i, a, u) kind) (id : i) set = + match (kind, set) with + | Big_map, {big_map; _} -> Big_map.IdSet.mem id big_map + | Sapling_state, {sapling_state; _} -> + Sapling_state.IdSet.mem id sapling_state + + let add (type i a u) (kind : (i, a, u) kind) (id : i) set = + match (kind, set) with + | Big_map, {big_map; _} -> + let big_map = Big_map.IdSet.add id big_map in + {set with big_map} + | Sapling_state, {sapling_state; _} -> + let sapling_state = Sapling_state.IdSet.add id sapling_state in + {set with sapling_state} + + let diff set1 set2 = + let big_map = Big_map.IdSet.diff set1.big_map set2.big_map in + let sapling_state = + Sapling_state.IdSet.diff set1.sapling_state set2.sapling_state + in + {big_map; sapling_state} + + let fold (type i a u) (kind : (i, a, u) kind) (f : i -> 'acc -> 'acc) set + (acc : 'acc) = + match (kind, set) with + | Big_map, {big_map; _} -> Big_map.IdSet.fold f big_map acc + | Sapling_state, {sapling_state; _} -> + Sapling_state.IdSet.fold f sapling_state acc + + let fold_all f set acc = + List.fold_left + (fun acc (_, Ex_Kind kind) -> fold kind (f.f kind) set acc) + acc + all +end diff --git a/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.mli b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.mli new file mode 100644 index 000000000000..eb23fb9545ad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/lazy_storage_kind.mli @@ -0,0 +1,178 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + Lazy_storage offers a unified interface for specific Michelson datatype that + behave somewhat lazily, because they are intended to be quite big. + Instead of serializing/deserializing the whole value to/from the storage, + only an identifier is used. The identifier acts like a pointer. + When using the value in a Michelson script, some part of it may be read from + the storage, and a lightweight diff is computed. + The diff is effectively applied to the storage at the end of the execution. + + This module defines the different kinds of lazy storages and their basic + properties. See also [Lazy_storage_diff]. + + Lazy storage types are: + - Big_map +*) + +(** + Lazy storage ids are kept as abstract as possible to avoid mixing them up. + + Behind the scene they are [Z.t]s but, within the protocol, only [parse_data]/ + [unparse_data] are allowed convert from/to it. + + Temporary ids may be used to pass values between contracts that won't be kept + longer than the lifetime of the operation. + Behind the scene, temporary ids are negative [Z.t]s. +*) +module type ID = sig + type t + + val compare : t -> t -> int + + val encoding : t Data_encoding.t + + val rpc_arg : t RPC_arg.arg + + (** Initial value for ids: zero. *) + val init : t + + (** In the protocol, to be used in parse_data only *) + val parse_z : Z.t -> t + + (** In the protocol, to be used in unparse_data only *) + val unparse_to_z : t -> Z.t + + val next : t -> t + + val is_temp : t -> bool + + (* To be removed once legacy big map diff is removed: *) + + val of_legacy_USE_ONLY_IN_Legacy_big_map_diff : Z.t -> t + + val to_legacy_USE_ONLY_IN_Legacy_big_map_diff : t -> Z.t + + (* To be used in storage: *) + + include Path_encoding.S with type t := t +end + +module Big_map : sig + val title : string + + module Id : ID + + type alloc = {key_type : Script_repr.expr; value_type : Script_repr.expr} + + type update = { + key : Script_repr.expr; + (** The key is ignored by [apply_update] but is shown in the receipt, + as specified in [print_big_map_diff]. *) + key_hash : Script_expr_hash.t; + value : Script_repr.expr option; + } + + type updates = update list + + val alloc_encoding : alloc Data_encoding.t + + val updates_encoding : updates Data_encoding.t +end + +module Sapling_state : sig + val title : string + + module Id : ID + + type alloc = {memo_size : Sapling_repr.Memo_size.t} + + type updates = Sapling_repr.diff + + val alloc_encoding : alloc Data_encoding.t + + val updates_encoding : updates Data_encoding.t +end + +(** + Kinds of lazy storage. + The GADT ensures operations are properly applied to the correct kind. + + ['id] the abstract type for the identifier of the kind. + ['alloc] is the type used to construct a new value. + ['updates] is the type used to update a value. +*) +type ('id, 'alloc, 'updates) t = + | Big_map : (Big_map.Id.t, Big_map.alloc, Big_map.updates) t + | Sapling_state + : (Sapling_state.Id.t, Sapling_state.alloc, Sapling_state.updates) t + +type ex = Ex_Kind : (_, _, _) t -> ex + +val all : (int * ex) list + +type (_, _) cmp = Eq : ('a, 'a) cmp | Neq + +val equal : + ('i1, 'a1, 'u1) t -> + ('i2, 'a2, 'u2) t -> + ('i1 * 'a1 * 'u1, 'i2 * 'a2 * 'u2) cmp + +type ('i, 'a, 'u) kind = ('i, 'a, 'u) t + +(** + Type to manage temporary ids. + Used only in the context. +*) +module Temp_ids : sig + type t + + val init : t + + val fresh : ('i, 'a, 'u) kind -> t -> t * 'i + + val fold_s : + ('i, 'a, 'u) kind -> ('acc -> 'i -> 'acc Lwt.t) -> t -> 'acc -> 'acc Lwt.t +end + +module IdSet : sig + type t + + type 'acc fold_f = {f : 'i 'a 'u. ('i, 'a, 'u) kind -> 'i -> 'acc -> 'acc} + + val empty : t + + val mem : ('i, 'a, 'u) kind -> 'i -> t -> bool + + val add : ('i, 'a, 'u) kind -> 'i -> t -> t + + val diff : t -> t -> t + + val fold : ('i, 'a, 'u) kind -> ('i -> 'acc -> 'acc) -> t -> 'acc -> 'acc + + val fold_all : 'acc fold_f -> t -> 'acc -> 'acc +end diff --git a/src/proto_016_PtMumbai/lib_protocol/legacy_script_patches.ml b/src/proto_016_PtMumbai/lib_protocol/legacy_script_patches.ml new file mode 100644 index 000000000000..de45c3d7fb9a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/legacy_script_patches.ml @@ -0,0 +1,52 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + addresses : string list; + hash : Script_expr_hash.t; + patched_code : Michelson_v1_primitives.prim Micheline.canonical; +} + +let script_hash {hash; _} = hash + +let code {patched_code; _} = patched_code + +let bin_expr_exn hex = + match + Option.bind + (Hex.to_bytes @@ `Hex hex) + (fun bytes -> + Data_encoding.Binary.of_bytes_opt Script_repr.expr_encoding bytes) + with + | Some expr -> expr + | None -> raise (Failure "Decoding script failed.") + +let patches = [] + +let addresses_to_patch = + List.concat_map + (fun {hash; patched_code; addresses} -> + List.map (fun addr -> (addr, hash, patched_code)) addresses) + patches diff --git a/src/proto_016_PtMumbai/lib_protocol/level_repr.ml b/src/proto_016_PtMumbai/lib_protocol/level_repr.ml new file mode 100644 index 000000000000..f4cb006b8317 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/level_repr.ml @@ -0,0 +1,354 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + level : Raw_level_repr.t; + level_position : int32; + cycle : Cycle_repr.t; + cycle_position : int32; + expected_commitment : bool; +} + +include Compare.Make (struct + type nonrec t = t + + let compare {level = l1; _} {level = l2; _} = Raw_level_repr.compare l1 l2 +end) + +type level = t + +let pp ppf {level; _} = Raw_level_repr.pp ppf level + +let pp_full ppf l = + Format.fprintf + ppf + "%a.%ld (cycle %a.%ld)" + Raw_level_repr.pp + l.level + l.level_position + Cycle_repr.pp + l.cycle + l.cycle_position + +let encoding = + let open Data_encoding in + conv + (fun {level; level_position; cycle; cycle_position; expected_commitment} -> + (level, level_position, cycle, cycle_position, expected_commitment)) + (fun (level, level_position, cycle, cycle_position, expected_commitment) -> + {level; level_position; cycle; cycle_position; expected_commitment}) + (obj5 + (req + "level" + ~description: + "The level of the block relative to genesis. This is also the \ + Shell's notion of level." + Raw_level_repr.encoding) + (req + "level_position" + ~description: + "The level of the block relative to the successor of the genesis \ + block. More precisely, it is the position of the block relative \ + to the block that starts the \"Alpha family\" of protocols, which \ + includes all protocols except Genesis (that is, from 001 \ + onwards)." + int32) + (req + "cycle" + ~description: + "The current cycle's number. Note that cycles are a \ + protocol-specific notion. As a result, the cycle number starts at \ + 0 with the first block of the Alpha family of protocols." + Cycle_repr.encoding) + (req + "cycle_position" + ~description: + "The current level of the block relative to the first block of the \ + current cycle." + int32) + (req + "expected_commitment" + ~description: + "Tells whether the baker of this block has to commit a seed nonce \ + hash." + bool)) + +let diff {level = l1; _} {level = l2; _} = + Int32.sub (Raw_level_repr.to_int32 l1) (Raw_level_repr.to_int32 l2) + +type cycle_era = { + first_level : Raw_level_repr.t; + first_cycle : Cycle_repr.t; + blocks_per_cycle : int32; + blocks_per_commitment : int32; +} + +type cycle_eras = cycle_era list + +type error += Invalid_cycle_eras + +let () = + register_error_kind + `Temporary + ~id:"level_repr.invalid_cycle_eras" + ~title:"Invalid cycle eras" + ~description: + "The cycles eras are not valid: empty list or non-decreasing first \ + levels or first cycles." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The cycles eras are not valid: empty list or non-decreasing first \ + levels or first cycles.") + Data_encoding.empty + (function Invalid_cycle_eras -> Some () | _ -> None) + (fun () -> Invalid_cycle_eras) + +let create_cycle_eras cycle_eras = + match cycle_eras with + | [] -> error Invalid_cycle_eras + | newest_era :: older_eras -> + let rec aux {first_level; first_cycle; _} older_eras = + match older_eras with + | ({ + first_level = first_level_of_previous_era; + first_cycle = first_cycle_of_previous_era; + _; + } as previous_era) + :: even_older_eras -> + if + Raw_level_repr.(first_level > first_level_of_previous_era) + && Cycle_repr.(first_cycle > first_cycle_of_previous_era) + then aux previous_era even_older_eras + else error Invalid_cycle_eras + | [] -> ok () + in + aux newest_era older_eras >>? fun () -> ok cycle_eras + +let add_cycle_era new_era cycle_eras = create_cycle_eras (new_era :: cycle_eras) + +let cycle_era_encoding = + let open Data_encoding in + conv + (fun {first_level; first_cycle; blocks_per_cycle; blocks_per_commitment} -> + (first_level, first_cycle, blocks_per_cycle, blocks_per_commitment)) + (fun (first_level, first_cycle, blocks_per_cycle, blocks_per_commitment) -> + {first_level; first_cycle; blocks_per_cycle; blocks_per_commitment}) + (obj4 + (req + "first_level" + ~description:"The first level of a new cycle era." + Raw_level_repr.encoding) + (req + "first_cycle" + ~description:"The first cycle of a new cycle era." + Cycle_repr.encoding) + (req + "blocks_per_cycle" + ~description: + "The value of the blocks_per_cycle constant used during the cycle \ + era starting with first_level." + int32) + (req + "blocks_per_commitment" + ~description: + "The value of the blocks_per_commitment constant used during the \ + cycle era starting with first_level." + int32)) + +let cycle_eras_encoding = + Data_encoding.conv_with_guard + (fun eras -> eras) + (fun eras -> + match create_cycle_eras eras with + | Ok eras -> Ok eras + | Error _ -> Error "Invalid cycle eras") + (Data_encoding.list cycle_era_encoding) + +let current_era = function [] -> assert false | cycle_era :: _ -> cycle_era + +let root_level cycle_eras = + let first_era = List.last_opt cycle_eras in + let first_era = + match first_era with + | Some first_era -> first_era + | None -> + (* {!create_cycle_eras} fails if the list is empty. + {!cycle_eras_encoding} uses {!create_cycle_eras} and so fails on empty + lists too. *) + assert false + in + { + level = first_era.first_level; + level_position = 0l; + cycle = Cycle_repr.root; + cycle_position = 0l; + expected_commitment = false; + } + +(* This function returns the cycle era to which [level] belongs. *) +let era_of_level ~cycle_eras level = + let rec aux = function + | ({first_level; _} as era) :: previous_eras -> + if Raw_level_repr.(level >= first_level) then era else aux previous_eras + | [] -> assert false + in + aux cycle_eras + +(* This function returns the cycle era to which [cycle] belongs. *) +let era_of_cycle ~cycle_eras cycle = + let rec aux = function + | ({first_cycle; _} as era) :: previous_eras -> + if Cycle_repr.(cycle >= first_cycle) then era else aux previous_eras + | [] -> assert false + in + aux cycle_eras + +(* precondition: [level] belongs to [era] *) +let level_from_raw_with_era era ~first_level_in_alpha_family level = + let {first_level; first_cycle; blocks_per_cycle; blocks_per_commitment} = + era + in + let level_position_in_era = Raw_level_repr.diff level first_level in + assert (Compare.Int32.(level_position_in_era >= 0l)) ; + let cycles_since_era_start = + Int32.div level_position_in_era blocks_per_cycle + in + let cycle = + Cycle_repr.add first_cycle (Int32.to_int cycles_since_era_start) + in + let cycle_position = Int32.rem level_position_in_era blocks_per_cycle in + let level_position = Raw_level_repr.diff level first_level_in_alpha_family in + let expected_commitment = + Compare.Int32.( + Int32.rem cycle_position blocks_per_commitment + = Int32.pred blocks_per_commitment) + in + {level; level_position; cycle; cycle_position; expected_commitment} + +let level_from_raw_aux_exn ~cycle_eras level = + let first_level_in_alpha_family = + match List.rev cycle_eras with + | [] -> assert false + | {first_level; _} :: _ -> first_level + in + let era = era_of_level ~cycle_eras level in + level_from_raw_with_era era ~first_level_in_alpha_family level + +let level_from_raw ~cycle_eras l = level_from_raw_aux_exn ~cycle_eras l + +type error += Level_not_in_alpha of Raw_level_repr.t + +let () = + register_error_kind + `Permanent + ~id:"level_not_in_alpha" + ~title:"Level not in Alpha family" + ~description:"Level not in Alpha family" + ~pp:(fun ppf level -> + Format.fprintf + ppf + "Level %a is not in the Alpha family of protocols." + Raw_level_repr.pp + level) + Data_encoding.(obj1 (req "level" Raw_level_repr.encoding)) + (function Level_not_in_alpha level -> Some level | _ -> None) + (fun level -> Level_not_in_alpha level) + +let level_from_raw_aux ~cycle_eras level = + let first_level_in_alpha_family = + match List.rev cycle_eras with + | [] -> assert false + | {first_level; _} :: _ -> first_level + in + error_when + Raw_level_repr.(level < first_level_in_alpha_family) + (Level_not_in_alpha level) + >|? fun () -> + let era = era_of_level ~cycle_eras level in + level_from_raw_with_era era ~first_level_in_alpha_family level + +type error += Negative_level_and_offset_sum of int32 * int32 + +let () = + register_error_kind + `Permanent + ~id:"negative_level_and_offset_sum" + ~title:"Negative sum of level and offset" + ~description:"Negative sum of level and offset" + ~pp:(fun ppf (level, offset) -> + Format.fprintf + ppf + "Sum of level (%ld) and offset (%ld) is negative." + level + offset) + Data_encoding.(obj2 (req "level" int32) (req "offset" int32)) + (function + | Negative_level_and_offset_sum (level, offset) -> Some (level, offset) + | _ -> None) + (fun (level, offset) -> Negative_level_and_offset_sum (level, offset)) + +let level_from_raw_with_offset ~cycle_eras ~offset raw_level = + let res = Raw_level_repr.(of_int32 (Int32.add (to_int32 raw_level) offset)) in + match res with + | Ok level -> level_from_raw_aux ~cycle_eras level + | Error _ -> + error + (Negative_level_and_offset_sum + (Raw_level_repr.to_int32 raw_level, offset)) + +let first_level_in_cycle_from_eras ~cycle_eras cycle = + let first_level_in_alpha_family = + match List.rev cycle_eras with + | [] -> assert false + | {first_level; _} :: _ -> first_level + in + let era = era_of_cycle ~cycle_eras cycle in + let cycle_position = Cycle_repr.diff cycle era.first_cycle in + let offset = Int32.mul era.blocks_per_cycle cycle_position in + let first_level_in_cycle = + Raw_level_repr.(of_int32_exn (Int32.add (to_int32 era.first_level) offset)) + in + level_from_raw_with_era era ~first_level_in_alpha_family first_level_in_cycle + +let last_of_cycle ~cycle_eras level = + let era = era_of_level ~cycle_eras level.level in + Compare.Int32.(Int32.succ level.cycle_position = era.blocks_per_cycle) + +module Internal_for_tests = struct + let add_level level n = + let raw_level = level.level in + let new_raw_level = Raw_level_repr.add raw_level n in + {level with level = new_raw_level} + + let add_cycles ~blocks_per_cycle level n = + { + level with + cycle = Cycle_repr.add level.cycle n; + level = Raw_level_repr.add level.level (n * blocks_per_cycle); + level_position = + Int32.add level.level_position (Int32.of_int (n * blocks_per_cycle)); + } +end diff --git a/src/proto_016_PtMumbai/lib_protocol/level_repr.mli b/src/proto_016_PtMumbai/lib_protocol/level_repr.mli new file mode 100644 index 000000000000..0c2800556dc2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/level_repr.mli @@ -0,0 +1,121 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines the protocol representation of a level. Besides the "raw + level", which is the shell's notion of the level, this representation also + contains additional information, like the cycle the level belongs to. *) + +type t = private { + level : Raw_level_repr.t; + (** The level of the block relative to genesis. This + is also the Shell's notion of level. *) + level_position : int32; + (** The level of the block relative to the block that starts the + alpha family of protocols. *) + cycle : Cycle_repr.t; + (** The current cycle's number. Note that cycles are a protocol-specific + notion. As a result, the cycle number starts at 0 with the first block of + the first version of protocol alpha. *) + cycle_position : int32; + (** The current level of the block relative to the first block of the current + cycle. *) + expected_commitment : bool; +} + +type level = t + +include Compare.S with type t := level + +val encoding : level Data_encoding.t + +val pp : Format.formatter -> level -> unit + +val pp_full : Format.formatter -> level -> unit + +val diff : level -> level -> int32 + +(** A cycle era is a chunk of cycles having the same number of levels + per cycle and the same number of blocks per commitment. *) +type cycle_era = { + first_level : Raw_level_repr.t; (** The first level of a cycle era. *) + first_cycle : Cycle_repr.t; (** The first cycle of a cycle era. *) + blocks_per_cycle : int32; + (** The value of the blocks_per_cycle constant used during the cycle + era starting with first_level. *) + blocks_per_commitment : int32; + (** The value of the blocks_per_commitment constant used during the + cycle era starting with first_level. *) +} + +(** Stores the cycles eras of the Alpha family of protocols *) +type cycle_eras + +val cycle_eras_encoding : cycle_eras Data_encoding.t + +(** Preconditions on the input list of cycle eras: + - the list is not empty + - the first levels and the first cycles are decreasing, meaning that the + first era in the list is the current era, and the last era in the list + is the oldest era + Invariants: + - the first era therefore contains the same constants as in Constants + - the first level of an era is the first level of a cycle +*) +val create_cycle_eras : cycle_era list -> cycle_eras tzresult + +(** Add a new cycle era *) +val add_cycle_era : cycle_era -> cycle_eras -> cycle_eras tzresult + +(** Returns the current era *) +val current_era : cycle_eras -> cycle_era + +(** Returns the first level of the oldest era *) +val root_level : cycle_eras -> level + +(** Returns the annotated level corresponding to a raw level *) +val level_from_raw : cycle_eras:cycle_eras -> Raw_level_repr.t -> level + +(** Returns the annotated level corresponding to a raw level and an + offset. A positive offset corresponds to a higher level. + Fails with [Negative_level_and_offset_sum] if the sum of the raw_level and the offset is negative. + Fails with [Level_not_in_alpha] if the sum of the raw_level and the offset + is a level before the first level in the Alpha family of protocols. *) +val level_from_raw_with_offset : + cycle_eras:cycle_eras -> offset:int32 -> Raw_level_repr.t -> level tzresult + +(** Returns the first level of the given cycle. *) +val first_level_in_cycle_from_eras : + cycle_eras:cycle_eras -> Cycle_repr.t -> level + +(** Returns true if the given level is the last of a cycle. *) +val last_of_cycle : cycle_eras:cycle_eras -> level -> bool + +module Internal_for_tests : sig + val add_level : t -> int -> t + + val add_cycles : blocks_per_cycle:int -> t -> int -> t +end + +(**/**) diff --git a/src/proto_016_PtMumbai/lib_protocol/level_storage.ml b/src/proto_016_PtMumbai/lib_protocol/level_storage.ml new file mode 100644 index 000000000000..331839bf787b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/level_storage.ml @@ -0,0 +1,127 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Level_repr + +let from_raw c l = + let cycle_eras = Raw_context.cycle_eras c in + Level_repr.level_from_raw ~cycle_eras l + +let from_raw_with_offset c ~offset l : Level_repr.t tzresult = + let cycle_eras = Raw_context.cycle_eras c in + Level_repr.level_from_raw_with_offset ~cycle_eras ~offset l + +let root c = Raw_context.cycle_eras c |> Level_repr.root_level + +let succ c (l : Level_repr.t) = from_raw c (Raw_level_repr.succ l.level) + +let pred c (l : Level_repr.t) = + match Raw_level_repr.pred l.Level_repr.level with + | None -> None + | Some l -> Some (from_raw c l) + +let add c (l : Level_repr.t) n = from_raw c (Raw_level_repr.add l.level n) + +let sub c (l : Level_repr.t) n = + match Raw_level_repr.sub l.level n with + | None -> None + | Some raw_level -> + let cycle_eras = Raw_context.cycle_eras c in + let root_level = Level_repr.root_level cycle_eras in + if Raw_level_repr.(raw_level >= root_level.level) then + Some (from_raw c raw_level) + else None + +let current ctxt = Raw_context.current_level ctxt + +let previous ctxt = + let l = current ctxt in + match pred ctxt l with + | None -> assert false (* We never validate the Genesis... *) + | Some p -> p + +let first_level_in_cycle ctxt cycle = + let cycle_eras = Raw_context.cycle_eras ctxt in + Level_repr.first_level_in_cycle_from_eras ~cycle_eras cycle + +let last_level_in_cycle ctxt c = + match pred ctxt (first_level_in_cycle ctxt (Cycle_repr.succ c)) with + | None -> assert false + | Some x -> x + +let levels_in_cycle ctxt cycle = + let first = first_level_in_cycle ctxt cycle in + let rec loop (n : Level_repr.t) acc = + if Cycle_repr.(n.cycle = first.cycle) then loop (succ ctxt n) (n :: acc) + else acc + in + loop first [] + +let levels_in_current_cycle ctxt ?(offset = 0l) () = + let current_cycle = Cycle_repr.to_int32 (current ctxt).cycle in + let cycle = Int32.add current_cycle offset in + if Compare.Int32.(cycle < 0l) then [] + else + let cycle = Cycle_repr.of_int32_exn cycle in + levels_in_cycle ctxt cycle + +let levels_with_commitments_in_cycle ctxt c = + let first = first_level_in_cycle ctxt c in + let rec loop (n : Level_repr.t) acc = + if Cycle_repr.(n.cycle = first.cycle) then + if n.expected_commitment then loop (succ ctxt n) (n :: acc) + else loop (succ ctxt n) acc + else acc + in + loop first [] + +let last_allowed_fork_level c = + let level = Raw_context.current_level c in + let preserved_cycles = Constants_storage.preserved_cycles c in + match Cycle_repr.sub level.cycle preserved_cycles with + | None -> Raw_level_repr.root + | Some cycle -> (first_level_in_cycle c cycle).level + +let last_of_a_cycle ctxt level = + let cycle_eras = Raw_context.cycle_eras ctxt in + Level_repr.last_of_cycle ~cycle_eras level + +let dawn_of_a_new_cycle ctxt = + let level = current ctxt in + if last_of_a_cycle ctxt level then Some level.cycle else None + +let may_snapshot_stake_distribution ctxt = + let level = current ctxt in + let blocks_per_stake_snapshot = + Constants_storage.blocks_per_stake_snapshot ctxt + in + Compare.Int32.equal + (Int32.rem level.cycle_position blocks_per_stake_snapshot) + (Int32.pred blocks_per_stake_snapshot) + +let may_compute_randao ctxt = + let level = current ctxt in + let nonce_reveal_cutoff = Constants_storage.nonce_revelation_threshold ctxt in + Compare.Int32.equal level.cycle_position nonce_reveal_cutoff diff --git a/src/proto_016_PtMumbai/lib_protocol/level_storage.mli b/src/proto_016_PtMumbai/lib_protocol/level_storage.mli new file mode 100644 index 000000000000..0049a8185451 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/level_storage.mli @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val current : Raw_context.t -> Level_repr.t + +val previous : Raw_context.t -> Level_repr.t + +val root : Raw_context.t -> Level_repr.t + +val from_raw : Raw_context.t -> Raw_level_repr.t -> Level_repr.t + +(** Fails with [Negative_level_and_offset_sum] if the sum of the raw_level and the offset is negative. *) +val from_raw_with_offset : + Raw_context.t -> offset:int32 -> Raw_level_repr.t -> Level_repr.t tzresult + +val pred : Raw_context.t -> Level_repr.t -> Level_repr.t option + +val succ : Raw_context.t -> Level_repr.t -> Level_repr.t + +(** [i] must be positive *) +val add : Raw_context.t -> Level_repr.t -> int -> Level_repr.t + +(** [sub c level i] returns None if the level is before the first + level of the Alpha family of protocol, otherwise it returns the + expected level. [i] must be positive. *) +val sub : Raw_context.t -> Level_repr.t -> int -> Level_repr.t option + +val first_level_in_cycle : Raw_context.t -> Cycle_repr.t -> Level_repr.t + +val last_level_in_cycle : Raw_context.t -> Cycle_repr.t -> Level_repr.t + +val levels_in_cycle : Raw_context.t -> Cycle_repr.t -> Level_repr.t list + +val levels_in_current_cycle : + Raw_context.t -> ?offset:int32 -> unit -> Level_repr.t list + +val levels_with_commitments_in_cycle : + Raw_context.t -> Cycle_repr.t -> Level_repr.t list + +val last_allowed_fork_level : Raw_context.t -> Raw_level_repr.t + +(** Returns [Some cycle] if the current level represents the last + level of [cycle] and [None] if the level is not the last level of a + cycle. *) +val dawn_of_a_new_cycle : Raw_context.t -> Cycle_repr.t option + +(** Returns [true] if the stake distribution should be snapshot at the current + level. *) +val may_snapshot_stake_distribution : Raw_context.t -> bool + +(** Returns [true] if RANDAO should be computed at the current level, that is + if the current level, relative to the cycle's start, equals the nonce + revelation period cut-off. *) +val may_compute_randao : Raw_context.t -> bool diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_cpmm.ml b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_cpmm.ml new file mode 100644 index 000000000000..be63503aa883 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_cpmm.ml @@ -0,0 +1,13 @@ +let script_hex : Hex.t = + `Hex + "02000011c405000764076407640865046e00000006256f776e6572076504620000000d256d696e4c71744d696e7465640765046200000013256d6178546f6b656e734465706f7369746564046b0000000925646561646c696e650000000d256164644c6971756964697479046c000000082564656661756c7407640865046e0000000325746f076504620000000a256c71744275726e65640765046a00000010256d696e58747a57697468647261776e0765046200000013256d696e546f6b656e7357697468647261776e046b0000000925646561646c696e65000000102572656d6f76654c69717569646974790865046e00000015256f7574707574446578746572436f6e74726163740765046200000010256d696e546f6b656e73426f756768740765046e0000000325746f076504620000000b25746f6b656e73536f6c64046b0000000925646561646c696e650000000d25746f6b656e546f546f6b656e07640865046e0000000325746f076504620000000b25746f6b656e73536f6c640765046a0000000d256d696e58747a426f75676874046b0000000925646561646c696e650000000b25746f6b656e546f58747a0865046e0000000325746f0765046200000010256d696e546f6b656e73426f75676874046b0000000925646561646c696e650000000b2578747a546f546f6b656e0501076504620000000a25746f6b656e506f6f6c0765046a000000082578747a506f6f6c0765046200000009256c7174546f74616c0765046e0000000d25746f6b656e41646472657373046e0000000b256c71744164647265737305020200000f7203210317034c0316072e02000009d1072e020000035a072e020000032603210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200004074303620003032702000002ea0743036a000105700004032105710005031703160322072f0200000013074303680100000008444956206279203003270200000000031603130743036a0001034c0322072f02000000130743036801000000084449562062792030032702000000000316034c0321057100020570000603210571000703170317031605700002032105710003033a0322072f020000001307430368010000000844495620627920300327020000000003160570000205700006032105710007031605700003033a0322072f020000001307430368010000000844495620627920300327020000002a03210317034c03160743036200000570000203190325072c02000000000200000008074303620001031205700002034c0321057100020319032a072c020000000c05200005074303620004032702000001b60571000203210571000303190337072c020000000c0520000407430362000503270200000190057000030321057100040317031703170570000203210571000305700005032105710006031703170316031203420570000403210571000503170316034205700004032105710005031603420317034c032105710002057000050321057100060316031203420321031703170313057000060317031603120342034c03160342034c03490354034203480342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d05700002033005700003034205700002032105710003034c03210317034c031605700002031703170317031706550765045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e072f020000000807430362000c032702000000000743036a000005700002057000030342034d05700002053d036d05700002031b05700002031b0342020000002803200321031703170313057000020321057100030317031603120342034c03160342053d036d0342020000066b072e020000038d03210317034c0316034c03210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200005074303620003032702000003470743036a000003130319032a072c020000000c0520000507430362000a03270200000323057000040321057100050317031703160743036a000105700006032105710007031703160322072f0200000013074303680100000008444956206279203003270200000000031605700004032105710005033a0322072f020000001307430368010000000844495620627920300327020000000003160743036a0001034c033a0570000503210571000603170317031605700006032105710007031605700005032105710006033a0322072f02000000130743036801000000084449562062792030032702000000000316057000030570000203210571000303190337072c020000000c0520000607430362000b0327020000022e05700002034c03210571000203190337072c020000000c0520000507430362000d032702000002060570000203210571000305700005032105710006031703170316034b0356072f020000000807430362000e03270200000000034c032105710002057000060321057100070316034b0356072f020000000807430362000f03270200000000057000040743035b0000034b0348034205700006032105710007034c03210317034c031605700002031703170317031706550765045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e072f020000000807430362000c032702000000000743036a000005700002057000030342034d0570000305700005032105710006034203490354034205700006032105710007034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d05700004032105710005057000060555036c072f020000000807430362000903270200000000034c0743036c030b034d0570000603210571000703170317057000060570000703210571000803170316034b034205700006031603420321031703170317057000060342034c032105710002031703160342034c031603420317057000040342053d036d05700002031b05700002031b05700002031b034202000002d203210317034c0316034c03210317034c0316034c03210317034c0316034c03210317034c03160570000406550765046e0000000325746f0765046200000010256d696e546f6b656e73426f75676874046b0000000925646561646c696e650000000b2578747a546f546f6b656e072f020000000807430362001f032702000000000743036a000003130319032a072c020000000c0520000607430362000a0327020000022d05700002032105710003034003190328072c020000000c05200006074303620003032702000002050743036200a70f05700002032105710003033a0743036200a80f057000070321057100080316033a031205700006032105710007031703160743036200a70f05700004032105710005033a033a0322072f020000001307430368010000000844495620627920300327020000000003160743036200a80f0743036200a70f05700002032105710003033a0322072f02000000130743036801000000084449562062792030032702000000000316057000070321057100080317057000040321057100050570000903210571000a031603120342032103170317057000030321057100040570000a03170316034b0342034c031603420570000403490354034203480342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d057000040570000303210571000405700006057000080342057000070342034d0570000305700004034b0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d05700003053d036d05700002031b05700002031b05700002031b0342020000058d072e02000002cc03210317034c0316034c03210317034c0316034c03210317034c0316034c034003190328072c020000000c05200004074303620003032702000002900743036a000003130319032a072c020000000c0520000407430362000a0327020000026c0743036200a70f05700002032105710003033a0743036200a80f057000050321057100060316033a03120743036a000105700005032105710006031703160322072f020000001307430368010000000844495620627920300327020000000003160743036200a70f05700004032105710005033a033a0322072f020000001307430368010000000844495620627920300327020000000003160743036a0001034c033a0743036200a80f0743036200a70f05700002032105710003033a0322072f0200000013074303680100000008444956206279203003270200000000031605700002034c03210571000203190337072c020000000a032007430362000803270200000000057000020321057100030349035403420348034205700005032105710006034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d034c032105710002057000050555036c072f020000000807430362000903270200000000034c0743036c030b034d0570000503210571000603170570000505700006032105710007031603120342032103170317057000050321057100060570000703170316034b0342034c031603420570000305700004034b0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d034c053d036d05700002031b05700002031b05700002031b034202000002b503210317034c0316034c03210317034c0316034c034003190328072c020000000c05200003074303620003032702000002830743036a000105700003032105710004031703160322072f0200000013074303680100000008444956206279203003270200000000031603130743036a0001034c0322072f020000001307430368010000000844495620627920300327020000000003160743036200a80f0743036200a70f05700002032105710003033a0322072f02000000130743036801000000084449562062792030032702000000000316032105700002034b03110743036200a70f05700002032105710003033a0743036200a80f05700004033a03120570000503210571000603160743036200a70f05700004032105710005033a033a0322072f0200000013074303680100000008444956206279203003270200000000031605700003034c03210571000203190337072c020000000a0320074303620012032702000000000321057000050321057100060316034b0356072f02000000080743036200130327020000000005700005032105710006031703170743036a000105700005033a05700006032105710007031703160312034205700005031603420317034c0342034c057000030342034903540342034c032105710002034c03210317034c0316034c03210317034c031605700003031703170317031606550765036e0765036e036200000009257472616e73666572072f0200000008074303620000032702000000000743036a000005700003057000030342057000030342034d0743036a000105700003033a0743036e0100000024747a314b65326837734464616b484a5168385758345a3337326475314b4368736b7379550555036c072f020000000807430362000903270200000000034c0743036c030b034d05700002053d036d05700002031b05700002031b0342" + +let script_bytes : Bytes.t option = Hex.to_bytes script_hex + +let script_opt : Script_repr.expr option = + Option.bind + script_bytes + (Data_encoding.Binary.of_bytes_opt Script_repr.expr_encoding) + +let script : Script_repr.expr = + Option.value_f ~default:(fun () -> assert false) script_opt diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_lqt.ml b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_lqt.ml new file mode 100644 index 000000000000..80c92e523d0f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_lqt.ml @@ -0,0 +1,13 @@ +let script_hex : Hex.t = + `Hex + "020000070005000764076407640865046e00000008257370656e6465720462000000062576616c75650000000825617070726f766508650865046e00000006256f776e6572046e00000008257370656e646572000000082572657175657374065a0362000000092563616c6c6261636b0000000d25676574416c6c6f77616e636507640865046e00000006256f776e6572065a0362000000092563616c6c6261636b0000000b2567657442616c616e63650865046c000000082572657175657374065a0362000000092563616c6c6261636b0000000f25676574546f74616c537570706c7907640865045b00000009257175616e74697479046e00000007257461726765740000000b256d696e744f724275726e0865046e000000052566726f6d0765046e0000000325746f0462000000062576616c756500000009257472616e73666572050107650861036e03620000000725746f6b656e73076508610765046e00000006256f776e6572046e00000008257370656e64657203620000000b25616c6c6f77616e6365730765046e000000062561646d696e04620000000d25746f74616c5f737570706c7905020200000552032103170743036a000003130319033c072c020000001607430368010000000b446f6e7453656e6454657a03270200000000034c0316072e02000001b2072e0200000132072e02000000e2034c03210571000203170316034c0321057100020316034803420743036200000570000303210571000403170319032a07430362000005700003032105710004057000030321057100040329072f020000000607430362000002000000000319032a0314072c0200000020074303680100000015556e73616665416c6c6f77616e63654368616e676503270200000000057000030321057100040317031705700002057000030317074303620000034c03210571000203190325072c02000000060320053e0362020000000203460570000303500342034c03160342053d036d03420200000044034c032105700002053d036d034c03210571000203170743036a000005700004031703160570000403160329072f02000000060743036200000200000000034d031b03420200000074072e0200000042034c032105700002053d036d034c03210571000203170743036a00000570000403160570000403160329072f02000000060743036200000200000000034d031b03420200000026034c032105700002053d036d034c03170743036a000005700003031703170317034d031b0342020000035e072e020000013c034c03210571000203170317031603480319033c072c02000000140743036801000000094f6e6c7941646d696e03270200000000032103160570000203210571000303160570000203210571000303170329072f0200000006074303620000020000000003120356072f020000003607430368010000002b43616e6e6f74206275726e206d6f7265207468616e207468652074617267657427732062616c616e63652e03270200000000034c032105710002031605700003032105710004031703170317031203110570000303210571000403170570000403160743036200000570000403210571000503190325072c020000000a057000030320053e03620200000006057000030346057000040317035003420321057100020317031703160342034c032105710002031703160342034c03160342053d036d03420200000216034c03210571000203170316057000020321057100030316057000020321057100030316034803190325072c0200000002034c02000000a903480570000303210571000403160342057000030321057100040317031705700003032105710004057000020321057100030329072f02000000060743036200000200000000034b0356072f020000001d0743036801000000124e6f74456e6f756768416c6c6f77616e636503270200000000057000030743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c03460570000203500570000203210571000303170317057000020321057100030570000403210571000503160329072f02000000060743036200000200000000034b0356072f020000001b0743036801000000104e6f74456e6f75676842616c616e636503270200000000057000020743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c034605700003032105710004031603500570000203210571000303170317034c03210571000205700004032105710005031703160329072f020000000607430362000002000000000312034c0743036200000570000203210571000303190325072c0200000008034c0320053e03620200000004034c034605700003031703160350057000020317034c0342032103170317057000020342034c03160342053d036d0342" + +let script_bytes : Bytes.t option = Hex.to_bytes script_hex + +let script_opt : Script_repr.expr option = + Option.bind + script_bytes + (Data_encoding.Binary.of_bytes_opt Script_repr.expr_encoding) + +let script : Script_repr.expr = + Option.value_f ~default:(fun () -> assert false) script_opt diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.ml b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.ml new file mode 100644 index 000000000000..59a8eb2c6549 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.ml @@ -0,0 +1,244 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module is used to originate contracts for liquidity baking during + protocol stitching: a CPMM (constant product market making) contract and a + liquidity token FA1.2 contract, with the storage of each containing the + other's address. + + The CPMM's storage contains a token address, which corresponds to tzBTC when + originated on mainnet and a reference FA1.2 contract when originated for + testing. + + The test FA1.2 contract uses the same script as the liquidity token. Its + manager is initialized to the first bootstrap account. Before originating it, + we make sure we are not on mainnet by both checking for the existence of the + tzBTC contract and that the level is sufficiently low. + + The Michelson and Ligo code, as well as Coq proofs, for the CPMM and + liquidity token contracts are available here: + https://gitlab.com/dexter2tz/dexter2tz/-/tree/liquidity_baking + + All contracts were generated from Ligo at revision + 4d10d07ca05abe0f8a5fb97d15267bf5d339d9f4 and converted to OCaml using + `octez-client convert`. +*) + +open Michelson_v1_primitives +open Micheline + +let null_address = + Bytes.of_string + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + +let mainnet_tzBTC_address = + Contract_hash.of_b58check_exn "KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn" + +(** If token_pool, xtz_pool, or lqt_total are ever zero the CPMM will be + permanently broken. Therefore, we initialize it with the null address + registered as a liquidity provider with 1 satoshi tzBTC and 100 mutez + (roughly the current exchange rate). *) +let cpmm_init_storage ~token_address ~lqt_address = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [ + Int (1, Z.one); + Int (2, Z.of_int 100); + Int (3, Z.of_int 100); + String (4, token_address); + String (5, lqt_address); + ], + [] ))) + +let lqt_init_storage cpmm_address = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [ + Seq + ( 1, + [ + Prim + ( 2, + D_Elt, + [Bytes (3, null_address); Int (4, Z.of_int 100)], + [] ); + ] ); + Seq (5, []); + String (6, cpmm_address); + Int (7, Z.of_int 100); + ], + [] ))) + +let test_fa12_init_storage manager = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [ + Seq (1, []); + Seq (2, []); + String (3, manager); + Int (4, Z.of_int 10_000); + ], + [] ))) + +let originate ctxt address_hash ~balance script = + Contract_storage.raw_originate + ctxt + ~prepaid_bootstrap_storage:true + address_hash + ~script + >>=? fun ctxt -> + let address = Contract_repr.Originated address_hash in + Contract_storage.used_storage_space ctxt address >>=? fun size -> + Fees_storage.burn_origination_fees + ~origin:Protocol_migration + ctxt + ~storage_limit:(Z.of_int64 Int64.max_int) + ~payer:`Liquidity_baking_subsidies + >>=? fun (ctxt, _, origination_updates) -> + Fees_storage.burn_storage_fees + ~origin:Protocol_migration + ctxt + ~storage_limit:(Z.of_int64 Int64.max_int) + ~payer:`Liquidity_baking_subsidies + size + >>=? fun (ctxt, _, storage_updates) -> + Token.transfer + ~origin:Protocol_migration + ctxt + `Liquidity_baking_subsidies + (`Contract address) + balance + >>=? fun (ctxt, transfer_updates) -> + let balance_updates = + origination_updates @ storage_updates @ transfer_updates + in + let result : Migration_repr.origination_result = + { + balance_updates; + originated_contracts = [address_hash]; + storage_size = size; + paid_storage_size_diff = size; + } + in + return (ctxt, result) + +let originate_test_fa12 ~typecheck ctxt admin = + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, fa12_address) -> + let script = + Script_repr. + { + code = Script_repr.lazy_expr Liquidity_baking_lqt.script; + storage = + test_fa12_init_storage (Signature.Public_key_hash.to_b58check admin); + } + in + typecheck ctxt script >>=? fun (script, ctxt) -> + originate ctxt fa12_address ~balance:(Tez_repr.of_mutez_exn 1_000_000L) script + >|=? fun (ctxt, origination_result) -> + (ctxt, fa12_address, [origination_result]) + +(* hardcoded from lib_parameters *) +let first_bootstrap_account = + Signature.Public_key.hash + (Signature.Public_key.of_b58check_exn + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav") + +let check_tzBTC ~typecheck current_level ctxt f = + Contract_storage.exists ctxt (Contract_repr.Originated mainnet_tzBTC_address) + >>= function + | true -> + (* If tzBTC exists, we're on mainnet and we use it as the token address in the CPMM. *) + f ctxt mainnet_tzBTC_address [] + | false -> + (* If the tzBTC contract does not exist, we originate a test FA1.2 contract using the same script as the LQT. This is so that we can test the contracts after performing the same protocol migration that will be done on mainnet. + + First, we check current level is below mainnet level roughly around 010 injection so we do not accidentally originate the test token contract on mainnet. *) + if Compare.Int32.(current_level < 1_437_862l) then + originate_test_fa12 ~typecheck ctxt first_bootstrap_account + (* Token contract admin *) + >>=? fun (ctxt, token_address, token_result) -> + f ctxt token_address token_result + else + (* If we accidentally entered the tzBTC address incorrectly, but current level indicates this could be mainnet, we do not originate any contracts *) + return (ctxt, []) + +let init ctxt ~typecheck = + (* We use a custom origination nonce because it is unset when stitching from 009 *) + let nonce = Operation_hash.hash_string ["Drip, drip, drip."] in + let ctxt = Raw_context.init_origination_nonce ctxt nonce in + Storage.Liquidity_baking.Toggle_ema.init ctxt 0l >>=? fun ctxt -> + let current_level = + Raw_level_repr.to_int32 (Level_storage.current ctxt).level + in + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, cpmm_address) -> + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, lqt_address) -> + Storage.Liquidity_baking.Cpmm_address.init ctxt cpmm_address >>=? fun ctxt -> + check_tzBTC + ~typecheck + current_level + ctxt + (fun ctxt token_address token_result -> + let cpmm_script = + Script_repr. + { + code = Script_repr.lazy_expr Liquidity_baking_cpmm.script; + storage = + cpmm_init_storage + ~token_address:(Contract_hash.to_b58check token_address) + ~lqt_address:(Contract_hash.to_b58check lqt_address); + } + in + typecheck ctxt cpmm_script >>=? fun (cpmm_script, ctxt) -> + let lqt_script = + Script_repr. + { + code = Script_repr.lazy_expr Liquidity_baking_lqt.script; + storage = lqt_init_storage (Contract_hash.to_b58check cpmm_address); + } + in + typecheck ctxt lqt_script >>=? fun (lqt_script, ctxt) -> + originate + ctxt + cpmm_address + ~balance:(Tez_repr.of_mutez_exn 100L) + cpmm_script + >>=? fun (ctxt, cpmm_result) -> + originate ctxt lqt_address ~balance:Tez_repr.zero lqt_script + >|=? fun (ctxt, lqt_result) -> + (* Unsets the origination nonce, which is okay because this is called after other originations in stitching. *) + let ctxt = Raw_context.unset_origination_nonce ctxt in + (ctxt, [cpmm_result; lqt_result] @ token_result)) diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.mli b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.mli new file mode 100644 index 000000000000..27059e493d50 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_migration.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val init : + Raw_context.t -> + typecheck: + (Raw_context.t -> + Script_repr.t -> + ((Script_repr.t * Lazy_storage_diff.diffs option) * Raw_context.t) tzresult + Lwt.t) -> + (Raw_context.t * Migration_repr.origination_result list) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.ml b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.ml new file mode 100644 index 000000000000..09ea87b0e4c4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.ml @@ -0,0 +1,122 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Options available for the Liquidity Baking per-block vote *) + +type liquidity_baking_toggle_vote = LB_on | LB_off | LB_pass + +let liquidity_baking_toggle_vote_encoding = + let of_int8 = function + | 0 -> Ok LB_on + | 1 -> Ok LB_off + | 2 -> Ok LB_pass + | _ -> Error "liquidity_baking_toggle_vote_of_int8" + in + let to_int8 = function LB_on -> 0 | LB_off -> 1 | LB_pass -> 2 in + let open Data_encoding in + (* union *) + def "liquidity_baking_toggle_vote" + @@ splitted + ~binary:(conv_with_guard to_int8 of_int8 int8) + ~json:(string_enum [("on", LB_on); ("off", LB_off); ("pass", LB_pass)]) + +module Toggle_EMA : sig + (* The exponential moving average is represented as an Int32 between 0l and 2_000_000_000l *) + + type t + + val zero : t + + val of_int32 : Int32.t -> t tzresult Lwt.t + + val to_int32 : t -> Int32.t + + val update_ema_off : t -> t + + val update_ema_on : t -> t + + val ( < ) : t -> Int32.t -> bool + + val encoding : t Data_encoding.t +end = struct + type t = Int32.t (* Invariant 0 <= ema <= 2_000_000_000l *) + + (* This error is not registered because we don't expect it to be + raised. *) + type error += Liquidity_baking_toggle_ema_out_of_bound of Int32.t + + let check_bounds x = Compare.Int32.(0l <= x && x <= 2_000_000_000l) + + let of_int32 x = + if check_bounds x then return x + else tzfail @@ Liquidity_baking_toggle_ema_out_of_bound x + + let zero = Int32.zero + + (* The conv_with_guard combinator of Data_encoding expects a (_, string) result. *) + let of_int32_for_encoding x = + if check_bounds x then Ok x else Error "out of bounds" + + let to_int32 ema = ema + + (* We perform the computations in Z to avoid overflows. *) + + let z_1999 = Z.of_int 1999 + + let z_2000 = Z.of_int 2000 + + let attenuate z = Z.(div (mul z_1999 z) z_2000) + + let z_1_000_000_000 = Z.of_int 1_000_000_000 + + (* Outside of this module, the EMA is always between 0 and 2,000,000,000. + This [recenter] wrappers, puts it in between -1,000,000,000 and 1,000,000,000. + The goal of this recentering around zero is to make [update_ema_off] and + [update_ema_on] behave symmetrically with respect to rounding. *) + let recenter f ema = Z.(add z_1_000_000_000 (f (sub ema z_1_000_000_000))) + + let z_500_000 = Z.of_int 500_000 + + let update_ema_off ema = + let ema = Z.of_int32 ema in + recenter (fun ema -> Z.add (attenuate ema) z_500_000) ema |> Z.to_int32 + + let update_ema_on ema = + let ema = Z.of_int32 ema in + recenter (fun ema -> Z.sub (attenuate ema) z_500_000) ema |> Z.to_int32 + + let ( < ) = Compare.Int32.( < ) + + let encoding = + Data_encoding.(conv_with_guard to_int32 of_int32_for_encoding int32) +end + +(* Invariant: 0 <= ema <= 2_000_000 *) +let compute_new_ema ~toggle_vote ema = + match toggle_vote with + | LB_pass -> ema + | LB_off -> Toggle_EMA.update_ema_off ema + | LB_on -> Toggle_EMA.update_ema_on ema diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.mli b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.mli new file mode 100644 index 000000000000..a41f80d5835b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_repr.mli @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Options available for the Liquidity Baking per-block vote *) + +type liquidity_baking_toggle_vote = LB_on | LB_off | LB_pass + +val liquidity_baking_toggle_vote_encoding : + liquidity_baking_toggle_vote Data_encoding.encoding + +(** Exponential moving average of toggle votes. Represented as an int32 between + 0 and 2,000,000. It is an exponential moving average of the [LB_off] votes + over a window of the most recent 2000 blocks that did not vote [LB_pass]. *) + +module Toggle_EMA : sig + type t + + val of_int32 : Int32.t -> t tzresult Lwt.t + + val zero : t + + val to_int32 : t -> Int32.t + + val encoding : t Data_encoding.t + + val ( < ) : t -> Int32.t -> bool +end + +(** [compute_new_ema ~toggle_vote old_ema] returns the value [new_ema] of the + exponential moving average [old_ema] updated by the vote [toggle_vote]. + + It is updated as follows: + - if [toggle_vote] is [LB_pass] then [new_ema] = [old_ema], + - if [toggle_vote] is [LB_off], then [new_ema] = (1999 * ema[n] // 2000) + 1,000,000, + - if [toggle_vote] is [LB_on], then [new_ema] = (1999 * ema[n] // 2000). + + The multiplication is performed in [Z.t] to avoid overflows, division is + rounded toward 1,000,000,000 (the middle of the interval). + *) +val compute_new_ema : + toggle_vote:liquidity_baking_toggle_vote -> Toggle_EMA.t -> Toggle_EMA.t diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.ml b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.ml new file mode 100644 index 000000000000..56c6f3746ad7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.ml @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Liquidity_baking_repr + +let get_cpmm_address = Storage.Liquidity_baking.Cpmm_address.get + +let get_toggle_ema ctxt = + Storage.Liquidity_baking.Toggle_ema.get ctxt >>=? fun ema -> + Toggle_EMA.of_int32 ema + +let on_cpmm_exists ctxt f = + get_cpmm_address ctxt >>=? fun cpmm_contract -> + Contract_storage.exists ctxt (Contract_repr.Originated cpmm_contract) + >>= function + | false -> + (* do nothing if the cpmm is not found *) + return (ctxt, []) + | true -> f ctxt cpmm_contract + +let update_toggle_ema ctxt ~toggle_vote = + get_toggle_ema ctxt >>=? fun old_ema -> + let new_ema = compute_new_ema ~toggle_vote old_ema in + Storage.Liquidity_baking.Toggle_ema.update ctxt (Toggle_EMA.to_int32 new_ema) + >|=? fun ctxt -> (ctxt, new_ema) + +let check_ema_below_threshold ctxt ema = + Toggle_EMA.( + ema < Constants_storage.liquidity_baking_toggle_ema_threshold ctxt) + +let on_subsidy_allowed ctxt ~toggle_vote f = + update_toggle_ema ctxt ~toggle_vote >>=? fun (ctxt, toggle_ema) -> + if check_ema_below_threshold ctxt toggle_ema then + on_cpmm_exists ctxt f >|=? fun (ctxt, operation_results) -> + (ctxt, operation_results, toggle_ema) + else return (ctxt, [], toggle_ema) diff --git a/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.mli b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.mli new file mode 100644 index 000000000000..f1d0d5886292 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/liquidity_baking_storage.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Get the address of the Constant-Product Market Maker receiving the + Liquidity Baking subsidy *) +val get_cpmm_address : Raw_context.t -> Contract_hash.t tzresult Lwt.t + +(** [on_subsidy_allowed ctxt ~toggle_vote f] updates the toggle EMA according to + [toggle_vote]. Then the callback function [f] is called if the following + conditions are met: + - the updated EMA is below the threshold, + - the CPMM contract exists. + + The role of the callback function [f] is to send the subsidy to the CPMM, + see [apply_liquidity_baking_subsidy] in [apply.ml]. *) +val on_subsidy_allowed : + Raw_context.t -> + toggle_vote:Liquidity_baking_repr.liquidity_baking_toggle_vote -> + (Raw_context.t -> Contract_hash.t -> (Raw_context.t * 'a list) tzresult Lwt.t) -> + (Raw_context.t * 'a list * Liquidity_baking_repr.Toggle_EMA.t) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.ml b/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.ml new file mode 100644 index 000000000000..868ee3abd6ef --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.ml @@ -0,0 +1,95 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(* + + Gas update and check for gas exhaustion + ======================================= + + Costs of various computations are subtracted from an amount of gas made + available for the script execution. + + Updating the gas counter is a critical aspect to operation validation + because it is done at many places. + + For this reason, the gas counter must be read and updated as quickly as + possible. Hence, the gas counter should be stored in a machine register. To + motivate the OCaml compiler to make that choice, we represent the gas counter + as a local parameter of the execution [step] function. + +*) + +type local_gas_counter = Local_gas_counter of int [@@ocaml.unboxed] + +(* + + The gas counter stored in the context is de-synchronized with the + [local_gas_counter] used locally. When we have to call a gas-consuming + function working on context with no local gas counter, we must update the + context so that it carries an up-to-date gas counter. Similarly, when we + return from such a function, the [local_gas_counter] must be updated as well. + + To statically track these points where the context's gas counter must be + updated, we introduce a type for outdated contexts. The [step] function + carries an [outdated_context]. When an external function needs a [context], + the typechecker points out the need for a conversion: this forces us to + either call [update_context], or better, when this is possible, the function + [use_gas_counter_in_context]. +*) +type outdated_context = Outdated_context of context [@@ocaml.unboxed] + +let outdated_context ctxt = Outdated_context ctxt [@@ocaml.inline always] + +let update_context (Local_gas_counter gas_counter) (Outdated_context ctxt) = + Gas.update_remaining_operation_gas ctxt (Gas.fp_of_milligas_int gas_counter) + [@@ocaml.inline always] + +let local_gas_counter ctxt = + Local_gas_counter (Gas.remaining_operation_gas ctxt :> int) + [@@ocaml.inline always] + +let local_gas_counter_and_outdated_context ctxt = + (local_gas_counter ctxt, outdated_context ctxt) + [@@ocaml.inline always] + +let use_gas_counter_in_context ctxt gas_counter f = + let ctxt = update_context gas_counter ctxt in + f ctxt >|=? fun (y, ctxt) -> (y, outdated_context ctxt, local_gas_counter ctxt) + [@@ocaml.inline always] + +let consume_opt (Local_gas_counter gas_counter) (cost : Gas.cost) = + let gas_counter = gas_counter - (cost :> int) in + if Compare.Int.(gas_counter < 0) then None + else Some (Local_gas_counter gas_counter) + [@@ocaml.inline always] + +let consume local_gas_counter cost = + match consume_opt local_gas_counter cost with + | None -> error Gas.Operation_quota_exceeded + | Some local_gas_counter -> Ok local_gas_counter + [@@ocaml.inline always] diff --git a/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.mli b/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.mli new file mode 100644 index 000000000000..0f2555eab36a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/local_gas_counter.mli @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module exposes an API for local gas counting. It provides a set of + functions for updating a gas counter without applying it on an + an [Alpha_context.context]. *) + +(** A [local_gas_counter] is a wrapped [int]. *) +type local_gas_counter = Local_gas_counter of int [@@ocaml.unboxed] + +(** A type for describing a context that is not up to date with respect to gas + consumption. *) +type outdated_context + +(*** [update_context gas_counter outdated_ctxt] returns a regular context, + extracted from [outdated_ctxt] with [gas_counter] applied. *) +val update_context : + local_gas_counter -> outdated_context -> Alpha_context.context + +(** [local_gas_counter_and_outdated_context ctxt] returns the gas counter value + corresponding to the remaining gas in the given context [ctxt] along with + an [outdated_context] value. *) +val local_gas_counter_and_outdated_context : + Alpha_context.context -> local_gas_counter * outdated_context + +(** [use_gas_counter_in_context outdated_ctxt gas_counter f] first applies the + [gas_counter] on the outdated context [outdated_ctxt], then invokes [f] on + the resulting context, and returns a new [outdated_context] and a + [local_gas_counter] value. *) +val use_gas_counter_in_context : + outdated_context -> + local_gas_counter -> + (Alpha_context.context -> ('a * Alpha_context.context) tzresult Lwt.t) -> + ('a * outdated_context * local_gas_counter) tzresult Lwt.t + +(** [consume_opt amt cost] attempts to consume an [amt] of gas and returns the + new remaining value wrapped in [Some]. If the resulting gas is negative + [None] is returned. *) +val consume_opt : + local_gas_counter -> Alpha_context.Gas.cost -> local_gas_counter option + +(** [consume amt cost] attempts to consume an [amt] of gas and returns the + new remaining value as a result. If the resulting gas is negative, + an error [Gas.Operation_quota_exceeded] is instead returned. *) +val consume : + local_gas_counter -> Alpha_context.Gas.cost -> local_gas_counter tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/main.ml b/src/proto_016_PtMumbai/lib_protocol/main.ml new file mode 100644 index 000000000000..8dba30c32503 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/main.ml @@ -0,0 +1,425 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Tezos Protocol Implementation - Protocol Signature Instance *) + +type block_header_data = Alpha_context.Block_header.protocol_data + +type block_header = Alpha_context.Block_header.t = { + shell : Block_header.shell_header; + protocol_data : block_header_data; +} + +let block_header_data_encoding = + Alpha_context.Block_header.protocol_data_encoding + +type block_header_metadata = Apply_results.block_metadata + +let block_header_metadata_encoding = Apply_results.block_metadata_encoding + +type operation_data = Alpha_context.packed_protocol_data = + | Operation_data : + 'kind Alpha_context.Operation.protocol_data + -> operation_data + +let operation_data_encoding = Alpha_context.Operation.protocol_data_encoding + +type operation_receipt = Apply_results.packed_operation_metadata = + | Operation_metadata : + 'kind Apply_results.operation_metadata + -> operation_receipt + | No_operation_metadata : operation_receipt + +let operation_receipt_encoding = Apply_results.operation_metadata_encoding + +let operation_data_and_receipt_encoding = + Apply_results.operation_data_and_metadata_encoding + +type operation = Alpha_context.packed_operation = { + shell : Operation.shell_header; + protocol_data : operation_data; +} + +let acceptable_pass = Alpha_context.Operation.acceptable_pass + +let max_block_length = Alpha_context.Block_header.max_header_length + +let max_operation_data_length = + Alpha_context.Constants.max_operation_data_length + +let validation_passes = + let open Alpha_context.Constants in + Updater. + [ + (* 2048 endorsements *) + {max_size = 2048 * 2048; max_op = Some 2048}; + (* 32k of voting operations *) + {max_size = 32 * 1024; max_op = None}; + (* revelations, wallet activations and denunciations *) + { + max_size = max_anon_ops_per_block * 1024; + max_op = Some max_anon_ops_per_block; + }; + (* 512kB *) + {max_size = 512 * 1024; max_op = None}; + ] + +let rpc_services = + Alpha_services.register () ; + Services_registration.get_rpc_services () + +type validation_state = Validate.validation_state + +type application_state = Apply.application_state + +let init_allowed_consensus_operations ctxt ~endorsement_level + ~preendorsement_level = + let open Lwt_result_syntax in + let open Alpha_context in + let* ctxt = Delegate.prepare_stake_distribution ctxt in + let* ctxt, allowed_endorsements, allowed_preendorsements = + if Level.(endorsement_level = preendorsement_level) then + let* ctxt, slots = + Baking.endorsing_rights_by_first_slot ctxt endorsement_level + in + let consensus_operations = slots in + return (ctxt, consensus_operations, consensus_operations) + else + let* ctxt, endorsements = + Baking.endorsing_rights_by_first_slot ctxt endorsement_level + in + let* ctxt, preendorsements = + Baking.endorsing_rights_by_first_slot ctxt preendorsement_level + in + return (ctxt, endorsements, preendorsements) + in + let ctxt = + Consensus.initialize_consensus_operation + ctxt + ~allowed_endorsements + ~allowed_preendorsements + in + return ctxt + +(** Circumstances and relevant information for [begin_validation] and + [begin_application] below. *) +type mode = + | Application of block_header + | Partial_validation of block_header + | Construction of { + predecessor_hash : Block_hash.t; + timestamp : Time.t; + block_header_data : block_header_data; + } + | Partial_construction of { + predecessor_hash : Block_hash.t; + timestamp : Time.t; + } + +let prepare_ctxt ctxt mode ~(predecessor : Block_header.shell_header) = + let open Lwt_result_syntax in + let open Alpha_context in + let level, timestamp = + match mode with + | Application block_header | Partial_validation block_header -> + (block_header.shell.level, block_header.shell.timestamp) + | Construction {timestamp; _} | Partial_construction {timestamp; _} -> + (Int32.succ predecessor.level, timestamp) + in + let* ctxt, migration_balance_updates, migration_operation_results = + prepare ctxt ~level ~predecessor_timestamp:predecessor.timestamp ~timestamp + in + let*? predecessor_raw_level = Raw_level.of_int32 predecessor.level in + let predecessor_level = Level.from_raw ctxt predecessor_raw_level in + (* During block (full or partial) application or full construction, + endorsements must be for [predecessor_level] and preendorsements, + if any, for the block's level. In the mempool (partial + construction), only consensus operations for [predecessor_level] + (that is, head's level) are allowed (except for grandparent + endorsements, which are handled differently). *) + let preendorsement_level = + match mode with + | Application _ | Partial_validation _ | Construction _ -> + Level.current ctxt + | Partial_construction _ -> predecessor_level + in + let* ctxt = + init_allowed_consensus_operations + ctxt + ~endorsement_level:predecessor_level + ~preendorsement_level + in + Dal_apply.initialisation ~level:predecessor_level ctxt >>=? fun ctxt -> + return + ( ctxt, + migration_balance_updates, + migration_operation_results, + predecessor_level, + predecessor_raw_level ) + +let begin_validation ctxt chain_id mode ~predecessor = + let open Lwt_result_syntax in + let open Alpha_context in + let* ( ctxt, + _migration_balance_updates, + _migration_operation_results, + predecessor_level, + _predecessor_raw_level ) = + prepare_ctxt ctxt ~predecessor mode + in + let predecessor_timestamp = predecessor.timestamp in + let predecessor_fitness = predecessor.fitness in + match mode with + | Application block_header -> + let*? fitness = Fitness.from_raw block_header.shell.fitness in + Validate.begin_application + ctxt + chain_id + ~predecessor_level + ~predecessor_timestamp + block_header + fitness + | Partial_validation block_header -> + let*? fitness = Fitness.from_raw block_header.shell.fitness in + Validate.begin_partial_validation + ctxt + chain_id + ~predecessor_level + ~predecessor_timestamp + block_header + fitness + | Construction {predecessor_hash; timestamp; block_header_data} -> + let*? predecessor_round = Fitness.round_from_raw predecessor_fitness in + let*? round = + Round.round_of_timestamp + (Constants.round_durations ctxt) + ~predecessor_timestamp + ~predecessor_round + ~timestamp + in + Validate.begin_full_construction + ctxt + chain_id + ~predecessor_level + ~predecessor_round + ~predecessor_timestamp + ~predecessor_hash + round + block_header_data.contents + | Partial_construction _ -> + let*? predecessor_round = Fitness.round_from_raw predecessor_fitness in + let*? grandparent_round = + Fitness.predecessor_round_from_raw predecessor_fitness + in + return + (Validate.begin_partial_construction + ctxt + chain_id + ~predecessor_level + ~predecessor_round + ~grandparent_round) + +let validate_operation = Validate.validate_operation + +let finalize_validation = Validate.finalize_block + +type error += Cannot_apply_in_partial_validation + +let () = + register_error_kind + `Permanent + ~id:"main.begin_application.cannot_apply_in_partial_validation" + ~title:"cannot_apply_in_partial_validation" + ~description: + "Cannot instantiate an application state using the 'Partial_validation' \ + mode." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Cannot instantiate an application state using the \ + 'Partial_validation' mode.") + Data_encoding.(empty) + (function Cannot_apply_in_partial_validation -> Some () | _ -> None) + (fun () -> Cannot_apply_in_partial_validation) + +let begin_application ctxt chain_id mode ~predecessor = + let open Lwt_result_syntax in + let open Alpha_context in + let* ( ctxt, + migration_balance_updates, + migration_operation_results, + predecessor_level, + predecessor_raw_level ) = + prepare_ctxt ctxt ~predecessor mode + in + let predecessor_timestamp = predecessor.timestamp in + let predecessor_fitness = predecessor.fitness in + match mode with + | Application block_header -> + Apply.begin_application + ctxt + chain_id + ~migration_balance_updates + ~migration_operation_results + ~predecessor_fitness + block_header + | Partial_validation _ -> tzfail Cannot_apply_in_partial_validation + | Construction {predecessor_hash; timestamp; block_header_data; _} -> + let*? predecessor_round = Fitness.round_from_raw predecessor_fitness in + Apply.begin_full_construction + ctxt + chain_id + ~migration_balance_updates + ~migration_operation_results + ~predecessor_timestamp + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~timestamp + block_header_data.contents + | Partial_construction {predecessor_hash; _} -> + Apply.begin_partial_construction + ctxt + chain_id + ~migration_balance_updates + ~migration_operation_results + ~predecessor_level:predecessor_raw_level + ~predecessor_hash + ~predecessor_fitness + +let apply_operation = Apply.apply_operation + +let finalize_application = Apply.finalize_block + +let compare_operations (oph1, op1) (oph2, op2) = + Alpha_context.Operation.compare (oph1, op1) (oph2, op2) + +let init chain_id ctxt block_header = + let level = block_header.Block_header.level in + let timestamp = block_header.timestamp in + let predecessor = block_header.predecessor in + let typecheck (ctxt : Alpha_context.context) (script : Alpha_context.Script.t) + = + let allow_forged_in_storage = + false + (* There should be no forged value in bootstrap contracts. *) + in + Script_ir_translator.parse_script + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ~allow_forged_in_storage + script + >>=? fun (Ex_script (Script parsed_script), ctxt) -> + Script_ir_translator.extract_lazy_storage_diff + ctxt + Optimized + parsed_script.storage_type + parsed_script.storage + ~to_duplicate:Script_ir_translator.no_lazy_storage_id + ~to_update:Script_ir_translator.no_lazy_storage_id + ~temporary:false + >>=? fun (storage, lazy_storage_diff, ctxt) -> + Script_ir_translator.unparse_data + ctxt + Optimized + parsed_script.storage_type + storage + >|=? fun (storage, ctxt) -> + let storage = Alpha_context.Script.lazy_expr storage in + (({script with storage}, lazy_storage_diff), ctxt) + in + (* The cache must be synced at the end of block validation, so we do + so here for the first block in a protocol where `finalize_block` + is not called. *) + Alpha_context.Raw_level.of_int32 level >>?= fun raw_level -> + let init_fitness = + Alpha_context.Fitness.create_without_locked_round + ~level:raw_level + ~round:Alpha_context.Round.zero + ~predecessor_round:Alpha_context.Round.zero + in + Alpha_context.prepare_first_block + chain_id + ~typecheck + ~level + ~timestamp + ~predecessor + ctxt + >>=? fun ctxt -> + let cache_nonce = + Alpha_context.Cache.cache_nonce_from_block_header + block_header + ({ + payload_hash = Block_payload_hash.zero; + payload_round = Alpha_context.Round.zero; + liquidity_baking_toggle_vote = Alpha_context.Liquidity_baking.LB_pass; + seed_nonce_hash = None; + proof_of_work_nonce = + Bytes.make Constants_repr.proof_of_work_nonce_size '0'; + } + : Alpha_context.Block_header.contents) + in + Alpha_context.Cache.Admin.sync ctxt cache_nonce >>= fun ctxt -> + return + (Alpha_context.finalize ctxt (Alpha_context.Fitness.to_raw init_fitness)) + +let value_of_key ~chain_id:_ ~predecessor_context:ctxt ~predecessor_timestamp + ~predecessor_level:pred_level ~predecessor_fitness:_ ~predecessor:_ + ~timestamp = + let level = Int32.succ pred_level in + Alpha_context.prepare ctxt ~level ~predecessor_timestamp ~timestamp + >>=? fun (ctxt, _, _) -> return (Apply.value_of_key ctxt) + +module Mempool = struct + include Mempool_validation + + let init ctxt chain_id ~head_hash ~(head : Block_header.shell_header) = + let open Lwt_result_syntax in + let open Alpha_context in + let* ( ctxt, + _migration_balance_updates, + _migration_operation_results, + head_level, + _head_raw_level ) = + (* We use Partial_construction to factorize the [prepare_ctxt]. *) + prepare_ctxt + ctxt + (Partial_construction + {predecessor_hash = head_hash; timestamp = head.timestamp}) + ~predecessor:head + in + let*? predecessor_round = Fitness.round_from_raw head.fitness in + let*? grandparent_round = Fitness.predecessor_round_from_raw head.fitness in + return + (init + ctxt + chain_id + ~predecessor_level:head_level + ~predecessor_round + ~predecessor_hash:head_hash + ~grandparent_round) +end + +(* Vanity nonce: 6455568396538124 *) diff --git a/src/proto_016_PtMumbai/lib_protocol/main.mli b/src/proto_016_PtMumbai/lib_protocol/main.mli new file mode 100644 index 000000000000..d6d5913c57da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/main.mli @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Protocol Signature Instance + + This module is the entrypoint to the protocol for shells and other + embedders. This signature is an instance of + {{!Tezos_protocol_environment_sigs.V7.T.Updater.PROTOCOL} the + [Updater.PROTOCOL] signature} from the + {{:https://tezos.gitlab.io/shell/the_big_picture.html#the-economic-protocol-environment-and-compiler} + Protocol Environment}. + + Each Protocol depends on a version of the Protocol Environment. For the + currently developed protocol, this is normally the latest version. You can + see {{!Tezos_protocol_environment_sigs} the full list of versions here}. + + For details on how Protocol and Environment interact, see + {{:https://tezos.gitlab.io/shell/the_big_picture.html} this overview}. + *) + +type operation_data = Alpha_context.packed_protocol_data + +type operation = Alpha_context.packed_operation = { + shell : Operation.shell_header; + protocol_data : operation_data; +} + +include + Updater.PROTOCOL + with type block_header_data = Alpha_context.Block_header.protocol_data + and type block_header_metadata = Apply_results.block_metadata + and type block_header = Alpha_context.Block_header.t + and type operation_data := operation_data + and type operation_receipt = Apply_results.packed_operation_metadata + and type operation := operation + and type validation_state = Validate.validation_state + and type application_state = Apply.application_state diff --git a/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.ml b/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.ml new file mode 100644 index 000000000000..9e93014af743 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.ml @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Compare.Z + +let init = Z.zero + +let succ = Z.succ + +let pp = Z.pp_print + +let encoding_for_storage = Data_encoding.z + +let encoding_for_operation = Data_encoding.(check_size 10 n) + +let encoding_for_RPCs = Data_encoding.n + +let encoding_for_errors = Data_encoding.z + +module Internal_for_injection = struct + let of_string s = + match Z.of_string s with + | exception _ -> None + | z -> if z < Z.zero then None else Some z +end + +module Internal_for_tests = struct + let of_int i = + assert (Compare.Int.(i >= 0)) ; + Z.of_int i + + let to_int = Z.to_int + + let add c i = + let c = Z.(add c (of_int i)) in + assert (c >= Z.zero) ; + c +end diff --git a/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.mli b/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.mli new file mode 100644 index 000000000000..50fdf8e1ded5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/manager_counter_repr.mli @@ -0,0 +1,69 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Counters are used as anti-replay protection mechanism in + manager operations: each manager account stores a counter and + each manager operation declares a value for the counter. When + a manager operation is applied, the value of the counter of + its manager is checked and incremented. *) + +include Compare.S + +(** Initial value for a counter (zero). *) +val init : t + +(** Successor of a counter. *) +val succ : t -> t + +(** Pretty-printer for counters. *) +val pp : Format.formatter -> t -> unit + +(** Encoding for a counter to be used in {!Storage}. *) +val encoding_for_storage : t Data_encoding.t + +(** Encoding for a counter to be used in {!Operation_repr}. *) +val encoding_for_operation : t Data_encoding.t + +(** Encoding for a counter to be used in RPCs. *) +val encoding_for_RPCs : t Data_encoding.t + +(** Encoding for a counter to be used in errors. *) +val encoding_for_errors : t Data_encoding.t + +(** To be used in client injection only. *) +module Internal_for_injection : sig + (** Converts a string to a counter. + Returns [None] if the string does not represent a valid counter. *) + val of_string : string -> t option +end + +module Internal_for_tests : sig + val of_int : int -> t + + val to_int : t -> int + + val add : t -> int -> t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/manager_repr.ml b/src/proto_016_PtMumbai/lib_protocol/manager_repr.ml new file mode 100644 index 000000000000..b96a51401289 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/manager_repr.ml @@ -0,0 +1,52 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Tezos Protocol Implementation - Low level Repr. of Managers' keys *) + +type manager_key = + | Hash of Signature.Public_key_hash.t + | Public_key of Signature.Public_key.t + +type t = manager_key + +open Data_encoding + +let hash_case tag = + case + tag + ~title:"Public_key_hash" + Signature.Public_key_hash.encoding + (function Hash hash -> Some hash | _ -> None) + (fun hash -> Hash hash) + +let pubkey_case tag = + case + tag + ~title:"Public_key" + Signature.Public_key.encoding + (function Public_key hash -> Some hash | _ -> None) + (fun hash -> Public_key hash) + +let encoding = union [hash_case (Tag 0); pubkey_case (Tag 1)] diff --git a/src/proto_016_PtMumbai/lib_protocol/manager_repr.mli b/src/proto_016_PtMumbai/lib_protocol/manager_repr.mli new file mode 100644 index 000000000000..18ca236d71b1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/manager_repr.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Tezos Protocol Implementation - Low level Repr. of Managers' keys *) + +(** The public key of the manager of a contract is reveled only after the + first operation. At Origination time, the manager provides only the hash + of its public key that is stored in the contract. When the public key + is actually revealed, the public key instead of the hash of the key *) +type manager_key = + | Hash of Signature.Public_key_hash.t + | Public_key of Signature.Public_key.t + +type t = manager_key + +val encoding : t Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/mempool_validation.ml b/src/proto_016_PtMumbai/lib_protocol/mempool_validation.ml new file mode 100644 index 000000000000..8493f18a7e13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/mempool_validation.ml @@ -0,0 +1,221 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Validate + +type t = { + predecessor_hash : Block_hash.t; + operation_state : operation_conflict_state; + operations : packed_operation Operation_hash.Map.t; +} + +type validation_info = Validate.info + +type add_result = Added | Replaced of {removed : Operation_hash.t} | Unchanged + +type operation_conflict = Validate_errors.operation_conflict = + | Operation_conflict of { + existing : Operation_hash.t; + new_operation : Operation_hash.t; + } + +type add_error = + | Validation_error of error trace + | Add_conflict of operation_conflict + +type merge_error = Incompatible_mempool | Merge_conflict of operation_conflict + +let encoding : t Data_encoding.t = + let open Data_encoding in + def "mempool" + @@ conv + (fun {predecessor_hash; operation_state; operations} -> + (predecessor_hash, operation_state, operations)) + (fun (predecessor_hash, operation_state, operations) -> + {predecessor_hash; operation_state; operations}) + @@ obj3 + (req "predecessor_hash" Block_hash.encoding) + (req "operation_state" Validate.operation_conflict_state_encoding) + (req + "operations" + (Operation_hash.Map.encoding + (dynamic_size ~kind:`Uint30 Operation.encoding))) + +let init ctxt chain_id ~predecessor_level ~predecessor_round ~predecessor_hash + ~grandparent_round : validation_info * t = + let {info; operation_state; _} = + begin_partial_construction + ctxt + chain_id + ~predecessor_level + ~predecessor_round + ~grandparent_round + in + ( info, + {predecessor_hash; operation_state; operations = Operation_hash.Map.empty} + ) + +type conflict_handler = + existing_operation:Operation_hash.t * packed_operation -> + new_operation:Operation_hash.t * packed_operation -> + [`Keep | `Replace] + +let remove_operation mempool oph = + match Operation_hash.Map.find_opt oph mempool.operations with + | None -> mempool + | Some {shell; protocol_data = Operation_data protocol_data} -> + let operations = Operation_hash.Map.remove oph mempool.operations in + let operation_state = + remove_operation mempool.operation_state {shell; protocol_data} + in + {mempool with operations; operation_state} + +let add_operation ?(check_signature = true) + ?(conflict_handler : conflict_handler option) info mempool + (oph, (packed_op : packed_operation)) : + (t * add_result, add_error) result Lwt.t = + let open Lwt_syntax in + let {shell; protocol_data = Operation_data protocol_data} = packed_op in + let operation : _ Alpha_context.operation = {shell; protocol_data} in + let* validate_result = check_operation ~check_signature info operation in + match validate_result with + | Error err -> Lwt.return_error (Validation_error err) + | Ok () -> ( + match check_operation_conflict mempool.operation_state oph operation with + | Ok () -> + let operation_state = + add_valid_operation mempool.operation_state oph operation + in + let operations = + Operation_hash.Map.add oph packed_op mempool.operations + in + let result = Added in + Lwt.return_ok ({mempool with operation_state; operations}, result) + | Error + (Validate_errors.Operation_conflict + {existing; new_operation = new_oph} as x) -> ( + match conflict_handler with + | Some handler -> ( + let new_operation = (new_oph, packed_op) in + let existing_operation = + match + Operation_hash.Map.find_opt existing mempool.operations + with + | None -> assert false + | Some op -> (existing, op) + in + match handler ~existing_operation ~new_operation with + | `Keep -> Lwt.return_ok (mempool, Unchanged) + | `Replace -> + let mempool = remove_operation mempool existing in + let operation_state = + add_valid_operation + mempool.operation_state + new_oph + operation + in + let operations = + Operation_hash.Map.add oph packed_op mempool.operations + in + Lwt.return_ok + ( {mempool with operations; operation_state}, + Replaced {removed = existing} )) + | None -> Lwt.return_error (Add_conflict x))) + +let merge ?conflict_handler existing_mempool new_mempool = + if + Block_hash.( + existing_mempool.predecessor_hash <> new_mempool.predecessor_hash) + then Error Incompatible_mempool + else + let open Result_syntax in + let unique_new_operations = + (* only retain unique operations that are in new_mempool *) + Operation_hash.Map.( + merge + (fun _ l r -> + match (l, r) with + | None, Some r -> Some r + | Some _, None -> None + | Some _, Some _ -> None + | None, None -> None) + existing_mempool.operations + new_mempool.operations) + in + let unopt_assert = function None -> assert false | Some o -> o in + let handle_conflict new_operation_content conflict = + match (conflict, conflict_handler) with + | Ok (), _ -> Ok `Add_new + | Error conflict, None -> Error (Merge_conflict conflict) + | ( Error (Operation_conflict {existing; new_operation}), + Some (f : conflict_handler) ) -> ( + (* New operations can only conflict with operations + already present in the existing mempool. *) + let existing_operation_content = + Operation_hash.Map.find_opt existing existing_mempool.operations + |> unopt_assert + in + match + f + ~existing_operation:(existing, existing_operation_content) + ~new_operation:(new_operation, new_operation_content) + with + | `Keep -> Ok `Do_nothing + | `Replace -> Ok (`Replace existing)) + in + Operation_hash.Map.fold_e + (fun roph packed_right_op mempool_acc -> + let {shell; protocol_data = Operation_data protocol_data} = + packed_right_op + in + let right_op = ({shell; protocol_data} : _ operation) in + let* conflict = + check_operation_conflict mempool_acc.operation_state roph right_op + |> handle_conflict packed_right_op + in + match conflict with + | `Do_nothing -> return mempool_acc + | `Add_new -> + let operation_state = + add_valid_operation mempool_acc.operation_state roph right_op + in + let operations = + Operation_hash.Map.add roph packed_right_op mempool_acc.operations + in + return {mempool_acc with operation_state; operations} + | `Replace loph -> + let mempool_acc = remove_operation mempool_acc loph in + let operation_state = + add_valid_operation mempool_acc.operation_state roph right_op + in + let operations = + Operation_hash.Map.add roph packed_right_op mempool_acc.operations + in + return {mempool_acc with operation_state; operations}) + unique_new_operations + existing_mempool + +let operations mempool = mempool.operations diff --git a/src/proto_016_PtMumbai/lib_protocol/mempool_validation.mli b/src/proto_016_PtMumbai/lib_protocol/mempool_validation.mli new file mode 100644 index 000000000000..6ed036b88545 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/mempool_validation.mli @@ -0,0 +1,185 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module implements a mempool structure meant to be used by a + shell and bakers in order to incrementally accumulate commutative + operations which could then be safely used to bake a new + block. These mempool components guarantee a set of properties + useful for these purposes: + + - Every operation contained in a mempool is valid; + + - All the mempool's operations can safely be included (and + applicable) in a block in an arbitrary order which means + operations commutes. However, to build a valid block with these + operations: + + - Operations must be reorganized with regards to their validation + passes. + - Block's operations quota are ignored, it is the baker's + responsability to ensure that the set of selected operations + does not exceed gas/size operations quota. + - The baker must also include the required preendorsements and + endorsements. + + - The merging of two mempools also maintains the aforementioned + properties. + + Mempools do not depend on local data and therefore are + serializable. This is useful when a node needs to send a mempool + to another (remote-)process (e.g. the baker). +*) + +open Alpha_context + +(** Mempool type *) +type t + +(** Validation info type required to validate and add operations to a + mempool. *) +type validation_info + +(** Type of the function that may be provided in order to resolve a + potential conflict when adding an operation to an existing mempool + or when merging two mempools. This handler may be defined as a + simple order relation over operations (e.g. prioritize the most + profitable operations) or an arbitrary one (e.g. prioritize + operations where the source is a specific manager). + + Returning [`Keep] will leave the mempool unchanged and retain the + [existing_operation] while returning [`Replace] will remove + [existing_operation] and add [new_operation] instead. *) +type conflict_handler = + existing_operation:Operation_hash.t * packed_operation -> + new_operation:Operation_hash.t * packed_operation -> + [`Keep | `Replace] + +(** Return type when adding an operation to the mempool *) +type add_result = + | Added + (** [Added] means that an operation was successfully added to + the mempool without any conflict. *) + | Replaced of {removed : Operation_hash.t} + (** [Replaced {removed}] means that an operation was + successfully added but there was a conflict with the [removed] + operation which was removed from the mempool. *) + | Unchanged + (** [Unchanged] means that there was a conflict with an existing + operation which was considered better by the + [conflict_handler], therefore the new operation is discarded + and the mempool remains unchanged. *) + +type operation_conflict = Validate_errors.operation_conflict = + | Operation_conflict of { + existing : Operation_hash.t; + new_operation : Operation_hash.t; + } + +(** Error type returned when adding an operation to the mempool fails. *) +type add_error = + | Validation_error of error trace + (** [Validation_error _] means that the operation is invalid. *) + | Add_conflict of operation_conflict + (** [Add_conflict _] means that an operation conflicts with an + existing one. This error will only be obtained when no + [conflict_handler] was provided. Moreover, [Validation_error _] + takes precedence over [Add_conflict _] which implies that + we have the implicit invariant that the operation would be + valid if there was no conflict. Therefore, if + [add_operation] would have to be called again, it would be + redondant to check the operation's signature. *) + +(** Error type returned when the merge of two mempools fails. *) +type merge_error = + | Incompatible_mempool + (** [Incompatible_mempool _] means that the two mempools are not built + ontop of the same head and therefore cannot be considered. *) + | Merge_conflict of operation_conflict + (** [Merge_conflict _] arises when two mempools contain conflicting + operations and no [conflict_handler] was provided. *) + +(** Mempool encoding *) +val encoding : t Data_encoding.t + +(** Initialize a static [validation_info] and [mempool], required to validate and add + operations, and an incremental and serializable [mempool]. *) +val init : + context -> + Chain_id.t -> + predecessor_level:Level.t -> + predecessor_round:Round.t -> + predecessor_hash:Block_hash.t -> + grandparent_round:Round.t -> + validation_info * t + +(** Adds an operation to a [mempool] if and only if it is valid and + does not conflict with previously added operations. + + This function checks the validity of an operation (see + {!Validate.check_operation}) and tries to add it to the mempool. + + If an error occurs during the validation, the result will be a + [Validation_error <err>]. If a conflict with a previous operation + exists, the result will be an [Add_conflict] (see + {!Validate.check_operation_conflict}). Important: no + [Add_conflict] will be raised if a [conflict_handler] is + provided (see [add_result]). + + If no error is raised the operation is potentially added to the + [mempool] depending on the [add_result] value. *) +val add_operation : + ?check_signature:bool -> + ?conflict_handler:conflict_handler -> + validation_info -> + t -> + Operation_hash.t * packed_operation -> + (t * add_result, add_error) result Lwt.t + +(** [remove_operation mempool oph] removes the operation [oph] from + the [mempool]. The [mempool] remains unchanged when [oph] is not + present in the [mempool] *) +val remove_operation : t -> Operation_hash.t -> t + +(** [merge ?conflict_handler existing_mempool new_mempool] merges [new_mempool] + {b into} [existing_mempool]. + + Mempools may only be merged if they are compatible: i.e. both have + been initialised with the same predecessor block. Otherwise, the + [Incompatible_mempool] error is returned. + + Conflicts between operations from the two mempools can + occur. Similarly as [add_operation], a [Merge_conflict] error + may be raised when no [conflict_handler] is provided. + + [existing_operation] in [conflict_handler ~existing_operation ~new_operation] + references operations present in [existing_mempool] while + [new_operation] will reference operations present in + [new_mempool]. *) +val merge : + ?conflict_handler:conflict_handler -> t -> t -> (t, merge_error) result + +(** [operations mempool] returns the map of operations present in + [mempool]. *) +val operations : t -> packed_operation Operation_hash.Map.t diff --git a/src/proto_016_PtMumbai/lib_protocol/merkle_list.ml b/src/proto_016_PtMumbai/lib_protocol/merkle_list.ml new file mode 100644 index 000000000000..bc41e7f1651a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/merkle_list.ml @@ -0,0 +1,338 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Merkle_list_invalid_position + +let max_depth ~count_limit = + (* We assume that the Merkle_tree implementation computes a tree in a + logarithmic size of the number of leaves. *) + let log2 n = Z.numbits (Z.of_int n) in + log2 count_limit + +let () = + register_error_kind + `Temporary + ~id:"Merkle_list_invalid_position" + ~title:"Merkle_list_invalid_position" + ~description:"Merkle_list_invalid_position" + ~pp:(fun ppf () -> Format.fprintf ppf "%s" "Merkle_list_invalid_position") + Data_encoding.empty + (function Merkle_list_invalid_position -> Some () | _ -> None) + (fun () -> Merkle_list_invalid_position) + +module type T = sig + type t + + type h + + type elt + + type path + + val dummy_path : path + + val pp_path : Format.formatter -> path -> unit + + val nil : t + + val empty : h + + val root : t -> h + + val snoc : t -> elt -> t + + val snoc_tr : t -> elt -> t + + val compute : elt list -> h + + val path_encoding : path Data_encoding.t + + val bounded_path_encoding : ?max_length:int -> unit -> path Data_encoding.t + + val compute_path : t -> int -> path tzresult + + val check_path : path -> int -> elt -> h -> bool tzresult + + val path_depth : path -> int + + val elt_bytes : elt -> Bytes.t + + module Internal_for_tests : sig + val path_to_list : path -> h list + + val equal : t -> t -> bool + + val to_list : t -> h list + end +end + +module Make (El : sig + type t + + val to_bytes : t -> bytes +end) +(H : S.HASH) : T with type elt = El.t and type h = H.t = struct + type h = H.t + + type elt = El.t + + let elt_bytes = El.to_bytes + + (* + The goal of this structure is to model an append-only list. + Its internal representation is that of a binary tree whose + leaves are all at the same level (the tree's height). + + To insert a new element in a full tree t, we create a new root with t + as its left subtree and a new tree t' as its right subtree. t' is just a + left-spine of the same height as t. Visually, + + t = / \ t' = / snoc 4 t = / \ + /\ /\ / / \ / + 0 1 2 3 4 /\ /\ / + 0 1 2 3 4 + + Then, this is a balanced tree by construction. + As the key in the tree for a given position is the position's + binary decomposition of size height(tree), the tree is dense. + For that reason, the use of extenders is not needed. + *) + + type tree = Empty | Leaf of h | Node of (h * tree * tree) + + (* The tree has the following invariants: + A node [Node left right] if valid iff + 1. [right] is Empty and [left] is not Empty, or + 2. [right] is not Empty and [left] is full + Additionally: + [t.depth] is the height of [t.tree] and + [t.next_pos] is the number of leaves in [t.tree] *) + type t = {tree : tree; depth : int; next_pos : int} + + type path = h list + + let dummy_path = [] + + let pp_path ppf = + Format.fprintf + ppf + "%a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@ ") + H.pp) + + let empty = H.zero + + let root = function Empty -> empty | Leaf h -> h | Node (h, _, _) -> h + + let nil = {tree = Empty; depth = 0; next_pos = 0} + + let hash_elt el = H.hash_bytes [elt_bytes el] + + let leaf_of el = Leaf (hash_elt el) + + let hash2 h1 h2 = H.(hash_bytes [to_bytes h1; to_bytes h2]) + + let node_of t1 t2 = Node (hash2 (root t1) (root t2), t1, t2) + + (* to_bin computes the [depth]-long binary representation of [pos] + (left-padding with 0s if required). This corresponds to the tree traversal + of en element at position [pos] (false = left, true = right). + + Pre-condition: pos >= 0 /| pos < 2^depth + Post-condition: len(to_bin pos depth) = depth *) + let to_bin ~pos ~depth = + let rec aux acc pos depth = + let pos', dir = (pos / 2, pos mod 2) in + match depth with + | 0 -> acc + | d -> aux (Compare.Int.(dir = 1) :: acc) pos' (d - 1) + in + aux [] pos depth + + (* Constructs a tree of a given depth in which every right subtree is empty + * and the only leaf contains the hash of el. *) + let make_spine_with el = + let rec aux left = function + | 0 -> left + | d -> (aux [@tailcall]) (node_of left Empty) (d - 1) + in + aux (leaf_of el) + + let snoc t (el : elt) = + let rec traverse tree depth key = + match (tree, key) with + | Node (_, t_left, Empty), true :: _key -> + (* The base case where the left subtree is full and we start + * the right subtree by creating a new tree the size of the remaining + * depth and placing the new element in its leftmost position. *) + let t_right = make_spine_with el (depth - 1) in + node_of t_left t_right + | Node (_, t_left, Empty), false :: key -> + (* Traversing left, the left subtree is not full (and thus the right + * subtree is empty). Recurse on left subtree. *) + let t_left = traverse t_left (depth - 1) key in + node_of t_left Empty + | Node (_, t_left, t_right), true :: key -> + (* Traversing right, the left subtree is full. + * Recurse on right subtree *) + let t_right = traverse t_right (depth - 1) key in + node_of t_left t_right + | _, _ -> + (* Impossible by construction of the tree and of the key. + * See [tree] invariants and [to_bin]. *) + assert false + in + + let tree', depth' = + match (t.tree, t.depth, t.next_pos) with + | Empty, 0, 0 -> (node_of (leaf_of el) Empty, 1) + | tree, depth, pos when Int32.(equal (shift_left 1l depth) (of_int pos)) + -> + let t_right = make_spine_with el depth in + (node_of tree t_right, depth + 1) + | tree, depth, pos -> + let key = to_bin ~pos ~depth in + (traverse tree depth key, depth) + in + {tree = tree'; depth = depth'; next_pos = t.next_pos + 1} + + type zipper = Left of zipper * tree | Right of tree * zipper | Top + + let rec rebuild_tree z t = + match z with + | Top -> t + | Left (z, r) -> (rebuild_tree [@tailcall]) z (node_of t r) + | Right (l, z) -> (rebuild_tree [@tailcall]) z (node_of l t) + + let snoc_tr t (el : elt) = + let rec traverse (z : zipper) tree depth key = + match (tree, key) with + | Node (_, t_left, Empty), true :: _key -> + let t_right = make_spine_with el (depth - 1) in + rebuild_tree z (node_of t_left t_right) + | Node (_, t_left, Empty), false :: key -> + let z = Left (z, Empty) in + (traverse [@tailcall]) z t_left (depth - 1) key + | Node (_, t_left, t_right), true :: key -> + let z = Right (t_left, z) in + (traverse [@tailcall]) z t_right (depth - 1) key + | _, _ -> + (* Impossible by construction of the tree and of the key. + * See [tree] invariants and [to_bin]. *) + assert false + in + + let tree', depth' = + match (t.tree, t.depth, t.next_pos) with + | Empty, 0, 0 -> (node_of (leaf_of el) Empty, 1) + | tree, depth, pos when Int32.(equal (shift_left 1l depth) (of_int pos)) + -> + let t_right = make_spine_with el depth in + (node_of tree t_right, depth + 1) + | tree, depth, pos -> + let key = to_bin ~pos ~depth in + (traverse Top tree depth key, depth) + in + {tree = tree'; depth = depth'; next_pos = t.next_pos + 1} + + let rec tree_to_list = function + | Empty -> [] + | Leaf h -> [h] + | Node (_, t_left, t_right) -> tree_to_list t_left @ tree_to_list t_right + + let path_encoding = Data_encoding.(list H.encoding) + + let bounded_path_encoding ?max_length () = + match max_length with + | None -> path_encoding + | Some max_length -> Data_encoding.((list ~max_length) H.encoding) + + (* The order of the path is from bottom to top *) + let compute_path {tree; depth; next_pos} pos = + if Compare.Int.(pos < 0 || pos >= next_pos) then + error Merkle_list_invalid_position + else + let key = to_bin ~pos ~depth in + let rec aux acc tree key = + match (tree, key) with + | Leaf _, [] -> ok acc + | Node (_, l, r), b :: key -> + if b then aux (root l :: acc) r key else aux (root r :: acc) l key + | _ -> error Merkle_list_invalid_position + in + aux [] tree key + + let check_path path pos el expected_root = + let depth = List.length path in + if + Compare.Int.(pos >= 0) + && Compare.Z.(Z.of_int pos < Z.shift_left Z.one depth) + then + let key = List.rev @@ to_bin ~pos ~depth in + let computed_root = + List.fold_left + (fun acc (sibling, b) -> + if b then hash2 sibling acc else hash2 acc sibling) + (hash_elt el) + (List.combine_drop path key) + in + ok (H.equal computed_root expected_root) + else error Merkle_list_invalid_position + + let path_depth path = List.length path + + let compute l = + let rec aux l = + let rec pairs acc = function + | [] -> List.rev acc + | [x] -> List.rev (hash2 x empty :: acc) + | x :: y :: xs -> pairs (hash2 x y :: acc) xs + in + match pairs [] l with [] -> empty | [h] -> h | pl -> aux pl + in + aux (List.map hash_elt l) + + let root t = root t.tree + + module Internal_for_tests = struct + let path_to_list x = x + + let to_list tree = tree_to_list tree.tree + + let equal t1 t2 = + let rec eq_tree t1 t2 = + match (t1, t2) with + | Empty, Empty -> true + | Leaf h1, Leaf h2 -> H.equal h1 h2 + | Node (h1, l1, r1), Node (h2, l2, r2) -> + H.equal h1 h2 && eq_tree l1 l2 && eq_tree r1 r2 + | _ -> false + in + Compare.Int.equal t1.depth t2.depth + && Compare.Int.equal t1.next_pos t2.next_pos + && eq_tree t1.tree t2.tree + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/merkle_list.mli b/src/proto_016_PtMumbai/lib_protocol/merkle_list.mli new file mode 100644 index 000000000000..2352d451b773 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/merkle_list.mli @@ -0,0 +1,115 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Merkle_list_invalid_position + +(** Given a list of size [count_limit], returns the maximum depth of + its merklisation. *) +val max_depth : count_limit:int -> int + +module type T = sig + (** The type of a Merkle list *) + type t + + (** The type of a hash *) + type h + + (** The type of an element *) + type elt + + (** A path, together with an element's position, is the proof of inclusion + of an element in the Merkle list. *) + type path + + (** A dummy path that can be used as a placeholder when no path is + actually required. *) + val dummy_path : path + + val pp_path : Format.formatter -> path -> unit + + (** The empty Merkle list *) + val nil : t + + (** The empty hash *) + val empty : h + + (** [root t] returns the root hash of a Merkle list. *) + val root : t -> h + + (** [snoc t el] adds element [el] to a Merkle list [t] and returns + the new list. *) + val snoc : t -> elt -> t + + (** Tail recursive variant of [snoc]. *) + val snoc_tr : t -> elt -> t + + (** [compute elems] returns the root hash of the Merkle list constructed with + [elems]. *) + val compute : elt list -> h + + (** Encoding of a path. *) + val path_encoding : path Data_encoding.t + + (** Encoding of a path, with optional bound [max_length]. *) + val bounded_path_encoding : ?max_length:int -> unit -> path Data_encoding.t + + (** [compute_path t pos] computes the path of the element in position [pos]. + + Can fail with [Merkle_list_invalid_position] if [pos] is negative or + if it is greater than the number of elements in the list. *) + val compute_path : t -> int -> path tzresult + + (** [check_path path pos elt expected_root] checks that an [elt] with path + [path] at position [pos] has the [expected_root]. + + Can fail with [Merkle_list_invalid_position] if [pos] is negative or + if it is greater than the number of elements in the list. *) + val check_path : path -> int -> elt -> h -> bool tzresult + + (** [path_depth path] returns the depth of the tree [path] is + related to. *) + val path_depth : path -> int + + val elt_bytes : elt -> Bytes.t + + (**/**) + + module Internal_for_tests : sig + val path_to_list : path -> h list + + (** Checks equality between Merkle lists. Outside of testing, clients should + use [root] for comparison. *) + val equal : t -> t -> bool + + val to_list : t -> h list + end +end + +module Make (El : sig + type t + + val to_bytes : t -> bytes +end) +(H : S.HASH) : T with type elt = El.t and type h = H.t diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.ml b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.ml new file mode 100644 index 000000000000..5e55479b93ef --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.ml @@ -0,0 +1,974 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Gas +module S = Saturation_repr +module Size = Gas_input_size + +module Cost_of = struct + let z_bytes (z : Z.t) = + let bits = Z.numbits z in + (7 + bits) / 8 + + let int_size_in_bytes (z : 'a Script_int.num) = z_bytes (Script_int.to_zint z) + + let manager_operation_int = 1_000 + + let manager_operation = step_cost @@ S.safe_int manager_operation_int + + module Interpreter = struct + open Michelson_v1_gas_costs + + let drop = atomic_step_cost cost_N_IDrop + + let dup = atomic_step_cost cost_N_IDup + + let swap = atomic_step_cost cost_N_ISwap + + let cons_some = atomic_step_cost cost_N_ICons_some + + let cons_none = atomic_step_cost cost_N_ICons_none + + let if_none = atomic_step_cost cost_N_IIf_none + + let opt_map = atomic_step_cost cost_N_IOpt_map + + let cons_pair = atomic_step_cost cost_N_ICons_pair + + let unpair = atomic_step_cost cost_N_IUnpair + + let car = atomic_step_cost cost_N_ICar + + let cdr = atomic_step_cost cost_N_ICdr + + let cons_left = atomic_step_cost cost_N_ILeft + + let cons_right = atomic_step_cost cost_N_IRight + + let if_left = atomic_step_cost cost_N_IIf_left + + let cons_list = atomic_step_cost cost_N_ICons_list + + let nil = atomic_step_cost cost_N_INil + + let if_cons = atomic_step_cost cost_N_IIf_cons + + let list_map : 'a Script_list.t -> Gas.cost = + fun _ -> atomic_step_cost cost_N_IList_map + + let list_size = atomic_step_cost cost_N_IList_size + + let list_iter : 'a Script_list.t -> Gas.cost = + fun _ -> atomic_step_cost cost_N_IList_iter + + let empty_set = atomic_step_cost cost_N_IEmpty_set + + let set_iter (type a) (set : a Script_typed_ir.set) = + let (module Box) = Script_set.get set in + atomic_step_cost (cost_N_ISet_iter Box.size) + + let set_size = atomic_step_cost cost_N_ISet_size + + let empty_map = atomic_step_cost cost_N_IEmpty_map + + let map_map (type k v) (map : (k, v) Script_typed_ir.map) = + let (module Box) = Script_map.get_module map in + atomic_step_cost (cost_N_IMap_map Box.size) + + let map_iter (type k v) (map : (k, v) Script_typed_ir.map) = + let (module Box) = Script_map.get_module map in + atomic_step_cost (cost_N_IMap_iter Box.size) + + let map_size = atomic_step_cost cost_N_IMap_size + + let big_map_elt_size = Script_expr_hash.size + + let big_map_mem ({size; _} : _ Script_typed_ir.big_map_overlay) = + atomic_step_cost (cost_N_IMap_mem big_map_elt_size size) + + let big_map_get ({size; _} : _ Script_typed_ir.big_map_overlay) = + atomic_step_cost (cost_N_IMap_get big_map_elt_size size) + + let big_map_update ({size; _} : _ Script_typed_ir.big_map_overlay) = + atomic_step_cost (cost_N_IMap_update big_map_elt_size size) + + let big_map_get_and_update ({size; _} : _ Script_typed_ir.big_map_overlay) = + atomic_step_cost (cost_N_IMap_get_and_update big_map_elt_size size) + + let add_seconds_timestamp : + 'a Script_int.num -> Script_timestamp.t -> Gas.cost = + fun seconds timestamp -> + let seconds_bytes = int_size_in_bytes seconds in + let timestamp_bytes = z_bytes (Script_timestamp.to_zint timestamp) in + atomic_step_cost + (cost_N_IAdd_seconds_to_timestamp seconds_bytes timestamp_bytes) + + let add_timestamp_seconds : + Script_timestamp.t -> 'a Script_int.num -> Gas.cost = + fun timestamp seconds -> + let seconds_bytes = int_size_in_bytes seconds in + let timestamp_bytes = z_bytes (Script_timestamp.to_zint timestamp) in + atomic_step_cost + (cost_N_IAdd_timestamp_to_seconds timestamp_bytes seconds_bytes) + + let sub_timestamp_seconds : + Script_timestamp.t -> 'a Script_int.num -> Gas.cost = + fun timestamp seconds -> + let seconds_bytes = int_size_in_bytes seconds in + let timestamp_bytes = z_bytes (Script_timestamp.to_zint timestamp) in + atomic_step_cost + (cost_N_ISub_timestamp_seconds timestamp_bytes seconds_bytes) + + let diff_timestamps t1 t2 = + let t1_bytes = z_bytes (Script_timestamp.to_zint t1) in + let t2_bytes = z_bytes (Script_timestamp.to_zint t2) in + atomic_step_cost (cost_N_IDiff_timestamps t1_bytes t2_bytes) + + let concat_string_pair s1 s2 = + atomic_step_cost + (cost_N_IConcat_string_pair + (Script_string.length s1) + (Script_string.length s2)) + + let slice_string s = + atomic_step_cost (cost_N_ISlice_string (Script_string.length s)) + + let string_size = atomic_step_cost cost_N_IString_size + + let concat_bytes_pair b1 b2 = + atomic_step_cost + (cost_N_IConcat_bytes_pair (Bytes.length b1) (Bytes.length b2)) + + let slice_bytes b = atomic_step_cost (cost_N_ISlice_bytes (Bytes.length b)) + + let bytes_size = atomic_step_cost cost_N_IBytes_size + + let lsl_bytes input nbits = + match Script_int.to_int nbits with + | None -> Saturation_repr.saturated + | Some nbits -> + atomic_step_cost (cost_N_ILsl_bytes (Bytes.length input) nbits) + + let lsr_bytes input nbits = + let input_nbytes = Bytes.length input in + let nbits = + Option.value (Script_int.to_int nbits) ~default:(input_nbytes * 8) + in + atomic_step_cost (cost_N_ILsr_bytes input_nbytes nbits) + + let or_bytes b1 b2 = + atomic_step_cost (cost_N_IOr_bytes (Bytes.length b1) (Bytes.length b2)) + + let and_bytes b1 b2 = + atomic_step_cost (cost_N_IAnd_bytes (Bytes.length b1) (Bytes.length b2)) + + let xor_bytes b1 b2 = + atomic_step_cost (cost_N_IXor_bytes (Bytes.length b1) (Bytes.length b2)) + + let not_bytes b = atomic_step_cost (cost_N_INot_bytes (Bytes.length b)) + + let bytes_nat n = atomic_step_cost (cost_N_IBytes_nat (int_size_in_bytes n)) + + let nat_bytes b = atomic_step_cost (cost_N_INat_bytes (Bytes.length b)) + + let bytes_int n = atomic_step_cost (cost_N_IBytes_int (int_size_in_bytes n)) + + let int_bytes b = atomic_step_cost (cost_N_IInt_bytes (Bytes.length b)) + + let add_tez = atomic_step_cost cost_N_IAdd_tez + + let sub_tez = atomic_step_cost cost_N_ISub_tez + + let sub_tez_legacy = atomic_step_cost cost_N_ISub_tez_legacy + + let mul_teznat = atomic_step_cost cost_N_IMul_teznat + + let mul_nattez = atomic_step_cost cost_N_IMul_nattez + + let bool_or = atomic_step_cost cost_N_IOr + + let bool_and = atomic_step_cost cost_N_IAnd + + let bool_xor = atomic_step_cost cost_N_IXor + + let bool_not = atomic_step_cost cost_N_INot + + let is_nat = atomic_step_cost cost_N_IIs_nat + + let abs_int i = atomic_step_cost (cost_N_IAbs_int (int_size_in_bytes i)) + + let int_nat = atomic_step_cost cost_N_IInt_nat + + let neg i = atomic_step_cost (cost_N_INeg (int_size_in_bytes i)) + + let add_int i1 i2 = + atomic_step_cost + (cost_N_IAdd_int (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let add_nat i1 i2 = + atomic_step_cost + (cost_N_IAdd_nat (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let sub_int i1 i2 = + atomic_step_cost + (cost_N_ISub_int (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let mul_int i1 i2 = + atomic_step_cost + (cost_N_IMul_int (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let mul_nat i1 i2 = + atomic_step_cost + (cost_N_IMul_nat (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let ediv_teznat _tez _n = atomic_step_cost cost_N_IEdiv_teznat + + let ediv_tez = atomic_step_cost cost_N_IEdiv_tez + + let ediv_int i1 i2 = + atomic_step_cost + (cost_N_IEdiv_int (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let ediv_nat i1 i2 = + atomic_step_cost + (cost_N_IEdiv_nat (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let eq = atomic_step_cost cost_N_IEq + + let lsl_nat shifted = + atomic_step_cost (cost_N_ILsl_nat (int_size_in_bytes shifted)) + + let lsr_nat shifted = + atomic_step_cost (cost_N_ILsr_nat (int_size_in_bytes shifted)) + + let or_nat n1 n2 = + atomic_step_cost + (cost_N_IOr_nat (int_size_in_bytes n1) (int_size_in_bytes n2)) + + let and_nat n1 n2 = + atomic_step_cost + (cost_N_IAnd_nat (int_size_in_bytes n1) (int_size_in_bytes n2)) + + let and_int_nat n1 n2 = + atomic_step_cost + (cost_N_IAnd_int_nat (int_size_in_bytes n1) (int_size_in_bytes n2)) + + let xor_nat n1 n2 = + atomic_step_cost + (cost_N_IXor_nat (int_size_in_bytes n1) (int_size_in_bytes n2)) + + let not_int i = atomic_step_cost (cost_N_INot_int (int_size_in_bytes i)) + + let if_ = atomic_step_cost cost_N_IIf + + let loop = atomic_step_cost cost_N_ILoop + + let loop_left = atomic_step_cost cost_N_ILoop_left + + let dip = atomic_step_cost cost_N_IDip + + let view = atomic_step_cost cost_N_IView + + let check_signature (pkey : Signature.public_key) b = + let cost = + match pkey with + | Ed25519 _ -> cost_N_ICheck_signature_ed25519 (Bytes.length b) + | Secp256k1 _ -> cost_N_ICheck_signature_secp256k1 (Bytes.length b) + | P256 _ -> cost_N_ICheck_signature_p256 (Bytes.length b) + | Bls _ -> cost_N_ICheck_signature_bls (Bytes.length b) + in + atomic_step_cost cost + + let blake2b b = atomic_step_cost (cost_N_IBlake2b (Bytes.length b)) + + let sha256 b = atomic_step_cost (cost_N_ISha256 (Bytes.length b)) + + let sha512 b = atomic_step_cost (cost_N_ISha512 (Bytes.length b)) + + let dign n = atomic_step_cost (cost_N_IDig n) + + let dugn n = atomic_step_cost (cost_N_IDug n) + + let dipn n = atomic_step_cost (cost_N_IDipN n) + + let dropn n = atomic_step_cost (cost_N_IDropN n) + + let voting_power = atomic_step_cost cost_N_IVoting_power + + let total_voting_power = atomic_step_cost cost_N_ITotal_voting_power + + let keccak b = atomic_step_cost (cost_N_IKeccak (Bytes.length b)) + + let sha3 b = atomic_step_cost (cost_N_ISha3 (Bytes.length b)) + + let add_bls12_381_g1 = atomic_step_cost cost_N_IAdd_bls12_381_g1 + + let add_bls12_381_g2 = atomic_step_cost cost_N_IAdd_bls12_381_g2 + + let add_bls12_381_fr = atomic_step_cost cost_N_IAdd_bls12_381_fr + + let mul_bls12_381_g1 = atomic_step_cost cost_N_IMul_bls12_381_g1 + + let mul_bls12_381_g2 = atomic_step_cost cost_N_IMul_bls12_381_g2 + + let mul_bls12_381_fr = atomic_step_cost cost_N_IMul_bls12_381_fr + + let mul_bls12_381_fr_z z = + atomic_step_cost (cost_N_IMul_bls12_381_fr_z (int_size_in_bytes z)) + + let mul_bls12_381_z_fr z = + atomic_step_cost (cost_N_IMul_bls12_381_z_fr (int_size_in_bytes z)) + + let int_bls12_381_fr = atomic_step_cost cost_N_IInt_bls12_381_z_fr + + let neg_bls12_381_g1 = atomic_step_cost cost_N_INeg_bls12_381_g1 + + let neg_bls12_381_g2 = atomic_step_cost cost_N_INeg_bls12_381_g2 + + let neg_bls12_381_fr = atomic_step_cost cost_N_INeg_bls12_381_fr + + let neq = atomic_step_cost cost_N_INeq + + let pairing_check_bls12_381 (l : 'a Script_list.t) = + atomic_step_cost (cost_N_IPairing_check_bls12_381 l.length) + + let comb n = atomic_step_cost (cost_N_IComb n) + + let uncomb n = atomic_step_cost (cost_N_IUncomb n) + + let comb_get n = atomic_step_cost (cost_N_IComb_get n) + + let comb_set n = atomic_step_cost (cost_N_IComb_set n) + + let dupn n = atomic_step_cost (cost_N_IDupN n) + + let sapling_verify_update ~inputs ~outputs ~bound_data = + atomic_step_cost (cost_N_ISapling_verify_update inputs outputs bound_data) + + let sapling_verify_update_deprecated ~inputs ~outputs = + atomic_step_cost (cost_N_ISapling_verify_update inputs outputs 0) + + let sapling_empty_state = atomic_step_cost cost_N_ISapling_empty_state + + let halt = atomic_step_cost cost_N_IHalt + + let const = atomic_step_cost cost_N_IConst + + let empty_big_map = atomic_step_cost cost_N_IEmpty_big_map + + let lt = atomic_step_cost cost_N_ILt + + let le = atomic_step_cost cost_N_ILe + + let gt = atomic_step_cost cost_N_IGt + + let ge = atomic_step_cost cost_N_IGe + + let exec = atomic_step_cost cost_N_IExec + + let apply ~(rec_flag : bool) = atomic_step_cost (cost_N_IApply rec_flag) + + let lambda = atomic_step_cost cost_N_ILambda + + let address = atomic_step_cost cost_N_IAddress + + let contract = atomic_step_cost cost_N_IContract + + let transfer_tokens = atomic_step_cost cost_N_ITransfer_tokens + + let implicit_account = atomic_step_cost cost_N_IImplicit_account + + let create_contract = atomic_step_cost cost_N_ICreate_contract + + let set_delegate = atomic_step_cost cost_N_ISet_delegate + + let level = atomic_step_cost cost_N_ILevel + + let now = atomic_step_cost cost_N_INow + + let min_block_time = atomic_step_cost cost_N_IMin_block_time + + let source = atomic_step_cost cost_N_ISource + + let sender = atomic_step_cost cost_N_ISender + + let self = atomic_step_cost cost_N_ISelf + + let self_address = atomic_step_cost cost_N_ISelf_address + + let amount = atomic_step_cost cost_N_IAmount + + let balance = atomic_step_cost cost_N_IBalance + + let chain_id = atomic_step_cost cost_N_IChainId + + let ticket = atomic_step_cost cost_N_ITicket + + let read_ticket = atomic_step_cost cost_N_IRead_ticket + + let hash_key _ = atomic_step_cost cost_N_IHash_key + + let split_ticket amount_a amount_b = + atomic_step_cost + (cost_N_ISplit_ticket + (int_size_in_bytes amount_a) + (int_size_in_bytes amount_b)) + + let open_chest ~chest ~time = + let plaintext = + Script_typed_ir.Script_timelock.get_plaintext_size chest + in + let log_time = Z.log2 Z.(add one time) in + atomic_step_cost (cost_N_IOpen_chest log_time plaintext) + + (* --------------------------------------------------------------------- *) + (* Semi-hand-crafted models *) + + let compare_unit = atomic_step_cost (S.safe_int 10) + + let compare_pair_tag = atomic_step_cost (S.safe_int 10) + + let compare_union_tag = atomic_step_cost (S.safe_int 10) + + let compare_option_tag = atomic_step_cost (S.safe_int 10) + + let compare_bool = atomic_step_cost (cost_N_ICompare 1 1) + + let compare_signature = atomic_step_cost (S.safe_int 92) + + let compare_string s1 s2 = + atomic_step_cost + (cost_N_ICompare (Script_string.length s1) (Script_string.length s2)) + + let compare_bytes b1 b2 = + atomic_step_cost (cost_N_ICompare (Bytes.length b1) (Bytes.length b2)) + + let compare_mutez = atomic_step_cost (cost_N_ICompare 8 8) + + let compare_int i1 i2 = + atomic_step_cost + (cost_N_ICompare (int_size_in_bytes i1) (int_size_in_bytes i2)) + + let compare_nat n1 n2 = + atomic_step_cost + (cost_N_ICompare (int_size_in_bytes n1) (int_size_in_bytes n2)) + + let compare_key_hash = + let sz = Signature.Public_key_hash.size in + atomic_step_cost (cost_N_ICompare sz sz) + + let compare_key = atomic_step_cost (S.safe_int 92) + + let compare_timestamp t1 t2 = + atomic_step_cost + (cost_N_ICompare + (z_bytes (Script_timestamp.to_zint t1)) + (z_bytes (Script_timestamp.to_zint t2))) + + (* Maximum size of an entrypoint in bytes *) + let entrypoint_size = 31 + + let compare_address = + let sz = Signature.Public_key_hash.size + entrypoint_size in + atomic_step_cost (cost_N_ICompare sz sz) + + (** TODO: https://gitlab.com/tezos/tezos/-/issues/2340 + Refine the gas model *) + let compare_tx_rollup_l2_address = atomic_step_cost (cost_N_ICompare 48 48) + + let compare_chain_id = atomic_step_cost (S.safe_int 30) + + (* Defunctionalized CPS *) + type cont = + | Compare : 'a Script_typed_ir.comparable_ty * 'a * 'a * cont -> cont + | Return : cont + + let compare : type a. a Script_typed_ir.comparable_ty -> a -> a -> cost = + fun ty x y -> + let rec compare : + type a. + a Script_typed_ir.comparable_ty -> a -> a -> cost -> cont -> cost = + fun ty x y acc k -> + match ty with + | Unit_t -> (apply [@tailcall]) Gas.(acc +@ compare_unit) k + | Never_t -> ( match x with _ -> .) + | Bool_t -> (apply [@tailcall]) Gas.(acc +@ compare_bool) k + | String_t -> (apply [@tailcall]) Gas.(acc +@ compare_string x y) k + | Signature_t -> (apply [@tailcall]) Gas.(acc +@ compare_signature) k + | Bytes_t -> (apply [@tailcall]) Gas.(acc +@ compare_bytes x y) k + | Mutez_t -> (apply [@tailcall]) Gas.(acc +@ compare_mutez) k + | Int_t -> (apply [@tailcall]) Gas.(acc +@ compare_int x y) k + | Nat_t -> (apply [@tailcall]) Gas.(acc +@ compare_nat x y) k + | Key_hash_t -> (apply [@tailcall]) Gas.(acc +@ compare_key_hash) k + | Key_t -> (apply [@tailcall]) Gas.(acc +@ compare_key) k + | Timestamp_t -> + (apply [@tailcall]) Gas.(acc +@ compare_timestamp x y) k + | Address_t -> (apply [@tailcall]) Gas.(acc +@ compare_address) k + | Tx_rollup_l2_address_t -> + (apply [@tailcall]) Gas.(acc +@ compare_tx_rollup_l2_address) k + | Chain_id_t -> (apply [@tailcall]) Gas.(acc +@ compare_chain_id) k + | Pair_t (tl, tr, _, YesYes) -> + (* Reasonable over-approximation of the cost of lexicographic comparison. *) + let xl, xr = x in + let yl, yr = y in + (compare [@tailcall]) + tl + xl + yl + Gas.(acc +@ compare_pair_tag) + (Compare (tr, xr, yr, k)) + | Union_t (tl, tr, _, YesYes) -> ( + match (x, y) with + | L x, L y -> + (compare [@tailcall]) tl x y Gas.(acc +@ compare_union_tag) k + | L _, R _ -> (apply [@tailcall]) Gas.(acc +@ compare_union_tag) k + | R _, L _ -> (apply [@tailcall]) Gas.(acc +@ compare_union_tag) k + | R x, R y -> + (compare [@tailcall]) tr x y Gas.(acc +@ compare_union_tag) k) + | Option_t (t, _, Yes) -> ( + match (x, y) with + | None, None -> + (apply [@tailcall]) Gas.(acc +@ compare_option_tag) k + | None, Some _ -> + (apply [@tailcall]) Gas.(acc +@ compare_option_tag) k + | Some _, None -> + (apply [@tailcall]) Gas.(acc +@ compare_option_tag) k + | Some x, Some y -> + (compare [@tailcall]) t x y Gas.(acc +@ compare_option_tag) k) + and apply cost k = + match k with + | Compare (ty, x, y, k) -> (compare [@tailcall]) ty x y cost k + | Return -> cost + in + compare ty x y Gas.free Return + + let set_mem (type a) (elt : a) (set : a Script_typed_ir.set) = + let open S.Syntax in + let (module Box) = Script_set.get set in + let per_elt_cost = Box.OPS.elt_size elt |> Size.to_int |> S.safe_int in + let size = S.safe_int Box.size in + let intercept = atomic_step_cost (S.safe_int 115) in + Gas.(intercept +@ (log2 size *@ per_elt_cost)) + + let set_update (type a) (elt : a) (set : a Script_typed_ir.set) = + let open S.Syntax in + let (module Box) = Script_set.get set in + let per_elt_cost = Box.OPS.elt_size elt |> Size.to_int |> S.safe_int in + let size = S.safe_int Box.size in + let intercept = atomic_step_cost (S.safe_int 130) in + (* The 2 factor reflects the update vs mem overhead as benchmarked + on non-structured data *) + Gas.(intercept +@ (S.safe_int 2 * log2 size *@ per_elt_cost)) + + let map_mem (type k v) (elt : k) (map : (k, v) Script_typed_ir.map) = + let open S.Syntax in + let (module Box) = Script_map.get_module map in + let per_elt_cost = Box.OPS.key_size elt |> Size.to_int |> S.safe_int in + let size = S.safe_int Box.size in + let intercept = atomic_step_cost (S.safe_int 80) in + Gas.(intercept +@ (log2 size *@ per_elt_cost)) + + let map_get = map_mem + + let map_update (type k v) (elt : k) (map : (k, v) Script_typed_ir.map) = + let open S.Syntax in + let (module Box) = Script_map.get_module map in + let per_elt_cost = Box.OPS.key_size elt |> Size.to_int |> S.safe_int in + let size = S.safe_int Box.size in + let intercept = atomic_step_cost (S.safe_int 80) in + (* The 2 factor reflects the update vs mem overhead as benchmarked + on non-structured data *) + Gas.(intercept +@ (S.safe_int 2 * log2 size *@ per_elt_cost)) + + let map_get_and_update (type k v) (elt : k) + (map : (k, v) Script_typed_ir.map) = + let open S.Syntax in + let (module Box) = Script_map.get_module map in + let per_elt_cost = Box.OPS.key_size elt |> Size.to_int |> S.safe_int in + let size = S.safe_int Box.size in + let intercept = atomic_step_cost (S.safe_int 80) in + (* The 3 factor reflects the update vs mem overhead as benchmarked + on non-structured data *) + Gas.(intercept +@ (S.safe_int 3 * log2 size *@ per_elt_cost)) + + let view_get (elt : Script_string.t) (m : Script_typed_ir.view_map) = + map_get elt m + + let view_update (elt : Script_string.t) (m : Script_typed_ir.view_map) = + map_update elt m + + let join_tickets : + 'a Script_typed_ir.comparable_ty -> + 'a Script_typed_ir.ticket -> + 'a Script_typed_ir.ticket -> + Gas.cost = + fun ty ticket_a ticket_b -> + let contents_comparison = + compare ty ticket_a.contents ticket_b.contents + in + Gas.( + contents_comparison +@ compare_address + +@ add_nat + (ticket_a.amount :> Script_int.n Script_int.num) + (ticket_b.amount :> Script_int.n Script_int.num)) + + let emit = atomic_step_cost cost_N_IEmit + + (* Continuations *) + module Control = struct + let nil = atomic_step_cost cost_N_KNil + + let cons = atomic_step_cost cost_N_KCons + + let return = atomic_step_cost cost_N_KReturn + + let view_exit = atomic_step_cost cost_N_KView_exit + + let map_head = atomic_step_cost cost_N_KMap_head + + let undip = atomic_step_cost cost_N_KUndip + + let loop_in = atomic_step_cost cost_N_KLoop_in + + let loop_in_left = atomic_step_cost cost_N_KLoop_in_left + + let iter = atomic_step_cost cost_N_KIter + + let list_enter_body xs ys_len = + atomic_step_cost (cost_N_KList_enter_body xs ys_len) + + let list_exit_body = atomic_step_cost cost_N_KList_exit_body + + let map_enter_body = atomic_step_cost cost_N_KMap_enter_body + + let map_exit_body (type k v) (key : k) (map : (k, v) Script_typed_ir.map) + = + map_update key map + end + + (* --------------------------------------------------------------------- *) + (* Hand-crafted models *) + + (* The cost functions below where not benchmarked, a cost model was derived + from looking at similar instructions. *) + + (* Cost for Concat_string is paid in two steps: when entering the interpreter, + the user pays for the cost of computing the information necessary to compute + the actual gas (so it's meta-gas): indeed, one needs to run through the + list of strings to compute the total allocated cost. + [concat_string_precheck] corresponds to the meta-gas cost of this computation. + *) + let concat_string_precheck (l : 'a Script_list.t) = + (* we set the precheck to be slightly more expensive than cost_N_IList_iter *) + atomic_step_cost (S.mul (S.safe_int l.length) (S.safe_int 10)) + + (* This is the cost of allocating a string and blitting existing ones into it. *) + let concat_string total_bytes = + atomic_step_cost S.(add (S.safe_int 100) (S.shift_right total_bytes 1)) + + (* Same story as Concat_string. *) + let concat_bytes total_bytes = + atomic_step_cost S.(add (S.safe_int 100) (S.shift_right total_bytes 1)) + + (* Cost of Unpack pays two integer comparisons, and a Bytes slice *) + let unpack bytes = + let blen = Bytes.length bytes in + let open S.Syntax in + atomic_step_cost (S.safe_int 260 + (S.safe_int blen lsr 1)) + + (* TODO benchmark *) + (* FIXME: imported from 006, needs proper benchmarks *) + let unpack_failed bytes = + (* We cannot instrument failed deserialization, + so we take worst case fees: a set of size 1 bytes values. *) + let blen = String.length bytes in + let len = S.safe_int blen in + let d = Z.numbits (Z.of_int blen) in + (len *@ alloc_mbytes_cost 1) + +@ len + *@ (S.safe_int d *@ (alloc_cost (S.safe_int 3) +@ step_cost S.one)) + end + + module Typechecking = struct + open Michelson_v1_gas_costs + + let public_key_optimized = + atomic_step_cost + @@ S.( + max + cost_DECODING_PUBLIC_KEY_ed25519 + (max + cost_DECODING_PUBLIC_KEY_secp256k1 + (max cost_DECODING_PUBLIC_KEY_p256 cost_DECODING_PUBLIC_KEY_bls))) + + let public_key_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_DECODING_PUBLIC_KEY_ed25519 + (max + cost_B58CHECK_DECODING_PUBLIC_KEY_secp256k1 + (max + cost_B58CHECK_DECODING_PUBLIC_KEY_p256 + cost_B58CHECK_DECODING_PUBLIC_KEY_bls))) + + let key_hash_optimized = + atomic_step_cost + @@ S.( + max + cost_DECODING_PUBLIC_KEY_HASH_ed25519 + (max + cost_DECODING_PUBLIC_KEY_HASH_secp256k1 + (max + cost_DECODING_PUBLIC_KEY_HASH_p256 + cost_DECODING_PUBLIC_KEY_HASH_bls))) + + let key_hash_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_ed25519 + (max + cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_secp256k1 + (max + cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_p256 + cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_bls))) + + let signature_optimized = + atomic_step_cost + @@ S.( + max + cost_DECODING_SIGNATURE_ed25519 + (max + cost_DECODING_SIGNATURE_secp256k1 + (max cost_DECODING_SIGNATURE_p256 cost_DECODING_SIGNATURE_bls))) + + let signature_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_DECODING_SIGNATURE_ed25519 + (max + cost_B58CHECK_DECODING_SIGNATURE_secp256k1 + (max + cost_B58CHECK_DECODING_SIGNATURE_p256 + cost_B58CHECK_DECODING_SIGNATURE_bls))) + + let chain_id_optimized = atomic_step_cost cost_DECODING_CHAIN_ID + + let chain_id_readable = atomic_step_cost cost_B58CHECK_DECODING_CHAIN_ID + + (* Reasonable approximation *) + let address_optimized = key_hash_optimized + + (* Reasonable approximation *) + let contract_optimized = key_hash_optimized + + (* Reasonable approximation *) + let contract_readable = key_hash_readable + + let bls12_381_g1 = atomic_step_cost cost_DECODING_BLS_G1 + + let bls12_381_g2 = atomic_step_cost cost_DECODING_BLS_G2 + + let bls12_381_fr = atomic_step_cost cost_DECODING_BLS_FR + + let check_printable s = + atomic_step_cost (cost_CHECK_PRINTABLE (String.length s)) + + let merge_cycle = atomic_step_cost cost_TY_EQ + + let parse_type_cycle = atomic_step_cost cost_PARSE_TYPE + + let parse_instr_cycle = atomic_step_cost cost_TYPECHECKING_CODE + + let parse_data_cycle = atomic_step_cost cost_TYPECHECKING_DATA + + (* Cost of a cycle of checking that a type is dupable *) + (* TODO: bench *) + let check_dupable_cycle = atomic_step_cost cost_TYPECHECKING_DATA + + let find_entrypoint_cycle = atomic_step_cost cost_FIND_ENTRYPOINT + + let bool = free + + let unit = free + + let timestamp_readable s = + atomic_step_cost (cost_TIMESTAMP_READABLE_DECODING (String.length s)) + + (** TODO: https://gitlab.com/tezos/tezos/-/issues/2340 + Refine the gas model *) + let tx_rollup_l2_address = bls12_381_g1 + + (* Balance stored at /contracts/index/hash/balance, on 64 bits *) + let contract_exists = + Gas.cost_of_repr @@ Storage_costs.read_access ~path_length:4 ~read_bytes:8 + + (* Constructing proof arguments consists in a decreasing loop in the result + monad, allocating at each step. We charge a reasonable overapproximation. *) + let proof_argument n = + atomic_step_cost (S.mul (S.safe_int n) (S.safe_int 50)) + + let chest_key = atomic_step_cost cost_DECODING_Chest_key + + let chest ~bytes = atomic_step_cost (cost_DECODING_Chest bytes) + end + + module Unparsing = struct + open Michelson_v1_gas_costs + + let public_key_optimized = + atomic_step_cost + @@ S.( + max + cost_ENCODING_PUBLIC_KEY_ed25519 + (max + cost_ENCODING_PUBLIC_KEY_secp256k1 + (max cost_ENCODING_PUBLIC_KEY_p256 cost_ENCODING_PUBLIC_KEY_bls))) + + let public_key_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_ENCODING_PUBLIC_KEY_ed25519 + (max + cost_B58CHECK_ENCODING_PUBLIC_KEY_secp256k1 + (max + cost_B58CHECK_ENCODING_PUBLIC_KEY_p256 + cost_B58CHECK_ENCODING_PUBLIC_KEY_bls))) + + let key_hash_optimized = + atomic_step_cost + @@ S.( + max + cost_ENCODING_PUBLIC_KEY_HASH_ed25519 + (max + cost_ENCODING_PUBLIC_KEY_HASH_secp256k1 + (max + cost_ENCODING_PUBLIC_KEY_HASH_p256 + cost_ENCODING_PUBLIC_KEY_HASH_bls))) + + let key_hash_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_ed25519 + (max + cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_secp256k1 + (max + cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_p256 + cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_bls))) + + let signature_optimized = + atomic_step_cost + @@ S.( + max + cost_ENCODING_SIGNATURE_ed25519 + (max + cost_ENCODING_SIGNATURE_secp256k1 + (max cost_ENCODING_SIGNATURE_p256 cost_ENCODING_SIGNATURE_bls))) + + let signature_readable = + atomic_step_cost + @@ S.( + max + cost_B58CHECK_ENCODING_SIGNATURE_ed25519 + (max + cost_B58CHECK_ENCODING_SIGNATURE_secp256k1 + (max + cost_B58CHECK_ENCODING_SIGNATURE_p256 + cost_B58CHECK_ENCODING_SIGNATURE_bls))) + + let chain_id_optimized = atomic_step_cost cost_ENCODING_CHAIN_ID + + let chain_id_readable = atomic_step_cost cost_B58CHECK_ENCODING_CHAIN_ID + + let timestamp_readable = atomic_step_cost cost_TIMESTAMP_READABLE_ENCODING + + (* Reasonable approximation *) + let address_optimized = key_hash_optimized + + (* Reasonable approximation *) + let contract_optimized = key_hash_optimized + + (* Reasonable approximation *) + let contract_readable = key_hash_readable + + let bls12_381_g1 = atomic_step_cost cost_ENCODING_BLS_G1 + + let bls12_381_g2 = atomic_step_cost cost_ENCODING_BLS_G2 + + let bls12_381_fr = atomic_step_cost cost_ENCODING_BLS_FR + + let unparse_type ty = + atomic_step_cost + @@ cost_UNPARSE_TYPE Script_typed_ir.(ty_size ty |> Type_size.to_int) + + let unparse_instr_cycle = atomic_step_cost cost_UNPARSING_CODE + + let unparse_data_cycle = atomic_step_cost cost_UNPARSING_DATA + + let unit = Gas.free + + (** TODO: https://gitlab.com/tezos/tezos/-/issues/2340 + Refine the gas model *) + let tx_rollup_l2_address = bls12_381_g1 + + (* Reuse 006 costs. *) + let operation bytes = Script.bytes_node_cost bytes + + let sapling_transaction (t : Sapling.transaction) = + let inputs = Size.sapling_transaction_inputs t in + let outputs = Size.sapling_transaction_outputs t in + let bound_data = Size.sapling_transaction_bound_data t in + atomic_step_cost + (cost_SAPLING_TRANSACTION_ENCODING ~inputs ~outputs ~bound_data) + + let sapling_transaction_deprecated (t : Sapling.Legacy.transaction) = + let inputs = List.length t.inputs in + let outputs = List.length t.outputs in + atomic_step_cost + (cost_SAPLING_TRANSACTION_ENCODING ~inputs ~outputs ~bound_data:0) + + let sapling_diff (d : Sapling.diff) = + let nfs = List.length d.nullifiers in + let cms = List.length d.commitments_and_ciphertexts in + atomic_step_cost (cost_SAPLING_DIFF_ENCODING ~nfs ~cms) + + let chest_key = atomic_step_cost cost_ENCODING_Chest_key + + let chest ~plaintext_size = + atomic_step_cost (cost_ENCODING_Chest plaintext_size) + end +end + +module Internal_for_tests = struct + let int_cost_of_manager_operation = Cost_of.manager_operation_int +end diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.mli b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.mli new file mode 100644 index 000000000000..c7f58dafcc64 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas.mli @@ -0,0 +1,537 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides the gas costs for typechecking Michelson scripts, + parsing and unparsing Michelson values, and interpreting Michelson + instructions. +*) + +open Alpha_context + +module Cost_of : sig + val manager_operation : Gas.cost + + module Interpreter : sig + val drop : Gas.cost + + val dup : Gas.cost + + val swap : Gas.cost + + val cons_some : Gas.cost + + val cons_none : Gas.cost + + val if_none : Gas.cost + + val opt_map : Gas.cost + + val cons_pair : Gas.cost + + val unpair : Gas.cost + + val car : Gas.cost + + val cdr : Gas.cost + + val cons_left : Gas.cost + + val cons_right : Gas.cost + + val if_left : Gas.cost + + val cons_list : Gas.cost + + val nil : Gas.cost + + val if_cons : Gas.cost + + (* The argument of this function is ignored when calculating gas cost. *) + val list_map : 'a Script_list.t -> Gas.cost + + val list_size : Gas.cost + + (* The argument of this function is ignored when calculating gas cost. *) + val list_iter : 'a Script_list.t -> Gas.cost + + val empty_set : Gas.cost + + val set_iter : 'a Script_typed_ir.set -> Gas.cost + + val set_mem : 'a -> 'a Script_typed_ir.set -> Gas.cost + + val set_update : 'a -> 'a Script_typed_ir.set -> Gas.cost + + val set_size : Gas.cost + + val empty_map : Gas.cost + + val map_map : ('k, 'v) Script_typed_ir.map -> Gas.cost + + val map_iter : ('k, 'v) Script_typed_ir.map -> Gas.cost + + val map_mem : 'k -> ('k, 'v) Script_typed_ir.map -> Gas.cost + + val map_get : 'k -> ('k, 'v) Script_typed_ir.map -> Gas.cost + + val map_update : 'k -> ('k, 'v) Script_typed_ir.map -> Gas.cost + + val map_get_and_update : 'k -> ('k, 'v) Script_typed_ir.map -> Gas.cost + + val big_map_mem : (_, _) Script_typed_ir.big_map_overlay -> Gas.cost + + val big_map_get : (_, _) Script_typed_ir.big_map_overlay -> Gas.cost + + val big_map_update : (_, _) Script_typed_ir.big_map_overlay -> Gas.cost + + val big_map_get_and_update : + (_, _) Script_typed_ir.big_map_overlay -> Gas.cost + + val map_size : Gas.cost + + val add_seconds_timestamp : + 'a Script_int.num -> Script_timestamp.t -> Gas.cost + + val add_timestamp_seconds : + Script_timestamp.t -> 'a Script_int.num -> Gas.cost + + val sub_timestamp_seconds : + Script_timestamp.t -> 'a Script_int.num -> Gas.cost + + val diff_timestamps : Script_timestamp.t -> Script_timestamp.t -> Gas.cost + + val concat_string_pair : Script_string.t -> Script_string.t -> Gas.cost + + val slice_string : Script_string.t -> Gas.cost + + val string_size : Gas.cost + + val concat_bytes_pair : bytes -> bytes -> Gas.cost + + val slice_bytes : bytes -> Gas.cost + + val bytes_size : Gas.cost + + val bytes_nat : Script_int.n Script_int.num -> Gas.cost + + val nat_bytes : bytes -> Gas.cost + + val bytes_int : Script_int.z Script_int.num -> Gas.cost + + val int_bytes : bytes -> Gas.cost + + val add_tez : Gas.cost + + val sub_tez : Gas.cost + + val sub_tez_legacy : Gas.cost + + val mul_teznat : Gas.cost + + val mul_nattez : Gas.cost + + val bool_or : Gas.cost + + val bool_and : Gas.cost + + val bool_xor : Gas.cost + + val bool_not : Gas.cost + + val is_nat : Gas.cost + + val abs_int : Script_int.z Script_int.num -> Gas.cost + + val int_nat : Gas.cost + + val neg : 'a Script_int.num -> Gas.cost + + val add_int : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val add_nat : + Script_int.n Script_int.num -> Script_int.n Script_int.num -> Gas.cost + + val sub_int : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val mul_int : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val mul_nat : Script_int.n Script_int.num -> 'a Script_int.num -> Gas.cost + + val ediv_teznat : 'a -> 'b Script_int.num -> Gas.cost + + val ediv_tez : Gas.cost + + val ediv_int : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val ediv_nat : Script_int.n Script_int.num -> 'a Script_int.num -> Gas.cost + + val eq : Gas.cost + + val lsl_nat : 'a Script_int.num -> Gas.cost + + val lsr_nat : 'a Script_int.num -> Gas.cost + + val lsl_bytes : bytes -> Script_int.n Script_int.num -> Gas.cost + + val lsr_bytes : bytes -> Script_int.n Script_int.num -> Gas.cost + + val or_nat : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val or_bytes : bytes -> bytes -> Gas.cost + + val and_nat : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val and_int_nat : + Script_int.z Script_int.num -> Script_int.n Script_int.num -> Gas.cost + + val and_bytes : bytes -> bytes -> Gas.cost + + val xor_nat : 'a Script_int.num -> 'b Script_int.num -> Gas.cost + + val xor_bytes : bytes -> bytes -> Gas.cost + + val not_int : 'a Script_int.num -> Gas.cost + + val not_bytes : bytes -> Gas.cost + + val if_ : Gas.cost + + val loop : Gas.cost + + val loop_left : Gas.cost + + val dip : Gas.cost + + val check_signature : Signature.public_key -> bytes -> Gas.cost + + val blake2b : bytes -> Gas.cost + + val sha256 : bytes -> Gas.cost + + val sha512 : bytes -> Gas.cost + + val dign : int -> Gas.cost + + val dugn : int -> Gas.cost + + val dipn : int -> Gas.cost + + val dropn : int -> Gas.cost + + val voting_power : Gas.cost + + val total_voting_power : Gas.cost + + val keccak : bytes -> Gas.cost + + val sha3 : bytes -> Gas.cost + + val add_bls12_381_g1 : Gas.cost + + val add_bls12_381_g2 : Gas.cost + + val add_bls12_381_fr : Gas.cost + + val mul_bls12_381_g1 : Gas.cost + + val mul_bls12_381_g2 : Gas.cost + + val mul_bls12_381_fr : Gas.cost + + val mul_bls12_381_fr_z : 'a Script_int.num -> Gas.cost + + val mul_bls12_381_z_fr : 'a Script_int.num -> Gas.cost + + val int_bls12_381_fr : Gas.cost + + val neg_bls12_381_g1 : Gas.cost + + val neg_bls12_381_g2 : Gas.cost + + val neg_bls12_381_fr : Gas.cost + + val neq : Gas.cost + + val pairing_check_bls12_381 : 'a Script_list.t -> Gas.cost + + val comb : int -> Gas.cost + + val uncomb : int -> Gas.cost + + val comb_get : int -> Gas.cost + + val comb_set : int -> Gas.cost + + val dupn : int -> Gas.cost + + val compare : 'a Script_typed_ir.comparable_ty -> 'a -> 'a -> Gas.cost + + val concat_string_precheck : 'a Script_list.t -> Gas.cost + + val concat_string : + Saturation_repr.may_saturate Saturation_repr.t -> Gas.cost + + val concat_bytes : + Saturation_repr.may_saturate Saturation_repr.t -> Gas.cost + + val halt : Gas.cost + + val const : Gas.cost + + val empty_big_map : Gas.cost + + val lt : Gas.cost + + val le : Gas.cost + + val gt : Gas.cost + + val ge : Gas.cost + + val exec : Gas.cost + + val apply : rec_flag:bool -> Gas.cost + + val lambda : Gas.cost + + val address : Gas.cost + + val contract : Gas.cost + + val view : Gas.cost + + val view_get : Script_string.t -> Script_typed_ir.view_map -> Gas.cost + + val view_update : Script_string.t -> Script_typed_ir.view_map -> Gas.cost + + val transfer_tokens : Gas.cost + + val implicit_account : Gas.cost + + val create_contract : Gas.cost + + val set_delegate : Gas.cost + + val balance : Gas.cost + + val level : Gas.cost + + val now : Gas.cost + + val min_block_time : Gas.cost + + val hash_key : Signature.Public_key.t -> Gas.cost + + val source : Gas.cost + + val sender : Gas.cost + + val self : Gas.cost + + val self_address : Gas.cost + + val amount : Gas.cost + + val chain_id : Gas.cost + + val unpack : bytes -> Gas.cost + + val unpack_failed : string -> Gas.cost + + val sapling_empty_state : Gas.cost + + val sapling_verify_update : + inputs:int -> outputs:int -> bound_data:int -> Gas.cost + + val sapling_verify_update_deprecated : inputs:int -> outputs:int -> Gas.cost + + val ticket : Gas.cost + + val read_ticket : Gas.cost + + val split_ticket : 'a Script_int.num -> 'a Script_int.num -> Gas.cost + + val join_tickets : + 'a Script_typed_ir.comparable_ty -> + 'a Script_typed_ir.ticket -> + 'a Script_typed_ir.ticket -> + Gas.cost + + val open_chest : + chest:Script_typed_ir.Script_timelock.chest -> time:Z.t -> Gas.cost + + (** cost to generate one event emission internal operation *) + val emit : Gas.cost + + module Control : sig + val nil : Gas.cost + + val cons : Gas.cost + + val return : Gas.cost + + val view_exit : Gas.cost + + val map_head : Gas.cost + + val undip : Gas.cost + + val loop_in : Gas.cost + + val loop_in_left : Gas.cost + + val iter : Gas.cost + + val list_enter_body : 'a list -> int -> Gas.cost + + val list_exit_body : Gas.cost + + val map_enter_body : Gas.cost + + val map_exit_body : 'k -> ('k, 'v) Script_typed_ir.map -> Gas.cost + end + end + + module Typechecking : sig + val public_key_optimized : Gas.cost + + val public_key_readable : Gas.cost + + val key_hash_optimized : Gas.cost + + val key_hash_readable : Gas.cost + + val signature_optimized : Gas.cost + + val signature_readable : Gas.cost + + val chain_id_optimized : Gas.cost + + val chain_id_readable : Gas.cost + + val address_optimized : Gas.cost + + val contract_optimized : Gas.cost + + val contract_readable : Gas.cost + + val bls12_381_g1 : Gas.cost + + val bls12_381_g2 : Gas.cost + + val bls12_381_fr : Gas.cost + + val check_printable : string -> Gas.cost + + val merge_cycle : Gas.cost + + val parse_type_cycle : Gas.cost + + val parse_instr_cycle : Gas.cost + + val parse_data_cycle : Gas.cost + + val check_dupable_cycle : Gas.cost + + val find_entrypoint_cycle : Gas.cost + + val bool : Gas.cost + + val unit : Gas.cost + + val timestamp_readable : string -> Gas.cost + + val tx_rollup_l2_address : Gas.cost + + val contract_exists : Gas.cost + + val proof_argument : int -> Gas.cost + + val chest_key : Gas.cost + + val chest : bytes:int -> Gas.cost + end + + module Unparsing : sig + val public_key_optimized : Gas.cost + + val public_key_readable : Gas.cost + + val key_hash_optimized : Gas.cost + + val key_hash_readable : Gas.cost + + val signature_optimized : Gas.cost + + val signature_readable : Gas.cost + + val chain_id_optimized : Gas.cost + + val chain_id_readable : Gas.cost + + val timestamp_readable : Gas.cost + + val address_optimized : Gas.cost + + val contract_optimized : Gas.cost + + val contract_readable : Gas.cost + + val bls12_381_g1 : Gas.cost + + val bls12_381_g2 : Gas.cost + + val bls12_381_fr : Gas.cost + + val unparse_type : ('a, _) Script_typed_ir.ty -> Gas.cost + + val unparse_instr_cycle : Gas.cost + + val unparse_data_cycle : Gas.cost + + val unit : Gas.cost + + val tx_rollup_l2_address : Gas.cost + + val operation : bytes -> Gas.cost + + val sapling_transaction : Sapling.transaction -> Gas.cost + + val sapling_transaction_deprecated : Sapling.Legacy.transaction -> Gas.cost + + val sapling_diff : Sapling.diff -> Gas.cost + + val chest_key : Gas.cost + + val chest : plaintext_size:int -> Gas.cost + end +end + +module Internal_for_tests : sig + (** [int] value of {!Cost_of.manager_operation} *) + val int_cost_of_manager_operation : int +end diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs.ml b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs.ml new file mode 100644 index 000000000000..8f741bdefb2b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs.ml @@ -0,0 +1,153 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Michelson_v1_gas_costs_generated +module S = Saturation_repr + +(* This file contains functions saved from + the original michelson_v1_gas_costs.ml. + These functions couldn't be generated by the snoop tool. *) + +(* N_IMul_nattez / N_IMul_teznat + These functions are benchmarked with the affine model. + However, empirically, the coefficient is ignorably small. *) + +(* model N_IMul_nattez *) +let cost_N_IMul_nattez = S.safe_int 50 + +(* model N_IMul_teznat *) +let cost_N_IMul_teznat = S.safe_int 50 + +(* N_IEdiv_teznat + This function is modeled with `division_cost` model, + which takes two arguments, divisor and dividend. *) + +(* model N_IEdiv_teznat *) +let cost_N_IEdiv_teznat = S.safe_int 70 + +(* N_ISapling_verify_update + This function depends on another cost function cost_N_IBlake2b. + Such code can't be generated by the current Snoop. *) + +(* model N_ISapling_verify_update *) +let cost_N_ISapling_verify_update size1 size2 bound_data = + let open S.Syntax in + let v1 = S.safe_int size1 in + let v2 = S.safe_int size2 in + cost_N_IBlake2b bound_data + S.safe_int 310_000 + + (S.safe_int 5_575_000 * v1) + + (S.safe_int 5_075_000 * v2) + +(* N_IApply + The current generated model receives int as a flag, + but it should receive bool. *) + +(* model N_IApply *) +let cost_N_IApply rec_flag = if rec_flag then S.safe_int 220 else S.safe_int 140 + +(* N_KIter / N_KMap_enter_body + The empty_branch_model are used as the models. + However, the defined cost functions receive nothing. *) + +(* model N_KIter *) +let cost_N_KIter = S.safe_int 10 + +(* model N_KMap_enter_body *) +let cost_N_KMap_enter_body = S.safe_int 80 + +(* N_KList_enter_body + The generated model receives the length of `xs` as the first argument + and branches on whether it is 0 or not. + However, calculating the length makes the performance worse. + The model should be changed to receive `xs_is_nil` as the first argument. *) + +(* model N_KList_enter_body *) +(* Approximating 1.672196 x term *) +let cost_N_KList_enter_body xs size_ys = + match xs with + | [] -> + let open S.Syntax in + let v0 = S.safe_int size_ys in + S.safe_int 25 + (v0 + (v0 lsr 1) + (v0 lsr 3)) + | _ :: _ -> S.safe_int 25 + +(* TY_EQ / PARSE_TYPE / UNPARSE_TYPE / TYPECHECKING_CODE / UNPARSING_CODE + TYPECHECKING_DATA / UNPARSING_DATA / FIND_ENTRYPOINT + Following functions are commented to indicate that they were manually modified. *) + +(* model TY_EQ + This is the estimated cost of one iteration of ty_eq, extracted + and copied manually from the parameter fit for the TY_EQ benchmark + (the model is parametric on the size of the type, which we don't have + access to in O(1)). *) +let cost_TY_EQ = S.safe_int 60 + +(* model PARSE_TYPE + This is the cost of one iteration of parse_ty, extracted by hand from the + parameter fit for the PARSE_TYPE benchmark. *) +let cost_PARSE_TYPE = S.safe_int 60 + +(* model UNPARSE_TYPE + This is the cost of one iteration of unparse_ty, extracted by hand from the + parameter fit for the UNPARSE_TYPE benchmark. *) +let cost_UNPARSE_TYPE type_size = S.mul (S.safe_int 20) type_size + +(* model TYPECHECKING_CODE + This is the cost of one iteration of parse_instr, extracted by hand from the + parameter fit for the TYPECHECKING_CODE benchmark. *) +let cost_TYPECHECKING_CODE = S.safe_int 220 + +(* model UNPARSING_CODE + This is the cost of one iteration of unparse_instr, extracted by hand from the + parameter fit for the UNPARSING_CODE benchmark. *) +let cost_UNPARSING_CODE = S.safe_int 115 + +(* model TYPECHECKING_DATA + This is the cost of one iteration of parse_data, extracted by hand from the + parameter fit for the TYPECHECKING_DATA benchmark. *) +let cost_TYPECHECKING_DATA = S.safe_int 100 + +(* model UNPARSING_DATA + This is the cost of one iteration of unparse_data, extracted by hand from the + parameter fit for the UNPARSING_DATA benchmark. *) +let cost_UNPARSING_DATA = S.safe_int 65 + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2264 + Benchmark. + Currently approximated by 2 comparisons of the longest entrypoint. *) +let cost_FIND_ENTRYPOINT = cost_N_ICompare 31 31 + +(* SAPLING_TRANSACTION_ENCODING / SAPLING_DIFF_ENCODING + These functions are missing model definitions. *) + +(* model SAPLING_TRANSACTION_ENCODING *) +let cost_SAPLING_TRANSACTION_ENCODING ~inputs ~outputs ~bound_data = + S.safe_int (1500 + (inputs * 160) + (outputs * 320) + (bound_data lsr 3)) + +(* model SAPLING_DIFF_ENCODING *) +let cost_SAPLING_DIFF_ENCODING ~nfs ~cms = S.safe_int ((nfs * 22) + (cms * 215)) diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs_generated.ml b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs_generated.ml new file mode 100644 index 000000000000..0778b909ff03 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_gas_costs_generated.ml @@ -0,0 +1,1015 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr +module S_syntax = S.Syntax + +(* This file is planned to be automatically generated. *) +(* If you want to update the following functions, update the gas model instead. *) + +(* model N_IAbs_int *) +(* Allocates [size] bytes. *) +let cost_N_IAbs_int size = S.safe_int (20 + (size lsr 1)) + +(* model N_IAdd_bls12_381_fr *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IAdd_bls12_381_fr = S.safe_int 30 + +(* model N_IAdd_bls12_381_g1 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IAdd_bls12_381_g1 = S.safe_int 900 + +(* model N_IAdd_bls12_381_g2 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IAdd_bls12_381_g2 = S.safe_int 2_470 + +(* Allocates [max size1 size2] *) +let cost_linear_op_int size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.max size1 size2) in + S.safe_int 35 + (v0 lsr 1) + +(* model N_IAdd_int *) +(* Approximating 0.078154 x term *) +let cost_N_IAdd_int = cost_linear_op_int + +(* model N_IAdd_nat *) +(* Approximating 0.077807 x term *) +let cost_N_IAdd_nat = cost_linear_op_int + +(* model N_IAdd_seconds_to_timestamp *) +(* Approximating 0.078056 x term *) +let cost_N_IAdd_seconds_to_timestamp = cost_linear_op_int + +(* model N_IAdd_tez *) +let cost_N_IAdd_tez = S.safe_int 20 + +(* model N_IAdd_timestamp_to_seconds *) +(* Approximating 0.077771 x term *) +let cost_N_IAdd_timestamp_to_seconds = cost_linear_op_int + +(* model N_IAddress *) +let cost_N_IAddress = S.safe_int 10 + +(* model N_IAmount *) +let cost_N_IAmount = S.safe_int 10 + +(* model N_IAnd *) +let cost_N_IAnd = S.safe_int 10 + +(* model N_IAnd_int_nat *) +(* Allocates [min size1 size2] *) +let cost_N_IAnd_int_nat size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.min size1 size2) in + S.safe_int 35 + (v0 lsr 1) + +(* model N_IAnd_nat *) +(* Allocates [min size1 size2] *) +let cost_N_IAnd_nat size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.min size1 size2) in + S.safe_int 35 + (v0 lsr 1) + +(* model N_IAnd_bytes *) +(* Allocates [min size1 size2] *) +let cost_N_IAnd_bytes size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.min size1 size2) in + S.safe_int 30 + (v0 lsr 1) + +(* model N_IBalance *) +let cost_N_IBalance = S.safe_int 10 + +(* model N_IBlake2b *) +(* Approximating 1.120804 x term *) +let cost_N_IBlake2b size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 430 + v0 + (v0 lsr 3) + +(* model N_IBytes_size *) +let cost_N_IBytes_size = S.safe_int 10 + +(* model N_IByte_nat *) +(* fun size -> (66.8357335892 + (2.26239804697 * size)) *) +(* Allocate [size] bytes *) +let cost_N_IBytes_nat size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 70 + (v0 lsl 1) + (v0 lsr 2) + +(* model N_INat_bytes *) +(* fun size -> (27.7373924021 + (2.22456674632 * size)) *) +(* Allocates [size] bytes *) +let cost_N_INat_bytes size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 30 + (v0 lsl 1) + +(* model N_IBytes_int *) +(* fun size -> (67.2231916885 + (2.29117132926 * size)) *) +(* Allocates [size] bytes *) +let cost_N_IBytes_int size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 70 + (v0 lsl 1) + (v0 lsr 2) + +(* model N_IInt_bytes *) +(* fun size -> (26.6345701541 + (2.24766891219 * size)) *) +(* Allocates [size] bytes *) +let cost_N_IInt_bytes size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 30 + (v0 lsl 1) + +(* model N_ICar *) +let cost_N_ICar = S.safe_int 10 + +(* model N_ICdr *) +let cost_N_ICdr = S.safe_int 10 + +(* model N_IChainId *) +let cost_N_IChainId = S.safe_int 15 + +(* model N_ICheck_signature_ed25519 *) +(* Approximating 1.123507 x term *) +let cost_N_ICheck_signature_ed25519 size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 65_800 + (v0 + (v0 lsr 3)) + +(* model N_ICheck_signature_p256 *) +(* Approximating 1.111539 x term *) +let cost_N_ICheck_signature_p256 size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 990_000 + (v0 + (v0 lsr 3)) + +(* model N_ICheck_signature_secp256k1 *) +(* Approximating 1.125404 x term *) +let cost_N_ICheck_signature_secp256k1 size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 51_600 + (v0 + (v0 lsr 3)) + +(* model N_ICheck_signature_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_N_ICheck_signature_bls size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 7_567_000 + (v0 + (v0 lsr 3)) + +(* model N_IComb *) +(* Approximating 3.531001 x term *) +(* Note: size >= 2, so the cost is never 0 *) +let cost_N_IComb size = + let open S_syntax in + let v0 = S.safe_int size in + (S.safe_int 3 * v0) + (v0 lsr 1) + (v0 lsr 5) + +(* model N_IComb_get *) +(* Approximating 0.573180 x term *) +let cost_N_IComb_get size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 20 + (v0 lsr 1) + (v0 lsr 4) + +(* model N_IComb_set *) +(* Approximating 1.287531 x term *) +let cost_N_IComb_set size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 20 + (v0 + (v0 lsr 2) + (v0 lsr 5)) + +(* Model N_ICompare *) +(* Approximating 0.024413 x term *) +let cost_N_ICompare size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.min size1 size2) in + S.safe_int 35 + ((v0 lsr 6) + (v0 lsr 7)) + +(* model N_IConcat_bytes_pair *) +(* Allocates [size1 + size2] *) +let cost_N_IConcat_bytes_pair size1 size2 = + let open S_syntax in + let v0 = S.safe_int size1 + S.safe_int size2 in + S.safe_int 45 + (v0 lsr 1) + +(* model N_IConcat_string_pair *) +(* Allocates [size1 + size2] *) +let cost_N_IConcat_string_pair size1 size2 = + let open S_syntax in + let v0 = S.safe_int size1 + S.safe_int size2 in + S.safe_int 45 + (v0 lsr 1) + +(* model N_ICons_list *) +let cost_N_ICons_list = S.safe_int 10 + +(* model N_ICons_none *) +let cost_N_ICons_none = S.safe_int 10 + +(* model N_ICons_pair *) +let cost_N_ICons_pair = S.safe_int 10 + +(* model N_ICons_some *) +let cost_N_ICons_some = S.safe_int 10 + +(* model N_IConst *) +let cost_N_IConst = S.safe_int 10 + +(* model N_IContract *) +let cost_N_IContract = S.safe_int 30 + +(* model N_ICreate_contract *) +let cost_N_ICreate_contract = S.safe_int 60 + +(* model N_IDiff_timestamps *) +(* Approximating 0.077922 x term *) +let cost_N_IDiff_timestamps = cost_linear_op_int + +(* model N_IDig *) +(* Approximating 6.750442 x term *) +let cost_N_IDig size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 30 + ((S.safe_int 6 * v0) + (v0 lsr 1) + (v0 lsr 2)) + +(* model N_IDip *) +let cost_N_IDip = S.safe_int 10 + +(* model N_IDipN *) +(* Approximating 4.05787663635 x term *) +let cost_N_IDipN size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 15 + (S.safe_int 4 * v0) + +(* model N_IView *) +let cost_N_IView = S.safe_int 1460 + +(* model N_IDrop *) +let cost_N_IDrop = S.safe_int 10 + +(* model N_IDropN *) +(* Approximating 2.713108 x term *) +let cost_N_IDropN size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 30 + (S.safe_int 2 * v0) + (v0 lsr 1) + (v0 lsr 3) + +(* model N_IDug *) +(* Approximating 6.718396 x term *) +let cost_N_IDug size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 35 + ((S.safe_int 6 * v0) + (v0 lsr 1) + (v0 lsr 2)) + +(* model N_IDup *) +let cost_N_IDup = S.safe_int 10 + +(* model N_IDupN *) +(* Approximating 1.222263 x term *) +let cost_N_IDupN size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 20 + v0 + (v0 lsr 2) + +let cost_div_int size1 size2 = + (* Allocates at most [size1] bytes *) + let q = size1 - size2 in + let open S_syntax in + let v1 = S.safe_int size1 in + if Compare.Int.(q < 0) then S.safe_int 105 + (v1 lsr 1) + else + let v0 = S.safe_int q * S.safe_int size2 in + S.safe_int 105 + (v0 lsr 10) + (v0 lsr 11) + (v0 lsr 13) + (v1 lsr 1) + +(* model N_IEdiv_int *) +(* Approximating 0.001591 x term *) +let cost_N_IEdiv_int = cost_div_int + +(* model N_IEdiv_nat *) +(* Approximating 0.001605 x term *) +let cost_N_IEdiv_nat = cost_div_int + +(* model N_IEdiv_tez *) +let cost_N_IEdiv_tez = S.safe_int 80 + +(* model N_IEmpty_big_map *) +let cost_N_IEmpty_big_map = S.safe_int 300 + +(* model N_IEmpty_map *) +let cost_N_IEmpty_map = S.safe_int 300 + +(* model N_IEmpty_set *) +let cost_N_IEmpty_set = S.safe_int 300 + +(* model N_IEq *) +let cost_N_IEq = S.safe_int 10 + +(* model N_IExec *) +let cost_N_IExec = S.safe_int 10 + +(* model N_IFailwith *) +(* let cost_N_IFailwith = S.safe_int 105 *) + +(* model N_IGe *) +let cost_N_IGe = S.safe_int 10 + +(* model N_IGt *) +let cost_N_IGt = S.safe_int 10 + +(* model N_IHalt *) +let cost_N_IHalt = S.safe_int 15 + +(* model N_IHash_key *) +let cost_N_IHash_key = S.safe_int 605 + +(* model N_IIf *) +let cost_N_IIf = S.safe_int 10 + +(* model N_IIf_cons *) +let cost_N_IIf_cons = S.safe_int 10 + +(* model N_IIf_left *) +let cost_N_IIf_left = S.safe_int 10 + +(* model N_IIf_none *) +let cost_N_IIf_none = S.safe_int 10 + +(* model N_IOpt_map *) +let cost_N_IOpt_map = S.safe_int 10 + +(* model N_IImplicit_account *) +let cost_N_IImplicit_account = S.safe_int 10 + +(* model N_IInt_bls12_381_z_fr *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IInt_bls12_381_z_fr = S.safe_int 115 + +(* model N_IInt_nat *) +let cost_N_IInt_nat = S.safe_int 10 + +(* model N_IIs_nat *) +let cost_N_IIs_nat = S.safe_int 10 + +(* model N_IKeccak *) +(* Approximating 8.276352 x term *) +let cost_N_IKeccak size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 1350 + ((S.safe_int 8 * v0) + (v0 lsr 2)) + +(* model N_ILambda *) +let cost_N_ILambda = S.safe_int 10 + +(* model N_ILe *) +let cost_N_ILe = S.safe_int 10 + +(* model N_ILeft *) +let cost_N_ILeft = S.safe_int 10 + +(* model N_ILevel *) +let cost_N_ILevel = S.safe_int 10 + +(* model N_IList_iter *) +let cost_N_IList_iter = S.safe_int 20 + +(* model N_IList_map *) +let cost_N_IList_map = S.safe_int 20 + +(* model N_IList_size *) +let cost_N_IList_size = S.safe_int 10 + +(* model N_ILoop *) +let cost_N_ILoop = S.safe_int 10 + +(* model N_ILoop_left *) +let cost_N_ILoop_left = S.safe_int 10 + +(* model N_ILsl_nat *) +(* Allocates at most [size + 256] bytes *) +let cost_N_ILsl_nat size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 128 + (v0 lsr 1) + +(* model N_ILsr_nat *) +(* Allocates at most [size] bytes*) +let cost_N_ILsr_nat size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 45 + (v0 lsr 1) + +(* model N_ILsl_bytes *) +(* Allocates [size + shift / 8] bytes *) +let cost_N_ILsl_bytes size shift = + let open S_syntax in + let v1 = S.safe_int size in + let v0 = S.safe_int shift in + S.safe_int 70 + (v1 lsr 1) + (v0 lsr 4) + +(* model N_ILsr_bytes *) +(* Allocates [max 0 (size - shift / 8)] bytes *) +let cost_N_ILsr_bytes size shift = + let q = size - (shift lsr 3) in + let open S.Syntax in + if Compare.Int.(q < 0) then S.safe_int 70 + else + let v0 = S.safe_int q in + S.safe_int 70 + (v0 lsr 1) + +(* model N_ILt *) +let cost_N_ILt = S.safe_int 10 + +(* model N_IMap_get *) +(* Approximating 0.048359 x term *) +let cost_N_IMap_get size1 size2 = + let open S_syntax in + let size1 = S.safe_int size1 in + let size2 = S.safe_int size2 in + let v0 = size1 * log2 size2 in + S.safe_int 45 + (v0 lsr 5) + (v0 lsr 6) + +(* model N_IMap_get_and_update *) +(* Approximating 0.145661 x term *) +let cost_N_IMap_get_and_update size1 size2 = + let open S_syntax in + let size1 = S.safe_int size1 in + let size2 = S.safe_int size2 in + let v0 = size1 * log2 size2 in + S.safe_int 75 + (v0 lsr 3) + (v0 lsr 6) + +(* model N_IMap_iter *) +(* Approximating 7.621331 x term *) +let cost_N_IMap_iter size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 50 + (S.safe_int 7 * v0) + (v0 lsr 1) + (v0 lsr 3) + +(* model N_IMap_map *) +(* Approximating 8.38965386732 x term *) +let cost_N_IMap_map size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 40 + ((S.safe_int 8 * v0) + (v0 lsr 1)) + +(* model N_IMap_mem *) +(* Approximating 0.048446 x term *) +let cost_N_IMap_mem size1 size2 = + let open S_syntax in + let size1 = S.safe_int size1 in + let size2 = S.safe_int size2 in + let v0 = size1 * log2 size2 in + S.safe_int 45 + (v0 lsr 5) + (v0 lsr 6) + +(* model N_IMap_size *) +let cost_N_IMap_size = S.safe_int 10 + +(* model N_IMap_update *) +(* Approximating 0.097072 x term *) +let cost_N_IMap_update size1 size2 = + let open S_syntax in + let size1 = S.safe_int size1 in + let size2 = S.safe_int size2 in + let v0 = size1 * log2 size2 in + S.safe_int 55 + (v0 lsr 4) + (v0 lsr 5) + +(* model N_IMul_bls12_381_fr *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IMul_bls12_381_fr = S.safe_int 45 + +(* model N_IMul_bls12_381_fr_z *) +(* Approximating 1.059386 x term *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IMul_bls12_381_fr_z size1 = + let open S_syntax in + let v0 = S.safe_int size1 in + S.safe_int 265 + v0 + (v0 lsr 4) + +(* model N_IMul_bls12_381_g1 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IMul_bls12_381_g1 = S.safe_int 103_000 + +(* model N_IMul_bls12_381_g2 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IMul_bls12_381_g2 = S.safe_int 220_000 + +(* model N_IMul_bls12_381_z_fr *) +(* Approximating 1.068674 x term *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IMul_bls12_381_z_fr size1 = + let open S_syntax in + let v0 = S.safe_int size1 in + S.safe_int 265 + v0 + (v0 lsr 4) + +let cost_mul size1 size2 = + let open S_syntax in + let a = S.add (S.safe_int size1) (S.safe_int size2) in + let v0 = a * log2 a in + S.safe_int 55 + (v0 lsr 1) + (v0 lsr 2) + (v0 lsr 4) + +(* model N_IMul_int *) +(* Approximating 0.857931 x term *) +let cost_N_IMul_int = cost_mul + +(* model N_IMul_nat *) +(* Approximating 0.861823 x term *) +let cost_N_IMul_nat = cost_mul + +(* model N_INeg_bls12_381_fr *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_INeg_bls12_381_fr = S.safe_int 25 + +(* model N_INeg_bls12_381_g1 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_INeg_bls12_381_g1 = S.safe_int 50 + +(* model N_INeg_bls12_381_g2 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_INeg_bls12_381_g2 = S.safe_int 70 + +(* model N_INeg *) +(* Allocates [size] bytes *) +let cost_N_INeg size = + let open S_syntax in + S.safe_int 25 + (S.safe_int size lsr 1) + +(* model N_INeq *) +let cost_N_INeq = S.safe_int 10 + +(* model N_INil *) +let cost_N_INil = S.safe_int 10 + +(* model N_INot *) +let cost_N_INot = S.safe_int 10 + +(* model N_INot_int *) +(* Allocates [size] bytes *) +let cost_N_INot_int size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 25 + (v0 lsr 1) + +(* model N_INot_bytes *) +(* Allocates [size] bytes *) +let cost_N_INot_bytes size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 30 + (v0 lsr 1) + +(* model N_INow *) +let cost_N_INow = S.safe_int 10 + +(* model N_IMin_block_time *) +let cost_N_IMin_block_time = S.safe_int 20 + +(* model N_IOpen_chest *) +(* 612000 + chest * 19 + time * 19050 *) +let cost_N_IOpen_chest time chest = + let open S_syntax in + let v0 = S.safe_int chest in + let v1 = S.safe_int time in + S.safe_int 612_000 + (S.safe_int 19 * v0) + (S.safe_int 19050 * v1) + +(* model N_IOr *) +let cost_N_IOr = S.safe_int 10 + +(* model N_IOr_nat *) +(* Approximating 0.075758 x term *) +let cost_N_IOr_nat = cost_linear_op_int + +(* model N_IOr_bytes *) +(* Allocates [max size1 size2] bytes *) +let cost_N_IOr_bytes size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.max size1 size2) in + S.safe_int 30 + (v0 lsr 1) + +(* model N_IPairing_check_bls12_381 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_N_IPairing_check_bls12_381 size = + S.add (S.safe_int 450_000) (S.mul (S.safe_int 342_500) (S.safe_int size)) + +(* model N_IRead_ticket *) +let cost_N_IRead_ticket = S.safe_int 10 + +(* model N_IRight *) +let cost_N_IRight = S.safe_int 10 + +(* model N_ISapling_empty_state *) +let cost_N_ISapling_empty_state = S.safe_int 300 + +(* model N_ISelf_address *) +let cost_N_ISelf_address = S.safe_int 10 + +(* model N_ISelf *) +let cost_N_ISelf = S.safe_int 10 + +(* model N_ISender *) +let cost_N_ISender = S.safe_int 10 + +(* model N_ISet_delegate *) +let cost_N_ISet_delegate = S.safe_int 60 + +(* model N_ISet_iter *) +(* Approximating 7.633555 x term *) +let cost_N_ISet_iter size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 50 + (S.safe_int 7 * v0) + (v0 lsr 1) + (v0 lsr 3) + +(* model N_ISet_size *) +let cost_N_ISet_size = S.safe_int 10 + +(* model N_ISha256 *) +(* Approximating 4.763264 x term *) +let cost_N_ISha256 size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 600 + ((S.safe_int 4 * v0) + (v0 lsr 1) + (v0 lsr 2)) + +(* model N_ISha3 *) +(* Approximating 8.362339 x term *) +let cost_N_ISha3 = cost_N_IKeccak + +(* model N_ISha512 *) +(* Approximating 3.074641 x term *) +let cost_N_ISha512 size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 680 + (S.safe_int 3 * v0) + +(* model N_ISlice_bytes *) +(* Allocates [size] bytes *) +let cost_N_ISlice_bytes size = + let open S_syntax in + S.safe_int 25 + (S.safe_int size lsr 1) + +(* model N_ISlice_string *) +(* Allocates [size] bytes *) +let cost_N_ISlice_string size = + let open S_syntax in + S.safe_int 25 + (S.safe_int size lsr 1) + +(* model N_ISource *) +let cost_N_ISource = S.safe_int 10 + +(* model N_ISplit_ticket *) +(* Allocates [max size1 size2] *) +let cost_N_ISplit_ticket size1 size2 = + let open S_syntax in + let v1 = S.safe_int (Compare.Int.max size1 size2) in + S.safe_int 40 + (v1 lsr 1) + +(* model N_IString_size *) +let cost_N_IString_size = S.safe_int 15 + +(* model N_ISub_int *) +(* Approximating 0.077849 x term *) +let cost_N_ISub_int = cost_linear_op_int + +(* model N_ISub_tez *) +let cost_N_ISub_tez = S.safe_int 15 + +(* model N_ISub_tez_legacy *) +let cost_N_ISub_tez_legacy = S.safe_int 20 + +(* model N_ISub_timestamp_seconds *) +(* Approximating 0.077794 x term *) +let cost_N_ISub_timestamp_seconds = cost_linear_op_int + +(* model N_ISwap *) +let cost_N_ISwap = S.safe_int 10 + +(* model N_ITicket *) +let cost_N_ITicket = S.safe_int 10 + +(* model N_ITotal_voting_power *) +let cost_N_ITotal_voting_power = S.safe_int 450 + +(* model N_ITransfer_tokens *) +let cost_N_ITransfer_tokens = S.safe_int 60 + +(* model N_IUncomb *) +(* Approximating 3.944710 x term *) +let cost_N_IUncomb size = + let open S_syntax in + let v0 = S.safe_int size in + S.safe_int 25 + (S.safe_int 4 * v0) + +(* model N_IUnpair *) +let cost_N_IUnpair = S.safe_int 10 + +(* model N_IVoting_power *) +let cost_N_IVoting_power = S.safe_int 640 + +(* model N_IXor *) +let cost_N_IXor = S.safe_int 15 + +(* model N_IXor_nat *) +(* Approximating 0.075601 x term *) +let cost_N_IXor_nat = cost_linear_op_int + +(* model N_IXor_bytes *) +(* Allocates [max size1 size2] bytes *) +let cost_N_IXor_bytes size1 size2 = + let open S_syntax in + let v0 = S.safe_int (Compare.Int.max size1 size2) in + S.safe_int 30 + (v0 lsr 1) + +(* model N_KCons *) +let cost_N_KCons = S.safe_int 10 + +(* model N_KList_exit_body *) +let cost_N_KList_exit_body = S.safe_int 10 + +(* model N_KLoop_in *) +let cost_N_KLoop_in = S.safe_int 10 + +(* model N_KLoop_in_left *) +let cost_N_KLoop_in_left = S.safe_int 10 + +(* model N_KNil *) +let cost_N_KNil = S.safe_int 15 + +(* model N_KReturn *) +let cost_N_KReturn = S.safe_int 10 + +(* model N_KView_exit *) +let cost_N_KView_exit = S.safe_int 20 + +(* model N_KMap_head *) +let cost_N_KMap_head = S.safe_int 20 + +(* model N_KUndip *) +let cost_N_KUndip = S.safe_int 10 + +(* model DECODING_BLS_FR *) +(* when benchmarking, compile bls12-381 without ADX, see + https://gitlab.com/dannywillems/ocaml-bls12-381/-/blob/71d0b4d467fbfaa6452d702fcc408d7a70916a80/README.md#install +*) +let cost_DECODING_BLS_FR = S.safe_int 120 + +(* model DECODING_BLS_G1 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_DECODING_BLS_G1 = S.safe_int 54_600 + +(* model DECODING_BLS_G2 *) +(* when benchmarking, compile bls12-381 without ADX *) +let cost_DECODING_BLS_G2 = S.safe_int 69_000 + +(* model B58CHECK_DECODING_CHAIN_ID *) +let cost_B58CHECK_DECODING_CHAIN_ID = S.safe_int 1_600 + +(* model B58CHECK_DECODING_PUBLIC_KEY_HASH_ed25519 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_ed25519 = S.safe_int 3_300 + +(* model B58CHECK_DECODING_PUBLIC_KEY_HASH_p256 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_p256 = S.safe_int 3_300 + +(* model B58CHECK_DECODING_PUBLIC_KEY_HASH_secp256k1 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_secp256k1 = S.safe_int 3_300 + +(* model B58CHECK_DECODING_PUBLIC_KEY_HASH_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_HASH_bls = S.safe_int 3_300 + +(* model B58CHECK_DECODING_PUBLIC_KEY_ed25519 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_ed25519 = S.safe_int 4_200 + +(* model B58CHECK_DECODING_PUBLIC_KEY_p256 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_p256 = S.safe_int 325_000 + +(* model B58CHECK_DECODING_PUBLIC_KEY_secp256k1 *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_secp256k1 = S.safe_int 9_000 + +(* model B58CHECK_DECODING_PUBLIC_KEY_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_DECODING_PUBLIC_KEY_bls = S.safe_int 9_000 + +(* model B58CHECK_DECODING_SIGNATURE_ed25519 *) +let cost_B58CHECK_DECODING_SIGNATURE_ed25519 = S.safe_int 6_400 + +(* model B58CHECK_DECODING_SIGNATURE_p256 *) +let cost_B58CHECK_DECODING_SIGNATURE_p256 = S.safe_int 6_400 + +(* model B58CHECK_DECODING_SIGNATURE_secp256k1 *) +let cost_B58CHECK_DECODING_SIGNATURE_secp256k1 = S.safe_int 6_400 + +(* model B58CHECK_DECODING_SIGNATURE_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_DECODING_SIGNATURE_bls = S.safe_int 6_400 + +(* model ENCODING_BLS_FR *) +let cost_ENCODING_BLS_FR = S.safe_int 80 + +(* model ENCODING_BLS_G1 *) +let cost_ENCODING_BLS_G1 = S.safe_int 3200 + +(* model ENCODING_BLS_G2 *) +let cost_ENCODING_BLS_G2 = S.safe_int 3900 + +(* model B58CHECK_ENCODING_CHAIN_ID *) +let cost_B58CHECK_ENCODING_CHAIN_ID = S.safe_int 1_800 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_HASH_ed25519 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_ed25519 = S.safe_int 3_200 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_HASH_p256 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_p256 = S.safe_int 3_200 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_HASH_secp256k1 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_secp256k1 = S.safe_int 3_200 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_HASH_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_HASH_bls = S.safe_int 3_200 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_ed25519 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_ed25519 = S.safe_int 4_500 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_p256 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_p256 = S.safe_int 4_550 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_secp256k1 *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_secp256k1 = S.safe_int 4_950 + +(* model B58CHECK_ENCODING_PUBLIC_KEY_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_ENCODING_PUBLIC_KEY_bls = S.safe_int 4_500 + +(* model B58CHECK_ENCODING_SIGNATURE_ed25519 *) +let cost_B58CHECK_ENCODING_SIGNATURE_ed25519 = S.safe_int 8_300 + +(* model B58CHECK_ENCODING_SIGNATURE_p256 *) +let cost_B58CHECK_ENCODING_SIGNATURE_p256 = S.safe_int 8_300 + +(* model B58CHECK_ENCODING_SIGNATURE_secp256k1 *) +let cost_B58CHECK_ENCODING_SIGNATURE_secp256k1 = S.safe_int 8_300 + +(* model B58CHECK_ENCODING_SIGNATURE_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_B58CHECK_ENCODING_SIGNATURE_bls = S.safe_int 8_300 + +(* model DECODING_CHAIN_ID *) +let cost_DECODING_CHAIN_ID = S.safe_int 50 + +(* model DECODING_PUBLIC_KEY_HASH_ed25519 *) +let cost_DECODING_PUBLIC_KEY_HASH_ed25519 = S.safe_int 50 + +(* model DECODING_PUBLIC_KEY_HASH_p256 *) +let cost_DECODING_PUBLIC_KEY_HASH_p256 = S.safe_int 50 + +(* model DECODING_PUBLIC_KEY_HASH_secp256k1 *) +let cost_DECODING_PUBLIC_KEY_HASH_secp256k1 = S.safe_int 50 + +(* model DECODING_PUBLIC_KEY_HASH_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_DECODING_PUBLIC_KEY_HASH_bls = S.safe_int 50 + +(* model DECODING_PUBLIC_KEY_ed25519 *) +let cost_DECODING_PUBLIC_KEY_ed25519 = S.safe_int 60 + +(* model DECODING_PUBLIC_KEY_p256 *) +let cost_DECODING_PUBLIC_KEY_p256 = S.safe_int 320_000 + +(* model DECODING_PUBLIC_KEY_secp256k1 *) +let cost_DECODING_PUBLIC_KEY_secp256k1 = S.safe_int 4_900 + +(* model DECODING_PUBLIC_KEY_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_DECODING_PUBLIC_KEY_bls = S.safe_int 60 + +(* model DECODING_SIGNATURE_ed25519 *) +let cost_DECODING_SIGNATURE_ed25519 = S.safe_int 35 + +(* model DECODING_SIGNATURE_p256 *) +let cost_DECODING_SIGNATURE_p256 = S.safe_int 35 + +(* model DECODING_SIGNATURE_secp256k1 *) +let cost_DECODING_SIGNATURE_secp256k1 = S.safe_int 35 + +(* model DECODING_SIGNATURE_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_DECODING_SIGNATURE_bls = S.safe_int 35 + +(* model DECODING_Chest_key *) +let cost_DECODING_Chest_key = S.safe_int 5900 + +(* model DECODING_Chest *) +(* Approximating 0.039349 x term *) +let cost_DECODING_Chest bytes = + let open S_syntax in + let v0 = S.safe_int bytes in + S.safe_int 7400 + (v0 lsr 5) + (v0 lsr 7) + +(* model ENCODING_CHAIN_ID *) +let cost_ENCODING_CHAIN_ID = S.safe_int 50 + +(* model ENCODING_PUBLIC_KEY_HASH_ed25519 *) +let cost_ENCODING_PUBLIC_KEY_HASH_ed25519 = S.safe_int 70 + +(* model ENCODING_PUBLIC_KEY_HASH_p256 *) +let cost_ENCODING_PUBLIC_KEY_HASH_p256 = S.safe_int 70 + +(* model ENCODING_PUBLIC_KEY_HASH_secp256k1 *) +let cost_ENCODING_PUBLIC_KEY_HASH_secp256k1 = S.safe_int 70 + +(* model ENCODING_PUBLIC_KEY_HASH_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_ENCODING_PUBLIC_KEY_HASH_bls = S.safe_int 70 + +(* model ENCODING_PUBLIC_KEY_ed25519 *) +let cost_ENCODING_PUBLIC_KEY_ed25519 = S.safe_int 80 + +(* model ENCODING_PUBLIC_KEY_p256 *) +let cost_ENCODING_PUBLIC_KEY_p256 = S.safe_int 90 + +(* model ENCODING_PUBLIC_KEY_secp256k1 *) +let cost_ENCODING_PUBLIC_KEY_secp256k1 = S.safe_int 455 + +(* model ENCODING_PUBLIC_KEY_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_ENCODING_PUBLIC_KEY_bls = S.safe_int 80 + +(* model ENCODING_SIGNATURE_ed25519 *) +let cost_ENCODING_SIGNATURE_ed25519 = S.safe_int 45 + +(* model ENCODING_SIGNATURE_p256 *) +let cost_ENCODING_SIGNATURE_p256 = S.safe_int 45 + +(* model ENCODING_SIGNATURE_secp256k1 *) +let cost_ENCODING_SIGNATURE_secp256k1 = S.safe_int 45 + +(* model ENCODING_SIGNATURE_bls *) +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3183 + Run benchmarks to update costs. *) +let cost_ENCODING_SIGNATURE_bls = S.safe_int 45 + +(* model ENCODING_Chest_key *) +let cost_ENCODING_Chest_key = S.safe_int 10_000 + +(* model ENCODING_Chest *) +(* Approximating 0.120086 x term *) +let cost_ENCODING_Chest plaintext_size = + let open S_syntax in + let v0 = S.safe_int plaintext_size in + S.safe_int 12_200 + (v0 lsr 3) + +(* model TIMESTAMP_READABLE_DECODING *) +(* Approximating 0.045400 x term *) +let cost_TIMESTAMP_READABLE_DECODING bytes = + let open S_syntax in + let b = S.safe_int bytes in + let v0 = S.mul (S.sqrt b) b in + S.safe_int 105 + ((v0 lsr 5) + (v0 lsr 6)) + +(* model TIMESTAMP_READABLE_ENCODING *) +let cost_TIMESTAMP_READABLE_ENCODING = S.safe_int 820 + +(* model CHECK_PRINTABLE *) +let cost_CHECK_PRINTABLE size = + let open S_syntax in + S.safe_int 14 + (S.safe_int 10 * S.safe_int size) + +(* model IEmit *) +let cost_N_IEmit = S.safe_int 30 diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.ml b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.ml new file mode 100644 index 000000000000..c0bf8dfc858e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.ml @@ -0,0 +1,836 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Micheline + +type error += Unknown_primitive_name of string + +type error += Invalid_case of string + +type error += + | Invalid_primitive_name of + string Micheline.canonical * Micheline.canonical_location + +type prim = + | K_parameter + | K_storage + | K_code + | K_view + | D_False + | D_Elt + | D_Left + | D_None + | D_Pair + | D_Right + | D_Some + | D_True + | D_Unit + | D_Lambda_rec + | I_PACK + | I_UNPACK + | I_BLAKE2B + | I_SHA256 + | I_SHA512 + | I_ABS + | I_ADD + | I_AMOUNT + | I_AND + | I_BALANCE + | I_CAR + | I_CDR + | I_CHAIN_ID + | I_CHECK_SIGNATURE + | I_COMPARE + | I_CONCAT + | I_CONS + | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT + | I_IMPLICIT_ACCOUNT + | I_DIP + | I_DROP + | I_DUP + | I_VIEW + | I_EDIV + | I_EMPTY_BIG_MAP + | I_EMPTY_MAP + | I_EMPTY_SET + | I_EQ + | I_EXEC + | I_APPLY + | I_FAILWITH + | I_GE + | I_GET + | I_GET_AND_UPDATE + | I_GT + | I_HASH_KEY + | I_IF + | I_IF_CONS + | I_IF_LEFT + | I_IF_NONE + | I_INT + | I_LAMBDA + | I_LAMBDA_REC + | I_LE + | I_LEFT + | I_LEVEL + | I_LOOP + | I_LSL + | I_LSR + | I_LT + | I_MAP + | I_MEM + | I_MUL + | I_NEG + | I_NEQ + | I_NIL + | I_NONE + | I_NOT + | I_NOW + | I_MIN_BLOCK_TIME + | I_OR + | I_PAIR + | I_UNPAIR + | I_PUSH + | I_RIGHT + | I_SIZE + | I_SOME + | I_SOURCE + | I_SENDER + | I_SELF + | I_SELF_ADDRESS + | I_SLICE + | I_STEPS_TO_QUOTA + | I_SUB + | I_SUB_MUTEZ + | I_SWAP + | I_TRANSFER_TOKENS + | I_SET_DELEGATE + | I_UNIT + | I_UPDATE + | I_XOR + | I_ITER + | I_LOOP_LEFT + | I_ADDRESS + | I_CONTRACT + | I_ISNAT + | I_CAST + | I_RENAME + | I_SAPLING_EMPTY_STATE + | I_SAPLING_VERIFY_UPDATE + | I_DIG + | I_DUG + | I_NEVER + | I_VOTING_POWER + | I_TOTAL_VOTING_POWER + | I_KECCAK + | I_SHA3 + | I_PAIRING_CHECK + | I_TICKET + | I_TICKET_DEPRECATED + | I_READ_TICKET + | I_SPLIT_TICKET + | I_JOIN_TICKETS + | I_OPEN_CHEST + | I_EMIT + | I_BYTES + | I_NAT + | T_bool + | T_contract + | T_int + | T_key + | T_key_hash + | T_lambda + | T_list + | T_map + | T_big_map + | T_nat + | T_option + | T_or + | T_pair + | T_set + | T_signature + | T_string + | T_bytes + | T_mutez + | T_timestamp + | T_unit + | T_operation + | T_address + | T_tx_rollup_l2_address + | T_sapling_transaction + | T_sapling_transaction_deprecated + | T_sapling_state + | T_chain_id + | T_never + | T_bls12_381_g1 + | T_bls12_381_g2 + | T_bls12_381_fr + | T_ticket + | T_chest_key + | T_chest + | H_constant + +(* Auxiliary types for error documentation. + All the prim constructor prefixes must match their namespace. *) +type namespace = + | (* prefix "T" *) Type_namespace + | (* prefix "D" *) Constant_namespace + | (* prefix "I" *) Instr_namespace + | (* prefix "K" *) Keyword_namespace + | (* prefix "H" *) Constant_hash_namespace + +let namespace = function + | K_code | K_view | K_parameter | K_storage -> Keyword_namespace + | D_Elt | D_False | D_Left | D_None | D_Pair | D_Right | D_Some | D_True + | D_Unit | D_Lambda_rec -> + Constant_namespace + | I_ABS | I_ADD | I_ADDRESS | I_AMOUNT | I_AND | I_APPLY | I_BALANCE + | I_BLAKE2B | I_CAR | I_CAST | I_CDR | I_CHAIN_ID | I_CHECK_SIGNATURE + | I_COMPARE | I_CONCAT | I_CONS | I_CONTRACT | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT | I_DIG | I_DIP | I_DROP | I_DUG | I_DUP | I_VIEW | I_EDIV + | I_EMPTY_BIG_MAP | I_EMPTY_MAP | I_EMPTY_SET | I_EQ | I_EXEC | I_FAILWITH + | I_GE | I_GET | I_GET_AND_UPDATE | I_GT | I_HASH_KEY | I_IF | I_IF_CONS + | I_IF_LEFT | I_IF_NONE | I_IMPLICIT_ACCOUNT | I_INT | I_ISNAT | I_ITER + | I_JOIN_TICKETS | I_KECCAK | I_LAMBDA | I_LAMBDA_REC | I_LE | I_LEFT + | I_LEVEL | I_LOOP | I_LOOP_LEFT | I_LSL | I_LSR | I_LT | I_MAP | I_MEM + | I_MUL | I_NEG | I_NEQ | I_NEVER | I_NIL | I_NONE | I_NOT | I_NOW + | I_MIN_BLOCK_TIME | I_OR | I_PACK | I_PAIR | I_PAIRING_CHECK | I_PUSH + | I_READ_TICKET | I_RENAME | I_RIGHT | I_SAPLING_EMPTY_STATE + | I_SAPLING_VERIFY_UPDATE | I_SELF | I_SELF_ADDRESS | I_SENDER + | I_SET_DELEGATE | I_SHA256 | I_SHA512 | I_SHA3 | I_SIZE | I_SLICE | I_SOME + | I_SOURCE | I_SPLIT_TICKET | I_STEPS_TO_QUOTA | I_SUB | I_SUB_MUTEZ | I_SWAP + | I_TICKET | I_TICKET_DEPRECATED | I_TOTAL_VOTING_POWER | I_TRANSFER_TOKENS + | I_UNIT | I_UNPACK | I_UNPAIR | I_UPDATE | I_VOTING_POWER | I_XOR + | I_OPEN_CHEST | I_EMIT | I_BYTES | I_NAT -> + Instr_namespace + | T_address | T_tx_rollup_l2_address | T_big_map | T_bool | T_bytes + | T_chain_id | T_contract | T_int | T_key | T_key_hash | T_lambda | T_list + | T_map | T_mutez | T_nat | T_never | T_operation | T_option | T_or | T_pair + | T_sapling_state | T_sapling_transaction | T_sapling_transaction_deprecated + | T_set | T_signature | T_string | T_timestamp | T_unit | T_bls12_381_fr + | T_bls12_381_g1 | T_bls12_381_g2 | T_ticket | T_chest_key | T_chest -> + Type_namespace + | H_constant -> Constant_hash_namespace + +let valid_case name = + let is_lower = function '_' | 'a' .. 'z' -> true | _ -> false in + let is_upper = function '_' | 'A' .. 'Z' -> true | _ -> false in + let rec for_all a b f = Compare.Int.(a > b) || (f a && for_all (a + 1) b f) in + let len = String.length name in + Compare.Int.(len <> 0) + && Compare.Char.(name.[0] <> '_') + && ((is_upper name.[0] && for_all 1 (len - 1) (fun i -> is_upper name.[i])) + || (is_upper name.[0] && for_all 1 (len - 1) (fun i -> is_lower name.[i])) + || (is_lower name.[0] && for_all 1 (len - 1) (fun i -> is_lower name.[i])) + ) + +let string_of_prim = function + | K_parameter -> "parameter" + | K_storage -> "storage" + | K_code -> "code" + | K_view -> "view" + | D_False -> "False" + | D_Elt -> "Elt" + | D_Left -> "Left" + | D_None -> "None" + | D_Pair -> "Pair" + | D_Right -> "Right" + | D_Some -> "Some" + | D_True -> "True" + | D_Unit -> "Unit" + | D_Lambda_rec -> "Lambda_rec" + | I_PACK -> "PACK" + | I_UNPACK -> "UNPACK" + | I_BLAKE2B -> "BLAKE2B" + | I_SHA256 -> "SHA256" + | I_SHA512 -> "SHA512" + | I_ABS -> "ABS" + | I_ADD -> "ADD" + | I_AMOUNT -> "AMOUNT" + | I_AND -> "AND" + | I_BALANCE -> "BALANCE" + | I_CAR -> "CAR" + | I_CDR -> "CDR" + | I_CHAIN_ID -> "CHAIN_ID" + | I_CHECK_SIGNATURE -> "CHECK_SIGNATURE" + | I_COMPARE -> "COMPARE" + | I_CONCAT -> "CONCAT" + | I_CONS -> "CONS" + | I_CREATE_ACCOUNT -> "CREATE_ACCOUNT" + | I_CREATE_CONTRACT -> "CREATE_CONTRACT" + | I_IMPLICIT_ACCOUNT -> "IMPLICIT_ACCOUNT" + | I_DIP -> "DIP" + | I_DROP -> "DROP" + | I_DUP -> "DUP" + | I_EDIV -> "EDIV" + | I_EMPTY_BIG_MAP -> "EMPTY_BIG_MAP" + | I_EMPTY_MAP -> "EMPTY_MAP" + | I_EMPTY_SET -> "EMPTY_SET" + | I_EQ -> "EQ" + | I_EXEC -> "EXEC" + | I_APPLY -> "APPLY" + | I_FAILWITH -> "FAILWITH" + | I_GE -> "GE" + | I_GET -> "GET" + | I_GET_AND_UPDATE -> "GET_AND_UPDATE" + | I_GT -> "GT" + | I_HASH_KEY -> "HASH_KEY" + | I_IF -> "IF" + | I_IF_CONS -> "IF_CONS" + | I_IF_LEFT -> "IF_LEFT" + | I_IF_NONE -> "IF_NONE" + | I_INT -> "INT" + | I_LAMBDA -> "LAMBDA" + | I_LAMBDA_REC -> "LAMBDA_REC" + | I_LE -> "LE" + | I_LEFT -> "LEFT" + | I_LEVEL -> "LEVEL" + | I_LOOP -> "LOOP" + | I_LSL -> "LSL" + | I_LSR -> "LSR" + | I_LT -> "LT" + | I_MAP -> "MAP" + | I_MEM -> "MEM" + | I_MUL -> "MUL" + | I_NEG -> "NEG" + | I_NEQ -> "NEQ" + | I_NIL -> "NIL" + | I_NONE -> "NONE" + | I_NOT -> "NOT" + | I_NOW -> "NOW" + | I_MIN_BLOCK_TIME -> "MIN_BLOCK_TIME" + | I_OR -> "OR" + | I_PAIR -> "PAIR" + | I_PUSH -> "PUSH" + | I_RIGHT -> "RIGHT" + | I_SIZE -> "SIZE" + | I_SOME -> "SOME" + | I_SOURCE -> "SOURCE" + | I_SENDER -> "SENDER" + | I_SELF -> "SELF" + | I_SELF_ADDRESS -> "SELF_ADDRESS" + | I_SLICE -> "SLICE" + | I_STEPS_TO_QUOTA -> "STEPS_TO_QUOTA" + | I_SUB -> "SUB" + | I_SUB_MUTEZ -> "SUB_MUTEZ" + | I_SWAP -> "SWAP" + | I_TRANSFER_TOKENS -> "TRANSFER_TOKENS" + | I_SET_DELEGATE -> "SET_DELEGATE" + | I_UNIT -> "UNIT" + | I_UNPAIR -> "UNPAIR" + | I_UPDATE -> "UPDATE" + | I_XOR -> "XOR" + | I_ITER -> "ITER" + | I_LOOP_LEFT -> "LOOP_LEFT" + | I_ADDRESS -> "ADDRESS" + | I_CONTRACT -> "CONTRACT" + | I_ISNAT -> "ISNAT" + | I_CAST -> "CAST" + | I_RENAME -> "RENAME" + | I_SAPLING_EMPTY_STATE -> "SAPLING_EMPTY_STATE" + | I_SAPLING_VERIFY_UPDATE -> "SAPLING_VERIFY_UPDATE" + | I_DIG -> "DIG" + | I_DUG -> "DUG" + | I_NEVER -> "NEVER" + | I_VOTING_POWER -> "VOTING_POWER" + | I_TOTAL_VOTING_POWER -> "TOTAL_VOTING_POWER" + | I_KECCAK -> "KECCAK" + | I_SHA3 -> "SHA3" + | I_PAIRING_CHECK -> "PAIRING_CHECK" + | I_TICKET -> "TICKET" + | I_TICKET_DEPRECATED -> "TICKET_DEPRECATED" + | I_READ_TICKET -> "READ_TICKET" + | I_SPLIT_TICKET -> "SPLIT_TICKET" + | I_JOIN_TICKETS -> "JOIN_TICKETS" + | I_OPEN_CHEST -> "OPEN_CHEST" + | I_EMIT -> "EMIT" + | I_VIEW -> "VIEW" + | I_BYTES -> "BYTES" + | I_NAT -> "NAT" + | T_bool -> "bool" + | T_contract -> "contract" + | T_int -> "int" + | T_key -> "key" + | T_key_hash -> "key_hash" + | T_lambda -> "lambda" + | T_list -> "list" + | T_map -> "map" + | T_big_map -> "big_map" + | T_nat -> "nat" + | T_option -> "option" + | T_or -> "or" + | T_pair -> "pair" + | T_set -> "set" + | T_signature -> "signature" + | T_string -> "string" + | T_bytes -> "bytes" + | T_mutez -> "mutez" + | T_timestamp -> "timestamp" + | T_unit -> "unit" + | T_operation -> "operation" + | T_address -> "address" + | T_tx_rollup_l2_address -> "tx_rollup_l2_address" + | T_sapling_state -> "sapling_state" + | T_sapling_transaction -> "sapling_transaction" + | T_sapling_transaction_deprecated -> "sapling_transaction_deprecated" + | T_chain_id -> "chain_id" + | T_never -> "never" + | T_bls12_381_g1 -> "bls12_381_g1" + | T_bls12_381_g2 -> "bls12_381_g2" + | T_bls12_381_fr -> "bls12_381_fr" + | T_ticket -> "ticket" + | T_chest_key -> "chest_key" + | T_chest -> "chest" + | H_constant -> "constant" + +let prim_of_string = function + | "parameter" -> ok K_parameter + | "storage" -> ok K_storage + | "code" -> ok K_code + | "view" -> ok K_view + | "False" -> ok D_False + | "Elt" -> ok D_Elt + | "Left" -> ok D_Left + | "None" -> ok D_None + | "Pair" -> ok D_Pair + | "Right" -> ok D_Right + | "Some" -> ok D_Some + | "True" -> ok D_True + | "Unit" -> ok D_Unit + | "Lambda_rec" -> ok D_Lambda_rec + | "PACK" -> ok I_PACK + | "UNPACK" -> ok I_UNPACK + | "BLAKE2B" -> ok I_BLAKE2B + | "SHA256" -> ok I_SHA256 + | "SHA512" -> ok I_SHA512 + | "ABS" -> ok I_ABS + | "ADD" -> ok I_ADD + | "AMOUNT" -> ok I_AMOUNT + | "AND" -> ok I_AND + | "BALANCE" -> ok I_BALANCE + | "CAR" -> ok I_CAR + | "CDR" -> ok I_CDR + | "CHAIN_ID" -> ok I_CHAIN_ID + | "CHECK_SIGNATURE" -> ok I_CHECK_SIGNATURE + | "COMPARE" -> ok I_COMPARE + | "CONCAT" -> ok I_CONCAT + | "CONS" -> ok I_CONS + | "CREATE_ACCOUNT" -> ok I_CREATE_ACCOUNT + | "CREATE_CONTRACT" -> ok I_CREATE_CONTRACT + | "IMPLICIT_ACCOUNT" -> ok I_IMPLICIT_ACCOUNT + | "DIP" -> ok I_DIP + | "DROP" -> ok I_DROP + | "DUP" -> ok I_DUP + | "VIEW" -> ok I_VIEW + | "EDIV" -> ok I_EDIV + | "EMPTY_BIG_MAP" -> ok I_EMPTY_BIG_MAP + | "EMPTY_MAP" -> ok I_EMPTY_MAP + | "EMPTY_SET" -> ok I_EMPTY_SET + | "EQ" -> ok I_EQ + | "EXEC" -> ok I_EXEC + | "APPLY" -> ok I_APPLY + | "FAILWITH" -> ok I_FAILWITH + | "GE" -> ok I_GE + | "GET" -> ok I_GET + | "GET_AND_UPDATE" -> ok I_GET_AND_UPDATE + | "GT" -> ok I_GT + | "HASH_KEY" -> ok I_HASH_KEY + | "IF" -> ok I_IF + | "IF_CONS" -> ok I_IF_CONS + | "IF_LEFT" -> ok I_IF_LEFT + | "IF_NONE" -> ok I_IF_NONE + | "INT" -> ok I_INT + | "KECCAK" -> ok I_KECCAK + | "LAMBDA" -> ok I_LAMBDA + | "LAMBDA_REC" -> ok I_LAMBDA_REC + | "LE" -> ok I_LE + | "LEFT" -> ok I_LEFT + | "LEVEL" -> ok I_LEVEL + | "LOOP" -> ok I_LOOP + | "LSL" -> ok I_LSL + | "LSR" -> ok I_LSR + | "LT" -> ok I_LT + | "MAP" -> ok I_MAP + | "MEM" -> ok I_MEM + | "MUL" -> ok I_MUL + | "NEG" -> ok I_NEG + | "NEQ" -> ok I_NEQ + | "NIL" -> ok I_NIL + | "NONE" -> ok I_NONE + | "NOT" -> ok I_NOT + | "NOW" -> ok I_NOW + | "MIN_BLOCK_TIME" -> ok I_MIN_BLOCK_TIME + | "OR" -> ok I_OR + | "PAIR" -> ok I_PAIR + | "UNPAIR" -> ok I_UNPAIR + | "PAIRING_CHECK" -> ok I_PAIRING_CHECK + | "PUSH" -> ok I_PUSH + | "RIGHT" -> ok I_RIGHT + | "SHA3" -> ok I_SHA3 + | "SIZE" -> ok I_SIZE + | "SOME" -> ok I_SOME + | "SOURCE" -> ok I_SOURCE + | "SENDER" -> ok I_SENDER + | "SELF" -> ok I_SELF + | "SELF_ADDRESS" -> ok I_SELF_ADDRESS + | "SLICE" -> ok I_SLICE + | "STEPS_TO_QUOTA" -> ok I_STEPS_TO_QUOTA + | "SUB" -> ok I_SUB + | "SUB_MUTEZ" -> ok I_SUB_MUTEZ + | "SWAP" -> ok I_SWAP + | "TRANSFER_TOKENS" -> ok I_TRANSFER_TOKENS + | "SET_DELEGATE" -> ok I_SET_DELEGATE + | "UNIT" -> ok I_UNIT + | "UPDATE" -> ok I_UPDATE + | "XOR" -> ok I_XOR + | "ITER" -> ok I_ITER + | "LOOP_LEFT" -> ok I_LOOP_LEFT + | "ADDRESS" -> ok I_ADDRESS + | "CONTRACT" -> ok I_CONTRACT + | "ISNAT" -> ok I_ISNAT + | "CAST" -> ok I_CAST + | "RENAME" -> ok I_RENAME + | "SAPLING_EMPTY_STATE" -> ok I_SAPLING_EMPTY_STATE + | "SAPLING_VERIFY_UPDATE" -> ok I_SAPLING_VERIFY_UPDATE + | "DIG" -> ok I_DIG + | "DUG" -> ok I_DUG + | "NEVER" -> ok I_NEVER + | "VOTING_POWER" -> ok I_VOTING_POWER + | "TOTAL_VOTING_POWER" -> ok I_TOTAL_VOTING_POWER + | "TICKET" -> ok I_TICKET + | "TICKET_DEPRECATED" -> ok I_TICKET_DEPRECATED + | "READ_TICKET" -> ok I_READ_TICKET + | "SPLIT_TICKET" -> ok I_SPLIT_TICKET + | "JOIN_TICKETS" -> ok I_JOIN_TICKETS + | "OPEN_CHEST" -> ok I_OPEN_CHEST + | "EMIT" -> ok I_EMIT + | "BYTES" -> ok I_BYTES + | "NAT" -> ok I_NAT + | "bool" -> ok T_bool + | "contract" -> ok T_contract + | "int" -> ok T_int + | "key" -> ok T_key + | "key_hash" -> ok T_key_hash + | "lambda" -> ok T_lambda + | "list" -> ok T_list + | "map" -> ok T_map + | "big_map" -> ok T_big_map + | "nat" -> ok T_nat + | "option" -> ok T_option + | "or" -> ok T_or + | "pair" -> ok T_pair + | "set" -> ok T_set + | "signature" -> ok T_signature + | "string" -> ok T_string + | "bytes" -> ok T_bytes + | "mutez" -> ok T_mutez + | "timestamp" -> ok T_timestamp + | "unit" -> ok T_unit + | "operation" -> ok T_operation + | "address" -> ok T_address + | "tx_rollup_l2_address" -> ok T_tx_rollup_l2_address + | "sapling_state" -> ok T_sapling_state + | "sapling_transaction" -> ok T_sapling_transaction + | "sapling_transaction_deprecated" -> ok T_sapling_transaction_deprecated + | "chain_id" -> ok T_chain_id + | "never" -> ok T_never + | "bls12_381_g1" -> ok T_bls12_381_g1 + | "bls12_381_g2" -> ok T_bls12_381_g2 + | "bls12_381_fr" -> ok T_bls12_381_fr + | "ticket" -> ok T_ticket + | "chest_key" -> ok T_chest_key + | "chest" -> ok T_chest + | "constant" -> ok H_constant + | n -> + if valid_case n then error (Unknown_primitive_name n) + else error (Invalid_case n) + +let prims_of_strings expr = + let rec convert = function + | (Int _ | String _ | Bytes _) as expr -> ok expr + | Prim (loc, prim, args, annot) -> + Error_monad.record_trace + (Invalid_primitive_name (expr, loc)) + (prim_of_string prim) + >>? fun prim -> + List.map_e convert args >|? fun args -> Prim (loc, prim, args, annot) + | Seq (loc, args) -> List.map_e convert args >|? fun args -> Seq (loc, args) + in + convert (root expr) >|? fun expr -> strip_locations expr + +let strings_of_prims expr = + let rec convert = function + | (Int _ | String _ | Bytes _) as expr -> expr + | Prim (loc, prim, args, annot) -> + let prim = string_of_prim prim in + let args = List.map convert args in + Prim (loc, prim, args, annot) + | Seq (loc, args) -> + let args = List.map convert args in + Seq (loc, args) + in + strip_locations (convert (root expr)) + +let prim_encoding = + let open Data_encoding in + def "michelson.v1.primitives" + @@ string_enum + (* Add the comment below every 10 lines *) + [ + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("parameter", K_parameter); + ("storage", K_storage); + ("code", K_code); + ("False", D_False); + ("Elt", D_Elt); + ("Left", D_Left); + ("None", D_None); + ("Pair", D_Pair); + ("Right", D_Right); + ("Some", D_Some); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("True", D_True); + ("Unit", D_Unit); + ("PACK", I_PACK); + ("UNPACK", I_UNPACK); + ("BLAKE2B", I_BLAKE2B); + ("SHA256", I_SHA256); + ("SHA512", I_SHA512); + ("ABS", I_ABS); + ("ADD", I_ADD); + ("AMOUNT", I_AMOUNT); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("AND", I_AND); + ("BALANCE", I_BALANCE); + ("CAR", I_CAR); + ("CDR", I_CDR); + ("CHECK_SIGNATURE", I_CHECK_SIGNATURE); + ("COMPARE", I_COMPARE); + ("CONCAT", I_CONCAT); + ("CONS", I_CONS); + ("CREATE_ACCOUNT", I_CREATE_ACCOUNT); + ("CREATE_CONTRACT", I_CREATE_CONTRACT); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("IMPLICIT_ACCOUNT", I_IMPLICIT_ACCOUNT); + ("DIP", I_DIP); + ("DROP", I_DROP); + ("DUP", I_DUP); + ("EDIV", I_EDIV); + ("EMPTY_MAP", I_EMPTY_MAP); + ("EMPTY_SET", I_EMPTY_SET); + ("EQ", I_EQ); + ("EXEC", I_EXEC); + ("FAILWITH", I_FAILWITH); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("GE", I_GE); + ("GET", I_GET); + ("GT", I_GT); + ("HASH_KEY", I_HASH_KEY); + ("IF", I_IF); + ("IF_CONS", I_IF_CONS); + ("IF_LEFT", I_IF_LEFT); + ("IF_NONE", I_IF_NONE); + ("INT", I_INT); + ("LAMBDA", I_LAMBDA); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("LE", I_LE); + ("LEFT", I_LEFT); + ("LOOP", I_LOOP); + ("LSL", I_LSL); + ("LSR", I_LSR); + ("LT", I_LT); + ("MAP", I_MAP); + ("MEM", I_MEM); + ("MUL", I_MUL); + ("NEG", I_NEG); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("NEQ", I_NEQ); + ("NIL", I_NIL); + ("NONE", I_NONE); + ("NOT", I_NOT); + ("NOW", I_NOW); + ("OR", I_OR); + ("PAIR", I_PAIR); + ("PUSH", I_PUSH); + ("RIGHT", I_RIGHT); + ("SIZE", I_SIZE); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("SOME", I_SOME); + ("SOURCE", I_SOURCE); + ("SENDER", I_SENDER); + ("SELF", I_SELF); + ("STEPS_TO_QUOTA", I_STEPS_TO_QUOTA); + ("SUB", I_SUB); + ("SWAP", I_SWAP); + ("TRANSFER_TOKENS", I_TRANSFER_TOKENS); + ("SET_DELEGATE", I_SET_DELEGATE); + ("UNIT", I_UNIT); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("UPDATE", I_UPDATE); + ("XOR", I_XOR); + ("ITER", I_ITER); + ("LOOP_LEFT", I_LOOP_LEFT); + ("ADDRESS", I_ADDRESS); + ("CONTRACT", I_CONTRACT); + ("ISNAT", I_ISNAT); + ("CAST", I_CAST); + ("RENAME", I_RENAME); + ("bool", T_bool); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("contract", T_contract); + ("int", T_int); + ("key", T_key); + ("key_hash", T_key_hash); + ("lambda", T_lambda); + ("list", T_list); + ("map", T_map); + ("big_map", T_big_map); + ("nat", T_nat); + ("option", T_option); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("or", T_or); + ("pair", T_pair); + ("set", T_set); + ("signature", T_signature); + ("string", T_string); + ("bytes", T_bytes); + ("mutez", T_mutez); + ("timestamp", T_timestamp); + ("unit", T_unit); + ("operation", T_operation); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("address", T_address); + (* Alpha_002 addition *) + ("SLICE", I_SLICE); + (* Alpha_005 addition *) + ("DIG", I_DIG); + ("DUG", I_DUG); + ("EMPTY_BIG_MAP", I_EMPTY_BIG_MAP); + ("APPLY", I_APPLY); + ("chain_id", T_chain_id); + ("CHAIN_ID", I_CHAIN_ID); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + (* Alpha_008 addition *) + ("LEVEL", I_LEVEL); + ("SELF_ADDRESS", I_SELF_ADDRESS); + ("never", T_never); + ("NEVER", I_NEVER); + ("UNPAIR", I_UNPAIR); + ("VOTING_POWER", I_VOTING_POWER); + ("TOTAL_VOTING_POWER", I_TOTAL_VOTING_POWER); + ("KECCAK", I_KECCAK); + ("SHA3", I_SHA3); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + (* Alpha_008 addition *) + ("PAIRING_CHECK", I_PAIRING_CHECK); + ("bls12_381_g1", T_bls12_381_g1); + ("bls12_381_g2", T_bls12_381_g2); + ("bls12_381_fr", T_bls12_381_fr); + ("sapling_state", T_sapling_state); + ("sapling_transaction_deprecated", T_sapling_transaction_deprecated); + ("SAPLING_EMPTY_STATE", I_SAPLING_EMPTY_STATE); + ("SAPLING_VERIFY_UPDATE", I_SAPLING_VERIFY_UPDATE); + ("ticket", T_ticket); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + (* Alpha_008 addition *) + ("TICKET_DEPRECATED", I_TICKET_DEPRECATED); + ("READ_TICKET", I_READ_TICKET); + ("SPLIT_TICKET", I_SPLIT_TICKET); + ("JOIN_TICKETS", I_JOIN_TICKETS); + ("GET_AND_UPDATE", I_GET_AND_UPDATE); + (* Alpha_011 addition *) + ("chest", T_chest); + ("chest_key", T_chest_key); + ("OPEN_CHEST", I_OPEN_CHEST); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + ("VIEW", I_VIEW); + ("view", K_view); + ("constant", H_constant); + (* Alpha_012 addition *) + ("SUB_MUTEZ", I_SUB_MUTEZ); + (* Alpha_013 addition *) + ("tx_rollup_l2_address", T_tx_rollup_l2_address); + ("MIN_BLOCK_TIME", I_MIN_BLOCK_TIME); + ("sapling_transaction", T_sapling_transaction); + (* /!\ NEW INSTRUCTIONS MUST BE ADDED AT THE END OF THE STRING_ENUM, FOR BACKWARD COMPATIBILITY OF THE ENCODING. *) + (* Alpha_014 addition *) + ("EMIT", I_EMIT); + (* Alpha_015 addition *) + ("Lambda_rec", D_Lambda_rec); + ("LAMBDA_REC", I_LAMBDA_REC); + ("TICKET", I_TICKET); + ("BYTES", I_BYTES); + ("NAT", I_NAT) + (* New instructions must be added here, for backward compatibility of the encoding. *) + (* Keep the comment above at the end of the list *); + ] + +let () = + register_error_kind + `Permanent + ~id:"michelson_v1.unknown_primitive_name" + ~title:"Unknown primitive name" + ~description:"In a script or data expression, a primitive was unknown." + ~pp:(fun ppf n -> Format.fprintf ppf "Unknown primitive %s." n) + Data_encoding.(obj1 (req "wrong_primitive_name" @@ string Plain)) + (function Unknown_primitive_name got -> Some got | _ -> None) + (fun got -> Unknown_primitive_name got) ; + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_primitive_name_case" + ~title:"Invalid primitive name case" + ~description: + "In a script or data expression, a primitive name is neither uppercase, \ + lowercase or capitalized." + ~pp:(fun ppf n -> Format.fprintf ppf "Primitive %s has invalid case." n) + Data_encoding.(obj1 (req "wrong_primitive_name" @@ string Plain)) + (function Invalid_case name -> Some name | _ -> None) + (fun name -> Invalid_case name) ; + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_primitive_name" + ~title:"Invalid primitive name" + ~description: + "In a script or data expression, a primitive name is unknown or has a \ + wrong case." + ~pp:(fun ppf _ -> Format.fprintf ppf "Invalid primitive.") + Data_encoding.( + obj2 + (req + "expression" + (Micheline.canonical_encoding ~variant:"generic" @@ string Plain)) + (req "location" Micheline.canonical_location_encoding)) + (function + | Invalid_primitive_name (expr, loc) -> Some (expr, loc) | _ -> None) + (fun (expr, loc) -> Invalid_primitive_name (expr, loc)) + +let string_of_namespace = function + | Type_namespace -> "T" + | Constant_namespace -> "D" + | Instr_namespace -> "I" + | Keyword_namespace -> "K" + | Constant_hash_namespace -> "H" diff --git a/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.mli b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.mli new file mode 100644 index 000000000000..761631190aba --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/michelson_v1_primitives.mli @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += (* `Permanent *) Unknown_primitive_name of string + +type error += (* `Permanent *) Invalid_case of string + +type error += + | (* `Permanent *) + Invalid_primitive_name of + string Micheline.canonical * Micheline.canonical_location + +(** Types of nodes in Michelson's AST. They fall into 4 categories: + - types (prefixed with [T_]); + - constants (prefixed with [D_]); + - instructions (prefixed with [I_]); + - keywords (prefixed with [K_]). + + Recall that Micheline is essentially just S-expressions with + a few extra atom types for strings and numbers. This variant + represents the values the [Prim] atoms in the Michelson subset + of Micheline. Other types (such as ['a Micheline.canonical]) are + frequently parameterized by this type. This gives us a strongly-typed + subset of Micheline while keeping the set of primitives independent + from the definition of Micheline for easier changes. +*) +type prim = + | K_parameter + | K_storage + | K_code + | K_view + | D_False + | D_Elt + | D_Left + | D_None + | D_Pair + | D_Right + | D_Some + | D_True + | D_Unit + | D_Lambda_rec + | I_PACK + | I_UNPACK + | I_BLAKE2B + | I_SHA256 + | I_SHA512 + | I_ABS + | I_ADD + | I_AMOUNT + | I_AND + | I_BALANCE + | I_CAR + | I_CDR + | I_CHAIN_ID + | I_CHECK_SIGNATURE + | I_COMPARE + | I_CONCAT + | I_CONS + | I_CREATE_ACCOUNT + | I_CREATE_CONTRACT + | I_IMPLICIT_ACCOUNT + | I_DIP + | I_DROP + | I_DUP + | I_VIEW + | I_EDIV + | I_EMPTY_BIG_MAP + | I_EMPTY_MAP + | I_EMPTY_SET + | I_EQ + | I_EXEC + | I_APPLY + | I_FAILWITH + | I_GE + | I_GET + | I_GET_AND_UPDATE + | I_GT + | I_HASH_KEY + | I_IF + | I_IF_CONS + | I_IF_LEFT + | I_IF_NONE + | I_INT + | I_LAMBDA + | I_LAMBDA_REC + | I_LE + | I_LEFT + | I_LEVEL + | I_LOOP + | I_LSL + | I_LSR + | I_LT + | I_MAP + | I_MEM + | I_MUL + | I_NEG + | I_NEQ + | I_NIL + | I_NONE + | I_NOT + | I_NOW + | I_MIN_BLOCK_TIME + | I_OR + | I_PAIR + | I_UNPAIR + | I_PUSH + | I_RIGHT + | I_SIZE + | I_SOME + | I_SOURCE + | I_SENDER + | I_SELF + | I_SELF_ADDRESS + | I_SLICE + | I_STEPS_TO_QUOTA + | I_SUB + | I_SUB_MUTEZ + | I_SWAP + | I_TRANSFER_TOKENS + | I_SET_DELEGATE + | I_UNIT + | I_UPDATE + | I_XOR + | I_ITER + | I_LOOP_LEFT + | I_ADDRESS + | I_CONTRACT + | I_ISNAT + | I_CAST + | I_RENAME + | I_SAPLING_EMPTY_STATE + | I_SAPLING_VERIFY_UPDATE + | I_DIG + | I_DUG + | I_NEVER + | I_VOTING_POWER + | I_TOTAL_VOTING_POWER + | I_KECCAK + | I_SHA3 + | I_PAIRING_CHECK + | I_TICKET + | I_TICKET_DEPRECATED + | I_READ_TICKET + | I_SPLIT_TICKET + | I_JOIN_TICKETS + | I_OPEN_CHEST + | I_EMIT + | I_BYTES + | I_NAT + | T_bool + | T_contract + | T_int + | T_key + | T_key_hash + | T_lambda + | T_list + | T_map + | T_big_map + | T_nat + | T_option + | T_or + | T_pair + | T_set + | T_signature + | T_string + | T_bytes + | T_mutez + | T_timestamp + | T_unit + | T_operation + | T_address + | T_tx_rollup_l2_address + | T_sapling_transaction + | T_sapling_transaction_deprecated + | T_sapling_state + | T_chain_id + | T_never + | T_bls12_381_g1 + | T_bls12_381_g2 + | T_bls12_381_fr + | T_ticket + | T_chest_key + | T_chest + (* See the interface of [Global_constants_storage]. *) + | H_constant + +(** Auxiliary types for error documentation. + All the prim constructor prefixes must match their namespace. *) + +type namespace = + | (* prefix "T" *) Type_namespace + | (* prefix "D" *) Constant_namespace + | (* prefix "I" *) Instr_namespace + | (* prefix "K" *) Keyword_namespace + (* The Constant Hash namespace is a singleton reserved + for the constant keyword. Unlike other primitives, + constants have no representation in the typed IR, + being fully expanded away before typechecking. *) + | (* prefix "H" *) Constant_hash_namespace + +val namespace : prim -> namespace + +val prim_encoding : prim Data_encoding.encoding + +val string_of_prim : prim -> string + +val prim_of_string : string -> prim tzresult + +val prims_of_strings : + string Micheline.canonical -> prim Micheline.canonical tzresult + +val strings_of_prims : prim Micheline.canonical -> string Micheline.canonical + +(** The string corresponds to the constructor prefix from the given namespace + (i.e. "T", "D", "I" or "K") *) +val string_of_namespace : namespace -> string diff --git a/src/proto_016_PtMumbai/lib_protocol/migration_repr.ml b/src/proto_016_PtMumbai/lib_protocol/migration_repr.ml new file mode 100644 index 000000000000..0008eed3f778 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/migration_repr.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type origination_result = { + balance_updates : Receipt_repr.balance_updates; + originated_contracts : Contract_hash.t list; + storage_size : Z.t; + paid_storage_size_diff : Z.t; +} + +let origination_result_list_encoding = + let open Data_encoding in + def "operation.alpha.origination_result" + @@ list + (conv + (fun { + balance_updates; + originated_contracts; + storage_size; + paid_storage_size_diff; + } -> + ( balance_updates, + originated_contracts, + storage_size, + paid_storage_size_diff )) + (fun ( balance_updates, + originated_contracts, + storage_size, + paid_storage_size_diff ) -> + { + balance_updates; + originated_contracts; + storage_size; + paid_storage_size_diff; + }) + (obj4 + (dft "balance_updates" Receipt_repr.balance_updates_encoding []) + (dft + "originated_contracts" + (list Contract_repr.originated_encoding) + []) + (dft "storage_size" z Z.zero) + (dft "paid_storage_size_diff" z Z.zero))) diff --git a/src/proto_016_PtMumbai/lib_protocol/migration_repr.mli b/src/proto_016_PtMumbai/lib_protocol/migration_repr.mli new file mode 100644 index 000000000000..1fb90c08c0d7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/migration_repr.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Dupe of `Kind.origination successful_manager_operation_result` for use + inside Alpha_context. Converted in Apply_results. + + Doesn't consume gas and omits lazy_storage_diff field since it would + require copying Script_ir_translator functions to work on Raw_context. + *) +type origination_result = { + balance_updates : Receipt_repr.balance_updates; + originated_contracts : Contract_hash.t list; + storage_size : Z.t; + paid_storage_size_diff : Z.t; +} + +val origination_result_list_encoding : origination_result list Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/misc.ml b/src/proto_016_PtMumbai/lib_protocol/misc.ml new file mode 100644 index 000000000000..817c53730049 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/misc.ml @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Public_key_map = Map.Make (Signature.Public_key) + +type 'a lazyt = unit -> 'a + +type 'a lazy_list_t = LCons of 'a * 'a lazy_list_t tzresult Lwt.t lazyt + +type 'a lazy_list = 'a lazy_list_t tzresult Lwt.t + +let rec ( --> ) i j = + (* [i; i+1; ...; j] *) + if Compare.Int.(i > j) then [] else i :: (succ i --> j) + +let rec ( <-- ) i j = + (* [j; j-1; ...; i] *) + if Compare.Int.(i > j) then [] else j :: (i <-- pred j) + +let rec ( ---> ) i j = + (* [i; i+1; ...; j] *) + if Compare.Int32.(i > j) then [] else i :: (Int32.succ i ---> j) + +let split delim ?(limit = max_int) path = + let l = String.length path in + let rec do_slashes acc limit i = + if Compare.Int.(i >= l) then List.rev acc + else if Compare.Char.(path.[i] = delim) then do_slashes acc limit (i + 1) + else do_split acc limit i + and do_split acc limit i = + if Compare.Int.(limit <= 0) then + if Compare.Int.(i = l) then List.rev acc + else List.rev (String.sub path i (l - i) :: acc) + else do_component acc (pred limit) i i + and do_component acc limit i j = + if Compare.Int.(j >= l) then + if Compare.Int.(i = j) then List.rev acc + else List.rev (String.sub path i (j - i) :: acc) + else if Compare.Char.(path.[j] = delim) then + do_slashes (String.sub path i (j - i) :: acc) limit j + else do_component acc limit i (j + 1) + in + if Compare.Int.(limit > 0) then do_slashes [] limit 0 else [path] + +let pp_print_paragraph ppf description = + Format.fprintf + ppf + "@[%a@]" + Format.(pp_print_list ~pp_sep:pp_print_space pp_print_string) + (split ' ' description) + +let take n l = + let rec loop acc n xs = + if Compare.Int.(n <= 0) then Some (List.rev acc, xs) + else match xs with [] -> None | x :: xs -> loop (x :: acc) (n - 1) xs + in + loop [] n l + +let remove_prefix ~prefix s = + let x = String.length prefix in + let n = String.length s in + if Compare.Int.(n >= x) && Compare.String.(String.sub s 0 x = prefix) then + Some (String.sub s x (n - x)) + else None + +let rec remove_elem_from_list nb = function + | [] -> [] + | _ :: _ as l when Compare.Int.(nb <= 0) -> l + | _ :: tl -> remove_elem_from_list (nb - 1) tl diff --git a/src/proto_016_PtMumbai/lib_protocol/misc.mli b/src/proto_016_PtMumbai/lib_protocol/misc.mli new file mode 100644 index 000000000000..734ca29f9bcf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/misc.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** {2 Helper functions} *) + +module Public_key_map : Map.S with type key = Signature.Public_key.t + +type 'a lazyt = unit -> 'a + +type 'a lazy_list_t = LCons of 'a * 'a lazy_list_t tzresult Lwt.t lazyt + +type 'a lazy_list = 'a lazy_list_t tzresult Lwt.t + +(** Include bounds *) +val ( --> ) : int -> int -> int list + +val ( <-- ) : int -> int -> int list + +val ( ---> ) : Int32.t -> Int32.t -> Int32.t list + +val pp_print_paragraph : Format.formatter -> string -> unit + +val take : int -> 'a list -> ('a list * 'a list) option + +(** Some (input with [prefix] removed), if string has [prefix], else [None] *) +val remove_prefix : prefix:string -> string -> string option + +(** [remove nb list] remove the first [nb] elements from the list [list]. *) +val remove_elem_from_list : int -> 'a list -> 'a list diff --git a/src/proto_016_PtMumbai/lib_protocol/non_empty_string.ml b/src/proto_016_PtMumbai/lib_protocol/non_empty_string.ml new file mode 100644 index 000000000000..410c86171248 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/non_empty_string.ml @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Compare.String + +let of_string = function "" -> None | s -> Some s + +let of_string_exn = function + | "" -> invalid_arg "Unexpected empty string" + | s -> s + +let cat2 a ?(sep = "") b = String.concat sep [a; b] diff --git a/src/proto_016_PtMumbai/lib_protocol/non_empty_string.mli b/src/proto_016_PtMumbai/lib_protocol/non_empty_string.mli new file mode 100644 index 000000000000..5807a2dcbb1a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/non_empty_string.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A string that is guaranteed to be non-empty *) +type t = private string + +include Compare.S with type t := t + +(** Returns [None] if the original string is empty. *) +val of_string : string -> t option + +(** Fails with [Invalid_argument] if the original string is empty. *) +val of_string_exn : string -> t + +(** [cat2 a b] concatenates [a] and [b]. + [cat2 a ~sep b] concatenates [a], [sep], and [b]. *) +val cat2 : t -> ?sep:string -> t -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/nonce_hash.ml b/src/proto_016_PtMumbai/lib_protocol/nonce_hash.ml new file mode 100644 index 000000000000..10a3f7efe42b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/nonce_hash.ml @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* 32 *) +let nonce_hash = "\069\220\169" (* nce(53) *) + +module H = + Blake2B.Make + (Base58) + (struct + let name = "cycle_nonce" + + let title = "A nonce hash" + + let b58check_prefix = nonce_hash + + let size = None + end) + +include H +include Path_encoding.Make_hex (H) + +let () = Base58.check_encoded_prefix b58check_encoding "nce" 53 diff --git a/src/proto_016_PtMumbai/lib_protocol/nonce_hash.mli b/src/proto_016_PtMumbai/lib_protocol/nonce_hash.mli new file mode 100644 index 000000000000..aeeef12905bd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/nonce_hash.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing nonces. *) + +include S.HASH + +include Path_encoding.S with type t := t diff --git a/src/proto_016_PtMumbai/lib_protocol/nonce_storage.ml b/src/proto_016_PtMumbai/lib_protocol/nonce_storage.ml new file mode 100644 index 000000000000..feb0b2edebf6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/nonce_storage.ml @@ -0,0 +1,139 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Seed_repr.nonce + +type nonce = t + +let encoding = Seed_repr.nonce_encoding + +type error += + | Too_late_revelation + | Too_early_revelation + | Already_revealed_nonce + | Inconsistent_nonce + +let () = + register_error_kind + `Branch + ~id:"nonce.too_late_revelation" + ~title:"Too late nonce revelation" + ~description:"Nonce revelation happens too late" + ~pp:(fun ppf () -> + Format.fprintf ppf "This nonce cannot be revealed anymore.") + Data_encoding.unit + (function Too_late_revelation -> Some () | _ -> None) + (fun () -> Too_late_revelation) ; + register_error_kind + `Temporary + ~id:"nonce.too_early_revelation" + ~title:"Too early nonce revelation" + ~description:"Nonce revelation happens before cycle end" + ~pp:(fun ppf () -> + Format.fprintf ppf "This nonce should not yet be revealed") + Data_encoding.unit + (function Too_early_revelation -> Some () | _ -> None) + (fun () -> Too_early_revelation) ; + register_error_kind + `Branch + ~id:"nonce.already_revealed" + ~title:"Already revealed nonce" + ~description:"Duplicated revelation for a nonce." + ~pp:(fun ppf () -> Format.fprintf ppf "This nonce was already revealed") + Data_encoding.unit + (function Already_revealed_nonce -> Some () | _ -> None) + (fun () -> Already_revealed_nonce) ; + register_error_kind + `Branch + ~id:"nonce.inconsistent" + ~title:"Inconsistent nonce" + ~description: + "The provided nonce is inconsistent with the committed nonce hash." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "This nonce revelation is invalid (inconsistent with the committed \ + hash)") + Data_encoding.unit + (function Inconsistent_nonce -> Some () | _ -> None) + (fun () -> Inconsistent_nonce) + +(* Checks that the level of a revelation is not too early or too late wrt to the + current context and that a nonce has not been already revealed for that level. + Also checks that we are not past the nonce revelation period. *) +let get_unrevealed ctxt (level : Level_repr.t) = + let current_level = Level_storage.current ctxt in + match Cycle_repr.pred current_level.cycle with + | None -> tzfail Too_early_revelation (* no revelations during cycle 0 *) + | Some revealed_cycle -> ( + if Cycle_repr.(revealed_cycle < level.Level_repr.cycle) then + tzfail Too_early_revelation + else if + Cycle_repr.(level.Level_repr.cycle < revealed_cycle) + || Compare.Int32.( + current_level.cycle_position + >= Constants_storage.nonce_revelation_threshold ctxt) + then tzfail Too_late_revelation + else + Storage.Seed.Nonce.get ctxt level >>=? function + | Revealed _ -> tzfail Already_revealed_nonce + | Unrevealed status -> return status) + +let record_hash ctxt unrevealed = + let level = Level_storage.current ctxt in + Storage.Seed.Nonce.init ctxt level (Unrevealed unrevealed) + +let check_unrevealed ctxt (level : Level_repr.t) nonce = + get_unrevealed ctxt level >>=? fun unrevealed -> + fail_unless + (Seed_repr.check_hash nonce unrevealed.nonce_hash) + Inconsistent_nonce + +let reveal ctxt level nonce = + Storage.Seed.Nonce.update ctxt level (Revealed nonce) + +type unrevealed = Storage.Seed.unrevealed_nonce = { + nonce_hash : Nonce_hash.t; + delegate : Signature.Public_key_hash.t; +} + +type status = Storage.Seed.nonce_status = + | Unrevealed of unrevealed + | Revealed of Seed_repr.nonce + +let get = Storage.Seed.Nonce.get + +type nonce_presence = No_nonce_expected | Nonce_expected of status + +let check ctxt level = + Storage.Seed.Nonce.find ctxt level >>=? function + | None -> return No_nonce_expected + | Some status -> return (Nonce_expected status) + +let of_bytes = Seed_repr.make_nonce + +let hash = Seed_repr.hash + +let check_hash = Seed_repr.check_hash diff --git a/src/proto_016_PtMumbai/lib_protocol/nonce_storage.mli b/src/proto_016_PtMumbai/lib_protocol/nonce_storage.mli new file mode 100644 index 000000000000..181682a41db9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/nonce_storage.mli @@ -0,0 +1,87 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides types and functions to manipulate nonces. + + A nonce is a byte sequence of fixed length, which is supposed to be random + and used only once, provided by a block producer and used to generate a + random seed (see {!module:Seed_repr}). *) + +type t = Seed_repr.nonce + +type nonce = t + +type error += + | Too_late_revelation + | Too_early_revelation + | Already_revealed_nonce + | Inconsistent_nonce + +val encoding : nonce Data_encoding.t + +type unrevealed = Storage.Seed.unrevealed_nonce = { + nonce_hash : Nonce_hash.t; + delegate : Signature.Public_key_hash.t; +} + +type status = Unrevealed of unrevealed | Revealed of Seed_repr.nonce + +val get : Raw_context.t -> Level_repr.t -> status tzresult Lwt.t + +type nonce_presence = No_nonce_expected | Nonce_expected of status + +val check : Raw_context.t -> Level_repr.t -> nonce_presence tzresult Lwt.t + +val record_hash : Raw_context.t -> unrevealed -> Raw_context.t tzresult Lwt.t + +(** Checks that a nonce revelation operation can be safely applied. + + @return [Error Too_early_revelation] if the current cycle is the + cycle 0 or if the previous cycle is lesser than the cycle of the + input level. + + @return [Error Too_late_revelation] if the previous cycle is + greater than the cycle of the input level. This error is also + returned if the current level cycle position is greater or equal to + the nonce revelation threshold. + + @return [Error Already_revealed_nonce] if a nonce is already + revealed in the context for the input level. + + @return [Error Inconsistent_nonce] if the hash of the input nonce + does not correspond to the nonce recover from the context for the + given level. *) +val check_unrevealed : + Raw_context.t -> Level_repr.t -> nonce -> unit tzresult Lwt.t + +val reveal : + Raw_context.t -> Level_repr.t -> nonce -> Raw_context.t tzresult Lwt.t + +val of_bytes : bytes -> nonce tzresult + +val hash : nonce -> Nonce_hash.t + +val check_hash : nonce -> Nonce_hash.t -> bool diff --git a/src/proto_016_PtMumbai/lib_protocol/operation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/operation_repr.ml new file mode 100644 index 000000000000..3c3070bb3fcf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/operation_repr.ml @@ -0,0 +1,2874 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Tezos Protocol Implementation - Low level Repr. of Operations *) + +module Kind = struct + type preendorsement_consensus_kind = Preendorsement_consensus_kind + + type endorsement_consensus_kind = Endorsement_consensus_kind + + type 'a consensus = + | Preendorsement_kind : preendorsement_consensus_kind consensus + | Endorsement_kind : endorsement_consensus_kind consensus + + type preendorsement = preendorsement_consensus_kind consensus + + type endorsement = endorsement_consensus_kind consensus + + type dal_attestation = Dal_attestation_kind + + type seed_nonce_revelation = Seed_nonce_revelation_kind + + type vdf_revelation = Vdf_revelation_kind + + type 'a double_consensus_operation_evidence = + | Double_consensus_operation_evidence + + type double_endorsement_evidence = + endorsement_consensus_kind double_consensus_operation_evidence + + type double_preendorsement_evidence = + preendorsement_consensus_kind double_consensus_operation_evidence + + type double_baking_evidence = Double_baking_evidence_kind + + type activate_account = Activate_account_kind + + type proposals = Proposals_kind + + type ballot = Ballot_kind + + type reveal = Reveal_kind + + type transaction = Transaction_kind + + type origination = Origination_kind + + type delegation = Delegation_kind + + type event = Event_kind + + type set_deposits_limit = Set_deposits_limit_kind + + type increase_paid_storage = Increase_paid_storage_kind + + type update_consensus_key = Update_consensus_key_kind + + type drain_delegate = Drain_delegate_kind + + type failing_noop = Failing_noop_kind + + type register_global_constant = Register_global_constant_kind + + type tx_rollup_origination = Tx_rollup_origination_kind + + type tx_rollup_submit_batch = Tx_rollup_submit_batch_kind + + type tx_rollup_commit = Tx_rollup_commit_kind + + type tx_rollup_return_bond = Tx_rollup_return_bond_kind + + type tx_rollup_finalize_commitment = Tx_rollup_finalize_commitment_kind + + type tx_rollup_remove_commitment = Tx_rollup_remove_commitment_kind + + type tx_rollup_rejection = Tx_rollup_rejection_kind + + type tx_rollup_dispatch_tickets = Tx_rollup_dispatch_tickets_kind + + type transfer_ticket = Transfer_ticket_kind + + type dal_publish_slot_header = Dal_publish_slot_header_kind + + type sc_rollup_originate = Sc_rollup_originate_kind + + type sc_rollup_add_messages = Sc_rollup_add_messages_kind + + type sc_rollup_cement = Sc_rollup_cement_kind + + type sc_rollup_publish = Sc_rollup_publish_kind + + type sc_rollup_refute = Sc_rollup_refute_kind + + type sc_rollup_timeout = Sc_rollup_timeout_kind + + type sc_rollup_execute_outbox_message = + | Sc_rollup_execute_outbox_message_kind + + type sc_rollup_recover_bond = Sc_rollup_recover_bond_kind + + type zk_rollup_origination = Zk_rollup_origination_kind + + type zk_rollup_publish = Zk_rollup_publish_kind + + type zk_rollup_update = Zk_rollup_update_kind + + type 'a manager = + | Reveal_manager_kind : reveal manager + | Transaction_manager_kind : transaction manager + | Origination_manager_kind : origination manager + | Delegation_manager_kind : delegation manager + | Event_manager_kind : event manager + | Register_global_constant_manager_kind : register_global_constant manager + | Set_deposits_limit_manager_kind : set_deposits_limit manager + | Increase_paid_storage_manager_kind : increase_paid_storage manager + | Update_consensus_key_manager_kind : update_consensus_key manager + | Tx_rollup_origination_manager_kind : tx_rollup_origination manager + | Tx_rollup_submit_batch_manager_kind : tx_rollup_submit_batch manager + | Tx_rollup_commit_manager_kind : tx_rollup_commit manager + | Tx_rollup_return_bond_manager_kind : tx_rollup_return_bond manager + | Tx_rollup_finalize_commitment_manager_kind + : tx_rollup_finalize_commitment manager + | Tx_rollup_remove_commitment_manager_kind + : tx_rollup_remove_commitment manager + | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_dispatch_tickets_manager_kind + : tx_rollup_dispatch_tickets manager + | Transfer_ticket_manager_kind : transfer_ticket manager + | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Sc_rollup_originate_manager_kind : sc_rollup_originate manager + | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager + | Sc_rollup_cement_manager_kind : sc_rollup_cement manager + | Sc_rollup_publish_manager_kind : sc_rollup_publish manager + | Sc_rollup_refute_manager_kind : sc_rollup_refute manager + | Sc_rollup_timeout_manager_kind : sc_rollup_timeout manager + | Sc_rollup_execute_outbox_message_manager_kind + : sc_rollup_execute_outbox_message manager + | Sc_rollup_recover_bond_manager_kind : sc_rollup_recover_bond manager + | Zk_rollup_origination_manager_kind : zk_rollup_origination manager + | Zk_rollup_publish_manager_kind : zk_rollup_publish manager + | Zk_rollup_update_manager_kind : zk_rollup_update manager +end + +type 'a consensus_operation_type = + | Endorsement : Kind.endorsement consensus_operation_type + | Preendorsement : Kind.preendorsement consensus_operation_type + +let pp_operation_kind (type kind) ppf + (operation_kind : kind consensus_operation_type) = + match operation_kind with + | Endorsement -> Format.fprintf ppf "Endorsement" + | Preendorsement -> Format.fprintf ppf "Preendorsement" + +type consensus_content = { + slot : Slot_repr.t; + level : Raw_level_repr.t; + (* The level is not required to validate an endorsement when it corresponds + to the current payload, but if we want to filter endorsements, we need + the level. *) + round : Round_repr.t; + block_payload_hash : Block_payload_hash.t; + (* NOTE: This could be just the hash of the set of operations (the + actual payload). The grandfather block hash should already be + fixed by the operation.shell.branch field. This is not really + important but could make things easier for debugging *) +} + +let consensus_content_encoding = + let open Data_encoding in + conv + (fun {slot; level; round; block_payload_hash} -> + (slot, level, round, block_payload_hash)) + (fun (slot, level, round, block_payload_hash) -> + {slot; level; round; block_payload_hash}) + (obj4 + (req "slot" Slot_repr.encoding) + (req "level" Raw_level_repr.encoding) + (req "round" Round_repr.encoding) + (req "block_payload_hash" Block_payload_hash.encoding)) + +let pp_consensus_content ppf content = + Format.fprintf + ppf + "(%ld, %a, %a, %a)" + (Raw_level_repr.to_int32 content.level) + Round_repr.pp + content.round + Slot_repr.pp + content.slot + Block_payload_hash.pp_short + content.block_payload_hash + +type consensus_watermark = + | Endorsement of Chain_id.t + | Preendorsement of Chain_id.t + | Dal_attestation of Chain_id.t + +let bytes_of_consensus_watermark = function + | Preendorsement chain_id -> + Bytes.cat (Bytes.of_string "\x12") (Chain_id.to_bytes chain_id) + | Dal_attestation chain_id + (* We reuse the watermark of an endorsement. This is because this + operation is temporary and aims to be merged with an endorsement + later on. Moreover, there is a leak of abstraction with the shell + which makes adding a new watermark a bit awkward. *) + | Endorsement chain_id -> + Bytes.cat (Bytes.of_string "\x13") (Chain_id.to_bytes chain_id) + +let to_watermark w = Signature.Custom (bytes_of_consensus_watermark w) + +let of_watermark = function + | Signature.Custom b -> + if Compare.Int.(Bytes.length b > 0) then + match Bytes.get b 0 with + | '\x12' -> + Option.map + (fun chain_id -> Endorsement chain_id) + (Chain_id.of_bytes_opt (Bytes.sub b 1 (Bytes.length b - 1))) + | '\x13' -> + Option.map + (fun chain_id -> Preendorsement chain_id) + (Chain_id.of_bytes_opt (Bytes.sub b 1 (Bytes.length b - 1))) + | '\x14' -> + Option.map + (fun chain_id -> Dal_attestation chain_id) + (Chain_id.of_bytes_opt (Bytes.sub b 1 (Bytes.length b - 1))) + | _ -> None + else None + | _ -> None + +type raw = Operation.t = {shell : Operation.shell_header; proto : bytes} + +let raw_encoding = Operation.encoding + +type 'kind operation = { + shell : Operation.shell_header; + protocol_data : 'kind protocol_data; +} + +and 'kind protocol_data = { + contents : 'kind contents_list; + signature : Signature.t option; +} + +and _ contents_list = + | Single : 'kind contents -> 'kind contents_list + | Cons : + 'kind Kind.manager contents * 'rest Kind.manager contents_list + -> ('kind * 'rest) Kind.manager contents_list + +and _ contents = + | Preendorsement : consensus_content -> Kind.preendorsement contents + | Endorsement : consensus_content -> Kind.endorsement contents + | Dal_attestation : + Dal_attestation_repr.operation + -> Kind.dal_attestation contents + | Seed_nonce_revelation : { + level : Raw_level_repr.t; + nonce : Seed_repr.nonce; + } + -> Kind.seed_nonce_revelation contents + | Vdf_revelation : { + solution : Seed_repr.vdf_solution; + } + -> Kind.vdf_revelation contents + | Double_preendorsement_evidence : { + op1 : Kind.preendorsement operation; + op2 : Kind.preendorsement operation; + } + -> Kind.double_preendorsement_evidence contents + | Double_endorsement_evidence : { + op1 : Kind.endorsement operation; + op2 : Kind.endorsement operation; + } + -> Kind.double_endorsement_evidence contents + | Double_baking_evidence : { + bh1 : Block_header_repr.t; + bh2 : Block_header_repr.t; + } + -> Kind.double_baking_evidence contents + | Activate_account : { + id : Ed25519.Public_key_hash.t; + activation_code : Blinded_public_key_hash.activation_code; + } + -> Kind.activate_account contents + | Proposals : { + source : Signature.Public_key_hash.t; + period : int32; + proposals : Protocol_hash.t list; + } + -> Kind.proposals contents + | Ballot : { + source : Signature.Public_key_hash.t; + period : int32; + proposal : Protocol_hash.t; + ballot : Vote_repr.ballot; + } + -> Kind.ballot contents + | Drain_delegate : { + consensus_key : Signature.Public_key_hash.t; + delegate : Signature.Public_key_hash.t; + destination : Signature.Public_key_hash.t; + } + -> Kind.drain_delegate contents + | Failing_noop : string -> Kind.failing_noop contents + | Manager_operation : { + source : Signature.public_key_hash; + fee : Tez_repr.tez; + counter : Manager_counter_repr.t; + operation : 'kind manager_operation; + gas_limit : Gas_limit_repr.Arith.integral; + storage_limit : Z.t; + } + -> 'kind Kind.manager contents + +and _ manager_operation = + | Reveal : Signature.Public_key.t -> Kind.reveal manager_operation + | Transaction : { + amount : Tez_repr.tez; + parameters : Script_repr.lazy_expr; + entrypoint : Entrypoint_repr.t; + destination : Contract_repr.t; + } + -> Kind.transaction manager_operation + | Origination : { + delegate : Signature.Public_key_hash.t option; + script : Script_repr.t; + credit : Tez_repr.tez; + } + -> Kind.origination manager_operation + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation manager_operation + | Register_global_constant : { + value : Script_repr.lazy_expr; + } + -> Kind.register_global_constant manager_operation + | Set_deposits_limit : + Tez_repr.t option + -> Kind.set_deposits_limit manager_operation + | Increase_paid_storage : { + amount_in_bytes : Z.t; + destination : Contract_hash.t; + } + -> Kind.increase_paid_storage manager_operation + | Update_consensus_key : + Signature.Public_key.t + -> Kind.update_consensus_key manager_operation + | Tx_rollup_origination : Kind.tx_rollup_origination manager_operation + | Tx_rollup_submit_batch : { + tx_rollup : Tx_rollup_repr.t; + content : string; + burn_limit : Tez_repr.t option; + } + -> Kind.tx_rollup_submit_batch manager_operation + | Tx_rollup_commit : { + tx_rollup : Tx_rollup_repr.t; + commitment : Tx_rollup_commitment_repr.Full.t; + } + -> Kind.tx_rollup_commit manager_operation + | Tx_rollup_return_bond : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_return_bond manager_operation + | Tx_rollup_finalize_commitment : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_finalize_commitment manager_operation + | Tx_rollup_remove_commitment : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_remove_commitment manager_operation + | Tx_rollup_rejection : { + tx_rollup : Tx_rollup_repr.t; + level : Tx_rollup_level_repr.t; + message : Tx_rollup_message_repr.t; + message_position : int; + message_path : Tx_rollup_inbox_repr.Merkle.path; + message_result_hash : Tx_rollup_message_result_hash_repr.t; + message_result_path : Tx_rollup_commitment_repr.Merkle.path; + previous_message_result : Tx_rollup_message_result_repr.t; + previous_message_result_path : Tx_rollup_commitment_repr.Merkle.path; + proof : Tx_rollup_l2_proof.serialized; + } + -> Kind.tx_rollup_rejection manager_operation + | Tx_rollup_dispatch_tickets : { + tx_rollup : Tx_rollup_repr.t; + level : Tx_rollup_level_repr.t; + context_hash : Context_hash.t; + message_index : int; + message_result_path : Tx_rollup_commitment_repr.Merkle.path; + tickets_info : Tx_rollup_reveal_repr.t list; + } + -> Kind.tx_rollup_dispatch_tickets manager_operation + | Transfer_ticket : { + contents : Script_repr.lazy_expr; + ty : Script_repr.lazy_expr; + ticketer : Contract_repr.t; + amount : Ticket_amount.t; + destination : Contract_repr.t; + entrypoint : Entrypoint_repr.t; + } + -> Kind.transfer_ticket manager_operation + | Dal_publish_slot_header : + Dal_slot_repr.Header.operation + -> Kind.dal_publish_slot_header manager_operation + | Sc_rollup_originate : { + kind : Sc_rollups.Kind.t; + boot_sector : string; + origination_proof : Sc_rollup_proof_repr.serialized; + parameters_ty : Script_repr.lazy_expr; + } + -> Kind.sc_rollup_originate manager_operation + | Sc_rollup_add_messages : { + messages : string list; + } + -> Kind.sc_rollup_add_messages manager_operation + | Sc_rollup_cement : { + rollup : Sc_rollup_repr.t; + commitment : Sc_rollup_commitment_repr.Hash.t; + } + -> Kind.sc_rollup_cement manager_operation + | Sc_rollup_publish : { + rollup : Sc_rollup_repr.t; + commitment : Sc_rollup_commitment_repr.t; + } + -> Kind.sc_rollup_publish manager_operation + | Sc_rollup_refute : { + rollup : Sc_rollup_repr.t; + opponent : Sc_rollup_repr.Staker.t; + refutation : Sc_rollup_game_repr.refutation option; + } + -> Kind.sc_rollup_refute manager_operation + | Sc_rollup_timeout : { + rollup : Sc_rollup_repr.t; + stakers : Sc_rollup_game_repr.Index.t; + } + -> Kind.sc_rollup_timeout manager_operation + | Sc_rollup_execute_outbox_message : { + rollup : Sc_rollup_repr.t; + cemented_commitment : Sc_rollup_commitment_repr.Hash.t; + output_proof : string; + } + -> Kind.sc_rollup_execute_outbox_message manager_operation + | Sc_rollup_recover_bond : { + sc_rollup : Sc_rollup_repr.t; + staker : Signature.public_key_hash; + } + -> Kind.sc_rollup_recover_bond manager_operation + | Zk_rollup_origination : { + public_parameters : Plonk.public_parameters; + circuits_info : [`Public | `Private | `Fee] Zk_rollup_account_repr.SMap.t; + init_state : Zk_rollup_state_repr.t; + nb_ops : int; + } + -> Kind.zk_rollup_origination manager_operation + | Zk_rollup_publish : { + zk_rollup : Zk_rollup_repr.t; + ops : (Zk_rollup_operation_repr.t * Zk_rollup_ticket_repr.t option) list; + } + -> Kind.zk_rollup_publish manager_operation + | Zk_rollup_update : { + zk_rollup : Zk_rollup_repr.t; + update : Zk_rollup_update_repr.t; + } + -> Kind.zk_rollup_update manager_operation + +let manager_kind : type kind. kind manager_operation -> kind Kind.manager = + function + | Reveal _ -> Kind.Reveal_manager_kind + | Transaction _ -> Kind.Transaction_manager_kind + | Origination _ -> Kind.Origination_manager_kind + | Delegation _ -> Kind.Delegation_manager_kind + | Register_global_constant _ -> Kind.Register_global_constant_manager_kind + | Set_deposits_limit _ -> Kind.Set_deposits_limit_manager_kind + | Increase_paid_storage _ -> Kind.Increase_paid_storage_manager_kind + | Update_consensus_key _ -> Kind.Update_consensus_key_manager_kind + | Tx_rollup_origination -> Kind.Tx_rollup_origination_manager_kind + | Tx_rollup_submit_batch _ -> Kind.Tx_rollup_submit_batch_manager_kind + | Tx_rollup_commit _ -> Kind.Tx_rollup_commit_manager_kind + | Tx_rollup_return_bond _ -> Kind.Tx_rollup_return_bond_manager_kind + | Tx_rollup_finalize_commitment _ -> + Kind.Tx_rollup_finalize_commitment_manager_kind + | Tx_rollup_remove_commitment _ -> + Kind.Tx_rollup_remove_commitment_manager_kind + | Tx_rollup_rejection _ -> Kind.Tx_rollup_rejection_manager_kind + | Tx_rollup_dispatch_tickets _ -> Kind.Tx_rollup_dispatch_tickets_manager_kind + | Transfer_ticket _ -> Kind.Transfer_ticket_manager_kind + | Dal_publish_slot_header _ -> Kind.Dal_publish_slot_header_manager_kind + | Sc_rollup_originate _ -> Kind.Sc_rollup_originate_manager_kind + | Sc_rollup_add_messages _ -> Kind.Sc_rollup_add_messages_manager_kind + | Sc_rollup_cement _ -> Kind.Sc_rollup_cement_manager_kind + | Sc_rollup_publish _ -> Kind.Sc_rollup_publish_manager_kind + | Sc_rollup_refute _ -> Kind.Sc_rollup_refute_manager_kind + | Sc_rollup_timeout _ -> Kind.Sc_rollup_timeout_manager_kind + | Sc_rollup_execute_outbox_message _ -> + Kind.Sc_rollup_execute_outbox_message_manager_kind + | Sc_rollup_recover_bond _ -> Kind.Sc_rollup_recover_bond_manager_kind + | Zk_rollup_origination _ -> Kind.Zk_rollup_origination_manager_kind + | Zk_rollup_publish _ -> Kind.Zk_rollup_publish_manager_kind + | Zk_rollup_update _ -> Kind.Zk_rollup_update_manager_kind + +type packed_manager_operation = + | Manager : 'kind manager_operation -> packed_manager_operation + +type packed_contents = Contents : 'kind contents -> packed_contents + +type packed_contents_list = + | Contents_list : 'kind contents_list -> packed_contents_list + +type packed_protocol_data = + | Operation_data : 'kind protocol_data -> packed_protocol_data + +type packed_operation = { + shell : Operation.shell_header; + protocol_data : packed_protocol_data; +} + +let pack ({shell; protocol_data} : _ operation) : packed_operation = + {shell; protocol_data = Operation_data protocol_data} + +let rec contents_list_to_list : type a. a contents_list -> _ = function + | Single o -> [Contents o] + | Cons (o, os) -> Contents o :: contents_list_to_list os + +let to_list = function Contents_list l -> contents_list_to_list l + +(* This first version of of_list has the type (_, string) result expected by + the conv_with_guard combinator of Data_encoding. For a more conventional + return type see [of_list] below. *) +let of_list_internal contents = + let rec of_list_internal acc = function + | [] -> Ok acc + | Contents o :: os -> ( + match (o, acc) with + | ( Manager_operation _, + Contents_list (Single (Manager_operation _) as rest) ) -> + (of_list_internal [@tailcall]) (Contents_list (Cons (o, rest))) os + | Manager_operation _, Contents_list (Cons _ as rest) -> + (of_list_internal [@tailcall]) (Contents_list (Cons (o, rest))) os + | _ -> + Error + "Operation list of length > 1 should only contain manager \ + operations.") + in + match List.rev contents with + | [] -> Error "Operation lists should not be empty." + | Contents o :: os -> of_list_internal (Contents_list (Single o)) os + +type error += Contents_list_error of string (* `Permanent *) + +let of_list l = + match of_list_internal l with + | Ok contents -> Ok contents + | Error s -> error @@ Contents_list_error s + +let tx_rollup_operation_tag_offset = 150 + +let tx_rollup_operation_origination_tag = tx_rollup_operation_tag_offset + 0 + +let tx_rollup_operation_submit_batch_tag = tx_rollup_operation_tag_offset + 1 + +let tx_rollup_operation_commit_tag = tx_rollup_operation_tag_offset + 2 + +let tx_rollup_operation_return_bond_tag = tx_rollup_operation_tag_offset + 3 + +let tx_rollup_operation_finalize_commitment_tag = + tx_rollup_operation_tag_offset + 4 + +let tx_rollup_operation_remove_commitment_tag = + tx_rollup_operation_tag_offset + 5 + +let tx_rollup_operation_rejection_tag = tx_rollup_operation_tag_offset + 6 + +let tx_rollup_operation_dispatch_tickets_tag = + tx_rollup_operation_tag_offset + 7 + +let transfer_ticket_tag = tx_rollup_operation_tag_offset + 8 + +let sc_rollup_operation_tag_offset = 200 + +let sc_rollup_operation_origination_tag = sc_rollup_operation_tag_offset + 0 + +let sc_rollup_operation_add_message_tag = sc_rollup_operation_tag_offset + 1 + +let sc_rollup_operation_cement_tag = sc_rollup_operation_tag_offset + 2 + +let sc_rollup_operation_publish_tag = sc_rollup_operation_tag_offset + 3 + +let sc_rollup_operation_refute_tag = sc_rollup_operation_tag_offset + 4 + +let sc_rollup_operation_timeout_tag = sc_rollup_operation_tag_offset + 5 + +let sc_rollup_execute_outbox_message_tag = sc_rollup_operation_tag_offset + 6 + +let sc_rollup_operation_recover_bond_tag = sc_rollup_operation_tag_offset + 7 + +let dal_offset = 230 + +let dal_publish_slot_header_tag = dal_offset + 0 + +let zk_rollup_operation_tag_offset = 250 + +let zk_rollup_operation_create_tag = zk_rollup_operation_tag_offset + 0 + +let zk_rollup_operation_publish_tag = zk_rollup_operation_tag_offset + 1 + +let zk_rollup_operation_update_tag = zk_rollup_operation_tag_offset + 2 + +module Encoding = struct + open Data_encoding + + (** These tags are reserved for future extensions: [fd] - [ff]. *) + let reserved_tag t = Compare.Int.(t >= 0xfd) + + let signature_prefix_tag = 0xff + + let () = assert (reserved_tag signature_prefix_tag) + + let case tag name args proj inj = + case + tag + ~title:(String.capitalize_ascii name) + (merge_objs (obj1 (req "kind" (constant name))) args) + (fun x -> match proj x with None -> None | Some x -> Some ((), x)) + (fun ((), x) -> inj x) + + module Manager_operations = struct + type 'kind case = + | MCase : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_manager_operation -> 'kind manager_operation option; + proj : 'kind manager_operation -> 'a; + inj : 'a -> 'kind manager_operation; + } + -> 'kind case + + let reveal_case = + MCase + { + tag = 0; + name = "reveal"; + encoding = obj1 (req "public_key" Signature.Public_key.encoding); + select = (function Manager (Reveal _ as op) -> Some op | _ -> None); + proj = (function Reveal pkh -> pkh); + inj = (fun pkh -> Reveal pkh); + } + + let transaction_case = + MCase + { + tag = 1; + name = "transaction"; + encoding = + obj3 + (req "amount" Tez_repr.encoding) + (req "destination" Contract_repr.encoding) + (opt + "parameters" + (obj2 + (req "entrypoint" Entrypoint_repr.smart_encoding) + (req "value" Script_repr.lazy_expr_encoding))); + select = + (function Manager (Transaction _ as op) -> Some op | _ -> None); + proj = + (function + | Transaction {amount; destination; parameters; entrypoint} -> + let parameters = + if + Script_repr.is_unit_parameter parameters + && Entrypoint_repr.is_default entrypoint + then None + else Some (entrypoint, parameters) + in + (amount, destination, parameters)); + inj = + (fun (amount, destination, parameters) -> + let entrypoint, parameters = + match parameters with + | None -> (Entrypoint_repr.default, Script_repr.unit_parameter) + | Some (entrypoint, value) -> (entrypoint, value) + in + Transaction {amount; destination; parameters; entrypoint}); + } + + let origination_case = + MCase + { + tag = 2; + name = "origination"; + encoding = + obj3 + (req "balance" Tez_repr.encoding) + (opt "delegate" Signature.Public_key_hash.encoding) + (req "script" Script_repr.encoding); + select = + (function Manager (Origination _ as op) -> Some op | _ -> None); + proj = + (function + | Origination {credit; delegate; script} -> + (credit, delegate, script)); + inj = + (fun (credit, delegate, script) -> + Origination {credit; delegate; script}); + } + + let delegation_case = + MCase + { + tag = 3; + name = "delegation"; + encoding = obj1 (opt "delegate" Signature.Public_key_hash.encoding); + select = + (function Manager (Delegation _ as op) -> Some op | _ -> None); + proj = (function Delegation key -> key); + inj = (fun key -> Delegation key); + } + + let register_global_constant_case = + MCase + { + tag = 4; + name = "register_global_constant"; + encoding = obj1 (req "value" Script_repr.lazy_expr_encoding); + select = + (function + | Manager (Register_global_constant _ as op) -> Some op | _ -> None); + proj = (function Register_global_constant {value} -> value); + inj = (fun value -> Register_global_constant {value}); + } + + let set_deposits_limit_case = + MCase + { + tag = 5; + name = "set_deposits_limit"; + encoding = obj1 (opt "limit" Tez_repr.encoding); + select = + (function + | Manager (Set_deposits_limit _ as op) -> Some op | _ -> None); + proj = (function Set_deposits_limit key -> key); + inj = (fun key -> Set_deposits_limit key); + } + + let increase_paid_storage_case = + MCase + { + tag = 9; + name = "increase_paid_storage"; + encoding = + obj2 + (req "amount" Data_encoding.z) + (req "destination" Contract_repr.originated_encoding); + select = + (function + | Manager (Increase_paid_storage _ as op) -> Some op | _ -> None); + proj = + (function + | Increase_paid_storage {amount_in_bytes; destination} -> + (amount_in_bytes, destination)); + inj = + (fun (amount_in_bytes, destination) -> + Increase_paid_storage {amount_in_bytes; destination}); + } + + let update_consensus_key_tag = 6 + + let update_consensus_key_case = + MCase + { + tag = update_consensus_key_tag; + name = "update_consensus_key"; + encoding = obj1 (req "pk" Signature.Public_key.encoding); + select = + (function + | Manager (Update_consensus_key _ as op) -> Some op | _ -> None); + proj = (function Update_consensus_key consensus_pk -> consensus_pk); + inj = (fun consensus_pk -> Update_consensus_key consensus_pk); + } + + let tx_rollup_origination_case = + MCase + { + tag = tx_rollup_operation_origination_tag; + name = "tx_rollup_origination"; + encoding = obj1 (req "tx_rollup_origination" Data_encoding.unit); + select = + (function + | Manager (Tx_rollup_origination as op) -> Some op | _ -> None); + proj = (function Tx_rollup_origination -> ()); + inj = (fun () -> Tx_rollup_origination); + } + + let tx_rollup_submit_batch_case = + MCase + { + tag = tx_rollup_operation_submit_batch_tag; + name = "tx_rollup_submit_batch"; + encoding = + obj3 + (req "rollup" Tx_rollup_repr.encoding) + (req "content" (string Hex)) + (opt "burn_limit" Tez_repr.encoding); + select = + (function + | Manager (Tx_rollup_submit_batch _ as op) -> Some op | _ -> None); + proj = + (function + | Tx_rollup_submit_batch {tx_rollup; content; burn_limit} -> + (tx_rollup, content, burn_limit)); + inj = + (fun (tx_rollup, content, burn_limit) -> + Tx_rollup_submit_batch {tx_rollup; content; burn_limit}); + } + + let tx_rollup_commit_case = + MCase + { + tag = tx_rollup_operation_commit_tag; + name = "tx_rollup_commit"; + encoding = + obj2 + (req "rollup" Tx_rollup_repr.encoding) + (req "commitment" Tx_rollup_commitment_repr.Full.encoding); + select = + (function + | Manager (Tx_rollup_commit _ as op) -> Some op | _ -> None); + proj = + (function + | Tx_rollup_commit {tx_rollup; commitment} -> (tx_rollup, commitment)); + inj = + (fun (tx_rollup, commitment) -> + Tx_rollup_commit {tx_rollup; commitment}); + } + + let tx_rollup_return_bond_case = + MCase + { + tag = tx_rollup_operation_return_bond_tag; + name = "tx_rollup_return_bond"; + encoding = obj1 (req "rollup" Tx_rollup_repr.encoding); + select = + (function + | Manager (Tx_rollup_return_bond _ as op) -> Some op | _ -> None); + proj = (function Tx_rollup_return_bond {tx_rollup} -> tx_rollup); + inj = (fun tx_rollup -> Tx_rollup_return_bond {tx_rollup}); + } + + let tx_rollup_finalize_commitment_case = + MCase + { + tag = tx_rollup_operation_finalize_commitment_tag; + name = "tx_rollup_finalize_commitment"; + encoding = obj1 (req "rollup" Tx_rollup_repr.encoding); + select = + (function + | Manager (Tx_rollup_finalize_commitment _ as op) -> Some op + | _ -> None); + proj = + (function Tx_rollup_finalize_commitment {tx_rollup} -> tx_rollup); + inj = (fun tx_rollup -> Tx_rollup_finalize_commitment {tx_rollup}); + } + + let tx_rollup_remove_commitment_case = + MCase + { + tag = tx_rollup_operation_remove_commitment_tag; + name = "tx_rollup_remove_commitment"; + encoding = obj1 (req "rollup" Tx_rollup_repr.encoding); + select = + (function + | Manager (Tx_rollup_remove_commitment _ as op) -> Some op + | _ -> None); + proj = + (function Tx_rollup_remove_commitment {tx_rollup} -> tx_rollup); + inj = (fun tx_rollup -> Tx_rollup_remove_commitment {tx_rollup}); + } + + let tx_rollup_rejection_case = + MCase + { + tag = tx_rollup_operation_rejection_tag; + name = "tx_rollup_rejection"; + encoding = + obj10 + (req "rollup" Tx_rollup_repr.encoding) + (req "level" Tx_rollup_level_repr.encoding) + (req "message" Tx_rollup_message_repr.encoding) + (req "message_position" n) + (req "message_path" Tx_rollup_inbox_repr.Merkle.path_encoding) + (req + "message_result_hash" + Tx_rollup_message_result_hash_repr.encoding) + (req + "message_result_path" + Tx_rollup_commitment_repr.Merkle.path_encoding) + (req + "previous_message_result" + Tx_rollup_message_result_repr.encoding) + (req + "previous_message_result_path" + Tx_rollup_commitment_repr.Merkle.path_encoding) + (req "proof" Tx_rollup_l2_proof.serialized_encoding); + select = + (function + | Manager (Tx_rollup_rejection _ as op) -> Some op | _ -> None); + proj = + (function + | Tx_rollup_rejection + { + tx_rollup; + level; + message; + message_position; + message_path; + message_result_hash; + message_result_path; + previous_message_result; + previous_message_result_path; + proof; + } -> + ( tx_rollup, + level, + message, + Z.of_int message_position, + message_path, + message_result_hash, + message_result_path, + previous_message_result, + previous_message_result_path, + proof )); + inj = + (fun ( tx_rollup, + level, + message, + message_position, + message_path, + message_result_hash, + message_result_path, + previous_message_result, + previous_message_result_path, + proof ) -> + Tx_rollup_rejection + { + tx_rollup; + level; + message; + message_position = Z.to_int message_position; + message_path; + message_result_hash; + message_result_path; + previous_message_result; + previous_message_result_path; + proof; + }); + } + + let tx_rollup_dispatch_tickets_case = + MCase + { + tag = tx_rollup_operation_dispatch_tickets_tag; + name = "tx_rollup_dispatch_tickets"; + encoding = + obj6 + (req "tx_rollup" Tx_rollup_repr.encoding) + (req "level" Tx_rollup_level_repr.encoding) + (req "context_hash" Context_hash.encoding) + (req "message_index" int31) + (req + "message_result_path" + Tx_rollup_commitment_repr.Merkle.path_encoding) + (req + "tickets_info" + (Data_encoding.list Tx_rollup_reveal_repr.encoding)); + select = + (function + | Manager (Tx_rollup_dispatch_tickets _ as op) -> Some op + | _ -> None); + proj = + (function + | Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + message_result_path; + tickets_info; + } -> + ( tx_rollup, + level, + context_hash, + message_index, + message_result_path, + tickets_info )); + inj = + (fun ( tx_rollup, + level, + context_hash, + message_index, + message_result_path, + tickets_info ) -> + Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + message_result_path; + tickets_info; + }); + } + + let transfer_ticket_case = + MCase + { + tag = transfer_ticket_tag; + name = "transfer_ticket"; + encoding = + obj6 + (req "ticket_contents" Script_repr.lazy_expr_encoding) + (req "ticket_ty" Script_repr.lazy_expr_encoding) + (req "ticket_ticketer" Contract_repr.encoding) + (req "ticket_amount" Ticket_amount.encoding) + (req "destination" Contract_repr.encoding) + (req "entrypoint" Entrypoint_repr.simple_encoding); + select = + (function + | Manager (Transfer_ticket _ as op) -> Some op | _ -> None); + proj = + (function + | Transfer_ticket + {contents; ty; ticketer; amount; destination; entrypoint} -> + (contents, ty, ticketer, amount, destination, entrypoint)); + inj = + (fun (contents, ty, ticketer, amount, destination, entrypoint) -> + Transfer_ticket + {contents; ty; ticketer; amount; destination; entrypoint}); + } + + let zk_rollup_origination_case = + MCase + { + tag = zk_rollup_operation_create_tag; + name = "zk_rollup_origination"; + encoding = + obj4 + (req "public_parameters" Plonk.public_parameters_encoding) + (req + "circuits_info" + Zk_rollup_account_repr.circuits_info_encoding) + (req "init_state" Zk_rollup_state_repr.encoding) + (* TODO https://gitlab.com/tezos/tezos/-/issues/3655 + Encoding of non-negative [nb_ops] for origination *) + (req "nb_ops" int31); + select = + (function + | Manager (Zk_rollup_origination _ as op) -> Some op | _ -> None); + proj = + (function + | Zk_rollup_origination + {public_parameters; circuits_info; init_state; nb_ops} -> + (public_parameters, circuits_info, init_state, nb_ops)); + inj = + (fun (public_parameters, circuits_info, init_state, nb_ops) -> + Zk_rollup_origination + {public_parameters; circuits_info; init_state; nb_ops}); + } + + let zk_rollup_publish_case = + MCase + { + tag = zk_rollup_operation_publish_tag; + name = "zk_rollup_publish"; + encoding = + obj2 + (req "zk_rollup" Zk_rollup_repr.Address.encoding) + (req "op" + @@ Data_encoding.list + (tup2 + Zk_rollup_operation_repr.encoding + (option Zk_rollup_ticket_repr.encoding))); + select = + (function + | Manager (Zk_rollup_publish _ as op) -> Some op | _ -> None); + proj = + (function Zk_rollup_publish {zk_rollup; ops} -> (zk_rollup, ops)); + inj = (fun (zk_rollup, ops) -> Zk_rollup_publish {zk_rollup; ops}); + } + + let zk_rollup_update_case = + MCase + { + tag = zk_rollup_operation_update_tag; + name = "zk_rollup_update"; + encoding = + obj2 + (req "zk_rollup" Zk_rollup_repr.Address.encoding) + (req "update" Zk_rollup_update_repr.encoding); + select = + (function + | Manager (Zk_rollup_update _ as op) -> Some op | _ -> None); + proj = + (function + | Zk_rollup_update {zk_rollup; update} -> (zk_rollup, update)); + inj = + (fun (zk_rollup, update) -> Zk_rollup_update {zk_rollup; update}); + } + + let sc_rollup_originate_case = + MCase + { + tag = sc_rollup_operation_origination_tag; + name = "sc_rollup_originate"; + encoding = + obj4 + (req "pvm_kind" Sc_rollups.Kind.encoding) + (req "kernel" (string Hex)) + (req "origination_proof" Sc_rollup_proof_repr.serialized_encoding) + (req "parameters_ty" Script_repr.lazy_expr_encoding); + select = + (function + | Manager (Sc_rollup_originate _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_originate + {kind; boot_sector; origination_proof; parameters_ty} -> + (kind, boot_sector, origination_proof, parameters_ty)); + inj = + (fun (kind, boot_sector, origination_proof, parameters_ty) -> + Sc_rollup_originate + {kind; boot_sector; origination_proof; parameters_ty}); + } + + let dal_publish_slot_header_case = + MCase + { + tag = dal_publish_slot_header_tag; + name = "dal_publish_slot_header"; + encoding = + obj1 (req "slot_header" Dal_slot_repr.Header.operation_encoding); + select = + (function + | Manager (Dal_publish_slot_header _ as op) -> Some op | _ -> None); + proj = (function Dal_publish_slot_header slot_header -> slot_header); + inj = (fun slot_header -> Dal_publish_slot_header slot_header); + } + + let sc_rollup_add_messages_case = + MCase + { + tag = sc_rollup_operation_add_message_tag; + name = "sc_rollup_add_messages"; + encoding = obj1 (req "message" (list (string Hex))); + select = + (function + | Manager (Sc_rollup_add_messages _ as op) -> Some op | _ -> None); + proj = (function Sc_rollup_add_messages {messages} -> messages); + inj = (fun messages -> Sc_rollup_add_messages {messages}); + } + + let sc_rollup_cement_case = + MCase + { + tag = sc_rollup_operation_cement_tag; + name = "sc_rollup_cement"; + encoding = + obj2 + (req "rollup" Sc_rollup_repr.encoding) + (req "commitment" Sc_rollup_commitment_repr.Hash.encoding); + select = + (function + | Manager (Sc_rollup_cement _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_cement {rollup; commitment} -> (rollup, commitment)); + inj = + (fun (rollup, commitment) -> Sc_rollup_cement {rollup; commitment}); + } + + let sc_rollup_publish_case = + MCase + { + tag = sc_rollup_operation_publish_tag; + name = "sc_rollup_publish"; + encoding = + obj2 + (req "rollup" Sc_rollup_repr.encoding) + (req "commitment" Sc_rollup_commitment_repr.encoding); + select = + (function + | Manager (Sc_rollup_publish _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_publish {rollup; commitment} -> (rollup, commitment)); + inj = + (fun (rollup, commitment) -> Sc_rollup_publish {rollup; commitment}); + } + + let sc_rollup_refute_case = + MCase + { + tag = sc_rollup_operation_refute_tag; + name = "sc_rollup_refute"; + encoding = + obj3 + (req "rollup" Sc_rollup_repr.encoding) + (req "opponent" Sc_rollup_repr.Staker.encoding) + (opt "refutation" Sc_rollup_game_repr.refutation_encoding); + select = + (function + | Manager (Sc_rollup_refute _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_refute {rollup; opponent; refutation} -> + (rollup, opponent, refutation)); + inj = + (fun (rollup, opponent, refutation) -> + Sc_rollup_refute {rollup; opponent; refutation}); + } + + let sc_rollup_timeout_case = + MCase + { + tag = sc_rollup_operation_timeout_tag; + name = "sc_rollup_timeout"; + encoding = + obj2 + (req "rollup" Sc_rollup_repr.encoding) + (req "stakers" Sc_rollup_game_repr.Index.encoding); + select = + (function + | Manager (Sc_rollup_timeout _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_timeout {rollup; stakers} -> (rollup, stakers)); + inj = (fun (rollup, stakers) -> Sc_rollup_timeout {rollup; stakers}); + } + + let sc_rollup_execute_outbox_message_case = + MCase + { + tag = sc_rollup_execute_outbox_message_tag; + name = "sc_rollup_execute_outbox_message"; + encoding = + obj3 + (req "rollup" Sc_rollup_repr.encoding) + (req + "cemented_commitment" + Sc_rollup_commitment_repr.Hash.encoding) + (req "output_proof" (string Hex)); + select = + (function + | Manager (Sc_rollup_execute_outbox_message _ as op) -> Some op + | _ -> None); + proj = + (function + | Sc_rollup_execute_outbox_message + {rollup; cemented_commitment; output_proof} -> + (rollup, cemented_commitment, output_proof)); + inj = + (fun (rollup, cemented_commitment, output_proof) -> + Sc_rollup_execute_outbox_message + {rollup; cemented_commitment; output_proof}); + } + + let sc_rollup_recover_bond_case = + MCase + { + tag = sc_rollup_operation_recover_bond_tag; + name = "sc_rollup_recover_bond"; + encoding = + obj2 + (req "rollup" Sc_rollup_repr.Address.encoding) + (req "staker" Signature.Public_key_hash.encoding); + select = + (function + | Manager (Sc_rollup_recover_bond _ as op) -> Some op | _ -> None); + proj = + (function + | Sc_rollup_recover_bond {sc_rollup; staker} -> (sc_rollup, staker)); + inj = + (fun (sc_rollup, staker) -> + Sc_rollup_recover_bond {sc_rollup; staker}); + } + end + + type 'b case = + | Case : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_contents -> 'b contents option; + proj : 'b contents -> 'a; + inj : 'a -> 'b contents; + } + -> 'b case + + let preendorsement_case = + Case + { + tag = 20; + name = "preendorsement"; + encoding = consensus_content_encoding; + select = + (function Contents (Preendorsement _ as op) -> Some op | _ -> None); + proj = (fun (Preendorsement preendorsement) -> preendorsement); + inj = (fun preendorsement -> Preendorsement preendorsement); + } + + let preendorsement_encoding = + let make (Case {tag; name; encoding; select = _; proj; inj}) = + case (Tag tag) name encoding (fun o -> Some (proj o)) (fun x -> inj x) + in + let to_list : Kind.preendorsement contents_list -> _ = function + | Single o -> o + in + let of_list : Kind.preendorsement contents -> _ = function + | o -> Single o + in + def "inlined.preendorsement" + @@ conv + (fun ({shell; protocol_data = {contents; signature}} : _ operation) -> + (shell, (contents, signature))) + (fun (shell, (contents, signature)) : _ operation -> + {shell; protocol_data = {contents; signature}}) + (merge_objs + Operation.shell_header_encoding + (obj2 + (req + "operations" + (conv to_list of_list + @@ def "inlined.preendorsement.contents" + @@ union [make preendorsement_case])) + (varopt "signature" Signature.encoding))) + + let endorsement_encoding = + obj4 + (req "slot" Slot_repr.encoding) + (req "level" Raw_level_repr.encoding) + (req "round" Round_repr.encoding) + (req "block_payload_hash" Block_payload_hash.encoding) + + let endorsement_case = + Case + { + tag = 21; + name = "endorsement"; + encoding = endorsement_encoding; + select = + (function Contents (Endorsement _ as op) -> Some op | _ -> None); + proj = + (fun (Endorsement consensus_content) -> + ( consensus_content.slot, + consensus_content.level, + consensus_content.round, + consensus_content.block_payload_hash )); + inj = + (fun (slot, level, round, block_payload_hash) -> + Endorsement {slot; level; round; block_payload_hash}); + } + + let endorsement_encoding = + let make (Case {tag; name; encoding; select = _; proj; inj}) = + case (Tag tag) name encoding (fun o -> Some (proj o)) (fun x -> inj x) + in + let to_list : Kind.endorsement contents_list -> _ = fun (Single o) -> o in + let of_list : Kind.endorsement contents -> _ = fun o -> Single o in + def "inlined.endorsement" + @@ conv + (fun ({shell; protocol_data = {contents; signature}} : _ operation) -> + (shell, (contents, signature))) + (fun (shell, (contents, signature)) : _ operation -> + {shell; protocol_data = {contents; signature}}) + (merge_objs + Operation.shell_header_encoding + (obj2 + (req + "operations" + (conv to_list of_list + @@ def "inlined.endorsement_mempool.contents" + @@ union [make endorsement_case])) + (varopt "signature" Signature.encoding))) + + let dal_attestation_encoding = + obj3 + (req "attestor" Signature.Public_key_hash.encoding) + (req "attestation" Dal_attestation_repr.encoding) + (req "level" Raw_level_repr.encoding) + + let dal_attestation_case = + Case + { + tag = 22; + name = "dal_attestation"; + encoding = dal_attestation_encoding; + select = + (function Contents (Dal_attestation _ as op) -> Some op | _ -> None); + proj = + (fun (Dal_attestation + Dal_attestation_repr.{attestor; attestation; level}) -> + (attestor, attestation, level)); + inj = + (fun (attestor, attestation, level) -> + Dal_attestation Dal_attestation_repr.{attestor; attestation; level}); + } + + let seed_nonce_revelation_case = + Case + { + tag = 1; + name = "seed_nonce_revelation"; + encoding = + obj2 + (req "level" Raw_level_repr.encoding) + (req "nonce" Seed_repr.nonce_encoding); + select = + (function + | Contents (Seed_nonce_revelation _ as op) -> Some op | _ -> None); + proj = (fun (Seed_nonce_revelation {level; nonce}) -> (level, nonce)); + inj = (fun (level, nonce) -> Seed_nonce_revelation {level; nonce}); + } + + let vdf_revelation_case = + Case + { + tag = 8; + name = "vdf_revelation"; + encoding = obj1 (req "solution" Seed_repr.vdf_solution_encoding); + select = + (function Contents (Vdf_revelation _ as op) -> Some op | _ -> None); + proj = (function Vdf_revelation {solution} -> solution); + inj = (fun solution -> Vdf_revelation {solution}); + } + + let double_preendorsement_evidence_case : + Kind.double_preendorsement_evidence case = + Case + { + tag = 7; + name = "double_preendorsement_evidence"; + encoding = + obj2 + (req "op1" (dynamic_size preendorsement_encoding)) + (req "op2" (dynamic_size preendorsement_encoding)); + select = + (function + | Contents (Double_preendorsement_evidence _ as op) -> Some op + | _ -> None); + proj = (fun (Double_preendorsement_evidence {op1; op2}) -> (op1, op2)); + inj = (fun (op1, op2) -> Double_preendorsement_evidence {op1; op2}); + } + + let double_endorsement_evidence_case : Kind.double_endorsement_evidence case = + Case + { + tag = 2; + name = "double_endorsement_evidence"; + encoding = + obj2 + (req "op1" (dynamic_size endorsement_encoding)) + (req "op2" (dynamic_size endorsement_encoding)); + select = + (function + | Contents (Double_endorsement_evidence _ as op) -> Some op + | _ -> None); + proj = (fun (Double_endorsement_evidence {op1; op2}) -> (op1, op2)); + inj = (fun (op1, op2) -> Double_endorsement_evidence {op1; op2}); + } + + let double_baking_evidence_case = + Case + { + tag = 3; + name = "double_baking_evidence"; + encoding = + obj2 + (req "bh1" (dynamic_size Block_header_repr.encoding)) + (req "bh2" (dynamic_size Block_header_repr.encoding)); + select = + (function + | Contents (Double_baking_evidence _ as op) -> Some op | _ -> None); + proj = (fun (Double_baking_evidence {bh1; bh2}) -> (bh1, bh2)); + inj = (fun (bh1, bh2) -> Double_baking_evidence {bh1; bh2}); + } + + let activate_account_case = + Case + { + tag = 4; + name = "activate_account"; + encoding = + obj2 + (req "pkh" Ed25519.Public_key_hash.encoding) + (req "secret" Blinded_public_key_hash.activation_code_encoding); + select = + (function + | Contents (Activate_account _ as op) -> Some op | _ -> None); + proj = + (fun (Activate_account {id; activation_code}) -> + (id, activation_code)); + inj = + (fun (id, activation_code) -> Activate_account {id; activation_code}); + } + + let proposals_case = + Case + { + tag = 5; + name = "proposals"; + encoding = + obj3 + (req "source" Signature.Public_key_hash.encoding) + (req "period" int32) + (req + "proposals" + (list + ~max_length:Constants_repr.max_proposals_per_delegate + Protocol_hash.encoding)); + select = + (function Contents (Proposals _ as op) -> Some op | _ -> None); + proj = + (fun (Proposals {source; period; proposals}) -> + (source, period, proposals)); + inj = + (fun (source, period, proposals) -> + Proposals {source; period; proposals}); + } + + let ballot_case = + Case + { + tag = 6; + name = "ballot"; + encoding = + obj4 + (req "source" Signature.Public_key_hash.encoding) + (req "period" int32) + (req "proposal" Protocol_hash.encoding) + (req "ballot" Vote_repr.ballot_encoding); + select = (function Contents (Ballot _ as op) -> Some op | _ -> None); + proj = + (function + | Ballot {source; period; proposal; ballot} -> + (source, period, proposal, ballot)); + inj = + (fun (source, period, proposal, ballot) -> + Ballot {source; period; proposal; ballot}); + } + + let drain_delegate_case = + Case + { + tag = 9; + name = "drain_delegate"; + encoding = + obj3 + (req "consensus_key" Signature.Public_key_hash.encoding) + (req "delegate" Signature.Public_key_hash.encoding) + (req "destination" Signature.Public_key_hash.encoding); + select = + (function Contents (Drain_delegate _ as op) -> Some op | _ -> None); + proj = + (function + | Drain_delegate {consensus_key; delegate; destination} -> + (consensus_key, delegate, destination)); + inj = + (fun (consensus_key, delegate, destination) -> + Drain_delegate {consensus_key; delegate; destination}); + } + + let failing_noop_case = + Case + { + tag = 17; + name = "failing_noop"; + encoding = obj1 (req "arbitrary" (string Hex)); + select = + (function Contents (Failing_noop _ as op) -> Some op | _ -> None); + proj = (function Failing_noop message -> message); + inj = (function message -> Failing_noop message); + } + + let manager_encoding = + obj5 + (req "source" Signature.Public_key_hash.encoding) + (req "fee" Tez_repr.encoding) + (req "counter" Manager_counter_repr.encoding_for_operation) + (req "gas_limit" (check_size 10 Gas_limit_repr.Arith.n_integral_encoding)) + (req "storage_limit" (check_size 10 n)) + + let extract : type kind. kind Kind.manager contents -> _ = function + | Manager_operation + {source; fee; counter; gas_limit; storage_limit; operation = _} -> + (source, fee, counter, gas_limit, storage_limit) + + let rebuild (source, fee, counter, gas_limit, storage_limit) operation = + Manager_operation + {source; fee; counter; gas_limit; storage_limit; operation} + + let make_manager_case tag (type kind) + (Manager_operations.MCase mcase : kind Manager_operations.case) = + Case + { + tag; + name = mcase.name; + encoding = merge_objs manager_encoding mcase.encoding; + select = + (function + | Contents (Manager_operation ({operation; _} as op)) -> ( + match mcase.select (Manager operation) with + | None -> None + | Some operation -> Some (Manager_operation {op with operation})) + | _ -> None); + proj = + (function + | Manager_operation {operation; _} as op -> + (extract op, mcase.proj operation)); + inj = (fun (op, contents) -> rebuild op (mcase.inj contents)); + } + + let reveal_case = make_manager_case 107 Manager_operations.reveal_case + + let transaction_case = + make_manager_case 108 Manager_operations.transaction_case + + let origination_case = + make_manager_case 109 Manager_operations.origination_case + + let delegation_case = make_manager_case 110 Manager_operations.delegation_case + + let register_global_constant_case = + make_manager_case 111 Manager_operations.register_global_constant_case + + let set_deposits_limit_case = + make_manager_case 112 Manager_operations.set_deposits_limit_case + + let increase_paid_storage_case = + make_manager_case 113 Manager_operations.increase_paid_storage_case + + let update_consensus_key_case = + make_manager_case 114 Manager_operations.update_consensus_key_case + + let tx_rollup_origination_case = + make_manager_case + tx_rollup_operation_tag_offset + Manager_operations.tx_rollup_origination_case + + let tx_rollup_submit_batch_case = + make_manager_case + tx_rollup_operation_submit_batch_tag + Manager_operations.tx_rollup_submit_batch_case + + let tx_rollup_commit_case = + make_manager_case + tx_rollup_operation_commit_tag + Manager_operations.tx_rollup_commit_case + + let tx_rollup_return_bond_case = + make_manager_case + tx_rollup_operation_return_bond_tag + Manager_operations.tx_rollup_return_bond_case + + let tx_rollup_finalize_commitment_case = + make_manager_case + tx_rollup_operation_finalize_commitment_tag + Manager_operations.tx_rollup_finalize_commitment_case + + let tx_rollup_remove_commitment_case = + make_manager_case + tx_rollup_operation_remove_commitment_tag + Manager_operations.tx_rollup_remove_commitment_case + + let tx_rollup_rejection_case = + make_manager_case + tx_rollup_operation_rejection_tag + Manager_operations.tx_rollup_rejection_case + + let tx_rollup_dispatch_tickets_case = + make_manager_case + tx_rollup_operation_dispatch_tickets_tag + Manager_operations.tx_rollup_dispatch_tickets_case + + let transfer_ticket_case = + make_manager_case + transfer_ticket_tag + Manager_operations.transfer_ticket_case + + let dal_publish_slot_header_case = + make_manager_case + dal_publish_slot_header_tag + Manager_operations.dal_publish_slot_header_case + + let sc_rollup_originate_case = + make_manager_case + sc_rollup_operation_origination_tag + Manager_operations.sc_rollup_originate_case + + let sc_rollup_add_messages_case = + make_manager_case + sc_rollup_operation_add_message_tag + Manager_operations.sc_rollup_add_messages_case + + let sc_rollup_cement_case = + make_manager_case + sc_rollup_operation_cement_tag + Manager_operations.sc_rollup_cement_case + + let sc_rollup_publish_case = + make_manager_case + sc_rollup_operation_publish_tag + Manager_operations.sc_rollup_publish_case + + let sc_rollup_refute_case = + make_manager_case + sc_rollup_operation_refute_tag + Manager_operations.sc_rollup_refute_case + + let sc_rollup_timeout_case = + make_manager_case + sc_rollup_operation_timeout_tag + Manager_operations.sc_rollup_timeout_case + + let sc_rollup_execute_outbox_message_case = + make_manager_case + sc_rollup_execute_outbox_message_tag + Manager_operations.sc_rollup_execute_outbox_message_case + + let sc_rollup_recover_bond_case = + make_manager_case + sc_rollup_operation_recover_bond_tag + Manager_operations.sc_rollup_recover_bond_case + + let zk_rollup_origination_case = + make_manager_case + zk_rollup_operation_create_tag + Manager_operations.zk_rollup_origination_case + + let zk_rollup_publish_case = + make_manager_case + zk_rollup_operation_publish_tag + Manager_operations.zk_rollup_publish_case + + let zk_rollup_update_case = + make_manager_case + zk_rollup_operation_update_tag + Manager_operations.zk_rollup_update_case + + type packed_case = PCase : 'b case -> packed_case + + let contents_cases = + [ + PCase endorsement_case; + PCase preendorsement_case; + PCase dal_attestation_case; + PCase seed_nonce_revelation_case; + PCase vdf_revelation_case; + PCase double_endorsement_evidence_case; + PCase double_preendorsement_evidence_case; + PCase double_baking_evidence_case; + PCase activate_account_case; + PCase proposals_case; + PCase ballot_case; + PCase reveal_case; + PCase transaction_case; + PCase origination_case; + PCase delegation_case; + PCase set_deposits_limit_case; + PCase increase_paid_storage_case; + PCase update_consensus_key_case; + PCase drain_delegate_case; + PCase failing_noop_case; + PCase register_global_constant_case; + PCase tx_rollup_origination_case; + PCase tx_rollup_submit_batch_case; + PCase tx_rollup_commit_case; + PCase tx_rollup_return_bond_case; + PCase tx_rollup_finalize_commitment_case; + PCase tx_rollup_remove_commitment_case; + PCase tx_rollup_rejection_case; + PCase tx_rollup_dispatch_tickets_case; + PCase transfer_ticket_case; + PCase dal_publish_slot_header_case; + PCase sc_rollup_originate_case; + PCase sc_rollup_add_messages_case; + PCase sc_rollup_cement_case; + PCase sc_rollup_publish_case; + PCase sc_rollup_refute_case; + PCase sc_rollup_timeout_case; + PCase sc_rollup_execute_outbox_message_case; + PCase sc_rollup_recover_bond_case; + PCase zk_rollup_origination_case; + PCase zk_rollup_publish_case; + PCase zk_rollup_update_case; + ] + + let contents_encoding = + let make (PCase (Case {tag; name; encoding; select; proj; inj})) = + assert (not @@ reserved_tag tag) ; + case + (Tag tag) + name + encoding + (fun o -> match select o with None -> None | Some o -> Some (proj o)) + (fun x -> Contents (inj x)) + in + def "operation.alpha.contents" @@ union (List.map make contents_cases) + + let contents_list_encoding = + conv_with_guard to_list of_list_internal (Variable.list contents_encoding) + + let protocol_data_json_encoding = + conv + (fun (Operation_data {contents; signature}) -> + (Contents_list contents, signature)) + (fun (Contents_list contents, signature) -> + Operation_data {contents; signature}) + (obj2 + (req "contents" (dynamic_size contents_list_encoding)) + (opt "signature" Signature.encoding)) + + type contents_or_signature_prefix = + | Actual_contents of packed_contents + | Signature_prefix of Signature.prefix + + let contents_or_signature_prefix_encoding = + let make_contents (PCase (Case {tag; name; encoding; select; proj; inj})) = + assert (not @@ reserved_tag tag) ; + case + (Tag tag) + name + encoding + (function + | Actual_contents o -> ( + match select o with None -> None | Some o -> Some (proj o)) + | _ -> None) + (fun x -> Actual_contents (Contents (inj x))) + in + def "operation.alpha.contents_or_signature_prefix" + @@ union + @@ case + (Tag signature_prefix_tag) + "signature_prefix" + (obj1 (req "signature_prefix" Signature.prefix_encoding)) + (function Signature_prefix prefix -> Some prefix | _ -> None) + (fun prefix -> Signature_prefix prefix) + (* The case signature_prefix is added to the operation's contents so that + we can store the prefix of BLS signatures without breaking the + encoding of operations. *) + :: List.map make_contents contents_cases + + let of_contents_and_signature_prefix contents_and_prefix = + let open Result_syntax in + let rec loop acc = function + | [] -> Ok acc + | Signature_prefix _ :: _ -> Error "Signature prefix must appear last" + | Actual_contents (Contents o) :: os -> ( + match (o, acc) with + | ( Manager_operation _, + Contents_list (Single (Manager_operation _) as rest) ) -> + (loop [@tailcall]) (Contents_list (Cons (o, rest))) os + | Manager_operation _, Contents_list (Cons _ as rest) -> + (loop [@tailcall]) (Contents_list (Cons (o, rest))) os + | _ -> + Error + "Operation list of length > 1 should only contain manager \ + operations.") + in + let rev_contents, prefix = + match List.rev contents_and_prefix with + | Signature_prefix prefix :: rev_contents -> (rev_contents, Some prefix) + | rev_contents -> (rev_contents, None) + in + let+ packed_contents = + match rev_contents with + | [] -> Error "Operation lists should not be empty." + | Signature_prefix _ :: _ -> Error "Signature prefix must appear last" + | Actual_contents (Contents o) :: os -> loop (Contents_list (Single o)) os + in + (packed_contents, prefix) + + let protocol_data_binary_encoding = + conv_with_guard + (fun (Operation_data {contents; signature}) -> + let contents_list = + List.map (fun c -> Actual_contents c) + @@ to_list (Contents_list contents) + in + let contents_and_signature_prefix, sig_suffix = + match signature with + | None -> (contents_list, Signature.(to_bytes zero)) + | Some signature -> ( + let {Signature.prefix; suffix} = + Signature.split_signature signature + in + match prefix with + | None -> (contents_list, suffix) + | Some prefix -> + (contents_list @ [Signature_prefix prefix], suffix)) + in + (contents_and_signature_prefix, sig_suffix)) + (fun (contents_and_signature_prefix, suffix) -> + let open Result_syntax in + let* Contents_list contents, prefix = + of_contents_and_signature_prefix contents_and_signature_prefix + in + let+ signature = + Result.of_option ~error:"Invalid signature" + @@ Signature.of_splitted {Signature.prefix; suffix} + in + let signature = + match prefix with + | None -> + if Signature.(signature = zero) then None else Some signature + | Some _ -> Some signature + in + Operation_data {contents; signature}) + (obj2 + (req + "contents_and_signature_prefix" + (Variable.list contents_or_signature_prefix_encoding)) + (req "signature_suffix" (Fixed.bytes Hex 64))) + + (* The binary and JSON encodings are different for protocol data, because we + have to fit BLS signatures (which are 96 bytes long) in a backward + compatible manner with fixed size signatures of 64 bytes. + + The JSON encoding is the same as in the previous protocols. + + To support BLS signatures, we extract the prefix of the signature and fit + it inside the field [contents] while keeping the 64 bytes suffix in the + same place as the other signature kinds (i.e. at the end). + + For instance the binary protocol data for a transfer operation signed by a + Ed25519 key would look like: + + +----------------+------------+ + | Transaction | signature | + +----+------+----+------------+ + | 6C | ... | 00 | (64 bytes) | + +----+------+----+------------+ + + The same transfer signed by a BLS key would be instead: + + +----------------+----------------------------+-------------------+ + | Transaction | signature prefix | signature suffix | + +----+------+----+----+----+------------------+-------------------+ + | 6C | ... | 00 | ff | 03 | (first 32 bytes) | (last 64 bytes) | + +----+------+----+----+----+------------------+-------------------+ + + Which can also be viewed with an equivalent schema: + + +----------------+----+---------------+--------------------------+ + | Transaction | ff | signature tag | signature | + +----+------+----+----+---------------+--------------------------+ + | 6C | ... | 00 | ff | 03 (BLS) | (96 bytes BLS signature) | + +----+------+----+----+---------------+--------------------------+ + + NOTE: BLS only supports the tagged format and Ed25519, Secp256k1 and P256 + signatures only support the untagged one. The latter restriction is only + here to guarantee unicity of the binary representation for signatures. + *) + let protocol_data_encoding = + def "operation.alpha.contents_and_signature" + @@ splitted + ~json:protocol_data_json_encoding + ~binary:protocol_data_binary_encoding + + let operation_encoding = + conv + (fun {shell; protocol_data} -> (shell, protocol_data)) + (fun (shell, protocol_data) -> {shell; protocol_data}) + (merge_objs Operation.shell_header_encoding protocol_data_encoding) + + let unsigned_operation_encoding = + def "operation.alpha.unsigned_operation" + @@ merge_objs + Operation.shell_header_encoding + (obj1 (req "contents" contents_list_encoding)) +end + +let encoding = Encoding.operation_encoding + +let contents_encoding = Encoding.contents_encoding + +let contents_list_encoding = Encoding.contents_list_encoding + +let protocol_data_encoding = Encoding.protocol_data_encoding + +let unsigned_operation_encoding = Encoding.unsigned_operation_encoding + +let raw ({shell; protocol_data} : _ operation) = + let proto = + Data_encoding.Binary.to_bytes_exn + protocol_data_encoding + (Operation_data protocol_data) + in + {Operation.shell; proto} + +(** Each operation belongs to a validation pass that is an integer + abstracting its priority in a block. Except Failing_noop. *) + +let consensus_pass = 0 + +let voting_pass = 1 + +let anonymous_pass = 2 + +let manager_pass = 3 + +(** [acceptable_pass op] returns either the validation_pass of [op] + when defines and None when [op] is [Failing_noop]. *) +let acceptable_pass (op : packed_operation) = + let (Operation_data protocol_data) = op.protocol_data in + match protocol_data.contents with + | Single (Failing_noop _) -> None + | Single (Preendorsement _) -> Some consensus_pass + | Single (Endorsement _) -> Some consensus_pass + | Single (Dal_attestation _) -> Some consensus_pass + | Single (Proposals _) -> Some voting_pass + | Single (Ballot _) -> Some voting_pass + | Single (Seed_nonce_revelation _) -> Some anonymous_pass + | Single (Vdf_revelation _) -> Some anonymous_pass + | Single (Double_endorsement_evidence _) -> Some anonymous_pass + | Single (Double_preendorsement_evidence _) -> Some anonymous_pass + | Single (Double_baking_evidence _) -> Some anonymous_pass + | Single (Activate_account _) -> Some anonymous_pass + | Single (Drain_delegate _) -> Some anonymous_pass + | Single (Manager_operation _) -> Some manager_pass + | Cons (Manager_operation _, _ops) -> Some manager_pass + +(** [compare_by_passes] orders two operations in the reverse order of + their acceptable passes. *) +let compare_by_passes op1 op2 = + match (acceptable_pass op1, acceptable_pass op2) with + | Some op1_pass, Some op2_pass -> Compare.Int.compare op2_pass op1_pass + | None, Some _ -> -1 + | Some _, None -> 1 + | None, None -> 0 + +type error += Invalid_signature (* `Permanent *) + +type error += Missing_signature (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"operation.invalid_signature" + ~title:"Invalid operation signature" + ~description: + "The operation signature is ill-formed or has been made with the wrong \ + public key" + ~pp:(fun ppf () -> Format.fprintf ppf "The operation signature is invalid") + Data_encoding.unit + (function Invalid_signature -> Some () | _ -> None) + (fun () -> Invalid_signature) ; + register_error_kind + `Permanent + ~id:"operation.missing_signature" + ~title:"Missing operation signature" + ~description: + "The operation is of a kind that must be signed, but the signature is \ + missing" + ~pp:(fun ppf () -> Format.fprintf ppf "The operation requires a signature") + Data_encoding.unit + (function Missing_signature -> Some () | _ -> None) + (fun () -> Missing_signature) ; + register_error_kind + `Permanent + ~id:"operation.contents_list_error" + ~title:"Invalid list of operation contents." + ~description: + "An operation contents list has an unexpected shape; it should be either \ + a single operation or a non-empty list of manager operations" + ~pp:(fun ppf s -> + Format.fprintf + ppf + "An operation contents list has an unexpected shape: %s" + s) + Data_encoding.(obj1 (req "message" (string Hex))) + (function Contents_list_error s -> Some s | _ -> None) + (fun s -> Contents_list_error s) + +let check_signature (type kind) key chain_id + ({shell; protocol_data} : kind operation) = + let check ~watermark contents signature = + let unsigned_operation = + Data_encoding.Binary.to_bytes_exn + unsigned_operation_encoding + (shell, contents) + in + if Signature.check ~watermark key signature unsigned_operation then Ok () + else error Invalid_signature + in + match protocol_data.signature with + | None -> error Missing_signature + | Some signature -> ( + match protocol_data.contents with + | Single (Preendorsement _) as contents -> + check + ~watermark:(to_watermark (Preendorsement chain_id)) + (Contents_list contents) + signature + | Single (Endorsement _) as contents -> + check + ~watermark:(to_watermark (Endorsement chain_id)) + (Contents_list contents) + signature + | Single (Dal_attestation _) as contents -> + check + ~watermark:(to_watermark (Dal_attestation chain_id)) + (Contents_list contents) + signature + | Single + ( Failing_noop _ | Proposals _ | Ballot _ | Seed_nonce_revelation _ + | Vdf_revelation _ | Double_endorsement_evidence _ + | Double_preendorsement_evidence _ | Double_baking_evidence _ + | Activate_account _ | Drain_delegate _ | Manager_operation _ ) -> + check + ~watermark:Generic_operation + (Contents_list protocol_data.contents) + signature + | Cons (Manager_operation _, _ops) -> + check + ~watermark:Generic_operation + (Contents_list protocol_data.contents) + signature) + +let hash_raw = Operation.hash + +let hash (o : _ operation) = + let proto = + Data_encoding.Binary.to_bytes_exn + protocol_data_encoding + (Operation_data o.protocol_data) + in + Operation.hash {shell = o.shell; proto} + +let hash_packed (o : packed_operation) = + let proto = + Data_encoding.Binary.to_bytes_exn protocol_data_encoding o.protocol_data + in + Operation.hash {shell = o.shell; proto} + +type ('a, 'b) eq = Eq : ('a, 'a) eq + +let equal_manager_operation_kind : + type a b. a manager_operation -> b manager_operation -> (a, b) eq option = + fun op1 op2 -> + match (op1, op2) with + | Reveal _, Reveal _ -> Some Eq + | Reveal _, _ -> None + | Transaction _, Transaction _ -> Some Eq + | Transaction _, _ -> None + | Origination _, Origination _ -> Some Eq + | Origination _, _ -> None + | Delegation _, Delegation _ -> Some Eq + | Delegation _, _ -> None + | Register_global_constant _, Register_global_constant _ -> Some Eq + | Register_global_constant _, _ -> None + | Set_deposits_limit _, Set_deposits_limit _ -> Some Eq + | Set_deposits_limit _, _ -> None + | Increase_paid_storage _, Increase_paid_storage _ -> Some Eq + | Increase_paid_storage _, _ -> None + | Update_consensus_key _, Update_consensus_key _ -> Some Eq + | Update_consensus_key _, _ -> None + | Tx_rollup_origination, Tx_rollup_origination -> Some Eq + | Tx_rollup_origination, _ -> None + | Tx_rollup_submit_batch _, Tx_rollup_submit_batch _ -> Some Eq + | Tx_rollup_submit_batch _, _ -> None + | Tx_rollup_commit _, Tx_rollup_commit _ -> Some Eq + | Tx_rollup_commit _, _ -> None + | Tx_rollup_return_bond _, Tx_rollup_return_bond _ -> Some Eq + | Tx_rollup_return_bond _, _ -> None + | Tx_rollup_finalize_commitment _, Tx_rollup_finalize_commitment _ -> Some Eq + | Tx_rollup_finalize_commitment _, _ -> None + | Tx_rollup_remove_commitment _, Tx_rollup_remove_commitment _ -> Some Eq + | Tx_rollup_remove_commitment _, _ -> None + | Tx_rollup_rejection _, Tx_rollup_rejection _ -> Some Eq + | Tx_rollup_rejection _, _ -> None + | Tx_rollup_dispatch_tickets _, Tx_rollup_dispatch_tickets _ -> Some Eq + | Tx_rollup_dispatch_tickets _, _ -> None + | Transfer_ticket _, Transfer_ticket _ -> Some Eq + | Transfer_ticket _, _ -> None + | Dal_publish_slot_header _, Dal_publish_slot_header _ -> Some Eq + | Dal_publish_slot_header _, _ -> None + | Sc_rollup_originate _, Sc_rollup_originate _ -> Some Eq + | Sc_rollup_originate _, _ -> None + | Sc_rollup_add_messages _, Sc_rollup_add_messages _ -> Some Eq + | Sc_rollup_add_messages _, _ -> None + | Sc_rollup_cement _, Sc_rollup_cement _ -> Some Eq + | Sc_rollup_cement _, _ -> None + | Sc_rollup_publish _, Sc_rollup_publish _ -> Some Eq + | Sc_rollup_publish _, _ -> None + | Sc_rollup_refute _, Sc_rollup_refute _ -> Some Eq + | Sc_rollup_refute _, _ -> None + | Sc_rollup_timeout _, Sc_rollup_timeout _ -> Some Eq + | Sc_rollup_timeout _, _ -> None + | Sc_rollup_execute_outbox_message _, Sc_rollup_execute_outbox_message _ -> + Some Eq + | Sc_rollup_execute_outbox_message _, _ -> None + | Sc_rollup_recover_bond _, Sc_rollup_recover_bond _ -> Some Eq + | Sc_rollup_recover_bond _, _ -> None + | Zk_rollup_origination _, Zk_rollup_origination _ -> Some Eq + | Zk_rollup_origination _, _ -> None + | Zk_rollup_publish _, Zk_rollup_publish _ -> Some Eq + | Zk_rollup_publish _, _ -> None + | Zk_rollup_update _, Zk_rollup_update _ -> Some Eq + | Zk_rollup_update _, _ -> None + +let equal_contents_kind : type a b. a contents -> b contents -> (a, b) eq option + = + fun op1 op2 -> + match (op1, op2) with + | Preendorsement _, Preendorsement _ -> Some Eq + | Preendorsement _, _ -> None + | Endorsement _, Endorsement _ -> Some Eq + | Endorsement _, _ -> None + | Dal_attestation _, Dal_attestation _ -> Some Eq + | Dal_attestation _, _ -> None + | Seed_nonce_revelation _, Seed_nonce_revelation _ -> Some Eq + | Seed_nonce_revelation _, _ -> None + | Vdf_revelation _, Vdf_revelation _ -> Some Eq + | Vdf_revelation _, _ -> None + | Double_endorsement_evidence _, Double_endorsement_evidence _ -> Some Eq + | Double_endorsement_evidence _, _ -> None + | Double_preendorsement_evidence _, Double_preendorsement_evidence _ -> + Some Eq + | Double_preendorsement_evidence _, _ -> None + | Double_baking_evidence _, Double_baking_evidence _ -> Some Eq + | Double_baking_evidence _, _ -> None + | Activate_account _, Activate_account _ -> Some Eq + | Activate_account _, _ -> None + | Proposals _, Proposals _ -> Some Eq + | Proposals _, _ -> None + | Ballot _, Ballot _ -> Some Eq + | Ballot _, _ -> None + | Drain_delegate _, Drain_delegate _ -> Some Eq + | Drain_delegate _, _ -> None + | Failing_noop _, Failing_noop _ -> Some Eq + | Failing_noop _, _ -> None + | Manager_operation op1, Manager_operation op2 -> ( + match equal_manager_operation_kind op1.operation op2.operation with + | None -> None + | Some Eq -> Some Eq) + | Manager_operation _, _ -> None + +let rec equal_contents_kind_list : + type a b. a contents_list -> b contents_list -> (a, b) eq option = + fun op1 op2 -> + match (op1, op2) with + | Single op1, Single op2 -> equal_contents_kind op1 op2 + | Single _, Cons _ -> None + | Cons _, Single _ -> None + | Cons (op1, ops1), Cons (op2, ops2) -> ( + match equal_contents_kind op1 op2 with + | None -> None + | Some Eq -> ( + match equal_contents_kind_list ops1 ops2 with + | None -> None + | Some Eq -> Some Eq)) + +let equal : type a b. a operation -> b operation -> (a, b) eq option = + fun op1 op2 -> + if not (Operation_hash.equal (hash op1) (hash op2)) then None + else + equal_contents_kind_list + op1.protocol_data.contents + op2.protocol_data.contents + +(** {2 Comparing operations} *) + +(** Precondition: both operations are [valid]. Hence, it is possible + to compare them without any state representation. *) + +(** {3 Operation passes} *) + +type consensus_pass_type + +type voting_pass_type + +type anonymous_pass_type + +type manager_pass_type + +type noop_pass_type + +type _ pass = + | Consensus : consensus_pass_type pass + | Voting : voting_pass_type pass + | Anonymous : anonymous_pass_type pass + | Manager : manager_pass_type pass + | Noop : noop_pass_type pass + +(** Pass comparison. *) +let compare_inner_pass : type a b. a pass -> b pass -> int = + fun pass1 pass2 -> + match (pass1, pass2) with + | Consensus, (Voting | Anonymous | Manager | Noop) -> 1 + | (Voting | Anonymous | Manager | Noop), Consensus -> -1 + | Voting, (Anonymous | Manager | Noop) -> 1 + | (Anonymous | Manager | Noop), Voting -> -1 + | Anonymous, (Manager | Noop) -> 1 + | (Manager | Noop), Anonymous -> -1 + | Manager, Noop -> 1 + | Noop, Manager -> -1 + | Consensus, Consensus + | Voting, Voting + | Anonymous, Anonymous + | Manager, Manager + | Noop, Noop -> + 0 + +(** {3 Operation weights} *) + +(** [round_infos] is the pair of a [level] convert into {!int32} and + [round] convert into an {!int}. + + By convention, if the [round] is from an operation round that + failed to convert in a {!int}, the value of [round] is (-1). *) +type round_infos = {level : int32; round : int} + +(** [endorsement_infos] is the pair of a {!round_infos} and a [slot] + convert into an {!int}. *) +type endorsement_infos = {round : round_infos; slot : int} + +(** [double_baking_infos] is the pair of a {!round_infos} and a + {!block_header} hash. *) +type double_baking_infos = {round : round_infos; bh_hash : Block_hash.t} + +(** Compute a {!round_infos} from a {consensus_content} of a valid + operation. Hence, the [round] must convert in {!int}. + + Precondition: [c] comes from a valid operation. The [round] from a + valid operation should succeed to convert in {!int}. Hence, for the + unreachable path where the convertion failed, we put (-1) as + [round] value. *) +let round_infos_from_consensus_content (c : consensus_content) = + let level = Raw_level_repr.to_int32 c.level in + match Round_repr.to_int c.round with + | Ok round -> {level; round} + | Error _ -> {level; round = -1} + +(** Compute a {!endorsement_infos} from a {!consensus_content}. It is + used to compute the weight of {!Endorsement} and {!Preendorsement}. + + Precondition: [c] comes from a valid operation. The {!Endorsement} + or {!Preendorsement} is valid, so its [round] must succeed to + convert into an {!int}. Hence, for the unreachable path where the + convertion fails, we put (-1) as [round] value (see + {!round_infos_from_consensus_content}). *) +let endorsement_infos_from_consensus_content (c : consensus_content) = + let slot = Slot_repr.to_int c.slot in + let round = round_infos_from_consensus_content c in + {round; slot} + +(** Compute a {!double_baking_infos} and a {!Block_header_repr.hash} + from a {!Block_header_repr.t}. It is used to compute the weight of + a {!Double_baking_evidence}. + + Precondition: [bh] comes from a valid operation. The + {!Double_baking_envidence} is valid, so its fitness from its first + denounced block header must succeed, and the round from this + fitness must convert in a {!int}. Hence, for the unreachable paths + where either the convertion fails or the fitness is not + retrievable, we put (-1) as [round] value. *) +let consensus_infos_and_hash_from_block_header (bh : Block_header_repr.t) = + let level = bh.shell.level in + let bh_hash = Block_header_repr.hash bh in + let round = + match Fitness_repr.from_raw bh.shell.fitness with + | Ok bh_fitness -> ( + match Round_repr.to_int (Fitness_repr.round bh_fitness) with + | Ok round -> {level; round} + | Error _ -> {level; round = -1}) + | Error _ -> {level; round = -1} + in + {round; bh_hash} + +(** The weight of an operation. + + Given an operation, its [weight] carries on static information that + is used to compare it to an operation of the same pass. + Operation weight are defined by validation pass. + + The [weight] of an {!Endorsement} or {!Preendorsement} depends on + its {!endorsement_infos}. + + The [weight] of a {!Dal_attestation} depends on the pair of + the size of its bitset, {!Dal_attestation_repr.t}, and the + signature of its attestor {! Signature.Public_key_hash.t}. + + The [weight] of a voting operation depends on the pair of its + [period] and [source]. + + The [weight] of a {!Vdf_revelation} depends on its [solution]. + + The [weight] of a {!Seed_nonce_revelation} depends on its [level] + converted in {!int32}. + + The [weight] of a {!Double_preendorsement} or + {!Double_endorsement} depends on the [level] and [round] of their + first denounciated operations. The [level] and [round] are wrapped + in a {!round_infos}. + + The [weight] of a {!Double_baking} depends on the [level], [round] + and [hash] of its first denounciated block_header. the [level] and + [round] are wrapped in a {!double_baking_infos}. + + The [weight] of an {!Activate_account} depends on its public key + hash. + + The [weight] of an {!Drain_delegate} depends on the public key + hash of the delegate. + + The [weight] of {!Manager_operation} depends on its [fee] and + [gas_limit] ratio expressed in {!Q.t}. *) +type _ weight = + | Weight_endorsement : endorsement_infos -> consensus_pass_type weight + | Weight_preendorsement : endorsement_infos -> consensus_pass_type weight + | Weight_dal_attestation : + (* attestor * num_attestations * level *) + (Signature.Public_key_hash.t * int * int32) + -> consensus_pass_type weight + | Weight_proposals : + int32 * Signature.Public_key_hash.t + -> voting_pass_type weight + | Weight_ballot : + int32 * Signature.Public_key_hash.t + -> voting_pass_type weight + | Weight_seed_nonce_revelation : int32 -> anonymous_pass_type weight + | Weight_vdf_revelation : Seed_repr.vdf_solution -> anonymous_pass_type weight + | Weight_double_preendorsement : round_infos -> anonymous_pass_type weight + | Weight_double_endorsement : round_infos -> anonymous_pass_type weight + | Weight_double_baking : double_baking_infos -> anonymous_pass_type weight + | Weight_activate_account : + Ed25519.Public_key_hash.t + -> anonymous_pass_type weight + | Weight_drain_delegate : + Signature.Public_key_hash.t + -> anonymous_pass_type weight + | Weight_manager : Q.t * Signature.public_key_hash -> manager_pass_type weight + | Weight_noop : noop_pass_type weight + +(** The weight of an operation is the pair of its pass and weight. *) +type operation_weight = W : 'pass pass * 'pass weight -> operation_weight + +(** The {!weight} of a batch of {!Manager_operation} depends on the + sum of all [fee] and the sum of all [gas_limit]. + + Precondition: [op] is a valid manager operation: its sum + of accumulated [fee] must succeed. Hence, in the unreachable path where + the [fee] sum fails, we put [Tez_repr.zero] as its value. *) +let cumulate_fee_and_gas_of_manager : + type kind. + kind Kind.manager contents_list -> + Tez_repr.t * Gas_limit_repr.Arith.integral = + fun op -> + let add_without_error acc y = + match Tez_repr.(acc +? y) with + | Ok v -> v + | Error _ -> (* This cannot happen *) acc + in + let rec loop : + type kind. 'a -> 'b -> kind Kind.manager contents_list -> 'a * 'b = + fun fees_acc gas_limit_acc -> function + | Single (Manager_operation {fee; gas_limit; _}) -> + let total_fees = add_without_error fees_acc fee in + let total_gas_limit = + Gas_limit_repr.Arith.add gas_limit_acc gas_limit + in + (total_fees, total_gas_limit) + | Cons (Manager_operation {fee; gas_limit; _}, manops) -> + let fees_acc = add_without_error fees_acc fee in + let gas_limit_acc = Gas_limit_repr.Arith.add gas_limit gas_limit_acc in + loop fees_acc gas_limit_acc manops + in + loop Tez_repr.zero Gas_limit_repr.Arith.zero op + +(** The {!weight} of a {!Manager_operation} as well as a batch of + operations is the ratio in {!int64} between its [fee] and + [gas_limit] as computed by + {!cumulate_fee_and_gas_of_manager} converted in {!Q.t}. + We assume that the manager operation valid, thus its gas limit can + never be zero. We treat this case the same as gas_limit = 1 for the + sake of simplicity. +*) +let weight_manager : + type kind. + kind Kind.manager contents_list -> Q.t * Signature.public_key_hash = + fun op -> + let fee, glimit = cumulate_fee_and_gas_of_manager op in + let source = + match op with + | Cons (Manager_operation {source; _}, _) -> source + | Single (Manager_operation {source; _}) -> source + in + let fee_f = Q.of_int64 (Tez_repr.to_mutez fee) in + if Gas_limit_repr.Arith.(glimit = Gas_limit_repr.Arith.zero) then + (fee_f, source) + else + let gas_f = Q.of_bigint (Gas_limit_repr.Arith.integral_to_z glimit) in + (Q.(fee_f / gas_f), source) + +(** Computing the {!operation_weight} of an operation. [weight_of + (Failing_noop _)] is unreachable, for completness we define a + Weight_noop which carrries no information. *) +let weight_of : packed_operation -> operation_weight = + fun op -> + let (Operation_data protocol_data) = op.protocol_data in + match protocol_data.contents with + | Single (Failing_noop _) -> W (Noop, Weight_noop) + | Single (Preendorsement consensus_content) -> + W + ( Consensus, + Weight_preendorsement + (endorsement_infos_from_consensus_content consensus_content) ) + | Single (Endorsement consensus_content) -> + W + ( Consensus, + Weight_endorsement + (endorsement_infos_from_consensus_content consensus_content) ) + | Single (Dal_attestation Dal_attestation_repr.{attestor; attestation; level}) + -> + W + ( Consensus, + Weight_dal_attestation + ( attestor, + Dal_attestation_repr.occupied_size_in_bits attestation, + Raw_level_repr.to_int32 level ) ) + | Single (Proposals {period; source; _}) -> + W (Voting, Weight_proposals (period, source)) + | Single (Ballot {period; source; _}) -> + W (Voting, Weight_ballot (period, source)) + | Single (Seed_nonce_revelation {level; _}) -> + W (Anonymous, Weight_seed_nonce_revelation (Raw_level_repr.to_int32 level)) + | Single (Vdf_revelation {solution}) -> + W (Anonymous, Weight_vdf_revelation solution) + | Single (Double_endorsement_evidence {op1; _}) -> ( + match op1.protocol_data.contents with + | Single (Endorsement consensus_content) -> + W + ( Anonymous, + Weight_double_endorsement + (round_infos_from_consensus_content consensus_content) )) + | Single (Double_preendorsement_evidence {op1; _}) -> ( + match op1.protocol_data.contents with + | Single (Preendorsement consensus_content) -> + W + ( Anonymous, + Weight_double_preendorsement + (round_infos_from_consensus_content consensus_content) )) + | Single (Double_baking_evidence {bh1; _}) -> + let double_baking_infos = + consensus_infos_and_hash_from_block_header bh1 + in + W (Anonymous, Weight_double_baking double_baking_infos) + | Single (Activate_account {id; _}) -> + W (Anonymous, Weight_activate_account id) + | Single (Drain_delegate {delegate; _}) -> + W (Anonymous, Weight_drain_delegate delegate) + | Single (Manager_operation _) as ops -> + let manweight, src = weight_manager ops in + W (Manager, Weight_manager (manweight, src)) + | Cons (Manager_operation _, _) as ops -> + let manweight, src = weight_manager ops in + W (Manager, Weight_manager (manweight, src)) + +(** {3 Comparisons of operations {!weight}} *) + +(** {4 Helpers} *) + +(** compare a pair of elements in lexicographic order. *) +let compare_pair_in_lexico_order ~cmp_fst ~cmp_snd (a1, b1) (a2, b2) = + let resa = cmp_fst a1 a2 in + if Compare.Int.(resa <> 0) then resa else cmp_snd b1 b2 + +(** compare in reverse order. *) +let compare_reverse (cmp : 'a -> 'a -> int) a b = cmp b a + +(** {4 Comparison of {!consensus_infos}} *) + +(** Two {!round_infos} compares as the pair of [level, round] in + lexicographic order: the one with the greater [level] being the + greater [round_infos]. When levels are the same, the one with the + greater [round] being the better. + + The greater {!round_infos} is the farther to the current state + when part of the weight of a valid consensus operation. + + The best {!round_infos} is the nearer to the current state when + part of the weight of a valid denunciation. + + In both case, that is the greater according to the lexicographic + order. + + Precondition: the {!round_infos} are from valid operation. They + have been computed by either {!round_infos_from_consensus_content} + or {!consensus_infos_and_hash_from_block_header}. Both input + parameter from valid operations and put (-1) to the [round] in the + unreachable path where the original round fails to convert in + {!int}. *) +let compare_round_infos infos1 infos2 = + compare_pair_in_lexico_order + ~cmp_fst:Compare.Int32.compare + ~cmp_snd:Compare.Int.compare + (infos1.level, infos1.round) + (infos2.level, infos2.round) + +(** When comparing {!Endorsement} to {!Preendorsement} or + {!Double_endorsement_evidence} to {!Double_preendorsement}, in case + of {!round_infos} equality, the position is relevant to compute the + order. *) +type prioritized_position = Nopos | Fstpos | Sndpos + +(** Comparison of two {!round_infos} with priority in case of + {!round_infos} equality. *) +let compare_round_infos_with_prioritized_position ~prioritized_position infos1 + infos2 = + let cmp = compare_round_infos infos1 infos2 in + if Compare.Int.(cmp <> 0) then cmp + else match prioritized_position with Fstpos -> 1 | Sndpos -> -1 | Nopos -> 0 + +(** When comparing consensus operation with {!endorsement_infos}, in + case of equality of their {!round_infos}, either they are of the + same kind and their [slot] have to be compared in the reverse + order, otherwise the {!Endorsement} is better and + [prioritized_position] gives its position. *) +let compare_prioritized_position_or_slot ~prioritized_position = + match prioritized_position with + | Nopos -> compare_reverse Compare.Int.compare + | Fstpos -> fun _ _ -> 1 + | Sndpos -> fun _ _ -> -1 + +(** Two {!endorsement_infos} are compared by their {!round_infos}. + When their {!round_infos} are equal, they are compared according to + their priority or their [slot], see + {!compare_prioritized_position_or_slot} for more details. *) +let compare_endorsement_infos ~prioritized_position (infos1 : endorsement_infos) + (infos2 : endorsement_infos) = + compare_pair_in_lexico_order + ~cmp_fst:compare_round_infos + ~cmp_snd:(compare_prioritized_position_or_slot ~prioritized_position) + (infos1.round, infos1.slot) + (infos2.round, infos2.slot) + +(** Two {!double_baking_infos} are compared as their {!round_infos}. + When their {!round_infos} are equal, they are compared as the + hashes of their first denounced block header. *) +let compare_baking_infos infos1 infos2 = + compare_pair_in_lexico_order + ~cmp_fst:compare_round_infos + ~cmp_snd:Block_hash.compare + (infos1.round, infos1.bh_hash) + (infos2.round, infos2.bh_hash) + +(** Two valid {!Dal_attestation} are compared in the + lexicographic order of their pairs of bitsets size and attestor + hash. *) +let compare_dal_attestation (attestor1, endorsements1, level1) + (attestor2, endorsements2, level2) = + compare_pair_in_lexico_order + ~cmp_fst: + (compare_pair_in_lexico_order + ~cmp_fst:Compare.Int32.compare + ~cmp_snd:Compare.Int.compare) + ~cmp_snd:Signature.Public_key_hash.compare + ((level1, endorsements1), attestor1) + ((level2, endorsements2), attestor2) + +(** {4 Comparison of valid operations of the same validation pass} *) + +(** {5 Comparison of valid consensus operations} *) + +(** Comparing consensus operations by their [weight] uses the + comparison on {!endorsement_infos} for {!Endorsement} and + {!Preendorsement}: see {!endorsement_infos} for more details. + + {!Dal_attestation} is smaller than the other kinds of + consensus operations. Two valid {!Dal_attestation} are + compared by {!compare_dal_attestation}. *) +let compare_consensus_weight w1 w2 = + match (w1, w2) with + | Weight_endorsement infos1, Weight_endorsement infos2 -> + compare_endorsement_infos ~prioritized_position:Nopos infos1 infos2 + | Weight_preendorsement infos1, Weight_preendorsement infos2 -> + compare_endorsement_infos ~prioritized_position:Nopos infos1 infos2 + | Weight_endorsement infos1, Weight_preendorsement infos2 -> + compare_endorsement_infos ~prioritized_position:Fstpos infos1 infos2 + | Weight_preendorsement infos1, Weight_endorsement infos2 -> + compare_endorsement_infos ~prioritized_position:Sndpos infos1 infos2 + | ( Weight_dal_attestation (attestor1, size1, lvl1), + Weight_dal_attestation (attestor2, size2, lvl2) ) -> + compare_dal_attestation (attestor1, size1, lvl1) (attestor2, size2, lvl2) + | Weight_dal_attestation _, (Weight_endorsement _ | Weight_preendorsement _) + -> + -1 + | (Weight_endorsement _ | Weight_preendorsement _), Weight_dal_attestation _ + -> + 1 + +(** {5 Comparison of valid voting operations} *) + +(** Two valid voting operations of the same kind are compared in the + lexicographic order of their pair of [period] and [source]. When + compared to each other, the {!Proposals} is better. *) +let compare_vote_weight w1 w2 = + let cmp i1 source1 i2 source2 = + compare_pair_in_lexico_order + (i1, source1) + (i2, source2) + ~cmp_fst:Compare.Int32.compare + ~cmp_snd:Signature.Public_key_hash.compare + in + match (w1, w2) with + | Weight_proposals (i1, source1), Weight_proposals (i2, source2) -> + cmp i1 source1 i2 source2 + | Weight_ballot (i1, source1), Weight_ballot (i2, source2) -> + cmp i1 source1 i2 source2 + | Weight_ballot _, Weight_proposals _ -> -1 + | Weight_proposals _, Weight_ballot _ -> 1 + +(** {5 Comparison of valid anonymous operations} *) + +(** Comparing two {!Double_endorsement_evidence}, or two + {!Double_preendorsement_evidence}, or comparing them to each other + is comparing their {!round_infos}, see {!compare_round_infos} for + more details. + + Comparing two {!Double_baking_evidence} is comparing as their + {!double_baking_infos}, see {!compare_double_baking_infos} for more + details. + + Two {!Seed_nonce_revelation} are compared by their [level]. + + Two {!Vdf_revelation} are compared by their [solution]. + + Two {!Activate_account} are compared as their [id]. + + When comparing different kind of anonymous operations, the order is + as follows: {!Double_preendorsement_evidence} > + {!Double_endorsement_evidence} > {!Double_baking_evidence} > + {!Vdf_revelation} > {!Seed_nonce_revelation} > {!Activate_account}. + *) +let compare_anonymous_weight w1 w2 = + match (w1, w2) with + | Weight_double_preendorsement infos1, Weight_double_preendorsement infos2 -> + compare_round_infos infos1 infos2 + | Weight_double_preendorsement infos1, Weight_double_endorsement infos2 -> + compare_round_infos_with_prioritized_position + ~prioritized_position:Fstpos + infos1 + infos2 + | Weight_double_endorsement infos1, Weight_double_preendorsement infos2 -> + compare_round_infos_with_prioritized_position + ~prioritized_position:Sndpos + infos1 + infos2 + | Weight_double_endorsement infos1, Weight_double_endorsement infos2 -> + compare_round_infos infos1 infos2 + | ( ( Weight_double_baking _ | Weight_seed_nonce_revelation _ + | Weight_vdf_revelation _ | Weight_activate_account _ + | Weight_drain_delegate _ ), + (Weight_double_preendorsement _ | Weight_double_endorsement _) ) -> + -1 + | ( (Weight_double_preendorsement _ | Weight_double_endorsement _), + ( Weight_double_baking _ | Weight_seed_nonce_revelation _ + | Weight_vdf_revelation _ | Weight_activate_account _ + | Weight_drain_delegate _ ) ) -> + 1 + | Weight_double_baking infos1, Weight_double_baking infos2 -> + compare_baking_infos infos1 infos2 + | ( ( Weight_seed_nonce_revelation _ | Weight_vdf_revelation _ + | Weight_activate_account _ | Weight_drain_delegate _ ), + Weight_double_baking _ ) -> + -1 + | ( Weight_double_baking _, + ( Weight_seed_nonce_revelation _ | Weight_vdf_revelation _ + | Weight_activate_account _ | Weight_drain_delegate _ ) ) -> + 1 + | Weight_vdf_revelation solution1, Weight_vdf_revelation solution2 -> + Seed_repr.compare_vdf_solution solution1 solution2 + | ( ( Weight_seed_nonce_revelation _ | Weight_activate_account _ + | Weight_drain_delegate _ ), + Weight_vdf_revelation _ ) -> + -1 + | ( Weight_vdf_revelation _, + ( Weight_seed_nonce_revelation _ | Weight_activate_account _ + | Weight_drain_delegate _ ) ) -> + 1 + | Weight_seed_nonce_revelation l1, Weight_seed_nonce_revelation l2 -> + Compare.Int32.compare l1 l2 + | ( (Weight_activate_account _ | Weight_drain_delegate _), + Weight_seed_nonce_revelation _ ) -> + -1 + | ( Weight_seed_nonce_revelation _, + (Weight_activate_account _ | Weight_drain_delegate _) ) -> + 1 + | Weight_activate_account pkh1, Weight_activate_account pkh2 -> + Ed25519.Public_key_hash.compare pkh1 pkh2 + | Weight_drain_delegate _, Weight_activate_account _ -> -1 + | Weight_activate_account _, Weight_drain_delegate _ -> 1 + | Weight_drain_delegate pkh1, Weight_drain_delegate pkh2 -> + Signature.Public_key_hash.compare pkh1 pkh2 + +(** {5 Comparison of valid {!Manager_operation}} *) + +(** Two {!Manager_operation} are compared in the lexicographic order + of their pair of their [fee]/[gas] ratio -- as computed by + {!weight_manager} -- and their [source]. *) +let compare_manager_weight weight1 weight2 = + match (weight1, weight2) with + | Weight_manager (manweight1, source1), Weight_manager (manweight2, source2) + -> + compare_pair_in_lexico_order + (manweight1, source1) + (manweight2, source2) + ~cmp_fst:Compare.Q.compare + ~cmp_snd:Signature.Public_key_hash.compare + +(** Two {!operation_weight} are compared by their [pass], see + {!compare_inner_pass} for more details. When they have the same + [pass], they are compared by their [weight]. *) +let compare_operation_weight w1 w2 = + match (w1, w2) with + | W (Consensus, w1), W (Consensus, w2) -> compare_consensus_weight w1 w2 + | W (Voting, w1), W (Voting, w2) -> compare_vote_weight w1 w2 + | W (Anonymous, w1), W (Anonymous, w2) -> compare_anonymous_weight w1 w2 + | W (Manager, w1), W (Manager, w2) -> compare_manager_weight w1 w2 + | W (pass1, _), W (pass2, _) -> compare_inner_pass pass1 pass2 + +(** {3 Compare two valid operations} *) + +(** Two valid operations are compared as their {!operation_weight}, + see {!compare_operation_weight} for more details. + + When they are equal according to their {!operation_weight} comparison, they + compare as their hash. + Hence, [compare] returns [0] only when the hashes of both operations are + equal. + + Preconditions: [oph1] is the hash of [op1]; [oph2] the one of [op2]; and + [op1] and [op2] are both valid. *) +let compare (oph1, op1) (oph2, op2) = + let cmp_h = Operation_hash.(compare oph1 oph2) in + if Compare.Int.(cmp_h = 0) then 0 + else + let cmp = compare_operation_weight (weight_of op1) (weight_of op2) in + if Compare.Int.(cmp = 0) then cmp_h else cmp diff --git a/src/proto_016_PtMumbai/lib_protocol/operation_repr.mli b/src/proto_016_PtMumbai/lib_protocol/operation_repr.mli new file mode 100644 index 000000000000..bfd56723fb7b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/operation_repr.mli @@ -0,0 +1,905 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Low level Repr. of Operations + + Defines kinds of operations that can be performed on chain: + - preendorsement + - endorsement + - double baking evidence + - double preendorsing evidence + - double endorsing evidence + - seed nonce revelation + - account activation + - proposal (see: [Voting_repr]) + - ballot (see: [Voting_repr]) + - failing noop + - manager operation (which in turn has several types): + - revelation + - transaction + - origination + - delegation + - set deposits limitation + - tx rollup origination + - tx rollup batch submission + - tx rollup commit + - tx rollup withdraw + - tx rollup reveal withdrawals + - smart contract rollup origination + - zk rollup origination + - zk rollup publish + - zk rollup update + + Each of them can be encoded as raw bytes. Operations are distinguished at + type level using phantom type parameters. [packed_operation] type allows + for unifying them when required, for instance to put them on a single + list. *) + +module Kind : sig + type preendorsement_consensus_kind = Preendorsement_consensus_kind + + type endorsement_consensus_kind = Endorsement_consensus_kind + + type 'a consensus = + | Preendorsement_kind : preendorsement_consensus_kind consensus + | Endorsement_kind : endorsement_consensus_kind consensus + + type preendorsement = preendorsement_consensus_kind consensus + + type endorsement = endorsement_consensus_kind consensus + + type dal_attestation = Dal_attestation_kind + + type seed_nonce_revelation = Seed_nonce_revelation_kind + + type vdf_revelation = Vdf_revelation_kind + + type 'a double_consensus_operation_evidence = + | Double_consensus_operation_evidence + + type double_endorsement_evidence = + endorsement_consensus_kind double_consensus_operation_evidence + + type double_preendorsement_evidence = + preendorsement_consensus_kind double_consensus_operation_evidence + + type double_baking_evidence = Double_baking_evidence_kind + + type activate_account = Activate_account_kind + + type proposals = Proposals_kind + + type ballot = Ballot_kind + + type reveal = Reveal_kind + + type transaction = Transaction_kind + + type origination = Origination_kind + + type delegation = Delegation_kind + + type event = Event_kind + + type set_deposits_limit = Set_deposits_limit_kind + + type increase_paid_storage = Increase_paid_storage_kind + + type update_consensus_key = Update_consensus_key_kind + + type drain_delegate = Drain_delegate_kind + + type failing_noop = Failing_noop_kind + + type register_global_constant = Register_global_constant_kind + + type tx_rollup_origination = Tx_rollup_origination_kind + + type tx_rollup_submit_batch = Tx_rollup_submit_batch_kind + + type tx_rollup_commit = Tx_rollup_commit_kind + + type tx_rollup_return_bond = Tx_rollup_return_bond_kind + + type tx_rollup_finalize_commitment = Tx_rollup_finalize_commitment_kind + + type tx_rollup_remove_commitment = Tx_rollup_remove_commitment_kind + + type tx_rollup_rejection = Tx_rollup_rejection_kind + + type tx_rollup_dispatch_tickets = Tx_rollup_dispatch_tickets_kind + + type transfer_ticket = Transfer_ticket_kind + + type dal_publish_slot_header = Dal_publish_slot_header_kind + + type sc_rollup_originate = Sc_rollup_originate_kind + + type sc_rollup_add_messages = Sc_rollup_add_messages_kind + + type sc_rollup_cement = Sc_rollup_cement_kind + + type sc_rollup_publish = Sc_rollup_publish_kind + + type sc_rollup_refute = Sc_rollup_refute_kind + + type sc_rollup_timeout = Sc_rollup_timeout_kind + + type sc_rollup_execute_outbox_message = + | Sc_rollup_execute_outbox_message_kind + + type sc_rollup_recover_bond = Sc_rollup_recover_bond_kind + + type zk_rollup_origination = Zk_rollup_origination_kind + + type zk_rollup_publish = Zk_rollup_publish_kind + + type zk_rollup_update = Zk_rollup_update_kind + + type 'a manager = + | Reveal_manager_kind : reveal manager + | Transaction_manager_kind : transaction manager + | Origination_manager_kind : origination manager + | Delegation_manager_kind : delegation manager + | Event_manager_kind : event manager + | Register_global_constant_manager_kind : register_global_constant manager + | Set_deposits_limit_manager_kind : set_deposits_limit manager + | Increase_paid_storage_manager_kind : increase_paid_storage manager + | Update_consensus_key_manager_kind : update_consensus_key manager + | Tx_rollup_origination_manager_kind : tx_rollup_origination manager + | Tx_rollup_submit_batch_manager_kind : tx_rollup_submit_batch manager + | Tx_rollup_commit_manager_kind : tx_rollup_commit manager + | Tx_rollup_return_bond_manager_kind : tx_rollup_return_bond manager + | Tx_rollup_finalize_commitment_manager_kind + : tx_rollup_finalize_commitment manager + | Tx_rollup_remove_commitment_manager_kind + : tx_rollup_remove_commitment manager + | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_dispatch_tickets_manager_kind + : tx_rollup_dispatch_tickets manager + | Transfer_ticket_manager_kind : transfer_ticket manager + | Dal_publish_slot_header_manager_kind : dal_publish_slot_header manager + | Sc_rollup_originate_manager_kind : sc_rollup_originate manager + | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager + | Sc_rollup_cement_manager_kind : sc_rollup_cement manager + | Sc_rollup_publish_manager_kind : sc_rollup_publish manager + | Sc_rollup_refute_manager_kind : sc_rollup_refute manager + | Sc_rollup_timeout_manager_kind : sc_rollup_timeout manager + | Sc_rollup_execute_outbox_message_manager_kind + : sc_rollup_execute_outbox_message manager + | Sc_rollup_recover_bond_manager_kind : sc_rollup_recover_bond manager + | Zk_rollup_origination_manager_kind : zk_rollup_origination manager + | Zk_rollup_publish_manager_kind : zk_rollup_publish manager + | Zk_rollup_update_manager_kind : zk_rollup_update manager +end + +type 'a consensus_operation_type = + | Endorsement : Kind.endorsement consensus_operation_type + | Preendorsement : Kind.preendorsement consensus_operation_type + +val pp_operation_kind : + Format.formatter -> 'kind consensus_operation_type -> unit + +type consensus_content = { + slot : Slot_repr.t; + (* By convention, this is the validator's first slot. *) + level : Raw_level_repr.t; + (* The level of (pre)endorsed block. *) + round : Round_repr.t; + (* The round of (pre)endorsed block. *) + block_payload_hash : Block_payload_hash.t; + (* The payload hash of (pre)endorsed block. *) +} + +val consensus_content_encoding : consensus_content Data_encoding.t + +val pp_consensus_content : Format.formatter -> consensus_content -> unit + +type consensus_watermark = + | Endorsement of Chain_id.t + | Preendorsement of Chain_id.t + | Dal_attestation of Chain_id.t + +val to_watermark : consensus_watermark -> Signature.watermark + +val of_watermark : Signature.watermark -> consensus_watermark option + +type raw = Operation.t = {shell : Operation.shell_header; proto : bytes} + +val raw_encoding : raw Data_encoding.t + +(** An [operation] contains the operation header information in [shell] + and all data related to the operation itself in [protocol_data]. *) +type 'kind operation = { + shell : Operation.shell_header; + protocol_data : 'kind protocol_data; +} + +(** A [protocol_data] wraps together a signature for the operation and + the contents of the operation itself. *) +and 'kind protocol_data = { + contents : 'kind contents_list; + signature : Signature.t option; +} + +(** A [contents_list] is a list of contents, the GADT guarantees two + invariants: + - the list is not empty, and + - if the list has several elements then it only contains manager + operations. *) +and _ contents_list = + | Single : 'kind contents -> 'kind contents_list + | Cons : + 'kind Kind.manager contents * 'rest Kind.manager contents_list + -> ('kind * 'rest) Kind.manager contents_list + +(** A value of type [contents] an operation related to whether + consensus, governance or contract management. *) +and _ contents = + (* Preendorsement: About consensus, preendorsement of a block held by a + validator (specific to Tenderbake). *) + | Preendorsement : consensus_content -> Kind.preendorsement contents + (* Endorsement: About consensus, endorsement of a block held by a + validator. *) + | Endorsement : consensus_content -> Kind.endorsement contents + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3115 + + Temporary operation to avoid modifying endorsement encoding. *) + | Dal_attestation : + Dal_attestation_repr.operation + -> Kind.dal_attestation contents + (* Seed_nonce_revelation: Nonces are created by bakers and are + combined to create pseudo-random seeds. Bakers are urged to reveal their + nonces after a given number of cycles to keep their block rewards + from being forfeited. *) + | Seed_nonce_revelation : { + level : Raw_level_repr.t; + nonce : Seed_repr.nonce; + } + -> Kind.seed_nonce_revelation contents + (* Vdf_revelation: VDF are computed from the seed generated by the revealed + nonces. *) + | Vdf_revelation : { + solution : Seed_repr.vdf_solution; + } + -> Kind.vdf_revelation contents + (* Double_preendorsement_evidence: Double-preendorsement is a + kind of malicious attack where a byzantine attempts to fork + the chain by preendorsing blocks with different + contents (at the same level and same round) + twice. This behavior may be reported and the byzantine will have + its security deposit forfeited. *) + | Double_preendorsement_evidence : { + op1 : Kind.preendorsement operation; + op2 : Kind.preendorsement operation; + } + -> Kind.double_preendorsement_evidence contents + (* Double_endorsement_evidence: Similar to double-preendorsement but + for endorsements. *) + | Double_endorsement_evidence : { + op1 : Kind.endorsement operation; + op2 : Kind.endorsement operation; + } + -> Kind.double_endorsement_evidence contents + (* Double_baking_evidence: Similarly to double-endorsement but the + byzantine attempts to fork by signing two different blocks at the + same level. *) + | Double_baking_evidence : { + bh1 : Block_header_repr.t; + bh2 : Block_header_repr.t; + } + -> Kind.double_baking_evidence contents + (* Activate_account: Account activation allows to register a public + key hash on the blockchain. *) + | Activate_account : { + id : Ed25519.Public_key_hash.t; + activation_code : Blinded_public_key_hash.activation_code; + } + -> Kind.activate_account contents + (* Proposals: A candidate protocol can be proposed for voting. *) + | Proposals : { + source : Signature.Public_key_hash.t; + period : int32; + proposals : Protocol_hash.t list; + } + -> Kind.proposals contents + (* Ballot: The validators of the chain will then vote on proposals. *) + | Ballot : { + source : Signature.Public_key_hash.t; + period : int32; + proposal : Protocol_hash.t; + ballot : Vote_repr.ballot; + } + -> Kind.ballot contents + (* [Drain_delegate { consensus_key ; delegate ; destination }] + transfers the spendable balance of the [delegate] to [destination] + when [consensus_key] is the active consensus key of [delegate].. *) + | Drain_delegate : { + consensus_key : Signature.Public_key_hash.t; + delegate : Signature.Public_key_hash.t; + destination : Signature.Public_key_hash.t; + } + -> Kind.drain_delegate contents + (* Failing_noop: An operation never considered by the state machine + and which will always fail at [apply]. This allows end-users to + sign arbitrary messages which have no computational semantics. *) + | Failing_noop : string -> Kind.failing_noop contents + (* Manager_operation: Operations, emitted and signed by + a (revealed) implicit account, that describe management and + interactions between contracts (whether implicit or + smart). *) + | Manager_operation : { + source : Signature.Public_key_hash.t; + fee : Tez_repr.tez; + counter : Manager_counter_repr.t; + operation : 'kind manager_operation; + gas_limit : Gas_limit_repr.Arith.integral; + storage_limit : Z.t; + } + -> 'kind Kind.manager contents + +(** A [manager_operation] describes management and interactions + between contracts (whether implicit or smart). *) +and _ manager_operation = + (* [Reveal] for the revelation of a public key, a one-time + prerequisite to any signed operation, in order to be able to + check the sender’s signature. *) + | Reveal : Signature.Public_key.t -> Kind.reveal manager_operation + (* [Transaction] of some amount to some destination contract. It can + also be used to execute/call smart-contracts. *) + | Transaction : { + amount : Tez_repr.tez; + parameters : Script_repr.lazy_expr; + entrypoint : Entrypoint_repr.t; + destination : Contract_repr.t; + } + -> Kind.transaction manager_operation + (* [Origination] of a contract using a smart-contract [script] and + initially credited with the amount [credit]. *) + | Origination : { + delegate : Signature.Public_key_hash.t option; + script : Script_repr.t; + credit : Tez_repr.tez; + } + -> Kind.origination manager_operation + (* [Delegation] to some staking contract (designated by its public + key hash). When this value is None, delegation is reverted as it + is set to nobody. *) + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation manager_operation + (* [Register_global_constant] allows registration and substitution + of a global constant available from any contract and registered in + the context. *) + | Register_global_constant : { + value : Script_repr.lazy_expr; + } + -> Kind.register_global_constant manager_operation + (* [Set_deposits_limit] sets an optional limit for frozen deposits + of a contract at a lower value than the maximum limit. When None, + the limit in unset back to the default maximum limit. *) + | Set_deposits_limit : + Tez_repr.t option + -> Kind.set_deposits_limit manager_operation + (* [Increase_paid_storage] allows a sender to pay to increase the paid storage of + some contract by some amount. *) + | Increase_paid_storage : { + amount_in_bytes : Z.t; + destination : Contract_hash.t; + } + -> Kind.increase_paid_storage manager_operation + (* [Update_consensus_key pk] updates the consensus key of + the signing delegate to [pk]. *) + | Update_consensus_key : + Signature.Public_key.t + -> Kind.update_consensus_key manager_operation + (* [Tx_rollup_origination] allows an implicit contract to originate + a new transactional rollup. *) + | Tx_rollup_origination : Kind.tx_rollup_origination manager_operation + (* [Tx_rollup_submit_batch] allows to submit batches of L2 operations on a + transactional rollup. The content is a string, but stands for an immutable + byte sequence. *) + | Tx_rollup_submit_batch : { + tx_rollup : Tx_rollup_repr.t; + content : string; + burn_limit : Tez_repr.t option; + } + -> Kind.tx_rollup_submit_batch manager_operation + | Tx_rollup_commit : { + tx_rollup : Tx_rollup_repr.t; + commitment : Tx_rollup_commitment_repr.Full.t; + } + -> Kind.tx_rollup_commit manager_operation + | Tx_rollup_return_bond : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_return_bond manager_operation + | Tx_rollup_finalize_commitment : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_finalize_commitment manager_operation + | Tx_rollup_remove_commitment : { + tx_rollup : Tx_rollup_repr.t; + } + -> Kind.tx_rollup_remove_commitment manager_operation + | Tx_rollup_rejection : { + tx_rollup : Tx_rollup_repr.t; + level : Tx_rollup_level_repr.t; + message : Tx_rollup_message_repr.t; + message_position : int; + message_path : Tx_rollup_inbox_repr.Merkle.path; + message_result_hash : Tx_rollup_message_result_hash_repr.t; + message_result_path : Tx_rollup_commitment_repr.Merkle.path; + previous_message_result : Tx_rollup_message_result_repr.t; + previous_message_result_path : Tx_rollup_commitment_repr.Merkle.path; + proof : Tx_rollup_l2_proof.serialized; + } + -> Kind.tx_rollup_rejection manager_operation + | Tx_rollup_dispatch_tickets : { + tx_rollup : Tx_rollup_repr.t; + (** The rollup from where the tickets are retrieved *) + level : Tx_rollup_level_repr.t; + (** The level at which the withdrawal was enabled *) + context_hash : Context_hash.t; + (** The hash of the l2 context resulting from the execution of the + inbox from where this withdrawal was enabled. *) + message_index : int; + (** Index of the message in the inbox at [level] where this withdrawal was enabled. *) + message_result_path : Tx_rollup_commitment_repr.Merkle.path; + tickets_info : Tx_rollup_reveal_repr.t list; + } + -> Kind.tx_rollup_dispatch_tickets manager_operation + (** [Transfer_ticket] allows an implicit account (the "claimer") to + receive [amount] tickets, pulled out of [tx_rollup], to the + [entrypoint] of the smart contract [destination]. + + The ticket must have been addressed to the + claimer, who must be the source of this operation. It must have been + pulled out at [level] and from the message at [message_index]. The ticket + is composed of [ticketer; ty; contents]. *) + | Transfer_ticket : { + contents : Script_repr.lazy_expr; (** Contents of the withdrawn ticket *) + ty : Script_repr.lazy_expr; + (** Type of the withdrawn ticket's contents *) + ticketer : Contract_repr.t; (** Ticketer of the withdrawn ticket *) + amount : Ticket_amount.t; + (** Quantity of the withdrawn ticket. Must match the + amount that was enabled. *) + destination : Contract_repr.t; + (** The smart contract address that should receive the tickets. *) + entrypoint : Entrypoint_repr.t; + (** The entrypoint of the smart contract address that should receive the tickets. *) + } + -> Kind.transfer_ticket manager_operation + | Dal_publish_slot_header : + Dal_slot_repr.Header.operation + -> Kind.dal_publish_slot_header manager_operation + (** [Sc_rollup_originate] allows an implicit account to originate a new + smart contract rollup (initialized with a given boot sector). + The [parameters_ty] field allows to provide the expected interface + of the rollup being originated (i.e. its entrypoints with their + associated signatures) as a Michelson type. + *) + | Sc_rollup_originate : { + kind : Sc_rollups.Kind.t; + boot_sector : string; + origination_proof : Sc_rollup_proof_repr.serialized; + parameters_ty : Script_repr.lazy_expr; + } + -> Kind.sc_rollup_originate manager_operation + (* [Sc_rollup_add_messages] adds messages to the smart rollups' inbox. *) + | Sc_rollup_add_messages : { + messages : string list; + } + -> Kind.sc_rollup_add_messages manager_operation + | Sc_rollup_cement : { + rollup : Sc_rollup_repr.t; + commitment : Sc_rollup_commitment_repr.Hash.t; + } + -> Kind.sc_rollup_cement manager_operation + | Sc_rollup_publish : { + rollup : Sc_rollup_repr.t; + commitment : Sc_rollup_commitment_repr.t; + } + -> Kind.sc_rollup_publish manager_operation + | Sc_rollup_refute : { + rollup : Sc_rollup_repr.t; + opponent : Sc_rollup_repr.Staker.t; + refutation : Sc_rollup_game_repr.refutation option; + } + -> Kind.sc_rollup_refute manager_operation + (** [Sc_rollup_refute { rollup; opponent; refutation }] makes a move + in a refutation game between the source of the operation and the + [opponent] under the given [rollup]. Both players must be stakers + on commitments in conflict. When [refutation = None], the game is + initialized. Next, when [refutation = Some move], [move] is the + next play for the current player. See {!Sc_rollup_game_repr} for + details. **) + | Sc_rollup_timeout : { + rollup : Sc_rollup_repr.t; + stakers : Sc_rollup_game_repr.Index.t; + } + -> Kind.sc_rollup_timeout manager_operation + (* [Sc_rollup_execute_outbox_message] executes a message from the rollup's + outbox. Messages may involve transactions to smart contract accounts on + Layer 1. *) + | Sc_rollup_execute_outbox_message : { + rollup : Sc_rollup_repr.t; (** The smart-contract rollup. *) + cemented_commitment : Sc_rollup_commitment_repr.Hash.t; + (** The hash of the last cemented commitment that the proof refers to. *) + output_proof : string; + (** A message along with a proof that it is included in the outbox + at a given outbox level and message index.*) + } + -> Kind.sc_rollup_execute_outbox_message manager_operation + | Sc_rollup_recover_bond : { + sc_rollup : Sc_rollup_repr.t; + staker : Signature.Public_key_hash.t; + } + -> Kind.sc_rollup_recover_bond manager_operation + | Zk_rollup_origination : { + public_parameters : Plonk.public_parameters; + circuits_info : [`Public | `Private | `Fee] Zk_rollup_account_repr.SMap.t; + (** Circuit names, alongside a tag indicating its kind. *) + init_state : Zk_rollup_state_repr.t; + nb_ops : int; + } + -> Kind.zk_rollup_origination manager_operation + | Zk_rollup_publish : { + zk_rollup : Zk_rollup_repr.t; + ops : (Zk_rollup_operation_repr.t * Zk_rollup_ticket_repr.t option) list; + (* See {!Zk_rollup_apply} *) + } + -> Kind.zk_rollup_publish manager_operation + | Zk_rollup_update : { + zk_rollup : Zk_rollup_repr.t; + update : Zk_rollup_update_repr.t; + } + -> Kind.zk_rollup_update manager_operation + +type packed_manager_operation = + | Manager : 'kind manager_operation -> packed_manager_operation + +type packed_contents = Contents : 'kind contents -> packed_contents + +type packed_contents_list = + | Contents_list : 'kind contents_list -> packed_contents_list + +val of_list : packed_contents list -> packed_contents_list tzresult + +val to_list : packed_contents_list -> packed_contents list + +type packed_protocol_data = + | Operation_data : 'kind protocol_data -> packed_protocol_data + +type packed_operation = { + shell : Operation.shell_header; + protocol_data : packed_protocol_data; +} + +val pack : 'kind operation -> packed_operation + +val manager_kind : 'kind manager_operation -> 'kind Kind.manager + +val encoding : packed_operation Data_encoding.t + +val contents_encoding : packed_contents Data_encoding.t + +val contents_list_encoding : packed_contents_list Data_encoding.t + +val protocol_data_encoding : packed_protocol_data Data_encoding.t + +val unsigned_operation_encoding : + (Operation.shell_header * packed_contents_list) Data_encoding.t + +val raw : _ operation -> raw + +val hash_raw : raw -> Operation_hash.t + +val hash : _ operation -> Operation_hash.t + +val hash_packed : packed_operation -> Operation_hash.t + +(** Each operation belongs to a validation pass that is an integer + abstracting its priority in a block. Except Failing_noop. *) + +(** The validation pass of consensus operations. *) +val consensus_pass : int + +(** The validation pass of voting operations. *) +val voting_pass : int + +(** The validation pass of anonymous operations. *) +val anonymous_pass : int + +(** The validation pass of anonymous operations. *) +val manager_pass : int + +(** [acceptable_pass op] returns either the validation_pass of [op] + when defines and None when [op] is [Failing_noop]. *) +val acceptable_pass : packed_operation -> int option + +(** [compare_by_passes] orders two operations in the reverse order of + their acceptable passes. *) +val compare_by_passes : packed_operation -> packed_operation -> int + +(** [compare (oph1,op1) (oph2,op2)] defines a total ordering relation + on operations. + + The following requirements must be satisfied: [oph1] is the + [Operation.hash op1], [oph2] is [Operation.hash op2], and that + [op1] and [op2] are valid in the same context. + + [compare (oph1,op1) (oph2,op2) = 0] happens only if + [Operation_hash.compare oph1 oph2 = 0], meaning when [op1] and + [op2] are structurally identical. + + Two valid operations of different [validation_pass] are compared + according to {!acceptable_passes}: the one with the smaller pass + being the greater. + + Two valid operations of the same [validation_pass] are compared + according to a [weight], computed thanks to their static + information. + + The global order is as follows: + + {!Endorsement} and {!Preendorsement} > {!Dal_attestation} > + {!Proposals} > {!Ballot} > {!Double_preendorsement_evidence} > + {!Double_endorsement_evidence} > {!Double_baking_evidence} > + {!Vdf_revelation} > {!Seed_nonce_revelation} > {!Activate_account} + > {!Drain_delegate} > {!Manager_operation}. + + {!Endorsement} and {!Preendorsement} are compared by the pair of + their [level] and [round] such as the farther to the current state + [level] and [round] is greater; e.g. the greater pair in + lexicographic order being the better. When equal and both + operations being of the same kind, we compare their [slot]: the + The smaller being the better, assuming that the more slots an endorser + has, the smaller is its smallest [slot]. When the pair is equal + and comparing an {!Endorsement] to a {!Preendorsement}, the + {!Endorsement} is better. + + Two {!Dal_attestation} ops are compared in the lexicographic + order of the pair of their number of endorsed slots as available + and their endorsers. + + Two voting operations are compared in the lexicographic order of + the pair of their [period] and [source]. A {!Proposals} is better + than a {!Ballot}. + + Two denunciations of the same kind are compared such as the farther + to the current state the better. For {!Double_baking_evidence} + in the case of equality, they are compared by the hashes of their first + denounced block_header. + + Two {!Vdf_revelation} ops are compared by their [solution]. + + Two {!Seed_nonce_relevation} ops are compared by their [level]. + + Two {!Activate_account} ops are compared by their [id]. + + Two {!Drain_delegate} ops are compared by their [delegate]. + + Two {!Manager_operation}s are compared in the lexicographic order of + the pair of their [fee]/[gas_limit] ratios and [source]. *) +val compare : + Operation_hash.t * packed_operation -> + Operation_hash.t * packed_operation -> + int + +type error += Missing_signature (* `Permanent *) + +type error += Invalid_signature (* `Permanent *) + +val check_signature : + Signature.Public_key.t -> Chain_id.t -> _ operation -> unit tzresult + +type ('a, 'b) eq = Eq : ('a, 'a) eq + +val equal : 'a operation -> 'b operation -> ('a, 'b) eq option + +module Encoding : sig + type 'b case = + | Case : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_contents -> 'b contents option; + proj : 'b contents -> 'a; + inj : 'a -> 'b contents; + } + -> 'b case + + val preendorsement_case : Kind.preendorsement case + + val endorsement_case : Kind.endorsement case + + val dal_attestation_case : Kind.dal_attestation case + + val seed_nonce_revelation_case : Kind.seed_nonce_revelation case + + val vdf_revelation_case : Kind.vdf_revelation case + + val double_preendorsement_evidence_case : + Kind.double_preendorsement_evidence case + + val double_endorsement_evidence_case : Kind.double_endorsement_evidence case + + val double_baking_evidence_case : Kind.double_baking_evidence case + + val activate_account_case : Kind.activate_account case + + val proposals_case : Kind.proposals case + + val ballot_case : Kind.ballot case + + val drain_delegate_case : Kind.drain_delegate case + + val failing_noop_case : Kind.failing_noop case + + val reveal_case : Kind.reveal Kind.manager case + + val transaction_case : Kind.transaction Kind.manager case + + val origination_case : Kind.origination Kind.manager case + + val delegation_case : Kind.delegation Kind.manager case + + val update_consensus_key_case : Kind.update_consensus_key Kind.manager case + + val register_global_constant_case : + Kind.register_global_constant Kind.manager case + + val set_deposits_limit_case : Kind.set_deposits_limit Kind.manager case + + val increase_paid_storage_case : Kind.increase_paid_storage Kind.manager case + + val tx_rollup_origination_case : Kind.tx_rollup_origination Kind.manager case + + val tx_rollup_submit_batch_case : + Kind.tx_rollup_submit_batch Kind.manager case + + val tx_rollup_commit_case : Kind.tx_rollup_commit Kind.manager case + + val tx_rollup_return_bond_case : Kind.tx_rollup_return_bond Kind.manager case + + val tx_rollup_finalize_commitment_case : + Kind.tx_rollup_finalize_commitment Kind.manager case + + val tx_rollup_remove_commitment_case : + Kind.tx_rollup_remove_commitment Kind.manager case + + val tx_rollup_rejection_case : Kind.tx_rollup_rejection Kind.manager case + + val tx_rollup_dispatch_tickets_case : + Kind.tx_rollup_dispatch_tickets Kind.manager case + + val transfer_ticket_case : Kind.transfer_ticket Kind.manager case + + val dal_publish_slot_header_case : + Kind.dal_publish_slot_header Kind.manager case + + val sc_rollup_originate_case : Kind.sc_rollup_originate Kind.manager case + + val sc_rollup_add_messages_case : + Kind.sc_rollup_add_messages Kind.manager case + + val sc_rollup_cement_case : Kind.sc_rollup_cement Kind.manager case + + val sc_rollup_publish_case : Kind.sc_rollup_publish Kind.manager case + + val sc_rollup_refute_case : Kind.sc_rollup_refute Kind.manager case + + val sc_rollup_timeout_case : Kind.sc_rollup_timeout Kind.manager case + + val sc_rollup_execute_outbox_message_case : + Kind.sc_rollup_execute_outbox_message Kind.manager case + + val sc_rollup_recover_bond_case : + Kind.sc_rollup_recover_bond Kind.manager case + + val zk_rollup_origination_case : Kind.zk_rollup_origination Kind.manager case + + val zk_rollup_publish_case : Kind.zk_rollup_publish Kind.manager case + + val zk_rollup_update_case : Kind.zk_rollup_update Kind.manager case + + module Manager_operations : sig + type 'b case = + | MCase : { + tag : int; + name : string; + encoding : 'a Data_encoding.t; + select : packed_manager_operation -> 'kind manager_operation option; + proj : 'kind manager_operation -> 'a; + inj : 'a -> 'kind manager_operation; + } + -> 'kind case + + val reveal_case : Kind.reveal case + + val transaction_case : Kind.transaction case + + val origination_case : Kind.origination case + + val delegation_case : Kind.delegation case + + val update_consensus_key_tag : int + + val update_consensus_key_case : Kind.update_consensus_key case + + val register_global_constant_case : Kind.register_global_constant case + + val set_deposits_limit_case : Kind.set_deposits_limit case + + val increase_paid_storage_case : Kind.increase_paid_storage case + + val tx_rollup_origination_case : Kind.tx_rollup_origination case + + val tx_rollup_submit_batch_case : Kind.tx_rollup_submit_batch case + + val tx_rollup_commit_case : Kind.tx_rollup_commit case + + val tx_rollup_return_bond_case : Kind.tx_rollup_return_bond case + + val tx_rollup_finalize_commitment_case : + Kind.tx_rollup_finalize_commitment case + + val tx_rollup_remove_commitment_case : Kind.tx_rollup_remove_commitment case + + val tx_rollup_rejection_case : Kind.tx_rollup_rejection case + + val tx_rollup_dispatch_tickets_case : Kind.tx_rollup_dispatch_tickets case + + val transfer_ticket_case : Kind.transfer_ticket case + + val dal_publish_slot_header_case : Kind.dal_publish_slot_header case + + val sc_rollup_originate_case : Kind.sc_rollup_originate case + + val sc_rollup_add_messages_case : Kind.sc_rollup_add_messages case + + val sc_rollup_cement_case : Kind.sc_rollup_cement case + + val sc_rollup_publish_case : Kind.sc_rollup_publish case + + val sc_rollup_refute_case : Kind.sc_rollup_refute case + + val sc_rollup_timeout_case : Kind.sc_rollup_timeout case + + val sc_rollup_execute_outbox_message_case : + Kind.sc_rollup_execute_outbox_message case + + val sc_rollup_recover_bond_case : Kind.sc_rollup_recover_bond case + + val zk_rollup_origination_case : Kind.zk_rollup_origination case + + val zk_rollup_publish_case : Kind.zk_rollup_publish case + + val zk_rollup_update_case : Kind.zk_rollup_update case + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/origination_nonce.ml b/src/proto_016_PtMumbai/lib_protocol/origination_nonce.ml new file mode 100644 index 000000000000..32bb5be371e1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/origination_nonce.ml @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = {operation_hash : Operation_hash.t; origination_index : int32} + +let encoding = + let open Data_encoding in + conv + (fun {operation_hash; origination_index} -> + (operation_hash, origination_index)) + (fun (operation_hash, origination_index) -> + {operation_hash; origination_index}) + @@ obj2 (req "operation" Operation_hash.encoding) (dft "index" int32 0l) + +let initial operation_hash = {operation_hash; origination_index = 0l} + +let incr nonce = + let origination_index = Int32.succ nonce.origination_index in + {nonce with origination_index} diff --git a/src/proto_016_PtMumbai/lib_protocol/origination_nonce.mli b/src/proto_016_PtMumbai/lib_protocol/origination_nonce.mli new file mode 100644 index 000000000000..cd44e5be14ff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/origination_nonce.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Originated contracts and tx rollups handles are crafted from the hash of the + operation that triggered their origination (and nothing else). As a single + operation can trigger several originations, the corresponding handles are + forged from a deterministic sequence of nonces, initialized with the hash of + the operation. *) +type t = {operation_hash : Operation_hash.t; origination_index : int32} + +val encoding : t Data_encoding.t + +val initial : Operation_hash.t -> t + +val incr : t -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/parameters_repr.ml b/src/proto_016_PtMumbai/lib_protocol/parameters_repr.ml new file mode 100644 index 000000000000..13604ffdc600 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/parameters_repr.ml @@ -0,0 +1,252 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type bootstrap_account = { + public_key_hash : Signature.Public_key_hash.t; + public_key : Signature.Public_key.t option; + amount : Tez_repr.t; + delegate_to : Signature.Public_key_hash.t option; + consensus_key : Signature.Public_key.t option; +} + +type bootstrap_contract = { + delegate : Signature.Public_key_hash.t option; + amount : Tez_repr.t; + script : Script_repr.t; +} + +type t = { + bootstrap_accounts : bootstrap_account list; + bootstrap_contracts : bootstrap_contract list; + commitments : Commitment_repr.t list; + constants : Constants_parametric_repr.t; + security_deposit_ramp_up_cycles : int option; + no_reward_cycles : int option; +} + +let bootstrap_account_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Public_key_known" + (tup2 Signature.Public_key.encoding Tez_repr.encoding) + (function + | { + public_key_hash; + public_key = Some public_key; + amount; + delegate_to = None; + consensus_key = None; + } -> + assert ( + Signature.Public_key_hash.equal + (Signature.Public_key.hash public_key) + public_key_hash) ; + Some (public_key, amount) + | {public_key = None; _} + | {delegate_to = Some _; _} + | {consensus_key = Some _; _} -> + None) + (fun (public_key, amount) -> + { + public_key = Some public_key; + public_key_hash = Signature.Public_key.hash public_key; + amount; + delegate_to = None; + consensus_key = None; + }); + case + (Tag 1) + ~title:"Public_key_unknown" + (tup2 Signature.Public_key_hash.encoding Tez_repr.encoding) + (function + | { + public_key_hash; + public_key = None; + amount; + delegate_to = None; + consensus_key = None; + } -> + Some (public_key_hash, amount) + | {public_key = Some _; _} + | {delegate_to = Some _; _} + | {consensus_key = Some _; _} -> + None) + (fun (public_key_hash, amount) -> + { + public_key = None; + public_key_hash; + amount; + delegate_to = None; + consensus_key = None; + }); + case + (Tag 2) + ~title:"Public_key_known_with_delegate" + (tup3 + Signature.Public_key.encoding + Tez_repr.encoding + Signature.Public_key_hash.encoding) + (function + | { + public_key_hash; + public_key = Some public_key; + amount; + delegate_to = Some delegate; + consensus_key = None; + } -> + assert ( + Signature.Public_key_hash.equal + (Signature.Public_key.hash public_key) + public_key_hash) ; + Some (public_key, amount, delegate) + | {public_key = None; _} + | {delegate_to = None; _} + | {consensus_key = Some _; _} -> + None) + (fun (public_key, amount, delegate) -> + { + public_key = Some public_key; + public_key_hash = Signature.Public_key.hash public_key; + amount; + delegate_to = Some delegate; + consensus_key = None; + }); + case + (Tag 3) + ~title:"Public_key_unknown_with_delegate" + (tup3 + Signature.Public_key_hash.encoding + Tez_repr.encoding + Signature.Public_key_hash.encoding) + (function + | { + public_key_hash; + public_key = None; + amount; + delegate_to = Some delegate; + consensus_key = None; + } -> + Some (public_key_hash, amount, delegate) + | {public_key = Some _; _} + | {delegate_to = None; _} + | {consensus_key = Some _; _} -> + None) + (fun (public_key_hash, amount, delegate) -> + { + public_key = None; + public_key_hash; + amount; + delegate_to = Some delegate; + consensus_key = None; + }); + case + (Tag 4) + ~title:"Public_key_known_with_consensus_key" + (tup3 + Signature.Public_key.encoding + Tez_repr.encoding + Signature.Public_key.encoding) + (function + | { + public_key_hash; + public_key = Some public_key; + amount; + delegate_to = None; + consensus_key = Some consensus_key; + } -> + assert ( + Signature.Public_key_hash.equal + (Signature.Public_key.hash public_key) + public_key_hash) ; + Some (public_key, amount, consensus_key) + | {public_key = None; _} + | {delegate_to = Some _; _} + | {consensus_key = None; _} -> + None) + (fun (public_key, amount, consensus_key) -> + { + public_key = Some public_key; + public_key_hash = Signature.Public_key.hash public_key; + amount; + delegate_to = None; + consensus_key = Some consensus_key; + }); + ] + +let bootstrap_contract_encoding = + let open Data_encoding in + conv + (fun {delegate; amount; script} -> (delegate, amount, script)) + (fun (delegate, amount, script) -> {delegate; amount; script}) + (obj3 + (opt "delegate" Signature.Public_key_hash.encoding) + (req "amount" Tez_repr.encoding) + (req "script" Script_repr.encoding)) + +let encoding = + let open Data_encoding in + conv + (fun { + bootstrap_accounts; + bootstrap_contracts; + commitments; + constants; + security_deposit_ramp_up_cycles; + no_reward_cycles; + } -> + ( ( bootstrap_accounts, + bootstrap_contracts, + commitments, + security_deposit_ramp_up_cycles, + no_reward_cycles ), + constants )) + (fun ( ( bootstrap_accounts, + bootstrap_contracts, + commitments, + security_deposit_ramp_up_cycles, + no_reward_cycles ), + constants ) -> + { + bootstrap_accounts; + bootstrap_contracts; + commitments; + constants; + security_deposit_ramp_up_cycles; + no_reward_cycles; + }) + (merge_objs + (obj5 + (req "bootstrap_accounts" (list bootstrap_account_encoding)) + (dft "bootstrap_contracts" (list bootstrap_contract_encoding) []) + (dft "commitments" (list Commitment_repr.encoding) []) + (opt "security_deposit_ramp_up_cycles" int31) + (opt "no_reward_cycles" int31)) + Constants_parametric_repr.encoding) + +let check_params params = Constants_repr.check_constants params.constants diff --git a/src/proto_016_PtMumbai/lib_protocol/parameters_repr.mli b/src/proto_016_PtMumbai/lib_protocol/parameters_repr.mli new file mode 100644 index 000000000000..97bad09f1ccb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/parameters_repr.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines protocol parameters, i.e. constants regulating the + behaviour of the blockchain under the protocol. *) + +(** An implict contract (account) initially existing on a chain since genesis. *) +type bootstrap_account = { + public_key_hash : Signature.Public_key_hash.t; + public_key : Signature.Public_key.t option; + amount : Tez_repr.t; + delegate_to : Signature.Public_key_hash.t option; + consensus_key : Signature.Public_key.t option; +} + +(** An originated contract initially existing on a chain since genesis. *) +type bootstrap_contract = { + delegate : Signature.Public_key_hash.t option; + amount : Tez_repr.t; + script : Script_repr.t; +} + +(** Protocol parameters define some constants regulating behaviour of the + chain. *) +type t = { + bootstrap_accounts : bootstrap_account list; + bootstrap_contracts : bootstrap_contract list; + commitments : Commitment_repr.t list; + constants : Constants_parametric_repr.t; + security_deposit_ramp_up_cycles : int option; + no_reward_cycles : int option; +} + +val bootstrap_account_encoding : bootstrap_account Data_encoding.t + +val encoding : t Data_encoding.t + +val check_params : t -> unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/path_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/path_encoding.ml new file mode 100644 index 000000000000..935986395bfd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/path_encoding.ml @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type S = sig + type t + + val to_path : t -> string list -> string list + + val of_path : string list -> t option + + val path_length : int +end + +module type ENCODING = sig + type t + + val to_bytes : t -> bytes + + val of_bytes_opt : bytes -> t option +end + +module Make_hex (H : ENCODING) = struct + let path_length = 1 + + let to_path t l = + let (`Hex key) = Hex.of_bytes (H.to_bytes t) in + key :: l + + let of_path = function + | [path] -> Option.bind (Hex.to_bytes (`Hex path)) H.of_bytes_opt + | _ -> None +end diff --git a/src/proto_016_PtMumbai/lib_protocol/path_encoding.mli b/src/proto_016_PtMumbai/lib_protocol/path_encoding.mli new file mode 100644 index 000000000000..e44d1db35038 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/path_encoding.mli @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type S = sig + type t + + (** [to_path t postfix] returns the context path name for [t] + postfixed with [postfix] *) + val to_path : t -> string list -> string list + + (** [of_path path] parses [path] as a context path name for [t] *) + val of_path : string list -> t option + + (** Directory levels of the path encoding of [t] *) + val path_length : int +end + +module type ENCODING = sig + type t + + val to_bytes : t -> bytes + + val of_bytes_opt : bytes -> t option +end + +(** Path encoding in hex: [/[0-9a-f]{2}+/] *) +module Make_hex (H : ENCODING) : S with type t := H.t diff --git a/src/proto_016_PtMumbai/lib_protocol/period_repr.ml b/src/proto_016_PtMumbai/lib_protocol/period_repr.ml new file mode 100644 index 000000000000..1f2de5752be8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/period_repr.ml @@ -0,0 +1,164 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* `Permanent *) +type error += Malformed_period of int64 | Invalid_arg | Period_overflow + +let () = + let open Data_encoding in + (* Malformed period *) + register_error_kind + `Permanent + ~id:"malformed_period" + ~title:"Malformed period" + ~description:"Period is negative." + ~pp:(fun ppf period -> + Format.fprintf ppf "The given period '%Ld' is negative " period) + (obj1 (req "malformed_period" int64)) + (function Malformed_period n -> Some n | _ -> None) + (fun n -> Malformed_period n) ; + (* Invalid arg *) + register_error_kind + `Permanent + ~id:"invalid_arg" + ~title:"Invalid arg" + ~description:"Negative multiple of periods are not allowed." + ~pp:(fun ppf () -> Format.fprintf ppf "Invalid arg") + empty + (function Invalid_arg -> Some () | _ -> None) + (fun () -> Invalid_arg) ; + let title = "Period overflow" in + register_error_kind + `Permanent + ~id:"period_overflow" + ~title + ~description:"Last operation generated an integer overflow." + ~pp:(fun ppf () -> Format.fprintf ppf "%s" title) + empty + (function Period_overflow -> Some () | _ -> None) + (fun () -> Period_overflow) + +module type INTERNAL = sig + type t = private int64 + + val create : int64 -> t option + + val zero : t + + val one : t + + val mult_ : t -> t -> t option + + val add_ : t -> t -> t option + + val encoding : t Data_encoding.t + + val rpc_arg : t RPC_arg.arg + + val pp : Format.formatter -> t -> unit + + include Compare.S with type t := t +end + +(* Internal module implementing natural numbers using int64. These are different + from usual (wrapping up) unsigned integers in that if one overflows the + representation bounds for int64 through [add] or [mul], a [None] value is + returned *) +module Internal : INTERNAL = struct + type t = Int64.t + + let encoding = + Data_encoding.( + with_decoding_guard + (fun t -> + if Compare.Int64.(t >= 0L) then Ok () + else Error "Positive int64 required") + int64) + + let rpc_arg = RPC_arg.uint63 + + let pp ppf v = Format.fprintf ppf "%Ld" v + + include (Compare.Int64 : Compare.S with type t := t) + + let zero = 0L + + let one = 1L + + let create t = if t >= zero then Some t else None + + (* The create function is not used in the [mul_] and [add_] below to not add + extra Some | None pattern matching to handle since the overflow checks are + generic and apply as well to negative as positive integers . + + To handle overflows, both [add_] and [mult_] return option types. [None] is + returned on detected overflow, [Some value] when everything went well. *) + let mult_ a b = + if a <> zero then + let res = Int64.mul a b in + if Int64.div res a <> b then None else Some res + else Some zero + + let add_ a b = + let res = Int64.add a b in + if res < a || res < b then None else Some res +end + +include Internal + +type period = Internal.t + +let to_seconds (t : Internal.t) = (t :> int64) + +let of_seconds secs = + match Internal.create secs with + | Some v -> ok v + | None -> error (Malformed_period secs) + +let of_seconds_exn t = + match Internal.create t with + | Some t -> t + | None -> invalid_arg "Period.of_seconds_exn" + +let mult i p = + match Internal.create (Int64.of_int32 i) with + | None -> error Invalid_arg + | Some iper -> ( + match Internal.mult_ iper p with + | None -> error Period_overflow + | Some res -> ok res) + +let add p1 p2 = + match Internal.add_ p1 p2 with + | None -> error Period_overflow + | Some res -> ok res + +let ( +? ) = add + +let one_second = Internal.one + +let one_minute = of_seconds_exn 60L + +let one_hour = of_seconds_exn 3600L diff --git a/src/proto_016_PtMumbai/lib_protocol/period_repr.mli b/src/proto_016_PtMumbai/lib_protocol/period_repr.mli new file mode 100644 index 000000000000..92f60493a57d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/period_repr.mli @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t + +(** Represents a period of time as a non-negative integer. *) +type period = t + +include Compare.S with type t := t + +val encoding : period Data_encoding.t + +val rpc_arg : period RPC_arg.t + +val pp : Format.formatter -> period -> unit + +(** Returns the number of seconds contained in the period. *) +val to_seconds : period -> int64 + +(** Converts a number of seconds to a [period]. + + [of_second s] fails if [s] is not positive. *) +val of_seconds : int64 -> period tzresult + +(** Converts a number of seconds to [period]. + + [of_second s] fails if [s] is not positive. + It should only be used at toplevel for constants. *) +val of_seconds_exn : int64 -> period + +(** Safe addition of periods, guarded against overflow. *) +val add : period -> period -> period tzresult + +(** Alias for [add]. *) +val ( +? ) : period -> period -> period tzresult + +(** Safe multiplication by a positive integer. Guarded against overflow. *) +val mult : int32 -> period -> period tzresult + +val zero : period + +val one_second : period + +val one_minute : period + +val one_hour : period + +(** [compare x y] returns [0] if [x] is equal to [y], a negative + integer if [x] is shorter than [y], and a positive integer if [x] + is longer than [y]. *) +val compare : period -> period -> int diff --git a/src/proto_016_PtMumbai/lib_protocol/ratio_repr.ml b/src/proto_016_PtMumbai/lib_protocol/ratio_repr.ml new file mode 100644 index 000000000000..463ab0667f22 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ratio_repr.ml @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = {numerator : int; denominator : int} + +let encoding = + let open Data_encoding in + conv_with_guard + (fun r -> (r.numerator, r.denominator)) + (fun (numerator, denominator) -> + if Compare.Int.(denominator > 0) then ok {numerator; denominator} + else Error "The denominator must be greater than 0.") + (obj2 (req "numerator" uint16) (req "denominator" uint16)) + +let pp fmt {numerator; denominator} = + Format.fprintf fmt "%d/%d" numerator denominator diff --git a/src/proto_016_PtMumbai/lib_protocol/ratio_repr.mli b/src/proto_016_PtMumbai/lib_protocol/ratio_repr.mli new file mode 100644 index 000000000000..237f04972695 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ratio_repr.mli @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = {numerator : int; denominator : int} + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/raw_context.ml b/src/proto_016_PtMumbai/lib_protocol/raw_context.ml new file mode 100644 index 000000000000..88ee47c7fda3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/raw_context.ml @@ -0,0 +1,1851 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Int_set = Set.Make (Compare.Int) + +(* + + Gas levels maintenance + ======================= + + The context maintains two levels of gas, one corresponds to the gas + available for the current operation while the other is the gas + available for the current block. Both levels are maintained + independently: [consume_gas] only decreases the operation level, + and block level should be updated with [consume_gas_limit_in_block]. + + A layered context + ================= + + Updating the context [remaining_operation_gas] is a critical routine + called very frequently by the operations performed by the protocol. + On the contrary, other fields are less frequently updated. + + In a previous version of the context datatype definition, all + the fields were represented at the toplevel. To update the remaining + gas, we had to copy ~25 fields (that is 200 bytes). + + With the following layered representation, we only have to + copy 2 fields (16 bytes) during [remaining_operation_gas] update. + This has a significant impact on the Michelson runtime efficiency. + + Here are the fields on the [back] of the context: + + *) + +type consensus_pk = { + delegate : Signature.Public_key_hash.t; + consensus_pk : Signature.Public_key.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +let consensus_pk_encoding = + let open Data_encoding in + conv + (fun {delegate; consensus_pk; consensus_pkh} -> + if Signature.Public_key_hash.equal consensus_pkh delegate then + (consensus_pk, None) + else (consensus_pk, Some delegate)) + (fun (consensus_pk, delegate) -> + let consensus_pkh = Signature.Public_key.hash consensus_pk in + let delegate = + match delegate with None -> consensus_pkh | Some del -> del + in + {delegate; consensus_pk; consensus_pkh}) + (obj2 + (req "consensus_pk" Signature.Public_key.encoding) + (opt "delegate" Signature.Public_key_hash.encoding)) + +module Raw_consensus = struct + (** Consensus operations are indexed by their [initial slots]. Given + a delegate, the [initial slot] is the lowest slot assigned to + this delegate. *) + + type t = { + current_endorsement_power : int; + (** Number of endorsement slots recorded for the current block. *) + allowed_endorsements : (consensus_pk * int) Slot_repr.Map.t; + (** Endorsements rights for the current block. Only an endorsement + for the lowest slot in the block can be recorded. The map + associates to each initial slot the [pkh] associated to this + slot with its power. *) + allowed_preendorsements : (consensus_pk * int) Slot_repr.Map.t; + (** Preendorsements rights for the current block. Only a preendorsement + for the lowest slot in the block can be recorded. The map + associates to each initial slot the [pkh] associated to this + slot with its power. *) + grand_parent_endorsements_seen : Signature.Public_key_hash.Set.t; + (** Record the endorsements already seen for the grand + parent. This only useful for the partial construction mode. *) + endorsements_seen : Slot_repr.Set.t; + (** Record the endorsements already seen. Only initial slots are indexed. *) + preendorsements_seen : Slot_repr.Set.t; + (** Record the preendorsements already seen. Only initial slots + are indexed. *) + locked_round_evidence : (Round_repr.t * int) option; + (** Record the preendorsement power for a locked round. *) + preendorsements_quorum_round : Round_repr.t option; + (** in block construction mode, record the round of preendorsements + included in a block. *) + endorsement_branch : (Block_hash.t * Block_payload_hash.t) option; + grand_parent_branch : (Block_hash.t * Block_payload_hash.t) option; + } + + (** Invariant: + + - [slot \in endorsements_seen => Int_map.mem slot allowed_endorsements] + + - [slot \in preendorsements_seen => Int_map.mem slot allowed_preendorsements] + + - [ |endorsements_seen| > 0 => |included endorsements| > 0] + + *) + + let empty : t = + { + current_endorsement_power = 0; + allowed_endorsements = Slot_repr.Map.empty; + allowed_preendorsements = Slot_repr.Map.empty; + grand_parent_endorsements_seen = Signature.Public_key_hash.Set.empty; + endorsements_seen = Slot_repr.Set.empty; + preendorsements_seen = Slot_repr.Set.empty; + locked_round_evidence = None; + preendorsements_quorum_round = None; + endorsement_branch = None; + grand_parent_branch = None; + } + + type error += Double_inclusion_of_consensus_operation + + let () = + register_error_kind + `Branch + ~id:"operation.double_inclusion_of_consensus_operation" + ~title:"Double inclusion of consensus operation" + ~description:"double inclusion of consensus operation" + ~pp:(fun ppf () -> + Format.fprintf ppf "Double inclusion of consensus operation") + Data_encoding.empty + (function + | Double_inclusion_of_consensus_operation -> Some () | _ -> None) + (fun () -> Double_inclusion_of_consensus_operation) + + let record_grand_parent_endorsement t pkh = + error_when + (Signature.Public_key_hash.Set.mem pkh t.grand_parent_endorsements_seen) + Double_inclusion_of_consensus_operation + >|? fun () -> + { + t with + grand_parent_endorsements_seen = + Signature.Public_key_hash.Set.add pkh t.grand_parent_endorsements_seen; + } + + let record_endorsement t ~initial_slot ~power = + error_when + (Slot_repr.Set.mem initial_slot t.endorsements_seen) + Double_inclusion_of_consensus_operation + >|? fun () -> + { + t with + current_endorsement_power = t.current_endorsement_power + power; + endorsements_seen = Slot_repr.Set.add initial_slot t.endorsements_seen; + } + + let record_preendorsement ~initial_slot ~power round t = + error_when + (Slot_repr.Set.mem initial_slot t.preendorsements_seen) + Double_inclusion_of_consensus_operation + >|? fun () -> + let locked_round_evidence = + match t.locked_round_evidence with + | None -> Some (round, power) + | Some (_stored_round, evidences) -> + (* In mempool mode, round and stored_round can be different. + It doesn't matter in that case since quorum certificates + are not used in mempool. + For other cases [Apply.check_round] verifies it. *) + Some (round, evidences + power) + in + { + t with + locked_round_evidence; + preendorsements_seen = + Slot_repr.Set.add initial_slot t.preendorsements_seen; + } + + let set_preendorsements_quorum_round round t = + match t.preendorsements_quorum_round with + | Some round' -> + (* If the rounds are different, an error should have already + been raised. *) + assert (Round_repr.equal round round') ; + t + | None -> {t with preendorsements_quorum_round = Some round} + + let initialize_with_endorsements_and_preendorsements ~allowed_endorsements + ~allowed_preendorsements t = + {t with allowed_endorsements; allowed_preendorsements} + + let locked_round_evidence t = t.locked_round_evidence + + let endorsement_branch t = t.endorsement_branch + + let grand_parent_branch t = t.grand_parent_branch + + let set_endorsement_branch t endorsement_branch = + {t with endorsement_branch = Some endorsement_branch} + + let set_grand_parent_branch t grand_parent_branch = + {t with grand_parent_branch = Some grand_parent_branch} +end + +type dal_committee = { + pkh_to_shards : + (Dal_attestation_repr.shard_index * int) Signature.Public_key_hash.Map.t; + shard_to_pkh : Signature.Public_key_hash.t Dal_attestation_repr.Shard_map.t; +} + +let empty_dal_committee = + { + pkh_to_shards = Signature.Public_key_hash.Map.empty; + shard_to_pkh = Dal_attestation_repr.Shard_map.empty; + } + +type back = { + context : Context.t; + constants : Constants_parametric_repr.t; + round_durations : Round_repr.Durations.t; + cycle_eras : Level_repr.cycle_eras; + level : Level_repr.t; + predecessor_timestamp : Time.t; + timestamp : Time.t; + fees : Tez_repr.t; + origination_nonce : Origination_nonce.t option; + temporary_lazy_storage_ids : Lazy_storage_kind.Temp_ids.t; + internal_nonce : int; + internal_nonces_used : Int_set.t; + remaining_block_gas : Gas_limit_repr.Arith.fp; + unlimited_operation_gas : bool; + consensus : Raw_consensus.t; + non_consensus_operations_rev : Operation_hash.t list; + dictator_proposal_seen : bool; + sampler_state : (Seed_repr.seed * consensus_pk Sampler.t) Cycle_repr.Map.t; + stake_distribution_for_current_cycle : + Tez_repr.t Signature.Public_key_hash.Map.t option; + tx_rollup_current_messages : + Tx_rollup_inbox_repr.Merkle.tree Tx_rollup_repr.Map.t; + sc_rollup_current_messages : Sc_rollup_inbox_merkelized_payload_hashes_repr.t; + dal_slot_fee_market : Dal_slot_repr.Slot_market.t; + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3105 + + We associate to a slot header some fees. This enable the use + of a fee market for slot publication. However, this is not + resilient from the game theory point of view. Probably we can find + better incentives here. In any case, because we want the following + invariant: + + - For each level and for each slot there is at most one slot + header. + + - We need to provide an incentive to avoid byzantines to post + dummy slot headers. *) + dal_attestation_slot_accountability : Dal_attestation_repr.Accountability.t; + dal_committee : dal_committee; +} + +(* + + The context is simply a record with two fields which + limits the cost of updating the [remaining_operation_gas]. + +*) +type t = {remaining_operation_gas : Gas_limit_repr.Arith.fp; back : back} + +type root = t + +(* + + Context fields accessors + ======================== + + To have the context related code more robust to evolutions, + we introduce accessors to get and to update the context + components. + +*) +let[@inline] context ctxt = ctxt.back.context + +let[@inline] current_level ctxt = ctxt.back.level + +let[@inline] predecessor_timestamp ctxt = ctxt.back.predecessor_timestamp + +let[@inline] current_timestamp ctxt = ctxt.back.timestamp + +let[@inline] round_durations ctxt = ctxt.back.round_durations + +let[@inline] cycle_eras ctxt = ctxt.back.cycle_eras + +let[@inline] constants ctxt = ctxt.back.constants + +let[@inline] tx_rollup ctxt = ctxt.back.constants.tx_rollup + +let[@inline] sc_rollup ctxt = ctxt.back.constants.sc_rollup + +let[@inline] zk_rollup ctxt = ctxt.back.constants.zk_rollup + +let[@inline] recover ctxt = ctxt.back.context + +let[@inline] fees ctxt = ctxt.back.fees + +let[@inline] origination_nonce ctxt = ctxt.back.origination_nonce + +let[@inline] internal_nonce ctxt = ctxt.back.internal_nonce + +let[@inline] internal_nonces_used ctxt = ctxt.back.internal_nonces_used + +let[@inline] remaining_block_gas ctxt = ctxt.back.remaining_block_gas + +let[@inline] unlimited_operation_gas ctxt = ctxt.back.unlimited_operation_gas + +let[@inline] temporary_lazy_storage_ids ctxt = + ctxt.back.temporary_lazy_storage_ids + +let[@inline] remaining_operation_gas ctxt = ctxt.remaining_operation_gas + +let[@inline] non_consensus_operations_rev ctxt = + ctxt.back.non_consensus_operations_rev + +let[@inline] dictator_proposal_seen ctxt = ctxt.back.dictator_proposal_seen + +let[@inline] sampler_state ctxt = ctxt.back.sampler_state + +let[@inline] update_back ctxt back = {ctxt with back} + +let[@inline] update_remaining_block_gas ctxt remaining_block_gas = + update_back ctxt {ctxt.back with remaining_block_gas} + +let[@inline] update_remaining_operation_gas ctxt remaining_operation_gas = + {ctxt with remaining_operation_gas} + +let[@inline] update_unlimited_operation_gas ctxt unlimited_operation_gas = + update_back ctxt {ctxt.back with unlimited_operation_gas} + +let[@inline] update_context ctxt context = + update_back ctxt {ctxt.back with context} + +let[@inline] update_constants ctxt constants = + update_back ctxt {ctxt.back with constants} + +let[@inline] update_origination_nonce ctxt origination_nonce = + update_back ctxt {ctxt.back with origination_nonce} + +let[@inline] update_internal_nonce ctxt internal_nonce = + update_back ctxt {ctxt.back with internal_nonce} + +let[@inline] update_internal_nonces_used ctxt internal_nonces_used = + update_back ctxt {ctxt.back with internal_nonces_used} + +let[@inline] update_fees ctxt fees = update_back ctxt {ctxt.back with fees} + +let[@inline] update_temporary_lazy_storage_ids ctxt temporary_lazy_storage_ids = + update_back ctxt {ctxt.back with temporary_lazy_storage_ids} + +let[@inline] update_non_consensus_operations_rev ctxt + non_consensus_operations_rev = + update_back ctxt {ctxt.back with non_consensus_operations_rev} + +let[@inline] update_dictator_proposal_seen ctxt dictator_proposal_seen = + update_back ctxt {ctxt.back with dictator_proposal_seen} + +let[@inline] update_sampler_state ctxt sampler_state = + update_back ctxt {ctxt.back with sampler_state} + +type error += Too_many_internal_operations (* `Permanent *) + +type error += Block_quota_exceeded (* `Temporary *) + +type error += Operation_quota_exceeded (* `Temporary *) + +type error += Stake_distribution_not_set (* `Branch *) + +type error += Sampler_already_set of Cycle_repr.t (* `Permanent *) + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"too_many_internal_operations" + ~title:"Too many internal operations" + ~description: + "A transaction exceeded the hard limit of internal operations it can emit" + empty + (function Too_many_internal_operations -> Some () | _ -> None) + (fun () -> Too_many_internal_operations) ; + register_error_kind + `Temporary + ~id:"gas_exhausted.operation" + ~title:"Gas quota exceeded for the operation" + ~description: + "A script or one of its callee took more time than the operation said it \ + would" + empty + (function Operation_quota_exceeded -> Some () | _ -> None) + (fun () -> Operation_quota_exceeded) ; + register_error_kind + `Temporary + ~id:"gas_exhausted.block" + ~title:"Gas quota exceeded for the block" + ~description: + "The sum of gas consumed by all the operations in the block exceeds the \ + hard gas limit per block" + empty + (function Block_quota_exceeded -> Some () | _ -> None) + (fun () -> Block_quota_exceeded) ; + register_error_kind + `Permanent + ~id:"delegate.stake_distribution_not_set" + ~title:"Stake distribution not set" + ~description:"The stake distribution for the current cycle is not set." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The stake distribution for the current cycle is not set.") + empty + (function Stake_distribution_not_set -> Some () | _ -> None) + (fun () -> Stake_distribution_not_set) ; + register_error_kind + `Permanent + ~id:"sampler_already_set" + ~title:"Sampler already set" + ~description: + "Internal error: Raw_context.set_sampler_for_cycle was called twice for \ + a given cycle" + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Internal error: sampler already set for cycle %a." + Cycle_repr.pp + c) + (obj1 (req "cycle" Cycle_repr.encoding)) + (function Sampler_already_set c -> Some c | _ -> None) + (fun c -> Sampler_already_set c) + +let fresh_internal_nonce ctxt = + if Compare.Int.(internal_nonce ctxt >= 65_535) then + error Too_many_internal_operations + else + ok + (update_internal_nonce ctxt (internal_nonce ctxt + 1), internal_nonce ctxt) + +let reset_internal_nonce ctxt = + let ctxt = update_internal_nonce ctxt 0 in + update_internal_nonces_used ctxt Int_set.empty + +let record_internal_nonce ctxt k = + update_internal_nonces_used ctxt (Int_set.add k (internal_nonces_used ctxt)) + +let internal_nonce_already_recorded ctxt k = + Int_set.mem k (internal_nonces_used ctxt) + +let get_collected_fees ctxt = fees ctxt + +let credit_collected_fees_only_call_from_token ctxt fees' = + let previous = get_collected_fees ctxt in + Tez_repr.(previous +? fees') >|? fun fees -> update_fees ctxt fees + +let spend_collected_fees_only_call_from_token ctxt fees' = + let previous = get_collected_fees ctxt in + Tez_repr.(previous -? fees') >|? fun fees -> update_fees ctxt fees + +type error += Undefined_operation_nonce (* `Permanent *) + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"undefined_operation_nonce" + ~title:"Ill timed access to the origination nonce" + ~description: + "An origination was attempted out of the scope of a manager operation" + empty + (function Undefined_operation_nonce -> Some () | _ -> None) + (fun () -> Undefined_operation_nonce) + +let init_origination_nonce ctxt operation_hash = + let origination_nonce = Some (Origination_nonce.initial operation_hash) in + update_origination_nonce ctxt origination_nonce + +let increment_origination_nonce ctxt = + match origination_nonce ctxt with + | None -> error Undefined_operation_nonce + | Some cur_origination_nonce -> + let origination_nonce = + Some (Origination_nonce.incr cur_origination_nonce) + in + let ctxt = update_origination_nonce ctxt origination_nonce in + ok (ctxt, cur_origination_nonce) + +let get_origination_nonce ctxt = + match origination_nonce ctxt with + | None -> error Undefined_operation_nonce + | Some origination_nonce -> ok origination_nonce + +let unset_origination_nonce ctxt = update_origination_nonce ctxt None + +let gas_level ctxt = + let open Gas_limit_repr in + if unlimited_operation_gas ctxt then Unaccounted + else Limited {remaining = remaining_operation_gas ctxt} + +let block_gas_level = remaining_block_gas + +let consume_gas_limit_in_block ctxt gas_limit = + let open Gas_limit_repr in + check_gas_limit + ~hard_gas_limit_per_operation:(constants ctxt).hard_gas_limit_per_operation + ~gas_limit + >>? fun () -> + let block_gas = block_gas_level ctxt in + let limit = Arith.fp gas_limit in + if Arith.(limit > block_gas) then error Block_quota_exceeded + else + let level = Arith.sub (block_gas_level ctxt) limit in + let ctxt = update_remaining_block_gas ctxt level in + Ok ctxt + +let set_gas_limit ctxt (remaining : 'a Gas_limit_repr.Arith.t) = + let open Gas_limit_repr in + let remaining_operation_gas = Arith.fp remaining in + let ctxt = update_unlimited_operation_gas ctxt false in + {ctxt with remaining_operation_gas} + +let set_gas_unlimited ctxt = update_unlimited_operation_gas ctxt true + +let consume_gas ctxt cost = + match Gas_limit_repr.raw_consume (remaining_operation_gas ctxt) cost with + | Some gas_counter -> Ok (update_remaining_operation_gas ctxt gas_counter) + | None -> + if unlimited_operation_gas ctxt then ok ctxt + else error Operation_quota_exceeded + +let check_enough_gas ctxt cost = + consume_gas ctxt cost >>? fun (_ : t) -> Result.return_unit + +let gas_consumed ~since ~until = + match (gas_level since, gas_level until) with + | Limited {remaining = before}, Limited {remaining = after} -> + Gas_limit_repr.Arith.sub before after + | _, _ -> Gas_limit_repr.Arith.zero + +type missing_key_kind = Get | Set | Del | Copy + +type storage_error = + | Incompatible_protocol_version of string + | Missing_key of string list * missing_key_kind + | Existing_key of string list + | Corrupted_data of string list + +let storage_error_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Incompatible_protocol_version" + (obj1 (req "incompatible_protocol_version" @@ string Plain)) + (function Incompatible_protocol_version arg -> Some arg | _ -> None) + (fun arg -> Incompatible_protocol_version arg); + case + (Tag 1) + ~title:"Missing_key" + (obj2 + (req "missing_key" (list @@ string Plain)) + (req + "function" + (string_enum + [("get", Get); ("set", Set); ("del", Del); ("copy", Copy)]))) + (function Missing_key (key, f) -> Some (key, f) | _ -> None) + (fun (key, f) -> Missing_key (key, f)); + case + (Tag 2) + ~title:"Existing_key" + (obj1 (req "existing_key" (list @@ string Plain))) + (function Existing_key key -> Some key | _ -> None) + (fun key -> Existing_key key); + case + (Tag 3) + ~title:"Corrupted_data" + (obj1 (req "corrupted_data" (list @@ string Plain))) + (function Corrupted_data key -> Some key | _ -> None) + (fun key -> Corrupted_data key); + ] + +let pp_storage_error ppf = function + | Incompatible_protocol_version version -> + Format.fprintf + ppf + "Found a context with an unexpected version '%s'." + version + | Missing_key (key, Get) -> + Format.fprintf ppf "Missing key '%s'." (String.concat "/" key) + | Missing_key (key, Set) -> + Format.fprintf + ppf + "Cannot set undefined key '%s'." + (String.concat "/" key) + | Missing_key (key, Del) -> + Format.fprintf + ppf + "Cannot delete undefined key '%s'." + (String.concat "/" key) + | Missing_key (key, Copy) -> + Format.fprintf + ppf + "Cannot copy undefined key '%s'." + (String.concat "/" key) + | Existing_key key -> + Format.fprintf + ppf + "Cannot initialize defined key '%s'." + (String.concat "/" key) + | Corrupted_data key -> + Format.fprintf + ppf + "Failed to parse the data at '%s'." + (String.concat "/" key) + +type error += Storage_error of storage_error + +let () = + register_error_kind + `Permanent + ~id:"context.storage_error" + ~title:"Storage error (fatal internal error)" + ~description: + "An error that should never happen unless something has been deleted or \ + corrupted in the database." + ~pp:(fun ppf err -> + Format.fprintf ppf "@[<v 2>Storage error:@ %a@]" pp_storage_error err) + storage_error_encoding + (function Storage_error err -> Some err | _ -> None) + (fun err -> Storage_error err) + +let storage_error err = error (Storage_error err) + +(* Initialization *********************************************************) + +(* This key should always be populated for every version of the + protocol. It's absence meaning that the context is empty. *) +let version_key = ["version"] + +(* This value is set by the snapshot_alpha.sh script, don't change it. *) +let version_value = "mumbai_016" + +let version = "v1" + +let cycle_eras_key = [version; "cycle_eras"] + +let constants_key = [version; "constants"] + +let protocol_param_key = ["protocol_parameters"] + +let get_cycle_eras ctxt = + Context.find ctxt cycle_eras_key >|= function + | None -> storage_error (Missing_key (cycle_eras_key, Get)) + | Some bytes -> ( + match + Data_encoding.Binary.of_bytes_opt Level_repr.cycle_eras_encoding bytes + with + | None -> storage_error (Corrupted_data cycle_eras_key) + | Some cycle_eras -> ok cycle_eras) + +let set_cycle_eras ctxt cycle_eras = + let bytes = + Data_encoding.Binary.to_bytes_exn Level_repr.cycle_eras_encoding cycle_eras + in + Context.add ctxt cycle_eras_key bytes >|= ok + +type error += Failed_to_parse_parameter of bytes + +type error += Failed_to_decode_parameter of Data_encoding.json * string + +let () = + register_error_kind + `Temporary + ~id:"context.failed_to_parse_parameter" + ~title:"Failed to parse parameter" + ~description:"The protocol parameters are not valid JSON." + ~pp:(fun ppf bytes -> + Format.fprintf + ppf + "@[<v 2>Cannot parse the protocol parameter:@ %s@]" + (Bytes.to_string bytes)) + Data_encoding.(obj1 (req "contents" @@ bytes Hex)) + (function Failed_to_parse_parameter data -> Some data | _ -> None) + (fun data -> Failed_to_parse_parameter data) ; + register_error_kind + `Temporary + ~id:"context.failed_to_decode_parameter" + ~title:"Failed to decode parameter" + ~description:"Unexpected JSON object." + ~pp:(fun ppf (json, msg) -> + Format.fprintf + ppf + "@[<v 2>Cannot decode the protocol parameter:@ %s@ %a@]" + msg + Data_encoding.Json.pp + json) + Data_encoding.(obj2 (req "contents" json) (req "error" @@ string Plain)) + (function + | Failed_to_decode_parameter (json, msg) -> Some (json, msg) | _ -> None) + (fun (json, msg) -> Failed_to_decode_parameter (json, msg)) + +let get_proto_param ctxt = + Context.find ctxt protocol_param_key >>= function + | None -> failwith "Missing protocol parameters." + | Some bytes -> ( + match Data_encoding.Binary.of_bytes_opt Data_encoding.json bytes with + | None -> tzfail (Failed_to_parse_parameter bytes) + | Some json -> ( + Context.remove ctxt protocol_param_key >|= fun ctxt -> + match Data_encoding.Json.destruct Parameters_repr.encoding json with + | exception (Data_encoding.Json.Cannot_destruct _ as exn) -> + Format.kasprintf + failwith + "Invalid protocol_parameters: %a %a" + (fun ppf -> Data_encoding.Json.print_error ppf) + exn + Data_encoding.Json.pp + json + | param -> + Parameters_repr.check_params param >>? fun () -> ok (param, ctxt)) + ) + +let add_constants ctxt constants = + let bytes = + Data_encoding.Binary.to_bytes_exn + Constants_parametric_repr.encoding + constants + in + Context.add ctxt constants_key bytes + +let get_constants ctxt = + Context.find ctxt constants_key >|= function + | None -> failwith "Internal error: cannot read constants in context." + | Some bytes -> ( + match + Data_encoding.Binary.of_bytes_opt + Constants_parametric_repr.encoding + bytes + with + | None -> failwith "Internal error: cannot parse constants in context." + | Some constants -> ok constants) + +let patch_constants ctxt f = + let constants = f (constants ctxt) in + add_constants (context ctxt) constants >|= fun context -> + let ctxt = update_context ctxt context in + update_constants ctxt constants + +let check_inited ctxt = + Context.find ctxt version_key >|= function + | None -> failwith "Internal error: un-initialized context." + | Some bytes -> + let s = Bytes.to_string bytes in + if Compare.String.(s = version_value) then Result.return_unit + else storage_error (Incompatible_protocol_version s) + +let check_cycle_eras (cycle_eras : Level_repr.cycle_eras) + (constants : Constants_parametric_repr.t) = + let current_era = Level_repr.current_era cycle_eras in + assert ( + Compare.Int32.(current_era.blocks_per_cycle = constants.blocks_per_cycle)) ; + assert ( + Compare.Int32.( + current_era.blocks_per_commitment = constants.blocks_per_commitment)) + +let prepare ~level ~predecessor_timestamp ~timestamp ctxt = + Raw_level_repr.of_int32 level >>?= fun level -> + check_inited ctxt >>=? fun () -> + get_constants ctxt >>=? fun constants -> + Round_repr.Durations.create + ~first_round_duration:constants.minimal_block_delay + ~delay_increment_per_round:constants.delay_increment_per_round + >>?= fun round_durations -> + get_cycle_eras ctxt >|=? fun cycle_eras -> + check_cycle_eras cycle_eras constants ; + let level = Level_repr.level_from_raw ~cycle_eras level in + let sc_rollup_current_messages = + Sc_rollup_inbox_repr.init_witness_no_history + in + { + remaining_operation_gas = Gas_limit_repr.Arith.zero; + back = + { + context = ctxt; + constants; + level; + predecessor_timestamp; + timestamp; + round_durations; + cycle_eras; + fees = Tez_repr.zero; + origination_nonce = None; + temporary_lazy_storage_ids = Lazy_storage_kind.Temp_ids.init; + internal_nonce = 0; + internal_nonces_used = Int_set.empty; + remaining_block_gas = + Gas_limit_repr.Arith.fp + constants.Constants_parametric_repr.hard_gas_limit_per_block; + unlimited_operation_gas = true; + consensus = Raw_consensus.empty; + non_consensus_operations_rev = []; + dictator_proposal_seen = false; + sampler_state = Cycle_repr.Map.empty; + stake_distribution_for_current_cycle = None; + tx_rollup_current_messages = Tx_rollup_repr.Map.empty; + sc_rollup_current_messages; + dal_slot_fee_market = + Dal_slot_repr.Slot_market.init + ~length:constants.Constants_parametric_repr.dal.number_of_slots; + dal_attestation_slot_accountability = + Dal_attestation_repr.Accountability.init + ~length:constants.Constants_parametric_repr.dal.number_of_slots; + dal_committee = empty_dal_committee; + }; + } + +type previous_protocol = Genesis of Parameters_repr.t | Lima_015 + +let check_and_update_protocol_version ctxt = + (Context.find ctxt version_key >>= function + | None -> + failwith "Internal error: un-initialized context in check_first_block." + | Some bytes -> + let s = Bytes.to_string bytes in + if Compare.String.(s = version_value) then + failwith "Internal error: previously initialized context." + else if Compare.String.(s = "genesis") then + get_proto_param ctxt >|=? fun (param, ctxt) -> (Genesis param, ctxt) + else if Compare.String.(s = "lima_015") then return (Lima_015, ctxt) + else Lwt.return @@ storage_error (Incompatible_protocol_version s)) + >>=? fun (previous_proto, ctxt) -> + Context.add ctxt version_key (Bytes.of_string version_value) >|= fun ctxt -> + ok (previous_proto, ctxt) + +(* only for the migration *) +let[@warning "-32"] get_previous_protocol_constants ctxt = + Context.find ctxt constants_key >>= function + | None -> + failwith + "Internal error: cannot read previous protocol constants in context." + | Some bytes -> ( + match + Data_encoding.Binary.of_bytes_opt + Constants_parametric_previous_repr.encoding + bytes + with + | None -> + failwith + "Internal error: cannot parse previous protocol constants in \ + context." + | Some constants -> Lwt.return constants) + +let update_block_time_related_constants (c : Constants_parametric_repr.t) = + let divide_period p = + Period_repr.of_seconds_exn + Int64.(div (add (Period_repr.to_seconds p) 1L) 2L) + in + let minimal_block_delay = divide_period c.minimal_block_delay in + let delay_increment_per_round = divide_period c.delay_increment_per_round in + let hard_gas_limit_per_block = + let two = Z.(succ one) in + Gas_limit_repr.Arith.( + integral_exn (Z.div (integral_to_z c.hard_gas_limit_per_block) two)) + in + let Constants_repr.Generated. + { + consensus_threshold = _; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + } = + Constants_repr.Generated.generate + ~consensus_committee_size: + c.Constants_parametric_repr.consensus_committee_size + ~blocks_per_minute: + { + numerator = 60; + denominator = + minimal_block_delay |> Period_repr.to_seconds |> Int64.to_int; + } + in + let double = Int32.mul 2l in + let blocks_per_cycle = double c.blocks_per_cycle in + let blocks_per_commitment = double c.blocks_per_commitment in + let nonce_revelation_threshold = double c.nonce_revelation_threshold in + let blocks_per_stake_snapshot = double c.blocks_per_stake_snapshot in + let max_operations_time_to_live = 2 * c.max_operations_time_to_live in + { + c with + blocks_per_cycle; + blocks_per_commitment; + nonce_revelation_threshold; + blocks_per_stake_snapshot; + max_operations_time_to_live; + minimal_block_delay; + delay_increment_per_round; + hard_gas_limit_per_block; + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + } + +let update_cycle_eras ctxt level ~prev_blocks_per_cycle ~blocks_per_cycle + ~blocks_per_commitment = + get_cycle_eras ctxt >>=? fun cycle_eras -> + let current_era = Level_repr.current_era cycle_eras in + let current_cycle = + let level_position = + Int32.sub level (Raw_level_repr.to_int32 current_era.first_level) + in + Cycle_repr.add + current_era.first_cycle + (Int32.to_int (Int32.div level_position prev_blocks_per_cycle)) + in + let new_cycle_era = + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn (Int32.succ level); + first_cycle = Cycle_repr.succ current_cycle; + blocks_per_cycle; + blocks_per_commitment; + } + in + Level_repr.add_cycle_era new_cycle_era cycle_eras >>?= fun new_cycle_eras -> + set_cycle_eras ctxt new_cycle_eras + +(* You should ensure that if the type `Constants_parametric_repr.t` is + different from `Constants_parametric_previous_repr.t` or the value of these + constants is modified, is changed from the previous protocol, then + you `propagate` these constants to the new protocol by writing them + onto the context via the function `add_constants` or + `patch_constants`. + + This migration can be achieved also implicitly by modifying the + encoding directly in a way which is compatible with the previous + protocol. However, by doing so, you do not change the value of + these constants inside the context. *) +let prepare_first_block ~level ~timestamp ctxt = + check_and_update_protocol_version ctxt >>=? fun (previous_proto, ctxt) -> + (match previous_proto with + | Genesis param -> + Raw_level_repr.of_int32 level >>?= fun first_level -> + let cycle_era = + { + Level_repr.first_level; + first_cycle = Cycle_repr.root; + blocks_per_cycle = param.constants.blocks_per_cycle; + blocks_per_commitment = param.constants.blocks_per_commitment; + } + in + Level_repr.create_cycle_eras [cycle_era] >>?= fun cycle_eras -> + set_cycle_eras ctxt cycle_eras >>=? fun ctxt -> + add_constants ctxt param.constants >|= ok + | Lima_015 -> + get_previous_protocol_constants ctxt >>= fun c -> + let tx_rollup = + Constants_parametric_repr. + { + enable = c.tx_rollup.enable; + origination_size = c.tx_rollup.origination_size; + hard_size_limit_per_inbox = c.tx_rollup.hard_size_limit_per_inbox; + hard_size_limit_per_message = + c.tx_rollup.hard_size_limit_per_message; + max_withdrawals_per_batch = c.tx_rollup.max_withdrawals_per_batch; + max_ticket_payload_size = c.tx_rollup.max_ticket_payload_size; + commitment_bond = c.tx_rollup.commitment_bond; + finality_period = c.tx_rollup.finality_period; + withdraw_period = c.tx_rollup.withdraw_period; + max_inboxes_count = c.tx_rollup.max_inboxes_count; + max_messages_per_inbox = c.tx_rollup.max_messages_per_inbox; + max_commitments_count = c.tx_rollup.max_commitments_count; + cost_per_byte_ema_factor = c.tx_rollup.cost_per_byte_ema_factor; + rejection_max_proof_size = c.tx_rollup.rejection_max_proof_size; + sunset_level = c.tx_rollup.sunset_level; + } + in + let cryptobox_parameters = + { + Dal.page_size = 4096; + number_of_shards = 2048; + slot_size = 1 lsl 20; + redundancy_factor = 16; + } + in + let dal = + Constants_parametric_repr. + { + feature_enable = c.dal.feature_enable; + number_of_slots = c.dal.number_of_slots; + attestation_lag = c.dal.endorsement_lag; + availability_threshold = c.dal.availability_threshold; + cryptobox_parameters; + } + in + let sc_rollup = + Constants_parametric_repr. + { + enable = c.sc_rollup.enable; + origination_size = c.sc_rollup.origination_size; + challenge_window_in_blocks = c.sc_rollup.challenge_window_in_blocks; + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2756 + The following constants need to be refined. *) + stake_amount = c.sc_rollup.stake_amount; + commitment_period_in_blocks = + c.sc_rollup.commitment_period_in_blocks; + max_lookahead_in_blocks = c.sc_rollup.max_lookahead_in_blocks; + max_active_outbox_levels = c.sc_rollup.max_active_outbox_levels; + max_outbox_messages_per_level = + c.sc_rollup.max_outbox_messages_per_level; + number_of_sections_in_dissection = + c.sc_rollup.number_of_sections_in_dissection; + timeout_period_in_blocks = c.sc_rollup.timeout_period_in_blocks; + max_number_of_stored_cemented_commitments = + c.sc_rollup.max_number_of_stored_cemented_commitments; + max_number_of_parallel_games = 32; + } + in + let zk_rollup = + Constants_parametric_repr. + { + enable = c.zk_rollup.enable; + origination_size = c.zk_rollup.origination_size; + min_pending_to_process = c.zk_rollup.min_pending_to_process; + } + in + let constants = + Constants_parametric_repr. + { + preserved_cycles = c.preserved_cycles; + blocks_per_cycle = c.blocks_per_cycle; + blocks_per_commitment = c.blocks_per_commitment; + nonce_revelation_threshold = c.nonce_revelation_threshold; + blocks_per_stake_snapshot = c.blocks_per_stake_snapshot; + cycles_per_voting_period = c.cycles_per_voting_period; + hard_gas_limit_per_operation = c.hard_gas_limit_per_operation; + hard_gas_limit_per_block = c.hard_gas_limit_per_block; + proof_of_work_threshold = c.proof_of_work_threshold; + minimal_stake = c.minimal_stake; + vdf_difficulty = c.vdf_difficulty; + seed_nonce_revelation_tip = c.seed_nonce_revelation_tip; + origination_size = c.origination_size; + max_operations_time_to_live = c.max_operations_time_to_live; + baking_reward_fixed_portion = c.baking_reward_fixed_portion; + baking_reward_bonus_per_slot = c.baking_reward_bonus_per_slot; + endorsing_reward_per_slot = c.endorsing_reward_per_slot; + cost_per_byte = c.cost_per_byte; + hard_storage_limit_per_operation = + c.hard_storage_limit_per_operation; + quorum_min = c.quorum_min; + quorum_max = c.quorum_max; + min_proposal_quorum = c.min_proposal_quorum; + liquidity_baking_subsidy = c.liquidity_baking_subsidy; + liquidity_baking_toggle_ema_threshold = + c.liquidity_baking_toggle_ema_threshold; + minimal_block_delay = c.minimal_block_delay; + delay_increment_per_round = c.delay_increment_per_round; + consensus_committee_size = c.consensus_committee_size; + consensus_threshold = c.consensus_threshold; + minimal_participation_ratio = c.minimal_participation_ratio; + max_slashing_period = c.max_slashing_period; + frozen_deposits_percentage = c.frozen_deposits_percentage; + double_baking_punishment = c.double_baking_punishment; + ratio_of_frozen_deposits_slashed_per_double_endorsement = + c.ratio_of_frozen_deposits_slashed_per_double_endorsement; + (* The `testnet_dictator` should absolutely be None on mainnet *) + testnet_dictator = c.testnet_dictator; + initial_seed = c.initial_seed; + cache_script_size = c.cache_script_size; + cache_stake_distribution_cycles = c.cache_stake_distribution_cycles; + cache_sampler_state_cycles = c.cache_sampler_state_cycles; + tx_rollup; + dal; + sc_rollup; + zk_rollup; + } + in + let block_time_is_at_least_15s = + Compare.Int64.(Period_repr.to_seconds c.minimal_block_delay >= 15L) + in + (if block_time_is_at_least_15s then + let new_constants = update_block_time_related_constants constants in + update_cycle_eras + ctxt + level + ~prev_blocks_per_cycle:constants.blocks_per_cycle + ~blocks_per_cycle:new_constants.blocks_per_cycle + ~blocks_per_commitment:new_constants.blocks_per_commitment + >>=? fun ctxt -> return (ctxt, new_constants) + else return (ctxt, constants)) + >>=? fun (ctxt, constants) -> + add_constants ctxt constants >>= fun ctxt -> return ctxt) + >>=? fun ctxt -> + prepare ctxt ~level ~predecessor_timestamp:timestamp ~timestamp + >|=? fun ctxt -> (previous_proto, ctxt) + +let activate ctxt h = Updater.activate (context ctxt) h >|= update_context ctxt + +(* Generic context ********************************************************) + +type key = string list + +type value = bytes + +type tree = Context.tree + +module type T = + Raw_context_intf.T + with type root := root + and type key := key + and type value := value + and type tree := tree + +let mem ctxt k = Context.mem (context ctxt) k + +let mem_tree ctxt k = Context.mem_tree (context ctxt) k + +let get ctxt k = + Context.find (context ctxt) k >|= function + | None -> storage_error (Missing_key (k, Get)) + | Some v -> ok v + +let get_tree ctxt k = + Context.find_tree (context ctxt) k >|= function + | None -> storage_error (Missing_key (k, Get)) + | Some v -> ok v + +let find ctxt k = Context.find (context ctxt) k + +let find_tree ctxt k = Context.find_tree (context ctxt) k + +let add ctxt k v = Context.add (context ctxt) k v >|= update_context ctxt + +let add_tree ctxt k v = + Context.add_tree (context ctxt) k v >|= update_context ctxt + +let init ctxt k v = + Context.mem (context ctxt) k >>= function + | true -> Lwt.return @@ storage_error (Existing_key k) + | _ -> + Context.add (context ctxt) k v >|= fun context -> + ok (update_context ctxt context) + +let init_tree ctxt k v : _ tzresult Lwt.t = + Context.mem_tree (context ctxt) k >>= function + | true -> Lwt.return @@ storage_error (Existing_key k) + | _ -> + Context.add_tree (context ctxt) k v >|= fun context -> + ok (update_context ctxt context) + +let update ctxt k v = + Context.mem (context ctxt) k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Set)) + | _ -> + Context.add (context ctxt) k v >|= fun context -> + ok (update_context ctxt context) + +let update_tree ctxt k v = + Context.mem_tree (context ctxt) k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Set)) + | _ -> + Context.add_tree (context ctxt) k v >|= fun context -> + ok (update_context ctxt context) + +(* Verify that the key is present before deleting *) +let remove_existing ctxt k = + Context.mem (context ctxt) k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Del)) + | _ -> + Context.remove (context ctxt) k >|= fun context -> + ok (update_context ctxt context) + +(* Verify that the key is present before deleting *) +let remove_existing_tree ctxt k = + Context.mem_tree (context ctxt) k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Del)) + | _ -> + Context.remove (context ctxt) k >|= fun context -> + ok (update_context ctxt context) + +(* Do not verify before deleting *) +let remove ctxt k = Context.remove (context ctxt) k >|= update_context ctxt + +let add_or_remove ctxt k = function + | None -> remove ctxt k + | Some v -> add ctxt k v + +let add_or_remove_tree ctxt k = function + | None -> remove ctxt k + | Some v -> add_tree ctxt k v + +let list ctxt ?offset ?length k = Context.list (context ctxt) ?offset ?length k + +let fold ?depth ctxt k ~order ~init ~f = + Context.fold ?depth (context ctxt) k ~order ~init ~f + +let config ctxt = Context.config (context ctxt) + +module Proof = Context.Proof + +let length ctxt key = Context.length (context ctxt) key + +module Tree : + Raw_context_intf.TREE + with type t := t + and type key := key + and type value := value + and type tree := tree = struct + include Context.Tree + + let empty ctxt = Context.Tree.empty (context ctxt) + + let get t k = + find t k >|= function + | None -> storage_error (Missing_key (k, Get)) + | Some v -> ok v + + let get_tree t k = + find_tree t k >|= function + | None -> storage_error (Missing_key (k, Get)) + | Some v -> ok v + + let init t k v = + mem t k >>= function + | true -> Lwt.return @@ storage_error (Existing_key k) + | _ -> add t k v >|= ok + + let init_tree t k v = + mem_tree t k >>= function + | true -> Lwt.return @@ storage_error (Existing_key k) + | _ -> add_tree t k v >|= ok + + let update t k v = + mem t k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Set)) + | _ -> add t k v >|= ok + + let update_tree t k v = + mem_tree t k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Set)) + | _ -> add_tree t k v >|= ok + + (* Verify that the key is present before deleting *) + let remove_existing t k = + mem t k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Del)) + | _ -> remove t k >|= ok + + (* Verify that the key is present before deleting *) + let remove_existing_tree t k = + mem_tree t k >>= function + | false -> Lwt.return @@ storage_error (Missing_key (k, Del)) + | _ -> remove t k >|= ok + + let add_or_remove t k = function None -> remove t k | Some v -> add t k v + + let add_or_remove_tree t k = function + | None -> remove t k + | Some v -> add_tree t k v +end + +let verify_tree_proof proof f = Context.verify_tree_proof proof f + +let verify_stream_proof proof f = Context.verify_stream_proof proof f + +let equal_config = Context.equal_config + +let project x = x + +let absolute_key _ k = k + +let description = Storage_description.create () + +let fold_map_temporary_lazy_storage_ids ctxt f = + f (temporary_lazy_storage_ids ctxt) |> fun (temporary_lazy_storage_ids, x) -> + (update_temporary_lazy_storage_ids ctxt temporary_lazy_storage_ids, x) + +let map_temporary_lazy_storage_ids_s ctxt f = + f (temporary_lazy_storage_ids ctxt) + >|= fun (ctxt, temporary_lazy_storage_ids) -> + update_temporary_lazy_storage_ids ctxt temporary_lazy_storage_ids + +module Cache = struct + type key = Context.Cache.key + + type value = Context.Cache.value = .. + + let key_of_identifier = Context.Cache.key_of_identifier + + let identifier_of_key = Context.Cache.identifier_of_key + + let pp fmt ctxt = Context.Cache.pp fmt (context ctxt) + + let find c k = Context.Cache.find (context c) k + + let set_cache_layout c layout = + Context.Cache.set_cache_layout (context c) layout >>= fun ctxt -> + Lwt.return (update_context c ctxt) + + let update c k v = Context.Cache.update (context c) k v |> update_context c + + let sync c cache_nonce = + Context.Cache.sync (context c) ~cache_nonce >>= fun ctxt -> + Lwt.return (update_context c ctxt) + + let clear c = Context.Cache.clear (context c) |> update_context c + + let list_keys c ~cache_index = + Context.Cache.list_keys (context c) ~cache_index + + let key_rank c key = Context.Cache.key_rank (context c) key + + let cache_size_limit c ~cache_index = + Context.Cache.cache_size_limit (context c) ~cache_index + + let cache_size c ~cache_index = + Context.Cache.cache_size (context c) ~cache_index + + let future_cache_expectation c ~time_in_blocks = + Context.Cache.future_cache_expectation (context c) ~time_in_blocks + |> update_context c +end + +let record_non_consensus_operation_hash ctxt operation_hash = + update_non_consensus_operations_rev + ctxt + (operation_hash :: non_consensus_operations_rev ctxt) + +let non_consensus_operations ctxt = List.rev (non_consensus_operations_rev ctxt) + +let record_dictator_proposal_seen ctxt = update_dictator_proposal_seen ctxt true + +let dictator_proposal_seen ctxt = dictator_proposal_seen ctxt + +let init_sampler_for_cycle ctxt cycle seed state = + let map = sampler_state ctxt in + if Cycle_repr.Map.mem cycle map then error (Sampler_already_set cycle) + else + let map = Cycle_repr.Map.add cycle (seed, state) map in + let ctxt = update_sampler_state ctxt map in + ok ctxt + +let sampler_for_cycle ~read ctxt cycle = + let map = sampler_state ctxt in + match Cycle_repr.Map.find cycle map with + | Some (seed, state) -> return (ctxt, seed, state) + | None -> + read ctxt >>=? fun (seed, state) -> + let map = Cycle_repr.Map.add cycle (seed, state) map in + let ctxt = update_sampler_state ctxt map in + return (ctxt, seed, state) + +let stake_distribution_for_current_cycle ctxt = + match ctxt.back.stake_distribution_for_current_cycle with + | None -> error Stake_distribution_not_set + | Some s -> ok s + +let init_stake_distribution_for_current_cycle ctxt + stake_distribution_for_current_cycle = + update_back + ctxt + { + ctxt.back with + stake_distribution_for_current_cycle = + Some stake_distribution_for_current_cycle; + } + +module Internal_for_tests = struct + let add_level ctxt l = + let new_level = Level_repr.Internal_for_tests.add_level ctxt.back.level l in + let new_back = {ctxt.back with level = new_level} in + {ctxt with back = new_back} + + let add_cycles ctxt l = + let blocks_per_cycle = Int32.to_int (constants ctxt).blocks_per_cycle in + let new_level = + Level_repr.Internal_for_tests.add_cycles + ~blocks_per_cycle + ctxt.back.level + l + in + let new_back = {ctxt.back with level = new_level} in + {ctxt with back = new_back} +end + +module type CONSENSUS = sig + type t + + type 'value slot_map + + type slot_set + + type slot + + type round + + type consensus_pk + + val allowed_endorsements : t -> (consensus_pk * int) slot_map + + val allowed_preendorsements : t -> (consensus_pk * int) slot_map + + val current_endorsement_power : t -> int + + val initialize_consensus_operation : + t -> + allowed_endorsements:(consensus_pk * int) slot_map -> + allowed_preendorsements:(consensus_pk * int) slot_map -> + t + + val record_grand_parent_endorsement : + t -> Signature.Public_key_hash.t -> t tzresult + + val record_endorsement : t -> initial_slot:slot -> power:int -> t tzresult + + val record_preendorsement : + t -> initial_slot:slot -> power:int -> round -> t tzresult + + val endorsements_seen : t -> slot_set + + val get_preendorsements_quorum_round : t -> round option + + val set_preendorsements_quorum_round : t -> round -> t + + val locked_round_evidence : t -> (round * int) option + + val set_endorsement_branch : t -> Block_hash.t * Block_payload_hash.t -> t + + val endorsement_branch : t -> (Block_hash.t * Block_payload_hash.t) option + + val set_grand_parent_branch : t -> Block_hash.t * Block_payload_hash.t -> t + + val grand_parent_branch : t -> (Block_hash.t * Block_payload_hash.t) option +end + +module Consensus : + CONSENSUS + with type t := t + and type slot := Slot_repr.t + and type 'a slot_map := 'a Slot_repr.Map.t + and type slot_set := Slot_repr.Set.t + and type round := Round_repr.t + and type consensus_pk := consensus_pk = struct + let[@inline] allowed_endorsements ctxt = + ctxt.back.consensus.allowed_endorsements + + let[@inline] allowed_preendorsements ctxt = + ctxt.back.consensus.allowed_preendorsements + + let[@inline] current_endorsement_power ctxt = + ctxt.back.consensus.current_endorsement_power + + let[@inline] get_preendorsements_quorum_round ctxt = + ctxt.back.consensus.preendorsements_quorum_round + + let[@inline] locked_round_evidence ctxt = + Raw_consensus.locked_round_evidence ctxt.back.consensus + + let[@inline] update_consensus_with ctxt f = + {ctxt with back = {ctxt.back with consensus = f ctxt.back.consensus}} + + let[@inline] update_consensus_with_tzresult ctxt f = + f ctxt.back.consensus >|? fun consensus -> + {ctxt with back = {ctxt.back with consensus}} + + let[@inline] initialize_consensus_operation ctxt ~allowed_endorsements + ~allowed_preendorsements = + update_consensus_with + ctxt + (Raw_consensus.initialize_with_endorsements_and_preendorsements + ~allowed_endorsements + ~allowed_preendorsements) + + let[@inline] record_grand_parent_endorsement ctxt pkh = + update_consensus_with_tzresult ctxt (fun ctxt -> + Raw_consensus.record_grand_parent_endorsement ctxt pkh) + + let[@inline] record_preendorsement ctxt ~initial_slot ~power round = + update_consensus_with_tzresult + ctxt + (Raw_consensus.record_preendorsement ~initial_slot ~power round) + + let[@inline] record_endorsement ctxt ~initial_slot ~power = + update_consensus_with_tzresult + ctxt + (Raw_consensus.record_endorsement ~initial_slot ~power) + + let[@inline] endorsements_seen ctxt = ctxt.back.consensus.endorsements_seen + + let[@inline] set_preendorsements_quorum_round ctxt round = + update_consensus_with + ctxt + (Raw_consensus.set_preendorsements_quorum_round round) + + let[@inline] endorsement_branch ctxt = + Raw_consensus.endorsement_branch ctxt.back.consensus + + let[@inline] set_endorsement_branch ctxt branch = + update_consensus_with ctxt (fun ctxt -> + Raw_consensus.set_endorsement_branch ctxt branch) + + let[@inline] grand_parent_branch ctxt = + Raw_consensus.grand_parent_branch ctxt.back.consensus + + let[@inline] set_grand_parent_branch ctxt branch = + update_consensus_with ctxt (fun ctxt -> + Raw_consensus.set_grand_parent_branch ctxt branch) +end + +module Tx_rollup = struct + let add_message ctxt rollup message = + let root = ref Tx_rollup_inbox_repr.Merkle.(root empty) in + let updater element = + let tree = + Option.value element ~default:Tx_rollup_inbox_repr.Merkle.(empty) + in + let tree = Tx_rollup_inbox_repr.Merkle.add_message tree message in + root := Tx_rollup_inbox_repr.Merkle.root tree ; + Some tree + in + let map = + Tx_rollup_repr.Map.update + rollup + updater + ctxt.back.tx_rollup_current_messages + in + let back = {ctxt.back with tx_rollup_current_messages = map} in + ({ctxt with back}, !root) +end + +(* + To optimize message insertion in smart contract rollup inboxes, we + maintain the sequence of current messages of each rollup used in + the block in a in-memory map. +*) +module Sc_rollup_in_memory_inbox = struct + let current_messages ctxt = ctxt.back.sc_rollup_current_messages + + let set_current_messages ctxt witness = + {ctxt with back = {ctxt.back with sc_rollup_current_messages = witness}} +end + +module Dal = struct + type error += + | Dal_register_invalid_slot_header of { + length : int; + slot_header : Dal_slot_repr.Header.t; + } + + let () = + register_error_kind + `Permanent + ~id:"dal_register_invalid_slot" + ~title:"Dal register invalid slot" + ~description: + "Attempt to register a slot which is invalid (the index is out of \ + bounds)." + ~pp:(fun ppf (length, slot) -> + Format.fprintf + ppf + "The slot provided is invalid. Slot index should be between 0 and \ + %d. Found: %a." + length + Dal_slot_repr.Index.pp + slot.Dal_slot_repr.Header.id.index) + Data_encoding.( + obj2 + (req "length" int31) + (req "slot_header" Dal_slot_repr.Header.encoding)) + (function + | Dal_register_invalid_slot_header {length; slot_header} -> + Some (length, slot_header) + | _ -> None) + (fun (length, slot_header) -> + Dal_register_invalid_slot_header {length; slot_header}) + + let record_available_shards ctxt slots shards = + let dal_attestation_slot_accountability = + Dal_attestation_repr.Accountability.record_shards_availability + ctxt.back.dal_attestation_slot_accountability + slots + shards + in + {ctxt with back = {ctxt.back with dal_attestation_slot_accountability}} + + let register_slot_header ctxt slot_header = + match + Dal_slot_repr.Slot_market.register + ctxt.back.dal_slot_fee_market + slot_header + with + | None -> + let length = + Dal_slot_repr.Slot_market.length ctxt.back.dal_slot_fee_market + in + error (Dal_register_invalid_slot_header {length; slot_header}) + | Some (dal_slot_fee_market, updated) -> + ok ({ctxt with back = {ctxt.back with dal_slot_fee_market}}, updated) + + let candidates ctxt = + Dal_slot_repr.Slot_market.candidates ctxt.back.dal_slot_fee_market + + let is_slot_index_available ctxt = + let threshold = + ctxt.back.constants.Constants_parametric_repr.dal.availability_threshold + in + let number_of_shards = + ctxt.back.constants.Constants_parametric_repr.dal.cryptobox_parameters + .number_of_shards + in + Dal_attestation_repr.Accountability.is_slot_available + ctxt.back.dal_attestation_slot_accountability + ~threshold + ~number_of_shards + + type committee = dal_committee = { + pkh_to_shards : + (Dal_attestation_repr.shard_index * int) Signature.Public_key_hash.Map.t; + shard_to_pkh : Signature.Public_key_hash.t Dal_attestation_repr.Shard_map.t; + } + + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3110 + + A committee is selected by the callback function + [pkh_from_tenderbake_slot]. We use a callback because of circular + dependencies. It is not clear whether it will be the final choice + for the DAL committee. The current solution is a bit hackish but + should work. If we decide to differ from the Tenderbake + committee, one could just draw a new committee. + + The problem with drawing a new committee is that it is not + guaranteed that everyone in the DAL committee will be in the + Tenderbake committee. Consequently, either we decide to have a + new consensus operation which does not count for Tenderbake, + and/or we take into account for the model of DAL that at every + level, a percentage of DAL attestations cannot be received. *) + let compute_committee ctxt pkh_from_tenderbake_slot = + let Constants_parametric_repr. + { + dal = {cryptobox_parameters = {number_of_shards; _}; _}; + consensus_committee_size; + _; + } = + ctxt.back.constants + in + (* We first draw a committee by drawing slots from the Tenderbake + committee. To have a compact representation of slots, we can + sort the Tenderbake slots by [pkh], so that a committee is + actually only an interval. This is done by recomputing a + committee from the first one. *) + let update_committee committee pkh ~slot_index ~power = + { + pkh_to_shards = + Signature.Public_key_hash.Map.update + pkh + (function + | None -> Some (slot_index, power) + | Some (initial_shard_index, old_power) -> + Some (initial_shard_index, old_power + power)) + committee.pkh_to_shards; + shard_to_pkh = + List.fold_left + (fun shard_to_pkh slot -> + Dal_attestation_repr.Shard_map.add slot pkh shard_to_pkh) + committee.shard_to_pkh + Misc.(slot_index --> (slot_index + (power - 1))); + } + in + let rec compute_power index committee = + if Compare.Int.(index < 0) then return committee + else + let shard_index = index mod consensus_committee_size in + Slot_repr.of_int shard_index >>?= fun slot -> + pkh_from_tenderbake_slot slot >>=? fun (_ctxt, pkh) -> + (* The [Slot_repr] module is related to the Tenderbake committee. *) + let slot_index = Slot_repr.to_int slot in + (* An optimisation could be to return only [pkh_to_shards] map + because the second one is not used. This can be done later + on if it is a good optimisation. *) + let committee = update_committee committee pkh ~slot_index ~power:1 in + compute_power (index - 1) committee + in + (* This committee is an intermediate to compute the final DAL + commitee. This one only projects the Tenderbake committee into + the DAL committee. The next one reorder the slots so that they + are grouped by public key hash. *) + compute_power (number_of_shards - 1) empty_dal_committee + >>=? fun unordered_committee -> + let dal_committee = + Signature.Public_key_hash.Map.fold + (fun pkh (_, power) (total_power, committee) -> + let committee = + update_committee committee pkh ~slot_index:total_power ~power + in + let new_total_power = total_power + power in + (new_total_power, committee)) + unordered_committee.pkh_to_shards + (0, empty_dal_committee) + |> snd + in + return dal_committee + + let init_committee ctxt committee = + {ctxt with back = {ctxt.back with dal_committee = committee}} + + let shards_of_attestor ctxt ~attestor:pkh = + let rec make acc (initial_shard_index, power) = + if Compare.Int.(power <= 0) then List.rev acc + else make (initial_shard_index :: acc) (initial_shard_index + 1, power - 1) + in + Signature.Public_key_hash.Map.find_opt + pkh + ctxt.back.dal_committee.pkh_to_shards + |> Option.map (fun pre_shards -> make [] pre_shards) +end + +(* The type for relative context accesses instead from the root. In order for + the carbonated storage functions to consume the gas, this has gas infomation +*) +type local_context = { + tree : tree; + path : key; + remaining_operation_gas : Gas_limit_repr.Arith.fp; + unlimited_operation_gas : bool; +} + +let with_local_context ctxt key f = + (find_tree ctxt key >|= function None -> Tree.empty ctxt | Some tree -> tree) + >>= fun tree -> + let local_ctxt = + { + tree; + path = key; + remaining_operation_gas = remaining_operation_gas ctxt; + unlimited_operation_gas = unlimited_operation_gas ctxt; + } + in + f local_ctxt >>=? fun (local_ctxt, res) -> + add_tree ctxt key local_ctxt.tree >|= fun ctxt -> + update_remaining_operation_gas ctxt local_ctxt.remaining_operation_gas + |> fun ctxt -> + update_unlimited_operation_gas ctxt local_ctxt.unlimited_operation_gas + |> fun ctxt -> ok (ctxt, res) + +module Local_context : sig + include + Raw_context_intf.VIEW + with type t = local_context + and type key := key + and type value := value + and type tree := tree + + val consume_gas : + local_context -> Gas_limit_repr.cost -> local_context tzresult + + val absolute_key : local_context -> key -> key +end = struct + type t = local_context + + let consume_gas local cost = + match Gas_limit_repr.raw_consume local.remaining_operation_gas cost with + | Some gas_counter -> Ok {local with remaining_operation_gas = gas_counter} + | None -> + if local.unlimited_operation_gas then ok local + else error Operation_quota_exceeded + + let tree local = local.tree + + let update_root_tree local tree = {local with tree} + + let absolute_key local key = local.path @ key + + let find local = Tree.find (tree local) + + let find_tree local = Tree.find_tree (tree local) + + let mem local = Tree.mem (tree local) + + let mem_tree local = Tree.mem_tree (tree local) + + let get local = Tree.get (tree local) + + let get_tree local = Tree.get_tree (tree local) + + let update local key b = + Tree.update (tree local) key b >|=? update_root_tree local + + let update_tree local key b = + Tree.update_tree (tree local) key b >|=? update_root_tree local + + let init local key b = + Tree.init (tree local) key b >|=? update_root_tree local + + let init_tree local key t = + Tree.init_tree (tree local) key t >|=? update_root_tree local + + let add local i b = Tree.add (tree local) i b >|= update_root_tree local + + let add_tree local i t = + Tree.add_tree (tree local) i t >|= update_root_tree local + + let remove local i = Tree.remove (tree local) i >|= update_root_tree local + + let remove_existing local key = + Tree.remove_existing (tree local) key >|=? update_root_tree local + + let remove_existing_tree local key = + Tree.remove_existing_tree (tree local) key >|=? update_root_tree local + + let add_or_remove local key vopt = + Tree.add_or_remove (tree local) key vopt >|= update_root_tree local + + let add_or_remove_tree local key topt = + Tree.add_or_remove_tree (tree local) key topt >|= update_root_tree local + + let fold ?depth local key ~order ~init ~f = + Tree.fold ?depth (tree local) key ~order ~init ~f + + let list local ?offset ?length key = + Tree.list (tree local) ?offset ?length key + + let config local = Tree.config (tree local) + + let length local i = Tree.length (tree local) i +end diff --git a/src/proto_016_PtMumbai/lib_protocol/raw_context.mli b/src/proto_016_PtMumbai/lib_protocol/raw_context.mli new file mode 100644 index 000000000000..c181e1cf1296 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/raw_context.mli @@ -0,0 +1,475 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili tech, Inc. <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** State of the validation. + + Two parts: + + 1. Context.t: what is stored between blocks, this includes an + Irmin tree typically stored on disk and the cache (stored in + RAM). + + 2. Additional information needed during the validation of a + block but not persisted across blocks, always stored in + RAM. The gas counter is here. + + [Alpha_context.t] is actually implemented as [Raw_context.t]. + The difference is that Alpha_context.mli does not expose this + so functions manipulating an Alpha_context.t are guaranteed + to only access the context through the storage modules + exposed in Alpha_context.mli. These modules are in charge of + maintaining invariants over the structure of the context. *) + +(** {1 Errors} *) + +type error += Too_many_internal_operations (* `Permanent *) + +type missing_key_kind = Get | Set | Del | Copy + +(** An internal storage error that should not happen *) +type storage_error = + | Incompatible_protocol_version of string + | Missing_key of string list * missing_key_kind + | Existing_key of string list + | Corrupted_data of string list + +type error += Storage_error of storage_error + +type error += Failed_to_parse_parameter of bytes + +type error += Failed_to_decode_parameter of Data_encoding.json * string + +val storage_error : storage_error -> 'a tzresult + +(** {1 Abstract Context} *) + +(** Abstract view of the context. + Includes a handle to the functional key-value database + ({!Context.t}) along with some in-memory values (gas, etc.). *) +type t + +type root = t + +(** Retrieves the state of the database and gives its abstract view. + It also returns wether this is the first block validated + with this version of the protocol. *) +val prepare : + level:Int32.t -> + predecessor_timestamp:Time.t -> + timestamp:Time.t -> + Context.t -> + t tzresult Lwt.t + +type previous_protocol = Genesis of Parameters_repr.t | Lima_015 + +val prepare_first_block : + level:int32 -> + timestamp:Time.t -> + Context.t -> + (previous_protocol * t) tzresult Lwt.t + +val activate : t -> Protocol_hash.t -> t Lwt.t + +(** Returns the state of the database resulting of operations on its + abstract view *) +val recover : t -> Context.t + +val current_level : t -> Level_repr.t + +val predecessor_timestamp : t -> Time.t + +val current_timestamp : t -> Time.t + +val constants : t -> Constants_parametric_repr.t + +val tx_rollup : t -> Constants_parametric_repr.tx_rollup + +val sc_rollup : t -> Constants_parametric_repr.sc_rollup + +val zk_rollup : t -> Constants_parametric_repr.zk_rollup + +val patch_constants : + t -> (Constants_parametric_repr.t -> Constants_parametric_repr.t) -> t Lwt.t + +val round_durations : t -> Round_repr.Durations.t + +(** Retrieve the cycle eras. *) +val cycle_eras : t -> Level_repr.cycle_eras + +(** Increment the current block fee stash that will be credited to the payload + producer's account at finalize_application *) +val credit_collected_fees_only_call_from_token : t -> Tez_repr.t -> t tzresult + +(** Decrement the current block fee stash that will be credited to the payload + producer's account at finalize_application *) +val spend_collected_fees_only_call_from_token : t -> Tez_repr.t -> t tzresult + +(** Returns the current block fee stash that will be credited to the payload + producer's account at finalize_application *) +val get_collected_fees : t -> Tez_repr.t + +(** [consume_gas_limit_in_block ctxt gas_limit] checks that + [gas_limit] is well-formed (i.e. it does not exceed the hard gas + limit per operation as defined in [ctxt], and it is positive), then + consumes [gas_limit] in the current block gas level of [ctxt]. + + @return [Error Gas_limit_repr.Gas_limit_too_high] if [gas_limit] + is greater than the allowed limit for operation gas level or + negative. + + @return [Error Block_quota_exceeded] if not enough gas remains in + the block. *) +val consume_gas_limit_in_block : t -> 'a Gas_limit_repr.Arith.t -> t tzresult + +val set_gas_limit : t -> 'a Gas_limit_repr.Arith.t -> t + +val set_gas_unlimited : t -> t + +val gas_level : t -> Gas_limit_repr.t + +val gas_consumed : since:t -> until:t -> Gas_limit_repr.Arith.fp + +val remaining_operation_gas : t -> Gas_limit_repr.Arith.fp + +val update_remaining_operation_gas : t -> Gas_limit_repr.Arith.fp -> t + +val block_gas_level : t -> Gas_limit_repr.Arith.fp + +val update_remaining_block_gas : t -> Gas_limit_repr.Arith.fp -> t + +type error += Undefined_operation_nonce (* `Permanent *) + +(** [init_origination_nonce ctxt hash] initialise the origination nonce in + memory from [hash]. See [Origination_nonce.t] for more information. *) +val init_origination_nonce : t -> Operation_hash.t -> t + +val get_origination_nonce : t -> Origination_nonce.t tzresult + +val increment_origination_nonce : t -> (t * Origination_nonce.t) tzresult + +(** [unset_origination_nonce ctxt] unset the origination nonce in memory. To be + used only when no more origination can be done in that operation. See + [Origination_nonce.t] for more information. *) +val unset_origination_nonce : t -> t + +(** {1 Generic accessors} *) + +type key = string list + +type value = bytes + +type tree + +type local_context + +module type T = + Raw_context_intf.T + with type root := root + and type key := key + and type value := value + and type tree := tree + +include T with type t := t and type local_context := local_context + +(** Initialize the local nonce used for preventing a script to + duplicate an internal operation to replay it. *) +val reset_internal_nonce : t -> t + +(** Increments the internal operation nonce. *) +val fresh_internal_nonce : t -> (t * int) tzresult + +(** Mark an internal operation nonce as taken. *) +val record_internal_nonce : t -> int -> t + +(** Check is the internal operation nonce has been taken. *) +val internal_nonce_already_recorded : t -> int -> bool + +val fold_map_temporary_lazy_storage_ids : + t -> + (Lazy_storage_kind.Temp_ids.t -> Lazy_storage_kind.Temp_ids.t * 'res) -> + t * 'res + +val map_temporary_lazy_storage_ids_s : + t -> + (Lazy_storage_kind.Temp_ids.t -> (t * Lazy_storage_kind.Temp_ids.t) Lwt.t) -> + t Lwt.t + +module Cache : sig + include + Context.CACHE + with type t := t + and type size := int + and type index := int + and type identifier := string + and type key = Context.Cache.key + and type value = Context.Cache.value + + val sync : t -> bytes -> t Lwt.t +end + +(* Hashes of non-consensus operations are stored so that, when + finalizing the block, we can compute the block's payload hash. *) +val record_non_consensus_operation_hash : t -> Operation_hash.t -> t + +val non_consensus_operations : t -> Operation_hash.t list + +type consensus_pk = { + delegate : Signature.Public_key_hash.t; + consensus_pk : Signature.Public_key.t; + consensus_pkh : Signature.Public_key_hash.t; +} + +val consensus_pk_encoding : consensus_pk Data_encoding.t + +(** Record that the dictator already voted in this block. *) +val record_dictator_proposal_seen : t -> t + +(** Checks whether the dictator voted in this block. *) +val dictator_proposal_seen : t -> bool + +(** [init_sampler_for_cycle ctxt cycle seed state] caches the seeded stake + sampler (a.k.a. [seed, state]) for [cycle] in memory for quick access. *) +val init_sampler_for_cycle : + t -> Cycle_repr.t -> Seed_repr.seed -> consensus_pk Sampler.t -> t tzresult + +(** [sampler_for_cycle ~read ctxt cycle] returns the seeded stake + sampler for [cycle]. The sampler is read in memory if + [init_sampler_for_cycle] or [sampler_for_cycle] was previously + called for the same [cycle]. Otherwise, it is read "on-disk" with + the [read] function and then cached in [ctxt] like + [init_sampler_for_cycle]. *) +val sampler_for_cycle : + read:(t -> (Seed_repr.seed * consensus_pk Sampler.t) tzresult Lwt.t) -> + t -> + Cycle_repr.t -> + (t * Seed_repr.seed * consensus_pk Sampler.t) tzresult Lwt.t + +(* The stake distribution is stored both in [t] and in the cache. It + may be sufficient to only store it in the cache. *) +val stake_distribution_for_current_cycle : + t -> Tez_repr.t Signature.Public_key_hash.Map.t tzresult + +val init_stake_distribution_for_current_cycle : + t -> Tez_repr.t Signature.Public_key_hash.Map.t -> t + +module Internal_for_tests : sig + val add_level : t -> int -> t + + val add_cycles : t -> int -> t +end + +module type CONSENSUS = sig + type t + + type 'value slot_map + + type slot_set + + type slot + + type round + + type consensus_pk + + (** Returns a map where each endorser's pkh is associated to the + list of its endorsing slots (in decreasing order) for a given + level. *) + val allowed_endorsements : t -> (consensus_pk * int) slot_map + + (** Returns a map where each endorser's pkh is associated to the + list of its endorsing slots (in decreasing order) for a given + level. *) + val allowed_preendorsements : t -> (consensus_pk * int) slot_map + + (** [endorsement power ctx] returns the endorsement power of the + current block. *) + val current_endorsement_power : t -> int + + (** Initializes the map of allowed endorsements and preendorsements, + this function must be called only once and before applying + any consensus operation. *) + val initialize_consensus_operation : + t -> + allowed_endorsements:(consensus_pk * int) slot_map -> + allowed_preendorsements:(consensus_pk * int) slot_map -> + t + + (** [record_grand_parent_endorsement ctx pkh] records an + grand_parent_endorsement for the current block. This is only + useful for the partial construction mode. *) + val record_grand_parent_endorsement : + t -> Signature.Public_key_hash.t -> t tzresult + + (** [record_endorsement ctx ~initial_slot ~power] records an + endorsement for the current block. + + The endorsement should be valid in the sense that + [Int_map.find_opt initial_slot allowed_endorsement ctx = Some + (pkh, power)]. *) + val record_endorsement : t -> initial_slot:slot -> power:int -> t tzresult + + (** [record_preendorsement ctx ~initial_slot ~power round + payload_hash power] records a preendorsement for a proposal at + [round] with payload [payload_hash]. + + The preendorsement should be valid in the sense that + [Int_map.find_opt initial_slot allowed_preendorsement ctx = Some + (pkh, power)]. *) + val record_preendorsement : + t -> initial_slot:slot -> power:int -> round -> t tzresult + + val endorsements_seen : t -> slot_set + + (** [get_preendorsements_quorum_round ctx] returns [None] if no + preendorsement are included in the current block. Otherwise, + return [Some r] where [r] is the round of the preendorsements + included in the block. *) + val get_preendorsements_quorum_round : t -> round option + + (** [set_preendorsements_quorum_round ctx round] sets the round for + preendorsements included in this block. This function should be + called only once. + + This function is only used in [Full_construction] mode. *) + val set_preendorsements_quorum_round : t -> round -> t + + (** [locked_round_evidence ctx] returns the round of the recorded + preendorsements as well as their power. *) + val locked_round_evidence : t -> (round * int) option + + val set_endorsement_branch : t -> Block_hash.t * Block_payload_hash.t -> t + + val endorsement_branch : t -> (Block_hash.t * Block_payload_hash.t) option + + val set_grand_parent_branch : t -> Block_hash.t * Block_payload_hash.t -> t + + val grand_parent_branch : t -> (Block_hash.t * Block_payload_hash.t) option +end + +module Consensus : + CONSENSUS + with type t := t + and type slot := Slot_repr.t + and type 'a slot_map := 'a Slot_repr.Map.t + and type slot_set := Slot_repr.Set.t + and type round := Round_repr.t + and type consensus_pk := consensus_pk + +module Tx_rollup : sig + val add_message : + t -> + Tx_rollup_repr.t -> + Tx_rollup_message_hash_repr.t -> + t * Tx_rollup_inbox_repr.Merkle.root +end + +module Sc_rollup_in_memory_inbox : sig + val current_messages : t -> Sc_rollup_inbox_merkelized_payload_hashes_repr.t + + val set_current_messages : + t -> Sc_rollup_inbox_merkelized_payload_hashes_repr.t -> t +end + +module Dal : sig + (** [record_available_shards ctxt slots shards] records that the + list of shards [shards] were declared available. The function + assumes that a shard belongs to the interval [0; number_of_shards + - 1]. Otherwise, for each shard outside this interval, it is a + no-op. *) + val record_available_shards : t -> Dal_attestation_repr.t -> int list -> t + + (** [register_slot_header ctxt slot_header] returns a new context + where the new candidate [slot] have been taken into + account. Returns [Some (ctxt,updated)] where [updated=true] if + the candidate is registered. [Some (ctxt,false)] if another + candidate was already registered previously. Returns an error if + the slot is invalid. *) + val register_slot_header : t -> Dal_slot_repr.Header.t -> (t * bool) tzresult + + (** [candidates ctxt] returns the current list of slot for which + there is at least one candidate. *) + val candidates : t -> Dal_slot_repr.Header.t list + + (** [is_slot_index_available ctxt slot_index] returns [true] if the + [slot_index] is declared available by the protocol. [false] + otherwise. If the [index] is out of the interval + [0;number_of_slots - 1], returns [false]. *) + val is_slot_index_available : t -> Dal_slot_repr.Index.t -> bool + + (** [shards_of_attestor ctxt ~attestor] returns the shard assignment + of the DAL committee of the current level for [attestor]. This + function never returns an empty list. *) + val shards_of_attestor : + t -> attestor:Signature.Public_key_hash.t -> int list option + + (** The DAL committee is a subset of the Tenderbake committee. A + shard from [0;number_of_shards] is associated to a public key + hash. For efficiency reasons, the committee is two-folds: a + mapping public key hash to shards and shards to public key + hashes. The DAL committee ensures the shards associated to the + same public key hash are contiguous. The list of shards is + represented as two natural numbers [(initial, power)] which + encodes the list of shards: + [initial;initial + 1;...;initial + power - 1]. + + This data-type ensures the following invariants: + + - \forall pkh shard, find pkh_to_shards pkh = Some (start,n) -> + \forall i, i \in [start; start + n -1] -> find shard_to_pkh shard + = Some pkh + + - forall pkh shard, find shard_to_pkh shard = Some pkh -> + \exists (start,n), find pkh_to_shards pkh = Some (start,n) /\ + start <= shard <= start + n -1 + + - Given an attestor, all its shards assignement are contiguous + *) + type committee = { + pkh_to_shards : + (Dal_attestation_repr.shard_index * int) Signature.Public_key_hash.Map.t; + shard_to_pkh : Signature.Public_key_hash.t Dal_attestation_repr.Shard_map.t; + } + + (** [compute_committee ctxt pkh_from_tenderbake_slot] computes the + DAL committee using the [pkh_from_tenderbake_slot] function. This + functions takes into account the fact that the DAL committee and + the Tenderbake committee may have different size. If the DAL + committee is smaller, then we simply take a projection of the + Tenderbake committee for the first [n] slots. If the DAL + committee is larger, shards are computed moduloe the Tenderbake + committee. Slots assignements are reordered for a given a public + key hash, to ensure all the slots (or shards in the context of + DAL) shards are contiguous (see {!type:committee}). *) + val compute_committee : + t -> + (Slot_repr.t -> (t * Signature.Public_key_hash.t) tzresult Lwt.t) -> + committee tzresult Lwt.t + + (** [init_committee ctxt committee] returns a context where the + [committee] is cached. The committee is expected to be the one + for the current level. *) + val init_committee : t -> committee -> t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/raw_context_intf.ml b/src/proto_016_PtMumbai/lib_protocol/raw_context_intf.ml new file mode 100644 index 000000000000..fa4789f7c8bd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/raw_context_intf.ml @@ -0,0 +1,599 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2018-2021 Tarides <contact@tarides.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** All context manipulation functions. This signature is included + as-is for direct context accesses, and used in {!Storage_functors} + to provide restricted views to the context. *) + +(** The tree depth of a fold. See the [fold] function for more information. *) +type depth = [`Eq of int | `Le of int | `Lt of int | `Ge of int | `Gt of int] + +(** The type for context configuration. If two trees or stores have the + same configuration, they will generate the same context hash. *) +type config = Context.config + +module type VIEW = sig + (* Same as [Environment_context.VIEW] but with extra getters and + setters functions. *) + + (** The type for context views. *) + type t + + (** The type for context keys. *) + type key = string list + + (** The type for context values. *) + type value = bytes + + (** The type for context trees. *) + type tree + + (** {2 Getters} *) + + (** [mem t k] is an Lwt promise that resolves to [true] iff [k] is bound + to a value in [t]. *) + val mem : t -> key -> bool Lwt.t + + (** [mem_tree t k] is like {!mem} but for trees. *) + val mem_tree : t -> key -> bool Lwt.t + + (** [get t k] is an Lwt promise that resolves to [Ok v] if [k] is + bound to the value [v] in [t] and {!Storage_Error Missing_key} + otherwise. *) + val get : t -> key -> value tzresult Lwt.t + + (** [get_tree] is like {!get} but for trees. *) + val get_tree : t -> key -> tree tzresult Lwt.t + + (** [find t k] is an Lwt promise that resolves to [Some v] if [k] is + bound to the value [v] in [t] and [None] otherwise. *) + val find : t -> key -> value option Lwt.t + + (** [find_tree t k] is like {!find} but for trees. *) + val find_tree : t -> key -> tree option Lwt.t + + (** [list t key] is the list of files and sub-nodes stored under [k] in [t]. + The result order is not specified but is stable. + + [offset] and [length] are used for pagination. *) + val list : + t -> ?offset:int -> ?length:int -> key -> (string * tree) list Lwt.t + + (** {2 Setters} *) + + (** [init t k v] is an Lwt promise that resolves to [Ok c] if: + + - [k] is unbound in [t]; + - [k] is bound to [v] in [c]; + - and [c] is similar to [t] otherwise. + + It is {!Storage_error Existing_key} if [k] is already bound in [t]. *) + val init : t -> key -> value -> t tzresult Lwt.t + + (** [init_tree] is like {!init} but for trees. *) + val init_tree : t -> key -> tree -> t tzresult Lwt.t + + (** [update t k v] is an Lwt promise that resolves to [Ok c] if: + + - [k] is bound in [t]; + - [k] is bound to [v] in [c]; + - and [c] is similar to [t] otherwise. + + It is {!Storage_error Missing_key} if [k] is not already bound in [t]. *) + val update : t -> key -> value -> t tzresult Lwt.t + + (** [update_tree] is like {!update} but for trees. *) + val update_tree : t -> key -> tree -> t tzresult Lwt.t + + (** [add t k v] is an Lwt promise that resolves to [c] such that: + + - [k] is bound to [v] in [c]; + - and [c] is similar to [t] otherwise. + + If [k] was already bound in [t] to a value that is physically equal + to [v], the result of the function is a promise that resolves to + [t]. Otherwise, the previous binding of [k] in [t] disappears. *) + val add : t -> key -> value -> t Lwt.t + + (** [add_tree] is like {!add} but for trees. *) + val add_tree : t -> key -> tree -> t Lwt.t + + (** [remove t k v] is an Lwt promise that resolves to [c] such that: + + - [k] is unbound in [c]; + - and [c] is similar to [t] otherwise. *) + val remove : t -> key -> t Lwt.t + + (** [remove_existing t k v] is an Lwt promise that resolves to [Ok c] if: + + - [k] is bound in [t] to a value; + - [k] is unbound in [c]; + - and [c] is similar to [t] otherwise.*) + val remove_existing : t -> key -> t tzresult Lwt.t + + (** [remove_existing_tree t k v] is an Lwt promise that reolves to [Ok c] if: + + - [k] is bound in [t] to a tree; + - [k] is unbound in [c]; + - and [c] is similar to [t] otherwise.*) + val remove_existing_tree : t -> key -> t tzresult Lwt.t + + (** [add_or_remove t k v] is: + + - [add t k x] if [v] is [Some x]; + - [remove t k] otherwise. *) + val add_or_remove : t -> key -> value option -> t Lwt.t + + (** [add_or_remove_tree t k v] is: + + - [add_tree t k x] if [v] is [Some x]; + - [remove t k] otherwise. *) + val add_or_remove_tree : t -> key -> tree option -> t Lwt.t + + (** {2 Folds} *) + + (** [fold ?depth t root ~order ~init ~f] recursively folds over the trees + and values of [t]. The [f] callbacks are called with a key relative + to [root]. [f] is never called with an empty key for values; i.e., + folding over a value is a no-op. + + The depth is 0-indexed. If [depth] is set (by default it is not), then [f] + is only called when the conditions described by the parameter is true: + + - [Eq d] folds over nodes and values of depth exactly [d]. + - [Lt d] folds over nodes and values of depth strictly less than [d]. + - [Le d] folds over nodes and values of depth less than or equal to [d]. + - [Gt d] folds over nodes and values of depth strictly more than [d]. + - [Ge d] folds over nodes and values of depth more than or equal to [d]. + + If [order] is [`Sorted] (the default), the elements are traversed in + lexicographic order of their keys. For large nodes, it is memory-consuming, + use [`Undefined] for a more memory efficient [fold]. *) + val fold : + ?depth:depth -> + t -> + key -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> tree -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + (** {2 Hash configurations} *) + + (** [config t] is [t]'s hash configuration. *) + val config : t -> config + + (** [length t key] is an Lwt promise that resolves to the number of files and + sub-nodes stored under [k] in [t]. + + It is equivalent to [list t k >|= List.length] but has a constant-time + complexity. + + Most of the time, this function does not perform any I/O as the length is + cached in the tree. It may perform one read to load the root node of the + tree in case it has not been loaded already. The initial constant is the + same between [list] and [length]. They both perform the same kind of I/O + reads. While [list] usually performs a linear number of reads, [length] + does at most one. *) + val length : t -> key -> int Lwt.t +end + +module Kind = struct + type t = [`Value | `Tree] +end + +module type TREE = sig + (** [Tree] provides immutable, in-memory partial mirror of the + context, with lazy reads and delayed writes. The trees are Merkle + trees that carry the same hash as the part of the context they + mirror. + + Trees are immutable and non-persistent (they disappear if the + host crash), held in memory for efficiency, where reads are done + lazily and writes are done only when needed, e.g. on + [Context.commit]. If a key is modified twice, only the last + value will be written to disk on commit. *) + + (** The type for context views. *) + type t + + (** The type for context trees. *) + type tree + + include VIEW with type t := tree and type tree := tree + + (** [empty _] is the empty tree. *) + val empty : t -> tree + + (** [is_empty t] is true iff [t] is [empty _]. *) + val is_empty : tree -> bool + + (** [kind t] is [t]'s kind. It's either a tree node or a leaf + value. *) + val kind : tree -> Kind.t + + (** [to_value t] is an Lwt promise that resolves to [Some v] if [t] + is a leaf tree and [None] otherwise. It is equivalent to [find t + []]. *) + val to_value : tree -> value option Lwt.t + + (** [hash t] is [t]'s Merkle hash. *) + val hash : tree -> Context_hash.t + + (** [equal x y] is true iff [x] and [y] have the same Merkle hash. *) + val equal : tree -> tree -> bool + + (** {2 Caches} *) + + (** [clear ?depth t] clears all caches in the tree [t] for subtrees with a + depth higher than [depth]. If [depth] is not set, all of the subtrees are + cleared. *) + val clear : ?depth:int -> tree -> unit +end + +module type PROOF = sig + (** Proofs are compact representations of trees which can be shared + between peers. + + This is expected to be used as follows: + + - A first peer runs a function [f] over a tree [t]. While performing + this computation, it records: the hash of [t] (called [before] + below), the hash of [f t] (called [after] below) and a subset of [t] + which is needed to replay [f] without any access to the first peer's + storage. Once done, all these informations are packed into a proof of + type [t] that is sent to the second peer. + + - The second peer generates an initial tree [t'] from [p] and computes + [f t']. Once done, it compares [t']'s hash and [f t']'s hash to [before] + and [after]. If they match, they know that the result state [f t'] is a + valid context state, without having to have access to the full storage + of the first peer. *) + + (** The type for file and directory names. *) + type step = string + + (** The type for values. *) + type value = bytes + + (** The type of indices for inodes' children. *) + type index = int + + (** The type for hashes. *) + type hash = Context_hash.t + + (** The type for (internal) inode proofs. + + These proofs encode large directories into a tree-like structure. This + reflects irmin-pack's way of representing nodes and computing + hashes (tree-like representations for nodes scales better than flat + representations). + + [length] is the total number of entries in the children of the inode. + It's the size of the "flattened" version of that inode. [length] can be + used to prove the correctness of operations such [Tree.length] and + [Tree.list ~offset ~length] in an efficient way. + + In proofs with [version.is_binary = false], an inode at depth 0 has a + [length] of at least [257]. Below that threshold a [Node] tag is used in + [tree]. That threshold is [3] when [version.is_binary = true]. + + [proofs] contains the children proofs. It is a sparse list of ['a] values. + These values are associated to their index in the list, and the list is + kept sorted in increasing order of indices. ['a] can be a concrete proof + or a hash of that proof. + + In proofs with [version.is_binary = true], inodes have at most 2 proofs + (indexed 0 or 1). + + In proofs with [version.is_binary = false], inodes have at most 32 proofs + (indexed from 0 to 31). *) + type 'a inode = {length : int; proofs : (index * 'a) list} + + (** The type for inode extenders. + + An extender is a compact representation of a sequence of [inode] which + contain only one child. As for inodes, The ['a] parameter can be a + concrete proof or a hash of that proof. + + If an inode proof contains singleton children [i_0, ..., i_n] such as: + [{length=l; proofs = [ (i_0, {proofs = ... { proofs = [ (i_n, p) ] }})]}], + then it is compressed into the inode extender + [{length=l; segment = [i_0;..;i_n]; proof=p}] sharing the same lenght [l] + and final proof [p]. *) + type 'a inode_extender = {length : int; segment : index list; proof : 'a} + + (** The type for compressed and partial Merkle tree proofs. + + Tree proofs do not provide any guarantee with the ordering of + computations. For instance, if two effects commute, they won't be + distinguishable by this kind of proofs. + + [Value v] proves that a value [v] exists in the store. + + [Blinded_value h] proves a value with hash [h] exists in the store. + + [Node ls] proves that a a "flat" node containing the list of files [ls] + exists in the store. + + In proofs with [version.is_binary = true], the length of [ls] is at most + 2. + + In proofs with [version.is_binary = false], the length of [ls] is at most + 256. + + [Blinded_node h] proves that a node with hash [h] exists in the store. + + [Inode i] proves that an inode [i] exists in the store. + + [Extender e] proves that an inode extender [e] exist in the store. *) + type tree = + | Value of value + | Blinded_value of hash + | Node of (step * tree) list + | Blinded_node of hash + | Inode of inode_tree inode + | Extender of inode_tree inode_extender + + (** The type for inode trees. It is a subset of [tree], limited to nodes. + + [Blinded_inode h] proves that an inode with hash [h] exists in the store. + + [Inode_values ls] is similar to trees' [Node]. + + [Inode_tree i] is similar to tree's [Inode]. + + [Inode_extender e] is similar to trees' [Extender]. *) + and inode_tree = + | Blinded_inode of hash + | Inode_values of (step * tree) list + | Inode_tree of inode_tree inode + | Inode_extender of inode_tree inode_extender + + (** The type for kinded hashes. *) + type kinded_hash = [`Value of hash | `Node of hash] + + module Stream : sig + (** Stream proofs represent an explicit traversal of a Merle tree proof. + Every element (a node, a value, or a shallow pointer) met is first + "compressed" by shallowing its children and then recorded in the proof. + + As stream proofs directly encode the recursive construction of the + Merkle root hash is slightly simpler to implement: verifier simply + need to hash the compressed elements lazily, without any memory or + choice. + + Moreover, the minimality of stream proofs is trivial to check. + Once the computation has consumed the compressed elements required, + it is sufficient to check that no more compressed elements remain + in the proof. + + However, as the compressed elements contain all the hashes of their + shallow children, the size of stream proofs is larger + (at least double in size in practice) than tree proofs, which only + contains the hash for intermediate shallow pointers. *) + + (** The type for elements of stream proofs. + + [Value v] is a proof that the next element read in the store is the + value [v]. + + [Node n] is a proof that the next element read in the store is the + node [n]. + + [Inode i] is a proof that the next element read in the store is the + inode [i]. + + [Inode_extender e] is a proof that the next element read in the store + is the node extender [e]. *) + type elt = + | Value of value + | Node of (step * kinded_hash) list + | Inode of hash inode + | Inode_extender of hash inode_extender + + (** The type for stream proofs. + + The sequence [e_1 ... e_n] proves that the [e_1], ..., [e_n] are + read in the store in sequence. *) + type t = elt Seq.t + end + + type stream = Stream.t + + (** The type for proofs of kind ['a]. + + A proof [p] proves that the state advanced from [before p] to + [after p]. [state p]'s hash is [before p], and [state p] contains + the minimal information for the computation to reach [after p]. + + [version p] is the proof version, it packs several informations. + + [is_stream] discriminates between the stream proofs and the tree proofs. + + [is_binary] discriminates between proofs emitted from + [Tezos_context(_memory).Context_binary] and + [Tezos_context(_memory).Context]. + + It will also help discriminate between the data encoding techniques used. + + The version is meant to be decoded and encoded using the + {!Tezos_context_helpers.Context.decode_proof_version} and + {!Tezos_context_helpers.Context.encode_proof_version}. *) + type 'a t = { + version : int; + before : kinded_hash; + after : kinded_hash; + state : 'a; + } +end + +module type T = sig + (** The type for root contexts. *) + type root + + include VIEW + + module Tree : + TREE + with type t := t + and type key := key + and type value := value + and type tree := tree + + module Proof : PROOF + + (** [verify p f] runs [f] in checking mode. [f] is a function that takes a + tree as input and returns a new version of the tree and a result. [p] is a + proof, that is a minimal representation of the tree that contains what [f] + should be expecting. + + Therefore, contrary to trees found in a storage, the contents of the trees + passed to [f] may not be available. For this reason, looking up a value at + some [path] can now produce three distinct outcomes: + - A value [v] is present in the proof [p] and returned : [find tree path] + is a promise returning [Some v]; + - [path] is known to have no value in [tree] : [find tree path] is a + promise returning [None]; and + - [path] is known to have a value in [tree] but [p] does not provide it + because [f] should not need it: [verify] returns an error classifying + [path] as an invalid path (see below). + + The same semantics apply to all operations on the tree [t] passed to [f] + and on all operations on the trees built from [f]. + + The generated tree is the tree after [f] has completed. That tree is + disconnected from any storage (i.e. [index]). It is possible to run + operations on it as long as they don't require loading shallowed subtrees. + + The result is [Error (`Msg _)] if the proof is rejected: + - For tree proofs: when [p.before] is different from the hash of + [p.state]; + - For tree and stream proofs: when [p.after] is different from the hash + of [f p.state]; + - For tree proofs: when [f p.state] tries to access invalid paths in + [p.state]; + - For stream proofs: when the proof is not consumed in the exact same + order it was produced; + - For stream proofs: when the proof is too short or not empty once [f] is + done. + + @raise Failure if the proof version is invalid or incompatible with the + verifier. *) + type ('proof, 'result) verifier := + 'proof -> + (tree -> (tree * 'result) Lwt.t) -> + ( tree * 'result, + [ `Proof_mismatch of string + | `Stream_too_long of string + | `Stream_too_short of string ] ) + result + Lwt.t + + (** The type for tree proofs. + + Guarantee that the given computation performs exactly the same state + operations as the generating computation, *in some order*. *) + type tree_proof := Proof.tree Proof.t + + (** [verify_tree_proof] is the verifier of tree proofs. *) + val verify_tree_proof : (tree_proof, 'a) verifier + + (** The type for stream proofs. + + Guarantee that the given computation performs exactly the same state + operations as the generating computation, in the exact same order. *) + type stream_proof := Proof.stream Proof.t + + (** [verify_stream] is the verifier of stream proofs. *) + val verify_stream_proof : (stream_proof, 'a) verifier + + (** The equality function for context configurations. If two context have the + same configuration, they will generate the same context hashes. *) + val equal_config : config -> config -> bool + + (** Internally used in {!Storage_functors} to escape from a view. *) + val project : t -> root + + (** Internally used in {!Storage_functors} to retrieve a full key + from partial key relative a view. *) + val absolute_key : t -> key -> key + + (** Raised if block gas quota is exhausted during gas + consumption. *) + type error += Block_quota_exceeded + + (** Raised if operation gas quota is exhausted during gas + consumption. *) + type error += Operation_quota_exceeded + + (** Internally used in {!Storage_functors} to consume gas from + within a view. May raise {!Block_quota_exceeded} or + {!Operation_quota_exceeded}. *) + val consume_gas : t -> Gas_limit_repr.cost -> t tzresult + + (** Check if consume_gas will fail *) + val check_enough_gas : t -> Gas_limit_repr.cost -> unit tzresult + + val description : t Storage_description.t + + (** The type for local context accesses instead from the root. In order for + the carbonated storage functions to consume the gas, this has gas + infomation *) + type local_context + + (** + [with_local_context ctxt key f] runs function [f] over the local + context at path [key] of the global [ctxt]. Using the local context [f] + can perform faster context accesses under [key]. + *) + val with_local_context : + t -> + key -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (t * 'a) tzresult Lwt.t + + (** [Local_context] provides functions for local access from a specific + directory. *) + module Local_context : sig + include + VIEW + with type t = local_context + and type tree := tree + and type key := key + and type value := value + + (** Internally used in {!Storage_functors} to consume gas from + within a view. May raise {!Block_quota_exceeded} or + {!Operation_quota_exceeded}. *) + val consume_gas : + local_context -> Gas_limit_repr.cost -> local_context tzresult + + (** Internally used in {!Storage_functors} to retrieve the full key of a + partial key relative to the [local_context]. *) + val absolute_key : local_context -> key -> key + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.ml b/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.ml new file mode 100644 index 000000000000..24ac0327882e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.ml @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = int32 + +type raw_level = t + +include (Compare.Int32 : Compare.S with type t := t) + +module Set = Set.Make (Compare.Int32) +module Map = Map.Make (Compare.Int32) + +let pp ppf level = Format.fprintf ppf "%ld" level + +let rpc_arg = + let construct raw_level = Int32.to_string raw_level in + let destruct str = + Int32.of_string_opt str |> Option.to_result ~none:"Cannot parse level" + in + RPC_arg.make + ~descr:"A level integer" + ~name:"block_level" + ~construct + ~destruct + () + +let root = 0l + +let succ = Int32.succ + +let add l i = + assert (Compare.Int.(i >= 0)) ; + Int32.add l (Int32.of_int i) + +let sub l i = + assert (Compare.Int.(i >= 0)) ; + let res = Int32.sub l (Int32.of_int i) in + if Compare.Int32.(res >= 0l) then Some res else None + +let pred l = if l = 0l then None else Some (Int32.pred l) + +let diff = Int32.sub + +let to_int32 l = l + +let to_int32_non_negative l = + match Bounded.Non_negative_int32.of_value l with + | Some x -> x + | _ -> assert false (* invariant: raw_levels are non-negative *) + +type error += Unexpected_level of Int32.t (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"unexpected_level" + ~title:"Unexpected level" + ~description:"Level must be non-negative." + ~pp:(fun ppf l -> + Format.fprintf + ppf + "The level is %s but should be non-negative." + (Int32.to_string l)) + Data_encoding.(obj1 (req "level" int32)) + (function Unexpected_level l -> Some l | _ -> None) + (fun l -> Unexpected_level l) + +let of_int32 l = + if Compare.Int32.(l >= 0l) then ok l else error (Unexpected_level l) + +let of_int32_exn l = + match of_int32 l with + | Ok l -> l + | Error _ -> invalid_arg "Level_repr.of_int32" + +let of_int32_non_negative l = + match of_int32 (Bounded.Non_negative_int32.to_value l) with + | Ok l -> l + | Error _ -> assert false (* invariant: raw_levels are non-negative *) + +let encoding = + Data_encoding.conv_with_guard + to_int32 + (fun l -> + match of_int32 l with + | Ok l -> Ok l + | Error _ -> Error "Level_repr.of_int32") + Data_encoding.int32 + +module Index = struct + type t = raw_level + + let path_length = 1 + + let to_path level l = Int32.to_string level :: l + + let of_path = function [s] -> Int32.of_string_opt s | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end diff --git a/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.mli b/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.mli new file mode 100644 index 000000000000..cdfcb175d57d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/raw_level_repr.mli @@ -0,0 +1,72 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The shell's notion of a level: an integer indicating the number of blocks + since genesis: genesis is 0, all other blocks have increasing levels from + there. *) +type t + +type raw_level = t + +module Set : Set.S with type elt = t + +module Map : Map.S with type key = t + +(** @raise Invalid_argument when the level to encode is not positive *) +val encoding : raw_level Data_encoding.t + +val rpc_arg : raw_level RPC_arg.arg + +val pp : Format.formatter -> raw_level -> unit + +include Compare.S with type t := raw_level + +val to_int32 : raw_level -> int32 + +val to_int32_non_negative : raw_level -> Bounded.Non_negative_int32.t + +(** @raise Invalid_argument when the level to encode is negative *) +val of_int32_exn : int32 -> raw_level + +(** Can trigger Unexpected_level error when the level to encode is negative *) +val of_int32 : int32 -> raw_level tzresult + +val of_int32_non_negative : Bounded.Non_negative_int32.t -> raw_level + +val diff : raw_level -> raw_level -> int32 + +val root : raw_level + +val succ : raw_level -> raw_level + +val pred : raw_level -> raw_level option + +(** [add l i] i must be positive *) +val add : raw_level -> int -> raw_level + +(** [sub l i] i must be positive *) +val sub : raw_level -> int -> raw_level option + +module Index : Storage_description.INDEX with type t = raw_level diff --git a/src/proto_016_PtMumbai/lib_protocol/receipt_repr.ml b/src/proto_016_PtMumbai/lib_protocol/receipt_repr.ml new file mode 100644 index 000000000000..4d8bfa8e7a87 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/receipt_repr.ml @@ -0,0 +1,439 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type balance = + | Contract of Contract_repr.t + | Block_fees + | Deposits of Signature.Public_key_hash.t + | Nonce_revelation_rewards + | Double_signing_evidence_rewards + | Endorsing_rewards + | Baking_rewards + | Baking_bonuses + | Storage_fees + | Double_signing_punishments + | Lost_endorsing_rewards of Signature.Public_key_hash.t * bool * bool + | Liquidity_baking_subsidies + | Burned + | Commitments of Blinded_public_key_hash.t + | Bootstrap + | Invoice + | Initial_commitments + | Minted + | Frozen_bonds of Contract_repr.t * Bond_id_repr.t + | Tx_rollup_rejection_punishments + | Tx_rollup_rejection_rewards + | Sc_rollup_refutation_punishments + | Sc_rollup_refutation_rewards + +let balance_encoding = + let open Data_encoding in + def "operation_metadata.alpha.balance" + @@ union + [ + case + (Tag 0) + ~title:"Contract" + (obj2 + (req "kind" (constant "contract")) + (req "contract" Contract_repr.encoding)) + (function Contract c -> Some ((), c) | _ -> None) + (fun ((), c) -> Contract c); + case + (Tag 2) + ~title:"Block_fees" + (obj2 + (req "kind" (constant "accumulator")) + (req "category" (constant "block fees"))) + (function Block_fees -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Block_fees); + case + (Tag 4) + ~title:"Deposits" + (obj3 + (req "kind" (constant "freezer")) + (req "category" (constant "deposits")) + (req "delegate" Signature.Public_key_hash.encoding)) + (function Deposits d -> Some ((), (), d) | _ -> None) + (fun ((), (), d) -> Deposits d); + case + (Tag 5) + ~title:"Nonce_revelation_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "nonce revelation rewards"))) + (function Nonce_revelation_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Nonce_revelation_rewards); + case + (Tag 6) + ~title:"Double_signing_evidence_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "double signing evidence rewards"))) + (function + | Double_signing_evidence_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Double_signing_evidence_rewards); + case + (Tag 7) + ~title:"Endorsing_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "endorsing rewards"))) + (function Endorsing_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Endorsing_rewards); + case + (Tag 8) + ~title:"Baking_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "baking rewards"))) + (function Baking_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Baking_rewards); + case + (Tag 9) + ~title:"Baking_bonuses" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "baking bonuses"))) + (function Baking_bonuses -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Baking_bonuses); + case + (Tag 11) + ~title:"Storage_fees" + (obj2 + (req "kind" (constant "burned")) + (req "category" (constant "storage fees"))) + (function Storage_fees -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Storage_fees); + case + (Tag 12) + ~title:"Double_signing_punishments" + (obj2 + (req "kind" (constant "burned")) + (req "category" (constant "punishments"))) + (function Double_signing_punishments -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Double_signing_punishments); + case + (Tag 13) + ~title:"Lost_endorsing_rewards" + (obj5 + (req "kind" (constant "burned")) + (req "category" (constant "lost endorsing rewards")) + (req "delegate" Signature.Public_key_hash.encoding) + (req "participation" Data_encoding.bool) + (req "revelation" Data_encoding.bool)) + (function + | Lost_endorsing_rewards (d, p, r) -> Some ((), (), d, p, r) + | _ -> None) + (fun ((), (), d, p, r) -> Lost_endorsing_rewards (d, p, r)); + case + (Tag 14) + ~title:"Liquidity_baking_subsidies" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "subsidy"))) + (function Liquidity_baking_subsidies -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Liquidity_baking_subsidies); + case + (Tag 15) + ~title:"Burned" + (obj2 + (req "kind" (constant "burned")) + (req "category" (constant "burned"))) + (function Burned -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Burned); + case + (Tag 16) + ~title:"Commitments" + (obj3 + (req "kind" (constant "commitment")) + (req "category" (constant "commitment")) + (req "committer" Blinded_public_key_hash.encoding)) + (function Commitments bpkh -> Some ((), (), bpkh) | _ -> None) + (fun ((), (), bpkh) -> Commitments bpkh); + case + (Tag 17) + ~title:"Bootstrap" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "bootstrap"))) + (function Bootstrap -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Bootstrap); + case + (Tag 18) + ~title:"Invoice" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "invoice"))) + (function Invoice -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Invoice); + case + (Tag 19) + ~title:"Initial_commitments" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "commitment"))) + (function Initial_commitments -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Initial_commitments); + case + (Tag 20) + ~title:"Minted" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "minted"))) + (function Minted -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Minted); + case + (Tag 21) + ~title:"Frozen_bonds" + (obj4 + (req "kind" (constant "freezer")) + (req "category" (constant "bonds")) + (req "contract" Contract_repr.encoding) + (req "bond_id" Bond_id_repr.encoding)) + (function Frozen_bonds (c, r) -> Some ((), (), c, r) | _ -> None) + (fun ((), (), c, r) -> Frozen_bonds (c, r)); + case + (Tag 22) + ~title:"Tx_rollup_rejection_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "tx_rollup_rejection_rewards"))) + (function Tx_rollup_rejection_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Tx_rollup_rejection_rewards); + case + (Tag 23) + ~title:"Tx_rollup_rejection_punishments" + (obj2 + (req "kind" (constant "burned")) + (req "category" (constant "tx_rollup_rejection_punishments"))) + (function + | Tx_rollup_rejection_punishments -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Tx_rollup_rejection_punishments); + case + (Tag 24) + ~title:"Sc_rollup_refutation_punishments" + (obj2 + (req "kind" (constant "burned")) + (req "category" (constant "sc_rollup_refutation_punishments"))) + (function + | Sc_rollup_refutation_punishments -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Sc_rollup_refutation_punishments); + case + (Tag 25) + ~title:"Sc_rollup_refutation_rewards" + (obj2 + (req "kind" (constant "minted")) + (req "category" (constant "sc_rollup_refutation_rewards"))) + (function + | Sc_rollup_refutation_rewards -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Sc_rollup_refutation_rewards); + ] + +let is_not_zero c = not (Compare.Int.equal c 0) + +let compare_balance ba bb = + match (ba, bb) with + | Contract ca, Contract cb -> Contract_repr.compare ca cb + | Deposits pkha, Deposits pkhb -> Signature.Public_key_hash.compare pkha pkhb + | Lost_endorsing_rewards (pkha, pa, ra), Lost_endorsing_rewards (pkhb, pb, rb) + -> + let c = Signature.Public_key_hash.compare pkha pkhb in + if is_not_zero c then c + else + let c = Compare.Bool.compare pa pb in + if is_not_zero c then c else Compare.Bool.compare ra rb + | Commitments bpkha, Commitments bpkhb -> + Blinded_public_key_hash.compare bpkha bpkhb + | Frozen_bonds (ca, ra), Frozen_bonds (cb, rb) -> + let c = Contract_repr.compare ca cb in + if is_not_zero c then c else Bond_id_repr.compare ra rb + | _, _ -> + let index b = + match b with + | Contract _ -> 0 + | Block_fees -> 1 + | Deposits _ -> 2 + | Nonce_revelation_rewards -> 3 + | Double_signing_evidence_rewards -> 4 + | Endorsing_rewards -> 5 + | Baking_rewards -> 6 + | Baking_bonuses -> 7 + | Storage_fees -> 8 + | Double_signing_punishments -> 9 + | Lost_endorsing_rewards _ -> 10 + | Liquidity_baking_subsidies -> 11 + | Burned -> 12 + | Commitments _ -> 13 + | Bootstrap -> 14 + | Invoice -> 15 + | Initial_commitments -> 16 + | Minted -> 17 + | Frozen_bonds _ -> 18 + | Tx_rollup_rejection_punishments -> 19 + | Tx_rollup_rejection_rewards -> 20 + | Sc_rollup_refutation_punishments -> 21 + | Sc_rollup_refutation_rewards -> 22 + (* don't forget to add parameterized cases in the first part of the function *) + in + Compare.Int.compare (index ba) (index bb) + +type balance_update = Debited of Tez_repr.t | Credited of Tez_repr.t + +let is_zero_update = function Debited t | Credited t -> Tez_repr.(t = zero) + +let balance_update_encoding = + let open Data_encoding in + def "operation_metadata.alpha.balance_update" + @@ obj1 + (req + "change" + (conv + (function + | Credited v -> Tez_repr.to_mutez v + | Debited v -> Int64.neg (Tez_repr.to_mutez v)) + ( Json.wrap_error @@ fun v -> + if Compare.Int64.(v < 0L) then + match Tez_repr.of_mutez (Int64.neg v) with + | Some v -> Debited v + | None -> assert false (* [of_mutez z] is [None] iff [z < 0] *) + else + match Tez_repr.of_mutez v with + | Some v -> Credited v + | None -> assert false (* same *) ) + int64)) + +type update_origin = + | Block_application + | Protocol_migration + | Subsidy + | Simulation + +let compare_update_origin oa ob = + let index o = + match o with + | Block_application -> 0 + | Protocol_migration -> 1 + | Subsidy -> 2 + | Simulation -> 3 + in + Compare.Int.compare (index oa) (index ob) + +let update_origin_encoding = + let open Data_encoding in + def "operation_metadata.alpha.update_origin" + @@ obj1 @@ req "origin" + @@ union + [ + case + (Tag 0) + ~title:"Block_application" + (constant "block") + (function Block_application -> Some () | _ -> None) + (fun () -> Block_application); + case + (Tag 1) + ~title:"Protocol_migration" + (constant "migration") + (function Protocol_migration -> Some () | _ -> None) + (fun () -> Protocol_migration); + case + (Tag 2) + ~title:"Subsidy" + (constant "subsidy") + (function Subsidy -> Some () | _ -> None) + (fun () -> Subsidy); + case + (Tag 3) + ~title:"Simulation" + (constant "simulation") + (function Simulation -> Some () | _ -> None) + (fun () -> Simulation); + ] + +type balance_updates = (balance * balance_update * update_origin) list + +let balance_updates_encoding = + let open Data_encoding in + def "operation_metadata.alpha.balance_updates" + @@ list + (conv + (function + | balance, balance_update, update_origin -> + ((balance, balance_update), update_origin)) + (fun ((balance, balance_update), update_origin) -> + (balance, balance_update, update_origin)) + (merge_objs + (merge_objs balance_encoding balance_update_encoding) + update_origin_encoding)) + +module BalanceMap = struct + include Map.Make (struct + type t = balance * update_origin + + let compare (ba, ua) (bb, ub) = + let c = compare_balance ba bb in + if is_not_zero c then c else compare_update_origin ua ub + end) + + let update_r key (f : 'a option -> 'b option tzresult) map = + f (find key map) >>? function + | Some v -> ok (add key v map) + | None -> ok (remove key map) +end + +let group_balance_updates balance_updates = + List.fold_left_e + (fun acc (b, update, o) -> + (* Do not do anything if the update is zero *) + if is_zero_update update then ok acc + else + BalanceMap.update_r + (b, o) + (function + | None -> ok (Some update) + | Some balance -> ( + match (balance, update) with + | Credited a, Debited b | Debited b, Credited a -> + (* Remove the binding since it just fell down to zero *) + if Tez_repr.(a = b) then ok None + else if Tez_repr.(a > b) then + Tez_repr.(a -? b) >>? fun update -> + ok (Some (Credited update)) + else + Tez_repr.(b -? a) >>? fun update -> + ok (Some (Debited update)) + | Credited a, Credited b -> + Tez_repr.(a +? b) >>? fun update -> + ok (Some (Credited update)) + | Debited a, Debited b -> + Tez_repr.(a +? b) >>? fun update -> + ok (Some (Debited update)))) + acc) + BalanceMap.empty + balance_updates + >>? fun map -> + ok (BalanceMap.fold (fun (b, o) u acc -> (b, u, o) :: acc) map []) diff --git a/src/proto_016_PtMumbai/lib_protocol/receipt_repr.mli b/src/proto_016_PtMumbai/lib_protocol/receipt_repr.mli new file mode 100644 index 000000000000..d651c9f33560 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/receipt_repr.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Places where tez can be found in the ledger's state. *) +type balance = + | Contract of Contract_repr.t + | Block_fees + | Deposits of Signature.Public_key_hash.t + | Nonce_revelation_rewards + | Double_signing_evidence_rewards + | Endorsing_rewards + | Baking_rewards + | Baking_bonuses + | Storage_fees + | Double_signing_punishments + | Lost_endorsing_rewards of Signature.Public_key_hash.t * bool * bool + | Liquidity_baking_subsidies + | Burned + | Commitments of Blinded_public_key_hash.t + | Bootstrap + | Invoice + | Initial_commitments + | Minted + | Frozen_bonds of Contract_repr.t * Bond_id_repr.t + | Tx_rollup_rejection_punishments + | Tx_rollup_rejection_rewards + | Sc_rollup_refutation_punishments + | Sc_rollup_refutation_rewards + +(** Compares two balances. *) +val compare_balance : balance -> balance -> int + +(** A credit or debit of tez to a balance. *) +type balance_update = Debited of Tez_repr.t | Credited of Tez_repr.t + +(** An origin of a balance update *) +type update_origin = + | Block_application (** Update from a block application *) + | Protocol_migration (** Update from a protocol migration *) + | Subsidy (** Update from an inflationary subsidy *) + | Simulation (** Simulation of an operation **) + +(** Compares two origins. *) +val compare_update_origin : update_origin -> update_origin -> int + +(** A list of balance updates. Duplicates may happen. + For example, an entry of the form [(Rewards (b,c), Credited am, ...)] + indicates that the balance of frozen rewards has been increased by [am] + for baker [b] and cycle [c]. *) +type balance_updates = (balance * balance_update * update_origin) list + +(** The property [Json.destruct (Json.construct balance_updates) = balance_updates] + does not always hold for [balance_updates_encoding] when [balance_updates] + contains entries of the form [(_, _ Tez_repr.zero, _)]. This is because the + [balance_update] [(_ Tez_repr.zero)] always decodes into [(Credited Tez_repr.zero)]. *) +val balance_updates_encoding : balance_updates Data_encoding.t + +(** Group updates by (balance x origin), and remove zero-valued balances. *) +val group_balance_updates : balance_updates -> balance_updates tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/round_repr.ml b/src/proto_016_PtMumbai/lib_protocol/round_repr.ml new file mode 100644 index 000000000000..4f8c5c7b20ee --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/round_repr.ml @@ -0,0 +1,485 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type round = int32 + +type t = round + +module Map = Map.Make (Int32) + +include (Compare.Int32 : Compare.S with type t := t) + +let zero = 0l + +let succ n = + if Compare.Int32.equal n Int32.max_int then + invalid_arg "round_repr.succ: cannot apply succ to maximum round value" + else Int32.succ n + +let pp fmt i = Format.fprintf fmt "%ld" i + +type error += Negative_round of int + +type error += Round_overflow of int + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"negative_round" + ~title:"Negative round" + ~description:"Round cannot be built out of negative integers." + ~pp:(fun ppf i -> + Format.fprintf + ppf + "Negative round cannot be built out of negative integers (%Ld)" + i) + (obj1 (req "Negative_round" int64)) + (function Negative_round i -> Some (Int64.of_int i) | _ -> None) + (fun i -> Negative_round (Int64.to_int i)) ; + register_error_kind + `Permanent + ~id:"round_overflow" + ~title:"Round overflow" + ~description: + "Round cannot be built out of integer greater than maximum int32 value." + ~pp:(fun ppf i -> + Format.fprintf + ppf + "Round cannot be built out of integer greater than maximum int32 value \ + (%Ld)" + i) + (obj1 (req "Round_overflow" int64)) + (function Round_overflow i -> Some (Int64.of_int i) | _ -> None) + (fun i -> Round_overflow (Int64.to_int i)) + +let of_int32 i = + if i >= 0l then Ok i else error (Negative_round (Int32.to_int i)) + [@@inline] + +let pred r = + let p = Int32.pred r in + of_int32 p + +let of_int i = + if Compare.Int.(i < 0) then error (Negative_round i) + else + (* i is positive *) + let i32 = Int32.of_int i in + if Compare.Int.(Int32.to_int i32 = i) then Ok i32 + else error (Round_overflow i) + +let to_int i32 = + let i = Int32.to_int i32 in + if Int32.(equal (of_int i) i32) then ok i else error (Round_overflow i) + +let to_int32 t = t [@@inline] + +let to_slot round ~committee_size = + to_int round >>? fun r -> + let slot = r mod committee_size in + Slot_repr.of_int slot + +let encoding = + Data_encoding.conv_with_guard + (fun i -> i) + (fun i -> + match of_int32 i with + | Ok _ as res -> res + | Error _ -> Error "Round_repr.encoding: negative round") + Data_encoding.int32 + +module Durations = struct + type t = { + first_round_duration : Period_repr.t; + delay_increment_per_round : Period_repr.t; + } + + type error += + | Non_increasing_rounds of {increment : Period_repr.t} + | Round_durations_must_be_at_least_one_second of {round : Period_repr.t} + + let () = + register_error_kind + `Permanent + ~id:"durations.non_increasing_rounds" + ~title:"Non increasing round" + ~description:"The provided rounds are not increasing." + ~pp:(fun ppf increment -> + Format.fprintf + ppf + "The provided rounds are not increasing (increment: %a)" + Period_repr.pp + increment) + Data_encoding.(obj1 (req "increment" Period_repr.encoding)) + (function + | Non_increasing_rounds {increment} -> Some increment | _ -> None) + (fun increment -> Non_increasing_rounds {increment}) + + let pp fmt t = + Format.fprintf + fmt + "%a,@ +%a" + Period_repr.pp + t.first_round_duration + Period_repr.pp + t.delay_increment_per_round + + let create ~first_round_duration ~delay_increment_per_round = + error_when + Compare.Int64.(Period_repr.to_seconds first_round_duration < 1L) + (Round_durations_must_be_at_least_one_second + {round = first_round_duration}) + >>? fun () -> + error_when + Compare.Int64.(Period_repr.to_seconds delay_increment_per_round < 1L) + (Non_increasing_rounds {increment = delay_increment_per_round}) + >>? fun () -> ok {first_round_duration; delay_increment_per_round} + + let create_opt ~first_round_duration ~delay_increment_per_round = + match create ~first_round_duration ~delay_increment_per_round with + | Ok v -> Some v + | Error _ -> None + + let encoding = + let open Data_encoding in + conv_with_guard + (fun {first_round_duration; delay_increment_per_round} -> + (first_round_duration, delay_increment_per_round)) + (fun (first_round_duration, delay_increment_per_round) -> + match create_opt ~first_round_duration ~delay_increment_per_round with + | None -> + Error + "Either round durations are non-increasing or minimal block \ + delay < 1" + | Some rounds -> Ok rounds) + (obj2 + (req "first_round_duration" Period_repr.encoding) + (req "delay_increment_per_round" Period_repr.encoding)) + + let round_duration {first_round_duration; delay_increment_per_round} round = + if Compare.Int32.(round < 0l) then + invalid_arg "round must be a non-negative integer" + else + let first_round_duration_s = Period_repr.to_seconds first_round_duration + and delay_increment_per_round_s = + Period_repr.to_seconds delay_increment_per_round + in + Period_repr.of_seconds_exn + Int64.( + add + first_round_duration_s + (mul (of_int32 round) delay_increment_per_round_s)) +end + +type error += Round_too_high of int32 + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"round_too_high" + ~title:"round too high" + ~description:"block round too high." + ~pp:(fun ppf round -> + Format.fprintf ppf "Block round is too high: %ld" round) + (obj1 (req "level_offset_too_high" int32)) + (function Round_too_high round -> Some round | _ -> None) + (fun round -> Round_too_high round) + +(* The duration of round n follows the arithmetic sequence: + + round_duration(0) = first_round_duration + round_duration(r+1) = round_duration(r) + delay_increment_per_round + + Hence, this sequence can be explicited into: + + round_duration(r) = first_round_duration + r * delay_increment_per_round + + The level offset of round r is the sum of the durations of the rounds up + until round r - 1. In other words, when r > 0 + + raw_level_offset_of_round(0) = 0 + raw_level_offset_of_round(r+1) = + raw_level_offset_of_round(r) + round_duration(r) + + Hence + + raw_level_offset_of_round(r) = Σ_{k=0}^{r-1} (round_duration(k)) + + After unfolding the series, the same function can be finally explicited into + + raw_level_offset_of_round(0) = 0 + raw_level_offset_of_round(r) = r * first_round_duration + + 1/2 * r * (r - 1) * delay_increment_per_round +*) +let raw_level_offset_of_round round_durations ~round = + if Compare.Int32.(round = zero) then ok Int64.zero + else + let sum_durations = + let Durations.{first_round_duration; delay_increment_per_round} = + round_durations + in + let roundz = Int64.of_int32 round in + let m = Z.of_int64 Int64.(div (mul roundz (pred roundz)) (of_int 2)) in + Z.( + add + (mul + m + (Z.of_int64 @@ Period_repr.to_seconds delay_increment_per_round)) + (mul + (Z.of_int32 round) + (Z.of_int64 @@ Period_repr.to_seconds first_round_duration))) + in + if Compare.Z.(sum_durations > Z.of_int64 Int64.max_int) then + error (Round_too_high round) + else ok (Z.to_int64 sum_durations) + +type error += Level_offset_too_high of Period_repr.t + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"level_offset_too_high" + ~title:"level offset too high" + ~description:"The block's level offset is too high." + ~pp:(fun ppf offset -> + Format.fprintf + ppf + "The block's level offset is too high: %a" + Period_repr.pp + offset) + (obj1 (req "level_offset_too_high" Period_repr.encoding)) + (function Level_offset_too_high offset -> Some offset | _ -> None) + (fun offset -> Level_offset_too_high offset) + +type round_and_offset = {round : int32; offset : Period_repr.t} + +(** Complexity: O(log level_offset). *) +let round_and_offset round_durations ~level_offset = + let level_offset_in_seconds = Period_repr.to_seconds level_offset in + (* We set the bound as 2^53 to prevent overflows when computing the + variable [discr] for reasonable values of [first_round_duration] and + [delay_increment_per_round]. This bound is derived by a rough approximation + from the inequation [discr] < Int64.max_int. *) + let overflow_bound = Int64.shift_right Int64.max_int 10 in + if Compare.Int64.(overflow_bound < level_offset_in_seconds) then + error (Level_offset_too_high level_offset) + else + let Durations.{first_round_duration; delay_increment_per_round} = + round_durations + in + let first_round_duration = Period_repr.to_seconds first_round_duration in + let delay_increment_per_round = + Period_repr.to_seconds delay_increment_per_round + in + (* If [level_offset] is lower than the first round duration, then + the solution straightforward. *) + if Compare.Int64.(level_offset_in_seconds < first_round_duration) then + ok {round = 0l; offset = level_offset} + else + let round = + if Compare.Int64.(delay_increment_per_round = Int64.zero) then + (* Case when delay_increment_per_round is zero and a simple + linear solution exists. *) + Int64.div level_offset_in_seconds first_round_duration + else + (* Case when the increment is non-negative and we look for the + quadratic solution. *) + let pow_2 n = Int64.mul n n in + let double n = Int64.shift_left n 1 in + let times_8 n = Int64.shift_left n 3 in + let half n = Int64.shift_right n 1 in + (* The integer square root is implemented using the Newton-Raphson + method. For any integer N, the convergence within the + neighborhood of √N is ensured within log2 (N) steps. *) + let sqrt (n : int64) = + let x0 = ref (half n) in + if Compare.Int64.(!x0 > 1L) then ( + let x1 = ref (half (Int64.add !x0 (Int64.div n !x0))) in + while Compare.Int64.(!x1 < !x0) do + x0 := !x1 ; + x1 := half (Int64.add !x0 (Int64.div n !x0)) + done ; + !x0) + else n + in + (* The idea is to solve the following equation in [round] and + use its integer value: + + Σ_{k=0}^{round-1} round_duration(k) = level_offset + + After unfolding the sum and expanding terms, we obtain a + quadratic equation: + + delay_increment_per_round × round² + + (2 first_round_duration - delay_increment_per_round) × round + - 2 level_offset + = 0 + + From there, we compute the discriminant and the solution of + the equation. + + Refer to https://gitlab.com/tezos/tezos/-/merge_requests/4009 + for more explanations. + *) + let discr = + Int64.add + (pow_2 + (Int64.sub + (double first_round_duration) + delay_increment_per_round)) + (times_8 + (Int64.mul delay_increment_per_round level_offset_in_seconds)) + in + Int64.div + (Int64.add + (Int64.sub + delay_increment_per_round + (double first_round_duration)) + (sqrt discr)) + (double delay_increment_per_round) + in + raw_level_offset_of_round round_durations ~round:(Int64.to_int32 round) + >>? fun current_level_offset -> + ok + { + round = Int64.to_int32 round; + offset = + Period_repr.of_seconds_exn + (Int64.sub + (Period_repr.to_seconds level_offset) + current_level_offset); + } + +(** Complexity: O(|round_durations|). *) +let timestamp_of_round round_durations ~predecessor_timestamp ~predecessor_round + ~round = + let pred_round_duration = + Durations.round_duration round_durations predecessor_round + in + (* First, the function computes when the current level l is supposed + to start. This is given by adding to the timestamp of the round + of predecessor level l-1 [predecessor_timestamp], the duration of + its last round [predecessor_round]. *) + Time_repr.(predecessor_timestamp +? pred_round_duration) + >>? fun start_of_current_level -> + (* Finally, we sum the durations of the rounds at the current level l until + reaching current [round]. *) + raw_level_offset_of_round round_durations ~round >>? fun level_offset -> + let level_offset = Period_repr.of_seconds_exn level_offset in + Time_repr.(start_of_current_level +? level_offset) + +(** Unlike [timestamp_of_round], this function gets the starting time + of a given round, given the timestamp and the round of a proposal + at the same level. + + We compute the starting time of [considered_round] from a given + [round_durations] description, some [current_round], and its + starting time [current_timestamp]. + + Complexity: O(|round_durations|). *) +let timestamp_of_another_round_same_level round_durations ~current_timestamp + ~current_round ~considered_round = + raw_level_offset_of_round round_durations ~round:considered_round + >>? fun target_offset -> + raw_level_offset_of_round round_durations ~round:current_round + >>? fun current_offset -> + ok + @@ Time_repr.of_seconds + Int64.( + add + (sub (Time_repr.to_seconds current_timestamp) current_offset) + target_offset) + +type error += + | Round_of_past_timestamp of { + provided_timestamp : Time.t; + predecessor_timestamp : Time.t; + predecessor_round : t; + } + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"round_of_past_timestamp" + ~title:"Round_of_timestamp for past timestamp" + ~description:"Provided timestamp is before the expected level start." + ~pp:(fun ppf (provided_ts, predecessor_ts, round) -> + Format.fprintf + ppf + "Provided timestamp (%a) is before the expected level start (computed \ + based on predecessor_ts %a at round %a)." + Time.pp_hum + provided_ts + Time.pp_hum + predecessor_ts + pp + round) + (obj3 + (req "provided_timestamp" Time.encoding) + (req "predecessor_timestamp" Time.encoding) + (req "predecessor_round" encoding)) + (function + | Round_of_past_timestamp + {provided_timestamp; predecessor_timestamp; predecessor_round} -> + Some (provided_timestamp, predecessor_timestamp, predecessor_round) + | _ -> None) + (fun (provided_timestamp, predecessor_timestamp, predecessor_round) -> + Round_of_past_timestamp + {provided_timestamp; predecessor_timestamp; predecessor_round}) + +let round_of_timestamp round_durations ~predecessor_timestamp ~predecessor_round + ~timestamp = + let round_duration = + Durations.round_duration round_durations predecessor_round + in + Time_repr.(predecessor_timestamp +? round_duration) + >>? fun start_of_current_level -> + Period_repr.of_seconds (Time_repr.diff timestamp start_of_current_level) + |> Error_monad.record_trace + (Round_of_past_timestamp + { + predecessor_timestamp; + provided_timestamp = timestamp; + predecessor_round; + }) + >>? fun diff -> + round_and_offset round_durations ~level_offset:diff + >>? fun round_and_offset -> ok round_and_offset.round + +let level_offset_of_round round_durations ~round = + raw_level_offset_of_round round_durations ~round >>? fun offset -> + ok (Period_repr.of_seconds_exn offset) + +module Internals_for_test = struct + type round_and_offset_raw = {round : round; offset : Period_repr.t} + + let round_and_offset round_durations ~level_offset = + round_and_offset round_durations ~level_offset >|? fun v -> + {round = v.round; offset = v.offset} +end diff --git a/src/proto_016_PtMumbai/lib_protocol/round_repr.mli b/src/proto_016_PtMumbai/lib_protocol/round_repr.mli new file mode 100644 index 000000000000..31ea658617fd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/round_repr.mli @@ -0,0 +1,247 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A round represents an iteration of the single-shot consensus algorithm. + + Rounds can be seen as an infinite, 0-indexed, list of durations. The + durations are generated by an arithmetic progression depending on + {!val:Constants_repr.minimal_block_delay} (its initial value, a.k.a the one for + round 0) and {!val:Constants_repr.delay_increment_per_round} (its common + difference) . + + Round identifiers are non-negative 32 bit integers. This interface ensures + that no negative round can be created. *) + +type round + +type t = round + +(** Round zero *) +val zero : t + +(** Successor of the given round. + + @raise Invalid_arg if applied to the upper bound of the round integer + representation. *) +val succ : t -> t + +(** Predecessor of the given round. + Returns an error if applied to [zero], as negative round are + prohibited. *) +val pred : t -> t tzresult + +(** Building a round from an int32. + Returns an error if applied to a negative number. *) +val of_int32 : int32 -> t tzresult + +val to_int32 : t -> int32 + +(** Building a round from an int. + Returns an error if applied to a negative number or a number + greater than Int32.max_int. *) +val of_int : int -> t tzresult + +(** Building an int from a round. + Returns an error if the value does not fit in max_int. (current + 32bit encodings always fit in int on 64bit architecture though). *) +val to_int : t -> int tzresult + +(** Returns the slot corresponding to the given round [r], that is [r + mod committee_size]. *) +val to_slot : t -> committee_size:int -> Slot_repr.t tzresult + +(** Round encoding. + Be aware that decoding a negative 32 bit integer would lead to an + exception. *) +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +include Compare.S with type t := t + +module Map : Map.S with type key = t + +(** {2 Round duration representation} *) + +module Durations : sig + (** [round_durations] represents the duration of rounds in seconds *) + type t + + val pp : Format.formatter -> t -> unit + + (** {3 Creation functions} *) + + (** [create ~first_round_duration ~delay_increment_per_round] creates a valid + duration value + + @param first_round_duration duration of round 0 + @param delay_increment_per_round amount of time added in from one round + duration to the duration of its next round + @raise Invalid_argument if + - first_round_duration <= 1; or + - delay_increment_per_round is <= 0 + *) + val create : + first_round_duration:Period_repr.t -> + delay_increment_per_round:Period_repr.t -> + t tzresult + + (** [create_opt ~first_round_duration ~delay_increment_per_round] returns a valid duration value + [Some d] when [create ~first_round_duration ~delay_increment_per_round] + does not fail. It returns [None] otherwise. *) + val create_opt : + first_round_duration:Period_repr.t -> + delay_increment_per_round:Period_repr.t -> + t option + + (** {b Warning} May trigger an exception when the expected invariant + does not hold. *) + val encoding : t Data_encoding.encoding + + (** {3 Accessors}*) + + (** [round_duration round_durations ~round] returns the duration of round + [~round]. This duration follows the arithmetic progression + + duration(round_n) = [first_round_duration] + round_n * [delay_increment_per_round] + + *) + val round_duration : t -> round -> Period_repr.t +end + +(** [level_offset_of_round round_durations ~round:r] represents the offset of the + starting time of round [r] with respect to the start of the level. + round = 0 1 2 3 r + + |-----|-----|-----|-----|-----|--- ... ... --|------|------- + | + <-------------------------------------------> + level_offset +*) +val level_offset_of_round : Durations.t -> round:t -> Period_repr.t tzresult + +(** [timestamp_of_round round_durations ~predecessor_timestamp:pred_ts + ~predecessor_round:pred_round ~round] returns the + starting time of round [round] given that the timestamp and the round of + the block at the previous level is [pred_ts] and [pred_round], + respectively. + + pred_round = 0 pred_round + + |-----|.. ... --|--------|-- ... --|------- + | | + | | + pred_ts | + | + start_of_cur_level + | + | + |-----|------|-- ... --|-------|- + cur_round = 0 1 | round + | + res_ts + + Precisely, the resulting timestamp is: + [pred_ts + round_duration(pred_round) + level_offset_of_round(round)]. +*) +val timestamp_of_round : + Durations.t -> + predecessor_timestamp:Time_repr.t -> + predecessor_round:t -> + round:t -> + Time_repr.t tzresult + +(** [timestamp_of_another_round_same_level + round_durations + ~current_timestamp + ~current_round + ~considered_round] + returns the starting time of round [considered_round]. + + start of current + level current ts result + | | | + | | | + |-----|----...--|-- ... ------|- + | | | | + cur_round = 0 1 current considered + round round + + It also works when [considered_round] is lower than [current_round]. + + Precisely, the resulting timestamp is: + [current_timestamp - level_offset_of_round(current_round) + + level_offset_of_round(considered_round)]. +*) +val timestamp_of_another_round_same_level : + Durations.t -> + current_timestamp:Time_repr.t -> + current_round:t -> + considered_round:t -> + Time_repr.t tzresult + +(** [round_of_timestamp round_durations ~predecessor_timestamp ~predecessor_round + ~timestamp:ts] returns the round to which the timestamp [ts] belongs to, + given that the timestamp and the round of the block at the previous level is + [pred_ts] and [pred_round], respectively. + + Precisely, the resulting round is: + [round_and_offset round_durations ~level_offset:diff] where + [diff = ts - (predecessor_timestamp + round_duration(predecessor_round)]. + + Returns an error when the timestamp is before the level start. Also + returns an error when the timestamp is so high that it would lead + to an integer overflow when computing the round. *) +val round_of_timestamp : + Durations.t -> + predecessor_timestamp:Time_repr.t -> + predecessor_round:t -> + timestamp:Time_repr.t -> + t tzresult + +module Internals_for_test : sig + type round_and_offset_raw = {round : round; offset : Period_repr.t} + + (** [round_and_offset round_durations ~level_offset], where [level_offset] + represents a time offset with respect to the start of the first round, + returns a tuple [(r, round_offset)] where the round [r] is such that + [level_offset_of_round(r) <= level_offset < level_offset_of_round(r+1)] and + [round_offset := level_offset - level_offset_of_round(r)]. + + round = 0 1 2 3 r + + |-----|-----|-----|-----|-----|--- ... ... --|--------|-- ... --|------- + | + round_delay(r) + | + | + <-----> + round_offset + <---------------------------------------------------> + level_offset +*) + val round_and_offset : + Durations.t -> level_offset:Period_repr.t -> round_and_offset_raw tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sampler.ml b/src/proto_016_PtMumbai/lib_protocol/sampler.ml new file mode 100644 index 000000000000..043e05945f86 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sampler.ml @@ -0,0 +1,219 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* + + This module implements the alias method for sampling from a given + distribution. The distribution need not be normalized. + +*) + +module type SMass = sig + type t + + val encoding : t Data_encoding.t + + val zero : t + + val of_int : int -> t + + val mul : t -> t -> t + + val add : t -> t -> t + + val sub : t -> t -> t + + val ( = ) : t -> t -> bool + + val ( <= ) : t -> t -> bool + + val ( < ) : t -> t -> bool +end + +module type S = sig + type mass + + type 'a t + + val create : ('a * mass) list -> 'a t + + val sample : 'a t -> (int_bound:int -> mass_bound:mass -> int * mass) -> 'a + + val encoding : 'a Data_encoding.t -> 'a t Data_encoding.t +end + +module Make (Mass : SMass) : S with type mass = Mass.t = struct + type mass = Mass.t + + type 'a t = { + total : Mass.t; + support : 'a FallbackArray.t; + p : Mass.t FallbackArray.t; + alias : int FallbackArray.t; + } + + let rec init_loop total p alias small large = + match (small, large) with + | [], _ -> List.iter (fun (_, i) -> FallbackArray.set p i total) large + | _, [] -> + (* This can only happen because of numerical inaccuracies e.g. when using + [Mass.t = float] *) + List.iter (fun (_, i) -> FallbackArray.set p i total) small + | (qi, i) :: small', (qj, j) :: large' -> + FallbackArray.set p i qi ; + FallbackArray.set alias i j ; + let qj' = Mass.sub (Mass.add qi qj) total in + if Mass.(qj' < total) then + init_loop total p alias ((qj', j) :: small') large' + else init_loop total p alias small' ((qj', j) :: large') + + let support : fallback:'a -> ('a * Mass.t) list -> 'a FallbackArray.t = + fun ~fallback measure -> FallbackArray.of_list ~fallback ~proj:fst measure + + let check_and_cleanup measure = + let total, measure = + List.fold_left + (fun ((total, m) as acc) ((_, p) as point) -> + if Mass.(zero < p) then (Mass.add total p, point :: m) + else if Mass.(p < zero) then invalid_arg "create" + else (* p = zero: drop point *) + acc) + (Mass.zero, []) + measure + in + match measure with + | [] -> invalid_arg "create" + | (fallback, _) :: _ -> (fallback, total, measure) + + (* NB: duplicate elements in the support are not merged; + the algorithm should still function correctly. *) + let create (measure : ('a * Mass.t) list) = + let fallback, total, measure = check_and_cleanup measure in + let length = List.length measure in + let n = Mass.of_int length in + let _, small, large = + List.fold_left + (fun (i, small, large) (_, p) -> + let q = Mass.mul p n in + if Mass.(q < total) then (i + 1, (q, i) :: small, large) + else (i + 1, small, (q, i) :: large)) + (0, [], []) + measure + in + let support = support ~fallback measure in + let p = FallbackArray.make length Mass.zero in + let alias = FallbackArray.make length (-1) in + init_loop total p alias small large ; + {total; support; p; alias} + + let sample {total; support; p; alias} draw_i_elt = + let n = FallbackArray.length support in + let i, elt = draw_i_elt ~int_bound:n ~mass_bound:total in + let p = FallbackArray.get p i in + if Mass.(elt < p) then FallbackArray.get support i + else + let j = FallbackArray.get alias i in + assert (Compare.Int.(j >= 0)) ; + FallbackArray.get support j + + (* Note: this could go in the environment maybe? *) + let array_encoding : 'a Data_encoding.t -> 'a FallbackArray.t Data_encoding.t + = + fun venc -> + let open Data_encoding in + conv + (fun array -> + let length = FallbackArray.length array in + let fallback = FallbackArray.fallback array in + let elements = + List.rev (FallbackArray.fold (fun acc elt -> elt :: acc) array []) + in + (length, fallback, elements)) + (fun (length, fallback, elements) -> + let array = FallbackArray.make length fallback in + List.iteri (fun i elt -> FallbackArray.set array i elt) elements ; + array) + (obj3 + (req "length" int31) + (req "fallback" venc) + (req "elements" (list venc))) + + let mass_array_encoding = array_encoding Mass.encoding + + let int_array_encoding = array_encoding Data_encoding.int31 + + let encoding enc = + let open Data_encoding in + conv + (fun {total; support; p; alias} -> (total, support, p, alias)) + (fun (total, support, p, alias) -> {total; support; p; alias}) + (obj4 + (req "total" Mass.encoding) + (req "support" (array_encoding enc)) + (req "p" mass_array_encoding) + (req "alias" int_array_encoding)) +end + +module Internal_for_tests = struct + module Make = Make + + module type SMass = SMass +end + +module Mass : SMass with type t = int64 = struct + type t = int64 + + let encoding = Data_encoding.int64 + + let zero = 0L + + let of_int = Int64.of_int + + let mul = Int64.mul + + let add = Int64.add + + let sub = Int64.sub + + let ( = ) = Compare.Int64.( = ) + + let ( <= ) = Compare.Int64.( <= ) + + let ( < ) = Compare.Int64.( < ) +end + +(* This is currently safe to do that since since at this point the values for + [total] is 8 * 10^8 * 10^6 and the delegates [n] = 400. + + Therefore [let q = Mass.mul p n ...] in [create] does not overflow since p < + total. + + Assuming the total active stake does not increase too much, which is the case + at the current 5% inflation rate, this implementation can thus support around + 10000 delegates without overflows. + + If/when this happens, the implementation should be revisited. +*) +include Make (Mass) diff --git a/src/proto_016_PtMumbai/lib_protocol/sampler.mli b/src/proto_016_PtMumbai/lib_protocol/sampler.mli new file mode 100644 index 000000000000..00cf20a7768c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sampler.mli @@ -0,0 +1,111 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +(** Efficient sampling from given finitely supported (nonzero, positive) + measures using the alias method. Measures need not be normalized on input, + but sampling proceeds from the normalized probability measure associated + to the given measure. + *) + +(** [S] is the module type of a module allowing to construct samplers based + on the alias method. *) +module type S = sig + (** [mass] is the type in which finite measures take their values + (see [Mass] module type). *) + type mass + + (** ['a t] is the type of auxilliary data for sampling from + a given distribution. *) + type 'a t + + (** [create measure] constructs auxilliary data to sample from + [measure] after normalization. Complexity: O(n). + + It is assumed that the measure is positive. [measure] can contain + zero mass elements: those are removed in a pre-processing step. + The total mass of the measure should be strictly positive. + + @raise Invalid_argument if [measure] contains negative mass elements + or if it contains only zero mass elements. *) + val create : ('a * mass) list -> 'a t + + (** [sample auxdata rand] creates a sampler from [auxdata] that follows + the distribution associated to the measure specified when + creating the [auxdata]. The parameter [rand] is a random sampler + for the two random values used by the sampling method. The first + bound is at most the length of the list passed to [create] when + creating [auxdata]. The second bound is at most the sum of all + items in the list passed to [create]. *) + val sample : 'a t -> (int_bound:int -> mass_bound:mass -> int * mass) -> 'a + + (** [encoding e] constructs an encoding for ['a t] given an encoding for ['a]. *) + val encoding : 'a Data_encoding.t -> 'a t Data_encoding.t +end + +(**/**) + +module Internal_for_tests : sig + (** [Mass] is the module type describing the measure associated to points. + + The current signature reflects the need for efficiency for the arithmetic + operators. As such, they do not error or add dynamic checks for + over-/under-flow. + + One must make sure that the implementation of its arithmetic operators + cannot over-/under-flow under the current usage. *) + module type SMass = sig + (** [t] is the type describing the measure associated to points. *) + type t + + val encoding : t Data_encoding.t + + val zero : t + + val of_int : int -> t + + val mul : t -> t -> t + + val add : t -> t -> t + + val sub : t -> t -> t + + val ( = ) : t -> t -> bool + + val ( <= ) : t -> t -> bool + + val ( < ) : t -> t -> bool + end + + (** [Make(Mass)] instantiates a module allowing to creates + samplers for [Mass]-valued finite measures. *) + module Make : functor (Mass : SMass) -> S with type mass = Mass.t +end + +(** Sampler based on int64. In the current state of the protocol, this should + not ever over-/under-flow -- see the thought process in the .ml file. + + However, should the total stake increase a lot or the number of delegates get + close to 10k, this might not be true anymore and this module should be + revisited. *) +include S with type mass = Int64.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sapling_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sapling_repr.ml new file mode 100644 index 000000000000..0e54e90a5727 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sapling_repr.ml @@ -0,0 +1,205 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type transaction = Sapling.UTXO.transaction + +let transaction_encoding = Sapling.UTXO.transaction_encoding + +(* The two data structures in the state are all ordered by position, a diff + contains the elements starting from an offset position up to the most recent + position. A diff can be applied to a state stored in a context to obtain a + new state. + Diffs are used by the Michelson interpreter during the evaluation of smart + contracts to keep a temporary state that may be discarded. + Diffs are also returned by an RPC to allow a client to synchronize its own + state with the chain. +*) +type diff = { + commitments_and_ciphertexts : + (Sapling.Commitment.t * Sapling.Ciphertext.t) list; + nullifiers : Sapling.Nullifier.t list; +} + +let diff_encoding = + let open Data_encoding in + conv + (fun d -> (d.commitments_and_ciphertexts, d.nullifiers)) + (fun (commitments_and_ciphertexts, nullifiers) -> + (match commitments_and_ciphertexts with + | [] -> () + | (_cm_hd, ct_hd) :: rest -> + let memo_size = Sapling.Ciphertext.get_memo_size ct_hd in + List.iter + (fun (_cm, ct) -> + assert ( + Compare.Int.(Sapling.Ciphertext.get_memo_size ct = memo_size))) + rest) ; + {commitments_and_ciphertexts; nullifiers}) + (obj2 + (req + "commitments_and_ciphertexts" + (list (tup2 Sapling.Commitment.encoding Sapling.Ciphertext.encoding))) + (req "nullifiers" (list Sapling.Nullifier.encoding))) + +module Memo_size = struct + type t = int + + let encoding = Data_encoding.uint16 + + let equal = Compare.Int.( = ) + + let max_uint16 = 0xffff + + let max_uint16_z = Z.of_int max_uint16 + + let err = + Error + ("a positive 16-bit integer (between 0 and " ^ string_of_int max_uint16 + ^ ")") + + let parse_z z = + if Compare.Z.(Z.zero <= z) && Compare.Z.(z <= max_uint16_z) then + Ok (Z.to_int z) + else err + + let unparse_to_z = Z.of_int + + let in_memory_size (_ : t) = + let open Cache_memory_helpers in + !!0 +end + +let transaction_get_memo_size (transaction : Sapling.UTXO.transaction) = + match transaction.outputs with + | [] -> None + | {ciphertext; _} :: _ -> + (* Encoding ensures all ciphertexts have the same memo size. *) + Some (Sapling.Ciphertext.get_memo_size ciphertext) + +open Cache_memory_helpers + +(* This should be exported by [lib_sapling] rather than implemented here. *) +let input_in_memory_size = + (* type input = + * Sapling.UTXO.input = { + * cv : Sapling.CV.t; + * nf : Sapling.Nullifier.t; + * rk : Sapling.UTXO.rk; + * proof_i : Sapling.UTXO.spend_proof; + * signature : Sapling.UTXO.spend_sig; + * } *) + let cv_size = string_size_gen 32 in + let nf_size = string_size_gen 32 in + let rk_size = string_size_gen 32 in + let proof_i_size = string_size_gen @@ (48 + 96 + 48) in + let signature_size = string_size_gen 64 in + header_size +! (word_size *? 5) +! cv_size +! nf_size +! rk_size + +! proof_i_size +! signature_size + +let ciphertext_size = + (* type t = { + * cv : CV.t; + * epk : DH.epk; + * payload_enc : Bytes.t; + * nonce_enc : Crypto_box.nonce; + * payload_out : Bytes.t; + * nonce_out : Crypto_box.nonce; + * } *) + let cv_size = string_size_gen 32 in + let epk_size = string_size_gen 32 in + let nonce_enc_size = + string_size_gen 24 + (* from lib_hacl/hacl.ml:Nonce.size *) + in + let payload_out_size = + string_size_gen (32 + 32 + 16) + (* from lib_sapling/core.ml:Ciphertext.encoding *) + in + let nonce_out_size = string_size_gen 24 in + let fixed_payload_data_size = + 11 + 8 + 32 + 16 + 4 + (* from lib_sapling/core.ml:Ciphertext.get_memo_size *) + in + + fun memo_size -> + let payload_size = string_size_gen (memo_size + fixed_payload_data_size) in + header_size +! (word_size *? 6) +! cv_size +! epk_size +! payload_size + +! nonce_enc_size +! payload_out_size +! nonce_out_size + +let output_in_memory_size = + (* type output = { + * cm : Commitment.t; + * proof_o : output_proof; + * ciphertext : Ciphertext.t; + * } *) + let cm_size = string_size_gen 32 in + let proof_o_size = string_size_gen @@ (48 + 96 + 48) in + let ciphertext_size = ciphertext_size in + + fun memo_size -> + header_size +! (word_size *? 3) +! cm_size +! proof_o_size + +! ciphertext_size memo_size + +(** Returns an approximation of the in-memory size of a Sapling transaction. *) +let transaction_in_memory_size (transaction : Sapling.UTXO.transaction) = + (* type transaction = + * transaction = { + * inputs : Sapling.UTXO.input list; + * outputs : Sapling.UTXO.output list; + * binding_sig : Sapling.UTXO.binding_sig; + * balance : int64; + * root : Sapling.Hash.t; + * } *) + let binding_sig_size = string_size_gen 64 in + let balance_size = int64_size in + let root_size = string_size_gen 32 in + let inputs = List.length transaction.inputs in + let outputs = List.length transaction.outputs in + let memo_size = + Option.value ~default:0 (transaction_get_memo_size transaction) + in + let bound_data_size = string_size transaction.bound_data in + header_size +! (word_size *? 5) + +! (list_cell_size input_in_memory_size *? inputs) + +! (list_cell_size (output_in_memory_size memo_size) *? outputs) + +! binding_sig_size +! balance_size +! root_size +! bound_data_size + +(** Returns an approximation of the in-memory size of a Sapling diff. *) +let diff_in_memory_size ({commitments_and_ciphertexts; nullifiers} : diff) = + let cms_and_cts = List.length commitments_and_ciphertexts in + let nfs = List.length nullifiers in + let cm_size = string_size_gen 32 in + let nf_size = string_size_gen 32 in + let memo_size = + (* All memo_size in a diff should be equal (see invariant enforced by + [diff] encoding above) *) + match commitments_and_ciphertexts with + | [] -> 0 + | (_, ct) :: _ -> Sapling.Ciphertext.get_memo_size ct + in + header_size +! (word_size *? 2) + +! list_cell_size (boxed_tup2 cm_size (ciphertext_size memo_size)) + *? cms_and_cts + +! (list_cell_size nf_size *? nfs) diff --git a/src/proto_016_PtMumbai/lib_protocol/sapling_services.ml b/src/proto_016_PtMumbai/lib_protocol/sapling_services.ml new file mode 100644 index 000000000000..738cecaaff22 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sapling_services.ml @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let custom_root = + (RPC_path.(open_root / "context" / "sapling") + : RPC_context.t RPC_path.context) + +type diff_query = { + offset_commitment : Int64.t option; + offset_nullifier : Int64.t option; +} + +module S = struct + module Args = struct + type ('query_type, 'output_type) t = { + name : string; + description : string; + query : 'query_type RPC_query.t; + output : 'output_type Data_encoding.t; + f : context -> Sapling.Id.t -> 'query_type -> 'output_type tzresult Lwt.t; + } + + let get_diff_query : diff_query RPC_query.t = + let open RPC_query in + query (fun offset_commitment offset_nullifier -> + {offset_commitment; offset_nullifier}) + |+ opt_field + ~descr: + "Commitments and ciphertexts are returned from the specified \ + offset up to the most recent." + "offset_commitment" + RPC_arg.uint63 + (fun {offset_commitment; _} -> offset_commitment) + |+ opt_field + ~descr: + "Nullifiers are returned from the specified offset up to the most \ + recent." + "offset_nullifier" + RPC_arg.uint63 + (fun {offset_nullifier; _} -> offset_nullifier) + |> seal + + let encoding = + let open Data_encoding in + merge_objs (obj1 (req "root" Sapling.root_encoding)) Sapling.diff_encoding + + let get_diff = + { + name = "get_diff"; + description = + "Returns the root and a diff of a state starting from an optional \ + offset which is zero by default."; + query = get_diff_query; + output = encoding; + f = + (fun ctxt id {offset_commitment; offset_nullifier} -> + Sapling.get_diff ctxt id ?offset_commitment ?offset_nullifier ()); + } + end + + let make_service Args.{name; description; query; output; f} = + let path = RPC_path.(custom_root /: Sapling.rpc_arg / name) in + let service = RPC_service.get_service ~description ~query ~output path in + (service, fun ctxt id q () -> f ctxt id q) + + let get_diff = make_service Args.get_diff +end + +let register () = + let reg ~chunked (service, f) = + Services_registration.register1 ~chunked service f + in + reg ~chunked:false S.get_diff + +let mk_call1 (service, _f) ctxt block id q = + RPC_context.make_call1 service ctxt block id q () + +let get_diff ctxt block id ?offset_commitment ?offset_nullifier () = + mk_call1 S.get_diff ctxt block id {offset_commitment; offset_nullifier} diff --git a/src/proto_016_PtMumbai/lib_protocol/sapling_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sapling_storage.ml new file mode 100644 index 000000000000..e043a080a46f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sapling_storage.ml @@ -0,0 +1,488 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type COMMITMENTS = sig + val init : Raw_context.t -> Storage.Sapling.id -> Raw_context.t Lwt.t + + val default_root : Sapling.Hash.t + + val get_root : + Raw_context.t -> + Storage.Sapling.id -> + (Raw_context.t * Sapling.Hash.t) tzresult Lwt.t + + val add : + Raw_context.t -> + Storage.Sapling.id -> + Sapling.Commitment.t list -> + int64 -> + (Raw_context.t * int) tzresult Lwt.t + + val get_from : + Raw_context.t -> + Storage.Sapling.id -> + int64 -> + Sapling.Commitment.t list tzresult Lwt.t +end + +module Commitments : COMMITMENTS = struct + module H = Sapling.Hash + + (** Incremental Merkle Tree + * + * A tree of height h contains 2^h leaves and h+1 levels of nodes with + * leaves at level 0 and root at level h. + * + * The leaves are commitments and the tree it is treated as always filled + * with a default value H.uncommitted. This allows to have proofs of + * membership, or witnesses, of fixed size. + * + * All the nodes at the same level of an empty tree have the same hash, + * which can be computed from the default value of the leaves. This is + * stored in the [uncommitted] list. + * + * Any subtree filled with default values is represented by the Empty + * constructor and given its height it's possible to compute its hash + * using the [uncommitted] list. + * + * The leaves are indexed by their position [pos], ranging from 0 to + * (2^h)-1. The encoding of [pos] limits the possible size of the tree. + * In any case the only valid height for the Sapling library is 32, so even + * if the library encodes positions as uint64, they never exceed uint32. + * + * The tree is incremental in the sense that leaves cannot be modified but + * only added and exclusively in successive positions. + * + * Given that elements are added and retrieved by position, it is possible + * to use this information to efficiently navigate the tree. + * Given a tree of height [h] and a position [pos], if pos < pow2 (h-1) only + * the left subtree needs to be inspected recursively. Otherwise only the + * right needs to be visited, decreasing [pos] by [pow2 (h-1)]. + * + * In order to avoid storing the height for each subtree (or worse + * recomputing it), each function with suffix `_height` expects the height + * of the tree as parameter. These functions are only for internal use and + * are later aliased by functions using the default height of a Sapling + * incremental Merkle tree. + * + * Each node of the tree is indexed starting from the root at index 1, + * followed by its left child at index 2, right child at index 3 and so on + * until the last leaf at index 2^(depth+1)-1, or in terms of height + * 2^(32 - height +1) -1. + * The functions left and right return the index of the left and right child + * of a node. + *) + + let pow2 h = Int64.(shift_left 1L h) + + let max_height = 32 + + let max_size = pow2 max_height + + let assert_node node height = + assert ( + let first_of_height = pow2 (max_height - height) in + let first_of_next_height = Int64.shift_left first_of_height 1 in + Compare.Int64.(node >= first_of_height && node < first_of_next_height)) + + let assert_height height = + assert (Compare.Int.(height >= 0 && height <= max_height)) + + let assert_pos pos height = + assert (Compare.Int64.(pos >= 0L && pos <= pow2 height)) + + let default_root = H.uncommitted ~height:max_height + + let init = Storage.Sapling.commitments_init + + let get_root_height ctx id node height = + assert_node node height ; + assert_height height ; + Storage.Sapling.Commitments.find (ctx, id) node >|=? function + | ctx, None -> + let hash = H.uncommitted ~height in + (ctx, hash) + | ctx, Some hash -> (ctx, hash) + + let left node = Int64.mul node 2L + + let right node = Int64.(add (mul node 2L) 1L) + + (* Not tail-recursive *) + let rec split_at n l = + if Compare.Int64.(n = 0L) then ([], l) + else + match l with + | [] -> ([], l) + | x :: xs -> + let l1, l2 = split_at Int64.(pred n) xs in + (x :: l1, l2) + + (* [insert tree height pos cms] inserts the list of commitments + [cms] in the tree [tree] of height [height] at the next position [pos]. + Returns the context, the size of the added storage, and the hash of the + node. Not tail-recursive. + Pre: incremental tree /\ + size tree + List.length cms <= pow2 height /\ + pos = size tree /\ + Post: incremental tree /\ + to_list (insert tree height pos cms) = to_list t @ cms *) + let rec insert ctx id node height pos cms = + assert_node node height ; + assert_height height ; + assert_pos pos height ; + match (height, cms) with + | _, [] -> + get_root_height ctx id node height >|=? fun (ctx, h) -> (ctx, 0, h) + | 0, [cm] -> + let h = H.of_commitment cm in + Storage.Sapling.Commitments.init (ctx, id) node h + >|=? fun (ctx, size) -> (ctx, size, h) + | _ -> + let height = height - 1 in + (if Compare.Int64.(pos < pow2 height) then + let at = Int64.(sub (pow2 height) pos) in + let cml, cmr = split_at at cms in + insert ctx id (left node) height pos cml >>=? fun (ctx, size_l, hl) -> + insert ctx id (right node) height 0L cmr >|=? fun (ctx, size_r, hr) -> + (ctx, size_l + size_r, hl, hr) + else + get_root_height ctx id (left node) height >>=? fun (ctx, hl) -> + let pos = Int64.(sub pos (pow2 height)) in + insert ctx id (right node) height pos cms + >|=? fun (ctx, size_r, hr) -> (ctx, size_r, hl, hr)) + >>=? fun (ctx, size_children, hl, hr) -> + let h = H.merkle_hash ~height hl hr in + Storage.Sapling.Commitments.add (ctx, id) node h + >|=? fun (ctx, size, _existing) -> (ctx, size + size_children, h) + + let rec fold_from_height ctx id node ~pos ~f ~acc height = + assert_node node height ; + assert_height height ; + assert_pos pos height ; + Storage.Sapling.Commitments.find (ctx, id) node + (* we don't count gas for this function, it is called only by RPC *) + >>=? + function + | _ctx, None -> return acc + | _ctx, Some h -> + if Compare.Int.(height = 0) then return (f acc h) + else + let full = pow2 (height - 1) in + if Compare.Int64.(pos < full) then + fold_from_height ctx id (left node) ~pos ~f ~acc (height - 1) + >>=? fun acc -> + (* Setting pos to 0 folds on the whole right subtree *) + fold_from_height ctx id (right node) ~pos:0L ~f ~acc (height - 1) + else + let pos = Int64.(sub pos full) in + fold_from_height ctx id (right node) ~pos ~f ~acc (height - 1) + + let root_node = 1L + + let get_root ctx id = get_root_height ctx id root_node max_height + + (* Expects pos to be the next position to insert. Pos is also the number of + inserted leaves. + A commitment should always be added together with a corresponding + ciphertext in the same position. + [insert] is not tail-recursive so we put a hard limit on the size of the + list of commitments. The use of [split_at] has O(n logn) complexity that is + less relevant on a smaller list. *) + let add ctx id cms pos = + let l = List.length cms in + assert (Compare.Int.(l <= 1000)) ; + let n' = Int64.(add pos (of_int l)) in + assert (Compare.Int64.(n' <= max_size)) ; + insert ctx id root_node max_height pos cms >|=? fun (ctx, size, _h) -> + (ctx, size) + + let get_from ctx id pos = + fold_from_height + ctx + id + root_node + ~pos + ~f:(fun acc c -> H.to_commitment c :: acc) + ~acc:[] + max_height + >|=? fun l -> List.rev l +end + +module Ciphertexts = struct + let init ctx id = Storage.Sapling.ciphertexts_init ctx id + + (* a ciphertext should always be added together with a corresponding + commitment in the same position *) + let add ctx id c pos = Storage.Sapling.Ciphertexts.init (ctx, id) pos c + + let get_from ctx id offset = + let rec aux (ctx, acc) pos = + Storage.Sapling.Ciphertexts.find (ctx, id) pos >>=? fun (ctx, c) -> + match c with + | None -> return (ctx, List.rev acc) + | Some c -> aux (ctx, c :: acc) (Int64.succ pos) + in + aux (ctx, []) offset +end + +(* Collection of nullifiers w/o duplicates, append-only. It has a dual + implementation with a hash map for constant `mem` and with a ordered set to + retrieve by position. *) +module Nullifiers = struct + let init = Storage.Sapling.nullifiers_init + + let size ctx id = Storage.Sapling.Nullifiers_size.get (ctx, id) + + let mem ctx id nf = Storage.Sapling.Nullifiers_hashed.mem (ctx, id) nf + + (* Allows for duplicates as they are already checked by verify_update before + updating the state. + Not tail-recursive so we put a hard limit on the size of the + list of nullifiers. *) + let add ctx id nfs = + assert (Compare.Int.(List.compare_length_with nfs 1000 <= 0)) ; + size ctx id >>=? fun nf_start_pos -> + List.fold_right_es + (fun nf (ctx, pos, acc_size) -> + Storage.Sapling.Nullifiers_hashed.init (ctx, id) nf + >>=? fun (ctx, size) -> + Storage.Sapling.Nullifiers_ordered.init (ctx, id) pos nf >|=? fun ctx -> + (ctx, Int64.succ pos, Z.add acc_size (Z.of_int size))) + nfs + (ctx, nf_start_pos, Z.zero) + >>=? fun (ctx, nf_end_pos, size) -> + Storage.Sapling.Nullifiers_size.update (ctx, id) nf_end_pos >|=? fun ctx -> + (ctx, size) + + let get_from ctx id offset = + let rec aux acc pos = + Storage.Sapling.Nullifiers_ordered.find (ctx, id) pos >>=? function + | None -> return @@ List.rev acc + | Some c -> aux (c :: acc) (Int64.succ pos) + in + aux [] offset +end + +(** Bounded queue of roots. The full size is initialized with the default + uncommitted root, that's why roots storage doesn't need to be carbonated. + A maximum of one new root is added per protocol level. + If multiple transactions for the same shielded pool are processed during the + same contract call or several calls in the same block, only the last root + will be stored. + This property prevents transactions in the same block from depending on each + other and guarantees that a transaction will be valid for a least two hours + (hence the 120 size) after being forged. *) +module Roots = struct + let size = 120l + + (* pos is the index of the last inserted element *) + + let get ctx id = + Storage.Sapling.Roots_pos.get (ctx, id) >>=? fun pos -> + Storage.Sapling.Roots.get (ctx, id) pos + + let init ctx id = + let rec aux ctx pos = + if Compare.Int32.(pos < 0l) then return ctx + else + Storage.Sapling.Roots.init (ctx, id) pos Commitments.default_root + >>=? fun ctx -> aux ctx (Int32.pred pos) + in + aux ctx (Int32.pred size) >>=? fun ctx -> + Storage.Sapling.Roots_pos.init (ctx, id) 0l >>=? fun ctx -> + let level = (Raw_context.current_level ctx).level in + Storage.Sapling.Roots_level.init (ctx, id) level + + let mem ctx id root = + Storage.Sapling.Roots_pos.get (ctx, id) >>=? fun start_pos -> + let rec aux pos = + Storage.Sapling.Roots.get (ctx, id) pos >>=? fun hash -> + if Compare.Int.(Sapling.Hash.compare hash root = 0) then return true + else + let pos = Int32.(pred pos) in + let pos = if Compare.Int32.(pos < 0l) then Int32.pred size else pos in + if Compare.Int32.(pos = start_pos) then return false else aux pos + in + aux start_pos + + (* allows duplicates *) + let add ctx id root = + Storage.Sapling.Roots_pos.get (ctx, id) >>=? fun pos -> + let level = (Raw_context.current_level ctx).level in + Storage.Sapling.Roots_level.get (ctx, id) >>=? fun stored_level -> + if Raw_level_repr.(stored_level = level) then + (* if there is another add during the same level, it will over-write on + the same position *) + Storage.Sapling.Roots.add (ctx, id) pos root >|= ok + else + (* it's the first add for this level *) + (* TODO(samoht): why is it using [update] and not [init] then? *) + Storage.Sapling.Roots_level.update (ctx, id) level >>=? fun ctx -> + let pos = Int32.rem (Int32.succ pos) size in + Storage.Sapling.Roots_pos.update (ctx, id) pos >>=? fun ctx -> + Storage.Sapling.Roots.add (ctx, id) pos root >|= ok +end + +(** This type links the permanent state stored in the context at the specified + id together with the ephemeral diff managed by the Michelson + interpreter. After a successful execution the diff can be applied to update + the state at id. The first time a state is created its id is None, one will + be assigned after the first application. *) +type state = { + id : Lazy_storage_kind.Sapling_state.Id.t option; + diff : Sapling_repr.diff; + memo_size : Sapling_repr.Memo_size.t; +} + +let empty_diff = + Sapling_repr.{commitments_and_ciphertexts = []; nullifiers = []} + +let empty_state ?id ~memo_size () = {id; diff = empty_diff; memo_size} + +(** Returns a state from an existing id. *) +let state_from_id ctxt id = + Storage.Sapling.Memo_size.get (ctxt, id) >|=? fun memo_size -> + ({id = Some id; diff = empty_diff; memo_size}, ctxt) + +let rpc_arg = Storage.Sapling.rpc_arg + +let get_memo_size ctx id = Storage.Sapling.Memo_size.get (ctx, id) + +let init ctx id ~memo_size = + Storage.Sapling.Memo_size.add (ctx, id) memo_size >>= fun ctx -> + Storage.Sapling.Commitments_size.add (ctx, id) Int64.zero >>= fun ctx -> + Commitments.init ctx id >>= fun ctx -> + Nullifiers.init ctx id >>= fun ctx -> + Roots.init ctx id >>=? fun ctx -> Ciphertexts.init ctx id >|= ok + +(* Gas costs for apply_diff. *) +let sapling_apply_diff_cost ~inputs ~outputs = + let open Saturation_repr in + add + (safe_int 1_300_000) + (add + (scale_fast (mul_safe_of_int_exn 5_000) (safe_int inputs)) + (scale_fast (mul_safe_of_int_exn 55_000) (safe_int outputs))) + +(** Applies a diff to a state id stored in the context. Updates Commitments, + Ciphertexts and Nullifiers using the diff and updates the Roots using the + new Commitments tree. *) +let apply_diff ctx id diff = + let open Sapling_repr in + let nb_commitments = List.length diff.commitments_and_ciphertexts in + let nb_nullifiers = List.length diff.nullifiers in + let sapling_cost = + sapling_apply_diff_cost ~inputs:nb_nullifiers ~outputs:nb_commitments + in + Raw_context.consume_gas ctx sapling_cost >>?= fun ctx -> + Storage.Sapling.Commitments_size.get (ctx, id) >>=? fun cm_start_pos -> + let cms = List.rev_map fst diff.commitments_and_ciphertexts in + Commitments.add ctx id cms cm_start_pos >>=? fun (ctx, size) -> + Storage.Sapling.Commitments_size.update + (ctx, id) + (Int64.add cm_start_pos (Int64.of_int nb_commitments)) + >>=? fun ctx -> + List.fold_right_es + (fun (_cm, cp) (ctx, pos, acc_size) -> + Ciphertexts.add ctx id cp pos >|=? fun (ctx, size) -> + (ctx, Int64.succ pos, Z.add acc_size (Z.of_int size))) + diff.commitments_and_ciphertexts + (ctx, cm_start_pos, Z.of_int size) + >>=? fun (ctx, _ct_end_pos, size) -> + Nullifiers.add ctx id diff.nullifiers >>=? fun (ctx, size_nf) -> + let size = Z.add size size_nf in + match diff.commitments_and_ciphertexts with + | [] -> + (* avoids adding duplicates to Roots *) + return (ctx, size) + | _ :: _ -> + Commitments.get_root ctx id >>=? fun (ctx, root) -> + Roots.add ctx id root >|=? fun ctx -> (ctx, size) + +let add {id; diff; memo_size} cm_cipher_list = + assert ( + List.for_all + (fun (_cm, cipher) -> + Compare.Int.(Sapling.Ciphertext.get_memo_size cipher = memo_size)) + cm_cipher_list) ; + { + id; + diff = + { + diff with + commitments_and_ciphertexts = + List.rev cm_cipher_list @ diff.commitments_and_ciphertexts; + }; + memo_size; + } + +let root_mem ctx {id; _} tested_root = + match id with + | Some id -> Roots.mem ctx id tested_root + | None -> + return + Compare.Int.( + Sapling.Hash.compare tested_root Commitments.default_root = 0) + +(* to avoid a double spend we need to check the disk AND the diff *) +let nullifiers_mem ctx {id; diff; _} nf = + let exists_in_diff = + List.exists + (fun v -> Compare.Int.(Sapling.Nullifier.compare nf v = 0)) + diff.nullifiers + in + if exists_in_diff then return (ctx, true) + else + match id with + | None -> return (ctx, false) + | Some id -> Nullifiers.mem ctx id nf + +(* Allows for duplicates as they are already checked by verify_update before + updating the state. *) +let nullifiers_add {id; diff; memo_size} nf = + {id; diff = {diff with nullifiers = nf :: diff.nullifiers}; memo_size} + +type root = Sapling.Hash.t + +let root_encoding = Sapling.Hash.encoding + +let get_diff ctx id ?(offset_commitment = 0L) ?(offset_nullifier = 0L) () = + if + not + Sapling.Commitment.( + valid_position offset_commitment && valid_position offset_nullifier) + then failwith "Invalid argument." + else + Commitments.get_from ctx id offset_commitment >>=? fun commitments -> + Roots.get ctx id >>=? fun root -> + Nullifiers.get_from ctx id offset_nullifier >>=? fun nullifiers -> + Ciphertexts.get_from ctx id offset_commitment + (* we don't count gas for RPCs *) + >|=? fun (_ctx, ciphertexts) -> + match List.combine ~when_different_lengths:() commitments ciphertexts with + | Error () -> failwith "Invalid argument." + | Ok commitments_and_ciphertexts -> + (root, Sapling_repr.{commitments_and_ciphertexts; nullifiers}) diff --git a/src/proto_016_PtMumbai/lib_protocol/sapling_validator.ml b/src/proto_016_PtMumbai/lib_protocol/sapling_validator.ml new file mode 100644 index 000000000000..a9784cae9421 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sapling_validator.ml @@ -0,0 +1,108 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Check that each nullifier is not already present in the state and add it. + Important to avoid spending the same input twice in a transaction. *) +let rec check_and_update_nullifiers ctxt state inputs = + match inputs with + | [] -> return (ctxt, Some state) + | input :: inputs -> ( + Sapling_storage.nullifiers_mem ctxt state Sapling.UTXO.(input.nf) + >>=? function + | ctxt, true -> return (ctxt, None) + | ctxt, false -> + let state = + Sapling_storage.nullifiers_add state Sapling.UTXO.(input.nf) + in + check_and_update_nullifiers ctxt state inputs) + +let verify_update : + Raw_context.t -> + Sapling_storage.state -> + Sapling_repr.transaction -> + string -> + (Raw_context.t * (Int64.t * Sapling_storage.state) option) tzresult Lwt.t = + fun ctxt state transaction key -> + (* Check the transaction *) + (* To avoid overflowing the balance, the number of inputs and outputs must be + bounded. + Ciphertexts' memo_size must match the state's memo_size. + These constraints are already enforced at the encoding level. *) + assert (Compare.Int.(List.compare_length_with transaction.inputs 5208 <= 0)) ; + assert (Compare.Int.(List.compare_length_with transaction.outputs 2019 <= 0)) ; + let pass = + List.for_all + (fun output -> + Compare.Int.( + Sapling.Ciphertext.get_memo_size Sapling.UTXO.(output.ciphertext) + = state.memo_size)) + transaction.outputs + in + if not pass then return (ctxt, None) + else + (* Check the root is a recent state *) + Sapling_storage.root_mem ctxt state transaction.root >>=? fun pass -> + if not pass then return (ctxt, None) + else + check_and_update_nullifiers ctxt state transaction.inputs >|=? function + | ctxt, None -> (ctxt, None) + | ctxt, Some state -> + Sapling.Verification.with_verification_ctx (fun vctx -> + let pass = + (* Check all the output ZK proofs *) + List.for_all + (fun output -> Sapling.Verification.check_output vctx output) + transaction.outputs + in + if not pass then (ctxt, None) + else + let pass = + (* Check all the input Zk proofs and signatures *) + List.for_all + (fun input -> + Sapling.Verification.check_spend + vctx + input + transaction.root + key) + transaction.inputs + in + if not pass then (ctxt, None) + else + let pass = + (* Check the signature and balance of the whole transaction *) + Sapling.Verification.final_check vctx transaction key + in + if not pass then (ctxt, None) + else + (* update tree *) + let list_to_add = + List.map + (fun output -> + Sapling.UTXO.(output.cm, output.ciphertext)) + transaction.outputs + in + let state = Sapling_storage.add state list_to_add in + (ctxt, Some (transaction.balance, state))) diff --git a/src/proto_016_PtMumbai/lib_protocol/saturation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/saturation_repr.ml new file mode 100644 index 000000000000..47739c809ba2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/saturation_repr.ml @@ -0,0 +1,200 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* let () = assert (Sys.int_size = 63) *) + +type _ t = int + +type mul_safe + +type may_saturate + +let may_saturate : _ t -> may_saturate t = fun x -> x + +let to_int x = x + +let ( < ) : _ t -> _ t -> bool = Compare.Int.( < ) + +let ( <= ) : _ t -> _ t -> bool = Compare.Int.( <= ) + +let ( > ) : _ t -> _ t -> bool = Compare.Int.( > ) + +let ( >= ) : _ t -> _ t -> bool = Compare.Int.( >= ) + +let ( = ) : _ t -> _ t -> bool = Compare.Int.( = ) + +let equal = ( = ) + +let ( <> ) : _ t -> _ t -> bool = Compare.Int.( <> ) + +let max : _ t -> _ t -> _ t = fun x y -> if x >= y then x else y + +let min : _ t -> _ t -> _ t = fun x y -> if x >= y then y else x + +let compare : _ t -> _ t -> _ t = Compare.Int.compare + +let saturated = max_int + +let ( >! ) : _ t -> int -> bool = Compare.Int.( > ) + +let of_int_opt t = if t >= 0 && t < saturated then Some t else None + +let of_z_opt z = + match Z.to_int z with int -> of_int_opt int | exception Z.Overflow -> None + +let to_z x = Z.of_int x + +let saturate_if_undef = function None -> saturated | Some x -> x + +let safe_z z = saturate_if_undef @@ of_z_opt z + +let safe_int x = of_int_opt x |> saturate_if_undef + +let numbits x = + let x = ref x and n = ref 0 in + (let y = !x lsr 32 in + if y <> 0 then ( + n := !n + 32 ; + x := y)) ; + (let y = !x lsr 16 in + if y <> 0 then ( + n := !n + 16 ; + x := y)) ; + (let y = !x lsr 8 in + if y <> 0 then ( + n := !n + 8 ; + x := y)) ; + (let y = !x lsr 4 in + if y <> 0 then ( + n := !n + 4 ; + x := y)) ; + (let y = !x lsr 2 in + if y <> 0 then ( + n := !n + 2 ; + x := y)) ; + if !x lsr 1 <> 0 then !n + 2 else !n + !x + +let zero = 0 + +let one = 1 + +let small_enough z = + (* The following literal triggers an error if compiled under 32-bit + architectures, please do not modify it. This is a static way to + ensure that this file is compiled under a 64-bit architecture. *) + z land 0x7fffffff80000000 = 0 + +let mul_safe x = if small_enough x then Some x else None + +let mul_safe_exn x = + if small_enough x then x + else failwith (Format.sprintf "mul_safe_exn: %d must be below 2147483648" x) + +let mul_safe_of_int_exn x = + Option.bind (of_int_opt x) mul_safe |> function + | None -> + failwith + (Format.sprintf "mul_safe_of_int_exn: %d must be below 2147483648" x) + | Some x -> x + +(* If [x] is positive, shifting to the right will produce a number + which is positive and is less than [x]. *) +let shift_right x y = (x :> int) lsr y + +let shift_left x y = + if shift_right saturated y < x then saturated else (x :> int) lsl y + +let mul x y = + (* assert (x >= 0 && y >= 0); *) + match x with + | 0 -> 0 + | x -> + if small_enough x && small_enough y then x * y + else if Compare.Int.(y > saturated / x) then saturated + else x * y + +let mul_fast x y = x * y + +let scale_fast x y = + if x = 0 then 0 + else if small_enough y then x * y + else if Compare.Int.(y > saturated / x) then saturated + else x * y + +let add x y = + let z = x + y in + if Compare.Int.(z >= 0) then z else saturated + +let succ x = add one x + +let sub x y = Compare.Int.max (x - y) 0 + +let sub_opt x y = + let s = x - y in + if Compare.Int.(s >= 0) then Some s else None + +(* Notice that Z.erem does not behave as mod on negative numbers. + Fortunately, the inhabitant of [t] are non-negative. *) +let erem x y = x mod y + +let ediv x y = x / y + +let sqrt x = + of_int_opt x + |> Option.map (fun x -> Z.of_int x |> Z.sqrt |> Z.to_int) + |> saturate_if_undef + +let t_to_z_exn z = + match of_z_opt z with + | None -> + (* since the encoding is applied to values of type [t]. *) assert false + | Some x -> x + +let z_encoding = Data_encoding.(check_size 9 (conv to_z t_to_z_exn z)) + +let n_encoding = Data_encoding.(check_size 9 (conv to_z t_to_z_exn n)) + +let pp fmt x = Format.pp_print_int fmt x + +module Syntax = struct + (* This is a good enough approximation. S.log2 0 = 1 *) + let log2 x = safe_int (1 + numbits x) + + let sqrt = sqrt + + let ( + ) = add + + let ( - ) = sub + + let ( * ) = mul + + let ( < ) = ( < ) + + let ( = ) = ( = ) + + let ( lsr ) = shift_right + + let ( lsl ) = shift_left +end diff --git a/src/proto_016_PtMumbai/lib_protocol/saturation_repr.mli b/src/proto_016_PtMumbai/lib_protocol/saturation_repr.mli new file mode 100644 index 000000000000..e1fcf58cb233 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/saturation_repr.mli @@ -0,0 +1,234 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides saturated arithmetic between 0 and 2^62 - 1. + + This means that the arithmetic operations provided by this module + do not overflow. If an operation would produce an integer [x] + greater than [2 ^ 62 - 1], it is [saturated] to this + value. Similarly, if an operation would produce a negative integer, + it outputs [zero] instead. + + This saturation arithmetic is used to monitor gas levels. While the + gas model can produce values beyond 2^62 - 1, there is no point in + distinguishing these values from 2^62 - 1 because the amount of gas + available is significantly lower than this limit. + + Notice that most saturation arithmetic operations do not behave + as their standard counterparts when one of their operands is + saturated. For instance, + + (saturated + saturated) - saturated = 0 + + For more information about saturation arithmetic, take a look at: + + https://en.wikipedia.org/wiki/Saturation_arithmetic + +*) + +(** An integer of type ['a t] is between [0] and [saturated]. + + The type parameter ['a] is [mul_safe] if the integer is known + not to overflow when multiplied with another [mul_safe t]. + + The type parameter ['a] is [may_saturate] if the integer is + not known to be sufficiently small to prevent overflow during + multiplication. + +*) +type 'a t = private int + +type mul_safe + +type may_saturate + +val may_saturate : _ t -> may_saturate t + +(** [to_int x] returns the underlying integer representing [x]. *) +val to_int : 'a t -> int + +(** 0 *) +val zero : _ t + +(** 1 *) +val one : _ t + +(** 2^62 - 1 *) +val saturated : may_saturate t + +(** We inherit the order over native integers. *) +val ( >= ) : _ t -> _ t -> bool + +val ( > ) : _ t -> _ t -> bool + +val ( <= ) : _ t -> _ t -> bool + +val ( < ) : _ t -> _ t -> bool + +val ( = ) : _ t -> _ t -> bool + +val ( <> ) : _ t -> _ t -> bool + +val equal : _ t -> _ t -> bool + +val min : 'a t -> 'a t -> 'a t + +val max : 'a t -> 'a t -> 'a t + +val compare : 'a t -> 'b t -> int + +(** [a >! b] is [a > b]. Avoids using [to_int]. *) +val ( >! ) : _ t -> int -> bool + +(** [numbits x] returns the number of bits used in the binary representation + of [x]. *) +val numbits : 'a t -> int + +(** [shift_right x y] behaves like a logical shift of [x] by [y] bits + to the right. [y] must be between 0 and 63. *) +val shift_right : 'a t -> int -> 'a t + +(** [shift_left x y] behaves like a logical shift of [x] by [y] bits + to the left. [y] must be between 0 and 63. In cases where [x lsl y] + is overflowing, [shift_left x y] is [saturated]. *) +val shift_left : 'a t -> int -> 'a t + +(** [mul x y] behaves like multiplication between native integers as + long as its result stay below [saturated]. Otherwise, [mul] returns + [saturated]. *) +val mul : _ t -> _ t -> may_saturate t + +(** [mul_safe x] returns a [mul_safe t] only if [x] does not trigger + overflows when multiplied with another [mul_safe t]. More precisely, + [x] is safe for fast multiplications if [x < 2147483648]. *) +val mul_safe : _ t -> mul_safe t option + +(** [mul_fast x y] exploits the fact that [x] and [y] are known not to + provoke overflows during multiplication to perform a mere + multiplication. *) +val mul_fast : mul_safe t -> mul_safe t -> may_saturate t + +(** [scale_fast x y] exploits the fact that [x] is known not to + provoke overflows during multiplication to perform a + multiplication faster than [mul]. *) +val scale_fast : mul_safe t -> _ t -> may_saturate t + +(** [add x y] behaves like addition between native integers as long as + its result stay below [saturated]. Otherwise, [add] returns + [saturated]. *) +val add : _ t -> _ t -> may_saturate t + +(** [succ x] is like [add one x] *) +val succ : _ t -> may_saturate t + +(** [sub x y] behaves like subtraction between native integers as long + as its result stay positive. Otherwise, [sub] returns [zero]. + This function assumes that [x] is not saturated. +*) +val sub : 'a t -> _ t -> 'a t + +(** [sub_opt x y] behaves like subtraction between native integers as + long as its result stay positive. Otherwise, [sub] returns + [None]. *) +val sub_opt : 'a t -> _ t -> 'a t option + +(** [ediv x y] returns [x / y]. This operation never saturates, hence + it is exactly the same as its native counterpart. [y] is supposed + to be strictly greater than 0, otherwise this function raises + [Division_by_zero]. *) +val ediv : 'a t -> _ t -> 'a t + +(** [erem x y] returns [x mod y]. [y] is supposed to be strictly + greater than 0, otherwise this function raises + [Division_by_zero]. *) +val erem : _ t -> 'b t -> 'b t + +(** [sqrt x] returns the square root of x, rounded down. *) +val sqrt : _ t -> 'a t + +(** [of_int_opt x] returns [Some x] if [x >= 0] and [x < saturated], + and [None] otherwise. *) +val of_int_opt : int -> may_saturate t option + +(** [of_z_opt x] returns [Some x] if [x >= 0] and [x < saturated], + and [None] otherwise. *) +val of_z_opt : Z.t -> may_saturate t option + +(** When a saturated integer is sufficiently small (i.e. strictly less + than 2147483648), we can assign it the type [mul_safe S.t] to use + it within fast multiplications, named [S.scale_fast] and + [S.mul_fast]. + + The following function allows such type assignment but may raise an + exception if the assumption is wrong. Therefore, [mul_safe_exn] + should only be used to define toplevel values, so that these + exceptions can only occur during startup. + *) +val mul_safe_exn : may_saturate t -> mul_safe t + +(** [mul_safe_of_int_exn x] is the composition of [of_int_opt] and + [mul_safe] in the option monad. This function raises [Invalid_argument] + if [x] is not safe. This function should be used on integer literals + that are obviously [mul_safe]. *) +val mul_safe_of_int_exn : int -> mul_safe t + +(** [safe_z z] is [of_z_opt x |> saturate_if_undef]. *) +val safe_z : Z.t -> may_saturate t + +(** [safe_int x] is [of_int_opt x |> saturate_if_undef]. *) +val safe_int : int -> may_saturate t + +(** [to_z z] is [Z.of_int]. *) +val to_z : _ t -> Z.t + +(** Encoding for [t] through the encoding for [z] integers. *) +val z_encoding : _ t Data_encoding.t + +(** Encoding for [t] through the encoding for non-negative integers. *) +val n_encoding : _ t Data_encoding.t + +(** A pretty-printer for native integers. *) +val pp : Format.formatter -> _ t -> unit + +(** Syntax for simple representations. *) +module Syntax : sig + val log2 : _ t -> may_saturate t + + val sqrt : _ t -> may_saturate t + + val ( + ) : _ t -> _ t -> may_saturate t + + val ( - ) : _ t -> _ t -> may_saturate t + + val ( * ) : _ t -> _ t -> may_saturate t + + val ( < ) : _ t -> _ t -> bool + + val ( = ) : _ t -> _ t -> bool + + val ( lsr ) : 'a t -> int -> 'a t + + val ( lsl ) : 'a t -> int -> 'a t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_PVM_sig.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_PVM_sig.ml new file mode 100644 index 000000000000..024dff2ccaf0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_PVM_sig.ml @@ -0,0 +1,557 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module introduces the semantics of Proof-generating Virtual Machines. + + A PVM defines an operational semantics for some computational model. The + specificity of PVMs, in comparison with standard virtual machines, is their + ability to generate and to validate a *compact* proof that a given atomic + execution step turned a given state into another one. + + In the smart-contract rollups, PVMs are used for two purposes: + + - They allow for the externalization of rollup execution by completely + specifying the operational semantics of a given rollup. This + standardization of the semantics gives a unique and executable source of + truth about the interpretation of smart-contract rollup inboxes, seen as a + transformation of a rollup state. + + - They allow for the validation or refutation of a claim that the processing + of some messages led to a given new rollup state (given an actual source + of truth about the nature of these messages). +*) + +(** An input to a PVM is the [message_counter] element of an inbox at + a given [inbox_level] and contains a given [payload]. + + According the rollup management protocol, the payload must be obtained + through {!Sc_rollup_inbox_message_repr.serialize} which follows a documented + format. +*) + +type inbox_message = { + inbox_level : Raw_level_repr.t; + message_counter : Z.t; + payload : Sc_rollup_inbox_message_repr.serialized; +} + +type reveal_data = + | Raw_data of string + | Metadata of Sc_rollup_metadata_repr.t + | Dal_page of Dal_slot_repr.Page.content option + +type input = Inbox_message of inbox_message | Reveal of reveal_data + +let pp_inbox_message fmt {inbox_level; message_counter; _} = + Format.fprintf + fmt + "@[<v 2>level: %a@,message index: %a@]" + Raw_level_repr.pp + inbox_level + Z.pp_print + message_counter + +let pp_reveal_data fmt = function + | Raw_data _ -> Format.pp_print_string fmt "raw data" + | Metadata metadata -> Sc_rollup_metadata_repr.pp fmt metadata + | Dal_page content_opt -> + Format.pp_print_option + ~none:(fun fmt () -> Format.pp_print_string fmt "<No_dal_data>") + (fun fmt _a -> Format.fprintf fmt "<Some_dal_data>") + fmt + content_opt + +let pp_input fmt = function + | Inbox_message msg -> + Format.fprintf fmt "@[<v 2>inbox message:@,%a@]" pp_inbox_message msg + | Reveal reveal -> + Format.fprintf fmt "@[<v 2>reveal: %a@]" pp_reveal_data reveal + +(** [inbox_message_encoding] encoding value for {!inbox_message}. *) +let inbox_message_encoding = + let open Data_encoding in + conv + (fun {inbox_level; message_counter; payload} -> + (inbox_level, message_counter, (payload :> string))) + (fun (inbox_level, message_counter, payload) -> + let payload = Sc_rollup_inbox_message_repr.unsafe_of_string payload in + {inbox_level; message_counter; payload}) + (obj3 + (req "inbox_level" Raw_level_repr.encoding) + (req "message_counter" n) + (req "payload" (string Hex))) + +let reveal_data_encoding = + let open Data_encoding in + let case_raw_data = + case + ~title:"raw data" + (Tag 0) + (obj2 + (req "reveal_data_kind" (constant "raw_data")) + (req + "raw_data" + (check_size + Constants_repr.sc_rollup_message_size_limit + Variable.(string Hex)))) + (function Raw_data m -> Some ((), m) | _ -> None) + (fun ((), m) -> Raw_data m) + and case_metadata = + case + ~title:"metadata" + (Tag 1) + (obj2 + (req "reveal_data_kind" (constant "metadata")) + (req "metadata" Sc_rollup_metadata_repr.encoding)) + (function Metadata md -> Some ((), md) | _ -> None) + (fun ((), md) -> Metadata md) + in + let case_dal_page = + case + ~title:"dal page" + (Tag 2) + (obj2 + (req "reveal_data_kind" (constant "dal_page")) + (req "dal_page_content" (option (bytes Hex)))) + (function Dal_page p -> Some ((), p) | _ -> None) + (fun ((), p) -> Dal_page p) + in + union [case_raw_data; case_metadata; case_dal_page] + +let input_encoding = + let open Data_encoding in + let case_inbox_message = + case + ~title:"inbox msg" + (Tag 0) + (obj2 + (req "input_kind" (constant "inbox_message")) + (req "inbox_message" inbox_message_encoding)) + (function Inbox_message m -> Some ((), m) | _ -> None) + (fun ((), m) -> Inbox_message m) + and case_reveal_revelation = + case + ~title:"reveal" + (Tag 1) + (obj2 + (req "input_kind" (constant "reveal_revelation")) + (req "reveal_data" reveal_data_encoding)) + (function Reveal d -> Some ((), d) | _ -> None) + (fun ((), d) -> Reveal d) + in + union [case_inbox_message; case_reveal_revelation] + +(** [input_equal i1 i2] return whether [i1] and [i2] are equal. *) +let inbox_message_equal a b = + let {inbox_level; message_counter; payload} = a in + (* To be robust to the addition of fields in [input] *) + Raw_level_repr.equal inbox_level b.inbox_level + && Z.equal message_counter b.message_counter + && String.equal (payload :> string) (b.payload :> string) + +let reveal_data_equal a b = + match (a, b) with + | Raw_data a, Raw_data b -> String.equal a b + | Raw_data _, _ -> false + | Metadata a, Metadata b -> Sc_rollup_metadata_repr.equal a b + | Metadata _, _ -> false + | Dal_page a, Dal_page b -> Option.equal Bytes.equal a b + | Dal_page _, _ -> false + +let input_equal a b = + match (a, b) with + | Inbox_message a, Inbox_message b -> inbox_message_equal a b + | Inbox_message _, _ -> false + | Reveal a, Reveal b -> reveal_data_equal a b + | Reveal _, _ -> false + +module Input_hash = + Blake2B.Make + (Base58) + (struct + let name = "Sc_rollup_input_hash" + + let title = "A smart contract rollup input hash" + + let b58check_prefix = + "\001\118\125\135" (* "scd1(37)" decoded from base 58. *) + + let size = Some 20 + end) + +type reveal = + | Reveal_raw_data of Sc_rollup_reveal_hash.t + | Reveal_metadata + | Request_dal_page of Dal_slot_repr.Page.t + +let reveal_encoding = + let open Data_encoding in + let case_raw_data = + case + ~title:"Reveal_raw_data" + (Tag 0) + (obj2 + (req "reveal_kind" (constant "reveal_raw_data")) + (req "input_hash" Sc_rollup_reveal_hash.encoding)) + (function Reveal_raw_data s -> Some ((), s) | _ -> None) + (fun ((), s) -> Reveal_raw_data s) + and case_metadata = + case + ~title:"Reveal_metadata" + (Tag 1) + (obj1 (req "reveal_kind" (constant "reveal_metadata"))) + (function Reveal_metadata -> Some () | _ -> None) + (fun () -> Reveal_metadata) + in + let case_dal_page = + case + ~title:"Request_dal_page" + (Tag 2) + (obj2 + (req "reveal_kind" (constant "request_dal_page")) + (req "page_id" Dal_slot_repr.Page.encoding)) + (function Request_dal_page s -> Some ((), s) | _ -> None) + (fun ((), s) -> Request_dal_page s) + in + union [case_raw_data; case_metadata; case_dal_page] + +(** The PVM's current input expectations: + - [No_input_required] if the machine is busy and has no need for new input. + + - [Initial] if the machine has never received an input so expects the very + first item in the inbox. + + - [First_after (level, counter)] expects whatever comes next after that + position in the inbox. + + - [Needs_metadata] if the machine needs the metadata to continue + its execution. +*) +type input_request = + | No_input_required + | Initial + | First_after of Raw_level_repr.t * Z.t + | Needs_reveal of reveal + +(** [input_request_encoding] encoding value for {!input_request}. *) +let input_request_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"No_input_required" + (Tag 0) + (obj1 (req "input_request_kind" (constant "no_input_required"))) + (function No_input_required -> Some () | _ -> None) + (fun () -> No_input_required); + case + ~title:"Initial" + (Tag 1) + (obj1 (req "input_request_kind" (constant "initial"))) + (function Initial -> Some () | _ -> None) + (fun () -> Initial); + case + ~title:"First_after" + (Tag 2) + (obj3 + (req "input_request_kind" (constant "first_after")) + (req "level" Raw_level_repr.encoding) + (req "counter" n)) + (function + | First_after (level, counter) -> Some ((), level, counter) + | _ -> None) + (fun ((), level, counter) -> First_after (level, counter)); + case + ~title:"Needs_reveal" + (Tag 3) + (obj2 + (req "input_request_kind" (constant "needs_reveal")) + (req "reveal" reveal_encoding)) + (function Needs_reveal p -> Some ((), p) | _ -> None) + (fun ((), p) -> Needs_reveal p); + ] + +let pp_reveal fmt = function + | Reveal_raw_data hash -> Sc_rollup_reveal_hash.pp fmt hash + | Reveal_metadata -> Format.pp_print_string fmt "Reveal metadata" + | Request_dal_page id -> Dal_slot_repr.Page.pp fmt id + +(** [pp_input_request fmt i] pretty prints the given input [i] to the formatter + [fmt]. *) +let pp_input_request fmt request = + match request with + | No_input_required -> Format.fprintf fmt "No_input_required" + | Initial -> Format.fprintf fmt "Initial" + | First_after (l, n) -> + Format.fprintf + fmt + "First_after (level = %a, counter = %a)" + Raw_level_repr.pp + l + Z.pp_print + n + | Needs_reveal reveal -> + Format.fprintf fmt "Needs reveal of %a" pp_reveal reveal + +let reveal_equal p1 p2 = + match (p1, p2) with + | Reveal_raw_data h1, Reveal_raw_data h2 -> Sc_rollup_reveal_hash.equal h1 h2 + | Reveal_metadata, Reveal_metadata -> true + | Request_dal_page a, Request_dal_page b -> Dal_slot_repr.Page.equal a b + | (Reveal_raw_data _ | Reveal_metadata | Request_dal_page _), _ -> false + +(** [input_request_equal i1 i2] return whether [i1] and [i2] are equal. *) +let input_request_equal a b = + match (a, b) with + | No_input_required, No_input_required -> true + | No_input_required, _ -> false + | Initial, Initial -> true + | Initial, _ -> false + | First_after (l, n), First_after (m, o) -> + Raw_level_repr.equal l m && Z.equal n o + | First_after _, _ -> false + | Needs_reveal p1, Needs_reveal p2 -> reveal_equal p1 p2 + | Needs_reveal _, _ -> false + +(** Type that describes output values. *) +type output = { + outbox_level : Raw_level_repr.t; + (** The outbox level containing the message. The level corresponds to the + inbox level for which the message was produced. *) + message_index : Z.t; (** The message index. *) + message : Sc_rollup_outbox_message_repr.t; (** The message itself. *) +} + +(** [output_encoding] encoding value for {!output}. *) +let output_encoding = + let open Data_encoding in + conv + (fun {outbox_level; message_index; message} -> + (outbox_level, message_index, message)) + (fun (outbox_level, message_index, message) -> + {outbox_level; message_index; message}) + (obj3 + (req "outbox_level" Raw_level_repr.encoding) + (req "message_index" n) + (req "message" Sc_rollup_outbox_message_repr.encoding)) + +(** [pp_output fmt o] pretty prints the given output [o] to the formatter + [fmt]. *) +let pp_output fmt {outbox_level; message_index; message} = + Format.fprintf + fmt + "@[%a@;%a@;%a@;@]" + Raw_level_repr.pp + outbox_level + Z.pp_print + message_index + Sc_rollup_outbox_message_repr.pp + message + +module type S = sig + (** The state of the PVM denotes a state of the rollup. + + The life cycle of the PVM is as follows. It starts its execution + from an {!initial_state}. The initial state is specialized at + origination with a [boot_sector], using the + {!install_boot_sector} function. The resulting state is call the + “genesis” of the rollup. + + Afterwards, we classify states into two categories: "internal + states" do not require any external information to be executed + while "input states" are waiting for some information from the + inbox to be executable. *) + type state + + val pp : state -> (Format.formatter -> unit -> unit) Lwt.t + + (** A [context] represents the executable environment needed by the state to + exist. Typically, the rollup node storage can be part of this context to + allow the PVM state to be persistent. *) + type context + + (** A [hash] characterizes the contents of a state. *) + type hash = Sc_rollup_repr.State_hash.t + + (** During interactive refutation games, a player may need to provide a proof + that a given execution step is valid. The PVM implementation is + responsible for ensuring that this proof type has the correct semantics. + + A proof [p] has four parameters: + + - [start_hash := proof_start_state p] + - [stop_hash := proof_stop_state p] + - [input_requested := proof_input_requested p] + - [input_given := proof_input_given p] + + The following predicate must hold of a valid proof: + + [exists start_state, stop_state. + (state_hash start_state == start_hash) + AND (Option.map state_hash stop_state == stop_hash) + AND (is_input_state start_state == input_requested) + AND (match (input_given, input_requested) with + | (None, No_input_required) -> eval start_state == stop_state + | (None, Initial) -> stop_state == None + | (None, First_after (l, n)) -> stop_state == None + | (Some input, No_input_required) -> true + | (Some input, Initial) -> + set_input input_given start_state == stop_state + | (Some input, First_after (l, n)) -> + set_input input_given start_state == stop_state)] + + In natural language---the two hash parameters [start_hash] and [stop_hash] + must have actual [state] values (or possibly [None] in the case of + [stop_hash]) of which they are the hashes. The [input_requested] parameter + must be the correct request from the [start_hash], given according to + [is_input_state]. Finally there are four possibilities of [input_requested] + and [input_given]. + + - if no input is required, or given, the proof is a simple [eval] + step ; + - if input was required but not given, the [stop_hash] must be + [None] (the machine is blocked) ; + - if no input was required but some was given, this makes no sense + and it doesn't matter if the proof is valid or invalid (this + case will be ruled out by the inbox proof anyway) ; + - finally, if input was required and given, the proof is a + [set_input] step. *) + type proof + + (** [proof]s are embedded in L1 refutation game operations using + [proof_encoding]. Given that the size of L1 operations are limited, it is + of *critical* importance to make sure that no execution step of the PVM + can generate proofs that do not fit in L1 operations when encoded. If such + a proof existed, the rollup could get stuck. *) + val proof_encoding : proof Data_encoding.t + + (** [proof_start_state proof] returns the initial state hash of the [proof] + execution step. *) + val proof_start_state : proof -> hash + + (** [proof_stop_state proof] returns the final state hash of the [proof] + execution step. *) + val proof_stop_state : proof -> hash + + (** [state_hash state] returns a compressed representation of [state]. *) + val state_hash : state -> hash Lwt.t + + (** [initial_state ~empty] is the initial state of the PVM, before its + specialization with a given [boot_sector]. The initial state is built on + the [empty] state which must be provided. *) + val initial_state : empty:state -> state Lwt.t + + (** [install_boot_sector state boot_sector] specializes the initial + [state] of a PVM using a dedicated [boot_sector], submitted at + the origination of the rollup. *) + val install_boot_sector : state -> string -> state Lwt.t + + (** [is_input_state state] returns the input expectations of the + [state]---does it need input, and if so, how far through the inbox + has it read so far? *) + val is_input_state : state -> input_request Lwt.t + + (** [set_input input state] sets [input] in [state] as the next + input to be processed. This must answer the [input_request] + from [is_input_state state]. *) + val set_input : input -> state -> state Lwt.t + + (** [eval s0] returns a state [s1] resulting from the + execution of an atomic step of the rollup at state [s0]. *) + val eval : state -> state Lwt.t + + (** [verify_proof input p] checks the proof [p] with input [input] and returns + the [input_request] before the evaluation of the proof. See the doc-string + for the [proof] type. + + [verify_proof input p] fails when the proof is invalid in regards to the + given input. *) + val verify_proof : input option -> proof -> input_request tzresult Lwt.t + + (** [produce_proof ctxt input_given state] should return a [proof] for + the PVM step starting from [state], if possible. This may fail for + a few reasons: + - the [input_given] doesn't match the expectations of [state] ; + - the [context] for this instance of the PVM doesn't have access + to enough of the [state] to build the proof. *) + val produce_proof : context -> input option -> state -> proof tzresult Lwt.t + + (** [verify_origination_proof proof boot_sector] verifies a proof + supposedly generated by [produce_origination_proof]. *) + val verify_origination_proof : proof -> string -> bool Lwt.t + + (** [produce_origination_proof context boot_sector] produces a proof + [p] covering the specialization of a PVM, from the + [initial_state] up to the genesis state wherein the + [boot_sector] has been installed. *) + val produce_origination_proof : context -> string -> proof tzresult Lwt.t + + (** The following type is inhabited by the proofs that a given [output] + is part of the outbox of a given [state]. *) + type output_proof + + (** [output_proof_encoding] encoding value for [output_proof]s. *) + val output_proof_encoding : output_proof Data_encoding.t + + (** [output_of_output_proof proof] returns the [output] that is referred to in + [proof]'s statement. *) + val output_of_output_proof : output_proof -> output + + (** [state_of_output_proof proof] returns the [state] hash that is referred to + in [proof]'s statement. *) + val state_of_output_proof : output_proof -> hash + + (** [verify_output_proof output_proof] returns [true] iff [proof] is a valid + witness that its [output] is part of its [state]'s outbox. *) + val verify_output_proof : output_proof -> bool Lwt.t + + (** [produce_output_proof ctxt state output] returns a proof that witnesses + the fact that [output] is part of [state]'s outbox. *) + val produce_output_proof : + context -> state -> output -> (output_proof, error) result Lwt.t + + (** [check_dissection ~default_number_of_sections ~start_chunk + ~stop_chunk chunks] fails if the dissection encoded by the list + [[start_chunk] @ chunks @ [stop_chunk]] does not satisfy the + properties expected by the PVM. *) + val check_dissection : + default_number_of_sections:int -> + start_chunk:Sc_rollup_dissection_chunk_repr.t -> + stop_chunk:Sc_rollup_dissection_chunk_repr.t -> + Sc_rollup_dissection_chunk_repr.t list -> + unit tzresult + + (** [get_current_level state] returns the current level of the [state], + returns [None] if it is not possible to compute the level. *) + val get_current_level : state -> Raw_level_repr.t option Lwt.t + + module Internal_for_tests : sig + (** [insert_failure state] corrupts the PVM state. This is used in + the loser mode of the rollup node. *) + val insert_failure : state -> state Lwt.t + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.ml new file mode 100644 index 000000000000..55c930c3adc8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.ml @@ -0,0 +1,1549 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr +module PS = Sc_rollup_PVM_sig + +(* + This is the state hash of reference that both the prover of the node + and the verifier of the protocol {!Protocol_implementation} have to + agree on (if they do, it means they are using the same tree + structure). + + We have to hard-code this value because the Arith PVM uses Irmin as + its Merkle proof verification backend, and the economic protocol + cannot create an empty Irmin context. Such a context is required to + create an empty tree, itself required to create the initial state of + the Arith PVM. + + Utlimately, the value of this constant is decided by the prover of + reference (the only need is for it to be compatible with + {!Protocol_implementation}.) + + Its value is the result of the following snippet + + {| + let*! state = Prover.initial_state ~empty in + Prover.state_hash state + |} +*) +let reference_initial_state_hash = + State_hash.of_b58check_exn + "scs11cXwQJJ5dkpEQGq3x2MJm3cM73cbEkHJqo5eDSoRpHUPyEQLB4" + +type error += + | Arith_proof_production_failed + | Arith_output_proof_production_failed + | Arith_invalid_claim_about_outbox + +let () = + let open Data_encoding in + let msg = "Invalid claim about outbox" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_invalid_claim_about_outbox" + ~title:msg + ~pp:(fun fmt () -> Format.pp_print_string fmt msg) + ~description:msg + unit + (function Arith_invalid_claim_about_outbox -> Some () | _ -> None) + (fun () -> Arith_invalid_claim_about_outbox) ; + let msg = "Output proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_output_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Arith_output_proof_production_failed -> Some () | _ -> None) + (fun () -> Arith_output_proof_production_failed) ; + let msg = "Proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Arith_proof_production_failed -> Some () | _ -> None) + (fun () -> Arith_proof_production_failed) + +module type P = sig + module Tree : Context.TREE with type key = string list and type value = bytes + + type tree = Tree.tree + + val hash_tree : tree -> State_hash.t + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> State_hash.t + + val proof_after : proof -> State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t +end + +module type S = sig + include PS.S + + val parse_boot_sector : string -> string option + + val pp_boot_sector : Format.formatter -> string -> unit + + val pp : state -> (Format.formatter -> unit -> unit) Lwt.t + + val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t + + type status = + | Halted + | Waiting_for_input_message + | Waiting_for_reveal + | Waiting_for_metadata + | Parsing + | Evaluating + + val get_status : state -> status Lwt.t + + val get_outbox : + Raw_level_repr.t -> state -> Sc_rollup_PVM_sig.output list Lwt.t + + type instruction = + | IPush : int -> instruction + | IAdd : instruction + | IStore : string -> instruction + + val equal_instruction : instruction -> instruction -> bool + + val pp_instruction : Format.formatter -> instruction -> unit + + val get_parsing_result : state -> bool option Lwt.t + + val get_code : state -> instruction list Lwt.t + + val get_stack : state -> int list Lwt.t + + val get_var : state -> string -> int option Lwt.t + + val get_evaluation_result : state -> bool option Lwt.t + + val get_is_stuck : state -> string option Lwt.t +end + +module Make (Context : P) : + S + with type context = Context.Tree.t + and type state = Context.tree + and type proof = Context.proof = struct + module Tree = Context.Tree + + type context = Context.Tree.t + + type hash = State_hash.t + + type proof = Context.proof + + let proof_encoding = Context.proof_encoding + + let proof_start_state proof = Context.proof_before proof + + let proof_stop_state proof = Context.proof_after proof + + let parse_boot_sector s = Some s + + let pp_boot_sector fmt s = Format.fprintf fmt "%s" s + + type tree = Tree.tree + + type status = + | Halted + | Waiting_for_input_message + | Waiting_for_reveal + | Waiting_for_metadata + | Parsing + | Evaluating + + type instruction = + | IPush : int -> instruction + | IAdd : instruction + | IStore : string -> instruction + + let equal_instruction i1 i2 = + match (i1, i2) with + | IPush x, IPush y -> Compare.Int.(x = y) + | IAdd, IAdd -> true + | IStore x, IStore y -> Compare.String.(x = y) + | _, _ -> false + + let pp_instruction fmt = function + | IPush x -> Format.fprintf fmt "push(%d)" x + | IAdd -> Format.fprintf fmt "add" + | IStore x -> Format.fprintf fmt "store(%s)" x + + let check_dissection ~default_number_of_sections ~start_chunk ~stop_chunk = + let open Sc_rollup_dissection_chunk_repr in + let dist = Sc_rollup_tick_repr.distance start_chunk.tick stop_chunk.tick in + let section_maximum_size = Z.div dist (Z.of_int 2) in + Sc_rollup_dissection_chunk_repr.( + default_check + ~section_maximum_size + ~check_sections_number:default_check_sections_number + ~default_number_of_sections + ~start_chunk + ~stop_chunk) + + (* + + The machine state is represented using a Merkle tree. + + Here is the data model of this state represented in the tree: + + - tick : Sc_rollup_tick_repr.t + The current tick counter of the machine. + - status : status + The current status of the machine. + - stack : int deque + The stack of integers. + - next_message : string option + The current input message to be processed. + - code : instruction deque + The instructions parsed from the input message. + - lexer_state : int * int + The internal state of the lexer. + - parsing_state : parsing_state + The internal state of the parser. + - parsing_result : bool option + The outcome of parsing. + - evaluation_result : bool option + The outcome of evaluation. + + *) + module State = struct + type state = tree + + module Monad : sig + type 'a t + + val run : 'a t -> state -> (state * 'a option) Lwt.t + + val is_stuck : string option t + + val internal_error : string -> 'a t + + val return : 'a -> 'a t + + module Syntax : sig + val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t + end + + val remove : Tree.key -> unit t + + val find_value : Tree.key -> 'a Data_encoding.t -> 'a option t + + val children : Tree.key -> 'a Data_encoding.t -> (string * 'a) list t + + val get_value : default:'a -> Tree.key -> 'a Data_encoding.t -> 'a t + + val set_value : Tree.key -> 'a Data_encoding.t -> 'a -> unit t + end = struct + type 'a t = state -> (state * 'a option) Lwt.t + + let return x state = Lwt.return (state, Some x) + + let bind m f state = + let open Lwt_syntax in + let* state, res = m state in + match res with None -> return (state, None) | Some res -> f res state + + module Syntax = struct + let ( let* ) = bind + end + + let run m state = m state + + let internal_error_key = ["internal_error"] + + let internal_error msg tree = + let open Lwt_syntax in + let* tree = Tree.add tree internal_error_key (Bytes.of_string msg) in + return (tree, None) + + let is_stuck tree = + let open Lwt_syntax in + let* v = Tree.find tree internal_error_key in + return (tree, Some (Option.map Bytes.to_string v)) + + let remove key tree = + let open Lwt_syntax in + let* tree = Tree.remove tree key in + return (tree, Some ()) + + let decode encoding bytes state = + let open Lwt_syntax in + match Data_encoding.Binary.of_bytes_opt encoding bytes with + | None -> internal_error "Error during decoding" state + | Some v -> return (state, Some v) + + let find_value key encoding state = + let open Lwt_syntax in + let* obytes = Tree.find state key in + match obytes with + | None -> return (state, Some None) + | Some bytes -> + let* state, value = decode encoding bytes state in + return (state, Some value) + + let children key encoding state = + let open Lwt_syntax in + let* children = Tree.list state key in + let rec aux = function + | [] -> return (state, Some []) + | (key, tree) :: children -> ( + let* obytes = Tree.to_value tree in + match obytes with + | None -> internal_error "Invalid children" state + | Some bytes -> ( + let* state, v = decode encoding bytes state in + match v with + | None -> return (state, None) + | Some v -> ( + let* state, l = aux children in + match l with + | None -> return (state, None) + | Some l -> return (state, Some ((key, v) :: l))))) + in + aux children + + let get_value ~default key encoding = + let open Syntax in + let* ov = find_value key encoding in + match ov with None -> return default | Some x -> return x + + let set_value key encoding value tree = + let open Lwt_syntax in + Data_encoding.Binary.to_bytes_opt encoding value |> function + | None -> internal_error "Internal_Error during encoding" tree + | Some bytes -> + let* tree = Tree.add tree key bytes in + return (tree, Some ()) + end + + open Monad + + module Make_var (P : sig + type t + + val name : string + + val initial : t + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + end) = + struct + let key = [P.name] + + let create = set_value key P.encoding P.initial + + let get = + let open Monad.Syntax in + let* v = find_value key P.encoding in + match v with + | None -> + (* This case should not happen if [create] is properly called. *) + return P.initial + | Some v -> return v + + let set = set_value key P.encoding + + let pp = + let open Monad.Syntax in + let* v = get in + return @@ fun fmt () -> Format.fprintf fmt "@[%s : %a@]" P.name P.pp v + end + + module Make_dict (P : sig + type t + + val name : string + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + end) = + struct + let key k = [P.name; k] + + let get k = find_value (key k) P.encoding + + let set k v = set_value (key k) P.encoding v + + let entries = children [P.name] P.encoding + + let mapped_to k v state = + let open Lwt_syntax in + let* state', _ = Monad.(run (set k v) state) in + let* t = Tree.find_tree state (key k) + and* t' = Tree.find_tree state' (key k) in + Lwt.return (Option.equal Tree.equal t t') + + let pp = + let open Monad.Syntax in + let* l = entries in + let pp_elem fmt (key, value) = + Format.fprintf fmt "@[%s : %a@]" key P.pp value + in + return @@ fun fmt () -> Format.pp_print_list pp_elem fmt l + end + + module Make_deque (P : sig + type t + + val name : string + + val encoding : t Data_encoding.t + end) = + struct + (* + + A stateful deque. + + [[head; end[] is the index range for the elements of the deque. + + The length of the deque is therefore [end - head]. + + *) + + let head_key = [P.name; "head"] + + let end_key = [P.name; "end"] + + let get_head = get_value ~default:Z.zero head_key Data_encoding.z + + let set_head = set_value head_key Data_encoding.z + + let get_end = get_value ~default:(Z.of_int 0) end_key Data_encoding.z + + let set_end = set_value end_key Data_encoding.z + + let idx_key idx = [P.name; Z.to_string idx] + + let top = + let open Monad.Syntax in + let* head_idx = get_head in + let* end_idx = get_end in + let* v = find_value (idx_key head_idx) P.encoding in + if Z.(leq end_idx head_idx) then return None + else + match v with + | None -> (* By invariants of the Deque. *) assert false + | Some x -> return (Some x) + + let push x = + let open Monad.Syntax in + let* head_idx = get_head in + let head_idx' = Z.pred head_idx in + let* () = set_head head_idx' in + set_value (idx_key head_idx') P.encoding x + + let pop = + let open Monad.Syntax in + let* head_idx = get_head in + let* end_idx = get_end in + if Z.(leq end_idx head_idx) then return None + else + let* v = find_value (idx_key head_idx) P.encoding in + match v with + | None -> (* By invariants of the Deque. *) assert false + | Some x -> + let* () = remove (idx_key head_idx) in + let head_idx = Z.succ head_idx in + let* () = set_head head_idx in + return (Some x) + + let inject x = + let open Monad.Syntax in + let* end_idx = get_end in + let end_idx' = Z.succ end_idx in + let* () = set_end end_idx' in + set_value (idx_key end_idx) P.encoding x + + let to_list = + let open Monad.Syntax in + let* head_idx = get_head in + let* end_idx = get_end in + let rec aux l idx = + if Z.(lt idx head_idx) then return l + else + let* v = find_value (idx_key idx) P.encoding in + match v with + | None -> (* By invariants of deque *) assert false + | Some v -> aux (v :: l) (Z.pred idx) + in + aux [] (Z.pred end_idx) + + let clear = remove [P.name] + end + + module Current_tick = Make_var (struct + include Sc_rollup_tick_repr + + let name = "tick" + end) + + module Vars = Make_dict (struct + type t = int + + let name = "vars" + + let encoding = Data_encoding.int31 + + let pp fmt x = Format.fprintf fmt "%d" x + end) + + module Stack = Make_deque (struct + type t = int + + let name = "stack" + + let encoding = Data_encoding.int31 + end) + + module Code = Make_deque (struct + type t = instruction + + let name = "code" + + let encoding = + Data_encoding.( + union + [ + case + ~title:"push" + (Tag 0) + Data_encoding.int31 + (function IPush x -> Some x | _ -> None) + (fun x -> IPush x); + case + ~title:"add" + (Tag 1) + Data_encoding.unit + (function IAdd -> Some () | _ -> None) + (fun () -> IAdd); + case + ~title:"store" + (Tag 2) + Data_encoding.(string Plain) + (function IStore x -> Some x | _ -> None) + (fun x -> IStore x); + ]) + end) + + module Boot_sector = Make_var (struct + type t = string + + let name = "boot_sector" + + let initial = "" + + let encoding = Data_encoding.(string Plain) + + let pp fmt s = Format.fprintf fmt "%s" s + end) + + module Status = Make_var (struct + type t = status + + let initial = Halted + + let encoding = + Data_encoding.string_enum + [ + ("Halted", Halted); + ("Waiting_for_input_message", Waiting_for_input_message); + ("Waiting_for_reveal", Waiting_for_reveal); + ("Waiting_for_metadata", Waiting_for_metadata); + ("Parsing", Parsing); + ("Evaluating", Evaluating); + ] + + let name = "status" + + let string_of_status = function + | Halted -> "Halted" + | Waiting_for_input_message -> "Waiting for input message" + | Waiting_for_reveal -> "Waiting for reveal" + | Waiting_for_metadata -> "Waiting for metadata" + | Parsing -> "Parsing" + | Evaluating -> "Evaluating" + + let pp fmt status = Format.fprintf fmt "%s" (string_of_status status) + end) + + module Required_reveal = Make_var (struct + type t = PS.reveal option + + let initial = None + + let encoding = Data_encoding.option PS.reveal_encoding + + let name = "required_reveal" + + let pp fmt v = + match v with + | None -> Format.fprintf fmt "<none>" + | Some h -> PS.pp_reveal fmt h + end) + + module Metadata = Make_var (struct + type t = Sc_rollup_metadata_repr.t option + + let initial = None + + let encoding = Data_encoding.option Sc_rollup_metadata_repr.encoding + + let name = "metadata" + + let pp fmt v = + match v with + | None -> Format.fprintf fmt "<none>" + | Some v -> Sc_rollup_metadata_repr.pp fmt v + end) + + module Current_level = Make_var (struct + type t = Raw_level_repr.t + + let initial = Raw_level_repr.root + + let encoding = Raw_level_repr.encoding + + let name = "current_level" + + let pp = Raw_level_repr.pp + end) + + module Message_counter = Make_var (struct + type t = Z.t option + + let initial = None + + let encoding = Data_encoding.option Data_encoding.n + + let name = "message_counter" + + let pp fmt = function + | None -> Format.fprintf fmt "None" + | Some c -> Format.fprintf fmt "Some %a" Z.pp_print c + end) + + (** Store an internal message counter. This is used to distinguish + an unparsable external message and a internal message, which we both + treat as no-ops. *) + module Internal_message_counter = Make_var (struct + type t = Z.t + + let initial = Z.zero + + let encoding = Data_encoding.n + + let name = "internal_message_counter" + + let pp fmt c = Z.pp_print fmt c + end) + + let incr_internal_message_counter = + let open Monad.Syntax in + let* current_counter = Internal_message_counter.get in + Internal_message_counter.set (Z.succ current_counter) + + module Next_message = Make_var (struct + type t = string option + + let initial = None + + let encoding = Data_encoding.(option (string Plain)) + + let name = "next_message" + + let pp fmt = function + | None -> Format.fprintf fmt "None" + | Some s -> Format.fprintf fmt "Some %s" s + end) + + type parser_state = ParseInt | ParseVar | SkipLayout + + module Lexer_state = Make_var (struct + type t = int * int + + let name = "lexer_buffer" + + let initial = (-1, -1) + + let encoding = Data_encoding.(tup2 int31 int31) + + let pp fmt (start, len) = + Format.fprintf fmt "lexer.(start = %d, len = %d)" start len + end) + + module Parser_state = Make_var (struct + type t = parser_state + + let name = "parser_state" + + let initial = SkipLayout + + let encoding = + Data_encoding.string_enum + [ + ("ParseInt", ParseInt); + ("ParseVar", ParseVar); + ("SkipLayout", SkipLayout); + ] + + let pp fmt = function + | ParseInt -> Format.fprintf fmt "Parsing int" + | ParseVar -> Format.fprintf fmt "Parsing var" + | SkipLayout -> Format.fprintf fmt "Skipping layout" + end) + + module Parsing_result = Make_var (struct + type t = bool option + + let name = "parsing_result" + + let initial = None + + let encoding = Data_encoding.(option bool) + + let pp fmt = function + | None -> Format.fprintf fmt "n/a" + | Some true -> Format.fprintf fmt "parsing succeeds" + | Some false -> Format.fprintf fmt "parsing fails" + end) + + module Evaluation_result = Make_var (struct + type t = bool option + + let name = "evaluation_result" + + let initial = None + + let encoding = Data_encoding.(option bool) + + let pp fmt = function + | None -> Format.fprintf fmt "n/a" + | Some true -> Format.fprintf fmt "evaluation succeeds" + | Some false -> Format.fprintf fmt "evaluation fails" + end) + + module Output_counter = Make_var (struct + type t = Z.t + + let initial = Z.zero + + let name = "output_counter" + + let encoding = Data_encoding.n + + let pp = Z.pp_print + end) + + module Output = Make_dict (struct + type t = Sc_rollup_PVM_sig.output + + let name = "output" + + let encoding = Sc_rollup_PVM_sig.output_encoding + + let pp = Sc_rollup_PVM_sig.pp_output + end) + + let pp = + let open Monad.Syntax in + let* status_pp = Status.pp in + let* message_counter_pp = Message_counter.pp in + let* next_message_pp = Next_message.pp in + let* parsing_result_pp = Parsing_result.pp in + let* parser_state_pp = Parser_state.pp in + let* lexer_state_pp = Lexer_state.pp in + let* evaluation_result_pp = Evaluation_result.pp in + let* vars_pp = Vars.pp in + let* output_pp = Output.pp in + let* stack = Stack.to_list in + let* current_tick_pp = Current_tick.pp in + return @@ fun fmt () -> + Format.fprintf + fmt + "@[<v 0 >@;\ + %a@;\ + %a@;\ + %a@;\ + %a@;\ + %a@;\ + %a@;\ + %a@;\ + tick : %a@;\ + vars : %a@;\ + output :%a@;\ + stack : %a@;\ + @]" + status_pp + () + message_counter_pp + () + next_message_pp + () + parsing_result_pp + () + parser_state_pp + () + lexer_state_pp + () + evaluation_result_pp + () + current_tick_pp + () + vars_pp + () + output_pp + () + Format.(pp_print_list pp_print_int) + stack + end + + open State + + type state = State.state + + open Monad + + let initial_state ~empty = + let m = + let open Monad.Syntax in + let* () = Status.set Halted in + return () + in + let open Lwt_syntax in + let* state, _ = run m empty in + return state + + let install_boot_sector state boot_sector = + let m = + let open Monad.Syntax in + let* () = Boot_sector.set boot_sector in + return () + in + let open Lwt_syntax in + let* state, _ = run m state in + return state + + let state_hash state = + let context_hash = Tree.hash state in + Lwt.return @@ State_hash.context_hash_to_state_hash context_hash + + let pp state = + let open Lwt_syntax in + let* _, pp = Monad.run pp state in + match pp with + | None -> return @@ fun fmt _ -> Format.fprintf fmt "<opaque>" + | Some pp -> + let* state_hash = state_hash state in + return (fun fmt () -> + Format.fprintf fmt "@[%a: %a@]" State_hash.pp state_hash pp ()) + + let boot = + let open Monad.Syntax in + let* () = Status.create in + let* () = Next_message.create in + let* () = Status.set Waiting_for_metadata in + return () + + let result_of ~default m state = + let open Lwt_syntax in + let* _, v = run m state in + match v with None -> return default | Some v -> return v + + let state_of m state = + let open Lwt_syntax in + let* s, _ = run m state in + return s + + let get_tick = result_of ~default:Sc_rollup_tick_repr.initial Current_tick.get + + let is_input_state_monadic = + let open Monad.Syntax in + let* status = Status.get in + match status with + | Waiting_for_input_message -> ( + let* level = Current_level.get in + let* counter = Message_counter.get in + match counter with + | Some n -> return (PS.First_after (level, n)) + | None -> return PS.Initial) + | Waiting_for_reveal -> ( + let* r = Required_reveal.get in + match r with + | None -> internal_error "Internal error: Reveal invariant broken" + | Some reveal -> return (PS.Needs_reveal reveal)) + | Waiting_for_metadata -> return PS.(Needs_reveal Reveal_metadata) + | Halted | Parsing | Evaluating -> return PS.No_input_required + + let is_input_state = + result_of ~default:PS.No_input_required @@ is_input_state_monadic + + let get_status = result_of ~default:Waiting_for_input_message @@ Status.get + + let get_outbox outbox_level state = + let open Lwt_syntax in + let+ entries = result_of ~default:[] Output.entries state in + List.filter_map + (fun (_, msg) -> + if Raw_level_repr.(msg.PS.outbox_level = outbox_level) then Some msg + else None) + entries + + let get_code = result_of ~default:[] @@ Code.to_list + + let get_parsing_result = result_of ~default:None @@ Parsing_result.get + + let get_stack = result_of ~default:[] @@ Stack.to_list + + let get_var state k = (result_of ~default:None @@ Vars.get k) state + + let get_evaluation_result = result_of ~default:None @@ Evaluation_result.get + + let get_is_stuck = result_of ~default:None @@ is_stuck + + let start_parsing : unit t = + let open Monad.Syntax in + let* () = Status.set Parsing in + let* () = Parsing_result.set None in + let* () = Parser_state.set SkipLayout in + let* () = Lexer_state.set (0, 0) in + let* () = Code.clear in + return () + + let set_inbox_message_monadic {PS.inbox_level; message_counter; payload} = + let open Monad.Syntax in + let* payload = + match Sc_rollup_inbox_message_repr.deserialize payload with + | Error _ -> return None + | Ok (External payload) -> return (Some payload) + | Ok (Internal (Transfer {payload; destination; _})) -> ( + let* () = incr_internal_message_counter in + let* (metadata : Sc_rollup_metadata_repr.t option) = Metadata.get in + match metadata with + | Some {address; _} when Address.(destination = address) -> ( + match Micheline.root payload with + | Bytes (_, payload) -> + let payload = Bytes.to_string payload in + return (Some payload) + | _ -> return None) + | _ -> return None) + | Ok (Internal Start_of_level) -> + let* () = incr_internal_message_counter in + return None + | Ok (Internal End_of_level) -> + let* () = incr_internal_message_counter in + return None + | Ok (Internal (Info_per_level _)) -> + let* () = incr_internal_message_counter in + return None + in + match payload with + | Some payload -> + let* boot_sector = Boot_sector.get in + let msg = boot_sector ^ payload in + let* () = Current_level.set inbox_level in + let* () = Message_counter.set (Some message_counter) in + let* () = Next_message.set (Some msg) in + let* () = start_parsing in + return () + | None -> + let* () = Current_level.set inbox_level in + let* () = Message_counter.set (Some message_counter) in + let* () = Status.set Waiting_for_input_message in + return () + + let reveal_monadic reveal_data = + (* + + The inbox cursor is unchanged as the message comes from the + outer world. + + We don't have to check that the data is the one we + expected as we decided to trust the initial witness. + + It is the responsibility of the rollup node to check the validity + of the [reveal_data] if it does not want to publish a wrong commitment. + + *) + let open Monad.Syntax in + match reveal_data with + | PS.Raw_data data -> + (* Notice that a multi-page transmission is possible by embedding + a continuation encoded as an optional hash in [data]. *) + let* () = Next_message.set (Some data) in + let* () = start_parsing in + return () + | PS.Metadata metadata -> + let* () = Metadata.set (Some metadata) in + let* () = Status.set Waiting_for_input_message in + return () + | PS.Dal_page None -> + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3995 + Below, we set the status to [Waiting_for_input_message] because the + inbox is the only source of automatically fetched data. + Once the issue above is handled (auto-fetch of Dal pages with EOL/SOL), + the implementation should be adapted. *) + let* () = Status.set Waiting_for_input_message in + return () + | PS.Dal_page (Some data) -> + let* () = Next_message.set (Some (Bytes.to_string data)) in + let* () = start_parsing in + return () + + let ticked m = + let open Monad.Syntax in + let* tick = Current_tick.get in + let* () = Current_tick.set (Sc_rollup_tick_repr.next tick) in + m + + let set_input_monadic input = + match input with + | PS.Inbox_message m -> set_inbox_message_monadic m + | PS.Reveal s -> reveal_monadic s + + let set_input input = set_input_monadic input |> ticked |> state_of + + let next_char = + let open Monad.Syntax in + Lexer_state.( + let* start, len = get in + set (start, len + 1)) + + let no_message_to_lex () = + internal_error "lexer: There is no input message to lex" + + let current_char = + let open Monad.Syntax in + let* start, len = Lexer_state.get in + let* msg = Next_message.get in + match msg with + | None -> no_message_to_lex () + | Some s -> + if Compare.Int.(start + len < String.length s) then + return (Some s.[start + len]) + else return None + + let lexeme = + let open Monad.Syntax in + let* start, len = Lexer_state.get in + let* msg = Next_message.get in + match msg with + | None -> no_message_to_lex () + | Some s -> + let* () = Lexer_state.set (start + len, 0) in + return (String.sub s start len) + + let push_int_literal = + let open Monad.Syntax in + let* s = lexeme in + match int_of_string_opt s with + | Some x -> Code.inject (IPush x) + | None -> (* By validity of int parsing. *) assert false + + let push_var = + let open Monad.Syntax in + let* s = lexeme in + Code.inject (IStore s) + + let start_evaluating : unit t = + let open Monad.Syntax in + let* () = Status.set Evaluating in + let* () = Evaluation_result.set None in + return () + + let stop_parsing outcome = + let open Monad.Syntax in + let* () = Parsing_result.set (Some outcome) in + start_evaluating + + let stop_evaluating outcome = + let open Monad.Syntax in + let* () = Evaluation_result.set (Some outcome) in + Status.set Waiting_for_input_message + + let parse : unit t = + let open Monad.Syntax in + let produce_add = + let* (_ : string) = lexeme in + let* () = next_char in + let* () = Code.inject IAdd in + return () + in + let produce_int = + let* () = push_int_literal in + let* () = Parser_state.set SkipLayout in + return () + in + let produce_var = + let* () = push_var in + let* () = Parser_state.set SkipLayout in + return () + in + let is_digit d = Compare.Char.(d >= '0' && d <= '9') in + let is_letter d = + Compare.Char.((d >= 'a' && d <= 'z') || (d >= 'A' && d <= 'Z')) + in + let is_identifier_char d = + is_letter d || is_digit d + || Compare.Char.(d = ':') + || Compare.Char.(d = '%') + in + let* parser_state = Parser_state.get in + match parser_state with + | ParseInt -> ( + let* char = current_char in + match char with + | Some d when is_digit d -> next_char + | Some '+' -> + let* () = produce_int in + let* () = produce_add in + return () + | Some (' ' | '\n') -> + let* () = produce_int in + let* () = next_char in + return () + | None -> + let* () = push_int_literal in + stop_parsing true + | _ -> stop_parsing false) + | ParseVar -> ( + let* char = current_char in + match char with + | Some d when is_identifier_char d -> next_char + | Some '+' -> + let* () = produce_var in + let* () = produce_add in + return () + | Some (' ' | '\n') -> + let* () = produce_var in + let* () = next_char in + return () + | None -> + let* () = push_var in + stop_parsing true + | _ -> stop_parsing false) + | SkipLayout -> ( + let* char = current_char in + match char with + | Some (' ' | '\n') -> next_char + | Some '+' -> produce_add + | Some d when is_digit d -> + let* (_ : string) = lexeme in + let* () = next_char in + let* () = Parser_state.set ParseInt in + return () + | Some d when is_letter d -> + let* (_ : string) = lexeme in + let* () = next_char in + let* () = Parser_state.set ParseVar in + return () + | None -> stop_parsing true + | _ -> stop_parsing false) + + let output (destination, entrypoint) v = + let open Monad.Syntax in + let open Sc_rollup_outbox_message_repr in + let* counter = Output_counter.get in + let* () = Output_counter.set (Z.succ counter) in + let unparsed_parameters = + Micheline.(Int ((), Z.of_int v) |> strip_locations) + in + let transaction = {unparsed_parameters; destination; entrypoint} in + let message = Atomic_transaction_batch {transactions = [transaction]} in + let* outbox_level = Current_level.get in + let output = + Sc_rollup_PVM_sig.{outbox_level; message_index = counter; message} + in + Output.set (Z.to_string counter) output + + let identifies_target_contract x = + let open Option_syntax in + match String.split_on_char '%' x with + | destination :: entrypoint -> ( + match Contract_hash.of_b58check_opt destination with + | None -> + if Compare.String.(x = "out") then + return (Contract_hash.zero, Entrypoint_repr.default) + else fail + | Some destination -> + let* entrypoint = + match entrypoint with + | [] -> return Entrypoint_repr.default + | _ -> + let* entrypoint = + Non_empty_string.of_string (String.concat "" entrypoint) + in + let* entrypoint = + Entrypoint_repr.of_annot_lax_opt entrypoint + in + return entrypoint + in + return (destination, entrypoint)) + | [] -> fail + + let evaluate_preimage_request hash = + let open Monad.Syntax in + match Sc_rollup_reveal_hash.of_b58check_opt hash with + | None -> stop_evaluating false + | Some hash -> + let* () = Required_reveal.set (Some (Reveal_raw_data hash)) in + let* () = Status.set Waiting_for_reveal in + return () + + let evaluate_dal_page_request = + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + - We should rather provide DAL parameters to PVM via metadata (and handle + the case where parameters are updated on L1). + - It's better to use EOL/SOL to request DAL pages once unique inbox MR + is merged. *) + (* The parameters below are those of mainnet in protocol constants, divided + by 16. *) + let attestation_lag = 1l in + let page_size = 4096 / 64 in + let slot_size = (1 lsl 20) / 64 in + let number_of_slots = 256 / 64 in + let number_of_pages = slot_size / page_size in + let mk_slot_index slot_str = + let open Option_syntax in + let* index = Option.map Int32.to_int @@ Int32.of_string_opt slot_str in + if Compare.Int.(index < 0 || index >= number_of_slots) then None + else Dal_slot_repr.Index.of_int index + in + let mk_page_index page_str = + let open Option_syntax in + let* index = Option.map Int32.to_int @@ Int32.of_string_opt page_str in + if Compare.Int.(index < 0 || index >= number_of_pages) then None + else Some index + in + fun raw_page_id -> + let mk_page_id current_lvl = + (* Dal pages import directive is [dal:<LVL>:<SID>:<PID>]. See mli file.*) + let open Option_syntax in + match String.split_on_char ':' raw_page_id with + | [lvl; slot; page] -> + let* lvl = Int32.of_string_opt lvl in + let* lvl = Bounded.Non_negative_int32.of_value lvl in + let published_level = Raw_level_repr.of_int32_non_negative lvl in + let delta = Raw_level_repr.diff current_lvl published_level in + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3995 + Putting delta > 0l doesn't work here because of the way the node + currently fetches blocks' data and calls the PVM. + This will be changed, in particular once EOL is used to fetch DAL + data. + + More generally, the whole condition below will be reworked. *) + if + Compare.Int32.( + delta > 1l && delta <= Int32.mul 2l attestation_lag) + then + let* index = mk_slot_index slot in + let* page_index = mk_page_index page in + let slot_id = Dal_slot_repr.Header.{published_level; index} in + Some Dal_slot_repr.Page.{slot_id; page_index} + else None + | _ -> None + in + let open Monad.Syntax in + let* current_lvl = Current_level.get in + match mk_page_id current_lvl with + | Some page_id -> + let* () = Required_reveal.set (Some (Request_dal_page page_id)) in + let* () = Status.set Waiting_for_reveal in + return () + | None -> stop_evaluating false + + let remove_prefix prefix input input_len = + let prefix_len = String.length prefix in + if + Compare.Int.(input_len > prefix_len) + && String.(equal (sub input 0 prefix_len) prefix) + then Some (String.sub input prefix_len (input_len - prefix_len)) + else None + + let evaluate = + let open Monad.Syntax in + let* i = Code.pop in + match i with + | None -> stop_evaluating true + | Some (IPush x) -> Stack.push x + | Some (IStore x) -> ( + (* When evaluating an instruction [IStore x], we start by checking if [x] + is a reserved directive: + - "hash:<HASH>", to import a DAC data; + - "dal:<LVL>:<SID>:<PID>", to request a Dal page; + - "out" or "<DESTINATION>%<ENTRYPOINT>", to add a message in the outbox. + Otherwise, the instruction is interpreted as a directive to store the + top of the PVM's stack into the variable [x]. + *) + let len = String.length x in + match remove_prefix "hash:" x len with + | Some hash -> evaluate_preimage_request hash + | None -> ( + match remove_prefix "dal:" x len with + | Some pid -> evaluate_dal_page_request pid + | None -> ( + let* v = Stack.top in + match v with + | None -> stop_evaluating false + | Some v -> ( + match identifies_target_contract x with + | Some contract_entrypoint -> output contract_entrypoint v + | None -> Vars.set x v)))) + | Some IAdd -> ( + let* v = Stack.pop in + match v with + | None -> stop_evaluating false + | Some x -> ( + let* v = Stack.pop in + match v with + | None -> stop_evaluating false + | Some y -> Stack.push (x + y))) + + let reboot = + let open Monad.Syntax in + let* () = Status.set Waiting_for_input_message in + let* () = Stack.clear in + let* () = Code.clear in + return () + + let eval_step = + let open Monad.Syntax in + let* x = is_stuck in + match x with + | Some _ -> reboot + | None -> ( + let* status = Status.get in + match status with + | Halted -> boot + | Waiting_for_input_message | Waiting_for_reveal | Waiting_for_metadata + -> ( + let* msg = Next_message.get in + match msg with + | None -> internal_error "An input state was not provided an input." + | Some _ -> start_parsing) + | Parsing -> parse + | Evaluating -> evaluate) + + let eval state = state_of (ticked eval_step) state + + let step_transition input_given state = + let open Lwt_syntax in + let* request = is_input_state state in + let error msg = state_of (internal_error msg) state in + let* state = + match (request, input_given) with + | PS.No_input_required, None -> eval state + | PS.No_input_required, Some _ -> + error "Invalid set_input: expecting no input message but got one." + | (PS.Initial | PS.First_after _), Some (PS.Inbox_message _ as input) + | ( PS.Needs_reveal (Reveal_raw_data _), + Some (PS.Reveal (Raw_data _) as input) ) + | PS.Needs_reveal Reveal_metadata, Some (PS.Reveal (Metadata _) as input) + | ( PS.Needs_reveal (PS.Request_dal_page _), + Some (PS.Reveal (Dal_page _) as input) ) -> + (* For all the cases above, the input request matches the given input, so + we proceed by setting the input. *) + set_input input state + | (PS.Initial | PS.First_after _), _ -> + error "Invalid set_input: expecting inbox message, got a reveal." + | PS.Needs_reveal (Reveal_raw_data _hash), _ -> + error + "Invalid set_input: expecting a raw data reveal, got an inbox \ + message or a reveal metadata." + | PS.Needs_reveal Reveal_metadata, _ -> + error + "Invalid set_input: expecting a metadata reveal, got an inbox \ + message or a raw data reveal." + | PS.Needs_reveal (PS.Request_dal_page _), _ -> + error + "Invalid set_input: expecting a dal page reveal, got an inbox \ + message or a raw data reveal." + in + return (state, request) + + type error += Arith_proof_verification_failed + + let verify_proof input_given proof = + let open Lwt_result_syntax in + let*! result = Context.verify_proof proof (step_transition input_given) in + match result with + | None -> tzfail Arith_proof_verification_failed + | Some (_state, request) -> return request + + let produce_proof context input_given state = + let open Lwt_result_syntax in + let*! result = + Context.produce_proof context state (step_transition input_given) + in + match result with + | Some (tree_proof, _requested) -> return tree_proof + | None -> tzfail Arith_proof_production_failed + + let verify_origination_proof proof boot_sector = + let open Lwt_syntax in + let before = Context.proof_before proof in + if State_hash.(before <> reference_initial_state_hash) then return false + else + let* result = + Context.verify_proof proof (fun state -> + let* state = install_boot_sector state boot_sector in + return (state, ())) + in + match result with None -> return false | Some (_, ()) -> return true + + let produce_origination_proof context boot_sector = + let open Lwt_result_syntax in + let*! state = initial_state ~empty:(Tree.empty context) in + let*! result = + Context.produce_proof context state (fun state -> + let open Lwt_syntax in + let* state = install_boot_sector state boot_sector in + return (state, ())) + in + match result with + | Some (proof, ()) -> return proof + | None -> tzfail Arith_proof_production_failed + + (* TEMPORARY: The following definitions will be extended in a future commit. *) + + type output_proof = { + output_proof : Context.proof; + output_proof_state : hash; + output_proof_output : PS.output; + } + + let output_proof_encoding = + let open Data_encoding in + conv + (fun {output_proof; output_proof_state; output_proof_output} -> + (output_proof, output_proof_state, output_proof_output)) + (fun (output_proof, output_proof_state, output_proof_output) -> + {output_proof; output_proof_state; output_proof_output}) + (obj3 + (req "output_proof" Context.proof_encoding) + (req "output_proof_state" State_hash.encoding) + (req "output_proof_output" PS.output_encoding)) + + let output_of_output_proof s = s.output_proof_output + + let state_of_output_proof s = s.output_proof_state + + let output_key (output : PS.output) = Z.to_string output.message_index + + let has_output output tree = + let open Lwt_syntax in + let* equal = Output.mapped_to (output_key output) output tree in + return (tree, equal) + + let verify_output_proof p = + let open Lwt_syntax in + let transition = has_output p.output_proof_output in + let* result = Context.verify_proof p.output_proof transition in + match result with None -> return false | Some _ -> return true + + let produce_output_proof context state output_proof_output = + let open Lwt_result_syntax in + let*! output_proof_state = state_hash state in + let*! result = + Context.produce_proof context state @@ has_output output_proof_output + in + match result with + | Some (output_proof, true) -> + return {output_proof; output_proof_state; output_proof_output} + | Some (_, false) -> fail Arith_invalid_claim_about_outbox + | None -> fail Arith_output_proof_production_failed + + let get_current_level state = + let open Lwt_syntax in + let* _state_, current_level = Monad.run Current_level.get state in + return current_level + + module Internal_for_tests = struct + let insert_failure state = + let add n = Tree.add state ["failures"; string_of_int n] Bytes.empty in + let open Lwt_syntax in + let* n = Tree.length state ["failures"] in + add n + end +end + +module Protocol_implementation = Make (struct + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + end + + type tree = Context.tree + + let hash_tree t = State_hash.context_hash_to_state_hash (Tree.hash t) + + type proof = Context.Proof.tree Context.Proof.t + + let verify_proof p f = + let open Lwt_option_syntax in + let*? () = Result.to_option (Context_binary_proof.check_is_binary p) in + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof _context _state _f = + (* Can't produce proof without full context*) + Lwt.return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> State_hash.context_hash_to_state_hash hash + + let proof_before proof = kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = Context.Proof_encoding.V2.Tree2.tree_proof_encoding +end) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.mli new file mode 100644 index 000000000000..4363385ef461 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_arith.mli @@ -0,0 +1,186 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides a temporary toy rollup to be used as a demo. *) + +(* + FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3995 + Use EOL/SOL once merged to import Dal pages. +*) + +(** + + This rollup is a stack machine equipped with addition. + + It processes postfix arithmetic expressions written as sequence of + (space separated) [int] and [+] using the following rules: + + - a number [x] is interpreted as pushing [x] on the stack ; + + - a variable [a] is interpreted as storing the topmost element of the + stack in the storage under the name "a" ; + + - a variable [out] is interpreted as adding a message to the outbox + containing a single transaction batch with the topmost element of the + stack as payload, the zero contract as destination, and a default + entrypoint ; + + - a symbol [+] pops two integers [x] and [y] and pushes [x + y] on + the stack ; + + - an input [hash:<HASH>] is interpreted as a directive to request the DAC + data whose hash is <HASH> ; + + - an input [dal:<LVL>:<SID>:<PID>] is interpreted as a directive to request + the DAL page whose index is <PID> belonging to slot index <SID> confirmed + at level <LVL> (i.e published at level LVL - attestation_lag) ; + + If a message is not syntactically correct or does not evaluate + correctly, the machine stops its evaluation and waits for the next + message. + + The machine has a boot sector which is a mere string used a prefix + for each message. + + The module implements the {!Sc_rollup_PVM_sig.S}Î interface to be + used in the smart contract rollup infrastructure. + + The machine exposes extra operations to be used in the rollup node. + +*) +module type S = sig + include Sc_rollup_PVM_sig.S + + (** [parse_boot_sector s] builds a boot sector from its human + writable description. *) + val parse_boot_sector : string -> string option + + (** [pp_boot_sector fmt s] prints a human readable representation of + a boot sector. *) + val pp_boot_sector : Format.formatter -> string -> unit + + (** [pp state] returns a pretty-printer valid for [state]. *) + val pp : state -> (Format.formatter -> unit -> unit) Lwt.t + + (** [get_tick state] returns the current tick of [state]. *) + val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t + + (** The machine has five possible statuses: *) + type status = + | Halted + | Waiting_for_input_message + | Waiting_for_reveal + | Waiting_for_metadata + | Parsing + | Evaluating + + (** [get_status state] returns the machine status in [state]. *) + val get_status : state -> status Lwt.t + + (** [get_outbox outbox_level state] returns the outbox in [state] + for a given [outbox_level]. *) + val get_outbox : + Raw_level_repr.t -> state -> Sc_rollup_PVM_sig.output list Lwt.t + + (** The machine has only three instructions. *) + type instruction = + | IPush : int -> instruction + | IAdd : instruction + | IStore : string -> instruction + + (** [equal_instruction i1 i2] is [true] iff [i1] equals [i2]. *) + val equal_instruction : instruction -> instruction -> bool + + (** [pp_instruction fmt i] shows a human readable representation of [i]. *) + val pp_instruction : Format.formatter -> instruction -> unit + + (** [get_parsing_result state] is [Some true] if the current + message is syntactically correct, [Some false] when it + contains a syntax error, and [None] when the machine is + not in parsing state. *) + val get_parsing_result : state -> bool option Lwt.t + + (** [get_code state] returns the current code obtained by parsing + the current input message. *) + val get_code : state -> instruction list Lwt.t + + (** [get_stack state] returns the current stack. *) + val get_stack : state -> int list Lwt.t + + (** [get_var state x] returns the current value of variable [x]. + Returns [None] if [x] does not exist. *) + val get_var : state -> string -> int option Lwt.t + + (** [get_evaluation_result state] returns [Some true] if the current + message evaluation succeeds, [Some false] if it failed, and + [None] if the evaluation has not been done yet. *) + val get_evaluation_result : state -> bool option Lwt.t + + (** [get_is_stuck state] returns [Some err] if some internal error + made the machine fail during the last evaluation step. [None] + if no internal error occurred. When a machine is stuck, it + reboots, waiting for the next message to process. *) + val get_is_stuck : state -> string option Lwt.t +end + +module Protocol_implementation : + S + with type context = Context.t + and type state = Context.tree + and type proof = Context.Proof.tree Context.Proof.t + +(** This is the state hash of reference that both the prover of the + node and the verifier of the protocol {!Protocol_implementation} + have to agree on (if they do, it means they are using the same + tree structure). *) +val reference_initial_state_hash : Sc_rollup_repr.State_hash.t + +module type P = sig + module Tree : Context.TREE with type key = string list and type value = bytes + + type tree = Tree.tree + + val hash_tree : tree -> Sc_rollup_repr.State_hash.t + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> Sc_rollup_repr.State_hash.t + + val proof_after : proof -> Sc_rollup_repr.State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t +end + +module Make (Context : P) : + S + with type context = Context.Tree.t + and type state = Context.tree + and type proof = Context.proof diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.ml new file mode 100644 index 000000000000..b01cd33baac4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.ml @@ -0,0 +1,141 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr + +(* 32 *) +let hash_prefix = "\017\144\021\100" (* scc1(54) *) + +module Hash = struct + let prefix = "scc1" + + let encoded_size = 54 + + module H = + Blake2B.Make + (Base58) + (struct + let name = "commitment_hash" + + let title = "The hash of a commitment of a smart contract rollup" + + let b58check_prefix = hash_prefix + + (* defaults to 32 *) + let size = None + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size + + include Path_encoding.Make_hex (H) +end + +module V1 = struct + type t = { + compressed_state : State_hash.t; + inbox_level : Raw_level_repr.t; + predecessor : Hash.t; + number_of_ticks : Number_of_ticks.t; + } + + let pp fmt {compressed_state; inbox_level; predecessor; number_of_ticks} = + Format.fprintf + fmt + "compressed_state: %a@,\ + inbox_level: %a@,\ + predecessor: %a@,\ + number_of_ticks: %Ld" + State_hash.pp + compressed_state + Raw_level_repr.pp + inbox_level + Hash.pp + predecessor + (Number_of_ticks.to_value number_of_ticks) + + let encoding = + let open Data_encoding in + conv + (fun {compressed_state; inbox_level; predecessor; number_of_ticks} -> + (compressed_state, inbox_level, predecessor, number_of_ticks)) + (fun (compressed_state, inbox_level, predecessor, number_of_ticks) -> + {compressed_state; inbox_level; predecessor; number_of_ticks}) + (obj4 + (req "compressed_state" State_hash.encoding) + (req "inbox_level" Raw_level_repr.encoding) + (req "predecessor" Hash.encoding) + (req "number_of_ticks" Number_of_ticks.encoding)) + + let hash_uncarbonated commitment = + let commitment_bytes = + Data_encoding.Binary.to_bytes_exn encoding commitment + in + Hash.hash_bytes [commitment_bytes] + + (* For [number_of_messages] and [number_of_ticks] min_value is equal to zero. *) + let genesis_commitment ~origination_level ~genesis_state_hash = + let open Sc_rollup_repr in + let number_of_ticks = Number_of_ticks.zero in + { + compressed_state = genesis_state_hash; + inbox_level = origination_level; + predecessor = Hash.zero; + number_of_ticks; + } + + type genesis_info = {level : Raw_level_repr.t; commitment_hash : Hash.t} + + let genesis_info_encoding = + let open Data_encoding in + conv + (fun {level; commitment_hash} -> (level, commitment_hash)) + (fun (level, commitment_hash) -> {level; commitment_hash}) + (obj2 + (req "level" Raw_level_repr.encoding) + (req "commitment_hash" Hash.encoding)) +end + +type versioned = V1 of V1.t + +let versioned_encoding = + let open Data_encoding in + union + [ + case + ~title:"V1" + (Tag 0) + V1.encoding + (function V1 commitment -> Some commitment) + (fun commitment -> V1 commitment); + ] + +include V1 + +let of_versioned = function V1 commitment -> commitment [@@inline] + +let to_versioned commitment = V1 commitment [@@inline] diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.mli new file mode 100644 index 000000000000..0346e476d141 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_repr.mli @@ -0,0 +1,102 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr + +module Hash : sig + include S.HASH + + include Storage_description.INDEX with type t := t +end + +(** A commitment represents a claim about the state of the Inbox and PVM at + some Inbox level. + + More formally, a commitment is a claim that: + + {ul + {li assuming the PVM and Inbox are in a state implied by [predecessor]} + {li the PVM consumes all the messages until [inbox_level] (not included) + from the inbox ; } + {li the PVM advances to the state [compressed_state] over + [number_of_ticks] ticks. } + } + + Commitments are disjoint. The next correct commitment is a function of the + previous machine state and Inbox. + + [compressed_state] and [number_of_ticks] can be proven/disproven by PVM + execution, or equivalently, by an interactive proof game between + conflicting parties, such that a correct executor always wins the game. +*) +module V1 : sig + type t = { + compressed_state : State_hash.t; + inbox_level : Raw_level_repr.t; + predecessor : Hash.t; + number_of_ticks : Number_of_ticks.t; + } + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val hash_uncarbonated : t -> Hash.t + + (** [genesis_commitment ~origination_level ~genesis_state_hash] is the + commitment that the protocol "publish" and "cement" when originating a new + rollup. Each rollup have a different [genesis_commitment] because the + [compressed_state] is computed after the boot sector is set. It has the + following values: + + {ul {li [compressed_state] = [genesis_state_hash]} + {li [inbox_level] = [origination_level]} + {li [predecessor] = {!Hash.zero}} + {li [number_of_messages] = {!Sc_rollup_repr.Number_of_messages.min_value}} + {li [number_of_ticks] = {!Sc_rollup_repr.Number_of_ticks.min_value}}} + + where {!Sc_rollup_repr.Number_of_messages.min_value} and + {!Sc_rollup_repr.Number_of_ticks.min_value} are equal to [zero]. + + See {!Sc_rollup_storage.originate} for the usage. *) + val genesis_commitment : + origination_level:Raw_level_repr.t -> + genesis_state_hash:Sc_rollup_repr.State_hash.t -> + t + + (** The genesis of a rollup is characterized by the Tezos level of + the rollup origination, and the hash of the commitment computed + by the protocol to specialize the PVM initial state with the + provided boot sector. *) + type genesis_info = {level : Raw_level_repr.t; commitment_hash : Hash.t} + + val genesis_info_encoding : genesis_info Data_encoding.t +end + +(** Versioning, see {!Sc_rollup_data_version_sig.S} for more information. *) +include Sc_rollup_data_version_sig.S with type t = V1.t + +include module type of V1 with type t = V1.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.ml new file mode 100644 index 000000000000..1a3d957089b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.ml @@ -0,0 +1,144 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_errors +module Store = Storage.Sc_rollup +module Commitment = Sc_rollup_commitment_repr +module Commitment_hash = Commitment.Hash + +let get_commitment_opt_unsafe ctxt rollup commitment = + let open Lwt_result_syntax in + let* ctxt, res = Store.Commitments.find (ctxt, rollup) commitment in + return (res, ctxt) + +let get_commitment_unsafe ctxt rollup commitment = + let open Lwt_result_syntax in + let* res, ctxt = get_commitment_opt_unsafe ctxt rollup commitment in + match res with + | None -> tzfail (Sc_rollup_unknown_commitment commitment) + | Some commitment -> return (commitment, ctxt) + +let last_cemented_commitment ctxt rollup = + let open Lwt_result_syntax in + let* ctxt, res = Store.Last_cemented_commitment.find ctxt rollup in + match res with + | None -> tzfail (Sc_rollup_does_not_exist rollup) + | Some lcc -> return (lcc, ctxt) + +let get_commitment ctxt rollup commitment = + let open Lwt_result_syntax in + (* Assert that a last cemented commitment exists. *) + let* _lcc, ctxt = last_cemented_commitment ctxt rollup in + get_commitment_unsafe ctxt rollup commitment + +let last_cemented_commitment_hash_with_level ctxt rollup = + let open Lwt_result_syntax in + let* commitment_hash, ctxt = last_cemented_commitment ctxt rollup in + let+ {inbox_level; _}, ctxt = + get_commitment_unsafe ctxt rollup commitment_hash + in + (commitment_hash, inbox_level, ctxt) + +let set_commitment_added ctxt rollup node new_value = + let open Lwt_result_syntax in + let* ctxt, res = Store.Commitment_added.find (ctxt, rollup) node in + match res with + | Some old_value -> + (* No need to re-add the read value *) + return (0, old_value, ctxt) + | None -> + let* ctxt, size_diff, _was_bound = + Store.Commitment_added.add (ctxt, rollup) node new_value + in + return (size_diff, new_value, ctxt) + +let get_predecessor_opt_unsafe ctxt rollup node = + let open Lwt_result_syntax in + let* commitment, ctxt = get_commitment_opt_unsafe ctxt rollup node in + return (Option.map (fun (c : Commitment.t) -> c.predecessor) commitment, ctxt) + +let get_predecessor_unsafe ctxt rollup node = + let open Lwt_result_syntax in + let* commitment, ctxt = get_commitment_unsafe ctxt rollup node in + return (commitment.predecessor, ctxt) + +let check_if_commitments_are_related ctxt rollup ~descendant ~ancestor = + let open Lwt_result_syntax in + let rec aux ctxt current_commitment_hash = + if Commitment_hash.(current_commitment_hash = ancestor) then + return (true, ctxt) + else + let* predecessor_commitment_opt, ctxt = + get_predecessor_opt_unsafe ctxt rollup current_commitment_hash + in + match predecessor_commitment_opt with + | None -> return (false, ctxt) + | Some cch -> (aux [@ocaml.tailcall]) ctxt cch + in + aux ctxt descendant + +let hash ctxt commitment = + let open Result_syntax in + let* ctxt = + Raw_context.consume_gas + ctxt + Sc_rollup_costs.Constants.cost_serialize_commitment + in + let commitment_bytes_opt = + Data_encoding.Binary.to_bytes_opt + Sc_rollup_commitment_repr.encoding + commitment + in + let* commitment_bytes = + Option.to_result + ~none:(trace_of_error Sc_rollup_bad_commitment_serialization) + commitment_bytes_opt + in + let bytes_len = Bytes.length commitment_bytes in + let* ctxt = + Raw_context.consume_gas ctxt (Sc_rollup_costs.cost_hash_bytes ~bytes_len) + in + return (ctxt, Sc_rollup_commitment_repr.Hash.hash_bytes [commitment_bytes]) + +module Internal_for_tests = struct + let get_cemented_commitments_with_levels ctxt rollup = + let open Lwt_result_syntax in + let rec aux ctxt commitments_with_levels commitment_hash = + let* commitment_opt, ctxt = + get_commitment_opt_unsafe ctxt rollup commitment_hash + in + match commitment_opt with + | None -> return (commitments_with_levels, ctxt) + | Some {predecessor; inbox_level; _} -> + (aux [@ocaml.tailcall]) + ctxt + ((commitment_hash, inbox_level) :: commitments_with_levels) + predecessor + in + let* lcc_hash, ctxt = last_cemented_commitment ctxt rollup in + let+ commitments_with_levels, ctxt = aux ctxt [] lcc_hash in + (commitments_with_levels, ctxt) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.mli new file mode 100644 index 000000000000..71d1769f777b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_commitment_storage.mli @@ -0,0 +1,252 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Defines storage for Smart Contract Optimistic Rollups. + + {2 Commitments} + + [Commitment]s are stored directly in the L1 context. Commitments are + immutable and content-addressed, and can be indexed by a [Commitment_hash]. + + A commitment represents a claim about the state of a PVM. + + We also keep auxiliary state about each commitment, namely: + + {ul + {li When it was first added.} + {li Its current number of stakers.} + } + + This auxiliary data is not part of the commitment itself. They represent + information that the L1 knows about the claim, not the claim itself. + + {3 Predecessors and Boot state} + Each commitment contains the hash of its {i predecessor}. Multiple + commitments can have the same predecessor. Therefore, commitments form + a Merkle tree. + + Conceptually the root of this tree is the [Commitment_hash.zero]. This + commitment claims that the PVM (Proof-generating Virtual Machine) is in a + pre-boot state and waiting to start booting by interpreting the boot sector with + respect to the Machine semantics. + + {3 Cemented and Disputable commitments} + Commitments accepted as true by the protocol are referred to as Cemented. + A commitment that is not cemented is said to be disputable. + + {3 Stakers} + The Stakers table maps Stakers (implicit accounts) to commitments hashes. + + Let [Stakers(S)] mean "looking up the key S in [Stakers]". + + A staker [S] is directly staked on [C] if [Stakers(S) = C]. A staker [S] + is indirectly staked on [C] if [C] is an ancestor of [Stakers(S)] in the commitment tree. + + {3 Dispute} + Commitments that have at least one sibling are referred to as Disputed. + More formally, a commitment C is disputed if at least one staker is not + (directly or indirectly) staked on C. + + {3 Dispute resolution} + The rollup protocol ensures that all disputes are resolved before cementing + a commitment. Therefore, cemented commitments form a list rather than a tree. + + In the context we only store the Last Cemented Commitment (LCC), which is + by definition a descendant of [zero]. We also store all Disputable + commitments that have at least one Staker. + + For example, assuming the full set of commitments for a rollup + looks like this: + + {[ + LCC staker1 staker2 + | | | + | V | + V --c3 | + zero--c1 --c2--/ | + \ V + --c4------ c5 + ]} + then commitments [c2..c5] will be stored in the context. + + {3 Conflicts} + + Let Commitments(S) be the set of commitments directly staked on by staker S. + + Two stakers A and B are: + + {ul + {li In total agreement iff Commitments(A) = Commitments(B).} + {li In partial agreement iff either Commitments(A) ⊂ Commitments(B), or + Commitments(B) ⊂ Commitments(A).} + {li In conflict iff they are neither in total or partial agreement.}} + + We can further refine a conflict to note what they are in conflict about, + e.g. they may be in conflict about the inbox, about execution, or both. We + can resolve conflicts by first resolving the conflict about inbox, then + about execution (since execution is irrelevant if the inbox is not + correct). + *) + +module Commitment = Sc_rollup_commitment_repr +module Commitment_hash = Commitment.Hash + +(** [last_cemented_commitment context rollup] returns the last cemented + commitment of the rollup. + + If no commitments have been cemented, the rollup is said to be in a + pre-boot state, and [last_cemented_commitment = Commitment_hash.zero]. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist}} *) +val last_cemented_commitment : + Raw_context.t -> + Sc_rollup_repr.t -> + (Commitment_hash.t * Raw_context.t) tzresult Lwt.t + +(** [last_cemented_commitment_hash_with_level ctxt sc_rollup] returns the hash + and level of the last cemented commitment (lcc) for [sc_rollup]. If the + rollup exists but no lcc exists, the initial commitment + [Sc_rollup.Commitment.zero] together with the rollup origination level is + returned. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist}} +*) +val last_cemented_commitment_hash_with_level : + Raw_context.t -> + Sc_rollup_repr.t -> + (Commitment_hash.t * Raw_level_repr.t * Raw_context.t) tzresult Lwt.t + +(** [get_commitment context rollup commitment_hash] returns the commitment with + the given hash. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_unknown_commitment] if [commitment] does not exist} + } +*) +val get_commitment : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment.t * Raw_context.t) tzresult Lwt.t + +(** [get_commitment_opt_unsafe context rollup commitment_hash] returns an + [Option.t] which is either a defined value containing the commitment with + the given hash, or `None` if such a commitment does not exist. This + function *must* be called only after they have checked for the existence + of the rollup, and therefore it is not necessary for it to check for the + existence of the rollup again. Otherwise, use the safe function + {!get_commitment}. +*) +val get_commitment_opt_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment.t Option.t * Raw_context.t) tzresult Lwt.t + +(** [get_commitment_unsafe context rollup commitment_hash] returns the commitment + with the given hash. + This function *must* be called only after they have checked for the existence + of the rollup, and therefore it is not necessary for it to check for the + existence of the rollup again. Otherwise, use the safe function + {!get_commitment}. + + May fail with: + {ul + {li [Sc_rollup_unknown_commitment] if [commitment] does not exist} + } +*) +val get_commitment_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment.t * Raw_context.t) tzresult Lwt.t + +(** [set_commitment_added ctxt rollup node current] sets the commitment + addition time of [node] to [current] iff the commitment time was + not previously set, and leaves it unchanged otherwise. + *) +val set_commitment_added : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + Raw_level_repr.t -> + (int * Raw_level_repr.t * Raw_context.t) tzresult Lwt.t + +(** [get_predecessor_opt_unsafe ctxt rollup commitment_hash] returns an + [Option.t] value containing the [rollup] commitment predecessor of + [commitment_hash] in the [ctxt], if any. It does not check for the + existence of the [rollup]. *) +val get_predecessor_opt_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment_hash.t Option.t * Raw_context.t) tzresult Lwt.t + +(** [get_predecessor_unsafe ctxt rollup commitment_hash] returns the [rollup] + commitment predecessor of [commitment_hash] in the [ctxt]. It is unsafe + as the current commitment is retrived using {!get_commitment_unsafe}. + It does not check for the existence of the [rollup]. *) +val get_predecessor_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment_hash.t * Raw_context.t) tzresult Lwt.t + +(** [check_if_commitments_are_related ~descendant ~ancestor] checks whether a + commitment with hash [~ancestor] exists as a predecessor of [~descendant], + among the list of commitments stored for [rollup] in [ctxt]. *) +val check_if_commitments_are_related : + Raw_context.t -> + Sc_rollup_repr.t -> + descendant:Commitment_hash.t -> + ancestor:Commitment_hash.t -> + (bool * Raw_context.t) tzresult Lwt.t + +(** Hash a commitment and account for gas spent. *) +val hash : + Raw_context.t -> Commitment.t -> (Raw_context.t * Commitment_hash.t) tzresult + +module Internal_for_tests : sig + (** [get_cemented_commitments_with_levels ctxt rollup] returns a list of all + cemented commitment hashes and corresponding inbox levels that are present + in the storage, ordered by inbox level. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + } +*) + val get_cemented_commitments_with_levels : + Raw_context.t -> + Sc_rollup_repr.t -> + ((Commitment_hash.t * Raw_level_repr.t) list * Raw_context.t) tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.ml new file mode 100644 index 000000000000..ec9d017cdd52 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.ml @@ -0,0 +1,152 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr + +module Constants = struct + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2648 + Fill in real benchmarked values. + Need to create benchmark and fill in values. + *) + let cost_add_message_base = S.safe_int 430 + + let cost_add_message_per_byte = S.safe_int 15 + + let cost_add_inbox_per_level = S.safe_int 15 + + let cost_update_num_and_size_of_messages = S.safe_int 15 + + (* equal to Michelson_v1_gas.Cost_of.Unparsing.contract_optimized *) + let cost_decoding_contract_optimized = S.safe_int 70 + + (* equal to Michelson_v1_gas.Cost_of.Unparsing.key_hash_optimized *) + let cost_decoding_key_hash_optimized = S.safe_int 50 + + (* Set to the cost of encoding a pkh defined in {!Michelson_v1_gas} divided + by the number of characters of a pkh, i.e. 70/35. To be updated when + benchmarking is completed. *) + let cost_encode_string_per_byte = S.safe_int 2 + + (* Cost of serializing a state hash. *) + let cost_serialize_state_hash = + let len = S.safe_int State_hash.size in + S.Syntax.(cost_encode_string_per_byte * len) + + (* Cost of serializing a commitment hash. *) + let cost_serialize_commitment_hash = + let len = S.safe_int Sc_rollup_commitment_repr.Hash.size in + S.Syntax.(cost_encode_string_per_byte * len) + + (* Cost of serializing a commitment. The cost of serializing the level and + number of ticks (both int32) is negligible. *) + let cost_serialize_commitment = + S.Syntax.(cost_serialize_state_hash + cost_serialize_commitment_hash) + + (* Cost of serializing an operation hash. *) + let cost_serialize_operation_hash = + let len = S.safe_int Operation_hash.size in + S.Syntax.(cost_encode_string_per_byte * len) + + (* Cost of serializing a nonce. The cost of serializing the index (an int32) + is negligible. *) + let cost_serialize_nonce = cost_serialize_operation_hash +end + +(* Reusing model from {!Ticket_costs.has_tickets_of_ty_cost}. *) +let is_valid_parameters_ty_cost ~ty_size = + let fixed_cost = S.safe_int 10 in + let coeff = S.safe_int 6 in + S.add fixed_cost (S.mul coeff ty_size) + +let cost_serialize_internal_inbox_message + (internal_inbox_message : + Sc_rollup_inbox_message_repr.internal_inbox_message) = + match internal_inbox_message with + | Transfer {payload; sender = _; source = _; destination = _} -> + let lexpr = Script_repr.lazy_expr payload in + let expr_cost = Script_repr.force_bytes_cost lexpr in + S.Syntax.( + expr_cost + Constants.cost_decoding_contract_optimized + + Constants.cost_decoding_key_hash_optimized) + | Start_of_level -> Saturation_repr.zero + | End_of_level -> Saturation_repr.zero + | Info_per_level _ -> Saturation_repr.zero + +(** TODO: #3212 + Confirm gas cost model. + We here assume that the cost of deserializing an expression of [bytes_len] + is proportional to deserializing a script expression of size [bytes_len]. + This may not be the case and in particular, the cost depends on the specific + structure used for the PVM. We may thus need to split the cost function. + *) +let cost_deserialize_output_proof ~bytes_len = + Script_repr.deserialization_cost_estimated_from_bytes bytes_len + +let cost_serialize_external_inbox_message ~bytes_len = + let len = S.safe_int bytes_len in + S.Syntax.(Constants.cost_encode_string_per_byte * len) + +(* Equal to Michelson_v1_gas.Cost_of.Interpreter.blake2b. *) +let cost_hash_bytes ~bytes_len = + let open S.Syntax in + let v0 = S.safe_int bytes_len in + S.safe_int 430 + v0 + (v0 lsr 3) + +let cost_compare a_size_in_bytes b_size_in_bytes = + let open S.Syntax in + let size_in_bytes = Compare.Int.min a_size_in_bytes b_size_in_bytes in + let v0 = S.safe_int size_in_bytes in + S.safe_int 35 + ((v0 lsr 6) + (v0 lsr 7)) + +let cost_search_in_tick_list len tick_size = + let open S.Syntax in + S.safe_int len * cost_compare tick_size tick_size + +let cost_check_dissection ~number_of_states ~tick_size ~hash_size = + let open S.Syntax in + cost_search_in_tick_list number_of_states tick_size + + (S.safe_int 2 * cost_compare hash_size hash_size) + +let cost_add_message ~current_index ~msg_len = + let open S.Syntax in + let hash_cell_cost = + Skip_list_costs.model_hash_cell_computed_backpointers_count + ~index:current_index + in + let hash_content_cost = cost_hash_bytes ~bytes_len:msg_len in + let next_cell_cost = + Skip_list_costs.model_next ~length:(Z.succ current_index) + in + hash_cell_cost + hash_content_cost + next_cell_cost + +(* Derived from benchmark in + [Sc_rollup_benchmarks.Sc_rollup_verify_output_proof_benchmark] and model + [model_Sc_rollup_verify_output_proof_benchmark] with estimated parameters: + [fun size -> (98707.0824163 + (11.6809615751 * size))] *) +let cost_verify_output_proof ~bytes_len = + let open S.Syntax in + let size = S.safe_int bytes_len in + let v0 = size in + S.safe_int 98750 + ((v0 lsl 3) + (v0 lsl 1) + v0 + (v0 lsr 1)) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.mli new file mode 100644 index 000000000000..df72da9f756c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_costs.mli @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module contains constants and utility functions for gas metering + functions used when handling SC rollups operations in context. *) + +module Constants : sig + val cost_add_message_base : Gas_limit_repr.cost + + val cost_add_message_per_byte : Gas_limit_repr.cost + + val cost_add_inbox_per_level : Gas_limit_repr.cost + + val cost_update_num_and_size_of_messages : Gas_limit_repr.cost + + val cost_serialize_state_hash : Gas_limit_repr.cost + + val cost_serialize_commitment_hash : Gas_limit_repr.cost + + val cost_serialize_commitment : Gas_limit_repr.cost + + val cost_serialize_nonce : Gas_limit_repr.cost +end + +(** [is_valid_parameters_ty_cost ty] returns the cost of checking whether a type + is a valid sc rollup parameter. *) +val is_valid_parameters_ty_cost : + ty_size:'a Saturation_repr.t -> Saturation_repr.may_saturate Saturation_repr.t + +(** [cost_serialize_internal_inbox_message internal_inbox_message] is the cost + of the serialization of an internal inbox message. It's equal to the cost of + serializing the script expression, with {!Script_repr.force_bytes_cost} plus + a fixed amount for the serialized addresses. + + It traverses the payload expression to find the precise cost. It is safe to + use {!Script_repr.force_bytes_cost} because the payload of an internal inbox + message is bounded. +*) +val cost_serialize_internal_inbox_message : + Sc_rollup_inbox_message_repr.internal_inbox_message -> Gas_limit_repr.cost + +(** [cost_deserialize_output_proof ~bytes_len] is the cost of the + deserialization of an output proof. It's equal to the cost of deserializing + a script expression of size [bytes_len]. *) +val cost_deserialize_output_proof : bytes_len:int -> Gas_limit_repr.cost + +(** [cost_serialize_external_inbox_message ~bytes_len] is the cost of the + serialization of an external inbox message of length [bytes_len]. It is + equal to the estimated cost of encoding a byte multiplied by [bytes_len]. *) +val cost_serialize_external_inbox_message : bytes_len:int -> Gas_limit_repr.cost + +(** [cost_hash_bytes ~bytes_len] is the cost of hashing [bytes_len] bytes. *) +val cost_hash_bytes : bytes_len:int -> Gas_limit_repr.cost + +(** [cost_check_dissection ~number_of_states ~tick_size ~hash_size] is the cost + of checking that a dissection with a given [number_of_states] used in a + refutation game is well-formed. This includes the comparison of a linear + number of ticks as well as the verification of two hashes of given + [hash_size]. *) +val cost_check_dissection : + number_of_states:int -> tick_size:int -> hash_size:int -> Gas_limit_repr.cost + +(** [cost_verify_output_proof ~bytes_len] is the cost of verifying an output + proof of length [bytes_len]. *) +val cost_verify_output_proof : bytes_len:int -> Gas_limit_repr.cost + +(** [cost_add_message ~new_cell_index ~msg_len] returns the cost of adding a + message of length [msg_len] to a sc-rollup inbox. This function is used + internally in the [Sc_rollup_storage] module and covers the function + {!Sc_rollup_inbox_merkelized_payload_hashes_repr.add_payload *) +val cost_add_message : current_index:Z.t -> msg_len:int -> Gas_limit_repr.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_data_version_sig.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_data_version_sig.ml new file mode 100644 index 000000000000..dfd261a72ee4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_data_version_sig.ml @@ -0,0 +1,49 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The values are versioned, to let the possibility to modify + the values in future iterations of the protocol. + + We allow the possibility to modify the values by introducing + a {!versioned} value that is the only values written in the storage. + + In future versions, the versioning is supposed to let us reinterpret old + stored values within the new protocol implementation. That is, each + access to the storage will transform old stored values to the + current version. +*) + +module type S = sig + type t + + type versioned + + val versioned_encoding : versioned Data_encoding.t + + val of_versioned : versioned -> t + + val to_versioned : t -> versioned +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.ml new file mode 100644 index 000000000000..178433092f13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.ml @@ -0,0 +1,322 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr + +type t = {state_hash : State_hash.t option; tick : Sc_rollup_tick_repr.t} + +let equal {state_hash; tick} chunk2 = + Option.equal State_hash.equal state_hash chunk2.state_hash + && Sc_rollup_tick_repr.equal tick chunk2.tick + +let encoding = + let open Data_encoding in + conv + (fun {state_hash; tick} -> (state_hash, tick)) + (fun (state_hash, tick) -> {state_hash; tick}) + (obj2 + (opt "state" State_hash.encoding) + (req "tick" Sc_rollup_tick_repr.encoding)) + +type error += + | (* `Temporary *) + Dissection_number_of_sections_mismatch of { + expected : Z.t; + given : Z.t; + } + | (* `Permanent *) Dissection_invalid_number_of_sections of Z.t + | (* `Temporary *) + Dissection_start_hash_mismatch of { + expected : Sc_rollup_repr.State_hash.t option; + given : Sc_rollup_repr.State_hash.t option; + } + | (* `Temporary *) + Dissection_stop_hash_mismatch of + Sc_rollup_repr.State_hash.t option + | (* `Temporary *) + Dissection_edge_ticks_mismatch of { + dissection_start_tick : Sc_rollup_tick_repr.t; + dissection_stop_tick : Sc_rollup_tick_repr.t; + chunk_start_tick : Sc_rollup_tick_repr.t; + chunk_stop_tick : Sc_rollup_tick_repr.t; + } + | (* `Permanent *) Dissection_ticks_not_increasing + | (* `Permanent *) Dissection_invalid_distribution of Z.t + | (* `Permanent *) Dissection_invalid_successive_states_shape + +let pp_state_hash = + let open Format in + pp_print_option ~none:(fun ppf () -> fprintf ppf "None") State_hash.pp + +let pp_hash_opt fmt = function + | None -> Format.fprintf fmt "None" + | Some x -> Sc_rollup_repr.State_hash.pp fmt x + +let pp ppf {state_hash; tick} = + let open Format in + fprintf + ppf + "State hash:%a@ Tick: %a" + pp_state_hash + state_hash + Sc_rollup_tick_repr.pp + tick + +let default_check_sections_number ~default_number_of_sections + ~number_of_sections ~dist = + let open Result_syntax in + let number_of_sections = Z.of_int number_of_sections in + let default_number_of_sections = Z.of_int default_number_of_sections in + let should_be_equal_to expected = + Dissection_number_of_sections_mismatch + {expected; given = number_of_sections} + in + if Compare.Z.(default_number_of_sections <= dist) then + error_unless + Compare.Z.(number_of_sections = default_number_of_sections) + (should_be_equal_to default_number_of_sections) + else if Compare.Z.(dist > Z.one) then + error_unless Compare.Z.(number_of_sections = dist) (should_be_equal_to dist) + else tzfail (Dissection_invalid_number_of_sections number_of_sections) + +let default_check ~section_maximum_size ~check_sections_number + ~default_number_of_sections ~start_chunk ~stop_chunk dissection = + let open Result_syntax in + let number_of_sections = Compare.Int.max 0 (List.length dissection - 1) in + let dist = Sc_rollup_tick_repr.distance start_chunk.tick stop_chunk.tick in + let* () = + check_sections_number ~default_number_of_sections ~number_of_sections ~dist + in + let* () = + match (List.hd dissection, List.last_opt dissection) with + | Some {state_hash = a; tick = a_tick}, Some {state_hash = b; tick = b_tick} + -> + let* () = + error_unless + (Option.equal State_hash.equal a start_chunk.state_hash + && not (Option.is_none a)) + (Dissection_start_hash_mismatch + {expected = start_chunk.state_hash; given = a}) + in + let* () = + error_unless + (not (Option.equal State_hash.equal b stop_chunk.state_hash)) + ((* If the [b] state is equal to [stop_chunk], that means we + agree on the after state of the section. But, we're trying + to dispute it, it doesn't make sense. *) + Dissection_stop_hash_mismatch + stop_chunk.state_hash) + in + Sc_rollup_tick_repr.( + error_unless + (a_tick = start_chunk.tick && b_tick = stop_chunk.tick) + (Dissection_edge_ticks_mismatch + { + dissection_start_tick = a_tick; + dissection_stop_tick = b_tick; + chunk_start_tick = start_chunk.tick; + chunk_stop_tick = stop_chunk.tick; + })) + | _ -> + (* This case is probably already handled by the + [Dissection_invalid_number_of_sections] returned above *) + tzfail + (Dissection_invalid_number_of_sections (Z.of_int number_of_sections)) + in + let rec traverse states = + match states with + | {state_hash = None; _} :: {state_hash = Some _; _} :: _ -> + tzfail Dissection_invalid_successive_states_shape + | {tick; _} :: ({tick = next_tick; state_hash = _} as next) :: others -> + if Sc_rollup_tick_repr.(tick < next_tick) then + let incr = Sc_rollup_tick_repr.distance tick next_tick in + if Z.(leq incr section_maximum_size) then traverse (next :: others) + else tzfail (Dissection_invalid_distribution section_maximum_size) + else tzfail Dissection_ticks_not_increasing + | _ -> return () + in + traverse dissection + +let () = + let description = "Mismatch in the number of sections in the dissection" in + register_error_kind + `Temporary + ~id:"Dissection_number_of_sections_mismatch" + ~title:description + ~description + ~pp:(fun ppf (expected, given) -> + Format.fprintf + ppf + "The number of sections must be equal to %a instead of %a" + Z.pp_print + expected + Z.pp_print + given) + Data_encoding.(obj2 (req "expected" n) (req "given" n)) + (function + | Dissection_number_of_sections_mismatch {expected; given} -> + Some (expected, given) + | _ -> None) + (fun (expected, given) -> + Dissection_number_of_sections_mismatch {expected; given}) ; + let description = "Invalid number of sections in the dissection" in + register_error_kind + `Permanent + ~id:"Dissection_invalid_number_of_sections" + ~title:description + ~description + ~pp:(fun ppf n -> + Format.fprintf + ppf + "A dissection with %a sections can never be valid" + Z.pp_print + n) + Data_encoding.(obj1 (req "value" n)) + (function Dissection_invalid_number_of_sections n -> Some n | _ -> None) + (fun n -> Dissection_invalid_number_of_sections n) ; + let description = "Mismatch in the start hash of the dissection" in + register_error_kind + `Temporary + ~id:"Dissection_start_hash_mismatch" + ~title:description + ~description + ~pp:(fun ppf (given, expected) -> + match given with + | None -> Format.fprintf ppf "The start hash must not be None" + | Some _ -> + Format.fprintf + ppf + "The start hash should be equal to %a, but the provided hash is %a" + pp_hash_opt + expected + pp_hash_opt + given) + Data_encoding.( + obj2 + (req "expected" (option Sc_rollup_repr.State_hash.encoding)) + (req "given" (option Sc_rollup_repr.State_hash.encoding))) + (function + | Dissection_start_hash_mismatch {expected; given} -> + Some (expected, given) + | _ -> None) + (fun (expected, given) -> Dissection_start_hash_mismatch {expected; given}) ; + let description = "Mismatch in the stop hash of the dissection" in + register_error_kind + `Temporary + ~id:"Dissection_stop_hash_mismatch" + ~title:description + ~description + ~pp:(fun ppf h -> + Format.fprintf ppf "The stop hash should not be equal to %a" pp_hash_opt h) + Data_encoding.( + obj1 (req "hash" (option Sc_rollup_repr.State_hash.encoding))) + (function Dissection_stop_hash_mismatch hopt -> Some hopt | _ -> None) + (fun hopt -> Dissection_stop_hash_mismatch hopt) ; + let description = "Mismatch in the edge ticks of the dissection" in + register_error_kind + `Temporary + ~id:"Dissection_edge_ticks_mismatch" + ~title:description + ~description + ~pp: + (fun ppf + ( dissection_start_tick, + dissection_stop_tick, + chunk_start_tick, + chunk_stop_tick ) -> + Sc_rollup_tick_repr.( + Format.fprintf + ppf + "We should have dissection_start_tick(%a) = %a and \ + dissection_stop_tick(%a) = %a" + pp + dissection_start_tick + pp + chunk_start_tick + pp + dissection_stop_tick + pp + chunk_stop_tick)) + Data_encoding.( + obj4 + (req "dissection_start_tick" Sc_rollup_tick_repr.encoding) + (req "dissection_stop_tick" Sc_rollup_tick_repr.encoding) + (req "chunk_start_tick" Sc_rollup_tick_repr.encoding) + (req "chunk_stop_tick" Sc_rollup_tick_repr.encoding)) + (function + | Dissection_edge_ticks_mismatch e -> + Some + ( e.dissection_start_tick, + e.dissection_stop_tick, + e.chunk_start_tick, + e.chunk_stop_tick ) + | _ -> None) + (fun ( dissection_start_tick, + dissection_stop_tick, + chunk_start_tick, + chunk_stop_tick ) -> + Dissection_edge_ticks_mismatch + { + dissection_start_tick; + dissection_stop_tick; + chunk_start_tick; + chunk_stop_tick; + }) ; + let description = "Ticks should only increase in dissection" in + register_error_kind + `Permanent + ~id:"Dissection_ticks_not_increasing" + ~title:description + ~description + ~pp:(fun ppf () -> Format.pp_print_string ppf description) + Data_encoding.empty + (function Dissection_ticks_not_increasing -> Some () | _ -> None) + (fun () -> Dissection_ticks_not_increasing) ; + register_error_kind + `Permanent + ~id:"Dissection_invalid_distribution" + ~title:description + ~description + ~pp:(fun ppf max -> + Format.fprintf + ppf + "Maximum tick increment in a section cannot be more than %a ticks" + Z.pp_print + max) + Data_encoding.(obj1 (req "section_max_size" n)) + (function Dissection_invalid_distribution max -> Some max | _ -> None) + (fun max -> Dissection_invalid_distribution max) ; + let description = "Cannot recover from a blocked state in a dissection" in + register_error_kind + `Permanent + ~id:"Dissection_invalid_successive_states_shape" + ~title:description + ~description + ~pp:(fun ppf () -> Format.pp_print_string ppf description) + Data_encoding.empty + (function + | Dissection_invalid_successive_states_shape -> Some () | _ -> None) + (fun () -> Dissection_invalid_successive_states_shape) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.mli new file mode 100644 index 000000000000..d81adbe90c9f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_dissection_chunk_repr.mli @@ -0,0 +1,108 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr + +(** A dissection chunk is made of an optional state hash, and a tick count. *) +type t = {state_hash : State_hash.t option; tick : Sc_rollup_tick_repr.t} + +val equal : t -> t -> bool + +val pp : Format.formatter -> t -> unit + +val encoding : t Data_encoding.t + +val default_check_sections_number : + default_number_of_sections:int -> + number_of_sections:int -> + dist:Z.t -> + unit tzresult + +(** We check firstly that [dissection] is the correct length. It must + be [default_number_of_sections] values long, unless the distance + between [start_tick] and [stop_tick] is too small to make this + possible, in which case it should be as long as possible. (If the + distance is one we fail immediately as there is no possible legal + dissection). + + Then we check that [dissection] starts at the correct tick and + state (specified by [start_chunk]), and that it ends at + [stop_chunk], at the correct tick and with a different state to + the current dissection. + + Finally, we check that [dissection] is well formed: it has + correctly ordered the ticks, and it begins with a real hash of the + form [Some s] not a [None] state. Note that we have to allow the + possibility of multiple [None] states because the restrictions on + dissection shape (which are necessary to prevent a 'linear-time + game' attack) will mean that sometimes the honest play is a + dissection with multiple [None] states. *) +val default_check : + section_maximum_size:Z.t -> + check_sections_number: + (default_number_of_sections:int -> + number_of_sections:int -> + dist:Z.t -> + unit tzresult) -> + default_number_of_sections:int -> + start_chunk:t -> + stop_chunk:t -> + t list -> + unit tzresult + +type error += + | Dissection_number_of_sections_mismatch of {expected : Z.t; given : Z.t} + (** There are more or less than the expected number of sections in the + given dissection. *) + | Dissection_invalid_number_of_sections of Z.t + (** There are less than two sections in the given dissection, which is + not valid. *) + | Dissection_start_hash_mismatch of { + expected : Sc_rollup_repr.State_hash.t option; + given : Sc_rollup_repr.State_hash.t option; + } + (** The given start hash in a dissection is [None] or doesn't match the + expected one.*) + | Dissection_stop_hash_mismatch of Sc_rollup_repr.State_hash.t option + (** The given stop state hash in a dissection should not match the last + hash of the section being refuted. *) + | Dissection_edge_ticks_mismatch of { + dissection_start_tick : Sc_rollup_tick_repr.t; + dissection_stop_tick : Sc_rollup_tick_repr.t; + chunk_start_tick : Sc_rollup_tick_repr.t; + chunk_stop_tick : Sc_rollup_tick_repr.t; + } + (** The given dissection's edge ticks don't match the edge ticks of the + section being refuted. *) + | Dissection_ticks_not_increasing + (** Invalid provided dissection because ticks are not increasing between + two successive sections. *) + | Dissection_invalid_distribution of Z.t + (** Invalid provided dissection because ticks split is not well balanced + across sections *) + | Dissection_invalid_successive_states_shape + (** A dissection cannot have a section with no state hash after another + section with some state hash. *) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_errors.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_errors.ml new file mode 100644 index 000000000000..5cae4c494539 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_errors.ml @@ -0,0 +1,533 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Temporary *) Sc_rollup_disputed + | (* `Temporary *) Sc_rollup_does_not_exist of Sc_rollup_repr.t + | (* `Temporary *) Sc_rollup_no_conflict + | (* `Temporary *) Sc_rollup_no_stakers + | (* `Temporary *) Sc_rollup_not_staked + | (* `Temporary *) Sc_rollup_not_staked_on_lcc + | (* `Temporary *) Sc_rollup_parent_not_lcc + | (* `Temporary *) Sc_rollup_remove_lcc + | (* `Temporary *) Sc_rollup_staker_backtracked + | (* `Temporary *) Sc_rollup_too_far_ahead + | (* `Temporary *) + Sc_rollup_commitment_from_future of { + current_level : Raw_level_repr.t; + inbox_level : Raw_level_repr.t; + } + | (* `Temporary *) + Sc_rollup_commitment_too_recent of { + current_level : Raw_level_repr.t; + min_level : Raw_level_repr.t; + } + | (* `Temporary *) + Sc_rollup_unknown_commitment of + Sc_rollup_commitment_repr.Hash.t + | (* `Temporary *) Sc_rollup_bad_inbox_level + | (* `Temporary *) Sc_rollup_game_already_started + | (* `Temporary *) + Sc_rollup_max_number_of_parallel_games_reached of + Signature.Public_key_hash.t + | (* `Temporary *) Sc_rollup_wrong_turn + | (* `Temporary *) Sc_rollup_no_game + | (* `Temporary *) + Sc_rollup_staker_in_game of + [ `Refuter of Signature.public_key_hash + | `Defender of Signature.public_key_hash + | `Both of Signature.public_key_hash * Signature.public_key_hash ] + | (* `Temporary *) + Sc_rollup_timeout_level_not_reached of + int32 * Signature.public_key_hash + | (* `Temporary *) + Sc_rollup_max_number_of_messages_reached_for_commitment_period + | (* `Permanent *) Sc_rollup_add_zero_messages + | (* `Temporary *) Sc_rollup_invalid_outbox_message_index + | (* `Temporary *) Sc_rollup_outbox_level_expired + | (* `Temporary *) Sc_rollup_outbox_message_already_applied + | (* `Temporary *) + Sc_rollup_staker_funds_too_low of { + staker : Signature.public_key_hash; + sc_rollup : Sc_rollup_repr.t; + staker_balance : Tez_repr.t; + min_expected_balance : Tez_repr.t; + } + | (* `Temporary *) Sc_rollup_bad_commitment_serialization + | (* `Permanent *) Sc_rollup_address_generation + | (* `Permanent *) Sc_rollup_zero_tick_commitment + | (* `Permanent *) Sc_rollup_commitment_past_curfew + +let () = + register_error_kind + `Temporary + ~id:"Sc_rollup_staker_in_game" + ~title:"Staker is already playing a game" + ~description:"Attempted to start a game where one staker is already busy" + ~pp:(fun ppf staker -> + let busy ppf = function + | `Refuter sc -> + Format.fprintf + ppf + "the refuter (%a) is" + Signature.Public_key_hash.pp + sc + | `Defender sc -> + Format.fprintf + ppf + "the defender (%a) is" + Signature.Public_key_hash.pp + sc + | `Both (refuter, defender) -> + Format.fprintf + ppf + "both the refuter (%a) and the defender (%a) are" + Signature.Public_key_hash.pp + refuter + Signature.Public_key_hash.pp + defender + in + Format.fprintf + ppf + "Attempted to start a game where %a already busy." + busy + staker) + Data_encoding.( + union + [ + case + (Tag 0) + ~title:"Refuter" + (obj1 (req "refuter" Signature.Public_key_hash.encoding)) + (function `Refuter sc -> Some sc | _ -> None) + (fun sc -> `Refuter sc); + case + (Tag 1) + ~title:"Defender" + (obj1 (req "defender" Signature.Public_key_hash.encoding)) + (function `Defender sc -> Some sc | _ -> None) + (fun sc -> `Defender sc); + case + (Tag 2) + ~title:"Both" + (obj2 + (req "refuter" Signature.Public_key_hash.encoding) + (req "defender" Signature.Public_key_hash.encoding)) + (function + | `Both (refuter, defender) -> Some (refuter, defender) + | _ -> None) + (fun (refuter, defender) -> `Both (refuter, defender)); + ]) + (function Sc_rollup_staker_in_game x -> Some x | _ -> None) + (fun x -> Sc_rollup_staker_in_game x) ; + let description = "Attempt to timeout game too early" in + register_error_kind + `Temporary + ~id:"Sc_rollup_timeout_level_not_reached" + ~title:"Attempt to timeout game too early" + ~description + ~pp:(fun ppf (blocks_left, staker) -> + Format.fprintf + ppf + "%s. The player %a has %ld left blocks to play." + description + Signature.Public_key_hash.pp_short + staker + blocks_left) + Data_encoding.( + obj2 + (req "level_timeout" int32) + (req "staker" Signature.Public_key_hash.encoding)) + (function + | Sc_rollup_timeout_level_not_reached (blocks_left, staker) -> + Some (blocks_left, staker) + | _ -> None) + (fun (blocks_left, staker) -> + Sc_rollup_timeout_level_not_reached (blocks_left, staker)) ; + let description = + "Refutation game already started, must play with is_opening_move = false." + in + register_error_kind + `Temporary + ~id:"Sc_rollup_game_already_started" + ~title:"Refutation game already started" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Sc_rollup_game_already_started -> Some () | _ -> None) + (fun () -> Sc_rollup_game_already_started) ; + let description = "Refutation game does not exist" in + register_error_kind + `Temporary + ~id:"Sc_rollup_no_game" + ~title:"Refutation game does not exist" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Sc_rollup_no_game -> Some () | _ -> None) + (fun () -> Sc_rollup_no_game) ; + let description = "Attempt to play move but not staker's turn" in + register_error_kind + `Temporary + ~id:"Sc_rollup_wrong_turn" + ~title:"Attempt to play move but not staker's turn" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Sc_rollup_wrong_turn -> Some () | _ -> None) + (fun () -> Sc_rollup_wrong_turn) ; + let description = + "Maximum number of messages reached for commitment period" + in + register_error_kind + `Temporary + ~id:"Sc_rollup_max_number_of_messages_reached_for_commitment_period" + ~title:"Maximum number of messages reached for commitment period" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function + | Sc_rollup_max_number_of_messages_reached_for_commitment_period -> + Some () + | _ -> None) + (fun () -> Sc_rollup_max_number_of_messages_reached_for_commitment_period) ; + let description = "Tried to add zero messages to a SC rollup" in + register_error_kind + `Permanent + ~id:"sc_rollup_errors.sc_rollup_add_zero_messages" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Sc_rollup_add_zero_messages -> Some () | _ -> None) + (fun () -> Sc_rollup_add_zero_messages) ; + let description = "Attempted to cement a disputed commitment." in + register_error_kind + `Temporary + ~id:"Sc_rollup_disputed" + ~title:"Commitment disputed" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_disputed -> Some () | _ -> None) + (fun () -> Sc_rollup_disputed) ; + let description = "Attempted to use a rollup that has not been originated." in + register_error_kind + `Temporary + ~id:"Sc_rollup_does_not_exist" + ~title:"Rollup does not exist" + ~description + ~pp:(fun ppf x -> + Format.fprintf ppf "Rollup %a does not exist" Sc_rollup_repr.pp x) + Data_encoding.(obj1 (req "rollup" Sc_rollup_repr.encoding)) + (function Sc_rollup_does_not_exist x -> Some x | _ -> None) + (fun x -> Sc_rollup_does_not_exist x) ; + let description = "No conflict." in + register_error_kind + `Temporary + ~id:"Sc_rollup_no_conflict" + ~title:"No conflict" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_no_conflict -> Some () | _ -> None) + (fun () -> Sc_rollup_no_conflict) ; + let description = "No stakers." in + register_error_kind + `Temporary + ~id:"Sc_rollup_no_stakers" + ~title:"No stakers" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_no_stakers -> Some () | _ -> None) + (fun () -> Sc_rollup_no_stakers) ; + let description = "Unknown staker." in + register_error_kind + `Temporary + ~id:"Sc_rollup_not_staked" + ~title:"Unknown staker" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_not_staked -> Some () | _ -> None) + (fun () -> Sc_rollup_not_staked) ; + let description = + "Attempted to withdraw while not staked on the last cemented commitment." + in + register_error_kind + `Temporary + ~id:"Sc_rollup_not_staked_on_lcc" + ~title:"Rollup not staked on LCC" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_not_staked_on_lcc -> Some () | _ -> None) + (fun () -> Sc_rollup_not_staked_on_lcc) ; + let description = "Parent is not the last cemented commitment." in + register_error_kind + `Temporary + ~id:"Sc_rollup_parent_not_lcc" + ~title:"Parent is not the last cemented commitment" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_parent_not_lcc -> Some () | _ -> None) + (fun () -> Sc_rollup_parent_not_lcc) ; + let description = "Can not remove a cemented commitment." in + register_error_kind + `Temporary + ~id:"Sc_rollup_remove_lcc" + ~title:"Can not remove cemented" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_remove_lcc -> Some () | _ -> None) + (fun () -> Sc_rollup_remove_lcc) ; + let description = "Staker backtracked." in + register_error_kind + `Temporary + ~id:"Sc_rollup_staker_backtracked" + ~title:"Staker backtracked" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_staker_backtracked -> Some () | _ -> None) + (fun () -> Sc_rollup_staker_backtracked) ; + let description = + "Commitment is too far ahead of the last cemented commitment." + in + register_error_kind + `Temporary + ~id:"Sc_rollup_too_far_ahead" + ~title:"Commitment too far ahead" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_too_far_ahead -> Some () | _ -> None) + (fun () -> Sc_rollup_too_far_ahead) ; + let description = + "Attempted to cement a commitment before its refutation deadline." + in + register_error_kind + `Temporary + ~id:"Sc_rollup_commitment_too_recent" + ~title:"Commitment too recent" + ~description + ~pp:(fun ppf (current_level, min_level) -> + Format.fprintf + ppf + "%s@ Current level: %a,@ minimal level: %a" + description + Raw_level_repr.pp + current_level + Raw_level_repr.pp + min_level) + Data_encoding.( + obj2 + (req "current_level" Raw_level_repr.encoding) + (req "min_level" Raw_level_repr.encoding)) + (function + | Sc_rollup_commitment_too_recent {current_level; min_level} -> + Some (current_level, min_level) + | _ -> None) + (fun (current_level, min_level) -> + Sc_rollup_commitment_too_recent {current_level; min_level}) ; + let description = "Unknown commitment." in + register_error_kind + `Temporary + ~id:"Sc_rollup_unknown_commitment" + ~title:"Unknown commitment" + ~description + ~pp:(fun ppf x -> + Format.fprintf + ppf + "Commitment %a does not exist" + Sc_rollup_commitment_repr.Hash.pp + x) + Data_encoding.( + obj1 (req "commitment" Sc_rollup_commitment_repr.Hash.encoding)) + (function Sc_rollup_unknown_commitment x -> Some x | _ -> None) + (fun x -> Sc_rollup_unknown_commitment x) ; + let description = "Attempted to commit to a bad inbox level." in + register_error_kind + `Temporary + ~id:"Sc_rollup_bad_inbox_level" + ~title:"Committing to a bad inbox level" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_bad_inbox_level -> Some () | _ -> None) + (fun () -> Sc_rollup_bad_inbox_level) ; + let description = "Invalid rollup outbox message index" in + register_error_kind + `Temporary + ~id:"Sc_rollup_invalid_outbox_message_index" + ~title:"Invalid rollup outbox message index" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_invalid_outbox_message_index -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_outbox_message_index) ; + let description = "Outbox level expired" in + register_error_kind + `Temporary + ~id:"Sc_rollup_outbox_level_expired" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_outbox_level_expired -> Some () | _ -> None) + (fun () -> Sc_rollup_outbox_level_expired) ; + let description = "Outbox message already applied" in + register_error_kind + `Temporary + ~id:"Sc_rollup_outbox_message_already_applied" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_outbox_message_already_applied -> Some () | _ -> None) + (fun () -> Sc_rollup_outbox_message_already_applied) ; + register_error_kind + `Temporary + ~id:"Sc_rollup_staker_funds_too_low" + ~title:"Staker does not have enough funds to make a deposit" + ~description: + "Staker doesn't have enough funds to make a smart contract rollup \ + deposit." + ~pp:(fun ppf (staker, sc_rollup, staker_balance, min_expected_balance) -> + Format.fprintf + ppf + "Staker (%a) doesn't have enough funds to make the deposit for smart \ + contract rollup (%a). Staker's balance is %a while a balance of at \ + least %a is required." + Signature.Public_key_hash.pp + staker + Sc_rollup_repr.pp + sc_rollup + Tez_repr.pp + staker_balance + Tez_repr.pp + min_expected_balance) + Data_encoding.( + obj4 + (req "staker" Signature.Public_key_hash.encoding) + (req "sc_rollup" Sc_rollup_repr.encoding) + (req "staker_balance" Tez_repr.encoding) + (req "min_expected_balance" Tez_repr.encoding)) + (function + | Sc_rollup_staker_funds_too_low + {staker; sc_rollup; staker_balance; min_expected_balance} -> + Some (staker, sc_rollup, staker_balance, min_expected_balance) + | _ -> None) + (fun (staker, sc_rollup, staker_balance, min_expected_balance) -> + Sc_rollup_staker_funds_too_low + {staker; sc_rollup; staker_balance; min_expected_balance}) ; + let description = "Could not serialize commitment." in + register_error_kind + `Temporary + ~id:"Sc_rollup_bad_commitment_serialization" + ~title:"Could not serialize commitment." + ~description:"Unable to hash the commitment serialization." + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_bad_commitment_serialization -> Some () | _ -> None) + (fun () -> Sc_rollup_bad_commitment_serialization) ; + let description = "Commitment inbox level is greater than current level" in + register_error_kind + `Temporary + ~id:"Sc_rollup_commitment_from_future" + ~title:"Commitment from future" + ~description + ~pp:(fun ppf (current_level, inbox_level) -> + Format.fprintf + ppf + "%s@ Current level: %a,@ commitment inbox level: %a" + description + Raw_level_repr.pp + current_level + Raw_level_repr.pp + inbox_level) + Data_encoding.( + obj2 + (req "current_level" Raw_level_repr.encoding) + (req "inbox_level" Raw_level_repr.encoding)) + (function + | Sc_rollup_commitment_from_future {current_level; inbox_level} -> + Some (current_level, inbox_level) + | _ -> None) + (fun (current_level, inbox_level) -> + Sc_rollup_commitment_from_future {current_level; inbox_level}) ; + let description = "Commitment is past the curfew for this level." in + register_error_kind + `Permanent + ~id:"Sc_rollup_commitment_past_curfew" + ~title:"Commitment past curfew." + ~description: + "A commitment exists for this inbox level for longer than the curfew \ + period." + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_commitment_past_curfew -> Some () | _ -> None) + (fun () -> Sc_rollup_commitment_past_curfew) ; + let description = "Error while generating rollup address" in + register_error_kind + `Permanent + ~id:"rollup.error_smart_contract_rollup_address_generation" + ~title:description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + ~description + Data_encoding.empty + (function Sc_rollup_address_generation -> Some () | _ -> None) + (fun () -> Sc_rollup_address_generation) ; + let description = "Tried to publish a 0 tick commitment" in + register_error_kind + `Permanent + ~id:"Sc_rollup_zero_tick_commitment" + ~title:description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + ~description + Data_encoding.empty + (function Sc_rollup_zero_tick_commitment -> Some () | _ -> None) + (fun () -> Sc_rollup_zero_tick_commitment) ; + let description = "Maximal number of parallel games reached" in + register_error_kind + `Temporary + ~id:"Sc_rollup_maximal_number_of_parallel_games_reached" + ~title:description + ~pp:(fun ppf staker -> + Format.fprintf + ppf + "%a has reached the limit for number of parallel games" + Signature.Public_key_hash.pp + staker) + ~description + Data_encoding.(obj1 (req "staker" Signature.Public_key_hash.encoding)) + (function + | Sc_rollup_max_number_of_parallel_games_reached staker -> Some staker + | _ -> None) + (fun staker -> Sc_rollup_max_number_of_parallel_games_reached staker) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.ml new file mode 100644 index 000000000000..b3c049969710 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.ml @@ -0,0 +1,987 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_repr + +(** {2 Refutation game errors} *) + +type error += + | (* `Temporary *) + Dissection_choice_not_found of Sc_rollup_tick_repr.t + | (* `Permanent *) Proof_unexpected_section_size of Z.t + | (* `Temporary *) + Proof_start_state_hash_mismatch of { + start_state_hash : Sc_rollup_repr.State_hash.t option; + start_proof : Sc_rollup_repr.State_hash.t; + } + | (* `Temporary *) + Proof_stop_state_hash_failed_to_refute of { + stop_state_hash : Sc_rollup_repr.State_hash.t option; + stop_proof : Sc_rollup_repr.State_hash.t option; + } + | (* `Temporary *) + Proof_stop_state_hash_failed_to_validate of { + stop_state_hash : Sc_rollup_repr.State_hash.t option; + stop_proof : Sc_rollup_repr.State_hash.t option; + } + | (* `Temporary *) Dissecting_during_final_move + +let pp_hash_opt fmt = function + | None -> Format.fprintf fmt "None" + | Some x -> Sc_rollup_repr.State_hash.pp fmt x + +let () = + let description = "Dissection choice not found" in + register_error_kind + `Temporary + ~id:"Dissection_choice_not_found" + ~title:description + ~description + ~pp:(fun ppf choice -> + Format.fprintf + ppf + "No section starting with tick %a found" + Sc_rollup_tick_repr.pp + choice) + Data_encoding.(obj1 (req "choice" Sc_rollup_tick_repr.encoding)) + (function Dissection_choice_not_found tick -> Some tick | _ -> None) + (fun tick -> Dissection_choice_not_found tick) ; + let description = "The distance for a proof should be equal to 1" in + register_error_kind + `Permanent + ~id:"Dissection_unexpected_section_size" + ~title:description + ~description + ~pp:(fun ppf n -> + Format.fprintf + ppf + "Distance should be equal to 1 in a proof, but got %a" + Z.pp_print + n) + Data_encoding.(obj1 (req "n" n)) + (function Proof_unexpected_section_size n -> Some n | _ -> None) + (fun n -> Proof_unexpected_section_size n) ; + let description = "The start state hash of the proof is invalid" in + register_error_kind + `Temporary + ~id:"Proof_start_state_hash_mismatch" + ~title:description + ~description + ~pp:(fun ppf (start_state_hash, start_proof) -> + Format.fprintf + ppf + "start(%a) should be equal to start_proof(%a)" + pp_hash_opt + start_state_hash + Sc_rollup_repr.State_hash.pp + start_proof) + Data_encoding.( + obj2 + (req "start_state_hash" (option Sc_rollup_repr.State_hash.encoding)) + (req "start_proof" Sc_rollup_repr.State_hash.encoding)) + (function + | Proof_start_state_hash_mismatch {start_state_hash; start_proof} -> + Some (start_state_hash, start_proof) + | _ -> None) + (fun (start_state_hash, start_proof) -> + Proof_start_state_hash_mismatch {start_state_hash; start_proof}) ; + let description = "Failed to refute the stop state hash with the proof" in + register_error_kind + `Temporary + ~id:"Proof_stop_state_hash_failed_to_refute" + ~title:description + ~description + ~pp:(fun ppf (stop_state_hash, stop_proof) -> + Format.fprintf + ppf + "Trying to refute %a, the stop_proof must not be equal to %a" + pp_hash_opt + stop_state_hash + pp_hash_opt + stop_proof) + Data_encoding.( + obj2 + (req "stop_state_hash" (option Sc_rollup_repr.State_hash.encoding)) + (req "stop_proof" (option Sc_rollup_repr.State_hash.encoding))) + (function + | Proof_stop_state_hash_failed_to_refute {stop_state_hash; stop_proof} -> + Some (stop_state_hash, stop_proof) + | _ -> None) + (fun (stop_state_hash, stop_proof) -> + Proof_stop_state_hash_failed_to_refute {stop_state_hash; stop_proof}) ; + let description = "Failed to validate the stop state hash with the proof" in + register_error_kind + `Temporary + ~id:"Proof_stop_state_hash_failed_to_validate" + ~title:description + ~description + ~pp:(fun ppf (stop_state_hash, stop_proof) -> + Format.fprintf + ppf + "Trying to validate %a, the stop_proof must not be equal to %a" + pp_hash_opt + stop_state_hash + pp_hash_opt + stop_proof) + Data_encoding.( + obj2 + (req "stop_state_hash" (option Sc_rollup_repr.State_hash.encoding)) + (req "stop_proof" (option Sc_rollup_repr.State_hash.encoding))) + (function + | Proof_stop_state_hash_failed_to_validate {stop_state_hash; stop_proof} + -> + Some (stop_state_hash, stop_proof) + | _ -> None) + (fun (stop_state_hash, stop_proof) -> + Proof_stop_state_hash_failed_to_validate {stop_state_hash; stop_proof}) ; + let description = "Tried to play a dissecting when the final move started" in + register_error_kind + `Temporary + ~id:"Dissecting_during_final_move" + ~title:description + ~description + ~pp:(fun ppf () -> Format.pp_print_string ppf description) + Data_encoding.empty + (function Dissecting_during_final_move -> Some () | _ -> None) + (fun () -> Dissecting_during_final_move) ; + () + +type player = Alice | Bob + +module V1 = struct + type dissection_chunk = Sc_rollup_dissection_chunk_repr.t = { + state_hash : State_hash.t option; + tick : Sc_rollup_tick_repr.t; + } + + type game_state = + | Dissecting of { + dissection : dissection_chunk list; + default_number_of_sections : int; + } + | Final_move of { + agreed_start_chunk : dissection_chunk; + refuted_stop_chunk : dissection_chunk; + } + + type t = { + turn : player; + inbox_snapshot : Sc_rollup_inbox_repr.history_proof; + dal_snapshot : Dal_slot_repr.History.t; + start_level : Raw_level_repr.t; + inbox_level : Raw_level_repr.t; + game_state : game_state; + } + + let player_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Alice" + (Tag 0) + (constant "alice") + (function Alice -> Some () | _ -> None) + (fun () -> Alice); + case + ~title:"Bob" + (Tag 1) + (constant "bob") + (function Bob -> Some () | _ -> None) + (fun () -> Bob); + ] + + let player_equal p1 p2 = + match (p1, p2) with + | Alice, Alice -> true + | Bob, Bob -> true + | _, _ -> false + + let game_state_equal gs1 gs2 = + match (gs1, gs2) with + | ( Dissecting + { + dissection = dissection1; + default_number_of_sections = default_number_of_sections1; + }, + Dissecting + { + dissection = dissection2; + default_number_of_sections = default_number_of_sections2; + } ) -> + Compare.Int.equal + default_number_of_sections1 + default_number_of_sections2 + && List.equal + Sc_rollup_dissection_chunk_repr.equal + dissection1 + dissection2 + | Dissecting _, _ -> false + | ( Final_move + { + agreed_start_chunk = agreed_start_chunk1; + refuted_stop_chunk = refuted_stop_chunk1; + }, + Final_move + { + agreed_start_chunk = agreed_start_chunk2; + refuted_stop_chunk = refuted_stop_chunk2; + } ) -> + Sc_rollup_dissection_chunk_repr.equal + agreed_start_chunk1 + agreed_start_chunk2 + && Sc_rollup_dissection_chunk_repr.equal + refuted_stop_chunk1 + refuted_stop_chunk2 + | Final_move _, _ -> false + + let equal + {turn; inbox_snapshot; dal_snapshot; start_level; inbox_level; game_state} + g2 = + player_equal turn g2.turn + && Sc_rollup_inbox_repr.equal_history_proof inbox_snapshot g2.inbox_snapshot + && Dal_slot_repr.History.equal dal_snapshot g2.dal_snapshot + && Raw_level_repr.equal start_level g2.start_level + && Raw_level_repr.equal inbox_level g2.inbox_level + && game_state_equal game_state g2.game_state + + let string_of_player = function Alice -> "alice" | Bob -> "bob" + + let pp_player ppf player = + Format.pp_print_string ppf (string_of_player player) + + let opponent = function Alice -> Bob | Bob -> Alice + + let dissection_encoding = + let open Data_encoding in + list Sc_rollup_dissection_chunk_repr.encoding + + let game_state_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Dissecting" + (Tag 0) + (obj3 + (req "kind" (constant "Dissecting")) + (req "dissection" dissection_encoding) + (req "default_number_of_sections" uint8)) + (function + | Dissecting {dissection; default_number_of_sections} -> + Some ((), dissection, default_number_of_sections) + | _ -> None) + (fun ((), dissection, default_number_of_sections) -> + Dissecting {dissection; default_number_of_sections}); + case + ~title:"Final_move" + (Tag 1) + (obj3 + (req "kind" (constant "Final_move")) + (req "agreed_start_chunk" Sc_rollup_dissection_chunk_repr.encoding) + (req "refuted_stop_chunk" Sc_rollup_dissection_chunk_repr.encoding)) + (function + | Final_move {agreed_start_chunk; refuted_stop_chunk} -> + Some ((), agreed_start_chunk, refuted_stop_chunk) + | _ -> None) + (fun ((), agreed_start_chunk, refuted_stop_chunk) -> + Final_move {agreed_start_chunk; refuted_stop_chunk}); + ] + + let encoding = + let open Data_encoding in + conv + (fun { + turn; + inbox_snapshot; + dal_snapshot; + start_level; + inbox_level; + game_state; + } -> + ( turn, + inbox_snapshot, + dal_snapshot, + start_level, + inbox_level, + game_state )) + (fun ( turn, + inbox_snapshot, + dal_snapshot, + start_level, + inbox_level, + game_state ) -> + { + turn; + inbox_snapshot; + dal_snapshot; + start_level; + inbox_level; + game_state; + }) + (obj6 + (req "turn" player_encoding) + (req "inbox_snapshot" Sc_rollup_inbox_repr.history_proof_encoding) + (req "dal_snapshot" Dal_slot_repr.History.encoding) + (req "start_level" Raw_level_repr.encoding) + (req "inbox_level" Raw_level_repr.encoding) + (req "game_state" game_state_encoding)) + + let pp_dissection ppf d = + Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.pp_print_string ppf ";\n") + Sc_rollup_dissection_chunk_repr.pp + ppf + d + + let pp_game_state ppf game_state = + let open Format in + match game_state with + | Dissecting {dissection; default_number_of_sections} -> + fprintf + ppf + "Dissecting %a using %d number of sections" + pp_dissection + dissection + default_number_of_sections + | Final_move {agreed_start_chunk; refuted_stop_chunk} -> + fprintf + ppf + "Final move to refute %a from %a, opponent failed to refute" + Sc_rollup_dissection_chunk_repr.pp + agreed_start_chunk + Sc_rollup_dissection_chunk_repr.pp + refuted_stop_chunk + + let pp ppf game = + Format.fprintf + ppf + "%a playing; inbox snapshot = %a; start level = %a; inbox level = %a; \ + game_state = %a" + pp_player + game.turn + Sc_rollup_inbox_repr.pp_history_proof + game.inbox_snapshot + Raw_level_repr.pp + game.start_level + Raw_level_repr.pp + game.inbox_level + pp_game_state + game.game_state +end + +type versioned = V1 of V1.t + +let versioned_encoding = + let open Data_encoding in + union + [ + case + ~title:"V1" + (Tag 0) + V1.encoding + (function V1 game -> Some game) + (fun game -> V1 game); + ] + +include V1 + +let of_versioned = function V1 game -> game [@@inline] + +let to_versioned game = V1 game [@@inline] + +module Index = struct + type t = {alice : Staker.t; bob : Staker.t} + + let make a b = + let alice, bob = + if Compare.Int.(Staker.compare a b > 0) then (b, a) else (a, b) + in + {alice; bob} + + let encoding = + let open Data_encoding in + conv + (fun {alice; bob} -> (alice, bob)) + (fun (alice, bob) -> make alice bob) + (obj2 (req "alice" Staker.encoding) (req "bob" Staker.encoding)) + + let compare {alice = a; bob = b} {alice = c; bob = d} = + match Staker.compare a c with 0 -> Staker.compare b d | x -> x + + let to_path {alice; bob} p = + Staker.to_b58check alice :: Staker.to_b58check bob :: p + + let both_of_b58check_opt (a, b) = + let ( let* ) = Option.bind in + let* a_staker = Staker.of_b58check_opt a in + let* b_staker = Staker.of_b58check_opt b in + Some (make a_staker b_staker) + + let of_path = function [a; b] -> both_of_b58check_opt (a, b) | _ -> None + + let path_length = 2 + + let rpc_arg = + let descr = + "A pair of stakers that index a smart contract rollup refutation game." + in + let construct {alice; bob} = + Format.sprintf "%s-%s" (Staker.to_b58check alice) (Staker.to_b58check bob) + in + let destruct s = + match String.split_on_char '-' s with + | [a; b] -> ( + match both_of_b58check_opt (a, b) with + | Some stakers -> ok stakers + | None -> + Result.error (Format.sprintf "Invalid game index notation %s" s)) + | _ -> Result.error (Format.sprintf "Invalid game index notation %s" s) + in + RPC_arg.make ~descr ~name:"game_index" ~construct ~destruct () + + let staker {alice; bob} = function Alice -> alice | Bob -> bob +end + +let make_chunk state_hash tick = {state_hash; tick} + +let initial inbox dal_snapshot ~start_level + ~(parent : Sc_rollup_commitment_repr.t) + ~(child : Sc_rollup_commitment_repr.t) ~refuter ~defender + ~default_number_of_sections = + let ({alice; _} : Index.t) = Index.make refuter defender in + let alice_to_play = Staker.equal alice refuter in + let open Sc_rollup_tick_repr in + let tick = of_number_of_ticks child.number_of_ticks in + let game_state = + Dissecting + { + dissection = + [ + make_chunk (Some parent.compressed_state) initial; + make_chunk (Some child.compressed_state) tick; + make_chunk None (next tick); + ]; + default_number_of_sections; + } + in + + { + turn = (if alice_to_play then Alice else Bob); + inbox_snapshot = inbox; + dal_snapshot; + start_level; + inbox_level = child.inbox_level; + game_state; + } + +type step = + | Dissection of dissection_chunk list + | Proof of Sc_rollup_proof_repr.serialized Sc_rollup_proof_repr.t + +let step_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Dissection" + (Tag 0) + dissection_encoding + (function Dissection d -> Some d | _ -> None) + (fun d -> Dissection d); + case + ~title:"Proof" + (Tag 1) + Sc_rollup_proof_repr.encoding + (function Proof p -> Some p | _ -> None) + (fun p -> Proof p); + ] + +let pp_step ppf step = + match step with + | Dissection states -> + Format.fprintf ppf "Dissection:@ " ; + Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.pp_print_string ppf ";\n\n") + (fun ppf {state_hash; tick} -> + Format.fprintf + ppf + "Tick: %a,@ State: %a\n" + Sc_rollup_tick_repr.pp + tick + (Format.pp_print_option State_hash.pp) + state_hash) + ppf + states + | Proof proof -> Format.fprintf ppf "proof: %a" Sc_rollup_proof_repr.pp proof + +type refutation = {choice : Sc_rollup_tick_repr.t; step : step} + +let pp_refutation ppf {choice; step} = + Format.fprintf + ppf + "Tick: %a@ Step: %a" + Sc_rollup_tick_repr.pp + choice + pp_step + step + +let refutation_encoding = + let open Data_encoding in + conv + (fun {choice; step} -> (choice, step)) + (fun (choice, step) -> {choice; step}) + (obj2 + (req "choice" Sc_rollup_tick_repr.encoding) + (req "step" step_encoding)) + +type reason = Conflict_resolved | Timeout + +let pp_reason ppf reason = + match reason with + | Conflict_resolved -> Format.fprintf ppf "conflict resolved" + | Timeout -> Format.fprintf ppf "timeout" + +let reason_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Conflict_resolved" + (Tag 0) + (constant "conflict_resolved") + (function Conflict_resolved -> Some () | _ -> None) + (fun () -> Conflict_resolved); + case + ~title:"Timeout" + (Tag 1) + (constant "timeout") + (function Timeout -> Some () | _ -> None) + (fun () -> Timeout); + ] + +type game_result = Loser of {reason : reason; loser : Staker.t} | Draw + +let pp_game_result ppf r = + let open Format in + match r with + | Loser {reason; loser} -> + fprintf ppf "%a lost because: %a" Staker.pp loser pp_reason reason + | Draw -> fprintf ppf "Draw" + +let game_result_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Loser" + (Tag 0) + (obj3 + (req "kind" (constant "loser")) + (req "reason" reason_encoding) + (req "player" Staker.encoding)) + (function + | Loser {reason; loser} -> Some ((), reason, loser) | _ -> None) + (fun ((), reason, loser) -> Loser {reason; loser}); + case + ~title:"Draw" + (Tag 1) + (obj1 (req "kind" (constant "draw"))) + (function Draw -> Some () | _ -> None) + (fun () -> Draw); + ] + +type status = Ongoing | Ended of game_result + +let pp_status ppf status = + match status with + | Ongoing -> Format.fprintf ppf "Game ongoing" + | Ended game_result -> + Format.fprintf ppf "Game ended: %a" pp_game_result game_result + +let status_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Ongoing" + (Tag 0) + (constant "ongoing") + (function Ongoing -> Some () | _ -> None) + (fun () -> Ongoing); + case + ~title:"Ended" + (Tag 1) + (obj1 (req "result" game_result_encoding)) + (function Ended r -> Some r | _ -> None) + (fun r -> Ended r); + ] + +let find_choice dissection tick = + let open Result_syntax in + let rec traverse states = + match states with + | ({state_hash = _; tick = state_tick} as curr) :: next :: others -> + if Sc_rollup_tick_repr.(tick = state_tick) then return (curr, next) + else traverse (next :: others) + | _ -> tzfail (Dissection_choice_not_found tick) + in + traverse dissection + +(** Check that the chosen interval is a single tick. *) +let check_proof_distance_is_one ~start_tick ~stop_tick = + let dist = Sc_rollup_tick_repr.distance start_tick stop_tick in + error_unless Z.(equal dist one) (Proof_unexpected_section_size dist) + +(** Check the proof begins with the correct state. *) +let check_proof_start_state ~pvm ~start_state proof = + let start_proof = Sc_rollup_proof_repr.start_of_pvm_step ~pvm proof in + error_unless + (Option.equal State_hash.equal start_state (Some start_proof)) + (Proof_start_state_hash_mismatch + {start_state_hash = start_state; start_proof}) + +(** Check the proof stops with a different state than refuted one. *) +let check_proof_stop_state ~pvm ~stop_state input_given + (input_request : Sc_rollup_PVM_sig.input_request) proof validate = + let stop_proof = + match (input_given, input_request) with + | None, No_input_required + | Some _, Initial + | Some _, First_after _ + | Some _, Needs_reveal _ -> + Some (Sc_rollup_proof_repr.stop_of_pvm_step ~pvm proof) + | Some _, No_input_required + | None, Initial + | None, First_after _ + | None, Needs_reveal _ -> + None + in + error_unless + (let b = Option.equal State_hash.equal stop_state stop_proof in + if validate then b else not b) + (if validate then + Proof_stop_state_hash_failed_to_validate + {stop_state_hash = stop_state; stop_proof} + else + Proof_stop_state_hash_failed_to_refute + {stop_state_hash = stop_state; stop_proof}) + +(** Check the proof validates the stop state. *) +let check_proof_validate_stop_state ~stop_state input input_request proof = + check_proof_stop_state ~stop_state input input_request proof true + +(** Check the proof refutes the stop state. *) +let check_proof_refute_stop_state ~stop_state input input_request proof = + check_proof_stop_state ~stop_state input input_request proof false + +(** Returns the validity of the first final move on top of a dissection. *) +let validity_final_move ~pvm ~dal_parameters ~dal_attestation_lag ~first_move + ~metadata ~proof ~game ~start_chunk ~stop_chunk = + let open Lwt_result_syntax in + let*! res = + let {inbox_snapshot; inbox_level; dal_snapshot; _} = game in + let*! valid = + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + This function is not resilient to dal parameters changes + (cryptobox parameters or dal_attestation_lag for instance). *) + Sc_rollup_proof_repr.valid + ~pvm + ~metadata + inbox_snapshot + inbox_level + dal_snapshot + dal_parameters + ~dal_attestation_lag + proof + in + let*? () = + if first_move then + check_proof_distance_is_one + ~start_tick:start_chunk.tick + ~stop_tick:stop_chunk.tick + else ok () + in + let*? () = + check_proof_start_state + ~pvm + ~start_state:start_chunk.state_hash + proof.pvm_step + in + match valid with + | Ok (input, input_request) -> + let*? () = + if first_move then + check_proof_refute_stop_state + ~pvm + ~stop_state:stop_chunk.state_hash + input + input_request + proof.pvm_step + else + check_proof_validate_stop_state + ~pvm + ~stop_state:stop_chunk.state_hash + input + input_request + proof.pvm_step + in + return_true + | _ -> return_false + in + Lwt.return @@ Result.value ~default:false res + +(** Returns the validity of the first final move on top of a dissection. + + It is valid if and only: + - The distance of the refuted dissection is [1]. + - The proof start on the agreed start state. + - The proof stop on the state different than the refuted one. + - The proof is correctly verified. +*) +let validity_first_final_move ~pvm ~dal_parameters ~dal_attestation_lag + ~metadata ~proof ~game ~start_chunk ~stop_chunk = + validity_final_move + ~pvm + ~dal_parameters + ~dal_attestation_lag + ~first_move:true + ~metadata + ~proof + ~game + ~start_chunk + ~stop_chunk + +(** Returns the validity of the second final move. + + It is valid if and only: + - The proof start on the agreed start state. + - The proof stop on the state validates the refuted one. + - The proof is correctly verified. +*) +let validity_second_final_move ~pvm ~dal_parameters ~dal_attestation_lag + ~metadata ~agreed_start_chunk ~refuted_stop_chunk ~game ~proof = + validity_final_move + ~pvm + ~dal_parameters + ~dal_attestation_lag + ~first_move:false + ~metadata + ~proof + ~game + ~start_chunk:agreed_start_chunk + ~stop_chunk:refuted_stop_chunk + +let loser_of_results ~alice_result ~bob_result = + match (alice_result, bob_result) with + | true, true -> None + | false, false -> None + | false, true -> Some Alice + | true, false -> Some Bob + +let cost_play _game refutation = + match refutation.step with + | Dissection states -> + let number_of_states = List.length states in + let hash_size = State_hash.size in + let tick_size = Sc_rollup_tick_repr.size_in_bytes refutation.choice in + Sc_rollup_costs.cost_check_dissection + ~number_of_states + ~tick_size + ~hash_size + | Proof _proof -> + (* + + Proof verification is complex. We choose to follow a very + rough overaproximation based on the idea that proof + verification for both the inbox and the execution step is + dominated by hash computation. + + Assuming that the worst case is a proof of the maximal + operation data length, we consider the cost of hashing a + balanced binary tree of this size (with a maximal size of + leaves since the hashing of internal nodes can be neglected. + + We also consider the largest tick known. At the time of writing + this comment, the largest tick is the origination tick of the + PVM. + + If we assume the following worst-case for origination tick: + - the origination has been done with a kernel of maximum size, and + - most of the computation cost is consumed by importing this kernel + in the PVM, + + We can simply consider, again, that the cost of hashing the imported + kernel dominates everything else. + + We multiply this number by 10 for extra safety. + + At the time of writing this comment, this leads to 372940 + mgas for the proof wellformedness verification and 372940 + mgas for the cost of executing a tick. + + *) + let open Saturation_repr in + (* model N_IBlake2b *) + (* Approximating 1.120804 x term *) + let cost_N_IBlake2b size = + let open Syntax in + let v0 = safe_int size in + safe_int 430 + v0 + (v0 lsr 3) + in + let overapproximated_hashing_size = + 2 * Constants_repr.max_operation_data_length + in + let scale10 x = Saturation_repr.(mul (safe_int 10) x) in + scale10 @@ Gas_limit_repr.atomic_step_cost + @@ cost_N_IBlake2b overapproximated_hashing_size + +let play kind dal_parameters ~dal_attestation_lag ~stakers metadata game + refutation = + let open Lwt_result_syntax in + let (Packed ((module PVM) as pvm)) = Sc_rollups.Kind.pvm_of kind in + let mk_loser loser = + let loser = Index.staker stakers loser in + Either.Left (Loser {loser; reason = Conflict_resolved}) + in + match (refutation.step, game.game_state) with + | Dissection states, Dissecting {dissection; default_number_of_sections} -> + let*? start_chunk, stop_chunk = + find_choice dissection refutation.choice + in + let*? () = + PVM.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + states + in + let new_game_state = + Dissecting {dissection = states; default_number_of_sections} + in + return + (Either.Right + { + turn = opponent game.turn; + inbox_snapshot = game.inbox_snapshot; + dal_snapshot = game.dal_snapshot; + start_level = game.start_level; + inbox_level = game.inbox_level; + game_state = new_game_state; + }) + | Dissection _, Final_move _ -> tzfail Dissecting_during_final_move + | Proof proof, Dissecting {dissection; default_number_of_sections = _} -> + let*? start_chunk, stop_chunk = + find_choice dissection refutation.choice + in + let*? pvm_step = + Sc_rollup_proof_repr.unserialize_pvm_step ~pvm proof.pvm_step + in + let proof = {proof with pvm_step} in + let*! player_result = + validity_first_final_move + ~pvm + ~dal_parameters + ~dal_attestation_lag + ~proof + ~metadata + ~game + ~start_chunk + ~stop_chunk + in + if player_result then return @@ mk_loser (opponent game.turn) + else + let new_game_state = + let agreed_start_chunk = start_chunk in + let refuted_stop_chunk = stop_chunk in + Final_move {agreed_start_chunk; refuted_stop_chunk} + in + return + (Either.Right + { + turn = opponent game.turn; + inbox_snapshot = game.inbox_snapshot; + dal_snapshot = game.dal_snapshot; + start_level = game.start_level; + inbox_level = game.inbox_level; + game_state = new_game_state; + }) + | Proof proof, Final_move {agreed_start_chunk; refuted_stop_chunk} -> + let*? pvm_step = + Sc_rollup_proof_repr.unserialize_pvm_step ~pvm proof.pvm_step + in + let proof = {proof with pvm_step} in + let*! player_result = + validity_second_final_move + ~pvm + ~dal_parameters + ~dal_attestation_lag + ~metadata + ~agreed_start_chunk + ~refuted_stop_chunk + ~game + ~proof + in + if player_result then + (* If we play when the final move started, the opponent provided + a invalid proof. So if the defender manages to provide a valid + proof, he wins. *) + return @@ mk_loser (opponent game.turn) + else return (Either.Left Draw) + +module Internal_for_tests = struct + let find_choice = find_choice + + let check_dissection ~default_number_of_sections ~start_chunk ~stop_chunk = + let open Sc_rollup_dissection_chunk_repr in + let dist = Sc_rollup_tick_repr.distance start_chunk.tick stop_chunk.tick in + let section_maximum_size = Z.div dist (Z.of_int 2) in + Sc_rollup_dissection_chunk_repr.( + default_check + ~section_maximum_size + ~check_sections_number:default_check_sections_number + ~default_number_of_sections + ~start_chunk + ~stop_chunk) +end + +type timeout = {alice : int; bob : int; last_turn_level : Raw_level_repr.t} + +let timeout_encoding = + let open Data_encoding in + conv + (fun {alice; bob; last_turn_level} -> (alice, bob, last_turn_level)) + (fun (alice, bob, last_turn_level) -> {alice; bob; last_turn_level}) + (obj3 + (req "alice" int31) + (req "bob" int31) + (req "last_turn_level" Raw_level_repr.encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.mli new file mode 100644 index 000000000000..ac183ecd7f58 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_game_repr.mli @@ -0,0 +1,430 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The smart contract rollup refutation game types are defined here, as + well as the basic pure logic for: + + - how to create a new game from a pair of commits in the commit tree; + + - how to update a game or complete a game when a move is played. + + This game logic is used by the protocol when two commitments are in + conflict to determine which one of the commitments is wrong. + + Game state and moves + ==================== + + The first step consists of dissecting the commitment's number of ticks. + The game stores a list [dissection] of state hashes and tick counts. + These are the claims about the PVM history made by the player who has + just moved. + + The next player to move will specify a tick count which appears in + the [dissection]; this is the last of the state hashes which she + agrees with. She will then either: + + - provide a new [dissection] by giving a list of state hashes and + tick counts that starts at the chosen tick count and ends at the + next tick count in the previous [dissection]. It must agree at the + start but disagree with the final state. + + - if the tick difference between this state and the next is one, + there is no 'room' for a new [dissection]. In this case she must + provide a Merkle proof that shows the step in the current + [dissection] is invalid. + + If a player failed to prove that the current [dissection] is valid. + We reach the final move of the game. The other player will have + a chance to prove that the [dissection] is valid. + If both player fails to invalidate each other, the game ends in a draw. + + Initializing a game + =================== + + In order to trigger the start of a game, one player must publish a + first move. + + The [initial] function is called at this point. It converts a + parent-child pair of commitments (belonging to the other player) into + an initial [dissection]. The first move is immediately applied to + this to give the first state of the game. + + Note: it is quite possible for the game to end immediately after + this first move, either if the commitment has a tick count of one or + more probably if the refutation proves that the commitment was + 'premature' (the state is not blocked---there are further + computation steps to do or more inbox messages to read). + + Expected properties + =================== + + P1 - If [dissection] is honest, the next move must be dishonest: + + There is only one honest state hash for a given tick count. The + next player must provide a different hash to the honest hash in + the [dissection]. + + P2 - If [dissection] is dishonest, there is a strategy for a player + equipped with a perfect PVM to play an honest next move: + + The player with a perfect PVM can calculate honest hashes until + one disagrees with the [dissection], and challenges the dissection + at that point, publishing either an honest [dissection] or an + honest [Proof]. + + Each [dissection] has a maximum tick count step shorter than the + last, so by induction using P1 and P2 we have + + P1' - If [dissection] is honest, the last player has a winning + strategy. + + P2' - If [dissection] is dishonest, the next player has a winning + strategy. + + This allows us to see the following. (We use [refuter] to mean the + first player to move, and [defender] to mean the other player.) + + Honest refuter wins: + An honest refuter will be refuting a dishonest commitment, because + there is only one honest state possible per level. Therefore the + initial [dissection] will be dishonest. By P2' the refuter has a + winning strategy. + + Honest defender wins: + An honest defender will have made an honest commitment which will + be translated into an honest initial [dissection]. By P1' the + defender has a winning strategy. + +*) + +open Sc_rollup_repr + +type error += + | Dissection_choice_not_found of Sc_rollup_tick_repr.t + (** The given choice in a refutation is not a starting tick of any of + the sections in the current dissection. *) + | Proof_unexpected_section_size of Z.t + (** Invalid proof step because there is more than one tick. *) + | Proof_start_state_hash_mismatch of { + start_state_hash : Sc_rollup_repr.State_hash.t option; + start_proof : Sc_rollup_repr.State_hash.t; + } + (** The given proof's starting state doesn't match the expected one. *) + | Proof_stop_state_hash_failed_to_refute of { + stop_state_hash : Sc_rollup_repr.State_hash.t option; + stop_proof : Sc_rollup_repr.State_hash.t option; + } + (** The given proof's ending state should not match the state being + refuted. *) + | Proof_stop_state_hash_failed_to_validate of { + stop_state_hash : Sc_rollup_repr.State_hash.t option; + stop_proof : Sc_rollup_repr.State_hash.t option; + } + (** The given proof's ending state should match the state being + refuted. *) + | Dissecting_during_final_move + (** The step move is a dissecting where the final move has started + already. *) + +(** The two stakers index the game in the storage as a pair of public + key hashes which is in lexical order. We use [Alice] and [Bob] to + represent the first and second player in the pair respectively. *) +type player = Alice | Bob + +module V1 : sig + type dissection_chunk = Sc_rollup_dissection_chunk_repr.t + + (** Describes the current state of a game. *) + type game_state = + | Dissecting of { + dissection : dissection_chunk list; + (** [dissection], a list of states with tick counts. The current + player will specify, in the next move, a tick count that + indicates the last of these states that she agrees with. *) + default_number_of_sections : int; + (** [default_number_of_sections] is the number of sections a + disection should contain in the more general case where we still + have a high enough number of disputed ticks. *) + } + (** When the state is [Dissecting], both player are still dissecting + the commitment to find the tick to refute. *) + | Final_move of { + agreed_start_chunk : dissection_chunk; + refuted_stop_chunk : dissection_chunk; + } + (** When the state is [Final_move], either [Alice] or [Bob] already + played an invalid proof. + + The other player will have a chance to prove that the + [refuted_stop_state] is valid. + If both players fail to either validate or refute the stop state, + the current game state describes a draw situation. + In the same way, the draw can be described by the situation where + the two players manage to validate or refute the stop state. *) + + val game_state_encoding : game_state Data_encoding.t + + val game_state_equal : game_state -> game_state -> bool + + (** A game is characterized by: + + - [turn], the player that must provide the next move. + + - [inbox_snapshot], a snapshot of the inbox state at the moment the + game is created. This is only used when checking [Input_step] and + [Blocked_step] proofs; it makes the proofs easier to create--- + otherwise they would have a 'moving target' because the actual + inbox may be updated continuously. + + - [dal_snapshot], a snapshot of the DAL's confirmed slots history at the + moment the game is created. In fact, since the confirmed slots history at + initialization would likely evolve during the game, we need a (fixed) + reference w.r.t. which Dal input proofs would be produced and verified if + needed. + + - [level], the inbox level of the commitment the game is refuting. + This is only used when checking [Blocked_step] proofs---the proof + will show that the next message available in [inbox_snapshot] is + at [level], so shouldn't be included in this commitment. + + - [game_state], the current state of the game, see {!game_state} + for more information. + + Invariants: + ----------- + - [dissection] must contain at least 2 values (normally it will be 32 + values, but smaller if there isn't enough space for a dissection + that size. The initial game dissection will be 3 values except in + the case of a zero-tick commit when it will have 2 values.) + - the first state hash value in [dissection] must not be [None] + - [inbox_snapshot] and [dal_snapshot] never change once the game is created + *) + type t = { + turn : player; + inbox_snapshot : Sc_rollup_inbox_repr.history_proof; + dal_snapshot : Dal_slot_repr.History.t; + start_level : Raw_level_repr.t; + inbox_level : Raw_level_repr.t; + game_state : game_state; + } + + (** [equal g1 g2] returns [true] iff [g1] is equal to [g2]. *) + val equal : t -> t -> bool + + (** Return the other player *) + val opponent : player -> player + + val encoding : t Data_encoding.t + + val pp_dissection : Format.formatter -> dissection_chunk list -> unit + + val player_equal : player -> player -> bool + + val player_encoding : player Data_encoding.t + + val pp : Format.formatter -> t -> unit +end + +(** Versioning, see {!Sc_rollup_data_version_sig.S} for more information. *) +include Sc_rollup_data_version_sig.S with type t = V1.t + +include + module type of V1 + with type dissection_chunk = V1.dissection_chunk + and type game_state = V1.game_state + and type t = V1.t + +module Index : sig + type t = private {alice : Staker.t; bob : Staker.t} + + (** [to_path i p] returns a new path with the path to the game indexed + by [i] added as a prefix to path [p]. See [Path_encoding] module. *) + val to_path : t -> string list -> string list + + val of_path : string list -> t option + + val path_length : int + + val rpc_arg : t RPC_arg.t + + val encoding : t Data_encoding.t + + val compare : t -> t -> int + + val make : Staker.t -> Staker.t -> t + + (** Given an index in normal form, resolve a given [player] ([Alice] + or [Bob]) to the actual staker they represent. *) + val staker : t -> player -> Staker.t +end + +(** To begin a game, first the conflict point in the commit tree is + found, and then this function is applied. + + [initial inbox dal_slots_history ~start_level ~parent ~child + ~refuter ~defender ~default_number_of_sections] will construct an + initial game where [refuter] is next to play. The game has + [dissection] with three states: + + - firstly, the state (with tick zero) of [parent], the commitment + that both stakers agree on. + + - secondly, the state and tick count of [child], the commitment + that [defender] has staked on. + + - thirdly, a [None] state which is a single tick after the [child] + commitment. This represents the claim, implicit in the commitment, + that the state given is blocked. + + This gives [refuter] a binary choice: she can refute the commit + itself by providing a new dissection between the two committed + states, or she can refute the claim that the [child] commit is a + blocked state by immediately providing a proof of a single tick + increment from that state to its successor. *) +val initial : + Sc_rollup_inbox_repr.history_proof -> + Dal_slot_repr.History.t -> + start_level:Raw_level_repr.t -> + parent:Sc_rollup_commitment_repr.t -> + child:Sc_rollup_commitment_repr.t -> + refuter:Staker.t -> + defender:Staker.t -> + default_number_of_sections:int -> + t + +(** A [step] in the game is either a new dissection (if there are + intermediate ticks remaining to put in it) or a proof. *) +type step = + | Dissection of dissection_chunk list + | Proof of Sc_rollup_proof_repr.serialized Sc_rollup_proof_repr.t + +(** A [refutation] is a move in the game. [choice] is the final tick + in the current dissection at which the two players agree. *) +type refutation = {choice : Sc_rollup_tick_repr.t; step : step} + +val pp_refutation : Format.formatter -> refutation -> unit + +val refutation_encoding : refutation Data_encoding.t + +(** A game ends for one of two reasons: the conflict has been +resolved via a proof or a player has been timed out. *) +type reason = Conflict_resolved | Timeout + +val pp_reason : Format.formatter -> reason -> unit + +val reason_encoding : reason Data_encoding.t + +(** The game result. *) +type game_result = + | Loser of {reason : reason; loser : Staker.t} (** One player lost. *) + | Draw (** The game ended in a draw *) + +val pp_game_result : Format.formatter -> game_result -> unit + +val game_result_encoding : game_result Data_encoding.t + +(** A type that represents the current game status in a way that is + useful to the outside world (using actual [Staker.t] values + instead of the internal [player] type). + + The [Staker.t] in the [Ended] case is the loser of the game: the + staker who will have their stake slashed. + + Used in operation result types. *) +type status = Ongoing | Ended of game_result + +val pp_status : Format.formatter -> status -> unit + +val status_encoding : status Data_encoding.t + +(** Decide the loser of the game, if it exists. *) +val loser_of_results : alice_result:bool -> bob_result:bool -> player option + +(* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + Providing DAL parameters here is not resilient to their change during + protocol upgrade. *) + +(** Applies the move [refutation] to the game. Returns the game {!status} + after applying the move. + + In the case of the game continuing, this swaps the current + player and returns a [Ongoing] status. Otherwise, it returns a + [Ended <game_result>] status. + + The provided DAL parameters and [dal_attestation_lag] are used in case the + game needs to check that a page's content is part of a slot (using the + slot's commitment). +*) +val play : + Sc_rollups.Kind.t -> + Dal_slot_repr.parameters -> + dal_attestation_lag:int -> + stakers:Index.t -> + Sc_rollup_metadata_repr.t -> + t -> + refutation -> + (game_result, t) Either.t tzresult Lwt.t + +(** [cost_play game refutation] returns the gas cost of [play] applied with [game] + and [refutation]. *) +val cost_play : t -> refutation -> Gas_limit_repr.cost + +(** A type that represents the number of blocks left for players to play. Each + player has her timeout value. `timeout` is expressed in the number of + blocks. + + Timeout logic is similar to a chess clock. Each player starts with the same + timeout. Each game move updates the timeout of the current player by + decreasing it by the amount of time she took to play, i.e. number of blocks + since the opponent last move. See {!Sc_rollup_refutation_storage.game_move} + to see the implementation. +*) +type timeout = { + alice : int; (** Timeout of [Alice]. *) + bob : int; (** Timeout of [Bob]. *) + last_turn_level : Raw_level_repr.t; (** Block level of the last turn move. *) +} + +val timeout_encoding : timeout Data_encoding.t + +module Internal_for_tests : sig + (** Checks that the tick count chosen by the current move is one of + the ones in the current dissection. Returns a tuple containing + the current dissection interval (including the two states) between + this tick and the next. *) + val find_choice : + dissection_chunk list -> + Sc_rollup_tick_repr.t -> + (dissection_chunk * dissection_chunk) tzresult + + (** See {!Sc_rollup_dissection_chunk_repr.default_check} *) + val check_dissection : + default_number_of_sections:int -> + start_chunk:dissection_chunk -> + stop_chunk:dissection_chunk -> + dissection_chunk list -> + unit tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml new file mode 100644 index 000000000000..1688125c11b6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml @@ -0,0 +1,248 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += (* `Permanent *) Merkelized_payload_hashes_proof_error of string + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"sc_rollup_inbox_message_repr.merkelized_payload_hashes_proof_error" + ~title: + "Internal error: error occurred during proof production or validation" + ~description:"A merkelized payload hashes proof error." + ~pp:(fun ppf e -> Format.fprintf ppf "Proof error: %s" e) + (obj1 (req "error" (string Plain))) + (function Merkelized_payload_hashes_proof_error e -> Some e | _ -> None) + (fun e -> Merkelized_payload_hashes_proof_error e) + +module Skip_list_parameters = struct + let basis = 2 +end + +module Skip_list = Skip_list_repr.Make (Skip_list_parameters) + +(* 32 *) +let hash_prefix = "\003\250\174\238\238" (* scib2(55) *) + +module Hash = struct + let prefix = "scib2" + + let encoded_size = 55 + + module H = + Blake2B.Make + (Base58) + (struct + let name = "merkelized_payload_hashes_hash" + + let title = + "The merkelized payload hashes' hash of the smart contract rollup \ + inbox" + + let b58check_prefix = hash_prefix + + (* defaults to 32 *) + let size = None + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size +end + +type t = (Sc_rollup_inbox_message_repr.Hash.t, Hash.t) Skip_list.cell + +let equal = Skip_list.equal Hash.equal Sc_rollup_inbox_message_repr.Hash.equal + +let hash merkelized = + let payload_hash = Skip_list.content merkelized in + let back_pointers_hashes = Skip_list.back_pointers merkelized in + Sc_rollup_inbox_message_repr.Hash.to_bytes payload_hash + :: List.map Hash.to_bytes back_pointers_hashes + |> Hash.hash_bytes + +let pp = + Skip_list.pp ~pp_content:Sc_rollup_inbox_message_repr.Hash.pp ~pp_ptr:Hash.pp + +let encoding = + Skip_list.encoding Hash.encoding Sc_rollup_inbox_message_repr.Hash.encoding + +type merkelized_and_payload = { + merkelized : t; + payload : Sc_rollup_inbox_message_repr.serialized; +} + +let equal_merkelized_and_payload {merkelized; payload} mp2 = + equal merkelized mp2.merkelized + && String.equal (payload :> string) (mp2.payload :> string) + +let pp_merkelized_and_payload fmt {merkelized; payload} = + Format.fprintf + fmt + "@[<hv 2>merkelized:@,%a@,payload: %a@]" + pp + merkelized + Format.pp_print_string + (payload :> string) + +let merkelized_and_payload_encoding = + let open Data_encoding in + conv + (fun {merkelized; payload} -> (merkelized, (payload :> string))) + (fun (merkelized, payload) -> + { + merkelized; + payload = Sc_rollup_inbox_message_repr.unsafe_of_string payload; + }) + (merge_objs encoding (obj1 (req "payload" (string Hex)))) + +module History = struct + include + Bounded_history_repr.Make + (struct + let name = "level_inbox_history" + end) + (Hash) + (struct + type nonrec t = merkelized_and_payload + + let pp = pp_merkelized_and_payload + + let equal = equal_merkelized_and_payload + + let encoding = merkelized_and_payload_encoding + end) + + let no_history = empty ~capacity:0L +end + +let remember history merkelized payload = + let prev_cell_ptr = hash merkelized in + History.remember prev_cell_ptr {merkelized; payload} history + +let genesis history payload = + let open Result_syntax in + let payload_hash = + Sc_rollup_inbox_message_repr.hash_serialized_message payload + in + let merkelized = Skip_list.genesis payload_hash in + let+ history = remember history merkelized payload in + (history, merkelized) + +let add_payload history prev_merkelized payload = + let open Result_syntax in + let prev_merkelized_ptr = hash prev_merkelized in + let merkelized = + Skip_list.next + ~prev_cell:prev_merkelized + ~prev_cell_ptr:prev_merkelized_ptr + (Sc_rollup_inbox_message_repr.hash_serialized_message payload) + in + let* history = remember history merkelized payload in + return (history, merkelized) + +let get_payload_hash = Skip_list.content + +let get_index = Skip_list.index + +type proof = t list + +let pp_proof = Format.pp_print_list pp + +let proof_encoding = Data_encoding.list encoding + +let produce_proof history ~index merkelized = + let open Option_syntax in + let deref ptr = + let* {merkelized; payload = _} = History.find ptr history in + return merkelized + in + let current_ptr = hash merkelized in + let lift_ptr = + let rec aux acc = function + | [] -> None + | [last_ptr] -> + let+ ({merkelized; _} as merkelized_and_payload) = + History.find last_ptr history + in + (merkelized_and_payload, List.rev (merkelized :: acc)) + | ptr :: rest -> + let* merkelized = deref ptr in + aux (merkelized :: acc) rest + in + aux [] + in + let* ptr_path = + Skip_list.back_path ~deref ~cell_ptr:current_ptr ~target_index:index + in + lift_ptr ptr_path + +let verify_proof inclusion_proof = + let open Result_syntax in + let* cell = + match inclusion_proof with + | cell :: _ -> ok cell + | [] -> + error (Merkelized_payload_hashes_proof_error "inclusion proof is empty") + in + let rec aux (hash_map, ptr_list) = function + | [] -> + error (Merkelized_payload_hashes_proof_error "inclusion proof is empty") + | [target] -> + let target_ptr = hash target in + let hash_map = Hash.Map.add target_ptr target hash_map in + let ptr_list = List.rev (target_ptr :: ptr_list) in + ok (hash_map, ptr_list, target, target_ptr) + | merkelized :: tail -> + let ptr = hash merkelized in + aux (Hash.Map.add ptr merkelized hash_map, ptr :: ptr_list) tail + in + let* hash_map, ptr_list, target, target_ptr = + aux (Hash.Map.empty, []) inclusion_proof + in + let deref ptr = Hash.Map.find ptr hash_map in + let cell_ptr = hash cell in + let* () = + error_unless + (Skip_list.valid_back_path + ~equal_ptr:Hash.equal + ~deref + ~cell_ptr + ~target_ptr + ptr_list) + (Merkelized_payload_hashes_proof_error "invalid inclusion proof") + in + return (target, cell) + +module Internal_for_tests = struct + let find_predecessor_payload payloads_history ~index payloads = + let open Option_syntax in + let deref ptr = + let* {merkelized; _} = History.find ptr payloads_history in + return merkelized + in + let cell_ptr = hash payloads in + Skip_list.find ~deref ~cell_ptr ~target_index:index +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.mli new file mode 100644 index 000000000000..22e5121a491b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.mli @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Merkelized_payload_hashes_proof_error of string + +module Hash : S.HASH + +(** A type representing the head of a merkelized list of + {!Sc_rollup_inbox_message_repr.serialized} message. It contains the hash of + the payload and the index on the list. *) +type t + +val encoding : t Data_encoding.t + +type merkelized_and_payload = { + merkelized : t; + payload : Sc_rollup_inbox_message_repr.serialized; +} + +(** A [History.t] is a lookup table of {!merkelized_and_payload}s. Payloads are + indexed by their hash {!Hash.t}. This history is needed in order to produce + {!proof}. + + A subtlety of this [history] type is that it is customizable depending on + how much of the inbox history you actually want to remember, using the + [capacity] parameter. In the L1 we use this with [capacity] set to zero, + which makes it immediately forget an old level as soon as we move to the + next. By contrast, the rollup node uses a history that is sufficiently large + to be able to take part in all potential refutation games occurring during + the challenge period. *) +module History : sig + include + Bounded_history_repr.S + with type key = Hash.t + and type value = merkelized_and_payload + + val no_history : t +end + +(** [hash merkelized] is the hash of [merkelized]. It is used as key to remember + a merkelized payload hash in an {!History.t}. *) +val hash : t -> Hash.t + +(** [remember history merkelized payload] remembers the [{merkelized; payload}] + in [history] with key [hash merkelized]. *) +val remember : + History.t -> + t -> + Sc_rollup_inbox_message_repr.serialized -> + History.t tzresult + +(** [genesis history payload] is the initial merkelized payload hashes with + index 0. It is remembered in [history] using [remember]. *) +val genesis : + History.t -> + Sc_rollup_inbox_message_repr.serialized -> + (History.t * t) tzresult + +(** [add_payload history merkelized payload] creates a new {!t} with [payload] + and [merkelized] as ancestor (i.e. [index = succ (get_index + merkelized)]). [merkelized] is remembered in [history] with [remember]. *) +val add_payload : + History.t -> + t -> + Sc_rollup_inbox_message_repr.serialized -> + (History.t * t) tzresult + +val equal : t -> t -> bool + +val pp : Format.formatter -> t -> unit + +(** [get_payload_hash merkelized] returns the + {!Sc_rollup_inbox_message_repr.serialized} payload's hash of + [merkelized]. *) +val get_payload_hash : t -> Sc_rollup_inbox_message_repr.Hash.t + +(** [get_index merkelized] returns the index of [merkelized]. *) +val get_index : t -> Z.t + +(** Given two t [(a, b)] and a {!Sc_rollup_inbox_message_repr.serialized} + [payload], a [proof] guarantees that [payload] hash is equal to [a] and that + [a] is an ancestor of [b]; i.e. [get_index a < get_index b]. *) +type proof + +val pp_proof : Format.formatter -> proof -> unit + +val proof_encoding : proof Data_encoding.t + +(** [produce_proof history ~index into_] returns a {!merkelized_and_payload} + with index [index] and a proof that it is an ancestor of [into_]. Returns + [None] if no merkelized payload with [index] is found (either in the + [history] or [index] is not inferior to [get_index into_]). *) +val produce_proof : + History.t -> index:Z.t -> t -> (merkelized_and_payload * proof) option + +(** [verify_proof proof] returns [(a, b)] where [proof] validates that [a] is an + ancestor of [b]. Fails when [proof] is not a valid inclusion proof. *) +val verify_proof : proof -> (t * t) tzresult + +module Internal_for_tests : sig + (** [find_predecessor_payload history ~index latest_merkelized] looks for the + {!t} with [index] that is an ancestor of [latest_merkelized]. *) + val find_predecessor_payload : History.t -> index:Z.t -> t -> t option +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.ml new file mode 100644 index 000000000000..b44d6a9a441d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.ml @@ -0,0 +1,199 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Permanent *) Error_encode_inbox_message + | (* `Permanent *) Error_decode_inbox_message + +let () = + let open Data_encoding in + let msg = + "Failed to encode a rollup management protocol inbox message value" + in + register_error_kind + `Permanent + ~id:"sc_rollup_inbox_message_repr.error_encoding_inbox_message" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Error_encode_inbox_message -> Some () | _ -> None) + (fun () -> Error_encode_inbox_message) ; + let msg = + "Failed to decode a rollup management protocol inbox message value" + in + register_error_kind + `Permanent + ~id:"sc_rollup_inbox_message_repr.error_decoding_inbox_message" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Error_decode_inbox_message -> Some () | _ -> None) + (fun () -> Error_decode_inbox_message) + +type internal_inbox_message = + | Transfer of { + payload : Script_repr.expr; + sender : Contract_hash.t; + source : Signature.public_key_hash; + destination : Sc_rollup_repr.Address.t; + } + | Start_of_level + | End_of_level + | Info_per_level of { + predecessor_timestamp : Time.t; + predecessor : Block_hash.t; + } + +let internal_inbox_message_encoding = + let open Data_encoding in + let kind name = req "internal_inbox_message_kind" (constant name) in + union + [ + case + (Tag 0) + ~title:"Transfer" + (obj5 + (kind "transfer") + (req "payload" Script_repr.expr_encoding) + (req "sender" Contract_hash.encoding) + (req "source" Signature.Public_key_hash.encoding) + (req "destination" Sc_rollup_repr.Address.encoding)) + (function + | Transfer {payload; sender; source; destination} -> + Some ((), payload, sender, source, destination) + | _ -> None) + (fun ((), payload, sender, source, destination) -> + Transfer {payload; sender; source; destination}); + case + (Tag 1) + ~title:"Start_of_level" + (obj1 (kind "start_of_level")) + (function Start_of_level -> Some () | _ -> None) + (fun () -> Start_of_level); + case + (Tag 2) + ~title:"End_of_level" + (obj1 (kind "end_of_level")) + (function End_of_level -> Some () | _ -> None) + (fun () -> End_of_level); + case + (Tag 3) + ~title:"Info_per_level" + (obj3 + (kind "info_per_level") + (req "predecessor_timestamp" Time.encoding) + (req "predecessor" Block_hash.encoding)) + (function + | Info_per_level {predecessor_timestamp; predecessor} -> + Some ((), predecessor_timestamp, predecessor) + | _ -> None) + (fun ((), predecessor_timestamp, predecessor) -> + Info_per_level {predecessor_timestamp; predecessor}); + ] + +type t = Internal of internal_inbox_message | External of string + +let encoding = + let open Data_encoding in + check_size + Constants_repr.sc_rollup_message_size_limit + (union + [ + case + (Tag 0) + ~title:"Internal" + internal_inbox_message_encoding + (function + | Internal internal_message -> Some internal_message + | External _ -> None) + (fun internal_message -> Internal internal_message); + case + (Tag 1) + ~title:"External" + Variable.(string Hex) + (function External msg -> Some msg | Internal _ -> None) + (fun msg -> External msg); + ]) + +type serialized = string + +let serialize msg = + let open Result_syntax in + match Data_encoding.Binary.to_string_opt encoding msg with + | None -> tzfail Error_encode_inbox_message + | Some str -> return str + +let deserialize s = + let open Result_syntax in + match Data_encoding.Binary.of_string_opt encoding s with + | None -> tzfail Error_decode_inbox_message + | Some msg -> return msg + +let unsafe_of_string s = s + +let unsafe_to_string s = s + +(* 32 *) +let hash_prefix = "\003\250\174\239\012" (* scib3(55) *) + +module Hash = struct + let prefix = "scib3" + + let encoded_size = 55 + + module H = + Blake2B.Make + (Base58) + (struct + let name = "serialized_message_hash" + + let title = + "The hash of a serialized message of the smart contract rollup inbox." + + let b58check_prefix = hash_prefix + + (* defaults to 32 *) + let size = None + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size +end + +let hash_serialized_message (payload : serialized) = + Hash.hash_string [(payload :> string)] + +let start_of_level_serialized = + (* If [Start_of_level] cannot be serialized, this will be detected at + compilation time as we are defining a top-level value. *) + Data_encoding.Binary.to_string_exn encoding (Internal Start_of_level) + +let end_of_level_serialized = + (* If [End_of_level] cannot be serialized, this will be detected at + compilation time as we are defining a top-level value. *) + Data_encoding.Binary.to_string_exn encoding (Internal End_of_level) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.mli new file mode 100644 index 000000000000..f4865b885d4d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_message_repr.mli @@ -0,0 +1,102 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module exposes a type {!t} that represents inbox messages. Inbox + messages are produced by the Layer 1 protocol and are encoded using the + {!serialize} function, before being added to a smart-contract rollup's inbox. + + They are part of the [Rollup Management Protocol] that defines the + communication protocol for exchanging messages between Layer 1 and Layer 2 + for a smart-contract rollup. + + There are two types of inbox messages: external and internal. + + Internal messages originate from Layer 1 smart-contract and consist of: + - [payload] the parameters passed to the smart-contract rollup. + - [sender] the Layer 1 contract caller. + - [source] the public key hash used for originating the transaction. + + External messages originate from the [Sc_rollup_add_messages] + manager-operation and consists of strings. The Layer 2 node is responsible + for decoding and interpreting these messages. + *) + +(** [internal_inbox_message] represent an internal message in a inbox (L1 -> + L2). This is not inline so it can easily be used by + {!Sc_rollup_costs.cost_serialize_internal_inbox_message}. *) +type internal_inbox_message = + | Transfer of { + payload : Script_repr.expr; + (** A Micheline value containing the parameters passed to the rollup. *) + sender : Contract_hash.t; + (** The contract hash of an Layer 1 originated contract sending a message + to the rollup. *) + source : Signature.public_key_hash; + (** The implicit account that originated the transaction. *) + destination : Sc_rollup_repr.Address.t; + (** The destination, as a rollup address, for the message. *) + } + | Start_of_level + (** Internal message put at the beginning of each inbox's level. *) + | End_of_level (** Internal message put at the end of each inbox's level. *) + | Info_per_level of { + predecessor_timestamp : Time.t; + (** Timestamp of the predecessor block where this message is + pushed. *) + predecessor : Block_hash.t; + (** Predecessor of the block this message is pushed. *) + } + +(** A type representing messages from Layer 1 to Layer 2. Internal ones are + originated from Layer 1 smart-contracts and external ones are messages from + an external manager operation. *) +type t = Internal of internal_inbox_message | External of string + +type serialized = private string + +(** Encoding for messages from Layer 1 to Layer 2 *) +val encoding : t Data_encoding.t + +(** [serialize msg] encodes the inbox message [msg] in binary format. *) +val serialize : t -> serialized tzresult + +(** [deserialize bs] decodes [bs] as an inbox_message [t]. *) +val deserialize : serialized -> t tzresult + +val unsafe_of_string : string -> serialized + +val unsafe_to_string : serialized -> string + +module Hash : S.HASH + +(** [hash_serialized_message payload] is the hash of [payload]. It is used by + {!Sc_rollup_inbox_merkelized_payload_hashes_repr.t}. *) +val hash_serialized_message : serialized -> Hash.t + +(** {!serialized} representation of [Internal [Start_of_level]]. *) +val start_of_level_serialized : serialized + +(** {!serialized} representation of [Internal [End_of_level]]. *) +val end_of_level_serialized : serialized diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.ml new file mode 100644 index 000000000000..c059fec69b0e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.ml @@ -0,0 +1,863 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + + A Merkelized inbox represents a list of messages. This list + is decomposed into sublists of messages, one for each Tezos level greater + than the level where SCORU is activated. + + This module is designed to: + + 1. provide a space-efficient representation for proofs of inbox + inclusions (only for inboxes obtained at the end of block + validation) ; + + 2. offer an efficient function to add a new batch of messages in the + inbox at the current level. + + To solve (1), we use a proof tree H which is implemented by a merkelized skip + list allowing for compact inclusion proofs (See {!skip_list_repr.ml}). + + To solve (2), we maintain a separate proof tree C witnessing the contents of + messages of the current level also implemented by a merkelized skip list for + the same reason. + + The protocol maintains the hashes of the head of H and C. + + The rollup node needs to maintain a full representation for C and a + partial representation for H back to the level of the LCC. + +*) +type error += Inbox_proof_error of string + +type error += Tried_to_add_zero_messages + +type error += Inbox_level_reached_messages_limit + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"sc_rollup_inbox.inbox_proof_error" + ~title: + "Internal error: error occurred during proof production or validation" + ~description:"An inbox proof error." + ~pp:(fun ppf e -> Format.fprintf ppf "Inbox proof error: %s" e) + (obj1 (req "error" (string Plain))) + (function Inbox_proof_error e -> Some e | _ -> None) + (fun e -> Inbox_proof_error e) ; + + register_error_kind + `Permanent + ~id:"sc_rollup_inbox.add_zero_messages" + ~title:"Internal error: trying to add zero messages" + ~description: + "Message adding functions must be called with a positive number of \ + messages" + ~pp:(fun ppf _ -> Format.fprintf ppf "Tried to add zero messages") + empty + (function Tried_to_add_zero_messages -> Some () | _ -> None) + (fun () -> Tried_to_add_zero_messages) ; + + let description = + Format.sprintf + "There can be only %s messages in an inbox level, the limit has been \ + reached." + (Z.to_string Constants_repr.sc_rollup_max_number_of_messages_per_level) + in + register_error_kind + `Permanent + ~id:"sc_rollup_inbox.inbox_level_reached_message_limit" + ~title:"Inbox level reached messages limit" + ~description + ~pp:(fun ppf _ -> Format.pp_print_string ppf description) + empty + (function Inbox_level_reached_messages_limit -> Some () | _ -> None) + (fun () -> Inbox_level_reached_messages_limit) + +module Int64_map = Map.Make (Int64) + +(* 32 *) +let hash_prefix = "\003\250\174\238\208" (* scib1(55) *) + +module Hash = struct + let prefix = "scib1" + + let encoded_size = 55 + + module H = + Blake2B.Make + (Base58) + (struct + let name = "inbox_hash" + + let title = "The hash of an inbox of a smart contract rollup" + + let b58check_prefix = hash_prefix + + (* defaults to 32 *) + let size = None + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size + + include Path_encoding.Make_hex (H) +end + +module Skip_list_parameters = struct + let basis = 2 +end + +module Skip_list = Skip_list_repr.Make (Skip_list_parameters) + +module V1 = struct + type level_proof = { + hash : Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t; + level : Raw_level_repr.t; + } + + let level_proof_encoding = + let open Data_encoding in + conv + (fun {hash; level} -> (hash, level)) + (fun (hash, level) -> {hash; level}) + (obj2 + (req + "hash" + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.encoding) + (req "level" Raw_level_repr.encoding)) + + let equal_level_proof {hash; level} level_proof_2 = + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.equal + hash + level_proof_2.hash + && Raw_level_repr.equal level level_proof_2.level + + type history_proof = (level_proof, Hash.t) Skip_list.cell + + let hash_history_proof cell = + let {hash; level} = Skip_list.content cell in + let back_pointers_hashes = Skip_list.back_pointers cell in + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.to_bytes hash + :: (Raw_level_repr.to_int32 level |> Int32.to_string |> Bytes.of_string) + :: List.map Hash.to_bytes back_pointers_hashes + |> Hash.hash_bytes + + let equal_history_proof = Skip_list.equal Hash.equal equal_level_proof + + let history_proof_encoding : history_proof Data_encoding.t = + Skip_list.encoding Hash.encoding level_proof_encoding + + let pp_level_proof fmt {hash; level} = + Format.fprintf + fmt + "hash: %a@,level: %a" + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.pp + hash + Raw_level_repr.pp + level + + let pp_history_proof fmt history_proof = + (Skip_list.pp ~pp_content:pp_level_proof ~pp_ptr:Hash.pp) fmt history_proof + + (** Construct an inbox [history] with a given [capacity]. If you + are running a rollup node, [capacity] needs to be large enough to + remember any levels for which you may need to produce proofs. *) + module History = + Bounded_history_repr.Make + (struct + let name = "inbox_history" + end) + (Hash) + (struct + type t = history_proof + + let pp = pp_history_proof + + let equal = equal_history_proof + + let encoding = history_proof_encoding + end) + + (* + + At a given level, an inbox is composed of metadata of type [t] and + [current_level], a [tree] representing the messages of the current level + (held by the [Raw_context.t] in the protocol). + + The metadata contains : + - [level] : the inbox level ; + - [current_level_proof] : the [current_level] and its root hash ; + - [old_levels_messages] : a witness of the inbox history. + + When new messages are appended to the current level inbox, the + metadata stored in the context may be related to an older level. + In that situation, an archival process is applied to the metadata. + This process saves the [current_level_proof] in the + [old_levels_messages] and empties [current_level]. It then + initializes a new level tree for the new messages---note that any + intermediate levels are simply skipped. See + {!Make_hashing_scheme.archive_if_needed} for details. + + *) + type t = { + level : Raw_level_repr.t; + current_level_proof : level_proof; + old_levels_messages : history_proof; + } + + let equal inbox1 inbox2 = + (* To be robust to addition of fields in [t]. *) + let {level; current_level_proof; old_levels_messages} = inbox1 in + Raw_level_repr.equal level inbox2.level + && equal_level_proof current_level_proof inbox2.current_level_proof + && equal_history_proof old_levels_messages inbox2.old_levels_messages + + let pp fmt {level; current_level_proof; old_levels_messages} = + Format.fprintf + fmt + "@[<hov 2>{ level = %a@;\ + current messages hash = %a@;\ + old_levels_messages = %a@;\ + }@]" + Raw_level_repr.pp + level + pp_level_proof + current_level_proof + pp_history_proof + old_levels_messages + + let inbox_level inbox = inbox.level + + let old_levels_messages inbox = inbox.old_levels_messages + + let current_level_proof inbox = inbox.current_level_proof + + let encoding = + Data_encoding.( + conv + (fun {level; current_level_proof; old_levels_messages} -> + (level, current_level_proof, old_levels_messages)) + (fun (level, current_level_proof, old_levels_messages) -> + {level; current_level_proof; old_levels_messages}) + (obj3 + (req "level" Raw_level_repr.encoding) + (req "current_level_proof" level_proof_encoding) + (req "old_levels_messages" history_proof_encoding))) +end + +type versioned = V1 of V1.t + +let versioned_encoding = + let open Data_encoding in + union + [ + case + ~title:"V1" + (Tag 0) + V1.encoding + (function V1 inbox -> Some inbox) + (fun inbox -> V1 inbox); + ] + +include V1 + +let of_versioned = function V1 inbox -> inbox [@@inline] + +let to_versioned inbox = V1 inbox [@@inline] + +type serialized_proof = string + +let serialized_proof_encoding = Data_encoding.(string Hex) + +type level_tree_proof = { + proof : Sc_rollup_inbox_merkelized_payload_hashes_repr.proof; + payload : Sc_rollup_inbox_message_repr.serialized option; +} + +let level_tree_proof_encoding = + let open Data_encoding in + conv + (fun {proof; payload} -> (proof, (payload :> string option))) + (fun (proof, payload) -> + { + proof; + payload = + Option.map Sc_rollup_inbox_message_repr.unsafe_of_string payload; + }) + (obj2 + (req + "proof" + Sc_rollup_inbox_merkelized_payload_hashes_repr.proof_encoding) + (opt "payload" (string Hex))) + +let add_protocol_internal_message payload payloads_history witness = + Sc_rollup_inbox_merkelized_payload_hashes_repr.add_payload + payloads_history + witness + payload + +let add_message payload payloads_history witness = + let open Result_syntax in + let message_counter = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_index witness + in + let* () = + let max_number_of_messages_per_level = + Constants_repr.sc_rollup_max_number_of_messages_per_level + in + error_unless + Compare.Z.(message_counter <= max_number_of_messages_per_level) + Inbox_level_reached_messages_limit + in + Sc_rollup_inbox_merkelized_payload_hashes_repr.add_payload + payloads_history + witness + payload + +(** [no_history] creates an empty history with [capacity] set to + zero---this makes the [remember] function a no-op. We want this + behaviour in the protocol because we don't want to store + previous levels of the inbox. *) +let no_history = History.empty ~capacity:0L + +let take_snapshot inbox = inbox.old_levels_messages + +(** [archive history inbox witness] archives the current inbox level depending + on the [history] parameter's [capacity]. Updates the + [inbox.current_level] and [inbox.old_levels_messages]. *) +let archive history inbox witness = + let open Result_syntax in + (* [form_history_proof history inbox] adds the current inbox level to the + history and creates new [inbox.old_levels_messages] including + the current level. *) + let form_history_proof history inbox = + let prev_cell = inbox.old_levels_messages in + let prev_cell_ptr = hash_history_proof prev_cell in + let* history = History.remember prev_cell_ptr prev_cell history in + let level_proof = current_level_proof inbox in + let cell = Skip_list.next ~prev_cell ~prev_cell_ptr level_proof in + return (history, cell) + in + let current_level_proof = + let hash = Sc_rollup_inbox_merkelized_payload_hashes_repr.hash witness in + {hash; level = inbox.level} + in + let inbox = {inbox with current_level_proof} in + let* history, old_levels_messages = form_history_proof history inbox in + let inbox = {inbox with old_levels_messages} in + return (history, inbox) + +let add_messages payloads_history payloads witness = + let open Result_syntax in + let* () = + error_when + (match payloads with [] -> true | _ -> false) + Tried_to_add_zero_messages + in + let* payloads_history, witness = + List.fold_left_e + (fun (payloads_history, witness) payload -> + add_message payload payloads_history witness) + (payloads_history, witness) + payloads + in + return (payloads_history, witness) + +let add_messages_no_history payloads witness = + let open Result_syntax in + let+ _, witness = + add_messages + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.no_history + payloads + witness + in + witness + +(* An [inclusion_proof] is a path in the Merkelized skip list + showing that a given inbox history is a prefix of another one. + This path has a size logarithmic in the difference between the + levels of the two inboxes. *) +type inclusion_proof = history_proof list + +let inclusion_proof_encoding = + let open Data_encoding in + list history_proof_encoding + +let pp_inclusion_proof fmt proof = + Format.pp_print_list pp_history_proof fmt proof + +let number_of_proof_steps proof = List.length proof + +(* See the main docstring for this type (in the mli file) for + definitions of the three proof parameters [starting_point], + [message] and [snapshot]. In the below we deconstruct + [starting_point] into [(l, n)] where [l] is a level and [n] is a + message index. + + In a proof, [inclusion_proof] is an inclusion proof of [history_proof] into + [snapshot] where [history_proof] is the skip list cell for the level [l], + and [message_proof] is a tree proof showing that + + [exists witness . + (hash_level_tree witness = history_proof.content.hash) + AND (get_messages_payload n witness = (_, message))] + + Note: in the case that [message] is [None] this shows that there's no + value at the index [n]; in this case we also must check that + [history_proof] equals [snapshot]. *) +type proof = { + inclusion_proof : inclusion_proof; + message_proof : level_tree_proof; +} + +let pp_proof fmt {inclusion_proof; message_proof = _} = + Format.fprintf + fmt + "inclusion proof: %a@" + (Format.pp_print_list pp_history_proof) + inclusion_proof + +let proof_encoding = + let open Data_encoding in + conv + (fun {inclusion_proof; message_proof} -> (inclusion_proof, message_proof)) + (fun (inclusion_proof, message_proof) -> {inclusion_proof; message_proof}) + (obj2 + (req "inclusion_proof" inclusion_proof_encoding) + (req "message_proof" level_tree_proof_encoding)) + +let of_serialized_proof = Data_encoding.Binary.of_string_opt proof_encoding + +let to_serialized_proof = Data_encoding.Binary.to_string_exn proof_encoding + +(** [verify_payloads_proof {proof; payload} head_cell_hash n label] handles + all the verification needed for a particular message proof at a particular + level. + + First it checks that [proof] is a valid inclusion of [payload_cell] in + [head_cell] and that [head_cell] hash is [head_cell_hash]. + + Then there is two cases, + + - either [n] is superior to the index of [head_cell] then the provided + [payload] must be empty (and [payload_cell = head_cell]); + + - or [0 < n < max_index head_cell] then the provided payload must exist and + the payload hash must equal the content of the [payload_cell]. +*) +let verify_payloads_proof {proof; payload} head_cell_hash n = + let open Result_syntax in + let* payload_cell, head_cell = + Sc_rollup_inbox_merkelized_payload_hashes_repr.verify_proof proof + in + (* Checks that [proof] is a valid inclusion of [payload_cell] in + [head_cell] and that [head_cell] hash is [head_cell_hash]. *) + let* () = + error_unless + (Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.equal + head_cell_hash + (Sc_rollup_inbox_merkelized_payload_hashes_repr.hash head_cell)) + (Inbox_proof_error (Format.sprintf "message_proof does not match history")) + in + let max_index = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_index head_cell + in + if Compare.Z.(n = Z.succ max_index) then + (* [n] is equal to the index of [head_cell] then the provided [payload] must + be init (,and [payload_cell = head_cell]) *) + let* () = + error_unless + (Option.is_none payload) + (Inbox_proof_error "Payload provided but none expected") + in + let* () = + error_unless + (Sc_rollup_inbox_merkelized_payload_hashes_repr.equal + payload_cell + head_cell) + (Inbox_proof_error "Provided proof is about a unexpected payload") + in + return_none + else if Compare.Z.(n <= max_index) then + (* [0 < n < max_index head_cell] then the provided [payload] must exists and + [payload_hash] must equal the content of the [payload_cell]. *) + let* payload = + match payload with + | Some payload -> return payload + | None -> + tzfail + (Inbox_proof_error + "Expected a payload but none provided in the proof") + in + let payload_hash = + Sc_rollup_inbox_message_repr.hash_serialized_message payload + in + let proven_payload_hash = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_payload_hash + payload_cell + in + let* () = + error_unless + (Sc_rollup_inbox_message_repr.Hash.equal + payload_hash + proven_payload_hash) + (Inbox_proof_error + "the payload provided does not match the payload's hash found in \ + the message proof") + in + let payload_index = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_index payload_cell + in + let* () = + error_unless + (Compare.Z.equal n payload_index) + (Inbox_proof_error + (Format.sprintf "found index in message_proof is incorrect")) + in + return_some payload + else + tzfail + (Inbox_proof_error + "Provided message counter is out of the valid range [0 -- (max_index \ + + 1)] ") + +(** [produce_payloads_proof get_paylooads_history head_cell_hash ~index] + + [get_paylooads_history cell_hash] is a function that returns an + {!Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t}. The returned + history must contains the cell with hash [cell_hash], all its ancestor cell + and their associated payload. + + [head_cell] the latest cell of the [witness] we want to produce a proof on + with hash [head_cell_hash]. + + This function produce either: + + - if [index <= head_cell_max_index], a proof that [payload_cell] with + [index] is an ancestor to [head_cell] where [head_cell] is the cell with + hash [head_cell_hash]. It returns the proof and the payload associated to + [payload_cell]; + + - else a proof that [index] is out of bound for [head_cell]. It returns the + proof and no payload. +*) +let produce_payloads_proof get_paylooads_history head_cell_hash ~index = + let open Lwt_result_syntax in + (* We first retrieve the history of cells for this level. *) + let*! payloads_history = get_paylooads_history head_cell_hash in + (* We then fetch the actual head cell in the history. *) + let*? head_cell = + match + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.find + head_cell_hash + payloads_history + with + | Some {merkelized = head_cell; payload = _} -> ok head_cell + | None -> + error + (Inbox_proof_error "could not find head_cell in the payloads_history") + in + let head_cell_max_index = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_index head_cell + in + (* if [index <= level_tree_max_index] then the index belongs to this level, we + prove its existence. Else the index is out of bounds, we prove its + non-existence. *) + let target_index = Compare.Z.(min index head_cell_max_index) in + (* We look for the cell at `target_index` starting from `head_cell`. If it + exists, we return the payload held in this cell. Otherwise, we prove that + [index] does not exist in this level. *) + let proof = + Sc_rollup_inbox_merkelized_payload_hashes_repr.produce_proof + payloads_history + head_cell + ~index:target_index + in + match proof with + | Some ({payload; merkelized = _}, proof) -> + if Compare.Z.(target_index = index) then + return {proof; payload = Some payload} + else return {proof; payload = None} + | None -> tzfail (Inbox_proof_error "could not produce a valid proof.") + +let verify_inclusion_proof inclusion_proof snapshot_history_proof = + let open Result_syntax in + let rec aux (hash_map, ptr_list) = function + | [] -> error (Inbox_proof_error "inclusion proof is empty") + | [target] -> + let target_ptr = hash_history_proof target in + let hash_map = Hash.Map.add target_ptr target hash_map in + let ptr_list = target_ptr :: ptr_list in + ok (hash_map, List.rev ptr_list, target, target_ptr) + | history_proof :: tail -> + let ptr = hash_history_proof history_proof in + aux (Hash.Map.add ptr history_proof hash_map, ptr :: ptr_list) tail + in + let* hash_map, ptr_list, target, target_ptr = + aux (Hash.Map.empty, []) inclusion_proof + in + let deref ptr = Hash.Map.find ptr hash_map in + let cell_ptr = hash_history_proof snapshot_history_proof in + let* () = + error_unless + (Skip_list.valid_back_path + ~equal_ptr:Hash.equal + ~deref + ~cell_ptr + ~target_ptr + ptr_list) + (Inbox_proof_error "invalid inclusion proof") + in + return target + +let produce_inclusion_proof deref inbox_snapshot l = + let open Lwt_result_syntax in + let compare {hash = _; level} = Raw_level_repr.compare level l in + let*! result = Skip_list.Lwt.search ~deref ~compare ~cell:inbox_snapshot in + match result with + | Skip_list.{rev_path; last_cell = Found history_proof} -> + return (List.rev rev_path, history_proof) + | {last_cell = Nearest _; _} + | {last_cell = No_exact_or_lower_ptr; _} + | {last_cell = Deref_returned_none; _} -> + (* We are only interested in the result where [search] returns a path to + the cell we were looking for. All the other cases should be + considered as an error. *) + tzfail + @@ Inbox_proof_error + (Format.asprintf + "Skip_list.search failed to find a valid path: %a" + (Skip_list.pp_search_result ~pp_cell:pp_history_proof) + result) + +let verify_proof (l, n) inbox_snapshot {inclusion_proof; message_proof} = + assert (Z.(geq n zero)) ; + let open Result_syntax in + let* history_proof = verify_inclusion_proof inclusion_proof inbox_snapshot in + let level_proof = Skip_list.content history_proof in + let* payload_opt = verify_payloads_proof message_proof level_proof.hash n in + match payload_opt with + | Some payload -> + return_some + Sc_rollup_PVM_sig.{inbox_level = l; message_counter = n; payload} + | None -> + if equal_history_proof inbox_snapshot history_proof then return_none + else + let* payload = + Sc_rollup_inbox_message_repr.(serialize (Internal Start_of_level)) + in + let inbox_level = Raw_level_repr.succ l in + let message_counter = Z.zero in + return_some Sc_rollup_PVM_sig.{inbox_level; message_counter; payload} + +let produce_proof ~get_payloads_history ~get_history inbox_snapshot (l, n) = + let open Lwt_result_syntax in + let* inclusion_proof, history_proof = + produce_inclusion_proof get_history inbox_snapshot l + in + let level_proof = Skip_list.content history_proof in + let* ({payload; proof = _} as message_proof) = + produce_payloads_proof get_payloads_history level_proof.hash ~index:n + in + let proof = {inclusion_proof; message_proof} in + let*? input = + let open Result_syntax in + match payload with + | Some payload -> + return_some + Sc_rollup_PVM_sig.{inbox_level = l; message_counter = n; payload} + | None -> + (* No payload means that there is no more message to read at the level of + [history_proof]. *) + if equal_history_proof inbox_snapshot history_proof then + (* if [history_proof] is equal to the snapshot then it means that there + is no more message to read. *) + return_none + else + (* Else we must read the [sol] of the next level. *) + let inbox_level = Raw_level_repr.succ l in + let message_counter = Z.zero in + let* payload = + Sc_rollup_inbox_message_repr.(serialize (Internal Start_of_level)) + in + return_some Sc_rollup_PVM_sig.{inbox_level; message_counter; payload} + in + return (proof, input) + +let init_witness payloads_history = + let open Result_syntax in + let sol = Sc_rollup_inbox_message_repr.start_of_level_serialized in + let* payloads_history, witness = + Sc_rollup_inbox_merkelized_payload_hashes_repr.genesis payloads_history sol + in + return (payloads_history, witness) + +let init_witness_no_history = + let no_payloads_history = + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.no_history + in + let res = init_witness no_payloads_history in + match res with + | Ok (_payloads_history, witness) -> witness + | Error _ -> + (* We extract the [witness] from the result monad so the caller does + not have to deal with the error case. This is a top-level declaration, + this will fail at compile-time. *) + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4359 + + Adding [SOL] without the history could remove the result monad here. *) + assert false + +let add_info_per_level ~predecessor_timestamp ~predecessor payloads_history + witness = + let open Result_syntax in + let* info_per_level = + Sc_rollup_inbox_message_repr.( + serialize (Internal (Info_per_level {predecessor_timestamp; predecessor}))) + in + add_protocol_internal_message info_per_level payloads_history witness + +let add_info_per_level_no_history ~predecessor_timestamp ~predecessor witness = + let open Result_syntax in + let no_payloads_history = + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.no_history + in + let* _payloads_history, witness = + add_info_per_level + ~predecessor_timestamp + ~predecessor + no_payloads_history + witness + in + return witness + +let finalize_inbox_level payloads_history history inbox witness = + let open Result_syntax in + let inbox = {inbox with level = Raw_level_repr.succ inbox.level} in + let eol = Sc_rollup_inbox_message_repr.end_of_level_serialized in + let* payloads_history, witness = + add_protocol_internal_message eol payloads_history witness + in + let* history, inbox = archive history inbox witness in + return (payloads_history, history, witness, inbox) + +let finalize_inbox_level_no_history inbox witness = + let open Result_syntax in + let* _payloads_history, _history, _witness, inbox = + finalize_inbox_level + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.no_history + no_history + inbox + witness + in + return inbox + +let add_all_messages ~predecessor_timestamp ~predecessor history inbox messages + = + let open Result_syntax in + let* payloads = List.map_e Sc_rollup_inbox_message_repr.serialize messages in + let payloads_history = + (* Must remember every [payloads] and internal messages pushed by the + protocol: SOL/Info_per_level/EOL. *) + let capacity = List.length payloads + 3 |> Int64.of_int in + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.empty ~capacity + in + (* Add [SOL] and [Info_per_level]. *) + let* payloads_history, witness = init_witness payloads_history in + let* payloads_history, witness = + add_info_per_level + ~predecessor_timestamp + ~predecessor + payloads_history + witness + in + + let* payloads_history, witness = + match payloads with + | [] -> return (payloads_history, witness) + | payloads -> add_messages payloads_history payloads witness + in + let* payloads_history, history, witness, inbox = + finalize_inbox_level payloads_history history inbox witness + in + + (* Wrap the messages so the caller can execute every actual messages + for this inbox. *) + let messages = + let open Sc_rollup_inbox_message_repr in + let sol = Internal Start_of_level in + let info_per_level = + Internal (Info_per_level {predecessor_timestamp; predecessor}) + in + let eol = Internal End_of_level in + [sol; info_per_level] @ messages @ [eol] + in + + return (payloads_history, history, inbox, witness, messages) + +let genesis ~predecessor_timestamp ~predecessor level = + let open Result_syntax in + let no_payloads_history = + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.no_history + in + (* 1. Add [SOL] and [Info_per_level]. *) + let witness = init_witness_no_history in + let* witness = + add_info_per_level_no_history ~predecessor_timestamp ~predecessor witness + in + + (* 2. Add [EOL]. *) + let eol = Sc_rollup_inbox_message_repr.end_of_level_serialized in + let* _payloads_history, witness = + add_protocol_internal_message eol no_payloads_history witness + in + + let level_proof = + let hash = Sc_rollup_inbox_merkelized_payload_hashes_repr.hash witness in + {hash; level} + in + + return + { + level; + current_level_proof = level_proof; + old_levels_messages = Skip_list.genesis level_proof; + } + +module Internal_for_tests = struct + let produce_inclusion_proof = produce_inclusion_proof + + let serialized_proof_of_string x = x + + let get_level_of_history_proof (history_proof : history_proof) = + let ({level; _} : level_proof) = Skip_list.content history_proof in + level +end + +type inbox = t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.mli new file mode 100644 index 000000000000..d4b7257c8a9f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_repr.mli @@ -0,0 +1,377 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Inbox_proof_error of string + +type error += Inbox_level_reached_messages_limit + +(** Merkelizing inbox for smart-contract rollups. + + {1 Overview} + + The inbox of a smart-contract rollup denotes the incoming messages + of the rollup. This inbox is the source of truth about what + operations are being published and have an effect on the rollup + state. As such, the inbox completely determines the state of the + rollup. Hence, if two claims disagree about the state of the + rollup, there are only two possibilities: either these two claims + correspond to two distinct interpretations of the same inbox ; or, + these two claims differ on their views about the contents of the + inbox itself. {!Sc_rollup_PVM_sig} is meant to arbitrate the first + kind of conflicts while {!Sc_rollup_inbox} focuses on the second + kind of conflicts. + + {1 Inbox messages} + + A message is a chunk of bytes. Messages are indexed using natural + numbers and the level they are introduced. + + A message is said to be *consumed* when its processing has been + cemented, that is, when no refutation about its insertion can + happen anymore because the commitment that describes the effect of + this message on the state is cemented. A message is said to be + *available* (for dispute) if it is not consumed. + + A message processed by the rollup can be consumed or available. A + message unprocessed by the rollup is always available. + + The number of messages in an inbox level is bounded by + {!Constants_repr.sc_rollup_max_number_of_messages_per_level} + When a level inbox reaches the maximum number of messages in the inbox level, + the inbox is said to be full and cannot accept more messages at this level. + This limitation is meant to ensure that Merkle proofs about the inbox + contents have a bounded size. (See next section.) + + {1 Merkelization of the inbox} + + As for the state of the {!Sc_rollup_PVM_sig}, the layer 1 does not + have to store the entire inbox but only a compressed form + (typically a low number of hashes) that witnesses its contents, so + that the protocol can check the validity of a proof about its contents. + This saves space in the context of the layer 1 and is sufficient for the + layer 1 to provide a source of truth about the contents of the + inbox at the current level. + + {1 A level-indexed chain of inboxes} + + By design, inboxes are logically indexed by Tezos levels. This is + required to have a simple way to decide if two commitments are in + conflict. (See {!Sc_rollup_storage}.) + + A commitment included in the block at level L describes the effect + of the messages of the inboxes with a level between a starting + level L_0 and a stopping level L_1, both strictly inferior to + L. The level L_0 must be the inbox level of its parent + commitment. + + To be valid, a commitment needs to prove that it is reading + messages from an inbox which is consistent with the inbox at level + L stored in the layer 1 context. So, it should be possible at any + time to build a proof that a given inbox is a previous version at + level L_1 of the inbox found at level L: these are called inclusion + proofs. + + {1 Clients} + + This module is meant to be used both by the protocol and by the + rollup node in order to maintain consistent inboxes on both sides. + These two clients slightly differ on the amount of information they + store about the inbox. + + On the one hand, to reduce the space consumption of rollups on the + chain storage, the protocol only stores metadata about the + inbox. The messages' hash of the current level are kept in memory during + block validation only (See {!Raw_context.Sc_rollup_in_memory_inbox}). + By contrast, the messages of the previous levels are not kept in + the context at all. They can be retrieved from the chain + history though. However, being absent from the context, they are + not accessible to the protocol. + + On the other hand, the rollup node must keep a more precise inbox + to be able to produce Merkle proofs about the content of specific + messages, at least during the refutation period. + + To cope with the discrepancy of requirements in terms of inbox + storage while preserving a consistent Merkelization + between the protocol and the rollup node, this module exposes the + functions used to merkelize the inbox with an history (See + {!History_bounded_repr.t}) as parameters to remember. + +*) + +module Hash : S.HASH + +module V1 : sig + (** The type of the inbox for a smart-contract rollup as stored + by the protocol in the context. Values that inhabit this type + only act as fingerprint for inboxes. *) + type t + + val pp : Format.formatter -> t -> unit + + val equal : t -> t -> bool + + val encoding : t Data_encoding.t + + (** [inbox_level inbox] returns the maximum level of message insertion in + [inbox] or its initial level. *) + val inbox_level : t -> Raw_level_repr.t + + (** A [level_proof] contains the root hash of the level tree and its + corresponding level. *) + type level_proof = private { + hash : Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t; + level : Raw_level_repr.t; + } + + (** A [history_proof] is a [Skip_list.cell] that stores multiple + hashes. [Skip_list.content history_proof] gives the hash of the + [level_proof] for this cell, while [Skip_list.back_pointers + history_proof] is an array of hashes of earlier [history_proof]s + in the inbox. + + On the one hand, we think of this type as representing the whole + Merkle structure of an inbox at a given level---it is the part of + {!t} above that can actually be used to prove things (it cannot be + forged by a malicious node because it much match the hash stored by + the L1). + + On the other hand, we think of this type as representing a single + proof-step back through the history of the inbox; given a hash that + appears at some point later in the inbox this type proves that that + hash points to this particular combination of a level tree and + further back-pointers. + + In terms of size, this type is a small set of hashes; one for the + current level tree and `O(log2(ix))` in the back-pointers, where + [ix] is the index of the cell in the skip list. That is, [ix] is the + number of non-empty levels between now and the origination level of + the rollup. + *) + type history_proof + + (** A [History.t] is basically a lookup table of {!history_proof}s. We + need this if we want to produce inbox proofs because it allows us + to dereference the 'pointer' hashes in any of the + [history_proof]s. This [deref] function is passed to + [Skip_list.back_path] or [Skip_list.search] to allow these + functions to construct valid paths back through the skip list. + + A subtlety of this [history] type is that it is customizable + depending on how much of the inbox history you actually want to + remember, using the [capacity] parameter. In the L1 we use this with + [capacity] set to zero, which makes it immediately forget an old + level as soon as we move to the next. By contrast, the rollup node + uses a history that is sufficiently large to be able to take part + in all potential refutation games occurring during the challenge + period. *) + module History : + Bounded_history_repr.S with type key = Hash.t and type value = history_proof + + val pp_history_proof : Format.formatter -> history_proof -> unit + + val history_proof_encoding : history_proof Data_encoding.t + + val equal_history_proof : history_proof -> history_proof -> bool + + (** [old_levels_messages inbox] returns the latest skip list cell of the inbox + history that is not up to change (i.e. not the current level tree). *) + val old_levels_messages : t -> history_proof +end + +(** Versioning, see {!Sc_rollup_data_version_sig.S} for more information. *) +include Sc_rollup_data_version_sig.S with type t = V1.t + +include module type of V1 with type t = V1.t + +(** This extracts the current {!level_proof} from the inbox. Note: the + current level hash is stored lazily as [fun () -> ...], and this + function will call that function. So don't use this if you want to + preserve the laziness. *) +val current_level_proof : t -> level_proof + +type serialized_proof + +val serialized_proof_encoding : serialized_proof Data_encoding.t + +(** [add_all_messages history inbox messages] starts a new inbox level, + adds all the [messages], then ends the inbox level. It can + be called even if [payloads] is empty. + + Remembers everything needed in a created [payloads_history] and [history]. + It is meant to be used by the rollup-node to reduce the risk of + de-synchronisation between the protocol and the node. + + Adds the messages pushed by the protocol and returns a list of messages + including them. The caller will need to execute this list of messages, + otherwise, it might miss some internal inputs. + *) +val add_all_messages : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + History.t -> + t -> + Sc_rollup_inbox_message_repr.t list -> + (Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t + * History.t + * t + * Sc_rollup_inbox_merkelized_payload_hashes_repr.t + * Sc_rollup_inbox_message_repr.t list) + tzresult + +(** [add_messages_no_history payloads witness] updates the [witness] by + inserting the [payloads]. *) +val add_messages_no_history : + Sc_rollup_inbox_message_repr.serialized list -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.t tzresult + +(** Used at the beginning of a refutation game to create the + snapshot against which proofs in that game must be valid. + + One important note: + It takes the snapshot of the inbox for the current level. The snapshot + points to the inbox at the *beginning* of the current block level. This + prevents to create a mid-level snapshot for a refutation game if new + messages are added before and/or after in the same block. *) +val take_snapshot : t -> history_proof + +(** Given a inbox [A] at some level [L] and another inbox [B] at some level [L' + >= L], an [inclusion_proof] guarantees that [A] is an older version of [B]. + + To be more precise, an [inclusion_proof] guarantees that the previous levels + [level_tree]s of [A] are included in the previous levels [level_tree]s of + [B]. The current [level_tree] of [A] and [B] are not considered. + + The size of this proof is O(log2 (L' - L)). *) +type inclusion_proof + +val inclusion_proof_encoding : inclusion_proof Data_encoding.t + +val pp_inclusion_proof : Format.formatter -> inclusion_proof -> unit + +(** [number_of_proof_steps proof] returns the length of [proof]. *) +val number_of_proof_steps : inclusion_proof -> int + +(** [verify_inclusion_proof proof snapshot] returns [A] iff [proof] is a minimal + and valid proof that [A] is included in [snapshot], fails otherwise. [A] is + part of the proof. *) +val verify_inclusion_proof : + inclusion_proof -> history_proof -> history_proof tzresult + +(** An inbox proof has three parameters: + + - the [starting_point], of type [Raw_level_repr.t * Z.t], specifying + a location in the inbox ; + + - the [message], of type [Sc_rollup_PVM_sig.input option] ; + + - and a reference [snapshot] inbox. + + A valid inbox proof implies the following semantics: beginning at + [starting_point] and reading forward through [snapshot], the first + message you reach will be [message]. + + Usually this is fairly simple because there will actually be a + message at the location specified by [starting_point]. But in some + cases [starting_point] is past the last message within a level, + and then the inbox proof's verification assumes that the next input + is the SOL of the next level, if not beyond the snapshot. +*) +type proof + +val pp_proof : Format.formatter -> proof -> unit + +val to_serialized_proof : proof -> serialized_proof + +val of_serialized_proof : serialized_proof -> proof option + +(** See the docstring for the [proof] type for details of proof semantics. + + [verify_proof starting_point inbox_snapshot proof] will return the third + parameter of the proof, [message], iff the proof is valid. *) +val verify_proof : + Raw_level_repr.t * Z.t -> + history_proof -> + proof -> + Sc_rollup_PVM_sig.inbox_message option tzresult + +(** [produce_proof ~get_payloads_history ~get_history inbox (level, counter)] + creates an inbox proof proving the first message after the index [counter] + at location [level]. This will fail if the [get_payloads_history] given + doesn't have sufficient data (it needs to be run on an with a full + history). *) +val produce_proof : + get_payloads_history: + (Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t Lwt.t) -> + get_history:(Hash.t -> history_proof option Lwt.t) -> + history_proof -> + Raw_level_repr.t * Z.t -> + (proof * Sc_rollup_PVM_sig.inbox_message option) tzresult Lwt.t + +(** [init_witness_no_history] initializes the witness for a new inbox level + by adding the first input, i.e. [Start_of_level]. *) +val init_witness_no_history : Sc_rollup_inbox_merkelized_payload_hashes_repr.t + +(** [add_info_per_level_no_history] adds the input [Info_per_level]. *) +val add_info_per_level_no_history : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.t tzresult + +(** [finalize_inbox_level payloads_history history inbox level_witness] updates + the current inbox's level witness by adding [EOL], and archives the current + level. *) +val finalize_inbox_level_no_history : + t -> Sc_rollup_inbox_merkelized_payload_hashes_repr.t -> t tzresult + +(** [genesis ~timestamp ~predecessor level] initializes the inbox at some + given [level] with: SOL, Info_per_level {timestamp; predecessor} and EOL + inside. *) +val genesis : + predecessor_timestamp:Time.t -> + predecessor:Block_hash.t -> + Raw_level_repr.t -> + t tzresult + +module Internal_for_tests : sig + (** [produce_inclusion_proof get_history a b] exploits [get_history] + to produce a self-contained proof that [a] is an older version of [b]. *) + val produce_inclusion_proof : + (Hash.t -> history_proof option Lwt.t) -> + history_proof -> + Raw_level_repr.t -> + (inclusion_proof * history_proof) tzresult Lwt.t + + (** Allows to create a dumb {!serialized_proof} from a string, instead of + serializing a proof with {!to_serialized_proof}. *) + val serialized_proof_of_string : string -> serialized_proof + + val get_level_of_history_proof : history_proof -> Raw_level_repr.t +end + +type inbox = t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.ml new file mode 100644 index 000000000000..a192729365f7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.ml @@ -0,0 +1,217 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Store = Storage.Sc_rollup + +let get_inbox ctxt = + let open Lwt_result_syntax in + let* inbox = Store.Inbox.get ctxt in + return (inbox, ctxt) + +let add_messages ctxt messages = + let open Lwt_result_syntax in + let open Raw_context in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3292 + + The carbonation needs to be activated again with the new internal inbox's + design, i.e. the skip list. + *) + let current_messages = Sc_rollup_in_memory_inbox.current_messages ctxt in + let messages_witness_index = + Sc_rollup_inbox_merkelized_payload_hashes_repr.get_index current_messages + in + let*? ctxt = + List.fold_left_i_e + (fun i ctxt (message : Sc_rollup_inbox_message_repr.serialized) -> + let msg_len = String.length (message :> string) in + let cost = + Sc_rollup_costs.cost_add_message + ~current_index:Z.(add messages_witness_index (of_int i)) + ~msg_len + in + Raw_context.consume_gas ctxt cost) + ctxt + messages + in + (* + Notice that the protocol is forgetful: it throws away the inbox + history. On the contrary, the history is stored by the rollup + node to produce inclusion proofs when needed. + *) + let*? current_messages = + Sc_rollup_inbox_repr.add_messages_no_history messages current_messages + in + let ctxt = + Sc_rollup_in_memory_inbox.set_current_messages ctxt current_messages + in + return ctxt + +let serialize_external_messages ctxt external_messages = + let open Sc_rollup_inbox_message_repr in + List.fold_left_map_e + (fun ctxt message -> + let open Result_syntax in + (* Pay gas for serializing an external message. *) + let* ctxt = + let bytes_len = String.length message in + Raw_context.consume_gas + ctxt + (Sc_rollup_costs.cost_serialize_external_inbox_message ~bytes_len) + in + let* serialized_message = serialize @@ External message in + return (ctxt, serialized_message)) + ctxt + external_messages + +let serialize_internal_message ctxt internal_message = + let open Result_syntax in + (* Pay gas for serializing an internal message. *) + let* ctxt = + Raw_context.consume_gas + ctxt + (Sc_rollup_costs.cost_serialize_internal_inbox_message internal_message) + in + let* message = + Sc_rollup_inbox_message_repr.(serialize @@ Internal internal_message) + in + return (message, ctxt) + +let add_external_messages ctxt external_messages = + let open Lwt_result_syntax in + let*? ctxt, messages = serialize_external_messages ctxt external_messages in + add_messages ctxt messages + +let add_internal_message ctxt internal_message = + let open Lwt_result_syntax in + let*? message, ctxt = serialize_internal_message ctxt internal_message in + add_messages ctxt [message] + +let add_deposit ctxt ~payload ~sender ~source ~destination = + let internal_message : Sc_rollup_inbox_message_repr.internal_inbox_message = + Transfer {destination; payload; sender; source} + in + add_internal_message ctxt internal_message + +let finalize_inbox_level ctxt = + let open Lwt_syntax in + let* res = + let open Lwt_result_syntax in + let* inbox, ctxt = get_inbox ctxt in + let witness = Raw_context.Sc_rollup_in_memory_inbox.current_messages ctxt in + let*? inbox = + Sc_rollup_inbox_repr.finalize_inbox_level_no_history inbox witness + in + let* ctxt = Store.Inbox.update ctxt inbox in + return ctxt + in + match res with + | Ok ctxt -> return ctxt + | Error err -> + (* As a protection, we backtrack the [ctxt] if finalizing the inbox level + failed. This way, we cannot make [finalize_block] fail. *) + Logging.( + log + Fatal + "Finalizing inbox level failed because of %a, the context is \ + backtracked. Smart rollups inbox failed to finalize this block, \ + this behavior is undefined and its consequence is unexplored." + pp_trace + err) ; + return ctxt + +let add_info_per_level ~predecessor ctxt = + let open Lwt_syntax in + let* res = + let open Lwt_result_syntax in + let predecessor_timestamp = Raw_context.predecessor_timestamp ctxt in + let witness = Raw_context.Sc_rollup_in_memory_inbox.current_messages ctxt in + let*? witness = + Sc_rollup_inbox_repr.add_info_per_level_no_history + ~predecessor_timestamp + ~predecessor + witness + in + let ctxt = + Raw_context.Sc_rollup_in_memory_inbox.set_current_messages ctxt witness + in + return ctxt + in + match res with + | Ok ctxt -> return ctxt + | Error err -> + (* As a protection, we backtrack the [ctxt] if adding the info per level + failed. This way, we cannot make [begin_application], + [begin_partial_application] and [begin_full_construction] fail. *) + Logging.( + log + Fatal + "Adding [Info_per_level] failed because of %a, the context is \ + backtracked. Smart rollups inbox failed to finalize this block, \ + this behavior is undefined and its consequence is unexplored." + pp_trace + err) ; + return ctxt + +let init_inbox ~predecessor ctxt = + let open Lwt_syntax in + let* res = + let open Lwt_result_syntax in + let ({level; _} : Level_repr.t) = Raw_context.current_level ctxt in + let predecessor_timestamp = Raw_context.predecessor_timestamp ctxt in + let*? inbox = + Sc_rollup_inbox_repr.genesis ~predecessor_timestamp ~predecessor level + in + let* ctxt = Store.Inbox.init ctxt inbox in + return ctxt + in + match res with + | Ok ctxt -> return ctxt + | Error err -> + (* As a protection, we backtrack the [ctxt] if initializing the inbox + failed. This way, we cannot make [prepare_first_block] fail. *) + Logging.( + log + Fatal + "Initializing inbox failed because of %a, the context is \ + backtracked. Smart rollups inbox failed, this behavior is undefined \ + and its consequence is unexplored." + pp_trace + err) ; + return ctxt + +module Internal_for_tests = struct + let add_start_of_level ctxt = + add_internal_message ctxt Sc_rollup_inbox_message_repr.Start_of_level + + let add_end_of_level ctxt = + add_internal_message ctxt Sc_rollup_inbox_message_repr.End_of_level + + let add_info_per_level ctxt predecessor_timestamp predecessor = + add_internal_message + ctxt + (Sc_rollup_inbox_message_repr.Info_per_level + {predecessor_timestamp; predecessor}) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.mli new file mode 100644 index 000000000000..f4421b79a81d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_inbox_storage.mli @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [get_inbox context] returns the current state of the inbox, + if it exists. *) +val get_inbox : + Raw_context.t -> (Sc_rollup_inbox_repr.t * Raw_context.t) tzresult Lwt.t + +(** [add_external_messages context messages] adds [messages] to the smart + rollups internal inbox level witness. *) +val add_external_messages : + Raw_context.t -> string list -> Raw_context.t tzresult Lwt.t + +(** [add_deposit ~payload ~sender ~source ~destination ctxt] adds the + internal deposit message of [payload], [sender], and [source] to + the smart-contract rollups' inbox. + + See [add_external_messages] for returned values and failures. +*) +val add_deposit : + Raw_context.t -> + payload:Script_repr.expr -> + sender:Contract_hash.t -> + source:Signature.public_key_hash -> + destination:Sc_rollup_repr.Address.t -> + Raw_context.t tzresult Lwt.t + +(** Initialize the inbox in the storage at protocol initialization. *) +val init_inbox : + predecessor:Block_hash.t -> Raw_context.t -> Raw_context.t Lwt.t + +(** Adds the [Info_per_level] in the in-memory inbox level witness. *) +val add_info_per_level : + predecessor:Block_hash.t -> Raw_context.t -> Raw_context.t Lwt.t + +(** [finalize_inbox_level ctxt] ends the internal representation for the block. +*) +val finalize_inbox_level : Raw_context.t -> Raw_context.t Lwt.t + +(**/**) + +module Internal_for_tests : sig + (** Push a [Start_of_level] internal inbox message in the inbox. *) + val add_start_of_level : Raw_context.t -> Raw_context.t tzresult Lwt.t + + (** Push a [End_of_level] internal inbox message in the inbox. *) + val add_end_of_level : Raw_context.t -> Raw_context.t tzresult Lwt.t + + (** Push a [Info_per_level] internal inbox message in the inbox. *) + val add_info_per_level : + Raw_context.t -> Time.t -> Block_hash.t -> Raw_context.t tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.ml new file mode 100644 index 000000000000..3ab96e8ee9c5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.ml @@ -0,0 +1,170 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += (* Permanent *) Sc_rollup_invalid_destination + +let () = + let open Data_encoding in + let msg = "Invalid destination" in + register_error_kind + `Permanent + ~id:"sc_rollup_management_protocol.sc_rollup_invalid_destination" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Sc_rollup_invalid_destination -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_destination) + +type transaction = + | Transaction : { + destination : Contract_hash.t; + entrypoint : Entrypoint.t; + parameters_ty : ('a, _) Script_typed_ir.ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> transaction + +type atomic_transaction_batch = {transactions : transaction list} + +type outbox_message = Atomic_transaction_batch of atomic_transaction_batch + +let make_internal_transfer ctxt ty ~payload ~sender ~source ~destination = + let open Lwt_result_syntax in + let+ payload, ctxt = + Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized + ty + payload + in + ( Sc_rollup.Inbox_message.Internal + (Transfer {payload; sender; source; destination}), + ctxt ) + +let transactions_batch_of_internal ctxt transactions = + let open Lwt_result_syntax in + let or_internal_transaction ctxt + {Sc_rollup.Outbox.Message.unparsed_parameters; destination; entrypoint} = + (* Lookup the contract-hash. *) + (* Load the type and entrypoints of the script. *) + let* ( Script_ir_translator.Ex_script (Script {arg_type; entrypoints; _}), + ctxt ) = + let* ctxt, _cache_key, cached = Script_cache.find ctxt destination in + match cached with + | Some (_script, ex_script) -> return (ex_script, ctxt) + | None -> tzfail Sc_rollup_invalid_destination + in + (* Find the entrypoint type for the given entrypoint. *) + let*? res, ctxt = + Gas_monad.run + ctxt + (Script_ir_translator.find_entrypoint + ~error_details:(Informative ()) + arg_type + entrypoints + entrypoint) + in + let*? (Ex_ty_cstr {ty = parameters_ty; _}) = res in + (* Parse the parameters according to the entrypoint type. *) + let* parameters, ctxt = + Script_ir_translator.parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + ~allow_forged:true + parameters_ty + (Micheline.root unparsed_parameters) + in + return + ( Transaction + { + destination; + entrypoint; + parameters_ty; + parameters; + unparsed_parameters; + }, + ctxt ) + in + let+ ctxt, transactions = + List.fold_left_map_es + (fun ctxt msg -> + let+ t, ctxt = or_internal_transaction ctxt msg in + (ctxt, t)) + ctxt + transactions + in + ({transactions}, ctxt) + +let outbox_message_of_outbox_message_repr ctxt + (Sc_rollup.Outbox.Message.Atomic_transaction_batch {transactions}) = + let open Lwt_result_syntax in + let+ ts, ctxt = transactions_batch_of_internal ctxt transactions in + (Atomic_transaction_batch ts, ctxt) + +module Internal_for_tests = struct + let make_transaction ctxt parameters_ty ~parameters ~destination ~entrypoint = + let open Lwt_result_syntax in + let* unparsed_parameters, ctxt = + Script_ir_translator.unparse_data ctxt Optimized parameters_ty parameters + in + return + ( Transaction + { + destination; + entrypoint; + parameters_ty; + parameters; + unparsed_parameters; + }, + ctxt ) + + let make_atomic_batch transactions = Atomic_transaction_batch {transactions} + + let serialize_outbox_message (Atomic_transaction_batch {transactions}) = + let open Result_syntax in + let to_internal_transaction + (Transaction + { + destination; + entrypoint; + parameters_ty = _; + parameters = _; + unparsed_parameters; + }) = + return + {Sc_rollup.Outbox.Message.unparsed_parameters; destination; entrypoint} + in + let* transactions = List.map_e to_internal_transaction transactions in + let output_message_internal = + Sc_rollup.Outbox.Message.Atomic_transaction_batch {transactions} + in + Sc_rollup.Outbox.Message.serialize output_message_internal + + let deserialize_inbox_message = Sc_rollup.Inbox_message.deserialize +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.mli new file mode 100644 index 000000000000..d84cb3dc9b85 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_management_protocol.mli @@ -0,0 +1,113 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides a typed API for the Rollup Management Protocol that + defines the communication protocol for exchanging messages between Layer 1 + and Layer 2 for smart-contract rollups. + + The API exposes functions for constructing inbox messages. These are + messages produced by the Layer 1 protocol and added to a smart-contract + rollups inbox. + + The Layer 2 node is responsible for decoding and interpreting the messages. + + A type {!outbox_message} representing messages from Layer 2 to Layer 1 + is also provided. An {!outbox_message} consists of a set of transactions + to L1 accounts. + *) + +open Alpha_context + +type error += (* Permanent *) Sc_rollup_invalid_destination + +(** A type representing a Layer 2 to Layer 1 transaction. *) +type transaction = private + | Transaction : { + destination : Contract_hash.t; + entrypoint : Entrypoint.t; + parameters_ty : ('a, _) Script_typed_ir.ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> transaction + +(** A type representing a batch of Layer 2 to Layer 1 transactions. *) +type atomic_transaction_batch = private {transactions : transaction list} + +(** A typed representation of {!Sc_rollup.Outbox.Message.t}. *) +type outbox_message = private + | Atomic_transaction_batch of atomic_transaction_batch + +(** [make_internal_transfer ctxt ty ~payload ~sender ~source ~destination] + constructs a smart rollup's [inbox message] (an L1 to L2 message) + with the given [payload], [sender], and [source] targeting [destination]. *) +val make_internal_transfer : + context -> + ('a, _) Script_typed_ir.ty -> + payload:'a -> + sender:Contract_hash.t -> + source:public_key_hash -> + destination:Sc_rollup.Address.t -> + (Sc_rollup.Inbox_message.t * context) tzresult Lwt.t + +(** [outbox_message_of_outbox_message_repr ctxt msg] returns a typed version of + of the given outbox message [msg]. + + Fails with an [Sc_rollup_invalid_destination] error in case the parameters + don't match the type of the entrypoint and destination. *) +val outbox_message_of_outbox_message_repr : + context -> + Sc_rollup.Outbox.Message.t -> + (outbox_message * context) tzresult Lwt.t + +(** Function for constructing and encoding {!inbox_message} and + {!outbox_message} values. Since Layer 1 only ever consumes {!outbox_message} + values and produces {!inbox_message} values, these functions are used for + testing only. *) +module Internal_for_tests : sig + (** [make_transaction ctxt ty ~parameters ~destination ~entrypoint] creates a + Layer 1 to Layer 2 transaction. *) + val make_transaction : + context -> + ('a, _) Script_typed_ir.ty -> + parameters:'a -> + destination:Contract_hash.t -> + entrypoint:Entrypoint.t -> + (transaction * context) tzresult Lwt.t + + (** [make_atomic_batch ts] creates an atomic batch with the given + transactions [ts]. *) + val make_atomic_batch : transaction list -> outbox_message + + (** [serialize_output_message msg] encodes the outbox message [msg] in binary + format. *) + val serialize_outbox_message : + outbox_message -> Sc_rollup.Outbox.Message.serialized tzresult + + (** [deserialize_inbox_message bs] decodes an inbox message from the given data + [bs]. *) + val deserialize_inbox_message : + Sc_rollup.Inbox_message.serialized -> Sc_rollup.Inbox_message.t tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.ml new file mode 100644 index 000000000000..5aea557a5959 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.ml @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3898 + We also need dynamic metadatas. *) + +type t = { + address : Sc_rollup_repr.Address.t; + origination_level : Raw_level_repr.t; +} + +let pp ppf {address; origination_level} = + Format.fprintf + ppf + "address: %a ; origination_level: %a" + Sc_rollup_repr.Address.pp + address + Raw_level_repr.pp + origination_level + +let equal {address; origination_level} metadata2 = + Sc_rollup_repr.Address.equal address metadata2.address + && Raw_level_repr.equal origination_level metadata2.origination_level + +let encoding = + let open Data_encoding in + conv + (fun {address; origination_level} -> (address, origination_level)) + (fun (address, origination_level) -> {address; origination_level}) + (obj2 + (req "address" Sc_rollup_repr.Address.encoding) + (req "origination_level" Raw_level_repr.encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.mli new file mode 100644 index 000000000000..c9b9ef648178 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_metadata_repr.mli @@ -0,0 +1,42 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Static rollup-related metadata for the PVMs. *) + +(** A metadata contains: *) +type t = { + address : Sc_rollup_repr.Address.t; (** The rollup address. *) + origination_level : Raw_level_repr.t; + (** The origination level of the rollup. *) +} + +(** Pretty-printer for metadatas *) +val pp : Format.formatter -> t -> unit + +(** Metadatas equality *) +val equal : t -> t -> bool + +(** Encoding for metadatas *) +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.ml new file mode 100644 index 000000000000..7640d77ced93 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.ml @@ -0,0 +1,548 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += + | (* Permanent *) Sc_rollup_invalid_parameters_type + | (* Permanent *) Sc_rollup_invalid_last_cemented_commitment + | (* Permanent *) Sc_rollup_invalid_output_proof + | (* Permanent *) Sc_rollup_invalid_outbox_level + +type execute_outbox_message_result = { + paid_storage_size_diff : Z.t; + ticket_receipt : Ticket_receipt.t; + operations : Script_typed_ir.packed_internal_operation list; +} + +let () = + let description = "Invalid parameters type for rollup" in + register_error_kind + `Permanent + ~id:"Sc_rollup_invalid_parameters_type" + ~title:"Invalid parameters type" + ~description + ~pp:(fun fmt () -> Format.fprintf fmt "%s" description) + Data_encoding.unit + (function Sc_rollup_invalid_parameters_type -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_parameters_type) ; + let description = "Invalid last-cemented-commitment" in + register_error_kind + `Permanent + ~id:"Sc_rollup_invalid_last_cemented_commitment" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function + | Sc_rollup_invalid_last_cemented_commitment -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_last_cemented_commitment) ; + let description = "Invalid output proof" in + register_error_kind + `Permanent + ~id:"Sc_rollup_invalid_output_proof" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_invalid_output_proof -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_output_proof) ; + let description = "Invalid outbox level" in + register_error_kind + `Permanent + ~id:"Sc_rollup_invalid_outbox_level" + ~title:description + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Sc_rollup_invalid_outbox_level -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_outbox_level) + +type origination_result = { + address : Sc_rollup.Address.t; + size : Z.t; + genesis_commitment_hash : Sc_rollup.Commitment.Hash.t; +} + +type 'ret continuation = unit -> 'ret tzresult + +(* Only a subset of types are supported for rollups. + This function checks whether or not a type can be used for a rollup. *) +let rec validate_ty : + type a ac ret. + (a, ac) Script_typed_ir.ty -> + a Script_typed_ir.entrypoints_node -> + ret continuation -> + ret tzresult = + fun ty {nested = nested_entrypoints; at_node} k -> + let open Script_typed_ir in + match at_node with + | Some {name = _; original_type_expr = _} -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4023 + We currently don't support entrypoints as the entrypoint information + for L1 to L2 messages is not propagated to the rollup. *) + error Sc_rollup_invalid_parameters_type + | None -> ( + match ty with + (* Valid primitive types. *) + | Unit_t -> (k [@ocaml.tailcall]) () + | Int_t -> (k [@ocaml.tailcall]) () + | Nat_t -> (k [@ocaml.tailcall]) () + | Signature_t -> (k [@ocaml.tailcall]) () + | String_t -> (k [@ocaml.tailcall]) () + | Bytes_t -> (k [@ocaml.tailcall]) () + | Key_hash_t -> (k [@ocaml.tailcall]) () + | Key_t -> (k [@ocaml.tailcall]) () + | Timestamp_t -> (k [@ocaml.tailcall]) () + | Address_t -> (k [@ocaml.tailcall]) () + | Bls12_381_g1_t -> (k [@ocaml.tailcall]) () + | Bls12_381_g2_t -> (k [@ocaml.tailcall]) () + | Bls12_381_fr_t -> (k [@ocaml.tailcall]) () + | Bool_t -> (k [@ocaml.tailcall]) () + | Never_t -> (k [@ocaml.tailcall]) () + | Tx_rollup_l2_address_t -> (k [@ocaml.tailcall]) () + | Chain_id_t -> (k [@ocaml.tailcall]) () + (* Valid collection types. *) + | Ticket_t (ty, _) -> (validate_ty [@ocaml.tailcall]) ty no_entrypoints k + | Set_t (ty, _) -> (validate_ty [@ocaml.tailcall]) ty no_entrypoints k + | Option_t (ty, _, _) -> + (validate_ty [@ocaml.tailcall]) ty no_entrypoints k + | List_t (ty, _) -> (validate_ty [@ocaml.tailcall]) ty no_entrypoints k + | Pair_t (ty1, ty2, _, _) -> + (* Entrypoints may not be nested in pairs, hence the no_entrypoints + value. *) + (validate_two_tys [@ocaml.tailcall]) + ty1 + ty2 + no_entrypoints + no_entrypoints + k + | Union_t (ty1, ty2, _, _) -> + let entrypoints_l, entrypoints_r = + match nested_entrypoints with + | Entrypoints_None -> (no_entrypoints, no_entrypoints) + | Entrypoints_Union {left; right} -> (left, right) + in + (validate_two_tys [@ocaml.tailcall]) + ty1 + ty2 + entrypoints_l + entrypoints_r + k + | Map_t (key_ty, val_ty, _) -> + (* Entrypoints may not be nested in maps, hence the no_entrypoints + value. *) + (validate_two_tys [@ocaml.tailcall]) + key_ty + val_ty + no_entrypoints + no_entrypoints + k + (* Invalid types. *) + | Mutez_t -> error Sc_rollup_invalid_parameters_type + | Big_map_t (_key_ty, _val_ty, _) -> + error Sc_rollup_invalid_parameters_type + | Contract_t _ -> error Sc_rollup_invalid_parameters_type + | Sapling_transaction_t _ -> error Sc_rollup_invalid_parameters_type + | Sapling_transaction_deprecated_t _ -> + error Sc_rollup_invalid_parameters_type + | Sapling_state_t _ -> error Sc_rollup_invalid_parameters_type + | Operation_t -> error Sc_rollup_invalid_parameters_type + | Chest_t -> error Sc_rollup_invalid_parameters_type + | Chest_key_t -> error Sc_rollup_invalid_parameters_type + | Lambda_t (_, _, _) -> error Sc_rollup_invalid_parameters_type) + +and validate_two_tys : + type a ac b bc ret. + (a, ac) Script_typed_ir.ty -> + (b, bc) Script_typed_ir.ty -> + a Script_typed_ir.entrypoints_node -> + b Script_typed_ir.entrypoints_node -> + ret continuation -> + ret tzresult = + fun ty1 ty2 entrypoints1 entrypoints2 k -> + (validate_ty [@ocaml.tailcall]) ty1 entrypoints1 (fun () -> + (validate_ty [@ocaml.tailcall]) ty2 entrypoints2 k) + +let validate_parameters_ty : + type a ac. + context -> + (a, ac) Script_typed_ir.ty -> + a Script_typed_ir.entrypoints_node -> + context tzresult = + fun ctxt parameters_ty entrypoints -> + let open Result_syntax in + let* ctxt = + Gas.consume + ctxt + (Sc_rollup_costs.is_valid_parameters_ty_cost + ~ty_size:Script_typed_ir.(ty_size parameters_ty |> Type_size.to_int)) + in + let+ () = validate_ty parameters_ty entrypoints ok in + ctxt + +let validate_untyped_parameters_ty ctxt parameters_ty = + let open Result_syntax in + (* Parse the type and check that the entrypoints are well-formed. Using + [parse_parameter_ty_and_entrypoints] restricts to [passable] types + (everything but operations), which is OK since [validate_ty] constraints + the type further. *) + let* ( Ex_parameter_ty_and_entrypoints + { + arg_type; + entrypoints = + {Script_typed_ir.root = entrypoint; original_type_expr = _}; + }, + ctxt ) = + Script_ir_translator.parse_parameter_ty_and_entrypoints + ctxt + ~legacy:false + (Micheline.root parameters_ty) + in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4023 + We currently don't support entrypoints as the entrypoint information + for L1 to L2 messages is not propagated to the rollup. *) + validate_parameters_ty ctxt arg_type entrypoint + +let check_origination_proof (type state proof output) + ~(pvm : (state, proof, output) Sc_rollup.PVM.implementation) boot_sector + origination_proof = + let open Lwt_result_syntax in + let (module PVM) = pvm in + let*! is_valid = PVM.verify_origination_proof origination_proof boot_sector in + let* () = + fail_when + (not is_valid) + (Sc_rollup_proof_repr.Sc_rollup_proof_check "invalid origination proof") + in + return PVM.(proof_stop_state origination_proof) + +let originate ctxt ~kind ~boot_sector ~origination_proof ~parameters_ty = + let open Lwt_result_syntax in + let (Packed ((module PVM) as pvm)) = Sc_rollup.Kind.pvm_of kind in + let*? ctxt = + let open Result_syntax in + let* parameters_ty, ctxt = + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + parameters_ty + in + validate_untyped_parameters_ty ctxt parameters_ty + in + let*? origination_proof = + Sc_rollup.Proof.unserialize_pvm_step ~pvm origination_proof + in + let* genesis_hash = + check_origination_proof ~pvm boot_sector origination_proof + in + let genesis_commitment = + Sc_rollup.Commitment.genesis_commitment + ~genesis_state_hash:genesis_hash + ~origination_level:(Level.current ctxt).level + in + let+ address, size, genesis_commitment_hash, ctxt = + Sc_rollup.originate ctxt ~kind ~parameters_ty ~genesis_commitment + in + ({address; size; genesis_commitment_hash}, ctxt) + +let to_transaction_operation ctxt ~source + (Sc_rollup_management_protocol.Transaction + {destination; entrypoint; parameters_ty; parameters; unparsed_parameters}) + = + let open Result_syntax in + let* ctxt, nonce = fresh_internal_nonce ctxt in + (* Validate the type of the parameters. Only types that can be transferred + from Layer 1 to Layer 2 are permitted. + + In principle, we could allow different types to be passed to the rollup and + from the rollup. In order to avoid confusion, and given that we don't + have any use case where they differ, we keep these sets identical. + + We don't check whether the type contains any entrypoints at this stage. + It has already been done during origination. + *) + let* ctxt = + validate_parameters_ty ctxt parameters_ty Script_typed_ir.no_entrypoints + in + let operation = + Script_typed_ir.Transaction_to_smart_contract + { + destination; + amount = Tez.zero; + entrypoint; + location = Micheline.dummy_location; + parameters_ty; + parameters; + unparsed_parameters; + } + in + return + ( Script_typed_ir.Internal_operation + {source = Contract.Implicit source; operation; nonce}, + ctxt ) + +(* Transfer some ticket-tokens from [source_destination] to [target_destination]. + This operation fails in case the [source_destination]'s balance is lower than + amount. *) +let transfer_ticket_token ctxt ~source_destination ~target_destination ~amount + ticket_token = + let open Lwt_result_syntax in + let* source_key_hash, ctxt = + Ticket_balance_key.of_ex_token ctxt ~owner:source_destination ticket_token + in + let* target_key_hash, ctxt = + Ticket_balance_key.of_ex_token ctxt ~owner:target_destination ticket_token + in + let* source_storage_diff, ctxt = + Ticket_balance.adjust_balance ctxt source_key_hash ~delta:(Z.neg amount) + in + let* target_storage_diff, ctxt = + Ticket_balance.adjust_balance ctxt target_key_hash ~delta:amount + in + (* Adjust the recorded paid-for storage space for the ticket-table. *) + let* storage_diff_to_pay, ctxt = + Ticket_balance.adjust_storage_space + ctxt + ~storage_diff:(Z.add source_storage_diff target_storage_diff) + in + return (storage_diff_to_pay, ctxt) + +let transfer_ticket_tokens ctxt ~source_destination ~acc_storage_diff + {Ticket_operations_diff.ticket_token; total_amount = _; destinations} = + let open Lwt_result_syntax in + List.fold_left_es + (fun (acc_storage_diff, ctxt) + (target_destination, (amount : Script_typed_ir.ticket_amount)) -> + let* storage_diff, ctxt = + transfer_ticket_token + ctxt + ~source_destination + ~target_destination + ~amount:Script_int.(to_zint (amount :> n num)) + ticket_token + in + return (Z.(add acc_storage_diff storage_diff), ctxt)) + (acc_storage_diff, ctxt) + destinations + +let validate_and_decode_output_proof ctxt ~cemented_commitment rollup + ~output_proof = + let open Lwt_result_syntax in + (* Lookup the PVM of the rollup. *) + let* ctxt, Packed (module PVM) = + let+ ctxt, kind = Sc_rollup.kind ctxt rollup in + (ctxt, Sc_rollup.Kind.pvm_of kind) + in + let output_proof_length = String.length output_proof in + let*? ctxt = + Gas.consume + ctxt + (Sc_rollup_costs.cost_deserialize_output_proof + ~bytes_len:output_proof_length) + in + let*? output_proof = + match + Data_encoding.Binary.of_string_opt PVM.output_proof_encoding output_proof + with + | Some x -> ok x + | None -> error Sc_rollup_invalid_output_proof + in + let output = PVM.output_of_output_proof output_proof in + (* Verify that the states match. *) + let* {Sc_rollup.Commitment.compressed_state; _}, ctxt = + Sc_rollup.Commitment.get_commitment ctxt rollup cemented_commitment + in + let* () = + let output_proof_state = PVM.state_of_output_proof output_proof in + fail_unless + Sc_rollup.State_hash.(output_proof_state = compressed_state) + Sc_rollup_invalid_output_proof + in + (* Consume cost of output proof verification. *) + let*? ctxt = + Gas.consume + ctxt + (Sc_rollup_costs.cost_verify_output_proof ~bytes_len:output_proof_length) + in + (* Verify that the proof is valid. *) + let* () = + let*! proof_is_valid = PVM.verify_output_proof output_proof in + fail_unless proof_is_valid Sc_rollup_invalid_output_proof + in + return (output, ctxt) + +let validate_outbox_level ctxt ~outbox_level ~lcc_level = + (* Check that outbox level is within the bounds of: + [min_level < outbox_level <= lcc_level] + Where + [min_level = lcc_level - max_active_levels] + + This prevents the rollup from putting messages at a level that is greater + than its corresponding inbox-level. It also prevents execution + of messages that are older than the maximum number of active levels. + *) + let max_active_levels = + Int32.to_int (Constants.sc_rollup_max_active_outbox_levels ctxt) + in + let outbox_level_is_active = + let min_allowed_level = + Int32.sub (Raw_level.to_int32 lcc_level) (Int32.of_int max_active_levels) + in + Compare.Int32.(min_allowed_level < Raw_level.to_int32 outbox_level) + in + fail_unless + (Raw_level.(outbox_level <= lcc_level) && outbox_level_is_active) + Sc_rollup_invalid_outbox_level + +let execute_outbox_message ctxt ~validate_and_decode_output_proof rollup + ~cemented_commitment ~source ~output_proof = + let open Lwt_result_syntax in + (* Get inbox level of last cemented commitment, needed to validate that the + outbox message is active. This call also implicitly checks that the rollup + exists. *) + let* lcc_hash, lcc_level, ctxt = + Sc_rollup.Commitment.last_cemented_commitment_hash_with_level ctxt rollup + in + (* Check that the commitment is a cemented commitment still stored in the + context. We start from the [lcc_hash] of the rollup, which we know to be + stored in context. *) + let* is_cemented_commitment_in_context, ctxt = + Sc_rollup.Commitment.check_if_commitments_are_related + ctxt + rollup + ~descendant:lcc_hash + ~ancestor:cemented_commitment + in + let* () = + fail_unless + is_cemented_commitment_in_context + Sc_rollup_invalid_last_cemented_commitment + in + (* Validate and decode the output proofs. *) + let* Sc_rollup.{outbox_level; message_index; message}, ctxt = + validate_and_decode_output_proof + ctxt + ~cemented_commitment + rollup + ~output_proof + in + (* Validate that the outbox level is within valid bounds. *) + let* () = validate_outbox_level ctxt ~outbox_level ~lcc_level in + let* ( Sc_rollup_management_protocol.Atomic_transaction_batch {transactions}, + ctxt ) = + Sc_rollup_management_protocol.outbox_message_of_outbox_message_repr + ctxt + message + in + (* Turn the transaction batch into a list of operations. *) + let*? ctxt, operations = + List.fold_left_map_e + (fun ctxt transaction -> + let open Result_syntax in + let+ op, ctxt = to_transaction_operation ctxt ~source transaction in + (ctxt, op)) + ctxt + transactions + in + (* Record that the message for the given level has been applied. This fails + in case a message for the rollup, outbox-level and message index has + already been executed. The storage diff returned may be negative. + *) + let* applied_msg_size_diff, ctxt = + Sc_rollup.Outbox.record_applied_message + ctxt + rollup + outbox_level + ~message_index:(Z.to_int message_index) + in + (* TODO: #3121 + Implement a more refined model. For instance a water-mark based one. + For now we only charge for positive contributions. It means that over time + we are overcharging for storage space. + *) + let paid_storage_size_diff = Z.max Z.zero applied_msg_size_diff in + (* Extract the ticket-token diffs from the operations. We here make sure that + there are no tickets with amount zero. Zero-amount tickets are not allowed + as they cannot be tracked by the ticket-balance table. + *) + let* ticket_token_diffs, ctxt = + Ticket_operations_diff.ticket_diffs_of_operations ctxt operations + in + (* Update the ticket-balance table by transferring ticket-tokens to new + destinations for each transaction. This fails in case the rollup does not + hold a sufficient amount of any of the ticket-tokens transferred. + + The updates must happen before any of the operations are executed to avoid + a case where ticket-transfers are funded as a result of prior operations + depositing new tickets to the rollup. + *) + let* paid_storage_size_diff, ctxt = + let source_destination = Destination.Sc_rollup rollup in + List.fold_left_es + (fun (acc_storage_diff, ctxt) ticket_token_diff -> + transfer_ticket_tokens + ctxt + ~source_destination + ~acc_storage_diff + ticket_token_diff) + (paid_storage_size_diff, ctxt) + ticket_token_diffs + in + let* ctxt, ticket_receipt = + List.fold_left_map_es + (fun ctxt + Ticket_operations_diff. + {ticket_token = ex_token; total_amount; destinations = _} -> + let+ ticket_token, ctxt = Ticket_token_unparser.unparse ctxt ex_token in + (* Here we only show the outgoing (negative) balance wrt to the rollup + address. The positive balances for the receiving contracts are + contained in the ticket updates for the internal operations. *) + let item = + Ticket_receipt. + { + ticket_token; + updates = + [ + { + account = Destination.Sc_rollup rollup; + amount = Z.neg (Script_int.to_zint total_amount); + }; + ]; + } + in + (ctxt, item)) + ctxt + ticket_token_diffs + in + return ({paid_storage_size_diff; ticket_receipt; operations}, ctxt) + +module Internal_for_tests = struct + let execute_outbox_message = execute_outbox_message +end + +let execute_outbox_message ctxt = + execute_outbox_message ctxt ~validate_and_decode_output_proof diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.mli new file mode 100644 index 000000000000..a9aff5536f42 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_operations.mli @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** High-level operations over smart contract rollups. *) +open Alpha_context + +type error += + | (* Permanent *) Sc_rollup_invalid_parameters_type + | (* Permanent *) Sc_rollup_invalid_last_cemented_commitment + | (* Permanent *) Sc_rollup_invalid_output_proof + | (* Permanent *) Sc_rollup_invalid_outbox_level + +(** Result of calling the {!execute_outbox_message} function. *) +type execute_outbox_message_result = { + paid_storage_size_diff : Z.t; + ticket_receipt : Ticket_receipt.t; + operations : Script_typed_ir.packed_internal_operation list; +} + +type origination_result = { + address : Sc_rollup.Address.t; + size : Z.t; + genesis_commitment_hash : Sc_rollup.Commitment.Hash.t; +} + +(** [originate context ~kind ~boot_sector ~origination_proof + ~parameters_ty] adds a new rollup running in a given [kind] + initialized with a [boot_sector] and to accept smart contract + calls of type [parameters_ty]. + + [origination_proof], which covers the specialization of the PVM + initial state with the [boot_sector], is used by the protocol to + compute the genesis commitment, after its correctness has been + checked. + + {b Note:} The need to provide an [origination_proof] is motivated + by technical limitations of Irmin (as of June, 2022), that + requires a context to get an empty tree. As soon as this + limitation is lifted, then we can drop the [origination_proof] + argument. + + Returns an error if [origination_proof] is invalid ({i e.g.}, it + does not target the expected PVM). +*) +val originate : + context -> + kind:Sc_rollup.Kind.t -> + boot_sector:string -> + origination_proof:Sc_rollup.Proof.serialized -> + parameters_ty:Script_repr.lazy_expr -> + (origination_result * context) tzresult Lwt.t + +(** [execute_outbox_message ctxt rollup ~cemented_commitment ~source + ~output_proof] validates the given outbox message and prepares a set of + resulting operations. *) +val execute_outbox_message : + context -> + Sc_rollup.t -> + cemented_commitment:Sc_rollup.Commitment.Hash.t -> + source:public_key_hash -> + output_proof:string -> + (execute_outbox_message_result * context) tzresult Lwt.t + +(** A module used for testing purposes only. *) +module Internal_for_tests : sig + (** Same as {!execute_outbox_message} but allows overriding the extraction + and validation of output proofs. *) + val execute_outbox_message : + context -> + validate_and_decode_output_proof: + (context -> + cemented_commitment:Sc_rollup.Commitment.Hash.t -> + Sc_rollup.t -> + output_proof:string -> + (Sc_rollup.output * context) tzresult Lwt.t) -> + Sc_rollup.t -> + cemented_commitment:Sc_rollup.Commitment.Hash.t -> + source:public_key_hash -> + output_proof:string -> + (execute_outbox_message_result * context) tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.ml new file mode 100644 index 000000000000..33292d5f51aa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.ml @@ -0,0 +1,133 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | (* `Permanent *) Error_encode_outbox_message + | (* `Permanent *) Error_decode_outbox_message + +let () = + let open Data_encoding in + let msg = + "Failed to encode a rollup management protocol outbox message value" + in + register_error_kind + `Permanent + ~id:"sc_rollup_outbox_message_repr.error_encoding_outbox_message" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Error_encode_outbox_message -> Some () | _ -> None) + (fun () -> Error_encode_outbox_message) ; + let msg = + "Failed to decode a rollup management protocol outbox message value" + in + register_error_kind + `Permanent + ~id:"sc_rollup_outbox_message_repr.error_decoding_outbox_message" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Error_decode_outbox_message -> Some () | _ -> None) + (fun () -> Error_decode_outbox_message) + +type transaction = { + unparsed_parameters : Script_repr.expr; (** The payload. *) + destination : Contract_hash.t; (** The recipient contract. *) + entrypoint : Entrypoint_repr.t; (** Entrypoint of the destination. *) +} + +type t = Atomic_transaction_batch of {transactions : transaction list} + +let transaction_encoding = + let open Data_encoding in + conv + (fun {unparsed_parameters; destination; entrypoint} -> + (unparsed_parameters, destination, entrypoint)) + (fun (unparsed_parameters, destination, entrypoint) -> + {unparsed_parameters; destination; entrypoint}) + @@ obj3 + (req "parameters" Script_repr.expr_encoding) + (req "destination" Contract_repr.originated_encoding) + Entrypoint_repr.(dft "entrypoint" simple_encoding default) + +let encoding = + let open Data_encoding in + (* We use a union encoding in order to guarantee backwards compatibility + when outbox messages are extended with more constructors. + + Each new constructor must be added with an increased tag number. + *) + check_size + Constants_repr.sc_rollup_message_size_limit + (union + [ + case + (Tag 0) + ~title:"Atomic_transaction_batch" + (obj1 (req "transactions" (list transaction_encoding))) + (fun (Atomic_transaction_batch {transactions}) -> Some transactions) + (fun transactions -> Atomic_transaction_batch {transactions}); + ]) + +let pp_transaction fmt {destination; entrypoint; unparsed_parameters} = + let json = + Data_encoding.Json.construct Script_repr.expr_encoding unparsed_parameters + in + Format.fprintf + fmt + "@[%a@;%a@;%a@]" + Contract_hash.pp + destination + Entrypoint_repr.pp + entrypoint + Data_encoding.Json.pp + json + +let pp fmt (Atomic_transaction_batch {transactions}) = + Format.pp_print_list + ~pp_sep:Format.pp_print_space + pp_transaction + fmt + transactions + +type serialized = string + +let deserialize data = + let open Result_syntax in + match Data_encoding.Binary.of_string_opt encoding data with + | Some x -> return x + | None -> tzfail Error_decode_outbox_message + +let serialize outbox_message = + let open Result_syntax in + match Data_encoding.Binary.to_string_opt encoding outbox_message with + | Some str -> return str + | None -> tzfail Error_encode_outbox_message + +let unsafe_of_string s = s + +let unsafe_to_string s = s diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.mli new file mode 100644 index 000000000000..4edae272da7e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_message_repr.mli @@ -0,0 +1,69 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines a data type {!t} that represents messages from Layer 2 + to Layer 1. + + They are part of the [Rollup Management Protocol] that defines the + communication protocol for exchanging messages between Layer 1 and Layer 2 + for smart-contract rollups. + + An outbox-message consists of a sequence of transactions to L1 + smart-contract accounts. All transactions contained in a message are + intended to be executed as a batch. + *) + +(** A transaction from L2 to L1. *) +type transaction = { + unparsed_parameters : Script_repr.expr; (** The payload. *) + destination : Contract_hash.t; (** The recipient contract. *) + entrypoint : Entrypoint_repr.t; (** Entrypoint of the destination. *) +} + +(** A type representing messages from Layer 2 to Layer 1. *) +type t = Atomic_transaction_batch of {transactions : transaction list} + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +type serialized = private string + +(** [deserialize ctxt bs] decodes an outbox message value from the + given data [bs]. The function involves parsing Micheline expressions to + typed values. *) +val deserialize : serialized -> t tzresult + +(** [serialize msg] serializes the given outbox message [msg]. *) +val serialize : t -> serialized tzresult + +(** [unsafe_of_string s] builds a serialized value out of a string. + You must understand the invariants of [serialized] to do so. *) +val unsafe_of_string : string -> serialized + +(** [unsafe_to_string s] builds a string out of a serialized value. + You must understand the invariants of [serialized] to manipulate + the resulting string. *) +val unsafe_to_string : serialized -> string diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.ml new file mode 100644 index 000000000000..6952ff828688 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.ml @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let level_index ctxt level = + let max_active_levels = + Constants_storage.sc_rollup_max_active_outbox_levels ctxt + in + Int32.rem (Raw_level_repr.to_int32 level) max_active_levels + +let record_applied_message ctxt rollup level ~message_index = + let open Lwt_result_syntax in + (* Check that the 0 <= message index < maximum number of outbox messages per + level. *) + let*? () = + let max_outbox_messages_per_level = + Constants_storage.sc_rollup_max_outbox_messages_per_level ctxt + in + error_unless + Compare.Int.( + 0 <= message_index && message_index < max_outbox_messages_per_level) + Sc_rollup_errors.Sc_rollup_invalid_outbox_message_index + in + let level_index = level_index ctxt level in + let* ctxt, level_and_bitset_opt = + Storage.Sc_rollup.Applied_outbox_messages.find (ctxt, rollup) level_index + in + let*? bitset, ctxt = + let open Result_syntax in + let* bitset, ctxt = + match level_and_bitset_opt with + | Some (existing_level, bitset) + when Raw_level_repr.(existing_level = level) -> + (* The level at the index is the same as requested. Fail if the + message has been applied already. *) + let* already_applied = Bitset.mem bitset message_index in + let* () = + error_when + already_applied + Sc_rollup_errors.Sc_rollup_outbox_message_already_applied + in + return (bitset, ctxt) + | Some (existing_level, _bitset) + when Raw_level_repr.(level < existing_level) -> + tzfail Sc_rollup_errors.Sc_rollup_outbox_level_expired + | Some _ | None -> + (* The old level is outdated or there is no previous bitset at + this index. *) + return (Bitset.empty, ctxt) + in + let* bitset = Bitset.add bitset message_index in + return (bitset, ctxt) + in + let+ ctxt, size_diff, _is_new = + Storage.Sc_rollup.Applied_outbox_messages.add + (ctxt, rollup) + level_index + (level, bitset) + in + (Z.of_int size_diff, ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.mli new file mode 100644 index 000000000000..1df195368aaa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_outbox_storage.mli @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A module for managing state concerning a rollup's outbox. *) + +(** [record_applied_message ctxt rollup level ~message_index] marks the message + in the outbox of rollup [rollup] at level [level] and position + [message_index] as processed. Returns the size diff resulting from adding an + entry. The size diff may be 0 if an entry already exists, or negative if an + index is replaced with a new level. + + An attempt to apply an old level that has already been replaced fails with + an [Sc_rollup_outbox_level_expired] error. + + In case a message has already been applied for the given level and message + index, the function fails with an [Sc_rollup_outbox_message_already_applied] + error. *) +val record_applied_message : + Raw_context.t -> + Sc_rollup_repr.t -> + Raw_level_repr.t -> + message_index:int -> + (Z.t * Raw_context.t) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.ml new file mode 100644 index 000000000000..bc74d5aa87e6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.ml @@ -0,0 +1,500 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Sc_rollup_proof_check of string + +type error += Sc_rollup_invalid_serialized_inbox_proof + +let () = + register_error_kind + `Permanent + ~id:"Sc_rollup_proof_check" + ~title:"Invalid proof" + ~description:"An invalid proof has been submitted" + ~pp:(fun fmt msg -> Format.fprintf fmt "Invalid proof: %s" msg) + Data_encoding.(obj1 @@ req "reason" (string Plain)) + (function Sc_rollup_proof_check msg -> Some msg | _ -> None) + (fun msg -> Sc_rollup_proof_check msg) ; + + register_error_kind + `Permanent + ~id:"Sc_rollup_invalid_serialized_inbox_proof" + ~title:"Invalid serialized inbox proof" + ~description:"The serialized inbox proof can not be de-serialized" + ~pp:(fun fmt () -> Format.fprintf fmt "Invalid serialized inbox proof") + Data_encoding.unit + (function Sc_rollup_invalid_serialized_inbox_proof -> Some () | _ -> None) + (fun () -> Sc_rollup_invalid_serialized_inbox_proof) + +type reveal_proof = + | Raw_data_proof of string + | Metadata_proof + | Dal_page_proof of { + page_id : Dal_slot_repr.Page.t; + proof : Dal_slot_repr.History.proof; + } + +let reveal_proof_encoding = + let open Data_encoding in + let case_raw_data = + case + ~title:"raw data proof" + (Tag 0) + (obj2 + (req "reveal_proof_kind" (constant "raw_data_proof")) + (req + "raw_data" + Bounded.( + string + ~length_kind:`Uint16 + Hex + Constants_repr.sc_rollup_message_size_limit))) + (function Raw_data_proof s -> Some ((), s) | _ -> None) + (fun ((), s) -> Raw_data_proof s) + and case_metadata_proof = + case + ~title:"metadata proof" + (Tag 1) + (obj1 (req "reveal_proof_kind" (constant "metadata_proof"))) + (function Metadata_proof -> Some () | _ -> None) + (fun () -> Metadata_proof) + in + let case_dal_page = + case + ~title:"dal page proof" + (Tag 2) + (obj3 + (req "reveal_proof_kind" (constant "dal_page_proof")) + (req "dal_page_id" Dal_slot_repr.Page.encoding) + (req "dal_proof" Dal_slot_repr.History.proof_encoding)) + (function + | Dal_page_proof {page_id; proof} -> Some ((), page_id, proof) + | _ -> None) + (fun ((), page_id, proof) -> Dal_page_proof {page_id; proof}) + in + union [case_raw_data; case_metadata_proof; case_dal_page] + +type input_proof = + | Inbox_proof of { + level : Raw_level_repr.t; + message_counter : Z.t; + proof : Sc_rollup_inbox_repr.serialized_proof; + } + | Reveal_proof of reveal_proof + | First_inbox_message + +let input_proof_encoding = + let open Data_encoding in + let proof_kind kind = req "input_proof_kind" (constant kind) in + let case_inbox_proof = + case + ~title:"inbox proof" + (Tag 0) + (obj4 + (proof_kind "inbox_proof") + (req "level" Raw_level_repr.encoding) + (req "message_counter" Data_encoding.n) + (req "serialized_proof" Sc_rollup_inbox_repr.serialized_proof_encoding)) + (function + | Inbox_proof {level; message_counter; proof} -> + Some ((), level, message_counter, proof) + | _ -> None) + (fun ((), level, message_counter, proof) -> + Inbox_proof {level; message_counter; proof}) + in + let case_reveal_proof = + case + ~title:"reveal proof" + (Tag 1) + (obj2 + (proof_kind "reveal_proof") + (req "reveal_proof" reveal_proof_encoding)) + (function Reveal_proof s -> Some ((), s) | _ -> None) + (fun ((), s) -> Reveal_proof s) + in + let first_input = + case + ~title:"first input" + (Tag 2) + (obj1 (proof_kind "first_input")) + (function First_inbox_message -> Some () | _ -> None) + (fun () -> First_inbox_message) + in + union [case_inbox_proof; case_reveal_proof; first_input] + +type 'proof t = {pvm_step : 'proof; input_proof : input_proof option} + +type serialized = string + +let serialize_pvm_step (type state proof output) + ~(pvm : (state, proof, output) Sc_rollups.PVM.implementation) + (proof : proof) : serialized tzresult = + let open Result_syntax in + let (module PVM) = pvm in + match Data_encoding.Binary.to_string_opt PVM.proof_encoding proof with + | Some p -> return p + | None -> error (Sc_rollup_proof_check "Cannot serialize proof") + +let unserialize_pvm_step (type state proof output) + ~(pvm : (state, proof, output) Sc_rollups.PVM.implementation) + (proof : string) : proof tzresult = + let open Result_syntax in + let (module PVM) = pvm in + match Data_encoding.Binary.of_string_opt PVM.proof_encoding proof with + | Some p -> return p + | None -> error (Sc_rollup_proof_check "Cannot unserialize proof") + +let serialized_encoding = Data_encoding.string Hex + +let encoding = + let open Data_encoding in + conv + (fun {pvm_step; input_proof} -> (pvm_step, input_proof)) + (fun (pvm_step, input_proof) -> {pvm_step; input_proof}) + (obj2 + (req "pvm_step" serialized_encoding) + (opt "input_proof" input_proof_encoding)) + +let pp ppf _ = Format.fprintf ppf "Refutation game proof" + +let start_of_pvm_step (type state proof output) + ~(pvm : (state, proof, output) Sc_rollups.PVM.implementation) + (proof : proof) = + let (module P) = pvm in + P.proof_start_state proof + +let stop_of_pvm_step (type state proof output) + ~(pvm : (state, proof, output) Sc_rollups.PVM.implementation) + (proof : proof) = + let (module P) = pvm in + P.proof_stop_state proof + +(* This takes an [input] and checks if it is above the given level, + and if it is at or below the origination level for this rollup. + It returns [None] if this is the case. + + We use this to check that the PVM proof is obeying [commit_inbox_level] + correctly---if the message obtained from the inbox proof is above + [commit_inbox_level] the [input_given] in the PVM proof should be [None]. *) +let cut_at_level ~origination_level ~commit_inbox_level + (input : Sc_rollup_PVM_sig.input) = + match input with + | Inbox_message {inbox_level = input_level; _} -> + if + Raw_level_repr.( + input_level <= origination_level || commit_inbox_level < input_level) + then None + else Some input + | Reveal _data -> Some input + +let proof_error reason = + let open Lwt_result_syntax in + tzfail (Sc_rollup_proof_check reason) + +let check p reason = + let open Lwt_result_syntax in + if p then return () else proof_error reason + +let check_inbox_proof snapshot serialized_inbox_proof (level, counter) = + match Sc_rollup_inbox_repr.of_serialized_proof serialized_inbox_proof with + | None -> error Sc_rollup_invalid_serialized_inbox_proof + | Some inbox_proof -> + Sc_rollup_inbox_repr.verify_proof (level, counter) snapshot inbox_proof + +module Dal_proofs = struct + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + The current DAL refutation integration is not resilient to DAL parameters + changes when upgrading the protocol. The code needs to be adapted. *) + (** Given a page, identified by its ID, we accept to produce or verify a + proof for it if, and only if, the page's level [page_published_level] + is in the following boundaries: + - page_published_level > origination_level: this means that the slot + of the page was published after the rollup origination ; + - page_published_level + dal_attestation_lag < commit_level: this + means that the slot of the page has been confirmed before the + [commit_level]. According to the definition in + {!Sc_rollup_commitment_repr}, [commit_level] (aka inbox_level + in that module) is the level (excluded) up to which the PVM consumed + all messages and DAL/DAC inputs before producing the related commitment. + *) + let page_level_is_valid ~dal_attestation_lag ~origination_level ~commit_level + page_id = + (* [dal_attestation_lag] is supposed to be positive. *) + let page_published_level = + Dal_slot_repr.(page_id.Page.slot_id.Header.published_level) + in + let open Raw_level_repr in + let not_too_old = page_published_level > origination_level in + let not_too_recent = + add page_published_level dal_attestation_lag < commit_level + in + not_too_old && not_too_recent + + let verify ~metadata ~dal_attestation_lag ~commit_level dal_parameters page_id + dal_snapshot proof = + let open Result_syntax in + if + page_level_is_valid + ~origination_level:metadata.Sc_rollup_metadata_repr.origination_level + ~dal_attestation_lag + ~commit_level + page_id + then + let* input = + Dal_slot_repr.History.verify_proof + dal_parameters + page_id + dal_snapshot + proof + in + return_some (Sc_rollup_PVM_sig.Reveal (Dal_page input)) + else return_none + + let produce ~metadata ~dal_attestation_lag ~commit_level dal_parameters + page_id ~page_info ~get_history confirmed_slots_history = + let open Lwt_result_syntax in + if + page_level_is_valid + ~origination_level:metadata.Sc_rollup_metadata_repr.origination_level + ~dal_attestation_lag + ~commit_level + page_id + then + let* proof, content_opt = + Dal_slot_repr.History.produce_proof + dal_parameters + page_id + ~page_info + ~get_history + confirmed_slots_history + in + return + ( Some (Reveal_proof (Dal_page_proof {proof; page_id})), + Some (Sc_rollup_PVM_sig.Reveal (Dal_page content_opt)) ) + else return (None, None) +end + +let valid (type state proof output) + ~(pvm : (state, proof, output) Sc_rollups.PVM.implementation) ~metadata + snapshot commit_inbox_level dal_snapshot dal_parameters ~dal_attestation_lag + (proof : proof t) = + let open Lwt_result_syntax in + let (module P) = pvm in + let origination_level = metadata.Sc_rollup_metadata_repr.origination_level in + let* input = + match proof.input_proof with + | None -> return_none + | Some (Inbox_proof {level; message_counter; proof}) -> + let*? inbox_message = + check_inbox_proof snapshot proof (level, Z.succ message_counter) + in + return + @@ Option.map (fun i -> Sc_rollup_PVM_sig.Inbox_message i) inbox_message + | Some First_inbox_message -> + let*? payload = + Sc_rollup_inbox_message_repr.(serialize (Internal Start_of_level)) + in + let inbox_level = Raw_level_repr.succ origination_level in + let message_counter = Z.zero in + return_some + Sc_rollup_PVM_sig.( + Inbox_message {inbox_level; message_counter; payload}) + | Some (Reveal_proof (Raw_data_proof data)) -> + return_some (Sc_rollup_PVM_sig.Reveal (Raw_data data)) + | Some (Reveal_proof Metadata_proof) -> + return_some (Sc_rollup_PVM_sig.Reveal (Metadata metadata)) + | Some (Reveal_proof (Dal_page_proof {proof; page_id})) -> + Dal_proofs.verify + ~metadata + dal_parameters + ~dal_attestation_lag + ~commit_level:commit_inbox_level + page_id + dal_snapshot + proof + |> Lwt.return + in + let input = + Option.bind input (cut_at_level ~origination_level ~commit_inbox_level) + in + let* input_requested = P.verify_proof input proof.pvm_step in + let* () = + match (proof.input_proof, input_requested) with + | None, No_input_required -> return_unit + | Some First_inbox_message, Initial -> + (* If the state is [Initial], we don't need a proof of the input, + we know it's the [Start_of_level] after the origination. *) + return_unit + | Some (Inbox_proof {level; message_counter; proof = _}), First_after (l, n) + -> + check + (Raw_level_repr.(level = l) && Z.(equal message_counter n)) + "Level and index of inbox proof are not equal to the one expected in \ + input request." + | ( Some (Reveal_proof (Raw_data_proof data)), + Needs_reveal (Reveal_raw_data expected_hash) ) -> + let scheme = Sc_rollup_reveal_hash.scheme_of_hash expected_hash in + + let data_hash = Sc_rollup_reveal_hash.hash_string ~scheme [data] in + check + (Sc_rollup_reveal_hash.equal data_hash expected_hash) + "Invalid reveal" + | Some (Reveal_proof Metadata_proof), Needs_reveal Reveal_metadata -> + return_unit + | ( Some (Reveal_proof (Dal_page_proof {page_id; proof = _})), + Needs_reveal (Request_dal_page pid) ) -> + check + (Dal_slot_repr.Page.equal page_id pid) + "Dal proof's page ID is not the one expected in input request." + | None, (Initial | First_after _ | Needs_reveal _) + | Some _, No_input_required + | Some (Inbox_proof _), Needs_reveal _ + | _ -> + proof_error "Inbox proof and input request are dissociated." + in + return (input, input_requested) + +module type PVM_with_context_and_state = sig + include Sc_rollups.PVM.S + + val context : context + + val state : state + + val proof_encoding : proof Data_encoding.t + + val reveal : Sc_rollup_reveal_hash.t -> string option Lwt.t + + module Inbox_with_history : sig + val inbox : Sc_rollup_inbox_repr.history_proof + + val get_history : + Sc_rollup_inbox_repr.Hash.t -> + Sc_rollup_inbox_repr.history_proof option Lwt.t + + val get_payloads_history : + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t Lwt.t + end + + module Dal_with_history : sig + val confirmed_slots_history : Dal_slot_repr.History.t + + val get_history : + Dal_slot_repr.History.hash -> Dal_slot_repr.History.t option Lwt.t + + val page_info : + (Dal_slot_repr.Page.content * Dal_slot_repr.Page.proof) option + + val dal_parameters : Dal_slot_repr.parameters + + val dal_attestation_lag : int + end +end + +let produce ~metadata pvm_and_state commit_inbox_level = + let open Lwt_result_syntax in + let (module P : PVM_with_context_and_state) = pvm_and_state in + let open P in + let*! (request : Sc_rollup_PVM_sig.input_request) = + P.is_input_state P.state + in + let origination_level = metadata.Sc_rollup_metadata_repr.origination_level in + let* input_proof, input_given = + match request with + | No_input_required -> return (None, None) + | Initial -> + (* The first input of a rollup is the [Start_of_level] after its + origination. *) + let* input = + let*? payload = + Sc_rollup_inbox_message_repr.(serialize (Internal Start_of_level)) + in + let inbox_level = Raw_level_repr.succ origination_level in + let message_counter = Z.zero in + return_some + Sc_rollup_PVM_sig.( + Inbox_message {inbox_level; message_counter; payload}) + in + let inbox_proof = First_inbox_message in + return (Some inbox_proof, input) + | First_after (level, message_counter) -> + let* inbox_proof, input = + Inbox_with_history.( + Sc_rollup_inbox_repr.produce_proof + ~get_payloads_history + ~get_history + inbox + (level, Z.succ message_counter)) + in + let input = + Option.map (fun msg -> Sc_rollup_PVM_sig.Inbox_message msg) input + in + let inbox_proof = + Inbox_proof + { + level; + message_counter; + proof = Sc_rollup_inbox_repr.to_serialized_proof inbox_proof; + } + in + return (Some inbox_proof, input) + | Needs_reveal (Reveal_raw_data h) -> ( + let*! res = reveal h in + match res with + | None -> proof_error "No reveal" + | Some data -> + return + ( Some (Reveal_proof (Raw_data_proof data)), + Some (Sc_rollup_PVM_sig.Reveal (Raw_data data)) )) + | Needs_reveal Reveal_metadata -> + return + ( Some (Reveal_proof Metadata_proof), + Some Sc_rollup_PVM_sig.(Reveal (Metadata metadata)) ) + | Needs_reveal (Request_dal_page page_id) -> + let open Dal_with_history in + Dal_proofs.produce + ~metadata + dal_parameters + ~dal_attestation_lag + ~commit_level:commit_inbox_level + page_id + ~page_info + ~get_history + confirmed_slots_history + in + let input_given = + Option.bind + input_given + (cut_at_level ~origination_level ~commit_inbox_level) + in + let* pvm_step_proof = P.produce_proof P.context input_given P.state in + let*? pvm_step = serialize_pvm_step ~pvm:(module P) pvm_step_proof in + return {pvm_step; input_proof} + +module Internal_for_tests = struct + let cut_at_level = cut_at_level +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.mli new file mode 100644 index 000000000000..799d94ba9346 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_proof_repr.mli @@ -0,0 +1,267 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A refutation game proof is required as part of the final move in a + game. + + This proof is basically a combination of a PVM proof (provided by + each implementation of the PVM signature) and an input proof. To + check the proof we must check each part separately and then also + check that they match on the two points where they touch: + + - the [input_requested] of the PVM proof should match the starting + point of the input proof ; + + - the [input_given] of the PVM proof should match the output + message of the input proof. + + It is also often the case that the PVM proof has [No_input_required] + for its [input_requested] and [None] for its [input_given]. If this + is the case, we don't need the input proof at all and the [input_proof] + parameter in our proof should be [None]. *) + +(** The proof that a reveal is valid. *) +type reveal_proof = + | Raw_data_proof of string + (** The existence of reveal for a given hash when the + [input_requested] is the [Needs_reveal Reveal_raw_data]. *) + | Metadata_proof + | Dal_page_proof of { + page_id : Dal_slot_repr.Page.t; + proof : Dal_slot_repr.History.proof; + } + (** The existence or not of a confirmed slot for a given page ID when the + [input_requested] is the [Needs_reveal Request_dal_page]. *) + +(** A PVM proof [pvm_step] is combined with an [input_proof] to provide + the proof necessary to validate a single step in the refutation + game. + + If the step doesn't involve any input, [proof_input_requested + pvm_step] and [proof_input_given pvm_step] will be + [No_input_required] and [None] respectively, and in this case + [inbox] should also be [None]. + + In the case that input is involved, [input_proof] is either: + + - a proof of the next inbox message available from the inbox + after a given location; this must match up with [pvm_step] + to give a valid refutation proof ; or + + - a proof of a reveal satisfiability. + + - a claim that the input involved is the first input of the inbox, which + does not need to be proved as we know by construction what is + the input (i.e. the [Start_of_level] of the level after the rollup's + origination level). +*) + +type input_proof = + | Inbox_proof of { + level : Raw_level_repr.t; + message_counter : Z.t; + proof : Sc_rollup_inbox_repr.serialized_proof; + } + | Reveal_proof of reveal_proof + | First_inbox_message + +type 'proof t = {pvm_step : 'proof; input_proof : input_proof option} + +type serialized = private string + +(** [serialize_pvm_step ~pvm proof] turns a structured representation + of a step proof of [pvm] into its serialized representation. *) +val serialize_pvm_step : + pvm:('state, 'proof, 'output) Sc_rollups.PVM.implementation -> + 'proof -> + serialized tzresult + +(** [unserialize_pvm_step ~pvm proof] turns a serialized + representation of a step proof of [pvm] into its structured + representation. *) +val unserialize_pvm_step : + pvm:('state, 'proof, 'output) Sc_rollups.PVM.implementation -> + serialized -> + 'proof tzresult + +type error += Sc_rollup_proof_check of string + +type error += Sc_rollup_invalid_serialized_inbox_proof + +val serialized_encoding : serialized Data_encoding.t + +val encoding : serialized t Data_encoding.t + +val pp : Format.formatter -> 'a t -> unit + +(** The state hash of the machine before the step. This must be checked + against the value in the refutation game as well as checking the + proof is valid. *) +val start_of_pvm_step : + pvm:('state, 'proof, 'output) Sc_rollups.PVM.implementation -> + 'proof -> + Sc_rollup_repr.State_hash.t + +(** The state hash of the machine after the step. This must be checked + against the value in the refutation game as well as checking the + proof is valid. *) +val stop_of_pvm_step : + pvm:('state, 'proof, 'output) Sc_rollups.PVM.implementation -> + 'proof -> + Sc_rollup_repr.State_hash.t + +(** Check the validity of a proof. + + This function requires a few bits of data (available from the + refutation game record in the storage): + + - a snapshot of the inbox, that may be used by the [input] proof in case + it's an inbox message ; + + - a snapshot of the DAL confirmed slots structure, that may be used by + the [input] proof in case the input is a DAL page ; + + - the inbox level of the commitment, used to determine if an + output from the [input] proof is too recent to be allowed into + the PVM proof ; + + - DAL parameters and [dal_attestation_lag], to be able to check the page + content membership to a slot if needed ; + + - the [pvm_name], used to check that the proof given has the right + PVM kind. + + It also returns the optional input executed during the proof and the + input_request for the state at the beginning of the proof. +*) +val valid : + pvm:('state, 'proof, 'output) Sc_rollups.PVM.implementation -> + metadata:Sc_rollup_metadata_repr.t -> + Sc_rollup_inbox_repr.history_proof -> + Raw_level_repr.t -> + Dal_slot_repr.History.t -> + Dal_slot_repr.parameters -> + dal_attestation_lag:int -> + 'proof t -> + (Sc_rollup_PVM_sig.input option * Sc_rollup_PVM_sig.input_request) tzresult + Lwt.t + +module type PVM_with_context_and_state = sig + include Sc_rollups.PVM.S + + val context : context + + val state : state + + val proof_encoding : proof Data_encoding.t + + val reveal : Sc_rollup_reveal_hash.t -> string option Lwt.t + + module Inbox_with_history : sig + val inbox : Sc_rollup_inbox_repr.history_proof + + val get_history : + Sc_rollup_inbox_repr.Hash.t -> + Sc_rollup_inbox_repr.history_proof option Lwt.t + + val get_payloads_history : + Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t -> + Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t Lwt.t + end + + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3997 + This interface might not be resilient to dal parameters changes + (cryptobox parameters or dal_attestation_lag for instance). *) + module Dal_with_history : sig + (** The reference/snapshot cell of the DAL skip list that stores + confirmed slots. *) + val confirmed_slots_history : Dal_slot_repr.History.t + + (** A function to retrieve a history from an underlying cache. *) + val get_history : + Dal_slot_repr.History.hash -> Dal_slot_repr.History.t option Lwt.t + + (** In case we expect to generate an input proof that is a DAL page + confirmation, we should provide via [page_info] the information of the + page. That is: its content and the proof that the page is part of a + confirmed slot whose ID is part of the page's ID. + + In case we expect to generate an input proof to justify that a DAL page + is not confirmed, the value of [page_info] should be [None]. + + In case the proof doesn't involve DAL inputs, the value of [page_info] + is [None]. *) + val page_info : + (Dal_slot_repr.Page.content * Dal_slot_repr.Page.proof) option + + (** Some parameters of the DAL. Needed when checking a page's proof against + a slot's {!val: Dal_slot_repr.commitment}. *) + val dal_parameters : Dal_slot_repr.parameters + + (** The lag between the time an endorsement is published on L1 + (its published_level) and the level it should be confirmed. *) + val dal_attestation_lag : int + end +end + +(** [produce ~metadata pvm_and_state inbox_context inbox_history + commit_inbox_level] will construct a full refutation game proof out of + the [state] given in [pvm_and_state]. It uses the [inbox] if necessary to + provide input in the proof. If the input is above or at [commit_level] it + will block it, and produce a proof that the PVM is blocked. If + the input requested is a reveal the proof production will also + fail. + + This will fail if any of the [context], [inbox_context], [inbox_history] or + [dal_slots_history_cache] given doesn't have enough data to make the proof. + For example, the 'protocol implementation' version of each PVM won't be + able to run this function. Similarly, the version of the inbox + stored in the L1 won't be enough because it forgets old levels. + + This uses the [name] in the [pvm_and_state] module to produce an + encodable [wrapped_proof] if possible. See the [wrap_proof] function + in [Sc_rollups]. + + It also need the [metadata] if it produces a proof for the [Needs_metadata] + state. +*) +val produce : + metadata:Sc_rollup_metadata_repr.t -> + (module PVM_with_context_and_state) -> + Raw_level_repr.t -> + serialized t tzresult Lwt.t + +(**/**) + +module Internal_for_tests : sig + (** Export internal [cut_at_level] function. See the docstring in the + implementation file for more information. *) + val cut_at_level : + origination_level:Raw_level_repr.t -> + commit_inbox_level:Raw_level_repr.t -> + Sc_rollup_PVM_sig.input -> + Sc_rollup_PVM_sig.input option +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.ml new file mode 100644 index 000000000000..cc88007c67a0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.ml @@ -0,0 +1,507 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_errors +module Store = Storage.Sc_rollup +module Commitment = Sc_rollup_commitment_repr +module Commitment_storage = Sc_rollup_commitment_storage +module Commitment_hash = Commitment.Hash +module Stake_storage = Sc_rollup_stake_storage + +type point = { + commitment : Sc_rollup_commitment_repr.t; + hash : Commitment_hash.t; +} + +type conflict_point = point * point + +(** [initial_timeout ctxt] set the initial timeout of players. The initial + timeout of each player is equal to [sc_rollup_timeout_period_in_blocks]. *) +let initial_timeout ctxt = + let last_turn_level = (Raw_context.current_level ctxt).level in + let timeout_period_in_blocks = + Constants_storage.sc_rollup_timeout_period_in_blocks ctxt + in + Sc_rollup_game_repr. + { + alice = timeout_period_in_blocks; + bob = timeout_period_in_blocks; + last_turn_level; + } + +(** [update_timeout ctxt rollup game idx] update the timeout left for the + current player [game.turn]. Her new timeout is equal to [nb_of_block_left - + (current_level - last_turn_level)] where [nb_of_block_left] is her current + timeout. *) +let update_timeout ctxt rollup (game : Sc_rollup_game_repr.t) idx = + let open Lwt_result_syntax in + let* ctxt, timeout = Store.Game_timeout.get (ctxt, rollup) idx in + let current_level = (Raw_context.current_level ctxt).level in + let sub_block_left nb_of_block_left = + nb_of_block_left + - Int32.to_int (Raw_level_repr.diff current_level timeout.last_turn_level) + in + let new_timeout = + match game.turn with + | Alice -> + let nb_of_block_left = sub_block_left timeout.alice in + {timeout with last_turn_level = current_level; alice = nb_of_block_left} + | Bob -> + let nb_of_block_left = sub_block_left timeout.bob in + {timeout with last_turn_level = current_level; bob = nb_of_block_left} + in + let* ctxt, _ = Store.Game_timeout.update (ctxt, rollup) idx new_timeout in + return ctxt + +let get_ongoing_games_for_staker ctxt rollup staker = + let open Lwt_result_syntax in + let* ctxt, entries = Store.Game.list_key_values ((ctxt, rollup), staker) in + let* ctxt, games = + List.fold_left_es + (fun (ctxt, games) (opponent, game_index) -> + let* ctxt, answer = Store.Game_info.find (ctxt, rollup) game_index in + match answer with + | None -> + (* A hash in [Store.Game] is always present in [Store.Game_info]. *) + assert false + | Some game -> + let games = + (game, Sc_rollup_game_repr.Index.make staker opponent) :: games + in + return (ctxt, games)) + (ctxt, []) + entries + in + return (games, ctxt) + +(** [goto_inbox_level ctxt rollup inbox_level commit] Follows the predecessors of [commit] until it + arrives at the exact [inbox_level]. The result is the commit hash at the given inbox level. *) +let goto_inbox_level ctxt rollup inbox_level commit = + let open Lwt_result_syntax in + let rec go ctxt commit = + let* info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup commit + in + if Raw_level_repr.(info.Commitment.inbox_level <= inbox_level) then ( + (* Assert that we're exactly at that level. If this isn't the case, we're most likely in a + situation where inbox levels are inconsistent. *) + assert (Raw_level_repr.(info.inbox_level = inbox_level)) ; + return (commit, ctxt)) + else (go [@ocaml.tailcall]) ctxt info.predecessor + in + go ctxt commit + +let get_conflict_point ctxt rollup staker1 staker2 = + let open Lwt_result_syntax in + (* Ensure the LCC is set. *) + let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in + (* Find out on which commitments the competitors are staked. *) + let* commit1, ctxt = Stake_storage.find_staker ctxt rollup staker1 in + let* commit2, ctxt = Stake_storage.find_staker ctxt rollup staker2 in + let* () = + fail_when + Commitment_hash.( + (* If PVM is in pre-boot state, there might be stakes on the zero commitment. *) + commit1 = zero || commit2 = zero + (* If either commit is the LCC, that also means there can't be a conflict. *) + || commit1 = lcc + || commit2 = lcc) + Sc_rollup_no_conflict + in + let* commit1_info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup commit1 + in + let* commit2_info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup commit2 + in + (* Make sure that both commits are at the same inbox level. In case they are not move the commit + that is farther ahead to the exact inbox level of the other. + + We do this instead of an alternating traversal of either commit to ensure the we can detect + wonky inbox level increases. For example, if the inbox levels decrease in different intervals + between commits for either history, we risk going past the conflict point and accidentally + determined that the commits are not in conflict by joining at the same commit. *) + let target_inbox_level = + Raw_level_repr.min commit1_info.inbox_level commit2_info.inbox_level + in + let* commit1, ctxt = + goto_inbox_level ctxt rollup target_inbox_level commit1 + in + let* commit2, ctxt = + goto_inbox_level ctxt rollup target_inbox_level commit2 + in + (* The inbox level of a commitment increases by a fixed amount over the preceding commitment. + We use this fact in the following to efficiently traverse both commitment histories towards + the conflict points. *) + let rec traverse_in_parallel ctxt commit1 commit2 = + (* We know that commit1 <> commit2 at the first call and during recursive calls + as well. *) + let* commit1_info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup commit1 + in + let* commit2_info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup commit2 + in + (* This assert should hold because: + - We call function [traverse_in_parallel] with two initial commitments + whose levels are equal to [target_inbox_level], + - In recursive calls, the commitments are replaced by their respective + predecessors, and we know that successive commitments in a branch are + spaced by [sc_rollup_commitment_period_in_blocks] *) + assert (Raw_level_repr.(commit1_info.inbox_level = commit2_info.inbox_level)) ; + if Commitment_hash.(commit1_info.predecessor = commit2_info.predecessor) + then + (* Same predecessor means we've found the conflict points. *) + return + ( ( {hash = commit1; commitment = commit1_info}, + {hash = commit2; commitment = commit2_info} ), + ctxt ) + else + (* Different predecessors means they run in parallel. *) + (traverse_in_parallel [@ocaml.tailcall]) + ctxt + commit1_info.predecessor + commit2_info.predecessor + in + let* () = + fail_when + (* This case will most dominantly happen when either commit is part of the other's history. + It occurs when the commit that is farther ahead gets dereferenced to its predecessor often + enough to land at the other commit. *) + Commitment_hash.(commit1 = commit2) + Sc_rollup_no_conflict + in + traverse_in_parallel ctxt commit1 commit2 + +let get_game ctxt rollup stakers = + let open Lwt_result_syntax in + let open Sc_rollup_game_repr.Index in + let* ctxt, game_index = + Store.Game.find ((ctxt, rollup), stakers.alice) stakers.bob + in + match game_index with + | None -> tzfail Sc_rollup_no_game + | Some game_hash -> ( + let* ctxt, game = Store.Game_info.find (ctxt, rollup) game_hash in + match game with + | Some game -> return (game, ctxt) + | None -> tzfail Sc_rollup_no_game) + +let create_game ctxt rollup stakers game = + let open Lwt_result_syntax in + let open Sc_rollup_game_repr.Index in + let* ctxt, _ = Store.Game_info.init (ctxt, rollup) stakers game in + let* ctxt, _ = + Store.Game.init ((ctxt, rollup), stakers.alice) stakers.bob stakers + in + let* ctxt, _ = + Store.Game.init ((ctxt, rollup), stakers.bob) stakers.alice stakers + in + return ctxt + +let update_game ctxt rollup stakers new_game = + let open Lwt_result_syntax in + let* ctxt, _storage_diff = + Store.Game_info.update (ctxt, rollup) stakers new_game + in + return ctxt + +let remove_game ctxt rollup stakers = + let open Lwt_result_syntax in + let open Sc_rollup_game_repr.Index in + let* ctxt, _storage_diff, _was_here = + Store.Game.remove ((ctxt, rollup), stakers.alice) stakers.bob + in + let* ctxt, _storage_diff, _was_here = + Store.Game.remove ((ctxt, rollup), stakers.bob) stakers.alice + in + let* ctxt, _storage_diff, _was_here = + Store.Game_info.remove (ctxt, rollup) stakers + in + return ctxt + +(** [start_game ctxt rollup refuter defender] initialises the game or + if it already exists fails with `Sc_rollup_game_already_started`. + + The game is created with `refuter` as the first player to move. The + initial state of the game will be obtained from the commitment pair + belonging to [defender] at the conflict point. See + [Sc_rollup_game_repr.initial] for documentation on how a pair of + commitments is turned into an initial game state. + + This also deals with the other bits of data in the storage around + the game. Notice that a staker can participate in multiple games in + parallel. However, there is at most one game between two given stakers + since a staker can publish at most one commitment per inbox level. + + It also initialises the timeout level to the current level plus + [timeout_period_in_blocks] (which will become a protocol constant + soon) to mark the block level at which it becomes possible for + anyone to end the game by timeout. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_no_conflict] if [refuter] is staked on an ancestor of + the commitment staked on by [defender], or vice versa} + {li [Sc_rollup_not_staked] if one of the [refuter] or [defender] is + not actually staked} + {li [Sc_rollup_staker_in_game] if one of the [refuter] or [defender] + is already playing a game} + } *) +let start_game ctxt rollup ~player:refuter ~opponent:defender = + let open Lwt_result_syntax in + let stakers = Sc_rollup_game_repr.Index.make refuter defender in + let* ctxt, game_exists = Store.Game_info.mem (ctxt, rollup) stakers in + let* () = fail_when game_exists Sc_rollup_game_already_started in + let check_staker_availability ctxt staker = + let* ctxt, entries = Store.Game.list_key_values ((ctxt, rollup), staker) in + let* () = + fail_when + Compare.List_length_with.( + entries + >= Constants_storage.sc_rollup_max_number_of_parallel_games ctxt) + (Sc_rollup_max_number_of_parallel_games_reached staker) + in + return ctxt + in + let* ctxt = check_staker_availability ctxt stakers.alice in + let* ctxt = check_staker_availability ctxt stakers.bob in + let* ( ( {hash = _refuter_commit; commitment = _info}, + {hash = _defender_commit; commitment = child_info} ), + ctxt ) = + get_conflict_point ctxt rollup refuter defender + in + let* parent_info, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup child_info.predecessor + in + let* inbox, ctxt = Sc_rollup_inbox_storage.get_inbox ctxt in + let default_number_of_sections = + Constants_storage.sc_rollup_number_of_sections_in_dissection ctxt + in + let* slots_history_snapshot = + Dal_slot_storage.get_slot_headers_history ctxt + in + let current_level = (Raw_context.current_level ctxt).level in + let game = + Sc_rollup_game_repr.initial + ~start_level:current_level + (Sc_rollup_inbox_repr.take_snapshot inbox) + slots_history_snapshot + ~parent:parent_info + ~child:child_info + ~refuter + ~defender + ~default_number_of_sections + in + let* ctxt = create_game ctxt rollup stakers game in + let* ctxt, _ = + Store.Game_timeout.init (ctxt, rollup) stakers (initial_timeout ctxt) + in + return ctxt + +let check_stakes ctxt rollup (stakers : Sc_rollup_game_repr.Index.t) = + let open Lwt_result_syntax in + let open Sc_rollup_game_repr in + let* alice_stake, ctxt = Stake_storage.is_staker ctxt rollup stakers.alice in + let* bob_stake, ctxt = Stake_storage.is_staker ctxt rollup stakers.bob in + let game_over loser = Loser {loser; reason = Conflict_resolved} in + match (alice_stake, bob_stake) with + | true, true -> return (None, ctxt) + | false, true -> return (Some (game_over stakers.alice), ctxt) + | true, false -> return (Some (game_over stakers.bob), ctxt) + | false, false -> return (Some Draw, ctxt) + +let game_move ctxt rollup ~player ~opponent refutation = + let open Lwt_result_syntax in + let stakers = Sc_rollup_game_repr.Index.make player opponent in + let* game, ctxt = get_game ctxt rollup stakers in + let* ctxt, kind = Store.PVM_kind.get ctxt rollup in + let* () = + fail_unless + (Sc_rollup_repr.Staker.equal + player + (Sc_rollup_game_repr.Index.staker stakers game.turn)) + Sc_rollup_wrong_turn + in + let* ctxt, metadata = Sc_rollup_storage.get_metadata ctxt rollup in + let dal = (Constants_storage.parametric ctxt).dal in + let* check_result, ctxt = check_stakes ctxt rollup stakers in + match check_result with + | Some game_result -> return (Some game_result, ctxt) + | None -> ( + let play_cost = Sc_rollup_game_repr.cost_play game refutation in + let*? ctxt = Raw_context.consume_gas ctxt play_cost in + let* move_result = + Sc_rollup_game_repr.play + kind + dal.cryptobox_parameters + ~dal_attestation_lag:dal.attestation_lag + ~stakers + metadata + game + refutation + in + match move_result with + | Either.Left game_result -> return (Some game_result, ctxt) + | Either.Right new_game -> + let* ctxt = update_game ctxt rollup stakers new_game in + let* ctxt = update_timeout ctxt rollup game stakers in + return (None, ctxt)) + +let get_timeout ctxt rollup stakers = + let open Lwt_result_syntax in + let* ctxt, timeout_opt = + Storage.Sc_rollup.Game_timeout.find (ctxt, rollup) stakers + in + match timeout_opt with + | Some timeout -> return (timeout, ctxt) + | None -> tzfail Sc_rollup_no_game + +let timeout ctxt rollup stakers = + let open Lwt_result_syntax in + let level = (Raw_context.current_level ctxt).level in + let* game, ctxt = get_game ctxt rollup stakers in + let* ctxt, timeout = Store.Game_timeout.get (ctxt, rollup) stakers in + let* () = + let block_left_before_timeout = + match game.turn with Alice -> timeout.alice | Bob -> timeout.bob + in + let level_of_timeout = + Raw_level_repr.add timeout.last_turn_level block_left_before_timeout + in + fail_unless + Raw_level_repr.(level > level_of_timeout) + (let blocks_left = Raw_level_repr.(diff level_of_timeout level) in + let staker = + match game.turn with Alice -> stakers.alice | Bob -> stakers.bob + in + Sc_rollup_timeout_level_not_reached (blocks_left, staker)) + in + let game_result = + match game.game_state with + | Dissecting _ -> + (* Timeout during the dissecting results in a loss. *) + let loser = Sc_rollup_game_repr.Index.staker stakers game.turn in + Sc_rollup_game_repr.(Loser {loser; reason = Timeout}) + | Final_move {agreed_start_chunk = _; refuted_stop_chunk = _} -> + (* Timeout-ed because the opponent played an invalid move and + the current player is not playing. Both are invalid moves. *) + Sc_rollup_game_repr.Draw + in + return (game_result, ctxt) + +let reward ctxt winner = + let open Lwt_result_syntax in + let winner_contract = Contract_repr.Implicit winner in + let stake = Constants_storage.sc_rollup_stake_amount ctxt in + let*? reward = Tez_repr.(stake /? 2L) in + Token.transfer + ctxt + `Sc_rollup_refutation_rewards + (`Contract winner_contract) + reward + +let apply_game_result ctxt rollup (stakers : Sc_rollup_game_repr.Index.t) + (game_result : Sc_rollup_game_repr.game_result) = + let open Lwt_result_syntax in + let status = Sc_rollup_game_repr.Ended game_result in + let* ctxt, balances_updates = + match game_result with + | Loser {loser; reason = _} -> + let losing_staker = loser in + let winning_staker = + let Sc_rollup_game_repr.Index.{alice; bob} = stakers in + if Signature.Public_key_hash.(alice = loser) then bob else alice + in + let* ctxt, balance_updates_winner = reward ctxt winning_staker in + let* ctxt = remove_game ctxt rollup stakers in + let* ctxt, balance_updates_loser = + Stake_storage.remove_staker ctxt rollup losing_staker + in + let balances_updates = balance_updates_loser @ balance_updates_winner in + return (ctxt, balances_updates) + | Draw -> + let* ctxt, balances_updates_alice = + Stake_storage.remove_staker ctxt rollup stakers.alice + in + let* ctxt, balances_updates_bob = + Stake_storage.remove_staker ctxt rollup stakers.bob + in + return (ctxt, balances_updates_alice @ balances_updates_bob) + in + let* ctxt, _storage_diff, _was_here = + Store.Game_timeout.remove (ctxt, rollup) stakers + in + return (status, ctxt, balances_updates) + +module Internal_for_tests = struct + let get_conflict_point = get_conflict_point +end + +type conflict = { + other : Sc_rollup_repr.Staker.t; + their_commitment : Sc_rollup_commitment_repr.t; + our_commitment : Sc_rollup_commitment_repr.t; + parent_commitment : Sc_rollup_commitment_repr.Hash.t; +} + +let conflict_encoding = + Data_encoding.( + conv + (fun {other; their_commitment; our_commitment; parent_commitment} -> + (other, their_commitment, our_commitment, parent_commitment)) + (fun (other, their_commitment, our_commitment, parent_commitment) -> + {other; their_commitment; our_commitment; parent_commitment}) + (obj4 + (req "other" Sc_rollup_repr.Staker.encoding) + (req "their_commitment" Sc_rollup_commitment_repr.encoding) + (req "our_commitment" Sc_rollup_commitment_repr.encoding) + (req "parent_commitment" Sc_rollup_commitment_repr.Hash.encoding))) + +let conflicting_stakers_uncarbonated ctxt rollup staker = + let open Lwt_result_syntax in + let make_conflict ctxt rollup other (our_point, their_point) = + let our_hash = our_point.hash and their_hash = their_point.hash in + let get = Sc_rollup_commitment_storage.get_commitment_unsafe ctxt rollup in + let* our_commitment, _ctxt = get our_hash in + let* their_commitment, _ctxt = get their_hash in + let parent_commitment = our_commitment.predecessor in + return {other; their_commitment; our_commitment; parent_commitment} + in + let* _ctxt, stakers = Store.stakers ctxt rollup in + List.fold_left_es + (fun conflicts (other_staker, _) -> + let*! res = get_conflict_point ctxt rollup staker other_staker in + match res with + | Ok (conflict_point, _) -> + let* conflict = + make_conflict ctxt rollup other_staker conflict_point + in + return (conflict :: conflicts) + | Error _ -> return conflicts) + [] + stakers diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.mli new file mode 100644 index 000000000000..c928e9f068b0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_refutation_storage.mli @@ -0,0 +1,200 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Commitment_hash = Sc_rollup_commitment_repr.Hash + +type point = { + commitment : Sc_rollup_commitment_repr.t; + hash : Commitment_hash.t; +} + +type conflict_point = point * point + +(** [get_ongoing_games_for_staker ctxt rollup staker] returns [games], + the list of refutation games currently played by [staker] in the + [rollup]. *) +val get_ongoing_games_for_staker : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + ((Sc_rollup_game_repr.t * Sc_rollup_game_repr.Index.t) list * Raw_context.t) + tzresult + Lwt.t + +(** A conflict between a staker and an [other] staker. The conflict is + about the commitment that follows the [parent_commitment]: + [their_commitment] and [our_commitment] are distinct, hence in + conflict. *) +type conflict = { + other : Sc_rollup_repr.Staker.t; + their_commitment : Sc_rollup_commitment_repr.t; + our_commitment : Sc_rollup_commitment_repr.t; + parent_commitment : Sc_rollup_commitment_repr.Hash.t; +} + +val conflict_encoding : conflict Data_encoding.t + +(** [conflicting_stakers_uncarbonated rollup staker] returns the list + of conflicts with [staker] in [rollup]. + + Notice that this operation can be expensive as it is proportional + to the number of stakers multiplied by the number of commitments in + the staked branches. Fortunately, this operation is only useful as + an RPC for the rollup node to look for a new conflict to solve. *) +val conflicting_stakers_uncarbonated : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + conflict list tzresult Lwt.t + +(** [start_game ctxt rollup ~player ~opponent] initiates a refutation + game between [player] and [opponent] in the given [rollup]. *) +val start_game : + Raw_context.t -> + Sc_rollup_repr.t -> + player:Signature.public_key_hash -> + opponent:Signature.public_key_hash -> + Raw_context.t tzresult Lwt.t + +(** [game_move ctxt rollup player opponent refutation] + handles the storage-side logic for when one of the players makes a + move in the game. It checks the game already exists. Then it checks + that [player] is the player whose turn it is; if so, it applies + [refutation] using the [play] function. + + If the result is a new game, this is stored and the timeout is updated. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_no_game] if [is_opening_move] is [false] but the + game does not exist} + {li [Sc_rollup_game_already_started] if [is_opening_move] is [true] + but the game already exists} + {li [Sc_rollup_no_conflict] if [player] is staked on an ancestor of + the commitment staked on by [opponent], or vice versa} + {li [Sc_rollup_not_staked] if one of the [player] or [opponent] is + not actually staked} + {li [Sc_rollup_staker_in_game] if one of the [player] or [opponent] + is already playing a game} + {li [Sc_rollup_wrong_turn] if a player is trying to move out of + turn} + } + + The [is_opening_move] argument is included here to make sure that an + operation intended to start a refutation game is never mistaken for + an operation to play the second move of the game---this may + otherwise happen due to non-deterministic ordering of L1 operations. + With the [is_opening_move] parameter, the worst case is that the + operation simply fails. Without it, the operation would be mistaken + for an invalid move in the game and the staker would lose their + stake! *) +val game_move : + Raw_context.t -> + Sc_rollup_repr.t -> + player:Sc_rollup_repr.Staker.t -> + opponent:Sc_rollup_repr.Staker.t -> + Sc_rollup_game_repr.refutation -> + (Sc_rollup_game_repr.game_result option * Raw_context.t) tzresult Lwt.t + +(** [timeout ctxt rollup stakers] checks that the timeout has + elapsed and if this function returns a game result that punishes whichever + of [stakers] is supposed to have played a move. + + The timeout period is defined a protocol constant, see + {!Constants_storage.sc_rollup_timeout_period_in_blocks}. + + May fail with: + {ul + {li [Sc_rollup_no_game] if the game does not in fact exist} + {li [Sc_rollup_timeout_level_not_reached] if the player still has + time in which to play} + } + + Note: this function takes the two stakers as a pair rather than + separate arguments. This reflects the fact that for this function + the two players are symmetric. This function will normalize the + order of the players if necessary to get a valid game index, so the + argument [stakers] doesn't have to be in normal form. *) +val timeout : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_game_repr.Index.t -> + (Sc_rollup_game_repr.game_result * Raw_context.t) tzresult Lwt.t + +(** [get_timeout ctxt rollup stakers] returns the current timeout values of both + players. *) +val get_timeout : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_game_repr.Index.t -> + (Sc_rollup_game_repr.timeout * Raw_context.t) tzresult Lwt.t + +(** [apply_game_result ctxt rollup game_result] takes a [game_result] produced + by [timeout] or [game_move] and performs the necessary end-of-game + cleanup: remove the game itself from the store and punish the losing + player by removing their stake. In the case where the game ended in + a draw, both players are slashed. + + This is mostly just calling [remove_staker], so it can fail with the + same errors as that. However, if it is called on an [game_result] + generated by [game_move] or [timeout] it should not fail. + + Note: this function takes the two stakers as a pair rather than + separate arguments. This reflects the fact that for this function + the two players are symmetric. This function will normalize the + order of the players if necessary to get a valid game index, so the + argument [stakers] doesn't have to be in normal form. *) +val apply_game_result : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_game_repr.Index.t -> + Sc_rollup_game_repr.game_result -> + (Sc_rollup_game_repr.status * Raw_context.t * Receipt_repr.balance_updates) + tzresult + Lwt.t + +(**/**) + +module Internal_for_tests : sig + (** [get_conflict_point context rollup staker1 staker2] returns the first point + of disagreement between the given stakers. The returned commitments are + distinct, and have the same [parent] commitment. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_no_conflict] if [staker1] is staked on an ancestor of the + commitment staked on by [staker2], or vice versa} + {li [Sc_rollup_not_staked] if one of the stakers is not staked} + } *) + val get_conflict_point : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + Sc_rollup_repr.Staker.t -> + (conflict_point * Raw_context.t) tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.ml new file mode 100644 index 000000000000..e69d9fdfb58c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.ml @@ -0,0 +1,172 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Address = struct + let prefix = "sr1" + + let encoded_size = 36 + + let decoded_prefix = "\006\124\117" (* "sr1(36)" decoded from base 58. *) + + module H = + Blake2B.Make + (Base58) + (struct + let name = "Sc_rollup_hash" + + let title = "A smart contract rollup address" + + let b58check_prefix = decoded_prefix + + let size = Some 20 + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size + + include Path_encoding.Make_hex (H) + + let of_b58data = function H.Data h -> Some h | _ -> None +end + +module Internal_for_tests = struct + let originated_sc_rollup nonce = + let data = + Data_encoding.Binary.to_bytes_exn Origination_nonce.encoding nonce + in + Address.hash_bytes [data] +end + +(* 32 *) +let state_hash_prefix = "\017\144\122\202" (* scs1(54) *) + +module State_hash = struct + let prefix = "scs1" + + let encoded_size = 54 + + module H = + Blake2B.Make + (Base58) + (struct + let name = "state_hash" + + let title = "The hash of the VM state of a smart contract rollup" + + let b58check_prefix = state_hash_prefix + + (* defaults to 32 *) + let size = None + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size + + include Path_encoding.Make_hex (H) + + let context_hash_to_state_hash = + (* Both State_hash and Context_hash's hashes are supposed to have the + same size. This top-level check enforces this invariant, in which case, + no exception could be thrown by [of_bytes_exn] below *) + let () = assert (Compare.Int.equal size Context_hash.size) in + fun h -> of_bytes_exn @@ Context_hash.to_bytes h + + (* Hackish way to disable hash_bytes and hash_string to force people to use + context_hash_to_state_hash (without changing content of HASH.S) *) + type unreachable = | + + let hash_bytes = function (_ : unreachable) -> . + + let hash_string = function (_ : unreachable) -> . +end + +type t = Address.t + +let description = + "A smart contract rollup is identified by a base58 address starting with " + ^ Address.prefix + +let pp = Address.pp + +let encoding = + let open Data_encoding in + def + "rollup_address" + ~title:"A smart contract rollup address" + ~description + Address.encoding + +let rpc_arg = + RPC_arg.like + Address.rpc_arg + ~descr:"A smart contract rollup address." + "sc_rollup_address" + +let in_memory_size (_ : t) = + let open Cache_memory_helpers in + h1w +! string_size_gen Address.size + +module Staker = Signature.Public_key_hash + +module Index = struct + type t = Address.t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt encoding) + | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = Address.compare +end + +module Number_of_ticks = struct + include Bounded.Int64 (struct + let min_value = 0L + + let max_value = Int64.max_int + end) + + let zero = + match of_value 0L with + | Some zero -> zero + | None -> assert false (* unreachable case, since [min_int = 0l] *) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.mli new file mode 100644 index 000000000000..e8e36e46e4c8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_repr.mli @@ -0,0 +1,105 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The basic components of an optimistic rollup for smart-contracts. *) + +(** + + An optimistic rollup for smart-contracts is made of two main + components: + + - a proof generating virtual machine (PVM), which provides the + essential semantics for the rollup operations to be validated by + the layer 1 in case of dispute about a commitment ; + + - a database which maintains the cemented operations of the rollup + as well as the potentially-disputed operations. + +*) + +(** A smart rollup has an address starting with "sr1". *) +module Address : sig + include S.HASH + + (** [encoded_size] is the number of bytes needed to represent an address. *) + val encoded_size : int + + val of_b58data : Base58.data -> t option + + (** [prefix] is the prefix of smart contract rollup addresses. *) + val prefix : string +end + +module Internal_for_tests : sig + val originated_sc_rollup : Origination_nonce.t -> Address.t +end + +module State_hash : sig + include S.HASH + + (** [context_hash_to_state_hash ch] turns an (Irmin) context hash + into a state hash. *) + val context_hash_to_state_hash : Context_hash.t -> t + + (* Hackish way to disable hash_bytes and hash_string to force people to use + context_hash_to_state_hash (without changing content of HASH.S) *) + type unreachable = | + + val hash_bytes : unreachable -> t + + val hash_string : unreachable -> t +end + +(** Number of ticks computed by a single commitment. This represents a claim + about the state of the PVM, which can be disputed as part of a commitment + dispute. + + See also {!Commitment_repr.}. *) +module Number_of_ticks : sig + include Bounded.S with type ocaml_type := int64 + + val zero : t +end + +(** A smart contract rollup is identified by its address. *) +type t = Address.t + +val encoding : t Data_encoding.t + +val rpc_arg : t RPC_arg.t + +val pp : Format.formatter -> t -> unit + +(** [in_memory_size sc_rollup] returns the number of bytes [sc_rollup] + uses in RAM. *) +val in_memory_size : t -> Cache_memory_helpers.sint + +(** A [Staker] is an implicit account, identified by its public key hash. *) +module Staker : + S.SIGNATURE_PUBLIC_KEY_HASH with type t = Signature.Public_key_hash.t + +(** The data model uses an index of these addresses. *) +module Index : Storage_description.INDEX with type t = Address.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.ml new file mode 100644 index 000000000000..c583ff28e2c1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.ml @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Reserve the first byte in the encoding to support multi-versioning + in the future. *) +module Blake2B = struct + include + Blake2B.Make + (Base58) + (struct + let name = "Sc_rollup_reveal_data_blake2b_hash" + + let title = "A smart contract rollup reveal hash" + + let b58check_prefix = + "\230\206\128\200\196" (* "scrrh1(56)" decoded from Base58. *) + + let size = Some 32 + end) + + let () = Base58.check_encoded_prefix b58check_encoding "scrrh1" 56 +end + +type supported_hashes = Blake2B + +type t = Blake2B of Blake2B.t + +let zero ~(scheme : supported_hashes) = + match scheme with Blake2B -> Blake2B Blake2B.zero + +let pp ppf hash = match hash with Blake2B hash -> Blake2B.pp ppf hash + +let equal h1 h2 = + match (h1, h2) with Blake2B h1, Blake2B h2 -> Blake2B.equal h1 h2 + +let compare h1 h2 = + match (h1, h2) with Blake2B h1, Blake2B h2 -> Blake2B.compare h1 h2 + +module Map = Map.Make (struct + type tmp = t + + type t = tmp + + let compare = compare +end) + +let of_b58check_opt b58_hash = + b58_hash |> Blake2B.of_b58check_opt |> Option.map (fun hash -> Blake2B hash) + +(* Size of the hash is the size of the inner hash plus one byte for the + tag used to identify the hashing scheme. *) +let size ~(scheme : supported_hashes) = + let tag_size = 1 in + let size_without_tag = match scheme with Blake2B -> Blake2B.size in + tag_size + size_without_tag + +let encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"Reveal_data_hash_v0" + (Tag 0) + Blake2B.encoding + (fun (Blake2B s) -> Some s) + (fun s -> Blake2B s); + ] + +let hash_string ~(scheme : supported_hashes) ?key strings = + match scheme with Blake2B -> Blake2B (Blake2B.hash_string ?key strings) + +let hash_bytes ~(scheme : supported_hashes) ?key bytes = + match scheme with Blake2B -> Blake2B (Blake2B.hash_bytes ?key bytes) + +let to_b58check hash = + match hash with Blake2B hash -> Blake2B.to_b58check hash + +let scheme_of_hash hash = + match hash with Blake2B _hash -> (Blake2B : supported_hashes) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.mli new file mode 100644 index 000000000000..084e09fc4e99 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_reveal_hash.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The type of a reveal hash. *) +type t + +(** The hashing schemes supported by the reveal hash. *) +type supported_hashes = Blake2B + +(** A Map module for storing reveal-hash-indexed values. *) +module Map : Map.S with type key = t + +(** [size ~scheme] returns the size of reveal hashes using the [scheme] + specified in input. *) +val size : scheme:supported_hashes -> int + +(** [zero ~scheme] returns the reveal hash corresponding to the zero hash + for the [scheme] specified in input. *) +val zero : scheme:supported_hashes -> t + +(** Formatting function for reveal-hashes. *) +val pp : Format.formatter -> t -> unit + +(** [equal hash1 hash2] checks if the two reveal-hashes [hash1] and [hash2] + are equal. This function must preserve the equality of individual + supported hashing schemes. If [hash1] and [hash2] are hashes obtained + from the same supported hashing scheme, then the [equal] function from + that hashing scheme is used to determine whether they are equivalent. + Otherwise, they are different. *) +val equal : t -> t -> bool + +(** [compare hash1 hash2] compares the values of the reveal hashes [hash1] + and [hash2]. This function must preserve the ordering of individual + supported hashing scheme. If [hash1] and [hash2] are reveal-hashes + obtained from the same hashing scheme, then [compare hash1 hash2] + should return the same result of the compare function exposed + by the hash module corresponding to their hashing scheme. *) +val compare : t -> t -> int + +(* [of_b58check_opt base58_hash] returns the reveal-hash, if any, + whose base58 encoding is [base58_hash]. To avoid ambiguity, + the [S.HASH] modules supported should avoid using the same prefix + for the base58 encoding. *) +val of_b58check_opt : string -> t option + +(* The encoding of reveal hashes. *) +val encoding : t Data_encoding.t + +(* [hash_string ~scheme ?key strings] hashes [strings] using the + supported hashing [scheme] given in input. *) +val hash_string : scheme:supported_hashes -> ?key:string -> string list -> t + +(* [hash_bytes ~scheme ?key strings] hashes [bytes] using the + supported hashing [scheme] given in input. *) +val hash_bytes : scheme:supported_hashes -> ?key:bytes -> bytes list -> t + +(* [to_b58check hash] returns the base58 encoded reveal hash. *) +val to_b58check : t -> string + +(* [scheme_of_hash] hash returns the supported hashing scheme + that was used to obtain [hash]. *) +val scheme_of_hash : t -> supported_hashes diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.ml new file mode 100644 index 000000000000..071c18e9b4df --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.ml @@ -0,0 +1,604 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_errors +module Store = Storage.Sc_rollup +module Commitment_storage = Sc_rollup_commitment_storage +module Commitment = Sc_rollup_commitment_repr +module Commitment_hash = Commitment.Hash + +let is_staker ctxt rollup staker = + let open Lwt_result_syntax in + let* ctxt, res = Store.Last_cemented_commitment.mem ctxt rollup in + if not res then tzfail (Sc_rollup_does_not_exist rollup) + else + let* ctxt, res = Store.Stakers.find (ctxt, rollup) staker in + match res with + | None -> return (false, ctxt) + | Some _branch -> return (true, ctxt) + +let find_staker_unsafe ctxt rollup staker = + let open Lwt_result_syntax in + let* ctxt, res = Store.Stakers.find (ctxt, rollup) staker in + match res with + | None -> tzfail Sc_rollup_not_staked + | Some branch -> return (branch, ctxt) + +let find_staker ctxt rollup staker = + let open Lwt_result_syntax in + let* ctxt, res = Store.Last_cemented_commitment.mem ctxt rollup in + if not res then tzfail (Sc_rollup_does_not_exist rollup) + else find_staker_unsafe ctxt rollup staker + +let modify_staker_count ctxt rollup f = + let open Lwt_result_syntax in + let* ctxt, maybe_count = Store.Staker_count.find ctxt rollup in + let count = Option.value ~default:0l maybe_count in + let* ctxt, size_diff, _was_bound = + Store.Staker_count.add ctxt rollup (f count) + in + assert (Compare.Int.(size_diff = 0)) ; + return ctxt + +let get_contract_and_stake ctxt staker = + let staker_contract = Contract_repr.Implicit staker in + let stake = Constants_storage.sc_rollup_stake_amount ctxt in + (staker_contract, stake) + +(** Warning: must be called only if [rollup] exists and [staker] is not to be + found in {!Store.Stakers.} *) +let deposit_stake ctxt rollup staker = + let open Lwt_result_syntax in + let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in + let staker_contract, stake = get_contract_and_stake ctxt staker in + let* ctxt, staker_balance = + Contract_storage.get_balance_carbonated ctxt staker_contract + in + let* () = + fail_when + Tez_repr.(staker_balance < stake) + (Sc_rollup_staker_funds_too_low + { + staker; + sc_rollup = rollup; + staker_balance; + min_expected_balance = stake; + }) + in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let* ctxt, balance_updates = + Token.transfer + ctxt + (`Contract staker_contract) + (`Frozen_bonds (staker_contract, bond_id)) + stake + in + let* ctxt, _size = Store.Stakers.init (ctxt, rollup) staker lcc in + let* ctxt = modify_staker_count ctxt rollup Int32.succ in + return (ctxt, balance_updates, lcc) + +let withdraw_stake ctxt rollup staker = + let open Lwt_result_syntax in + let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in + let* ctxt, res = Store.Stakers.find (ctxt, rollup) staker in + match res with + | None -> tzfail Sc_rollup_not_staked + | Some staked_on_commitment -> + let* () = + fail_unless + Commitment_hash.(staked_on_commitment = lcc) + Sc_rollup_not_staked_on_lcc + in + let staker_contract, stake = get_contract_and_stake ctxt staker in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let* ctxt, balance_updates = + Token.transfer + ctxt + (`Frozen_bonds (staker_contract, bond_id)) + (`Contract staker_contract) + stake + in + let* ctxt, _size_freed = + Store.Stakers.remove_existing (ctxt, rollup) staker + in + let+ ctxt = modify_staker_count ctxt rollup Int32.pred in + (ctxt, balance_updates) + +let assert_commitment_not_too_far_ahead ctxt rollup lcc commitment = + let open Lwt_result_syntax in + let* lcc, ctxt = Commitment_storage.get_commitment_unsafe ctxt rollup lcc in + let min_level = Commitment.(lcc.inbox_level) in + let max_level = Commitment.(commitment.inbox_level) in + let* () = + fail_when + (let sc_rollup_max_lookahead = + Constants_storage.sc_rollup_max_lookahead_in_blocks ctxt + in + Compare.Int32.( + sc_rollup_max_lookahead < Raw_level_repr.diff max_level min_level)) + Sc_rollup_too_far_ahead + in + return ctxt + +(** Enfore that a commitment's inbox level increases by an exact fixed amount over its predecessor. + This property is used in several places - not obeying it causes severe breakage. +*) +let assert_commitment_period ctxt rollup commitment = + let open Lwt_result_syntax in + let pred_hash = Commitment.(commitment.predecessor) in + let* pred, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup pred_hash + in + let pred_level = Commitment.(pred.inbox_level) in + (* We want to check the following inequalities on [commitment.inbox_level], + [commitment.predecessor.inbox_level] and the constant [sc_rollup_commitment_period]. + + - Greater-than-or-equal (>=), to ensure inbox_levels are monotonically + increasing along each branch of commitments. Together with + [assert_commitment_not_too_far_ahead] this is sufficient to limit the + depth of the commitment tree, which is also the number of commitments stored + per staker. This constraint must be enforced at submission time. + + - Equality (=), so that L2 blocks are produced at a regular rate. This + ensures that there is only ever one branch of correct commitments, + simplifying refutation logic. This could also be enforced at refutation time + rather than submission time, but doing it here works too. + + Because [a >= b && a = b] is equivalent to [a = b], we can just keep the latter as + an optimization. + *) + let sc_rollup_commitment_period = + Constants_storage.sc_rollup_commitment_period_in_blocks ctxt + in + let* () = + fail_unless + Raw_level_repr.( + commitment.inbox_level = add pred_level sc_rollup_commitment_period) + Sc_rollup_bad_inbox_level + in + return ctxt + +(** [assert_commitment_is_not_past_curfew ctxt rollup inbox_level] will look in the + storage [Commitment_first_publication_level] for the level of the oldest commit for + [inbox_level] and if it is more than [sc_rollup_challenge_window_in_blocks] + ago it fails with [Sc_rollup_commitment_past_curfew]. Otherwise it adds the + respective storage (if it is not set) and returns the context. *) +let assert_commitment_is_not_past_curfew ctxt rollup inbox_level = + let open Lwt_result_syntax in + let refutation_deadline_blocks = + Int32.of_int @@ Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let current_level = (Raw_context.current_level ctxt).level in + let* ctxt, oldest_commit = + Store.Commitment_first_publication_level.find (ctxt, rollup) inbox_level + in + match oldest_commit with + | Some oldest_commit -> + if + Compare.Int32.( + Raw_level_repr.diff current_level oldest_commit + > refutation_deadline_blocks) + then tzfail Sc_rollup_commitment_past_curfew + else return ctxt + | None -> + (* The storage cost is covered by the stake. *) + let* ctxt, _diff, _existed = + Store.Commitment_first_publication_level.add + (ctxt, rollup) + inbox_level + current_level + in + return ctxt + +(** Check invariants on [inbox_level], enforcing overallocation of storage, + regularity of block production and curfew. + + The constants used by [assert_refine_conditions_met] must be chosen such + that the maximum cost of storage allocated by each staker is at most the size + of their deposit. + *) +let assert_refine_conditions_met ctxt rollup lcc commitment = + let open Lwt_result_syntax in + let* ctxt = assert_commitment_not_too_far_ahead ctxt rollup lcc commitment in + let* ctxt = assert_commitment_period ctxt rollup commitment in + let* ctxt = + assert_commitment_is_not_past_curfew + ctxt + rollup + Commitment.(commitment.inbox_level) + in + let current_level = (Raw_context.current_level ctxt).level in + let* () = + fail_unless + Raw_level_repr.(commitment.Commitment.inbox_level < current_level) + (Sc_rollup_commitment_from_future + {current_level; inbox_level = commitment.inbox_level}) + in + return ctxt + +let get_commitment_stake_count ctxt rollup node = + let open Lwt_result_syntax in + let* ctxt, maybe_staked_on_commitment = + Store.Commitment_stake_count.find (ctxt, rollup) node + in + return (Option.value ~default:0l maybe_staked_on_commitment, ctxt) + +let modify_commitment_stake_count ctxt rollup node f = + let open Lwt_result_syntax in + let* count, ctxt = get_commitment_stake_count ctxt rollup node in + let new_count = f count in + let* ctxt, size_diff, _was_bound = + Store.Commitment_stake_count.add (ctxt, rollup) node new_count + in + return (new_count, size_diff, ctxt) + +let deallocate_commitment ctxt rollup node = + let open Lwt_result_syntax in + if Commitment_hash.(node = zero) then return ctxt + else + let* ctxt, _size_freed = + Store.Commitments.remove_existing (ctxt, rollup) node + in + return ctxt + +let deallocate_commitment_metadata ctxt rollup node = + let open Lwt_result_syntax in + if Commitment_hash.(node = zero) then return ctxt + else + let* ctxt, commitment = Store.Commitments.get (ctxt, rollup) node in + let* ctxt, _size_freed = + Store.Commitment_added.remove_existing (ctxt, rollup) node + in + let* ctxt, _size_freed = + Store.Commitment_stake_count.remove_existing (ctxt, rollup) node + in + let* ctxt, count = + Store.Commitment_count_per_inbox_level.get + (ctxt, rollup) + commitment.inbox_level + in + if Compare.Int32.(count = 1l) then + let* ctxt, _size_freed = + Store.Commitment_count_per_inbox_level.remove_existing + (ctxt, rollup) + commitment.inbox_level + in + let+ ctxt, _size_freed = + Store.Commitment_first_publication_level.remove_existing + (ctxt, rollup) + commitment.inbox_level + in + ctxt + else + let+ ctxt, _size_freed, _was_bound = + Store.Commitment_count_per_inbox_level.add + (ctxt, rollup) + commitment.inbox_level + (Int32.pred count) + in + ctxt + +let deallocate ctxt rollup node = + let open Lwt_result_syntax in + let* ctxt = deallocate_commitment_metadata ctxt rollup node in + deallocate_commitment ctxt rollup node + +let find_commitment_to_deallocate ctxt rollup commitment_hash + ~num_commitments_to_keep = + let open Lwt_result_syntax in + let rec aux ctxt commitment_hash n = + if Compare.Int.(n = 0) then return (Some commitment_hash, ctxt) + else + let* pred_hash, ctxt = + Commitment_storage.get_predecessor_opt_unsafe + ctxt + rollup + commitment_hash + in + match pred_hash with + | None -> return (None, ctxt) + | Some pred_hash -> (aux [@ocaml.tailcall]) ctxt pred_hash (n - 1) + in + aux ctxt commitment_hash num_commitments_to_keep + +let decrease_commitment_stake_count ctxt rollup node = + let open Lwt_result_syntax in + let* new_count, _size_diff, ctxt = + modify_commitment_stake_count ctxt rollup node Int32.pred + in + if Compare.Int32.(new_count <= 0l) then deallocate ctxt rollup node + else return ctxt + +let increase_commitment_stake_count ctxt rollup node = + let open Lwt_result_syntax in + let* _new_count, size_diff, ctxt = + modify_commitment_stake_count ctxt rollup node Int32.succ + in + return (size_diff, ctxt) + +(* 77 for Commitments entry + + 4 for Commitment_stake_count entry + + 4 for Commitment_added entry + + 4 for Commitment_count_per_level in case if this level didn't exist before, 0 otherwise + + 0 for Staker_count_update entry *) +let commitment_storage_size_in_bytes = 89 + +let refine_stake ctxt rollup staker staked_on commitment = + let open Lwt_result_syntax in + let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in + let* ctxt = assert_refine_conditions_met ctxt rollup lcc commitment in + let*? ctxt, new_hash = Sc_rollup_commitment_storage.hash ctxt commitment in + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2559 + Add a test checking that L2 nodes can catch up after going offline. *) + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4307 + Check value of [max_lookahead_in_blocks] against gas exhaustion + during this function execution. *) + let rec go node ctxt = + (* + + The recursive calls of this function are protected from + infinite recursion because [Commitment_storage] and + [Commitment_stake_count] are using carbonated storage. + + Hence, at each step of the traversal, the gas strictly + decreases. + + WARNING: Do NOT reorder this sequence of ifs. We must check + for [staked_on] before LCC, since refining from the LCC to + another commit is a valid operation. + + *) + if Commitment_hash.(node = staked_on) then ( + (* Previously staked commit found: + Insert new commitment if not existing *) + let* ctxt, commitment_size_diff, commit_existed = + Store.Commitments.add (ctxt, rollup) new_hash commitment + in + let* ctxt, commitment_count_per_level_size_diff, inbox_level_existed = + if commit_existed then return (ctxt, 0, true) + else + let* ctxt, count_opt = + Store.Commitment_count_per_inbox_level.find + (ctxt, rollup) + commitment.inbox_level + in + match count_opt with + | None -> + Store.Commitment_count_per_inbox_level.add + (ctxt, rollup) + commitment.inbox_level + 1l + | Some v -> + Store.Commitment_count_per_inbox_level.add + (ctxt, rollup) + commitment.inbox_level + (Int32.succ v) + in + let level = (Raw_context.current_level ctxt).level in + let* commitment_added_size_diff, commitment_added_level, ctxt = + Commitment_storage.set_commitment_added ctxt rollup new_hash level + in + let* ctxt, staker_count_diff = + Store.Stakers.update (ctxt, rollup) staker new_hash + in + let* stake_count_size_diff, ctxt = + increase_commitment_stake_count ctxt rollup new_hash + in + (* WARNING: [commitment_storage_size] is a defined constant, and used + to set a bound on the relationship between [max_lookahead], + [commitment_period] and [stake_amount]. Be careful changing this + calculation. *) + let size_diff = + commitment_size_diff + commitment_added_size_diff + + stake_count_size_diff + staker_count_diff + + commitment_count_per_level_size_diff + in + (* First submission adds [commitment_storage_size_in_bytes] or + [commitment_storage_size_in_bytes] - 4 byes to storage, + depending on existence commitment with the same level. + Later submission adds 0 due to content-addressing. *) + let expected_size_diff = + commitment_storage_size_in_bytes - if inbox_level_existed then 4 else 0 + in + assert (Compare.Int.(size_diff = 0 || size_diff = expected_size_diff)) ; + return (new_hash, commitment_added_level, ctxt) + (* See WARNING above. *)) + else + let* () = + (* We reached the LCC, but [staker] is not staked directly on it. + Thus, we backtracked. Note that everyone is staked indirectly on + the LCC. *) + fail_when Commitment_hash.(node = lcc) Sc_rollup_staker_backtracked + in + let* pred, ctxt = + Commitment_storage.get_predecessor_unsafe ctxt rollup node + in + let* _size, ctxt = increase_commitment_stake_count ctxt rollup node in + (go [@ocaml.tailcall]) pred ctxt + in + go Commitment.(commitment.predecessor) ctxt + +let publish_commitment ctxt rollup staker commitment = + let open Lwt_result_syntax in + let* () = + fail_when + Sc_rollup_repr.Number_of_ticks.( + commitment.Commitment.number_of_ticks = zero) + Sc_rollup_zero_tick_commitment + in + let* ctxt, staked_on_opt = Store.Stakers.find (ctxt, rollup) staker in + let* ctxt, balance_updates, staked_on = + match staked_on_opt with + | Some staked_on -> return (ctxt, [], staked_on) + | None -> deposit_stake ctxt rollup staker + in + let+ commitment_hash, ctxt, level = + refine_stake ctxt rollup staker staked_on commitment + in + (commitment_hash, ctxt, level, balance_updates) + +let cement_commitment ctxt rollup new_lcc = + let open Lwt_result_syntax in + let refutation_deadline_blocks = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + (* Calling [last_final_commitment] first to trigger failure in case of + non-existing rollup. *) + let* old_lcc, ctxt = + Commitment_storage.last_cemented_commitment ctxt rollup + in + (* Get is safe, as [Stakers_size] is initialized on origination. *) + let* ctxt, total_staker_count = Store.Staker_count.get ctxt rollup in + let* () = + fail_when Compare.Int32.(total_staker_count <= 0l) Sc_rollup_no_stakers + in + let* new_lcc_commitment, ctxt = + Commitment_storage.get_commitment_unsafe ctxt rollup new_lcc + in + let* () = + fail_when + Commitment_hash.(new_lcc_commitment.predecessor <> old_lcc) + Sc_rollup_parent_not_lcc + in + let* ctxt, commitment_count_for_inbox_level = + Store.Commitment_count_per_inbox_level.get + (ctxt, rollup) + new_lcc_commitment.inbox_level + in + let* () = + fail_when + Compare.Int32.(commitment_count_for_inbox_level <> 1l) + Sc_rollup_disputed + in + let* ctxt, new_lcc_added = + Store.Commitment_added.get (ctxt, rollup) new_lcc + in + let* () = + let current_level = (Raw_context.current_level ctxt).level in + let min_level = + Raw_level_repr.add new_lcc_added refutation_deadline_blocks + in + fail_when + Raw_level_repr.(current_level < min_level) + (Sc_rollup_commitment_too_recent {current_level; min_level}) + in + (* update LCC *) + let* ctxt, lcc_size_diff = + Store.Last_cemented_commitment.update ctxt rollup new_lcc + in + assert (Compare.Int.(lcc_size_diff = 0)) ; + (* At this point we know that all stakers are implicitly staked on the new + LCC, and no one is directly staked on the old LCC. Therefore we can safely + deallocate the metadata ([Commitment_added] and [Commitment_stake_count]) + of the old LCC. + However, we must not remove the commitment itself as we need it to allow + executing outbox messages for a limited period. The maximum number of + active cemented commitments available for execution is specified in + [ctxt.sc_rollup.max_number_of_stored_cemented_commitments]. + Instead, we remove the oldest cemented commitment that would exceed + [max_number_of_cemented_commitments], if such exist. + *) + let* ctxt = deallocate_commitment_metadata ctxt rollup old_lcc in + (* Decrease max_number_of_stored_cemented_commitments by one because + we start counting commitments from old_lcc, rather than from new_lcc. *) + let num_commitments_to_keep = + (Raw_context.constants ctxt).sc_rollup + .max_number_of_stored_cemented_commitments - 1 + in + let* commitment_to_deallocate, ctxt = + find_commitment_to_deallocate ~num_commitments_to_keep ctxt rollup old_lcc + in + match commitment_to_deallocate with + | None -> return (ctxt, new_lcc_commitment) + | Some old_lcc -> + let+ ctxt = deallocate_commitment ctxt rollup old_lcc in + (ctxt, new_lcc_commitment) + +let remove_staker ctxt rollup staker = + let open Lwt_result_syntax in + let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in + let* ctxt, res = Store.Stakers.find (ctxt, rollup) staker in + match res with + | None -> tzfail Sc_rollup_not_staked + | Some staked_on -> + let* () = + fail_when Commitment_hash.(staked_on = lcc) Sc_rollup_remove_lcc + in + let staker_contract, stake = get_contract_and_stake ctxt staker in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let* ctxt, balance_updates = + Token.transfer + ctxt + (`Frozen_bonds (staker_contract, bond_id)) + `Sc_rollup_refutation_punishments + stake + in + let* ctxt, _size_diff = + Store.Stakers.remove_existing (ctxt, rollup) staker + in + let* ctxt = modify_staker_count ctxt rollup Int32.pred in + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4307 + Check value of [max_lookahead_in_blocks] against gas exhaustion + during this function execution. *) + let rec go node ctxt = + (* + + The recursive calls of this function are protected from + infinite recursion because [Commitment_storage] and + [Commitment_stake_count] are using carbonated storage. + + Hence, at each step of the traversal, the gas strictly + decreases. + + *) + if Commitment_hash.(node = lcc) then return ctxt + else + let* pred, ctxt = + Commitment_storage.get_predecessor_unsafe ctxt rollup node + in + let* ctxt = decrease_commitment_stake_count ctxt rollup node in + (go [@ocaml.tailcall]) pred ctxt + in + let+ ctxt = go staked_on ctxt in + (ctxt, balance_updates) + +module Internal_for_tests = struct + let deposit_stake = deposit_stake + + let refine_stake ctxt rollup staker ?staked_on commitment = + let open Lwt_result_syntax in + match staked_on with + | Some staked_on -> refine_stake ctxt rollup staker staked_on commitment + | None -> + (* This allows to call {!refine_stake} without explicitely passing the + staked_on parameter, it's more convenient for tests. However, + it still enforce that {!deposit_stake} was called before. *) + let* _ctxt, staked_on = Store.Stakers.get (ctxt, rollup) staker in + refine_stake ctxt rollup staker staked_on commitment +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.mli new file mode 100644 index 000000000000..3b45cf450c29 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_stake_storage.mli @@ -0,0 +1,259 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [remove_staker context rollup staker] forcibly removes the given [staker] + and confiscates their frozen deposits. + + Any commitments no longer staked on are removed and storage reclaimed by + [remove_staker]. Because of this there is no need to explicitly reject + commitments. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_not_staked] if [staker] is not staked} + {li [Sc_rollup_remove_lcc] if [staker] is staked on a cemented commitment} + } *) +val remove_staker : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** This is a wrapper around [deposit_stake] and [refine_stake] that + deposits a stake and then refines it to the specified commitment, + creating that commitment if necessary. Before calling + [deposit_stake] it checks that the staker is not already staked, and + if so will skip that step and go straight to calling [refine_stake]. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_too_far_ahead] if [staker] would be more than + [sc_rollup_max_future_commitments] ahead of the Last Cemented Commitment} + {li [Sc_rollup_commitment_past_curfew] if current level is + more than {!Constants_storage.sc_rollup_challenge_window_in_blocks} + after the first commit for the same inbox level.} + {li [Sc_rollup_commitment_from_future] if [commitment]'s inbox level is greater than current level + {li [Sc_rollup_bad_inbox_level] if [commitment]'s predecessor is + less than [sc_rollup_commitment_period] blocks ahead} + {li [Sc_rollup_staker_backtracked] if [staker] is not staked on an ancestor + of [commitment]} + {li [Sc_rollup_unknown_commitment] if the parent of the given commitment + does not exist} + {li [Sc_rollup_staker_funds_too_low] if [staker] is not previously a staker, and does not have enough funds + to cover the deposit} + } + + Returns the hash of the given commitment, and the level when the commitment + was first published by some staker. + + This function does not authenticate the staker. *) +val publish_commitment : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + Sc_rollup_commitment_repr.t -> + (Sc_rollup_commitment_repr.Hash.t + * Raw_level_repr.t + * Raw_context.t + * Receipt_repr.balance_updates) + tzresult + Lwt.t + +(** [cement_commitment context rollup commitment] cements the given + commitment whose hash is given (and returns the corresponding commitment). + + Subsequent calls to [refine_stake] and [cement_commitment] must use + a [context] with greater level, or behavior is undefined. + + For cementing to succeed, the following must hold: + {ol + {li The deadline for [commitment] must have passed.} + {li The predecessor of [commitment] must be the Last Cemented Commitment.} + {li There must be at least one staker.} + {li All stakers must be indirectly staked on [commitment].} + } + + If successful, [last_cemented_commitment] is set to the given [commitment] and + the appropriate amount of inbox messages is consumed. The old LCC is also + deallocated. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_unknown_commitment] if [commitment] does not exist} + {li [Sc_rollup_parent_not_lcc] if [commitment] is not the child of the last cemented commitment} + {li [Sc_rollup_commitment_too_recent] if [commitment] has not passed its deadline} + {li [Sc_rollup_no_stakers] if there are zero stakers} + {li [Sc_rollup_disputed] if at least one staker is not staked on [commitment]} + } *) +val cement_commitment : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_commitment_repr.Hash.t -> + (Raw_context.t * Sc_rollup_commitment_repr.t) tzresult Lwt.t + +(** [is_staker ctxt rollup staker] returns [true] iff [staker] has a + deposit on the given [rollup]. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist}} + +*) +val is_staker : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (bool * Raw_context.t) tzresult Lwt.t + +(** [find_staker_unsafe ctxt rollup staker] returns the branch on which the stake + is deposited for the [rollup]'s [staker]. + This function *must* be called only after they have checked for the existence + of the rollup, and therefore it is not necessary for it to check for the + existence of the rollup again. Otherwise, use the safe function + {!find_staker}. + + May fail with [Sc_rollup_not_staked] if [staker] is not staked. *) +val find_staker_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (Sc_rollup_commitment_repr.Hash.t * Raw_context.t) tzresult Lwt.t + +(** Same as {!find_staker_unsafe} but checks for the existence of the [rollup] + before. *) +val find_staker : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (Sc_rollup_commitment_repr.Hash.t * Raw_context.t) tzresult Lwt.t + +(** The storage size requirement (in bytes) of a commitment *) +val commitment_storage_size_in_bytes : int + +(** [withdraw_stake context rollup staker] removes [staker] and returns + any deposit previously frozen by [deposit_stake]. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_not_staked_on_lcc] if [staker] is not staked on the last + cemented commitment} + } + + Note that it is not possible to be staked on a Cemented commitment other + than the Last, because of Cementation Rule #4. See [cement_commitment] + for details. + + By design, the operation wrapping this might {i not} be authenticated, + as it may be necessary for nodes on the honest branch to refund stakers on + the LCC. They must do so by using [withdraw_stake] as they are implicitly + staked on the LCC and can not dispute it. *) +val withdraw_stake : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(**/**) + +module Internal_for_tests : sig + (** [deposit_stake context rollup staker] stakes [staker] at the last + cemented commitment, freezing [sc_rollup_stake_amount] from [staker]'s + account balance. It also returns the last cemented commitment of the + [rollup] on which the staker just deposited. + + Warning: must be called only if [rollup] exists and [staker] is not to be + found in {!Store.Stakers.} + + May fail with: + {ul + {li [Sc_rollup_staker_funds_too_low] if [staker] does not have enough + funds to cover the deposit} + } + + This should usually be followed by [refine_stake] to stake on a + specific commitment. + + This function does not authenticate the staker. *) + val deposit_stake : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + (Raw_context.t + * Receipt_repr.balance_updates + * Sc_rollup_commitment_repr.Hash.t) + tzresult + Lwt.t + + (** [refine_stake context rollup staker ?staked_on commitment] moves the stake + of [staker] on [?staked_on] to [commitment]. The function exposed + in [Internal_for_tests] allows [staked_on] to be [None] and fetches + the real value from the storage, but, the production code uses the + already existing commitment on which the staker is staked. + + Because we do not assume any form of coordination between validators, we + do not distinguish between {i adding new} commitments and {i staking on + existing commitments}. The storage of commitments is content-addressable + to minimize storage duplication. + + Subsequent calls to [refine_stake] and [cement_commitment] must use + a [context] with greater level, or this function call will fail. + + The first time a commitment hash is staked on, it is assigned a deadline, + which is counted in Tezos blocks (levels). Further stakes on the block does + not affect the deadline. The commitment can not be cemented before the + deadline has expired. Note that if a commitment is removed due to disputes + and then re-entered, a later deadline may be assigned. Assuming one honest + staker is always available, this only affects invalid commitments. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + {li [Sc_rollup_too_far_ahead] if [staker] would be more than + [sc_rollup_max_future_commitments] ahead of the Last Cemented Commitment} + {li [Sc_rollup_bad_inbox_level] if [commitment]'s predecessor is + less than [sc_rollup_commitment_period] blocks ahead} + {li [Sc_rollup_not_staked] if [staker] is not staked} + {li [Sc_rollup_staker_backtracked] if [staker] is not staked on an ancestor of [commitment]} + {li [Sc_rollup_unknown_commitment] if the parent of the given commitment does not exist} + } + + Returns the hash of the given commitment. + + This function does not authenticate the staker. *) + val refine_stake : + Raw_context.t -> + Sc_rollup_repr.t -> + Sc_rollup_repr.Staker.t -> + ?staked_on:Sc_rollup_commitment_repr.Hash.t -> + Sc_rollup_commitment_repr.t -> + (Sc_rollup_commitment_repr.Hash.t * Raw_level_repr.t * Raw_context.t) + tzresult + Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.ml new file mode 100644 index 000000000000..7017673bdb6a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.ml @@ -0,0 +1,162 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Sc_rollup_errors +module Store = Storage.Sc_rollup +module Commitment = Sc_rollup_commitment_repr +module Commitment_hash = Commitment.Hash + +(** [address_from_nonce ctxt nonce] produces an address completely determined by + an operation hash and an origination counter, and accounts for gas spent. *) +let address_from_nonce ctxt nonce = + let open Result_syntax in + let* ctxt = + Raw_context.consume_gas ctxt Sc_rollup_costs.Constants.cost_serialize_nonce + in + match Data_encoding.Binary.to_bytes_opt Origination_nonce.encoding nonce with + | None -> error Sc_rollup_address_generation + | Some nonce_bytes -> + let bytes_len = Bytes.length nonce_bytes in + let+ ctxt = + Raw_context.consume_gas + ctxt + (Sc_rollup_costs.cost_hash_bytes ~bytes_len) + in + (ctxt, Sc_rollup_repr.Address.hash_bytes [nonce_bytes]) + +let originate ctxt ~kind ~parameters_ty ~genesis_commitment = + let open Lwt_result_syntax in + let*? ctxt, genesis_commitment_hash = + Sc_rollup_commitment_storage.hash ctxt genesis_commitment + in + let*? ctxt, nonce = Raw_context.increment_origination_nonce ctxt in + let*? ctxt, address = address_from_nonce ctxt nonce in + let* ctxt, pvm_kind_size, _kind_existed = + Store.PVM_kind.add ctxt address kind + in + let origination_level = (Raw_context.current_level ctxt).level in + let* ctxt, genesis_info_size, _info_existed = + Store.Genesis_info.add + ctxt + address + {commitment_hash = genesis_commitment_hash; level = origination_level} + in + let* ctxt, param_ty_size_diff, _added = + Store.Parameters_type.add ctxt address parameters_ty + in + let* ctxt, lcc_size_diff = + Store.Last_cemented_commitment.init ctxt address genesis_commitment_hash + in + let* ctxt, commitment_size_diff, _was_bound = + Store.Commitments.add + (ctxt, address) + genesis_commitment_hash + genesis_commitment + in + (* Those stores [Store.Commitment_added] and [Store.Commitment_stake_count] + are going to be used to look this bootstrap commitment. + This commitment is added here so the + [sc_rollup_state_storage.deallocate] function does not have to handle a + edge case. + *) + let* ctxt, commitment_added_size_diff, _commitment_existed = + Store.Commitment_added.add + (ctxt, address) + genesis_commitment_hash + origination_level + in + (* There is no staker for the genesis_commitment. *) + let* ctxt, commitment_staker_count_size_diff, _commitment_staker_existed = + Store.Commitment_stake_count.add + (ctxt, address) + genesis_commitment_hash + Int32.zero + in + + (* Those stores [Store.Commitment_first_publication_level] and + [Store.Commitment_count_per_inbox_level] are populated with dummy values, + in order the [sc_rollup_state_storage.deallocate_commitment_metadata] + function does not have to handle an edge case of genesis commitment hash. + *) + let* ctxt, commitment_first_publication_level_diff, _existed = + Store.Commitment_first_publication_level.add + (ctxt, address) + origination_level + origination_level + in + let* ctxt, commitment_count_per_inbox_level_diff, _existed = + Store.Commitment_count_per_inbox_level.add + (ctxt, address) + origination_level + Int32.one + in + let* ctxt, stakers_size_diff = Store.Staker_count.init ctxt address 0l in + let addresses_size = 2 * Sc_rollup_repr.Address.size in + let stored_kind_size = 2 (* because tag_size of kind encoding is 16bits. *) in + let origination_size = Constants_storage.sc_rollup_origination_size ctxt in + let size = + Z.of_int + (origination_size + stored_kind_size + addresses_size + lcc_size_diff + + commitment_size_diff + commitment_added_size_diff + + commitment_staker_count_size_diff + + commitment_first_publication_level_diff + + commitment_first_publication_level_diff + + commitment_count_per_inbox_level_diff + stakers_size_diff + + param_ty_size_diff + pvm_kind_size + genesis_info_size) + in + return (address, size, genesis_commitment_hash, ctxt) + +let kind ctxt address = + let open Lwt_result_syntax in + let* ctxt, kind_opt = Store.PVM_kind.find ctxt address in + match kind_opt with + | Some k -> return (ctxt, k) + | None -> tzfail (Sc_rollup_errors.Sc_rollup_does_not_exist address) + +let list_unaccounted ctxt = + let open Lwt_syntax in + let+ res = Store.PVM_kind.keys_unaccounted ctxt in + Result.return res + +let genesis_info ctxt rollup = + let open Lwt_result_syntax in + let* ctxt, genesis_info = Store.Genesis_info.find ctxt rollup in + match genesis_info with + | None -> tzfail (Sc_rollup_does_not_exist rollup) + | Some genesis_info -> return (ctxt, genesis_info) + +let get_metadata ctxt rollup = + let open Lwt_result_syntax in + let* ctxt, genesis_info = genesis_info ctxt rollup in + let metadata : Sc_rollup_metadata_repr.t = + {address = rollup; origination_level = genesis_info.level} + in + return (ctxt, metadata) + +let parameters_type ctxt rollup = + let open Lwt_result_syntax in + let+ ctxt, res = Store.Parameters_type.find ctxt rollup in + (res, ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.mli new file mode 100644 index 000000000000..197ca0b64608 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_storage.mli @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [originate context ~kind ~parameters_ty ~genesis_commitment] produces an + address [a] for a smart contract rollup using the origination nonce found in + [context]. This function also initializes the storage with a new + entry indexed by [a] to remember the [kind] of the rollup at + address [a]. + + Also returns the number of allocated bytes. *) +val originate : + Raw_context.t -> + kind:Sc_rollups.Kind.t -> + parameters_ty:Script_repr.lazy_expr -> + genesis_commitment:Sc_rollup_commitment_repr.t -> + (Sc_rollup_repr.Address.t + * Z.t + * Sc_rollup_commitment_repr.Hash.t + * Raw_context.t) + tzresult + Lwt.t + +(** [kind context address] returns the kind of the given rollup [address] iff + [address] is an existing rollup. Fails with an [Sc_rollup_does_not_exist] + error in case the rollup does not exist. *) +val kind : + Raw_context.t -> + Sc_rollup_repr.t -> + (Raw_context.t * Sc_rollups.Kind.t) tzresult Lwt.t + +val list_unaccounted : Raw_context.t -> Sc_rollup_repr.t list tzresult Lwt.t + +(** [genesis_info ctxt sc_rollup] returns the level at which a [sc_rollup] was + originated, and its genesis commitment hash. *) +val genesis_info : + Raw_context.t -> + Sc_rollup_repr.t -> + (Raw_context.t * Sc_rollup_commitment_repr.genesis_info) tzresult Lwt.t + +(** [get_metadata ctxt rollup] retrieves the origination level of the [rollup] + using {!Sc_rollup_commitment_repr.genesis_info} and creates a + {!Sc_rollup_metadata_repr.t}. + Fails with [Sc_rollup_does_not_exist {rollup}] if the genesis info is + missing. *) +val get_metadata : + Raw_context.t -> + Sc_rollup_repr.t -> + (Raw_context.t * Sc_rollup_metadata_repr.t) tzresult Lwt.t + +(** [parameters_type ctxt rollup] returns the registered type of a rollup. + Returns [None] in case there is no registered type for the rollup. *) +val parameters_type : + Raw_context.t -> + Sc_rollup_repr.t -> + (Script_repr.lazy_expr option * Raw_context.t) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.ml new file mode 100644 index 000000000000..690a612e7fd1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.ml @@ -0,0 +1,69 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Z + +let initial = zero + +let next = succ + +let jump tick z = max initial (add tick z) + +let pp = pp_print + +let encoding = Data_encoding.n + +let distance tick1 tick2 = Z.abs (Z.sub tick1 tick2) + +let of_int x = if Compare.Int.(x < 0) then None else Some (Z.of_int x) + +let to_int x = if Z.fits_int x then Some (Z.to_int x) else None + +let of_z x = x + +let to_z x = x + +let of_number_of_ticks x = + Z.of_int64 (Sc_rollup_repr.Number_of_ticks.to_value x) + +let ( <= ) = leq + +let ( < ) = lt + +let ( >= ) = geq + +let ( > ) = gt + +let ( = ) = equal + +let ( <> ) x y = not (x = y) + +let size_in_bytes tick = + (* Same definition as in {!Michelson_v1_gas}. *) + let bits = numbits tick in + (7 + bits) / 8 + +module Map = Map.Make (Z) diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.mli new file mode 100644 index 000000000000..1344b53f5502 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_tick_repr.mli @@ -0,0 +1,74 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines [Tick.t], an execution step counter for + smart-contract rollups. *) + +(** A tick is a counter for the execution step of a smart-contract rollup. *) +type t + +(** The initial tick. *) +val initial : t + +(** [next tick] returns the counter successor of [tick]. *) +val next : t -> t + +(** [jump tick k] moves [tick] by [k] (possibly negative) steps. + The move stops at [initial] when going back in time. *) +val jump : t -> Z.t -> t + +(** [distance t1 t2] is the absolute value of the difference between [t1] and [t2]. *) +val distance : t -> t -> Z.t + +(** [of_int x] returns [Some tick] for the rollup [x]-th execution + step if [x] is non-negative. Returns [None] otherwise. *) +val of_int : int -> t option + +(** [to_int tick] converts the [tick] into an integer. *) +val to_int : t -> int option + +(** [of_number_of_ticks] converts from the bounded int type defined in + the [Sc_rollup_repr] module. [Number_of_ticks] is used inside of + commitments to limit the maximum possible storage requirement. It is + bounded between one and [max_int] meaning that this can never return + a negative number so an [option] isn't required. *) +val of_number_of_ticks : Sc_rollup_repr.Number_of_ticks.t -> t + +val of_z : Z.t -> t + +val to_z : t -> Z.t + +(** [size_in_bytes tick] is the size in bytes of [tick]'s internal + representation. This function is used by the gas model. *) +val size_in_bytes : t -> int + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +include Compare.S with type t := t + +module Map : Map.S with type key = t diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.ml new file mode 100644 index 000000000000..30df0dfbe716 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.ml @@ -0,0 +1,721 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += WASM_proof_verification_failed + +type error += WASM_proof_production_failed + +type error += WASM_output_proof_production_failed + +type error += WASM_invalid_claim_about_outbox + +type error += WASM_invalid_dissection_distribution + +let () = + let open Data_encoding in + let msg = "Invalid claim about outbox" in + register_error_kind + `Permanent + ~id:"sc_rollup_wasm_invalid_claim_about_outbox" + ~title:msg + ~pp:(fun fmt () -> Format.pp_print_string fmt msg) + ~description:msg + unit + (function WASM_invalid_claim_about_outbox -> Some () | _ -> None) + (fun () -> WASM_invalid_claim_about_outbox) ; + let msg = "Output proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_wasm_output_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function WASM_output_proof_production_failed -> Some () | _ -> None) + (fun () -> WASM_output_proof_production_failed) ; + let msg = "Proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_wasm_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function WASM_proof_production_failed -> Some () | _ -> None) + (fun () -> WASM_proof_production_failed) ; + let msg = + "Invalid dissection distribution: not all ticks are a multiplier of the \ + maximum number of ticks of a snapshot" + in + register_error_kind + `Permanent + ~id:"sc_rollup_wasm_invalid_dissection_distribution" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function WASM_invalid_dissection_distribution -> Some () | _ -> None) + (fun () -> WASM_invalid_dissection_distribution) + +module V2_0_0 = struct + let ticks_per_snapshot = Z.of_int64 11_000_000_000L + + let outbox_validity_period = Int32.of_int 80_640 + + let outbox_message_limit = Z.of_int 100 + + let well_known_reveal_preimage = "" + + let well_known_reveal_hash = + Sc_rollup_reveal_hash.hash_string + ~scheme:Blake2B + [well_known_reveal_preimage] + + (* + This is the state hash of reference that both the prover of the + node and the verifier of the protocol {!Protocol_implementation} + have to agree on (if they do, it means they are using the same + tree structure). + + We have to hard-code this value because the Wasm PVM uses Irmin as + its Merkle proof verification backend, and the economic protocol + cannot create an empty Irmin context. Such a context is required to + create an empty tree, itself required to create the initial state of + the Wasm PVM. + + Utlimately, the value of this constant is decided by the prover of + reference (the only need is for it to be compatible with + {!Protocol_implementation}.) + + Its value is the result of the following snippet + + {| + let*! state = Prover.initial_state context in + Prover.state_hash state + |} + *) + let reference_initial_state_hash = + Sc_rollup_repr.State_hash.of_b58check_exn + "scs11anfGzGUHWbxyaDhYPPE7nntNegMvCFTBcGXuoa3ATg6Mnirwe" + + open Sc_rollup_repr + module PS = Sc_rollup_PVM_sig + + module type TreeS = + Context.TREE with type key = string list and type value = bytes + + module type Make_wasm = module type of Wasm_2_0_0.Make + + module type P = sig + module Tree : TreeS + + type tree = Tree.tree + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> State_hash.t + + val proof_after : proof -> State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t + end + + module type S = sig + include Sc_rollup_PVM_sig.S + + val parse_boot_sector : string -> string option + + val pp_boot_sector : Format.formatter -> string -> unit + + (** [get_tick state] gets the total tick counter for the given PVM state. *) + val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t + + (** PVM status *) + type status = + | Computing + | Waiting_for_input_message + | Waiting_for_reveal of Sc_rollup_PVM_sig.reveal + + (** [get_status state] gives you the current execution status for the PVM. *) + val get_status : state -> status Lwt.t + + val get_outbox : + Raw_level_repr.t -> state -> Sc_rollup_PVM_sig.output list Lwt.t + end + + (* [Make (Make_backend) (Context)] creates a PVM. + + The Make_backend is a functor that creates the backend of the PVM. + The Conext provides the tree and the proof types. + *) + module Make (Make_backend : Make_wasm) (Context : P) : + S + with type context = Context.Tree.t + and type state = Context.tree + and type proof = Context.proof = struct + module Tree = Context.Tree + + type context = Context.Tree.t + + type hash = State_hash.t + + type proof = Context.proof + + let proof_encoding = Context.proof_encoding + + let proof_start_state proof = Context.proof_before proof + + let proof_stop_state proof = Context.proof_after proof + + let parse_boot_sector s = Hex.to_string @@ `Hex s + + let pp_boot_sector fmt s = Format.fprintf fmt "%s" s + + type tree = Tree.tree + + type status = + | Computing + | Waiting_for_input_message + | Waiting_for_reveal of Sc_rollup_PVM_sig.reveal + + module State = struct + type state = tree + + module Monad : sig + type 'a t + + val run : 'a t -> state -> (state * 'a) Lwt.t + + val return : 'a -> 'a t + + module Syntax : sig + val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t + end + + val get : tree t + + val set : tree -> unit t + + val lift : 'a Lwt.t -> 'a t + end = struct + type 'a t = state -> (state * 'a) Lwt.t + + let return x state = Lwt.return (state, x) + + let bind m f state = + let open Lwt_syntax in + let* state, res = m state in + f res state + + module Syntax = struct + let ( let* ) = bind + end + + let run m state = m state + + let get s = Lwt.return (s, s) + + let set s _ = Lwt.return (s, ()) + + let lift m s = Lwt.map (fun r -> (s, r)) m + end + end + + type state = State.state + + module WASM_machine = Make_backend (Tree) + open State + + let pp _state = + Lwt.return @@ fun fmt () -> Format.pp_print_string fmt "<wasm-state>" + + open Monad + + let initial_state ~empty = WASM_machine.initial_state empty + + let install_boot_sector state boot_sector = + WASM_machine.install_boot_sector + ~ticks_per_snapshot + ~outbox_validity_period + ~outbox_message_limit + boot_sector + state + + let state_hash state = + let context_hash = Tree.hash state in + Lwt.return @@ State_hash.context_hash_to_state_hash context_hash + + let result_of m state = + let open Lwt_syntax in + let* _, v = run m state in + return v + + let state_of m state = + let open Lwt_syntax in + let* s, _ = run m state in + return s + + let get_tick : Sc_rollup_tick_repr.t Monad.t = + let open Monad.Syntax in + let* s = get in + let* info = lift (WASM_machine.get_info s) in + return @@ Sc_rollup_tick_repr.of_z info.current_tick + + let get_tick : state -> Sc_rollup_tick_repr.t Lwt.t = result_of get_tick + + let get_status : status Monad.t = + let open Monad.Syntax in + let open Sc_rollup_PVM_sig in + let* s = get in + let* info = lift (WASM_machine.get_info s) in + return + @@ + match info.input_request with + | No_input_required -> Computing + | Input_required -> Waiting_for_input_message + | Reveal_required (Wasm_2_0_0.Reveal_raw_data hash) -> ( + match + Data_encoding.Binary.of_string_opt + Sc_rollup_reveal_hash.encoding + hash + with + | Some hash -> Waiting_for_reveal (Reveal_raw_data hash) + | None -> + (* In case of an invalid hash, the rollup is + blocked. Any commitment will be invalid. *) + Waiting_for_reveal (Reveal_raw_data well_known_reveal_hash)) + | Reveal_required Wasm_2_0_0.Reveal_metadata -> + Waiting_for_reveal Reveal_metadata + + let get_last_message_read : _ Monad.t = + let open Monad.Syntax in + let* s = get in + let* info = lift (WASM_machine.get_info s) in + return + @@ + match info.last_input_read with + | Some {inbox_level; message_counter} -> + let inbox_level = Raw_level_repr.of_int32_non_negative inbox_level in + Some (inbox_level, message_counter) + | _ -> None + + let is_input_state = + let open Monad.Syntax in + let* status = get_status in + match status with + | Waiting_for_input_message -> ( + let* last_read = get_last_message_read in + match last_read with + | Some (level, n) -> return (PS.First_after (level, n)) + | None -> return PS.Initial) + | Computing -> return PS.No_input_required + | Waiting_for_reveal reveal -> return (PS.Needs_reveal reveal) + + let is_input_state = result_of is_input_state + + let get_status : state -> status Lwt.t = result_of get_status + + let get_outbox outbox_level state = + let outbox_level_int32 = + Raw_level_repr.to_int32_non_negative outbox_level + in + let open Lwt_syntax in + let rec aux outbox message_index = + let output = + Wasm_2_0_0.{outbox_level = outbox_level_int32; message_index} + in + let* res = WASM_machine.get_output output state in + match res with + | None -> return (List.rev outbox) + | Some msg -> ( + let serialized = + Sc_rollup_outbox_message_repr.unsafe_of_string msg + in + match Sc_rollup_outbox_message_repr.deserialize serialized with + | Error _ -> + (* The [write_output] host function does not guarantee that the contents + of the returned output is a valid encoding of an outbox message. + We choose to ignore such messages. An alternative choice would be to + craft an output with a payload witnessing the illformedness of the + output produced by the kernel. *) + (aux [@ocaml.tailcall]) outbox (Z.succ message_index) + | Ok message -> + let output = PS.{outbox_level; message_index; message} in + (aux [@ocaml.tailcall]) + (output :: outbox) + (Z.succ message_index)) + in + aux [] Z.zero + + let set_input_state input = + let open Monad.Syntax in + match input with + | PS.Inbox_message input -> + let open PS in + let {inbox_level; message_counter; payload} = input in + let* s = get in + let* s = + lift + (WASM_machine.set_input_step + { + inbox_level = Raw_level_repr.to_int32_non_negative inbox_level; + message_counter; + } + (payload :> string) + s) + in + set s + | PS.Reveal (PS.Raw_data data) -> + let* s = get in + let* s = lift (WASM_machine.reveal_step (Bytes.of_string data) s) in + set s + | PS.Reveal (PS.Metadata metadata) -> + let metadata_bytes = + Data_encoding.Binary.to_bytes_exn + Sc_rollup_metadata_repr.encoding + metadata + in + let* s = get in + let* s = lift (WASM_machine.reveal_step metadata_bytes s) in + set s + | PS.Reveal (PS.Dal_page _content_opt) -> + (* FIXME/DAL: https://gitlab.com/tezos/tezos/-/issues/3927. + Handle DAL pages in wasm PVM. *) + assert false + + let set_input input = state_of @@ set_input_state input + + let eval_step = + let open Monad.Syntax in + let* s = get in + let* s = lift (WASM_machine.compute_step s) in + set s + + let eval state = state_of eval_step state + + let step_transition input_given state = + let open Lwt_syntax in + let* request = is_input_state state in + let* state = + match request with + | PS.No_input_required -> eval state + | _ -> ( + match input_given with + | Some input -> set_input input state + | None -> return state) + in + return (state, request) + + let verify_proof input_given proof = + let open Lwt_result_syntax in + let*! result = Context.verify_proof proof (step_transition input_given) in + match result with + | None -> tzfail WASM_proof_verification_failed + | Some (_state, request) -> return request + + let produce_proof context input_given state = + let open Lwt_result_syntax in + let*! result = + Context.produce_proof context state (step_transition input_given) + in + match result with + | Some (tree_proof, _requested) -> return tree_proof + | None -> tzfail WASM_proof_production_failed + + let verify_origination_proof proof boot_sector = + let open Lwt_syntax in + let before = Context.proof_before proof in + if State_hash.(before <> reference_initial_state_hash) then return false + else + let* result = + Context.verify_proof proof (fun state -> + let* state = install_boot_sector state boot_sector in + return (state, ())) + in + match result with None -> return false | Some (_, ()) -> return true + + let produce_origination_proof context boot_sector = + let open Lwt_result_syntax in + let*! state = initial_state ~empty:(Tree.empty context) in + let*! result = + Context.produce_proof context state (fun state -> + let open Lwt_syntax in + let* state = install_boot_sector state boot_sector in + return (state, ())) + in + match result with + | Some (tree_proof, ()) -> return tree_proof + | None -> tzfail WASM_proof_production_failed + + type output_proof = { + output_proof : Context.proof; + output_proof_state : hash; + output_proof_output : PS.output; + } + + let output_proof_encoding = + let open Data_encoding in + conv + (fun {output_proof; output_proof_state; output_proof_output} -> + (output_proof, output_proof_state, output_proof_output)) + (fun (output_proof, output_proof_state, output_proof_output) -> + {output_proof; output_proof_state; output_proof_output}) + (obj3 + (req "output_proof" Context.proof_encoding) + (req "output_proof_state" State_hash.encoding) + (req "output_proof_output" PS.output_encoding)) + + let output_of_output_proof s = s.output_proof_output + + let state_of_output_proof s = s.output_proof_state + + let has_output : PS.output -> bool Monad.t = function + | {outbox_level; message_index; message} -> ( + let open Monad.Syntax in + let* s = get in + let* result = + lift + (WASM_machine.get_output + { + outbox_level = + Raw_level_repr.to_int32_non_negative outbox_level; + message_index; + } + s) + in + let message_encoded = + Data_encoding.Binary.to_string_exn + Sc_rollup_outbox_message_repr.encoding + message + in + return + @@ + match result with + | Some result -> Compare.String.(result = message_encoded) + | None -> false) + + let verify_output_proof p = + let open Lwt_syntax in + let transition = run @@ has_output p.output_proof_output in + let* result = Context.verify_proof p.output_proof transition in + match result with None -> return false | Some _ -> return true + + let produce_output_proof context state output_proof_output = + let open Lwt_result_syntax in + let*! output_proof_state = state_hash state in + let*! result = + Context.produce_proof context state + @@ run + @@ has_output output_proof_output + in + match result with + | Some (output_proof, true) -> + return {output_proof; output_proof_state; output_proof_output} + | Some (_, false) -> fail WASM_invalid_claim_about_outbox + | None -> fail WASM_output_proof_production_failed + + let check_sections_number ~default_number_of_sections ~number_of_sections + ~dist = + let open Sc_rollup_dissection_chunk_repr in + let is_stop_chunk_aligned = + Compare.Z.(Z.rem dist ticks_per_snapshot = Z.zero) + in + let max_number_of_sections = Z.(div dist ticks_per_snapshot) in + let expected = + Compare.Z.min + (Z.of_int default_number_of_sections) + (if is_stop_chunk_aligned then max_number_of_sections + else Z.succ max_number_of_sections) + in + let given = Z.of_int number_of_sections in + error_unless + Compare.Z.(given = expected) + (Dissection_number_of_sections_mismatch {given; expected}) + + let check_dissection ~default_number_of_sections ~start_chunk ~stop_chunk + dissection = + let open Result_syntax in + let open Sc_rollup_dissection_chunk_repr in + let dist = + Sc_rollup_tick_repr.distance start_chunk.tick stop_chunk.tick + in + (* + We fall back to the default dissection check when the + [kernel_run] culprit has been found and is being dissected. + + This condition will also be met if the PVM is stuck (because + it is unlikely that [ticks_per_snapshot] messages can be + posted in a commitment period), which is OKay because the Fast + Execution cannot be leveraged in that case, which means the + ad-hoc dissection predicate would not provide any speed up. + *) + if Compare.Z.(dist <= ticks_per_snapshot) then + default_check + ~section_maximum_size:Z.(div dist (Z.of_int 2)) + ~check_sections_number:default_check_sections_number + ~default_number_of_sections + ~start_chunk + ~stop_chunk + dissection + else + (* + There are enough ticks to consider that at least one call + to [kernel_run] is involved. + + We now need to consider two cases: either [stop_chunk] is a + multiple of [ticks_per_snapshot] (the PVM is not stuck), or + it is not (the PVM has been stuck during the processing + of one of the ticks of the dissection). + + For the latter case, we want to validate a dissection if + + 1. Every complete [kernel_run] invocations are dissected + as normal in the n-1 first chunks, and + 2. The final section contains all the ticks of the + interrupted [kernel_run]. + *) + let is_stop_chunk_aligned = + Compare.Z.(Z.rem dist ticks_per_snapshot = Z.zero) + in + (* + We keep the same dissection predicate as the default + dissection that a given section cannot be more than half of + the “full distance”, but we only consider the complete + calls to [kernel_run] in the “full distance”. The remainder + ticks will be put in the very last section. + *) + let considered_dist = + if is_stop_chunk_aligned then dist + else + let last_valid_stop_tick = + Sc_rollup_tick_repr.of_z + Z.( + mul + (div + (Sc_rollup_tick_repr.to_z stop_chunk.tick) + ticks_per_snapshot) + ticks_per_snapshot) + in + Sc_rollup_tick_repr.(distance start_chunk.tick last_valid_stop_tick) + in + (* + There is one last corner case to consider: if the stuck + state happens in the second [kernel_run] of the period. + + In this case, the considered distance is equal to the + snapshot size, and divided this value by two means the + maximum size of a section becomes 0. + + So we keep that a section length is at least + [ticks_per_snapshot]. + *) + let section_maximum_size = + Z.max ticks_per_snapshot (Z.div considered_dist (Z.of_int 2)) + in + let* () = + default_check + ~section_maximum_size + ~check_sections_number + ~default_number_of_sections + ~start_chunk + ~stop_chunk + dissection + in + error_unless + (List.for_all + (fun chunk -> + let open Sc_rollup_tick_repr in + Z.( + equal (rem (to_z chunk.tick) ticks_per_snapshot) zero + || Sc_rollup_tick_repr.equal start_chunk.tick chunk.tick + || Sc_rollup_tick_repr.equal stop_chunk.tick chunk.tick)) + dissection) + WASM_invalid_dissection_distribution + + let get_current_level state = + let open Lwt_syntax in + let+ res = result_of get_last_message_read state in + Option.map fst res + + module Internal_for_tests = struct + let insert_failure state = + let add n = Tree.add state ["failures"; string_of_int n] Bytes.empty in + let open Lwt_syntax in + let* n = Tree.length state ["failures"] in + add n + end + end + + module Protocol_implementation = + Make + (Wasm_2_0_0.Make) + (struct + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + end + + type tree = Context.tree + + type proof = Context.Proof.tree Context.Proof.t + + let verify_proof p f = + let open Lwt_option_syntax in + let*? () = + Result.to_option (Context_binary_proof.check_is_binary p) + in + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof _context _state _f = + (* Can't produce proof without full context*) + Lwt.return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = + kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = Context.Proof_encoding.V2.Tree2.tree_proof_encoding + end) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.mli new file mode 100644 index 000000000000..cb2291150b2e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollup_wasm.mli @@ -0,0 +1,137 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module V2_0_0 : sig + (** This module provides Proof-Generating Virtual Machine (PVM) running + WebAssembly (version 2.0.0). *) + + module type S = sig + include Sc_rollup_PVM_sig.S + + (** [parse_boot_sector s] builds a boot sector from its human + writable description. *) + val parse_boot_sector : string -> string option + + (** [pp_boot_sector fmt s] prints a human readable representation of + a boot sector. *) + val pp_boot_sector : Format.formatter -> string -> unit + + (* Required by L2 node: *) + + (** [get_tick state] gets the total tick counter for the given PVM state. *) + val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t + + (** PVM status *) + type status = + | Computing + | Waiting_for_input_message + | Waiting_for_reveal of Sc_rollup_PVM_sig.reveal + + (** [get_status state] gives you the current execution status for the PVM. *) + val get_status : state -> status Lwt.t + + (** [get_outbox outbox_level state] returns the outbox in [state] + for a given [outbox_level]. *) + val get_outbox : + Raw_level_repr.t -> state -> Sc_rollup_PVM_sig.output list Lwt.t + end + + module type P = sig + module Tree : + Context.TREE with type key = string list and type value = bytes + + type tree = Tree.tree + + type proof + + val proof_encoding : proof Data_encoding.t + + val proof_before : proof -> Sc_rollup_repr.State_hash.t + + val proof_after : proof -> Sc_rollup_repr.State_hash.t + + val verify_proof : + proof -> (tree -> (tree * 'a) Lwt.t) -> (tree * 'a) option Lwt.t + + val produce_proof : + Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t + end + + module type Make_wasm = module type of Wasm_2_0_0.Make + + (** Build a WebAssembly PVM using the given proof-supporting context. *) + module Make (Lib_scoru_Wasm : Make_wasm) (Context : P) : + S + with type context = Context.Tree.t + and type state = Context.tree + and type proof = Context.proof + + (** This PVM is used for verification in the Protocol. [produce_proof] always returns [None]. *) + module Protocol_implementation : + S + with type context = Context.t + and type state = Context.tree + and type proof = Context.Proof.tree Context.Proof.t + + (** This is the state hash of reference that both the prover of the + node and the verifier of the protocol {!Protocol_implementation} + have to agree on (if they do, it means they are using the same + tree structure). *) + val reference_initial_state_hash : Sc_rollup_repr.State_hash.t + + (** Number of ticks between snapshotable states, chosen low enough + to maintain refutability. + + {b Warning:} This value is used to specialize the dissection + predicate of the WASM PVM. Do not change it without a migration + plan for already originated smart rollups. + + Depends on + - speed (tick/s) of node in slow mode (from benchmark, 6000000 tick/s) + - the number of ticks in a commitment ({!Int64.max_int}, + as per Number_of_ticks.max_value) + + see #3590 for more pointers *) + val ticks_per_snapshot : Z.t + + (* The number of outboxes to keep, which is for a period of two weeks. For a + block time of 30 seconds, this equals to 2 * 60 * 24 * 14 = 40_320 + blocks. *) + val outbox_validity_period : int32 + + (* Maximum number of outbox messages per level. + + Equals to {Constants_parametric_repr.max_outbox_messages_per_level}. *) + val outbox_message_limit : Z.t + + (** The hash requested by the WASM PVM if it cannot decode the input + provided by the WASM kernel, that is, if the bytes value cannot + be decoded with {!Sc_rollup_reveal_hash.encoding}. *) + val well_known_reveal_hash : Sc_rollup_reveal_hash.t + + (** The preimage of {!well_known_reveal_hash}. *) + val well_known_reveal_preimage : string +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollups.ml b/src/proto_016_PtMumbai/lib_protocol/sc_rollups.ml new file mode 100644 index 000000000000..de63308c7346 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollups.ml @@ -0,0 +1,90 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module PVM = struct + type boot_sector = string + + module type S = sig + val parse_boot_sector : string -> boot_sector option + + val pp_boot_sector : Format.formatter -> boot_sector -> unit + + include Sc_rollup_PVM_sig.S + end + + type ('state, 'proof, 'output) implementation = + (module S + with type state = 'state + and type proof = 'proof + and type output_proof = 'output) + + type t = Packed : ('state, 'proof, 'output) implementation -> t [@@unboxed] +end + +module Kind = struct + (* + Each time we add a data constructor to [t], we also need: + - to extend [Sc_rollups.all] with this new constructor ; + - to update [Sc_rollups.of_name] and [encoding] ; + - to update [Sc_rollups.wrapped_proof] and [wrapped_proof_encoding]. + + *) + type t = Example_arith | Wasm_2_0_0 + + let all = [Example_arith; Wasm_2_0_0] + + let to_string = function + | Example_arith -> "arith" + | Wasm_2_0_0 -> "wasm_2_0_0" + + let of_string = function + | "arith" -> Some Example_arith + | "wasm_2_0_0" -> Some Wasm_2_0_0 + | _ -> None + + let encoding = + Data_encoding.string_enum @@ List.map (fun k -> (to_string k, k)) all + + let pp fmt = function + | Example_arith -> Format.pp_print_string fmt "arith" + | Wasm_2_0_0 -> Format.pp_print_string fmt "wasm_2_0_0" + + let equal x y = + match (x, y) with + | Example_arith, Example_arith -> true + | Wasm_2_0_0, Wasm_2_0_0 -> true + | _ -> false + + let example_arith_pvm = + PVM.Packed (module Sc_rollup_arith.Protocol_implementation) + + let wasm_2_0_0_pvm = + PVM.Packed (module Sc_rollup_wasm.V2_0_0.Protocol_implementation) + + let pvm_of = function + | Example_arith -> example_arith_pvm + | Wasm_2_0_0 -> wasm_2_0_0_pvm +end diff --git a/src/proto_016_PtMumbai/lib_protocol/sc_rollups.mli b/src/proto_016_PtMumbai/lib_protocol/sc_rollups.mli new file mode 100644 index 000000000000..5fa3b57695aa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/sc_rollups.mli @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Here is the list of PVMs available in this protocol. *) + +module PVM : sig + type boot_sector = string + + module type S = sig + val parse_boot_sector : string -> boot_sector option + + val pp_boot_sector : Format.formatter -> boot_sector -> unit + + include Sc_rollup_PVM_sig.S + end + + type ('state, 'proof, 'output) implementation = + (module S + with type state = 'state + and type proof = 'proof + and type output_proof = 'output) + + type t = Packed : ('state, 'proof, 'output) implementation -> t [@@unboxed] +end + +(** A smart contract rollup has a kind, which assigns meaning to + rollup operations. *) +module Kind : sig + (** + + The list of available rollup kinds. + + This list must only be appended for backward compatibility. + *) + type t = Example_arith | Wasm_2_0_0 + + val encoding : t Data_encoding.t + + val equal : t -> t -> bool + + (** [pvm_of kind] returns the [PVM] of the given [kind]. *) + val pvm_of : t -> PVM.t + + (** [all] returns all implemented PVM. *) + val all : t list + + val of_string : string -> t option + + val to_string : t -> string + + val pp : Format.formatter -> t -> unit +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_big_map.ml b/src/proto_016_PtMumbai/lib_protocol/script_big_map.ml new file mode 100644 index 000000000000..a149b8e569a2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_big_map.ml @@ -0,0 +1,92 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* Copyright (c) 2022 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_typed_ir +open Script_ir_translator + +let empty key_type value_type = + Big_map + { + id = None; + diff = {map = Big_map_overlay.empty; size = 0}; + key_type; + value_type; + } + +let mem ctxt key (Big_map {id; diff; key_type; _}) = + hash_comparable_data ctxt key_type key >>=? fun (key_hash, ctxt) -> + match (Big_map_overlay.find key_hash diff.map, id) with + | None, None -> return (false, ctxt) + | None, Some id -> + Alpha_context.Big_map.mem ctxt id key_hash >|=? fun (ctxt, res) -> + (res, ctxt) + | Some (_, None), _ -> return (false, ctxt) + | Some (_, Some _), _ -> return (true, ctxt) + +let get_by_hash ctxt key (Big_map {id; diff; value_type; _}) = + match (Big_map_overlay.find key diff.map, id) with + | Some (_, x), _ -> return (x, ctxt) + | None, None -> return (None, ctxt) + | None, Some id -> ( + Alpha_context.Big_map.get_opt ctxt id key >>=? function + | ctxt, None -> return (None, ctxt) + | ctxt, Some value -> + parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ~allow_forged:true + value_type + (Micheline.root value) + >|=? fun (x, ctxt) -> (Some x, ctxt)) + +let get ctxt key (Big_map {key_type; _} as map) = + hash_comparable_data ctxt key_type key >>=? fun (key_hash, ctxt) -> + get_by_hash ctxt key_hash map + +let update_by_hash key_hash key value (Big_map map) = + let contains = Big_map_overlay.mem key_hash map.diff.map in + Big_map + { + map with + diff = + { + map = Big_map_overlay.add key_hash (key, value) map.diff.map; + size = (if contains then map.diff.size else map.diff.size + 1); + }; + } + +let update ctxt key value (Big_map {key_type; _} as map) = + hash_comparable_data ctxt key_type key >>=? fun (key_hash, ctxt) -> + let map = update_by_hash key_hash key value map in + return (map, ctxt) + +let get_and_update ctxt key value (Big_map {key_type; _} as map) = + hash_comparable_data ctxt key_type key >>=? fun (key_hash, ctxt) -> + let new_map = update_by_hash key_hash key value map in + get_by_hash ctxt key_hash map >>=? fun (old_value, ctxt) -> + return ((old_value, new_map), ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_big_map.mli b/src/proto_016_PtMumbai/lib_protocol/script_big_map.mli new file mode 100644 index 000000000000..62fac92a1846 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_big_map.mli @@ -0,0 +1,83 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* Copyright (c) 2022 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** [empty] is the big map with no bindings. *) +val empty : + 'a Script_typed_ir.comparable_ty -> + ('b, _) Script_typed_ir.ty -> + ('a, 'b) Script_typed_ir.big_map + +(** [mem ctxt key big_map] returns [true] iff [key] is bound in the + given [big_map]. + Consumes the cost of hashing the given key. + Consumes as [Storage.Big_map.Contents.mem] if the key is not bound + yet in the current overlay. *) +val mem : + context -> + 'key -> + ('key, 'value) Script_typed_ir.big_map -> + (bool * context) tzresult Lwt.t + +(** [get ctxt key big_map] returns the value bound by [key] in the + given [big_map]. If the [key] is not bound, [None] is returned instead. + Consumes cost of hashing the given key. + Consumes cost as [Storage.Big_map.Contents.find] in case of the given key + is absent in the current overlay. + Consumes cost of parsing data if the value is readed from storage. *) +val get : + context -> + 'key -> + ('key, 'value) Script_typed_ir.big_map -> + ('value option * context) tzresult Lwt.t + +(** [update ctxt key new_value big_map] updates the value bound by [key] + with [v] if the [new_value] is [Some v]. When the [new_value] is [None], + delete the entire entry bound by [key] in the [big_map]. + Consumes cost for hashing the given key. + See {!get_and_update} for details. *) +val update : + context -> + 'key -> + 'value option -> + ('key, 'value) Script_typed_ir.big_map -> + (('key, 'value) Script_typed_ir.big_map * context) tzresult Lwt.t + +(** [get_and_update ctxt key new_value big_map] works just like + [update ctxt key new_value big_map] except it also returns + the old value bound by [key]. + Consumes cost for hashing the given key. + This does {i not} modify the underlying storage, only the diff table. *) +val get_and_update : + context -> + 'key -> + 'value option -> + ('key, 'value) Script_typed_ir.big_map -> + (('value option * ('key, 'value) Script_typed_ir.big_map) * context) tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_bytes.ml b/src/proto_016_PtMumbai/lib_protocol/script_bytes.ml new file mode 100644 index 000000000000..aa0685a22a6e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_bytes.ml @@ -0,0 +1,204 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Bytes + +let bytes_and = logand + +let bytes_or = logor + +let bytes_xor = logxor + +let bytes_not = lognot + +let bytes_lsl a n = + (* We have to limit the number of shifts for LSL *) + match Script_int.to_int n with + | Some n when Compare.Int.(n <= 64000) -> Some (shift_left a n) + | _ -> None + +let bytes_lsr a n = + (* No limit on the number of shifts for LSR *) + match Script_int.to_int n with + | None -> + (* [LSR bytes max_int] can shift out completely the longest + possible [bytes]. *) + Bytes.empty + | Some n -> shift_right a n + +module Conversion_BE : sig + (** Convert a natural number to bytes using big-endian encoding. + + Returns [None] when the argument is negative. + + Examples: + + - [bytes_of_nat_be (Z.of_int 0x00) = Some Bytes.empty] + - [bytes_of_nat_be (Z.of_int 0x01) = Some (Bytes.of_string "\x01")] + - [bytes_of_nat_be (Z.of_int 0xff) = Some (Bytes.of_string "\xff")] + - [bytes_of_nat_be (Z.of_int 0x100) = Some (Bytes.of_strnig "\x01\x00")] + - [bytes_of_nat_be (Z.of_int (-1)) = None] + *) + val bytes_of_nat_be : Z.t -> bytes option + + (** Convert bytes to a natural number using big-endian encoding. + + Examples: + + - [nat_of_bytes_be Bytes.empty = Z.of_int 0x00] + - [nat_of_bytes_be (Bytes.of_string "\x00") = Z.of_int 0x00] + - [nat_of_bytes_be (Bytes.of_string "\x01") = Z.of_int 0x01] + - [nat_of_bytes_be (Bytes.of_string "\x00\x01") = Z.of_int 0x01] + - [nat_of_bytes_be (Bytes.of_string "\xff") = Z.of_int 0xff] + - [nat_of_bytes_be (Bytes.of_string "\x00\x00\xff") = Z.of_int 0xff] + - [nat_of_bytes_be (Bytes.of_string "\x01\x00") = Z.of_int 0x0100] + *) + val nat_of_bytes_be : bytes -> Z.t + + (** Convert an integer to bytes using big-endian encoding. + Negative numbers are handled by two's-complement. + + Examples: + + - [bytes_of_int_be (Z.of_int 0x00) = Bytes.empty] + - [bytes_of_int_be (Z.of_int 0x01) = Bytes.of_string "\x01"] + - [bytes_of_int_be (Z.of_int 0x7f) = Bytes.of_string "\x7f"] + - [bytes_of_int_be (Z.of_int (-0x80)) = Bytes.of_string "\x80"] + - [bytes_of_int_be (Z.of_int 0x80) = Bytes.of_string "\x00\x80"] (not ["\x80"]) + - [bytes_of_int_be (Z.of_int (-0x81)) = Bytes.of_string "\xff\x7f"] (not ["\x7f"]) + - [bytes_of_int_be (Z.of_int 0x8000) = Bytes.of_string "\x00\x80\x00"], (not ["\x80\x00"]) + *) + val bytes_of_int_be : Z.t -> bytes + + (** Convert bytes to an integer using big-endian encoding. + Negative numbers are handled by two's-complement. + + Examples: + + - [int_of_bytes_be Bytes.empty = Z.of_int 0x00] + - [int_of_bytes_be (Bytes.of_string "\x01") = Z.of_int 0x01] + - [int_of_bytes_be (Bytes.of_string "\x00\x01") = Z.of_int 0x01] + - [int_of_bytes_be (Bytes.of_string "\x7f") = Z.of_int 0x7f] + - [int_of_bytes_be (Bytes.of_string "\x00\x7f") = Z.of_int 0x7f] + - [int_of_bytes_be (Bytes.of_string "\x80") = Z.of_int (-0x80)] (not [0x80]) + - [int_of_bytes_be (Bytes.of_string "\xff\x80") = Z.of_int (-0x80)] + - [int_of_bytes_be (Bytes.of_string "\xff\x8f") = Z.of_int (-0x81)] + *) + val int_of_bytes_be : bytes -> Z.t +end = struct + let encode_nat_be nbytes default z = + (* [nbytes] is the exact number of the bytes to encode [z]. + + When encoding an integer to bytes, it is first converted to + a natural number using 2's complement, and then sent to this function. + [default] is the prefix byte which may be required for the integer + encoding. [Some '\000'] when the integer is zero or positive. + [Some '\255'] when negative. + *) + assert (Compare.Z.(z >= Z.zero)) ; + (* [Z.to_bits] encodes zero and positive numbers in the little endian. + The result string can be zero trailed to make its length multiple + of 4 or 8. + *) + let string_le = Z.to_bits z in + let slen = String.length string_le in + (* If [slen = nbytes]: + string_le aabbcc + the final output ccbbaa + + else if [slen > nbytes]: + string_le aabbcc0000 + the final output ccbbaa + + else if [slen < nbytes] and [default= Some DD]: + This is to encode an integer which requires an extra byte. + string_le aabbcc + encoded DDccbbaa + + otherwise: error, which should not happen. + *) + Bytes.init nbytes (fun i -> + let j = nbytes - i - 1 in + if Compare.Int.(j >= slen) then + Option.value_f default ~default:(fun () -> + assert false (* it never happens *)) + else string_le.[j]) + + let bytes_of_nat_be z = + match Z.compare z Z.zero with + | -1 -> None + | 0 -> Some Bytes.empty + | _ -> + let nbits = Z.log2up (Z.succ z) in + let nbytes = (nbits + 7) / 8 in + Some (encode_nat_be nbytes None z) + + let bytes_of_int_be z = + match Z.compare z Z.zero with + | 0 -> Bytes.empty + | 1 -> + let nbits = Z.log2up (Z.succ z) + 1 (* The top bit must be 0 *) in + let nbytes = (nbits + 7) / 8 in + encode_nat_be nbytes (Some '\000') z + | _ -> + let nbits = Z.log2up Z.(neg z) + 1 (* The top bit must be 1 *) in + let nbytes = (nbits + 7) / 8 in + let nbits' = nbytes * 8 in + let z'' = Z.(add (shift_left one nbits') z) in + encode_nat_be nbytes (Some '\255') z'' + + let nat_of_bytes_be bytes = + (* [Z.of_bits] ignores trailing zeros *) + let len = Bytes.length bytes in + (* Z.of_bits uses little-endian encoding but we want a big-endian + encoding so we reverse [bytes] while converting it to `string`. *) + Z.of_bits @@ String.init len (fun i -> Bytes.get bytes (len - i - 1)) + + let int_of_bytes_be bytes = + let nbytes = Bytes.length bytes in + if Compare.Int.(nbytes = 0) then Z.zero + else + let top_bit = Compare.Int.(Char.code (Bytes.get bytes 0) land 128 <> 0) in + if top_bit then + (* negative *) + let z = nat_of_bytes_be bytes in + let nbits = nbytes * 8 in + Z.(sub z (shift_left one nbits)) + else nat_of_bytes_be bytes +end + +open Script_int + +let bytes_of_nat_be (n : n num) = + (* The function always succeeds since the argument is 0 or positive *) + match Conversion_BE.bytes_of_nat_be @@ to_zint n with + | Some bytes -> bytes + | None -> assert false + +let nat_of_bytes_be b = abs @@ of_zint @@ Conversion_BE.nat_of_bytes_be b + +let bytes_of_int_be (z : z num) = Conversion_BE.bytes_of_int_be @@ to_zint z + +let int_of_bytes_be b = of_zint @@ Conversion_BE.int_of_bytes_be b diff --git a/src/proto_016_PtMumbai/lib_protocol/script_bytes.mli b/src/proto_016_PtMumbai/lib_protocol/script_bytes.mli new file mode 100644 index 000000000000..c37bccfe4a63 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_bytes.mli @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda.jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Semantics of logical and bit-shift operators for bytes *) + +(** [bytes_or a b] returns the logical or'ed bytes of [a] and [b]. + If the arguments have different lengths, the shorter one is 0-padded + on the left before the logical operation. For example: + + 0x1200 OR 0x34 = 0x1200 OR 0x0034 = 0x1234 + 0x0012 OR 0xff = 0x0012 OR 0x00ff = 0x00ff (instead of 0xff) +*) +val bytes_or : bytes -> bytes -> bytes + +(** [bytes_and a b] returns the logical and'ed bytes of [a] and [b]. + If the arguments have different lengths, the prefix of the longer one + is removed to have the same length as the shorter one before the logical + operation. For example: + + 0x1234 AND 0x30 = 0x34 AND 0x30 = 0x30 + 0x12f00f AND 0x0fff = 0xf00f AND 0x0fff = 0x000f (instead of 0x0f) +*) +val bytes_and : bytes -> bytes -> bytes + +(** [bytes_xor a b] returns the logical xor'ed bytes of [a] and [b]. + If the arguments have different lengths, the shorter one is 0-padded + on the left before the logical operation. For example: + + 0x1200 XOR 0x34 = 0x1200 XOR 0x0034 = 0x1234 + 0x0012 XOR 0xff = 0x0012 XOR 0x00ff = 0x00ed (instead of 0xed) +*) +val bytes_xor : bytes -> bytes -> bytes + +(** [bytes_not a] returns the logical not'ed bytes of [a] with the same + length of [a]. For example: + + NOT 0xff00 = 0x00ff (instead of 0xff) +*) +val bytes_not : bytes -> bytes + +(** [bytes_lsl bytes bits] returns the [bits] left shifted bytes of [bytes]. + If [bits] is more than 64000, it returns [None]. + + The function always returns a longer bytes of the input if [bits] + is not 0. For example: + + 0x12 LSL 1 = 0x0024 (instead of 0x24) + 0x0012 LSL 9 = 0x00002400 (instead of 0x002400 or 0x2400) +*) +val bytes_lsl : bytes -> Script_int.n Script_int.num -> bytes option + +(** [bytes_lsr bytes bits] returns the [bits] right shifted bytes of [bytes]. + + 0x1234 LSR 1 = 0x091a + 0x1234 LSR 8 = 0x12 (instead of 0x0012) +*) +val bytes_lsr : bytes -> Script_int.n Script_int.num -> bytes + +(** Convert a natural number to bytes using big-endian encoding. *) +val bytes_of_nat_be : Script_int.n Script_int.num -> bytes + +(** Convert bytes to a natural number using big-endian encoding. *) +val nat_of_bytes_be : bytes -> Script_int.n Script_int.num + +(** Convert an integer to bytes using big-endian encoding. + Negative numbers are handled by two's-complement. *) +val bytes_of_int_be : Script_int.z Script_int.num -> bytes + +(** Convert bytes to an integer using big-endian encoding. + Negative numbers are handled by two's-complement. *) +val int_of_bytes_be : bytes -> Script_int.z Script_int.num + +module Conversion_BE : sig + val bytes_of_nat_be : Z.t -> bytes option + + val nat_of_bytes_be : bytes -> Z.t + + val bytes_of_int_be : Z.t -> bytes + + val int_of_bytes_be : bytes -> Z.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_cache.ml b/src/proto_016_PtMumbai/lib_protocol/script_cache.ml new file mode 100644 index 000000000000..ce6e55771ac9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_cache.ml @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type identifier = string + +let identifier_of_contract addr = Contract_hash.to_b58check addr + +let contract_of_identifier identifier = + match Contract_hash.of_b58check_opt identifier with + | Some addr -> Ok addr + | None -> error (Contract_repr.Invalid_contract_notation identifier) + +type cached_contract = Script.t * Script_ir_translator.ex_script + +let load_and_elaborate ctxt addr = + Contract.get_script ctxt addr >>=? fun (ctxt, script) -> + match script with + | None -> return (ctxt, None) + | Some script -> + Script_ir_translator.( + parse_script + ctxt + script + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ~allow_forged_in_storage:true + >>=? fun (ex_script, ctxt) -> + (* We consume gas after the fact in order to not have to instrument + [script_size] (for efficiency). + This is safe, as we already pay gas proportional to storage size + in [parse_script] beforehand. *) + let size, cost = script_size ex_script in + Gas.consume ctxt cost >>?= fun ctxt -> + return (ctxt, Some (script, ex_script, size))) + +module Client = struct + type cached_value = cached_contract + + let namespace = Cache.create_namespace "contract" + + let cache_index = 0 + + let value_of_identifier ctxt identifier = + (* + + I/O, deserialization, and elaboration of contracts scripts + are cached. + + *) + contract_of_identifier identifier >>?= fun addr -> + load_and_elaborate ctxt addr >>=? function + | _, None -> + (* [value_of_identifier ctxt k] is applied to identifiers stored + in the cache. Only script-based contracts that have been + executed are in the cache. Hence, [get_script] always + succeeds for these identifiers if [ctxt] and the [cache] are + properly synchronized by the shell. *) + failwith "Script_cache: Inconsistent script cache." + | _, Some (unparsed_script, ir_script, _) -> + return (unparsed_script, ir_script) +end + +module Cache = (val Cache.register_exn (module Client)) + +let find ctxt addr = + let identifier = identifier_of_contract addr in + Cache.find ctxt identifier >>=? function + | Some (unparsed_script, ex_script) -> + return (ctxt, identifier, Some (unparsed_script, ex_script)) + | None -> ( + load_and_elaborate ctxt addr >>=? function + | ctxt, None -> return (ctxt, identifier, None) + | ctxt, Some (unparsed_script, script_ir, size) -> + let cached_value = (unparsed_script, script_ir) in + Lwt.return + ( Cache.update ctxt identifier (Some (cached_value, size)) + >>? fun ctxt -> + ok (ctxt, identifier, Some (unparsed_script, script_ir)) )) + +let update ctxt identifier updated_script approx_size = + Cache.update ctxt identifier (Some (updated_script, approx_size)) + +let entries ctxt = + Cache.list_identifiers ctxt + |> List.map_e @@ fun (identifier, age) -> + contract_of_identifier identifier >|? fun contract -> (contract, age) + +let contract_rank ctxt addr = + Cache.identifier_rank ctxt (identifier_of_contract addr) + +let size = Cache.size + +let size_limit = Cache.size_limit + +let insert ctxt addr updated_script approx_size = + let identifier = identifier_of_contract addr in + Cache.update ctxt identifier (Some (updated_script, approx_size)) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_cache.mli b/src/proto_016_PtMumbai/lib_protocol/script_cache.mli new file mode 100644 index 000000000000..03a856926c38 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_cache.mli @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module manages the cache for smart contracts. + + This cache must be consistent with the on-disk representation + of the smart contracts. In particular, [update] must be called + each time a contract storage is updated. + +*) + +open Alpha_context + +(** Each cached script has a unique identifier in the cache. *) +type identifier + +(** The cache holds the unparsed and the internal representation of + the contract. *) +type cached_contract = Script.t * Script_ir_translator.ex_script + +(** [find ctxt contract] returns [(ctxt', identifier, script)] where: + - [ctxt'] is [ctxt] with less gas; + - [identifier] is the identifier identifying the [contract] in the cache; + - [script = None] if there is no such contract in [ctxt]; + - [script = Some (unparsed_script, ir_script)] where + - [unparsed_script] is the contract source code and storage; + - [script_ir] is a typed internal representation of the contract, i.e., + the abstract syntax tree of its code as well as its storage. + + This function consumes gas depending on the cache. If the contract is not + in the cache, then the function also consumes the gas of [Contract.get_script] + and [Script_ir_translator.parse_script]. *) +val find : + context -> + Contract_hash.t -> + (context * identifier * cached_contract option) tzresult Lwt.t + +(** [update ctxt identifier unparsed_script ir_script size] refreshes the + cached contract identified by [identifier] with a new [unparsed_script], + a new [ir_script], and a new size. *) +val update : context -> identifier -> cached_contract -> int -> context tzresult + +(** [entries ctxt] returns the contracts in the cache as well as their + respective size. The list is sorted by date of last modification: + the least recently updated entry comes first. *) +val entries : context -> (Contract_hash.t * int) list tzresult + +(** [contract_rank ctxt contract] returns the number of contracts + older than [contract] in the cache of [ctxt]. This function + returns [None] if [contract] does not exist in the cache of + [ctxt]. *) +val contract_rank : context -> Contract_hash.t -> int option + +(** [size ctxt] is an overapproximation of the cache size in + memory (in bytes). *) +val size : context -> int + +(** [size_limit ctxt] is the maximal size of the cache (in bytes). *) +val size_limit : context -> int + +(** [insert] is a variant of [update] which identifies the contract to update + by its address (of type [Contract_hash.t]) instead of its cache identifier. *) +val insert : + context -> Contract_hash.t -> cached_contract -> int -> context tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/script_comparable.ml b/src/proto_016_PtMumbai/lib_protocol/script_comparable.ml new file mode 100644 index 000000000000..2156d26610b5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_comparable.ml @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_typed_ir + +let compare_address {destination = destination1; entrypoint = entrypoint1} + {destination = destination2; entrypoint = entrypoint2} = + let lres = Destination.compare destination1 destination2 in + if Compare.Int.(lres = 0) then Entrypoint.compare entrypoint1 entrypoint2 + else lres + +let compare_tx_rollup_l2_address = Tx_rollup_l2_address.Indexable.compare_values + +type compare_comparable_cont = + | Compare_comparable : + 'a comparable_ty * 'a * 'a * compare_comparable_cont + -> compare_comparable_cont + | Compare_comparable_return : compare_comparable_cont + +let compare_comparable : type a. a comparable_ty -> a -> a -> int = + let rec compare_comparable : + type a. a comparable_ty -> compare_comparable_cont -> a -> a -> int = + fun kind k x y -> + match (kind, x, y) with + | Unit_t, (), () -> (apply [@tailcall]) 0 k + | Never_t, _, _ -> . + | Signature_t, x, y -> (apply [@tailcall]) (Script_signature.compare x y) k + | String_t, x, y -> (apply [@tailcall]) (Script_string.compare x y) k + | Bool_t, x, y -> (apply [@tailcall]) (Compare.Bool.compare x y) k + | Mutez_t, x, y -> (apply [@tailcall]) (Tez.compare x y) k + | Key_hash_t, x, y -> + (apply [@tailcall]) (Signature.Public_key_hash.compare x y) k + | Key_t, x, y -> (apply [@tailcall]) (Signature.Public_key.compare x y) k + | Int_t, x, y -> (apply [@tailcall]) (Script_int.compare x y) k + | Nat_t, x, y -> (apply [@tailcall]) (Script_int.compare x y) k + | Timestamp_t, x, y -> (apply [@tailcall]) (Script_timestamp.compare x y) k + | Address_t, x, y -> (apply [@tailcall]) (compare_address x y) k + | Tx_rollup_l2_address_t, x, y -> + (apply [@tailcall]) (compare_tx_rollup_l2_address x y) k + | Bytes_t, x, y -> (apply [@tailcall]) (Compare.Bytes.compare x y) k + | Chain_id_t, x, y -> (apply [@tailcall]) (Script_chain_id.compare x y) k + | Pair_t (tl, tr, _, YesYes), (lx, rx), (ly, ry) -> + (compare_comparable [@tailcall]) + tl + (Compare_comparable (tr, rx, ry, k)) + lx + ly + | Union_t (tl, _, _, YesYes), L x, L y -> + (compare_comparable [@tailcall]) tl k x y + | Union_t _, L _, R _ -> -1 + | Union_t _, R _, L _ -> 1 + | Union_t (_, tr, _, YesYes), R x, R y -> + (compare_comparable [@tailcall]) tr k x y + | Option_t _, None, None -> (apply [@tailcall]) 0 k + | Option_t _, None, Some _ -> -1 + | Option_t _, Some _, None -> 1 + | Option_t (t, _, Yes), Some x, Some y -> + (compare_comparable [@tailcall]) t k x y + and apply ret k = + match (ret, k) with + | 0, Compare_comparable (ty, x, y, k) -> + (compare_comparable [@tailcall]) ty k x y + | 0, Compare_comparable_return -> 0 + | ret, _ -> + (* ret <> 0, we perform an early exit *) + if Compare.Int.(ret > 0) then 1 else -1 + in + fun t -> compare_comparable t Compare_comparable_return diff --git a/src/proto_016_PtMumbai/lib_protocol/script_comparable.mli b/src/proto_016_PtMumbai/lib_protocol/script_comparable.mli new file mode 100644 index 000000000000..70c1f809d41f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_comparable.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val compare_comparable : 'a Script_typed_ir.comparable_ty -> 'a -> 'a -> int + +val compare_address : Script_typed_ir.address -> Script_typed_ir.address -> int + +val compare_tx_rollup_l2_address : + Script_typed_ir.tx_rollup_l2_address -> + Script_typed_ir.tx_rollup_l2_address -> + int diff --git a/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.ml b/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.ml new file mode 100644 index 000000000000..4b26c6d4234d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let script_expr_hash = "\013\044\064\027" (* expr(54) *) + +module H = + Blake2B.Make + (Base58) + (struct + let name = "script_expr" + + let title = "A script expression ID" + + let b58check_prefix = script_expr_hash + + let size = None + end) + +include H +include Path_encoding.Make_hex (H) + +let () = Base58.check_encoded_prefix b58check_encoding "expr" 54 diff --git a/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.mli b/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.mli new file mode 100644 index 000000000000..8ba38e2eaaf5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_expr_hash.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing Michelson expressions. *) + +include S.HASH + +include Path_encoding.S with type t := t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_int.ml b/src/proto_016_PtMumbai/lib_protocol/script_int.ml new file mode 100644 index 000000000000..0fe44ad35b49 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_int.ml @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type n = Natural_tag + +type z = Integer_tag + +(* We could define `num` as a GADT with constructors for `n` and `z`. + This would enable factorizing the code a bit in the Michelson interpreter and + also make formal the claim that `num` is only instantiated with `n` and `z`, + but it would result in space and time overheads when manipulating `num`s, by + having to deconstruct to and reconstruct from `Z.t`. *) +type 't repr = Z.t + +type 't num = Num_tag of 't repr [@@ocaml.unboxed] + +let compare (Num_tag x) (Num_tag y) = Z.compare x y + +let zero = Num_tag Z.zero + +let one = Num_tag Z.one + +let zero_n = Num_tag Z.zero + +let one_n = Num_tag Z.one + +let to_string (Num_tag x) = Z.to_string x + +let of_string s = Option.catch (fun () -> Num_tag (Z.of_string s)) + +let of_int32 n = Num_tag (Z.of_int64 @@ Int64.of_int32 n) + +let to_int64 (Num_tag x) = Option.catch (fun () -> Z.to_int64 x) + +let of_int64 n = Num_tag (Z.of_int64 n) + +let to_int (Num_tag x) = Option.catch (fun () -> Z.to_int x) + +let of_int n = Num_tag (Z.of_int n) + +let of_zint x = Num_tag x + +let to_zint (Num_tag x) = x + +let add (Num_tag x) (Num_tag y) = Num_tag (Z.add x y) + +let sub (Num_tag x) (Num_tag y) = Num_tag (Z.sub x y) + +let mul (Num_tag x) (Num_tag y) = Num_tag (Z.mul x y) + +let ediv (Num_tag x) (Num_tag y) = + let ediv_tagged x y = + let quo, rem = Z.ediv_rem x y in + (Num_tag quo, Num_tag rem) + in + Option.catch (fun () -> ediv_tagged x y) + +let add_n = add + +let succ_n (Num_tag x) = Num_tag (Z.succ x) + +let mul_n = mul + +let ediv_n = ediv + +let abs (Num_tag x) = Num_tag (Z.abs x) + +let is_nat (Num_tag x) = + if Compare.Z.(x < Z.zero) then None else Some (Num_tag x) + +let neg (Num_tag x) = Num_tag (Z.neg x) + +let int (Num_tag x) = Num_tag x + +let shift_left (Num_tag x) (Num_tag y) = + if Compare.Int.(Z.compare y (Z.of_int 256) > 0) then None + else + let y = Z.to_int y in + Some (Num_tag (Z.shift_left x y)) + +let shift_right (Num_tag x) (Num_tag y) = + if Compare.Int.(Z.compare y (Z.of_int 256) > 0) then None + else + let y = Z.to_int y in + Some (Num_tag (Z.shift_right x y)) + +let shift_left_n = shift_left + +let shift_right_n = shift_right + +let logor (Num_tag x) (Num_tag y) = Num_tag (Z.logor x y) + +let logxor (Num_tag x) (Num_tag y) = Num_tag (Z.logxor x y) + +let logand (Num_tag x) (Num_tag y) = Num_tag (Z.logand x y) + +let lognot (Num_tag x) = Num_tag (Z.lognot x) + +let z_encoding : z num Data_encoding.encoding = + Data_encoding.(conv (fun (Num_tag z) -> z) (fun z -> Num_tag z) z) + +let n_encoding : n num Data_encoding.encoding = + Data_encoding.(conv (fun (Num_tag n) -> n) (fun n -> Num_tag n) n) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_int.mli b/src/proto_016_PtMumbai/lib_protocol/script_int.mli new file mode 100644 index 000000000000..53b8416f0d7a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_int.mli @@ -0,0 +1,169 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The types for arbitrary precision integers in Michelson. + The type variable ['t] is always [n] or [z], + [n num] and [z num] are incompatible. + + This is internally a [Z.t]. + This module mostly adds signedness preservation guarantees. *) +type 't repr + +(** [num] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) +type 't num = Num_tag of 't repr [@@ocaml.unboxed] + +(** Flag for natural numbers. *) +type n = Natural_tag + +(** Flag for relative numbers. *) +type z = Integer_tag + +(** Natural zero. *) +val zero_n : n num + +(** Natural one. *) +val one_n : n num + +(** Natural successor. + + [succ_n x] is the same as [add_n one_n]. + *) +val succ_n : n num -> n num + +(** Relative zero. *) +val zero : z num + +(** Relative one. *) +val one : z num + +(** Compare two numbers as if they were *) +val compare : 'a num -> 'a num -> int + +(** Conversion to an OCaml [string] in decimal notation. *) +val to_string : _ num -> string + +(** Conversion from an OCaml [string]. + Returns [None] in case of an invalid notation. + Supports [+] and [-] sign modifiers, and [0x], [0o] and [0b] base modifiers. *) +val of_string : string -> z num option + +(** Conversion from an OCaml [int32]. *) +val of_int32 : int32 -> z num + +(** Conversion to an OCaml [int64], returns [None] on overflow. *) +val to_int64 : _ num -> int64 option + +(** Conversion from an OCaml [int64]. *) +val of_int64 : int64 -> z num + +(** Conversion to an OCaml [int], returns [None] on overflow. *) +val to_int : _ num -> int option + +(** Conversion from an OCaml [int]. *) +val of_int : int -> z num + +(** Conversion from a Zarith integer ([Z.t]). *) +val of_zint : Z.t -> z num + +(** Conversion to a Zarith integer ([Z.t]). *) +val to_zint : 'a num -> Z.t + +(** Addition between naturals. *) +val add_n : n num -> n num -> n num + +(** Multiplication with a natural. *) +val mul_n : n num -> 'a num -> 'a num + +(** Euclidean division of a natural. + [ediv_n n d] returns [None] if divisor is zero, + or [Some (q, r)] where [n = d * q + r] and [[0 <= r < d]] otherwise. *) +val ediv_n : n num -> 'a num -> ('a num * n num) option + +(** Sign agnostic addition. + Use {!add_n} when working with naturals to preserve the sign. *) +val add : _ num -> _ num -> z num + +(** Sign agnostic subtraction. + Use {!sub_n} when working with naturals to preserve the sign. *) +val sub : _ num -> _ num -> z num + +(** Sign agnostic multiplication. + Use {!mul_n} when working with a natural to preserve the sign. *) +val mul : _ num -> _ num -> z num + +(** Sign agnostic euclidean division. + [ediv n d] returns [None] if divisor is zero, + or [Some (q, r)] where [n = d * q + r] and [[0 <= r < |d|]] otherwise. + Use {!ediv_n} when working with a natural to preserve the sign. *) +val ediv : _ num -> _ num -> (z num * n num) option + +(** Compute the absolute value of a relative, turning it into a natural. *) +val abs : z num -> n num + +(** Partial identity over [N]. *) +val is_nat : z num -> n num option + +(** Negates a number. *) +val neg : _ num -> z num + +(** Turns a natural into a relative, not changing its value. *) +val int : n num -> z num + +(** Reverses each bit in the representation of the number. + Also applies to the sign. *) +val lognot : _ num -> z num + +(** Shifts the natural to the left of a number of bits between 0 and 256. + Returns [None] if the amount is too high. *) +val shift_left_n : n num -> n num -> n num option + +(** Shifts the natural to the right of a number of bits between 0 and 256. + Returns [None] if the amount is too high. *) +val shift_right_n : n num -> n num -> n num option + +(** Shifts the number to the left of a number of bits between 0 and 256. + Returns [None] if the amount is too high. *) +val shift_left : 'a num -> n num -> 'a num option + +(** Shifts the number to the right of a number of bits between 0 and 256. + Returns [None] if the amount is too high. *) +val shift_right : 'a num -> n num -> 'a num option + +(** Applies a boolean or operation to each bit. *) +val logor : 'a num -> 'a num -> 'a num + +(** Applies a boolean and operation to each bit. *) +val logand : _ num -> n num -> n num + +(** Applies a boolean xor operation to each bit. *) +val logxor : n num -> n num -> n num + +(** Naturals are encoded using Data_encoding.n *) +val n_encoding : n num Data_encoding.encoding + +(** Integers are encoded using Data_encoding.z *) +val z_encoding : z num Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/script_interpreter.ml b/src/proto_016_PtMumbai/lib_protocol/script_interpreter.ml new file mode 100644 index 000000000000..27b95ce059fe --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_interpreter.ml @@ -0,0 +1,1909 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* + + This module implements an interpreter for Michelson. It takes the + form of a [step] function that interprets script instructions in a + dedicated abstract machine. + + The interpreter is written in a small-step style: an execution + [step] only interprets a single instruction by updating the + configuration of a dedicated abstract machine. + + This abstract machine has two components: + + - a stack to control which instructions must be executed ; and + + - a stack of values where instructions get their inputs and put + their outputs. + + In addition, the machine has access to effectful primitives to + interact with the execution environment (e.g. the Tezos + node). These primitives live in the [Lwt+State+Error] monad. Hence, + this interpreter produces a computation in the [Lwt+State+Error] + monad. + + This interpreter enjoys the following properties: + + - The interpreter is tail-recursive, hence it is robust to stack + overflow. This property is checked by the compiler thanks to the + [@ocaml.tailcall] annotation of each recursive call. + + - The interpreter is type-preserving. Thanks to GADTs, the typing + rules of Michelson are statically checked by the OCaml typechecker: + a Michelson program cannot go wrong. + + - The interpreter is tagless. Thanks to GADTs, the exact shape of + the stack is known statically so the interpreter does not have to + check that the input stack has the shape expected by the + instruction to be executed. + + Outline + ======= + + This file is organized as follows: + + 1. Definition of runtime errors. + + 2. Interpretation loop: This is the main functionality of this + module, aka the [step] function. + + 3. Interface functions: This part of the module builds high-level + functions on top of the more basic [step] function. + + Auxiliary definitions can be found in {!Script_interpreter_defs}. + + Implementation details are explained along the file. + +*) + +open Alpha_context +open Script_typed_ir +open Script_ir_translator +open Local_gas_counter +open Script_interpreter_defs +module S = Saturation_repr + +type step_constants = Script_typed_ir.step_constants = { + source : Contract.t; + payer : Signature.public_key_hash; + self : Contract_hash.t; + amount : Tez.t; + balance : Tez.t; + chain_id : Chain_id.t; + now : Script_timestamp.t; + level : Script_int.n Script_int.num; +} + +(* ---- Run-time errors -----------------------------------------------------*) + +type error += Reject of Script.location * Script.expr * execution_trace option + +type error += Overflow of Script.location * execution_trace option + +type error += Runtime_contract_error of Contract_hash.t + +type error += Bad_contract_parameter of Contract.t (* `Permanent *) + +type error += Cannot_serialize_failure + +type error += Cannot_serialize_storage + +type error += Michelson_too_many_recursive_calls + +let () = + let open Data_encoding in + let trace_encoding : Script_typed_ir.execution_trace encoding = + list + @@ obj3 + (req "location" Script.location_encoding) + (req "gas" Gas.Arith.z_fp_encoding) + (req "stack" (list Script.expr_encoding)) + in + (* Reject *) + register_error_kind + `Temporary + ~id:"michelson_v1.script_rejected" + ~title:"Script failed" + ~description:"A FAILWITH instruction was reached" + (obj3 + (req "location" Script.location_encoding) + (req "with" Script.expr_encoding) + (opt "trace" trace_encoding)) + (function Reject (loc, v, trace) -> Some (loc, v, trace) | _ -> None) + (fun (loc, v, trace) -> Reject (loc, v, trace)) ; + (* Overflow *) + register_error_kind + `Temporary + ~id:"michelson_v1.script_overflow" + ~title:"Script failed (overflow error)" + ~description: + "A FAIL instruction was reached due to the detection of an overflow" + (obj2 + (req "location" Script.location_encoding) + (opt "trace" trace_encoding)) + (function Overflow (loc, trace) -> Some (loc, trace) | _ -> None) + (fun (loc, trace) -> Overflow (loc, trace)) ; + (* Runtime contract error *) + register_error_kind + `Temporary + ~id:"michelson_v1.runtime_error" + ~title:"Script runtime error" + ~description:"Toplevel error for all runtime script errors" + (obj2 + (req "contract_handle" Contract.originated_encoding) + (req "contract_code" (constant "Deprecated"))) + (function + | Runtime_contract_error contract -> Some (contract, ()) | _ -> None) + (fun (contract, ()) -> Runtime_contract_error contract) ; + (* Bad contract parameter *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_contract_parameter" + ~title:"Contract supplied an invalid parameter" + ~description: + "Either no parameter was supplied to a contract with a non-unit \ + parameter type, a non-unit parameter was passed to an account, or a \ + parameter was supplied of the wrong type" + Data_encoding.(obj1 (req "contract" Contract.encoding)) + (function Bad_contract_parameter c -> Some c | _ -> None) + (fun c -> Bad_contract_parameter c) ; + (* Cannot serialize failure *) + register_error_kind + `Temporary + ~id:"michelson_v1.cannot_serialize_failure" + ~title:"Not enough gas to serialize argument of FAILWITH" + ~description: + "Argument of FAILWITH was too big to be serialized with the provided gas" + Data_encoding.empty + (function Cannot_serialize_failure -> Some () | _ -> None) + (fun () -> Cannot_serialize_failure) ; + (* Cannot serialize storage *) + register_error_kind + `Temporary + ~id:"michelson_v1.cannot_serialize_storage" + ~title:"Not enough gas to serialize execution storage" + ~description: + "The returned storage was too big to be serialized with the provided gas" + Data_encoding.empty + (function Cannot_serialize_storage -> Some () | _ -> None) + (fun () -> Cannot_serialize_storage) + +(* + + Interpretation loop + =================== + +*) + +(* + + As announced earlier, the [step] function produces a computation in + the [Lwt+State+Error] monad. The [State] monad is implemented by + having the [context] passed as input and returned updated as + output. The [Error] monad is represented by the [tzresult] type + constructor. + + The [step] function is actually defined as an internal + tail-recursive routine of the toplevel [step]. It monitors the gas + level before executing the instruction under focus, once this is + done, it recursively calls itself on the continuation held by the + current instruction. + + For each pure instruction (i.e. that is not monadic), the + interpretation simply updates the input arguments of the [step] + function. Since these arguments are (most likely) stored in + hardware registers and since the tail-recursive calls are compiled + into direct jumps, this interpretation technique offers good + performances while saving safety thanks to a rich typing. + + For each impure instruction, the interpreter makes use of monadic + bindings to compose monadic primitives with the [step] function. + Again, we make sure that the recursive calls to [step] are tail + calls by annotating them with [@ocaml.tailcall]. + + The [step] function is actually based on several mutually + recursive functions that can be separated in two groups: the first + group focuses on the evaluation of continuations while the second + group is about evaluating the instructions. + +*) + +module Raw = struct + (* + + Evaluation of continuations + =========================== + + As explained in [Script_typed_ir], there are several kinds of + continuations, each having a specific evaluation rules. The + following group of functions starts with a list of evaluation + rules for continuations that generate fresh continuations. This + group ends with the definition of [next], which dispatches + evaluation rules depending on the continuation at stake. + + Some of these functions generate fresh continuations. As such, they + expect a constructor [instrument] which inserts a [KLog] if the + evaluation is logged. + + *) + let rec kmap_exit : + type a b c e f m n o. (a, b, c, e, f, m, n, o) kmap_exit_type = + fun instrument g gas body xs ty ys yk ks accu stack -> + let ys = Script_map.update yk (Some accu) ys in + let ks = instrument @@ KMap_enter_body (body, xs, ys, ty, ks) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and kmap_enter : + type a b c d f i j k. (a, b, c, d, f, i, j, k) kmap_enter_type = + fun instrument g gas body xs ty ys ks accu stack -> + match xs with + | [] -> (next [@ocaml.tailcall]) g gas ks ys (accu, stack) + | (xk, xv) :: xs -> + let ks = instrument @@ KMap_exit_body (body, xs, ys, xk, ty, ks) in + let res = (xk, xv) in + let stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas body ks res stack + [@@inline] + + and klist_exit : type a b c d e i j. (a, b, c, d, e, i, j) klist_exit_type = + fun instrument g gas body xs ys ty len ks accu stack -> + let ys = Script_list.cons accu ys in + let ks = instrument @@ KList_enter_body (body, xs, ys, ty, len, ks) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and klist_enter : type a b c d e f j. (a, b, c, d, e, f, j) klist_enter_type = + fun instrument g gas body xs ys ty len ks' accu stack -> + match xs with + | [] -> + let ys = Script_list.rev ys in + (next [@ocaml.tailcall]) g gas ks' ys (accu, stack) + | x :: xs -> + let ks = instrument @@ KList_exit_body (body, xs, ys, ty, len, ks') in + (step [@ocaml.tailcall]) g gas body ks x (accu, stack) + [@@inline] + + and kloop_in_left : + type a b c d e f g. (a, b, c, d, e, f, g) kloop_in_left_type = + fun g gas ks0 ki ks' accu stack -> + match accu with + | L v -> (step [@ocaml.tailcall]) g gas ki ks0 v stack + | R v -> (next [@ocaml.tailcall]) g gas ks' v stack + [@@inline] + + and kloop_in : type a b c r f s. (a, b, c, r, f, s) kloop_in_type = + fun g gas ks0 ki ks' accu stack -> + let accu', stack' = stack in + if accu then (step [@ocaml.tailcall]) g gas ki ks0 accu' stack' + else (next [@ocaml.tailcall]) g gas ks' accu' stack' + [@@inline] + + and kiter : type a b s r f c. (a, b, s, r, f, c) kiter_type = + fun instrument g gas body ty xs ks accu stack -> + match xs with + | [] -> (next [@ocaml.tailcall]) g gas ks accu stack + | x :: xs -> + let ks = instrument @@ KIter (body, ty, xs, ks) in + (step [@ocaml.tailcall]) g gas body ks x (accu, stack) + [@@inline] + + and next : + type a s r f. + outdated_context * step_constants -> + local_gas_counter -> + (a, s, r, f) continuation -> + a -> + s -> + (r * f * outdated_context * local_gas_counter) tzresult Lwt.t = + fun ((ctxt, _) as g) gas ks0 accu stack -> + match consume_control gas ks0 with + | None -> tzfail Gas.Operation_quota_exceeded + | Some gas -> ( + match ks0 with + | KLog (ks, sty, logger) -> + (logger.klog [@ocaml.tailcall]) logger g gas sty ks0 ks accu stack + | KNil -> Lwt.return (Ok (accu, stack, ctxt, gas)) + | KCons (k, ks) -> (step [@ocaml.tailcall]) g gas k ks accu stack + | KLoop_in (ki, ks') -> + (kloop_in [@ocaml.tailcall]) g gas ks0 ki ks' accu stack + | KReturn (stack', _, ks) -> + (next [@ocaml.tailcall]) g gas ks accu stack' + | KMap_head (f, ks) -> (next [@ocaml.tailcall]) g gas ks (f accu) stack + | KLoop_in_left (ki, ks') -> + (kloop_in_left [@ocaml.tailcall]) g gas ks0 ki ks' accu stack + | KUndip (x, _, ks) -> (next [@ocaml.tailcall]) g gas ks x (accu, stack) + | KIter (body, ty, xs, ks) -> + (kiter [@ocaml.tailcall]) id g gas body ty xs ks accu stack + | KList_enter_body (body, xs, ys, ty, len, ks) -> + (klist_enter [@ocaml.tailcall]) + id + g + gas + body + xs + ys + ty + len + ks + accu + stack + | KList_exit_body (body, xs, ys, ty, len, ks) -> + (klist_exit [@ocaml.tailcall]) + id + g + gas + body + xs + ys + ty + len + ks + accu + stack + | KMap_enter_body (body, xs, ys, ty, ks) -> + (kmap_enter [@ocaml.tailcall]) id g gas body xs ty ys ks accu stack + | KMap_exit_body (body, xs, ys, yk, ty, ks) -> + (kmap_exit [@ocaml.tailcall]) + id + g + gas + body + xs + ty + ys + yk + ks + accu + stack + | KView_exit (orig_step_constants, ks) -> + let g = (fst g, orig_step_constants) in + (next [@ocaml.tailcall]) g gas ks accu stack) + + (* + + Evaluation of instructions + ========================== + + The following functions define evaluation rules for instructions that + generate fresh continuations. As such, they expect a constructor + [instrument] which inserts a [KLog] if the evaluation is logged. + + The [step] function is taking care of the evaluation of the other + instructions. + +*) + and ilist_map : + type a b c d e f g h i. (a, b, c, d, e, f, g, h, i) ilist_map_type = + fun instrument g gas body k ks ty accu stack -> + let xs = accu.elements in + let ys = Script_list.empty in + let len = accu.length in + let ks = + instrument @@ KList_enter_body (body, xs, ys, ty, len, KCons (k, ks)) + in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and ilist_iter : + type a b c d e f g cmp. (a, b, c, d, e, f, g, cmp) ilist_iter_type = + fun instrument g gas body ty k ks accu stack -> + let xs = accu.elements in + let ks = instrument @@ KIter (body, ty, xs, KCons (k, ks)) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and iset_iter : type a b c d e f g. (a, b, c, d, e, f, g) iset_iter_type = + fun instrument g gas body ty k ks accu stack -> + let set = accu in + let l = List.rev (Script_set.fold (fun e acc -> e :: acc) set []) in + let ks = instrument @@ KIter (body, ty, l, KCons (k, ks)) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and imap_map : + type a b c d e f g h i j. (a, b, c, d, e, f, g, h, i, j) imap_map_type = + fun instrument g gas body k ks ty accu stack -> + let map = accu in + let xs = List.rev (Script_map.fold (fun k v a -> (k, v) :: a) map []) in + let ys = Script_map.empty_from map in + let ks = instrument @@ KMap_enter_body (body, xs, ys, ty, KCons (k, ks)) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and imap_iter : + type a b c d e f g h cmp. (a, b, c, d, e, f, g, h, cmp) imap_iter_type = + fun instrument g gas body ty k ks accu stack -> + let map = accu in + let l = List.rev (Script_map.fold (fun k v a -> (k, v) :: a) map []) in + let ks = instrument @@ KIter (body, ty, l, KCons (k, ks)) in + let accu, stack = stack in + (next [@ocaml.tailcall]) g gas ks accu stack + [@@inline] + + and imul_teznat : type a b c d e f. (a, b, c, d, e, f) imul_teznat_type = + fun logger g gas loc k ks accu stack -> + let x = accu in + let y, stack = stack in + match Script_int.to_int64 y with + | None -> get_log logger >>=? fun log -> tzfail (Overflow (loc, log)) + | Some y -> + Tez.(x *? y) >>?= fun res -> + (step [@ocaml.tailcall]) g gas k ks res stack + + and imul_nattez : type a b c d e f. (a, b, c, d, e, f) imul_nattez_type = + fun logger g gas loc k ks accu stack -> + let y = accu in + let x, stack = stack in + match Script_int.to_int64 y with + | None -> get_log logger >>=? fun log -> tzfail (Overflow (loc, log)) + | Some y -> + Tez.(x *? y) >>?= fun res -> + (step [@ocaml.tailcall]) g gas k ks res stack + + and ilsl_nat : type a b c d e f. (a, b, c, d, e, f) ilsl_nat_type = + fun logger g gas loc k ks accu stack -> + let x = accu and y, stack = stack in + match Script_int.shift_left_n x y with + | None -> get_log logger >>=? fun log -> tzfail (Overflow (loc, log)) + | Some x -> (step [@ocaml.tailcall]) g gas k ks x stack + + and ilsr_nat : type a b c d e f. (a, b, c, d, e, f) ilsr_nat_type = + fun logger g gas loc k ks accu stack -> + let x = accu and y, stack = stack in + match Script_int.shift_right_n x y with + | None -> get_log logger >>=? fun log -> tzfail (Overflow (loc, log)) + | Some r -> (step [@ocaml.tailcall]) g gas k ks r stack + + and ilsl_bytes : type a b c d e f. (a, b, c, d, e, f) ilsl_bytes_type = + fun logger g gas loc k ks accu stack -> + let x = accu and y, stack = stack in + match Script_bytes.bytes_lsl x y with + | None -> get_log logger >>=? fun log -> tzfail (Overflow (loc, log)) + | Some res -> (step [@ocaml.tailcall]) g gas k ks res stack + + and ifailwith : ifailwith_type = + { + ifailwith = + (fun logger (ctxt, _) gas kloc tv accu -> + let v = accu in + let ctxt = update_context gas ctxt in + trace Cannot_serialize_failure (unparse_data ctxt Optimized tv v) + >>=? fun (v, _ctxt) -> + get_log logger >>=? fun log -> tzfail (Reject (kloc, v, log))); + } + + and iexec : type a b c d e f g. (a, b, c, d, e, f, g) iexec_type = + fun instrument logger g gas cont_sty k ks accu stack -> + let arg = accu and code, stack = stack in + let log_code b = + let body = + match logger with + | None -> b.kinstr + | Some logger -> logger.log_kinstr logger b.kbef b.kinstr + in + let ks = instrument @@ KReturn (stack, cont_sty, KCons (k, ks)) in + (body, ks) + in + match code with + | Lam (body, _) -> + let body, ks = log_code body in + (step [@ocaml.tailcall]) g gas body ks arg (EmptyCell, EmptyCell) + | LamRec (body, _) -> + let body, ks = log_code body in + (step [@ocaml.tailcall]) g gas body ks arg (code, (EmptyCell, EmptyCell)) + + and iview : type a b c d e f i o. (a, b, c, d, e, f, i, o) iview_type = + fun instrument + (ctxt, sc) + gas + (View_signature {name; input_ty; output_ty}) + stack_ty + k + ks + accu + stack -> + let input = accu in + let addr, stack = stack in + let ctxt = update_context gas ctxt in + let return_none ctxt = + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks None stack + in + let legacy = Script_ir_translator_config.make ~legacy:true () in + match addr.destination with + | Contract (Implicit _) | Tx_rollup _ | Sc_rollup _ | Zk_rollup _ -> + (return_none [@ocaml.tailcall]) ctxt + | Contract (Originated contract_hash as c) -> ( + Contract.get_script ctxt contract_hash >>=? fun (ctxt, script_opt) -> + match script_opt with + | None -> (return_none [@ocaml.tailcall]) ctxt + | Some script -> ( + parse_script + ~elab_conf:legacy + ~allow_forged_in_storage:true + ctxt + script + >>=? fun (Ex_script (Script {storage; storage_type; views; _}), ctxt) + -> + Gas.consume ctxt (Interp_costs.view_get name views) >>?= fun ctxt -> + match Script_map.get name views with + | None -> (return_none [@ocaml.tailcall]) ctxt + | Some view -> ( + let view_result = + Script_ir_translator.parse_view + ctxt + ~elab_conf:legacy + storage_type + view + in + trace_eval + (fun () -> + Script_tc_errors.Ill_typed_contract + (Micheline.strip_locations view.view_code, [])) + view_result + >>=? fun ( Typed_view + { + input_ty = input_ty'; + output_ty = output_ty'; + kinstr; + original_code_expr = _; + }, + ctxt ) -> + let io_ty = + let open Gas_monad.Syntax in + let* out_eq = + ty_eq ~error_details:Fast output_ty' output_ty + in + let+ in_eq = ty_eq ~error_details:Fast input_ty input_ty' in + (out_eq, in_eq) + in + Gas_monad.run ctxt io_ty >>?= fun (eq, ctxt) -> + match eq with + | Error Inconsistent_types_fast -> + (return_none [@ocaml.tailcall]) ctxt + | Ok (Eq, Eq) -> + let kcons = KCons (ICons_some (kinstr_location k, k), ks) in + Contract.get_balance_carbonated ctxt c + >>=? fun (ctxt, balance) -> + let gas, ctxt = + local_gas_counter_and_outdated_context ctxt + in + let sty = + Option.map (fun t -> Item_t (output_ty, t)) stack_ty + in + (step [@ocaml.tailcall]) + ( ctxt, + { + source = Contract.Originated sc.self; + self = contract_hash; + amount = Tez.zero; + balance; + (* The following remain unchanged, but let's + list them anyway, so that we don't forget + to update something added later. *) + payer = sc.payer; + chain_id = sc.chain_id; + now = sc.now; + level = sc.level; + } ) + gas + kinstr + (instrument + @@ KView_exit (sc, KReturn (stack, sty, kcons))) + (input, storage) + (EmptyCell, EmptyCell)))) + + and step : type a s b t r f. (a, s, b, t, r, f) step_type = + fun ((ctxt, sc) as g) gas i ks accu stack -> + match consume_instr gas i accu stack with + | None -> tzfail Gas.Operation_quota_exceeded + | Some gas -> ( + match i with + | ILog (_, sty, event, logger, k) -> + (logger.ilog [@ocaml.tailcall]) + logger + event + sty + g + gas + k + ks + accu + stack + | IHalt _ -> (next [@ocaml.tailcall]) g gas ks accu stack + (* stack ops *) + | IDrop (_, k) -> + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IDup (_, k) -> (step [@ocaml.tailcall]) g gas k ks accu (accu, stack) + | ISwap (_, k) -> + let top, stack = stack in + (step [@ocaml.tailcall]) g gas k ks top (accu, stack) + | IConst (_, _ty, v, k) -> + (step [@ocaml.tailcall]) g gas k ks v (accu, stack) + (* options *) + | ICons_some (_, k) -> + (step [@ocaml.tailcall]) g gas k ks (Some accu) stack + | ICons_none (_, _ty, k) -> + (step [@ocaml.tailcall]) g gas k ks None (accu, stack) + | IIf_none {branch_if_none; branch_if_some; k; _} -> ( + match accu with + | None -> + let accu, stack = stack in + (step [@ocaml.tailcall]) + g + gas + branch_if_none + (KCons (k, ks)) + accu + stack + | Some v -> + (step [@ocaml.tailcall]) + g + gas + branch_if_some + (KCons (k, ks)) + v + stack) + | IOpt_map {body; k; loc = _} -> ( + match accu with + | None -> (step [@ocaml.tailcall]) g gas k ks None stack + | Some v -> + let ks' = KMap_head (Option.some, KCons (k, ks)) in + (step [@ocaml.tailcall]) g gas body ks' v stack) + (* pairs *) + | ICons_pair (_, k) -> + let b, stack = stack in + (step [@ocaml.tailcall]) g gas k ks (accu, b) stack + | IUnpair (_, k) -> + let a, b = accu in + (step [@ocaml.tailcall]) g gas k ks a (b, stack) + | ICar (_, k) -> + let a, _ = accu in + (step [@ocaml.tailcall]) g gas k ks a stack + | ICdr (_, k) -> + let _, b = accu in + (step [@ocaml.tailcall]) g gas k ks b stack + (* unions *) + | ICons_left (_, _tyb, k) -> + (step [@ocaml.tailcall]) g gas k ks (L accu) stack + | ICons_right (_, _tya, k) -> + (step [@ocaml.tailcall]) g gas k ks (R accu) stack + | IIf_left {branch_if_left; branch_if_right; k; _} -> ( + match accu with + | L v -> + (step [@ocaml.tailcall]) + g + gas + branch_if_left + (KCons (k, ks)) + v + stack + | R v -> + (step [@ocaml.tailcall]) + g + gas + branch_if_right + (KCons (k, ks)) + v + stack) + (* lists *) + | ICons_list (_, k) -> + let tl, stack = stack in + let accu = Script_list.cons accu tl in + (step [@ocaml.tailcall]) g gas k ks accu stack + | INil (_, _ty, k) -> + let stack = (accu, stack) in + let accu = Script_list.empty in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IIf_cons {branch_if_cons; branch_if_nil; k; _} -> ( + match Script_list.uncons accu with + | None -> + let accu, stack = stack in + (step [@ocaml.tailcall]) + g + gas + branch_if_nil + (KCons (k, ks)) + accu + stack + | Some (hd, tl) -> + (step [@ocaml.tailcall]) + g + gas + branch_if_cons + (KCons (k, ks)) + hd + (tl, stack)) + | IList_map (_, body, ty, k) -> + (ilist_map [@ocaml.tailcall]) id g gas body k ks ty accu stack + | IList_size (_, k) -> + let list = accu in + let len = Script_int.(abs (of_int list.length)) in + (step [@ocaml.tailcall]) g gas k ks len stack + | IList_iter (_, ty, body, k) -> + (ilist_iter [@ocaml.tailcall]) id g gas body ty k ks accu stack + (* sets *) + | IEmpty_set (_, ty, k) -> + let res = Script_set.empty ty in + let stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks res stack + | ISet_iter (_, ty, body, k) -> + (iset_iter [@ocaml.tailcall]) id g gas body ty k ks accu stack + | ISet_mem (_, k) -> + let set, stack = stack in + let res = Script_set.mem accu set in + (step [@ocaml.tailcall]) g gas k ks res stack + | ISet_update (_, k) -> + let presence, (set, stack) = stack in + let res = Script_set.update accu presence set in + (step [@ocaml.tailcall]) g gas k ks res stack + | ISet_size (_, k) -> + let res = Script_set.size accu in + (step [@ocaml.tailcall]) g gas k ks res stack + (* maps *) + | IEmpty_map (_, kty, _vty, k) -> + let res = Script_map.empty kty and stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMap_map (_, ty, body, k) -> + (imap_map [@ocaml.tailcall]) id g gas body k ks ty accu stack + | IMap_iter (_, kvty, body, k) -> + (imap_iter [@ocaml.tailcall]) id g gas body kvty k ks accu stack + | IMap_mem (_, k) -> + let map, stack = stack in + let res = Script_map.mem accu map in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMap_get (_, k) -> + let map, stack = stack in + let res = Script_map.get accu map in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMap_update (_, k) -> + let v, (map, stack) = stack in + let key = accu in + let res = Script_map.update key v map in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMap_get_and_update (_, k) -> + let key = accu in + let v, (map, rest) = stack in + let map' = Script_map.update key v map in + let v' = Script_map.get key map in + (step [@ocaml.tailcall]) g gas k ks v' (map', rest) + | IMap_size (_, k) -> + let res = Script_map.size accu in + (step [@ocaml.tailcall]) g gas k ks res stack + (* Big map operations *) + | IEmpty_big_map (_, tk, tv, k) -> + let ebm = Script_big_map.empty tk tv in + (step [@ocaml.tailcall]) g gas k ks ebm (accu, stack) + | IBig_map_mem (_, k) -> + let map, stack = stack in + let key = accu in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + Script_big_map.mem ctxt key map ) + >>=? fun (res, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks res stack + | IBig_map_get (_, k) -> + let map, stack = stack in + let key = accu in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + Script_big_map.get ctxt key map ) + >>=? fun (res, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks res stack + | IBig_map_update (_, k) -> + let key = accu in + let maybe_value, (map, stack) = stack in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + Script_big_map.update ctxt key maybe_value map ) + >>=? fun (big_map, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks big_map stack + | IBig_map_get_and_update (_, k) -> + let key = accu in + let v, (map, stack) = stack in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + Script_big_map.get_and_update ctxt key v map ) + >>=? fun ((v', map'), ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks v' (map', stack) + (* timestamp operations *) + | IAdd_seconds_to_timestamp (_, k) -> + let n = accu in + let t, stack = stack in + let result = Script_timestamp.add_delta t n in + (step [@ocaml.tailcall]) g gas k ks result stack + | IAdd_timestamp_to_seconds (_, k) -> + let t = accu in + let n, stack = stack in + let result = Script_timestamp.add_delta t n in + (step [@ocaml.tailcall]) g gas k ks result stack + | ISub_timestamp_seconds (_, k) -> + let t = accu in + let s, stack = stack in + let result = Script_timestamp.sub_delta t s in + (step [@ocaml.tailcall]) g gas k ks result stack + | IDiff_timestamps (_, k) -> + let t1 = accu in + let t2, stack = stack in + let result = Script_timestamp.diff t1 t2 in + (step [@ocaml.tailcall]) g gas k ks result stack + (* string operations *) + | IConcat_string_pair (_, k) -> + let x = accu in + let y, stack = stack in + let s = Script_string.concat_pair x y in + (step [@ocaml.tailcall]) g gas k ks s stack + | IConcat_string (_, k) -> + let ss = accu in + (* The cost for this fold_left has been paid upfront *) + let total_length = + List.fold_left + (fun acc s -> S.add acc (S.safe_int (Script_string.length s))) + S.zero + ss.elements + in + consume gas (Interp_costs.concat_string total_length) + >>?= fun gas -> + let s = Script_string.concat ss.elements in + (step [@ocaml.tailcall]) g gas k ks s stack + | ISlice_string (_, k) -> + let offset = accu and length, (s, stack) = stack in + let s_length = Z.of_int (Script_string.length s) in + let offset = Script_int.to_zint offset in + let length = Script_int.to_zint length in + if Compare.Z.(offset < s_length && Z.add offset length <= s_length) + then + let s = Script_string.sub s (Z.to_int offset) (Z.to_int length) in + (step [@ocaml.tailcall]) g gas k ks (Some s) stack + else (step [@ocaml.tailcall]) g gas k ks None stack + | IString_size (_, k) -> + let s = accu in + let result = Script_int.(abs (of_int (Script_string.length s))) in + (step [@ocaml.tailcall]) g gas k ks result stack + (* bytes operations *) + | IConcat_bytes_pair (_, k) -> + let x = accu in + let y, stack = stack in + let s = Bytes.cat x y in + (step [@ocaml.tailcall]) g gas k ks s stack + | IConcat_bytes (_, k) -> + let ss = accu in + (* The cost for this fold_left has been paid upfront *) + let total_length = + List.fold_left + (fun acc s -> S.add acc (S.safe_int (Bytes.length s))) + S.zero + ss.elements + in + consume gas (Interp_costs.concat_string total_length) + >>?= fun gas -> + let s = Bytes.concat Bytes.empty ss.elements in + (step [@ocaml.tailcall]) g gas k ks s stack + | ISlice_bytes (_, k) -> + let offset = accu and length, (s, stack) = stack in + let s_length = Z.of_int (Bytes.length s) in + let offset = Script_int.to_zint offset in + let length = Script_int.to_zint length in + if Compare.Z.(offset < s_length && Z.add offset length <= s_length) + then + let s = Bytes.sub s (Z.to_int offset) (Z.to_int length) in + (step [@ocaml.tailcall]) g gas k ks (Some s) stack + else (step [@ocaml.tailcall]) g gas k ks None stack + | IBytes_size (_, k) -> + let s = accu in + let result = Script_int.(abs (of_int (Bytes.length s))) in + (step [@ocaml.tailcall]) g gas k ks result stack + | ILsl_bytes (loc, k) -> ilsl_bytes None g gas loc k ks accu stack + | ILsr_bytes (_, k) -> + let x = accu and y, stack = stack in + let res = Script_bytes.bytes_lsr x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IOr_bytes (_, k) -> + let x = accu and y, stack = stack in + let res = Script_bytes.bytes_or x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAnd_bytes (_, k) -> + let x = accu and y, stack = stack in + let res = Script_bytes.bytes_and x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IXor_bytes (_, k) -> + let x = accu and y, stack = stack in + let res = Script_bytes.bytes_xor x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | INot_bytes (_, k) -> + let x = accu in + let res = Script_bytes.bytes_not x in + (step [@ocaml.tailcall]) g gas k ks res stack + | IBytes_nat (_, k) -> + let n = accu in + let result = Script_bytes.bytes_of_nat_be n in + (step [@ocaml.tailcall]) g gas k ks result stack + | INat_bytes (_, k) -> + let s = accu in + let result = Script_bytes.nat_of_bytes_be s in + (step [@ocaml.tailcall]) g gas k ks result stack + | IBytes_int (_, k) -> + let n = accu in + let result = Script_bytes.bytes_of_int_be n in + (step [@ocaml.tailcall]) g gas k ks result stack + | IInt_bytes (_, k) -> + let s = accu in + let result = Script_bytes.int_of_bytes_be s in + (step [@ocaml.tailcall]) g gas k ks result stack + (* currency operations *) + | IAdd_tez (_, k) -> + let x = accu in + let y, stack = stack in + Tez.(x +? y) >>?= fun res -> + (step [@ocaml.tailcall]) g gas k ks res stack + | ISub_tez (_, k) -> + let x = accu in + let y, stack = stack in + let res = Tez.sub_opt x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | ISub_tez_legacy (_, k) -> + let x = accu in + let y, stack = stack in + Tez.(x -? y) >>?= fun res -> + (step [@ocaml.tailcall]) g gas k ks res stack + | IMul_teznat (loc, k) -> imul_teznat None g gas loc k ks accu stack + | IMul_nattez (loc, k) -> imul_nattez None g gas loc k ks accu stack + (* boolean operations *) + | IOr (_, k) -> + let x = accu in + let y, stack = stack in + (step [@ocaml.tailcall]) g gas k ks (x || y) stack + | IAnd (_, k) -> + let x = accu in + let y, stack = stack in + (step [@ocaml.tailcall]) g gas k ks (x && y) stack + | IXor (_, k) -> + let x = accu in + let y, stack = stack in + let res = Compare.Bool.(x <> y) in + (step [@ocaml.tailcall]) g gas k ks res stack + | INot (_, k) -> + let x = accu in + (step [@ocaml.tailcall]) g gas k ks (not x) stack + (* integer operations *) + | IIs_nat (_, k) -> + let x = accu in + let res = Script_int.is_nat x in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAbs_int (_, k) -> + let x = accu in + let res = Script_int.abs x in + (step [@ocaml.tailcall]) g gas k ks res stack + | IInt_nat (_, k) -> + let x = accu in + let res = Script_int.int x in + (step [@ocaml.tailcall]) g gas k ks res stack + | INeg (_, k) -> + let x = accu in + let res = Script_int.neg x in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAdd_int (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.add x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAdd_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.add_n x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | ISub_int (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.sub x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMul_int (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.mul x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMul_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.mul_n x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IEdiv_teznat (_, k) -> + let x = accu and y, stack = stack in + let x = Script_int.of_int64 (Tez.to_mutez x) in + let result = + match Script_int.ediv x y with + | None -> None + | Some (q, r) -> ( + match (Script_int.to_int64 q, Script_int.to_int64 r) with + | Some q, Some r -> ( + match (Tez.of_mutez q, Tez.of_mutez r) with + | Some q, Some r -> Some (q, r) + (* Cannot overflow *) + | _ -> assert false) + (* Cannot overflow *) + | _ -> assert false) + in + (step [@ocaml.tailcall]) g gas k ks result stack + | IEdiv_tez (_, k) -> + let x = accu and y, stack = stack in + let x = Script_int.abs (Script_int.of_int64 (Tez.to_mutez x)) in + let y = Script_int.abs (Script_int.of_int64 (Tez.to_mutez y)) in + let result = + match Script_int.ediv_n x y with + | None -> None + | Some (q, r) -> ( + match Script_int.to_int64 r with + | None -> assert false (* Cannot overflow *) + | Some r -> ( + match Tez.of_mutez r with + | None -> assert false (* Cannot overflow *) + | Some r -> Some (q, r))) + in + (step [@ocaml.tailcall]) g gas k ks result stack + | IEdiv_int (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.ediv x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IEdiv_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.ediv_n x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | ILsl_nat (loc, k) -> ilsl_nat None g gas loc k ks accu stack + | ILsr_nat (loc, k) -> ilsr_nat None g gas loc k ks accu stack + | IOr_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.logor x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAnd_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.logand x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IAnd_int_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.logand x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IXor_nat (_, k) -> + let x = accu and y, stack = stack in + let res = Script_int.logxor x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | INot_int (_, k) -> + let x = accu in + let res = Script_int.lognot x in + (step [@ocaml.tailcall]) g gas k ks res stack + (* control *) + | IIf {branch_if_true; branch_if_false; k; _} -> + let res, stack = stack in + if accu then + (step [@ocaml.tailcall]) + g + gas + branch_if_true + (KCons (k, ks)) + res + stack + else + (step [@ocaml.tailcall]) + g + gas + branch_if_false + (KCons (k, ks)) + res + stack + | ILoop (_, body, k) -> + let ks = KLoop_in (body, KCons (k, ks)) in + (next [@ocaml.tailcall]) g gas ks accu stack + | ILoop_left (_, bl, br) -> + let ks = KLoop_in_left (bl, KCons (br, ks)) in + (next [@ocaml.tailcall]) g gas ks accu stack + | IDip (_, b, ty, k) -> + let ign = accu in + let ks = KUndip (ign, ty, KCons (k, ks)) in + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas b ks accu stack + | IExec (_, sty, k) -> iexec id None g gas sty k ks accu stack + | IApply (_, capture_ty, k) -> + let capture = accu in + let lam, stack = stack in + apply ctxt gas capture_ty capture lam >>=? fun (lam', ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks lam' stack + | ILambda (_, lam, k) -> + (step [@ocaml.tailcall]) g gas k ks lam (accu, stack) + | IFailwith (kloc, tv) -> + let {ifailwith} = ifailwith in + ifailwith None g gas kloc tv accu + (* comparison *) + | ICompare (_, ty, k) -> + let a = accu in + let b, stack = stack in + let r = + Script_int.of_int @@ Script_comparable.compare_comparable ty a b + in + (step [@ocaml.tailcall]) g gas k ks r stack + (* comparators *) + | IEq (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a = 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + | INeq (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a <> 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + | ILt (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a < 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + | ILe (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a <= 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + | IGt (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a > 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + | IGe (_, k) -> + let a = accu in + let a = Script_int.compare a Script_int.zero in + let a = Compare.Int.(a >= 0) in + (step [@ocaml.tailcall]) g gas k ks a stack + (* packing *) + | IPack (_, ty, k) -> + let value = accu in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + Script_ir_translator.pack_data ctxt ty value ) + >>=? fun (bytes, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks bytes stack + | IUnpack (_, ty, k) -> + let bytes = accu in + ( use_gas_counter_in_context ctxt gas @@ fun ctxt -> + unpack ctxt ~ty ~bytes ) + >>=? fun (opt, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks opt stack + | IAddress (_, k) -> + let typed_contract = accu in + let destination = Typed_contract.destination typed_contract in + let entrypoint = Typed_contract.entrypoint typed_contract in + let address = {destination; entrypoint} in + (step [@ocaml.tailcall]) g gas k ks address stack + | IContract (loc, t, entrypoint, k) -> ( + let addr = accu in + let entrypoint_opt = + if Entrypoint.is_default addr.entrypoint then Some entrypoint + else if Entrypoint.is_default entrypoint then Some addr.entrypoint + else (* both entrypoints are non-default *) None + in + match entrypoint_opt with + | Some entrypoint -> + let ctxt = update_context gas ctxt in + Script_ir_translator.parse_contract_for_script + ctxt + loc + t + addr.destination + ~entrypoint + >>=? fun (ctxt, maybe_contract) -> + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + let accu = maybe_contract in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks accu stack + | None -> (step [@ocaml.tailcall]) (ctxt, sc) gas k ks None stack) + | ITransfer_tokens (loc, k) -> + let p = accu in + let amount, (typed_contract, stack) = stack in + transfer (ctxt, sc) gas amount loc typed_contract p + >>=? fun (accu, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks accu stack + | IImplicit_account (_, k) -> + let key = accu in + let res = Typed_implicit key in + (step [@ocaml.tailcall]) g gas k ks res stack + | IView (_, view_signature, stack_ty, k) -> + (iview [@ocaml.tailcall]) + id + g + gas + view_signature + stack_ty + k + ks + accu + stack + | ICreate_contract {storage_type; code; k; loc = _} -> + (* Removed the instruction's arguments manager, spendable and delegatable *) + let delegate = accu in + let credit, (init, stack) = stack in + create_contract g gas storage_type code delegate credit init + >>=? fun (res, contract, ctxt, gas) -> + let destination = Destination.Contract (Originated contract) in + let stack = + ({destination; entrypoint = Entrypoint.default}, stack) + in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks res stack + | ISet_delegate (_, k) -> + let delegate = accu in + let operation = Delegation delegate in + let ctxt = update_context gas ctxt in + fresh_internal_nonce ctxt >>?= fun (ctxt, nonce) -> + let piop = + Internal_operation + {source = Contract.Originated sc.self; operation; nonce} + in + let res = {piop; lazy_storage_diff = None} in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks res stack + | IBalance (_, k) -> + let ctxt = update_context gas ctxt in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + let g = (ctxt, sc) in + (step [@ocaml.tailcall]) g gas k ks sc.balance (accu, stack) + | ILevel (_, k) -> + (step [@ocaml.tailcall]) g gas k ks sc.level (accu, stack) + | INow (_, k) -> (step [@ocaml.tailcall]) g gas k ks sc.now (accu, stack) + | IMin_block_time (_, k) -> + let ctxt = update_context gas ctxt in + let min_block_time = + Alpha_context.Constants.minimal_block_delay ctxt + |> Period.to_seconds |> Script_int.of_int64 + (* Realistically the block delay is never negative. *) + |> Script_int.abs + in + let new_stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks min_block_time new_stack + | ICheck_signature (_, k) -> + let key = accu and signature, (message, stack) = stack in + let res = Script_signature.check key signature message in + (step [@ocaml.tailcall]) g gas k ks res stack + | IHash_key (_, k) -> + let key = accu in + let res = Signature.Public_key.hash key in + (step [@ocaml.tailcall]) g gas k ks res stack + | IBlake2b (_, k) -> + let bytes = accu in + let hash = Raw_hashes.blake2b bytes in + (step [@ocaml.tailcall]) g gas k ks hash stack + | ISha256 (_, k) -> + let bytes = accu in + let hash = Raw_hashes.sha256 bytes in + (step [@ocaml.tailcall]) g gas k ks hash stack + | ISha512 (_, k) -> + let bytes = accu in + let hash = Raw_hashes.sha512 bytes in + (step [@ocaml.tailcall]) g gas k ks hash stack + | ISource (_, k) -> + let destination : Destination.t = Contract (Implicit sc.payer) in + let res = {destination; entrypoint = Entrypoint.default} in + (step [@ocaml.tailcall]) g gas k ks res (accu, stack) + | ISender (_, k) -> + let destination : Destination.t = Contract sc.source in + let res = {destination; entrypoint = Entrypoint.default} in + (step [@ocaml.tailcall]) g gas k ks res (accu, stack) + | ISelf (_, ty, entrypoint, k) -> + let res = + Typed_originated + {arg_ty = ty; contract_hash = sc.self; entrypoint} + in + (step [@ocaml.tailcall]) g gas k ks res (accu, stack) + | ISelf_address (_, k) -> + let destination : Destination.t = Contract (Originated sc.self) in + let res = {destination; entrypoint = Entrypoint.default} in + (step [@ocaml.tailcall]) g gas k ks res (accu, stack) + | IAmount (_, k) -> + let accu = sc.amount and stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IDig (_, _n, n', k) -> + let (accu, stack), x = + interp_stack_prefix_preserving_operation + (fun v stack -> (stack, v)) + n' + accu + stack + in + let accu = x and stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IDug (_, _n, n', k) -> + let v = accu in + let accu, stack = stack in + let (accu, stack), () = + interp_stack_prefix_preserving_operation + (fun accu stack -> ((v, (accu, stack)), ())) + n' + accu + stack + in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IDipn (_, _n, n', b, k) -> + let accu, stack, restore_prefix = kundip n' accu stack k in + let ks = KCons (restore_prefix, ks) in + (step [@ocaml.tailcall]) g gas b ks accu stack + | IDropn (_, _n, n', k) -> + let stack = + let rec aux : + type a s b t. + (b, t, b, t, a, s, a, s) stack_prefix_preservation_witness -> + a -> + s -> + b * t = + fun w accu stack -> + match w with + | KRest -> (accu, stack) + | KPrefix (_, _ty, w) -> + let accu, stack = stack in + aux w accu stack + in + aux n' accu stack + in + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas k ks accu stack + | ISapling_empty_state (_, memo_size, k) -> + let state = Sapling.empty_state ~memo_size () in + (step [@ocaml.tailcall]) g gas k ks state (accu, stack) + | ISapling_verify_update (_, k) -> ( + let transaction = accu in + let state, stack = stack in + let address = Contract_hash.to_b58check sc.self in + let sc_chain_id = Script_chain_id.make sc.chain_id in + let chain_id = Script_chain_id.to_b58check sc_chain_id in + let anti_replay = address ^ chain_id in + let ctxt = update_context gas ctxt in + Sapling.verify_update ctxt state transaction anti_replay + >>=? fun (ctxt, balance_state_opt) -> + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + match balance_state_opt with + | Some (balance, state) -> + let state = + Some + ( Bytes.of_string transaction.bound_data, + (Script_int.of_int64 balance, state) ) + in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks state stack + | None -> (step [@ocaml.tailcall]) (ctxt, sc) gas k ks None stack) + | ISapling_verify_update_deprecated (_, k) -> ( + let transaction = accu in + let state, stack = stack in + let address = Contract_hash.to_b58check sc.self in + let sc_chain_id = Script_chain_id.make sc.chain_id in + let chain_id = Script_chain_id.to_b58check sc_chain_id in + let anti_replay = address ^ chain_id in + let ctxt = update_context gas ctxt in + Sapling.Legacy.verify_update ctxt state transaction anti_replay + >>=? fun (ctxt, balance_state_opt) -> + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + match balance_state_opt with + | Some (balance, state) -> + let state = Some (Script_int.of_int64 balance, state) in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks state stack + | None -> (step [@ocaml.tailcall]) (ctxt, sc) gas k ks None stack) + | IChainId (_, k) -> + let accu = Script_chain_id.make sc.chain_id + and stack = (accu, stack) in + (step [@ocaml.tailcall]) g gas k ks accu stack + | INever _ -> ( match accu with _ -> .) + | IVoting_power (_, k) -> + let key_hash = accu in + let ctxt = update_context gas ctxt in + Vote.get_voting_power ctxt key_hash >>=? fun (ctxt, power) -> + let power = Script_int.(abs (of_int64 power)) in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks power stack + | ITotal_voting_power (_, k) -> + let ctxt = update_context gas ctxt in + Vote.get_total_voting_power ctxt >>=? fun (ctxt, power) -> + let power = Script_int.(abs (of_int64 power)) in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + let g = (ctxt, sc) in + (step [@ocaml.tailcall]) g gas k ks power (accu, stack) + | IKeccak (_, k) -> + let bytes = accu in + let hash = Raw_hashes.keccak256 bytes in + (step [@ocaml.tailcall]) g gas k ks hash stack + | ISha3 (_, k) -> + let bytes = accu in + let hash = Raw_hashes.sha3_256 bytes in + (step [@ocaml.tailcall]) g gas k ks hash stack + | IAdd_bls12_381_g1 (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.G1.add x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IAdd_bls12_381_g2 (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.G2.add x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IAdd_bls12_381_fr (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.Fr.add x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IMul_bls12_381_g1 (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.G1.mul x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IMul_bls12_381_g2 (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.G2.mul x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IMul_bls12_381_fr (_, k) -> + let x = accu and y, stack = stack in + let accu = Script_bls.Fr.mul x y in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IMul_bls12_381_fr_z (_, k) -> + let x = accu and y, stack = stack in + let x = Script_bls.Fr.of_z (Script_int.to_zint x) in + let res = Script_bls.Fr.mul x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IMul_bls12_381_z_fr (_, k) -> + let y = accu and x, stack = stack in + let x = Script_bls.Fr.of_z (Script_int.to_zint x) in + let res = Script_bls.Fr.mul x y in + (step [@ocaml.tailcall]) g gas k ks res stack + | IInt_bls12_381_fr (_, k) -> + let x = accu in + let res = Script_int.of_zint (Script_bls.Fr.to_z x) in + (step [@ocaml.tailcall]) g gas k ks res stack + | INeg_bls12_381_g1 (_, k) -> + let x = accu in + let accu = Script_bls.G1.negate x in + (step [@ocaml.tailcall]) g gas k ks accu stack + | INeg_bls12_381_g2 (_, k) -> + let x = accu in + let accu = Script_bls.G2.negate x in + (step [@ocaml.tailcall]) g gas k ks accu stack + | INeg_bls12_381_fr (_, k) -> + let x = accu in + let accu = Script_bls.Fr.negate x in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IPairing_check_bls12_381 (_, k) -> + let pairs = accu in + let check = Script_bls.pairing_check pairs.elements in + (step [@ocaml.tailcall]) g gas k ks check stack + | IComb (_, _, witness, k) -> + let rec aux : + type a b s c d t. + (a, b, s, c, d, t) comb_gadt_witness -> + a * (b * s) -> + c * (d * t) = + fun witness stack -> + match (witness, stack) with + | Comb_one, stack -> stack + | Comb_succ witness', (a, tl) -> + let b, tl' = aux witness' tl in + ((a, b), tl') + in + let stack = aux witness (accu, stack) in + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IUncomb (_, _, witness, k) -> + let rec aux : + type a b s c d t. + (a, b, s, c, d, t) uncomb_gadt_witness -> + a * (b * s) -> + c * (d * t) = + fun witness stack -> + match (witness, stack) with + | Uncomb_one, stack -> stack + | Uncomb_succ witness', ((a, b), tl) -> (a, aux witness' (b, tl)) + in + let stack = aux witness (accu, stack) in + let accu, stack = stack in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IComb_get (_, _, witness, k) -> + let comb = accu in + let rec aux : + type before after. + (before, after) comb_get_gadt_witness -> before -> after = + fun witness comb -> + match (witness, comb) with + | Comb_get_zero, v -> v + | Comb_get_one, (a, _) -> a + | Comb_get_plus_two witness', (_, b) -> aux witness' b + in + let accu = aux witness comb in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IComb_set (_, _, witness, k) -> + let value = accu and comb, stack = stack in + let rec aux : + type value before after. + (value, before, after) comb_set_gadt_witness -> + value -> + before -> + after = + fun witness value item -> + match (witness, item) with + | Comb_set_zero, _ -> value + | Comb_set_one, (_hd, tl) -> (value, tl) + | Comb_set_plus_two witness', (hd, tl) -> + (hd, aux witness' value tl) + in + let accu = aux witness value comb in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IDup_n (_, _, witness, k) -> + let rec aux : + type a b before after. + (a, b, before, after) dup_n_gadt_witness -> + a * (b * before) -> + after = + fun witness stack -> + match (witness, stack) with + | Dup_n_zero, (a, _) -> a + | Dup_n_succ witness', (_, tl) -> aux witness' tl + in + let stack = (accu, stack) in + let accu = aux witness stack in + (step [@ocaml.tailcall]) g gas k ks accu stack + (* Tickets *) + | ITicket_deprecated (_, _, k) -> ( + let contents = accu and amount, stack = stack in + match Ticket_amount.of_n amount with + | Some amount -> + let ticketer = Contract.Originated sc.self in + let accu = {ticketer; contents; amount} in + (step [@ocaml.tailcall]) g gas k ks accu stack + | None -> tzfail Script_tc_errors.Forbidden_zero_ticket_quantity) + | ITicket (_, _, k) -> ( + let contents = accu and amount, stack = stack in + match Ticket_amount.of_n amount with + | Some amount -> + let ticketer = Contract.Originated sc.self in + let accu = Some {ticketer; contents; amount} in + (step [@ocaml.tailcall]) g gas k ks accu stack + | None -> (step [@ocaml.tailcall]) g gas k ks None stack) + | IRead_ticket (_, _, k) -> + let {ticketer; contents; amount} = accu in + let stack = (accu, stack) in + let destination : Destination.t = Contract ticketer in + let addr = {destination; entrypoint = Entrypoint.default} in + let accu = + (addr, (contents, (amount :> Script_int.n Script_int.num))) + in + (step [@ocaml.tailcall]) g gas k ks accu stack + | ISplit_ticket (_, k) -> + let ticket = accu and (amount_a, amount_b), stack = stack in + let result = + Option.bind (Ticket_amount.of_n amount_a) @@ fun amount_a -> + Option.bind (Ticket_amount.of_n amount_b) @@ fun amount_b -> + let amount = Ticket_amount.add amount_a amount_b in + if + Compare.Int.( + Script_int.( + compare (amount :> n num) (ticket.amount :> n num)) + = 0) + then + Some + ( {ticket with amount = amount_a}, + {ticket with amount = amount_b} ) + else None + in + (step [@ocaml.tailcall]) g gas k ks result stack + | IJoin_tickets (_, contents_ty, k) -> + let ticket_a, ticket_b = accu in + let result = + if + Compare.Int.( + Contract.compare ticket_a.ticketer ticket_b.ticketer = 0 + && Script_comparable.compare_comparable + contents_ty + ticket_a.contents + ticket_b.contents + = 0) + then + Some + { + ticketer = ticket_a.ticketer; + contents = ticket_a.contents; + amount = Ticket_amount.add ticket_a.amount ticket_b.amount; + } + else None + in + (step [@ocaml.tailcall]) g gas k ks result stack + | IOpen_chest (_, k) -> + let open Timelock in + let chest_key = accu in + let chest, (time_z, stack) = stack in + (* If the time is not an integer we then consider the proof as + incorrect. Indeed the verification asks for an integer for practical reasons. + Therefore no proof can be correct.*) + let accu = + match Script_int.to_int time_z with + | None -> R false + | Some time -> ( + match Script_timelock.open_chest chest chest_key ~time with + | Correct bytes -> L bytes + | Bogus_cipher -> R false + | Bogus_opening -> R true) + in + (step [@ocaml.tailcall]) g gas k ks accu stack + | IEmit {tag; ty = event_type; unparsed_ty; k; loc = _} -> + let event_data = accu in + emit_event (ctxt, sc) gas ~event_type ~unparsed_ty ~tag ~event_data + >>=? fun (accu, ctxt, gas) -> + (step [@ocaml.tailcall]) (ctxt, sc) gas k ks accu stack) +end + +open Raw + +(* + + Entrypoints + =========== + +*) + +let step_descr ~log_now logger (ctxt, sc) descr accu stack = + let gas, outdated_ctxt = local_gas_counter_and_outdated_context ctxt in + (match logger with + | None -> step (outdated_ctxt, sc) gas descr.kinstr KNil accu stack + | Some logger -> + (if log_now then + let loc = kinstr_location descr.kinstr in + logger.log_interp descr.kinstr ctxt loc descr.kbef (accu, stack)) ; + let log = + ILog + ( kinstr_location descr.kinstr, + descr.kbef, + LogEntry, + logger, + descr.kinstr ) + in + let knil = KLog (KNil, descr.kaft, logger) in + step (outdated_ctxt, sc) gas log knil accu stack) + >>=? fun (accu, stack, ctxt, gas) -> + return (accu, stack, update_context gas ctxt) + +let interp logger g lam arg = + match lam with + | LamRec (code, _) -> + step_descr ~log_now:true logger g code arg (lam, (EmptyCell, EmptyCell)) + >|=? fun (ret, (EmptyCell, EmptyCell), ctxt) -> (ret, ctxt) + | Lam (code, _) -> + step_descr ~log_now:true logger g code arg (EmptyCell, EmptyCell) + >|=? fun (ret, (EmptyCell, EmptyCell), ctxt) -> (ret, ctxt) + +(* + + High-level functions + ==================== + +*) +type execution_arg = + | Typed_arg : + Script.location * ('a, _) Script_typed_ir.ty * 'a + -> execution_arg + | Untyped_arg : Script.expr -> execution_arg + +let lift_execution_arg (type a ac) ctxt ~internal (entrypoint_ty : (a, ac) ty) + (construct : a -> 'b) arg : ('b * context) tzresult Lwt.t = + (match arg with + | Untyped_arg arg -> + let arg = Micheline.root arg in + parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + ~allow_forged:internal + entrypoint_ty + arg + | Typed_arg (loc, parsed_arg_ty, parsed_arg) -> + Gas_monad.run + ctxt + (Script_ir_translator.ty_eq + ~error_details:(Informative loc) + entrypoint_ty + parsed_arg_ty) + >>?= fun (res, ctxt) -> + res >>?= fun Eq -> + let parsed_arg : a = parsed_arg in + return (parsed_arg, ctxt)) + >>=? fun (entrypoint_arg, ctxt) -> return (construct entrypoint_arg, ctxt) + +type execution_result = { + script : Script_ir_translator.ex_script; + code_size : int; + storage : Script.expr; + lazy_storage_diff : Lazy_storage.diffs option; + operations : packed_internal_operation list; + ticket_diffs : Z.t Ticket_token_map.t; + ticket_receipt : Ticket_receipt.t; +} + +let execute_any_arg logger ctxt mode step_constants ~entrypoint ~internal + unparsed_script cached_script arg = + let elab_conf = + Script_ir_translator_config.make + ~legacy:true + ~keep_extra_types_for_interpreter_logging:(Option.is_some logger) + () + in + (match cached_script with + | None -> + parse_script ctxt unparsed_script ~elab_conf ~allow_forged_in_storage:true + | Some ex_script -> return (ex_script, ctxt)) + >>=? fun ( Ex_script + (Script + { + code_size; + code; + arg_type; + storage = old_storage; + storage_type; + entrypoints; + views; + }), + ctxt ) -> + Gas_monad.run + ctxt + (find_entrypoint + ~error_details:(Informative ()) + arg_type + entrypoints + entrypoint) + >>?= fun (r, ctxt) -> + let self_contract = Contract.Originated step_constants.self in + record_trace (Bad_contract_parameter self_contract) r + >>?= fun (Ex_ty_cstr {ty = entrypoint_ty; construct; original_type_expr = _}) + -> + trace + (Bad_contract_parameter self_contract) + (lift_execution_arg ctxt ~internal entrypoint_ty construct arg) + >>=? fun (arg, ctxt) -> + Script_ir_translator.collect_lazy_storage ctxt arg_type arg + >>?= fun (to_duplicate, ctxt) -> + Script_ir_translator.collect_lazy_storage ctxt storage_type old_storage + >>?= fun (to_update, ctxt) -> + trace + (Runtime_contract_error step_constants.self) + (interp logger (ctxt, step_constants) code (arg, old_storage)) + >>=? fun ((ops, new_storage), ctxt) -> + Script_ir_translator.extract_lazy_storage_diff + ctxt + mode + ~temporary:false + ~to_duplicate + ~to_update + storage_type + new_storage + >>=? fun (storage, lazy_storage_diff, ctxt) -> + trace Cannot_serialize_storage (unparse_data ctxt mode storage_type storage) + >>=? fun (unparsed_storage, ctxt) -> + let op_to_couple op = (op.piop, op.lazy_storage_diff) in + let operations, op_diffs = + ops.elements |> List.map op_to_couple |> List.split + in + let lazy_storage_diff_all = + match + List.flatten + (List.map (Option.value ~default:[]) (op_diffs @ [lazy_storage_diff])) + with + | [] -> None + | diff -> Some diff + in + let script = + Ex_script + (Script + {code_size; code; arg_type; storage; storage_type; entrypoints; views}) + in + Ticket_scanner.type_has_tickets ctxt arg_type + >>?= fun (arg_type_has_tickets, ctxt) -> + Ticket_scanner.type_has_tickets ctxt storage_type + >>?= fun (storage_type_has_tickets, ctxt) -> + (* Collect the ticket diffs *) + Ticket_accounting.ticket_diffs + ctxt + ~self_contract + ~arg_type_has_tickets + ~storage_type_has_tickets + ~arg + ~old_storage + ~new_storage + ~lazy_storage_diff:(Option.value ~default:[] lazy_storage_diff) + >>=? fun (ticket_diffs, ticket_receipt, ctxt) -> + (* We consume gas after the fact in order to not have to instrument + [script_size] (for efficiency). + This is safe, as we already pay gas proportional to storage size + in [unparse_data]. *) + let size, cost = Script_ir_translator.script_size script in + Gas.consume ctxt cost >>?= fun ctxt -> + return + ( { + script; + code_size = size; + storage = unparsed_storage; + lazy_storage_diff = lazy_storage_diff_all; + operations; + ticket_diffs; + ticket_receipt; + }, + ctxt ) + +let execute_with_typed_parameter ?logger ctxt ~cached_script mode step_constants + ~script ~entrypoint ~parameter_ty ~location ~parameter ~internal = + execute_any_arg + logger + ctxt + mode + step_constants + ~entrypoint + ~internal + script + cached_script + (Typed_arg (location, parameter_ty, parameter)) + +let execute ?logger ctxt ~cached_script mode step_constants ~script ~entrypoint + ~parameter ~internal = + execute_any_arg + logger + ctxt + mode + step_constants + ~entrypoint + ~internal + script + cached_script + (Untyped_arg parameter) + +(* + + Internals + ========= + +*) + +(* + + We export the internals definitions for tool that requires + a white-box view on the interpreter, typically snoop, the + gas model inference engine. + +*) +module Internals = struct + let next logger g gas sty ks accu stack = + let ks = + match logger with None -> ks | Some logger -> KLog (ks, sty, logger) + in + next g gas ks accu stack + + let kstep logger ctxt step_constants sty kinstr accu stack = + let kinstr = + match logger with + | None -> kinstr + | Some logger -> + ILog (kinstr_location kinstr, sty, LogEntry, logger, kinstr) + in + let gas, outdated_ctxt = local_gas_counter_and_outdated_context ctxt in + step (outdated_ctxt, step_constants) gas kinstr KNil accu stack + >>=? fun (accu, stack, ctxt, gas) -> + return (accu, stack, update_context gas ctxt) + + let step (ctxt, step_constants) gas ks accu stack = + step (ctxt, step_constants) gas ks KNil accu stack + + let step_descr logger ctxt step_constants descr stack = + step_descr ~log_now:false logger (ctxt, step_constants) descr stack + + module Raw = Raw +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_interpreter.mli b/src/proto_016_PtMumbai/lib_protocol/script_interpreter.mli new file mode 100644 index 000000000000..0a5a2903cb2b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_interpreter.mli @@ -0,0 +1,253 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This is the Michelson interpreter. + + This module offers a way to execute either a Michelson script or a + Michelson instruction. + + Implementation details are documented in the .ml file. + +*) + +open Alpha_context +open Script_typed_ir + +type error += Reject of Script.location * Script.expr * execution_trace option + +type error += Overflow of Script.location * execution_trace option + +type error += Runtime_contract_error of Contract_hash.t + +type error += Bad_contract_parameter of Contract.t (* `Permanent *) + +type error += Cannot_serialize_failure + +type error += Cannot_serialize_storage + +type error += Michelson_too_many_recursive_calls + +(** The result from script interpretation. *) +type execution_result = { + script : Script_ir_translator.ex_script; + code_size : int; + storage : Script.expr; + lazy_storage_diff : Lazy_storage.diffs option; + operations : packed_internal_operation list; + ticket_diffs : Z.t Ticket_token_map.t; + ticket_receipt : Ticket_receipt.t; +} + +type step_constants = Script_typed_ir.step_constants = { + source : Contract.t; + payer : Signature.public_key_hash; + self : Contract_hash.t; + amount : Tez.t; + balance : Tez.t; + chain_id : Chain_id.t; + now : Script_timestamp.t; + level : Script_int.n Script_int.num; +} + +(** [execute ?logger ctxt ~cached_script mode step_constant ~script + ~entrypoint ~parameter ~internal] interprets the [script]'s + [entrypoint] for a given [parameter]. + + This will update the local storage of the contract + [step_constants.self]. Other pieces of contextual information + ([source], [payer], [amount], and [chaind_id]) are also passed in + [step_constant]. + + [internal] is [true] if and only if the execution happens within an + internal operation. + + [mode] is the unparsing mode, as declared by + {!Script_ir_translator}. + + [cached_script] is the cached elaboration of [script], that is the + well typed abstract syntax tree produced by the type elaboration of + [script] during a previous execution and stored in the in-memory + cache. + +*) +val execute : + ?logger:logger -> + Alpha_context.t -> + cached_script:Script_ir_translator.ex_script option -> + Script_ir_unparser.unparsing_mode -> + step_constants -> + script:Script.t -> + entrypoint:Entrypoint.t -> + parameter:Script.expr -> + internal:bool -> + (execution_result * context) tzresult Lwt.t + +(** [execute_with_typed_parameter ?logger ctxt ~cached_script mode + step_constant ~script ~entrypoint loc ~parameter_ty ~parameter ~internal] + interprets the [script]'s [entrypoint] for a given (typed) [parameter]. + + See {!execute} for more details about the function's arguments. +*) +val execute_with_typed_parameter : + ?logger:logger -> + Alpha_context.context -> + cached_script:Script_ir_translator.ex_script option -> + Script_ir_unparser.unparsing_mode -> + step_constants -> + script:Script.t -> + entrypoint:Entrypoint.t -> + parameter_ty:('a, _) Script_typed_ir.ty -> + location:Script.location -> + parameter:'a -> + internal:bool -> + (execution_result * context) tzresult Lwt.t + +(** Internal interpretation loop + ============================ + + The following types and the following functions are exposed + in the interface to allow the inference of a gas model in + snoop. + + Strictly speaking, they should not be considered as part of + the interface since they expose implementation details that + may change in the future. + +*) + +module Internals : sig + (** Internally, the interpretation loop uses a local gas counter. *) + + (** [next logger (ctxt, step_constants) local_gas_counter ks accu + stack] is an internal function which interprets the continuation + [ks] to execute the interpreter on the current A-stack. *) + val next : + logger option -> + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's) stack_ty -> + ('a, 's, 'r, 'f) continuation -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + + val step : + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's, 'r, 'f) Script_typed_ir.kinstr -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + + val step_descr : + logger option -> + context -> + Script_typed_ir.step_constants -> + ('a, 's, 'r, 'f) Script_typed_ir.kdescr -> + 'a -> + 's -> + ('r * 'f * context) tzresult Lwt.t + + (** [kstep logger ctxt step_constants kinstr accu stack] interprets the + script represented by [kinstr] under the context [ctxt]. This will + turn a stack whose topmost element is [accu] and remaining elements + [stack] into a new accumulator and a new stack. This function also + returns an updated context. If [logger] is given, [kstep] calls back + its functions at specific points of the execution. The execution is + parameterized by some [step_constants]. *) + val kstep : + logger option -> + context -> + step_constants -> + ('a, 's) stack_ty -> + ('a, 's, 'r, 'f) Script_typed_ir.kinstr -> + 'a -> + 's -> + ('r * 'f * context) tzresult Lwt.t + + module Raw : sig + open Local_gas_counter + open Script_interpreter_defs + + val kmap_exit : ('a, 'b, 'c, 'e, 'f, 'm, 'n, 'o) kmap_exit_type + + val kmap_enter : ('a, 'b, 'c, 'd, 'f, 'i, 'j, 'k) kmap_enter_type + + val klist_exit : ('a, 'b, 'c, 'd, 'e, 'i, 'j) klist_exit_type + + val klist_enter : ('a, 'b, 'c, 'd, 'e, 'f, 'j) klist_enter_type + + val kloop_in_left : ('a, 'b, 'c, 'd, 'e, 'f, 'g) kloop_in_left_type + + val kloop_in : ('a, 'b, 'c, 'r, 'f, 's) kloop_in_type + + val kiter : ('a, 'b, 's, 'r, 'f, 'c) kiter_type + + val next : + outdated_context * step_constants -> + local_gas_counter -> + ('a, 's, 'r, 'f) continuation -> + 'a -> + 's -> + ('r * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + + val ilist_map : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i) ilist_map_type + + val ilist_iter : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'cmp) ilist_iter_type + + val iset_iter : ('a, 'b, 'c, 'd, 'e, 'f, 'g) iset_iter_type + + val imap_map : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j) imap_map_type + + val imap_iter : ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'cmp) imap_iter_type + + val imul_teznat : ('a, 'b, 'c, 'd, 'e, 'f) imul_teznat_type + + val imul_nattez : ('a, 'b, 'c, 'd, 'e, 'f) imul_nattez_type + + val ilsl_nat : ('a, 'b, 'c, 'd, 'e, 'f) ilsl_nat_type + + val ilsr_nat : ('a, 'b, 'c, 'd, 'e, 'f) ilsr_nat_type + + val ifailwith : ifailwith_type + + val iexec : ('a, 'b, 'c, 'd, 'e, 'f, 'g) iexec_type + + val iview : ('a, 'b, 'c, 'd, 'e, 'f, 'i, 'o) iview_type + + val step : ('a, 's, 'b, 't, 'r, 'f) step_type + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_interpreter_defs.ml b/src/proto_016_PtMumbai/lib_protocol/script_interpreter_defs.ml new file mode 100644 index 000000000000..e8310d6b2830 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_interpreter_defs.ml @@ -0,0 +1,1072 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* + + This module provides auxiliary definitions used in the interpreter. + + These are internal private definitions. Do not rely on them outside + the interpreter. + +*) + +open Alpha_context +open Script +open Script_typed_ir +open Script_ir_translator +open Local_gas_counter + +type error += Rollup_invalid_transaction_amount | Rollup_invalid_entrypoint + +let () = + register_error_kind + `Permanent + ~id:"operation.rollup_invalid_transaction_amount" + ~title:"Transaction amount to a rollup must be zero" + ~description: + "Because rollups are outside of the delegation mechanism of Tezos, they \ + cannot own Tez, and therefore transactions targeting a rollup must have \ + its amount field set to zero." + ~pp:(fun ppf () -> + Format.pp_print_string ppf "Transaction amount to a rollup must be zero.") + Data_encoding.unit + (function Rollup_invalid_transaction_amount -> Some () | _ -> None) + (fun () -> Rollup_invalid_transaction_amount) ; + register_error_kind + `Permanent + ~id:"operation.rollup_invalid_entrypoint" + ~title:"Only the default entrypoint is allowed for rollups" + ~description:"Rollups only support transactions to the default entrypoint." + ~pp:(fun ppf () -> + Format.pp_print_string + ppf + "Rollups only support transactions to the default entrypoint.") + Data_encoding.unit + (function Rollup_invalid_entrypoint -> Some () | _ -> None) + (fun () -> Rollup_invalid_entrypoint) + +(* + + Computing the cost of Michelson instructions + ============================================ + + The function [cost_of_instr] provides a cost model for Michelson + instructions. It is used by the interpreter to track the + consumption of gas. This consumption may depend on the values + on the stack. + + *) + +module Interp_costs = Michelson_v1_gas.Cost_of.Interpreter + +let cost_of_instr : type a s r f. (a, s, r, f) kinstr -> a -> s -> Gas.cost = + fun i accu stack -> + match i with + | IList_map _ -> + let list = accu in + Interp_costs.list_map list + | IList_iter _ -> + let list = accu in + Interp_costs.list_iter list + | ISet_iter _ -> + let set = accu in + Interp_costs.set_iter set + | ISet_mem _ -> + let v = accu and set, _ = stack in + Interp_costs.set_mem v set + | ISet_update _ -> + let v = accu and _, (set, _) = stack in + Interp_costs.set_update v set + | IMap_map _ -> + let map = accu in + Interp_costs.map_map map + | IMap_iter _ -> + let map = accu in + Interp_costs.map_iter map + | IMap_mem _ -> + let v = accu and map, _ = stack in + Interp_costs.map_mem v map + | IMap_get _ -> + let v = accu and map, _ = stack in + Interp_costs.map_get v map + | IMap_update _ -> + let k = accu and _, (map, _) = stack in + Interp_costs.map_update k map + | IMap_get_and_update _ -> + let k = accu and _, (map, _) = stack in + Interp_costs.map_get_and_update k map + | IBig_map_mem _ -> + let Big_map map, _ = stack in + Interp_costs.big_map_mem map.diff + | IBig_map_get _ -> + let Big_map map, _ = stack in + Interp_costs.big_map_get map.diff + | IBig_map_update _ -> + let _, (Big_map map, _) = stack in + Interp_costs.big_map_update map.diff + | IBig_map_get_and_update _ -> + let _, (Big_map map, _) = stack in + Interp_costs.big_map_get_and_update map.diff + | IAdd_seconds_to_timestamp _ -> + let n = accu and t, _ = stack in + Interp_costs.add_seconds_timestamp n t + | IAdd_timestamp_to_seconds _ -> + let t = accu and n, _ = stack in + Interp_costs.add_timestamp_seconds t n + | ISub_timestamp_seconds _ -> + let t = accu and n, _ = stack in + Interp_costs.sub_timestamp_seconds t n + | IDiff_timestamps _ -> + let t1 = accu and t2, _ = stack in + Interp_costs.diff_timestamps t1 t2 + | IConcat_string_pair _ -> + let x = accu and y, _ = stack in + Interp_costs.concat_string_pair x y + | IConcat_string _ -> + let ss = accu in + Interp_costs.concat_string_precheck ss + | ISlice_string _ -> + let (_offset : Script_int.n Script_int.num) = accu in + let _length, (s, _) = stack in + Interp_costs.slice_string s + | IConcat_bytes_pair _ -> + let x = accu and y, _ = stack in + Interp_costs.concat_bytes_pair x y + | IConcat_bytes _ -> + let ss = accu in + Interp_costs.concat_string_precheck ss + | ISlice_bytes _ -> + let _, (s, _) = stack in + Interp_costs.slice_bytes s + | IBytes_nat _ -> + let n = accu in + Interp_costs.bytes_nat n + | INat_bytes _ -> + let b = accu in + Interp_costs.nat_bytes b + | IBytes_int _ -> + let n = accu in + Interp_costs.bytes_int n + | IInt_bytes _ -> + let b = accu in + Interp_costs.int_bytes b + | IMul_teznat _ -> Interp_costs.mul_teznat + | IMul_nattez _ -> Interp_costs.mul_nattez + | IAbs_int _ -> + let x = accu in + Interp_costs.abs_int x + | INeg _ -> + let x = accu in + Interp_costs.neg x + | IAdd_int _ -> + let x = accu and y, _ = stack in + Interp_costs.add_int x y + | IAdd_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.add_nat x y + | ISub_int _ -> + let x = accu and y, _ = stack in + Interp_costs.sub_int x y + | IMul_int _ -> + let x = accu and y, _ = stack in + Interp_costs.mul_int x y + | IMul_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.mul_nat x y + | IEdiv_teznat _ -> + let x = accu and y, _ = stack in + Interp_costs.ediv_teznat x y + | IEdiv_int _ -> + let x = accu and y, _ = stack in + Interp_costs.ediv_int x y + | IEdiv_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.ediv_nat x y + | ILsl_nat _ -> + let x = accu in + Interp_costs.lsl_nat x + | ILsl_bytes _ -> + let x = accu in + let y, _ = stack in + Interp_costs.lsl_bytes x y + | ILsr_nat _ -> + let x = accu in + Interp_costs.lsr_nat x + | ILsr_bytes _ -> + let x = accu in + let y, _ = stack in + Interp_costs.lsr_bytes x y + | IOr_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.or_nat x y + | IOr_bytes _ -> + let x = accu and y, _ = stack in + Interp_costs.or_bytes x y + | IAnd_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.and_nat x y + | IAnd_int_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.and_int_nat x y + | IAnd_bytes _ -> + let x = accu and y, _ = stack in + Interp_costs.and_bytes x y + | IXor_nat _ -> + let x = accu and y, _ = stack in + Interp_costs.xor_nat x y + | IXor_bytes _ -> + let x = accu and y, _ = stack in + Interp_costs.xor_bytes x y + | INot_int _ -> + let x = accu in + Interp_costs.not_int x + | INot_bytes _ -> + let x = accu in + Interp_costs.not_bytes x + | ICompare (_, ty, _) -> + let a = accu and b, _ = stack in + Interp_costs.compare ty a b + | ICheck_signature _ -> + let key = accu and _, (message, _) = stack in + Interp_costs.check_signature key message + | IHash_key _ -> + let pk = accu in + Interp_costs.hash_key pk + | IBlake2b _ -> + let bytes = accu in + Interp_costs.blake2b bytes + | ISha256 _ -> + let bytes = accu in + Interp_costs.sha256 bytes + | ISha512 _ -> + let bytes = accu in + Interp_costs.sha512 bytes + | IKeccak _ -> + let bytes = accu in + Interp_costs.keccak bytes + | ISha3 _ -> + let bytes = accu in + Interp_costs.sha3 bytes + | IPairing_check_bls12_381 _ -> + let pairs = accu in + Interp_costs.pairing_check_bls12_381 pairs + | ISapling_verify_update _ -> + let tx = accu in + let inputs = Gas_input_size.sapling_transaction_inputs tx in + let outputs = Gas_input_size.sapling_transaction_outputs tx in + let bound_data = Gas_input_size.sapling_transaction_bound_data tx in + Interp_costs.sapling_verify_update ~inputs ~outputs ~bound_data + | ISapling_verify_update_deprecated _ -> + let tx = accu in + let inputs = List.length tx.inputs in + let outputs = List.length tx.outputs in + Interp_costs.sapling_verify_update_deprecated ~inputs ~outputs + | ISplit_ticket _ -> + let (amount_a, amount_b), _ = stack in + Interp_costs.split_ticket amount_a amount_b + | IJoin_tickets (_, ty, _) -> + let ticket_a, ticket_b = accu in + Interp_costs.join_tickets ty ticket_a ticket_b + | IHalt _ -> Interp_costs.halt + | IDrop _ -> Interp_costs.drop + | IDup _ -> Interp_costs.dup + | ISwap _ -> Interp_costs.swap + | IConst _ -> Interp_costs.const + | ICons_some _ -> Interp_costs.cons_some + | ICons_none _ -> Interp_costs.cons_none + | IIf_none _ -> Interp_costs.if_none + | IOpt_map _ -> Interp_costs.opt_map + | ICons_pair _ -> Interp_costs.cons_pair + | IUnpair _ -> Interp_costs.unpair + | ICar _ -> Interp_costs.car + | ICdr _ -> Interp_costs.cdr + | ICons_left _ -> Interp_costs.cons_left + | ICons_right _ -> Interp_costs.cons_right + | IIf_left _ -> Interp_costs.if_left + | ICons_list _ -> Interp_costs.cons_list + | INil _ -> Interp_costs.nil + | IIf_cons _ -> Interp_costs.if_cons + | IList_size _ -> Interp_costs.list_size + | IEmpty_set _ -> Interp_costs.empty_set + | ISet_size _ -> Interp_costs.set_size + | IEmpty_map _ -> Interp_costs.empty_map + | IMap_size _ -> Interp_costs.map_size + | IEmpty_big_map _ -> Interp_costs.empty_big_map + | IString_size _ -> Interp_costs.string_size + | IBytes_size _ -> Interp_costs.bytes_size + | IAdd_tez _ -> Interp_costs.add_tez + | ISub_tez _ -> Interp_costs.sub_tez + | ISub_tez_legacy _ -> Interp_costs.sub_tez_legacy + | IOr _ -> Interp_costs.bool_or + | IAnd _ -> Interp_costs.bool_and + | IXor _ -> Interp_costs.bool_xor + | INot _ -> Interp_costs.bool_not + | IIs_nat _ -> Interp_costs.is_nat + | IInt_nat _ -> Interp_costs.int_nat + | IInt_bls12_381_fr _ -> Interp_costs.int_bls12_381_fr + | IEdiv_tez _ -> Interp_costs.ediv_tez + | IIf _ -> Interp_costs.if_ + | ILoop _ -> Interp_costs.loop + | ILoop_left _ -> Interp_costs.loop_left + | IDip _ -> Interp_costs.dip + | IExec _ -> Interp_costs.exec + | IApply _ -> ( + let l, _ = stack in + match l with + | Lam _ -> Interp_costs.apply ~rec_flag:false + | LamRec _ -> Interp_costs.apply ~rec_flag:true) + | ILambda _ -> Interp_costs.lambda + | IFailwith _ -> Gas.free + | IEq _ -> Interp_costs.eq + | INeq _ -> Interp_costs.neq + | ILt _ -> Interp_costs.lt + | ILe _ -> Interp_costs.le + | IGt _ -> Interp_costs.gt + | IGe _ -> Interp_costs.ge + | IPack _ -> Gas.free + | IUnpack _ -> + let b = accu in + Interp_costs.unpack b + | IAddress _ -> Interp_costs.address + | IContract _ -> Interp_costs.contract + | ITransfer_tokens _ -> Interp_costs.transfer_tokens + | IView _ -> Interp_costs.view + | IImplicit_account _ -> Interp_costs.implicit_account + | ISet_delegate _ -> Interp_costs.set_delegate + | IBalance _ -> Interp_costs.balance + | ILevel _ -> Interp_costs.level + | INow _ -> Interp_costs.now + | IMin_block_time _ -> Interp_costs.min_block_time + | ISapling_empty_state _ -> Interp_costs.sapling_empty_state + | ISource _ -> Interp_costs.source + | ISender _ -> Interp_costs.sender + | ISelf _ -> Interp_costs.self + | ISelf_address _ -> Interp_costs.self_address + | IAmount _ -> Interp_costs.amount + | IDig (_, n, _, _) -> Interp_costs.dign n + | IDug (_, n, _, _) -> Interp_costs.dugn n + | IDipn (_, n, _, _, _) -> Interp_costs.dipn n + | IDropn (_, n, _, _) -> Interp_costs.dropn n + | IChainId _ -> Interp_costs.chain_id + | ICreate_contract _ -> Interp_costs.create_contract + | INever _ -> ( match accu with _ -> .) + | IVoting_power _ -> Interp_costs.voting_power + | ITotal_voting_power _ -> Interp_costs.total_voting_power + | IAdd_bls12_381_g1 _ -> Interp_costs.add_bls12_381_g1 + | IAdd_bls12_381_g2 _ -> Interp_costs.add_bls12_381_g2 + | IAdd_bls12_381_fr _ -> Interp_costs.add_bls12_381_fr + | IMul_bls12_381_g1 _ -> Interp_costs.mul_bls12_381_g1 + | IMul_bls12_381_g2 _ -> Interp_costs.mul_bls12_381_g2 + | IMul_bls12_381_fr _ -> Interp_costs.mul_bls12_381_fr + | INeg_bls12_381_g1 _ -> Interp_costs.neg_bls12_381_g1 + | INeg_bls12_381_g2 _ -> Interp_costs.neg_bls12_381_g2 + | INeg_bls12_381_fr _ -> Interp_costs.neg_bls12_381_fr + | IMul_bls12_381_fr_z _ -> + let z = accu in + Interp_costs.mul_bls12_381_fr_z z + | IMul_bls12_381_z_fr _ -> + let z, _ = stack in + Interp_costs.mul_bls12_381_z_fr z + | IDup_n (_, n, _, _) -> Interp_costs.dupn n + | IComb (_, n, _, _) -> Interp_costs.comb n + | IUncomb (_, n, _, _) -> Interp_costs.uncomb n + | IComb_get (_, n, _, _) -> Interp_costs.comb_get n + | IComb_set (_, n, _, _) -> Interp_costs.comb_set n + | ITicket _ | ITicket_deprecated _ -> Interp_costs.ticket + | IRead_ticket _ -> Interp_costs.read_ticket + | IOpen_chest _ -> + let (_chest_key : Script_timelock.chest_key) = accu + and chest, (time, _) = stack in + Interp_costs.open_chest ~chest ~time:(Script_int.to_zint time) + | IEmit _ -> Interp_costs.emit + | ILog _ -> Gas.free + [@@ocaml.inline always] + +let cost_of_control : type a s r f. (a, s, r, f) continuation -> Gas.cost = + fun ks -> + match ks with + | KLog _ -> Gas.free + | KNil -> Interp_costs.Control.nil + | KCons (_, _) -> Interp_costs.Control.cons + | KReturn _ -> Interp_costs.Control.return + | KMap_head (_, _) -> Interp_costs.Control.map_head + | KUndip (_, _, _) -> Interp_costs.Control.undip + | KLoop_in (_, _) -> Interp_costs.Control.loop_in + | KLoop_in_left (_, _) -> Interp_costs.Control.loop_in_left + | KIter (_, _, _, _) -> Interp_costs.Control.iter + | KList_enter_body (_, xs, _, _, len, _) -> + Interp_costs.Control.list_enter_body xs len + | KList_exit_body (_, _, _, _, _, _) -> Interp_costs.Control.list_exit_body + | KMap_enter_body (_, _, _, _, _) -> Interp_costs.Control.map_enter_body + | KMap_exit_body (_, _, map, key, _, _) -> + Interp_costs.Control.map_exit_body key map + | KView_exit (_, _) -> Interp_costs.Control.view_exit + +(* + + [step] calls [consume_instr] at the beginning of each execution step. + + [Local_gas_counter.consume] is used in the implementation of + [IConcat_string] and [IConcat_bytes] because in that special cases, the + cost is expressed with respect to a non-constant-time computation on the + inputs. + +*) + +let consume_instr local_gas_counter k accu stack = + let cost = cost_of_instr k accu stack in + consume_opt local_gas_counter cost + [@@ocaml.inline always] + +let consume_control local_gas_counter ks = + let cost = cost_of_control ks in + consume_opt local_gas_counter cost + [@@ocaml.inline always] + +let get_log = function + | None -> Lwt.return (Ok None) + | Some logger -> logger.get_log () + [@@ocaml.inline always] + +(* + + Auxiliary functions used by the interpretation loop + =================================================== + +*) + +(* The following function pops n elements from the stack + and push their reintroduction in the continuations stack. *) +let rec kundip : + type a s e z c u d w b t. + (a, s, e, z, c, u, d, w) stack_prefix_preservation_witness -> + c -> + u -> + (d, w, b, t) kinstr -> + a * s * (e, z, b, t) kinstr = + fun w accu stack k -> + match w with + | KPrefix (loc, ty, w) -> + let k = IConst (loc, ty, accu, k) in + let accu, stack = stack in + kundip w accu stack k + | KRest -> (accu, stack, k) + +(* [apply ctxt gas ty v lam] specializes [lam] by fixing its first + formal argument to [v]. The type of [v] is represented by [ty]. *) +let apply ctxt gas capture_ty capture lam = + let loc = Micheline.dummy_location in + let ctxt = update_context gas ctxt in + Script_ir_unparser.unparse_ty ~loc ctxt capture_ty >>?= fun (ty_expr, ctxt) -> + unparse_data ctxt Optimized capture_ty capture >>=? fun (const_expr, ctxt) -> + let make_expr expr = + Micheline.( + Seq + ( loc, + Prim (loc, I_PUSH, [ty_expr; Micheline.root const_expr], []) + :: Prim (loc, I_PAIR, [], []) + :: expr )) + in + let lam' = + match lam with + | LamRec (descr, expr) -> ( + let (Item_t (full_arg_ty, Item_t (Lambda_t (_, _, _), Bot_t))) = + descr.kbef + in + let (Item_t (ret_ty, Bot_t)) = descr.kaft in + Script_ir_unparser.unparse_ty ~loc ctxt full_arg_ty + >>?= fun (arg_ty_expr, ctxt) -> + Script_ir_unparser.unparse_ty ~loc ctxt ret_ty + >>?= fun (ret_ty_expr, ctxt) -> + match full_arg_ty with + | Pair_t (capture_ty, arg_ty, _, _) -> + let arg_stack_ty = Item_t (arg_ty, Bot_t) in + (* To avoid duplicating the recursive lambda [lam], we + return a regular lambda that builds the tuple of + parameters and applies it to `lam`. Since `lam` is + recursive it will push itself on top of the stack at + execution time. *) + let full_descr = + { + kloc = descr.kloc; + kbef = arg_stack_ty; + kaft = descr.kaft; + kinstr = + IConst + ( descr.kloc, + capture_ty, + capture, + ICons_pair + ( descr.kloc, + ILambda + ( descr.kloc, + lam, + ISwap + ( descr.kloc, + IExec + ( descr.kloc, + Some descr.kaft, + IHalt descr.kloc ) ) ) ) ); + } + in + let full_expr = + make_expr + Micheline. + [ + Prim + (loc, I_LAMBDA_REC, [arg_ty_expr; ret_ty_expr; expr], []); + Prim (loc, I_SWAP, [], []); + Prim (loc, I_EXEC, [], []); + ] + in + return (Lam (full_descr, full_expr), ctxt)) + | Lam (descr, expr) -> ( + let (Item_t (full_arg_ty, Bot_t)) = descr.kbef in + match full_arg_ty with + | Pair_t (capture_ty, arg_ty, _, _) -> + let arg_stack_ty = Item_t (arg_ty, Bot_t) in + let full_descr = + { + kloc = descr.kloc; + kbef = arg_stack_ty; + kaft = descr.kaft; + kinstr = + IConst + ( descr.kloc, + capture_ty, + capture, + ICons_pair (descr.kloc, descr.kinstr) ); + } + in + let full_expr = make_expr [expr] in + return (Lam (full_descr, full_expr), ctxt)) + in + lam' >>=? fun (lam', ctxt) -> + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + return (lam', ctxt, gas) + +let make_transaction_to_tx_rollup (type t) ctxt ~destination ~amount + ~(parameters_ty : ((t ticket, tx_rollup_l2_address) pair, _) ty) ~parameters + = + (* The entrypoints of a transaction rollup are polymorphic wrt. the + tickets it can process. However, two Michelson values can have + the same Micheline representation, but different types. What + this means is that when we start the execution of a transaction + rollup, the type of its argument is lost if we just give it the + values provided by the Michelson script. + + To address this issue, we instrument a transfer to a transaction + rollup to inject the exact type of the entrypoint as used by + the smart contract. This allows the transaction rollup to extract + the type of the ticket. *) + error_unless Tez.(amount = zero) Rollup_invalid_transaction_amount + >>?= fun () -> + let (Pair_t (Ticket_t (tp, _), _, _, _)) = parameters_ty in + unparse_data ctxt Optimized parameters_ty parameters + >>=? fun (unparsed_parameters, ctxt) -> + Lwt.return + ( Script_ir_unparser.unparse_ty ~loc:Micheline.dummy_location ctxt tp + >>? fun (ty, ctxt) -> + let unparsed_parameters = + Micheline.Seq + (Micheline.dummy_location, [Micheline.root unparsed_parameters; ty]) + in + Gas.consume ctxt (Script.strip_locations_cost unparsed_parameters) + >|? fun ctxt -> + let unparsed_parameters = Micheline.strip_locations unparsed_parameters in + ( Transaction_to_tx_rollup + {destination; parameters_ty; parameters; unparsed_parameters}, + ctxt ) ) + +let make_transaction_to_sc_rollup ctxt ~destination ~amount ~entrypoint + ~parameters_ty ~parameters = + error_unless Tez.(amount = zero) Rollup_invalid_transaction_amount + >>?= fun () -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4023 + We currently don't support entrypoints as the entrypoint information + for L1 to L2 messages is not propagated to the rollup. *) + error_unless (Entrypoint.is_default entrypoint) Rollup_invalid_entrypoint + >>?= fun () -> + unparse_data ctxt Optimized parameters_ty parameters + >|=? fun (unparsed_parameters, ctxt) -> + ( Transaction_to_sc_rollup + {destination; entrypoint; parameters_ty; parameters; unparsed_parameters}, + ctxt ) + +(** [emit_event] generates an internal operation that will effect an event emission + if the contract code returns this successfully. *) +let emit_event (type t tc) (ctxt, sc) gas ~(event_type : (t, tc) ty) + ~unparsed_ty ~tag ~(event_data : t) = + let ctxt = update_context gas ctxt in + (* No need to take care of lazy storage as only packable types are allowed *) + let lazy_storage_diff = None in + unparse_data ctxt Optimized event_type event_data + >>=? fun (unparsed_data, ctxt) -> + fresh_internal_nonce ctxt >>?= fun (ctxt, nonce) -> + let operation = Event {ty = unparsed_ty; tag; unparsed_data} in + let iop = {source = Contract.Originated sc.self; operation; nonce} in + let res = {piop = Internal_operation iop; lazy_storage_diff} in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + return (res, ctxt, gas) + +let make_transaction_to_zk_rollup (type t) ctxt ~destination ~amount + ~(parameters_ty : ((t ticket, bytes) pair, _) ty) ~parameters = + error_unless Tez.(amount = zero) Rollup_invalid_transaction_amount + >>?= fun () -> + unparse_data ctxt Optimized parameters_ty parameters + >|=? fun (unparsed_parameters, ctxt) -> + ( Transaction_to_zk_rollup + {destination; parameters_ty; parameters; unparsed_parameters}, + ctxt ) + +(* [transfer (ctxt, sc) gas tez parameters_ty parameters destination entrypoint] + creates an operation that transfers an amount of [tez] to a destination and + an entrypoint instantiated with argument [parameters] of type + [parameters_ty]. *) +let transfer (type t) (ctxt, sc) gas amount location + (typed_contract : t typed_contract) (parameters : t) = + let ctxt = update_context gas ctxt in + (match typed_contract with + | Typed_implicit destination -> + let () = parameters in + return (Transaction_to_implicit {destination; amount}, None, ctxt) + | Typed_implicit_with_ticket {destination; ticket_ty} -> + unparse_data ctxt Optimized ticket_ty parameters + >>=? fun (unparsed_ticket, ctxt) -> + return + ( Transaction_to_implicit_with_ticket + { + destination; + amount; + ticket_ty; + ticket = parameters; + unparsed_ticket = Script.lazy_expr unparsed_ticket; + }, + None, + ctxt ) + | Typed_originated + {arg_ty = parameters_ty; contract_hash = destination; entrypoint} -> + collect_lazy_storage ctxt parameters_ty parameters + >>?= fun (to_duplicate, ctxt) -> + let to_update = no_lazy_storage_id in + extract_lazy_storage_diff + ctxt + Optimized + parameters_ty + parameters + ~to_duplicate + ~to_update + ~temporary:true + >>=? fun (parameters, lazy_storage_diff, ctxt) -> + unparse_data ctxt Optimized parameters_ty parameters + >|=? fun (unparsed_parameters, ctxt) -> + ( Transaction_to_smart_contract + { + destination; + amount; + entrypoint; + location; + parameters_ty; + parameters; + unparsed_parameters; + }, + lazy_storage_diff, + ctxt ) + | Typed_tx_rollup {arg_ty = parameters_ty; tx_rollup = destination} -> + make_transaction_to_tx_rollup + ctxt + ~destination + ~amount + ~parameters_ty + ~parameters + >|=? fun (operation, ctxt) -> (operation, None, ctxt) + | Typed_sc_rollup + {arg_ty = parameters_ty; sc_rollup = destination; entrypoint} -> + make_transaction_to_sc_rollup + ctxt + ~destination + ~amount + ~entrypoint + ~parameters_ty + ~parameters + >|=? fun (operation, ctxt) -> (operation, None, ctxt) + | Typed_zk_rollup {arg_ty = parameters_ty; zk_rollup = destination} -> + make_transaction_to_zk_rollup + ctxt + ~destination + ~amount + ~parameters_ty + ~parameters + >|=? fun (operation, ctxt) -> (operation, None, ctxt)) + >>=? fun (operation, lazy_storage_diff, ctxt) -> + fresh_internal_nonce ctxt >>?= fun (ctxt, nonce) -> + let iop = {source = Contract.Originated sc.self; operation; nonce} in + let res = {piop = Internal_operation iop; lazy_storage_diff} in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + return (res, ctxt, gas) + +(** [create_contract (ctxt, sc) gas storage_ty code delegate credit init] + creates an origination operation for a contract represented by [code], some + initial [credit] (withdrawn from the contract being executed), and an + initial storage [init] of type [storage_ty]. *) +let create_contract (ctxt, sc) gas storage_type code delegate credit init = + let ctxt = update_context gas ctxt in + collect_lazy_storage ctxt storage_type init >>?= fun (to_duplicate, ctxt) -> + let to_update = no_lazy_storage_id in + extract_lazy_storage_diff + ctxt + Optimized + storage_type + init + ~to_duplicate + ~to_update + ~temporary:true + >>=? fun (init, lazy_storage_diff, ctxt) -> + unparse_data ctxt Optimized storage_type init + >>=? fun (unparsed_storage, ctxt) -> + Contract.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, preorigination) -> + let operation = + Origination + { + credit; + delegate; + code; + unparsed_storage; + preorigination; + storage_type; + storage = init; + } + in + fresh_internal_nonce ctxt >>?= fun (ctxt, nonce) -> + let source = Contract.Originated sc.self in + let piop = Internal_operation {source; operation; nonce} in + let res = {piop; lazy_storage_diff} in + let gas, ctxt = local_gas_counter_and_outdated_context ctxt in + return (res, preorigination, ctxt, gas) + +(* [unpack ctxt ty bytes] deserialize [bytes] into a value of type [ty]. *) +let unpack ctxt ~ty ~bytes = + Gas.consume + ctxt + (Script.deserialization_cost_estimated_from_bytes (Bytes.length bytes)) + >>?= fun ctxt -> + if + Compare.Int.(Bytes.length bytes >= 1) + && Compare.Int.(TzEndian.get_uint8 bytes 0 = 0x05) + then + let str = Bytes.sub_string bytes 1 (Bytes.length bytes - 1) in + match Data_encoding.Binary.of_string_opt Script.expr_encoding str with + | None -> + Lwt.return + ( Gas.consume ctxt (Interp_costs.unpack_failed str) >|? fun ctxt -> + (None, ctxt) ) + | Some expr -> ( + parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + ~allow_forged:false + ty + (Micheline.root expr) + >|= function + | Ok (value, ctxt) -> ok (Some value, ctxt) + | Error _ignored -> + Gas.consume ctxt (Interp_costs.unpack_failed str) >|? fun ctxt -> + (None, ctxt)) + else return (None, ctxt) + +(* [interp_stack_prefix_preserving_operation f w accu stack] applies + a well-typed operation [f] under some prefix of the A-stack + exploiting [w] to justify that the shape of the stack is + preserved. *) +let rec interp_stack_prefix_preserving_operation : + type a s b t c u d w result. + (a -> s -> (b * t) * result) -> + (a, s, b, t, c, u, d, w) stack_prefix_preservation_witness -> + c -> + u -> + (d * w) * result = + fun f n accu stk -> + match (n, stk) with + | KPrefix (_, _, n), rest -> + interp_stack_prefix_preserving_operation f n (fst rest) (snd rest) + |> fun ((v, rest'), result) -> ((accu, (v, rest')), result) + | KRest, v -> f accu v + +(* + + Some auxiliary functions have complex types and must be annotated + because of GADTs and polymorphic recursion. + + To improve readibility, we introduce their types as abbreviations: + + *) + +(* A function of this type either introduces type-preserving + instrumentation of a continuation for the purposes of logging + or returns given continuation unchanged. *) +type ('a, 'b, 'c, 'd) cont_instrumentation = + ('a, 'b, 'c, 'd) continuation -> ('a, 'b, 'c, 'd) continuation + +let id x = x + +type ('a, 'b, 'c, 'e, 'f, 'm, 'n, 'o) kmap_exit_type = + ('a, 'b, 'e, 'f) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('m * 'n, 'a * 'b, 'o, 'a * 'b) kinstr -> + ('m * 'n) list -> + (('m, 'o) map, 'c) ty option -> + ('m, 'o) map -> + 'm -> + (('m, 'o) map, 'a * 'b, 'e, 'f) continuation -> + 'o -> + 'a * 'b -> + ('e * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'j, 'k) kmap_enter_type = + ('a, 'b * 'c, 'd, 'e) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('j * 'k, 'b * 'c, 'a, 'b * 'c) kinstr -> + ('j * 'k) list -> + (('j, 'a) map, 'f) ty option -> + ('j, 'a) map -> + (('j, 'a) map, 'b * 'c, 'd, 'e) continuation -> + 'b -> + 'c -> + ('d * 'e * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'i, 'j) klist_exit_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('i, 'a * 'b, 'j, 'a * 'b) kinstr -> + 'i list -> + 'j Script_list.t -> + ('j Script_list.t, 'e) ty option -> + int -> + ('j Script_list.t, 'a * 'b, 'c, 'd) continuation -> + 'j -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'j) klist_enter_type = + ('b, 'a * 'c, 'd, 'e) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('j, 'a * 'c, 'b, 'a * 'c) kinstr -> + 'j list -> + 'b Script_list.t -> + ('b Script_list.t, 'f) ty option -> + int -> + ('b Script_list.t, 'a * 'c, 'd, 'e) continuation -> + 'a -> + 'c -> + ('d * 'e * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g) kloop_in_left_type = + outdated_context * step_constants -> + local_gas_counter -> + ('c, 'd, 'e, 'f) continuation -> + ('a, 'g, 'c, 'd) kinstr -> + ('b, 'g, 'e, 'f) continuation -> + ('a, 'b) union -> + 'g -> + ('e * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'r, 'f, 's) kloop_in_type = + outdated_context * step_constants -> + local_gas_counter -> + ('b, 'c, 'r, 'f) continuation -> + ('a, 's, 'b, 'c) kinstr -> + ('a, 's, 'r, 'f) continuation -> + bool -> + 'a * 's -> + ('r * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 's, 'r, 'f, 'c) kiter_type = + ('a, 's, 'r, 'f) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('b, 'a * 's, 'a, 's) kinstr -> + ('b, 'c) ty option -> + 'b list -> + ('a, 's, 'r, 'f) continuation -> + 'a -> + 's -> + ('r * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i) ilist_map_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('e, 'a * 'b, 'f, 'a * 'b) kinstr -> + ('f Script_list.t, 'a * 'b, 'g, 'h) kinstr -> + ('g, 'h, 'c, 'd) continuation -> + ('f Script_list.t, 'i) ty option -> + 'e Script_list.t -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'cmp) ilist_iter_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('e, 'a * 'b, 'a, 'b) kinstr -> + ('e, 'cmp) ty option -> + ('a, 'b, 'f, 'g) kinstr -> + ('f, 'g, 'c, 'd) continuation -> + 'e Script_list.t -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g) iset_iter_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('e, 'a * 'b, 'a, 'b) kinstr -> + 'e comparable_ty option -> + ('a, 'b, 'f, 'g) kinstr -> + ('f, 'g, 'c, 'd) continuation -> + 'e set -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j) imap_map_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('e * 'f, 'a * 'b, 'g, 'a * 'b) kinstr -> + (('e, 'g) map, 'a * 'b, 'h, 'i) kinstr -> + ('h, 'i, 'c, 'd) continuation -> + (('e, 'g) map, 'j) ty option -> + ('e, 'f) map -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'cmp) imap_iter_type = + ('a, 'b, 'c, 'd) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('e * 'f, 'a * 'b, 'a, 'b) kinstr -> + ('e * 'f, 'cmp) ty option -> + ('a, 'b, 'g, 'h) kinstr -> + ('g, 'h, 'c, 'd) continuation -> + ('e, 'f) map -> + 'a * 'b -> + ('c * 'd * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f) imul_teznat_type = + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + (Tez.t, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + Tez.t -> + Script_int.n Script_int.num * 'b -> + ('e * 'f * outdated_context * local_gas_counter, error trace) result Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f) imul_nattez_type = + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + (Tez.t, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + Script_int.n Script_int.num -> + Tez.t * 'b -> + ('e * 'f * outdated_context * local_gas_counter, error trace) result Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f) ilsl_nat_type = + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + (Script_int.n Script_int.num, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + Script_int.n Script_int.num -> + Script_int.n Script_int.num * 'b -> + ('e * 'f * outdated_context * local_gas_counter, error trace) result Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f) ilsr_nat_type = + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + (Script_int.n Script_int.num, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + Script_int.n Script_int.num -> + Script_int.n Script_int.num * 'b -> + ('e * 'f * outdated_context * local_gas_counter, error trace) result Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f) ilsl_bytes_type = + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + (bytes, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + bytes -> + Script_int.n Script_int.num * 'b -> + ('e * 'f * outdated_context * local_gas_counter, error trace) result Lwt.t + +type ifailwith_type = { + ifailwith : + 'a 'ac 'b. + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + Script.location -> + ('a, 'ac) ty -> + 'a -> + ('b, error trace) result Lwt.t; +} +[@@unboxed] + +type ('a, 'b, 'c, 'd, 'e, 'f, 'g) iexec_type = + ('a, end_of_stack, 'e, 'f) cont_instrumentation -> + logger option -> + outdated_context * step_constants -> + local_gas_counter -> + ('a, 'b) stack_ty option -> + ('a, 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + 'g -> + ('g, 'a) lambda * 'b -> + ('e * 'f * outdated_context * local_gas_counter) tzresult Lwt.t + +type ('a, 'b, 'c, 'd, 'e, 'f, 'i, 'o) iview_type = + ('o, end_of_stack, 'e, 'f) cont_instrumentation -> + outdated_context * step_constants -> + local_gas_counter -> + ('i, 'o) view_signature -> + ('a, 'b) stack_ty option -> + ('o option, 'a * 'b, 'c, 'd) kinstr -> + ('c, 'd, 'e, 'f) continuation -> + 'i -> + address * ('a * 'b) -> + ('e * 'f * outdated_context * local_gas_counter) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.ml b/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.ml new file mode 100644 index 000000000000..6c477246b467 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.ml @@ -0,0 +1,260 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Micheline +open Script_tc_errors + +type var_annot = Var_annot + +type type_annot = Type_annot + +type field_annot = Field_annot of Non_empty_string.t [@@ocaml.unboxed] + +let error_unexpected_annot loc annot = + match annot with + | [] -> Result.return_unit + | _ :: _ -> error (Unexpected_annotation loc) + +(* Check that the predicate p holds on all s.[k] for k >= i *) +let string_iter p s i = + let len = String.length s in + let rec aux i = + if Compare.Int.(i >= len) then Result.return_unit + else p s.[i] >>? fun () -> aux (i + 1) + in + aux i + +let is_allowed_char = function + | 'a' .. 'z' | 'A' .. 'Z' | '_' | '.' | '%' | '@' | '0' .. '9' -> true + | _ -> false + +(* Valid annotation characters as defined by the allowed_annot_char function from lib_micheline/micheline_parser *) +let check_char loc c = + if is_allowed_char c then Result.return_unit + else error (Unexpected_annotation loc) + +(* This constant is defined in lib_micheline/micheline_parser which is not available in the environment. *) +let max_annot_length = 255 + +type annot_opt = + | Field_annot_opt of Non_empty_string.t option + | Type_annot_opt of type_annot option + | Var_annot_opt of var_annot option + +let at = Non_empty_string.of_string_exn "@" + +let parse_annot loc s = + (* allow empty annotations as wildcards but otherwise only accept + annotations that start with [a-zA-Z_] *) + let sub_or_wildcard wrap s = + match Non_empty_string.of_string s with + | None -> ok @@ wrap None + | Some s -> ( + match (s :> string).[0] with + | 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' -> + (* check that all characters are valid*) + string_iter (check_char loc) (s :> string) 1 >>? fun () -> + ok @@ wrap (Some s) + | _ -> error (Unexpected_annotation loc)) + in + let len = String.length s in + if Compare.Int.(len = 0 || len > max_annot_length) then + error (Unexpected_annotation loc) + else + let rest = String.sub s 1 (len - 1) in + match s.[0] with + | ':' -> + sub_or_wildcard + (fun a -> + Type_annot_opt + (Option.map (fun (_ : Non_empty_string.t) -> Type_annot) a)) + rest + | '@' -> + sub_or_wildcard + (fun a -> + Var_annot_opt + (Option.map (fun (_ : Non_empty_string.t) -> Var_annot) a)) + rest + | '%' -> sub_or_wildcard (fun a -> Field_annot_opt a) rest + | _ -> error (Unexpected_annotation loc) + +let parse_annots loc ?(allow_special_var = false) ?(allow_special_field = false) + l = + List.map_e + (function + | "@%" when allow_special_var -> ok @@ Var_annot_opt (Some Var_annot) + | "@%%" when allow_special_var -> ok @@ Var_annot_opt (Some Var_annot) + | "%@" when allow_special_field -> ok @@ Field_annot_opt (Some at) + | s -> parse_annot loc s) + l + +let opt_field_of_field_opt = function + | None -> None + | Some a -> Some (Field_annot a) + +let classify_annot loc l : + (var_annot option list * type_annot option list * field_annot option list) + tzresult = + try + let _, rv, _, rt, _, rf = + List.fold_left + (fun (in_v, rv, in_t, rt, in_f, rf) a -> + match (a, in_v, rv, in_t, rt, in_f, rf) with + | Var_annot_opt a, true, _, _, _, _, _ + | Var_annot_opt a, false, [], _, _, _, _ -> + (true, a :: rv, false, rt, false, rf) + | Type_annot_opt a, _, _, true, _, _, _ + | Type_annot_opt a, _, _, false, [], _, _ -> + (false, rv, true, a :: rt, false, rf) + | Field_annot_opt a, _, _, _, _, true, _ + | Field_annot_opt a, _, _, _, _, false, [] -> + (false, rv, false, rt, true, opt_field_of_field_opt a :: rf) + | _ -> raise Exit) + (false, [], false, [], false, []) + l + in + ok (List.rev rv, List.rev rt, List.rev rf) + with Exit -> error (Ungrouped_annotations loc) + +let get_one_annot loc = function + | [] -> Result.return_none + | [a] -> ok a + | _ -> error (Unexpected_annotation loc) + +let get_two_annot loc = function + | [] -> ok (None, None) + | [a] -> ok (a, None) + | [a; b] -> ok (a, b) + | _ -> error (Unexpected_annotation loc) + +let check_type_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc vars >>? fun () -> + error_unexpected_annot loc fields >>? fun () -> + get_one_annot loc types >|? fun (_a : type_annot option) -> () + +let check_composed_type_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc vars >>? fun () -> + get_one_annot loc types >>? fun (_t : type_annot option) -> + get_two_annot loc fields >|? fun (_f1, _f2) -> () + +let parse_field_annot : + Script.location -> string -> Non_empty_string.t option tzresult = + fun loc annot -> + if Compare.Int.(String.length annot <= 0) || Compare.Char.(annot.[0] <> '%') + then Result.return_none + else + parse_annot loc annot >|? function + | Field_annot_opt annot_opt -> annot_opt + | _ -> None + +let is_field_annot loc a = parse_field_annot loc a >|? Option.is_some + +let extract_field_annot : + Script.node -> (Script.node * Non_empty_string.t option) tzresult = function + | Prim (loc, prim, args, annot) as expr -> + let rec extract_first acc = function + | [] -> ok (expr, None) + | s :: rest -> ( + parse_field_annot loc s >>? function + | None -> extract_first (s :: acc) rest + | Some _ as some_field_annot -> + let annot = List.rev_append acc rest in + ok (Prim (loc, prim, args, annot), some_field_annot)) + in + extract_first [] annot + | expr -> ok (expr, None) + +let has_field_annot node = + extract_field_annot node >|? function + | _node, Some _ -> true + | _node, None -> false + +let remove_field_annot node = + extract_field_annot node >|? fun (node, _a) -> node + +let extract_entrypoint_annot node = + extract_field_annot node >|? fun (node, field_annot_opt) -> + ( node, + Option.bind field_annot_opt (fun field_annot -> + Entrypoint.of_annot_lax_opt field_annot) ) + +let check_var_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc types >>? fun () -> + error_unexpected_annot loc fields >>? fun () -> + get_one_annot loc vars >|? fun (_a : var_annot option) -> () + +let check_constr_annot loc annot = + parse_annots ~allow_special_field:true loc annot >>? classify_annot loc + >>? fun (vars, types, fields) -> + get_one_annot loc vars >>? fun (_v : var_annot option) -> + get_one_annot loc types >>? fun (_t : type_annot option) -> + get_two_annot loc fields >|? fun (_f1, _f2) -> () + +let check_two_var_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc types >>? fun () -> + error_unexpected_annot loc fields >>? fun () -> + get_two_annot loc vars >|? fun (_a1, _a2) -> () + +let check_destr_annot loc annot = + parse_annots loc ~allow_special_var:true annot >>? classify_annot loc + >>? fun (vars, types, fields) -> + error_unexpected_annot loc types >>? fun () -> + get_one_annot loc vars >>? fun (_v : var_annot option) -> + get_one_annot loc fields >|? fun (_f : field_annot option) -> () + +let check_unpair_annot loc annot = + parse_annots loc ~allow_special_var:true annot >>? classify_annot loc + >>? fun (vars, types, fields) -> + error_unexpected_annot loc types >>? fun () -> + get_two_annot loc vars >>? fun (_vcar, _vcdr) -> + get_two_annot loc fields >|? fun (_f1, _f2) -> () + +let parse_entrypoint_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc types >>? fun () -> + get_one_annot loc fields >>? fun f -> + get_one_annot loc vars >|? fun (_v : var_annot option) -> f + +let parse_entrypoint_annot_strict loc annot = + parse_entrypoint_annot loc annot >>? function + | None -> Ok Entrypoint.default + | Some (Field_annot a) -> Entrypoint.of_annot_strict ~loc a + +let parse_entrypoint_annot_lax loc annot = + parse_entrypoint_annot loc annot >>? function + | None -> Ok Entrypoint.default + | Some (Field_annot annot) -> Entrypoint.of_annot_lax annot + +let check_var_type_annot loc annot = + parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> + error_unexpected_annot loc fields >>? fun () -> + get_one_annot loc vars >>? fun (_v : var_annot option) -> + get_one_annot loc types >|? fun (_t : type_annot option) -> () diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.mli b/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.mli new file mode 100644 index 000000000000..4f3740fbe2a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_annot.mli @@ -0,0 +1,87 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** @return an error {!Unexpected_annotation} in the monad the list is not empty. *) +val error_unexpected_annot : Script.location -> 'a list -> unit tzresult + +(** check_xxx_annot functions below are remains from the past (they were called + parse_xxx_annot before). + They check that annotations are well-formed and, depending on different + contexts, that only the annotations that are expected to be found are + present. + Hopefully we will relax this property soon. +*) + +(** Check a type annotation only. *) +val check_type_annot : Script.location -> string list -> unit tzresult + +(** Check a field annotation only. *) +val is_field_annot : Script.location -> string -> bool tzresult + +(** Check an annotation for composed types, of the form + [:ty_name %field1 %field2] in any order. *) +val check_composed_type_annot : Script.location -> string list -> unit tzresult + +(** Checks whether a node has a field annotation. *) +val has_field_annot : Script.node -> bool tzresult + +(** Removes a field annotation from a node. *) +val remove_field_annot : Script.node -> Script.node tzresult + +(** Extract and remove a field annotation as an entrypoint from a node *) +val extract_entrypoint_annot : + Script.node -> (Script.node * Entrypoint.t option) tzresult + +(** Instruction annotations parsing *) + +(** Check a variable annotation. *) +val check_var_annot : Script.location -> string list -> unit tzresult + +val is_allowed_char : char -> bool + +val check_constr_annot : Script.location -> string list -> unit tzresult + +val check_two_var_annot : Script.location -> string list -> unit tzresult + +val check_destr_annot : Script.location -> string list -> unit tzresult + +val check_unpair_annot : Script.location -> string list -> unit tzresult + +(** Parses a field annotation and converts it to an entrypoint. + An error is returned if the annotation is too long or is "default". + An empty annotation is converted to "default". *) +val parse_entrypoint_annot_strict : + Script.location -> string list -> Entrypoint.t tzresult + +(** Parse a field annotation and convert it to an entrypoint. + An error is returned if the field annot is too long. + An empty annotation is converted to "default". *) +val parse_entrypoint_annot_lax : + Script.location -> string list -> Entrypoint.t tzresult + +val check_var_type_annot : Script.location -> string list -> unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.ml b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.ml new file mode 100644 index 000000000000..58fc63442c53 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.ml @@ -0,0 +1,5528 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Micheline +open Script +open Script_tc_errors +open Script_ir_annot +open Script_typed_ir +open Script_ir_unparser +module Typecheck_costs = Michelson_v1_gas.Cost_of.Typechecking +module Unparse_costs = Michelson_v1_gas.Cost_of.Unparsing +module Tc_context = Script_tc_context + +type elab_conf = Script_ir_translator_config.elab_config + +type ex_stack_ty = Ex_stack_ty : ('a, 's) stack_ty -> ex_stack_ty + +(* Equality witnesses *) +type ('ta, 'tb) eq = Eq : ('same, 'same) eq + +(* + + The following type represents an instruction parameterized by its + continuation. During the elaboration of the typed term, a sequence + of instructions in Micheline is read from left to right: hence, the + elaboration needs to wait for the next instruction to be elaborated + to be able to construct the current instruction. + +*) +type ('a, 's, 'b, 'u) cinstr = { + apply : 'r 'f. ('b, 'u, 'r, 'f) kinstr -> ('a, 's, 'r, 'f) kinstr; +} +[@@ocaml.unboxed] + +(* + + While a [Script_typed_ir.descr] contains a fully defined + instruction, [descr] contains a [cinstr], that is an instruction + parameterized by the next instruction, as explained in the previous + comment. + +*) +type ('a, 's, 'b, 'u) descr = { + loc : Script.location; + bef : ('a, 's) stack_ty; + aft : ('b, 'u) stack_ty; + instr : ('a, 's, 'b, 'u) cinstr; +} + +let close_descr {loc; bef; aft; instr} = + let kinstr = instr.apply (IHalt loc) in + {kloc = loc; kbef = bef; kaft = aft; kinstr} + +let compose_descr : + type a s b u c v. + Script.location -> + (a, s, b, u) descr -> + (b, u, c, v) descr -> + (a, s, c, v) descr = + fun loc d1 d2 -> + { + loc; + bef = d1.bef; + aft = d2.aft; + instr = {apply = (fun k -> d1.instr.apply (d2.instr.apply k))}; + } + +type tc_context = Tc_context.t + +(* ---- Error helpers -------------------------------------------------------*) + +let location = function + | Prim (loc, _, _, _) + | Int (loc, _) + | String (loc, _) + | Bytes (loc, _) + | Seq (loc, _) -> + loc + +let kind_equal a b = + match (a, b) with + | Int_kind, Int_kind + | String_kind, String_kind + | Bytes_kind, Bytes_kind + | Prim_kind, Prim_kind + | Seq_kind, Seq_kind -> + true + | _ -> false + +let kind = function + | Int _ -> Int_kind + | String _ -> String_kind + | Bytes _ -> Bytes_kind + | Prim _ -> Prim_kind + | Seq _ -> Seq_kind + +let unexpected expr exp_kinds exp_ns exp_prims = + match expr with + | Int (loc, _) -> Invalid_kind (loc, Prim_kind :: exp_kinds, Int_kind) + | String (loc, _) -> Invalid_kind (loc, Prim_kind :: exp_kinds, String_kind) + | Bytes (loc, _) -> Invalid_kind (loc, Prim_kind :: exp_kinds, Bytes_kind) + | Seq (loc, _) -> Invalid_kind (loc, Prim_kind :: exp_kinds, Seq_kind) + | Prim (loc, name, _, _) -> ( + let open Michelson_v1_primitives in + match (namespace name, exp_ns) with + | Type_namespace, Type_namespace + | Instr_namespace, Instr_namespace + | Constant_namespace, Constant_namespace -> + Invalid_primitive (loc, exp_prims, name) + | ns, _ -> Invalid_namespace (loc, name, exp_ns, ns)) + +let check_kind kinds expr = + let kind = kind expr in + if List.exists (kind_equal kind) kinds then Result.return_unit + else + let loc = location expr in + error (Invalid_kind (loc, kinds, kind)) + +let check_comparable : + type a ac. + Script.location -> (a, ac) ty -> (ac, Dependent_bool.yes) eq tzresult = + fun loc ty -> + match is_comparable ty with + | Yes -> ok Eq + | No -> + let t = Script_ir_unparser.serialize_ty_for_error ty in + error (Comparable_type_expected (loc, t)) + +let pack_node unparsed ctxt = + let bytes = + Data_encoding.( + Binary.to_bytes_exn (tup2 (Fixed.string Plain 1) expr_encoding)) + ("\x05", unparsed) + in + (bytes, ctxt) + +let pack_comparable_data ctxt ty data = + unparse_comparable_data ctxt Optimized_legacy ty data + >|=? fun (unparsed, ctxt) -> pack_node unparsed ctxt + +let hash_bytes ctxt bytes = + Gas.consume ctxt (Michelson_v1_gas.Cost_of.Interpreter.blake2b bytes) + >|? fun ctxt -> (Script_expr_hash.(hash_bytes [bytes]), ctxt) + +let hash_comparable_data ctxt ty data = + pack_comparable_data ctxt ty data >>=? fun (bytes, ctxt) -> + Lwt.return @@ hash_bytes ctxt bytes + +(* ---- Tickets ------------------------------------------------------------ *) + +(* + All comparable types are dupable, this function exists only to not forget + checking this property when adding new types. +*) +let check_dupable_comparable_ty : type a. a comparable_ty -> unit = function + | Unit_t | Never_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t + | Mutez_t | Bool_t | Key_hash_t | Key_t | Timestamp_t | Chain_id_t | Address_t + | Tx_rollup_l2_address_t | Pair_t _ | Union_t _ | Option_t _ -> + () + +let check_dupable_ty ctxt loc ty = + let rec aux : type a ac. location -> (a, ac) ty -> (unit, error) Gas_monad.t = + fun loc ty -> + let open Gas_monad.Syntax in + let* () = Gas_monad.consume_gas Typecheck_costs.check_dupable_cycle in + match ty with + | Unit_t -> return_unit + | Int_t -> return_unit + | Nat_t -> return_unit + | Signature_t -> return_unit + | String_t -> return_unit + | Bytes_t -> return_unit + | Mutez_t -> return_unit + | Key_hash_t -> return_unit + | Key_t -> return_unit + | Timestamp_t -> return_unit + | Address_t -> return_unit + | Tx_rollup_l2_address_t -> return_unit + | Bool_t -> return_unit + | Contract_t _ -> return_unit + | Operation_t -> return_unit + | Chain_id_t -> return_unit + | Never_t -> return_unit + | Bls12_381_g1_t -> return_unit + | Bls12_381_g2_t -> return_unit + | Bls12_381_fr_t -> return_unit + | Sapling_state_t _ -> return_unit + | Sapling_transaction_t _ -> return_unit + | Sapling_transaction_deprecated_t _ -> return_unit + | Chest_t -> return_unit + | Chest_key_t -> return_unit + | Ticket_t _ -> fail @@ Unexpected_ticket loc + | Pair_t (ty_a, ty_b, _, _) -> + let* () = aux loc ty_a in + aux loc ty_b + | Union_t (ty_a, ty_b, _, _) -> + let* () = aux loc ty_a in + aux loc ty_b + | Lambda_t (_, _, _) -> + (* + Lambda are dupable as long as: + - they don't contain non-dupable values, e.g. in `PUSH` + (mostly non-dupable values should probably be considered forged) + - they are not the result of a partial application on a non-dupable + value. `APPLY` rejects non-packable types (because of `PUSH`). + Hence non-dupable should imply non-packable. + *) + return_unit + | Option_t (ty, _, _) -> aux loc ty + | List_t (ty, _) -> aux loc ty + | Set_t (key_ty, _) -> + let () = check_dupable_comparable_ty key_ty in + return_unit + | Map_t (key_ty, val_ty, _) -> + let () = check_dupable_comparable_ty key_ty in + aux loc val_ty + | Big_map_t (key_ty, val_ty, _) -> + let () = check_dupable_comparable_ty key_ty in + aux loc val_ty + in + let gas = aux loc ty in + Gas_monad.run ctxt gas >>? fun (res, ctxt) -> + match res with Ok () -> ok ctxt | Error e -> error e + +let type_metadata_eq : + type error_trace. + error_details:(_, error_trace) error_details -> + 'a ty_metadata -> + 'b ty_metadata -> + (unit, error_trace) result = + fun ~error_details {size = size_a} {size = size_b} -> + Type_size.check_eq ~error_details size_a size_b + +let default_ty_eq_error loc ty1 ty2 = + let ty1 = serialize_ty_for_error ty1 in + let ty2 = serialize_ty_for_error ty2 in + Inconsistent_types (loc, ty1, ty2) + +let memo_size_eq : + type error_trace. + error_details:(_, error_trace) error_details -> + Sapling.Memo_size.t -> + Sapling.Memo_size.t -> + (unit, error_trace) result = + fun ~error_details ms1 ms2 -> + if Sapling.Memo_size.equal ms1 ms2 then Result.return_unit + else + Error + (match error_details with + | Fast -> Inconsistent_types_fast + | Informative _ -> trace_of_error @@ Inconsistent_memo_sizes (ms1, ms2)) + +(* Check that two types are equal. + + The result is an equality witness between the types of the two inputs within + the gas monad (for gas consumption). +*) +let rec ty_eq : + type a ac b bc error_trace. + error_details:(Script.location, error_trace) error_details -> + (a, ac) ty -> + (b, bc) ty -> + (((a, ac) ty, (b, bc) ty) eq, error_trace) Gas_monad.t = + fun ~error_details ty1 ty2 -> + let type_metadata_eq meta1 meta2 = + Gas_monad.of_result (type_metadata_eq ~error_details meta1 meta2) + |> Gas_monad.record_trace_eval ~error_details (fun loc -> + default_ty_eq_error loc ty1 ty2) + in + let memo_size_eq ms1 ms2 = + Gas_monad.of_result (memo_size_eq ~error_details ms1 ms2) + in + let rec help : + type ta tac tb tbc. + (ta, tac) ty -> + (tb, tbc) ty -> + (((ta, tac) ty, (tb, tbc) ty) eq, error_trace) Gas_monad.t = + fun ty1 ty2 -> + help0 ty1 ty2 + |> Gas_monad.record_trace_eval ~error_details (fun loc -> + default_ty_eq_error loc ty1 ty2) + and help0 : + type ta tac tb tbc. + (ta, tac) ty -> + (tb, tbc) ty -> + (((ta, tac) ty, (tb, tbc) ty) eq, error_trace) Gas_monad.t = + fun ty1 ty2 -> + let open Gas_monad.Syntax in + let* () = Gas_monad.consume_gas Typecheck_costs.merge_cycle in + let not_equal () = + Gas_monad.of_result + @@ Error + (match error_details with + | Fast -> (Inconsistent_types_fast : error_trace) + | Informative loc -> + trace_of_error @@ default_ty_eq_error loc ty1 ty2) + in + match (ty1, ty2) with + | Unit_t, Unit_t -> return (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Unit_t, _ -> not_equal () + | Int_t, Int_t -> return Eq + | Int_t, _ -> not_equal () + | Nat_t, Nat_t -> return Eq + | Nat_t, _ -> not_equal () + | Key_t, Key_t -> return Eq + | Key_t, _ -> not_equal () + | Key_hash_t, Key_hash_t -> return Eq + | Key_hash_t, _ -> not_equal () + | String_t, String_t -> return Eq + | String_t, _ -> not_equal () + | Bytes_t, Bytes_t -> return Eq + | Bytes_t, _ -> not_equal () + | Signature_t, Signature_t -> return Eq + | Signature_t, _ -> not_equal () + | Mutez_t, Mutez_t -> return Eq + | Mutez_t, _ -> not_equal () + | Timestamp_t, Timestamp_t -> return Eq + | Timestamp_t, _ -> not_equal () + | Address_t, Address_t -> return Eq + | Address_t, _ -> not_equal () + | Tx_rollup_l2_address_t, Tx_rollup_l2_address_t -> return Eq + | Tx_rollup_l2_address_t, _ -> not_equal () + | Bool_t, Bool_t -> return Eq + | Bool_t, _ -> not_equal () + | Chain_id_t, Chain_id_t -> return Eq + | Chain_id_t, _ -> not_equal () + | Never_t, Never_t -> return Eq + | Never_t, _ -> not_equal () + | Operation_t, Operation_t -> return Eq + | Operation_t, _ -> not_equal () + | Bls12_381_g1_t, Bls12_381_g1_t -> return Eq + | Bls12_381_g1_t, _ -> not_equal () + | Bls12_381_g2_t, Bls12_381_g2_t -> return Eq + | Bls12_381_g2_t, _ -> not_equal () + | Bls12_381_fr_t, Bls12_381_fr_t -> return Eq + | Bls12_381_fr_t, _ -> not_equal () + | Map_t (tal, tar, meta1), Map_t (tbl, tbr, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let* Eq = help tar tbr in + let+ Eq = ty_eq ~error_details tal tbl in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Map_t _, _ -> not_equal () + | Big_map_t (tal, tar, meta1), Big_map_t (tbl, tbr, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let* Eq = help tar tbr in + let+ Eq = ty_eq ~error_details tal tbl in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Big_map_t _, _ -> not_equal () + | Set_t (ea, meta1), Set_t (eb, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let+ Eq = ty_eq ~error_details ea eb in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Set_t _, _ -> not_equal () + | Ticket_t (ea, meta1), Ticket_t (eb, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let+ Eq = ty_eq ~error_details ea eb in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Ticket_t _, _ -> not_equal () + | Pair_t (tal, tar, meta1, cmp1), Pair_t (tbl, tbr, meta2, cmp2) -> + let* () = type_metadata_eq meta1 meta2 in + let* Eq = help tal tbl in + let+ Eq = help tar tbr in + let Eq = Dependent_bool.merge_dand cmp1 cmp2 in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Pair_t _, _ -> not_equal () + | Union_t (tal, tar, meta1, cmp1), Union_t (tbl, tbr, meta2, cmp2) -> + let* () = type_metadata_eq meta1 meta2 in + let* Eq = help tal tbl in + let+ Eq = help tar tbr in + let Eq = Dependent_bool.merge_dand cmp1 cmp2 in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Union_t _, _ -> not_equal () + | Lambda_t (tal, tar, meta1), Lambda_t (tbl, tbr, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let* Eq = help tal tbl in + let+ Eq = help tar tbr in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Lambda_t _, _ -> not_equal () + | Contract_t (tal, meta1), Contract_t (tbl, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let+ Eq = help tal tbl in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Contract_t _, _ -> not_equal () + | Option_t (tva, meta1, _), Option_t (tvb, meta2, _) -> + let* () = type_metadata_eq meta1 meta2 in + let+ Eq = help tva tvb in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | Option_t _, _ -> not_equal () + | List_t (tva, meta1), List_t (tvb, meta2) -> + let* () = type_metadata_eq meta1 meta2 in + let+ Eq = help tva tvb in + (Eq : ((ta, tac) ty, (tb, tbc) ty) eq) + | List_t _, _ -> not_equal () + | Sapling_state_t ms1, Sapling_state_t ms2 -> + let+ () = memo_size_eq ms1 ms2 in + Eq + | Sapling_state_t _, _ -> not_equal () + | Sapling_transaction_t ms1, Sapling_transaction_t ms2 -> + let+ () = memo_size_eq ms1 ms2 in + Eq + | Sapling_transaction_t _, _ -> not_equal () + | Sapling_transaction_deprecated_t ms1, Sapling_transaction_deprecated_t ms2 + -> + let+ () = memo_size_eq ms1 ms2 in + Eq + | Sapling_transaction_deprecated_t _, _ -> not_equal () + | Chest_t, Chest_t -> return Eq + | Chest_t, _ -> not_equal () + | Chest_key_t, Chest_key_t -> return Eq + | Chest_key_t, _ -> not_equal () + in + help ty1 ty2 + +(* Same as ty_eq but for stacks. + A single error monad is used here because there is no need to + recover from stack merging errors. *) +let rec stack_eq : + type ta tb ts tu. + Script.location -> + context -> + int -> + (ta, ts) stack_ty -> + (tb, tu) stack_ty -> + (((ta, ts) stack_ty, (tb, tu) stack_ty) eq * context) tzresult = + fun loc ctxt lvl stack1 stack2 -> + match (stack1, stack2) with + | Bot_t, Bot_t -> ok (Eq, ctxt) + | Item_t (ty1, rest1), Item_t (ty2, rest2) -> + Gas_monad.run ctxt @@ ty_eq ~error_details:(Informative loc) ty1 ty2 + |> record_trace (Bad_stack_item lvl) + >>? fun (eq, ctxt) -> + eq >>? fun Eq -> + stack_eq loc ctxt (lvl + 1) rest1 rest2 >|? fun (Eq, ctxt) -> + ((Eq : ((ta, ts) stack_ty, (tb, tu) stack_ty) eq), ctxt) + | _, _ -> error Bad_stack_length + +(* ---- Type checker results -------------------------------------------------*) + +type ('a, 's) judgement = + | Typed : ('a, 's, 'b, 'u) descr -> ('a, 's) judgement + | Failed : { + descr : 'b 'u. ('b, 'u) stack_ty -> ('a, 's, 'b, 'u) descr; + } + -> ('a, 's) judgement + +(* ---- Type checker (Untyped expressions -> Typed IR) ----------------------*) + +type ('a, 's, 'b, 'u, 'c, 'v) branch = { + branch : + 'r 'f. + ('a, 's, 'r, 'f) descr -> ('b, 'u, 'r, 'f) descr -> ('c, 'v, 'r, 'f) descr; +} +[@@unboxed] + +let merge_branches : + type a s b u c v. + context -> + Script.location -> + (a, s) judgement -> + (b, u) judgement -> + (a, s, b, u, c, v) branch -> + ((c, v) judgement * context) tzresult = + fun ctxt loc btr bfr {branch} -> + match (btr, bfr) with + | Typed ({aft = aftbt; _} as dbt), Typed ({aft = aftbf; _} as dbf) -> + let unmatched_branches () = + let aftbt = serialize_stack_for_error ctxt aftbt in + let aftbf = serialize_stack_for_error ctxt aftbf in + Unmatched_branches (loc, aftbt, aftbf) + in + record_trace_eval + unmatched_branches + ( stack_eq loc ctxt 1 aftbt aftbf >|? fun (Eq, ctxt) -> + (Typed (branch dbt dbf), ctxt) ) + | Failed {descr = descrt}, Failed {descr = descrf} -> + let descr ret = branch (descrt ret) (descrf ret) in + ok (Failed {descr}, ctxt) + | Typed dbt, Failed {descr = descrf} -> + ok (Typed (branch dbt (descrf dbt.aft)), ctxt) + | Failed {descr = descrt}, Typed dbf -> + ok (Typed (branch (descrt dbf.aft) dbf), ctxt) + +let parse_memo_size (n : (location, _) Micheline.node) : + Sapling.Memo_size.t tzresult = + match n with + | Int (_, z) -> ( + match Sapling.Memo_size.parse_z z with + | Ok _ as ok_memo_size -> ok_memo_size + | Error msg -> + error + @@ Invalid_syntactic_constant (location n, strip_locations n, msg)) + | _ -> error @@ Invalid_kind (location n, [Int_kind], kind n) + +type ex_comparable_ty = + | Ex_comparable_ty : 'a comparable_ty -> ex_comparable_ty + +type ex_parameter_ty_and_entrypoints_node = + | Ex_parameter_ty_and_entrypoints_node : { + arg_type : ('a, _) ty; + entrypoints : 'a entrypoints_node; + } + -> ex_parameter_ty_and_entrypoints_node + +(** [parse_ty] can be used to parse regular types as well as parameter types + together with their entrypoints. + + In the first case, use [~ret:Don't_parse_entrypoints], [parse_ty] will + return an [ex_ty]. + + In the second case, use [~ret:Parse_entrypoints], [parse_ty] will return + an [ex_parameter_ty_and_entrypoints_node]. +*) +type ('ret, 'name) parse_ty_ret = + | Don't_parse_entrypoints : (ex_ty, unit) parse_ty_ret + | Parse_entrypoints + : (ex_parameter_ty_and_entrypoints_node, Entrypoint.t option) parse_ty_ret + +let rec parse_ty : + type ret name. + context -> + stack_depth:int -> + legacy:bool -> + allow_lazy_storage:bool -> + allow_operation:bool -> + allow_contract:bool -> + allow_ticket:bool -> + ret:(ret, name) parse_ty_ret -> + Script.node -> + (ret * context) tzresult = + fun ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret + node -> + Gas.consume ctxt Typecheck_costs.parse_type_cycle >>? fun ctxt -> + if Compare.Int.(stack_depth > 10000) then + error Typechecking_too_many_recursive_calls + else + (match ret with + | Don't_parse_entrypoints -> ok (node, (() : name)) + | Parse_entrypoints -> extract_entrypoint_annot node) + >>? fun (node, name) -> + let return ctxt ty : ret * context = + match ret with + | Don't_parse_entrypoints -> (Ex_ty ty, ctxt) + | Parse_entrypoints -> + let at_node = + Option.map (fun name -> {name; original_type_expr = node}) name + in + ( Ex_parameter_ty_and_entrypoints_node + { + arg_type = ty; + entrypoints = {at_node; nested = Entrypoints_None}; + }, + ctxt ) + in + match node with + | Prim (loc, T_unit, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt unit_t + | Prim (loc, T_int, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt int_t + | Prim (loc, T_nat, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt nat_t + | Prim (loc, T_string, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt string_t + | Prim (loc, T_bytes, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt bytes_t + | Prim (loc, T_mutez, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt mutez_t + | Prim (loc, T_bool, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt bool_t + | Prim (loc, T_key, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt key_t + | Prim (loc, T_key_hash, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt key_hash_t + | Prim (loc, T_chest_key, [], annot) -> + if legacy then + check_type_annot loc annot >|? fun () -> return ctxt chest_key_t + else error (Deprecated_instruction T_chest_key) + | Prim (loc, T_chest, [], annot) -> + if legacy then + check_type_annot loc annot >|? fun () -> return ctxt chest_t + else error (Deprecated_instruction T_chest) + | Prim (loc, T_timestamp, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt timestamp_t + | Prim (loc, T_address, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt address_t + | Prim (loc, T_tx_rollup_l2_address, [], annot) -> + if Constants.tx_rollup_enable ctxt then + check_type_annot loc annot >|? fun () -> + return ctxt tx_rollup_l2_address_t + else error @@ Tx_rollup_addresses_disabled loc + | Prim (loc, T_signature, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt signature_t + | Prim (loc, T_operation, [], annot) -> + if allow_operation then + check_type_annot loc annot >|? fun () -> return ctxt operation_t + else error (Unexpected_operation loc) + | Prim (loc, T_chain_id, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt chain_id_t + | Prim (loc, T_never, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt never_t + | Prim (loc, T_bls12_381_g1, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt bls12_381_g1_t + | Prim (loc, T_bls12_381_g2, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt bls12_381_g2_t + | Prim (loc, T_bls12_381_fr, [], annot) -> + check_type_annot loc annot >|? fun () -> return ctxt bls12_381_fr_t + | Prim (loc, T_contract, [utl], annot) -> + if allow_contract then + parse_passable_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + utl + ~ret:Don't_parse_entrypoints + >>? fun (Ex_ty tl, ctxt) -> + check_type_annot loc annot >>? fun () -> + contract_t loc tl >|? fun ty -> return ctxt ty + else error (Unexpected_contract loc) + | Prim (loc, T_pair, utl :: utr, annot) -> + remove_field_annot utl >>? fun utl -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret:Don't_parse_entrypoints + utl + >>? fun (Ex_ty tl, ctxt) -> + (match utr with + | [utr] -> remove_field_annot utr + | utr -> + (* Unfold [pair t1 ... tn] as [pair t1 (... (pair tn-1 tn))] *) + ok (Prim (loc, T_pair, utr, []))) + >>? fun utr -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret:Don't_parse_entrypoints + utr + >>? fun (Ex_ty tr, ctxt) -> + check_type_annot loc annot >>? fun () -> + pair_t loc tl tr >|? fun (Ty_ex_c ty) -> return ctxt ty + | Prim (loc, T_or, [utl; utr], annot) -> ( + (match ret with + | Don't_parse_entrypoints -> + remove_field_annot utl >>? fun utl -> + remove_field_annot utr >|? fun utr -> (utl, utr) + | Parse_entrypoints -> ok (utl, utr)) + >>? fun (utl, utr) -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret + utl + >>? fun (parsed_l, ctxt) -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret + utr + >>? fun (parsed_r, ctxt) -> + check_type_annot loc annot >>? fun () -> + match ret with + | Don't_parse_entrypoints -> + let (Ex_ty tl) = parsed_l in + let (Ex_ty tr) = parsed_r in + union_t loc tl tr >|? fun (Ty_ex_c ty) -> ((Ex_ty ty : ret), ctxt) + | Parse_entrypoints -> + let (Ex_parameter_ty_and_entrypoints_node + {arg_type = tl; entrypoints = left}) = + parsed_l + in + let (Ex_parameter_ty_and_entrypoints_node + {arg_type = tr; entrypoints = right}) = + parsed_r + in + union_t loc tl tr >|? fun (Ty_ex_c arg_type) -> + let entrypoints = + let at_node = + Option.map (fun name -> {name; original_type_expr = node}) name + in + {at_node; nested = Entrypoints_Union {left; right}} + in + (Ex_parameter_ty_and_entrypoints_node {arg_type; entrypoints}, ctxt) + ) + | Prim (loc, T_lambda, [uta; utr], annot) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy uta + >>? fun (Ex_ty ta, ctxt) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy utr + >>? fun (Ex_ty tr, ctxt) -> + check_type_annot loc annot >>? fun () -> + lambda_t loc ta tr >|? fun ty -> return ctxt ty + | Prim (loc, T_option, [ut], annot) -> + (if legacy then + (* legacy semantics with (broken) field annotations *) + remove_field_annot ut >>? fun ut -> + check_composed_type_annot loc annot >>? fun () -> ok ut + else check_type_annot loc annot >>? fun () -> ok ut) + >>? fun ut -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret:Don't_parse_entrypoints + ut + >>? fun (Ex_ty t, ctxt) -> + option_t loc t >|? fun ty -> return ctxt ty + | Prim (loc, T_list, [ut], annot) -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret:Don't_parse_entrypoints + ut + >>? fun (Ex_ty t, ctxt) -> + check_type_annot loc annot >>? fun () -> + list_t loc t >|? fun ty -> return ctxt ty + | Prim (loc, T_ticket, [ut], annot) -> + if allow_ticket then + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt ut + >>? fun (Ex_comparable_ty t, ctxt) -> + check_type_annot loc annot >>? fun () -> + ticket_t loc t >|? fun ty -> return ctxt ty + else error (Unexpected_ticket loc) + | Prim (loc, T_set, [ut], annot) -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt ut + >>? fun (Ex_comparable_ty t, ctxt) -> + check_type_annot loc annot >>? fun () -> + set_t loc t >|? fun ty -> return ctxt ty + | Prim (loc, T_map, [uta; utr], annot) -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt uta + >>? fun (Ex_comparable_ty ta, ctxt) -> + parse_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + ~ret:Don't_parse_entrypoints + utr + >>? fun (Ex_ty tr, ctxt) -> + check_type_annot loc annot >>? fun () -> + map_t loc ta tr >|? fun ty -> return ctxt ty + | Prim (loc, T_sapling_transaction, [memo_size], annot) -> + check_type_annot loc annot >>? fun () -> + parse_memo_size memo_size >|? fun memo_size -> + return ctxt (sapling_transaction_t ~memo_size) + | Prim (loc, T_sapling_transaction_deprecated, [memo_size], annot) -> + if legacy then + check_type_annot loc annot >>? fun () -> + parse_memo_size memo_size >|? fun memo_size -> + return ctxt (sapling_transaction_deprecated_t ~memo_size) + else error (Deprecated_instruction T_sapling_transaction_deprecated) + (* + /!\ When adding new lazy storage kinds, be careful to use + [when allow_lazy_storage] /!\ + Lazy storage should not be packable to avoid stealing a lazy storage + from another contract with `PUSH t id` or `UNPACK`. + *) + | Prim (loc, T_big_map, args, annot) when allow_lazy_storage -> + parse_big_map_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + loc + args + annot + >|? fun (Ex_ty ty, ctxt) -> return ctxt ty + | Prim (loc, T_sapling_state, [memo_size], annot) when allow_lazy_storage -> + check_type_annot loc annot >>? fun () -> + parse_memo_size memo_size >|? fun memo_size -> + return ctxt (sapling_state_t ~memo_size) + | Prim (loc, (T_big_map | T_sapling_state), _, _) -> + error (Unexpected_lazy_storage loc) + | Prim + ( loc, + (( T_unit | T_signature | T_int | T_nat | T_string | T_bytes | T_mutez + | T_bool | T_key | T_key_hash | T_timestamp | T_address + | T_tx_rollup_l2_address | T_chain_id | T_operation | T_never ) as + prim), + l, + _ ) -> + error (Invalid_arity (loc, prim, 0, List.length l)) + | Prim + ( loc, + ((T_set | T_list | T_option | T_contract | T_ticket) as prim), + l, + _ ) -> + error (Invalid_arity (loc, prim, 1, List.length l)) + | Prim (loc, ((T_pair | T_or | T_map | T_lambda) as prim), l, _) -> + error (Invalid_arity (loc, prim, 2, List.length l)) + | expr -> + error + @@ unexpected + expr + [] + Type_namespace + [ + T_bls12_381_fr; + T_bls12_381_g1; + T_bls12_381_g2; + T_bool; + T_bytes; + T_chain_id; + T_contract; + T_int; + T_key; + T_key_hash; + T_lambda; + T_list; + T_map; + T_mutez; + T_nat; + T_never; + T_operation; + T_option; + T_or; + T_pair; + T_set; + T_signature; + T_string; + T_ticket; + T_timestamp; + T_tx_rollup_l2_address; + T_unit; + ] + +and parse_comparable_ty : + context -> + stack_depth:int -> + Script.node -> + (ex_comparable_ty * context) tzresult = + fun ctxt ~stack_depth node -> + parse_ty + ~ret:Don't_parse_entrypoints + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy:false + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:false + ~allow_ticket:false + node + >>? fun (Ex_ty t, ctxt) -> + match is_comparable t with + | Yes -> ok (Ex_comparable_ty t, ctxt) + | No -> + error + (Comparable_type_expected (location node, Micheline.strip_locations node)) + +and parse_passable_ty : + type ret name. + context -> + stack_depth:int -> + legacy:bool -> + ret:(ret, name) parse_ty_ret -> + Script.node -> + (ret * context) tzresult = + fun ctxt ~stack_depth ~legacy -> + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:true + ~allow_operation:false + ~allow_contract:true + ~allow_ticket:true + +and parse_any_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult = + fun ctxt ~stack_depth ~legacy -> + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:true + ~allow_operation:true + ~allow_contract:true + ~allow_ticket:true + ~ret:Don't_parse_entrypoints + +and parse_big_map_ty ctxt ~stack_depth ~legacy big_map_loc args map_annot = + Gas.consume ctxt Typecheck_costs.parse_type_cycle >>? fun ctxt -> + match args with + | [key_ty; value_ty] -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt key_ty + >>? fun (Ex_comparable_ty key_ty, ctxt) -> + parse_big_map_value_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + value_ty + >>? fun (Ex_ty value_ty, ctxt) -> + check_type_annot big_map_loc map_annot >>? fun () -> + big_map_t big_map_loc key_ty value_ty >|? fun big_map_ty -> + (Ex_ty big_map_ty, ctxt) + | args -> error @@ Invalid_arity (big_map_loc, T_big_map, 2, List.length args) + +and parse_big_map_value_ty ctxt ~stack_depth ~legacy value_ty = + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:legacy + ~allow_ticket:true + ~ret:Don't_parse_entrypoints + value_ty + +let parse_packable_ty ctxt ~stack_depth ~legacy node = + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:legacy + (* type contract is forbidden in UNPACK because of + https://gitlab.com/tezos/tezos/-/issues/301 *) + ~allow_ticket:false + ~ret:Don't_parse_entrypoints + node + +let parse_view_input_ty ctxt ~stack_depth ~legacy node = + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:true + ~allow_ticket:false + ~ret:Don't_parse_entrypoints + node + +let parse_view_output_ty ctxt ~stack_depth ~legacy node = + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:false + ~allow_operation:false + ~allow_contract:true + ~allow_ticket:false + ~ret:Don't_parse_entrypoints + node + +let parse_normal_storage_ty ctxt ~stack_depth ~legacy node = + (parse_ty [@tailcall]) + ctxt + ~stack_depth + ~legacy + ~allow_lazy_storage:true + ~allow_operation:false + ~allow_contract:legacy + ~allow_ticket:true + ~ret:Don't_parse_entrypoints + node + +let parse_storage_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult = + fun ctxt ~stack_depth ~legacy node -> + match node with + | Prim + ( loc, + T_pair, + [Prim (big_map_loc, T_big_map, args, map_annot); remaining_storage], + storage_annot ) + when legacy -> ( + match storage_annot with + | [] -> + (parse_normal_storage_ty [@tailcall]) ctxt ~stack_depth ~legacy node + | [single] + when Compare.Int.(String.length single > 0) + && Compare.Char.(single.[0] = '%') -> + (parse_normal_storage_ty [@tailcall]) ctxt ~stack_depth ~legacy node + | _ -> + (* legacy semantics of big maps used the wrong annotation parser *) + Gas.consume ctxt Typecheck_costs.parse_type_cycle >>? fun ctxt -> + parse_big_map_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + big_map_loc + args + map_annot + >>? fun (Ex_ty big_map_ty, ctxt) -> + parse_normal_storage_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + remaining_storage + >>? fun (Ex_ty remaining_storage, ctxt) -> + check_composed_type_annot loc storage_annot >>? fun () -> + pair_t loc big_map_ty remaining_storage >|? fun (Ty_ex_c ty) -> + (Ex_ty ty, ctxt)) + | _ -> (parse_normal_storage_ty [@tailcall]) ctxt ~stack_depth ~legacy node + +(* check_packable: determine if a `ty` is packable into Michelson *) +let check_packable ~legacy loc root = + let rec check : type t tc. (t, tc) ty -> unit tzresult = function + (* /!\ When adding new lazy storage kinds, be sure to return an error. /!\ + Lazy storage should not be packable. *) + | Big_map_t _ -> error (Unexpected_lazy_storage loc) + | Sapling_state_t _ -> error (Unexpected_lazy_storage loc) + | Operation_t -> error (Unexpected_operation loc) + | Unit_t -> Result.return_unit + | Int_t -> Result.return_unit + | Nat_t -> Result.return_unit + | Signature_t -> Result.return_unit + | String_t -> Result.return_unit + | Bytes_t -> Result.return_unit + | Mutez_t -> Result.return_unit + | Key_hash_t -> Result.return_unit + | Key_t -> Result.return_unit + | Timestamp_t -> Result.return_unit + | Address_t -> Result.return_unit + | Tx_rollup_l2_address_t -> Result.return_unit + | Bool_t -> Result.return_unit + | Chain_id_t -> Result.return_unit + | Never_t -> Result.return_unit + | Set_t (_, _) -> Result.return_unit + | Ticket_t _ -> error (Unexpected_ticket loc) + | Lambda_t (_, _, _) -> Result.return_unit + | Bls12_381_g1_t -> Result.return_unit + | Bls12_381_g2_t -> Result.return_unit + | Bls12_381_fr_t -> Result.return_unit + | Pair_t (l_ty, r_ty, _, _) -> check l_ty >>? fun () -> check r_ty + | Union_t (l_ty, r_ty, _, _) -> check l_ty >>? fun () -> check r_ty + | Option_t (v_ty, _, _) -> check v_ty + | List_t (elt_ty, _) -> check elt_ty + | Map_t (_, elt_ty, _) -> check elt_ty + | Contract_t (_, _) when legacy -> Result.return_unit + | Contract_t (_, _) -> error (Unexpected_contract loc) + | Sapling_transaction_t _ -> ok () + | Sapling_transaction_deprecated_t _ -> ok () + | Chest_key_t -> Result.return_unit + | Chest_t -> Result.return_unit + in + check root + +type toplevel = { + code_field : Script.node; + arg_type : Script.node; + storage_type : Script.node; + views : view_map; +} + +type ('arg, 'storage) code = + | Code : { + code : + (('arg, 'storage) pair, (operation Script_list.t, 'storage) pair) lambda; + arg_type : ('arg, _) ty; + storage_type : ('storage, _) ty; + views : view_map; + entrypoints : 'arg entrypoints; + code_size : Cache_memory_helpers.sint; + } + -> ('arg, 'storage) code + +type ex_script = Ex_script : ('a, 'c) Script_typed_ir.script -> ex_script + +type ex_code = Ex_code : ('a, 'c) code -> ex_code + +type 'storage typed_view = + | Typed_view : { + input_ty : ('input, _) ty; + output_ty : ('output, _) ty; + kinstr : ('input * 'storage, end_of_stack, 'output, end_of_stack) kinstr; + original_code_expr : Script.node; + } + -> 'storage typed_view + +type 'storage typed_view_map = (Script_string.t, 'storage typed_view) map + +type (_, _) dig_proof_argument = + | Dig_proof_argument : + ('x, 'a * 's, 'a, 's, 'b, 't, 'c, 'u) stack_prefix_preservation_witness + * ('x, _) ty + * ('c, 'u) stack_ty + -> ('b, 't) dig_proof_argument + +type (_, _, _) dug_proof_argument = + | Dug_proof_argument : + (('a, 's, 'x, 'a * 's, 'b, 't, 'c, 'u) stack_prefix_preservation_witness + * ('c, 'u) stack_ty) + -> ('b, 't, 'x) dug_proof_argument + +type (_, _) dipn_proof_argument = + | Dipn_proof_argument : + ('fa, 'fs, 'fb, 'fu, 'a, 's, 'b, 'u) stack_prefix_preservation_witness + * context + * ('fa, 'fs, 'fb, 'fu) descr + * ('b, 'u) stack_ty + -> ('a, 's) dipn_proof_argument + +type (_, _) dropn_proof_argument = + | Dropn_proof_argument : + ('fa, 'fs, 'fa, 'fs, 'a, 's, 'a, 's) stack_prefix_preservation_witness + * ('fa, 'fs) stack_ty + -> ('a, 's) dropn_proof_argument + +type (_, _, _) comb_proof_argument = + | Comb_proof_argument : + ('a, 'b, 's, 'c, 'd, 't) comb_gadt_witness * ('c, 'd * 't) stack_ty + -> ('a, 'b, 's) comb_proof_argument + +type (_, _, _) uncomb_proof_argument = + | Uncomb_proof_argument : + ('a, 'b, 's, 'c, 'd, 't) uncomb_gadt_witness * ('c, 'd * 't) stack_ty + -> ('a, 'b, 's) uncomb_proof_argument + +type 'before comb_get_proof_argument = + | Comb_get_proof_argument : + ('before, 'after) comb_get_gadt_witness * ('after, _) ty + -> 'before comb_get_proof_argument + +type ('rest, 'before) comb_set_proof_argument = + | Comb_set_proof_argument : + ('rest, 'before, 'after) comb_set_gadt_witness * ('after, _) ty + -> ('rest, 'before) comb_set_proof_argument + +type (_, _, _) dup_n_proof_argument = + | Dup_n_proof_argument : + ('a, 'b, 's, 't) dup_n_gadt_witness * ('t, _) ty + -> ('a, 'b, 's) dup_n_proof_argument + +let rec make_dug_proof_argument : + type a s x xc. + location -> + int -> + (x, xc) ty -> + (a, s) stack_ty -> + (a, s, x) dug_proof_argument option = + fun loc n x stk -> + match (n, stk) with + | 0, rest -> Some (Dug_proof_argument (KRest, Item_t (x, rest))) + | n, Item_t (v, rest) -> + make_dug_proof_argument loc (n - 1) x rest + |> Option.map @@ fun (Dug_proof_argument (n', aft')) -> + Dug_proof_argument (KPrefix (loc, v, n'), Item_t (v, aft')) + | _, _ -> None + +let rec make_comb_get_proof_argument : + type b bc. int -> (b, bc) ty -> b comb_get_proof_argument option = + fun n ty -> + match (n, ty) with + | 0, value_ty -> Some (Comb_get_proof_argument (Comb_get_zero, value_ty)) + | 1, Pair_t (hd_ty, _, _annot, _) -> + Some (Comb_get_proof_argument (Comb_get_one, hd_ty)) + | n, Pair_t (_, tl_ty, _annot, _) -> + make_comb_get_proof_argument (n - 2) tl_ty + |> Option.map + @@ fun (Comb_get_proof_argument (comb_get_left_witness, ty')) -> + Comb_get_proof_argument (Comb_get_plus_two comb_get_left_witness, ty') + | _ -> None + +let rec make_comb_set_proof_argument : + type value valuec before beforec a s. + context -> + (a, s) stack_ty -> + location -> + int -> + (value, valuec) ty -> + (before, beforec) ty -> + (value, before) comb_set_proof_argument tzresult = + fun ctxt stack_ty loc n value_ty ty -> + match (n, ty) with + | 0, _ -> ok @@ Comb_set_proof_argument (Comb_set_zero, value_ty) + | 1, Pair_t (_hd_ty, tl_ty, _, _) -> + pair_t loc value_ty tl_ty >|? fun (Ty_ex_c after_ty) -> + Comb_set_proof_argument (Comb_set_one, after_ty) + | n, Pair_t (hd_ty, tl_ty, _, _) -> + make_comb_set_proof_argument ctxt stack_ty loc (n - 2) value_ty tl_ty + >>? fun (Comb_set_proof_argument (comb_set_left_witness, tl_ty')) -> + pair_t loc hd_ty tl_ty' >|? fun (Ty_ex_c after_ty) -> + Comb_set_proof_argument (Comb_set_plus_two comb_set_left_witness, after_ty) + | _ -> + let whole_stack = serialize_stack_for_error ctxt stack_ty in + error (Bad_stack (loc, I_UPDATE, 2, whole_stack)) + +type 'a ex_ty_cstr = + | Ex_ty_cstr : { + ty : ('b, _) Script_typed_ir.ty; + construct : 'b -> 'a; + original_type_expr : Script.node; + } + -> 'a ex_ty_cstr + +let find_entrypoint (type full fullc error_context error_trace) + ~(error_details : (error_context, error_trace) error_details) + (full : (full, fullc) ty) (entrypoints : full entrypoints) entrypoint : + (full ex_ty_cstr, error_trace) Gas_monad.t = + let open Gas_monad.Syntax in + let rec find_entrypoint : + type t tc. + (t, tc) ty -> + t entrypoints_node -> + Entrypoint.t -> + (t ex_ty_cstr, unit) Gas_monad.t = + fun ty entrypoints entrypoint -> + let* () = Gas_monad.consume_gas Typecheck_costs.find_entrypoint_cycle in + match (ty, entrypoints) with + | _, {at_node = Some {name; original_type_expr}; _} + when Entrypoint.(name = entrypoint) -> + return (Ex_ty_cstr {ty; construct = (fun e -> e); original_type_expr}) + | Union_t (tl, tr, _, _), {nested = Entrypoints_Union {left; right}; _} -> ( + Gas_monad.bind_recover (find_entrypoint tl left entrypoint) @@ function + | Ok (Ex_ty_cstr {ty; construct; original_type_expr}) -> + return + (Ex_ty_cstr + { + ty; + construct = (fun e -> L (construct e)); + original_type_expr; + }) + | Error () -> + let+ (Ex_ty_cstr {ty; construct; original_type_expr}) = + find_entrypoint tr right entrypoint + in + Ex_ty_cstr + {ty; construct = (fun e -> R (construct e)); original_type_expr}) + | _, {nested = Entrypoints_None; _} -> Gas_monad.of_result (Error ()) + in + let {root; original_type_expr} = entrypoints in + Gas_monad.bind_recover (find_entrypoint full root entrypoint) @@ function + | Ok f_t -> return f_t + | Error () -> + if Entrypoint.is_default entrypoint then + return + (Ex_ty_cstr {ty = full; construct = (fun e -> e); original_type_expr}) + else + Gas_monad.of_result + @@ Error + (match error_details with + | Fast -> (Inconsistent_types_fast : error_trace) + | Informative _ -> trace_of_error @@ No_such_entrypoint entrypoint) + +let find_entrypoint_for_type (type full fullc exp expc error_trace) + ~error_details ~(full : (full, fullc) ty) ~(expected : (exp, expc) ty) + entrypoints entrypoint : + (Entrypoint.t * (exp, expc) ty, error_trace) Gas_monad.t = + let open Gas_monad.Syntax in + let* res = find_entrypoint ~error_details full entrypoints entrypoint in + match res with + | Ex_ty_cstr {ty; _} -> ( + match entrypoints.root.at_node with + | Some {name; original_type_expr = _} + when Entrypoint.is_root name && Entrypoint.is_default entrypoint -> + Gas_monad.bind_recover + (ty_eq ~error_details:Fast ty expected) + (function + | Ok Eq -> return (Entrypoint.default, (ty : (exp, expc) ty)) + | Error Inconsistent_types_fast -> + let+ Eq = ty_eq ~error_details full expected in + (Entrypoint.root, (full : (exp, expc) ty))) + | _ -> + let+ Eq = ty_eq ~error_details ty expected in + (entrypoint, (ty : (exp, expc) ty))) + +let well_formed_entrypoints (type full fullc) (full : (full, fullc) ty) + entrypoints = + let merge path (type t tc) (ty : (t, tc) ty) + (entrypoints : t entrypoints_node) reachable + ((first_unreachable, all) as acc) = + match entrypoints.at_node with + | None -> + ok + ( (if reachable then acc + else + match ty with + | Union_t _ -> acc + | _ -> ( + match first_unreachable with + | None -> (Some (List.rev path), all) + | Some _ -> acc)), + reachable ) + | Some {name; original_type_expr = _} -> + if Entrypoint.Set.mem name all then error (Duplicate_entrypoint name) + else ok ((first_unreachable, Entrypoint.Set.add name all), true) + in + let rec check : + type t tc. + (t, tc) ty -> + t entrypoints_node -> + prim list -> + bool -> + prim list option * Entrypoint.Set.t -> + (prim list option * Entrypoint.Set.t) tzresult = + fun t entrypoints path reachable acc -> + match (t, entrypoints) with + | Union_t (tl, tr, _, _), {nested = Entrypoints_Union {left; right}; _} -> + merge (D_Left :: path) tl left reachable acc + >>? fun (acc, l_reachable) -> + merge (D_Right :: path) tr right reachable acc + >>? fun (acc, r_reachable) -> + check tl left (D_Left :: path) l_reachable acc >>? fun acc -> + check tr right (D_Right :: path) r_reachable acc + | _ -> ok acc + in + let init, reachable = + match entrypoints.at_node with + | None -> (Entrypoint.Set.empty, false) + | Some {name; original_type_expr = _} -> + (Entrypoint.Set.singleton name, true) + in + check full entrypoints [] reachable (None, init) + >>? fun (first_unreachable, all) -> + if not (Entrypoint.Set.mem Entrypoint.default all) then Result.return_unit + else + match first_unreachable with + | None -> Result.return_unit + | Some path -> error (Unreachable_entrypoint path) + +type ex_parameter_ty_and_entrypoints = + | Ex_parameter_ty_and_entrypoints : { + arg_type : ('a, _) ty; + entrypoints : 'a entrypoints; + } + -> ex_parameter_ty_and_entrypoints + +let parse_parameter_ty_and_entrypoints : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_parameter_ty_and_entrypoints * context) tzresult = + fun ctxt ~stack_depth ~legacy node -> + parse_passable_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + node + ~ret:Parse_entrypoints + >>? fun (Ex_parameter_ty_and_entrypoints_node {arg_type; entrypoints}, ctxt) + -> + (if legacy then Result.return_unit + else well_formed_entrypoints arg_type entrypoints) + >|? fun () -> + let entrypoints = {root = entrypoints; original_type_expr = node} in + (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, ctxt) + +let parse_passable_ty = parse_passable_ty ~ret:Don't_parse_entrypoints + +let parse_uint ~nb_bits = + assert (Compare.Int.(nb_bits >= 0 && nb_bits <= 30)) ; + let max_int = (1 lsl nb_bits) - 1 in + let max_z = Z.of_int max_int in + function + | Micheline.Int (_, n) when Compare.Z.(Z.zero <= n) && Compare.Z.(n <= max_z) + -> + ok (Z.to_int n) + | node -> + error + @@ Invalid_syntactic_constant + ( location node, + strip_locations node, + "a positive " ^ string_of_int nb_bits + ^ "-bit integer (between 0 and " ^ string_of_int max_int ^ ")" ) + +let parse_uint10 = parse_uint ~nb_bits:10 + +let parse_uint11 = parse_uint ~nb_bits:11 + +(* The type returned by this function is used to: + - serialize and deserialize tickets when they are stored or transferred, + - type the READ_TICKET instruction. *) +let opened_ticket_type loc ty = comparable_pair_3_t loc address_t ty nat_t + +(* -- parse data of primitive types -- *) + +let parse_unit ctxt ~legacy = function + | Prim (loc, D_Unit, [], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>? fun () -> + Gas.consume ctxt Typecheck_costs.unit >|? fun ctxt -> ((), ctxt) + | Prim (loc, D_Unit, l, _) -> + error @@ Invalid_arity (loc, D_Unit, 0, List.length l) + | expr -> error @@ unexpected expr [] Constant_namespace [D_Unit] + +let parse_bool ctxt ~legacy = function + | Prim (loc, D_True, [], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>? fun () -> + Gas.consume ctxt Typecheck_costs.bool >|? fun ctxt -> (true, ctxt) + | Prim (loc, D_False, [], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>? fun () -> + Gas.consume ctxt Typecheck_costs.bool >|? fun ctxt -> (false, ctxt) + | Prim (loc, ((D_True | D_False) as c), l, _) -> + error @@ Invalid_arity (loc, c, 0, List.length l) + | expr -> error @@ unexpected expr [] Constant_namespace [D_True; D_False] + +let parse_string ctxt : Script.node -> (Script_string.t * context) tzresult = + function + | String (loc, v) as expr -> + Gas.consume ctxt (Typecheck_costs.check_printable v) >>? fun ctxt -> + record_trace + (Invalid_syntactic_constant + (loc, strip_locations expr, "a printable ascii string")) + (Script_string.of_string v >|? fun s -> (s, ctxt)) + | expr -> error @@ Invalid_kind (location expr, [String_kind], kind expr) + +let parse_bytes ctxt = function + | Bytes (_, v) -> ok (v, ctxt) + | expr -> error @@ Invalid_kind (location expr, [Bytes_kind], kind expr) + +let parse_int ctxt = function + | Int (_, v) -> ok (Script_int.of_zint v, ctxt) + | expr -> error @@ Invalid_kind (location expr, [Int_kind], kind expr) + +let parse_nat ctxt : + Script.node -> (Script_int.n Script_int.num * context) tzresult = function + | Int (loc, v) as expr -> ( + let v = Script_int.of_zint v in + match Script_int.is_nat v with + | Some nat -> ok (nat, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a non-negative integer")) + | expr -> error @@ Invalid_kind (location expr, [Int_kind], kind expr) + +let parse_mutez ctxt : Script.node -> (Tez.t * context) tzresult = function + | Int (loc, v) as expr -> ( + match + let open Option in + bind (catch (fun () -> Z.to_int64 v)) Tez.of_mutez + with + | Some tez -> Ok (tez, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid mutez amount")) + | expr -> error @@ Invalid_kind (location expr, [Int_kind], kind expr) + +let parse_timestamp ctxt : + Script.node -> (Script_timestamp.t * context) tzresult = function + | Int (_, v) (* As unparsed with [Optimized] or out of bounds [Readable]. *) + -> + ok (Script_timestamp.of_zint v, ctxt) + | String (loc, s) as expr (* As unparsed with [Readable]. *) -> ( + Gas.consume ctxt (Typecheck_costs.timestamp_readable s) >>? fun ctxt -> + match Script_timestamp.of_string s with + | Some v -> ok (v, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid timestamp")) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Int_kind], kind expr) + +let parse_key ctxt : Script.node -> (public_key * context) tzresult = function + | Bytes (loc, bytes) as expr -> ( + (* As unparsed with [Optimized]. *) + Gas.consume ctxt Typecheck_costs.public_key_optimized + >>? fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt Signature.Public_key.encoding bytes + with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid public key")) + | String (loc, s) as expr -> ( + (* As unparsed with [Readable]. *) + Gas.consume ctxt Typecheck_costs.public_key_readable + >>? fun ctxt -> + match Signature.Public_key.of_b58check_opt s with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid public key")) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_key_hash ctxt : Script.node -> (public_key_hash * context) tzresult = + function + | Bytes (loc, bytes) as expr -> ( + (* As unparsed with [Optimized]. *) + Gas.consume ctxt Typecheck_costs.key_hash_optimized + >>? fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt + Signature.Public_key_hash.encoding + bytes + with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid key hash")) + | String (loc, s) as expr (* As unparsed with [Readable]. *) -> ( + Gas.consume ctxt Typecheck_costs.key_hash_readable >>? fun ctxt -> + match Signature.Public_key_hash.of_b58check_opt s with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid key hash")) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_signature ctxt : Script.node -> (signature * context) tzresult = + function + | Bytes (loc, bytes) as expr (* As unparsed with [Optimized]. *) -> ( + Gas.consume ctxt Typecheck_costs.signature_optimized >>? fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt Script_signature.encoding bytes + with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid signature")) + | String (loc, s) as expr (* As unparsed with [Readable]. *) -> ( + Gas.consume ctxt Typecheck_costs.signature_readable >>? fun ctxt -> + match Script_signature.of_b58check_opt s with + | Some s -> ok (s, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid signature")) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_chain_id ctxt : Script.node -> (Script_chain_id.t * context) tzresult + = function + | Bytes (loc, bytes) as expr -> ( + Gas.consume ctxt Typecheck_costs.chain_id_optimized >>? fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt Script_chain_id.encoding bytes + with + | Some k -> ok (k, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid chain id")) + | String (loc, s) as expr -> ( + Gas.consume ctxt Typecheck_costs.chain_id_readable >>? fun ctxt -> + match Script_chain_id.of_b58check_opt s with + | Some s -> ok (s, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid chain id")) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_address ctxt : Script.node -> (address * context) tzresult = + let destination_allowed loc {destination; entrypoint} ctxt = + match destination with + | Destination.Tx_rollup _ when not (Constants.tx_rollup_enable ctxt) -> + error @@ Tx_rollup_addresses_disabled loc + | Destination.Sc_rollup _ when not (Constants.sc_rollup_enable ctxt) -> + error @@ Sc_rollup_disabled loc + | Destination.Zk_rollup _ when not (Constants.zk_rollup_enable ctxt) -> + error @@ Zk_rollup_disabled loc + | _ -> Ok ({destination; entrypoint}, ctxt) + in + function + | Bytes (loc, bytes) as expr (* As unparsed with [Optimized]. *) -> ( + Gas.consume ctxt Typecheck_costs.contract_optimized >>? fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt + Data_encoding.(tup2 Destination.encoding Entrypoint.value_encoding) + bytes + with + | Some (destination, entrypoint) -> + destination_allowed loc {destination; entrypoint} ctxt + | None -> + error + @@ Invalid_syntactic_constant + (loc, strip_locations expr, "a valid address")) + | String (loc, s) (* As unparsed with [Readable]. *) -> + Gas.consume ctxt Typecheck_costs.contract_readable >>? fun ctxt -> + (match String.index_opt s '%' with + | None -> ok (s, Entrypoint.default) + | Some pos -> + let len = String.length s - pos - 1 in + let name = String.sub s (pos + 1) len in + Entrypoint.of_string_strict ~loc name >|? fun entrypoint -> + (String.sub s 0 pos, entrypoint)) + >>? fun (addr, entrypoint) -> + Destination.of_b58check addr >>? fun destination -> + destination_allowed loc {destination; entrypoint} ctxt + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_tx_rollup_l2_address ctxt : + Script.node -> (tx_rollup_l2_address * context) tzresult = function + | Bytes (loc, bytes) as expr (* As unparsed with [Optimized]. *) -> ( + Gas.consume ctxt Typecheck_costs.tx_rollup_l2_address >>? fun ctxt -> + match Tx_rollup_l2_address.of_bytes_opt bytes with + | Some txa -> ok (Tx_rollup_l2_address.Indexable.value txa, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + ( loc, + strip_locations expr, + "a valid transaction rollup L2 address" )) + | String (loc, str) as expr (* As unparsed with [Readable]. *) -> ( + Gas.consume ctxt Typecheck_costs.tx_rollup_l2_address >>? fun ctxt -> + match Tx_rollup_l2_address.of_b58check_opt str with + | Some txa -> ok (Tx_rollup_l2_address.Indexable.value txa, ctxt) + | None -> + error + @@ Invalid_syntactic_constant + ( loc, + strip_locations expr, + "a valid transaction rollup L2 address" )) + | expr -> + error @@ Invalid_kind (location expr, [String_kind; Bytes_kind], kind expr) + +let parse_never expr : (never * context) tzresult = + error @@ Invalid_never_expr (location expr) + +(* -- parse data of complex types -- *) + +let parse_pair (type r) parse_l parse_r ctxt ~legacy + (r_comb_witness : (r, unit -> _) comb_witness) expr = + let parse_comb loc l rs = + parse_l ctxt l >>=? fun (l, ctxt) -> + (match (rs, r_comb_witness) with + | [r], _ -> ok r + | [], _ -> error @@ Invalid_arity (loc, D_Pair, 2, 1) + | _ :: _, Comb_Pair _ -> + (* Unfold [Pair x1 ... xn] as [Pair x1 (Pair x2 ... xn-1 xn))] + for type [pair ta (pair tb1 tb2)] and n >= 3 only *) + ok (Prim (loc, D_Pair, rs, [])) + | _ -> error @@ Invalid_arity (loc, D_Pair, 2, 1 + List.length rs)) + >>?= fun r -> + parse_r ctxt r >|=? fun (r, ctxt) -> ((l, r), ctxt) + in + match expr with + | Prim (loc, D_Pair, l :: rs, annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>?= fun () -> parse_comb loc l rs + | Prim (loc, D_Pair, l, _) -> + tzfail @@ Invalid_arity (loc, D_Pair, 2, List.length l) + (* Unfold [{x1; ...; xn}] as [Pair x1 x2 ... xn-1 xn] for n >= 2 *) + | Seq (loc, l :: (_ :: _ as rs)) -> parse_comb loc l rs + | Seq (loc, l) -> tzfail @@ Invalid_seq_arity (loc, 2, List.length l) + | expr -> tzfail @@ unexpected expr [] Constant_namespace [D_Pair] + +let parse_union parse_l parse_r ctxt ~legacy = function + | Prim (loc, D_Left, [v], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>?= fun () -> + parse_l ctxt v >|=? fun (v, ctxt) -> (L v, ctxt) + | Prim (loc, D_Left, l, _) -> + tzfail @@ Invalid_arity (loc, D_Left, 1, List.length l) + | Prim (loc, D_Right, [v], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>?= fun () -> + parse_r ctxt v >|=? fun (v, ctxt) -> (R v, ctxt) + | Prim (loc, D_Right, l, _) -> + tzfail @@ Invalid_arity (loc, D_Right, 1, List.length l) + | expr -> tzfail @@ unexpected expr [] Constant_namespace [D_Left; D_Right] + +let parse_option parse_v ctxt ~legacy = function + | Prim (loc, D_Some, [v], annot) -> + (if legacy then Result.return_unit else error_unexpected_annot loc annot) + >>?= fun () -> + parse_v ctxt v >|=? fun (v, ctxt) -> (Some v, ctxt) + | Prim (loc, D_Some, l, _) -> + tzfail @@ Invalid_arity (loc, D_Some, 1, List.length l) + | Prim (loc, D_None, [], annot) -> + Lwt.return + ( (if legacy then Result.return_unit + else error_unexpected_annot loc annot) + >|? fun () -> (None, ctxt) ) + | Prim (loc, D_None, l, _) -> + tzfail @@ Invalid_arity (loc, D_None, 0, List.length l) + | expr -> tzfail @@ unexpected expr [] Constant_namespace [D_Some; D_None] + +let comb_witness1 : type t tc. (t, tc) ty -> (t, unit -> unit) comb_witness = + function + | Pair_t _ -> Comb_Pair Comb_Any + | _ -> Comb_Any + +let parse_view_name ctxt : Script.node -> (Script_string.t * context) tzresult = + function + | String (loc, v) as expr -> + (* The limitation of length of string is same as entrypoint *) + if Compare.Int.(String.length v > 31) then error (View_name_too_long v) + else + let rec check_char i = + if Compare.Int.(i < 0) then ok v + else if Script_ir_annot.is_allowed_char v.[i] then check_char (i - 1) + else error (Bad_view_name loc) + in + Gas.consume ctxt (Typecheck_costs.check_printable v) >>? fun ctxt -> + record_trace + (Invalid_syntactic_constant + ( loc, + strip_locations expr, + "string [a-zA-Z0-9_.%@] and the maximum string length of 31 \ + characters" )) + ( check_char (String.length v - 1) >>? fun v -> + Script_string.of_string v >|? fun s -> (s, ctxt) ) + | expr -> error @@ Invalid_kind (location expr, [String_kind], kind expr) + +let parse_toplevel : + context -> legacy:bool -> Script.expr -> (toplevel * context) tzresult = + fun ctxt ~legacy toplevel -> + record_trace (Ill_typed_contract (toplevel, [])) + @@ + match root toplevel with + | Int (loc, _) -> error (Invalid_kind (loc, [Seq_kind], Int_kind)) + | String (loc, _) -> error (Invalid_kind (loc, [Seq_kind], String_kind)) + | Bytes (loc, _) -> error (Invalid_kind (loc, [Seq_kind], Bytes_kind)) + | Prim (loc, _, _, _) -> error (Invalid_kind (loc, [Seq_kind], Prim_kind)) + | Seq (_, fields) -> ( + let rec find_fields ctxt p s c views fields = + match fields with + | [] -> ok (ctxt, (p, s, c, views)) + | Int (loc, _) :: _ -> error (Invalid_kind (loc, [Prim_kind], Int_kind)) + | String (loc, _) :: _ -> + error (Invalid_kind (loc, [Prim_kind], String_kind)) + | Bytes (loc, _) :: _ -> + error (Invalid_kind (loc, [Prim_kind], Bytes_kind)) + | Seq (loc, _) :: _ -> error (Invalid_kind (loc, [Prim_kind], Seq_kind)) + | Prim (loc, K_parameter, [arg], annot) :: rest -> ( + match p with + | None -> find_fields ctxt (Some (arg, loc, annot)) s c views rest + | Some _ -> error (Duplicate_field (loc, K_parameter))) + | Prim (loc, K_storage, [arg], annot) :: rest -> ( + match s with + | None -> find_fields ctxt p (Some (arg, loc, annot)) c views rest + | Some _ -> error (Duplicate_field (loc, K_storage))) + | Prim (loc, K_code, [arg], annot) :: rest -> ( + match c with + | None -> find_fields ctxt p s (Some (arg, loc, annot)) views rest + | Some _ -> error (Duplicate_field (loc, K_code))) + | Prim (loc, ((K_parameter | K_storage | K_code) as name), args, _) :: _ + -> + error (Invalid_arity (loc, name, 1, List.length args)) + | Prim (loc, K_view, [name; input_ty; output_ty; view_code], _) :: rest + -> + parse_view_name ctxt name >>? fun (str, ctxt) -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.view_update str views) + >>? fun ctxt -> + if Script_map.mem str views then error (Duplicated_view_name loc) + else + let views' = + Script_map.update + str + (Some {input_ty; output_ty; view_code}) + views + in + find_fields ctxt p s c views' rest + | Prim (loc, K_view, args, _) :: _ -> + error (Invalid_arity (loc, K_view, 4, List.length args)) + | Prim (loc, name, _, _) :: _ -> + let allowed = [K_parameter; K_storage; K_code; K_view] in + error (Invalid_primitive (loc, allowed, name)) + in + find_fields ctxt None None None (Script_map.empty string_t) fields + >>? fun (ctxt, toplevel) -> + match toplevel with + | None, _, _, _ -> error (Missing_field K_parameter) + | Some _, None, _, _ -> error (Missing_field K_storage) + | Some _, Some _, None, _ -> error (Missing_field K_code) + | ( Some (p, ploc, pannot), + Some (s, sloc, sannot), + Some (c, cloc, cannot), + views ) -> + let p_pannot = + (* root name can be attached to either the parameter + primitive or the toplevel constructor (legacy only). + + In the latter case we move it to the parameter type. + *) + Script_ir_annot.has_field_annot p >>? function + | true -> ok (p, pannot) + | false -> ( + match pannot with + | [single] when legacy -> ( + is_field_annot ploc single >|? fun is_field_annot -> + match (is_field_annot, p) with + | true, Prim (loc, prim, args, annots) -> + (Prim (loc, prim, args, single :: annots), []) + | _ -> (p, [])) + | _ -> ok (p, pannot)) + in + (* only one field annot is allowed to set the root entrypoint name *) + p_pannot >>? fun (arg_type, pannot) -> + Script_ir_annot.error_unexpected_annot ploc pannot >>? fun () -> + Script_ir_annot.error_unexpected_annot cloc cannot >>? fun () -> + Script_ir_annot.error_unexpected_annot sloc sannot >|? fun () -> + ({code_field = c; arg_type; views; storage_type = s}, ctxt)) + +(* -- parse data of any type -- *) + +(* + Some values, such as operations, tickets, or big map ids, are used only + internally and are not allowed to be forged by users. + In [parse_data], [allow_forged] should be [false] for: + - PUSH + - UNPACK + - user-provided script parameters + - storage on origination + And [true] for: + - internal calls parameters + - storage after origination +*) + +let rec parse_data : + type a ac. + elab_conf:elab_conf -> + stack_depth:int -> + context -> + allow_forged:bool -> + (a, ac) ty -> + Script.node -> + (a * context) tzresult Lwt.t = + fun ~elab_conf ~stack_depth ctxt ~allow_forged ty script_data -> + Gas.consume ctxt Typecheck_costs.parse_data_cycle >>?= fun ctxt -> + let non_terminal_recursion ctxt ty script_data = + if Compare.Int.(stack_depth > 10_000) then + tzfail Typechecking_too_many_recursive_calls + else + parse_data + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + ~allow_forged + ty + script_data + in + let parse_data_error () = + let ty = serialize_ty_for_error ty in + Invalid_constant (location script_data, strip_locations script_data, ty) + in + let fail_parse_data () = tzfail (parse_data_error ()) in + let traced_no_lwt body = record_trace_eval parse_data_error body in + let traced body = trace_eval parse_data_error body in + let traced_fail err = Lwt.return @@ traced_no_lwt (error err) in + let parse_items ctxt expr key_type value_type items item_wrapper = + List.fold_left_es + (fun (last_value, map, ctxt) item -> + match item with + | Prim (loc, D_Elt, [k; v], annot) -> + (if elab_conf.legacy then Result.return_unit + else error_unexpected_annot loc annot) + >>?= fun () -> + non_terminal_recursion ctxt key_type k >>=? fun (k, ctxt) -> + non_terminal_recursion ctxt value_type v >>=? fun (v, ctxt) -> + Lwt.return + ( (match last_value with + | Some value -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.compare + key_type + value + k) + >>? fun ctxt -> + let c = + Script_comparable.compare_comparable key_type value k + in + if Compare.Int.(0 <= c) then + if Compare.Int.(0 = c) then + error (Duplicate_map_keys (loc, strip_locations expr)) + else + error (Unordered_map_keys (loc, strip_locations expr)) + else ok ctxt + | None -> ok ctxt) + >>? fun ctxt -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.map_update k map) + >|? fun ctxt -> + (Some k, Script_map.update k (Some (item_wrapper v)) map, ctxt) + ) + | Prim (loc, D_Elt, l, _) -> + tzfail @@ Invalid_arity (loc, D_Elt, 2, List.length l) + | Prim (loc, name, _, _) -> + tzfail @@ Invalid_primitive (loc, [D_Elt], name) + | Int _ | String _ | Bytes _ | Seq _ -> fail_parse_data ()) + (None, Script_map.empty key_type, ctxt) + items + |> traced + >|=? fun (_, items, ctxt) -> (items, ctxt) + in + let parse_big_map_items (type t) ctxt expr (key_type : t comparable_ty) + value_type items item_wrapper = + List.fold_left_es + (fun (last_key, {map; size}, ctxt) item -> + match item with + | Prim (loc, D_Elt, [k; v], annot) -> + (if elab_conf.legacy then Result.return_unit + else error_unexpected_annot loc annot) + >>?= fun () -> + non_terminal_recursion ctxt key_type k >>=? fun (k, ctxt) -> + hash_comparable_data ctxt key_type k >>=? fun (key_hash, ctxt) -> + non_terminal_recursion ctxt value_type v >>=? fun (v, ctxt) -> + Lwt.return + ( (match last_key with + | Some last_key -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.compare + key_type + last_key + k) + >>? fun ctxt -> + let c = + Script_comparable.compare_comparable key_type last_key k + in + if Compare.Int.(0 <= c) then + if Compare.Int.(0 = c) then + error (Duplicate_map_keys (loc, strip_locations expr)) + else + error (Unordered_map_keys (loc, strip_locations expr)) + else ok ctxt + | None -> ok ctxt) + >>? fun ctxt -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.big_map_update + {map; size}) + >>? fun ctxt -> + if Big_map_overlay.mem key_hash map then + error (Duplicate_map_keys (loc, strip_locations expr)) + else + ok + ( Some k, + { + map = + Big_map_overlay.add key_hash (k, item_wrapper v) map; + size = size + 1; + }, + ctxt ) ) + | Prim (loc, D_Elt, l, _) -> + tzfail @@ Invalid_arity (loc, D_Elt, 2, List.length l) + | Prim (loc, name, _, _) -> + tzfail @@ Invalid_primitive (loc, [D_Elt], name) + | Int _ | String _ | Bytes _ | Seq _ -> fail_parse_data ()) + (None, {map = Big_map_overlay.empty; size = 0}, ctxt) + items + |> traced + >|=? fun (_, map, ctxt) -> (map, ctxt) + in + let legacy = elab_conf.legacy in + match (ty, script_data) with + | Unit_t, expr -> + Lwt.return @@ traced_no_lwt + @@ (parse_unit ctxt ~legacy expr : (a * context) tzresult) + | Bool_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_bool ctxt ~legacy expr + | String_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_string ctxt expr + | Bytes_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_bytes ctxt expr + | Int_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_int ctxt expr + | Nat_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_nat ctxt expr + | Mutez_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_mutez ctxt expr + | Timestamp_t, expr -> + Lwt.return @@ traced_no_lwt @@ parse_timestamp ctxt expr + | Key_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_key ctxt expr + | Key_hash_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_key_hash ctxt expr + | Signature_t, expr -> + Lwt.return @@ traced_no_lwt @@ parse_signature ctxt expr + | Operation_t, _ -> + (* operations cannot appear in parameters or storage, + the protocol should never parse the bytes of an operation *) + assert false + | Chain_id_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_chain_id ctxt expr + | Address_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_address ctxt expr + | Tx_rollup_l2_address_t, expr -> + Lwt.return @@ traced_no_lwt @@ parse_tx_rollup_l2_address ctxt expr + | Contract_t (arg_ty, _), expr -> + traced + ( parse_address ctxt expr >>?= fun (address, ctxt) -> + let loc = location expr in + parse_contract_data + ~stack_depth:(stack_depth + 1) + ctxt + loc + arg_ty + address.destination + ~entrypoint:address.entrypoint + >|=? fun (ctxt, typed_contract) -> (typed_contract, ctxt) ) + (* Pairs *) + | Pair_t (tl, tr, _, _), expr -> + let r_witness = comb_witness1 tr in + let parse_l ctxt v = non_terminal_recursion ctxt tl v in + let parse_r ctxt v = non_terminal_recursion ctxt tr v in + traced @@ parse_pair parse_l parse_r ctxt ~legacy r_witness expr + (* Unions *) + | Union_t (tl, tr, _, _), expr -> + let parse_l ctxt v = non_terminal_recursion ctxt tl v in + let parse_r ctxt v = non_terminal_recursion ctxt tr v in + traced @@ parse_union parse_l parse_r ctxt ~legacy expr + (* Lambdas *) + | Lambda_t (ta, tr, _ty_name), (Seq (_loc, _) as script_instr) -> + traced + @@ parse_kdescr + Tc_context.data + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + ta + tr + script_instr + >|=? fun (kdescr, ctxt) -> (Lam (kdescr, script_instr), ctxt) + | ( Lambda_t (ta, tr, _ty_name), + Prim (loc, D_Lambda_rec, [(Seq (_loc, _) as script_instr)], []) ) -> + traced + @@ ( lambda_t loc ta tr >>?= fun lambda_rec_ty -> + parse_lam_rec + Tc_context.(add_lambda data) + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + ta + tr + lambda_rec_ty + script_instr ) + | Lambda_t _, expr -> + traced_fail (Invalid_kind (location expr, [Seq_kind], kind expr)) + (* Options *) + | Option_t (t, _, _), expr -> + let parse_v ctxt v = non_terminal_recursion ctxt t v in + traced @@ parse_option parse_v ctxt ~legacy expr + (* Lists *) + | List_t (t, _ty_name), Seq (_loc, items) -> + traced + @@ List.fold_right_es + (fun v (rest, ctxt) -> + non_terminal_recursion ctxt t v >|=? fun (v, ctxt) -> + (Script_list.cons v rest, ctxt)) + items + (Script_list.empty, ctxt) + | List_t _, expr -> + traced_fail (Invalid_kind (location expr, [Seq_kind], kind expr)) + (* Tickets *) + | Ticket_t (t, _ty_name), expr -> + if allow_forged then + opened_ticket_type (location expr) t >>?= fun ty -> + non_terminal_recursion ctxt ty expr + >>=? fun (({destination; entrypoint = _}, (contents, amount)), ctxt) -> + match Ticket_amount.of_n amount with + | Some amount -> ( + match destination with + | Contract ticketer -> return ({ticketer; contents; amount}, ctxt) + | Tx_rollup _ | Sc_rollup _ | Zk_rollup _ -> + tzfail (Unexpected_ticket_owner destination)) + | None -> traced_fail Forbidden_zero_ticket_quantity + else traced_fail (Unexpected_forged_value (location expr)) + (* Sets *) + | Set_t (t, _ty_name), (Seq (loc, vs) as expr) -> + traced + @@ List.fold_left_es + (fun (last_value, set, ctxt) v -> + non_terminal_recursion ctxt t v >>=? fun (v, ctxt) -> + Lwt.return + ( (match last_value with + | Some value -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.compare t value v) + >>? fun ctxt -> + let c = Script_comparable.compare_comparable t value v in + if Compare.Int.(0 <= c) then + if Compare.Int.(0 = c) then + error + (Duplicate_set_values (loc, strip_locations expr)) + else + error + (Unordered_set_values (loc, strip_locations expr)) + else ok ctxt + | None -> ok ctxt) + >>? fun ctxt -> + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.set_update v set) + >|? fun ctxt -> (Some v, Script_set.update v true set, ctxt) )) + (None, Script_set.empty t, ctxt) + vs + >|=? fun (_, set, ctxt) -> (set, ctxt) + | Set_t _, expr -> + traced_fail (Invalid_kind (location expr, [Seq_kind], kind expr)) + (* Maps *) + | Map_t (tk, tv, _ty_name), (Seq (_, vs) as expr) -> + parse_items ctxt expr tk tv vs (fun x -> x) + | Map_t _, expr -> + traced_fail (Invalid_kind (location expr, [Seq_kind], kind expr)) + | Big_map_t (tk, tv, _ty_name), expr -> + (match expr with + | Int (loc, id) -> + return (Some (id, loc), {map = Big_map_overlay.empty; size = 0}, ctxt) + | Seq (_, vs) -> + parse_big_map_items ctxt expr tk tv vs (fun x -> Some x) + >|=? fun (diff, ctxt) -> (None, diff, ctxt) + | Prim (loc, D_Pair, [Int (loc_id, id); Seq (_, vs)], annot) -> + error_unexpected_annot loc annot >>?= fun () -> + option_t loc tv >>?= fun tv_opt -> + parse_big_map_items ctxt expr tk tv_opt vs (fun x -> x) + >|=? fun (diff, ctxt) -> (Some (id, loc_id), diff, ctxt) + | Prim (_, D_Pair, [Int _; expr], _) -> + traced_fail (Invalid_kind (location expr, [Seq_kind], kind expr)) + | Prim (_, D_Pair, [expr; _], _) -> + traced_fail (Invalid_kind (location expr, [Int_kind], kind expr)) + | Prim (loc, D_Pair, l, _) -> + traced_fail @@ Invalid_arity (loc, D_Pair, 2, List.length l) + | _ -> + traced_fail + (unexpected expr [Seq_kind; Int_kind] Constant_namespace [D_Pair])) + >>=? fun (id_opt, diff, ctxt) -> + (match id_opt with + | None -> return @@ (None, ctxt) + | Some (id, loc) -> + if allow_forged then + let id = Big_map.Id.parse_z id in + Big_map.exists ctxt id >>=? function + | _, None -> traced_fail (Invalid_big_map (loc, id)) + | ctxt, Some (btk, btv) -> + Lwt.return + ( parse_comparable_ty + ~stack_depth:(stack_depth + 1) + ctxt + (Micheline.root btk) + >>? fun (Ex_comparable_ty btk, ctxt) -> + parse_big_map_value_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + (Micheline.root btv) + >>? fun (Ex_ty btv, ctxt) -> + (Gas_monad.run ctxt + @@ + let open Gas_monad.Syntax in + let error_details = Informative loc in + let* Eq = ty_eq ~error_details tk btk in + ty_eq ~error_details tv btv) + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> (Some id, ctxt) ) + else traced_fail (Unexpected_forged_value loc)) + >|=? fun (id, ctxt) -> + (Big_map {id; diff; key_type = tk; value_type = tv}, ctxt) + | Never_t, expr -> Lwt.return @@ traced_no_lwt @@ parse_never expr + (* Bls12_381 types *) + | Bls12_381_g1_t, Bytes (_, bs) -> ( + Gas.consume ctxt Typecheck_costs.bls12_381_g1 >>?= fun ctxt -> + match Script_bls.G1.of_bytes_opt bs with + | Some pt -> return (pt, ctxt) + | None -> fail_parse_data ()) + | Bls12_381_g1_t, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + | Bls12_381_g2_t, Bytes (_, bs) -> ( + Gas.consume ctxt Typecheck_costs.bls12_381_g2 >>?= fun ctxt -> + match Script_bls.G2.of_bytes_opt bs with + | Some pt -> return (pt, ctxt) + | None -> fail_parse_data ()) + | Bls12_381_g2_t, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + | Bls12_381_fr_t, Bytes (_, bs) -> ( + Gas.consume ctxt Typecheck_costs.bls12_381_fr >>?= fun ctxt -> + match Script_bls.Fr.of_bytes_opt bs with + | Some pt -> return (pt, ctxt) + | None -> fail_parse_data ()) + | Bls12_381_fr_t, Int (_, v) -> + Gas.consume ctxt Typecheck_costs.bls12_381_fr >>?= fun ctxt -> + return (Script_bls.Fr.of_z v, ctxt) + | Bls12_381_fr_t, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + (* + /!\ When adding new lazy storage kinds, you may want to guard the parsing + of identifiers with [allow_forged]. + *) + (* Sapling *) + | Sapling_transaction_t memo_size, Bytes (_, bytes) -> ( + match + Data_encoding.Binary.of_bytes_opt Sapling.transaction_encoding bytes + with + | Some transaction -> ( + match Sapling.transaction_get_memo_size transaction with + | None -> return (transaction, ctxt) + | Some transac_memo_size -> + Lwt.return + ( memo_size_eq + ~error_details:(Informative ()) + memo_size + transac_memo_size + >|? fun () -> (transaction, ctxt) )) + | None -> fail_parse_data ()) + | Sapling_transaction_t _, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + | Sapling_transaction_deprecated_t memo_size, Bytes (_, bytes) -> ( + match + Data_encoding.Binary.of_bytes_opt + Sapling.Legacy.transaction_encoding + bytes + with + | Some transaction -> ( + match Sapling.Legacy.transaction_get_memo_size transaction with + | None -> return (transaction, ctxt) + | Some transac_memo_size -> + Lwt.return + ( memo_size_eq + ~error_details:(Informative ()) + memo_size + transac_memo_size + >|? fun () -> (transaction, ctxt) )) + | None -> fail_parse_data ()) + | Sapling_transaction_deprecated_t _, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + | Sapling_state_t memo_size, Int (loc, id) -> + if allow_forged then + let id = Sapling.Id.parse_z id in + Sapling.state_from_id ctxt id >>=? fun (state, ctxt) -> + Lwt.return + ( traced_no_lwt + @@ memo_size_eq + ~error_details:(Informative ()) + memo_size + state.Sapling.memo_size + >|? fun () -> (state, ctxt) ) + else traced_fail (Unexpected_forged_value loc) + | Sapling_state_t memo_size, Seq (_, []) -> + return (Sapling.empty_state ~memo_size (), ctxt) + | Sapling_state_t _, expr -> + (* Do not allow to input diffs as they are untrusted and may not be the + result of a verify_update. *) + traced_fail + (Invalid_kind (location expr, [Int_kind; Seq_kind], kind expr)) + (* Time lock*) + | Chest_key_t, Bytes (_, bytes) -> ( + Gas.consume ctxt Typecheck_costs.chest_key >>?= fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt + Script_timelock.chest_key_encoding + bytes + with + | Some chest_key -> return (chest_key, ctxt) + | None -> fail_parse_data ()) + | Chest_key_t, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + | Chest_t, Bytes (_, bytes) -> ( + Gas.consume ctxt (Typecheck_costs.chest ~bytes:(Bytes.length bytes)) + >>?= fun ctxt -> + match + Data_encoding.Binary.of_bytes_opt Script_timelock.chest_encoding bytes + with + | Some chest -> return (chest, ctxt) + | None -> fail_parse_data ()) + | Chest_t, expr -> + traced_fail (Invalid_kind (location expr, [Bytes_kind], kind expr)) + +and parse_view : + type storage storagec. + elab_conf:elab_conf -> + context -> + (storage, storagec) ty -> + view -> + (storage typed_view * context) tzresult Lwt.t = + fun ~elab_conf ctxt storage_type {input_ty; output_ty; view_code} -> + let legacy = elab_conf.legacy in + let input_ty_loc = location input_ty in + record_trace_eval + (fun () -> + Ill_formed_type + (Some "arg of view", strip_locations input_ty, input_ty_loc)) + (parse_view_input_ty ctxt ~stack_depth:0 ~legacy input_ty) + >>?= fun (Ex_ty input_ty, ctxt) -> + let output_ty_loc = location output_ty in + record_trace_eval + (fun () -> + Ill_formed_type + (Some "return of view", strip_locations output_ty, output_ty_loc)) + (parse_view_output_ty ctxt ~stack_depth:0 ~legacy output_ty) + >>?= fun (Ex_ty output_ty, ctxt) -> + pair_t input_ty_loc input_ty storage_type >>?= fun (Ty_ex_c pair_ty) -> + parse_instr + ~elab_conf + ~stack_depth:0 + Tc_context.view + ctxt + view_code + (Item_t (pair_ty, Bot_t)) + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Failed {descr} -> + let {kinstr; _} = close_descr (descr (Item_t (output_ty, Bot_t))) in + ok + ( Typed_view + {input_ty; output_ty; kinstr; original_code_expr = view_code}, + ctxt ) + | Typed ({loc; aft; _} as descr) -> ( + let ill_type_view stack_ty loc = + let actual = serialize_stack_for_error ctxt stack_ty in + let expected_stack = Item_t (output_ty, Bot_t) in + let expected = serialize_stack_for_error ctxt expected_stack in + Ill_typed_view {loc; actual; expected} + in + match aft with + | Item_t (ty, Bot_t) -> + let error_details = Informative loc in + Gas_monad.run ctxt + @@ Gas_monad.record_trace_eval ~error_details (fun loc -> + ill_type_view aft loc) + @@ ty_eq ~error_details ty output_ty + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> + let {kinstr; _} = close_descr descr in + ( Typed_view + {input_ty; output_ty; kinstr; original_code_expr = view_code}, + ctxt ) + | _ -> error (ill_type_view aft loc)) + +and parse_views : + type storage storagec. + elab_conf:elab_conf -> + context -> + (storage, storagec) ty -> + view_map -> + (storage typed_view_map * context) tzresult Lwt.t = + fun ~elab_conf ctxt storage_type views -> + let aux ctxt name cur_view = + Gas.consume + ctxt + (Michelson_v1_gas.Cost_of.Interpreter.view_update name views) + >>?= fun ctxt -> parse_view ~elab_conf ctxt storage_type cur_view + in + Script_map.map_es_in_context aux ctxt views + +and parse_kdescr : + type arg argc ret retc. + elab_conf:elab_conf -> + stack_depth:int -> + tc_context -> + context -> + (arg, argc) ty -> + (ret, retc) ty -> + Script.node -> + ((arg, end_of_stack, ret, end_of_stack) kdescr * context) tzresult Lwt.t = + fun ~elab_conf ~stack_depth tc_context ctxt arg ret script_instr -> + parse_instr + ~elab_conf + tc_context + ctxt + ~stack_depth:(stack_depth + 1) + script_instr + (Item_t (arg, Bot_t)) + >>=? function + | Typed ({loc; aft = Item_t (ty, Bot_t) as stack_ty; _} as descr), ctxt -> + Lwt.return + (let error_details = Informative loc in + Gas_monad.run ctxt + @@ Gas_monad.record_trace_eval ~error_details (fun loc -> + let ret = serialize_ty_for_error ret in + let stack_ty = serialize_stack_for_error ctxt stack_ty in + Bad_return (loc, stack_ty, ret)) + @@ ty_eq ~error_details ty ret + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> + ( (close_descr descr : (arg, end_of_stack, ret, end_of_stack) kdescr), + ctxt )) + | Typed {loc; aft = stack_ty; _}, ctxt -> + let ret = serialize_ty_for_error ret in + let stack_ty = serialize_stack_for_error ctxt stack_ty in + tzfail @@ Bad_return (loc, stack_ty, ret) + | Failed {descr}, ctxt -> + return + ( (close_descr (descr (Item_t (ret, Bot_t))) + : (arg, end_of_stack, ret, end_of_stack) kdescr), + ctxt ) + +and parse_lam_rec : + type arg argc ret retc. + elab_conf:elab_conf -> + stack_depth:int -> + tc_context -> + context -> + (arg, argc) ty -> + (ret, retc) ty -> + ((arg, ret) lambda, _) ty -> + Script.node -> + ((arg, ret) lambda * context) tzresult Lwt.t = + fun ~elab_conf ~stack_depth tc_context ctxt arg ret lambda_rec_ty script_instr -> + parse_instr + ~elab_conf + tc_context + ctxt + ~stack_depth:(stack_depth + 1) + script_instr + (Item_t (arg, Item_t (lambda_rec_ty, Bot_t))) + >>=? function + | Typed ({loc; aft = Item_t (ty, Bot_t) as stack_ty; _} as descr), ctxt -> + Lwt.return + (let error_details = Informative loc in + Gas_monad.run ctxt + @@ Gas_monad.record_trace_eval ~error_details (fun loc -> + let ret = serialize_ty_for_error ret in + let stack_ty = serialize_stack_for_error ctxt stack_ty in + Bad_return (loc, stack_ty, ret)) + @@ ty_eq ~error_details ty ret + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> + ((LamRec (close_descr descr, script_instr) : (arg, ret) lambda), ctxt)) + | Typed {loc; aft = stack_ty; _}, ctxt -> + let ret = serialize_ty_for_error ret in + let stack_ty = serialize_stack_for_error ctxt stack_ty in + tzfail @@ Bad_return (loc, stack_ty, ret) + | Failed {descr}, ctxt -> + return + ( (LamRec (close_descr (descr (Item_t (ret, Bot_t))), script_instr) + : (arg, ret) lambda), + ctxt ) + +and parse_instr : + type a s. + elab_conf:elab_conf -> + stack_depth:int -> + tc_context -> + context -> + Script.node -> + (a, s) stack_ty -> + ((a, s) judgement * context) tzresult Lwt.t = + fun ~elab_conf ~stack_depth tc_context ctxt script_instr stack_ty -> + let for_logging_only x = + if elab_conf.keep_extra_types_for_interpreter_logging then Some x else None + in + let check_item_ty (type a ac b bc) ctxt (exp : (a, ac) ty) (got : (b, bc) ty) + loc name n m : ((a, b) eq * context) tzresult = + record_trace_eval (fun () -> + let stack_ty = serialize_stack_for_error ctxt stack_ty in + Bad_stack (loc, name, m, stack_ty)) + @@ record_trace + (Bad_stack_item n) + ( Gas_monad.run ctxt @@ ty_eq ~error_details:(Informative loc) exp got + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> ((Eq : (a, b) eq), ctxt) ) + in + let log_stack loc stack_ty aft = + match (elab_conf.type_logger, script_instr) with + | None, _ | Some _, (Int _ | String _ | Bytes _) -> () + | Some log, (Prim _ | Seq _) -> + (* Unparsing for logging is not carbonated as this + is used only by the client and not the protocol *) + let stack_ty_before = unparse_stack_uncarbonated stack_ty in + let stack_ty_after = unparse_stack_uncarbonated aft in + log loc ~stack_ty_before ~stack_ty_after + in + let typed_no_lwt ctxt loc instr aft = + log_stack loc stack_ty aft ; + let j = Typed {loc; instr; bef = stack_ty; aft} in + Ok (j, ctxt) + in + let typed ctxt loc instr aft = + Lwt.return @@ typed_no_lwt ctxt loc instr aft + in + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>?= fun ctxt -> + let non_terminal_recursion tc_context ctxt script_instr stack_ty = + if Compare.Int.(stack_depth > 10000) then + tzfail Typechecking_too_many_recursive_calls + else + parse_instr + ~elab_conf + tc_context + ctxt + ~stack_depth:(stack_depth + 1) + script_instr + stack_ty + in + let bad_stack_error ctxt loc prim relevant_stack_portion = + let whole_stack = serialize_stack_for_error ctxt stack_ty in + error (Bad_stack (loc, prim, relevant_stack_portion, whole_stack)) + in + let legacy = elab_conf.legacy in + match (script_instr, stack_ty) with + (* stack ops *) + | Prim (loc, I_DROP, [], annot), Item_t (_, rest) -> + (error_unexpected_annot loc annot >>?= fun () -> + typed ctxt loc {apply = (fun k -> IDrop (loc, k))} rest + : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_DROP, [n], result_annot), whole_stack -> + parse_uint10 n >>?= fun whole_n -> + Gas.consume ctxt (Typecheck_costs.proof_argument whole_n) >>?= fun ctxt -> + let rec make_proof_argument : + type a s. + int -> (a, s) stack_ty -> (a, s) dropn_proof_argument tzresult = + fun n stk -> + match (Compare.Int.(n = 0), stk) with + | true, rest -> ok @@ Dropn_proof_argument (KRest, rest) + | false, Item_t (a, rest) -> + make_proof_argument (n - 1) rest + >|? fun (Dropn_proof_argument (n', stack_after_drops)) -> + Dropn_proof_argument (KPrefix (loc, a, n'), stack_after_drops) + | _, _ -> + let whole_stack = serialize_stack_for_error ctxt whole_stack in + error (Bad_stack (loc, I_DROP, whole_n, whole_stack)) + in + error_unexpected_annot loc result_annot >>?= fun () -> + make_proof_argument whole_n whole_stack + >>?= fun (Dropn_proof_argument (n', stack_after_drops)) -> + let kdropn k = IDropn (loc, whole_n, n', k) in + typed ctxt loc {apply = kdropn} stack_after_drops + | Prim (loc, I_DROP, (_ :: _ :: _ as l), _), _ -> + (* Technically, the arities 0 and 1 are allowed but the error only mentions 1. + However, DROP is equivalent to DROP 1 so hinting at an arity of 1 makes sense. *) + tzfail (Invalid_arity (loc, I_DROP, 1, List.length l)) + | Prim (loc, I_DUP, [], annot), (Item_t (v, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + record_trace_eval + (fun () -> + let t = serialize_ty_for_error v in + Non_dupable_type (loc, t)) + (check_dupable_ty ctxt loc v) + >>?= fun ctxt -> + let dup = {apply = (fun k -> IDup (loc, k))} in + typed ctxt loc dup (Item_t (v, stack)) + | Prim (loc, I_DUP, [n], v_annot), (Item_t _ as stack_ty) -> + check_var_annot loc v_annot >>?= fun () -> + let rec make_proof_argument : + type a b s. + int -> (a, b * s) stack_ty -> (a, b, s) dup_n_proof_argument tzresult + = + fun n (stack_ty : (a, b * s) stack_ty) -> + match (n, stack_ty) with + | 1, Item_t (hd_ty, _) -> ok @@ Dup_n_proof_argument (Dup_n_zero, hd_ty) + | n, Item_t (_, (Item_t (_, _) as tl_ty)) -> + make_proof_argument (n - 1) tl_ty + >|? fun (Dup_n_proof_argument (dup_n_witness, b_ty)) -> + Dup_n_proof_argument (Dup_n_succ dup_n_witness, b_ty) + | _ -> bad_stack_error ctxt loc I_DUP 1 + in + parse_uint10 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + error_unless (Compare.Int.( > ) n 0) (Dup_n_bad_argument loc) + >>?= fun () -> + record_trace (Dup_n_bad_stack loc) (make_proof_argument n stack_ty) + >>?= fun (Dup_n_proof_argument (witness, after_ty)) -> + record_trace_eval + (fun () -> + let t = serialize_ty_for_error after_ty in + Non_dupable_type (loc, t)) + (check_dupable_ty ctxt loc after_ty) + >>?= fun ctxt -> + let dupn = {apply = (fun k -> IDup_n (loc, n, witness, k))} in + typed ctxt loc dupn (Item_t (after_ty, stack_ty)) + | Prim (loc, I_DIG, [n], result_annot), stack -> + let rec make_proof_argument : + type a s. int -> (a, s) stack_ty -> (a, s) dig_proof_argument tzresult + = + fun n stk -> + match (Compare.Int.(n = 0), stk) with + | true, Item_t (v, rest) -> ok @@ Dig_proof_argument (KRest, v, rest) + | false, Item_t (v, rest) -> + make_proof_argument (n - 1) rest + >|? fun (Dig_proof_argument (n', x, aft')) -> + Dig_proof_argument (KPrefix (loc, v, n'), x, Item_t (v, aft')) + | _, _ -> + let whole_stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, I_DIG, 3, whole_stack)) + in + parse_uint10 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + error_unexpected_annot loc result_annot >>?= fun () -> + make_proof_argument n stack >>?= fun (Dig_proof_argument (n', x, aft)) -> + let dig = {apply = (fun k -> IDig (loc, n, n', k))} in + typed ctxt loc dig (Item_t (x, aft)) + | Prim (loc, I_DIG, (([] | _ :: _ :: _) as l), _), _ -> + tzfail (Invalid_arity (loc, I_DIG, 1, List.length l)) + | Prim (loc, I_DUG, [n], result_annot), Item_t (x, whole_stack) -> ( + parse_uint10 n >>?= fun whole_n -> + Gas.consume ctxt (Typecheck_costs.proof_argument whole_n) >>?= fun ctxt -> + error_unexpected_annot loc result_annot >>?= fun () -> + match make_dug_proof_argument loc whole_n x whole_stack with + | None -> + let whole_stack = serialize_stack_for_error ctxt whole_stack in + tzfail (Bad_stack (loc, I_DUG, whole_n, whole_stack)) + | Some (Dug_proof_argument (n', aft)) -> + let dug = {apply = (fun k -> IDug (loc, whole_n, n', k))} in + typed ctxt loc dug aft) + | Prim (loc, I_DUG, [_], result_annot), stack -> + Lwt.return + ( error_unexpected_annot loc result_annot >>? fun () -> + let stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, I_DUG, 1, stack)) ) + | Prim (loc, I_DUG, (([] | _ :: _ :: _) as l), _), _ -> + tzfail (Invalid_arity (loc, I_DUG, 1, List.length l)) + | Prim (loc, I_SWAP, [], annot), Item_t (v, Item_t (w, rest)) -> + error_unexpected_annot loc annot >>?= fun () -> + let swap = {apply = (fun k -> ISwap (loc, k))} in + let stack_ty = Item_t (w, Item_t (v, rest)) in + typed ctxt loc swap stack_ty + | Prim (loc, I_PUSH, [t; d], annot), stack -> + check_var_annot loc annot >>?= fun () -> + parse_packable_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy t + >>?= fun (Ex_ty t, ctxt) -> + parse_data + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + ~allow_forged:false + t + d + >>=? fun (v, ctxt) -> + let const = {apply = (fun k -> IConst (loc, t, v, k))} in + typed ctxt loc const (Item_t (t, stack)) + | Prim (loc, I_UNIT, [], annot), stack -> + check_var_type_annot loc annot >>?= fun () -> + let const = {apply = (fun k -> IConst (loc, unit_t, (), k))} in + typed ctxt loc const (Item_t (unit_t, stack)) + (* options *) + | Prim (loc, I_SOME, [], annot), Item_t (t, rest) -> + check_var_type_annot loc annot >>?= fun () -> + let cons_some = {apply = (fun k -> ICons_some (loc, k))} in + option_t loc t >>?= fun ty -> typed ctxt loc cons_some (Item_t (ty, rest)) + | Prim (loc, I_NONE, [t], annot), stack -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy t + >>?= fun (Ex_ty t, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + let cons_none = {apply = (fun k -> ICons_none (loc, t, k))} in + option_t loc t >>?= fun ty -> + let stack_ty = Item_t (ty, stack) in + typed ctxt loc cons_none stack_ty + | Prim (loc, I_MAP, [body], annot), Item_t (Option_t (t, _, _), rest) -> ( + check_kind [Seq_kind] body >>?= fun () -> + check_var_type_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body (Item_t (t, rest)) + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed ({loc; aft = Item_t (ret, aft_rest); _} as kibody) -> + let invalid_map_body () = + let aft = serialize_stack_for_error ctxt kibody.aft in + Invalid_map_body (loc, aft) + in + record_trace_eval + invalid_map_body + ( stack_eq loc ctxt 1 aft_rest rest >>? fun (Eq, ctxt) -> + option_t loc ret >>? fun opt_ty -> + let final_stack = Item_t (opt_ty, rest) in + let body = kibody.instr.apply (IHalt loc) in + let apply k = IOpt_map {loc; body; k} in + typed_no_lwt ctxt loc {apply} final_stack ) + | Typed {aft = Bot_t; _} -> + let aft = serialize_stack_for_error ctxt Bot_t in + error (Invalid_map_body (loc, aft)) + | Failed _ -> error (Invalid_map_block_fail loc)) + | ( Prim (loc, I_IF_NONE, [bt; bf], annot), + (Item_t (Option_t (t, _, _), rest) as bef) ) -> + check_kind [Seq_kind] bt >>?= fun () -> + check_kind [Seq_kind] bf >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt bt rest >>=? fun (btr, ctxt) -> + let stack_ty = Item_t (t, rest) in + non_terminal_recursion tc_context ctxt bf stack_ty >>=? fun (bfr, ctxt) -> + let branch ibt ibf = + let ifnone = + { + apply = + (fun k -> + let hloc = kinstr_location k in + let branch_if_none = ibt.instr.apply (IHalt hloc) + and branch_if_some = ibf.instr.apply (IHalt hloc) in + IIf_none {loc; branch_if_none; branch_if_some; k}); + } + in + {loc; instr = ifnone; bef; aft = ibt.aft} + in + Lwt.return @@ merge_branches ctxt loc btr bfr {branch} + (* pairs *) + | Prim (loc, I_PAIR, [], annot), Item_t (a, Item_t (b, rest)) -> + check_constr_annot loc annot >>?= fun () -> + pair_t loc a b >>?= fun (Ty_ex_c ty) -> + let stack_ty = Item_t (ty, rest) in + let cons_pair = {apply = (fun k -> ICons_pair (loc, k))} in + typed ctxt loc cons_pair stack_ty + | Prim (loc, I_PAIR, [n], annot), (Item_t _ as stack_ty) -> + check_var_annot loc annot >>?= fun () -> + let rec make_proof_argument : + type a b s. + int -> (a, b * s) stack_ty -> (a, b, s) comb_proof_argument tzresult = + fun n stack_ty -> + match (n, stack_ty) with + | 1, Item_t _ -> ok (Comb_proof_argument (Comb_one, stack_ty)) + | n, Item_t (a_ty, (Item_t _ as tl_ty)) -> + make_proof_argument (n - 1) tl_ty + >>? fun (Comb_proof_argument (comb_witness, Item_t (b_ty, tl_ty'))) + -> + pair_t loc a_ty b_ty >|? fun (Ty_ex_c pair_t) -> + Comb_proof_argument (Comb_succ comb_witness, Item_t (pair_t, tl_ty')) + | _ -> bad_stack_error ctxt loc I_PAIR 1 + in + parse_uint10 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + error_unless (Compare.Int.( > ) n 1) (Pair_bad_argument loc) + >>?= fun () -> + make_proof_argument n stack_ty + >>?= fun (Comb_proof_argument (witness, after_ty)) -> + let comb = {apply = (fun k -> IComb (loc, n, witness, k))} in + typed ctxt loc comb after_ty + | Prim (loc, I_UNPAIR, [n], annot), (Item_t _ as stack_ty) -> + error_unexpected_annot loc annot >>?= fun () -> + let rec make_proof_argument : + type a b s. + int -> (a, b * s) stack_ty -> (a, b, s) uncomb_proof_argument tzresult + = + fun n stack_ty -> + match (n, stack_ty) with + | 1, (Item_t _ as stack) -> + ok @@ Uncomb_proof_argument (Uncomb_one, stack) + | n, Item_t (Pair_t (a_ty, b_ty, _, _), tl_ty) -> + make_proof_argument (n - 1) (Item_t (b_ty, tl_ty)) + >|? fun (Uncomb_proof_argument (uncomb_witness, after_ty)) -> + Uncomb_proof_argument + (Uncomb_succ uncomb_witness, Item_t (a_ty, after_ty)) + | _ -> bad_stack_error ctxt loc I_UNPAIR 1 + in + parse_uint10 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + error_unless (Compare.Int.( > ) n 1) (Unpair_bad_argument loc) + >>?= fun () -> + make_proof_argument n stack_ty + >>?= fun (Uncomb_proof_argument (witness, after_ty)) -> + let uncomb = {apply = (fun k -> IUncomb (loc, n, witness, k))} in + typed ctxt loc uncomb after_ty + | Prim (loc, I_GET, [n], annot), Item_t (comb_ty, rest_ty) -> ( + check_var_annot loc annot >>?= fun () -> + parse_uint11 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + match make_comb_get_proof_argument n comb_ty with + | None -> + let whole_stack = serialize_stack_for_error ctxt stack_ty in + tzfail (Bad_stack (loc, I_GET, 1, whole_stack)) + | Some (Comb_get_proof_argument (witness, ty')) -> + let after_stack_ty = Item_t (ty', rest_ty) in + let comb_get = {apply = (fun k -> IComb_get (loc, n, witness, k))} in + typed ctxt loc comb_get after_stack_ty) + | ( Prim (loc, I_UPDATE, [n], annot), + Item_t (value_ty, Item_t (comb_ty, rest_ty)) ) -> + check_var_annot loc annot >>?= fun () -> + parse_uint11 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + make_comb_set_proof_argument ctxt stack_ty loc n value_ty comb_ty + >>?= fun (Comb_set_proof_argument (witness, after_ty)) -> + let after_stack_ty = Item_t (after_ty, rest_ty) in + let comb_set = {apply = (fun k -> IComb_set (loc, n, witness, k))} in + typed ctxt loc comb_set after_stack_ty + | Prim (loc, I_UNPAIR, [], annot), Item_t (Pair_t (a, b, _, _), rest) -> + check_unpair_annot loc annot >>?= fun () -> + let unpair = {apply = (fun k -> IUnpair (loc, k))} in + typed ctxt loc unpair (Item_t (a, Item_t (b, rest))) + | Prim (loc, I_CAR, [], annot), Item_t (Pair_t (a, _, _, _), rest) -> + check_destr_annot loc annot >>?= fun () -> + let car = {apply = (fun k -> ICar (loc, k))} in + typed ctxt loc car (Item_t (a, rest)) + | Prim (loc, I_CDR, [], annot), Item_t (Pair_t (_, b, _, _), rest) -> + check_destr_annot loc annot >>?= fun () -> + let cdr = {apply = (fun k -> ICdr (loc, k))} in + typed ctxt loc cdr (Item_t (b, rest)) + (* unions *) + | Prim (loc, I_LEFT, [tr], annot), Item_t (tl, rest) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy tr + >>?= fun (Ex_ty tr, ctxt) -> + check_constr_annot loc annot >>?= fun () -> + let cons_left = {apply = (fun k -> ICons_left (loc, tr, k))} in + union_t loc tl tr >>?= fun (Ty_ex_c ty) -> + let stack_ty = Item_t (ty, rest) in + typed ctxt loc cons_left stack_ty + | Prim (loc, I_RIGHT, [tl], annot), Item_t (tr, rest) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy tl + >>?= fun (Ex_ty tl, ctxt) -> + check_constr_annot loc annot >>?= fun () -> + let cons_right = {apply = (fun k -> ICons_right (loc, tl, k))} in + union_t loc tl tr >>?= fun (Ty_ex_c ty) -> + let stack_ty = Item_t (ty, rest) in + typed ctxt loc cons_right stack_ty + | ( Prim (loc, I_IF_LEFT, [bt; bf], annot), + (Item_t (Union_t (tl, tr, _, _), rest) as bef) ) -> + check_kind [Seq_kind] bt >>?= fun () -> + check_kind [Seq_kind] bf >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt bt (Item_t (tl, rest)) + >>=? fun (btr, ctxt) -> + non_terminal_recursion tc_context ctxt bf (Item_t (tr, rest)) + >>=? fun (bfr, ctxt) -> + let branch ibt ibf = + let instr = + { + apply = + (fun k -> + let hloc = kinstr_location k in + let branch_if_left = ibt.instr.apply (IHalt hloc) + and branch_if_right = ibf.instr.apply (IHalt hloc) in + IIf_left {loc; branch_if_left; branch_if_right; k}); + } + in + {loc; instr; bef; aft = ibt.aft} + in + Lwt.return @@ merge_branches ctxt loc btr bfr {branch} + (* lists *) + | Prim (loc, I_NIL, [t], annot), stack -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy t + >>?= fun (Ex_ty t, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + let nil = {apply = (fun k -> INil (loc, t, k))} in + list_t loc t >>?= fun ty -> typed ctxt loc nil (Item_t (ty, stack)) + | ( Prim (loc, I_CONS, [], annot), + Item_t (tv, (Item_t (List_t (t, _), _) as stack)) ) -> + check_item_ty ctxt tv t loc I_CONS 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let cons_list = {apply = (fun k -> ICons_list (loc, k))} in + (typed ctxt loc cons_list stack + : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_IF_CONS, [bt; bf], annot), + (Item_t (List_t (t, _), rest) as bef) ) -> + check_kind [Seq_kind] bt >>?= fun () -> + check_kind [Seq_kind] bf >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt bt (Item_t (t, bef)) + >>=? fun (btr, ctxt) -> + non_terminal_recursion tc_context ctxt bf rest >>=? fun (bfr, ctxt) -> + let branch ibt ibf = + let instr = + { + apply = + (fun k -> + let hloc = kinstr_location k in + let branch_if_cons = ibt.instr.apply (IHalt hloc) + and branch_if_nil = ibf.instr.apply (IHalt hloc) in + IIf_cons {loc; branch_if_nil; branch_if_cons; k}); + } + in + {loc; instr; bef; aft = ibt.aft} + in + Lwt.return @@ merge_branches ctxt loc btr bfr {branch} + | Prim (loc, I_SIZE, [], annot), Item_t (List_t _, rest) -> + check_var_type_annot loc annot >>?= fun () -> + let list_size = {apply = (fun k -> IList_size (loc, k))} in + typed ctxt loc list_size (Item_t (nat_t, rest)) + | Prim (loc, I_MAP, [body], annot), Item_t (List_t (elt, _), starting_rest) + -> ( + check_kind [Seq_kind] body >>?= fun () -> + check_var_type_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body (Item_t (elt, starting_rest)) + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed ({aft = Item_t (ret, rest) as aft; _} as kibody) -> + let invalid_map_body () = + let aft = serialize_stack_for_error ctxt aft in + Invalid_map_body (loc, aft) + in + record_trace_eval + invalid_map_body + ( stack_eq loc ctxt 1 rest starting_rest >>? fun (Eq, ctxt) -> + let hloc = loc in + let ibody = kibody.instr.apply (IHalt hloc) in + list_t loc ret >>? fun ty -> + let list_map = + { + apply = + (fun k -> IList_map (loc, ibody, for_logging_only ty, k)); + } + in + let stack = Item_t (ty, rest) in + typed_no_lwt ctxt loc list_map stack ) + | Typed {aft; _} -> + let aft = serialize_stack_for_error ctxt aft in + error (Invalid_map_body (loc, aft)) + | Failed _ -> error (Invalid_map_block_fail loc)) + | Prim (loc, I_ITER, [body], annot), Item_t (List_t (elt, _), rest) -> ( + check_kind [Seq_kind] body >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body (Item_t (elt, rest)) + >>=? fun (judgement, ctxt) -> + let mk_list_iter ibody = + { + apply = + (fun k -> + let hinfo = loc in + let ibody = ibody.instr.apply (IHalt hinfo) in + IList_iter (loc, for_logging_only elt, ibody, k)); + } + in + Lwt.return + @@ + match judgement with + | Typed ({aft; _} as ibody) -> + let invalid_iter_body () = + let aft = serialize_stack_for_error ctxt ibody.aft in + let rest = serialize_stack_for_error ctxt rest in + Invalid_iter_body (loc, rest, aft) + in + record_trace_eval + invalid_iter_body + ( stack_eq loc ctxt 1 aft rest + >>? fun (Eq, ctxt) : ((a, s) judgement * context) tzresult -> + typed_no_lwt ctxt loc (mk_list_iter ibody) rest ) + | Failed {descr} -> typed_no_lwt ctxt loc (mk_list_iter (descr rest)) rest + ) + (* sets *) + | Prim (loc, I_EMPTY_SET, [t], annot), rest -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt t + >>?= fun (Ex_comparable_ty t, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEmpty_set (loc, t, k))} in + set_t loc t >>?= fun ty -> typed ctxt loc instr (Item_t (ty, rest)) + | Prim (loc, I_ITER, [body], annot), Item_t (Set_t (elt, _), rest) -> ( + check_kind [Seq_kind] body >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body (Item_t (elt, rest)) + >>=? fun (judgement, ctxt) -> + let mk_iset_iter ibody = + { + apply = + (fun k -> + let hinfo = loc in + let ibody = ibody.instr.apply (IHalt hinfo) in + ISet_iter (loc, for_logging_only elt, ibody, k)); + } + in + Lwt.return + @@ + match judgement with + | Typed ({aft; _} as ibody) -> + let invalid_iter_body () = + let aft = serialize_stack_for_error ctxt ibody.aft in + let rest = serialize_stack_for_error ctxt rest in + Invalid_iter_body (loc, rest, aft) + in + record_trace_eval + invalid_iter_body + ( stack_eq loc ctxt 1 aft rest + >>? fun (Eq, ctxt) : ((a, s) judgement * context) tzresult -> + typed_no_lwt ctxt loc (mk_iset_iter ibody) rest ) + | Failed {descr} -> typed_no_lwt ctxt loc (mk_iset_iter (descr rest)) rest + ) + | Prim (loc, I_MEM, [], annot), Item_t (v, Item_t (Set_t (elt, _), rest)) -> + check_var_type_annot loc annot >>?= fun () -> + check_item_ty ctxt elt v loc I_MEM 1 2 >>?= fun (Eq, ctxt) -> + let instr = {apply = (fun k -> ISet_mem (loc, k))} in + (typed ctxt loc instr (Item_t (bool_t, rest)) + : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_UPDATE, [], annot), + Item_t (v, Item_t (Bool_t, (Item_t (Set_t (elt, _), _) as stack))) ) -> + check_item_ty ctxt elt v loc I_UPDATE 1 3 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISet_update (loc, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_SIZE, [], annot), Item_t (Set_t _, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISet_size (loc, k))} in + typed ctxt loc instr (Item_t (nat_t, rest)) + (* maps *) + | Prim (loc, I_EMPTY_MAP, [tk; tv], annot), stack -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt tk + >>?= fun (Ex_comparable_ty tk, ctxt) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy tv + >>?= fun (Ex_ty tv, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + let instr = + {apply = (fun k -> IEmpty_map (loc, tk, for_logging_only tv, k))} + in + map_t loc tk tv >>?= fun ty -> typed ctxt loc instr (Item_t (ty, stack)) + | Prim (loc, I_MAP, [body], annot), Item_t (Map_t (kt, elt, _), starting_rest) + -> ( + check_kind [Seq_kind] body >>?= fun () -> + check_var_type_annot loc annot >>?= fun () -> + pair_t loc kt elt >>?= fun (Ty_ex_c ty) -> + non_terminal_recursion tc_context ctxt body (Item_t (ty, starting_rest)) + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed ({aft = Item_t (ret, rest) as aft; _} as ibody) -> + let invalid_map_body () = + let aft = serialize_stack_for_error ctxt aft in + Invalid_map_body (loc, aft) + in + record_trace_eval + invalid_map_body + ( stack_eq loc ctxt 1 rest starting_rest >>? fun (Eq, ctxt) -> + map_t loc kt ret >>? fun ty -> + let instr = + { + apply = + (fun k -> + let hinfo = loc in + let ibody = ibody.instr.apply (IHalt hinfo) in + IMap_map (loc, for_logging_only ty, ibody, k)); + } + in + let stack = Item_t (ty, rest) in + typed_no_lwt ctxt loc instr stack ) + | Typed {aft; _} -> + let aft = serialize_stack_for_error ctxt aft in + error (Invalid_map_body (loc, aft)) + | Failed _ -> error (Invalid_map_block_fail loc)) + | Prim (loc, I_ITER, [body], annot), Item_t (Map_t (key, element_ty, _), rest) + -> ( + check_kind [Seq_kind] body >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + pair_t loc key element_ty >>?= fun (Ty_ex_c ty) -> + non_terminal_recursion tc_context ctxt body (Item_t (ty, rest)) + >>=? fun (judgement, ctxt) -> + let make_instr ibody = + { + apply = + (fun k -> + let hinfo = loc in + let ibody = ibody.instr.apply (IHalt hinfo) in + IMap_iter (loc, for_logging_only ty, ibody, k)); + } + in + Lwt.return + @@ + match judgement with + | Typed ({aft; _} as ibody) -> + let invalid_iter_body () = + let aft = serialize_stack_for_error ctxt ibody.aft in + let rest = serialize_stack_for_error ctxt rest in + Invalid_iter_body (loc, rest, aft) + in + record_trace_eval + invalid_iter_body + ( stack_eq loc ctxt 1 aft rest + >>? fun (Eq, ctxt) : ((a, s) judgement * context) tzresult -> + typed_no_lwt ctxt loc (make_instr ibody) rest ) + | Failed {descr} -> typed_no_lwt ctxt loc (make_instr (descr rest)) rest) + | Prim (loc, I_MEM, [], annot), Item_t (vk, Item_t (Map_t (k, _, _), rest)) -> + check_item_ty ctxt vk k loc I_MEM 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMap_mem (loc, k))} in + (typed ctxt loc instr (Item_t (bool_t, rest)) + : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_GET, [], annot), Item_t (vk, Item_t (Map_t (k, elt, _), rest)) + -> + check_item_ty ctxt vk k loc I_GET 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMap_get (loc, k))} in + option_t loc elt + >>?= fun ty : ((a, s) judgement * context) tzresult Lwt.t -> + typed ctxt loc instr (Item_t (ty, rest)) + | ( Prim (loc, I_UPDATE, [], annot), + Item_t + ( vk, + Item_t (Option_t (vv, _, _), (Item_t (Map_t (k, v, _), _) as stack)) + ) ) -> + check_item_ty ctxt vk k loc I_UPDATE 1 3 >>?= fun (Eq, ctxt) -> + check_item_ty ctxt vv v loc I_UPDATE 2 3 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMap_update (loc, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_GET_AND_UPDATE, [], annot), + Item_t + ( vk, + (Item_t (Option_t (vv, _, _), Item_t (Map_t (k, v, _), _)) as stack) + ) ) -> + check_item_ty ctxt vk k loc I_GET_AND_UPDATE 1 3 >>?= fun (Eq, ctxt) -> + check_item_ty ctxt vv v loc I_GET_AND_UPDATE 2 3 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMap_get_and_update (loc, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_SIZE, [], annot), Item_t (Map_t (_, _, _), rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMap_size (loc, k))} in + typed ctxt loc instr (Item_t (nat_t, rest)) + (* big_map *) + | Prim (loc, I_EMPTY_BIG_MAP, [tk; tv], annot), stack -> + parse_comparable_ty ~stack_depth:(stack_depth + 1) ctxt tk + >>?= fun (Ex_comparable_ty tk, ctxt) -> + parse_big_map_value_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy tv + >>?= fun (Ex_ty tv, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEmpty_big_map (loc, tk, tv, k))} in + big_map_t loc tk tv >>?= fun ty -> + let stack = Item_t (ty, stack) in + typed ctxt loc instr stack + | ( Prim (loc, I_MEM, [], annot), + Item_t (set_key, Item_t (Big_map_t (k, _, _), rest)) ) -> + check_item_ty ctxt set_key k loc I_MEM 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBig_map_mem (loc, k))} in + let stack = Item_t (bool_t, rest) in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_GET, [], annot), + Item_t (vk, Item_t (Big_map_t (k, elt, _), rest)) ) -> + check_item_ty ctxt vk k loc I_GET 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBig_map_get (loc, k))} in + option_t loc elt >>?= fun ty -> + let stack = Item_t (ty, rest) in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_UPDATE, [], annot), + Item_t + ( set_key, + Item_t + ( Option_t (set_value, _, _), + (Item_t (Big_map_t (map_key, map_value, _), _) as stack) ) ) ) -> + check_item_ty ctxt set_key map_key loc I_UPDATE 1 3 >>?= fun (Eq, ctxt) -> + check_item_ty ctxt set_value map_value loc I_UPDATE 2 3 + >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBig_map_update (loc, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_GET_AND_UPDATE, [], annot), + Item_t + ( vk, + (Item_t (Option_t (vv, _, _), Item_t (Big_map_t (k, v, _), _)) as + stack) ) ) -> + check_item_ty ctxt vk k loc I_GET_AND_UPDATE 1 3 >>?= fun (Eq, ctxt) -> + check_item_ty ctxt vv v loc I_GET_AND_UPDATE 2 3 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBig_map_get_and_update (loc, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + (* Sapling *) + | Prim (loc, I_SAPLING_EMPTY_STATE, [memo_size], annot), rest -> + parse_memo_size memo_size >>?= fun memo_size -> + check_var_annot loc annot >>?= fun () -> + let instr = + {apply = (fun k -> ISapling_empty_state (loc, memo_size, k))} + in + let stack = Item_t (sapling_state_t ~memo_size, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_SAPLING_VERIFY_UPDATE, [], _), + Item_t + ( Sapling_transaction_deprecated_t transaction_memo_size, + Item_t ((Sapling_state_t state_memo_size as state_ty), rest) ) ) -> + if legacy then + memo_size_eq + ~error_details:(Informative ()) + state_memo_size + transaction_memo_size + >>?= fun () -> + let instr = + {apply = (fun k -> ISapling_verify_update_deprecated (loc, k))} + in + pair_t loc int_t state_ty >>?= fun (Ty_ex_c pair_ty) -> + option_t loc pair_ty >>?= fun ty -> + let stack = Item_t (ty, rest) in + typed ctxt loc instr stack + else tzfail (Deprecated_instruction T_sapling_transaction_deprecated) + | ( Prim (loc, I_SAPLING_VERIFY_UPDATE, [], _), + Item_t + ( Sapling_transaction_t transaction_memo_size, + Item_t ((Sapling_state_t state_memo_size as state_ty), rest) ) ) -> + memo_size_eq + ~error_details:(Informative ()) + state_memo_size + transaction_memo_size + >>?= fun () -> + let instr = {apply = (fun k -> ISapling_verify_update (loc, k))} in + pair_t loc int_t state_ty >>?= fun (Ty_ex_c pair_ty) -> + pair_t loc bytes_t pair_ty >>?= fun (Ty_ex_c pair_ty) -> + option_t loc pair_ty >>?= fun ty -> + let stack = Item_t (ty, rest) in + typed ctxt loc instr stack + (* control *) + | Seq (loc, []), stack -> + let instr = {apply = (fun k -> k)} in + typed ctxt loc instr stack + | Seq (_, [single]), stack -> + non_terminal_recursion tc_context ctxt single stack + | Seq (loc, hd :: tl), stack -> ( + non_terminal_recursion tc_context ctxt hd stack + >>=? fun (judgement, ctxt) -> + match judgement with + | Failed _ -> tzfail (Fail_not_in_tail_position (Micheline.location hd)) + | Typed ({aft = middle; _} as ihd) -> + non_terminal_recursion + tc_context + ctxt + (Seq (Micheline.dummy_location, tl)) + middle + >|=? fun (judgement, ctxt) -> + let judgement = + match judgement with + | Failed {descr} -> + let descr ret = compose_descr loc ihd (descr ret) in + Failed {descr} + | Typed itl -> Typed (compose_descr loc ihd itl) + in + (judgement, ctxt)) + | Prim (loc, I_IF, [bt; bf], annot), (Item_t (Bool_t, rest) as bef) -> + check_kind [Seq_kind] bt >>?= fun () -> + check_kind [Seq_kind] bf >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt bt rest >>=? fun (btr, ctxt) -> + non_terminal_recursion tc_context ctxt bf rest >>=? fun (bfr, ctxt) -> + let branch ibt ibf = + let instr = + { + apply = + (fun k -> + let hloc = kinstr_location k in + let branch_if_true = ibt.instr.apply (IHalt hloc) + and branch_if_false = ibf.instr.apply (IHalt hloc) in + IIf {loc; branch_if_true; branch_if_false; k}); + } + in + {loc; instr; bef; aft = ibt.aft} + in + Lwt.return @@ merge_branches ctxt loc btr bfr {branch} + | Prim (loc, I_LOOP, [body], annot), (Item_t (Bool_t, rest) as stack) -> ( + check_kind [Seq_kind] body >>?= fun () -> + error_unexpected_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body rest + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed ibody -> + let unmatched_branches () = + let aft = serialize_stack_for_error ctxt ibody.aft in + let stack = serialize_stack_for_error ctxt stack in + Unmatched_branches (loc, aft, stack) + in + record_trace_eval + unmatched_branches + ( stack_eq loc ctxt 1 ibody.aft stack >>? fun (Eq, ctxt) -> + let instr = + { + apply = + (fun k -> + let loc = kinstr_location k in + let ibody = ibody.instr.apply (IHalt loc) in + ILoop (loc, ibody, k)); + } + in + typed_no_lwt ctxt loc instr rest ) + | Failed {descr} -> + let instr = + { + apply = + (fun k -> + let loc = kinstr_location k in + let ibody = descr stack in + let ibody = ibody.instr.apply (IHalt loc) in + ILoop (loc, ibody, k)); + } + in + typed_no_lwt ctxt loc instr rest) + | ( Prim (loc, I_LOOP_LEFT, [body], annot), + (Item_t (Union_t (tl, tr, _, _), rest) as stack) ) -> ( + check_kind [Seq_kind] body >>?= fun () -> + check_var_annot loc annot >>?= fun () -> + non_terminal_recursion tc_context ctxt body (Item_t (tl, rest)) + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed ibody -> + let unmatched_branches () = + let aft = serialize_stack_for_error ctxt ibody.aft in + let stack = serialize_stack_for_error ctxt stack in + Unmatched_branches (loc, aft, stack) + in + record_trace_eval + unmatched_branches + ( stack_eq loc ctxt 1 ibody.aft stack >>? fun (Eq, ctxt) -> + let instr = + { + apply = + (fun k -> + let loc = kinstr_location k in + let ibody = ibody.instr.apply (IHalt loc) in + ILoop_left (loc, ibody, k)); + } + in + let stack = Item_t (tr, rest) in + typed_no_lwt ctxt loc instr stack ) + | Failed {descr} -> + let instr = + { + apply = + (fun k -> + let loc = kinstr_location k in + let ibody = descr stack in + let ibody = ibody.instr.apply (IHalt loc) in + ILoop_left (loc, ibody, k)); + } + in + let stack = Item_t (tr, rest) in + typed_no_lwt ctxt loc instr stack) + | Prim (loc, I_LAMBDA, [arg; ret; code], annot), stack -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy arg + >>?= fun (Ex_ty arg, ctxt) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy ret + >>?= fun (Ex_ty ret, ctxt) -> + check_kind [Seq_kind] code >>?= fun () -> + check_var_annot loc annot >>?= fun () -> + parse_kdescr + (Tc_context.add_lambda tc_context) + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + arg + ret + code + >>=? fun (kdescr, ctxt) -> + let instr = {apply = (fun k -> ILambda (loc, Lam (kdescr, code), k))} in + lambda_t loc arg ret >>?= fun ty -> + let stack = Item_t (ty, stack) in + typed ctxt loc instr stack + | ( Prim (loc, I_LAMBDA_REC, [arg_ty_expr; ret_ty_expr; lambda_expr], annot), + stack ) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy arg_ty_expr + >>?= fun (Ex_ty arg, ctxt) -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy ret_ty_expr + >>?= fun (Ex_ty ret, ctxt) -> + check_kind [Seq_kind] lambda_expr >>?= fun () -> + check_var_annot loc annot >>?= fun () -> + lambda_t loc arg ret >>?= fun lambda_rec_ty -> + parse_lam_rec + Tc_context.(add_lambda tc_context) + ~elab_conf + ~stack_depth:(stack_depth + 1) + ctxt + arg + ret + lambda_rec_ty + lambda_expr + >>=? fun (code, ctxt) -> + let instr = {apply = (fun k -> ILambda (loc, code, k))} in + let stack = Item_t (lambda_rec_ty, stack) in + typed ctxt loc instr stack + | ( Prim (loc, I_EXEC, [], annot), + Item_t (arg, Item_t (Lambda_t (param, ret, _), rest)) ) -> + check_item_ty ctxt arg param loc I_EXEC 1 2 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let stack = Item_t (ret, rest) in + let instr = {apply = (fun k -> IExec (loc, for_logging_only stack, k))} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, I_APPLY, [], annot), + Item_t + ( capture, + Item_t (Lambda_t (Pair_t (capture_ty, arg_ty, _, _), ret, _), rest) ) + ) -> + check_packable ~legacy:false loc capture_ty >>?= fun () -> + check_item_ty ctxt capture capture_ty loc I_APPLY 1 2 + >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IApply (loc, capture_ty, k))} in + lambda_t loc arg_ty ret + (* This cannot tzfail because the type [lambda 'arg 'ret] is always smaller than + the input type [lambda (pair 'arg 'capture) 'ret]. In an ideal world, there + would be a smart deconstructor to ensure this statically. *) + >>?= + fun res_ty -> + let stack = Item_t (res_ty, rest) in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_DIP, [code], annot), Item_t (v, rest) -> ( + error_unexpected_annot loc annot >>?= fun () -> + check_kind [Seq_kind] code >>?= fun () -> + non_terminal_recursion tc_context ctxt code rest + >>=? fun (judgement, ctxt) -> + match judgement with + | Typed descr -> + let instr = + { + apply = + (fun k -> + let b = descr.instr.apply (IHalt descr.loc) in + IDip (loc, b, for_logging_only v, k)); + } + in + let stack = Item_t (v, descr.aft) in + typed ctxt loc instr stack + | Failed _ -> tzfail (Fail_not_in_tail_position loc)) + | Prim (loc, I_DIP, [n; code], result_annot), stack -> + parse_uint10 n >>?= fun n -> + Gas.consume ctxt (Typecheck_costs.proof_argument n) >>?= fun ctxt -> + let rec make_proof_argument : + type a s. + int -> (a, s) stack_ty -> (a, s) dipn_proof_argument tzresult Lwt.t = + fun n stk -> + match (Compare.Int.(n = 0), stk) with + | true, rest -> ( + non_terminal_recursion tc_context ctxt code rest + >>=? fun (judgement, ctxt) -> + Lwt.return + @@ + match judgement with + | Typed descr -> + ok + (Dipn_proof_argument (KRest, ctxt, descr, descr.aft) + : (a, s) dipn_proof_argument) + | Failed _ -> error (Fail_not_in_tail_position loc)) + | false, Item_t (v, rest) -> + make_proof_argument (n - 1) rest + >|=? fun (Dipn_proof_argument (n', ctxt, descr, aft')) -> + let w = KPrefix (loc, v, n') in + Dipn_proof_argument (w, ctxt, descr, Item_t (v, aft')) + | _, _ -> + Lwt.return + (let whole_stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, I_DIP, 1, whole_stack))) + in + error_unexpected_annot loc result_annot >>?= fun () -> + make_proof_argument n stack + >>=? fun (Dipn_proof_argument (n', ctxt, descr, aft)) -> + let b = descr.instr.apply (IHalt descr.loc) in + let res = {apply = (fun k -> IDipn (loc, n, n', b, k))} in + typed ctxt loc res aft + | Prim (loc, I_DIP, (([] | _ :: _ :: _ :: _) as l), _), _ -> + (* Technically, the arities 1 and 2 are allowed but the error only mentions 2. + However, DIP {code} is equivalent to DIP 1 {code} so hinting at an arity of 2 makes sense. *) + tzfail (Invalid_arity (loc, I_DIP, 2, List.length l)) + | Prim (loc, I_FAILWITH, [], annot), Item_t (v, _rest) -> + Lwt.return + ( error_unexpected_annot loc annot >>? fun () -> + (if legacy then Result.return_unit + else check_packable ~legacy:false loc v) + >|? fun () -> + let instr = {apply = (fun _k -> IFailwith (loc, v))} in + let descr aft = {loc; instr; bef = stack_ty; aft} in + log_stack loc stack_ty Bot_t ; + (Failed {descr}, ctxt) ) + | Prim (loc, I_NEVER, [], annot), Item_t (Never_t, _rest) -> + Lwt.return + ( error_unexpected_annot loc annot >|? fun () -> + let instr = {apply = (fun _k -> INever loc)} in + let descr aft = {loc; instr; bef = stack_ty; aft} in + log_stack loc stack_ty Bot_t ; + (Failed {descr}, ctxt) ) + (* timestamp operations *) + | Prim (loc, I_ADD, [], annot), Item_t (Timestamp_t, Item_t (Int_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_timestamp_to_seconds (loc, k))} in + typed ctxt loc instr (Item_t (Timestamp_t, rest)) + | ( Prim (loc, I_ADD, [], annot), + Item_t (Int_t, (Item_t (Timestamp_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_seconds_to_timestamp (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SUB, [], annot), Item_t (Timestamp_t, Item_t (Int_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_timestamp_seconds (loc, k))} in + let stack = Item_t (Timestamp_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_SUB, [], annot), + Item_t (Timestamp_t, Item_t (Timestamp_t, rest)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IDiff_timestamps (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + (* string operations *) + | ( Prim (loc, I_CONCAT, [], annot), + Item_t (String_t, (Item_t (String_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IConcat_string_pair (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_CONCAT, [], annot), Item_t (List_t (String_t, _), rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IConcat_string (loc, k))} in + typed ctxt loc instr (Item_t (String_t, rest)) + | ( Prim (loc, I_SLICE, [], annot), + Item_t (Nat_t, Item_t (Nat_t, Item_t (String_t, rest))) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISlice_string (loc, k))} in + let stack = Item_t (option_string_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_SIZE, [], annot), Item_t (String_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IString_size (loc, k))} in + let stack = Item_t (nat_t, rest) in + typed ctxt loc instr stack + (* bytes operations *) + | ( Prim (loc, I_CONCAT, [], annot), + Item_t (Bytes_t, (Item_t (Bytes_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IConcat_bytes_pair (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_CONCAT, [], annot), Item_t (List_t (Bytes_t, _), rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IConcat_bytes (loc, k))} in + let stack = Item_t (Bytes_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_SLICE, [], annot), + Item_t (Nat_t, Item_t (Nat_t, Item_t (Bytes_t, rest))) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISlice_bytes (loc, k))} in + let stack = Item_t (option_bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_SIZE, [], annot), Item_t (Bytes_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBytes_size (loc, k))} in + let stack = Item_t (nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_BYTES, [], annot), Item_t (Nat_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBytes_nat (loc, k))} in + let stack = Item_t (bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_NAT, [], annot), Item_t (Bytes_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INat_bytes (loc, k))} in + let stack = Item_t (nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_BYTES, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBytes_int (loc, k))} in + let stack = Item_t (bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_INT, [], annot), Item_t (Bytes_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IInt_bytes (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + (* currency operations *) + | ( Prim (loc, I_ADD, [], annot), + Item_t (Mutez_t, (Item_t (Mutez_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_tez (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_SUB, [], annot), + Item_t (Mutez_t, (Item_t (Mutez_t, _) as stack)) ) -> + if legacy then + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_tez_legacy (loc, k))} in + typed ctxt loc instr stack + else tzfail (Deprecated_instruction I_SUB) + | Prim (loc, I_SUB_MUTEZ, [], annot), Item_t (Mutez_t, Item_t (Mutez_t, rest)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_tez (loc, k))} in + let stack = Item_t (option_mutez_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Mutez_t, Item_t (Nat_t, rest)) -> + (* no type name check *) + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_teznat (loc, k))} in + let stack = Item_t (Mutez_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Nat_t, (Item_t (Mutez_t, _) as stack)) + -> + (* no type name check *) + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_nattez (loc, k))} in + typed ctxt loc instr stack + (* boolean operations *) + | Prim (loc, I_OR, [], annot), Item_t (Bool_t, (Item_t (Bool_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IOr (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_AND, [], annot), Item_t (Bool_t, (Item_t (Bool_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAnd (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_XOR, [], annot), Item_t (Bool_t, (Item_t (Bool_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IXor (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NOT, [], annot), (Item_t (Bool_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INot (loc, k))} in + typed ctxt loc instr stack + (* integer operations *) + | Prim (loc, I_ABS, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAbs_int (loc, k))} in + let stack = Item_t (nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_ISNAT, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IIs_nat (loc, k))} in + let stack = Item_t (option_nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_INT, [], annot), Item_t (Nat_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IInt_nat (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_NEG, [], annot), (Item_t (Int_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeg (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NEG, [], annot), Item_t (Nat_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeg (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_ADD, [], annot), Item_t (Int_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_ADD, [], annot), Item_t (Int_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_int (loc, k))} in + let stack = Item_t (Int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_ADD, [], annot), Item_t (Nat_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_ADD, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SUB, [], annot), Item_t (Int_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SUB, [], annot), Item_t (Int_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_int (loc, k))} in + let stack = Item_t (Int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_SUB, [], annot), Item_t (Nat_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SUB, [], annot), Item_t (Nat_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISub_int (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Int_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Int_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_int (loc, k))} in + let stack = Item_t (Int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Nat_t, (Item_t (Int_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Mutez_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_teznat (loc, k))} in + let stack = Item_t (option_pair_mutez_mutez_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Mutez_t, Item_t (Mutez_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_tez (loc, k))} in + let stack = Item_t (option_pair_nat_mutez_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Int_t, Item_t (Int_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_int (loc, k))} in + let stack = Item_t (option_pair_int_nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Int_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_int (loc, k))} in + let stack = Item_t (option_pair_int_nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Nat_t, Item_t (Int_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_nat (loc, k))} in + let stack = Item_t (option_pair_int_nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_EDIV, [], annot), Item_t (Nat_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEdiv_nat (loc, k))} in + let stack = Item_t (option_pair_nat_nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_LSL, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILsl_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_LSL, [], annot), Item_t (Bytes_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILsl_bytes (loc, k))} in + let stack = Item_t (Bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_LSR, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILsr_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_LSR, [], annot), Item_t (Bytes_t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILsr_bytes (loc, k))} in + let stack = Item_t (Bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_OR, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IOr_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_OR, [], annot), Item_t (Bytes_t, (Item_t (Bytes_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IOr_bytes (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_AND, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAnd_nat (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_AND, [], annot), Item_t (Int_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAnd_int_nat (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_AND, [], annot), + Item_t (Bytes_t, (Item_t (Bytes_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAnd_bytes (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_XOR, [], annot), Item_t (Nat_t, (Item_t (Nat_t, _) as stack)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IXor_nat (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_XOR, [], annot), + Item_t (Bytes_t, (Item_t (Bytes_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IXor_bytes (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NOT, [], annot), (Item_t (Int_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INot_int (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NOT, [], annot), Item_t (Nat_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INot_int (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_NOT, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INot_bytes (loc, k))} in + typed ctxt loc instr stack + (* comparison *) + | Prim (loc, I_COMPARE, [], annot), Item_t (t1, Item_t (t2, rest)) -> + check_var_annot loc annot >>?= fun () -> + check_item_ty ctxt t1 t2 loc I_COMPARE 1 2 >>?= fun (Eq, ctxt) -> + check_comparable loc t1 >>?= fun Eq -> + let instr = {apply = (fun k -> ICompare (loc, t1, k))} in + let stack = Item_t (int_t, rest) in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + (* comparators *) + | Prim (loc, I_EQ, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IEq (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_NEQ, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeq (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_LT, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILt (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_GT, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IGt (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_LE, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILe (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_GE, [], annot), Item_t (Int_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IGe (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + (* annotations *) + | Prim (loc, I_CAST, [cast_t], annot), (Item_t (t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + parse_any_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy cast_t + >>?= fun (Ex_ty cast_t, ctxt) -> + Gas_monad.run ctxt @@ ty_eq ~error_details:(Informative loc) cast_t t + >>?= fun (eq, ctxt) -> + eq >>?= fun Eq -> + (* We can reuse [stack] because [a ty = b ty] means [a = b]. *) + let instr = {apply = (fun k -> k)} in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | Prim (loc, I_RENAME, [], annot), (Item_t _ as stack) -> + check_var_annot loc annot >>?= fun () -> + (* can erase annot *) + let instr = {apply = (fun k -> k)} in + typed ctxt loc instr stack + (* packing *) + | Prim (loc, I_PACK, [], annot), Item_t (t, rest) -> + check_packable + ~legacy:true + (* allow to pack contracts for hash/signature checks *) loc + t + >>?= fun () -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IPack (loc, t, k))} in + let stack = Item_t (bytes_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_UNPACK, [ty], annot), Item_t (Bytes_t, rest) -> + parse_packable_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy ty + >>?= fun (Ex_ty t, ctxt) -> + check_var_type_annot loc annot >>?= fun () -> + option_t loc t >>?= fun res_ty -> + let instr = {apply = (fun k -> IUnpack (loc, t, k))} in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + (* protocol *) + | Prim (loc, I_ADDRESS, [], annot), Item_t (Contract_t _, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAddress (loc, k))} in + let stack = Item_t (address_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_CONTRACT, [ty], annot), Item_t (Address_t, rest) -> + parse_passable_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy ty + >>?= fun (Ex_ty t, ctxt) -> + contract_t loc t >>?= fun contract_ty -> + option_t loc contract_ty >>?= fun res_ty -> + parse_entrypoint_annot_strict loc annot >>?= fun entrypoint -> + let instr = {apply = (fun k -> IContract (loc, t, entrypoint, k))} in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_VIEW, [name; output_ty], annot), + Item_t (input_ty, Item_t (Address_t, rest)) ) -> + let output_ty_loc = location output_ty in + parse_view_name ctxt name >>?= fun (name, ctxt) -> + parse_view_output_ty ctxt ~stack_depth:0 ~legacy output_ty + >>?= fun (Ex_ty output_ty, ctxt) -> + option_t output_ty_loc output_ty >>?= fun res_ty -> + check_var_annot loc annot >>?= fun () -> + let instr = + { + apply = + (fun k -> + IView + ( loc, + View_signature {name; input_ty; output_ty}, + for_logging_only rest, + k )); + } + in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + | ( Prim (loc, (I_TRANSFER_TOKENS as prim), [], annot), + Item_t (p, Item_t (Mutez_t, Item_t (Contract_t (cp, _), rest))) ) -> + Tc_context.check_not_in_view loc ~legacy tc_context prim >>?= fun () -> + check_item_ty ctxt p cp loc prim 1 4 >>?= fun (Eq, ctxt) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ITransfer_tokens (loc, k))} in + let stack = Item_t (operation_t, rest) in + (typed ctxt loc instr stack : ((a, s) judgement * context) tzresult Lwt.t) + | ( Prim (loc, (I_SET_DELEGATE as prim), [], annot), + Item_t (Option_t (Key_hash_t, _, _), rest) ) -> + Tc_context.check_not_in_view loc ~legacy tc_context prim >>?= fun () -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISet_delegate (loc, k))} in + let stack = Item_t (operation_t, rest) in + typed ctxt loc instr stack + | Prim (_, I_CREATE_ACCOUNT, _, _), _ -> + tzfail (Deprecated_instruction I_CREATE_ACCOUNT) + | Prim (loc, I_IMPLICIT_ACCOUNT, [], annot), Item_t (Key_hash_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IImplicit_account (loc, k))} in + let stack = Item_t (contract_unit_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, (I_CREATE_CONTRACT as prim), [(Seq _ as code)], annot), + Item_t + (Option_t (Key_hash_t, _, _), Item_t (Mutez_t, Item_t (ginit, rest))) ) + -> ( + Tc_context.check_not_in_view ~legacy loc tc_context prim >>?= fun () -> + check_two_var_annot loc annot >>?= fun () -> + (* We typecheck the script to make sure we will originate only well-typed + contracts but then we throw away the typed version, except for the + storage type which is kept for efficiency in the ticket scanner. *) + let canonical_code = Micheline.strip_locations code in + parse_toplevel ctxt ~legacy canonical_code + >>?= fun ({arg_type; storage_type; code_field; views}, ctxt) -> + record_trace + (Ill_formed_type (Some "parameter", canonical_code, location arg_type)) + (parse_parameter_ty_and_entrypoints + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + arg_type) + >>?= fun (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, ctxt) + -> + record_trace + (Ill_formed_type (Some "storage", canonical_code, location storage_type)) + (parse_storage_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy + storage_type) + >>?= fun (Ex_ty storage_type, ctxt) -> + pair_t loc arg_type storage_type >>?= fun (Ty_ex_c arg_type_full) -> + pair_t loc list_operation_t storage_type + >>?= fun (Ty_ex_c ret_type_full) -> + trace + (Ill_typed_contract (canonical_code, [])) + (parse_kdescr + (Tc_context.toplevel ~storage_type ~param_type:arg_type ~entrypoints) + ctxt + ~elab_conf + ~stack_depth:(stack_depth + 1) + arg_type_full + ret_type_full + code_field) + >>=? function + | {kbef = Item_t (arg, Bot_t); kaft = Item_t (ret, Bot_t); _}, ctxt -> + let views_result = parse_views ctxt ~elab_conf storage_type views in + trace (Ill_typed_contract (canonical_code, [])) views_result + >>=? fun (_typed_views, ctxt) -> + (let error_details = Informative loc in + Gas_monad.run ctxt + @@ + let open Gas_monad.Syntax in + let* Eq = ty_eq ~error_details arg arg_type_full in + let* Eq = ty_eq ~error_details ret ret_type_full in + ty_eq ~error_details storage_type ginit) + >>?= fun (storage_eq, ctxt) -> + storage_eq >>?= fun Eq -> + let instr = + { + apply = + (fun k -> + ICreate_contract {loc; storage_type; code = canonical_code; k}); + } + in + let stack = Item_t (operation_t, Item_t (address_t, rest)) in + typed ctxt loc instr stack) + | Prim (loc, I_NOW, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INow (loc, k))} in + let stack = Item_t (timestamp_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_MIN_BLOCK_TIME, [], _), stack -> + typed + ctxt + loc + {apply = (fun k -> IMin_block_time (loc, k))} + (Item_t (nat_t, stack)) + | Prim (loc, I_AMOUNT, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAmount (loc, k))} in + let stack = Item_t (mutez_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_CHAIN_ID, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IChainId (loc, k))} in + let stack = Item_t (chain_id_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_BALANCE, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBalance (loc, k))} in + let stack = Item_t (mutez_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_LEVEL, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ILevel (loc, k))} in + let stack = Item_t (nat_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_VOTING_POWER, [], annot), Item_t (Key_hash_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IVoting_power (loc, k))} in + let stack = Item_t (nat_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_TOTAL_VOTING_POWER, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ITotal_voting_power (loc, k))} in + let stack = Item_t (nat_t, stack) in + typed ctxt loc instr stack + | Prim (_, I_STEPS_TO_QUOTA, _, _), _ -> + tzfail (Deprecated_instruction I_STEPS_TO_QUOTA) + | Prim (loc, I_SOURCE, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISource (loc, k))} in + let stack = Item_t (address_t, stack) in + typed ctxt loc instr stack + | Prim (loc, I_SENDER, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISender (loc, k))} in + let stack = Item_t (address_t, stack) in + typed ctxt loc instr stack + | Prim (loc, (I_SELF as prim), [], annot), stack -> + Lwt.return + ( parse_entrypoint_annot_lax loc annot >>? fun entrypoint -> + let open Tc_context in + match tc_context.callsite with + | _ when is_in_lambda tc_context -> + error + (Forbidden_instr_in_context (loc, Script_tc_errors.Lambda, prim)) + (* [Data] is for pushed instructions of lambda type. *) + | Data -> + error + (Forbidden_instr_in_context (loc, Script_tc_errors.Lambda, prim)) + | View -> + error + (Forbidden_instr_in_context (loc, Script_tc_errors.View, prim)) + | Toplevel {param_type; entrypoints; storage_type = _} -> + Gas_monad.run ctxt + @@ find_entrypoint + ~error_details:(Informative ()) + param_type + entrypoints + entrypoint + >>? fun (r, ctxt) -> + r >>? fun (Ex_ty_cstr {ty = param_type; _}) -> + contract_t loc param_type >>? fun res_ty -> + let instr = + {apply = (fun k -> ISelf (loc, param_type, entrypoint, k))} + in + let stack = Item_t (res_ty, stack) in + typed_no_lwt ctxt loc instr stack ) + | Prim (loc, I_SELF_ADDRESS, [], annot), stack -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISelf_address (loc, k))} in + let stack = Item_t (address_t, stack) in + typed ctxt loc instr stack + (* cryptography *) + | Prim (loc, I_HASH_KEY, [], annot), Item_t (Key_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IHash_key (loc, k))} in + let stack = Item_t (key_hash_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_CHECK_SIGNATURE, [], annot), + Item_t (Key_t, Item_t (Signature_t, Item_t (Bytes_t, rest))) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ICheck_signature (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_BLAKE2B, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IBlake2b (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SHA256, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISha256 (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SHA512, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISha512 (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_KECCAK, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IKeccak (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_SHA3, [], annot), (Item_t (Bytes_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> ISha3 (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_ADD, [], annot), + Item_t (Bls12_381_g1_t, (Item_t (Bls12_381_g1_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_bls12_381_g1 (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_ADD, [], annot), + Item_t (Bls12_381_g2_t, (Item_t (Bls12_381_g2_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_bls12_381_g2 (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_ADD, [], annot), + Item_t (Bls12_381_fr_t, (Item_t (Bls12_381_fr_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IAdd_bls12_381_fr (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_MUL, [], annot), + Item_t (Bls12_381_g1_t, Item_t (Bls12_381_fr_t, rest)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_g1 (loc, k))} in + let stack = Item_t (Bls12_381_g1_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_MUL, [], annot), + Item_t (Bls12_381_g2_t, Item_t (Bls12_381_fr_t, rest)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_g2 (loc, k))} in + let stack = Item_t (Bls12_381_g2_t, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_MUL, [], annot), + Item_t (Bls12_381_fr_t, (Item_t (Bls12_381_fr_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_fr (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_MUL, [], annot), + Item_t (Nat_t, (Item_t (Bls12_381_fr_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_fr_z (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_MUL, [], annot), + Item_t (Int_t, (Item_t (Bls12_381_fr_t, _) as stack)) ) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_fr_z (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Bls12_381_fr_t, Item_t (Int_t, rest)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_z_fr (loc, k))} in + let stack = Item_t (Bls12_381_fr_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_MUL, [], annot), Item_t (Bls12_381_fr_t, Item_t (Nat_t, rest)) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IMul_bls12_381_z_fr (loc, k))} in + let stack = Item_t (Bls12_381_fr_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_INT, [], annot), Item_t (Bls12_381_fr_t, rest) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IInt_bls12_381_fr (loc, k))} in + let stack = Item_t (int_t, rest) in + typed ctxt loc instr stack + | Prim (loc, I_NEG, [], annot), (Item_t (Bls12_381_g1_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeg_bls12_381_g1 (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NEG, [], annot), (Item_t (Bls12_381_g2_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeg_bls12_381_g2 (loc, k))} in + typed ctxt loc instr stack + | Prim (loc, I_NEG, [], annot), (Item_t (Bls12_381_fr_t, _) as stack) -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> INeg_bls12_381_fr (loc, k))} in + typed ctxt loc instr stack + | ( Prim (loc, I_PAIRING_CHECK, [], annot), + Item_t (List_t (Pair_t (Bls12_381_g1_t, Bls12_381_g2_t, _, _), _), rest) ) + -> + check_var_annot loc annot >>?= fun () -> + let instr = {apply = (fun k -> IPairing_check_bls12_381 (loc, k))} in + let stack = Item_t (bool_t, rest) in + typed ctxt loc instr stack + (* Tickets *) + | Prim (loc, I_TICKET, [], annot), Item_t (t, Item_t (Nat_t, rest)) -> + check_var_annot loc annot >>?= fun () -> + check_comparable loc t >>?= fun Eq -> + ticket_t loc t >>?= fun res_ty -> + let instr = {apply = (fun k -> ITicket (loc, for_logging_only t, k))} in + option_t loc res_ty >>?= fun res_ty -> + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + | Prim (loc, I_TICKET_DEPRECATED, [], annot), Item_t (t, Item_t (Nat_t, rest)) + -> + if legacy then + check_var_annot loc annot >>?= fun () -> + check_comparable loc t >>?= fun Eq -> + ticket_t loc t >>?= fun res_ty -> + let instr = + {apply = (fun k -> ITicket_deprecated (loc, for_logging_only t, k))} + in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + else tzfail (Deprecated_instruction I_TICKET_DEPRECATED) + | ( Prim (loc, I_READ_TICKET, [], annot), + (Item_t (Ticket_t (t, _), _) as full_stack) ) -> + check_var_annot loc annot >>?= fun () -> + let () = check_dupable_comparable_ty t in + opened_ticket_type loc t >>?= fun result -> + let instr = + {apply = (fun k -> IRead_ticket (loc, for_logging_only t, k))} + in + let stack = Item_t (result, full_stack) in + typed ctxt loc instr stack + | ( Prim (loc, I_SPLIT_TICKET, [], annot), + Item_t + ( (Ticket_t (t, _) as ticket_t), + Item_t (Pair_t (Nat_t, Nat_t, _, _), rest) ) ) -> + check_var_annot loc annot >>?= fun () -> + let () = check_dupable_comparable_ty t in + pair_t loc ticket_t ticket_t >>?= fun (Ty_ex_c pair_tickets_ty) -> + option_t loc pair_tickets_ty >>?= fun res_ty -> + let instr = {apply = (fun k -> ISplit_ticket (loc, k))} in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + | ( Prim (loc, I_JOIN_TICKETS, [], annot), + Item_t + ( Pair_t + ( (Ticket_t (contents_ty_a, _) as ty_a), + Ticket_t (contents_ty_b, _), + _, + _ ), + rest ) ) -> + check_var_annot loc annot >>?= fun () -> + Gas_monad.run ctxt + @@ ty_eq ~error_details:(Informative loc) contents_ty_a contents_ty_b + >>?= fun (eq, ctxt) -> + eq >>?= fun Eq -> + option_t loc ty_a >>?= fun res_ty -> + let instr = {apply = (fun k -> IJoin_tickets (loc, contents_ty_a, k))} in + let stack = Item_t (res_ty, rest) in + typed ctxt loc instr stack + (* Timelocks *) + | ( Prim (loc, I_OPEN_CHEST, [], _), + Item_t (Chest_key_t, Item_t (Chest_t, Item_t (Nat_t, rest))) ) -> + if legacy then + let instr = {apply = (fun k -> IOpen_chest (loc, k))} in + typed ctxt loc instr (Item_t (union_bytes_bool_t, rest)) + else tzfail (Deprecated_instruction I_OPEN_CHEST) + (* Events *) + | Prim (loc, I_EMIT, [], annot), Item_t (data, rest) -> + check_packable ~legacy loc data >>?= fun () -> + parse_entrypoint_annot_strict loc annot >>?= fun tag -> + unparse_ty ~loc:() ctxt data >>?= fun (unparsed_ty, ctxt) -> + Gas.consume ctxt (Script.strip_locations_cost unparsed_ty) + >>?= fun ctxt -> + let unparsed_ty = Micheline.strip_locations unparsed_ty in + let instr = + {apply = (fun k -> IEmit {loc; tag; ty = data; unparsed_ty; k})} + in + typed ctxt loc instr (Item_t (Operation_t, rest)) + | Prim (loc, I_EMIT, [ty_node], annot), Item_t (data, rest) -> + parse_packable_ty ctxt ~stack_depth:(stack_depth + 1) ~legacy ty_node + >>?= fun (Ex_ty ty, ctxt) -> + check_item_ty ctxt ty data loc I_EMIT 1 2 >>?= fun (Eq, ctxt) -> + parse_entrypoint_annot_strict loc annot >>?= fun tag -> + Gas.consume ctxt (Script.strip_locations_cost ty_node) >>?= fun ctxt -> + let unparsed_ty = Micheline.strip_locations ty_node in + let instr = + {apply = (fun k -> IEmit {loc; tag; ty = data; unparsed_ty; k})} + in + typed ctxt loc instr (Item_t (Operation_t, rest)) + (* Primitive parsing errors *) + | ( Prim + ( loc, + (( I_DUP | I_SWAP | I_SOME | I_UNIT | I_PAIR | I_UNPAIR | I_CAR + | I_CDR | I_CONS | I_CONCAT | I_SLICE | I_MEM | I_UPDATE | I_GET + | I_EXEC | I_FAILWITH | I_SIZE | I_ADD | I_SUB | I_SUB_MUTEZ | I_MUL + | I_EDIV | I_OR | I_AND | I_XOR | I_NOT | I_ABS | I_NEG | I_LSL + | I_LSR | I_COMPARE | I_EQ | I_NEQ | I_LT | I_GT | I_LE | I_GE + | I_TRANSFER_TOKENS | I_SET_DELEGATE | I_NOW | I_MIN_BLOCK_TIME + | I_IMPLICIT_ACCOUNT | I_AMOUNT | I_BALANCE | I_LEVEL + | I_CHECK_SIGNATURE | I_HASH_KEY | I_SOURCE | I_SENDER | I_BLAKE2B + | I_SHA256 | I_SHA512 | I_ADDRESS | I_RENAME | I_PACK | I_ISNAT + | I_INT | I_SELF | I_CHAIN_ID | I_NEVER | I_VOTING_POWER + | I_TOTAL_VOTING_POWER | I_KECCAK | I_SHA3 | I_PAIRING_CHECK + | I_TICKET | I_READ_TICKET | I_SPLIT_TICKET | I_JOIN_TICKETS + | I_OPEN_CHEST ) as name), + (_ :: _ as l), + _ ), + _ ) -> + tzfail (Invalid_arity (loc, name, 0, List.length l)) + | ( Prim + ( loc, + (( I_NONE | I_LEFT | I_RIGHT | I_NIL | I_MAP | I_ITER | I_EMPTY_SET + | I_LOOP | I_LOOP_LEFT | I_CONTRACT | I_CAST | I_UNPACK + | I_CREATE_CONTRACT | I_EMIT ) as name), + (([] | _ :: _ :: _) as l), + _ ), + _ ) -> + tzfail (Invalid_arity (loc, name, 1, List.length l)) + | ( Prim + ( loc, + (( I_PUSH | I_VIEW | I_IF_NONE | I_IF_LEFT | I_IF_CONS | I_EMPTY_MAP + | I_EMPTY_BIG_MAP | I_IF ) as name), + (([] | [_] | _ :: _ :: _ :: _) as l), + _ ), + _ ) -> + tzfail (Invalid_arity (loc, name, 2, List.length l)) + | ( Prim (loc, I_LAMBDA, (([] | [_] | [_; _] | _ :: _ :: _ :: _ :: _) as l), _), + _ ) -> + tzfail (Invalid_arity (loc, I_LAMBDA, 3, List.length l)) + (* Stack errors *) + | ( Prim + ( loc, + (( I_ADD | I_SUB | I_SUB_MUTEZ | I_MUL | I_EDIV | I_AND | I_OR | I_XOR + | I_LSL | I_LSR | I_CONCAT | I_PAIRING_CHECK ) as name), + [], + _ ), + Item_t (ta, Item_t (tb, _)) ) -> + let ta = serialize_ty_for_error ta in + let tb = serialize_ty_for_error tb in + tzfail (Undefined_binop (loc, name, ta, tb)) + | ( Prim + ( loc, + (( I_NEG | I_ABS | I_NOT | I_SIZE | I_EQ | I_NEQ | I_LT | I_GT | I_LE + | I_GE + (* CONCAT is both unary and binary; this case can only be triggered + on a singleton stack *) + | I_CONCAT ) as name), + [], + _ ), + Item_t (t, _) ) -> + let t = serialize_ty_for_error t in + tzfail (Undefined_unop (loc, name, t)) + | Prim (loc, ((I_UPDATE | I_SLICE | I_OPEN_CHEST) as name), [], _), stack -> + Lwt.return + (let stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, name, 3, stack))) + | Prim (loc, I_CREATE_CONTRACT, _, _), stack -> + let stack = serialize_stack_for_error ctxt stack in + tzfail (Bad_stack (loc, I_CREATE_CONTRACT, 7, stack)) + | Prim (loc, I_TRANSFER_TOKENS, [], _), stack -> + Lwt.return + (let stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, I_TRANSFER_TOKENS, 4, stack))) + | ( Prim + ( loc, + (( I_DROP | I_DUP | I_CAR | I_CDR | I_UNPAIR | I_SOME | I_BLAKE2B + | I_SHA256 | I_SHA512 | I_DIP | I_IF_NONE | I_LEFT | I_RIGHT + | I_IF_LEFT | I_IF | I_LOOP | I_IF_CONS | I_IMPLICIT_ACCOUNT | I_NEG + | I_ABS | I_INT | I_NOT | I_HASH_KEY | I_EQ | I_NEQ | I_LT | I_GT + | I_LE | I_GE | I_SIZE | I_FAILWITH | I_RENAME | I_PACK | I_ISNAT + | I_ADDRESS | I_SET_DELEGATE | I_CAST | I_MAP | I_ITER | I_LOOP_LEFT + | I_UNPACK | I_CONTRACT | I_NEVER | I_KECCAK | I_SHA3 | I_READ_TICKET + | I_JOIN_TICKETS ) as name), + _, + _ ), + stack ) -> + Lwt.return + (let stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, name, 1, stack))) + | ( Prim + ( loc, + (( I_SWAP | I_PAIR | I_CONS | I_GET | I_MEM | I_EXEC + | I_CHECK_SIGNATURE | I_ADD | I_SUB | I_SUB_MUTEZ | I_MUL | I_EDIV + | I_AND | I_OR | I_XOR | I_LSL | I_LSR | I_COMPARE | I_PAIRING_CHECK + | I_TICKET | I_SPLIT_TICKET ) as name), + _, + _ ), + stack ) -> + Lwt.return + (let stack = serialize_stack_for_error ctxt stack in + error (Bad_stack (loc, name, 2, stack))) + (* Generic parsing errors *) + | expr, _ -> + tzfail + @@ unexpected + expr + [Seq_kind] + Instr_namespace + [ + I_ABS; + I_ADD; + I_AMOUNT; + I_AND; + I_BALANCE; + I_BLAKE2B; + I_CAR; + I_CDR; + I_CHECK_SIGNATURE; + I_COMPARE; + I_CONCAT; + I_CONS; + I_CREATE_CONTRACT; + I_DIG; + I_DIP; + I_DROP; + I_DUG; + I_DUP; + I_EDIV; + I_EMPTY_BIG_MAP; + I_EMPTY_MAP; + I_EMPTY_SET; + I_EQ; + I_EXEC; + I_FAILWITH; + I_GE; + I_GET; + I_GET_AND_UPDATE; + I_GT; + I_HASH_KEY; + I_IF; + I_IF_CONS; + I_IF_LEFT; + I_IF_NONE; + I_IMPLICIT_ACCOUNT; + I_INT; + I_ITER; + I_JOIN_TICKETS; + I_KECCAK; + I_LAMBDA; + I_LE; + I_LEFT; + I_LEVEL; + I_LOOP; + I_LSL; + I_LSR; + I_LT; + I_MAP; + I_MEM; + I_MIN_BLOCK_TIME; + I_MUL; + I_NEG; + I_NEQ; + I_NEVER; + I_NIL; + I_NONE; + I_NOT; + I_NOW; + I_OPEN_CHEST; + I_OR; + I_PAIR; + I_PAIRING_CHECK; + I_PUSH; + I_READ_TICKET; + I_RIGHT; + I_SAPLING_EMPTY_STATE; + I_SAPLING_VERIFY_UPDATE; + I_SELF; + I_SELF_ADDRESS; + I_SENDER; + I_SHA256; + I_SHA3; + I_SHA512; + I_SIZE; + I_SOME; + I_SOURCE; + I_SPLIT_TICKET; + I_SUB; + I_SUB_MUTEZ; + I_SWAP; + I_TICKET; + I_TOTAL_VOTING_POWER; + I_TRANSFER_TOKENS; + I_UNIT; + I_UNPAIR; + I_UPDATE; + I_VIEW; + I_VOTING_POWER; + I_XOR; + ] + +and parse_contract_data : + type arg argc. + stack_depth:int -> + context -> + Script.location -> + (arg, argc) ty -> + Destination.t -> + entrypoint:Entrypoint.t -> + (context * arg typed_contract) tzresult Lwt.t = + fun ~stack_depth ctxt loc arg destination ~entrypoint -> + let error_details = Informative loc in + parse_contract + ~stack_depth:(stack_depth + 1) + ctxt + ~error_details + loc + arg + destination + ~entrypoint + >>=? fun (ctxt, res) -> Lwt.return (res >|? fun res -> (ctxt, res)) + +(* [parse_contract] is used both to: + - parse contract data by [parse_data] ([parse_contract_data]) + - to execute the [CONTRACT] instruction ([parse_contract_for_script]). + + The return type resembles the [Gas_monad]: + - the outer [tzresult] is for gas exhaustion and internal errors + - the inner [result] is for other legitimate cases of failure. + + The inner [result] is turned into an [option] by [parse_contract_for_script]. + Both [tzresult] are merged by [parse_contract_data]. +*) +and parse_contract : + type arg argc err. + stack_depth:int -> + context -> + error_details:(location, err) error_details -> + Script.location -> + (arg, argc) ty -> + Destination.t -> + entrypoint:Entrypoint.t -> + (context * (arg typed_contract, err) result) tzresult Lwt.t = + fun ~stack_depth ctxt ~error_details loc arg destination ~entrypoint -> + let error ctxt f_err : context * (_, err) result = + ( ctxt, + Error + (match error_details with + | Fast -> (Inconsistent_types_fast : err) + | Informative loc -> trace_of_error @@ f_err loc) ) + in + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>?= fun ctxt -> + match destination with + | Contract contract -> ( + match contract with + | Implicit destination -> + Lwt.return + @@ + if Entrypoint.is_default entrypoint then + (* An implicit account on the "default" entrypoint always exists and has type unit + or (ticket cty). *) + let typecheck = + let open Gas_monad.Syntax in + let* () = Gas_monad.consume_gas Typecheck_costs.merge_cycle in + match arg with + | Unit_t -> + return (Typed_implicit destination : arg typed_contract) + | Ticket_t _ as ticket_ty -> + return (Typed_implicit_with_ticket {ticket_ty; destination}) + | _ -> + Gas_monad.of_result + @@ Error + (match error_details with + | Fast -> (Inconsistent_types_fast : err) + | Informative loc -> + trace_of_error @@ default_ty_eq_error loc arg unit_t) + in + Gas_monad.run ctxt typecheck >|? fun (v, ctxt) -> (ctxt, v) + else + (* An implicit account on any other entrypoint is not a valid contract. *) + ok @@ error ctxt (fun _loc -> No_such_entrypoint entrypoint) + | Originated contract_hash -> + trace + (Invalid_contract (loc, contract)) + ( Contract.get_script_code ctxt contract_hash + >>=? fun (ctxt, code) -> + Lwt.return + (match code with + | None -> + ok + (error ctxt (fun loc -> Invalid_contract (loc, contract))) + | Some code -> + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + code + >>? fun (code, ctxt) -> + (* can only fail because of gas *) + parse_toplevel ctxt ~legacy:true code + >>? fun ({arg_type; _}, ctxt) -> + parse_parameter_ty_and_entrypoints + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy:true + arg_type + >>? fun ( Ex_parameter_ty_and_entrypoints + {arg_type = targ; entrypoints}, + ctxt ) -> + Gas_monad.run ctxt + @@ find_entrypoint_for_type + ~error_details + ~full:targ + ~expected:arg + entrypoints + entrypoint + >|? fun (entrypoint_arg, ctxt) -> + ( ctxt, + entrypoint_arg >|? fun (entrypoint, arg_ty) -> + Typed_originated {arg_ty; contract_hash; entrypoint} )) )) + | Tx_rollup tx_rollup -> + Tx_rollup_state.assert_exist ctxt tx_rollup >|=? fun ctxt -> + if Entrypoint.(is_deposit entrypoint) then + (* /!\ This pattern matching needs to remain in sync with + [parse_tx_rollup_deposit_parameters]. *) + match arg with + | Pair_t (Ticket_t (_, _), Tx_rollup_l2_address_t, _, _) -> + ( ctxt, + ok + @@ (Typed_tx_rollup {arg_ty = arg; tx_rollup} + : arg typed_contract) ) + | _ -> + error ctxt (fun loc -> + Tx_rollup_bad_deposit_parameter (loc, serialize_ty_for_error arg)) + else error ctxt (fun _loc -> No_such_entrypoint entrypoint) + | Zk_rollup zk_rollup -> + Zk_rollup.assert_exist ctxt zk_rollup >|=? fun ctxt -> + if Entrypoint.(is_deposit entrypoint) then + match arg with + | Pair_t (Ticket_t (_, _), Bytes_t, _, _) -> + ( ctxt, + ok + @@ (Typed_zk_rollup {arg_ty = arg; zk_rollup} + : arg typed_contract) ) + | _ -> + error ctxt (fun loc -> + Zk_rollup_bad_deposit_parameter (loc, serialize_ty_for_error arg)) + else error ctxt (fun _loc -> No_such_entrypoint entrypoint) + | Sc_rollup sc_rollup -> + Sc_rollup.parameters_type ctxt sc_rollup + >>=? fun (parameters_type, ctxt) -> + Lwt.return + (match parameters_type with + | None -> + ok + (error ctxt (fun _loc -> + Sc_rollup.Errors.Sc_rollup_does_not_exist sc_rollup)) + | Some parameters_type -> + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + parameters_type + >>? fun (parameters_type, ctxt) -> + parse_parameter_ty_and_entrypoints + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy:true + (root parameters_type) + >>? fun ( Ex_parameter_ty_and_entrypoints + {arg_type = full; entrypoints}, + ctxt ) -> + Gas_monad.run ctxt + @@ find_entrypoint_for_type + ~error_details + ~full + ~expected:arg + entrypoints + entrypoint + >|? fun (entrypoint_arg, ctxt) -> + ( ctxt, + entrypoint_arg >|? fun (entrypoint, arg_ty) -> + Typed_sc_rollup {arg_ty; sc_rollup; entrypoint} )) + +(* Same as [parse_contract], but does not fail when the contact is missing or + if the expected type doesn't match the actual one. In that case None is + returned and some overapproximation of the typechecking gas is consumed. + This can still fail on gas exhaustion. *) +let parse_contract_for_script : + type arg argc. + context -> + Script.location -> + (arg, argc) ty -> + Destination.t -> + entrypoint:Entrypoint.t -> + (context * arg typed_contract option) tzresult Lwt.t = + fun ctxt loc arg destination ~entrypoint -> + parse_contract + ~stack_depth:0 + ctxt + ~error_details:Fast + loc + arg + destination + ~entrypoint + >|=? fun (ctxt, res) -> + ( ctxt, + match res with Ok res -> Some res | Error Inconsistent_types_fast -> None ) + +let view_size view = + let open Script_typed_ir_size in + node_size view.view_code ++ node_size view.input_ty + ++ node_size view.output_ty + +let code_size ctxt code views = + let open Script_typed_ir_size in + let views_size = Script_map.fold (fun _ v s -> view_size v ++ s) views zero in + (* The size of the storage_type and the arg_type is counted by + [lambda_size]. *) + let ir_size = lambda_size code in + let nodes, code_size = views_size ++ ir_size in + (* We consume gas after the fact in order to not have to instrument + [node_size] (for efficiency). + This is safe, as we already pay gas proportional to [views_size] and + [ir_size] during their typechecking. *) + Gas.consume ctxt (Script_typed_ir_size_costs.nodes_cost ~nodes) + >|? fun ctxt -> (code_size, ctxt) + +let parse_code : + elab_conf:elab_conf -> + context -> + code:lazy_expr -> + (ex_code * context) tzresult Lwt.t = + fun ~elab_conf ctxt ~code -> + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + code + >>?= fun (code, ctxt) -> + let legacy = elab_conf.legacy in + Global_constants_storage.expand ctxt code >>=? fun (ctxt, code) -> + parse_toplevel ctxt ~legacy code + >>?= fun ({arg_type; storage_type; code_field; views}, ctxt) -> + let arg_type_loc = location arg_type in + record_trace + (Ill_formed_type (Some "parameter", code, arg_type_loc)) + (parse_parameter_ty_and_entrypoints ctxt ~stack_depth:0 ~legacy arg_type) + >>?= fun (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, ctxt) -> + let storage_type_loc = location storage_type in + record_trace + (Ill_formed_type (Some "storage", code, storage_type_loc)) + (parse_storage_ty ctxt ~stack_depth:0 ~legacy storage_type) + >>?= fun (Ex_ty storage_type, ctxt) -> + pair_t storage_type_loc arg_type storage_type + >>?= fun (Ty_ex_c arg_type_full) -> + pair_t storage_type_loc list_operation_t storage_type + >>?= fun (Ty_ex_c ret_type_full) -> + trace + (Ill_typed_contract (code, [])) + (parse_kdescr + Tc_context.(toplevel ~storage_type ~param_type:arg_type ~entrypoints) + ~elab_conf + ctxt + ~stack_depth:0 + arg_type_full + ret_type_full + code_field) + >>=? fun (kdescr, ctxt) -> + let code = Lam (kdescr, code_field) in + Lwt.return + ( code_size ctxt code views >>? fun (code_size, ctxt) -> + ok + ( Ex_code + (Code {code; arg_type; storage_type; views; entrypoints; code_size}), + ctxt ) ) + +let parse_storage : + elab_conf:elab_conf -> + context -> + allow_forged:bool -> + ('storage, _) ty -> + storage:lazy_expr -> + ('storage * context) tzresult Lwt.t = + fun ~elab_conf ctxt ~allow_forged storage_type ~storage -> + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + storage + >>?= fun (storage, ctxt) -> + trace_eval + (fun () -> + let storage_type = serialize_ty_for_error storage_type in + Ill_typed_data (None, storage, storage_type)) + (parse_data + ~elab_conf + ~stack_depth:0 + ctxt + ~allow_forged + storage_type + (root storage)) + +let parse_script : + elab_conf:elab_conf -> + context -> + allow_forged_in_storage:bool -> + Script.t -> + (ex_script * context) tzresult Lwt.t = + fun ~elab_conf ctxt ~allow_forged_in_storage {code; storage} -> + parse_code ~elab_conf ctxt ~code + >>=? fun ( Ex_code + (Code + {code; arg_type; storage_type; views; entrypoints; code_size}), + ctxt ) -> + parse_storage + ~elab_conf + ctxt + ~allow_forged:allow_forged_in_storage + storage_type + ~storage + >|=? fun (storage, ctxt) -> + ( Ex_script + (Script + {code_size; code; arg_type; storage; storage_type; views; entrypoints}), + ctxt ) + +type typechecked_code_internal = + | Typechecked_code_internal : { + toplevel : toplevel; + arg_type : ('arg, _) ty; + storage_type : ('storage, _) ty; + entrypoints : 'arg entrypoints; + typed_views : 'storage typed_view_map; + type_map : type_map; + } + -> typechecked_code_internal + +let typecheck_code : + legacy:bool -> + show_types:bool -> + context -> + Script.expr -> + (typechecked_code_internal * context) tzresult Lwt.t = + fun ~legacy ~show_types ctxt code -> + (* Constants need to be expanded or [parse_toplevel] may fail. *) + Global_constants_storage.expand ctxt code >>=? fun (ctxt, code) -> + parse_toplevel ctxt ~legacy code >>?= fun (toplevel, ctxt) -> + let {arg_type; storage_type; code_field; views} = toplevel in + let type_map = ref [] in + let arg_type_loc = location arg_type in + record_trace + (Ill_formed_type (Some "parameter", code, arg_type_loc)) + (parse_parameter_ty_and_entrypoints ctxt ~stack_depth:0 ~legacy arg_type) + >>?= fun (Ex_parameter_ty_and_entrypoints {arg_type; entrypoints}, ctxt) -> + let storage_type_loc = location storage_type in + record_trace + (Ill_formed_type (Some "storage", code, storage_type_loc)) + (parse_storage_ty ctxt ~stack_depth:0 ~legacy storage_type) + >>?= fun (ex_storage_type, ctxt) -> + let (Ex_ty storage_type) = ex_storage_type in + pair_t storage_type_loc arg_type storage_type + >>?= fun (Ty_ex_c arg_type_full) -> + pair_t storage_type_loc list_operation_t storage_type + >>?= fun (Ty_ex_c ret_type_full) -> + let type_logger loc ~stack_ty_before ~stack_ty_after = + type_map := (loc, (stack_ty_before, stack_ty_after)) :: !type_map + in + let type_logger = if show_types then Some type_logger else None in + let elab_conf = Script_ir_translator_config.make ~legacy ?type_logger () in + let result = + parse_kdescr + (Tc_context.toplevel ~storage_type ~param_type:arg_type ~entrypoints) + ctxt + ~elab_conf + ~stack_depth:0 + arg_type_full + ret_type_full + code_field + in + trace (Ill_typed_contract (code, !type_map)) result + >>=? fun ((_ : (_, _, _, _) kdescr), ctxt) -> + let views_result = parse_views ctxt ~elab_conf storage_type views in + trace (Ill_typed_contract (code, !type_map)) views_result + >|=? fun (typed_views, ctxt) -> + ( Typechecked_code_internal + { + toplevel; + arg_type; + storage_type; + entrypoints; + typed_views; + type_map = !type_map; + }, + ctxt ) + +(* Uncarbonated because used only in RPCs *) +let list_entrypoints_uncarbonated (type full fullc) (full : (full, fullc) ty) + (entrypoints : full entrypoints) = + let merge path (type t tc) (ty : (t, tc) ty) + (entrypoints : t entrypoints_node) reachable ((unreachables, all) as acc) + = + match entrypoints.at_node with + | None -> + ( (if reachable then acc + else + match ty with + | Union_t _ -> acc + | _ -> (List.rev path :: unreachables, all)), + reachable ) + | Some {name; original_type_expr} -> + ( (if Entrypoint.Map.mem name all then + (List.rev path :: unreachables, all) + else + ( unreachables, + Entrypoint.Map.add name (Ex_ty ty, original_type_expr) all )), + true ) + in + let rec fold_tree : + type t tc. + (t, tc) ty -> + t entrypoints_node -> + prim list -> + bool -> + prim list list * (ex_ty * Script.node) Entrypoint.Map.t -> + prim list list * (ex_ty * Script.node) Entrypoint.Map.t = + fun t entrypoints path reachable acc -> + match (t, entrypoints) with + | Union_t (tl, tr, _, _), {nested = Entrypoints_Union {left; right}; _} -> + let acc, l_reachable = merge (D_Left :: path) tl left reachable acc in + let acc, r_reachable = merge (D_Right :: path) tr right reachable acc in + let acc = fold_tree tl left (D_Left :: path) l_reachable acc in + fold_tree tr right (D_Right :: path) r_reachable acc + | _ -> acc + in + let init, reachable = + match entrypoints.root.at_node with + | None -> (Entrypoint.Map.empty, false) + | Some {name; original_type_expr} -> + (Entrypoint.Map.singleton name (Ex_ty full, original_type_expr), true) + in + fold_tree full entrypoints.root [] reachable ([], init) + +include Data_unparser (struct + let opened_ticket_type = opened_ticket_type + + let parse_packable_ty = parse_packable_ty + + let parse_data = parse_data +end) + +let parse_and_unparse_script_unaccounted ctxt ~legacy ~allow_forged_in_storage + mode ~normalize_types {code; storage} = + Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + code + >>?= fun (code, ctxt) -> + typecheck_code ~legacy ~show_types:false ctxt code + >>=? fun ( Typechecked_code_internal + { + toplevel = + { + code_field; + arg_type = original_arg_type_expr; + storage_type = original_storage_type_expr; + views; + }; + arg_type; + storage_type; + entrypoints; + typed_views; + type_map = _; + }, + ctxt ) -> + parse_storage + ~elab_conf:(Script_ir_translator_config.make ~legacy ()) + ctxt + ~allow_forged:allow_forged_in_storage + storage_type + ~storage + >>=? fun (storage, ctxt) -> + unparse_code ctxt ~stack_depth:0 mode code_field >>=? fun (code, ctxt) -> + unparse_data ctxt ~stack_depth:0 mode storage_type storage + >>=? fun (storage, ctxt) -> + let loc = Micheline.dummy_location in + (if normalize_types then + unparse_parameter_ty ~loc ctxt arg_type ~entrypoints + >>?= fun (arg_type, ctxt) -> + unparse_ty ~loc ctxt storage_type >>?= fun (storage_type, ctxt) -> + Script_map.map_es_in_context + (fun ctxt + _name + (Typed_view {input_ty; output_ty; kinstr = _; original_code_expr}) -> + Lwt.return + ( unparse_ty ~loc ctxt input_ty >>? fun (input_ty, ctxt) -> + unparse_ty ~loc ctxt output_ty >|? fun (output_ty, ctxt) -> + ({input_ty; output_ty; view_code = original_code_expr}, ctxt) )) + ctxt + typed_views + >|=? fun (views, ctxt) -> (arg_type, storage_type, views, ctxt) + else return (original_arg_type_expr, original_storage_type_expr, views, ctxt)) + >>=? fun (arg_type, storage_type, views, ctxt) -> + Script_map.map_es_in_context + (fun ctxt _name {input_ty; output_ty; view_code} -> + unparse_code ctxt ~stack_depth:0 mode view_code + >|=? fun (view_code, ctxt) -> + let view_code = Micheline.root view_code in + ({input_ty; output_ty; view_code}, ctxt)) + ctxt + views + >>=? fun (views, ctxt) -> + let open Micheline in + let unparse_view_unaccounted name {input_ty; output_ty; view_code} views = + Prim + ( loc, + K_view, + [ + String (loc, Script_string.to_string name); + input_ty; + output_ty; + view_code; + ], + [] ) + :: views + in + let views = Script_map.fold unparse_view_unaccounted views [] |> List.rev in + let code = + Seq + ( loc, + [ + Prim (loc, K_parameter, [arg_type], []); + Prim (loc, K_storage, [storage_type], []); + Prim (loc, K_code, [Micheline.root code], []); + ] + @ views ) + in + return + ( {code = lazy_expr (strip_locations code); storage = lazy_expr storage}, + ctxt ) + +let pack_data_with_mode ctxt ty data ~mode = + unparse_data ~stack_depth:0 ctxt mode ty data >|=? fun (unparsed, ctxt) -> + pack_node unparsed ctxt + +let hash_data ctxt ty data = + pack_data_with_mode ctxt ty data ~mode:Optimized_legacy + >>=? fun (bytes, ctxt) -> Lwt.return @@ hash_bytes ctxt bytes + +let pack_data ctxt ty data = + pack_data_with_mode ctxt ty data ~mode:Optimized_legacy + +(* ---------------- Lazy storage---------------------------------------------*) + +type lazy_storage_ids = Lazy_storage.IdSet.t + +let no_lazy_storage_id = Lazy_storage.IdSet.empty + +let diff_of_big_map ctxt mode ~temporary ~ids_to_copy + (Big_map {id; key_type; value_type; diff}) = + (match id with + | Some id -> + if Lazy_storage.IdSet.mem Big_map id ids_to_copy then + Big_map.fresh ~temporary ctxt >|=? fun (ctxt, duplicate) -> + (ctxt, Lazy_storage.Copy {src = id}, duplicate) + else + (* The first occurrence encountered of a big_map reuses the + ID. This way, the payer is only charged for the diff. + For this to work, this diff has to be put at the end of + the global diff, otherwise the duplicates will use the + updated version as a base. This is true because we add + this diff first in the accumulator of + `extract_lazy_storage_updates`, and this accumulator is not + reversed. *) + return (ctxt, Lazy_storage.Existing, id) + | None -> + Big_map.fresh ~temporary ctxt >>=? fun (ctxt, id) -> + Lwt.return + (let kt = unparse_comparable_ty_uncarbonated ~loc:() key_type in + Gas.consume ctxt (Script.strip_locations_cost kt) >>? fun ctxt -> + unparse_ty ~loc:() ctxt value_type >>? fun (kv, ctxt) -> + Gas.consume ctxt (Script.strip_locations_cost kv) >|? fun ctxt -> + let key_type = Micheline.strip_locations kt in + let value_type = Micheline.strip_locations kv in + (ctxt, Lazy_storage.(Alloc Big_map.{key_type; value_type}), id))) + >>=? fun (ctxt, init, id) -> + let pairs = + Big_map_overlay.fold + (fun key_hash (key, value) acc -> (key_hash, key, value) :: acc) + diff.map + [] + in + List.fold_left_es + (fun (acc, ctxt) (key_hash, key, value) -> + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>?= fun ctxt -> + unparse_comparable_data ctxt mode key_type key >>=? fun (key, ctxt) -> + (match value with + | None -> return (None, ctxt) + | Some x -> + unparse_data ~stack_depth:0 ctxt mode value_type x + >|=? fun (node, ctxt) -> (Some node, ctxt)) + >|=? fun (value, ctxt) -> + let diff_item = Big_map.{key; key_hash; value} in + (diff_item :: acc, ctxt)) + ([], ctxt) + (List.rev pairs) + >|=? fun (updates, ctxt) -> (Lazy_storage.Update {init; updates}, id, ctxt) + +let diff_of_sapling_state ctxt ~temporary ~ids_to_copy + ({id; diff; memo_size} : Sapling.state) = + (match id with + | Some id -> + if Lazy_storage.IdSet.mem Sapling_state id ids_to_copy then + Sapling.fresh ~temporary ctxt >|=? fun (ctxt, duplicate) -> + (ctxt, Lazy_storage.Copy {src = id}, duplicate) + else return (ctxt, Lazy_storage.Existing, id) + | None -> + Sapling.fresh ~temporary ctxt >|=? fun (ctxt, id) -> + (ctxt, Lazy_storage.Alloc Sapling.{memo_size}, id)) + >|=? fun (ctxt, init, id) -> + (Lazy_storage.Update {init; updates = diff}, id, ctxt) + +(** + Witness flag for whether a type can be populated by a value containing a + lazy storage. + [False_f] must be used only when a value of the type cannot contain a lazy + storage. + + This flag is built in [has_lazy_storage] and used only in + [extract_lazy_storage_updates] and [collect_lazy_storage]. + + This flag is necessary to avoid these two functions to have a quadratic + complexity in the size of the type. + + Add new lazy storage kinds here. + + Please keep the usage of this GADT local. +*) + +type 'ty has_lazy_storage = + | Big_map_f : ('a, 'b) big_map has_lazy_storage + | Sapling_state_f : Sapling.state has_lazy_storage + | False_f : _ has_lazy_storage + | Pair_f : + 'a has_lazy_storage * 'b has_lazy_storage + -> ('a, 'b) pair has_lazy_storage + | Union_f : + 'a has_lazy_storage * 'b has_lazy_storage + -> ('a, 'b) union has_lazy_storage + | Option_f : 'a has_lazy_storage -> 'a option has_lazy_storage + | List_f : 'a has_lazy_storage -> 'a Script_list.t has_lazy_storage + | Map_f : 'v has_lazy_storage -> (_, 'v) map has_lazy_storage + +(** + This function is called only on storage and parameter types of contracts, + once per typechecked contract. It has a complexity linear in the size of + the types, which happen to be literally written types, so the gas for them + has already been paid. +*) +let rec has_lazy_storage : type t tc. (t, tc) ty -> t has_lazy_storage = + fun ty -> + let aux1 cons t = + match has_lazy_storage t with False_f -> False_f | h -> cons h + in + let aux2 cons t1 t2 = + match (has_lazy_storage t1, has_lazy_storage t2) with + | False_f, False_f -> False_f + | h1, h2 -> cons h1 h2 + in + match ty with + | Big_map_t (_, _, _) -> Big_map_f + | Sapling_state_t _ -> Sapling_state_f + | Unit_t -> False_f + | Int_t -> False_f + | Nat_t -> False_f + | Signature_t -> False_f + | String_t -> False_f + | Bytes_t -> False_f + | Mutez_t -> False_f + | Key_hash_t -> False_f + | Key_t -> False_f + | Timestamp_t -> False_f + | Address_t -> False_f + | Tx_rollup_l2_address_t -> False_f + | Bool_t -> False_f + | Lambda_t (_, _, _) -> False_f + | Set_t (_, _) -> False_f + | Contract_t (_, _) -> False_f + | Operation_t -> False_f + | Chain_id_t -> False_f + | Never_t -> False_f + | Bls12_381_g1_t -> False_f + | Bls12_381_g2_t -> False_f + | Bls12_381_fr_t -> False_f + | Sapling_transaction_t _ -> False_f + | Sapling_transaction_deprecated_t _ -> False_f + | Ticket_t _ -> False_f + | Chest_key_t -> False_f + | Chest_t -> False_f + | Pair_t (l, r, _, _) -> aux2 (fun l r -> Pair_f (l, r)) l r + | Union_t (l, r, _, _) -> aux2 (fun l r -> Union_f (l, r)) l r + | Option_t (t, _, _) -> aux1 (fun h -> Option_f h) t + | List_t (t, _) -> aux1 (fun h -> List_f h) t + | Map_t (_, t, _) -> aux1 (fun h -> Map_f h) t + +(** + Transforms a value potentially containing lazy storage in an intermediary + state to a value containing lazy storage only represented by identifiers. + + Returns the updated value, the updated set of ids to copy, and the lazy + storage diff to show on the receipt and apply on the storage. + +*) +let extract_lazy_storage_updates ctxt mode ~temporary ids_to_copy acc ty x = + let rec aux : + type a ac. + context -> + unparsing_mode -> + temporary:bool -> + Lazy_storage.IdSet.t -> + Lazy_storage.diffs -> + (a, ac) ty -> + a -> + has_lazy_storage:a has_lazy_storage -> + (context * a * Lazy_storage.IdSet.t * Lazy_storage.diffs) tzresult Lwt.t = + fun ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage -> + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>?= fun ctxt -> + match (has_lazy_storage, ty, x) with + | False_f, _, _ -> return (ctxt, x, ids_to_copy, acc) + | Big_map_f, Big_map_t (_, _, _), map -> + diff_of_big_map ctxt mode ~temporary ~ids_to_copy map + >|=? fun (diff, id, ctxt) -> + let map = + let (Big_map map) = map in + Big_map + { + map with + diff = {map = Big_map_overlay.empty; size = 0}; + id = Some id; + } + in + let diff = Lazy_storage.make Big_map id diff in + let ids_to_copy = Lazy_storage.IdSet.add Big_map id ids_to_copy in + (ctxt, map, ids_to_copy, diff :: acc) + | Sapling_state_f, Sapling_state_t _, sapling_state -> + diff_of_sapling_state ctxt ~temporary ~ids_to_copy sapling_state + >|=? fun (diff, id, ctxt) -> + let sapling_state = + Sapling.empty_state ~id ~memo_size:sapling_state.memo_size () + in + let diff = Lazy_storage.make Sapling_state id diff in + let ids_to_copy = Lazy_storage.IdSet.add Sapling_state id ids_to_copy in + (ctxt, sapling_state, ids_to_copy, diff :: acc) + | Pair_f (hl, hr), Pair_t (tyl, tyr, _, _), (xl, xr) -> + aux ctxt mode ~temporary ids_to_copy acc tyl xl ~has_lazy_storage:hl + >>=? fun (ctxt, xl, ids_to_copy, acc) -> + aux ctxt mode ~temporary ids_to_copy acc tyr xr ~has_lazy_storage:hr + >|=? fun (ctxt, xr, ids_to_copy, acc) -> + (ctxt, (xl, xr), ids_to_copy, acc) + | Union_f (has_lazy_storage, _), Union_t (ty, _, _, _), L x -> + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + >|=? fun (ctxt, x, ids_to_copy, acc) -> (ctxt, L x, ids_to_copy, acc) + | Union_f (_, has_lazy_storage), Union_t (_, ty, _, _), R x -> + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + >|=? fun (ctxt, x, ids_to_copy, acc) -> (ctxt, R x, ids_to_copy, acc) + | Option_f has_lazy_storage, Option_t (ty, _, _), Some x -> + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + >|=? fun (ctxt, x, ids_to_copy, acc) -> (ctxt, Some x, ids_to_copy, acc) + | List_f has_lazy_storage, List_t (ty, _), l -> + List.fold_left_es + (fun (ctxt, l, ids_to_copy, acc) x -> + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + >|=? fun (ctxt, x, ids_to_copy, acc) -> + (ctxt, Script_list.cons x l, ids_to_copy, acc)) + (ctxt, Script_list.empty, ids_to_copy, acc) + l.elements + >|=? fun (ctxt, l, ids_to_copy, acc) -> + let reversed = Script_list.rev l in + (ctxt, reversed, ids_to_copy, acc) + | Map_f has_lazy_storage, Map_t (_, ty, _), map -> + let (module M) = Script_map.get_module map in + let bindings m = M.OPS.fold (fun k v bs -> (k, v) :: bs) m [] in + List.fold_left_es + (fun (ctxt, m, ids_to_copy, acc) (k, x) -> + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + >|=? fun (ctxt, x, ids_to_copy, acc) -> + (ctxt, M.OPS.add k x m, ids_to_copy, acc)) + (ctxt, M.OPS.empty, ids_to_copy, acc) + (bindings M.boxed) + >|=? fun (ctxt, m, ids_to_copy, acc) -> + let module M = struct + module OPS = M.OPS + + type key = M.key + + type value = M.value + + let boxed = m + + let size = M.size + end in + ( ctxt, + Script_map.make + (module M : Boxed_map + with type key = M.key + and type value = M.value), + ids_to_copy, + acc ) + | _, Option_t (_, _, _), None -> return (ctxt, None, ids_to_copy, acc) + in + let has_lazy_storage = has_lazy_storage ty in + aux ctxt mode ~temporary ids_to_copy acc ty x ~has_lazy_storage + +(** We namespace an error type for [fold_lazy_storage]. The error case is only + available when the ['error] parameter is equal to unit. *) +module Fold_lazy_storage = struct + type ('acc, 'error) result = + | Ok : 'acc -> ('acc, 'error) result + | Error : ('acc, unit) result +end + +(** Prematurely abort if [f] generates an error. Use this function without the + [unit] type for [error] if you are in a case where errors are impossible. +*) +let rec fold_lazy_storage : + type a ac error. + f:('acc, error) Fold_lazy_storage.result Lazy_storage.IdSet.fold_f -> + init:'acc -> + context -> + (a, ac) ty -> + a -> + has_lazy_storage:a has_lazy_storage -> + (('acc, error) Fold_lazy_storage.result * context) tzresult = + fun ~f ~init ctxt ty x ~has_lazy_storage -> + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>? fun ctxt -> + match (has_lazy_storage, ty, x) with + | Big_map_f, Big_map_t (_, _, _), Big_map {id = Some id; _} -> + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>? fun ctxt -> + ok (f.f Big_map id (Fold_lazy_storage.Ok init), ctxt) + | Sapling_state_f, Sapling_state_t _, {id = Some id; _} -> + Gas.consume ctxt Typecheck_costs.parse_instr_cycle >>? fun ctxt -> + ok (f.f Sapling_state id (Fold_lazy_storage.Ok init), ctxt) + | False_f, _, _ -> ok (Fold_lazy_storage.Ok init, ctxt) + | Big_map_f, Big_map_t (_, _, _), Big_map {id = None; _} -> + ok (Fold_lazy_storage.Ok init, ctxt) + | Sapling_state_f, Sapling_state_t _, {id = None; _} -> + ok (Fold_lazy_storage.Ok init, ctxt) + | Pair_f (hl, hr), Pair_t (tyl, tyr, _, _), (xl, xr) -> ( + fold_lazy_storage ~f ~init ctxt tyl xl ~has_lazy_storage:hl + >>? fun (init, ctxt) -> + match init with + | Fold_lazy_storage.Ok init -> + fold_lazy_storage ~f ~init ctxt tyr xr ~has_lazy_storage:hr + | Fold_lazy_storage.Error -> ok (init, ctxt)) + | Union_f (has_lazy_storage, _), Union_t (ty, _, _, _), L x -> + fold_lazy_storage ~f ~init ctxt ty x ~has_lazy_storage + | Union_f (_, has_lazy_storage), Union_t (_, ty, _, _), R x -> + fold_lazy_storage ~f ~init ctxt ty x ~has_lazy_storage + | _, Option_t (_, _, _), None -> ok (Fold_lazy_storage.Ok init, ctxt) + | Option_f has_lazy_storage, Option_t (ty, _, _), Some x -> + fold_lazy_storage ~f ~init ctxt ty x ~has_lazy_storage + | List_f has_lazy_storage, List_t (ty, _), l -> + List.fold_left_e + (fun ((init, ctxt) : ('acc, error) Fold_lazy_storage.result * context) x -> + match init with + | Fold_lazy_storage.Ok init -> + fold_lazy_storage ~f ~init ctxt ty x ~has_lazy_storage + | Fold_lazy_storage.Error -> ok (init, ctxt)) + (Fold_lazy_storage.Ok init, ctxt) + l.elements + | Map_f has_lazy_storage, Map_t (_, ty, _), m -> + Script_map.fold + (fun _ + v + (acc : (('acc, error) Fold_lazy_storage.result * context) tzresult) -> + acc >>? fun (init, ctxt) -> + match init with + | Fold_lazy_storage.Ok init -> + fold_lazy_storage ~f ~init ctxt ty v ~has_lazy_storage + | Fold_lazy_storage.Error -> ok (init, ctxt)) + m + (ok (Fold_lazy_storage.Ok init, ctxt)) + +let collect_lazy_storage ctxt ty x = + let has_lazy_storage = has_lazy_storage ty in + let f kind id (acc : (_, never) Fold_lazy_storage.result) = + let acc = match acc with Fold_lazy_storage.Ok acc -> acc in + Fold_lazy_storage.Ok (Lazy_storage.IdSet.add kind id acc) + in + fold_lazy_storage ~f:{f} ~init:no_lazy_storage_id ctxt ty x ~has_lazy_storage + >>? fun (ids, ctxt) -> + match ids with Fold_lazy_storage.Ok ids -> ok (ids, ctxt) + +let extract_lazy_storage_diff ctxt mode ~temporary ~to_duplicate ~to_update ty v + = + (* + Basically [to_duplicate] are ids from the argument and [to_update] are ids + from the storage before execution (i.e. it is safe to reuse them since they + will be owned by the same contract). + *) + let to_duplicate = Lazy_storage.IdSet.diff to_duplicate to_update in + extract_lazy_storage_updates ctxt mode ~temporary to_duplicate [] ty v + >|=? fun (ctxt, v, alive, diffs) -> + let diffs = + if temporary then diffs + else + let dead = Lazy_storage.IdSet.diff to_update alive in + Lazy_storage.IdSet.fold_all + {f = (fun kind id acc -> Lazy_storage.make kind id Remove :: acc)} + dead + diffs + in + match diffs with + | [] -> (v, None, ctxt) + | diffs -> (v, Some diffs (* do not reverse *), ctxt) + +let list_of_big_map_ids ids = + Lazy_storage.IdSet.fold Big_map (fun id acc -> id :: acc) ids [] + +let parse_data = parse_data ~stack_depth:0 + +let parse_comparable_data ?type_logger = + parse_data + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ?type_logger ()) + ~allow_forged:false + +let parse_instr : + type a s. + elab_conf:elab_conf -> + tc_context -> + context -> + Script.node -> + (a, s) stack_ty -> + ((a, s) judgement * context) tzresult Lwt.t = + fun ~elab_conf tc_context ctxt script_instr stack_ty -> + parse_instr ~elab_conf ~stack_depth:0 tc_context ctxt script_instr stack_ty + +let unparse_data = unparse_data ~stack_depth:0 + +let unparse_code ctxt mode code = + (* Constants need to be expanded or [unparse_code] may fail. *) + Global_constants_storage.expand ctxt (strip_locations code) + >>=? fun (ctxt, code) -> unparse_code ~stack_depth:0 ctxt mode (root code) + +let parse_contract_data context loc arg_ty contract ~entrypoint = + parse_contract_data ~stack_depth:0 context loc arg_ty contract ~entrypoint + +let parse_toplevel ctxt ~legacy toplevel = + Global_constants_storage.expand ctxt toplevel >>=? fun (ctxt, toplevel) -> + Lwt.return @@ parse_toplevel ctxt ~legacy toplevel + +let parse_comparable_ty = parse_comparable_ty ~stack_depth:0 + +let parse_big_map_value_ty = parse_big_map_value_ty ~stack_depth:0 + +let parse_packable_ty = parse_packable_ty ~stack_depth:0 + +let parse_passable_ty = parse_passable_ty ~stack_depth:0 + +let parse_any_ty = parse_any_ty ~stack_depth:0 + +let parse_ty = parse_ty ~stack_depth:0 ~ret:Don't_parse_entrypoints + +let parse_parameter_ty_and_entrypoints = + parse_parameter_ty_and_entrypoints ~stack_depth:0 + +let get_single_sapling_state ctxt ty x = + let has_lazy_storage = has_lazy_storage ty in + let f (type i a u) (kind : (i, a, u) Lazy_storage.Kind.t) (id : i) + single_id_opt : (Sapling.Id.t option, unit) Fold_lazy_storage.result = + match kind with + | Lazy_storage.Kind.Sapling_state -> ( + match single_id_opt with + | Fold_lazy_storage.Ok None -> Fold_lazy_storage.Ok (Some id) + | Fold_lazy_storage.Ok (Some _) -> + Fold_lazy_storage.Error (* more than one *) + | Fold_lazy_storage.Error -> single_id_opt) + | _ -> single_id_opt + in + fold_lazy_storage ~f:{f} ~init:None ctxt ty x ~has_lazy_storage + >>? fun (id, ctxt) -> + match id with + | Fold_lazy_storage.Ok (Some id) -> ok (Some id, ctxt) + | Fold_lazy_storage.Ok None | Fold_lazy_storage.Error -> ok (None, ctxt) + +(* + + {!Script_cache} needs a measure of the script size in memory. + Determining this size is not easy in OCaml because of sharing. + + Indeed, many values present in the script share the same memory + area. This is especially true for types and stack types: they are + heavily shared in every typed IR internal representation. As a + consequence, computing the size of the typed IR without taking + sharing into account leads to a size which is sometimes two order + of magnitude bigger than the actual size. + + We could track down this sharing. Unfortunately, sharing is not + part of OCaml semantics: for this reason, a compiler can optimize + memory representation by adding more sharing. If two nodes use + different optimization flags or compilers, such a precise + computation of the memory footprint of scripts would lead to two + distinct sizes. As these sizes occur in the blockchain context, + this situation would lead to a fork. + + For this reason, we introduce a *size model* for the script size. + This model provides an overapproximation of the actual size in + memory. The risk is to be too far from the actual size: the cache + would then be wrongly marked as full. This situation would make the + cache less useful but should present no security risk . + +*) +let script_size + (Ex_script + (Script + { + code_size; + code = _; + arg_type = _; + storage; + storage_type; + entrypoints = _; + views = _; + })) = + let nodes, storage_size = + Script_typed_ir_size.value_size storage_type storage + in + let cost = Script_typed_ir_size_costs.nodes_cost ~nodes in + (Saturation_repr.(add code_size storage_size |> to_int), cost) + +let typecheck_code ~legacy ~show_types ctxt code = + typecheck_code ~legacy ~show_types ctxt code + >|=? fun (Typechecked_code_internal {type_map; _}, ctxt) -> (type_map, ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.mli b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.mli new file mode 100644 index 000000000000..dd9af56c6fdc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator.mli @@ -0,0 +1,464 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Overview: + + This mli is organized into roughly three parts: + + 1. A set of new types prefixed with "ex_" + Michelson is encoded in a GADT that preserves certain properties about its + type system. If you haven't read about GADT's, check out the relevant section + in the Tezos docs: + https://tezos.gitlab.io/developer/gadt.html#generalized-algebraic-data-types-gadts + + The idea is that type representing a Michelson type, ['a ty], is parameterized + by a type 'a. But that 'a can't be just _any_ type; it must be valid according + to the definition of ['a ty]. Thus, if I give you a value of type ['a ty], + all you know is that "there exists some 'a such that 'a ty exists". You must be + careful not to accidentally quantify 'a universally, that is "for all 'a, + 'a ty exists", otherwise you'll get an annoying error about 'a trying to escape + it's scope. We do this by hiding 'a in an existential type. This is what + ex_comparable_ty, ex_ty, ex_stack_ty, etc. do. + + 2. A set of functions dealing with high-level Michelson types: + This module also provides functions for interacting with the list, map, + set, and big_map Michelson types. + + 3. A set of functions for parsing and typechecking Michelson. + Finally, and what you likely came for, the module provides many functions prefixed + with "parse_" that convert untyped Micheline (which is essentially S-expressions + with a few primitive atom types) into the GADT encoding well-typed Michelson. Likewise + there is a number of functions prefixed "unparse_" that do the reverse. These functions + consume gas, and thus are parameterized by an [Alpha_context.t]. + + The variety of functions reflects the variety of things one might want to parse, + from [parse_data] for arbitrary Micheline expressions to [parse_contract_data] for + well-formed Michelson contracts. +*) + +(** {1 Michelson Existential Witness types} *) +open Alpha_context + +open Script_typed_ir +open Script_tc_errors + +type ('ta, 'tb) eq = Eq : ('same, 'same) eq + +type ex_comparable_ty = + | Ex_comparable_ty : 'a Script_typed_ir.comparable_ty -> ex_comparable_ty + +type ex_parameter_ty_and_entrypoints = + | Ex_parameter_ty_and_entrypoints : { + arg_type : ('a, _) Script_typed_ir.ty; + entrypoints : 'a Script_typed_ir.entrypoints; + } + -> ex_parameter_ty_and_entrypoints + +type ex_stack_ty = + | Ex_stack_ty : ('a, 's) Script_typed_ir.stack_ty -> ex_stack_ty + +type ex_script = Ex_script : ('a, 'b) Script_typed_ir.script -> ex_script + +type toplevel = { + code_field : Script.node; + arg_type : Script.node; + storage_type : Script.node; + views : Script_typed_ir.view_map; +} + +type ('arg, 'storage) code = + | Code : { + code : + ( ('arg, 'storage) Script_typed_ir.pair, + ( Script_typed_ir.operation Script_list.t, + 'storage ) + Script_typed_ir.pair ) + Script_typed_ir.lambda; + arg_type : ('arg, _) Script_typed_ir.ty; + storage_type : ('storage, _) Script_typed_ir.ty; + views : Script_typed_ir.view_map; + entrypoints : 'arg Script_typed_ir.entrypoints; + code_size : Cache_memory_helpers.sint; + (** This is an over-approximation of the value size in memory, in + bytes, of the contract's static part, that is its source + code. This includes the code of the contract as well as the code + of the views. The storage size is not taken into account by this + field as it has a dynamic size. *) + } + -> ('arg, 'storage) code + +type ex_code = Ex_code : ('a, 'c) code -> ex_code + +type 'storage typed_view = + | Typed_view : { + input_ty : ('input, _) Script_typed_ir.ty; + output_ty : ('output, _) Script_typed_ir.ty; + kinstr : + ( 'input * 'storage, + Script_typed_ir.end_of_stack, + 'output, + Script_typed_ir.end_of_stack ) + Script_typed_ir.kinstr; + original_code_expr : Script.node; + } + -> 'storage typed_view + +type 'storage typed_view_map = + (Script_string.t, 'storage typed_view) Script_typed_ir.map + +type ('a, 's, 'b, 'u) cinstr = { + apply : + 'r 'f. + ('b, 'u, 'r, 'f) Script_typed_ir.kinstr -> + ('a, 's, 'r, 'f) Script_typed_ir.kinstr; +} +[@@ocaml.unboxed] + +type ('a, 's, 'b, 'u) descr = { + loc : Script.location; + bef : ('a, 's) Script_typed_ir.stack_ty; + aft : ('b, 'u) Script_typed_ir.stack_ty; + instr : ('a, 's, 'b, 'u) cinstr; +} + +type tc_context = Script_tc_context.t + +type ('a, 's) judgement = + | Typed : ('a, 's, 'b, 'u) descr -> ('a, 's) judgement + | Failed : { + descr : 'b 'u. ('b, 'u) Script_typed_ir.stack_ty -> ('a, 's, 'b, 'u) descr; + } + -> ('a, 's) judgement + +val close_descr : + ('a, 'b, 'c, 'd) descr -> ('a, 'b, 'c, 'd) Script_typed_ir.kdescr + +(* ---- Lists, Sets and Maps ----------------------------------------------- *) + +(** {2 High-level Michelson Data Types} *) +val ty_eq : + error_details:(Script.location, 'error_trace) error_details -> + ('a, 'ac) Script_typed_ir.ty -> + ('b, 'bc) Script_typed_ir.ty -> + ( (('a, 'ac) Script_typed_ir.ty, ('b, 'bc) Script_typed_ir.ty) eq, + 'error_trace ) + Gas_monad.t + +(** {3 Parsing and Typechecking Michelson} *) +val parse_comparable_data : + ?type_logger:Script_ir_translator_config.type_logger -> + context -> + 'a Script_typed_ir.comparable_ty -> + Script.node -> + ('a * context) tzresult Lwt.t + +(* Parsing a Micheline node data into an IR-typed data. *) +val parse_data : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + allow_forged:bool -> + ('a, _) Script_typed_ir.ty -> + Script.node -> + ('a * context) tzresult Lwt.t + +(* Unparsing an IR-typed data back into a Micheline node data *) +val unparse_data : + context -> + Script_ir_unparser.unparsing_mode -> + ('a, _) Script_typed_ir.ty -> + 'a -> + (Script.expr * context) tzresult Lwt.t + +val unparse_code : + context -> + Script_ir_unparser.unparsing_mode -> + Script.node -> + (Script.expr * context) tzresult Lwt.t + +(** For benchmarking purpose, we also export versions of the unparsing + functions which don't call location stripping. These functions are + not carbonated and should not be called directly from the protocol. *) +module Internal_for_benchmarking : sig + val unparse_data : + context -> + stack_depth:int -> + Script_ir_unparser.unparsing_mode -> + ('a, 'ac) ty -> + 'a -> + (Script.node * context) tzresult Lwt.t + + val unparse_code : + context -> + stack_depth:int -> + Script_ir_unparser.unparsing_mode -> + Script.node -> + (Script.node * context) tzresult Lwt.t +end + +val parse_instr : + elab_conf:Script_ir_translator_config.elab_config -> + tc_context -> + context -> + Script.node -> + ('a, 's) Script_typed_ir.stack_ty -> + (('a, 's) judgement * context) tzresult Lwt.t + +(** + [parse_ty] specialized for the right-hand side part of a big map type, i.e. + the `value` in `big_map key value`. +*) +val parse_big_map_value_ty : + context -> legacy:bool -> Script.node -> (ex_ty * context) tzresult + +val parse_packable_ty : + context -> legacy:bool -> Script.node -> (ex_ty * context) tzresult + +val parse_passable_ty : + context -> legacy:bool -> Script.node -> (ex_ty * context) tzresult + +val parse_comparable_ty : + context -> Script.node -> (ex_comparable_ty * context) tzresult + +val parse_parameter_ty_and_entrypoints : + context -> + legacy:bool -> + Script.node -> + (ex_parameter_ty_and_entrypoints * context) tzresult + +val parse_view_input_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult + +val parse_view_output_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult + +val parse_view : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + ('storage, _) Script_typed_ir.ty -> + Script_typed_ir.view -> + ('storage typed_view * context) tzresult Lwt.t + +val parse_views : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + ('storage, _) Script_typed_ir.ty -> + Script_typed_ir.view_map -> + ('storage typed_view_map * context) tzresult Lwt.t + +(** + [parse_ty] allowing big_map values, operations, contract and tickets. +*) +val parse_any_ty : + context -> legacy:bool -> Script.node -> (ex_ty * context) tzresult + +(** We expose [parse_ty] for convenience to external tools. Please use + specialized versions such as [parse_packable_ty], [parse_passable_ty], + [parse_comparable_ty], or [parse_big_map_value_ty] if possible. *) +val parse_ty : + context -> + legacy:bool -> + allow_lazy_storage:bool -> + allow_operation:bool -> + allow_contract:bool -> + allow_ticket:bool -> + Script.node -> + (ex_ty * context) tzresult + +val parse_toplevel : + context -> legacy:bool -> Script.expr -> (toplevel * context) tzresult Lwt.t + +(** High-level function to typecheck a Michelson script. This function is not + used for validating operations but only for the [typecheck_code] RPC. + + If [show_types] is set to [true], details of the typechecking are returned + in the [type_map], otherwise the returned [type_map] is empty. *) +val typecheck_code : + legacy:bool -> + show_types:bool -> + context -> + Script.expr -> + (type_map * context) tzresult Lwt.t + +val parse_code : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + code:Script.lazy_expr -> + (ex_code * context) tzresult Lwt.t + +val parse_storage : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + allow_forged:bool -> + ('storage, _) Script_typed_ir.ty -> + storage:Script.lazy_expr -> + ('storage * context) tzresult Lwt.t + +(** Combines [parse_code] and [parse_storage] *) +val parse_script : + elab_conf:Script_ir_translator_config.elab_config -> + context -> + allow_forged_in_storage:bool -> + Script.t -> + (ex_script * context) tzresult Lwt.t + +(* Gas accounting may not be perfect in this function, as it is only called by RPCs. *) +val parse_and_unparse_script_unaccounted : + context -> + legacy:bool -> + allow_forged_in_storage:bool -> + Script_ir_unparser.unparsing_mode -> + normalize_types:bool -> + Script.t -> + (Script.t * context) tzresult Lwt.t + +val parse_contract_data : + context -> + Script.location -> + ('a, _) Script_typed_ir.ty -> + Destination.t -> + entrypoint:Entrypoint.t -> + (context * 'a Script_typed_ir.typed_contract) tzresult Lwt.t + +val parse_contract_for_script : + context -> + Script.location -> + ('a, _) Script_typed_ir.ty -> + Destination.t -> + entrypoint:Entrypoint.t -> + (context * 'a Script_typed_ir.typed_contract option) tzresult Lwt.t + +(** ['a ex_ty_cstr] is like [ex_ty], but also adds to the existential a function + used to reconstruct a value of type ['a] from the internal type of the + existential. Typically, it will be used to go from the type of an + entry-point to the full type of a contract. *) +type 'a ex_ty_cstr = + | Ex_ty_cstr : { + ty : ('b, _) Script_typed_ir.ty; + construct : 'b -> 'a; + original_type_expr : Script.node; + } + -> 'a ex_ty_cstr + +val find_entrypoint : + error_details:(_, 'error_trace) error_details -> + ('t, _) Script_typed_ir.ty -> + 't Script_typed_ir.entrypoints -> + Entrypoint.t -> + ('t ex_ty_cstr, 'error_trace) Gas_monad.t + +val list_entrypoints_uncarbonated : + ('t, _) Script_typed_ir.ty -> + 't Script_typed_ir.entrypoints -> + Michelson_v1_primitives.prim list list + * (ex_ty * Script.node) Entrypoint.Map.t + +val pack_data : + context -> + ('a, _) Script_typed_ir.ty -> + 'a -> + (bytes * context) tzresult Lwt.t + +val hash_comparable_data : + context -> + 'a Script_typed_ir.comparable_ty -> + 'a -> + (Script_expr_hash.t * context) tzresult Lwt.t + +val hash_data : + context -> + ('a, _) Script_typed_ir.ty -> + 'a -> + (Script_expr_hash.t * context) tzresult Lwt.t + +type lazy_storage_ids + +val no_lazy_storage_id : lazy_storage_ids + +(** Traverse the given type, producing a {!lazy_storage_ids} for + use with {!extract_lazy_storage_diff}. + *) +val collect_lazy_storage : + context -> + ('a, _) Script_typed_ir.ty -> + 'a -> + (lazy_storage_ids * context) tzresult + +val list_of_big_map_ids : lazy_storage_ids -> Big_map.Id.t list + +(** Produce a lazy storage diff, containing in-memory writes to + lazy data structures such as big_maps yet to be committed. + + The resulting diff can be committed to the underlying storage + (context) using [Lazy_storage_diff.apply]. + + @param to_duplicate + Lazy data structure reference produced via {!collect_lazy_storage} + that can not be reused. Typically collected via traversing + the parameters to a smart contract. + @param to_update + Lazy data structure reference produced via {!collect_lazy_storage} + that can be reused. Typically collected via traversing the previous + storage of a smart contract. + *) +val extract_lazy_storage_diff : + context -> + Script_ir_unparser.unparsing_mode -> + temporary:bool -> + to_duplicate:lazy_storage_ids -> + to_update:lazy_storage_ids -> + ('a, _) Script_typed_ir.ty -> + 'a -> + ('a * Lazy_storage.diffs option * context) tzresult Lwt.t + +(* return [None] if none or more than one found *) +val get_single_sapling_state : + context -> + ('a, _) Script_typed_ir.ty -> + 'a -> + (Sapling.Id.t option * context) tzresult + +(** [code_size ctxt code views] returns an overapproximation of the size of + the in-memory representation of [code] and [views] in bytes in the + context [ctxt]. *) +val code_size : + context -> + ('a, 'b) Script_typed_ir.lambda -> + Script_typed_ir.view_map -> + (Cache_memory_helpers.sint * context) tzresult + +(** [script_size script] returns an overapproximation of the size of + the in-memory representation of [script] in bytes as well as the cost + associated to computing that overapproximation. *) +val script_size : ex_script -> int * Gas_limit_repr.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_translator_config.ml b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator_config.ml new file mode 100644 index 000000000000..a8c535735b08 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_translator_config.ml @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** [type_logger] is a function, whose task is to log how a stack's type + is altered by some operation being logged. *) +type type_logger = + Script.location -> + stack_ty_before:Script.expr list -> + stack_ty_after:Script.expr list -> + unit + +(** LEGACY MODE is the feature of the Translator and Interpreter which + allows us to distinguish between scripts already originated on chain + and new ones. + + The reason to treat those types of scripts differently is the evolving + nature of Michelson, which sometimes requires disabling features + available in previous versions. These features must be supported at all + times for already originated contracts, but we still want to disable + them at least for new contracts. + + This distinction gives us a handy deprecation mechanism, which + allows us to make sure that from a certain point on no more + contract will be originated using these deprecated features. When + that point time is reached, it becomes possible to patch existing + contracts so that they no longer use the feature and remove it + entirely. + + As a side effect, legacy mode can also be used to skip checks that + have already been performed and hence are guaranteed to pass.*) + +(** [elab_config] is a record grouping together some flags and options + shared by many of the functions in [Script_ir_translator]. It's + convenient to group them together, because they're of similar + types ([bool] or ['a option]), so they're easier not to mix together. + It also makes for shorter and more readable function calls. *) +type elab_config = { + type_logger : type_logger option; + (** A function responsible for logging stack types during typechecking. + Used especially in plugins for editors and IDEs. *) + keep_extra_types_for_interpreter_logging : bool; + (** If set to [true], it instructs the elaborator to retain some + additional type information necessary for logging. This should + never be enabled during validation to save memory occupied by + cached contracts. + + NOTE: if this option wasn't passed to the elaborator and the + interpreter was still called with logging enabled, it might + result in a crash. This cannot be helped at the moment, but since + logging is never enabled during validation, we should be safe. *) + legacy : bool; (** If set to true, it enables the legacy mode (see above). *) +} + +(** [make ?type_logger ?logging_enabled ~legacy ()] creates an [elab_config] + record to be passed to parsing functions in [Script_ir_translator]. + + Note: [?logging_enabled] defaults to [false], because it only ever should + be set to [true] if the Translator is called from outside the protocol + (i.e. from the Plugin). *) +let make : + ?type_logger:type_logger -> + ?keep_extra_types_for_interpreter_logging:bool -> + legacy:bool -> + unit -> + elab_config = + fun ?type_logger ?(keep_extra_types_for_interpreter_logging = false) ~legacy () -> + {type_logger; keep_extra_types_for_interpreter_logging; legacy} diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.ml b/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.ml new file mode 100644 index 000000000000..6315ff10db35 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.ml @@ -0,0 +1,777 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Micheline +open Script_typed_ir +open Michelson_v1_primitives +module Unparse_costs = Michelson_v1_gas.Cost_of.Unparsing + +type unparsing_mode = Optimized | Readable | Optimized_legacy + +(* This part contains the unparsing that does not depend on parsing + (everything that cannot contain a lambda). The rest is located at + the end of the file. *) + +let unparse_memo_size ~loc memo_size = + let z = Sapling.Memo_size.unparse_to_z memo_size in + Int (loc, z) + +let rec unparse_ty_and_entrypoints_uncarbonated : + type a ac loc. + loc:loc -> (a, ac) ty -> a entrypoints_node -> loc Script.michelson_node = + fun ~loc ty {nested = nested_entrypoints; at_node} -> + let name, args = + match ty with + | Unit_t -> (T_unit, []) + | Int_t -> (T_int, []) + | Nat_t -> (T_nat, []) + | Signature_t -> (T_signature, []) + | String_t -> (T_string, []) + | Bytes_t -> (T_bytes, []) + | Mutez_t -> (T_mutez, []) + | Bool_t -> (T_bool, []) + | Key_hash_t -> (T_key_hash, []) + | Key_t -> (T_key, []) + | Timestamp_t -> (T_timestamp, []) + | Address_t -> (T_address, []) + | Tx_rollup_l2_address_t -> (T_tx_rollup_l2_address, []) + | Operation_t -> (T_operation, []) + | Chain_id_t -> (T_chain_id, []) + | Never_t -> (T_never, []) + | Bls12_381_g1_t -> (T_bls12_381_g1, []) + | Bls12_381_g2_t -> (T_bls12_381_g2, []) + | Bls12_381_fr_t -> (T_bls12_381_fr, []) + | Contract_t (ut, _meta) -> + let t = + unparse_ty_and_entrypoints_uncarbonated ~loc ut no_entrypoints + in + (T_contract, [t]) + | Pair_t (utl, utr, _meta, _) -> ( + let tl = + unparse_ty_and_entrypoints_uncarbonated ~loc utl no_entrypoints + in + let tr = + unparse_ty_and_entrypoints_uncarbonated ~loc utr no_entrypoints + in + (* Fold [pair a1 (pair ... (pair an-1 an))] into [pair a1 ... an] *) + (* Note that the folding does not happen if the pair on the right has an + annotation because this annotation would be lost *) + match tr with + | Prim (_, T_pair, ts, []) -> (T_pair, tl :: ts) + | _ -> (T_pair, [tl; tr])) + | Union_t (utl, utr, _meta, _) -> + let entrypoints_l, entrypoints_r = + match nested_entrypoints with + | Entrypoints_None -> (no_entrypoints, no_entrypoints) + | Entrypoints_Union {left; right} -> (left, right) + in + let tl = + unparse_ty_and_entrypoints_uncarbonated ~loc utl entrypoints_l + in + let tr = + unparse_ty_and_entrypoints_uncarbonated ~loc utr entrypoints_r + in + (T_or, [tl; tr]) + | Lambda_t (uta, utr, _meta) -> + let ta = + unparse_ty_and_entrypoints_uncarbonated ~loc uta no_entrypoints + in + let tr = + unparse_ty_and_entrypoints_uncarbonated ~loc utr no_entrypoints + in + (T_lambda, [ta; tr]) + | Option_t (ut, _meta, _) -> + let ut = + unparse_ty_and_entrypoints_uncarbonated ~loc ut no_entrypoints + in + (T_option, [ut]) + | List_t (ut, _meta) -> + let t = + unparse_ty_and_entrypoints_uncarbonated ~loc ut no_entrypoints + in + (T_list, [t]) + | Ticket_t (ut, _meta) -> + let t = unparse_comparable_ty_uncarbonated ~loc ut in + (T_ticket, [t]) + | Set_t (ut, _meta) -> + let t = unparse_comparable_ty_uncarbonated ~loc ut in + (T_set, [t]) + | Map_t (uta, utr, _meta) -> + let ta = unparse_comparable_ty_uncarbonated ~loc uta in + let tr = + unparse_ty_and_entrypoints_uncarbonated ~loc utr no_entrypoints + in + (T_map, [ta; tr]) + | Big_map_t (uta, utr, _meta) -> + let ta = unparse_comparable_ty_uncarbonated ~loc uta in + let tr = + unparse_ty_and_entrypoints_uncarbonated ~loc utr no_entrypoints + in + (T_big_map, [ta; tr]) + | Sapling_transaction_t memo_size -> + (T_sapling_transaction, [unparse_memo_size ~loc memo_size]) + | Sapling_transaction_deprecated_t memo_size -> + (T_sapling_transaction_deprecated, [unparse_memo_size ~loc memo_size]) + | Sapling_state_t memo_size -> + (T_sapling_state, [unparse_memo_size ~loc memo_size]) + | Chest_key_t -> (T_chest_key, []) + | Chest_t -> (T_chest, []) + in + let annot = + match at_node with + | None -> [] + | Some {name; original_type_expr = _} -> + [Entrypoint.unparse_as_field_annot name] + in + Prim (loc, name, args, annot) + +and unparse_comparable_ty_uncarbonated : + type a loc. loc:loc -> a comparable_ty -> loc Script.michelson_node = + fun ~loc ty -> unparse_ty_and_entrypoints_uncarbonated ~loc ty no_entrypoints + +let unparse_ty_uncarbonated ~loc ty = + unparse_ty_and_entrypoints_uncarbonated ~loc ty no_entrypoints + +let unparse_ty ~loc ctxt ty = + Gas.consume ctxt (Unparse_costs.unparse_type ty) >|? fun ctxt -> + (unparse_ty_uncarbonated ~loc ty, ctxt) + +let unparse_parameter_ty ~loc ctxt ty ~entrypoints = + Gas.consume ctxt (Unparse_costs.unparse_type ty) >|? fun ctxt -> + (unparse_ty_and_entrypoints_uncarbonated ~loc ty entrypoints.root, ctxt) + +let serialize_ty_for_error ty = + (* + Types are bounded by [Constants.michelson_maximum_type_size], so + [unparse_ty_uncarbonated] and [strip_locations] are bounded in time. + + It is hence OK to use them in errors that are not caught in the validation + (only once in apply). + *) + unparse_ty_uncarbonated ~loc:() ty |> Micheline.strip_locations + +let rec unparse_stack_uncarbonated : + type a s. (a, s) stack_ty -> Script.expr list = function + | Bot_t -> [] + | Item_t (ty, rest) -> + let uty = unparse_ty_uncarbonated ~loc:() ty in + let urest = unparse_stack_uncarbonated rest in + strip_locations uty :: urest + +let serialize_stack_for_error ctxt stack_ty = + match Gas.level ctxt with + | Unaccounted -> unparse_stack_uncarbonated stack_ty + | Limited _ -> [] + +let unparse_unit ~loc ctxt () = ok (Prim (loc, D_Unit, [], []), ctxt) + +let unparse_int ~loc ctxt v = ok (Int (loc, Script_int.to_zint v), ctxt) + +let unparse_nat ~loc ctxt v = ok (Int (loc, Script_int.to_zint v), ctxt) + +let unparse_string ~loc ctxt s = + ok (String (loc, Script_string.to_string s), ctxt) + +let unparse_bytes ~loc ctxt s = ok (Bytes (loc, s), ctxt) + +let unparse_bool ~loc ctxt b = + ok (Prim (loc, (if b then D_True else D_False), [], []), ctxt) + +let unparse_timestamp ~loc ctxt mode t = + match mode with + | Optimized | Optimized_legacy -> + ok (Int (loc, Script_timestamp.to_zint t), ctxt) + | Readable -> ( + Gas.consume ctxt Unparse_costs.timestamp_readable >>? fun ctxt -> + match Script_timestamp.to_notation t with + | None -> ok (Int (loc, Script_timestamp.to_zint t), ctxt) + | Some s -> ok (String (loc, s), ctxt)) + +let unparse_address ~loc ctxt mode {destination; entrypoint} = + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.contract_optimized >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn + Data_encoding.(tup2 Destination.encoding Entrypoint.value_encoding) + (destination, entrypoint) + in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.contract_readable >|? fun ctxt -> + let notation = + Destination.to_b58check destination + ^ Entrypoint.to_address_suffix entrypoint + in + (String (loc, notation), ctxt) + +let unparse_tx_rollup_l2_address ~loc ctxt mode + (tx_address : tx_rollup_l2_address) = + let tx_address = Indexable.to_value tx_address in + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.contract_optimized >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_l2_address.encoding + tx_address + in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.contract_readable >|? fun ctxt -> + let b58check = Tx_rollup_l2_address.to_b58check tx_address in + (String (loc, b58check), ctxt) + +let unparse_contract ~loc ctxt mode typed_contract = + let destination = Typed_contract.destination typed_contract in + let entrypoint = Typed_contract.entrypoint typed_contract in + let address = {destination; entrypoint} in + unparse_address ~loc ctxt mode address + +let unparse_signature ~loc ctxt mode s = + let s = Script_signature.get s in + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.signature_optimized >|? fun ctxt -> + let bytes = Data_encoding.Binary.to_bytes_exn Signature.encoding s in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.signature_readable >|? fun ctxt -> + (String (loc, Signature.to_b58check s), ctxt) + +let unparse_mutez ~loc ctxt v = ok (Int (loc, Z.of_int64 (Tez.to_mutez v)), ctxt) + +let unparse_key ~loc ctxt mode k = + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.public_key_optimized >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn Signature.Public_key.encoding k + in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.public_key_readable >|? fun ctxt -> + (String (loc, Signature.Public_key.to_b58check k), ctxt) + +let unparse_key_hash ~loc ctxt mode k = + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.key_hash_optimized >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn Signature.Public_key_hash.encoding k + in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.key_hash_readable >|? fun ctxt -> + (String (loc, Signature.Public_key_hash.to_b58check k), ctxt) + +(* Operations are only unparsed during the production of execution traces of + the interpreter. *) +let unparse_operation ~loc ctxt {piop; lazy_storage_diff = _} = + let iop = Apply_internal_results.packed_internal_operation piop in + let bytes = + Data_encoding.Binary.to_bytes_exn + Apply_internal_results.internal_operation_encoding + iop + in + Gas.consume ctxt (Unparse_costs.operation bytes) >|? fun ctxt -> + (Bytes (loc, bytes), ctxt) + +let unparse_chain_id ~loc ctxt mode chain_id = + match mode with + | Optimized | Optimized_legacy -> + Gas.consume ctxt Unparse_costs.chain_id_optimized >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn Script_chain_id.encoding chain_id + in + (Bytes (loc, bytes), ctxt) + | Readable -> + Gas.consume ctxt Unparse_costs.chain_id_readable >|? fun ctxt -> + (String (loc, Script_chain_id.to_b58check chain_id), ctxt) + +let unparse_bls12_381_g1 ~loc ctxt x = + Gas.consume ctxt Unparse_costs.bls12_381_g1 >|? fun ctxt -> + let bytes = Script_bls.G1.to_bytes x in + (Bytes (loc, bytes), ctxt) + +let unparse_bls12_381_g2 ~loc ctxt x = + Gas.consume ctxt Unparse_costs.bls12_381_g2 >|? fun ctxt -> + let bytes = Script_bls.G2.to_bytes x in + (Bytes (loc, bytes), ctxt) + +let unparse_bls12_381_fr ~loc ctxt x = + Gas.consume ctxt Unparse_costs.bls12_381_fr >|? fun ctxt -> + let bytes = Script_bls.Fr.to_bytes x in + (Bytes (loc, bytes), ctxt) + +let unparse_with_data_encoding ~loc ctxt s unparse_cost encoding = + Lwt.return + ( Gas.consume ctxt unparse_cost >|? fun ctxt -> + let bytes = Data_encoding.Binary.to_bytes_exn encoding s in + (Bytes (loc, bytes), ctxt) ) + +(* -- Unparsing data of complex types -- *) + +type ('ty, 'depth) comb_witness = + | Comb_Pair : ('t, 'd) comb_witness -> (_ * 't, unit -> 'd) comb_witness + | Comb_Any : (_, _) comb_witness + +let unparse_pair (type r) ~loc unparse_l unparse_r ctxt mode + (r_comb_witness : (r, unit -> unit -> _) comb_witness) (l, (r : r)) = + unparse_l ctxt l >>=? fun (l, ctxt) -> + unparse_r ctxt r >|=? fun (r, ctxt) -> + (* Fold combs. + For combs, three notations are supported: + - a) [Pair x1 (Pair x2 ... (Pair xn-1 xn) ...)], + - b) [Pair x1 x2 ... xn-1 xn], and + - c) [{x1; x2; ...; xn-1; xn}]. + In readable mode, we always use b), + in optimized mode we use the shortest to serialize: + - for n=2, [Pair x1 x2], + - for n=3, [Pair x1 (Pair x2 x3)], + - for n>=4, [{x1; x2; ...; xn}]. + *) + let res = + match (mode, r_comb_witness, r) with + | Optimized, Comb_Pair _, Micheline.Seq (_, r) -> + (* Optimized case n > 4 *) + Micheline.Seq (loc, l :: r) + | ( Optimized, + Comb_Pair (Comb_Pair _), + Prim (_, D_Pair, [x2; Prim (_, D_Pair, [x3; x4], [])], []) ) -> + (* Optimized case n = 4 *) + Micheline.Seq (loc, [l; x2; x3; x4]) + | Readable, Comb_Pair _, Prim (_, D_Pair, xs, []) -> + (* Readable case n > 2 *) + Prim (loc, D_Pair, l :: xs, []) + | _ -> + (* The remaining cases are: + - Optimized n = 2, + - Optimized n = 3, and + - Readable n = 2, + - Optimized_legacy, any n *) + Prim (loc, D_Pair, [l; r], []) + in + (res, ctxt) + +let unparse_union ~loc unparse_l unparse_r ctxt = function + | L l -> + unparse_l ctxt l >|=? fun (l, ctxt) -> (Prim (loc, D_Left, [l], []), ctxt) + | R r -> + unparse_r ctxt r >|=? fun (r, ctxt) -> (Prim (loc, D_Right, [r], []), ctxt) + +let unparse_option ~loc unparse_v ctxt = function + | Some v -> + unparse_v ctxt v >|=? fun (v, ctxt) -> (Prim (loc, D_Some, [v], []), ctxt) + | None -> return (Prim (loc, D_None, [], []), ctxt) + +(* -- Unparsing data of comparable types -- *) + +let comb_witness2 : + type t tc. (t, tc) ty -> (t, unit -> unit -> unit) comb_witness = function + | Pair_t (_, Pair_t _, _, _) -> Comb_Pair (Comb_Pair Comb_Any) + | Pair_t _ -> Comb_Pair Comb_Any + | _ -> Comb_Any + +let rec unparse_comparable_data_rec : + type a loc. + loc:loc -> + context -> + unparsing_mode -> + a comparable_ty -> + a -> + (loc Script.michelson_node * context) tzresult Lwt.t = + fun ~loc ctxt mode ty a -> + (* No need for stack_depth here. Unlike [unparse_data], + [unparse_comparable_data] doesn't call [unparse_code]. + The stack depth is bounded by the type depth, currently bounded + by 1000 (michelson_maximum_type_size). *) + Gas.consume ctxt Unparse_costs.unparse_data_cycle + (* We could have a smaller cost but let's keep it consistent with + [unparse_data] for now. *) + >>?= + fun ctxt -> + match (ty, a) with + | Unit_t, v -> Lwt.return @@ unparse_unit ~loc ctxt v + | Int_t, v -> Lwt.return @@ unparse_int ~loc ctxt v + | Nat_t, v -> Lwt.return @@ unparse_nat ~loc ctxt v + | String_t, s -> Lwt.return @@ unparse_string ~loc ctxt s + | Bytes_t, s -> Lwt.return @@ unparse_bytes ~loc ctxt s + | Bool_t, b -> Lwt.return @@ unparse_bool ~loc ctxt b + | Timestamp_t, t -> Lwt.return @@ unparse_timestamp ~loc ctxt mode t + | Address_t, address -> Lwt.return @@ unparse_address ~loc ctxt mode address + | Tx_rollup_l2_address_t, address -> + Lwt.return @@ unparse_tx_rollup_l2_address ~loc ctxt mode address + | Signature_t, s -> Lwt.return @@ unparse_signature ~loc ctxt mode s + | Mutez_t, v -> Lwt.return @@ unparse_mutez ~loc ctxt v + | Key_t, k -> Lwt.return @@ unparse_key ~loc ctxt mode k + | Key_hash_t, k -> Lwt.return @@ unparse_key_hash ~loc ctxt mode k + | Chain_id_t, chain_id -> + Lwt.return @@ unparse_chain_id ~loc ctxt mode chain_id + | Pair_t (tl, tr, _, YesYes), pair -> + let r_witness = comb_witness2 tr in + let unparse_l ctxt v = unparse_comparable_data_rec ~loc ctxt mode tl v in + let unparse_r ctxt v = unparse_comparable_data_rec ~loc ctxt mode tr v in + unparse_pair ~loc unparse_l unparse_r ctxt mode r_witness pair + | Union_t (tl, tr, _, YesYes), v -> + let unparse_l ctxt v = unparse_comparable_data_rec ~loc ctxt mode tl v in + let unparse_r ctxt v = unparse_comparable_data_rec ~loc ctxt mode tr v in + unparse_union ~loc unparse_l unparse_r ctxt v + | Option_t (t, _, Yes), v -> + let unparse_v ctxt v = unparse_comparable_data_rec ~loc ctxt mode t v in + unparse_option ~loc unparse_v ctxt v + | Never_t, _ -> . + +let account_for_future_serialization_cost unparsed_data ctxt = + Gas.consume ctxt (Script.strip_locations_cost unparsed_data) >>? fun ctxt -> + let unparsed_data = Micheline.strip_locations unparsed_data in + Gas.consume ctxt (Script.micheline_serialization_cost unparsed_data) + >|? fun ctxt -> (unparsed_data, ctxt) + +(* -- Unparsing data of any type -- *) + +module type MICHELSON_PARSER = sig + val opened_ticket_type : + Script.location -> + 'a comparable_ty -> + (address, ('a, Script_int.n Script_int.num) pair) pair comparable_ty + tzresult + + val parse_packable_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult + + val parse_data : + elab_conf:Script_ir_translator_config.elab_config -> + stack_depth:int -> + context -> + allow_forged:bool -> + ('a, 'ac) ty -> + Script.node -> + ('a * t) tzresult Lwt.t +end + +module Data_unparser (P : MICHELSON_PARSER) = struct + open Script_tc_errors + + let rec unparse_data_rec : + type a ac. + context -> + stack_depth:int -> + unparsing_mode -> + (a, ac) ty -> + a -> + (Script.node * context) tzresult Lwt.t = + fun ctxt ~stack_depth mode ty a -> + Gas.consume ctxt Unparse_costs.unparse_data_cycle >>?= fun ctxt -> + let non_terminal_recursion ctxt mode ty a = + if Compare.Int.(stack_depth > 10_000) then + tzfail Script_tc_errors.Unparsing_too_many_recursive_calls + else unparse_data_rec ctxt ~stack_depth:(stack_depth + 1) mode ty a + in + let loc = Micheline.dummy_location in + match (ty, a) with + | Unit_t, v -> Lwt.return @@ unparse_unit ~loc ctxt v + | Int_t, v -> Lwt.return @@ unparse_int ~loc ctxt v + | Nat_t, v -> Lwt.return @@ unparse_nat ~loc ctxt v + | String_t, s -> Lwt.return @@ unparse_string ~loc ctxt s + | Bytes_t, s -> Lwt.return @@ unparse_bytes ~loc ctxt s + | Bool_t, b -> Lwt.return @@ unparse_bool ~loc ctxt b + | Timestamp_t, t -> Lwt.return @@ unparse_timestamp ~loc ctxt mode t + | Address_t, address -> Lwt.return @@ unparse_address ~loc ctxt mode address + | Tx_rollup_l2_address_t, address -> + Lwt.return @@ unparse_tx_rollup_l2_address ~loc ctxt mode address + | Contract_t _, contract -> + Lwt.return @@ unparse_contract ~loc ctxt mode contract + | Signature_t, s -> Lwt.return @@ unparse_signature ~loc ctxt mode s + | Mutez_t, v -> Lwt.return @@ unparse_mutez ~loc ctxt v + | Key_t, k -> Lwt.return @@ unparse_key ~loc ctxt mode k + | Key_hash_t, k -> Lwt.return @@ unparse_key_hash ~loc ctxt mode k + | Operation_t, operation -> + Lwt.return @@ unparse_operation ~loc ctxt operation + | Chain_id_t, chain_id -> + Lwt.return @@ unparse_chain_id ~loc ctxt mode chain_id + | Bls12_381_g1_t, x -> Lwt.return @@ unparse_bls12_381_g1 ~loc ctxt x + | Bls12_381_g2_t, x -> Lwt.return @@ unparse_bls12_381_g2 ~loc ctxt x + | Bls12_381_fr_t, x -> Lwt.return @@ unparse_bls12_381_fr ~loc ctxt x + | Pair_t (tl, tr, _, _), pair -> + let r_witness = comb_witness2 tr in + let unparse_l ctxt v = non_terminal_recursion ctxt mode tl v in + let unparse_r ctxt v = non_terminal_recursion ctxt mode tr v in + unparse_pair ~loc unparse_l unparse_r ctxt mode r_witness pair + | Union_t (tl, tr, _, _), v -> + let unparse_l ctxt v = non_terminal_recursion ctxt mode tl v in + let unparse_r ctxt v = non_terminal_recursion ctxt mode tr v in + unparse_union ~loc unparse_l unparse_r ctxt v + | Option_t (t, _, _), v -> + let unparse_v ctxt v = non_terminal_recursion ctxt mode t v in + unparse_option ~loc unparse_v ctxt v + | List_t (t, _), items -> + List.fold_left_es + (fun (l, ctxt) element -> + non_terminal_recursion ctxt mode t element + >|=? fun (unparsed, ctxt) -> (unparsed :: l, ctxt)) + ([], ctxt) + items.elements + >|=? fun (items, ctxt) -> (Micheline.Seq (loc, List.rev items), ctxt) + | Ticket_t (t, _), {ticketer; contents; amount} -> + (* ideally we would like to allow a little overhead here because it is only used for unparsing *) + P.opened_ticket_type loc t >>?= fun t -> + let destination : Destination.t = Contract ticketer in + let addr = {destination; entrypoint = Entrypoint.default} in + (unparse_data_rec [@tailcall]) + ctxt + ~stack_depth + mode + t + (addr, (contents, (amount :> Script_int.n Script_int.num))) + | Set_t (t, _), set -> + List.fold_left_es + (fun (l, ctxt) item -> + unparse_comparable_data_rec ~loc ctxt mode t item + >|=? fun (item, ctxt) -> (item :: l, ctxt)) + ([], ctxt) + (Script_set.fold (fun e acc -> e :: acc) set []) + >|=? fun (items, ctxt) -> (Micheline.Seq (loc, items), ctxt) + | Map_t (kt, vt, _), map -> + let items = Script_map.fold (fun k v acc -> (k, v) :: acc) map [] in + unparse_items_rec ctxt ~stack_depth:(stack_depth + 1) mode kt vt items + >|=? fun (items, ctxt) -> (Micheline.Seq (loc, items), ctxt) + | Big_map_t (_kt, _vt, _), Big_map {id = Some id; diff = {size; _}; _} + when Compare.Int.( = ) size 0 -> + return (Micheline.Int (loc, Big_map.Id.unparse_to_z id), ctxt) + | Big_map_t (kt, vt, _), Big_map {id = Some id; diff = {map; _}; _} -> + let items = + Big_map_overlay.fold (fun _ (k, v) acc -> (k, v) :: acc) map [] + in + let items = + (* Sort the items in Michelson comparison order and not in key + hash order. This code path is only exercised for tracing, + so we don't bother carbonating this sort operation + precisely. Also, the sort uses a reverse compare because + [unparse_items] will reverse the result. *) + List.sort + (fun (a, _) (b, _) -> Script_comparable.compare_comparable kt b a) + items + in + (* this can't fail if the original type is well-formed + because [option vt] is always strictly smaller than [big_map kt vt] *) + option_t loc vt >>?= fun vt -> + unparse_items_rec ctxt ~stack_depth:(stack_depth + 1) mode kt vt items + >|=? fun (items, ctxt) -> + ( Micheline.Prim + ( loc, + D_Pair, + [Int (loc, Big_map.Id.unparse_to_z id); Seq (loc, items)], + [] ), + ctxt ) + | Big_map_t (kt, vt, _), Big_map {id = None; diff = {map; _}; _} -> + let items = + Big_map_overlay.fold + (fun _ (k, v) acc -> + match v with None -> acc | Some v -> (k, v) :: acc) + map + [] + in + let items = + (* See note above. *) + List.sort + (fun (a, _) (b, _) -> Script_comparable.compare_comparable kt b a) + items + in + unparse_items_rec ctxt ~stack_depth:(stack_depth + 1) mode kt vt items + >|=? fun (items, ctxt) -> (Micheline.Seq (loc, items), ctxt) + | Lambda_t _, Lam (_, original_code) -> + unparse_code_rec ctxt ~stack_depth:(stack_depth + 1) mode original_code + | Lambda_t _, LamRec (_, original_code) -> + unparse_code_rec ctxt ~stack_depth:(stack_depth + 1) mode original_code + >|=? fun (body, ctxt) -> + (Micheline.Prim (loc, D_Lambda_rec, [body], []), ctxt) + | Never_t, _ -> . + | Sapling_transaction_t _, s -> + Lwt.return + ( Gas.consume ctxt (Unparse_costs.sapling_transaction s) + >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn Sapling.transaction_encoding s + in + (Bytes (loc, bytes), ctxt) ) + | Sapling_transaction_deprecated_t _, s -> + Lwt.return + ( Gas.consume ctxt (Unparse_costs.sapling_transaction_deprecated s) + >|? fun ctxt -> + let bytes = + Data_encoding.Binary.to_bytes_exn + Sapling.Legacy.transaction_encoding + s + in + (Bytes (loc, bytes), ctxt) ) + | Sapling_state_t _, {id; diff; _} -> + Lwt.return + ( Gas.consume ctxt (Unparse_costs.sapling_diff diff) >|? fun ctxt -> + ( (match diff with + | {commitments_and_ciphertexts = []; nullifiers = []} -> ( + match id with + | None -> Micheline.Seq (loc, []) + | Some id -> + let id = Sapling.Id.unparse_to_z id in + Micheline.Int (loc, id)) + | diff -> ( + let diff_bytes = + Data_encoding.Binary.to_bytes_exn Sapling.diff_encoding diff + in + let unparsed_diff = Bytes (loc, diff_bytes) in + match id with + | None -> unparsed_diff + | Some id -> + let id = Sapling.Id.unparse_to_z id in + Micheline.Prim + (loc, D_Pair, [Int (loc, id); unparsed_diff], []))), + ctxt ) ) + | Chest_key_t, s -> + unparse_with_data_encoding + ~loc + ctxt + s + Unparse_costs.chest_key + Script_timelock.chest_key_encoding + | Chest_t, s -> + unparse_with_data_encoding + ~loc + ctxt + s + (Unparse_costs.chest + ~plaintext_size:(Script_timelock.get_plaintext_size s)) + Script_timelock.chest_encoding + + and unparse_items_rec : + type k v vc. + context -> + stack_depth:int -> + unparsing_mode -> + k comparable_ty -> + (v, vc) ty -> + (k * v) list -> + (Script.node list * context) tzresult Lwt.t = + fun ctxt ~stack_depth mode kt vt items -> + List.fold_left_es + (fun (l, ctxt) (k, v) -> + let loc = Micheline.dummy_location in + unparse_comparable_data_rec ~loc ctxt mode kt k >>=? fun (key, ctxt) -> + unparse_data_rec ctxt ~stack_depth:(stack_depth + 1) mode vt v + >|=? fun (value, ctxt) -> + (Prim (loc, D_Elt, [key; value], []) :: l, ctxt)) + ([], ctxt) + items + + and unparse_code_rec ctxt ~stack_depth mode code = + let elab_conf = Script_ir_translator_config.make ~legacy:true () in + Gas.consume ctxt Unparse_costs.unparse_instr_cycle >>?= fun ctxt -> + let non_terminal_recursion ctxt mode code = + if Compare.Int.(stack_depth > 10_000) then + tzfail Unparsing_too_many_recursive_calls + else unparse_code_rec ctxt ~stack_depth:(stack_depth + 1) mode code + in + match code with + | Prim (loc, I_PUSH, [ty; data], annot) -> + P.parse_packable_ty + ctxt + ~stack_depth:(stack_depth + 1) + ~legacy:elab_conf.legacy + ty + >>?= fun (Ex_ty t, ctxt) -> + let allow_forged = + false + (* Forgeable in PUSH data are already forbidden at parsing, + the only case for which this matters is storing a lambda resulting + from APPLYing a non-forgeable but this cannot happen either as long + as all packable values are also forgeable. *) + in + P.parse_data + ~elab_conf + ctxt + ~stack_depth:(stack_depth + 1) + ~allow_forged + t + data + >>=? fun (data, ctxt) -> + unparse_data_rec ctxt ~stack_depth:(stack_depth + 1) mode t data + >>=? fun (data, ctxt) -> + return (Prim (loc, I_PUSH, [ty; data], annot), ctxt) + | Seq (loc, items) -> + List.fold_left_es + (fun (l, ctxt) item -> + non_terminal_recursion ctxt mode item >|=? fun (item, ctxt) -> + (item :: l, ctxt)) + ([], ctxt) + items + >>=? fun (items, ctxt) -> + return (Micheline.Seq (loc, List.rev items), ctxt) + | Prim (loc, prim, items, annot) -> + List.fold_left_es + (fun (l, ctxt) item -> + non_terminal_recursion ctxt mode item >|=? fun (item, ctxt) -> + (item :: l, ctxt)) + ([], ctxt) + items + >>=? fun (items, ctxt) -> + return (Prim (loc, prim, List.rev items, annot), ctxt) + | (Int _ | String _ | Bytes _) as atom -> return (atom, ctxt) + + let unparse_data ctxt ~stack_depth mode ty v = + unparse_data_rec ctxt ~stack_depth mode ty v + >>=? fun (unparsed_data, ctxt) -> + Lwt.return (account_for_future_serialization_cost unparsed_data ctxt) + + let unparse_code ctxt ~stack_depth mode v = + unparse_code_rec ctxt ~stack_depth mode v >>=? fun (unparsed_data, ctxt) -> + Lwt.return (account_for_future_serialization_cost unparsed_data ctxt) + + let unparse_items ctxt ~stack_depth mode ty vty vs = + unparse_items_rec ctxt ~stack_depth mode ty vty vs + >>=? fun (unparsed_datas, ctxt) -> + List.fold_left_e + (fun (acc, ctxt) unparsed_data -> + account_for_future_serialization_cost unparsed_data ctxt + >|? fun (unparsed_data, ctxt) -> (unparsed_data :: acc, ctxt)) + ([], ctxt) + unparsed_datas + >>?= fun (unparsed_datas, ctxt) -> return (List.rev unparsed_datas, ctxt) + + module Internal_for_benchmarking = struct + let unparse_data = unparse_data_rec + + let unparse_code = unparse_code_rec + end +end + +let unparse_comparable_data ctxt mode ty v = + unparse_comparable_data_rec ctxt ~loc:() mode ty v + >>=? fun (unparsed_data, ctxt) -> + Lwt.return (account_for_future_serialization_cost unparsed_data ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.mli b/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.mli new file mode 100644 index 000000000000..908fd7cdeaf0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_ir_unparser.mli @@ -0,0 +1,228 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_typed_ir + +(** Flag that drives unparsing of typed values to nodes. + - [Optimized_legacy] must be kept backward-compatible in order to compute + valid hashes (of big map keys). + - [Optimized] may be used as long as the result can be read by {!Script_translator.parse_data}. + - [Readable] produces with [string] values instead of [bytes] when feasible. +*) +type unparsing_mode = Optimized | Readable | Optimized_legacy + +(** [('t, 'd) comb_witness] describes types of values belonging to a [comb] + of type ['t] and size ['d]. *) +type ('ty, 'depth) comb_witness = + | Comb_Pair : ('t, 'd) comb_witness -> (_ * 't, unit -> 'd) comb_witness + | Comb_Any : (_, _) comb_witness + +(** [serialize_ty_for_error ty] returns the Micheline representation of [ty] + suitable for rendering in an error message. Does not consume gas, since + when this function is called, the operation must have already failed. *) +val serialize_ty_for_error : ('a, 'b) ty -> Script.expr + +(** [serialize_stack_for_error ctxt stack_ty] returns a Micheline representation of + [stack_ty] as a list of Micheline expressions ONLY IF gas is unlimited + in [ctxt]. Otherwise returns an empty list. *) +val serialize_stack_for_error : context -> ('a, 'b) stack_ty -> Script.expr list + +(** [unparse_ty ~loc ctxt ty] returns the Micheline representation of a given + type and an update context, where gas has been properly consumed. *) +val unparse_ty : + loc:'loc -> + context -> + ('b, 'c) ty -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_comparable_ty_uncarbonated ~loc ty] returns the Michelson + representation of comparable type [ty] without consuming gas. *) +val unparse_comparable_ty_uncarbonated : + loc:'loc -> 'a comparable_ty -> 'loc Script.michelson_node + +(** [unparse_stack_uncarbonated stack_ty] returns the Micheline representation + of [stack_ty]. Does not consume gas. *) +val unparse_stack_uncarbonated : ('a, 's) stack_ty -> Script.expr list + +(** [unparse_parameter_ty ~loc ctxt ty ~entrypoints] is a specialised version of + [unparse_ty], which also analyses [entrypoints] in order to annotate + the returned type with adequate annotations. *) +val unparse_parameter_ty : + loc:'loc -> + context -> + ('a, 'c) ty -> + entrypoints:'a entrypoints -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_bls12_381_g1 ~loc ctxt bls] returns the Micheline representation + of [bls] and consumes gas from [ctxt]. *) +val unparse_bls12_381_g1 : + loc:'loc -> + context -> + Script_bls.G1.t -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_bls12_381_g1 ~loc ctxt bls] returns the Micheline representation + of [bls] and consumes gas from [ctxt]. *) +val unparse_bls12_381_g2 : + loc:'loc -> + context -> + Script_bls.G2.t -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_bls12_381_g1 ~loc ctxt bls] returns the Micheline representation + of [bls] and consumes gas from [ctxt]. *) +val unparse_bls12_381_fr : + loc:'loc -> + context -> + Script_bls.Fr.t -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_operation ~loc ctxt op] returns the Micheline representation of + [op] and consumes gas from [ctxt]. Useful only for producing execution + traces in the interpreter. *) +val unparse_operation : + loc:'loc -> + context -> + Script_typed_ir.operation -> + ('loc Script.michelson_node * context, error trace) result + +(** [unparse_with_data_encoding ~loc ctxt v gas_cost enc] returns the bytes + representation of [v] wrapped in [Micheline.Bytes], consuming [gas_cost] + from [ctxt]. *) +val unparse_with_data_encoding : + loc:'loc -> + context -> + 'a -> + Gas.cost -> + 'a Data_encoding.t -> + ('loc Script.michelson_node * context, error trace) result Lwt.t + +(** [unparse_comparable_data ctxt unparsing_mode ty v] returns the + Micheline representation of [v] of type [ty], consuming gas from + [ctxt]. *) +val unparse_comparable_data : + context -> + unparsing_mode -> + 'a comparable_ty -> + 'a -> + (Script.expr * context) tzresult Lwt.t + +(** [unparse_contract ~loc ctxt unparsin_mode contract] returns a Micheline + representation of a given contract in a given [unparsing_mode]. Consumes + gas [ctxt]. *) +val unparse_contract : + loc:'loc -> + context -> + unparsing_mode -> + 'b typed_contract -> + ('loc Script.michelson_node * context, error trace) result + +(** [MICHESLON_PARSER] signature describes a set of dependencies required to + unparse arbitrary values in the IR. Because some of those values contain + just a Michelson code that does not need to be parsed immediately, + unparsing them requires extracting information from that code – that's + why we depend on the parser here. *) +module type MICHELSON_PARSER = sig + val opened_ticket_type : + Script.location -> + 'a comparable_ty -> + (address, ('a, Script_int.n Script_int.num) pair) pair comparable_ty + tzresult + + val parse_packable_ty : + context -> + stack_depth:int -> + legacy:bool -> + Script.node -> + (ex_ty * context) tzresult + + val parse_data : + elab_conf:Script_ir_translator_config.elab_config -> + stack_depth:int -> + context -> + allow_forged:bool -> + ('a, 'ac) ty -> + Script.node -> + ('a * t) tzresult Lwt.t +end + +module Data_unparser : functor (P : MICHELSON_PARSER) -> sig + (** [unparse_data ctxt ~stack_depth unparsing_mode ty data] returns the + Micheline representation of [data] of type [ty], consuming an appropriate + amount of gas from [ctxt]. *) + val unparse_data : + context -> + stack_depth:int -> + unparsing_mode -> + ('a, 'ac) ty -> + 'a -> + (Script.expr * context) tzresult Lwt.t + + (** [unparse_items ctxt ~stack_depth unparsing_mode kty vty assoc] returns the + Micheline representation of [assoc] (being an association list) with keys + of type [kty] and values of type [vty]. Gas is being consumed from + [ctxt]. *) + val unparse_items : + context -> + stack_depth:int -> + unparsing_mode -> + 'k comparable_ty -> + ('v, 'vc) ty -> + ('k * 'v) list -> + (Script.expr list * context) tzresult Lwt.t + + (** [unparse_code ctxt ~stack_depth unparsing_mode code] returns [code] + with [I_PUSH] instructions parsed and unparsed back to make sure that + only forgeable values are being pushed. The gas is being consumed from + [ctxt]. *) + val unparse_code : + context -> + stack_depth:int -> + unparsing_mode -> + Script.node -> + (Script.expr * context, error trace) result Lwt.t + + (** For benchmarking purpose, we also export versions of the unparsing + functions which don't call location stripping. These functions are + not carbonated and should not be called directly from the protocol. *) + module Internal_for_benchmarking : sig + val unparse_data : + context -> + stack_depth:int -> + unparsing_mode -> + ('a, 'ac) ty -> + 'a -> + (Script.node * context) tzresult Lwt.t + + val unparse_code : + context -> + stack_depth:int -> + unparsing_mode -> + Script.node -> + (Script.node * context) tzresult Lwt.t + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_list.ml b/src/proto_016_PtMumbai/lib_protocol/script_list.ml new file mode 100644 index 000000000000..66d97bdbffbc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_list.ml @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type 'elt t = {elements : 'elt list; length : int} + +let of_list l = {elements = l; length = List.length l} [@@inline always] + +let to_list {elements; length = _} = elements [@@inline always] + +let empty : 'a t = {elements = []; length = 0} + +let cons : 'a -> 'a t -> 'a t = + fun elt l -> {length = 1 + l.length; elements = elt :: l.elements} + +let length {elements = _; length} = length [@@inline always] + +let uncons = function + | {elements = []; length = _} -> None + | {elements = hd :: tl; length} -> + Some (hd, {elements = tl; length = length - 1}) + +let rev {elements; length} = {elements = List.rev elements; length} + [@@inline always] diff --git a/src/proto_016_PtMumbai/lib_protocol/script_list.mli b/src/proto_016_PtMumbai/lib_protocol/script_list.mli new file mode 100644 index 000000000000..dbd19d6467c0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_list.mli @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type 'elt t = private {elements : 'elt list; length : int} + +(** Convert an OCaml list into Michelson list. *) +val of_list : 'a list -> 'a t + +(** Convert a Michelson list to an OCaml list. *) +val to_list : 'a t -> 'a list + +(** [length l] returns the number of elements in [l] as [int]. *) +val length : 'a t -> int + +(** Empty list. *) +val empty : 'a t + +(** Prepend an element. *) +val cons : 'a -> 'a t -> 'a t + +(** [uncons l] returns [Some (hd, tl)] where [hd :: tl = l] if [l] is + not empty or [None] otherwise. *) +val uncons : 'a t -> ('a * 'a t) option + +(** [rev l] returns a list containing all elements of [l] in reversed order. *) +val rev : 'a t -> 'a t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_map.ml b/src/proto_016_PtMumbai/lib_protocol/script_map.ml new file mode 100644 index 000000000000..5e7dcf3b44da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_map.ml @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_typed_ir + +let make x = Map_tag x + +let get_module (Map_tag x) = x + +let empty_from : type a b c. (a, b) map -> (a, c) map = + fun (Map_tag (module Box)) -> + Map_tag + (module struct + type key = a + + type value = c + + module OPS = Box.OPS + + let boxed = OPS.empty + + let size = 0 + end) + +let empty : type a b. a comparable_ty -> (a, b) map = + fun ty -> + let module OPS = struct + let key_size = Gas_comparable_input_size.size_of_comparable_value ty + + include Map.Make (struct + type t = a + + let compare = Script_comparable.compare_comparable ty + end) + end in + Map_tag + (module struct + type key = a + + type value = b + + module OPS = OPS + + let boxed = OPS.empty + + let size = 0 + end) + +let get : type key value. key -> (key, value) map -> value option = + fun k (Map_tag (module Box)) -> Box.OPS.find k Box.boxed + +let update : type a b. a -> b option -> (a, b) map -> (a, b) map = + fun k v (Map_tag (module Box)) -> + let boxed, size = + let contains = + match Box.OPS.find k Box.boxed with None -> false | _ -> true + in + match v with + | Some v -> (Box.OPS.add k v Box.boxed, Box.size + if contains then 0 else 1) + | None -> (Box.OPS.remove k Box.boxed, Box.size - if contains then 1 else 0) + in + Map_tag + (module struct + type key = a + + type value = b + + module OPS = Box.OPS + + let boxed = boxed + + let size = size + end) + +let mem : type key value. key -> (key, value) map -> bool = + fun k (Map_tag (module Box)) -> + match Box.OPS.find k Box.boxed with None -> false | _ -> true + +let fold : + type key value acc. + (key -> value -> acc -> acc) -> (key, value) map -> acc -> acc = + fun f (Map_tag (module Box)) -> Box.OPS.fold f Box.boxed + +let fold_es : + type key value acc. + (key -> value -> acc -> acc tzresult Lwt.t) -> + (key, value) map -> + acc -> + acc tzresult Lwt.t = + fun f (Map_tag (module Box)) -> Box.OPS.fold_es f Box.boxed + +let size : type key value. (key, value) map -> Script_int.n Script_int.num = + fun (Map_tag (module Box)) -> Script_int.(abs (of_int Box.size)) + +let map_es_in_context : + type context key value value'. + (context -> key -> value -> (value' * context) tzresult Lwt.t) -> + context -> + (key, value) map -> + ((key, value') map * context) tzresult Lwt.t = + fun f ctxt (Map_tag (module Box)) -> + Box.OPS.fold_es + (fun key value (map, ctxt) -> + f ctxt key value >|=? fun (value, ctxt) -> + (Box.OPS.add key value map, ctxt)) + Box.boxed + (Box.OPS.empty, ctxt) + >|=? fun (map, ctxt) -> + ( Map_tag + (module struct + type key = Box.key + + type value = value' + + module OPS = Box.OPS + + let boxed = map + + let size = Box.size + end), + ctxt ) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_map.mli b/src/proto_016_PtMumbai/lib_protocol/script_map.mli new file mode 100644 index 000000000000..23fab2b979b6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_map.mli @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Functions to ease the manipulation of Michelson maps. + + A map in Michelson is a type-homegeneous, partial function of keys to + values, along with the functions that operate on the structure (through a + first-class module). +*) + +open Script_typed_ir + +val make : + (module Boxed_map with type key = 'key and type value = 'value) -> + ('key, 'value) map + +val get_module : + ('key, 'value) map -> + (module Boxed_map with type key = 'key and type value = 'value) + +(** [empty cmp_ty] creates a map module where keys have size + [Gas_comparable_input_size.size_of_comparable_value cmp_ty] and are compared + with [Script_comparable.compare_comparable cmp_ty] (used for sorting keys, + which ensures a reasonable complexity of the map functions). + The function returns an empty map packaged as a first-class map module. *) +val empty : 'a comparable_ty -> ('a, 'b) map + +(** [empty_from map] creates an empty map module where the size of keys and the + comparison function are those of [map]. *) +val empty_from : ('a, 'b) map -> ('a, 'c) map + +val fold : + ('key -> 'value -> 'acc -> 'acc) -> ('key, 'value) map -> 'acc -> 'acc + +val fold_es : + ('key -> 'value -> 'acc -> 'acc tzresult Lwt.t) -> + ('key, 'value) map -> + 'acc -> + 'acc tzresult Lwt.t + +(** [update k (Some v) map] associates [v] to [k] in [map] (overwriting the + previous value, if any), and [update k None map] removes the potential + association to [k] in [map]. *) +val update : 'a -> 'b option -> ('a, 'b) map -> ('a, 'b) map + +val mem : 'key -> ('key, 'value) map -> bool + +val get : 'key -> ('key, 'value) map -> 'value option + +val size : ('a, 'b) map -> Script_int.n Script_int.num + +val map_es_in_context : + ('context -> 'key -> 'value1 -> ('value2 * 'context) tzresult Lwt.t) -> + 'context -> + ('key, 'value1) map -> + (('key, 'value2) map * 'context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_repr.ml b/src/proto_016_PtMumbai/lib_protocol/script_repr.ml new file mode 100644 index 000000000000..7c5aca4c7893 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_repr.ml @@ -0,0 +1,352 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type location = Micheline.canonical_location + +let location_encoding = Micheline.canonical_location_encoding + +type annot = Micheline.annot + +type expr = Michelson_v1_primitives.prim Micheline.canonical + +type lazy_expr = expr Data_encoding.lazy_t + +type 'location michelson_node = + ('location, Michelson_v1_primitives.prim) Micheline.node + +type node = location michelson_node + +let expr_encoding = + Micheline.canonical_encoding + ~variant:"michelson_v1" + Michelson_v1_primitives.prim_encoding + +type error += Lazy_script_decode (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"invalid_binary_format" + ~title:"Invalid binary format" + ~description: + "Could not deserialize some piece of data from its binary representation" + ~pp:(fun fmt () -> + Format.fprintf + fmt + "Could not deserialize some piece of data from its binary \ + representation") + Data_encoding.empty + (function Lazy_script_decode -> Some () | _ -> None) + (fun () -> Lazy_script_decode) + +let lazy_expr_encoding = Data_encoding.lazy_encoding expr_encoding + +let lazy_expr expr = Data_encoding.make_lazy expr_encoding expr + +type t = {code : lazy_expr; storage : lazy_expr} + +let encoding = + let open Data_encoding in + def "scripted.contracts" + @@ conv + (fun {code; storage} -> (code, storage)) + (fun (code, storage) -> {code; storage}) + (obj2 (req "code" lazy_expr_encoding) (req "storage" lazy_expr_encoding)) + +module S = Saturation_repr + +module Micheline_size = struct + type t = { + nodes : S.may_saturate S.t; + string_bytes : S.may_saturate S.t; + z_bytes : S.may_saturate S.t; + } + + let make ~nodes ~string_bytes ~z_bytes = {nodes; string_bytes; z_bytes} + + let zero = {nodes = S.zero; string_bytes = S.zero; z_bytes = S.zero} + + let add_int acc n = + let numbits = Z.numbits n in + let z_bytes = + S.safe_int ((numbits + 7) / 8) + (* Compute the number of bytes in a Z.t *) + in + { + nodes = S.succ acc.nodes; + string_bytes = acc.string_bytes; + z_bytes = S.add acc.z_bytes z_bytes; + } + + let add_string acc n = + let string_bytes = S.safe_int (String.length n) in + { + nodes = S.succ acc.nodes; + string_bytes = S.add acc.string_bytes string_bytes; + z_bytes = acc.z_bytes; + } + + let add_bytes acc n = + let string_bytes = S.safe_int (Bytes.length n) in + { + nodes = S.succ acc.nodes; + string_bytes = S.add acc.string_bytes string_bytes; + z_bytes = acc.z_bytes; + } + + let add_node s = {s with nodes = S.succ s.nodes} + + (* We model annotations as Seqs of Strings *) + let of_annots acc annots = + List.fold_left (fun acc s -> add_string acc s) acc annots + + let rec of_nodes acc nodes more_nodes = + let open Micheline in + match nodes with + | [] -> ( + match more_nodes with + | [] -> acc + | nodes :: more_nodes -> + (of_nodes [@ocaml.tailcall]) acc nodes more_nodes) + | Int (_, n) :: nodes -> + let acc = add_int acc n in + (of_nodes [@ocaml.tailcall]) acc nodes more_nodes + | String (_, s) :: nodes -> + let acc = add_string acc s in + (of_nodes [@ocaml.tailcall]) acc nodes more_nodes + | Bytes (_, s) :: nodes -> + let acc = add_bytes acc s in + (of_nodes [@ocaml.tailcall]) acc nodes more_nodes + | Prim (_, _, args, annots) :: nodes -> + let acc = add_node acc in + let acc = of_annots acc annots in + (of_nodes [@ocaml.tailcall]) acc args (nodes :: more_nodes) + | Seq (_, args) :: nodes -> + let acc = add_node acc in + (of_nodes [@ocaml.tailcall]) acc args (nodes :: more_nodes) + + let of_node node = of_nodes zero [node] [] + + let dot_product s1 s2 = + S.add + (S.mul s1.nodes s2.nodes) + (S.add + (S.mul s1.string_bytes s2.string_bytes) + (S.mul s1.z_bytes s2.z_bytes)) +end + +(* Costs pertaining to deserialization of Micheline values (bytes to Micheline). + The costs are given in atomic steps (see [Gas_limit_repr]). *) +module Micheline_decoding = struct + (* Cost vector allowing to compute decoding costs as a function of the + size of the Micheline term *) + let micheline_size_dependent_cost = + let traversal_cost = S.safe_int 60 in + let string_per_byte_cost = S.safe_int 10 in + let z_per_byte_cost = S.safe_int 10 in + Micheline_size.make + ~nodes:traversal_cost + ~string_bytes:string_per_byte_cost + ~z_bytes:z_per_byte_cost + + let bytes_dependent_cost = S.safe_int 20 +end + +(* Costs pertaining to serialization of Micheline values (Micheline to bytes) + The costs are given in atomic steps (see [Gas_limit_repr]). *) +module Micheline_encoding = struct + (* Cost vector allowing to compute encoding cost as a function of the + size of the Micheline term *) + let micheline_size_dependent_cost = + let traversal_cost = S.safe_int 100 in + let string_per_byte_cost = S.safe_int 10 in + let z_per_byte_cost = S.safe_int 25 in + Micheline_size.make + ~nodes:traversal_cost + ~string_bytes:string_per_byte_cost + ~z_bytes:z_per_byte_cost + + let bytes_dependent_cost = S.safe_int 33 +end + +let expr_size expr = Micheline_size.of_node (Micheline.root expr) + +(* Compute the cost of serializing a term of given [size]. *) +let serialization_cost size = + Gas_limit_repr.atomic_step_cost + @@ Micheline_size.dot_product + size + Micheline_encoding.micheline_size_dependent_cost + +(* Compute the cost of serializing a given term. *) +let micheline_serialization_cost v = serialization_cost (expr_size v) + +(* Compute the cost of deserializing a term of given [size]. *) +let deserialization_cost size = + Gas_limit_repr.atomic_step_cost + @@ Micheline_size.dot_product + size + Micheline_decoding.micheline_size_dependent_cost + +(* Estimate the cost of deserializing a term encoded in [bytes_len] bytes. *) +let deserialization_cost_estimated_from_bytes bytes_len = + Gas_limit_repr.atomic_step_cost + @@ S.mul Micheline_decoding.bytes_dependent_cost (S.safe_int bytes_len) + +(* Estimate the cost of serializing a term from its encoded form, + having [bytes_len] bytes. *) +let serialization_cost_estimated_from_bytes bytes_len = + Gas_limit_repr.atomic_step_cost + @@ S.mul Micheline_encoding.bytes_dependent_cost (S.safe_int bytes_len) + +(* Cost of running [strip_locations] on a term with [size] nodes. + Note that [strip_locations] will reallocate a fresh Micheline tree. + This only depends on the total number of nodes (not the size of + the leaves). *) +let cost_micheline_strip_locations size = + Gas_limit_repr.atomic_step_cost @@ S.mul (S.safe_int size) (S.safe_int 51) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2049 + Plugin benchmarked gas. + Replace this definition, copied from [cost_michelines_strip_locations]. +*) +(* Cost of running [strip_annotations] on a term with [size] nodes. + Note that [strip_annotations] will reallocate a fresh Micheline tree. + This only depends on the total number of nodes (not the size of + the leaves). *) +let cost_micheline_strip_annotations size = + Gas_limit_repr.atomic_step_cost @@ S.mul (S.safe_int size) (S.safe_int 51) + +(* This is currently used to estimate the cost of serializing an operation. *) +let bytes_node_cost s = serialization_cost_estimated_from_bytes (Bytes.length s) + +let deserialized_cost expr = + Gas_limit_repr.atomic_step_cost @@ deserialization_cost (expr_size expr) + +let force_decode_cost lexpr = + Data_encoding.apply_lazy + ~fun_value:(fun _ -> Gas_limit_repr.free) + ~fun_bytes:(fun b -> + deserialization_cost_estimated_from_bytes (Bytes.length b)) + ~fun_combine:(fun _ _ -> Gas_limit_repr.free) + lexpr + +let stable_force_decode_cost lexpr = + let has_bytes = + Data_encoding.apply_lazy + ~fun_value:(fun v -> `Only_value v) + ~fun_bytes:(fun b -> `Has_bytes b) + ~fun_combine:(fun _v b -> + (* When the lazy_expr contains both a deserialized version + and a serialized one, we compute the cost from the + serialized version because its is cheaper to do. *) + b) + lexpr + in + match has_bytes with + | `Has_bytes b -> deserialization_cost_estimated_from_bytes (Bytes.length b) + | `Only_value v -> + (* This code path should not be reached in theory because values that are + decoded should have been encoded before. + Here we use Data_encoding.Binary.length, which yields the same results + as serializing the value and taking the size, without the need to + encode (in particular, less allocations). + *) + deserialization_cost_estimated_from_bytes + (Data_encoding.Binary.length expr_encoding v) + +let force_decode lexpr = + match Data_encoding.force_decode lexpr with + | Some v -> ok v + | None -> error Lazy_script_decode + +let force_bytes_cost expr = + (* Estimating the cost directly from the bytes would be cheaper, but + using [serialization_cost] is more accurate. *) + Data_encoding.apply_lazy + ~fun_value:(fun v -> Some v) + ~fun_bytes:(fun _ -> None) + ~fun_combine:(fun _ _ -> None) + expr + |> Option.fold ~none:Gas_limit_repr.free ~some:micheline_serialization_cost + +let force_bytes expr = + Error_monad.catch_f + (fun () -> Data_encoding.force_bytes expr) + (fun _ -> Lazy_script_decode) + +let unit = + Micheline.strip_locations (Prim (0, Michelson_v1_primitives.D_Unit, [], [])) + +let unit_parameter = lazy_expr unit + +let is_unit v = + match Micheline.root v with + | Prim (_, Michelson_v1_primitives.D_Unit, [], []) -> true + | _ -> false + +let is_unit_parameter = + let unit_bytes = Data_encoding.force_bytes unit_parameter in + Data_encoding.apply_lazy + ~fun_value:is_unit + ~fun_bytes:(fun b -> Compare.Bytes.equal b unit_bytes) + ~fun_combine:(fun res _ -> res) + +let rec strip_annotations node = + let open Micheline in + match node with + | (Int (_, _) | String (_, _) | Bytes (_, _)) as leaf -> leaf + | Prim (loc, name, args, _) -> + Prim (loc, name, List.map strip_annotations args, []) + | Seq (loc, args) -> Seq (loc, List.map strip_annotations args) + +let rec micheline_fold_aux node f acc k = + match node with + | Micheline.Int (_, _) -> k (f acc node) + | Micheline.String (_, _) -> k (f acc node) + | Micheline.Bytes (_, _) -> k (f acc node) + | Micheline.Prim (_, _, subterms, _) -> + micheline_fold_nodes subterms f (f acc node) k + | Micheline.Seq (_, subterms) -> + micheline_fold_nodes subterms f (f acc node) k + +and micheline_fold_nodes subterms f acc k = + match subterms with + | [] -> k acc + | node :: nodes -> + micheline_fold_nodes nodes f acc @@ fun acc -> + micheline_fold_aux node f acc k + +let fold node init f = micheline_fold_aux node f init (fun x -> x) + +let micheline_nodes node = fold node 0 @@ fun n _ -> n + 1 + +let strip_locations_cost node = + let nodes = micheline_nodes node in + cost_micheline_strip_locations nodes + +let strip_annotations_cost node = + let nodes = micheline_nodes node in + cost_micheline_strip_annotations nodes diff --git a/src/proto_016_PtMumbai/lib_protocol/script_repr.mli b/src/proto_016_PtMumbai/lib_protocol/script_repr.mli new file mode 100644 index 000000000000..54f707dcac6f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_repr.mli @@ -0,0 +1,137 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Defines a Michelson expression representation as a Micheline node with + canonical ([int]) location and [Michelson_v1_primitives.prim] as content. + + Types [expr] and [node] both define representation of Michelson + expressions and are indeed the same type internally, although this is not + visible outside Micheline due to interface abstraction. *) + +(** Locations are used by Micheline mostly for error-reporting and pretty- + printing expressions. [canonical_location] is simply an [int]. *) +type location = Micheline.canonical_location + +(** Annotations attached to Michelson expressions. *) +type annot = Micheline.annot + +(** Represents a Michelson expression as canonical Micheline. *) +type expr = Michelson_v1_primitives.prim Micheline.canonical + +type error += Lazy_script_decode (* `Permanent *) + +(** A record containing either an underlying serialized representation of an + expression or a deserialized one, or both. If either is absent, it will be + computed on-demand. *) +type lazy_expr = expr Data_encoding.lazy_t + +type 'location michelson_node = + ('location, Michelson_v1_primitives.prim) Micheline.node + +(** Same as [expr], but used in different contexts, as required by Micheline's + abstract interface. *) +type node = location michelson_node + +val location_encoding : location Data_encoding.t + +val expr_encoding : expr Data_encoding.t + +val lazy_expr_encoding : lazy_expr Data_encoding.t + +val lazy_expr : expr -> lazy_expr + +(** Type [t] joins the contract's code and storage in a single record. *) +type t = {code : lazy_expr; storage : lazy_expr} + +val encoding : t Data_encoding.encoding + +(* Basic gas costs of operations related to processing Michelson: *) + +val deserialization_cost_estimated_from_bytes : int -> Gas_limit_repr.cost + +val deserialized_cost : expr -> Gas_limit_repr.cost + +val bytes_node_cost : bytes -> Gas_limit_repr.cost + +(** Returns (a lower bound on) the cost to deserialize a + {!lazy_expr}. If the expression has already been deserialized + (i.e. the lazy expression contains the deserialized value or both + the bytes representation and the deserialized value) then the cost + is {b free}. *) +val force_decode_cost : lazy_expr -> Gas_limit_repr.cost + +(** Like {!force_decode_cost}, excepted that the returned cost does + not depend on the internal state of the lazy_expr. This means that + the cost is never free (excepted for zero bytes expressions). *) +val stable_force_decode_cost : lazy_expr -> Gas_limit_repr.cost + +val force_decode : lazy_expr -> expr tzresult + +(** Returns the cost to serialize a {!lazy_expr}. If the expression + has already been deserialized (i.e. le lazy expression contains the + bytes representation or both the bytes representation and the + deserialized value) then the cost is {b free}. *) +val force_bytes_cost : lazy_expr -> Gas_limit_repr.cost + +val force_bytes : lazy_expr -> bytes tzresult + +val unit : expr + +val unit_parameter : lazy_expr + +val is_unit : expr -> bool + +val is_unit_parameter : lazy_expr -> bool + +val strip_annotations : node -> node + +val strip_locations_cost : _ michelson_node -> Gas_limit_repr.cost + +val strip_annotations_cost : node -> Gas_limit_repr.cost + +(** Computes the cost of serializing a given term. *) +val micheline_serialization_cost : expr -> Gas_limit_repr.cost + +module Micheline_size : sig + type t = { + nodes : Saturation_repr.may_saturate Saturation_repr.t; + string_bytes : Saturation_repr.may_saturate Saturation_repr.t; + z_bytes : Saturation_repr.may_saturate Saturation_repr.t; + } + + val of_node : node -> t +end + +(** [micheline_nodes root] returns the number of internal nodes in the + micheline expression held from [root]. *) +val micheline_nodes : node -> int + +(** [fold node i f] traverses [node] applying [f] on an + accumulator initialized by [i]. *) +val fold : + ('loc, 'prim) Micheline.node -> + 'acc -> + ('acc -> ('loc, 'prim) Micheline.node -> 'acc) -> + 'acc diff --git a/src/proto_016_PtMumbai/lib_protocol/script_set.ml b/src/proto_016_PtMumbai/lib_protocol/script_set.ml new file mode 100644 index 000000000000..c18824cdb973 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_set.ml @@ -0,0 +1,81 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_typed_ir + +let make x = Set_tag x + +let get (Set_tag x) = x + +let empty : type a. a comparable_ty -> a set = + fun ty -> + let module OPS : Boxed_set_OPS with type elt = a = struct + let elt_size = Gas_comparable_input_size.size_of_comparable_value ty + + include Set.Make (struct + type t = a + + let compare = Script_comparable.compare_comparable ty + end) + end in + Set_tag + (module struct + type elt = a + + module OPS = OPS + + let boxed = OPS.empty + + let size = 0 + end) + +let update : type a. a -> bool -> a set -> a set = + fun v b (Set_tag (module Box)) -> + Set_tag + (module struct + type elt = a + + module OPS = Box.OPS + + let boxed = + if b then Box.OPS.add v Box.boxed else Box.OPS.remove v Box.boxed + + let size = + let mem = Box.OPS.mem v Box.boxed in + if mem then if b then Box.size else Box.size - 1 + else if b then Box.size + 1 + else Box.size + end) + +let mem : type elt. elt -> elt set -> bool = + fun v (Set_tag (module Box)) -> Box.OPS.mem v Box.boxed + +let fold : type elt acc. (elt -> acc -> acc) -> elt set -> acc -> acc = + fun f (Set_tag (module Box)) -> Box.OPS.fold f Box.boxed + +let size : type elt. elt set -> Script_int.n Script_int.num = + fun (Set_tag (module Box)) -> Script_int.(abs (of_int Box.size)) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_set.mli b/src/proto_016_PtMumbai/lib_protocol/script_set.mli new file mode 100644 index 000000000000..bffb228a0752 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_set.mli @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Functions to ease the manipulation of sets of values in Michelson. + + A set in Michelson is a collection of type-homegeneous values along with the + functions that operate on the structure (through a first-class module). In + particular, the {!size} function runs in constant time. +*) + +open Script_typed_ir + +val make : (module Boxed_set with type elt = 'elt) -> 'elt set + +val get : 'elt set -> (module Boxed_set with type elt = 'elt) + +(** [empty cmp_ty] creates a set module where elements have size + [Gas_comparable_input_size.size_of_comparable_value cmp_ty] and are compared + with [Script_comparable.compare_comparable cmp_ty] (used for sorting values, + which ensures a reasonable complexity of the set functions). + The function returns an empty set packaged as a first-class set module. *) +val empty : 'a comparable_ty -> 'a set + +val fold : ('elt -> 'acc -> 'acc) -> 'elt set -> 'acc -> 'acc + +(** [update v true set] adds [v] to [set], and [update v false set] removes [v] + from [set]. *) +val update : 'a -> bool -> 'a set -> 'a set + +val mem : 'elt -> 'elt set -> bool + +(** [size set] runs in constant time. *) +val size : 'elt set -> Script_int.n Script_int.num diff --git a/src/proto_016_PtMumbai/lib_protocol/script_string.ml b/src/proto_016_PtMumbai/lib_protocol/script_string.ml new file mode 100644 index 000000000000..8585be293466 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_string.ml @@ -0,0 +1,81 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Strings of printable characters *) + +type repr = string (* Invariant: contains only printable characters *) + +type t = String_tag of repr [@@ocaml.unboxed] + +type error += Non_printable_character of (int * string) + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"michelson_v1.non_printable_character" + ~title:"Non printable character in a Michelson string" + ~description: + "Michelson strings are only allowed to contain printable characters \ + (either the newline character or characters in the [32, 126] ASCII \ + range)." + ~pp:(fun ppf (pos, s) -> + Format.fprintf + ppf + "In Michelson string \"%s\", character at position %d has ASCII code \ + %d. Expected: either a newline character (ASCII code 10) or a \ + printable character (ASCII code between 32 and 126)." + s + pos + (Char.code s.[pos])) + (obj2 (req "position" int31) (req "string" (string Plain))) + (function Non_printable_character (pos, s) -> Some (pos, s) | _ -> None) + (fun (pos, s) -> Non_printable_character (pos, s)) + +let empty = String_tag "" + +let of_string v = + let rec check_printable_ascii i = + if Compare.Int.(i < 0) then ok (String_tag v) + else + match v.[i] with + | '\n' | '\x20' .. '\x7E' -> check_printable_ascii (i - 1) + | _ -> error @@ Non_printable_character (i, v) + in + check_printable_ascii (String.length v - 1) + +let to_string (String_tag s) = s + +let compare (String_tag x) (String_tag y) = Compare.String.compare x y + +let length (String_tag s) = String.length s + +let concat_pair (String_tag x) (String_tag y) = String_tag (x ^ y) + +let concat l = + let l = List.map (fun (String_tag s) -> s) l in + String_tag (String.concat "" l) + +let sub (String_tag s) offset length = String_tag (String.sub s offset length) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_string.mli b/src/proto_016_PtMumbai/lib_protocol/script_string.mli new file mode 100644 index 000000000000..e76a3b15e67c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_string.mli @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Strings of printable characters *) + +type repr + +(** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) +type t = String_tag of repr [@@ocaml.unboxed] + +type error += Non_printable_character of (int * string) + +val empty : t + +val of_string : string -> t tzresult + +val to_string : t -> string + +val compare : t -> t -> int + +val length : t -> int + +val concat_pair : t -> t -> t + +val concat : t list -> t + +val sub : t -> int -> int -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_tc_context.ml b/src/proto_016_PtMumbai/lib_protocol/script_tc_context.ml new file mode 100644 index 000000000000..d0b4609e3bb3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_tc_context.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_typed_ir + +type in_lambda = bool + +type callsite = + | Toplevel : { + storage_type : ('sto, _) ty; + param_type : ('param, _) ty; + entrypoints : 'param Script_typed_ir.entrypoints; + } + -> callsite + | View : callsite + | Data : callsite + +type t = {callsite : callsite; in_lambda : in_lambda} + +let init callsite = {callsite; in_lambda = false} + +let toplevel ~storage_type ~param_type ~entrypoints = + init (Toplevel {storage_type; param_type; entrypoints}) + +let view = init View + +(* [data] is prefered over [toplevel] outside [Script_ir_translator], because + [toplevel] needs to setup a lot of information. *) +let data = init Data + +let add_lambda tc_context = {tc_context with in_lambda = true} + +let is_in_lambda {callsite = _; in_lambda} = in_lambda + +let check_not_in_view loc ~legacy tc_context prim = + match tc_context.callsite with + (* The forbidden (stateful) instructions in views are in facts allowed in + lambdas in views, because they could be returned to the caller, and then + executed on his responsibility. *) + | Toplevel _ | Data -> Result.return_unit + | View when is_in_lambda tc_context || legacy -> Result.return_unit + | View -> + error Script_tc_errors.(Forbidden_instr_in_context (loc, View, prim)) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_tc_context.mli b/src/proto_016_PtMumbai/lib_protocol/script_tc_context.mli new file mode 100644 index 000000000000..14f907133edd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_tc_context.mli @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_typed_ir + +(** This module defines the typechecking context used during the translation + from Michelson untyped nodes to typed nodes ([Script_ir_translator]). + The context keeps track of the origin of the code (top-level from a contract, + in a view, etc.), plus some information to allow or forbid instructions + given the context (no `SELF` in a lambda for example). *) + +(** Lambdas are a bit special when considering stateful instructions such as + [TRANSFER_TOKENS]. + For instance, a view containing a [TRANSFER_TOKENS] is not OK, because + calling the view would transfer tokens from the view's owner. + However, a view returning a lambda containing a [TRANSFER_TOKENS] could be + considered OK, as the decision whether to execute it or not falls on + the view's caller, whose tokens would be transfered. + This type is used to keep track of whether we are inside a lambda: it is + [true] when inside a lambda, and [false] otherwise. *) +type in_lambda = bool + +(** The calling context when parsing Michelson code: either a top-level contract + code, the code of a view, or code in data (when pushing a block of + instructions for example). *) +type callsite = + | Toplevel : { + storage_type : ('sto, _) ty; + param_type : ('param, _) ty; + entrypoints : 'param Script_typed_ir.entrypoints; + } + -> callsite + | View : callsite + | Data : callsite + +type t = {callsite : callsite; in_lambda : in_lambda} + +val init : callsite -> t + +val toplevel : + storage_type:('sto, _) ty -> + param_type:('param, _) ty -> + entrypoints:'param Script_typed_ir.entrypoints -> + t + +val view : t + +(** This value can be used outside the translation module as a simple context + when testing code, for example. *) +val data : t + +val add_lambda : t -> t + +val is_in_lambda : t -> bool + +val check_not_in_view : + Script.location -> legacy:bool -> t -> Script.prim -> unit tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/script_tc_errors.ml b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors.ml new file mode 100644 index 000000000000..64be6905ed23 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors.ml @@ -0,0 +1,223 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script + +(* ---- Error definitions ---------------------------------------------------*) + +type kind = Int_kind | String_kind | Bytes_kind | Prim_kind | Seq_kind + +type unparsed_stack_ty = Script.expr list + +type type_map = (Script.location * (unparsed_stack_ty * unparsed_stack_ty)) list + +(* Structure errors *) +type error += Invalid_arity of Script.location * prim * int * int + +type error += Invalid_seq_arity of Script.location * int * int + +type error += + | Invalid_namespace of + Script.location + * prim + * Michelson_v1_primitives.namespace + * Michelson_v1_primitives.namespace + +type error += Invalid_primitive of Script.location * prim list * prim + +type error += Invalid_kind of Script.location * kind list * kind + +type error += Invalid_never_expr of Script.location + +type error += Missing_field of prim + +type error += Duplicate_field of Script.location * prim + +type error += Unexpected_lazy_storage of Script.location + +type error += Unexpected_operation of Script.location + +type error += Unexpected_contract of Script.location + +type error += No_such_entrypoint of Entrypoint.t + +type error += Duplicate_entrypoint of Entrypoint.t + +type error += Unreachable_entrypoint of prim list + +(* Transaction rollup errors *) + +type error += Tx_rollup_bad_deposit_parameter of Script.location * Script.expr + +type error += Tx_rollup_invalid_ticket_amount of Z.t + +type error += Forbidden_zero_ticket_quantity + +type error += Tx_rollup_addresses_disabled of Script.location + +(* Smart-contract rollup errors *) + +type error += Sc_rollup_disabled of Script.location + +(* Zero Knowledge rollup errors *) + +type error += Zk_rollup_disabled of Script.location + +type error += Zk_rollup_bad_deposit_parameter of Script.location * Script.expr + +(* Instruction typing errors *) +type error += Fail_not_in_tail_position of Script.location + +type error += + | Undefined_binop : + Script.location * prim * Script.expr * Script.expr + -> error + +type error += Undefined_unop : Script.location * prim * Script.expr -> error + +type error += + | Bad_return : Script.location * unparsed_stack_ty * Script.expr -> error + +type error += + | Bad_stack : Script.location * prim * int * unparsed_stack_ty -> error + +type error += + | Unmatched_branches : + Script.location * unparsed_stack_ty * unparsed_stack_ty + -> error + +(* View errors *) +type error += View_name_too_long of string + +type error += Bad_view_name of Script.location + +type error += + | Ill_typed_view of { + loc : Script.location; + actual : unparsed_stack_ty; + expected : unparsed_stack_ty; + } + +type error += Duplicated_view_name of Script.location + +type context_desc = Lambda | View + +type error += + | Forbidden_instr_in_context of Script.location * context_desc * prim + +type error += Bad_stack_length + +type error += Bad_stack_item of int + +type error += Unexpected_annotation of Script.location + +type error += Ungrouped_annotations of Script.location + +type error += Invalid_map_body : Script.location * unparsed_stack_ty -> error + +type error += Invalid_map_block_fail of Script.location + +type error += + | Invalid_iter_body : + Script.location * unparsed_stack_ty * unparsed_stack_ty + -> error + +type error += Type_too_large : Script.location * int -> error + +type error += Pair_bad_argument of Script.location + +type error += Unpair_bad_argument of Script.location + +type error += Dup_n_bad_argument of Script.location + +type error += Dup_n_bad_stack of Script.location + +(* Value typing errors *) +type error += + | Invalid_constant : Script.location * Script.expr * Script.expr -> error + +type error += + | Invalid_syntactic_constant : Script.location * Script.expr * string -> error + +type error += Invalid_contract of Script.location * Contract.t + +type error += Invalid_big_map of Script.location * Big_map.Id.t + +type error += Comparable_type_expected : Script.location * Script.expr -> error + +type error += Inconsistent_type_sizes : int * int -> error + +type error += + | Inconsistent_types : Script.location * Script.expr * Script.expr -> error + +type error += + | Inconsistent_memo_sizes : Sapling.Memo_size.t * Sapling.Memo_size.t -> error + +type error += Unordered_map_keys of Script.location * Script.expr + +type error += Unordered_set_values of Script.location * Script.expr + +type error += Duplicate_map_keys of Script.location * Script.expr + +type error += Duplicate_set_values of Script.location * Script.expr + +(* Toplevel errors *) +type error += + | Ill_typed_data : string option * Script.expr * Script.expr -> error + +type error += Ill_formed_type of string option * Script.expr * Script.location + +type error += Ill_typed_contract : Script.expr * type_map -> error + +(* Deprecation errors *) +type error += Deprecated_instruction of prim + +(* Stackoverflow errors *) +type error += Typechecking_too_many_recursive_calls + +type error += Unparsing_too_many_recursive_calls + +(* Ticket errors *) +type error += Unexpected_ticket of Script.location + +type error += Unexpected_forged_value of Script.location + +type error += Non_dupable_type of Script.location * Script.expr + +type error += Unexpected_ticket_owner of Destination.t + +(* Merge type errors *) + +type inconsistent_types_fast_error = + | Inconsistent_types_fast + (** This value is only used when the details of the error don't matter because +the error will be ignored later. For example, when types are compared during +the interpretation of the [CONTRACT] instruction any error will lead to +returning [None] but the content of the error will be ignored. *) + +type (_, _) error_details = + | Informative : 'error_context -> ('error_context, error trace) error_details + | Fast : (_, inconsistent_types_fast_error) error_details diff --git a/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.ml b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.ml new file mode 100644 index 000000000000..1aa670624d13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.ml @@ -0,0 +1,827 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script +open Script_tc_errors + +(* Helpers for encoding *) +let stack_ty_enc = Data_encoding.list Script.expr_encoding + +let type_map_enc = + let open Data_encoding in + list + (conv + (fun (loc, (bef, aft)) -> (loc, bef, aft)) + (fun (loc, bef, aft) -> (loc, (bef, aft))) + (obj3 + (req "location" Script.location_encoding) + (req "stack_before" stack_ty_enc) + (req "stack_after" stack_ty_enc))) + +(* main registration *) +let () = + let open Data_encoding in + let located enc = + merge_objs (obj1 (req "location" Script.location_encoding)) enc + in + let arity_enc = int8 in + let namespace_enc = + def + "primitiveNamespace" + ~title:"Primitive namespace" + ~description: + "One of the five possible namespaces of primitive (data constructor, \ + type name, instruction, keyword, or constant hash)." + @@ string_enum + [ + ("type", Michelson_v1_primitives.Type_namespace); + ("constant", Constant_namespace); + ("instruction", Instr_namespace); + ("keyword", Keyword_namespace); + ("constant_hash", Constant_hash_namespace); + ] + in + let kind_enc = + def + "expressionKind" + ~title:"Expression kind" + ~description: + "One of the four possible kinds of expression (integer, string, \ + primitive application or sequence)." + @@ string_enum + [ + ("integer", Int_kind); + ("string", String_kind); + ("bytes", Bytes_kind); + ("primitiveApplication", Prim_kind); + ("sequence", Seq_kind); + ] + in + let context_desc_enc = + let open Data_encoding in + def "michelson_v1.context_desc" + @@ string_enum [("Lambda", Lambda); ("View", View)] + in + (* -- Structure errors ---------------------- *) + (* Invalid arity *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_arity" + ~title:"Invalid arity" + ~description: + "In a script or data expression, a primitive was applied to an \ + unsupported number of arguments." + (located + (obj3 + (req "primitive_name" Script.prim_encoding) + (req "expected_arity" arity_enc) + (req "wrong_arity" arity_enc))) + (function + | Invalid_arity (loc, name, exp, got) -> Some (loc, (name, exp, got)) + | _ -> None) + (fun (loc, (name, exp, got)) -> Invalid_arity (loc, name, exp, got)) ; + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_seq_arity" + ~title:"Invalid sequence arity" + ~description: + "In a script or data expression, a sequence was used with a number of \ + elements too small." + (located + (obj2 + (req "minimal_expected_arity" arity_enc) + (req "wrong_arity" arity_enc))) + (function + | Invalid_seq_arity (loc, exp, got) -> Some (loc, (exp, got)) | _ -> None) + (fun (loc, (exp, got)) -> Invalid_seq_arity (loc, exp, got)) ; + (* Missing field *) + register_error_kind + `Permanent + ~id:"michelson_v1.missing_script_field" + ~title:"Script is missing a field (parse error)" + ~description:"When parsing script, a field was expected, but not provided" + (obj1 (req "prim" prim_encoding)) + (function Missing_field prim -> Some prim | _ -> None) + (fun prim -> Missing_field prim) ; + (* Invalid primitive *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_primitive" + ~title:"Invalid primitive" + ~description:"In a script or data expression, a primitive was unknown." + (located + (obj2 + (dft "expected_primitive_names" (list prim_encoding) []) + (req "wrong_primitive_name" prim_encoding))) + (function + | Invalid_primitive (loc, exp, got) -> Some (loc, (exp, got)) | _ -> None) + (fun (loc, (exp, got)) -> Invalid_primitive (loc, exp, got)) ; + (* Invalid kind *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_expression_kind" + ~title:"Invalid expression kind" + ~description: + "In a script or data expression, an expression was of the wrong kind \ + (for instance a string where only a primitive applications can appear)." + (located + (obj2 (req "expected_kinds" (list kind_enc)) (req "wrong_kind" kind_enc))) + (function + | Invalid_kind (loc, exp, got) -> Some (loc, (exp, got)) | _ -> None) + (fun (loc, (exp, got)) -> Invalid_kind (loc, exp, got)) ; + (* Invalid namespace *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_primitive_namespace" + ~title:"Invalid primitive namespace" + ~description: + "In a script or data expression, a primitive was of the wrong namespace." + (located + (obj3 + (req "primitive_name" prim_encoding) + (req "expected_namespace" namespace_enc) + (req "wrong_namespace" namespace_enc))) + (function + | Invalid_namespace (loc, name, exp, got) -> Some (loc, (name, exp, got)) + | _ -> None) + (fun (loc, (name, exp, got)) -> Invalid_namespace (loc, name, exp, got)) ; + (* Invalid literal for type never *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_never_expr" + ~title:"Invalid expression for type never" + ~description: + "In a script or data expression, an expression was provided but a value \ + of type never was expected. No expression can have type never." + (located unit) + (function Invalid_never_expr loc -> Some (loc, ()) | _ -> None) + (fun (loc, ()) -> Invalid_never_expr loc) ; + (* Duplicate field *) + register_error_kind + `Permanent + ~id:"michelson_v1.duplicate_script_field" + ~title:"Script has a duplicated field (parse error)" + ~description:"When parsing script, a field was found more than once" + (obj2 (req "loc" location_encoding) (req "prim" prim_encoding)) + (function Duplicate_field (loc, prim) -> Some (loc, prim) | _ -> None) + (fun (loc, prim) -> Duplicate_field (loc, prim)) ; + (* Unexpected big_map *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_lazy_storage" + ~title:"Lazy storage in unauthorized position (type error)" + ~description: + "When parsing script, a big_map or sapling_state type was found in a \ + position where it could end up stored inside a big_map, which is \ + forbidden for now." + (obj1 (req "loc" location_encoding)) + (function Unexpected_lazy_storage loc -> Some loc | _ -> None) + (fun loc -> Unexpected_lazy_storage loc) ; + (* Unexpected operation *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_operation" + ~title:"Operation in unauthorized position (type error)" + ~description: + "When parsing script, an operation type was found in the storage or \ + parameter field." + (obj1 (req "loc" location_encoding)) + (function Unexpected_operation loc -> Some loc | _ -> None) + (fun loc -> Unexpected_operation loc) ; + (* No such entrypoint *) + register_error_kind + `Permanent + ~id:"michelson_v1.no_such_entrypoint" + ~title:"No such entrypoint (type error)" + ~description:"An entrypoint was not found when calling a contract." + (obj1 (req "entrypoint" Entrypoint.simple_encoding)) + (function No_such_entrypoint entrypoint -> Some entrypoint | _ -> None) + (fun entrypoint -> No_such_entrypoint entrypoint) ; + (* Unreachable entrypoint *) + register_error_kind + `Permanent + ~id:"michelson_v1.unreachable_entrypoint" + ~title:"Unreachable entrypoint (type error)" + ~description:"An entrypoint in the contract is not reachable." + (obj1 (req "path" (list prim_encoding))) + (function Unreachable_entrypoint path -> Some path | _ -> None) + (fun path -> Unreachable_entrypoint path) ; + (* Tx rollup bad deposit parameter *) + register_error_kind + `Permanent + ~id:"michelson_v1.tx_rollup_bad_deposit_parameter" + ~title:"Bad deposit parameter" + ~description: + "The parameter to the deposit entrypoint of a transaction rollup should \ + be a pair of a ticket and the address of a recipient transaction \ + rollup." + (located (obj1 (req "parameter" Script.expr_encoding))) + (function + | Tx_rollup_bad_deposit_parameter (loc, expr) -> Some (loc, expr) + | _ -> None) + (fun (loc, expr) -> Tx_rollup_bad_deposit_parameter (loc, expr)) ; + (* Tx rollup invalid ticket amount *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_tx_rollup_ticket_amount" + ~title:"Invalid ticket amount" + ~description: + "Ticket amount to be deposited in a transaction rollup should be \ + strictly positive and fit in a signed 64-bit integer" + (obj1 (req "requested_value" Data_encoding.z)) + (function Tx_rollup_invalid_ticket_amount z -> Some z | _ -> None) + (fun z -> Tx_rollup_invalid_ticket_amount z) ; + register_error_kind + `Permanent + ~id:"michelson_v1.forbidden_zero_amount_ticket" + ~title:"Zero ticket amount is not allowed" + ~description: + "It is not allowed to use a zero amount ticket in this operation." + Data_encoding.empty + (function Forbidden_zero_ticket_quantity -> Some () | _ -> None) + (fun () -> Forbidden_zero_ticket_quantity) ; + (* Tx rollup addresses disabled *) + register_error_kind + `Permanent + ~id:"michelson_v1.tx_rollup_addresses_disabled" + ~title:"Tx rollup addresses are disabled" + ~description:"Cannot parse a tx_rollup address as tx rollups are disabled." + (obj1 (req "location" Script.location_encoding)) + (function Tx_rollup_addresses_disabled loc -> Some loc | _ -> None) + (fun loc -> Tx_rollup_addresses_disabled loc) ; + (* Sc rollup disabled *) + register_error_kind + `Permanent + ~id:"michelson_v1.sc_rollup_disabled" + ~title:"Sc rollup are disabled" + ~description: + "Cannot use smart-contract rollup features as they are disabled." + (obj1 (req "location" Script.location_encoding)) + (function Sc_rollup_disabled loc -> Some loc | _ -> None) + (fun loc -> Sc_rollup_disabled loc) ; + (* Duplicate entrypoint *) + register_error_kind + `Permanent + ~id:"michelson_v1.duplicate_entrypoint" + ~title:"Duplicate entrypoint (type error)" + ~description:"Two entrypoints have the same name." + (obj1 (req "path" Entrypoint.simple_encoding)) + (function Duplicate_entrypoint entrypoint -> Some entrypoint | _ -> None) + (fun entrypoint -> Duplicate_entrypoint entrypoint) ; + (* Unexpected contract *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_contract" + ~title:"Contract in unauthorized position (type error)" + ~description: + "When parsing script, a contract type was found in the storage or \ + parameter field." + (obj1 (req "loc" location_encoding)) + (function Unexpected_contract loc -> Some loc | _ -> None) + (fun loc -> Unexpected_contract loc) ; + (* -- Value typing errors ---------------------- *) + (* Unordered map keys *) + register_error_kind + `Permanent + ~id:"michelson_v1.unordered_map_literal" + ~title:"Invalid map key order" + ~description:"Map keys must be in strictly increasing order" + (obj2 + (req "location" Script.location_encoding) + (req "item" Script.expr_encoding)) + (function Unordered_map_keys (loc, expr) -> Some (loc, expr) | _ -> None) + (fun (loc, expr) -> Unordered_map_keys (loc, expr)) ; + (* Duplicate map keys *) + register_error_kind + `Permanent + ~id:"michelson_v1.duplicate_map_keys" + ~title:"Duplicate map keys" + ~description:"Map literals cannot contain duplicated keys" + (obj2 + (req "location" Script.location_encoding) + (req "item" Script.expr_encoding)) + (function Duplicate_map_keys (loc, expr) -> Some (loc, expr) | _ -> None) + (fun (loc, expr) -> Duplicate_map_keys (loc, expr)) ; + (* Unordered set values *) + register_error_kind + `Permanent + ~id:"michelson_v1.unordered_set_literal" + ~title:"Invalid set value order" + ~description:"Set values must be in strictly increasing order" + (obj2 + (req "location" Script.location_encoding) + (req "value" Script.expr_encoding)) + (function + | Unordered_set_values (loc, expr) -> Some (loc, expr) | _ -> None) + (fun (loc, expr) -> Unordered_set_values (loc, expr)) ; + (* Duplicate set values *) + register_error_kind + `Permanent + ~id:"michelson_v1.duplicate_set_values_in_literal" + ~title:"Sets literals cannot contain duplicate elements" + ~description: + "Set literals cannot contain duplicate elements, but a duplicate was \ + found while parsing." + (obj2 + (req "location" Script.location_encoding) + (req "value" Script.expr_encoding)) + (function + | Duplicate_set_values (loc, expr) -> Some (loc, expr) | _ -> None) + (fun (loc, expr) -> Duplicate_set_values (loc, expr)) ; + (* -- Instruction typing errors ------------- *) + (* Fail not in tail position *) + register_error_kind + `Permanent + ~id:"michelson_v1.fail_not_in_tail_position" + ~title:"FAIL not in tail position" + ~description:"There is non trivial garbage code after a FAIL instruction." + (located empty) + (function Fail_not_in_tail_position loc -> Some (loc, ()) | _ -> None) + (fun (loc, ()) -> Fail_not_in_tail_position loc) ; + (* Undefined binary operation *) + register_error_kind + `Permanent + ~id:"michelson_v1.undefined_binop" + ~title:"Undefined binop" + ~description: + "A binary operation is called on operands of types over which it is not \ + defined." + (located + (obj3 + (req "operator_name" prim_encoding) + (req "wrong_left_operand_type" Script.expr_encoding) + (req "wrong_right_operand_type" Script.expr_encoding))) + (function + | Undefined_binop (loc, n, tyl, tyr) -> Some (loc, (n, tyl, tyr)) + | _ -> None) + (fun (loc, (n, tyl, tyr)) -> Undefined_binop (loc, n, tyl, tyr)) ; + (* Undefined unary operation *) + register_error_kind + `Permanent + ~id:"michelson_v1.undefined_unop" + ~title:"Undefined unop" + ~description: + "A unary operation is called on an operand of type over which it is not \ + defined." + (located + (obj2 + (req "operator_name" prim_encoding) + (req "wrong_operand_type" Script.expr_encoding))) + (function Undefined_unop (loc, n, ty) -> Some (loc, (n, ty)) | _ -> None) + (fun (loc, (n, ty)) -> Undefined_unop (loc, n, ty)) ; + (* Bad return *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_return" + ~title:"Bad return" + ~description:"Unexpected stack at the end of a lambda or script." + (located + (obj2 + (req "expected_return_type" Script.expr_encoding) + (req "wrong_stack_type" stack_ty_enc))) + (function Bad_return (loc, sty, ty) -> Some (loc, (ty, sty)) | _ -> None) + (fun (loc, (ty, sty)) -> Bad_return (loc, sty, ty)) ; + (* Bad stack *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_stack" + ~title:"Bad stack" + ~description:"The stack has an unexpected length or contents." + (located + (obj3 + (req "primitive_name" prim_encoding) + (req "relevant_stack_portion" int16) + (req "wrong_stack_type" stack_ty_enc))) + (function + | Bad_stack (loc, name, s, sty) -> Some (loc, (name, s, sty)) | _ -> None) + (fun (loc, (name, s, sty)) -> Bad_stack (loc, name, s, sty)) ; + (* Unexpected annotation *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_annotation" + ~title:"An annotation was encountered where no annotation is expected" + ~description:"A node in the syntax tree was improperly annotated" + (located empty) + (function Unexpected_annotation loc -> Some (loc, ()) | _ -> None) + (fun (loc, ()) -> Unexpected_annotation loc) ; + (* Ungrouped annotations *) + register_error_kind + `Permanent + ~id:"michelson_v1.ungrouped_annotations" + ~title:"Annotations of the same kind were found spread apart" + ~description:"Annotations of the same kind must be grouped" + (located empty) + (function Ungrouped_annotations loc -> Some (loc, ()) | _ -> None) + (fun (loc, ()) -> Ungrouped_annotations loc) ; + (* Unmatched branches *) + register_error_kind + `Permanent + ~id:"michelson_v1.unmatched_branches" + ~title:"Unmatched branches" + ~description: + "At the join point at the end of two code branches the stacks have \ + inconsistent lengths or contents." + (located + (obj2 + (req "first_stack_type" stack_ty_enc) + (req "other_stack_type" stack_ty_enc))) + (function + | Unmatched_branches (loc, stya, styb) -> Some (loc, (stya, styb)) + | _ -> None) + (fun (loc, (stya, styb)) -> Unmatched_branches (loc, stya, styb)) ; + (* Bad stack item *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_stack_item" + ~title:"Bad stack item" + ~description: + "The type of a stack item is unexpected (this error is always \ + accompanied by a more precise one)." + (obj1 (req "item_level" int16)) + (function Bad_stack_item n -> Some n | _ -> None) + (fun n -> Bad_stack_item n) ; + (* Forbidden instruction in a context. *) + register_error_kind + `Permanent + ~id:"michelson_v1.forbidden_instr_in_context" + ~title:"Forbidden instruction in context" + ~description: + "An instruction was encountered in a context where it is forbidden." + (located + (obj2 + (req "context" context_desc_enc) + (req "forbidden_instruction" prim_encoding))) + (function + | Forbidden_instr_in_context (loc, ctxt, prim) -> Some (loc, (ctxt, prim)) + | _ -> None) + (fun (loc, (ctxt, prim)) -> Forbidden_instr_in_context (loc, ctxt, prim)) ; + (* Bad stack length *) + register_error_kind + `Permanent + ~id:"michelson_v1.inconsistent_stack_lengths" + ~title:"Inconsistent stack lengths" + ~description: + "A stack was of an unexpected length (this error is always in the \ + context of a located error)." + empty + (function Bad_stack_length -> Some () | _ -> None) + (fun () -> Bad_stack_length) ; + (* -- Value typing errors ------------------- *) + (* Invalid constant *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_constant" + ~title:"Invalid constant" + ~description:"A data expression was invalid for its expected type." + (located + (obj2 + (req "expected_type" Script.expr_encoding) + (req "wrong_expression" Script.expr_encoding))) + (function + | Invalid_constant (loc, expr, ty) -> Some (loc, (ty, expr)) | _ -> None) + (fun (loc, (ty, expr)) -> Invalid_constant (loc, expr, ty)) ; + (* View name too long *) + register_error_kind + `Permanent + ~id:"michelson_v1.view_name_too_long" + ~title:"View name too long (type error)" + ~description:"A view name exceeds the maximum length of 31 characters." + (obj1 (req "name" (string Plain))) + (function View_name_too_long name -> Some name | _ -> None) + (fun name -> View_name_too_long name) ; + (* Duplicated view name *) + register_error_kind + `Permanent + ~id:"michelson_v1.duplicated_view_name" + ~title:"Duplicated view name" + ~description:"The name of view in toplevel should be unique." + (obj1 (req "location" Script.location_encoding)) + (function Duplicated_view_name loc -> Some loc | _ -> None) + (fun loc -> Duplicated_view_name loc) ; + (* Invalid syntactic constant *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_syntactic_constant" + ~title:"Invalid constant (parse error)" + ~description:"A compile-time constant was invalid for its expected form." + (located + (obj2 + (req "expected_form" (string Plain)) + (req "wrong_expression" Script.expr_encoding))) + (function + | Invalid_syntactic_constant (loc, expr, expected) -> + Some (loc, (expected, expr)) + | _ -> None) + (fun (loc, (expected, expr)) -> + Invalid_syntactic_constant (loc, expr, expected)) ; + (* Invalid contract *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_contract" + ~title:"Invalid contract" + ~description: + "A script or data expression references a contract that does not exist \ + or assumes a wrong type for an existing contract." + (located (obj1 (req "contract" Contract.encoding))) + (function Invalid_contract (loc, c) -> Some (loc, c) | _ -> None) + (fun (loc, c) -> Invalid_contract (loc, c)) ; + (* Invalid big_map *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_big_map" + ~title:"Invalid big_map" + ~description: + "A script or data expression references a big_map that does not exist or \ + assumes a wrong type for an existing big_map." + (located (obj1 (req "big_map" Big_map.Id.encoding))) + (function Invalid_big_map (loc, c) -> Some (loc, c) | _ -> None) + (fun (loc, c) -> Invalid_big_map (loc, c)) ; + (* Comparable type expected *) + register_error_kind + `Permanent + ~id:"michelson_v1.comparable_type_expected" + ~title:"Comparable type expected" + ~description: + "A non comparable type was used in a place where only comparable types \ + are accepted." + (located (obj1 (req "wrong_type" Script.expr_encoding))) + (function + | Comparable_type_expected (loc, ty) -> Some (loc, ty) | _ -> None) + (fun (loc, ty) -> Comparable_type_expected (loc, ty)) ; + (* Inconsistent type sizes *) + register_error_kind + `Permanent + ~id:"michelson_v1.inconsistent_type_sizes" + ~title:"Inconsistent type sizes" + ~description: + "Two types were expected to be equal but they have different sizes." + (obj2 (req "first_type_size" int31) (req "other_type_size" int31)) + (function + | Inconsistent_type_sizes (tya, tyb) -> Some (tya, tyb) | _ -> None) + (fun (tya, tyb) -> Inconsistent_type_sizes (tya, tyb)) ; + (* Inconsistent types *) + register_error_kind + `Permanent + ~id:"michelson_v1.inconsistent_types" + ~title:"Inconsistent types" + ~description: + "This is the basic type clash error, that appears in several places \ + where the equality of two types have to be proven, it is always \ + accompanied with another error that provides more context." + (obj3 + (req "loc" Script.location_encoding) + (req "first_type" Script.expr_encoding) + (req "other_type" Script.expr_encoding)) + (function + | Inconsistent_types (loc, tya, tyb) -> Some (loc, tya, tyb) | _ -> None) + (fun (loc, tya, tyb) -> Inconsistent_types (loc, tya, tyb)) ; + (* Inconsistent memo_sizes *) + register_error_kind + `Permanent + ~id:"michelson_v1.inconsistent_memo_sizes" + ~title:"Inconsistent memo sizes" + ~description:"Memo sizes of two sapling states or transactions do not match" + (obj2 + (req "first_memo_size" Sapling.Memo_size.encoding) + (req "other_memo_size" Sapling.Memo_size.encoding)) + (function + | Inconsistent_memo_sizes (msa, msb) -> Some (msa, msb) | _ -> None) + (fun (msa, msb) -> Inconsistent_memo_sizes (msa, msb)) ; + (* -- Instruction typing errors ------------------- *) + (* Bad view name *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_view_name" + ~title:"Bad view name" + ~description:"In a view declaration, the view name must be a string" + (obj1 (req "loc" Script.location_encoding)) + (function Bad_view_name loc -> Some loc | _ -> None) + (fun loc -> Bad_view_name loc) ; + (* Invalid view body *) + register_error_kind + `Permanent + ~id:"michelson_v1.ill_typed_view" + ~title:"Ill typed view" + ~description:"The return of a view block did not match the expected type" + (obj3 + (req "loc" Script.location_encoding) + (req "resulted_view_stack" stack_ty_enc) + (req "expected_view_stack" stack_ty_enc)) + (function + | Ill_typed_view {loc; actual; expected} -> Some (loc, actual, expected) + | _ -> None) + (fun (loc, actual, expected) -> Ill_typed_view {loc; actual; expected}) ; + (* Invalid map body *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_map_body" + ~title:"Invalid map body" + ~description:"The body of a map block did not match the expected type" + (obj2 (req "loc" Script.location_encoding) (req "body_type" stack_ty_enc)) + (function Invalid_map_body (loc, stack) -> Some (loc, stack) | _ -> None) + (fun (loc, stack) -> Invalid_map_body (loc, stack)) ; + (* Invalid map block FAIL *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_map_block_fail" + ~title:"FAIL instruction occurred as body of map block" + ~description: + "FAIL cannot be the only instruction in the body. The proper type of the \ + return list cannot be inferred." + (obj1 (req "loc" Script.location_encoding)) + (function Invalid_map_block_fail loc -> Some loc | _ -> None) + (fun loc -> Invalid_map_block_fail loc) ; + (* Invalid ITER body *) + register_error_kind + `Permanent + ~id:"michelson_v1.invalid_iter_body" + ~title:"ITER body returned wrong stack type" + ~description: + "The body of an ITER instruction must result in the same stack type as \ + before the ITER." + (obj3 + (req "loc" Script.location_encoding) + (req "bef_stack" stack_ty_enc) + (req "aft_stack" stack_ty_enc)) + (function + | Invalid_iter_body (loc, bef, aft) -> Some (loc, bef, aft) | _ -> None) + (fun (loc, bef, aft) -> Invalid_iter_body (loc, bef, aft)) ; + (* Type too large *) + register_error_kind + `Permanent + ~id:"michelson_v1.type_too_large" + ~title:"Stack item type too large" + ~description:"An instruction generated a type larger than the limit." + (obj2 (req "loc" Script.location_encoding) (req "maximum_type_size" uint16)) + (function Type_too_large (loc, maxts) -> Some (loc, maxts) | _ -> None) + (fun (loc, maxts) -> Type_too_large (loc, maxts)) ; + (* Bad PAIR argument *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_pair_argument" + ~title:"0 or 1 passed to PAIR" + ~description:"PAIR expects an argument of at least 2" + (obj1 (req "loc" Script.location_encoding)) + (function Pair_bad_argument loc -> Some loc | _ -> None) + (fun loc -> Pair_bad_argument loc) ; + (* Bad UNPAIR argument *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_unpair_argument" + ~title:"0 or 1 passed to UNPAIR" + ~description:"UNPAIR expects an argument of at least 2" + (obj1 (req "loc" Script.location_encoding)) + (function Unpair_bad_argument loc -> Some loc | _ -> None) + (fun loc -> Unpair_bad_argument loc) ; + (* Bad dup_n argument *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_dupn_argument" + ~title:"0 passed to DUP n" + ~description:"DUP expects an argument of at least 1 (passed 0)" + (obj1 (req "loc" Script.location_encoding)) + (function Dup_n_bad_argument loc -> Some loc | _ -> None) + (fun loc -> Dup_n_bad_argument loc) ; + (* Bad dup_n stack *) + register_error_kind + `Permanent + ~id:"michelson_v1.bad_dupn_stack" + ~title:"Stack too short when typing DUP n" + ~description:"Stack present when typing DUP n was too short" + (obj1 (req "loc" Script.location_encoding)) + (function Dup_n_bad_stack x -> Some x | _ -> None) + (fun x -> Dup_n_bad_stack x) ; + (* -- Toplevel errors ------------------- *) + (* Ill typed data *) + register_error_kind + `Permanent + ~id:"michelson_v1.ill_typed_data" + ~title:"Ill typed data" + ~description: + "The toplevel error thrown when trying to typecheck a data expression \ + against a given type (always followed by more precise errors)." + (obj3 + (opt "identifier" (string Plain)) + (req "expected_type" Script.expr_encoding) + (req "ill_typed_expression" Script.expr_encoding)) + (function + | Ill_typed_data (name, expr, ty) -> Some (name, ty, expr) | _ -> None) + (fun (name, ty, expr) -> Ill_typed_data (name, expr, ty)) ; + (* Ill formed type *) + register_error_kind + `Permanent + ~id:"michelson_v1.ill_formed_type" + ~title:"Ill formed type" + ~description: + "The toplevel error thrown when trying to parse a type expression \ + (always followed by more precise errors)." + (obj3 + (opt "identifier" (string Plain)) + (req "ill_formed_expression" Script.expr_encoding) + (req "location" Script.location_encoding)) + (function + | Ill_formed_type (name, expr, loc) -> Some (name, expr, loc) | _ -> None) + (fun (name, expr, loc) -> Ill_formed_type (name, expr, loc)) ; + (* Ill typed contract *) + register_error_kind + `Permanent + ~id:"michelson_v1.ill_typed_contract" + ~title:"Ill typed contract" + ~description: + "The toplevel error thrown when trying to typecheck a contract code \ + against given input, output and storage types (always followed by more \ + precise errors)." + (obj2 + (req "ill_typed_code" Script.expr_encoding) + (req "type_map" type_map_enc)) + (function + | Ill_typed_contract (expr, type_map) -> Some (expr, type_map) | _ -> None) + (fun (expr, type_map) -> Ill_typed_contract (expr, type_map)) ; + (* Deprecated instruction *) + register_error_kind + `Permanent + ~id:"michelson_v1.deprecated_instruction" + ~title:"Script is using a deprecated instruction" + ~description: + "A deprecated instruction usage is disallowed in newly created contracts" + (obj1 (req "prim" prim_encoding)) + (function Deprecated_instruction prim -> Some prim | _ -> None) + (fun prim -> Deprecated_instruction prim) ; + (* Typechecking stack overflow *) + register_error_kind + `Temporary + ~id:"michelson_v1.typechecking_too_many_recursive_calls" + ~title:"Too many recursive calls during typechecking" + ~description:"Too many recursive calls were needed for typechecking" + Data_encoding.empty + (function Typechecking_too_many_recursive_calls -> Some () | _ -> None) + (fun () -> Typechecking_too_many_recursive_calls) ; + (* Unparsing stack overflow *) + register_error_kind + `Temporary + ~id:"michelson_v1.unparsing_stack_overflow" + ~title:"Too many recursive calls during unparsing" + ~description:"Too many recursive calls were needed for unparsing" + Data_encoding.empty + (function Unparsing_too_many_recursive_calls -> Some () | _ -> None) + (fun () -> Unparsing_too_many_recursive_calls) ; + (* Unexpected forged value *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_forged_value" + ~title:"Unexpected forged value" + ~description: + "A forged value was encountered but disallowed for that position." + (obj1 (req "location" Script.location_encoding)) + (function Unexpected_forged_value loc -> Some loc | _ -> None) + (fun loc -> Unexpected_forged_value loc) ; + (* Unexpected ticket *) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_ticket" + ~title:"Ticket in unauthorized position (type error)" + ~description:"A ticket type has been found" + (obj1 (req "loc" location_encoding)) + (function Unexpected_ticket loc -> Some loc | _ -> None) + (fun loc -> Unexpected_ticket loc) ; + (* Attempt to duplicate a non-dupable type *) + register_error_kind + `Permanent + ~id:"michelson_v1.non_dupable_type" + ~title:"Non-dupable type duplication attempt" + ~description:"DUP was used on a non-dupable type (e.g. tickets)." + (obj2 (req "loc" location_encoding) (req "type" Script.expr_encoding)) + (function Non_dupable_type (loc, ty) -> Some (loc, ty) | _ -> None) + (fun (loc, ty) -> Non_dupable_type (loc, ty)) ; + (* Unexpected ticket owner*) + register_error_kind + `Permanent + ~id:"michelson_v1.unexpected_ticket_owner" + ~title:"Unexpected ticket owner" + ~description:"Ticket can only be created by a smart contract" + (obj1 (req "ticketer" Destination.encoding)) + (function Unexpected_ticket_owner t -> Some t | _ -> None) + (fun t -> Unexpected_ticket_owner t) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.mli b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.mli new file mode 100644 index 000000000000..dd2e61e500ce --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_tc_errors_registration.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module registers all the errors from [Script_tc_errors] as a top-level + effect. *) + +open Alpha_context +open Script + +val type_map_enc : + (location * (expr list * expr list)) list Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/script_timestamp.ml b/src/proto_016_PtMumbai/lib_protocol/script_timestamp.ml new file mode 100644 index 000000000000..105d751473e8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_timestamp.ml @@ -0,0 +1,66 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type repr = Z.t + +type t = Timestamp_tag of repr [@@ocaml.unboxed] + +let compare (Timestamp_tag x) (Timestamp_tag y) = Z.compare x y + +let of_int64 i = Timestamp_tag (Z.of_int64 i) + +let of_string x = + match Time_repr.of_notation x with + | None -> Option.catch (fun () -> Timestamp_tag (Z.of_string x)) + | Some time -> Some (of_int64 (Time_repr.to_seconds time)) + +let to_notation (Timestamp_tag x) = + Option.catch (fun () -> + Time_repr.to_notation (Time.of_seconds (Z.to_int64 x))) + +let to_num_str (Timestamp_tag x) = Z.to_string x + +let to_string x = match to_notation x with None -> to_num_str x | Some s -> s + +let diff (Timestamp_tag x) (Timestamp_tag y) = Script_int.of_zint @@ Z.sub x y + +let sub_delta (Timestamp_tag t) delta = + Timestamp_tag (Z.sub t (Script_int.to_zint delta)) + +let add_delta (Timestamp_tag t) delta = + Timestamp_tag (Z.add t (Script_int.to_zint delta)) + +let to_zint (Timestamp_tag x) = x + +let of_zint x = Timestamp_tag x + +let encoding = Data_encoding.(conv to_zint of_zint z) + +let now ctxt = + let open Alpha_context in + let first_delay = Period.to_seconds (Constants.minimal_block_delay ctxt) in + let current_timestamp = Timestamp.predecessor ctxt in + Time.add current_timestamp first_delay |> Timestamp.to_seconds |> of_int64 diff --git a/src/proto_016_PtMumbai/lib_protocol/script_timestamp.mli b/src/proto_016_PtMumbai/lib_protocol/script_timestamp.mli new file mode 100644 index 000000000000..2d246ae4f9a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_timestamp.mli @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Defines the internal Michelson representation for timestamps and basic + operations that can be performed on it. *) + +open Script_int + +type repr + +(** Representation of timestamps specific to the Michelson interpreter. + A number of seconds since the epoch. + [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) +type t = Timestamp_tag of repr [@@ocaml.unboxed] + +(** Convert a number of seconds since the epoch to a timestamp.*) +val of_int64 : int64 -> t + +(** Compare timestamps. Returns [1] if the first timestamp is later than the + second one; [0] if they're equal and [-1] othwerwise. *) +val compare : t -> t -> int + +(** Convert a timestamp to RFC3339 notation if possible **) +val to_notation : t -> string option + +(** Convert a timestamp to a string representation of the seconds *) +val to_num_str : t -> string + +(** Convert to RFC3339 notation if possible, or num if not *) +val to_string : t -> string + +val of_string : string -> t option + +(** Returns difference between timestamps as integral number of seconds + in Michelson representation of numbers. *) +val diff : t -> t -> z num + +(** Add a number of seconds to the timestamp. *) +val add_delta : t -> z num -> t + +(** Subtract a number of seconds from the timestamp. *) +val sub_delta : t -> z num -> t + +val to_zint : t -> Z.t + +val of_zint : Z.t -> t + +(* Timestamps are encoded exactly as Z. *) +val encoding : t Data_encoding.encoding + +val now : Alpha_context.t -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.ml b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.ml new file mode 100644 index 000000000000..079a1eeb353d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.ml @@ -0,0 +1,2342 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda,jp> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_int +open Dependent_bool + +(* + + The step function of the interpreter is parametrized by a bunch of values called the step constants. + These values are indeed constants during the call of a smart contract with the notable exception of + the IView instruction which modifies `source`, `self`, and `amount` and the KView_exit continuation + which restores them. + ====================== + +*) +type step_constants = { + source : Contract.t; + (** The address calling this contract, as returned by SENDER. *) + payer : Signature.public_key_hash; + (** The address of the implicit account that initiated the chain of contract calls, as returned by SOURCE. *) + self : Contract_hash.t; + (** The address of the contract being executed, as returned by SELF and SELF_ADDRESS. + Also used: + - as ticketer in TICKET + - as caller in VIEW, TRANSFER_TOKENS, and CREATE_CONTRACT *) + amount : Tez.t; + (** The amount of the current transaction, as returned by AMOUNT. *) + balance : Tez.t; (** The balance of the contract as returned by BALANCE. *) + chain_id : Chain_id.t; + (** The chain id of the chain, as returned by CHAIN_ID. *) + now : Script_timestamp.t; + (** The earliest time at which the current block could have been timestamped, as returned by NOW. *) + level : Script_int.n Script_int.num; + (** The level of the current block, as returned by LEVEL. *) +} + +(* Preliminary definitions. *) + +type never = | + +type address = {destination : Destination.t; entrypoint : Entrypoint.t} + +module Script_signature = struct + type t = Signature_tag of signature [@@ocaml.unboxed] + + let make s = Signature_tag s + + let get (Signature_tag s) = s + + let encoding = + Data_encoding.conv + (fun (Signature_tag x) -> x) + (fun x -> Signature_tag x) + Signature.encoding + + let of_b58check_opt x = Option.map make (Signature.of_b58check_opt x) + + let check ?watermark pub_key (Signature_tag s) bytes = + Signature.check ?watermark pub_key s bytes + + let compare (Signature_tag x) (Signature_tag y) = Signature.compare x y + + let size (Signature_tag s) = Signature.size s +end + +type signature = Script_signature.t + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2466 + The various attributes of this type should be checked with + appropriate testing. *) +type tx_rollup_l2_address = Tx_rollup_l2_address.Indexable.value + +type ('a, 'b) pair = 'a * 'b + +type ('a, 'b) union = L of 'a | R of 'b + +module Script_chain_id = struct + type t = Chain_id_tag of Chain_id.t [@@ocaml.unboxed] + + let make x = Chain_id_tag x + + let compare (Chain_id_tag x) (Chain_id_tag y) = Chain_id.compare x y + + let size = Chain_id.size + + let encoding = + Data_encoding.conv (fun (Chain_id_tag x) -> x) make Chain_id.encoding + + let to_b58check (Chain_id_tag x) = Chain_id.to_b58check x + + let of_b58check_opt x = Option.map make (Chain_id.of_b58check_opt x) +end + +module Script_bls = struct + module type S = sig + type t + + type fr + + val add : t -> t -> t + + val mul : t -> fr -> t + + val negate : t -> t + + val of_bytes_opt : Bytes.t -> t option + + val to_bytes : t -> Bytes.t + end + + module Fr = struct + type t = Fr_tag of Bls.Primitive.Fr.t [@@ocaml.unboxed] + + open Bls.Primitive.Fr + + let add (Fr_tag x) (Fr_tag y) = Fr_tag (add x y) + + let mul (Fr_tag x) (Fr_tag y) = Fr_tag (mul x y) + + let negate (Fr_tag x) = Fr_tag (negate x) + + let of_bytes_opt bytes = Option.map (fun x -> Fr_tag x) (of_bytes_opt bytes) + + let to_bytes (Fr_tag x) = to_bytes x + + let of_z z = Fr_tag (of_z z) + + let to_z (Fr_tag x) = to_z x + end + + module G1 = struct + type t = G1_tag of Bls.Primitive.G1.t [@@ocaml.unboxed] + + open Bls.Primitive.G1 + + let add (G1_tag x) (G1_tag y) = G1_tag (add x y) + + let mul (G1_tag x) (Fr.Fr_tag y) = G1_tag (mul x y) + + let negate (G1_tag x) = G1_tag (negate x) + + let of_bytes_opt bytes = Option.map (fun x -> G1_tag x) (of_bytes_opt bytes) + + let to_bytes (G1_tag x) = to_bytes x + end + + module G2 = struct + type t = G2_tag of Bls.Primitive.G2.t [@@ocaml.unboxed] + + open Bls.Primitive.G2 + + let add (G2_tag x) (G2_tag y) = G2_tag (add x y) + + let mul (G2_tag x) (Fr.Fr_tag y) = G2_tag (mul x y) + + let negate (G2_tag x) = G2_tag (negate x) + + let of_bytes_opt bytes = Option.map (fun x -> G2_tag x) (of_bytes_opt bytes) + + let to_bytes (G2_tag x) = to_bytes x + end + + let pairing_check l = + let l = List.map (fun (G1.G1_tag x, G2.G2_tag y) -> (x, y)) l in + Bls.Primitive.pairing_check l +end + +module Script_timelock = struct + type chest_key = Chest_key_tag of Timelock.chest_key [@@ocaml.unboxed] + + let make_chest_key chest_key = Chest_key_tag chest_key + + let chest_key_encoding = + Data_encoding.conv + (fun (Chest_key_tag x) -> x) + (fun x -> Chest_key_tag x) + Timelock.chest_key_encoding + + type chest = Chest_tag of Timelock.chest [@@ocaml.unboxed] + + let make_chest chest = Chest_tag chest + + let chest_encoding = + Data_encoding.conv + (fun (Chest_tag x) -> x) + (fun x -> Chest_tag x) + Timelock.chest_encoding + + let open_chest (Chest_tag chest) (Chest_key_tag chest_key) ~time = + Timelock.open_chest chest chest_key ~time + + let get_plaintext_size (Chest_tag x) = Timelock.get_plaintext_size x +end + +type ticket_amount = Ticket_amount.t + +type 'a ticket = {ticketer : Contract.t; contents : 'a; amount : ticket_amount} + +module type TYPE_SIZE = sig + (* A type size represents the size of its type parameter. + This constraint is enforced inside this module (Script_typed_ir), hence there + should be no way to construct a type size outside of it. + + It allows keeping type metadata and types non-private. + + The size of a type is the number of nodes in its AST + representation. In other words, the size of a type is 1 plus the size of + its arguments. For instance, the size of [Unit] is 1 and the size of + [Pair ty1 ty2] is [1] plus the size of [ty1] and [ty2]. + + This module is here because we want three levels of visibility over this + code: + - inside this submodule, we have [type 'a t = int] + - outside of [Script_typed_ir], the ['a t] type is abstract and we have + the invariant that whenever [x : 'a t] we have that [x] is exactly + the size of ['a]. + - in-between (inside [Script_typed_ir] but outside the [Type_size] + submodule), the type is abstract but we have access to unsafe + constructors that can break the invariant. + *) + type 'a t + + val check_eq : + error_details:('error_context, 'error_trace) Script_tc_errors.error_details -> + 'a t -> + 'b t -> + (unit, 'error_trace) result + + val to_int : 'a t -> Saturation_repr.mul_safe Saturation_repr.t + + (* Unsafe constructors, to be used only safely and inside this module *) + + val one : _ t + + val two : _ t + + val three : _ t + + val four : (_, _) pair option t + + val compound1 : Script.location -> _ t -> _ t tzresult + + val compound2 : Script.location -> _ t -> _ t -> _ t tzresult +end + +module Type_size : TYPE_SIZE = struct + type 'a t = int + + let () = + (* static-like check that all [t] values fit in a [mul_safe] *) + let (_ : Saturation_repr.mul_safe Saturation_repr.t) = + Saturation_repr.mul_safe_of_int_exn Constants.michelson_maximum_type_size + in + () + + let to_int = Saturation_repr.mul_safe_of_int_exn + + let one = 1 + + let two = 2 + + let three = 3 + + let four = 4 + + let check_eq : + type a b error_trace. + error_details:(_, error_trace) Script_tc_errors.error_details -> + a t -> + b t -> + (unit, error_trace) result = + fun ~error_details x y -> + if Compare.Int.(x = y) then Result.return_unit + else + Error + (match error_details with + | Fast -> Inconsistent_types_fast + | Informative _ -> + trace_of_error @@ Script_tc_errors.Inconsistent_type_sizes (x, y)) + + let of_int loc size = + let max_size = Constants.michelson_maximum_type_size in + if Compare.Int.(size <= max_size) then ok size + else error (Script_tc_errors.Type_too_large (loc, max_size)) + + let compound1 loc size = of_int loc (1 + size) + + let compound2 loc size1 size2 = of_int loc (1 + size1 + size2) +end + +type empty_cell = EmptyCell + +type end_of_stack = empty_cell * empty_cell + +type 'a ty_metadata = {size : 'a Type_size.t} [@@unboxed] + +(* + + This signature contains the exact set of functions used in the + protocol. We do not include all [Set.S] because this would + increase the size of the first class modules used to represent + [boxed_set]. + + Warning: for any change in this signature, there must be a + change in [Script_typed_ir_size.value_size] which updates + [boxing_space] in the case for sets. + +*) +module type Boxed_set_OPS = sig + type t + + type elt + + val elt_size : elt -> int (* Gas_input_size.t *) + + val empty : t + + val add : elt -> t -> t + + val mem : elt -> t -> bool + + val remove : elt -> t -> t + + val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a +end + +module type Boxed_set = sig + type elt + + module OPS : Boxed_set_OPS with type elt = elt + + val boxed : OPS.t + + val size : int +end + +type 'elt set = Set_tag of (module Boxed_set with type elt = 'elt) +[@@ocaml.unboxed] + +(* + + Same remark as for [Boxed_set_OPS]. (See below.) + +*) +module type Boxed_map_OPS = sig + type 'a t + + type key + + val key_size : key -> int (* Gas_input_size.t *) + + val empty : 'value t + + val add : key -> 'value -> 'value t -> 'value t + + val remove : key -> 'value t -> 'value t + + val find : key -> 'value t -> 'value option + + val fold : (key -> 'value -> 'a -> 'a) -> 'value t -> 'a -> 'a + + val fold_es : + (key -> 'value -> 'a -> 'a tzresult Lwt.t) -> + 'value t -> + 'a -> + 'a tzresult Lwt.t +end + +module type Boxed_map = sig + type key + + type value + + module OPS : Boxed_map_OPS with type key = key + + val boxed : value OPS.t + + val size : int +end + +type ('key, 'value) map = + | Map_tag of (module Boxed_map with type key = 'key and type value = 'value) +[@@ocaml.unboxed] + +module Big_map_overlay = Map.Make (struct + type t = Script_expr_hash.t + + let compare = Script_expr_hash.compare +end) + +type ('key, 'value) big_map_overlay = { + map : ('key * 'value option) Big_map_overlay.t; + size : int; +} + +type view = { + input_ty : Script.node; + output_ty : Script.node; + view_code : Script.node; +} + +type view_map = (Script_string.t, view) map + +type entrypoint_info = {name : Entrypoint.t; original_type_expr : Script.node} + +type 'arg entrypoints_node = { + at_node : entrypoint_info option; + nested : 'arg nested_entrypoints; +} + +and 'arg nested_entrypoints = + | Entrypoints_Union : { + left : 'l entrypoints_node; + right : 'r entrypoints_node; + } + -> ('l, 'r) union nested_entrypoints + | Entrypoints_None : _ nested_entrypoints + +let no_entrypoints = {at_node = None; nested = Entrypoints_None} + +type logging_event = LogEntry | LogExit of Script.location + +type 'arg entrypoints = { + root : 'arg entrypoints_node; + original_type_expr : Script.node; +} + +(* ---- Instructions --------------------------------------------------------*) +and ('before_top, 'before, 'result_top, 'result) kinstr = + (* + Stack + ----- + *) + | IDrop : + Script.location * ('b, 's, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IDup : + Script.location * ('a, 'a * ('b * 's), 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | ISwap : + Script.location * ('b, 'a * ('c * 's), 'r, 'f) kinstr + -> ('a, 'b * ('c * 's), 'r, 'f) kinstr + | IConst : + Script.location * ('ty, _) ty * 'ty * ('ty, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + (* + Pairs + ----- + *) + | ICons_pair : + Script.location * ('a * 'b, 'c * 's, 'r, 'f) kinstr + -> ('a, 'b * ('c * 's), 'r, 'f) kinstr + | ICar : + Script.location * ('a, 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + | ICdr : + Script.location * ('b, 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + | IUnpair : + Script.location * ('a, 'b * 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + (* + Options + ------- + *) + | ICons_some : + Script.location * ('v option, 'a * 's, 'r, 'f) kinstr + -> ('v, 'a * 's, 'r, 'f) kinstr + | ICons_none : + Script.location * ('b, _) ty * ('b option, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IIf_none : { + loc : Script.location; + branch_if_none : ('b, 's, 'c, 't) kinstr; + branch_if_some : ('a, 'b * 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> ('a option, 'b * 's, 'r, 'f) kinstr + | IOpt_map : { + loc : Script.location; + body : ('a, 's, 'b, 's) kinstr; + k : ('b option, 's, 'c, 't) kinstr; + } + -> ('a option, 's, 'c, 't) kinstr + (* + Unions + ------ + *) + | ICons_left : + Script.location * ('b, _) ty * (('a, 'b) union, 'c * 's, 'r, 'f) kinstr + -> ('a, 'c * 's, 'r, 'f) kinstr + | ICons_right : + Script.location * ('a, _) ty * (('a, 'b) union, 'c * 's, 'r, 'f) kinstr + -> ('b, 'c * 's, 'r, 'f) kinstr + | IIf_left : { + loc : Script.location; + branch_if_left : ('a, 's, 'c, 't) kinstr; + branch_if_right : ('b, 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> (('a, 'b) union, 's, 'r, 'f) kinstr + (* + Lists + ----- + *) + | ICons_list : + Script.location * ('a Script_list.t, 's, 'r, 'f) kinstr + -> ('a, 'a Script_list.t * 's, 'r, 'f) kinstr + | INil : + Script.location * ('b, _) ty * ('b Script_list.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IIf_cons : { + loc : Script.location; + branch_if_cons : ('a, 'a Script_list.t * ('b * 's), 'c, 't) kinstr; + branch_if_nil : ('b, 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> ('a Script_list.t, 'b * 's, 'r, 'f) kinstr + | IList_map : + Script.location + * ('a, 'c * 's, 'b, 'c * 's) kinstr + * ('b Script_list.t, _) ty option + * ('b Script_list.t, 'c * 's, 'r, 'f) kinstr + -> ('a Script_list.t, 'c * 's, 'r, 'f) kinstr + | IList_iter : + Script.location + * ('a, _) ty option + * ('a, 'b * 's, 'b, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> ('a Script_list.t, 'b * 's, 'r, 'f) kinstr + | IList_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> ('a Script_list.t, 's, 'r, 'f) kinstr + (* + Sets + ---- + *) + | IEmpty_set : + Script.location * 'b comparable_ty * ('b set, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISet_iter : + Script.location + * 'a comparable_ty option + * ('a, 'b * 's, 'b, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> ('a set, 'b * 's, 'r, 'f) kinstr + | ISet_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, 'a set * 's, 'r, 'f) kinstr + | ISet_update : + Script.location * ('a set, 's, 'r, 'f) kinstr + -> ('a, bool * ('a set * 's), 'r, 'f) kinstr + | ISet_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> ('a set, 's, 'r, 'f) kinstr + (* + Maps + ---- + *) + | IEmpty_map : + Script.location + * 'b comparable_ty + * ('c, _) ty option + * (('b, 'c) map, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IMap_map : + Script.location + * (('a, 'c) map, _) ty option + * ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * (('a, 'c) map, 'd * 's, 'r, 'f) kinstr + -> (('a, 'b) map, 'd * 's, 'r, 'f) kinstr + | IMap_iter : + Script.location + * ('a * 'b, _) ty option + * ('a * 'b, 'c * 's, 'c, 's) kinstr + * ('c, 's, 'r, 'f) kinstr + -> (('a, 'b) map, 'c * 's, 'r, 'f) kinstr + | IMap_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) map * 's, 'r, 'f) kinstr + | IMap_get : + Script.location * ('b option, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) map * 's, 'r, 'f) kinstr + | IMap_update : + Script.location * (('a, 'b) map, 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) map * 's), 'r, 'f) kinstr + | IMap_get_and_update : + Script.location * ('b option, ('a, 'b) map * 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) map * 's), 'r, 'f) kinstr + | IMap_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (('a, 'b) map, 's, 'r, 'f) kinstr + (* + Big maps + -------- + *) + | IEmpty_big_map : + Script.location + * 'b comparable_ty + * ('c, _) ty + * (('b, 'c) big_map, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IBig_map_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) big_map * 's, 'r, 'f) kinstr + | IBig_map_get : + Script.location * ('b option, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) big_map * 's, 'r, 'f) kinstr + | IBig_map_update : + Script.location * (('a, 'b) big_map, 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) big_map * 's), 'r, 'f) kinstr + | IBig_map_get_and_update : + Script.location * ('b option, ('a, 'b) big_map * 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) big_map * 's), 'r, 'f) kinstr + (* + Strings + ------- + *) + | IConcat_string : + Script.location * (Script_string.t, 's, 'r, 'f) kinstr + -> (Script_string.t Script_list.t, 's, 'r, 'f) kinstr + | IConcat_string_pair : + Script.location * (Script_string.t, 's, 'r, 'f) kinstr + -> (Script_string.t, Script_string.t * 's, 'r, 'f) kinstr + | ISlice_string : + Script.location * (Script_string.t option, 's, 'r, 'f) kinstr + -> (n num, n num * (Script_string.t * 's), 'r, 'f) kinstr + | IString_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (Script_string.t, 's, 'r, 'f) kinstr + (* + Bytes + ----- + *) + | IConcat_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes Script_list.t, 's, 'r, 'f) kinstr + | IConcat_bytes_pair : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | ISlice_bytes : + Script.location * (bytes option, 's, 'r, 'f) kinstr + -> (n num, n num * (bytes * 's), 'r, 'f) kinstr + | IBytes_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ILsl_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, n num * 's, 'r, 'f) kinstr + | ILsr_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, n num * 's, 'r, 'f) kinstr + | IOr_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | IAnd_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | IXor_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | INot_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | INat_bytes : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBytes_nat : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (n num, 's, 'r, 'f) kinstr + | IInt_bytes : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBytes_int : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + (* + Timestamps + ---------- + *) + | IAdd_seconds_to_timestamp : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (z num, Script_timestamp.t * 's, 'r, 'f) kinstr + | IAdd_timestamp_to_seconds : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, z num * 's, 'r, 'f) kinstr + | ISub_timestamp_seconds : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, z num * 's, 'r, 'f) kinstr + | IDiff_timestamps : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, Script_timestamp.t * 's, 'r, 'f) kinstr + (* + Tez + --- + *) + | IAdd_tez : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | ISub_tez : + Script.location * (Tez.t option, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | ISub_tez_legacy : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | IMul_teznat : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, n num * 's, 'r, 'f) kinstr + | IMul_nattez : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (n num, Tez.t * 's, 'r, 'f) kinstr + | IEdiv_teznat : + Script.location * ((Tez.t, Tez.t) pair option, 's, 'r, 'f) kinstr + -> (Tez.t, n num * 's, 'r, 'f) kinstr + | IEdiv_tez : + Script.location * ((n num, Tez.t) pair option, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + (* + Booleans + -------- + *) + | IOr : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | IAnd : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | IXor : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | INot : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, 's, 'r, 'f) kinstr + (* + Integers + -------- + *) + | IIs_nat : + Script.location * (n num option, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | INeg : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 's, 'r, 'f) kinstr + | IAbs_int : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IInt_nat : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (n num, 's, 'r, 'f) kinstr + | IAdd_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IAdd_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | ISub_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IMul_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IMul_nat : + Script.location * ('a num, 's, 'r, 'f) kinstr + -> (n num, 'a num * 's, 'r, 'f) kinstr + | IEdiv_int : + Script.location * ((z num, n num) pair option, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IEdiv_nat : + Script.location * (('a num, n num) pair option, 's, 'r, 'f) kinstr + -> (n num, 'a num * 's, 'r, 'f) kinstr + | ILsl_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | ILsr_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | IOr_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + (* Even though `IAnd_nat` and `IAnd_int_nat` could be merged into a single + instruction from both the type and behavior point of views, their gas costs + differ too much (see `cost_N_IAnd_nat` and `cost_N_IAnd_int_nat` in + `Michelson_v1_gas.Cost_of.Generated_costs`), so we keep them separated. *) + | IAnd_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | IAnd_int_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (z num, n num * 's, 'r, 'f) kinstr + | IXor_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | INot_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 's, 'r, 'f) kinstr + (* + Control + ------- + *) + | IIf : { + loc : Script.location; + branch_if_true : ('a, 's, 'b, 'u) kinstr; + branch_if_false : ('a, 's, 'b, 'u) kinstr; + k : ('b, 'u, 'r, 'f) kinstr; + } + -> (bool, 'a * 's, 'r, 'f) kinstr + | ILoop : + Script.location * ('a, 's, bool, 'a * 's) kinstr * ('a, 's, 'r, 'f) kinstr + -> (bool, 'a * 's, 'r, 'f) kinstr + | ILoop_left : + Script.location + * ('a, 's, ('a, 'b) union, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> (('a, 'b) union, 's, 'r, 'f) kinstr + | IDip : + Script.location + * ('b, 's, 'c, 't) kinstr + * ('a, _) ty option + * ('a, 'c * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IExec : + Script.location * ('b, 's) stack_ty option * ('b, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) lambda * 's, 'r, 'f) kinstr + | IApply : + Script.location * ('a, _) ty * (('b, 'c) lambda, 's, 'r, 'f) kinstr + -> ('a, ('a * 'b, 'c) lambda * 's, 'r, 'f) kinstr + | ILambda : + Script.location + * ('b, 'c) lambda + * (('b, 'c) lambda, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IFailwith : Script.location * ('a, _) ty -> ('a, 's, 'r, 'f) kinstr + (* + Comparison + ---------- + *) + | ICompare : + Script.location * 'a comparable_ty * (z num, 'b * 's, 'r, 'f) kinstr + -> ('a, 'a * ('b * 's), 'r, 'f) kinstr + (* + Comparators + ----------- + *) + | IEq : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | INeq : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | ILt : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IGt : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | ILe : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IGe : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + (* + Protocol + -------- + *) + | IAddress : + Script.location * (address, 's, 'r, 'f) kinstr + -> ('a typed_contract, 's, 'r, 'f) kinstr + | IContract : + Script.location + * ('a, _) ty + * Entrypoint.t + * ('a typed_contract option, 's, 'r, 'f) kinstr + -> (address, 's, 'r, 'f) kinstr + | IView : + Script.location + * ('a, 'b) view_signature + * ('c, 's) stack_ty option + * ('b option, 'c * 's, 'r, 'f) kinstr + -> ('a, address * ('c * 's), 'r, 'f) kinstr + | ITransfer_tokens : + Script.location * (operation, 's, 'r, 'f) kinstr + -> ('a, Tez.t * ('a typed_contract * 's), 'r, 'f) kinstr + | IImplicit_account : + Script.location * (unit typed_contract, 's, 'r, 'f) kinstr + -> (public_key_hash, 's, 'r, 'f) kinstr + | ICreate_contract : { + loc : Script.location; + storage_type : ('a, _) ty; + code : Script.expr; + k : (operation, address * ('c * 's), 'r, 'f) kinstr; + } + -> (public_key_hash option, Tez.t * ('a * ('c * 's)), 'r, 'f) kinstr + | ISet_delegate : + Script.location * (operation, 's, 'r, 'f) kinstr + -> (public_key_hash option, 's, 'r, 'f) kinstr + | INow : + Script.location * (Script_timestamp.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IMin_block_time : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IBalance : + Script.location * (Tez.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ILevel : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ICheck_signature : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (public_key, signature * (bytes * 's), 'r, 'f) kinstr + | IHash_key : + Script.location * (public_key_hash, 's, 'r, 'f) kinstr + -> (public_key, 's, 'r, 'f) kinstr + | IPack : + Script.location * ('a, _) ty * (bytes, 'b * 's, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IUnpack : + Script.location * ('a, _) ty * ('a option, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBlake2b : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha256 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha512 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISource : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISender : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISelf : + Script.location + * ('b, _) ty + * Entrypoint.t + * ('b typed_contract, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISelf_address : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IAmount : + Script.location * (Tez.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISapling_empty_state : + Script.location + * Sapling.Memo_size.t + * (Sapling.state, 'a * 's, 'b, 'f) kinstr + -> ('a, 's, 'b, 'f) kinstr + | ISapling_verify_update : + Script.location + * ((bytes, (z num, Sapling.state) pair) pair option, 's, 'r, 'f) kinstr + -> (Sapling.transaction, Sapling.state * 's, 'r, 'f) kinstr + | ISapling_verify_update_deprecated : + Script.location * ((z num, Sapling.state) pair option, 's, 'r, 'f) kinstr + -> (Sapling.Legacy.transaction, Sapling.state * 's, 'r, 'f) kinstr + | IDig : + Script.location + * int + * ('b, 'c * 't, 'c, 't, 'a, 's, 'd, 'u) stack_prefix_preservation_witness + * ('b, 'd * 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IDug : + Script.location + * int + * ('c, 't, 'a, 'c * 't, 'b, 's, 'd, 'u) stack_prefix_preservation_witness + * ('d, 'u, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IDipn : + Script.location + * int + * ('c, 't, 'd, 'v, 'a, 's, 'b, 'u) stack_prefix_preservation_witness + * ('c, 't, 'd, 'v) kinstr + * ('b, 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IDropn : + Script.location + * int + * ('b, 'u, 'b, 'u, 'a, 's, 'a, 's) stack_prefix_preservation_witness + * ('b, 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IChainId : + Script.location * (Script_chain_id.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | INever : Script.location -> (never, 's, 'r, 'f) kinstr + | IVoting_power : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (public_key_hash, 's, 'r, 'f) kinstr + | ITotal_voting_power : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IKeccak : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha3 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IAdd_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, Script_bls.G1.t * 's, 'r, 'f) kinstr + | IAdd_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, Script_bls.G2.t * 's, 'r, 'f) kinstr + | IAdd_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_z_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 'a num * 's, 'r, 'f) kinstr + | IMul_bls12_381_fr_z : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> ('a num, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IInt_bls12_381_fr : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 's, 'r, 'f) kinstr + | IPairing_check_bls12_381 : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ( (Script_bls.G1.t, Script_bls.G2.t) pair Script_list.t, + 's, + 'r, + 'f ) + kinstr + | IComb : + Script.location + * int + * ('a, 'b, 's, 'c, 'd, 't) comb_gadt_witness + * ('c, 'd * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IUncomb : + Script.location + * int + * ('a, 'b, 's, 'c, 'd, 't) uncomb_gadt_witness + * ('c, 'd * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IComb_get : + Script.location + * int + * ('t, 'v) comb_get_gadt_witness + * ('v, 'a * 's, 'r, 'f) kinstr + -> ('t, 'a * 's, 'r, 'f) kinstr + | IComb_set : + Script.location + * int + * ('a, 'b, 'c) comb_set_gadt_witness + * ('c, 'd * 's, 'r, 'f) kinstr + -> ('a, 'b * ('d * 's), 'r, 'f) kinstr + | IDup_n : + Script.location + * int + * ('a, 'b, 's, 't) dup_n_gadt_witness + * ('t, 'a * ('b * 's), 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | ITicket : + Script.location + * 'a comparable_ty option + * ('a ticket option, 's, 'r, 'f) kinstr + -> ('a, n num * 's, 'r, 'f) kinstr + | ITicket_deprecated : + Script.location * 'a comparable_ty option * ('a ticket, 's, 'r, 'f) kinstr + -> ('a, n num * 's, 'r, 'f) kinstr + | IRead_ticket : + Script.location + * 'a comparable_ty option + * (address * ('a * n num), 'a ticket * 's, 'r, 'f) kinstr + -> ('a ticket, 's, 'r, 'f) kinstr + | ISplit_ticket : + Script.location * (('a ticket * 'a ticket) option, 's, 'r, 'f) kinstr + -> ('a ticket, (n num * n num) * 's, 'r, 'f) kinstr + | IJoin_tickets : + Script.location * 'a comparable_ty * ('a ticket option, 's, 'r, 'f) kinstr + -> ('a ticket * 'a ticket, 's, 'r, 'f) kinstr + | IOpen_chest : + Script.location * ((bytes, bool) union, 's, 'r, 'f) kinstr + -> ( Script_timelock.chest_key, + Script_timelock.chest * (n num * 's), + 'r, + 'f ) + kinstr + | IEmit : { + loc : Script.location; + tag : Entrypoint.t; + ty : ('a, _) ty; + unparsed_ty : Script.expr; + k : (operation, 's, 'r, 'f) kinstr; + } + -> ('a, 's, 'r, 'f) kinstr + (* + Internal control instructions + ----------------------------- + *) + | IHalt : Script.location -> ('a, 's, 'a, 's) kinstr + | ILog : + Script.location + * ('a, 's) stack_ty + * logging_event + * logger + * ('a, 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + +and ('arg, 'ret) lambda = + | Lam : + ('arg, end_of_stack, 'ret, end_of_stack) kdescr * Script.node + -> ('arg, 'ret) lambda + | LamRec : + ('arg, ('arg, 'ret) lambda * end_of_stack, 'ret, end_of_stack) kdescr + * Script.node + -> ('arg, 'ret) lambda + +and 'arg typed_contract = + | Typed_implicit : public_key_hash -> unit typed_contract + | Typed_implicit_with_ticket : { + ticket_ty : ('arg ticket, _) ty; + destination : public_key_hash; + } + -> 'arg ticket typed_contract + | Typed_originated : { + arg_ty : ('arg, _) ty; + contract_hash : Contract_hash.t; + entrypoint : Entrypoint.t; + } + -> 'arg typed_contract + | Typed_tx_rollup : { + arg_ty : (('a ticket, tx_rollup_l2_address) pair, _) ty; + tx_rollup : Tx_rollup.t; + } + -> ('a ticket, tx_rollup_l2_address) pair typed_contract + | Typed_sc_rollup : { + arg_ty : ('arg, _) ty; + sc_rollup : Sc_rollup.t; + entrypoint : Entrypoint.t; + } + -> 'arg typed_contract + | Typed_zk_rollup : { + arg_ty : (('a ticket, bytes) pair, _) ty; + zk_rollup : Zk_rollup.t; + } + -> ('a ticket, bytes) pair typed_contract + +and (_, _, _, _) continuation = + | KNil : ('r, 'f, 'r, 'f) continuation + | KCons : + ('a, 's, 'b, 't) kinstr * ('b, 't, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + | KReturn : + 's * ('a, 's) stack_ty option * ('a, 's, 'r, 'f) continuation + -> ('a, end_of_stack, 'r, 'f) continuation + | KMap_head : + ('a -> 'b) * ('b, 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + | KUndip : + 'b * ('b, _) ty option * ('b, 'a * 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + | KLoop_in : + ('a, 's, bool, 'a * 's) kinstr * ('a, 's, 'r, 'f) continuation + -> (bool, 'a * 's, 'r, 'f) continuation + | KLoop_in_left : + ('a, 's, ('a, 'b) union, 's) kinstr * ('b, 's, 'r, 'f) continuation + -> (('a, 'b) union, 's, 'r, 'f) continuation + | KIter : + ('a, 'b * 's, 'b, 's) kinstr + * ('a, _) ty option + * 'a list + * ('b, 's, 'r, 'f) continuation + -> ('b, 's, 'r, 'f) continuation + | KList_enter_body : + ('a, 'c * 's, 'b, 'c * 's) kinstr + * 'a list + * 'b Script_list.t + * ('b Script_list.t, _) ty option + * int + * ('b Script_list.t, 'c * 's, 'r, 'f) continuation + -> ('c, 's, 'r, 'f) continuation + | KList_exit_body : + ('a, 'c * 's, 'b, 'c * 's) kinstr + * 'a list + * 'b Script_list.t + * ('b Script_list.t, _) ty option + * int + * ('b Script_list.t, 'c * 's, 'r, 'f) continuation + -> ('b, 'c * 's, 'r, 'f) continuation + | KMap_enter_body : + ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * ('a * 'b) list + * ('a, 'c) map + * (('a, 'c) map, _) ty option + * (('a, 'c) map, 'd * 's, 'r, 'f) continuation + -> ('d, 's, 'r, 'f) continuation + | KMap_exit_body : + ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * ('a * 'b) list + * ('a, 'c) map + * 'a + * (('a, 'c) map, _) ty option + * (('a, 'c) map, 'd * 's, 'r, 'f) continuation + -> ('c, 'd * 's, 'r, 'f) continuation + | KView_exit : + step_constants * ('a, 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + | KLog : + ('a, 's, 'r, 'f) continuation * ('a, 's) stack_ty * logger + -> ('a, 's, 'r, 'f) continuation + +and ('a, 's, 'b, 'f, 'c, 'u) logging_function = + ('a, 's, 'b, 'f) kinstr -> + context -> + Script.location -> + ('c, 'u) stack_ty -> + 'c * 'u -> + unit + +and execution_trace = (Script.location * Gas.Arith.fp * Script.expr list) list + +and logger = { + log_interp : 'a 's 'b 'f 'c 'u. ('a, 's, 'b, 'f, 'c, 'u) logging_function; + get_log : unit -> execution_trace option tzresult Lwt.t; + klog : 'a 's 'r 'f. ('a, 's, 'r, 'f) klog; + ilog : 'a 's 'b 't 'r 'f. ('a, 's, 'b, 't, 'r, 'f) ilog; + log_kinstr : 'a 'b 'c 'd. ('a, 'b, 'c, 'd) log_kinstr; +} + +and ('a, 's, 'r, 'f) klog = + logger -> + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's) stack_ty -> + ('a, 's, 'r, 'f) continuation -> + ('a, 's, 'r, 'f) continuation -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + +and ('a, 's, 'b, 't, 'r, 'f) ilog = + logger -> + logging_event -> + ('a, 's) stack_ty -> + ('a, 's, 'b, 't, 'r, 'f) step_type + +and ('a, 's, 'b, 't, 'r, 'f) step_type = + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's, 'b, 't) kinstr -> + ('b, 't, 'r, 'f) continuation -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + +and ('a, 'b, 'c, 'd) log_kinstr = + logger -> + ('a, 'b) stack_ty -> + ('a, 'b, 'c, 'd) kinstr -> + ('a, 'b, 'c, 'd) kinstr + +(* ---- Auxiliary types -----------------------------------------------------*) +and ('ty, 'comparable) ty = + | Unit_t : (unit, yes) ty + | Int_t : (z num, yes) ty + | Nat_t : (n num, yes) ty + | Signature_t : (signature, yes) ty + | String_t : (Script_string.t, yes) ty + | Bytes_t : (bytes, yes) ty + | Mutez_t : (Tez.t, yes) ty + | Key_hash_t : (public_key_hash, yes) ty + | Key_t : (public_key, yes) ty + | Timestamp_t : (Script_timestamp.t, yes) ty + | Address_t : (address, yes) ty + | Tx_rollup_l2_address_t : (tx_rollup_l2_address, yes) ty + | Bool_t : (bool, yes) ty + | Pair_t : + ('a, 'ac) ty + * ('b, 'bc) ty + * ('a, 'b) pair ty_metadata + * ('ac, 'bc, 'rc) dand + -> (('a, 'b) pair, 'rc) ty + | Union_t : + ('a, 'ac) ty + * ('b, 'bc) ty + * ('a, 'b) union ty_metadata + * ('ac, 'bc, 'rc) dand + -> (('a, 'b) union, 'rc) ty + | Lambda_t : + ('arg, _) ty * ('ret, _) ty * ('arg, 'ret) lambda ty_metadata + -> (('arg, 'ret) lambda, no) ty + | Option_t : + ('v, 'c) ty * 'v option ty_metadata * 'c dbool + -> ('v option, 'c) ty + | List_t : + ('v, _) ty * 'v Script_list.t ty_metadata + -> ('v Script_list.t, no) ty + | Set_t : 'v comparable_ty * 'v set ty_metadata -> ('v set, no) ty + | Map_t : + 'k comparable_ty * ('v, _) ty * ('k, 'v) map ty_metadata + -> (('k, 'v) map, no) ty + | Big_map_t : + 'k comparable_ty * ('v, _) ty * ('k, 'v) big_map ty_metadata + -> (('k, 'v) big_map, no) ty + | Contract_t : + ('arg, _) ty * 'arg typed_contract ty_metadata + -> ('arg typed_contract, no) ty + | Sapling_transaction_t : Sapling.Memo_size.t -> (Sapling.transaction, no) ty + | Sapling_transaction_deprecated_t : + Sapling.Memo_size.t + -> (Sapling.Legacy.transaction, no) ty + | Sapling_state_t : Sapling.Memo_size.t -> (Sapling.state, no) ty + | Operation_t : (operation, no) ty + | Chain_id_t : (Script_chain_id.t, yes) ty + | Never_t : (never, yes) ty + | Bls12_381_g1_t : (Script_bls.G1.t, no) ty + | Bls12_381_g2_t : (Script_bls.G2.t, no) ty + | Bls12_381_fr_t : (Script_bls.Fr.t, no) ty + | Ticket_t : 'a comparable_ty * 'a ticket ty_metadata -> ('a ticket, no) ty + | Chest_key_t : (Script_timelock.chest_key, no) ty + | Chest_t : (Script_timelock.chest, no) ty + +and 'ty comparable_ty = ('ty, yes) ty + +and ('top_ty, 'resty) stack_ty = + | Item_t : + ('ty, _) ty * ('ty2, 'rest) stack_ty + -> ('ty, 'ty2 * 'rest) stack_ty + | Bot_t : (empty_cell, empty_cell) stack_ty + +and ('key, 'value) big_map = + | Big_map : { + id : Big_map.Id.t option; + diff : ('key, 'value) big_map_overlay; + key_type : 'key comparable_ty; + value_type : ('value, _) ty; + } + -> ('key, 'value) big_map + +and ('a, 's, 'r, 'f) kdescr = { + kloc : Script.location; + kbef : ('a, 's) stack_ty; + kaft : ('r, 'f) stack_ty; + kinstr : ('a, 's, 'r, 'f) kinstr; +} + +and (_, _, _, _, _, _, _, _) stack_prefix_preservation_witness = + | KPrefix : + Script.location + * ('a, _) ty + * ('c, 'v, 'd, 'w, 'x, 's, 'y, 'u) stack_prefix_preservation_witness + -> ( 'c, + 'v, + 'd, + 'w, + 'a, + 'x * 's, + 'a, + 'y * 'u ) + stack_prefix_preservation_witness + | KRest : ('a, 's, 'b, 'u, 'a, 's, 'b, 'u) stack_prefix_preservation_witness + +and (_, _, _, _, _, _) comb_gadt_witness = + | Comb_one : ('a, 'x, 'before, 'a, 'x, 'before) comb_gadt_witness + | Comb_succ : + ('b, 'c, 's, 'd, 'e, 't) comb_gadt_witness + -> ('a, 'b, 'c * 's, 'a * 'd, 'e, 't) comb_gadt_witness + +and (_, _, _, _, _, _) uncomb_gadt_witness = + | Uncomb_one : ('a, 'x, 'before, 'a, 'x, 'before) uncomb_gadt_witness + | Uncomb_succ : + ('b, 'c, 's, 'd, 'e, 't) uncomb_gadt_witness + -> ('a * 'b, 'c, 's, 'a, 'd, 'e * 't) uncomb_gadt_witness + +and ('before, 'after) comb_get_gadt_witness = + | Comb_get_zero : ('b, 'b) comb_get_gadt_witness + | Comb_get_one : ('a * 'b, 'a) comb_get_gadt_witness + | Comb_get_plus_two : + ('before, 'after) comb_get_gadt_witness + -> ('a * 'before, 'after) comb_get_gadt_witness + +and ('value, 'before, 'after) comb_set_gadt_witness = + | Comb_set_zero : ('value, _, 'value) comb_set_gadt_witness + | Comb_set_one : ('value, 'hd * 'tl, 'value * 'tl) comb_set_gadt_witness + | Comb_set_plus_two : + ('value, 'before, 'after) comb_set_gadt_witness + -> ('value, 'a * 'before, 'a * 'after) comb_set_gadt_witness + +and (_, _, _, _) dup_n_gadt_witness = + | Dup_n_zero : ('a, _, _, 'a) dup_n_gadt_witness + | Dup_n_succ : + ('b, 'c, 'stack, 'd) dup_n_gadt_witness + -> ('a, 'b, 'c * 'stack, 'd) dup_n_gadt_witness + +and ('input, 'output) view_signature = + | View_signature : { + name : Script_string.t; + input_ty : ('input, _) ty; + output_ty : ('output, _) ty; + } + -> ('input, 'output) view_signature + +and 'kind internal_operation_contents = + | Transaction_to_implicit : { + destination : Signature.Public_key_hash.t; + amount : Tez.tez; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_implicit_with_ticket : { + destination : Signature.Public_key_hash.t; + ticket_ty : ('content ticket, _) ty; + ticket : 'content ticket; + unparsed_ticket : Script.lazy_expr; + amount : Tez.tez; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_smart_contract : { + destination : Contract_hash.t; + amount : Tez.tez; + entrypoint : Entrypoint.t; + location : Script.location; + parameters_ty : ('a, _) ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_tx_rollup : { + destination : Tx_rollup.t; + parameters_ty : (('a ticket, tx_rollup_l2_address) pair, _) ty; + parameters : ('a ticket, tx_rollup_l2_address) pair; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_sc_rollup : { + destination : Sc_rollup.t; + entrypoint : Entrypoint.t; + parameters_ty : ('a, _) ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Event : { + ty : Script.expr; + tag : Entrypoint.t; + unparsed_data : Script.expr; + } + -> Kind.event internal_operation_contents + | Transaction_to_zk_rollup : { + destination : Zk_rollup.t; + parameters_ty : (('a ticket, bytes) pair, _) ty; + parameters : ('a ticket, bytes) pair; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Origination : { + delegate : Signature.Public_key_hash.t option; + code : Script.expr; + unparsed_storage : Script.expr; + credit : Tez.tez; + preorigination : Contract_hash.t; + storage_type : ('storage, _) ty; + storage : 'storage; + } + -> Kind.origination internal_operation_contents + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation internal_operation_contents + +and 'kind internal_operation = { + source : Contract.t; + operation : 'kind internal_operation_contents; + nonce : int; +} + +and packed_internal_operation = + | Internal_operation : 'kind internal_operation -> packed_internal_operation +[@@ocaml.unboxed] + +and operation = { + piop : packed_internal_operation; + lazy_storage_diff : Lazy_storage.diffs option; +} + +type ex_ty = Ex_ty : ('a, _) ty -> ex_ty + +type ('arg, 'storage) script = + | Script : { + code : + (('arg, 'storage) pair, (operation Script_list.t, 'storage) pair) lambda; + arg_type : ('arg, _) ty; + storage : 'storage; + storage_type : ('storage, _) ty; + views : view_map; + entrypoints : 'arg entrypoints; + code_size : Cache_memory_helpers.sint; + (* This is an over-approximation of the value size in memory, in + bytes, of the contract's static part, that is its source + code. This includes the code of the contract as well as the code + of the views. The storage size is not taken into account by this + field as it has a dynamic size. *) + } + -> ('arg, 'storage) script + +let manager_kind : + type kind. kind internal_operation_contents -> kind Kind.manager = function + | Transaction_to_implicit _ -> Kind.Transaction_manager_kind + | Transaction_to_implicit_with_ticket _ -> Kind.Transaction_manager_kind + | Transaction_to_smart_contract _ -> Kind.Transaction_manager_kind + | Transaction_to_tx_rollup _ -> Kind.Transaction_manager_kind + | Transaction_to_sc_rollup _ -> Kind.Transaction_manager_kind + | Transaction_to_zk_rollup _ -> Kind.Transaction_manager_kind + | Event _ -> Kind.Event_manager_kind + | Origination _ -> Kind.Origination_manager_kind + | Delegation _ -> Kind.Delegation_manager_kind + +let kinstr_location : type a s b f. (a, s, b, f) kinstr -> Script.location = + fun i -> + match i with + | IDrop (loc, _) -> loc + | IDup (loc, _) -> loc + | ISwap (loc, _) -> loc + | IConst (loc, _, _, _) -> loc + | ICons_pair (loc, _) -> loc + | ICar (loc, _) -> loc + | ICdr (loc, _) -> loc + | IUnpair (loc, _) -> loc + | ICons_some (loc, _) -> loc + | ICons_none (loc, _, _) -> loc + | IIf_none {loc; _} -> loc + | IOpt_map {loc; _} -> loc + | ICons_left (loc, _, _) -> loc + | ICons_right (loc, _, _) -> loc + | IIf_left {loc; _} -> loc + | ICons_list (loc, _) -> loc + | INil (loc, _, _) -> loc + | IIf_cons {loc; _} -> loc + | IList_map (loc, _, _, _) -> loc + | IList_iter (loc, _, _, _) -> loc + | IList_size (loc, _) -> loc + | IEmpty_set (loc, _, _) -> loc + | ISet_iter (loc, _, _, _) -> loc + | ISet_mem (loc, _) -> loc + | ISet_update (loc, _) -> loc + | ISet_size (loc, _) -> loc + | IEmpty_map (loc, _, _, _) -> loc + | IMap_map (loc, _, _, _) -> loc + | IMap_iter (loc, _, _, _) -> loc + | IMap_mem (loc, _) -> loc + | IMap_get (loc, _) -> loc + | IMap_update (loc, _) -> loc + | IMap_get_and_update (loc, _) -> loc + | IMap_size (loc, _) -> loc + | IEmpty_big_map (loc, _, _, _) -> loc + | IBig_map_mem (loc, _) -> loc + | IBig_map_get (loc, _) -> loc + | IBig_map_update (loc, _) -> loc + | IBig_map_get_and_update (loc, _) -> loc + | IConcat_string (loc, _) -> loc + | IConcat_string_pair (loc, _) -> loc + | ISlice_string (loc, _) -> loc + | IString_size (loc, _) -> loc + | IConcat_bytes (loc, _) -> loc + | IConcat_bytes_pair (loc, _) -> loc + | ISlice_bytes (loc, _) -> loc + | IBytes_size (loc, _) -> loc + | ILsl_bytes (loc, _) -> loc + | ILsr_bytes (loc, _) -> loc + | IOr_bytes (loc, _) -> loc + | IAnd_bytes (loc, _) -> loc + | IXor_bytes (loc, _) -> loc + | INot_bytes (loc, _) -> loc + | INat_bytes (loc, _) -> loc + | IBytes_nat (loc, _) -> loc + | IInt_bytes (loc, _) -> loc + | IBytes_int (loc, _) -> loc + | IAdd_seconds_to_timestamp (loc, _) -> loc + | IAdd_timestamp_to_seconds (loc, _) -> loc + | ISub_timestamp_seconds (loc, _) -> loc + | IDiff_timestamps (loc, _) -> loc + | IAdd_tez (loc, _) -> loc + | ISub_tez (loc, _) -> loc + | ISub_tez_legacy (loc, _) -> loc + | IMul_teznat (loc, _) -> loc + | IMul_nattez (loc, _) -> loc + | IEdiv_teznat (loc, _) -> loc + | IEdiv_tez (loc, _) -> loc + | IOr (loc, _) -> loc + | IAnd (loc, _) -> loc + | IXor (loc, _) -> loc + | INot (loc, _) -> loc + | IIs_nat (loc, _) -> loc + | INeg (loc, _) -> loc + | IAbs_int (loc, _) -> loc + | IInt_nat (loc, _) -> loc + | IAdd_int (loc, _) -> loc + | IAdd_nat (loc, _) -> loc + | ISub_int (loc, _) -> loc + | IMul_int (loc, _) -> loc + | IMul_nat (loc, _) -> loc + | IEdiv_int (loc, _) -> loc + | IEdiv_nat (loc, _) -> loc + | ILsl_nat (loc, _) -> loc + | ILsr_nat (loc, _) -> loc + | IOr_nat (loc, _) -> loc + | IAnd_nat (loc, _) -> loc + | IAnd_int_nat (loc, _) -> loc + | IXor_nat (loc, _) -> loc + | INot_int (loc, _) -> loc + | IIf {loc; _} -> loc + | ILoop (loc, _, _) -> loc + | ILoop_left (loc, _, _) -> loc + | IDip (loc, _, _, _) -> loc + | IExec (loc, _, _) -> loc + | IApply (loc, _, _) -> loc + | ILambda (loc, _, _) -> loc + | IFailwith (loc, _) -> loc + | ICompare (loc, _, _) -> loc + | IEq (loc, _) -> loc + | INeq (loc, _) -> loc + | ILt (loc, _) -> loc + | IGt (loc, _) -> loc + | ILe (loc, _) -> loc + | IGe (loc, _) -> loc + | IAddress (loc, _) -> loc + | IContract (loc, _, _, _) -> loc + | ITransfer_tokens (loc, _) -> loc + | IView (loc, _, _, _) -> loc + | IImplicit_account (loc, _) -> loc + | ICreate_contract {loc; _} -> loc + | ISet_delegate (loc, _) -> loc + | INow (loc, _) -> loc + | IMin_block_time (loc, _) -> loc + | IBalance (loc, _) -> loc + | ILevel (loc, _) -> loc + | ICheck_signature (loc, _) -> loc + | IHash_key (loc, _) -> loc + | IPack (loc, _, _) -> loc + | IUnpack (loc, _, _) -> loc + | IBlake2b (loc, _) -> loc + | ISha256 (loc, _) -> loc + | ISha512 (loc, _) -> loc + | ISource (loc, _) -> loc + | ISender (loc, _) -> loc + | ISelf (loc, _, _, _) -> loc + | ISelf_address (loc, _) -> loc + | IAmount (loc, _) -> loc + | ISapling_empty_state (loc, _, _) -> loc + | ISapling_verify_update (loc, _) -> loc + | ISapling_verify_update_deprecated (loc, _) -> loc + | IDig (loc, _, _, _) -> loc + | IDug (loc, _, _, _) -> loc + | IDipn (loc, _, _, _, _) -> loc + | IDropn (loc, _, _, _) -> loc + | IChainId (loc, _) -> loc + | INever loc -> loc + | IVoting_power (loc, _) -> loc + | ITotal_voting_power (loc, _) -> loc + | IKeccak (loc, _) -> loc + | ISha3 (loc, _) -> loc + | IAdd_bls12_381_g1 (loc, _) -> loc + | IAdd_bls12_381_g2 (loc, _) -> loc + | IAdd_bls12_381_fr (loc, _) -> loc + | IMul_bls12_381_g1 (loc, _) -> loc + | IMul_bls12_381_g2 (loc, _) -> loc + | IMul_bls12_381_fr (loc, _) -> loc + | IMul_bls12_381_z_fr (loc, _) -> loc + | IMul_bls12_381_fr_z (loc, _) -> loc + | IInt_bls12_381_fr (loc, _) -> loc + | INeg_bls12_381_g1 (loc, _) -> loc + | INeg_bls12_381_g2 (loc, _) -> loc + | INeg_bls12_381_fr (loc, _) -> loc + | IPairing_check_bls12_381 (loc, _) -> loc + | IComb (loc, _, _, _) -> loc + | IUncomb (loc, _, _, _) -> loc + | IComb_get (loc, _, _, _) -> loc + | IComb_set (loc, _, _, _) -> loc + | IDup_n (loc, _, _, _) -> loc + | ITicket (loc, _, _) -> loc + | ITicket_deprecated (loc, _, _) -> loc + | IRead_ticket (loc, _, _) -> loc + | ISplit_ticket (loc, _) -> loc + | IJoin_tickets (loc, _, _) -> loc + | IOpen_chest (loc, _) -> loc + | IEmit {loc; _} -> loc + | IHalt loc -> loc + | ILog (loc, _, _, _, _) -> loc + +let meta_basic = {size = Type_size.one} + +let ty_metadata : type a ac. (a, ac) ty -> a ty_metadata = function + | Unit_t | Never_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t + | Mutez_t | Bool_t | Key_hash_t | Key_t | Timestamp_t | Chain_id_t | Address_t + | Tx_rollup_l2_address_t -> + meta_basic + | Pair_t (_, _, meta, _) -> meta + | Union_t (_, _, meta, _) -> meta + | Option_t (_, meta, _) -> meta + | Lambda_t (_, _, meta) -> meta + | List_t (_, meta) -> meta + | Set_t (_, meta) -> meta + | Map_t (_, _, meta) -> meta + | Big_map_t (_, _, meta) -> meta + | Ticket_t (_, meta) -> meta + | Contract_t (_, meta) -> meta + | Sapling_transaction_t _ | Sapling_transaction_deprecated_t _ + | Sapling_state_t _ | Operation_t | Bls12_381_g1_t | Bls12_381_g2_t + | Bls12_381_fr_t | Chest_t | Chest_key_t -> + meta_basic + +let ty_size t = (ty_metadata t).size + +let is_comparable : type v c. (v, c) ty -> c dbool = function + | Never_t -> Yes + | Unit_t -> Yes + | Int_t -> Yes + | Nat_t -> Yes + | Signature_t -> Yes + | String_t -> Yes + | Bytes_t -> Yes + | Mutez_t -> Yes + | Bool_t -> Yes + | Key_hash_t -> Yes + | Key_t -> Yes + | Timestamp_t -> Yes + | Chain_id_t -> Yes + | Address_t -> Yes + | Tx_rollup_l2_address_t -> Yes + | Pair_t (_, _, _, dand) -> dbool_of_dand dand + | Union_t (_, _, _, dand) -> dbool_of_dand dand + | Option_t (_, _, cmp) -> cmp + | Lambda_t _ -> No + | List_t _ -> No + | Set_t _ -> No + | Map_t _ -> No + | Big_map_t _ -> No + | Ticket_t _ -> No + | Contract_t _ -> No + | Sapling_transaction_t _ -> No + | Sapling_transaction_deprecated_t _ -> No + | Sapling_state_t _ -> No + | Operation_t -> No + | Bls12_381_g1_t -> No + | Bls12_381_g2_t -> No + | Bls12_381_fr_t -> No + | Chest_t -> No + | Chest_key_t -> No + +type 'v ty_ex_c = Ty_ex_c : ('v, _) ty -> 'v ty_ex_c [@@ocaml.unboxed] + +let unit_t = Unit_t + +let int_t = Int_t + +let nat_t = Nat_t + +let signature_t = Signature_t + +let string_t = String_t + +let bytes_t = Bytes_t + +let mutez_t = Mutez_t + +let key_hash_t = Key_hash_t + +let key_t = Key_t + +let timestamp_t = Timestamp_t + +let address_t = Address_t + +let bool_t = Bool_t + +let tx_rollup_l2_address_t = Tx_rollup_l2_address_t + +let pair_t : + type a ac b bc. + Script.location -> (a, ac) ty -> (b, bc) ty -> (a, b) pair ty_ex_c tzresult + = + fun loc l r -> + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + let (Ex_dand cmp) = dand (is_comparable l) (is_comparable r) in + Ty_ex_c (Pair_t (l, r, {size}, cmp)) + +let pair_3_t loc l m r = pair_t loc m r >>? fun (Ty_ex_c r) -> pair_t loc l r + +let comparable_pair_t loc l r = + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + Pair_t (l, r, {size}, YesYes) + +let comparable_pair_3_t loc l m r = + comparable_pair_t loc m r >>? fun r -> comparable_pair_t loc l r + +let union_t : + type a ac b bc. + Script.location -> (a, ac) ty -> (b, bc) ty -> (a, b) union ty_ex_c tzresult + = + fun loc l r -> + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + let (Ex_dand cmp) = dand (is_comparable l) (is_comparable r) in + Ty_ex_c (Union_t (l, r, {size}, cmp)) + +let union_bytes_bool_t = + Union_t (bytes_t, bool_t, {size = Type_size.three}, YesYes) + +let comparable_union_t loc l r = + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + Union_t (l, r, {size}, YesYes) + +let lambda_t loc l r = + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + Lambda_t (l, r, {size}) + +let option_t loc t = + Type_size.compound1 loc (ty_size t) >|? fun size -> + let cmp = is_comparable t in + Option_t (t, {size}, cmp) + +let option_mutez_t = Option_t (mutez_t, {size = Type_size.two}, Yes) + +let option_string_t = Option_t (string_t, {size = Type_size.two}, Yes) + +let option_bytes_t = Option_t (bytes_t, {size = Type_size.two}, Yes) + +let option_nat_t = Option_t (nat_t, {size = Type_size.two}, Yes) + +let option_pair_nat_nat_t = + Option_t + ( Pair_t (nat_t, nat_t, {size = Type_size.three}, YesYes), + {size = Type_size.four}, + Yes ) + +let option_pair_nat_mutez_t = + Option_t + ( Pair_t (nat_t, mutez_t, {size = Type_size.three}, YesYes), + {size = Type_size.four}, + Yes ) + +let option_pair_mutez_mutez_t = + Option_t + ( Pair_t (mutez_t, mutez_t, {size = Type_size.three}, YesYes), + {size = Type_size.four}, + Yes ) + +let option_pair_int_nat_t = + Option_t + ( Pair_t (int_t, nat_t, {size = Type_size.three}, YesYes), + {size = Type_size.four}, + Yes ) + +let list_t loc t = + Type_size.compound1 loc (ty_size t) >|? fun size -> List_t (t, {size}) + +let operation_t = Operation_t + +let list_operation_t = List_t (operation_t, {size = Type_size.two}) + +let set_t loc t = + Type_size.compound1 loc (ty_size t) >|? fun size -> Set_t (t, {size}) + +let map_t loc l r = + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + Map_t (l, r, {size}) + +let big_map_t loc l r = + Type_size.compound2 loc (ty_size l) (ty_size r) >|? fun size -> + Big_map_t (l, r, {size}) + +let contract_t loc t = + Type_size.compound1 loc (ty_size t) >|? fun size -> Contract_t (t, {size}) + +let contract_unit_t = Contract_t (unit_t, {size = Type_size.two}) + +let sapling_transaction_t ~memo_size = Sapling_transaction_t memo_size + +let sapling_transaction_deprecated_t ~memo_size = + Sapling_transaction_deprecated_t memo_size + +let sapling_state_t ~memo_size = Sapling_state_t memo_size + +let chain_id_t = Chain_id_t + +let never_t = Never_t + +let bls12_381_g1_t = Bls12_381_g1_t + +let bls12_381_g2_t = Bls12_381_g2_t + +let bls12_381_fr_t = Bls12_381_fr_t + +let ticket_t loc t = + Type_size.compound1 loc (ty_size t) >|? fun size -> Ticket_t (t, {size}) + +let chest_key_t = Chest_key_t + +let chest_t = Chest_t + +type 'a kinstr_traverse = { + apply : 'b 'u 'r 'f. 'a -> ('b, 'u, 'r, 'f) kinstr -> 'a; +} + +let kinstr_traverse i init f = + let rec aux : + type ret a s r f. 'accu -> (a, s, r, f) kinstr -> ('accu -> ret) -> ret = + fun accu t continue -> + let accu = f.apply accu t in + let next k = + (aux [@ocaml.tailcall]) accu k (fun accu -> + (continue [@ocaml.tailcall]) accu) + in + let next2 k1 k2 = + (aux [@ocaml.tailcall]) accu k1 (fun accu -> + (aux [@ocaml.tailcall]) accu k2 (fun accu -> + (continue [@ocaml.tailcall]) accu)) + in + let next3 k1 k2 k3 = + (aux [@ocaml.tailcall]) accu k1 (fun accu -> + (aux [@ocaml.tailcall]) accu k2 (fun accu -> + (aux [@ocaml.tailcall]) accu k3 (fun accu -> + (continue [@ocaml.tailcall]) accu))) + in + let return () = (continue [@ocaml.tailcall]) accu in + match t with + | IDrop (_, k) -> (next [@ocaml.tailcall]) k + | IDup (_, k) -> (next [@ocaml.tailcall]) k + | ISwap (_, k) -> (next [@ocaml.tailcall]) k + | IConst (_, _, _, k) -> (next [@ocaml.tailcall]) k + | ICons_pair (_, k) -> (next [@ocaml.tailcall]) k + | ICar (_, k) -> (next [@ocaml.tailcall]) k + | ICdr (_, k) -> (next [@ocaml.tailcall]) k + | IUnpair (_, k) -> (next [@ocaml.tailcall]) k + | ICons_some (_, k) -> (next [@ocaml.tailcall]) k + | ICons_none (_, _, k) -> (next [@ocaml.tailcall]) k + | IIf_none {loc = _; branch_if_none = k1; branch_if_some = k2; k} -> + (next3 [@ocaml.tailcall]) k1 k2 k + | IOpt_map {loc = _; body; k} -> (next2 [@ocaml.tailcall]) body k + | ICons_left (_, _, k) -> (next [@ocaml.tailcall]) k + | ICons_right (_, _, k) -> (next [@ocaml.tailcall]) k + | IIf_left {loc = _; branch_if_left = k1; branch_if_right = k2; k} -> + (next3 [@ocaml.tailcall]) k1 k2 k + | ICons_list (_, k) -> (next [@ocaml.tailcall]) k + | INil (_, _, k) -> (next [@ocaml.tailcall]) k + | IIf_cons {loc = _; branch_if_nil = k1; branch_if_cons = k2; k} -> + (next3 [@ocaml.tailcall]) k1 k2 k + | IList_map (_, k1, _, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IList_iter (_, _, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IList_size (_, k) -> (next [@ocaml.tailcall]) k + | IEmpty_set (_, _, k) -> (next [@ocaml.tailcall]) k + | ISet_iter (_, _, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | ISet_mem (_, k) -> (next [@ocaml.tailcall]) k + | ISet_update (_, k) -> (next [@ocaml.tailcall]) k + | ISet_size (_, k) -> (next [@ocaml.tailcall]) k + | IEmpty_map (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IMap_map (_, _, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IMap_iter (_, _, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IMap_mem (_, k) -> (next [@ocaml.tailcall]) k + | IMap_get (_, k) -> (next [@ocaml.tailcall]) k + | IMap_update (_, k) -> (next [@ocaml.tailcall]) k + | IMap_get_and_update (_, k) -> (next [@ocaml.tailcall]) k + | IMap_size (_, k) -> (next [@ocaml.tailcall]) k + | IEmpty_big_map (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IBig_map_mem (_, k) -> (next [@ocaml.tailcall]) k + | IBig_map_get (_, k) -> (next [@ocaml.tailcall]) k + | IBig_map_update (_, k) -> (next [@ocaml.tailcall]) k + | IBig_map_get_and_update (_, k) -> (next [@ocaml.tailcall]) k + | IConcat_string (_, k) -> (next [@ocaml.tailcall]) k + | IConcat_string_pair (_, k) -> (next [@ocaml.tailcall]) k + | ISlice_string (_, k) -> (next [@ocaml.tailcall]) k + | IString_size (_, k) -> (next [@ocaml.tailcall]) k + | IConcat_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IConcat_bytes_pair (_, k) -> (next [@ocaml.tailcall]) k + | ISlice_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IBytes_size (_, k) -> (next [@ocaml.tailcall]) k + | ILsl_bytes (_, k) -> (next [@ocaml.tailcall]) k + | ILsr_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IOr_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IAnd_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IXor_bytes (_, k) -> (next [@ocaml.tailcall]) k + | INot_bytes (_, k) -> (next [@ocaml.tailcall]) k + | INat_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IBytes_nat (_, k) -> (next [@ocaml.tailcall]) k + | IInt_bytes (_, k) -> (next [@ocaml.tailcall]) k + | IBytes_int (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_seconds_to_timestamp (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_timestamp_to_seconds (_, k) -> (next [@ocaml.tailcall]) k + | ISub_timestamp_seconds (_, k) -> (next [@ocaml.tailcall]) k + | IDiff_timestamps (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_tez (_, k) -> (next [@ocaml.tailcall]) k + | ISub_tez (_, k) -> (next [@ocaml.tailcall]) k + | ISub_tez_legacy (_, k) -> (next [@ocaml.tailcall]) k + | IMul_teznat (_, k) -> (next [@ocaml.tailcall]) k + | IMul_nattez (_, k) -> (next [@ocaml.tailcall]) k + | IEdiv_teznat (_, k) -> (next [@ocaml.tailcall]) k + | IEdiv_tez (_, k) -> (next [@ocaml.tailcall]) k + | IOr (_, k) -> (next [@ocaml.tailcall]) k + | IAnd (_, k) -> (next [@ocaml.tailcall]) k + | IXor (_, k) -> (next [@ocaml.tailcall]) k + | INot (_, k) -> (next [@ocaml.tailcall]) k + | IIs_nat (_, k) -> (next [@ocaml.tailcall]) k + | INeg (_, k) -> (next [@ocaml.tailcall]) k + | IAbs_int (_, k) -> (next [@ocaml.tailcall]) k + | IInt_nat (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_int (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_nat (_, k) -> (next [@ocaml.tailcall]) k + | ISub_int (_, k) -> (next [@ocaml.tailcall]) k + | IMul_int (_, k) -> (next [@ocaml.tailcall]) k + | IMul_nat (_, k) -> (next [@ocaml.tailcall]) k + | IEdiv_int (_, k) -> (next [@ocaml.tailcall]) k + | IEdiv_nat (_, k) -> (next [@ocaml.tailcall]) k + | ILsl_nat (_, k) -> (next [@ocaml.tailcall]) k + | ILsr_nat (_, k) -> (next [@ocaml.tailcall]) k + | IOr_nat (_, k) -> (next [@ocaml.tailcall]) k + | IAnd_nat (_, k) -> (next [@ocaml.tailcall]) k + | IAnd_int_nat (_, k) -> (next [@ocaml.tailcall]) k + | IXor_nat (_, k) -> (next [@ocaml.tailcall]) k + | INot_int (_, k) -> (next [@ocaml.tailcall]) k + | IIf {loc = _; branch_if_true = k1; branch_if_false = k2; k} -> + (next3 [@ocaml.tailcall]) k1 k2 k + | ILoop (_, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | ILoop_left (_, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IDip (_, k1, _, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IExec (_, _, k) -> (next [@ocaml.tailcall]) k + | IApply (_, _, k) -> (next [@ocaml.tailcall]) k + | ILambda (_, _, k) -> (next [@ocaml.tailcall]) k + | IFailwith (_, _) -> (return [@ocaml.tailcall]) () + | ICompare (_, _, k) -> (next [@ocaml.tailcall]) k + | IEq (_, k) -> (next [@ocaml.tailcall]) k + | INeq (_, k) -> (next [@ocaml.tailcall]) k + | ILt (_, k) -> (next [@ocaml.tailcall]) k + | IGt (_, k) -> (next [@ocaml.tailcall]) k + | ILe (_, k) -> (next [@ocaml.tailcall]) k + | IGe (_, k) -> (next [@ocaml.tailcall]) k + | IAddress (_, k) -> (next [@ocaml.tailcall]) k + | IContract (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IView (_, _, _, k) -> (next [@ocaml.tailcall]) k + | ITransfer_tokens (_, k) -> (next [@ocaml.tailcall]) k + | IImplicit_account (_, k) -> (next [@ocaml.tailcall]) k + | ICreate_contract {k; _} -> (next [@ocaml.tailcall]) k + | ISet_delegate (_, k) -> (next [@ocaml.tailcall]) k + | INow (_, k) -> (next [@ocaml.tailcall]) k + | IMin_block_time (_, k) -> (next [@ocaml.tailcall]) k + | IBalance (_, k) -> (next [@ocaml.tailcall]) k + | ILevel (_, k) -> (next [@ocaml.tailcall]) k + | ICheck_signature (_, k) -> (next [@ocaml.tailcall]) k + | IHash_key (_, k) -> (next [@ocaml.tailcall]) k + | IPack (_, _, k) -> (next [@ocaml.tailcall]) k + | IUnpack (_, _, k) -> (next [@ocaml.tailcall]) k + | IBlake2b (_, k) -> (next [@ocaml.tailcall]) k + | ISha256 (_, k) -> (next [@ocaml.tailcall]) k + | ISha512 (_, k) -> (next [@ocaml.tailcall]) k + | ISource (_, k) -> (next [@ocaml.tailcall]) k + | ISender (_, k) -> (next [@ocaml.tailcall]) k + | ISelf (_, _, _, k) -> (next [@ocaml.tailcall]) k + | ISelf_address (_, k) -> (next [@ocaml.tailcall]) k + | IAmount (_, k) -> (next [@ocaml.tailcall]) k + | ISapling_empty_state (_, _, k) -> (next [@ocaml.tailcall]) k + | ISapling_verify_update (_, k) -> (next [@ocaml.tailcall]) k + | ISapling_verify_update_deprecated (_, k) -> (next [@ocaml.tailcall]) k + | IDig (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IDug (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IDipn (_, _, _, k1, k2) -> (next2 [@ocaml.tailcall]) k1 k2 + | IDropn (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IChainId (_, k) -> (next [@ocaml.tailcall]) k + | INever _ -> (return [@ocaml.tailcall]) () + | IVoting_power (_, k) -> (next [@ocaml.tailcall]) k + | ITotal_voting_power (_, k) -> (next [@ocaml.tailcall]) k + | IKeccak (_, k) -> (next [@ocaml.tailcall]) k + | ISha3 (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_bls12_381_g1 (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_bls12_381_g2 (_, k) -> (next [@ocaml.tailcall]) k + | IAdd_bls12_381_fr (_, k) -> (next [@ocaml.tailcall]) k + | IMul_bls12_381_g1 (_, k) -> (next [@ocaml.tailcall]) k + | IMul_bls12_381_g2 (_, k) -> (next [@ocaml.tailcall]) k + | IMul_bls12_381_fr (_, k) -> (next [@ocaml.tailcall]) k + | IMul_bls12_381_z_fr (_, k) -> (next [@ocaml.tailcall]) k + | IMul_bls12_381_fr_z (_, k) -> (next [@ocaml.tailcall]) k + | IInt_bls12_381_fr (_, k) -> (next [@ocaml.tailcall]) k + | INeg_bls12_381_g1 (_, k) -> (next [@ocaml.tailcall]) k + | INeg_bls12_381_g2 (_, k) -> (next [@ocaml.tailcall]) k + | INeg_bls12_381_fr (_, k) -> (next [@ocaml.tailcall]) k + | IPairing_check_bls12_381 (_, k) -> (next [@ocaml.tailcall]) k + | IComb (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IUncomb (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IComb_get (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IComb_set (_, _, _, k) -> (next [@ocaml.tailcall]) k + | IDup_n (_, _, _, k) -> (next [@ocaml.tailcall]) k + | ITicket (_, _, k) -> (next [@ocaml.tailcall]) k + | ITicket_deprecated (_, _, k) -> (next [@ocaml.tailcall]) k + | IRead_ticket (_, _, k) -> (next [@ocaml.tailcall]) k + | ISplit_ticket (_, k) -> (next [@ocaml.tailcall]) k + | IJoin_tickets (_, _, k) -> (next [@ocaml.tailcall]) k + | IOpen_chest (_, k) -> (next [@ocaml.tailcall]) k + | IEmit {k; _} -> (next [@ocaml.tailcall]) k + | IHalt _ -> (return [@ocaml.tailcall]) () + | ILog (_, _, _, _, k) -> (next [@ocaml.tailcall]) k + in + aux init i (fun accu -> accu) + +type 'a ty_traverse = {apply : 't 'tc. 'a -> ('t, 'tc) ty -> 'a} + +let ty_traverse = + let rec aux : + type ret t tc accu. + accu ty_traverse -> accu -> (t, tc) ty -> (accu -> ret) -> ret = + fun f accu ty continue -> + let accu = f.apply accu ty in + match ty with + | Unit_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t | Mutez_t + | Key_hash_t | Key_t | Timestamp_t | Address_t | Tx_rollup_l2_address_t + | Bool_t | Sapling_transaction_t _ | Sapling_transaction_deprecated_t _ + | Sapling_state_t _ | Operation_t | Chain_id_t | Never_t | Bls12_381_g1_t + | Bls12_381_g2_t | Bls12_381_fr_t -> + (continue [@ocaml.tailcall]) accu + | Ticket_t (cty, _) -> aux f accu cty continue + | Chest_key_t | Chest_t -> (continue [@ocaml.tailcall]) accu + | Pair_t (ty1, ty2, _, _) -> + (next2 [@ocaml.tailcall]) f accu ty1 ty2 continue + | Union_t (ty1, ty2, _, _) -> + (next2 [@ocaml.tailcall]) f accu ty1 ty2 continue + | Lambda_t (ty1, ty2, _) -> + (next2 [@ocaml.tailcall]) f accu ty1 ty2 continue + | Option_t (ty1, _, _) -> (next [@ocaml.tailcall]) f accu ty1 continue + | List_t (ty1, _) -> (next [@ocaml.tailcall]) f accu ty1 continue + | Set_t (cty, _) -> (aux [@ocaml.tailcall]) f accu cty continue + | Map_t (cty, ty1, _) -> + (aux [@ocaml.tailcall]) f accu cty (fun accu -> + (next [@ocaml.tailcall]) f accu ty1 continue) + | Big_map_t (cty, ty1, _) -> + (aux [@ocaml.tailcall]) f accu cty (fun accu -> + (next [@ocaml.tailcall]) f accu ty1 continue) + | Contract_t (ty1, _) -> (next [@ocaml.tailcall]) f accu ty1 continue + and next2 : + type a ac b bc ret accu. + accu ty_traverse -> + accu -> + (a, ac) ty -> + (b, bc) ty -> + (accu -> ret) -> + ret = + fun f accu ty1 ty2 continue -> + (aux [@ocaml.tailcall]) f accu ty1 (fun accu -> + (aux [@ocaml.tailcall]) f accu ty2 (fun accu -> + (continue [@ocaml.tailcall]) accu)) + and next : + type a ac ret accu. + accu ty_traverse -> accu -> (a, ac) ty -> (accu -> ret) -> ret = + fun f accu ty1 continue -> + (aux [@ocaml.tailcall]) f accu ty1 (fun accu -> + (continue [@ocaml.tailcall]) accu) + in + fun ty init f -> aux f init ty (fun accu -> accu) + +type 'accu stack_ty_traverse = { + apply : 'ty 's. 'accu -> ('ty, 's) stack_ty -> 'accu; +} + +let stack_ty_traverse (type a t) (sty : (a, t) stack_ty) init f = + let rec aux : type b u. 'accu -> (b, u) stack_ty -> 'accu = + fun accu sty -> + match sty with + | Bot_t -> f.apply accu sty + | Item_t (_, sty') -> aux (f.apply accu sty) sty' + in + aux init sty + +type 'a value_traverse = {apply : 't 'tc. 'a -> ('t, 'tc) ty -> 't -> 'a} + +let value_traverse (type t tc) (ty : (t, tc) ty) (x : t) init f = + let rec aux : type ret t tc. 'accu -> (t, tc) ty -> t -> ('accu -> ret) -> ret + = + fun accu ty x continue -> + let accu = f.apply accu ty x in + let next2 ty1 ty2 x1 x2 = + (aux [@ocaml.tailcall]) accu ty1 x1 (fun accu -> + (aux [@ocaml.tailcall]) accu ty2 x2 (fun accu -> + (continue [@ocaml.tailcall]) accu)) + in + let next ty1 x1 = + (aux [@ocaml.tailcall]) accu ty1 x1 (fun accu -> + (continue [@ocaml.tailcall]) accu) + in + let return () = (continue [@ocaml.tailcall]) accu in + let rec on_list ty' accu = function + | [] -> (continue [@ocaml.tailcall]) accu + | x :: xs -> + (aux [@ocaml.tailcall]) accu ty' x (fun accu -> + (on_list [@ocaml.tailcall]) ty' accu xs) + in + match ty with + | Unit_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t | Mutez_t + | Key_hash_t | Key_t | Timestamp_t | Address_t | Tx_rollup_l2_address_t + | Bool_t | Sapling_transaction_t _ | Sapling_transaction_deprecated_t _ + | Sapling_state_t _ | Operation_t | Chain_id_t | Never_t | Bls12_381_g1_t + | Bls12_381_g2_t | Bls12_381_fr_t | Chest_key_t | Chest_t + | Lambda_t (_, _, _) -> + (return [@ocaml.tailcall]) () + | Pair_t (ty1, ty2, _, _) -> + (next2 [@ocaml.tailcall]) ty1 ty2 (fst x) (snd x) + | Union_t (ty1, ty2, _, _) -> ( + match x with + | L l -> (next [@ocaml.tailcall]) ty1 l + | R r -> (next [@ocaml.tailcall]) ty2 r) + | Option_t (ty, _, _) -> ( + match x with + | None -> return () + | Some v -> (next [@ocaml.tailcall]) ty v) + | Ticket_t (cty, _) -> (aux [@ocaml.tailcall]) accu cty x.contents continue + | List_t (ty', _) -> on_list ty' accu x.elements + | Map_t (kty, ty', _) -> + let (Map_tag (module M)) = x in + let bindings = M.OPS.fold (fun k v bs -> (k, v) :: bs) M.boxed [] in + on_bindings accu kty ty' continue bindings + | Set_t (ty', _) -> + let (Set_tag (module M)) = x in + let elements = M.OPS.fold (fun x s -> x :: s) M.boxed [] in + on_list ty' accu elements + | Big_map_t (_, _, _) -> + (* For big maps, there is no obvious recursion scheme so we + delegate this case to the client. *) + (return [@ocaml.tailcall]) () + | Contract_t (_, _) -> (return [@ocaml.tailcall]) () + and on_bindings : + type ret k v vc. + 'accu -> + k comparable_ty -> + (v, vc) ty -> + ('accu -> ret) -> + (k * v) list -> + ret = + fun accu kty ty' continue xs -> + match xs with + | [] -> (continue [@ocaml.tailcall]) accu + | (k, v) :: xs -> + (aux [@ocaml.tailcall]) accu kty k (fun accu -> + (aux [@ocaml.tailcall]) accu ty' v (fun accu -> + (on_bindings [@ocaml.tailcall]) accu kty ty' continue xs)) + in + aux init ty x (fun accu -> accu) + +let stack_top_ty : type a b s. (a, b * s) stack_ty -> a ty_ex_c = function + | Item_t (ty, _) -> Ty_ex_c ty + +module Typed_contract = struct + let destination : type a. a typed_contract -> Destination.t = function + | Typed_implicit pkh -> Destination.Contract (Implicit pkh) + | Typed_implicit_with_ticket {destination; _} -> + Destination.Contract (Implicit destination) + | Typed_originated {contract_hash; _} -> + Destination.Contract (Originated contract_hash) + | Typed_tx_rollup {tx_rollup; _} -> Destination.Tx_rollup tx_rollup + | Typed_sc_rollup {sc_rollup; _} -> Destination.Sc_rollup sc_rollup + | Typed_zk_rollup {zk_rollup; _} -> Destination.Zk_rollup zk_rollup + + let arg_ty : type a. a typed_contract -> a ty_ex_c = function + | Typed_implicit _ -> (Ty_ex_c Unit_t : a ty_ex_c) + | Typed_implicit_with_ticket {ticket_ty; _} -> Ty_ex_c ticket_ty + | Typed_originated {arg_ty; _} -> Ty_ex_c arg_ty + | Typed_tx_rollup {arg_ty; _} -> Ty_ex_c arg_ty + | Typed_sc_rollup {arg_ty; _} -> Ty_ex_c arg_ty + | Typed_zk_rollup {arg_ty; _} -> Ty_ex_c arg_ty + + let entrypoint : type a. a typed_contract -> Entrypoint.t = function + | Typed_implicit _ | Typed_implicit_with_ticket _ -> Entrypoint.default + | Typed_tx_rollup _ -> Entrypoint.deposit + | Typed_originated {entrypoint; _} | Typed_sc_rollup {entrypoint; _} -> + entrypoint + | Typed_zk_rollup _ -> Entrypoint.deposit + + module Internal_for_tests = struct + let typed_exn : + type a ac. + (a, ac) ty -> Destination.t -> Entrypoint.t -> a typed_contract = + fun arg_ty destination entrypoint -> + match (destination, arg_ty) with + | Contract (Implicit pkh), Unit_t -> Typed_implicit pkh + | Contract (Implicit _), _ -> + invalid_arg "Implicit contracts expect type unit" + | Contract (Originated contract_hash), _ -> + Typed_originated {arg_ty; contract_hash; entrypoint} + | Tx_rollup tx_rollup, Pair_t (Ticket_t _, Tx_rollup_l2_address_t, _, _) + -> + (Typed_tx_rollup {arg_ty; tx_rollup} : a typed_contract) + | Tx_rollup _, _ -> + invalid_arg + "Transaction rollups expect type (pair (ticket _) \ + tx_rollup_l2_address)" + | Sc_rollup sc_rollup, _ -> + Typed_sc_rollup {arg_ty; sc_rollup; entrypoint} + | Zk_rollup zk_rollup, Pair_t (Ticket_t _, Bytes_t, _, _) -> + (Typed_zk_rollup {arg_ty; zk_rollup} : a typed_contract) + | Zk_rollup _, _ -> + invalid_arg "ZK rollups expect type (pair (ticket _) bytes)" + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.mli b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.mli new file mode 100644 index 000000000000..fd231efccdc0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir.mli @@ -0,0 +1,1900 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_int +open Dependent_bool + +(* + + The step function of the interpreter is parametrized by a bunch of values called the step constants. + These values are indeed constants during the call of a smart contract with the notable exception of + the IView instruction which modifies `source`, `self`, and `amount` and the KView_exit continuation + which restores them. + ====================== + +*) +type step_constants = { + source : Contract.t; + (** The address calling this contract, as returned by SENDER. *) + payer : Signature.public_key_hash; + (** The address of the implicit account that initiated the chain of contract calls, as returned by SOURCE. *) + self : Contract_hash.t; + (** The address of the contract being executed, as returned by SELF and SELF_ADDRESS. + Also used: + - as ticketer in TICKET + - as caller in VIEW, TRANSFER_TOKENS, and CREATE_CONTRACT *) + amount : Tez.t; + (** The amount of the current transaction, as returned by AMOUNT. *) + balance : Tez.t; (** The balance of the contract as returned by BALANCE. *) + chain_id : Chain_id.t; + (** The chain id of the chain, as returned by CHAIN_ID. *) + now : Script_timestamp.t; + (** The earliest time at which the current block could have been timestamped, as returned by NOW. *) + level : Script_int.n Script_int.num; + (** The level of the current block, as returned by LEVEL. *) +} + +(* Preliminary definitions. *) + +type never = | + +type address = {destination : Destination.t; entrypoint : Entrypoint.t} + +module Script_signature : sig + (** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type t = Signature_tag of signature [@@ocaml.unboxed] + + val make : signature -> t + + val get : t -> signature + + val encoding : t Data_encoding.t + + val of_b58check_opt : string -> t option + + val check : + ?watermark:Signature.watermark -> + Signature.Public_key.t -> + t -> + Bytes.t -> + bool + + val compare : t -> t -> int + + val size : t -> int +end + +type signature = Script_signature.t + +type tx_rollup_l2_address = Tx_rollup_l2_address.Indexable.value + +type ('a, 'b) pair = 'a * 'b + +type ('a, 'b) union = L of 'a | R of 'b + +module Script_chain_id : sig + (** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type t = Chain_id_tag of Chain_id.t [@@ocaml.unboxed] + + val make : Chain_id.t -> t + + val compare : t -> t -> int + + val size : int + + val encoding : t Data_encoding.t + + val to_b58check : t -> string + + val of_b58check_opt : string -> t option +end + +module Script_bls : sig + module type S = sig + type t + + type fr + + val add : t -> t -> t + + val mul : t -> fr -> t + + val negate : t -> t + + val of_bytes_opt : Bytes.t -> t option + + val to_bytes : t -> Bytes.t + end + + module Fr : sig + (** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type t = Fr_tag of Bls.Primitive.Fr.t [@@ocaml.unboxed] + + include S with type t := t and type fr := t + + val of_z : Z.t -> t + + val to_z : t -> Z.t + end + + module G1 : sig + (** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type t = G1_tag of Bls.Primitive.G1.t [@@ocaml.unboxed] + + include S with type t := t and type fr := Fr.t + end + + module G2 : sig + (** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type t = G2_tag of Bls.Primitive.G2.t [@@ocaml.unboxed] + + include S with type t := t and type fr := Fr.t + end + + val pairing_check : (G1.t * G2.t) list -> bool +end + +module Script_timelock : sig + (** [chest_key] is made algebraic in order to distinguish it from the other + type parameters of [Script_typed_ir.ty]. *) + type chest_key = Chest_key_tag of Timelock.chest_key [@@ocaml.unboxed] + + val make_chest_key : Timelock.chest_key -> chest_key + + val chest_key_encoding : chest_key Data_encoding.t + + (** [chest] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) + type chest = Chest_tag of Timelock.chest [@@ocaml.unboxed] + + val make_chest : Timelock.chest -> chest + + val chest_encoding : chest Data_encoding.t + + val open_chest : chest -> chest_key -> time:int -> Timelock.opening_result + + val get_plaintext_size : chest -> int +end + +type ticket_amount = Ticket_amount.t + +type 'a ticket = {ticketer : Contract.t; contents : 'a; amount : ticket_amount} + +type empty_cell = EmptyCell + +type end_of_stack = empty_cell * empty_cell + +module Type_size : sig + type 'a t + + val check_eq : + error_details:('error_context, 'error_trace) Script_tc_errors.error_details -> + 'a t -> + 'b t -> + (unit, 'error_trace) result + + val to_int : 'a t -> Saturation_repr.mul_safe Saturation_repr.t +end + +type 'a ty_metadata = {size : 'a Type_size.t} [@@unboxed] + +module type Boxed_set_OPS = sig + type t + + type elt + + val elt_size : elt -> int (* Gas_input_size.t *) + + val empty : t + + val add : elt -> t -> t + + val mem : elt -> t -> bool + + val remove : elt -> t -> t + + val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a +end + +module type Boxed_set = sig + type elt + + module OPS : Boxed_set_OPS with type elt = elt + + val boxed : OPS.t + + val size : int +end + +(** [set] is made algebraic in order to distinguish it from the other type + parameters of [ty]. *) +type 'elt set = Set_tag of (module Boxed_set with type elt = 'elt) +[@@ocaml.unboxed] + +module type Boxed_map_OPS = sig + type 'a t + + type key + + val key_size : key -> int (* Gas_input_size.t *) + + val empty : 'value t + + val add : key -> 'value -> 'value t -> 'value t + + val remove : key -> 'value t -> 'value t + + val find : key -> 'value t -> 'value option + + val fold : (key -> 'value -> 'a -> 'a) -> 'value t -> 'a -> 'a + + val fold_es : + (key -> 'value -> 'a -> 'a tzresult Lwt.t) -> + 'value t -> + 'a -> + 'a tzresult Lwt.t +end + +module type Boxed_map = sig + type key + + type value + + module OPS : Boxed_map_OPS with type key = key + + val boxed : value OPS.t + + val size : int +end + +(** [map] is made algebraic in order to distinguish it from the other type + parameters of [ty]. *) +type ('key, 'value) map = + | Map_tag of (module Boxed_map with type key = 'key and type value = 'value) +[@@ocaml.unboxed] + +module Big_map_overlay : Map.S with type key = Script_expr_hash.t + +type ('key, 'value) big_map_overlay = { + map : ('key * 'value option) Big_map_overlay.t; + size : int; +} + +type view = { + input_ty : Script.node; + output_ty : Script.node; + view_code : Script.node; +} + +type view_map = (Script_string.t, view) map + +type entrypoint_info = {name : Entrypoint.t; original_type_expr : Script.node} + +(** ['arg entrypoints] represents the tree of entrypoints of a parameter type + ['arg]. + [at_node] are entrypoint details at that node if it is not [None]. + [nested] are the entrypoints below the node in the tree. + It is always [Entrypoints_None] for non-union nodes. + But it is also ok to have [Entrypoints_None] for a union node, it just + means that there are no entrypoints below that node in the tree. +*) +type 'arg entrypoints_node = { + at_node : entrypoint_info option; + nested : 'arg nested_entrypoints; +} + +and 'arg nested_entrypoints = + | Entrypoints_Union : { + left : 'l entrypoints_node; + right : 'r entrypoints_node; + } + -> ('l, 'r) union nested_entrypoints + | Entrypoints_None : _ nested_entrypoints + +(** [no_entrypoints] is [{at_node = None; nested = Entrypoints_None}] *) +val no_entrypoints : _ entrypoints_node + +type logging_event = LogEntry | LogExit of Script.location + +type 'arg entrypoints = { + root : 'arg entrypoints_node; + original_type_expr : Script.node; +} + +(* ---- Instructions --------------------------------------------------------*) + +(* + + The instructions of Michelson are represented in the following + Generalized Algebraic Datatypes. + + There are three important aspects in that type declaration. + + First, we follow a tagless approach for values: they are directly + represented as OCaml values. This reduces the computational cost of + interpretation because there is no need to check the shape of a + value before applying an operation to it. To achieve that, the GADT + encodes the typing rules of the Michelson programming + language. This static information is sufficient for the typechecker + to justify the absence of runtime checks. As a bonus, it also + ensures that well-typed Michelson programs cannot go wrong: if the + interpreter typechecks then we have the static guarantee that no + stack underflow or type error can occur at runtime. + + Second, we maintain the invariant that the stack type always has a + distinguished topmost element. This invariant is important to + implement the stack as an accumulator followed by a linked list of + cells, a so-called A-Stack. This representation is considered in + the literature[1] as an efficient representation of the stack for a + stack-based abstract machine, mainly because this opens the + opportunity for the accumulator to be stored in a hardware + register. In the GADT, this invariant is encoded by representing + the stack type using two parameters instead of one: the first one + is the type of the accumulator while the second is the type of the + rest of the stack. + + Third, in this representation, each instruction embeds its + potential successor instructions in the control flow. This design + choice permits an efficient implementation of the continuation + stack in the interpreter. Assigning a precise type to this kind of + instruction which is a cell in a linked list of instructions is + similar to the typing of delimited continuations: we need to give a + type to the stack ['before] the execution of the instruction, a + type to the stack ['after] the execution of the instruction and + before the execution of the next, and a type for the [`result]ing + stack type after the execution of the whole chain of instructions. + + Combining these three aspects, the type [kinstr] needs four + parameters: + + ('before_top, 'before, 'result_top, 'result) kinstr + + Notice that we could have chosen to only give two parameters to + [kinstr] by manually enforcing each argument to be a pair but this + is error-prone: with four parameters, this constraint is enforced + by the arity of the type constructor itself. + + Hence, an instruction which has a successor instruction enjoys a + type of the form: + + ... * ('after_top, 'after, 'result_top, 'result) kinstr * ... -> + ('before_top, 'before, 'result_top, 'result) kinstr + + where ['before_top] and ['before] are the types of the stack top + and rest before the instruction chain, ['after_top] and ['after] + are the types of the stack top and rest after the instruction + chain, and ['result_top] and ['result] are the types of the stack + top and rest after the instruction chain. The [IHalt] instruction + ends a sequence of instructions and has no successor, as shown by + its type: + + IHalt : Script.location -> ('a, 's, 'a, 's) kinstr + + Each instruction is decorated by its location: its value is only + used for logging and error reporting and has no impact on the + operational semantics. + + Notations: + ---------- + + In the following declaration, we use 'a, 'b, 'c, 'd, ... to assign + types to stack cell contents while we use 's, 't, 'u, 'v, ... to + assign types to stacks. + + The types for the final result and stack rest of a whole sequence + of instructions are written 'r and 'f (standing for "result" and + "final stack rest", respectively). + + Instructions for internal execution steps + ========================================= + + Some instructions encoded in the following type are not present in the + source language. They only appear during evaluation to account for + intermediate execution steps. Indeed, since the interpreter follows + a small-step style, it is sometimes necessary to decompose a + source-level instruction (e.g. List_map) into several instructions + with smaller steps. This technique seems required to get an + efficient tail-recursive interpreter. + + References + ========== + [1]: http://www.complang.tuwien.ac.at/projects/interpreters.html + + *) +and ('before_top, 'before, 'result_top, 'result) kinstr = + (* + Stack + ----- + *) + | IDrop : + Script.location * ('b, 's, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IDup : + Script.location * ('a, 'a * ('b * 's), 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | ISwap : + Script.location * ('b, 'a * ('c * 's), 'r, 'f) kinstr + -> ('a, 'b * ('c * 's), 'r, 'f) kinstr + | IConst : + Script.location * ('ty, _) ty * 'ty * ('ty, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + (* + Pairs + ----- + *) + | ICons_pair : + Script.location * ('a * 'b, 'c * 's, 'r, 'f) kinstr + -> ('a, 'b * ('c * 's), 'r, 'f) kinstr + | ICar : + Script.location * ('a, 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + | ICdr : + Script.location * ('b, 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + | IUnpair : + Script.location * ('a, 'b * 's, 'r, 'f) kinstr + -> ('a * 'b, 's, 'r, 'f) kinstr + (* + Options + ------- + *) + | ICons_some : + Script.location * ('v option, 'a * 's, 'r, 'f) kinstr + -> ('v, 'a * 's, 'r, 'f) kinstr + | ICons_none : + Script.location * ('b, _) ty * ('b option, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IIf_none : { + loc : Script.location; + branch_if_none : ('b, 's, 'c, 't) kinstr; + branch_if_some : ('a, 'b * 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> ('a option, 'b * 's, 'r, 'f) kinstr + | IOpt_map : { + loc : Script.location; + body : ('a, 's, 'b, 's) kinstr; + k : ('b option, 's, 'c, 't) kinstr; + } + -> ('a option, 's, 'c, 't) kinstr + (* + Unions + ------ + *) + | ICons_left : + Script.location * ('b, _) ty * (('a, 'b) union, 'c * 's, 'r, 'f) kinstr + -> ('a, 'c * 's, 'r, 'f) kinstr + | ICons_right : + Script.location * ('a, _) ty * (('a, 'b) union, 'c * 's, 'r, 'f) kinstr + -> ('b, 'c * 's, 'r, 'f) kinstr + | IIf_left : { + loc : Script.location; + branch_if_left : ('a, 's, 'c, 't) kinstr; + branch_if_right : ('b, 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> (('a, 'b) union, 's, 'r, 'f) kinstr + (* + Lists + ----- + *) + | ICons_list : + Script.location * ('a Script_list.t, 's, 'r, 'f) kinstr + -> ('a, 'a Script_list.t * 's, 'r, 'f) kinstr + | INil : + Script.location * ('b, _) ty * ('b Script_list.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IIf_cons : { + loc : Script.location; + branch_if_cons : ('a, 'a Script_list.t * ('b * 's), 'c, 't) kinstr; + branch_if_nil : ('b, 's, 'c, 't) kinstr; + k : ('c, 't, 'r, 'f) kinstr; + } + -> ('a Script_list.t, 'b * 's, 'r, 'f) kinstr + | IList_map : + Script.location + * ('a, 'c * 's, 'b, 'c * 's) kinstr + * ('b Script_list.t, _) ty option + * ('b Script_list.t, 'c * 's, 'r, 'f) kinstr + -> ('a Script_list.t, 'c * 's, 'r, 'f) kinstr + | IList_iter : + Script.location + * ('a, _) ty option + * ('a, 'b * 's, 'b, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> ('a Script_list.t, 'b * 's, 'r, 'f) kinstr + | IList_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> ('a Script_list.t, 's, 'r, 'f) kinstr + (* + Sets + ---- + *) + | IEmpty_set : + Script.location * 'b comparable_ty * ('b set, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISet_iter : + Script.location + * 'a comparable_ty option + * ('a, 'b * 's, 'b, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> ('a set, 'b * 's, 'r, 'f) kinstr + | ISet_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, 'a set * 's, 'r, 'f) kinstr + | ISet_update : + Script.location * ('a set, 's, 'r, 'f) kinstr + -> ('a, bool * ('a set * 's), 'r, 'f) kinstr + | ISet_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> ('a set, 's, 'r, 'f) kinstr + (* + Maps + ---- + *) + | IEmpty_map : + Script.location + * 'b comparable_ty + * ('c, _) ty option + * (('b, 'c) map, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IMap_map : + Script.location + * (('a, 'c) map, _) ty option + * ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * (('a, 'c) map, 'd * 's, 'r, 'f) kinstr + -> (('a, 'b) map, 'd * 's, 'r, 'f) kinstr + | IMap_iter : + Script.location + * ('a * 'b, _) ty option + * ('a * 'b, 'c * 's, 'c, 's) kinstr + * ('c, 's, 'r, 'f) kinstr + -> (('a, 'b) map, 'c * 's, 'r, 'f) kinstr + | IMap_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) map * 's, 'r, 'f) kinstr + | IMap_get : + Script.location * ('b option, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) map * 's, 'r, 'f) kinstr + | IMap_update : + Script.location * (('a, 'b) map, 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) map * 's), 'r, 'f) kinstr + | IMap_get_and_update : + Script.location * ('b option, ('a, 'b) map * 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) map * 's), 'r, 'f) kinstr + | IMap_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (('a, 'b) map, 's, 'r, 'f) kinstr + (* + Big maps + -------- + *) + | IEmpty_big_map : + Script.location + * 'b comparable_ty + * ('c, _) ty + * (('b, 'c) big_map, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IBig_map_mem : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) big_map * 's, 'r, 'f) kinstr + | IBig_map_get : + Script.location * ('b option, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) big_map * 's, 'r, 'f) kinstr + | IBig_map_update : + Script.location * (('a, 'b) big_map, 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) big_map * 's), 'r, 'f) kinstr + | IBig_map_get_and_update : + Script.location * ('b option, ('a, 'b) big_map * 's, 'r, 'f) kinstr + -> ('a, 'b option * (('a, 'b) big_map * 's), 'r, 'f) kinstr + (* + Strings + ------- + *) + | IConcat_string : + Script.location * (Script_string.t, 's, 'r, 'f) kinstr + -> (Script_string.t Script_list.t, 's, 'r, 'f) kinstr + | IConcat_string_pair : + Script.location * (Script_string.t, 's, 'r, 'f) kinstr + -> (Script_string.t, Script_string.t * 's, 'r, 'f) kinstr + | ISlice_string : + Script.location * (Script_string.t option, 's, 'r, 'f) kinstr + -> (n num, n num * (Script_string.t * 's), 'r, 'f) kinstr + | IString_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (Script_string.t, 's, 'r, 'f) kinstr + (* + Bytes + ----- + *) + | IConcat_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes Script_list.t, 's, 'r, 'f) kinstr + | IConcat_bytes_pair : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | ISlice_bytes : + Script.location * (bytes option, 's, 'r, 'f) kinstr + -> (n num, n num * (bytes * 's), 'r, 'f) kinstr + | IBytes_size : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ILsl_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, n num * 's, 'r, 'f) kinstr + | ILsr_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, n num * 's, 'r, 'f) kinstr + | IOr_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | IAnd_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | IXor_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, bytes * 's, 'r, 'f) kinstr + | INot_bytes : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | INat_bytes : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBytes_nat : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (n num, 's, 'r, 'f) kinstr + | IInt_bytes : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBytes_int : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + (* + Timestamps + ---------- + *) + | IAdd_seconds_to_timestamp : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (z num, Script_timestamp.t * 's, 'r, 'f) kinstr + | IAdd_timestamp_to_seconds : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, z num * 's, 'r, 'f) kinstr + | ISub_timestamp_seconds : + Script.location * (Script_timestamp.t, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, z num * 's, 'r, 'f) kinstr + | IDiff_timestamps : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (Script_timestamp.t, Script_timestamp.t * 's, 'r, 'f) kinstr + (* + Tez + --- + *) + | IAdd_tez : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | ISub_tez : + Script.location * (Tez.t option, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | ISub_tez_legacy : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + | IMul_teznat : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (Tez.t, n num * 's, 'r, 'f) kinstr + | IMul_nattez : + Script.location * (Tez.t, 's, 'r, 'f) kinstr + -> (n num, Tez.t * 's, 'r, 'f) kinstr + | IEdiv_teznat : + Script.location * ((Tez.t, Tez.t) pair option, 's, 'r, 'f) kinstr + -> (Tez.t, n num * 's, 'r, 'f) kinstr + | IEdiv_tez : + Script.location * ((n num, Tez.t) pair option, 's, 'r, 'f) kinstr + -> (Tez.t, Tez.t * 's, 'r, 'f) kinstr + (* + Booleans + -------- + *) + | IOr : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | IAnd : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | IXor : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, bool * 's, 'r, 'f) kinstr + | INot : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (bool, 's, 'r, 'f) kinstr + (* + Integers + -------- + *) + | IIs_nat : + Script.location * (n num option, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | INeg : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 's, 'r, 'f) kinstr + | IAbs_int : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IInt_nat : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (n num, 's, 'r, 'f) kinstr + | IAdd_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IAdd_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | ISub_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IMul_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IMul_nat : + Script.location * ('a num, 's, 'r, 'f) kinstr + -> (n num, 'a num * 's, 'r, 'f) kinstr + | IEdiv_int : + Script.location * ((z num, n num) pair option, 's, 'r, 'f) kinstr + -> ('a num, 'b num * 's, 'r, 'f) kinstr + | IEdiv_nat : + Script.location * (('a num, n num) pair option, 's, 'r, 'f) kinstr + -> (n num, 'a num * 's, 'r, 'f) kinstr + | ILsl_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | ILsr_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | IOr_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | IAnd_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | IAnd_int_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (z num, n num * 's, 'r, 'f) kinstr + | IXor_nat : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (n num, n num * 's, 'r, 'f) kinstr + | INot_int : + Script.location * (z num, 's, 'r, 'f) kinstr + -> ('a num, 's, 'r, 'f) kinstr + (* + Control + ------- + *) + | IIf : { + loc : Script.location; + branch_if_true : ('a, 's, 'b, 'u) kinstr; + branch_if_false : ('a, 's, 'b, 'u) kinstr; + k : ('b, 'u, 'r, 'f) kinstr; + } + -> (bool, 'a * 's, 'r, 'f) kinstr + | ILoop : + Script.location * ('a, 's, bool, 'a * 's) kinstr * ('a, 's, 'r, 'f) kinstr + -> (bool, 'a * 's, 'r, 'f) kinstr + | ILoop_left : + Script.location + * ('a, 's, ('a, 'b) union, 's) kinstr + * ('b, 's, 'r, 'f) kinstr + -> (('a, 'b) union, 's, 'r, 'f) kinstr + | IDip : + Script.location + * ('b, 's, 'c, 't) kinstr + * ('a, _) ty option + * ('a, 'c * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IExec : + Script.location * ('b, 's) stack_ty option * ('b, 's, 'r, 'f) kinstr + -> ('a, ('a, 'b) lambda * 's, 'r, 'f) kinstr + | IApply : + Script.location * ('a, _) ty * (('b, 'c) lambda, 's, 'r, 'f) kinstr + -> ('a, ('a * 'b, 'c) lambda * 's, 'r, 'f) kinstr + | ILambda : + Script.location + * ('b, 'c) lambda + * (('b, 'c) lambda, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IFailwith : Script.location * ('a, _) ty -> ('a, 's, 'r, 'f) kinstr + (* + Comparison + ---------- + *) + | ICompare : + Script.location * 'a comparable_ty * (z num, 'b * 's, 'r, 'f) kinstr + -> ('a, 'a * ('b * 's), 'r, 'f) kinstr + (* + Comparators + ----------- + *) + | IEq : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | INeq : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | ILt : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IGt : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | ILe : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + | IGe : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (z num, 's, 'r, 'f) kinstr + (* + Protocol + -------- + *) + | IAddress : + Script.location * (address, 's, 'r, 'f) kinstr + -> ('a typed_contract, 's, 'r, 'f) kinstr + | IContract : + Script.location + * ('a, _) ty + * Entrypoint.t + * ('a typed_contract option, 's, 'r, 'f) kinstr + -> (address, 's, 'r, 'f) kinstr + | IView : + Script.location + * ('a, 'b) view_signature + * ('c, 's) stack_ty option + * ('b option, 'c * 's, 'r, 'f) kinstr + -> ('a, address * ('c * 's), 'r, 'f) kinstr + | ITransfer_tokens : + Script.location * (operation, 's, 'r, 'f) kinstr + -> ('a, Tez.t * ('a typed_contract * 's), 'r, 'f) kinstr + | IImplicit_account : + Script.location * (unit typed_contract, 's, 'r, 'f) kinstr + -> (public_key_hash, 's, 'r, 'f) kinstr + | ICreate_contract : { + loc : Script.location; + storage_type : ('a, _) ty; + code : Script.expr; + k : (operation, address * ('c * 's), 'r, 'f) kinstr; + } + -> (public_key_hash option, Tez.t * ('a * ('c * 's)), 'r, 'f) kinstr + | ISet_delegate : + Script.location * (operation, 's, 'r, 'f) kinstr + -> (public_key_hash option, 's, 'r, 'f) kinstr + | INow : + Script.location * (Script_timestamp.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IMin_block_time : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IBalance : + Script.location * (Tez.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ILevel : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ICheck_signature : + Script.location * (bool, 's, 'r, 'f) kinstr + -> (public_key, signature * (bytes * 's), 'r, 'f) kinstr + | IHash_key : + Script.location * (public_key_hash, 's, 'r, 'f) kinstr + -> (public_key, 's, 'r, 'f) kinstr + | IPack : + Script.location * ('a, _) ty * (bytes, 'b * 's, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IUnpack : + Script.location * ('a, _) ty * ('a option, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IBlake2b : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha256 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha512 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISource : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISender : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISelf : + Script.location + * ('b, _) ty + * Entrypoint.t + * ('b typed_contract, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISelf_address : + Script.location * (address, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IAmount : + Script.location * (Tez.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | ISapling_empty_state : + Script.location + * Sapling.Memo_size.t + * (Sapling.state, 'a * 's, 'b, 'f) kinstr + -> ('a, 's, 'b, 'f) kinstr + | ISapling_verify_update : + Script.location + * ((bytes, (z num, Sapling.state) pair) pair option, 's, 'r, 'f) kinstr + -> (Sapling.transaction, Sapling.state * 's, 'r, 'f) kinstr + | ISapling_verify_update_deprecated : + (* legacy introduced in J *) + Script.location + * ((z num, Sapling.state) pair option, 's, 'r, 'f) kinstr + -> (Sapling.Legacy.transaction, Sapling.state * 's, 'r, 'f) kinstr + | IDig : + Script.location + (* + There is a prefix of length [n] common to the input stack + of type ['a * 's] and an intermediary stack of type ['d * 'u]. + *) + * int + (* + Under this common prefix, the input stack has type ['b * 'c * 't] and + the intermediary stack type ['c * 't] because we removed the ['b] from + the input stack. This value of type ['b] is pushed on top of the + stack passed to the continuation. + *) + * ('b, 'c * 't, 'c, 't, 'a, 's, 'd, 'u) stack_prefix_preservation_witness + * ('b, 'd * 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IDug : + Script.location + (* + The input stack has type ['a * 'b * 's]. + + There is a prefix of length [n] common to its substack + of type ['b * 's] and the output stack of type ['d * 'u]. + *) + * int + (* + Under this common prefix, the first stack has type ['c * 't] + and the second has type ['a * 'c * 't] because we have pushed + the topmost element of this input stack under the common prefix. + *) + * ('c, 't, 'a, 'c * 't, 'b, 's, 'd, 'u) stack_prefix_preservation_witness + * ('d, 'u, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IDipn : + Script.location + (* The body of Dipn is applied under a prefix of size [n]... *) + * int + (* + ... the relation between the types of the input and output stacks + is characterized by the following witness. + (See forthcoming comments about [stack_prefix_preservation_witness].) + *) + * ('c, 't, 'd, 'v, 'a, 's, 'b, 'u) stack_prefix_preservation_witness + * ('c, 't, 'd, 'v) kinstr + * ('b, 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IDropn : + Script.location + (* + The input stack enjoys a prefix of length [n]... + *) + * int + (* + ... and the following value witnesses that under this prefix + the stack has type ['b * 'u]. + *) + * ('b, 'u, 'b, 'u, 'a, 's, 'a, 's) stack_prefix_preservation_witness + (* + This stack is passed to the continuation since we drop the + entire prefix. + *) + * ('b, 'u, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IChainId : + Script.location * (Script_chain_id.t, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | INever : Script.location -> (never, 's, 'r, 'f) kinstr + | IVoting_power : + Script.location * (n num, 's, 'r, 'f) kinstr + -> (public_key_hash, 's, 'r, 'f) kinstr + | ITotal_voting_power : + Script.location * (n num, 'a * 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + | IKeccak : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | ISha3 : + Script.location * (bytes, 's, 'r, 'f) kinstr + -> (bytes, 's, 'r, 'f) kinstr + | IAdd_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, Script_bls.G1.t * 's, 'r, 'f) kinstr + | IAdd_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, Script_bls.G2.t * 's, 'r, 'f) kinstr + | IAdd_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IMul_bls12_381_z_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 'a num * 's, 'r, 'f) kinstr + | IMul_bls12_381_fr_z : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> ('a num, Script_bls.Fr.t * 's, 'r, 'f) kinstr + | IInt_bls12_381_fr : + Script.location * (z num, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_g1 : + Script.location * (Script_bls.G1.t, 's, 'r, 'f) kinstr + -> (Script_bls.G1.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_g2 : + Script.location * (Script_bls.G2.t, 's, 'r, 'f) kinstr + -> (Script_bls.G2.t, 's, 'r, 'f) kinstr + | INeg_bls12_381_fr : + Script.location * (Script_bls.Fr.t, 's, 'r, 'f) kinstr + -> (Script_bls.Fr.t, 's, 'r, 'f) kinstr + | IPairing_check_bls12_381 : + Script.location * (bool, 's, 'r, 'f) kinstr + -> ( (Script_bls.G1.t, Script_bls.G2.t) pair Script_list.t, + 's, + 'r, + 'f ) + kinstr + | IComb : + Script.location + * int + * ('a, 'b, 's, 'c, 'd, 't) comb_gadt_witness + * ('c, 'd * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IUncomb : + Script.location + * int + * ('a, 'b, 's, 'c, 'd, 't) uncomb_gadt_witness + * ('c, 'd * 't, 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | IComb_get : + Script.location + * int + * ('t, 'v) comb_get_gadt_witness + * ('v, 'a * 's, 'r, 'f) kinstr + -> ('t, 'a * 's, 'r, 'f) kinstr + | IComb_set : + Script.location + * int + * ('a, 'b, 'c) comb_set_gadt_witness + * ('c, 'd * 's, 'r, 'f) kinstr + -> ('a, 'b * ('d * 's), 'r, 'f) kinstr + | IDup_n : + Script.location + * int + * ('a, 'b, 's, 't) dup_n_gadt_witness + * ('t, 'a * ('b * 's), 'r, 'f) kinstr + -> ('a, 'b * 's, 'r, 'f) kinstr + | ITicket : + Script.location + * 'a comparable_ty option + * ('a ticket option, 's, 'r, 'f) kinstr + -> ('a, n num * 's, 'r, 'f) kinstr + | ITicket_deprecated : + Script.location * 'a comparable_ty option * ('a ticket, 's, 'r, 'f) kinstr + -> ('a, n num * 's, 'r, 'f) kinstr + | IRead_ticket : + Script.location + * 'a comparable_ty option + * (address * ('a * n num), 'a ticket * 's, 'r, 'f) kinstr + -> ('a ticket, 's, 'r, 'f) kinstr + | ISplit_ticket : + Script.location * (('a ticket * 'a ticket) option, 's, 'r, 'f) kinstr + -> ('a ticket, (n num * n num) * 's, 'r, 'f) kinstr + | IJoin_tickets : + Script.location * 'a comparable_ty * ('a ticket option, 's, 'r, 'f) kinstr + -> ('a ticket * 'a ticket, 's, 'r, 'f) kinstr + | IOpen_chest : + Script.location * ((bytes, bool) union, 's, 'r, 'f) kinstr + -> ( Script_timelock.chest_key, + Script_timelock.chest * (n num * 's), + 'r, + 'f ) + kinstr + | IEmit : { + loc : Script.location; + tag : Entrypoint.t; + ty : ('a, _) ty; + unparsed_ty : Script.expr; + k : (operation, 's, 'r, 'f) kinstr; + } + -> ('a, 's, 'r, 'f) kinstr + (* + + Internal control instructions + ============================= + + The following instructions are not available in the source language. + They are used by the internals of the interpreter. + *) + | IHalt : Script.location -> ('a, 's, 'a, 's) kinstr + | ILog : + Script.location + * ('a, 's) stack_ty + * logging_event + * logger + * ('a, 's, 'r, 'f) kinstr + -> ('a, 's, 'r, 'f) kinstr + +and ('arg, 'ret) lambda = + | Lam : + ('arg, end_of_stack, 'ret, end_of_stack) kdescr * Script.node + -> ('arg, 'ret) lambda + | LamRec : + ('arg, ('arg, 'ret) lambda * end_of_stack, 'ret, end_of_stack) kdescr + * Script.node + -> ('arg, 'ret) lambda + +and 'arg typed_contract = + | Typed_implicit : public_key_hash -> unit typed_contract + | Typed_implicit_with_ticket : { + ticket_ty : ('arg ticket, _) ty; + destination : public_key_hash; + } + -> 'arg ticket typed_contract + | Typed_originated : { + arg_ty : ('arg, _) ty; + contract_hash : Contract_hash.t; + entrypoint : Entrypoint.t; + } + -> 'arg typed_contract + | Typed_tx_rollup : { + arg_ty : (('a ticket, tx_rollup_l2_address) pair, _) ty; + tx_rollup : Tx_rollup.t; + } + -> ('a ticket, tx_rollup_l2_address) pair typed_contract + | Typed_sc_rollup : { + arg_ty : ('arg, _) ty; + sc_rollup : Sc_rollup.t; + entrypoint : Entrypoint.t; + } + -> 'arg typed_contract + | Typed_zk_rollup : { + arg_ty : (('a ticket, bytes) pair, _) ty; + zk_rollup : Zk_rollup.t; + } + -> ('a ticket, bytes) pair typed_contract + +(* + + Control stack + ============= + + The control stack is a list of [kinstr]. + + Since [kinstr] denotes a list of instructions, the control stack + can be seen as a list of instruction sequences, each representing a + form of delimited continuation (i.e. a control stack fragment). The + [continuation] GADT ensures that the input and output stack types of the + continuations are consistent. + + Loops have a special treatment because their control stack is reused + as is for the next iteration. This avoids the reallocation of a + control stack cell at each iteration. + + To implement [step] as a tail-recursive function, we implement + higher-order iterators (i.e. MAPs and ITERs) using internal instructions +. Roughly speaking, these instructions help in decomposing the execution + of [I f c] (where [I] is an higher-order iterator over a container [c]) + into three phases: to start the iteration, to execute [f] if there are + elements to be processed in [c], and to loop. + + Dip also has a dedicated constructor in the control stack. This + allows the stack prefix to be restored after the execution of the + [Dip]'s body. + + Following the same style as in [kinstr], [continuation] has four + arguments, two for each stack types. More precisely, with + + [('bef_top, 'bef, 'aft_top, 'aft) continuation] + + we encode the fact that the stack before executing the continuation + has type [('bef_top * 'bef)] and that the stack after this execution + has type [('aft_top * 'aft)]. + +*) +and (_, _, _, _) continuation = + (* This continuation returns immediately. *) + | KNil : ('r, 'f, 'r, 'f) continuation + (* This continuation starts with the next instruction to execute. *) + | KCons : + ('a, 's, 'b, 't) kinstr * ('b, 't, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + (* This continuation represents a call frame: it stores the caller's + stack of type ['s] and the continuation which expects the callee's + result on top of the stack. *) + | KReturn : + 's * ('a, 's) stack_ty option * ('a, 's, 'r, 'f) continuation + -> ('a, end_of_stack, 'r, 'f) continuation + (* This continuation is useful when stack head requires some wrapping or + unwrapping before it can be passed forward. For instance this continuation + is used after a [MAP] instruction applied to an option in order to wrap the + result back in a [Some] constructor. + + /!\ When using it, make sure the function runs in constant time or that gas + has been properly charged beforehand. + Also make sure it runs with a small, bounded stack. + *) + | KMap_head : + ('a -> 'b) * ('b, 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + (* This continuation comes right after a [Dip i] to restore the topmost + element ['b] of the stack after having executed [i] in the substack + of type ['a * 's]. *) + | KUndip : + 'b * ('b, _) ty option * ('b, 'a * 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + (* This continuation is executed at each iteration of a loop with + a Boolean condition. *) + | KLoop_in : + ('a, 's, bool, 'a * 's) kinstr * ('a, 's, 'r, 'f) continuation + -> (bool, 'a * 's, 'r, 'f) continuation + (* This continuation is executed at each iteration of a loop with + a condition encoded by a sum type. *) + | KLoop_in_left : + ('a, 's, ('a, 'b) union, 's) kinstr * ('b, 's, 'r, 'f) continuation + -> (('a, 'b) union, 's, 'r, 'f) continuation + (* This continuation is executed at each iteration of a traversal. + (Used in List, Map and Set.) *) + | KIter : + ('a, 'b * 's, 'b, 's) kinstr + * ('a, _) ty option + * 'a list + * ('b, 's, 'r, 'f) continuation + -> ('b, 's, 'r, 'f) continuation + (* This continuation represents each step of a List.map. *) + | KList_enter_body : + ('a, 'c * 's, 'b, 'c * 's) kinstr + * 'a list + * 'b Script_list.t + * ('b Script_list.t, _) ty option + * int + * ('b Script_list.t, 'c * 's, 'r, 'f) continuation + -> ('c, 's, 'r, 'f) continuation + (* This continuation represents what is done after each step of a List.map. *) + | KList_exit_body : + ('a, 'c * 's, 'b, 'c * 's) kinstr + * 'a list + * 'b Script_list.t + * ('b Script_list.t, _) ty option + * int + * ('b Script_list.t, 'c * 's, 'r, 'f) continuation + -> ('b, 'c * 's, 'r, 'f) continuation + (* This continuation represents each step of a Map.map. *) + | KMap_enter_body : + ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * ('a * 'b) list + * ('a, 'c) map + * (('a, 'c) map, _) ty option + * (('a, 'c) map, 'd * 's, 'r, 'f) continuation + -> ('d, 's, 'r, 'f) continuation + (* This continuation represents what is done after each step of a Map.map. *) + | KMap_exit_body : + ('a * 'b, 'd * 's, 'c, 'd * 's) kinstr + * ('a * 'b) list + * ('a, 'c) map + * 'a + * (('a, 'c) map, _) ty option + * (('a, 'c) map, 'd * 's, 'r, 'f) continuation + -> ('c, 'd * 's, 'r, 'f) continuation + (* This continuation represents what is done after returning from a view. + It holds the original step constants value prior to entering the view. *) + | KView_exit : + step_constants * ('a, 's, 'r, 'f) continuation + -> ('a, 's, 'r, 'f) continuation + (* This continuation instruments the execution with a [logger]. *) + | KLog : + ('a, 's, 'r, 'f) continuation * ('a, 's) stack_ty * logger + -> ('a, 's, 'r, 'f) continuation + +(* + + Execution instrumentation + ========================= + + One can observe the context and the stack at some specific points + of an execution step. This feature is implemented by calling back + some [logging_function]s defined in a record of type [logger] + passed as argument to the step function. + + A [logger] is typically embedded in an [KLog] continuation by the + client to trigger an evaluation instrumented with some logging. The + logger is then automatically propagated to the logging instruction + [ILog] as well as to any instructions that need to generate a + backtrace when it fails (e.g., [IFailwith], [IMul_teznat], ...). + +*) +and ('a, 's, 'b, 'f, 'c, 'u) logging_function = + ('a, 's, 'b, 'f) kinstr -> + context -> + Script.location -> + ('c, 'u) stack_ty -> + 'c * 'u -> + unit + +and execution_trace = (Script.location * Gas.Arith.fp * Script.expr list) list + +and logger = { + log_interp : 'a 's 'b 'f 'c 'u. ('a, 's, 'b, 'f, 'c, 'u) logging_function; + (** [log_interp] is called at each call of the internal function + [interp]. [interp] is called when starting the interpretation of + a script and subsequently at each [Exec] instruction. *) + get_log : unit -> execution_trace option tzresult Lwt.t; + (** [get_log] allows to obtain an execution trace, if any was + produced. *) + klog : 'a 's 'r 'f. ('a, 's, 'r, 'f) klog; + (** [klog] is called on [KLog] inserted when instrumenting + continuations. *) + ilog : 'a 's 'b 't 'r 'f. ('a, 's, 'b, 't, 'r, 'f) ilog; + (** [ilog] is called on [ILog] inserted when instrumenting + instructions. *) + log_kinstr : 'a 'b 'c 'd. ('a, 'b, 'c, 'd) log_kinstr; + (** [log_kinstr] instruments an instruction with [ILog]. *) +} + +and ('a, 's, 'r, 'f) klog = + logger -> + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's) stack_ty -> + ('a, 's, 'r, 'f) continuation -> + ('a, 's, 'r, 'f) continuation -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + +and ('a, 's, 'b, 't, 'r, 'f) ilog = + logger -> + logging_event -> + ('a, 's) stack_ty -> + ('a, 's, 'b, 't, 'r, 'f) step_type + +and ('a, 's, 'b, 't, 'r, 'f) step_type = + Local_gas_counter.outdated_context * step_constants -> + Local_gas_counter.local_gas_counter -> + ('a, 's, 'b, 't) kinstr -> + ('b, 't, 'r, 'f) continuation -> + 'a -> + 's -> + ('r + * 'f + * Local_gas_counter.outdated_context + * Local_gas_counter.local_gas_counter) + tzresult + Lwt.t + +and ('a, 'b, 'c, 'd) log_kinstr = + logger -> + ('a, 'b) stack_ty -> + ('a, 'b, 'c, 'd) kinstr -> + ('a, 'b, 'c, 'd) kinstr + +(* ---- Auxiliary types -----------------------------------------------------*) +and ('ty, 'comparable) ty = + | Unit_t : (unit, yes) ty + | Int_t : (z num, yes) ty + | Nat_t : (n num, yes) ty + | Signature_t : (signature, yes) ty + | String_t : (Script_string.t, yes) ty + | Bytes_t : (bytes, yes) ty + | Mutez_t : (Tez.t, yes) ty + | Key_hash_t : (public_key_hash, yes) ty + | Key_t : (public_key, yes) ty + | Timestamp_t : (Script_timestamp.t, yes) ty + | Address_t : (address, yes) ty + | Tx_rollup_l2_address_t : (tx_rollup_l2_address, yes) ty + | Bool_t : (bool, yes) ty + | Pair_t : + ('a, 'ac) ty + * ('b, 'bc) ty + * ('a, 'b) pair ty_metadata + * ('ac, 'bc, 'rc) dand + -> (('a, 'b) pair, 'rc) ty + | Union_t : + ('a, 'ac) ty + * ('b, 'bc) ty + * ('a, 'b) union ty_metadata + * ('ac, 'bc, 'rc) dand + -> (('a, 'b) union, 'rc) ty + | Lambda_t : + ('arg, _) ty * ('ret, _) ty * ('arg, 'ret) lambda ty_metadata + -> (('arg, 'ret) lambda, no) ty + | Option_t : + ('v, 'c) ty * 'v option ty_metadata * 'c dbool + -> ('v option, 'c) ty + | List_t : + ('v, _) ty * 'v Script_list.t ty_metadata + -> ('v Script_list.t, no) ty + | Set_t : 'v comparable_ty * 'v set ty_metadata -> ('v set, no) ty + | Map_t : + 'k comparable_ty * ('v, _) ty * ('k, 'v) map ty_metadata + -> (('k, 'v) map, no) ty + | Big_map_t : + 'k comparable_ty * ('v, _) ty * ('k, 'v) big_map ty_metadata + -> (('k, 'v) big_map, no) ty + | Contract_t : + ('arg, _) ty * 'arg typed_contract ty_metadata + -> ('arg typed_contract, no) ty + | Sapling_transaction_t : Sapling.Memo_size.t -> (Sapling.transaction, no) ty + | Sapling_transaction_deprecated_t : + Sapling.Memo_size.t + -> (Sapling.Legacy.transaction, no) ty + | Sapling_state_t : Sapling.Memo_size.t -> (Sapling.state, no) ty + | Operation_t : (operation, no) ty + | Chain_id_t : (Script_chain_id.t, yes) ty + | Never_t : (never, yes) ty + | Bls12_381_g1_t : (Script_bls.G1.t, no) ty + | Bls12_381_g2_t : (Script_bls.G2.t, no) ty + | Bls12_381_fr_t : (Script_bls.Fr.t, no) ty + | Ticket_t : 'a comparable_ty * 'a ticket ty_metadata -> ('a ticket, no) ty + | Chest_key_t : (Script_timelock.chest_key, no) ty + | Chest_t : (Script_timelock.chest, no) ty + +and 'ty comparable_ty = ('ty, yes) ty + +and ('top_ty, 'resty) stack_ty = + | Item_t : + ('ty, _) ty * ('ty2, 'rest) stack_ty + -> ('ty, 'ty2 * 'rest) stack_ty + | Bot_t : (empty_cell, empty_cell) stack_ty + +and ('key, 'value) big_map = + | Big_map : { + id : Big_map.Id.t option; + diff : ('key, 'value) big_map_overlay; + key_type : 'key comparable_ty; + value_type : ('value, _) ty; + } + -> ('key, 'value) big_map + +and ('a, 's, 'r, 'f) kdescr = { + kloc : Script.location; + kbef : ('a, 's) stack_ty; + kaft : ('r, 'f) stack_ty; + kinstr : ('a, 's, 'r, 'f) kinstr; +} + +(* + + Several instructions work under an arbitrary deep stack prefix + (e.g, IDipn, IDropn, etc). To convince the typechecker that + these instructions are well-typed, we must provide a witness + to statically characterize the relationship between the input + and the output stacks. The inhabitants of the following GADT + act as such witnesses. + + More precisely, a value [w] of type + + [(c, t, d, v, a, s, b, u) stack_prefix_preservation_witness] + + proves that there is a common prefix between an input stack + of type [a * s] and an output stack of type [b * u]. This prefix + is as deep as the number of [KPrefix] application in [w]. When + used with an operation parameterized by a natural number [n] + characterizing the depth at which the operation must be applied, + [w] is the Peano encoding of [n]. + + When this prefix is removed from the two stacks, the input stack + has type [c * t] while the output stack has type [d * v]. + +*) +and (_, _, _, _, _, _, _, _) stack_prefix_preservation_witness = + | KPrefix : + Script.location + * ('a, _) ty + * ('c, 'v, 'd, 'w, 'x, 's, 'y, 'u) stack_prefix_preservation_witness + -> ( 'c, + 'v, + 'd, + 'w, + 'a, + 'x * 's, + 'a, + 'y * 'u ) + stack_prefix_preservation_witness + | KRest : ('a, 's, 'b, 'u, 'a, 's, 'b, 'u) stack_prefix_preservation_witness + +and (_, _, _, _, _, _) comb_gadt_witness = + | Comb_one : ('a, 'x, 'before, 'a, 'x, 'before) comb_gadt_witness + | Comb_succ : + ('b, 'c, 's, 'd, 'e, 't) comb_gadt_witness + -> ('a, 'b, 'c * 's, 'a * 'd, 'e, 't) comb_gadt_witness + +and (_, _, _, _, _, _) uncomb_gadt_witness = + | Uncomb_one : ('a, 'x, 'before, 'a, 'x, 'before) uncomb_gadt_witness + | Uncomb_succ : + ('b, 'c, 's, 'd, 'e, 't) uncomb_gadt_witness + -> ('a * 'b, 'c, 's, 'a, 'd, 'e * 't) uncomb_gadt_witness + +and ('before, 'after) comb_get_gadt_witness = + | Comb_get_zero : ('b, 'b) comb_get_gadt_witness + | Comb_get_one : ('a * 'b, 'a) comb_get_gadt_witness + | Comb_get_plus_two : + ('before, 'after) comb_get_gadt_witness + -> ('a * 'before, 'after) comb_get_gadt_witness + +and ('value, 'before, 'after) comb_set_gadt_witness = + | Comb_set_zero : ('value, _, 'value) comb_set_gadt_witness + | Comb_set_one : ('value, 'hd * 'tl, 'value * 'tl) comb_set_gadt_witness + | Comb_set_plus_two : + ('value, 'before, 'after) comb_set_gadt_witness + -> ('value, 'a * 'before, 'a * 'after) comb_set_gadt_witness + +(* + + [dup_n_gadt_witness ('a, 'b, 's, 't)] ensures that there exists at least + [n] elements in ['a, 'b, 's] and that the [n]-th element is of type + ['t]. Here [n] follows Peano's encoding (0 and successor). + Besides, [0] corresponds to the topmost element of ['s]. + + This relational predicate is defined by induction on [n]. + +*) +and (_, _, _, _) dup_n_gadt_witness = + | Dup_n_zero : ('a, _, _, 'a) dup_n_gadt_witness + | Dup_n_succ : + ('b, 'c, 'stack, 'd) dup_n_gadt_witness + -> ('a, 'b, 'c * 'stack, 'd) dup_n_gadt_witness + +and ('input, 'output) view_signature = + | View_signature : { + name : Script_string.t; + input_ty : ('input, _) ty; + output_ty : ('output, _) ty; + } + -> ('input, 'output) view_signature + +and 'kind internal_operation_contents = + | Transaction_to_implicit : { + destination : Signature.Public_key_hash.t; + amount : Tez.tez; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_implicit_with_ticket : { + destination : Signature.Public_key_hash.t; + ticket_ty : ('content ticket, _) ty; + ticket : 'content ticket; + unparsed_ticket : Script.lazy_expr; + amount : Tez.tez; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_smart_contract : { + (* The [unparsed_parameters] field may seem useless since we have + access to a typed version of the field (with [parameters_ty] and + [parameters]), but we keep it so that we do not have to unparse the + typed version in order to produce the receipt + ([Apply_internal_results.internal_operation_contents]). *) + destination : Contract_hash.t; + amount : Tez.tez; + entrypoint : Entrypoint.t; + location : Script.location; + parameters_ty : ('a, _) ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_tx_rollup : { + destination : Tx_rollup.t; + parameters_ty : (('a ticket, tx_rollup_l2_address) pair, _) ty; + parameters : ('a ticket, tx_rollup_l2_address) pair; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Transaction_to_sc_rollup : { + destination : Sc_rollup.t; + entrypoint : Entrypoint.t; + parameters_ty : ('a, _) ty; + parameters : 'a; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Event : { + ty : Script.expr; + tag : Entrypoint.t; + unparsed_data : Script.expr; + } + -> Kind.event internal_operation_contents + | Transaction_to_zk_rollup : { + destination : Zk_rollup.t; + parameters_ty : (('a ticket, bytes) pair, _) ty; + parameters : ('a ticket, bytes) pair; + unparsed_parameters : Script.expr; + } + -> Kind.transaction internal_operation_contents + | Origination : { + delegate : Signature.Public_key_hash.t option; + code : Script.expr; + unparsed_storage : Script.expr; + credit : Tez.tez; + preorigination : Contract_hash.t; + storage_type : ('storage, _) ty; + storage : 'storage; + } + -> Kind.origination internal_operation_contents + | Delegation : + Signature.Public_key_hash.t option + -> Kind.delegation internal_operation_contents + +and 'kind internal_operation = { + source : Contract.t; + operation : 'kind internal_operation_contents; + nonce : int; +} + +and packed_internal_operation = + | Internal_operation : 'kind internal_operation -> packed_internal_operation +[@@ocaml.unboxed] + +and operation = { + piop : packed_internal_operation; + lazy_storage_diff : Lazy_storage.diffs option; +} + +type ('arg, 'storage) script = + | Script : { + code : + (('arg, 'storage) pair, (operation Script_list.t, 'storage) pair) lambda; + arg_type : ('arg, _) ty; + storage : 'storage; + storage_type : ('storage, _) ty; + views : view_map; + entrypoints : 'arg entrypoints; + code_size : Cache_memory_helpers.sint; + } + -> ('arg, 'storage) script + +type ex_ty = Ex_ty : ('a, _) ty -> ex_ty + +val manager_kind : 'kind internal_operation_contents -> 'kind Kind.manager + +val kinstr_location : (_, _, _, _) kinstr -> Script.location + +val ty_size : ('a, _) ty -> 'a Type_size.t + +val is_comparable : ('v, 'c) ty -> 'c dbool + +type 'v ty_ex_c = Ty_ex_c : ('v, _) ty -> 'v ty_ex_c [@@ocaml.unboxed] + +val unit_t : unit comparable_ty + +val int_t : z num comparable_ty + +val nat_t : n num comparable_ty + +val signature_t : signature comparable_ty + +val string_t : Script_string.t comparable_ty + +val bytes_t : Bytes.t comparable_ty + +val mutez_t : Tez.t comparable_ty + +val key_hash_t : public_key_hash comparable_ty + +val key_t : public_key comparable_ty + +val timestamp_t : Script_timestamp.t comparable_ty + +val address_t : address comparable_ty + +val tx_rollup_l2_address_t : tx_rollup_l2_address comparable_ty + +val bool_t : bool comparable_ty + +val pair_t : + Script.location -> ('a, _) ty -> ('b, _) ty -> ('a, 'b) pair ty_ex_c tzresult + +val pair_3_t : + Script.location -> + ('a, _) ty -> + ('b, _) ty -> + ('c, _) ty -> + ('a, ('b, 'c) pair) pair ty_ex_c tzresult + +val comparable_pair_t : + Script.location -> + 'a comparable_ty -> + 'b comparable_ty -> + ('a, 'b) pair comparable_ty tzresult + +val comparable_pair_3_t : + Script.location -> + 'a comparable_ty -> + 'b comparable_ty -> + 'c comparable_ty -> + ('a, ('b, 'c) pair) pair comparable_ty tzresult + +val union_t : + Script.location -> ('a, _) ty -> ('b, _) ty -> ('a, 'b) union ty_ex_c tzresult + +val comparable_union_t : + Script.location -> + 'a comparable_ty -> + 'b comparable_ty -> + ('a, 'b) union comparable_ty tzresult + +val union_bytes_bool_t : (Bytes.t, bool) union comparable_ty + +val lambda_t : + Script.location -> + ('arg, _) ty -> + ('ret, _) ty -> + (('arg, 'ret) lambda, no) ty tzresult + +val option_t : Script.location -> ('v, 'c) ty -> ('v option, 'c) ty tzresult + +val option_mutez_t : Tez.t option comparable_ty + +val option_string_t : Script_string.t option comparable_ty + +val option_bytes_t : Bytes.t option comparable_ty + +val option_nat_t : n num option comparable_ty + +val option_pair_nat_nat_t : (n num, n num) pair option comparable_ty + +val option_pair_nat_mutez_t : (n num, Tez.t) pair option comparable_ty + +val option_pair_mutez_mutez_t : (Tez.t, Tez.t) pair option comparable_ty + +val option_pair_int_nat_t : (z num, n num) pair option comparable_ty + +val list_t : Script.location -> ('v, _) ty -> ('v Script_list.t, no) ty tzresult + +val list_operation_t : (operation Script_list.t, no) ty + +val set_t : Script.location -> 'v comparable_ty -> ('v set, no) ty tzresult + +val map_t : + Script.location -> + 'k comparable_ty -> + ('v, _) ty -> + (('k, 'v) map, no) ty tzresult + +val big_map_t : + Script.location -> + 'k comparable_ty -> + ('v, _) ty -> + (('k, 'v) big_map, no) ty tzresult + +val contract_t : + Script.location -> ('arg, _) ty -> ('arg typed_contract, no) ty tzresult + +val contract_unit_t : (unit typed_contract, no) ty + +val sapling_transaction_t : + memo_size:Sapling.Memo_size.t -> (Sapling.transaction, no) ty + +val sapling_transaction_deprecated_t : + memo_size:Sapling.Memo_size.t -> (Sapling.Legacy.transaction, no) ty + +val sapling_state_t : memo_size:Sapling.Memo_size.t -> (Sapling.state, no) ty + +val operation_t : (operation, no) ty + +val chain_id_t : Script_chain_id.t comparable_ty + +val never_t : never comparable_ty + +val bls12_381_g1_t : (Script_bls.G1.t, no) ty + +val bls12_381_g2_t : (Script_bls.G2.t, no) ty + +val bls12_381_fr_t : (Script_bls.Fr.t, no) ty + +val ticket_t : + Script.location -> 'a comparable_ty -> ('a ticket, no) ty tzresult + +val chest_key_t : (Script_timelock.chest_key, no) ty + +val chest_t : (Script_timelock.chest, no) ty + +(** + + The following functions named `X_traverse` for X in + [{ kinstr, ty, comparable_ty, value }] provide tail recursive top down + traversals over the values of these types. + + The traversal goes through a value and rewrites an accumulator + along the way starting from some [init]ial value for the + accumulator. + + All these traversals follow the same recursion scheme: the + user-provided function is first called on the toplevel value, then + the traversal recurses on the direct subvalues of the same type. + + Hence, the user-provided function must only compute the + contribution of the value on the accumulator minus the contribution + of its subvalues of the same type. + +*) +type 'a kinstr_traverse = { + apply : 'b 'u 'r 'f. 'a -> ('b, 'u, 'r, 'f) kinstr -> 'a; +} + +val kinstr_traverse : + ('a, 'b, 'c, 'd) kinstr -> 'ret -> 'ret kinstr_traverse -> 'ret + +type 'a ty_traverse = {apply : 't 'tc. 'a -> ('t, 'tc) ty -> 'a} + +val ty_traverse : ('a, _) ty -> 'r -> 'r ty_traverse -> 'r + +type 'accu stack_ty_traverse = { + apply : 'ty 's. 'accu -> ('ty, 's) stack_ty -> 'accu; +} + +val stack_ty_traverse : ('a, 's) stack_ty -> 'r -> 'r stack_ty_traverse -> 'r + +type 'a value_traverse = {apply : 't 'tc. 'a -> ('t, 'tc) ty -> 't -> 'a} + +val value_traverse : ('t, _) ty -> 't -> 'r -> 'r value_traverse -> 'r + +val stack_top_ty : ('a, 'b * 's) stack_ty -> 'a ty_ex_c + +module Typed_contract : sig + val destination : _ typed_contract -> Destination.t + + val arg_ty : 'a typed_contract -> 'a ty_ex_c + + val entrypoint : _ typed_contract -> Entrypoint.t + + module Internal_for_tests : sig + (* This function doesn't guarantee that the contract is well-typed wrt its + registered type at origination, it only guarantees that the type is + plausible wrt to the destination kind. *) + val typed_exn : + ('a, _) ty -> Destination.t -> Entrypoint.t -> 'a typed_contract + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.ml b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.ml new file mode 100644 index 000000000000..f12f9578491a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.ml @@ -0,0 +1,717 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Script_typed_ir +include Cache_memory_helpers + +let script_string_size s = Script_string.to_string s |> string_size + +let ty_traverse_f = + let base_basic = + !!0 + (* Basic types count for 0 because they are all static values, hence shared + and not counted by `reachable_words`. + On the other hand compound types are functions, hence not shared. *) + in + let base_compound_no_meta = header_size in + let base_compound _meta = h1w in + let apply : type a ac. nodes_and_size -> (a, ac) ty -> nodes_and_size = + fun accu ty -> + match ty with + | Unit_t -> ret_succ_adding accu base_basic + | Int_t -> ret_succ_adding accu base_basic + | Nat_t -> ret_succ_adding accu base_basic + | Signature_t -> ret_succ_adding accu base_basic + | String_t -> ret_succ_adding accu base_basic + | Bytes_t -> ret_succ_adding accu base_basic + | Mutez_t -> ret_succ_adding accu base_basic + | Key_hash_t -> ret_succ_adding accu base_basic + | Key_t -> ret_succ_adding accu base_basic + | Timestamp_t -> ret_succ_adding accu base_basic + | Address_t -> ret_succ_adding accu base_basic + | Tx_rollup_l2_address_t -> ret_succ_adding accu base_basic + | Bool_t -> ret_succ_adding accu base_basic + | Operation_t -> ret_succ_adding accu base_basic + | Chain_id_t -> ret_succ_adding accu base_basic + | Never_t -> ret_succ_adding accu base_basic + | Bls12_381_g1_t -> ret_succ_adding accu base_basic + | Bls12_381_g2_t -> ret_succ_adding accu base_basic + | Bls12_381_fr_t -> ret_succ_adding accu base_basic + | Chest_key_t -> ret_succ_adding accu base_basic + | Chest_t -> ret_succ_adding accu base_basic + | Pair_t (_ty1, _ty2, a, _) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 3)) + | Union_t (_ty1, _ty2, a, _) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 3)) + | Lambda_t (_ty1, _ty2, a) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 2)) + | Option_t (_ty, a, _) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 2)) + | List_t (_ty, a) -> ret_succ_adding accu @@ (base_compound a +! word_size) + | Set_t (_cty, a) -> ret_succ_adding accu @@ (base_compound a +! word_size) + | Map_t (_cty, _ty, a) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 2)) + | Big_map_t (_cty, _ty, a) -> + ret_succ_adding accu @@ (base_compound a +! (word_size *? 2)) + | Contract_t (_ty, a) -> + ret_succ_adding accu @@ (base_compound a +! word_size) + | Sapling_transaction_t m -> + ret_succ_adding accu + @@ base_compound_no_meta + +! Sapling.Memo_size.in_memory_size m + +! word_size + | Sapling_transaction_deprecated_t m -> + ret_succ_adding accu + @@ base_compound_no_meta + +! Sapling.Memo_size.in_memory_size m + +! word_size + | Sapling_state_t m -> + ret_succ_adding accu + @@ base_compound_no_meta + +! Sapling.Memo_size.in_memory_size m + +! word_size + | Ticket_t (_cty, a) -> + ret_succ_adding accu @@ (base_compound a +! word_size) + in + ({apply} : nodes_and_size ty_traverse) + +let ty_size : type a ac. (a, ac) ty -> nodes_and_size = + fun ty -> ty_traverse ty zero ty_traverse_f + +(* Types stored for logging are optional and never present in the cache. Therefore + it's safe not to count them. *) +let ty_for_logging_size : type a ac. (a, ac) ty option -> sint = fun _ty -> !!0 + +let stack_ty_size s = + let apply : type a s. nodes_and_size -> (a, s) stack_ty -> nodes_and_size = + fun accu s -> + match s with + | Bot_t -> ret_succ accu + | Item_t (ty, _) -> ret_succ_adding (accu ++ ty_size ty) h2w + in + stack_ty_traverse s zero {apply} + +(* Stack types for logging are optional and never present in the cache. Therefore + it's safe not to count them. One word taken by the [None] tag is already + accounted for by the call-sites of this function. *) +let stack_ty_for_logging_size : type a s. (a, s) stack_ty option -> sint = + fun _ -> !!0 + +let script_nat_size n = Script_int.to_zint n |> z_size + +let script_int_size n = Script_int.to_zint n |> z_size + +let signature_size (Script_signature.Signature_tag x) = + match x with + (* By Obj.reachable_words. *) + | Ed25519 _ | Secp256k1 _ | P256 _ | Unknown _ -> !!96 + | Bls _ -> !!128 + +let key_hash_size (_x : Signature.public_key_hash) = !!64 +(* By Obj.reachable_words. *) + +let public_key_size (x : public_key) = + h1w + +? + match x with + | Ed25519 _ -> 64 + | Secp256k1 _ -> 72 + | P256 _ -> 96 + | Bls _ -> 64 + +let mutez_size = h2w + +let timestamp_size x = Script_timestamp.to_zint x |> z_size + +let destination_size = Destination.in_memory_size + +let address_size addr = + h2w + +! destination_size addr.destination + +! Entrypoint.in_memory_size addr.entrypoint + +let tx_rollup_l2_address_size (tx : tx_rollup_l2_address) = + Tx_rollup_l2_address.Indexable.in_memory_size @@ Indexable.forget tx + +let view_signature_size (View_signature {name; input_ty; output_ty}) = + ret_adding + (ty_size input_ty ++ ty_size output_ty) + (h3w +! script_string_size name) + +let script_expr_hash_size = !!64 + +(* Note: this function is NOT tail-recursive, but that's okay, since + the recursion is bound by the size of the witness, which is an + 11-bit unsigned integer, i.e. at most 2048. This is enough to + guarantee there will be no stack overflow. *) +let rec stack_prefix_preservation_witness_size_internal : + type a b c d e f g h. + (a, b, c, d, e, f, g, h) stack_prefix_preservation_witness -> nodes_and_size + = function + | KPrefix (_loc, ty, w) -> + ret_succ_adding + (ty_size ty ++ stack_prefix_preservation_witness_size_internal w) + h3w + | KRest -> zero + +let stack_prefix_preservation_witness_size (_n : int) w = + stack_prefix_preservation_witness_size_internal w + +let peano_shape_proof = + let scale = header_size +! h1w in + fun k -> scale *? k + +let comb_gadt_witness_size n (_w : (_, _, _, _, _, _) comb_gadt_witness) = + peano_shape_proof n + +let uncomb_gadt_witness_size n (_w : (_, _, _, _, _, _) uncomb_gadt_witness) = + peano_shape_proof n + +let comb_get_gadt_witness_size n (_w : (_, _) comb_get_gadt_witness) = + peano_shape_proof n + +let comb_set_gadt_witness_size n (_w : (_, _, _) comb_set_gadt_witness) = + peano_shape_proof n + +let dup_n_gadt_witness_size n (_w : (_, _, _, _) dup_n_gadt_witness) = + peano_shape_proof n + +let contract_size : type t. t typed_contract -> nodes_and_size = function + | Typed_implicit _ -> ret_adding zero (h1w +! public_key_hash_in_memory_size) + | Typed_implicit_with_ticket {ticket_ty; destination = _} -> + ret_adding (ty_size ticket_ty) (h2w +! public_key_hash_in_memory_size) + | Typed_originated {arg_ty; contract_hash = _; entrypoint} -> + ret_adding + (ty_size arg_ty) + (h3w +! blake2b_hash_size +! Entrypoint.in_memory_size entrypoint) + | Typed_tx_rollup {arg_ty; tx_rollup} -> + ret_adding (ty_size arg_ty) (h2w +! Tx_rollup.in_memory_size tx_rollup) + | Typed_sc_rollup {arg_ty; sc_rollup; entrypoint} -> + ret_adding + (ty_size arg_ty) + (h3w + +! Sc_rollup.in_memory_size sc_rollup + +! Entrypoint.in_memory_size entrypoint) + | Typed_zk_rollup {arg_ty; zk_rollup} -> + ret_adding (ty_size arg_ty) (h2w +! Zk_rollup.in_memory_size zk_rollup) + +let sapling_state_size {Sapling.id; diff; memo_size} = + h3w + +! option_size (fun x -> z_size (Sapling.Id.unparse_to_z x)) id + +! Sapling.diff_in_memory_size diff + +! Sapling.Memo_size.in_memory_size memo_size + +let chain_id_size = !!16 (* by Obj.reachable_words. *) + +(* [contents] is handled by the recursion scheme in [value_size]. *) +let ticket_size {ticketer; contents = _; amount} = + h3w + +! Contract.in_memory_size ticketer + +! script_nat_size (amount :> Script_int.n Script_int.num) + +let chest_size chest = + (* + type chest = { + locked_value : locked_value; + rsa_public : rsa_public; + ciphertext : ciphertext; + } + *) + let locked_value_size = 256 in + let rsa_public_size = 256 in + let ciphertext_size = Script_timelock.get_plaintext_size chest in + h3w +? (locked_value_size + rsa_public_size + ciphertext_size) + +let chest_key_size _ = + (* + type chest_key = { + unlocked_value : unlocked_value; + proof : time_lock_proof + } + *) + let unlocked_value_size = 256 in + let proof_size = 256 in + h2w +? (unlocked_value_size + proof_size) + +(* The following mutually recursive functions are mostly + tail-recursive and the only recursive call that is not a tailcall + cannot be nested. (See [big_map_size].) For this reason, these + functions should not trigger stack overflows. *) +let rec value_size : + type a ac. + count_lambda_nodes:bool -> + nodes_and_size -> + (a, ac) ty -> + a -> + nodes_and_size = + fun ~count_lambda_nodes accu ty x -> + let apply : type a ac. nodes_and_size -> (a, ac) ty -> a -> nodes_and_size = + fun accu ty x -> + match ty with + | Unit_t -> ret_succ accu + | Int_t -> ret_succ_adding accu (script_int_size x) + | Nat_t -> ret_succ_adding accu (script_nat_size x) + | Signature_t -> ret_succ_adding accu (signature_size x) + | String_t -> ret_succ_adding accu (script_string_size x) + | Bytes_t -> ret_succ_adding accu (bytes_size x) + | Mutez_t -> ret_succ_adding accu mutez_size + | Key_hash_t -> ret_succ_adding accu (key_hash_size x) + | Key_t -> ret_succ_adding accu (public_key_size x) + | Timestamp_t -> ret_succ_adding accu (timestamp_size x) + | Address_t -> ret_succ_adding accu (address_size x) + | Tx_rollup_l2_address_t -> + ret_succ_adding accu (tx_rollup_l2_address_size x) + | Bool_t -> ret_succ accu + | Pair_t (_, _, _, _) -> ret_succ_adding accu h2w + | Union_t (_, _, _, _) -> ret_succ_adding accu h1w + | Lambda_t (_, _, _) -> + (lambda_size [@ocaml.tailcall]) ~count_lambda_nodes (ret_succ accu) x + | Option_t (_, _, _) -> ret_succ_adding accu (option_size (fun _ -> !!0) x) + | List_t (_, _) -> ret_succ_adding accu (h2w +! (h2w *? x.length)) + | Set_t (_, _) -> + let module M = (val Script_set.get x) in + let boxing_space = !!536 (* By Obj.reachable_words. *) in + ret_succ_adding accu (boxing_space +! (h4w *? M.size)) + | Map_t (_, _, _) -> + let module M = (val Script_map.get_module x) in + let boxing_space = !!696 (* By Obj.reachable_words. *) in + ret_succ_adding accu (boxing_space +! (h5w *? M.size)) + | Big_map_t (cty, ty', _) -> + (big_map_size [@ocaml.tailcall]) + ~count_lambda_nodes + (ret_succ accu) + cty + ty' + x + | Contract_t (_, _) -> ret_succ (accu ++ contract_size x) + | Sapling_transaction_t _ -> + ret_succ_adding accu (Sapling.transaction_in_memory_size x) + | Sapling_transaction_deprecated_t _ -> + ret_succ_adding accu (Sapling.Legacy.transaction_in_memory_size x) + | Sapling_state_t _ -> ret_succ_adding accu (sapling_state_size x) + (* Operations are neither storable nor pushable, so they can appear neither + in the storage nor in the script. Hence they cannot appear in the cache + and we never need to measure their size. *) + | Operation_t -> assert false + | Chain_id_t -> ret_succ_adding accu chain_id_size + | Never_t -> ( match x with _ -> .) + | Bls12_381_g1_t -> ret_succ_adding accu !!Bls.Primitive.G1.size_in_memory + | Bls12_381_g2_t -> ret_succ_adding accu !!Bls.Primitive.G2.size_in_memory + | Bls12_381_fr_t -> ret_succ_adding accu !!Bls.Primitive.Fr.size_in_memory + | Ticket_t (_, _) -> ret_succ_adding accu (ticket_size x) + | Chest_key_t -> ret_succ_adding accu (chest_key_size x) + | Chest_t -> ret_succ_adding accu (chest_size x) + in + value_traverse ty x accu {apply} + +and big_map_size : + type a b bc. + count_lambda_nodes:bool -> + nodes_and_size -> + a comparable_ty -> + (b, bc) ty -> + (a, b) big_map -> + nodes_and_size = + fun ~count_lambda_nodes accu cty ty' (Big_map {id; diff; key_type; value_type}) -> + (* [Map.bindings] cannot overflow and only consumes a + logarithmic amount of stack. *) + let diff_size = + let map_size = + Big_map_overlay.fold + (fun _key_hash (key, value) accu -> + let base = h5w +! (word_size *? 3) +! script_expr_hash_size in + let accu = ret_succ_adding accu base in + (* The following recursive call cannot introduce a stack + overflow because this would require a key of type + big_map while big_map is not comparable. *) + let accu = value_size ~count_lambda_nodes accu cty key in + match value with + | None -> accu + | Some value -> + let accu = ret_succ_adding accu h1w in + (value_size [@ocaml.tailcall]) ~count_lambda_nodes accu ty' value) + diff.map + accu + in + ret_adding map_size h2w + in + let big_map_id_size s = z_size (Big_map.Id.unparse_to_z s) in + let id_size = option_size big_map_id_size id in + ret_adding + (ty_size key_type ++ ty_size value_type ++ diff_size) + (h4w +! id_size) + +and lambda_size : + type i o. + count_lambda_nodes:bool -> nodes_and_size -> (i, o) lambda -> nodes_and_size + = + fun ~count_lambda_nodes accu lam -> + let count_lambda_body kdescr node = + (* We assume that the nodes' size have already been counted if the + lambda is not a toplevel lambda. *) + let accu = + ret_adding + (accu ++ if count_lambda_nodes then node_size node else zero) + h2w + in + (kdescr_size [@ocaml.tailcall]) ~count_lambda_nodes:false accu kdescr + in + match lam with + | Lam (kdescr, node) -> count_lambda_body kdescr node + | LamRec (kdescr, node) -> count_lambda_body kdescr node + +and kdescr_size : + type a s r f. + count_lambda_nodes:bool -> + nodes_and_size -> + (a, s, r, f) kdescr -> + nodes_and_size = + fun ~count_lambda_nodes accu {kloc = _; kbef; kaft; kinstr} -> + let accu = + ret_adding (accu ++ stack_ty_size kbef ++ stack_ty_size kaft) h4w + in + (kinstr_size [@ocaml.tailcall]) ~count_lambda_nodes accu kinstr + +and kinstr_size : + type a s r f. + count_lambda_nodes:bool -> + nodes_and_size -> + (a, s, r, f) kinstr -> + nodes_and_size = + fun ~count_lambda_nodes accu t -> + (* To avoid forgetting counting things, the [apply] function below must ignore + no values (can be checked by grepping \b_\w*\b), except for the [ILog] case. + Use the [base] function depending on the number of continuations in the + instruction and only count other fields. + Location counts as zero because it's an immediate integer. + Continuations are counted by the [kinstr_traverse] function. + *) + let base0 (_loc : Script.location) = h1w in + let base1 (_loc : Script.location) (_k : (_, _, _, _) kinstr) = h2w in + let base2 (_loc : Script.location) (_k1 : (_, _, _, _) kinstr) + (_k2 : (_, _, _, _) kinstr) = + h3w + in + let base3 (_loc : Script.location) (_k1 : (_, _, _, _) kinstr) + (_k2 : (_, _, _, _) kinstr) (_k3 : (_, _, _, _) kinstr) = + h4w + in + let apply : + type a s r f. nodes_and_size -> (a, s, r, f) kinstr -> nodes_and_size = + fun accu t -> + match t with + | IDrop (loc, k) -> ret_succ_adding accu (base1 loc k) + | IDup (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISwap (loc, k) -> ret_succ_adding accu (base1 loc k) + | IConst (loc, ty, x, k) -> + let accu = ret_succ_adding accu (base1 loc k +! (word_size *? 2)) in + (value_size [@ocaml.tailcall]) + ~count_lambda_nodes + (accu ++ ty_size ty) + ty + x + | ICons_pair (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICar (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICdr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IUnpair (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICons_some (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICons_none (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | IIf_none {loc; branch_if_none = k1; branch_if_some = k2; k = k3} -> + ret_succ_adding accu (base3 loc k1 k2 k3) + | IOpt_map {loc; body = k1; k = k2} -> + ret_succ_adding accu (base2 loc k1 k2) + | ICons_left (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | ICons_right (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | IIf_left {loc; branch_if_left = k1; branch_if_right = k2; k = k3} -> + ret_succ_adding accu (base3 loc k1 k2 k3) + | ICons_list (loc, k) -> ret_succ_adding accu (base1 loc k) + | INil (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | IIf_cons {loc; branch_if_nil = k1; branch_if_cons = k2; k = k3} -> + ret_succ_adding accu (base3 loc k1 k2 k3) + | IList_map (loc, k1, ty, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size ty +! word_size) + | IList_iter (loc, ty, k1, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size ty +! word_size) + | IList_size (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEmpty_set (loc, cty, k) -> + ret_succ_adding (accu ++ ty_size cty) (base1 loc k +! word_size) + | ISet_iter (loc, ty, k1, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size ty +! word_size) + | ISet_mem (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISet_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISet_size (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEmpty_map (loc, cty, vty, k) -> + ret_succ_adding + (accu ++ ty_size cty) + (base1 loc k +! ty_for_logging_size vty +! (word_size *? 2)) + | IMap_map (loc, ty, k1, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size ty +! word_size) + | IMap_iter (loc, kvty, k1, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size kvty +! word_size) + | IMap_mem (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMap_get (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMap_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMap_get_and_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMap_size (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEmpty_big_map (loc, cty, ty, k) -> + ret_succ_adding + (accu ++ ty_size cty ++ ty_size ty) + (base1 loc k +! (word_size *? 2)) + | IBig_map_mem (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBig_map_get (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBig_map_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBig_map_get_and_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | IConcat_string (loc, k) -> ret_succ_adding accu (base1 loc k) + | IConcat_string_pair (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISlice_string (loc, k) -> ret_succ_adding accu (base1 loc k) + | IString_size (loc, k) -> ret_succ_adding accu (base1 loc k) + | IConcat_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IConcat_bytes_pair (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISlice_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBytes_size (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILsl_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILsr_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IOr_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAnd_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IXor_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | INot_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBytes_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | INat_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBytes_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IInt_bytes (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_seconds_to_timestamp (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_timestamp_to_seconds (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISub_timestamp_seconds (loc, k) -> ret_succ_adding accu (base1 loc k) + | IDiff_timestamps (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_tez (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISub_tez (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISub_tez_legacy (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_teznat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_nattez (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEdiv_teznat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEdiv_tez (loc, k) -> ret_succ_adding accu (base1 loc k) + | IOr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAnd (loc, k) -> ret_succ_adding accu (base1 loc k) + | IXor (loc, k) -> ret_succ_adding accu (base1 loc k) + | INot (loc, k) -> ret_succ_adding accu (base1 loc k) + | IIs_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | INeg (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAbs_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IInt_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISub_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEdiv_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEdiv_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILsl_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILsr_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IOr_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAnd_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAnd_int_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | IXor_nat (loc, k) -> ret_succ_adding accu (base1 loc k) + | INot_int (loc, k) -> ret_succ_adding accu (base1 loc k) + | IIf {loc; branch_if_true = k1; branch_if_false = k2; k = k3} -> + ret_succ_adding accu (base3 loc k1 k2 k3) + | ILoop (loc, k1, k2) -> ret_succ_adding accu (base2 loc k1 k2) + | ILoop_left (loc, k1, k2) -> ret_succ_adding accu (base2 loc k1 k2) + | IDip (loc, k1, ty, k2) -> + ret_succ_adding + accu + (base2 loc k1 k2 +! ty_for_logging_size ty +! word_size) + | IExec (loc, sty, k) -> + ret_succ_adding + accu + (base1 loc k +! stack_ty_for_logging_size sty +! word_size) + | IApply (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | ILambda (loc, lambda, k) -> + let accu = ret_succ_adding accu (base1 loc k +! word_size) in + (lambda_size [@ocaml.tailcall]) ~count_lambda_nodes accu lambda + | IFailwith (loc, ty) -> + ret_succ_adding (accu ++ ty_size ty) (base0 loc +! word_size) + | ICompare (loc, cty, k) -> + ret_succ_adding (accu ++ ty_size cty) (base1 loc k +! word_size) + | IEq (loc, k) -> ret_succ_adding accu (base1 loc k) + | INeq (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILt (loc, k) -> ret_succ_adding accu (base1 loc k) + | IGt (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILe (loc, k) -> ret_succ_adding accu (base1 loc k) + | IGe (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAddress (loc, k) -> ret_succ_adding accu (base1 loc k) + | IContract (loc, ty, s, k) -> + ret_succ_adding + (accu ++ ty_size ty) + (base1 loc k +! Entrypoint.in_memory_size s +! (word_size *? 2)) + | IView (loc, s, sty, k) -> + ret_succ_adding + (accu ++ view_signature_size s) + (base1 loc k +! stack_ty_for_logging_size sty +! (word_size *? 2)) + | ITransfer_tokens (loc, k) -> ret_succ_adding accu (base1 loc k) + | IImplicit_account (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICreate_contract {loc; storage_type; code; k} -> + ret_succ_adding + (accu ++ ty_size storage_type ++ expr_size code) + (base1 loc k +! (word_size *? 2)) + | ISet_delegate (loc, k) -> ret_succ_adding accu (base1 loc k) + | INow (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMin_block_time (loc, k) -> ret_succ_adding accu (base1 loc k) + | IBalance (loc, k) -> ret_succ_adding accu (base1 loc k) + | ILevel (loc, k) -> ret_succ_adding accu (base1 loc k) + | ICheck_signature (loc, k) -> ret_succ_adding accu (base1 loc k) + | IHash_key (loc, k) -> ret_succ_adding accu (base1 loc k) + | IPack (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | IUnpack (loc, ty, k) -> + ret_succ_adding (accu ++ ty_size ty) (base1 loc k +! word_size) + | IBlake2b (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISha256 (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISha512 (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISource (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISender (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISelf (loc, ty, s, k) -> + ret_succ_adding + (accu ++ ty_size ty) + (base1 loc k +! (word_size *? 2) +! Entrypoint.in_memory_size s) + | ISelf_address (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAmount (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISapling_empty_state (loc, m, k) -> + ret_succ_adding + accu + (base1 loc k +! word_size +! Sapling.Memo_size.in_memory_size m) + | ISapling_verify_update (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISapling_verify_update_deprecated (loc, k) -> + ret_succ_adding accu (base1 loc k) + | IDig (loc, n, w, k) -> + ret_succ_adding + (accu ++ stack_prefix_preservation_witness_size n w) + (base1 loc k +! (word_size *? 2)) + | IDug (loc, n, w, k) -> + ret_succ_adding + (accu ++ stack_prefix_preservation_witness_size n w) + (base1 loc k +! (word_size *? 2)) + | IDipn (loc, n, w, k1, k2) -> + ret_succ_adding + (accu ++ stack_prefix_preservation_witness_size n w) + (base2 loc k1 k2 +! (word_size *? 2)) + | IDropn (loc, n, w, k) -> + ret_succ_adding + (accu ++ stack_prefix_preservation_witness_size n w) + (base1 loc k +! (word_size *? 2)) + | IChainId (loc, k) -> ret_succ_adding accu (base1 loc k) + | INever loc -> ret_succ_adding accu (base0 loc) + | IVoting_power (loc, k) -> ret_succ_adding accu (base1 loc k) + | ITotal_voting_power (loc, k) -> ret_succ_adding accu (base1 loc k) + | IKeccak (loc, k) -> ret_succ_adding accu (base1 loc k) + | ISha3 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_bls12_381_g1 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_bls12_381_g2 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IAdd_bls12_381_fr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_bls12_381_g1 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_bls12_381_g2 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_bls12_381_fr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_bls12_381_z_fr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IMul_bls12_381_fr_z (loc, k) -> ret_succ_adding accu (base1 loc k) + | IInt_bls12_381_fr (loc, k) -> ret_succ_adding accu (base1 loc k) + | INeg_bls12_381_g1 (loc, k) -> ret_succ_adding accu (base1 loc k) + | INeg_bls12_381_g2 (loc, k) -> ret_succ_adding accu (base1 loc k) + | INeg_bls12_381_fr (loc, k) -> ret_succ_adding accu (base1 loc k) + | IPairing_check_bls12_381 (loc, k) -> ret_succ_adding accu (base1 loc k) + | IComb (loc, n, w, k) -> + ret_succ_adding + accu + (base1 loc k +! (word_size *? 2) +! comb_gadt_witness_size n w) + | IUncomb (loc, n, w, k) -> + ret_succ_adding + accu + (base1 loc k +! (word_size *? 2) +! uncomb_gadt_witness_size n w) + | IComb_get (loc, n, w, k) -> + ret_succ_adding + accu + (base1 loc k +! (word_size *? 2) +! comb_get_gadt_witness_size n w) + | IComb_set (loc, n, w, k) -> + ret_succ_adding + accu + (base1 loc k +! (word_size *? 2) +! comb_set_gadt_witness_size n w) + | IDup_n (loc, n, w, k) -> + ret_succ_adding + accu + (base1 loc k +! (word_size *? 2) +! dup_n_gadt_witness_size n w) + | ITicket (loc, cty, k) -> + ret_succ_adding + accu + (base1 loc k +! ty_for_logging_size cty +! word_size) + | ITicket_deprecated (loc, cty, k) -> + ret_succ_adding + accu + (base1 loc k +! ty_for_logging_size cty +! word_size) + | IRead_ticket (loc, ty, k) -> + ret_succ_adding accu (base1 loc k +! ty_for_logging_size ty +! word_size) + | ISplit_ticket (loc, k) -> ret_succ_adding accu (base1 loc k) + | IJoin_tickets (loc, cty, k) -> + ret_succ_adding (accu ++ ty_size cty) (base1 loc k +! word_size) + | IOpen_chest (loc, k) -> ret_succ_adding accu (base1 loc k) + | IEmit {loc; tag; ty; unparsed_ty; k} -> + ret_succ_adding + (accu ++ ty_size ty ++ expr_size unparsed_ty) + (base1 loc k +! Entrypoint.in_memory_size tag +! (word_size *? 3)) + | IHalt loc -> ret_succ_adding accu (base0 loc) + | ILog _ -> + (* This instruction is ignored because it is only used for testing. + Keep this case at the end. *) + accu + in + kinstr_traverse t accu {apply} + +let lambda_size lam = lambda_size ~count_lambda_nodes:true zero lam + +let kinstr_size kinstr = kinstr_size ~count_lambda_nodes:true zero kinstr + +let value_size ty x = value_size ~count_lambda_nodes:true zero ty x + +module Internal_for_tests = struct + let ty_size = ty_size + + let kinstr_size = kinstr_size + + let stack_prefix_preservation_witness_size = + stack_prefix_preservation_witness_size_internal +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.mli b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.mli new file mode 100644 index 000000000000..41fc1434d1ad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides overapproximation of memory footprint for + Michelson-related values. + + These overapproximations are used by the cache to evaluate its own + memory footprint and enforce declared limit over its size. + +*) + +(** [value_size ty v] returns an overapproximation of the size of the + in-memory representation of [v] of type [ty]. *) +val value_size : + ('a, _) Script_typed_ir.ty -> 'a -> Cache_memory_helpers.nodes_and_size + +(** [lambda_size l] returns an overapproximation of the size of the + internal IR for the Michelson lambda abstraction [l]. *) +val lambda_size : + ('a, 'b) Script_typed_ir.lambda -> Cache_memory_helpers.nodes_and_size + +(** [node_size root] returns the size of the in-memory representation + of [root] in bytes. This is an over-approximation of the memory + actually consumed by [root] since no sharing is taken into + account. *) +val node_size : + ('loc, 'prim) Micheline.node -> Cache_memory_helpers.nodes_and_size + +(** Pointwise addition (reexport from {!Cache_memory_helpers}) *) +val ( ++ ) : + Cache_memory_helpers.nodes_and_size -> + Cache_memory_helpers.nodes_and_size -> + Cache_memory_helpers.nodes_and_size + +(** Zero vector (reexport from {!Cache_memory_helpers}) *) +val zero : Cache_memory_helpers.nodes_and_size + +(**/**) + +module Internal_for_tests : sig + (** [ty_size ty] returns an overapproximation of the size of the + in-memory representation of type [ty]. *) + val ty_size : + ('a, _) Script_typed_ir.ty -> Cache_memory_helpers.nodes_and_size + + (** [kinstr_size i] returns an overapproximation of the size of the + internal IR [i]. *) + val kinstr_size : + ('a, 's, 'r, 'f) Script_typed_ir.kinstr -> + Cache_memory_helpers.nodes_and_size + + val stack_prefix_preservation_witness_size : + ( 'a, + 'b, + 'c, + 'd, + 'e, + 'f, + 'g, + 'h ) + Script_typed_ir.stack_prefix_preservation_witness -> + Cache_memory_helpers.nodes_and_size +end diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.ml b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.ml new file mode 100644 index 000000000000..b2e4a9af007c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.ml @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr + +(** FIXME insert proper gas constants (the gas constant below was fitted on + a non-standard machine) *) +let nodes_cost ~nodes = + let open S in + let nodes = Cache_memory_helpers.Nodes.to_int nodes in + let coeff = safe_int 45 in + Gas_limit_repr.atomic_step_cost (mul coeff (S.safe_int nodes)) diff --git a/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.mli b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.mli new file mode 100644 index 000000000000..9789e3d104af --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/script_typed_ir_size_costs.mli @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [node_size_cost ~nodes] returns the cost of having called + a function in {!Script_typed_ir_size} that returned [nodes]. *) +val nodes_cost : nodes:Cache_memory_helpers.Nodes.t -> Gas_limit_repr.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/seed_repr.ml b/src/proto_016_PtMumbai/lib_protocol/seed_repr.ml new file mode 100644 index 000000000000..b84736293e3a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/seed_repr.ml @@ -0,0 +1,270 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Tezos Protocol Implementation - Random number generation *) + +type seed = B of State_hash.t + +type t = T of State_hash.t + +type sequence = S of State_hash.t + +type nonce = bytes + +type vdf_setup = Vdf.discriminant * Vdf.challenge + +type vdf_solution = Vdf.result * Vdf.proof + +let seed_to_bytes x = + let seed_to_state_hash (B b) = b in + State_hash.to_bytes (seed_to_state_hash x) + +let vdf_setup_encoding = + let open Data_encoding in + let vdf_discriminant_encoding = + conv_with_guard + Vdf.discriminant_to_bytes + (fun b -> + Option.to_result + ~none:"VDF discriminant could not be deserialised" + (Vdf.discriminant_of_bytes_opt b)) + (Fixed.(bytes Hex) Vdf.discriminant_size_bytes) + in + let vdf_challenge_encoding = + conv_with_guard + Vdf.challenge_to_bytes + (fun b -> + Option.to_result + ~none:"VDF challenge could not be deserialised" + (Vdf.challenge_of_bytes_opt b)) + (Fixed.(bytes Hex) Vdf.form_size_bytes) + in + tup2 vdf_discriminant_encoding vdf_challenge_encoding + +let vdf_solution_encoding = + let open Data_encoding in + let vdf_result_encoding = + conv_with_guard + Vdf.result_to_bytes + (fun b -> + Option.to_result + ~none:"VDF result could not be deserialised" + (Vdf.result_of_bytes_opt b)) + (Fixed.(bytes Hex) Vdf.form_size_bytes) + in + let vdf_proof_encoding = + conv_with_guard + Vdf.proof_to_bytes + (fun b -> + Option.to_result + ~none:"VDF proof could not be deserialised" + (Vdf.proof_of_bytes_opt b)) + (Fixed.(bytes Hex) Vdf.form_size_bytes) + in + tup2 vdf_result_encoding vdf_proof_encoding + +let pp_solution ppf solution = + let result, proof = solution in + Format.fprintf + ppf + "@[<v 2>VDF result: %a" + Hex.pp + (Hex.of_bytes (Vdf.result_to_bytes result)) ; + Format.fprintf + ppf + "@,VDF proof: %a" + Hex.pp + (Hex.of_bytes (Vdf.proof_to_bytes proof)) ; + Format.fprintf ppf "@]" + +let nonce_encoding = Data_encoding.Fixed.(bytes Hex) Constants_repr.nonce_length + +let zero_bytes = Bytes.make Nonce_hash.size '\000' + +let state_hash_encoding = + let open Data_encoding in + conv + State_hash.to_bytes + State_hash.of_bytes_exn + (Fixed.(bytes Hex) Nonce_hash.size) + +let seed_encoding = + let open Data_encoding in + conv (fun (B b) -> b) (fun b -> B b) state_hash_encoding + +let update_seed (B state) nonce = + B (State_hash.hash_bytes [State_hash.to_bytes state; nonce]) + +let initialize_new (B state) append = + T (State_hash.hash_bytes (State_hash.to_bytes state :: zero_bytes :: append)) + +let xor_higher_bits i b = + let higher = TzEndian.get_int32 b 0 in + let r = Int32.logxor higher i in + let res = Bytes.copy b in + TzEndian.set_int32 res 0 r ; + res + +let sequence (T state) n = + State_hash.to_bytes state |> xor_higher_bits n |> fun b -> + S (State_hash.hash_bytes [b]) + +let take (S state) = + let b = State_hash.to_bytes state in + let h = State_hash.hash_bytes [b] in + (State_hash.to_bytes h, S h) + +let take_int32 s bound = + if Compare.Int32.(bound <= 0l) then invalid_arg "Seed_repr.take_int32" + (* FIXME *) + else + let drop_if_over = + Int32.sub Int32.max_int (Int32.rem Int32.max_int bound) + in + let rec loop s = + let bytes, s = take s in + let r = TzEndian.get_int32 bytes 0 in + (* The absolute value of min_int is min_int. Also, every + positive integer is represented twice (positive and negative), + but zero is only represented once. We fix both problems at + once. *) + let r = if Compare.Int32.(r = Int32.min_int) then 0l else Int32.abs r in + if Compare.Int32.(r >= drop_if_over) then loop s + else + let v = Int32.rem r bound in + (v, s) + in + loop s + +let take_int64 s bound = + if Compare.Int64.(bound <= 0L) then invalid_arg "Seed_repr.take_int64" + (* FIXME *) + else + let drop_if_over = + Int64.sub Int64.max_int (Int64.rem Int64.max_int bound) + in + + let rec loop s = + let bytes, s = take s in + let r = TzEndian.get_int64 bytes 0 in + (* The absolute value of min_int is min_int. Also, every + positive integer is represented twice (positive and negative), + but zero is only represented once. We fix both problems at + once. *) + let r = if Compare.Int64.(r = Int64.min_int) then 0L else Int64.abs r in + if Compare.Int64.(r >= drop_if_over) then loop s + else + let v = Int64.rem r bound in + (v, s) + in + loop s + +type error += Unexpected_nonce_length (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"unexpected_nonce_length" + ~title:"Unexpected nonce length" + ~description:"Nonce length is incorrect." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Nonce length is not %i bytes long as it should." + Constants_repr.nonce_length) + Data_encoding.empty + (function Unexpected_nonce_length -> Some () | _ -> None) + (fun () -> Unexpected_nonce_length) + +let make_nonce nonce = + if Compare.Int.(Bytes.length nonce <> Constants_repr.nonce_length) then + error Unexpected_nonce_length + else ok nonce + +let hash nonce = Nonce_hash.hash_bytes [nonce] + +let check_hash nonce hash = + Compare.Int.(Bytes.length nonce = Constants_repr.nonce_length) + && Nonce_hash.equal (Nonce_hash.hash_bytes [nonce]) hash + +let nonce_hash_key_part = Nonce_hash.to_path + +let initial_nonce_0 = zero_bytes + +let initial_nonce_hash_0 = hash initial_nonce_0 + +let deterministic_seed seed = update_seed seed zero_bytes + +let initial_seeds ?initial_seed n = + let rec loop acc elt i = + if Compare.Int.(i = 1) then List.rev (elt :: acc) + else loop (elt :: acc) (deterministic_seed elt) (i - 1) + in + let first_seed = + match initial_seed with + | Some initial_seed -> update_seed (B initial_seed) initial_nonce_0 + | None -> B (State_hash.hash_bytes []) + in + loop [] first_seed n + +let nonce_discriminant = Bytes.of_string "Tezos_generating_vdf_discriminant" + +let nonce_challenge = Bytes.of_string "Tezos_generating_vdf_challenge" + +let generate_vdf_setup ~seed_discriminant ~seed_challenge = + let size = Vdf.discriminant_size_bytes in + let seed = + update_seed seed_discriminant nonce_discriminant |> seed_to_bytes + in + let discriminant = Vdf.generate_discriminant ~seed size in + let input = update_seed seed_challenge nonce_challenge |> seed_to_bytes in + let challenge = Vdf.generate_challenge discriminant input in + (discriminant, challenge) + +let verify (discriminant, challenge) vdf_difficulty solution = + (* We return false when getting non group elements as input *) + let result, proof = solution in + (* Note: external library call must be wrapped to ensure that + exceptions are caught. *) + Option.catch (fun () -> + Vdf.verify discriminant challenge vdf_difficulty result proof) + +let vdf_to_seed seed_challenge solution = + let result, _ = solution in + update_seed seed_challenge (Vdf.result_to_bytes result) + +type seed_status = RANDAO_seed | VDF_seed + +let seed_status_encoding = + let to_bool = function RANDAO_seed -> false | VDF_seed -> true in + let of_bool t = if t then VDF_seed else RANDAO_seed in + Data_encoding.conv to_bool of_bool Data_encoding.bool + +let compare_vdf_solution solution solution' = + let result, _ = solution in + let result', _ = solution' in + Compare.Bytes.compare + (Vdf.result_to_bytes result) + (Vdf.result_to_bytes result') diff --git a/src/proto_016_PtMumbai/lib_protocol/seed_repr.mli b/src/proto_016_PtMumbai/lib_protocol/seed_repr.mli new file mode 100644 index 000000000000..343e8405ba84 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/seed_repr.mli @@ -0,0 +1,135 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Random number generation + + This is not expected to be a good cryptographic random number + generator. In particular this is supposed to be used in situations + where the seed is a globally known information. + + The only expected property is: It should be difficult to find a + seed such that the generated sequence is a given one. *) + +(** {2 Random Generation} *) + +(** The state of the random number generator *) +type t + +(** A random seed, to derive random sequences from *) +type seed + +(** A random sequence, to derive random values from *) +type sequence + +(** A VDF discriminant and challenge *) +type vdf_setup = Vdf.discriminant * Vdf.challenge + +(** A VDF result, to derive a seed from *) +type vdf_solution = Vdf.result * Vdf.proof + +val pp_solution : Format.formatter -> vdf_solution -> unit + +(** Compare only the first element of two vdf_solution, that are + of [Vdf.result]. *) +val compare_vdf_solution : vdf_solution -> vdf_solution -> int + +val generate_vdf_setup : + seed_discriminant:seed -> seed_challenge:seed -> vdf_setup + +val verify : vdf_setup -> Int64.t -> vdf_solution -> bool option + +val vdf_to_seed : seed -> vdf_solution -> seed + +(** [initialize_new state ident] returns a new generator *) +val initialize_new : seed -> bytes list -> t + +(** [sequence state n] prepares the n-th sequence of a state *) +val sequence : t -> int32 -> sequence + +(** Generates the next random value in the sequence *) +val take : sequence -> bytes * sequence + +(** [take_int32 s bound] generates the next random value as a bounded [int32] + + @param bound must be a positive integer + @raise Invalid_argument "Seed_repr.take_int32" if [bound] <= 0 + *) +val take_int32 : sequence -> int32 -> int32 * sequence + +(** [take_int64 s bound] generates the next random value as a bounded [int64] + + @param bound must be a positive integer + @raise Invalid_argument "Seed_repr.take_int64" if [bound] <= 0 + *) +val take_int64 : sequence -> int64 -> int64 * sequence + +(** {2 Entropy} *) + +(** A nonce for adding entropy to the generator *) +type nonce + +(** Add entropy to the seed generator *) +val update_seed : seed -> nonce -> seed + +(** Use a byte sequence as a nonce *) +val make_nonce : bytes -> nonce tzresult + +(** Compute the hash of a nonce *) +val hash : nonce -> Nonce_hash.t + +(** [check_hash nonce hash] is true if the nonce correspond to the hash *) +val check_hash : nonce -> Nonce_hash.t -> bool + +(** For using nonce hashes as keys in the hierarchical database *) +val nonce_hash_key_part : Nonce_hash.t -> string list -> string list + +(** Returns a new seed by hashing the one passed with a constant. *) +val deterministic_seed : seed -> seed + +(** [initial_seeds n] generates the first [n] seeds for which there are no nonces. + The first seed is a constant value. The kth seed is the hash of seed (k-1) + concatenated with a constant. If an [initial_seed] is provided, the + {i first} seed is created using it as the first one. *) +val initial_seeds : ?initial_seed:State_hash.t -> int -> seed list + +(** {2 Predefined nonce} *) + +val initial_nonce_0 : nonce + +val initial_nonce_hash_0 : Nonce_hash.t + +(** {2 Serializers} *) + +val nonce_encoding : nonce Data_encoding.t + +val seed_encoding : seed Data_encoding.t + +val vdf_setup_encoding : vdf_setup Data_encoding.t + +val vdf_solution_encoding : vdf_solution Data_encoding.t + +type seed_status = RANDAO_seed | VDF_seed + +val seed_status_encoding : seed_status Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/seed_storage.ml b/src/proto_016_PtMumbai/lib_protocol/seed_storage.ml new file mode 100644 index 000000000000..90021630c113 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/seed_storage.ml @@ -0,0 +1,259 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Lwt_result_syntax + +type seed_computation_status = + | Nonce_revelation_stage + | Vdf_revelation_stage of { + seed_discriminant : Seed_repr.seed; + seed_challenge : Seed_repr.seed; + } + | Computation_finished + +type error += + | (* `Permanent *) + Unknown of { + oldest : Cycle_repr.t; + cycle : Cycle_repr.t; + latest : Cycle_repr.t; + } + | Already_accepted + | Unverified_vdf + | Too_early_revelation + +let () = + register_error_kind + `Permanent + ~id:"seed.unknown_seed" + ~title:"Unknown seed" + ~description:"The requested seed is not available" + ~pp:(fun ppf (oldest, cycle, latest) -> + if Cycle_repr.(cycle < oldest) then + Format.fprintf + ppf + "The seed for cycle %a has been cleared from the context (oldest \ + known seed is for cycle %a)" + Cycle_repr.pp + cycle + Cycle_repr.pp + oldest + else + Format.fprintf + ppf + "The seed for cycle %a has not been computed yet (latest known seed \ + is for cycle %a)" + Cycle_repr.pp + cycle + Cycle_repr.pp + latest) + Data_encoding.( + obj3 + (req "oldest" Cycle_repr.encoding) + (req "requested" Cycle_repr.encoding) + (req "latest" Cycle_repr.encoding)) + (function + | Unknown {oldest; cycle; latest} -> Some (oldest, cycle, latest) + | _ -> None) + (fun (oldest, cycle, latest) -> Unknown {oldest; cycle; latest}) ; + register_error_kind + `Temporary + ~id:"vdf.too_early_revelation" + ~title:"Too early VDF revelation" + ~description:"VDF revelation before the end of the nonce revelation period" + Data_encoding.unit + (function Too_early_revelation -> Some () | _ -> None) + (fun () -> Too_early_revelation) ; + register_error_kind + `Branch + ~id:"vdf.unverified_result" + ~title:"Unverified VDF" + ~description:"VDF verification failed" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "A correct VDF result and Wesolowski's proof are expected") + Data_encoding.unit + (function Unverified_vdf -> Some () | _ -> None) + (fun () -> Unverified_vdf) ; + register_error_kind + `Branch + ~id:"vdf.previously_revealed" + ~title:"Previously revealed VDF" + ~description:"Duplicate VDF revelation in cycle" + Data_encoding.unit + (function Already_accepted -> Some () | _ -> None) + (fun () -> Already_accepted) + +let purge_nonces_and_get_unrevealed ctxt ~cycle = + let levels = Level_storage.levels_with_commitments_in_cycle ctxt cycle in + let combine (c, unrevealed) level = + Storage.Seed.Nonce.get c level >>=? function + | Revealed _ -> + let+ c = Storage.Seed.Nonce.remove_existing c level in + (c, unrevealed) + | Unrevealed u -> + let+ c = Storage.Seed.Nonce.remove_existing c level in + (c, u :: unrevealed) + in + List.fold_left_es combine (ctxt, []) levels + +let compute_randao ctxt = + let current_cycle = (Level_storage.current ctxt).cycle in + let preserved = Constants_storage.preserved_cycles ctxt in + let cycle_computed = Cycle_repr.add current_cycle (preserved + 1) in + let*! seed_computed = Storage.Seed.For_cycle.mem ctxt cycle_computed in + (* Check if seed has already been computed, and not in cycle 0. *) + match Cycle_repr.(pred current_cycle, pred cycle_computed) with + | Some prev_cycle, Some prev_cycle_computed when not seed_computed -> + (* Retrieve the levels with nonce commitments in the previous cycle. *) + let levels = + Level_storage.levels_with_commitments_in_cycle ctxt prev_cycle + in + (* Retrieve previous preserved seed. *) + let* prev_seed = Storage.Seed.For_cycle.get ctxt prev_cycle_computed in + (* Generate preserved seed by updating previous preserved seed with current revealed nonces. *) + let combine (c, random_seed) level = + Storage.Seed.Nonce.get c level >>=? function + | Revealed nonce -> return (c, Seed_repr.update_seed random_seed nonce) + | Unrevealed _ -> return (c, random_seed) + in + let seed = Seed_repr.deterministic_seed prev_seed in + let* c, seed = List.fold_left_es combine (ctxt, seed) levels in + Storage.Seed.For_cycle.init c cycle_computed seed + | _, _ -> return ctxt + +let get_seed_computation_status ctxt = + let current_level = Level_storage.current ctxt in + let current_cycle = current_level.cycle in + let nonce_revelation_threshold = + Constants_storage.nonce_revelation_threshold ctxt + in + if Compare.Int32.(current_level.cycle_position < nonce_revelation_threshold) + then return Nonce_revelation_stage + else + let* status = Storage.Seed.get_status ctxt in + match status with + | RANDAO_seed -> + let preserved = Constants_storage.preserved_cycles ctxt in + let cycle_computed = Cycle_repr.add current_cycle (preserved + 1) in + let previous_cycle = Cycle_repr.add current_cycle preserved in + let* seed_discriminant = + Storage.Seed.For_cycle.get ctxt previous_cycle + in + let* seed_challenge = Storage.Seed.For_cycle.get ctxt cycle_computed in + return (Vdf_revelation_stage {seed_discriminant; seed_challenge}) + | VDF_seed -> return Computation_finished + +let check_vdf ctxt vdf_solution = + let* r = get_seed_computation_status ctxt in + let*? seed_discriminant, seed_challenge = + match r with + | Computation_finished -> error Already_accepted + | Nonce_revelation_stage -> error Too_early_revelation + | Vdf_revelation_stage {seed_discriminant; seed_challenge} -> + ok (seed_discriminant, seed_challenge) + in + (* To avoid recomputing the discriminant and challenge for every (potentially + * invalid) submission in a cycle, we compute them once and store them *) + let* stored = Storage.Seed.VDF_setup.find ctxt in + let* ctxt, setup = + match stored with + | None -> + let setup = + Seed_repr.generate_vdf_setup ~seed_discriminant ~seed_challenge + in + let*! ctxt = Storage.Seed.VDF_setup.add ctxt setup in + return (ctxt, setup) + | Some setup -> return (ctxt, setup) + in + let*? () = + error_unless + (Option.value + ~default:false + (Seed_repr.verify + setup + (Constants_storage.vdf_difficulty ctxt) + vdf_solution)) + Unverified_vdf + in + return () + +let update_seed ctxt vdf_solution = + let open Lwt_result_syntax in + (* compute and update seed and change seed status from RANDAO to + VDF *) + let current_cycle = (Level_storage.current ctxt).cycle in + let preserved = Constants_storage.preserved_cycles ctxt in + let cycle_computed = Cycle_repr.add current_cycle (preserved + 1) in + let* seed_challenge = Storage.Seed.For_cycle.get ctxt cycle_computed in + let new_seed = Seed_repr.vdf_to_seed seed_challenge vdf_solution in + Storage.Seed.For_cycle.update ctxt cycle_computed new_seed Seed_repr.VDF_seed + +let raw_for_cycle = Storage.Seed.For_cycle.get + +let for_cycle ctxt cycle = + let preserved = Constants_storage.preserved_cycles ctxt in + let max_slashing_period = Constants_storage.max_slashing_period ctxt in + let current_cycle = (Level_storage.current ctxt).cycle in + let latest = + if Cycle_repr.(current_cycle = root) then + Cycle_repr.add current_cycle (preserved + 1) + else Cycle_repr.add current_cycle preserved + in + let oldest = + match Cycle_repr.sub current_cycle (max_slashing_period - 1) with + | None -> Cycle_repr.root + | Some oldest -> oldest + in + let*? () = + error_unless + Cycle_repr.(oldest <= cycle && cycle <= latest) + (Unknown {oldest; cycle; latest}) + in + Storage.Seed.For_cycle.get ctxt cycle + +let init ?initial_seed ctxt = + let preserved = Constants_storage.preserved_cycles ctxt in + let* ctxt = Storage.Seed_status.init ctxt Seed_repr.RANDAO_seed in + List.fold_left_es + (fun (c, ctxt) seed -> + let cycle = Cycle_repr.of_int32_exn (Int32.of_int c) in + let+ ctxt = Storage.Seed.For_cycle.init ctxt cycle seed in + (c + 1, ctxt)) + (0, ctxt) + (Seed_repr.initial_seeds ?initial_seed (preserved + 2)) + >|=? snd + +let cycle_end ctxt last_cycle = + let*! ctxt = Storage.Seed.VDF_setup.remove ctxt in + (* NB: the clearing of past seeds is done elsewhere by the caller *) + match Cycle_repr.pred last_cycle with + | None -> return (ctxt, []) + | Some previous_cycle -> + (* cycle with revelations *) + purge_nonces_and_get_unrevealed ctxt ~cycle:previous_cycle + +let remove_for_cycle = Storage.Seed.For_cycle.remove_existing diff --git a/src/proto_016_PtMumbai/lib_protocol/seed_storage.mli b/src/proto_016_PtMumbai/lib_protocol/seed_storage.mli new file mode 100644 index 000000000000..93c8520aee94 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/seed_storage.mli @@ -0,0 +1,100 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This modules handles the storage of random nonce seeds. + + This module is responsible for maintaining the table + {!Storage.Seed.For_cycle}. *) + +type seed_computation_status = + | Nonce_revelation_stage + | Vdf_revelation_stage of { + seed_discriminant : Seed_repr.seed; + seed_challenge : Seed_repr.seed; + } + | Computation_finished + +type error += + | (* `Permanent *) + Unknown of { + oldest : Cycle_repr.t; + cycle : Cycle_repr.t; + latest : Cycle_repr.t; + } + | Already_accepted + | Unverified_vdf + | Too_early_revelation + +(** Generates the first [preserved_cycles+2] seeds for which + there are no nonces. *) +val init : + ?initial_seed:State_hash.t -> Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** Verifies if a VDF (result, proof) is valid. + + @return [Error Too_early_revelation] if the nonce revelation + threshold is greater than the current level cycle position. + + @return [Error Already_accepted] if a VDF seed has already been + recorded. + + @return [Error Unverified_vdf] if the {!Seed_repr.vdf_solution} is + not verified. *) +val check_vdf : Raw_context.t -> Seed_repr.vdf_solution -> unit tzresult Lwt.t + +(** Updates the seed with a function of the VDF result. *) +val update_seed : + Raw_context.t -> Seed_repr.vdf_solution -> Raw_context.t tzresult Lwt.t + +(** Returns the seed associated with the given cycle. Returns a generic storage + error when the seed is not available. *) +val raw_for_cycle : + Raw_context.t -> Cycle_repr.t -> Seed_repr.seed tzresult Lwt.t + +(** Returns the seed associated with the given cycle. Returns the {!Unknown} + error when the seed is not available. *) +val for_cycle : Raw_context.t -> Cycle_repr.t -> Seed_repr.seed tzresult Lwt.t + +(** Computes RANDAO output for cycle #(current_cycle + preserved + 1) *) +val compute_randao : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** Must be run at the end of the cycle, resets the VDF state and returns + unrevealed nonces to know which party has to forfeit its endorsing + rewards for that cycle. *) +val cycle_end : + Raw_context.t -> + Cycle_repr.t -> + (Raw_context.t * Nonce_storage.unrevealed list) tzresult Lwt.t + +(** Return the random seed computation status, that is whether the VDF + computation period has started, and if so the information needed, or if it has + finished for the current cycle. *) +val get_seed_computation_status : + Raw_context.t -> seed_computation_status tzresult Lwt.t + +(** Removes the seed associated with the given cycle from the storage. It + assumes the seed exists. If it does not it returns a generic storage error. *) +val remove_for_cycle : + Raw_context.t -> Cycle_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/services_registration.ml b/src/proto_016_PtMumbai/lib_protocol/services_registration.ml new file mode 100644 index 000000000000..de94c5dbdf69 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/services_registration.ml @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type rpc_context = { + block_hash : Block_hash.t; + block_header : Block_header.shell_header; + context : Alpha_context.t; +} + +let rpc_init ({block_hash; block_header; context} : Updater.rpc_context) mode = + let timestamp = block_header.timestamp in + let level = + match mode with + | `Head_level -> block_header.level + | `Successor_level -> Int32.succ block_header.level + in + Alpha_context.prepare + ~level + ~predecessor_timestamp:timestamp + ~timestamp + context + >|=? fun (context, _, _) -> {block_hash; block_header; context} + +let rpc_services = + ref (RPC_directory.empty : Updater.rpc_context RPC_directory.t) + +let register0_fullctxt ~chunked s f = + rpc_services := + RPC_directory.register ~chunked !rpc_services s (fun ctxt q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt q i) + +let register0 ~chunked s f = + register0_fullctxt ~chunked s (fun {context; _} -> f context) + +let register0_noctxt ~chunked s f = + rpc_services := + RPC_directory.register ~chunked !rpc_services s (fun _ q i -> f q i) + +let register1_fullctxt ~chunked s f = + rpc_services := + RPC_directory.register ~chunked !rpc_services s (fun (ctxt, arg) q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt arg q i) + +let register1 ~chunked s f = + register1_fullctxt ~chunked s (fun {context; _} x -> f context x) + +let register2_fullctxt ~chunked s f = + rpc_services := + RPC_directory.register + ~chunked + !rpc_services + s + (fun ((ctxt, arg1), arg2) q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt arg1 arg2 q i) + +let register2 ~chunked s f = + register2_fullctxt ~chunked s (fun {context; _} a1 a2 q i -> + f context a1 a2 q i) + +let opt_register0_fullctxt ~chunked s f = + rpc_services := + RPC_directory.opt_register ~chunked !rpc_services s (fun ctxt q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt q i) + +let opt_register0 ~chunked s f = + opt_register0_fullctxt ~chunked s (fun {context; _} -> f context) + +let opt_register1_fullctxt ~chunked s f = + rpc_services := + RPC_directory.opt_register ~chunked !rpc_services s (fun (ctxt, arg) q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt arg q i) + +let opt_register1 ~chunked s f = + opt_register1_fullctxt ~chunked s (fun {context; _} x -> f context x) + +let opt_register2_fullctxt ~chunked s f = + rpc_services := + RPC_directory.opt_register + ~chunked + !rpc_services + s + (fun ((ctxt, arg1), arg2) q i -> + rpc_init ctxt `Head_level >>=? fun ctxt -> f ctxt arg1 arg2 q i) + +let opt_register2 ~chunked s f = + opt_register2_fullctxt ~chunked s (fun {context; _} a1 a2 q i -> + f context a1 a2 q i) + +let get_rpc_services () = + let p = + RPC_directory.map + (fun c -> + rpc_init c `Head_level >|= function + | Error t -> + raise (Failure (Format.asprintf "%a" Error_monad.pp_trace t)) + | Ok c -> c.context) + (Storage_description.build_directory Alpha_context.description) + in + RPC_directory.register_dynamic_directory + !rpc_services + RPC_path.(open_root / "context" / "raw" / "json") + (fun _ -> Lwt.return p) diff --git a/src/proto_016_PtMumbai/lib_protocol/services_registration.mli b/src/proto_016_PtMumbai/lib_protocol/services_registration.mli new file mode 100644 index 000000000000..c6bc2ed72c92 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/services_registration.mli @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Functions for RPC service registration, using [Updater.rpc_context] and + [RPC_service.t] from the Protocol Environment. + + This module is a frontend to a mutable service directory. The various + [register] functions update the directory as a side-effect. + + The [get_rpc_services] function returns the resulting [RPC_context]. It is + parameterized by [Updater.rpc_context] which acts as the service prefix (in + practice meaning this type will be passed to each handler). Hence, + Protocol RPC services provide a {i read-only} view of the Ledger state. + *) + +open Alpha_context + +type rpc_context = { + block_hash : Block_hash.t; + block_header : Block_header.shell_header; + context : t; +} + +(** [rpc_init rpc_context mode] allows to instantiate an [rpc_context] + using the [Alpha_context] representation from a raw context + representation (the one the shell knows). + + If [mode = `Head_level], the [Alpha_context] uses the same level + as the head of the chain (given by [rpc_context.block_header]). + + If [mode= `Successor_level], the [Alpha_context] uses the + successor level of the head. + + This function aims to be used by RPCs, in particular by RPCs which + simulate an operation to determine the fees/gas of an + operation. Using the [`Head_level] can be dangerous if some storage + paths depend on the level. Using the successor level allows to + ensure that the simulation is done on a fresh level. *) +val rpc_init : + Updater.rpc_context -> + [`Head_level | `Successor_level] -> + rpc_context Error_monad.tzresult Lwt.t + +val register0 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + Updater.rpc_context, + 'a, + 'b, + 'c ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c Error_monad.tzresult Lwt.t) -> + unit + +val register0_noctxt : + chunked:bool -> + ([< RPC_service.meth], Updater.rpc_context, 'a, 'b, 'c, 'd) RPC_service.t -> + ('b -> 'c -> 'd Error_monad.tzresult Lwt.t) -> + unit + +val register1 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + Updater.rpc_context * 'a, + 'b, + 'c, + 'd ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c -> 'd Error_monad.tzresult Lwt.t) -> + unit + +val register2 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + (Updater.rpc_context * 'a) * 'b, + 'c, + 'd, + 'e ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c -> 'd -> 'e Error_monad.tzresult Lwt.t) -> + unit + +val opt_register0 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + Updater.rpc_context, + 'a, + 'b, + 'c ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c option Error_monad.tzresult Lwt.t) -> + unit + +val opt_register1 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + Updater.rpc_context * 'a, + 'b, + 'c, + 'd ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c -> 'd option Error_monad.tzresult Lwt.t) -> + unit + +val opt_register2 : + chunked:bool -> + ( [< RPC_service.meth], + Updater.rpc_context, + (Updater.rpc_context * 'a) * 'b, + 'c, + 'd, + 'e ) + RPC_service.t -> + (t -> 'a -> 'b -> 'c -> 'd -> 'e option Error_monad.tzresult Lwt.t) -> + unit + +val get_rpc_services : unit -> Updater.rpc_context RPC_directory.directory diff --git a/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.ml b/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.ml new file mode 100644 index 000000000000..a7cb61d4eba5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.ml @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module S = Saturation_repr + +(* model model_next *) +(* fun size -> (41.51416897 * (log2 (1 + size))) *) +let model_next ~length = + let open S.Syntax in + let length = S.safe_z length in + S.safe_int 42 * log2 (S.safe_int 1 + length) + +(* model model_hash_cell *) +(* fun size -> (614.246755643 + (33.7098924139 * size)) *) +let model_hash_cell ~backpointers_count = + let open S.Syntax in + let backpointers_count = S.safe_int backpointers_count in + S.safe_int 614 + (S.safe_int 34 * backpointers_count) + +(* model model_hash_cell *) +(* fun size -> (614.246755643 + (33.7098924139 * size)) *) +let model_hash_cell_computed_backpointers_count ~index = + let open S.Syntax in + let backpointers_count = log2 (S.safe_z index) in + S.safe_int 614 + (S.safe_int 34 * backpointers_count) diff --git a/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.mli b/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.mli new file mode 100644 index 000000000000..65e868bb0e73 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/skip_list_costs.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [model_next ~length] returns the gas cost of inserting a cell in a + skip list of a given [length], assuming basis equals 2. *) +val model_next : length:Z.t -> Saturation_repr.may_saturate Saturation_repr.t + +(** [model_hash_cell ~backpointers_count] returns the gas cost of + hashing the last cell with a given [backpointers_count], assuming + basis equals 2. *) +val model_hash_cell : + backpointers_count:int -> Saturation_repr.may_saturate Saturation_repr.t + +(** [model_hash_cell_computed_backpointers_count ~index] same as + {!model_hash_cell} but compute the number of backpointers a specific cell + will have. Assuming basis equals 2. *) +val model_hash_cell_computed_backpointers_count : + index:Z.t -> Saturation_repr.may_saturate Saturation_repr.t diff --git a/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.ml b/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.ml new file mode 100644 index 000000000000..53449ddc56d1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.ml @@ -0,0 +1,586 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module type MONAD = sig + type 'a t + + val bind : 'a t -> ('a -> 'b t) -> 'b t + + val return : 'a -> 'a t +end + +module type S = sig + type ('content, 'ptr) cell + + val pp : + pp_ptr:(Format.formatter -> 'ptr -> unit) -> + pp_content:(Format.formatter -> 'content -> unit) -> + Format.formatter -> + ('content, 'ptr) cell -> + unit + + val equal : + ('ptr -> 'ptr -> bool) -> + ('content -> 'content -> bool) -> + ('content, 'ptr) cell -> + ('content, 'ptr) cell -> + bool + + val encoding : + 'ptr Data_encoding.t -> + 'content Data_encoding.t -> + ('content, 'ptr) cell Data_encoding.t + + val index : (_, _) cell -> Z.t + + val content : ('content, 'ptr) cell -> 'content + + val back_pointer : ('content, 'ptr) cell -> int -> 'ptr option + + val back_pointers : ('content, 'ptr) cell -> 'ptr list + + val genesis : 'content -> ('content, 'ptr) cell + + val next : + prev_cell:('content, 'ptr) cell -> + prev_cell_ptr:'ptr -> + 'content -> + ('content, 'ptr) cell + + type ('ptr, 'content) search_cell_result = + | Found of ('ptr, 'content) cell + | Nearest of { + lower : ('ptr, 'content) cell; + upper : ('ptr, 'content) cell option; + } + | No_exact_or_lower_ptr + | Deref_returned_none + + type ('ptr, 'content) search_result = { + rev_path : ('ptr, 'content) cell list; + last_cell : ('ptr, 'content) search_cell_result; + } + + val pp_search_result : + pp_cell:(Format.formatter -> ('ptr, 'content) cell -> unit) -> + Format.formatter -> + ('ptr, 'content) search_result -> + unit + + module type MONADIC = sig + type 'a result + + val find : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + ('content, 'ptr) cell option result + + val back_path : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + 'ptr list option result + + val valid_back_path : + equal_ptr:('ptr -> 'ptr -> bool) -> + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_ptr:'ptr -> + 'ptr list -> + bool result + + val search : + deref:('ptr -> ('content, 'ptr) cell option result) -> + compare:('content -> int) -> + cell:('content, 'ptr) cell -> + ('content, 'ptr) search_result result + end + + include MONADIC with type 'a result := 'a + + module Lwt : MONADIC with type 'a result := 'a Lwt.t + + module Make_monadic (M : MONAD) : MONADIC with type 'a result := 'a M.t +end + +module Make (Parameters : sig + val basis : int +end) : S = struct + let () = assert (Compare.Int.(Parameters.basis >= 2)) + + open Parameters + + (* + + A cell of a skip list with some [`content] and back pointers of + type [`ptr]. + + Invariants + ---------- + + - back_pointers[i] + = Some (pointer to (index - (index mod (basis ** i)) - 1)) + (for all i < length back_pointers) + - length back_pointers = log basis index + + Notes + ----- + + - The [index] field is not strictly required but helps in making + the data structure more robust. Indeed, otherwise, we should + also ask the client to provide the index of the cell to be + built, which can be error-prone. + + - The back pointers of a cell are chosen from the back pointers of + its predecessor (except for the genesis cell) and a pointer to this + predecessor. This locality makes the insertion of new cell very + efficient in practice. + + *) + type ('content, 'ptr) cell = { + content : 'content; + back_pointers : 'ptr option FallbackArray.t; + index : Z.t; + } + + let equal equal_ptr equal_content cell1 cell2 = + let equal_back_pointers b1 b2 = + let open FallbackArray in + Compare.Int.(length b1 = length b2) + && fst + @@ fold + (fun (equal, i) h1 -> + (equal && Option.equal equal_ptr h1 (get b2 i), i + 1)) + b1 + (true, 0) + in + let {content; back_pointers; index} = cell1 in + equal_content content cell2.content + && Compare.Z.equal index cell2.index + && equal_back_pointers back_pointers cell2.back_pointers + + let index cell = cell.index + + let back_pointers_to_list a = + FallbackArray.fold + (fun l -> function + | Some ptr -> ptr :: l + | None -> (* By [cell] invariants. *) assert false) + a + [] + |> List.rev + + let pp ~pp_ptr ~pp_content fmt {content; back_pointers; index} = + Format.fprintf + fmt + {| + content = %a + index = %s + back_pointers = %a + |} + pp_content + content + (Z.to_string index) + (Format.pp_print_list pp_ptr) + (back_pointers_to_list back_pointers) + + let encoding ptr_encoding content_encoding = + let of_list = + FallbackArray.of_list ~fallback:None ~proj:(fun c -> Some c) + in + let to_list = back_pointers_to_list in + let open Data_encoding in + conv + (fun {index; content; back_pointers} -> + (index, content, to_list back_pointers)) + (fun (index, content, back_pointers) -> + {index; content; back_pointers = of_list back_pointers}) + (obj3 + (req "index" n) + (req "content" content_encoding) + (req "back_pointers" (list ptr_encoding))) + + let content cell = cell.content + + let back_pointers cell = back_pointers_to_list cell.back_pointers + + let genesis content = + {index = Z.zero; content; back_pointers = FallbackArray.make 0 None} + + let back_pointer cell i = FallbackArray.get cell.back_pointers i + + (* Precondition: i < length cell.back_pointers *) + let back_pointer_unsafe cell i = + match FallbackArray.get cell.back_pointers i with + | Some ptr -> ptr + | None -> (* By precondition and invariants of cells. *) assert false + + let next ~prev_cell ~prev_cell_ptr content = + let index = Z.succ prev_cell.index in + let back_pointers = + let rec aux power accu i = + if Compare.Z.(index < power) then List.rev accu + else + let back_pointer_i = + if Compare.Z.(Z.rem index power = Z.zero) then prev_cell_ptr + else + (* The following call is valid because of + - [i < List.length prev_cell.back_pointer] + because [log_basis index = log_basis prev_cell.index] + - the invariants of [prev_cell] *) + back_pointer_unsafe prev_cell i + in + let accu = back_pointer_i :: accu in + aux Z.(mul power (of_int basis)) accu (i + 1) + in + aux Z.one [] 0 + in + let back_pointers = + FallbackArray.of_list ~fallback:None ~proj:Option.some back_pointers + in + {index; content; back_pointers} + + (* returns the array of [basis^i] forall [i < len (back_pointers cell)] *) + let list_powers cell = + let rec aux n prev p = + if Compare.Int.(n <= 0) then List.rev p + else aux (n - 1) (basis * prev) (prev :: p) + in + FallbackArray.of_list + ~fallback:0 + ~proj:(fun x -> x) + (aux (FallbackArray.length cell.back_pointers) 1 []) + + (* + [back_pointers] are sorted in decreasing order of their pointing cell index + in the list. So we can do a [binary_search] to find the [cell] with the + smallest index that is greater than [target] in the list. + + More formally, min({c : cell | c.index >= target.index}) where [c] is one of + the pointed cells in the array of back pointers of the [cell] parameter. + *) + let best_skip cell target_index powers = + let open FallbackArray in + let pointed_cell_index i = + Z.(pred @@ sub cell.index (rem cell.index (of_int (get powers i)))) + in + (* cell.index - (cell.index mod get powers i) - 1 in *) + let rec binary_search start_idx end_idx = + if Compare.Int.(start_idx >= end_idx) then Some start_idx + else + let mid_idx = start_idx + ((end_idx - start_idx) / 2) in + let mid_cell_index = pointed_cell_index mid_idx in + if Compare.Z.(mid_cell_index = target_index) then Some mid_idx + else if Compare.Z.(mid_cell_index < target_index) then + binary_search start_idx (mid_idx - 1) + else + let prev_mid_cell_index = pointed_cell_index (mid_idx + 1) in + if Compare.Z.(prev_mid_cell_index = target_index) then + Some (mid_idx + 1) + else if Compare.Z.(prev_mid_cell_index < target_index) then + (* + If (mid_cell_index > target_index) && + (prev_mid_cell_index < target_index) + then we found the closest cell to the target, which is mid_cell, + so we return its index [mid_idx] in the array of back_pointers. + *) + Some mid_idx + else binary_search (mid_idx + 1) end_idx + in + binary_search 0 (length cell.back_pointers - 1) + + type ('ptr, 'content) search_cell_result = + | Found of ('ptr, 'content) cell + | Nearest of { + lower : ('ptr, 'content) cell; + upper : ('ptr, 'content) cell option; + } + | No_exact_or_lower_ptr + | Deref_returned_none + + type ('ptr, 'content) search_result = { + rev_path : ('ptr, 'content) cell list; + last_cell : ('ptr, 'content) search_cell_result; + } + + let pp_rev_path ~pp_cell = + Format.pp_print_list ~pp_sep:Format.pp_print_space pp_cell + + let pp_search_cell_result ~pp_cell fmt = function + | Found cell -> Format.fprintf fmt "Found(%a)" pp_cell cell + | Nearest {lower; upper} -> + Format.fprintf + fmt + "Nearest(lower=%a;upper=%a)" + pp_cell + lower + (Format.pp_print_option pp_cell) + upper + | No_exact_or_lower_ptr -> Format.fprintf fmt "No_exact_or_lower_ptr" + | Deref_returned_none -> Format.fprintf fmt "Deref_returned_none" + + let pp_search_result ~pp_cell fmt {rev_path; last_cell} = + Format.fprintf + fmt + "{rev_path = %a; last_point = %a}" + (pp_rev_path ~pp_cell) + rev_path + (pp_search_cell_result ~pp_cell) + last_cell + + module type MONADIC = sig + type 'a result + + val find : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + ('content, 'ptr) cell option result + + val back_path : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + 'ptr list option result + + val valid_back_path : + equal_ptr:('ptr -> 'ptr -> bool) -> + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_ptr:'ptr -> + 'ptr list -> + bool result + + val search : + deref:('ptr -> ('content, 'ptr) cell option result) -> + compare:('content -> int) -> + cell:('content, 'ptr) cell -> + ('content, 'ptr) search_result result + end + + module Make_monadic (M : MONAD) : MONADIC with type 'a result := 'a M.t = + struct + module Monad_syntax = struct + include M + + let ( let* ) = bind + + module Option = struct + let (return [@ocaml.inline "always"]) = fun x -> M.return (Some x) + + let ( let* ) lo f = + M.bind lo (function None -> M.return None | Some x -> f x) + + let ( let*? ) o f = match o with Some x -> f x | None -> M.return None + end + end + + let rev_back_path ~deref ~cell_ptr ~target_index = + let open Monad_syntax.Option in + let* cell = deref cell_ptr in + let powers = list_powers cell in + let rec aux path ptr = + let path = ptr :: path in + let* cell = deref ptr in + let index = cell.index in + if Compare.Z.(target_index = index) then return path + else if Compare.Z.(target_index > index) then M.return None + else + let*? best_idx = best_skip cell target_index powers in + let*? ptr = back_pointer cell best_idx in + aux path ptr + in + aux [] cell_ptr + + let find ~deref ~cell_ptr ~target_index = + let open Monad_syntax.Option in + let* rev_back_path = rev_back_path ~deref ~cell_ptr ~target_index in + let*? cell_ptr = List.hd rev_back_path in + deref cell_ptr + + let back_path ~deref ~cell_ptr ~target_index = + let open Monad_syntax.Option in + let* rev_back_path = rev_back_path ~deref ~cell_ptr ~target_index in + return (List.rev rev_back_path) + + let mem equal x l = + let open FallbackArray in + let n = length l in + let rec aux idx = + if Compare.Int.(idx >= n) then false + else + match get l idx with + | None -> aux (idx + 1) + | Some y -> if equal x y then true else aux (idx + 1) + in + aux 0 + + let assume_some o f = + let open Monad_syntax in + let* o = o in + match o with None -> return false | Some x -> f x + + let valid_back_path ~equal_ptr ~deref ~cell_ptr ~target_ptr path = + let open Monad_syntax in + assume_some (deref target_ptr) @@ fun target -> + assume_some (deref cell_ptr) @@ fun cell -> + let target_index = index target + and cell_index = index cell + and powers = list_powers cell in + let rec valid_path index cell_ptr path = + match (cell_ptr, path) with + | final_cell, [] -> + return + (equal_ptr target_ptr final_cell + && Compare.Z.(index = target_index)) + | cell_ptr, cell_ptr' :: path -> + assume_some (deref cell_ptr) @@ fun cell -> + assume_some (deref cell_ptr') @@ fun cell' -> + if mem equal_ptr cell_ptr' cell.back_pointers then return true + else + assume_some (M.return @@ best_skip cell target_index powers) + @@ fun best_idx -> + assume_some (M.return @@ back_pointer cell best_idx) + @@ fun best_ptr -> + let minimal = equal_ptr best_ptr cell_ptr' in + if minimal then return true + else + let index' = cell'.index in + valid_path index' cell_ptr' path + in + match path with + | [] -> return false + | first_cell_ptr :: path -> + if equal_ptr first_cell_ptr cell_ptr then return true + else valid_path cell_index cell_ptr path + + let search (type ptr) ~(deref : ptr -> ('content, ptr) cell option M.t) + ~compare ~cell = + let open Monad_syntax in + let ( = ), ( < ), ( > ) = Compare.Int.(( = ), ( < ), ( > )) in + (* Given a cell, to compute the minimal path, we need to find the + good back-pointer. This is done linearly with respect to the + number of back-pointers. This number of back-pointers is + logarithmic with respect to the number of non-empty + inboxes. The complexity is consequently in O(log_2^2(n)). Since + in practice, [n < 2^32], we have at most [1000] calls. Besides, + the recursive function is tail recursive. + + The linear search could be turned into a dichotomy search if + necessary. But since this piece of code won't be used in a + carbonated function, we prefer to keep a simple implementation + for the moment. *) + let rec aux rev_path cell ix = + (* Below, we call the [target] the cell for which [compare target = 0]. *) + + (* Invariant: + + - compare cell > target + - ix >= 0 + - if cell <> genesis => ix < List.length (back_pointers cell) + - \exists path' rev_path = cell:path' + *) + let back_pointers_length = FallbackArray.length cell.back_pointers in + if back_pointers_length = 0 then + (* [cell] is the genesis cell. *) + return {rev_path; last_cell = No_exact_or_lower_ptr} + else + let candidate_ptr = + match back_pointer cell ix with + | None -> + (* At this point we have [cell <> genesis]. Consequently, + thanks to the invariant of this function, we have [ix + < List.length (back_pointers cell)]. Consequently, the + call to [back_pointer] cannot fail. *) + assert false + | Some candidate_ptr -> candidate_ptr + in + let* derefed = deref candidate_ptr in + match derefed with + | None -> + (* If we cannot dereference a pointer, We stop the search + and returns the current path. *) + return {rev_path; last_cell = Deref_returned_none} + | Some next_cell -> ( + let comparison = compare next_cell.content in + if comparison = 0 then + (* We have found the target.*) + let rev_path = next_cell :: rev_path in + return {rev_path; last_cell = Found next_cell} + else if comparison > 0 then + if ix < back_pointers_length - 1 then + (* There might be a short path by dereferencing the next pointer. *) + aux rev_path cell (ix + 1) + else + (* The last pointer is still above the target. We are on the good track, *) + let rev_path = next_cell :: rev_path in + aux rev_path next_cell 0 + else if ix = 0 then + (* We found a cell lower than the target. *) + (* The first back pointers gives a cell below the target *) + let rev_path = next_cell :: rev_path in + return + { + rev_path; + last_cell = Nearest {lower = next_cell; upper = Some cell}; + } + else + (* We found a cell lower than the target. *) + (* The previous pointer was actually the good one. *) + let good_candidate_ptr = + match back_pointer cell (ix - 1) with + | None -> assert false + | Some candidate_ptr -> candidate_ptr + in + let* derefed = deref good_candidate_ptr in + match derefed with + | None -> + (* We already dereferenced this pointer before. *) + assert false + | Some good_next_cell -> + let rev_path = good_next_cell :: rev_path in + aux rev_path good_next_cell 0) + in + let comparison = compare cell.content in + if Compare.Int.(comparison = 0) then + (* Particular case where the target is the start cell. *) + return {rev_path = [cell]; last_cell = Found cell} + else if Compare.Int.(comparison < 0) then + return + {rev_path = [cell]; last_cell = Nearest {lower = cell; upper = None}} + else aux [cell] cell 0 + end + + include Make_monadic (struct + type 'a t = 'a + + let (bind [@ocaml.inline "always"]) = ( |> ) + + let[@ocaml.inline always] return x = x + end) + + module Lwt = Make_monadic (Lwt) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.mli b/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.mli new file mode 100644 index 000000000000..3288eb2ff410 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/skip_list_repr.mli @@ -0,0 +1,226 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides an implementation of the skip list data structure. *) + +(** Basic signature for a monad. *) +module type MONAD = sig + type 'a t + + val bind : 'a t -> ('a -> 'b t) -> 'b t + + val return : 'a -> 'a t +end + +(** A skip list represents a sequence of values. There are three main + differences between these [skip list]s and OCaml standard [list]s: + + 1. A skip list cannot be empty. + + 2. A skip list grows at its end. + + 3. Each cell of the skip list provides several back pointers + allowing to *skip* chunk of ancestors of the sequence to directly + jump to a given position. More precisely, given a [basis] + parameter, the i-th back pointers of element number [n] in the + sequence points to [n - n mod basis^i - 1]. The element number [n] + in the sequence contains [log_basis n] back pointers. + + The skip list is defined by a pair of dereferencing function + of type ['ptr -> ('content, 'ptr) cell] and the last cell + of the sequence. The maintainance of this pair is left to the client. + In particular, the client is responsible to correctly bind a cell + to each back pointers reachable from the last cell. + +*) +module type S = sig + (** A cell in the skip list carrying a given ['content] and back + pointers of type ['ptr]. *) + type ('content, 'ptr) cell + + val pp : + pp_ptr:(Format.formatter -> 'ptr -> unit) -> + pp_content:(Format.formatter -> 'content -> unit) -> + Format.formatter -> + ('content, 'ptr) cell -> + unit + + val equal : + ('ptr -> 'ptr -> bool) -> + ('content -> 'content -> bool) -> + ('content, 'ptr) cell -> + ('content, 'ptr) cell -> + bool + + val encoding : + 'ptr Data_encoding.t -> + 'content Data_encoding.t -> + ('content, 'ptr) cell Data_encoding.t + + (** [index cell] returns the position of [cell] in the sequence. *) + val index : (_, _) cell -> Z.t + + (** [content cell] is the content carried by the [cell]. *) + val content : ('content, 'ptr) cell -> 'content + + (** [back_pointer cell i] returns [Some ptr] if [ptr] is the + [i]-th back pointer of [cell]. Returns [None] if the cell + contains less than [i + 1] back pointers. *) + val back_pointer : ('content, 'ptr) cell -> int -> 'ptr option + + (** [back_pointers cell] returns the back pointers of [cell]. *) + val back_pointers : ('content, 'ptr) cell -> 'ptr list + + (** [genesis content] is the first cell of a skip list. It has + no back pointers. *) + val genesis : 'content -> ('content, 'ptr) cell + + (** [next ~prev_cell ~prev_cell_ptr content] creates a new cell + that carries some [content], that follows [prev_cell]. *) + val next : + prev_cell:('content, 'ptr) cell -> + prev_cell_ptr:'ptr -> + 'content -> + ('content, 'ptr) cell + + type ('ptr, 'content) search_cell_result = + | Found of ('ptr, 'content) cell + | Nearest of { + lower : ('ptr, 'content) cell; + upper : ('ptr, 'content) cell option; + } + | No_exact_or_lower_ptr + | Deref_returned_none + + type ('ptr, 'content) search_result = { + rev_path : ('ptr, 'content) cell list; + last_cell : ('ptr, 'content) search_cell_result; + } + + val pp_search_result : + pp_cell:(Format.formatter -> ('ptr, 'content) cell -> unit) -> + Format.formatter -> + ('ptr, 'content) search_result -> + unit + + module type MONADIC = sig + (** Type of results for monadic functions. *) + type 'a result + + (** [find ~deref ~cell_ptr ~target_index] returns [Some cell] where [cell] is + the cell at position [target_index]. This is done by dereferencing the last + pointer of the path returned by {!back_path}. *) + val find : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + ('content, 'ptr) cell option result + + (** [back_path ~deref ~cell_ptr ~target_index] returns [Some path] + where [path] is a sequence of back pointers to traverse to go + from [cell_ptr] to the cell at position [target_index] in the + sequence denoted by [(deref, cell_ptr)]. *) + val back_path : + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_index:Z.t -> + 'ptr list option result + + (** [valid_back_path ~equal_ptr ~deref ~cell_ptr ~target_ptr path] + returns [true] iff [path] is a valid and minimal path from + [cell_ptr] to [target_ptr] in the skip list denoted by + [(deref, cell_ptr)]. *) + val valid_back_path : + equal_ptr:('ptr -> 'ptr -> bool) -> + deref:('ptr -> ('content, 'ptr) cell option result) -> + cell_ptr:'ptr -> + target_ptr:'ptr -> + 'ptr list -> + bool result + + (** [search ~deref ~compare ~cell] allows to find a cell of the skip + list according to its content. This function assumes that the + content of the cells is in increasing order according to the + ordering defined by the function [compare]. In other words, this + function assumes that [compare] is a function that returns a + negative integer for cells before the target and a positive + integer for cells after the target. The value returned by this + function is [{rev_path; last_cell}] such that. + + - [rev_path = []] if and only if [compare (content cell) > 0] + + - For all the cases below, if there is a path from cell [A] to + cell [B], [rev_path] contains the list of cells to go from [B] to + [A]. Consequently, the first element of [rev_path] is [B]. + Except for [Nearest_lower], this path is a minimal path. + + - [last_pointer = Deref_returned_none] if [deref] fails to + associate a cell to a pointer during the search. In that case, + [rev_path] is a path from [cell] to [candidate] where [candidate] + is the last cell for which candidate did not fail and such that + [compare (content (candidate)) > 0]. + + - [last_pointer = No_exact_or_lower_ptr] if for all cell of the + skip list, [compare (content cell) > 0]. In that case, [rev_path] + is a path from [cell] to the genesis cell. + + - [last_pointer = Found target] if there is a cell [target] such + that [compare (content target) = 0] and a path from [cell] to + [target]. In that case, [rev_path] is the minimal path from + [cell] to [target]. + + - [last_pointer = Nearest_lower {lower;upper}] if there is no + cell in the skip list such that [compare (content cell) = 0]. In + that case [lower] is the unique cell such that [compare (content + lower) < 0] and for all other cells [candidate] such that + [compare (content candidate) < 0] then there is a path from + [lower] to [candidate]. [upper], if it exists is the successor + cell to [lower], i.e. [deref ((back_pointer upper) 0) = Some + lower]. In that case, [rev_path] is a path from [cell] to + [lower]. This path is *NOT* minimal but almost. The path is + minimal from [cell] to [upper=Some up]. By minimality, the path + is logarithmic. Consequently, since there is a direct pointer + from [up] to [lower], the passe to [lower] is also + logarithmic. *) + val search : + deref:('ptr -> ('content, 'ptr) cell option result) -> + compare:('content -> int) -> + cell:('content, 'ptr) cell -> + ('content, 'ptr) search_result result + end + + (** Functions in the empty monad are accessible directly. *) + include MONADIC with type 'a result := 'a + + (** This module contains functions in the {!Lwt} monad. *) + module Lwt : MONADIC with type 'a result := 'a Lwt.t + + (** This functor can be used to build monadic functions for the skip list. *) + module Make_monadic (M : MONAD) : MONADIC with type 'a result := 'a M.t +end + +module Make (_ : sig + val basis : int +end) : S diff --git a/src/proto_016_PtMumbai/lib_protocol/slot_repr.ml b/src/proto_016_PtMumbai/lib_protocol/slot_repr.ml new file mode 100644 index 000000000000..9e72811663ce --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/slot_repr.ml @@ -0,0 +1,110 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Invalid_slot of int + +let () = + register_error_kind + `Permanent + ~id:"slot.invalid_slot" + ~title:"invalid slot" + ~description:"Invalid slot" + ~pp:(fun ppf x -> Format.fprintf ppf "invalid slot: %d" x) + Data_encoding.(obj1 (req "bad_slot" int31)) + (function Invalid_slot x -> Some x | _ -> None) + (fun x -> Invalid_slot x) + +include Compare.Int + +type slot = t + +(* TODO? should there be some assertions to verify that slots are + never too big ? Or do that in a storage module that depends on + constants ? *) + +let encoding = Data_encoding.uint16 + +let pp = Format.pp_print_int + +let zero = 0 + +let to_int x = x + +(* We assume 2^16 slots is big enough. + + We could increase that, but we would need to make sure there is no big + performance penalty first. *) +let max_value = (1 lsl 16) - 1 + +let of_int_do_not_use_except_for_parameters i = i + +let of_int i = + if Compare.Int.(i < 0 || i > max_value) then error (Invalid_slot i) else ok i + +let succ slot = of_int (slot + 1) + +module Map = Map.Make (Compare.Int) +module Set = Set.Make (Compare.Int) + +module Range = struct + (* For now, we only need full intervals. If we ever need sparse ones, we + could switch this representation to interval trees. [hi] and [lo] bounds + are included. *) + type t = Interval of {lo : int; hi : int} + + let create ~min ~count = + error_when (min < 0) (Invalid_slot min) >>? fun () -> + error_when (min > max_value) (Invalid_slot min) >>? fun () -> + error_when (count < 1) (Invalid_slot count) >>? fun () -> + error_when (count > max_value) (Invalid_slot count) >>? fun () -> + let max = min + count - 1 in + error_when (max > max_value) (Invalid_slot max) >>? fun () -> + ok (Interval {lo = min; hi = max}) + + let fold f init (Interval {lo; hi}) = + let rec loop ~acc ~next = + if Compare.Int.(next > hi) then acc + else loop ~acc:(f acc next) ~next:(next + 1) + in + loop ~acc:(f init lo) ~next:(lo + 1) + + let fold_es f init (Interval {lo; hi}) = + let rec loop ~acc ~next = + if Compare.Int.(next > hi) then return acc + else f acc next >>=? fun acc -> loop ~acc ~next:(next + 1) + in + f init lo >>=? fun acc -> loop ~acc ~next:(lo + 1) + + let rev_fold_es f init (Interval {lo; hi}) = + let rec loop ~acc ~next = + if Compare.Int.(next < lo) then return acc + else f acc next >>=? fun acc -> loop ~acc ~next:(next - 1) + in + f init hi >>=? fun acc -> loop ~acc ~next:(hi - 1) +end + +module Internal_for_tests = struct + let of_int = of_int +end diff --git a/src/proto_016_PtMumbai/lib_protocol/slot_repr.mli b/src/proto_016_PtMumbai/lib_protocol/slot_repr.mli new file mode 100644 index 000000000000..27b574b4f2ac --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/slot_repr.mli @@ -0,0 +1,121 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Slot index representation *) + +(** {1 Abstract type} *) + +(** A slot index is in essence a bounded whole number. That is, it is not + allowed to overflow [max_value], nor does it wrap when calling [succ + max_value]. In this case it returns an [Invalid_slot] error.*) +type t + +type slot = t + +val encoding : t Data_encoding.t + +(** {1 Constructors }*) + +val zero : t + +(** Upper bound on the value a slot index can take *) +val max_value : t + +(** [of_int i] creates a slot index from integer [i]. + + @return [Error (Invalid_slot i)] if [i < 0 || i > max_value], and + [Ok slot] otherwise + *) +val of_int : int -> t tzresult + +(** [of_int_do_not_use_except_for_parameters i] is an unchecked construction + function. + + It may be used in cases where one knows [0 <= i <= max_value], e.g., when + creating protocol parameters. + + When in doubt, use [of_int] or [of_int_exn]. + *) +val of_int_do_not_use_except_for_parameters : int -> t + +(** {1 Operator and pretty-printer} *) + +(** [succ n] either returns an [Invalid_slot] error if [n] is [max_value] or [ok + value] otherwise. *) +val succ : t -> t tzresult + +(** {1 Conversion/Printing} *) + +(** [to_int slot] returns the integral representation of a slot index. This + value is always a whole number. *) +val to_int : t -> int + +val pp : Format.formatter -> t -> unit + +(** {1 Submodules} *) + +module Map : Map.S with type key = t + +module Set : Set.S with type elt = t + +include Compare.S with type t := t + +(** {2 Slot ranges} *) +module Range : sig + (** An ordered range of slots, in increasing order. *) + type t + + (** {3 Constructor} *) + + (** [create ~min ~count] creates a full slot range starting at [min], of size + [count], i.e, [min, min + count - 1]. + + [create] errors if + - [min < 0] + - [count < 1] + - [min + count - 1 > max_value] + *) + val create : min:int -> count:int -> t tzresult + + (** {3 Iterators} *) + + (** [fold f acc range] folds [f] over the values of [range], in increasing + order. *) + val fold : ('a -> slot -> 'a) -> 'a -> t -> 'a + + (** [fold_es f acc range] folds [f] over the values of [range], in increasing + order. *) + val fold_es : + ('a -> slot -> 'a tzresult Lwt.t) -> 'a -> t -> 'a tzresult Lwt.t + + (** [rev_fold_es f acc range] folds [f] over the values of [range], in decreasing + order. *) + val rev_fold_es : + ('a -> slot -> 'a tzresult Lwt.t) -> 'a -> t -> 'a tzresult Lwt.t +end + +module Internal_for_tests : sig + val of_int : int -> t tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/stake_storage.ml b/src/proto_016_PtMumbai/lib_protocol/stake_storage.ml new file mode 100644 index 000000000000..08549fa26a2c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/stake_storage.ml @@ -0,0 +1,211 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Selected_distribution_for_cycle = struct + module Cache_client = struct + type cached_value = (Signature.Public_key_hash.t * Tez_repr.t) list + + let namespace = Cache_repr.create_namespace "stake_distribution" + + let cache_index = 1 + + let value_of_identifier ctxt identifier = + let cycle = Cycle_repr.of_string_exn identifier in + Storage.Stake.Selected_distribution_for_cycle.get ctxt cycle + end + + module Cache = (val Cache_repr.register_exn (module Cache_client)) + + let identifier_of_cycle cycle = Format.asprintf "%a" Cycle_repr.pp cycle + + let init ctxt cycle stakes = + let id = identifier_of_cycle cycle in + Storage.Stake.Selected_distribution_for_cycle.init ctxt cycle stakes + >>=? fun ctxt -> + let size = 1 (* that's symbolic: 1 cycle = 1 entry *) in + Cache.update ctxt id (Some (stakes, size)) >>?= fun ctxt -> return ctxt + + let get ctxt cycle = + let id = identifier_of_cycle cycle in + Cache.find ctxt id >>=? function + | None -> Storage.Stake.Selected_distribution_for_cycle.get ctxt cycle + | Some v -> return v + + let remove_existing ctxt cycle = + let id = identifier_of_cycle cycle in + Cache.update ctxt id None >>?= fun ctxt -> + Storage.Stake.Selected_distribution_for_cycle.remove_existing ctxt cycle +end + +let get_staking_balance = Storage.Stake.Staking_balance.get + +let get_initialized_stake ctxt delegate = + Storage.Stake.Staking_balance.find ctxt delegate >>=? function + | Some staking_balance -> return (staking_balance, ctxt) + | None -> + Frozen_deposits_storage.init ctxt delegate >>=? fun ctxt -> + let balance = Tez_repr.zero in + Storage.Stake.Staking_balance.init ctxt delegate balance >>=? fun ctxt -> + return (balance, ctxt) + +let remove_stake ctxt delegate amount = + get_initialized_stake ctxt delegate >>=? fun (staking_balance_before, ctxt) -> + Tez_repr.(staking_balance_before -? amount) >>?= fun staking_balance -> + Storage.Stake.Staking_balance.update ctxt delegate staking_balance + >>=? fun ctxt -> + let minimal_stake = Constants_storage.minimal_stake ctxt in + if Tez_repr.(staking_balance_before >= minimal_stake) then + Delegate_activation_storage.is_inactive ctxt delegate >>=? fun inactive -> + if (not inactive) && Tez_repr.(staking_balance < minimal_stake) then + Storage.Stake.Active_delegates_with_minimal_stake.remove ctxt delegate + >>= fun ctxt -> return ctxt + else return ctxt + else + (* The delegate was not in Stake.Active_delegates_with_minimal_stake, + either because it was inactive, or because it did not have a + the minimal required stake, in which case it still does not have it. *) + return ctxt + +let add_stake ctxt delegate amount = + get_initialized_stake ctxt delegate >>=? fun (staking_balance_before, ctxt) -> + Tez_repr.(amount +? staking_balance_before) >>?= fun staking_balance -> + Storage.Stake.Staking_balance.update ctxt delegate staking_balance + >>=? fun ctxt -> + let minimal_stake = Constants_storage.minimal_stake ctxt in + if Tez_repr.(staking_balance >= minimal_stake) then + Delegate_activation_storage.is_inactive ctxt delegate >>=? fun inactive -> + if inactive || Tez_repr.(staking_balance_before >= minimal_stake) then + return ctxt + else + Storage.Stake.Active_delegates_with_minimal_stake.add ctxt delegate () + >>= fun ctxt -> return ctxt + else + (* The delegate was not in Stake.Active_delegates_with_minimal_stake, + because it did not have the minimal required stake (as otherwise it + would also have it now). *) + return ctxt + +let set_inactive ctxt delegate = + Delegate_activation_storage.set_inactive ctxt delegate >>= fun ctxt -> + Storage.Stake.Active_delegates_with_minimal_stake.remove ctxt delegate + +let set_active ctxt delegate = + Delegate_activation_storage.set_active ctxt delegate + >>=? fun (ctxt, inactive) -> + if not inactive then return ctxt + else + get_initialized_stake ctxt delegate >>=? fun (staking_balance, ctxt) -> + let minimal_stake = Constants_storage.minimal_stake ctxt in + if Tez_repr.(staking_balance >= minimal_stake) then + Storage.Stake.Active_delegates_with_minimal_stake.add ctxt delegate () + >>= fun ctxt -> return ctxt + else return ctxt + +let snapshot ctxt = + Storage.Stake.Last_snapshot.get ctxt >>=? fun index -> + Storage.Stake.Last_snapshot.update ctxt (index + 1) >>=? fun ctxt -> + Storage.Stake.Staking_balance.snapshot ctxt index >>=? fun ctxt -> + Storage.Stake.Active_delegates_with_minimal_stake.snapshot ctxt index + +let max_snapshot_index = Storage.Stake.Last_snapshot.get + +let set_selected_distribution_for_cycle ctxt cycle stakes total_stake = + let stakes = List.sort (fun (_, x) (_, y) -> Tez_repr.compare y x) stakes in + Selected_distribution_for_cycle.init ctxt cycle stakes >>=? fun ctxt -> + Storage.Stake.Total_active_stake.add ctxt cycle total_stake >>= fun ctxt -> + (* cleanup snapshots *) + Storage.Stake.Staking_balance.Snapshot.clear ctxt >>= fun ctxt -> + Storage.Stake.Active_delegates_with_minimal_stake.Snapshot.clear ctxt + >>= fun ctxt -> Storage.Stake.Last_snapshot.update ctxt 0 + +let clear_cycle ctxt cycle = + Storage.Stake.Total_active_stake.remove_existing ctxt cycle >>=? fun ctxt -> + Selected_distribution_for_cycle.remove_existing ctxt cycle + +let fold ctxt ~f ~order init = + Storage.Stake.Active_delegates_with_minimal_stake.fold + ctxt + ~order + ~init:(Ok init) + ~f:(fun delegate () acc -> + acc >>?= fun acc -> + get_staking_balance ctxt delegate >>=? fun stake -> + f (delegate, stake) acc) + +let fold_snapshot ctxt ~index ~f ~init = + Storage.Stake.Active_delegates_with_minimal_stake.fold_snapshot + ctxt + index + ~order:`Sorted + ~init + ~f:(fun delegate () acc -> + Storage.Stake.Staking_balance.Snapshot.get ctxt (index, delegate) + >>=? fun stake -> f (delegate, stake) acc) + +let clear_at_cycle_end ctxt ~new_cycle = + let max_slashing_period = Constants_storage.max_slashing_period ctxt in + match Cycle_repr.sub new_cycle max_slashing_period with + | None -> return ctxt + | Some cycle_to_clear -> clear_cycle ctxt cycle_to_clear + +let get ctxt delegate = + Storage.Stake.Active_delegates_with_minimal_stake.mem ctxt delegate + >>= function + | true -> get_staking_balance ctxt delegate + | false -> return Tez_repr.zero + +let fold_on_active_delegates_with_minimal_stake = + Storage.Stake.Active_delegates_with_minimal_stake.fold + +let get_selected_distribution = Selected_distribution_for_cycle.get + +let find_selected_distribution = + Storage.Stake.Selected_distribution_for_cycle.find + +let prepare_stake_distribution ctxt = + let level = Level_storage.current ctxt in + Selected_distribution_for_cycle.get ctxt level.cycle >>=? fun stakes -> + let stake_distribution = + List.fold_left + (fun map (pkh, stake) -> Signature.Public_key_hash.Map.add pkh stake map) + Signature.Public_key_hash.Map.empty + stakes + in + return + (Raw_context.init_stake_distribution_for_current_cycle + ctxt + stake_distribution) + +let get_total_active_stake = Storage.Stake.Total_active_stake.get + +let remove_contract_stake ctxt contract amount = + Contract_delegate_storage.find ctxt contract >>=? function + | None -> return ctxt + | Some delegate -> remove_stake ctxt delegate amount + +let add_contract_stake ctxt contract amount = + Contract_delegate_storage.find ctxt contract >>=? function + | None -> return ctxt + | Some delegate -> add_stake ctxt delegate amount diff --git a/src/proto_016_PtMumbai/lib_protocol/stake_storage.mli b/src/proto_016_PtMumbai/lib_protocol/stake_storage.mli new file mode 100644 index 000000000000..515d001f2f2f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/stake_storage.mli @@ -0,0 +1,140 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides basic operations (accessors and setters) on + staking tokens. + + It is responsible for maintaining the following tables: + - {!Storage.Stake.Selected_distribution_for_cycle} + - {!Storage.Stake.Staking_balance} + - {!Storage.Stake.Active_delegate_with_one_roll} + - {!Storage.Stake.Last_snapshot} + - {!Storage.Stake.Total_active_stake} +*) + +val remove_stake : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +val add_stake : + Raw_context.t -> + Signature.Public_key_hash.t -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +val set_inactive : + Raw_context.t -> Signature.Public_key_hash.t -> Raw_context.t Lwt.t + +val set_active : + Raw_context.t -> Signature.Public_key_hash.t -> Raw_context.t tzresult Lwt.t + +val get_staking_balance : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +val snapshot : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** [fold ctxt ~f ~order init] folds [f] on the list of active delegates having the + minimal required stake. The folding process starts with [init]. Each element of the + list is a pair [pkh, stake], where [pkh] is the public key hash of the + delegate and [stake] is the staking balance of the delegate. *) +val fold : + Raw_context.t -> + f:(Signature.Public_key_hash.t * Tez_repr.t -> 'a -> 'a tzresult Lwt.t) -> + order:[`Sorted | `Undefined] -> + 'a -> + 'a tzresult Lwt.t + +(** [fold_snapshot ctxt ~index ~f ~init] folds [f] on the list of active + delegates having the minimal required stake for the given snapshot [index]. The folding + process starts with [init]. Each element of the list is a pair [pkh, stake], + where [pkh] is the public key hash of the delegate and [stake] is the staking + balance of the delegate for the given snapshot [index]. *) +val fold_snapshot : + Raw_context.t -> + index:int -> + f:(Signature.Public_key_hash.t * Tez_repr.t -> 'a -> 'a tzresult Lwt.t) -> + init:'a -> + 'a tzresult Lwt.t + +(** [max_snapshot_index ctxt] returns the index of the last snapshot taken of + staking balances and active delegates. *) +val max_snapshot_index : Raw_context.t -> int tzresult Lwt.t + +(** [set_selected_distribution_for_cycle ctxt cycle distrib total_stake] saves + the selected distribution [distrib] of the [total_stake] for the given + [cycle]. *) +val set_selected_distribution_for_cycle : + Raw_context.t -> + Cycle_repr.t -> + (Signature.public_key_hash * Tez_repr.t) list -> + Tez_repr.t -> + Raw_context.t tzresult Lwt.t + +val clear_at_cycle_end : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t tzresult Lwt.t + +val get : + Raw_context.t -> Signature.Public_key_hash.t -> Tez_repr.t tzresult Lwt.t + +val fold_on_active_delegates_with_minimal_stake : + Raw_context.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(Signature.Public_key_hash.t -> unit -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + +val get_selected_distribution : + Raw_context.t -> + Cycle_repr.t -> + (Signature.Public_key_hash.t * Tez_repr.t) list tzresult Lwt.t + +val find_selected_distribution : + Raw_context.t -> + Cycle_repr.t -> + (Signature.Public_key_hash.t * Tez_repr.t) list option tzresult Lwt.t + +(** Copy the stake distribution for the current cycle (from + [Storage.Stake.Selected_distribution_for_cycle]) in the raw + context. *) +val prepare_stake_distribution : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** [get_total_active_stake ctxt cycle] retrieves the amount in Tez of the + active stake at [cycle] from [ctxt]. *) +val get_total_active_stake : + Raw_context.t -> Cycle_repr.t -> Tez_repr.t tzresult Lwt.t + +(** [add_contract_stake ctxt contract amount] calls + [Stake_storage.add_stake ctxt delegate amount] if [contract] has a + [delegate]. Otherwise this function does nothing. *) +val add_contract_stake : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + +(** [remove_contract_stake ctxt contract amount] calls + [Stake_storage.remove_stake ctxt delegate amount] if [contract] has a + [delegate]. Otherwise this function does nothing. *) +val remove_contract_stake : + Raw_context.t -> Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/state_hash.ml b/src/proto_016_PtMumbai/lib_protocol/state_hash.ml new file mode 100644 index 000000000000..a39ce4a21127 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/state_hash.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let random_state_hash = "\076\064\204" (* rng(53): never used... *) + +module H = + Blake2B.Make + (Base58) + (struct + let name = "random" + + let title = "A random generation state" + + let b58check_prefix = random_state_hash + + let size = None + end) + +include H +include Path_encoding.Make_hex (H) + +let () = Base58.check_encoded_prefix b58check_encoding "rng" 53 diff --git a/src/proto_016_PtMumbai/lib_protocol/state_hash.mli b/src/proto_016_PtMumbai/lib_protocol/state_hash.mli new file mode 100644 index 000000000000..7ae77f3a0c42 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/state_hash.mli @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing internal states of random + number generators. *) + +include S.HASH diff --git a/src/proto_016_PtMumbai/lib_protocol/storage.ml b/src/proto_016_PtMumbai/lib_protocol/storage.ml new file mode 100644 index 000000000000..db2b480fce27 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage.ml @@ -0,0 +1,2095 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Storage_functors +open Storage_sigs + +module Encoding = struct + module UInt16 : VALUE with type t = int = struct + type t = int + + let encoding = Data_encoding.uint16 + end + + module Int32 : VALUE with type t = Int32.t = struct + type t = Int32.t + + let encoding = Data_encoding.int32 + end + + module Int64 : VALUE with type t = Int64.t = struct + type t = Int64.t + + let encoding = Data_encoding.int64 + end + + module Z : VALUE with type t = Z.t = struct + type t = Z.t + + let encoding = Data_encoding.z + end + + module Manager_counter : VALUE with type t = Manager_counter_repr.t = struct + type t = Manager_counter_repr.t + + let encoding = Manager_counter_repr.encoding_for_storage + end +end + +module Int31_index : INDEX with type t = int = struct + type t = int + + let path_length = 1 + + let to_path c l = string_of_int c :: l + + let of_path = function [] | _ :: _ :: _ -> None | [c] -> int_of_string_opt c + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = RPC_arg.int; + encoding = Data_encoding.int31; + compare = Compare.Int.compare; + } +end + +module Make_index (H : Storage_description.INDEX) : + INDEX with type t = H.t and type 'a ipath = 'a * H.t = struct + include H + + type 'a ipath = 'a * t + + let args = Storage_description.One {rpc_arg; encoding; compare} +end + +module type Simple_single_data_storage = sig + type value + + val get : Raw_context.t -> value tzresult Lwt.t + + val update : Raw_context.t -> value -> Raw_context.t tzresult Lwt.t + + val init : Raw_context.t -> value -> Raw_context.t tzresult Lwt.t +end + +module Block_round : Simple_single_data_storage with type value = Round_repr.t = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["block_round"] + end) + (Round_repr) + +module Tenderbake = struct + module First_level_of_protocol = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["first_level_of_protocol"] + end) + (Raw_level_repr) + + module Branch = struct + type t = Block_hash.t * Block_payload_hash.t + + let encoding = + Data_encoding.( + obj2 + (req "grand_parent_hash" Block_hash.encoding) + (req "predecessor_payload" Block_payload_hash.encoding)) + end + + module Endorsement_branch = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["endorsement_branch"] + end) + (Branch) + + module Grand_parent_branch = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["grand_parent_branch"] + end) + (Branch) +end + +(** Contracts handling *) + +type deposits = {initial_amount : Tez_repr.t; current_amount : Tez_repr.t} + +module Deposits = struct + type t = deposits + + let encoding = + let open Data_encoding in + conv + (fun {initial_amount; current_amount} -> (initial_amount, current_amount)) + (fun (initial_amount, current_amount) -> {initial_amount; current_amount}) + (obj2 + (req "initial_amount" Tez_repr.encoding) + (req "actual_amount" Tez_repr.encoding)) +end + +type missed_endorsements_info = {remaining_slots : int; missed_levels : int} + +module Missed_endorsements_info = struct + type t = missed_endorsements_info + + let encoding = + let open Data_encoding in + conv + (fun {remaining_slots; missed_levels} -> (remaining_slots, missed_levels)) + (fun (remaining_slots, missed_levels) -> {remaining_slots; missed_levels}) + (obj2 (req "remaining_slots" int31) (req "missed_levels" int31)) +end + +module Contract = struct + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["contracts"] + end) + + module Global_counter : + Simple_single_data_storage with type value = Manager_counter_repr.t = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["global_counter"] + end) + (Encoding.Manager_counter) + + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["index"] + end)) + (Make_index (Contract_repr.Index)) + + let fold = Indexed_context.fold_keys + + let list = Indexed_context.keys + + type local_context = Indexed_context.local_context + + let with_local_context = Indexed_context.with_local_context + + module Spendable_balance = + Indexed_context.Make_map + (Registered) + (struct + let name = ["balance"] + end) + (Tez_repr) + + module Missed_endorsements = + Indexed_context.Make_map + (Registered) + (struct + let name = ["missed_endorsements"] + end) + (Missed_endorsements_info) + + module Manager = + Indexed_context.Make_map + (Registered) + (struct + let name = ["manager"] + end) + (Manager_repr) + + module Consensus_key = + Indexed_context.Make_map + (Registered) + (struct + let name = ["consensus_key"; "active"] + end) + (Signature.Public_key) + + module Pending_consensus_keys = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["consensus_key"; "pendings"] + end)) + (Make_index (Cycle_repr.Index)) + (Signature.Public_key) + + module Delegate = + Indexed_context.Make_map + (Registered) + (struct + let name = ["delegate"] + end) + (Signature.Public_key_hash) + + module Inactive_delegate = + Indexed_context.Make_set + (Registered) + (struct + let name = ["inactive_delegate"] + end) + + module Delegate_last_cycle_before_deactivation = + Indexed_context.Make_map + (Registered) + (struct + (* FIXME? Change the key name to reflect the functor's name *) + let name = ["delegate_desactivation"] + end) + (Cycle_repr) + + module Delegated = + Make_data_set_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["delegated"] + end)) + (Make_index (Contract_repr.Index)) + + module Counter = + Indexed_context.Make_map + (Registered) + (struct + let name = ["counter"] + end) + (Encoding.Manager_counter) + + (* Consume gas for serialization and deserialization of expr in this + module *) + module Make_carbonated_map_expr (N : Storage_sigs.NAME) : + Storage_sigs.Non_iterable_indexed_carbonated_data_storage + with type key = Contract_repr.t + and type value = Script_repr.lazy_expr + and type t := Raw_context.t = struct + module I = + Indexed_context.Make_carbonated_map (Registered) (N) + (struct + type t = Script_repr.lazy_expr + + let encoding = Script_repr.lazy_expr_encoding + end) + + type context = I.context + + type key = I.key + + type value = I.value + + let mem = I.mem + + let remove_existing = I.remove_existing + + let remove = I.remove + + let consume_deserialize_gas ctxt value = + Raw_context.consume_gas ctxt (Script_repr.force_decode_cost value) + + let consume_serialize_gas ctxt value = + Raw_context.consume_gas ctxt (Script_repr.force_bytes_cost value) + + let get ctxt contract = + I.get ctxt contract >>=? fun (ctxt, value) -> + Lwt.return + (consume_deserialize_gas ctxt value >|? fun ctxt -> (ctxt, value)) + + let find ctxt contract = + I.find ctxt contract >>=? fun (ctxt, value_opt) -> + Lwt.return + @@ + match value_opt with + | None -> ok (ctxt, None) + | Some value -> + consume_deserialize_gas ctxt value >|? fun ctxt -> (ctxt, value_opt) + + let update ctxt contract value = + consume_serialize_gas ctxt value >>?= fun ctxt -> + I.update ctxt contract value + + let add_or_remove ctxt contract value_opt = + match value_opt with + | None -> I.add_or_remove ctxt contract None + | Some value -> + consume_serialize_gas ctxt value >>?= fun ctxt -> + I.add_or_remove ctxt contract value_opt + + let init ctxt contract value = + consume_serialize_gas ctxt value >>?= fun ctxt -> + I.init ctxt contract value + + let add ctxt contract value = + consume_serialize_gas ctxt value >>?= fun ctxt -> + I.add ctxt contract value + + let keys_unaccounted = I.keys_unaccounted + end + + module Code = Make_carbonated_map_expr (struct + let name = ["code"] + end) + + module Storage = Make_carbonated_map_expr (struct + let name = ["storage"] + end) + + module Paid_storage_space = + Indexed_context.Make_map + (Registered) + (struct + let name = ["paid_bytes"] + end) + (Encoding.Z) + + module Used_storage_space = + Indexed_context.Make_map + (Registered) + (struct + let name = ["used_bytes"] + end) + (Encoding.Z) + + module Frozen_deposits = + Indexed_context.Make_map + (Registered) + (struct + let name = ["frozen_deposits"] + end) + (Deposits) + + module Frozen_deposits_limit = + Indexed_context.Make_map + (Registered) + (struct + let name = ["frozen_deposits_limit"] + end) + (Tez_repr) + + module Bond_id_index = + Make_indexed_subcontext + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["bond_id_index"] + end)) + (Make_index (Bond_id_repr.Index)) + + module Frozen_bonds = + Bond_id_index.Make_carbonated_map + (Registered) + (struct + let name = ["frozen_bonds"] + end) + (Tez_repr) + + let fold_bond_ids = Bond_id_index.fold_keys + + module Total_frozen_bonds = + Indexed_context.Make_map + (Registered) + (struct + let name = ["total_frozen_bonds"] + end) + (Tez_repr) +end + +module type NEXT = sig + type id + + val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + + val incr : Raw_context.t -> (Raw_context.t * id) tzresult Lwt.t +end + +module Global_constants = struct + module Map : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Script_expr_hash.t + and type value = Script_repr.expr = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["global_constant"] + end)) + (Make_index (Script_expr_hash)) + (struct + type t = Script_repr.expr + + let encoding = Script_repr.expr_encoding + end) +end + +(** Big maps handling *) + +module Big_map = struct + type id = Lazy_storage_kind.Big_map.Id.t + + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["big_maps"] + end) + + module Next : NEXT with type id := id = struct + module Storage = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["next"] + end) + (Lazy_storage_kind.Big_map.Id) + + let incr ctxt = + Storage.get ctxt >>=? fun i -> + Storage.update ctxt (Lazy_storage_kind.Big_map.Id.next i) >|=? fun ctxt -> + (ctxt, i) + + let init ctxt = Storage.init ctxt Lazy_storage_kind.Big_map.Id.init + end + + module Index = Lazy_storage_kind.Big_map.Id + + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["index"] + end)) + (Make_index (Index)) + + let rpc_arg = Index.rpc_arg + + let fold = Indexed_context.fold_keys + + let list = Indexed_context.keys + + let remove ctxt n = Indexed_context.remove ctxt n + + let copy ctxt ~from ~to_ = Indexed_context.copy ctxt ~from ~to_ + + type key = Raw_context.t * Index.t + + module Total_bytes = + Indexed_context.Make_map + (Registered) + (struct + let name = ["total_bytes"] + end) + (Encoding.Z) + + module Key_type = + Indexed_context.Make_map + (Registered) + (struct + let name = ["key_type"] + end) + (struct + type t = Script_repr.expr + + let encoding = Script_repr.expr_encoding + end) + + module Value_type = + Indexed_context.Make_map + (Registered) + (struct + let name = ["value_type"] + end) + (struct + type t = Script_repr.expr + + let encoding = Script_repr.expr_encoding + end) + + module Contents = struct + module I = + Storage_functors.Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["contents"] + end)) + (Make_index (Script_expr_hash)) + (struct + type t = Script_repr.expr + + let encoding = Script_repr.expr_encoding + end) + + type context = I.context + + type key = I.key + + type value = I.value + + let mem = I.mem + + let remove_existing = I.remove_existing + + let remove = I.remove + + let update = I.update + + let add_or_remove = I.add_or_remove + + let init = I.init + + let add = I.add + + let list_key_values = I.list_key_values + + let consume_deserialize_gas ctxt value = + Raw_context.consume_gas ctxt (Script_repr.deserialized_cost value) + + let get ctxt contract = + I.get ctxt contract >>=? fun (ctxt, value) -> + Lwt.return + (consume_deserialize_gas ctxt value >|? fun ctxt -> (ctxt, value)) + + let find ctxt contract = + I.find ctxt contract >>=? fun (ctxt, value_opt) -> + Lwt.return + @@ + match value_opt with + | None -> ok (ctxt, None) + | Some value -> + consume_deserialize_gas ctxt value >|? fun ctxt -> (ctxt, value_opt) + + let keys_unaccounted = I.keys_unaccounted + end +end + +module Sapling = struct + type id = Lazy_storage_kind.Sapling_state.Id.t + + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["sapling"] + end) + + module Next = struct + module Storage = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["next"] + end) + (Lazy_storage_kind.Sapling_state.Id) + + let incr ctxt = + Storage.get ctxt >>=? fun i -> + Storage.update ctxt (Lazy_storage_kind.Sapling_state.Id.next i) + >|=? fun ctxt -> (ctxt, i) + + let init ctxt = Storage.init ctxt Lazy_storage_kind.Sapling_state.Id.init + end + + module Index = Lazy_storage_kind.Sapling_state.Id + + let rpc_arg = Index.rpc_arg + + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["index"] + end)) + (Make_index (Index)) + + let remove ctxt n = Indexed_context.remove ctxt n + + let copy ctxt ~from ~to_ = Indexed_context.copy ctxt ~from ~to_ + + module Total_bytes = + Indexed_context.Make_map + (Registered) + (struct + let name = ["total_bytes"] + end) + (Encoding.Z) + + module Commitments_size = + Make_single_data_storage (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitments_size"] + end) + (Encoding.Int64) + + module Memo_size = + Make_single_data_storage (Registered) (Indexed_context.Raw_context) + (struct + let name = ["memo_size"] + end) + (Sapling_repr.Memo_size) + + module Commitments : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Hash.t = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitments"] + end)) + (Make_index (struct + type t = int64 + + let rpc_arg = + let construct = Int64.to_string in + let destruct hash = + Int64.of_string_opt hash + |> Result.of_option ~error:"Cannot parse node position" + in + RPC_arg.make + ~descr:"The position of a node in a sapling commitment tree" + ~name:"sapling_node_position" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "sapling_node_position" + ~title:"Sapling node position" + ~description: + "The position of a node in a sapling commitment tree" + Data_encoding.int64 + + let compare = Compare.Int64.compare + + let path_length = 1 + + let to_path c l = Int64.to_string c :: l + + let of_path = function [c] -> Int64.of_string_opt c | _ -> None + end)) + (Sapling.Hash) + + let commitments_init ctx id = + Indexed_context.Raw_context.remove (ctx, id) ["commitments"] + >|= fun (ctx, _id) -> ctx + + module Ciphertexts : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Ciphertext.t = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["ciphertexts"] + end)) + (Make_index (struct + type t = int64 + + let rpc_arg = + let construct = Int64.to_string in + let destruct hash = + Int64.of_string_opt hash + |> Result.of_option ~error:"Cannot parse ciphertext position" + in + RPC_arg.make + ~descr:"The position of a sapling ciphertext" + ~name:"sapling_ciphertext_position" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "sapling_ciphertext_position" + ~title:"Sapling ciphertext position" + ~description:"The position of a sapling ciphertext" + Data_encoding.int64 + + let compare = Compare.Int64.compare + + let path_length = 1 + + let to_path c l = Int64.to_string c :: l + + let of_path = function [c] -> Int64.of_string_opt c | _ -> None + end)) + (Sapling.Ciphertext) + + let ciphertexts_init ctx id = + Indexed_context.Raw_context.remove (ctx, id) ["commitments"] + >|= fun (ctx, _id) -> ctx + + module Nullifiers_size = + Make_single_data_storage (Registered) (Indexed_context.Raw_context) + (struct + let name = ["nullifiers_size"] + end) + (Encoding.Int64) + + (* For sequential access when building a diff *) + module Nullifiers_ordered : + Non_iterable_indexed_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Nullifier.t = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["nullifiers_ordered"] + end)) + (Make_index (struct + type t = int64 + + let rpc_arg = + let construct = Int64.to_string in + let destruct hash = + Int64.of_string_opt hash + |> Result.of_option ~error:"Cannot parse nullifier position" + in + RPC_arg.make + ~descr:"A sapling nullifier position" + ~name:"sapling_nullifier_position" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "sapling_nullifier_position" + ~title:"Sapling nullifier position" + ~description:"Sapling nullifier position" + Data_encoding.int64 + + let compare = Compare.Int64.compare + + let path_length = 1 + + let to_path c l = Int64.to_string c :: l + + let of_path = function [c] -> Int64.of_string_opt c | _ -> None + end)) + (Sapling.Nullifier) + + (* Check membership in O(1) for verify_update *) + module Nullifiers_hashed = + Make_carbonated_data_set_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["nullifiers_hashed"] + end)) + (Make_index (struct + type t = Sapling.Nullifier.t + + let encoding = Sapling.Nullifier.encoding + + let of_string hexstring = + Option.bind + (Hex.to_bytes (`Hex hexstring)) + (Data_encoding.Binary.of_bytes_opt encoding) + |> Result.of_option ~error:"Cannot parse sapling nullifier" + + let to_string nf = + let b = Data_encoding.Binary.to_bytes_exn encoding nf in + let (`Hex hexstring) = Hex.of_bytes b in + hexstring + + let rpc_arg = + RPC_arg.make + ~descr:"A sapling nullifier" + ~name:"sapling_nullifier" + ~construct:to_string + ~destruct:of_string + () + + let compare = Sapling.Nullifier.compare + + let path_length = 1 + + let to_path c l = to_string c :: l + + let of_path = function + | [c] -> Result.to_option (of_string c) + | _ -> None + end)) + + let nullifiers_init ctx id = + Nullifiers_size.add (ctx, id) Int64.zero >>= fun ctx -> + Indexed_context.Raw_context.remove (ctx, id) ["nullifiers_ordered"] + >>= fun (ctx, id) -> + Indexed_context.Raw_context.remove (ctx, id) ["nullifiers_hashed"] + >|= fun (ctx, _id) -> ctx + + module Roots : + Non_iterable_indexed_data_storage + with type t := Raw_context.t * id + and type key = int32 + and type value = Sapling.Hash.t = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["roots"] + end)) + (Make_index (struct + type t = int32 + + let rpc_arg = + let construct = Int32.to_string in + let destruct hash = + Int32.of_string_opt hash + |> Result.of_option ~error:"Cannot parse nullifier position" + in + RPC_arg.make + ~descr:"A sapling root" + ~name:"sapling_root" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "sapling_root" + ~title:"Sapling root" + ~description:"Sapling root" + Data_encoding.int32 + + let compare = Compare.Int32.compare + + let path_length = 1 + + let to_path c l = Int32.to_string c :: l + + let of_path = function [c] -> Int32.of_string_opt c | _ -> None + end)) + (Sapling.Hash) + + module Roots_pos = + Make_single_data_storage (Registered) (Indexed_context.Raw_context) + (struct + let name = ["roots_pos"] + end) + (Encoding.Int32) + + module Roots_level = + Make_single_data_storage (Registered) (Indexed_context.Raw_context) + (struct + let name = ["roots_level"] + end) + (Raw_level_repr) +end + +module Public_key_hash = struct + open Signature + include Signature.Public_key_hash + module Path_Ed25519 = Path_encoding.Make_hex (Ed25519.Public_key_hash) + module Path_Secp256k1 = Path_encoding.Make_hex (Secp256k1.Public_key_hash) + module Path_P256 = Path_encoding.Make_hex (P256.Public_key_hash) + module Path_Bls = Path_encoding.Make_hex (Bls.Public_key_hash) + + let to_path (key : public_key_hash) l = + match key with + | Ed25519 h -> "ed25519" :: Path_Ed25519.to_path h l + | Secp256k1 h -> "secp256k1" :: Path_Secp256k1.to_path h l + | P256 h -> "p256" :: Path_P256.to_path h l + | Bls h -> "bls" :: Path_Bls.to_path h l + + let of_path : _ -> public_key_hash option = function + | "ed25519" :: rest -> ( + match Path_Ed25519.of_path rest with + | Some pkh -> Some (Ed25519 pkh) + | None -> None) + | "secp256k1" :: rest -> ( + match Path_Secp256k1.of_path rest with + | Some pkh -> Some (Secp256k1 pkh) + | None -> None) + | "p256" :: rest -> ( + match Path_P256.of_path rest with + | Some pkh -> Some (P256 pkh) + | None -> None) + | "bls" :: rest -> ( + match Path_Bls.of_path rest with + | Some pkh -> Some (Bls pkh) + | None -> None) + | _ -> None + + let path_length = + let l1 = Path_Ed25519.path_length + and l2 = Path_Secp256k1.path_length + and l3 = Path_P256.path_length + and l4 = Path_Bls.path_length in + assert (Compare.Int.(l1 = l2 && l2 = l3 && l3 = l4)) ; + l1 + 1 +end + +module Public_key_hash_index = Make_index (Public_key_hash) + +module Protocol_hash_with_path_encoding = struct + include Protocol_hash + include Path_encoding.Make_hex (Protocol_hash) +end + +module Delegates = + Make_data_set_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["delegates"] + end)) + (Public_key_hash_index) + +module Consensus_keys = + Make_data_set_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["consensus_keys"] + end)) + (Public_key_hash_index) + +(** Per cycle storage *) + +type slashed_level = {for_double_endorsing : bool; for_double_baking : bool} + +module Slashed_level = struct + type t = slashed_level + + let encoding = + let open Data_encoding in + conv + (fun {for_double_endorsing; for_double_baking} -> + (for_double_endorsing, for_double_baking)) + (fun (for_double_endorsing, for_double_baking) -> + {for_double_endorsing; for_double_baking}) + (obj2 (req "for_double_endorsing" bool) (req "for_double_baking" bool)) +end + +module Cycle = struct + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["cycle"] + end)) + (Make_index (Cycle_repr.Index)) + + module Slashed_deposits = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["slashed_deposits"] + end)) + (Pair (Make_index (Raw_level_repr.Index)) (Public_key_hash_index)) + (Slashed_level) + + module Selected_stake_distribution = + Indexed_context.Make_map + (Registered) + (struct + let name = ["selected_stake_distribution"] + end) + (struct + type t = (Signature.Public_key_hash.t * Tez_repr.t) list + + let encoding = + Data_encoding.( + Variable.list + (obj2 + (req "baker" Signature.Public_key_hash.encoding) + (req "active_stake" Tez_repr.encoding))) + end) + + module Total_active_stake = + Indexed_context.Make_map + (Registered) + (struct + let name = ["total_active_stake"] + end) + (Tez_repr) + + module Delegate_sampler_state = + Indexed_context.Make_map + (Registered) + (struct + let name = ["delegate_sampler_state"] + end) + (struct + type t = Raw_context.consensus_pk Sampler.t + + let encoding = Sampler.encoding Raw_context.consensus_pk_encoding + end) + + type unrevealed_nonce = { + nonce_hash : Nonce_hash.t; + delegate : Signature.Public_key_hash.t; + } + + type nonce_status = + | Unrevealed of unrevealed_nonce + | Revealed of Seed_repr.nonce + + let nonce_status_encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Unrevealed" + (tup2 Nonce_hash.encoding Signature.Public_key_hash.encoding) + (function + | Unrevealed {nonce_hash; delegate} -> Some (nonce_hash, delegate) + | _ -> None) + (fun (nonce_hash, delegate) -> Unrevealed {nonce_hash; delegate}); + case + (Tag 1) + ~title:"Revealed" + Seed_repr.nonce_encoding + (function Revealed nonce -> Some nonce | _ -> None) + (fun nonce -> Revealed nonce); + ] + + module Nonce = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["nonces"] + end)) + (Make_index (Raw_level_repr.Index)) + (struct + type t = nonce_status + + let encoding = nonce_status_encoding + end) + + module Seed = + Indexed_context.Make_map + (Registered) + (struct + let name = ["random_seed"] + end) + (struct + type t = Seed_repr.seed + + let encoding = Seed_repr.seed_encoding + end) +end + +module Slashed_deposits = Cycle.Slashed_deposits + +module Stake = struct + module Staking_balance = + Make_indexed_data_snapshotable_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["staking_balance"] + end)) + (Int31_index) + (Public_key_hash_index) + (Tez_repr) + + module Active_delegates_with_minimal_stake = + Make_indexed_data_snapshotable_storage + (Make_subcontext (Registered) (Raw_context) + (struct + (* This name is for historical reasons, when the stake was + expressed in rolls (that is, pre-Ithaca). *) + let name = ["active_delegate_with_one_roll"] + end)) + (Int31_index) + (Public_key_hash_index) + (struct + type t = unit + + let encoding = Data_encoding.unit + end) + + module Selected_distribution_for_cycle = Cycle.Selected_stake_distribution + module Total_active_stake = Cycle.Total_active_stake + + (* This is an index that is set to 0 by calls to + {!val:Stake_storage.selected_new_distribution_at_cycle_end} and + incremented (by 1) by calls to {!val:Stake_storage.snapshot}. + + {!val:Stake_storage.snapshot} is called in relation with constant + [blocks_per_stake_snapshot] in + {!val:Level_storage.may_snapshot_stake_distribution}. + + That is, the increment is done every [blocks_per_stake_snaphot] + blocks and reset at the end of cycles. So, it goes up to + [blocks_per_cycle / blocks_per_stake_snaphot], which is currently + 16 (= 8192/512 -- the concrete values can be found in + {!val:Default_parameters.constants_mainnet}), then comes back to + 0, so that a UInt16 is big enough. + + The ratio [blocks_per_cycle / blocks_per_stake_snapshot] above is + checked in {!val:Constants_repr.check_constants} to fit in a + UInt16. *) + module Last_snapshot = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["last_snapshot"] + end) + (Encoding.UInt16) +end + +module Delegate_sampler_state = Cycle.Delegate_sampler_state + +(** Votes *) + +module Vote = struct + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["votes"] + end) + + module Pred_period_kind = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["pred_period_kind"] + end) + (struct + type t = Voting_period_repr.kind + + let encoding = Voting_period_repr.kind_encoding + end) + + module Current_period = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["current_period"] + end) + (struct + type t = Voting_period_repr.t + + let encoding = Voting_period_repr.encoding + end) + + module Participation_ema = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["participation_ema"] + end) + (Encoding.Int32) + + module Current_proposal = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["current_proposal"] + end) + (Protocol_hash) + + module Voting_power_in_listings = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["voting_power_in_listings"] + end) + (Encoding.Int64) + + module Listings = + Make_indexed_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["listings"] + end)) + (Public_key_hash_index) + (Encoding.Int64) + + module Proposals = + Make_data_set_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["proposals"] + end)) + (Pair + (Make_index + (Protocol_hash_with_path_encoding)) + (Public_key_hash_index)) + + module Proposals_count = + Make_indexed_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["proposals_count"] + end)) + (Public_key_hash_index) + (Encoding.UInt16) + + module Ballots = + Make_indexed_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["ballots"] + end)) + (Public_key_hash_index) + (struct + type t = Vote_repr.ballot + + let encoding = Vote_repr.ballot_encoding + end) +end + +module type FOR_CYCLE = sig + val init : + Raw_context.t -> + Cycle_repr.t -> + Seed_repr.seed -> + Raw_context.t tzresult Lwt.t + + val mem : Raw_context.t -> Cycle_repr.t -> bool Lwt.t + + val get : Raw_context.t -> Cycle_repr.t -> Seed_repr.seed tzresult Lwt.t + + val update : + Raw_context.t -> + Cycle_repr.t -> + Seed_repr.seed -> + Seed_repr.seed_status -> + Raw_context.t tzresult Lwt.t + + val remove_existing : + Raw_context.t -> Cycle_repr.t -> Raw_context.t tzresult Lwt.t +end + +(** Seed *) + +module Seed_status = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["seed_status"] + end) + (struct + type t = Seed_repr.seed_status + + let encoding = Seed_repr.seed_status_encoding + end) + +module Seed = struct + type unrevealed_nonce = Cycle.unrevealed_nonce = { + nonce_hash : Nonce_hash.t; + delegate : Signature.Public_key_hash.t; + } + + type nonce_status = Cycle.nonce_status = + | Unrevealed of unrevealed_nonce + | Revealed of Seed_repr.nonce + + module Nonce : + Non_iterable_indexed_data_storage + with type key := Level_repr.t + and type value := nonce_status + and type t := Raw_context.t = struct + open Level_repr + + type context = Raw_context.t + + let mem ctxt (l : Level_repr.t) = Cycle.Nonce.mem (ctxt, l.cycle) l.level + + let get ctxt (l : Level_repr.t) = Cycle.Nonce.get (ctxt, l.cycle) l.level + + let find ctxt (l : Level_repr.t) = Cycle.Nonce.find (ctxt, l.cycle) l.level + + let update ctxt (l : Level_repr.t) v = + Cycle.Nonce.update (ctxt, l.cycle) l.level v + + let init ctxt (l : Level_repr.t) v = + Cycle.Nonce.init (ctxt, l.cycle) l.level v + + let add ctxt (l : Level_repr.t) v = + Cycle.Nonce.add (ctxt, l.cycle) l.level v + + let add_or_remove ctxt (l : Level_repr.t) v = + Cycle.Nonce.add_or_remove (ctxt, l.cycle) l.level v + + let remove_existing ctxt (l : Level_repr.t) = + Cycle.Nonce.remove_existing (ctxt, l.cycle) l.level + + let remove ctxt (l : Level_repr.t) = + Cycle.Nonce.remove (ctxt, l.cycle) l.level + end + + module VDF_setup = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["vdf_challenge"] + end) + (struct + type t = Seed_repr.vdf_setup + + let encoding = Seed_repr.vdf_setup_encoding + end) + + module For_cycle : FOR_CYCLE = struct + let init ctxt cycle seed = + let open Lwt_result_syntax in + let* ctxt = Cycle.Seed.init ctxt cycle seed in + let*! ctxt = Seed_status.add ctxt Seed_repr.RANDAO_seed in + return ctxt + + let mem = Cycle.Seed.mem + + let get = Cycle.Seed.get + + let update ctxt cycle seed status = + Cycle.Seed.update ctxt cycle seed >>=? fun ctxt -> + Seed_status.update ctxt status + + let remove_existing = Cycle.Seed.remove_existing + end + + let get_status = Seed_status.get +end + +(** Commitments *) + +module Commitments = + Make_indexed_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["commitments"] + end)) + (Make_index (Blinded_public_key_hash.Index)) + (Tez_repr) + +(** Ramp up rewards... *) + +module Ramp_up = struct + type reward = { + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + } + + module Rewards = + Make_indexed_data_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["ramp_up"; "rewards"] + end)) + (Make_index (Cycle_repr.Index)) + (struct + type t = reward + + let encoding = + Data_encoding.( + conv + (fun { + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + } -> + ( baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot )) + (fun ( baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot ) -> + { + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + }) + (obj3 + (req "baking_reward_fixed_portion" Tez_repr.encoding) + (req "baking_reward_bonus_per_slot" Tez_repr.encoding) + (req "endorsing_reward_per_slot" Tez_repr.encoding))) + end) +end + +module Pending_migration = struct + module Balance_updates = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["pending_migration_balance_updates"] + end) + (struct + type t = Receipt_repr.balance_updates + + let encoding = Receipt_repr.balance_updates_encoding + end) + + module Operation_results = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["pending_migration_operation_results"] + end) + (struct + type t = Migration_repr.origination_result list + + let encoding = Migration_repr.origination_result_list_encoding + end) + + let remove ctxt = + let balance_updates ctxt = + Balance_updates.find ctxt >>=? function + | Some balance_updates -> + Balance_updates.remove ctxt >>= fun ctxt -> + (* When applying balance updates in a migration, we must attach receipts. + The balance updates returned from here will be applied in the first + block of the new protocol. *) + return (ctxt, balance_updates) + | None -> return (ctxt, []) + in + let operation_results ctxt = + Operation_results.find ctxt >>=? function + | Some operation_results -> + Operation_results.remove ctxt >>= fun ctxt -> + return (ctxt, operation_results) + | None -> return (ctxt, []) + in + balance_updates ctxt >>=? fun (ctxt, balance_updates) -> + operation_results ctxt >>=? fun (ctxt, operation_results) -> + return (ctxt, balance_updates, operation_results) +end + +module Liquidity_baking = struct + module Toggle_ema = + Make_single_data_storage (Registered) (Raw_context) + (struct + (* The old "escape" name is kept here to avoid migrating this. *) + let name = ["liquidity_baking_escape_ema"] + end) + (Encoding.Int32) + + module Cpmm_address = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["liquidity_baking_cpmm_address"] + end) + (struct + type t = Contract_hash.t + + (* Keeping contract-compatible encoding to avoid migrating this. *) + let encoding = Contract_repr.originated_encoding + end) +end + +module Ticket_balance = struct + module Name = struct + let name = ["ticket_balance"] + end + + module Raw_context = Make_subcontext (Registered) (Raw_context) (Name) + + module Paid_storage_space = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["paid_bytes"] + end) + (Encoding.Z) + + module Used_storage_space = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["used_bytes"] + end) + (Encoding.Z) + + module Table_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["table"] + end) + + module Index = Make_index (Ticket_hash_repr.Index) + module Table = + Make_indexed_carbonated_data_storage (Table_context) (Index) (Encoding.Z) +end + +module Tx_rollup = struct + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["tx_rollup"] + end)) + (Make_index (Tx_rollup_repr.Index)) + + module State = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["state"] + end) + (Tx_rollup_state_repr) + + module Level_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["tx_level"] + end)) + (Make_index (Tx_rollup_level_repr.Index)) + + module Inbox = + Level_context.Make_carbonated_map + (Registered) + (struct + let name = ["inbox"] + end) + (struct + type t = Tx_rollup_inbox_repr.t + + let encoding = Tx_rollup_inbox_repr.encoding + end) + + module Revealed_withdrawals = + Level_context.Make_carbonated_map + (Registered) + (struct + let name = ["withdrawals"] + end) + (Bitset) + + module Commitment = + Level_context.Make_carbonated_map + (Registered) + (struct + let name = ["commitment"] + end) + (Tx_rollup_commitment_repr.Submitted_commitment) + + module Bond_indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["bond"] + end)) + (Public_key_hash_index) + + module Commitment_bond = + Bond_indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["commitment"] + end) + (struct + type t = int + + let encoding = Data_encoding.int31 + end) +end + +module Sc_rollup = struct + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["sc_rollup"] + end) + + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["index"] + end)) + (Make_index (Sc_rollup_repr.Index)) + + module Make_versioned + (Versioned_value : Sc_rollup_data_version_sig.S) (Data_storage : sig + type context + + type key + + type value = Versioned_value.versioned + + val get : context -> key -> (Raw_context.t * value) tzresult Lwt.t + + val find : + context -> key -> (Raw_context.t * value option) tzresult Lwt.t + + val update : + context -> key -> value -> (Raw_context.t * int) tzresult Lwt.t + + val init : + context -> key -> value -> (Raw_context.t * int) tzresult Lwt.t + + val add : + context -> key -> value -> (Raw_context.t * int * bool) tzresult Lwt.t + + val add_or_remove : + context -> + key -> + value option -> + (Raw_context.t * int * bool) tzresult Lwt.t + end) = + struct + include Data_storage + + type value = Versioned_value.t + + let get ctxt key = + let open Lwt_result_syntax in + let* ctxt, versioned = get ctxt key in + return (ctxt, Versioned_value.of_versioned versioned) + + let find ctxt key = + let open Lwt_result_syntax in + let* ctxt, versioned = find ctxt key in + return (ctxt, Option.map Versioned_value.of_versioned versioned) + + let update ctxt key value = + update ctxt key (Versioned_value.to_versioned value) + + let init ctxt key value = init ctxt key (Versioned_value.to_versioned value) + + let add ctxt key value = add ctxt key (Versioned_value.to_versioned value) + + let add_or_remove ctxt key value = + add_or_remove ctxt key (Option.map Versioned_value.to_versioned value) + end + + module PVM_kind = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["kind"] + end) + (struct + type t = Sc_rollups.Kind.t + + let encoding = Sc_rollups.Kind.encoding + end) + + module Parameters_type = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["parameters_type"] + end) + (struct + type t = Script_repr.lazy_expr + + let encoding = Script_repr.lazy_expr_encoding + end) + + module Genesis_info = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["genesis_info"] + end) + (struct + type t = Sc_rollup_commitment_repr.genesis_info + + let encoding = Sc_rollup_commitment_repr.genesis_info_encoding + end) + + module Inbox = struct + include + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["sc_rollup_inbox"] + end) + (struct + type t = Sc_rollup_inbox_repr.versioned + + let encoding = Sc_rollup_inbox_repr.versioned_encoding + end) + + type value = Sc_rollup_inbox_repr.t + + let of_versioned = Sc_rollup_inbox_repr.of_versioned + + let to_versioned = Sc_rollup_inbox_repr.to_versioned + + let get ctxt = + let open Lwt_result_syntax in + let* versioned = get ctxt in + return (of_versioned versioned) + + let find ctxt = + let open Lwt_result_syntax in + let* versioned = find ctxt in + return (Option.map of_versioned versioned) + + let init ctxt value = init ctxt (to_versioned value) + + let update ctxt value = update ctxt (to_versioned value) + + let add ctxt value = + let versioned = to_versioned value in + add ctxt versioned + + let add_or_remove ctxt value = + add_or_remove ctxt (Option.map to_versioned value) + end + + module Last_cemented_commitment = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["last_cemented_commitment"] + end) + (struct + type t = Sc_rollup_commitment_repr.Hash.t + + let encoding = Sc_rollup_commitment_repr.Hash.encoding + end) + + module Stakers = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["stakers"] + end)) + (Public_key_hash_index) + (struct + type t = Sc_rollup_commitment_repr.Hash.t + + let encoding = Sc_rollup_commitment_repr.Hash.encoding + end) + + let stakers (ctxt : Raw_context.t) (rollup : Sc_rollup_repr.t) = + Stakers.list_key_values (ctxt, rollup) + + module Staker_count = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["staker_count"] + end) + (struct + type t = int32 + + let encoding = Data_encoding.int32 + end) + + module Commitments_versioned = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitments"] + end)) + (Make_index (Sc_rollup_commitment_repr.Hash)) + (struct + type t = Sc_rollup_commitment_repr.versioned + + let encoding = Sc_rollup_commitment_repr.versioned_encoding + end) + + module Commitments = struct + include Commitments_versioned + include Make_versioned (Sc_rollup_commitment_repr) (Commitments_versioned) + end + + module Commitment_stake_count = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitment_stake_count"] + end)) + (Make_index (Sc_rollup_commitment_repr.Hash)) + (struct + type t = int32 + + let encoding = Data_encoding.int32 + end) + + module Commitment_count_per_inbox_level = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitment_count_per_inbox_level"] + end)) + (Make_index (Raw_level_repr.Index)) + (struct + type t = int32 + + let encoding = Data_encoding.int32 + end) + + module Commitment_first_publication_level = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitment_first_publication_level"] + end)) + (Make_index (Raw_level_repr.Index)) + (Raw_level_repr) + + module Commitment_added = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["commitment_added"] + end)) + (Make_index (Sc_rollup_commitment_repr.Hash)) + (struct + type t = Raw_level_repr.t + + let encoding = Raw_level_repr.encoding + end) + + module Game_info_versioned = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["refutation_game_info"] + end)) + (Make_index (Sc_rollup_game_repr.Index)) + (struct + type t = Sc_rollup_game_repr.versioned + + let encoding = Sc_rollup_game_repr.versioned_encoding + end) + + module Game_info = struct + include Game_info_versioned + include Make_versioned (Sc_rollup_game_repr) (Game_info_versioned) + end + + module Games_per_staker = + Make_indexed_subcontext + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["game"] + end)) + (Public_key_hash_index) + + module Game = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Games_per_staker.Raw_context) + (struct + let name = ["opponents"] + end)) + (Public_key_hash_index) + (struct + type t = Sc_rollup_game_repr.Index.t + + let encoding = Sc_rollup_game_repr.Index.encoding + end) + + module Game_timeout = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["game_timeout"] + end)) + (Make_index (Sc_rollup_game_repr.Index)) + (struct + type t = Sc_rollup_game_repr.timeout + + let encoding = Sc_rollup_game_repr.timeout_encoding + end) + + (** An index used for a SCORU's outbox levels. An outbox level is mapped to + the index through: [outbox_level % sc_rollup_max_active_outbox_levels]. + That way we keep a limited number of entries. The current value of an + entry contains the most recently added level that maps to the index. *) + module Level_index = struct + type t = int32 + + let rpc_arg = + let construct = Int32.to_string in + let destruct hash = + Int32.of_string_opt hash + |> Result.of_option ~error:"Cannot parse level index" + in + RPC_arg.make + ~descr:"The level index for applied outbox message records" + ~name:"level_index" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "level_index" + ~title:"Level index" + ~description:"The level index for applied outbox message records" + Data_encoding.int32 + + let compare = Compare.Int32.compare + + let path_length = 1 + + let to_path c l = Int32.to_string c :: l + + let of_path = function [c] -> Int32.of_string_opt c | _ -> None + end + + module Level_index_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["level_index"] + end)) + (Make_index (Level_index)) + + module Bitset_and_level = struct + type t = Raw_level_repr.t * Bitset.t + + let encoding = + Data_encoding.( + obj2 + (req "level" Raw_level_repr.encoding) + (req "bitset" Bitset.encoding)) + end + + module Applied_outbox_messages = + Level_index_context.Make_carbonated_map + (Registered) + (struct + let name = ["applied_outbox_messages"] + end) + (Bitset_and_level) +end + +module Dal = struct + module Raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["dal"] + end) + + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3113 + + This is only for prototyping. Probably something smarter would be + to index each header directly. *) + (* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3684 + + This storage should be carbonated. *) + module Slot = struct + module Slot_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["slot"] + end) + + module Level_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["level"] + end)) + (Make_index (Raw_level_repr.Index)) + + module Headers = + Level_context.Make_map + (Registered) + (struct + let name = ["slot_headers"] + end) + (struct + type t = Dal_slot_repr.Header.t list + + let encoding = Data_encoding.(list Dal_slot_repr.Header.encoding) + end) + + module History = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["slot_headers_history"] + end) + (struct + type t = Dal_slot_repr.History.t + + let encoding = Dal_slot_repr.History.encoding + end) + end +end + +module Zk_rollup = struct + module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["zk_rollup"] + end)) + (Make_index (Zk_rollup_repr.Index)) + + module Account : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Zk_rollup_repr.t + and type value = Zk_rollup_account_repr.t = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["account"] + end) + (Zk_rollup_account_repr) + + module Pending_list = + Indexed_context.Make_carbonated_map + (Registered) + (struct + let name = ["pending_list"] + end) + (struct + type t = Zk_rollup_repr.pending_list + + let encoding = Zk_rollup_repr.pending_list_encoding + end) + + module Pending_operation : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * Zk_rollup_repr.t + and type key = int64 + and type value = Zk_rollup_operation_repr.t * Ticket_hash_repr.t option = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["pending_operations"] + end)) + (Make_index (struct + type t = int64 + + let rpc_arg = + let construct = Int64.to_string in + let destruct hash = + Int64.of_string_opt hash + |> Result.of_option + ~error:"Cannot parse pending operation position" + in + RPC_arg.make + ~descr: + "The position of an operation in a pending operations list" + ~name:"zkru_pending_op_position" + ~construct + ~destruct + () + + let encoding = + Data_encoding.def + "zkru_pending_op_position" + ~title:"Zkru pending operation position" + ~description: + "The position of an operation in a pending operations list" + Data_encoding.Compact.(make ~tag_size:`Uint8 int64) + + let compare = Compare.Int64.compare + + let path_length = 1 + + let to_path c l = Int64.to_string c :: l + + let of_path = function [c] -> Int64.of_string_opt c | _ -> None + end)) + (struct + type t = Zk_rollup_operation_repr.t * Ticket_hash_repr.t option + + let encoding = + Data_encoding.( + tup2 + Zk_rollup_operation_repr.encoding + (option Ticket_hash_repr.encoding)) + end) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/storage.mli b/src/proto_016_PtMumbai/lib_protocol/storage.mli new file mode 100644 index 000000000000..675829618d2f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage.mli @@ -0,0 +1,950 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Typed storage + + This module hides the hierarchical (key x value) database under + pre-allocated typed accessors for all persistent entities of the + tezos context. + + This interface enforces no invariant on the contents of the + database. Its goal is to centralize all accessors in order to have + a complete view over the database contents and avoid key + collisions. *) + +open Storage_sigs + +module type Simple_single_data_storage = sig + type value + + val get : Raw_context.t -> value tzresult Lwt.t + + val update : Raw_context.t -> value -> Raw_context.t tzresult Lwt.t + + val init : Raw_context.t -> value -> Raw_context.t tzresult Lwt.t +end + +module Block_round : Simple_single_data_storage with type value = Round_repr.t + +type deposits = {initial_amount : Tez_repr.t; current_amount : Tez_repr.t} + +type missed_endorsements_info = {remaining_slots : int; missed_levels : int} + +module Contract : sig + (** Storage from this submodule must only be accessed through the + module `Contract`. *) + + module Global_counter : + Simple_single_data_storage with type value = Manager_counter_repr.t + + (** The domain of alive contracts *) + val fold : + Raw_context.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(Contract_repr.t -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + val list : Raw_context.t -> Contract_repr.t list Lwt.t + + (** see {!Raw_context_intf.T.local_context} *) + type local_context + + (** see {!Raw_context_intf.T.with_local_context} *) + val with_local_context : + Raw_context.t -> + Contract_repr.t -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (Raw_context.t * 'a) tzresult Lwt.t + + (** The tez possessed by a contract and that can be used. A contract + may also possess tez in frozen deposits. Empty balances (of zero + tez) are only allowed for originated contracts, not for implicit + ones. *) + module Spendable_balance : + Indexed_data_storage_with_local_context + with type key = Contract_repr.t + and type value = Tez_repr.t + and type t := Raw_context.t + and type local_context := local_context + + (** If the value is not set, the delegate didn't miss any endorsing + opportunity. If it is set, this value is a record of type + [missed_endorsements_info], where: + - [remaining_slots] is the difference between the maximum number of + slots that can be missed and the number of missed slots; + therefore, when the number is positive, it represents the number + of slots that a delegate can still miss before forfeiting its + endorsing rewards for the current cycle; when the number is zero + it means rewards are not lost, but no further slots can be + missed anymore; + - [missed_levels] represents the number of missed levels (for + endorsing). *) + module Missed_endorsements : + Indexed_data_storage + with type key = Contract_repr.t + and type value = missed_endorsements_info + and type t := Raw_context.t + + (** The manager of a contract *) + module Manager : + Indexed_data_storage_with_local_context + with type key = Contract_repr.t + and type value = Manager_repr.t + and type t := Raw_context.t + and type local_context := local_context + + (** The active consensus key of a delegate *) + module Consensus_key : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Signature.Public_key.t + and type t := Raw_context.t + + (** The pending consensus key of a delegate *) + module Pending_consensus_keys : + Indexed_data_storage + with type key = Cycle_repr.t + and type value = Signature.Public_key.t + and type t := Raw_context.t * Contract_repr.t + + (** The delegate of a contract, if any. *) + module Delegate : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Signature.Public_key_hash.t + and type t := Raw_context.t + + (** All contracts (implicit and originated) that are delegated, if any *) + module Delegated : + Data_set_storage + with type elt = Contract_repr.t + and type t = Raw_context.t * Contract_repr.t + + (** The part of a delegate balance that can't be used. The total + balance is frozen_deposits.current_amount + balance. It also stores + the initial frozen balance in frozen_deposits.initial_amount. We + have current_amount <= initial_amount and current_amount < + initial_amount iff the delegate was slashed. *) + module Frozen_deposits : + Indexed_data_storage + with type key = Contract_repr.t + and type value = deposits + and type t := Raw_context.t + + (** If there is a value, the frozen balance for the contract won't + exceed it (starting in preserved_cycles + 1). *) + module Frozen_deposits_limit : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Tez_repr.t + and type t := Raw_context.t + + module Inactive_delegate : + Data_set_storage with type elt = Contract_repr.t and type t = Raw_context.t + + (** The last cycle where the delegate is considered active; that is, + at the next cycle it will be considered inactive. *) + module Delegate_last_cycle_before_deactivation : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Cycle_repr.t + and type t := Raw_context.t + + module Counter : + Indexed_data_storage_with_local_context + with type key = Contract_repr.t + and type value = Manager_counter_repr.t + and type t := Raw_context.t + and type local_context := local_context + + module Code : + Non_iterable_indexed_carbonated_data_storage + with type key = Contract_repr.t + and type value = Script_repr.lazy_expr + and type t := Raw_context.t + + module Storage : + Non_iterable_indexed_carbonated_data_storage + with type key = Contract_repr.t + and type value = Script_repr.lazy_expr + and type t := Raw_context.t + + (** Current storage space in bytes. + Includes code, global storage and big map elements. *) + module Used_storage_space : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Z.t + and type t := Raw_context.t + + (** Maximal space available without needing to burn new fees. *) + module Paid_storage_space : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Z.t + and type t := Raw_context.t + + (** Associates a contract and a bond_id with a bond, i.e. an amount of tez + that is frozen. *) + module Frozen_bonds : + Non_iterable_indexed_carbonated_data_storage + with type key = Bond_id_repr.t + and type value = Tez_repr.t + and type t := Raw_context.t * Contract_repr.t + + val fold_bond_ids : + Raw_context.t * Contract_repr.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(Bond_id_repr.t -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + (** Associates a contract with the total of all its frozen bonds. *) + module Total_frozen_bonds : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Tez_repr.t + and type t := Raw_context.t +end + +module Big_map : sig + type id = Lazy_storage_kind.Big_map.Id.t + + module Next : sig + val incr : Raw_context.t -> (Raw_context.t * id) tzresult Lwt.t + + val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + end + + (** The domain of alive big maps *) + val fold : + Raw_context.t -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(id -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + val list : Raw_context.t -> id list Lwt.t + + val remove : Raw_context.t -> id -> Raw_context.t Lwt.t + + val copy : Raw_context.t -> from:id -> to_:id -> Raw_context.t tzresult Lwt.t + + type key = Raw_context.t * id + + val rpc_arg : id RPC_arg.t + + module Contents : sig + include + Non_iterable_indexed_carbonated_data_storage + with type key = Script_expr_hash.t + and type value = Script_repr.expr + and type t := key + + val list_key_values : + ?offset:int -> + ?length:int -> + Raw_context.t * id -> + (Raw_context.t * (Script_expr_hash.t * Script_repr.expr) list) tzresult + Lwt.t + end + + module Total_bytes : + Indexed_data_storage_with_local_context + with type key = id + and type value = Z.t + and type t := Raw_context.t + + module Key_type : + Indexed_data_storage + with type key = id + and type value = Script_repr.expr + and type t := Raw_context.t + + module Value_type : + Indexed_data_storage + with type key = id + and type value = Script_repr.expr + and type t := Raw_context.t +end + +module Sapling : sig + type id = Lazy_storage_kind.Sapling_state.Id.t + + val rpc_arg : id RPC_arg.t + + module Next : sig + val incr : Raw_context.t -> (Raw_context.t * id) tzresult Lwt.t + + val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + end + + val copy : Raw_context.t -> from:id -> to_:id -> Raw_context.t tzresult Lwt.t + + val remove : Raw_context.t -> id -> Raw_context.t Lwt.t + + module Total_bytes : + Indexed_data_storage + with type key = id + and type value = Z.t + and type t := Raw_context.t + + (* Used by both Commitments and Ciphertexts *) + module Commitments_size : + Single_data_storage with type t := Raw_context.t * id and type value = int64 + + module Memo_size : + Single_data_storage with type t := Raw_context.t * id and type value = int + + module Commitments : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Hash.t + + val commitments_init : Raw_context.t -> id -> Raw_context.t Lwt.t + + module Ciphertexts : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Ciphertext.t + + val ciphertexts_init : Raw_context.t -> id -> Raw_context.t Lwt.t + + module Nullifiers_size : + Single_data_storage with type t := Raw_context.t * id and type value = int64 + + module Nullifiers_ordered : + Non_iterable_indexed_data_storage + with type t := Raw_context.t * id + and type key = int64 + and type value = Sapling.Nullifier.t + + module Nullifiers_hashed : + Carbonated_data_set_storage + with type t := Raw_context.t * id + and type elt = Sapling.Nullifier.t + + val nullifiers_init : Raw_context.t -> id -> Raw_context.t Lwt.t + + module Roots : + Non_iterable_indexed_data_storage + with type t := Raw_context.t * id + and type key = int32 + and type value = Sapling.Hash.t + + module Roots_pos : + Single_data_storage with type t := Raw_context.t * id and type value = int32 + + module Roots_level : + Single_data_storage + with type t := Raw_context.t * id + and type value = Raw_level_repr.t +end + +(** Set of all registered delegates. *) +module Delegates : + Data_set_storage + with type t := Raw_context.t + and type elt = Signature.Public_key_hash.t + +(** Set of all active consensus keys in cycle `current + preserved_cycles + 1` *) +module Consensus_keys : + Data_set_storage + with type t := Raw_context.t + and type elt = Signature.Public_key_hash.t + +type slashed_level = {for_double_endorsing : bool; for_double_baking : bool} + +(** Set used to avoid slashing multiple times the same event *) +module Slashed_deposits : + Indexed_data_storage + with type t := Raw_context.t * Cycle_repr.t + and type key = Raw_level_repr.t * Signature.Public_key_hash.t + and type value = slashed_level + +module Stake : sig + (** The map of all the staking balances of all delegates, including + those with less than + {!Constants_parametric_repr.minimal_stake}. It might be large *) + module Staking_balance : + Indexed_data_snapshotable_storage + with type key = Signature.Public_key_hash.t + and type value = Tez_repr.t + and type snapshot = int + and type t := Raw_context.t + + (** This is a set, encoded in a map with value unit. This should be + fairly small compared to staking balance *) + module Active_delegates_with_minimal_stake : + Indexed_data_snapshotable_storage + with type key = Signature.Public_key_hash.t + and type value = unit + and type snapshot = int + and type t := Raw_context.t + + (** Counter of stake storage snapshots taken since last cycle *) + module Last_snapshot : + Single_data_storage with type value = int and type t := Raw_context.t + + (** List of active stake *) + module Selected_distribution_for_cycle : + Indexed_data_storage + with type key = Cycle_repr.t + and type value = (Signature.Public_key_hash.t * Tez_repr.t) list + and type t := Raw_context.t + + (** Sum of the active stakes of all the delegates with + {!Constants_parametric_repr.minimal_stake} *) + module Total_active_stake : + Indexed_data_storage + with type key = Cycle_repr.t + and type value = Tez_repr.t + and type t := Raw_context.t +end + +(** State of the sampler used to select delegates. Managed synchronously + with [Stake.Selected_distribution_for_cycle]. *) +module Delegate_sampler_state : + Indexed_data_storage + with type key = Cycle_repr.t + and type value = Raw_context.consensus_pk Sampler.t + and type t := Raw_context.t + +(** Votes *) + +module Vote : sig + module Pred_period_kind : + Single_data_storage + with type value = Voting_period_repr.kind + and type t := Raw_context.t + + module Current_period : + Single_data_storage + with type value = Voting_period_repr.t + and type t := Raw_context.t + + (** Participation exponential moving average, in centile of percentage *) + module Participation_ema : + Single_data_storage with type value = int32 and type t := Raw_context.t + + module Current_proposal : + Single_data_storage + with type value = Protocol_hash.t + and type t := Raw_context.t + + (** Sum of voting weights of all delegates. *) + module Voting_power_in_listings : + Single_data_storage with type value = int64 and type t := Raw_context.t + + (** Contains all delegates with their assigned voting weight. *) + module Listings : + Indexed_data_storage + with type key = Signature.Public_key_hash.t + and type value = int64 + and type t := Raw_context.t + + (** Set of protocol proposal with corresponding proposer delegate *) + module Proposals : + Data_set_storage + with type elt = Protocol_hash.t * Signature.Public_key_hash.t + and type t := Raw_context.t + + (** Keeps for each delegate the number of proposed protocols *) + module Proposals_count : + Indexed_data_storage + with type key = Signature.Public_key_hash.t + and type value = int + and type t := Raw_context.t + + (** Contains for each delegate its ballot *) + module Ballots : + Indexed_data_storage + with type key = Signature.Public_key_hash.t + and type value = Vote_repr.ballot + and type t := Raw_context.t +end + +module type FOR_CYCLE = sig + val init : + Raw_context.t -> + Cycle_repr.t -> + Seed_repr.seed -> + Raw_context.t tzresult Lwt.t + + val mem : Raw_context.t -> Cycle_repr.t -> bool Lwt.t + + val get : Raw_context.t -> Cycle_repr.t -> Seed_repr.seed tzresult Lwt.t + + val update : + Raw_context.t -> + Cycle_repr.t -> + Seed_repr.seed -> + Seed_repr.seed_status -> + Raw_context.t tzresult Lwt.t + + val remove_existing : + Raw_context.t -> Cycle_repr.t -> Raw_context.t tzresult Lwt.t +end + +(** Seed *) + +module Seed_status : + Simple_single_data_storage with type value = Seed_repr.seed_status + +module Seed : sig + (** Storage from this submodule must only be accessed through the + module `Seed`. *) + + type unrevealed_nonce = { + nonce_hash : Nonce_hash.t; + delegate : Signature.Public_key_hash.t; + } + + type nonce_status = + | Unrevealed of unrevealed_nonce + | Revealed of Seed_repr.nonce + + module Nonce : + Non_iterable_indexed_data_storage + with type key := Level_repr.t + and type value := nonce_status + and type t := Raw_context.t + + module VDF_setup : + Single_data_storage + with type value = Seed_repr.vdf_setup + and type t := Raw_context.t + + module For_cycle : FOR_CYCLE + + val get_status : Raw_context.t -> Seed_repr.seed_status tzresult Lwt.t +end + +(** Commitments *) + +module Commitments : + Indexed_data_storage + with type key = Blinded_public_key_hash.t + and type value = Tez_repr.t + and type t := Raw_context.t + +(** Ramp up rewards *) +module Ramp_up : sig + type reward = { + baking_reward_fixed_portion : Tez_repr.t; + baking_reward_bonus_per_slot : Tez_repr.t; + endorsing_reward_per_slot : Tez_repr.t; + } + + module Rewards : + Indexed_data_storage + with type key = Cycle_repr.t + and type value := reward + and type t := Raw_context.t +end + +module Pending_migration : sig + module Balance_updates : + Single_data_storage + with type value = Receipt_repr.balance_updates + and type t := Raw_context.t + + module Operation_results : + Single_data_storage + with type value = Migration_repr.origination_result list + and type t := Raw_context.t + + val remove : + Raw_context.t -> + (Raw_context.t + * Receipt_repr.balance_updates + * Migration_repr.origination_result list) + tzresult + Lwt.t +end + +module Liquidity_baking : sig + (** Exponential moving average (ema) of flags set in protocol_data.contents. + The liquidity baking subsidy is not sent to the CPMM if this EMA is above + the threshold set in constants. **) + module Toggle_ema : + Single_data_storage with type t := Raw_context.t and type value = Int32.t + + (** Constant product market maker contract that receives liquidity baking subsidy. **) + module Cpmm_address : + Single_data_storage + with type t := Raw_context.t + and type value = Contract_hash.t +end + +(** A map of [Script_repr.expr] values, indexed by their hash ([Script_expr_hash.t]). + Values from this map can be incorporated by any contract via the primitive + [Michelson_v1_primitives.H_constant]. *) +module Global_constants : sig + module Map : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Script_expr_hash.t + and type value = Script_repr.expr +end + +(** This module exposes a balance table for tracking ticket ownership. + The table is a mapping from keys to values where the keys consist of a + hashed representation of: + - A ticketer, i.e. the creator of the ticket + - The content of a the ticket + - The contract that owns some amount of the ticket + The values of the table are the amounts owned by each key. + *) +module Ticket_balance : sig + module Table : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Ticket_hash_repr.t + and type value = Z.t + + module Paid_storage_space : + Single_data_storage with type t := Raw_context.t and type value = Z.t + + module Used_storage_space : + Single_data_storage with type t := Raw_context.t and type value = Z.t +end + +(** Tenderbake *) + +module Tenderbake : sig + (** [First_level_of_protocol] stores the level of the first block of + this protocol. *) + module First_level_of_protocol : + Single_data_storage + with type t := Raw_context.t + and type value = Raw_level_repr.t + + (** [Endorsement_branch] stores a single value composed of the + grandparent hash and the predecessor's payload (computed with + the grandparent hash) used to verify the validity of + endorsements. *) + module Endorsement_branch : + Single_data_storage + with type value = Block_hash.t * Block_payload_hash.t + and type t := Raw_context.t + + (** [Grand_parent_branch] stores a single value composed of the + great-grand parent hash and the grand parent's payload *) + module Grand_parent_branch : + Single_data_storage + with type value = Block_hash.t * Block_payload_hash.t + and type t := Raw_context.t +end + +module Tx_rollup : sig + (** [State] stores the state of a transaction rollup. *) + module State : + Non_iterable_indexed_carbonated_data_storage + with type key = Tx_rollup_repr.t + and type value = Tx_rollup_state_repr.t + and type t := Raw_context.t + + (** The representation of an inbox. See {!Tx_rollup_inbox_repr.t} + for a description of the actual content. *) + module Inbox : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * Tx_rollup_repr.t + and type key = Tx_rollup_level_repr.t + and type value = Tx_rollup_inbox_repr.t + + (** A carbonated storage of the set of withdrawals revealed of those + potentially associated to each message of an inbox. The key is the message + number, which is sequentially assigned from 0. *) + module Revealed_withdrawals : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * Tx_rollup_repr.t + and type key = Tx_rollup_level_repr.t + and type value = Bitset.t + + (** A rollup can have at most one commitment per rollup level. Some + metadata are saved in addition to the commitment itself. See + {!Tx_rollup_commitment_repr.Submitted_commitment.t} for the exact + content. *) + module Commitment : + Non_iterable_indexed_carbonated_data_storage + with type key = Tx_rollup_level_repr.t + and type value = Tx_rollup_commitment_repr.Submitted_commitment.t + and type t := Raw_context.t * Tx_rollup_repr.t + + (** This stores information about which contracts have bonds + for each rollup, and how many commitments those bonds + stake. *) + module Commitment_bond : + Non_iterable_indexed_carbonated_data_storage + with type key = Signature.public_key_hash + and type value = int + and type t := Raw_context.t * Tx_rollup_repr.t +end + +module Sc_rollup : sig + (** Smart contract rollup. + + Storage from this submodule must only be accessed through the + module `Sc_rollup_storage`. + + Each smart contract rollup is associated to: + + - a PVM kind (provided at creation time, read-only) + - a metadata (generated at creation time, read-only) + - a boot sector (provided at creation time, read-only) + - a parameters type specifying the types of parameters the rollup accepts + - the L1 block level at which the rollup was created + - a merkelized inbox, of which only the root hash is stored + - a tree of commitments, rooted at the last cemented commitment + - a map from stakers to commitments + - a map from commitments to the time (level) of their first insertion + + For performance reasons we also store (per rollup): + + - the total number of active stakers; + - the number of stakers per commitment. + + See module {!Sc_rollup_repr.Commitment} for details. + *) + module PVM_kind : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_repr.t + and type value = Sc_rollups.Kind.t + and type t := Raw_context.t + + module Parameters_type : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_repr.t + and type value = Script_repr.lazy_expr + and type t := Raw_context.t + + module Genesis_info : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_repr.t + and type value = Sc_rollup_commitment_repr.genesis_info + and type t := Raw_context.t + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3920 + Use carbonated storage. *) + module Inbox : + Single_data_storage + with type value = Sc_rollup_inbox_repr.t + and type t := Raw_context.t + + module Last_cemented_commitment : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_repr.t + and type value = Sc_rollup_commitment_repr.Hash.t + and type t := Raw_context.t + + module Stakers : + Non_iterable_indexed_carbonated_data_storage + with type key = Signature.Public_key_hash.t + and type value = Sc_rollup_commitment_repr.Hash.t + and type t = Raw_context.t * Sc_rollup_repr.t + + (** [stakers ctxt rollup] returns all the stakers over [rollup] with + their related commitment. *) + val stakers : + Raw_context.t -> + Sc_rollup_repr.t -> + (Raw_context.t + * (Signature.Public_key_hash.t * Sc_rollup_commitment_repr.Hash.t) list) + tzresult + Lwt.t + + (** Cache: This should always be the number of entries in [Stakers]. + + Combined with {!Commitment_stake_count} (see below), this ensures we can + check that all stakers agree on a commitment prior to cementing it in + O(1) - rather than O(n) reads. + *) + module Staker_count : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_repr.t + and type value = int32 + and type t := Raw_context.t + + module Commitments : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_commitment_repr.Hash.t + and type value = Sc_rollup_commitment_repr.t + and type t = Raw_context.t * Sc_rollup_repr.t + + (** Cache: This should always be the number of stakers that are directly or + indirectly staked on this commitment. + + Let Stakers[S] mean "looking up the key S in [Stakers]". + + A staker [S] is directly staked on [C] if [Stakers[S] = C]. A staker + [S] is indirectly staked on [C] if [C] is an ancestor of [Stakers[S]]. + + This ensures we remove unreachable commitments at the end of a + dispute in O(n) reads, where n is the length of the rejected branch. + + We maintain the invariant that each branch has at least one staker. On + rejection, we decrease stake count from the removed staker to the root, + and reclaim commitments whose stake count (refcount) thus reaches zero. + + In the worst case all commitments are dishonest and on the same branch. + In practice we expect the honest branch, to be the longest, and dishonest + branches to be of similar lengths, making removal require a small number + of steps with respect to the total number of commitments. + *) + module Commitment_stake_count : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_commitment_repr.Hash.t + and type value = int32 + and type t = Raw_context.t * Sc_rollup_repr.t + + (** This storage contains for each rollup and inbox level not yet cemented the + level of publication of the first commitment. This is used to compute the + curfew for a given rollup and inbox level. + + The storage size is bounded for each rollup by + + [max_lookahead / commitment_period] + + Since the storage is cleaned when commitments are cemented, this storage + space is only temporarily bought by stakers with their deposits. + *) + module Commitment_first_publication_level : + Non_iterable_indexed_carbonated_data_storage + with type key = Raw_level_repr.t + and type value = Raw_level_repr.t + and type t = Raw_context.t * Sc_rollup_repr.t + + (** This storage contains number of commitments with a particular inbox level *) + module Commitment_count_per_inbox_level : + Non_iterable_indexed_carbonated_data_storage + with type key = Raw_level_repr.t + and type value = int32 + and type t = Raw_context.t * Sc_rollup_repr.t + + module Commitment_added : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_commitment_repr.Hash.t + and type value = Raw_level_repr.t + and type t = Raw_context.t * Sc_rollup_repr.t + + module Game_info : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_game_repr.Index.t + and type value = Sc_rollup_game_repr.t + and type t = Raw_context.t * Sc_rollup_repr.t + + (** Refutation games are indexed by the rollup, by one staker, and + by its opponent staker. Hence, each game appears twice. This is + convenient to quickly compute the opponents of a given staker. *) + module Game : + Indexed_carbonated_data_storage + with type key = Signature.Public_key_hash.t + and type value = Sc_rollup_game_repr.Index.t + and type t = + (Raw_context.t * Sc_rollup_repr.t) * Signature.Public_key_hash.t + + (** [Game_timeout] stores the block level at which the staker whose + turn it is to move will (become vulnerable to) timeout. The staker + pair should always be in lexical order to ensure that this value is + not duplicated. + *) + module Game_timeout : + Non_iterable_indexed_carbonated_data_storage + with type key = Sc_rollup_game_repr.Index.t + and type value = Sc_rollup_game_repr.timeout + and type t = Raw_context.t * Sc_rollup_repr.t + + (** A carbonated storage for keeping track of applied outbox messages for a + a SCORU. + + The [key] is an [int32] value that represents the index of a SCORU's + outbox level. An outbox level is mapped to the index through: + + [index = outbox_level % sc_rollup_max_active_outbox_levels] + + The rationale is to keep a limited number of entries. The current value of + an entry contains the most recently added level that maps to the index. + + The [value] is a pair of the actual outbox level and a bitset containing + the set of applied messages. + *) + module Applied_outbox_messages : + Non_iterable_indexed_carbonated_data_storage + with type t = Raw_context.t * Sc_rollup_repr.t + and type key = int32 + and type value = Raw_level_repr.t * Bitset.t +end + +module Dal : sig + module Slot : sig + (** This is a temporary storage for slot headers proposed onto the L1. *) + module Headers : + Non_iterable_indexed_data_storage + with type t = Raw_context.t + and type key = Raw_level_repr.t + and type value = Dal_slot_repr.Header.t list + + (** This is a permanent storage for slot headers confirmed by the L1. *) + module History : + Single_data_storage + with type t := Raw_context.t + and type value = Dal_slot_repr.History.t + end +end + +module Zk_rollup : sig + (** ZK rollup. + + Each ZK rollup is associated to: + + - an Account, as described in [Zk_rollup_repr] + - a pending list description, consisting of its head's index and + a counter + - a map from integer indeces to L2 operations, to store the actual + pending list + *) + module Account : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Zk_rollup_repr.t + and type value = Zk_rollup_account_repr.t + + module Pending_list : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t + and type key = Zk_rollup_repr.t + and type value = Zk_rollup_repr.pending_list + + module Pending_operation : + Non_iterable_indexed_carbonated_data_storage + with type t := Raw_context.t * Zk_rollup_repr.t + and type key = int64 + and type value = Zk_rollup_operation_repr.t * Ticket_hash_repr.t option +end diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_costs.ml b/src/proto_016_PtMumbai/lib_protocol/storage_costs.ml new file mode 100644 index 000000000000..b22216ac0b0c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_costs.ml @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* The model for read accesses is the following: + + cost(path_length, read_bytes) = 200_000 + 5000 * path_length + 2 * read_bytes +*) +let read_access ~path_length ~read_bytes = + let open Saturation_repr in + let base_cost = safe_int (200_000 + (5000 * path_length)) in + Gas_limit_repr.atomic_step_cost + (add base_cost (mul (safe_int 2) (safe_int read_bytes))) + +(* The model for write accesses is the following: + + cost(written_bytes) = 200_000 + 4 * written_bytes +*) +let write_access ~written_bytes = + let open Saturation_repr in + Gas_limit_repr.atomic_step_cost + (add (safe_int 200_000) (mul (safe_int 4) (safe_int written_bytes))) + +let list_key_values_step_cost = Saturation_repr.safe_int 117 + +let list_key_values_intercept = Saturation_repr.safe_int 470 + +let list_key_values_traverse ~size = + Saturation_repr.( + add + list_key_values_intercept + (mul (safe_int size) list_key_values_step_cost)) diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_costs.mli b/src/proto_016_PtMumbai/lib_protocol/storage_costs.mli new file mode 100644 index 000000000000..8c4e4c703ea8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_costs.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Cost of reading [read_bytes] at a key of length [path_length]. *) +val read_access : path_length:int -> read_bytes:int -> Gas_limit_repr.cost + +(** Cost of performing a single write access, writing [written_bytes] bytes. *) +val write_access : written_bytes:int -> Gas_limit_repr.cost + +(** [list_key_values_traverse ~size] returns the cost of traversing a context + with [size] number of elements. *) +val list_key_values_traverse : size:int -> Gas_limit_repr.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_description.ml b/src/proto_016_PtMumbai/lib_protocol/storage_description.ml new file mode 100644 index 000000000000..9b3eb082492f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_description.ml @@ -0,0 +1,380 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module StringMap = Map.Make (String) + +type 'key t = 'key desc_with_path + +(** [desc_with_path] describes a position in the storage. It's composed + [rev_path] which is the reverse path up to the position, and [dir] the + position's [description]. [rev_path] is only useful in case of an error to + print a descriptive message. [List.rev rev_path] is a storage's path that + contains no conflict and allows the registration of a [dir]'s storage. + NB: [rev_path] indicates the position in the tree, so once the node is + added, it won't change; whereas [dir] is mutable because when more subtrees + are added this may require updating it. *) +and 'key desc_with_path = { + rev_path : string list; + mutable dir : 'key description; +} + +and 'key description = + | Empty : 'key description + | Value : { + get : 'key -> 'a option tzresult Lwt.t; + encoding : 'a Data_encoding.t; + } + -> 'key description + | NamedDir : 'key t StringMap.t -> 'key description + | IndexedDir : { + arg : 'a RPC_arg.t; + arg_encoding : 'a Data_encoding.t; + list : 'key -> 'a list tzresult Lwt.t; + subdir : ('key * 'a) t; + } + -> 'key description + +let rec pp : type a. Format.formatter -> a t -> unit = + fun ppf {dir; _} -> + match dir with + | Empty -> Format.fprintf ppf "Empty" + | Value _e -> Format.fprintf ppf "Value" + | NamedDir map -> + Format.fprintf + ppf + "@[<v>%a@]" + (Format.pp_print_list pp_item) + (StringMap.bindings map) + | IndexedDir {arg; subdir; _} -> + let name = Format.asprintf "<%s>" (RPC_arg.descr arg).name in + pp_item ppf (name, subdir) + +and pp_item : type a. Format.formatter -> string * a t -> unit = + fun ppf (name, desc) -> Format.fprintf ppf "@[<hv 2>%s@ %a@]" name pp desc + +let pp_rev_path ppf path = + Format.fprintf + ppf + "[%a]" + Format.( + pp_print_list + ~pp_sep:(fun ppf () -> pp_print_string ppf " / ") + pp_print_string) + (List.rev path) + +let rec register_named_subcontext : type r. r t -> string list -> r t = + fun desc names -> + match (desc.dir, names) with + | _, [] -> desc + | Value _, _ | IndexedDir _, _ -> + Format.kasprintf + invalid_arg + "Could not register a named subcontext at %a because of an existing %a." + pp_rev_path + desc.rev_path + pp + desc + | Empty, name :: names -> + let subdir = {rev_path = name :: desc.rev_path; dir = Empty} in + desc.dir <- NamedDir (StringMap.singleton name subdir) ; + register_named_subcontext subdir names + | NamedDir map, name :: names -> + let subdir = + match StringMap.find name map with + | Some subdir -> subdir + | None -> + let subdir = {rev_path = name :: desc.rev_path; dir = Empty} in + desc.dir <- NamedDir (StringMap.add name subdir map) ; + subdir + in + register_named_subcontext subdir names + +type (_, _, _) args = + | One : { + rpc_arg : 'a RPC_arg.t; + encoding : 'a Data_encoding.t; + compare : 'a -> 'a -> int; + } + -> ('key, 'a, 'key * 'a) args + | Pair : + ('key, 'a, 'inter_key) args * ('inter_key, 'b, 'sub_key) args + -> ('key, 'a * 'b, 'sub_key) args + +let rec unpack : type a b c. (a, b, c) args -> c -> a * b = function + | One _ -> fun x -> x + | Pair (l, r) -> + let unpack_l = unpack l in + let unpack_r = unpack r in + fun x -> + let c, d = unpack_r x in + let b, a = unpack_l c in + (b, (a, d)) + +let rec pack : type a b c. (a, b, c) args -> a -> b -> c = function + | One _ -> fun b a -> (b, a) + | Pair (l, r) -> + let pack_l = pack l in + let pack_r = pack r in + fun b (a, d) -> + let c = pack_l b a in + pack_r c d + +let rec compare : type a b c. (a, b, c) args -> b -> b -> int = function + | One {compare; _} -> compare + | Pair (l, r) -> ( + let compare_l = compare l in + let compare_r = compare r in + fun (a1, b1) (a2, b2) -> + match compare_l a1 a2 with 0 -> compare_r b1 b2 | x -> x) + +let destutter equal l = + match l with + | [] -> [] + | (i, _) :: l -> + let rec loop acc i = function + | [] -> acc + | (j, _) :: l -> if equal i j then loop acc i l else loop (j :: acc) j l + in + loop [i] i l + +let rec register_indexed_subcontext : + type r a b. + r t -> list:(r -> a list tzresult Lwt.t) -> (r, a, b) args -> b t = + fun desc ~list path -> + match path with + | Pair (left, right) -> + let compare_left = compare left in + let equal_left x y = Compare.Int.(compare_left x y = 0) in + let list_left r = list r >|=? fun l -> destutter equal_left l in + let list_right r = + let a, k = unpack left r in + list a >|=? fun l -> + List.map snd (List.filter (fun (x, _) -> equal_left x k) l) + in + register_indexed_subcontext + (register_indexed_subcontext desc ~list:list_left left) + ~list:list_right + right + | One {rpc_arg = arg; encoding = arg_encoding; _} -> ( + match desc.dir with + | Value _ | NamedDir _ -> + Format.kasprintf + invalid_arg + "Could not register an indexed subcontext at %a because of an \ + existing %a." + pp_rev_path + desc.rev_path + pp + desc + | Empty -> + let subdir = + { + rev_path = + Format.sprintf "(Maybe of %s)" RPC_arg.(descr arg).name + :: desc.rev_path; + dir = Empty; + } + in + desc.dir <- IndexedDir {arg; arg_encoding; list; subdir} ; + subdir + | IndexedDir {arg = inner_arg; subdir; _} -> ( + match RPC_arg.eq arg inner_arg with + | None -> + Format.kasprintf + invalid_arg + "An indexed subcontext at %a already exists but has a \ + different argument: `%s` <> `%s`." + pp_rev_path + desc.rev_path + (RPC_arg.descr arg).name + (RPC_arg.descr inner_arg).name + | Some RPC_arg.Eq -> subdir)) + +let register_value : + type a b. + a t -> get:(a -> b option tzresult Lwt.t) -> b Data_encoding.t -> unit = + fun desc ~get encoding -> + match desc.dir with + | Empty -> desc.dir <- Value {get; encoding} + | _ -> + Format.kasprintf + invalid_arg + "Could not register a value at %a because of an existing %a." + pp_rev_path + desc.rev_path + pp + desc + +let create () = {rev_path = []; dir = Empty} + +module type INDEX = sig + type t + + include Path_encoding.S with type t := t + + val rpc_arg : t RPC_arg.t + + val encoding : t Data_encoding.t + + val compare : t -> t -> int +end + +type _ handler = + | Handler : { + encoding : 'a Data_encoding.t; + get : 'key -> int -> 'a tzresult Lwt.t; + } + -> 'key handler + +type _ opt_handler = + | Opt_handler : { + encoding : 'a Data_encoding.t; + get : 'key -> int -> 'a option tzresult Lwt.t; + } + -> 'key opt_handler + +let rec combine_object = function + | [] -> + Handler {encoding = Data_encoding.unit; get = (fun _ _ -> return_unit)} + | (name, Opt_handler handler) :: fields -> + let (Handler handlers) = combine_object fields in + Handler + { + encoding = + Data_encoding.merge_objs + Data_encoding.(obj1 (opt name (dynamic_size handler.encoding))) + handlers.encoding; + get = + (fun k i -> + handler.get k i >>=? fun v1 -> + handlers.get k i >|=? fun v2 -> (v1, v2)); + } + +type query = {depth : int} + +let depth_query = + let open RPC_query in + query (fun depth -> {depth}) + |+ field "depth" RPC_arg.uint 0 (fun t -> t.depth) + |> seal + +let build_directory : type key. key t -> key RPC_directory.t = + fun dir -> + let rpc_dir = ref (RPC_directory.empty : key RPC_directory.t) in + let register : + type ikey. + chunked:bool -> (key, ikey) RPC_path.t -> ikey opt_handler -> unit = + fun ~chunked path (Opt_handler {encoding; get}) -> + let service = + RPC_service.get_service ~query:depth_query ~output:encoding path + in + rpc_dir := + RPC_directory.opt_register ~chunked !rpc_dir service (fun k q () -> + get k (q.depth + 1)) + in + let rec build_handler : + type ikey. ikey t -> (key, ikey) RPC_path.t -> ikey opt_handler = + fun desc path -> + match desc.dir with + | Empty -> + Opt_handler + {encoding = Data_encoding.unit; get = (fun _ _ -> return_none)} + | Value {get; encoding} -> + let handler = + Opt_handler + { + encoding; + get = + (fun k i -> if Compare.Int.(i < 0) then return_none else get k); + } + in + register ~chunked:true path handler ; + handler + | NamedDir map -> + let fields = StringMap.bindings map in + let fields = + List.map + (fun (name, dir) -> + (name, build_handler dir RPC_path.(path / name))) + fields + in + let (Handler handler) = combine_object fields in + let handler = + Opt_handler + { + encoding = handler.encoding; + get = + (fun k i -> + if Compare.Int.(i < 0) then return_none + else handler.get k (i - 1) >>=? fun v -> return_some v); + } + in + register ~chunked:true path handler ; + handler + | IndexedDir {arg; arg_encoding; list; subdir} -> + let (Opt_handler handler) = + build_handler subdir RPC_path.(path /: arg) + in + let encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Leaf" + (dynamic_size arg_encoding) + (function key, None -> Some key | _ -> None) + (fun key -> (key, None)); + case + (Tag 1) + ~title:"Dir" + (tup2 + (dynamic_size arg_encoding) + (dynamic_size handler.encoding)) + (function key, Some value -> Some (key, value) | _ -> None) + (fun (key, value) -> (key, Some value)); + ] + in + let get k i = + if Compare.Int.(i < 0) then return_none + else if Compare.Int.(i = 0) then return_some [] + else + list k >>=? fun keys -> + List.map_es + (fun key -> + if Compare.Int.(i = 1) then return (key, None) + else handler.get (k, key) (i - 1) >|=? fun value -> (key, value)) + keys + >>=? fun values -> return_some values + in + let handler = + Opt_handler + {encoding = Data_encoding.(list (dynamic_size encoding)); get} + in + register ~chunked:true path handler ; + handler + in + ignore (build_handler dir RPC_path.open_root : key opt_handler) ; + !rpc_dir diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_description.mli b/src/proto_016_PtMumbai/lib_protocol/storage_description.mli new file mode 100644 index 000000000000..33e44cc39f13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_description.mli @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module is responsible for building the description of the current state + of the storage, which is then used to build specification of the RPC + endpoints for accessing the storage. It produces [resto] [RPC_directory.t] + values, which can be used directly to construct the RPC endpoint tree. *) + +(** Typed description of the key-value context. *) +type 'key t + +(** Trivial display of the key-value context layout. *) +val pp : Format.formatter -> 'key t -> unit + +(** Export an RPC hierarchy for querying the context. There is one service + by possible path in the context. Services for "directory" are able to + aggregate in one JSON object the whole subtree. *) +val build_directory : 'key t -> 'key RPC_directory.t + +(** Create a empty context description, + keys will be registered by side effects. *) +val create : unit -> 'key t + +(** Register a single key accessor at a given path. *) +val register_value : + 'key t -> get:('key -> 'a option tzresult Lwt.t) -> 'a Data_encoding.t -> unit + +(** Return a description for a prefixed fragment of the given context. + All keys registered in the subcontext will be shared by the external + context *) +val register_named_subcontext : 'key t -> string list -> 'key t + +(** Description of an index as a sequence of `RPC_arg.t`. *) +type (_, _, _) args = + | One : { + rpc_arg : 'a RPC_arg.t; + encoding : 'a Data_encoding.t; + compare : 'a -> 'a -> int; + } + -> ('key, 'a, 'key * 'a) args + | Pair : + ('key, 'a, 'inter_key) args * ('inter_key, 'b, 'sub_key) args + -> ('key, 'a * 'b, 'sub_key) args + +(** Return a description for a indexed sub-context. + All keys registered in the subcontext will be shared by the external + context. One should provide a function to list all the registered + index in the context. *) +val register_indexed_subcontext : + 'key t -> + list:('key -> 'arg list tzresult Lwt.t) -> + ('key, 'arg, 'sub_key) args -> + 'sub_key t + +(** Helpers for manipulating and defining indexes. *) + +val pack : ('key, 'a, 'sub_key) args -> 'key -> 'a -> 'sub_key + +val unpack : ('key, 'a, 'sub_key) args -> 'sub_key -> 'key * 'a + +module type INDEX = sig + type t + + include Path_encoding.S with type t := t + + val rpc_arg : t RPC_arg.t + + val encoding : t Data_encoding.t + + val compare : t -> t -> int +end diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_functors.ml b/src/proto_016_PtMumbai/lib_protocol/storage_functors.ml new file mode 100644 index 000000000000..885731544def --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_functors.ml @@ -0,0 +1,1273 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Storage_sigs + +module Registered = struct + let ghost = false +end + +module Ghost = struct + let ghost = true +end + +module type ENCODER = sig + type t + + val of_bytes : key:(unit -> string list) -> bytes -> t tzresult + + val to_bytes : t -> bytes +end + +module Make_encoder (V : VALUE) : ENCODER with type t := V.t = struct + let of_bytes ~key b = + match Data_encoding.Binary.of_bytes_opt V.encoding b with + | None -> error (Raw_context.Storage_error (Corrupted_data (key ()))) + | Some v -> Ok v + + let to_bytes v = + match Data_encoding.Binary.to_bytes_opt V.encoding v with + | Some b -> b + | None -> Bytes.empty +end + +let len_name = "len" + +let data_name = "data" + +let encode_len_value bytes = + let length = Bytes.length bytes in + Data_encoding.(Binary.to_bytes_exn int31) length + +let decode_len_value key len = + match Data_encoding.(Binary.of_bytes_opt int31) len with + | None -> error (Raw_context.Storage_error (Corrupted_data key)) + | Some len -> ok len + +module Make_subcontext (R : REGISTER) (C : Raw_context.T) (N : NAME) : + Raw_context.T with type t = C.t and type local_context = C.local_context = +struct + type t = C.t + + type local_context = C.local_context + + let to_key k = N.name @ k + + let mem t k = C.mem t (to_key k) + + let mem_tree t k = C.mem_tree t (to_key k) + + let get t k = C.get t (to_key k) + + let get_tree t k = C.get_tree t (to_key k) + + let find t k = C.find t (to_key k) + + let find_tree t k = C.find_tree t (to_key k) + + let add t k v = C.add t (to_key k) v + + let add_tree t k v = C.add_tree t (to_key k) v + + let init t k v = C.init t (to_key k) v + + let init_tree t k v = C.init_tree t (to_key k) v + + let update t k v = C.update t (to_key k) v + + let update_tree t k v = C.update_tree t (to_key k) v + + let add_or_remove t k v = C.add_or_remove t (to_key k) v + + let add_or_remove_tree t k v = C.add_or_remove_tree t (to_key k) v + + let remove_existing t k = C.remove_existing t (to_key k) + + let remove_existing_tree t k = C.remove_existing_tree t (to_key k) + + let remove t k = C.remove t (to_key k) + + let list t ?offset ?length k = C.list t ?offset ?length (to_key k) + + let fold ?depth t k ~order ~init ~f = + C.fold ?depth t (to_key k) ~order ~init ~f + + let config t = C.config t + + module Tree = C.Tree + module Proof = C.Proof + + let verify_tree_proof = C.verify_tree_proof + + let verify_stream_proof = C.verify_stream_proof + + let equal_config = C.equal_config + + let project = C.project + + let absolute_key c k = C.absolute_key c (to_key k) + + type error += Block_quota_exceeded = C.Block_quota_exceeded + + type error += Operation_quota_exceeded = C.Operation_quota_exceeded + + let consume_gas = C.consume_gas + + let check_enough_gas = C.check_enough_gas + + let description = + let description = + if R.ghost then Storage_description.create () else C.description + in + Storage_description.register_named_subcontext description N.name + + let length = C.length + + let with_local_context ctxt k f = C.with_local_context ctxt (to_key k) f + + module Local_context = C.Local_context +end + +module Make_single_data_storage + (R : REGISTER) + (C : Raw_context.T) + (N : NAME) + (V : VALUE) : Single_data_storage with type t = C.t and type value = V.t = +struct + type t = C.t + + type context = t + + type value = V.t + + let mem t = C.mem t N.name + + include Make_encoder (V) + + let get t = + C.get t N.name >>=? fun b -> + let key () = C.absolute_key t N.name in + Lwt.return (of_bytes ~key b) + + let find t = + C.find t N.name >|= function + | None -> Result.return_none + | Some b -> + let key () = C.absolute_key t N.name in + of_bytes ~key b >|? fun v -> Some v + + let init t v = C.init t N.name (to_bytes v) >|=? fun t -> C.project t + + let update t v = C.update t N.name (to_bytes v) >|=? fun t -> C.project t + + let add t v = C.add t N.name (to_bytes v) >|= fun t -> C.project t + + let add_or_remove t v = + C.add_or_remove t N.name (Option.map to_bytes v) >|= fun t -> C.project t + + let remove t = C.remove t N.name >|= fun t -> C.project t + + let remove_existing t = C.remove_existing t N.name >|=? fun t -> C.project t + + let () = + let open Storage_description in + let description = + if R.ghost then Storage_description.create () else C.description + in + register_value + ~get:find + (register_named_subcontext description N.name) + V.encoding +end + +module type INDEX = sig + type t + + include Path_encoding.S with type t := t + + type 'a ipath + + val args : ('a, t, 'a ipath) Storage_description.args +end + +module Pair (I1 : INDEX) (I2 : INDEX) : INDEX with type t = I1.t * I2.t = struct + type t = I1.t * I2.t + + let path_length = I1.path_length + I2.path_length + + let to_path (x, y) l = I1.to_path x (I2.to_path y l) + + let of_path l = + match Misc.take I1.path_length l with + | None -> None + | Some (l1, l2) -> ( + match (I1.of_path l1, I2.of_path l2) with + | Some x, Some y -> Some (x, y) + | _ -> None) + + type 'a ipath = 'a I1.ipath I2.ipath + + let args = Storage_description.Pair (I1.args, I2.args) +end + +module Make_data_set_storage (C : Raw_context.T) (I : INDEX) : + Data_set_storage with type t = C.t and type elt = I.t = struct + type t = C.t + + type context = t + + type elt = I.t + + let inited = Bytes.of_string "inited" + + let mem s i = C.mem s (I.to_path i []) + + let add s i = C.add s (I.to_path i []) inited >|= fun t -> C.project t + + let remove s i = C.remove s (I.to_path i []) >|= fun t -> C.project t + + let clear s = C.remove s [] >|= fun t -> C.project t + + let fold s ~order ~init ~f = + C.fold ~depth:(`Eq I.path_length) s [] ~order ~init ~f:(fun file tree acc -> + match C.Tree.kind tree with + | `Value -> ( + match I.of_path file with None -> assert false | Some p -> f p acc) + | `Tree -> Lwt.return acc) + + let elements s = + fold s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + register_value (* TODO fixme 'elements...' *) + ~get:(fun c -> + let c, k = unpack c in + mem c k >>= function true -> return_some true | false -> return_none) + (register_indexed_subcontext + ~list:(fun c -> elements c >|= ok) + C.description + I.args) + Data_encoding.bool +end + +module Make_indexed_data_storage (C : Raw_context.T) (I : INDEX) (V : VALUE) : + Indexed_data_storage with type t = C.t and type key = I.t and type value = V.t = +struct + type t = C.t + + type context = t + + type key = I.t + + type value = V.t + + include Make_encoder (V) + + let mem s i = C.mem s (I.to_path i []) + + let is_empty i = + let open Lwt_syntax in + let* root = C.find_tree i [] in + match root with + | None -> return_true + | Some root -> return @@ C.Tree.is_empty root + + let get s i = + C.get s (I.to_path i []) >>=? fun b -> + let key () = C.absolute_key s (I.to_path i []) in + Lwt.return (of_bytes ~key b) + + let find s i = + C.find s (I.to_path i []) >|= function + | None -> Result.return_none + | Some b -> + let key () = C.absolute_key s (I.to_path i []) in + of_bytes ~key b >|? fun v -> Some v + + let update s i v = + C.update s (I.to_path i []) (to_bytes v) >|=? fun t -> C.project t + + let init s i v = + C.init s (I.to_path i []) (to_bytes v) >|=? fun t -> C.project t + + let add s i v = C.add s (I.to_path i []) (to_bytes v) >|= fun t -> C.project t + + let add_or_remove s i v = + C.add_or_remove s (I.to_path i []) (Option.map to_bytes v) >|= fun t -> + C.project t + + let remove s i = C.remove s (I.to_path i []) >|= fun t -> C.project t + + let remove_existing s i = + C.remove_existing s (I.to_path i []) >|=? fun t -> C.project t + + let clear s = C.remove s [] >|= fun t -> C.project t + + let fold s ~order ~init ~f = + C.fold ~depth:(`Eq I.path_length) s [] ~order ~init ~f:(fun file tree acc -> + C.Tree.to_value tree >>= function + | Some v -> ( + match I.of_path file with + | None -> assert false + | Some path -> ( + let key () = C.absolute_key s file in + match of_bytes ~key v with + | Ok v -> f path v acc + | Error _ -> Lwt.return acc)) + | None -> Lwt.return acc) + + let fold_keys s ~order ~init ~f = + fold s ~order ~init ~f:(fun k _ acc -> f k acc) + + let bindings s = + fold s ~order:`Sorted ~init:[] ~f:(fun p v acc -> + Lwt.return ((p, v) :: acc)) + + let keys s = + fold_keys s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + register_value + ~get:(fun c -> + let c, k = unpack c in + find c k) + (register_indexed_subcontext + ~list:(fun c -> keys c >|= ok) + C.description + I.args) + V.encoding +end + +(* Internal-use-only version of {!Make_indexed_carbonated_data_storage} to + expose fold_keys_unaccounted *) +module Make_indexed_carbonated_data_storage_INTERNAL + (C : Raw_context.T) + (I : INDEX) + (V : VALUE) : + Indexed_carbonated_data_storage_INTERNAL + with type t = C.t + and type key = I.t + and type value = V.t = struct + type t = C.t + + type context = t + + type key = I.t + + type value = V.t + + include Make_encoder (V) + + let is_empty i = + let open Lwt_syntax in + let* root = C.find_tree i [] in + match root with + | None -> return_true + | Some root -> return @@ C.Tree.is_empty root + + let data_key i = I.to_path i [data_name] + + let len_key i = I.to_path i [len_name] + + let consume_mem_gas c key = + let path_length = List.length @@ C.absolute_key c key in + C.consume_gas c (Storage_costs.read_access ~path_length ~read_bytes:0) + + let existing_size c i = + C.find c (len_key i) >|= function + | None -> ok (0, false) + | Some len -> decode_len_value (len_key i) len >|? fun len -> (len, true) + + let consume_read_gas get c i = + let len_key = len_key i in + get c len_key >>=? fun len -> + let path_length = List.length @@ C.absolute_key c len_key in + Lwt.return + ( decode_len_value len_key len >>? fun read_bytes -> + let cost = Storage_costs.read_access ~path_length ~read_bytes in + C.consume_gas c cost ) + + (* For the future: here, we bill a generic cost for encoding the value + to bytes. It would be cleaner for users of this functor to provide + gas costs for the encoding. *) + let consume_serialize_write_gas set c i v = + let bytes = to_bytes v in + let len = Bytes.length bytes in + C.consume_gas c (Gas_limit_repr.alloc_mbytes_cost len) >>?= fun c -> + let cost = Storage_costs.write_access ~written_bytes:len in + C.consume_gas c cost >>?= fun c -> + set c (len_key i) (encode_len_value bytes) >|=? fun c -> (c, bytes) + + let consume_remove_gas del c i = + C.consume_gas c (Storage_costs.write_access ~written_bytes:0) >>?= fun c -> + del c (len_key i) + + let mem s i = + let key = data_key i in + consume_mem_gas s key >>?= fun s -> + C.mem s key >|= fun exists -> ok (C.project s, exists) + + let get_unprojected s i = + consume_read_gas C.get s i >>=? fun s -> + C.get s (data_key i) >>=? fun b -> + let key () = C.absolute_key s (data_key i) in + Lwt.return (of_bytes ~key b >|? fun v -> (s, v)) + + let get s i = get_unprojected s i >|=? fun (s, v) -> (C.project s, v) + + let find s i = + let key = data_key i in + consume_mem_gas s key >>?= fun s -> + C.mem s key >>= fun exists -> + if exists then get s i >|=? fun (s, v) -> (s, Some v) + else return (C.project s, None) + + let update s i v = + existing_size s i >>=? fun (prev_size, _) -> + consume_serialize_write_gas C.update s i v >>=? fun (s, bytes) -> + C.update s (data_key i) bytes >|=? fun t -> + let size_diff = Bytes.length bytes - prev_size in + (C.project t, size_diff) + + let init s i v = + consume_serialize_write_gas C.init s i v >>=? fun (s, bytes) -> + C.init s (data_key i) bytes >|=? fun t -> + let size = Bytes.length bytes in + (C.project t, size) + + let add s i v = + let add s i v = C.add s i v >|= ok in + existing_size s i >>=? fun (prev_size, existed) -> + consume_serialize_write_gas add s i v >>=? fun (s, bytes) -> + add s (data_key i) bytes >|=? fun t -> + let size_diff = Bytes.length bytes - prev_size in + (C.project t, size_diff, existed) + + let remove s i = + let remove s i = C.remove s i >|= ok in + existing_size s i >>=? fun (prev_size, existed) -> + consume_remove_gas remove s i >>=? fun s -> + remove s (data_key i) >|=? fun t -> (C.project t, prev_size, existed) + + let remove_existing s i = + existing_size s i >>=? fun (prev_size, _) -> + consume_remove_gas C.remove_existing s i >>=? fun s -> + C.remove_existing s (data_key i) >|=? fun t -> (C.project t, prev_size) + + let add_or_remove s i v = + match v with None -> remove s i | Some v -> add s i v + + (* TODO https://gitlab.com/tezos/tezos/-/issues/3318 + Switch implementation to use [C.list]. + Given that MR !2771 which flattens paths is done, we should use + [C.list] to avoid having to iterate over all keys when [length] and/or + [offset] is passed. + *) + let list_key_values ?(offset = 0) ?(length = max_int) s = + let root = [] in + let depth = `Eq I.path_length in + C.length s root >>= fun size -> + (* Regardless of the [length] argument, all elements stored in the context + are traversed. We therefore pay a gas cost proportional to the number of + elements, given by [size], upfront. We also pay gas for decoding elements + whenever they are loaded in the body of the fold. *) + C.consume_gas s (Storage_costs.list_key_values_traverse ~size) >>?= fun s -> + C.fold + s + root + ~depth + ~order:`Sorted + ~init:(ok (s, [], offset, length)) + ~f:(fun file tree acc -> + match (C.Tree.kind tree, acc) with + | `Tree, Ok (s, rev_values, offset, length) -> ( + if Compare.Int.(length <= 0) then + (* Keep going until the end, we have no means of short-circuiting *) + Lwt.return acc + else if Compare.Int.(offset > 0) then + (* Offset (first element) not reached yet *) + let offset = pred offset in + Lwt.return (Ok (s, rev_values, offset, length)) + else + (* Nominal case *) + match I.of_path file with + | None -> assert false + | Some key -> + (* This also accounts for gas for loading the element. *) + get_unprojected s key >|=? fun (s, value) -> + (s, (key, value) :: rev_values, 0, pred length)) + | _ -> + (* Even if we run out of gas or fail in some other way, we still + traverse the whole tree. In this case there is no context to + update. *) + Lwt.return acc) + >|=? fun (s, rev_values, _offset, _length) -> + (C.project s, List.rev rev_values) + + let fold_keys_unaccounted s ~order ~init ~f = + C.fold + ~depth:(`Eq (1 + I.path_length)) + s + [] + ~order + ~init + ~f:(fun file tree acc -> + match C.Tree.kind tree with + | `Value -> ( + match List.rev file with + | last :: _ when Compare.String.(last = len_name) -> Lwt.return acc + | last :: rest when Compare.String.(last = data_name) -> ( + let file = List.rev rest in + match I.of_path file with + | None -> assert false + | Some path -> f path acc) + | _ -> assert false) + | `Tree -> Lwt.return acc) + + let keys_unaccounted s = + fold_keys_unaccounted s ~order:`Sorted ~init:[] ~f:(fun p acc -> + Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + register_value (* TODO export consumed gas ?? *) + ~get:(fun c -> + let c, k = unpack c in + find c k >|=? fun (_, v) -> v) + (register_indexed_subcontext + ~list:(fun c -> keys_unaccounted c >|= ok) + C.description + I.args) + V.encoding +end + +module Make_indexed_carbonated_data_storage : functor + (C : Raw_context.T) + (I : INDEX) + (V : VALUE) + -> + Indexed_carbonated_data_storage + with type t = C.t + and type key = I.t + and type value = V.t = + Make_indexed_carbonated_data_storage_INTERNAL + +module Make_carbonated_data_set_storage (C : Raw_context.T) (I : INDEX) : + Carbonated_data_set_storage with type t = C.t and type elt = I.t = struct + module V = struct + type t = unit + + let encoding = Data_encoding.unit + end + + module M = Make_indexed_carbonated_data_storage_INTERNAL (C) (I) (V) + + type t = M.t + + type context = t + + type elt = I.t + + let mem = M.mem + + let init s i = M.init s i () + + let add s i = M.add s i () + + let remove s i = M.remove s i + + let fold_keys_unaccounted = M.fold_keys_unaccounted +end + +module Make_indexed_data_snapshotable_storage + (C : Raw_context.T) + (Snapshot_index : INDEX) + (I : INDEX) + (V : VALUE) : + Indexed_data_snapshotable_storage + with type t = C.t + and type snapshot = Snapshot_index.t + and type key = I.t + and type value = V.t = struct + type snapshot = Snapshot_index.t + + let data_name = ["current"] + + let snapshot_name = ["snapshot"] + + module C_data = + Make_subcontext (Registered) (C) + (struct + let name = data_name + end) + + module C_snapshot = + Make_subcontext (Registered) (C) + (struct + let name = snapshot_name + end) + + module V_encoder = Make_encoder (V) + include Make_indexed_data_storage (C_data) (I) (V) + module Snapshot = + Make_indexed_data_storage (C_snapshot) (Pair (Snapshot_index) (I)) (V) + + let snapshot_path id = snapshot_name @ Snapshot_index.to_path id [] + + let snapshot_exists s id = C.mem_tree s (snapshot_path id) + + let err_missing_key key = Raw_context.storage_error (Missing_key (key, Copy)) + + let snapshot s id = + C.find_tree s data_name >>= function + | None -> Lwt.return (err_missing_key data_name) + | Some tree -> + C.add_tree s (snapshot_path id) tree >|= (fun t -> C.project t) >|= ok + + let fold_snapshot s id ~order ~init ~f = + C.find_tree s (snapshot_path id) >>= function + | None -> Lwt.return (err_missing_key data_name) + | Some tree -> + C_data.Tree.fold + tree + ~depth:(`Eq I.path_length) + [] + ~order + ~init:(Ok init) + ~f:(fun file tree acc -> + acc >>?= fun acc -> + C.Tree.to_value tree >>= function + | Some v -> ( + match I.of_path file with + | None -> assert false + | Some path -> ( + let key () = C.absolute_key s file in + match V_encoder.of_bytes ~key v with + | Ok v -> f path v acc + | Error _ -> return acc)) + | None -> return acc) + + let delete_snapshot s id = + C.remove s (snapshot_path id) >|= fun t -> C.project t +end + +module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : + Indexed_raw_context + with type t = C.t + and type key = I.t + and type 'a ipath = 'a I.ipath + and type local_context = C.local_context = struct + type t = C.t + + type context = t + + type key = I.t + + type 'a ipath = 'a I.ipath + + type local_context = C.local_context + + let clear t = C.remove t [] >|= fun t -> C.project t + + let is_empty i = + let open Lwt_syntax in + let* root = C.find_tree i [] in + match root with + | None -> return_true + | Some root -> return @@ C.Tree.is_empty root + + let fold_keys t ~order ~init ~f = + C.fold ~depth:(`Eq I.path_length) t [] ~order ~init ~f:(fun path tree acc -> + match C.Tree.kind tree with + | `Tree -> ( + match I.of_path path with + | None -> assert false + | Some path -> f path acc) + | `Value -> Lwt.return acc) + + let keys t = + fold_keys t ~order:`Sorted ~init:[] ~f:(fun i acc -> Lwt.return (i :: acc)) + + let err_missing_key key = Raw_context.storage_error (Missing_key (key, Copy)) + + let copy t ~from ~to_ = + let from = I.to_path from [] in + let to_ = I.to_path to_ [] in + C.find_tree t from >>= function + | None -> Lwt.return (err_missing_key from) + | Some tree -> C.add_tree t to_ tree >|= ok + + let remove t k = C.remove t (I.to_path k []) + + let description = + Storage_description.register_indexed_subcontext + ~list:(fun c -> keys c >|= ok) + C.description + I.args + + let unpack = Storage_description.unpack I.args + + let pack = Storage_description.pack I.args + + module Raw_context : + Raw_context.T + with type t = C.t I.ipath + and type local_context = C.local_context = struct + type t = C.t I.ipath + + type local_context = C.local_context + + let to_key i k = I.to_path i k + + let mem c k = + let t, i = unpack c in + C.mem t (to_key i k) + + let mem_tree c k = + let t, i = unpack c in + C.mem_tree t (to_key i k) + + let get c k = + let t, i = unpack c in + C.get t (to_key i k) + + let get_tree c k = + let t, i = unpack c in + C.get_tree t (to_key i k) + + let find c k = + let t, i = unpack c in + C.find t (to_key i k) + + let find_tree c k = + let t, i = unpack c in + C.find_tree t (to_key i k) + + let list c ?offset ?length k = + let t, i = unpack c in + C.list t ?offset ?length (to_key i k) + + let init c k v = + let t, i = unpack c in + C.init t (to_key i k) v >|=? fun t -> pack t i + + let init_tree c k v = + let t, i = unpack c in + C.init_tree t (to_key i k) v >|=? fun t -> pack t i + + let update c k v = + let t, i = unpack c in + C.update t (to_key i k) v >|=? fun t -> pack t i + + let update_tree c k v = + let t, i = unpack c in + C.update_tree t (to_key i k) v >|=? fun t -> pack t i + + let add c k v = + let t, i = unpack c in + C.add t (to_key i k) v >|= fun t -> pack t i + + let add_tree c k v = + let t, i = unpack c in + C.add_tree t (to_key i k) v >|= fun t -> pack t i + + let add_or_remove c k v = + let t, i = unpack c in + C.add_or_remove t (to_key i k) v >|= fun t -> pack t i + + let add_or_remove_tree c k v = + let t, i = unpack c in + C.add_or_remove_tree t (to_key i k) v >|= fun t -> pack t i + + let remove_existing c k = + let t, i = unpack c in + C.remove_existing t (to_key i k) >|=? fun t -> pack t i + + let remove_existing_tree c k = + let t, i = unpack c in + C.remove_existing_tree t (to_key i k) >|=? fun t -> pack t i + + let remove c k = + let t, i = unpack c in + C.remove t (to_key i k) >|= fun t -> pack t i + + let fold ?depth c k ~order ~init ~f = + let t, i = unpack c in + C.fold ?depth t (to_key i k) ~order ~init ~f + + let config c = + let t, _ = unpack c in + C.config t + + module Tree = struct + include C.Tree + + let empty c = + let t, _ = unpack c in + C.Tree.empty t + end + + module Proof = C.Proof + + let verify_tree_proof = C.verify_tree_proof + + let verify_stream_proof = C.verify_stream_proof + + let equal_config = C.equal_config + + let project c = + let t, _ = unpack c in + C.project t + + let absolute_key c k = + let t, i = unpack c in + C.absolute_key t (to_key i k) + + type error += Block_quota_exceeded = C.Block_quota_exceeded + + type error += Operation_quota_exceeded = C.Operation_quota_exceeded + + let consume_gas c g = + let t, i = unpack c in + C.consume_gas t g >>? fun t -> ok (pack t i) + + let check_enough_gas c g = + let t, _i = unpack c in + C.check_enough_gas t g + + let description = description + + let length c = + let t, _i = unpack c in + C.length t + + let with_local_context c k f = + let t, i = unpack c in + C.with_local_context t (to_key i k) f >|=? fun (t, res) -> (pack t i, res) + + module Local_context = C.Local_context + end + + let with_local_context s i f = + Raw_context.with_local_context (pack s i) [] f >|=? fun (c, x) -> + let s, _ = unpack c in + (s, x) + + module Make_set (R : REGISTER) (N : NAME) : + Data_set_storage with type t = t and type elt = key = struct + type t = C.t + + type context = t + + type elt = I.t + + let inited = Bytes.of_string "inited" + + let mem s i = Raw_context.mem (pack s i) N.name + + let add s i = + Raw_context.add (pack s i) N.name inited >|= fun c -> + let s, _ = unpack c in + C.project s + + let remove s i = + Raw_context.remove (pack s i) N.name >|= fun c -> + let s, _ = unpack c in + C.project s + + let clear s = + fold_keys s ~init:s ~order:`Sorted ~f:(fun i s -> + Raw_context.remove (pack s i) N.name >|= fun c -> + let s, _ = unpack c in + s) + >|= fun t -> C.project t + + let fold s ~order ~init ~f = + fold_keys s ~order ~init ~f:(fun i acc -> + mem s i >>= function true -> f i acc | false -> Lwt.return acc) + + let elements s = + fold s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + let description = + if R.ghost then Storage_description.create () + else Raw_context.description + in + register_value + ~get:(fun c -> + let c, k = unpack c in + mem c k >>= function true -> return_some true | false -> return_none) + (register_named_subcontext description N.name) + Data_encoding.bool + end + + module Make_map (R : REGISTER) (N : NAME) (V : VALUE) : + Indexed_data_storage_with_local_context + with type t = t + and type key = key + and type value = V.t + and type local_context = local_context = struct + type t = C.t + + type context = t + + type key = I.t + + type value = V.t + + type nonrec local_context = local_context + + include Make_encoder (V) + + let is_empty i = + let open Lwt_syntax in + let* root = C.find_tree i [] in + match root with + | None -> return_true + | Some root -> return @@ C.Tree.is_empty root + + let mem s i = Raw_context.mem (pack s i) N.name + + let get s i = + Raw_context.get (pack s i) N.name >>=? fun b -> + let key () = Raw_context.absolute_key (pack s i) N.name in + Lwt.return (of_bytes ~key b) + + let find s i = + Raw_context.find (pack s i) N.name >|= function + | None -> Result.return_none + | Some b -> + let key () = Raw_context.absolute_key (pack s i) N.name in + of_bytes ~key b >|? fun v -> Some v + + let update s i v = + Raw_context.update (pack s i) N.name (to_bytes v) >|=? fun c -> + let s, _ = unpack c in + C.project s + + let init s i v = + Raw_context.init (pack s i) N.name (to_bytes v) >|=? fun c -> + let s, _ = unpack c in + C.project s + + let add s i v = + Raw_context.add (pack s i) N.name (to_bytes v) >|= fun c -> + let s, _ = unpack c in + C.project s + + let add_or_remove s i v = + Raw_context.add_or_remove (pack s i) N.name (Option.map to_bytes v) + >|= fun c -> + let s, _ = unpack c in + C.project s + + let remove s i = + Raw_context.remove (pack s i) N.name >|= fun c -> + let s, _ = unpack c in + C.project s + + let remove_existing s i = + Raw_context.remove_existing (pack s i) N.name >|=? fun c -> + let s, _ = unpack c in + C.project s + + let clear s = + fold_keys s ~order:`Sorted ~init:s ~f:(fun i s -> + Raw_context.remove (pack s i) N.name >|= fun c -> + let s, _ = unpack c in + s) + >|= fun t -> C.project t + + let fold s ~order ~init ~f = + fold_keys s ~order ~init ~f:(fun i acc -> + get s i >>= function Error _ -> Lwt.return acc | Ok v -> f i v acc) + + let bindings s = + fold s ~order:`Sorted ~init:[] ~f:(fun p v acc -> + Lwt.return ((p, v) :: acc)) + + let fold_keys s ~order ~init ~f = + fold_keys s ~order ~init ~f:(fun i acc -> + mem s i >>= function false -> Lwt.return acc | true -> f i acc) + + let keys s = + fold_keys s ~order:`Sorted ~init:[] ~f:(fun p acc -> + Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + let description = + if R.ghost then Storage_description.create () + else Raw_context.description + in + register_value + ~get:(fun c -> + let c, k = unpack c in + find c k) + (register_named_subcontext description N.name) + V.encoding + + module Local = struct + type context = Raw_context.Local_context.t + + let mem local = Raw_context.Local_context.mem local N.name + + let get local = + Raw_context.Local_context.get local N.name >|= fun r -> + let key () = Raw_context.Local_context.absolute_key local N.name in + r >>? of_bytes ~key + + let find local = + Raw_context.Local_context.find local N.name >|= function + | None -> Result.return_none + | Some b -> + let key () = Raw_context.Local_context.absolute_key local N.name in + of_bytes ~key b >|? fun v -> Some v + + let init local v = + Raw_context.Local_context.init local N.name (to_bytes v) + + let update local v = + Raw_context.Local_context.update local N.name (to_bytes v) + + let add local v = Raw_context.Local_context.add local N.name (to_bytes v) + + let add_or_remove local vo = + Raw_context.Local_context.add_or_remove + local + N.name + (Option.map to_bytes vo) + + let remove_existing local = + Raw_context.Local_context.remove_existing local N.name + + let remove local = Raw_context.Local_context.remove local N.name + end + end + + module Make_carbonated_map (R : REGISTER) (N : NAME) (V : VALUE) : + Non_iterable_indexed_carbonated_data_storage + with type t = t + and type key = key + and type value = V.t = struct + type t = C.t + + type context = t + + type key = I.t + + type value = V.t + + include Make_encoder (V) + + let len_name = len_name :: N.name + + let data_name = data_name :: N.name + + let consume_mem_gas c = + let path_length = List.length (Raw_context.absolute_key c N.name) + 1 in + Raw_context.consume_gas + c + (Storage_costs.read_access ~path_length ~read_bytes:0) + + let existing_size c = + Raw_context.find c len_name >|= function + | None -> ok (0, false) + | Some len -> decode_len_value len_name len >|? fun len -> (len, true) + + let consume_read_gas get c = + let path_length = List.length (Raw_context.absolute_key c N.name) + 1 in + get c len_name >>=? fun len -> + Lwt.return + ( decode_len_value len_name len >>? fun read_bytes -> + Raw_context.consume_gas + c + (Storage_costs.read_access ~path_length ~read_bytes) ) + + let consume_write_gas set c v = + let bytes = to_bytes v in + let len = Bytes.length bytes in + Raw_context.consume_gas c (Storage_costs.write_access ~written_bytes:len) + >>?= fun c -> + set c len_name (encode_len_value bytes) >|=? fun c -> (c, bytes) + + let consume_remove_gas del c = + Raw_context.consume_gas c (Storage_costs.write_access ~written_bytes:0) + >>?= fun c -> del c len_name + + let mem s i = + consume_mem_gas (pack s i) >>?= fun c -> + Raw_context.mem c data_name >|= fun res -> ok (Raw_context.project c, res) + + let get s i = + consume_read_gas Raw_context.get (pack s i) >>=? fun c -> + Raw_context.get c data_name >>=? fun b -> + let key () = Raw_context.absolute_key c data_name in + Lwt.return (of_bytes ~key b >|? fun v -> (Raw_context.project c, v)) + + let find s i = + consume_mem_gas (pack s i) >>?= fun c -> + let s, _ = unpack c in + Raw_context.mem (pack s i) data_name >>= fun exists -> + if exists then get s i >|=? fun (s, v) -> (s, Some v) + else return (C.project s, None) + + let update s i v = + existing_size (pack s i) >>=? fun (prev_size, _) -> + consume_write_gas Raw_context.update (pack s i) v >>=? fun (c, bytes) -> + Raw_context.update c data_name bytes >|=? fun c -> + let size_diff = Bytes.length bytes - prev_size in + (Raw_context.project c, size_diff) + + let init s i v = + consume_write_gas Raw_context.init (pack s i) v >>=? fun (c, bytes) -> + Raw_context.init c data_name bytes >|=? fun c -> + let size = Bytes.length bytes in + (Raw_context.project c, size) + + let add s i v = + let add c k v = Raw_context.add c k v >|= ok in + existing_size (pack s i) >>=? fun (prev_size, existed) -> + consume_write_gas add (pack s i) v >>=? fun (c, bytes) -> + add c data_name bytes >|=? fun c -> + let size_diff = Bytes.length bytes - prev_size in + (Raw_context.project c, size_diff, existed) + + let remove s i = + let remove c k = Raw_context.remove c k >|= ok in + existing_size (pack s i) >>=? fun (prev_size, existed) -> + consume_remove_gas remove (pack s i) >>=? fun c -> + remove c data_name >|=? fun c -> + (Raw_context.project c, prev_size, existed) + + let remove_existing s i = + existing_size (pack s i) >>=? fun (prev_size, _) -> + consume_remove_gas Raw_context.remove_existing (pack s i) >>=? fun c -> + Raw_context.remove_existing c data_name >|=? fun c -> + (Raw_context.project c, prev_size) + + let add_or_remove s i v = + match v with None -> remove s i | Some v -> add s i v + + let mem_unaccounted s i = Raw_context.mem (pack s i) data_name + + let fold_keys_unaccounted s ~order ~init ~f = + fold_keys s ~order ~init ~f:(fun i acc -> + mem_unaccounted s i >>= function + | false -> Lwt.return acc + | true -> f i acc) + + let keys_unaccounted s = + fold_keys_unaccounted s ~order:`Sorted ~init:[] ~f:(fun p acc -> + Lwt.return (p :: acc)) + + let () = + let open Storage_description in + let unpack = unpack I.args in + let description = + if R.ghost then Storage_description.create () + else Raw_context.description + in + register_value + ~get:(fun c -> + let c, k = unpack c in + find c k >|=? fun (_, v) -> v) + (register_named_subcontext description N.name) + V.encoding + end +end + +module type WRAPPER = sig + type t + + type key + + val wrap : t -> key + + val unwrap : key -> t option +end + +module Wrap_indexed_data_storage + (C : Indexed_data_storage) + (K : WRAPPER with type key := C.key) : + Indexed_data_storage + with type t = C.t + and type key = K.t + and type value = C.value = struct + type t = C.t + + type context = C.t + + type key = K.t + + type value = C.value + + let is_empty ctxt = C.is_empty ctxt + + let mem ctxt k = C.mem ctxt (K.wrap k) + + let get ctxt k = C.get ctxt (K.wrap k) + + let find ctxt k = C.find ctxt (K.wrap k) + + let update ctxt k v = C.update ctxt (K.wrap k) v + + let init ctxt k v = C.init ctxt (K.wrap k) v + + let add ctxt k v = C.add ctxt (K.wrap k) v + + let add_or_remove ctxt k v = C.add_or_remove ctxt (K.wrap k) v + + let remove_existing ctxt k = C.remove_existing ctxt (K.wrap k) + + let remove ctxt k = C.remove ctxt (K.wrap k) + + let clear ctxt = C.clear ctxt + + let fold ctxt ~order ~init ~f = + C.fold ctxt ~order ~init ~f:(fun k v acc -> + match K.unwrap k with None -> Lwt.return acc | Some k -> f k v acc) + + let bindings s = + fold s ~order:`Sorted ~init:[] ~f:(fun p v acc -> + Lwt.return ((p, v) :: acc)) + + let fold_keys s ~order ~init ~f = + C.fold_keys s ~order ~init ~f:(fun k acc -> + match K.unwrap k with None -> Lwt.return acc | Some k -> f k acc) + + let keys s = + fold_keys s ~order:`Sorted ~init:[] ~f:(fun p acc -> Lwt.return (p :: acc)) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_functors.mli b/src/proto_016_PtMumbai/lib_protocol/storage_functors.mli new file mode 100644 index 000000000000..8ab39501caf3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_functors.mli @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Tezos Protocol Implementation - Typed storage builders. + + Contains functors used by [Storage] to create the structure on + disk. + + See {!Make_subcontext} + *) + +open Storage_sigs + +module Registered : REGISTER + +module Ghost : REGISTER + +(** Given a [Raw_context], return a new [Raw_context] that projects into + a given subtree. Similar to a {i functional lens}. + *) +module Make_subcontext (_ : REGISTER) (C : Raw_context.T) (_ : NAME) : + Raw_context.T with type t = C.t + +module Make_single_data_storage + (_ : REGISTER) + (C : Raw_context.T) + (_ : NAME) + (V : VALUE) : Single_data_storage with type t = C.t and type value = V.t + +(** A type that can be serialized as a [string list], and used + as a prefix in the typed datastore. + + Useful to implement storage of maps and sets. + *) +module type INDEX = sig + type t + + include Path_encoding.S with type t := t + + type 'a ipath + + val args : ('a, t, 'a ipath) Storage_description.args +end + +module Pair (I1 : INDEX) (I2 : INDEX) : INDEX with type t = I1.t * I2.t + +(** Create storage for a compound type. *) +module Make_data_set_storage (C : Raw_context.T) (I : INDEX) : + Data_set_storage with type t = C.t and type elt = I.t + +(** Like [Make_data_set_storage], adding tracking of storage cost. *) +module Make_carbonated_data_set_storage (C : Raw_context.T) (I : INDEX) : + Carbonated_data_set_storage with type t = C.t and type elt = I.t + +(** This functor creates storage for types with a notion of an index. *) +module Make_indexed_data_storage (C : Raw_context.T) (I : INDEX) (V : VALUE) : + Indexed_data_storage with type t = C.t and type key = I.t and type value = V.t + +(** Like [Make_indexed_data_storage], adding tracking of storage cost. *) +module Make_indexed_carbonated_data_storage + (C : Raw_context.T) + (I : INDEX) + (V : VALUE) : + Indexed_carbonated_data_storage + with type t = C.t + and type key = I.t + and type value = V.t + +module Make_indexed_data_snapshotable_storage + (C : Raw_context.T) + (Snapshot : INDEX) + (I : INDEX) + (V : VALUE) : + Indexed_data_snapshotable_storage + with type t = C.t + and type snapshot = Snapshot.t + and type key = I.t + and type value = V.t + +module Make_indexed_subcontext (C : Raw_context.T) (I : INDEX) : + Indexed_raw_context + with type t = C.t + and type key = I.t + and type 'a ipath = 'a I.ipath + +module type WRAPPER = sig + type t + + type key + + val wrap : t -> key + + val unwrap : key -> t option +end + +module Wrap_indexed_data_storage + (C : Indexed_data_storage) + (K : WRAPPER with type key := C.key) : + Indexed_data_storage + with type t = C.t + and type key = K.t + and type value = C.value diff --git a/src/proto_016_PtMumbai/lib_protocol/storage_sigs.ml b/src/proto_016_PtMumbai/lib_protocol/storage_sigs.ml new file mode 100644 index 000000000000..f0494bf1fa36 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/storage_sigs.ml @@ -0,0 +1,500 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** {1 Entity Accessor Signatures} *) + +(** The generic signature of a single data accessor (a single value + bound to a specific key in the hierarchical (key x value) + database). *) +module type Single_data_storage = sig + type t + + type context = t + + (** The type of the value *) + type value + + (** Tells if the data is already defined *) + val mem : context -> bool Lwt.t + + (** Retrieve the value from the storage bucket ; returns a + {!Storage_error} if the key is not set or if the deserialisation + fails *) + val get : context -> value tzresult Lwt.t + + (** Retrieves the value from the storage bucket ; returns [None] if + the data is not initialized, or {!Storage_helpers.Storage_error} + if the deserialisation fails *) + val find : context -> value option tzresult Lwt.t + + (** Allocates the storage bucket and initializes it ; returns a + {!Storage_error Existing_key} if the bucket exists *) + val init : context -> value -> Raw_context.t tzresult Lwt.t + + (** Updates the content of the bucket ; returns a {!Storage_Error + Missing_key} if the value does not exists *) + val update : context -> value -> Raw_context.t tzresult Lwt.t + + (** Allocates the data and initializes it with a value ; just + updates it if the bucket exists *) + val add : context -> value -> Raw_context.t Lwt.t + + (** When the value is [Some v], allocates the data and initializes + it with [v] ; just updates it if the bucket exists. When the + value is [None], delete the storage bucket when the value ; does + nothing if the bucket does not exists. *) + val add_or_remove : context -> value option -> Raw_context.t Lwt.t + + (** Delete the storage bucket ; returns a {!Storage_error + Missing_key} if the bucket does not exists *) + val remove_existing : context -> Raw_context.t tzresult Lwt.t + + (** Removes the storage bucket and its contents ; does nothing if + the bucket does not exists *) + val remove : context -> Raw_context.t Lwt.t +end + +(** Restricted version of {!Indexed_data_storage} w/o iterators. *) +module type Non_iterable_indexed_data_storage = sig + type t + + type context = t + + (** An abstract type for keys *) + type key + + (** The type of values *) + type value + + (** Tells if a given key is already bound to a storage bucket *) + val mem : context -> key -> bool Lwt.t + + (** Retrieve a value from the storage bucket at a given key ; + returns {!Storage_error Missing_key} if the key is not set ; + returns {!Storage_error Corrupted_data} if the deserialisation + fails. *) + val get : context -> key -> value tzresult Lwt.t + + (** Retrieve a value from the storage bucket at a given key ; + returns [None] if the value is not set ; returns {!Storage_error + Corrupted_data} if the deserialisation fails. *) + val find : context -> key -> value option tzresult Lwt.t + + (** Updates the content of a bucket ; returns A {!Storage_Error + Missing_key} if the value does not exists. *) + val update : context -> key -> value -> Raw_context.t tzresult Lwt.t + + (** Allocates a storage bucket at the given key and initializes it ; + returns a {!Storage_error Existing_key} if the bucket exists. *) + val init : context -> key -> value -> Raw_context.t tzresult Lwt.t + + (** Allocates a storage bucket at the given key and initializes it + with a value ; just updates it if the bucket exists. *) + val add : context -> key -> value -> Raw_context.t Lwt.t + + (** When the value is [Some v], allocates the data and initializes + it with [v] ; just updates it if the bucket exists. When the + value is [None], delete the storage bucket when the value ; does + nothing if the bucket does not exists. *) + val add_or_remove : context -> key -> value option -> Raw_context.t Lwt.t + + (** Delete a storage bucket and its contents ; returns a + {!Storage_error Missing_key} if the bucket does not exists. *) + val remove_existing : context -> key -> Raw_context.t tzresult Lwt.t + + (** Removes a storage bucket and its contents ; does nothing if the + bucket does not exists. *) + val remove : context -> key -> Raw_context.t Lwt.t +end + +(** Variant of {!Non_iterable_indexed_data_storage} with gas accounting. *) +module type Non_iterable_indexed_carbonated_data_storage = sig + type t + + type context = t + + (** An abstract type for keys *) + type key + + (** The type of values *) + type value + + (** Tells if a given key is already bound to a storage bucket. + Consumes [Gas_repr.read_bytes_cost Z.zero]. *) + val mem : context -> key -> (Raw_context.t * bool) tzresult Lwt.t + + (** Retrieve a value from the storage bucket at a given key ; + returns {!Storage_error Missing_key} if the key is not set ; + returns {!Storage_error Corrupted_data} if the deserialisation + fails. + Consumes [Gas_repr.read_bytes_cost <size of the value>]. *) + val get : context -> key -> (Raw_context.t * value) tzresult Lwt.t + + (** Retrieve a value from the storage bucket at a given key ; + returns [None] if the value is not set ; returns {!Storage_error + Corrupted_data} if the deserialisation fails. + Consumes [Gas_repr.read_bytes_cost <size of the value>] if present + or [Gas_repr.read_bytes_cost Z.zero]. *) + val find : context -> key -> (Raw_context.t * value option) tzresult Lwt.t + + (** Updates the content of a bucket ; returns A {!Storage_Error + Missing_key} if the value does not exists. + Consumes serialization cost. + Consumes [Gas_repr.write_bytes_cost <size of the new value>]. + Returns the difference from the old to the new size. *) + val update : context -> key -> value -> (Raw_context.t * int) tzresult Lwt.t + + (** Allocates a storage bucket at the given key and initializes it ; + returns a {!Storage_error Existing_key} if the bucket exists. + Consumes serialization cost. + Consumes [Gas_repr.write_bytes_cost <size of the value>]. + Returns the size. *) + val init : context -> key -> value -> (Raw_context.t * int) tzresult Lwt.t + + (** Allocates a storage bucket at the given key and initializes it + with a value ; just updates it if the bucket exists. + Consumes serialization cost. + Consumes [Gas_repr.write_bytes_cost <size of the new value>]. + Returns the difference from the old (maybe 0) to the new size, and a boolean + indicating if a value was already associated to this key. *) + val add : + context -> key -> value -> (Raw_context.t * int * bool) tzresult Lwt.t + + (** When the value is [Some v], allocates the data and initializes + it with [v] ; just updates it if the bucket exists. When the + value is [None], delete the storage bucket when the value ; does + nothing if the bucket does not exists. + Consumes serialization cost. + Consumes the same gas cost as either {!remove} or {!init_set}. + Returns the difference from the old (maybe 0) to the new size, and a boolean + indicating if a value was already associated to this key. *) + val add_or_remove : + context -> + key -> + value option -> + (Raw_context.t * int * bool) tzresult Lwt.t + + (** Delete a storage bucket and its contents ; returns a + {!Storage_error Missing_key} if the bucket does not exists. + Consumes [Gas_repr.write_bytes_cost Z.zero]. + Returns the freed size. *) + val remove_existing : context -> key -> (Raw_context.t * int) tzresult Lwt.t + + (** Removes a storage bucket and its contents ; does nothing if the + bucket does not exists. + Consumes [Gas_repr.write_bytes_cost Z.zero]. + Returns the freed size, and a boolean + indicating if a value was already associated to this key. *) + val remove : context -> key -> (Raw_context.t * int * bool) tzresult Lwt.t + + (** Returns the list of all storage bucket keys. + Not carbonated (i.e. gas is not consumed); use with care. *) + val keys_unaccounted : context -> key list Lwt.t +end + +module type Indexed_carbonated_data_storage = sig + include Non_iterable_indexed_carbonated_data_storage + + (** [list_key_values ?offset ?length storage] lists the key and value pairs of + each entry in the given [storage]. The first [offset] values are ignored + (if passed). Negative offsets are treated as [0]. There will be no more + than [length] values in the result list (if passed). Negative values are + treated as [0]. + + The returned {!context} takes into account gas consumption of traversing + the keys and loading values. *) + val list_key_values : + ?offset:int -> + ?length:int -> + t -> + (Raw_context.t * (key * value) list) tzresult Lwt.t + + (** Returns [true] iff [context] is empty. *) + val is_empty : context -> bool Lwt.t +end + +module type Indexed_carbonated_data_storage_INTERNAL = sig + include Indexed_carbonated_data_storage + + val fold_keys_unaccounted : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> 'a -> 'a Lwt.t) -> + 'a Lwt.t +end + +(** The generic signature of indexed data accessors (a set of values + of the same type indexed by keys of the same form in the + hierarchical (key x value) database). *) +module type Indexed_data_storage = sig + include Non_iterable_indexed_data_storage + + (** Empties all the keys and associated data. *) + val clear : context -> Raw_context.t Lwt.t + + (** Lists all the keys. *) + val keys : context -> key list Lwt.t + + (** Lists all the keys and associated data. *) + val bindings : context -> (key * value) list Lwt.t + + (** Iterates over all the keys and associated data. *) + val fold : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> value -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + (** Iterate over all the keys. *) + val fold_keys : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + (** Returns [true] iff [context] is empty. *) + val is_empty : context -> bool Lwt.t +end + +module type Indexed_data_storage_with_local_context = sig + include Indexed_data_storage + + type local_context + + module Local : sig + type context = local_context + + (** Tells if the data is already defined *) + val mem : context -> bool Lwt.t + + (** Retrieves the value from the storage bucket; returns a + {!Storage_error} if the key is not set or if the deserialisation + fails *) + val get : context -> value tzresult Lwt.t + + (** Retrieves the value from the storage bucket ; returns [None] if + the data is not initialized, or {!Storage_helpers.Storage_error} + if the deserialisation fails *) + val find : context -> value option tzresult Lwt.t + + (** Allocates the storage bucket and initializes it ; returns a + {!Storage_error Existing_key} if the bucket exists *) + val init : context -> value -> context tzresult Lwt.t + + (** Updates the content of the bucket; returns a {!Storage_Error + Missing_key} if the value does not exist *) + val update : context -> value -> context tzresult Lwt.t + + (** Allocates the data and initializes it with a value ; just + updates it if the bucket exists *) + val add : context -> value -> context Lwt.t + + (** When the value is [Some v], allocates the data and initializes + it with [v] ; just updates it if the bucket exists. When the + value is [None], deletes the storage bucket; it does + nothing if the bucket does not exists. *) + val add_or_remove : context -> value option -> context Lwt.t + + (** Delete the storage bucket ; returns a {!Storage_error + Missing_key} if the bucket does not exists *) + val remove_existing : context -> context tzresult Lwt.t + + (** Removes the storage bucket and its contents; does nothing if + the bucket does not exist *) + val remove : context -> context Lwt.t + end +end + +module type Indexed_data_snapshotable_storage = sig + type snapshot + + type key + + include Indexed_data_storage with type key := key + + module Snapshot : + Indexed_data_storage + with type key = snapshot * key + and type value = value + and type t = t + + val snapshot_exists : context -> snapshot -> bool Lwt.t + + val snapshot : context -> snapshot -> Raw_context.t tzresult Lwt.t + + val fold_snapshot : + context -> + snapshot -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> value -> 'a -> 'a tzresult Lwt.t) -> + 'a tzresult Lwt.t + + val delete_snapshot : context -> snapshot -> Raw_context.t Lwt.t +end + +(** The generic signature of a data set accessor (a set of values + bound to a specific key prefix in the hierarchical (key x value) + database). *) +module type Data_set_storage = sig + type t + + type context = t + + (** The type of elements. *) + type elt + + (** Tells if a elt is a member of the set *) + val mem : context -> elt -> bool Lwt.t + + (** Adds a elt is a member of the set *) + val add : context -> elt -> Raw_context.t Lwt.t + + (** Removes a elt of the set ; does nothing if not a member *) + val remove : context -> elt -> Raw_context.t Lwt.t + + (** Returns the elements of the set, deserialized in a list in no + particular order. *) + val elements : context -> elt list Lwt.t + + (** Iterates over the elements of the set. *) + val fold : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(elt -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + (** Removes all elements in the set *) + val clear : context -> Raw_context.t Lwt.t +end + +(** Variant of {!Data_set_storage} with gas accounting. *) +module type Carbonated_data_set_storage = sig + type t + + type context = t + + (** The type of elements. *) + type elt + + (** Tells whether an elt is a member of the set. + Consumes [Gas_repr.read_bytes_cost Z.zero] *) + val mem : context -> elt -> (Raw_context.t * bool) tzresult Lwt.t + + (** Adds an elt as a member of the set. + Consumes [Gas_repr.write_bytes_cost <size of the new value>]. + Returns the the new size. *) + val init : context -> elt -> (Raw_context.t * int) tzresult Lwt.t + + (** Adds an elt as a member of the set. + Consumes [Gas_repr.write_bytes_cost <size of the new value>]. + Returns the new size, and true if the value previously existed. *) + val add : context -> elt -> (Raw_context.t * int * bool) tzresult Lwt.t + + (** Removes an elt from the set ; does nothing if not a member. + Consumes [Gas_repr.write_bytes_cost Z.zero]. + Returns the freed size, and a boolean + indicating if a value was already associated to this key. *) + val remove : context -> elt -> (Raw_context.t * int * bool) tzresult Lwt.t + + val fold_keys_unaccounted : + context -> + order:[`Sorted | `Undefined] -> + init:'acc -> + f:(elt -> 'acc -> 'acc Lwt.t) -> + 'acc Lwt.t +end + +module type NAME = sig + val name : Raw_context.key +end + +module type VALUE = sig + type t + + val encoding : t Data_encoding.t +end + +module type REGISTER = sig + val ghost : bool +end + +module type Indexed_raw_context = sig + type t + + type context = t + + type key + + type 'a ipath + + type local_context + + val clear : context -> Raw_context.t Lwt.t + + val is_empty : context -> bool Lwt.t + + val fold_keys : + context -> + order:[`Sorted | `Undefined] -> + init:'a -> + f:(key -> 'a -> 'a Lwt.t) -> + 'a Lwt.t + + val keys : context -> key list Lwt.t + + val remove : context -> key -> context Lwt.t + + val copy : context -> from:key -> to_:key -> context tzresult Lwt.t + + val with_local_context : + context -> + key -> + (local_context -> (local_context * 'a) tzresult Lwt.t) -> + (context * 'a) tzresult Lwt.t + + module Make_set (_ : REGISTER) (_ : NAME) : + Data_set_storage with type t = t and type elt = key + + module Make_map (_ : REGISTER) (_ : NAME) (V : VALUE) : + Indexed_data_storage_with_local_context + with type t = t + and type key = key + and type value = V.t + and type local_context = local_context + + module Make_carbonated_map (_ : REGISTER) (_ : NAME) (V : VALUE) : + Non_iterable_indexed_carbonated_data_storage + with type t = t + and type key = key + and type value = V.t + + module Raw_context : Raw_context.T with type t = t ipath +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/README.md b/src/proto_016_PtMumbai/lib_protocol/test/README.md new file mode 100644 index 000000000000..b0ec6d5b0464 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/README.md @@ -0,0 +1,30 @@ +# lib_protocol tests + +This folder contains unit, integration and property-based tests for +the economic protocol definition. The tests are organized in +sub-folders: first by type of test, and for integration, a further +subdivision by theme: + +- `unit`: tests that sit below `Alpha_context`. +- `integration`: tests that require passing around a context. + - `michelson`: tests that involve Micheline expressions. + - `consensus`: tests for consensus: baking, endorsement, etc. + - `gas`: tests for gas. + - `operations`: test for operations. +- `pbt`: for property-based tests using `qcheck`. + +Finally, `helpers/` contains common definitions for writing tests. + +There might not be a clear-cut location for new tests. For new +integration tests, either add them directly to `integration/` or +create a new sub-folder corresponding to the theme of the test. + +# Running + +To run all the tests, run: + +``` +dune runtest src/proto_alpha/lib_protocol/ +``` + +To run an individual test file, consult its `Invocation` header. diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/README.md b/src/proto_016_PtMumbai/lib_protocol/test/helpers/README.md new file mode 100644 index 000000000000..b071cfb4ec03 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/README.md @@ -0,0 +1,3 @@ +## Helpers to build unit/integration tests for the protocol + +The OPAM package `tezos-alpha-test-helpers` contains helpers to build unit/integration tests, like forging a block, a context, nonces, operations, etc. diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.ml new file mode 100644 index 000000000000..3e7d428897e5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.ml @@ -0,0 +1,154 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type t = { + pkh : Tezos_crypto.Signature.Public_key_hash.t; + pk : Tezos_crypto.Signature.Public_key.t; + sk : Tezos_crypto.Signature.Secret_key.t; +} + +type account = t + +let known_accounts = Tezos_crypto.Signature.Public_key_hash.Table.create 17 + +let random_seed ~rng_state = + Bytes.init Tezos_crypto.Hacl.Ed25519.sk_size (fun _i -> + Char.chr (Random.State.int rng_state 256)) + +let random_algo ~rng_state : Tezos_crypto.Signature.algo = + match Random.State.int rng_state 3 with + | 0 -> Ed25519 + | 1 -> Secp256k1 + | 2 -> P256 + | 3 -> Bls + | _ -> assert false + +let new_account ?(rng_state = Random.State.make_self_init ()) + ?(seed = random_seed ~rng_state) ?(algo = random_algo ~rng_state) () = + let pkh, pk, sk = Tezos_crypto.Signature.generate_key ~algo ~seed () in + let account = {pkh; pk; sk} in + Tezos_crypto.Signature.Public_key_hash.Table.add known_accounts pkh account ; + account + +let add_account ({pkh; _} as account) = + Tezos_crypto.Signature.Public_key_hash.Table.add known_accounts pkh account + +let activator_account = + let seed = random_seed ~rng_state:(Random.State.make [|0x1337533D|]) in + new_account ~seed () + +let find pkh = + match + Tezos_crypto.Signature.Public_key_hash.Table.find known_accounts pkh + with + | Some k -> return k + | None -> + failwith + "Missing account: %a" + Tezos_crypto.Signature.Public_key_hash.pp + pkh + +let find_alternate pkh = + let exception Found of t in + try + Tezos_crypto.Signature.Public_key_hash.Table.iter + (fun pkh' account -> + if not (Tezos_crypto.Signature.Public_key_hash.equal pkh pkh') then + raise (Found account)) + known_accounts ; + raise Not_found + with Found account -> account + +let dummy_account = + let seed = + random_seed ~rng_state:(Random.State.make [|0x1337533D; 0x1337533D|]) + in + new_account ~seed () + +let default_initial_balance = Tez.of_mutez_exn 4_000_000_000_000L + +let generate_accounts ?rng_state n : t list tzresult = + Tezos_crypto.Signature.Public_key_hash.Table.clear known_accounts ; + List.init ~when_negative_length:[] n (fun _i -> new_account ?rng_state ()) + +let commitment_secret = + Blinded_public_key_hash.activation_code_of_hex + "aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb" + |> WithExceptions.Option.get ~loc:__LOC__ + +let new_commitment ?seed () = + let pkh, pk, sk = + Tezos_crypto.Signature.generate_key ?seed ~algo:Ed25519 () + in + let unactivated_account = {pkh; pk; sk} in + let open Commitment in + let pkh = match pkh with Ed25519 pkh -> pkh | _ -> assert false in + let bpkh = Blinded_public_key_hash.of_ed25519_pkh commitment_secret pkh in + Lwt.return + ( (Environment.wrap_tzresult @@ Tez.(one *? 4_000L)) >|? fun amount -> + (unactivated_account, {blinded_public_key_hash = bpkh; amount}) ) + +let pkh_of_contract_exn = function + | Contract.Implicit pkh -> pkh + | Originated _ -> assert false + +let make_bootstrap_account ?(balance = default_initial_balance) + ?(delegate_to = None) ?(consensus_key = None) account = + Parameters. + { + public_key_hash = account.pkh; + public_key = Some account.pk; + amount = balance; + delegate_to; + consensus_key; + } + +let rec make_bootstrap_accounts ?(bootstrap_balances = []) + ?(bootstrap_delegations = []) ?(bootstrap_consensus_keys = []) accounts = + let decons_of_opt = function x :: xs -> (x, xs) | [] -> (None, []) in + let decons = function x :: xs -> (Some x, xs) | [] -> (None, []) in + match accounts with + | account :: accounts -> + let balance, bootstrap_balances = decons bootstrap_balances in + let delegate_to, bootstrap_delegations = + decons_of_opt bootstrap_delegations + in + let consensus_key, bootstrap_consensus_keys = + decons_of_opt bootstrap_consensus_keys + in + make_bootstrap_account + ?balance:(Option.map Tez.of_mutez_exn balance) + ~delegate_to + ~consensus_key + account + :: make_bootstrap_accounts + ~bootstrap_balances + ~bootstrap_delegations + ~bootstrap_consensus_keys + accounts + | [] -> [] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.mli new file mode 100644 index 000000000000..f97b60d4d883 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/account.mli @@ -0,0 +1,100 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type t = { + pkh : Tezos_crypto.Signature.Public_key_hash.t; + pk : Tezos_crypto.Signature.Public_key.t; + sk : Tezos_crypto.Signature.Secret_key.t; +} + +type account = t + +val known_accounts : t Tezos_crypto.Signature.Public_key_hash.Table.t + +val activator_account : account + +val dummy_account : account + +(** [new_account ?rng_state ?seed ?algo ()] creates a new account with curve + [algo] with the given [seed] (or [rng_state] to generate the seed) and add + it to the global account state. +*) +val new_account : + ?rng_state:Random.State.t -> + ?seed:Bytes.t -> + ?algo:Tezos_crypto.Signature.algo -> + unit -> + account + +val add_account : t -> unit + +val find : Tezos_crypto.Signature.Public_key_hash.t -> t tzresult Lwt.t + +val find_alternate : Tezos_crypto.Signature.Public_key_hash.t -> t + +(** 4.000.000.000 tez *) +val default_initial_balance : Tez.t + +(** [generate_accounts ?rng_state n] first frees the global account state then + generates [n] random accounts with [rng_state] to generate the seed and adds + them to the global account state. +*) +val generate_accounts : ?rng_state:Random.State.t -> int -> t list tzresult + +val commitment_secret : Blinded_public_key_hash.activation_code + +val new_commitment : + ?seed:Bytes.t -> unit -> (account * Commitment.t) tzresult Lwt.t + +(** Fails if the contract is not an implicit one *) +val pkh_of_contract_exn : Contract.t -> Tezos_crypto.Signature.Public_key_hash.t + +(** [make_bootstrap_account ~initial_balance ~delegate_to account] creates a + {!Parameters.bootstrap_account} from an account with the default or set + values. default [initial_balance] is [default_initial_balance], + [delegate_to] is [None] and [consensus_key] is [None]. +*) +val make_bootstrap_account : + ?balance:Tez.t -> + ?delegate_to:Tezos_crypto.Signature.public_key_hash option -> + ?consensus_key:Tezos_crypto.Signature.public_key option -> + t -> + Parameters.bootstrap_account + +(** [make_bootstrap_accounts ~bootstrap_balances ~bootstrap_delegations + ~bootstrap_consensus_keys accounts] combines the lists [accounts], + [bootstrap_balances], [bootstrap_delegations] and [bootstrap_consensus_keys] + to create a list of {!Parameters.bootstrap_account} using + [make_bootstrap_account]. +*) +val make_bootstrap_accounts : + ?bootstrap_balances:int64 list -> + ?bootstrap_delegations:Tezos_crypto.Signature.public_key_hash option list -> + ?bootstrap_consensus_keys:Tezos_crypto.Signature.public_key option list -> + t list -> + Parameters.bootstrap_account list diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/assert.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/assert.ml new file mode 100644 index 000000000000..24d1953a35e3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/assert.ml @@ -0,0 +1,300 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2021-2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +let error ~loc v f = + match v with + | Error err when List.exists f err -> return_unit + | Ok _ -> failwith "Unexpected successful result (%s)" loc + | Error err -> failwith "@[Unexpected error (%s): %a@]" loc pp_print_trace err + +let test_error_encodings e = + let module E = Environment.Error_monad in + ignore (E.pp Format.str_formatter e) ; + let e' = E.json_of_error e |> E.error_of_json in + assert (e = e') + +let proto_error ~loc v f = + error ~loc v (function + | Environment.Ecoproto_error err -> + test_error_encodings err ; + f err + | _ -> false) + +let proto_error_with_info ?(error_info_field = `Title) ~loc v + expected_error_info = + let info err = + let i = Error_monad.find_info_of_error (Environment.wrap_tzerror err) in + match error_info_field with + | `Title -> i.title + | `Id -> i.id + | `Description -> i.description + | `Message -> Format.asprintf "%a" Environment.Error_monad.pp err + in + proto_error ~loc v (function err -> + Format.printf + "@[<v 4>THE ERROR IS: %s@,EXPECTED: %s@]@." + (info err) + expected_error_info ; + let info = info err in + String.equal info expected_error_info) + +let equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b = + if not (cmp a b) then + failwith "@[@[[%s]@] - @[%s : %a is not equal to %a@]@]" loc msg pp a pp b + else return_unit + +let leq ~loc (cmp : 'a -> 'a -> int) msg pp a b = + if cmp a b > 0 then + failwith + "@[@[[%s]@] - @[%s : %a is not less or equal to %a@]@]" + loc + msg + pp + a + pp + b + else return_unit + +let lt ~loc (cmp : 'a -> 'a -> int) msg pp a b = + if cmp a b >= 0 then + failwith "@[@[[%s]@] - @[%s : %a is not less than %a@]@]" loc msg pp a pp b + else return_unit + +let not_equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b = + if cmp a b then + failwith "@[@[[%s]@] - @[%s : %a is equal to %a@]@]" loc msg pp a pp b + else return_unit + +module Int32 = struct + include Int32 + + let pp pp v = Format.pp_print_int pp (Int32.to_int v) +end + +module Int64 = struct + include Int64 + + let pp pp v = Format.pp_print_int pp (Int64.to_int v) +end + +(* char *) +let equal_char ~loc a b = + equal ~loc Char.equal "Characters aren't equal" Format.pp_print_char a b + +(* int *) +let equal_int ~loc (a : int) (b : int) = + equal ~loc Int.equal "Integers aren't equal" Format.pp_print_int a b + +let not_equal_int ~loc (a : int) (b : int) = + not_equal ~loc Int.equal "Integers are equal" Format.pp_print_int a b + +let leq_int ~loc (a : int) (b : int) = + leq ~loc Compare.Int.compare "Integer comparison" Format.pp_print_int a b + +(* int32 *) +let equal_int32 ~loc (a : int32) (b : int32) = + equal ~loc Int32.equal "Int32 aren't equal" Int32.pp a b + +let leq_int32 ~loc (a : int32) (b : int32) = + leq ~loc Compare.Int32.compare "Int32 comparison" Int32.pp a b + +let lt_int32 ~loc (a : int32) (b : int32) = + lt ~loc Compare.Int32.compare "Int32 comparison" Int32.pp a b + +(* int64 *) +let equal_int64 ~loc (a : int64) (b : int64) = + equal ~loc Compare.Int64.( = ) "Int64 aren't equal" Int64.pp a b + +let not_equal_int64 ~loc (a : int64) (b : int64) = + not_equal ~loc Int64.equal "Int64 are equal" Int64.pp a b + +let leq_int64 ~loc (a : int64) (b : int64) = + leq ~loc Compare.Int64.compare "Int64 comparison" Int64.pp a b + +let equal_z ~loc (a : Z.t) (b : Z.t) = + equal ~loc Compare.Z.( = ) "Z are not equal" Z.pp_print a b + +(* bool *) +let equal_bool ~loc (a : bool) (b : bool) = + equal ~loc Bool.equal "Booleans aren't equal" Format.pp_print_bool a b + +let not_equal_bool ~loc (a : bool) (b : bool) = + not_equal ~loc Bool.equal "Booleans are equal" Format.pp_print_bool a b + +(* string *) +let equal_string ~loc (a : string) (b : string) = + equal ~loc String.equal "Strings aren't equal" Format.pp_print_string a b + +let not_equal_string ~loc (a : string) (b : string) = + not_equal ~loc String.equal "Strings are equal" Format.pp_print_string a b + +(* tez *) +let equal_tez ~loc (a : Alpha_context.Tez.t) (b : Alpha_context.Tez.t) = + let open Alpha_context in + equal ~loc Tez.( = ) "Tez aren't equal" Tez.pp a b + +let not_equal_tez ~loc (a : Alpha_context.Tez.t) (b : Alpha_context.Tez.t) = + let open Alpha_context in + not_equal ~loc Tez.( = ) "Tez are equal" Tez.pp a b + +(* pkh *) +let equal_pkh ~loc (a : Tezos_crypto.Signature.Public_key_hash.t) + (b : Tezos_crypto.Signature.Public_key_hash.t) = + let module PKH = Tezos_crypto.Signature.Public_key_hash in + equal ~loc PKH.equal "Public key hashes aren't equal" PKH.pp a b + +let not_equal_pkh ~loc (a : Tezos_crypto.Signature.Public_key_hash.t) + (b : Tezos_crypto.Signature.Public_key_hash.t) = + let module PKH = Tezos_crypto.Signature.Public_key_hash in + not_equal ~loc PKH.equal "Public key hashes are equal" PKH.pp a b + +(* protocol hash *) +let equal_protocol_hash ~loc (a : Tezos_crypto.Protocol_hash.t) + (b : Tezos_crypto.Protocol_hash.t) = + equal + ~loc + Tezos_crypto.Protocol_hash.equal + "Protocol hashes aren't equal" + Tezos_crypto.Protocol_hash.pp + a + b + +let not_equal_protocol_hash ~loc (a : Tezos_crypto.Protocol_hash.t) + (b : Tezos_crypto.Protocol_hash.t) = + not_equal + ~loc + Tezos_crypto.Protocol_hash.equal + "Protocol hashes are equal" + Tezos_crypto.Protocol_hash.pp + a + b + +let get_some ~loc = function + | Some x -> return x + | None -> failwith "Unexpected None (%s)" loc + +let is_none ~loc ~pp = function + | Some x -> failwith "Unexpected (Some %a) (%s)" pp x loc + | None -> return_unit + +let equal_result ~loc ~pp_ok ~pp_error eq_ok eq_error a b = + equal + ~loc + (Result.equal ~ok:eq_ok ~error:eq_error) + "Results are not equal" + (Format.pp_print_result ~ok:pp_ok ~error:pp_error) + a + b + +let is_error ~loc ~pp = function + | Ok x -> failwith "Unexpected (Ok %a) (%s)" pp x loc + | Error _ -> return_unit + +let get_ok ~__LOC__ = function + | Ok r -> return r + | Error err -> + failwith "@[Unexpected error (%s): %a@]" __LOC__ pp_print_trace err + +open Context + +(* Some asserts for account operations *) + +let contract_property_is property ~loc b contract expected = + property b contract >>=? fun balance -> equal_tez ~loc balance expected + +(** [balance_is b c amount] checks that the current balance [b] of contract [c] + is [amount]. +*) +let balance_is = contract_property_is Contract.balance + +(** [frozen_bonds_is b c amount] checks that the current frozen bonds of + contract [c] is [amount]. +*) +let frozen_bonds_is = contract_property_is Contract.frozen_bonds + +let balance_or_frozen_bonds_was_operated ~is_balance ~operand ~loc b contract + old_balance amount = + operand old_balance amount |> Environment.wrap_tzresult >>?= fun expected -> + let f = if is_balance then balance_is else frozen_bonds_is in + f ~loc b contract expected + +(** [balance_was_credited ~loc ctxt contract old_balance amount] checks + that [contract]'s balance was credited [amount] tez in comparison to + [old_balance]. +*) +let balance_was_credited = + balance_or_frozen_bonds_was_operated + ~is_balance:true + ~operand:Alpha_context.Tez.( +? ) + +(** [balance_was_credited ~loc ctxt contract old_balance amount] checks + that [contract]'s balance was debited [amount] tez in comparison to + [old_balance]. +*) +let balance_was_debited = + balance_or_frozen_bonds_was_operated + ~is_balance:true + ~operand:Alpha_context.Tez.( -? ) + +(** [frozen_bonds_was_credited ~loc ctxt contract old_balance amount] checks + that [contract]'s frozen bonds was credited [amount] tez in comparison to + [old_balance]. +*) +let frozen_bonds_was_credited = + balance_or_frozen_bonds_was_operated + ~is_balance:false + ~operand:Alpha_context.Tez.( +? ) + +(** [frozen_bonds_was_credited ~loc ctxt contract old_balance amount] checks + that [contract]'s frozen bonds was credited [amount] tez in comparison to + [old_balance]. +*) +let frozen_bonds_was_debited = + balance_or_frozen_bonds_was_operated + ~is_balance:false + ~operand:Alpha_context.Tez.( -? ) + +let pp_print_list pp out xs = + let list_pp fmt = + Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@.") fmt + in + Format.fprintf out "[%a]" (list_pp pp) xs + +let assert_equal_list ~loc eq msg pp = + equal ~loc (List.equal eq) msg (pp_print_list pp) + +let to_json_string encoding x = + x + |> Data_encoding.Json.construct encoding + |> Format.asprintf "\n%a\n" Data_encoding.Json.pp + +let equal_with_encoding ~loc encoding a b = + equal_string ~loc (to_json_string encoding a) (to_json_string encoding b) + +let not_equal_with_encoding ~loc encoding a b = + not_equal_string ~loc (to_json_string encoding a) (to_json_string encoding b) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.ml new file mode 100644 index 000000000000..23a2b146034c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.ml @@ -0,0 +1,74 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let wrap m = m >|= Environment.wrap_tzresult + +let make_big_map block ~source ~key_type ~value_type key_values = + let open Lwt_result_syntax in + let key_type = Expr.from_string key_type in + let value_type = Expr.from_string value_type in + let* operation, originated = + Op.contract_origination_hash (B block) source ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + let* updates, ctxt = + List.fold_left_es + (fun (kvs, ctxt) (key, value) -> + let key_hash = + match + Data_encoding.Binary.to_bytes_opt Script_repr.expr_encoding key + with + | Some bytes -> Script_expr_hash.hash_bytes [bytes] + | None -> assert false + in + return ({Big_map.key; key_hash; value = Some value} :: kvs, ctxt)) + ([], ctxt) + key_values + in + let* ctxt = + wrap + (Contract.update_script_storage + ctxt + originated + key_type + (Some + [ + Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update + { + init = Lazy_storage.Alloc Big_map.{key_type; value_type}; + updates; + }); + ])) + in + return (big_map_id, ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.mli new file mode 100644 index 000000000000..eca8c1dbd083 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/big_map_helpers.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** [make_big_map block ~source ~key_type ~value_type key_values] constructs a + new big-map with the given key-type [key_type] and value type [value_type]. + + The big-map is owned by a new contract that is originated from [source], + with script {!Op.dummy_script}, and consists of a list of key-value pairs + according to the given [key_values] list of Micheline expressions. *) +val make_big_map : + Block.t -> + source:Alpha_context.Contract.t -> + key_type:string -> + value_type:string -> + (Script_repr.expr * Script_repr.expr) list -> + (Lazy_storage_kind.Big_map.Id.t * Alpha_context.context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.ml new file mode 100644 index 000000000000..fa298f7f1acd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.ml @@ -0,0 +1,1034 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Proto_Nonce = Nonce (* Renamed otherwise is masked by Alpha_context *) +open Alpha_context + +(* This type collects a block and the context that results from its application *) +type t = { + hash : Tezos_crypto.Block_hash.t; + header : Block_header.t; + operations : Operation.packed list; + context : Tezos_protocol_environment.Context.t; +} + +type block = t + +let rpc_context block = + { + Environment.Updater.block_hash = block.hash; + block_header = block.header.shell; + context = block.context; + } + +let rpc_ctxt = + new Environment.proto_rpc_context_of_directory + rpc_context + Plugin.RPC.rpc_services + +let to_alpha_ctxt b = + Alpha_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >|= Environment.wrap_tzresult + >>=? fun (ctxt, _balance_updates, _migration_results) -> return ctxt + +(******** Policies ***********) + +(* Policies are functions that take a block and return a tuple + [(account, level, timestamp)] for the [forge_header] function. *) + +(* This type is used only to provide a simpler interface to the exterior. *) +type baker_policy = + | By_round of int + | By_account of public_key_hash + | Excluding of public_key_hash list + +type baking_mode = Application | Baking + +let get_next_baker_by_round round block = + Plugin.RPC.Baking_rights.get rpc_ctxt ~all:true ~max_round:(round + 1) block + >|=? fun bakers -> + let {Plugin.RPC.Baking_rights.delegate = pkh; consensus_key; timestamp; _} = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.find + (fun {Plugin.RPC.Baking_rights.round = r; _} -> + Round.to_int32 r = Int32.of_int round) + bakers + in + ( pkh, + consensus_key, + round, + WithExceptions.Option.to_exn ~none:(Failure "") timestamp ) + +let get_next_baker_by_account pkh block = + Plugin.RPC.Baking_rights.get rpc_ctxt ~delegates:[pkh] block + >>=? fun bakers -> + (match List.hd bakers with + | Some b -> return b + | None -> + failwith + "No slots found for %a" + Tezos_crypto.Signature.Public_key_hash.pp + pkh) + >>=? fun { + Plugin.RPC.Baking_rights.delegate = pkh; + consensus_key; + timestamp; + round; + _; + } -> + Environment.wrap_tzresult (Round.to_int round) >>?= fun round -> + return + ( pkh, + consensus_key, + round, + WithExceptions.Option.to_exn ~none:(Failure __LOC__) timestamp ) + +let get_next_baker_excluding excludes block = + Plugin.RPC.Baking_rights.get rpc_ctxt block >>=? fun bakers -> + let { + Plugin.RPC.Baking_rights.delegate = pkh; + consensus_key; + timestamp; + round; + _; + } = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.find + (fun {Plugin.RPC.Baking_rights.consensus_key; _} -> + not + (List.mem + ~equal:Tezos_crypto.Signature.Public_key_hash.equal + consensus_key + excludes)) + bakers + in + Environment.wrap_tzresult (Round.to_int round) >>?= fun round -> + return + ( pkh, + consensus_key, + round, + WithExceptions.Option.to_exn ~none:(Failure "") timestamp ) + +let dispatch_policy = function + | By_round r -> get_next_baker_by_round r + | By_account a -> get_next_baker_by_account a + | Excluding al -> get_next_baker_excluding al + +let get_next_baker ?(policy = By_round 0) = dispatch_policy policy + +let get_round (b : t) = + let fitness = b.header.shell.fitness in + Fitness.(from_raw fitness >|? round) |> Environment.wrap_tzresult + +module Forge = struct + type header = { + baker : public_key_hash; + consensus_key : public_key_hash; + (* the signer of the block *) + shell : Block_header.shell_header; + contents : Block_header.contents; + } + + let default_proof_of_work_nonce = + Bytes.create Constants.proof_of_work_nonce_size + + let make_contents ?(proof_of_work_nonce = default_proof_of_work_nonce) + ~payload_hash ~payload_round + ?(liquidity_baking_toggle_vote = Liquidity_baking.LB_pass) + ~seed_nonce_hash () = + Block_header. + { + payload_hash; + payload_round; + proof_of_work_nonce; + seed_nonce_hash; + liquidity_baking_toggle_vote; + } + + let make_shell ~level ~predecessor ~timestamp ~fitness ~operations_hash = + Tezos_base.Block_header. + { + level; + predecessor; + timestamp; + fitness; + operations_hash; + (* We don't care of the following values, only the shell validates them. *) + proto_level = 0; + validation_passes = 0; + context = Tezos_crypto.Context_hash.zero; + } + + let set_seed_nonce_hash seed_nonce_hash + {baker; consensus_key; shell; contents} = + {baker; consensus_key; shell; contents = {contents with seed_nonce_hash}} + + let set_baker baker ?(consensus_key = baker) header = + {header with baker; consensus_key} + + let sign_header {consensus_key; shell; contents; _} = + Account.find consensus_key >|=? fun signer_account -> + let unsigned_bytes = + Data_encoding.Binary.to_bytes_exn + Block_header.unsigned_encoding + (shell, contents) + in + let signature = + Tezos_crypto.Signature.sign + ~watermark: + Block_header.(to_watermark (Block_header Tezos_crypto.Chain_id.zero)) + signer_account.sk + unsigned_bytes + in + Block_header.{shell; protocol_data = {contents; signature}} + + let classify_operations operations = + let validation_passes_len = List.length Main.validation_passes in + let t = Array.make validation_passes_len [] in + List.iter + (fun (op : packed_operation) -> + match Main.acceptable_pass op with + | None -> () + | Some pass -> t.(pass) <- op :: t.(pass)) + operations ; + let t = Array.map List.rev t in + Array.to_list t + + let forge_header ?(locked_round = None) ?(payload_round = None) + ?(policy = By_round 0) ?timestamp ?(operations = []) + ?liquidity_baking_toggle_vote pred = + let pred_fitness = + match Fitness.from_raw pred.header.shell.fitness with + | Ok pred_fitness -> pred_fitness + | _ -> assert false + in + let predecessor_round = Fitness.round pred_fitness in + dispatch_policy policy pred + >>=? fun (delegate, consensus_key, round, expected_timestamp) -> + let timestamp = Option.value ~default:expected_timestamp timestamp in + let level = Int32.succ pred.header.shell.level in + Raw_level.of_int32 level |> Environment.wrap_tzresult >>?= fun raw_level -> + Round.of_int round |> Environment.wrap_tzresult >>?= fun round -> + Fitness.create ~level:raw_level ~predecessor_round ~round ~locked_round + >|? Fitness.to_raw |> Environment.wrap_tzresult + >>?= fun fitness -> + (Plugin.RPC.current_level ~offset:1l rpc_ctxt pred >|=? function + | {expected_commitment = true; _} -> Some (fst (Proto_Nonce.generate ())) + | {expected_commitment = false; _} -> None) + >|=? fun seed_nonce_hash -> + let hashes = List.map Operation.hash_packed operations in + let operations_hash = + Tezos_crypto.Operation_list_list_hash.compute + [Tezos_crypto.Operation_list_hash.compute hashes] + in + let shell = + make_shell + ~level + ~predecessor:pred.hash + ~timestamp + ~fitness + ~operations_hash + in + let operations = classify_operations operations in + let non_consensus_operations = + List.concat (match List.tl operations with None -> [] | Some l -> l) + in + let hashes = List.map Operation.hash_packed non_consensus_operations in + let payload_round = + match payload_round with None -> round | Some r -> r + in + let payload_hash = + Block_payload.hash + ~predecessor_hash:shell.predecessor + ~payload_round + hashes + in + let contents = + make_contents + ~seed_nonce_hash + ?liquidity_baking_toggle_vote + ~payload_hash + ~payload_round + () + in + {baker = delegate; consensus_key; shell; contents} + + (* compatibility only, needed by incremental *) + let contents ?(proof_of_work_nonce = default_proof_of_work_nonce) + ?seed_nonce_hash + ?(liquidity_baking_toggle_vote = Liquidity_baking.LB_pass) ~payload_hash + ~payload_round () = + { + Block_header.proof_of_work_nonce; + seed_nonce_hash; + liquidity_baking_toggle_vote; + payload_hash; + payload_round; + } +end + +(********* Genesis creation *************) + +(* Hard-coded context key *) +let protocol_param_key = ["protocol_parameters"] + +let check_constants_consistency constants = + let open Constants.Parametric in + let { + blocks_per_cycle; + blocks_per_commitment; + nonce_revelation_threshold; + blocks_per_stake_snapshot; + _; + } = + constants + in + Error_monad.unless (blocks_per_commitment <= blocks_per_cycle) (fun () -> + failwith + "Inconsistent constants : blocks_per_commitment must be less than \ + blocks_per_cycle") + >>=? fun () -> + Error_monad.unless (nonce_revelation_threshold <= blocks_per_cycle) (fun () -> + failwith + "Inconsistent constants : nonce_revelation_threshold must be less than \ + blocks_per_cycle") + >>=? fun () -> + Error_monad.unless (blocks_per_cycle >= blocks_per_stake_snapshot) (fun () -> + failwith + "Inconsistent constants : blocks_per_cycle must be superior than \ + blocks_per_stake_snapshot") + +let prepare_main_init_params ?bootstrap_contracts commitments constants + bootstrap_accounts = + let open Tezos_protocol_016_PtMumbai_parameters in + let parameters = + Default_parameters.parameters_of_constants + ~bootstrap_accounts + ?bootstrap_contracts + ~commitments + constants + in + let json = Default_parameters.json_of_parameters parameters in + let proto_params = + Data_encoding.Binary.to_bytes_exn Data_encoding.json json + in + Tezos_protocol_environment.Context.( + let empty = Tezos_protocol_environment.Memory_context.empty in + add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> + add ctxt protocol_param_key proto_params) + +let initial_context ?(commitments = []) ?bootstrap_contracts chain_id constants + header bootstrap_accounts = + prepare_main_init_params + ?bootstrap_contracts + commitments + constants + bootstrap_accounts + >>= fun ctxt -> + Main.init chain_id ctxt header >|= Environment.wrap_tzresult + >|=? fun {context; _} -> context + +let initial_alpha_context ?(commitments = []) constants + (block_header : Block_header.shell_header) bootstrap_accounts = + prepare_main_init_params commitments constants bootstrap_accounts + >>= fun ctxt -> + let level = block_header.level in + let timestamp = block_header.timestamp in + let predecessor = block_header.predecessor in + let typecheck (ctxt : Alpha_context.context) (script : Alpha_context.Script.t) + = + let allow_forged_in_storage = + false + (* There should be no forged value in bootstrap contracts. *) + in + Script_ir_translator.parse_script + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage + script + >>=? fun (Ex_script (Script parsed_script), ctxt) -> + Script_ir_translator.extract_lazy_storage_diff + ctxt + Optimized + parsed_script.storage_type + parsed_script.storage + ~to_duplicate:Script_ir_translator.no_lazy_storage_id + ~to_update:Script_ir_translator.no_lazy_storage_id + ~temporary:false + >>=? fun (storage, lazy_storage_diff, ctxt) -> + Script_ir_translator.unparse_data + ctxt + Optimized + parsed_script.storage_type + storage + >|=? fun (storage, ctxt) -> + let storage = Alpha_context.Script.lazy_expr storage in + (({script with storage}, lazy_storage_diff), ctxt) + in + Alpha_context.prepare_first_block + ~typecheck + ~level + ~timestamp + ~predecessor + Tezos_crypto.Chain_id.zero + ctxt + >|= Environment.wrap_tzresult + +let genesis_with_parameters parameters = + let hash = + Tezos_crypto.Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU" + in + let fitness = + Fitness_repr.create_without_locked_round + ~level:(Protocol.Raw_level_repr.of_int32_exn 0l) + ~predecessor_round:Round_repr.zero + ~round:Round_repr.zero + |> Fitness_repr.to_raw + in + let shell = + Forge.make_shell + ~level:0l + ~predecessor:hash + ~timestamp:Time.Protocol.epoch + ~fitness + ~operations_hash:Tezos_crypto.Operation_list_list_hash.zero + in + let contents = + Forge.make_contents + ~payload_hash:Block_payload_hash.zero + ~payload_round:Round.zero + ~seed_nonce_hash:None + () + in + let open Tezos_protocol_016_PtMumbai_parameters in + let json = Default_parameters.json_of_parameters parameters in + let proto_params = + Data_encoding.Binary.to_bytes_exn Data_encoding.json json + in + Tezos_protocol_environment.Context.( + let empty = Tezos_protocol_environment.Memory_context.empty in + add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> + add ctxt protocol_param_key proto_params) + >>= fun ctxt -> + let chain_id = Tezos_crypto.Chain_id.of_block_hash hash in + Main.init chain_id ctxt shell >|= Environment.wrap_tzresult + >|=? fun {context; _} -> + { + hash; + header = + { + shell; + protocol_data = {contents; signature = Tezos_crypto.Signature.zero}; + }; + operations = []; + context; + } + +let validate_bootstrap_accounts + (bootstrap_accounts : Parameters.bootstrap_account list) minimal_stake = + if bootstrap_accounts = [] then + Stdlib.failwith "Must have one account with minimal_stake to bake" ; + (* Check there are at least minimal_stake tokens *) + Lwt.catch + (fun () -> + List.fold_left_es + (fun acc (Parameters.{amount; _} : Parameters.bootstrap_account) -> + Environment.wrap_tzresult @@ Tez.( +? ) acc amount >>?= fun acc -> + if acc >= minimal_stake then raise Exit else return acc) + Tez.zero + bootstrap_accounts + >>=? fun (_ : Tez.t) -> + failwith + "Insufficient tokens in initial accounts: the amount should be at \ + least minimal_stake") + (function Exit -> return_unit | exc -> raise exc) + +let prepare_initial_context_params ?consensus_threshold ?min_proposal_quorum + ?level ?cost_per_byte ?liquidity_baking_subsidy ?endorsing_reward_per_slot + ?baking_reward_bonus_per_slot ?baking_reward_fixed_portion ?origination_size + ?blocks_per_cycle ?cycles_per_voting_period ?tx_rollup_enable + ?tx_rollup_sunset_level ?tx_rollup_origination_size ?sc_rollup_enable + ?dal_enable ?zk_rollup_enable ?hard_gas_limit_per_block + ?nonce_revelation_threshold () = + let open Tezos_protocol_016_PtMumbai_parameters in + let constants = Default_parameters.constants_test in + let min_proposal_quorum = + Option.value ~default:constants.min_proposal_quorum min_proposal_quorum + in + let cost_per_byte = + Option.value ~default:constants.cost_per_byte cost_per_byte + in + let liquidity_baking_subsidy = + Option.value + ~default:constants.liquidity_baking_subsidy + liquidity_baking_subsidy + in + let endorsing_reward_per_slot = + Option.value + ~default:constants.endorsing_reward_per_slot + endorsing_reward_per_slot + in + let baking_reward_bonus_per_slot = + Option.value + ~default:constants.baking_reward_bonus_per_slot + baking_reward_bonus_per_slot + in + let baking_reward_fixed_portion = + Option.value + ~default:constants.baking_reward_fixed_portion + baking_reward_fixed_portion + in + let origination_size = + Option.value ~default:constants.origination_size origination_size + in + let blocks_per_cycle = + Option.value ~default:constants.blocks_per_cycle blocks_per_cycle + in + let cycles_per_voting_period = + Option.value + ~default:constants.cycles_per_voting_period + cycles_per_voting_period + in + let consensus_threshold = + Option.value ~default:constants.consensus_threshold consensus_threshold + in + let tx_rollup_enable = + Option.value ~default:constants.tx_rollup.enable tx_rollup_enable + in + let tx_rollup_sunset_level = + Option.value + ~default:constants.tx_rollup.sunset_level + tx_rollup_sunset_level + in + let tx_rollup_origination_size = + Option.value + ~default:constants.tx_rollup.origination_size + tx_rollup_origination_size + in + let sc_rollup_enable = + Option.value ~default:constants.sc_rollup.enable sc_rollup_enable + in + let dal_enable = + Option.value ~default:constants.dal.feature_enable dal_enable + in + let zk_rollup_enable = + Option.value ~default:constants.zk_rollup.enable zk_rollup_enable + in + let hard_gas_limit_per_block = + Option.value + ~default:constants.hard_gas_limit_per_block + hard_gas_limit_per_block + in + let nonce_revelation_threshold = + Option.value + ~default:constants.nonce_revelation_threshold + nonce_revelation_threshold + in + let constants = + { + constants with + endorsing_reward_per_slot; + baking_reward_bonus_per_slot; + baking_reward_fixed_portion; + origination_size; + blocks_per_cycle; + cycles_per_voting_period; + min_proposal_quorum; + cost_per_byte; + liquidity_baking_subsidy; + consensus_threshold; + tx_rollup = + { + constants.tx_rollup with + enable = tx_rollup_enable; + sunset_level = tx_rollup_sunset_level; + origination_size = tx_rollup_origination_size; + }; + sc_rollup = {constants.sc_rollup with enable = sc_rollup_enable}; + dal = {constants.dal with feature_enable = dal_enable}; + zk_rollup = {constants.zk_rollup with enable = zk_rollup_enable}; + hard_gas_limit_per_block; + nonce_revelation_threshold; + } + in + check_constants_consistency constants >>=? fun () -> + let hash = + Tezos_crypto.Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU" + in + let level = Option.value ~default:0l level in + let fitness = + Fitness_repr.create_without_locked_round + ~level:(Protocol.Raw_level_repr.of_int32_exn level) + ~predecessor_round:Round_repr.zero + ~round:Round_repr.zero + |> Fitness_repr.to_raw + in + let shell = + Forge.make_shell + ~level + ~predecessor:hash + ~timestamp:Time.Protocol.epoch + ~fitness + ~operations_hash:Tezos_crypto.Operation_list_list_hash.zero + in + return (constants, shell, hash) + +(* if no parameter file is passed we check in the current directory + where the test is run *) +let genesis ?commitments ?consensus_threshold ?min_proposal_quorum + ?bootstrap_contracts ?level ?cost_per_byte ?liquidity_baking_subsidy + ?endorsing_reward_per_slot ?baking_reward_bonus_per_slot + ?baking_reward_fixed_portion ?origination_size ?blocks_per_cycle + ?cycles_per_voting_period ?tx_rollup_enable ?tx_rollup_sunset_level + ?tx_rollup_origination_size ?sc_rollup_enable ?dal_enable ?zk_rollup_enable + ?hard_gas_limit_per_block ?nonce_revelation_threshold + (bootstrap_accounts : Parameters.bootstrap_account list) = + prepare_initial_context_params + ?consensus_threshold + ?min_proposal_quorum + ?level + ?cost_per_byte + ?liquidity_baking_subsidy + ?endorsing_reward_per_slot + ?baking_reward_bonus_per_slot + ?baking_reward_fixed_portion + ?origination_size + ?blocks_per_cycle + ?cycles_per_voting_period + ?tx_rollup_enable + ?tx_rollup_sunset_level + ?tx_rollup_origination_size + ?sc_rollup_enable + ?dal_enable + ?zk_rollup_enable + ?hard_gas_limit_per_block + ?nonce_revelation_threshold + () + >>=? fun (constants, shell, hash) -> + validate_bootstrap_accounts bootstrap_accounts constants.minimal_stake + >>=? fun () -> + initial_context + ?commitments + ?bootstrap_contracts + (Tezos_crypto.Chain_id.of_block_hash hash) + constants + shell + bootstrap_accounts + >|=? fun context -> + let contents = + Forge.make_contents + ~payload_hash:Block_payload_hash.zero + ~payload_round:Round.zero + ~seed_nonce_hash:None + () + in + { + hash; + header = + { + shell; + protocol_data = {contents; signature = Tezos_crypto.Signature.zero}; + }; + operations = []; + context; + } + +let alpha_context ?commitments ?min_proposal_quorum + (bootstrap_accounts : Parameters.bootstrap_account list) = + prepare_initial_context_params ?min_proposal_quorum () + >>=? fun (constants, shell, _hash) -> + validate_bootstrap_accounts bootstrap_accounts constants.minimal_stake + >>=? fun () -> + initial_alpha_context ?commitments constants shell bootstrap_accounts + +(********* Baking *************) + +let begin_validation_and_application ctxt chain_id mode ~predecessor = + let open Lwt_result_syntax in + let* validation_state = begin_validation ctxt chain_id mode ~predecessor in + let* application_state = begin_application ctxt chain_id mode ~predecessor in + return (validation_state, application_state) + +let get_application_vstate (pred : t) (operations : Protocol.operation trace) = + Forge.forge_header pred ~operations >>=? fun header -> + Forge.sign_header header >>=? fun header -> + let open Environment.Error_monad in + begin_validation_and_application + pred.context + Tezos_crypto.Chain_id.zero + (Application header) + ~predecessor:pred.header.shell + >|= Environment.wrap_tzresult + +(* Note that by calling this function without [protocol_data], we + force the mode to be partial construction. *) +let get_construction_vstate ?(policy = By_round 0) ?timestamp + ?(protocol_data = None) (pred : t) = + let open Protocol in + dispatch_policy policy pred + >>=? fun (_pkh, _ck, _round, expected_timestamp) -> + let timestamp = Option.value ~default:expected_timestamp timestamp in + let mode = + match protocol_data with + | None -> Partial_construction {predecessor_hash = pred.hash; timestamp} + | Some block_header_data -> + Construction + {predecessor_hash = pred.hash; timestamp; block_header_data} + in + begin_validation_and_application + pred.context + Tezos_crypto.Chain_id.zero + mode + ~predecessor:pred.header.shell + >|= Environment.wrap_tzresult + +let validate_and_apply_operation (validation_state, application_state) op = + let open Lwt_result_syntax in + let oph = Operation.hash_packed op in + let* validation_state = validate_operation validation_state oph op in + let* application_state, receipt = apply_operation application_state oph op in + return ((validation_state, application_state), receipt) + +let finalize_validation_and_application (validation_state, application_state) + shell_header = + let open Lwt_result_syntax in + let* () = finalize_validation validation_state in + finalize_application application_state shell_header + +let detect_manager_failure : + type kind. kind Apply_results.operation_metadata -> _ = + let rec detect_manager_failure : + type kind. kind Apply_results.contents_result_list -> _ = + let open Apply_results in + let open Apply_operation_result in + let open Apply_internal_results in + let detect_manager_failure_single (type kind) + (Manager_operation_result + {operation_result; internal_operation_results; _} : + kind Kind.manager Apply_results.contents_result) = + let detect_manager_failure (type kind) + (result : (kind, _, _) operation_result) = + match result with + | Applied _ -> Ok () + | Skipped _ -> assert false + | Backtracked (_, None) -> + (* there must be another error for this to happen *) + Ok () + | Backtracked (_, Some errs) -> Error errs + | Failed (_, errs) -> Error errs + in + detect_manager_failure operation_result >>? fun () -> + List.iter_e + (fun (Internal_operation_result (_, r)) -> detect_manager_failure r) + internal_operation_results + in + function + | Single_result (Manager_operation_result _ as res) -> + detect_manager_failure_single res + | Single_result _ -> Ok () + | Cons_result (res, rest) -> + detect_manager_failure_single res >>? fun () -> + detect_manager_failure rest + in + fun {contents} -> detect_manager_failure contents + +let apply_with_metadata ?(policy = By_round 0) ?(check_size = true) ~baking_mode + ~allow_manager_failures header ?(operations = []) pred = + let open Environment.Error_monad in + ( (match baking_mode with + | Application -> + begin_validation_and_application + pred.context + Tezos_crypto.Chain_id.zero + (Application header) + ~predecessor:pred.header.shell + >|= Environment.wrap_tzresult + | Baking -> + get_construction_vstate + ~policy + ~protocol_data:(Some header.protocol_data) + (pred : t)) + >>=? fun vstate -> + List.fold_left_es + (fun vstate op -> + (if check_size then + let operation_size = + Data_encoding.Binary.length Operation.encoding op + in + if operation_size > Constants_repr.max_operation_data_length then + raise + (invalid_arg + (Format.sprintf + "The operation size is %d, it exceeds the constant maximum \ + size %d" + operation_size + Constants_repr.max_operation_data_length))) ; + validate_and_apply_operation vstate op >>=? fun (state, result) -> + if allow_manager_failures then return state + else + match result with + | No_operation_metadata -> return state + | Operation_metadata metadata -> + detect_manager_failure metadata >>?= fun () -> return state) + vstate + operations + >|= Environment.wrap_tzresult + >>=? fun vstate -> + finalize_validation_and_application vstate (Some header.shell) + >|= Environment.wrap_tzresult + >|=? fun (validation, result) -> (validation.context, result) ) + >|=? fun (context, result) -> + let hash = Block_header.hash header in + ({hash; header; operations; context}, result) + +let apply header ?(operations = []) ?(allow_manager_failures = false) pred = + apply_with_metadata + header + ~operations + pred + ~baking_mode:Application + ~allow_manager_failures + >>=? fun (t, _metadata) -> return t + +let bake_with_metadata ?locked_round ?policy ?timestamp ?operation ?operations + ?payload_round ?check_size ~baking_mode ?(allow_manager_failures = false) + ?liquidity_baking_toggle_vote pred = + let operations = + match (operation, operations) with + | Some op, Some ops -> Some (op :: ops) + | Some op, None -> Some [op] + | None, Some ops -> Some ops + | None, None -> None + in + Forge.forge_header + ?payload_round + ?locked_round + ?timestamp + ?policy + ?operations + ?liquidity_baking_toggle_vote + pred + >>=? fun header -> + Forge.sign_header header >>=? fun header -> + apply_with_metadata + ?policy + ?check_size + ~baking_mode + ~allow_manager_failures + header + ?operations + pred + +let bake ?(baking_mode = Application) ?(allow_manager_failures = false) + ?payload_round ?locked_round ?policy ?timestamp ?operation ?operations + ?liquidity_baking_toggle_vote ?check_size pred = + bake_with_metadata + ?payload_round + ~baking_mode + ~allow_manager_failures + ?locked_round + ?policy + ?timestamp + ?operation + ?operations + ?liquidity_baking_toggle_vote + ?check_size + pred + >>=? fun (t, (_metadata : block_header_metadata)) -> return t + +(********** Cycles ****************) + +(* This function is duplicated from Context to avoid a cyclic dependency *) +let get_constants b = Alpha_services.Constants.all rpc_ctxt b + +let bake_n ?(baking_mode = Application) ?policy ?liquidity_baking_toggle_vote n + b = + List.fold_left_es + (fun b _ -> bake ~baking_mode ?policy ?liquidity_baking_toggle_vote b) + b + (1 -- n) + +let rec bake_while ?(baking_mode = Application) ?policy + ?liquidity_baking_toggle_vote predicate b = + let open Lwt_result_syntax in + let* new_block = bake ~baking_mode ?policy ?liquidity_baking_toggle_vote b in + if predicate new_block then + (bake_while [@ocaml.tailcall]) + ~baking_mode + ?policy + ?liquidity_baking_toggle_vote + predicate + new_block + else return b + +let bake_until_level ?(baking_mode = Application) ?policy + ?liquidity_baking_toggle_vote level b = + bake_while + ~baking_mode + ?policy + ?liquidity_baking_toggle_vote + (fun b -> b.header.shell.level <= Raw_level.to_int32 level) + b + +let bake_n_with_all_balance_updates ?(baking_mode = Application) ?policy + ?liquidity_baking_toggle_vote n b = + List.fold_left_es + (fun (b, balance_updates_rev) _ -> + bake_with_metadata ~baking_mode ?policy ?liquidity_baking_toggle_vote b + >>=? fun (b, metadata) -> + let balance_updates_rev = + List.rev_append metadata.balance_updates balance_updates_rev + in + let balance_updates_rev = + List.fold_left + (fun balance_updates_rev -> + let open Apply_results in + fun (Successful_manager_result r) -> + match r with + | Transaction_result (Transaction_to_sc_rollup_result _) + | Reveal_result _ | Delegation_result _ + | Update_consensus_key_result _ | Set_deposits_limit_result _ + | Tx_rollup_origination_result _ | Tx_rollup_submit_batch_result _ + | Tx_rollup_commit_result _ | Tx_rollup_return_bond_result _ + | Tx_rollup_finalize_commitment_result _ + | Tx_rollup_remove_commitment_result _ + | Tx_rollup_rejection_result _ | Transfer_ticket_result _ + | Tx_rollup_dispatch_tickets_result _ + | Dal_publish_slot_header_result _ | Sc_rollup_originate_result _ + | Sc_rollup_add_messages_result _ | Sc_rollup_cement_result _ + | Sc_rollup_publish_result _ | Sc_rollup_refute_result _ + | Sc_rollup_timeout_result _ + | Sc_rollup_execute_outbox_message_result _ + | Sc_rollup_recover_bond_result _ | Zk_rollup_origination_result _ + | Zk_rollup_publish_result _ | Zk_rollup_update_result _ -> + balance_updates_rev + | Transaction_result + ( Transaction_to_contract_result {balance_updates; _} + | Transaction_to_tx_rollup_result {balance_updates; _} + | Transaction_to_zk_rollup_result {balance_updates; _} ) + | Origination_result {balance_updates; _} + | Register_global_constant_result {balance_updates; _} + | Increase_paid_storage_result {balance_updates; _} -> + List.rev_append balance_updates balance_updates_rev) + balance_updates_rev + metadata.implicit_operations_results + in + return (b, balance_updates_rev)) + (b, []) + (1 -- n) + >|=? fun (b, balance_updates_rev) -> (b, List.rev balance_updates_rev) + +let bake_n_with_origination_results ?(baking_mode = Application) ?policy n b = + List.fold_left_es + (fun (b, origination_results_rev) _ -> + bake_with_metadata ~baking_mode ?policy b >>=? fun (b, metadata) -> + let origination_results_rev = + List.fold_left + (fun origination_results_rev -> + let open Apply_results in + function + | Successful_manager_result (Reveal_result _) + | Successful_manager_result (Delegation_result _) + | Successful_manager_result (Update_consensus_key_result _) + | Successful_manager_result (Transaction_result _) + | Successful_manager_result (Register_global_constant_result _) + | Successful_manager_result (Set_deposits_limit_result _) + | Successful_manager_result (Increase_paid_storage_result _) + | Successful_manager_result (Tx_rollup_origination_result _) + | Successful_manager_result (Tx_rollup_submit_batch_result _) + | Successful_manager_result (Tx_rollup_commit_result _) + | Successful_manager_result (Tx_rollup_return_bond_result _) + | Successful_manager_result (Tx_rollup_finalize_commitment_result _) + | Successful_manager_result (Tx_rollup_remove_commitment_result _) + | Successful_manager_result (Tx_rollup_rejection_result _) + | Successful_manager_result (Tx_rollup_dispatch_tickets_result _) + | Successful_manager_result (Transfer_ticket_result _) + | Successful_manager_result (Dal_publish_slot_header_result _) + | Successful_manager_result (Sc_rollup_originate_result _) + | Successful_manager_result (Sc_rollup_add_messages_result _) + | Successful_manager_result (Sc_rollup_cement_result _) + | Successful_manager_result (Sc_rollup_publish_result _) + | Successful_manager_result (Sc_rollup_refute_result _) + | Successful_manager_result (Sc_rollup_timeout_result _) + | Successful_manager_result + (Sc_rollup_execute_outbox_message_result _) + | Successful_manager_result (Sc_rollup_recover_bond_result _) + | Successful_manager_result (Zk_rollup_origination_result _) + | Successful_manager_result (Zk_rollup_publish_result _) + | Successful_manager_result (Zk_rollup_update_result _) -> + origination_results_rev + | Successful_manager_result (Origination_result x) -> + Origination_result x :: origination_results_rev) + origination_results_rev + metadata.implicit_operations_results + in + return (b, origination_results_rev)) + (b, []) + (1 -- n) + >|=? fun (b, origination_results_rev) -> (b, List.rev origination_results_rev) + +let bake_n_with_liquidity_baking_toggle_ema ?(baking_mode = Application) ?policy + ?liquidity_baking_toggle_vote n b = + let initial_ema = Liquidity_baking.Toggle_EMA.zero in + List.fold_left_es + (fun (b, _toggle_ema) _ -> + bake_with_metadata ~baking_mode ?policy ?liquidity_baking_toggle_vote b + >|=? fun (b, metadata) -> (b, metadata.liquidity_baking_toggle_ema)) + (b, initial_ema) + (1 -- n) + +let bake_until_cycle_end ?policy b = + get_constants b >>=? fun Constants.{parametric = {blocks_per_cycle; _}; _} -> + let current_level = b.header.shell.level in + let current_level = Int32.rem current_level blocks_per_cycle in + let delta = Int32.sub blocks_per_cycle current_level in + bake_n ?policy (Int32.to_int delta) b + +let bake_until_n_cycle_end ?policy n b = + List.fold_left_es (fun b _ -> bake_until_cycle_end ?policy b) b (1 -- n) + +let current_cycle b = + get_constants b >>=? fun Constants.{parametric = {blocks_per_cycle; _}; _} -> + let current_level = b.header.shell.level in + let current_cycle = Int32.div current_level blocks_per_cycle in + let current_cycle = Cycle.add Cycle.root (Int32.to_int current_cycle) in + return current_cycle + +let bake_until_cycle ?policy cycle (b : t) = + let rec loop (b : t) = + current_cycle b >>=? fun current_cycle -> + if Cycle.equal cycle current_cycle then return b + else bake_until_cycle_end ?policy b >>=? fun b -> loop b + in + loop b diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.mli new file mode 100644 index 000000000000..fd8560a3c776 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/block.mli @@ -0,0 +1,310 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type t = { + hash : Tezos_crypto.Block_hash.t; + header : Block_header.t; + operations : Operation.packed list; + context : Tezos_protocol_environment.Context.t; (** Resulting context *) +} + +type block = t + +val rpc_ctxt : t Environment.RPC_context.simple + +(** Build an alpha context using {!Alpha_context.prepare}. *) +val to_alpha_ctxt : t -> Alpha_context.t tzresult Lwt.t + +(** Policies to select the next baker: + - [By_round r] selects the baker at round [r] + - [By_account pkh] selects the first slot for baker [pkh] + - [Excluding pkhs] selects the first baker that doesn't belong to [pkhs] + + Note that bakers can have active consensus keys different from + their regular delegate keys. For the [By_account pkh] policy, [pkh] + refers to the baker's delegate key. However, for the [Excluding pkhs] + policy, [pkhs] refer to the baker's active consensus key. *) +type baker_policy = + | By_round of int + | By_account of public_key_hash + | Excluding of public_key_hash list + +(** + The default baking functions below is to use (blocks) [Application] mode. + Setting [baking_mode] allows to switch to [Full_construction] mode. +*) +type baking_mode = Application | Baking + +(** Returns (account, round, timestamp) of the next baker given + a policy, defaults to By_round 0. *) +val get_next_baker : + ?policy:baker_policy -> + t -> + (public_key_hash * public_key_hash * int * Time.Protocol.t) tzresult Lwt.t + +val get_round : block -> Round.t tzresult + +module Forge : sig + val contents : + ?proof_of_work_nonce:Bytes.t -> + ?seed_nonce_hash:Nonce_hash.t -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + payload_hash:Block_payload_hash.t -> + payload_round:Round.t -> + unit -> + Block_header.contents + + type header + + val classify_operations : packed_operation list -> packed_operation list list + + (** Forges a correct header following the policy. + The header can then be modified and applied with [apply]. *) + val forge_header : + ?locked_round:Alpha_context.Round.t option -> + ?payload_round:Round.t option -> + ?policy:baker_policy -> + ?timestamp:Timestamp.time -> + ?operations:Operation.packed list -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + t -> + header tzresult Lwt.t + + (** Sets uniquely seed_nonce_hash of a header *) + val set_seed_nonce_hash : Nonce_hash.t option -> header -> header + + (** Sets the baker that will sign the header to an arbitrary pkh *) + val set_baker : + public_key_hash -> + ?consensus_key:Tezos_crypto.Signature.public_key_hash -> + header -> + header + + (** Signs the header with the key of the baker configured in the header. + The header can no longer be modified, only applied. *) + val sign_header : header -> Block_header.block_header tzresult Lwt.t +end + +val check_constants_consistency : Constants.Parametric.t -> unit tzresult Lwt.t + +(** [genesis <opts> accounts] : generates an initial block with the + given constants [<opts>] and initializes [accounts] with their + associated amounts. +*) +val genesis : + ?commitments:Commitment.t list -> + ?consensus_threshold:int -> + ?min_proposal_quorum:int32 -> + ?bootstrap_contracts:Parameters.bootstrap_contract list -> + ?level:int32 -> + ?cost_per_byte:Tez.t -> + ?liquidity_baking_subsidy:Tez.t -> + ?endorsing_reward_per_slot:Tez.t -> + ?baking_reward_bonus_per_slot:Tez.t -> + ?baking_reward_fixed_portion:Tez.t -> + ?origination_size:int -> + ?blocks_per_cycle:int32 -> + ?cycles_per_voting_period:int32 -> + ?tx_rollup_enable:bool -> + ?tx_rollup_sunset_level:int32 -> + ?tx_rollup_origination_size:int -> + ?sc_rollup_enable:bool -> + ?dal_enable:bool -> + ?zk_rollup_enable:bool -> + ?hard_gas_limit_per_block:Gas.Arith.integral -> + ?nonce_revelation_threshold:int32 -> + Parameters.bootstrap_account list -> + block tzresult Lwt.t + +val genesis_with_parameters : Parameters.t -> block tzresult Lwt.t + +(** [alpha_context <opts> accounts] : instantiates an alpha_context with the + given constants [<opts>] and initializes [accounts] with their + associated amounts. +*) +val alpha_context : + ?commitments:Commitment.t list -> + ?min_proposal_quorum:int32 -> + Parameters.bootstrap_account list -> + Alpha_context.t tzresult Lwt.t + +(** + [get_application_vstate pred operations] constructs a protocol validation + environment for operations in application mode on top of the given block + with the given operations. It's a shortcut for [begin_application] +*) +val get_application_vstate : + t -> + Protocol.operation list -> + (validation_state * application_state) tzresult Lwt.t + +(** + [get_construction_vstate ?policy ?timestamp ?protocol_data pred] + constructs a protocol validation environment for operations in + construction mode on top of the given block. The mode is + full(baking)/partial(mempool) if [protocol_data] given/absent. It's a + shortcut for [begin_construction] + *) +val get_construction_vstate : + ?policy:baker_policy -> + ?timestamp:Timestamp.time -> + ?protocol_data:block_header_data option -> + block -> + (validation_state * application_state) tzresult Lwt.t + +(** applies a signed header and its operations to a block and + obtains a new block *) +val apply : + Block_header.block_header -> + ?operations:Operation.packed list -> + ?allow_manager_failures:bool -> + t -> + t tzresult Lwt.t + +(** [bake b] returns a block [b'] which has as predecessor block [b]. + Optional parameter [policy] allows to pick the next baker in + several ways. If [check_size] is [true] (the default case), then + the function checks that the operations passed as arguments satisfy + the size limit of Tezos operations, as defined in the protocol. + This function bundles together [forge_header], [sign_header] and + [apply]. These functions should be used instead of bake to craft + unusual blocks for testing together with setters for properties of + the headers. Setting [allow_manager_failures] (default=false), + allows baking blocks with manager operation(s) that are valid but + that could fail during their application. If this is not set, the + block is correctly baked but the operations' application will fail + silently. For examples see seed.ml or double_baking.ml +*) +val bake : + ?baking_mode:baking_mode -> + ?allow_manager_failures:bool -> + ?payload_round:Round.t option -> + ?locked_round:Alpha_context.Round.t option -> + ?policy:baker_policy -> + ?timestamp:Timestamp.time -> + ?operation:Operation.packed -> + ?operations:Operation.packed list -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + ?check_size:bool -> + t -> + t tzresult Lwt.t + +(** Bakes [n] blocks. *) +val bake_n : + ?baking_mode:baking_mode -> + ?policy:baker_policy -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + int -> + t -> + block tzresult Lwt.t + +(** Bakes until the given level is reached. *) +val bake_until_level : + ?baking_mode:baking_mode -> + ?policy:baker_policy -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + Raw_level.t -> + t -> + block tzresult Lwt.t + +(** Version of bake_n that returns a list of all balance updates included + in the metadata of baked blocks. **) +val bake_n_with_all_balance_updates : + ?baking_mode:baking_mode -> + ?policy:baker_policy -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + int -> + t -> + (block * Alpha_context.Receipt.balance_updates) tzresult Lwt.t + +(** Version of bake_n that returns a list of all origination results + in the metadata of baked blocks. **) +val bake_n_with_origination_results : + ?baking_mode:baking_mode -> + ?policy:baker_policy -> + int -> + t -> + (block + * Alpha_context.Kind.origination + Apply_results.successful_manager_operation_result + list) + tzresult + Lwt.t + +(** Version of bake_n that returns the liquidity baking toggle EMA after [n] blocks. **) +val bake_n_with_liquidity_baking_toggle_ema : + ?baking_mode:baking_mode -> + ?policy:baker_policy -> + ?liquidity_baking_toggle_vote:Liquidity_baking.liquidity_baking_toggle_vote -> + int -> + t -> + (block * Alpha_context.Liquidity_baking.Toggle_EMA.t) tzresult Lwt.t + +val current_cycle : t -> Cycle.t tzresult Lwt.t + +(** Given a block [b] at level [l] bakes enough blocks to complete a cycle, + that is [blocks_per_cycle - (l % blocks_per_cycle)]. *) +val bake_until_cycle_end : ?policy:baker_policy -> t -> t tzresult Lwt.t + +(** Bakes enough blocks to end [n] cycles. *) +val bake_until_n_cycle_end : + ?policy:baker_policy -> int -> t -> t tzresult Lwt.t + +(** Bakes enough blocks to reach the cycle. *) +val bake_until_cycle : ?policy:baker_policy -> Cycle.t -> t -> t tzresult Lwt.t + +(** Common util function to create parameters for [initial_context] function *) +val prepare_initial_context_params : + ?consensus_threshold:int -> + ?min_proposal_quorum:int32 -> + ?level:int32 -> + ?cost_per_byte:Tez.t -> + ?liquidity_baking_subsidy:Tez.t -> + ?endorsing_reward_per_slot:Tez.t -> + ?baking_reward_bonus_per_slot:Tez.t -> + ?baking_reward_fixed_portion:Tez.t -> + ?origination_size:int -> + ?blocks_per_cycle:int32 -> + ?cycles_per_voting_period:int32 -> + ?tx_rollup_enable:bool -> + ?tx_rollup_sunset_level:int32 -> + ?tx_rollup_origination_size:int -> + ?sc_rollup_enable:bool -> + ?dal_enable:bool -> + ?zk_rollup_enable:bool -> + ?hard_gas_limit_per_block:Gas.Arith.integral -> + ?nonce_revelation_threshold:int32 -> + unit -> + ( Constants.Parametric.t + * Block_header.shell_header + * Tezos_crypto.Block_hash.t, + tztrace ) + result + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/consensus_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/consensus_helpers.ml new file mode 100644 index 000000000000..3db4a7d1ab13 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/consensus_helpers.ml @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let test_consensus_operation ?construction_mode ?level ?block_payload_hash ?slot + ?round ~endorsed_block ~error ~is_preendorsement ~loc () = + (if is_preendorsement then + Op.preendorsement ?block_payload_hash ?level ?slot ?round endorsed_block + else Op.endorsement ?block_payload_hash ?level ?slot ?round endorsed_block) + >>=? fun operation -> + let assert_error res = Assert.proto_error ~loc res error in + match construction_mode with + | None -> + (* meaning Application mode *) + Block.bake ~operation endorsed_block >>= assert_error + | Some (pred, protocol_data) -> + (* meaning partial construction or full construction mode, depending on + [protocol_data] *) + Block.get_construction_vstate ~protocol_data pred + >>=? fun (validation_state, _application_state) -> + let oph = Operation.hash_packed operation in + validate_operation validation_state oph operation + >|= Environment.wrap_tzresult >>= assert_error + +let delegate_of_first_slot b = + let module V = Plugin.RPC.Validators in + Context.get_endorsers b >|=? function + | {V.consensus_key; slots = s :: _; _} :: _ -> (consensus_key, s) + | _ -> assert false + +let delegate_of_slot ?(different_slot = false) slot b = + let module V = Plugin.RPC.Validators in + Context.get_endorsers b >|=? fun endorsers -> + List.find_map + (function + | {V.consensus_key; slots = s :: _; _} + when if different_slot then not (Slot.equal s slot) + else Slot.equal s slot -> + Some consensus_key + | _ -> None) + endorsers + |> function + | None -> assert false + | Some d -> d + +let test_consensus_op_for_next ~genesis ~kind ~next = + let dorsement ~endorsed_block ~delegate = + match kind with + | `Preendorsement -> Op.preendorsement ~delegate endorsed_block + | `Endorsement -> Op.endorsement ~delegate endorsed_block + in + Block.bake genesis >>=? fun b1 -> + (match next with + | `Level -> Block.bake b1 + | `Round -> Block.bake ~policy:(By_round 1) genesis) + >>=? fun b2 -> + Incremental.begin_construction ~mempool_mode:true b1 >>=? fun inc -> + delegate_of_first_slot (B b1) >>=? fun (delegate, slot) -> + dorsement ~endorsed_block:b1 ~delegate >>=? fun operation -> + Incremental.add_operation inc operation >>=? fun inc -> + delegate_of_slot ~different_slot:true slot (B b2) >>=? fun delegate -> + dorsement ~endorsed_block:b2 ~delegate >>=? fun operation -> + Incremental.add_operation inc operation >>= fun res -> + let error_title = + match next with + | `Level -> "Consensus operation for future level" + | `Round -> "Consensus operation for future round" + in + Assert.proto_error_with_info ~loc:__LOC__ res error_title diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml new file mode 100644 index 000000000000..e263b66df612 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml @@ -0,0 +1,603 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type t = B of Block.t | I of Incremental.t + +let branch = function B b -> b.hash | I i -> (Incremental.predecessor i).hash + +let pred_branch = function + | B b -> b.header.shell.predecessor + | I i -> (Incremental.predecessor i).hash + +let level = function B b -> b.header.shell.level | I i -> Incremental.level i + +let get_level ctxt = + level ctxt |> Raw_level.of_int32 |> Environment.wrap_tzresult + +let to_alpha_ctxt = function + | B b -> Block.to_alpha_ctxt b + | I i -> return (Incremental.alpha_ctxt i) + +let rpc_ctxt = + object + method call_proto_service0 + : 'm 'q 'i 'o. + ( ([< Tezos_rpc.Service.meth] as 'm), + Environment.RPC_context.t, + Environment.RPC_context.t, + 'q, + 'i, + 'o ) + Tezos_rpc.Service.t -> + t -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + fun s pr q i -> + match pr with + | B b -> Block.rpc_ctxt#call_proto_service0 s b q i + | I b -> Incremental.rpc_ctxt#call_proto_service0 s b q i + + method call_proto_service1 + : 'm 'a 'q 'i 'o. + ( ([< Tezos_rpc.Service.meth] as 'm), + Environment.RPC_context.t, + Environment.RPC_context.t * 'a, + 'q, + 'i, + 'o ) + Tezos_rpc.Service.t -> + t -> + 'a -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + fun s pr a q i -> + match pr with + | B bl -> Block.rpc_ctxt#call_proto_service1 s bl a q i + | I bl -> Incremental.rpc_ctxt#call_proto_service1 s bl a q i + + method call_proto_service2 + : 'm 'a 'b 'q 'i 'o. + ( ([< Tezos_rpc.Service.meth] as 'm), + Environment.RPC_context.t, + (Environment.RPC_context.t * 'a) * 'b, + 'q, + 'i, + 'o ) + Tezos_rpc.Service.t -> + t -> + 'a -> + 'b -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + fun s pr a b q i -> + match pr with + | B bl -> Block.rpc_ctxt#call_proto_service2 s bl a b q i + | I bl -> Incremental.rpc_ctxt#call_proto_service2 s bl a b q i + + method call_proto_service3 + : 'm 'a 'b 'c 'q 'i 'o. + ( ([< Tezos_rpc.Service.meth] as 'm), + Environment.RPC_context.t, + ((Environment.RPC_context.t * 'a) * 'b) * 'c, + 'q, + 'i, + 'o ) + Tezos_rpc.Service.t -> + t -> + 'a -> + 'b -> + 'c -> + 'q -> + 'i -> + 'o tzresult Lwt.t = + fun s pr a b c q i -> + match pr with + | B bl -> Block.rpc_ctxt#call_proto_service3 s bl a b c q i + | I bl -> Incremental.rpc_ctxt#call_proto_service3 s bl a b c q i + end + +let get_endorsers ctxt = Plugin.RPC.Validators.get rpc_ctxt ctxt + +let get_first_different_endorsers ctxt = + get_endorsers ctxt >|=? function x :: y :: _ -> (x, y) | _ -> assert false + +let get_endorser ctxt = + get_endorsers ctxt >|=? fun endorsers -> + let endorser = WithExceptions.Option.get ~loc:__LOC__ @@ List.hd endorsers in + (endorser.consensus_key, endorser.slots) + +let get_endorser_slot ctxt pkh = + get_endorsers ctxt >|=? fun endorsers -> + List.find_map + (function + | {Plugin.RPC.Validators.consensus_key; slots; _} -> + if Tezos_crypto.Signature.Public_key_hash.(consensus_key = pkh) then + Some slots + else None) + endorsers + +let get_endorser_n ctxt n = + Plugin.RPC.Validators.get rpc_ctxt ctxt >|=? fun endorsers -> + let endorser = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth endorsers n + in + (endorser.consensus_key, endorser.slots) + +let get_endorsing_power_for_delegate ctxt ?levels pkh = + Plugin.RPC.Validators.get rpc_ctxt ?levels ctxt >>=? fun endorsers -> + let rec find_slots_for_delegate = function + | [] -> return 0 + | {Plugin.RPC.Validators.delegate; slots; _} :: t -> + if Tezos_crypto.Signature.Public_key_hash.equal delegate pkh then + return (List.length slots) + else find_slots_for_delegate t + in + find_slots_for_delegate endorsers + +let get_voting_power = Delegate_services.voting_power rpc_ctxt + +let get_total_voting_power = Alpha_services.Voting.total_voting_power rpc_ctxt + +let get_bakers ?filter ?cycle ctxt = + Plugin.RPC.Baking_rights.get rpc_ctxt ?cycle ctxt >|=? fun bakers -> + (match filter with None -> bakers | Some f -> List.filter f bakers) + |> List.map (fun p -> p.Plugin.RPC.Baking_rights.delegate) + +let get_baker ctxt ~round = + get_bakers ~filter:(fun x -> x.round = round) ctxt >>=? fun bakers -> + (* there is only one baker for a given round *) + match bakers with [baker] -> return baker | _ -> assert false + +let get_first_different_baker baker bakers = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.find + (fun baker' -> + Tezos_crypto.Signature.Public_key_hash.( <> ) baker baker') + bakers + +let get_first_different_bakers ctxt = + get_bakers ctxt >|=? function + | [] -> assert false + | baker_1 :: other_bakers -> + (baker_1, get_first_different_baker baker_1 other_bakers) + +let get_seed_nonce_hash ctxt = + let header = + match ctxt with B {header; _} -> header | I i -> Incremental.header i + in + match header.protocol_data.contents.seed_nonce_hash with + | None -> failwith "No committed nonce" + | Some hash -> return hash + +let get_seed ctxt = Alpha_services.Seed.get rpc_ctxt ctxt + +let get_seed_computation ctxt = + Alpha_services.Seed_computation.get rpc_ctxt ctxt + +let get_constants ctxt = Alpha_services.Constants.all rpc_ctxt ctxt + +let default_test_constants = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_test + +let get_baking_reward_fixed_portion ctxt = + get_constants ctxt + >>=? fun {Constants.parametric = {baking_reward_fixed_portion; _}; _} -> + return baking_reward_fixed_portion + +let get_bonus_reward ctxt ~endorsing_power = + get_constants ctxt + >>=? fun { + Constants.parametric = + {baking_reward_bonus_per_slot; consensus_threshold; _}; + _; + } -> + let multiplier = max 0 (endorsing_power - consensus_threshold) in + return Test_tez.(baking_reward_bonus_per_slot *! Int64.of_int multiplier) + +let get_endorsing_reward ctxt ~expected_endorsing_power = + get_constants ctxt + >>=? fun {Constants.parametric = {endorsing_reward_per_slot; _}; _} -> + Lwt.return + (Environment.wrap_tzresult + Tez.(endorsing_reward_per_slot *? Int64.of_int expected_endorsing_power)) + +let get_liquidity_baking_subsidy ctxt = + get_constants ctxt + >>=? fun {Constants.parametric = {liquidity_baking_subsidy; _}; _} -> + return liquidity_baking_subsidy + +let get_liquidity_baking_cpmm_address ctxt = + Alpha_services.Liquidity_baking.get_cpmm_address rpc_ctxt ctxt + +(* Voting *) + +module Vote = struct + let get_ballots ctxt = Alpha_services.Voting.ballots rpc_ctxt ctxt + + let get_ballot_list ctxt = Alpha_services.Voting.ballot_list rpc_ctxt ctxt + + let get_current_period ctxt = + Alpha_services.Voting.current_period rpc_ctxt ctxt + + let get_current_quorum ctxt = + Alpha_services.Voting.current_quorum rpc_ctxt ctxt + + let get_listings ctxt = Alpha_services.Voting.listings rpc_ctxt ctxt + + let get_proposals ctxt = Alpha_services.Voting.proposals rpc_ctxt ctxt + + let get_current_proposal ctxt = + Alpha_services.Voting.current_proposal rpc_ctxt ctxt + + let get_protocol (b : Block.t) = + Tezos_protocol_environment.Context.get_protocol b.context + + let get_participation_ema (b : Block.t) = + Environment.Context.find b.context ["votes"; "participation_ema"] + >|= function + | None -> assert false + | Some bytes -> ok (TzEndian.get_int32 bytes 0) + + let set_participation_ema (b : Block.t) ema = + let bytes = Bytes.make 4 '\000' in + TzEndian.set_int32 bytes 0 ema ; + Environment.Context.add b.context ["votes"; "participation_ema"] bytes + >|= fun context -> {b with context} + + type delegate_info = Alpha_context.Vote.delegate_info = { + voting_power : Int64.t option; + current_ballot : Alpha_context.Vote.ballot option; + current_proposals : Tezos_crypto.Protocol_hash.t list; + remaining_proposals : int; + } + + let get_delegate_proposal_count ctxt pkh = + to_alpha_ctxt ctxt >>=? fun alpha_ctxt -> + Vote.get_delegate_proposal_count alpha_ctxt pkh + >|= Environment.wrap_tzresult +end + +module Contract = struct + let pp = Alpha_context.Contract.pp + + let equal a b = Alpha_context.Contract.compare a b = 0 + + let pkh = function + | Contract.Implicit p -> p + | Originated _ -> Stdlib.failwith "pkh: only for implicit contracts" + + let balance ctxt contract = + Alpha_services.Contract.balance rpc_ctxt ctxt contract + + let frozen_bonds ctxt contract = + Alpha_services.Contract.frozen_bonds rpc_ctxt ctxt contract + + let balance_and_frozen_bonds ctxt contract = + Alpha_services.Contract.balance_and_frozen_bonds rpc_ctxt ctxt contract + + let counter ctxt (contract : Contract.t) = + match contract with + | Originated _ -> invalid_arg "Helpers.Context.counter" + | Implicit mgr -> Alpha_services.Contract.counter rpc_ctxt ctxt mgr + + let manager _ (contract : Contract.t) = + match contract with + | Originated _ -> invalid_arg "Helpers.Context.manager" + | Implicit pkh -> Account.find pkh + + let is_manager_key_revealed ctxt (contract : Contract.t) = + match contract with + | Originated _ -> invalid_arg "Helpers.Context.is_manager_key_revealed" + | Implicit mgr -> + Alpha_services.Contract.manager_key rpc_ctxt ctxt mgr >|=? fun res -> + res <> None + + let delegate ctxt contract = + Alpha_services.Contract.delegate rpc_ctxt ctxt contract + + let delegate_opt ctxt contract = + Alpha_services.Contract.delegate_opt rpc_ctxt ctxt contract + + let storage ctxt contract = + Alpha_services.Contract.storage rpc_ctxt ctxt contract + + let script ctxt contract = + Alpha_services.Contract.script rpc_ctxt ctxt contract + >>=? fun {code; storage = _} -> + match Data_encoding.force_decode code with + | Some v -> return v + | None -> invalid_arg "Cannot force lazy script" + + let script_hash ctxt contract = + script ctxt contract >>=? fun script -> + let bytes = Data_encoding.Binary.to_bytes_exn Script.expr_encoding script in + return @@ Script_expr_hash.hash_bytes [bytes] +end + +module Delegate = struct + type info = Delegate_services.info = { + full_balance : Tez.t; + current_frozen_deposits : Tez.t; + frozen_deposits : Tez.t; + staking_balance : Tez.t; + frozen_deposits_limit : Tez.t option; + delegated_contracts : Alpha_context.Contract.t list; + delegated_balance : Tez.t; + deactivated : bool; + grace_period : Cycle.t; + voting_info : Alpha_context.Vote.delegate_info; + active_consensus_key : Tezos_crypto.Signature.Public_key_hash.t; + pending_consensus_keys : + (Cycle.t * Tezos_crypto.Signature.Public_key_hash.t) list; + } + + let info ctxt pkh = Delegate_services.info rpc_ctxt ctxt pkh + + let full_balance ctxt pkh = Delegate_services.full_balance rpc_ctxt ctxt pkh + + let current_frozen_deposits ctxt pkh = + Delegate_services.current_frozen_deposits rpc_ctxt ctxt pkh + + let initial_frozen_deposits ctxt pkh = + Delegate_services.frozen_deposits rpc_ctxt ctxt pkh + + let staking_balance ctxt pkh = + Delegate_services.staking_balance rpc_ctxt ctxt pkh + + let frozen_deposits_limit ctxt pkh = + Delegate_services.frozen_deposits_limit rpc_ctxt ctxt pkh + + let deactivated ctxt pkh = Delegate_services.deactivated rpc_ctxt ctxt pkh + + let voting_info ctxt d = Alpha_services.Delegate.voting_info rpc_ctxt ctxt d + + let consensus_key ctxt pkh = Delegate_services.consensus_key rpc_ctxt ctxt pkh + + let participation ctxt pkh = Delegate_services.participation rpc_ctxt ctxt pkh +end + +module Tx_rollup = struct + let state ctxt tx_rollup = Tx_rollup_services.state rpc_ctxt ctxt tx_rollup + + let inbox ctxt tx_rollup = Tx_rollup_services.inbox rpc_ctxt ctxt tx_rollup + + let commitment ctxt tx_rollup = + Tx_rollup_services.commitment rpc_ctxt ctxt tx_rollup +end + +module Sc_rollup = struct + let inbox ctxt = + Environment.RPC_context.make_call0 + Plugin.RPC.Sc_rollup.S.inbox + rpc_ctxt + ctxt + () + () + + let commitment ctxt sc_rollup hash = + Environment.RPC_context.make_call2 + Plugin.RPC.Sc_rollup.S.commitment + rpc_ctxt + ctxt + sc_rollup + hash + () + () + + let genesis_info ctxt sc_rollup = + Environment.RPC_context.make_call1 + Plugin.RPC.Sc_rollup.S.genesis_info + rpc_ctxt + ctxt + sc_rollup + () + () + + let timeout ctxt sc_rollup stakers = + Environment.RPC_context.make_call1 + Plugin.RPC.Sc_rollup.S.timeout + rpc_ctxt + ctxt + sc_rollup + stakers + () + + let ongoing_games_for_staker ctxt sc_rollup staker = + Environment.RPC_context.make_call1 + Plugin.RPC.Sc_rollup.S.ongoing_refutation_games + rpc_ctxt + ctxt + sc_rollup + staker + () +end + +type (_, _) tup = + | T1 : ('a, 'a) tup + | T2 : ('a, 'a * 'a) tup + | T3 : ('a, 'a * 'a * 'a) tup + | TList : int -> ('a, 'a list) tup + +let tup_hd : type a r. (a, r) tup -> r -> a = + fun tup elts -> + match (tup, elts) with + | T1, v -> v + | T2, (v, _) -> v + | T3, (v, _, _) -> v + | TList _, v :: _ -> v + | TList _, [] -> assert false + +let tup_n : type a r. (a, r) tup -> int = function + | T1 -> 1 + | T2 -> 2 + | T3 -> 3 + | TList n -> n + +let tup_get : type a r. (a, r) tup -> a list -> r = + fun tup list -> + match (tup, list) with + | T1, [v] -> v + | T2, [v1; v2] -> (v1, v2) + | T3, [v1; v2; v3] -> (v1, v2, v3) + | TList _, l -> l + | _ -> assert false + +let init_gen tup ?rng_state ?commitments ?bootstrap_balances + ?bootstrap_delegations ?bootstrap_consensus_keys ?consensus_threshold + ?min_proposal_quorum ?bootstrap_contracts ?level ?cost_per_byte + ?liquidity_baking_subsidy ?endorsing_reward_per_slot + ?baking_reward_bonus_per_slot ?baking_reward_fixed_portion ?origination_size + ?blocks_per_cycle ?cycles_per_voting_period ?tx_rollup_enable + ?tx_rollup_sunset_level ?tx_rollup_origination_size ?sc_rollup_enable + ?dal_enable ?zk_rollup_enable ?hard_gas_limit_per_block + ?nonce_revelation_threshold () = + let n = tup_n tup in + Account.generate_accounts ?rng_state n >>?= fun accounts -> + let contracts = + List.map (fun a -> Alpha_context.Contract.Implicit Account.(a.pkh)) accounts + in + let bootstrap_accounts = + Account.make_bootstrap_accounts + ?bootstrap_balances + ?bootstrap_delegations + ?bootstrap_consensus_keys + accounts + in + Block.genesis + ?commitments + ?consensus_threshold + ?min_proposal_quorum + ?bootstrap_contracts + ?level + ?cost_per_byte + ?liquidity_baking_subsidy + ?endorsing_reward_per_slot + ?baking_reward_bonus_per_slot + ?baking_reward_fixed_portion + ?origination_size + ?blocks_per_cycle + ?cycles_per_voting_period + ?tx_rollup_enable + ?tx_rollup_sunset_level + ?tx_rollup_origination_size + ?sc_rollup_enable + ?dal_enable + ?zk_rollup_enable + ?hard_gas_limit_per_block + ?nonce_revelation_threshold + bootstrap_accounts + >|=? fun blk -> (blk, tup_get tup contracts) + +let init_n n = init_gen (TList n) + +let init1 = init_gen T1 + +let init2 = init_gen T2 + +let init3 = init_gen T3 + +let create_bootstrap_accounts n = + let open Result_syntax in + let* accounts = Account.generate_accounts n in + let contracts = + List.map (fun a -> Alpha_context.Contract.Implicit Account.(a.pkh)) accounts + in + let bootstrap_accounts = Account.make_bootstrap_accounts accounts in + return (bootstrap_accounts, contracts) + +let init_with_constants_gen tup constants = + let open Lwt_result_syntax in + let n = tup_n tup in + let*? bootstrap_accounts, contracts = create_bootstrap_accounts n in + let parameters = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + ~bootstrap_accounts + constants + in + let* blk = Block.genesis_with_parameters parameters in + return (blk, tup_get tup contracts) + +let init_with_constants_n constants n = + init_with_constants_gen (TList n) constants + +let init_with_constants1 = init_with_constants_gen T1 + +let init_with_constants2 = init_with_constants_gen T2 + +let init_with_parameters_gen tup parameters = + let open Lwt_result_syntax in + let n = tup_n tup in + let*? bootstrap_accounts, contracts = create_bootstrap_accounts n in + let parameters = Parameters.{parameters with bootstrap_accounts} in + let* blk = Block.genesis_with_parameters parameters in + return (blk, tup_get tup contracts) + +let init_with_parameters_n params n = init_with_parameters_gen (TList n) params + +let init_with_parameters1 = init_with_parameters_gen T1 + +let init_with_parameters2 = init_with_parameters_gen T2 + +let default_raw_context () = + let open Tezos_protocol_016_PtMumbai_parameters in + let initial_account = Account.new_account () in + let bootstrap_accounts = + Account.make_bootstrap_account + ~balance:(Tez.of_mutez_exn 100_000_000_000L) + initial_account + in + Block.prepare_initial_context_params () >>=? fun (constants, _, _) -> + let parameters = + Default_parameters.parameters_of_constants + ~bootstrap_accounts:[bootstrap_accounts] + ~commitments:[] + constants + in + let json = Default_parameters.json_of_parameters parameters in + let proto_params = + Data_encoding.Binary.to_bytes_exn Data_encoding.json json + in + let protocol_param_key = ["protocol_parameters"] in + Tezos_protocol_environment.Context.( + let empty = Tezos_protocol_environment.Memory_context.empty in + add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> + add ctxt protocol_param_key proto_params) + >>= fun context -> + let typecheck ctxt script_repr = return ((script_repr, None), ctxt) in + Init_storage.prepare_first_block + Tezos_crypto.Chain_id.zero + context + ~level:0l + ~timestamp:(Time.Protocol.of_seconds 1643125688L) + ~predecessor:Tezos_crypto.Block_hash.zero + ~typecheck + >>= fun e -> Lwt.return @@ Environment.wrap_tzresult e diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.mli new file mode 100644 index 000000000000..d747ac65e606 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.mli @@ -0,0 +1,399 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Environment + +type t = B of Block.t | I of Incremental.t + +val branch : t -> Tezos_crypto.Block_hash.t + +val pred_branch : t -> Tezos_crypto.Block_hash.t + +val get_level : t -> Raw_level.t tzresult + +(** Either retrieve the alpha context (in the [Incremental] case) or + build one (in the [Block] case). *) +val to_alpha_ctxt : t -> Alpha_context.t tzresult Lwt.t + +(** Given a context, returns the list of endorsers charactized by + the [level], the public key hash of the [delegate], its [consensus_key] + and its assigned [slots]. + see {! Plugin.RPC.Validator.t}. *) +val get_endorsers : t -> Plugin.RPC.Validators.t list tzresult Lwt.t + +(** Return the two first elements of the list returns by [get_endorsers]. *) +val get_first_different_endorsers : + t -> (Plugin.RPC.Validators.t * Plugin.RPC.Validators.t) tzresult Lwt.t + +(** Return the first element [delegate,slot] of the list returns by + [get_endorsers], where [delegate] is the [consensus key] when + is set. *) +val get_endorser : t -> (public_key_hash * Slot.t list) tzresult Lwt.t + +(** Given a [delegate], and a context [ctxt], if [delegate] is in + [get_endorsers ctxt] returns the [slots] of [delegate] otherwise + return [None]. *) +val get_endorser_slot : + t -> public_key_hash -> Slot.t list option tzresult Lwt.t + +(** Return the [n]th element of the list returns by [get_endorsers]. *) +val get_endorser_n : t -> int -> (public_key_hash * Slot.t list) tzresult Lwt.t + +val get_endorsing_power_for_delegate : + t -> ?levels:Raw_level.t list -> public_key_hash -> int tzresult Lwt.t + +val get_voting_power : + t -> public_key_hash -> int64 Environment.Error_monad.shell_tzresult Lwt.t + +val get_total_voting_power : + t -> int64 Environment.Error_monad.shell_tzresult Lwt.t + +val get_bakers : + ?filter:(Plugin.RPC.Baking_rights.t -> bool) -> + ?cycle:Cycle.t -> + t -> + public_key_hash list tzresult Lwt.t + +val get_baker : t -> round:Round.t -> public_key_hash tzresult Lwt.t + +val get_first_different_baker : + public_key_hash -> public_key_hash trace -> public_key_hash + +val get_first_different_bakers : + t -> (public_key_hash * public_key_hash) tzresult Lwt.t + +val get_seed_nonce_hash : t -> Nonce_hash.t tzresult Lwt.t + +(** Returns the seed of the cycle to which the block belongs to. *) +val get_seed : t -> Seed.seed tzresult Lwt.t + +val get_seed_computation : t -> Seed.seed_computation_status tzresult Lwt.t + +(** Returns all the constants of the protocol *) +val get_constants : t -> Constants.t tzresult Lwt.t + +(** The default constants used in the test framework. To be used with + [init_with_constants]. *) +val default_test_constants : Constants.Parametric.t + +val get_baking_reward_fixed_portion : t -> Tez.t tzresult Lwt.t + +val get_bonus_reward : t -> endorsing_power:int -> Tez.t tzresult Lwt.t + +val get_endorsing_reward : + t -> expected_endorsing_power:int -> Tez.t tzresult Lwt.t + +val get_liquidity_baking_subsidy : t -> Tez.t tzresult Lwt.t + +val get_liquidity_baking_cpmm_address : t -> Contract_hash.t tzresult Lwt.t + +module Vote : sig + val get_ballots : t -> Vote.ballots tzresult Lwt.t + + val get_ballot_list : + t -> + (Tezos_crypto.Signature.Public_key_hash.t * Vote.ballot) list tzresult Lwt.t + + val get_current_period : t -> Voting_period.info tzresult Lwt.t + + val get_current_quorum : t -> int32 tzresult Lwt.t + + val get_participation_ema : Block.t -> int32 tzresult Lwt.t + + val get_listings : + t -> (Tezos_crypto.Signature.Public_key_hash.t * int64) list tzresult Lwt.t + + val get_proposals : t -> int64 Protocol_hash.Map.t tzresult Lwt.t + + val get_current_proposal : + t -> Tezos_crypto.Protocol_hash.t option tzresult Lwt.t + + val get_protocol : Block.t -> Tezos_crypto.Protocol_hash.t Lwt.t + + val set_participation_ema : Block.t -> int32 -> Block.t Lwt.t + + type delegate_info = Alpha_context.Vote.delegate_info = { + voting_power : Int64.t option; + current_ballot : Alpha_context.Vote.ballot option; + current_proposals : Tezos_crypto.Protocol_hash.t list; + remaining_proposals : int; + } + + (** See {!Vote_storage.get_delegate_proposal_count}. + + Note that unlike most functions in the current module, this one + does not call an RPC. *) + val get_delegate_proposal_count : t -> public_key_hash -> int tzresult Lwt.t +end + +module Contract : sig + val pp : Format.formatter -> Contract.t -> unit + + val equal : Contract.t -> Contract.t -> bool + + val pkh : Contract.t -> public_key_hash + + (** Returns the balance of a contract, by default the main balance. + If the contract is implicit the frozen balances are available too: + deposit, fees or rewards. *) + val balance : t -> Contract.t -> Tez.t tzresult Lwt.t + + val frozen_bonds : t -> Contract.t -> Tez.t tzresult Lwt.t + + val balance_and_frozen_bonds : t -> Contract.t -> Tez.t tzresult Lwt.t + + val counter : t -> Contract.t -> Manager_counter.t tzresult Lwt.t + + val manager : t -> Contract.t -> Account.t tzresult Lwt.t + + val is_manager_key_revealed : t -> Contract.t -> bool tzresult Lwt.t + + val delegate : t -> Contract.t -> public_key_hash tzresult Lwt.t + + val delegate_opt : t -> Contract.t -> public_key_hash option tzresult Lwt.t + + val storage : t -> Contract_hash.t -> Script.expr tzresult Lwt.t + + val script : t -> Contract_hash.t -> Script.expr tzresult Lwt.t + + val script_hash : t -> Contract_hash.t -> Script_expr_hash.t tzresult Lwt.t +end + +module Delegate : sig + type info = Delegate_services.info = { + full_balance : Tez.t; + current_frozen_deposits : Tez.t; + frozen_deposits : Tez.t; + staking_balance : Tez.t; + frozen_deposits_limit : Tez.t option; + delegated_contracts : Alpha_context.Contract.t list; + delegated_balance : Tez.t; + deactivated : bool; + grace_period : Cycle.t; + voting_info : Vote.delegate_info; + active_consensus_key : Tezos_crypto.Signature.Public_key_hash.t; + pending_consensus_keys : + (Cycle.t * Tezos_crypto.Signature.Public_key_hash.t) list; + } + + val info : t -> public_key_hash -> Delegate_services.info tzresult Lwt.t + + val full_balance : t -> public_key_hash -> Tez.t tzresult Lwt.t + + val current_frozen_deposits : t -> public_key_hash -> Tez.t tzresult Lwt.t + + (** calls the RPC [frozen_deposits]: we're using a different name to + be more easily distinguishable from [current_frozen_deposits] *) + val initial_frozen_deposits : t -> public_key_hash -> Tez.t tzresult Lwt.t + + val staking_balance : t -> public_key_hash -> Tez.t tzresult Lwt.t + + val frozen_deposits_limit : + t -> public_key_hash -> Tez.t option tzresult Lwt.t + + val deactivated : t -> public_key_hash -> bool tzresult Lwt.t + + val voting_info : t -> public_key_hash -> Vote.delegate_info tzresult Lwt.t + + val consensus_key : + t -> + public_key_hash -> + (public_key_hash * (Cycle.t * public_key_hash) list) tzresult Lwt.t + + val participation : + t -> public_key_hash -> Delegate.participation_info tzresult Lwt.t +end + +module Tx_rollup : sig + val state : t -> Tx_rollup.t -> Tx_rollup_state.t tzresult Lwt.t + + (** [inbox ctxt tx_rollup level] returns the inbox of this + transaction rollup at [level]. If the inbox does not exist, the + function returns an error. *) + val inbox : + t -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_inbox.t option tzresult Lwt.t + + (** [commitment ctxt tx_rollup] returns the commitment of this + transaction rollup at [level]. If the commitment does not exist, + the function returns an error. *) + val commitment : + t -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_commitment.Submitted_commitment.t option tzresult Lwt.t +end + +module Sc_rollup : sig + val inbox : t -> Sc_rollup.Inbox.t tzresult Lwt.t + + val commitment : + t -> + Sc_rollup.t -> + Sc_rollup.Commitment.Hash.t -> + Sc_rollup.Commitment.t tzresult Lwt.t + + val genesis_info : + t -> Sc_rollup.t -> Sc_rollup.Commitment.genesis_info tzresult Lwt.t + + val timeout : + t -> + Sc_rollup.t -> + Tezos_crypto.Signature.Public_key_hash.t + * Tezos_crypto.Signature.Public_key_hash.t -> + Sc_rollup.Game.timeout option tzresult Lwt.t + + val ongoing_games_for_staker : + t -> + Sc_rollup.t -> + Tezos_crypto.Signature.public_key_hash -> + (Sc_rollup.Game.t + * Tezos_crypto.Signature.public_key_hash + * Tezos_crypto.Signature.public_key_hash) + list + tzresult + Lwt.t +end + +type (_, _) tup = + | T1 : ('a, 'a) tup + | T2 : ('a, 'a * 'a) tup + | T3 : ('a, 'a * 'a * 'a) tup + | TList : int -> ('a, 'a list) tup + +val tup_hd : ('a, 'elts) tup -> 'elts -> 'a + +type 'accounts init := + ?rng_state:Random.State.t -> + ?commitments:Commitment.t list -> + ?bootstrap_balances:int64 list -> + ?bootstrap_delegations:Signature.Public_key_hash.t option list -> + ?bootstrap_consensus_keys:Signature.Public_key.t option list -> + ?consensus_threshold:int -> + ?min_proposal_quorum:int32 -> + ?bootstrap_contracts:Parameters.bootstrap_contract list -> + ?level:int32 -> + ?cost_per_byte:Tez.t -> + ?liquidity_baking_subsidy:Tez.t -> + ?endorsing_reward_per_slot:Tez.t -> + ?baking_reward_bonus_per_slot:Tez.t -> + ?baking_reward_fixed_portion:Tez.t -> + ?origination_size:int -> + ?blocks_per_cycle:int32 -> + ?cycles_per_voting_period:int32 -> + ?tx_rollup_enable:bool -> + ?tx_rollup_sunset_level:int32 -> + ?tx_rollup_origination_size:int -> + ?sc_rollup_enable:bool -> + ?dal_enable:bool -> + ?zk_rollup_enable:bool -> + ?hard_gas_limit_per_block:Gas.Arith.integral -> + ?nonce_revelation_threshold:int32 -> + unit -> + (Block.t * 'accounts) tzresult Lwt.t + +(** Returns an initial block and the implicit contracts corresponding + to its bootstrap accounts. The number of bootstrap accounts, and + the structure of the returned contracts, are specified by the [tup] + argument. *) +val init_gen : (Alpha_context.Contract.t, 'accounts) tup -> 'accounts init + +(** [init_n n] : returns an initial block with [n] initialized accounts + and the associated implicit contracts *) +val init_n : int -> Alpha_context.Contract.t list init + +(** [init1] : returns an initial block with 1 initialized bootstrap account + and the associated implicit contract *) +val init1 : Alpha_context.Contract.t init + +(** [init2] : returns an initial block with 2 initialized bootstrap accounts + and the associated implicit contracts *) +val init2 : (Alpha_context.Contract.t * Alpha_context.Contract.t) init + +(** [init3] : returns an initial block with 3 initialized bootstrap accounts + and the associated implicit contracts *) +val init3 : + (Alpha_context.Contract.t + * Alpha_context.Contract.t + * Alpha_context.Contract.t) + init + +val init_with_constants_gen : + (Alpha_context.Contract.t, 'contracts) tup -> + Constants.Parametric.t -> + (Block.t * 'contracts) tzresult Lwt.t + +val init_with_constants_n : + Constants.Parametric.t -> + int -> + (Block.t * Alpha_context.Contract.t list) tzresult Lwt.t + +val init_with_constants1 : + Constants.Parametric.t -> (Block.t * Alpha_context.Contract.t) tzresult Lwt.t + +val init_with_constants2 : + Constants.Parametric.t -> + (Block.t * (Alpha_context.Contract.t * Alpha_context.Contract.t)) tzresult + Lwt.t + +(** [init_with_parameters_gen tup params] returns an initial block parametrised + with [params] and the implicit contracts corresponding to its bootstrap + accounts. The number of bootstrap accounts, and the structure of the + returned contracts, are specified by the [tup] argument. *) +val init_with_parameters_gen : + (Alpha_context.Contract.t, 'contracts) tup -> + Parameters.t -> + (Block.t * 'contracts) tzresult Lwt.t + +(** [init_with_parameters_n params n] returns an initial block parametrized + with [params] with [n] initialized accounts and the associated implicit + contracts *) +val init_with_parameters_n : + Parameters.t -> + int -> + (Block.t * Alpha_context.Contract.t list) tzresult Lwt.t + +(** [init_with_parameters1 params] returns an initial block parametrized with + [params] with one initialized account and the associated implicit + contract. *) +val init_with_parameters1 : + Parameters.t -> (Block.t * Alpha_context.Contract.t) tzresult Lwt.t + +(** [init_with_parameters2 params] returns an initial block parametrized with + [params] with two initialized accounts and the associated implicit + contracts *) +val init_with_parameters2 : + Parameters.t -> + (Block.t * (Alpha_context.Contract.t * Alpha_context.Contract.t)) tzresult + Lwt.t + +(** [default_raw_context] returns a [Raw_context.t] for use in tests + below [Alpha_context] *) +val default_raw_context : unit -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/contract_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/contract_helpers.ml new file mode 100644 index 000000000000..f7d6c63dab2a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/contract_helpers.ml @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Error_monad_operators + +(** Initializes 2 addresses to do only operations plus one that will be + used to bake. *) +let init () = + Context.init3 ~consensus_threshold:0 () >|=? fun (b, (src0, src1, src2)) -> + let baker = + match src0 with Implicit v -> v | Originated _ -> assert false + in + (b, baker, src1, src2) + +(** Return contents of a given file as string. *) +let read_file f = + In_channel.with_open_text f (fun ic -> + really_input_string ic (in_channel_length ic)) + +(** Loads a script from file. *) +let load_script ~storage file = + let contract_string = read_file file in + let code = Expr.toplevel_from_string contract_string in + let storage = Expr.from_string storage in + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + +(** Returns a block in which the contract is originated. *) +let originate_contract_hash file storage src b baker = + let script = load_script ~storage file in + Op.contract_origination_hash (B b) src ~fee:(Test_tez.of_int 10) ~script + >>=? fun (operation, dst) -> + Incremental.begin_construction ~policy:Block.(By_account baker) b + >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr >|=? fun b -> (dst, b) + +let originate_contract file storage src b baker = + originate_contract_hash file storage src b baker >|=? fun (dst, b) -> + (Contract.Originated dst, b) + +let fake_KT1 = + Contract_hash.of_b58check_exn "KT1FAKEFAKEFAKEFAKEFAKEFAKEFAKGGSE2x" + +let default_self = fake_KT1 + +let default_payer = Tezos_crypto.Signature.Public_key_hash.zero + +let default_source = Contract.Implicit default_payer + +let default_step_constants = + Script_interpreter. + { + source = default_source; + payer = default_payer; + self = default_self; + amount = Tez.zero; + balance = Tez.zero; + chain_id = Tezos_crypto.Chain_id.zero; + now = Script_timestamp.of_zint Z.zero; + level = Script_int.zero_n; + } + +(** Helper function that parses and typechecks a script, its initial storage and + parameters from strings. It then executes the typed script with the storage + and parameters and returns the result. + + The [step_constants] argument passes in some data which remains constant + throughout script's execution, hence the name. This includes addresses of + the sender and payer, the address of the smart contract, the amount of Tez + transferred to it and so on. + + An [internal] operation is an operation generated by smart contract's execution + rather than by an implicit account. *) +let run_script ctx ?logger ?(step_constants = default_step_constants) + ?(internal = false) contract ?(entrypoint = Entrypoint.default) ~storage + ~parameter () = + let contract_expr = Expr.from_string contract in + let storage_expr = Expr.from_string storage in + let parameter_expr = Expr.from_string parameter in + let script = + Script.{code = lazy_expr contract_expr; storage = lazy_expr storage_expr} + in + Script_interpreter.execute + ctx + Readable + step_constants + ?logger + ~script + ~cached_script:None + ~entrypoint + ~parameter:parameter_expr + ~internal + >>=?? fun res -> return res + +let originate_contract_from_string_hash ~script ~storage ~source_contract ~baker + block = + let code = Expr.toplevel_from_string script in + let storage = Expr.from_string storage in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + Op.contract_origination_hash + (B block) + source_contract + ~fee:(Test_tez.of_int 10) + ~script + >>=? fun (operation, dst) -> + Incremental.begin_construction ~policy:Block.(By_account baker) block + >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr >|=? fun b -> (dst, script, b) + +let originate_contract_from_string ~script ~storage ~source_contract ~baker + block = + originate_contract_from_string_hash + ~script + ~storage + ~source_contract + ~baker + block + >|=? fun (dst, script, b) -> (Contract.Originated dst, script, b) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_logic.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_logic.ml new file mode 100644 index 000000000000..a1d4d8027c58 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_logic.ml @@ -0,0 +1,102 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This is a simulation of the CPMM contract, as implemented in mligo + in [src/proto_alpha/lib_protocol/contracts/cpmm.mligo]. The + interested reader should look for comments in this file to gain a + better understanding of the contract logic. *) +module Simulate_raw = struct + let mutez_to_natural t = Z.of_int64 (Tez.to_mutez t) + + let natural_to_mutez n = Tez.of_mutez_exn (Z.to_int64 n) + + let addLiquidity ~tokenPool ~xtzPool ~lqtTotal ~amount = + let xtzPool = mutez_to_natural xtzPool in + let nat_amount = mutez_to_natural amount in + let lqt_minted = Z.(nat_amount * lqtTotal / xtzPool) in + let tokens_deposited = Z.(cdiv (nat_amount * tokenPool) xtzPool) in + (lqt_minted, tokens_deposited) + + let removeLiquidity ~tokenPool ~xtzPool ~lqtTotal ~lqtBurned = + let xtz_withdrawn = + natural_to_mutez Z.(lqtBurned * mutez_to_natural xtzPool / lqtTotal) + in + let tokens_withdrawn = Z.(lqtBurned * tokenPool / lqtTotal) in + (xtz_withdrawn, tokens_withdrawn) + + let tokenToXtz ~tokenPool ~xtzPool ~tokensSold = + let fee = Z.of_int 999 in + let xtz_bought_nat = + Z.( + tokensSold * fee * mutez_to_natural xtzPool + / ((tokenPool * of_int 1000) + (tokensSold * fee))) + in + let bought = Z.(xtz_bought_nat * of_int 999 / of_int 1000) in + (natural_to_mutez bought, xtz_bought_nat) + + let xtzToToken ~tokenPool ~xtzPool ~amount = + let fee = Z.of_int 999 in + let xtzPool = mutez_to_natural xtzPool in + let nat_amount = mutez_to_natural amount in + let amount_net_burn = Z.(nat_amount * Z.of_int 999 / Z.of_int 1000) in + let tokens_bought = + Z.( + amount_net_burn * fee * tokenPool + / ((xtzPool * Z.of_int 1000) + (amount_net_burn * fee))) + in + (tokens_bought, amount_net_burn) + + let tokenToToken ~tokenPool ~xtzPool ~tokensSold = + let fee = Z.of_int 999 in + let xtz_bought_nat = + Z.( + tokensSold * fee * mutez_to_natural xtzPool + / ((tokenPool * of_int 1000) + (tokensSold * fee))) + in + let xtz_bought_net_burn = Z.(xtz_bought_nat * of_int 999 / of_int 1000) in + (natural_to_mutez xtz_bought_net_burn, xtz_bought_nat) +end + +module Simulate = struct + open Cpmm_repr.Storage + + let addLiquidity {tokenPool; xtzPool; lqtTotal; _} amount = + Simulate_raw.addLiquidity ~xtzPool ~tokenPool ~lqtTotal ~amount + + let removeLiquidity {tokenPool; xtzPool; lqtTotal; _} lqtBurned = + Simulate_raw.removeLiquidity ~tokenPool ~xtzPool ~lqtTotal ~lqtBurned + + let tokenToXtz {tokenPool; xtzPool; _} tokensSold = + Simulate_raw.tokenToXtz ~tokenPool ~xtzPool ~tokensSold + + let xtzToToken {tokenPool; xtzPool; _} amount = + Simulate_raw.xtzToToken ~tokenPool ~xtzPool ~amount + + let tokenToToken {tokenPool; xtzPool; _} tokensSold = + Simulate_raw.tokenToToken ~tokenPool ~xtzPool ~tokensSold +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_repr.ml new file mode 100644 index 000000000000..41c1c8c0543b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/cpmm_repr.ml @@ -0,0 +1,384 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Expr_common + +(* // ============================================================================= + * // Storage + * // ============================================================================= *) + +module Storage = struct + type t = { + tokenPool : Z.t; + xtzPool : Tez.t; + lqtTotal : Z.t; + tokenAddress : Contract_hash.t; + lqtAddress : Contract_hash.t; + } + + let zero : t = + { + tokenPool = Z.zero; + xtzPool = Tez.zero; + lqtTotal = Z.zero; + tokenAddress = Contract_hash.zero; + lqtAddress = Contract_hash.zero; + } + + let to_string {tokenPool; xtzPool; lqtTotal; tokenAddress; lqtAddress} = + Format.asprintf + "{tokenPool : %a; xtzPool : %s; lqtTotal : %a; tokenAddress : %s; \ + lqtAddress : %s;}" + Z.pp_print + tokenPool + (Int64.to_string @@ Tez.to_mutez xtzPool) + Z.pp_print + lqtTotal + (Contract_hash.to_b58check tokenAddress) + (Contract_hash.to_b58check lqtAddress) + + let pp fmt s = Format.fprintf fmt "%s" (to_string s) + + let eq s s' = s = s' + + let to_expr : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc {tokenPool; xtzPool; lqtTotal; tokenAddress; lqtAddress} -> + comb + ~loc + [ + int ~loc tokenPool; + mutez ~loc xtzPool; + int ~loc lqtTotal; + address_string ~loc (Contract.Originated tokenAddress); + address_string ~loc (Contract.Originated lqtAddress); + ] + + let to_michelson_string e = + let e = to_expr ~loc:0 e in + Format.asprintf + "%a" + Michelson_v1_printer.print_expr + (Micheline.strip_locations e) + + type exn += Invalid_storage_expr of string + + (** Note: parses a storage unparsed in readable mode (as + e.g. returned by [Alpha_services.Contract.storage]), so that + contracts are represented by strings. *) + let of_expr_exn : + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node -> t = + function + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Int (_, tokenPool); + Tezos_micheline.Micheline.Int (_, xtzPool); + Tezos_micheline.Micheline.Int (_, lqtTotal); + Tezos_micheline.Micheline.String (_, tokenAddress); + Tezos_micheline.Micheline.String (_, lqtAddress); + ], + [] ) -> + let xtzPool = Tez.of_mutez_exn (Z.to_int64 xtzPool) in + let tokenAddress = originated_of_string_exn tokenAddress in + let lqtAddress = originated_of_string_exn lqtAddress in + {tokenPool; xtzPool; lqtTotal; tokenAddress; lqtAddress} + | e -> + let canonical = Micheline.strip_locations e in + let msg = + Format.asprintf + "Not a valid CPMM storage: %s /// %a" + (try + Michelson_v1_printer.micheline_string_of_expression + ~zero_loc:true + canonical + with Z.Overflow -> + "Cannot represent as micheline due to overflowing Z -> int") + Michelson_v1_printer.print_expr + canonical + in + raise (Invalid_storage_expr msg) + + let get (ctxt : Context.t) ~(contract : Contract.t) : t tzresult Lwt.t = + match contract with + | Implicit _ -> + invalid_arg "Cpmm_repr.Storage.get called on implicit account" + | Originated c -> + Context.Contract.storage ctxt c >|=? Micheline.root >|=? of_expr_exn + + let of_tuple (tokenPool, xtzPool, lqtTotal, tokenAddress, lqtAddress) = + {tokenPool; xtzPool; lqtTotal; tokenAddress; lqtAddress} + + let to_tuple {tokenPool; xtzPool; lqtTotal; tokenAddress; lqtAddress} = + (tokenPool, xtzPool, lqtTotal, tokenAddress, lqtAddress) + + let valid {tokenPool; xtzPool; lqtTotal; _} = + tokenPool > Z.zero && lqtTotal > Z.zero && Tez.(xtzPool > Tez.zero) +end + +module Parameter = struct + (* // ============================================================================= + * // Entrypoints + * // ============================================================================= *) + + type add_liquidity = { + owner : Contract.t; + minLqtMinted : Z.t; + maxTokensDeposited : Z.t; + deadline : Script_timestamp.t; + } + + type remove_liquidity = { + to_ : Contract.t; + (* recipient of the liquidity redemption *) + lqtBurned : Z.t; + (* amount of lqt owned by sender to burn *) + minXtzWithdrawn : Tez.t; + (* minimum amount of Tez.t to withdraw *) + minTokensWithdrawn : Z.t; + (* minimum amount of tokens to withdraw *) + deadline : Script_timestamp.t; + (* the time before which the request must be completed *) + } + + type token_to_token = { + outputDexterContract : Contract.t; + minTokensBought : Z.t; + to_ : Contract.t; + tokensSold : Z.t; + deadline : Script_timestamp.t; + } + + type token_to_xtz = { + to_ : Contract.t; + tokensSold : Z.t; + minXtzBought : Tez.t; + deadline : Script_timestamp.t; + } + + type xtz_to_token = { + to_ : Contract.t; + minTokensBought : Z.t; + deadline : Script_timestamp.t; + } + + type t = + | AddLiquidity of add_liquidity + | Default of unit + | RemoveLiquidity of remove_liquidity + | TokenToToken of token_to_token + | TokenToXtz of token_to_xtz + | XtzToToken of xtz_to_token + + let addLiquidity p = AddLiquidity p + + let default p = Default p + + let removeLiquidity p = RemoveLiquidity p + + let tokenToToken p = TokenToToken p + + let tokenToXtz p = TokenToXtz p + + let xtzToToken p = XtzToToken p + + let add_liquidity_to_string : add_liquidity -> string = + fun {owner; minLqtMinted; maxTokensDeposited; deadline} -> + Format.asprintf + "{owner : %s; minLqtMinted : %a; maxTokensDeposited : %a; deadline : %s }" + (Contract.to_b58check owner) + Z.pp_print + minLqtMinted + Z.pp_print + maxTokensDeposited + (Script_timestamp.to_string deadline) + + let remove_liquidity_to_string : remove_liquidity -> string = + fun {to_; lqtBurned; minXtzWithdrawn; minTokensWithdrawn; deadline} -> + Format.asprintf + "{owner : %s; lqtBurned : %a; minXtzWithdrawn : %s; minTokensWithdrawn : \ + %a; deadline : %s }" + (Contract.to_b58check to_) + Z.pp_print + lqtBurned + (Int64.to_string @@ Tez.to_mutez minXtzWithdrawn) + Z.pp_print + minTokensWithdrawn + (Script_timestamp.to_string deadline) + + let token_to_token_to_string : token_to_token -> string = + fun {outputDexterContract; minTokensBought; to_; tokensSold; deadline} -> + Format.asprintf + "{outputDexterContract : %s; minTokensBought : %a; to_ : %s; tokensSold \ + : %a; deadline : %s }" + (Contract.to_b58check outputDexterContract) + Z.pp_print + minTokensBought + (Contract.to_b58check to_) + Z.pp_print + tokensSold + (Script_timestamp.to_string deadline) + + let token_to_xtz_to_string : token_to_xtz -> string = + fun {to_; tokensSold; minXtzBought; deadline} -> + Format.asprintf + "{to_ : %s; tokensSold : %a; minXtzBought : %s; deadline : %s }" + (Contract.to_b58check to_) + Z.pp_print + tokensSold + (Int64.to_string @@ Tez.to_mutez minXtzBought) + (Script_timestamp.to_string deadline) + + let xtz_to_token_to_string : xtz_to_token -> string = + fun {to_; minTokensBought; deadline} -> + Format.asprintf + "{to_ : %s; minTokensBought : %a; deadline : %s }" + (Contract.to_b58check to_) + Z.pp_print + minTokensBought + (Script_timestamp.to_string deadline) + + let to_string : t -> string = function + | AddLiquidity p -> + Format.asprintf "AddLiquidity %s" (add_liquidity_to_string p) + | Default () -> "Default ()" + | RemoveLiquidity p -> + Format.asprintf "RemoveLiquidity %s" (remove_liquidity_to_string p) + | TokenToToken p -> + Format.asprintf "TokenToToken (%s)" (token_to_token_to_string p) + | TokenToXtz p -> + Format.asprintf "TokenToXtz (%s)" (token_to_xtz_to_string p) + | XtzToToken p -> + Format.asprintf "XtzToToken (%s)" (xtz_to_token_to_string p) + + let entrypoint_of_parameter : t -> Entrypoint.t = function + | AddLiquidity _ -> Entrypoint.of_string_strict_exn "addLiquidity" + | Default _ -> Entrypoint.default + | RemoveLiquidity _ -> Entrypoint.of_string_strict_exn "removeLiquidity" + | TokenToToken _ -> Entrypoint.of_string_strict_exn "tokenToToken" + | TokenToXtz _ -> Entrypoint.of_string_strict_exn "tokenToXtz" + | XtzToToken _ -> Entrypoint.of_string_strict_exn "xtzToToken" + + let pp fmt s = Format.fprintf fmt "%s" (to_string s) + + let eq s s' = s = s' + + let to_expr_rooted : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc -> function + | AddLiquidity {owner; minLqtMinted; maxTokensDeposited; deadline} -> + comb + ~loc + [ + address_string ~loc owner; + int ~loc minLqtMinted; + int ~loc maxTokensDeposited; + timestamp ~loc deadline; + ] + | Default () -> unit ~loc () + | RemoveLiquidity + {to_; lqtBurned; minXtzWithdrawn; minTokensWithdrawn; deadline} -> + comb + ~loc + [ + address_string ~loc to_; + int ~loc lqtBurned; + mutez ~loc minXtzWithdrawn; + int ~loc minTokensWithdrawn; + timestamp ~loc deadline; + ] + | TokenToToken + {outputDexterContract; minTokensBought; to_; tokensSold; deadline} -> + comb + ~loc + [ + address_string ~loc outputDexterContract; + int ~loc minTokensBought; + address_string ~loc to_; + int ~loc tokensSold; + timestamp ~loc deadline; + ] + | TokenToXtz {to_; tokensSold; minXtzBought; deadline} -> + comb + ~loc + [ + address_string ~loc to_; + int ~loc tokensSold; + mutez ~loc minXtzBought; + timestamp ~loc deadline; + ] + | XtzToToken {to_; minTokensBought; deadline} -> + comb + ~loc + [ + address_string ~loc to_; + int ~loc minTokensBought; + timestamp ~loc deadline; + ] + + let to_expr : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc p -> + let rooted = to_expr_rooted ~loc p in + match p with + | AddLiquidity _ -> left ~loc @@ left ~loc @@ left ~loc rooted + | Default () -> left ~loc @@ left ~loc @@ right ~loc rooted + | RemoveLiquidity _ -> left ~loc @@ right ~loc @@ left ~loc rooted + | TokenToToken _ -> left ~loc @@ right ~loc @@ right ~loc rooted + | TokenToXtz _ -> right ~loc @@ left ~loc rooted + | XtzToToken _ -> right ~loc @@ right ~loc rooted + + let to_michelson_string e = + let e = to_expr ~loc:0 e in + Format.asprintf + "%a" + Michelson_v1_printer.print_expr + (Micheline.strip_locations e) +end + +let transaction (ctxt : Context.t) ~(contract : Contract.t) ~(src : Contract.t) + ?(amount = Tez.zero) (parameters : Parameter.t) = + let entrypoint = Parameter.entrypoint_of_parameter parameters in + let rooted_param_lazy = + parameters + |> Parameter.to_expr_rooted ~loc:0 + |> Micheline.strip_locations |> Alpha_context.Script.lazy_expr + in + Op.transaction + ctxt + src + contract + amount + ~entrypoint + ~parameters:rooted_param_lazy diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.ml new file mode 100644 index 000000000000..c6624b11513c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.ml @@ -0,0 +1,254 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module S = Dal_slot_repr +module P = S.Page +module Hist = S.History +module Ihist = Hist.Internal_for_tests + +(** Error used below for functions that don't return their failures in the monad + error. *) +type error += Test_failure of string + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"test_failure" + ~title:"Test failure" + ~description:"Test failure." + ~pp:(fun ppf e -> Format.fprintf ppf "Test failure: %s" e) + (obj1 (req "error" string)) + (function Test_failure e -> Some e | _ -> None) + (fun e -> Test_failure e) + +let mk_cryptobox dal_params = + let open Result_syntax in + let parameters = + Cryptobox.Internal_for_tests.initialisation_parameters_from_slot_size + ~slot_size:dal_params.S.slot_size + in + let () = Cryptobox.Internal_for_tests.load_parameters parameters in + match Cryptobox.make dal_params with + | Ok dal -> return dal + | Error (`Fail s) -> fail [Test_failure s] + +let derive_dal_parameters (reference : Cryptobox.parameters) ~redundancy_factor + ~constants_divider = + { + S.redundancy_factor; + page_size = reference.page_size / constants_divider; + slot_size = reference.slot_size / constants_divider; + number_of_shards = reference.number_of_shards / constants_divider; + } + +module Make (Parameters : sig + val dal_parameters : Alpha_context.Constants.Parametric.dal + + val cryptobox : Cryptobox.t +end) = +struct + (* Some global constants. *) + + let params = Parameters.dal_parameters.cryptobox_parameters + + let cryptobox = Parameters.cryptobox + + let genesis_history = Hist.genesis + + let genesis_history_cache = Hist.History_cache.empty ~capacity:3000L + + let level_one = Raw_level_repr.(succ root) + + let level_ten = Raw_level_repr.(of_int32_exn 10l) + + (* Helper functions. *) + + let get_history cache h = Hist.History_cache.find h cache |> Lwt.return + + let dal_mk_polynomial_from_slot slot_data = + let open Result_syntax in + match Cryptobox.polynomial_from_slot cryptobox slot_data with + | Ok p -> return p + | Error (`Slot_wrong_size s) -> + fail + [ + Test_failure + (Format.sprintf "polynomial_from_slot: Slot_wrong_size (%s)" s); + ] + + let dal_mk_prove_page polynomial page_id = + let open Result_syntax in + match Cryptobox.prove_page cryptobox polynomial page_id.P.page_index with + | Ok p -> return p + | Error `Segment_index_out_of_range -> + fail [Test_failure "compute_proof_segment: Segment_index_out_of_range"] + + let mk_slot ?(level = level_one) ?(index = S.Index.zero) + ?(fill_function = fun _i -> 'x') () = + let open Result_syntax in + let slot_data = Bytes.init params.slot_size fill_function in + let* polynomial = dal_mk_polynomial_from_slot slot_data in + let commitment = Cryptobox.commit cryptobox polynomial in + return + ( slot_data, + polynomial, + S.Header.{id = {published_level = level; index}; commitment} ) + + let mk_page_id published_level slot_index page_index = + P.{slot_id = {published_level; index = slot_index}; page_index} + + let no_data = Some (fun ~default_char:_ _ -> None) + + let mk_page_info ?(default_char = 'x') ?level ?(page_index = P.Index.zero) + ?(custom_data = None) (slot : S.Header.t) polynomial = + let open Result_syntax in + let level = + match level with None -> slot.id.published_level | Some level -> level + in + let page_id = mk_page_id level slot.id.index page_index in + let* page_proof = dal_mk_prove_page polynomial page_id in + match custom_data with + | None -> + let page_data = Bytes.make params.page_size default_char in + return (Some (page_data, page_proof), page_id) + | Some mk_data -> ( + match mk_data ~default_char params.page_size with + | None -> return (None, page_id) + | Some page_data -> return (Some (page_data, page_proof), page_id)) + + let succ_slot_index index = + Option.value_f + S.Index.(of_int (to_int index + 1)) + ~default:(fun () -> S.Index.zero) + + let next_char c = Char.(chr ((code c + 1) mod 255)) + + (** Auxiliary test function used by both unit and PBT tests: This function + produces a proof from the given information and verifies the produced result, + if any. The result of each step is checked with [check_produce_result] and + [check_verify_result], respectively. *) + let produce_and_verify_proof ~check_produce ?check_verify ~get_history + skip_list ~page_info ~page_id = + let open Lwt_result_syntax in + let*! res = + Hist.produce_proof params ~page_info page_id ~get_history skip_list + |> Lwt.map Environment.wrap_tzresult + in + let* () = check_produce res page_info in + match check_verify with + | None -> return_unit + | Some check_verify -> + let*? proof, _input_opt = res in + let res = + Hist.verify_proof params page_id skip_list proof + |> Environment.wrap_tzresult + in + check_verify res page_info + + (* Some check functions. *) + + (** Check that/if the returned content is the expected one. *) + let assert_content_is ~__LOC__ ~expected returned = + Assert.equal + ~loc:__LOC__ + (Option.equal Bytes.equal) + "Returned %s doesn't match the expected one" + (fun fmt opt -> + match opt with + | None -> Format.fprintf fmt "<None>" + | Some bs -> Format.fprintf fmt "<Some:%s>" (Bytes.to_string bs)) + returned + expected + + let expected_data page_info proof_status = + match (page_info, proof_status) with + | Some (d, _p), `Confirmed -> Some d + | None, `Confirmed -> assert false + | _ -> None + + let proof_status_to_string = function + | `Confirmed -> "CONFIRMED" + | `Unconfirmed -> "UNCONFIRMED" + + let successful_check_produce_result ~__LOC__ proof_status res page_info = + let open Lwt_result_syntax in + let* proof, input_opt = Assert.get_ok ~__LOC__ res in + let* () = + if Hist.Internal_for_tests.proof_statement_is proof proof_status then + return_unit + else + failwith + "Expected to have a %s page proof. Got %a@." + (proof_status_to_string proof_status) + (Hist.pp_proof ~serialized:false) + proof + in + assert_content_is + ~__LOC__ + input_opt + ~expected:(expected_data page_info proof_status) + + let failing_check_produce_result ~__LOC__ ~expected_error res _page_info = + Assert.proto_error ~loc:__LOC__ res (fun e -> + match (e, expected_error) with + | Hist.Dal_proof_error s, Hist.Dal_proof_error expected -> + String.equal s expected + | ( Hist.Unexpected_page_size {expected_size = e1; page_size = p1}, + Hist.Unexpected_page_size {expected_size = e2; page_size = p2} ) -> + e1 = e2 && p1 = p2 + | _ -> false) + + let successful_check_verify_result ~__LOC__ proof_status res page_info = + let open Lwt_result_syntax in + let* content = Assert.get_ok ~__LOC__ res in + let expected = expected_data page_info proof_status in + assert_content_is ~__LOC__ ~expected content + + (** Checks if the two provided Page.proof are equal. *) + let eq_page_proof = + let bytes_opt_of_proof page_proof = + Data_encoding.Binary.to_bytes_opt P.proof_encoding page_proof + in + fun pp1 pp2 -> + Option.equal Bytes.equal (bytes_opt_of_proof pp1) (bytes_opt_of_proof pp2) + + let slot_confirmed_but_page_data_not_provided ~__LOC__ = + failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Dal_proof_error + "The page ID's slot is confirmed, but no page content and proof are \ + provided.") + + let slot_not_confirmed_but_page_data_provided ~__LOC__ = + failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Dal_proof_error + "The page ID's slot is not confirmed, but page content and proof \ + are provided.") +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.mli new file mode 100644 index 000000000000..2c2eb26e448a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dal_helpers.mli @@ -0,0 +1,171 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Returns an object of type {!Cryptobox.t} from the given DAL paramters. *) +val mk_cryptobox : Cryptobox.parameters -> Cryptobox.t tzresult + +(** Derive new DAL parameters from the given ones by: + - setting the given redundancy factor ; + - dividing the other fields by the given factor. +*) +val derive_dal_parameters : + Cryptobox.parameters -> + redundancy_factor:int -> + constants_divider:int -> + Cryptobox.parameters + +module Make (P : sig + val dal_parameters : Alpha_context.Constants.Parametric.dal + + val cryptobox : Cryptobox.t +end) : sig + (** Some global constants. *) + + val genesis_history : Dal_slot_repr.History.t + + val genesis_history_cache : Dal_slot_repr.History.History_cache.t + + val level_one : Raw_level_repr.t + + val level_ten : Raw_level_repr.t + + (** Helper functions. *) + + (** Retrieves the history from a given cache. *) + val get_history : + Dal_slot_repr.History.History_cache.t -> + Dal_slot_repr.History.hash -> + Dal_slot_repr.History.t option Lwt.t + + (** Returns the slot's polynomial from the given slot's data. *) + val dal_mk_polynomial_from_slot : bytes -> Cryptobox.polynomial tzresult + + (** Using the given slot's polynomial, this function computes the page proof of + the page whose ID is provided. *) + val dal_mk_prove_page : + Cryptobox.polynomial -> + Dal_slot_repr.Page.t -> + Cryptobox.page_proof tzresult + + (** Constructs a slot whose ID is defined from the given level and given + index, and whose data are built using the given fill function. The function + returns the slot's data, polynomial, and header (in the sense: ID + kate + commitment). *) + val mk_slot : + ?level:Raw_level_repr.t -> + ?index:Dal_slot_repr.Index.t -> + ?fill_function:(int -> char) -> + unit -> + (bytes * Cryptobox.polynomial * Dal_slot_repr.Header.t) tzresult + + (** Constructs a record value of type Page.id. *) + val mk_page_id : + Raw_level_repr.t -> Dal_slot_repr.Index.t -> int -> Dal_slot_repr.Page.t + + val no_data : (default_char:char -> int -> bytes option) option + + (** Constructs a page whose level and slot indexes are those of the given slot + (except if level is redefined via [?level]), and whose page index and data + are given by arguments [page_index] and [mk_data]. If [mk_data] is set to + [No], the function returns the pair (None, page_id). Otherwise, the page's + [data] and [proof] is computed, and the function returns [Some (data, + proof), page_id]. *) + val mk_page_info : + ?default_char:char -> + ?level:Raw_level_repr.t -> + ?page_index:int -> + ?custom_data:(default_char:char -> int -> bytes option) option -> + Dal_slot_repr.Header.t -> + Cryptobox.polynomial -> + ( (bytes * Cryptobox.page_proof) option * Dal_slot_repr.Page.t, + error trace ) + result + + (** Returns the char after [c]. Restarts from the char whose code is 0 if [c]'s + code is 255. *) + val next_char : char -> char + + (** Increment the given slot index. Returns zero in case of overflow. *) + val succ_slot_index : Dal_slot_repr.Index.t -> Dal_slot_repr.Index.t + + (** Auxiliary test function used by both unit and PBT tests: This function + produces a proof from the given information and verifies the produced + result, if any. The result of each step is checked with + [check_produce_result] and [check_verify_result], respectively. *) + val produce_and_verify_proof : + check_produce: + ((Dal_slot_repr.History.proof * bytes option) tzresult -> + (bytes * Cryptobox.page_proof) option -> + (unit, tztrace) result Lwt.t) -> + ?check_verify: + (bytes option tzresult -> + (bytes * Cryptobox.page_proof) option -> + (unit, tztrace) result Lwt.t) -> + get_history: + (Dal_slot_repr.History.hash -> Dal_slot_repr.History.t option Lwt.t) -> + Dal_slot_repr.History.t -> + page_info:(bytes * Cryptobox.page_proof) option -> + page_id:Dal_slot_repr.Page.t -> + (unit, tztrace) result Lwt.t + + (** Check if two page proofs are equal. *) + val eq_page_proof : Cryptobox.page_proof -> Cryptobox.page_proof -> bool + + (** Helper for the case where produce_proof is expected to succeed. *) + val successful_check_produce_result : + __LOC__:string -> + [`Confirmed | `Unconfirmed] -> + (Dal_slot_repr.History.proof * bytes option) tzresult -> + (bytes * 'a) option -> + (unit, tztrace) result Lwt.t + + (** Helper for the case where verify_proof is expected to succeed. *) + val successful_check_verify_result : + __LOC__:string -> + [> `Confirmed] -> + bytes option tzresult -> + (bytes * 'a) option -> + (unit, tztrace) result Lwt.t + + (** Helper for the case where produce_proof is expected to fail because the slot + is confirmed but no page information are provided. *) + val slot_confirmed_but_page_data_not_provided : + __LOC__:string -> 'a tzresult -> 'b -> unit tzresult Lwt.t + + (** Helper for the case where produce_proof is expected to fail because the slot + is not confirmed but page_info are provided. *) + val slot_not_confirmed_but_page_data_provided : + __LOC__:string -> 'a tzresult -> 'b -> unit tzresult Lwt.t + + (** Helper for the case where produce_proof is expected to fail. *) + val failing_check_produce_result : + __LOC__:string -> + expected_error:Environment.Error_monad.error -> + 'a tzresult -> + 'b -> + unit tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dummy_zk_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dummy_zk_rollup.ml new file mode 100644 index 000000000000..71407dfdd7aa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dummy_zk_rollup.ml @@ -0,0 +1,630 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Dummy ZK Rollup for testing the ZKRU integration in the protocol. + The library Plompiler is used to build the circuits (in a module V as + verifier) and the corresponding functions to produce the inputs for the + circuits (in a module P as prover). + + The state of this rollup is a boolean value, which will be + represented with a scalar value of [zero] for [false] and + [one] for [true]. + + This RU has only one operation, with [op_code] 0. In addition to the + common header (see {!Zk_rollup_operation_repr}), this operation has + as payload one scalar representing a boolean value. + + The transition function [f] for this rollup is: + + {[ + f : operation -> state -> state + f (Op b) s = if b = s then not s else s + ]} + + That is, the state bool is flipped only if the operation's payload is + equal to the current state. + + The operation can be used publicly or in a private batch. The circuits + that describe the RU are: + - ["op"]: for a single public operation. + - ["batch-"[N]]: for a batch of [N] private operations. [N] is determined + by the [batch_size] parameter to the [Operator] functor. + - ["fee"]: the trivial fees circuit, since this RU has no concept of fees. + + NB: the "op" circuit does not add any constraints over the operation's + [exit_validity] other than it being in {0, 1}. This means that the dummy + rollup can be used to test deposits/withdrawals, but the rollup will not + perform any monetary bookkeeping. +*) + +open Plompiler + +(** Helper types and modules *) + +(** Empty types to represent bounds *) + +type balance + +type amount + +type fee + +type op_code + +(** Bounds required for the dummy rollup. *) +module Bound : sig + type 'a t = private Z.t + + val bound_balance : balance t + + val bound_amount : amount t + + val bound_fee : fee t + + val bound_op_code : op_code t + + val v : 'a t -> Z.t +end = struct + type 'a t = Z.t + + (** These bounds are exclusive. *) + + (** Upper bound for ticket balance, as found in the price field of an + operation's header *) + let bound_balance = Z.(shift_left one 20) + + (** Upper bound for ticket amount, used for fee circuit *) + let bound_amount = Z.(shift_left one 20) + + (** Upper bound for fee amount of one public operation *) + let bound_fee = Z.(shift_left one 10) + + (** Upper bound for op code *) + let bound_op_code = Z.one + + let v x = x +end + +(** Modules to manipulate bounded integers, both as OCaml values and in circuit + representation. +*) +module Bounded = Bounded.Make (Bound) + +(** Types used for the Dummy Rollup circuits. + This module is split into: + - P: concrete OCaml version of the types, + - V: Plompiler's circuit representation for P's types, and + - Encodings: conversion between P and V. +*) +module Types = struct + module P = struct + type state = bool + + module Bounded = Bounded.P + + type 'a ticket = {id : S.t; amount : 'a Bounded.t} + + type tezos_pkh = Environment.Signature.Public_key_hash.t + + type header = { + op_code : op_code Bounded.t; + price : balance ticket; + l1_dst : tezos_pkh; + rollup_id : tezos_pkh; + } + + type op = {header : header; payload : bool} + + (** Dummy values for these types. Useful to get the circuit without having + the actual inputs. *) + module Dummy = struct + let op_code = Bounded.make ~bound:Bound.bound_op_code Z.zero + + let balance = Bounded.make ~bound:Bound.bound_balance Z.zero + + let tezos_pkh = Environment.Signature.Public_key_hash.zero + + let ticket_balance = {id = S.zero; amount = balance} + + let header = + { + op_code; + price = ticket_balance; + l1_dst = tezos_pkh; + rollup_id = tezos_pkh; + } + end + end + + module V (L : LIB) = struct + open L + module Bounded_u = Bounded.V (L) + + type 'a ticket_u = {id : scalar repr; amount : 'a Bounded_u.t} + + type tezos_pkh_u = scalar repr + + type header_u = { + op_code : op_code Bounded_u.t; + price : balance ticket_u; + l1_dst : tezos_pkh_u; + rollup_id : tezos_pkh_u; + } + + type op_u = {header : header_u; payload : bool repr} + end + + module Encodings (L : LIB) = struct + module Bounded_e = Bounded.Encoding (L) + open P + + open V (L) + + open Encodings (L) + + let op_code_encoding ~safety = + Bounded_e.encoding ~safety Bound.bound_op_code + + let encoding_to_scalar e x = + let bs = Data_encoding.Binary.to_bytes_exn e x in + let z = Z.of_bits @@ Bytes.to_string bs in + Bls12_381.Fr.of_z z + + let encoding_of_scalar e x = + let z = Bls12_381.Fr.to_z x in + let bs = Bytes.of_string @@ Z.to_bits z in + Data_encoding.Binary.of_bytes_exn e bs + + let tezos_pkh_encoding : (tezos_pkh, tezos_pkh_u, _) encoding = + conv + (fun pkhu -> pkhu) + (fun w -> w) + (encoding_to_scalar Tezos_crypto.Signature.Public_key_hash.encoding) + (encoding_of_scalar Tezos_crypto.Signature.Public_key_hash.encoding) + scalar_encoding + + let amount_encoding ~safety = Bounded_e.encoding ~safety Bound.bound_amount + + let fee_encoding ~safety = Bounded_e.encoding ~safety Bound.bound_fee + + let ticket_encoding ~safety (bound : 'a Bound.t) : + ('a ticket, 'a ticket_u, _) encoding = + conv + (fun {id; amount} -> (id, amount)) + (fun (id, amount) -> {id; amount}) + (fun ({id; amount} : 'a ticket) -> (id, amount)) + (fun (id, amount) -> {id; amount}) + (obj2_encoding scalar_encoding (Bounded_e.encoding ~safety bound)) + + let ticket_balance_encoding ~safety = + ticket_encoding ~safety Bound.bound_balance + + let header_encoding ~safety : (header, header_u, _) encoding = + conv + (fun {op_code; price; l1_dst; rollup_id} -> + (op_code, (price, (l1_dst, rollup_id)))) + (fun (op_code, (price, (l1_dst, rollup_id))) -> + {op_code; price; l1_dst; rollup_id}) + (fun ({op_code; price; l1_dst; rollup_id} : header) -> + (op_code, (price, (l1_dst, rollup_id)))) + (fun (op_code, (price, (l1_dst, rollup_id))) -> + {op_code; price; l1_dst; rollup_id}) + (obj4_encoding + (op_code_encoding ~safety) + (* We use an Unsafe Bounded scalar encoding here to be able to + detect that an out-of-range value has been passed. + This encoding is unsafe in the sense that such value will cause + a failure in proving, instead of a circuit that can prove that + the argument is out-of-range. + This is enough for Protocol testing purposes, while keeping + the dummy circuit small. + *) + (ticket_balance_encoding ~safety:Unsafe) + tezos_pkh_encoding + tezos_pkh_encoding) + + let op_encoding : (op, op_u, _) encoding = + conv + (fun {header; payload} -> (header, payload)) + (fun (header, payload) -> {header; payload}) + (fun ({header; payload} : op) -> (header, payload)) + (fun (header, payload) -> {header; payload}) + (obj2_encoding (header_encoding ~safety:NoCheck) bool_encoding) + end +end + +(** Plompiler circuits for the dummy rollup *) +module V (L : LIB) = struct + open L + module E = Types.Encodings (L) + module Encodings = Encodings (L) + open Encodings + + open Types.V (L) + + let coerce (type a) (x : a Bounded_u.t) = + fst (x : a Bounded_u.t :> scalar repr * Z.t) + + (** Common logic for the state transition function *) + let logic_op ~old_state ~rollup_id op = + ignore rollup_id ; + let* valid = equal old_state op.payload in + let* new_state = Bool.bnot old_state in + let* expected_new_state = Bool.ifthenelse valid new_state old_state in + Num.assert_eq_const (coerce op.header.op_code) S.zero + (* >* assert_equal rollup_id op.header.rollup_id *) + >* ret expected_new_state + + (** Circuit definition for one public operation *) + let predicate_op ?(public = true) ~old_state ~new_state ~fee ~exit_validity + ~rollup_id op = + let* old_state = input ~public:true @@ Input.bool old_state in + let* new_state = input ~public:true @@ Input.bool new_state in + let* (_fee : scalar repr) = + input ~public:true + @@ E.((fee_encoding ~safety:Bounded_e.Unsafe).input) fee + in + let* (_exit_validity : bool repr) = + input ~public:true @@ Input.bool exit_validity + in + let* rollup_id = + input ~public:true @@ E.(tezos_pkh_encoding.input) rollup_id + in + let* op = input ~public @@ E.op_encoding.input op in + let op = E.op_encoding.decode op in + let* expected_new_state = logic_op ~old_state ~rollup_id op in + assert_equal expected_new_state new_state + + (** Circuit definition for a batch of private operations *) + let predicate_batch ~old_state ~new_state ~fees ~rollup_id ops = + let* old_state = input ~public:true @@ Input.bool old_state in + let* new_state = input ~public:true @@ Input.bool new_state in + let* (_fees : scalar repr) = + input ~public:true + @@ E.((amount_encoding ~safety:Bounded_e.Unsafe).input) fees + in + let* rollup_id = + input ~public:true @@ E.(tezos_pkh_encoding.input) rollup_id + in + let* ops = input @@ (Encodings.list_encoding E.op_encoding).input ops in + let ops = (Encodings.list_encoding E.op_encoding).decode ops in + let* computed_final_state = + foldM + (fun old_state op -> logic_op ~old_state ~rollup_id op) + old_state + ops + in + assert_equal computed_final_state new_state + + (** Fee circuit *) + let predicate_fees ~old_state ~new_state ~fees = + let* old_state = input ~public:true @@ Input.bool old_state in + let* new_state = input ~public:true @@ Input.bool new_state in + let* (_fees : scalar repr) = + input ~public:true + @@ E.((amount_encoding ~safety:Bounded_e.Unsafe).input) fees + in + assert_equal old_state new_state +end + +(** Basic rollup operator for generating Updates. *) +module Operator (Params : sig + val batch_size : int +end) : sig + open Protocol.Alpha_context + + (** Initial state of the rollup *) + val init_state : Zk_rollup.State.t + + (** Map associating every circuit identifier to its kind *) + val circuits : [`Public | `Private | `Fee] Plonk.SMap.t + + (** Commitment to the circuits *) + val public_parameters : Plonk.Main_protocol.verifier_public_parameters + + (** [craft_update state ~zk_rollup ?private_ops ?exit_validities public_ops] + will apply first the [public_ops], then the [private_ops]. While doing so, + the public inputs for every circuit will be collected. A Plonk proof of + correctness of the application these operations is created. *) + val craft_update : + Zk_rollup.State.t -> + zk_rollup:Zk_rollup.t -> + ?private_ops:Zk_rollup.Operation.t list list -> + ?exit_validities:bool list -> + Zk_rollup.Operation.t list -> + Zk_rollup.State.t * Zk_rollup.Update.t + + module Internal_for_tests : sig + val true_op : Zk_rollup.Operation.t + + val false_op : Zk_rollup.Operation.t + + val pending : Zk_rollup.Operation.t list + + val private_ops : Zk_rollup.Operation.t list list + + val update_data : Zk_rollup.Update.t + end +end = struct + open Protocol.Alpha_context + module SMap = Plonk.SMap + module Dummy = Types.P.Dummy + module T = Types.P + module VC = V (LibCircuit) + + let srs = + let open Bls12_381_polynomial in + (Srs.generate_insecure 9 1, Srs.generate_insecure 1 1) + + let dummy_l1_dst = + Hex.to_bytes_exn (`Hex "0002298c03ed7d454a101eb7022bc95f7e5f41ac78") + + let dummy_rollup_id = + let address = + Zk_rollup.Address.of_b58check_exn "epx18RJJqrYuJQqhB636BWvukU3XBNQGbtm8C" + in + Data_encoding.Binary.to_bytes_exn Zk_rollup.Address.encoding address + + let dummy_ticket_hash = Bytes.make 32 '0' + + let of_proto_state : Zk_rollup.State.t -> Types.P.state = + fun s -> Bls12_381.Fr.is_one s.(0) + + let to_proto_state : Types.P.state -> Zk_rollup.State.t = + fun s -> if s then [|Bls12_381.Fr.one|] else [|Bls12_381.Fr.zero|] + + let dummy_op = T.{header = Dummy.header; payload = false} + + let batch_name = "batch-" ^ string_of_int Params.batch_size + + (* Circuits that define the rollup, alongside their public input size and + solver *) + let circuit_map = + let get_circuit _name c = + let r = LibCircuit.get_cs ~optimize:true c in + let _initial, public_input_size = LibCircuit.get_inputs c in + ( Plonk.Circuit.to_plonk ~public_input_size r.cs, + public_input_size, + r.solver ) + in + SMap.of_list + @@ List.map + (fun (n, c) -> (n, get_circuit n c)) + [ + ( "op", + VC.predicate_op + ~old_state:false + ~new_state:true + ~fee:(T.Bounded.make ~bound:Bound.bound_fee Z.zero) + ~exit_validity:false + ~rollup_id:Dummy.tezos_pkh + dummy_op ); + ( batch_name, + VC.predicate_batch + ~old_state:false + ~new_state:true + ~fees:(T.Bounded.make ~bound:Bound.bound_amount Z.zero) + ~rollup_id:Dummy.tezos_pkh + (Stdlib.List.init Params.batch_size (Fun.const dummy_op)) ); + ( "fee", + VC.predicate_fees + ~old_state:false + ~new_state:false + ~fees:(T.Bounded.make ~bound:Bound.bound_amount Z.zero) ); + ] + + let circuits = + SMap.(add "op" `Public @@ add batch_name `Private @@ add "fee" `Fee empty) + + let prover_pp, public_parameters = + Plonk.Main_protocol.setup + ~zero_knowledge:false + (SMap.map (fun (a, b, _) -> (a, b)) circuit_map) + ~srs + + let insert s x m = + match SMap.find_opt s m with + | None -> SMap.add s [x] m + | Some l -> SMap.add s (x :: l) m + + let craft_update : + Zk_rollup.State.t -> + zk_rollup:Zk_rollup.t -> + ?private_ops:Zk_rollup.Operation.t list list -> + ?exit_validities:bool list -> + Zk_rollup.Operation.t list -> + Zk_rollup.State.t * Zk_rollup.Update.t = + fun s ~zk_rollup ?(private_ops = []) ?exit_validities pending -> + let s = of_proto_state s in + let rev_inputs = SMap.empty in + let exit_validities = + match exit_validities with + | None -> List.map (Fun.const true) pending + | Some l -> + assert (List.length l = List.length pending) ; + l + in + let _circ, _pi_size, op_solver = SMap.find "op" circuit_map in + (* Process the public operations *) + let s, rev_inputs, rev_pending_pis = + Stdlib.List.fold_left2 + (fun (s, rev_inputs, rev_pending_pis) op exit_validity -> + let new_state = + if s = of_proto_state Zk_rollup.Operation.(op.payload) then not s + else s + in + let fee = Bls12_381.Fr.zero in + let pi_to_send = + Zk_rollup.Update. + {new_state = to_proto_state new_state; fee; exit_validity} + in + let exit_validity_s = + if exit_validity then Bls12_381.Fr.one else Bls12_381.Fr.zero + in + let public_inputs = + Array.concat + [ + to_proto_state s; + to_proto_state new_state; + [|fee; exit_validity_s; Zk_rollup.to_scalar zk_rollup|]; + Zk_rollup.Operation.to_scalar_array op; + ] + in + let private_inputs = Solver.solve op_solver public_inputs in + ( new_state, + insert + "op" + Plonk.Main_protocol. + {public = public_inputs; witness = private_inputs} + rev_inputs, + ("op", pi_to_send) :: rev_pending_pis )) + (s, rev_inputs, []) + pending + exit_validities + in + let pending_pis = List.rev rev_pending_pis in + + let _circ, _pi_size, batch_solver = SMap.find batch_name circuit_map in + (* Process the private operation batches *) + let s, rev_inputs, rev_private_pis = + if private_ops = [] then (s, rev_inputs, []) + else + List.fold_left + (fun (s, rev_inputs, rev_private_pis) batch -> + let new_state = + List.fold_left + (fun s op -> + if s = of_proto_state Zk_rollup.Operation.(op.payload) then + not s + else s) + s + batch + in + let fees = Bls12_381.Fr.zero in + let pi_to_send : Zk_rollup.Update.private_inner_pi = + Zk_rollup.Update.{new_state = to_proto_state new_state; fees} + in + let public_inputs = + Array.concat + [ + to_proto_state s; + to_proto_state new_state; + [|fees; Zk_rollup.to_scalar zk_rollup|]; + ] + in + let initial = + Array.concat + ([public_inputs] + @ List.map Zk_rollup.Operation.to_scalar_array batch) + in + let private_inputs = Solver.solve batch_solver initial in + ( new_state, + insert + batch_name + Plonk.Main_protocol. + {public = public_inputs; witness = private_inputs} + rev_inputs, + (batch_name, pi_to_send) :: rev_private_pis )) + (s, rev_inputs, []) + private_ops + in + let private_pis = List.rev rev_private_pis in + (* Dummy fee circuit *) + let _circ, _pi_size, fee_solver = SMap.find "fee" circuit_map in + let rev_inputs, fee_pi = + let fee_pi = Zk_rollup.Update.{new_state = to_proto_state s} in + let fees = Bls12_381.Fr.zero in + + let public_inputs = + Array.concat [to_proto_state s; to_proto_state s; [|fees|]] + in + let private_inputs = Solver.solve fee_solver public_inputs in + ( insert + "fee" + Plonk.Main_protocol.{public = public_inputs; witness = private_inputs} + rev_inputs, + fee_pi ) + in + let inputs = SMap.map List.rev rev_inputs in + + let proof = Plonk.Main_protocol.prove prover_pp ~inputs in + let verifier_inputs = + Plonk.SMap.map + (List.map (fun Plonk.Main_protocol.{public; witness = _} -> public)) + inputs + in + assert ( + Plonk.Main_protocol.verify public_parameters ~inputs:verifier_inputs proof) ; + ( to_proto_state s, + Zk_rollup.Update.{pending_pis; private_pis; fee_pi; proof} ) + + let init_state = to_proto_state false + + module Internal_for_tests = struct + let true_op = + Zk_rollup.Operation. + { + op_code = 0; + price = + (let id = + Data_encoding.Binary.of_bytes_exn + Ticket_hash.encoding + dummy_ticket_hash + in + {id; amount = Z.zero}); + l1_dst = + Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Signature.Public_key_hash.encoding + dummy_l1_dst; + rollup_id = + Data_encoding.Binary.of_bytes_exn + Zk_rollup.Address.encoding + dummy_rollup_id; + payload = [|Bls12_381.Fr.one|]; + } + + let false_op = {true_op with payload = [|Bls12_381.Fr.zero|]} + + let pending = [false_op; true_op; true_op] + + let n_batches = 10 + + let private_ops = + Stdlib.List.init n_batches @@ Fun.const + @@ Stdlib.List.init Params.batch_size (fun i -> + if i mod 2 = 0 then false_op else true_op) + + let update_data = + snd + @@ craft_update + init_state + ~zk_rollup: + (Data_encoding.Binary.of_bytes_exn + Zk_rollup.Address.encoding + dummy_rollup_id) + ~private_ops + pending + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune new file mode 100644 index 000000000000..e0b06837bd91 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune @@ -0,0 +1,33 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_alpha_test_helpers) + (public_name tezos-alpha-test-helpers) + (instrumentation (backend bisect_ppx)) + (libraries + alcotest-lwt + qcheck-alcotest + tezos-test-helpers + tezos-base + tezos-micheline + tezos-stdlib-unix + tezos-protocol-016-PtMumbai + tezos-client-alpha + tezos-protocol-016-PtMumbai.parameters + tezos-protocol-environment + tezos-protocol-plugin-alpha + tezos-shell-services + tezos-plompiler + tezos-crypto-dal) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_micheline + -open Tezos_stdlib_unix + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_shell_services + -open Tezos_crypto_dal)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.ml new file mode 100644 index 000000000000..9157c0b35a25 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.ml @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let ( >>=?? ) x y = + x >>= function + | Ok s -> y s + | Error err -> Lwt.return @@ Error (Environment.wrap_tztrace err) + +let ( >|=?? ) m f = m >>=?? fun x -> return (f x) + +let ( >>??= ) x y = + match x with + | Ok s -> y s + | Error err -> Lwt.return @@ Error (Environment.wrap_tztrace err) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.mli new file mode 100644 index 000000000000..bf0726c160b2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/error_monad_operators.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val ( >>=?? ) : + ('a, Environment.Error_monad.error Environment.Error_monad.trace) result Lwt.t -> + ('a -> ('b, error trace) result Lwt.t) -> + ('b, error trace) result Lwt.t + +val ( >|=?? ) : + ('a, Environment.Error_monad.error Environment.Error_monad.trace) result Lwt.t -> + ('a -> 'b) -> + ('b, error trace) result Lwt.t + +val ( >>??= ) : + ('a, Environment.Error_monad.error Environment.Error_monad.trace) result -> + ('a -> ('b, error trace) result Lwt.t) -> + ('b, error trace) result Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr.ml new file mode 100644 index 000000000000..468d09535ae8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr.ml @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +exception Expression_from_string + +(** Parse a Michelson expression from string, raising an exception on error. *) +let from_string ?(check_micheline_indentation = false) str : Script.expr = + let ast, errs = + Michelson_v1_parser.parse_expression ~check:check_micheline_indentation str + in + (match errs with + | [] -> () + | lst -> + Format.printf "expr_from_string: %a\n" Error_monad.pp_print_trace lst ; + raise Expression_from_string) ; + ast.expanded + +(** Parses a Michelson contract from string, raising an exception on error. *) +let toplevel_from_string ?(check_micheline_indentation = false) str = + let ast, errs = + Michelson_v1_parser.parse_toplevel ~check:check_micheline_indentation str + in + match errs with [] -> ast.expanded | _ -> Stdlib.failwith "parse toplevel" + +let to_string c = Format.asprintf "%a" Michelson_v1_printer.print_expr c diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr_common.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr_common.ml new file mode 100644 index 000000000000..e6444892c600 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/expr_common.ml @@ -0,0 +1,98 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* From OCaml values to Micheline expressions *) + +let seq ?(loc = 0) l = Tezos_micheline.Micheline.Seq (loc, l) + +let pair ?(loc = 0) a b = + Tezos_micheline.Micheline.Prim (loc, Script.D_Pair, [a; b], []) + +let pair_n ?(loc = 0) els = + Tezos_micheline.Micheline.Prim (loc, Script.D_Pair, els, []) + +let comb ?(loc = 0) es = + Tezos_micheline.Micheline.Prim (loc, Script.D_Pair, es, []) + +let none ?(loc = 0) () = + Tezos_micheline.Micheline.Prim (loc, Script.D_None, [], []) + +let some ?(loc = 0) a = + Tezos_micheline.Micheline.Prim (loc, Script.D_Some, [a], []) + +let left ?(loc = 0) a = + Tezos_micheline.Micheline.Prim (loc, Script.D_Left, [a], []) + +let right ?(loc = 0) b = + Tezos_micheline.Micheline.Prim (loc, Script.D_Right, [b], []) + +let unit ?(loc = 0) () = + Tezos_micheline.Micheline.Prim (loc, Script.D_Unit, [], []) + +let int ?(loc = 0) i = Tezos_micheline.Micheline.Int (loc, i) + +let bytes ?(loc = 0) s = Tezos_micheline.Micheline.Bytes (loc, s) + +let string ?(loc = 0) s = Tezos_micheline.Micheline.String (loc, s) + +let mutez ?(loc = 0) m = int ~loc (Z.of_int64 (Tez.to_mutez m)) + +(* Translate a timestamp to a Micheline expression in optimized + form *) +let timestamp ?(loc = 0) ts = int ~loc (Script_timestamp.to_zint ts) + +let address ?(loc = 0) adr = + bytes ~loc @@ Data_encoding.Binary.to_bytes_exn Contract.encoding adr + +let address_string ?(loc = 0) adr = string ~loc @@ Contract.to_b58check adr + +let big_map_id ?(loc = 0) id = int ~loc @@ Big_map.Id.unparse_to_z id + +(* From Micheline expressions to OCaml values *) + +let timestamp_of_zint zint = Script_timestamp.of_zint zint + +let public_key_of_bytes_exn b = + Data_encoding.Binary.of_bytes_exn Tezos_crypto.Signature.Public_key.encoding b + +let address_of_bytes_exn b = + Data_encoding.Binary.of_bytes_exn Contract.encoding b + +type exn += Invalid_address_expr of string + +let address_of_string_exn s = + match Contract.of_b58check s with + | Ok c -> c + | Error _ -> raise @@ Invalid_address_expr s + +let originated_of_string_exn s = + match address_of_string_exn s with + | Contract.Originated addr -> addr + | Contract.Implicit _ -> + invalid_arg + "Expected originated contract address, got implicit contract address" diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.ml new file mode 100644 index 000000000000..1cf523719e41 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.ml @@ -0,0 +1,291 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +module Proto_Nonce = Nonce (* Renamed otherwise is masked by Alpha_context *) +open Alpha_context + +type t = { + predecessor : Block.t; + state : validation_state * application_state; + rev_operations : Operation.packed list; + rev_tickets : operation_receipt list; + header : Block_header.t; + delegate : Account.t; +} + +type incremental = t + +let predecessor {predecessor; _} = predecessor + +let header {header; _} = header + +let rev_tickets {rev_tickets; _} = rev_tickets + +let validation_state {state = vs, _; _} = vs + +let level st = st.header.shell.level + +let alpha_ctxt {state = _, application_state; _} = application_state.ctxt + +let rpc_context st = + let fitness = (header st).shell.fitness in + let result = Alpha_context.finalize (alpha_ctxt st) fitness in + { + Environment.Updater.block_hash = Tezos_crypto.Block_hash.zero; + block_header = {st.header.shell with fitness = result.fitness}; + context = result.context; + } + +let rpc_ctxt = + new Environment.proto_rpc_context_of_directory + rpc_context + Plugin.RPC.rpc_services + +let set_alpha_ctxt st ctxt = + {st with state = (fst st.state, {(snd st.state) with ctxt})} + +let begin_validation_and_application ctxt chain_id mode ~predecessor = + let open Lwt_result_syntax in + let* validation_state = begin_validation ctxt chain_id mode ~predecessor in + let* application_state = begin_application ctxt chain_id mode ~predecessor in + return (validation_state, application_state) + +let begin_construction ?timestamp ?seed_nonce_hash ?(mempool_mode = false) + ?(policy = Block.By_round 0) (predecessor : Block.t) = + Block.get_next_baker ~policy predecessor + >>=? fun (delegate, _consensus_key, round, real_timestamp) -> + Account.find delegate >>=? fun delegate -> + Round.of_int round |> Environment.wrap_tzresult >>?= fun payload_round -> + let timestamp = Option.value ~default:real_timestamp timestamp in + (match seed_nonce_hash with + | Some _hash -> return seed_nonce_hash + | None -> ( + Plugin.RPC.current_level ~offset:1l Block.rpc_ctxt predecessor + >|=? function + | {expected_commitment = true; _} -> Some (fst (Proto_Nonce.generate ())) + | {expected_commitment = false; _} -> None)) + >>=? fun seed_nonce_hash -> + let contents = + Block.Forge.contents + ?seed_nonce_hash + ~payload_hash:Block_payload_hash.zero + ~payload_round + () + in + let mode = + if mempool_mode then + Partial_construction {predecessor_hash = predecessor.hash; timestamp} + else + let block_header_data = + {Block_header.contents; signature = Tezos_crypto.Signature.zero} + in + Construction + {predecessor_hash = predecessor.hash; timestamp; block_header_data} + in + let header = + { + Block_header.shell = + { + predecessor = predecessor.hash; + proto_level = predecessor.header.shell.proto_level; + validation_passes = predecessor.header.shell.validation_passes; + fitness = predecessor.header.shell.fitness; + timestamp; + level = predecessor.header.shell.level; + context = Tezos_crypto.Context_hash.zero; + operations_hash = Tezos_crypto.Operation_list_list_hash.zero; + }; + protocol_data = {contents; signature = Tezos_crypto.Signature.zero}; + } + in + begin_validation_and_application + predecessor.context + Tezos_crypto.Chain_id.zero + mode + ~predecessor:predecessor.header.shell + >|= fun state -> + Environment.wrap_tzresult state >|? fun state -> + {predecessor; state; rev_operations = []; rev_tickets = []; header; delegate} + +let detect_script_failure : + type kind. kind Apply_results.operation_metadata -> _ = + let rec detect_script_failure : + type kind. kind Apply_results.contents_result_list -> _ = + let open Apply_results in + let open Apply_operation_result in + let open Apply_internal_results in + let detect_script_failure_single (type kind) + (Manager_operation_result + {operation_result; internal_operation_results; _} : + kind Kind.manager Apply_results.contents_result) = + let detect_script_failure (type kind) + (result : (kind, _, _) operation_result) = + match result with + | Applied _ -> Ok () + | Skipped _ -> assert false + | Backtracked (_, None) -> + (* there must be another error for this to happen *) + Ok () + | Backtracked (_, Some errs) -> Error (Environment.wrap_tztrace errs) + | Failed (_, errs) -> Error (Environment.wrap_tztrace errs) + in + detect_script_failure operation_result >>? fun () -> + List.iter_e + (fun (Internal_operation_result (_, r)) -> detect_script_failure r) + internal_operation_results + in + function + | Single_result (Manager_operation_result _ as res) -> + detect_script_failure_single res + | Single_result _ -> Ok () + | Cons_result (res, rest) -> + detect_script_failure_single res >>? fun () -> + detect_script_failure rest + in + fun {contents} -> detect_script_failure contents + +let check_operation_size ?(check_size = true) op = + if check_size then + let operation_size = Data_encoding.Binary.length Operation.encoding op in + if operation_size > Constants_repr.max_operation_data_length then + raise + (invalid_arg + (Format.sprintf + "The operation size is %d: it exceeds the constant maximum size \ + %d." + operation_size + Constants_repr.max_operation_data_length)) + +let validate_operation ?expect_failure ?check_size st op = + let open Lwt_result_syntax in + check_operation_size ?check_size op ; + let validation_state, application_state = st.state in + let oph = Operation.hash_packed op in + let*! res = validate_operation validation_state oph op in + match (expect_failure, Environment.wrap_tzresult res) with + | Some _, Ok _ -> failwith "Error expected while validating operation" + | Some f, Error err -> + let* () = f err in + return st + | None, Error err -> fail err + | None, Ok validation_state -> + return {st with state = (validation_state, application_state)} + +let add_operation ?expect_failure ?expect_apply_failure ?allow_manager_failure + ?check_size st op = + let open Lwt_result_syntax in + let open Apply_results in + let* st = validate_operation ?expect_failure ?check_size st op in + match expect_failure with + | Some _ -> + (* The expected failure has already been observed in + [validate_operation]. *) + return st + | None -> ( + let validation_state, application_state = st.state in + let oph = Operation.hash_packed op in + let*! res = apply_operation application_state oph op in + let*? application_state, metadata = Environment.wrap_tzresult res in + let st = + { + st with + state = (validation_state, application_state); + rev_operations = op :: st.rev_operations; + rev_tickets = metadata :: st.rev_tickets; + } + in + match allow_manager_failure with + | Some true -> return st + | None | Some false -> ( + match (expect_apply_failure, metadata) with + | None, No_operation_metadata -> return st + | None, Operation_metadata result -> + let*? () = detect_script_failure result in + return st + | Some _, No_operation_metadata -> + failwith "Error expected while adding operation" + | Some f, Operation_metadata result -> ( + match detect_script_failure result with + | Ok _ -> failwith "Error expected while adding operation" + | Error err -> + let* () = f err in + return st))) + +let finalize_validation_and_application (validation_state, application_state) + shell_header = + let open Lwt_result_syntax in + let* () = finalize_validation validation_state in + finalize_application application_state shell_header + +let finalize_block st = + let open Lwt_result_syntax in + let operations = List.rev st.rev_operations in + let operations_hash = + Tezos_crypto.Operation_list_list_hash.compute + [ + Tezos_crypto.Operation_list_hash.compute + (List.map Operation.hash_packed operations); + ] + in + let shell_header = + { + st.header.shell with + level = Int32.succ st.header.shell.level; + operations_hash; + } + in + let*! res = + finalize_validation_and_application st.state (Some shell_header) + in + let*? validation_result, _ = Environment.wrap_tzresult res in + let operations = List.rev st.rev_operations in + let operations_hash = + Tezos_crypto.Operation_list_list_hash.compute + [ + Tezos_crypto.Operation_list_hash.compute + (List.map Operation.hash_packed operations); + ] + in + let header = + { + st.header with + shell = + { + st.header.shell with + level = Int32.succ st.header.shell.level; + operations_hash; + fitness = validation_result.fitness; + }; + } + in + let hash = Block_header.hash header in + return {Block.hash; header; operations; context = validation_result.context} + +let assert_validate_operation_fails expect_failure op block = + let open Lwt_result_syntax in + let* i = begin_construction block in + let* (_i : incremental) = validate_operation ~expect_failure i op in + return_unit diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.mli new file mode 100644 index 000000000000..1be5fc3dff6b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/incremental.mli @@ -0,0 +1,136 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type t + +type incremental = t + +val predecessor : incremental -> Block.t + +val header : incremental -> Block_header.t + +val rev_tickets : incremental -> operation_receipt list + +val validation_state : incremental -> validation_state + +val level : incremental -> int32 + +(** [begin_construction ?mempool_mode predecessor] uses + {!Main.begin_validation_and_application} to create a validation and + application state on top of [predecessor] for the construction of a + new block. + + Optional arguments allow to override defaults: + + {ul {li [?mempool_mode:bool]: when [true], use [Partial_construction] + mode. By default, it is [false] and the mode is [Construction].}} *) +val begin_construction : + ?timestamp:Time.Protocol.t -> + ?seed_nonce_hash:Nonce_hash.t -> + ?mempool_mode:bool -> + ?policy:Block.baker_policy -> + Block.t -> + incremental tzresult Lwt.t + +(** [validate_operation ?expect_failure ?check_size i op] tries to + validate [op] in the validation state of [i]. If the validation + succeeds, the function returns the incremental value with a + validation state updated after the validate. Otherwise raise the + error from the validation of [op]. + + Optional arguments allow to override defaults: + + {ul {li [?expect_failure:(error list -> unit tzresult Lwt.t)]: + validation of [op] is expected to fail and [expect_failure] should + handle the error. In case validate does not fail and an + [expect_failure] is provided, [validate_operation] fails.} + + {li [?check_size:bool]: enable the check that an operation size + should not exceed [Constants_repr.max_operation_data_length]. + Enabled (set to [true]) by default. }} *) +val validate_operation : + ?expect_failure:(error list -> unit tzresult Lwt.t) -> + ?check_size:bool -> + incremental -> + Operation.packed -> + incremental tzresult Lwt.t + +(** [add_operation ?expect_failure ?expect_apply_failure + ?allow_manager_failure ?check_size i op] tries to validate then + apply [op] in the validation and application state of [i]. If the + validation of [op] succeeds, the function returns the incremental + value with a validation state updated after the application of + [op]. Otherwise raise the error from the validation of [op]. + + Optional arguments allow to override defaults: + + {ul {li [?expect_failure:(error list -> unit tzresult Lwt.t)]: + validation of [op] is expected to fail and [expect_failure] should + handle the error. In case validate does not fail and + [expect_failure] is provided, [validate_operation] fails.}} + + {ul {li [?expect_apply_failure:(error list -> unit tzresult + Lwt.t)]: application of [op] is expected to fail and + [expect_apply_failure] should handle the errror. In case the + application of [op] does not fail and [expect_apply_failure] is + provided, [add_operation] fails.}} + + {ul {li [?allow_manager_failure] marks that manager operation + failures after fee taken are ignored.}} + + {li [?check_size:bool]: enable the check that an operation size + should not exceed [Constants_repr.max_operation_data_length]. + Enabled (set to [true]) by default. } *) +val add_operation : + ?expect_failure:(error list -> unit tzresult Lwt.t) -> + ?expect_apply_failure:(error list -> unit tzresult Lwt.t) -> + ?allow_manager_failure:bool -> + ?check_size:bool -> + incremental -> + Operation.packed -> + incremental tzresult Lwt.t + +(** [finalize_block i] creates a [Block.t] based on the protocol + states and the operations contained in [i]. The function calls + [Main.finalize_application] to compute a new context. *) +val finalize_block : incremental -> Block.t tzresult Lwt.t + +(** [assert_validate_operation_fails expect_failure operation block] + calls {!begin_construction} on top of [block], then + {!validate_operation} with [~expect_failure]. *) +val assert_validate_operation_fails : + (tztrace -> unit tzresult Lwt.t) -> + Operation.packed -> + Block.t -> + unit tzresult Lwt.t + +val rpc_ctxt : incremental Environment.RPC_context.simple + +val alpha_ctxt : incremental -> Alpha_context.context + +val set_alpha_ctxt : incremental -> Alpha_context.context -> incremental diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.ml new file mode 100644 index 000000000000..ea3ce8c3963a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.ml @@ -0,0 +1,328 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Liquidity_baking_machine +open QCheck2.Gen +open Lib_test + +let total_xtz = 32_000_000_000_000L + +let ten_subsidies = 25_000_000L + +let rec remove_last_element = function + | [_] -> [] + | x :: rst -> x :: remove_last_element rst + | [] -> raise (Invalid_argument "remove_last_element") + +(** Try to shrink a list by removing elements from the tail of said + list. + + The elements themselves are not shrinked. *) +let rec shrink_list l = + if l == [] then Seq.empty + else + let l = remove_last_element l in + Seq.cons l (shrink_list l) + +let gen_balances : int64 -> int -> int -> balances QCheck2.Gen.t = + fun max_xtz max_tzbtc max_liquidity -> + let open Qcheck2_helpers in + let+ xtz = int64_strictly_positive_gen max_xtz + and+ tzbtc = int_strictly_positive_gen max_tzbtc + and+ liquidity = int_strictly_positive_gen max_liquidity in + {xtz; tzbtc; liquidity} + +let gen_specs : int -> int -> specs QCheck2.Gen.t = + fun total_tzbtc total_liquidity -> + (* 1. We pick a random number to decide how many implicit account we + will set-up in the specs. Note that there will be one more + implicit accounts, the [Holder], that we will use to reach the + expected balances for the CPMM and the implicit accounts. *) + let* accounts_numbers = int_range 10 20 in + (* 2. To keep the generator simpler, we do not try to strictly reach + the [total_tzbtc] and [total_liquidity] value, but rather we + compute maxima for the implicit accounts balances from + them. *) + (* 2.1. We divide a fraction of the [total_xtz] that we need to + share to the implicit accounts. The rationale is to provide + a large amount to xtz to [Holder], so that we do not have to + worry about it being “rich enough.” *) + let max_xtz = Int64.(div total_xtz (of_int (50 * accounts_numbers))) in + (* 2.2. We divide [total_tzbtc] between the implicit accounts *and* + the CPMM contract. *) + let max_tzbtc = total_tzbtc / (accounts_numbers + 1) in + (* 2.2. We divide [total_liquidity] between the implicit accounts only. *) + let max_liquidity = total_liquidity / accounts_numbers in + let+ cpmm_balance = gen_balances max_xtz max_tzbtc 1 + and+ accounts_balances = + list_repeat accounts_numbers (gen_balances max_xtz max_tzbtc max_liquidity) + in + { + cpmm_min_xtz_balance = cpmm_balance.xtz; + cpmm_min_tzbtc_balance = cpmm_balance.tzbtc; + accounts_balances; + } + +type 'a optgen = 'a option QCheck2.Gen.t + +let ( let*? ) (m : 'a optgen) (f : 'a -> 'b optgen) = + let* x = m in + match x with None -> return None | Some x -> f x + +(** [genopt_oneof l] tries to generate a value using the generators of + [l], one at a time. + + First, the list [l] is randomized, then each generator is + tried. The first one to return a result (not [None]) is picked. If + all generators returns [None], the generators tries again with the + whole list (at most 100 times). If no generator of [l] is able to + return a result, then [genopt_oneof l] returns [None]. *) +let genopt_oneof (l : 'a optgen list) : 'a optgen = + let* l = QCheck2.Gen.shuffle_l l in + let rec aux n = function + | [] -> if n = 0 then pure None else aux (n - 1) l + | g :: l -> ( + let* x = g in + match x with None -> aux n l | Some x -> pure @@ Some x) + in + aux 100 l + +let genopt_account ?choice ?(filter = Fun.const true) env : contract_id optgen = + let l = + List.filter + filter + (Option.fold ~none:env.implicit_accounts ~some:(fun x -> [x]) choice) + in + if l = [] then return None else map Option.some (oneofl l) + +let genopt_account_with_tzbtc ?choice ?(min = 1) env state = + genopt_account + ?choice + ~filter:(fun a -> SymbolicMachine.get_tzbtc_balance a env state >= min) + env + +let genopt_account_with_xtz ?choice ?(min = 1L) env state = + genopt_account + ?choice + ~filter:(fun a -> SymbolicMachine.get_xtz_balance a state >= min) + env + +let genopt_account_with_liquidity ?choice ?(min = 1) env state = + genopt_account + ?choice + ~filter:(fun a -> SymbolicMachine.get_liquidity_balance a env state >= min) + env + +let genopt_step_tzbtc_to_xtz : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + contract_id step optgen = + fun ?source ?destination env state -> + let*? source = genopt_account_with_tzbtc ?choice:source env state in + let*? destination = genopt_account ?choice:destination env in + let+ tzbtc_deposit = + Qcheck2_helpers.int_strictly_positive_gen + (SymbolicMachine.get_tzbtc_balance source env state) + in + (* See note (2) *) + if + SymbolicMachine.get_tzbtc_balance env.cpmm_contract env state + < Int.max_int - tzbtc_deposit + then Some (SellTzBTC {source; destination; tzbtc_deposit}) + else None + +let genopt_step_xtz_to_tzbtc : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + contract_id step optgen = + fun ?source ?destination env state -> + let*? source = genopt_account_with_xtz ?choice:source env state in + let*? destination = genopt_account ?choice:destination env in + let+ xtz_deposit = + map + Int64.of_int + (int_range + 1 + (Int64.to_int @@ SymbolicMachine.get_xtz_balance source state)) + in + (* See note (2) *) + if + SymbolicMachine.get_xtz_balance env.cpmm_contract state + < Int64.(sub max_int (add ten_subsidies xtz_deposit)) + then Some (BuyTzBTC {source; destination; xtz_deposit}) + else None + +let genopt_step_add_liquidity : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + contract_id step optgen = + fun ?source ?destination env state -> + let rec find_xtz_deposit candidate max_tzbtc_deposit = + let tzbtc_deposit = + SymbolicMachine.predict_required_tzbtc_deposit candidate env state + in + if tzbtc_deposit <= max_tzbtc_deposit then candidate + else find_xtz_deposit (Int64.div candidate 2L) max_tzbtc_deposit + in + let*? source = genopt_account_with_xtz ?choice:source env state in + let*? destination = genopt_account ?choice:destination env in + let source_xtz_pool = SymbolicMachine.get_xtz_balance source state in + (* the source needs at least one xtz *) + if 1L < source_xtz_pool then + let+ candidate = + Qcheck2_helpers.int64_strictly_positive_gen source_xtz_pool + in + let xtz_deposit = + find_xtz_deposit + candidate + (SymbolicMachine.get_tzbtc_balance source env state) + in + (* See note (2) *) + if + SymbolicMachine.get_xtz_balance env.cpmm_contract state + < Int64.(sub max_int (add ten_subsidies xtz_deposit)) + then Some (AddLiquidity {source; destination; xtz_deposit}) + else None + else pure None + +let genopt_step_remove_liquidity : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + contract_id step optgen = + fun ?source ?destination env state -> + let*? source = genopt_account_with_liquidity ?choice:source env state in + let*? destination = genopt_account ?choice:destination env in + let lqt_available = SymbolicMachine.get_liquidity_balance source env state in + if 1 < lqt_available then + let+ lqt_burned = + int_range 1 (SymbolicMachine.get_liquidity_balance source env state) + in + Some (RemoveLiquidity {source; destination; lqt_burned}) + else return None + +let genopt_step : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + contract_id step optgen = + fun ?source ?destination env state -> + genopt_oneof + [ + genopt_step_tzbtc_to_xtz env state ?source ?destination; + genopt_step_xtz_to_tzbtc env state ?source ?destination; + genopt_step_add_liquidity env state ?source ?destination; + genopt_step_remove_liquidity env state ?source ?destination; + ] + +let gen_steps : + ?source:contract_id -> + ?destination:contract_id -> + contract_id env -> + SymbolicMachine.t -> + int -> + contract_id step list QCheck2.Gen.t = + fun ?source ?destination env state size -> + let rec inner env state size random_state = + if size <= 0 then [] + else + let h = + QCheck2.Gen.generate1 + ~rand:random_state + (genopt_step ?source ?destination env state) + in + match h with + | None -> [] + | Some h -> + let state = SymbolicMachine.step h env state in + let rst = inner env state (size - 1) random_state in + h :: rst + in + QCheck2.Gen.make_primitive ~gen:(inner env state size) ~shrink:(fun l -> + shrink_list l) + +let gen_scenario : + tzbtc -> liquidity -> int -> (specs * contract_id step list) QCheck2.Gen.t = + fun total_tzbtc total_liquidity size -> + let* specs = gen_specs total_tzbtc total_liquidity in + let state, env = SymbolicMachine.build specs in + let+ scenario = gen_steps env state size in + (specs, scenario) + +let pp_scenario fmt (specs, steps) = + Format.( + fprintf + fmt + "@[<v>{@ @[<v 2> @[<v 2>specs@ = %a;@]@ @[<v 2>steps@ = @[<v>[ \ + %a]@]@]@]}@]" + pp_specs + specs + (pp_print_list + ~pp_sep:(fun fmt _ -> fprintf fmt "@ ; ") + (pp_step pp_contract_id)) + steps) + +let print_scenario = Format.asprintf "%a" pp_scenario + +let gen_adversary_scenario : + tzbtc -> + liquidity -> + int -> + (specs * contract_id * contract_id step list) QCheck2.Gen.t = + fun total_tzbtc total_liquidity size -> + let* specs = gen_specs total_tzbtc total_liquidity in + let state, env = SymbolicMachine.build ~subsidy:0L specs in + let* c = oneofl env.implicit_accounts in + let+ scenario = gen_steps ~source:c ~destination:c env state size in + (specs, c, scenario) + +let print_adversary_scenario (specs, _, steps) = + Format.asprintf "%a" pp_scenario (specs, steps) + +(* -------------------------------------------------------------------------- *) + +(* Note (1) + + We shrink a valid scenario by removing steps from its tails, + because a prefix of a valid scenario remains a valid + scenario. Removing a random element of a scenario could lead to an + invalid scenario. We have to use QCheck2.Gen.make_primitive to specify + the shrinking method of the generator, and avoid defaulting on the + shrinking implied by QCheck2.Gen.bind *) + +(* Note (2) + + If we are not being careful, it is possible to provoke an overflow + in the xtzPool and tzbtcPool. We try to avoid that as much as + possible by being very careful with the steps that are likely to + add xtz to the contract. *) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.mli new file mode 100644 index 000000000000..02a0a12ebc93 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_generator.mli @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides a set of abstractions to reason about the + so-called “liquidity baking” feature[1]. + + [1]: https://gitlab.com/tezos/tzip/-/blob/367628e1a576c3926bedc1d6107b2945607c2605/drafts/current/draft-liquidity_baking.md + + We remind that this feature is built upon three smart contracts: + (1) a CPMM contract initially based on Dexter 2, and (2) two + tokens contracts. + + Our purpose for Liquidity Baking is to easily express and test + invariants regarding the execution of these contracts. To that + end, we have introduced a set of dedicated types to describe + arbitrary contexts in terms of account balances (see + [Liquidity_baking_machine.specs]), along with [build] functions + that turn a description of a context into concrete states. + + In this module, we provide QCheck2 generators which allow to + construct arbitrary specifications for states, and so-called + scenarios ({i i.e.}, sequences of entrypoint calls). *) + +open Liquidity_baking_machine + +(** [gen_specs max_tzbtc max_liquidity] constructs arbitrary Liquidity + Baking [specs] for an initial state, where at most [max_tzbtc] and + [max_liquidity] are shared among an arbitrary number of implicit + accounts. *) +val gen_specs : tzbtc -> liquidity -> specs QCheck2.Gen.t + +(** [gen_scenario max_tzbtc max_liquidity size] constructs arbitrary + Liquidity Baking [specs] with a semantics similar to [gen_specs], along with sequences of {b valid} + scenarios ({i i.e.}, sequences of entrypoint calls) of length + [size]. By valid, we mean that running the scenario using a + Liquidity baking machine initialized with the [specs] should + succeed. *) +val gen_scenario : + tzbtc -> liquidity -> int -> (specs * contract_id step list) QCheck2.Gen.t + +(** [print_scenario scenario] produces a string representation of [scenario], + as produced by [gen_scenario]. *) +val print_scenario : specs * contract_id step list -> string + +(** [gen_adversary_scenario max_tzbtc max_liquidity size] constructs + arbitrary scenarios that can be used to challenge the “no global + gain” property of Liquidity Baking. + + The key idea of this property is the following: a given contract + cannot profit from Liquidity Baking if they are the only one to + interact with the CPMM (in the absence of subsidies). The scenario + generated by [gen_adversary_scenario] only consists in [step] + performed by one contract. This contract is identified by the + [contract_id] returned by this function. *) +val gen_adversary_scenario : + tzbtc -> + liquidity -> + int -> + (specs * contract_id * contract_id step list) QCheck2.Gen.t + +(** [print_adversary_scenario scenario] produces a string representation of [scenario], + as produced by [gen_adversary_scenario]. *) +val print_adversary_scenario : + specs * contract_id * contract_id step list -> string diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.ml new file mode 100644 index 000000000000..47c4579363d9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.ml @@ -0,0 +1,1362 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** To implement the interface of this module, as described and + documented in the related MLI file, we rely on the OCaml module + system. More precisely, most of the implementation of the two + public machines ([ValidationMachine] and [SymbolicMachine]) is + derived by means of functors. + + The machines provide two key functions which can be used in a + test suite: + + - [M.build specs] which allows to construct an initial state of + a machine [M] that satisfies the properties described by + [specs] (along with the so-called “environment” of the + machine) + - [M.step s env state] (resp. [M.run]) which allows to execute a + so-called scenario [step] (resp. a sequence of [step]s, {i + i.e.}, a complete scenario) by the machine [M] from the state + [state]. + + The module is organized as follows: + + 1. We introduce the necessary abstractions we later use to + specify the properties the initial state of a given machine + needs to satisfy (most notably the [specs] type). + 2. Then, we introduce the [step] type, which describes the + various actions we can make a machine perform as part of a + more complete scenario. + 3. We introduce the [MACHINE] module type which lists the + necessary types and functions we need to derive a machine + capable of executing scenarios, and the [Machine.Make] + functor that we can use to derive such a machine + automatically. + 4. We introduce the [MACHINE_WITH_INIT] module type which is a + superset of [MACHINE], extended with an [init] function + (analogous to {! Context.init_n}) to create an initial, mostly + blank state, and the [MachineBuilder.Make] functor that we + can use to derive a machine with a [build] function. + 5. We construct the [ConcreteMachine], that allows to + asynchronously execute scenarios against the Tezos + blockchain. + 6. We implement the [AbstractMachine.Make] functor, which we + can use to construct machines that can simulate the + execution scenarios completely off-chains, by reimplementing + the LB features logic in pure OCaml. + 7. We use [AbstractMachine.Make] to create the [SymbolicMachine]. + 8. We use the [AbstractMachine.Make] functor in conjuction with + the [ConcreteMachine] to introduce the [ValidationMachine]. + + _ + / \ A warning for developers willing to modify this module: + / | \ dealing with the subsidy of the Liquidity Baking (LB) + / · \ feature is probably the main source of complexity and + /_______\ fragility of this module. + + At several places (marked with a /!\ note), we need to predict the + xtz pool of the CPMM contract, in order to compute the amount of + tzBTC token it will provide or request. To make this prediction, + we need to determine how many blocks have been/will be baked. This + means that each time we modify the code of the machine functors, + we will probably have to modify the code marked with /!\ too. + + To reduce the potential to get things wrong, we have introduced + constants to prevent the use of “magic numbers” (numbers whose + meaning cannot be guessed only by looking at the formula). The + value of these constants is not statically checked, so pay extra + attention before modifying them. + + Ideally, we could probably compute these magic numbers using a + dedicated machine, whose purpose would be to count the number of + call to the [bake] function. For the sake of simplicity, we do not + do it currently. *) + +(** The number of blocks baked in order to execute the {! + AddLiquidity} step. *) +let blocks_per_add_liquidity_step = 2L + +(** The number of blocks baked by the [init] function. Since + Tenderbake, we need to compensate for deposits, so the number is + no longer constant. It is linear wrt. the number of accounts. *) +let blocks_during_init len = Int64.add 3L len + +(** The number of blocks baked by the [mint_tzbtc] functions *) +let blocks_per_mint_tzbtc = 1L + +(** A timestamp “far in the future” which should not be exceeded when + running tests. *) +let far_future = Script_timestamp.of_zint (Z.of_int 42_000) +(* Hypothesis: the tests start at timestamp 0, and 42000 is + “big enough.” *) + +(* --------------------------------------------------------------------------- *) + +(** {1 Miscellaneous Helpers} *) +module List_helpers = struct + let rec zip l r = + match (l, r) with + | xl :: rstl, xr :: rstr -> (xl, xr) :: zip rstl rstr + | _ -> [] + + let nth_exn l n = + match List.nth l n with + | Some x -> x + | _ -> raise (Invalid_argument "nth_exn") + + let assoc_exn c l = + match List.assoc ~equal:( = ) c l with + | Some x -> x + | _ -> raise (Invalid_argument "assoc_exn") +end + +(* --------------------------------------------------------------------------- *) + +(** {1 Characterizing Initial Machines States} *) + +(** In order to run so-called scenarios against our machines, we first + need to characterize their initial state. *) + +type xtz = int64 + +type tzbtc = int + +type liquidity = int + +type balances = {xtz : xtz; tzbtc : tzbtc; liquidity : liquidity} + +let pp_balances fmt b = + Format.fprintf + fmt + "@[<h>{xtz = %a; tzbtc = %d; liquidity = %d}@]" + Tez.pp + (Tez.of_mutez_exn b.xtz) + b.tzbtc + b.liquidity + +let xtz {xtz; _} = xtz + +type specs = { + cpmm_min_xtz_balance : xtz; + cpmm_min_tzbtc_balance : tzbtc; + accounts_balances : balances list; +} + +let pp_specs fmt specs = + Format.( + fprintf + fmt + "@[<v>{@ @[<v>cpmm = {min_xtz = %a; min_tzbtc = %d}@ @[<v 2>accounts = \ + [@ %a@ ]@]@]@ }@]" + Tez.pp + (Tez.of_mutez_exn specs.cpmm_min_xtz_balance) + specs.cpmm_min_tzbtc_balance + (pp_print_list ~pp_sep:pp_print_space pp_balances) + specs.accounts_balances) + +(* --------------------------------------------------------------------------- *) + +(** {1 Scenario [step] }*) + +type 'a step = + | SellTzBTC of {source : 'a; destination : 'a; tzbtc_deposit : tzbtc} + | BuyTzBTC of {source : 'a; destination : 'a; xtz_deposit : xtz} + | AddLiquidity of {source : 'a; destination : 'a; xtz_deposit : xtz} + | RemoveLiquidity of {source : 'a; destination : 'a; lqt_burned : liquidity} + +let pp_step pp_contract fmt = function + | SellTzBTC p -> + Format.( + fprintf + fmt + "@[<h>SellTzBTC(%a, %dtz₿, %a)@]" + pp_contract + p.source + p.tzbtc_deposit + pp_contract + p.destination) + | BuyTzBTC p -> + Format.( + fprintf + fmt + "@[<h>BuyTzBTC(%a, %aꜩ, %a)@]" + pp_contract + p.source + Tez.pp + (Tez.of_mutez_exn p.xtz_deposit) + pp_contract + p.destination) + | AddLiquidity p -> + Format.( + fprintf + fmt + "@[<h>AddLiquidity(%a, %aꜩ, %a)@]" + pp_contract + p.source + Tez.pp + (Tez.of_mutez_exn p.xtz_deposit) + pp_contract + p.destination) + | RemoveLiquidity p -> + Format.( + fprintf + fmt + "@[<h>RemoveLiquidity(%a, %d lqt, %a)@]" + pp_contract + p.source + p.lqt_burned + pp_contract + p.destination) + +type contract_id = + | Cpmm + | Holder + | TzBTC + | TzBTCAdmin + | Liquidity + | LiquidityAdmin + | ImplicitAccount of int + +let contract_id_to_string = function + | Holder -> "holder" + | Cpmm -> "cpmm" + | TzBTC -> "tzbtc" + | TzBTCAdmin -> "tzbtc_admin" + | Liquidity -> "lqt" + | LiquidityAdmin -> "lqt_admin" + | ImplicitAccount i -> Format.sprintf "#%d" i + +let pp_contract_id fmt c = Format.(fprintf fmt "[%s]" (contract_id_to_string c)) + +(* --------------------------------------------------------------------------- *) + +(** {1 Machines} *) + +(** {2 Machine Environment} *) + +type 'a env = { + cpmm_contract : 'a; + tzbtc_contract : 'a; + tzbtc_admin : 'a; + liquidity_contract : 'a; + liquidity_admin : 'a; + implicit_accounts : 'a list; + holder : 'a; + subsidy : xtz; +} + +let refine_contract env = function + | Cpmm -> env.cpmm_contract + | TzBTC -> env.tzbtc_contract + | TzBTCAdmin -> env.tzbtc_admin + | Liquidity -> env.liquidity_contract + | LiquidityAdmin -> env.liquidity_admin + | Holder -> env.holder + | ImplicitAccount i -> List_helpers.nth_exn env.implicit_accounts i + +let refine_step env step = + match step with + | SellTzBTC p -> + SellTzBTC + { + p with + source = refine_contract env p.source; + destination = refine_contract env p.destination; + } + | BuyTzBTC p -> + BuyTzBTC + { + p with + source = refine_contract env p.source; + destination = refine_contract env p.destination; + } + | AddLiquidity p -> + AddLiquidity + { + p with + source = refine_contract env p.source; + destination = refine_contract env p.destination; + } + | RemoveLiquidity p -> + RemoveLiquidity + { + p with + source = refine_contract env p.source; + destination = refine_contract env p.destination; + } + +(** {2 Machine Module Type} *) + +module type MACHINE = sig + type 'a m + + type contract + + type t + + type operation + + val pp_contract : Format.formatter -> contract -> unit + + val ( >>= ) : 'a m -> ('a -> 'b m) -> 'b m + + val fold_m : ('a -> 'b -> 'a m) -> 'a -> 'b list -> 'a m + + val pure : 'a -> 'a m + + val get_balances : contract -> contract env -> t -> balances m + + val get_xtz_balance : contract -> t -> xtz m + + val get_tzbtc_balance : contract -> contract env -> t -> tzbtc m + + val get_liquidity_balance : contract -> contract env -> t -> liquidity m + + val get_cpmm_total_liquidity : contract env -> t -> liquidity m + + val bake : + invariant:(contract env -> t -> bool m) -> + baker:contract -> + operation list -> + contract env -> + t -> + t m + + val transaction : src:contract -> contract -> xtz -> t -> operation m + + val token_to_xtz : + src:contract -> contract -> tzbtc -> contract env -> t -> operation m + + val xtz_to_token : + src:contract -> contract -> xtz -> contract env -> t -> operation m + + (* [mint_or_burn_tzbtc contract amount env state] will construct an + operation to credit or remove [amount] tzbtc tokens to [contract] *) + val mint_or_burn_tzbtc : + contract -> liquidity -> contract env -> t -> operation m + + (** [approve_tzbtc contract amount env state] will construct an + operation to authorize the CPMM contract to spend [amount] tzbtc + on behalf of [contract] *) + val approve_tzbtc : contract -> tzbtc -> contract env -> t -> operation m + + val add_liquidity : + src:contract -> contract -> xtz -> tzbtc -> contract env -> t -> operation m + + val remove_liquidity : + src:contract -> contract -> liquidity -> contract env -> t -> operation m + + val reveal : Account.t -> t -> operation m +end + +(** {2 Tezos Constants} *) + +let default_subsidy = + let open Tezos_protocol_016_PtMumbai_parameters in + Tez.to_mutez @@ Default_parameters.constants_test.liquidity_baking_subsidy + +let security_deposit = 640_000_000L + +(* When calling [Context.init_n] with a list of initial balances, the + sum of these balances should be equal to this constant. *) +let total_xtz = 32_000_000_000_000L + +let tzbtc_admin_account : Account.t = + { + pkh = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; + pk = + Tezos_crypto.Signature.Public_key.of_b58check_exn + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"; + sk = + Tezos_crypto.Signature.Secret_key.of_b58check_exn + "edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh"; + } + +let cpmm_initial_balance = {xtz = 100L; tzbtc = 1; liquidity = 0} + +let cpmm_initial_liquidity_supply = 100 + +(** {2 Machine Functor} *) + +module Machine = struct + module Make (S : MACHINE) = struct + open S + + let mint_tzbtc destination ~invariant amount env state = + mint_or_burn_tzbtc destination amount env state >>= fun op -> + bake ~invariant ~baker:env.holder [op] env state + + let add_liquidity ~invariant src dst xtz_deposit tzbtc_deposit env state = + approve_tzbtc src tzbtc_deposit env state >>= fun lqt_op -> + bake ~invariant ~baker:env.holder [lqt_op] env state >>= fun state -> + add_liquidity ~src dst xtz_deposit tzbtc_deposit env state + >>= fun cpmm_op -> bake ~invariant ~baker:env.holder [cpmm_op] env state + + let remove_liquidity ~invariant src dst lqt_burned env state = + remove_liquidity ~src dst lqt_burned env state >>= fun cpmm_op -> + bake ~invariant ~baker:env.holder [cpmm_op] env state + + let sell_tzbtc ~invariant src dst tzbtc_deposit env state = + approve_tzbtc src tzbtc_deposit env state >>= fun tzbtc_op -> + bake ~invariant ~baker:env.holder [tzbtc_op] env state >>= fun state -> + token_to_xtz ~src dst tzbtc_deposit env state >>= fun cpmm_op -> + bake ~invariant ~baker:env.holder [cpmm_op] env state + + let buy_tzbtc ~invariant src dst xtz_deposit env state = + xtz_to_token ~src dst xtz_deposit env state >>= fun cpmm_op -> + bake ~invariant ~baker:env.holder [cpmm_op] env state + + let check_state_satisfies_specs (env : S.contract env) (state : S.t) + (specs : specs) = + let implicit_accounts_targets = + List_helpers.zip env.implicit_accounts specs.accounts_balances + in + fold_m + (fun _ acc -> + let expected = List_helpers.assoc_exn acc implicit_accounts_targets in + get_balances acc env state >>= fun amount -> + assert (expected = amount) ; + pure ()) + () + env.implicit_accounts + >>= fun () -> + get_tzbtc_balance env.cpmm_contract env state + >>= fun cpmm_tzbtc_balance -> + assert (specs.cpmm_min_tzbtc_balance <= cpmm_tzbtc_balance) ; + get_xtz_balance env.cpmm_contract state >>= fun current_cpmm_xtz -> + assert ( + Int64.(to_int specs.cpmm_min_xtz_balance <= to_int @@ current_cpmm_xtz)) ; + pure () + + (** [predict_required_tzbtc_deposit xtz_deposit env state] + predicts the tzbtc deposit which will be required by the CPMM + contract for a deposit of [xtz_deposit]. + + This function is used by the machines to make the according + call to the [approve] entrypoint of the TzBTC contract. *) + let predict_required_tzbtc_deposit xtz_deposit env state = + get_xtz_balance env.cpmm_contract state >>= fun xtzPool -> + (* /!\ We need to take into accounts the number of blocks baked + to actually call the [add_liquidity] entry point of the + CPMM. *) + let xtzPool = + Tez.of_mutez_exn + Int64.(add xtzPool (mul blocks_per_add_liquidity_step env.subsidy)) + in + get_tzbtc_balance env.cpmm_contract env state >>= fun tokenPool -> + let tokenPool = Z.of_int tokenPool in + get_cpmm_total_liquidity env state >>= fun lqtTotal -> + let lqtTotal = Z.of_int lqtTotal in + let amount = Tez.of_mutez_exn xtz_deposit in + let _, tokens_deposited = + Cpmm_logic.Simulate_raw.addLiquidity + ~tokenPool + ~xtzPool + ~lqtTotal + ~amount + in + pure (Z.to_int tokens_deposited) + + let step ?(invariant = fun _ _ -> pure true) s env state = + match s with + | SellTzBTC {source; destination; tzbtc_deposit} -> + sell_tzbtc ~invariant source destination tzbtc_deposit env state + | BuyTzBTC {source; destination; xtz_deposit} -> + buy_tzbtc ~invariant source destination xtz_deposit env state + | AddLiquidity {source; destination; xtz_deposit} -> + predict_required_tzbtc_deposit xtz_deposit env state + >>= fun tzbtc_deposit -> + add_liquidity + ~invariant + source + destination + xtz_deposit + tzbtc_deposit + env + state + | RemoveLiquidity {source; destination; lqt_burned} -> + remove_liquidity ~invariant source destination lqt_burned env state + + let run ?(invariant = fun _ _ -> pure true) scenario env state = + fold_m + (fun state s -> step ~invariant (refine_step env s) env state) + state + scenario + end +end + +let initial_xtz_repartition accounts_balances = + let distributed_xtz = List.fold_left Int64.add 0L accounts_balances in + let bootstrap1_xtz = Int64.sub total_xtz distributed_xtz in + let bootstrap_balances = bootstrap1_xtz :: accounts_balances in + let n = List.length bootstrap_balances in + (n, bootstrap_balances) + +(* --------------------------------------------------------------------------- *) + +(** {1 Machines with a [build] Function} *) + +module type MACHINE_WITH_INIT = sig + include MACHINE + + (** [init balances] will create an “initial” state wherein the + [balances] have been distributed to [n] implicit contracts ([n] + being the size of the [balances] list). This function also + creates a [holder] implicit account which has the rest of the + xtz liquidity (the test framework forces the sum of xtz balances + to be equal to [total_xtz]). [init] also accepts an optional + argument [subsidy] to modify the default value of the subsidy + minted by the protocol in favor of the CPMM. *) + val init : + invariant:(contract env -> t -> bool m) -> + ?subsidy:xtz -> + xtz list -> + (t * contract env) m +end + +(** [initial_xtz_pool] balances predicts the value of the CPMM’s xtz + pool just before we start using the [add_liquidity] entrypoint to + provide to each implicit accounts the necessary liquidity + tokens. *) +let initial_xtz_pool balances subsidy = + (* /!\ In addition to the initial CPMM balances, we need to take + into account the subsidies of each block baked before this + point, which currently consist in: + + - One call to the [init] function + - One call to the [mint_tzbtc] function per implicit + accounts + + If the [build] function changes, this functions needs to be + updated accordingly. *) + let len = Int64.of_int (List.length balances) in + Int64.( + add + cpmm_initial_balance.xtz + (mul + (add (blocks_during_init len) (mul blocks_per_mint_tzbtc len)) + subsidy)) + +(** [predict_initial_balances xtz_pool tzbtc_pool lqt_total balances] + evaluates the extra xtz and tzbtc tokens to add to each balance of + the list [balances] so that the related implicit accounts can call + the [add_liquidity] entrypoint in order to have the required + liquidity token. + + For instance, for a balance [b] such that [b.liquidity = 10], we + compute [xtz_etra] and [tzbtc_extra] so that the implicit account + will be able to buy [10] liquidity tokens, and replace [b] with + [{b with xtz = b.xtz + xtz_extra; tzbtc = b.tzbtc + tzbtc_extra}] + in the returned list. + + The implementation of this function is made more complex than it + should due to the mechanism of subsidy of LB. In particular, it is + depends on the number of block baked to buy liquidities. *) +let predict_initial_balances balances subsidy = + let open Z in + let subsidy_z = of_int64 subsidy in + (* Due to the roundness of [Z.( / )], it is not straightforward to + find the inverse of the equation used to compute the number of + liquidity tokens bought with the [add_liquidity] entrypoint. To + find the suitable number of xtz to propose in order to buy + [liquidity_target], we naively search for the correct + solution. We compute a [xtz_candidate] by ignoring the roundness + of [Z.( / )], then increment it until it works. *) + let find_xtz_extra xtz_pool lqt_total liquidity_target = + let rec aux xtz_candidate = + let liquidity_z = xtz_candidate * lqt_total / xtz_pool in + if liquidity_z = liquidity_target then xtz_candidate + else aux (xtz_candidate + Z.one) + in + let xtz_extra_candidate = liquidity_target * xtz_pool / lqt_total in + aux xtz_extra_candidate + in + let rec predict_initial_balances xtz_pool tzbtc_pool lqt_total = function + | {xtz; tzbtc; liquidity} :: rst -> + (* balance inputs *) + (* /!\ We compute two blocks per [add_liquidity] entrypoint, + hence the two subsidies *) + let xtz_pool = + xtz_pool + (Z.of_int64 blocks_per_add_liquidity_step * subsidy_z) + in + let xtz_z = of_int64 xtz in + let tzbtc_z = of_int tzbtc in + let liquidity_z = of_int liquidity in + (* compute extra for being able to buy liquidity tokens *) + let xtz_extra = find_xtz_extra xtz_pool lqt_total liquidity_z in + let tzbtc_extra = cdiv (xtz_extra * tzbtc_pool) xtz_pool in + (* compute new balances *) + let xtz = to_int64 (xtz_z + xtz_extra) in + let tzbtc = to_int (tzbtc_z + tzbtc_extra) in + let liquidity = to_int liquidity_z in + (* new pools *) + let xtz_pool' = xtz_pool + xtz_extra in + let tzbtc_pool' = tzbtc_pool + tzbtc_extra in + let lqt_total' = lqt_total + liquidity_z in + (* recursion time *) + {xtz; tzbtc; liquidity} + :: predict_initial_balances xtz_pool' tzbtc_pool' lqt_total' rst + | [] -> [] + in + predict_initial_balances + (of_int64 @@ initial_xtz_pool balances subsidy) + (of_int cpmm_initial_balance.tzbtc) + (of_int cpmm_initial_liquidity_supply) + balances + +module MachineBuilder = struct + module Make (S : MACHINE_WITH_INIT) = struct + open S + include Machine.Make (S) + + let build : + ?invariant:(S.contract env -> S.t -> bool m) -> + ?subsidy:xtz -> + specs -> + (S.t * S.contract env) m = + fun ?(invariant = fun _ _ -> pure true) + ?(subsidy = default_subsidy) + ({cpmm_min_xtz_balance; accounts_balances; cpmm_min_tzbtc_balance} as + specs) -> + let accounts_balances_with_extra = + predict_initial_balances accounts_balances subsidy + in + let xtz_balances_with_extra = List.map xtz accounts_balances_with_extra in + (* 1. Create an initial context *) + init ~invariant ~subsidy xtz_balances_with_extra >>= fun (state, env) -> + invariant env state >>= fun cond -> + assert cond ; + (* 2. Provide the initial tzBTC liquidities to implicit accounts *) + let accounts = + List_helpers.zip + env.implicit_accounts + (List_helpers.zip accounts_balances accounts_balances_with_extra) + in + fold_m + (fun state (address, (_, balances)) -> + mint_tzbtc ~invariant address balances.tzbtc env state) + state + accounts + >>= fun state -> + (* 3. Make implicit accounts buy liquidities *) + fold_m + (fun state (address, (target_balances, balances_with_extra)) -> + let xtz = Int64.sub balances_with_extra.xtz target_balances.xtz in + let tzbtc = balances_with_extra.tzbtc - target_balances.tzbtc in + add_liquidity ~invariant address address xtz tzbtc env state) + state + accounts + >>= fun state -> + (* 4. Provide any missing tzbtc tokens to [cpmm_contract], if necessary *) + get_tzbtc_balance env.cpmm_contract env state + >>= fun current_cpmm_tzbtc_balance -> + let tzbtc_missing = cpmm_min_tzbtc_balance - current_cpmm_tzbtc_balance in + (if 0 < tzbtc_missing then + (* 4.1. Provide the tokens to the [bootstrap1] account, as a + temporary holder for CPMM missing tzBTC balance *) + mint_tzbtc ~invariant env.holder tzbtc_missing env state >>= fun state -> + (* 4.1. Make [bootstrap1] buy some xtz against the appropriate + amount of tzbtc *) + sell_tzbtc ~invariant env.holder env.holder tzbtc_missing env state + else pure state) + >>= fun state -> + (* 5. Provide any missing xtz tokens to [cpmm_contract], if necessary *) + get_xtz_balance env.cpmm_contract state + >>= fun current_cpmm_xtz_balance -> + let xtz_missing = + Int64.sub cpmm_min_xtz_balance current_cpmm_xtz_balance + in + (if 0L < xtz_missing then + transaction ~src:env.holder env.cpmm_contract xtz_missing state + >>= fun op -> bake ~invariant ~baker:env.holder [op] env state + else pure state) + >>= fun state -> + check_state_satisfies_specs env state specs >>= fun () -> pure (state, env) + end +end + +(* --------------------------------------------------------------------------- *) + +module ConcreteBaseMachine : + MACHINE_WITH_INIT + with type 'a m = 'a tzresult Lwt.t + and type contract = Contract.t + and type t = Block.t = struct + type 'a m = 'a tzresult Lwt.t + + type contract = Contract.t + + type operation = packed_operation + + type t = Block.t + + let pp_contract = Contract.pp + + let ( >>= ) = ( >>=? ) + + let fold_m = Environment.List.fold_left_es + + let pure = return + + let get_xtz_balance contract blk = + Context.Contract.balance (B blk) contract >>= fun x -> + pure @@ Tez.to_mutez x + + let get_tzbtc_balance contract env blk = + let destination = Destination.Contract contract in + Lqt_fa12_repr.Storage.getBalance_opt + (B blk) + ~contract:env.tzbtc_contract + {destination; entrypoint = Entrypoint.default} + >>=? fun mamount -> + pure (Option.value (Option.map Z.to_int mamount) ~default:0) + + let get_liquidity_balance contract env blk = + let destination = Destination.Contract contract in + Lqt_fa12_repr.Storage.getBalance_opt + (B blk) + ~contract:env.liquidity_contract + {destination; entrypoint = Entrypoint.default} + >>=? fun mamount -> + pure (Option.value (Option.map Z.to_int mamount) ~default:0) + + let get_cpmm_total_liquidity env blk = + Cpmm_repr.Storage.get (B blk) ~contract:env.cpmm_contract + >>=? fun cpmm_storage -> pure @@ Z.to_int cpmm_storage.lqtTotal + + let get_balances contract env blk = + get_xtz_balance contract blk >>= fun xtz -> + get_tzbtc_balance contract env blk >>= fun tzbtc -> + get_liquidity_balance contract env blk >>= fun liquidity -> + pure {xtz; tzbtc; liquidity} + + let bake ~invariant ~baker ops env blk = + Incremental.begin_construction + ~policy:(Block.By_account (Context.Contract.pkh baker)) + blk + >>= fun incr -> + fold_m Incremental.add_operation incr ops >>= fun incr -> + Incremental.finalize_block incr >>= fun blk -> + invariant env blk >>= fun cond -> + assert cond ; + return blk + + let reveal (account : Account.t) blk = Op.revelation (B blk) account.pk + + let transaction ~src dst amount blk = + Op.transaction (B blk) src dst (Tez.of_mutez_exn amount) + + let token_to_xtz ~src dst tzbtc_deposit env blk = + Cpmm_repr.transaction + (B blk) + ~src + ~contract:env.cpmm_contract + (Cpmm_repr.Parameter.TokenToXtz + { + to_ = dst; + minXtzBought = Tez.zero; + tokensSold = Z.of_int tzbtc_deposit; + deadline = far_future; + }) + + let xtz_to_token ~src dst amount env blk = + Cpmm_repr.transaction + (B blk) + ~src + ~contract:env.cpmm_contract + (Cpmm_repr.Parameter.XtzToToken + {to_ = dst; minTokensBought = Z.zero; deadline = far_future}) + ~amount:(Tez.of_mutez_exn amount) + + let approve_tzbtc src tzbtc env blk = + let maxTokensDeposited = Z.of_int tzbtc in + Lqt_fa12_repr.transaction + (B blk) + ~src + ~contract:env.tzbtc_contract + (Lqt_fa12_repr.Parameter.Approve + {spender = env.cpmm_contract; value = maxTokensDeposited}) + + let mint_or_burn_tzbtc target amount env blk = + let quantity = Z.of_int amount in + let ctxt = Context.B blk in + Lqt_fa12_repr.transaction + ctxt + ~src:env.tzbtc_admin + ~contract:env.tzbtc_contract + (Lqt_fa12_repr.Parameter.mintOrBurn {target; quantity}) + + let add_liquidity ~src dst xtz_deposit tzbtc_deposit env blk = + let amount = Tez.of_mutez_exn xtz_deposit in + let maxTokensDeposited = Z.of_int tzbtc_deposit in + Cpmm_repr.transaction + (B blk) + ~src + ~contract:env.cpmm_contract + ~amount + (Cpmm_repr.Parameter.AddLiquidity + { + owner = dst; + maxTokensDeposited; + minLqtMinted = Z.zero; + deadline = far_future; + }) + + let remove_liquidity ~src dst lqt_burned env blk = + let lqtBurned = Z.of_int lqt_burned in + Cpmm_repr.transaction + (B blk) + ~src + ~contract:env.cpmm_contract + (Cpmm_repr.Parameter.RemoveLiquidity + { + to_ = dst; + lqtBurned; + minXtzWithdrawn = Tez.zero; + minTokensWithdrawn = Z.zero; + deadline = far_future; + }) + + let reveal_tzbtc_admin ~invariant env state = + Account.add_account tzbtc_admin_account ; + transaction ~src:env.holder env.tzbtc_admin 1L state >>= fun op1 -> + bake ~invariant ~baker:env.holder [op1] env state >>= fun state -> + reveal tzbtc_admin_account state >>= fun op2 -> + bake ~invariant ~baker:env.holder [op2] env state + + let init ~invariant ?subsidy accounts_balances = + let liquidity_baking_subsidy = Option.map Tez.of_mutez_exn subsidy in + let n, bootstrap_balances = initial_xtz_repartition accounts_balances in + Context.init_n + n + ~consensus_threshold:0 + ~bootstrap_balances + ~cost_per_byte:Tez.zero + ~endorsing_reward_per_slot:Tez.zero + ~baking_reward_bonus_per_slot:Tez.zero + ~baking_reward_fixed_portion:Tez.zero + ~origination_size:0 + ~blocks_per_cycle:10_000l + ~cycles_per_voting_period:1l + ?liquidity_baking_subsidy + () + >>= function + | blk, holder :: accounts -> + let ctxt = Context.B blk in + Context.get_liquidity_baking_cpmm_address ctxt >>= fun cpmm_contract -> + Context.Contract.storage ctxt cpmm_contract >>= fun storage -> + let storage = Cpmm_repr.Storage.of_expr_exn (Micheline.root storage) in + let tzbtc_contract = storage.tokenAddress in + let liquidity_contract = storage.lqtAddress in + Context.Contract.storage ctxt tzbtc_contract >>= fun storage -> + let storage = + Lqt_fa12_repr.Storage.of_expr_exn (Micheline.root storage) + in + let tzbtc_admin = storage.admin in + Context.Contract.storage ctxt liquidity_contract >>= fun storage -> + let storage = + Lqt_fa12_repr.Storage.of_expr_exn (Micheline.root storage) + in + let liquidity_admin = storage.admin in + Context.get_liquidity_baking_subsidy (B blk) >>=? fun subsidy -> + let env = + { + cpmm_contract = Contract.Originated cpmm_contract; + tzbtc_contract = Contract.Originated tzbtc_contract; + tzbtc_admin; + liquidity_contract = Contract.Originated liquidity_contract; + liquidity_admin; + implicit_accounts = accounts; + holder; + subsidy = Tez.to_mutez subsidy; + } + in + reveal_tzbtc_admin ~invariant:(fun _ _ -> pure true) env blk + >>= fun blk -> + mint_or_burn_tzbtc env.cpmm_contract cpmm_initial_balance.tzbtc env blk + >>= fun op -> + bake ~invariant:(fun _ _ -> pure true) ~baker:env.holder [op] env blk + >>= fun blk -> + (* Since Tenderbake, we need to compensate for potential deposits + related to the consensus. *) + List.fold_left_i_es + (fun idx blk contract -> + match List.nth accounts_balances idx with + | Some target -> + get_xtz_balance contract blk >>=? fun balance -> + let delta = Int64.(sub target balance) in + if Compare.Int64.(0L = delta) then + (* We need to be able to determine the number of + blocks baked in the init function (to predict the + CPMM balance). So even when there is no delta to + compensate with, we bake an empty block. *) + bake + ~invariant:(fun _ _ -> pure true) + ~baker:env.holder + [] + env + blk + else if Compare.Int64.(0L < delta) then + transaction ~src:env.holder contract delta blk >>= fun op -> + bake + ~invariant:(fun _ _ -> pure true) + ~baker:env.holder + [op] + env + blk + else assert false + | None -> assert false) + blk + accounts + >>=? fun blk -> + (* We did not check the invariant before, because the CPMM + contract was in an inconsistent state. More precisely, it + was supposed to hold tzbtc tokens, while in practice it was + not. This was solved by the last call to [bake]. *) + invariant env blk >>= fun cond -> + assert cond ; + pure (blk, env) + | _ -> assert false +end + +module ConcreteMachine = struct + include ConcreteBaseMachine + include Machine.Make (ConcreteBaseMachine) + include MachineBuilder.Make (ConcreteBaseMachine) +end + +(* --------------------------------------------------------------------------- *) + +(** {1 Abstract Machines} *) + +type 'a state = { + cpmm_total_liquidity : liquidity; + accounts_balances : ('a * balances) list; +} + +let refine_state env state = + { + cpmm_total_liquidity = state.cpmm_total_liquidity; + accounts_balances = + List.map + (fun (c, b) -> (refine_contract env c, b)) + state.accounts_balances; + } + +let update_balances account f state = + match List.assoc ~equal:( = ) account state.accounts_balances with + | Some b -> + { + state with + accounts_balances = + (account, f b) + :: List.remove_assoc ~equal:( = ) account state.accounts_balances; + } + | _ -> assert false + +let update_xtz_balance account f = + update_balances account (fun b -> {b with xtz = f b.xtz}) + +let update_tzbtc_balance account f = + update_balances account (fun b -> {b with tzbtc = f b.tzbtc}) + +let update_liquidity_balance account f = + update_balances account (fun b -> {b with liquidity = f b.liquidity}) + +let transfer_xtz_balance src dest d st = + update_xtz_balance src (fun b -> Int64.sub b d) st + |> update_xtz_balance dest (fun b -> Int64.add b d) + +let transfer_tzbtc_balance src dest d st = + update_tzbtc_balance src (fun b -> b - d) st + |> update_tzbtc_balance dest (fun b -> d + b) + +module AbstractMachine = struct + module type C = sig + type t + + val pp : Format.formatter -> t -> unit + end + + module Make (C : C) : + MACHINE with type 'a m = 'a and type contract = C.t and type t = C.t state = + struct + type 'a m = 'a + + type contract = C.t + + type t = C.t state + + type operation = t -> t + + let pp_contract = C.pp + + let ( >>= ) x f = f x + + let pure = Fun.id + + let fold_m = List.fold_left + + let get_balances account state = + match List.assoc ~equal:( = ) account state.accounts_balances with + | Some x -> x + | _ -> assert false + + let get_xtz_balance account state = (get_balances account state).xtz + + let get_tzbtc_balance account _env state = + (get_balances account state).tzbtc + + let get_liquidity_balance account _env state = + (get_balances account state).liquidity + + let get_balances account _env state = get_balances account state + + let get_cpmm_total_liquidity _env state = state.cpmm_total_liquidity + + let reveal _pk _state state = state + + let transaction ~src dst amount _ state = + transfer_xtz_balance src dst amount state + + let xtz_bought tzbtc env state = + let xtzPool = + Tez.of_mutez_exn @@ get_xtz_balance env.cpmm_contract state + in + let tokenPool = + Z.of_int @@ get_tzbtc_balance env.cpmm_contract env state + in + let tokensSold = Z.of_int tzbtc in + let xtz_bought, xtz_net_bought = + Cpmm_logic.Simulate_raw.tokenToXtz ~xtzPool ~tokenPool ~tokensSold + in + (Z.to_int64 xtz_net_bought, Tez.to_mutez xtz_bought) + + let token_to_xtz ~src dst amount env _ state = + let xtz_bought, xtz_net_bought = xtz_bought amount env state in + state + |> transfer_tzbtc_balance src env.cpmm_contract amount + |> update_xtz_balance env.cpmm_contract (fun b -> Int64.sub b xtz_bought) + |> update_xtz_balance dst (Int64.add xtz_net_bought) + + let tzbtc_bought env state amount = + let xtzPool = + Tez.of_mutez_exn @@ get_xtz_balance env.cpmm_contract state + in + let tokenPool = + Z.of_int @@ get_tzbtc_balance env.cpmm_contract env state + in + let amount = Tez.of_mutez_exn amount in + let tzbtc_bought, xtz_earnt = + Cpmm_logic.Simulate_raw.xtzToToken ~xtzPool ~tokenPool ~amount + in + (Z.to_int tzbtc_bought, Z.to_int64 xtz_earnt) + + let xtz_to_token ~src dst amount env _ state = + let tzbtc_bought, xtz_earnt = tzbtc_bought env state amount in + update_xtz_balance src (fun b -> Int64.sub b amount) state + |> update_xtz_balance env.cpmm_contract (Int64.add xtz_earnt) + |> transfer_tzbtc_balance env.cpmm_contract dst tzbtc_bought + + let mint_or_burn_tzbtc target amount _ _ = + update_tzbtc_balance target (( + ) amount) + + let approve_tzbtc _contract _amount _env _state = Fun.id + + let add_liquidity ~src dst xtz_deposit _tzbtc_deposit env _ state = + let xtzPool = + Tez.of_mutez_exn (get_xtz_balance env.cpmm_contract state) + in + let tokenPool = + Z.of_int (get_tzbtc_balance env.cpmm_contract env state) + in + let lqtTotal = Z.of_int state.cpmm_total_liquidity in + let amount = Tez.of_mutez_exn xtz_deposit in + let lqt_minted, tokens_deposited = + Cpmm_logic.Simulate_raw.addLiquidity + ~tokenPool + ~xtzPool + ~lqtTotal + ~amount + in + let lqt_minted = Z.to_int lqt_minted in + let tokens_deposited = Z.to_int tokens_deposited in + let state = + transfer_xtz_balance src env.cpmm_contract xtz_deposit state + |> transfer_tzbtc_balance src env.cpmm_contract tokens_deposited + |> update_liquidity_balance dst (( + ) lqt_minted) + in + { + state with + cpmm_total_liquidity = state.cpmm_total_liquidity + lqt_minted; + } + + let remove_liquidity ~src dst lqt_burned env _ state = + let xtzPool = + Tez.of_mutez_exn (get_xtz_balance env.cpmm_contract state) + in + let tokenPool = + Z.of_int (get_tzbtc_balance env.cpmm_contract env state) + in + let lqtTotal = Z.of_int state.cpmm_total_liquidity in + let lqtBurned = Z.of_int lqt_burned in + let xtz_withdrawn, tokens_withdrawn = + Cpmm_logic.Simulate_raw.removeLiquidity + ~tokenPool + ~xtzPool + ~lqtTotal + ~lqtBurned + in + let xtz_withdrawn = Tez.to_mutez xtz_withdrawn in + let tokens_withdrawn = Z.to_int tokens_withdrawn in + let state = + update_xtz_balance dst (fun b -> Int64.add b xtz_withdrawn) state + |> update_tzbtc_balance dst (( + ) tokens_withdrawn) + |> update_liquidity_balance src (fun b -> b - lqt_burned) + |> update_xtz_balance env.cpmm_contract (fun b -> + Int64.sub b xtz_withdrawn) + |> update_tzbtc_balance env.cpmm_contract (fun b -> + b - tokens_withdrawn) + in + { + state with + cpmm_total_liquidity = state.cpmm_total_liquidity - lqt_burned; + } + + (* Ideally, we should also deal with the release of security + deposit, but since our tests are not long enough for this to + happen, we omit this aspect of the simulation. *) + let bake ~invariant ~baker operations env state = + let state = + update_xtz_balance env.cpmm_contract (Int64.add env.subsidy) state + |> (fun state -> List.fold_left ( |> ) state operations) + |> update_xtz_balance baker (fun b -> Int64.sub b security_deposit) + in + assert (invariant env state) ; + state + end +end + +(* --------------------------------------------------------------------------- *) + +(** {1 Symbolic Machine} *) + +module SymbolicBaseMachine : + MACHINE_WITH_INIT + with type 'a m = 'a + and type contract = contract_id + and type t = contract_id state = struct + include AbstractMachine.Make (struct + type t = contract_id + + let pp = pp_contract_id + end) + + let init ~invariant:_ ?(subsidy = default_subsidy) accounts_balances = + let _, bootstrap_balances = initial_xtz_repartition accounts_balances in + let len = Int64.of_int (List.length accounts_balances) in + match bootstrap_balances with + | holder_xtz :: accounts -> + let xtz_cpmm = + Int64.( + add cpmm_initial_balance.xtz (mul (blocks_during_init len) subsidy)) + in + ( { + cpmm_total_liquidity = cpmm_initial_liquidity_supply; + accounts_balances = + (Cpmm, {cpmm_initial_balance with xtz = xtz_cpmm}) + :: (Holder, {xtz = holder_xtz; tzbtc = 0; liquidity = 0}) + :: (TzBTCAdmin, {xtz = 0L; tzbtc = 0; liquidity = 0}) + :: List.mapi + (fun i xtz -> + (ImplicitAccount i, {xtz; tzbtc = 0; liquidity = 0})) + accounts; + }, + { + cpmm_contract = Cpmm; + tzbtc_contract = TzBTC; + tzbtc_admin = TzBTCAdmin; + liquidity_contract = Liquidity; + liquidity_admin = LiquidityAdmin; + implicit_accounts = + List.mapi (fun i _ -> ImplicitAccount i) accounts; + holder = Holder; + subsidy; + } ) + | [] -> assert false +end + +module SymbolicMachine = struct + include SymbolicBaseMachine + include Machine.Make (SymbolicBaseMachine) + include MachineBuilder.Make (SymbolicBaseMachine) +end + +(* --------------------------------------------------------------------------- *) + +(** {1 Validation Machine} *) + +module ValidationBaseMachine : + MACHINE_WITH_INIT + with type 'a m = 'a ConcreteBaseMachine.m + and type t = ConcreteBaseMachine.t * Contract.t state + and type contract = Contract.t = struct + module GhostMachine = AbstractMachine.Make (struct + type t = Contract.t + + let pp = Contract.pp + end) + + type 'a m = 'a ConcreteBaseMachine.m + + type t = ConcreteBaseMachine.t * GhostMachine.t + + type contract = Contract.t + + type operation = ConcreteBaseMachine.operation * GhostMachine.operation + + let pp_contract = Contract.pp + + let ( >>= ) = ConcreteBaseMachine.( >>= ) + + let fold_m = ConcreteBaseMachine.fold_m + + let pure = ConcreteBaseMachine.pure + + let get_balances contract env (_, state) = + pure (GhostMachine.get_balances contract env state) + + let get_xtz_balance contract (_, state) = + pure (GhostMachine.get_xtz_balance contract state) + + let get_tzbtc_balance contract env (_, state) = + pure (GhostMachine.get_tzbtc_balance contract env state) + + let get_liquidity_balance contract env (_, state) = + pure (GhostMachine.get_liquidity_balance contract env state) + + let get_cpmm_total_liquidity env (_, state) = + pure (GhostMachine.get_cpmm_total_liquidity env state) + + let bake ~invariant ~baker ops env (blk, state) = + let cops = List.map fst ops in + let rops = List.map snd ops in + ConcreteBaseMachine.( + bake ~invariant:(fun _ _ -> pure true) ~baker cops env blk) + >>= fun blk -> + let state = + GhostMachine.bake ~invariant:(fun _ _ -> true) ~baker rops env state + in + invariant env (blk, state) >>= fun cond -> + assert cond ; + pure (blk, state) + + let transaction ~src dst xtz (blk, state) = + ConcreteBaseMachine.transaction ~src dst xtz blk >>= fun cop -> + pure (cop, GhostMachine.transaction ~src dst xtz state) + + let token_to_xtz ~src dst tzbtc env (blk, state) = + ConcreteBaseMachine.token_to_xtz ~src dst tzbtc env blk >>= fun cop -> + pure (cop, GhostMachine.token_to_xtz ~src dst tzbtc env state) + + let xtz_to_token ~src dst xtz env (blk, state) = + ConcreteBaseMachine.xtz_to_token ~src dst xtz env blk >>= fun cop -> + pure (cop, GhostMachine.xtz_to_token ~src dst xtz env state) + + let mint_or_burn_tzbtc dst tzbtc env (blk, state) = + ConcreteBaseMachine.mint_or_burn_tzbtc dst tzbtc env blk >>= fun cop -> + pure (cop, GhostMachine.mint_or_burn_tzbtc dst tzbtc env state) + + let approve_tzbtc dst tzbtc env (blk, state) = + ConcreteBaseMachine.approve_tzbtc dst tzbtc env blk >>= fun cop -> + pure (cop, GhostMachine.approve_tzbtc dst tzbtc env state) + + let add_liquidity ~src dst xtz_deposit tzbtc_deposit env (blk, state) = + ConcreteBaseMachine.add_liquidity ~src dst xtz_deposit tzbtc_deposit env blk + >>= fun cop -> + pure + ( cop, + GhostMachine.add_liquidity ~src dst xtz_deposit tzbtc_deposit env state + ) + + let remove_liquidity ~src dst lqt_burned env (blk, state) = + ConcreteBaseMachine.remove_liquidity ~src dst lqt_burned env blk + >>= fun cop -> + pure (cop, GhostMachine.remove_liquidity ~src dst lqt_burned env state) + + let reveal account (blk, state) = + ConcreteBaseMachine.reveal account blk >>= fun cop -> + pure (cop, GhostMachine.reveal account state) + + let init ~invariant ?subsidy balances = + ConcreteBaseMachine.init + ~invariant:(fun _ _ -> return true) + ?subsidy + balances + >>= fun (blk, env) -> + let state, _ = + SymbolicBaseMachine.init ~invariant:(fun _ _ -> true) ?subsidy balances + in + let state = refine_state env state in + invariant env (blk, state) >>= fun cond -> + assert cond ; + pure ((blk, state), env) +end + +module ValidationMachine = struct + include ValidationBaseMachine + include Machine.Make (ValidationBaseMachine) + include MachineBuilder.Make (ValidationBaseMachine) + + module Symbolic = struct + let get_xtz_balance = get_xtz_balance + + let get_tzbtc_balance = get_tzbtc_balance + + let get_liquidity_balance = get_liquidity_balance + + let get_cpmm_total_liquidity = get_cpmm_total_liquidity + end + + module Concrete = struct + let get_xtz_balance contract (blk, _) = + ConcreteMachine.get_xtz_balance contract blk + + let get_tzbtc_balance contract env (blk, _) = + ConcreteMachine.get_tzbtc_balance contract env blk + + let get_liquidity_balance contract env (blk, _) = + ConcreteMachine.get_liquidity_balance contract env blk + + let get_cpmm_total_liquidity env (blk, _) = + ConcreteMachine.get_cpmm_total_liquidity env blk + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.mli new file mode 100644 index 000000000000..76107f8b4d61 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/liquidity_baking_machine.mli @@ -0,0 +1,387 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This module provides the means to test extensively the Liquidity + Baking (LB) feature. We recall that this feature is built upon + three smart contracts: (1) a CPMM contract initially based on + Dexter 2, and (2) two tokens contracts. Our objective is to run + “scenarios” consisting in interleaved, realistic calls to these + contracts, and to assert these scenarios do not yield any + undesirable behaviors. + + To that end, three “machines” are provided. + + - The {! SymbolicMachine} allows to simulate scenarios involving + the LB feature completely off-chain. It can be seen as an + abstraction of the concrete implementation provided by the Tezos + node. + - The {! ConcreteMachine } allows to execute scenarios on-chain. + - The {! ValidationMachine } combines the two previously mentioned + machines. In other words, the {! ValidationMachine} makes the {! + SymbolicMachine} and the [ConcreteMachine] execute the same + scenarios, and asserts they remain synchronized after each baked + block. + + The {! ValidationMachine} allows to (1) validate the {! + SymbolicMachine} ({i i.e.,} the reimplementation of the LB + contracts logic) against the real implementation provided by + Tezos, {b and} the contracts originated by the protocol correctly + implement the LB logic, as implemented by the {! SymbolicMachine}. + That is, the {! ValidationMachine} reports desynchronization of + the two machines, but cannot explain this desynchronization. *) + +(** {1 Machine State Characterization} *) + +type xtz = int64 + +type tzbtc = int + +type liquidity = int + +(** As far as liquidity baking is concerned, an account can hold three + kinds of tokens: [xtz], [tzbtc], and [liquidity]. *) +type balances = {xtz : xtz; tzbtc : tzbtc; liquidity : liquidity} + +val pp_balances : Format.formatter -> balances -> unit + +(** A value of type [specs] allows to specify an initial state of a + “machine”. + + In a nutshell, it consists in specifying the minimal balances of + the CPMM contracts and a set of implicit contracts. The two + machines provided by this module has a [build] function which + turns a [specs] into a consistent initial state for this + machine. *) +type specs = { + cpmm_min_xtz_balance : xtz; + cpmm_min_tzbtc_balance : tzbtc; + accounts_balances : balances list; +} + +val pp_specs : Format.formatter -> specs -> unit + +(** A value of type ['a env] (where ['a] is the type of contract + identifiers) summarizes the different contracts involved in the LB + feature. + + Values of type [env] are constructed by the [build] function of + the machines. *) +type 'a env = private { + cpmm_contract : 'a; + tzbtc_contract : 'a; + tzbtc_admin : 'a; + liquidity_contract : 'a; + liquidity_admin : 'a; + implicit_accounts : 'a list; + holder : 'a; + subsidy : xtz; +} + +(** A value of type ['a step] (where ['a] is the type used to identify + contracts) describes a consistent sequence of LB smart contract + calls. + + For instance, [SellTzBTC] consists in approving an allowance in + the [TzBTC] contract, then calling the [token_to_xtz] entry point + of the [CPMM]. *) +type 'a step = + | SellTzBTC of {source : 'a; destination : 'a; tzbtc_deposit : tzbtc} + | BuyTzBTC of {source : 'a; destination : 'a; xtz_deposit : xtz} + | AddLiquidity of {source : 'a; destination : 'a; xtz_deposit : xtz} + | RemoveLiquidity of {source : 'a; destination : 'a; lqt_burned : liquidity} + +val pp_step : + (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a step -> unit + +(** A summary of the state of a machine, parameterized by the type of + contract identifier. *) +type 'a state = { + cpmm_total_liquidity : liquidity; + accounts_balances : ('a * balances) list; +} + +(** {1 The Symbolic Machine} *) + +(** In the {! SymbolicMachine}, a contract is identified by a symbolic + value. *) +type contract_id = + | Cpmm + | Holder + | TzBTC + | TzBTCAdmin + | Liquidity + | LiquidityAdmin + (* We use integers to distinguish between implicit account because + this integer has the extra benefit of being the index of the + related account in [env.implicit_accounts]. *) + | ImplicitAccount of int + +val pp_contract_id : Format.formatter -> contract_id -> unit + +module SymbolicMachine : sig + (** The state of the {! SymbolicMachine}. *) + type t = contract_id state + + (** [get_xtz_balance c state] returns the amount of mutez owned by + [c] in [state]. *) + val get_xtz_balance : contract_id -> t -> xtz + + (** [get_tzbtc_balance c env state] returns the amount of TzBTC + owned by [c] in [state], according to the [TzBTC] contract. *) + val get_tzbtc_balance : contract_id -> contract_id env -> t -> tzbtc + + (** [get_liquidity_balance c env state] returns the amount of + liquidity token owned by [c] in [state], according to the + [Liquidity] contract. *) + val get_liquidity_balance : contract_id -> contract_id env -> t -> liquidity + + (** [get_cpmm_total_liquidity env state] fetches the current amount + of liquidity tokens distributed by the CPMM contract from the + state [state]. *) + val get_cpmm_total_liquidity : contract_id env -> t -> liquidity + + (** [predict_required_tzbtc_deposit xtz_deposit env state] predicts + the deposit in TzBTC which will be required by the CPMM contract + when executing a step [AddLiquidity] with [xtz_deposit] from + [state]. *) + val predict_required_tzbtc_deposit : xtz -> contract_id env -> t -> tzbtc + + (** [build specs] computes (1) an initial state for the {! + SymbolicMachine}, and (2) the environment associated to this + state. + + The machine enforces the resulting state is consistent with the + [specs] given as inputs, and raises an [Assert_failure] + exception if it does not. + + One can use the optional argument [subsidy] to set the subsidy + amount to a given value (by default, we use the same as the main + chain). Additionally, the [invariant] optional argument can be + used to verify that a given invariant holds at the end of the + initialization. *) + val build : + ?invariant:(contract_id env -> t -> bool) -> + ?subsidy:xtz -> + specs -> + t * contract_id env + + (** [step s env state] executes a single step [s] from [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val step : + ?invariant:(contract_id env -> t -> bool) -> + contract_id step -> + contract_id env -> + t -> + t + + (** [run steps env state] executes a list of steps from [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val run : + ?invariant:(contract_id env -> t -> bool) -> + contract_id step list -> + contract_id env -> + t -> + t +end + +(** A machine that can execute scenarios onchain. *) +module ConcreteMachine : sig + (** The state of the {! ConcreteMachine}. *) + type t = Block.t + + (** [get_xtz_balance c state] returns the amount of mutez owned by + [c] in [state]. *) + val get_xtz_balance : Contract.t -> t -> xtz tzresult Lwt.t + + (** [get_tzbtc_balance c env state] returns the amount of TzBTC + owned by [c] in [state], according to the [TzBTC] contract. *) + val get_tzbtc_balance : + Contract.t -> Contract.t env -> t -> tzbtc tzresult Lwt.t + + (** [get_liquidity_balance c env state] returns the amount of + liquidity token owned by [c] in [state], according to the + [Liquidity] contract. *) + val get_liquidity_balance : + Contract.t -> Contract.t env -> t -> liquidity tzresult Lwt.t + + (** [get_cpmm_total_liquidity env state] fetches the current amount + of liquidity tokens distributed by the CPMM contract from the + state [state]. *) + val get_cpmm_total_liquidity : Contract.t env -> t -> liquidity tzresult Lwt.t + + (** [build specs] asynchronously computes (1) an initial block for + the {! ConcreteMachine}, and (2) the environment associated to + this block. + + The machine enforces the resulting state is consistent with the + [specs] given as inputs, and raises an [Assert_failure] + exception if it does not. It also enforces that the machines + used underneath remain in sync. + + One can use the optional argument [subsidy] to set the subsidy + amount to a given value (by default, we use the same as the main + chain). Additionally, the [invariant] optional argument can be + used to verify that a given invariant holds at the end of the + initialization. *) + val build : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + ?subsidy:xtz -> + specs -> + (t * Contract.t env) tzresult Lwt.t + + (** [step s env state] asynchronously executes a single step [s] + from [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val step : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + Contract.t step -> + Contract.t env -> + t -> + t tzresult Lwt.t + + (** [run lss env state] asynchronously executes a list of steps from + [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val run : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + contract_id step list -> + Contract.t env -> + t -> + t tzresult Lwt.t +end + +module ValidationMachine : sig + (** The state of the {! ValidationMachine}. *) + type t = ConcreteMachine.t * Contract.t state + + module Symbolic : sig + (** A collections of functions to introspect the symbolic part of + the [ValidationMachine] state. *) + + (** [get_xtz_balance c state] returns the amount of mutez owned by + [c] in the symbolic part of [state]. *) + val get_xtz_balance : Contract.t -> t -> xtz tzresult Lwt.t + + (** [get_tzbtc_balance c env state] returns the amount of TzBTC + owned by [c] in the symbolic part of [state], according to the + [TzBTC] contract. *) + val get_tzbtc_balance : + Contract.t -> Contract.t env -> t -> tzbtc tzresult Lwt.t + + (** [get_liquidity_balance c env state] returns the amount of + liquidity token owned by [c] in the symbolic part of [state], + according to the [Liquidity] contract. *) + val get_liquidity_balance : + Contract.t -> Contract.t env -> t -> liquidity tzresult Lwt.t + + (** [get_cpmm_total_liquidity env state] fetches the   current + amount of liquidity tokens distributed by the CPMM   contract + using the symbolic part of the state [state]. *) + val get_cpmm_total_liquidity : + Contract.t env -> t -> liquidity tzresult Lwt.t + end + + module Concrete : sig + (** A collections of functions to introspect the concrete part of + the [ValidationMachine] state. *) + + (** [get_xtz_balance c state] returns the amount of mutez owned by + [c] in the concrete part of [state]. *) + val get_xtz_balance : Contract.t -> t -> xtz tzresult Lwt.t + + (** [get_tzbtc_balance c env state] returns the amount of TzBTC + owned by [c] in the concrete part of [state], according to the + [TzBTC] contract. *) + val get_tzbtc_balance : + Contract.t -> Contract.t env -> t -> tzbtc tzresult Lwt.t + + (** [get_liquidity_balance c env state] returns the amount of + liquidity token owned by [c] in the concrete part of [state], + according to the [Liquidity] contract. *) + val get_liquidity_balance : + Contract.t -> Contract.t env -> t -> liquidity tzresult Lwt.t + + (** [get_cpmm_total_liquidity env state] fetches the current + amount of liquidity tokens distributed by the CPMM contract + using the concrete part of the state [state]. *) + val get_cpmm_total_liquidity : + Contract.t env -> t -> liquidity tzresult Lwt.t + end + + (** [build specs] asynchronously computes (1) an initial state for + the {! ValidationMachine}, and (2) the environment associated to + this state. + + The machine enforces the resulting state is consistent with the + [specs] given as inputs, and raises an [Assert_failure] + exception if it does not. It also enforces that the machines + used underneath remain in sync. + + One can use the optional argument [subsidy] to set the subsidy + amount to a given value (by default, we use the same as the main + chain). Additionally, the [invariant] optional argument can be + used to verify that a given invariant holds at the end of the + initialization. *) + val build : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + ?subsidy:xtz -> + specs -> + (t * Contract.t env) tzresult Lwt.t + + (** [step s env state] asynchronously executes a single step [s] + from [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val step : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + Contract.t step -> + Contract.t env -> + t -> + t tzresult Lwt.t + + (** [run lss env state] asynchronously executes a list of steps from + [state]. + + The [invariant] optional argument can be used to verify that a + given invariant holds after each baked block. *) + val run : + ?invariant:(Contract.t env -> t -> bool tzresult Lwt.t) -> + contract_id step list -> + Contract.t env -> + t -> + t tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/lqt_fa12_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/lqt_fa12_repr.ml new file mode 100644 index 000000000000..168bbb43dac6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/lqt_fa12_repr.ml @@ -0,0 +1,253 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Expr_common + +module Parameter = struct + (* // ============================================================================= + * // Entrypoints + * // ============================================================================= *) + + (* Note: in the lqt_fa12 contract, [value] is a nat. Hence, it + should always be positive *) + type approve = {spender : Contract.t; value : Z.t} + + type mintOrBurn = {quantity : Z.t; target : Contract.t} + + (* Note: this wrapper does not implement a reprensentation for the + entrypoints transfer, getAllowance, getBalance, getTotalSupply, + as they are not used as of yet. *) + type t = Approve of approve | MintOrBurn of mintOrBurn + + let approve p = + assert (Z.lt Z.zero p.value || Z.equal Z.zero p.value) ; + Approve p + + let mintOrBurn p = MintOrBurn p + + let approve_to_string {spender; value} = + Format.asprintf + "{ spender: %a; value: %a }" + Contract.pp + spender + Z.pp_print + value + + let mint_or_burn_to_string {quantity; target} = + Format.asprintf + "{ quantity: %a; target: %a }" + Z.pp_print + quantity + Contract.pp + target + + let to_string : t -> string = function + | Approve p -> Format.asprintf "Approve %s" (approve_to_string p) + | MintOrBurn p -> Format.asprintf "MintOrBurn %s" (mint_or_burn_to_string p) + + let entrypoint_of_parameter : t -> Entrypoint.t = function + | Approve _ -> Entrypoint.of_string_strict_exn "approve" + | MintOrBurn _ -> Entrypoint.of_string_strict_exn "mintOrBurn" + + let pp fmt s = Format.fprintf fmt "%s" (to_string s) + + let eq s s' = s = s' + + let to_expr_rooted : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc -> function + | MintOrBurn {quantity; target} -> + comb ~loc [int ~loc quantity; address_string ~loc target] + | Approve {spender; value} -> + comb ~loc [address_string ~loc spender; int ~loc value] + + let to_expr : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc p -> + let rooted = to_expr_rooted ~loc p in + match p with + | MintOrBurn _ -> right ~loc @@ left ~loc rooted + | Approve _ -> left ~loc @@ left ~loc @@ left ~loc rooted + + let to_michelson_string e = + let e = to_expr ~loc:0 e in + Format.asprintf + "%a" + Michelson_v1_printer.print_expr + (Micheline.strip_locations e) +end + +(* // ============================================================================= + * // Storage + * // ============================================================================= *) + +module Storage = struct + let pp_big_map_id fmt v = Z.pp_print fmt (Big_map.Id.unparse_to_z v) + + type t = { + tokens : Big_map.Id.t; + allowances : Big_map.Id.t; + admin : Contract.t; + totalSupply : Z.t; + } + + let pp {tokens; allowances; admin; totalSupply} = + Format.asprintf + "{ tokens: %a; allowances: %a; admin: %a; totalSupply: %a}" + Z.pp_print + (Big_map.Id.unparse_to_z tokens) + Z.pp_print + (Big_map.Id.unparse_to_z allowances) + Contract.pp + admin + Z.pp_print + totalSupply + + let null : t = + { + tokens = Big_map.Id.parse_z Z.zero; + allowances = Big_map.Id.parse_z Z.one; + admin = Contract.Implicit Tezos_crypto.Signature.Public_key_hash.zero; + totalSupply = Z.zero; + } + + let eq s s' = s = s' + + let to_expr : + loc:'a -> + t -> + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node = + fun ~loc {tokens; allowances; admin; totalSupply} -> + comb + ~loc + [ + big_map_id ~loc tokens; + big_map_id ~loc allowances; + address_string ~loc admin; + int ~loc totalSupply; + ] + + let to_michelson_string e = + let e = to_expr ~loc:0 e in + Format.asprintf + "%a" + Michelson_v1_printer.print_expr + (Micheline.strip_locations e) + + type exn += Invalid_storage_expr of string + + (** Note: parses a storage unparsed in readable mode (as + e.g. returned by [Alpha_services.Contract.storage]), so that + contracts are represented by strings. *) + let of_expr_exn : + ('a, Michelson_v1_primitives.prim) Tezos_micheline.Micheline.node -> t = + function + | Tezos_micheline.Micheline.Prim + ( _, + Script.D_Pair, + [ + Tezos_micheline.Micheline.Int (_, tokens); + Tezos_micheline.Micheline.Int (_, allowances); + Tezos_micheline.Micheline.String (_, admin); + Tezos_micheline.Micheline.Int (_, totalSupply); + ], + [] ) -> + let tokens = Big_map.Id.parse_z tokens in + let allowances = Big_map.Id.parse_z allowances in + let admin = address_of_string_exn admin in + {tokens; allowances; admin; totalSupply} + | e -> + let canonical = Micheline.strip_locations e in + let msg = + Format.asprintf + "Not a valid LQT_FA1.2 storage: %s /// %a" + (try + Michelson_v1_printer.micheline_string_of_expression + ~zero_loc:true + canonical + with Z.Overflow -> + "Cannot represent as micheline due to overflowing Z -> int") + Michelson_v1_printer.print_expr + canonical + in + raise (Invalid_storage_expr msg) + + let get (ctxt : Context.t) ~(contract : Contract.t) : t tzresult Lwt.t = + match contract with + | Implicit _ -> + invalid_arg "Lqt_fa12_repr.Storage.get called on implicit account" + | Originated c -> + Context.Contract.storage ctxt c >|=? Micheline.root >|=? of_expr_exn + + let get_alpha_context (ctxt : Context.t) : Alpha_context.t tzresult Lwt.t = + (match ctxt with + | B b -> + (* can perhaps be retrieved through Raw_context.prepare ? *) + Incremental.begin_construction b + | I i -> return i) + >|=? Incremental.alpha_ctxt + + let getBalance_opt (ctxt : Context.t) ~(contract : Contract.t) + (owner : Script_typed_ir.address) = + get ctxt ~contract >>=? fun storage -> + let tokens = storage.tokens in + get_alpha_context ctxt >>=? fun ctxt -> + Script_ir_translator.hash_data ctxt Script_typed_ir.address_t owner + >|= Environment.wrap_tzresult + >>=? fun (address_hash, ctxt) -> + Big_map.get_opt ctxt tokens address_hash >|= Environment.wrap_tzresult + >>=? function + | _, Some canonical -> ( + match Tezos_micheline.Micheline.root canonical with + | Tezos_micheline.Micheline.Int (_, amount) -> return @@ Some amount + | _ -> assert false) + | _, None -> return @@ None + + let getBalance (ctxt : Context.t) ~(contract : Contract.t) + (owner : Script_typed_ir.address) = + getBalance_opt ctxt ~contract owner >|=? Option.value ~default:Z.zero +end + +let transaction (ctxt : Context.t) ~(contract : Contract.t) ~(src : Contract.t) + ?(amount = Tez.zero) (parameters : Parameter.t) = + let entrypoint = Parameter.entrypoint_of_parameter parameters in + let rooted_param_lazy = + parameters + |> Parameter.to_expr_rooted ~loc:0 + |> Micheline.strip_locations |> Alpha_context.Script.lazy_expr + in + Op.transaction + ctxt + src + contract + amount + ~entrypoint + ~parameters:rooted_param_lazy diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/merkle_list_helper.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/merkle_list_helper.ml new file mode 100644 index 000000000000..bf823ad6f954 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/merkle_list_helper.ml @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let prefix = "\001\002\003" (* 8uE(36) *) + +module Hash = + Environment.Blake2B.Make + (Environment.Base58) + (struct + let name = "Merkle_list" + + let title = "Merkle_list" + + let b58check_prefix = prefix + + let size = Some 20 + end) + +module ML = + Protocol.Merkle_list.Make + (struct + type t = bytes + + let to_bytes x = x + end) + (Hash) + +include ML + +(* Hash two hashes *) +let hash2 (h1 : Hash.t) (h2 : Hash.t) = + Hash.(hash_bytes [to_bytes h1; to_bytes h2]) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.ml new file mode 100644 index 000000000000..23edb62e017f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.ml @@ -0,0 +1,35 @@ +(**************************************************************************) +(* *) +(* Copyright (c) 2014 - 2018. *) +(* Dynamic Ledger Solutions, Inc.< contact@tezos.com > *) +(* *) +(* All rights reserved.No warranty, explicit or implicit, provided. *) +(* *) +(**************************************************************************) + +open Protocol + +module Table = Hashtbl.Make (struct + type t = Nonce_hash.t + + let hash h = Int32.to_int (TzEndian.get_int32 (Nonce_hash.to_bytes h) 0) + + let equal = Nonce_hash.equal +end) + +let known_nonces = Table.create 17 + +let generate () = + match + Alpha_context.Nonce.of_bytes + @@ Tezos_crypto.Rand.generate Alpha_context.Constants.nonce_length + with + | Ok nonce -> + let hash = Alpha_context.Nonce.hash nonce in + Table.add known_nonces hash nonce ; + (hash, nonce) + | Error _ -> assert false + +let forget_all () = Table.clear known_nonces + +let get hash = Table.find known_nonces hash diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.mli new file mode 100644 index 000000000000..8a8b258b0658 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/nonce.mli @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Returns a fresh nonce and its corresponding hash (and stores them). *) +val generate : unit -> Nonce_hash.t * Alpha_context.Nonce.t + +val get : Nonce_hash.t -> Alpha_context.Nonce.t option + +val forget_all : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.ml new file mode 100644 index 000000000000..429a4f52c4cd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.ml @@ -0,0 +1,1106 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let pack_operation ctxt signature contents = + let branch = Context.branch ctxt in + Operation.pack + ({shell = {branch}; protocol_data = {contents; signature}} : _ Operation.t) + +let sign ?(watermark = Tezos_crypto.Signature.Generic_operation) sk branch + contents = + let unsigned = + Data_encoding.Binary.to_bytes_exn + Operation.unsigned_encoding + ({branch}, Contents_list contents) + in + let signature = Some (Tezos_crypto.Signature.sign ~watermark sk unsigned) in + ({shell = {branch}; protocol_data = {contents; signature}} : _ Operation.t) + +(** Generates the block payload hash based on the hash [pred_hash] of + the predecessor block and the hash of non-consensus operations of + the current block [b]. *) +let mk_block_payload_hash predecessor_hash payload_round (b : Block.t) = + let ops = Block.Forge.classify_operations b.operations in + let non_consensus_operations = + List.concat (match List.tl ops with None -> [] | Some l -> l) + in + let hashes = List.map Operation.hash_packed non_consensus_operations in + Block_payload.hash ~predecessor_hash ~payload_round hashes + +let mk_consensus_content_signer_and_pred_branch ?delegate ?slot ?level ?round + ?block_payload_hash ?pred_branch endorsed_block = + let open Lwt_result_syntax in + let pred_branch = + match pred_branch with + | None -> endorsed_block.Block.header.shell.predecessor + | Some branch -> branch + in + let* delegate_pkh, slots = + match delegate with + | None -> Context.get_endorser (B endorsed_block) + | Some del -> ( + let* slots = Context.get_endorser_slot (B endorsed_block) del in + match slots with + | None -> return (del, []) + | Some slots -> return (del, slots)) + in + let slot = + match slot with None -> Stdlib.List.hd slots | Some slot -> slot + in + let* level = + match level with + | None -> + let*? level = Context.get_level (B endorsed_block) in + return level + | Some level -> return level + in + let* round = + match round with + | None -> + let*? round = Block.get_round endorsed_block in + return round + | Some round -> return round + in + let block_payload_hash = + match block_payload_hash with + | None -> mk_block_payload_hash pred_branch round endorsed_block + | Some block_payload_hash -> block_payload_hash + in + let consensus_content = {slot; level; round; block_payload_hash} in + let* signer = Account.find delegate_pkh in + return (consensus_content, signer.sk, pred_branch) + +let raw_endorsement ?delegate ?slot ?level ?round ?block_payload_hash + ?pred_branch endorsed_block = + let open Lwt_result_syntax in + let* consensus_content, signer, pred_branch = + mk_consensus_content_signer_and_pred_branch + ?delegate + ?slot + ?level + ?round + ?block_payload_hash + ?pred_branch + endorsed_block + in + let op = Single (Endorsement consensus_content) in + return + (sign + ~watermark: + Operation.(to_watermark (Endorsement Tezos_crypto.Chain_id.zero)) + signer + pred_branch + op) + +let endorsement ?delegate ?slot ?level ?round ?block_payload_hash ?pred_branch + endorsed_block = + let open Lwt_result_syntax in + let* op = + raw_endorsement + ?delegate + ?slot + ?level + ?round + ?block_payload_hash + ?pred_branch + endorsed_block + in + return (Operation.pack op) + +let raw_preendorsement ?delegate ?slot ?level ?round ?block_payload_hash + ?pred_branch endorsed_block = + let open Lwt_result_syntax in + let* consensus_content, signer, pred_branch = + mk_consensus_content_signer_and_pred_branch + ?delegate + ?slot + ?level + ?round + ?block_payload_hash + ?pred_branch + endorsed_block + in + let op = Single (Preendorsement consensus_content) in + return + (sign + ~watermark: + Operation.(to_watermark (Preendorsement Tezos_crypto.Chain_id.zero)) + signer + pred_branch + op) + +let preendorsement ?delegate ?slot ?level ?round ?block_payload_hash + ?pred_branch endorsed_block = + let open Lwt_result_syntax in + let* op = + raw_preendorsement + ?delegate + ?slot + ?level + ?round + ?block_payload_hash + ?pred_branch + endorsed_block + in + return (Operation.pack op) + +let sign ?watermark sk ctxt (Contents_list contents) = + Operation.pack (sign ?watermark sk ctxt contents) + +let batch_operations ?(recompute_counters = false) ~source ctxt + (operations : packed_operation list) = + let operations = + List.map + (function + | {Alpha_context.protocol_data = Operation_data {contents; _}; _} -> + Operation.to_list (Contents_list contents)) + operations + |> List.flatten + in + (if recompute_counters then + Context.Contract.counter ctxt source >>=? fun counter -> + (* Update counters and transform into a contents_list *) + let _, rev_operations = + List.fold_left + (fun (counter, acc) -> function + | Contents (Manager_operation m) -> + ( Manager_counter.succ counter, + Contents (Manager_operation {m with counter}) :: acc ) + | x -> (counter, x :: acc)) + (Manager_counter.succ counter, []) + operations + in + return (List.rev rev_operations) + else return operations) + >>=? fun operations -> + Context.Contract.manager ctxt source >>=? fun account -> + Environment.wrap_tzresult @@ Operation.of_list operations + >>?= fun operations -> + return @@ sign account.sk (Context.branch ctxt) operations + +type gas_limit = Max | High | Low | Zero | Custom_gas of Gas.Arith.integral + +let default_low_gas_limit = + Gas.Arith.integral_of_int_exn + Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation + +let default_high_gas_limit = + Gas.Arith.integral_of_int_exn + (49_000 + Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation) + +let resolve_gas_limit ctxt = function + | Max -> + Context.get_constants ctxt >>=? fun c -> + return c.parametric.hard_gas_limit_per_operation + | High -> return default_high_gas_limit + | Low -> return default_low_gas_limit + | Zero -> return Gas.Arith.zero + | Custom_gas x -> return x + +let pp_gas_limit fmt = function + | Max -> Format.fprintf fmt "Max" + | High -> + Format.fprintf fmt "High: %a" Gas.Arith.pp_integral default_high_gas_limit + | Low -> + Format.fprintf fmt "Low: %a" Gas.Arith.pp_integral default_low_gas_limit + | Zero -> Format.fprintf fmt "Zero: %a" Gas.Arith.pp_integral Gas.Arith.zero + | Custom_gas x -> Format.fprintf fmt "Custom: %a" Gas.Arith.pp_integral x + +let combine_operations ?public_key ?counter ?spurious_operation ~source ctxt + (packed_operations : packed_operation list) = + assert (match packed_operations with [] -> false | _ :: _ -> true) ; + (* Hypothesis : each operation must have the same branch (is this really true?) *) + let {Tezos_base.Operation.branch} = + (WithExceptions.Option.get ~loc:__LOC__ @@ List.hd packed_operations).shell + in + assert ( + List.for_all + (fun {shell = {Tezos_base.Operation.branch = b; _}; _} -> + Tezos_crypto.Block_hash.(branch = b)) + packed_operations) ; + (* TODO? : check signatures consistency *) + let unpacked_operations = + List.map + (function + | {Alpha_context.protocol_data = Operation_data {contents; _}; _} -> ( + match Contents_list contents with + | Contents_list (Single o) -> Contents o + | Contents_list + (Cons (Manager_operation {operation = Reveal _; _}, Single o)) + -> + Contents o + | _ -> (* TODO : decent error *) assert false)) + packed_operations + in + (match counter with + | Some counter -> return counter + | None -> Context.Contract.counter ctxt source) + >>=? fun counter -> + (* We increment the counter *) + let counter = Manager_counter.succ counter in + Context.Contract.manager ctxt source >>=? fun account -> + let public_key = Option.value ~default:account.pk public_key in + (Context.Contract.is_manager_key_revealed ctxt source >|=? function + | false -> + let reveal_op = + Manager_operation + { + source = Tezos_crypto.Signature.Public_key.hash public_key; + fee = Tez.zero; + counter; + operation = Reveal public_key; + gas_limit = default_high_gas_limit; + storage_limit = Z.zero; + } + in + (Some (Contents reveal_op), Manager_counter.succ counter) + | true -> (None, counter)) + >>=? fun (manager_op, counter) -> + (* Update counters and transform into a contents_list *) + let counter, rev_operations = + List.fold_left + (fun (counter, acc) -> function + | Contents (Manager_operation m) -> + ( Manager_counter.succ counter, + Contents (Manager_operation {m with counter}) :: acc ) + | x -> (counter, x :: acc)) + (counter, match manager_op with None -> [] | Some op -> [op]) + unpacked_operations + in + let operations = List.rev rev_operations in + (* patch a random operation with a corrupted pkh *) + let operations = + match spurious_operation with + | None -> operations + | Some op -> + let op = + match op with + | {protocol_data; shell = _} -> ( + match protocol_data with + | Operation_data {contents; _} -> ( + match contents with + | Cons _ -> assert false + | Single (Manager_operation m) -> + Alpha_context.Contents + (Manager_operation {m with counter}) + | Single op -> Contents op)) + in + (* Insert at the end *) + operations @ [op] + in + Environment.wrap_tzresult @@ Operation.of_list operations + >>?= fun operations -> + return @@ sign account.sk (Context.branch ctxt) operations + +let manager_operation ?(force_reveal = false) ?counter ?(fee = Tez.zero) + ?(gas_limit = High) ?storage_limit ?public_key ~source ctxt operation = + (match counter with + | Some counter -> return counter + | None -> Context.Contract.counter ctxt source) + >>=? fun counter -> + Context.get_constants ctxt >>=? fun c -> + let storage_limit = + Option.value + ~default:c.parametric.hard_storage_limit_per_operation + storage_limit + in + resolve_gas_limit ctxt gas_limit >>=? fun gas_limit -> + Context.Contract.manager ctxt source >>=? fun account -> + let public_key = Option.value ~default:account.pk public_key in + let counter = Manager_counter.succ counter in + Context.Contract.is_manager_key_revealed ctxt source >|=? fun revealed -> + (* If the manager is revealed or we are not forcing reveals, we + generate a singleton manager operation. *) + if revealed || not force_reveal then + let op = + Manager_operation + { + source = Tezos_crypto.Signature.Public_key.hash public_key; + fee; + counter; + operation; + gas_limit; + storage_limit; + } + in + Contents_list (Single op) + (* Otherwise if the manager is unrevealed and we are + force_revaling managers by default, we pre-attach a revelation + for it. *) + else + let op_reveal = + Manager_operation + { + source = Tezos_crypto.Signature.Public_key.hash public_key; + fee = Tez.zero; + counter; + operation = Reveal public_key; + gas_limit = default_high_gas_limit; + storage_limit = Z.zero; + } + in + let op = + Manager_operation + { + source = Tezos_crypto.Signature.Public_key.hash public_key; + fee; + counter = Manager_counter.succ counter; + operation; + gas_limit; + storage_limit; + } + in + Contents_list (Cons (op_reveal, Single op)) + +let revelation ?(fee = Tez.zero) ?(gas_limit = High) ?(storage_limit = Z.zero) + ?counter ?(forge_pkh = None) ctxt public_key = + (* If Some pkh is provided to ?forge_pkh we take that hash at face + value, otherwise we honestly compute the hash from + [public_key]. This is useful to test forging Reveal operations + (cf. tezos!5182). *) + let pkh = + match forge_pkh with + | Some pkh -> pkh + | None -> Tezos_crypto.Signature.Public_key.hash public_key + in + resolve_gas_limit ctxt gas_limit >>=? fun gas_limit -> + let source = Contract.Implicit pkh in + (match counter with + | None -> Context.Contract.counter ctxt source + | Some ctr -> return ctr) + >>=? fun counter -> + Context.Contract.manager ctxt source >|=? fun account -> + let counter = Manager_counter.succ counter in + let sop = + Contents_list + (Single + (Manager_operation + { + source = pkh; + fee; + counter; + operation = Reveal public_key; + gas_limit; + storage_limit; + })) + in + sign account.sk (Context.branch ctxt) sop + +let failing_noop ctxt source arbitrary = + let op = Contents_list (Single (Failing_noop arbitrary)) in + Account.find source >>=? fun account -> + return @@ sign account.sk (Context.branch ctxt) op + +let originated_contract_hash op = + let nonce = Protocol.Origination_nonce.initial (Operation.hash_packed op) in + Contract_hash.of_nonce nonce + +let originated_contract op = Contract.Originated (originated_contract_hash op) + +exception Impossible + +let contract_origination_gen k ?force_reveal ?counter ?delegate ~script + ?public_key ?credit ?fee ?gas_limit ?storage_limit ctxt source = + Context.Contract.manager ctxt source >>=? fun account -> + let default_credit = Tez.of_mutez @@ Int64.of_int 1000001 in + let default_credit = + WithExceptions.Option.to_exn ~none:Impossible default_credit + in + let credit = Option.value ~default:default_credit credit in + let operation = Origination {delegate; script; credit} in + manager_operation + ?force_reveal + ?counter + ?public_key + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + operation + >|=? fun sop -> k (sign account.sk (Context.branch ctxt) sop) + +let contract_origination = + contract_origination_gen (fun op -> (op, originated_contract op)) + +let contract_origination_hash = + contract_origination_gen (fun op -> (op, originated_contract_hash op)) + +let register_global_constant ?force_reveal ?counter ?public_key ?fee ?gas_limit + ?storage_limit ctxt ~source ~value = + Context.Contract.manager ctxt source >>=? fun account -> + let operation = Register_global_constant {value} in + manager_operation + ?force_reveal + ?counter + ?public_key + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + operation + >|=? fun sop -> sign account.sk (Context.branch ctxt) sop + +let unsafe_transaction ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ?(parameters = Script.unit_parameter) ?(entrypoint = Entrypoint.default) + ctxt (src : Contract.t) (destination : Contract.t) (amount : Tez.t) = + let top = Transaction {amount; parameters; destination; entrypoint} in + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + top + >>=? fun sop -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) sop + +let transaction ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ?parameters ?entrypoint ctxt (src : Contract.t) (dst : Contract.t) + (amount : Tez.t) = + unsafe_transaction + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ?parameters + ?entrypoint + ctxt + src + dst + amount + +let delegation ?force_reveal ?fee ?gas_limit ?counter ?storage_limit ctxt source + dst = + let top = Delegation dst in + manager_operation + ?force_reveal + ?fee + ?counter + ?gas_limit + ?storage_limit + ~source + ctxt + top + >>=? fun sop -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) sop + +let set_deposits_limit ?force_reveal ?fee ?gas_limit ?storage_limit ?counter + ctxt source limit = + let top = Set_deposits_limit limit in + manager_operation + ?force_reveal + ?fee + ?counter + ?storage_limit + ?gas_limit + ~source + ctxt + top + >>=? fun sop -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) sop + +let increase_paid_storage ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt ~source ~destination (amount : Z.t) = + let top = Increase_paid_storage {amount_in_bytes = amount; destination} in + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + top + >>=? fun sop -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) sop + +let activation ctxt (pkh : Tezos_crypto.Signature.Public_key_hash.t) + activation_code = + (match pkh with + | Ed25519 edpkh -> return edpkh + | _ -> + failwith + "Wrong public key hash : %a - Commitments must be activated with an \ + Tezos_crypto.Ed25519 encrypted public key hash" + Tezos_crypto.Signature.Public_key_hash.pp + pkh) + >|=? fun id -> + let contents = Single (Activate_account {id; activation_code}) in + let branch = Context.branch ctxt in + { + shell = {branch}; + protocol_data = Operation_data {contents; signature = None}; + } + +let double_endorsement ctxt op1 op2 = + let contents = Single (Double_endorsement_evidence {op1; op2}) in + let branch = Context.branch ctxt in + { + shell = {branch}; + protocol_data = Operation_data {contents; signature = None}; + } + +let double_preendorsement ctxt op1 op2 = + let contents = Single (Double_preendorsement_evidence {op1; op2}) in + let branch = Context.branch ctxt in + { + shell = {branch}; + protocol_data = Operation_data {contents; signature = None}; + } + +let double_baking ctxt bh1 bh2 = + let contents = Single (Double_baking_evidence {bh1; bh2}) in + let branch = Context.branch ctxt in + { + shell = {branch}; + protocol_data = Operation_data {contents; signature = None}; + } + +let seed_nonce_revelation ctxt level nonce = + { + shell = {branch = Context.branch ctxt}; + protocol_data = + Operation_data + { + contents = Single (Seed_nonce_revelation {level; nonce}); + signature = None; + }; + } + +let vdf_revelation ctxt solution = + { + shell = {branch = Context.branch ctxt}; + protocol_data = + Operation_data + {contents = Single (Vdf_revelation {solution}); signature = None}; + } + +let get_period ?period ctxt = + let open Lwt_result_syntax in + match period with + | Some period -> return period + | None -> + let* current_period = Context.Vote.get_current_period ctxt in + return current_period.voting_period.index + +let proposals_contents ctxt proposer ?period proposals = + let open Lwt_result_syntax in + let source = Context.Contract.pkh proposer in + let* period = get_period ?period ctxt in + return (Single (Proposals {source; period; proposals})) + +let proposals ctxt proposer ?period proposals = + let open Lwt_result_syntax in + let* contents = proposals_contents ctxt proposer ?period proposals in + let* account = Account.find (Context.Contract.pkh proposer) in + return (sign account.sk (Context.branch ctxt) (Contents_list contents)) + +let ballot_contents ctxt voter ?period proposal ballot = + let open Lwt_result_syntax in + let source = Context.Contract.pkh voter in + let* period = get_period ?period ctxt in + return (Single (Ballot {source; period; proposal; ballot})) + +let ballot ctxt voter ?period proposal ballot = + let open Lwt_result_syntax in + let* contents = ballot_contents ctxt voter ?period proposal ballot in + let* account = Account.find (Context.Contract.pkh voter) in + return (sign account.sk (Context.branch ctxt) (Contents_list contents)) + +let dummy_script = + let open Micheline in + Script. + { + code = + lazy_expr + (strip_locations + (Seq + ( (), + [ + Prim ((), K_parameter, [Prim ((), T_unit, [], [])], []); + Prim ((), K_storage, [Prim ((), T_unit, [], [])], []); + Prim + ( (), + K_code, + [ + Seq + ( (), + [ + Prim ((), I_CDR, [], []); + Prim + ( (), + I_NIL, + [Prim ((), T_operation, [], [])], + [] ); + Prim ((), I_PAIR, [], []); + ] ); + ], + [] ); + ] ))); + storage = lazy_expr (strip_locations (Prim ((), D_Unit, [], []))); + } + +let dummy_script_cost = Test_tez.of_mutez_exn 9_500L + +let originated_tx_rollup op = + let nonce = + Origination_nonce.Internal_for_tests.initial (Operation.hash_packed op) + in + (nonce, Tx_rollup.Internal_for_tests.originated_tx_rollup nonce) + +let tx_rollup_origination ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (src : Contract.t) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + Tx_rollup_origination + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + let op = sign account.sk (Context.branch ctxt) to_sign_op in + (op, originated_tx_rollup op |> snd) + +let tx_rollup_submit_batch ?force_reveal ?counter ?fee ?burn_limit ?gas_limit + ?storage_limit ctxt (source : Contract.t) (tx_rollup : Tx_rollup.t) + (content : string) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_submit_batch {tx_rollup; content; burn_limit}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_commit ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (source : Contract.t) (tx_rollup : Tx_rollup.t) + (commitment : Tx_rollup_commitment.Full.t) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_commit {tx_rollup; commitment}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_return_bond ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (source : Contract.t) (tx_rollup : Tx_rollup.t) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_return_bond {tx_rollup}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_finalize ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (source : Contract.t) (tx_rollup : Tx_rollup.t) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_finalize_commitment {tx_rollup}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_remove_commitment ?force_reveal ?counter ?fee ?gas_limit + ?storage_limit ctxt (source : Contract.t) (tx_rollup : Tx_rollup.t) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_remove_commitment {tx_rollup}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_dispatch_tickets ?force_reveal ?counter ?fee ?gas_limit + ?storage_limit ctxt ~(source : Contract.t) ~message_index + ~message_result_path tx_rollup level context_hash tickets_info = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + tickets_info; + message_result_path; + }) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let transfer_ticket ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + ~(source : Contract.t) ~contents ~ty ~ticketer ~amount ~destination + ~entrypoint = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_raw_reject ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (source : Contract.t) (tx_rollup : Tx_rollup.t) + (level : Tx_rollup_level.t) (message : Tx_rollup_message.t) + ~(message_position : int) ~(message_path : Tx_rollup_inbox.Merkle.path) + ~message_result_hash ~message_result_path + ~(proof : Tx_rollup_l2_proof.serialized) + ~(previous_message_result : Tx_rollup_message_result.t) + ~previous_message_result_path = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_rejection + { + tx_rollup; + level; + message; + message_position; + message_path; + message_result_hash; + proof; + previous_message_result; + previous_message_result_path; + message_result_path; + }) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let tx_rollup_reject ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (source : Contract.t) (tx_rollup : Tx_rollup.t) (level : Tx_rollup_level.t) + (message : Tx_rollup_message.t) ~(message_position : int) + ~(message_path : Tx_rollup_inbox.Merkle.path) ~message_result_hash + ~message_result_path ~(proof : Tx_rollup_l2_proof.t) + ~(previous_message_result : Tx_rollup_message_result.t) + ~previous_message_result_path = + let proof = Tx_rollup_l2_proof.serialize_proof_exn proof in + tx_rollup_raw_reject + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ctxt + source + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path + +let originated_sc_rollup op = + let packed = Operation.hash_packed op in + let nonce = Origination_nonce.Internal_for_tests.initial packed in + Sc_rollup.Internal_for_tests.originated_sc_rollup nonce + +let sc_rollup_origination ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ?origination_proof ctxt (src : Contract.t) kind ~boot_sector ~parameters_ty + = + let open Lwt_result_syntax in + let* origination_proof = + Sc_rollup_helpers.wrap_origination_proof + ~boot_sector + ~kind + origination_proof + in + let* to_sign_op = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_originate {kind; boot_sector; origination_proof; parameters_ty}) + in + let* account = Context.Contract.manager ctxt src in + let op = sign account.sk (Context.branch ctxt) to_sign_op in + let t = originated_sc_rollup op |> fun addr -> (op, addr) in + return t + +let sc_rollup_publish ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) rollup commitment = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_publish {rollup; commitment}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_cement ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) rollup commitment = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_cement {rollup; commitment}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_execute_outbox_message ?counter ?fee ?gas_limit ?storage_limit + ?force_reveal ctxt (src : Contract.t) rollup cemented_commitment + ~output_proof = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_execute_outbox_message + {rollup; cemented_commitment; output_proof}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_recover_bond ?counter ?fee ?gas_limit ?storage_limit ?force_reveal + ctxt (source : Contract.t) (sc_rollup : Sc_rollup.t) + (staker : public_key_hash) = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Sc_rollup_recover_bond {sc_rollup; staker}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_add_messages ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (src : Contract.t) messages = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_add_messages {messages}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_refute ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) rollup opponent refutation = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_refute {rollup; opponent; refutation}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let sc_rollup_timeout ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) rollup stakers = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Sc_rollup_timeout {rollup; stakers}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let dal_publish_slot_header ?force_reveal ?counter ?fee ?gas_limit + ?storage_limit ctxt (src : Contract.t) slot_header = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Dal_publish_slot_header slot_header) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let originated_zk_rollup op = + let packed = Operation.hash_packed op in + let nonce = Origination_nonce.Internal_for_tests.initial packed in + Zk_rollup.Internal_for_tests.originated_zk_rollup nonce + +let zk_rollup_origination ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (src : Contract.t) ~public_parameters ~circuits_info ~init_state + ~nb_ops = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Zk_rollup_origination + {public_parameters; circuits_info; init_state; nb_ops}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + let op = sign account.sk (Context.branch ctxt) to_sign_op in + originated_zk_rollup op |> fun addr -> (op, addr) + +let update_consensus_key ?force_reveal ?counter ?fee ?gas_limit ?storage_limit + ctxt (src : Contract.t) pkh = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Update_consensus_key pkh) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let drain_delegate ctxt ~consensus_key ~delegate ~destination = + let contents = + Single (Drain_delegate {consensus_key; delegate; destination}) + in + Context.Contract.manager ctxt (Contract.Implicit consensus_key) + >|=? fun account -> + sign account.sk (Context.branch ctxt) (Contents_list contents) + +let zk_rollup_publish ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) ~zk_rollup ~ops = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Zk_rollup_publish {zk_rollup; ops}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op + +let zk_rollup_update ?force_reveal ?counter ?fee ?gas_limit ?storage_limit ctxt + (src : Contract.t) ~zk_rollup ~update = + manager_operation + ?force_reveal + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source:src + ctxt + (Zk_rollup_update {zk_rollup; update}) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt src >|=? fun account -> + sign account.sk (Context.branch ctxt) to_sign_op diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.mli new file mode 100644 index 000000000000..7bcecfbdbb31 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/op.mli @@ -0,0 +1,822 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3181 + Improve documentation of the operation helpers *) + +(** Assemble the given signature and [contents_list] into a + [packed_operation]. + + The context argument is used to retrieve the branch. + + If the [signature option] argument is [None], then the resulting + operation is unsigned. + + This function is mainly useful to craft an operation with a + missing or invalid signatue. Otherwise, it is often better to use + one of the helpers below: they handle the signature internally to + directly return well-signed operations. *) +val pack_operation : + Context.t -> signature option -> 'a contents_list -> packed_operation + +val sign : + ?watermark:Tezos_crypto.Signature.watermark -> + Tezos_crypto.Signature.secret_key -> + Tezos_crypto.Block_hash.t -> + packed_contents_list -> + packed_operation + +(** Create an unpacked endorsement that is expected for given [Block.t]. + + Optional parameters allow to specify the endorsed values: [level], + [round] and/or [block_payload_hash]. + + They also allow to specify the endorser, [delegate], and/or the + [slot]. + + Finally, the predecessor branch, [pred_branch] can be specified.*) +val raw_endorsement : + ?delegate:public_key_hash -> + ?slot:Slot.t -> + ?level:Raw_level.t -> + ?round:Round.t -> + ?block_payload_hash:Block_payload_hash.t -> + ?pred_branch:Tezos_crypto.Block_hash.t -> + Block.t -> + Kind.endorsement Operation.t tzresult Lwt.t + +(** Create an unpacked preendorsement that is expected for a given + [Block.t]. + + Optional parameters are the same than {!raw_endorsement}. *) +val raw_preendorsement : + ?delegate:public_key_hash -> + ?slot:Slot.t -> + ?level:Raw_level.t -> + ?round:Round.t -> + ?block_payload_hash:Block_payload_hash.t -> + ?pred_branch:Tezos_crypto.Block_hash.t -> + Block.t -> + Kind.preendorsement Operation.t tzresult Lwt.t + +(** Create a packed endorsement that is expected for a given + [Block.t] by packing the result of {!raw_endorsement}. *) +val endorsement : + ?delegate:public_key_hash -> + ?slot:Slot.t -> + ?level:Raw_level.t -> + ?round:Round.t -> + ?block_payload_hash:Block_payload_hash.t -> + ?pred_branch:Tezos_crypto.Block_hash.t -> + Block.t -> + Operation.packed tzresult Lwt.t + +(** Create a packed preendorsement that is expected for a given + [Block.t] by packing the result of {!raw_preendorsement}. *) +val preendorsement : + ?delegate:public_key_hash -> + ?slot:Slot.t -> + ?level:Raw_level.t -> + ?round:Round.t -> + ?block_payload_hash:Block_payload_hash.t -> + ?pred_branch:Tezos_crypto.Block_hash.t -> + Block.t -> + Operation.packed tzresult Lwt.t + +type gas_limit = + | Max (** Max corresponds to the [max_gas_limit_per_operation] constant. *) + | High + (** High corresponds to [50_000] gas unit which should cover a + majority of use-cases. This is the default used when forging + manager operations. *) + | Low (** Low corresponds to the gas entry cost of a manager operation *) + | Zero + | Custom_gas of Gas.Arith.integral + +(** Pretty printer for gas_limit type. *) +val pp_gas_limit : Format.formatter -> gas_limit -> unit + +val transaction : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?parameters:Script.lazy_expr -> + ?entrypoint:Entrypoint.t -> + Context.t -> + Contract.t -> + Contract.t -> + Tez.t -> + Operation.packed tzresult Lwt.t + +(** Same as [transaction], but with a more generic destination + parameter. It is said unsafe because it can construct transactions + that will always fail, such as + + {ul {li Transaction to the deposit entrypoint of a transaction + rollup, as these transactions are necessarily internals.}} + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val unsafe_transaction : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?parameters: + Michelson_v1_primitives.prim Micheline.canonical Data_encoding.lazy_t -> + ?entrypoint:Entrypoint_repr.t -> + Context.t -> + Contract.t -> + Contract.t -> + Tez.t -> + packed_operation tzresult Lwt.t + +val delegation : + ?force_reveal:bool -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?counter:Manager_counter.t -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + public_key_hash option -> + Operation.packed tzresult Lwt.t + +val set_deposits_limit : + ?force_reveal:bool -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + Context.t -> + Contract.t -> + Tez.tez option -> + Operation.packed tzresult Lwt.t + +val increase_paid_storage : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + source:Contract.t -> + destination:Contract_hash.t -> + Z.t -> + Operation.packed tzresult Lwt.t + +(** [revelation ?fee ?gas_limit ?forge_pkh ctxt pkh] Creates a new + [Reveal] {!manager_operation} to reveal a public key [pkh] + applying to current context [ctxt]. + + Optional arguments allow to override defaults: + + {ul {li [?fee:Tez.tez]: specify a fee, otherwise set to + [Tez.zero].} + + {li [?gas_limit:Gas.Arith.integral]: force a gas limit, otherwise + set to 10000 gas units.} + + {li [?forge_pkh]: use a provided [pkh] as source, instead of + hashing [pkh]. Useful for forging non-honest reveal operations} + + {li [?storage_limit:Z.t]: forces a storage limit, otherwise + set to [Z.zero]} +*) +val revelation : + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?counter:Manager_counter.t -> + ?forge_pkh:public_key_hash option -> + Context.t -> + public_key -> + (packed_operation, tztrace) result Lwt.t + +val failing_noop : + Context.t -> public_key_hash -> string -> Operation.packed tzresult Lwt.t + +(** [contract_origination ctxt source] Create a new contract origination + operation, sign it with [source] and returns it alongside the contract + address. The contract address is using the initial origination nonce with the + hash of the operation. If this operation is combined with [combine_operations] + then the contract address is false as the nonce is not based on the correct + operation hash. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val contract_origination : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?delegate:public_key_hash -> + script:Script.t -> + ?public_key:public_key -> + ?credit:Tez.tez -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + (Operation.packed * Contract.t) tzresult Lwt.t + +val contract_origination_hash : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?delegate:public_key_hash -> + script:Script.t -> + ?public_key:public_key -> + ?credit:Tez.tez -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + (Operation.packed * Contract_hash.t) tzresult Lwt.t + +val originated_contract : Operation.packed -> Contract.t + +val register_global_constant : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?public_key:Tezos_crypto.Signature.public_key -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + (* Account doing the registration *) + source:Contract.t -> + (* Micheline value to be registered *) + value:Protocol.Alpha_context.Script.lazy_expr -> + (Protocol.operation, tztrace) result Lwt.t + +val double_endorsement : + Context.t -> + Kind.endorsement Operation.t -> + Kind.endorsement Operation.t -> + Operation.packed + +val double_preendorsement : + Context.t -> + Kind.preendorsement Operation.t -> + Kind.preendorsement Operation.t -> + Operation.packed + +val double_baking : + Context.t -> + Block_header.block_header -> + Block_header.block_header -> + Operation.packed + +val activation : + Context.t -> + Tezos_crypto.Signature.Public_key_hash.t -> + Blinded_public_key_hash.activation_code -> + Operation.packed tzresult Lwt.t + +val combine_operations : + ?public_key:public_key -> + ?counter:Manager_counter.t -> + ?spurious_operation:packed_operation -> + source:Contract.t -> + Context.t -> + packed_operation list -> + packed_operation tzresult Lwt.t + +(** Batch a list of (already signed) operations and (re-)sign with the + [source]. No revelation is inserted and the counters are kept as + they are unless [recompute_counters] is set to [true] (defaults false). *) +val batch_operations : + ?recompute_counters:bool -> + source:Contract.t -> + Context.t -> + packed_operation list -> + packed_operation tzresult Lwt.t + +(** Reveals a seed_nonce that was previously committed at a certain level *) +val seed_nonce_revelation : + Context.t -> Raw_level.t -> Nonce.t -> Operation.packed + +(** Reveals a VDF with a proof of correctness *) +val vdf_revelation : Context.t -> Seed.vdf_solution -> Operation.packed + +(** Craft the [contents_list] for a Proposals operation. + + Invocation: [proposals_contents ctxt source ?period proposals]. + + @param period defaults to the index of the current voting period + in [ctxt]. *) +val proposals_contents : + Context.t -> + Contract.t -> + ?period:int32 -> + Tezos_crypto.Protocol_hash.t list -> + Kind.proposals contents_list tzresult Lwt.t + +(** Craft a Proposals operation. + + Invocation: [proposals ctxt source ?period proposals]. + + @param period defaults to the index of the current voting period + in [ctxt]. *) +val proposals : + Context.t -> + Contract.t -> + ?period:int32 -> + Tezos_crypto.Protocol_hash.t list -> + Operation.packed tzresult Lwt.t + +(** Craft the [contents_list] for a Ballot operation. + + Invocation: [ballot_contents ctxt source ?period proposal ballot]. + + @param period defaults to the index of the current voting period + in [ctxt]. *) +val ballot_contents : + Context.t -> + Contract.t -> + ?period:int32 -> + Tezos_crypto.Protocol_hash.t -> + Vote.ballot -> + Kind.ballot contents_list tzresult Lwt.t + +(** Craft a Ballot operation. + + Invocation: [ballot ctxt source ?period proposal ballot]. + + @param period defaults to the index of the current voting period + in [ctxt]. *) +val ballot : + Context.t -> + Contract.t -> + ?period:int32 -> + Tezos_crypto.Protocol_hash.t -> + Vote.ballot -> + Operation.packed tzresult Lwt.t + +val dummy_script : Script.t + +val dummy_script_cost : Tez.t + +(** [tx_rollup_origination ctxt source] Originate a new tx rollup operation, + sign it with [source] and returns it alongside the tx rollup address. The + tx_rollup address is using the initial origination nonce with the hash of the + operation. If this operation is combined with [combine_operations] then the + tx rollup address is false as the nonce is not based on the correct operation + hash. *) +val tx_rollup_origination : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + (Operation.packed * Tx_rollup.t) tzresult Lwt.t + +(** [tx_rollup_submit_batch ctxt source tx_rollup batch] submits + [batch], an array of bytes that is expected to be a batch of L2 + transactions, to be appended in the inbox of [tx_rollup]. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val tx_rollup_submit_batch : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?burn_limit:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + string -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_commit ctxt source tx_rollup commitment] Commits to a + tx. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val tx_rollup_commit : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Tx_rollup_commitment.Full.t -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_return_bond ctxt source tx_rollup] returns a commitment + bond. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default..}} *) +val tx_rollup_return_bond : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_finalize ctxt source tx_rollup] finalizes the most + recent final level of a rollup. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val tx_rollup_finalize : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_remove_commitment ctxt source tx_rollup] tries to + remove a commitment from the rollup context. *) +val tx_rollup_remove_commitment : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_dispatch_tickets ctxt ~source ~message_index tx_rollup + level context_hash tickets_info] sends all tickets from + [tickets_info] to the appropriate implicit accounts, as authorized + by the [message_index]th hash of the commitment of [tx_rollup] + posted for [level]. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val tx_rollup_dispatch_tickets : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + source:Contract.t -> + message_index:int -> + message_result_path:Tx_rollup_commitment.Merkle.path -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tezos_crypto.Context_hash.t -> + Tx_rollup_reveal.t list -> + (packed_operation, tztrace) result Lwt.t + +(** [transfer_ticket] allows an implicit account to transfer tickets they owned. + + The arguments are: + + {ul + {li [Context.t]: the context on which to apply the operation} + {li [source:Contract.t]: the source contract of the operation} + {li [Tx_rollup.t]: the rollup to which the withdrawal pertains} + {li [Tx_rollup_level.t]: the level on which the withdrawal was commited} + {li [contents:Script.lazy_expr]: the contents of the ticket of + the withdrawal} + {li [ty:Script.lazy_expr]: the type of the ticket of the withdrawal} + {li [ticketer:Contract.t]: the ticketer of the ticket of the withdrawal} + {li [Z.t]: the quantity of the ticket of the withdrawal} + {li [destination:Contract.t]: the destination contract that + should receive the ticket of the withdrawal} + {li [Entrypoint_repr.t]: the entrypoint of the destination + contract to which the ticket should be sent}} + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val transfer_ticket : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + source:Contract.t -> + contents:Script.lazy_expr -> + ty:Script.lazy_expr -> + ticketer:Contract.t -> + amount:Ticket_amount.t -> + destination:Contract.t -> + entrypoint:Entrypoint_repr.t -> + (packed_operation, tztrace) result Lwt.t + +(** [tx_rollup_raw_reject] is a low-level helpers to reject a + commitment by providing a serialized proofs (which can be + invalid). See {!tx_rollup_reject} if you are interested in a + helper that guarantees the submitted proof to be decodable by the + protocol. *) +val tx_rollup_raw_reject : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_message.t -> + message_position:int -> + message_path:Tx_rollup_inbox.Merkle.path -> + message_result_hash:Tx_rollup_message_result_hash.t -> + message_result_path:Tx_rollup_commitment.Merkle.path -> + proof:Tx_rollup_l2_proof.serialized -> + previous_message_result:Tx_rollup_message_result.t -> + previous_message_result_path:Tx_rollup_commitment.Merkle.path -> + Operation.packed tzresult Lwt.t + +(** [tx_rollup_reject ctxt source tx_rollup tx_rollup level message + index proof] Rejects a tx rollup commitment. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val tx_rollup_reject : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_message.t -> + message_position:int -> + message_path:Tx_rollup_inbox.Merkle.path -> + message_result_hash:Tx_rollup_message_result_hash.t -> + message_result_path:Tx_rollup_commitment.Merkle.path -> + proof:Tx_rollup_l2_proof.t -> + previous_message_result:Tx_rollup_message_result.t -> + previous_message_result_path:Tx_rollup_commitment.Merkle.path -> + Operation.packed tzresult Lwt.t + +(** [sc_rollup_origination ctxt source kind boot_sector] originates a + new smart contract rollup of some given [kind] booting using + [boot_sector]. The process is the same as in + [tx_rollup_origination]. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val sc_rollup_origination : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?origination_proof:Sc_rollup.Proof.serialized -> + Context.t -> + Contract.t -> + Sc_rollup.Kind.t -> + boot_sector:string -> + parameters_ty:Script.lazy_expr -> + (packed_operation * Sc_rollup.t) tzresult Lwt.t + +(** [sc_rollup_publish ctxt source rollup commitment] tries to publish + a commitment to the SCORU. Optional arguments allow to override + defaults: + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val sc_rollup_publish : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + Sc_rollup.Commitment.t -> + Operation.packed tzresult Lwt.t + +(** [sc_rollup_cement ctxt source rollup commitment] tries to cement + the specified commitment. + + Optional arguments allow to override defaults: + + {ul {li [?force_reveal:bool]: prepend the operation to reveal + [source]'s public key if the latter has not been revealed + yet. Disabled (set to [false]) by default.}} *) +val sc_rollup_cement : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + Sc_rollup.Commitment.Hash.t -> + Operation.packed tzresult Lwt.t + +val sc_rollup_execute_outbox_message : + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?force_reveal:bool -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + Sc_rollup.Commitment.Hash.t -> + output_proof:string -> + (packed_operation, tztrace) result Lwt.t + +(** [sc_rollup_recover_bond ctxt source sc_rollup staker] recovers the + commitment bond of [staker]. *) +val sc_rollup_recover_bond : + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + ?force_reveal:bool -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + public_key_hash -> + Operation.packed tzresult Lwt.t + +val sc_rollup_add_messages : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + string list -> + Operation.packed tzresult Lwt.t + +val sc_rollup_refute : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + public_key_hash -> + Sc_rollup.Game.refutation option -> + Operation.packed tzresult Lwt.t + +val sc_rollup_timeout : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.tez -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Sc_rollup.t -> + Sc_rollup.Game.Index.t -> + Operation.packed tzresult Lwt.t + +val dal_publish_slot_header : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + Dal.Slot.Header.operation -> + (packed_operation, tztrace) result Lwt.t + +(** [zk_rollup_origination ctxt source ~public_parameters ~circuits_info + ~init_state ~nb_ops] tries to originate a ZK Rollup. *) +val zk_rollup_origination : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + public_parameters:Plonk.Main_protocol.verifier_public_parameters -> + circuits_info:[`Public | `Private | `Fee] Zk_rollup.Account.SMap.t -> + init_state:Zk_rollup.State.t -> + nb_ops:int -> + (Operation.packed * Zk_rollup.t) tzresult Lwt.t + +val update_consensus_key : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + public_key -> + (packed_operation, tztrace) result Lwt.t + +val drain_delegate : + Context.t -> + consensus_key:Tezos_crypto.Signature.Public_key_hash.t -> + delegate:Tezos_crypto.Signature.Public_key_hash.t -> + destination:Tezos_crypto.Signature.Public_key_hash.t -> + packed_operation tzresult Lwt.t + +(** [zk_rollup_publish ctxt source ~zk_rollup ~op] tries to add an operation + to the pending list of a ZK Rollup. *) +val zk_rollup_publish : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + zk_rollup:Zk_rollup.t -> + ops:(Zk_rollup.Operation.t * Zk_rollup.Ticket.t option) list -> + Operation.packed tzresult Lwt.t + +(** [zk_rollup_update ctxt source ~zk_rollup ~update] tries to apply an update + to a ZK Rollup. *) +val zk_rollup_update : + ?force_reveal:bool -> + ?counter:Manager_counter.t -> + ?fee:Tez.t -> + ?gas_limit:gas_limit -> + ?storage_limit:Z.t -> + Context.t -> + Contract.t -> + zk_rollup:Zk_rollup.t -> + update:Zk_rollup.Update.t -> + Operation.packed tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/operation_generator.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/operation_generator.ml new file mode 100644 index 000000000000..6503b38e7574 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/operation_generator.ml @@ -0,0 +1,854 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** These generators aims at generating operations which are not + necessary correct. The goal is to tests functions such as {! + Operation.compare} with as much as possible parameters that play a + role in operation [weight] computation. + + When adding a new operation, one should also add its weight + computation, hence knows which kind of generator should be provided + for this new operation.*) + +open Protocol +open Alpha_context + +(** {2 Operations kind labelling.} *) + +let consensus_pass = `PConsensus + +let anonymous_pass = `PAnonymous + +let vote_pass = `PVote + +let manager_pass = `PManager + +let all_passes = [`PConsensus; `PAnonymous; `PVote; `PManager] + +let consensus_kinds = [`KPreendorsement; `KEndorsement; `KDal_attestation] + +let anonymous_kinds = + [ + `KSeed_nonce_revelation; + `KVdf_revelation; + `KDouble_endorsement; + `KDouble_preendorsement; + `KDouble_baking; + `KActivate_account; + ] + +let vote_kinds = [`KProposals; `KBallot] + +(* N.b. we do not consider Failing_noop as those will never be valid. *) +let manager_kinds = + [ + `KReveal; + `KTransaction; + `KOrigination; + `KDelegation; + `KSet_deposits_limit; + `KIncrease_paid_storage; + `KRegister_global_constant; + `KTx_rollup_origination; + `KTx_rollup_submit_batch; + `KTx_rollup_commit; + `KTx_rollup_return_bond; + `KTx_rollup_finalize_commitment; + `KTx_rollup_remove_commitment; + `KTx_rollup_rejection; + `KTx_rollup_dispatch_tickets; + `KTransfer_ticket; + `KDal_publish_slot_header; + `KSc_rollup_originate; + `KSc_rollup_add_messages; + `KSc_rollup_cement; + `KSc_rollup_publish; + `KSc_rollup_refute; + `KSc_rollup_timeout; + `KSc_rollup_execute_outbox_message; + `KSc_rollup_recover_bond; + ] + +let pass_to_operation_kinds = function + | `PConsensus -> consensus_kinds + | `PVote -> vote_kinds + | `PAnonymous -> anonymous_kinds + | `PManager -> [`KManager] + +let pp_kind fmt k = + Format.fprintf + fmt + "%s" + (match k with + | `KPreendorsement -> "KPreendorsement" + | `KEndorsement -> "KEndorsement" + | `KDal_attestation -> "KDal_attestation" + | `KSeed_nonce_revelation -> "KSeed_nonce_revelation" + | `KVdf_revelation -> "KVdf_revelation" + | `KDouble_endorsement -> "KDouble_endorsement" + | `KDouble_preendorsement -> "KDouble_preendorsement" + | `KDouble_baking -> "KDouble_baking" + | `KActivate_account -> "KActivate_account" + | `KProposals -> "KProposals" + | `KBallot -> "KBallot" + | `KManager -> "KManager") + +(** {2 Generators} *) + +module Gen_hash (H : sig + type t + + val size : int + + val of_bytes_exn : bytes -> t +end) = +struct + let gen = + let open QCheck2.Gen in + let+ str = string_size (pure H.size) in + H.of_bytes_exn (Bytes.unsafe_of_string str) +end + +(** {3 Selection in hashes list} *) + +let gen_block_hash = + let module G = Gen_hash (Tezos_crypto.Block_hash) in + G.gen + +let random_payload_hash = + let module G = Gen_hash (Block_payload_hash) in + G.gen + +let gen_algo = QCheck2.Gen.oneofl Tezos_crypto.Signature.algos + +let random_seed = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.Hacl.Ed25519.sk_size) in + Bytes.unsafe_of_string str + +let random_keys = + let open QCheck2.Gen in + let* algo = gen_algo in + let+ seed = random_seed in + Tezos_crypto.Signature.generate_key ~algo ~seed () + +let random_tz1 = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.Ed25519.Public_key_hash.size) in + (Ed25519 (Tezos_crypto.Ed25519.Public_key_hash.of_string_exn str) + : public_key_hash) + +let random_tz2 = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.Secp256k1.Public_key_hash.size) in + (Secp256k1 (Tezos_crypto.Secp256k1.Public_key_hash.of_string_exn str) + : public_key_hash) + +let random_tz3 = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.P256.Public_key_hash.size) in + (P256 (Tezos_crypto.P256.Public_key_hash.of_string_exn str) : public_key_hash) + +let random_tz4 = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.Bls.Public_key_hash.size) in + (Bls (Tezos_crypto.Bls.Public_key_hash.of_string_exn str) : public_key_hash) + +let random_pkh = + let open QCheck2.Gen in + let* algo = gen_algo in + match algo with + | Ed25519 -> random_tz1 + | Secp256k1 -> random_tz2 + | P256 -> random_tz3 + | Bls -> random_tz4 + +let random_pk = + let open QCheck2.Gen in + let+ _, pk, _ = random_keys in + pk + +let random_signature = + let open QCheck2.Gen in + let* algo = option ~ratio:0.8 gen_algo in + match algo with + | None -> + let+ str = string_size (pure Tezos_crypto.Ed25519.size) in + (Unknown (Bytes.unsafe_of_string str) : Tezos_crypto.Signature.t) + | Some Ed25519 -> + let+ str = string_size (pure Tezos_crypto.Ed25519.size) in + (Ed25519 (Tezos_crypto.Ed25519.of_string_exn str) + : Tezos_crypto.Signature.t) + | Some Secp256k1 -> + let+ str = string_size (pure Tezos_crypto.Secp256k1.size) in + (Secp256k1 (Tezos_crypto.Secp256k1.of_string_exn str) + : Tezos_crypto.Signature.t) + | Some P256 -> + let+ str = string_size (pure Tezos_crypto.P256.size) in + (P256 (Tezos_crypto.P256.of_string_exn str) : Tezos_crypto.Signature.t) + | Some Bls -> + let+ seed = random_seed in + let _, _, sk = Tezos_crypto.Signature.generate_key ~algo:Bls ~seed () in + Tezos_crypto.Signature.sign sk Bytes.empty + +let random_signature = + let open QCheck2.Gen in + graft_corners + random_signature + Tezos_crypto.Signature. + [ + of_ed25519 Tezos_crypto.Ed25519.zero; + of_secp256k1 Tezos_crypto.Secp256k1.zero; + of_p256 Tezos_crypto.P256.zero; + of_bls Tezos_crypto.Bls.zero; + Unknown (Bytes.make 64 '\000'); + ] + () + +let random_contract_hash = + let module G = Gen_hash (Contract_hash) in + G.gen + +let block_headers = + let bh1 = + {json|{ "level": 2, "proto": 1, "predecessor": "BLbcVY1kYiKQy2MJJfoHJMN2xRk5QPG1PEKWMDSyW2JMxBsMmiL", "timestamp": "2022-08-08T11:16:30Z", "validation_pass": 4, "operations_hash": "LLoa7bxRTKaQN2bLYoitYB6bU2DvLnBAqrVjZcvJ364cTcX2PZYKU", "fitness": [ "02", "00000002", "", "ffffffff", "00000001" ], "context": "CoUvpF8XBUfz3w9CJumt4ZKGZkrcdcfs1Qdrrd1ZeFij64E1QCud", "payload_hash": "vh2TyrWeZ2dydEy9ZjmvrjQvyCs5sdHZPypcZrXDUSM1tNuPermf", "payload_round": 1, "proof_of_work_nonce": "62de1e0d00000000", "liquidity_baking_toggle_vote": "pass", "signature": "sigaXGo4DWsZwo1SvbKCp2hLgE5jcwd61Ufkc3iMt3sXy3NBj9jticuJKJnRhyH2ZPJQMwEuDqQTgZgoK5xRH6HeF7YxLb4u" }|json} + in + let bh2 = + {json|{ "level": 3, "proto": 1, "predecessor": "BLAUNUbzKHgA4DYQEXCbxY73wdE2roGAzvJJbFp8dQe62Ekpada", "timestamp": "2022-08-08T11:16:32Z", "validation_pass": 4, "operations_hash": "LLoaWjBX8Cm8DVpoLNtm7FPNnxUdL6Dakq122pVfNHYaf2rE9GQXi", "fitness": [ "02", "00000003", "", "fffffffe", "00000000" ], "context": "CoUtWowJUqXwMm4pbR1jjyFfVRHqRHGs6bYVDaaByvbmULoAND2x", "payload_hash": "vh1p1VzeYjZLEW6WDqdTwVy354KEmGCDgPmagEKcLN4NT4X58mNk", "payload_round": 0, "proof_of_work_nonce": "62de1e0d00000000", "liquidity_baking_toggle_vote": "pass", "signature": "sigVqWWE7BPuxHqPWiVRmzQ1eMZZAPAxGJ94ytY2sjV8Y1Z4QH1F2bPGZS1ZeWDbqmcppPPFobRpi7wNasQ17Mm9CFGKag2t" }|json} + in + let bh3 = + {json|{ "level": 4, "proto": 1, "predecessor": "BLuurCvGmNPTzXSnGCpcFPy5h8A49PwH2LnfAWBnp5R1qv5czwe", "timestamp": "2022-08-08T11:16:33Z", "validation_pass": 4, "operations_hash": "LLoaf8AANzyNxhk715zykDrwG5Bpqw6FsZLWWNp2Dcm3ewFrcc3Wc", "fitness": [ "02", "00000004", "", "ffffffff", "00000000" ], "context": "CoVzxEBMDhxpGVxrguik6r5qVogJBFyhuvwm2KZBcsmvqhekPiwL", "payload_hash": "vh2gWcSUUhJBwvjx4vS7JN5ioMVWpHCSK6W2MKNPr5dn6NUdfFDQ", "payload_round": 0, "proof_of_work_nonce": "62de1e0d00000000", "seed_nonce_hash": "nceV3VjdHp1yk6uqcQicQBxLJY1AfWvLSabQpqnpiqkC1q2tS35EN", "liquidity_baking_toggle_vote": "pass", "signature": "sigijumaDLSQwjh2AKK7af1VcEDsZsRwbweL8hF176puhHy3ySVocNCbrwPqJLiQP8EbqY5YL6z6b1vDaw12h8MQU2Rh4SW1" }|json} + in + List.map + (fun s -> + let open Data_encoding.Json in + from_string s |> function + | Ok json -> destruct Alpha_context.Block_header.encoding json + | Error _ -> assert false) + [bh1; bh2; bh3] + +let random_block_header = QCheck2.Gen.oneofl block_headers + +let random_tx_rollup = + let open QCheck2.Gen in + let module G = Gen_hash (Tezos_crypto.Operation_hash) in + let+ oph = G.gen in + let nonce = Origination_nonce.Internal_for_tests.initial oph in + Tx_rollup.Internal_for_tests.originated_tx_rollup nonce + +let random_sc_rollup = + let module G = Gen_hash (Sc_rollup.Address) in + G.gen + +let random_proto = + let module G = Gen_hash (Tezos_crypto.Protocol_hash) in + G.gen + +let random_code = + let open QCheck2.Gen in + let+ str = string_size (pure Tezos_crypto.Ed25519.Public_key_hash.size) in + let (`Hex hex) = Hex.of_string str in + Blinded_public_key_hash.activation_code_of_hex hex + |> WithExceptions.Option.get ~loc:__LOC__ + +(** {2 Operations parameters generators} *) + +let random_shell : Tezos_base.Operation.shell_header QCheck2.Gen.t = + let open QCheck2.Gen in + let+ branch = gen_block_hash in + Tezos_base.Operation.{branch} + +let gen_slot = + let open QCheck2.Gen in + let+ i = small_nat in + match Slot.Internal_for_tests.of_int i with + | Ok slot -> slot + | Error _ -> assert false + +let gen_level = + let open QCheck2.Gen in + let+ i = ui32 in + match Raw_level.of_int32 i with Ok v -> v | Error _ -> assert false + +let gen_round = + let open QCheck2.Gen in + let+ i = ui32 in + match Round.of_int32 i with Ok v -> v | Error _ -> assert false + +let generate_consensus_content : consensus_content QCheck2.Gen.t = + let open QCheck2.Gen in + let* slot = gen_slot in + let* level = gen_level in + let* round = gen_round in + let+ block_payload_hash = random_payload_hash in + {slot; level; round; block_payload_hash} + +let gen_tez = + let open QCheck2.Gen in + let+ i = ui64 in + match Tez.of_mutez i with None -> Tez.zero | Some v -> v + +let gen_fee = gen_tez + +let gen_amount = gen_tez + +let gen_amount_in_bytes = + let open QCheck2.Gen in + let+ i = nat in + Z.of_int i + +let random_contract = + let open QCheck2.Gen in + let* b = bool in + if b then + let+ pkh = random_pkh in + Contract.Implicit pkh + else + let+ contract_hash = random_contract_hash in + Contract.Originated contract_hash + +let gen_counters = + let open QCheck2.Gen in + let+ i = nat in + Manager_counter.Internal_for_tests.of_int i + +let gen_ticket_amounts = + let open QCheck2.Gen in + let+ i = nat in + Option.value (Ticket_amount.of_zint (Z.of_int i)) ~default:Ticket_amount.one + +let gen_gas_limit = + let open QCheck2.Gen in + let+ i = nat in + Gas.Arith.integral_of_int_exn i + +let gen_storage_limit = + let open QCheck2.Gen in + let+ i = nat in + Z.of_int i + +let nonces = + List.map + (fun i -> + let b = Bytes.create 32 in + Bytes.set_int8 b 0 i ; + Alpha_context.Nonce.of_bytes b |> function + | Ok v -> v + | Error _ -> assert false) + [1; 2; 3] + +let random_nonce = QCheck2.Gen.oneofl nonces + +let vdf_solutions = + let open Environment.Vdf in + let opt_assert = function Some v -> v | None -> assert false in + List.map + (fun i -> + let b = Bytes.create form_size_bytes in + Bytes.set_int8 b 0 i ; + let result = result_of_bytes_opt b |> opt_assert in + let proof = proof_of_bytes_opt b |> opt_assert in + (result, proof)) + [1; 2; 3] + +(** {2 Generators for each Operation Kind} *) + +let wrap_operation sh (pdata : 'kind protocol_data) : 'kind operation = + {shell = sh; protocol_data = pdata} + +let generate_op (gen_op : 'kind contents QCheck2.Gen.t) : + 'kind operation QCheck2.Gen.t = + let open QCheck2.Gen in + let* op = gen_op in + let* signature = option ~ratio:0.9 random_signature in + let+ shell = random_shell in + let contents = Single op in + let protocol_data = {contents; signature} in + wrap_operation shell protocol_data + +let generate_operation gen_op = + let open QCheck2.Gen in + let+ op = generate_op gen_op in + Operation.pack op + +let generate_preendorsement = + let open QCheck2.Gen in + let+ cc = generate_consensus_content in + Preendorsement cc + +let generate_endorsement = + let open QCheck2.Gen in + let+ cc = generate_consensus_content in + Endorsement cc + +let generate_dal_attestation = + let open QCheck2.Gen in + let+ attestor = random_pkh in + Dal_attestation + Dal.Attestation. + {attestor; attestation = Dal.Attestation.empty; level = Raw_level.root} + +let generate_vdf_revelation = + let open QCheck2.Gen in + let+ solution = oneofl vdf_solutions in + Vdf_revelation {solution} + +let generate_seed_nonce_revelation = + let open QCheck2.Gen in + let* level = gen_level in + let+ nonce = random_nonce in + Seed_nonce_revelation {level; nonce} + +let generate_double_preendorsement = + let open QCheck2.Gen in + let* op1 = generate_op generate_preendorsement in + let+ op2 = generate_op generate_preendorsement in + Double_preendorsement_evidence {op1; op2} + +let generate_double_endorsement = + let open QCheck2.Gen in + let* op1 = generate_op generate_endorsement in + let+ op2 = generate_op generate_endorsement in + Double_endorsement_evidence {op1; op2} + +let generate_double_baking = + let open QCheck2.Gen in + let* bh1 = random_block_header in + let+ bh2 = random_block_header in + Double_baking_evidence {bh1; bh2} + +let generate_activate_account = + let open QCheck2.Gen in + let* activation_code = random_code in + let+ id = random_tz1 in + let id = + match id with + | Tezos_crypto.Signature.Ed25519 pkh -> pkh + | _ -> assert false + in + Activate_account {id; activation_code} + +let random_period = + let open QCheck2.Gen in + let+ i = ui32 in + i + +let generate_proposals = + let open QCheck2.Gen in + let* source = random_pkh in + let+ period = random_period in + let proposals = [] in + Proposals {source; period; proposals} + +let generate_ballot = + let open QCheck2.Gen in + let* source = random_pkh in + let* period = random_period in + let+ proposal = random_proto in + let ballot = Vote.Pass in + Ballot {source; period; proposal; ballot} + +let generate_manager_aux ?source gen_manop = + let open QCheck2.Gen in + let* source = + match source with None -> random_pkh | Some source -> return source + in + let* fee = gen_fee in + let* counter = gen_counters in + let* gas_limit = gen_gas_limit in + let* storage_limit = gen_storage_limit in + let+ operation = gen_manop in + Manager_operation {source; fee; counter; operation; gas_limit; storage_limit} + +let generate_manager ?source gen_manop = + generate_op (generate_manager_aux ?source gen_manop) + +let generate_manager_operation ?source gen_manop = + let open QCheck2.Gen in + let+ manop = generate_manager ?source gen_manop in + Operation.pack manop + +let generate_reveal = + let open QCheck2.Gen in + let+ pk = random_pk in + Reveal pk + +let generate_transaction = + let open QCheck2.Gen in + let* amount = gen_amount in + let+ destination = random_contract in + let parameters = Script.unit_parameter in + let entrypoint = Entrypoint.default in + Transaction {amount; parameters; entrypoint; destination} + +let generate_origination = + let open QCheck2.Gen in + let+ credit = gen_amount in + let delegate = None in + let script = Script.{code = unit_parameter; storage = unit_parameter} in + Origination {delegate; script; credit} + +let generate_delegation = + let open QCheck2.Gen in + let+ delegate = option random_pkh in + Delegation delegate + +let generate_increase_paid_storage = + let open QCheck2.Gen in + let* amount_in_bytes = gen_amount_in_bytes in + let+ destination = random_contract_hash in + Increase_paid_storage {amount_in_bytes; destination} + +let generate_set_deposits_limit = + let open QCheck2.Gen in + let+ amount_opt = option gen_amount in + Set_deposits_limit amount_opt + +let generate_register_global_constant = + let value = Script_repr.lazy_expr (Expr.from_string "Pair 1 2") in + QCheck2.Gen.pure (Register_global_constant {value}) + +let generate_tx_rollup_origination = QCheck2.Gen.pure Tx_rollup_origination + +let generate_tx_rollup_submit_batch = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + let content = "batch" in + let burn_limit = None in + Tx_rollup_submit_batch {tx_rollup; content; burn_limit} + +let generate_tx_rollup_commit = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + let commitment : Tx_rollup_commitment.Full.t = + { + level = Tx_rollup_level.root; + messages = []; + predecessor = None; + inbox_merkle_root = Tx_rollup_inbox.Merkle.merklize_list []; + } + in + Tx_rollup_commit {tx_rollup; commitment} + +let generate_tx_rollup_return_bond = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + Tx_rollup_return_bond {tx_rollup} + +let generate_tx_finalize_commitment = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + Tx_rollup_finalize_commitment {tx_rollup} + +let generate_tx_rollup_remove_commitment = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + Tx_rollup_remove_commitment {tx_rollup} + +let generate_tx_rollup_rejection = + let open QCheck2.Gen in + let+ tx_rollup = random_tx_rollup in + let message, _ = Tx_rollup_message.make_batch "" in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = + match Tx_rollup_inbox.Merkle.compute_path [message_hash] 0 with + | Ok message_path -> message_path + | _ -> raise (Invalid_argument "Single_message_inbox.message_path") + in + let proof : Tx_rollup_l2_proof.t = + { + version = 1; + before = `Value Tx_rollup_message_result.empty_l2_context_hash; + after = `Value Tezos_crypto.Context_hash.zero; + state = Seq.empty; + } + in + let previous_message_result : Tx_rollup_message_result.t = + { + context_hash = Tx_rollup_message_result.empty_l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + let level = Tx_rollup_level.root in + let message_result_hash = Tx_rollup_message_result_hash.zero in + let message_result_path = Tx_rollup_commitment.Merkle.dummy_path in + let previous_message_result_path = Tx_rollup_commitment.Merkle.dummy_path in + let message_position = 0 in + let proof = Tx_rollup_l2_proof.serialize_proof_exn proof in + Tx_rollup_rejection + { + tx_rollup; + level; + message; + message_position; + message_path; + message_result_hash; + message_result_path; + previous_message_result; + previous_message_result_path; + proof; + } + +let generate_tx_dispatch_tickets = + let open QCheck2.Gen in + let* tx_rollup = random_tx_rollup in + let* source = random_pkh in + let+ contract = random_contract in + let level = Tx_rollup_level.root in + let message_index = 0 in + let message_result_path = Tx_rollup_commitment.Merkle.dummy_path in + let context_hash = Tezos_crypto.Context_hash.zero in + let reveal = + Tx_rollup_reveal. + { + contents = Script.lazy_expr (Expr.from_string "1"); + ty = Script.lazy_expr (Expr.from_string "nat"); + ticketer = contract; + amount = Tx_rollup_l2_qty.of_int64_exn 10L; + claimer = source; + } + in + let tickets_info = [reveal] in + Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + message_result_path; + tickets_info; + } + +let generate_transfer_ticket = + let open QCheck2.Gen in + let* ticketer = random_contract in + let* destination = random_contract in + let+ amount = gen_ticket_amounts in + let contents = Script.lazy_expr (Expr.from_string "1") in + let ty = Script.lazy_expr (Expr.from_string "nat") in + let entrypoint = Entrypoint.default in + Transfer_ticket {contents; ty; ticketer; amount; destination; entrypoint} + +let generate_dal_publish_slot_header = + let published_level = Alpha_context.Raw_level.of_int32_exn Int32.zero in + let index = Alpha_context.Dal.Slot_index.zero in + let commitment = Alpha_context.Dal.Slot.Commitment.zero in + let proof = Alpha_context.Dal.Slot.Commitment_proof.zero in + let slot_header = + Alpha_context.Dal.Slot.Header. + {header = {id = {published_level; index}; commitment}; proof} + in + QCheck2.Gen.pure (Dal_publish_slot_header slot_header) + +let generate_sc_rollup_originate = + let kind = Sc_rollup.Kind.Example_arith in + let boot_sector = "" in + let parameters_ty = Script.lazy_expr (Expr.from_string "1") in + let origination_proof = + Lwt_main.run (Sc_rollup_helpers.origination_proof ~boot_sector kind) + in + QCheck2.Gen.pure + (Sc_rollup_originate {kind; boot_sector; origination_proof; parameters_ty}) + +let generate_sc_rollup_add_messages = + let open QCheck2.Gen in + return (Sc_rollup_add_messages {messages = []}) + +let sc_dummy_commitment = + let number_of_ticks = + match Sc_rollup.Number_of_ticks.of_value 3000L with + | None -> assert false + | Some x -> x + in + Sc_rollup.Commitment. + { + predecessor = Sc_rollup.Commitment.Hash.zero; + inbox_level = Raw_level.of_int32_exn Int32.zero; + number_of_ticks; + compressed_state = Sc_rollup.State_hash.zero; + } + +let generate_sc_rollup_cement = + let open QCheck2.Gen in + let+ rollup = random_sc_rollup in + let commitment = Sc_rollup.Commitment.hash_uncarbonated sc_dummy_commitment in + Sc_rollup_cement {rollup; commitment} + +let generate_sc_rollup_publish = + let open QCheck2.Gen in + let+ rollup = random_sc_rollup in + let commitment = sc_dummy_commitment in + Sc_rollup_publish {rollup; commitment} + +let generate_sc_rollup_refute = + let open QCheck2.Gen in + let* opponent = random_pkh in + let+ rollup = random_sc_rollup in + let refutation : Sc_rollup.Game.refutation option = + Some {choice = Sc_rollup.Tick.initial; step = Dissection []} + in + Sc_rollup_refute {rollup; opponent; refutation} + +let generate_sc_rollup_timeout = + let open QCheck2.Gen in + let* source = random_pkh in + let* rollup = random_sc_rollup in + let+ staker = random_pkh in + let stakers = Sc_rollup.Game.Index.make source staker in + Sc_rollup_timeout {rollup; stakers} + +let generate_sc_rollup_execute_outbox_message = + let open QCheck2.Gen in + let+ rollup = random_sc_rollup in + let cemented_commitment = + Sc_rollup.Commitment.hash_uncarbonated sc_dummy_commitment + in + let output_proof = "" in + Sc_rollup_execute_outbox_message {rollup; cemented_commitment; output_proof} + +let generate_sc_rollup_recover_bond = + let open QCheck2.Gen in + let* staker = random_pkh in + let+ sc_rollup = random_sc_rollup in + Sc_rollup_recover_bond {sc_rollup; staker} + +(** {By Kind Operation Generator} *) + +let generator_of ?source = function + | `KReveal -> generate_manager_operation ?source generate_reveal + | `KTransaction -> generate_manager_operation ?source generate_transaction + | `KOrigination -> generate_manager_operation ?source generate_origination + | `KSet_deposits_limit -> + generate_manager_operation ?source generate_set_deposits_limit + | `KIncrease_paid_storage -> + generate_manager_operation ?source generate_increase_paid_storage + | `KDelegation -> generate_manager_operation ?source generate_delegation + | `KRegister_global_constant -> + generate_manager_operation ?source generate_register_global_constant + | `KTx_rollup_origination -> + generate_manager_operation ?source generate_tx_rollup_origination + | `KTransfer_ticket -> + generate_manager_operation ?source generate_transfer_ticket + | `KDal_publish_slot_header -> + generate_manager_operation ?source generate_dal_publish_slot_header + | `KTx_rollup_submit_batch -> + generate_manager_operation ?source generate_tx_rollup_submit_batch + | `KTx_rollup_commit -> + generate_manager_operation ?source generate_tx_rollup_commit + | `KTx_rollup_return_bond -> + generate_manager_operation ?source generate_tx_rollup_return_bond + | `KTx_rollup_finalize_commitment -> + generate_manager_operation ?source generate_tx_finalize_commitment + | `KTx_rollup_remove_commitment -> + generate_manager_operation ?source generate_tx_rollup_remove_commitment + | `KTx_rollup_rejection -> + generate_manager_operation ?source generate_tx_rollup_rejection + | `KTx_rollup_dispatch_tickets -> + generate_manager_operation ?source generate_tx_dispatch_tickets + | `KSc_rollup_originate -> + generate_manager_operation ?source generate_sc_rollup_originate + | `KSc_rollup_add_messages -> + generate_manager_operation ?source generate_sc_rollup_add_messages + | `KSc_rollup_cement -> + generate_manager_operation ?source generate_sc_rollup_cement + | `KSc_rollup_publish -> + generate_manager_operation ?source generate_sc_rollup_publish + | `KSc_rollup_refute -> + generate_manager_operation ?source generate_sc_rollup_refute + | `KSc_rollup_timeout -> + generate_manager_operation ?source generate_sc_rollup_timeout + | `KSc_rollup_execute_outbox_message -> + generate_manager_operation + ?source + generate_sc_rollup_execute_outbox_message + | `KSc_rollup_recover_bond -> + generate_manager_operation ?source generate_sc_rollup_recover_bond + +let generate_manager_operation batch_size = + let open QCheck2.Gen in + let* source = random_pkh in + let source = Some source in + let* l = + flatten_l (Stdlib.List.init batch_size (fun _ -> oneofl manager_kinds)) + in + let* packed_manager_ops = flatten_l (List.map (generator_of ?source) l) in + let first_op = Stdlib.List.hd packed_manager_ops in + let unpacked_operations = + List.map + (function + | {Alpha_context.protocol_data = Operation_data {contents; _}; _} -> ( + match Contents_list contents with + | Contents_list (Single o) -> Contents o + | Contents_list + (Cons (Manager_operation {operation = Reveal _; _}, Single o)) + -> + Contents o + | _ -> assert false)) + packed_manager_ops + in + let contents_list = + List.fold_left + (fun acc -> function + | Contents (Manager_operation m) -> + Contents (Manager_operation m) :: acc + | x -> x :: acc) + [] + unpacked_operations + |> List.rev + in + let (Contents_list contents_list) = + match Operation.of_list contents_list with Ok v -> v | _ -> assert false + in + let signature = + match first_op.protocol_data with + | Operation_data {signature; _} -> signature + in + let protocol_data = {contents = contents_list; signature} in + return (Operation.pack {shell = first_op.shell; protocol_data}) + +let generate_operation = + let open QCheck2.Gen in + let* pass = oneofl all_passes in + let* kind = oneofl (pass_to_operation_kinds pass) in + let+ packed_operation = + match kind with + | `KPreendorsement -> generate_operation generate_preendorsement + | `KEndorsement -> generate_operation generate_endorsement + | `KDal_attestation -> generate_operation generate_dal_attestation + | `KSeed_nonce_revelation -> + generate_operation generate_seed_nonce_revelation + | `KVdf_revelation -> generate_operation generate_vdf_revelation + | `KDouble_endorsement -> generate_operation generate_double_endorsement + | `KDouble_preendorsement -> + generate_operation generate_double_preendorsement + | `KDouble_baking -> generate_operation generate_double_baking + | `KActivate_account -> generate_operation generate_activate_account + | `KProposals -> generate_operation generate_proposals + | `KBallot -> generate_operation generate_ballot + | `KManager -> + let* batch_size = int_range 1 49 in + generate_manager_operation batch_size + in + (kind, (Operation.hash_packed packed_operation, packed_operation)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/rewards.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/rewards.ml new file mode 100644 index 000000000000..bc9c833a8221 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/rewards.ml @@ -0,0 +1,1641 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2019--2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2019 Cryptium Labs <hello@cryptium.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The tables are precomputed using this the following formulas: + +let max_endos = 256 +let max_reward = 40 + +let r = 0.5 +let a = 3. +let b = 1.5 + +let ( -- ) i j = List.init (j - i + 1) (fun x -> x + i) + +let baking_rewards = + let reward p e = + let r_aux = + if p = 0 then + r *. (float_of_int max_reward) + else + a + in + let r = r_aux /. (float_of_int max_endos) in + let r = 1_000_000. *. r in + Float.to_int ((float_of_int e) *. (ceil r)) in + + let ps = 0 -- 2 in + let es = 0 -- max_endos in + + List.map (fun p -> + List.map (fun e -> + reward p e + ) es |> Array.of_list + ) ps |> Array.of_list + + +let endorsing_rewards = + let reward p e = + let r_aux = + (1. -. r) *. + (float_of_int max_reward) /. + (float_of_int max_endos) in + let r = if p = 0 then r_aux else r_aux /. b in + let r = 1_000_000. *. r in + Float.to_int ((float_of_int e) *. (floor r)) in + + let ps = 0 -- 2 in + let es = 0 -- max_endos in + + List.map (fun p -> + List.map (fun e -> + reward p e + ) es |> Array.of_list + ) ps |> Array.of_list + + *) + +let baking_rewards : int array array = + [| + [| + 0; + 78125; + 156250; + 234375; + 312500; + 390625; + 468750; + 546875; + 625000; + 703125; + 781250; + 859375; + 937500; + 1015625; + 1093750; + 1171875; + 1250000; + 1328125; + 1406250; + 1484375; + 1562500; + 1640625; + 1718750; + 1796875; + 1875000; + 1953125; + 2031250; + 2109375; + 2187500; + 2265625; + 2343750; + 2421875; + 2500000; + 2578125; + 2656250; + 2734375; + 2812500; + 2890625; + 2968750; + 3046875; + 3125000; + 3203125; + 3281250; + 3359375; + 3437500; + 3515625; + 3593750; + 3671875; + 3750000; + 3828125; + 3906250; + 3984375; + 4062500; + 4140625; + 4218750; + 4296875; + 4375000; + 4453125; + 4531250; + 4609375; + 4687500; + 4765625; + 4843750; + 4921875; + 5000000; + 5078125; + 5156250; + 5234375; + 5312500; + 5390625; + 5468750; + 5546875; + 5625000; + 5703125; + 5781250; + 5859375; + 5937500; + 6015625; + 6093750; + 6171875; + 6250000; + 6328125; + 6406250; + 6484375; + 6562500; + 6640625; + 6718750; + 6796875; + 6875000; + 6953125; + 7031250; + 7109375; + 7187500; + 7265625; + 7343750; + 7421875; + 7500000; + 7578125; + 7656250; + 7734375; + 7812500; + 7890625; + 7968750; + 8046875; + 8125000; + 8203125; + 8281250; + 8359375; + 8437500; + 8515625; + 8593750; + 8671875; + 8750000; + 8828125; + 8906250; + 8984375; + 9062500; + 9140625; + 9218750; + 9296875; + 9375000; + 9453125; + 9531250; + 9609375; + 9687500; + 9765625; + 9843750; + 9921875; + 10000000; + 10078125; + 10156250; + 10234375; + 10312500; + 10390625; + 10468750; + 10546875; + 10625000; + 10703125; + 10781250; + 10859375; + 10937500; + 11015625; + 11093750; + 11171875; + 11250000; + 11328125; + 11406250; + 11484375; + 11562500; + 11640625; + 11718750; + 11796875; + 11875000; + 11953125; + 12031250; + 12109375; + 12187500; + 12265625; + 12343750; + 12421875; + 12500000; + 12578125; + 12656250; + 12734375; + 12812500; + 12890625; + 12968750; + 13046875; + 13125000; + 13203125; + 13281250; + 13359375; + 13437500; + 13515625; + 13593750; + 13671875; + 13750000; + 13828125; + 13906250; + 13984375; + 14062500; + 14140625; + 14218750; + 14296875; + 14375000; + 14453125; + 14531250; + 14609375; + 14687500; + 14765625; + 14843750; + 14921875; + 15000000; + 15078125; + 15156250; + 15234375; + 15312500; + 15390625; + 15468750; + 15546875; + 15625000; + 15703125; + 15781250; + 15859375; + 15937500; + 16015625; + 16093750; + 16171875; + 16250000; + 16328125; + 16406250; + 16484375; + 16562500; + 16640625; + 16718750; + 16796875; + 16875000; + 16953125; + 17031250; + 17109375; + 17187500; + 17265625; + 17343750; + 17421875; + 17500000; + 17578125; + 17656250; + 17734375; + 17812500; + 17890625; + 17968750; + 18046875; + 18125000; + 18203125; + 18281250; + 18359375; + 18437500; + 18515625; + 18593750; + 18671875; + 18750000; + 18828125; + 18906250; + 18984375; + 19062500; + 19140625; + 19218750; + 19296875; + 19375000; + 19453125; + 19531250; + 19609375; + 19687500; + 19765625; + 19843750; + 19921875; + 20000000; + |]; + [| + 0; + 11719; + 23438; + 35157; + 46876; + 58595; + 70314; + 82033; + 93752; + 105471; + 117190; + 128909; + 140628; + 152347; + 164066; + 175785; + 187504; + 199223; + 210942; + 222661; + 234380; + 246099; + 257818; + 269537; + 281256; + 292975; + 304694; + 316413; + 328132; + 339851; + 351570; + 363289; + 375008; + 386727; + 398446; + 410165; + 421884; + 433603; + 445322; + 457041; + 468760; + 480479; + 492198; + 503917; + 515636; + 527355; + 539074; + 550793; + 562512; + 574231; + 585950; + 597669; + 609388; + 621107; + 632826; + 644545; + 656264; + 667983; + 679702; + 691421; + 703140; + 714859; + 726578; + 738297; + 750016; + 761735; + 773454; + 785173; + 796892; + 808611; + 820330; + 832049; + 843768; + 855487; + 867206; + 878925; + 890644; + 902363; + 914082; + 925801; + 937520; + 949239; + 960958; + 972677; + 984396; + 996115; + 1007834; + 1019553; + 1031272; + 1042991; + 1054710; + 1066429; + 1078148; + 1089867; + 1101586; + 1113305; + 1125024; + 1136743; + 1148462; + 1160181; + 1171900; + 1183619; + 1195338; + 1207057; + 1218776; + 1230495; + 1242214; + 1253933; + 1265652; + 1277371; + 1289090; + 1300809; + 1312528; + 1324247; + 1335966; + 1347685; + 1359404; + 1371123; + 1382842; + 1394561; + 1406280; + 1417999; + 1429718; + 1441437; + 1453156; + 1464875; + 1476594; + 1488313; + 1500032; + 1511751; + 1523470; + 1535189; + 1546908; + 1558627; + 1570346; + 1582065; + 1593784; + 1605503; + 1617222; + 1628941; + 1640660; + 1652379; + 1664098; + 1675817; + 1687536; + 1699255; + 1710974; + 1722693; + 1734412; + 1746131; + 1757850; + 1769569; + 1781288; + 1793007; + 1804726; + 1816445; + 1828164; + 1839883; + 1851602; + 1863321; + 1875040; + 1886759; + 1898478; + 1910197; + 1921916; + 1933635; + 1945354; + 1957073; + 1968792; + 1980511; + 1992230; + 2003949; + 2015668; + 2027387; + 2039106; + 2050825; + 2062544; + 2074263; + 2085982; + 2097701; + 2109420; + 2121139; + 2132858; + 2144577; + 2156296; + 2168015; + 2179734; + 2191453; + 2203172; + 2214891; + 2226610; + 2238329; + 2250048; + 2261767; + 2273486; + 2285205; + 2296924; + 2308643; + 2320362; + 2332081; + 2343800; + 2355519; + 2367238; + 2378957; + 2390676; + 2402395; + 2414114; + 2425833; + 2437552; + 2449271; + 2460990; + 2472709; + 2484428; + 2496147; + 2507866; + 2519585; + 2531304; + 2543023; + 2554742; + 2566461; + 2578180; + 2589899; + 2601618; + 2613337; + 2625056; + 2636775; + 2648494; + 2660213; + 2671932; + 2683651; + 2695370; + 2707089; + 2718808; + 2730527; + 2742246; + 2753965; + 2765684; + 2777403; + 2789122; + 2800841; + 2812560; + 2824279; + 2835998; + 2847717; + 2859436; + 2871155; + 2882874; + 2894593; + 2906312; + 2918031; + 2929750; + 2941469; + 2953188; + 2964907; + 2976626; + 2988345; + 3000064; + |]; + [| + 0; + 11719; + 23438; + 35157; + 46876; + 58595; + 70314; + 82033; + 93752; + 105471; + 117190; + 128909; + 140628; + 152347; + 164066; + 175785; + 187504; + 199223; + 210942; + 222661; + 234380; + 246099; + 257818; + 269537; + 281256; + 292975; + 304694; + 316413; + 328132; + 339851; + 351570; + 363289; + 375008; + 386727; + 398446; + 410165; + 421884; + 433603; + 445322; + 457041; + 468760; + 480479; + 492198; + 503917; + 515636; + 527355; + 539074; + 550793; + 562512; + 574231; + 585950; + 597669; + 609388; + 621107; + 632826; + 644545; + 656264; + 667983; + 679702; + 691421; + 703140; + 714859; + 726578; + 738297; + 750016; + 761735; + 773454; + 785173; + 796892; + 808611; + 820330; + 832049; + 843768; + 855487; + 867206; + 878925; + 890644; + 902363; + 914082; + 925801; + 937520; + 949239; + 960958; + 972677; + 984396; + 996115; + 1007834; + 1019553; + 1031272; + 1042991; + 1054710; + 1066429; + 1078148; + 1089867; + 1101586; + 1113305; + 1125024; + 1136743; + 1148462; + 1160181; + 1171900; + 1183619; + 1195338; + 1207057; + 1218776; + 1230495; + 1242214; + 1253933; + 1265652; + 1277371; + 1289090; + 1300809; + 1312528; + 1324247; + 1335966; + 1347685; + 1359404; + 1371123; + 1382842; + 1394561; + 1406280; + 1417999; + 1429718; + 1441437; + 1453156; + 1464875; + 1476594; + 1488313; + 1500032; + 1511751; + 1523470; + 1535189; + 1546908; + 1558627; + 1570346; + 1582065; + 1593784; + 1605503; + 1617222; + 1628941; + 1640660; + 1652379; + 1664098; + 1675817; + 1687536; + 1699255; + 1710974; + 1722693; + 1734412; + 1746131; + 1757850; + 1769569; + 1781288; + 1793007; + 1804726; + 1816445; + 1828164; + 1839883; + 1851602; + 1863321; + 1875040; + 1886759; + 1898478; + 1910197; + 1921916; + 1933635; + 1945354; + 1957073; + 1968792; + 1980511; + 1992230; + 2003949; + 2015668; + 2027387; + 2039106; + 2050825; + 2062544; + 2074263; + 2085982; + 2097701; + 2109420; + 2121139; + 2132858; + 2144577; + 2156296; + 2168015; + 2179734; + 2191453; + 2203172; + 2214891; + 2226610; + 2238329; + 2250048; + 2261767; + 2273486; + 2285205; + 2296924; + 2308643; + 2320362; + 2332081; + 2343800; + 2355519; + 2367238; + 2378957; + 2390676; + 2402395; + 2414114; + 2425833; + 2437552; + 2449271; + 2460990; + 2472709; + 2484428; + 2496147; + 2507866; + 2519585; + 2531304; + 2543023; + 2554742; + 2566461; + 2578180; + 2589899; + 2601618; + 2613337; + 2625056; + 2636775; + 2648494; + 2660213; + 2671932; + 2683651; + 2695370; + 2707089; + 2718808; + 2730527; + 2742246; + 2753965; + 2765684; + 2777403; + 2789122; + 2800841; + 2812560; + 2824279; + 2835998; + 2847717; + 2859436; + 2871155; + 2882874; + 2894593; + 2906312; + 2918031; + 2929750; + 2941469; + 2953188; + 2964907; + 2976626; + 2988345; + 3000064; + |]; + |] + +let endorsing_rewards : int array array = + [| + [| + 0; + 78125; + 156250; + 234375; + 312500; + 390625; + 468750; + 546875; + 625000; + 703125; + 781250; + 859375; + 937500; + 1015625; + 1093750; + 1171875; + 1250000; + 1328125; + 1406250; + 1484375; + 1562500; + 1640625; + 1718750; + 1796875; + 1875000; + 1953125; + 2031250; + 2109375; + 2187500; + 2265625; + 2343750; + 2421875; + 2500000; + 2578125; + 2656250; + 2734375; + 2812500; + 2890625; + 2968750; + 3046875; + 3125000; + 3203125; + 3281250; + 3359375; + 3437500; + 3515625; + 3593750; + 3671875; + 3750000; + 3828125; + 3906250; + 3984375; + 4062500; + 4140625; + 4218750; + 4296875; + 4375000; + 4453125; + 4531250; + 4609375; + 4687500; + 4765625; + 4843750; + 4921875; + 5000000; + 5078125; + 5156250; + 5234375; + 5312500; + 5390625; + 5468750; + 5546875; + 5625000; + 5703125; + 5781250; + 5859375; + 5937500; + 6015625; + 6093750; + 6171875; + 6250000; + 6328125; + 6406250; + 6484375; + 6562500; + 6640625; + 6718750; + 6796875; + 6875000; + 6953125; + 7031250; + 7109375; + 7187500; + 7265625; + 7343750; + 7421875; + 7500000; + 7578125; + 7656250; + 7734375; + 7812500; + 7890625; + 7968750; + 8046875; + 8125000; + 8203125; + 8281250; + 8359375; + 8437500; + 8515625; + 8593750; + 8671875; + 8750000; + 8828125; + 8906250; + 8984375; + 9062500; + 9140625; + 9218750; + 9296875; + 9375000; + 9453125; + 9531250; + 9609375; + 9687500; + 9765625; + 9843750; + 9921875; + 10000000; + 10078125; + 10156250; + 10234375; + 10312500; + 10390625; + 10468750; + 10546875; + 10625000; + 10703125; + 10781250; + 10859375; + 10937500; + 11015625; + 11093750; + 11171875; + 11250000; + 11328125; + 11406250; + 11484375; + 11562500; + 11640625; + 11718750; + 11796875; + 11875000; + 11953125; + 12031250; + 12109375; + 12187500; + 12265625; + 12343750; + 12421875; + 12500000; + 12578125; + 12656250; + 12734375; + 12812500; + 12890625; + 12968750; + 13046875; + 13125000; + 13203125; + 13281250; + 13359375; + 13437500; + 13515625; + 13593750; + 13671875; + 13750000; + 13828125; + 13906250; + 13984375; + 14062500; + 14140625; + 14218750; + 14296875; + 14375000; + 14453125; + 14531250; + 14609375; + 14687500; + 14765625; + 14843750; + 14921875; + 15000000; + 15078125; + 15156250; + 15234375; + 15312500; + 15390625; + 15468750; + 15546875; + 15625000; + 15703125; + 15781250; + 15859375; + 15937500; + 16015625; + 16093750; + 16171875; + 16250000; + 16328125; + 16406250; + 16484375; + 16562500; + 16640625; + 16718750; + 16796875; + 16875000; + 16953125; + 17031250; + 17109375; + 17187500; + 17265625; + 17343750; + 17421875; + 17500000; + 17578125; + 17656250; + 17734375; + 17812500; + 17890625; + 17968750; + 18046875; + 18125000; + 18203125; + 18281250; + 18359375; + 18437500; + 18515625; + 18593750; + 18671875; + 18750000; + 18828125; + 18906250; + 18984375; + 19062500; + 19140625; + 19218750; + 19296875; + 19375000; + 19453125; + 19531250; + 19609375; + 19687500; + 19765625; + 19843750; + 19921875; + 20000000; + |]; + [| + 0; + 52083; + 104166; + 156249; + 208332; + 260415; + 312498; + 364581; + 416664; + 468747; + 520830; + 572913; + 624996; + 677079; + 729162; + 781245; + 833328; + 885411; + 937494; + 989577; + 1041660; + 1093743; + 1145826; + 1197909; + 1249992; + 1302075; + 1354158; + 1406241; + 1458324; + 1510407; + 1562490; + 1614573; + 1666656; + 1718739; + 1770822; + 1822905; + 1874988; + 1927071; + 1979154; + 2031237; + 2083320; + 2135403; + 2187486; + 2239569; + 2291652; + 2343735; + 2395818; + 2447901; + 2499984; + 2552067; + 2604150; + 2656233; + 2708316; + 2760399; + 2812482; + 2864565; + 2916648; + 2968731; + 3020814; + 3072897; + 3124980; + 3177063; + 3229146; + 3281229; + 3333312; + 3385395; + 3437478; + 3489561; + 3541644; + 3593727; + 3645810; + 3697893; + 3749976; + 3802059; + 3854142; + 3906225; + 3958308; + 4010391; + 4062474; + 4114557; + 4166640; + 4218723; + 4270806; + 4322889; + 4374972; + 4427055; + 4479138; + 4531221; + 4583304; + 4635387; + 4687470; + 4739553; + 4791636; + 4843719; + 4895802; + 4947885; + 4999968; + 5052051; + 5104134; + 5156217; + 5208300; + 5260383; + 5312466; + 5364549; + 5416632; + 5468715; + 5520798; + 5572881; + 5624964; + 5677047; + 5729130; + 5781213; + 5833296; + 5885379; + 5937462; + 5989545; + 6041628; + 6093711; + 6145794; + 6197877; + 6249960; + 6302043; + 6354126; + 6406209; + 6458292; + 6510375; + 6562458; + 6614541; + 6666624; + 6718707; + 6770790; + 6822873; + 6874956; + 6927039; + 6979122; + 7031205; + 7083288; + 7135371; + 7187454; + 7239537; + 7291620; + 7343703; + 7395786; + 7447869; + 7499952; + 7552035; + 7604118; + 7656201; + 7708284; + 7760367; + 7812450; + 7864533; + 7916616; + 7968699; + 8020782; + 8072865; + 8124948; + 8177031; + 8229114; + 8281197; + 8333280; + 8385363; + 8437446; + 8489529; + 8541612; + 8593695; + 8645778; + 8697861; + 8749944; + 8802027; + 8854110; + 8906193; + 8958276; + 9010359; + 9062442; + 9114525; + 9166608; + 9218691; + 9270774; + 9322857; + 9374940; + 9427023; + 9479106; + 9531189; + 9583272; + 9635355; + 9687438; + 9739521; + 9791604; + 9843687; + 9895770; + 9947853; + 9999936; + 10052019; + 10104102; + 10156185; + 10208268; + 10260351; + 10312434; + 10364517; + 10416600; + 10468683; + 10520766; + 10572849; + 10624932; + 10677015; + 10729098; + 10781181; + 10833264; + 10885347; + 10937430; + 10989513; + 11041596; + 11093679; + 11145762; + 11197845; + 11249928; + 11302011; + 11354094; + 11406177; + 11458260; + 11510343; + 11562426; + 11614509; + 11666592; + 11718675; + 11770758; + 11822841; + 11874924; + 11927007; + 11979090; + 12031173; + 12083256; + 12135339; + 12187422; + 12239505; + 12291588; + 12343671; + 12395754; + 12447837; + 12499920; + 12552003; + 12604086; + 12656169; + 12708252; + 12760335; + 12812418; + 12864501; + 12916584; + 12968667; + 13020750; + 13072833; + 13124916; + 13176999; + 13229082; + 13281165; + 13333248; + |]; + [| + 0; + 52083; + 104166; + 156249; + 208332; + 260415; + 312498; + 364581; + 416664; + 468747; + 520830; + 572913; + 624996; + 677079; + 729162; + 781245; + 833328; + 885411; + 937494; + 989577; + 1041660; + 1093743; + 1145826; + 1197909; + 1249992; + 1302075; + 1354158; + 1406241; + 1458324; + 1510407; + 1562490; + 1614573; + 1666656; + 1718739; + 1770822; + 1822905; + 1874988; + 1927071; + 1979154; + 2031237; + 2083320; + 2135403; + 2187486; + 2239569; + 2291652; + 2343735; + 2395818; + 2447901; + 2499984; + 2552067; + 2604150; + 2656233; + 2708316; + 2760399; + 2812482; + 2864565; + 2916648; + 2968731; + 3020814; + 3072897; + 3124980; + 3177063; + 3229146; + 3281229; + 3333312; + 3385395; + 3437478; + 3489561; + 3541644; + 3593727; + 3645810; + 3697893; + 3749976; + 3802059; + 3854142; + 3906225; + 3958308; + 4010391; + 4062474; + 4114557; + 4166640; + 4218723; + 4270806; + 4322889; + 4374972; + 4427055; + 4479138; + 4531221; + 4583304; + 4635387; + 4687470; + 4739553; + 4791636; + 4843719; + 4895802; + 4947885; + 4999968; + 5052051; + 5104134; + 5156217; + 5208300; + 5260383; + 5312466; + 5364549; + 5416632; + 5468715; + 5520798; + 5572881; + 5624964; + 5677047; + 5729130; + 5781213; + 5833296; + 5885379; + 5937462; + 5989545; + 6041628; + 6093711; + 6145794; + 6197877; + 6249960; + 6302043; + 6354126; + 6406209; + 6458292; + 6510375; + 6562458; + 6614541; + 6666624; + 6718707; + 6770790; + 6822873; + 6874956; + 6927039; + 6979122; + 7031205; + 7083288; + 7135371; + 7187454; + 7239537; + 7291620; + 7343703; + 7395786; + 7447869; + 7499952; + 7552035; + 7604118; + 7656201; + 7708284; + 7760367; + 7812450; + 7864533; + 7916616; + 7968699; + 8020782; + 8072865; + 8124948; + 8177031; + 8229114; + 8281197; + 8333280; + 8385363; + 8437446; + 8489529; + 8541612; + 8593695; + 8645778; + 8697861; + 8749944; + 8802027; + 8854110; + 8906193; + 8958276; + 9010359; + 9062442; + 9114525; + 9166608; + 9218691; + 9270774; + 9322857; + 9374940; + 9427023; + 9479106; + 9531189; + 9583272; + 9635355; + 9687438; + 9739521; + 9791604; + 9843687; + 9895770; + 9947853; + 9999936; + 10052019; + 10104102; + 10156185; + 10208268; + 10260351; + 10312434; + 10364517; + 10416600; + 10468683; + 10520766; + 10572849; + 10624932; + 10677015; + 10729098; + 10781181; + 10833264; + 10885347; + 10937430; + 10989513; + 11041596; + 11093679; + 11145762; + 11197845; + 11249928; + 11302011; + 11354094; + 11406177; + 11458260; + 11510343; + 11562426; + 11614509; + 11666592; + 11718675; + 11770758; + 11822841; + 11874924; + 11927007; + 11979090; + 12031173; + 12083256; + 12135339; + 12187422; + 12239505; + 12291588; + 12343671; + 12395754; + 12447837; + 12499920; + 12552003; + 12604086; + 12656169; + 12708252; + 12760335; + 12812418; + 12864501; + 12916584; + 12968667; + 13020750; + 13072833; + 13124916; + 13176999; + 13229082; + 13281165; + 13333248; + |]; + |] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/sapling_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/sapling_helpers.ml new file mode 100644 index 000000000000..0f256cd31ce0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/sapling_helpers.ml @@ -0,0 +1,476 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +module Common = struct + let memo_size_of_int i = + match Alpha_context.Sapling.Memo_size.parse_z @@ Z.of_int i with + | Ok memo_size -> memo_size + | Error _ -> assert false + + let int_of_memo_size ms = + Alpha_context.Sapling.Memo_size.unparse_to_z ms |> Z.to_int + + let wrap e = Lwt.return (Environment.wrap_tzresult e) + + let assert_true res = res >|=? fun res -> assert res + + let assert_false res = res >|=? fun res -> assert (not res) + + let assert_some res = res >|=? function Some s -> s | None -> assert false + + let assert_none res = + res >>=? function Some _ -> assert false | None -> return_unit + + let assert_error res = + res >>= function Ok _ -> assert false | Error _ -> return_unit + + let print ?(prefix = "") e v = + Printf.printf + "%s: %s\n" + prefix + Data_encoding.(Json.to_string (Json.construct e v)) + + let to_hex x encoding = + Hex.show (Hex.of_bytes Data_encoding.Binary.(to_bytes_exn encoding x)) + + let randomized_byte ?pos v encoding = + let bytes = Data_encoding.Binary.(to_bytes_exn encoding v) in + let rec aux () = + let random_char = Random.int 256 |> char_of_int in + let pos = Option.value ~default:(Random.int (Bytes.length bytes)) pos in + if random_char = Bytes.get bytes pos then aux () + else Bytes.set bytes pos random_char + in + aux () ; + Data_encoding.Binary.(of_bytes_exn encoding bytes) + + type wallet = { + sk : Tezos_sapling.Core.Wallet.Spending_key.t; + vk : Tezos_sapling.Core.Wallet.Viewing_key.t; + } + + let wallet_gen () = + let sk = + Tezos_sapling.Core.Wallet.Spending_key.of_seed + (Tezos_crypto.Hacl.Rand.gen 32) + in + let vk = Tezos_sapling.Core.Wallet.Viewing_key.of_sk sk in + {sk; vk} + + let gen_addr n vk = + let rec aux n index res = + if Compare.Int.( <= ) n 0 then res + else + let new_index, new_addr = + Tezos_sapling.Core.Client.Viewing_key.new_address vk index + in + aux (n - 1) new_index (new_addr :: res) + in + aux n Tezos_sapling.Core.Client.Viewing_key.default_index [] + + let gen_nf () = + let {vk; _} = wallet_gen () in + let addr = + snd + @@ Tezos_sapling.Core.Wallet.Viewing_key.(new_address vk default_index) + in + let amount = 10L in + let rcm = Tezos_sapling.Core.Client.Rcm.random () in + let position = 10L in + Tezos_sapling.Core.Client.Nullifier.compute addr vk ~amount rcm ~position + + let gen_cm_cipher ~memo_size () = + let open Tezos_sapling.Core.Client in + let {vk; _} = wallet_gen () in + let addr = + snd + @@ Tezos_sapling.Core.Wallet.Viewing_key.(new_address vk default_index) + in + let amount = 10L in + let rcm = Tezos_sapling.Core.Client.Rcm.random () in + let cm = Commitment.compute addr ~amount rcm in + let cipher = + let payload_enc = + Data_encoding.Binary.to_bytes_exn + Data_encoding.bytes + (Tezos_crypto.Hacl.Rand.gen (memo_size + 4 + 16 + 11 + 32 + 8)) + in + Data_encoding.Binary.of_bytes_exn + Ciphertext.encoding + (Bytes.concat + Bytes.empty + [ + Bytes.create (32 + 32); + payload_enc; + Bytes.create (24 + 64 + 16 + 24); + ]) + in + (cm, cipher) + + (* rebuilds from empty at each call *) + let client_state_of_diff ~memo_size (root, diff) = + let open Alpha_context.Sapling in + let cs = + Tezos_sapling.Storage.add + (Tezos_sapling.Storage.empty ~memo_size) + diff.commitments_and_ciphertexts + in + assert (Tezos_sapling.Storage.get_root cs = root) ; + List.fold_left + (fun s nf -> Tezos_sapling.Storage.add_nullifier s nf) + cs + diff.nullifiers +end + +module Alpha_context_helpers = struct + include Common + + let init () = + Context.init1 () >>=? fun (b, _contract) -> + Alpha_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + (* ~fitness:b.header.shell.fitness *) + >>= wrap + >|=? fun (ctxt, _, _) -> ctxt + + (* takes a state obtained from Sapling.empty_state or Sapling.state_from_id and + passed through Sapling.verify_update *) + let finalize ctx = + let open Alpha_context in + let open Sapling in + function + | {id = None; diff; memo_size} -> + Sapling.fresh ~temporary:false ctx >>= wrap >>=? fun (ctx, id) -> + let init = Lazy_storage.Alloc {memo_size} in + let lazy_storage_diff = Lazy_storage.Update {init; updates = diff} in + let diffs = [Lazy_storage.make Sapling_state id lazy_storage_diff] in + Lazy_storage.apply ctx diffs >>= wrap >|=? fun (ctx, _added_size) -> + (ctx, id) + | {id = Some id; diff; _} -> + let init = Lazy_storage.Existing in + let lazy_storage_diff = Lazy_storage.Update {init; updates = diff} in + let diffs = [Lazy_storage.make Sapling_state id lazy_storage_diff] in + Lazy_storage.apply ctx diffs >>= wrap >|=? fun (ctx, _added_size) -> + (ctx, id) + + (* disk only version *) + let verify_update ctx ?memo_size ?id vt = + let anti_replay = "anti-replay" in + (match id with + | None -> + (match memo_size with + | None -> ( + match vt.Environment.Sapling.UTXO.outputs with + | [] -> failwith "Can't infer memo_size from empty outputs" + | output :: _ -> + return + @@ Environment.Sapling.Ciphertext.get_memo_size + output.ciphertext) + | Some memo_size -> return memo_size) + >>=? fun memo_size -> + let memo_size = memo_size_of_int memo_size in + let vs = Alpha_context.Sapling.empty_state ~memo_size () in + return (vs, ctx) + | Some id -> + (* Storage.Sapling.Roots.get (Obj.magic ctx, id) 0l *) + (* >>= wrap *) + (* >>=? fun (_, root) -> *) + (* print ~prefix:"verify: " Environment.Sapling.Hash.encoding root ; *) + Alpha_context.Sapling.state_from_id ctx id >>= wrap) + >>=? fun (vs, ctx) -> + Alpha_context.Sapling.verify_update ctx vs vt anti_replay >>= wrap + >>=? fun (ctx, res) -> + match res with + | None -> return_none + | Some (_balance, vs) -> + finalize ctx vs >>=? fun (ctx, id) -> + let fake_fitness = + Alpha_context.( + let level = + match Raw_level.of_int32 0l with + | Error _ -> assert false + | Ok l -> l + in + Fitness.create_without_locked_round + ~level + ~predecessor_round:Round.zero + ~round:Round.zero + |> Fitness.to_raw) + in + let ectx = (Alpha_context.finalize ctx fake_fitness).context in + (* bump the level *) + Alpha_context.prepare + ectx + ~level: + Alpha_context.( + Raw_level.to_int32 Level.((succ ctx (current ctx)).level)) + ~predecessor_timestamp:(Time.Protocol.of_seconds Int64.zero) + ~timestamp:(Time.Protocol.of_seconds Int64.zero) + >>= wrap + >|=? fun (ctx, _, _) -> Some (ctx, id) + + (* Same as before but for legacy *) + let verify_update_legacy ctx ?memo_size ?id vt = + let anti_replay = "anti-replay" in + (match id with + | None -> + (match memo_size with + | None -> ( + match vt.Environment.Sapling.UTXO.Legacy.outputs with + | [] -> failwith "Can't infer memo_size from empty outputs" + | output :: _ -> + return + @@ Environment.Sapling.Ciphertext.get_memo_size + output.ciphertext) + | Some memo_size -> return memo_size) + >>=? fun memo_size -> + let memo_size = memo_size_of_int memo_size in + let vs = Alpha_context.Sapling.empty_state ~memo_size () in + return (vs, ctx) + | Some id -> + (* Storage.Sapling.Roots.get (Obj.magic ctx, id) 0l *) + (* >>= wrap *) + (* >>=? fun (_, root) -> *) + (* print ~prefix:"verify: " Environment.Sapling.Hash.encoding root ; *) + Alpha_context.Sapling.state_from_id ctx id >>= wrap) + >>=? fun (vs, ctx) -> + Alpha_context.Sapling.Legacy.verify_update ctx vs vt anti_replay >>= wrap + >>=? fun (ctx, res) -> + match res with + | None -> return_none + | Some (_balance, vs) -> + finalize ctx vs >>=? fun (ctx, id) -> + let fake_fitness = + Alpha_context.( + let level = + match Raw_level.of_int32 0l with + | Error _ -> assert false + | Ok l -> l + in + Fitness.create_without_locked_round + ~level + ~predecessor_round:Round.zero + ~round:Round.zero + |> Fitness.to_raw) + in + let ectx = (Alpha_context.finalize ctx fake_fitness).context in + (* bump the level *) + Alpha_context.prepare + ectx + ~level: + Alpha_context.( + Raw_level.to_int32 Level.((succ ctx (current ctx)).level)) + ~predecessor_timestamp:(Time.Protocol.of_seconds Int64.zero) + ~timestamp:(Time.Protocol.of_seconds Int64.zero) + >>= wrap + >|=? fun (ctx, _, _) -> Some (ctx, id) + + let transfer_inputs_outputs w cs is = + (* Tezos_sapling.Storage.size cs *) + (* |> fun (a, b) -> *) + (* Printf.printf "%Ld %Ld" a b ; *) + let inputs = + List.map + (fun i -> + Tezos_sapling.Forge.Input.get cs (Int64.of_int i) w.vk + |> WithExceptions.Option.get ~loc:__LOC__ + |> snd) + is + in + let addr = + snd + @@ Tezos_sapling.Core.Wallet.Viewing_key.(new_address w.vk default_index) + in + let memo_size = Tezos_sapling.Storage.get_memo_size cs in + let o = + Tezos_sapling.Forge.make_output addr 1000000L (Bytes.create memo_size) + in + (inputs, [o]) + + let transfer w cs is = + let anti_replay = "anti-replay" in + let ins, outs = transfer_inputs_outputs w cs is in + (* change the wallet of this last line *) + Tezos_sapling.Forge.forge_transaction + ins + outs + w.sk + anti_replay + ~bound_data:"" + cs + + let transfer_legacy w cs is = + let anti_replay = "anti-replay" in + let ins, outs = transfer_inputs_outputs w cs is in + (* change the wallet of this last line *) + Tezos_sapling.Forge.forge_transaction_legacy ins outs w.sk anti_replay cs + + let client_state_alpha ctx id = + Alpha_context.Sapling.get_diff ctx id () >>= wrap >>=? fun diff -> + Alpha_context.Sapling.state_from_id ctx id >>= wrap + >|=? fun ({memo_size; _}, _ctx) -> + let memo_size = int_of_memo_size memo_size in + client_state_of_diff ~memo_size diff +end + +(* + Interpreter level +*) + +module Interpreter_helpers = struct + include Common + include Contract_helpers + + (** Returns a block in which the contract is originated. + Also returns the associated anti-replay string and KT1 address. *) + let originate_contract_hash file storage src b baker = + originate_contract_hash file storage src b baker >|=? fun (dst, b) -> + let anti_replay = + Format.asprintf + "%a%a" + Contract_hash.pp + dst + Tezos_crypto.Chain_id.pp + Tezos_crypto.Chain_id.zero + in + (dst, b, anti_replay) + + let hex_shield ~memo_size wallet anti_replay = + let ps = Tezos_sapling.Storage.empty ~memo_size in + let addr = + snd + @@ Tezos_sapling.Core.Wallet.Viewing_key.( + new_address wallet.vk default_index) + in + let output = + Tezos_sapling.Forge.make_output addr 15L (Bytes.create memo_size) + in + let pt = + Tezos_sapling.Forge.forge_transaction + [] + [output] + wallet.sk + anti_replay + ~bound_data:"" + ps + in + let hex_string = + "0x" + ^ Hex.show + (Hex.of_bytes + Data_encoding.Binary.( + to_bytes_exn + Tezos_sapling.Core.Client.UTXO.transaction_encoding + pt)) + in + hex_string + + (* Make a transaction and sync a local client state. [to_exclude] is the list + of addresses that cannot bake the block*) + let transac_and_sync ~memo_size block parameters amount src dst baker = + let amount_tez = + Test_tez.(Alpha_context.Tez.one_mutez *! Int64.of_int amount) + in + let fee = Test_tez.of_int 10 in + Op.transaction + ~gas_limit:Max + ~fee + (B block) + src + (Alpha_context.Contract.Originated dst) + amount_tez + ~parameters + >>=? fun operation -> + Incremental.begin_construction ~policy:Block.(By_account baker) block + >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr >>=? fun block -> + Alpha_services.Contract.single_sapling_get_diff + Block.rpc_ctxt + block + dst + ~offset_commitment:0L + ~offset_nullifier:0L + () + >|=? fun diff -> + let state = client_state_of_diff ~memo_size diff in + (block, state) + + (* Returns a list of printed shield transactions and their total amount. *) + let shield ~memo_size sk number_transac vk printer anti_replay = + let state = Tezos_sapling.Storage.empty ~memo_size in + let rec aux number_transac number_outputs index amount_output total res = + if Compare.Int.(number_transac <= 0) then (res, total) + else + let new_index, new_addr = + Tezos_sapling.Core.Wallet.Viewing_key.(new_address vk index) + in + let outputs = + WithExceptions.List.init ~loc:__LOC__ number_outputs (fun _ -> + Tezos_sapling.Forge.make_output + new_addr + amount_output + (Bytes.create memo_size)) + in + let tr_hex = + to_hex + (Tezos_sapling.Forge.forge_transaction + ~number_dummy_inputs:0 + ~number_dummy_outputs:0 + [] + outputs + sk + anti_replay + ~bound_data:"" + state) + Tezos_sapling.Core.Client.UTXO.transaction_encoding + in + aux + (number_transac - 1) + (number_outputs + 1) + new_index + (Int64.add 20L amount_output) + (total + (number_outputs * Int64.to_int amount_output)) + (printer tr_hex :: res) + in + aux + number_transac + 2 + Tezos_sapling.Core.Wallet.Viewing_key.default_index + 20L + 0 + [] + + (* This fails if the operation is not correct wrt the block *) + let next_block block operation = + Incremental.begin_construction block >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/sc_rollup_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/sc_rollup_helpers.ml new file mode 100644 index 000000000000..4e31aafc0e65 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/sc_rollup_helpers.ml @@ -0,0 +1,664 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let originated_rollup op = + let nonce = + Origination_nonce.Internal_for_tests.initial (Operation.hash_packed op) + in + Contract.Internal_for_tests.originated_contract nonce + +module Make_in_memory_context (Context : sig + type tree + + include + Tezos_context_sigs.Context.TEZOS_CONTEXT + with type memory_context_tree := tree + and type tree := tree + and type value_key = Tezos_crypto.Context_hash.t + and type node_key = Tezos_crypto.Context_hash.t +end) = +struct + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + end + + type tree = Tree.tree + + type proof = Context.Proof.tree Context.Proof.t + + let hash_tree _ = assert false + + let verify_proof p f = + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof context state step = + let open Lwt_syntax in + let* context = Context.add_tree context [] state in + let* h = Context.commit ~time:Time.Protocol.epoch context in + let index = Context.index context in + let* context = Context.checkout_exn index h in + match Tree.kinded_key state with + | Some k -> + let index = Context.index context in + let* p = Context.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup.State_hash.context_hash_to_state_hash hash + + let proof_before proof = kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding +end + +module In_memory_context = + Make_in_memory_context (Tezos_context_memory.Context_binary) +module Wrong_in_memory_context = + Make_in_memory_context (Tezos_context_memory.Context) + +module Arith_pvm : + Sc_rollup.PVM.S + with type context = In_memory_context.Tree.t + and type state = In_memory_context.tree + and type proof = + Tezos_context_memory.Context.Proof.tree + Tezos_context_memory.Context.Proof.t = + Sc_rollup.ArithPVM.Make (In_memory_context) + +module Wrong_arith_pvm : + Sc_rollup.PVM.S + with type context = Wrong_in_memory_context.Tree.t + and type state = Wrong_in_memory_context.tree + and type proof = + Tezos_context_memory.Context.Proof.tree + Tezos_context_memory.Context.Proof.t = + Sc_rollup.ArithPVM.Make (Wrong_in_memory_context) + +module Wasm_pvm : + Sc_rollup.PVM.S + with type context = In_memory_context.Tree.t + and type state = In_memory_context.tree + and type proof = + Tezos_context_memory.Context.Proof.tree + Tezos_context_memory.Context.Proof.t = + Sc_rollup.Wasm_2_0_0PVM.Make (Environment.Wasm_2_0_0.Make) (In_memory_context) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/4386 + Extracted and adapted from {!Tezos_context_memory}. *) +let make_empty_context ?(root = "/tmp") () = + let open Lwt_syntax in + let context_promise = + let+ index = Tezos_context_memory.Context_binary.init root in + Tezos_context_memory.Context_binary.empty index + in + match Lwt.state context_promise with + | Lwt.Return result -> result + | Lwt.Fail exn -> raise exn + | Lwt.Sleep -> + (* The in-memory context should never block *) + assert false + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/4386 + Extracted and adapted from {!Tezos_context_memory}. *) +let make_empty_tree = + let dummy_context = make_empty_context ~root:"dummy" () in + fun () -> Tezos_context_memory.Context_binary.Tree.empty dummy_context + +let origination_proof ~boot_sector = function + | Sc_rollup.Kind.Example_arith -> + let open Lwt_syntax in + let context = make_empty_context () in + let+ proof = Arith_pvm.produce_origination_proof context boot_sector in + let proof = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Arith_pvm) proof + | Sc_rollup.Kind.Wasm_2_0_0 -> + let open Lwt_syntax in + let context = make_empty_context () in + let+ proof = Wasm_pvm.produce_origination_proof context boot_sector in + let proof = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Wasm_pvm) proof + +(** [wrong_arith_origination_proof ~alter_binary_bit ~boot_sector] + returns a serialized proof computed with a Arith PVM using 32-ary + trees. + + If [alter_binary_bit] is set to true, the resulting proof lies + about the arity of its trees. *) +let wrong_arith_origination_proof ~alter_binary_bit ~boot_sector = + let open Lwt_syntax in + let context = Tezos_context_memory.make_empty_context () in + let+ proof = Wrong_arith_pvm.produce_origination_proof context boot_sector in + let proof = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + let proof = + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4386 This should + be exposed more cleanly in the Tezos context libraries. + + Basically, the 2nd bit of the `version` field is set to 1 to + signal a proof for a [Context_binary] tree.*) + if alter_binary_bit then {proof with version = proof.version land 0b10} + else proof + in + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Arith_pvm) proof + +let wrap_origination_proof ~kind ~boot_sector proof_string_opt : + Sc_rollup.Proof.serialized tzresult Lwt.t = + let open Lwt_result_syntax in + match proof_string_opt with + | None -> + let*! origination_proof = origination_proof ~boot_sector kind in + return origination_proof + | Some proof_string -> return proof_string + +let genesis_commitment ~boot_sector ~origination_level = function + | Sc_rollup.Kind.Example_arith -> + let open Lwt_syntax in + let context = make_empty_context () in + let* proof = Arith_pvm.produce_origination_proof context boot_sector in + let proof = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + let genesis_state_hash = Arith_pvm.proof_stop_state proof in + return + Sc_rollup.Commitment.( + genesis_commitment ~origination_level ~genesis_state_hash) + | Sc_rollup.Kind.Wasm_2_0_0 -> + let open Lwt_syntax in + let context = make_empty_context () in + let* proof = Wasm_pvm.produce_origination_proof context boot_sector in + let proof = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + let genesis_state_hash = Wasm_pvm.proof_stop_state proof in + return + Sc_rollup.Commitment.( + genesis_commitment ~origination_level ~genesis_state_hash) + +let genesis_commitment_raw ~boot_sector ~origination_level kind = + let open Lwt_syntax in + let origination_level = + Raw_level_repr.to_int32 origination_level + |> Alpha_context.Raw_level.of_int32_exn + in + let kind = + match kind with + | Sc_rollups.Kind.Example_arith -> Sc_rollup.Kind.Example_arith + | Sc_rollups.Kind.Wasm_2_0_0 -> Sc_rollup.Kind.Wasm_2_0_0 + in + let* res = genesis_commitment ~boot_sector ~origination_level kind in + let res = + Data_encoding.Binary.to_bytes_exn Sc_rollup.Commitment.encoding res + |> Data_encoding.Binary.of_bytes_exn Sc_rollup_commitment_repr.encoding + in + return res + +(** {2. Inbox message helpers.} *) + +(** {1. Above [Alpha_context].} *) + +let message_serialize msg = + WithExceptions.Result.get_ok + ~loc:__LOC__ + Sc_rollup.Inbox_message.(serialize msg) + +let make_external_inbox_message str = message_serialize (External str) + +let make_internal_inbox_message internal_msg = + message_serialize (Internal internal_msg) + +let make_input ?(inbox_level = Raw_level.root) ?(message_counter = Z.zero) + payload = + Sc_rollup.Inbox_message {inbox_level; message_counter; payload} + +let make_external_input ?inbox_level ?message_counter str = + let payload = make_external_inbox_message str in + make_input ?inbox_level ?message_counter payload + +let make_sol ~inbox_level = + let payload = make_internal_inbox_message Start_of_level in + make_input ~inbox_level ~message_counter:Z.zero payload + +let make_eol ~inbox_level ~message_counter = + let payload = make_internal_inbox_message End_of_level in + make_input ~inbox_level ~message_counter payload + +let make_info_per_level ~inbox_level ~predecessor_timestamp ~predecessor = + let payload = + make_internal_inbox_message + (Info_per_level {predecessor_timestamp; predecessor}) + in + make_input ~inbox_level ~message_counter:Z.one payload + +(** Message is the combination of a [message] and its associated [input]. + + [message] is used to: + - Construct the protocol inbox, when [message] is [`Message]. The protocol + adds [`SOL] and [`EOL] itself. + - Construct the players' inboxes. + + [input] is used to evaluate the players' inboxes. + +*) +type message = { + input : Sc_rollup.input; + message : + [ `SOL + | `Info_per_level of Timestamp.t * Tezos_crypto.Block_hash.t + | `Message of string + | `EOL ]; +} + +(** Put as much information as possible in this record so it can be used + in different setups: + 1. Creating an inbox on the protocol-side, requires [messages] only. + 2. Re-construct an inbox, requires [payloads], [timestamp], [predecessor]. + 3. Evaluate inputs in a PVM, requires [inputs] + + [level] is useful for (1) (2) (3). + *) +type payloads_per_level = { + messages : string list; (** List of external messages. *) + payloads : Sc_rollup.Inbox_message.serialized list; + (** List of external serialized messages. *) + predecessor_timestamp : Time.Protocol.t; + (** predecessor timestamp of the [Info_per_level]. *) + predecessor : Tezos_crypto.Block_hash.t; + (** Predecessor of the [Info_per_level]. *) + level : Raw_level.t; + inputs : Sc_rollup.input list; + (** List of all inputs for the level, to be read by a PVM. *) +} + +let pp_input fmt (input : Sc_rollup.input) = + match input with + | Reveal _ -> assert false + | Inbox_message {inbox_level; message_counter; _} -> + Format.fprintf + fmt + "(%a, %s)" + Raw_level.pp + inbox_level + (Z.to_string message_counter) + +let pp_message fmt {input; message} = + Format.fprintf + fmt + "{ input = %a; message = %S }" + pp_input + input + (match message with + | `SOL -> "SOL" + | `Info_per_level (predecessor_timestamp, block_hash) -> + Format.asprintf + "Info_per_level (%s, %a)" + (Timestamp.to_notation predecessor_timestamp) + Tezos_crypto.Block_hash.pp + block_hash + | `Message msg -> msg + | `EOL -> "EOL") + +(** Creates inputs based on string messages. *) +let strs_to_inputs inbox_level messages = + List.fold_left + (fun (acc, message_counter) message -> + let input = make_external_input ~inbox_level ~message_counter message in + ({input; message = `Message message} :: acc, Z.succ message_counter)) + ([], Z.of_int 2) + messages + +(** Transform the list of all inputs the PVM should read. *) +let make_inputs predecessor_timestamp predecessor messages inbox_level = + (* SOL is at index 0. *) + let sol = make_sol ~inbox_level in + (* Info_per_level is at index 1. *) + let info_per_level = + make_info_per_level ~inbox_level ~predecessor_timestamp ~predecessor + in + (* External inputs start at index 2. *) + let external_inputs = + List.mapi + (fun i message -> + make_external_input + ~inbox_level + ~message_counter:(Z.of_int (2 + i)) + message) + messages + in + (* EOL is after SOL/Info_per_level and all external inputs, therefore, + at index [2 + List.length messages]. *) + let eol = + let message_counter = Z.of_int (2 + List.length messages) in + make_eol ~inbox_level ~message_counter + in + [sol; info_per_level] @ external_inputs @ [eol] + +(** Wrap messages, predecessor_timestamp and predecessor of a level into a + [payloads_per_level] .*) +let wrap_messages ?(predecessor_timestamp = Timestamp.of_seconds 0L) + ?(predecessor = Tezos_crypto.Block_hash.zero) level messages : + payloads_per_level = + let payloads = List.map make_external_inbox_message messages in + let inputs = make_inputs predecessor_timestamp predecessor messages level in + {payloads; predecessor_timestamp; predecessor; messages; level; inputs} + +let make_empty_level ?predecessor_timestamp ?predecessor level = + wrap_messages ?predecessor_timestamp ?predecessor level [] + +let gen_payloads_for_levels ~start_level ~max_level gen_message = + let open QCheck2.Gen in + let rec aux acc n = + match n with + | n when n < 0 -> + (* Prevent [Stack_overflow]. *) + assert false + | 0 -> return acc + | n -> + let inbox_level = + Raw_level.of_int32_exn (Int32.of_int (start_level + n - 1)) + in + let* empty_level = bool in + let* level_messages = + if empty_level then return (make_empty_level inbox_level) + else + let* messages = + let* input = gen_message in + let* inputs = small_list gen_message in + return (input :: inputs) + in + return (wrap_messages inbox_level messages) + in + aux (level_messages :: acc) (n - 1) + in + aux [] (max_level - start_level) + +(** {1. Below [Alpha_context].} *) + +let message_serialize_repr msg = + WithExceptions.Result.get_ok + ~loc:__LOC__ + Sc_rollup_inbox_message_repr.(serialize msg) + +let make_external_inbox_message_repr str = message_serialize_repr (External str) + +let make_internal_inbox_message_repr internal_msg = + message_serialize_repr (Internal internal_msg) + +let make_input_repr ?(inbox_level = Raw_level_repr.root) + ?(message_counter = Z.zero) payload = + Sc_rollup_PVM_sig.Inbox_message {inbox_level; message_counter; payload} + +let make_external_input_repr ?inbox_level ?message_counter str = + let payload = make_external_inbox_message_repr str in + make_input_repr ?inbox_level ?message_counter payload + +let make_sol_repr ~inbox_level = + let payload = make_internal_inbox_message_repr Start_of_level in + make_input_repr ~inbox_level ~message_counter:Z.zero payload + +let make_eol_repr ~inbox_level ~message_counter = + let payload = make_internal_inbox_message_repr End_of_level in + make_input_repr ~inbox_level ~message_counter payload + +(** Message is the combination of a [message] and its associated [input]. + + [message] is used to: + - Construct the protocol inbox, when [message] is [`Message]. The protocol + adds [`SOL] and [`EOL] itself. + - Construct the players' inboxes. + + [input] is used to evaluate the players' inboxes. + +*) +type message_repr = { + input_repr : Sc_rollup_PVM_sig.input; + message_repr : [`SOL | `Message of string | `EOL]; +} + +let pp_input_repr fmt (input_repr : Sc_rollup_PVM_sig.input) = + match input_repr with + | Reveal _ -> assert false + | Inbox_message {inbox_level; message_counter; _} -> + Format.fprintf + fmt + "(%a, %s)" + Raw_level_repr.pp + inbox_level + (Z.to_string message_counter) + +let pp_message_repr fmt {input_repr; message_repr} = + Format.fprintf + fmt + "{ input_repr = %a; message_repr = %S }" + pp_input_repr + input_repr + (match message_repr with + | `SOL -> "SOL" + | `Message msg -> msg + | `EOL -> "EOL") + +(** An empty inbox level is a SOL and EOL. *) +let make_empty_level_repr inbox_level = + let sol = {input_repr = make_sol_repr ~inbox_level; message_repr = `SOL} in + let eol = + { + input_repr = make_eol_repr ~inbox_level ~message_counter:Z.one; + message_repr = `EOL; + } + in + (inbox_level, [sol; eol]) + +(** Creates input_reprs based on string message_reprs. *) +let strs_to_input_reprs_repr inbox_level message_reprs = + List.fold_left + (fun (acc, message_counter) message_repr -> + let input_repr = + make_external_input_repr ~inbox_level ~message_counter message_repr + in + ( {input_repr; message_repr = `Message message_repr} :: acc, + Z.succ message_counter )) + ([], Z.one) + message_reprs + +(** Transform message_reprs into input_reprs and wrap them between SOL and EOL. *) +let wrap_message_reprs_repr inbox_level strs = + let sol = {input_repr = make_sol_repr ~inbox_level; message_repr = `SOL} in + let rev_input_reprs, message_counter = + strs_to_input_reprs_repr inbox_level strs + in + let input_reprs = List.rev rev_input_reprs in + let eol = + { + input_repr = make_eol_repr ~inbox_level ~message_counter; + message_repr = `EOL; + } + in + (sol :: input_reprs) @ [eol] + +let gen_message_reprs_for_levels_repr ~start_level ~max_level gen_message_repr = + let open QCheck2.Gen in + let rec aux acc n = + match n with + | 0 -> return acc + | n when n > 0 -> + let inbox_level = + Raw_level_repr.of_int32_exn (Int32.of_int (start_level + n - 1)) + in + let* empty_level = bool in + let* level_message_reprs = + if empty_level then return (make_empty_level_repr inbox_level) + else + let* message_reprs = + let* input_repr = gen_message_repr in + let* input_reprs = small_list gen_message_repr in + return (input_repr :: input_reprs) + in + return + (inbox_level, wrap_message_reprs_repr inbox_level message_reprs) + in + aux (level_message_reprs :: acc) (n - 1) + | _ -> + (* Prevent [Stack_overflow]. *) + assert false + in + aux [] (max_level - start_level) + +module Payloads_histories = + Map.Make (Sc_rollup.Inbox_merkelized_payload_hashes.Hash) + +type payloads_histories = + Sc_rollup.Inbox_merkelized_payload_hashes.History.t Payloads_histories.t + +let get_payloads_history payloads_histories witness = + Payloads_histories.find witness payloads_histories + |> WithExceptions.Option.get ~loc:__LOC__ + |> Lwt.return + +let get_history history i = Sc_rollup.Inbox.History.find i history |> Lwt.return + +let fill_inbox ~inbox history payloads_histories payloads_per_levels = + let open Result_syntax in + let rec aux payloads_histories history inbox = function + | [] -> return (payloads_histories, history, inbox) + | ({ + payloads = _; + predecessor_timestamp; + predecessor; + messages; + level = _; + inputs = _; + } : + payloads_per_level) + :: rst -> + let messages = + List.map + (fun message -> Sc_rollup.Inbox_message.External message) + messages + in + let* payloads_history, history, inbox, _witness, _messages = + Environment.wrap_tzresult + @@ Sc_rollup.Inbox.add_all_messages + ~predecessor_timestamp + ~predecessor + history + inbox + messages + in + (* Store in the history this archived level. *) + let Sc_rollup.Inbox.{hash = witness_hash; _} = + Sc_rollup.Inbox.current_level_proof inbox + in + let payloads_histories = + Payloads_histories.add + witness_hash + payloads_history + payloads_histories + in + aux payloads_histories history inbox rst + in + aux payloads_histories history inbox payloads_per_levels + +let construct_inbox ?(inbox_creation_level = Raw_level.(root)) + ?(with_histories = true) ?(predecessor_timestamp = Time.Protocol.epoch) + ?(predecessor = Tezos_crypto.Block_hash.zero) payloads_per_levels = + let inbox = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Environment.wrap_tzresult + @@ Sc_rollup.Inbox.genesis + ~predecessor_timestamp + ~predecessor + inbox_creation_level + in + let history = + let capacity = if with_histories then 10000L else 0L in + Sc_rollup.Inbox.History.empty ~capacity + in + let payloads_histories = Payloads_histories.empty in + fill_inbox ~inbox history payloads_histories payloads_per_levels + +let inbox_message_of_input input = + match input with Sc_rollup.Inbox_message x -> Some x | _ -> None + +let payloads_from_messages = + List.map (fun {input; _} -> + match input with + | Inbox_message {payload; _} -> payload + | Reveal _ -> assert false) + +let first_after payloads_per_levels level message_counter = + let payloads_at_level level = + List.find + (fun {level = payloads_level; _} -> level = payloads_level) + payloads_per_levels + in + let payloads_per_level = + WithExceptions.Option.get ~loc:__LOC__ @@ payloads_at_level level + in + match List.nth payloads_per_level.inputs (Z.to_int message_counter) with + | Some input -> inbox_message_of_input input + | None -> ( + (* If no input at (l, n), the next input is (l+1, 0). *) + let next_level = Raw_level.succ level in + match payloads_at_level next_level with + | None -> None + | Some payloads_per_level -> + let input = Stdlib.List.hd payloads_per_level.inputs in + inbox_message_of_input input) + +let list_of_inputs_from_list_of_messages + (payloads_per_levels : message list list) = + List.map + (fun inputs -> + let payloads = List.map (fun {input; _} -> input) inputs in + payloads) + payloads_per_levels + +let dumb_init level = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Inbox.genesis + ~predecessor_timestamp:Time.Protocol.epoch + ~predecessor:Tezos_crypto.Block_hash.zero + level + +let dumb_init_repr level = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup_inbox_repr.genesis + ~predecessor_timestamp:Time.Protocol.epoch + ~predecessor:Tezos_crypto.Block_hash.zero + level diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.ml new file mode 100644 index 000000000000..6a7745859af0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.ml @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) + +let update k v m ctxt = Protocol.Script_big_map.update ctxt k v m + +let of_list key_ty ty xs ctxt = + List.fold_left_es + (fun (bm, ctxt) (k, v) -> update k (Some v) bm ctxt) + (Protocol.Script_big_map.empty key_ty ty, ctxt) + xs diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.mli new file mode 100644 index 000000000000..0a6bcc4d51ad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_big_map.mli @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) + +(** Update a big map. See [Script_typed_ir.big_map_get_and_update] for details. *) +val update : + 'key -> + 'value option -> + ('key, 'value) Protocol.Script_typed_ir.big_map -> + Protocol.Alpha_context.t -> + (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) + Environment.Error_monad.tzresult + Lwt.t + +(** Convert a list to a [Script_big_map]. If the list contains duplicate keys, + the first occurence is used. + *) +val of_list : + 'key Protocol.Script_typed_ir.comparable_ty -> + ('value, _) Protocol.Script_typed_ir.ty -> + ('key * 'value) list -> + Protocol.Alpha_context.t -> + (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) + Environment.Error_monad.tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.ml new file mode 100644 index 000000000000..5b780f7ac8e2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.ml @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let of_list : + type k v. + k Protocol.Script_typed_ir.comparable_ty -> + (k * v) list -> + (k, v) Protocol.Script_typed_ir.map = + fun ty1 xs -> + List.fold_left + (fun rs (k, v) -> Protocol.Script_map.update k (Some v) rs) + (Protocol.Script_map.empty ty1) + xs diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.mli new file mode 100644 index 000000000000..e81cf5956c93 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_map.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Convert a list to a [Script_map]. If the list contains duplicate keys, + the last occurence is used. *) +val of_list : + 'k Protocol.Script_typed_ir.comparable_ty -> + ('k * 'v) list -> + ('k, 'v) Protocol.Script_typed_ir.map diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.ml new file mode 100644 index 000000000000..b02d082465a4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.ml @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let of_list ty1 xs = + List.fold_left + (fun rs k -> Protocol.Script_set.update k true rs) + (Protocol.Script_set.empty ty1) + xs diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.mli new file mode 100644 index 000000000000..7df70020e3b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/script_set.mli @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Convert a list to a Script IR set. If the list contains duplicates, + the last occurence is used. *) +val of_list : + 'a Protocol.Script_typed_ir.comparable_ty -> + 'a list -> + 'a Protocol.Script_typed_ir.set diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_global_constants.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_global_constants.ml new file mode 100644 index 000000000000..341d5b63e5c5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_global_constants.ml @@ -0,0 +1,321 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Micheline +open Michelson_v1_primitives + +let create_context () = + let open Lwt_result_syntax in + let*? accounts = Account.generate_accounts 2 in + Block.alpha_context (Account.make_bootstrap_accounts accounts) + +let expr_to_hash expr = + let lexpr = Script_repr.lazy_expr expr in + Script_repr.force_bytes lexpr >|? fun b -> Script_expr_hash.hash_bytes [b] + +let assert_expr_equal loc = + Assert.equal + ~loc + ( = ) + "Michelson Expressions Not Equal" + Michelson_v1_printer.print_expr + +let assert_proto_error_id loc id result = + let test err = + (Error_monad.find_info_of_error err).id + = "proto." ^ Protocol.name ^ "." ^ id + in + Assert.error ~loc result test + +let assert_ok_lwt x = + match Lwt_main.run x with + | Ok x -> x + | Error _ -> raise @@ Failure "Called assert_ok_lwt on Error" + +let assert_ok = function + | Ok x -> x + | Error _ -> raise @@ Failure "Called assert_ok on Error" + +(** Filters out values that would cause [register] *) +let assume_expr_not_too_large expr = + let node = root expr in + QCheck2.assume @@ not + @@ Global_constants_storage.Internal_for_tests.node_too_large node + +module Generators = struct + let context_gen () = QCheck2.Gen.return (create_context () |> assert_ok_lwt) + + let prims = + [ + K_parameter; + K_storage; + K_code; + D_False; + D_Elt; + D_Left; + D_None; + D_Pair; + D_Right; + D_Some; + D_True; + D_Unit; + I_PACK; + I_UNPACK; + I_BLAKE2B; + I_SHA256; + I_SHA512; + I_ABS; + I_ADD; + I_AMOUNT; + I_AND; + I_BALANCE; + I_CAR; + I_CDR; + I_CHAIN_ID; + I_CHECK_SIGNATURE; + I_COMPARE; + I_CONCAT; + I_CONS; + I_CREATE_ACCOUNT; + I_CREATE_CONTRACT; + I_IMPLICIT_ACCOUNT; + I_DIP; + I_DROP; + I_DUP; + I_EDIV; + I_EMPTY_BIG_MAP; + I_EMPTY_MAP; + I_EMPTY_SET; + I_EQ; + I_EXEC; + I_APPLY; + I_FAILWITH; + I_GE; + I_GET; + I_GET_AND_UPDATE; + I_GT; + I_HASH_KEY; + I_IF; + I_IF_CONS; + I_IF_LEFT; + I_IF_NONE; + I_INT; + I_LAMBDA; + I_LE; + I_LEFT; + I_LEVEL; + I_LOOP; + I_LSL; + I_LSR; + I_LT; + I_MAP; + I_MEM; + I_MUL; + I_NEG; + I_NEQ; + I_NIL; + I_NONE; + I_NOT; + I_NOW; + I_OR; + I_PAIR; + I_UNPAIR; + I_PUSH; + I_RIGHT; + I_SIZE; + I_SOME; + I_SOURCE; + I_SENDER; + I_SELF; + I_SELF_ADDRESS; + I_SLICE; + I_STEPS_TO_QUOTA; + I_SUB; + I_SWAP; + I_TRANSFER_TOKENS; + I_SET_DELEGATE; + I_UNIT; + I_UPDATE; + I_XOR; + I_ITER; + I_LOOP_LEFT; + I_ADDRESS; + I_CONTRACT; + I_ISNAT; + I_CAST; + I_RENAME; + I_SAPLING_EMPTY_STATE; + I_SAPLING_VERIFY_UPDATE; + I_DIG; + I_DUG; + I_NEVER; + I_VOTING_POWER; + I_TOTAL_VOTING_POWER; + I_KECCAK; + I_SHA3; + I_PAIRING_CHECK; + I_TICKET; + I_READ_TICKET; + I_SPLIT_TICKET; + I_JOIN_TICKETS; + T_bool; + T_contract; + T_int; + T_key; + T_key_hash; + T_lambda; + T_list; + T_map; + T_big_map; + T_nat; + T_option; + T_or; + T_pair; + T_set; + T_signature; + T_string; + T_bytes; + T_mutez; + T_timestamp; + T_unit; + T_operation; + T_address; + T_sapling_transaction_deprecated; + T_sapling_state; + T_chain_id; + T_never; + T_bls12_381_g1; + T_bls12_381_g2; + T_bls12_381_fr; + T_ticket; + H_constant; + ] + + let prim_gen = QCheck2.Gen.oneofl prims + + let prims_without_constants_gen = + QCheck2.Gen.oneofl (List.filter (fun x -> x != H_constant) prims) + + let z_gen = QCheck2.Gen.map Z.of_int QCheck2.Gen.int + + let micheline_node_gen l_gen p_gen annot_gen : + ('l, 'p) Micheline.node QCheck2.Gen.t = + let open Micheline in + let open QCheck2.Gen in + fix + (fun self () -> + frequency + [ + (3, map (fun (l, x) -> Int (l, x)) (pair l_gen z_gen)); + (3, map (fun (l, x) -> String (l, x)) (pair l_gen string)); + ( 3, + map + (fun (l, x) -> Bytes (l, Bytes.of_string x)) + (pair l_gen string) ); + ( 1, + map + (fun (l, p, args, annot) -> Prim (l, p, args, annot)) + (quad + l_gen + p_gen + (list_size (int_bound 10) (self ())) + annot_gen) ); + ( 1, + map + (fun (l, args) -> Seq (l, args)) + (pair l_gen (list_size (int_bound 10) (self ()))) ); + ]) + () + + let rec replace_with_constant : + Script.node -> Script.location -> Script.node * Script.node option = + fun node loc -> + let open Michelson_v1_primitives in + let open Micheline in + let rec loop : Script.node list -> Script.node list * Script.node option = + function + | [] -> ([], None) + | hd :: tl -> ( + match replace_with_constant hd loc with + | node, Some x -> (node :: tl, Some x) + | _, None -> + let l, x = loop tl in + (hd :: l, x)) + in + match node with + | (Int (l, _) | String (l, _) | Bytes (l, _)) as node -> + if l = loc then + let hash = + node |> strip_locations |> expr_to_hash |> assert_ok + |> Script_expr_hash.to_b58check + in + (Prim (-1, H_constant, [String (-1, hash)], []), Some node) + else (node, None) + | Prim (l, prim, args, annot) as node -> + if l = loc then + let hash = + node |> strip_locations |> expr_to_hash |> assert_ok + |> Script_expr_hash.to_b58check + in + (Prim (-1, H_constant, [String (-1, hash)], []), Some node) + else + let result, x = loop args in + (Prim (l, prim, result, annot), x) + | Seq (l, args) as node -> + if l = loc then + let hash = + node |> strip_locations |> expr_to_hash |> assert_ok + |> Script_expr_hash.to_b58check + in + (Prim (-1, H_constant, [String (-1, hash)], []), Some node) + else + let result, x = loop args in + (Seq (l, result), x) + + let micheline_gen p_gen annot_gen = + QCheck2.Gen.map + Micheline.strip_locations + (micheline_node_gen (QCheck2.Gen.return (-1)) p_gen annot_gen) + + let canonical_without_constant_gen () = + QCheck2.Gen.map + strip_locations + (micheline_node_gen + (QCheck2.Gen.return (-1)) + prims_without_constants_gen + (QCheck2.Gen.return [])) + + let canonical_with_constant_gen () = + let open QCheck2.Gen in + canonical_without_constant_gen () >>= fun expr -> + let size = Script_repr.micheline_nodes (root expr) in + 0 -- (size - 1) >|= fun loc -> + match replace_with_constant (root expr) loc with + | _, None -> assert false + | node, Some replaced_node -> + (expr, strip_locations node, strip_locations replaced_node) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_tez.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_tez.ml new file mode 100644 index 000000000000..5809c11c2adf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/test_tez.ml @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Environment + +(* This module wraps the errors from the protocol *) +open Tez + +let ( +? ) t1 t2 = t1 +? t2 |> wrap_tzresult + +let ( -? ) t1 t2 = t1 -? t2 |> wrap_tzresult + +let ( *? ) t1 t2 = t1 *? t2 |> wrap_tzresult + +let ( /? ) t1 t2 = t1 /? t2 |> wrap_tzresult + +let ( +! ) t1 t2 = + match t1 +? t2 with Ok r -> r | Error _ -> Pervasives.failwith "adding tez" + +let ( -! ) t1 t2 = + match t1 -? t2 with + | Ok r -> r + | Error _ -> Pervasives.failwith "subtracting tez" + +let ( *! ) t1 t2 = + match t1 *? t2 with + | Ok r -> r + | Error _ -> Pervasives.failwith "multiplying tez" + +let ( /! ) t1 t2 = + match t1 /? t2 with + | Ok r -> r + | Error _ -> Pervasives.failwith "dividing tez" + +let of_int x = + match Tez.of_mutez (Int64.mul (Int64.of_int x) 1_000_000L) with + | None -> invalid_arg "tez_of_int" + | Some x -> x + +let of_mutez_exn x = + match Tez.of_mutez x with None -> invalid_arg "tez_of_mutez" | Some x -> x + +let to_mutez = Tez.to_mutez + +let max_tez = + match Tez.of_mutez Int64.max_int with None -> assert false | Some p -> p diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/testable.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/testable.ml new file mode 100644 index 000000000000..287b46840b00 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/testable.ml @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let contract : Protocol.Alpha_context.Contract.t Alcotest.testable = + let open Protocol in + let open Alpha_context in + Alcotest.testable Contract.pp Contract.( = ) + +let script_expr : Protocol.Alpha_context.Script.expr Alcotest.testable = + Alcotest.testable Michelson_v1_printer.print_expr ( = ) + +let trace : tztrace Alcotest.testable = Alcotest.testable pp_print_trace ( = ) + +let protocol_error : Environment.Error_monad.error Alcotest.testable = + let open Environment.Error_monad in + Alcotest.testable pp ( = ) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/ticket_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/ticket_helpers.ml new file mode 100644 index 000000000000..ba0f48f79564 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/ticket_helpers.ml @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) + +open Protocol +open Alpha_context + +let assert_balance ctxt ~loc key expected = + let open Lwt_result_syntax in + let* balance, _ = + Ticket_balance.get_balance ctxt key >|= Environment.wrap_tzresult + in + match (balance, expected) with + | Some b, Some eb -> Assert.equal_int ~loc (Z.to_int b) eb + | None, Some eb -> failwith "Expected balance %d" eb + | Some eb, None -> failwith "Expected None but got %d" (Z.to_int eb) + | None, None -> return_unit + +let string_ticket_token ticketer content = + let open Lwt_result_syntax in + let contents = + Result.value_f ~default:(fun _ -> assert false) + @@ Script_string.of_string content + in + let*? ticketer = Environment.wrap_tzresult @@ Contract.of_b58check ticketer in + return + (Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.string_t; contents}) + +let adjust_ticket_token_balance alpha_ctxt owner ticket_token ~delta = + let open Lwt_result_syntax in + let* ticket_token_hash, ctxt = + Ticket_balance_key.of_ex_token alpha_ctxt ~owner ticket_token + >|= Environment.wrap_tzresult + in + let* _, alpha_ctxt = + Ticket_balance.adjust_balance ctxt ticket_token_hash ~delta + >|= Environment.wrap_tzresult + in + return (ticket_token_hash, alpha_ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.ml new file mode 100644 index 000000000000..7d92c8c3ad30 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.ml @@ -0,0 +1,69 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Test_tez + +let transfer_and_check_balances ?(with_burn = false) ~loc b ?(fee = Tez.zero) + ?expect_apply_failure src dst amount = + let open Lwt_result_syntax in + let*? amount_fee = fee +? amount in + let* bal_src = Context.Contract.balance (I b) src in + let* bal_dst = Context.Contract.balance (I b) dst in + let* op = + Op.transaction + ~force_reveal:true + ~gas_limit:(Custom_gas (Alpha_context.Gas.Arith.integral_of_int_exn 3000)) + (I b) + ~fee + src + dst + amount + in + let* b = Incremental.add_operation ?expect_apply_failure b op in + let* {parametric = {origination_size; cost_per_byte; _}; _} = + Context.get_constants (I b) + in + let*? origination_burn = cost_per_byte *? Int64.of_int origination_size in + let*? amount_fee_burn = amount_fee +? origination_burn in + let amount_fee_maybe_burn = + if with_burn then amount_fee_burn else amount_fee + in + let* () = + Assert.balance_was_debited ~loc (I b) src bal_src amount_fee_maybe_burn + in + let+ () = Assert.balance_was_credited ~loc (I b) dst bal_dst amount in + (b, op) + +let n_transactions n b ?fee source dest amount = + List.fold_left_es + (fun b _ -> + transfer_and_check_balances ~loc:__LOC__ b ?fee source dest amount + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b) + b + (1 -- n) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.mli new file mode 100644 index 000000000000..86e17da6e2e4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/transfers.mli @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** [transfer_and_check_balances b fee src dst amount] + this function takes a block, an optional parameter fee if fee does not + given it will be set to zero tez, a source contract, a destination contract + and the amount that one wants to transfer. + + 1- Transfer the amount of tez (w/wo fee) from a source contract to a + destination contract. + + 2- Check the equivalent of the balance of the source/destination + contract before and after transfer is validated. + + This function returns a pair: + - A block that added a valid operation + - a valid operation *) +val transfer_and_check_balances : + ?with_burn:bool -> + loc:string -> + Incremental.t -> + ?fee:Tez.t -> + ?expect_apply_failure:(error trace -> unit tzresult Lwt.t) -> + Contract.t -> + Contract.t -> + Tez.t -> + (Incremental.t * packed_operation) tzresult Lwt.t + +(** [n_transactions n b fee source dest amount] + this function takes a number of "n" that one wish to transfer, + a block, an optional parameter fee, a source contract, + a destination contract and an amount one wants to transfer. + + This function will do a transaction from a source contract to + a destination contract with the amount "n" times. *) +val n_transactions : + int -> + Incremental.t -> + ?fee:Tez.t -> + Contract.t -> + Contract.t -> + Tez.t -> + Incremental.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/tx_rollup_l2_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/tx_rollup_l2_helpers.ml new file mode 100644 index 000000000000..22acc5dfcb67 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/tx_rollup_l2_helpers.ml @@ -0,0 +1,200 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Protocol.Tx_rollup_l2_storage_sig + +(* Build a Tezos context with binary trees *) +module Store = struct + module Conf : Irmin_pack.Conf.S = struct + let entries = 2 + + let stable_hash = 2 + + let inode_child_order = `Seeded_hash + + let contents_length_header = None + + let forbid_empty_dir_persistence = true + end + + open Irmin_pack_mem.Maker (Conf) + + (* We could directly use a simpler encoding for commits + instead of keeping the same as in the current context. *) + include Make (Tezos_context_encoding.Context.Schema) +end + +module Irmin_storage : + STORAGE + with type t = Store.tree + and type 'a m = ('a, Environment.Error_monad.error) result Lwt.t = struct + type t = Store.tree + + type 'a m = ('a, Environment.Error_monad.error) result Lwt.t + + let path k = [Bytes.to_string k] + + let get store key = + let open Lwt_syntax in + let* res = Store.Tree.find store (path key) in + return_ok res + + let set store key value = + let open Lwt_syntax in + let* store = Store.Tree.add store (path key) value in + return_ok store + + let remove store key = + let open Lwt_syntax in + let* store = Store.Tree.remove store (path key) in + return_ok store + + module Syntax = struct + include Lwt_result_syntax + + let fail : Environment.Error_monad.error -> 'a m = + fun e -> Lwt.return (Error e) + + let catch (m : 'a m) k h = + Lwt.bind m (function Ok x -> k x | Error e -> h e) + + let list_fold_left_m = List.fold_left_es + end +end + +module Context_l2 = Protocol.Tx_rollup_l2_context.Make (Irmin_storage) +module Apply_l2 = Protocol.Tx_rollup_l2_apply.Make (Context_l2) + +let empty_storage : Irmin_storage.t = Store.Tree.empty () + +let empty_context : Context_l2.t = empty_storage + +let rng_state = Random.State.make_self_init () + +let gen_l1_address ?seed () = + Tezos_crypto.Signature.generate_key ~algo:Ed25519 ?seed () + +let gen_l2_address () = + let pkh, public_key, secret_key = Tezos_crypto.Bls.generate_key () in + (secret_key, public_key, pkh) + +(** [make_unit_ticket_key ctxt ticketer l2_address] computes the key hash of + the unit ticket crafted by [ticketer] and owned by [l2_address]. *) +let make_unit_ticket_key ticketer l2_address = + let open Tezos_micheline.Micheline in + let open Michelson_v1_primitives in + let ticketer = + Bytes + ( 0, + Data_encoding.Binary.to_bytes_exn + Alpha_context.Contract.encoding + ticketer ) + in + let ty = Prim (0, T_unit, [], []) in + let contents = Prim (0, D_Unit, [], []) in + let owner = + String (dummy_location, Tx_rollup_l2_address.to_b58check l2_address) + in + Alpha_context.Ticket_hash.Internal_for_tests.make_uncarbonated + ~ticketer + ~ty + ~contents + ~owner + |> WithExceptions.Result.get_ok ~loc:__LOC__ + +let gen_n_address n = + List.init ~when_negative_length:[] n (fun _ -> gen_l2_address ()) |> function + | Ok addresses -> addresses + | _ -> raise (Invalid_argument "Failed to forge addresses") + +let gen_n_ticket_hash n = + let x = + Lwt_main.run + ( Context.init_n n () >>=? fun (_, contracts) -> + let addressess = gen_n_address n in + let tickets = + List.map2 + ~when_different_lengths:[] + (fun contract (_, _, address) -> + make_unit_ticket_key contract address) + contracts + addressess + in + match tickets with + | Ok x -> return x + | Error _ -> raise (Invalid_argument "Failed to forge tickets") ) + in + match x with + | Ok x -> x + | Error _ -> raise (Invalid_argument "Failed to forge tickets") + +let sign_transaction : + Tezos_crypto.Bls.Secret_key.t list -> + ('signer, 'content) Tx_rollup_l2_batch.V1.transaction -> + Tx_rollup_l2_batch.V1.signature list = + fun sks transaction -> + let ops_nb = List.length transaction in + assert (Compare.List_length_with.(sks = ops_nb)) ; + + let buf = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_l2_batch.V1.transaction_encoding + transaction + in + List.map (fun sk -> Tezos_crypto.Bls.sign sk buf) sks + +type Environment.Error_monad.error += Test_error of string + +let fail_msg msg = Context_l2.Syntax.fail (Test_error msg) + +let () = + let open Data_encoding in + Environment.Error_monad.register_error_kind + `Permanent + ~id:"tx_rollup_l2_apply_test_error" + ~title:"Test error" + ~description:"Something went wrong during a test" + (obj1 (req "msg" string)) + (function Test_error s -> Some s | _ -> None) + (fun s -> Test_error s) + +let expect_error ?msg_if_valid ?msg_if_error f err = + let open Context_l2.Syntax in + let default = "<no message provided>" in + let msg_if_valid = Option.value ~default msg_if_valid in + let msg_if_error = Option.value ~default msg_if_error in + + catch + f + (fun _ -> fail_msg msg_if_valid) + (fun err' -> if err = err' then return () else fail_msg msg_if_error) + +let nth_exn l n = + match List.nth l n with + | Some x -> x + | None -> raise (Invalid_argument "nth_exn") diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/zk_rollup_l2_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/zk_rollup_l2_helpers.ml new file mode 100644 index 000000000000..eb710552b7cc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/zk_rollup_l2_helpers.ml @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Dummy_zk_rollup = Dummy_zk_rollup diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune new file mode 100644 index 000000000000..da895ae2b7c6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune @@ -0,0 +1,27 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + alcotest-lwt + tezos-base + tezos-protocol-016-PtMumbai + tezos-alpha-test-helpers + tezos-base-test-helpers + tezos-protocol-016-PtMumbai.parameters + tezos-protocol-plugin-alpha) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_016_PtMumbai + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_protocol_plugin_alpha)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.ml new file mode 100644 index 000000000000..04f2209b8b9d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.ml @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/consensus + Subject: Entrypoint +*) + +let () = + Alcotest_lwt.run + "protocol > integration > consensus" + [ + ("endorsement", Test_endorsement.tests); + ("preendorsement", Test_preendorsement.tests); + ("double endorsement", Test_double_endorsement.tests); + ("double preendorsement", Test_double_preendorsement.tests); + ("double baking", Test_double_baking.tests); + ("seed", Test_seed.tests); + ("baking", Test_baking.tests); + ("delegation", Test_delegation.tests); + ("deactivation", Test_deactivation.tests); + ("helpers rpcs", Test_helpers_rpcs.tests); + ("participation monitoring", Test_participation.tests); + ("frozen deposits", Test_frozen_deposits.tests); + ("consensus key", Test_consensus_key.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml new file mode 100644 index 000000000000..8d332485f39f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml @@ -0,0 +1,460 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (baking) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^baking$" + Subject: Rewards and bakers. Tests based on RPCs. +*) + +open Protocol +open Alpha_context + +(** Verify the level is correctly computed when the first cycle is + passed and after baking a certain fixed number of blocks (10 for + the moment). The result should be [blocks_per_cycle + 10] where + [blocks_per_cycle] comes from the constants of the selected + protocol. + + IMPROVEMENTS: + - Randomize the number of cycle. + - Randomize the number of accounts created at the beginning + - Randomize the blocks per cycle. + - Randomize the number of blocks baked after the n cycles baked + previously. *) +let test_cycle () = + Context.init_n ~consensus_threshold:0 5 () >>=? fun (b, _contracts) -> + Context.get_constants (B b) >>=? fun csts -> + let blocks_per_cycle = csts.parametric.blocks_per_cycle in + let pp fmt x = Format.fprintf fmt "%ld" x in + Block.bake b >>=? fun b -> + Block.bake_until_cycle_end b >>=? fun b -> + Context.get_level (B b) >>?= fun curr_level -> + Assert.equal + ~loc:__LOC__ + Int32.equal + "not the right level" + pp + (Alpha_context.Raw_level.to_int32 curr_level) + blocks_per_cycle + >>=? fun () -> + Context.get_level (B b) >>?= fun l -> + Block.bake_n 10 b >>=? fun b -> + Context.get_level (B b) >>?= fun curr_level -> + Assert.equal + ~loc:__LOC__ + Int32.equal + "not the right level" + pp + (Alpha_context.Raw_level.to_int32 curr_level) + (Int32.add (Alpha_context.Raw_level.to_int32 l) 10l) + +let wrap et = et >>= fun e -> Lwt.return (Environment.wrap_tzresult e) + +(** Test baking [n] cycles in a raw works smoothly. *) +let test_bake_n_cycles n () = + let open Block in + let policy = By_round 0 in + Context.init1 ~consensus_threshold:0 () >>=? fun (block, _contract) -> + Block.bake_until_n_cycle_end ~policy n block >>=? fun (_block : block) -> + return_unit + +(** Check that, after one or two voting periods, the voting power of a baker is + updated according to the rewards it receives for baking the blocks in the + voting periods. Note we consider only one baker. *) +let test_voting_power_cache () = + let open Block in + let policy = By_round 0 in + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Context.get_constants (B genesis) >>=? fun csts -> + let blocks_per_voting_period = + Int32.( + mul + csts.parametric.blocks_per_cycle + csts.parametric.cycles_per_voting_period) + in + let blocks_per_voting_periods n = + Int64.of_int (n * Int32.to_int blocks_per_voting_period) + in + Context.get_baking_reward_fixed_portion (B genesis) >>=? fun baking_reward -> + Context.get_bakers (B genesis) >>=? fun bakers -> + let baker = WithExceptions.Option.get ~loc:__LOC__ @@ List.hd bakers in + Context.Delegate.full_balance (B genesis) baker >>=? fun full_balance -> + let assert_voting_power ~loc n block = + Context.get_voting_power (B block) baker >>=? fun voting_power -> + Assert.equal_int64 ~loc n voting_power + in + (* the voting power is the full staking balance *) + let initial_voting_power_at_genesis = Tez.to_mutez full_balance in + assert_voting_power ~loc:__LOC__ initial_voting_power_at_genesis genesis + >>=? fun () -> + let rewards_after_one_voting_period = + Test_tez.(baking_reward *! Int64.pred (blocks_per_voting_periods 1)) + in + let expected_delta_voting_power_after_one_voting_period = + Tez.to_mutez rewards_after_one_voting_period + in + Block.bake_n ~policy (Int32.to_int blocks_per_voting_period - 1) genesis + >>=? fun block -> + let expected_voting_power_after_one_voting_period = + Int64.add + initial_voting_power_at_genesis + expected_delta_voting_power_after_one_voting_period + in + assert_voting_power + ~loc:__LOC__ + expected_voting_power_after_one_voting_period + block + >>=? fun () -> + let rewards_after_two_voting_periods = + Test_tez.(baking_reward *! Int64.pred (blocks_per_voting_periods 2)) + in + let expected_delta_voting_power_after_two_voting_periods = + Tez.to_mutez rewards_after_two_voting_periods + in + Block.bake_n ~policy (Int32.to_int blocks_per_voting_period) block + >>=? fun block -> + let expected_voting_power_after_two_voting_periods = + Int64.add + initial_voting_power_at_genesis + expected_delta_voting_power_after_two_voting_periods + in + assert_voting_power + ~loc:__LOC__ + expected_voting_power_after_two_voting_periods + block + +(** test that after baking, one gets the baking reward fixed portion. *) +let test_basic_baking_reward () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, baker) -> + Block.bake genesis >>=? fun b -> + let baker_pkh = Context.Contract.pkh baker in + Context.Contract.balance (B b) baker >>=? fun bal -> + Context.Delegate.current_frozen_deposits (B b) baker_pkh + >>=? fun frozen_deposit -> + Context.get_baking_reward_fixed_portion (B b) >>=? fun br -> + let open Test_tez in + let expected_initial_balance = bal +! frozen_deposit -! br in + Assert.equal_tez + ~loc:__LOC__ + expected_initial_balance + Account.default_initial_balance + +let get_contract_for_pkh contracts pkh = + let rec find_contract = function + | [] -> assert false + | c :: t -> + let c_pkh = Context.Contract.pkh c in + if Tezos_crypto.Signature.Public_key_hash.equal c_pkh pkh then return c + else find_contract t + in + find_contract contracts + +(** Test that + - the block producer gets the bonus for including the endorsements; + - the payload producer gets the baking reward. + + The test checks this in two scenarios, in the first one the payload producer + and the block producer are the same delegate, in the second one they are + different. The first scenario is checked by first baking block [b1] and then + block [b2] at round 0 containing a number of endorsements for [b1] and the + checking the balance of [b2]'s baker. For the second scenario another block + [b2'] is build on top of [b1] by a different baker, using the same payload as + [b2]. *) +let test_rewards_block_and_payload_producer () = + Context.init_n ~consensus_threshold:1 10 () >>=? fun (genesis, contracts) -> + Context.get_baker (B genesis) ~round:Round.zero >>=? fun baker_b1 -> + get_contract_for_pkh contracts baker_b1 >>=? fun baker_b1_contract -> + Block.bake ~policy:(By_round 0) genesis >>=? fun b1 -> + Context.get_endorsers (B b1) >>=? fun endorsers -> + List.map_es + (function + | {Plugin.RPC.Validators.delegate; slots; _} -> return (delegate, slots)) + endorsers + >>=? fun endorsers -> + (* We let just a part of the endorsers vote; we assume here that 5 of 10 + endorsers will have together at least one slot (to pass the threshold), but + not all slots (to make the test more interesting, otherwise we know the + total endorsing power). *) + let endorsers = List.take_n 5 endorsers in + List.map_ep + (fun (endorser, _slots) -> Op.endorsement ~delegate:endorser b1) + endorsers + >>=? fun endos -> + let endorsing_power = + List.fold_left + (fun acc (_pkh, slots) -> acc + List.length slots) + 0 + endorsers + in + let fee = Tez.one in + Op.transaction (B b1) ~fee baker_b1_contract baker_b1_contract Tez.one + >>=? fun tx -> + Block.bake ~policy:(By_round 0) ~operations:(endos @ [tx]) b1 >>=? fun b2 -> + Context.get_baker (B b1) ~round:Round.zero >>=? fun baker_b2 -> + get_contract_for_pkh contracts baker_b2 >>=? fun baker_b2_contract -> + Context.Contract.balance (B b2) baker_b2_contract >>=? fun bal -> + Context.Delegate.current_frozen_deposits (B b2) baker_b2 + >>=? fun frozen_deposit -> + Context.get_baking_reward_fixed_portion (B b2) >>=? fun baking_reward -> + Context.get_bonus_reward (B b2) ~endorsing_power >>=? fun bonus_reward -> + (if Tezos_crypto.Signature.Public_key_hash.equal baker_b2 baker_b1 then + Context.get_baking_reward_fixed_portion (B b1) + else return Tez.zero) + >>=? fun reward_for_b1 -> + (* we are in the first scenario where the payload producer is the same as the + block producer, in our case, [baker_b2]. [baker_b2] gets the baking reward + plus the fee for the transaction [tx]. *) + let expected_balance = + let open Test_tez in + Account.default_initial_balance -! frozen_deposit +! baking_reward + +! bonus_reward +! reward_for_b1 +! fee + in + Assert.equal_tez ~loc:__LOC__ bal expected_balance >>=? fun () -> + (* Some new baker [baker_b2'] bakes b2' at the first round which does not + correspond to a slot of [baker_b2] and it includes the PQC for [b2]. We + check that the fixed baking reward goes to the payload producer [baker_b2], + while the bonus goes to the the block producer (aka baker) [baker_b2']. *) + Context.get_endorsers (B b2) >>=? fun endorsers -> + List.map_es + (function + | {Plugin.RPC.Validators.delegate; slots; _} -> return (delegate, slots)) + endorsers + >>=? fun preendorsers -> + List.map_ep + (fun (endorser, _slots) -> Op.preendorsement ~delegate:endorser b2) + preendorsers + >>=? fun preendos -> + Context.get_baker (B b1) ~round:Round.zero >>=? fun baker_b2 -> + Context.get_bakers (B b1) >>=? fun bakers -> + let baker_b2' = Context.get_first_different_baker baker_b2 bakers in + Block.bake + ~payload_round:(Some Round.zero) + ~locked_round:(Some Round.zero) + ~policy:(By_account baker_b2') + ~operations:(preendos @ endos @ [tx]) + b1 + >>=? fun b2' -> + (* [baker_b2], as payload producer, gets the block reward and the fees *) + Context.Contract.balance (B b2') baker_b2_contract >>=? fun bal -> + Context.Delegate.current_frozen_deposits (B b2') baker_b2 + >>=? fun frozen_deposit -> + let reward_for_b1 = + if Tezos_crypto.Signature.Public_key_hash.equal baker_b2 baker_b1 then + baking_reward + else Tez.zero + in + let expected_balance = + let open Test_tez in + Account.default_initial_balance +! baking_reward -! frozen_deposit + +! reward_for_b1 +! fee + in + Assert.equal_tez ~loc:__LOC__ bal expected_balance >>=? fun () -> + (* [baker_b2'] gets the bonus because he is the one who included the + endorsements *) + get_contract_for_pkh contracts baker_b2' >>=? fun baker_b2'_contract -> + Context.Contract.balance (B b2') baker_b2'_contract >>=? fun bal' -> + Context.Delegate.current_frozen_deposits (B b2') baker_b2' + >>=? fun frozen_deposits' -> + Context.get_baker (B genesis) ~round:Round.zero >>=? fun baker_b1 -> + let reward_for_b1' = + if Tezos_crypto.Signature.Public_key_hash.equal baker_b2' baker_b1 then + baking_reward + else Tez.zero + in + let expected_balance' = + let open Test_tez in + Account.default_initial_balance +! bonus_reward +! reward_for_b1' + -! frozen_deposits' + in + Assert.equal_tez ~loc:__LOC__ bal' expected_balance' + +(** We test that: + - a delegate that has active stake can bake; + - a delegate that has no active stake cannot bake. +*) +let test_enough_active_stake_to_bake ~has_active_stake () = + Context.init1 () >>=? fun (b_for_constants, _contract) -> + Context.get_constants (B b_for_constants) + >>=? fun Constants.{parametric = {minimal_stake; _}; _} -> + let tpr = Tez.to_mutez minimal_stake in + (* N.B. setting the balance has an impact on the active stake; without + delegation, the full balance is the same as the staking balance and the + active balance is less or equal the staking balance (see + [Delegate_sampler.select_distribution_for_cycle]). *) + let initial_bal1 = if has_active_stake then tpr else Int64.sub tpr 1L in + Context.init2 + ~bootstrap_balances:[initial_bal1; tpr] + ~consensus_threshold:0 + () + >>=? fun (b0, (account1, _account2)) -> + let pkh1 = Context.Contract.pkh account1 in + Context.get_constants (B b0) + >>=? fun Constants.{parametric = {baking_reward_fixed_portion; _}; _} -> + Block.bake ~policy:(By_account pkh1) b0 >>= fun b1 -> + if has_active_stake then + b1 >>?= fun b1 -> + Context.Contract.balance (B b1) account1 >>=? fun bal -> + Context.Delegate.current_frozen_deposits (B b1) pkh1 + >>=? fun frozen_deposit -> + let expected_bal = + Test_tez.( + Tez.of_mutez_exn initial_bal1 + -! frozen_deposit +! baking_reward_fixed_portion) + in + Assert.equal_tez ~loc:__LOC__ bal expected_bal + else + (* pkh1 has less than minimal_stake so it will have no slots, thus it + cannot be a proposer, thus it cannot bake. Precisely, bake fails because + get_next_baker_by_account fails with "No slots found for pkh1" *) + Assert.error ~loc:__LOC__ b1 (fun _ -> true) + +let test_committee_sampling () = + let test_distribution max_round distribution = + let bootstrap_balances, bounds = List.split distribution in + Account.generate_accounts (List.length bootstrap_balances) + >>?= fun accounts -> + let bootstrap_accounts = + Account.make_bootstrap_accounts ~bootstrap_balances accounts + in + let consensus_committee_size = max_round in + assert ( + (* Enforce that we are not mistakenly testing a value for committee_size + that violates invariants of module Slot_repr. *) + Result.is_ok + (Slot_repr.of_int consensus_committee_size)) ; + let constants = + { + Default_parameters.constants_test with + consensus_committee_size; + consensus_threshold = 0; + } + in + let parameters = + Default_parameters.parameters_of_constants ~bootstrap_accounts constants + in + Block.genesis_with_parameters parameters >>=? fun genesis -> + Plugin.RPC.Baking_rights.get Block.rpc_ctxt ~all:true ~max_round genesis + >|=? fun bakers -> + let stats = Stdlib.Hashtbl.create 10 in + Stdlib.List.iter2 + (fun acc bounds -> Stdlib.Hashtbl.add stats acc.Account.pkh (bounds, 0)) + accounts + bounds ; + List.iter + (fun {Plugin.RPC.Baking_rights.delegate = pkh; _} -> + let bounds, n = Stdlib.Hashtbl.find stats pkh in + Stdlib.Hashtbl.replace stats pkh (bounds, n + 1)) + bakers ; + let one_failed = ref false in + + Format.eprintf + "@[<hov>Testing with baker distribution [%a],@ committee size %d.@]@." + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ ") + (fun ppf (tez, _) -> Format.fprintf ppf "%Ld" tez)) + distribution + max_round ; + + Format.eprintf + "@[<v 2>@,%a@]@." + (fun ppf stats -> + Stdlib.Hashtbl.iter + (fun pkh ((min_p, max_p), n) -> + let failed = not (n >= min_p && n <= max_p) in + Format.fprintf + ppf + "@[<h>- %a %d%a@]@," + Tezos_crypto.Signature.Public_key_hash.pp + pkh + n + (fun ppf failed -> + if failed then + Format.fprintf ppf " [FAIL] should be in [%d, %d]" min_p max_p + else Format.fprintf ppf "") + failed ; + one_failed := failed || !one_failed) + stats) + stats ; + + if !one_failed then + Stdlib.failwith + "The proportion of bakers marked as [FAILED] in the log output appear \ + in the wrong proportion in the committee." + else Format.eprintf "Test succesful.@." + in + (* The tests below are not deterministic, but the probability that + they fail is infinitesimal. *) + let accounts = + let expected_lower_bound = 6_100 and expected_upper_bound = 6_900 in + let balance = 8_000_000_000L in + let account = (balance, (expected_lower_bound, expected_upper_bound)) in + Array.(make 10 account |> to_list) + in + test_distribution 65535 accounts >>=? fun () -> + test_distribution + 10_000 + [ + (16_000_000_000L, (4_600, 5_400)); + (8_000_000_000L, (2_200, 2_800)); + (8_000_000_000L, (2_200, 2_800)); + ] + >>=? fun () -> + test_distribution + 10_000 + [(792_000_000_000L, (9_830, 9_970)); (8_000_000_000L, (40, 160))] + +let tests = + [ + Tztest.tztest "cycle" `Quick test_cycle; + Tztest.tztest + "test_bake_n_cycles for 12 cycles" + `Quick + (test_bake_n_cycles 12); + Tztest.tztest "voting_power" `Quick test_voting_power_cache; + Tztest.tztest + "the fixed baking reward is given after a bake" + `Quick + test_basic_baking_reward; + Tztest.tztest + "test that the block producer gets the bonus while the payload producer \ + gets the baking reward " + `Quick + test_rewards_block_and_payload_producer; + Tztest.tztest + "test that a delegate with 8000 tez can bake" + `Quick + (test_enough_active_stake_to_bake ~has_active_stake:true); + Tztest.tztest + "test that a delegate with 7999 tez cannot bake" + `Quick + (test_enough_active_stake_to_bake ~has_active_stake:false); + Tztest.tztest "test committee sampling" `Quick test_committee_sampling; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml new file mode 100644 index 000000000000..336097c14e35 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -0,0 +1,304 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (delegate_storage) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^consensus key$" + Subject: consistency of the [Drain_delegate] operation + *) + +open Protocol +open Alpha_context + +let constants = + { + Default_parameters.constants_test with + endorsing_reward_per_slot = Tez.zero; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + consensus_threshold = 0; + origination_size = 0; + } + +(** Checks that staking balance is sum of delegators' stake. *) +let check_delegate_staking_invariant blk delegate_pkh = + Context.Delegate.staking_balance (B blk) delegate_pkh + >>=? fun delegate_staking_balance -> + Context.Delegate.full_balance (B blk) delegate_pkh + >>=? fun self_staking_balance -> + Context.Delegate.info (B blk) delegate_pkh >>=? fun delegate_info -> + let delegate_contract = Contract.Implicit delegate_pkh in + let delegated_contracts = + List.filter + (fun c -> Contract.(c <> delegate_contract)) + delegate_info.delegated_contracts + in + List.fold_left_es + (fun total pkh -> + Context.Contract.balance_and_frozen_bonds (B blk) pkh + >>=? fun staking_balance -> + Lwt.return Tez.(total +? staking_balance) >|= Environment.wrap_tzresult) + self_staking_balance + delegated_contracts + >>=? fun delegators_stake -> + Assert.equal_tez ~loc:__LOC__ delegate_staking_balance delegators_stake + +let update_consensus_key blk delegate public_key = + let nb_delay_cycles = constants.preserved_cycles + 1 in + Op.update_consensus_key (B blk) (Contract.Implicit delegate) public_key + >>=? fun update_ck -> + Block.bake ~operation:update_ck blk >>=? fun blk' -> + Block.bake_until_n_cycle_end nb_delay_cycles blk' + +let delegate_stake blk source delegate = + Op.delegation (B blk) (Contract.Implicit source) (Some delegate) + >>=? fun delegation -> Block.bake ~operation:delegation blk + +let transfer_tokens blk source destination amount = + Op.transaction + (B blk) + (Contract.Implicit source) + (Contract.Implicit destination) + amount + >>=? fun transfer_op -> Block.bake ~operation:transfer_op blk + +let may_reveal_manager_key blk (pkh, pk) = + let open Lwt_result_syntax in + let* is_revealed = + Context.Contract.is_manager_key_revealed (B blk) (Contract.Implicit pkh) + in + if is_revealed then return blk + else + Op.revelation (B blk) pk >>=? fun reveal_op -> + Block.bake ~operation:reveal_op blk + +let drain_delegate ~policy blk consensus_key delegate destination + expected_final_balance = + Op.drain_delegate (B blk) ~consensus_key ~delegate ~destination + >>=? fun drain_del -> + Block.bake ~policy ~operation:drain_del blk >>=? fun blk' -> + check_delegate_staking_invariant blk' delegate >>=? fun () -> + Context.Contract.balance (B blk') (Contract.Implicit delegate) + >>=? fun final_balance -> + Assert.equal_tez ~loc:__LOC__ final_balance expected_final_balance + +let get_first_2_accounts_contracts (a1, a2) = + ((a1, Context.Contract.pkh a1), (a2, Context.Contract.pkh a2)) + +let test_drain_delegate_scenario f = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (_contract1, account1_pkh), (_contract2, account2_pkh) = + get_first_2_accounts_contracts contracts + in + let consensus_account = Account.new_account () in + let delegate = account1_pkh in + let consensus_pk = consensus_account.pk in + let consensus_pkh = consensus_account.pkh in + transfer_tokens genesis account2_pkh consensus_pkh Tez.one_mutez + >>=? fun blk' -> + update_consensus_key blk' delegate consensus_pk >>=? fun blk' -> + f blk' consensus_pkh consensus_pk delegate + +let test_drain_delegate ~low_balance ~exclude_ck ~ck_delegates () = + test_drain_delegate_scenario (fun blk consensus_pkh consensus_pk delegate -> + let policy = + if exclude_ck then Block.Excluding [consensus_pkh] + else Block.By_account delegate + in + (if ck_delegates then + may_reveal_manager_key blk (consensus_pkh, consensus_pk) >>=? fun blk -> + delegate_stake blk consensus_pkh delegate + else return blk) + >>=? fun blk -> + Context.Contract.balance (B blk) (Contract.Implicit delegate) + >>=? fun delegate_balance -> + (if low_balance then + transfer_tokens blk delegate consensus_pkh delegate_balance + >>=? fun blk -> + may_reveal_manager_key blk (consensus_pkh, consensus_pk) >>=? fun blk -> + transfer_tokens blk consensus_pkh delegate Tez.(of_mutez_exn 1_000_000L) + else return blk) + >>=? fun blk -> + Context.Contract.balance (B blk) (Contract.Implicit delegate) + >>=? fun delegate_balance -> + let expected_final_balance = + if exclude_ck then Tez.zero + else Tez.(max one (div_exn delegate_balance 100)) + in + drain_delegate + ~policy + blk + consensus_pkh + delegate + consensus_pkh + expected_final_balance) + +let test_drain_empty_delegate ~exclude_ck () = + test_drain_delegate_scenario (fun blk consensus_pkh _consensus_pk delegate -> + let policy = + if exclude_ck then Block.Excluding [consensus_pkh] + else Block.By_account delegate + in + Context.Contract.balance (B blk) (Contract.Implicit delegate) + >>=? fun delegate_balance -> + transfer_tokens blk delegate consensus_pkh delegate_balance + >>=? fun blk -> + drain_delegate ~policy blk consensus_pkh delegate consensus_pkh Tez.zero + >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + "Drain delegate without enough balance for allocation burn or drain \ + fees") + +let test_tz4_consensus_key () = + Context.init_with_constants1 constants >>=? fun (genesis, contracts) -> + let account1_pkh = Context.Contract.pkh contracts in + let consensus_account = Account.new_account ~algo:Bls () in + let delegate = account1_pkh in + let consensus_pk = consensus_account.pk in + let consensus_pkh = consensus_account.pkh in + transfer_tokens genesis account1_pkh consensus_pkh Tez.one_mutez + >>=? fun blk' -> + Op.update_consensus_key (B blk') (Contract.Implicit delegate) consensus_pk + >>=? fun operation -> + let tz4_pk = match consensus_pk with Bls pk -> pk | _ -> assert false in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Delegate_consensus_key.Invalid_consensus_key_update_tz4 pk); + ] + when Tezos_crypto.Bls.Public_key.(pk = tz4_pk) -> + return_unit + | err -> + failwith + "Error trace:@,\ + \ %a does not match the \ + [Delegate_consensus_key.Invalid_consensus_key_update_tz4] error" + Error_monad.pp_print_trace + err + in + Incremental.begin_construction blk' >>=? fun inc -> + Incremental.validate_operation ~expect_failure inc operation + >>=? fun (_i : Incremental.t) -> return_unit + +let test_endorsement_with_consensus_key () = + Context.init_with_constants1 constants >>=? fun (genesis, contracts) -> + let account1_pkh = Context.Contract.pkh contracts in + let consensus_account = Account.new_account () in + let delegate = account1_pkh in + let consensus_pk = consensus_account.pk in + let consensus_pkh = consensus_account.pkh in + transfer_tokens genesis account1_pkh consensus_pkh Tez.one_mutez + >>=? fun blk' -> + update_consensus_key blk' delegate consensus_pk >>=? fun b_pre -> + Block.bake b_pre >>=? fun b -> + let slot = Slot.of_int_do_not_use_except_for_parameters 0 in + Op.endorsement ~delegate:account1_pkh ~slot b >>=? fun endorsement -> + Block.bake ~operation:endorsement b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Operation.Invalid_signature -> true + | _ -> false) + >>=? fun () -> + Op.endorsement ~delegate:consensus_pkh ~slot b >>=? fun endorsement -> + Block.bake ~operation:endorsement b >>=? fun (_good_block : Block.t) -> + return_unit + +let tests = + Tztest. + [ + tztest + "test drain delegate high balance, excluding ck, ck delegates" + `Quick + (test_drain_delegate + ~low_balance:false + ~exclude_ck:true + ~ck_delegates:true); + tztest + "test drain delegate high balance, excluding ck, ck does not delegate" + `Quick + (test_drain_delegate + ~low_balance:false + ~exclude_ck:true + ~ck_delegates:false); + tztest + "test drain delegate high balance, with ck, ck delegates" + `Quick + (test_drain_delegate + ~low_balance:false + ~exclude_ck:false + ~ck_delegates:true); + tztest + "test drain delegate high balance, with ck, ck does not delegate" + `Quick + (test_drain_delegate + ~low_balance:false + ~exclude_ck:false + ~ck_delegates:false); + tztest + "test drain delegate low balance, excluding ck, ck delegates" + `Quick + (test_drain_delegate + ~low_balance:true + ~exclude_ck:true + ~ck_delegates:true); + tztest + "test drain delegate low balance, excluding ck, ck does not delegate" + `Quick + (test_drain_delegate + ~low_balance:true + ~exclude_ck:true + ~ck_delegates:false); + tztest + "test drain delegate low balance, with ck, ck delegates" + `Quick + (test_drain_delegate + ~low_balance:true + ~exclude_ck:false + ~ck_delegates:true); + tztest + "test drain delegate low balance, with ck, ck does not delegate" + `Quick + (test_drain_delegate + ~low_balance:true + ~exclude_ck:false + ~ck_delegates:false); + tztest + "test empty drain delegate excluding ck" + `Quick + (test_drain_empty_delegate ~exclude_ck:true); + tztest + "test empty drain delegate with ck" + `Quick + (test_drain_empty_delegate ~exclude_ck:false); + tztest "test tz4 consensus key" `Quick test_tz4_consensus_key; + tztest + "test endorsement with ck" + `Quick + test_endorsement_with_consensus_key; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml new file mode 100644 index 000000000000..a8fa7b8e547b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml @@ -0,0 +1,358 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^deactivation$" + Subject: After a given number of cycles during which a delegate has not + made use of its baking and endorsing rights, its account will + be deactivated for validator selection. To bake/endorse + again, it will have to re-activate its account. +*) + +open Protocol +open Alpha_context +open Test_tez + +let wrap e = Lwt.return (Environment.wrap_tzresult e) + +(** Check that [Delegate.staking_balance] is the same as [Delegate.full_balance] + (this is not true in general, but in these tests it is because they only deal + with self-delegation. Also, check that [Delegate.staking_balance] coincides + with [Stake_storage.get] when the account is active and it has the minimal + required stake. *) +let check_stake ~loc (b : Block.t) (account : Account.t) = + Context.Delegate.staking_balance (B b) account.pkh >>=? fun staking_balance -> + Context.Delegate.full_balance (B b) account.pkh >>=? fun full_balance -> + Assert.equal_tez ~loc full_balance staking_balance >>=? fun () -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctxt -> + Stake_storage.get ctxt account.pkh >>= wrap >>=? fun stake -> + Assert.equal_int64 + ~loc + (Tez_repr.to_mutez stake) + (Tez.to_mutez staking_balance) + +(** Check that [Stake_storage.get] returns 0 (following a deactivation). Note + that in case of deactivation [Delegate.staking_balance] does not necessarily + coincide with [Stake_storage.get] in that [Delegate.staking_balance] may be + positive (while [Stake_storage.get] returns 0 because the account is no + longer in [Active_delegate_with_minimal_stake] because of deactivation, see + [Stake_storage].) *) +let check_no_stake ~loc (b : Block.t) (account : Account.t) = + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctxt -> + Stake_storage.get ctxt account.pkh >>= wrap >>=? fun stake -> + Assert.equal_int64 ~loc (Tez_repr.to_mutez stake) 0L + +(** Create a block with two initialized contracts/accounts. Assert + that the first account has a staking balance that is equal to its + own balance, and that its staking rights are consistent + (check_stake). *) +let test_simple_staking_rights () = + Context.init2 () >>=? fun (b, (a1, _a2)) -> + Context.Contract.balance (B b) a1 >>=? fun balance -> + let delegate1 = Context.Contract.pkh a1 in + Context.Delegate.current_frozen_deposits (B b) delegate1 + >>=? fun frozen_deposits -> + let expected_initial_balance = + Account.default_initial_balance -! frozen_deposits + in + Assert.equal_tez ~loc:__LOC__ balance expected_initial_balance >>=? fun () -> + Context.Contract.manager (B b) a1 >>=? fun m1 -> + Context.Delegate.info (B b) m1.pkh >>=? fun info -> + Assert.equal_tez + ~loc:__LOC__ + Account.default_initial_balance + info.staking_balance + >>=? fun () -> check_stake ~loc:__LOC__ b m1 + +(** Create a block with two initialized contracts/accounts. Bake + five blocks. Assert that the staking balance of the first account + equals to its balance. Then both accounts have consistent staking + rights. *) +let test_simple_staking_rights_after_baking () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, (a1, a2)) -> + Context.Contract.manager (B b) a1 >>=? fun m1 -> + Context.Contract.manager (B b) a2 >>=? fun m2 -> + Block.bake_n ~policy:(By_account m2.pkh) 5 b >>=? fun b -> + Context.Contract.balance (B b) a1 >>=? fun balance -> + let delegate1 = Context.Contract.pkh a1 in + Context.Delegate.current_frozen_deposits (B b) delegate1 + >>=? fun frozen_deposits -> + balance +? frozen_deposits >>?= fun full_balance -> + Context.Delegate.info (B b) m1.pkh >>=? fun info -> + Assert.equal_tez ~loc:__LOC__ full_balance info.staking_balance >>=? fun () -> + check_stake ~loc:__LOC__ b m1 >>=? fun () -> check_stake ~loc:__LOC__ b m2 + +let check_active_staking_balance ~loc ~deactivated b (m : Account.t) = + Context.Delegate.info (B b) m.pkh >>=? fun info -> + Assert.equal_bool ~loc info.deactivated deactivated >>=? fun () -> + if deactivated then check_no_stake ~loc b m else check_stake ~loc b m + +let run_until_deactivation () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, (a1, a2)) -> + Context.Contract.balance (B b) a1 >>=? fun balance_start -> + Context.Contract.manager (B b) a1 >>=? fun m1 -> + Context.Contract.manager (B b) a2 >>=? fun m2 -> + check_active_staking_balance ~loc:__LOC__ ~deactivated:false b m1 + >>=? fun () -> + Context.Delegate.info (B b) m1.pkh >>=? fun info -> + Block.bake_until_cycle ~policy:(By_account m2.pkh) info.grace_period b + >>=? fun b -> + check_active_staking_balance ~loc:__LOC__ ~deactivated:false b m1 + >>=? fun () -> + Block.bake_until_cycle_end ~policy:(By_account m2.pkh) b >>=? fun b -> + check_active_staking_balance ~loc:__LOC__ ~deactivated:true b m1 + >|=? fun () -> (b, ((a1, m1), balance_start), (a2, m2)) + +(** From an initialized block with two contracts/accounts, the first + one is active then deactivated. After baking, check that the + account is active again. Baking rights are ensured. *) +let test_deactivation_then_bake () = + run_until_deactivation () + >>=? fun ( b, + ((_deactivated_contract, deactivated_account), _start_balance), + (_a2, _m2) ) -> + Block.bake ~policy:(By_account deactivated_account.pkh) b >>=? fun b -> + check_active_staking_balance + ~loc:__LOC__ + ~deactivated:false + b + deactivated_account + +(** check that an account which is deactivated for [preserved_cycles] cannot be + part of a committee *) +let test_a_really_deactivated_account_is_not_in_the_committee () = + run_until_deactivation () + >>=? fun ( b, + ((_deactivated_contract, deactivated_account), _start_balance), + (_a2, m2) ) -> + (* at this point, the deactivated account can either bake (because it still + has rights) and become active again, or, in case it is inactive for another + [preserved_cycles], it has no more rights, thus cannot be part of the + committee. *) + let constants = Default_parameters.constants_test in + Block.bake_until_n_cycle_end + (constants.preserved_cycles + 1) + ~policy:(By_account m2.pkh) + b + >>=? fun b -> + Plugin.RPC.Baking_rights.get + Block.rpc_ctxt + ~delegates:[deactivated_account.pkh] + b + >>=? fun bakers -> + match List.hd bakers with Some _ -> assert false | None -> return_unit + +(** A deactivated account, after baking with self-delegation, is + active again. Preservation of its balance is tested. Baking rights + are ensured. *) +let test_deactivation_then_self_delegation () = + run_until_deactivation () + >>=? fun ( b, + ((deactivated_contract, deactivated_account), _start_balance), + (_a2, m2) ) -> + Op.delegation (B b) deactivated_contract (Some deactivated_account.pkh) + >>=? fun self_delegation -> + Block.bake ~policy:(By_account m2.pkh) b ~operation:self_delegation + >>=? fun b -> + check_active_staking_balance + ~loc:__LOC__ + ~deactivated:false + b + deactivated_account + >>=? fun () -> check_stake ~loc:__LOC__ b deactivated_account + +(** A deactivated account, which is emptied (into a newly created sink + account), then self-delegated, becomes activated. Its balance is + zero. Baking rights are ensured. *) +let test_deactivation_then_empty_then_self_delegation () = + run_until_deactivation () + >>=? fun ( b, + ((deactivated_contract, deactivated_account), _start_balance), + (_a2, m2) ) -> + (* empty the contract *) + Context.Contract.balance (B b) deactivated_contract >>=? fun balance -> + let sink_account = Account.new_account () in + let sink_contract = Contract.Implicit sink_account.pkh in + Context.get_constants (B b) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> + let amount = + match balance -? origination_burn with Ok r -> r | Error _ -> assert false + in + Op.transaction (B b) deactivated_contract sink_contract amount + >>=? fun empty_contract -> + Block.bake ~policy:(By_account m2.pkh) ~operation:empty_contract b + >>=? fun b1 -> + (* the account is deactivated, the stake is 0. *) + check_no_stake ~loc:__LOC__ b deactivated_account >>=? fun () -> + (* self delegation *) + Op.delegation (B b1) deactivated_contract (Some deactivated_account.pkh) + >>=? fun self_delegation -> + Block.bake ~policy:(By_account m2.pkh) ~operation:self_delegation b1 + >>=? fun b2 -> + check_active_staking_balance + ~loc:__LOC__ + ~deactivated:false + b2 + deactivated_account + >>=? fun () -> + (* the account is activated, the stake is still 0. *) + Context.Contract.balance (B b2) deactivated_contract >>=? fun balance -> + Assert.equal_tez ~loc:__LOC__ Tez.zero balance + +(** A deactivated account, which is emptied, then self-delegated, then + re-credited of the sunk amount, becomes active again. Staking + rights remain consistent. *) +let test_deactivation_then_empty_then_self_delegation_then_recredit () = + run_until_deactivation () + >>=? fun ( b, + ((deactivated_contract, deactivated_account), _start_balance), + (_a2, m2) ) -> + (* empty the contract *) + Context.Contract.balance (B b) deactivated_contract >>=? fun balance -> + let sink_account = Account.new_account () in + let sink_contract = Contract.Implicit sink_account.pkh in + Context.get_constants (B b) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> + let amount = + match balance -? origination_burn with Ok r -> r | Error _ -> assert false + in + Op.transaction + ~force_reveal:true + (B b) + deactivated_contract + sink_contract + amount + >>=? fun empty_contract -> + Block.bake ~policy:(By_account m2.pkh) ~operation:empty_contract b + >>=? fun b0 -> + (* the account is deactivated, the stake is 0. *) + check_no_stake ~loc:__LOC__ b deactivated_account >>=? fun () -> + (**** self delegation *) + Op.delegation (B b0) deactivated_contract (Some deactivated_account.pkh) + >>=? fun self_delegation -> + Block.bake ~policy:(By_account m2.pkh) ~operation:self_delegation b0 + >>=? fun b1 -> + (* the account is still deactivated *) + check_no_stake ~loc:__LOC__ b deactivated_account >>=? fun () -> + (**** recredit *) + Op.transaction + ~force_reveal:true + (B b1) + sink_contract + deactivated_contract + amount + >>=? fun recredit_contract -> + Block.bake ~policy:(By_account m2.pkh) ~operation:recredit_contract b1 + >>=? fun b2 -> + check_active_staking_balance + ~loc:__LOC__ + ~deactivated:false + b2 + deactivated_account + >>=? fun () -> + Context.Contract.balance (B b2) deactivated_contract >>=? fun balance2 -> + Assert.equal_tez ~loc:__LOC__ amount balance2 >>=? fun () -> + check_stake ~loc:__LOC__ b2 deactivated_account + +(** Initialize a block with two contracts/accounts. A third new account is also + created. The first account is self-delegated. First account sends to third + one minimal_stake tez (so that, once it is active, it can appear in + [Active_delegate_with_minimal_stake]. The third account has no delegate and is + consistent for baking rights. Then, it is self-delegated and is supposed to + be activated. Again, consistency for baking rights are preserved for the + first and third accounts. *) +let test_delegation () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, (a1, a2)) -> + let m3 = Account.new_account () in + Account.add_account m3 ; + Context.Contract.manager (B b) a1 >>=? fun m1 -> + Context.Contract.manager (B b) a2 >>=? fun m2 -> + let a3 = Contract.Implicit m3.pkh in + Context.Contract.delegate_opt (B b) a1 >>=? fun delegate -> + (match delegate with + | None -> assert false + | Some pkh -> assert (Tezos_crypto.Signature.Public_key_hash.equal pkh m1.pkh)) ; + let constants = Default_parameters.constants_test in + let minimal_stake = constants.minimal_stake in + Op.transaction ~force_reveal:true (B b) a1 a3 minimal_stake + >>=? fun transact -> + Block.bake ~policy:(By_account m2.pkh) b ~operation:transact >>=? fun b -> + Context.Contract.delegate_opt (B b) a3 >>=? fun delegate -> + (match delegate with None -> () | Some _ -> assert false) ; + check_no_stake ~loc:__LOC__ b m3 >>=? fun () -> + Op.delegation ~force_reveal:true (B b) a3 (Some m3.pkh) >>=? fun delegation -> + Block.bake ~policy:(By_account m2.pkh) b ~operation:delegation >>=? fun b -> + Context.Contract.delegate_opt (B b) a3 >>=? fun delegate -> + (match delegate with + | None -> assert false + | Some pkh -> assert (Tezos_crypto.Signature.Public_key_hash.equal pkh m3.pkh)) ; + check_active_staking_balance ~loc:__LOC__ ~deactivated:false b m3 + >>=? fun () -> + check_stake ~loc:__LOC__ b m3 >>=? fun () -> check_stake ~loc:__LOC__ b m1 + +let tests = + [ + Tztest.tztest "simple staking rights" `Quick test_simple_staking_rights; + Tztest.tztest + "simple staking rights after baking" + `Quick + test_simple_staking_rights_after_baking; + Tztest.tztest "deactivation then bake" `Quick test_deactivation_then_bake; + Tztest.tztest + "deactivation then self delegation" + `Quick + test_deactivation_then_self_delegation; + Tztest.tztest + "deactivation then empty then self delegation" + `Quick + test_deactivation_then_empty_then_self_delegation; + Tztest.tztest + "deactivation then empty then self delegation then recredit" + `Quick + test_deactivation_then_empty_then_self_delegation_then_recredit; + Tztest.tztest "delegate" `Quick test_delegation; + Tztest.tztest + "a really deactivated account is not part of the committee" + `Quick + test_a_really_deactivated_account_is_not_in_the_committee; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml new file mode 100644 index 000000000000..2aa32630dd84 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml @@ -0,0 +1,1616 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (delegation) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^delegation$" + Subject: - Properties on bootstrap contracts (self-delegation, + cannot delete/change their delegate (as opposed to contracts + not-being-delegate which can do these), bootstrap manager + as delegate during origination). + - Properties on delegation depending on whether delegate + keys registration, through origination and delegation. +*) + +open Protocol +open Alpha_context +open Test_tez + +(*****************************************************************************) +(* Bootstrap contracts + ------------------- + Bootstrap contracts are heavily used in other tests. It is helpful to test + some properties of these contracts, so we can correctly interpret the other + tests that use them. *) +(*****************************************************************************) + +let expect_error err = function + | err0 :: _ when err = err0 -> return_unit + | _ -> failwith "Unexpected successful result" + +let expect_alpha_error err = expect_error (Environment.Ecoproto_error err) + +let expect_no_change_registered_delegate_pkh pkh = function + | Environment.Ecoproto_error (Delegate_storage.Contract.No_deletion pkh0) :: _ + when pkh0 = pkh -> + return_unit + | _ -> failwith "Delegate can not be deleted and operation should fail." + +let expect_too_low_balance_error i op = + Incremental.add_operation i op >>= fun err -> + Assert.proto_error_with_info ~loc:__LOC__ err "Balance too low" + +let expect_delegate_already_active_error i op = + Incremental.add_operation i op >>= fun err -> + Assert.proto_error_with_info ~loc:__LOC__ err "Delegate already active" + +(** Bootstrap contracts delegate to themselves. *) +let bootstrap_manager_is_bootstrap_delegate () = + Context.init1 () >>=? fun (b, bootstrap0) -> + Context.Contract.delegate (B b) bootstrap0 >>=? fun delegate0 -> + Context.Contract.manager (B b) bootstrap0 >>=? fun manager0 -> + Assert.equal_pkh ~loc:__LOC__ delegate0 manager0.pkh + +(** Bootstrap contracts cannot change their delegate. *) +let bootstrap_delegate_cannot_change ~fee () = + Context.init2 () >>=? fun (b, (bootstrap0, bootstrap1)) -> + let pkh1 = Context.Contract.pkh bootstrap0 in + Incremental.begin_construction b ~policy:(Block.Excluding [pkh1]) + >>=? fun i -> + Context.Contract.manager (I i) bootstrap1 >>=? fun manager1 -> + Context.Contract.balance (I i) bootstrap0 >>=? fun balance0 -> + Context.Contract.delegate (I i) bootstrap0 >>=? fun delegate0 -> + (* change delegation to bootstrap1 *) + Op.delegation ~fee (I i) bootstrap0 (Some manager1.pkh) + >>=? fun set_delegate -> + if fee > balance0 then expect_too_low_balance_error i set_delegate + else + Incremental.add_operation + ~expect_apply_failure:(expect_no_change_registered_delegate_pkh delegate0) + i + set_delegate + >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* bootstrap0 still has same delegate *) + Context.Contract.delegate (B b) bootstrap0 >>=? fun delegate0_after -> + Assert.equal_pkh ~loc:__LOC__ delegate0_after delegate0 >>=? fun () -> + (* fee has been debited *) + Assert.balance_was_debited ~loc:__LOC__ (B b) bootstrap0 balance0 fee + +(** Bootstrap contracts cannot delete their delegation. *) +let bootstrap_delegate_cannot_be_removed ~fee () = + Context.init1 () >>=? fun (b, bootstrap) -> + Incremental.begin_construction b >>=? fun i -> + Context.Contract.balance (I i) bootstrap >>=? fun balance -> + Context.Contract.delegate (I i) bootstrap >>=? fun delegate -> + Context.Contract.manager (I i) bootstrap >>=? fun manager -> + (* remove delegation *) + Op.delegation ~fee (I i) bootstrap None >>=? fun set_delegate -> + if fee > balance then expect_too_low_balance_error i set_delegate + else + Incremental.add_operation + ~expect_apply_failure: + (expect_no_change_registered_delegate_pkh manager.pkh) + i + set_delegate + >>=? fun i -> + (* delegate has not changed *) + Context.Contract.delegate (I i) bootstrap >>=? fun delegate_after -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_after >>=? fun () -> + (* fee has been debited *) + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance fee + +(** Contracts not registered as delegate can change their + delegation. *) +let delegate_can_be_changed_from_unregistered_contract ~fee () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (bootstrap0, bootstrap1)) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let unregistered = Contract.Implicit unregistered_pkh in + Context.Contract.manager (B b) bootstrap0 >>=? fun manager0 -> + Context.Contract.manager (B b) bootstrap1 >>=? fun manager1 -> + let credit = of_int 10 in + Op.transaction ~fee:Tez.zero (B b) bootstrap0 unregistered credit + >>=? fun credit_contract -> + Context.Contract.balance (B b) bootstrap0 >>=? fun balance -> + Block.bake b ~operation:credit_contract >>=? fun b -> + (* delegate to bootstrap0 *) + Op.delegation + ~force_reveal:true + ~fee:Tez.zero + (B b) + unregistered + (Some manager0.pkh) + >>=? fun set_delegate -> + Block.bake b ~operation:set_delegate >>=? fun b -> + Context.Contract.delegate (B b) unregistered >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate manager0.pkh >>=? fun () -> + (* change delegation to bootstrap1 *) + Op.delegation ~force_reveal:true ~fee (B b) unregistered (Some manager1.pkh) + >>=? fun change_delegate -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i change_delegate + else + Incremental.add_operation i change_delegate >>=? fun i -> + (* delegate has changed *) + Context.Contract.delegate (I i) unregistered >>=? fun delegate_after -> + Assert.equal_pkh ~loc:__LOC__ delegate_after manager1.pkh >>=? fun () -> + (* fee has been debited *) + Assert.balance_was_debited ~loc:__LOC__ (I i) unregistered credit fee + +(** Contracts not registered as delegate can delete their + delegation. *) +let delegate_can_be_removed_from_unregistered_contract ~fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let unregistered = Contract.Implicit unregistered_pkh in + Context.Contract.manager (B b) bootstrap >>=? fun manager -> + let credit = of_int 10 in + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + unregistered + credit + >>=? fun credit_contract -> + Context.Contract.balance (B b) bootstrap >>=? fun balance -> + Block.bake b ~operation:credit_contract >>=? fun b -> + (* delegate to bootstrap *) + Op.delegation + ~force_reveal:true + ~fee:Tez.zero + (B b) + unregistered + (Some manager.pkh) + >>=? fun set_delegate -> + Block.bake b ~operation:set_delegate >>=? fun b -> + Context.Contract.delegate (B b) unregistered >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate manager.pkh >>=? fun () -> + (* remove delegation *) + Op.delegation ~fee (B b) unregistered None >>=? fun delete_delegate -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i delete_delegate + else + Incremental.add_operation i delete_delegate >>=? fun i -> + (* the delegate has been removed *) + (Context.Contract.delegate_opt (I i) unregistered >>=? function + | None -> return_unit + | Some _ -> failwith "Expected delegate to be removed") + >>=? fun () -> + (* fee has been debited *) + Assert.balance_was_debited ~loc:__LOC__ (I i) unregistered credit fee + +(** Bootstrap keys are already registered as delegate keys. *) +let bootstrap_manager_already_registered_delegate ~fee () = + Context.init1 () >>=? fun (b, bootstrap) -> + Incremental.begin_construction b >>=? fun i -> + Context.Contract.manager (I i) bootstrap >>=? fun manager -> + let pkh = manager.pkh in + let impl_contract = Contract.Implicit pkh in + Context.Contract.balance (I i) impl_contract >>=? fun balance -> + Op.delegation ~fee (I i) impl_contract (Some pkh) >>=? fun sec_reg -> + if fee > balance then expect_too_low_balance_error i sec_reg + else + Incremental.add_operation + ~expect_apply_failure:(function + | Environment.Ecoproto_error Delegate_storage.Contract.Active_delegate + :: _ -> + return_unit + | _ -> failwith "Delegate is already active and operation should fail.") + i + sec_reg + >>=? fun i -> + (* fee has been debited *) + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract balance fee + +(** Bootstrap manager can be set as delegate of an originated contract + (through origination operation). *) +let delegate_to_bootstrap_by_origination ~fee () = + Context.init1 () >>=? fun (b, bootstrap) -> + Incremental.begin_construction b >>=? fun i -> + Context.Contract.manager (I i) bootstrap >>=? fun manager -> + Context.Contract.balance (I i) bootstrap >>=? fun balance -> + (* originate a contract with bootstrap's manager as delegate *) + Op.contract_origination + ~fee + ~credit:Tez.zero + ~delegate:manager.pkh + (I i) + bootstrap + ~script:Op.dummy_script + >>=? fun (op, orig_contract) -> + Context.get_constants (I i) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + (* 0.257tz *) + cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> + fee +? origination_burn >>? ( +? ) Op.dummy_script_cost >>?= fun total_fee -> + if fee > balance then expect_too_low_balance_error i op + else if total_fee > balance && balance >= fee then + (* origination did not proceed; fee has been debited *) + let expect_apply_failure = function + | Environment.Ecoproto_error err :: _ -> + Assert.test_error_encodings err ; + let error_info = + Error_monad.find_info_of_error (Environment.wrap_tzerror err) + in + if String.equal error_info.title "Balance too low" then return_unit + else failwith "unexpected failure" + | _ -> + failwith + "Test_delegation.delegate_to_bootstrap_by_origination was expected \ + to fail but has not" + in + Incremental.add_operation i ~expect_apply_failure op >>=? fun i -> + (* fee was taken *) + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance fee + >>=? fun () -> + (* originated contract has not been created *) + Context.Contract.balance (I i) orig_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + else + (* bootstrap is delegate, fee + origination burn have been debited *) + Incremental.add_operation i op >>=? fun i -> + Context.Contract.delegate (I i) orig_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate manager.pkh >>=? fun () -> + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance total_fee + +let undelegated_originated_bootstrap_contract () = + Context.init1 + ~bootstrap_contracts: + [ + Parameters.{delegate = None; amount = Tez.zero; script = Op.dummy_script}; + ] + () + >>=? fun (b, _contract) -> + Block.bake b >>=? fun b -> + (* We know the address of the first originated bootstrap contract because we know the bootstrap origination nonce. This address corresponds to the first TF vesting contract on mainnnet. *) + Lwt.return @@ Environment.wrap_tzresult + @@ Alpha_context.Contract.of_b58check "KT1WPEis2WhAc2FciM2tZVn8qe6pCBe9HkDp" + >>=? fun originated_bootstrap0 -> + Context.Contract.delegate_opt (B b) originated_bootstrap0 + >>=? fun delegate0 -> + match delegate0 with + | None -> return_unit + | Some _ -> failwith "Bootstrap contract should be undelegated (%s)" __LOC__ + +let delegated_implicit_bootstrap_contract () = + Account.generate_accounts 2 >>?= fun accounts -> + let to_pkh, from_pkh = + match accounts with + | [account1; account2] -> (account1.pkh, account2.pkh) + | _ -> assert false + in + let bootstrap_delegations = [None; Some to_pkh] in + let bootstrap_accounts = + Account.make_bootstrap_accounts ~bootstrap_delegations accounts + in + Block.genesis bootstrap_accounts >>=? fun b -> + (Context.Contract.delegate_opt (B b) (Implicit from_pkh) >>=? function + | Some pkh when pkh = to_pkh -> return_unit + | Some _ | None -> + failwith "Bootstrap contract should be delegated (%s)." __LOC__) + >>=? fun () -> + (* Test delegation amount *) + Incremental.begin_construction b >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + Delegate.delegated_balance ctxt to_pkh >|= Environment.wrap_tzresult + >>=? fun amount -> + Assert.equal_tez ~loc:__LOC__ amount (Tez.of_mutez_exn 4_000_000_000_000L) + +let tests_bootstrap_contracts = + [ + Tztest.tztest + "bootstrap contracts delegate to themselves" + `Quick + bootstrap_manager_is_bootstrap_delegate; + Tztest.tztest + "bootstrap contracts can change their delegate (small fee)" + `Quick + (bootstrap_delegate_cannot_change ~fee:Tez.one_mutez); + Tztest.tztest + "bootstrap contracts can change their delegate (max fee)" + `Quick + (bootstrap_delegate_cannot_change ~fee:max_tez); + Tztest.tztest + "bootstrap contracts cannot remove their delegation (small fee)" + `Quick + (bootstrap_delegate_cannot_be_removed ~fee:Tez.one_mutez); + Tztest.tztest + "bootstrap contracts cannot remove their delegation (max fee)" + `Quick + (bootstrap_delegate_cannot_be_removed ~fee:max_tez); + Tztest.tztest + "contracts not registered as delegate can remove their delegation (small \ + fee)" + `Quick + (delegate_can_be_changed_from_unregistered_contract ~fee:Tez.one_mutez); + Tztest.tztest + "contracts not registered as delegate can remove their delegation (max \ + fee)" + `Quick + (delegate_can_be_changed_from_unregistered_contract ~fee:max_tez); + Tztest.tztest + "contracts not registered as delegate can remove their delegation (small \ + fee)" + `Quick + (delegate_can_be_removed_from_unregistered_contract ~fee:Tez.one_mutez); + Tztest.tztest + "contracts not registered as delegate can remove their delegation (max \ + fee)" + `Quick + (delegate_can_be_removed_from_unregistered_contract ~fee:max_tez); + Tztest.tztest + "bootstrap keys are already registered as delegate keys (small fee)" + `Quick + (bootstrap_manager_already_registered_delegate ~fee:Tez.one_mutez); + Tztest.tztest + "bootstrap keys are already registered as delegate keys (max fee)" + `Quick + (bootstrap_manager_already_registered_delegate ~fee:max_tez); + Tztest.tztest + "bootstrap manager can be delegate (init origination, small fee)" + `Quick + (delegate_to_bootstrap_by_origination ~fee:Tez.one_mutez); + (* balance enough for fee but not for fee + origination burn + dummy script storage cost *) + Tztest.tztest + "bootstrap manager can be delegate (init origination, edge case)" + `Quick + (delegate_to_bootstrap_by_origination + ~fee:(Tez.of_mutez_exn 3_999_999_705_000L)); + (* fee bigger than bootstrap's initial balance*) + Tztest.tztest + "bootstrap manager can be delegate (init origination, large fee)" + `Quick + (delegate_to_bootstrap_by_origination ~fee:(Test_tez.of_int 10_000_000)); + Tztest.tztest + "originated bootstrap contract can be undelegated" + `Quick + undelegated_originated_bootstrap_contract; + Tztest.tztest + "originated bootstrap contract can be delegated" + `Quick + delegated_implicit_bootstrap_contract; + ] + +(*****************************************************************************) +(* Delegate registration + --------------------- + A delegate is a pkh. Delegates must be registered. Registration is + done via the self-delegation of the implicit contract corresponding + to the pkh. The implicit contract must be credited when the + self-delegation is done. Furthermore, trying to register an already + registered key raises an error. + + In this series of tests, we verify that + 1- unregistered delegate keys cannot be delegated to, + 2- registered keys can be delegated to, + 3- registering an already registered key raises an error. + + We consider three scenarios for setting a delegate: + - through origination, + - through delegation when the implicit contract has no delegate yet, + - through delegation when the implicit contract already has a delegate. + + We also test that emptying the implicit contract linked to a + registered delegate key does not unregister the delegate key. + + Valid registration + ------------------ + Unregistered key: + - contract not credited and no self-delegation, + - contract credited but no self-delegation, + - contract not credited and self-delegation. + + Not credited: + - no credit operation + - credit operation of 1μꜩ and then debit operation of 1μꜩ *) +(*****************************************************************************) + +(* Part A. + Unregistered delegate keys cannot be used for delegation + + Two main series of tests: without self-delegation and with a failed attempt at self-delegation: + + 1/ no self-delegation + a/ no credit + - no token transfer + - credit of 1μꜩ and then debit of 1μꜩ + b/ with credit of 1μꜩ. + For every scenario, we try three different ways of delegating: + - through origination (init origination) + - through delegation when no delegate was assigned (init delegation) + - through delegation when a delegate was assigned (switch delegation). + + 2/ Self-delegation fails if the contract has no credit. We try the + two possibilities of 1a for non-credited contracts. *) + +let expect_unregistered_key pkh = function + | Environment.Ecoproto_error (Delegate_storage.Unregistered_delegate pkh0) + :: _ + when pkh = pkh0 -> + return_unit + | _ -> failwith "Delegate key is not registered: operation should fail." + +(* Part A. Section 1. + No self-delegation. *) + +(** No token transfer, no self-delegation. Originated account. If + fees are higher than balance, [Balance_too_low] is + raised. Otherwise, it checks the correct exception is raised + (unregistered key), and the fees are still debited. Using RPCs, we + verify the contract has not been originated. *) +let test_unregistered_delegate_key_init_origination ~fee () = + Context.init1 () >>=? fun (b, bootstrap) -> + Incremental.begin_construction b >>=? fun i -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + (* origination with delegate argument *) + Op.contract_origination + ~fee + ~delegate:unregistered_pkh + (I i) + bootstrap + ~script:Op.dummy_script + >>=? fun (op, orig_contract) -> + Context.get_constants (I i) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> + fee +? origination_burn >>?= fun (_total_fee : Tez.t) -> + (* FIXME unused variable *) + Context.Contract.balance (I i) bootstrap >>=? fun balance -> + if fee > balance then expect_too_low_balance_error i op + else + (* origination did not proceed; fee has been debited *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_pkh) + i + op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance fee + >>=? fun () -> + (* originated contract has not been created *) + Context.Contract.balance (I i) orig_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Delegation when delegate key is not assigned. Delegate account is + initialized. If fees are higher than initial credit (10 tez), + [Balance_too_low] is raised. Otherwise, fees are still debited. The + implicit contract has no delegate. *) +let test_unregistered_delegate_key_init_delegation ~fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* initial credit for the delegated contract *) + let credit = of_int 10 in + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + credit + >>=? fun credit_contract -> + Block.bake b ~operation:credit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> + (* try to delegate *) + Op.delegation + ~force_reveal:true + ~fee + (B b) + impl_contract + (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been debited; no delegate *) + Incremental.add_operation + i + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract credit fee + >>=? fun () -> + (* implicit contract has no delegate *) + Context.Contract.delegate (I i) impl_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Re-delegation when a delegate key was already assigned. If fees + are higher than initial credit (10 tez), [Balance_too_low] is + raised. Otherwise, fees are not debited and the implicit contract + delegate remains unchanged. *) +let test_unregistered_delegate_key_switch_delegation ~fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let bootstrap_pkh = Context.Contract.pkh bootstrap in + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* initial credit for the delegated contract *) + let credit = of_int 10 in + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + credit + >>=? fun init_credit -> + Block.bake b ~operation:init_credit >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> + (* set and check the initial delegate *) + Op.delegation + ~force_reveal:true + ~fee:Tez.zero + (B b) + impl_contract + (Some bootstrap_pkh) + >>=? fun delegate_op -> + Block.bake b ~operation:delegate_op >>=? fun b -> + Context.Contract.delegate (B b) bootstrap >>=? fun delegate_pkh -> + Assert.equal_pkh ~loc:__LOC__ bootstrap_pkh delegate_pkh >>=? fun () -> + (* try to delegate *) + Op.delegation ~fee (B b) impl_contract (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been debited; no delegate *) + Incremental.add_operation + i + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract credit fee + >>=? fun () -> + (* implicit contract delegate has not changed *) + Context.Contract.delegate (I i) bootstrap >>=? fun delegate_pkh_after -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate_pkh_after + +(** Same as [unregistered_delegate_key_init_origination] and credits + [amount], no self-delegation. *) +let test_unregistered_delegate_key_init_origination_credit ~fee ~amount () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + (* credit + check balance *) + Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake b ~operation:create_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* origination with delegate argument *) + Context.Contract.balance (B b) bootstrap >>=? fun balance -> + Op.contract_origination + ~fee + ~delegate:unregistered_pkh + (B b) + bootstrap + ~script:Op.dummy_script + >>=? fun (op, orig_contract) -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i op + else + (* origination not done, fee taken *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_pkh) + i + op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance fee + >>=? fun () -> + Context.Contract.balance (I i) orig_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Same as [unregistered_delegate_key_init_delegation] and credits + the amount [amount] of the implicit contract. *) +let test_unregistered_delegate_key_init_delegation_credit ~fee ~amount () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* credit + check balance *) + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* initial credit for the delegated contract *) + let credit = of_int 10 in + credit +? amount >>?= fun balance -> + Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit + >>=? fun init_credit -> + Block.bake ~operation:init_credit b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun () -> + (* try to delegate *) + Op.delegation + ~force_reveal:true + ~fee + (B b) + impl_contract + (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been taken, no delegate for contract *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + i + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract balance fee + >>=? fun () -> + Context.Contract.delegate (I i) impl_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Same as in [unregistered_delegate_key_switch_delegation] and + credits the amount [amount] to the implicit contract. *) +let test_unregistered_delegate_key_switch_delegation_credit ~fee ~amount () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let bootstrap_pkh = Context.Contract.pkh bootstrap in + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* credit + check balance *) + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* initial credit for the delegated contract *) + let credit = of_int 10 in + credit +? amount >>?= fun balance -> + Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit + >>=? fun init_credit -> + Block.bake ~operation:init_credit b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun () -> + (* set and check the initial delegate *) + Op.delegation + ~force_reveal:true + ~fee:Tez.zero + (B b) + impl_contract + (Some bootstrap_pkh) + >>=? fun delegate_op -> + Block.bake ~operation:delegate_op b >>=? fun b -> + Context.Contract.delegate (B b) bootstrap >>=? fun delegate_pkh -> + Assert.equal_pkh ~loc:__LOC__ bootstrap_pkh delegate_pkh >>=? fun () -> + (* switch delegate through delegation *) + Op.delegation ~fee (B b) impl_contract (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been taken, delegate for contract has not changed *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + i + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract balance fee + >>=? fun () -> + Context.Contract.delegate (I i) impl_contract >>=? fun delegate -> + Assert.not_equal_pkh ~loc:__LOC__ delegate unregistered_delegate_pkh + >>=? fun () -> Assert.equal_pkh ~loc:__LOC__ delegate bootstrap_pkh + +(** A credit of some amount followed by a debit of the same amount, + no self-delegation. *) +let test_unregistered_delegate_key_init_origination_credit_debit ~fee ~amount () + = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + (* credit + check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake b ~operation:create_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* debit + check balance *) + Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount + >>=? fun debit_contract -> + Block.bake b ~operation:debit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* origination with delegate argument *) + Context.Contract.balance (B b) bootstrap >>=? fun balance -> + Op.contract_origination + ~fee + ~delegate:unregistered_pkh + (B b) + bootstrap + ~script:Op.dummy_script + >>=? fun (op, orig_contract) -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i op + else + (* fee taken, origination not processed *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_pkh) + i + op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) bootstrap balance fee + >>=? fun () -> + Context.Contract.balance (I i) orig_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Same as in [unregistered_delegate_key_init_delegation] but credits + then debits the amount [amount] to the implicit contract. *) +let test_unregistered_delegate_key_init_delegation_credit_debit ~amount ~fee () + = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* credit + check balance *) + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + amount + >>=? fun create_contract -> + Block.bake b ~operation:create_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* debit + check balance *) + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + impl_contract + bootstrap + amount + >>=? fun debit_contract -> + Block.bake b ~operation:debit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* initial credit for the delegated contract *) + let credit = of_int 10 in + Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit + >>=? fun credit_contract -> + Block.bake b ~operation:credit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> + (* try to delegate *) + Op.delegation + ~force_reveal:true + ~fee + (B b) + impl_contract + (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been taken, no delegate for contract *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + i + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract credit fee + >>=? fun () -> + Context.Contract.delegate (I i) impl_contract >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + +(** Same as in [unregistered_delegate_key_switch_delegation] but + credits then debits the amount [amount] to the implicit contract. *) +let test_unregistered_delegate_key_switch_delegation_credit_debit ~fee ~amount + () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let bootstrap_pkh = Context.Contract.pkh bootstrap in + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + let unregistered_delegate_account = Account.new_account () in + let unregistered_delegate_pkh = Account.(unregistered_delegate_account.pkh) in + (* credit + check balance *) + Op.transaction + ~force_reveal:true + ~fee:Tez.zero + (B b) + bootstrap + impl_contract + amount + >>=? fun create_contract -> + Block.bake b ~operation:create_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* debit + check balance *) + Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount + >>=? fun debit_contract -> + Block.bake b ~operation:debit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* delegation - initial credit for the delegated contract *) + let credit = of_int 10 in + Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit + >>=? fun credit_contract -> + Block.bake b ~operation:credit_contract >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> + (* set and check the initial delegate *) + Op.delegation + ~force_reveal:true + ~fee:Tez.zero + (B b) + impl_contract + (Some bootstrap_pkh) + >>=? fun delegate_op -> + Block.bake b ~operation:delegate_op >>=? fun b -> + Context.Contract.delegate (B b) bootstrap >>=? fun delegate_pkh -> + Assert.equal_pkh ~loc:__LOC__ bootstrap_pkh delegate_pkh >>=? fun () -> + (* switch delegate through delegation *) + Op.delegation (B b) ~fee impl_contract (Some unregistered_delegate_pkh) + >>=? fun delegate_op -> + Incremental.begin_construction b >>=? fun i -> + if fee > credit then expect_too_low_balance_error i delegate_op + else + (* fee has been taken, delegate for contract has not changed *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key unregistered_delegate_pkh) + i + delegate_op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) impl_contract credit fee + >>=? fun () -> + Context.Contract.delegate (I i) impl_contract >>=? fun delegate -> + Assert.not_equal_pkh ~loc:__LOC__ delegate unregistered_delegate_pkh + +(* Part A. Section 2. + Self-delegation to an empty contract fails. *) + +(** Self-delegation with zero-balance contract should fail. *) +let test_failed_self_delegation_no_transaction () = + Context.init1 () >>=? fun (b, _contract) -> + Incremental.begin_construction b >>=? fun i -> + let account = Account.new_account () in + let unregistered_pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + (* check balance *) + Context.Contract.balance (I i) impl_contract >>=? fun balance -> + Assert.equal_tez ~loc:__LOC__ Tez.zero balance >>=? fun () -> + (* self delegation fails *) + Op.delegation (I i) impl_contract (Some unregistered_pkh) + >>=? fun self_delegation -> + Incremental.add_operation i self_delegation >>= fun err -> + Assert.proto_error_with_info ~loc:__LOC__ err "Empty implicit contract" + +(** Implicit contract is credited then debited of same amount (i.e., + is emptied). Self-delegation fails. *) +let test_failed_self_delegation_emptied_implicit_contract amount () = + (* create an implicit contract *) + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let account = Account.new_account () in + let unregistered_pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + (* credit implicit contract and check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* empty implicit contract and check balance *) + Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* self delegation fails *) + Op.delegation (B b) impl_contract (Some unregistered_pkh) + >>=? fun self_delegation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i self_delegation >>= fun err -> + Assert.proto_error_with_info ~loc:__LOC__ err "Empty implicit contract" + +(** Implicit contract is credited with a non-zero quantity [amount] + tz, then it is delegated. The operation of debit of [amount] tz + should fail as the contract is already delegated. *) +let test_emptying_delegated_implicit_contract_fails amount () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + Context.Contract.manager (B b) bootstrap >>=? fun bootstrap_manager -> + let account = Account.new_account () in + let unregistered_pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit unregistered_pkh in + (* credit unregistered implicit contract and check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* delegate the contract to the bootstrap *) + Op.delegation + ~force_reveal:true + (B b) + impl_contract + (Some bootstrap_manager.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* empty implicit contract and expect error since the contract is delegated *) + Op.transaction (B b) impl_contract bootstrap amount + >>=? fun create_contract -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i create_contract >>= fun err -> + Assert.proto_error_with_info + ~loc:__LOC__ + err + "Empty implicit delegated contract" + +(* Part B. + - Valid registration: + - Credit implicit contract with some ꜩ + verification of balance + - Self delegation + verification + - Empty contract + verification of balance + verification of not being erased / self-delegation + - Create delegator implicit contract w first implicit contract as delegate + verification of delegation. *) + +(** Initialized account is credited of [amount] tz, then + self-delegated. *) +let test_valid_delegate_registration_init_delegation_credit amount () = + (* create an implicit contract *) + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let delegate_account = Account.new_account () in + let delegate_pkh = Account.(delegate_account.pkh) in + let impl_contract = Contract.Implicit delegate_pkh in + (* credit > 0ꜩ + check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* self delegation + verification *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun () -> + (* create an implicit contract with no delegate *) + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let delegator = Contract.Implicit unregistered_pkh in + Op.transaction ~fee:Tez.zero (B b) bootstrap delegator Tez.one + >>=? fun credit_contract -> + Block.bake ~operation:credit_contract b >>=? fun b -> + (* check no delegate for delegator contract *) + Context.Contract.delegate (B b) delegator >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + >>=? fun () -> + (* delegation to the newly registered key *) + Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* check delegation *) + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate delegate_pkh + +(** Create an implicit contract, credits with [amount] + tz. Self-delegates. Create another implicit contract with + bootstrap as delegate. Re-delegate it to the first implicit + contract. *) +let test_valid_delegate_registration_switch_delegation_credit amount () = + (* create an implicit contract *) + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let delegate_account = Account.new_account () in + let delegate_pkh = Account.(delegate_account.pkh) in + let impl_contract = Contract.Implicit delegate_pkh in + (* credit > 0ꜩ + check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* self delegation + verification *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun () -> + (* create an implicit contract with bootstrap's account as delegate *) + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let delegator = Contract.Implicit unregistered_pkh in + Op.transaction ~fee:Tez.zero (B b) bootstrap delegator Tez.one + >>=? fun credit_contract -> + Block.bake ~operation:credit_contract b >>=? fun b -> + Context.Contract.manager (B b) bootstrap >>=? fun bootstrap_manager -> + Op.delegation ~force_reveal:true (B b) delegator (Some bootstrap_manager.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* test delegate of new contract is bootstrap *) + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate bootstrap_manager.pkh + >>=? fun () -> + (* delegation with newly registered key *) + Op.delegation (B b) delegator (Some delegate_account.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate delegate_pkh + +(** Create an implicit contract. *) +let test_valid_delegate_registration_init_delegation_credit_debit amount () = + (* create an implicit contract *) + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let delegate_account = Account.new_account () in + let delegate_pkh = Account.(delegate_account.pkh) in + let impl_contract = Contract.Implicit delegate_pkh in + (* credit > 0ꜩ+ check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* self delegation + verification *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> + (* empty implicit contracts are usually deleted but they are kept if + they were registered as delegates. we empty the contract in + order to verify this. *) + Op.transaction (B b) impl_contract bootstrap amount >>=? fun empty_contract -> + Block.bake ~operation:empty_contract b >>=? fun b -> + (* impl_contract is empty *) + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* verify self-delegation after contract is emptied *) + Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> + (* create an implicit contract with no delegate *) + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let delegator = Contract.Implicit unregistered_pkh in + Op.transaction ~fee:Tez.zero (B b) bootstrap delegator Tez.one + >>=? fun credit_contract -> + Block.bake ~operation:credit_contract b >>=? fun b -> + (* check no delegate for delegator contract *) + Context.Contract.delegate (B b) delegator >>= fun err -> + Assert.error ~loc:__LOC__ err (function + | Tezos_rpc.Context.Not_found _ -> true + | _ -> false) + >>=? fun () -> + (* delegation to the newly registered key *) + Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* check delegation *) + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate delegate_pkh + +(** A created implicit contract is credited with [amount] tz, then is + self-delegated. It is emptied (fund back into bootstrap), and + should remain existing (as registered as delegate). Another created + implicit contract is delegated to bootstrap, then should be able to + be re-delegated to the latter contract. *) +let test_valid_delegate_registration_switch_delegation_credit_debit amount () = + (* create an implicit contract *) + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let delegate_account = Account.new_account () in + let delegate_pkh = Account.(delegate_account.pkh) in + let impl_contract = Contract.Implicit delegate_pkh in + (* credit > 0ꜩ + check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> + (* self delegation + verification *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> + (* empty implicit contracts are usually deleted but they are kept if + they were registered as delegates. we empty the contract in + order to verify this. *) + Op.transaction (B b) impl_contract bootstrap amount >>=? fun empty_contract -> + Block.bake ~operation:empty_contract b >>=? fun b -> + (* impl_contract is empty *) + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* create an implicit contract with bootstrap's account as delegate *) + let unregistered_account = Account.new_account () in + let unregistered_pkh = Account.(unregistered_account.pkh) in + let delegator = Contract.Implicit unregistered_pkh in + Op.transaction ~fee:Tez.zero (B b) bootstrap delegator Tez.one + >>=? fun credit_contract -> + Block.bake ~operation:credit_contract b >>=? fun b -> + Context.Contract.manager (B b) bootstrap >>=? fun bootstrap_manager -> + Op.delegation ~force_reveal:true (B b) delegator (Some bootstrap_manager.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* test delegate of new contract is bootstrap *) + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate bootstrap_manager.pkh + >>=? fun () -> + (* delegation with newly registered key *) + Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> + Assert.equal_pkh ~loc:__LOC__ delegator_delegate delegate_pkh + +(* Part C. + A second self-delegation should raise an [Active_delegate] error. *) + +(** Second self-delegation should fail with implicit contract with + some credit. *) +let test_double_registration () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let account = Account.new_account () in + let pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit pkh in + (* credit 1μꜩ+ check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> + (* self-delegation *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + (* second self-delegation *) + Op.delegation (B b) impl_contract (Some pkh) >>=? fun second_registration -> + Incremental.begin_construction b >>=? fun i -> + expect_delegate_already_active_error i second_registration + +(** Second self-delegation should fail with implicit contract emptied + after first self-delegation. *) +let test_double_registration_when_empty () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let account = Account.new_account () in + let pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit pkh in + (* credit 1μꜩ+ check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> + (* self delegation *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + (* empty the delegate account *) + Op.transaction (B b) impl_contract bootstrap Tez.one_mutez + >>=? fun empty_contract -> + Block.bake ~operation:empty_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* second self-delegation *) + Op.delegation (B b) impl_contract (Some pkh) >>=? fun second_registration -> + Incremental.begin_construction b >>=? fun i -> + expect_delegate_already_active_error i second_registration + +(** Second self-delegation should fail with implicit contract emptied + then credited back after first self-delegation. *) +let test_double_registration_when_recredited () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let account = Account.new_account () in + let pkh = Account.(account.pkh) in + let impl_contract = Contract.Implicit pkh in + (* credit 1μꜩ+ check balance *) + Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> + (* self delegation *) + Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) + >>=? fun self_delegation -> + Block.bake ~operation:self_delegation b >>=? fun b -> + (* empty the delegate account *) + Op.transaction ~force_reveal:true (B b) impl_contract bootstrap Tez.one_mutez + >>=? fun empty_contract -> + Block.bake ~operation:empty_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> + (* credit 1μꜩ+ check balance *) + Op.transaction (B b) bootstrap impl_contract Tez.one_mutez + >>=? fun create_contract -> + Block.bake ~operation:create_contract b >>=? fun b -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> + (* second self-delegation *) + Op.delegation (B b) impl_contract (Some pkh) >>=? fun second_registration -> + Incremental.begin_construction b >>=? fun i -> + expect_delegate_already_active_error i second_registration + +(** Self-delegation on unrevealed contract. *) +let test_unregistered_and_unrevealed_self_delegate_key_init_delegation ~fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let {Account.pkh; _} = Account.new_account () in + let {Account.pkh = delegate_pkh; _} = Account.new_account () in + let contract = Alpha_context.Contract.Implicit pkh in + Op.transaction ~force_reveal:true (B b) bootstrap contract (of_int 10) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.delegation ~fee ~force_reveal:true (B b) contract (Some delegate_pkh) + >>=? fun op -> + Context.Contract.balance (B b) contract >>=? fun balance -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i op + else + (* origination did not proceed; fee has been debited *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key delegate_pkh) + i + op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) contract balance fee + +(** Self-delegation on revealed but not registered contract. *) +let test_unregistered_and_revealed_self_delegate_key_init_delegation ~fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let {Account.pkh; pk; _} = Account.new_account () in + let {Account.pkh = delegate_pkh; _} = Account.new_account () in + let contract = Alpha_context.Contract.Implicit pkh in + Op.transaction (B b) bootstrap contract (of_int 10) >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.revelation (B b) pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.delegation ~fee (B b) contract (Some delegate_pkh) >>=? fun op -> + Context.Contract.balance (B b) contract >>=? fun balance -> + Incremental.begin_construction b >>=? fun i -> + if fee > balance then expect_too_low_balance_error i op + else + (* origination did not proceed; fee has been debited *) + Incremental.add_operation + ~expect_apply_failure:(expect_unregistered_key delegate_pkh) + i + op + >>=? fun i -> + Assert.balance_was_debited ~loc:__LOC__ (I i) contract balance fee + +(** Self-delegation emptying a fresh contract. *) +let test_self_delegation_emptying_contract () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let {Account.pkh; pk; _} = Account.new_account () in + let {Account.pkh = delegate_pkh; _} = Account.new_account () in + let contract = Alpha_context.Contract.Implicit pkh in + let amount = of_int 10 in + Op.transaction (B b) bootstrap contract amount >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.revelation ~fee:Tez.zero (B b) pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.delegation ~fee:amount (B b) contract (Some delegate_pkh) >>=? fun op -> + (Context.Contract.is_manager_key_revealed (B b) contract >>=? function + | false -> failwith "contract should exist" + | true -> return_unit) + >>=? fun () -> + Incremental.begin_construction b >>=? fun i -> + (* The delegation operation should be applied and the fees + debited but it is expected to fail in the apply-part. *) + Incremental.add_operation ~expect_apply_failure:(fun _ -> return_unit) i op + >>=? fun i -> + Context.Contract.is_manager_key_revealed (I i) contract >>=? function + | false -> return_unit + | true -> failwith "contract should have been removed" + +(** Self-delegation on revealed and registered contract. *) +let test_registered_self_delegate_key_init_delegation () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let {Account.pkh; _} = Account.new_account () in + let {Account.pkh = delegate_pkh; pk = delegate_pk; _} = + Account.new_account () + in + let contract = Alpha_context.Contract.Implicit pkh in + let delegate_contract = Alpha_context.Contract.Implicit delegate_pkh in + Op.transaction ~force_reveal:true (B b) bootstrap contract (of_int 10) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.transaction (B b) bootstrap delegate_contract (of_int 1) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.revelation (B b) delegate_pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.delegation (B b) delegate_contract (Some delegate_pkh) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.delegation ~force_reveal:true (B b) contract (Some delegate_pkh) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Context.Contract.delegate (B b) contract >>=? fun delegate -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun () -> return_unit + +let test_bls_account_cannot_self_delegate () = + let open Lwt_result_syntax in + let* b, bootstrap = Context.init1 ~consensus_threshold:0 () in + let {Account.pkh = tz4_pkh; pk = tz4_pk; _} = + Account.new_account ~algo:Bls () + in + let tz4_contract = Alpha_context.Contract.Implicit tz4_pkh in + let* operation = + Op.transaction + ~force_reveal:true + (B b) + bootstrap + tz4_contract + (of_int 200_000) + in + let* b = Block.bake ~operation b in + let* operation = Op.revelation (B b) tz4_pk in + let* b = Block.bake ~operation b in + let* operation = Op.delegation (B b) tz4_contract (Some tz4_pkh) in + let* inc = Incremental.begin_construction b in + let tz4_pkh = match tz4_pkh with Bls pkh -> pkh | _ -> assert false in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Contract_delegate_storage.Forbidden_tz4_delegate pkh); + ] + when Tezos_crypto.Bls.Public_key_hash.(pkh = tz4_pkh) -> + return_unit + | err -> + failwith + "Error trace:@,\ + %a does not match the \ + [Contract_delegate_storage.Forbidden_tz4_delegate] error" + Error_monad.pp_print_trace + err + in + let* (_i : Incremental.t) = + Incremental.validate_operation ~expect_failure inc operation + in + return_unit + +let tests_delegate_registration = + [ + Tztest.tztest "TEST" `Quick test_bls_account_cannot_self_delegate; + (*** unregistered delegate key: no self-delegation ***) + (* no token transfer, no self-delegation *) + Tztest.tztest + "unregistered delegate key (origination, small fee)" + `Quick + (test_unregistered_delegate_key_init_origination ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key (origination, edge case fee)" + `Quick + (test_unregistered_delegate_key_init_origination ~fee:(of_int 3_999_488)); + Tztest.tztest + "unregistered delegate key (origination, large fee)" + `Quick + (test_unregistered_delegate_key_init_origination ~fee:(of_int 10_000_000)); + Tztest.tztest + "unregistered delegate key (init with delegation, small fee)" + `Quick + (test_unregistered_delegate_key_init_delegation ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key (init with delegation, max fee)" + `Quick + (test_unregistered_delegate_key_init_delegation ~fee:max_tez); + Tztest.tztest + "unregistered delegate key (switch with delegation, small fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key (switch with delegation, max fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation ~fee:max_tez); + (* credit/debit 1μꜩ, no self-delegation *) + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (origination, small fee)" + `Quick + (test_unregistered_delegate_key_init_origination_credit_debit + ~fee:Tez.one_mutez + ~amount:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (origination, large fee)" + `Quick + (test_unregistered_delegate_key_init_origination_credit_debit + ~fee:max_tez + ~amount:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (init with delegation, \ + small fee)" + `Quick + (test_unregistered_delegate_key_init_delegation_credit_debit + ~amount:Tez.one_mutez + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (init with delegation, \ + large fee)" + `Quick + (test_unregistered_delegate_key_init_delegation_credit_debit + ~amount:Tez.one_mutez + ~fee:max_tez); + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (switch with delegation, \ + small fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation_credit_debit + ~amount:Tez.one_mutez + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit/debit 1μꜩ (switch with delegation, \ + large fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation_credit_debit + ~amount:Tez.one_mutez + ~fee:max_tez); + (* credit 1μꜩ, no self-delegation *) + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (origination, small fee)" + `Quick + (test_unregistered_delegate_key_init_origination_credit + ~fee:Tez.one_mutez + ~amount:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (origination, edge case fee)" + `Quick + (test_unregistered_delegate_key_init_origination_credit + ~fee:(of_int 3_999_488) + ~amount:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (origination, large fee)" + `Quick + (test_unregistered_delegate_key_init_origination_credit + ~fee:(of_int 10_000_000) + ~amount:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (init with delegation, small fee)" + `Quick + (test_unregistered_delegate_key_init_delegation_credit + ~amount:Tez.one_mutez + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (init with delegation, large fee)" + `Quick + (test_unregistered_delegate_key_init_delegation_credit + ~amount:Tez.one_mutez + ~fee:max_tez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (switch with delegation, small \ + fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation_credit + ~amount:Tez.one_mutez + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered delegate key - credit 1μꜩ (switch with delegation, large \ + fee)" + `Quick + (test_unregistered_delegate_key_switch_delegation_credit + ~amount:Tez.one_mutez + ~fee:max_tez); + (* self delegation on unrevealed and unregistered contract *) + Tztest.tztest + "unregistered and unrevealed self-delegation (small fee)" + `Quick + (test_unregistered_and_unrevealed_self_delegate_key_init_delegation + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered and unrevealed self-delegation (large fee)" + `Quick + (test_unregistered_and_unrevealed_self_delegate_key_init_delegation + ~fee:max_tez); + (* self delegation on unregistered contract *) + Tztest.tztest + "unregistered and revealed self-delegation (small fee)" + `Quick + (test_unregistered_and_revealed_self_delegate_key_init_delegation + ~fee:Tez.one_mutez); + Tztest.tztest + "unregistered and revealed self-delegation large fee)" + `Quick + (test_unregistered_and_revealed_self_delegate_key_init_delegation + ~fee:max_tez); + Tztest.tztest + "unregistered and revealed self-delegation (fee = balance)" + `Quick + test_self_delegation_emptying_contract; + (* self delegation on registered contract *) + Tztest.tztest + "registered and revealed self-delegation" + `Quick + test_registered_self_delegate_key_init_delegation; + (*** unregistered delegate key: failed self-delegation ***) + (* no token transfer, self-delegation *) + Tztest.tztest + "failed self-delegation: no transaction" + `Quick + test_failed_self_delegation_no_transaction; + (* credit 1μtz, debit 1μtz, self-delegation *) + Tztest.tztest + "failed self-delegation: credit & debit 1μꜩ" + `Quick + (test_failed_self_delegation_emptied_implicit_contract Tez.one_mutez); + (* credit 1μtz, delegate, debit 1μtz *) + Tztest.tztest + "empty delegated contract is not deleted: credit 1μꜩ, delegate & debit \ + 1μꜩ" + `Quick + (test_emptying_delegated_implicit_contract_fails Tez.one_mutez); + (*** valid registration ***) + (* valid registration: credit 1 μꜩ, self delegation *) + Tztest.tztest + "valid delegate registration: credit 1μꜩ, self delegation (init with \ + delegation)" + `Quick + (test_valid_delegate_registration_init_delegation_credit Tez.one_mutez); + Tztest.tztest + "valid delegate registration: credit 1μꜩ, self delegation (switch with \ + delegation)" + `Quick + (test_valid_delegate_registration_switch_delegation_credit Tez.one_mutez); + (* valid registration: credit 1 μꜩ, self delegation, debit 1μꜩ *) + Tztest.tztest + "valid delegate registration: credit 1μꜩ, self delegation, debit 1μꜩ \ + (init with delegation)" + `Quick + (test_valid_delegate_registration_init_delegation_credit_debit + Tez.one_mutez); + Tztest.tztest + "valid delegate registration: credit 1μꜩ, self delegation, debit 1μꜩ \ + (switch with delegation)" + `Quick + (test_valid_delegate_registration_switch_delegation_credit_debit + Tez.one_mutez); + (*** double registration ***) + Tztest.tztest "double registration" `Quick test_double_registration; + Tztest.tztest + "double registration when delegate account is emptied" + `Quick + test_double_registration_when_empty; + Tztest.tztest + "double registration when delegate account is emptied and then recredited" + `Quick + test_double_registration_when_recredited; + ] + +(******************************************************************************) +(* Main *) +(******************************************************************************) + +let tests = tests_bootstrap_contracts @ tests_delegate_registration diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml new file mode 100644 index 000000000000..5b5ce979ae4d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -0,0 +1,465 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (double baking) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^double baking$" + Subject: A double baking evidence operation may be injected when it has + been observed that a baker baked two different blocks at the + same level and same round. +*) + +open Protocol +open Alpha_context + +(****************************************************************) +(* Utility functions *) +(****************************************************************) + +(** Bake two block at the same level using the same policy (i.e. same + baker). *) +let block_fork ?policy (contract_a, contract_b) b = + Op.transaction (B b) contract_a contract_b Alpha_context.Tez.one_cent + >>=? fun operation -> + Block.bake ?policy ~operation b >>=? fun blk_a -> + Block.bake ?policy b >|=? fun blk_b -> (blk_a, blk_b) + +let order_block_hashes ~correct_order bh1 bh2 = + let hash1 = Block_header.hash bh1 in + let hash2 = Block_header.hash bh2 in + let c = Tezos_crypto.Block_hash.compare hash1 hash2 in + if correct_order then if c < 0 then (bh1, bh2) else (bh2, bh1) + else if c < 0 then (bh2, bh1) + else (bh1, bh2) + +let double_baking ctxt ?(correct_order = true) bh1 bh2 = + let bh1, bh2 = order_block_hashes ~correct_order bh1 bh2 in + Op.double_baking ctxt bh1 bh2 + +(****************************************************************) +(* Tests *) +(****************************************************************) + +(** Simple scenario where two blocks are baked by a same baker and + exposed by a double baking evidence operation. *) +let test_valid_double_baking_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> + Context.get_constants (B genesis) + >>=? fun Constants.{parametric = {double_baking_punishment; _}; _} -> + Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> + block_fork ~policy:(By_account baker1) contracts genesis + >>=? fun (blk_a, blk_b) -> + double_baking (B blk_a) blk_a.header blk_b.header |> fun operation -> + Block.bake ~policy:(By_account baker2) ~operation blk_a >>=? fun blk_final -> + (* Check that the frozen deposits are slashed *) + Context.Delegate.current_frozen_deposits (B blk_a) baker1 + >>=? fun frozen_deposits_before -> + Context.Delegate.current_frozen_deposits (B blk_final) baker1 + >>=? fun frozen_deposits_after -> + let slashed_amount = + Test_tez.(frozen_deposits_before -! frozen_deposits_after) + in + Assert.equal_tez ~loc:__LOC__ slashed_amount double_baking_punishment + >>=? fun () -> + (* Check that the initial frozen deposits has not changed *) + Context.Delegate.initial_frozen_deposits (B blk_final) baker1 + >>=? fun initial_frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ initial_frozen_deposits frozen_deposits_before + +(* auxiliary function used in [double_endorsement] *) +let order_endorsements ~correct_order op1 op2 = + let oph1 = Operation.hash op1 in + let oph2 = Operation.hash op2 in + let c = Tezos_crypto.Operation_hash.compare oph1 oph2 in + if correct_order then if c < 0 then (op1, op2) else (op2, op1) + else if c < 0 then (op2, op1) + else (op1, op2) + +(* auxiliary function used in + [test_valid_double_baking_followed_by_double_endorsing] and + [test_valid_double_endorsing_followed_by_double_baking] *) +let double_endorsement ctxt ?(correct_order = true) op1 op2 = + let e1, e2 = order_endorsements ~correct_order op1 op2 in + Op.double_endorsement ctxt e1 e2 + +let test_valid_double_baking_followed_by_double_endorsing () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> + Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> + Block.bake genesis >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) baker1 + >>=? fun frozen_deposits_before -> + block_fork ~policy:(By_account baker1) contracts b >>=? fun (blk_a, blk_b) -> + double_baking (B blk_a) blk_a.header blk_b.header |> fun operation -> + Block.bake ~policy:(By_account baker2) ~operation blk_a + >>=? fun blk_with_db_evidence -> + Context.get_first_different_endorsers (B blk_a) >>=? fun (e1, e2) -> + let delegate = + if Tezos_crypto.Signature.Public_key_hash.( = ) e1.delegate baker1 then + e1.delegate + else e2.delegate + in + Op.raw_endorsement ~delegate blk_a >>=? fun endorsement_a -> + Op.raw_endorsement ~delegate blk_b >>=? fun endorsement_b -> + let operation = double_endorsement (B genesis) endorsement_a endorsement_b in + Block.bake ~policy:(By_account baker1) ~operation blk_with_db_evidence + >>=? fun blk_final -> + Context.Delegate.current_frozen_deposits (B blk_final) baker1 + >>=? fun frozen_deposits_after -> + Context.get_constants (B genesis) >>=? fun csts -> + let r = + csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + in + let expected_frozen_deposits_after_de = + Test_tez.( + frozen_deposits_before + *! Int64.of_int (r.denominator - r.numerator) + /! Int64.of_int r.denominator) + in + (* the deposit after double baking and double endorsing equals the + expected deposit after double endorsing minus the double baking + punishment *) + Assert.equal_tez + ~loc:__LOC__ + Test_tez.( + expected_frozen_deposits_after_de + -! csts.parametric.double_baking_punishment) + frozen_deposits_after + +(* auxiliary function used in [test_valid_double_endorsing_followed_by_double_baking] *) +let block_fork_diff b = + Context.get_first_different_bakers (B b) >>=? fun (baker_1, baker_2) -> + Block.bake ~policy:(By_account baker_1) b >>=? fun blk_a -> + Block.bake ~policy:(By_account baker_2) b >|=? fun blk_b -> (blk_a, blk_b) + +let test_valid_double_endorsing_followed_by_double_baking () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> + Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> + block_fork_diff genesis >>=? fun (blk_1, blk_2) -> + Context.Delegate.current_frozen_deposits (B genesis) baker1 + >>=? fun frozen_deposits_before -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_first_different_endorsers (B blk_a) >>=? fun (e1, e2) -> + let delegate = + if Tezos_crypto.Signature.Public_key_hash.( = ) e1.delegate baker1 then + e1.delegate + else e2.delegate + in + Op.raw_endorsement ~delegate blk_a >>=? fun endorsement_a -> + Op.raw_endorsement ~delegate blk_b >>=? fun endorsement_b -> + let operation = double_endorsement (B genesis) endorsement_a endorsement_b in + Block.bake ~policy:(By_account baker1) ~operation blk_a + >>=? fun blk_with_de_evidence -> + block_fork ~policy:(By_account baker1) contracts blk_1 + >>=? fun (blk_a, blk_b) -> + double_baking (B blk_a) blk_a.header blk_b.header |> fun operation -> + Block.bake ~policy:(By_account baker2) ~operation blk_with_de_evidence + >>=? fun blk_with_db_evidence -> + Context.Delegate.current_frozen_deposits (B blk_with_db_evidence) baker1 + >>=? fun frozen_deposits_after -> + Context.get_constants (B genesis) >>=? fun csts -> + let r = + csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + in + let expected_frozen_deposits_after_de = + Test_tez.( + frozen_deposits_before + *! Int64.of_int (r.denominator - r.numerator) + /! Int64.of_int r.denominator) + in + (* the deposit after double baking and double endorsing equals the + expected deposit after double endorsing minus the double baking + punishment *) + Assert.equal_tez + ~loc:__LOC__ + Test_tez.( + expected_frozen_deposits_after_de + -! csts.parametric.double_baking_punishment) + frozen_deposits_after + +(** Test that the payload producer of the block containing a double + baking evidence (and not the block producer, if different) receives + the reward. *) +let test_payload_producer_gets_evidence_rewards () = + Context.init_n ~consensus_threshold:0 10 () >>=? fun (genesis, contracts) -> + Context.get_constants (B genesis) + >>=? fun Constants. + { + parametric = + {double_baking_punishment; baking_reward_fixed_portion; _}; + _; + } -> + Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> + let c1_c2 = + match contracts with c1 :: c2 :: _ -> (c1, c2) | _ -> assert false + in + block_fork ~policy:(By_account baker1) c1_c2 genesis >>=? fun (b1, b2) -> + double_baking (B b1) b1.header b2.header |> fun db_evidence -> + Block.bake ~policy:(By_account baker2) ~operation:db_evidence b1 + >>=? fun b_with_evidence -> + Context.get_endorsers (B b_with_evidence) >>=? fun endorsers -> + List.map_es + (function + | {Plugin.RPC.Validators.delegate; slots; _} -> return (delegate, slots)) + endorsers + >>=? fun preendorsers -> + List.map_ep + (fun (endorser, _slots) -> + Op.preendorsement ~delegate:endorser b_with_evidence) + preendorsers + >>=? fun preendos -> + Block.bake + ~payload_round:(Some Round.zero) + ~locked_round:(Some Round.zero) + ~policy:(By_account baker1) + ~operations:(preendos @ [db_evidence]) + b1 + >>=? fun b' -> + (* the frozen deposits of the double-signer [baker1] are slashed *) + Context.Delegate.current_frozen_deposits (B b1) baker1 + >>=? fun frozen_deposits_before -> + Context.Delegate.current_frozen_deposits (B b') baker1 + >>=? fun frozen_deposits_after -> + let slashed_amount = + Test_tez.(frozen_deposits_before -! frozen_deposits_after) + in + Assert.equal_tez ~loc:__LOC__ slashed_amount double_baking_punishment + >>=? fun () -> + (* [baker2] included the double baking evidence in [b_with_evidence] + and so it receives the reward for the evidence included in [b'] + (besides the reward for proposing the payload). *) + Context.Delegate.full_balance (B b1) baker2 >>=? fun full_balance -> + let evidence_reward = Test_tez.(slashed_amount /! 2L) in + let expected_reward = + Test_tez.(baking_reward_fixed_portion +! evidence_reward) + in + Context.Delegate.full_balance (B b') baker2 + >>=? fun full_balance_with_rewards -> + let real_reward = Test_tez.(full_balance_with_rewards -! full_balance) in + Assert.equal_tez ~loc:__LOC__ expected_reward real_reward >>=? fun () -> + (* [baker1] did not produce the payload, it does not receive the reward for the + evidence *) + Context.Delegate.full_balance (B b1) baker1 >>=? fun full_balance_at_b1 -> + Context.Delegate.full_balance (B b') baker1 >>=? fun full_balance_at_b' -> + Assert.equal_tez + ~loc:__LOC__ + full_balance_at_b' + Test_tez.(full_balance_at_b1 -! double_baking_punishment) + +(****************************************************************) +(* The following test scenarios are supposed to raise errors. *) +(****************************************************************) + +(** Check that a double baking operation fails if it exposes the same two + blocks. *) +let test_same_blocks () = + Context.init2 () >>=? fun (b, _contracts) -> + Block.bake b >>=? fun ba -> + double_baking (B ba) ba.header ba.header |> fun operation -> + Block.bake ~operation ba >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_double_baking_evidence _ -> true + | _ -> false) + +(** Check that an double baking operation that is invalid due to + incorrect ordering of the block headers fails. *) +let test_incorrect_order () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> + block_fork ~policy:(By_round 0) contracts genesis >>=? fun (blk_a, blk_b) -> + double_baking (B genesis) ~correct_order:false blk_a.header blk_b.header + |> fun operation -> + Block.bake ~operation genesis >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_double_baking_evidence _ -> true + | _ -> false) + +(** Check that a double baking operation exposing two blocks with + different levels fails. *) +let test_different_levels () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, contracts) -> + block_fork ~policy:(By_round 0) contracts b >>=? fun (blk_a, blk_b) -> + Block.bake blk_b >>=? fun blk_b_2 -> + double_baking (B blk_a) blk_a.header blk_b_2.header |> fun operation -> + Block.bake ~operation blk_a >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_double_baking_evidence _ -> true + | _ -> false) + +(** Check that a double baking operation exposing two yet-to-be-baked + blocks fails. *) +let test_too_early_double_baking_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> + Block.bake_until_cycle_end genesis >>=? fun b -> + block_fork ~policy:(By_round 0) contracts b >>=? fun (blk_a, blk_b) -> + double_baking (B b) blk_a.header blk_b.header |> fun operation -> + Block.bake ~operation genesis >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Too_early_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Block -> + true + | _ -> false) + +(** Check that after [max_slashing_period * blocks_per_cycle + 1] blocks -- corresponding to 2 cycles + --, it is not possible to create a double baking operation anymore. *) +let test_too_late_double_baking_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, contracts) -> + Context.get_constants (B b) + >>=? fun Constants.{parametric = {max_slashing_period; _}; _} -> + block_fork ~policy:(By_round 0) contracts b >>=? fun (blk_a, blk_b) -> + Block.bake_until_n_cycle_end max_slashing_period blk_a >>=? fun blk -> + double_baking (B blk) blk_a.header blk_b.header |> fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Outdated_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Block -> + true + | _ -> false) + +(** Check that before [max_slashing_period * blocks_per_cycle] blocks + -- corresponding to 2 cycles --, it is still possible to create a + double baking operation. *) +let test_just_in_time_double_baking_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, contracts) -> + Context.get_constants (B b) + >>=? fun Constants.{parametric = {blocks_per_cycle; _}; _} -> + block_fork ~policy:(By_round 0) contracts b >>=? fun (blk_a, blk_b) -> + Block.bake_until_cycle_end blk_a >>=? fun blk -> + Block.bake_n Int32.(sub blocks_per_cycle 2l |> to_int) blk >>=? fun blk -> + let operation = double_baking (B blk) blk_a.header blk_b.header in + (* We include the denunciation in the previous to last block of the + cycle. *) + Block.bake ~operation blk >>=? fun (_ : Block.t) -> return_unit + +(** Check that an invalid double baking evidence that exposes two + block baking with same level made by different bakers fails. *) +let test_different_delegates () = + Context.init2 () >>=? fun (b, _contracts) -> + Context.get_first_different_bakers (B b) >>=? fun (baker_1, baker_2) -> + Block.bake ~policy:(By_account baker_1) b >>=? fun blk_a -> + Block.bake ~policy:(By_account baker_2) b >>=? fun blk_b -> + double_baking (B blk_a) blk_a.header blk_b.header |> fun operation -> + Block.bake ~operation blk_a >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Invalid_double_baking_evidence _ -> true + | _ -> false) + +(** This test is supposed to mimic that a block cannot be baked by one baker and + signed by another. The way it tries to show this is by using a + Double_baking_evidence operation: + - say [baker_1] bakes block blk_a so blk_a has a header with baker_1's + signature + - say we create an artificial [header_b] for a block b' with timestamp [ts] + at the same level as [blk_a], and the header is created such that it says that + b' is baked by the same [baker_1] and signed by [baker_2] + - because [header_b] says that b' is baked by [baker_0], b' has the same + round as [blk_a], which together with the fact that b' and [blk_a] have the + same level, means that double_baking is valid: we have [blk_a] and b' at the + same level and round, but with different timestamps and signed by different + bakers. + This test fails with an error stating that block is signed by the wrong + baker. *) +let test_wrong_signer () = + let header_custom_signer baker baker_2 timestamp b = + Block.Forge.forge_header ~policy:(By_account baker) ~timestamp b + >>=? fun header -> + Block.Forge.set_baker baker_2 header |> Block.Forge.sign_header + in + Context.init2 () >>=? fun (b, _contracts) -> + Context.get_first_different_bakers (B b) >>=? fun (baker_1, baker_2) -> + Block.bake ~policy:(By_account baker_1) b >>=? fun blk_a -> + let ts = Timestamp.of_seconds_string (Int64.to_string 10L) in + match ts with + | None -> assert false + | Some ts -> + header_custom_signer baker_1 baker_2 ts b >>=? fun header_b -> + double_baking (B blk_a) blk_a.header header_b |> fun operation -> + Block.bake ~operation blk_a >>= fun e -> + Assert.proto_error_with_info ~loc:__LOC__ e "Invalid block signature" + +(** an evidence can only be accepted once (this also means that the + same evidence doesn't lead to slashing the offender twice) *) +let test_double_evidence () = + Context.init3 ~consensus_threshold:0 () >>=? fun (blk, (c1, c2, _c3)) -> + block_fork (c1, c2) blk >>=? fun (blk_a, blk_b) -> + Block.bake_until_cycle_end blk_a >>=? fun blk -> + double_baking (B blk) blk_a.header blk_b.header |> fun evidence -> + Block.bake ~operations:[evidence; evidence] blk >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Conflicting_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Block -> + true + | _ -> false) + >>=? fun () -> + Block.bake ~operation:evidence blk >>=? fun blk -> + double_baking (B blk) blk_b.header blk_a.header |> fun evidence -> + Block.bake ~operation:evidence blk >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Already_denounced _ -> true + | _ -> false) + +let tests = + [ + Tztest.tztest + "valid double baking evidence" + `Quick + test_valid_double_baking_evidence; + Tztest.tztest + "payload producer receives the rewards for double baking evidence" + `Quick + test_payload_producer_gets_evidence_rewards; + (* Should fail*) + Tztest.tztest "same blocks" `Quick test_same_blocks; + Tztest.tztest "incorrect order" `Quick test_incorrect_order; + Tztest.tztest "different levels" `Quick test_different_levels; + Tztest.tztest + "too early double baking evidence" + `Quick + test_too_early_double_baking_evidence; + Tztest.tztest + "too late double baking evidence" + `Quick + test_too_late_double_baking_evidence; + Tztest.tztest + "just in time double baking evidence" + `Quick + test_just_in_time_double_baking_evidence; + Tztest.tztest "different delegates" `Quick test_different_delegates; + Tztest.tztest "wrong delegate" `Quick test_wrong_signer; + Tztest.tztest + "reject double injection of an evidence" + `Quick + test_double_evidence; + Tztest.tztest + "double baking followed by double endorsing" + `Quick + test_valid_double_baking_followed_by_double_endorsing; + Tztest.tztest + "double endorsing followed by double baking" + `Quick + test_valid_double_endorsing_followed_by_double_baking; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml new file mode 100644 index 000000000000..38d190702a43 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -0,0 +1,513 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (double endorsement) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^double endorsement$" + Subject: Double endorsement evidence operation may happen when an + endorser endorsed two different blocks on the same level. +*) + +open Protocol +open Alpha_context + +(****************************************************************) +(* Utility functions *) +(****************************************************************) + +let block_fork b = + Context.get_first_different_bakers (B b) >>=? fun (baker_1, baker_2) -> + Block.bake ~policy:(By_account baker_1) b >>=? fun blk_a -> + Block.bake ~policy:(By_account baker_2) b >|=? fun blk_b -> (blk_a, blk_b) + +(****************************************************************) +(* Tests *) +(****************************************************************) + +let order_endorsements ~correct_order op1 op2 = + let oph1 = Operation.hash op1 in + let oph2 = Operation.hash op2 in + let c = Tezos_crypto.Operation_hash.compare oph1 oph2 in + if correct_order then if c < 0 then (op1, op2) else (op2, op1) + else if c < 0 then (op2, op1) + else (op1, op2) + +let double_endorsement ctxt ?(correct_order = true) op1 op2 = + let e1, e2 = order_endorsements ~correct_order op1 op2 in + Op.double_endorsement ctxt e1 e2 + +(** This test verifies that when a "cheater" double endorses and + doesn't have enough tokens to re-freeze of full deposit, we only + freeze what we can (i.e. the remaining balance) but we check that + another denunciation will slash 50% of the initial (expected) amount + of the deposit. *) + +(** Simple scenario where two endorsements are made from the same + delegate and exposed by a double_endorsement operation. Also verify + that punishment is operated. *) +let test_valid_double_endorsement_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + (* from blk_1 we bake blk_a and from blk_2 we bake blk_b so that + the same delegate endorses blk_a and blk_b and these 2 form + a valid double endorsement evidence; + - note that we cannot have double endorsement evidence + at the level of blk_1, blk_2 because both have as parent genesis + and so the endorsements are identical because the blocks blk_1, blk_2 + are identical. *) + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (delegate, _) -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + let operation = double_endorsement (B genesis) endorsement_a endorsement_b in + Context.get_bakers (B blk_a) >>=? fun bakers -> + let baker = Context.get_first_different_baker delegate bakers in + Context.Delegate.full_balance (B blk_a) baker >>=? fun full_balance -> + Block.bake ~policy:(By_account baker) ~operation blk_a >>=? fun blk_final -> + (* Check that parts of the frozen deposits are slashed *) + Context.Delegate.current_frozen_deposits (B blk_a) delegate + >>=? fun frozen_deposits_before -> + Context.Delegate.current_frozen_deposits (B blk_final) delegate + >>=? fun frozen_deposits_after -> + Context.get_constants (B genesis) >>=? fun csts -> + let r = + csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + in + let expected_frozen_deposits_after = + Test_tez.( + frozen_deposits_before + *! Int64.of_int (r.denominator - r.numerator) + /! Int64.of_int r.denominator) + in + Assert.equal_tez + ~loc:__LOC__ + expected_frozen_deposits_after + frozen_deposits_after + >>=? fun () -> + (* Check that the initial frozen deposits has not changed *) + Context.Delegate.initial_frozen_deposits (B blk_final) delegate + >>=? fun initial_frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ initial_frozen_deposits frozen_deposits_before + >>=? fun () -> + (* Check that [baker] is rewarded with: + - baking_reward_fixed_portion for baking and, + - half of the frozen_deposits for including the evidence *) + let baking_reward = csts.parametric.baking_reward_fixed_portion in + let evidence_reward = Test_tez.(frozen_deposits_after /! 2L) in + let expected_reward = Test_tez.(baking_reward +! evidence_reward) in + Context.Delegate.full_balance (B blk_final) baker + >>=? fun full_balance_with_rewards -> + let real_reward = Test_tez.(full_balance_with_rewards -! full_balance) in + Assert.equal_tez ~loc:__LOC__ expected_reward real_reward + +(** Say a delegate double-endorses twice and say the 2 evidences are timely + included. Then the delegate can no longer bake. *) +let test_two_double_endorsement_evidences_leadsto_no_bake () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (delegate, _) -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + let operation = double_endorsement (B genesis) endorsement_a endorsement_b in + Context.get_bakers (B blk_a) >>=? fun bakers -> + let baker = Context.get_first_different_baker delegate bakers in + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> + Block.bake ~policy:(By_account baker) ~operation blk_a + >>=? fun blk_with_evidence1 -> + block_fork blk_with_evidence1 >>=? fun (blk_30, blk_40) -> + Block.bake blk_30 >>=? fun blk_3 -> + Block.bake blk_40 >>=? fun blk_4 -> + Op.raw_endorsement blk_3 >>=? fun endorsement_3 -> + Op.raw_endorsement blk_4 >>=? fun endorsement_4 -> + let operation = + double_endorsement (B blk_with_evidence1) endorsement_3 endorsement_4 + in + Block.bake ~policy:(By_account baker) ~operation blk_3 + >>=? fun blk_with_evidence2 -> + (* Check that all the frozen deposits are slashed *) + Context.Delegate.current_frozen_deposits (B blk_with_evidence2) delegate + >>=? fun frozen_deposits_after -> + Assert.equal_tez ~loc:__LOC__ Tez.zero frozen_deposits_after >>=? fun () -> + Block.bake ~policy:(By_account delegate) blk_with_evidence2 >>= fun b -> + (* a delegate with 0 frozen deposits cannot bake *) + Assert.proto_error_with_info ~loc:__LOC__ b "Zero frozen deposits" + +(****************************************************************) +(* The following test scenarios are supposed to raise errors. *) +(****************************************************************) + +(** Check that an invalid double endorsement operation that exposes a + valid endorsement fails. *) +let test_invalid_double_endorsement () = + Context.init_n ~consensus_threshold:0 10 () >>=? fun (genesis, _contracts) -> + Block.bake genesis >>=? fun b -> + Op.raw_endorsement b >>=? fun endorsement -> + Block.bake ~operation:(Operation.pack endorsement) b >>=? fun b -> + Op.double_endorsement (B b) endorsement endorsement |> fun operation -> + Block.bake ~operation b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_denunciation kind + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +(** Check that an double endorsement operation that is invalid due to + incorrect ordering of the endorsements fails. *) +let test_invalid_double_endorsement_variant () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + Block.bake_until_cycle_end genesis >>=? fun b -> + block_fork b >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + double_endorsement + (B genesis) + ~correct_order:false + endorsement_a + endorsement_b + |> fun operation -> + Block.bake ~operation genesis >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_denunciation kind + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +(** Check that a future-cycle double endorsement fails. *) +let test_too_early_double_endorsement_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + Block.bake_until_cycle_end genesis >>=? fun b -> + block_fork b >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + double_endorsement (B genesis) endorsement_a endorsement_b |> fun operation -> + Block.bake ~operation genesis >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Too_early_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +(** Check that after [max_slashing_period * blocks_per_cycle + 1], it is not possible + to create a double_endorsement anymore. *) +let test_too_late_double_endorsement_evidence () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + Context.get_constants (B genesis) + >>=? fun Constants. + {parametric = {max_slashing_period; blocks_per_cycle; _}; _} -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + Block.bake_n ((max_slashing_period * Int32.to_int blocks_per_cycle) + 1) blk_a + >>=? fun blk -> + double_endorsement (B blk) endorsement_a endorsement_b |> fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Outdated_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +(** Check that an invalid double endorsement evidence that exposes two + endorsements made by two different endorsers fails. *) +let test_different_delegates () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + Block.bake genesis >>=? fun genesis -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (endorser_a, _a_slots) -> + Context.get_first_different_endorsers (B blk_b) + >>=? fun (endorser_b1c, endorser_b2c) -> + let endorser_b = + if + Tezos_crypto.Signature.Public_key_hash.( = ) + endorser_a + endorser_b1c.delegate + then endorser_b2c.delegate + else endorser_b1c.delegate + in + Op.raw_endorsement ~delegate:endorser_a blk_a >>=? fun e_a -> + Op.raw_endorsement ~delegate:endorser_b blk_b >>=? fun e_b -> + Block.bake ~operation:(Operation.pack e_b) blk_b >>=? fun (_ : Block.t) -> + double_endorsement (B blk_b) e_a e_b |> fun operation -> + Block.bake ~operation blk_b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Inconsistent_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +(** Check that a double endorsement evidence that exposes a ill-formed + endorsement fails. *) +let test_wrong_delegate () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (endorser_a, _a_slots) -> + Op.raw_endorsement ~delegate:endorser_a blk_a >>=? fun endorsement_a -> + Context.get_endorser_n (B blk_b) 0 >>=? fun (endorser0, _slots0) -> + Context.get_endorser_n (B blk_b) 1 >>=? fun (endorser1, _slots1) -> + let endorser_b = + if Tezos_crypto.Signature.Public_key_hash.equal endorser_a endorser0 then + endorser1 + else endorser0 + in + Op.raw_endorsement ~delegate:endorser_b blk_b >>=? fun endorsement_b -> + double_endorsement (B blk_b) endorsement_a endorsement_b |> fun operation -> + Block.bake ~operation blk_b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Inconsistent_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +let test_freeze_more_with_low_balance = + let get_endorsing_slots_for_account ctxt account = + (* Get the slots of the given account in the given context. *) + Context.get_endorsers ctxt >>=? function + | [d1; d2] -> + return + (if Tezos_crypto.Signature.Public_key_hash.equal account d1.delegate + then d1 + else if + Tezos_crypto.Signature.Public_key_hash.equal account d2.delegate + then d2 + else assert false) + .slots + | _ -> assert false + (* there are exactly two endorsers for this test. *) + in + let double_endorse_and_punish b2 account1 = + (* Bake a block on top of [b2] that includes a double-endorsement + denunciation of [account1]. *) + block_fork b2 >>=? fun (blk_d1, blk_d2) -> + Block.bake ~policy:(Block.By_account account1) blk_d1 >>=? fun blk_a -> + Block.bake ~policy:(Block.By_account account1) blk_d2 >>=? fun blk_b -> + get_endorsing_slots_for_account (B blk_a) account1 >>=? fun slots_a -> + let slot = + match List.hd slots_a with None -> assert false | Some s -> s + in + Op.raw_endorsement ~delegate:account1 ~slot blk_a >>=? fun end_a -> + get_endorsing_slots_for_account (B blk_b) account1 >>=? fun slots_b -> + let slot = + match List.hd slots_b with None -> assert false | Some s -> s + in + Op.raw_endorsement ~delegate:account1 ~slot blk_b >>=? fun end_b -> + let denunciation = double_endorsement (B b2) end_a end_b in + Block.bake ~policy:(Excluding [account1]) b2 ~operations:[denunciation] + in + let check_unique_endorser b account2 = + Context.get_endorsers (B b) >>=? function + | [{delegate; _}] + when Tezos_crypto.Signature.Public_key_hash.equal account2 delegate -> + return_unit + | _ -> failwith "We are supposed to only have account2 as endorser." + in + fun () -> + let constants = + { + Default_parameters.constants_test with + endorsing_reward_per_slot = Tez.zero; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + consensus_threshold = 0; + origination_size = 0; + preserved_cycles = 5; + ratio_of_frozen_deposits_slashed_per_double_endorsement = + (* enforce that ratio is 50% is the test's params. *) + {numerator = 1; denominator = 2}; + } + in + Context.init_with_constants2 constants >>=? fun (genesis, (c1, c2)) -> + let account1 = Context.Contract.pkh c1 in + let account2 = Context.Contract.pkh c2 in + (* we empty the available balance of [account1]. *) + Context.Delegate.info (B genesis) account1 >>=? fun info1 -> + Op.transaction + (B genesis) + (Contract.Implicit account1) + (Contract.Implicit account2) + Test_tez.(info1.full_balance -! info1.frozen_deposits) + >>=? fun op -> + Block.bake ~policy:(Block.By_account account2) genesis ~operations:[op] + >>=? fun b2 -> + Context.Delegate.info (B b2) account1 >>=? fun info2 -> + (* after block [b2], the spendable balance of [account1] is 0tz. So, given + that we have the invariant full_balance = spendable balance + + frozen_deposits, in this particular case, full_balance = frozen_deposits + for [account1], and the frozen_deposits didn't change since genesis. *) + Assert.equal_tez ~loc:__LOC__ info2.full_balance info2.frozen_deposits + >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ info1.frozen_deposits info2.frozen_deposits + >>=? fun () -> + double_endorse_and_punish b2 account1 >>=? fun b3 -> + (* Denunciation has happened: we check that the full balance of [account1] + is (still) equal to its deposit. *) + Context.Delegate.info (B b3) account1 >>=? fun info3 -> + Assert.equal_tez + ~loc:__LOC__ + info3.full_balance + info3.current_frozen_deposits + >>=? fun () -> + (* We also check that compared to deposits at block [b2], [account1] lost + 50% of its deposits. *) + let slash_ratio = + constants.ratio_of_frozen_deposits_slashed_per_double_endorsement + in + let expected_frozen_deposits_after = + Test_tez.( + info2.frozen_deposits + *! Int64.of_int (slash_ratio.denominator - slash_ratio.numerator) + /! Int64.of_int slash_ratio.denominator) + in + Assert.equal_tez + ~loc:__LOC__ + expected_frozen_deposits_after + info3.current_frozen_deposits + >>=? fun () -> + (* We now bake until end of cycle only with [account2]: + block of the new cycle are called cX below. *) + Block.bake_until_cycle_end b3 >>=? fun c1 -> + double_endorse_and_punish c1 account1 >>=? fun c2 -> + (* Second denunciation has happened: we check that the full balance of + [account1] reflects the slashing of 50% of the original deposit. Its + current deposits are thus 0tz. *) + Context.Delegate.info (B c2) account1 >>=? fun info4 -> + Assert.equal_tez ~loc:__LOC__ info4.full_balance Tez.zero >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ info4.current_frozen_deposits Tez.zero + >>=? fun () -> + Block.bake c2 ~policy:(By_account account1) >>= fun c3 -> + (* Once the deposits dropped to 0, the baker cannot bake anymore *) + Assert.proto_error_with_info ~loc:__LOC__ c3 "Zero frozen deposits" + >>=? fun () -> + (* We bake [2 * preserved_cycles] additional cycles only with [account2]. + Because [account1] does not bake during this period, it loses its rights. + *) + Block.bake_until_n_cycle_end + ~policy:(By_account account2) + (2 * constants.preserved_cycles) + c2 + >>=? fun d1 -> + Context.Delegate.info (B d1) account1 >>=? fun info5 -> + (* [account1] is only deactivated after 1 + [2 * preserved_cycles] (see + [Delegate_activation_storage.set_active] since the last time it was + active, that is, since the first cycle. Thus the cycle at which + [account1] is deactivated is 2 + [2 * preserved_cycles] from genesis. *) + Assert.equal_bool ~loc:__LOC__ info5.deactivated false >>=? fun () -> + (* account1 is still active, but has no rights. *) + check_unique_endorser d1 account2 >>=? fun () -> + Block.bake_until_cycle_end ~policy:(By_account account2) d1 >>=? fun e1 -> + (* account1 has no rights and furthermore is no longer active. *) + check_unique_endorser e1 account2 >>=? fun () -> + Context.Delegate.info (B e1) account1 >>=? fun info6 -> + Assert.equal_bool ~loc:__LOC__ info6.deactivated true + +(** Injecting a valid double endorsement multiple times raises an error. *) +let test_two_double_endorsement_evidences_leads_to_duplicate_denunciation () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (delegate, _) -> + Op.raw_endorsement blk_a >>=? fun endorsement_a -> + Op.raw_endorsement blk_b >>=? fun endorsement_b -> + let operation = double_endorsement (B genesis) endorsement_a endorsement_b in + let operation2 = double_endorsement (B genesis) endorsement_b endorsement_a in + Context.get_bakers (B blk_a) >>=? fun bakers -> + let baker = Context.get_first_different_baker delegate bakers in + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> + Block.bake + ~policy:(By_account baker) + ~operations:[operation; operation2] + blk_a + >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Conflicting_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + >>=? fun () -> + Block.bake ~policy:(By_account baker) ~operation blk_a + >>=? fun blk_with_evidence1 -> + Block.bake ~policy:(By_account baker) ~operation blk_with_evidence1 + >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Already_denounced {kind; _} + when kind = Validate_errors.Anonymous.Endorsement -> + true + | _ -> false) + +let tests = + [ + Tztest.tztest + "valid double endorsement evidence" + `Quick + test_valid_double_endorsement_evidence; + Tztest.tztest + "2 valid double endorsement evidences lead to not being able to bake" + `Quick + test_two_double_endorsement_evidences_leadsto_no_bake; + Tztest.tztest + "valid double endorsement injected multiple time" + `Quick + test_two_double_endorsement_evidences_leads_to_duplicate_denunciation; + Tztest.tztest + "invalid double endorsement evidence" + `Quick + test_invalid_double_endorsement; + Tztest.tztest + "another invalid double endorsement evidence" + `Quick + test_invalid_double_endorsement_variant; + Tztest.tztest + "too early double endorsement evidence" + `Quick + test_too_early_double_endorsement_evidence; + Tztest.tztest + "too late double endorsement evidence" + `Quick + test_too_late_double_endorsement_evidence; + Tztest.tztest "different delegates" `Quick test_different_delegates; + Tztest.tztest "wrong delegate" `Quick test_wrong_delegate; + Tztest.tztest + "freeze available balance after slashing" + `Quick + test_freeze_more_with_low_balance; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml new file mode 100644 index 000000000000..199f1d679b5a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -0,0 +1,403 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (double preendorsement) in Full_construction & Application modes + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^double preendorsement$" + Subject: These tests target different cases for double preendorsement *) + +open Protocol +open Alpha_context + +module type MODE = sig + val name : string + + val baking_mode : Block.baking_mode +end + +module BakeWithMode (Mode : MODE) : sig + val tests : unit Alcotest_lwt.test_case trace +end = struct + let name = Mode.name + + let bake = Block.bake ~baking_mode:Mode.baking_mode + + let bake_n = Block.bake_n ~baking_mode:Mode.baking_mode + + (****************************************************************) + (* Utility functions *) + (****************************************************************) + + (** Helper function for illformed denunciations construction *) + + let pick_endorsers ctxt = + let module V = Plugin.RPC.Validators in + Context.get_endorsers ctxt >>=? function + | a :: b :: _ -> + return ((a.V.delegate, a.V.slots), (b.V.delegate, b.V.slots)) + | _ -> assert false + + let invalid_denunciation loc res = + Assert.proto_error ~loc res (function + | Validate_errors.Anonymous.Invalid_denunciation kind + when kind = Validate_errors.Anonymous.Preendorsement -> + true + | _ -> false) + + let malformed_double_preendorsement_denunciation + ?(include_endorsement = false) ?(block_round = 0) + ?(mk_evidence = fun ctxt p1 p2 -> Op.double_preendorsement ctxt p1 p2) + ~loc () = + Context.init_n ~consensus_threshold:0 10 () + >>=? fun (genesis, _contracts) -> + bake genesis >>=? fun b1 -> + bake ~policy:(By_round 0) b1 >>=? fun b2_A -> + Op.endorsement b1 >>=? fun e -> + let operations = if include_endorsement then [e] else [] in + bake ~policy:(By_round block_round) ~operations b1 >>=? fun b2_B -> + Op.raw_preendorsement b2_A >>=? fun op1 -> + Op.raw_preendorsement b2_B >>=? fun op2 -> + let op = mk_evidence (B genesis) op1 op2 in + bake b1 ~operations:[op] >>= fun res -> invalid_denunciation loc res + + let max_slashing_period () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Context.get_constants (B genesis) + >>=? fun {parametric = {max_slashing_period; blocks_per_cycle; _}; _} -> + return (max_slashing_period * Int32.to_int blocks_per_cycle) + + let already_denounced loc res = + Assert.proto_error ~loc res (function + | Validate_errors.Anonymous.Already_denounced {kind; _} + when kind = Validate_errors.Anonymous.Preendorsement -> + true + | _ -> false) + + let inconsistent_denunciation loc res = + Assert.proto_error ~loc res (function + | Validate_errors.Anonymous.Inconsistent_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Preendorsement -> + true + | _ -> false) + + let outdated_denunciation loc res = + Assert.proto_error ~loc res (function + | Validate_errors.Anonymous.Outdated_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Preendorsement -> + true + | _ -> false) + + let unexpected_failure loc res = + (* no error is expected *) + Assert.proto_error ~loc res (function _ -> false) + + let unexpected_success loc _ _ _ _ _ = + Alcotest.fail (loc ^ ": Test should not succeed") + + let expected_success _loc baker pred bbad d1 d2 = + (* same preendorsers in case denunciation succeeds*) + Assert.equal_pkh ~loc:__LOC__ d1 d2 >>=? fun () -> + Context.get_constants (B pred) + >>=? fun Constants. + { + parametric = + { + ratio_of_frozen_deposits_slashed_per_double_endorsement = r; + _; + }; + _; + } -> + (* let's bake the block on top of pred without denunciating d1 *) + bake ~policy:(By_account baker) pred >>=? fun bgood -> + (* Checking what the endorser lost *) + Context.Delegate.current_frozen_deposits (B pred) d1 + >>=? fun frozen_deposit -> + Context.Delegate.full_balance (B bgood) d1 >>=? fun bal_good -> + Context.Delegate.full_balance (B bbad) d1 >>=? fun bal_bad -> + (* the diff of the two balances in normal and in denunciation cases *) + let diff_end_bal = Test_tez.(bal_good -! bal_bad) in + (* amount lost due to denunciation *) + let lost_deposit = + Test_tez.( + frozen_deposit *! Int64.of_int r.numerator /! Int64.of_int r.denominator) + in + (* have of the lost deposts will be earned by the baker *) + let denun_reward = Test_tez.(lost_deposit /! 2L) in + (* if the baker is the endorser, he'll only loose half of the deposits *) + let expected_endo_loss = + if Tezos_crypto.Signature.Public_key_hash.equal baker d1 then + Test_tez.(lost_deposit -! denun_reward) + else lost_deposit + in + Assert.equal_tez ~loc:__LOC__ expected_endo_loss diff_end_bal >>=? fun () -> + (* Checking what the baker earned (or lost) *) + Context.Delegate.full_balance (B bgood) baker >>=? fun bal_good -> + Context.Delegate.full_balance (B bbad) baker >>=? fun bal_bad -> + (* if baker = endorser, the baker's balance in the good case is better, + because half of his deposits are burnt in the bad (double-preendorsement) + situation. In case baker <> endorser, bal_bad of the baker gets half of + burnt deposit of d1, so it's higher + *) + let high, low = + if Tezos_crypto.Signature.Public_key_hash.equal baker d1 then + (bal_good, bal_bad) + else (bal_bad, bal_good) + in + let diff_baker = Test_tez.(high -! low) in + (* the baker has either earnt or lost (in case baker = d1) half of burnt + endorsement deposits *) + Assert.equal_tez ~loc:__LOC__ denun_reward diff_baker >>=? fun () -> + return_unit + + let order_preendorsements ~correct_order op1 op2 = + let oph1 = Operation.hash op1 in + let oph2 = Operation.hash op2 in + let c = Tezos_crypto.Operation_hash.compare oph1 oph2 in + if correct_order then if c < 0 then (op1, op2) else (op2, op1) + else if c < 0 then (op2, op1) + else (op1, op2) + + (** Helper function for denunciations inclusion *) + let generic_double_preendorsement_denunciation ~nb_blocks_before_double + ~nb_blocks_before_denunciation + ?(test_expected_ok = fun _loc _baker _pred _bbad _d1 _d2 -> return_unit) + ?(test_expected_ko = fun _loc _res -> return_unit) + ?(pick_endorsers = + fun ctxt -> pick_endorsers ctxt >>=? fun (a, _b) -> return (a, a)) ~loc + () = + Context.init_n ~consensus_threshold:0 10 () >>=? fun (genesis, contracts) -> + let addr = + match List.hd contracts with None -> assert false | Some e -> e + in + (* bake `nb_blocks_before_double blocks` before double preendorsing *) + bake_n nb_blocks_before_double genesis >>=? fun blk -> + (* producing two differents blocks and two preendorsements op1 and op2 *) + Op.transaction (B genesis) addr addr Tez.one_mutez >>=? fun trans -> + bake ~policy:(By_round 0) blk >>=? fun head_A -> + bake ~policy:(By_round 0) blk ~operations:[trans] >>=? fun head_B -> + pick_endorsers (B head_A) >>=? fun ((d1, _slots1), (d2, _slots2)) -> + (* default: d1 = d2 *) + Op.raw_preendorsement ~delegate:d1 head_A >>=? fun op1 -> + Op.raw_preendorsement ~delegate:d2 head_B >>=? fun op2 -> + let op1, op2 = order_preendorsements ~correct_order:true op1 op2 in + (* bake `nb_blocks_before_denunciation` before double preend. denunciation *) + bake_n nb_blocks_before_denunciation blk >>=? fun blk -> + let op : Operation.packed = Op.double_preendorsement (B blk) op1 op2 in + Context.get_baker (B blk) ~round:Round.zero >>=? fun baker -> + bake ~policy:(By_account baker) blk ~operations:[op] >>= function + | Ok new_head -> + test_expected_ok loc baker blk new_head d1 d2 >>=? fun () -> + let op : Operation.packed = + Op.double_preendorsement (B new_head) op2 op1 + in + bake new_head ~operations:[op] >>= invalid_denunciation loc + >>=? fun () -> + let op : Operation.packed = + Op.double_preendorsement (B new_head) op1 op2 + in + bake new_head ~operations:[op] >>= already_denounced loc + | Error _ as res -> test_expected_ko loc res + + (****************************************************************) + (* Tests *) + (****************************************************************) + + (** Preendorsing two blocks that are structurally equal is not punished *) + let malformed_double_preendorsement_denunciation_same_payload_hash_1 () = + malformed_double_preendorsement_denunciation ~loc:__LOC__ () + + (** Preendorsing two blocks that are structurally equal up to the endorsements + they include is not punished *) + let malformed_double_preendorsement_denunciation_same_payload_hash_2 () = + malformed_double_preendorsement_denunciation + (* including an endorsement in one of the blocks doesn't change its + payload hash *) + ~include_endorsement:true + ~loc:__LOC__ + () + + (** Denunciation evidence cannot have the same operations *) + let malformed_double_preendorsement_denunciation_same_preendorsement () = + malformed_double_preendorsement_denunciation + (* exactly the same preendorsement operation => illformed *) + ~mk_evidence:(fun ctxt p1 _p2 -> Op.double_preendorsement ctxt p1 p1) + ~loc:__LOC__ + () + + (** Preendorsing two blocks with different rounds is not punished *) + let malformed_double_preendorsement_denunciation_different_rounds () = + malformed_double_preendorsement_denunciation ~loc:__LOC__ ~block_round:1 () + + (** Preendorsing two blocks by two different validators is not punished *) + let malformed_double_preendorsement_denunciation_different_validators () = + generic_double_preendorsement_denunciation + ~nb_blocks_before_double:0 + ~nb_blocks_before_denunciation:2 + ~test_expected_ok:unexpected_success + ~test_expected_ko:inconsistent_denunciation + ~pick_endorsers (* pick different endorsers *) + ~loc:__LOC__ + () + + (** Attempt a denunciation of a double-pre in the first block after genesis *) + let double_preendorsement_just_after_upgrade () = + generic_double_preendorsement_denunciation + ~nb_blocks_before_double:0 + ~nb_blocks_before_denunciation:1 + ~test_expected_ok:expected_success + ~test_expected_ko:unexpected_failure + ~loc:__LOC__ + () + + (** Denunciation of double-pre at level L is injected at level L' = max_slashing_period. + The denunciation is outdated. *) + let double_preendorsement_denunciation_during_slashing_period () = + max_slashing_period () >>=? fun max_slashing_period -> + generic_double_preendorsement_denunciation + ~nb_blocks_before_double:0 + ~nb_blocks_before_denunciation:(max_slashing_period / 2) + ~test_expected_ok:expected_success + ~test_expected_ko:unexpected_failure + ~loc:__LOC__ + () + + (** Denunciation of double-pre at level L is injected 1 block after unfreeze + delay. Too late: denunciation is outdated. *) + let double_preendorsement_denunciation_after_slashing_period () = + max_slashing_period () >>=? fun max_slashing_period -> + generic_double_preendorsement_denunciation + ~nb_blocks_before_double:0 + ~nb_blocks_before_denunciation:(max_slashing_period + 1) + ~test_expected_ok:unexpected_success + ~test_expected_ko:outdated_denunciation + ~loc:__LOC__ + () + + let double_preendorsement ctxt ?(correct_order = true) op1 op2 = + let e1, e2 = order_preendorsements ~correct_order op1 op2 in + Op.double_preendorsement ctxt e1 e2 + + let block_fork b = + Context.get_first_different_bakers (B b) >>=? fun (baker_1, baker_2) -> + Block.bake ~policy:(By_account baker_1) b >>=? fun blk_a -> + Block.bake ~policy:(By_account baker_2) b >|=? fun blk_b -> (blk_a, blk_b) + + (** Injecting a valid double preendorsement multiple time raises an error. *) + let test_two_double_preendorsement_evidences_leads_to_duplicate_denunciation + () = + Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, _contracts) -> + block_fork genesis >>=? fun (blk_1, blk_2) -> + Block.bake blk_1 >>=? fun blk_a -> + Block.bake blk_2 >>=? fun blk_b -> + Context.get_endorser (B blk_a) >>=? fun (delegate, _) -> + Op.raw_preendorsement blk_a >>=? fun preendorsement_a -> + Op.raw_preendorsement blk_b >>=? fun preendorsement_b -> + let operation = + double_preendorsement (B genesis) preendorsement_a preendorsement_b + in + let operation2 = + double_preendorsement (B genesis) preendorsement_b preendorsement_a + in + Context.get_bakers (B blk_a) >>=? fun bakers -> + let baker = Context.get_first_different_baker delegate bakers in + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> + Block.bake + ~policy:(By_account baker) + ~operations:[operation; operation2] + blk_a + >>= fun e -> + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Conflicting_denunciation {kind; _} + when kind = Validate_errors.Anonymous.Preendorsement -> + true + | _ -> false) + >>=? fun () -> + Block.bake ~policy:(By_account baker) ~operation blk_a + >>=? fun blk_with_evidence1 -> + Block.bake ~policy:(By_account baker) ~operation blk_with_evidence1 + >>= fun e -> already_denounced __LOC__ e + + let my_tztest title test = + Tztest.tztest (Format.sprintf "%s: %s" name title) test + + let tests = + [ + (* illformed denunciations *) + my_tztest + "ko: malformed_double_preendorsement_denunciation_same_payload_hash_1" + `Quick + malformed_double_preendorsement_denunciation_same_payload_hash_1; + my_tztest + "ko: malformed_double_preendorsement_denunciation_same_payload_hash_2" + `Quick + malformed_double_preendorsement_denunciation_same_payload_hash_2; + my_tztest + "ko: malformed_double_preendorsement_denunciation_different_rounds" + `Quick + malformed_double_preendorsement_denunciation_different_rounds; + my_tztest + "ko: malformed_double_preendorsement_denunciation_same_preendorsement" + `Quick + malformed_double_preendorsement_denunciation_same_preendorsement; + my_tztest + "ko: malformed_double_preendorsement_denunciation_different_validators" + `Quick + malformed_double_preendorsement_denunciation_different_validators; + my_tztest + "double_preendorsement_just_after_upgrade" + `Quick + double_preendorsement_just_after_upgrade; + (* tests for unfreeze *) + my_tztest + "double_preendorsement_denunciation_during_slashing_period" + `Quick + double_preendorsement_denunciation_during_slashing_period; + my_tztest + "double_preendorsement_denunciation_after_slashing_period" + `Quick + double_preendorsement_denunciation_after_slashing_period; + my_tztest + "valid double preendorsement injected multiple times" + `Quick + test_two_double_preendorsement_evidences_leads_to_duplicate_denunciation; + ] +end + +let tests = + let module AppMode = BakeWithMode (struct + let name = "AppMode" + + let baking_mode = Block.Application + end) in + let module ConstrMode = BakeWithMode (struct + let name = "ConstrMode" + + let baking_mode = Block.Baking + end) in + AppMode.tests @ ConstrMode.tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml new file mode 100644 index 000000000000..3646a977e447 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml @@ -0,0 +1,616 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (endorsement) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^endorsement$" + Subject: Endorsing a block adds an extra layer of confidence + to the Tezos' PoS algorithm. The block endorsing + operation must be included in the following block. +*) + +open Protocol +open Alpha_context + +let init_genesis ?policy () = + Context.init_n ~consensus_threshold:0 5 () >>=? fun (genesis, _contracts) -> + Block.bake ?policy genesis >>=? fun b -> return (genesis, b) + +(** inject an endorsement and return the block with the endorsement and its + parent. *) +let inject_the_first_endorsement () = + init_genesis () >>=? fun (_genesis, b) -> + Op.endorsement b >>=? fun operation -> + Block.bake ~operation b >>=? fun b' -> return (b', b) + +(****************************************************************) +(* Tests *) +(****************************************************************) + +(** Apply a single endorsement from the slot 0 endorser. *) +let test_simple_endorsement () = + inject_the_first_endorsement () >>=? fun (_, _) -> return_unit + +(****************************************************************) +(* The following test scenarios are supposed to raise errors. *) +(****************************************************************) + +(** Apply an endorsement with a negative slot. *) +let test_negative_slot () = + Context.init_n 5 () >>=? fun (genesis, _contracts) -> + Block.bake genesis >>=? fun b -> + Context.get_endorser (B b) >>=? fun (delegate, _slots) -> + Lwt.catch + (fun () -> + Op.endorsement + ~delegate + ~slot:(Slot.of_int_do_not_use_except_for_parameters (-1)) + b + >>=? fun (_ : packed_operation) -> + failwith "negative slot should not be accepted by the binary format") + (function + | Data_encoding.Binary.Write_error _ -> return_unit | e -> Lwt.fail e) + +(** Apply an endorsement with a non-normalized slot (that is, not the smallest + possible). *) +let test_non_normalized_slot () = + Context.init_n 5 () >>=? fun (genesis, _contracts) -> + Block.bake genesis >>=? fun b -> + Context.get_endorsers (B b) >>=? fun endorsers_list -> + (* find an endorsers with more than 1 slot *) + List.find_map + (function + | {Plugin.RPC.Validators.delegate; slots; _} -> + if Compare.List_length_with.(slots > 1) then Some (delegate, slots) + else None) + endorsers_list + |> function + | None -> assert false + | Some (delegate, slots) -> + let set_slots = Slot.Set.of_list slots in + (* no duplicated slots *) + Assert.equal_int + ~loc:__LOC__ + (Slot.Set.cardinal set_slots) + (List.length slots) + >>=? fun () -> + (* the first slot should be the smallest slot *) + Assert.equal + ~loc:__LOC__ + (fun x y -> Slot.compare x y = 0) + "the first slot is not the smallest" + Slot.pp + (WithExceptions.Option.get ~loc:__LOC__ @@ List.hd slots) + (WithExceptions.Option.get ~loc:__LOC__ @@ Slot.Set.min_elt set_slots) + >>=? fun () -> + let slot = + match List.hd (List.rev slots) with None -> assert false | Some s -> s + in + Op.endorsement ~delegate ~slot b >>=? fun operation -> + let policy = Block.Excluding [delegate] in + Block.bake ~policy ~operation b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Wrong_slot_used_for_consensus_operation + {kind} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Wrong endorsement predecessor : apply an endorsement with an + incorrect block predecessor. *) +let test_wrong_endorsement_predecessor () = + init_genesis () >>=? fun (_genesis, b) -> + Op.endorsement ~pred_branch:(Context.branch (B b)) b >>=? fun operation -> + Block.bake ~operation b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Wrong_consensus_operation_branch {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Invalid_endorsement_level: apply an endorsement with an incorrect + level (i.e. the predecessor level). *) +let test_invalid_endorsement_level () = + init_genesis () >>=? fun (genesis, b) -> + Context.get_level (B genesis) >>?= fun genesis_level -> + Op.endorsement ~level:genesis_level b >>=? fun operation -> + Block.bake ~operation b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Duplicate endorsement : apply an endorsement that has already been applied. *) +let test_duplicate_endorsement () = + init_genesis () >>=? fun (_genesis, b) -> + Incremental.begin_construction b >>=? fun inc -> + Op.endorsement b >>=? fun operation -> + Incremental.add_operation inc operation >>=? fun inc -> + Op.endorsement b >>=? fun operation -> + Incremental.add_operation inc operation >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Conflicting_consensus_operation {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Consensus operation for future level : apply an endorsement with a level in the future *) +let test_consensus_operation_endorsement_for_future_level () = + init_genesis () >>=? fun (_genesis, pred) -> + let raw_level = Raw_level.of_int32 (Int32.of_int 10) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_future_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for old level : apply an endorsement one level in the past *) +let test_consensus_operation_endorsement_for_predecessor_level () = + init_genesis () >>=? fun (_genesis, pred) -> + let raw_level = Raw_level.of_int32 (Int32.of_int 0) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for old level : apply an endorsement with more than one level in the past *) +let test_consensus_operation_endorsement_for_old_level () = + init_genesis () >>=? fun (genesis, pred) -> + Block.bake genesis >>=? fun _next_block -> + let raw_level = Raw_level.of_int32 (Int32.of_int 0) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for future round : apply an endorsement with a round in the future *) +let test_consensus_operation_endorsement_for_future_round () = + init_genesis () >>=? fun (_genesis, pred) -> + Environment.wrap_tzresult (Round.of_int 21) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~round + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_future_round {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for old round : apply an endorsement with a round in the past *) +let test_consensus_operation_endorsement_for_old_round () = + init_genesis ~policy:(By_round 10) () >>=? fun (_genesis, pred) -> + Environment.wrap_tzresult (Round.of_int 0) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~round + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_round {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation on competing proposal : apply an endorsement on a competing proposal *) +let test_consensus_operation_endorsement_on_competing_proposal () = + init_genesis () >>=? fun (_genesis, pred) -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:pred + ~block_payload_hash:Block_payload_hash.zero + ~error:(function + | Validate_errors.Consensus.Wrong_payload_hash_for_consensus_operation + {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Wrong round : apply an endorsement with an incorrect round *) +let test_wrong_round () = + init_genesis () >>=? fun (_genesis, b) -> + Environment.wrap_tzresult (Round.of_int 2) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:b + ~round + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_future_round {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + () + +(** Wrong level : apply an endorsement with an incorrect level *) +let test_wrong_level () = + init_genesis () >>=? fun (_genesis, b) -> + (* let context = Context.B genesis in*) + let raw_level = Raw_level.of_int32 (Int32.of_int 0) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:b + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + () + +(** Wrong payload hash : apply an endorsement with an incorrect payload hash *) +let test_wrong_payload_hash () = + init_genesis () >>=? fun (_genesis, b) -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:b + ~block_payload_hash:Block_payload_hash.zero + ~error:(function + | Validate_errors.Consensus.Wrong_payload_hash_for_consensus_operation + {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + () + +let test_wrong_slot_used () = + init_genesis () >>=? fun (_genesis, b) -> + Context.get_endorser (B b) >>=? fun (_, slots) -> + (match slots with + | _x :: y :: _ -> return y + | _ -> failwith "Slots size should be at least of 2 ") + >>=? fun slot -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:false + ~endorsed_block:b + ~slot + ~error:(function + | Validate_errors.Consensus.Wrong_slot_used_for_consensus_operation + {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + () + +(** Check that: + - a block with not enough endorsement cannot be baked; + - a block with enough endorsement is baked. *) +let test_endorsement_threshold ~sufficient_threshold () = + (* We choose a relative large number of accounts so that the probability that + any delegate has [consensus_threshold] slots is low and most delegates have + about 1 slot so we can get closer to the limit of [consensus_threshold]: we + check that a block with endorsing power [consensus_threshold - 1] won't be + baked. *) + Context.init_n 10 () >>=? fun (genesis, _contracts) -> + Block.bake genesis >>=? fun b -> + Context.get_constants (B b) + >>=? fun {parametric = {consensus_threshold; _}; _} -> + Context.get_endorsers (B b) >>=? fun endorsers_list -> + Block.get_round b >>?= fun round -> + List.fold_left_es + (fun (counter, endos) {Plugin.RPC.Validators.delegate; slots; _} -> + let new_counter = counter + List.length slots in + if + (sufficient_threshold && counter < consensus_threshold) + || ((not sufficient_threshold) && new_counter < consensus_threshold) + then + Op.endorsement ~round ~delegate b >>=? fun endo -> + return (new_counter, endo :: endos) + else return (counter, endos)) + (0, []) + endorsers_list + >>=? fun (_, endos) -> + Block.bake ~operations:endos b >>= fun b -> + if sufficient_threshold then return_unit + else Assert.proto_error_with_info ~loc:__LOC__ b "Not enough endorsements" + +(** Fitness gap: this is a straightforward update from Emmy to Tenderbake, that + is, check that the level is incremented in a child block. *) +let test_fitness_gap () = + inject_the_first_endorsement () >>=? fun (b, pred_b) -> + let fitness = + match Fitness.from_raw b.header.shell.fitness with + | Ok fitness -> fitness + | _ -> assert false + in + let pred_fitness = + match Fitness.from_raw pred_b.header.shell.fitness with + | Ok fitness -> fitness + | _ -> assert false + in + let level = Fitness.level fitness in + let pred_level = Fitness.level pred_fitness in + let level_diff = + Int32.sub (Raw_level.to_int32 level) (Raw_level.to_int32 pred_level) + in + Assert.equal_int32 ~loc:__LOC__ level_diff 1l + +let test_preendorsement_endorsement_same_level () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b1 -> + Incremental.begin_construction ~mempool_mode:true ~policy:(By_round 2) b1 + >>=? fun i -> + Op.endorsement b1 >>=? fun op_endo -> + Incremental.add_operation i op_endo >>=? fun (_i : Incremental.t) -> + Op.preendorsement b1 >>=? fun op_preendo -> + Incremental.add_operation i op_preendo >>=? fun (_i : Incremental.t) -> + return_unit + +(** Test for endorsement injection with wrong slot in mempool mode. This + test is expected to fail *) +let test_wrong_endorsement_slot_in_mempool_mode () = + Context.init_n ~consensus_threshold:1 5 () >>=? fun (genesis, _) -> + Block.bake genesis >>=? fun b1 -> + let module V = Plugin.RPC.Validators in + (Context.get_endorsers (B b1) >>=? function + | {V.slots = _ :: non_canonical_slot :: _; _} :: _ -> + (* we didn't use min slot for the injection. It's bad !*) + return (Some non_canonical_slot) + | _ -> assert false) + >>=? fun slot -> + Op.endorsement ?slot b1 >>=? fun endo -> + Incremental.begin_construction ~mempool_mode:true b1 >>=? fun i -> + Incremental.add_operation i endo >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Wrong_slot_used_for_consensus_operation {kind} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Endorsement for next level *) +let test_endorsement_for_next_level () = + init_genesis () >>=? fun (genesis, _) -> + Consensus_helpers.test_consensus_op_for_next + ~genesis + ~kind:`Endorsement + ~next:`Level + +(** Endorsement for next round *) +let test_endorsement_for_next_round () = + init_genesis () >>=? fun (genesis, _) -> + Consensus_helpers.test_consensus_op_for_next + ~genesis + ~kind:`Endorsement + ~next:`Round + +(** Endorsement of grandparent *) +let test_endorsement_grandparent () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b_gp -> + Block.bake b_gp >>=? fun b -> + Incremental.begin_construction ~mempool_mode:true b >>=? fun i -> + (* Endorsement on grandparent *) + Op.endorsement b_gp >>=? fun op1 -> + (* Endorsement on parent *) + Op.endorsement b >>=? fun op2 -> + (* Both should be accepted by the mempool *) + Incremental.add_operation i op1 >>=? fun i -> + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit + +(** Double inclusion of grandparent endorsement *) +let test_double_endorsement_grandparent () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b_gp -> + Block.bake b_gp >>=? fun b -> + Incremental.begin_construction ~mempool_mode:true b >>=? fun i -> + (* Endorsement on grandparent *) + Op.endorsement b_gp >>=? fun op1 -> + (* Endorsement on parent *) + Op.endorsement b >>=? fun op2 -> + (* The first grand parent endorsement should be accepted by the + mempool but the second rejected. *) + Incremental.add_operation i op1 >>=? fun i -> + Incremental.add_operation i op1 >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + "Double inclusion of consensus operation" + >>=? fun () -> + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit + +(** Endorsement of grandparent on same slot as parent *) +let test_endorsement_grandparent_same_slot () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b_gp -> + Block.bake b_gp >>=? fun b -> + Incremental.begin_construction ~mempool_mode:true b >>=? fun i -> + (* Endorsement on parent *) + Consensus_helpers.delegate_of_first_slot (B b) >>=? fun (delegate, slot) -> + Op.endorsement ~delegate b >>=? fun op2 -> + (* Endorsement on grandparent *) + Consensus_helpers.delegate_of_slot slot (B b_gp) >>=? fun delegate -> + Op.endorsement ~delegate b_gp >>=? fun op1 -> + (* Both should be accepted by the mempool *) + Incremental.add_operation i op1 >>=? fun i -> + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit + +(** Endorsement of grandparent in application mode should be rejected *) +let test_endorsement_grandparent_application () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b_gp -> + Block.bake b_gp >>=? fun b -> + Op.endorsement b_gp >>=? fun operation -> + Block.bake ~operation b >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +(** Endorsement of grandparent in full construction mode should be rejected *) +let test_endorsement_grandparent_full_construction () = + Context.init1 ~consensus_threshold:0 () >>=? fun (genesis, _contract) -> + Block.bake genesis >>=? fun b_gp -> + Block.bake b_gp >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + (* Endorsement on grandparent *) + Op.endorsement b_gp >>=? fun op1 -> + Incremental.add_operation i op1 >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Endorsement -> + true + | _ -> false) + +let tests = + [ + Tztest.tztest "Simple endorsement" `Quick test_simple_endorsement; + Tztest.tztest "Endorsement with slot -1" `Quick test_negative_slot; + Tztest.tztest + "Endorsement wrapped with non-normalized slot" + `Quick + test_non_normalized_slot; + Tztest.tztest "Fitness gap" `Quick test_fitness_gap; + (* Fail scenarios *) + Tztest.tztest + "Wrong endorsement predecessor" + `Quick + test_wrong_endorsement_predecessor; + Tztest.tztest + "Invalid endorsement level" + `Quick + test_invalid_endorsement_level; + Tztest.tztest "Duplicate endorsement" `Quick test_duplicate_endorsement; + Tztest.tztest + "Endorsement for future level" + `Quick + test_consensus_operation_endorsement_for_future_level; + Tztest.tztest + "Endorsement for predecessor level" + `Quick + test_consensus_operation_endorsement_for_old_level; + Tztest.tztest + "Endorsement for old level" + `Quick + test_consensus_operation_endorsement_for_old_level; + Tztest.tztest + "Endorsement for future round" + `Quick + test_consensus_operation_endorsement_for_future_round; + Tztest.tztest + "Endorsement for old round" + `Quick + test_consensus_operation_endorsement_for_old_round; + Tztest.tztest + "Endorsement on competing proposal" + `Quick + test_consensus_operation_endorsement_on_competing_proposal; + Tztest.tztest "Wrong level for consensus operation" `Quick test_wrong_level; + Tztest.tztest "Wrong round for consensus operation" `Quick test_wrong_round; + Tztest.tztest + "Wrong payload hash for consensus operation" + `Quick + test_wrong_payload_hash; + Tztest.tztest + "Wrong slot used for consensus operation" + `Quick + test_wrong_slot_used; + Tztest.tztest + "sufficient endorsement threshold" + `Quick + (test_endorsement_threshold ~sufficient_threshold:true); + Tztest.tztest + "insufficient endorsement threshold" + `Quick + (test_endorsement_threshold ~sufficient_threshold:false); + Tztest.tztest + "Endorsement/Preendorsement at same level" + `Quick + test_preendorsement_endorsement_same_level; + Tztest.tztest + "Wrong endorsement slot in mempool mode" + `Quick + test_wrong_endorsement_slot_in_mempool_mode; + Tztest.tztest + "Endorsement for next level" + `Quick + test_endorsement_for_next_level; + Tztest.tztest + "Endorsement for next round" + `Quick + test_endorsement_for_next_round; + Tztest.tztest + "Endorsement for grandparent" + `Quick + test_endorsement_grandparent; + Tztest.tztest + "Double endorsement of grandparent" + `Quick + test_double_endorsement_grandparent; + Tztest.tztest + "Endorsement for grandparent on same slot as parent" + `Quick + test_endorsement_grandparent_same_slot; + Tztest.tztest + "Endorsement for grandparent in application mode" + `Quick + test_endorsement_grandparent_application; + Tztest.tztest + "Endorsement for grandparent in full construction mode" + `Quick + test_endorsement_grandparent_full_construction; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml new file mode 100644 index 000000000000..93c45c94b830 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -0,0 +1,718 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (frozen_deposits) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^frozen deposits$" + Subject: consistency of frozen deposits and the [set_deposits_limit] operation + *) + +open Protocol +open Alpha_context +open Test_tez + +let constants = + { + Default_parameters.constants_test with + endorsing_reward_per_slot = Tez.zero; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + consensus_threshold = 0; + origination_size = 0; + } + +let get_first_2_accounts_contracts (a1, a2) = + ((a1, Context.Contract.pkh a1), (a2, Context.Contract.pkh a2)) + +(* Terminology: + + - staking balance = full balance + delegated stake; obtained with + Delegate.staking_balance + + - active stake = the amount of tez with which a delegate participates in + consensus; it must be greater than [minimal_stake] and less or equal the staking + balance; it is computed in [Delegate_sampler.select_distribution_for_cycle] + + - frozen deposits = represents frozen_deposits_percentage of the maximum stake during + preserved_cycles + max_slashing_period cycles; obtained with + Delegate.current_frozen_deposits + + - spendable balance = full balance - frozen deposits; obtained with Contract.balance + + - full balance = spendable balance + frozen deposits; obtained with Delegate.full_balance +*) +let test_invariants () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (contract2, _account2) = + get_first_2_accounts_contracts contracts + in + Context.Delegate.staking_balance (B genesis) account1 + >>=? fun staking_balance -> + Context.Delegate.full_balance (B genesis) account1 >>=? fun full_balance -> + Context.Contract.balance (B genesis) contract1 >>=? fun spendable_balance -> + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun frozen_deposits -> + (* before delegation *) + Assert.equal_tez ~loc:__LOC__ full_balance staking_balance >>=? fun () -> + Assert.equal_tez + ~loc:__LOC__ + full_balance + Test_tez.(spendable_balance +! frozen_deposits) + >>=? fun () -> + (* to see how delegation plays a role, let's delegate to account1; + N.B. account2 represents a delegate so it cannot delegate to account1; this is + why we go through new_account as an intermediate *) + Context.Contract.balance (B genesis) contract2 >>=? fun spendable_balance2 -> + let new_account = (Account.new_account ()).pkh in + let new_contract = Contract.Implicit new_account in + (* we first put some money in new_account *) + Op.transaction + ~force_reveal:true + (B genesis) + contract2 + new_contract + spendable_balance2 + >>=? fun transfer -> + Block.bake ~operation:transfer genesis >>=? fun b -> + Context.Contract.balance (B b) new_contract >>=? fun new_account_balance -> + Assert.equal_tez ~loc:__LOC__ new_account_balance spendable_balance2 + >>=? fun () -> + Op.delegation ~force_reveal:true (B b) new_contract (Some account1) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b1 -> + Block.bake_until_n_cycle_end constants.preserved_cycles b1 >>=? fun b2 -> + Context.Delegate.staking_balance (B b2) account1 + >>=? fun new_staking_balance -> + Context.Delegate.full_balance (B b2) account1 >>=? fun new_full_balance -> + Context.Contract.balance (B b2) contract1 >>=? fun new_spendable_balance -> + Context.Delegate.current_frozen_deposits (B b2) account1 + >>=? fun new_frozen_deposits -> + (* after delegation, we see the delegated stake reflected in the new staking + balance of account1 *) + Assert.equal_tez + ~loc:__LOC__ + new_staking_balance + Test_tez.(new_full_balance +! new_account_balance) + >>=? fun () -> + Assert.equal_tez + ~loc:__LOC__ + new_full_balance + Test_tez.(new_spendable_balance +! new_frozen_deposits) + >>=? fun () -> + let expected_new_frozen_deposits = + Test_tez.( + (* in this particular example, if we follow the calculation of the active + stake, it is precisely the new_staking_balance *) + new_staking_balance /! 100L + *! Int64.of_int constants.frozen_deposits_percentage) + in + Assert.equal_tez ~loc:__LOC__ new_frozen_deposits expected_new_frozen_deposits + +let test_set_limit balance_percentage () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (_contract2, account2) = + get_first_2_accounts_contracts contracts + in + (Context.Delegate.frozen_deposits_limit (B genesis) account1 >>=? function + | Some _ -> Alcotest.fail "unexpected deposits limit" + | None -> return_unit) + >>=? fun () -> + (* Test deposit consistency before and after first cycle *) + Context.Delegate.full_balance (B genesis) account1 >>=? fun full_balance -> + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun frozen_deposits -> + let expected_deposits = + full_balance *! Int64.of_int constants.frozen_deposits_percentage /! 100L + in + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_deposits >>=? fun () -> + (* Bake until end of first cycle *) + Block.bake_until_cycle_end genesis >>=? fun b -> + Context.Delegate.full_balance (B genesis) account1 >>=? fun full_balance -> + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun frozen_deposits -> + let expected_deposits = + full_balance *! Int64.of_int constants.frozen_deposits_percentage /! 100L + in + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_deposits >>=? fun () -> + (* set deposits limit to balance_percentage out of the balance *) + let limit = + Test_tez.(full_balance *! Int64.of_int balance_percentage /! 100L) + in + Op.set_deposits_limit (B genesis) contract1 (Some limit) >>=? fun operation -> + Block.bake ~policy:(By_account account2) ~operation b >>=? fun b -> + (Context.Delegate.frozen_deposits_limit (B b) account1 >>=? function + | Some set_limit -> Assert.equal_tez ~loc:__LOC__ set_limit limit + | None -> Alcotest.fail "unexpected absence of deposits limit") + >>=? fun () -> + (* the frozen deposits limit affects the active stake for cycles starting with c + + preserved_cycles + 1; the new active stake is taken into account when + computing the frozen deposits for cycle c+1 already, however the user may see + an update to its frozen deposits at cycle c + preserved_cycles + + max_slashing_period at the latest (because up to that cycle the frozen + deposits also depend on the active stake at cycles before cycle c+1). *) + let expected_number_of_cycles_with_previous_deposit = + constants.preserved_cycles + constants.max_slashing_period + in + Block.bake_until_n_cycle_end + ~policy:(By_account account2) + (expected_number_of_cycles_with_previous_deposit - 1) + b + >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.not_equal_tez ~loc:__LOC__ frozen_deposits Tez.zero >>=? fun () -> + Block.bake_until_cycle_end ~policy:(By_account account2) b >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits limit + +let test_set_too_high_limit () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, _account1), _ = get_first_2_accounts_contracts contracts in + let max_limit = + Tez.of_mutez_exn + Int64.( + add + (mul + (of_int constants.frozen_deposits_percentage) + Int64.(div max_int 100L)) + 1L) + in + let expect_apply_failure = function + | Environment.Ecoproto_error err :: _ -> + Assert.test_error_encodings err ; + let error_info = + Error_monad.find_info_of_error (Environment.wrap_tzerror err) + in + if error_info.title = "Set deposits limit to a too high value" then + return_unit + else failwith "unexpected error" + | _ -> failwith "should fail" + in + Incremental.begin_construction genesis >>=? fun b -> + Op.set_deposits_limit (B genesis) contract1 (Some max_limit) + >>=? fun operation -> + Incremental.add_operation ~expect_apply_failure b operation >>=? fun b -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +let test_unset_limit () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (_contract2, account2) = + get_first_2_accounts_contracts contracts + in + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun frozen_deposits_at_genesis -> + (* set the limit to 0 *) + Op.set_deposits_limit (B genesis) contract1 (Some Tez.zero) + >>=? fun operation -> + Block.bake ~policy:(By_account account2) ~operation genesis >>=? fun b -> + (Context.Delegate.frozen_deposits_limit (B b) account1 >>=? function + | Some set_limit -> Assert.equal_tez ~loc:__LOC__ set_limit Tez.zero + | None -> Alcotest.fail "unexpected absence of deposits limit") + >>=? fun () -> + let expected_number_of_cycles_with_previous_deposit = + constants.preserved_cycles + constants.max_slashing_period + in + Block.bake_until_n_cycle_end + ~policy:(By_account account2) + expected_number_of_cycles_with_previous_deposit + b + >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits_at_b -> + (* after [expected_number_of_cycles_with_previous_deposit] cycles + the 0 limit is reflected in the deposit which becomes 0 itself *) + Assert.equal_tez ~loc:__LOC__ frozen_deposits_at_b Tez.zero >>=? fun () -> + (* unset the 0 limit *) + Op.set_deposits_limit (B b) contract1 None >>=? fun operation -> + Block.bake ~policy:(By_account account2) ~operation b >>=? fun b -> + (Context.Delegate.frozen_deposits_limit (B b) account1 >>=? function + | Some _ -> Alcotest.fail "unexpected deposits limit" + | None -> return_unit) + >>=? fun () -> + (* removing the 0 limit is visible once the cycle ends *) + Block.bake_until_cycle_end ~policy:(By_account account2) b >>=? fun bfin -> + Context.Delegate.current_frozen_deposits (B bfin) account1 + >>=? fun frozen_deposits_at_bfin -> + (* without a limit, the new deposit matches the one at genesis; note + that account1 hasn't baked any block so its stake did not change. *) + Assert.equal_tez + ~loc:__LOC__ + frozen_deposits_at_bfin + frozen_deposits_at_genesis + >>=? fun () -> return_unit + +let test_cannot_bake_with_zero_deposits () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (_contract2, account2) = + get_first_2_accounts_contracts contracts + in + (* N.B. there is no non-zero frozen deposits value for which one cannot bake: + even with a small deposit one can still bake, though with a smaller probability + (because the frozen deposits value impacts the active stake and the active + stake is the one used to determine baking/endorsing rights. *) + Op.set_deposits_limit (B genesis) contract1 (Some Tez.zero) + >>=? fun operation -> + Block.bake ~policy:(By_account account2) ~operation genesis >>=? fun b -> + let expected_number_of_cycles_with_previous_deposit = + constants.preserved_cycles + constants.max_slashing_period - 1 + in + Block.bake_until_n_cycle_end + ~policy:(By_account account2) + expected_number_of_cycles_with_previous_deposit + b + >>=? fun b -> + Block.bake ~policy:(By_account account1) b >>= fun b1 -> + (* by now, the active stake of account1 is 0 so it no longer has slots, thus it + cannot be a proposer, thus it cannot bake. Precisely, bake fails because + get_next_baker_by_account fails with "No slots found" *) + Assert.error ~loc:__LOC__ b1 (fun _ -> true) >>=? fun () -> + Block.bake_until_cycle_end ~policy:(By_account account2) b >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 >>=? fun fd -> + Assert.equal_tez ~loc:__LOC__ fd Tez.zero >>=? fun () -> + Block.bake ~policy:(By_account account1) b >>= fun b1 -> + (* don't know why the zero frozen deposits error is not caught here *) + (* Assert.proto_error_with_info ~loc:__LOC__ b1 "Zero frozen deposits" *) + Assert.error ~loc:__LOC__ b1 (fun _ -> true) + +let test_deposits_after_stake_removal () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (contract2, account2) = + get_first_2_accounts_contracts contracts + in + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun initial_frozen_deposits_1 -> + Context.Delegate.current_frozen_deposits (B genesis) account2 + >>=? fun initial_frozen_deposits_2 -> + let expected_new_frozen_deposits_2 = + Test_tez.(initial_frozen_deposits_2 *! 3L /! 2L) + in + (* Move half the account1's balance to account2 *) + Context.Delegate.full_balance (B genesis) account1 >>=? fun full_balance -> + let half_balance = Test_tez.(full_balance /! 2L) in + Op.transaction (B genesis) contract1 contract2 half_balance + >>=? fun operation -> + Block.bake ~operation genesis >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits_1 -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits_1 initial_frozen_deposits_1 + >>=? fun () -> + Context.Delegate.current_frozen_deposits (B b) account2 + >>=? fun frozen_deposits_2 -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits_2 initial_frozen_deposits_2 + >>=? fun () -> + (* Bake a cycle to act account2's new frozen deposits *) + Block.bake_until_cycle_end b >>=? fun b -> + let rec loop b n = + if n = 0 then return b + else + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits_1 -> + (* the frozen_deposits is frozen_deposits_percentage of the maximum active stake + during the last preserved_cycles + max_slashing_period cycles; + consequently, though the active stake of account1 has decreased at + cycle c, this decrease makes the frozen deposits smaller only after + preserved cycles + max_slashing_period. *) + Assert.equal_tez ~loc:__LOC__ frozen_deposits_1 initial_frozen_deposits_1 + >>=? fun () -> + (* the active stake of account2 has increased and this increase affects + the frozen_deposits from this cycle as it is greater than previous ones. *) + Context.Delegate.current_frozen_deposits (B b) account2 + >>=? fun frozen_deposits_2 -> + Assert.equal_tez + ~loc:__LOC__ + frozen_deposits_2 + expected_new_frozen_deposits_2 + >>=? fun () -> + Block.bake_until_cycle_end b >>=? fun b -> loop b (pred n) + in + (* the frozen deposits for account1 do not change until [preserved cycles + + max_slashing_period] are baked (-1 because we already baked a cycle) *) + loop b (constants.preserved_cycles + constants.max_slashing_period - 1) + >>=? fun b -> + (* after preserved cycles + max_slashing_period, the frozen_deposits for account1 + reflects the decrease in account1's active stake. *) + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits_1 -> + Assert.equal_tez + ~loc:__LOC__ + frozen_deposits_1 + Test_tez.(initial_frozen_deposits_1 /! 2L) + >>=? fun () -> + Context.Delegate.current_frozen_deposits (B b) account2 + >>=? fun frozen_deposits_2 -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits_2 expected_new_frozen_deposits_2 + +let test_unfreeze_deposits_after_deactivation () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (_contract2, account2) = + get_first_2_accounts_contracts contracts + in + Context.Delegate.full_balance (B genesis) account1 >>=? fun initial_balance -> + (* [account1] will not participate (ie bake/endorse); we set the + expected last cycles at which it is considered active and at + which it has non-zero deposits *) + let last_active_cycle = + 1 + (2 * constants.preserved_cycles) + (* according to [Delegate_storage.set_active] *) + in + let last_cycle_with_deposits = + last_active_cycle + constants.preserved_cycles + + constants.max_slashing_period + (* according to [Delegate_storage.freeze_deposits] *) + in + let cycles_to_bake = last_cycle_with_deposits + constants.preserved_cycles in + let rec loop b n = + if n = 0 then return b + else + Block.bake_until_cycle_end ~policy:(By_account account2) b >>=? fun b -> + Context.Delegate.deactivated (B b) account1 >>=? fun is_deactivated -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + (* the spendable balance *) + Context.Contract.balance (B b) contract1 >>=? fun balance -> + let new_cycle = cycles_to_bake - n + 1 in + Assert.equal_bool + ~loc:__LOC__ + is_deactivated + (new_cycle > last_active_cycle) + >>=? fun () -> + Assert.equal_bool + ~loc:__LOC__ + (new_cycle > last_cycle_with_deposits) + (* as soon as frozen_deposits are set to zero from a non-zero value v, v is + returned to the spendable balance of account1; in this particular + case, the spendable balance [balance] updated with v is precisely the + initial_balance.*) + (Tez.(frozen_deposits = zero) && Tez.(balance = initial_balance)) + >>=? fun () -> loop b (pred n) + in + loop genesis cycles_to_bake >>=? fun (_b : Block.t) -> return_unit + +let test_frozen_deposits_with_delegation () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (_contract1, account1), (contract2, account2) = + get_first_2_accounts_contracts contracts + in + Context.Delegate.staking_balance (B genesis) account1 + >>=? fun initial_staking_balance -> + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun initial_frozen_deposits -> + Context.Contract.balance (B genesis) contract2 >>=? fun delegated_amount -> + let new_account = Account.new_account () in + let new_contract = Contract.Implicit new_account.pkh in + Op.transaction + ~force_reveal:true + (B genesis) + contract2 + new_contract + delegated_amount + >>=? fun transfer -> + Block.bake ~operation:transfer genesis >>=? fun b -> + Context.Delegate.staking_balance (B b) account2 + >>=? fun new_staking_balance -> + let expected_new_staking_balance = + Test_tez.(initial_staking_balance -! delegated_amount) + in + Assert.equal_tez ~loc:__LOC__ new_staking_balance expected_new_staking_balance + >>=? fun () -> + Op.delegation ~force_reveal:true (B b) new_contract (Some account1) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + let expected_new_staking_balance = + Test_tez.(initial_staking_balance +! delegated_amount) + in + Context.Delegate.staking_balance (B b) account1 + >>=? fun new_staking_balance -> + Assert.equal_tez ~loc:__LOC__ new_staking_balance expected_new_staking_balance + >>=? fun () -> + (* Bake one cycle to update the frozen deposits *) + Block.bake_until_cycle_end b >>=? fun b -> + let expected_new_frozen_deposits = + Test_tez.( + initial_frozen_deposits + +! delegated_amount + *! Int64.of_int constants.frozen_deposits_percentage + /! 100L) + in + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun new_frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ new_frozen_deposits expected_new_frozen_deposits + >>=? fun () -> + let cycles_to_bake = + 2 * (constants.preserved_cycles + constants.max_slashing_period) + in + let rec loop b n = + if n = 0 then return b + else + Block.bake_until_cycle_end ~policy:(By_account account1) b >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_new_frozen_deposits + >>=? fun () -> loop b (pred n) + in + (* Check that frozen deposits do not change for a sufficient period of + time *) + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit + +let test_frozen_deposits_with_overdelegation () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (contract2, account2) = + get_first_2_accounts_contracts contracts + in + (* - [account1] and [account2] give their spendable balance to [new_account] + - [new_account] overdelegates to [account1] *) + Context.Delegate.staking_balance (B genesis) account1 + >>=? fun initial_staking_balance -> + Context.Delegate.staking_balance (B genesis) account2 + >>=? fun initial_staking_balance' -> + Context.Delegate.current_frozen_deposits (B genesis) account1 + >>=? fun initial_frozen_deposits -> + Context.Contract.balance (B genesis) contract1 >>=? fun amount -> + Context.Contract.balance (B genesis) contract2 >>=? fun amount' -> + let new_account = (Account.new_account ()).pkh in + let new_contract = Contract.Implicit new_account in + Op.transaction ~force_reveal:true (B genesis) contract1 new_contract amount + >>=? fun transfer1 -> + Op.transaction ~force_reveal:true (B genesis) contract2 new_contract amount' + >>=? fun transfer2 -> + Block.bake ~operations:[transfer1; transfer2] genesis >>=? fun b -> + let expected_new_staking_balance = + Test_tez.(initial_staking_balance -! amount) + in + Context.Delegate.staking_balance (B b) account1 + >>=? fun new_staking_balance -> + Assert.equal_tez ~loc:__LOC__ new_staking_balance expected_new_staking_balance + >>=? fun () -> + let expected_new_staking_balance' = + Test_tez.(initial_staking_balance' -! amount') + in + Context.Delegate.staking_balance (B b) account2 + >>=? fun new_staking_balance' -> + Assert.equal_tez + ~loc:__LOC__ + new_staking_balance' + expected_new_staking_balance' + >>=? fun () -> + Op.delegation ~force_reveal:true (B b) new_contract (Some account1) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + Context.Delegate.staking_balance (B b) account1 + >>=? fun new_staking_balance -> + let expected_new_staking_balance = + Test_tez.(initial_frozen_deposits +! amount +! amount') + in + Assert.equal_tez ~loc:__LOC__ new_staking_balance expected_new_staking_balance + >>=? fun () -> + (* Finish the cycle to update the frozen deposits *) + Block.bake_until_cycle_end b >>=? fun b -> + Context.Delegate.full_balance (B b) account1 + >>=? fun expected_new_frozen_deposits -> + (* the equality follows from the definition of active stake in + [Delegate_sampler.select_distribution_for_cycle]. *) + assert (initial_frozen_deposits = expected_new_frozen_deposits) ; + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun new_frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ new_frozen_deposits expected_new_frozen_deposits + >>=? fun () -> + let cycles_to_bake = + 2 * (constants.preserved_cycles + constants.max_slashing_period) + in + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_new_frozen_deposits + >>=? fun () -> + let rec loop b n = + if n = 0 then return b + else + Block.bake_until_cycle_end ~policy:(By_account account1) b >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_new_frozen_deposits + >>=? fun () -> loop b (pred n) + in + (* Check that frozen deposits do not change for a sufficient period of + time *) + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit + +let test_set_limit_with_overdelegation () = + let constants = {constants with frozen_deposits_percentage = 10} in + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let (contract1, account1), (contract2, account2) = + get_first_2_accounts_contracts contracts + in + (* - [account1] and [account2] will give 80% of their balance to + [new_account] + - [new_account] will overdelegate to [account1] but [account1] will set + its frozen deposits limit to 15% of its stake *) + Context.Delegate.staking_balance (B genesis) account1 + >>=? fun initial_staking_balance -> + Context.Delegate.staking_balance (B genesis) account2 + >>=? fun initial_staking_balance' -> + let amount = Test_tez.(initial_staking_balance *! 8L /! 10L) in + let amount' = Test_tez.(initial_staking_balance' *! 8L /! 10L) in + let limit = Test_tez.(initial_staking_balance *! 15L /! 100L) in + let new_account = (Account.new_account ()).pkh in + let new_contract = Contract.Implicit new_account in + Op.transaction ~force_reveal:true (B genesis) contract1 new_contract amount + >>=? fun transfer1 -> + Op.transaction ~force_reveal:true (B genesis) contract2 new_contract amount' + >>=? fun transfer2 -> + Block.bake ~operations:[transfer1; transfer2] genesis >>=? fun b -> + Op.set_deposits_limit (B b) contract1 (Some limit) >>=? fun set_deposits -> + Block.bake ~operation:set_deposits b >>=? fun b -> + let expected_new_staking_balance = + Test_tez.(initial_staking_balance -! amount) + in + Context.Delegate.staking_balance (B b) account1 + >>=? fun new_staking_balance -> + Assert.equal_tez ~loc:__LOC__ new_staking_balance expected_new_staking_balance + >>=? fun () -> + let expected_new_staking_balance' = + Test_tez.(initial_staking_balance' -! amount') + in + Context.Delegate.staking_balance (B b) account2 + >>=? fun new_staking_balance' -> + Assert.equal_tez + ~loc:__LOC__ + new_staking_balance' + expected_new_staking_balance' + >>=? fun () -> + Op.delegation ~force_reveal:true (B b) new_contract (Some account1) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + (* Finish the cycle to update the frozen deposits *) + Block.bake_until_cycle_end b >>=? fun b -> + let expected_new_frozen_deposits = limit in + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_new_frozen_deposits + >>=? fun () -> + let cycles_to_bake = + 2 * (constants.preserved_cycles + constants.max_slashing_period) + in + let rec loop b n = + if n = 0 then return b + else + Block.bake_until_cycle_end ~policy:(By_account account1) b >>=? fun b -> + Context.Delegate.current_frozen_deposits (B b) account1 + >>=? fun frozen_deposits -> + Assert.equal_tez ~loc:__LOC__ frozen_deposits expected_new_frozen_deposits + >>=? fun () -> loop b (pred n) + in + (* Check that frozen deposits do not change for a sufficient period of + time *) + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit + +(** This test fails when [to_cycle] in [Delegate.freeze_deposits] is smaller than + [new_cycle + preserved_cycles]. *) +let test_error_is_thrown_when_smaller_upper_bound_for_frozen_window () = + Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> + let contract1, contract2 = contracts in + let account1 = Context.Contract.pkh contract1 in + (* [account2] delegates (through [new_account]) to [account1] its spendable + balance. The point is to make [account1] have a lot of staking balance so + that, after [preserved_cycles] when the active stake reflects this increase + in staking balance, its [maximum_stake_to_be_deposited] is bigger than the frozen + deposit which is computed on a smaller window because [to_cycle] is smaller + than [new_cycle + preserved_cycles]. *) + Context.Contract.balance (B genesis) contract2 >>=? fun delegated_amount -> + let new_account = Account.new_account () in + let new_contract = Contract.Implicit new_account.pkh in + Op.transaction + ~force_reveal:true + (B genesis) + contract2 + new_contract + delegated_amount + >>=? fun transfer -> + Block.bake ~operation:transfer genesis >>=? fun b -> + Op.delegation ~force_reveal:true (B b) new_contract (Some account1) + >>=? fun delegation -> + Block.bake ~operation:delegation b >>=? fun b -> + Block.bake_until_cycle_end b >>=? fun b -> + (* After 1 cycle, namely, at cycle 2, [account1] transfers all its spendable + balance. *) + Context.Contract.balance (B b) contract1 >>=? fun balance1 -> + Op.transaction ~force_reveal:true (B b) contract1 contract2 balance1 + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Block.bake_until_n_cycle_end constants.preserved_cycles b + >>=? fun (_ : Block.t) -> + (* By this time, after [preserved_cycles] passed after [account1] has emptied + its spendable balance, because [account1] had a big staking balance at + cycle 0, at this cycle it has a big active stake, and so its + [maximum_stake_to_be_deposited] too is bigger than [frozen_deposits.current_amount], + so the variable [to_freeze] in [freeze_deposits] is positive. + Because the spendable balance of [account1] is 0, an error "Underflowing + subtraction" is raised at the end of the cycle when updating the balance by + subtracting [to_freeze] in [freeze_deposits]. + Note that by taking [to_cycle] is [new_cycle + preserved_cycles], + [frozen_deposits.current_amount] can no longer be smaller + than [maximum_stake_to_be_deposited], that is, the invariant + maximum_stake_to_be_deposited <= frozen_deposits + balance is preserved. + *) + return_unit + +let tests = + Tztest. + [ + tztest "test invariants" `Quick test_invariants; + tztest "set deposits limit to 0%" `Quick (test_set_limit 0); + tztest "set deposits limit to 5%" `Quick (test_set_limit 5); + tztest "set a too high deposits limit" `Quick test_set_too_high_limit; + tztest "unset deposits limit" `Quick test_unset_limit; + tztest + "cannot bake with zero deposits" + `Quick + test_cannot_bake_with_zero_deposits; + tztest + "deposits after stake removal" + `Quick + test_deposits_after_stake_removal; + tztest + "unfreeze deposits after deactivation" + `Quick + test_unfreeze_deposits_after_deactivation; + tztest + "frozen deposits with delegation" + `Quick + test_frozen_deposits_with_delegation; + tztest + "test frozen deposits with overdelegation" + `Quick + test_frozen_deposits_with_overdelegation; + tztest + "test set limit with overdelegation" + `Quick + test_set_limit_with_overdelegation; + tztest + "test error is thrown when the frozen window is smaller" + `Quick + test_error_is_thrown_when_smaller_upper_bound_for_frozen_window; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml new file mode 100644 index 000000000000..367aa44d4ecf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Helpers RPCs) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^helpers rpcs$" + Subject: On RPCs. +*) + +(* Test the baking_rights RPC. + Future levels or cycles are not tested because it's hard in this framework, + using only RPCs, to fabricate them. *) +let test_baking_rights () = + Context.init2 () >>=? fun (b, (c1, _c2)) -> + let open Plugin.RPC.Baking_rights in + (* default max_round returns 65 results *) + get Block.rpc_ctxt b ~all:true >>=? fun rights -> + assert (Compare.List_length_with.(rights = 65)) ; + (* arbitrary max_round *) + let max_round = 15 in + get Block.rpc_ctxt b ~all:true ~max_round >>=? fun rights -> + assert (Compare.List_length_with.(rights = max_round + 1)) ; + (* filtering by delegate *) + let d = Context.Contract.pkh c1 in + get Block.rpc_ctxt b ~all:true ~delegates:[d] >>=? fun rights -> + assert (List.for_all (fun {delegate; _} -> delegate = d) rights) ; + (* filtering by cycle *) + Plugin.RPC.current_level Block.rpc_ctxt b >>=? fun {cycle; _} -> + get Block.rpc_ctxt b ~all:true ~cycle >>=? fun rights -> + Plugin.RPC.levels_in_current_cycle Block.rpc_ctxt b >>=? fun (first, last) -> + assert ( + List.for_all (fun {level; _} -> level >= first && level <= last) rights) ; + (* filtering by level *) + Plugin.RPC.current_level Block.rpc_ctxt b >>=? fun {level; _} -> + get Block.rpc_ctxt b ~all:true ~levels:[level] >>=? fun rights -> + let expected_level = level in + assert (List.for_all (fun {level; _} -> level = expected_level) rights) ; + return_unit + +let tests = [Tztest.tztest "baking_rights" `Quick test_baking_rights] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml new file mode 100644 index 000000000000..edfa1f50b635 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml @@ -0,0 +1,205 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (participation monitoring) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^participation" + Subject: Participation monitoring in Tenderbake +*) + +open Protocol +open Alpha_context + +(** [baker] bakes and [endorser] endorses *) +let bake_and_endorse_once (_b_pred, b_cur) baker endorser = + let open Context in + Context.get_endorsers (B b_cur) >>=? fun endorsers_list -> + List.find_map + (function + | {Plugin.RPC.Validators.delegate; slots; _} -> + if Tezos_crypto.Signature.Public_key_hash.equal delegate endorser then + Some (delegate, slots) + else None) + endorsers_list + |> function + | None -> assert false + | Some (delegate, _slots) -> + Block.get_round b_cur >>?= fun round -> + Op.endorsement ~round ~delegate b_cur >>=? fun endorsement -> + Block.bake ~policy:(By_account baker) ~operation:endorsement b_cur + +(** We test that: + - a delegate that participates enough, gets its endorsing rewards at the end of the cycle, + - a delegate that does not participating enough during a cycle, doesn't get rewarded. + + The case distinction is made by the boolean argument [sufficient_participation]. + If [sufficient_participation] is true, + then a validator endorses for as long as the minimal required activity is not reached, + otherwise it does not endorse. + Finally, we check the validator's balance at the end of the cycle. +*) +let test_participation ~sufficient_participation () = + let n_accounts = 2 in + Context.init_n ~consensus_threshold:1 n_accounts () >>=? fun (b0, accounts) -> + Context.get_constants (B b0) >>=? fun csts -> + let blocks_per_cycle = Int32.to_int csts.parametric.blocks_per_cycle in + let mpr = csts.parametric.minimal_participation_ratio in + assert (blocks_per_cycle mod mpr.denominator = 0) ; + (* if this assertion does not hold, then the test might be incorrect *) + let committee_size = csts.parametric.consensus_committee_size in + let expected_nb_slots = blocks_per_cycle * committee_size / n_accounts in + let minimal_nb_active_slots = + mpr.numerator * expected_nb_slots / mpr.denominator + in + let account1, account2 = + match accounts with a1 :: a2 :: _ -> (a1, a2) | _ -> assert false + in + let del1 = Context.Contract.pkh account1 in + let del2 = Context.Contract.pkh account2 in + Block.bake ~policy:(By_account del1) b0 >>=? fun b1 -> + (* To separate concerns, only [del1] bakes: this way, we don't need to + consider baking rewards for [del2]. Delegate [del2] endorses only + if the target [minimal_nb_active_slots] is not reached; for the + rest, it is [del1] that endorses. *) + List.fold_left_es + (fun (b_pred, b_crt, endorsing_power) level -> + let int_level = Int32.of_int level in + Environment.wrap_tzresult (Raw_level.of_int32 int_level) >>?= fun level -> + Context.get_endorsing_power_for_delegate (B b_crt) ~levels:[level] del1 + >>=? fun endorsing_power_for_level -> + let endorser, new_endorsing_power = + if sufficient_participation && endorsing_power < minimal_nb_active_slots + then (del2, endorsing_power + endorsing_power_for_level) + else (del1, endorsing_power) + in + bake_and_endorse_once (b_pred, b_crt) del1 endorser >>=? fun b -> + return (b_crt, b, new_endorsing_power)) + (b0, b1, 0) + (2 -- (blocks_per_cycle - 1)) + >>=? fun (pred_b, b, _) -> + Context.Contract.balance (B pred_b) account2 >|=? Tez.to_mutez + >>=? fun bal2_at_pred_b -> + Context.Contract.balance (B b) account2 >|=? Tez.to_mutez + >>=? fun bal2_at_b -> + (* - If not sufficient_participation, we check that the balance of del2 at b is the + balance of del2 at pred_b; consequently, no rewards could have been given + to del2. + - If sufficient participation, we check that the balance of del2 at b is the + balance of del2 at pred_b plus the endorsing rewards. *) + Context.get_endorsing_reward (B b) ~expected_endorsing_power:expected_nb_slots + >|=? Tez.to_mutez + >>=? fun er -> + let endorsing_rewards = if sufficient_participation then er else 0L in + let expected_bal2_at_b = Int64.add bal2_at_pred_b endorsing_rewards in + Assert.equal_int64 ~loc:__LOC__ bal2_at_b expected_bal2_at_b + +(* We bake and endorse with 1 out of 2 accounts; we monitor the result + returned by the '../delegates/<pkh>/participation' RPC for the + non-participating account. *) +let test_participation_rpc () = + let n_accounts = 2 in + Context.init2 ~consensus_threshold:1 () >>=? fun (b0, (account1, account2)) -> + let del1 = Context.Contract.pkh account1 in + let del2 = Context.Contract.pkh account2 in + Context.get_constants (B b0) >>=? fun csts -> + let blocks_per_cycle = Int32.to_int csts.parametric.blocks_per_cycle in + let Ratio.{numerator; denominator} = + csts.parametric.minimal_participation_ratio + in + let expected_cycle_activity = + blocks_per_cycle * csts.parametric.consensus_committee_size / n_accounts + in + let minimal_cycle_activity = + expected_cycle_activity * numerator / denominator + in + let allowed_missed_slots = expected_cycle_activity - minimal_cycle_activity in + let expected_endorsing_rewards = + Tez.mul_exn + csts.parametric.endorsing_reward_per_slot + expected_cycle_activity + in + Block.bake ~policy:(By_account del1) b0 >>=? fun b1 -> + List.fold_left_es + (fun (b_pred, b_crt, total_endorsing_power) level_int -> + Context.Delegate.participation (B b_crt) del2 >>=? fun info -> + Assert.equal_int + ~loc:__LOC__ + info.expected_cycle_activity + expected_cycle_activity + >>=? fun () -> + Assert.equal_int + ~loc:__LOC__ + info.minimal_cycle_activity + minimal_cycle_activity + >>=? fun () -> + Assert.equal_int ~loc:__LOC__ info.missed_levels (level_int - 1) + >>=? fun () -> + let missed_slots = total_endorsing_power in + Assert.equal_int ~loc:__LOC__ info.missed_slots missed_slots + >>=? fun () -> + let remaining_allowed_missed_slots = + allowed_missed_slots - missed_slots + in + Assert.equal_int + ~loc:__LOC__ + info.remaining_allowed_missed_slots + (max 0 remaining_allowed_missed_slots) + >>=? fun () -> + let endorsing_rewards = + if remaining_allowed_missed_slots >= 0 then expected_endorsing_rewards + else Tez.zero + in + Assert.equal_tez + ~loc:__LOC__ + info.expected_endorsing_rewards + endorsing_rewards + >>=? fun () -> + bake_and_endorse_once (b_pred, b_crt) del1 del1 >>=? fun b -> + (* [level_int] is the level of [b_crt] *) + level_int |> Int32.of_int |> Raw_level.of_int32 + |> Environment.wrap_tzresult + >>?= fun level -> + Context.get_endorsing_power_for_delegate (B b_crt) ~levels:[level] del2 + >>=? fun endorsing_power -> + return (b_crt, b, total_endorsing_power + endorsing_power)) + (b0, b1, 0) + (1 -- (blocks_per_cycle - 2)) + >>=? fun (_, _, _) -> return_unit + +let tests = + [ + Tztest.tztest + "test insufficient participation" + `Quick + (test_participation ~sufficient_participation:false); + Tztest.tztest + "test minimal participation" + `Quick + (test_participation ~sufficient_participation:true); + Tztest.tztest "test participation RPC" `Quick test_participation_rpc; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml new file mode 100644 index 000000000000..54e62f8b256a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml @@ -0,0 +1,246 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (preendorsement) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^preendorsement$" +*) + +open Protocol +open Alpha_context + +(****************************************************************) +(* Utility functions *) +(****************************************************************) + +let init_genesis ?policy () = + Context.init_n ~consensus_threshold:0 5 () >>=? fun (genesis, _contracts) -> + Block.bake ?policy genesis >>=? fun b -> return (genesis, b) + +(****************************************************************) +(* Tests *) +(****************************************************************) + +(** Consensus operation for future level : apply a preendorsement with a level in the future *) +let test_consensus_operation_preendorsement_for_future_level () = + init_genesis () >>=? fun (_genesis, pred) -> + let raw_level = Raw_level.of_int32 (Int32.of_int 10) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_future_level {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for old level : apply a preendorsement with a level in the past *) +let test_consensus_operation_preendorsement_for_old_level () = + init_genesis () >>=? fun (_genesis, pred) -> + let raw_level = Raw_level.of_int32 (Int32.of_int 0) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~level + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_level {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for future round : apply a preendorsement with a round in the future *) +let test_consensus_operation_preendorsement_for_future_round () = + init_genesis () >>=? fun (_genesis, pred) -> + Environment.wrap_tzresult (Round.of_int 21) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~round + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_future_round {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation for old round : apply a preendorsement with a round in the past *) +let test_consensus_operation_preendorsement_for_old_round () = + init_genesis ~policy:(By_round 10) () >>=? fun (_genesis, pred) -> + Environment.wrap_tzresult (Round.of_int 0) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~round + ~error:(function + | Validate_errors.Consensus.Consensus_operation_for_old_round {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Consensus operation on competing proposal : apply a preendorsement on a competing proposal *) +let test_consensus_operation_preendorsement_on_competing_proposal () = + init_genesis () >>=? fun (_genesis, pred) -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~block_payload_hash:Block_payload_hash.zero + ~error:(function + | Validate_errors.Consensus.Wrong_payload_hash_for_consensus_operation + {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + ~construction_mode:(pred, None) + () + +(** Unexpected preendorsements in block : apply a preendorsement with an incorrect round *) +let test_unexpected_preendorsements_in_blocks () = + init_genesis () >>=? fun (_genesis, pred) -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~error:(function + | Validate_errors.Consensus.Unexpected_preendorsement_in_block -> true + | _ -> false) + () + +(** Round too high : apply a preendorsement with a too high round *) +let test_too_high_round () = + init_genesis () >>=? fun (_genesis, pred) -> + let raw_level = Raw_level.of_int32 (Int32.of_int 2) in + let level = match raw_level with Ok l -> l | Error _ -> assert false in + Environment.wrap_tzresult (Round.of_int 1) >>?= fun round -> + Consensus_helpers.test_consensus_operation + ~loc:__LOC__ + ~is_preendorsement:true + ~endorsed_block:pred + ~round + ~level + ~error:(function + | Validate_errors.Consensus.Preendorsement_round_too_high _ -> true + | _ -> false) + ~construction_mode:(pred, Some pred.header.protocol_data) + () + +(** Duplicate preendorsement : apply a preendorsement that has already been applied. *) +let test_duplicate_preendorsement () = + init_genesis () >>=? fun (genesis, _) -> + Block.bake genesis >>=? fun b -> + Incremental.begin_construction ~mempool_mode:true b >>=? fun inc -> + Op.preendorsement b >>=? fun operation -> + Incremental.add_operation inc operation >>=? fun inc -> + Op.preendorsement b >>=? fun operation -> + Incremental.add_operation inc operation >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + "Double inclusion of consensus operation" + +(** Preendorsement for next level *) +let test_preendorsement_for_next_level () = + init_genesis () >>=? fun (genesis, _) -> + Consensus_helpers.test_consensus_op_for_next + ~genesis + ~kind:`Preendorsement + ~next:`Level + +(** Preendorsement for next round *) +let test_preendorsement_for_next_round () = + init_genesis () >>=? fun (genesis, _) -> + Consensus_helpers.test_consensus_op_for_next + ~genesis + ~kind:`Preendorsement + ~next:`Round + +let tests = + let module AppMode = Test_preendorsement_functor.BakeWithMode (struct + let name = "AppMode" + + let baking_mode = Block.Application + end) in + let module ConstrMode = Test_preendorsement_functor.BakeWithMode (struct + let name = "ConstrMode" + + let baking_mode = Block.Baking + end) in + AppMode.tests @ ConstrMode.tests + @ [ + Tztest.tztest + "Preendorsement for future level" + `Quick + test_consensus_operation_preendorsement_for_future_level; + Tztest.tztest + "Preendorsement for old level" + `Quick + test_consensus_operation_preendorsement_for_old_level; + Tztest.tztest + "Preendorsement for future round" + `Quick + test_consensus_operation_preendorsement_for_future_round; + Tztest.tztest + "Preendorsement for old round" + `Quick + test_consensus_operation_preendorsement_for_old_round; + Tztest.tztest + "Preendorsement on competing proposal" + `Quick + test_consensus_operation_preendorsement_on_competing_proposal; + Tztest.tztest + "Unexpected preendorsements in blocks" + `Quick + test_unexpected_preendorsements_in_blocks; + Tztest.tztest "Preendorsements round too high" `Quick test_too_high_round; + Tztest.tztest + "Duplicate preendorsement" + `Quick + test_duplicate_preendorsement; + Tztest.tztest + "Preendorsement for next level" + `Quick + test_preendorsement_for_next_level; + Tztest.tztest + "Preendorsement for next round" + `Quick + test_preendorsement_for_next_round; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml new file mode 100644 index 000000000000..1b70fc2779f5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml @@ -0,0 +1,300 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (preendorsement) in Full_construction & Application modes + Subject: preendorsement inclusion in a block +*) + +open Protocol +open Alpha_context + +(****************************************************************) +(* Utility functions *) +(****************************************************************) +module type MODE = sig + val name : string + + val baking_mode : Block.baking_mode +end + +module BakeWithMode (Mode : MODE) : sig + val tests : unit Alcotest_lwt.test_case trace +end = struct + let name = Mode.name + + let bake = Block.bake ~baking_mode:Mode.baking_mode + + let aux_simple_preendorsement_inclusion ?(payload_round = Some Round.zero) + ?(locked_round = Some Round.zero) ?(block_round = 1) + ?(preend_round = Round.zero) + ?(preend_branch = fun _predpred pred _curr -> pred) + ?(preendorsed_block = fun _predpred _pred curr -> curr) + ?(mk_ops = fun op -> [op]) + ?(get_delegate_and_slot = + fun _predpred _pred _curr -> return (None, None)) + ?(post_process = Ok (fun _ -> return_unit)) ~loc () = + Context.init_n ~consensus_threshold:1 5 () >>=? fun (genesis, _contracts) -> + bake genesis >>=? fun b1 -> + Op.endorsement b1 >>=? fun endo -> + bake b1 ~operations:[endo] >>=? fun b2 -> + let pred_branch = + Some (Context.branch (Context.B (preend_branch genesis b1 b2))) + in + let endorsed_block = preendorsed_block genesis b1 b2 in + get_delegate_and_slot genesis b1 b2 >>=? fun (delegate, slot) -> + Op.preendorsement + ?delegate + ?slot + ?pred_branch + ~round:preend_round + endorsed_block + >>=? fun p -> + let operations = endo :: (mk_ops @@ p) in + bake + ~payload_round + ~locked_round + ~policy:(By_round block_round) + ~operations + b1 + >>= fun res -> + match (res, post_process) with + | Ok ok, Ok success_fun -> success_fun ok + | Error _, Error error -> Assert.proto_error ~loc res error + | Ok _, Error _ -> Assert.error ~loc res (fun _ -> false) + | Error _, Ok _ -> Assert.error ~loc res (fun _ -> false) + + (****************************************************************) + (* Tests *) + (****************************************************************) + + (** OK: bake a block "_b2_1" at round 1, containing a PQC and a locked + round of round 0 *) + let include_preendorsement_in_block_with_locked_round () = + aux_simple_preendorsement_inclusion ~loc:__LOC__ () + + (** KO: bake a block "_b2_1" at round 1, containing a PQC and a locked + round of round 0. But the preendorsement is on a bad branch *) + let test_preendorsement_with_bad_branch () = + aux_simple_preendorsement_inclusion + (* preendorsement should be on branch _pred to be valid *) + ~preend_branch:(fun predpred _pred _curr -> predpred) + ~loc:__LOC__ + ~post_process: + (Error + (function + | Validate_errors.Consensus.Wrong_consensus_operation_branch + {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false)) + () + + (** KO: The same preendorsement injected twice in the PQC *) + let duplicate_preendorsement_in_pqc () = + aux_simple_preendorsement_inclusion (* inject the op twice *) + ~mk_ops:(fun op -> [op; op]) + ~loc:__LOC__ + ~post_process: + (Error + (function + | Validate_errors.Consensus.Conflicting_consensus_operation {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false)) + () + + (** KO: locked round declared in the block is not smaller than + that block's round *) + let locked_round_not_before_block_round () = + aux_simple_preendorsement_inclusion + (* default locked_round = 0 < block_round = 1 for this aux function *) + ~block_round:0 + ~loc:__LOC__ + ~post_process: + (Error + (function + | Fitness_repr.Locked_round_not_less_than_round _ -> true + | _ -> false)) + () + + (** KO: because we announce a locked_round, but we don't provide the + preendorsement quorum certificate in the operations *) + let with_locked_round_in_block_but_without_any_pqc () = + (* This test only fails in Application mode. If full_construction mode, the + given locked_round is not used / checked. Moreover, the test succeed in + this case. + *) + let post_process = + if Mode.baking_mode == Block.Application then + Error (function Fitness_repr.Wrong_fitness -> true | _ -> false) + else Ok (fun _ -> return_unit) + in + aux_simple_preendorsement_inclusion + (* with declared locked_round but without a PQC in the ops *) + ~mk_ops:(fun _p -> []) + ~loc:__LOC__ + ~post_process + () + + (** KO: The preendorsed block is the pred one, not the current one *) + let preendorsement_has_wrong_level () = + aux_simple_preendorsement_inclusion + (* preendorsement should be for _curr block to be valid *) + ~preendorsed_block:(fun _predpred pred _curr -> pred) + ~loc:__LOC__ + ~post_process: + (Error + (function + | Validate_errors.Consensus.Consensus_operation_for_old_level + {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false)) + () + + (** OK: explicit the correct endorser and preendorsing slot in the test *) + let preendorsement_in_block_with_good_slot () = + aux_simple_preendorsement_inclusion + ~get_delegate_and_slot:(fun _predpred _pred curr -> + let module V = Plugin.RPC.Validators in + Context.get_endorsers (B curr) >>=? function + | {V.delegate; slots = s :: _; _} :: _ -> return (Some delegate, Some s) + | _ -> assert false + (* there is at least one endorser with a slot *)) + ~loc:__LOC__ + () + + (** KO: the used slot for injecting the endorsement is not the canonical one *) + let preendorsement_in_block_with_wrong_slot () = + aux_simple_preendorsement_inclusion + ~get_delegate_and_slot:(fun _predpred _pred curr -> + let module V = Plugin.RPC.Validators in + Context.get_endorsers (B curr) >>=? function + | {V.delegate; V.slots = _ :: non_canonical_slot :: _; _} :: _ -> + return (Some delegate, Some non_canonical_slot) + | _ -> assert false + (* there is at least one endorser with a slot *)) + ~loc:__LOC__ + ~post_process: + (Error + (function + | Validate_errors.Consensus.Wrong_slot_used_for_consensus_operation + {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false)) + () + + (** KO: the delegate tries to injects with a canonical slot of another delegate *) + let preendorsement_in_block_with_wrong_signature () = + aux_simple_preendorsement_inclusion + ~get_delegate_and_slot:(fun _predpred _pred curr -> + let module V = Plugin.RPC.Validators in + Context.get_endorsers (B curr) >>=? function + | {V.delegate; _} :: {V.slots = s :: _; _} :: _ -> + (* the canonical slot s is not owned by the delegate "delegate" !*) + return (Some delegate, Some s) + | _ -> assert false + (* there is at least one endorser with a slot *)) + ~loc:__LOC__ + ~post_process: + (Error + (function Operation_repr.Invalid_signature -> true | _ -> false)) + () + + (** KO: cannot have a locked_round higher than attached PQC's round *) + let locked_round_is_higher_than_pqc_round () = + (* This test only fails in Application mode. If full_construction mode, the + given locked_round is not used / checked. Moreover, the test succeed in + this case. + *) + let post_process = + if Mode.baking_mode == Application then + Error + (function + | Validate_errors.Consensus.Consensus_operation_for_old_round + {kind; _} + when kind = Validate_errors.Consensus.Preendorsement -> + true + | _ -> false) + else Ok (fun _ -> return_unit) + in + aux_simple_preendorsement_inclusion + ~preend_round:Round.zero + ~locked_round:(Some (Round.succ Round.zero)) + ~block_round:2 + ~loc:__LOC__ + ~post_process + () + + let my_tztest title test = + Tztest.tztest (Format.sprintf "%s: %s" name title) test + + let tests = + [ + my_tztest + "ok: include_preendorsement_in_block_with_locked_round" + `Quick + include_preendorsement_in_block_with_locked_round; + my_tztest + "ko: test_preendorsement_with_bad_branch" + `Quick + test_preendorsement_with_bad_branch; + my_tztest + "ko: duplicate_preendorsement_in_pqc" + `Quick + duplicate_preendorsement_in_pqc; + my_tztest + "ko:locked_round_not_before_block_round" + `Quick + locked_round_not_before_block_round; + my_tztest + "ko: with_locked_round_in_block_but_without_any_pqc" + `Quick + with_locked_round_in_block_but_without_any_pqc; + my_tztest + "ko: preendorsement_has_wrong_level" + `Quick + preendorsement_has_wrong_level; + my_tztest + "ok: preendorsement_in_block_with_good_slot" + `Quick + preendorsement_in_block_with_good_slot; + my_tztest + "ko: preendorsement_in_block_with_wrong_slot" + `Quick + preendorsement_in_block_with_wrong_slot; + my_tztest + "ko: preendorsement_in_block_with_wrong_signature" + `Quick + preendorsement_in_block_with_wrong_signature; + my_tztest + "ko: locked_round_is_higher_than_pqc_round" + `Quick + locked_round_is_higher_than_pqc_round; + ] +end diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml new file mode 100644 index 000000000000..d737eeb9fc78 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml @@ -0,0 +1,645 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (seed) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- test "^seed$" + Subject: - seed_nonce_hash included in some blocks + - revelation operation of seed_nonce that should correspond + to each seed_nonce_hash +*) + +open Protocol +open Lwt_result_syntax + +(** Checking that, in the absence of nonce revelations and VDF computation, + the seed of each cycle is correctly computed based on the seed of + the previous cycle. *) +let test_seed_no_commitment () = + let n_cycles = 15 in + let (Hash initial_seed) = + let empty_bytes = Bytes.(copy empty) in + Tezos_crypto.Hacl.Blake2b.direct empty_bytes Nonce_hash.size + in + let seeds = + (* compute the first `n_cycles` expected seeds *) + let zero_bytes = Bytes.make Nonce_hash.size '\000' in + let rec make_seeds s = function + | 0 -> [] + | n -> + let (Hash h) = + Tezos_crypto.Hacl.Blake2b.direct + (Bytes.cat s zero_bytes) + Nonce_hash.size + in + h :: make_seeds h (n - 1) + in + make_seeds initial_seed n_cycles + in + let check_seed b expected_seed = + let open Alpha_context in + let* s = Context.get_seed (B b) in + let seed_bytes = Data_encoding.Binary.to_bytes_exn Seed.seed_encoding s in + (if expected_seed <> seed_bytes then + let seed_pp = + Hex.show + (Hex.of_string + (Data_encoding.Binary.to_string_exn Seed.seed_encoding s)) + in + let expected_seed_pp = Hex.show (Hex.of_bytes expected_seed) in + Stdlib.failwith + (Format.sprintf "Seed: %s\nExpected: %s\n\n" seed_pp expected_seed_pp)) ; + return b + in + let rec bake_and_check_seed b = function + | [] -> return b + | s :: seeds -> + let* b = Block.bake_until_cycle_end b in + let* b = check_seed b s in + let* b = Block.bake_n 2 b in + bake_and_check_seed b seeds + in + let* b, _delegates = + Context.init3 + ~blocks_per_cycle:8l + ~consensus_threshold:0 + ~nonce_revelation_threshold:2l + () + in + let* b = check_seed b initial_seed in + let* (_ : Block.t) = bake_and_check_seed b seeds in + return_unit + +(** Baking [blocks_per_commitment] blocks without a [seed_nonce_hash] + commitment fails with an "Invalid commitment in block header" error. *) +let test_no_commitment () = + let* b, _contracts = Context.init_n ~consensus_threshold:0 5 () in + let* {parametric = {blocks_per_commitment; _}; _} = + Context.get_constants (B b) + in + let blocks_per_commitment = Int32.to_int blocks_per_commitment in + (* Bake normally until before the commitment *) + let* b = Block.bake_n (blocks_per_commitment - 2) b in + (* Forge a block with empty commitment and apply it *) + let* header = Block.Forge.forge_header b in + let* header = + Block.Forge.set_seed_nonce_hash None header |> Block.Forge.sign_header + in + let*! e = Block.apply header b in + Assert.proto_error_with_info + ~loc:__LOC__ + e + "Invalid commitment in block header" + +(** Choose a baker, denote it by id. In the first cycle, make id bake only once. + Check that: + - when id reveals the nonce too early, there's an error + - when id reveals at the right time but the wrong value, there's an error + - when another baker reveals correctly, it receives the tip + - revealing twice produces an error *) +let test_revelation_early_wrong_right_twice () = + let open Assert in + let* b, _contracts = Context.init_n ~consensus_threshold:0 5 () in + let* csts = Context.get_constants (B b) in + let tip = csts.parametric.seed_nonce_revelation_tip in + let blocks_per_commitment = + Int32.to_int csts.parametric.blocks_per_commitment + in + let baking_reward_fixed_portion = + csts.parametric.baking_reward_fixed_portion + in + (* get the pkh of a baker *) + let* pkh, _, _, _ = Block.get_next_baker b in + let id = Alpha_context.Contract.Implicit pkh in + let policy = Block.Excluding [pkh] in + (* bake until commitment - 2, excluding id *) + let* b = Block.bake_n ~policy (blocks_per_commitment - 2) b in + let* bal_main = Context.Contract.balance (B b) id in + (* the baker [id] will include a seed_nonce commitment *) + let* b = Block.bake ~policy:(Block.By_account pkh) b in + let*? level_commitment = Context.get_level (B b) in + let* committed_hash = Context.get_seed_nonce_hash (B b) in + (* test that the baking reward is received *) + let* () = + balance_was_credited + ~loc:__LOC__ + (B b) + id + bal_main + baking_reward_fixed_portion + in + (* test that revealing too early produces an error *) + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get committed_hash) + in + let*! e = Block.bake ~policy ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Nonce_storage.Too_early_revelation -> true + | _ -> false) + in + (* finish the cycle excluding the committing baker, id *) + let* b = Block.bake_until_cycle_end ~policy b in + (* test that revealing at the right time but the wrong value + produces an error *) + let wrong_hash, _ = Nonce.generate () in + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get wrong_hash) + in + let*! e = Block.bake ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Nonce_storage.Inconsistent_nonce -> true + | _ -> false) + in + (* reveals correctly *) + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get committed_hash) + in + let* baker_pkh, _, _, _ = Block.get_next_baker ~policy b in + let baker = Alpha_context.Contract.Implicit baker_pkh in + let* baker_bal = Context.Contract.balance (B b) baker in + (* test that revealing twice in a block produces an error *) + let*! e = + Block.bake + ~policy:(Block.By_account baker_pkh) + ~operations:[operation; operation] + b + in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Conflicting_nonce_revelation _ -> true + | _ -> false) + in + let* b = Block.bake ~policy:(Block.By_account baker_pkh) ~operation b in + (* test that the baker gets the tip reward plus the baking reward*) + let* () = + balance_was_credited + ~loc:__LOC__ + (B b) + baker + baker_bal + Test_tez.(tip +! baking_reward_fixed_portion) + in + (* test that revealing twice produces an error *) + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get wrong_hash) + in + let*! e = Block.bake ~operation ~policy b in + Assert.proto_error ~loc:__LOC__ e (function + | Nonce_storage.Already_revealed_nonce -> true + | _ -> false) + +(** Test that revealing too late produces an error. Note that a + committer who doesn't reveal at cycle 1 is not punished.*) +let test_revelation_missing_and_late () = + let open Context in + let open Assert in + let* b, _contracts = Context.init_n ~consensus_threshold:0 5 () in + let* csts = get_constants (B b) in + let blocks_per_commitment = + Int32.to_int csts.parametric.blocks_per_commitment + in + let nonce_revelation_threshold = + Int32.to_int csts.parametric.nonce_revelation_threshold + in + (* bake until commitment *) + let* b = Block.bake_n (blocks_per_commitment - 2) b in + (* the next baker [id] will include a seed_nonce commitment *) + let* pkh, _, _, _ = Block.get_next_baker b in + let* b = Block.bake b in + let*? level_commitment = Context.get_level (B b) in + let* committed_hash = Context.get_seed_nonce_hash (B b) in + (* finish cycle 0 excluding the committing baker [id] *) + let policy = Block.Excluding [pkh] in + let* b = Block.bake_until_cycle_end ~policy b in + (* test that revealing after revelation period produces an error *) + let* b = Block.bake_n (nonce_revelation_threshold - 1) b in + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get committed_hash) + in + let*! e = Block.bake ~operation ~policy b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Nonce_storage.Too_late_revelation -> true + | _ -> false) + in + (* finish cycle 1 excluding the committing baker [id] *) + let* b = Block.bake_until_cycle_end ~policy b in + (* test that revealing too late after cycle 1 produces an error *) + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get committed_hash) + in + let*! e = Block.bake ~operation b in + Assert.proto_error ~loc:__LOC__ e (function + | Nonce_storage.Too_late_revelation -> true + | _ -> false) + +let wrap e = e >|= Environment.wrap_tzresult + +(** Test that we do not distribute endorsing rewards if the nonce was + not revealed. *) +let test_unrevealed () = + let open Alpha_context in + let constants = + { + Default_parameters.constants_test with + endorsing_reward_per_slot = Tez.one_mutez; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + seed_nonce_revelation_tip = Tez.zero; + consensus_threshold = 0; + minimal_participation_ratio = Ratio.{numerator = 0; denominator = 1}; + } + in + let* b, (_account1, account2) = Context.init_with_constants2 constants in + let delegate2 = Context.Contract.pkh account2 in + (* Delegate 2 will add a nonce but never reveals it *) + let* csts = Context.get_constants (B b) in + let blocks_per_commitment = + Int32.to_int csts.parametric.blocks_per_commitment + in + let bake_and_endorse_block ?policy (_pred_b, b) = + let* slots = Context.get_endorsers (B b) in + let* endorsements = + List.map_es + (fun {Plugin.RPC.Validators.consensus_key; _} -> + Op.endorsement ~delegate:consensus_key b) + slots + in + Block.bake ?policy ~operations:endorsements b + in + (* Bake until commitment *) + let* b = Block.bake_n (blocks_per_commitment - 2) b in + (* Baker delegate 2 will include a seed_nonce commitment *) + let policy = Block.By_account delegate2 in + let* b = Block.bake_until_cycle_end ~policy b in + let* info_before = Context.Delegate.info (B b) delegate2 in + let* b' = Block.bake ~policy b in + let* b = bake_and_endorse_block ~policy (b, b') in + (* Finish cycle 1 excluding the first baker *) + let* b = Block.bake_until_cycle_end ~policy b in + let* info_after = Context.Delegate.info (B b) delegate2 in + (* Assert that we did not received a reward because we didn't + reveal the nonce. *) + let* () = + Assert.equal_tez + ~loc:__LOC__ + info_before.full_balance + info_after.full_balance + in + return_unit + +let test_vdf_status () = + let* b, _ = Context.init3 ~consensus_threshold:0 () in + let* b = Block.bake b in + let* status = Context.get_seed_computation (B b) in + assert (status = Alpha_context.Seed.Nonce_revelation_stage) ; + let* constants = Context.get_constants (B b) in + let* b = + Block.bake_n + (Int32.to_int constants.parametric.nonce_revelation_threshold) + b + in + let* status = Context.get_seed_computation (B b) in + assert ( + match status with + | Alpha_context.Seed.Vdf_revelation_stage _ -> true + | _ -> false) ; + return_unit + +(** Choose a baker, denote it by id. In the first cycle, make id bake only once. + Check that: + - when the vdf is revealed too early, there's an error + - when the vdf is revealed at the right time but the wrong value, there's an error + - when the vdf is revealed at the right time and the correct value, + - the baker receives a reward + - the VDF status is updated to "Computation_finished" + - the seed is updated with the vdf solution + - another vdf revelation produces an error *) +let test_early_incorrect_unverified_correct_already_vdf () = + let open Assert in + let* b, _ = Context.init3 ~consensus_threshold:0 () in + let* csts = Context.get_constants (B b) in + let blocks_per_commitment = + Int32.to_int csts.parametric.blocks_per_commitment + in + let nonce_revelation_threshold = + Int32.to_int csts.parametric.nonce_revelation_threshold + in + let baking_reward_fixed_portion = + csts.parametric.baking_reward_fixed_portion + in + let seed_nonce_revelation_tip = csts.parametric.seed_nonce_revelation_tip in + let vdf_nonce_revelation_tip = csts.parametric.seed_nonce_revelation_tip in + (* get the pkh of a baker *) + let* pkh, _, _, _ = Block.get_next_baker b in + let id = Alpha_context.Contract.Implicit pkh in + let policy = Block.Excluding [pkh] in + (* bake until commitment - 2, excluding id *) + let* b = Block.bake_n ~policy (blocks_per_commitment - 2) b in + let* bal_main = Context.Contract.balance (B b) id in + (* the baker [id] will include a seed_nonce commitment *) + let* b = Block.bake ~policy:(Block.By_account pkh) b in + let*? level_commitment = Context.get_level (B b) in + let* committed_hash = Context.get_seed_nonce_hash (B b) in + (* test that the baking reward is received *) + let* () = + balance_was_credited + ~loc:__LOC__ + (B b) + id + bal_main + baking_reward_fixed_portion + in + (* finish the cycle excluding the committing baker, id *) + let* b = Block.bake_until_cycle_end ~policy b in + (* reveals correctly *) + let operation = + Op.seed_nonce_revelation + (B b) + level_commitment + (WithExceptions.Option.to_exn ~none:Not_found @@ Nonce.get committed_hash) + in + let* baker_pkh, _, _, _ = Block.get_next_baker ~policy b in + let baker = Alpha_context.Contract.Implicit baker_pkh in + let* baker_bal = Context.Contract.balance (B b) baker in + let* b = Block.bake ~policy:(Block.By_account baker_pkh) ~operation b in + (* test that the baker gets the tip reward plus the baking reward*) + let* () = + balance_was_credited + ~loc:__LOC__ + (B b) + baker + baker_bal + Test_tez.(seed_nonce_revelation_tip +! baking_reward_fixed_portion) + in + (* test that revealing the VDF early produces an error *) + let dummy_solution = + let open Environment.Vdf in + let dummy = Bytes.create Environment.Vdf.form_size_bytes in + let result = Stdlib.Option.get @@ result_of_bytes_opt dummy in + let proof = Stdlib.Option.get @@ proof_of_bytes_opt dummy in + (result, proof) + in + let operation = Op.vdf_revelation (B b) dummy_solution in + let*! e = Block.bake ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Seed_storage.Too_early_revelation -> true + | _ -> false) + in + (* bake until nonce reveal period finishes *) + let* b = Block.bake_n ~policy nonce_revelation_threshold b in + (* test that revealing non group elements produces an error *) + let operation = Op.vdf_revelation (B b) dummy_solution in + let*! e = Block.bake ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Seed_storage.Unverified_vdf -> true + | _ -> false) + in + let* seed_status = Context.get_seed_computation (B b) in + match seed_status with + | Nonce_revelation_stage -> assert false + | Computation_finished -> assert false + | Vdf_revelation_stage info -> ( + (* generate the VDF discriminant and challenge *) + let discriminant, challenge = + Alpha_context.Seed.generate_vdf_setup + ~seed_discriminant:info.seed_discriminant + ~seed_challenge:info.seed_challenge + in + (* test that revealing wrong VDF produces an error *) + let wrong_solution = + let open Environment.Vdf in + let f = challenge_to_bytes challenge in + let result = Stdlib.Option.get @@ result_of_bytes_opt f in + let proof = Stdlib.Option.get @@ proof_of_bytes_opt f in + (result, proof) + in + let operation = Op.vdf_revelation (B b) wrong_solution in + let*! e = Block.bake ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Seed_storage.Unverified_vdf -> true + | _ -> false) + in + (* test with correct input *) + (* compute the VDF solution (the result and the proof ) *) + let solution = + (* generate the result and proof *) + Environment.Vdf.prove + discriminant + challenge + csts.parametric.vdf_difficulty + in + let* baker_bal = Context.Contract.balance (B b) baker in + let operation = Op.vdf_revelation (B b) solution in + let*! e = + Block.bake + ~policy:(Block.By_account baker_pkh) + ~operations:[operation; operation] + b + in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Validate_errors.Anonymous.Conflicting_vdf_revelation _ -> true + | _ -> false) + in + (* verify the balance was credited following operation inclusion *) + let* b = Block.bake ~policy:(Block.By_account baker_pkh) ~operation b in + let* () = + balance_was_credited + ~loc:__LOC__ + (B b) + baker + baker_bal + Test_tez.(vdf_nonce_revelation_tip +! baking_reward_fixed_portion) + in + (* verify the seed status has changed *) + let* seed_status = Context.get_seed_computation (B b) in + match seed_status with + | Nonce_revelation_stage -> assert false + | Vdf_revelation_stage _ -> assert false + | Computation_finished -> + (* test than sending another VDF reveal produces an error *) + let operation = Op.vdf_revelation (B b) solution in + let*! e = Block.bake ~operation b in + let* () = + Assert.proto_error ~loc:__LOC__ e (function + | Seed_storage.Already_accepted -> true + | _ -> false) + in + (* verify the stored seed has the expected value *) + let open Data_encoding.Binary in + let open Alpha_context in + (* retrieving & converting seed stored in cycle n + preserved_cycle + 1 *) + let* b = + Block.bake_until_n_cycle_end + ~policy + (csts.parametric.preserved_cycles + 1) + b + in + let* stored_seed = Context.get_seed (B b) in + let vdf_stored_seed = to_bytes_exn Seed.seed_encoding stored_seed in + (* recomputing seed with randao output and vdf solution *) + let vdf_expected_seed = + let randao_seed = + to_bytes_exn Seed.seed_encoding info.seed_challenge + |> of_bytes_exn Seed_repr.seed_encoding + in + Seed_repr.vdf_to_seed randao_seed solution + |> to_bytes_exn Seed_repr.seed_encoding + in + assert (Bytes.(equal vdf_expected_seed vdf_stored_seed)) ; + return_unit) + +(* We check that bounds used in [Seed_storage.for_cycle] are as expected. *) +let test_cycle_bounds () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, _accounts) -> + Context.get_constants (B b) >>=? fun csts -> + let past_offset = csts.parametric.max_slashing_period - 1 in + let future_offset = csts.parametric.preserved_cycles in + let open Alpha_context.Cycle in + let expected_error_message direction current_cycle = + match direction with + | `Past -> + let oldest_cycle = Stdlib.Option.get (sub current_cycle past_offset) in + let older_cycle = Stdlib.Option.get (sub oldest_cycle 1) in + Format.asprintf + "The seed for cycle %a has been cleared from the context (oldest \ + known seed is for cycle %a)" + pp + older_cycle + pp + oldest_cycle + | `Future -> + let latest_cycle = add current_cycle future_offset in + let later_cycle = add latest_cycle 1 in + Format.asprintf + "The seed for cycle %a has not been computed yet (latest known seed \ + is for cycle %a)" + pp + later_cycle + pp + latest_cycle + | `Missing_sampler_state cycle -> + Format.asprintf + "Storage error:\n Missing key 'cycle/%a/delegate_sampler_state'." + pp + cycle + in + let cycle = root in + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> + let future_cycle = add cycle (future_offset + 1) in + Context.get_bakers ~cycle:future_cycle (B b) >>= fun res -> + (* the first cycle is special *) + Assert.proto_error_with_info + ~loc:__LOC__ + ~error_info_field:`Message + res + (expected_error_message (`Missing_sampler_state future_cycle) cycle) + >>=? fun () -> + Block.bake_until_cycle_end b >>=? fun b -> + let cycle = add cycle 1 in + Context.get_bakers ~cycle:root (B b) >>=? fun (_ : _ list) -> + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> + Context.get_bakers ~cycle:(add cycle (future_offset + 1)) (B b) >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + ~error_info_field:`Message + (expected_error_message `Future cycle) + >>=? fun () -> + Block.bake_until_n_cycle_end past_offset b >>=? fun b -> + let cycle = add cycle past_offset in + Context.get_bakers ~cycle:(Stdlib.Option.get (sub cycle past_offset)) (B b) + >>=? fun (_ : _ list) -> + Context.get_bakers + ~cycle:(Stdlib.Option.get (sub cycle (past_offset + 1))) + (B b) + >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + ~error_info_field:`Message + (expected_error_message `Past cycle) + >>=? fun () -> + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> + Context.get_bakers ~cycle:(add cycle (future_offset + 1)) (B b) >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + ~error_info_field:`Message + (expected_error_message `Future cycle) + +let tests = + [ + Tztest.tztest + "seed computation (no commitment)" + `Quick + test_seed_no_commitment; + Tztest.tztest "no commitment" `Quick test_no_commitment; + Tztest.tztest + "revelation_early_wrong_right_twice" + `Quick + test_revelation_early_wrong_right_twice; + Tztest.tztest + "revelation_missing_and_late" + `Quick + test_revelation_missing_and_late; + Tztest.tztest "test unrevealed" `Quick test_unrevealed; + Tztest.tztest + "test_early_incorrect_unverified_correct_already_vdf" + `Quick + test_early_incorrect_unverified_correct_already_vdf; + Tztest.tztest "test VDF status" `Quick test_vdf_status; + Tztest.tztest "for_cycle cycle bounds" `Quick test_cycle_bounds; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune new file mode 100644 index 000000000000..37f09ac5c5a6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune @@ -0,0 +1,30 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + tezt + tezos-context + alcotest-lwt + tezos-base + tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters + tezos-alpha-test-helpers + tezos-base-test-helpers) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (deps (glob_files wasm_kernel/*.wasm)) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune new file mode 100644 index 000000000000..b6b619a82da8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune @@ -0,0 +1,23 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + alcotest-lwt + tezos-base + tezos-protocol-016-PtMumbai + tezos-alpha-test-helpers + tezos-base-test-helpers) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_016_PtMumbai + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml new file mode 100644 index 000000000000..bba8b42862d2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol > Gas + Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/gas + Subject: Entrypoint +*) + +let () = + Alcotest_lwt.run + "protocol > integration > gas" + [ + ("gas levels", Test_gas_levels.tests); + ("gas cost functions", Test_gas_costs.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml new file mode 100644 index 000000000000..9fe85ead49c5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml @@ -0,0 +1,286 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (gas costs) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ + -- test "^gas cost functions$" + Subject: Gas costs + Current limitations: for maps, sets & compare, we only test + integer comparable keys. +*) + +open Protocol +module S = Saturation_repr + +let dummy_list = Script_list.(cons 42 empty) + +let forty_two = Script_int.of_int 42 + +let forty_two_n = Script_int.abs forty_two + +let dummy_set = + let open Script_set in + update forty_two true (empty Script_typed_ir.int_t) + +let dummy_map = + let open Script_map in + update forty_two (Some forty_two) (empty Script_typed_ir.int_t) + +let dummy_timestamp = Script_timestamp.of_zint (Z.of_int 42) + +let dummy_pk = + Tezos_crypto.Signature.Public_key.of_b58check_exn + "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU" + +let dummy_bytes = Bytes.of_string "dummy" + +let dummy_string = + match Script_string.of_string "dummy" with + | Ok s -> s + | Error _ -> assert false + +let dummy_ty = Script_typed_ir.never_t + +let free = ["balance"; "bool"; "parsing_unit"; "unparsing_unit"] + +(* /!\ The compiler will only complain if costs are _removed_ /!\*) +let all_interpreter_costs = + let open Michelson_v1_gas.Cost_of.Interpreter in + [ + ("drop", drop); + ("dup", dup); + ("swap", swap); + ("cons_some", cons_some); + ("cons_none", cons_none); + ("if_none", if_none); + ("cons_pair", cons_pair); + ("car", car); + ("cdr", cdr); + ("cons_left", cons_left); + ("cons_right", cons_right); + ("if_left", if_left); + ("cons_list", cons_list); + ("nil", nil); + ("if_cons", if_cons); + ("list_map", list_map dummy_list); + ("list_size", list_size); + ("list_iter", list_iter dummy_list); + ("empty_set", empty_set); + ("set_iter", set_iter dummy_set); + ("set_mem", set_mem forty_two dummy_set); + ("set_update", set_update forty_two dummy_set); + ("set_size", set_size); + ("empty_map", empty_map); + ("map_map", map_map dummy_map); + ("map_iter", map_iter dummy_map); + ("map_mem", map_mem forty_two dummy_map); + ("map_get", map_get forty_two dummy_map); + ("map_update", map_update forty_two dummy_map); + ("map_size", map_size); + ("add_seconds_timestamp", add_seconds_timestamp forty_two dummy_timestamp); + ("sub_timestamp_seconds", sub_timestamp_seconds dummy_timestamp forty_two); + ("diff_timestamps", diff_timestamps dummy_timestamp dummy_timestamp); + ("concat_string_pair", concat_string_pair dummy_string dummy_string); + ("slice_string", slice_string dummy_string); + ("string_size", string_size); + ("concat_bytes_pair", concat_bytes_pair dummy_bytes dummy_bytes); + ("slice_bytes", slice_bytes dummy_bytes); + ("bytes_size", bytes_size); + ("add_tez", add_tez); + ("sub_tez", sub_tez); + ("mul_teznat", mul_teznat); + ("bool_or", bool_or); + ("bool_and", bool_and); + ("bool_xor", bool_xor); + ("bool_not", bool_not); + ("is_nat", is_nat); + ("abs_int", abs_int forty_two); + ("int_nat", int_nat); + ("neg", neg forty_two); + ("add_int", add_int forty_two forty_two); + ("sub_int", sub_int forty_two forty_two); + ("mul_int", mul_int forty_two forty_two); + ("ediv_teznat", ediv_teznat Alpha_context.Tez.fifty_cents forty_two); + ("ediv_tez", ediv_tez); + ("ediv_int", ediv_int forty_two (Script_int.of_int 1)); + ("eq", eq); + ("lsl_nat", lsl_nat forty_two); + ("lsr_nat", lsr_nat forty_two); + ("or_nat", or_nat forty_two forty_two); + ("and_nat", and_nat forty_two forty_two); + ("xor_nat", xor_nat forty_two forty_two); + ("not_int", not_int forty_two); + ("if_", if_); + ("loop", loop); + ("loop_left", loop_left); + ("dip", dip); + ("check_signature", check_signature dummy_pk dummy_bytes); + ("blake2b", blake2b dummy_bytes); + ("sha256", sha256 dummy_bytes); + ("sha512", sha512 dummy_bytes); + ("dign", dign 42); + ("dugn", dugn 42); + ("dipn", dipn 42); + ("dropn", dropn 42); + ("neq", neq); + ("compare", compare Script_typed_ir.int_t forty_two forty_two); + ( "concat_string_precheck", + concat_string_precheck Script_list.(cons "42" empty) ); + ("concat_string", concat_string (S.safe_int 42)); + ("concat_bytes", concat_bytes (S.safe_int 42)); + ("exec", exec); + ("apply_rec", apply ~rec_flag:true); + ("apply", apply ~rec_flag:false); + ("lambda", lambda); + ("address", address); + ("contract", contract); + ("transfer_tokens", transfer_tokens); + ("implicit_account", implicit_account); + ("create_contract", create_contract); + ("set_delegate", set_delegate); + (* balance is free *) + ("balance", balance); + ("level", level); + ("now", now); + ("hash_key", hash_key dummy_pk); + ("source", source); + ("sender", sender); + ("self", self); + ("self_address", self_address); + ("amount", amount); + ("chain_id", chain_id); + ("unpack_failed", unpack_failed "dummy"); + ] + +(* /!\ The compiler will only complain if costs are _removed_ /!\*) +let all_parsing_costs = + let open Michelson_v1_gas.Cost_of.Typechecking in + [ + ("public_key_optimized", public_key_optimized); + ("public_key_readable", public_key_readable); + ("key_hash_optimized", key_hash_optimized); + ("key_hash_readable", key_hash_readable); + ("signature_optimized", signature_optimized); + ("signature_readable", signature_readable); + ("chain_id_optimized", chain_id_optimized); + ("chain_id_readable", chain_id_readable); + ("address_optimized", address_optimized); + ("contract_optimized", contract_optimized); + ("contract_readable", contract_readable); + ("check_printable", check_printable "dummy"); + ("merge_cycle", merge_cycle); + ("parse_type_cycle", parse_type_cycle); + ("parse_instr_cycle", parse_instr_cycle); + ("parse_data_cycle", parse_data_cycle); + ("bool", bool); + ("parsing_unit", unit); + ("timestamp_readable", timestamp_readable "dummy"); + ("contract_exists", contract_exists); + ("proof_argument", proof_argument 42); + ] + +(* /!\ The compiler will only complain if costs are _removed_ /!\*) +let all_unparsing_costs = + let open Michelson_v1_gas.Cost_of.Unparsing in + [ + ("public_key_optimized", public_key_optimized); + ("public_key_readable", public_key_readable); + ("key_hash_optimized", key_hash_optimized); + ("key_hash_readable", key_hash_readable); + ("signature_optimized", signature_optimized); + ("signature_readable", signature_readable); + ("chain_id_optimized", chain_id_optimized); + ("chain_id_readable", chain_id_readable); + ("timestamp_readable", timestamp_readable); + ("address_optimized", address_optimized); + ("contract_optimized", contract_optimized); + ("contract_readable", contract_readable); + ("unparse_type", unparse_type dummy_ty); + ("unparse_instr_cycle", unparse_instr_cycle); + ("unparse_data_cycle", unparse_data_cycle); + ("unparsing_unit", unit); + ("operation", operation dummy_bytes); + ] + +(* /!\ The compiler will only complain if costs are _removed_ /!\*) +let all_io_costs = + let open Storage_costs in + [ + ("read_access 0 0", read_access ~path_length:0 ~read_bytes:0); + ("read_access 1 0", read_access ~path_length:1 ~read_bytes:0); + ("read_access 0 1", read_access ~path_length:0 ~read_bytes:1); + ("read_access 1 1", read_access ~path_length:1 ~read_bytes:1); + ("write_access 0", write_access ~written_bytes:0); + ("write_access 1", write_access ~written_bytes:1); + ] + +(* Here we're using knowledge of the internal representation of costs to + cast them to S ... *) +let cast_cost_to_s (c : Alpha_context.Gas.cost) : _ S.t = + Data_encoding.Binary.to_bytes_exn Alpha_context.Gas.cost_encoding c + |> Data_encoding.Binary.of_bytes_exn S.n_encoding + +(** Checks that all costs are positive values. *) +let test_cost_reprs_are_all_positive list () = + List.iter_es + (fun (cost_name, cost) -> + if S.(cost > S.zero) then return_unit + else if S.equal cost S.zero && List.mem ~equal:String.equal cost_name free + then return_unit + else + fail + (Exn + (Failure (Format.asprintf "Gas cost test \"%s\" failed" cost_name)))) + list + +(** Checks that all costs are positive values. *) +let test_costs_are_all_positive list () = + let list = + List.map (fun (cost_name, cost) -> (cost_name, cast_cost_to_s cost)) list + in + test_cost_reprs_are_all_positive list () + +let tests = + [ + Tztest.tztest + "Positivity of interpreter costs" + `Quick + (test_costs_are_all_positive all_interpreter_costs); + Tztest.tztest + "Positivity of typechecking costs" + `Quick + (test_costs_are_all_positive all_parsing_costs); + Tztest.tztest + "Positivity of unparsing costs" + `Quick + (test_costs_are_all_positive all_unparsing_costs); + Tztest.tztest + "Positivity of io costs" + `Quick + (test_cost_reprs_are_all_positive all_io_costs); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml new file mode 100644 index 000000000000..a6e799c846db --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml @@ -0,0 +1,571 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Gas levels) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ + -- test "^gas levels$" + Subject: On gas consumption and exhaustion. +*) + +open Protocol +open Raw_context +module S = Saturation_repr + +(* This value is supposed to be larger than the block gas level limit + but not saturated. *) +let opg = max_int / 10000 + +exception Gas_levels_test_error of string + +let err x = Exn (Gas_levels_test_error x) + +let succeed x = match x with Ok _ -> true | _ -> false + +let failed x = not (succeed x) + +let dummy_context () = + Context.init1 ~consensus_threshold:0 () >>=? fun (block, _contract) -> + Raw_context.prepare + ~level:Int32.zero + ~predecessor_timestamp:Time.Protocol.epoch + ~timestamp:Time.Protocol.epoch + (* ~fitness:[] *) + (block.context : Tezos_protocol_environment.Context.t) + >|= Environment.wrap_tzresult + +let consume_gas_lwt context gas = + Lwt.return (consume_gas context (S.safe_int gas)) + >|= Environment.wrap_tzresult + +let consume_gas_limit_in_block_lwt context gas = + Lwt.return (consume_gas_limit_in_block context gas) + >|= Environment.wrap_tzresult + +let test_detect_gas_exhaustion_in_fresh_context () = + dummy_context () >>=? fun context -> + fail_unless + (consume_gas context (S.safe_int opg) |> succeed) + (err "In a fresh context, gas consumption is unlimited.") + +(** Create a context with a given block gas level, capped at the + hard gas limit per block *) +let make_context remaining_block_gas = + let open Gas_limit_repr in + dummy_context () >>=? fun context -> + let hard_limit = Arith.fp (constants context).hard_gas_limit_per_operation in + let hard_limit_block = + Arith.fp (constants context).hard_gas_limit_per_block + in + let block_gas = Arith.(unsafe_fp (Z.of_int remaining_block_gas)) in + let rec aux context to_consume = + (* Because of saturated arithmetic, [to_consume] should never be negative. *) + assert (Arith.(to_consume >= zero)) ; + if Arith.(to_consume = zero) then return context + else if Arith.(to_consume <= hard_limit) then + consume_gas_limit_in_block_lwt context to_consume + else + consume_gas_limit_in_block_lwt context hard_limit >>=? fun context -> + aux context (Arith.sub to_consume hard_limit) + in + aux context Arith.(sub hard_limit_block block_gas) + +(** Test operation gas exhaustion. Should pass when remaining gas is 0, + and fail when it goes over *) +let test_detect_gas_exhaustion_when_operation_gas_hits_zero () = + let gas_op = 100000 in + dummy_context () >>=? fun context -> + set_gas_limit context (Gas_limit_repr.Arith.unsafe_fp (Z.of_int gas_op)) + |> fun context -> + fail_unless + (consume_gas context (S.safe_int gas_op) |> succeed) + (err "Succeed when consuming exactly the remaining operation gas.") + >>=? fun () -> + fail_unless + (consume_gas context (S.safe_int (gas_op + 1)) |> failed) + (err "Fail when consuming more than the remaining operation gas.") + +(** Test block gas exhaustion *) +let test_detect_gas_exhaustion_when_block_gas_hits_zero () = + let gas k = Gas_limit_repr.Arith.unsafe_fp (Z.of_int k) in + let remaining_gas = gas 100000 and too_much = gas (100000 + 1) in + make_context 100000 >>=? fun context -> + fail_unless + (consume_gas_limit_in_block context remaining_gas |> succeed) + (err "Succeed when consuming exactly the remaining block gas.") + >>=? fun () -> + fail_unless + (consume_gas_limit_in_block context too_much |> failed) + (err "Fail when consuming more than the remaining block gas.") + +(** Test invalid gas limit. Should fail when limit is above the hard gas limit per + operation *) +let test_detect_gas_limit_consumption_above_hard_gas_operation_limit () = + dummy_context () >>=? fun context -> + fail_unless + (consume_gas_limit_in_block + context + (Gas_limit_repr.Arith.unsafe_fp (Z.of_int opg)) + |> failed) + (err + "Fail when consuming gas above the hard limit per operation in the \ + block.") + +(** For a given [context], check if its levels match those given in [block_level] and + [operation_level] *) +let check_context_levels context block_level operation_level = + let op_check = + match gas_level context with + | Unaccounted -> true + | Limited {remaining} -> + Gas_limit_repr.Arith.(unsafe_fp (Z.of_int operation_level) = remaining) + in + let block_check = + Gas_limit_repr.Arith.( + unsafe_fp (Z.of_int block_level) = block_gas_level context) + in + fail_unless + (op_check || block_check) + (err "Unexpected block and operation gas levels") + >>=? fun () -> + fail_unless op_check (err "Unexpected operation gas level") >>=? fun () -> + fail_unless block_check (err "Unexpected block gas level") + +let monitor remaining_block_gas initial_operation_level consumed_gas () = + let op_limit = + Gas_limit_repr.Arith.unsafe_fp (Z.of_int initial_operation_level) + in + make_context remaining_block_gas >>=? fun context -> + consume_gas_limit_in_block_lwt context op_limit >>=? fun context -> + set_gas_limit context op_limit |> fun context -> + consume_gas_lwt context consumed_gas >>=? fun context -> + check_context_levels + context + (remaining_block_gas - initial_operation_level) + (initial_operation_level - consumed_gas) + +let test_monitor_gas_level = monitor 1000 100 10 + +(** Test cas consumption mode switching (limited -> unlimited) *) +let test_set_gas_unlimited () = + let init_block_gas = 100000 in + let op_limit_int = 10000 in + let op_limit = Gas_limit_repr.Arith.unsafe_fp (Z.of_int op_limit_int) in + make_context init_block_gas >>=? fun context -> + set_gas_limit context op_limit |> set_gas_unlimited |> fun context -> + consume_gas_lwt context opg >>=? fun context -> + check_context_levels context init_block_gas (-1) + +(** Test cas consumption mode switching (unlimited -> limited) *) +let test_set_gas_limited () = + let init_block_gas = 100000 in + let op_limit_int = 10000 in + let op_limit = Gas_limit_repr.Arith.unsafe_fp (Z.of_int op_limit_int) in + let op_gas = 100 in + make_context init_block_gas >>=? fun context -> + set_gas_unlimited context |> fun context -> + set_gas_limit context op_limit |> fun context -> + consume_gas_lwt context op_gas >>=? fun context -> + check_context_levels context init_block_gas (op_limit_int - op_gas) + +(*** Tests with blocks ***) + +let begin_validation_and_application ctxt chain_id mode ~predecessor = + let open Lwt_result_syntax in + let* validation_state = begin_validation ctxt chain_id mode ~predecessor in + let* application_state = begin_application ctxt chain_id mode ~predecessor in + return (validation_state, application_state) + +let validate_and_apply_operation (validation_state, application_state) op = + let open Lwt_result_syntax in + let oph = Alpha_context.Operation.hash_packed op in + let* validation_state = validate_operation validation_state oph op in + let* application_state, receipt = apply_operation application_state oph op in + return ((validation_state, application_state), receipt) + +let finalize_validation_and_application (validation_state, application_state) + shell_header = + let open Lwt_result_syntax in + let* () = finalize_validation validation_state in + finalize_application application_state shell_header + +let apply_with_gas header ?(operations = []) (pred : Block.t) = + let open Alpha_context in + (let open Environment.Error_monad in + begin_validation_and_application + pred.context + Tezos_crypto.Chain_id.zero + (Application header) + ~predecessor:pred.header.shell + >>=? fun vstate -> + List.fold_left_es + (fun vstate op -> + validate_and_apply_operation vstate op >|=? fun (state, _result) -> state) + vstate + operations + >>=? fun vstate -> + finalize_validation_and_application vstate (Some header.shell) + >|=? fun (validation, result) -> (validation.context, result.consumed_gas)) + >|= Environment.wrap_tzresult + >|=? fun (context, consumed_gas) -> + let hash = Block_header.hash header in + ({Block.hash; header; operations; context}, consumed_gas) + +let bake_with_gas ?policy ?timestamp ?operation ?operations pred = + let operations = + match (operation, operations) with + | Some op, Some ops -> Some (op :: ops) + | Some op, None -> Some [op] + | None, Some ops -> Some ops + | None, None -> None + in + Block.Forge.forge_header ?timestamp ?policy ?operations pred + >>=? fun header -> + Block.Forge.sign_header header >>=? fun header -> + apply_with_gas header ?operations pred + +let check_consumed_gas consumed expected = + fail_unless + Alpha_context.Gas.Arith.(consumed = expected) + (err + (Format.asprintf + "Gas discrepancy: consumed gas : %a | expected : %a\n" + Alpha_context.Gas.Arith.pp + consumed + Alpha_context.Gas.Arith.pp + expected)) + +let lazy_unit = Alpha_context.Script.lazy_expr (Expr.from_string "Unit") + +let prepare_origination block source script = + let code = Expr.toplevel_from_string script in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_unit} + in + Op.contract_origination (B block) source ~script + +let originate_contract block source script = + prepare_origination block source script >>=? fun (operation, dst) -> + Block.bake ~operation block >>=? fun block -> return (block, dst) + +let init_block n to_originate = + Context.init_n n ~consensus_threshold:0 () >>=? fun (block, src_list) -> + match src_list with + | [] -> assert false + | src :: _ -> + (*** originate contracts ***) + let rec full_originate block originated = function + | [] -> return (block, List.rev originated) + | h :: t -> + originate_contract block src h >>=? fun (block, ct) -> + full_originate block (ct :: originated) t + in + full_originate block [] to_originate >>=? fun (block, originated) -> + return (block, src_list, originated) + +let nil_contract = + "parameter unit;\n\ + storage unit;\n\ + code {\n\ + \ DROP;\n\ + \ UNIT; NIL operation; PAIR\n\ + \ }\n" + +let fail_contract = "parameter unit; storage unit; code { FAIL }" + +let loop_contract = + "parameter unit;\n\ + storage unit;\n\ + code {\n\ + \ DROP;\n\ + \ PUSH bool True;\n\ + \ LOOP {\n\ + \ PUSH string \"GASGASGAS\";\n\ + \ PACK;\n\ + \ SHA3;\n\ + \ DROP;\n\ + \ PUSH bool True\n\ + \ };\n\ + \ UNIT; NIL operation; PAIR\n\ + \ }\n" + +let block_with_one_origination n contract = + init_block n [contract] >>=? fun (block, srcs, originated) -> + match originated with [dst] -> return (block, srcs, dst) | _ -> assert false + +let full_block n () = + init_block n [nil_contract; fail_contract; loop_contract] + >>=? fun (block, src_list, originated) -> + let dst_nil, dst_fail, dst_loop = + match originated with [c1; c2; c3] -> (c1, c2, c3) | _ -> assert false + in + return (block, src_list, dst_nil, dst_fail, dst_loop) + +(** Combine a list of operations into an operation list. Also returns + the sum of their gas limits.*) +let combine_operations_with_gas block list_dst = + let rec make_op_list src full_gas op_list = function + | [] -> return (src, full_gas, List.rev op_list) + | (src, dst, gas_limit) :: t -> + Op.transaction + ~gas_limit:(Custom_gas gas_limit) + (B block) + src + dst + Alpha_context.Tez.zero + >>=? fun op -> + make_op_list + (Some src) + (Alpha_context.Gas.Arith.add full_gas gas_limit) + (op :: op_list) + t + in + make_op_list None Alpha_context.Gas.Arith.zero [] list_dst + >>=? fun (src, full_gas, op_list) -> + match src with + | None -> assert false + | Some source -> + Op.batch_operations ~recompute_counters:true ~source (B block) op_list + >>=? fun operation -> return (operation, full_gas) + +(** Applies [combine_operations_with_gas] to lists in a list, then bake a block + with this list of operations. Also returns the sum of all gas limits *) +let bake_operations_with_gas block list_list_dst = + let rec make_list full_gas op_list = function + | [] -> return (full_gas, List.rev op_list) + | list_dst :: t -> + combine_operations_with_gas block list_dst >>=? fun (op, gas) -> + make_list (Alpha_context.Gas.Arith.add full_gas gas) (op :: op_list) t + in + make_list Alpha_context.Gas.Arith.zero [] list_list_dst + >>=? fun (gas_limit_total, operations) -> + bake_with_gas ~operations block >>=? fun (block, consumed_gas) -> + return (block, consumed_gas, gas_limit_total) + +let basic_gas_sampler () = + Alpha_context.Gas.Arith.integral_of_int_exn + (Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation + 100 + + Random.int 900) + +let generic_test_block_one_origination contract gas_sampler structure = + let sources_number = List.length structure in + block_with_one_origination sources_number contract + >>=? fun (block, src_list, dst) -> + let lld = + List.mapi + (fun i t -> + match List.nth src_list i with + | None -> assert false + | Some src -> (List.map (fun _ -> (src, dst, gas_sampler ()))) t) + structure + in + bake_operations_with_gas block lld + >>=? fun (_block, consumed_gas, gas_limit_total) -> + check_consumed_gas consumed_gas gas_limit_total + +let make_batch_test_block_one_origination name contract gas_sampler = + let test = generic_test_block_one_origination contract gas_sampler in + let test_one_operation () = test [[()]] in + let test_one_operation_list () = test [[(); (); ()]] in + let test_many_single_operations () = test [[()]; [()]; [()]] in + let test_mixed_operations () = test [[(); ()]; [()]; [(); (); ()]] in + let app_n = List.map (fun (x, y) -> (x ^ " with contract " ^ name, y)) in + app_n + [ + ("Test bake one operation", test_one_operation); + ("Test bake one operation list", test_one_operation_list); + ("Test multiple single operations", test_many_single_operations); + ("Test both lists and single operations", test_mixed_operations); + ] + +(** Tests the consumption of all gas in a block, should pass *) +let test_consume_exactly_all_block_gas () = + let number_of_ops = 2 in + block_with_one_origination number_of_ops nil_contract + >>=? fun (block, src_list, dst) -> + (* assumptions: + hard gas limit per operation = 1_040_000 + hard gas limit per block = 2_600_000 + *) + let lld = + List.map + (fun src -> + [(src, dst, Alpha_context.Gas.Arith.integral_of_int_exn 1040000)]) + src_list + in + bake_operations_with_gas block lld >>=? fun (_, _, _) -> return_unit + +(** Tests the consumption of more than the block gas level with many single + operations, should fail *) +let test_malformed_block_max_limit_reached () = + let number_of_ops = 6 in + block_with_one_origination number_of_ops nil_contract + >>=? fun (block, src_list, dst) -> + (* assumptions: + hard gas limit per operation = 1040000 + hard gas limit per block = 5200000 + *) + let lld = + List.mapi + (fun i src -> + [ + ( src, + dst, + Alpha_context.Gas.Arith.integral_of_int_exn + (if i = number_of_ops - 1 then 1 else 1040000) ); + ]) + src_list + in + bake_operations_with_gas block lld >>= function + | Error _ -> return_unit + | Ok _ -> + fail + (err + "Invalid block: sum of operation gas limits exceeds hard gas limit \ + per block") + +(** Tests the consumption of more than the block gas level with one big + operation list, should fail *) +let test_malformed_block_max_limit_reached' () = + let number_of_ops = 6 in + block_with_one_origination number_of_ops nil_contract + >>=? fun (block, src_list, dst) -> + (* assumptions: + hard gas limit per operation = 1040000 + hard gas limit per block = 5200000 + *) + let lld = + List.mapi + (fun i src -> + [ + ( src, + dst, + Alpha_context.Gas.Arith.integral_of_int_exn + (if i = number_of_ops - 1 then 1 else 1040000) ); + ]) + src_list + in + bake_operations_with_gas block lld >>= function + | Error _ -> return_unit + | Ok _ -> + fail + (err + "Invalid block: sum of gas limits in operation list exceeds hard \ + gas limit per block") + +let test_block_mixed_operations () = + let number_of_ops = 4 in + full_block number_of_ops () + >>=? fun (block, src_list, dst_nil, dst_fail, dst_loop) -> + let l = [[dst_nil]; [dst_nil; dst_fail; dst_nil]; [dst_loop]; [dst_nil]] in + List.map2 + ~when_different_lengths:[] + (fun src l -> (List.map (fun x -> (src, x, basic_gas_sampler ()))) l) + src_list + l + >>?= fun lld -> + bake_operations_with_gas block lld + >>=? fun (_block, consumed_gas, gas_limit_total) -> + check_consumed_gas consumed_gas gas_limit_total + +(** Test that emptying an account does not cost extra-gas *) +let test_emptying_account_gas () = + let open Alpha_context in + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap) -> + let bootstrap_pkh = Context.Contract.pkh bootstrap in + let {Account.pkh; pk; _} = Account.new_account () in + let contract = Contract.Implicit pkh in + let amount = Test_tez.of_int 10 in + Op.transaction (B b) bootstrap contract amount >>=? fun op1 -> + Block.bake ~operation:op1 b >>=? fun b -> + Op.revelation ~fee:Tez.zero (B b) pk >>=? fun op2 -> + Block.bake ~operation:op2 b >>=? fun b -> + let gas_limit = + Op.Custom_gas + (Gas.Arith.integral_of_int_exn + Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation) + in + Op.delegation ~fee:amount ~gas_limit (B b) contract (Some bootstrap_pkh) + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + (* The delegation operation should be valid as the operation effect + would be to remove [contract] and should not generate any extra + gas cost. *) + let expect_apply_failure = function + | [Environment.Ecoproto_error (Storage_error (Raw_context.Missing_key _))] + -> + (* The delegation is expected to fail in the apply part as the + contract was emptied when fees were retrieved. *) + return_unit + | err -> failwith "got unexpected error: %a" pp_print_trace err + in + Incremental.add_operation ~expect_apply_failure i op + >>=? fun (_i : Incremental.t) -> return_unit + +let quick (what, how) = Tztest.tztest what `Quick how + +let tests = + List.map + quick + ([ + ( "Detect gas exhaustion in fresh context", + test_detect_gas_exhaustion_in_fresh_context ); + ( "Detect gas exhaustion when operation gas as hits zero", + test_detect_gas_exhaustion_when_operation_gas_hits_zero ); + ( "Detect gas exhaustion when block gas as hits zero", + test_detect_gas_exhaustion_when_block_gas_hits_zero ); + ( "Detect gas limit consumption when it is above the hard gas operation \ + limit", + test_detect_gas_limit_consumption_above_hard_gas_operation_limit ); + ( "Each new operation impacts block gas level, each gas consumption \ + impacts operation gas level", + test_monitor_gas_level ); + ( "Switches operation gas consumption from limited to unlimited", + test_set_gas_unlimited ); + ( "Switches operation gas consumption from unlimited to limited", + test_set_gas_limited ); + ( "Accepts a block that consumes all of its gas", + test_consume_exactly_all_block_gas ); + ( "Detect when the sum of all operation gas limits exceeds the hard gas \ + limit per block", + test_malformed_block_max_limit_reached ); + ( "Detect when gas limit of operation list exceeds the hard gas limit \ + per block", + test_malformed_block_max_limit_reached' ); + ( "Test the gas consumption of various operations", + test_block_mixed_operations ); + ("Test that emptying an account costs gas", test_emptying_account_gas); + ] + @ make_batch_test_block_one_origination "nil" nil_contract basic_gas_sampler + @ make_batch_test_block_one_origination + "fail" + fail_contract + basic_gas_sampler + @ make_batch_test_block_one_origination + "infinite loop" + loop_contract + basic_gas_sampler) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml new file mode 100644 index 000000000000..cc4b5cd0f515 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune build @@src/proto_alpha/lib_protocol/test/integration/runtest + Subject: Entrypoint +*) + +let () = + Alcotest_lwt.run + "protocol > integration" + [ + ("constants", Test_constants.tests); + ("liquidity baking", Test_liquidity_baking.tests); + ("storage description", Test_storage.tests); + ("storage tests", Test_storage_functions.tests); + ("token movements", Test_token.tests); + ("frozen bonds", Test_frozen_bonds.tests); + ("sc rollup wasm", Test_sc_rollup_wasm.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/big_interpreter_stack.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/big_interpreter_stack.tz new file mode 100644 index 000000000000..24832df0827f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/big_interpreter_stack.tz @@ -0,0 +1,5 @@ +{ parameter unit ; + storage unit ; + code { CAR ; + { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { {} ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; } ; + NIL operation; PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/emit.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/emit.tz new file mode 100644 index 000000000000..c8c2da0886d0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/emit.tz @@ -0,0 +1,16 @@ +parameter unit; +storage unit; +code { DROP ; + UNIT ; + PUSH string "right" ; + RIGHT nat ; + EMIT %tag1 ; + PUSH nat 2 ; + LEFT string ; + EMIT %tag2 (or (nat %int) (string %str)) ; + NIL operation ; + SWAP ; + CONS ; + SWAP ; + CONS ; + PAIR } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/fail_rec.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/fail_rec.tz new file mode 100644 index 000000000000..cac888664928 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/fail_rec.tz @@ -0,0 +1,8 @@ +{ parameter unit; + storage unit; + code { CAR; + LAMBDA_REC unit unit { }; + SWAP; + EXEC; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_CREATE_CONTRACT.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_CREATE_CONTRACT.tz new file mode 100644 index 000000000000..e3ee1fd0665a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_CREATE_CONTRACT.tz @@ -0,0 +1,24 @@ +# This contract uses CREATE_CONTRACT in a view, which is forbidden. +{ + storage unit ; + parameter unit ; + code { + CAR ; + NIL operation ; + PAIR + } ; + view "v" unit unit { + DROP ; + UNIT ; + PUSH mutez 5 ; + NONE key_hash ; + CREATE_CONTRACT { + storage unit ; + parameter unit ; + code { CAR ; NIL operation ; PAIR } + } ; + DROP ; + DROP ; + UNIT + } +} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SELF.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SELF.tz new file mode 100644 index 000000000000..79636452d4bf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SELF.tz @@ -0,0 +1,11 @@ +# This contract uses SELF in a view, which is forbidden. +{ + storage unit ; + parameter unit ; + code { + CAR ; + NIL operation ; + PAIR + } ; + view "v" unit unit { DROP ; SELF ; DROP ; UNIT } +} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SET_DELEGATE.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SET_DELEGATE.tz new file mode 100644 index 000000000000..7e396e55dab1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_SET_DELEGATE.tz @@ -0,0 +1,11 @@ +# This contract uses SET_DELEGATE in a view, which is forbidden. +{ + storage unit ; + parameter unit ; + code { + CAR ; + NIL operation ; + PAIR + } ; + view "v" key_hash unit { CAR ; SOME ; SET_DELEGATE ; DROP ; UNIT } +} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_TRANSFER_TOKENS.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_TRANSFER_TOKENS.tz new file mode 100644 index 000000000000..e6adb07fd31b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/forbidden_op_in_view_TRANSFER_TOKENS.tz @@ -0,0 +1,12 @@ +# This contract uses TRANSFER_TOKENS in a view, which is forbidden. +{ + storage unit ; + parameter unit ; + code { + CAR ; + NIL operation ; + PAIR + } ; + view "v" (pair unit mutez (contract unit)) unit + { CAR ; UNPAPAIR ; TRANSFER_TOKENS ; DROP ; UNIT } +} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/int-store.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/int-store.tz new file mode 100644 index 000000000000..acd5104c042b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/int-store.tz @@ -0,0 +1,3 @@ +{ parameter unit ; + storage int ; + code { CDR ; NIL operation; PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/omega.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/omega.tz new file mode 100644 index 000000000000..52adfdf1facc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/omega.tz @@ -0,0 +1,9 @@ +{ parameter unit; + storage unit; + code { CAR; + LAMBDA_REC unit unit + { EXEC }; + SWAP; + EXEC; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact.tz new file mode 100644 index 000000000000..b3dd6402f440 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact.tz @@ -0,0 +1,19 @@ +{ parameter int; + storage int; + code { CAR ; + LAMBDA_REC int int + { DUP; + EQ; + IF { PUSH int 1 } + { DUP; + DUP 3; + PUSH int 1; + DUP 4; + SUB; + EXEC; + MUL}; + DIP { DROP 2 }}; + SWAP; + EXEC; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply.tz new file mode 100644 index 000000000000..85515df4cde8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply.tz @@ -0,0 +1,24 @@ + {parameter int; + storage int; + code { CAR ; + LAMBDA_REC (pair unit int) int + { UNPAIR; + DUP 2; + EQ; + IF { PUSH int 1 } + { DUP 2; + DUP 4; + DUP 3; + APPLY; + PUSH int 1; + DUP 3; + SUB; + EXEC; + MUL}; + DIP { DROP 3 }}; + UNIT; + APPLY; + SWAP; + EXEC; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply_store.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply_store.tz new file mode 100644 index 000000000000..8d38ed03bddb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_apply_store.tz @@ -0,0 +1,27 @@ +{ storage (or int (lambda int int)); + parameter (or (unit %gen) (int %exec)); + code { UNPAIR; + IF_LEFT{ DROP 2; + LAMBDA_REC (pair unit int) int + { UNPAIR; + DUP 2; + EQ; + IF { PUSH int 1 } + { DUP 2; + DUP 4; + DUP 3; + APPLY; + PUSH int 1; + DUP 3; + SUB; + EXEC; + MUL}; + DIP { DROP 3 }}; + UNIT; + APPLY; + RIGHT int} + { DIP { ASSERT_RIGHT }; + EXEC; + LEFT (lambda int int)}; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_store.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_store.tz new file mode 100644 index 000000000000..c4825db7f634 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/rec_fact_store.tz @@ -0,0 +1,22 @@ +{ storage (or int (lambda int int)); + parameter (or (unit %gen) (int %exec)); + code { UNPAIR; + IF_LEFT{ DROP 2; + LAMBDA_REC int int + { DUP; + EQ; + IF { PUSH int 1 } + { DUP; + DUP 3; + PUSH int 1; + DUP 4; + SUB; + EXEC; + MUL}; + DIP { DROP 2 }}; + RIGHT int} + { DIP { ASSERT_RIGHT }; + EXEC; + LEFT (lambda int int)}; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz new file mode 100644 index 000000000000..0b9e2ff99264 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract.tz @@ -0,0 +1,73 @@ +# This contract manages a shielded pool with a 1 to 1 conversion with respect to +# the mutez, updated by a list of Sapling transactions. +# As a convention, all unshield transactions must contain in their `bound_data` +# field a Micheline encoded public_key_hash which is used as the recipient of +# the unshielded tez. + +storage (sapling_state 8); +parameter (list (sapling_transaction 8)); +code { # Stack manipulation + UNPAIR; + NIL operation; + SWAP; + DIP { SWAP}; + AMOUNT ; + SWAP ; + DIP {SWAP} ; + ITER { + # If the transaction is valid, the resulting stack contains the + # bound_data and balance of the transaction and the updated + # state. If the rest of the script goes well, this state + # will be the new state of the smart contract. + SAPLING_VERIFY_UPDATE; + # In the case of an invalid transaction, we stop. + ASSERT_SOME; + UNPAIR; + SWAP; + UNPAIR; + # Convert the balance in mutez, keeping the signed balance on top + # of the stack and the balance in mutez as the second element. + DUP; + DIP { ABS; # in case of negative balance i.e. shielding + PUSH mutez 1; + MUL; }; + # We have three cases now: unshielding, shielding and transfers. + # If the balance is strictly positive (i.e. unshielding), we send + # funds to the given address. + # If we can't unpack an address from the bound_data, we stop. + IFGT { + DIIP {UNPACK key_hash; + ASSERT_SOME; + IMPLICIT_ACCOUNT }; + SWAP; + # The tokens are transferred to the recipient. + DIP { UNIT; + TRANSFER_TOKENS; + SWAP; + DIP {CONS} ;}; + } + # If the balance is negative or 0 (i.e. shielding or transfer), + # we verify the amount transferred in the transaction is + # exactly the balance returned by verify_update. This enforces + # the conversion 1-1 between mutez and shielded token + # as the balance in mutez of the contract will always be + # the same as the number of tokens in the sapling_state. + # No operation is executed. + { + DIIP {SWAP}; + DIP {SWAP}; + SWAP; + SUB_MUTEZ; ASSERT_SOME; + # For a transfer or shield operation, we don't expect an + # implicit account in the `bound_data` field. + # If one is given, we fail as it might be an invalid + # operation or an erroneous call. + DIIP { SIZE; PUSH nat 0; ASSERT_CMPEQ; }; + SWAP; + }; + }; + DIP { + PUSH mutez 0; + ASSERT_CMPEQ;}; + SWAP; + PAIR} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_double.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_double.tz new file mode 100644 index 000000000000..b826428db278 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_double.tz @@ -0,0 +1,27 @@ +storage (pair (sapling_state :left 8) (sapling_state :right 8) ); +parameter (pair bool (pair (sapling_transaction :left 8) (sapling_transaction :right 8)) ); +code { UNPAIR ; + UNPAIR ; + DIP {UNPAIR} ; + DIIIP {UNPAIR} ; + DIIP {SWAP} ; + IF { SAPLING_VERIFY_UPDATE ; + ASSERT_SOME ; + CDR ; CDR ; + DIP {DIP {DUP}; + SAPLING_VERIFY_UPDATE; + ASSERT_SOME ; + DROP;}; + } + { DIP { DUP}; + SAPLING_VERIFY_UPDATE; + ASSERT_SOME; + DROP ; + DIP { SAPLING_VERIFY_UPDATE ; + ASSERT_SOME ; + CDR ; CDR; + }}; + PAIR; + NIL operation; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_drop.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_drop.tz new file mode 100644 index 000000000000..b4d4a3a56bc8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_drop.tz @@ -0,0 +1,13 @@ +storage (unit); +parameter (list (sapling_transaction 8)); +code { UNPAIR ; + SAPLING_EMPTY_STATE 8; + SWAP ; + ITER { SAPLING_VERIFY_UPDATE ; + ASSERT_SOME ; + CDR ; CDR ; + } ; + DROP ; + NIL operation; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_send.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_send.tz new file mode 100644 index 000000000000..43a6edba46ec --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_send.tz @@ -0,0 +1,20 @@ +storage (unit); +parameter (pair (contract (or (sapling_transaction 8) (sapling_state 8))) (sapling_transaction 8)); +code { UNPAIR ; + UNPAIR; + SWAP ; + SAPLING_EMPTY_STATE 8; + SWAP ; + SAPLING_VERIFY_UPDATE ; + ASSERT_SOME ; + CDR ; + CDR ; + PUSH mutez 0; + SWAP ; + RIGHT (sapling_transaction 8); + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_state_as_arg.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_state_as_arg.tz new file mode 100644 index 000000000000..e8a96df046ee --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_contract_state_as_arg.tz @@ -0,0 +1,18 @@ +storage (option (sapling_transaction 8)); +parameter (or (sapling_transaction 8) (sapling_state 8)); +code { UNPAIR ; + IF_LEFT + { + DIP {DROP;}; + SOME; + } + { DIP {ASSERT_SOME;}; + SWAP ; + SAPLING_VERIFY_UPDATE; + ASSERT_SOME; + DROP ; + NONE (sapling_transaction 8) ; + }; + NIL operation; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_push_sapling_state.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_push_sapling_state.tz new file mode 100644 index 000000000000..8d1db432bf2e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_push_sapling_state.tz @@ -0,0 +1,11 @@ +# Attempt to use `PUSH sapling_state 0` where 0 is the ID of a sapling state. +# sapling_state is not allowed in the instruction PUSH. +parameter unit; +storage unit; +code { DROP; + PUSH (sapling_state 8) 0; + DROP; + PUSH unit Unit; + NIL operation; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_use_existing_state.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_use_existing_state.tz new file mode 100644 index 000000000000..bc8c46a28d87 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/sapling_use_existing_state.tz @@ -0,0 +1,12 @@ +parameter (pair (sapling_transaction 8) (sapling_state 8)); +storage (sapling_state 8); +code { UNPAIR; + UNPAIR; + DIIP { DROP }; + SAPLING_VERIFY_UPDATE; + ASSERT_SOME; + CDR; + CDR; + NIL operation; + PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/temp_big_maps.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/temp_big_maps.tz new file mode 100644 index 000000000000..0a9162f8f982 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/temp_big_maps.tz @@ -0,0 +1,81 @@ +# Testing passing/originating with big maps from different sources +# This contract is used by test_temp_big_maps.ml + +# The left member of the parameter is either: +# - (Left True) to use a fresh big map +# - (Left False) to use the stored big map +# - (Right bigmap) to use the passed big map + +# The right member of the parameter is used to decide between: +# - passing the argument (positive value) +# - doing nothing (zero) +# - originating (negative value) + +parameter (pair (or bool (big_map int int)) int); +storage (big_map int int); +code + { # parameter * storage :: [] + UNPAIR; # parameter :: storage :: [] + UNPAIR; # parameter.fst :: parameter.snd :: storage :: [] + DIP { SWAP }; # parameter.fst :: storage :: parameter.snd :: [] + IF_LEFT + { # parameter.fst.Left :: storage :: parameter.snd :: [] + IF + { # storage :: parameter.snd :: [] + DROP; # parameter.snd :: [] + EMPTY_BIG_MAP int int; # empty_big_map :: parameter.snd :: [] + PUSH (option int) (Some 2); # Some 2 :: empty_big_map :: parameter.snd :: [] + PUSH int 1; # 1 :: Some 2 :: empty_big_map :: parameter.snd :: [] + UPDATE; # big_map { 1 -> 2 } :: parameter.snd :: [] + } + { # stored_big_map :: parameter.snd :: [] + } + } + { # parameter.fst.Right :: storage :: parameter.snd :: [] + DIP { DROP } # passed_big_map :: parameter.snd :: [] + }; + DUP; # big_map :: big_map :: parameter.snd :: [] + DIG 2; # parameter.snd :: big_map :: big_map :: [] + DUP; # parameter.snd :: parameter.snd :: big_map :: big_map :: [] + IFGT + { # parameter.snd :: big_map :: big_map :: [] + PUSH int -1; + ADD; # parameter.snd - 1 :: big_map :: big_map :: [] + SWAP; # big_map :: parameter.snd - 1 :: big_map :: [] + RIGHT bool ; # Right big_map :: parameter.snd - 1 :: big_map :: [] + PAIR; # Right big_map * (parameter.snd - 1) :: big_map :: [] + DIP { SELF; PUSH mutez 0; }; # Right big_map * (parameter.snd - 1) :: 0 mutez :: self :: big_map :: [] + TRANSFER_TOKENS; # transfer_tokens :: big_map :: [] + NIL operation; # nil_operation :: transfer_tokens :: big_map :: [] + SWAP; # transfer_tokens :: nil_operation :: big_map :: [] + CONS # list operation :: big_map :: [] + } + { # parameter.snd :: big_map :: big_map :: [] + IFEQ + { # big_map :: big_map :: [] + DROP; # big_map :: [] + NIL operation; # list operation :: big_map :: [] + } + { # big_map :: big_map :: [] + PUSH mutez 0; # 0 mutez :: big_map :: big_map :: [] + NONE key_hash; # None key_hash :: 0 mutez :: big_map :: big_map :: [] + CREATE_CONTRACT + { + parameter unit; + storage (big_map int int); + code + { + UNPAIR; + DROP; + NIL operation; + PAIR + } + }; # create_contract :: address :: big_map :: [] + DIP { DROP }; # create_contract :: big_map :: [] + NIL operation; # nil_operation :: create_contract :: big_map :: [] + SWAP; # create_contract :: nil_operation :: big_map :: [] + CONS # list operation :: big_map :: [] + }; + }; + PAIR # (list operation * big_map) :: [] + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/timelock.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/timelock.tz new file mode 100644 index 000000000000..2ddad4258117 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/contracts/timelock.tz @@ -0,0 +1,31 @@ +# This contract takes a chest and chest key as parameter. +# It tries to open it and stores the resulting bytes if successful. +# Otherwise it stores some hardcoded bytes to test that we are in +# the expected branch +storage (bytes); +parameter (pair (chest_key) (chest)); +code { + UNPAIR; + DIP {DROP}; + UNPAIR; + DIIP {PUSH nat 1000}; + OPEN_CHEST; + IF_LEFT + { # successful case + NIL operation; + PAIR ; + } + { + IF + { # first type of failure + PUSH bytes 0x01; + NIL operation; + PAIR; + } + { # second type of failure + PUSH bytes 0x00; + NIL operation; + PAIR; + } + } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune new file mode 100644 index 000000000000..4def0a0e6f5a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune @@ -0,0 +1,36 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + alcotest-lwt + tezos-base + tezos-protocol-016-PtMumbai + tezos-alpha-test-helpers + tezos-base-test-helpers + tezos-client-alpha + tezos-benchmark + tezos-micheline + tezos-benchmark-alpha + tezos-benchmark-type-inference-alpha + tezos-protocol-plugin-alpha + tezos-protocol-016-PtMumbai.parameters) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_016_PtMumbai + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers + -open Tezos_client_alpha + -open Tezos_micheline + -open Tezos_benchmark_alpha + -open Tezos_benchmark_type_inference_alpha + -open Tezos_protocol_plugin_alpha)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (deps (glob_files contracts/*) (glob_files patched_contracts/*)) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.ml new file mode 100644 index 000000000000..dd1a9f76fe0f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.ml @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/michelson + Subject: Integration > Michelson +*) + +let () = + Alcotest_lwt.run + "protocol > integration > michelson" + [ + ("global table of constants", Test_global_constants_storage.tests); + ("interpretation", Test_interpretation.tests); + ("lazy storage diff", Test_lazy_storage_diff.tests); + ("sapling", Test_sapling.tests); + ("script typed ir size", Test_script_typed_ir_size.tests); + ("temp big maps", Test_temp_big_maps.tests); + ("ticket balance key", Test_ticket_balance_key.tests); + ("ticket scanner", Test_ticket_scanner.tests); + ("ticket storage", Test_ticket_storage.tests); + ("ticket lazy storage diff", Test_ticket_lazy_storage_diff.tests); + ("ticket operations diff", Test_ticket_operations_diff.tests); + ("ticket accounting", Test_ticket_accounting.tests); + ("ticket balance", Test_ticket_balance.tests); + ("ticket manager", Test_ticket_manager.tests); + ("timelock", Test_timelock.tests); + ("typechecking", Test_typechecking.tests); + ("script cache", Test_script_cache.tests); + ("block time instructions", Test_block_time_instructions.tests); + ("annotations", Test_annotations.tests); + ("event logging", Test_contract_event.tests); + ("patched contracts", Test_patched_contracts.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml new file mode 100644 index 000000000000..200d25431759 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml @@ -0,0 +1,140 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Michelson annotations) + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^annotations$" + Subject: This module tests that Michelson annotations are properly handled. +*) + +open Protocol +open Alpha_context + +let type_with_annotations = + "(option :a (or :b (pair %c :d (int %e :f) (nat :g %h)) (bool %i :j)))" + +let contract_with_annotations = + Printf.sprintf + "{ parameter %s ;\n storage %s ;\n code { FAILWITH } }" + type_with_annotations + type_with_annotations + +let contract_factory_with_annotations = + Printf.sprintf + "{ parameter %s ;\n\ + \ storage (option address) ;\n\ + \ code { CAR ;\n\ + \ AMOUNT ;\n\ + \ NONE key_hash ;\n\ + \ CREATE_CONTRACT %s ;\n\ + \ DIP { SOME ;\n\ + \ NIL operation } ;\n\ + \ CONS ;\n\ + \ PAIR } }" + type_with_annotations + contract_with_annotations + +let lazy_none = Script.lazy_expr (Expr.from_string "None") + +let init_and_originate contract_code_string = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, source) -> + Incremental.begin_construction b >>=? fun inc -> + let code = Expr.toplevel_from_string contract_code_string in + let script = Script.{code = lazy_expr code; storage = lazy_none} in + Op.contract_origination_hash (I inc) source ~script + >>=? fun (operation, addr) -> + Incremental.add_operation inc operation >|=? fun inc -> (inc, source, addr) + +let assert_stored_script_equal inc addr expected_code_string = + Context.Contract.script (I inc) addr >>=? fun stored_script -> + Assert.equal_string + ~loc:__LOC__ + expected_code_string + (Expr.to_string stored_script) + +let get_address_from_storage inc factory_addr = + Context.Contract.storage (I inc) factory_addr >>=? fun factory_storage -> + let ctxt = Incremental.alpha_ctxt inc in + Environment.wrap_tzresult Script_typed_ir.(option_t 0 address_t) + >>?= fun option_address_t -> + Script_ir_translator.parse_data + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:false ()) + ~allow_forged:false + option_address_t + (Micheline.root factory_storage) + >>= fun res -> + Environment.wrap_tzresult res >>?= fun (factory_storage, _ctxt) -> + match factory_storage with + | Some {entrypoint; _} when not (Entrypoint.is_default entrypoint) -> + failwith "Did not expect non-default entrypoint" + | Some {destination = Tx_rollup _; _} -> + failwith "Did not expect non-contract address" + | Some {destination = Contract (Implicit _); _} -> + failwith "Did not expect implict account" + | Some {destination = Contract (Originated addr); entrypoint = _it_is_default} + -> + return addr + | _ -> + failwith + "The factory contract should have stored the address of the originated \ + contract" + +(* Checks that [contract_with_annotations] once originated is stored as is. *) +let test_external_origination () = + init_and_originate contract_with_annotations >>=? fun (inc, _source, addr) -> + assert_stored_script_equal inc addr contract_with_annotations + +(* Checks that [contract_with_annotations] originated from + [contract_factory_with_annotations] is stored as is. *) +let test_internal_origination () = + init_and_originate contract_factory_with_annotations + >>=? fun (inc, source, factory) -> + Op.transaction + (I inc) + source + (Contract.Originated factory) + ~parameters:lazy_none + Tez.zero + >>=? fun operation -> + Incremental.finalize_block inc >>=? fun b -> + Incremental.begin_construction b >>=? fun inc -> + Incremental.add_operation inc operation >>=? fun inc -> + get_address_from_storage inc factory >>=? fun addr -> + assert_stored_script_equal inc addr contract_with_annotations + +let tests = + [ + Tztest.tztest + "External origination preserves annotations" + `Quick + test_external_origination; + Tztest.tztest + "Internal origination preserves annotations" + `Quick + test_internal_origination; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml new file mode 100644 index 000000000000..030f14db0244 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 TriliTech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Michelson block-time instructions) + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^block time instructions$" + Subject: This module tests that Michelson instructions related to block time are correct. +*) + +open Tezos_protocol_016_PtMumbai_parameters +open Protocol +open Alpha_context + +let context_with_constants constants = + let open Lwt_result_syntax in + let* block, _contracts = Context.init_with_constants1 constants in + let+ incremental = Incremental.begin_construction block in + Incremental.alpha_ctxt incremental + +let test_min_block_time () = + let open Lwt_result_syntax in + let* context = context_with_constants Default_parameters.constants_mainnet in + let* result, _ = + Contract_helpers.run_script + context + ~storage:"0" + ~parameter:"Unit" + {| { parameter unit; storage nat; code { DROP; MIN_BLOCK_TIME; NIL operation; PAIR } } |} + () + in + + let expected_value = + Default_parameters.constants_mainnet.minimal_block_delay + |> Period.to_seconds |> Z.of_int64 + in + + match Micheline.root result.storage with + | Int (_, result_storage) when Z.equal result_storage expected_value -> + return_unit + | _ -> + failwith + "Expected storage to be %a, but got %a" + Z.pp_print + expected_value + Micheline_printer.print_expr + (Micheline_printer.printable + Michelson_v1_primitives.string_of_prim + result.storage) + +let tests = + [ + Tztest.tztest + "MIN_BLOCK_TIME gives current minimal block delay" + `Quick + test_min_block_time; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml new file mode 100644 index 000000000000..9625e49f354e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml @@ -0,0 +1,135 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Lwt_result_syntax + +(** Testing + ------- + Component: Protocol (event logging) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test '^event logging$' + Subject: This module tests that the event logs can be written to the receipt + in correct order and expected format. +*) + +let wrap m = m >|= Environment.wrap_tzresult + +(** Parse a Michelson contract from string. *) +let originate_contract file storage src b = + let load_file f = + let ic = open_in f in + let res = really_input_string ic (in_channel_length ic) in + close_in ic ; + res + in + let contract_string = load_file file in + let code = Expr.toplevel_from_string contract_string in + let storage = Expr.from_string storage in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + let* operation, dst = + Op.contract_origination (B b) src ~fee:(Test_tez.of_int 10) ~script + in + let* incr = Incremental.begin_construction b in + let* incr = Incremental.add_operation incr operation in + let+ b = Incremental.finalize_block incr in + (dst, b) + +(** Run emit.tz and assert that both the order of events and data content are correct *) +let contract_test () = + let* b, src = Context.init1 ~consensus_threshold:0 () in + let* dst, b = originate_contract "contracts/emit.tz" "Unit" src b in + let fee = Test_tez.of_int 10 in + let parameters = Script.unit_parameter in + let* operation = + Op.transaction ~fee ~parameters (B b) src dst (Test_tez.of_int 0) + in + let* incr = Incremental.begin_construction b in + let* incr = Incremental.add_operation incr operation in + match Incremental.rev_tickets incr with + | [ + Operation_metadata + { + contents = + Single_result + (Manager_operation_result + { + internal_operation_results = + [ + Internal_operation_result + ( { + operation = + Event {tag = tag1; payload = data1; ty = ty1}; + _; + }, + Applied (IEvent_result _) ); + Internal_operation_result + ( { + operation = + Event {tag = tag2; payload = data2; ty = ty2}; + _; + }, + Applied (IEvent_result _) ); + ]; + _; + }); + }; + ] -> + let open Micheline in + ((match root data1 with + | Prim (_, D_Right, [String (_, "right")], _) -> () + | _ -> assert false) ; + + match root data2 with + | Prim (_, D_Left, [Int (_, n)], _) -> assert (Z.to_int n = 2) + | _ -> assert false) ; + assert (Entrypoint.to_string tag1 = "tag1") ; + assert (Entrypoint.to_string tag2 = "tag2") ; + (match root ty1 with + | Prim (_, T_or, [Prim (_, T_nat, [], []); Prim (_, T_string, [], [])], []) + -> + () + | _ -> assert false) ; + (match root ty2 with + | Prim + ( _, + T_or, + [Prim (_, T_nat, [], ["%int"]); Prim (_, T_string, [], ["%str"])], + [] ) -> + () + | _ -> assert false) ; + return_unit + | _ -> assert false + +let tests = + [ + Tztest.tztest + "contract emits event with correct data in proper order" + `Quick + contract_test; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml new file mode 100644 index 000000000000..7a031944fbed --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml @@ -0,0 +1,133 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context +open Transfers + +(** Testing + ------- + Component: Protocol (global table of constants) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^global table of constants$" + Subject: This module tests that the global table of constants + can be written to and read from across blocks. +*) + +let get_next_context b = + Incremental.begin_construction b >>=? fun b -> + return (Incremental.alpha_ctxt b) + +let assert_proto_error_id loc id result = + let test err = + (Error_monad.find_info_of_error err).id + = "proto." ^ Protocol.name ^ "." ^ id + in + Assert.error ~loc result test + +let expr_to_hash expr = + let lexpr = Script_repr.lazy_expr @@ Expr.from_string expr in + Script_repr.force_bytes lexpr >|? fun b -> Script_expr_hash.hash_bytes [b] + +(* This test has a long wind-up, but is very simple: it just asserts + that values written to the global table of constants persist across + blocks. *) +let get_happy_path () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, (alice, bob)) -> + Incremental.begin_construction b >>=? fun b -> + let expr_str = "Pair 3 7" in + let expr = Expr.from_string expr_str in + Environment.wrap_tzresult @@ expr_to_hash expr_str >>?= fun hash -> + Op.register_global_constant + (I b) + ~source:alice + ~value:(Script_repr.lazy_expr expr) + >>=? fun op -> + Incremental.add_operation b op >>=? fun b -> + Incremental.finalize_block b >>=? fun b -> + let assert_unchanged b = + get_next_context b >>=? fun context -> + Global_constants_storage.get context hash >|= Environment.wrap_tzresult + >>=? fun (_, result_expr) -> + Test_global_constants.assert_expr_equal __LOC__ expr result_expr + >|=? fun () -> b + in + assert_unchanged b >>=? fun b -> + let do_many_transfers b = + Incremental.begin_construction b >>=? fun b -> + n_transactions 10 b alice bob (Tez.of_mutez_exn 1000L) >>=? fun b -> + Incremental.finalize_block b >>=? fun b -> assert_unchanged b + in + do_many_transfers b >>=? do_many_transfers >>=? do_many_transfers + >>=? fun (_ : Block.t) -> Lwt.return_ok () + +(* Blocks that include a registration of a bad expression should + fail. *) +let test_registration_of_bad_expr_fails () = + Context.init1 () >>=? fun (b, alice) -> + Incremental.begin_construction b >>=? fun b -> + (* To produce the failure, we attempt to register an expression with + a malformed hash. *) + let expr = Expr.from_string "Pair 1 (constant \"foo\")" in + Op.register_global_constant + (I b) + ~source:alice + ~value:(Script_repr.lazy_expr expr) + >>=? fun op -> + Incremental.add_operation b op + >>= assert_proto_error_id __LOC__ "Badly_formed_constant_expression" + +(* You cannot register the same expression twice. *) +let test_no_double_register () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, alice) -> + let expr = Expr.from_string "Pair 1 2" in + Op.register_global_constant + (B b) + ~source:alice + ~value:(Script_repr.lazy_expr expr) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Register the same expression again *) + Op.register_global_constant + (B b) + ~source:alice + ~value:(Script_repr.lazy_expr expr) + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op + >>= assert_proto_error_id __LOC__ "Expression_already_registered" + +let tests = + [ + Tztest.tztest "Multiple blocks happy path" `Quick get_happy_path; + Tztest.tztest + "Bad register global operations fail when added to the block" + `Quick + test_registration_of_bad_expr_fails; + Tztest.tztest + "You cannot register the same expression twice." + `Quick + test_no_double_register; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml new file mode 100644 index 000000000000..ebb8358c3f49 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml @@ -0,0 +1,451 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (interpretation) + Dependencies: src/proto_alpha/lib_protocol/script_interpreter.ml + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test "^interpretation$" + Subject: Interpretation of Michelson scripts +*) + +open Protocol +open Alpha_context +open Script_interpreter + +let test_context () = + Context.init3 () >>=? fun (b, _cs) -> + Incremental.begin_construction b >>=? fun v -> + return (Incremental.alpha_ctxt v) + +let logger = + Script_interpreter_logging.make + (module struct + let log_interp _ _ _ _ _ = () + + let log_entry _ _ _ _ _ = () + + let log_exit _ _ _ _ _ = () + + let log_control _ = () + + let get_log () = Lwt.return (Ok None) + end) + +let run_step ctxt code accu stack = + let open Script_interpreter in + let open Contract_helpers in + Internals.step_descr None ctxt default_step_constants code accu stack + >>=? fun ((_, _, ctxt') as r) -> + Internals.step_descr (Some logger) ctxt default_step_constants code accu stack + >>=? fun (_, _, ctxt'') -> + if Gas.(remaining_operation_gas ctxt' <> remaining_operation_gas ctxt'') then + Alcotest.failf "Logging should not have an impact on gas consumption." ; + return r + +(** Runs a script with an ill-typed parameter and verifies that a + Bad_contract_parameter error is returned. *) +let test_bad_contract_parameter () = + test_context () >>=? fun ctx -> + (* Run script with a parameter of wrong type *) + Contract_helpers.run_script + ctx + "{parameter unit; storage unit; code { CAR; NIL operation; PAIR }}" + ~storage:"Unit" + ~parameter:"0" + () + >>= function + | Ok _ -> Alcotest.fail "expected an error" + | Error (Environment.Ecoproto_error (Bad_contract_parameter source') :: _) -> + Alcotest.(check Testable.contract) + "incorrect field in Bad_contract_parameter" + (Contract.Originated Contract_helpers.default_self) + source' ; + return_unit + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +let test_multiplication_close_to_overflow_passes () = + test_context () >>=? fun ctx -> + (* Get sure that multiplication deals with numbers between 2^62 and + 2^63 without overflowing *) + Contract_helpers.run_script + ctx + "{parameter unit;storage unit;code {DROP; PUSH mutez 2944023901536524477; \ + PUSH nat 2; MUL; DROP; UNIT; NIL operation; PAIR}}" + ~storage:"Unit" + ~parameter:"Unit" + () + >>= function + | Ok _ -> return_unit + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +let dummy_loc = -1 + +(** The purpose of these two tests is to check that the Michelson interpreter is + stack-safe (because it is tail-recursive). + + This requires to confront it to deep recursions, typically deeper than what + the gas limit allows. Unfortunately we cannot run the interpreter in + unaccounted gas mode because for efficiency it uses a custom gas management + that represents the gas counter as a mere integer. Instead we set the gas + counter to the highest possible value ([Saturation_repr.saturated]); with + the current gas costs and limits this enables more than a million recursive + calls which is larger than the stack size. *) + +let test_stack_overflow () = + let open Script_typed_ir in + test_context () >>=? fun ctxt -> + (* Set the gas counter to the maximum value *) + let ctxt = + Gas.update_remaining_operation_gas ctxt + @@ Gas.fp_of_milligas_int (Saturation_repr.saturated :> int) + in + let stack = Bot_t in + let descr kinstr = {kloc = 0; kbef = stack; kaft = stack; kinstr} in + let enorme_et_seq n = + let rec aux n acc = + if n = 0 then acc + else + aux (n - 1) (IConst (dummy_loc, Bool_t, true, IDrop (dummy_loc, acc))) + in + aux n (IHalt dummy_loc) + in + run_step ctxt (descr (enorme_et_seq 1_000_000)) EmptyCell EmptyCell + >>= function + | Ok _ -> return_unit + | Error trace -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + Alcotest.failf "Unexpected error (%s) at %s" trace_string __LOC__ + +(** The stack-safety of the interpreter relies a lot on the stack-safety of + Lwt.bind. This second test is similar to the previous one but uses an + instruction (IBig_map_mem) for which the interpreter calls Lwt.bind. *) + +let test_stack_overflow_in_lwt () = + let open Script_typed_ir in + test_context () >>=? fun ctxt -> + let ctxt = + Gas.update_remaining_operation_gas ctxt + @@ Gas.fp_of_milligas_int (Saturation_repr.saturated :> int) + in + let stack = Bot_t in + let descr kinstr = {kloc = 0; kbef = stack; kaft = stack; kinstr} in + let push_empty_big_map k = IEmpty_big_map (dummy_loc, unit_t, unit_t, k) in + let large_mem_seq n = + let rec aux n acc = + if n = 0 then acc + else + aux + (n - 1) + (IDup + ( dummy_loc, + IConst + ( dummy_loc, + Unit_t, + (), + IBig_map_mem (dummy_loc, IDrop (dummy_loc, acc)) ) )) + in + aux n (IDrop (dummy_loc, IHalt dummy_loc)) + in + let script = push_empty_big_map (large_mem_seq 1_000_000) in + run_step ctxt (descr script) EmptyCell EmptyCell >>= function + | Ok _ -> return_unit + | Error trace -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + Alcotest.failf "Unexpected error (%s) at %s" trace_string __LOC__ + +(** Test the encoding/decoding of script_interpreter.ml specific errors *) +let test_json_roundtrip name testable enc v = + let v' = + Data_encoding.Json.destruct enc (Data_encoding.Json.construct enc v) + in + Alcotest.check + testable + (Format.asprintf "round trip should not change value of %s" name) + v + v' ; + return_unit + +(** Encoding/decoding of script_interpreter.ml specific errors. *) +let test_json_roundtrip_err name e () = + test_json_roundtrip + name + Testable.protocol_error + Environment.Error_monad.error_encoding + e + +let error_encoding_tests = + let contract_zero = + Contract.Implicit Tezos_crypto.Signature.Public_key_hash.zero + in + let script_expr_int = Micheline.strip_locations (Micheline.Int (0, Z.zero)) in + List.map + (fun (name, e) -> + Tztest.tztest + (Format.asprintf "test error encoding: %s" name) + `Quick + (test_json_roundtrip_err name e)) + [ + ("Reject", Reject (0, script_expr_int, None)); + ("Overflow", Overflow (0, None)); + ("Runtime_contract_error", Runtime_contract_error Contract_hash.zero); + ("Bad_contract_parameter", Bad_contract_parameter contract_zero); + ("Cannot_serialize_failure", Cannot_serialize_failure); + ("Cannot_serialize_storage", Cannot_serialize_storage); + ] + +module Test_map_instr_on_options = struct + type storage = {prev : int option; total : int} + + (* storage: (last input * total); param replaces the last input and + if some – gets added to the total. *) + let test_map_option_script = + {| { parameter (option int); + storage (pair (option int) int); + code { + UNPAIR ; + DIP { CDR } ; + MAP { + DUP ; + DIP { ADD } ; + } ; + PAIR ; + NIL operation ; + PAIR ; + } + } |} + + let run_test_map_opt_script param {prev; total} = + let storage = + Option.fold + ~none:(Format.sprintf "Pair None %d" total) + ~some:(fun p -> Format.sprintf "Pair (Some %d) %d" p total) + prev + in + let parameter = + Option.fold ~none:"None" ~some:(Format.sprintf "Some %d") param + in + test_context () >>=? fun ctxt -> + Contract_helpers.run_script + ctxt + test_map_option_script + ~storage + ~parameter + () + + let assume_storage_shape = + let open Micheline in + let open Michelson_v1_primitives in + function + | Prim (_, D_Pair, [Prim (_, D_None, [], _); Int (_, total)], _) -> + {prev = None; total = Z.to_int total} + | Prim (_, D_Pair, [Prim (_, D_Some, [Int (_, prev)], _); Int (_, total)], _) + -> + {prev = Some (Z.to_int prev); total = Z.to_int total} + | _ -> QCheck2.assume_fail () + + let assertions storage_before storage_after = function + | None -> + Assert.is_none ~loc:__LOC__ ~pp:Format.pp_print_int storage_after.prev + >>=? fun () -> + Assert.equal_int ~loc:__LOC__ storage_before.total storage_after.total + | Some input -> + Assert.get_some ~loc:__LOC__ storage_after.prev >>=? fun prev_aft -> + Assert.equal_int ~loc:__LOC__ input prev_aft >>=? fun () -> + Assert.equal_int + ~loc:__LOC__ + (storage_before.total + input) + storage_after.total + + let test_mapping (input, prev, total) = + let storage_before = {prev; total} in + run_test_map_opt_script input storage_before >>=? fun ({storage; _}, _) -> + let new_storage = assume_storage_shape (Micheline.root storage) in + assertions storage_before new_storage input +end + +let test_contract path storage param ~entrypoint_str ~ok ~ko = + let entrypoint = + match entrypoint_str with + | None -> Entrypoint.default + | Some str -> Entrypoint.of_string_strict_exn str + in + test_context () >>=? fun ctx -> + let read_file filename = + let ch = open_in filename in + let s = really_input_string ch (in_channel_length ch) in + close_in ch ; + s + in + let script = read_file path in + Contract_helpers.run_script + ctx + script + ~storage + ~parameter:param + ~entrypoint + () + >>= function + | Ok (res, _) -> ok res + | Error t -> ko t + +let fail_with_trace trace = + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace trace + +let test_contract_success path storage param expected_storage_str + ?entrypoint_str () = + let expected_storage = Expr.from_string expected_storage_str in + test_contract + path + storage + param + ~ok:(fun real -> + if real.storage = expected_storage then return_unit + else Alcotest.fail "Unexpected result") + ~ko:fail_with_trace + ~entrypoint_str + +let test_contract_fail path storage param ?entrypoint_str () = + test_contract + path + storage + param + ~ok:(fun _ -> + Alcotest.failf + "Unexpected success: interpreting %s should have failed." + path) + ~ko:(fun _ -> return_unit) + ~entrypoint_str + +let test_store_and_reload path ~init_storage ~entrypoint_str_1 ~param_1 + ~expected_storage_str_1 ~entrypoint_str_2 ~param_2 ~expected_storage_str_2 + () = + let expected_storage_1 = Expr.from_string expected_storage_str_1 in + test_contract + path + init_storage + param_1 + ~entrypoint_str:(Some entrypoint_str_1) + ~ok:(fun real -> + if real.storage = expected_storage_1 then + test_contract_success + path + expected_storage_str_1 + param_2 + expected_storage_str_2 + ~entrypoint_str:entrypoint_str_2 + () + else + Alcotest.failf + "Unexpected result. \n Expected :\n %s \n Real : \n %s \n" + (Expr.to_string expected_storage_1) + (Expr.to_string real.storage)) + ~ko:fail_with_trace + +let tests = + [ + Tztest.tztest "test bad contract error" `Quick test_bad_contract_parameter; + Tztest.tztest "check robustness overflow error" `Slow test_stack_overflow; + Tztest.tztest + "check robustness overflow error in lwt" + `Slow + test_stack_overflow_in_lwt; + Tztest.tztest + "test multiplication no illegitimate overflow" + `Quick + test_multiplication_close_to_overflow_passes; + Tztest.tztest "test stack overflow error" `Slow test_stack_overflow; + Tztest.tztest_qcheck2 + ~name:"test map instr against options" + QCheck2.Gen.( + triple (opt small_signed_int) (opt small_signed_int) small_signed_int) + Test_map_instr_on_options.test_mapping; + Tztest.tztest + "test lambda_rec instruction" + `Quick + (test_contract_success "./contracts/rec_fact.tz" "0" "5" "120"); + Tztest.tztest + "test lambda_rec instruction with apply" + `Quick + (test_contract_success "./contracts/rec_fact_apply.tz" "0" "5" "120"); + Tztest.tztest + "test lambda_rec instruction with an infinite recursion" + `Quick + (test_contract_fail "./contracts/omega.tz" "Unit" "Unit"); + Tztest.tztest + "test lambda_rec instruction storage" + `Quick + (test_store_and_reload + "./contracts/rec_fact_store.tz" + ~init_storage:"Left 0" + ~entrypoint_str_1:"gen" + ~param_1:"Unit" + ~expected_storage_str_1: + {|Right + (Lambda_rec + { DUP ; + EQ ; + IF { PUSH int 1 } { DUP ; DUP 3 ; PUSH int 1 ; DUP 4 ; SUB + ; EXEC ; MUL } ; + DIP { DROP 2 } })|} + ~entrypoint_str_2:"exec" + ~param_2:"5" + ~expected_storage_str_2:"Left 120"); + Tztest.tztest + "test lambda_rec instruction storage" + `Quick + (test_store_and_reload + "./contracts/rec_fact_apply_store.tz" + ~init_storage:"Left 0" + ~entrypoint_str_1:"gen" + ~param_1:"Unit" + ~expected_storage_str_1: + {|Right + { PUSH unit Unit ; + PAIR ; + LAMBDA_REC + (pair unit int) + int + { UNPAIR ; + DUP 2 ; + EQ ; + IF { PUSH int 1 } + { DUP 2 ; DUP 4 ; DUP 3 ; APPLY ; PUSH int 1 ; DUP 3 ; + SUB ; EXEC ; MUL } ; + DIP { DROP 3 } } ; + SWAP ; + EXEC }|} + ~entrypoint_str_2:"exec" + ~param_2:"5" + ~expected_storage_str_2:"Left 120"); + ] + @ error_encoding_tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml new file mode 100644 index 000000000000..03a84159c6b2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml @@ -0,0 +1,140 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** Generation of input data *) + +let ids = + [|1; 42; 1337; 1984|] |> Array.map Z.of_int + |> Array.map Lazy_storage_kind.Big_map.Id.parse_z + +let strs = [|"0"; "True"; "nat"; "bool"|] + +let exprs = strs |> Array.map Expr.from_string + +let hashes = + strs |> Array.map (fun x -> [x]) |> Array.map Script_expr_hash.hash_string + +let updates_len_existing = [1; 2; 3] + +let updates_len_other = 0 :: updates_len_existing + +let gen_inits idx : + (( Lazy_storage_kind.Big_map.Id.t, + Lazy_storage_kind.Big_map.alloc ) + Lazy_storage_diff.init + * int list) + list = + [ + (Existing, updates_len_existing); + (Copy {src = ids.(idx - 1)}, updates_len_other); + ( Alloc {key_type = exprs.(idx); value_type = exprs.(idx - 1)}, + updates_len_other ); + ] + +let gen_update_list idx : Lazy_storage_kind.Big_map.update list = + [None; Some exprs.(idx)] + |> List.map (fun value -> + Lazy_storage_kind.Big_map. + {key = exprs.(idx); key_hash = hashes.(idx); value}) + +let rec gen_updates updates_len : Lazy_storage_kind.Big_map.updates list = + if updates_len = 0 then [] + else + gen_updates (updates_len - 1) + |> List.map (fun suffix -> + gen_update_list updates_len + |> List.map (fun prefix -> prefix :: suffix)) + |> List.flatten + +let gen_updates_list updates_lens : Lazy_storage_kind.Big_map.updates list = + updates_lens |> List.map gen_updates |> List.flatten + +let gen_diffs idx : + ( Lazy_storage_kind.Big_map.Id.t, + Lazy_storage_kind.Big_map.alloc, + Lazy_storage_kind.Big_map.updates ) + Lazy_storage_diff.diff + list = + let open Lazy_storage_diff in + Remove + :: (gen_inits idx + |> List.map (fun (init, updates_lens) -> + gen_updates_list updates_lens + |> List.map (fun updates -> Update {init; updates})) + |> List.flatten) + +let gen_diffs_items idx : Lazy_storage_diff.diffs_item list = + let id = ids.(idx) in + gen_diffs idx |> List.map (fun diff -> Lazy_storage_diff.make Big_map id diff) + +let rec gen_diffs_list len : Lazy_storage_diff.diffs list = + if len = 0 then [] + else + gen_diffs_list (len - 1) + |> List.map (fun suffix -> + gen_diffs_items len |> List.map (fun prefix -> prefix :: suffix)) + |> List.flatten + +let diffs_list_lens = [0; 1; 2; 3] + +let diffs_list : Lazy_storage_diff.diffs list = + diffs_list_lens |> List.map gen_diffs_list |> List.flatten + +(** Properties to check *) + +let conversion_roundtrip lazy_storage_diff = + let legacy_big_map_diff = + Contract_storage.Legacy_big_map_diff.of_lazy_storage_diff lazy_storage_diff + in + let reconverted = + Contract_storage.Legacy_big_map_diff.to_lazy_storage_diff + legacy_big_map_diff + in + assert (Stdlib.( = ) reconverted lazy_storage_diff) + +let encoding_roundtrip lazy_storage_diff = + let encoded = + Data_encoding.Binary.to_bytes_exn + Lazy_storage_diff.encoding + lazy_storage_diff + in + match Data_encoding.Binary.of_bytes Lazy_storage_diff.encoding encoded with + | Ok decoded -> assert (Stdlib.( = ) decoded lazy_storage_diff) + | Error _ -> Stdlib.failwith "Decoding failed" + +(** Iterator and test definitions *) + +let on_diffs f () = + List.iter f diffs_list ; + return_unit + +(* Marked Slow because they take 5 to 10 seconds and are unlikely to change *) +let tests = + [ + Tztest.tztest "conversion roundtrip" `Slow (on_diffs conversion_roundtrip); + Tztest.tztest "encoding roundtrip" `Slow (on_diffs encoding_roundtrip); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml new file mode 100644 index 000000000000..d5f13a418b5c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml @@ -0,0 +1,214 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Migration (patched scripts) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson + dune exec ./main.exe -- test "^patched contracts$" + Subject: Migration +*) + +open Tezos_micheline +open Protocol + +module type LEGACY_SCRIPT_PATCHES = sig + type t + + val script_hash : t -> Script_expr_hash.t + + val code : t -> Michelson_v1_primitives.prim Micheline.canonical + + val patches : t list +end + +module type LEGACY_PATCH_TESTS = sig + type t + + val tests : t -> unit Alcotest_lwt.test_case list +end + +let script_hash_testable = + Alcotest.testable Script_expr_hash.pp Script_expr_hash.equal + +(** This functor provides testing for legacy script patches. Patches to + be tested should be placed in a module conformal to the signature + [LEGACY_SCRIPT_PATCHES]. It should contain a list of patches and for + each patch it has to provide a hash of the patched contract and the + new code (as binary-encoded Micheline). + + Additionally for each patch 3 files need to be placed in + [patched_contracts] subdirectory: + * script_hash.original.tz – containing the original version of the + script; + * script_hash.patched.tz - containing the patched version; + * script_hash.diff - containing the diff between the two. + + These files are there so that reviewers of the migration can easily + see what changes are made to each contract and these tests make sure + that the patched code supplied in file is identical to the one + included in the migration; and that the diff is correct. *) +module Legacy_patch_test (Patches : LEGACY_SCRIPT_PATCHES) : + LEGACY_PATCH_TESTS with type t = Patches.t = struct + open Lwt_result_syntax + + type t = Patches.t + + let readable_micheline m = + let open Micheline in + map_node (fun _ -> ()) Michelson_v1_primitives.string_of_prim (root m) + + let contract_path ?(ext = "patched.tz") hash = + Filename.concat "patched_contracts" + @@ Format.asprintf "%a.%s" Script_expr_hash.pp hash ext + + let read_file ?ext hash = + let filename = contract_path ?ext hash in + Lwt_io.(with_file ~mode:Input filename read) + + (* Test that the hashes of the scripts in ./patched_contract/<hash>.original.tz + match hashes of the contracts being updated by the migration. *) + let test_original_contract legacy_script_hash () = + let*! code = read_file ~ext:"original.tz" legacy_script_hash in + let michelson = Michelson_v1_parser.parse_toplevel ~check:true code in + let*? prog = Micheline_parser.no_parsing_error michelson in + let bytes = + Data_encoding.Binary.to_bytes_exn + Alpha_context.Script.expr_encoding + prog.expanded + in + Alcotest.check + script_hash_testable + "Expr hash doesn't match" + legacy_script_hash + (Script_expr_hash.hash_bytes [bytes]) ; + return () + + (* Test that the binary-encoded versions of the patched contracts used during the + migration correspond to the content of the `./patched_contracts/<hash>.tz` + files *) + let test_patched_contract patch () = + let*! expected_michelson = read_file @@ Patches.script_hash patch in + let*? program = + Micheline_parser.no_parsing_error + @@ Michelson_v1_parser.parse_toplevel ~check:true expected_michelson + in + match + Micheline_diff.diff + ~prev:(readable_micheline @@ Patches.code patch) + ~current:(readable_micheline program.expanded) + () + with + | Some diff -> + let msg = + Format.asprintf + "Patched code for %a different than expected!\n%a" + Script_expr_hash.pp + (Patches.script_hash patch) + Micheline_printer.print_expr + diff + in + Alcotest.fail msg + | None -> return () + + (* Test that the diff files `./patched_contracts/<hash>.diff` + are the results of the `diff` command on the corresponding + original and patched files *) + let verify_diff legacy_script_hash () = + let*! expected_diff = read_file ~ext:"diff" legacy_script_hash in + let original_code = contract_path ~ext:"original.tz" legacy_script_hash in + (* The other test asserts that this is indeed the patched code. *) + let current_code = contract_path ~ext:"patched.tz" legacy_script_hash in + let diff_cmd = + ( "", + [| + "diff"; + "-u"; + "--label"; + original_code; + "--label"; + current_code; + original_code; + current_code; + |] ) + in + let*! actual_diff = Lwt_process.pread diff_cmd in + Alcotest.(check string) "same diff" expected_diff actual_diff ; + return () + + let typecheck_patched_script code () = + (* Number 3 below controls how many accounts should be + created. This number shouldn't be too small or the context + won't have enough at least [minimal_stake] tokens. *) + let* block, _contracts = Context.init3 () in + let* inc = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt inc in + let* _code, _ctxt = + Lwt.map Environment.wrap_tzresult + @@ Script_ir_translator.parse_code + ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) + ~code:(Script_repr.lazy_expr code) + ctxt + in + return () + + let tests (patch : Patches.t) = + let script_hash = Patches.script_hash patch in + [ + Tztest.tztest + (Format.asprintf + "check original contract hash %a" + Script_expr_hash.pp + script_hash) + `Quick + (test_original_contract script_hash); + Tztest.tztest + (Format.asprintf + "check patched contract %a" + Script_expr_hash.pp + script_hash) + `Quick + (test_patched_contract patch); + Tztest.tztest + (Format.asprintf "verify patch for %a" Script_expr_hash.pp script_hash) + `Quick + (verify_diff script_hash); + Tztest.tztest + (Format.asprintf "type check %a" Script_expr_hash.pp script_hash) + `Quick + (typecheck_patched_script @@ Patches.code patch); + ] +end + +(* List modules containing patched scripts here: *) +let test_modules : (module LEGACY_SCRIPT_PATCHES) list = + [(module Legacy_script_patches)] + +let tests = + List.concat_map + (fun (module Patches : LEGACY_SCRIPT_PATCHES) -> + let module Test = Legacy_patch_test (Patches) in + List.concat_map Test.tests Patches.patches) + test_modules diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml new file mode 100644 index 000000000000..d17de0ab45cf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml @@ -0,0 +1,1222 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Sapling) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test "^sapling$" + Subject: On the privacy-preserving library Sapling +*) + +open Protocol +open Alpha_context +open Test_tez + +let ( >>??= ) x y = + match x with + | Ok s -> y s + | Error err -> Lwt.return @@ Error (Environment.wrap_tztrace err) + +module Raw_context_tests = struct + open Sapling_helpers.Common + + (* This test adds to the first 100 positions in the commitments tree the + constant value `uncommitted` for which we know the corresponding root and + tests that the returned root is as expected. *) + let commitments_add_uncommitted () = + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + let module H = Tezos_sapling.Core.Client.Hash in + let cm = H.uncommitted ~height:0 in + let expected_root = H.uncommitted ~height:32 in + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size:0 >>= wrap >>=? fun ctx -> + List.fold_left_es + (fun ctx pos -> + Sapling_storage.Commitments.get_root ctx id >>= wrap + >>=? fun (ctx, root) -> + assert (root = expected_root) ; + Sapling_storage.Commitments.add + ctx + id + [H.to_commitment cm] + (Int64.of_int pos) + >>= wrap + >>=? fun (ctx, _size) -> + Sapling_storage.Commitments.get_root ctx id >>= wrap + >|=? fun (ctx, root) -> + assert (root = expected_root) ; + ctx) + ctx + (0 -- 99) + >>=? fun (_ctx : Raw_context.t) -> return_unit + + (* Nullifiers don't check for duplicates are it's done by verify_update, + however committing to disk twice the same nf causes a storage error by + trying to initialize the same key twice. *) + let nullifier_double () = + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size:0 >>= wrap >>=? fun ctx -> + let nf = gen_nf () in + let open Sapling_storage in + let state = + {id = Some id; diff = Sapling_storage.empty_diff; memo_size = 0} + in + let state = nullifiers_add state nf in + let state = nullifiers_add state nf in + assert (Compare.List_length_with.(state.diff.nullifiers = 2)) ; + Sapling_storage.Nullifiers.size ctx id >>= wrap >>=? fun disk_size -> + assert (disk_size = 0L) ; + Sapling_storage.apply_diff ctx id state.diff |> assert_error + + (* In this test we add two lists of nullifiers to the state, one is applied to + the context (committed to disk) and one is kept in kept in a diff (only in + memory). We then check that nullifier_mem answers true for those two lists + and false for a third one. *) + let nullifier_test () = + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size:0 >>= wrap >>=? fun ctx -> + let nf_list_ctx = + WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> gen_nf ()) + in + let state = + List.fold_left + (fun state nf -> Sapling_storage.nullifiers_add state nf) + {id = Some id; diff = Sapling_storage.empty_diff; memo_size = 0} + nf_list_ctx + in + Sapling_storage.apply_diff ctx id state.diff >>= wrap >>=? fun (ctx, _) -> + let nf_list_diff = + WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> gen_nf ()) + in + let state = + List.fold_left + (fun state nf -> Sapling_storage.nullifiers_add state nf) + state + nf_list_diff + in + List.iter_ep + (fun nf -> + Sapling_storage.nullifiers_mem ctx state nf >>= wrap + >>=? fun (_, bool) -> + assert bool ; + return_unit) + (nf_list_ctx @ nf_list_diff) + >>=? fun () -> + let nf_list_absent = + WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> gen_nf ()) + in + List.iter_ep + (fun nf -> + Sapling_storage.nullifiers_mem ctx state nf >>= wrap + >>=? fun (_, bool) -> + assert (not bool) ; + return_unit) + nf_list_absent + + (* This test applies a diff with tuples of ciphertext, commitment. Then it + checks the result of get_from with different indexes. *) + let cm_cipher_test () = + Random.self_init () ; + let memo_size = Random.int 200 in + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size >>= wrap >>=? fun ctx -> + Sapling_storage.state_from_id ctx id >>= wrap >>=? fun (diff, ctx) -> + let list_added = + WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> + gen_cm_cipher ~memo_size ()) + in + let state = Sapling_storage.add diff list_added in + Sapling_storage.apply_diff ctx id state.diff >>= wrap >>=? fun (ctx, _) -> + let rec test_from from until expected = + if from > until then return_unit + else + Sapling_storage.Ciphertexts.get_from ctx id from >>= wrap + >>=? fun (ctx, result) -> + let expected_cipher = List.map snd expected in + assert (result = expected_cipher) ; + Sapling_storage.Commitments.get_from ctx id from >>= wrap + >>=? fun result -> + let expected_cm = List.map fst expected in + assert (result = expected_cm) ; + test_from + (Int64.succ from) + until + (WithExceptions.Option.get ~loc:__LOC__ @@ List.tl expected) + in + test_from 0L 9L list_added + + (* This test tests the insertion of a list vs inserting one by one. + It does so by checking the equality of the roots. *) + let list_insertion_test () = + Random.self_init () ; + let memo_size = Random.int 200 in + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id_one_by_one) -> + Sapling_storage.init ctx id_one_by_one ~memo_size >>= wrap >>=? fun ctx -> + let list_to_add = + fst @@ List.split + @@ WithExceptions.List.init ~loc:__LOC__ 33 (fun _ -> + gen_cm_cipher ~memo_size ()) + in + let rec test counter ctx = + if counter >= 32 then return_unit + else + (* add a single cm to the existing tree *) + Sapling_storage.Commitments.add + ctx + id_one_by_one + [ + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth list_to_add counter; + ] + (Int64.of_int counter) + >>= wrap + (* create a new tree and add a list of cms *) + >>=? fun (ctx, _size) -> + Lazy_storage_diff.fresh + Lazy_storage_kind.Sapling_state + ~temporary:false + ctx + >>= wrap + >>=? fun (ctx, id_all_at_once) -> + Sapling_storage.init ctx id_all_at_once ~memo_size >>= wrap + >>=? fun ctx -> + Sapling_storage.Commitments.add + ctx + id_all_at_once + (WithExceptions.List.init ~loc:__LOC__ (counter + 1) (fun i -> + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth list_to_add i)) + 0L + >>= wrap + >>=? fun (ctx, _size) -> + Sapling_storage.Commitments.get_root ctx id_one_by_one >>= wrap + >>=? fun (ctx, root_one_by_one) -> + Sapling_storage.Commitments.get_root ctx id_all_at_once >>= wrap + >>=? fun (ctx, root_all_at_once) -> + assert (root_all_at_once = root_one_by_one) ; + test (counter + 1) ctx + in + test 0 ctx + + (* This test adds 10 more roots the maximum capacity, all at different + levels, and checks that all but the first 10 are stored. + Then it adds one in the diff and checks it is stored. + Then it adds 10 at the same level and check that only the last one is + stored. *) + let root_test () = + let open Tezos_sapling.Core in + let gen_root () = + Data_encoding.Binary.of_bytes_exn + Validator.Hash.encoding + (Tezos_crypto.Hacl.Rand.gen 32) + in + let roots_ctx = + WithExceptions.List.init + ~loc:__LOC__ + (Int32.to_int Sapling_storage.Roots.size + 10) + (fun _ -> gen_root ()) + in + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size:0 >>= wrap >>=? fun ctx -> + (* Add one root per level to the context *) + List.fold_left_es + (fun (ctx, cnt) root -> + Sapling_storage.Roots.add ctx id root >>= wrap >>=? fun ctx -> + (* Very low level way to "bake" a block. It would be better to use the + helpers functions but they complicate the access to the raw_context. *) + Raw_context.prepare + ~level:(Int32.add b.header.shell.level cnt) + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + (Raw_context.recover ctx) + >>= wrap + >|=? fun ctx -> (ctx, Int32.succ cnt)) + (ctx, 0l) + roots_ctx + >>=? fun (ctx, _) -> + (* Check mem on all the roots in the context. *) + let state = + Sapling_storage. + {id = Some id; diff = Sapling_storage.empty_diff; memo_size = 0} + in + List.fold_left_es + (fun i root -> + Sapling_storage.root_mem ctx state root >>= wrap >|=? fun bool -> + assert (if i < 10 then not bool else bool) ; + i + 1) + 0 + roots_ctx + >>=? fun (_ : int) -> + (* Add roots w/o increasing the level *) + let roots_same_level = + WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> gen_root ()) + in + List.fold_left_es + (fun ctx root -> Sapling_storage.Roots.add ctx id root >>= wrap) + ctx + roots_same_level + >>=? fun ctx -> + List.fold_left_es + (fun (i, ctx) root -> + Sapling_storage.root_mem ctx state root >>= wrap >|=? fun bool -> + assert (if i < 9 then not bool else bool) ; + (i + 1, ctx)) + (0, ctx) + roots_same_level + >>=? fun (_, _) -> return_unit + + let test_get_memo_size () = + Context.init1 () >>=? fun (b, _contract) -> + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >>= wrap + >>=? fun ctx -> + Lazy_storage_diff.fresh Lazy_storage_kind.Sapling_state ~temporary:false ctx + >>= wrap + >>=? fun (ctx, id) -> + Sapling_storage.init ctx id ~memo_size:0 >>= wrap >>=? fun ctx -> + Sapling_storage.get_memo_size ctx id >>= wrap >|=? fun memo_size -> + assert (memo_size = 0) +end + +module Alpha_context_tests = struct + open Sapling_helpers.Alpha_context_helpers + + (* Create a transaction with memo_size 1, test that is validates with a newly + created empty_state with memo_size 1 and does not with memo_size 0. *) + let test_verify_memo () = + init () >>=? fun ctx -> + let sk = + Tezos_sapling.Core.Wallet.Spending_key.of_seed + (Tezos_crypto.Hacl.Rand.gen 32) + in + let vt = + let ps = Tezos_sapling.Storage.empty ~memo_size:0 in + (* the dummy output will have memo_size 0 *) + Tezos_sapling.Forge.forge_transaction + ~number_dummy_outputs:1 + [] + [] + sk + "anti-replay" + ~bound_data:"" + ps + in + verify_update ctx vt ~memo_size:0 |> assert_some >>=? fun (_, _) -> + verify_update ctx vt ~memo_size:1 |> assert_none + + (* Bench the proving and validation time of shielding and transferring several + tokens. *) + let test_bench_phases () = + init () >>=? fun ctx -> + let rounds = 5 in + Printf.printf "\nrounds: %d\n" rounds ; + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + (* one verify_update to get the id *) + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id) -> + client_state_alpha ctx id >>=? fun cs -> + let start = Unix.gettimeofday () in + let vts = List.map (fun _ -> transfer w cs []) (1 -- rounds) in + let ctime_shields = Unix.gettimeofday () -. start in + Printf.printf "client_shields %f\n" ctime_shields ; + let start = Unix.gettimeofday () in + List.fold_left_es + (fun ctx vt -> + verify_update ctx ~id vt |> assert_some >|=? fun (ctx, _id) -> ctx) + ctx + vts + >>=? fun ctx -> + let vtime_shields = Unix.gettimeofday () -. start in + Printf.printf "valdtr_shields %f\n" vtime_shields ; + client_state_alpha ctx id >>=? fun cs -> + let start = Unix.gettimeofday () in + let vts = List.map (fun i -> transfer w cs [i]) (1 -- rounds) in + let ctime_transfers = Unix.gettimeofday () -. start in + Printf.printf "client_txs %f\n" ctime_transfers ; + let start = Unix.gettimeofday () in + List.fold_left_es + (fun ctx vt -> + verify_update ctx ~id vt |> assert_some >|=? fun (ctx, _id) -> ctx) + ctx + vts + >|=? fun (_ctx : context) -> + let vtime_transfers = Unix.gettimeofday () -. start in + Printf.printf "valdtr_txs %f\n" vtime_transfers + + (* Same as before but for the legacy instruction. *) + let test_bench_phases_legacy () = + init () >>=? fun ctx -> + let rounds = 5 in + Printf.printf "\nrounds: %d\n" rounds ; + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + (* one verify_update to get the id *) + let vt = transfer_legacy w cs [] in + verify_update_legacy ctx vt |> assert_some >>=? fun (ctx, id) -> + client_state_alpha ctx id >>=? fun cs -> + let start = Unix.gettimeofday () in + let vts = List.map (fun _ -> transfer_legacy w cs []) (1 -- rounds) in + let ctime_shields = Unix.gettimeofday () -. start in + Printf.printf "client_shields %f\n" ctime_shields ; + let start = Unix.gettimeofday () in + List.fold_left_es + (fun ctx vt -> + verify_update_legacy ctx ~id vt |> assert_some >|=? fun (ctx, _id) -> + ctx) + ctx + vts + >>=? fun ctx -> + let vtime_shields = Unix.gettimeofday () -. start in + Printf.printf "valdtr_shields %f\n" vtime_shields ; + client_state_alpha ctx id >>=? fun cs -> + let start = Unix.gettimeofday () in + let vts = List.map (fun i -> transfer_legacy w cs [i]) (1 -- rounds) in + let ctime_transfers = Unix.gettimeofday () -. start in + Printf.printf "client_txs %f\n" ctime_transfers ; + let start = Unix.gettimeofday () in + List.fold_left_es + (fun ctx vt -> + verify_update_legacy ctx ~id vt |> assert_some >|=? fun (ctx, _id) -> + ctx) + ctx + vts + >|=? fun (_ctx : context) -> + let vtime_transfers = Unix.gettimeofday () -. start in + Printf.printf "valdtr_txs %f\n" vtime_transfers + + (* Transfer several times the same token. *) + let test_bench_fold_over_same_token () = + init () >>=? fun ctx -> + let rounds = 5 in + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + (* one verify_update to get the id *) + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id) -> + let rec loop cnt ctx = + if cnt >= rounds then return_unit + else + (* inefficient: re-synch from scratch at each round *) + client_state_alpha ctx id >>=? fun cs -> + let vt = transfer w cs [cnt] in + verify_update ctx ~id vt |> assert_some >>=? fun (ctx, _id) -> + loop (cnt + 1) ctx + in + loop 0 ctx + + (* + The following tests trigger all the branches of + Sapling_validator.verify_update. + The function performs several checks and returns None in case of failure. + During development the function was modified to throw a different exception + for each of its checks so to be sure that they were reached. + *) + + (* Test that double spending the same input fails the nf check. *) + let test_double_spend_same_input () = + init () >>=? fun ctx -> + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + (* one verify_update to get the id *) + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id) -> + client_state_alpha ctx id >>=? fun cs -> + let vt = transfer w cs [0] in + verify_update ctx ~id vt |> assert_some >>=? fun (_ctx, id) -> + let vt = transfer w cs [0; 0] in + verify_update ctx ~id vt |> assert_none + + let test_verifyupdate_one_transaction () = + init () >>=? fun ctx -> + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id) -> + client_state_alpha ctx id >>=? fun cs -> + let vt = transfer w cs [0] in + (* fails sig check because of wrong balance *) + let vt_broken = + Tezos_sapling.Core.Validator.UTXO. + {vt with balance = Int64.(succ vt.balance)} + in + verify_update ctx ~id vt_broken |> assert_none >>=? fun () -> + (* randomize one output to fail check outputs *) + (* don't randomize the ciphertext as it is not part of the proof *) + let open Tezos_sapling.Core.Client.UTXO in + let o = WithExceptions.Option.get ~loc:__LOC__ @@ List.hd vt.outputs in + let o_wrong_cm = + { + o with + cm = randomized_byte o.cm Tezos_sapling.Core.Client.Commitment.encoding; + } + in + let vt_broken = + Tezos_sapling.Core.Validator.UTXO.{vt with outputs = [o_wrong_cm]} + in + verify_update ctx ~id vt_broken |> assert_none >>=? fun () -> + (* position inside the cv *) + let pos = Random.int 32 in + let o_wrong_cv = + { + o with + ciphertext = + randomized_byte + ~pos + o.ciphertext + Tezos_sapling.Core.Client.Ciphertext.encoding; + } + in + let vt_broken = + Tezos_sapling.Core.Validator.UTXO.{vt with outputs = [o_wrong_cv]} + in + verify_update ctx ~id vt_broken |> assert_none + + let test_verifyupdate_two_transactions () = + init () >>=? fun ctx -> + let w = wallet_gen () in + let cs = Tezos_sapling.Storage.empty ~memo_size:8 in + (* generate the first storage *) + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id1) -> + client_state_alpha ctx id1 >>=? fun cs1 -> + let vt1 = transfer w cs1 [0] in + (* generate the second storage *) + let vt = transfer w cs [] in + verify_update ctx vt |> assert_some >>=? fun (ctx, id2) -> + client_state_alpha ctx id2 >>=? fun cs2 -> + let vt2 = transfer w cs2 [0] in + (* fail root check *) + verify_update ctx ~id:id1 vt2 |> assert_none >>=? fun () -> + (* Swap the root so that it passes the root_mem check but fails + the input check *) + let vt1_broken = + Tezos_sapling.Core.Validator.UTXO.{vt2 with root = vt1.root} + in + verify_update ctx ~id:id1 vt1_broken |> assert_none >>=? fun () -> + (* fail the sig check *) + let vt1_broken = + Tezos_sapling.Core.Validator.UTXO.{vt1 with outputs = vt2.outputs} + in + verify_update ctx ~id:id1 vt1_broken |> assert_none +end + +module Interpreter_tests = struct + open Sapling_helpers.Interpreter_helpers + + let parameters_of_list transactions = + let string = "{ " ^ String.concat " ; " transactions ^ " }" in + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + + (* In this test we use a contract which takes a list of transactions, applies + all of them, and assert all of them are correct. It also enforces a 1-to-1 + conversion with mutez by asking an amount to shield and asking for a pkh to + unshield. + We create 2 keys a and b. We originate the contract, then do two lists of + shield for a, then transfers several outputs to b while unshielding, then + transfer all of b inputs to a while adding dummy inputs and outputs. + At last we fail we make a failing transaction. *) + let test_shielded_tez () = + init () >>=? fun (genesis, baker, src0, src1) -> + let memo_size = 8 in + originate_contract_hash + "contracts/sapling_contract.tz" + "{ }" + src0 + genesis + baker + >>=? fun (dst, b1, anti_replay) -> + let wa = wallet_gen () in + let list_transac, total = + shield ~memo_size wa.sk 4 wa.vk (Format.sprintf "0x%s") anti_replay + in + let parameters = parameters_of_list list_transac in + (* a does a list of shield transaction *) + transac_and_sync ~memo_size b1 parameters total src0 dst baker + >>=? fun (b2, _state) -> + (* we shield again on another block, forging with the empty state *) + let list_transac, total = + shield ~memo_size wa.sk 4 wa.vk (Format.sprintf "0x%s") anti_replay + in + let parameters = parameters_of_list list_transac in + (* a does a list of shield transaction *) + transac_and_sync ~memo_size b2 parameters total src0 dst baker + >>=? fun (b3, state) -> + (* address that will receive an unshield *) + Context.Contract.balance (B b3) src1 >>=? fun balance_before_shield -> + (* address that will receive an unshield *) + let wb = wallet_gen () in + let list_addr = gen_addr 15 wb.vk in + let list_forge_input = + WithExceptions.List.init ~loc:__LOC__ 14 (fun pos_int -> + let pos = Int64.of_int pos_int in + let forge_input = + snd + (Tezos_sapling.Forge.Input.get state pos wa.vk + |> WithExceptions.Option.get ~loc:__LOC__) + in + forge_input) + in + let list_forge_output = + List.map + (fun addr -> Tezos_sapling.Forge.make_output addr 1L (Bytes.create 8)) + list_addr + in + (let pkh = Context.Contract.pkh src1 in + Incremental.begin_construction b3 >>=? fun incr -> + let alpha_ctxt = Incremental.alpha_ctxt incr in + Script_ir_translator.pack_data alpha_ctxt Script_typed_ir.key_hash_t pkh + >>= wrap + >>=? fun (bound_data, _alpha_ctxt) -> return bound_data) + >>=? fun bound_data -> + let hex_transac = + to_hex + (Tezos_sapling.Forge.forge_transaction + ~number_dummy_inputs:0 + ~number_dummy_outputs:0 + list_forge_input + list_forge_output + wa.sk + anti_replay + ~bound_data:(Bytes.to_string bound_data) + state) + Tezos_sapling.Core.Client.UTXO.transaction_encoding + in + let string = Format.sprintf "{0x%s}" hex_transac in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + in + (* a transfers to b and unshield some money to src_1 (the pkh) *) + transac_and_sync ~memo_size b3 parameters 0 src0 dst baker + >>=? fun (b4, state) -> + Context.Contract.balance (B b4) src1 >>=? fun balance_after_shield -> + let diff_due_to_shield = + Int64.sub + (Test_tez.to_mutez balance_after_shield) + (Test_tez.to_mutez balance_before_shield) + in + (* The balance after shield is obtained from the balance before shield by + the shield specific update. *) + (* The inputs total [total] mutez and 15 of those are transfered in shielded tez *) + Assert.equal_int ~loc:__LOC__ (Int64.to_int diff_due_to_shield) (total - 15) + >>=? fun () -> + let list_forge_input = + WithExceptions.List.init ~loc:__LOC__ 15 (fun i -> + let pos = Int64.of_int (i + 14 + 14) in + let forge_input = + snd + (Tezos_sapling.Forge.Input.get state pos wb.vk + |> WithExceptions.Option.get ~loc:__LOC__) + in + forge_input) + in + let addr_a = + snd + @@ Tezos_sapling.Core.Client.Viewing_key.new_address + wa.vk + Tezos_sapling.Core.Client.Viewing_key.default_index + in + let output = Tezos_sapling.Forge.make_output addr_a 15L (Bytes.create 8) in + let hex_transac = + to_hex + (Tezos_sapling.Forge.forge_transaction + ~number_dummy_inputs:2 + ~number_dummy_outputs:2 + list_forge_input + [output] + wb.sk + anti_replay + ~bound_data:"" + state) + Tezos_sapling.Core.Client.UTXO.transaction_encoding + in + let string = Format.sprintf "{0x%s}" hex_transac in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + in + (* b transfers to a with dummy inputs and outputs *) + transac_and_sync ~memo_size b4 parameters 0 src0 dst baker + >>=? fun (b, state) -> + (* Here we fail by doing the same transaction again*) + Incremental.begin_construction b >>=? fun incr -> + let fee = Test_tez.of_int 10 in + let dst = Alpha_context.Contract.Originated dst in + Op.transaction ~gas_limit:Max ~fee (B b) src0 dst Tez.zero ~parameters + >>=? fun operation -> + Incremental.add_operation (* TODO make more precise *) + ~expect_apply_failure:(fun _ -> return_unit) + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Here we fail by changing the field bound_data*) + let orginal_transac = + Tezos_sapling.Forge.forge_transaction + ~number_dummy_inputs:2 + ~number_dummy_outputs:2 + list_forge_input + [output] + wb.sk + anti_replay + ~bound_data:"right" + state + in + let modified_transac = + Tezos_sapling.Core.Validator.UTXO. + {orginal_transac with bound_data = "wrong"} + in + let string = + Format.sprintf + "{0x%s}" + (to_hex + modified_transac + Tezos_sapling.Core.Client.UTXO.transaction_encoding) + in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + in + Incremental.begin_construction b >>=? fun incr -> + let fee = Test_tez.of_int 10 in + Op.transaction ~gas_limit:Max ~fee (B b) src0 dst Tez.zero ~parameters + >>=? fun operation -> + Incremental.add_operation (* TODO make more precise *) + ~expect_apply_failure:(fun _ -> return_unit) + incr + operation + >>=? fun (_incr : Incremental.t) -> return_unit + + let test_push_sapling_state_should_be_forbidden () = + init () + (* Originating a contract to get a sapling_state with ID 0, used in the next contract *) + >>=? + fun (block, baker, src, _) -> + originate_contract_hash + "contracts/sapling_contract.tz" + "{ }" + src + block + baker + >>=? fun (_, _, _) -> + (* Originating the next contract should fail *) + originate_contract_hash + "contracts/sapling_push_sapling_state.tz" + "{ }" + src + block + baker + >>= function + | Error + [ + Environment.Ecoproto_error (Script_tc_errors.Ill_typed_contract _); + Environment.Ecoproto_error + (Script_tc_errors.Unexpected_lazy_storage _); + ] -> + return_unit + | _ -> assert false + + let test_use_state_from_other_contract_and_transact () = + (* + Attempt to use a sapling state of a contract A in a contract B + *) + init () (* Originating the contracts *) >>=? fun (block, baker, src, _) -> + let memo_size = 8 in + (* originate_contract "contracts/sapling_contract.tz" "{ }" src block baker + >>=? fun (_shielded_pool_contract_address, block, _anti_replay_shielded_pool) + -> *) + originate_contract_hash + "contracts/sapling_use_existing_state.tz" + "{ }" + src + block + baker + >>=? fun (existing_state_contract_address, block, anti_replay_2) -> + (* we create one shielding transaction and transform it in Micheline to use + it as a parameter + *) + let wa = wallet_gen () in + let transactions, _total = + shield + ~memo_size + wa.sk + 1 + wa.vk + (Format.sprintf "(Pair 0x%s 0)") + anti_replay_2 + in + let transaction = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd transactions + in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string transaction)) + in + transac_and_sync + ~memo_size + block + parameters + 0 + src + existing_state_contract_address + baker + >|= function + | Ok _ -> Alcotest.failf "Unexpected operations success" + | Error errs -> + assert ( + List.exists + (function + | Environment.Ecoproto_error + (Tezos_protocol_016_PtMumbai.Protocol.Script_tc_errors + .Unexpected_forged_value _) -> + true + | _ -> false) + errs) ; + Result.return_unit + + (* In this test we do two transactions in one block and same two in two block. + We check that the sate is the same expect for roots. + The second transaction is possible only if the first one is done. *) + let test_transac_and_block () = + init () >>=? fun (b, baker, src, _) -> + let memo_size = 8 in + originate_contract_hash "contracts/sapling_contract.tz" "{ }" src b baker + >>=? fun (dst, block_start, anti_replay) -> + let {sk; vk} = wallet_gen () in + let hex_transac_1 = hex_shield ~memo_size {sk; vk} anti_replay in + let string_1 = Format.sprintf "{%s}" hex_transac_1 in + let parameters_1 = + Alpha_context.Script.(lazy_expr (Expr.from_string string_1)) + in + transac_and_sync ~memo_size block_start parameters_1 15 src dst baker + >>=? fun (block_1, state) -> + let intermediary_root = Tezos_sapling.Storage.get_root state in + let addr = + snd + @@ Tezos_sapling.Core.Wallet.Viewing_key.(new_address vk default_index) + in + let output = Tezos_sapling.Forge.make_output addr 15L (Bytes.create 8) in + let hex_transac_2 = + "0x" + ^ to_hex + (Tezos_sapling.Forge.forge_transaction + [ + snd + (Tezos_sapling.Forge.Input.get state 0L vk + |> WithExceptions.Option.get ~loc:__LOC__); + ] + [output] + sk + anti_replay + ~bound_data:"" + state) + Tezos_sapling.Core.Client.UTXO.transaction_encoding + in + let string_2 = Format.sprintf "{%s}" hex_transac_2 in + let parameters_2 = + Alpha_context.Script.(lazy_expr (Expr.from_string string_2)) + in + transac_and_sync ~memo_size block_1 parameters_2 0 src dst baker + >>=? fun (block_1, state_1) -> + let final_root = Tezos_sapling.Storage.get_root state_1 in + Alpha_services.Contract.single_sapling_get_diff + Block.rpc_ctxt + block_1 + dst + ~offset_commitment:0L + ~offset_nullifier:0L + () + >>=? fun (_root, diff_1) -> + let fee = Test_tez.of_int 10 in + Tez.one_mutez *? Int64.of_int 15 >>?= fun amount_tez -> + Op.transaction + ~gas_limit:Max + ~fee + (B block_start) + src + (Contract.Originated dst) + amount_tez + ~parameters:parameters_1 + >>=? fun operation1 -> + Incremental.begin_construction block_start >>=? fun incr -> + (* We need to manually get the counter here *) + let ctx = Incremental.alpha_ctxt incr in + let pkh = Context.Contract.pkh src in + Alpha_context.Contract.get_counter ctx pkh >>= wrap >>=? fun counter -> + Op.transaction + ~gas_limit:Max + ~counter + ~fee + (B block_start) + src + (Contract.Originated dst) + Tez.zero + ~parameters:parameters_2 + >>=? fun operation2 -> + Op.batch_operations + ~recompute_counters:true + ~source:src + (I incr) + [operation1; operation2] + >>=? fun operation -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr >>=? fun block_2 -> + Alpha_services.Contract.single_sapling_get_diff + Block.rpc_ctxt + block_2 + dst + ~offset_commitment:0L + ~offset_nullifier:0L + () + >>=? fun (_root, diff_2) -> + (* We check that the same transactions have passed *) + assert (diff_1 = diff_2) ; + let is_root_in block dst root = + Incremental.begin_construction block >>=? fun incr -> + let ctx_2 = Incremental.alpha_ctxt incr in + Alpha_services.Contract.script Block.rpc_ctxt block dst >>=? fun script -> + let ctx_without_gas_2 = Alpha_context.Gas.set_unlimited ctx_2 in + Script_ir_translator.parse_script + ctx_without_gas_2 + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage:true + script + >>= wrap + >>=? fun (Ex_script (Script script), ctxt) -> + Script_ir_translator.get_single_sapling_state + ctxt + script.storage_type + script.storage + |> wrap + >>=? fun (id, _ctx_2) -> + let single_id = WithExceptions.Option.get ~loc:__LOC__ id in + let id = + Lazy_storage_kind.Sapling_state.Id.parse_z + @@ Alpha_context.Sapling.Id.unparse_to_z single_id + in + Raw_context.prepare + block.context + ~level:block.header.shell.level + ~predecessor_timestamp:block.header.shell.timestamp + ~timestamp:block.header.shell.timestamp + >>= wrap + >>=? fun raw_ctx -> Sapling_storage.Roots.mem raw_ctx id root >>= wrap + in + (* We check that the second state did not store the root in between + transactions. *) + is_root_in block_2 dst intermediary_root |> assert_false >>=? fun () -> + (* We check that the second state did store the final root. *) + is_root_in block_2 dst final_root |> assert_true >>=? fun () -> + (* We check that the first state did store the final root. *) + is_root_in block_1 dst final_root |> assert_true >>=? fun () -> + (* We check that the first state did store the root in between transactions. *) + is_root_in block_1 dst intermediary_root |> assert_true + + (* In this test we try a contract which creates an empty sapling state on the + fly. It then applies a list of transactions, checks they are correct and + drops the result. We make several shields in the same list (since the state + is drop). *) + let test_drop () = + init () >>=? fun (b, baker, src, _) -> + originate_contract_hash + "contracts/sapling_contract_drop.tz" + "Unit" + src + b + baker + >>=? fun (dst, b, anti_replay) -> + let {sk; vk} = wallet_gen () in + let list_transac, _total = + shield ~memo_size:8 sk 4 vk (Format.sprintf "0x%s") anti_replay + in + let parameters = parameters_of_list list_transac in + let dst = Contract.Originated dst in + Op.transaction + ~gas_limit:Max + ~fee:(Test_tez.of_int 10) + (B b) + src + dst + Tez.zero + ~parameters + >>=? fun operation -> + next_block b operation >>=? fun (_b : Block.t) -> return_unit + + (* We use a contrac with two states. Its parameter is two transactions and a + bool. The two transactions are tested valid against the two states, but + only one state according to the bool is updated. + We do two transactions shielding to different keys in the two states. + At each transactions both are applied but only state is updated. + We then check that the first state is updated in the correct way. *) + let test_double () = + init () >>=? fun (b, baker, src, _) -> + let memo_size = 8 in + originate_contract_hash + "contracts/sapling_contract_double.tz" + "(Pair { } { })" + src + b + baker + >>=? fun (dst, b, anti_replay) -> + let wa = wallet_gen () in + let hex_transac_1 = hex_shield ~memo_size wa anti_replay in + let wb = wallet_gen () in + let hex_transac_2 = hex_shield ~memo_size wb anti_replay in + let str_1 = + "(Pair True (Pair " ^ hex_transac_1 ^ " " ^ hex_transac_2 ^ "))" + in + let str_2 = + "(Pair False (Pair " ^ hex_transac_2 ^ " " ^ hex_transac_1 ^ "))" + in + (* transac 1 is applied to state_1*) + let parameters_1 = + Alpha_context.Script.(lazy_expr (Expr.from_string str_1)) + in + (* tranasc_2 is applied to state_2*) + let parameters_2 = + Alpha_context.Script.(lazy_expr (Expr.from_string str_2)) + in + let fee = Test_tez.of_int 10 in + let cdst = Contract.Originated dst in + Op.transaction + ~gas_limit:Max + ~fee + (B b) + src + cdst + Tez.zero + ~parameters:parameters_1 + >>=? fun operation -> + next_block b operation >>=? fun b -> + Op.transaction + ~gas_limit:Max + ~fee + (B b) + src + cdst + Tez.zero + ~parameters:parameters_2 + >>=? fun operation -> + next_block b operation >>=? fun b -> + Incremental.begin_construction b >>=? fun incr -> + let ctx = Incremental.alpha_ctxt incr in + let ctx_without_gas = Alpha_context.Gas.set_unlimited ctx in + Alpha_services.Contract.storage Block.rpc_ctxt b dst >>=? fun storage -> + let storage_lazy_expr = Alpha_context.Script.lazy_expr storage in + + (let memo_size = memo_size_of_int memo_size in + let open Script_typed_ir in + let state_ty = sapling_state_t ~memo_size in + pair_t (-1) state_ty state_ty) + >>??= fun (Ty_ex_c tytype) -> + Script_ir_translator.parse_storage + ctx_without_gas + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged:true + tytype + ~storage:storage_lazy_expr + >>= wrap + >>=? fun ((state_1, state_2), _ctx) -> + (*Only works when diff is empty*) + let local_state_from_disk disk_state ctx = + let id = + Alpha_context.Sapling.(disk_state.id) + |> WithExceptions.Option.get ~loc:__LOC__ + in + Alpha_context.Sapling.get_diff + ctx + id + ~offset_commitment:0L + ~offset_nullifier:0L + () + >>= wrap + >|=? fun diff -> client_state_of_diff ~memo_size diff + in + local_state_from_disk state_1 ctx >>=? fun state_1 -> + local_state_from_disk state_2 ctx >|=? fun state_2 -> + (* we check that first state contains 15 to addr_1 but not 15 to addr_2*) + assert (Option.is_some @@ Tezos_sapling.Forge.Input.get state_1 0L wa.vk) ; + assert (Option.is_some @@ Tezos_sapling.Forge.Input.get state_2 0L wa.vk) ; + assert (Option.is_none @@ Tezos_sapling.Forge.Input.get state_1 0L wb.vk) ; + assert (Option.is_none @@ Tezos_sapling.Forge.Input.get state_2 0L wb.vk) + + let test_state_as_arg () = + init () >>=? fun (b, baker, src, _) -> + originate_contract_hash + "contracts/sapling_contract_state_as_arg.tz" + "None" + src + b + baker + >>=? fun (dst, b, anti_replay) -> + originate_contract_hash + "contracts/sapling_contract_send.tz" + "Unit" + src + b + baker + >>=? fun (dst_2, b, anti_replay_2) -> + let w = wallet_gen () in + let hex_transac_1 = hex_shield ~memo_size:8 w anti_replay in + let string = "Left " ^ hex_transac_1 in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + in + let fee = Test_tez.of_int 10 in + let dst = Contract.Originated dst in + Op.transaction ~gas_limit:Max ~fee (B b) src dst Tez.zero ~parameters + >>=? fun operation -> + next_block b operation >>=? fun b -> + let contract = "0x" ^ to_hex dst Alpha_context.Contract.encoding in + let hex_transac_2 = hex_shield ~memo_size:8 w anti_replay_2 in + let string = "(Pair " ^ contract ^ " " ^ hex_transac_2 ^ ")" in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string string)) + in + let dst_2 = Contract.Originated dst_2 in + Op.transaction ~gas_limit:Max ~fee (B b) src dst_2 Tez.zero ~parameters + >>=? fun operation -> + next_block b operation >>=? fun (_b : Block.t) -> return_unit +end + +let tests = + [ + Tztest.tztest + "commitments_add_uncommitted" + `Quick + Raw_context_tests.commitments_add_uncommitted; + Tztest.tztest "nullifier_double" `Quick Raw_context_tests.nullifier_double; + Tztest.tztest "nullifier_test" `Quick Raw_context_tests.nullifier_test; + Tztest.tztest "cm_cipher_test" `Quick Raw_context_tests.cm_cipher_test; + Tztest.tztest + "list_insertion_test" + `Quick + Raw_context_tests.list_insertion_test; + Tztest.tztest "root" `Quick Raw_context_tests.root_test; + Tztest.tztest + "test_get_memo_size" + `Quick + Raw_context_tests.test_get_memo_size; + Tztest.tztest "test_verify_memo" `Quick Alpha_context_tests.test_verify_memo; + Tztest.tztest + "test_bench_phases" + `Slow + Alpha_context_tests.test_bench_phases; + Tztest.tztest + "test_bench_phases_legacy" + `Quick + Alpha_context_tests.test_bench_phases_legacy; + Tztest.tztest + "test_bench_fold_over_same_token" + `Slow + Alpha_context_tests.test_bench_fold_over_same_token; + Tztest.tztest + "test_double_spend_same_input" + `Quick + Alpha_context_tests.test_double_spend_same_input; + Tztest.tztest + "test_verifyupdate_one_transaction" + `Quick + Alpha_context_tests.test_verifyupdate_one_transaction; + Tztest.tztest + "test_verifyupdate_two_transactions" + `Quick + Alpha_context_tests.test_verifyupdate_two_transactions; + Tztest.tztest "test_shielded_tez" `Quick Interpreter_tests.test_shielded_tez; + Tztest.tztest + "test use state from other contract and transact" + `Quick + Interpreter_tests.test_use_state_from_other_contract_and_transact; + Tztest.tztest + "Instruction PUSH sapling_state 0 should be forbidden" + `Quick + Interpreter_tests.test_push_sapling_state_should_be_forbidden; + Tztest.tztest + "test_transac_and_block" + `Quick + Interpreter_tests.test_transac_and_block; + Tztest.tztest "test_drop" `Quick Interpreter_tests.test_drop; + Tztest.tztest "test_double" `Quick Interpreter_tests.test_double; + Tztest.tztest "test_state_as_arg" `Quick Interpreter_tests.test_state_as_arg; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml new file mode 100644 index 000000000000..d6797f5bf7fc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml @@ -0,0 +1,415 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (cache) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test "^script cache$" + Subject: These unit tests check basic behavior of script cache +*) + +open Protocol +open Alpha_context +open Contract_helpers +open Script_ir_translator + +exception Script_cache_test_error of string + +let err x = Exn (Script_cache_test_error x) + +(* + + The following value is hard-coded to detect change in the size + model. It has been computed by a manual run of the test. + +*) +let liquidity_baking_contract_size = 182272 + +let liquidity_baking_contract = + Contract_hash.of_b58check_exn "KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5" + +let make_block block f = + Incremental.begin_construction block >>=? fun incr -> + f (Incremental.alpha_ctxt incr) >>=? fun (ret, ctxt) -> + let incr = Incremental.set_alpha_ctxt incr ctxt in + Incremental.finalize_block incr >>=? fun block -> + Block.bake block >>=? fun next_block -> return (ret, next_block) + +let ( @! ) f g = + f @@ fun ctxt -> + g ctxt >>=? fun ret -> return (ret, ctxt) + +let throw_block_away (x, _block) = return x + +let equal_scripts (s1 : Script.t) (s2 : Script.t) = + Script_repr.( + force_bytes s1.code >>? fun code1 -> + force_bytes s2.code >>? fun code2 -> + force_bytes s1.storage >>? fun storage1 -> + force_bytes s2.storage >>? fun storage2 -> + ok (Bytes.equal code1 code2 && Bytes.equal storage1 storage2)) + |> Environment.wrap_tzresult + +let find ctxt addr = + Script_cache.find ctxt addr >|= Environment.wrap_tzresult + >>=? fun (ctxt, identifier, result) -> + match result with + | None -> + (* by [find_correctly_looks_up]. *) + assert false + | Some (script, Ex_script ir) -> + return (ctxt, identifier, script, Ex_script ir) + +let value_as_int : + type a ac. (a, ac) Script_typed_ir.ty -> a -> Script_int.z Script_int.num = + fun ty v -> match ty with Int_t -> v | _ -> Stdlib.failwith "value_as_int" + +let add_some_contracts k src block baker = + ( make_block block @@ fun ctxt -> + find ctxt liquidity_baking_contract >>=? fun (ctxt, id, _, _) -> + return (id, ctxt) ) + >>=? fun (liquidity_baking_contract_id, block) -> + List.fold_left_es + (fun (rev_contracts, block) _ -> + originate_contract_hash "contracts/int-store.tz" "31" src block baker + >>=? fun (addr, block) -> + Block.bake block >>=? fun block -> + make_block block @@ fun ctxt -> + find ctxt addr >>=? fun (ctxt, id, _, _) -> + let contract = (id, addr) in + return (contract :: rev_contracts, ctxt)) + ([], block) + (1 -- k) + >>=? fun (rev_contracts, block) -> + let contracts = + (* After each baking [liquidity_baking_contract] is the most + recently used contract. *) + let lb = (liquidity_baking_contract_id, liquidity_baking_contract) in + List.rev (lb :: rev_contracts) + in + return (contracts, block) + +(* + + The following value is hard-coded to detect change in the size + model. It has been computed by a manual run of the test. + +*) +let int_store_contract_size = 592 + +(* + + Check our assumptions regarding the size of reference scripts. + +*) +let assert_cache_size expected_size ctxt = + fail_unless + (Script_cache.size ctxt = expected_size) + (err + (Printf.sprintf + "Invalid script cache size, expecting %d, got %d" + expected_size + (Script_cache.size ctxt))) + +let test_size_of_liquidity_baking_contract () = + init () >>=? fun (block, _, _, _) -> + make_block block @! assert_cache_size liquidity_baking_contract_size + >>=? throw_block_away + +let test_size_of_int_store_contract () = + init () >>=? fun (block, baker, src, _) -> + originate_contract_hash "contracts/int-store.tz" "31" src block baker + >>=? fun (addr, block) -> + ( make_block block @! fun ctxt -> + Script_cache.find ctxt addr >|= Environment.wrap_tzresult + >>=? fun (ctxt, _, _) -> + assert_cache_size + (int_store_contract_size + liquidity_baking_contract_size) + ctxt ) + >>=? throw_block_away + +(* + + When a contract is in the context, [find] correctly returns it. + +*) +let test_find_correctly_looks_up () = + init () >>=? fun (block, baker, src, _) -> + originate_contract_hash "contracts/sapling_contract.tz" "{ }" src block baker + >>=? fun (addr, block) -> + ( make_block block @! fun ctxt -> + (* + Contract is present. + *) + Script_cache.find ctxt addr >|= Environment.wrap_tzresult + >>=? fun (_, _, result) -> + Contract.get_script ctxt addr >|= Environment.wrap_tzresult + >>=? fun (ctxt, script) -> + (match (result, script) with + | None, _ -> ok false + | Some _, None -> + (* because we assume that get_script correctly behaves. *) + assert false + | Some (cached_script, _), Some script -> equal_scripts script cached_script) + >>?= fun cond -> + fail_unless + cond + (err "find should be able to retrieve an originated contract") + (* + Contract is absent. + *) + >>=? fun () -> + let addr = Contract_helpers.fake_KT1 in + Script_cache.find ctxt addr >|= Environment.wrap_tzresult + >>=? fun (_, _, cached_contract) -> + fail_unless + (cached_contract = None) + (err "find should return None for unbound contracts") ) + >>=? throw_block_away + +(* + + [test_update] correctly modifies a cached contract in the context. + +*) +let test_update_modifies_cached_contract () = + init () >>=? fun (block, baker, src, _) -> + originate_contract_hash "contracts/int-store.tz" "36" src block baker + >>=? fun (addr, block) -> + ( make_block block @! fun ctxt -> + find ctxt addr >>=? fun (ctxt, identifier, script, Ex_script (Script ir)) -> + match ir.storage_type with + | Int_t -> + let storage' = Script_int.(add ir.storage (Script_int.of_int 1)) in + let cached_contract' = + (script, Ex_script (Script {ir with storage = storage'})) + in + Script_cache.update ctxt identifier cached_contract' 1 + |> Environment.wrap_tzresult + >>?= fun ctxt -> + find ctxt addr >>=? fun (_, _, _, Ex_script (Script ir')) -> + let storage = value_as_int ir'.storage_type ir'.storage in + fail_unless + (Script_int.compare storage storage' = 0) + (err + (Format.sprintf + "Update failed, expecting %s, got %s" + (Script_int.to_string storage') + (Script_int.to_string storage))) + | _ -> + (* by definition of int-store.tz. *) + assert false ) + >>=? throw_block_away + +(* + + [test_entries] returns the list of cached scripts in order of least + modification date. + +*) +let test_entries_returns_the_list_in_correct_order () = + let ncontracts = 10 in + init () >>=? fun (block, baker, src, _) -> + add_some_contracts ncontracts src block baker >>=? fun (contracts, block) -> + let addrs = snd @@ List.split contracts in + ( make_block block @! fun ctxt -> + Script_cache.entries ctxt |> Environment.wrap_tzresult >>?= fun entries -> + let cached_contracts = fst (List.split entries) in + fail_unless + (addrs = cached_contracts) + (err "entries must return cached contracts in order") ) + >>=? throw_block_away + +(* + + [test_contract_rank] correctly computes LRU rank. + +*) +let test_contract_rank_is_lru_rank () = + let ncontracts = 10 in + init () >>=? fun (block, baker, src, _) -> + add_some_contracts ncontracts src block baker >>=? fun (contracts, block) -> + let addrs = snd @@ List.split contracts in + ( make_block block @! fun ctxt -> + let rec check_rank k = function + | [] -> return () + | addr :: addrs -> ( + match Script_cache.contract_rank ctxt addr with + | None -> fail (err "Contract rank should find a cached contract") + | Some rank -> + fail_unless + (k = rank) + (err + (Printf.sprintf + "Invalid contract rank, expecting %d, got %d" + k + rank)) + >>=? fun () -> check_rank (k + 1) addrs) + in + check_rank 0 addrs ) + >>=? throw_block_away + +(* + + [size] correctly returns the sums of the (declared) sizes. + +*) +let test_size_adds_entries_sizes () = + let ncontracts = 10 in + init () >>=? fun (block, baker, src, _) -> + add_some_contracts ncontracts src block baker >>=? fun (_, block) -> + ( make_block block @! fun ctxt -> + let expected_size = + liquidity_baking_contract_size + (ncontracts * int_store_contract_size) + in + fail_unless + (Script_cache.size ctxt = expected_size) + (err + (Printf.sprintf + "Invalid script cache size, expecting %d, got %d" + expected_size + (Script_cache.size ctxt))) ) + >>=? throw_block_away + +(* + + [test_size_limit] is the value found in [Constants_repr.cache_layout]. + +*) +let defined_size_limit = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_mainnet + .cache_script_size + +let test_size_limit_is_in_constants_repr () = + init () >>=? fun (block, _baker, _src, _) -> + ( make_block block @! fun ctxt -> + fail_unless + (Script_cache.size_limit ctxt = defined_size_limit) + (err + (Printf.sprintf + "Invalid size limit, expecting %d, got %d" + defined_size_limit + (Script_cache.size_limit ctxt))) ) + >>=? throw_block_away + +(* + + [test_entries] are conform to an LRU strategy: when the cache is + full the least recently used entries are removed. + +*) +let test_entries_shows_lru () = + let ncontracts = 10 in + init () >>=? fun (block, baker, src, _) -> + add_some_contracts ncontracts src block baker >>=? fun (contracts, block) -> + (* We pretend that the contracts' sizes grow so much that they cannot all + fit into the cache. *) + let new_size = 2 * defined_size_limit / ncontracts in + ( make_block block @@ fun ctxt -> + List.fold_left_es + (fun ctxt (_, addr) -> + find ctxt addr >>=? fun (ctxt, id, script, cached_contract) -> + Lwt.return + @@ (Script_cache.update ctxt id (script, cached_contract) new_size + |> Environment.wrap_tzresult)) + ctxt + contracts + >>=? fun ctxt -> return ((), ctxt) ) + >>=? fun ((), block) -> + (* At this point, the cache should only contain the most recently modified + contracts. *) + ( make_block block @@ fun ctxt -> + Script_cache.entries ctxt |> Environment.wrap_tzresult >>?= fun entries -> + let rev_entries = List.rev entries in + let rev_contracts = List.rev contracts in + let rec aux rev_entries rev_contracts = + Printf.eprintf + "%d %d\n" + (List.length rev_entries) + (List.length rev_contracts) ; + match (rev_entries, rev_contracts) with + | [], _ -> + (* We do not count liquidity baking contract. *) + let removed_contracts = List.length rev_contracts - 1 in + fail_unless + (removed_contracts = ncontracts / 2) + (err + (Printf.sprintf + "Too few contracts have been removed from the cache while it \ + is full, %d remaining while expecting %d" + removed_contracts + (ncontracts / 2))) + | (contract, size) :: rev_entries, (_, contract') :: rev_contracts -> + fail_unless + (size = new_size || contract = liquidity_baking_contract) + (err + (Printf.sprintf + "A contract in the cache has not the right size, expecting \ + %d, got %d" + new_size + size)) + >>=? fun () -> + fail_unless + (contract = contract') + (err + (Printf.sprintf + "entries do not return cached contracts in right order")) + >>=? fun () -> aux rev_entries rev_contracts + | _, [] -> + (* There cannot be more entries than contracts. *) + assert false + in + aux rev_entries rev_contracts >>=? fun () -> return ((), ctxt) ) + >>=? throw_block_away + +let tests = + let open Tztest in + [ + tztest + "assumption about size of liquidity baking holds" + `Quick + test_size_of_liquidity_baking_contract; + tztest + "assumption about size of 'int_store' contract holds" + `Quick + test_size_of_int_store_contract; + tztest "find correctly looks up" `Quick test_find_correctly_looks_up; + tztest + "update correctly modifies" + `Quick + test_update_modifies_cached_contract; + tztest + "entries correctly list contracts in order" + `Quick + test_entries_returns_the_list_in_correct_order; + tztest "contract_rank is LRU rank" `Quick test_contract_rank_is_lru_rank; + tztest "size returns entries size" `Quick test_size_adds_entries_sizes; + tztest + "size limit is a protocol constant" + `Quick + test_size_limit_is_in_constants_repr; + tztest "entries show LRU behavior" `Quick test_entries_shows_lru; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml new file mode 100644 index 000000000000..a09c098f2a90 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml @@ -0,0 +1,1054 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (script typed IR size) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^script typed ir size$" + Subject: Script_typed_ir computes good approximation of values' sizes +*) + +open Protocol +open Alpha_context +open Script_typed_ir + +(* + Helpers + ------- +*) + +exception Script_typed_ir_test_error of string + +let err x = Exn (Script_typed_ir_test_error x) + +let dummy_loc = Micheline.dummy_location + +let get = Stdlib.Option.get + +let is_ok m = match m with Ok x -> x | _ -> assert false + +let footprint v = + (* This is to turn every statically allocated data into + heap-allocated data, to consider the worst-case in-memory + representation of values. Note that it does NOT remove sharing.*) + let v' = + try Marshal.(from_bytes (to_bytes v [Closures]) 0) + with _ -> (* Custom blocks are problematic. *) v + in + let size v = Obj.(reachable_words (repr v) * 8) in + max (size v) (size v') + +(** [gen_string s] returns a heap-allocated string. Notice that a + string literal ["foo"] written in the code is statically allocated + and is therefore not counted by [Obj.reachable_words]. *) +let gen_string s = + let s = Bytes.of_string s |> Bytes.to_string in + is_ok @@ Script_string.of_string s + +let boxed_set_elements s = Script_set.fold (fun x s -> x :: s) s [] + +let boxed_map_bindings s = Script_map.fold (fun k v s -> (k, v) :: s) s [] + +let big_map_bindings (Big_map s) = Big_map_overlay.bindings s.diff.map + +let show_script_int fmt x = Z.pp_print fmt (Script_int.to_zint x) + +let show_bool fmt b = Format.fprintf fmt "%B" b + +let show_script_string fmt x = + Format.fprintf fmt "%s" (Script_string.to_string x) + +let show_address fmt Script_typed_ir.{destination; entrypoint} = + Format.fprintf + fmt + "%a(%d):%a(%d)" + Destination.pp + destination + (footprint destination) + Entrypoint.pp + entrypoint + (footprint entrypoint) + +let dont_show _fmt _ = () + +let size = {Tezos_benchmark.Base_samplers.min = 4; max = 32} + +module Crypto_samplers = +Tezos_benchmark.Crypto_samplers.Make_finite_key_pool (struct + let size = 10 + + let algo = `Default +end) + +include + Michelson_samplers.Make + (struct + let parameters : Michelson_samplers.parameters = + { + base_parameters = + { + Michelson_samplers_base.int_size = size; + string_size = size; + bytes_size = size; + }; + list_size = size; + set_size = size; + map_size = size; + } + end) + (Crypto_samplers) + +let random_state = Random.State.make [|37; 73; 17; 71; 42|] + +let sample_ty size = Random_type.m_type ~size random_state + +let sample_value ty = Random_value.value ty random_state + +type ex = Ex : string * ('a, _) Script_typed_ir.ty * 'a * int -> ex [@@boxed] + +let ex ?(error = 0) label ty v = Ex (label, ty, v, error) + +let ex_random ?(error = 0) show ty ?(sample = fun () -> sample_value ty) label = + let v = sample () in + let label = Format.asprintf "@[%a%s@]@." show v label in + ex ~error label ty v + +let exs ?(error = 0) n show ty ?(sample = fun () -> sample_value ty) label = + List.map (fun _ -> ex_random ~error show ty label ~sample) (1 -- n) + +let nsample = 100 + +type ex_kinstr = Kinstr : string * ('a, 'b, 'c, 'd) kinstr -> ex_kinstr +[@@boxed] + +(** [check_value_size ()] covers a finite number of cases of Michelson + values, checking that the cost model is sound with respect to their + memory footprint. + + One could wonder why we do not simply use a single value generator + based on a randomly chosen type. We actually implemented such a + strategy in a previous version of this test but this results in a + flaky test. Indeed, for some types, the values are overapproximated + and it was difficult to correctly handle the accumulation of errors + when types were randomly composed. + + The current strategy requires more code but, in exchange, it + provides a finer control over the overapproximation. As a + consequence, we can check for example that there is no + overapproximation for values for which the model is exact. We can + also check that the overapproximation is at least well understood + on the values for which size model is not exact. *) +let check_value_size () = + let check (Ex (what, ty, v, error)) = + let expected_size = footprint v in + let _, size = Script_typed_ir_size.value_size ty v in + let size = Saturation_repr.to_int size in + fail_when + (expected_size + error < size || size < expected_size) + (err + (Printf.sprintf + "%s was expected to have size %d while the size model answered %d \ + (with +%d accepted over approximation error)" + what + expected_size + size + error)) + in + List.iter_es + check + ((* + Unit_t + ====== + *) + [ex "() : unit" Unit_t ()] + (* + Int_t + ===== + *) + @ (let error = 8 in + [ + ex ~error "0 : int" Int_t Script_int.zero; + ex ~error "2^63 : int" Int_t (Script_int.of_int max_int); + ex + ~error + "37^73 : int" + Int_t + (Script_int.of_zint Z.(pow (of_int 37) 73)); + ex + ~error + "-37^73 : int" + Int_t + (Script_int.of_zint Z.(neg (pow (of_int 37) 73))); + ex + ~error + "13270006022583112970 : int" + Int_t + (get @@ Script_int.of_string "13270006022583112970"); + ] + @ exs ~error nsample show_script_int Int_t ": int") + (* + Nat_t + ===== + *) + @ (let error = 8 in + [ + ex ~error "0 : nat" Nat_t Script_int.zero_n; + ex + ~error + "2^63 : nat" + Nat_t + (get Script_int.(is_nat @@ of_int max_int)); + ex + ~error + "37^73 : int" + Nat_t + (get Script_int.(is_nat @@ of_zint Z.(pow (of_int 37) 73))); + ] + @ exs ~error nsample show_script_int Nat_t ": nat") + (* + Signature_t + =========== + *) + @ (let show fmt (Script_typed_ir.Script_signature.Signature_tag s) = + Tezos_crypto.Signature.pp fmt s + in + exs ~error:8 nsample show Signature_t ": signature") + (* + String_t + ======== + *) + @ (let show fmt s = Format.fprintf fmt "%s" (Script_string.to_string s) in + exs nsample show String_t ": string") + (* + Bytes_t + ======= + *) + @ (let show fmt s = Format.fprintf fmt "%s" (Bytes.to_string s) in + exs nsample show Bytes_t ": bytes") + (* + Mutez_t + ======= + *) + @ (let show fmt t = Format.fprintf fmt "%s" (Tez.to_string t) in + exs nsample show Mutez_t ": mutez") + (* + Key_hash_t + ========== + *) + @ (let show = Tezos_crypto.Signature.Public_key_hash.pp in + exs nsample show Key_hash_t ": key_hash") + (* + Key_t + ===== + *) + @ (let show = Tezos_crypto.Signature.Public_key.pp in + exs nsample show Key_t ": key_t") + (* + Timestamp_t + =========== + *) + @ (let show fmt s = + Format.fprintf fmt "%s" (Script_timestamp.to_string s) + in + exs ~error:8 nsample show Timestamp_t ": timestamp_t") + (* + Address_t + ========= + *) + @ exs nsample show_address Address_t ": address_t" + (* + Tx_rollup_l2_address_t + ====================== + *) + @ (let show = Indexable.pp Tx_rollup_l2_address.pp in + exs nsample show Tx_rollup_l2_address_t ": tx_rollup_l2_t") + (* + Bool_t + ====== + *) + @ [ex "true : bool" Bool_t true; ex "false : bool" Bool_t false] + (* + Pair_t + ====== + *) + @ (let module P = struct + type ('a, 'b) f = {apply : 'c. ('a * 'b, 'c) ty -> ex} + end in + let on_pair : type a b. (a, _) ty -> (b, _) ty -> (a, b) P.f -> ex = + fun ty1 ty2 f -> + let (Ty_ex_c ty) = is_ok @@ pair_t dummy_loc ty1 ty2 in + f.apply ty + in + let open Script_int in + [ + (* "int * int" *) + on_pair + int_t + int_t + {apply = (fun ty -> ex "(0, 0) : int * int" ty (of_int 0, of_int 0))}; + (* "string * string" *) + on_pair + string_t + string_t + { + apply = + (fun ty -> + let foo = gen_string "foo" in + let bar = gen_string "bar" in + ex "(foo, bar) : string * string" ty (foo, bar)); + }; + (* "string * int" *) + on_pair + string_t + int_t + { + apply = + (fun ty -> + let foo = gen_string "foo" in + ex "(foo, 0) : string * int" ty (foo, of_int 0)); + }; + (* "int * int * int" *) + on_pair + int_t + int_t + { + apply = + (fun ty -> + on_pair int_t ty + @@ { + apply = + (fun ty -> + ex + "(0, (1, 2)) : int * int * int" + ty + (of_int 0, (of_int 1, of_int 2))); + }); + }; + ]) + (* + Union_t + ======= + *) + @ (let module P = struct + type ('a, 'b) f = {apply : 'c. (('a, 'b) union, 'c) ty -> ex} + end in + let on_union : type a b. (a, _) ty -> (b, _) ty -> (a, b) P.f -> ex = + fun ty1 ty2 f -> + let (Ty_ex_c ty) = is_ok @@ union_t dummy_loc ty1 ty2 in + f.apply ty + in + let open Script_int in + [ + (* "int + int" *) + on_union + int_t + int_t + {apply = (fun ty -> ex "L 0 : int + int" ty (L (of_int 0)))}; + on_union + int_t + int_t + {apply = (fun ty -> ex "R 0 : int + int" ty (R (of_int 0)))}; + (* "string + string" *) + on_union + string_t + string_t + { + apply = + (fun ty -> + let foo = gen_string "foo" in + ex "L foo : string * string" ty (L foo)); + }; + on_union + string_t + string_t + { + apply = + (fun ty -> + let foo = gen_string "foo" in + ex "R foo : string * string" ty (R foo)); + }; + (* "string + int" *) + on_union + string_t + int_t + { + apply = + (fun ty -> + let foo = gen_string "foo" in + ex "L foo : string * int" ty (L foo)); + }; + (* "int + int + int" *) + on_union + int_t + int_t + { + apply = + (fun ty -> + on_union + int_t + ty + { + apply = + (fun ty -> ex "L 0 : int + int + int" ty (L (of_int 0))); + }); + }; + on_union + int_t + int_t + { + apply = + (fun ty -> + on_union + int_t + ty + { + apply = + (fun ty -> + ex "R (L 0) : int + int + int" ty (R (L (of_int 0)))); + }); + }; + on_union + int_t + int_t + { + apply = + (fun ty -> + on_union + int_t + ty + { + apply = + (fun ty -> + ex "R (R 0) : int + int + int" ty (R (R (of_int 0)))); + }); + }; + ]) + (* + Option_t + ======== + *) + @ (let module P = struct + type 'a f = {apply : 'c. ('a option, 'c) ty -> ex} + end in + let on_option : type a. (a, _) ty -> a P.f -> ex = + fun ty f -> f.apply @@ is_ok @@ option_t dummy_loc ty + in + let open Script_int in + [ + (* "option int" *) + on_option int_t {apply = (fun ty -> ex "None : option int" ty None)}; + on_option + int_t + {apply = (fun ty -> ex "Some 0 : option int" ty (Some (of_int 0)))}; + (* "option string" *) + on_option + string_t + {apply = (fun ty -> ex "None : option string" ty None)}; + on_option + string_t + { + apply = + (fun ty -> + ex "Some \"foo\" : option string" ty (Some (gen_string "foo"))); + }; + ]) + (* + List_t + ====== + *) + @ (let module P = struct + type 'a f = {apply : 'c. ('a Script_list.t, 'c) ty -> ex list} + end in + let on_list : type a. (a, _) ty -> a P.f -> ex list = + fun ty f -> f.apply @@ is_ok @@ list_t dummy_loc ty + in + let check ty show_elt = + on_list + ty + { + apply = + (fun ty -> + let show fmt l = + Format.pp_print_list show_elt fmt @@ Script_list.to_list l + in + exs nsample show ty ": list _"); + } + in + check string_t show_script_string) + (* + Set_t + ====== + *) + @ (let module P = struct + type 'a f = {apply : 'c. ('a set, 'c) ty -> ex list} + end in + let on_set : type a. (a, _) ty -> a P.f -> ex list = + fun ty f -> f.apply @@ is_ok @@ set_t dummy_loc ty + in + let check ty show_elt = + on_set + ty + { + apply = + (fun ty -> + let show fmt s = + Format.fprintf + fmt + "%a / %a" + show_script_int + (Script_set.size s) + (Format.pp_print_list show_elt) + (boxed_set_elements s) + in + exs nsample show ty ": set _"); + } + in + check string_t show_script_string) + (* + Map_t + ====== + *) + @ (let module P = struct + type ('k, 'v) f = {apply : 'c. (('k, 'v) map, 'c) ty -> ex list} + end in + let on_map : type k v. (k, _) ty -> (v, _) ty -> (k, v) P.f -> ex list = + fun kty vty f -> f.apply @@ is_ok @@ map_t dummy_loc kty vty + in + let check kty vty show_key show_value = + on_map + kty + vty + { + apply = + (fun ty -> + let show_binding fmt (k, v) = + Format.fprintf fmt "(%a -> %a)" show_key k show_value v + in + let show fmt s = + Format.pp_print_list show_binding fmt (boxed_map_bindings s) + in + exs nsample show ty ": map _"); + } + in + check string_t string_t show_script_string show_script_string) + (* + Big_map_t + ====== + *) + @ (let module P = struct + type ('k, 'v) f = {apply : 'c. (('k, 'v) big_map, 'c) ty -> ex list} + end in + let on_big_map : type k v. (k, _) ty -> (v, _) ty -> (k, v) P.f -> ex list + = + fun kty vty f -> f.apply @@ is_ok @@ big_map_t dummy_loc kty vty + in + let check kty vty show_key show_value = + on_big_map + kty + vty + { + apply = + (fun ty -> + let show_binding fmt (_, (k, v)) = + match v with + | Some v -> + Format.fprintf fmt "(%a -> %a)" show_key k show_value v + | None -> Format.fprintf fmt "(%a?)" show_key k + in + let show fmt s = + Format.pp_print_list show_binding fmt (big_map_bindings s) + in + exs nsample show ty ": big_map _"); + } + in + check bool_t bool_t show_bool show_bool) + (* + Contract_t + ========= + *) + @ (let show fmt typed_contract = + let destination = Typed_contract.destination typed_contract in + let entrypoint = Typed_contract.entrypoint typed_contract in + show_address fmt {destination; entrypoint} + in + exs + nsample + show + (is_ok @@ contract_t dummy_loc string_t) + ": contract string") + (* + Chain_t + ========= + *) + @ exs nsample dont_show chain_id_t ": chain_id" + (* + Bls12_381_g1_t + ============== + *) + @ exs nsample dont_show bls12_381_g1_t ": bls12_381_g1_t" + (* + Bls12_381_g2_t + ============== + *) + @ exs nsample dont_show bls12_381_g2_t ": bls12_381_g2_t" + (* + Bls12_381_fr_t + ============== + *) + @ exs nsample dont_show bls12_381_fr_t ": bls12_381_fr_t" + (* + Ticket_t + ======== + *) + @ exs + ~error:8 + nsample + dont_show + (is_ok @@ ticket_t dummy_loc bool_t) + ": ticket bool" + (* + Missing by lack of fully functional samplers: + - Sapling_transaction_t ; + - Sapling_transaction_deprecated_t ; + - Sapling_state ; + - Operation_t ; + - Chest_key_t ; + - Chest_t ; + - Lambda_t. + *) + ) + +let check_ty_size () = + let check () = + match (sample_ty (Random.int 10 + 1) : ex_ty) with + | Ex_ty ty -> + let expected_size = footprint ty in + let _, size = Script_typed_ir_size.Internal_for_tests.ty_size ty in + let size = Saturation_repr.to_int size in + let what = "some type" in + fail_when + (size <> expected_size) + (err + (Printf.sprintf + "%s was expected to have size %d while the size model answered \ + %d." + what + expected_size + size)) + in + List.iter_es (fun _ -> check ()) (1 -- nsample) + +let check_size ~name ~expected item = + let open Lwt_result_syntax in + let _, e = expected item in + let exp = Saturation_repr.to_int e in + let actual = 8 * Obj.(reachable_words @@ repr item) in + let overapprox = 1_000_000 * (exp - actual) / actual in + let msg verb = + Printf.sprintf + "For %s model predicts the size of %d bytes; while actual measured size \ + is %d bytes. The model %s %d.%04d%%" + name + exp + actual + verb + (abs @@ (overapprox / 10_000)) + (abs @@ (overapprox mod 10_000)) + in + let* () = fail_when (overapprox < 0) (err @@ msg "under-approximates by") in + fail_when (overapprox > 0) (err @@ msg "over-approximates by") +(* We expected the model to always be exact. *) + +(* Test that the model accurately predicts instruction sizes. It tests each + type of instruction separately as much as possible. Tested values are + specifically tailored so that they can't be shared (in particular all + reused values are wrapped in functions to discourage sharing). Thanks + to this the model gives precise predictions for each instruction. In real + life the model will over-approximate due to sharing. It should never under- + approximate though. *) +let check_kinstr_size () = + let open Lwt_result_syntax in + let check (Kinstr (name, instr)) = + check_size + ~name + ~expected:Script_typed_ir_size.Internal_for_tests.kinstr_size + instr + in + (* Location is an immediate value, so we don't care if it's shared. *) + let loc = Micheline.dummy_location in + let str s = + (* It's important to transform the string somehow, or else it will be shared + and thus not reached by Obj.reachable_words. *) + match Script_string.of_string @@ String.uppercase_ascii s with + | Ok ss -> ss + | Error _ -> assert false + in + let entrypoint name = + Entrypoint.of_string_strict_exn @@ String.uppercase_ascii name + in + (* Constants below are wrapped in functions to force recomputation and + discourage sharing. *) + let halt () = IHalt loc in + let drop () = IDrop (loc, halt ()) in + let cdr = ICdr (loc, halt ()) in + let const ty v = IConst (loc, ty, v, halt ()) in + let unit_option_t () = + WithExceptions.Result.get_ok ~loc:__LOC__ @@ option_t loc Unit_t + in + let stack_type () = Item_t (unit_option_t (), Bot_t) in + let id_lambda () = + Lam + ( { + kloc = loc; + kbef = stack_type (); + kaft = stack_type (); + kinstr = halt (); + }, + Micheline.Seq (loc, []) ) + in + (* Following constants are used but once. *) + let zero_memo_size = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Alpha_context.Sapling.Memo_size.parse_z Z.zero + in + (* Check size of the lambda alone. *) + let* () = + check_size + ~name:"id lambda" + ~expected:Script_typed_ir_size.lambda_size + (id_lambda ()) + in + (* Testing individual instructions. *) + List.iter_es + check + [ + Kinstr ("IDrop", drop ()); + Kinstr ("IDup", IDup (loc, halt ())); + Kinstr ("ISwap", ISwap (loc, halt ())); + Kinstr ("IConst", const String_t @@ str "tezos"); + Kinstr ("ICons_pair", ICons_pair (loc, halt ())); + Kinstr ("ICar", ICar (loc, halt ())); + Kinstr ("ICdr", cdr); + Kinstr ("IUnpair", IUnpair (loc, halt ())); + Kinstr ("ICons_some", ICons_some (loc, halt ())); + Kinstr ("ICons_none", ICons_none (loc, Int_t, halt ())); + Kinstr + ( "IIf_none", + IIf_none + { + loc; + branch_if_some = drop (); + branch_if_none = halt (); + k = halt (); + } ); + Kinstr ("IOpt_map", IOpt_map {loc; body = halt (); k = halt ()}); + Kinstr ("ICons_left", ICons_left (loc, Nat_t, halt ())); + Kinstr ("ICons_right", ICons_right (loc, Int_t, halt ())); + Kinstr + ( "IIf_left", + IIf_left + { + loc; + branch_if_left = drop (); + branch_if_right = drop (); + k = halt (); + } ); + Kinstr ("ICons_list", ICons_list (loc, halt ())); + Kinstr ("INil", INil (loc, Bytes_t, halt ())); + Kinstr + ( "IIf_cons", + IIf_cons + { + loc; + branch_if_cons = IDrop (loc, drop ()); + branch_if_nil = halt (); + k = halt (); + } ); + Kinstr ("IList_map", IList_map (loc, halt (), None, halt ())); + Kinstr ("IList_iter", IList_iter (loc, None, drop (), halt ())); + Kinstr ("IList_size", IList_size (loc, halt ())); + Kinstr ("IEmpty_set", IEmpty_set (loc, String_t, halt ())); + Kinstr ("ISet_iter", ISet_iter (loc, None, drop (), halt ())); + Kinstr ("ISet_mem", ISet_mem (loc, halt ())); + Kinstr ("ISet_update", ISet_update (loc, halt ())); + Kinstr ("ISet_size", ISet_size (loc, halt ())); + Kinstr ("IEmpty_map", IEmpty_map (loc, Nat_t, None, halt ())); + Kinstr ("IMap_map", IMap_map (loc, None, cdr, halt ())); + Kinstr ("IMap_iter", IMap_iter (loc, None, drop (), halt ())); + Kinstr ("IMap_mem", IMap_mem (loc, halt ())); + Kinstr ("IMap_get", IMap_get (loc, halt ())); + Kinstr ("IMap_update", IMap_update (loc, halt ())); + Kinstr ("IMap_get_and_update", IMap_get_and_update (loc, halt ())); + Kinstr ("IMap_size", IMap_size (loc, halt ())); + Kinstr ("IEmpty_big_map", IEmpty_big_map (loc, Nat_t, String_t, halt ())); + Kinstr ("IBig_map_mem", IBig_map_mem (loc, halt ())); + Kinstr ("IBig_map_get", IBig_map_get (loc, halt ())); + Kinstr ("IBig_map_update", IBig_map_update (loc, halt ())); + Kinstr ("IBig_map_get_and_update", IBig_map_get_and_update (loc, halt ())); + Kinstr ("IConcat_string", IConcat_string (loc, halt ())); + Kinstr ("IConcat_string_pair", IConcat_string_pair (loc, halt ())); + Kinstr ("ISlice_string", ISlice_string (loc, halt ())); + Kinstr ("IString_size", IString_size (loc, halt ())); + Kinstr ("IConcat_bytes", IConcat_bytes (loc, halt ())); + Kinstr ("IConcat_bytes_pair", IConcat_bytes_pair (loc, halt ())); + Kinstr ("ISlice_bytes", ISlice_bytes (loc, halt ())); + Kinstr ("IBytes_size", IBytes_size (loc, halt ())); + Kinstr + ("IAdd_seconds_to_timestamp ", IAdd_seconds_to_timestamp (loc, halt ())); + Kinstr + ("IAdd_timestamp_to_seconds", IAdd_timestamp_to_seconds (loc, halt ())); + Kinstr ("ISub_timestamp_seconds", ISub_timestamp_seconds (loc, halt ())); + Kinstr ("IDiff_timestamps", IDiff_timestamps (loc, halt ())); + Kinstr ("IAdd_tez", IAdd_tez (loc, halt ())); + Kinstr ("ISub_tez", ISub_tez (loc, halt ())); + Kinstr ("ISub_tez_legacy", ISub_tez_legacy (loc, halt ())); + Kinstr ("IMul_tez_nat", IMul_teznat (loc, halt ())); + Kinstr ("IMul_nattez", IMul_nattez (loc, halt ())); + Kinstr ("IEdiv_teznat", IEdiv_teznat (loc, halt ())); + Kinstr ("IEdiv_nattez", IEdiv_tez (loc, halt ())); + Kinstr ("IOr", IOr (loc, halt ())); + Kinstr ("IAnd", IAnd (loc, halt ())); + Kinstr ("IXor", IXor (loc, halt ())); + Kinstr ("INot", INot (loc, halt ())); + Kinstr ("IIs_nat", IIs_nat (loc, halt ())); + Kinstr ("INeg", INeg (loc, halt ())); + Kinstr ("IAbs_int", IAbs_int (loc, halt ())); + Kinstr ("IInt_nat", IInt_nat (loc, halt ())); + Kinstr ("IAdd_int", IAdd_int (loc, halt ())); + Kinstr ("IAdd_nat", IAdd_nat (loc, halt ())); + Kinstr ("ISub_int", ISub_int (loc, halt ())); + Kinstr ("IMul_int", IMul_int (loc, halt ())); + Kinstr ("IMul_nat", IMul_nat (loc, halt ())); + Kinstr ("IEdiv_int", IEdiv_int (loc, halt ())); + Kinstr ("IEdiv_nat", IEdiv_nat (loc, halt ())); + Kinstr ("ILsl_nat", ILsl_nat (loc, halt ())); + Kinstr ("ILsr_nat", ILsr_nat (loc, halt ())); + Kinstr ("IOr_nat", IOr_nat (loc, halt ())); + Kinstr ("IAnd_nat", IAnd_nat (loc, halt ())); + Kinstr ("IAnd_int_nat", IAnd_int_nat (loc, halt ())); + Kinstr ("IXor_nat", IXor_nat (loc, halt ())); + Kinstr ("INot_int", INot_int (loc, halt ())); + Kinstr ("IAnd_bytes", IAnd_bytes (loc, halt ())); + Kinstr ("IOr_bytes", IOr_bytes (loc, halt ())); + Kinstr ("IXor_bytes", IXor_bytes (loc, halt ())); + Kinstr ("INot_bytes", INot_bytes (loc, halt ())); + Kinstr ("ILsl_bytes", ILsl_bytes (loc, halt ())); + Kinstr ("ILsr_bytes", ILsr_bytes (loc, halt ())); + Kinstr + ( "IIf", + IIf + { + loc; + branch_if_true = halt (); + branch_if_false = halt (); + k = halt (); + } ); + Kinstr ("ILoop", ILoop (loc, const Bool_t true, halt ())); + Kinstr ("ILoop_left", ILoop_left (loc, INever loc, halt ())); + Kinstr ("IDip", IDip (loc, halt (), None, halt ())); + Kinstr ("IExec", IExec (loc, None, halt ())); + Kinstr ("IApply", IApply (loc, String_t, halt ())); + Kinstr ("ILambda", ILambda (loc, id_lambda (), halt ())); + Kinstr ("IFailwith", IFailwith (loc, String_t)); + Kinstr ("ICompare", ICompare (loc, String_t, halt ())); + Kinstr ("IEq", IEq (loc, halt ())); + Kinstr ("INeq", INeq (loc, halt ())); + Kinstr ("ILt", ILt (loc, halt ())); + Kinstr ("IGt", IGt (loc, halt ())); + Kinstr ("ILe", ILe (loc, halt ())); + Kinstr ("IGe", IGe (loc, halt ())); + Kinstr ("IAddress", IAddress (loc, halt ())); + Kinstr ("IContract", IContract (loc, Unit_t, entrypoint "entry", halt ())); + Kinstr + ( "IView", + IView + ( loc, + View_signature + { + name = str "myview"; + input_ty = unit_option_t (); + output_ty = unit_option_t (); + }, + None, + halt () ) ); + Kinstr ("ITransfer_tokens", ITransfer_tokens (loc, halt ())); + Kinstr ("IImplicit_account", IImplicit_account (loc, halt ())); + Kinstr + ( "ICreate_contract", + ICreate_contract + { + loc; + storage_type = Unit_t; + code = Micheline.(strip_locations @@ Seq (loc, [])); + k = halt (); + } ); + Kinstr ("ISet_delegate", ISet_delegate (loc, halt ())); + Kinstr ("INow", INow (loc, halt ())); + Kinstr ("IMin_block_time", IMin_block_time (loc, halt ())); + Kinstr ("IBalance", IBalance (loc, halt ())); + Kinstr ("ILevel", ILevel (loc, halt ())); + Kinstr ("ICheck_signature", ICheck_signature (loc, halt ())); + Kinstr ("IHash_key", IHash_key (loc, halt ())); + Kinstr ("IPack", IPack (loc, Int_t, halt ())); + Kinstr ("IUnpack", IUnpack (loc, Int_t, halt ())); + Kinstr ("IBlake2b", IBlake2b (loc, halt ())); + Kinstr ("ISha_256", ISha256 (loc, halt ())); + Kinstr ("ISha512", ISha512 (loc, halt ())); + Kinstr ("ISource", ISource (loc, halt ())); + Kinstr ("ISender", ISender (loc, halt ())); + Kinstr ("ISelf", ISelf (loc, Unit_t, entrypoint "entry", halt ())); + Kinstr ("ISelf_address", ISelf_address (loc, halt ())); + Kinstr ("IAmount", IAmount (loc, halt ())); + Kinstr + ( "ISapling_empty_state", + ISapling_empty_state (loc, zero_memo_size, halt ()) ); + Kinstr ("ISapling_verify_update", ISapling_verify_update (loc, halt ())); + Kinstr + ( "ISapling_verify_update_deprecated", + ISapling_verify_update_deprecated (loc, halt ()) ); + Kinstr ("IDig", IDig (loc, 0, KRest, halt ())); + Kinstr ("IDug", IDug (loc, 0, KRest, halt ())); + Kinstr ("IDipn", IDipn (loc, 0, KRest, halt (), halt ())); + Kinstr ("IDropn", IDropn (loc, 0, KRest, halt ())); + Kinstr ("IChainId", IChainId (loc, halt ())); + Kinstr ("INever", INever loc); + Kinstr ("IVoting_power", IVoting_power (loc, halt ())); + Kinstr ("ITotal_voting_power", ITotal_voting_power (loc, halt ())); + Kinstr ("IKeccak", IKeccak (loc, halt ())); + Kinstr ("ISha3", ISha3 (loc, halt ())); + Kinstr ("IAdd_bls12_381_g1", IAdd_bls12_381_g1 (loc, halt ())); + Kinstr ("IAdd_bls12_381_2g", IAdd_bls12_381_g2 (loc, halt ())); + Kinstr ("IAdd_bls12_381_fr", IAdd_bls12_381_fr (loc, halt ())); + Kinstr ("IMul_bls12_381_g1", IMul_bls12_381_g1 (loc, halt ())); + Kinstr ("IMul_bls12_381_g2", IMul_bls12_381_g2 (loc, halt ())); + Kinstr ("IMul_bls12_381_fr", IMul_bls12_381_fr (loc, halt ())); + Kinstr ("IMul_bls12_381_z_fr", IMul_bls12_381_z_fr (loc, halt ())); + Kinstr ("IMul_bls12_381_fr_z", IMul_bls12_381_fr_z (loc, halt ())); + Kinstr ("IMul_bls12_381_fr_z", IMul_bls12_381_fr_z (loc, halt ())); + Kinstr ("IInt_bls12_381_fr", IInt_bls12_381_fr (loc, halt ())); + Kinstr ("INeg_bls12_381_g1", INeg_bls12_381_g1 (loc, halt ())); + Kinstr ("INeg_bls12_381_g2", INeg_bls12_381_g2 (loc, halt ())); + Kinstr ("INeg_bls12_381_fr", INeg_bls12_381_fr (loc, halt ())); + Kinstr + ("IPairing_check_bls12_381", IPairing_check_bls12_381 (loc, halt ())); + Kinstr ("IComb", IComb (loc, 0, Comb_one, halt ())); + Kinstr ("IUncomb", IUncomb (loc, 0, Uncomb_one, halt ())); + Kinstr ("IComb_get", IComb_get (loc, 0, Comb_get_zero, halt ())); + Kinstr ("IComb_set", IComb_set (loc, 0, Comb_set_zero, halt ())); + Kinstr ("IDup_n", IDup_n (loc, 0, Dup_n_zero, halt ())); + Kinstr ("ITicket", ITicket (loc, None, halt ())); + Kinstr ("IRead_ticket", IRead_ticket (loc, None, halt ())); + Kinstr ("ISplit_ticket", ISplit_ticket (loc, halt ())); + Kinstr ("IJoin_tickets", IJoin_tickets (loc, Unit_t, halt ())); + Kinstr ("IOpen_chest", IOpen_chest (loc, halt ())); + Kinstr + ( "IEmit", + IEmit + { + loc; + tag = entrypoint "entry"; + ty = Unit_t; + unparsed_ty = Micheline.(strip_locations @@ Seq (loc, [])); + k = halt (); + } ); + Kinstr ("IHalt ()", halt ()); + ] + +let check_witness_sizes () = + let loc = Micheline.dummy_location in + let stack_prefix_preservation = + KPrefix + ( loc, + Unit_t, + KPrefix + ( loc, + Unit_t, + KPrefix + ( loc, + Unit_t, + KPrefix + ( loc, + Unit_t, + KPrefix + ( loc, + Unit_t, + KPrefix + ( loc, + Unit_t, + KPrefix (loc, Unit_t, KPrefix (loc, Unit_t, KRest)) + ) ) ) ) ) ) + in + check_size + ~name:"stack_prefix_preservation_witness" + ~expected: + Script_typed_ir_size.Internal_for_tests + .stack_prefix_preservation_witness_size + stack_prefix_preservation + +let check_micheline_sizes () = + let open Michelson_v1_primitives in + let check (name, micheline) = + check_size ~name ~expected:Cache_memory_helpers.node_size micheline + in + let int i = Micheline.(Int (dummy_loc, Z.of_int i)) in + let big_int z = Micheline.(Int (dummy_loc, z)) in + let str s = Micheline.(String (dummy_location, String.lowercase_ascii s)) in + let bytes b = Micheline.(Bytes (dummy_location, Bytes.of_string b)) in + let prim ?(annot = []) p args = + Micheline.(Prim (dummy_location, p, args, annot)) + in + let seq xs = Micheline.(Seq (dummy_location, xs)) in + List.iter_es + check + [ + ("empty micheline", seq []); + ("a single number", int 1024); + ("a large number", big_int Z.(of_int 3 * of_int max_int)); + ("a short string", str "tezostezostezos"); + ("a short bytestring", bytes "tezostezostezos"); + ("a prim with no args", prim I_UNIT []); + ("a seq of prims", seq [prim I_DUP []; prim I_DROP []]); + ("a prim with arg", prim I_DIG [int 2]); + ( "combine everything together", + seq + [ + prim I_UNIT []; + prim I_DUG [int 3] ~annot:[String.lowercase_ascii "@number"]; + prim I_DIP [seq [prim I_DROP [int 2]]]; + prim I_PUSH [prim T_string []; str "tezos"]; + ] ); + ] + +let tests = + let open Tztest in + [ + tztest "check value size" `Quick check_value_size; + tztest "check ty size" `Quick check_ty_size; + tztest "check kinstr size" `Quick check_kinstr_size; + tztest "check witness sizes" `Quick check_witness_sizes; + tztest "check micheline sizes" `Quick check_micheline_sizes; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml new file mode 100644 index 000000000000..0df912fd077a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml @@ -0,0 +1,101 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (temporary big maps) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson \ + && dune exec ./main.exe -- test "^temp big maps$" + Subject: On temporary big maps. +*) + +open Protocol + +let to_raw_context (b : Block.t) = + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + >|= Environment.wrap_tzresult + +let check_no_dangling_temp_big_map b = + to_raw_context b >>=? fun ctxt -> + Storage.Big_map.fold ctxt ~init:() ~order:`Sorted ~f:(fun id () -> + assert (not (Lazy_storage_kind.Big_map.Id.is_temp id)) ; + Lwt.return_unit) + >>= fun () -> + Storage.Big_map.fold ctxt ~init:() ~order:`Undefined ~f:(fun id () -> + assert (not (Lazy_storage_kind.Big_map.Id.is_temp id)) ; + Lwt.return_unit) + >>= fun () -> return_unit + +let call_the_contract b ~baker ~src contract param_left param_right = + let fee = Alpha_context.Tez.one in + let amount = Alpha_context.Tez.zero in + let param = Printf.sprintf "Pair (%s) %s" param_left param_right in + let parameters = Alpha_context.Script.lazy_expr (Expr.from_string param) in + Op.transaction ~fee (B b) src contract amount ~parameters + >>=? fun operation -> + Incremental.begin_construction ~policy:Block.(By_account baker) b + >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr + +(** Originates the contract at contracts/temp_big_maps.tz and calls it with + the pair [(param_left, param_right)]. + An action (originating, storing, passing, passing twice) is done on a big + map (either fresh, passed, or stored). + All combinations are exercised. +*) +let test_temp_big_maps_contract param_left param_right () = + Contract_helpers.init () >>=? fun (b, baker, src, _src2) -> + Contract_helpers.originate_contract + "contracts/temp_big_maps.tz" + "{}" + src + b + baker + >>=? fun (contract, b) -> + check_no_dangling_temp_big_map b >>=? fun () -> + call_the_contract b ~baker ~src contract param_left param_right >>=? fun b -> + check_no_dangling_temp_big_map b + +let param_left_values = ["Left True"; "Left False"; "Right {}"] + +let param_right_values = ["-1"; "0"; "1"; "2"] + +let tests = + List.flatten + (List.map + (fun param_left -> + List.map + (fun param_right -> + Tztest.tztest + (Printf.sprintf "temp_big_maps(%s, %s)" param_left param_right) + `Quick + (test_temp_big_maps_contract param_left param_right)) + param_right_values) + param_left_values) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml new file mode 100644 index 000000000000..618766fb1db5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml @@ -0,0 +1,1474 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_scanner) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket accounting" + Subject: Ticket scanner tests +*) + +open Protocol +open Alpha_context +open Script_typed_ir + +let wrap m = m >|= Environment.wrap_tzresult + +let assert_equal_string_list ~loc msg = + Assert.assert_equal_list ~loc String.equal msg Format.pp_print_string + +let assert_fail_with ~loc ~msg f = + let open Lwt_syntax in + let* res = wrap @@ f () in + match res with + | Error [x] -> + let x = Format.asprintf "%a" Error_monad.pp x in + Assert.equal ~loc String.equal "" Format.pp_print_string msg x + | Ok _ -> failwith "Expected an error at %s, but got `Ok'." loc + | Error _ -> failwith "Expected a single error at %s." loc + +let string_list_of_ex_token_diffs ctxt token_diffs = + let open Lwt_result_syntax in + let accum (xs, ctxt) + (Ticket_token.Ex_token {ticketer; contents_type; contents}, amount) = + let* x, ctxt = + wrap + @@ Script_ir_unparser.unparse_comparable_data + ctxt + Script_ir_unparser.Readable + contents_type + contents + in + let str = + Format.asprintf + {|{ticketer: "%a"; contents: %a; amount: %a}|} + Contract.pp + ticketer + Michelson_v1_printer.print_expr + x + Z.pp_print + amount + in + return (str :: xs, ctxt) + in + let* xs, ctxt = List.fold_left_es accum ([], ctxt) token_diffs in + return (List.rev xs, ctxt) + +let make_ex_token ctxt ~ticketer ~type_exp ~content_exp = + let open Lwt_result_syntax in + wrap + @@ let*? Script_ir_translator.Ex_comparable_ty contents_type, ctxt = + let node = Micheline.root @@ Expr.from_string type_exp in + Script_ir_translator.parse_comparable_ty ctxt node + in + let*? ticketer = Contract.of_b58check ticketer in + let* contents, ctxt = + let node = Micheline.root @@ Expr.from_string content_exp in + Script_ir_translator.parse_comparable_data ctxt contents_type node + in + return (Ticket_token.Ex_token {ticketer; contents_type; contents}, ctxt) + +let assert_equal_ticket_diffs ~loc ctxt given expected = + let open Lwt_result_syntax in + let* ctxt, tbs1 = + List.fold_left_map_es + (fun ctxt ((ticketer, content), delta) -> + make_ex_token + ctxt + ~ticketer + ~type_exp:"string" + ~content_exp:(Printf.sprintf "%S" content) + >|=? fun (token, ctxt) -> (ctxt, (token, Z.of_int delta))) + ctxt + expected + in + let* tbs1, ctxt = string_list_of_ex_token_diffs ctxt tbs1 in + let* tbs2, _ctxt = string_list_of_ex_token_diffs ctxt given in + assert_equal_string_list + ~loc + "Compare token balances" + (List.sort String.compare tbs1) + (List.sort String.compare tbs2) + +let assert_equal_ticket_receipt ~loc given expected = + let open Lwt_result_syntax in + let make_receipt_item (ticketer, content, updates) = + wrap + @@ let*? ticketer = Contract.of_b58check ticketer in + let contents = Expr.from_string (Printf.sprintf "%S" content) in + let contents_type = Expr.from_string "string" in + let ticket_token = Ticket_token.{ticketer; contents_type; contents} in + let updates = + List.map + (fun (account, amount) -> + let account = Destination.Contract account in + let amount = Z.of_int amount in + Ticket_receipt.{account; amount}) + updates + in + return Ticket_receipt.{ticket_token; updates} + in + let* expected = List.map_es make_receipt_item expected in + Assert.equal_with_encoding + ~loc + (Data_encoding.list Ticket_receipt.item_encoding) + expected + given + +let updates_of_key_values ctxt ~key_type ~value_type key_values = + let open Lwt_result_syntax in + List.fold_right_es + (fun (key, value) (kvs, ctxt) -> + let* key_hash, ctxt = + wrap (Script_ir_translator.hash_comparable_data ctxt key_type key) + in + let* key, ctxt = + wrap + (Script_ir_unparser.unparse_comparable_data + ctxt + Script_ir_unparser.Readable + key_type + key) + in + let* value, ctxt = + match value with + | None -> return (None, ctxt) + | Some value -> + let* value_node, ctxt = + wrap + (Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Readable + value_type + value) + in + return (Some value_node, ctxt) + in + return ({Big_map.key; key_hash; value} :: kvs, ctxt)) + key_values + ([], ctxt) + +let make_alloc big_map_id alloc updates = + Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update {init = Lazy_storage.Alloc alloc; updates}) + +let init () = + let open Lwt_result_syntax in + let* block, source = Context.init1 () in + let* operation, originated = + Op.contract_origination_hash (B block) source ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* inc = Incremental.begin_construction block in + return (originated, Incremental.alpha_ctxt inc) + +(** Initializes one address for operations and one baker. *) +let init_for_operation () = + Context.init2 ~consensus_threshold:0 () >|=? fun (block, (src0, src1)) -> + let baker = Context.Contract.pkh src0 in + (baker, src1, block) + +let two_ticketers block = + let open Lwt_result_syntax in + let* ctxt = + Incremental.begin_construction block >|=? Incremental.alpha_ctxt + in + let*! cs = Contract.list ctxt in + match cs with c1 :: c2 :: _ -> return (c1, c2) | _ -> assert false + +let ticket_list_script = + {| + { parameter (list (ticket string)); + storage (list (ticket string)); + code { CAR; NIL operation ; PAIR } } + |} + +let setup ctxt ~key_type ~value_type entries = + let open Lwt_result_syntax in + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + let* updates, ctxt = + updates_of_key_values + ctxt + ~key_type + ~value_type + (List.map (fun (k, v) -> (k, Some v)) entries) + in + let*? key_type_node, ctxt = + Environment.wrap_tzresult + @@ Script_ir_unparser.unparse_ty ~loc:Micheline.dummy_location ctxt key_type + in + let*? value_type_node, ctxt = + Environment.wrap_tzresult + @@ Script_ir_unparser.unparse_ty + ~loc:Micheline.dummy_location + ctxt + value_type + in + let key_type = Micheline.strip_locations key_type_node in + let value_type = Micheline.strip_locations value_type_node in + let alloc = make_alloc big_map_id Big_map.{key_type; value_type} updates in + return (alloc, big_map_id, ctxt) + +let new_big_map ctxt contract ~key_type ~value_type entries = + let open Lwt_result_syntax in + let* alloc, big_map_id, ctxt = setup ctxt ~key_type ~value_type entries in + let storage = Expr.from_string "{}" in + let* ctxt = + wrap @@ Contract.update_script_storage ctxt contract storage (Some [alloc]) + in + return (big_map_id, ctxt) + +let alloc_diff ctxt ~key_type ~value_type entries = + let open Lwt_result_syntax in + let* allocations, _, ctxt = setup ctxt ~key_type ~value_type entries in + return (allocations, ctxt) + +let remove_diff ctxt contract ~key_type ~value_type ~existing_entries = + let open Lwt_result_syntax in + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + return (Lazy_storage.make Lazy_storage.Kind.Big_map big_map_id Remove, ctxt) + +let copy_diff ctxt contract ~key_type ~value_type ~existing_entries ~updates = + let open Lwt_result_syntax in + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + let* updates, ctxt = + updates_of_key_values ctxt ~key_type ~value_type updates + in + let* ctxt, new_big_map_id = wrap @@ Big_map.fresh ctxt ~temporary:false in + return + ( Lazy_storage.make + Lazy_storage.Kind.Big_map + new_big_map_id + (Update {init = Lazy_storage.Copy {src = big_map_id}; updates}), + ctxt ) + +let existing_diff ctxt contract ~key_type ~value_type ~existing_entries ~updates + = + let open Lwt_result_syntax in + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + let* updates, ctxt = + updates_of_key_values ctxt ~key_type ~value_type updates + in + return + ( Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update {init = Lazy_storage.Existing; updates}), + ctxt ) + +let empty_big_map ctxt ~key_type ~value_type = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + return + ( Big_map + { + id = Some big_map_id; + diff = {map = Big_map_overlay.empty; size = 0}; + key_type; + value_type; + }, + ctxt ) + +let make_big_map ctxt contract ~key_type ~value_type entries = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type entries + in + return + ( Big_map + { + id = Some big_map_id; + diff = {map = Big_map_overlay.empty; size = 0}; + key_type; + value_type; + }, + ctxt ) + +let originate_script block ~script ~storage ~src ~baker ~forges_tickets = + let open Lwt_result_syntax in + let code = Expr.toplevel_from_string script in + let storage = Expr.from_string storage in + let* operation, destination = + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + Op.contract_origination_hash (B block) src ~fee:(Test_tez.of_int 10) ~script + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let* incr = + Incremental.add_operation + ?expect_apply_failure: + (if forges_tickets then Some (fun _ -> return ()) else None) + incr + operation + in + let script = (code, storage) in + Incremental.finalize_block incr >|=? fun block -> (destination, script, block) + +let origination_operation ctxt ~src ~script:(code, storage) ~orig_contract = + let open Lwt_result_syntax in + let script = Script.{code = lazy_expr code; storage = lazy_expr storage} in + let unparsed_storage = storage in + let* ( Script_ir_translator.Ex_script + (Script + { + storage_type; + storage; + code = _; + arg_type = _; + views = _; + entrypoints = _; + code_size = _; + }), + ctxt ) = + wrap + @@ Script_ir_translator.parse_script + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage:true + script + in + let operation = + Internal_operation + { + source = src; + operation = + Origination + { + delegate = None; + code; + unparsed_storage; + credit = Tez.one; + preorigination = orig_contract; + storage_type; + storage; + }; + nonce = 1; + } + in + return (operation, ctxt) + +let originate block ~src ~baker ~script ~storage ~forges_tickets = + let open Lwt_result_syntax in + let* orig_contract, script, block = + originate_script block ~script ~storage ~src ~baker ~forges_tickets + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + return (orig_contract, script, incr) + +let transfer_operation ctxt ~src ~destination ~arg_type ~arg = + let open Lwt_result_syntax in + let* params_node, ctxt = + wrap + (Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Readable + arg_type + arg) + in + return + ( Internal_operation + { + source = src; + operation = + Transaction_to_smart_contract + { + amount = Tez.zero; + unparsed_parameters = params_node; + entrypoint = Entrypoint.default; + destination; + location = Micheline.dummy_location; + parameters_ty = arg_type; + parameters = arg; + }; + nonce = 1; + }, + ctxt ) + +let ticket_string_type = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Script_typed_ir.(ticket_t (-1) string_t) + +let ticket_string_list_type = + Result.value_f ~default:(fun _ -> assert false) + @@ Script_typed_ir.list_t (-1) ticket_string_type + +let boxed_list = Script_list.of_list + +let big_map_type ~key_type ~value_type = + Environment.wrap_tzresult + @@ Script_typed_ir.big_map_t (-1) key_type value_type + +let type_has_tickets ctxt ty = + Environment.wrap_tzresult @@ Ticket_scanner.type_has_tickets ctxt ty + +(** Test that adding a ticket to a lazy storage diff is picked up. *) +let assert_ticket_diffs ctxt ~loc ~self_contract ~arg_type ~storage_type ~arg + ~old_storage ~new_storage ~lazy_storage_diff ~expected_diff + ~expected_receipt = + let open Lwt_result_syntax in + let*? arg_type_has_tickets, ctxt = type_has_tickets ctxt arg_type in + let*? storage_type_has_tickets, ctxt = type_has_tickets ctxt storage_type in + let* ticket_diff, ticket_receipt, ctxt = + wrap + (Ticket_accounting.ticket_diffs + ctxt + ~self_contract:(Originated self_contract) + ~arg_type_has_tickets + ~storage_type_has_tickets + ~arg + ~old_storage + ~new_storage + ~lazy_storage_diff) + in + let*? ticket_diffs, ctxt = + Environment.wrap_tzresult @@ Ticket_token_map.to_list ctxt ticket_diff + in + let* () = assert_equal_ticket_diffs ~loc ctxt ticket_diffs expected_diff in + let expected_receipt = + List.map + (fun (contract, contents, amounts) -> + let amounts = + List.map + (fun (contract, amount) -> (Contract.Originated contract, amount)) + amounts + in + (contract, contents, amounts)) + expected_receipt + in + assert_equal_ticket_receipt ~loc ticket_receipt expected_receipt + +let assert_balance = Ticket_helpers.assert_balance + +let string_ticket ticketer contents amount = + let amount = + WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_n @@ Script_int.abs @@ Script_int.of_int amount + in + let ticketer = + Result.value_f ~default:(fun _ -> assert false) + @@ Contract.of_b58check ticketer + in + let contents = + Result.value_f ~default:(fun _ -> assert false) + @@ Script_string.of_string contents + in + Script_typed_ir.{ticketer; contents; amount} + +let string_ticket_token = Ticket_helpers.string_ticket_token + +let test_diffs_empty () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + (* Start with an empty big-map *) + let* empty_big_map, ctxt = + empty_big_map ctxt ~key_type:int_t ~value_type:ticket_string_type + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:unit_t + ~storage_type:int_ticket_big_map_ty + ~arg:() + ~old_storage:empty_big_map + ~new_storage:empty_big_map + ~lazy_storage_diff:[] + ~expected_diff:[] + ~expected_receipt:[] + +(** Test that sending one ticket as an argument, when the new storage is empty + results in: + - Negative diff + - Empty receipt (since no ticket was added/removed from storage) *) +let test_diffs_tickets_in_args () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let arg = string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:ticket_string_type + ~storage_type:unit_t + ~arg + ~old_storage:() + ~new_storage:() + ~lazy_storage_diff:[] + ~expected_diff:[(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1)] + ~expected_receipt:[] + +(** Test adding a ticket to the args, which is also accounted for in the new + storage, results in: + - Empty diff + - Receipt with positive update (since one ticket was added to storage) *) +let test_diffs_tickets_in_args_and_storage () = + let open Lwt_result_syntax in + let* contract, ctxt = init () in + let arg = string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:ticket_string_type + ~storage_type:ticket_string_list_type + ~arg + ~old_storage:(boxed_list []) + ~new_storage:(boxed_list [arg]) + ~lazy_storage_diff:[] + ~expected_diff:[(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 0)] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, 1)])] + +(** Test that adding two tickets in the args, and only one new ticket in the + storage results in: + - Negative diff + - Receipt with single positive update (since one ticket was added to storage) *) +let test_diffs_drop_one_ticket () = + let open Lwt_result_syntax in + let* contract, ctxt = init () in + let arg = + boxed_list + [ + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1; + ] + in + let new_storage = + boxed_list [string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1] + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:ticket_string_list_type + ~storage_type:ticket_string_list_type + ~arg + ~old_storage:(boxed_list []) + ~new_storage + ~lazy_storage_diff:[] + ~expected_diff: + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 0); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), -1); + ] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, 1)])] + +(** Test that adding a new ticket to the storage results in: + - Positive diff + - Receipt with single positive update *) +let test_diffs_adding_new_ticket_to_storage () = + let open Lwt_result_syntax in + let* contract, ctxt = init () in + let new_storage = + boxed_list [string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1] + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:Script_typed_ir.unit_t + ~storage_type:ticket_string_list_type + ~arg:() + ~old_storage:(boxed_list []) + ~new_storage + ~lazy_storage_diff:[] + ~expected_diff:[(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1)] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, 1)])] + +(** Test that removing one ticket from the storage results in: + - Negative diff + - Receipt with negative update *) +let test_diffs_remove_from_storage () = + let open Lwt_result_syntax in + let* contract, ctxt = init () in + let old_storage = + boxed_list + [ + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 2; + ] + in + let new_storage = + boxed_list [string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1] + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:Script_typed_ir.unit_t + ~storage_type:ticket_string_list_type + ~arg:() + ~old_storage + ~new_storage + ~lazy_storage_diff:[] + ~expected_diff: + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 0); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), -2); + ] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", [(contract, -2)])] + +(* Test adding ticket through lazy-storage diff results in: + - Positive diff + - Receipt with positive update *) +let test_diffs_lazy_storage_alloc () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + (* Start with an empty big-map *) + let* empty_big_map, ctxt = + empty_big_map ctxt ~key_type:int_t ~value_type:ticket_string_type + in + (* We add one ticket to the storage. *) + let* lazy_storage_diff, ctxt = + alloc_diff + ctxt + ~key_type:int_t + ~value_type:ticket_string_type + [ + ( Script_int.of_int 1, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ); + ] + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:int_ticket_big_map_ty + ~storage_type:int_ticket_big_map_ty + ~arg:empty_big_map + ~old_storage:empty_big_map + ~new_storage:empty_big_map + ~lazy_storage_diff:[lazy_storage_diff] + ~expected_diff:[(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1)] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, 1)])] + +(* Test removing a big map containing a ticket results in: + - Negative diff + - Receipt with negative update *) +let test_diffs_remove_from_big_map () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + (* Start with an empty big-map *) + let* empty_big_map, ctxt = + empty_big_map ctxt ~key_type:int_t ~value_type:ticket_string_type + in + (* Remove one ticket from the lazy storage. *) + let* lazy_storage_diff, ctxt = + remove_diff + ctxt + contract + ~key_type:int_t + ~value_type:ticket_string_type + ~existing_entries: + [ + ( Script_int.of_int 1, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ); + ] + in + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:unit_t + ~storage_type:int_ticket_big_map_ty + ~arg:() + ~old_storage:empty_big_map + ~new_storage:empty_big_map + ~lazy_storage_diff:[lazy_storage_diff] + ~expected_diff:[(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1)] + ~expected_receipt: + [("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, -1)])] + +(** Test copying a big-map. *) +let test_diffs_copy_big_map () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + (* Start with an empty big-map *) + let* empty_big_map, ctxt = + empty_big_map ctxt ~key_type:int_t ~value_type:ticket_string_type + in + (* We add one ticket to the storage. *) + let* lazy_storage_diff, ctxt = + copy_diff + ctxt + contract + ~key_type:int_t + ~value_type:ticket_string_type + ~existing_entries: + [ + ( Script_int.of_int 1, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ); + ] + ~updates: + [ + ( Script_int.of_int 2, + Some (string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1) + ); + ] + in + (* We copy a big-map with one ticket inside (this is illegal in Michelson). + Then we add a new ticket to the map. The result is two new tickets. + *) + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:unit_t + ~storage_type:int_ticket_big_map_ty + ~arg:() + ~old_storage:empty_big_map + ~new_storage:empty_big_map + ~lazy_storage_diff:[lazy_storage_diff] + ~expected_diff: + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 1); + ] + ~expected_receipt: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, 1)]); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", [(contract, 1)]); + ] + +(** Test that adding and removing items from an existing big-map results + yield corresponding ticket-token diffs. *) +let test_diffs_add_to_existing_big_map () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + let* old_storage, ctxt = + make_big_map + ctxt + contract + ~key_type:int_t + ~value_type:ticket_string_type + [ + (* It doesn't matter what the old entries are. They are never traversed *) + ( Script_int.of_int 1, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ); + ( Script_int.of_int 2, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1 ); + ( Script_int.of_int 3, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1 ); + ] + in + (* We add one ticket to the storage. *) + let* lazy_storage_diff, ctxt = + existing_diff + ctxt + contract + ~key_type:int_t + ~value_type:ticket_string_type + ~existing_entries: + [ + ( Script_int.of_int 1, + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ); + ] + ~updates: + [ + (* Add one new ticket to the big-map. *) + ( Script_int.of_int 2, + Some (string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 2) + ); + (* Remove a ticket *) + (Script_int.of_int 1, None); + ] + in + (* Even if the old and the new storage are the same (and contains tickets) + we should still detect the diff from the lazy-storage diff. + Since the old and new storage are lazy, they should never be traversed. + *) + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:unit_t + ~storage_type:int_ticket_big_map_ty + ~arg:() + ~old_storage + ~new_storage:old_storage + ~lazy_storage_diff:[lazy_storage_diff] + ~expected_diff: + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 2); + ] + ~expected_receipt: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", [(contract, -1)]); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", [(contract, 2)]); + ] + +(** Test a combination of updates. *) +let test_diffs_args_storage_and_lazy_diffs () = + let open Lwt_result_syntax in + let open Script_typed_ir in + let* contract, ctxt = init () in + let*? int_ticket_big_map_ty = + big_map_type ~key_type:int_t ~value_type:ticket_string_type + in + let*? (Ty_ex_c list_big_map_pair_type) = + Environment.wrap_tzresult + @@ pair_t (-1) ticket_string_list_type int_ticket_big_map_ty + in + let* empty_big_map, ctxt = + empty_big_map ctxt ~key_type:int_t ~value_type:ticket_string_type + in + (* We send two tickets in the args. *) + let arg = + boxed_list + [ + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1; + ] + in + (* We add three tickets to the storage. *) + let* lazy_storage_diff, ctxt = + existing_diff + ctxt + contract + ~key_type:int_t + ~value_type:ticket_string_type + ~existing_entries:[] + ~updates: + [ + ( Script_int.of_int 1, + Some (string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1) + ); + ( Script_int.of_int 2, + Some (string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1) + ); + ( Script_int.of_int 3, + Some + (string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1) + ); + ] + in + (* We have three tickets in the old storage. *) + let old_storage = + ( boxed_list + [ + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1; + ], + empty_big_map ) + in + let new_storage = + ( boxed_list + [ + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1; + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 1; + ], + empty_big_map ) + in + (* + Diff: + Before script execution: + - Args: 1 red, 1 blue + - Old storage : 1 red, 1 blue, 1 green + - Total: 2 red, 2 blue, 1 green + After execution: + - New_storage: 1 green, 1 yellow + - Lazy-diff: 1 red, 1 blue, 1 green + - Total: 1 red, 1 blue, 2 green, 1 yellow + Net diff: + - -1 red, -1 blue, +1 green, +1 yellow + Receipt (diff in storage): + Before script execution: + - Old storage : 1 red, 1 blue, 1 green + - Total: 1 red, 1 blue, 1 green + After execution: + - New_storage: 1 green, 1 yellow + - Lazy-diff: 1 red, 1 blue, 1 green + - Total: 1 red, 1 blue, 2 green, 1 yellow + Net diff: + - +1 green, +1 yellow + + *) + assert_ticket_diffs + ctxt + ~loc:__LOC__ + ~self_contract:contract + ~arg_type:ticket_string_list_type + ~storage_type:list_big_map_pair_type + ~arg + ~old_storage + ~new_storage + ~lazy_storage_diff:[lazy_storage_diff] + ~expected_diff: + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 1); + ] + ~expected_receipt: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow", [(contract, 1)]); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green", [(contract, 1)]); + ] + +(** Test that attempting to transfer a ticket that exceeds the budget fails. *) +let test_update_invalid_transfer () = + let open Lwt_result_syntax in + let* baker, src, block = init_for_operation () in + let* destination, _script, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let ctxt = Incremental.alpha_ctxt incr in + let arg_type = ticket_string_list_type in + let arg = + boxed_list [string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1] + in + let* operation, ctxt = + transfer_operation ctxt ~src ~destination ~arg_type ~arg + in + assert_fail_with + ~loc:__LOC__ + ~msg: + "Attempted to send 1 unit(s) of a ticket created by \ + KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq." + (fun () -> + Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:src + ~ticket_diffs:Ticket_token_map.empty + [operation]) + +(** Test that adding more tickets created by the [self] contract is valid and + results in a balance update. *) +let test_update_ticket_self_diff () = + let open Lwt_result_syntax in + let* baker, src, block = init_for_operation () in + let* self, _script, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let ticketer = Contract_hash.to_b58check self in + let self = Contract.Originated self in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* ticket_diffs, ctxt = + wrap + (Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun _ -> assert false) + [(red_token, Z.of_int 10)]) + in + let* _, ctxt = + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs + []) + in + (* After update, we should have 10 added red tokens. *) + let* red_self_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract self) + red_token + in + assert_balance ~loc:__LOC__ ctxt red_self_token_hash (Some 10) + +(* Test that sending tickets to self succeed (there are no budget constraints). *) +let test_update_self_ticket_transfer () = + let open Lwt_result_syntax in + let* baker, self, block = init_for_operation () in + let* ticket_receiver, _script, incr = + originate + block + ~src:self + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + (* Ticket is self. That means we can transfer an unlimited amounts of such + ticket-tokens. *) + let ticketer = Contract.to_b58check self in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* operation, ctxt = + let arg_type = ticket_string_list_type in + let arg = + boxed_list + [ + (* Send a total of 10 units of ticket-tokens. *) + string_ticket ticketer "red" 1; + string_ticket ticketer "red" 2; + string_ticket ticketer "red" 3; + string_ticket ticketer "red" 4; + ] + in + transfer_operation + ctxt + ~src:self + ~destination:ticket_receiver + ~arg_type + ~arg + in + let* _, ctxt = + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs:Ticket_token_map.empty + [operation]) + in + (* Once we're done with the update, we expect ticket-receiver to have been + credited with 10 units of ticket-tokens. *) + let* () = + let* red_receiver_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract (Originated ticket_receiver)) + red_token + in + assert_balance ~loc:__LOC__ ctxt red_receiver_token_hash (Some 10) + in + return () + +(** Test that transferring a ticket that does not exceed the budget succeeds. *) +let test_update_valid_transfer () = + let open Lwt_result_syntax in + let* baker, self, block = init_for_operation () in + let* destination, _script, incr = + originate + block + ~src:self + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let ticketer = "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" in + assert (ticketer <> Contract.to_b58check self) ; + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* red_self_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract self) + red_token + in + let* red_receiver_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract (Originated destination)) + red_token + in + (* Set up the balance so that the self contract owns one ticket. *) + let* _, ctxt = + wrap @@ Ticket_balance.adjust_balance ctxt red_self_token_hash ~delta:Z.one + in + let* operation, ctxt = + let arg_type = ticket_string_list_type in + let arg = boxed_list [string_ticket ticketer "red" 1] in + transfer_operation ctxt ~src:self ~destination ~arg_type ~arg + in + let* _, ctxt = + let* ticket_diffs, ctxt = + wrap + (Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun _ -> assert false) + [(red_token, Z.of_int (-1))]) + in + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs + [operation]) + in + (* Once we're done with the update, we expect the balance to have been moved + from [self] to [destination]. *) + let* () = assert_balance ~loc:__LOC__ ctxt red_self_token_hash None in + let* () = assert_balance ~loc:__LOC__ ctxt red_receiver_token_hash (Some 1) in + return () + +(** Test that transferring a ticket to itself is allowed and does not impact + the balance. *) +let test_update_transfer_tickets_to_self () = + let open Lwt_result_syntax in + let* baker, src, block = init_for_operation () in + let* self_hash, _script, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let ticketer = "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" in + assert (ticketer <> Contract_hash.to_b58check self_hash) ; + let self = Contract.Originated self_hash in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* red_self_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract self) + red_token + in + (* Set up the balance so that the self contract owns ten tickets. *) + let* _, ctxt = + wrap + @@ Ticket_balance.adjust_balance + ctxt + red_self_token_hash + ~delta:(Z.of_int 10) + in + let* operation, ctxt = + let arg_type = ticket_string_list_type in + let arg = boxed_list [string_ticket ticketer "red" 1] in + transfer_operation ctxt ~src:self ~destination:self_hash ~arg_type ~arg + in + let* _, ctxt = + (* Ticket diff removes 5 tickets. *) + let* ticket_diffs, ctxt = + wrap + (Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun _ -> assert false) + [(red_token, Z.of_int (-5))]) + in + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs + [operation]) + in + (* We started with 10 units. Removed 5 from storage and sent one to [self]. + Therefore we expect 10 - 5 + 1 = 6 units remaining. *) + let* () = assert_balance ~loc:__LOC__ ctxt red_self_token_hash (Some 6) in + return () + +(** Test that attempting to originate a contract with tickets that exceed the + budget fails. *) +let test_update_invalid_origination () = + let open Lwt_result_syntax in + let* baker, src, block = init_for_operation () in + let* orig_contract, script, incr = + let storage = + let ticketer = "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" in + Printf.sprintf + {|{ Pair %S "red" 1; Pair %S "green" 1; Pair %S "blue" 1; } |} + ticketer + ticketer + ticketer + in + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let ctxt = Incremental.alpha_ctxt incr in + let* operation, ctxt = + origination_operation ctxt ~src ~orig_contract ~script + in + assert_fail_with + ~loc:__LOC__ + ~msg: + "Attempted to send 1 unit(s) of a ticket created by \ + KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq." + (fun () -> + Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:src + ~ticket_diffs:Ticket_token_map.empty + [operation]) + +(** Test update valid origination. *) +let test_update_valid_origination () = + let open Lwt_result_syntax in + let* baker, self, block = init_for_operation () in + let ticketer = "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" in + assert (ticketer <> Contract.to_b58check self) ; + let* orig_contract, script, incr = + let storage = Printf.sprintf {|{ Pair %S "red" 1; }|} ticketer in + originate + block + ~src:self + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* red_self_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract self) + red_token + in + (* Set up the balance so that the self contract owns one ticket. *) + let* _, ctxt = + wrap @@ Ticket_balance.adjust_balance ctxt red_self_token_hash ~delta:Z.one + in + let* operation, ctxt = + origination_operation ctxt ~src:self ~orig_contract ~script + in + let* _, ctxt = + let* ticket_diffs, ctxt = + wrap + (Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun _ -> assert false) + [(red_token, Z.of_int (-1))]) + in + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs + [operation]) + in + (* Once we're done with the update, we expect the balance to have been moved + from [self] to [destination]. *) + let* red_originated_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract (Originated orig_contract)) + red_token + in + assert_balance ~loc:__LOC__ ctxt red_originated_token_hash (Some 1) + +let test_update_self_origination () = + let open Lwt_result_syntax in + let* baker, self, block = init_for_operation () in + let ticketer = Contract.to_b58check self in + let* orig_contract, script, incr = + let storage = Printf.sprintf {|{ Pair %S "red" 1; }|} ticketer in + originate + block + ~src:self + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* red_originated_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract (Originated orig_contract)) + red_token + in + let* operation, ctxt = + origination_operation ctxt ~src:self ~orig_contract ~script + in + let* _, ctxt = + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs:Ticket_token_map.empty + [operation]) + in + (* Once we're done with the update, we expect the balance to have been + credited to the originated contract. *) + assert_balance ~loc:__LOC__ ctxt red_originated_token_hash (Some 1) + +(** Test ticket-token map of list with duplicates. *) +let test_ticket_token_map_of_list_with_duplicates () = + let open Lwt_result_syntax in + let* baker, src, block = init_for_operation () in + let* self, _script, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let ticketer = Contract_hash.to_b58check self in + let self = Contract.Originated self in + let ctxt = Incremental.alpha_ctxt incr in + let* red_token = string_ticket_token ticketer "red" in + let* ticket_diffs, ctxt = + wrap + (Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun ctxt v1 v2 -> ok (Z.add v1 v2, ctxt)) + [(red_token, Z.of_int 10); (red_token, Z.of_int 5)]) + in + let* _, ctxt = + wrap + (Ticket_accounting.update_ticket_balances + ctxt + ~self_contract:self + ~ticket_diffs + []) + in + (* After update, we should have 10 + 5 added red tokens. *) + let* red_self_token_hash, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract self) + red_token + in + assert_balance ~loc:__LOC__ ctxt red_self_token_hash (Some 15) + +let tests = + [ + Tztest.tztest "Diffs empty" `Quick test_diffs_empty; + Tztest.tztest "Diffs for tickets in args" `Quick test_diffs_tickets_in_args; + Tztest.tztest + "Diffs for tickets in args and storage" + `Quick + test_diffs_tickets_in_args_and_storage; + Tztest.tztest "Diffs for dropped ticket" `Quick test_diffs_drop_one_ticket; + Tztest.tztest + "Diffs for adding new ticket to storage" + `Quick + test_diffs_adding_new_ticket_to_storage; + Tztest.tztest + "Diffs for removing from storage" + `Quick + test_diffs_remove_from_storage; + Tztest.tztest + "Diffs for lazy storage allocation" + `Quick + test_diffs_lazy_storage_alloc; + Tztest.tztest + "Diffs for removing from big-map" + `Quick + test_diffs_remove_from_big_map; + Tztest.tztest "Diffs for copying a big-map" `Quick test_diffs_copy_big_map; + Tztest.tztest + "Diffs for adding to an existing big-map" + `Quick + test_diffs_add_to_existing_big_map; + Tztest.tztest + "Diffs for args, storage and lazy-diff" + `Quick + test_diffs_args_storage_and_lazy_diffs; + Tztest.tztest + "Update tickets balances with invalid transfer" + `Quick + test_update_invalid_transfer; + Tztest.tztest "Update ticket self diff" `Quick test_update_ticket_self_diff; + Tztest.tztest + "Update ticket balances for valid transfer" + `Quick + test_update_valid_transfer; + Tztest.tztest + "Update ticket balances for transfer with 'self' tickets" + `Quick + test_update_self_ticket_transfer; + Tztest.tztest + "Update transfer tickets to self" + `Quick + test_update_transfer_tickets_to_self; + Tztest.tztest + "Update invalid origination" + `Quick + test_update_invalid_origination; + Tztest.tztest + "Update valid origination" + `Quick + test_update_valid_origination; + Tztest.tztest + "Update valid self origination" + `Quick + test_update_self_origination; + Tztest.tztest + "Test ticket-token map with duplicate keys" + `Quick + test_ticket_token_map_of_list_with_duplicates; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml new file mode 100644 index 000000000000..c3e8bd9acdbc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml @@ -0,0 +1,1764 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_balance_key) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket balance" + Subject: Ticket balance key hashing +*) + +open Protocol +open Alpha_context +open Lwt_result_syntax + +let wrap m = m >|= Environment.wrap_tzresult + +type init_env = { + block : Block.t; + baker : Tezos_crypto.Signature.public_key_hash; + contract : Contract.t; +} + +let init_env () = + let* block, baker, contract, _src2 = Contract_helpers.init () in + return {block; baker; contract} + +let transaction block ~baker ~sender ~entrypoint ~recipient ~parameters = + let parameters = Script.lazy_expr @@ Expr.from_string parameters in + let* operation = + Op.transaction + (B block) + ~gas_limit:Max + ~entrypoint + ~parameters + ~fee:Tez.one + sender + recipient + (Tez.of_mutez_exn 0L) + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let* incr = Incremental.add_operation incr operation in + Incremental.finalize_block incr + +let originate = Contract_helpers.originate_contract_from_string + +let get_balance ctxt ~token ~owner = + let* key_hash, ctxt = + wrap @@ Ticket_balance_key.of_ex_token ctxt ~owner token + in + wrap (Ticket_balance.get_balance ctxt key_hash) + +let get_used_ticket_storage block = + let* incr = Incremental.begin_construction block in + wrap + @@ Ticket_balance.Internal_for_tests.used_storage_space + (Incremental.alpha_ctxt incr) + +let get_paid_ticket_storage block = + let* incr = Incremental.begin_construction block in + wrap + @@ Ticket_balance.Internal_for_tests.paid_storage_space + (Incremental.alpha_ctxt incr) + +let get_used_contract_storage block contract = + let* incr = Incremental.begin_construction block in + let alpha_ctxt = Incremental.alpha_ctxt incr in + wrap @@ Alpha_context.Contract.used_storage_space alpha_ctxt contract + +let get_paid_contract_storage block contract = + let* incr = Incremental.begin_construction block in + let alpha_ctxt = Incremental.alpha_ctxt incr in + wrap + @@ Alpha_context.Contract.Internal_for_tests.paid_storage_space + alpha_ctxt + contract + +let assert_paid_contract_storage ~loc block contract expected = + let* storage = get_paid_contract_storage block contract in + Assert.equal + ~loc + Z.equal + "Paid contract storage " + Z.pp_print + (Z.of_int expected) + storage + +let assert_used_contract_storage ~loc block contract expected = + let* storage = get_used_contract_storage block contract in + Assert.equal + ~loc + Z.equal + "Used contract storage " + Z.pp_print + (Z.of_int expected) + storage + +let assert_paid_ticket_storage ~loc block expected = + let* storage = get_paid_ticket_storage block in + Assert.equal + ~loc + Z.equal + "Paid ticket storage " + Z.pp_print + (Z.of_int expected) + storage + +let assert_used_ticket_storage ~loc block expected = + let* storage = get_used_ticket_storage block in + Assert.equal + ~loc + Z.equal + "Used ticket storage " + Z.pp_print + (Z.of_int expected) + storage + +let assert_token_balance ~loc block token owner expected = + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let* balance, _ = + get_balance ctxt ~token ~owner:(Destination.Contract owner) + in + match (balance, expected) with + | Some b, Some e -> Assert.equal_int ~loc (Z.to_int b) e + | Some b, None -> + failwith "%s: Expected no balance but got some %d" loc (Z.to_int b) + | None, Some b -> failwith "%s: Expected balance %d but got none" loc b + | None, None -> return () + +let string_token ~ticketer content = + let contents = + WithExceptions.Result.get_ok ~loc:__LOC__ @@ Script_string.of_string content + in + Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.string_t; contents} + +let unit_ticket ~ticketer = + Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.unit_t; contents = ()} + +let new_contracts ~before ~after = + let all_contracts current_block = + let* ctxt = + Incremental.begin_construction current_block >|=? Incremental.alpha_ctxt + in + Lwt.map Result.ok (Contract.list ctxt) + in + let* cs1 = all_contracts before in + let* cs2 = all_contracts after in + let not_in_cs1 = + let module S = Set.Make (String) in + let set = S.of_list @@ List.map Contract.to_b58check cs1 in + fun c -> not @@ S.mem (Contract.to_b58check c) set + in + return (List.filter not_in_cs1 cs2) + +let get_new_contract before f = + let* after = f before in + let* contracts = new_contracts ~before ~after in + match contracts with + | c :: _ -> return (c, after) + | _ -> failwith "Expected one new contracts" + +(** Test adding a ticket to a strict storage. *) +let test_add_strict () = + let* {block; baker; contract = source_contract} = init_env () in + (* Originate *) + let* contract, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter unit; + storage (list (ticket string)); + code + { CDR; + PUSH nat 1; + PUSH string "Red"; + TICKET; + ASSERT_SOME; + CONS; + NIL operation ; + PAIR } } + |} + ~storage:"{}" + block + in + let token_red = string_token ~ticketer:contract "Red" in + (* Before calling the contract the balance should be empty. *) + let* () = assert_token_balance ~loc:__LOC__ block token_red contract None in + (* Run the script *) + let* block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Unit" + in + (* After calling the contract, one ticket is added and balance is one. *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red contract (Some 1) + in + (* Calling the contract again should increase the balance once more. *) + let* block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Unit" + in + assert_token_balance ~loc:__LOC__ block token_red contract (Some 2) + +(** Test adding and removing tickets from a list in the storage. *) +let test_add_remove () = + let* {block; baker; contract = source_contract} = init_env () in + (* Originate *) + let* contract, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (or (unit %add) (unit %remove)); + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { DROP ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + CONS ; + NIL operation ; + PAIR } + { DROP 2 ; NIL (ticket string) ; NIL operation ; PAIR } } } + |} + ~storage:"{}" + block + in + let add_one block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Left Unit" + in + let clear block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Right Unit" + in + let token_red = string_token ~ticketer:contract "Red" in + (* Before calling the contract the balance should be empty *) + let* () = assert_token_balance ~loc:__LOC__ block token_red contract None in + (* Call the contract twice *) + let* block = add_one block in + let* block = add_one block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red contract (Some 2) + in + (* Remove tickets from the contract *) + let* block = clear block in + assert_token_balance ~loc:__LOC__ block token_red contract None + +(** Test adding multiple tickets to a big-map. *) +let test_add_to_big_map () = + let* {block; baker; contract = source_contract} = init_env () in + let* contract, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter int ; + storage (big_map int (ticket string)) ; + code { LEFT (big_map int (ticket string)) ; + LOOP_LEFT + { UNPAIR ; + PUSH int 0 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + LE ; + IF { DROP ; RIGHT (pair int (big_map int (ticket string))) } + { SWAP ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + SOME ; + DUP 3 ; + GET_AND_UPDATE ; + DROP ; + PUSH int 1 ; + DIG 2 ; + SUB ; + PAIR ; + LEFT (big_map int (ticket string)) } } ; + NIL operation ; + PAIR } } + |} + ~storage:"{}" + block + in + let* block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"100" + in + let token_red = string_token ~ticketer:contract "Red" in + assert_token_balance ~loc:__LOC__ block token_red contract (Some 100) + +(** Test adding, swapping and clearing big-maps from storage. + The script contains in its storage two big-maps: + + pair + (big_map %map1 int (ticket string)) + (big_map %map2 int (ticket string))) + + And takes three actions: + 1) Add one ticket to map1 + 2) Swap map1 and map2 + 3) Clear map1 + *) +let test_swap_big_map () = + let* {block; baker; contract = source_contract} = init_env () in + let* contract, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (or (or (int %add) (unit %clear)) (unit %swap)) ; + storage (pair (big_map %map1 int (ticket string)) (big_map %map2 int (ticket string))) ; + code { UNPAIR ; + NIL operation ; + SWAP ; + IF_LEFT + { IF_LEFT + { DIG 2 ; + UNPAIR ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + SOME ; + DIG 3 ; + GET_AND_UPDATE ; + DROP ; + PAIR ; + SWAP ; + PAIR } + { DROP ; SWAP ; CDR ; EMPTY_BIG_MAP int (ticket string) ; + PAIR ; SWAP ; PAIR } } + { DROP ; SWAP ; UNPAIR ; SWAP ; PAIR ; SWAP ; PAIR } } } + |} + ~storage:"Pair {} {}" + block + in + let add_to_index block ix = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:(Printf.sprintf "Left (Left %d)" ix) + in + let swap_big_maps block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Right Unit" + in + let clear_left_big_map block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:contract + ~parameters:"Left (Right Unit)" + in + (* Add three tickets to [map1] *) + let* block = add_to_index block 1 in + let* block = add_to_index block 2 in + let* block = add_to_index block 3 in + let token_red = string_token ~ticketer:contract "Red" in + let* () = + assert_token_balance ~loc:__LOC__ block token_red contract (Some 3) + in + (* Swap [map1] and [map2]. This should not impact the ticket balance. *) + let* block = swap_big_maps block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red contract (Some 3) + in + (* Remove all tickets from [map1] (which is empty). *) + let* block = clear_left_big_map block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red contract (Some 3) + in + (* Swap [map1] and [map2]. Now, [map1] contains three tickets. *) + let* block = swap_big_maps block in + (* Clear all tickets from [map1]. *) + let* block = clear_left_big_map block in + assert_token_balance ~loc:__LOC__ block token_red contract None + +(* Test sending a ticket to an address *) +let test_send_tickets () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract that can receive a ticket and store it in a list. *) + let* ticket_receiver, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (ticket string) ; + storage (list (ticket string)) ; + code { UNPAIR ; CONS ; NIL operation ; PAIR } } + |} + ~storage:"{}" + block + in + (* A contract that, given an address to a contract that receives tickets, + mints a ticket and sends it over. *) + let* ticket_sender, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter address ; + storage unit ; + code { CAR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract of type `ticket(string)' not found" ; + FAILWITH } + { PUSH mutez 0 ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + |} + ~storage:"Unit" + block + in + let mint_and_send block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_sender + ~parameters: + (Printf.sprintf {|"%s"|} @@ Contract.to_b58check ticket_receiver) + in + (* Call ticket-sender twice in order to transfer tickets to ticket-receiver *) + let* block = mint_and_send block in + let* block = mint_and_send block in + let token_red = string_token ~ticketer:ticket_sender "Red" in + assert_token_balance ~loc:__LOC__ block token_red ticket_receiver (Some 2) + +(** Test sending and storing tickets with amount zero. *) +let test_send_and_store_zero_amount_tickets () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract that, given an address to a contract that receives tickets, + mints a ticket and sends it over. *) + let* ticket_minter, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + |} + ~storage:"Unit" + block + in + (* A contract with two entrypoints: + - Store (ticket): stores the received ticket. + - Send (address) sends the last received tickets to the given address. + *) + let ticket_storer_script = + {| + { parameter (or (address %send) (ticket %store string)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { CONTRACT (ticket string) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { SWAP ; + IF_CONS + { DIG 2 ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + SWAP ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } + { DROP ; PUSH string "Empty storage" ; FAILWITH } } } + { CONS ; NIL operation ; PAIR } } } + |} + in + let* ticket_store_1, _script, block = + originate + ~baker + ~source_contract + ~script:ticket_storer_script + ~storage:"{}" + block + in + let* ticket_store_2, _script, block = + originate + ~baker + ~source_contract + ~script:ticket_storer_script + ~storage:"{}" + block + in + let mint_and_send_to_storer_1 block amount = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_minter + ~parameters: + (Printf.sprintf + {|Pair "%s%s" %d|} + (Contract.to_b58check ticket_store_1) + "%store" + amount) + in + let send_from_store_1_to_store_2 block = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "send") + ~baker + ~sender:source_contract + block + ~recipient:ticket_store_1 + ~parameters: + (Printf.sprintf + {|"%s%s"|} + (Contract.to_b58check ticket_store_2) + "%store") + in + let token_red = string_token ~ticketer:ticket_minter "Red" in + (* Mint and send a ticket with amount 0 to [ticket_store_1], which fails. + After the transaction: + + [ticket_store_1]: + [ ] + *) + let*! result = mint_and_send_to_storer_1 block 0 in + assert (Result.is_error result) ; + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 None + in + (* Mint and send a ticket with amount 10 to [ticket_store_1]. After + the transaction: + + [ticket_store_1]: + [ + (TM, "Red", 10) + ] + *) + let* block = mint_and_send_to_storer_1 block 10 in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 (Some 10) + in + (* Send the top of [ticket_storer_1]'s list to [ticket_store_2]. That is the + ticket (TM, "Red", 10). After the transaction: + + ticket_store_1: + [ ] + ticket_store_2: + [ + (TM, "Red", 10) + ] + *) + let* block = send_from_store_1_to_store_2 block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_2 (Some 10) + in + (* Send the top of [ticket_store_1]'s stack to [ticket_store_2]. + However, this fails because [ticket_store_1]'s stack is empty. + Now, [ticket_store_2] holds both tickets. + + ticket_store_1: + [ ] + [ticket_store_2]: + [ + (TM, "Red", 10) + ] + *) + let*! result = send_from_store_1_to_store_2 block in + assert (Result.is_error result) ; + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_2 (Some 10) + in + (* Mint and send a ticket with amount 5 to [ticket_store_1]. After the + transaction: + + [ticket_store_1]: + [ + (TM, "Red", 5) + ] + [ticket_store_2]: + [ + (TM, "Red", 10) + ] + *) + let* block = mint_and_send_to_storer_1 block 5 in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 (Some 5) + in + (* Send the top of [ticket_store_1]'s stack to [ticket_store_2]. That is the + ticket (TM, "Red", 5). After the transaction, [ticket_store_2] holds three + tickets: + + ticket_store_1: + [ ] + [ticket_store_2]: + [ + (TM, "Red", 5) + (TM, "Red", 10) + ] + *) + let* block = send_from_store_1_to_store_2 block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_1 None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_store_2 (Some 15) + in + return_unit + +(** Test sending tickets to an implicit account. *) +let test_send_tickets_to_implicit_account () = + let* block, baker, contract, contract2 = Contract_helpers.init () in + let () = + match (contract, contract2) with + | Contract.Implicit _, Contract.Implicit _ -> () + | _ -> assert false + in + (* A contract that receives an address and mints and sends a ticket to it. *) + let* ticketer, _script, block = + originate + ~baker + ~source_contract:contract + ~script: + {| + { parameter address; + storage unit; + code { CAR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0; + PUSH nat 1 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR }}} + |} + ~storage:"Unit" + block + in + let* block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:contract + block + ~recipient:ticketer + ~parameters:(Printf.sprintf {|"%s"|} (Contract.to_b58check contract2)) + in + let token = string_token ~ticketer "Ticket" in + assert_token_balance ~loc:__LOC__ block token contract2 (Some 1) + +(** Test sending tickets in a big-map. *) +let test_send_tickets_in_big_map () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract that can receive a big-map with tickets. *) + let* ticket_receiver, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (big_map int (ticket string)) ; + storage (big_map int (ticket string)) ; + code { CAR ; NIL operation ; PAIR } } + |} + ~storage:"{}" + block + in + (* A contract with two actions: + - [mint_and_save(key, content)] for creating and saving a new ticket in + a big-map. + - [send (address)] for transferring the big-map to the given address. + *) + let* ticket_manager, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (or (pair %mint_and_save int string) (address %send)) ; + storage (big_map int (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { UNPAIR ; + DIG 2 ; + PUSH nat 1 ; + DIG 3 ; + TICKET ; + ASSERT_SOME ; + SOME ; + DIG 2 ; + GET_AND_UPDATE ; + DROP ; + NIL operation ; + PAIR } + { CONTRACT (big_map int (ticket string)) ; + IF_NONE + { PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + EMPTY_BIG_MAP int (ticket string) ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } } + |} + ~storage:"{}" + block + in + let mint_and_save key content block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters:(Printf.sprintf {|Left (Pair %d "%s")|} key content) + in + let send block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters: + (Printf.sprintf {|Right "%s"|} @@ Contract.to_b58check ticket_receiver) + in + let token_red = string_token ~ticketer:ticket_manager "Red" in + let token_blue = string_token ~ticketer:ticket_manager "Blue" in + let token_yellow = string_token ~ticketer:ticket_manager "Yellow" in + (* Call ticket manager to mint and save three tickets in a big-map. *) + let* block = mint_and_save 1 "Red" block in + let* block = mint_and_save 2 "Blue" block in + let* block = mint_and_save 3 "Yellow" block in + (* Verify that all three tickets are accounted for and belong to + ticket-manager. *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_manager (Some 1) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_blue ticket_manager (Some 1) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_yellow ticket_manager (Some 1) + in + (* Send over the big-map with tickets to ticket-receiver. *) + let* block = send block in + (* Verify that all three tickets now belong to the ticket-receiver contract. *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_receiver (Some 1) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_blue ticket_receiver (Some 1) + in + let* () = + assert_token_balance + ~loc:__LOC__ + block + token_yellow + ticket_receiver + (Some 1) + in + (* Finally test that the ticket-manager no longer holds any of the tickets *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_manager None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_blue ticket_manager None + in + assert_token_balance ~loc:__LOC__ block token_yellow ticket_manager None + +(* Test sending tickets in a big-map. *) +let test_modify_big_map () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract with two actions: + - [Add ((int, string))] for adding a ticket to the big-map. + - [Remove(int)] for removing an index from the big-map. + *) + let* ticket_manager, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (or (pair %add int string) (int %remove)) ; + storage (big_map int (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { UNPAIR ; + DIG 2 ; + PUSH nat 1 ; + DIG 3 ; + TICKET ; + ASSERT_SOME ; + SOME ; + DIG 2 ; + GET_AND_UPDATE ; + DROP ; + NIL operation ; + PAIR } + { SWAP ; + NONE (ticket string) ; + DIG 2 ; + GET_AND_UPDATE ; + DROP ; + NIL operation ; + PAIR } } } + |} + ~storage:"{}" + block + in + let add key content block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters:(Printf.sprintf {|Left (Pair %d "%s")|} key content) + in + let remove key block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters:(Printf.sprintf {|Right %d|} key) + in + let token_red = string_token ~ticketer:ticket_manager "Red" in + let token_blue = string_token ~ticketer:ticket_manager "Blue" in + let token_yellow = string_token ~ticketer:ticket_manager "Yellow" in + let token_green = string_token ~ticketer:ticket_manager "Green" in + (* Add a red, blue and a yellow ticket *) + let* block = add 1 "Red" block in + let* block = add 2 "Blue" block in + let* block = add 3 "Yellow" block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_manager (Some 1) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_blue ticket_manager (Some 1) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_yellow ticket_manager (Some 1) + in + (* Replace the red ticket at index 1 with a green one. *) + let* block = add 1 "Green" block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_manager None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_green ticket_manager (Some 1) + in + (* Remove the blue ticket at index 2. *) + let* block = remove 2 block in + let* () = + assert_token_balance ~loc:__LOC__ block token_blue ticket_manager None + in + (* Add one more green ticket at index 4 and verify that the total count is 2. *) + let* block = add 4 "Green" block in + assert_token_balance ~loc:__LOC__ block token_green ticket_manager (Some 2) + +(* Test sending tickets in a big-map to a receiver that drops it. *) +let test_send_tickets_in_big_map_and_drop () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract that can receive a big-map with tickets but drops it. *) + let* ticket_receiver, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (big_map int (ticket string)) ; + storage unit; + code { DROP; PUSH unit Unit; NIL operation ; PAIR } } + |} + ~storage:"Unit" + block + in + (* A contract that, given an address, creates a ticket and sends it to the + corresponding contract in a big-map. *) + let* ticket_sender, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter address ; + storage unit ; + code { CAR ; + EMPTY_BIG_MAP int (ticket string) ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 1 ; + GET_AND_UPDATE ; + DROP ; + SWAP ; + CONTRACT (big_map int (ticket string)) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + + |} + ~storage:"Unit" + block + in + let token_red = string_token ~ticketer:ticket_sender "Red" in + (* Call ticket-sender to send a ticket to ticket-receiver. *) + let* block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_sender + ~parameters: + (Printf.sprintf {|"%s"|} @@ Contract.to_b58check ticket_receiver) + in + (* Verify that neither ticket-sender nor ticket-receiver holds any balance + for the ticket. *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_sender None + in + assert_token_balance ~loc:__LOC__ block token_red ticket_receiver None + +(* Test create contract with tickets *) +let test_create_contract_with_ticket () = + let* {block; baker; contract = source_contract} = init_env () in + let* ticket_creator, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (pair (pair string nat) key_hash) ; + storage unit ; + code { UNPAIR ; + UNPAIR ; + UNPAIR ; + TICKET ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + SOME ; + CREATE_CONTRACT + { parameter (ticket string) ; + storage (ticket string) ; + code { CAR ; NIL operation ; PAIR } } ; + SWAP ; + DROP ; + SWAP ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } + |} + ~storage:"Unit" + block + in + let token_red = string_token ~ticketer:ticket_creator "Red" in + (* Call ticket-creator to originate a new contract with one ticket *) + let* new_contract, block = + get_new_contract block (fun block -> + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_creator + ~parameters: + (Printf.sprintf + {|Pair (Pair "Red" 1) "%s"|} + (Contract.to_b58check source_contract))) + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red new_contract (Some 1) + in + assert_token_balance ~loc:__LOC__ block token_red ticket_creator None + +let test_join_tickets () = + let* {block; baker; contract = source_contract} = init_env () in + let* ticket_joiner, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter unit ; + storage (option (ticket string)) ; + code { CDR ; + IF_NONE + { PUSH nat 1 ; PUSH string "Red" ; + TICKET ; ASSERT_SOME ; SOME ; NIL operation ; PAIR } + { PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + PAIR ; + JOIN_TICKETS ; + NIL operation ; + PAIR } } } + |} + ~storage:"None" + block + in + let token_red = string_token ~ticketer:ticket_joiner "Red" in + (* Call ticket joiner to create and join an additional ticket. *) + let add block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_joiner + ~parameters:"Unit" + in + (* Add three tickets *) + let* block = add block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_joiner (Some 1) + in + let* block = add block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_joiner (Some 2) + in + let* block = add block in + assert_token_balance ~loc:__LOC__ block token_red ticket_joiner (Some 3) + +(* A simple fungible token contract implemented using tickets of type + [ticket unit]. + parameter: + - burn: ticket unit + - mint: (contract %destination (ticket unit)) x (nat %amount) +*) +let ticket_builder = + {| + + parameter + (or (ticket %burn unit) + (pair %mint (contract %destination (ticket unit)) (nat %amount))); + storage address; + code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR; + IF_LEFT + { + # Burn entrypoint + # Check that the ticket is ticketed by ourselves + READ_TICKET; CAR; SELF_ADDRESS; ASSERT_CMPEQ; + + # Drop the ticket + DROP; + + # Finish + NIL operation + } + { + # Mint entrypoint + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + UNPAIR; + SWAP; UNIT; TICKET; ASSERT_SOME; + PUSH mutez 0; SWAP; TRANSFER_TOKENS; + NIL operation; SWAP; CONS + }; + PAIR + } + + |} + +(* A simple wallet for fungible tokens implemented using tickets of + type [ticket unit]. + parameter: + - receive: ticket unit + - send: + * destination: (contract (ticket unit)) + * amount: nat + * ticketer: address +*) +let ticket_wallet = + {| + parameter + (or + (ticket %receive unit) + (pair %send (contract %destination (ticket unit)) (nat %amount) (address %ticketer))); + storage (pair (address %manager) (big_map %tickets address (ticket unit))); + code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR 3; + IF_LEFT + { + # Receive entrypoint + + # Get the ticketer + READ_TICKET; CAR @ticketer; DUP; + + # Extract the associated ticket, if any, from the stored big map + DIG 4; + NONE (ticket unit); + DIG 2; + GET_AND_UPDATE; + + # Join it with the parameter + IF_SOME + { + DIG 3; + PAIR; + JOIN_TICKETS; + ASSERT_SOME + } + { DIG 2 }; + SOME; + DIG 2; + GET_AND_UPDATE; + ASSERT_NONE; + SWAP; + PAIR; + NIL operation + } + { + # Send entrypoints + + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + UNPAIR 3; + + # Get the ticket associated to the requested ticketer + DIG 4; + NONE (ticket unit); + DUP @ticketer 5; + GET_AND_UPDATE; + ASSERT_SOME; + + # Substract the requested amount + READ_TICKET; + GET @total_amount 4; + DUP @amount 5; + SWAP; SUB; + DUP; EQ; + IF + { + # Drop @remaining_amount because it is zero + DROP; + # Drop @amount because this is now irrelevant + DIG 3; DROP; + # Drop @ticketer because we are not storing any ticket in this wallet + DIG 3; DROP; + # Bring the big map to the stack top since the ticket entry is already striked out + DUG 3 + } + { + ISNAT; ASSERT_SOME @remaining_amount; + + # Split the ticket + DIG 4; PAIR; SWAP; SPLIT_TICKET; + ASSERT_SOME; UNPAIR @to_send @to_keep; + + # Store the ticket to keep + DUG 5; + SOME; + DIG 3; + GET_AND_UPDATE; + ASSERT_NONE; + }; + DIG 2; PAIR; + + # Send the ticket + SWAP; + PUSH mutez 0; + DIG 3; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + }; + PAIR + } + |} + +(** Test ticket wallet implementation including sending tickets to self. *) +let test_ticket_wallet () = + let* {block; baker; contract = source_contract} = init_env () in + let* ticket_builder, _script, block = + originate + ~baker + ~source_contract + ~script:ticket_builder + ~storage:(Printf.sprintf "%S" @@ Contract.to_b58check source_contract) + block + in + let* ticket_wallet, _script, block = + originate + ~baker + ~source_contract + ~script:ticket_wallet + ~storage: + (Printf.sprintf "Pair %S {}" @@ Contract.to_b58check source_contract) + block + in + (* Call ticket-builder to mint one ticket and send to ticket-wallet. *) + let ticket_builder_token = unit_ticket ~ticketer:ticket_builder in + let send_one block = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "mint") + ~baker + ~sender:source_contract + block + ~recipient:ticket_builder + ~parameters: + (Printf.sprintf + {|Pair "%s%sreceive" 1|} + (Contract.to_b58check ticket_wallet) + "%") + in + (* Call ticket wallet to send a ticket to ticket-builder's burn address + entrypoint. *) + let send_to_burn block = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "send") + ~baker + ~sender:source_contract + block + ~recipient:ticket_wallet + ~parameters: + (Printf.sprintf + {|Pair "%s%sburn" 1 %S|} + (Contract.to_b58check ticket_builder) + "%" + (Contract.to_b58check ticket_builder)) + in + let send_to_self block = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "send") + ~baker + ~sender:source_contract + block + ~recipient:ticket_wallet + ~parameters: + (Printf.sprintf + {|Pair "%s%sreceive" 1 %S|} + (Contract.to_b58check ticket_wallet) + "%" + (Contract.to_b58check ticket_builder)) + in + let assert_balance block balance = + assert_token_balance + ~loc:__LOC__ + block + ticket_builder_token + ticket_wallet + balance + in + (* Mint and send tickets to wallet. *) + let* block = send_one block in + let* () = assert_balance block (Some 1) in + let* block = send_one block in + let* () = assert_balance block (Some 2) in + (* Send to self should not affect the balance. *) + let* block = send_to_self block in + let* () = assert_balance block (Some 2) in + (* Burn tickets by sending to burn address. *) + let* block = send_to_burn block in + let* () = assert_balance block (Some 1) in + let* block = send_to_burn block in + assert_balance block None + +(* Test used ticket storage and paid storage. *) +let test_ticket_storage () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract that can receive a ticket and store it. Each new ticket it + receives is added to a list. *) + let* ticket_keeper, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (ticket string) ; + storage (list (ticket string)) ; + code { UNPAIR ; CONS ; NIL operation ; PAIR } } + |} + ~storage:"{}" + block + in + (* A contract that receives a pair of ticket and address and forwards the + ticket to the given address. The contract does not store any tickets. *) + let* ticket_forwarder, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (pair (ticket string) address) ; + storage unit ; + code { CAR ; + UNPAIR ; + SWAP ; + CONTRACT (ticket string) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + |} + ~storage:"Unit" + block + in + (* A contract that takes two addresses: one to a ticket-forward contract and + one to a ticket-receiver contract, mints and sends the ticket to a + ticket-forward address along with the address of the ticket-receiver. + + Altogether we have: + + [ticket_minter] ----> [ticket_forwarder] ----> [ticket_receiver] + *) + let* ticket_minter, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (pair address address) ; storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (pair (ticket string) address) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH nat 1 ; + PUSH string "Red" ; + TICKET ; + ASSERT_SOME ; + PAIR ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } |} + ~storage:"Unit" + block + in + let mint_and_send block = + transaction + ~entrypoint:Entrypoint.default + ~baker + ~sender:source_contract + block + ~recipient:ticket_minter + ~parameters: + (Printf.sprintf + {|Pair %S %S|} + (Contract.to_b58check ticket_forwarder) + (Contract.to_b58check ticket_keeper)) + in + let* block = mint_and_send block in + let token_red = string_token ~ticketer:ticket_minter "Red" in + (* Verify that the ticket is accredited to the ticket keeper and no one else. + The ticket table now looks like: + *) + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_minter None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_forwarder None + in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_keeper (Some 1) + in + (* Both ticket paid and used storage should now be 65 bytes for the key and + one for the value. Ticket table looks like: + + | Owner x Ticket-token | Amount | + |--------------------------|--------| + | ticket_keeper x Red | 1 | + + Used storage: 65 + 1 = 66 + + Paid storage: 66 + *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 66 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 66 in + (* Send another ticket that uses the same slot. That does not increase used + storage. The first call from [ticket_minter] to ticket-forwarder results in + a table: + + | Owner x Ticket-token | Amount | + |--------------------------|--------| + | ticket_forwarder x Red | 1 | + | ticket_keeper x Red | 1 | + + Used storage: 132 + + The call from ticket-forwarder to [ticket_keeper] results in: + + | Owner x Ticket-token | Amount | + |--------------------------|--------| + | ticket_keeper x Red | 2 | + + Used storage: 66 + + Noted that the paid-storage "water-marker" was pushed up to 132. + *) + let* block = mint_and_send block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_keeper (Some 2) + in + let* () = assert_used_ticket_storage ~loc:__LOC__ block 66 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 132 in + (* Send yet another ticket that uses the same slot. That does not increase used + storage and it's using already paid storage. The first call from + [ticket_minter] to ticket-forwarder results in a table: + + | Owner x Ticket-token | Amount | + |--------------------------|--------| + | ticket_forwarder x Red | 1 | + | ticket_keeper x Red | 2 | + + Used storage: 132 + + The call from ticket-forwarder to [ticket_keeper] results in: + + | Owner x Ticket-token | Amount | + |--------------------------|--------| + | ticket_keeper x Red | 3 | + + Used storage: 66 + + Here, the paid_storage "water-mark" is not pushed up. + *) + let* block = mint_and_send block in + let* () = + assert_token_balance ~loc:__LOC__ block token_red ticket_keeper (Some 3) + in + let* () = assert_used_ticket_storage ~loc:__LOC__ block 66 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 132 in + return () + +(* Test used ticket storage and paid storage. *) +let test_storage_for_create_and_remove_tickets () = + let* {block; baker; contract = source_contract} = init_env () in + (* A contract with two endpoints: + - Create n tickets and add to its storage + - Remove all tickets + *) + let* ticket_manager, _script, block = + originate + ~baker + ~source_contract + ~script: + {| + { parameter (or (pair %add nat string) (unit %clear)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { UNPAIR ; DIG 2 ; SWAP ; DIG 2 ; TICKET ; ASSERT_SOME ; CONS ; NIL operation ; PAIR } + { DROP 2 ; NIL (ticket string) ; NIL operation ; PAIR } } } + |} + ~storage:"{}" + block + in + let add block n content = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "add") + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters:(Printf.sprintf "Pair %d %S" n content) + in + let clear block = + transaction + ~entrypoint:(Entrypoint.of_string_strict_exn "clear") + ~baker + ~sender:source_contract + block + ~recipient:ticket_manager + ~parameters:"Unit" + in + (* Initially the used and paid contract storage size is 141. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 141 + in + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 141 + in + (* Add 1000 units of "A" tickets. *) + let* block = add block 1000 "A" in + (* After adding one block the new used and paid storage grows to accommodate + for the new ticket. The size is 141 + 40 (size of ticket) = 181. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 181 + in + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 181 + in + (* The size of used and paid-for ticket storage is 67 bytes. (65 for hash + and 2 for amount). *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 67 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 67 in + (* Add 1000 units of "B" tickets. *) + let* block = add block 1000 "B" in + (* The new used and paid for contract storage grow to 155 + 40 = 195. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 221 + in + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 221 + in + (* The new used and paid for ticket storage doubles (2 * 67 = 134). *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 134 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 134 in + (* Clear all tickets. *) + let* block = clear block in + (* We're back to 115 base-line for the used contract storage and keep 195 for + paid. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 141 + in + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 221 + in + (* Since the ticket-table is empty it does not take up any space. However, + we've already paid for 134 bytes. *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 0 in + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 134 in + (* Add one unit of "C" tickets. *) + let* block = add block 1 "C" in + (* The new used storage is 141 + 39 (size of ticket) = 180. The size is 39 + rather than 40 because it carries a smaller amount payload. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 180 + in + (* We still have paid for 221 contract storage. *) + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 221 + in + (* There is one row in the ticket table with size 65 (for the hash) + 1 + (for the amount) = 65 bytes. *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 66 in + (* We've still paid for 134 bytes however. *) + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 134 in + (* Add yet another "C" ticket. *) + let* block = add block 1 "C" in + (* The new used storage is 180 + 39 (size of ticket) = 219. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 219 + in + (* We still have paid for 221 contract storage. *) + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 221 + in + (* There is still only one row in the ticket table with size 66. *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 66 in + (* And we've still paid for 134 bytes. *) + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 134 in + (* Add a "D" ticket. *) + let* block = add block 1 "D" in + (* The new used storage is 219 + 39 (size of ticket) = 258. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 258 + in + (* The paid storage also increases to 258. *) + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 258 + in + (* There are now two rows in the ticket table: 2 x 66 = 132 *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 132 in + (* And we've still paid for 134 bytes. *) + let* () = assert_paid_ticket_storage ~loc:__LOC__ block 134 in + let* block = add block 1 "E" in + (* The new used storage is 258 + 39 (size of ticket) = 297. *) + let* () = + assert_used_contract_storage ~loc:__LOC__ block ticket_manager 297 + in + (* The paid storage also increases to 297. *) + let* () = + assert_paid_contract_storage ~loc:__LOC__ block ticket_manager 297 + in + (* There are now three rows in the ticket table: 3 x 66 = 198. *) + let* () = assert_used_ticket_storage ~loc:__LOC__ block 198 in + (* And the paid storage has increased. *) + assert_paid_ticket_storage ~loc:__LOC__ block 198 + +let tests = + [ + Tztest.tztest "Test add strict" `Quick test_add_strict; + Tztest.tztest "Test add and remove" `Quick test_add_remove; + Tztest.tztest "Test add to big-map" `Quick test_add_to_big_map; + Tztest.tztest "Test swap big-map" `Quick test_swap_big_map; + Tztest.tztest "Test send ticket" `Quick test_send_tickets; + Tztest.tztest + "Test send ticket to implicit" + `Quick + test_send_tickets_to_implicit_account; + Tztest.tztest + "Test send and store tickets with amount 0" + `Quick + test_send_and_store_zero_amount_tickets; + Tztest.tztest + "Test send tickets in big-map" + `Quick + test_send_tickets_in_big_map; + Tztest.tztest "Test modify big-map" `Quick test_modify_big_map; + Tztest.tztest "Test send drop" `Quick test_send_tickets_in_big_map_and_drop; + Tztest.tztest "Test send drop" `Quick test_create_contract_with_ticket; + Tztest.tztest "Test join" `Quick test_join_tickets; + Tztest.tztest "Test wallet" `Quick test_ticket_wallet; + Tztest.tztest "Test ticket storage" `Quick test_ticket_storage; + Tztest.tztest + "Test storage for create and remove tickets" + `Quick + test_storage_for_create_and_remove_tickets; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml new file mode 100644 index 000000000000..1d3af7b23ebd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml @@ -0,0 +1,454 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_balance_key) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket balance key" + Subject: Ticket balance key hashing +*) + +open Protocol +open Alpha_context + +let ( let* ) m f = m >>=? f + +let wrap m = m >|= Environment.wrap_tzresult + +let new_ctxt () = + let* block, _contract = Context.init1 () in + let* incr = Incremental.begin_construction block in + return @@ Incremental.alpha_ctxt incr + +let make_contract ticketer = wrap @@ Lwt.return @@ Contract.of_b58check ticketer + +let make_ex_token ctxt ~ticketer ~ty ~content = + let* Script_ir_translator.Ex_comparable_ty cty, ctxt = + let node = Micheline.root @@ Expr.from_string ty in + wrap @@ Lwt.return @@ Script_ir_translator.parse_comparable_ty ctxt node + in + let* ticketer = make_contract ticketer in + let* contents, ctxt = + let node = Micheline.root @@ Expr.from_string content in + wrap @@ Script_ir_translator.parse_comparable_data ctxt cty node + in + return (Ticket_token.Ex_token {contents_type = cty; ticketer; contents}, ctxt) + +let make_key ctxt ~ticketer ~ty ~content ~owner = + let* ex_token, ctxt = make_ex_token ctxt ~ticketer ~ty ~content in + let* owner = make_contract owner in + let* key, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract owner) + ex_token + in + return (key, ctxt) + +let equal_script_hash ~loc msg key1 key2 = + Assert.equal ~loc Ticket_hash.equal msg Ticket_hash.pp key1 key2 + +let not_equal_script_hash ~loc msg key1 key2 = + Assert.not_equal ~loc Ticket_hash.equal msg Ticket_hash.pp key1 key2 + +let assert_keys ~ticketer1 ~ticketer2 ~ty1 ~ty2 ~amount1 ~amount2 ~content1 + ~content2 ~owner1 ~owner2 assert_condition = + let* ctxt = new_ctxt () in + let* key1, ctxt = + make_key ctxt ~ticketer:ticketer1 ~ty:ty1 ~content:content1 ~owner:owner1 + in + let* key2, _ = + make_key ctxt ~ticketer:ticketer2 ~ty:ty2 ~content:content2 ~owner:owner2 + in + assert_condition (key1, amount1) (key2, amount2) + +let assert_keys_not_equal ~loc = + assert_keys (fun (key1, _) (key2, _) -> + not_equal_script_hash ~loc "Assert that keys are not equal" key1 key2) + +let assert_keys_equal ~loc = + assert_keys (fun (key1, _) (key2, _) -> + equal_script_hash ~loc "Assert that keys are equal" key1 key2) + +(** Test that tickets with two different amounts map to the same hash. + The amount is not part of the ticket balance key. *) +let test_different_amounts () = + assert_keys_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"unit" + ~ty2:"unit" + ~content1:"Unit" + ~content2:"Unit" + ~amount1:1 + ~amount2:2 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that two tickets with different ticketers map to different hashes. *) +let test_different_ticketers () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~ty1:"nat" + ~ty2:"nat" + ~content1:"1" + ~content2:"1" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that two tickets with different owners map to different hashes. *) +let test_different_owners () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"nat" + ~ty2:"nat" + ~content1:"1" + ~content2:"1" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + +(** Test that two tickets with different contents map to different hashes. *) +let test_different_content () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"nat" + ~ty2:"nat" + ~content1:"1" + ~content2:"2" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type nat and a ticket of type int, with the same + content, map to different hashes. *) +let test_nat_int () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"nat" + ~ty2:"int" + ~content1:"1" + ~content2:"1" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type nat and a ticket of type mutez, with the same + content, map to different hashes. *) +let test_nat_mutez () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"nat" + ~ty2:"mutez" + ~content1:"1" + ~content2:"1" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type nat and a ticket of type bool, with the + contents (False/0), map to different hashes. *) +let test_bool_nat () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"bool" + ~ty2:"nat" + ~content1:"False" + ~content2:"0" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type nat and a ticket of type bytes, with the + contents (0/0x), map to different hashes. *) +let test_nat_bytes () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"nat" + ~ty2:"bytes" + ~content1:"0" + ~content2:"0x" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a chain_id with same content + map to different hashes. *) +let test_string_chain_id () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"chain_id" + ~content1:{|"NetXynUjJNZm7wi"|} + ~content2:{|"NetXynUjJNZm7wi"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a key_hash with same content + map to different hashes. *) +let test_string_key_hash () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"key_hash" + ~content1:{|"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"|} + ~content2:{|"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a key with same content + map to different hashes. *) +let test_string_key () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"key" + ~content1:{|"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"|} + ~content2:{|"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a timestamp with same content + map to different hashes. *) +let test_string_timestamp () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"timestamp" + ~content1:{|"2019-09-26T10:59:51Z"|} + ~content2:{|"2019-09-26T10:59:51Z"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a address with same content + map to different hashes. *) +let test_string_address () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"address" + ~content1:{|"KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%entrypoint"|} + ~content2:{|"KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%entrypoint"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type string and a signature with same content + map to different hashes. *) +let test_string_signature () = + let signature = + {|"edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7"|} + in + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"string" + ~ty2:"signature" + ~content1:signature + ~content2:signature + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Tests that annotations are not taken into account when hashing keys. + Two comparable types that only differ in their annotations should + map to to the same hash. Here, the type [pair int string] is identical to + [pair (int %id) (string %name)]. + *) +let test_annotation_pair () = + assert_keys_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"(pair int string)" + ~ty2:{|(pair (int %id) (string %name))|} + ~content1:{|Pair 1 "hello"|} + ~content2:{|Pair 1 "hello"|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Tests that annotations are not taken into account when hashing keys. + Here the types [or int string] and [or (int %id) (string %name)] + should hash to the same key. + *) +let test_annotation_or () = + assert_keys_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"(or int string)" + ~ty2:{|(or (int %id) (string %name))|} + ~content1:{|Left 1|} + ~content2:{|Left 1|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Tests that annotations are not taken into account when hashing keys. + Here the types [int] and [(int :int_alias)] should hash to the same key. + *) +let test_annotation_type_alias () = + assert_keys_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"int" + ~ty2:"(int :int_alias)" + ~content1:"0" + ~content2:"0" + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Tests that annotations are not taken into account when hashing keys. + Here the types [pair (or int string) int] and + [pair (or (int %id) (string %name)) int] should hash to the same key. + *) +let test_annotation_pair_or () = + assert_keys_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"pair (or int string) int" + ~ty2:{|pair (or (int %id) (string %name)) int|} + ~content1:{|Pair (Left 1) 2|} + ~content2:{|Pair (Left 1) 2|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type [option int] and [option nat] with the same + content, [None], don't map to the same hash. *) +let test_option_none () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"option int" + ~ty2:"option nat" + ~content1:{|None|} + ~content2:{|None|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +(** Test that a ticket of type [option int] and [option nat] with the same + content, [Some 0], don't map to the same hash. *) +let test_option_some () = + assert_keys_not_equal + ~loc:__LOC__ + ~ticketer1:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ticketer2:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~ty1:"option int" + ~ty2:"option nat" + ~content1:{|Some 0|} + ~content2:{|Some 0|} + ~amount1:1 + ~amount2:1 + ~owner1:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + ~owner2:"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + +let tests = + [ + Tztest.tztest "Test different ticketers" `Quick test_different_ticketers; + Tztest.tztest "Test different owners" `Quick test_different_owners; + Tztest.tztest "Test different content" `Quick test_different_content; + Tztest.tztest "Test different amounts" `Quick test_different_amounts; + Tztest.tztest "Test nat int" `Quick test_nat_int; + Tztest.tztest "Test nat mutez" `Quick test_nat_mutez; + Tztest.tztest "Test not bool" `Quick test_bool_nat; + Tztest.tztest "Test nat bytes" `Quick test_nat_bytes; + Tztest.tztest "Test string chain_id" `Quick test_string_chain_id; + Tztest.tztest "Test string key_hash" `Quick test_string_key_hash; + Tztest.tztest "Test string timestamp" `Quick test_string_timestamp; + Tztest.tztest "Test string address" `Quick test_string_address; + Tztest.tztest "Test string key" `Quick test_string_key; + Tztest.tztest "Test string signature" `Quick test_string_signature; + Tztest.tztest "Test annotations for pair" `Quick test_annotation_pair; + Tztest.tztest "Test annotations for or" `Quick test_annotation_or; + Tztest.tztest + "Test annotations for type alias" + `Quick + test_annotation_type_alias; + Tztest.tztest + "Test annotations for paired ors" + `Quick + test_annotation_pair_or; + Tztest.tztest "Test option none" `Quick test_option_none; + Tztest.tztest "Test option some" `Quick test_option_some; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml new file mode 100644 index 000000000000..754a4079cf2b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml @@ -0,0 +1,696 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_scanner) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket lazy storage diff" + Subject: Ticket scanner tests +*) + +open Protocol +open Alpha_context + +let ( let* ) m f = m >>=? f + +let wrap m = m >|= Environment.wrap_tzresult + +let assert_equal_string_list ~loc msg = + Assert.assert_equal_list ~loc String.equal msg Format.pp_print_string + +let string_list_of_ex_token_diffs ctxt token_diffs = + let accum (xs, ctxt) + (Ticket_token.Ex_token {ticketer; contents_type; contents}, amount) = + let* x, ctxt = + wrap + @@ Script_ir_unparser.unparse_comparable_data + ctxt + Script_ir_unparser.Readable + contents_type + contents + in + let str = + Format.asprintf + "((%a, %a), %a)" + Contract.pp + ticketer + Michelson_v1_printer.print_expr + x + Z.pp_print + amount + in + return (str :: xs, ctxt) + in + let* xs, ctxt = List.fold_left_es accum ([], ctxt) token_diffs in + return (List.rev xs, ctxt) + +let make_ex_token ctxt ~ticketer ~type_exp ~content_exp = + let* Script_ir_translator.Ex_comparable_ty contents_type, ctxt = + let node = Micheline.root @@ Expr.from_string type_exp in + wrap @@ Lwt.return @@ Script_ir_translator.parse_comparable_ty ctxt node + in + let* ticketer = wrap @@ Lwt.return @@ Contract.of_b58check ticketer in + let* contents, ctxt = + let node = Micheline.root @@ Expr.from_string content_exp in + wrap @@ Script_ir_translator.parse_comparable_data ctxt contents_type node + in + return (Ticket_token.Ex_token {ticketer; contents_type; contents}, ctxt) + +let assert_equal_balances ~loc ctxt given expected = + let* ctxt, tbs1 = + List.fold_left_map_es + (fun ctxt ((ticketer, content), delta) -> + make_ex_token + ctxt + ~ticketer + ~type_exp:"string" + ~content_exp:(Printf.sprintf "%S" content) + >|=? fun (token, ctxt) -> (ctxt, (token, Z.of_int delta))) + ctxt + expected + in + let* tbs1, ctxt = string_list_of_ex_token_diffs ctxt tbs1 in + let* tbs2, _ctxt = string_list_of_ex_token_diffs ctxt given in + assert_equal_string_list + ~loc + "Compare token balances" + (List.sort String.compare tbs1) + (List.sort String.compare tbs2) + +let wrap_result res = wrap (Lwt.return res) + +let updates_of_key_values ctxt key_values = + List.fold_right_es + (fun (key, value) (kvs, ctxt) -> + let* key_hash, ctxt = + wrap + (Script_ir_translator.hash_comparable_data + ctxt + Script_typed_ir.int_t + (Script_int.of_int key)) + in + return + ( { + Big_map.key = Expr.from_string @@ string_of_int key; + key_hash; + value = Option.map Expr.from_string value; + } + :: kvs, + ctxt )) + key_values + ([], ctxt) + +let make_alloc big_map_id alloc updates = + Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update {init = Lazy_storage.Alloc alloc; updates}) + +let init () = + let* block, source = Context.init1 () in + let* operation, originated = + Op.contract_origination_hash (B block) source ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* inc = Incremental.begin_construction block in + return (originated, Incremental.alpha_ctxt inc) + +let setup ctxt contract ~key_type ~value_type entries = + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + let key_type = Expr.from_string key_type in + let value_type = Expr.from_string value_type in + let* updates, ctxt = updates_of_key_values ctxt entries in + let alloc = make_alloc big_map_id Big_map.{key_type; value_type} updates in + return (alloc, big_map_id, contract, ctxt) + +let new_big_map ctxt contract ~key_type ~value_type entries = + let* alloc, big_map_id, contract, ctxt = + setup ctxt contract ~key_type ~value_type + @@ List.map (fun (k, v) -> (k, Some v)) entries + in + let storage = Expr.from_string "{}" in + let* ctxt = + wrap @@ Contract.update_script_storage ctxt contract storage (Some [alloc]) + in + return (big_map_id, ctxt) + +let alloc_diff ctxt contract ~key_type ~value_type entries = + let* allocations, _, _, ctxt = + setup + ctxt + contract + ~key_type + ~value_type + (List.map (fun (k, v) -> (k, Some v)) entries) + in + return (allocations, ctxt) + +let remove_diff ctxt contract ~key_type ~value_type ~existing_entries = + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + return (Lazy_storage.make Lazy_storage.Kind.Big_map big_map_id Remove, ctxt) + +let copy_diff ctxt contract ~key_type ~value_type ~existing_entries ~updates = + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + let* updates, ctxt = updates_of_key_values ctxt updates in + let* ctxt, new_big_map_id = wrap @@ Big_map.fresh ctxt ~temporary:false in + return + ( Lazy_storage.make + Lazy_storage.Kind.Big_map + new_big_map_id + (Update {init = Lazy_storage.Copy {src = big_map_id}; updates}), + ctxt ) + +let existing_diff ctxt contract ~key_type ~value_type ~existing_entries ~updates + = + let* big_map_id, ctxt = + new_big_map ctxt contract ~key_type ~value_type existing_entries + in + let* updates, ctxt = updates_of_key_values ctxt updates in + return + ( Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update {init = Lazy_storage.Existing; updates}), + ctxt ) + +(** Test that no ticket-tokens are extracted from a diff for allocating an empty + big-map. *) +let test_allocate_new_empty () = + let* contract, ctxt = init () in + let* diff, ctxt = + alloc_diff ctxt contract ~key_type:"int" ~value_type:"ticket string" [] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances ~loc:__LOC__ ctxt diff [] + +(** Test that no ticket-tokens are extracted from a lazy-diff of a big-map + that does not contain tickets. *) +let test_allocate_new_no_tickets () = + let* contract, ctxt = init () in + let* diff, ctxt = + alloc_diff + ctxt + contract + ~key_type:"int" + ~value_type:"string" + [(1, {|"A"|}); (2, {|"B"|}); (3, {|"C"|})] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances ~loc:__LOC__ ctxt diff [] + +(** Test that ticket-tokens can be extracted from a lazy-diff for allocating a + new big-map. *) +let test_allocate_new () = + let* contract, ctxt = init () in + let* diff, ctxt = + alloc_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 3); + ] + +(** Test that ticket-tokens with negative balances are extracted from a + lazy-diff that removes a big-map. *) +let test_remove_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + remove_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), -2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), -3); + ] + +(** Test that there are no ticket-token balance deltas extracted from a + lazy-diff that applies no updates. *) +let test_no_updates_to_existing_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + ~updates:[] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances ~loc:__LOC__ ctxt diff [] + +(** Test that ticket-tokens extracted reflect the balance diffs that are + extracted from a lazy-diff that modifies an existing big-map. + *) +let test_update_existing_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + ~updates: + [ + (* Replace entry at index 1 *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 4|}); + (* Remove entry at index 2 *) + (2, None); + (* Add new entry at index 4 *) + (4, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "pink" 5|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), -2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 4); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "pink"), 5); + ] + +(** Test that ticket-tokens extracted reflect the balance diffs that are + extracted from a lazy-diff that modifies an existing big-map and with + multiple updates to the same key. + *) +let test_update_same_key_multiple_times_existing_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Replace entry at index 1 *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 1|}); + (* Replace entry at index 1 *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), -1); + ] + +(** Test that ticket-tokens extracted reflect the balance diffs that are + extracted from a lazy-diff that modifies an existing big-map and with + multiple removals of the same item. + *) +let test_remove_same_key_multiple_times_existing_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Remove entry at index 1 *) + (1, None); + (* Remove entry at index 1 again *) + (1, None); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [(("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1)] + +(** Test that ticket-tokens extracted reflect the balance diffs that are + extracted from a lazy-diff that modifies an existing big-map and with + multiple additions and removals of the same item. + *) +let test_update_and_remove_same_key_multiple_times_existing_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Remove entry at index 1 *) + (1, None); + (* Add a yellow ticket at index 1. *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 1|}); + (* Remove entry at index 1 again *) + (1, None); + (* Add a green ticket at index 1. *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 1); + ] + +(** Test that the extracted ticket-tokens from a lazy diff for copying a big-map + reflects the tokens of the source as well as the updates. *) +let test_copy_big_map () = + let* contract, ctxt = init () in + let* diff, ctxt = + copy_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + ~updates:[] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 3); + ] + +(** Test that the extracted ticket-tokens from a lazy diff for copying a big-map + reflects the tokens of the source as well as the updates. *) +let test_copy_big_map_with_updates () = + let* contract, ctxt = init () in + let* diff, ctxt = + copy_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + ~updates: + [ + (* Remove element at index 1*) + (1, None); + (* Replace element at index 3 *) + (3, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 4|}); + (* Add a new element at index 4 *) + (4, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "pink" 5|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 3); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), -3); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 4); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "pink"), 5); + ] + +(** Test that the extracted ticket-tokens from a lazy diff for copying a big-map + with multiple updates to the same key reflects the tokens of the source as + well as the updates. *) +let test_copy_big_map_with_updates_to_same_key () = + let* contract, ctxt = init () in + let* diff, ctxt = + copy_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Remove element at index 1 *) + (1, None); + (* Add element at index 1 *) + (1, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "yellow" 2|}); + (* Remove again *) + (1, None); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff ctxt [diff]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (* From the copy of the big-map *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (* From removing the element from the copied big-map *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (* From adding to the copied big-map. *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), 2); + (* From removing from the copied big-map *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "yellow"), -2); + ] + +(** Test combinations of lazy-diffs. *) +let test_mix_lazy_diffs () = + let* contract, ctxt = init () in + let* diff_copy, ctxt = + copy_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Remove element at index 1 *) + (1, None); + (* Replace element at index 2 *) + (2, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2|}); + ] + in + let* diff_existing, ctxt = + existing_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~updates: + [ + (* Remove entry at index 2 *) + (2, None); + (* Add new entry at index 3 *) + (3, Some {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3|}); + ] + in + let* diff_remove, ctxt = + remove_diff + ctxt + contract + ~key_type:"int" + ~value_type:"ticket string" + ~existing_entries: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "white" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "black" 1|}); + ] + in + let* diff, ctxt = + wrap + (Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff + ctxt + [diff_copy; diff_existing; diff_remove]) + in + assert_equal_balances + ~loc:__LOC__ + ctxt + diff + [ + (* From the copy *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green"), 2); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red"), 1); + (* From updating an existing *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue"), 3); + (* From the remove *) + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "white"), -1); + (("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "black"), -1); + ] + +let tests = + [ + Tztest.tztest "Test allocate new empty" `Quick test_allocate_new_empty; + Tztest.tztest "Test allocate new" `Quick test_allocate_new; + Tztest.tztest + "Test allocate new no tickets" + `Quick + test_allocate_new_no_tickets; + Tztest.tztest "Remove" `Quick test_remove_big_map; + Tztest.tztest + "Test no updates to existing" + `Quick + test_no_updates_to_existing_big_map; + Tztest.tztest + "Test update existing big-map" + `Quick + test_update_existing_big_map; + Tztest.tztest + "Test update same key multiple times on existing big-map" + `Quick + test_update_same_key_multiple_times_existing_big_map; + Tztest.tztest + "Test remove same key multiple times on existing big-map" + `Quick + test_remove_same_key_multiple_times_existing_big_map; + Tztest.tztest + "Test update and remove same key multiple times on existing big-map" + `Quick + test_update_and_remove_same_key_multiple_times_existing_big_map; + Tztest.tztest "Test copy" `Quick test_copy_big_map; + Tztest.tztest "Test copy with updates" `Quick test_copy_big_map_with_updates; + Tztest.tztest + "Test copy with multiple updates to same key" + `Quick + test_copy_big_map_with_updates_to_same_key; + Tztest.tztest "Test mix lazy diffs" `Quick test_mix_lazy_diffs; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml new file mode 100644 index 000000000000..eca8fee374a4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml @@ -0,0 +1,806 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_balance_key) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket manager" + Subject: Tests that compare the ticket-balance table against tickets in the + contract storages. The tests include a lot of operations that + sends and store tickets. After each operation we check that the + ticket balance table reflects the actual tickets stored. + This relies on the invariant that any ticket-token referenced by + the table corresponds to a ticket in a storage. Currently, storage + is the only place to actually keep existing tickets. +*) + +open Protocol +open Alpha_context +open Lwt_result_syntax + +let wrap m = m >|= Environment.wrap_tzresult + +type init_env = { + block : Block.t; + baker : Tezos_crypto.Signature.public_key_hash; + contract : Contract.t; +} + +let init_env () = + let* block, baker, contract, _src2 = Contract_helpers.init () in + return {block; baker; contract} + +let collect_token_amounts ctxt tickets = + let accum (tokens, ctxt) ticket = + let token, amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ticket + in + let tokens = (token, Script_int.(to_zint (amount :> n num))) :: tokens in + return (tokens, ctxt) + in + List.fold_left_es accum ([], ctxt) tickets + +let tokens_of_value ~include_lazy ctxt ty x = + let*? has_tickets, ctxt = Ticket_scanner.type_has_tickets ctxt ty in + let* tickets, ctxt = + Ticket_scanner.tickets_of_value ~include_lazy ctxt has_tickets x + in + let* tas, ctxt = collect_token_amounts ctxt tickets in + let* bm, ctxt = + Ticket_token_map.of_list + ctxt + ~merge_overlap:(fun ctxt v1 v2 -> ok (Z.add v1 v2, ctxt)) + tas + in + Lwt.return @@ Ticket_token_map.to_list ctxt bm + +(* Extract ticket-token balance of storage *) +let ticket_balance_of_storage ctxt (contract : Alpha_context.Contract.t) = + match contract with + | Implicit _ -> return ([], ctxt) + | Originated contract_hash -> ( + let* ctxt, script = + wrap @@ Alpha_context.Contract.get_script ctxt contract_hash + in + match script with + | None -> return ([], ctxt) + | Some script -> + let* ( Script_ir_translator.Ex_script + (Script {storage; storage_type; _}), + ctxt ) = + wrap + (Script_ir_translator.parse_script + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage:true + script) + in + let* tokens, ctxt = + wrap (tokens_of_value ~include_lazy:true ctxt storage_type storage) + in + let* tokens, ctxt = + wrap + @@ List.fold_left_es + (fun (acc, ctxt) (ex_token, amount) -> + let* key, ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract contract) + ex_token + in + let acc = (key, amount) :: acc in + return (acc, ctxt)) + ([], ctxt) + tokens + in + return (tokens, ctxt)) + +let transaction block ~sender ~recipient ~amount ~parameters = + let parameters = Script.lazy_expr @@ Expr.from_string parameters in + let* block = Incremental.begin_construction block in + let* operation = + Op.transaction + (I block) + ~gas_limit:Max + ~entrypoint:Entrypoint.default + ~parameters + ~fee:Tez.zero + sender + recipient + (Tez.of_mutez_exn amount) + in + let* block = Incremental.add_operation block operation in + Incremental.finalize_block block + +let all_contracts current_block = + let* ctxt = + Incremental.begin_construction current_block >|=? Incremental.alpha_ctxt + in + Lwt.map Result.ok @@ Contract.list ctxt + +(* Fetch all added contracts between [before] and [after]. *) +let new_contracts ~before ~after = + let* cs1 = all_contracts before in + let* cs2 = all_contracts after in + let not_in_cs1 = + let module S = Set.Make (String) in + let set = S.of_list @@ List.map Contract.to_b58check cs1 in + fun c -> not @@ S.mem (Contract.to_b58check c) set + in + return @@ List.filter not_in_cs1 cs2 + +let get_first_two_new_contracts before f = + let* after = f before in + let* c = new_contracts ~before ~after in + match c with + | c1 :: c2 :: _ -> return (c1, c2, after) + | _ -> failwith "Expected two new contracts" + +let show_key_balance key balance = + let key = String.escaped @@ Format.asprintf "%a" Ticket_hash.pp key in + let balance = Z.to_string balance in + (key, balance) + +let compare_key_balance (k1, b1) (k2, b2) = + match String.compare k1 k2 with + | n when n <> 0 -> n + | _ -> String.compare b1 b2 + +let normalize_balances key_balances = + List.filter_map + (fun (key, balance) -> + if Z.equal balance Z.zero then None + else Some (show_key_balance key balance)) + key_balances + |> List.sort compare_key_balance + +let equal_key_balances kb1 kb2 = + let compare x y = compare_key_balance x y = 0 in + List.for_all2 + ~when_different_lengths:"Length of key-balances don't match" + compare + kb1 + kb2 + +let show_balance_table kvs = + let show_rows kvs = + let key_col_length = + List.fold_left (fun mx (s, _) -> max mx (String.length s)) 0 kvs + in + let column align col_length s = + let space = + Stdlib.List.init (col_length - String.length s) (fun _ -> " ") + |> String.concat "" + in + match align with + | `Left -> Printf.sprintf "%s%s" s space + | `Right -> Printf.sprintf "%s%s" space s + in + List.map + (fun (k, v) -> + Printf.sprintf + "| %s | %s |" + (column `Left key_col_length k) + (column `Right 8 v)) + kvs + |> String.concat "\n" + in + show_rows (("Token x Content x Owner", "Balance") :: kvs) + +let validate_ticket_balances block = + let* contracts = all_contracts block in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let* kvs_storage, ctxt = + List.fold_left_es + (fun (acc, ctxt) contract -> + let* lists, ctxt = ticket_balance_of_storage ctxt contract in + return (lists @ acc, ctxt)) + ([], ctxt) + contracts + in + let* kvs_balance, _ctxt = + wrap + @@ List.fold_left_es + (fun (acc, ctxt) (key, _) -> + let* balance, ctxt = Ticket_balance.get_balance ctxt key in + let acc = + match balance with None -> acc | Some b -> (key, b) :: acc + in + return (acc, ctxt)) + ([], ctxt) + kvs_storage + in + let kvs_storage = normalize_balances kvs_storage in + let kvs_balance = normalize_balances kvs_balance in + let print_both () = + print_endline "Storage table:" ; + print_endline @@ show_balance_table kvs_storage ; + print_endline "Balance table:" ; + print_endline @@ show_balance_table kvs_balance + in + match equal_key_balances kvs_balance kvs_storage with + | Ok true -> return () + | Ok false -> + print_both () ; + failwith "Storage and balance don't match" + | Error e -> + print_both () ; + failwith "%s" e + +module Ticket_manager = struct + (* A rather complicated script for various ticket operations. + See documentation for [action] below for a list of the params. + *) + let script = + {| + { parameter + (or (or (or (or %add (pair %add_lazy (pair int string) nat) (pair %add_strict string nat)) + (pair %create (pair string nat) key_hash)) + (or (or %remove (or (unit %remove_all_lazy) (int %remove_lazy)) (unit %remove_strict)) + (big_map %replace_big_map int (ticket string)))) + (or %send + (or (pair %send_lazy int address) (pair %send_new (pair string nat) address)) + (or (unit %send_self_replace_big_map) (address %send_strict)))) ; + storage (pair (list %list (ticket string)) (big_map %map int (ticket string))) ; + code { NIL (ticket string) ; + SWAP ; + UNPAIR ; + IF_LEFT + { DIG 2 ; + DROP ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { # `add_lazy` entrypoint + UNPAIR ; + UNPAIR ; + DIG 3 ; + DIG 3 ; + SWAP ; + UNPAIR ; + SWAP ; + DUP 3 ; + DUP 6 ; + TICKET ; + ASSERT_SOME ; + SOME ; + DUP 5 ; + GET_AND_UPDATE ; + DROP ; + DUP 3 ; + DUP 6 ; + TICKET ; + ASSERT_SOME ; + SOME ; + DUP 5 ; + GET_AND_UPDATE ; + DROP ; + DIG 2 ; + DIG 4 ; + TICKET ; + ASSERT_SOME ; + SOME ; + DIG 3 ; + GET_AND_UPDATE ; + DROP ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } + { + # `add_strict` entrypoint + UNPAIR ; + DIG 2 ; + UNPAIR ; + DIG 3 ; + DIG 3 ; + TICKET ; + ASSERT_SOME ; + CONS ; + PAIR ; + NIL operation ; + PAIR } } + { # `create` entrypoint + UNPAIR ; + UNPAIR ; + DUP 3 ; + DUG 2 ; + TICKET ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + SOME ; + CREATE_CONTRACT + { parameter (ticket string) ; + storage (ticket string) ; + code { JOIN_TICKETS ; + IF_NONE + { PUSH string "Failed to join tickets" ; FAILWITH } + { NIL operation ; PAIR } } } ; + SWAP ; + DROP ; + EMPTY_BIG_MAP int (ticket string) ; + PUSH nat 99 ; + PUSH string "NEW_TICKET_IN_ORIGINATED_CONTRACT" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 1 ; + GET_AND_UPDATE ; + DROP ; + PUSH mutez 0 ; + DIG 3 ; + SOME ; + CREATE_CONTRACT + { parameter (ticket string) ; + storage (big_map int (ticket string)) ; + code { UNPAIR ; + SOME ; + PUSH int 1 ; + GET_AND_UPDATE ; + DROP ; + NIL operation ; + PAIR } } ; + SWAP ; + DROP ; + DIG 2 ; + NIL operation ; + DIG 2 ; + CONS ; + DIG 2 ; + CONS ; + PAIR } } + { IF_LEFT + { IF_LEFT + { IF_LEFT + { # `remove_all_lazy` entrypoint + DROP ; + CAR ; + EMPTY_BIG_MAP int (ticket string) ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } + { # `remove` entrypoint + SWAP ; + UNPAIR ; + SWAP ; + NONE (ticket string) ; + DIG 3 ; + GET_AND_UPDATE ; + DROP ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } } + { # `remove_strict` entrypoint + DROP ; CDR ; NIL (ticket string) ; PAIR ; NIL operation ; PAIR } } + { # `replace_big_map` entrypoint + SWAP ; + CAR ; + SWAP ; + NONE (ticket string) ; + PUSH int 1 ; + GET_AND_UPDATE ; + DROP ; + PUSH nat 1 ; + PUSH string "ADDED_BY_REPLACE_BIG_MAP" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 11 ; + GET_AND_UPDATE ; + DROP ; + NONE (ticket string) ; + PUSH int 11 ; + GET_AND_UPDATE ; + DROP ; + PUSH nat 1 ; + PUSH string "ADDED_BY_REPLACE_BIG_MAP" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 11 ; + GET_AND_UPDATE ; + DROP ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } } } + { IF_LEFT + { DIG 2 ; + DROP ; + IF_LEFT + { # `send_lazy` entrypoint + UNPAIR ; + DIG 2 ; + UNPAIR ; + DIG 3 ; + CONTRACT (ticket string) ; + IF_NONE + { DIG 2 ; + DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { DIG 2 ; + NONE (ticket string) ; + DIG 4 ; + GET_AND_UPDATE ; + IF_NONE + { SWAP ; DROP ; PUSH string "Could not find ticket" ; FAILWITH } + { DIG 2 ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + SWAP ; + DIG 2 ; + PAIR ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + { # `send_new` entrypoint + UNPAIR ; + UNPAIR ; + DIG 3 ; + DIG 3 ; + SWAP ; + UNPAIR ; + DIG 2 ; + CONTRACT (ticket string) ; + IF_NONE + { DIG 2 ; + DROP ; + DIG 2 ; + DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { PUSH mutez 0 ; + DIG 5 ; + DIG 5 ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + DUG 2 ; + PAIR ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + { IF_LEFT + { # `send_self_replace_big_map` entrypoint + DROP ; + SWAP ; + DROP ; + UNPAIR ; + SELF_ADDRESS ; + CONTRACT + (or (or (or (or %add (pair %add_lazy (pair int string) nat) (pair %add_strict string nat)) + (pair %create (pair string nat) key_hash)) + (or (or %remove (or (unit %remove_all_lazy) (int %remove_lazy)) (unit %remove_strict)) + (big_map %replace_big_map int (ticket string)))) + (or %send + (or (pair %send_lazy int address) (pair %send_new (pair string nat) address)) + (or (unit %send_self_replace_big_map) (address %send_strict)))) ; + IF_NONE + { PUSH string "Failed to get self-contract" ; FAILWITH } + { EMPTY_BIG_MAP int (ticket string) ; + DIG 3 ; + PUSH nat 1 ; + PUSH string "ADDED_BY_SEND_SELF_REPLACE" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 10 ; + GET_AND_UPDATE ; + DROP ; + NONE (ticket string) ; + PUSH int 2 ; + GET_AND_UPDATE ; + DROP ; + DIG 2 ; + PUSH mutez 0 ; + DIG 2 ; + RIGHT (or (or unit int) unit) ; + RIGHT + (or (or (pair (pair int string) nat) (pair string nat)) (pair (pair string nat) key_hash)) ; + LEFT (or (or (pair int address) (pair (pair string nat) address)) (or unit address)) ; + TRANSFER_TOKENS ; + SWAP ; + PUSH nat 1 ; + PUSH string "ADDED_BY_SEND_SELF_REPLACE_TO_STORAGE" ; + TICKET ; + ASSERT_SOME ; + SOME ; + PUSH int 11 ; + GET_AND_UPDATE ; + DROP ; + DIG 2 ; + PAIR ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } + { # `send_strict` entrypoint + SWAP ; + UNPAIR ; + DIG 2 ; + CONTRACT (ticket string) ; + IF_NONE + { DROP ; + PUSH string "Contract of type `ticket(string)` not found" ; + FAILWITH } + { NONE (ticket string) ; + DIG 2 ; + ITER { SWAP ; IF_NONE { SOME } { PAIR ; JOIN_TICKETS } } ; + IF_NONE + { DROP ; PUSH string "Couldn't produce a ticket" ; FAILWITH } + { SWAP ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + SWAP ; + DIG 2 ; + PAIR ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } } } } } + |} + + type remove_args = Remove_lazy of int | Remove_strict | Remove_all_lazy + + type send_args = + | Send_lazy of {index : int; recipient : Contract.t} + | Send_strict of Contract.t + | Send_new of {content : string; amount : int; recipient : Contract.t} + | Send_self_replace_big_map + + type add_args = + | Add_lazy of {index : int; content : string; amount : int} + | Add_strict of {content : string; amount : int} + + type action = + | Remove of remove_args + | Add of add_args + | Create of {content : string; amount : int; originator : Contract.t} + | Send of send_args + + let remove_lazy ~index = Remove (Remove_lazy index) + + let remove_strict = Remove Remove_strict + + let add_lazy ~index ~content ~amount = Add (Add_lazy {index; content; amount}) + + let add_strict ~content ~amount = Add (Add_strict {content; amount}) + + let create ~content ~amount ~originator = Create {content; amount; originator} + + let send_lazy ~index ~recipient = Send (Send_lazy {index; recipient}) + + let send_strict ~recipient = Send (Send_strict recipient) + + let send_new ~content ~amount ~recipient = + Send (Send_new {content; amount; recipient}) + + let remove_all_lazy = Remove Remove_all_lazy + + let send_self_replace_big_map = Send Send_self_replace_big_map + + let string_args = function + | Remove (Remove_lazy ix) -> + Printf.sprintf "Left (Right (Left (Left (Right %d))))" ix + | Remove Remove_strict -> "Left (Right (Left (Right Unit)))" + | Remove Remove_all_lazy -> "Left (Right (Left (Left (Left Unit))))" + | Add (Add_lazy {index; content; amount}) -> + Printf.sprintf + {|Left (Left (Left (Left (Pair (Pair %d "%s") %d))))|} + index + content + amount + | Add (Add_strict {content; amount}) -> + Printf.sprintf + {|Left (Left (Left (Right (Pair "%s" %d))))|} + content + amount + | Create {content; amount; originator} -> + Printf.sprintf + {|Left (Left (Right (Pair (Pair "%s" %d) "%s")))|} + content + amount + (Contract.to_b58check originator) + | Send (Send_lazy {index; recipient}) -> + Printf.sprintf + {|Right (Left (Left (Pair %d "%s")))|} + index + (Contract.to_b58check recipient) + | Send (Send_strict contract) -> + Printf.sprintf + {|Right (Right (Right "%s"))|} + (Contract.to_b58check contract) + | Send (Send_new {content; amount; recipient}) -> + Printf.sprintf + {|(Right (Left (Right (Pair (Pair "%s" %d) "%s"))))|} + content + amount + (Contract.to_b58check recipient) + | Send Send_self_replace_big_map -> "Right (Right (Left Unit))" + + let originate block ~originator baker = + Contract_helpers.originate_contract_from_string + ~script + ~storage:"Pair {} {}" + ~source_contract:originator + ~baker + block + + let transaction block ~sender ~ticket_manager ~parameters = + let parameters = string_args parameters in + transaction block ~sender ~recipient:ticket_manager ~amount:0L ~parameters +end + +(* Sets up the environment and returns a function for running a transaction + and validating the balance table against tickets in the storage once + completed. *) +let setup_test () = + let module TM = Ticket_manager in + let* {block; baker; contract = originator} = init_env () in + let* ticket_manager, _script, block = TM.originate block ~originator baker in + let test block parameters = + let* b = + TM.transaction block ~sender:originator ~ticket_manager ~parameters + in + let* () = validate_ticket_balances b in + return b + in + return (test, originator, block) + +(** Test create new contracts and send tickets to them. *) +let test_create_contract_and_send_tickets () = + let module TM = Ticket_manager in + let* test, originator, b = setup_test () in + + (* Call the `create` endpoint that creates two new ticket receiver contracts: + - Both contracts accepts a single ticket as an argument. + - The first holds a big-map with tickets in its storage. + - The second holds a ticket in its storage and only accepts "green" tickets. + - The second contract joins all received tickets. + *) + let* ticket_receiver_green_1, ticket_receiver_green_2, b = + get_first_two_new_contracts b @@ fun b -> + test b @@ TM.create ~content:"Green" ~amount:1 ~originator + in + (* + * Invoke the second ticket receiver contract: + - Remove all strict tickets + - Replace them with a list of 2 green ones + - Send all (joined) strict tickets to the ticket receiver + *) + let* b = test b @@ TM.remove_strict in + let* b = test b @@ TM.add_strict ~content:"Green" ~amount:1 in + let* b = test b @@ TM.add_strict ~content:"Green" ~amount:1 in + let* b = test b @@ TM.send_strict ~recipient:ticket_receiver_green_1 in + (* Send a new ticket *) + let* b = + test + b + (TM.send_new + ~content:"Green" + ~amount:10 + ~recipient:ticket_receiver_green_1) + in + (* Add a green ticket to the lazy storage at index 1 and send it to the green + ticket-receiver *) + let* b = test b @@ TM.add_lazy ~index:1 ~content:"Green" ~amount:10 in + let* (_b : Block.t) = + test b @@ TM.send_lazy ~index:1 ~recipient:ticket_receiver_green_2 + in + return () + +(** Tets add and remove tickets from lazy storage. *) +let test_add_remove_from_lazy_storage () = + let module TM = Ticket_manager in + let* tm, _, b = setup_test () in + let* b = tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:10 in + let* b = tm b @@ TM.add_lazy ~index:2 ~content:"Green" ~amount:10 in + let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:10 in + (* Remove ticket at index 1. *) + let* b = tm b @@ TM.remove_lazy ~index:1 in + let* b = tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:1 in + let* b = tm b @@ TM.add_lazy ~index:2 ~content:"Green" ~amount:2 in + let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:3 in + (* Remove the big-map. *) + let* b = tm b TM.remove_all_lazy in + (* Add back a ticket at index 1. *) + let* (_b : Block.t) = + tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:10 + in + return () + +(** Test send to self and replace big-map. *) +let test_send_self_replace_big_map () = + let module TM = Ticket_manager in + let* tm, _, b = setup_test () in + (* Send self replace bigmap *) + let* b = tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:1 in + let* b = tm b @@ TM.add_lazy ~index:2 ~content:"Green" ~amount:1 in + let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:1 in + let* b = tm b @@ TM.send_self_replace_big_map in + let* b = tm b @@ TM.send_self_replace_big_map in + let* (_b : Block.t) = tm b @@ TM.send_self_replace_big_map in + return () + +(** Test add to and remove from strict storage. *) +let test_add_remove_strict () = + let module TM = Ticket_manager in + let* tm, _, b = setup_test () in + (* Add some more strict tickets *) + let* b = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in + let* b = tm b @@ TM.add_strict ~content:"Red" ~amount:2 in + let* b = tm b @@ TM.add_strict ~content:"Red" ~amount:20 in + let* b = tm b @@ TM.add_strict ~content:"Green" ~amount:1 in + let* b = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in + + (* Remove strict tickets *) + let* b = tm b @@ TM.remove_strict in + let* (_b : Block.t) = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in + return () + +(** Test mixed operations. *) +let test_mixed_operations () = + let module TM = Ticket_manager in + let* tm, _, b = setup_test () in + (* Add some more strict tickets *) + let* b = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in + let* b = tm b @@ TM.add_strict ~content:"Green" ~amount:1 in + (* Add some lazy tickets *) + let* b = tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:1 in + let* b = tm b @@ TM.add_lazy ~index:2 ~content:"Green" ~amount:1 in + let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:1 in + (* Remove strict and lazy *) + let* b = tm b @@ TM.remove_strict in + let* (_b : Block.t) = tm b @@ TM.remove_all_lazy in + return () + +let tests = + [ + Tztest.tztest "Create contract" `Quick test_create_contract_and_send_tickets; + Tztest.tztest + "Send self replace big-map" + `Quick + test_send_self_replace_big_map; + Tztest.tztest + "Add and remove from strict storage" + `Quick + test_add_remove_strict; + Tztest.tztest + "Add and remove from lazy storage" + `Quick + test_add_remove_from_lazy_storage; + Tztest.tztest "Mix of operations" `Quick test_mixed_operations; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml new file mode 100644 index 000000000000..1612fb26a89d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml @@ -0,0 +1,1372 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_scanner) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket operations diff" + Subject: Ticket scanner tests +*) + +open Protocol +open Alpha_context +open Script_typed_ir + +(** A local non-private type that mirrors + [Ticket_operations_diff.ticket_token_diff]. *) +type ticket_token_diff = { + ticket_token : Ticket_token.ex_token; + total_amount : Script_int.n Script_int.num; + destinations : (Destination.t * ticket_amount) list; +} + +let to_local_ticket_token_diff + {Ticket_operations_diff.ticket_token; total_amount; destinations} = + {ticket_token; total_amount; destinations} + +let ( let* ) m f = m >>=? f + +let wrap m = m >|= Environment.wrap_tzresult + +let assert_fails ~loc ?error m = + let open Lwt_result_syntax in + let*! res = m in + let rec aux err_res = + match (err_res, error) with + | Environment.Ecoproto_error err' :: rest, Some err -> + (* Matched exact error. *) + if err' = err then return_unit else aux rest + | _ :: rest, Some _ -> aux rest + | [], Some _ -> + (* Expected a different error. *) + let msg = + Printf.sprintf "Expected a different error at location %s" loc + in + Stdlib.failwith msg + | _, None -> + (* Any error is ok. *) + return () + in + match res with + | Ok _ -> Stdlib.failwith "Expected failure" + | Error err_res -> aux err_res + +let big_map_updates_of_key_values ctxt key_values = + List.fold_right_es + (fun (key, value) (kvs, ctxt) -> + let* key_hash, ctxt = + wrap + (Script_ir_translator.hash_comparable_data + ctxt + Script_typed_ir.int_t + (Script_int.of_int key)) + in + return + ( { + Big_map.key = Expr.from_string @@ string_of_int key; + key_hash; + value = Option.map Expr.from_string value; + } + :: kvs, + ctxt )) + key_values + ([], ctxt) + +let new_int_key_big_map ctxt contract ~value_type entries = + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + let key_type = Expr.from_string "int" in + let value_type = Expr.from_string value_type in + let* updates, ctxt = + big_map_updates_of_key_values ctxt + @@ List.map (fun (k, v) -> (k, Some v)) entries + in + let alloc = + Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update + {init = Lazy_storage.Alloc Big_map.{key_type; value_type}; updates}) + in + let storage = Expr.from_string "{}" in + let* ctxt = + wrap @@ Contract.update_script_storage ctxt contract storage (Some [alloc]) + in + return (big_map_id, ctxt) + +let assert_equal_string_list ~loc msg = + Assert.assert_equal_list ~loc String.equal msg Format.pp_print_string + +let string_of_ticket_token ctxt + (Ticket_token.Ex_token {ticketer; contents_type; contents}) = + let* x, _ = + wrap + @@ Script_ir_unparser.unparse_comparable_data + ctxt + Script_ir_unparser.Readable + contents_type + contents + in + return + @@ Format.asprintf + {|("%a", %a)|} + Contract.pp + ticketer + Michelson_v1_printer.print_expr + x + +let string_of_destination_and_amounts cas = + Format.asprintf + "[%a]" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "; ") + (fun fmt (contract, (amount : ticket_amount)) -> + Format.fprintf + fmt + {|("%a", %s)|} + Destination.pp + contract + Script_int.(to_string (amount :> n num)))) + cas + +let string_of_ticket_operations_diff ctxt + {ticket_token; total_amount; destinations} = + let* ticket_token = string_of_ticket_token ctxt ticket_token in + let destinations = string_of_destination_and_amounts destinations in + return + (Printf.sprintf + "(%s, %s, %s)" + ticket_token + (Script_int.to_string total_amount) + destinations) + +let assert_equal_ticket_token_diffs ctxt ~loc ticket_diffs + ~(expected : ticket_token_diff list) = + (* Sort destinations by contract and the strings alphabetically so that order + does not matter for comparison. *) + let sorted_strings ticket_diffs = + List.map + (fun {ticket_token; total_amount; destinations} -> + { + ticket_token; + total_amount; + destinations = + List.sort + (fun (c1, _) (c2, _) -> Destination.compare c1 c2) + destinations; + }) + ticket_diffs + |> List.map_es (string_of_ticket_operations_diff ctxt) + >|=? List.sort String.compare + in + let* exp_str_diffs = sorted_strings expected in + let* str_diffs = + sorted_strings @@ List.map to_local_ticket_token_diff ticket_diffs + in + assert_equal_string_list + ~loc + "Equal ticket-token-diffs" + exp_str_diffs + str_diffs + +let string_token ~ticketer content = + let contents = + Result.value_f ~default:(fun _ -> assert false) + @@ Script_string.of_string content + in + Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.string_t; contents} + +(** Initializes one address for operations and one baker. *) +let init ?tx_rollup_enable () = + Context.init2 ?tx_rollup_enable ~consensus_threshold:0 () + >|=? fun (block, (src0, src1)) -> + let baker = Context.Contract.pkh src0 in + (baker, src1, block) + +let originate block ~script ~storage ~src ~baker ~forges_tickets = + let code = Expr.toplevel_from_string script in + let storage = Expr.from_string storage in + let* operation, destination = + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + Op.contract_origination_hash (B block) src ~fee:(Test_tez.of_int 10) ~script + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let* incr = + Incremental.add_operation + ?expect_apply_failure: + (if forges_tickets then Some (fun _ -> return ()) else None) + incr + operation + in + let script = (code, storage) in + Incremental.finalize_block incr >|=? fun block -> (destination, script, block) + +let two_ticketers block = + let* ctxt = + Incremental.begin_construction block >|=? Incremental.alpha_ctxt + in + let* cs = Lwt.map Result.ok @@ Contract.list ctxt in + match cs with c1 :: c2 :: _ -> return (c1, c2) | _ -> assert false + +let one_ticketer block = two_ticketers block >|=? fst + +let nat n = Script_int.(abs @@ of_int n) + +let origination_operation block ~src ~baker ~script ~storage ~forges_tickets = + let* orig_contract, (code, storage), block = + originate block ~script ~storage ~src ~baker ~forges_tickets + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let ctxt = Incremental.alpha_ctxt incr in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + let unparsed_storage = storage in + let* ( Script_ir_translator.Ex_script + (Script + { + storage_type; + storage; + code = _; + arg_type = _; + views = _; + entrypoints = _; + code_size = _; + }), + ctxt ) = + wrap + @@ Script_ir_translator.parse_script + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~allow_forged_in_storage:true + script + in + let operation = + Script_typed_ir.Internal_operation + { + source = src; + operation = + Origination + { + delegate = None; + code; + unparsed_storage; + credit = Tez.one; + preorigination = orig_contract; + storage_type; + storage; + }; + nonce = 1; + } + in + let incr = Incremental.set_alpha_ctxt incr ctxt in + return (Contract.Originated orig_contract, operation, incr) + +let delegation_operation ~src = + Script_typed_ir.Internal_operation + {source = src; operation = Delegation None; nonce = 1} + +let originate block ~src ~baker ~script ~storage ~forges_tickets = + let* orig_contract, _script, block = + originate block ~script ~storage ~src ~baker ~forges_tickets + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + return (orig_contract, incr) + +let transfer_operation ~incr ~src ~destination ~parameters_ty ~parameters = + let open Lwt_result_syntax in + let ctxt = Incremental.alpha_ctxt incr in + let* params_node, ctxt = + wrap + (Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Readable + parameters_ty + parameters) + in + let incr = Incremental.set_alpha_ctxt incr ctxt in + return + ( Script_typed_ir.Internal_operation + { + source = src; + operation = + Transaction_to_smart_contract + { + amount = Tez.zero; + unparsed_parameters = params_node; + entrypoint = Entrypoint.default; + destination; + location = Micheline.dummy_location; + parameters_ty; + parameters; + }; + nonce = 1; + }, + incr ) + +let transfer_operation_to_tx_rollup ~incr ~src ~parameters_ty ~parameters + ~tx_rollup = + let open Lwt_result_syntax in + let ctxt = Incremental.alpha_ctxt incr in + let* params_node, ctxt = + wrap + (Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized_legacy + parameters_ty + parameters) + in + let incr = Incremental.set_alpha_ctxt incr ctxt in + return + ( Script_typed_ir.Internal_operation + { + source = src; + operation = + Transaction_to_tx_rollup + { + unparsed_parameters = params_node; + destination = tx_rollup; + parameters_ty; + parameters; + }; + nonce = 1; + }, + incr ) + +let ticket_diffs_of_operations incr operations = + wrap + @@ Ticket_operations_diff.ticket_diffs_of_operations + (Incremental.alpha_ctxt incr) + operations + +let unit_script = + {| + { parameter unit; + storage unit; + code { CAR; NIL operation ; PAIR } } + |} + +let ticket_list_script = + {| + { parameter (list (ticket string)); + storage (list (ticket string)); + code { CAR; NIL operation ; PAIR } } + |} + +let ticket_big_map_script = + {| + { parameter (big_map int (ticket string)); + storage (big_map int (ticket string)); + code { CAR; NIL operation ; PAIR } } + |} + +let list_ticket_string_ty = + ticket_t Micheline.dummy_location string_t >>? fun ticket_ty -> + list_t Micheline.dummy_location ticket_ty + +let make_ticket (ticketer, contents, amount) = + Script_string.of_string contents >>?= fun contents -> + let amount = nat amount in + Option.value_e + ~error: + (Environment.Error_monad.trace_of_error + Script_tc_errors.Forbidden_zero_ticket_quantity) + @@ Ticket_amount.of_n amount + >>?= fun amount -> return {ticketer; contents; amount} + +let make_tickets ts = + let* elements = List.map_es make_ticket ts in + return @@ Script_list.of_list elements + +let transfer_tickets_operation ~incr ~src ~destination tickets = + let open Lwt_result_syntax in + let*? parameters_ty = Environment.wrap_tzresult list_ticket_string_ty in + let* parameters = wrap @@ make_tickets tickets in + transfer_operation ~incr ~src ~destination ~parameters_ty ~parameters + +(** Test that no tickets are returned for operations that do not contain + tickets. *) +let test_non_ticket_operations () = + let* _baker, src, block = init () in + let* incr = Incremental.begin_construction block in + let operations = [delegation_operation ~src] in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr operations in + assert_equal_ticket_token_diffs ctxt ~loc:__LOC__ ticket_diffs ~expected:[] + +(** Test transfer to a contract that does not take tickets. *) +let test_transfer_to_non_ticket_contract () = + let* baker, src, block = init () in + let* orig_contract, incr = + originate + block + ~src + ~baker + ~script:unit_script + ~storage:"Unit" + ~forges_tickets:false + in + let* operation, incr = + transfer_operation + ~incr + ~src + ~destination:orig_contract + ~parameters_ty:unit_t + ~parameters:() + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs ctxt ~loc:__LOC__ ticket_diffs ~expected:[] + +(** Test transfer an empty list of tickets. *) +let test_transfer_empty_ticket_list () = + let* baker, src, block = init () in + let* orig_contract, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation, incr = + transfer_tickets_operation ~incr ~src ~destination:orig_contract [] + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs ctxt ~loc:__LOC__ ticket_diffs ~expected:[] + +let one = Ticket_amount.one + +let two = Ticket_amount.add one one + +let three = Ticket_amount.add two one + +let five = Ticket_amount.add three two + +(** Test transfer a list of one ticket. *) +let test_transfer_one_ticket () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let* orig_contract, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation, incr = + transfer_tickets_operation + ~incr + ~src + ~destination:orig_contract + [(ticketer, "white", 1)] + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "white"; + total_amount = nat 1; + destinations = + [(Destination.Contract (Originated orig_contract), one)]; + }; + ] + +(** Test transferring a list of multiple tickets. This should work when + zero-tickets are disabled as well as when the parameters do not contain any + zero-amount tickets. *) +let test_transfer_multiple_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let* orig_contract, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation, incr = + transfer_tickets_operation + ~incr + ~src + ~destination:orig_contract + [ + (ticketer, "red", 1); + (ticketer, "blue", 2); + (ticketer, "green", 3); + (ticketer, "red", 4); + ] + in + let orig_contract = Contract.Originated orig_contract in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 5; + destinations = [(Destination.Contract orig_contract, five)]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 2; + destinations = [(Destination.Contract orig_contract, two)]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 3; + destinations = [(Destination.Contract orig_contract, three)]; + }; + ] + +(** Test transfer a list of tickets of different types. *) +let test_transfer_different_tickets () = + let* baker, src, block = init () in + let* ticketer1, ticketer2 = two_ticketers block in + let* destination, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation, incr = + transfer_tickets_operation + ~incr + ~src + ~destination + [ + (ticketer1, "red", 1); + (ticketer1, "green", 1); + (ticketer1, "blue", 1); + (ticketer2, "red", 1); + (ticketer2, "green", 1); + (ticketer2, "blue", 1); + (ticketer1, "red", 1); + (ticketer1, "green", 1); + (ticketer1, "blue", 1); + ] + in + let destination = Destination.Contract (Originated destination) in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer:ticketer1 "red"; + total_amount = nat 2; + destinations = [(destination, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer1 "green"; + total_amount = nat 2; + destinations = [(destination, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer1 "blue"; + total_amount = nat 2; + destinations = [(destination, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "red"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "green"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "blue"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + ] + +(** Test transfer to two contracts with different types of tickets. *) +let test_transfer_to_two_contracts_with_different_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let parameters = + [(ticketer, "red", 1); (ticketer, "green", 1); (ticketer, "blue", 1)] + in + let* destination1, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation1, incr = + transfer_tickets_operation ~incr ~src ~destination:destination1 parameters + in + let* block = Incremental.finalize_block incr in + let* destination2, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation2, incr = + transfer_tickets_operation ~incr ~src ~destination:destination2 parameters + in + let* ticket_diffs, ctxt = + ticket_diffs_of_operations incr [operation1; operation2] + in + let one = Ticket_amount.one in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract (Originated destination1), one); + ]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract (Originated destination1), one); + ]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract (Originated destination1), one); + ]; + }; + ] + +(** Test originate a contract that does not contain tickets. *) +let test_originate_non_ticket_contract () = + let* baker, src, block = init () in + let* _orig_contract, operation, incr = + origination_operation + block + ~src + ~baker + ~script:unit_script + ~storage:"Unit" + ~forges_tickets:false + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs ctxt ~loc:__LOC__ ticket_diffs ~expected:[] + +(** Test originate a contract with an empty list of tickets. *) +let test_originate_with_empty_tickets_list () = + let* baker, src, block = init () in + let storage = "{}" in + let* _orig_contract, operation, incr = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:false + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs ctxt ~loc:__LOC__ ticket_diffs ~expected:[] + +(** Test originate a contract with a single ticket. *) +let test_originate_with_one_ticket () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let storage = + Printf.sprintf {|{Pair %S "white" 1}|} (Contract.to_b58check ticketer) + in + let* orig_contract, operation, ctxt = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations ctxt [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "white"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + ] + +(** Test originate a contract with multiple tickets. *) +let test_originate_with_multiple_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let storage = + let ticketer_addr = Contract.to_b58check ticketer in + Printf.sprintf + {|{ + Pair %S "red" 1; + Pair %S "blue" 2 ; + Pair %S "green" 3; + Pair %S "red" 4;} + |} + ticketer_addr + ticketer_addr + ticketer_addr + ticketer_addr + in + let* orig_contract, operation, ctxt = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations ctxt [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 5; + destinations = [(Destination.Contract orig_contract, five)]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 2; + destinations = [(Destination.Contract orig_contract, two)]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 3; + destinations = [(Destination.Contract orig_contract, three)]; + }; + ] + +(** Test originate a contract with multiple tickets of different types. *) +let test_originate_with_different_tickets () = + let* baker, src, block = init () in + let* ticketer1, ticketer2 = two_ticketers block in + let storage = + let ticketer1_addr = Contract.to_b58check ticketer1 in + let ticketer2_addr = Contract.to_b58check ticketer2 in + Printf.sprintf + {|{ + Pair %S "red" 1; + Pair %S "green" 1; + Pair %S "blue" 1; + Pair %S "red" 1; + Pair %S "green" 1; + Pair %S "blue" 1 ; + Pair %S "red" 1; + Pair %S "green" 1; + Pair %S "blue" 1; } + |} + ticketer1_addr + ticketer1_addr + ticketer1_addr + ticketer2_addr + ticketer2_addr + ticketer2_addr + ticketer1_addr + ticketer1_addr + ticketer1_addr + in + let* orig_contract, operation, ctxt = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations ctxt [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer:ticketer1 "red"; + total_amount = nat 2; + destinations = [(Destination.Contract orig_contract, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer1 "green"; + total_amount = nat 2; + destinations = [(Destination.Contract orig_contract, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer1 "blue"; + total_amount = nat 2; + destinations = [(Destination.Contract orig_contract, two)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "red"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "green"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer2 "blue"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + ] + +(** Test originate two contracts with multiple tickets of different types. *) +let test_originate_two_contracts_with_different_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let storage = + let ticketer_addr = Contract.to_b58check ticketer in + Printf.sprintf + {|{Pair %S "red" 1; Pair %S "green" 1; Pair %S "blue" 1; }|} + ticketer_addr + ticketer_addr + ticketer_addr + in + let* orig_contract1, operation1, incr = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* block = Incremental.finalize_block incr in + let* orig_contract2, operations2, incr = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* ticket_diffs, ctxt = + ticket_diffs_of_operations incr [operation1; operations2] + in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract orig_contract2, one); + (Destination.Contract orig_contract1, one); + ]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract orig_contract2, one); + (Destination.Contract orig_contract1, one); + ]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract orig_contract2, one); + (Destination.Contract orig_contract1, one); + ]; + }; + ] + +(** Test originate and transfer tickets. *) +let test_originate_and_transfer () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let ticketer_addr = Contract.to_b58check ticketer in + let storage = + Printf.sprintf + {|{Pair %S "red" 1; Pair %S "green" 1; Pair %S "blue" 1; }|} + ticketer_addr + ticketer_addr + ticketer_addr + in + let* orig_contract1, operation1, incr = + origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + in + let* block = Incremental.finalize_block incr in + let* destination2, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + let* operation2, incr = + transfer_tickets_operation + ~incr + ~src + ~destination:destination2 + [(ticketer, "red", 1); (ticketer, "green", 1); (ticketer, "blue", 1)] + in + let* ticket_diffs, ctxt = + ticket_diffs_of_operations incr [operation1; operation2] + in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract orig_contract1, one); + ]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract orig_contract1, one); + ]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 2; + destinations = + [ + (Destination.Contract (Originated destination2), one); + (Destination.Contract orig_contract1, one); + ]; + }; + ] + +(** Test originate a contract with a big-map with tickets inside. *) +let test_originate_big_map_with_tickets () = + let* baker, ticketer, block = init () in + let* operation, originated = + Op.contract_origination_hash (B block) ticketer ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* incr = Incremental.begin_construction block in + let ticketer_addr = Contract.to_b58check ticketer in + let* big_map_id, ctxt = + new_int_key_big_map + (Incremental.alpha_ctxt incr) + originated + ~value_type:"ticket string" + [ + (1, Printf.sprintf {|Pair %S "red" 1|} ticketer_addr); + (2, Printf.sprintf {|Pair %S "green" 1|} ticketer_addr); + (3, Printf.sprintf {|Pair %S "blue" 1|} ticketer_addr); + ] + in + let incr = Incremental.set_alpha_ctxt incr ctxt in + let* block = Incremental.finalize_block incr in + let* orig_contract, operation, incr = + let storage = + Printf.sprintf "%d" @@ Z.to_int (Big_map.Id.unparse_to_z big_map_id) + in + origination_operation + block + ~src:ticketer + ~baker + ~script:ticket_big_map_script + ~storage + ~forges_tickets:true + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "red"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + { + ticket_token = string_token ~ticketer "green"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + { + ticket_token = string_token ~ticketer "blue"; + total_amount = nat 1; + destinations = [(Destination.Contract orig_contract, one)]; + }; + ] + +(** Test transfer a big-map with tickets. *) +let test_transfer_big_map_with_tickets () = + let* baker, ticketer_contract, block = init () in + let* operation, originated = + Op.contract_origination_hash + (B block) + ticketer_contract + ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* incr = Incremental.begin_construction block in + let ticketer_addr = Contract.to_b58check ticketer_contract in + let* big_map_id, ctxt = + new_int_key_big_map + (Incremental.alpha_ctxt incr) + originated + ~value_type:"ticket string" + [ + (1, Printf.sprintf {|Pair %S "red" 1|} ticketer_addr); + (2, Printf.sprintf {|Pair %S "green" 1|} ticketer_addr); + (3, Printf.sprintf {|Pair %S "blue" 1|} ticketer_addr); + ] + in + let incr = Incremental.set_alpha_ctxt incr ctxt in + let* block = Incremental.finalize_block incr in + let* orig_contract, incr = + originate + block + ~src:ticketer_contract + ~baker + ~script:ticket_big_map_script + ~storage:"{}" + ~forges_tickets:false + in + let open Lwt_result_syntax in + let*? value_type = + Environment.wrap_tzresult @@ ticket_t Micheline.dummy_location string_t + in + let*? parameters_ty = + Environment.wrap_tzresult + @@ big_map_t Micheline.dummy_location int_t value_type + in + let parameters = + Big_map + { + id = Some big_map_id; + diff = {map = Big_map_overlay.empty; size = 0}; + key_type = int_t; + value_type; + } + in + let* operation, incr = + transfer_operation + ~incr + ~src:ticketer_contract + ~destination:orig_contract + ~parameters_ty + ~parameters + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + let destination = Destination.Contract (Originated orig_contract) in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer:ticketer_contract "red"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer_contract "green"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + { + ticket_token = string_token ~ticketer:ticketer_contract "blue"; + total_amount = nat 1; + destinations = [(destination, one)]; + }; + ] + +(** Test transfer a ticket to a tx_rollup. *) +let test_tx_rollup_deposit_one_ticket () = + let open Lwt_result_syntax in + let* _baker, src, block = init ~tx_rollup_enable:true () in + let* ticketer = one_ticketer block in + let* incr = Incremental.begin_construction block in + let* operation, tx_rollup = + Op.tx_rollup_origination (I incr) src ~fee:(Test_tez.of_int 10) + in + let* incr = Incremental.add_operation incr operation in + + let*? ticket_ty = + Script_typed_ir.(ticket_t Micheline.dummy_location string_t) + |> Environment.wrap_tzresult + in + let*? (Ty_ex_c parameters_ty) = + Script_typed_ir.( + pair_t Micheline.dummy_location ticket_ty tx_rollup_l2_address_t) + |> Environment.wrap_tzresult + in + let amount = one in + let*? contents = + Script_string.of_string "white" |> Environment.wrap_tzresult + in + let l2_destination = + Indexable.value + @@ Tx_rollup_l2_address.of_b58check_exn + "tz4MSfZsn6kMDczShy8PMeB628TNukn9hi2K" + in + let parameters = + (Script_typed_ir.{ticketer; contents; amount}, l2_destination) + in + + let* operation, incr = + transfer_operation_to_tx_rollup + ~incr + ~src + ~tx_rollup + ~parameters_ty + ~parameters + in + let* ticket_diffs, ctxt = ticket_diffs_of_operations incr [operation] in + assert_equal_ticket_token_diffs + ctxt + ~loc:__LOC__ + ticket_diffs + ~expected: + [ + { + ticket_token = string_token ~ticketer "white"; + total_amount = nat 1; + destinations = [(Destination.Tx_rollup tx_rollup, one)]; + }; + ] + +(** Test transferring a list of multiple tickets where two of them have zero + amounts fails. *) +let test_transfer_fails_on_multiple_zero_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let* orig_contract, incr = + originate + block + ~src + ~baker + ~script:ticket_list_script + ~storage:"{}" + ~forges_tickets:false + in + assert_fails + ~loc:__LOC__ + ~error:Script_tc_errors.Forbidden_zero_ticket_quantity + @@ (* let* operation, incr = *) + transfer_tickets_operation + ~incr + ~src + ~destination:orig_contract + [ + (ticketer, "red", 1); + (ticketer, "blue", 0); + (ticketer, "green", 2); + (ticketer, "red", 0); + (ticketer, "green", 3); + ] + +(** Test that zero-amount tickets are detected and that an error is yielded. *) +let test_fail_on_zero_amount_tickets () = + let* baker, src, block = init () in + let* ticketer = one_ticketer block in + let storage = + let ticketer_addr = Contract.to_b58check ticketer in + Printf.sprintf + {| + { Pair %S "red" 1; + Pair %S "blue" 2 ; + Pair %S "green" 3; + Pair %S "red" 0; + Pair %S "red" 4; } + |} + ticketer_addr + ticketer_addr + ticketer_addr + ticketer_addr + ticketer_addr + in + assert_fails + ~loc:__LOC__ + ~error:Script_tc_errors.Forbidden_zero_ticket_quantity + @@ origination_operation + block + ~src + ~baker + ~script:ticket_list_script + ~storage + ~forges_tickets:true + +let tests = + [ + Tztest.tztest + "Test operations that do not involve tickets" + `Quick + test_non_ticket_operations; + Tztest.tztest + "Test transfer to non-ticket contract" + `Quick + test_transfer_to_non_ticket_contract; + Tztest.tztest + "Test transfer empty ticket list" + `Quick + test_transfer_empty_ticket_list; + Tztest.tztest "Test transfer one ticket" `Quick test_transfer_one_ticket; + Tztest.tztest + "Test transfer multiple tickets" + `Quick + test_transfer_multiple_tickets; + Tztest.tztest + "Test transfer different tickets" + `Quick + test_transfer_different_tickets; + Tztest.tztest + "Test transfer to two contracts with different tickets" + `Quick + test_transfer_to_two_contracts_with_different_tickets; + Tztest.tztest + "Test originate contract that does not contain tickets" + `Quick + test_originate_non_ticket_contract; + Tztest.tztest + "Test originate with empty ticket list" + `Quick + test_originate_with_empty_tickets_list; + Tztest.tztest + "Test originate with one ticket" + `Quick + test_originate_with_one_ticket; + Tztest.tztest + "Test originate with multiple tickets" + `Quick + test_originate_with_multiple_tickets; + Tztest.tztest + "Test originate with different tickets" + `Quick + test_originate_with_different_tickets; + Tztest.tztest + "Test originate two contracts with different tickets" + `Quick + test_originate_two_contracts_with_different_tickets; + Tztest.tztest + "Test originate and transfer" + `Quick + test_originate_and_transfer; + Tztest.tztest + "Test originate big-map with tickets" + `Quick + test_originate_big_map_with_tickets; + Tztest.tztest + "Test transfer big-map with tickets" + `Quick + test_transfer_big_map_with_tickets; + Tztest.tztest + "Test tx rollup deposit one ticket" + `Quick + test_tx_rollup_deposit_one_ticket; + Tztest.tztest + "Test transfer fails on multiple zero tickets" + `Quick + test_transfer_fails_on_multiple_zero_tickets; + Tztest.tztest + "Test fail in zero-amount tickets" + `Quick + test_fail_on_zero_amount_tickets; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml new file mode 100644 index 000000000000..f8e662e07c8e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml @@ -0,0 +1,695 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Ticket_scanner) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket scanner" + Subject: Ticket scanner tests +*) + +open Protocol +open Alpha_context + +let assert_fails ~loc ?error m = + let open Lwt_result_syntax in + let*! res = m in + let rec aux err_res = + match (err_res, error) with + | Environment.Ecoproto_error err' :: rest, Some err -> + if err = err' then return_unit else aux rest + | _, Some _ -> + (* Expected a different error. *) + let msg = + Printf.sprintf "Expected a different error at location %s" loc + in + Stdlib.failwith msg + | _, None -> + (* Any error is ok. *) + return () + in + match res with + | Ok _ -> Stdlib.failwith "Expected failure" + | Error err_res -> aux err_res + +let ( let* ) m f = m >>=? f + +let wrap m = m >|= Environment.wrap_tzresult + +let new_ctxt () = + let* block, _contract = Context.init1 () in + let* incr = Incremental.begin_construction block in + return @@ Incremental.alpha_ctxt incr + +let assert_equal_string_list ~loc msg = + Assert.assert_equal_list ~loc String.equal msg Format.pp_print_string + +let string_list_of_ex_tickets ctxt tickets = + let accum (xs, ctxt) + (Ticket_scanner.Ex_ticket + (cty, {Script_typed_ir.ticketer; contents; amount})) = + let* x, ctxt = + wrap + @@ Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Readable + cty + contents + in + let content = + Format.kasprintf Fun.id "%a" Michelson_v1_printer.print_expr x + in + let str = + Format.kasprintf + Fun.id + "(%a, %s, %a)" + Contract.pp + ticketer + content + Z.pp_print + Script_int.(to_zint (amount :> n num)) + in + return (str :: xs, ctxt) + in + let* xs, ctxt = List.fold_left_es accum ([], ctxt) tickets in + return (List.rev xs, ctxt) + +let make_ex_ticket ctxt ~ticketer ~type_exp ~content_exp ~amount = + let* Script_ir_translator.Ex_comparable_ty cty, ctxt = + let node = Micheline.root @@ Expr.from_string type_exp in + wrap @@ Lwt.return @@ Script_ir_translator.parse_comparable_ty ctxt node + in + let* ticketer = wrap @@ Lwt.return @@ Contract.of_b58check ticketer in + let* contents, ctxt = + let node = Micheline.root @@ Expr.from_string content_exp in + wrap @@ Script_ir_translator.parse_comparable_data ctxt cty node + in + let amount = Script_int.(abs @@ of_int amount) in + let amount = + WithExceptions.Option.get ~loc:__LOC__ @@ Ticket_amount.of_n amount + in + let ticket = Script_typed_ir.{ticketer; contents; amount} in + return (Ticket_scanner.Ex_ticket (cty, ticket), ctxt) + +let assert_equals_ex_tickets ctxt ~loc ex_tickets expected = + let* str_tickets, ctxt = string_list_of_ex_tickets ctxt ex_tickets in + let* str_tickets_expected, _ctxt = string_list_of_ex_tickets ctxt expected in + assert_equal_string_list + ~loc + "Compare with expected tickets" + (List.sort String.compare str_tickets) + (List.sort String.compare str_tickets_expected) + +let tickets_of_value ctxt ~include_lazy ~type_exp ~value_exp = + let Script_typed_ir.Ex_ty ty, ctxt = + let node = Micheline.root @@ Expr.from_string type_exp in + Result.value_f + ~default:(fun () -> Stdlib.failwith "Failed to parse") + (Script_ir_translator.parse_any_ty ctxt ~legacy:false node) + in + let node = Micheline.root @@ Expr.from_string value_exp in + let* value, ctxt = + wrap + @@ Script_ir_translator.parse_data + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:false ()) + ~allow_forged:true + ty + node + in + let* ht, ctxt = + wrap @@ Lwt.return @@ Ticket_scanner.type_has_tickets ctxt ty + in + wrap @@ Ticket_scanner.tickets_of_value ctxt ~include_lazy ht value + +let assert_contains_tickets ctxt ~loc ~include_lazy ~type_exp ~value_exp + expected = + let* ex_tickets, _ = + tickets_of_value ctxt ~include_lazy ~type_exp ~value_exp + in + assert_equals_ex_tickets ctxt ~loc ex_tickets expected + +let assert_fail_non_empty_overlay ctxt ~loc ~include_lazy ~type_exp ~value_exp = + tickets_of_value ctxt ~include_lazy ~type_exp ~value_exp >>= fun res -> + match res with + | Error [x] -> + let x = Format.kasprintf Fun.id "%a" Error_monad.pp x in + Assert.equal + ~loc + String.equal + "" + Format.pp_print_string + "Unsupported big-map value with non-empty overlay" + x + | _ -> failwith "Expected an error at %s" loc + +let make_string_tickets ctxt ticketer_amounts = + List.fold_right_es + (fun (ticketer, content, amount) (tickets, ctxt) -> + let* ticket, ctxt = + make_ex_ticket + ctxt + ~ticketer + ~type_exp:"string" + ~content_exp:(Printf.sprintf {|"%s"|} content) + ~amount + in + return (ticket :: tickets, ctxt)) + ticketer_amounts + ([], ctxt) + +let tickets_from_big_map_ref ~pre_populated value_exp = + let* block, source = Context.init1 () in + let* operation, originated = + Op.contract_origination_hash (B block) source ~script:Op.dummy_script + in + let* block = Block.bake ~operation block in + let* inc = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt inc in + let* ctxt, big_map_id = wrap @@ Big_map.fresh ~temporary:false ctxt in + let int_ty_expr = Expr.from_string "int" in + let* diffs, ctxt = + let* updates, ctxt = + List.fold_left_es + (fun (kvs, ctxt) (key, value) -> + let* key_hash, ctxt = + wrap + @@ Script_ir_translator.hash_comparable_data + ctxt + Script_typed_ir.int_t + (Script_int.of_int key) + in + return + ( { + Big_map.key = Expr.from_string @@ string_of_int key; + key_hash; + value = Some (Expr.from_string value); + } + :: kvs, + ctxt )) + ([], ctxt) + pre_populated + in + let alloc = + Big_map. + {key_type = int_ty_expr; value_type = Expr.from_string "ticket string"} + in + return + ( [ + Lazy_storage.make + Lazy_storage.Kind.Big_map + big_map_id + (Update {init = Lazy_storage.Alloc alloc; updates}); + ], + ctxt ) + in + let* ctxt = + wrap + @@ Contract.update_script_storage ctxt originated int_ty_expr (Some diffs) + in + let value_exp = + value_exp @@ Z.to_string (Big_map.Id.unparse_to_z big_map_id) + in + return (value_exp, ctxt) + +let assert_big_map_int_ticket_string_ref ~loc ~pre_populated ~big_map_exp + ex_tickets = + let* value_exp, ctxt = tickets_from_big_map_ref ~pre_populated big_map_exp in + let* ex_tickets, ctxt = make_string_tickets ctxt ex_tickets in + assert_contains_tickets + ctxt + ~include_lazy:true + ~loc + ~type_exp:"big_map int (ticket string)" + ~value_exp + ex_tickets + +let assert_fail_non_empty_overlay_with_big_map_ref ~loc ~pre_populated + ~big_map_exp = + let* value_exp, ctxt = tickets_from_big_map_ref ~pre_populated big_map_exp in + assert_fail_non_empty_overlay + ctxt + ~include_lazy:true + ~loc + ~type_exp:"big_map int (ticket string)" + ~value_exp + +let assert_string_tickets ~loc ~include_lazy ~type_exp ~value_exp ~expected = + let* ctxt = new_ctxt () in + let* ex_tickets, ctxt = make_string_tickets ctxt expected in + let* () = + assert_contains_tickets + ctxt + ~include_lazy + ~loc + ~type_exp + ~value_exp + ex_tickets + in + assert_contains_tickets + ctxt + ~include_lazy + ~loc + ~type_exp + ~value_exp + ex_tickets + +(** Test that the ticket can be extracted from a a single unit ticket *) +let test_tickets_in_unit_ticket () = + let* ctxt = new_ctxt () in + let type_exp = "ticket(unit)" in + let value_exp = {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" Unit 10|} in + let* ex_ticket, ctxt = + make_ex_ticket + ctxt + ~ticketer:"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" + ~type_exp:"unit" + ~content_exp:"Unit" + ~amount:10 + in + assert_contains_tickets + ctxt + ~loc:__LOC__ + ~include_lazy:false + ~type_exp + ~value_exp + [ex_ticket] + +let assert_string_tickets_fail_on_zero_amount ~loc ~include_lazy ~type_exp + ~value_exp = + let* ctxt = new_ctxt () in + assert_fails ~loc ~error:Script_tc_errors.Forbidden_zero_ticket_quantity + @@ tickets_of_value ctxt ~include_lazy ~type_exp ~value_exp + +let test_tickets_in_list_with_zero_amount () = + assert_string_tickets_fail_on_zero_amount + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"list(ticket(string))" + ~value_exp: + {| + { + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "orange" 0; + } + |} + +(** Test that all tickets can be extracted from a list of tickets *) +let test_tickets_in_list () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"list(ticket(string))" + ~value_exp: + {| + { + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3; + } + |} + ~expected: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green", 2); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", 3); + ] + +let test_tickets_in_pair_with_zero_amount () = + assert_string_tickets_fail_on_zero_amount + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"pair (ticket string) (ticket string) (ticket string)" + ~value_exp: + {| + Pair + (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1) + (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2) + (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 0) + |} + +(** Test that all tickets can be extracted from a pair of tickets *) +let test_tickets_in_pair () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"pair (ticket string) (ticket string)" + ~value_exp: + {| + Pair + (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1) + (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2) + |} + ~expected: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green", 2); + ] + +let test_tickets_in_map_with_zero_amount () = + assert_string_tickets_fail_on_zero_amount + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"map int (ticket string)" + ~value_exp: + {| + { + Elt 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1); + Elt 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2); + Elt 3 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 0); + } + |} + +(** Test that all tickets from a map can be extracted. *) +let test_tickets_in_map () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"map int (ticket string)" + ~value_exp: + {| + { + Elt 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1); + Elt 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2); + } + |} + ~expected: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green", 2); + ] + +(** Test that all tickets from a big-map with non-empty overlay fails. + If we extend the ticket scanner function to support non-empty overlays + this test needs to be adapted. + *) +let test_tickets_in_big_map () = + let* ctxt = new_ctxt () in + assert_fail_non_empty_overlay + ctxt + ~loc:__LOC__ + ~include_lazy:true + ~type_exp:"big_map int (ticket string)" + ~value_exp: + {| + { + Elt 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1); + Elt 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2); + } + |} + +(** Test that tickets are not extracted from big-map with [include_lazy] set + to false. *) +let test_tickets_in_big_map_strict_only () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"big_map int (ticket string)" + ~value_exp: + {| + { + Elt 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1); + Elt 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 2); + Elt 3 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 3); + } + |} + ~expected:[] + +(** Test that tickets can be extracted from a list of tickets inside a big-map + This fails due to non-empty overlay. If we extend the ticket scanner + function to support non-empty overlays this test needs to be adapted. +*) +let test_tickets_in_list_in_big_map () = + let* ctxt = new_ctxt () in + assert_fail_non_empty_overlay + ctxt + ~loc:__LOC__ + ~include_lazy:true + ~type_exp:"(big_map int (list(ticket string)))" + ~value_exp: + {| + { + Elt 1 { + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1 + }; + Elt 2 { + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1 ; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "orange" 1 + } + } + |} + +(** Test that tickets can be extracted from a combination of a list and lazy structure + and that only the strict part is considered with [include_lazy] set to fasle *) +let test_tickets_in_pair_big_map_and_list_strict_only () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"pair (big_map int (ticket string)) (list (ticket string))" + ~value_exp: + {| + Pair + { + Elt 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1); + Elt 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1) + } + { + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1; + Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "orange" 1 + } + |} + ~expected: + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "orange", 1); + ] + +(** Test that tickets can be extracted from the left side of an or-expression. *) +let test_tickets_in_or_left () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"or (ticket string) int" + ~value_exp:{| Left (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1) |} + ~expected:[("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1)] + +(** Test that tickets from the left side of an or-expression with zero amount + are rejected. *) +let test_tickets_in_or_left_with_zero_amount () = + assert_string_tickets_fail_on_zero_amount + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"or (ticket string) int" + ~value_exp:{| Left (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 0) |} + +(** Test that tickets can be extracted from the right side of an or-expression. *) +let test_tickets_in_or_right () = + assert_string_tickets + ~loc:__LOC__ + ~include_lazy:false + ~type_exp:"or int (ticket string)" + ~value_exp:{| Right (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1) |} + ~expected:[("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1)] + +(* + Big maps have three possible representations. Either as a list of key-value + pairs, as an identifier (int), or as a pair of identifier and overrides. + Example values: + + 1) { Elt "bar" True ; Elt "foo" False } + 2) 42 + 3) Pair 42 { Elt "foo" (Some False) } + *) + +(** Test tickets from empty big_map when passed by reference. *) +let test_tickets_in_empty_big_map_ref () = + assert_big_map_int_ticket_string_ref + ~loc:__LOC__ + ~pre_populated:[] + ~big_map_exp:(Printf.sprintf "%s") + [] + +(** Test tickets from non-empty big-map when passed by reference. + Here, tickets are scanned from the context. *) +let test_tickets_in_non_empty_big_map_ref () = + assert_big_map_int_ticket_string_ref + ~loc:__LOC__ + ~pre_populated: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1|}); + ] + ~big_map_exp:(Printf.sprintf "%s") + [ + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "red", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "green", 1); + ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq", "blue", 1); + ] + +(** Test tickets from empty big-map when passed as a pair of identifier + and overrides. Here, the scanned tickets are only contained in the overlay + why ticket-scanning fails. + + If we extend the ticket scanner function to support non-empty overlays + this test needs to be adapted. + *) +let test_tickets_overlay_in_empty_big_map_ref () = + assert_fail_non_empty_overlay_with_big_map_ref + ~loc:__LOC__ + ~pre_populated:[] + ~big_map_exp: + (Printf.sprintf + {|Pair %s { Elt 1 (Some (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1))}|}) + +(** Test tickets from non-empty big-map when passed as a pair of identifier + and overrides. The scanned tickets are contained in the context as well as + in the overlay. Since overlay is non-empty is non-empty, ticket scanning + fails. + + If we extend the ticket scanner function to support non-empty overlays + this test needs to be adapted + *) +let test_tickets_overlay_in_non_empty_in_big_map_ref () = + assert_fail_non_empty_overlay_with_big_map_ref + ~loc:__LOC__ + ~pre_populated: + [ + (1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|}); + (2, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1|}); + (3, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "blue" 1|}); + ] + ~big_map_exp: + (Printf.sprintf + {| Pair + %s + { Elt 4 (Some (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "orange" 1))} + |}) + +(** Test tickets from non-empty big-map when passed as a pair of identifier + and overrides, and where the override replaces an existing ticket. + Ticket scanning fails due to non-empty overlay. + + If we extend the ticket scanner function to support non-empty overlays + this test needs to be adapted. + *) +let test_tickets_replace_overlay_in_non_empty_in_big_map_ref () = + assert_fail_non_empty_overlay_with_big_map_ref + ~loc:__LOC__ + ~pre_populated: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~big_map_exp: + (Printf.sprintf + {| Pair + %s + { Elt 1 (Some (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "green" 1))} + |}) + +(** Test tickets from non-empty big-map when passed as a pair of identifier + and overrides, and where the override removes an existing ticket. + Ticket scanning fails due to non-empty overlay. + + If we extend the ticket scanner function to support non-empty overlays + this test needs to be adapted. + *) +let test_tickets_remove_overlay_in_non_empty_in_big_map_ref () = + assert_fail_non_empty_overlay_with_big_map_ref + ~loc:__LOC__ + ~pre_populated: + [(1, {|Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1|})] + ~big_map_exp:(Printf.sprintf {| Pair %s { Elt 1 None} |}) + +let tests = + [ + Tztest.tztest + "Test tickets in unit ticket" + `Quick + test_tickets_in_unit_ticket; + Tztest.tztest "Test tickets in list" `Quick test_tickets_in_list; + Tztest.tztest + "Test tickets in list with zero amount" + `Quick + test_tickets_in_list_with_zero_amount; + Tztest.tztest "Test tickets in pair" `Quick test_tickets_in_pair; + Tztest.tztest + "Test tickets in pair with zero amount" + `Quick + test_tickets_in_pair_with_zero_amount; + Tztest.tztest "Test tickets in map" `Quick test_tickets_in_map; + Tztest.tztest + "Test tickets in map with zero amount" + `Quick + test_tickets_in_map_with_zero_amount; + Tztest.tztest "Test tickets in big map" `Quick test_tickets_in_big_map; + Tztest.tztest + "Test tickets in big map with include lazy set to false" + `Quick + test_tickets_in_big_map_strict_only; + Tztest.tztest + "Test tickets in list in big map" + `Quick + test_tickets_in_list_in_big_map; + Tztest.tztest + "Test tickets in a pair of big-map and list with include lazy set to \ + false" + `Quick + test_tickets_in_pair_big_map_and_list_strict_only; + Tztest.tztest "Test tickets in or left" `Quick test_tickets_in_or_left; + Tztest.tztest + "Test tickets in or left with zero amount" + `Quick + test_tickets_in_or_left_with_zero_amount; + Tztest.tztest "Test tickets in or right" `Quick test_tickets_in_or_right; + Tztest.tztest + "Test tickets in empty big-map ref" + `Quick + test_tickets_overlay_in_empty_big_map_ref; + Tztest.tztest + "Test tickets in big-map ref" + `Quick + test_tickets_in_empty_big_map_ref; + Tztest.tztest + "Test tickets in non-empty big-map ref" + `Quick + test_tickets_in_non_empty_big_map_ref; + Tztest.tztest + "Test tickets in non-empty big-map ref with overlay" + `Quick + test_tickets_overlay_in_non_empty_in_big_map_ref; + Tztest.tztest + "Test tickets replace existing value from overlay" + `Quick + test_tickets_replace_overlay_in_non_empty_in_big_map_ref; + Tztest.tztest + "Test tickets remove existing value from overlay" + `Quick + test_tickets_remove_overlay_in_non_empty_in_big_map_ref; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml new file mode 100644 index 000000000000..fe0e93271301 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml @@ -0,0 +1,273 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Alpha_context.Ticket_balance) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- test "^ticket storage$" + Subject: Ticket storage functions tested using the Ticket_balance module in Alpha_context. +*) + +open Protocol +open Alpha_context + +let ( let* ) m f = m >>=? f + +let wrap m = m >|= Environment.wrap_tzresult + +let make_context () = + let* block, _contract = Context.init1 () in + let* incr = Incremental.begin_construction block in + return (Incremental.alpha_ctxt incr) + +let hash_key ctxt ~ticketer ~ty ~contents ~owner = + let ticketer = Micheline.root @@ Expr.from_string ticketer in + let ty = Micheline.root @@ Expr.from_string ty in + let contents = Micheline.root @@ Expr.from_string contents in + let owner = Micheline.root @@ Expr.from_string owner in + wrap + @@ Lwt.return + (Alpha_context.Ticket_hash.make ctxt ~ticketer ~ty ~contents ~owner) + +let assert_balance ctxt ~loc key expected = + let* balance, _ = wrap @@ Ticket_balance.get_balance ctxt key in + match balance with + | Some b -> Assert.equal_int ~loc (Z.to_int b) expected + | None -> failwith "Expected balance %d" expected + +let assert_no_balance ctxt key = + let* balance, _ = wrap @@ Ticket_balance.get_balance ctxt key in + match balance with + | Some b -> failwith "Expected empty (none) balance but got %d" (Z.to_int b) + | None -> return () + +let adjust_balance ctxt key delta = + wrap @@ Ticket_balance.adjust_balance ctxt key ~delta:(Z.of_int delta) + +let assert_non_overlapping_keys ~loc ~ticketer1 ~ticketer2 ~contents1 ~contents2 + ~ty1 ~ty2 ~owner1 ~owner2 = + let* ctxt = make_context () in + let* k1, ctxt = + hash_key ctxt ~ticketer:ticketer1 ~ty:ty1 ~contents:contents1 ~owner:owner1 + in + let* k2, _ctxt = + hash_key ctxt ~ticketer:ticketer2 ~ty:ty2 ~contents:contents2 ~owner:owner2 + in + Assert.not_equal + ~loc + Ticket_hash.equal + "Keys should not overlap" + Ticket_hash.pp + k1 + k2 + +let make_key ctxt content = + hash_key + ctxt + ~ticketer:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ty:"string" + ~contents:(Printf.sprintf {|"%s"|} content) + ~owner:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + +(** Test that key-hashes constructed from different ticketers don't overlap. *) +let test_non_overlapping_keys_ticketer () = + assert_non_overlapping_keys + ~loc:__LOC__ + ~ticketer1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ticketer2:{|"KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn"|} + ~ty1:"nat" + ~ty2:"int" + ~contents1:{|"1"|} + ~contents2:{|"1"|} + ~owner1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~owner2:{|"KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn"|} + +(** Test that key-hashes constructed from different contents don't overlap. *) +let test_non_overlapping_keys_contents () = + assert_non_overlapping_keys + ~loc:__LOC__ + ~ticketer1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ticketer2:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ty1:"string" + ~ty2:"string" + ~contents1:{|"red"|} + ~contents2:{|"blue"|} + ~owner1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~owner2:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + +(** Test that key-hashes constructed from different content-types don't overlap. *) +let test_non_overlapping_keys_type () = + assert_non_overlapping_keys + ~loc:__LOC__ + ~ticketer1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ticketer2:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ty1:"nat" + ~ty2:"int" + ~contents1:{|"1"|} + ~contents2:{|"1"|} + ~owner1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~owner2:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + +(** Test that key-hashes constructed from different owners don't overlap. *) +let test_non_overlapping_keys_owner () = + assert_non_overlapping_keys + ~loc:__LOC__ + ~ticketer1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ticketer2:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~ty1:"nat" + ~ty2:"int" + ~contents1:{|"1"|} + ~contents2:{|"1"|} + ~owner1:{|"KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq"|} + ~owner2:{|"KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn"|} + +(** Test that updating the ticket balance table has + the intended effect. + *) +let test_ticket_balance_single_update () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + let* _, ctxt = adjust_balance ctxt alice_red 1 in + assert_balance ctxt ~loc:__LOC__ alice_red 1 + +(** Test that updating the ticket-balance table with different keys + updates both entries. *) +let test_ticket_balance_different_owners () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + let* alice_blue, ctxt = make_key ctxt "alice_blue" in + let* _, ctxt = adjust_balance ctxt alice_red 1 in + let* _, ctxt = adjust_balance ctxt alice_blue 1 in + let* () = assert_balance ctxt ~loc:__LOC__ alice_red 1 in + let* () = assert_balance ctxt ~loc:__LOC__ alice_blue 1 in + return () + +(** Test updating the same entry with multiple updates yields + the net result of all balance updates *) +let test_ticket_balance_multiple_updates () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + let* _, ctxt = adjust_balance ctxt alice_red 1 in + let* _, ctxt = adjust_balance ctxt alice_red 2 in + let* _, ctxt = adjust_balance ctxt alice_red (-1) in + assert_balance ctxt ~loc:__LOC__ alice_red 2 + +(** Test that with no updates to the table, no balance is present in + the table *) +let test_empty_balance () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + assert_no_balance ctxt alice_red + +(** Test that adding one entry with positive balance and then + updating with a negative balance also removes the entry *) +let test_empty_balance_after_update () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + let* _, ctxt = adjust_balance ctxt alice_red 1 in + let* _, ctxt = adjust_balance ctxt alice_red (-1) in + assert_no_balance ctxt alice_red + +(** Test that attempting to update an entry with a negative balance + results in an error. *) +let test_negative_balance () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + adjust_balance ctxt alice_red (-1) >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (fun _err -> true) + +(** Test that positive storage spaces are returned for operations + resulting in extra storage space and negative for ones that frees up storage. + *) +let test_storage_space () = + let* ctxt = make_context () in + let* alice_red, ctxt = make_key ctxt "alice_red" in + (* Space for adding an entry is 65 for the key plus 1 for the value. *) + let* space, ctxt = adjust_balance ctxt alice_red 1 in + let* () = Assert.equal_int ~loc:__LOC__ 66 (Z.to_int space) in + (* Adding one does not consume additional space. *) + let* space, ctxt = adjust_balance ctxt alice_red 1 in + let* () = Assert.equal_int ~loc:__LOC__ 0 (Z.to_int space) in + (* Adding a big balance costs extra. *) + let* space, ctxt = adjust_balance ctxt alice_red 1000 in + let* () = Assert.equal_int ~loc:__LOC__ 1 (Z.to_int space) in + (* Reset balance to zero should free up space. + The freed up space is 65 for the key + 2 for the value *) + let* b, ctxt = wrap @@ Ticket_balance.get_balance ctxt alice_red in + let* space, ctxt = + wrap + (Ticket_balance.adjust_balance + ctxt + alice_red + ~delta:(Z.neg @@ Option.value ~default:Z.zero b)) + in + let* () = Assert.equal_int ~loc:__LOC__ (-67) (Z.to_int space) in + (* Adjusting the space to 0 again should not free anything *) + let* space, ctxt = adjust_balance ctxt alice_red 0 in + let* () = Assert.equal_int ~loc:__LOC__ 0 (Z.to_int space) in + (* Adding a balance requiers extra space. *) + let* space, _ = adjust_balance ctxt alice_red 10 in + Assert.equal_int ~loc:__LOC__ 66 (Z.to_int space) + +let tests = + [ + Tztest.tztest + "no overlapping keys for ticketer" + `Quick + test_non_overlapping_keys_ticketer; + Tztest.tztest + "no overlapping keys for content" + `Quick + test_non_overlapping_keys_contents; + Tztest.tztest + "no overlapping keys for content type" + `Quick + test_non_overlapping_keys_type; + Tztest.tztest + "no overlapping keys for owner" + `Quick + test_non_overlapping_keys_owner; + Tztest.tztest + "ticket balance single update" + `Quick + test_ticket_balance_single_update; + Tztest.tztest "empty balance" `Quick test_empty_balance; + Tztest.tztest + "empty balance after update" + `Quick + test_empty_balance_after_update; + Tztest.tztest "negative balance" `Quick test_negative_balance; + Tztest.tztest + "ticket balance multiple updates" + `Quick + test_ticket_balance_multiple_updates; + Tztest.tztest + "ticket balance different owners" + `Quick + test_ticket_balance_different_owners; + Tztest.tztest "ticket storage space" `Quick test_storage_space; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_timelock.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_timelock.ml new file mode 100644 index 000000000000..f72e3983caef --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_timelock.ml @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Tezos_crypto.Timelock) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test "^timelock$" + Subject: On timelock +*) + +open Protocol +open Lwt_result_syntax + +let wrap e = Lwt.return (Environment.wrap_tzresult e) + +let simple_test () = + let public, secret = Tezos_crypto.Timelock.gen_rsa_keys () in + let locked_value = Tezos_crypto.Timelock.gen_locked_value public in + let time = 1000 in + let unlocked_value = + Tezos_crypto.Timelock.unlock_with_secret secret ~time locked_value + in + let same_unlocked, proof = + Tezos_crypto.Timelock.unlock_and_prove_without_secret + public + ~time + locked_value + in + assert (unlocked_value = same_unlocked) ; + let sym_key = + Tezos_crypto.Timelock.unlocked_value_to_symmetric_key unlocked_value + in + let message = Bytes.create 12 in + let c = Tezos_crypto.Timelock.encrypt sym_key message in + let expected_result = Environment.Timelock.Correct message in + let chest_key = Tezos_crypto.Timelock.{unlocked_value; proof} in + let chest = + Tezos_crypto.Timelock.{locked_value; rsa_public = public; ciphertext = c} + in + let result = Environment.Timelock.open_chest chest chest_key ~time in + assert (result = expected_result) ; + return_unit + +let deprecated_chest_open () = + (* Verify contract fails origination as OPEN_CHEST is marked as legacy (deprecated )*) + let* block, baker, source_contract, _src2 = Contract_helpers.init () in + let storage = "0xdeadbeef" in + let script = Contract_helpers.read_file "./contracts/timelock.tz" in + Contract_helpers.originate_contract_from_string_hash + ~script + ~storage + ~source_contract + ~baker + block + >>= function + | Ok _ -> Alcotest.fail "script originated successfully, expected an error" + | Error lst + when List.mem + ~equal:( = ) + (Environment.Ecoproto_error + (Script_tc_errors.Deprecated_instruction T_chest_key)) + lst -> + return () + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +(* Test to verify open_chest correctness + DISABLED as open_chest is deprecated, but is expected to return. +*) +let contract_test () = + let* block, baker, source_contract, _src2 = Contract_helpers.init () in + let storage = "0xdeadbeef" in + let script = Contract_helpers.read_file "./contracts/timelock.tz" in + let* dst, _script, block = + Contract_helpers.originate_contract_from_string_hash + ~script + ~storage + ~source_contract + ~baker + block + in + let public, secret = Tezos_crypto.Timelock.gen_rsa_keys () in + let locked_value = Tezos_crypto.Timelock.gen_locked_value public in + let time = 1000 in + let unlocked_value = + Tezos_crypto.Timelock.unlock_with_secret secret ~time locked_value + in + let _same_unlocked, proof = + Tezos_crypto.Timelock.unlock_and_prove_without_secret + public + ~time + locked_value + in + let sym_key = + Tezos_crypto.Timelock.unlocked_value_to_symmetric_key unlocked_value + in + let message = Bytes.of_string "this is my message" in + let c = Tezos_crypto.Timelock.encrypt sym_key message in + let check_storage chest chest_key expected_storage_hexa = + let chest_key_bytes = + "0x" + ^ Hex.show + (Hex.of_bytes + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Timelock.chest_key_encoding + chest_key)) + in + let chest_bytes = + "0x" + ^ Hex.show + (Hex.of_bytes + (Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Timelock.chest_encoding + chest)) + in + let michelson_string = + Format.sprintf "(Pair %s %s )" chest_key_bytes chest_bytes + in + let parameters = + Alpha_context.Script.(lazy_expr (Expr.from_string michelson_string)) + in + let fee = Test_tez.of_int 10 in + Op.transaction + ~fee + (B block) + source_contract + (Originated dst) + (Test_tez.of_int 3) + ~parameters + >>=? fun operation -> + Incremental.begin_construction block >>=? fun incr -> + Incremental.add_operation incr operation >>=? fun incr -> + Incremental.finalize_block incr >>=? fun block -> + Incremental.begin_construction block >>=? fun incr -> + let ctxt = Incremental.alpha_ctxt incr in + Alpha_context.Contract.get_storage ctxt dst >>= wrap + >>=? fun (_, expr_option) -> + let expr = expr_option |> WithExceptions.Option.get ~loc:__LOC__ in + let bytes = + match Micheline.root expr with + | Micheline.Bytes (_, b) -> b + | _ -> assert false + in + let to_check = Hex.show (Hex.of_bytes bytes) in + assert (to_check = expected_storage_hexa) ; + return_unit + in + let chest_key_correct = Tezos_crypto.Timelock.{unlocked_value; proof} in + let chest_correct = + Tezos_crypto.Timelock.{locked_value; rsa_public = public; ciphertext = c} + in + check_storage + chest_correct + chest_key_correct + (Hex.show (Hex.of_bytes message)) + >>=? fun () -> + (* We redo an RSA parameters generation to create incorrect cipher and proof *) + let public_bogus, secret_bogus = Tezos_crypto.Timelock.gen_rsa_keys () in + let locked_value_bogus = + Tezos_crypto.Timelock.gen_locked_value public_bogus + in + let time = 1000 in + let unlocked_value_bogus = + Tezos_crypto.Timelock.unlock_with_secret + secret_bogus + ~time + locked_value_bogus + in + let _same_unlocked, proof_bogus = + Tezos_crypto.Timelock.unlock_and_prove_without_secret + public + ~time + locked_value_bogus + in + let sym_key_bogus = + Tezos_crypto.Timelock.unlocked_value_to_symmetric_key unlocked_value_bogus + in + let c_bogus = Tezos_crypto.Timelock.encrypt sym_key_bogus message in + + let chest_incorrect = + Tezos_crypto.Timelock. + {locked_value; rsa_public = public; ciphertext = c_bogus} + in + check_storage chest_incorrect chest_key_correct "00" >>=? fun () -> + let chest_key_incorrect = + Tezos_crypto.Timelock.{unlocked_value; proof = proof_bogus} + in + check_storage chest_correct chest_key_incorrect "01" >>=? fun () -> + return_unit + +(** + Expect fail wrapper for tests that you expect to return Error or throw an exception. + Useful to keep tests enabled even if they fail, but still run them. + @param test_f test function that is expected to fail. + *) +let expect_fail_result_lwt test_f () = + let open Lwt_syntax in + try + let* res = test_f () in + match res with + | Ok _ -> Alcotest.fail "Expect failure" + | Error _ -> return_ok_unit + with _ -> return_ok_unit + +let tests = + [ + Tztest.tztest "simple test" `Quick simple_test; + Tztest.tztest + "verify chest_open fails origination" + `Quick + deprecated_chest_open; + Tztest.tztest + "contract test with chest_open (OK when it fails)" + `Quick + (expect_fail_result_lwt contract_test); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml new file mode 100644 index 000000000000..8136c612ccde --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml @@ -0,0 +1,930 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (type-checking) + Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ + dune exec ./main.exe -- test "^typechecking$" + Subject: Type-checking +*) + +open Protocol +open Alpha_context +open Micheline +open Error_monad_operators + +let wrap_error_lwt x = x >>= fun x -> Lwt.return @@ Environment.wrap_tzresult x + +let context_init_with_sc_rollup_enabled tup = + Context.init_with_constants_gen + tup + { + Context.default_test_constants with + consensus_threshold = 0; + sc_rollup = {Context.default_test_constants.sc_rollup with enable = true}; + } + +let sc_originate block contract parameters_ty = + let open Lwt_result_syntax in + let kind = Sc_rollup.Kind.Example_arith in + let* operation, rollup = + Op.sc_rollup_origination + ~counter:(Manager_counter.Internal_for_tests.of_int 0) + (B block) + contract + kind + ~boot_sector:"" + ~parameters_ty:(Script.lazy_expr @@ Expr.from_string parameters_ty) + in + let* incr = Incremental.begin_construction block in + let* incr = Incremental.add_operation incr operation in + let* block = Incremental.finalize_block incr in + return (block, rollup) + +(* Test for Script_ir_translator.parse_and_unparse_script_unaccounted on a + script declaring views. *) +let test_unparse_view () = + let dummy_contract = + "{parameter unit; storage unit; code { CAR; NIL operation; PAIR }; view \ + \"v0\" unit unit { DROP; UNIT }; view \"v1\" nat nat {CAR}}" + in + let contract_expr = Expr.from_string dummy_contract in + let storage_expr = Expr.from_string "Unit" in + let bef = Script.lazy_expr contract_expr |> Data_encoding.force_bytes in + let script = + Script.{code = lazy_expr contract_expr; storage = lazy_expr storage_expr} + in + Context.init3 () >>=? fun (b, _cs) -> + Incremental.begin_construction b >>=? fun v -> + let ctx = Incremental.alpha_ctxt v in + Script_ir_translator.parse_and_unparse_script_unaccounted + ctx + ~legacy:true + ~allow_forged_in_storage:false + Readable + ~normalize_types:true + script + >>=?? fun (unparsed_script, _ctx) -> + let aft = Data_encoding.force_bytes unparsed_script.code in + Alcotest.(check bytes) "didn't match" bef aft |> return + +let test_context () = + Context.init3 ~consensus_threshold:0 () >>=? fun (b, _cs) -> + Incremental.begin_construction b >>=? fun v -> + return (Incremental.alpha_ctxt v) + +let test_context_with_nat_nat_big_map ?(sc_rollup_enable = false) () = + Context.init_with_constants1 + { + Context.default_test_constants with + sc_rollup = + { + Context.default_test_constants.sc_rollup with + enable = sc_rollup_enable; + }; + } + >>=? fun (b, source) -> + Op.contract_origination_hash (B b) source ~script:Op.dummy_script + >>=? fun (operation, originated) -> + Block.bake ~operation b >>=? fun b -> + Incremental.begin_construction b >>=? fun v -> + let ctxt = Incremental.alpha_ctxt v in + wrap_error_lwt @@ Big_map.fresh ~temporary:false ctxt >>=? fun (ctxt, id) -> + let nat_ty = Script_typed_ir.nat_t in + wrap_error_lwt @@ Lwt.return + @@ Script_ir_unparser.unparse_ty ~loc:() ctxt nat_ty + >>=? fun (nat_ty_node, ctxt) -> + let nat_ty_expr = Micheline.strip_locations nat_ty_node in + let alloc = Big_map.{key_type = nat_ty_expr; value_type = nat_ty_expr} in + let init = Lazy_storage.Alloc alloc in + let diffs = + [ + Lazy_storage.make + Lazy_storage.Kind.Big_map + id + (Update {init; updates = []}); + ] + in + wrap_error_lwt + @@ Contract.update_script_storage ctxt originated nat_ty_expr (Some diffs) + >>=? fun ctxt -> return (ctxt, id) + +let read_file filename = + let ch = open_in filename in + let s = really_input_string ch (in_channel_length ch) in + close_in ch ; + s + +(** Check that the custom stack overflow exception is triggered when + it should be. *) +let test_typecheck_stack_overflow () = + test_context () >>=? fun ctxt -> + let storage = "Unit" in + let parameter = "Unit" in + let script = read_file "./contracts/big_interpreter_stack.tz" in + Contract_helpers.run_script ctxt script ~storage ~parameter () >>= function + | Ok _ -> Alcotest.fail "expected an error" + | Error lst + when List.mem + ~equal:( = ) + (Environment.Ecoproto_error + Script_tc_errors.Typechecking_too_many_recursive_calls) + lst -> + return () + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +(* NOTE: this test fails with an out-of-memory exception. *) +let _test_unparse_stack_overflow () = + test_context () >>=? fun ctxt -> + (* Meme *) + let enorme_et_seq n = + let rec aux n acc = aux (n - 1) @@ Micheline.Seq (0, [acc]) in + aux n (Micheline.Int (0, Z.zero)) + in + Script_ir_translator.(unparse_code ctxt Readable (enorme_et_seq 10_001)) + >>= function + | Ok _ -> Alcotest.fail "expected an error" + | Error trace -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + let expect_id = "michelson_v1.unparsing_stack_overflow" in + let expect_descrfiption = + "Too many recursive calls were needed for unparsing" + in + if + Astring.String.is_infix ~affix:expect_id trace_string + && Astring.String.is_infix ~affix:expect_descrfiption trace_string + then return_unit + else + Alcotest.failf + "Unexpected error (%s) at %s" + trace_string + __LOC__ + return_unit + +let location = function + | Prim (loc, _, _, _) + | Int (loc, _) + | String (loc, _) + | Bytes (loc, _) + | Seq (loc, _) -> + loc + +let test_parse_ty (type exp expc) ctxt node + (expected : (exp, expc) Script_typed_ir.ty) = + let legacy = false in + let allow_lazy_storage = true in + let allow_operation = true in + let allow_contract = true in + let allow_ticket = true in + Environment.wrap_tzresult + ( Script_ir_translator.parse_ty + ctxt + ~legacy + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + node + >>? fun (Script_typed_ir.Ex_ty actual, ctxt) -> + Gas_monad.run ctxt + @@ Script_ir_translator.ty_eq + ~error_details:(Informative (location node)) + actual + expected + >>? fun (eq, ctxt) -> + eq >|? fun Eq -> ctxt ) + +let test_parse_comb_type () = + let open Script in + let open Script_typed_ir in + let nat_prim = Prim (-1, T_nat, [], []) in + let nat_prim_a = Prim (-1, T_nat, [], ["%a"]) in + let nat_prim_b = Prim (-1, T_nat, [], ["%b"]) in + let nat_prim_c = Prim (-1, T_nat, [], ["%c"]) in + let nat_ty = nat_t in + let pair_prim l = Prim (-1, T_pair, l, []) in + let pair_ty ty1 ty2 = pair_t (-1) ty1 ty2 in + let pair_prim2 a b = pair_prim [a; b] in + let pair_nat_nat_prim = pair_prim2 nat_prim nat_prim in + pair_ty nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_nat_ty) -> + test_context () >>=? fun ctxt -> + (* pair nat nat *) + test_parse_ty ctxt pair_nat_nat_prim pair_nat_nat_ty >>?= fun ctxt -> + (* pair (pair nat nat) nat *) + pair_ty pair_nat_nat_ty nat_ty >>??= fun (Ty_ex_c pair_pair_nat_nat_nat_ty) -> + test_parse_ty + ctxt + (pair_prim2 pair_nat_nat_prim nat_prim) + pair_pair_nat_nat_nat_ty + >>?= fun ctxt -> + (* pair nat (pair nat nat) *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun (Ty_ex_c pair_nat_pair_nat_nat_ty) -> + test_parse_ty + ctxt + (pair_prim2 nat_prim pair_nat_nat_prim) + pair_nat_pair_nat_nat_ty + >>?= fun ctxt -> + (* pair nat nat nat *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun (Ty_ex_c pair_nat_nat_nat_ty) -> + test_parse_ty + ctxt + (pair_prim [nat_prim; nat_prim; nat_prim]) + pair_nat_nat_nat_ty + >>?= fun ctxt -> + (* pair (nat %a) nat *) + pair_t (-1) nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_a_nat_ty) -> + test_parse_ty ctxt (pair_prim2 nat_prim_a nat_prim) pair_nat_a_nat_ty + >>?= fun ctxt -> + (* pair nat (nat %b) *) + pair_t (-1) nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_nat_b_ty) -> + test_parse_ty ctxt (pair_prim2 nat_prim nat_prim_b) pair_nat_nat_b_ty + >>?= fun ctxt -> + (* pair (nat %a) (nat %b) *) + pair_t (-1) nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_a_nat_b_ty) -> + test_parse_ty ctxt (pair_prim2 nat_prim_a nat_prim_b) pair_nat_a_nat_b_ty + >>?= fun ctxt -> + (* pair (nat %a) (nat %b) (nat %c) *) + pair_t (-1) nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_b_nat_c_ty) -> + pair_t (-1) nat_ty pair_nat_b_nat_c_ty + >>??= fun (Ty_ex_c pair_nat_a_nat_b_nat_c_ty) -> + test_parse_ty + ctxt + (pair_prim [nat_prim_a; nat_prim_b; nat_prim_c]) + pair_nat_a_nat_b_nat_c_ty + >>?= fun ctxt -> + (* pair (nat %a) (pair %b nat nat) *) + pair_t (-1) nat_ty nat_ty >>??= fun (Ty_ex_c pair_b_nat_nat_ty) -> + pair_t (-1) nat_ty pair_b_nat_nat_ty + >>??= fun (Ty_ex_c pair_nat_a_pair_b_nat_nat_ty) -> + test_parse_ty + ctxt + (pair_prim2 nat_prim_a (Prim (-1, T_pair, [nat_prim; nat_prim], ["%b"]))) + pair_nat_a_pair_b_nat_nat_ty + >>?= fun (_ : context) -> return_unit + +let test_unparse_ty loc ctxt expected ty = + Environment.wrap_tzresult + ( Script_ir_unparser.unparse_ty ~loc:() ctxt ty >>? fun (actual, ctxt) -> + if actual = expected then ok ctxt + else Alcotest.failf "Unexpected error: %s" loc ) + +let test_unparse_comb_type () = + let open Script in + let open Script_typed_ir in + let nat_prim = Prim ((), T_nat, [], []) in + let nat_ty = nat_t in + let pair_prim l = Prim ((), T_pair, l, []) in + let pair_ty ty1 ty2 = pair_t (-1) ty1 ty2 in + let pair_prim2 a b = pair_prim [a; b] in + let pair_nat_nat_prim = pair_prim2 nat_prim nat_prim in + pair_ty nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_nat_ty) -> + test_context () >>=? fun ctxt -> + (* pair nat nat *) + test_unparse_ty __LOC__ ctxt pair_nat_nat_prim pair_nat_nat_ty + >>?= fun ctxt -> + (* pair (pair nat nat) nat *) + pair_ty pair_nat_nat_ty nat_ty >>??= fun (Ty_ex_c pair_pair_nat_nat_nat_ty) -> + test_unparse_ty + __LOC__ + ctxt + (pair_prim2 pair_nat_nat_prim nat_prim) + pair_pair_nat_nat_nat_ty + >>?= fun ctxt -> + (* pair nat nat nat *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun (Ty_ex_c pair_nat_nat_nat_ty) -> + test_unparse_ty + __LOC__ + ctxt + (pair_prim [nat_prim; nat_prim; nat_prim]) + pair_nat_nat_nat_ty + >>?= fun (_ : context) -> return_unit + +let test_unparse_comparable_ty loc ctxt expected ty = + (* unparse_comparable_ty is not exported, the simplest way to call it is to + call parse_ty on a set type *) + let open Script_typed_ir in + Environment.wrap_tzresult + ( set_t (-1) ty >>? fun set_ty_ty -> + Script_ir_unparser.unparse_ty ~loc:() ctxt set_ty_ty + >>? fun (actual, ctxt) -> + if actual = Prim ((), T_set, [expected], []) then ok ctxt + else Alcotest.failf "Unexpected error: %s" loc ) + +let test_unparse_comb_comparable_type () = + let open Script in + let open Script_typed_ir in + let nat_prim = Prim ((), T_nat, [], []) in + let nat_ty = nat_t in + let pair_prim l = Prim ((), T_pair, l, []) in + let pair_ty ty1 ty2 = comparable_pair_t (-1) ty1 ty2 in + let pair_prim2 a b = pair_prim [a; b] in + let pair_nat_nat_prim = pair_prim2 nat_prim nat_prim in + pair_ty nat_ty nat_ty >>??= fun pair_nat_nat_ty -> + test_context () >>=? fun ctxt -> + (* pair nat nat *) + test_unparse_comparable_ty __LOC__ ctxt pair_nat_nat_prim pair_nat_nat_ty + >>?= fun ctxt -> + (* pair (pair nat nat) nat *) + pair_ty pair_nat_nat_ty nat_ty >>??= fun pair_pair_nat_nat_nat_ty -> + test_unparse_comparable_ty + __LOC__ + ctxt + (pair_prim2 pair_nat_nat_prim nat_prim) + pair_pair_nat_nat_nat_ty + >>?= fun ctxt -> + (* pair nat nat nat *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun pair_nat_nat_nat_ty -> + test_unparse_comparable_ty + __LOC__ + ctxt + (pair_prim [nat_prim; nat_prim; nat_prim]) + pair_nat_nat_nat_ty + >>?= fun (_ : context) -> return_unit + +let test_parse_data ?(equal = Stdlib.( = )) loc ctxt ty node expected = + let elab_conf = Script_ir_translator_config.make ~legacy:false () in + let allow_forged = true in + wrap_error_lwt + ( Script_ir_translator.parse_data ctxt ~elab_conf ~allow_forged ty node + >>=? fun (actual, ctxt) -> + if equal actual expected then return ctxt + else Alcotest.failf "Unexpected error: %s" loc ) + +let test_parse_data_fails loc ctxt ty node = + let elab_conf = Script_ir_translator_config.make ~legacy:false () in + let allow_forged = false in + wrap_error_lwt + (Script_ir_translator.parse_data ctxt ~elab_conf ~allow_forged ty node + >>= function + | Ok _ -> Alcotest.failf "Unexpected typechecking success: %s" loc + | Error trace -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + let expect_id = "michelson_v1.invalid_constant" in + let expect_descrfiption = + "A data expression was invalid for its expected type." + in + if + Astring.String.is_infix ~affix:expect_id trace_string + && Astring.String.is_infix ~affix:expect_descrfiption trace_string + then return_unit + else + Alcotest.failf + "Unexpected error (%s) at %s" + trace_string + __LOC__ + return_unit) + +let test_parse_comb_data () = + let open Script in + let open Script_typed_ir in + let z = Script_int.zero_n in + let z_prim = Micheline.Int (-1, Z.zero) in + let nat_ty = nat_t in + let pair_prim l = Prim (-1, D_Pair, l, []) in + let pair_ty ty1 ty2 = pair_t (-1) ty1 ty2 in + pair_ty nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_nat_ty) -> + let pair_prim2 a b = pair_prim [a; b] in + let pair_z_z_prim = pair_prim2 z_prim z_prim in + list_t (-1) nat_ty >>??= fun list_nat_ty -> + big_map_t (-1) nat_ty nat_ty >>??= fun big_map_nat_nat_ty -> + test_context_with_nat_nat_big_map () >>=? fun (ctxt, big_map_id) -> + (* Pair 0 0 *) + test_parse_data __LOC__ ctxt pair_nat_nat_ty pair_z_z_prim (z, z) + >>=? fun ctxt -> + (* {0; 0} *) + test_parse_data + __LOC__ + ctxt + pair_nat_nat_ty + (Micheline.Seq (-1, [z_prim; z_prim])) + (z, z) + >>=? fun ctxt -> + (* Pair (Pair 0 0) 0 *) + pair_ty pair_nat_nat_ty nat_ty >>??= fun (Ty_ex_c pair_pair_nat_nat_nat_ty) -> + test_parse_data + __LOC__ + ctxt + pair_pair_nat_nat_nat_ty + (pair_prim2 pair_z_z_prim z_prim) + ((z, z), z) + >>=? fun ctxt -> + (* Pair 0 (Pair 0 0) *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun (Ty_ex_c pair_nat_pair_nat_nat_ty) -> + test_parse_data + __LOC__ + ctxt + pair_nat_pair_nat_nat_ty + (pair_prim2 z_prim pair_z_z_prim) + (z, (z, z)) + >>=? fun ctxt -> + (* Pair 0 0 0 *) + test_parse_data + __LOC__ + ctxt + pair_nat_pair_nat_nat_ty + (pair_prim [z_prim; z_prim; z_prim]) + (z, (z, z)) + >>=? fun ctxt -> + (* {0; 0; 0} *) + test_parse_data + __LOC__ + ctxt + pair_nat_pair_nat_nat_ty + (Micheline.Seq (-1, [z_prim; z_prim; z_prim])) + (z, (z, z)) + >>=? fun ctxt -> + (* Should fail: {0} against pair nat (list nat) *) + pair_ty nat_ty list_nat_ty >>??= fun (Ty_ex_c pair_nat_list_nat_ty) -> + test_parse_data_fails + __LOC__ + ctxt + pair_nat_list_nat_ty + (Micheline.Seq (-1, [z_prim])) + >>=? fun () -> + (* Should fail: {0; 0; 0} against pair nat (list nat) *) + test_parse_data_fails + __LOC__ + ctxt + pair_nat_list_nat_ty + (Micheline.Seq (-1, [z_prim; z_prim; z_prim])) + >>=? fun () -> + (* check Pair 0 (Pair 0 {}) against pair nat (big_map nat nat) + so that the following test fails for the good reason and not because + the big map doesn't exist + *) + let id_z = Big_map.Id.unparse_to_z big_map_id in + let id_prim = Int (-1, id_z) in + let expected_big_map = + let open Script_typed_ir in + let diff = {map = Big_map_overlay.empty; size = 0} in + Big_map {id = Some big_map_id; diff; key_type = nat_ty; value_type = nat_ty} + in + let ty_equal : + type a ac1 ac2. + (a, ac1) Script_typed_ir.ty -> (a, ac2) Script_typed_ir.ty -> bool = + fun ty1 ty2 -> + match Script_typed_ir.(is_comparable ty1, is_comparable ty2) with + | Yes, Yes -> ty1 = ty2 + | No, No -> ty1 = ty2 + | Yes, No -> assert false + | No, Yes -> assert false + (* + These last two cases can't happen because the comparable character of a + type is a function of its concrete type. + It is possible to write a function that proves it but it is not needed + in the protocol for the moment. + *) + in + let equal (nat1, Big_map big_map1) (nat2, Big_map big_map2) = + (* Custom equal needed because big maps contain boxed maps containing functional values *) + nat1 = nat2 && big_map1.id = big_map2.id + && big_map1.key_type = big_map2.key_type + && ty_equal big_map1.value_type big_map2.value_type + && big_map1.diff.size = big_map2.diff.size + && Big_map_overlay.bindings big_map1.diff.map + = Big_map_overlay.bindings big_map2.diff.map + in + pair_ty nat_ty big_map_nat_nat_ty + >>??= fun (Ty_ex_c pair_nat_big_map_nat_nat_ty) -> + test_parse_data + ~equal + __LOC__ + ctxt + pair_nat_big_map_nat_nat_ty + (pair_prim2 z_prim (pair_prim2 id_prim (Seq (-1, [])))) + (Script_int.zero_n, expected_big_map) + >>=? fun ctxt -> + (* Should fail: Pair 0 0 {} against pair nat (big_map nat nat) *) + test_parse_data_fails + __LOC__ + ctxt + pair_nat_big_map_nat_nat_ty + (pair_prim [z_prim; id_prim; Seq (-1, [])]) + +let test_parse_address () = + let open Script_typed_ir in + test_context_with_nat_nat_big_map ~sc_rollup_enable:true () + >>=? fun (ctxt, _big_map_id) -> + (* KT1% (empty entrypoint) *) + wrap_error_lwt + (Lwt.return (Contract.of_b58check "KT1FAKEFAKEFAKEFAKEFAKEFAKEFAKGGSE2x")) + >>=? fun kt1fake -> + test_parse_data + __LOC__ + ctxt + address_t + (String (-1, "KT1FAKEFAKEFAKEFAKEFAKEFAKEFAKGGSE2x%")) + {destination = Contract kt1fake; entrypoint = Entrypoint.default} + >>=? fun ctxt -> + (* tz1% (empty entrypoint) *) + wrap_error_lwt + (Lwt.return (Contract.of_b58check "tz1fakefakefakefakefakefakefakcphLA5")) + >>=? fun tz1fake -> + test_parse_data + __LOC__ + ctxt + address_t + (String (-1, "tz1fakefakefakefakefakefakefakcphLA5%")) + {destination = Contract tz1fake; entrypoint = Entrypoint.default} + >>=? fun ctxt -> + (* scr1% (empty entrypoint) *) + wrap_error_lwt + (Lwt.return + (Destination.of_b58check "sr1JPVatbbPoGp4vb6VfQ1jzEPMrYFcKq6VG")) + >>=? fun scr1 -> + test_parse_data + __LOC__ + ctxt + address_t + (String (-1, "sr1JPVatbbPoGp4vb6VfQ1jzEPMrYFcKq6VG")) + {destination = scr1; entrypoint = Entrypoint.default} + >>=? fun ctxt -> + (* scr1% (default entrypoint) *) + test_parse_data + __LOC__ + ctxt + address_t + (String (-1, "sr1JPVatbbPoGp4vb6VfQ1jzEPMrYFcKq6VG%")) + {destination = scr1; entrypoint = Entrypoint.default} + >|=? fun (_ctxt : context) -> () + +let test_unparse_data loc ctxt ty x ~expected_readable ~expected_optimized = + wrap_error_lwt + ( Script_ir_translator.unparse_data ctxt Script_ir_unparser.Readable ty x + >>=? fun (actual_readable, ctxt) -> + (if actual_readable = Micheline.strip_locations expected_readable then + return ctxt + else Alcotest.failf "Error in readable unparsing: %s" loc) + >>=? fun ctxt -> + Script_ir_translator.unparse_data ctxt Script_ir_unparser.Optimized ty x + >>=? fun (actual_optimized, ctxt) -> + if actual_optimized = Micheline.strip_locations expected_optimized then + return ctxt + else Alcotest.failf "Error in optimized unparsing: %s" loc ) + +let test_unparse_comb_data () = + let open Script in + let open Script_typed_ir in + let z = Script_int.zero_n in + let z_prim = Micheline.Int (-1, Z.zero) in + let nat_ty = nat_t in + let pair_prim l = Prim (-1, D_Pair, l, []) in + let pair_ty ty1 ty2 = pair_t (-1) ty1 ty2 in + pair_ty nat_ty nat_ty >>??= fun (Ty_ex_c pair_nat_nat_ty) -> + let pair_prim2 a b = pair_prim [a; b] in + let pair_z_z_prim = pair_prim2 z_prim z_prim in + test_context () >>=? fun ctxt -> + (* Pair 0 0 *) + test_unparse_data + __LOC__ + ctxt + pair_nat_nat_ty + (z, z) + ~expected_readable:pair_z_z_prim + ~expected_optimized:pair_z_z_prim + >>=? fun ctxt -> + (* Pair (Pair 0 0) 0 *) + pair_ty pair_nat_nat_ty nat_ty >>??= fun (Ty_ex_c pair_pair_nat_nat_nat_ty) -> + test_unparse_data + __LOC__ + ctxt + pair_pair_nat_nat_nat_ty + ((z, z), z) + ~expected_readable:(pair_prim2 pair_z_z_prim z_prim) + ~expected_optimized:(pair_prim2 pair_z_z_prim z_prim) + >>=? fun ctxt -> + (* Readable: Pair 0 0 0; Optimized: Pair 0 (Pair 0 0) *) + pair_ty nat_ty pair_nat_nat_ty >>??= fun (Ty_ex_c pair_nat_pair_nat_nat_ty) -> + test_unparse_data + __LOC__ + ctxt + pair_nat_pair_nat_nat_ty + (z, (z, z)) + ~expected_readable:(pair_prim [z_prim; z_prim; z_prim]) + ~expected_optimized:(pair_prim2 z_prim pair_z_z_prim) + >>=? fun ctxt -> + (* Readable: Pair 0 0 0 0; Optimized: {0; 0; 0; 0} *) + pair_ty nat_ty pair_nat_pair_nat_nat_ty + >>??= fun (Ty_ex_c pair_nat_pair_nat_pair_nat_nat_ty) -> + test_unparse_data + __LOC__ + ctxt + pair_nat_pair_nat_pair_nat_nat_ty + (z, (z, (z, z))) + ~expected_readable:(pair_prim [z_prim; z_prim; z_prim; z_prim]) + ~expected_optimized:(Micheline.Seq (-1, [z_prim; z_prim; z_prim; z_prim])) + >>=? fun (_ : context) -> return_unit + +(* Generate all the possible syntaxes for pairs *) +let gen_pairs left right = + [Prim ((), Script.D_Pair, [left; right], []); Seq ((), [left; right])] + +(* Generate all the possible syntaxes for combs *) +let rec gen_combs leaf arity = + assert (arity >= 2) ; + if arity = 2 then gen_pairs leaf leaf + else + gen_combs leaf (arity - 1) + |> List.map (fun smaller -> + (match smaller with + | Prim (loc, Script.D_Pair, vs, []) -> + Prim (loc, Script.D_Pair, leaf :: vs, []) + | Seq (loc, vs) -> Seq (loc, leaf :: vs) + | _ -> assert false) + :: gen_pairs leaf smaller) + |> List.flatten + +(* Checks the optimality of the Optimized Micheline representation for combs *) +let test_optimal_comb () = + let open Script_typed_ir in + let leaf_ty = nat_t in + let leaf_mich = Int ((), Z.zero) in + let leaf_v = Script_int.zero_n in + let size_of_micheline mich = + let canonical = Micheline.strip_locations mich in + ( canonical, + Bytes.length + @@ Data_encoding.Binary.to_bytes_exn Script.expr_encoding canonical ) + in + let check_optimal_comb loc ctxt ty v arity = + wrap_error_lwt + ( Script_ir_translator.unparse_data ctxt Script_ir_unparser.Optimized ty v + >>=? fun (unparsed, ctxt) -> + let unparsed_canonical, unparsed_size = + size_of_micheline (Micheline.root unparsed) + in + List.iter_es (fun other_repr -> + let other_repr_canonical, other_repr_size = + size_of_micheline other_repr + in + if other_repr_size < unparsed_size then + Alcotest.failf + "At %s, for comb of arity %d, representation %a (size %d \ + bytes) is shorter than representation %a (size %d bytes) \ + returned by unparse_data in Optimized mode" + loc + arity + Michelson_v1_printer.print_expr + other_repr_canonical + other_repr_size + Michelson_v1_printer.print_expr + unparsed_canonical + unparsed_size + else return_unit) + @@ gen_combs leaf_mich arity + >>=? fun () -> return ctxt ) + in + let pair_ty ty1 ty2 = pair_t (-1) ty1 ty2 in + test_context () >>=? fun ctxt -> + pair_ty leaf_ty leaf_ty >>??= fun (Ty_ex_c comb2_ty) -> + let comb2_v = (leaf_v, leaf_v) in + check_optimal_comb __LOC__ ctxt comb2_ty comb2_v 2 >>=? fun ctxt -> + pair_ty leaf_ty comb2_ty >>??= fun (Ty_ex_c comb3_ty) -> + let comb3_v = (leaf_v, comb2_v) in + check_optimal_comb __LOC__ ctxt comb3_ty comb3_v 3 >>=? fun ctxt -> + pair_ty leaf_ty comb3_ty >>??= fun (Ty_ex_c comb4_ty) -> + let comb4_v = (leaf_v, comb3_v) in + check_optimal_comb __LOC__ ctxt comb4_ty comb4_v 4 >>=? fun ctxt -> + pair_ty leaf_ty comb4_ty >>??= fun (Ty_ex_c comb5_ty) -> + let comb5_v = (leaf_v, comb4_v) in + check_optimal_comb __LOC__ ctxt comb5_ty comb5_v 5 >>=? fun (_ : context) -> + return_unit + +(* Check that UNPACK on contract is forbidden. + See https://gitlab.com/tezos/tezos/-/issues/301 for the motivation + behind this restriction. +*) +let test_contract_not_packable () = + let elab_conf = Script_ir_translator_config.make ~legacy:false () in + let contract_unit = + Prim (0, Script.T_contract, [Prim (0, T_unit, [], [])], []) + in + test_context () >>=? fun ctxt -> + (* Test that [contract_unit] is parsable *) + (match Script_ir_translator.parse_any_ty ctxt ~legacy:false contract_unit with + | Ok _ -> return_unit + | Error _ -> Alcotest.failf "Could not parse (contract unit)") + >>=? fun () -> + (* Test that [contract_unit] is not packable *) + (match + Script_ir_translator.parse_packable_ty ctxt ~legacy:false contract_unit + with + | Ok _ -> + Alcotest.failf + "(contract unit) should not be packable, see \ + https://gitlab.com/tezos/tezos/-/issues/301" + | Error _ -> return_unit) + >>=? fun () -> + (* Test that elaboration of the [UNPACK unit] instruction succeeds *) + (Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf + (Prim (0, I_UNPACK, [Prim (0, T_unit, [], [])], [])) + (Item_t (Script_typed_ir.bytes_t, Bot_t)) + >>= function + | Ok _ -> return_unit + | Error _ -> Alcotest.failf "Could not parse UNPACK unit") + >>=? fun () -> + (* Test that elaboration of the [UNPACK (contract unit)] instruction fails *) + Script_ir_translator.parse_instr + Script_tc_context.data + ctxt + ~elab_conf + (Prim (0, I_UNPACK, [contract_unit], [])) + (Item_t (Script_typed_ir.bytes_t, Bot_t)) + >>= function + | Ok _ -> + Alcotest.failf + "UNPACK (contract unit) should not be allowed, see \ + https://gitlab.com/tezos/tezos/-/issues/301" + | Error _ -> return_unit + +(* This test function is used to checks forbidden operations in views. *) +let test_forbidden_op_in_view op () = + let prefix = "./contracts/forbidden_op_in_view_" in + let script = read_file (prefix ^ op ^ ".tz") in + let contract_expr = Expr.from_string script in + test_context () >>=? fun ctxt -> + Script_ir_translator.typecheck_code + ~legacy:false + ~show_types:false + ctxt + contract_expr + >>= function + | Ok _ -> + Alcotest.failf + "%s should not be allowed in views, see \ + https://gitlab.com/tezos/tezos/-/issues/1922" + op + | Error _ -> return_unit + +(** Test [parse_contract_data] for rollup with unit type. *) +let test_parse_contract_data_for_unit_rollup () = + let open Lwt_result_syntax in + let* block, (contract, _) = context_init_with_sc_rollup_enabled T2 in + let* block, rollup = sc_originate block contract "unit" in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let* _ctxt, typed_contract = + wrap_error_lwt + @@ Script_ir_translator.parse_contract_data + ctxt + (-1) + Script_typed_ir.unit_t + (Destination.Sc_rollup rollup) + ~entrypoint:Entrypoint.default + in + let (Ty_ex_c Script_typed_ir.Unit_t) = + Script_typed_ir.Typed_contract.arg_ty typed_contract + in + let destination = Script_typed_ir.Typed_contract.destination typed_contract in + let entrypoint = Script_typed_ir.Typed_contract.entrypoint typed_contract in + (* Check that the destinations match. *) + let* () = + Assert.equal_string + ~loc:__LOC__ + (Destination.to_b58check destination) + (Sc_rollup.Address.to_b58check rollup) + in + (* Check that entrypoints match. *) + let* () = + Assert.equal_string ~loc:__LOC__ (Entrypoint.to_string entrypoint) "default" + in + return () + +(** Test that [parse_contract_data] for rollup with invalid type fails. *) +let test_parse_contract_data_for_rollup_with_invalid_type () = + let open Lwt_result_syntax in + let* block, (contract, _) = context_init_with_sc_rollup_enabled T2 in + let* block, rollup = sc_originate block contract "string" in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let entrypoint = Entrypoint.of_string_strict_exn "add" in + let*! res = + wrap_error_lwt + @@ Script_ir_translator.parse_contract_data + ctxt + (-1) + Script_typed_ir.unit_t + (Destination.Sc_rollup rollup) + ~entrypoint + in + Assert.proto_error + ~loc:__LOC__ + res + (( = ) (Script_tc_errors.No_such_entrypoint entrypoint)) + +let test_contract path ~ok ~ko () = + let contract = path in + let script = read_file contract in + let contract_expr = Expr.from_string script in + test_context () >>=? fun ctxt -> + Script_ir_translator.typecheck_code + ~legacy:false + ~show_types:false + ctxt + contract_expr + >>= function + | Ok _ -> ok () + | Error t -> ko t + +let test_contract_success path = + test_contract path ~ok:return ~ko:(fun t -> + Alcotest.failf "Unexpected error: %a" Environment.Error_monad.pp_trace t) + +let test_contract_failure path = + test_contract + path + ~ok:(fun () -> + Alcotest.failf + "Unexpected success: typechecking %s should have failed" + path) + ~ko:(fun _ -> return_unit) + +let tests = + [ + Tztest.tztest "test unparse view" `Quick test_unparse_view; + Tztest.tztest + "test typecheck stack overflow error" + `Quick + test_typecheck_stack_overflow; + Tztest.tztest "test comb type parsing" `Quick test_parse_comb_type; + Tztest.tztest "test comb type unparsing" `Quick test_unparse_comb_type; + Tztest.tztest + "test comb comparable type unparsing" + `Quick + test_unparse_comb_comparable_type; + Tztest.tztest "test comb data parsing" `Quick test_parse_comb_data; + Tztest.tztest "test comb data unparsing" `Quick test_unparse_comb_data; + Tztest.tztest "test optimal comb data unparsing" `Quick test_optimal_comb; + Tztest.tztest "test parse address" `Quick test_parse_address; + Tztest.tztest + "test unpackability of the contract type" + `Quick + test_contract_not_packable; + Tztest.tztest + "test forbidden SELF in view" + `Quick + (test_forbidden_op_in_view "SELF"); + Tztest.tztest + "test forbidden SET_DELEGATE in view" + `Quick + (test_forbidden_op_in_view "SET_DELEGATE"); + Tztest.tztest + "test forbidden TRANSFER_TOKENS in view" + `Quick + (test_forbidden_op_in_view "TRANSFER_TOKENS"); + Tztest.tztest + "test forbidden CREATE_CONTRACT in view" + `Quick + (test_forbidden_op_in_view "CREATE_CONTRACT"); + Tztest.tztest + "test parse contract data for rollup" + `Quick + test_parse_contract_data_for_unit_rollup; + Tztest.tztest + "test parse contract data for rollup with entrypoint invalid type" + `Quick + test_parse_contract_data_for_rollup_with_invalid_type; + Tztest.tztest + "test lambda_rec instruction" + `Quick + (test_contract_success "./contracts/rec_fact.tz"); + Tztest.tztest + "test lambda_rec instruction with apply" + `Quick + (test_contract_success "./contracts/rec_fact_apply.tz"); + Tztest.tztest + "test lambda_rec with type error" + `Quick + (test_contract_failure "./contracts/fail_rec.tz"); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit.tz new file mode 100644 index 000000000000..e07e83aa7195 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit.tz @@ -0,0 +1,34 @@ +parameter (pair address tx_rollup_l2_address); +storage (unit); +code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %deposit (pair (ticket unit) tx_rollup_l2_address); + + IF_SOME { + SWAP; + + # amount for transfering + PUSH mutez 0; + SWAP; + + # create a ticket + PUSH nat 100000; + PUSH unit Unit; + TICKET; + ASSERT_SOME; + + PAIR ; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_entrypoint.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_entrypoint.tz new file mode 100644 index 000000000000..f029a2583085 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_entrypoint.tz @@ -0,0 +1,34 @@ +parameter (pair address tx_rollup_l2_address); +storage (unit); +code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %default (pair (ticket unit) tx_rollup_l2_address); + + IF_SOME { + SWAP; + + # amount for transfering + PUSH mutez 0; + SWAP; + + # create a ticket + PUSH nat 10; + PUSH unit Unit; + TICKET; + ASSERT_SOME; + + PAIR ; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_param.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_param.tz new file mode 100644 index 000000000000..96590ef8a61e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_incorrect_param.tz @@ -0,0 +1,25 @@ +parameter (address); +storage (unit); +code { + # cast the address to contract type + CAR; + CONTRACT %deposit (nat); + + IF_SOME { + # amount for transfering + PUSH mutez 0; + + # create a ticket + PUSH nat 100; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } \ No newline at end of file diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_one_mutez.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_one_mutez.tz new file mode 100644 index 000000000000..82aa389266a5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_one_mutez.tz @@ -0,0 +1,34 @@ +parameter (pair address tx_rollup_l2_address); +storage (unit); +code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %deposit (pair (ticket unit) tx_rollup_l2_address); + + IF_SOME { + SWAP; + + # amount for transfering + PUSH mutez 1; + SWAP; + + # create a ticket + PUSH nat 10; + PUSH unit Unit; + TICKET; + ASSERT_SOME; + + PAIR ; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_pair_string.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_pair_string.tz new file mode 100644 index 000000000000..d554c713f056 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_pair_string.tz @@ -0,0 +1,36 @@ +parameter (pair address tx_rollup_l2_address string); +storage (unit); +code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %deposit (pair (ticket (pair unit string)) tx_rollup_l2_address); + + IF_SOME { + SWAP; + UNPAIR; SWAP; + + # create a ticket + PUSH nat 10; + SWAP; + UNIT; + PAIR; + TICKET; + ASSERT_SOME; + PAIR; + + # amount for transfering + PUSH mutez 0; + SWAP; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_string.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_string.tz new file mode 100644 index 000000000000..977698a30239 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_deposit_string.tz @@ -0,0 +1,34 @@ +parameter (pair address tx_rollup_l2_address string); +storage (unit); +code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %deposit (pair (ticket string) tx_rollup_l2_address); + + IF_SOME { + SWAP; + UNPAIR; SWAP; + + # create a ticket + PUSH nat 10; + SWAP; + TICKET; + ASSERT_SOME; + PAIR; + + # amount for transfering + PUSH mutez 0; + SWAP; + + # deposit + TRANSFER_TOKENS; + + DIP { NIL operation }; + CONS; + + DIP { PUSH unit Unit }; + PAIR; + } + { FAIL ; } + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_comparable_type.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_comparable_type.tz new file mode 100644 index 000000000000..a14c47861158 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_comparable_type.tz @@ -0,0 +1,7 @@ +parameter unit; +storage unit; +code { + DROP; + EMPTY_SET tx_rollup_l2_address; DROP; + UNIT; NIL operation; PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_data.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_data.tz new file mode 100644 index 000000000000..3955efd6129c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_data.tz @@ -0,0 +1,7 @@ +parameter unit; +storage unit; +code { + DROP; + PUSH address "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi"; DROP; + UNIT; NIL operation; PAIR; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_type.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_type.tz new file mode 100644 index 000000000000..8756195f7f5e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_parse_type.tz @@ -0,0 +1,3 @@ +parameter tx_rollup_l2_address; +storage unit; +code { DROP; UNIT; NIL operation; PAIR; } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz new file mode 100644 index 000000000000..0329b648cd2d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz @@ -0,0 +1,3 @@ +parameter (ticket nat); +storage (option (ticket nat)); +code { CAR ; SOME ; NIL operation ; PAIR } ; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz new file mode 100644 index 000000000000..386c94da1552 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz @@ -0,0 +1,3 @@ +parameter (ticket unit); +storage (option (ticket unit)); +code { CAR ; SOME ; NIL operation ; PAIR } ; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune new file mode 100644 index 000000000000..d20198296492 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune @@ -0,0 +1,28 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + alcotest-lwt + tezos-base + tezos-protocol-016-PtMumbai + tezos-client-alpha + tezos-alpha-test-helpers + tezos-base-test-helpers + tezos-protocol-plugin-alpha) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_alpha + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers + -open Tezos_protocol_plugin_alpha)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (deps (glob_files contracts/*)) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.ml new file mode 100644 index 000000000000..1f33d0e6828c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.ml @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/operations + Subject: Entrypoint +*) + +let () = + Alcotest_lwt.run + "protocol > integration > operations" + [ + ("voting", Test_voting.tests); + ("origination", Test_origination.tests); + ("revelation", Test_reveal.tests); + ("transfer", Test_transfer.tests); + ("activation", Test_activation.tests); + ("paid storage increase", Test_paid_storage_increase.tests); + ("combined", Test_combined_operations.tests); + ("failing_noop operation", Test_failing_noop.tests); + ("tx rollup", Test_tx_rollup.tests); + ("sc rollup", Test_sc_rollup.tests); + ("sc rollup transfer", Test_sc_rollup_transfer.tests); + ("zk rollup", Test_zk_rollup.tests); + ("transfer ticket", Test_transfer_ticket.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml new file mode 100644 index 000000000000..778544462e33 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml @@ -0,0 +1,575 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (activation) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^activation$" + Subject: The activation operation creates an implicit contract from a + registered commitment present in the context. It is + parametrized by a public key hash (pkh) and a secret. + + The commitments are composed of : + - a blinded pkh that can be revealed by the secret ; + - an amount. + + The commitments and the secrets are generated from + /scripts/create_genesis/create_genesis.py and should be + coherent. +*) + +open Protocol +open Alpha_context +open Test_tez + +(* Generated commitments and secrets *) + +let commitments = + List.map + (fun (bpkh, a) -> + Commitment. + { + blinded_public_key_hash = Blinded_public_key_hash.of_b58check_exn bpkh; + amount = Tez.of_mutez_exn (Int64.of_string a); + }) + [ + ("btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", "23932454669343"); + ("btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", "72954577464032"); + ("btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", "217487035428349"); + ("btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", "4092742372031"); + ("btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", "17590039016550"); + ("btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", "26322312350555"); + ("btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", "244951387881443"); + ("btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", "80065050465525"); + ("btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", "3569618927693"); + ("btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", "9034781424478"); + ] + +type secret_account = { + account : public_key_hash; + activation_code : Blinded_public_key_hash.activation_code; + amount : Tez.t; +} + +let secrets () = + (* Exported from proto_alpha client - TODO : remove when relocated to lib_crypto *) + let read_key mnemonic email password = + match Tezos_client_base.Bip39.of_words mnemonic with + | None -> assert false + | Some t -> + (* TODO: unicode normalization (NFKD)... *) + let passphrase = Bytes.(cat (of_string email) (of_string password)) in + let sk = Tezos_client_base.Bip39.to_seed ~passphrase t in + let sk = Bytes.sub sk 0 32 in + let sk : Tezos_crypto.Signature.Secret_key.t = + Ed25519 + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Ed25519.Secret_key.encoding + sk) + in + let pk = Tezos_crypto.Signature.Secret_key.to_public_key sk in + let pkh = Tezos_crypto.Signature.Public_key.hash pk in + (pkh, pk, sk) + in + List.map + (fun (mnemonic, secret, amount, pkh, password, email) -> + let pkh', pk, sk = read_key mnemonic email password in + let pkh = Tezos_crypto.Signature.Public_key_hash.of_b58check_exn pkh in + assert (Tezos_crypto.Signature.Public_key_hash.equal pkh pkh') ; + let account = Account.{pkh; pk; sk} in + Account.add_account account ; + { + account = account.pkh; + activation_code = + Stdlib.Option.get + (Blinded_public_key_hash.activation_code_of_hex secret); + amount = + WithExceptions.Option.to_exn + ~none:(Invalid_argument "tez conversion") + (Tez.of_mutez (Int64.of_string amount)); + }) + [ + ( [ + "envelope"; + "hospital"; + "mind"; + "sunset"; + "cancel"; + "muscle"; + "leisure"; + "thumb"; + "wine"; + "market"; + "exit"; + "lucky"; + "style"; + "picnic"; + "success"; + ], + "0f39ed0b656509c2ecec4771712d9cddefe2afac", + "23932454669343", + "tz1MawerETND6bqJqx8GV3YHUrvMBCDasRBF", + "z0eZHQQGKt", + "cjgfoqmk.wpxnvnup@tezos.example.org" ); + ( [ + "flag"; + "quote"; + "will"; + "valley"; + "mouse"; + "chat"; + "hold"; + "prosper"; + "silk"; + "tent"; + "cruel"; + "cause"; + "demise"; + "bottom"; + "practice"; + ], + "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4", + "72954577464032", + "tz1X4maqF9tC1Yn4jULjHRAyzjAtc25Z68TX", + "MHErskWPE6", + "oklmcktr.ztljnpzc@tezos.example.org" ); + ( [ + "library"; + "away"; + "inside"; + "paper"; + "wise"; + "focus"; + "sweet"; + "expose"; + "require"; + "change"; + "stove"; + "planet"; + "zone"; + "reflect"; + "finger"; + ], + "411dfef031eeecc506de71c9df9f8e44297cf5ba", + "217487035428349", + "tz1SWBY7rWMutEuWS54Pt33MkzAS6eWkUuTc", + "0AO6BzQNfN", + "ctgnkvqm.kvtiybky@tezos.example.org" ); + ( [ + "cruel"; + "fluid"; + "damage"; + "demand"; + "mimic"; + "above"; + "village"; + "alpha"; + "vendor"; + "staff"; + "absent"; + "uniform"; + "fire"; + "asthma"; + "milk"; + ], + "08d7d355bc3391d12d140780b39717d9f46fcf87", + "4092742372031", + "tz1amUjiZaevaxQy5wKn4SSRvVoERCip3nZS", + "9kbZ7fR6im", + "bnyxxzqr.tdszcvqb@tezos.example.org" ); + ( [ + "opera"; + "divorce"; + "easy"; + "myself"; + "idea"; + "aim"; + "dash"; + "scout"; + "case"; + "resource"; + "vote"; + "humor"; + "ticket"; + "client"; + "edge"; + ], + "9b7cad042fba557618bdc4b62837c5f125b50e56", + "17590039016550", + "tz1Zaee3QBtD4ErY1SzqUvyYTrENrExu6yQM", + "suxT5H09yY", + "iilkhohu.otnyuvna@tezos.example.org" ); + ( [ + "token"; + "similar"; + "ginger"; + "tongue"; + "gun"; + "sort"; + "piano"; + "month"; + "hotel"; + "vote"; + "undo"; + "success"; + "hobby"; + "shell"; + "cart"; + ], + "124c0ca217f11ffc6c7b76a743d867c8932e5afd", + "26322312350555", + "tz1geDUUhfXK1EMj7VQdRjug1MoFe6gHWnCU", + "4odVdLykaa", + "kwhlglvr.slriitzy@tezos.example.org" ); + ( [ + "shield"; + "warrior"; + "gorilla"; + "birth"; + "steak"; + "neither"; + "feel"; + "only"; + "liberty"; + "float"; + "oven"; + "extend"; + "pulse"; + "suffer"; + "vapor"; + ], + "ac7a2125beea68caf5266a647f24dce9fea018a7", + "244951387881443", + "tz1h3nY7jcZciJgAwRhWcrEwqfVp7VQoffur", + "A6yeMqBFG8", + "lvrmlbyj.yczltcxn@tezos.example.org" ); + ( [ + "waste"; + "open"; + "scan"; + "tip"; + "subway"; + "dance"; + "rent"; + "copper"; + "garlic"; + "laundry"; + "defense"; + "clerk"; + "another"; + "staff"; + "liar"; + ], + "2b3e94be133a960fa0ef87f6c0922c19f9d87ca2", + "80065050465525", + "tz1VzL4Xrb3fL3ckvqCWy6bdGMzU2w9eoRqs", + "oVZqpq60sk", + "rfodmrha.zzdndvyk@tezos.example.org" ); + ( [ + "fiber"; + "next"; + "property"; + "cradle"; + "silk"; + "obey"; + "gossip"; + "push"; + "key"; + "second"; + "across"; + "minimum"; + "nice"; + "boil"; + "age"; + ], + "dac31640199f2babc157aadc0021cd71128ca9ea", + "3569618927693", + "tz1RUHg536oRKhPLFfttcB5gSWAhh4E9TWjX", + "FfytQTTVbu", + "owecikdy.gxnyttya@tezos.example.org" ); + ( [ + "print"; + "labor"; + "budget"; + "speak"; + "poem"; + "diet"; + "chunk"; + "eternal"; + "book"; + "saddle"; + "pioneer"; + "ankle"; + "happy"; + "only"; + "exclude"; + ], + "bb841227f250a066eb8429e56937ad504d7b34dd", + "9034781424478", + "tz1M1LFbgctcPWxstrao9aLr2ECW1fV4pH5u", + "zknAl3lrX2", + "ettilrvh.zsrqrbud@tezos.example.org" ); + ] + +(** Helper: Create a genesis block with predefined commitments, + accounts and balances. *) +let activation_init () = + Context.init1 ~consensus_threshold:0 ~commitments () >|=? fun (b, c) -> + secrets () |> fun ss -> (b, c, ss) + +(** Verify the genesis block created by [activation_init] can be + baked. *) +let test_simple_init_with_commitments () = + activation_init () >>=? fun (blk, _contract, _secrets) -> + Block.bake blk >>=? fun (_ : Block.t) -> return_unit + +(** A single activation *) +let test_single_activation () = + activation_init () >>=? fun (blk, _contract, secrets) -> + let ({account; activation_code; amount = expected_amount; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + (* Contract does not exist *) + Assert.balance_is ~loc:__LOC__ (B blk) (Contract.Implicit account) Tez.zero + >>=? fun () -> + Op.activation (B blk) account activation_code >>=? fun operation -> + Block.bake ~operation blk >>=? fun blk -> + (* Contract does exist *) + Assert.balance_is + ~loc:__LOC__ + (B blk) + (Contract.Implicit account) + expected_amount + +(** 10 activations, one per bake. *) +let test_multi_activation_1 () = + activation_init () >>=? fun (blk, _contract, secrets) -> + List.fold_left_es + (fun blk {account; activation_code; amount = expected_amount; _} -> + Op.activation (B blk) account activation_code >>=? fun operation -> + Block.bake ~operation blk >>=? fun blk -> + Assert.balance_is + ~loc:__LOC__ + (B blk) + (Contract.Implicit account) + expected_amount + >|=? fun () -> blk) + blk + secrets + >>=? fun (_ : Block.t) -> return_unit + +(** All of the 10 activations occur in one bake. *) +let test_multi_activation_2 () = + activation_init () >>=? fun (blk, _contract, secrets) -> + List.fold_left_es + (fun ops {account; activation_code; _} -> + Op.activation (B blk) account activation_code >|=? fun op -> op :: ops) + [] + secrets + >>=? fun ops -> + Block.bake ~operations:ops blk >>=? fun blk -> + List.iter_es + (fun {account; amount = expected_amount; _} -> + (* Contract does exist *) + Assert.balance_is + ~loc:__LOC__ + (B blk) + (Contract.Implicit account) + expected_amount) + secrets + +(** Transfer with activated account. *) +let test_activation_and_transfer () = + activation_init () >>=? fun (blk, bootstrap_contract, secrets) -> + let ({account; activation_code; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + let first_contract = Contract.Implicit account in + Op.activation (B blk) account activation_code >>=? fun operation -> + Block.bake ~operation blk >>=? fun blk -> + Context.Contract.balance (B blk) bootstrap_contract >>=? fun amount -> + Test_tez.( /? ) amount 2L >>?= fun half_amount -> + Context.Contract.balance (B blk) first_contract + >>=? fun activated_amount_before -> + Op.transaction (B blk) bootstrap_contract first_contract half_amount + >>=? fun operation -> + Block.bake ~operation blk >>=? fun blk -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + (Contract.Implicit account) + activated_amount_before + half_amount + +(** Transfer to an unactivated account and then activating it. *) +let test_transfer_to_unactivated_then_activate () = + activation_init () >>=? fun (blk, bootstrap_contract, secrets) -> + let ({account; activation_code; amount} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + let unactivated_commitment_contract = Contract.Implicit account in + Context.Contract.balance (B blk) bootstrap_contract >>=? fun b_amount -> + b_amount /? 2L >>?= fun b_half_amount -> + Incremental.begin_construction blk >>=? fun inc -> + Op.transaction + (I inc) + bootstrap_contract + unactivated_commitment_contract + b_half_amount + >>=? fun op -> + Incremental.add_operation inc op >>=? fun inc -> + Op.activation (I inc) account activation_code >>=? fun op' -> + Incremental.add_operation inc op' >>=? fun inc -> + Incremental.finalize_block inc >>=? fun blk2 -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk2) + (Contract.Implicit account) + amount + b_half_amount + +(****************************************************************) +(* The following test scenarios are supposed to raise errors. *) +(****************************************************************) + +(** Invalid pkh activation: expected to fail as the context does not + contain any commitment. *) +let test_invalid_activation_with_no_commitments () = + Context.init1 () >>=? fun (blk, _contract) -> + let secrets = secrets () in + let ({account; activation_code; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + Op.activation (B blk) account activation_code >>=? fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_activation _ -> true + | _ -> false) + +(** Wrong activation: wrong secret given in the operation. *) +let test_invalid_activation_wrong_secret () = + activation_init () >>=? fun (blk, _contract, secrets) -> + let ({account; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth secrets 0 + in + let ({activation_code; _} as _second_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth secrets 1 + in + Op.activation (B blk) account activation_code >>=? fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_activation _ -> true + | _ -> false) + +(** Invalid pkh activation : expected to fail as the context does not + contain an associated commitment. *) +let test_invalid_activation_inexistent_pkh () = + activation_init () >>=? fun (blk, _contract, secrets) -> + let ({activation_code; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + let inexistent_pkh = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1PeQHGKPWSpNoozvxgqLN9TFsj6rDqNV3o" + in + Op.activation (B blk) inexistent_pkh activation_code >>=? fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Invalid_activation _ -> true + | _ -> false) + +(** Invalid pkh activation : expected to fail as the commitment has + already been claimed. *) +let test_invalid_double_activation () = + activation_init () >>=? fun (blk, _contract, secrets) -> + let ({account; activation_code; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + Incremental.begin_construction blk >>=? fun inc -> + Op.activation (I inc) account activation_code >>=? fun op -> + Incremental.add_operation inc op >>=? fun inc -> + Op.activation (I inc) account activation_code >>=? fun op' -> + Incremental.add_operation inc op' >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Validate_errors.Anonymous.Conflicting_activation _ -> true + | _ -> false) + +(** Transfer from an unactivated commitment account. *) +let test_invalid_transfer_from_unactivated_account () = + activation_init () >>=? fun (blk, bootstrap_contract, secrets) -> + let ({account; _} as _first_one) = + WithExceptions.Option.get ~loc:__LOC__ @@ List.hd secrets + in + let unactivated_commitment_contract = Contract.Implicit account in + (* No activation *) + Op.transaction + (B blk) + unactivated_commitment_contract + bootstrap_contract + Tez.one + >>=? fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error_with_info ~loc:__LOC__ res "Empty implicit contract" + +let tests = + [ + Tztest.tztest + "init with commitments" + `Quick + test_simple_init_with_commitments; + Tztest.tztest "single activation" `Quick test_single_activation; + Tztest.tztest "multi-activation one-by-one" `Quick test_multi_activation_1; + Tztest.tztest + "multi-activation all at a time" + `Quick + test_multi_activation_2; + Tztest.tztest "activation and transfer" `Quick test_activation_and_transfer; + Tztest.tztest + "transfer to unactivated account then activate" + `Quick + test_transfer_to_unactivated_then_activate; + Tztest.tztest + "invalid activation with no commitments" + `Quick + test_invalid_activation_with_no_commitments; + Tztest.tztest + "invalid activation with commitments" + `Quick + test_invalid_activation_inexistent_pkh; + Tztest.tztest + "invalid double activation" + `Quick + test_invalid_double_activation; + Tztest.tztest + "wrong activation code" + `Quick + test_invalid_activation_wrong_secret; + Tztest.tztest + "invalid transfer from unactivated account" + `Quick + test_invalid_transfer_from_unactivated_account; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml new file mode 100644 index 000000000000..8fc28644d5da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml @@ -0,0 +1,411 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (combined operations) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^combined$" + Subject: Multiple operations can be grouped in one ensuring their + deterministic application. + + If an invalid operation is present in this group of + operations, the previously applied operations are + backtracked leaving the context unchanged and the + following operations are skipped. Fees attributed to the + operations are collected by the baker nonetheless. + + Only manager operations are allowed in multiple transactions. + They must all belong to the same manager as there is only one + signature. +*) + +open Protocol +open Alpha_context + +let ten_tez = Test_tez.of_int 10 + +let gas_limit = Op.Custom_gas (Alpha_context.Gas.Arith.integral_of_int_exn 3000) + +(** Groups ten transactions between the same parties. *) +let test_multiple_transfers () = + Context.init3 () >>=? fun (blk, (c1, c2, c3)) -> + List.map_es + (fun _ -> Op.transaction ~gas_limit (B blk) c1 c2 Tez.one) + (1 -- 10) + >>=? fun ops -> + Op.combine_operations ~source:c1 (B blk) ops >>=? fun operation -> + let baker_pkh = Context.Contract.pkh c3 in + Incremental.begin_construction ~policy:(By_account baker_pkh) blk + >>=? fun inc -> + Context.Contract.balance (I inc) c1 >>=? fun c1_old_balance -> + Context.Contract.balance (I inc) c2 >>=? fun c2_old_balance -> + Incremental.add_operation inc operation >>=? fun inc -> + Assert.balance_was_debited + ~loc:__LOC__ + (I inc) + c1 + c1_old_balance + (Test_tez.of_int 10) + >>=? fun () -> + Assert.balance_was_credited + ~loc:__LOC__ + (I inc) + c2 + c2_old_balance + (Test_tez.of_int 10) + >>=? fun () -> return_unit + +(** Groups ten delegated originations. *) +let test_multiple_origination_and_delegation () = + Context.init2 () >>=? fun (blk, (c1, c2)) -> + let n = 10 in + Context.get_constants (B blk) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + let delegate_pkh = Context.Contract.pkh c2 in + (* Deploy n smart contracts with dummy scripts from c1 *) + List.map_es + (fun i -> + Op.contract_origination + ~gas_limit + ~delegate:delegate_pkh + ~counter:(Manager_counter.Internal_for_tests.of_int i) + ~fee:Tez.zero + ~script:Op.dummy_script + ~credit:(Test_tez.of_int 10) + (B blk) + c1) + (1 -- n) + >>=? fun originations -> + (* These computed originated contracts are not the ones really created *) + (* We will extract them from the tickets *) + let originations_operations, _ = List.split originations in + Op.combine_operations ~source:c1 (B blk) originations_operations + >>=? fun operation -> + Incremental.begin_construction blk >>=? fun inc -> + Context.Contract.balance (I inc) c1 >>=? fun c1_old_balance -> + Incremental.add_operation inc operation >>=? fun inc -> + (* To retrieve the originated contracts, it is easier to extract them + from the tickets. Else, we could (could we ?) hash each combined + operation individually. *) + let tickets = Incremental.rev_tickets inc in + let open Apply_results in + let tickets = + List.fold_left + (fun acc -> function + | No_operation_metadata -> assert false + | Operation_metadata {contents} -> + to_list (Contents_result_list contents) @ acc) + [] + tickets + |> List.rev + in + let new_contracts = + List.map + (function + | Contents_result + (Manager_operation_result + { + operation_result = + Applied (Origination_result {originated_contracts = [h]; _}); + _; + }) -> + h + | _ -> assert false) + tickets + in + (* Previous balance - (Credit (n * 10tz) + Origination cost (n tz)) *) + Test_tez.(cost_per_byte *? Int64.of_int origination_size) + >>?= fun origination_burn -> + Test_tez.(origination_burn *? Int64.of_int n) + >>?= fun origination_total_cost -> + Test_tez.( *? ) Op.dummy_script_cost 10L + >>? Test_tez.( +? ) (Test_tez.of_int (10 * n)) + >>? Test_tez.( +? ) origination_total_cost + >>?= fun total_cost -> + Assert.balance_was_debited ~loc:__LOC__ (I inc) c1 c1_old_balance total_cost + >>=? fun () -> + List.iter_es + (fun c -> + let c = Contract.Originated c in + Assert.balance_is ~loc:__LOC__ (I inc) c (Test_tez.of_int 10)) + new_contracts + +let expect_apply_failure = function + | Environment.Ecoproto_error err :: _ -> + Assert.test_error_encodings err ; + let error_info = + Error_monad.find_info_of_error (Environment.wrap_tzerror err) + in + if error_info.title = "Balance too low" then return_unit + else failwith "unexpected error" + | _ -> failwith "balance too low should fail" + +(** Groups three operations, the middle one failing. + Checks that the receipt is consistent. + Variant without fees. *) +let test_failing_operation_in_the_middle () = + Context.init2 () >>=? fun (blk, (c1, c2)) -> + Op.transaction ~gas_limit ~fee:Tez.zero (B blk) c1 c2 Tez.one >>=? fun op1 -> + Op.transaction ~gas_limit ~fee:Tez.zero (B blk) c1 c2 Test_tez.max_tez + >>=? fun op2 -> + Op.transaction ~gas_limit ~fee:Tez.zero (B blk) c1 c2 Tez.one >>=? fun op3 -> + let operations = [op1; op2; op3] in + Op.combine_operations ~source:c1 (B blk) operations >>=? fun operation -> + Incremental.begin_construction blk >>=? fun inc -> + Context.Contract.balance (I inc) c1 >>=? fun c1_old_balance -> + Context.Contract.balance (I inc) c2 >>=? fun c2_old_balance -> + Incremental.add_operation ~expect_apply_failure inc operation >>=? fun inc -> + let tickets = Incremental.rev_tickets inc in + let open Apply_results in + let tickets = + List.fold_left + (fun acc -> function + | No_operation_metadata -> assert false + | Operation_metadata {contents} -> + to_list (Contents_result_list contents) @ acc) + [] + tickets + in + (match tickets with + | Contents_result + (Manager_operation_result {operation_result = Backtracked _; _}) + :: Contents_result + (Manager_operation_result {operation_result = Failed (_, trace); _}) + :: Contents_result + (Manager_operation_result {operation_result = Skipped _; _}) + :: _ -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + let expect = + Format.asprintf "Balance of contract %a too low" Context.Contract.pp c1 + in + assert (Astring.String.is_infix ~affix:expect trace_string) + | _ -> assert false) ; + Assert.balance_is ~loc:__LOC__ (I inc) c1 c1_old_balance >>=? fun () -> + Assert.balance_is ~loc:__LOC__ (I inc) c2 c2_old_balance >>=? fun () -> + return_unit + +(** Groups three operations, the middle one failing. + Checks that the receipt is consistent. + Variant with fees, that should be spent even in case of failure. *) +let test_failing_operation_in_the_middle_with_fees () = + Context.init2 () >>=? fun (blk, (c1, c2)) -> + Op.transaction ~fee:Tez.one (B blk) c1 c2 Tez.one >>=? fun op1 -> + Op.transaction ~fee:Tez.one (B blk) c1 c2 Test_tez.max_tez >>=? fun op2 -> + Op.transaction ~fee:Tez.one (B blk) c1 c2 Tez.one >>=? fun op3 -> + let operations = [op1; op2; op3] in + Op.combine_operations ~source:c1 (B blk) operations >>=? fun operation -> + Incremental.begin_construction blk >>=? fun inc -> + Context.Contract.balance (I inc) c1 >>=? fun c1_old_balance -> + Context.Contract.balance (I inc) c2 >>=? fun c2_old_balance -> + Incremental.add_operation ~expect_apply_failure inc operation >>=? fun inc -> + let tickets = Incremental.rev_tickets inc in + let open Apply_results in + let tickets = + List.fold_left + (fun acc -> function + | No_operation_metadata -> assert false + | Operation_metadata {contents} -> + to_list (Contents_result_list contents) @ acc) + [] + tickets + in + (match tickets with + | Contents_result + (Manager_operation_result {operation_result = Backtracked _; _}) + :: Contents_result + (Manager_operation_result {operation_result = Failed (_, trace); _}) + :: Contents_result + (Manager_operation_result {operation_result = Skipped _; _}) + :: _ -> + let trace_string = + Format.asprintf "%a" Environment.Error_monad.pp_trace trace + in + let expect = + Format.asprintf "Balance of contract %a too low" Context.Contract.pp c1 + in + assert (Astring.String.is_infix ~affix:expect trace_string) + | _ -> assert false) ; + (* In the presence of a failure, all the fees are collected. Even for skipped operations. *) + Assert.balance_was_debited + ~loc:__LOC__ + (I inc) + c1 + c1_old_balance + (Test_tez.of_int 3) + >>=? fun () -> + Assert.balance_is ~loc:__LOC__ (I inc) c2 c2_old_balance >>=? fun () -> + return_unit + +let test_wrong_signature_in_the_middle () = + Context.init2 ~consensus_threshold:0 () >>=? fun (blk, (c1, c2)) -> + Op.transaction ~gas_limit ~fee:Tez.one (B blk) c1 c2 Tez.one >>=? fun op1 -> + Op.transaction ~gas_limit ~fee:Tez.one (B blk) c2 c1 Tez.one >>=? fun op2 -> + (* Make legit transfers, performing reveals *) + Block.bake ~operations:[op1; op2] blk >>=? fun b -> + (* Make c2 reach counter 5 *) + Op.transaction ~gas_limit ~fee:Tez.one (B b) c2 c1 Tez.one + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.transaction ~gas_limit ~fee:Tez.one (B b) c2 c1 Tez.one + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.transaction ~gas_limit ~fee:Tez.one (B b) c2 c1 Tez.one + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Cook transactions for actual test *) + Op.transaction ~gas_limit ~fee:Tez.one (B b) c1 c2 Tez.one >>=? fun op1 -> + Op.transaction ~gas_limit ~fee:Tez.one (B b) c1 c2 Tez.one >>=? fun op2 -> + Op.transaction ~gas_limit ~fee:Tez.one (B b) c1 c2 Tez.one >>=? fun op3 -> + Op.transaction ~gas_limit ~fee:Tez.one (B b) c2 c1 Tez.one + >>=? fun spurious_operation -> + let operations = [op1; op2; op3] in + + Op.combine_operations ~spurious_operation ~source:c1 (B b) operations + >>=? fun operation -> + let expect_failure = function + | Environment.Ecoproto_error + (Validate_errors.Manager.Inconsistent_sources as err) + :: _ -> + Assert.test_error_encodings err ; + return_unit + | _ -> + failwith + "Packed operation has invalid source in the middle : operation \ + expected to fail." + in + Incremental.begin_construction b >>=? fun inc -> + Incremental.add_operation ~expect_failure inc operation + >>=? fun (_inc : Incremental.t) -> return_unit + +let expect_inconsistent_counters list = + if + List.exists + (function + | Environment.Ecoproto_error + Validate_errors.Manager.Inconsistent_counters -> + true + | _ -> false) + list + then return_unit + else + failwith + "Packed operation has inconsistent counters : operation expected to fail \ + but got errors: %a." + Error_monad.pp_print_trace + list + +let test_inconsistent_counters () = + Context.init2 () >>=? fun (blk, (c1, c2)) -> + Op.transaction ~gas_limit ~fee:Tez.one (B blk) c1 c2 Tez.one >>=? fun op1 -> + Op.transaction ~gas_limit ~fee:Tez.one (B blk) c2 c1 Tez.one >>=? fun op2 -> + (* Make legit transfers, performing reveals *) + Block.bake ~operations:[op1; op2] blk >>=? fun b -> + (* Now, counter c1 = counter c2 = 1, Op.transaction builds with counter + 1 *) + Op.transaction + ~gas_limit + ~fee:Tez.one + (B b) + c1 + c2 + ~counter:(Manager_counter.Internal_for_tests.of_int 1) + Tez.one + >>=? fun op1 -> + Op.transaction + ~gas_limit + ~fee:Tez.one + (B b) + c1 + c2 + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + Tez.one + >>=? fun op2 -> + Op.transaction + ~gas_limit + ~fee:Tez.one + (B b) + c1 + c2 + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + (Tez.of_mutez_exn 5_000L) + >>=? fun op2' -> + Op.transaction + ~gas_limit + ~fee:Tez.one + (B b) + c1 + c2 + ~counter:(Manager_counter.Internal_for_tests.of_int 3) + Tez.one + >>=? fun op3 -> + Op.transaction + ~gas_limit + ~fee:Tez.one + (B b) + c1 + c2 + ~counter:(Manager_counter.Internal_for_tests.of_int 4) + Tez.one + >>=? fun op4 -> + (* Canari: Check counters are ok *) + Op.batch_operations ~source:c1 (B b) [op1; op2; op3; op4] >>=? fun op -> + Incremental.begin_construction b >>=? fun inc -> + Incremental.add_operation inc op >>=? fun (_ : Incremental.t) -> + (* Gap in counter in the following op *) + Op.batch_operations ~source:c1 (B b) [op1; op2; op4] >>=? fun op -> + Incremental.add_operation ~expect_failure:expect_inconsistent_counters inc op + >>=? fun (_ : Incremental.t) -> + (* Same counter used twice in the following op *) + Op.batch_operations ~source:c1 (B b) [op1; op2; op2'] >>=? fun op -> + Incremental.add_operation ~expect_failure:expect_inconsistent_counters inc op + >>=? fun (_ : Incremental.t) -> return_unit + +let tests = + [ + Tztest.tztest "multiple transfers" `Quick test_multiple_transfers; + Tztest.tztest + "multiple originations and delegations" + `Quick + test_multiple_origination_and_delegation; + Tztest.tztest + "Failing operation in the middle" + `Quick + test_failing_operation_in_the_middle; + Tztest.tztest + "Failing operation in the middle (with fees)" + `Quick + test_failing_operation_in_the_middle_with_fees; + Tztest.tztest + "Failing operation (wrong manager in the middle of a pack)" + `Quick + test_wrong_signature_in_the_middle; + Tztest.tztest + "Inconsistent counters in batch" + `Quick + test_inconsistent_counters; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml new file mode 100644 index 000000000000..917fe3dec5f4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^failing_noop operation$" + Subject: The Failing_noop operation was added bearing in mind the + possibility for the end user to sign arbitrary bytes, + encapsulate in the operation, with the absolute garanty that + the signed bytes can't be used for something against the + user's will. The Failing_noop operation always fails when + applied. + *) + +(** try to apply a failing_noop and assert that the operation fails *) +let failing_noop_must_fail_when_injected () = + Context.init1 () >>=? fun (blk, contract) -> + let source = Context.Contract.pkh contract in + Op.failing_noop (B blk) source "tezos" >>=? fun operation -> + Block.bake ~operation blk >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Protocol.Validate_errors.Failing_noop_error -> true + | _ -> false) + +let tests = + [Tztest.tztest "injection fails" `Quick failing_noop_must_fail_when_injected] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml new file mode 100644 index 000000000000..8531dfe0b5d6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml @@ -0,0 +1,328 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (origination) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^origination$" + Subject: On originating contracts. +*) + +open Protocol +open Alpha_context +open Test_tez + +let ten_tez = of_int 10 + +(* The possible fees are: a given credit, an origination burn fee + (constants_repr.default.origination_burn = 257 mtez), a fee that is paid when + creating an originate contract. *) +let total_fees_for_origination ?(fee = Tez.zero) ?(credit = Tez.zero) b = + Context.get_constants (B b) + >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> + cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> + credit +? fee >>? ( +? ) origination_burn >>? ( +? ) Op.dummy_script_cost + >>?= fun total_fee -> return total_fee + +(* [test_origination_balances fee credit spendable delegatable] takes four + optional parameter: fee is the fee that pay if require to create an + originated contract; credit is the amount of tez that will send to this + contract; delegatable default is set to true meaning that this contract is + able to delegate. + + This function creates 2 contracts, one for originating (called source) and + one for baking; get the balance of the source contract, call the + origination operation to create a new originated contract from this contract + with all the possible fees; and check the balance before/after originated + operation valid. + - the source contract has payed all the fees + - the originated has been credited correctly. + Note that we need 2 contracts because in Tenderbake the baker receives the + fees instantaneously. So to see that the fees are subtracted, we need that + the bake is done by another delegated. *) +let test_origination_balances ~loc:_ ?(fee = Tez.zero) ?(credit = Tez.zero) () = + Context.init2 () >>=? fun (b, (source, contract_for_bake)) -> + let pkh_for_orig = Context.Contract.pkh source in + let pkh_for_bake = Context.Contract.pkh contract_for_bake in + Op.contract_origination (B b) source ~fee ~credit ~script:Op.dummy_script + >>=? fun (operation, new_contract) -> + total_fees_for_origination ~fee ~credit b >>=? fun total_fee -> + Block.bake ~operation ~policy:(By_account pkh_for_bake) b >>=? fun b -> + (* check that after the block has been baked the contract for originating + was debited all the fees *) + Context.Delegate.current_frozen_deposits (B b) pkh_for_orig + >>=? fun deposits -> + total_fee +? deposits >>?= fun total_fee_plus_deposits -> + Assert.balance_was_debited + ~loc:__LOC__ + (B b) + source + Account.default_initial_balance + total_fee_plus_deposits + >>=? fun () -> + (* check the balance of the originate contract is equal to credit *) + Assert.balance_is ~loc:__LOC__ (B b) new_contract credit + +(** [register_origination fee credit spendable delegatable] takes four + optional parameter: fee for the fee need to be paid if set to + create an originated contract; credit is the amount of tez that + send to this originated contract; spendable default is set to true + meaning that this contract is spendable; delegatable default is + set to true meaning that this contract is able to delegate. *) +let register_origination ?(fee = Tez.zero) ?(credit = Tez.zero) () = + Context.init2 () >>=? fun (b, (source, contract_for_bake)) -> + let source_pkh = Context.Contract.pkh source in + let pkh_for_bake = Context.Contract.pkh contract_for_bake in + Op.contract_origination (B b) source ~fee ~credit ~script:Op.dummy_script + >>=? fun (operation, originated) -> + Block.bake ~operation ~policy:(By_account pkh_for_bake) b >>=? fun b -> + (* fee + credit were debited from source *) + total_fees_for_origination ~fee ~credit b >>=? fun total_fee -> + Context.Delegate.current_frozen_deposits (B b) source_pkh >>=? fun deposits -> + total_fee +? deposits >>?= fun total_fee_plus_deposits -> + Assert.balance_was_debited + ~loc:__LOC__ + (B b) + source + Account.default_initial_balance + total_fee_plus_deposits + >>=? fun () -> + (* originated contract has been credited *) + Assert.balance_was_credited ~loc:__LOC__ (B b) originated Tez.zero credit + >|=? fun () -> + (* TODO spendable or not and delegatable or not if relevant for some + test. Not the case at the moment, cf. uses of + register_origination *) + (b, source, originated) + +(******************************************************) +(* Tests *) +(******************************************************) + +(** Basic test. A contract is created as well as the newly originated + contract (called from origination operation). The balance + before/after are checked. *) +let test_balances_simple () = test_origination_balances ~loc:__LOC__ () + +(** Same as [balances_simple] but credits 10 tez to the originated + contract (no fees). *) +let test_balances_credit () = + test_origination_balances ~loc:__LOC__ ~credit:ten_tez () + +(** Same as [balances_credit] with 10 tez fees. *) +let test_balances_credit_fee () = + test_origination_balances ~loc:__LOC__ ~credit:(of_int 2) ~fee:ten_tez () + +(** Ask source contract to pay a fee when originating a contract. *) +let test_pay_fee () = + register_origination ~credit:(of_int 2) ~fee:ten_tez () + >>=? fun (_b, _contract, _new_contract) -> return_unit + +(******************************************************) +(** Errors *) + +(******************************************************) + +(** Create an originate contract where the contract does not have + enough tez to pay for the fee. *) +let test_not_tez_in_contract_to_pay_fee () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + (* transfer everything but one tez from 1 to 2 and check balance of 1 *) + Context.Contract.balance (B b) contract_1 >>=? fun balance -> + balance -? Tez.one >>?= fun amount -> + Op.transaction (B b) contract_1 contract_2 amount >>=? fun operation -> + let pkh1 = Context.Contract.pkh contract_1 in + Block.bake ~policy:(Excluding [pkh1]) ~operation b >>=? fun b -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract_1 balance amount + >>=? fun () -> + (* use this source contract to create an originate contract where it requires + to pay a fee and add an amount of credit into this new contract *) + Op.contract_origination + (B b) + ~fee:ten_tez + ~credit:Tez.one + contract_1 + ~script:Op.dummy_script + >>=? fun (op, _) -> + Incremental.begin_construction b >>=? fun inc -> + Incremental.add_operation inc op >>= fun inc -> + Assert.proto_error_with_info ~loc:__LOC__ inc "Balance too low" + +(* Set the endorser of the block as manager/delegate of the originated + account. *) +let register_contract_get_endorser () = + Context.init1 () >>=? fun (b, contract) -> + Incremental.begin_construction b >>=? fun inc -> + Context.get_endorser (I inc) >|=? fun (account_endorser, _slots) -> + (inc, contract, account_endorser) + +(* Create multiple originated contracts and ask contract to pay the fee. *) +let n_originations n ?credit ?fee () = + List.fold_left_es + (fun new_contracts _ -> + register_origination ?fee ?credit () + >|=? fun (_b, _source, new_contract) -> new_contract :: new_contracts) + [] + (1 -- n) + +(** Create 100 originations. *) +let test_multiple_originations () = + n_originations 100 ~credit:(of_int 2) ~fee:ten_tez () >>=? fun contracts -> + Assert.equal_int ~loc:__LOC__ (List.length contracts) 100 + +(** Cannot originate two contracts with the same context's counter. *) +let test_counter () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, contract) -> + Op.contract_origination (B b) ~credit:Tez.one contract ~script:Op.dummy_script + >>=? fun (op1, _) -> + Op.contract_origination (B b) ~credit:Tez.one contract ~script:Op.dummy_script + >>=? fun (op2, _) -> + Block.bake ~operation:op1 b >>=? fun b -> + Incremental.begin_construction b >>=? fun inc -> + Incremental.add_operation inc op2 >>= fun res -> + Assert.proto_error_with_info + ~loc:__LOC__ + res + "Invalid counter (already used) in a manager operation" + +let test_unparsable_script () = + let open Lwt_result_syntax in + let* b, contract = Context.init1 ~consensus_threshold:0 () in + let open Alpha_context in + (* Craft an ill-typed origination's contract. *) + let pkh = + match contract with Implicit pkh -> pkh | Originated _ -> assert false + in + let dummy_expr = + Script.lazy_expr + Environment.Micheline.(strip_locations (Int ((), Z.of_int 123))) + in + let script = Script.{code = dummy_expr; storage = dummy_expr} in + let origination = Origination {delegate = None; script; credit = Tez.one} in + let gas_limit = + Gas.Arith.integral_of_int_exn + (49_000 + + Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation) + in + let op = + Contents_list + (Single + (Manager_operation + { + source = pkh; + fee = Tez.one; + counter = Manager_counter.Internal_for_tests.of_int 1; + operation = origination; + gas_limit; + storage_limit = Z.zero; + })) + in + let encoded_op = + Data_encoding.Binary.to_bytes_exn Operation.contents_list_encoding op + |> Bytes.to_string + in + let* account = Account.find pkh in + let ill_typed_op = + Data_encoding.Binary.of_string_exn + Operation.contents_list_encoding + encoded_op + |> Op.sign account.sk (Context.branch (B b)) + in + (* Ensure that the application fails with [Ill_typed_contract]. *) + let* i = Incremental.begin_construction b in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure:(function + | Environment.Ecoproto_error (Script_tc_errors.Ill_typed_contract _) + :: _ -> + return_unit + | trace -> + failwith + "Expected error trace [Ill_typed_contract], but got:@\n%a" + pp_print_trace + trace) + i + ill_typed_op + in + (* Craft an unparsable lazy expr. *) + let encoded_dummy_expr = + let b = + Data_encoding.Binary.to_bytes_exn Script.lazy_expr_encoding dummy_expr + in + assert (Hex.to_bytes_exn (`Hex "0000000300bb01") = b) ; + Bytes.to_string b + in + let unparsable_dummy_expr = + Hex.to_bytes_exn (`Hex "00000003ffffff") |> Bytes.to_string + in + let unparsable_operation = + let encoded_bad_op = + Re.( + replace_string + ~all:true + (compile (str encoded_dummy_expr)) + encoded_op + ~by:unparsable_dummy_expr) + in + Data_encoding.Binary.of_string_exn + Operation.contents_list_encoding + encoded_bad_op + |> Op.sign account.sk (Context.branch (B b)) + in + (* Ensure that the operation is valid but the application fails with + [Lazy_script_decode]. *) + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure:(function + | [Environment.Ecoproto_error Script.Lazy_script_decode] -> return_unit + | trace -> + failwith + "Expected error trace [Lazy_script_decode], but got:@\n%a" + pp_print_trace + trace) + i + unparsable_operation + in + return_unit + +(******************************************************) + +let tests = + [ + Tztest.tztest "balances_simple" `Quick test_balances_simple; + Tztest.tztest "balances_credit" `Quick test_balances_credit; + Tztest.tztest "balances_credit_fee" `Quick test_balances_credit_fee; + Tztest.tztest "pay_fee" `Quick test_pay_fee; + Tztest.tztest + "not enough tez in contract to pay fee" + `Quick + test_not_tez_in_contract_to_pay_fee; + Tztest.tztest "multiple originations" `Quick test_multiple_originations; + Tztest.tztest "counter" `Quick test_counter; + Tztest.tztest "unparsable script" `Quick test_unparsable_script; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml new file mode 100644 index 000000000000..f233834607eb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml @@ -0,0 +1,247 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (increase_paid_storage) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^paid storage increase$" + Subject: On increasing a paid amount of contract storage. +*) + +open Protocol +open Alpha_context + +let ten_tez = Test_tez.of_int 10 + +let dummy_script = + "{parameter unit; storage unit; code { CAR ; NIL operation ; PAIR }}" + +let contract_originate block ?(script = dummy_script) + ?(storage = Expr.from_string "Unit") account = + let open Lwt_result_syntax in + let code = Expr.from_string script in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + let source_contract = account in + let baker = Context.Contract.pkh account in + let* op, dst = + Op.contract_origination_hash (B block) source_contract ~fee:Tez.zero ~script + in + let* inc = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let* inc = Incremental.add_operation inc op in + let+ b = Incremental.finalize_block inc in + (b, dst) + +(** [test_balances] runs a simple [increase_paid_storage] and verifies that the + source contract balance is correct and that the storage of the + destination contract has been increased by the right amount. *) +let test_balances ~amount = + let open Lwt_result_syntax in + let* b, source = Context.init1 () in + let* b, destination = contract_originate b source in + let* inc = Incremental.begin_construction b in + let* balance_before_op = Context.Contract.balance (I inc) source in + let contract_dst = Contract.Originated destination in + let*! storage_before_op = + Contract.Internal_for_tests.paid_storage_space + (Incremental.alpha_ctxt inc) + contract_dst + in + let* storage_before_op = + Lwt.return (Environment.wrap_tzresult storage_before_op) + in + let* op = + Op.increase_paid_storage ~fee:Tez.zero (I inc) ~source ~destination amount + in + let* inc = Incremental.add_operation inc op in + (* check that after the block has been baked, the source was debited of all + the burned tez *) + let* {parametric = {cost_per_byte; _}; _} = Context.get_constants (I inc) in + let burned_tez = Tez.mul_exn cost_per_byte (Z.to_int amount) in + let* () = + Assert.balance_was_debited + ~loc:__LOC__ + (I inc) + source + balance_before_op + burned_tez + in + (* check that the storage has been increased by the right amount *) + let*! storage = + Contract.Internal_for_tests.paid_storage_space + (Incremental.alpha_ctxt inc) + contract_dst + in + let* storage = Lwt.return (Environment.wrap_tzresult storage) in + let storage_minus_amount = Z.sub storage amount in + Assert.equal_int + ~loc:__LOC__ + (Z.to_int storage_before_op) + (Z.to_int storage_minus_amount) + +(******************************************************) +(* Tests *) +(******************************************************) + +(** Basic test. We test balances in simple cases. *) +let test_balances_simple () = test_balances ~amount:(Z.of_int 100) + +(******************************************************) +(* Errors *) +(******************************************************) + +(** We test the operation when the amount given is null. *) +let test_null_amount () = + let open Lwt_result_syntax in + let*! result = test_balances ~amount:Z.zero in + Assert.proto_error ~loc:__LOC__ result (function + | Fees_storage.Negative_storage_input -> true + | _ -> false) + +(** We test the operation when the amount given is negative. *) +let test_negative_amount () = + let open Lwt_result_syntax in + let amount = Z.of_int (-10) in + let*! result = test_balances ~amount in + Assert.proto_error ~loc:__LOC__ result (function + | Fees_storage.Negative_storage_input -> true + | _ -> false) + +(** We create an implicit account with not enough tez to pay for the + storage increase. *) +let test_no_tez_to_pay () = + let open Lwt_result_syntax in + let* b, (source, baker, receiver) = Context.init3 ~consensus_threshold:0 () in + let* b, destination = contract_originate b source in + let pkh_for_bake = Context.Contract.pkh baker in + let* inc = + Incremental.begin_construction ~policy:Block.(By_account pkh_for_bake) b + in + let* {parametric = {cost_per_byte; _}; _} = Context.get_constants (I inc) in + let increase_amount = + Z.div (Z.of_int 2_000_000) (Z.of_int64 (Tez.to_mutez cost_per_byte)) + in + let* balance = Context.Contract.balance (I inc) source in + let*? tez_to_substract = Test_tez.(balance -? Tez.one) in + let* op = + Op.transaction (I inc) ~fee:Tez.zero source receiver tez_to_substract + in + let* inc = Incremental.add_operation inc op in + let* b = Incremental.finalize_block inc in + let* inc = + Incremental.begin_construction ~policy:Block.(By_account pkh_for_bake) b + in + let* op = + Op.increase_paid_storage (I inc) ~source ~destination increase_amount + in + let*! inc = Incremental.add_operation inc op in + Assert.proto_error ~loc:__LOC__ inc (function + | Fees_storage.Cannot_pay_storage_fee -> true + | _ -> false) + +(** To test when there is no smart contract at the address given. *) +let test_no_contract () = + let open Lwt_result_syntax in + let* b, source = Context.init1 () in + let* inc = Incremental.begin_construction b in + let destination = Contract_helpers.fake_KT1 in + let* op = Op.increase_paid_storage (I inc) ~source ~destination Z.zero in + let*! inc = Incremental.add_operation inc op in + Assert.proto_error ~loc:__LOC__ inc (function + | Raw_context.Storage_error (Missing_key (_, Raw_context.Get)) -> true + | _ -> false) + +(** To test if the increase in storage is effective. *) +let test_effectiveness () = + let open Lwt_result_syntax in + let* b, (source, _contract_source) = + Context.init2 ~consensus_threshold:0 () + in + let script = + "{parameter unit; storage int; code { CDR ; PUSH int 65536 ; MUL ; NIL \ + operation ; PAIR }}" + in + let storage = + Tezos_micheline.Micheline.strip_locations (Expr_common.int Z.one) + in + let* b, destination = contract_originate ~script ~storage b source in + let* inc = Incremental.begin_construction b in + (* We ensure that the transaction can't be made with a 0 burn cap. *) + let contract_dst = Contract.Originated destination in + let* op = + Op.transaction + ~storage_limit:Z.zero + ~fee:Tez.zero + (I inc) + source + contract_dst + Tez.zero + in + let*! inc_test = Incremental.add_operation inc op in + let* () = + Assert.proto_error ~loc:__LOC__ inc_test (function + | Fees.Operation_quota_exceeded -> true + | _ -> false) + in + let* b = Incremental.finalize_block inc in + let* inc = Incremental.begin_construction b in + let* op = + Op.increase_paid_storage + (I inc) + ~fee:Tez.zero + ~source + ~destination + (Z.of_int 10) + in + let* inc = Incremental.add_operation inc op in + let* b = Incremental.finalize_block inc in + let* inc = Incremental.begin_construction b in + (* We test the same transaction to see if increase_paid_storage worked. *) + let* op = + Op.transaction + ~storage_limit:Z.zero + ~fee:Tez.zero + (I inc) + source + contract_dst + Tez.zero + in + let+ (_inc : Incremental.t) = Incremental.add_operation inc op in + () + +let tests = + [ + Tztest.tztest "balances simple" `Quick test_balances_simple; + Tztest.tztest "null amount" `Quick test_null_amount; + Tztest.tztest "negative amount" `Quick test_negative_amount; + Tztest.tztest "not enough tez to pay" `Quick test_no_tez_to_pay; + Tztest.tztest "no contract to bump its paid storage" `Quick test_no_contract; + Tztest.tztest "effectiveness" `Quick test_effectiveness; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml new file mode 100644 index 000000000000..d8f5ef94b4aa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml @@ -0,0 +1,749 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2022 Nomadic Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (revelation) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^revelation$" + Subject: On the reveal operation. +*) + +(** Protocol integration tests for the [Reveal] operation. *) + +open Protocol +open Alpha_context +open Test_tez + +let ten_tez = of_int 10 + +let test_simple_reveal () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Alpha_context.Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation" + | false -> ()) + >>=? fun () -> + (* Reveal the contract *) + Op.revelation (B blk) new_c.pk >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> () + | false -> Stdlib.failwith "New contract revelation failed." + +let test_empty_account_on_reveal () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Alpha_context.Contract.Implicit new_c.pkh in + let amount = Tez.one_mutez in + (* Create the contract *) + Op.transaction (B blk) c new_contract amount >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expecting fresh pkh" + | false -> ()) + >>=? fun () -> + (* Reveal the contract *) + Op.revelation ~fee:amount (B blk) new_c.pk >>=? fun operation -> + Incremental.begin_construction blk >>=? fun inc -> + let expect_apply_failure = function + | [ + Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract pkh); + ] + when pkh = new_c.pkh -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_apply_failure inc operation >>=? fun inc -> + Context.Contract.balance (I inc) new_contract >>=? fun balance -> + Assert.equal_tez ~loc:__LOC__ balance Tez.zero >>=? fun () -> + Context.Contract.is_manager_key_revealed (I inc) new_contract >|=? function + | false -> () + | true -> Stdlib.failwith "Empty account still exists and is revealed." + +let test_not_enough_funds_for_reveal () = + Context.init1 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Alpha_context.Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one_mutez >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation" + | false -> ()) + >>=? fun () -> + (* Reveal the contract *) + Op.revelation ~fee:Tez.fifty_cents (B blk) new_c.pk >>=? fun operation -> + Block.bake blk ~operation >>= fun res -> + Assert.proto_error_with_info ~loc:__LOC__ res "Balance too low" + +let test_transfer_fees_emptying_after_reveal_batched () = + Context.init1 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Alpha_context.Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + Incremental.begin_construction blk >>=? fun inc -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun reveal -> + Incremental.add_operation inc reveal >>=? fun tmp_inc -> + Op.transaction ~fee:Tez.one (I tmp_inc) new_contract c Tez.one + >>=? fun transaction -> + Op.batch_operations ~source:new_contract (I inc) [reveal; transaction] + >>=? fun op -> + let expect_apply_failure = function + | [ + Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract pkh); + ] + when pkh = new_c.pkh -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_apply_failure inc op + >>=? fun (_inc : Incremental.t) -> return_unit + +(* We assert that the changes introduced in !5182, splitting the + application of Reveal operations into a pre-checking and + an application phase, do not allow to forge dishonest revelations. *) +let test_reveal_with_fake_account () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, bootstrap) -> + (* Create two fresh, unrevealed, accounts a and b. *) + let account_a = Account.new_account () in + let a_pkh = account_a.pkh in + let a_contract = Contract.Implicit a_pkh in + let account_b = Account.new_account () in + let b_pkh = account_b.pkh in + let b_contract = Contract.Implicit b_pkh in + (* Assert a and b are fresh.*) + (* TODO tezos/tezos#2996 + + These preambles are too verbose and boilerplate. We should factor + out revealing fresh unrevealed accounts. *) + when_ (Tezos_crypto.Signature.Public_key_hash.equal a_pkh b_pkh) (fun () -> + failwith + "Expected different pkhs: got %a %a" + Tezos_crypto.Signature.Public_key_hash.pp + a_pkh + Tezos_crypto.Signature.Public_key_hash.pp + b_pkh) + >>=? fun () -> + Op.transaction (B blk) bootstrap a_contract Tez.one >>=? fun oa -> + Op.transaction (B blk) bootstrap b_contract Tez.one >>=? fun ob -> + Op.batch_operations + ~recompute_counters:true + ~source:bootstrap + (B blk) + [oa; ob] + >>=? fun batch -> + Block.bake blk ~operation:batch >>=? fun b -> + (Context.Contract.is_manager_key_revealed (B blk) a_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + (Context.Contract.is_manager_key_revealed (B blk) b_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + (* get initial balance of account_a *) + Context.Contract.balance (B b) a_contract >>=? fun a_balance_before -> + (* We will attempt to forge a reveal with a fake account that + impersonates account_a but uses account_b's public and secret + keys, e.g. + + fake_a = Account.{pkh = account_a.pkh; pk = account_b.pk; sk = + account_b.sk} + + and we will attempt to reveal the public key of b with a's + pkh. This operation should fail without updating account_a's + balance *) + Op.revelation ~fee:Tez.one_mutez ~forge_pkh:(Some a_pkh) (B b) account_b.pk + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + ~expect_failure:(function + | [ + Environment.Ecoproto_error + (Contract_manager_storage.Inconsistent_hash _); + ] -> + return_unit + | errs -> + failwith + "Expected an Contract_manager_storage.Inconsistent_hash error but \ + got %a" + Error_monad.pp_print_trace + errs) + i + operation + >>=? fun i -> + Context.Contract.balance (I i) a_contract >>=? fun a_balance_after -> + unless (Tez.equal a_balance_after a_balance_before) (fun () -> + failwith + "Balance of contract_a should have not changed: expected %atz, got %atz" + Tez.pp + a_balance_before + Tez.pp + a_balance_after) + +(* On the following test, we create an account a, fund it, reveal it, + and get its balance. Then we attempt to forge a reveal for another + account b, using a's pkh. *) +let test_reveal_with_fake_account_already_revealed () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, bootstrap) -> + (* Create two fresh, unrevealed, accounts a and b. *) + let account_a = Account.new_account () in + let a_pkh = account_a.pkh in + let a_contract = Contract.Implicit a_pkh in + let account_b = Account.new_account () in + let b_pkh = account_b.pkh in + let b_contract = Contract.Implicit b_pkh in + (* Assert a and b are fresh.*) + (* TODO tezos/tezos#2996 + + These preambles are too verbose and boilerplate. We should factor + out revealing fresh unrevealed accounts. *) + when_ (Tezos_crypto.Signature.Public_key_hash.equal a_pkh b_pkh) (fun () -> + failwith + "Expected different pkhs: got %a %a" + Tezos_crypto.Signature.Public_key_hash.pp + a_pkh + Tezos_crypto.Signature.Public_key_hash.pp + b_pkh) + >>=? fun () -> + Op.transaction (B blk) bootstrap a_contract Tez.one >>=? fun oa -> + Op.transaction (B blk) bootstrap b_contract Tez.one >>=? fun ob -> + Op.batch_operations + ~recompute_counters:true + ~source:bootstrap + (B blk) + [oa; ob] + >>=? fun batch -> + Block.bake blk ~operation:batch >>=? fun b -> + (Context.Contract.is_manager_key_revealed (B blk) a_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + (Context.Contract.is_manager_key_revealed (B blk) b_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + (* We first reveal a in a block *) + Op.revelation ~fee:Tez.one_mutez (B b) account_a.pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Context.Contract.balance (B b) a_contract >>=? fun a_balance_before -> + (* Reveal the public key of b while impersonating account_a. This + operation should fail without updating account_a's balance *) + Op.revelation ~fee:Tez.one_mutez ~forge_pkh:(Some a_pkh) (B b) account_b.pk + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + ~expect_failure:(function + | [ + Environment.Ecoproto_error + (Contract_manager_storage.Inconsistent_hash _); + ] -> + return_unit + | errs -> + failwith + "Expected a Previously_revealed_key error but got %a" + Error_monad.pp_print_trace + errs) + i + operation + >>=? fun i -> + Context.Contract.balance (I i) a_contract >>=? fun a_balance_after -> + unless (Tez.equal a_balance_after a_balance_before) (fun () -> + failwith + "Balance of contract_a should have not changed: expected %atz, got %atz" + Tez.pp + a_balance_before + Tez.pp + a_balance_after) + +(* cf: #2386 + + On tezos/tezos!5182 we have reverted the behaviour implemented by + tezos/tezos!587, which explicitly avoided marking reveal operations + as backtracked to reflect the fact that a reveal in a failing batch + did still take effect (cf #338). + + We test that backtracked reveals stay backtracked. *) +let test_backtracked_reveal_in_batch () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun op_reveal -> + Op.transaction + ~force_reveal:false + ~fee:Tez.zero + (I inc) + new_contract + new_contract + (Tez.of_mutez_exn 1_000_001L) + >>=? fun op_transfer -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [op_reveal; op_transfer] + >>=? fun batched_operation -> + let expect_apply_failure = function + | [ + Environment.Ecoproto_error (Contract_storage.Balance_too_low _); + Environment.Ecoproto_error (Tez_repr.Subtraction_underflow _); + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + Incremental.add_operation ~expect_apply_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the batch has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected contract revelation: reveal was expected to fail") + +(* Asserts that re-revealing an already revealed manager will make the + whole batch fail. *) +let test_already_revealed_manager_in_batch () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expecting fresh pkh" + | false -> ()) + >>=? fun () -> + (* Reveal the contract *) + Op.revelation (B blk) new_c.pk >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (* We pack a correct batch of operations attempting to re-reveal the contract *) + Incremental.begin_construction blk >>=? fun inc -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun op_reveal -> + Op.transaction + ~force_reveal:false + ~fee:Tez.zero + (I inc) + new_contract + new_contract + (Tez.of_mutez_exn 1_000_001L) + >>=? fun op_transfer -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (B blk) + [op_reveal; op_transfer] + >>=? fun batched_operation -> + let expect_apply_failure = function + | [ + Environment.Ecoproto_error + (Contract_manager_storage.Previously_revealed_key _); + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_apply_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still revealed. *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + unless revelead (fun () -> + Stdlib.failwith + "Unexpected unrevelation: failing batch shouldn't unreveal the manager") + +(* cf: #2386 + + We imitate the behaviour of + + https://tzkt.io/ooSocfx3xxzDo7eFyGu6ZDR1svzMrbaJtBikQanXXhwrqMuWfGz + + which provides evidence of a failing reveal with a gas exhaustion + error due to an incorrect gas limit of 0, which still takes effect + as witnessed by the subsequent (reveal-less) transfer + + https://tzkt.io/opBQQJQ5senPP5v8PfPFf4uVQqKRE5RVjbwx8uD4SqeRs2JGcVw + + This showcases a bad separation of concerns between pre-checking + and the application of manager operations per-se within + [Protocol.Apply.apply_operation]. The situation originated because + [precheck_manager_contents_lists] would reveal the manager by + calling [Protocol.Alpha_context.Contract.reveal_manager_key] before + [prepare_apply_manager_operation_content] has consumed the declared + gas. + + With !5182 we have fixed this situation by revealing the manager + contract at application time. The following test isolates the + failing reveal and asserts that the manager is not revealed after + the failing op. + + As of !5506, the reveal operation does not pass precheck + anyway. Unfortunately, this means that this test has lost some of + its original purpose. Fortunately, {!test_empty_account_on_reveal} + offers a similar scenario to what this test was supposed to do: a + reveal fails during application and we check that the contract is + not revealed afterward. *) +let test_no_reveal_when_gas_exhausted () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Fund the contract with a sufficient balance *) + Op.transaction (B blk) c new_contract (Tez.of_mutez_exn 1_000L) + >>=? fun operation -> + (* Create the contract *) + Block.bake blk ~operation >>=? fun blk -> + (* Assert that the account has not been revealed yet *) + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + (* We craft a new (bad) reveal operation with a 0 gas_limit *) + Op.revelation ~fee:Tez.zero ~gas_limit:Zero (B blk) new_c.pk >>=? fun op -> + Incremental.begin_construction blk >>=? fun inc -> + (* The application of this operation is expected to fail with a + {! Protocol.Raw_context.Operation_quota_exceeded} error *) + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Insufficient_gas_for_manager; + Environment.Ecoproto_error Raw_context.Operation_quota_exceeded; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc op >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the operation has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected revelation: reveal operation failed") + +(* Fix #2774 + + We test that reveals can only succeed if they are placed at the + first position in a batch of manager operations, and that moreover + reveal operations occur uniquely in batches. + + - First, [test_reveal_incorrect_position_in_batch] asserts that a + [[transfer; reveal]] batch where a valid reveal follows another + valid op (different from a reveal, so here a transfer) fails with + an [Apply.Incorrect_reveal_position] error. + + - Second, we test a batch consisting of duplicate (potentially) + valid reveal operations. We assert the second reveal to fail again + with an [Apply.Incorrect_reveal_position] error, and for the first + reveal to be backtracked. + + - Then, we test batches with duplicate reveals which follow a + failing one and we assert again the second reveal fails skipped. We + do this for the 3 different reasons a well-placed reveal might fail + (as tested above): gas exhaustion, insolvency, and emptying the + balance while revealing. +*) +let test_reveal_incorrect_position_in_batch () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + Op.transaction + ~force_reveal:false + ~fee:Tez.zero + (I inc) + new_contract + new_contract + (Tez.of_mutez_exn 1L) + >>=? fun op_transfer -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun op_reveal -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [op_transfer; op_reveal] + >>=? fun batched_operation -> + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the operation has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected revelation: reveal operation was expected to fail") + +(* Test that a batch [reveal pk; reveal pk] where the first reveal + succeeds but the second one results in the second one failing, and + then first reveal being backtracked. *) +let test_duplicate_valid_reveals () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun op_rev1 -> + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun op_rev2 -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [op_rev1; op_rev2] + >>=? fun batched_operation -> + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the operation has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected contract revelation: backtracking expected") + +(* Test that a batch [failed_reveal pk; reveal pk] where the first + reveal fails with a gas exhaustion results in the second one + failing due to not being well-placed at the beginnning of the + batch. *) +let test_valid_reveal_after_gas_exhausted_one () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + (* We first craft a (bad) reveal operation with a 0 gas_limit *) + Op.revelation ~fee:Tez.zero ~gas_limit:Zero (B blk) new_c.pk + >>=? fun bad_reveal -> + (* While the second is a valid one *) + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun good_reveal -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [bad_reveal; good_reveal] + >>=? fun batched_operation -> + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the batch has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected contract revelation: no valid reveal in batch") + +(* Test that a batch [failed_reveal pk; reveal pk; transfer] where the + first reveal fails with insufficient funds results in the second + one failing due to not being well-placed at the beginnning of the + batch. We add the trailing transfer to ensure covering all branches + of `check_batch_tail_sanity` in `find_manager_public_key` when + calling {!Apply.check_manager_signature} to verify the manager's pk + while processing the second reveal. *) +let test_valid_reveal_after_insolvent_one () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + (* Create the contract *) + Op.transaction (B blk) c new_contract Tez.one >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation: expected fresh pkh" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + (* We first craft an insolvent reveal operation *) + Op.revelation ~fee:ten_tez (B blk) new_c.pk >>=? fun bad_reveal -> + (* While the second is a free valid one *) + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun good_reveal -> + Op.transaction ~fee:Tez.zero (I inc) new_contract c Tez.one + >>=? fun transfer -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [bad_reveal; good_reveal; transfer] + >>=? fun batched_operation -> + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the batch has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected contract revelation: no valid reveal in batch") + +(* Test that a batch [failed_reveal pk; reveal pk] where the first + reveal fails with insufficient funds results in the second one + failing due to not being well-placed at the beginnning of the + batch. *) +let test_valid_reveal_after_emptying_balance () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, c) -> + let new_c = Account.new_account () in + let new_contract = Contract.Implicit new_c.pkh in + let amount = Tez.one_mutez in + (* Create the contract *) + Op.transaction (B blk) c new_contract amount >>=? fun operation -> + Block.bake blk ~operation >>=? fun blk -> + (Context.Contract.is_manager_key_revealed (B blk) new_contract >|=? function + | true -> Stdlib.failwith "Unexpected revelation" + | false -> ()) + >>=? fun () -> + Incremental.begin_construction blk >>=? fun inc -> + (* Reveal the contract, spending all its balance in fees *) + Op.revelation ~fee:amount (B blk) new_c.pk >>=? fun bad_reveal -> + (* While the second is a free valid one *) + Op.revelation ~fee:Tez.zero (I inc) new_c.pk >>=? fun good_reveal -> + Op.batch_operations + ~recompute_counters:true + ~source:new_contract + (I inc) + [bad_reveal; good_reveal] + >>=? fun batched_operation -> + let expect_failure = function + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | _ -> assert false + in + Incremental.add_operation ~expect_failure inc batched_operation + >>=? fun inc -> + (* We assert the manager key is still unrevealed, as the batch has failed *) + Context.Contract.is_manager_key_revealed (I inc) new_contract + >>=? fun revelead -> + when_ revelead (fun () -> + failwith "Unexpected contract revelation: no valid reveal in batch") + +let tests = + [ + Tztest.tztest "simple reveal" `Quick test_simple_reveal; + Tztest.tztest "empty account on reveal" `Quick test_empty_account_on_reveal; + Tztest.tztest + "not enough funds for reveal" + `Quick + test_not_enough_funds_for_reveal; + Tztest.tztest + "transfer fees emptying balance after reveal in batch" + `Quick + test_transfer_fees_emptying_after_reveal_batched; + Tztest.tztest + "cannot forge reveal with fake keys and signature" + `Quick + test_reveal_with_fake_account; + Tztest.tztest + "cannot re-reveal an account with fake keys and signature" + `Quick + test_reveal_with_fake_account_already_revealed; + Tztest.tztest + "a backtracked reveal in a batch doesn't take effect" + `Quick + test_backtracked_reveal_in_batch; + Tztest.tztest + "cannot re-reveal a manager in a batch" + `Quick + test_already_revealed_manager_in_batch; + Tztest.tztest + "do not reveal when gas exhausted" + `Quick + test_no_reveal_when_gas_exhausted; + Tztest.tztest + "incorrect reveal position in batch" + `Quick + test_reveal_incorrect_position_in_batch; + Tztest.tztest + "cannot duplicate valid reveals in batch" + `Quick + test_duplicate_valid_reveals; + Tztest.tztest + "cannot batch a good reveal after a gas-exhausted one" + `Quick + test_valid_reveal_after_gas_exhausted_one; + Tztest.tztest + "cannot batch a good reveal after an insolvent one" + `Quick + test_valid_reveal_after_insolvent_one; + Tztest.tztest + "cannot batch a good reveal after one emptying account" + `Quick + test_valid_reveal_after_emptying_balance; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml new file mode 100644 index 000000000000..f45f51c1deb5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -0,0 +1,2783 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Rollup layer 1 logic + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^sc rollup$" + Subject: Test smart contract rollup +*) + +open Protocol +open Alpha_context +open Lwt_result_syntax + +exception Sc_rollup_test_error of string + +let err x = Exn (Sc_rollup_test_error x) + +let wrap k = Lwt.map Environment.wrap_tzresult k + +let assert_fails ~loc ?error m = + let open Lwt_result_syntax in + let*! res = m in + match res with + | Ok _ -> Stdlib.failwith "Expected failure" + | Error err_res -> ( + match (err_res, error) with + | Environment.Ecoproto_error err' :: _, Some err when err = err' -> + (* Matched exact error. *) + return_unit + | Environment.Ecoproto_error err' :: _, Some err -> + let msg = + Format.asprintf + "Expected error [%a] but got [%a] at location %s" + Environment.Error_monad.pp + err' + Environment.Error_monad.pp + err + loc + in + Stdlib.failwith msg + | _, Some _ -> + (* Expected a different error. *) + let msg = + Printf.sprintf "Expected a different error at location %s" loc + in + Stdlib.failwith msg + | _, None -> + (* Any error is ok. *) + return ()) + +let assert_equal_z ~loc x y = + Assert.equal ~loc Z.equal "Compare Z.t" Z.pp_print x y + +let get_game_status_result incr = + match Incremental.rev_tickets incr with + | [ + Operation_metadata + { + contents = + Single_result + (Manager_operation_result {operation_result = Applied op; _}); + }; + ] -> ( + match op with + | Sc_rollup_refute_result {game_status; _} -> (game_status, `Refute) + | Sc_rollup_timeout_result {game_status; _} -> (game_status, `Timeout) + | _ -> + Stdlib.failwith + "The operation applied is neither a [Sc_rollup_refute_result] or a \ + [Sc_rollup_timeout_result]") + | _ -> + Stdlib.failwith + "Failed to found an applied operation result in the metadata" + +let assert_equal_game_status ?game_status actual_game_status = + match game_status with + | None -> return_unit + | Some game_status -> + if game_status = actual_game_status then return_unit + else + let msg = + Format.asprintf + "Expected game status [%a] but got [%a]" + Sc_rollup.Game.pp_status + game_status + Sc_rollup.Game.pp_status + actual_game_status + in + Stdlib.failwith msg + +let assert_refute_result ?game_status incr = + let actual_game_status, op_type = get_game_status_result incr in + assert (op_type = `Refute) ; + assert_equal_game_status ?game_status actual_game_status + +let assert_timeout_result ?game_status incr = + let actual_game_status, op_type = get_game_status_result incr in + assert (op_type = `Timeout) ; + assert_equal_game_status ?game_status actual_game_status + +(** [context_init tup] initializes a context for testing in which the + [sc_rollup_enable] constant is set to true. It returns the created + context and contracts. *) +let context_init ?(sc_rollup_challenge_window_in_blocks = 10) + ?(timeout_period_in_blocks = 10) ?hard_gas_limit_per_operation + ?hard_gas_limit_per_block tup = + Context.init_with_constants_gen + tup + { + Context.default_test_constants with + consensus_threshold = 0; + hard_gas_limit_per_operation = + Option.value + hard_gas_limit_per_operation + ~default:Context.default_test_constants.hard_gas_limit_per_operation; + hard_gas_limit_per_block = + Option.value + hard_gas_limit_per_block + ~default:Context.default_test_constants.hard_gas_limit_per_block; + sc_rollup = + { + Context.default_test_constants.sc_rollup with + enable = true; + challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + timeout_period_in_blocks; + }; + } + +(** [test_disable_feature_flag ()] tries to originate a smart contract + rollup when the feature flag is deactivated and checks that it + fails. *) +let test_disable_feature_flag () = + let* b, contract = Context.init1 () in + let* i = Incremental.begin_construction b in + let kind = Sc_rollup.Kind.Example_arith in + let* op, _ = + let parameters_ty = Script.lazy_expr @@ Expr.from_string "unit" in + Op.sc_rollup_origination (I i) contract kind ~boot_sector:"" ~parameters_ty + in + let expect_failure = function + | Environment.Ecoproto_error + (Validate_errors.Manager.Sc_rollup_feature_disabled as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_feature_disabled]" + in + let* (_ : Incremental.t) = Incremental.add_operation ~expect_failure i op in + return_unit + +(** Initializes the context and originates a SCORU. *) +let sc_originate ?(boot_sector = "") ?origination_proof block contract + parameters_ty = + let kind = Sc_rollup.Kind.Example_arith in + let* operation, rollup = + Op.sc_rollup_origination + ?origination_proof + (B block) + contract + kind + ~boot_sector + ~parameters_ty:(Script.lazy_expr @@ Expr.from_string parameters_ty) + in + let* incr = Incremental.begin_construction block in + let* incr = Incremental.add_operation incr operation in + let* block = Incremental.finalize_block incr in + return (block, rollup) + +(** Initializes the context and originates a SCORU. *) +let init_and_originate ?boot_sector ?origination_proof + ?sc_rollup_challenge_window_in_blocks tup parameters_ty = + let* block, contracts = + context_init ?sc_rollup_challenge_window_in_blocks tup + in + let contract = Context.tup_hd tup contracts in + let* block, rollup = + sc_originate ?boot_sector ?origination_proof block contract parameters_ty + in + return (block, contracts, rollup) + +let number_of_ticks_exn n = + match Sc_rollup.Number_of_ticks.of_value n with + | Some x -> x + | None -> Stdlib.failwith "Bad Number_of_ticks" + +let next_inbox_level ?predecessor ctxt rollup = + let* genesis_info = Context.Sc_rollup.genesis_info ctxt rollup in + let+ constants = Context.get_constants ctxt in + let commitment_freq = + constants.parametric.sc_rollup.commitment_period_in_blocks + in + let pred_level = + Option.fold + ~none:genesis_info.level + ~some:(fun pred -> pred.Sc_rollup.Commitment.inbox_level) + predecessor + in + Raw_level.Internal_for_tests.add pred_level commitment_freq + +let dummy_commitment ?predecessor ?compressed_state ?(number_of_ticks = 3000L) + ctxt rollup = + let* genesis_info = Context.Sc_rollup.genesis_info ctxt rollup in + let predecessor_hash = + match predecessor with + | Some pred -> Sc_rollup.Commitment.hash_uncarbonated pred + | None -> genesis_info.commitment_hash + in + let* compressed_state = + match compressed_state with + | None -> + let* {compressed_state; _} = + Context.Sc_rollup.commitment ctxt rollup predecessor_hash + in + return compressed_state + | Some compressed_state -> return compressed_state + in + let* inbox_level = next_inbox_level ?predecessor ctxt rollup in + return + Sc_rollup.Commitment. + { + predecessor = predecessor_hash; + inbox_level; + number_of_ticks = number_of_ticks_exn number_of_ticks; + compressed_state; + } + +(* Bakes blocks to satisfy requirement of next_commitment.inbox_level <= current_level *) +let bake_blocks_until_next_inbox_level ?predecessor block rollup = + let* next_level = next_inbox_level ?predecessor (B block) rollup in + Block.bake_until_level next_level block + +let bake_blocks_until_inbox_level block commitment = + Block.bake_until_level commitment.Sc_rollup.Commitment.inbox_level block + +let publish_op_and_dummy_commitment ~src ?compressed_state ?predecessor rollup + block = + let compressed_state = + Option.map + (fun s -> + Sc_rollup.State_hash.context_hash_to_state_hash + (Tezos_crypto.Context_hash.hash_string [s])) + compressed_state + in + let* commitment = + dummy_commitment ?compressed_state ?predecessor (B block) rollup + in + let* publish = Op.sc_rollup_publish (B block) src rollup commitment in + return (publish, commitment) + +(* Verify that parameters and unparsed parameters match. *) +let verify_params ctxt ~parameters_ty ~parameters ~unparsed_parameters = + let show exp = Expr.to_string @@ exp in + let unparse ctxt parameters = + wrap + (Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized + parameters_ty + parameters) + in + let* unparsed_parameters, ctxt = + (* Make sure we can parse the unparsed-parameters with the given parameters + type. *) + let* parsed_unparsed_parameters, ctxt = + wrap + (Script_ir_translator.parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ~allow_forged:true + parameters_ty + (Environment.Micheline.root unparsed_parameters)) + in + (* Un-parse again to get back to Micheline. *) + unparse ctxt parsed_unparsed_parameters + in + (* Un-parse the parsed parameters. *) + let* expected_unparsed_parameters, _ctxt = unparse ctxt parameters in + (* Verify that both version match. *) + Assert.equal_string + ~loc:__LOC__ + (show unparsed_parameters) + (show expected_unparsed_parameters) + +(* Verify that the given list of transactions and transaction operations match. + Also checks each transaction operation for type mismatches etc. *) +let verify_execute_outbox_message_operations incr ~loc ~source ~operations + ~expected_transactions = + let ctxt = Incremental.alpha_ctxt incr in + let validate_and_extract_operation_params ctxt op = + match op with + | Script_typed_ir.Internal_operation + { + source = op_source; + operation = + Transaction_to_smart_contract + { + destination; + amount; + entrypoint; + location = _; + parameters_ty; + parameters; + unparsed_parameters; + }; + nonce = _; + } -> + (* Check that the parameters match. *) + let* () = + verify_params ctxt ~parameters_ty ~parameters ~unparsed_parameters + in + let* () = + (* Check that the sources match. *) + Assert.equal_string + ~loc + (Contract.to_b58check (Contract.Implicit source)) + (Contract.to_b58check op_source) + in + (* Assert that the amount is 0. *) + let* () = Assert.equal_tez ~loc amount Tez.zero in + (* Load the arg-type and entrypoints of the destination script. *) + let* ( Script_ir_translator.Ex_script (Script {arg_type; entrypoints; _}), + ctxt ) = + let* ctxt, _cache_key, cached = + wrap @@ Script_cache.find ctxt destination + in + match cached with + | Some (_script, ex_script) -> return (ex_script, ctxt) + | None -> failwith "Could not load script at %s" loc + in + (* Find the script parameters ty of the script. *) + let*? entrypoint_res, ctxt = + Environment.wrap_tzresult + (Gas_monad.run + ctxt + (Script_ir_translator.find_entrypoint + ~error_details:(Informative ()) + arg_type + entrypoints + entrypoint)) + in + let*? (Ex_ty_cstr {ty = script_parameters_ty; _}) = + Environment.wrap_tzresult entrypoint_res + in + (* Check that the script parameters type matches the one from the + transaction. *) + let*? ctxt = + Environment.wrap_tzresult + (let open Result_syntax in + let* eq, ctxt = + Gas_monad.run + ctxt + (Script_ir_translator.ty_eq + ~error_details:(Informative (-1)) + script_parameters_ty + parameters_ty) + in + let+ Eq = eq in + ctxt) + in + return (ctxt, (destination, entrypoint, unparsed_parameters)) + | _ -> + failwith + "Expected an internal transaction operation to a smart-contract, \ + called from %s" + loc + in + let* _ctxt, operations_data = + List.fold_left_map_es validate_and_extract_operation_params ctxt operations + in + let compare_data (d1, e1, p1) (d2, e2, p2) = + Contract_hash.equal d1 d2 + && Entrypoint_repr.(e1 = e2) + && String.equal (Expr.to_string p1) (Expr.to_string p2) + in + let pp_data fmt (d, e, p) = + Format.fprintf + fmt + "(%a, %a, %s)" + Contract_hash.pp + d + Entrypoint_repr.pp + e + (Expr.to_string p) + in + let transactions_data = + let data_of_transaction (contract, entrypoint, params) = + let params = Expr.from_string params in + (contract, entrypoint, params) + in + List.map data_of_transaction expected_transactions + in + Assert.assert_equal_list + ~loc + compare_data + "Compare operations data" + pp_data + operations_data + transactions_data + +(* Helper function to create output used for executing outbox messages. *) +let make_output ~outbox_level ~message_index transactions = + let transactions = + List.map + (fun (destination, entrypoint, parameters) -> + let unparsed_parameters = Expr.from_string parameters in + {Sc_rollup.Outbox.Message.unparsed_parameters; destination; entrypoint}) + transactions + in + let message = + Sc_rollup.Outbox.Message.Atomic_transaction_batch {transactions} + in + let outbox_level = Raw_level.of_int32_exn (Int32.of_int outbox_level) in + let message_index = Z.of_int message_index in + Sc_rollup.{outbox_level; message_index; message} + +let string_ticket_token ticketer content = + let open Lwt_result_syntax in + let contents = + Result.value_f ~default:(fun _ -> assert false) + @@ Script_string.of_string content + in + let*? ticketer = Environment.wrap_tzresult @@ Contract.of_b58check ticketer in + return + (Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.string_t; contents}) + +let originate_contract incr ~script ~baker ~storage ~source_contract = + let* block = Incremental.finalize_block incr in + let* contract, _, block = + Contract_helpers.originate_contract_from_string_hash + ~script + ~storage + ~source_contract + ~baker + block + in + let* incr = Incremental.begin_construction block in + return (contract, incr) + +let hash_commitment incr commitment = + let ctxt = Incremental.alpha_ctxt incr in + let+ ctxt, hash = + wrap @@ Lwt.return (Sc_rollup.Commitment.hash ctxt commitment) + in + (Incremental.set_alpha_ctxt incr ctxt, hash) + +let publish_and_cement_commitment incr ~baker ~originator rollup commitment = + let* incr = + if + (Incremental.header incr).Block_header.shell.level + < Raw_level.to_int32 commitment.Sc_rollup.Commitment.inbox_level + then + let* block = Incremental.finalize_block incr in + let* block = bake_blocks_until_inbox_level block commitment in + Incremental.begin_construction block + else return incr + in + let* operation = Op.sc_rollup_publish (I incr) originator rollup commitment in + let* incr = Incremental.add_operation incr operation in + let* block = Incremental.finalize_block incr in + let* constants = Context.get_constants (B block) in + let* block = + Block.bake_n constants.parametric.sc_rollup.challenge_window_in_blocks block + in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + let* incr, hash = hash_commitment incr commitment in + let* cement_op = Op.sc_rollup_cement (I incr) originator rollup hash in + let* incr = Incremental.add_operation incr cement_op in + let* block = Incremental.finalize_block incr in + let* incr = + Incremental.begin_construction ~policy:Block.(By_account baker) block + in + return (hash, incr) + +let publish_and_cement_dummy_commitment incr ~baker ~originator rollup = + let* commitment = dummy_commitment (I incr) rollup in + publish_and_cement_commitment incr ~baker ~originator rollup commitment + +(* Publishes repeated cemented commitments until a commitment with + [inbox_level >= min_inbox_level] is found (such a commitment + is also published and cemented). *) +let publish_commitments_until_min_inbox_level incr rollup ~baker ~originator + ~min_inbox_level ~cemented_commitment_hash ~cemented_commitment = + let rec aux incr hash ({Sc_rollup.Commitment.inbox_level; _} as commitment) = + let level = Raw_level.to_int32 inbox_level in + if level >= Int32.of_int min_inbox_level then return (hash, incr) + else + let* commitment = + dummy_commitment ~predecessor:commitment (I incr) rollup + in + let* hash, incr = + publish_and_cement_commitment incr ~baker ~originator rollup commitment + in + aux incr hash commitment + in + aux incr cemented_commitment_hash cemented_commitment + +let adjust_ticket_token_balance_of_rollup ctxt rollup ticket_token ~delta = + let* incr = + Context.( + match ctxt with + | I incr -> return incr + | B block -> Incremental.begin_construction block) + in + let alpha_ctxt = Incremental.alpha_ctxt incr in + let* hash, alpha_ctxt = + Ticket_helpers.adjust_ticket_token_balance + alpha_ctxt + (Destination.Sc_rollup rollup) + ticket_token + ~delta + in + let incr = Incremental.set_alpha_ctxt incr alpha_ctxt in + return (hash, incr) + +(** A version of execute outbox message that output ignores proof validation. *) +let execute_outbox_message_without_proof_validation incr rollup + ~cemented_commitment ~source outbox_message = + let* res, ctxt = + wrap + (Sc_rollup_operations.Internal_for_tests.execute_outbox_message + (Incremental.alpha_ctxt incr) + ~validate_and_decode_output_proof: + (fun ctxt ~cemented_commitment:_ _rollup ~output_proof:_ -> + return (outbox_message, ctxt)) + rollup + ~cemented_commitment + ~source + ~output_proof:"Not used") + in + return (res, Incremental.set_alpha_ctxt incr ctxt) + +let execute_outbox_message incr ~originator rollup ~output_proof + ~commitment_hash = + let* batch_op = + Op.sc_rollup_execute_outbox_message + (I incr) + originator + rollup + commitment_hash + ~output_proof + in + let* incr = Incremental.add_operation incr batch_op in + let* block = Incremental.finalize_block incr in + Incremental.begin_construction block + +let assert_ticket_token_balance ~loc incr token owner expected = + let ctxt = Incremental.alpha_ctxt incr in + let* balance, _ = + let* key_hash, ctxt = + wrap @@ Ticket_balance_key.of_ex_token ctxt ~owner token + in + wrap (Ticket_balance.get_balance ctxt key_hash) + in + match (balance, expected) with + | Some b, Some e -> Assert.equal_int ~loc (Z.to_int b) e + | Some b, None -> + failwith "%s: Expected no balance but got some %d" loc (Z.to_int b) + | None, Some b -> failwith "%s: Expected balance %d but got none" loc b + | None, None -> return () + +(** Assert that the computation fails with the given message. *) +let assert_fails_with ~__LOC__ k expected_err = + let*! res = k in + Assert.proto_error ~loc:__LOC__ res (( = ) expected_err) + +type balances = {liquid : Tez.t; frozen : Tez.t} + +let balances ctxt contract = + let* liquid = Context.Contract.balance ctxt contract in + let* frozen = Context.Contract.frozen_bonds ctxt contract in + return {liquid; frozen} + +let check_balances_evolution bal_before {liquid; frozen} ~action = + let open Lwt_result_syntax in + let wret x = wrap @@ Lwt.return x in + let* {liquid = expected_liquid; frozen = expected_frozen} = + match action with + | `Freeze amount -> + let* liquid = wret @@ Tez.( -? ) bal_before.liquid amount in + let* frozen = wret @@ Tez.( +? ) bal_before.frozen amount in + return {liquid; frozen} + | `Unfreeze amount -> + let* liquid = wret @@ Tez.( +? ) bal_before.liquid amount in + let* frozen = wret @@ Tez.( -? ) bal_before.frozen amount in + return {liquid; frozen} + in + let* () = Assert.equal_tez ~loc:__LOC__ expected_liquid liquid in + let* () = Assert.equal_tez ~loc:__LOC__ expected_frozen frozen in + return () + +(* Generates a list of cemented dummy commitments. *) +let gen_commitments incr ~baker ~originator rollup ~predecessor_hash + ~num_commitments = + let rec aux incr predecessor_hash n acc = + if n <= 0 then return (List.rev acc, incr) + else + let* predecessor = + Context.Sc_rollup.commitment (I incr) rollup predecessor_hash + in + let* commitment = dummy_commitment ~predecessor (I incr) rollup in + let* commitment_hash, incr = + publish_and_cement_commitment incr ~baker ~originator rollup commitment + in + aux incr commitment_hash (n - 1) (predecessor_hash :: acc) + in + aux incr predecessor_hash num_commitments [] + +let attempt_to_recover_bond i contract ?staker rollup = + (* Recover its own bond by default. *) + let staker = + match staker with + | Some staker -> staker + | None -> ( + match contract with + | Contract.Implicit staker -> staker + | _ -> assert false) + in + let* recover_bond_op = + Op.sc_rollup_recover_bond (I i) contract rollup staker + in + let* i = Incremental.add_operation i recover_bond_op in + let* b = Incremental.finalize_block i in + return b + +let recover_bond_not_lcc i contract rollup = + assert_fails_with + ~__LOC__ + (attempt_to_recover_bond i contract rollup) + Sc_rollup_errors.Sc_rollup_not_staked_on_lcc + +let recover_bond_not_staked i contract rollup = + assert_fails_with + ~__LOC__ + (attempt_to_recover_bond i contract rollup) + Sc_rollup_errors.Sc_rollup_not_staked + +let recover_bond_with_success i contract rollup = + let* bal_before = balances (I i) contract in + let* b = attempt_to_recover_bond i contract rollup in + let* bal_after = balances (B b) contract in + let* constants = Context.get_constants (I i) in + let* () = + check_balances_evolution + bal_before + bal_after + ~action:(`Unfreeze constants.parametric.sc_rollup.stake_amount) + in + return b + +(** [test_publish_cement_and_recover_bond] creates a rollup, publishes a + commitment and then [challenge_window_in_blocks] blocks later cements + that commitment. + The comitter tries to withdraw stake before and after cementing. Only the + second attempt is expected to succeed. *) +let test_publish_cement_and_recover_bond () = + let* block, contracts, rollup = init_and_originate Context.T2 "unit" in + let _, contract = contracts in + let* block = bake_blocks_until_next_inbox_level block rollup in + let* i = Incremental.begin_construction block in + (* not staked yet *) + let* () = recover_bond_not_staked i contract rollup in + let* c = dummy_commitment (I i) rollup in + let* operation = Op.sc_rollup_publish (B block) contract rollup c in + let* i = Incremental.add_operation i operation in + let* b = Incremental.finalize_block i in + let* constants = Context.get_constants (B b) in + let* b = + Block.bake_n constants.parametric.sc_rollup.challenge_window_in_blocks b + in + let* i = Incremental.begin_construction b in + let* i, hash = hash_commitment i c in + (* stake not on LCC *) + let* () = recover_bond_not_lcc i contract rollup in + let* cement_op = Op.sc_rollup_cement (I i) contract rollup hash in + let* i = Incremental.add_operation i cement_op in + let* b = Incremental.finalize_block i in + let* i = + let pkh = + (* We forbid the stake owner from baker to correctly check the unfrozen + amount below. *) + match contract with Implicit pkh -> pkh | Originated _ -> assert false + in + Incremental.begin_construction b ~policy:(Excluding [pkh]) + in + (* recover bond should succeed *) + let* b = recover_bond_with_success i contract rollup in + let* i = Incremental.begin_construction b in + (* not staked anymore *) + let* () = recover_bond_not_staked i contract rollup in + return_unit + +(** [test_publish_fails_on_backtrack] creates a rollup and then + publishes two different commitments with the same staker. We check + that the second publish fails. *) +let test_publish_fails_on_backtrack () = + let* ctxt, contracts, rollup = init_and_originate Context.T2 "unit" in + let* ctxt = bake_blocks_until_next_inbox_level ctxt rollup in + let _, contract = contracts in + let* i = Incremental.begin_construction ctxt in + let* commitment1 = dummy_commitment (I i) rollup in + let commitment2 = + {commitment1 with number_of_ticks = number_of_ticks_exn 3001L} + in + let* operation1 = Op.sc_rollup_publish (B ctxt) contract rollup commitment1 in + let* i = Incremental.add_operation i operation1 in + let* b = Incremental.finalize_block i in + let* operation2 = Op.sc_rollup_publish (B b) contract rollup commitment2 in + let* i = Incremental.begin_construction b in + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_staker_backtracked as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_staker_backtracked]" + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_apply_failure i operation2 + in + return_unit + +(** [test_cement_fails_on_conflict] creates a rollup and then publishes + two different commitments. It waits 20 blocks and then attempts to + cement one of the commitments; it checks that this fails because the + commitment is contested. *) +let test_cement_fails_on_conflict () = + let* ctxt, contracts, rollup = init_and_originate Context.T3 "unit" in + let* ctxt = bake_blocks_until_next_inbox_level ctxt rollup in + let _, contract1, contract2 = contracts in + let* i = Incremental.begin_construction ctxt in + let* commitment1 = dummy_commitment (I i) rollup in + let commitment2 = + {commitment1 with number_of_ticks = number_of_ticks_exn 3001L} + in + let* operation1 = + Op.sc_rollup_publish (B ctxt) contract1 rollup commitment1 + in + let* i = Incremental.add_operation i operation1 in + let* b = Incremental.finalize_block i in + let* operation2 = Op.sc_rollup_publish (B b) contract2 rollup commitment2 in + let* i = Incremental.begin_construction b in + let* i = Incremental.add_operation i operation2 in + let* b = Incremental.finalize_block i in + let* constants = Context.get_constants (B b) in + let* b = + Block.bake_n constants.parametric.sc_rollup.challenge_window_in_blocks b + in + let* i = Incremental.begin_construction b in + let* i, hash = hash_commitment i commitment1 in + let* cement_op = Op.sc_rollup_cement (I i) contract1 rollup hash in + let expect_apply_failure = function + | Environment.Ecoproto_error (Sc_rollup_errors.Sc_rollup_disputed as e) :: _ + -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_disputed]" + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_apply_failure i cement_op + in + return_unit + +let commit_and_cement_after_n_bloc ?expect_apply_failure block contract rollup n + = + let* block = bake_blocks_until_next_inbox_level block rollup in + let* i = Incremental.begin_construction block in + let* commitment = dummy_commitment (I i) rollup in + let* operation = Op.sc_rollup_publish (B block) contract rollup commitment in + let* i = Incremental.add_operation i operation in + let* b = Incremental.finalize_block i in + (* This pattern would add an additional block, so we decrement [n] by one. *) + let* b = Block.bake_n (n - 1) b in + let* i = Incremental.begin_construction b in + let* i, hash = hash_commitment i commitment in + let* cement_op = Op.sc_rollup_cement (I i) contract rollup hash in + let* (_ : Incremental.t) = + Incremental.add_operation ?expect_apply_failure i cement_op + in + return_unit + +(** [test_challenge_window_period_boundaries] checks that cementing a commitment + without waiting for the whole challenge window period fails. Whereas, + succeeds when the period is over. *) +let test_challenge_window_period_boundaries () = + let sc_rollup_challenge_window_in_blocks = 10 in + let* ctxt, contract, rollup = + init_and_originate ~sc_rollup_challenge_window_in_blocks Context.T1 "unit" + in + (* Should fail because the waiting period is not strictly greater than the + challenge window period. *) + let* () = + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_commitment_too_recent _ as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> + failwith + "It should have failed with [Sc_rollup_commitment_too_recent]" + in + commit_and_cement_after_n_bloc + ~expect_apply_failure + ctxt + contract + rollup + (sc_rollup_challenge_window_in_blocks - 1) + in + (* Succeeds because the challenge period is over. *) + let* () = + commit_and_cement_after_n_bloc + ctxt + contract + rollup + sc_rollup_challenge_window_in_blocks + in + return_unit + +(** Test originating with bad type. *) +let test_originating_with_invalid_types () = + let* block, (contract, _, _) = context_init Context.T3 in + let assert_fails_for_type parameters_type = + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_parameters_type + (sc_originate block contract parameters_type) + in + (* Following types fail at validation time. *) + let* () = + [ + "mutez"; + "big_map string nat"; + "contract string"; + "sapling_state 2"; + "sapling_transaction 2"; + "lambda string nat"; + "or (nat %deposit) (string %name)"; + ] + |> List.iter_es assert_fails_for_type + in + (* Operation fails with a different error as it's not "passable". *) + assert_fails ~loc:__LOC__ (sc_originate block contract "operation") + +let test_originating_with_invalid_boot_sector_proof () = + let*! origination_proof = + Sc_rollup_helpers.origination_proof + ~boot_sector:"a boot sector" + Sc_rollup.Kind.Example_arith + in + let*! res = + init_and_originate + ~boot_sector:"another boot sector" + ~origination_proof + Context.T1 + "unit" + in + match res with + | Error + (Environment.Ecoproto_error (Sc_rollup.Proof.Sc_rollup_proof_check _ as e) + :: _) -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_proof_check]" + +let test_originating_with_invalid_kind_proof () = + let*! origination_proof = + Sc_rollup_helpers.origination_proof + ~boot_sector:"a boot sector" + Sc_rollup.Kind.Wasm_2_0_0 + in + let*! res = + init_and_originate + ~boot_sector:"a boot sector" + ~origination_proof + Context.T1 + "unit" + in + match res with + | Error + (Environment.Ecoproto_error (Sc_rollup.Proof.Sc_rollup_proof_check _ as e) + :: _) -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_proof_check]" + +let test_originating_with_random_proof () = + let origination_proof = + Data_encoding.Binary.( + of_string_exn Sc_rollup.Proof.serialized_encoding + @@ to_string_exn Data_encoding.string Hex.(show @@ of_string "bad proof")) + in + let*! res = + init_and_originate + ~boot_sector:"some boot sector" + ~origination_proof + Context.T1 + "unit" + in + match res with + | Error + (Environment.Ecoproto_error (Sc_rollup.Proof.Sc_rollup_proof_check _ as e) + :: _) -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_proof_check]" + +let test_originating_with_wrong_tree ~alter_binary_bit () = + let open Lwt_result_syntax in + let*! origination_proof = + Sc_rollup_helpers.wrong_arith_origination_proof + ~alter_binary_bit + ~boot_sector:"this should produce an invalid proof" + in + let*! res = + init_and_originate + ~boot_sector:"some boot sector" + ~origination_proof + Context.T1 + "unit" + in + match res with + | Error + (Environment.Ecoproto_error (Sc_rollup.Proof.Sc_rollup_proof_check _ as e) + :: _) -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Sc_rollup_proof_check]" + +let assert_equal_expr ~loc e1 e2 = + let s1 = Format.asprintf "%a" Michelson_v1_printer.print_expr e1 in + let s2 = Format.asprintf "%a" Michelson_v1_printer.print_expr e2 in + Assert.equal_string ~loc s1 s2 + +let test_originating_with_valid_type () = + let* block, contract = context_init Context.T1 in + let assert_parameters_ty parameters_ty = + let* block, rollup = sc_originate block contract parameters_ty in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let* expr, _ctxt = wrap @@ Sc_rollup.parameters_type ctxt rollup in + let expr = WithExceptions.Option.get ~loc:__LOC__ expr in + let*? expr, _ctxt = + Environment.wrap_tzresult + @@ Script.force_decode_in_context + ~consume_deserialization_gas:When_needed + ctxt + expr + in + assert_equal_expr ~loc:__LOC__ (Expr.from_string parameters_ty) expr + in + [ + "unit"; + "int"; + "nat"; + "signature"; + "string"; + "bytes"; + "key_hash"; + "key"; + "timestamp"; + "address"; + "bls12_381_fr"; + "bls12_381_g1"; + "bls12_381_g2"; + "bool"; + "never"; + "tx_rollup_l2_address"; + "chain_id"; + "ticket string"; + "set nat"; + "option (ticket string)"; + "list nat"; + "pair nat unit"; + "or nat string"; + "map string int"; + "map (option (pair nat string)) (list (ticket nat))"; + ] + |> List.iter_es assert_parameters_ty + +(* A contract that receives a pair of nat and a ticket and stores the ticket + with previously stored tickets. *) +let ticket_receiver = + {| + { parameter (pair nat (ticket string)); + storage (list (ticket string)); + code { UNPAIR; # [(nat, ticket) ; list] + CDR; # [ticket ; list] + CONS; # [ticket :: list] + NIL operation ; # [[] ; ticket :: list] + PAIR; # [([], ticket :: list)] + } + } + |} + +(* A contract that receives a string. *) +let string_receiver = + {| + { parameter string; + storage string; + code { CDR ; NIL operation; PAIR } } + |} + +(* A contract that receives a mutez. *) +let mutez_receiver = + {| + { parameter mutez; + storage mutez; + code { CDR ; NIL operation; PAIR } } + |} + +let test_single_transaction_batch () = + let* block, (baker, originator) = context_init Context.T2 in + let source = Context.Contract.pkh originator in + let baker = Context.Contract.pkh baker in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* ticket_receiver, incr = + originate_contract + incr + ~script:ticket_receiver + ~storage:"{}" + ~source_contract:originator + ~baker + in + (* Ticket-token with content "red". *) + let* red_token = + string_ticket_token "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Create an atomic batch message. *) + let transactions = + [ + ( ticket_receiver, + Entrypoint.default, + {|Pair 42 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1)|} ); + ] + in + let output = make_output ~outbox_level:0 ~message_index:0 transactions in + (* Set up the balance so that the self contract owns one ticket. *) + let* _ticket_hash, incr = + adjust_ticket_token_balance_of_rollup (I incr) rollup red_token ~delta:Z.one + in + let* Sc_rollup_operations.{operations; _}, incr = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output + in + (* Confirm that each transaction maps to one operation. *) + let* () = + verify_execute_outbox_message_operations + ~loc:__LOC__ + incr + ~source + ~operations + ~expected_transactions:transactions + in + (* Verify that the balance has moved to ticket-receiver. *) + let* () = + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Sc_rollup rollup) + None + in + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Contract (Originated ticket_receiver)) + (Some 1) + +(** Test that checks that an outbox message can be executed against all stored + cemented commitments but not against an outdated one. *) +let test_older_cemented_commitment () = + let* block, (baker, originator) = context_init Context.T2 in + let source = Context.Contract.pkh originator in + let baker = Context.Contract.pkh baker in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* ticket_receiver, incr = + originate_contract + incr + ~script:ticket_receiver + ~storage:"{}" + ~source_contract:originator + ~baker + in + (* Ticket-token with content "red". *) + let* red_token = + string_ticket_token "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" + in + let verify_outbox_message_execution incr cemented_commitment = + (* Set up the balance so that the self contract owns one ticket. *) + let* _ticket_hash, incr = + adjust_ticket_token_balance_of_rollup + (I incr) + rollup + red_token + ~delta:Z.one + in + (* Create an atomic batch message. *) + let transactions = + [ + ( ticket_receiver, + Entrypoint.default, + {|Pair 42 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1)|} ); + ] + in + let output = make_output ~outbox_level:0 ~message_index:0 transactions in + let* Sc_rollup_operations.{operations; _}, incr = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output + in + (* Confirm that each transaction maps to one operation. *) + let* () = + verify_execute_outbox_message_operations + ~loc:__LOC__ + incr + ~source + ~operations + ~expected_transactions:transactions + in + (* Verify that the balance has moved to ticket-receiver. *) + let* () = + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Sc_rollup rollup) + None + in + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Contract (Originated ticket_receiver)) + (Some 1) + in + let* max_num_stored_cemented_commitments = + let* ctxt = Context.to_alpha_ctxt (I incr) in + return + @@ Alpha_context.Constants.max_number_of_stored_cemented_commitments ctxt + in + (* Publish and cement a commitment. *) + let* first_commitment_hash, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Generate a list of commitments that exceed the maximum number of stored + ones by one. *) + let* commitment_hashes, incr = + gen_commitments + incr + ~baker + ~originator + rollup + ~predecessor_hash:first_commitment_hash + ~num_commitments:(max_num_stored_cemented_commitments + 1) + in + match commitment_hashes with + | too_old_commitment :: stored_hashes -> + (* Executing outbox message for the old non-stored commitment should fail. *) + let* () = + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_last_cemented_commitment + (verify_outbox_message_execution incr too_old_commitment) + in + (* Executing outbox message for the recent ones should succeed. *) + List.iteri_es + (fun _ix commitment -> verify_outbox_message_execution incr commitment) + stored_hashes + | _ -> failwith "Expected non-empty list of commitment hashes." + +let test_multi_transaction_batch () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* ticket_receiver, incr = + originate_contract + incr + ~script:ticket_receiver + ~storage:"{}" + ~source_contract:originator + ~baker + in + (* Originate a contract that accepts a string as input. *) + let* string_receiver, incr = + originate_contract + incr + ~script:string_receiver + ~storage:{|""|} + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Ticket-token with content "red". *) + let* red_token = + string_ticket_token "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" + in + let transactions = + [ + (* A transaction to the ticket-receiver contract. *) + ( ticket_receiver, + Entrypoint.default, + {|Pair 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 4)|} ); + (* Another transaction to the ticket-receiver contract. *) + ( ticket_receiver, + Entrypoint.default, + {|Pair 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 6)|} ); + (* A transaction to the string-receiver contract. *) + (string_receiver, Entrypoint.default, {|"Hello"|}); + (* Another transaction to the string-receiver contract. *) + (string_receiver, Entrypoint.default, {|"Hello again"|}); + ] + in + (* Create an atomic batch message. *) + let output = make_output ~outbox_level:0 ~message_index:0 transactions in + (* Set up the balance so that the rollup owns 10 units of red tokens. *) + let* _ticket_hash, incr = + adjust_ticket_token_balance_of_rollup + (I incr) + rollup + red_token + ~delta:(Z.of_int 10) + in + let* Sc_rollup_operations.{operations; _}, incr = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output + in + (* Confirm that each transaction maps to one operation. *) + let* () = + verify_execute_outbox_message_operations + ~loc:__LOC__ + incr + ~source + ~operations + ~expected_transactions:transactions + in + (* Verify that the balance has moved to ticket-receiver. *) + let* () = + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Sc_rollup rollup) + None + in + assert_ticket_token_balance + ~loc:__LOC__ + incr + red_token + (Destination.Contract (Originated ticket_receiver)) + (Some 10) + +(** Test that executing an L2 to L1 transaction that involves an invalid + parameter (mutez) fails. *) +let test_transaction_with_invalid_type () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + let* mutez_receiver, incr = + originate_contract + incr + ~script:mutez_receiver + ~storage:"0" + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + let transactions = [(mutez_receiver, Entrypoint.default, "12")] in + (* Create an atomic batch message. *) + let output = make_output ~outbox_level:0 ~message_index:1 transactions in + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_parameters_type + (execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output) + +(** Test that executing the same outbox message for the same twice fails. *) +let test_execute_message_twice () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* string_receiver, incr = + originate_contract + incr + ~script:string_receiver + ~storage:{|""|} + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Create an atomic batch message. *) + let transactions = [(string_receiver, Entrypoint.default, {|"Hello"|})] in + let output = make_output ~outbox_level:0 ~message_index:1 transactions in + (* Execute the message once - should succeed. *) + let* Sc_rollup_operations.{operations; _}, incr = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output + in + (* Confirm that each transaction maps to one operation. *) + let* () = + verify_execute_outbox_message_operations + ~loc:__LOC__ + incr + ~source + ~operations + ~expected_transactions:transactions + in + (* Execute the same message again should fail. *) + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_errors.Sc_rollup_outbox_message_already_applied + (execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output) + +(** Verifies that it is not possible to execute the same message twice from + different commitments. *) +let test_execute_message_twice_different_cemented_commitments () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* string_receiver, incr = + originate_contract + incr + ~script:string_receiver + ~storage:{|""|} + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* first_cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + let* predecessor = + Context.Sc_rollup.commitment (I incr) rollup first_cemented_commitment + in + let* commitment = dummy_commitment ~predecessor (I incr) rollup in + let* second_cemented_commitment, incr = + publish_and_cement_commitment incr ~baker ~originator rollup commitment + in + (* Create an atomic batch message. *) + let transactions = [(string_receiver, Entrypoint.default, {|"Hello"|})] in + let output = make_output ~outbox_level:0 ~message_index:1 transactions in + (* Execute the message once - should succeed. *) + let* Sc_rollup_operations.{operations; _}, incr = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment:first_cemented_commitment + ~source + output + in + (* Confirm that each transaction maps to one operation. *) + let* () = + verify_execute_outbox_message_operations + ~loc:__LOC__ + incr + ~source + ~operations + ~expected_transactions:transactions + in + (* Execute the same message again should fail. *) + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_errors.Sc_rollup_outbox_message_already_applied + (execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment:second_cemented_commitment + ~source + output) + +let test_zero_amount_ticket () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* ticket_receiver, incr = + originate_contract + incr + ~script:ticket_receiver + ~storage:"{}" + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Create an atomic batch message. *) + let transactions = + [ + ( ticket_receiver, + Entrypoint.default, + {|Pair 42 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 0)|} ); + ] + in + let output = make_output ~outbox_level:0 ~message_index:0 transactions in + let*! result = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output + in + match result with + | Error e -> + if + Option.is_some + @@ List.find + (function + | Environment.Ecoproto_error + Script_tc_errors.Forbidden_zero_ticket_quantity -> + true + | _ -> false) + e + then return_unit + else Stdlib.failwith "Expected failure" + | Ok _ -> Stdlib.failwith "Expected failure" + +(* Check that executing an outbox message fails when the inclusion proof in + invalid. *) +let test_invalid_output_proof () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_output_proof + (execute_outbox_message + incr + rollup + ~originator + ~output_proof:"No good" + ~commitment_hash:cemented_commitment) + +let test_execute_message_override_applied_messages_slot () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* string_receiver, incr = + originate_contract + incr + ~script:string_receiver + ~storage:{|""|} + ~source_contract:originator + ~baker + in + let max_active_levels = + Int32.to_int + (Constants_storage.sc_rollup_max_active_outbox_levels + (Alpha_context.Internal_for_tests.to_raw @@ Incremental.alpha_ctxt incr)) + in + let execute_message incr ~outbox_level ~message_index + ~cemented_commitment_hash = + let transactions = [(string_receiver, Entrypoint.default, {|"Hello"|})] in + let output = make_output ~outbox_level ~message_index transactions in + let* ( Sc_rollup_operations. + {operations = _; ticket_receipt = _; paid_storage_size_diff}, + incr ) = + execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment:cemented_commitment_hash + ~source + output + in + return (paid_storage_size_diff, incr) + in + let* cemented_commitment = dummy_commitment (I incr) rollup in + let* cemented_commitment_hash, incr = + publish_and_cement_commitment + incr + rollup + ~baker + ~originator + cemented_commitment + in + (* Execute a message. *) + let* _, incr = + execute_message + incr + ~outbox_level:0 + ~message_index:0 + ~cemented_commitment_hash + in + (* Publish a bunch of commitments until the inbox level of the lcc is greater + than [max_active_levels]. *) + let* cemented_commitment_hash, incr = + publish_commitments_until_min_inbox_level + incr + rollup + ~baker + ~originator + ~min_inbox_level:(max_active_levels + 10) + ~cemented_commitment_hash + ~cemented_commitment + in + (* Execute the message again but at [max_active_levels] outbox-level. *) + let* paid_storage_size_diff, incr = + execute_message + incr + ~outbox_level:max_active_levels + ~message_index:1 + ~cemented_commitment_hash + in + (* Since bitset has already been created for the slot, there should be no + extra storage space. *) + let* () = assert_equal_z ~loc:__LOC__ paid_storage_size_diff Z.zero in + (* Execute a message at index 99. *) + let* paid_storage_size_diff, incr = + execute_message + incr + ~outbox_level:max_active_levels + ~message_index:99 + ~cemented_commitment_hash + in + (* A message at slot 99 is now recorded which expands the size of the bitset. + We therefore see an increase in size. + *) + let* () = assert_equal_z ~loc:__LOC__ paid_storage_size_diff (Z.of_int 14) in + (* Execute at index 98. *) + let* paid_storage_size_diff, incr = + execute_message + incr + ~outbox_level:max_active_levels + ~message_index:98 + ~cemented_commitment_hash + in + (* The bitset is not expanded so we don't pay anything. *) + let* () = assert_equal_z ~loc:__LOC__ paid_storage_size_diff Z.zero in + (* If we now try to record a message at level 0 it should fail since it + expired. *) + let* () = + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_outbox_level + (execute_message + incr + ~outbox_level:0 + ~message_index:0 + ~cemented_commitment_hash) + in + let* _paid_storage_size_diff, _incr = + execute_message + incr + ~outbox_level:(max_active_levels + 5) + ~message_index:0 + ~cemented_commitment_hash + in + (* This should fail even if no message exists for the corresponding slot. + The reason is that outbox-level is smaller than the minimum level: + [last-cemented-commitment-level - max-active-levels]. + *) + let* () = + assert_fails + ~loc:__LOC__ + ~error:Sc_rollup_operations.Sc_rollup_invalid_outbox_level + (execute_message + incr + ~outbox_level:1 + ~message_index:0 + ~cemented_commitment_hash) + in + return_unit + +(** Test that a transaction fails if it attempts to transfer more tickets than + allowed. *) +let test_insufficient_ticket_balances () = + let* block, (baker, originator) = context_init Context.T2 in + let baker = Context.Contract.pkh baker in + let source = Context.Contract.pkh originator in + (* Originate a rollup that accepts a list of string tickets as input. *) + let* block, rollup = sc_originate block originator "list (ticket string)" in + let* incr = Incremental.begin_construction block in + (* Originate a contract that accepts a pair of nat and ticket string input. *) + let* ticket_receiver, incr = + originate_contract + incr + ~script:ticket_receiver + ~storage:"{}" + ~source_contract:originator + ~baker + in + (* Originate a contract that accepts a string as input. *) + let* string_receiver, incr = + originate_contract + incr + ~script:string_receiver + ~storage:{|""|} + ~source_contract:originator + ~baker + in + (* Publish and cement a commitment. *) + let* cemented_commitment, incr = + publish_and_cement_dummy_commitment incr ~baker ~originator rollup + in + (* Ticket-token with content "red". *) + let* red_token = + string_ticket_token "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" + in + let transactions = + [ + (* A transaction to the ticket-receiver contract. *) + ( ticket_receiver, + Entrypoint.default, + {|Pair 1 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 4)|} ); + (* Another transaction to the ticket-receiver contract. *) + ( ticket_receiver, + Entrypoint.default, + {|Pair 2 (Pair "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 6)|} ); + (* A transaction to the string-receiver contract. *) + (string_receiver, Entrypoint.default, {|"Hello"|}); + (* Another transaction to the string-receiver contract. *) + (string_receiver, Entrypoint.default, {|"Hello again"|}); + ] + in + (* Create an atomic batch message. *) + let output = make_output ~outbox_level:0 ~message_index:0 transactions in + (* Set up the balance so that the rollup owns 7 units of red tokens. + This is insufficient wrt the set of transactions above. + *) + let* ticket_hash, incr = + adjust_ticket_token_balance_of_rollup + (I incr) + rollup + red_token + ~delta:(Z.of_int 7) + in + (* Executing the batch fails because the rollup only has 7 units of tickets + but attempts to transfer 10 units. *) + assert_fails + ~loc:__LOC__ + ~error: + (Ticket_balance.Negative_ticket_balance + {key = ticket_hash; balance = Z.of_int (-3)}) + (execute_outbox_message_without_proof_validation + incr + rollup + ~cemented_commitment + ~source + output) + +let test_inbox_max_number_of_messages_per_level () = + let* block, (account1, account2) = + (* set sort of unlimited gas or we are going to hit gas exhaustion. *) + context_init + ~hard_gas_limit_per_operation:(Gas.Arith.integral_of_int_exn 100_000_000) + ~hard_gas_limit_per_block: + (Gas.Arith.integral_of_int_exn Int.(max_int / 1000)) + Context.T2 + in + let* block, _rollup = sc_originate block account1 "unit" in + let max_number_of_messages_per_level = + Constants.sc_rollup_max_number_of_messages_per_level + in + let* incr = Incremental.begin_construction block in + (* This just one message below the limit *) + let messages = + List.repeat (Z.to_int max_number_of_messages_per_level) "foo" + in + let* op = + Op.sc_rollup_add_messages ~gas_limit:Max (I incr) account1 messages + in + let* incr = Incremental.add_operation ~check_size:false incr op in + (* This break the limit *) + let* op = Op.sc_rollup_add_messages (I incr) account2 ["foo"] in + let* (_incr : Incremental.t) = + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_inbox_repr.Inbox_level_reached_messages_limit as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> + failwith + "It should have failed with [Inbox_level_reached_messages_limit]" + in + + Incremental.add_operation ~expect_apply_failure incr op + in + return_unit + +let add_op block op = + let* incr = Incremental.begin_construction block in + let* incr = Incremental.add_operation incr op in + Incremental.finalize_block incr + +let add_publish ~rollup block account commitment = + let* publish = Op.sc_rollup_publish (B block) account rollup commitment in + let* block = bake_blocks_until_inbox_level block commitment in + add_op block publish + +(** [test_number_of_parallel_games_bounded] checks that one cannot + play an arbitrary number of games. *) +let test_number_of_parallel_games_bounded () = + let max_number_of_parallel_games = + Context.default_test_constants.sc_rollup.max_number_of_parallel_games + in + let nb_accounts = max_number_of_parallel_games + 2 in + let* block, accounts = + context_init + ~sc_rollup_challenge_window_in_blocks:100 + (Context.TList nb_accounts) + in + let* block, rollup = sc_originate block (Stdlib.List.hd accounts) "unit" in + let* dummy_commitment = dummy_commitment (B block) rollup in + + let commitments = + List.mapi + (fun i _ -> + { + dummy_commitment with + number_of_ticks = number_of_ticks_exn (Int64.of_int (i + 1)); + }) + accounts + in + let* block = + List.fold_left2_es + ~when_different_lengths:[] + (fun block account commitment -> + add_publish ~rollup block account commitment) + block + accounts + commitments + in + match accounts with + | staker :: opponents -> + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_max_number_of_parallel_games_reached + xstaker) + :: _ -> + assert ( + Tezos_crypto.Signature.Public_key_hash.( + xstaker = Account.pkh_of_contract_exn staker)) ; + return_unit + | _ -> + failwith + "It should have failed with \ + [Sc_rollup_max_number_of_parallel_games_reached]" + in + let* block = Incremental.begin_construction block in + let* _block, _counter = + List.fold_left_es + (fun (block, counter) opponent -> + let addr = Account.pkh_of_contract_exn staker in + let* op = Op.sc_rollup_refute (I block) opponent rollup addr None in + let* block = + if counter = max_number_of_parallel_games then + Incremental.add_operation ~expect_apply_failure block op + else Incremental.add_operation block op + in + return (block, counter + 1)) + (block, 0) + opponents + in + return () + | [] -> + (* Because [max_number_of_parallel_games] is strictly positive. *) + assert false + +(** [test_timeout] test multiple cases of the timeout logic. + - Test to timeout a player before it's allowed and fails. + - Test that the timeout left by player decreases as expected. + - Test another account can timeout a late player. +*) +let test_timeout () = + let* block, (account1, account2, account3) = context_init Context.T3 in + let pkh1 = Account.pkh_of_contract_exn account1 in + let pkh2 = Account.pkh_of_contract_exn account2 in + let* block, rollup = sc_originate block account1 "unit" in + let* constants = Context.get_constants (B block) in + let Constants.Parametric.{timeout_period_in_blocks; _} = + constants.parametric.sc_rollup + in + let* genesis_info = Context.Sc_rollup.genesis_info (B block) rollup in + let* dummy_commitment = dummy_commitment (B block) rollup in + let commitment1 = + { + dummy_commitment with + number_of_ticks = number_of_ticks_exn 4L; + compressed_state = + Sc_rollup.State_hash.context_hash_to_state_hash + (Tezos_crypto.Context_hash.hash_string ["first"]); + } + in + let commitment2 = + { + dummy_commitment with + number_of_ticks = number_of_ticks_exn 4L; + compressed_state = + Sc_rollup.State_hash.context_hash_to_state_hash + (Tezos_crypto.Context_hash.hash_string ["second"]); + } + in + + let* block = add_publish ~rollup block account1 commitment1 in + let* block = add_publish ~rollup block account2 commitment2 in + let* start_game_op = + Op.sc_rollup_refute (B block) account1 rollup pkh2 None + in + let* block = add_op block start_game_op in + let* block = Block.bake_n (timeout_period_in_blocks - 1) block in + let game_index = Sc_rollup.Game.Index.make pkh1 pkh2 in + (* Testing to send a timeout before it's allowed. There is one block left + before timeout is allowed, that is, the current block. *) + let* (_incr : Incremental.t) = + let expected_block_left = 0l in + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_timeout_level_not_reached + (blocks_left, staker) as e) + :: _ -> + Assert.test_error_encodings e ; + if blocks_left = expected_block_left && pkh1 = staker then return_unit + else + failwith + "It should have failed with [Sc_rollup_timeout_level_not_reached \ + (%ld, %a)] but got [Sc_rollup_timeout_level_not_reached (%ld, \ + %a)]" + expected_block_left + Tezos_crypto.Signature.Public_key_hash.pp + pkh1 + blocks_left + Tezos_crypto.Signature.Public_key_hash.pp + staker + | _ -> + failwith + "It should have failed with [Sc_rollup_timeout_level_not_reached \ + (%ld, %a)]" + expected_block_left + Tezos_crypto.Signature.Public_key_hash.pp + pkh1 + in + let* timeout = Op.sc_rollup_timeout (B block) account3 rollup game_index in + let* incr = Incremental.begin_construction block in + Incremental.add_operation ~expect_apply_failure incr timeout + in + let* refute = + let tick = + WithExceptions.Option.get ~loc:__LOC__ (Sc_rollup.Tick.of_int 0) + in + let* {compressed_state; _} = + Context.Sc_rollup.commitment (B block) rollup genesis_info.commitment_hash + in + let first_chunk = + Sc_rollup.Dissection_chunk.{state_hash = Some compressed_state; tick} + in + let* rest = + List.init_es ~when_negative_length:[] 4 (fun i -> + let state_hash = None in + let tick = + WithExceptions.Option.get + ~loc:__LOC__ + (Sc_rollup.Tick.of_int (i + 1)) + in + return Sc_rollup.Dissection_chunk.{state_hash; tick}) + in + let step = Sc_rollup.Game.Dissection (first_chunk :: rest) in + let move = Sc_rollup.Game.{choice = tick; step} in + Op.sc_rollup_refute (B block) account1 rollup pkh2 (Some move) + in + let* block = add_op block refute in + let* pkh1_timeout, pkh2_timeout = + let+ timeout = Context.Sc_rollup.timeout (B block) rollup (pkh1, pkh2) in + let timeout = WithExceptions.Option.get ~loc:__LOC__ timeout in + if game_index.alice = pkh1 then (timeout.alice, timeout.bob) + else (timeout.bob, timeout.alice) + in + let* () = Assert.equal_int ~loc:__LOC__ pkh1_timeout 0 in + let* () = + Assert.equal_int ~loc:__LOC__ pkh2_timeout timeout_period_in_blocks + in + let* block = Block.bake_n timeout_period_in_blocks block in + let* timeout = Op.sc_rollup_timeout (B block) account3 rollup game_index in + let* incr = Incremental.begin_construction block in + let* incr = Incremental.add_operation incr timeout in + let expected_game_status : Sc_rollup.Game.status = + Ended (Loser {reason = Timeout; loser = pkh2}) + in + assert_timeout_result ~game_status:expected_game_status incr + +let init_with_conflict () = + let open Lwt_result_syntax in + let* block, (account1, account2) = context_init Context.T2 in + let pkh1 = Account.pkh_of_contract_exn account1 in + let pkh2 = Account.pkh_of_contract_exn account2 in + let* block, rollup = sc_originate block account1 "unit" in + let compressed_state = + Sc_rollup.State_hash.context_hash_to_state_hash + (Tezos_crypto.Context_hash.hash_string ["first"]) + in + let* commitment1 = + dummy_commitment ~compressed_state ~number_of_ticks:1L (B block) rollup + in + let compressed_state = + Sc_rollup.State_hash.context_hash_to_state_hash + (Tezos_crypto.Context_hash.hash_string ["second"]) + in + let* commitment2 = + dummy_commitment ~compressed_state ~number_of_ticks:1L (B block) rollup + in + let* block = add_publish ~rollup block account1 commitment1 in + let* block = add_publish ~rollup block account2 commitment2 in + let* start_game_op = + Op.sc_rollup_refute (B block) account1 rollup pkh2 None + in + let* block = add_op block start_game_op in + return (block, (account1, pkh1), (account2, pkh2), rollup) + +module Arith_pvm = Sc_rollup_helpers.Arith_pvm + +let dumb_proof ~choice = + let open Lwt_result_syntax in + let context_arith_pvm = Sc_rollup_helpers.make_empty_context () in + let empty = + Sc_rollup_helpers.In_memory_context.Tree.empty context_arith_pvm + in + let*! arith_state = Arith_pvm.initial_state ~empty in + let*! arith_state = Arith_pvm.install_boot_sector arith_state "" in + let input = Sc_rollup_helpers.make_external_input "c4c4" in + let* pvm_step = + Arith_pvm.produce_proof context_arith_pvm (Some input) arith_state + >|= Environment.wrap_tzresult + in + let pvm_step = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Arith_pvm) pvm_step + in + let inbox_proof = + Sc_rollup.Proof.Inbox_proof + { + level = Raw_level.root; + message_counter = Z.zero; + proof = + Sc_rollup.Inbox.Internal_for_tests.serialized_proof_of_string + "dummy proof"; + } + in + let proof = Sc_rollup.Proof.{pvm_step; input_proof = Some inbox_proof} in + return Sc_rollup.Game.{choice; step = Proof proof} + +(** Test that two invalid proofs from the two players lead to a draw + in the refutation game. *) +let test_draw_with_two_invalid_moves () = + let* block, (p1, p1_pkh), (p2, p2_pkh), rollup = init_with_conflict () in + + (* Player1 will play an invalid final move. *) + let* block = + let* p1_refutation = + let choice = Sc_rollup.Tick.initial in + dumb_proof ~choice + in + let* p1_final_move_op = + Op.sc_rollup_refute (B block) p1 rollup p2_pkh (Some p1_refutation) + in + add_op block p1_final_move_op + in + + (* Get the frozen bonds for the two players before the draw. *) + let* frozen_bonds_p1 = Context.Contract.frozen_bonds (B block) p1 in + let* frozen_bonds_p2 = Context.Contract.frozen_bonds (B block) p2 in + + (* Player2 will also send an invalid final move. *) + let* incr = + let* p2_refutation = + let choice = Sc_rollup.Tick.initial in + dumb_proof ~choice + in + let* p2_final_move_op = + Op.sc_rollup_refute (B block) p2 rollup p1_pkh (Some p2_refutation) + in + let* incr = Incremental.begin_construction block in + Incremental.add_operation incr p2_final_move_op + in + + (* As both players played invalid moves, the game ends in a draw. *) + let expected_game_status : Sc_rollup.Game.status = Ended Draw in + let* () = assert_refute_result ~game_status:expected_game_status incr in + + (* The two players should have been slashed. *) + let* constants = Context.get_constants (I incr) in + let stake_amount = constants.parametric.sc_rollup.stake_amount in + let* () = + Assert.frozen_bonds_was_debited + ~loc:__LOC__ + (I incr) + p1 + frozen_bonds_p1 + stake_amount + in + let* () = + Assert.frozen_bonds_was_debited + ~loc:__LOC__ + (I incr) + p2 + frozen_bonds_p2 + stake_amount + in + return_unit + +(** Test that timeout a player during the final move ends the game if + the other player played. *) +let test_timeout_during_final_move () = + let* block, (p1, p1_pkh), (_p2, p2_pkh), rollup = init_with_conflict () in + + (* Player1 will play an invalid final move. *) + let* block = + let* p1_refutation = + let choice = Sc_rollup.Tick.initial in + dumb_proof ~choice + in + + let* p1_final_move_op = + Op.sc_rollup_refute (B block) p1 rollup p2_pkh (Some p1_refutation) + in + add_op block p1_final_move_op + in + + (* Player2 will not play and it will be timeout. *) + let* incr = + let* constants = Context.get_constants (B block) in + let Constants.Parametric.{timeout_period_in_blocks; _} = + constants.parametric.sc_rollup + in + let* block = Block.bake_n timeout_period_in_blocks block in + let game_index = Sc_rollup.Game.Index.make p1_pkh p2_pkh in + let* timeout = Op.sc_rollup_timeout (B block) p1 rollup game_index in + let* incr = Incremental.begin_construction block in + Incremental.add_operation incr timeout + in + + (* As the player1 played an invalid move, the timeout is counted + as an invalid one too. The game ends in a draw. *) + let expected_game_status : Sc_rollup.Game.status = Ended Draw in + assert_timeout_result ~game_status:expected_game_status incr + +(** Test that playing a dissection during a final move is rejected. *) +let test_dissection_during_final_move () = + let* block, (p1, p1_pkh), (p2, p2_pkh), rollup = init_with_conflict () in + + (* Player1 will play an invalid final move. *) + let* block = + let* p1_refutation = + let choice = Sc_rollup.Tick.initial in + dumb_proof ~choice + in + + let* p1_final_move_op = + Op.sc_rollup_refute (B block) p1 rollup p2_pkh (Some p1_refutation) + in + add_op block p1_final_move_op + in + + (* Player2 will play a dissection. *) + let dumb_dissection = + let choice = Sc_rollup.Tick.initial in + Sc_rollup.Game.{choice; step = Dissection []} + in + let* p2_op = + Op.sc_rollup_refute (B block) p2 rollup p1_pkh (Some dumb_dissection) + in + (* Dissecting is no longer accepted. *) + let* incr = Incremental.begin_construction block in + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_game_repr.Dissecting_during_final_move as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "It should have failed with [Dissecting_during_final_move]" + in + let* (_incr : Incremental.t) = + Incremental.add_operation ~expect_apply_failure incr p2_op + in + return_unit + +let init_arith_state ~boot_sector = + let open Lwt_syntax in + let context = Sc_rollup_helpers.make_empty_context () in + let empty = Sc_rollup_helpers.In_memory_context.Tree.empty context in + let* state = Arith_pvm.initial_state ~empty in + let* state = Arith_pvm.install_boot_sector state boot_sector in + return (context, state) + +let make_arith_state ?(boot_sector = "") metadata = + let open Lwt_syntax in + let* _context, state = init_arith_state ~boot_sector in + let* state_hash1 = Arith_pvm.state_hash state in + + (* 1. We evaluate the boot sector. *) + let* input_required = Arith_pvm.is_input_state state in + assert (input_required = Sc_rollup.No_input_required) ; + let* state = Arith_pvm.eval state in + let* state_hash2 = Arith_pvm.state_hash state in + (* 2. The state now needs the metadata. *) + let* input_required = Arith_pvm.is_input_state state in + assert (input_required = Sc_rollup.Needs_reveal Reveal_metadata) ; + (* 3. We feed the state with the metadata. *) + let input = Sc_rollup.(Reveal (Metadata metadata)) in + let* state = Arith_pvm.set_input input state in + let* state_hash3 = Arith_pvm.state_hash state in + let* input_required = Arith_pvm.is_input_state state in + assert (input_required = Sc_rollup.Initial) ; + + return (state_hash1, state_hash2, state_hash3) + +let make_refutation_metadata ?(boot_sector = "") metadata = + let open Lwt_syntax in + let* context, state = init_arith_state ~boot_sector in + (* We will prove the tick after the evaluation of the boot sector. *) + let* state = Arith_pvm.eval state in + let input = Sc_rollup.(Reveal (Metadata metadata)) in + let* proof = Arith_pvm.produce_proof context (Some input) state in + let pvm_step = WithExceptions.Result.get_ok ~loc:__LOC__ proof in + let pvm_step = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup.Proof.serialize_pvm_step ~pvm:(module Arith_pvm) pvm_step + in + let choice = Sc_rollup.Tick.(next initial) in + let step : Sc_rollup.Game.step = + let input_proof = Some Sc_rollup.Proof.(Reveal_proof Metadata_proof) in + Proof {pvm_step; input_proof} + in + return Sc_rollup.Game.{choice; step} + +(** Test that during a refutation game when one malicious player lied on the + metadata, he can not win the game. *) +let test_refute_invalid_metadata () = + let open Lwt_result_syntax in + let* block, (account1, account2) = context_init Context.T2 in + let pkh1 = Account.pkh_of_contract_exn account1 in + let pkh2 = Account.pkh_of_contract_exn account2 in + let* block, rollup = sc_originate block account1 "unit" in + let* genesis_info = Context.Sc_rollup.genesis_info (B block) rollup in + let predecessor = genesis_info.commitment_hash in + + let post_commitment_from_metadata block account metadata = + let*! state1, state2, state3 = make_arith_state metadata in + let commitment : Sc_rollup.Commitment.t = + { + predecessor; + inbox_level = Raw_level.of_int32_exn 31l; + number_of_ticks = number_of_ticks_exn 2L; + compressed_state = state3; + } + in + let* block = add_publish ~rollup block account commitment in + return (block, state1, state2, state3) + in + + (* [account1] will play a valid commitment with the correct evaluation of + the [metadata]. *) + let valid_metadata = + Sc_rollup.Metadata. + {address = rollup; origination_level = Raw_level.(succ root)} + in + let* block, state1, state2, state3 = + post_commitment_from_metadata block account1 valid_metadata + in + + (* [account2] will play an invalid commitment with an invalid metadata. *) + let invalid_metadata = + {valid_metadata with origination_level = Raw_level.of_int32_exn 42l} + in + let* block, _, _, _ = + post_commitment_from_metadata block account2 invalid_metadata + in + + (* [account1] starts a refutation game. It will provide a dissection + that will directly allow a final move. It's a bit hack-ish, but we + know which tick we want to refute. + *) + let* start_game_op = + Op.sc_rollup_refute (B block) account1 rollup pkh2 None + in + let* block = add_op block start_game_op in + let dissection : Sc_rollup.Game.refutation = + let choice = Sc_rollup.Tick.initial in + let step : Sc_rollup.Game.step = + let zero = Sc_rollup.Tick.initial in + let one = Sc_rollup.Tick.next zero in + let two = Sc_rollup.Tick.next one in + Dissection + [ + {tick = zero; state_hash = Some state1}; + {tick = one; state_hash = Some state2}; + {tick = two; state_hash = Some state3}; + ] + in + {choice; step} + in + let* dissection_op = + Op.sc_rollup_refute (B block) account1 rollup pkh2 (Some dissection) + in + let* block = add_op block dissection_op in + + (* [account2] will play an invalid proof about the invalid metadata. *) + let*! proof = make_refutation_metadata invalid_metadata in + let* proof1_op = + Op.sc_rollup_refute (B block) account2 rollup pkh1 (Some proof) + in + let* block = add_op block proof1_op in + + (* We can implicitely check that [proof1_op] was invalid if + [account1] wins the game. *) + let*! proof = make_refutation_metadata valid_metadata in + let* incr = Incremental.begin_construction block in + let* proof2_op = + Op.sc_rollup_refute (I incr) account1 rollup pkh2 (Some proof) + in + let* incr = Incremental.add_operation incr proof2_op in + let expected_game_status : Sc_rollup.Game.status = + Ended (Loser {reason = Conflict_resolved; loser = pkh2}) + in + assert_refute_result ~game_status:expected_game_status incr + +let full_history_inbox (predecessor_timestamp, predecessor) + all_external_messages = + let open Sc_rollup_helpers in + let payloads_per_levels = + List.map + (fun ((predecessor_timestamp, predecessor), level, external_messages) -> + wrap_messages + ~predecessor_timestamp + ~predecessor + level + external_messages) + all_external_messages + in + Sc_rollup_helpers.construct_inbox + ~predecessor_timestamp + ~predecessor + payloads_per_levels + +let input_included ~snapshot ~full_history_inbox (l, n) = + let open Sc_rollup_helpers in + let payloads_histories, history, inbox = full_history_inbox in + let history_proof = Sc_rollup.Inbox.old_levels_messages inbox in + (* Create an inclusion proof of the inbox message at [(l, n)]. *) + let* proof, _ = + Sc_rollup.Inbox.produce_proof + ~get_payloads_history:(get_payloads_history payloads_histories) + ~get_history:(get_history history) + history_proof + (l, n) + >|= Environment.wrap_tzresult + in + let*? inbox_message_verified = + Sc_rollup.Inbox.verify_proof (l, n) snapshot proof + |> Environment.wrap_tzresult + in + return + @@ Option.map + (fun inbox_message -> Sc_rollup.Inbox_message inbox_message) + inbox_message_verified + +(** Test that the protocol adds a [SOL], [Info_per_level] and [EOL] for each + Tezos level, even if no messages are added to the inbox. *) +let test_automatically_added_internal_messages () = + let assert_input_included ~snapshot ~full_history_inbox (l, n) input = + let* input_verified = input_included ~snapshot ~full_history_inbox (l, n) in + Assert.equal + ~loc:__LOC__ + (Option.equal Sc_rollup.input_equal) + "Input found with the proof is different from input provided" + (fun ppf v -> + match v with + | None -> Format.pp_print_string ppf "None" + | Some v -> Sc_rollup.pp_input ppf v) + input_verified + input + in + + let info_per_block (block : Block.t) = + (block.header.shell.timestamp, block.hash) + in + + (* Create the first block. *) + let* block, account = context_init Context.T1 in + + let level_zero_info = + ( Time.Protocol.epoch, + Tezos_crypto.Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisCCCCCeZiLHU" ) + in + + let level_one_info = info_per_block block in + (* Bake a second block. *) + let* block = Block.bake block in + + let level_two_info = info_per_block block in + (* Bake a third block where a message is added. *) + let* operation = Op.sc_rollup_add_messages (B block) account ["foo"] in + let* block = Block.bake ~operation block in + + let* inbox = Context.Sc_rollup.inbox (B block) in + let snapshot = Sc_rollup.Inbox.take_snapshot inbox in + + let level_one = Raw_level.of_int32_exn 1l in + let level_two = Raw_level.of_int32_exn 2l in + let*? ((_level_tree_histories, _history, inbox) as full_history_inbox) = + full_history_inbox + level_zero_info + [(level_one_info, level_one, []); (level_two_info, level_two, ["foo"])] + in + + let level_two = Raw_level.of_int32_exn 2l in + (* Assert SOL is at position 0. *) + let sol = Sc_rollup_helpers.make_sol ~inbox_level:level_two in + let* () = + assert_input_included + ~snapshot + ~full_history_inbox + (level_two, Z.zero) + (Some sol) + in + + (* Assert Info_per_level is at position 1. *) + let predecessor_timestamp, predecessor = level_two_info in + let info_per_level = + Sc_rollup_helpers.make_info_per_level + ~inbox_level:level_two + ~predecessor_timestamp + ~predecessor + in + let* () = + assert_input_included + ~snapshot + ~full_history_inbox + (level_two, Z.one) + (Some info_per_level) + in + + (* Assert EOL is at the end of inbox level. *) + let eol = + Sc_rollup_helpers.make_eol + ~inbox_level:level_two + ~message_counter:(Z.of_int 3) + in + let* () = + assert_input_included + ~snapshot + ~full_history_inbox + (level_two, Z.of_int 3) + (Some eol) + in + (* Assert EOL was the last message of the inbox level. *) + let* () = + assert_input_included + ~snapshot + ~full_history_inbox + (level_two, Z.of_int 4) + None + in + + (* Assert the computed inbox and protocol's inbox are equal. *) + let history_proof = Sc_rollup.Inbox.old_levels_messages inbox in + Assert.equal + ~loc:__LOC__ + Sc_rollup.Inbox.equal_history_proof + "Computed and protocol inboxes aren't equal" + Sc_rollup.Inbox.pp_history_proof + snapshot + history_proof + +(** With [Start_of_level] and [End_of_level] inbox messages in each inbox level, + it's impossible to give a valid commitment with 0 ticks. *) +let test_zero_tick_commitment_fails () = + let* ctxt, contract, rollup = init_and_originate Context.T1 "unit" in + let* incr = Incremental.begin_construction ctxt in + let* commitment = dummy_commitment (I incr) rollup in + let commitment = {commitment with number_of_ticks = number_of_ticks_exn 0L} in + let* publish_commitment = + Op.sc_rollup_publish (B ctxt) contract rollup commitment + in + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_zero_tick_commitment as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> + failwith "It should have failed with [Sc_rollup_zero_tick_commitment]" + in + let* _incr = + Incremental.add_operation ~expect_apply_failure incr publish_commitment + in + return_unit + +(** [test_curfew] creates a rollup, publishes two conflicting + commitments. Branches are expected to continue (commitment are able to be + published). Tries to publish another commitment at the same initial + `inbox_level` after [challenge_window_in_blocks - 1] and after + [challenge_window_in_blocks] blocks. Only the first attempt is expected to + succeed. *) +let test_curfew () = + let open Lwt_result_syntax in + let* block, (account1, account2, account3), rollup = + (* sc_rollup_challenge_window_in_blocks should be at least commitment period *) + init_and_originate + ~sc_rollup_challenge_window_in_blocks:60 + Context.T3 + "unit" + in + let* constants = Context.get_constants (B block) in + let challenge_window = + constants.parametric.sc_rollup.challenge_window_in_blocks + in + let* publish1, commitment1 = + publish_op_and_dummy_commitment + ~src:account1 + ~compressed_state:"first" + rollup + block + in + let* publish2, commitment2 = + publish_op_and_dummy_commitment + ~src:account2 + ~compressed_state:"second" + rollup + block + in + let* block = bake_blocks_until_inbox_level block commitment1 in + let* block = Block.bake ~operations:[publish1; publish2] block in + let* block = Block.bake_n (challenge_window - 1) block in + + let* publish11, commitment11 = + publish_op_and_dummy_commitment + ~src:account1 + ~predecessor:commitment1 + rollup + block + in + let* publish21, commitment21 = + publish_op_and_dummy_commitment + ~src:account2 + ~predecessor:commitment2 + rollup + block + in + let* publish3, _commitment3 = + publish_op_and_dummy_commitment + ~src:account3 + ~compressed_state:"third" + rollup + block + in + let* block = bake_blocks_until_inbox_level block commitment11 in + let* block = Block.bake ~operations:[publish11; publish21; publish3] block in + let* publish111, commitment111 = + publish_op_and_dummy_commitment + ~src:account1 + ~predecessor:commitment11 + rollup + block + in + let* publish211, _commitment211 = + publish_op_and_dummy_commitment + ~src:account2 + ~predecessor:commitment21 + rollup + block + in + let* publish4, _commitment4 = + publish_op_and_dummy_commitment + ~src:account3 + ~compressed_state:"fourth" + rollup + block + in + let* block = bake_blocks_until_inbox_level block commitment111 in + let* incr = Incremental.begin_construction block in + let* incr = Incremental.add_operation incr publish111 in + let* incr = Incremental.add_operation incr publish211 in + let expect_apply_failure = function + | Environment.Ecoproto_error + (Sc_rollup_errors.Sc_rollup_commitment_past_curfew as e) + :: _ -> + Assert.test_error_encodings e ; + return_unit + | _ -> + failwith "It should have failed with [Sc_rollup_commitment_past_curfew]" + in + let* _incr = Incremental.add_operation ~expect_apply_failure incr publish4 in + return_unit + +(** [test_curfew_period_is_started_only_after_first_publication checks that + publishing the first commitment of a given [inbox_level] after + [inbox_level + challenge_window] is still possible. *) +let test_curfew_period_is_started_only_after_first_publication () = + let open Lwt_result_syntax in + let* block, account1, rollup = init_and_originate Context.T1 "unit" in + let* constants = Context.get_constants (B block) in + let challenge_window = + constants.parametric.sc_rollup.challenge_window_in_blocks + in + let commitment_period = + constants.parametric.sc_rollup.commitment_period_in_blocks + in + let* block = Block.bake_n commitment_period block in + let* block = Block.bake_n challenge_window block in + let* commitment = dummy_commitment (B block) rollup in + let* operation = Op.sc_rollup_publish (B block) account1 rollup commitment in + let* _block = Block.bake ~operation block in + return_unit + +let test_offline_staker_does_not_prevent_cementation () = + let* ctxt, contracts, rollup = init_and_originate Context.T2 "unit" in + let contract1, contract2 = contracts in + let* ctxt = bake_blocks_until_next_inbox_level ctxt rollup in + (* A publishes a commitment on C1. *) + let* commitment1 = dummy_commitment (B ctxt) rollup in + let* operation = Op.sc_rollup_publish (B ctxt) contract1 rollup commitment1 in + let* b = Block.bake ~operation ctxt in + + (* We cement C1. *) + let* constants = Context.get_constants (B b) in + let* b = + Block.bake_n constants.parametric.sc_rollup.challenge_window_in_blocks b + in + let hash = Sc_rollup.Commitment.hash_uncarbonated commitment1 in + let* cement_op = Op.sc_rollup_cement (B b) contract1 rollup hash in + let* b = Block.bake ~operation:cement_op b in + + (* A now goes offline, B takes over. *) + let* commitment2 = dummy_commitment (B b) rollup in + let commitment2 = + { + commitment2 with + predecessor = hash; + inbox_level = Raw_level.of_int32_exn 61l; + } + in + let* operation2 = + Op.sc_rollup_publish (B ctxt) contract2 rollup commitment2 + in + let* b = bake_blocks_until_inbox_level b commitment2 in + let* b = Block.bake ~operation:operation2 b in + + (* We cement C2. *) + let* constants = Context.get_constants (B b) in + let* b = + Block.bake_n constants.parametric.sc_rollup.challenge_window_in_blocks b + in + let hash = Sc_rollup.Commitment.hash_uncarbonated commitment2 in + let* cement_op = Op.sc_rollup_cement (B b) contract2 rollup hash in + let* _b = Block.bake ~operation:cement_op b in + return_unit + +let tests = + [ + Tztest.tztest + "check effect of disabled feature flag" + `Quick + test_disable_feature_flag; + Tztest.tztest + "can publish a commit, cement it and withdraw stake" + `Quick + test_publish_cement_and_recover_bond; + Tztest.tztest + "publish will fail if staker is backtracking" + `Quick + test_publish_fails_on_backtrack; + Tztest.tztest + "cement will fail if commitment is contested" + `Quick + test_cement_fails_on_conflict; + Tztest.tztest + "check the challenge window period boundaries" + `Quick + test_challenge_window_period_boundaries; + Tztest.tztest + "originating with invalid types" + `Quick + test_originating_with_invalid_types; + Tztest.tztest + "originating with valid type" + `Quick + test_originating_with_valid_type; + Tztest.tztest + "originating with invalid boot sector proof" + `Quick + test_originating_with_invalid_boot_sector_proof; + Tztest.tztest + "originating with invalid kind proof" + `Quick + test_originating_with_invalid_kind_proof; + Tztest.tztest + "originating with random proof" + `Quick + test_originating_with_random_proof; + Tztest.tztest + "originating with proof for Tezos context trees" + `Quick + (test_originating_with_wrong_tree ~alter_binary_bit:false); + Tztest.tztest + "originating with proof for Tezos context trees trying to pass as a \ + binary tree" + `Quick + (test_originating_with_wrong_tree ~alter_binary_bit:true); + Tztest.tztest + "single transaction atomic batch" + `Quick + test_single_transaction_batch; + Tztest.tztest + "execute outbox message against older cemented commitment" + `Quick + test_older_cemented_commitment; + Tztest.tztest + "multi-transaction atomic batch" + `Quick + test_multi_transaction_batch; + Tztest.tztest + "transaction with invalid type" + `Quick + test_transaction_with_invalid_type; + Tztest.tztest "execute same message twice" `Quick test_execute_message_twice; + Tztest.tztest + "execute same message twice against different cemented commitments" + `Quick + test_execute_message_twice_different_cemented_commitments; + Tztest.tztest + "transaction with zero amount ticket" + `Quick + test_zero_amount_ticket; + Tztest.tztest "invalid output proof" `Quick test_invalid_output_proof; + Tztest.tztest + "outbox message that overrides an old slot" + `Quick + test_execute_message_override_applied_messages_slot; + Tztest.tztest + "insufficient ticket balances" + `Quick + test_insufficient_ticket_balances; + Tztest.tztest + "inbox max number of messages per inbox level" + `Quick + test_inbox_max_number_of_messages_per_level; + Tztest.tztest + "Test that a player can't timeout another player before timeout period \ + and related timeout value." + `Quick + test_timeout; + Tztest.tztest + "Test that a player cannot play more than max_number_of_parallel_games \ + games in parallel." + `Quick + test_number_of_parallel_games_bounded; + Tztest.tztest + "Two invalid final moves end the game in a draw situation" + `Quick + test_draw_with_two_invalid_moves; + Tztest.tztest + "Timeout during the final move can end the game in a draw situation" + `Quick + test_timeout_during_final_move; + Tztest.tztest + "Cannot play a dissection when the final move has started" + `Quick + test_dissection_during_final_move; + Tztest.tztest + "Invalid metadata initialization can be refuted" + `Quick + test_refute_invalid_metadata; + Tztest.tztest + "Test that SOL/Info_per_level/EOL are added in the inbox" + `Quick + test_automatically_added_internal_messages; + Tztest.tztest + "0-tick commitments are forbidden" + `Quick + test_zero_tick_commitment_fails; + Tztest.tztest "check the curfew functionality" `Quick test_curfew; + Tztest.tztest + "check that a commitment can be published after the inbox_level + \ + challenge window is passed." + `Quick + test_curfew_period_is_started_only_after_first_publication; + Tztest.tztest + "An offline staker should not prevent cementation" + `Quick + test_offline_staker_does_not_prevent_cementation; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml new file mode 100644 index 000000000000..e8b50eac379c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml @@ -0,0 +1,420 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Sc rollup L1/L2 communication + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^sc rollup transfer$" + Subject: Test transfers from Michelson to smart contract rollups +*) + +open Protocol +open Alpha_context +open Lwt_result_syntax + +(* Helpers *) + +exception Unexpected_error + +let check_proto_error ~loc ~exp f trace = + let*? proto_trace = + List.map_e + (function + | Environment.Ecoproto_error e -> ok e + | e -> + error_with + "At %s, expected protocol error %s, got non-protocol error %a in \ + trace %a" + loc + exp + Error_monad.pp + e + Error_monad.pp_print_trace + trace) + trace + in + try f proto_trace + with Unexpected_error -> + failwith + "At %s, expected error %s, got %a" + loc + exp + Error_monad.pp_print_trace + trace + +let sc_originate = Test_sc_rollup.sc_originate + +(* A contract with four entrypoints: + - [transfer_non_zero] takes a [contract int] and attempts to transfer with a + non-zero amount to it. Expected to fail. + + - [transfer_int] takes a [contract int] and transfers an int to it. Expected + to succeed. + + - [transfer_zero_ticket] takes a [contract (ticket string)] and transfers a + zero-amount ticket to it. Expected to fail. + + - [transfer_ticket] takes a [contract (ticket string)] and transfers a + ticket to it. Expected to succeed. +*) +let contract_originate block account = + let script = + {| + parameter (or (contract %transfer_non_zero int) + (or (contract %transfer_int int) + (or (contract %transfer_zero_ticket (ticket string)) + (or (contract %transfer_ticket (ticket string)) + never)))); + storage unit; + code { + UNPAIR; + IF_LEFT { + # transfer_non_zero + PUSH mutez 1; + PUSH int 42; + TRANSFER_TOKENS; + } { + IF_LEFT { + # transfer_int + PUSH mutez 0; + PUSH int 42; + TRANSFER_TOKENS; + } { + IF_LEFT { + # transfer_zero_ticket + PUSH mutez 0; + PUSH nat 0; + PUSH string "ticket payload"; + TICKET; + ASSERT_SOME; + TRANSFER_TOKENS; + } { + IF_LEFT { + # transfer ticket + PUSH mutez 0; + PUSH nat 137; + PUSH string "G"; + TICKET; + ASSERT_SOME; + TRANSFER_TOKENS; + } { + NEVER + } + } + } + }; + NIL operation; + SWAP; + CONS; + PAIR } +|} + in + Contract_helpers.originate_contract_from_string_hash + ~baker:(Context.Contract.pkh account) + ~source_contract:account + ~script + ~storage:"Unit" + block + +let context_init ty = + let* b, c = Test_sc_rollup.context_init T1 in + let* contract, _script, b = contract_originate b c in + let* b, rollup = sc_originate b c ty in + return (b, c, contract, rollup) + +let transfer ?expect_apply_failure b ~from ~to_ ~param ~entrypoint = + let parameters = Script.lazy_expr (Expr.from_string param) in + let* op = + Op.transaction + (B b) + from + (Contract.Originated to_) + Tez.zero + ~parameters + ~entrypoint:(Entrypoint.of_string_strict_exn entrypoint) + ~gas_limit:High + in + let* inc = Incremental.begin_construction b in + let* inc = Incremental.add_operation ?expect_apply_failure inc op in + Incremental.finalize_block inc + +(* Tests *) + +(* Test parsing a [contract] with a badly formatted sr1 address. *) +let test_transfer_to_bad_sc_rollup_address () = + let* b, c, contract, _rollup = context_init "unit" in + let not_an_sc_rollup_address = {|"sr1Fq8fPi2NjhWUXtcXBggbL6zFjZctDamso"|} in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param:not_an_sc_rollup_address + ~entrypoint:"transfer_non_zero" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Invalid_destination_b58check" + @@ function + | [ + Script_interpreter.Bad_contract_parameter _; + Script_tc_errors.Invalid_constant (_loc, _expr, ty); + Destination_repr.Invalid_destination_b58check _; + ] -> + Assert.equal_string + ~loc:__LOC__ + "(contract int)" + (Expr.to_string ty) + | _ -> raise Unexpected_error) + in + return_unit + +(* Now, the address is well-formatted but the rollup does not exist. *) +let test_transfer_to_unknown_sc_rollup_address () = + let* b, c, contract, _rollup = context_init "unit" in + let unknown_sc_rollup_address = {|"sr1Fq8fPi2NjhWUXtcXBggbL6zFjZctGkmso"|} in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param:unknown_sc_rollup_address + ~entrypoint:"transfer_non_zero" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Sc_rollup_does_not_exist" + @@ function + | [ + Script_interpreter.Bad_contract_parameter _; + Script_tc_errors.Invalid_constant _; + Sc_rollup_errors.Sc_rollup_does_not_exist _; + ] -> + return_unit + | _ -> raise Unexpected_error) + in + return_unit + +(* Now, let's originate an sc rollup, use its address but with a wrong type. *) +let test_transfer_to_wrongly_typed_sc_rollup () = + let* b, c, contract, rollup = context_init "unit" in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param + ~entrypoint:"transfer_non_zero" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Inconsistent_types" @@ function + | [ + Script_interpreter.Bad_contract_parameter _; + Script_tc_errors.Invalid_constant _; + Script_tc_errors.Inconsistent_types _; + Script_tc_errors.Inconsistent_types _; + ] -> + return_unit + | _ -> raise Unexpected_error) + in + return_unit + +(* Use the correct type but with a non-zero amount. *) +let test_transfer_non_zero_amount () = + let* b, c, contract, rollup = context_init "int" in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param + ~entrypoint:"transfer_non_zero" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Rollup_invalid_transaction_amount" + @@ function + | [ + Script_interpreter.Runtime_contract_error _; + Script_interpreter_defs.Rollup_invalid_transaction_amount; + ] -> + return_unit + | _ -> raise Unexpected_error) + in + return_unit + +(* Use the correct type through an entrypoint but with a non-zero amount. *) +let test_transfer_non_zero_amount_via_entrypoint () = + let* b, c, contract, rollup = context_init "int" in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param + ~entrypoint:"transfer_non_zero" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Rollup_invalid_transaction_amount" + @@ function + | [ + Script_interpreter.Runtime_contract_error _; + Script_interpreter_defs.Rollup_invalid_transaction_amount; + ] -> + return_unit + | _ -> raise Unexpected_error) + in + return_unit + +(* Now, transfer with a zero-amount and check that the inbox has been updated correctly. *) +let test_transfer_works () = + let* b, c, contract, rollup = context_init "int" in + let* inbox_before = Context.Sc_rollup.inbox (B b) in + let* expected_inbox_after = + let* inc = Incremental.begin_construction b in + let ctxt = Incremental.alpha_ctxt inc in + let payload = Expr.from_string "42" in + let* ctxt = + Sc_rollup.Inbox.add_deposit + ctxt + ~destination:rollup + ~payload + ~sender:contract + ~source:(Context.Contract.pkh c) + >|= Environment.wrap_tzresult + in + let incr = Incremental.set_alpha_ctxt inc ctxt in + let* block = Incremental.finalize_block incr in + let* expected_inbox_after = Context.Sc_rollup.inbox (B block) in + return expected_inbox_after + in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* b = transfer b ~from:c ~to_:contract ~param ~entrypoint:"transfer_int" in + let* inbox_after = Context.Sc_rollup.inbox (B b) in + let* () = + Assert.not_equal_with_encoding + ~loc:__LOC__ + Sc_rollup.Inbox.encoding + inbox_before + inbox_after + in + Assert.equal_with_encoding + ~loc:__LOC__ + Sc_rollup.Inbox.encoding + inbox_after + expected_inbox_after + +(* Transfer of zero-amount ticket fails. *) +let test_transfer_zero_amount_ticket () = + let* b, c, contract, rollup = context_init "ticket string" in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* (_b : Block.t) = + transfer + b + ~from:c + ~to_:contract + ~param + ~entrypoint:"transfer_zero_ticket" + ~expect_apply_failure: + (check_proto_error ~loc:__LOC__ ~exp:"Script_rejected" @@ function + | [ + Script_interpreter.Runtime_contract_error _; + Script_interpreter.Reject _; + ] -> + return_unit + | _ -> raise Unexpected_error) + in + return_unit + +(* Transfer of a non-zero-amount ticket works and the balance table is correctly updated. *) +let test_transfer_non_zero_amount_ticket () = + let* b, c, contract, rollup = context_init "ticket string" in + let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in + let* b = + transfer b ~from:c ~to_:contract ~param ~entrypoint:"transfer_ticket" + in + let* ticket_key_for_contract, ticket_key_for_rollup, ctxt = + let* ticket_token = + Ticket_helpers.string_ticket_token + (Contract_hash.to_b58check contract) + "G" + in + let* inc = Incremental.begin_construction b in + let ctxt = Incremental.alpha_ctxt inc in + let* ticket_key_for_contract, ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract (Originated contract)) + ticket_token + >|= Environment.wrap_tzresult + in + let* ticket_key_for_rollup, _ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Sc_rollup rollup) + ticket_token + >|= Environment.wrap_tzresult + in + return (ticket_key_for_contract, ticket_key_for_rollup, ctxt) + in + (* The rollup is the owner of the tickets *) + let* () = + Ticket_helpers.assert_balance + ctxt + ~loc:__LOC__ + ticket_key_for_rollup + (Some 137) + in + (* The contract didn't retain any ticket in the operation *) + let* () = + Ticket_helpers.assert_balance ctxt ~loc:__LOC__ ticket_key_for_contract None + in + return_unit + +let tests = + [ + Tztest.tztest + "Transfer to a bad sc rollup address" + `Quick + test_transfer_to_bad_sc_rollup_address; + Tztest.tztest + "Transfer to an unknown rollup address" + `Quick + test_transfer_to_unknown_sc_rollup_address; + Tztest.tztest + "Transfer with a wrong type" + `Quick + test_transfer_to_wrongly_typed_sc_rollup; + Tztest.tztest + "Transfer with a non-zero amount" + `Quick + test_transfer_non_zero_amount_via_entrypoint; + Tztest.tztest "Transfer works" `Quick test_transfer_works; + Tztest.tztest + "Transfer of zero-amount ticket" + `Quick + test_transfer_zero_amount_ticket; + Tztest.tztest + "Transfer of non-zero-amount ticket" + `Quick + test_transfer_non_zero_amount_ticket; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml new file mode 100644 index 000000000000..fd437a82ae80 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml @@ -0,0 +1,896 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (transfer) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^transfer$" + Subject: Quantities transfer between contracts. +*) + +open Protocol +open Alpha_context +open Test_tez +open Transfers + +(*********************************************************************) +(* Utility functions *) +(*********************************************************************) + +(** + [transfer_to_itself_and_check_balances b fee contract amount] + this function takes a block, an optional parameter fee, + a contract that is a source and a destination contract, + and an amount of tez that one wants to transfer. + + 1- Transfer the amount of tez (w/wo transfer fee) from/to a contract itself. + + 2- Check the equivalent of the balance of the contract before + and after transfer. + + This function returns a pair: + - a block that added the valid transaction + - an valid transaction *) +let transfer_to_itself_and_check_balances ~loc ?policy b ?(fee = Tez.zero) + contract amount = + Context.Contract.balance (B b) contract >>=? fun bal -> + Op.transaction (B b) ~fee contract contract amount >>=? fun operation -> + Block.bake ?policy ~operation b >>=? fun b -> + Assert.balance_was_debited ~loc (B b) contract bal fee >|=? fun () -> + (b, operation) + +let ten_tez = of_int 10 + +(*********************************************************************) +(* Tests *) +(*********************************************************************) + +(** Compute a fraction of 2/[n] of the balance of [contract] *) +let two_over_n_of_balance ctxt contract n = + Context.Contract.balance ctxt contract >>=? fun balance -> + Lwt.return (balance /? n >>? fun res -> res *? 2L) + +(********************) +(** Single transfer *) + +(********************) + +let single_transfer ?fee ?expect_apply_failure amount = + Context.init2 () >>=? fun (b, (contract_1, contract_2)) -> + Incremental.begin_construction b >>=? fun b -> + transfer_and_check_balances + ~loc:__LOC__ + ?fee + ?expect_apply_failure + b + contract_1 + contract_2 + amount + >>=? fun (b, _) -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(** Single transfer without fee. *) +let test_block_with_a_single_transfer () = single_transfer Tez.one + +(** Single transfer with fee. *) +let test_block_with_a_single_transfer_with_fee () = + single_transfer ~fee:Tez.one Tez.one + +(** Single transfer without fee. *) +let test_transfer_zero_tez () = + let expect_apply_failure = function + | Environment.Ecoproto_error (Apply.Empty_transaction _ as err) :: _ -> + Assert.test_error_encodings err ; + return_unit + | _ -> failwith "Empty transaction should fail" + in + single_transfer ~expect_apply_failure Tez.zero + +(** Transfer zero tez from an implicit contract. *) +let test_transfer_zero_implicit () = + Context.init1 () >>=? fun (b, dest) -> + let account = Account.new_account () in + Incremental.begin_construction b >>=? fun i -> + let src = Contract.Implicit account.Account.pkh in + Op.transaction (I i) src dest Tez.zero >>=? fun op -> + Incremental.add_operation i op >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Contract_storage.Empty_implicit_contract _ as err -> + Assert.test_error_encodings err ; + true + | _ -> false) + +(** Transfer to originated contract. *) +let test_transfer_to_originate_with_fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, contract) -> + two_over_n_of_balance (B b) contract 10L >>=? fun fee -> + (* originated contract, paying a fee to originated this contract *) + Op.contract_origination (B b) ~fee:ten_tez contract ~script:Op.dummy_script + >>=? fun (operation, new_contract) -> + Block.bake ~operation b >>=? fun b -> + two_over_n_of_balance (B b) contract 3L >>=? fun amount -> + Incremental.begin_construction b >>=? fun i -> + transfer_and_check_balances ~loc:__LOC__ i ~fee contract new_contract amount + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit + +(** Transfer from balance. *) +let test_transfer_amount_of_contract_balance () = + Context.init2 () >>=? fun (b, (contract_1, contract_2)) -> + let pkh1 = Context.Contract.pkh contract_1 in + (* given that contract_1 no longer has a sufficient balance to bake, + make sure it cannot be chosen as baker *) + Incremental.begin_construction b ~policy:(Block.Excluding [pkh1]) + >>=? fun b -> + (* get the balance of the source contract *) + Context.Contract.balance (I b) contract_1 >>=? fun balance -> + (* transfer all the tez inside contract 1 *) + transfer_and_check_balances ~loc:__LOC__ b contract_1 contract_2 balance + >>=? fun (b, _) -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(** Transfer to oneself. *) +let test_transfers_to_self () = + Context.init2 ~consensus_threshold:0 () >>=? fun (b, (contract, _)) -> + two_over_n_of_balance (B b) contract 3L >>=? fun amount -> + let pkh1 = Context.Contract.pkh contract in + transfer_to_itself_and_check_balances + ~loc:__LOC__ + ~policy:(Block.Excluding [pkh1]) + b + contract + amount + >>=? fun (b, _) -> + two_over_n_of_balance (B b) contract 5L >>=? fun fee -> + transfer_to_itself_and_check_balances + ~loc:__LOC__ + b + ~policy:(Block.Excluding [pkh1]) + ~fee + contract + ten_tez + >>=? fun (_, _) -> return_unit + +(** Forgot to add the valid transaction into the block. *) +let test_missing_transaction () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + (* given that contract_1 no longer has a sufficient balance to bake, + make sure it cannot be chosen as baker *) + let pkh1 = Context.Contract.pkh contract_1 in + Incremental.begin_construction b ~policy:(Block.Excluding [pkh1]) + >>=? fun i -> + two_over_n_of_balance (B b) contract_1 6L >>=? fun amount -> + (* Do the transfer 3 times from source contract to destination contract *) + n_transactions 3 i contract_1 contract_2 amount >>=? fun i -> + (* do the fourth transfer from source contract to destination contract *) + Op.transaction (I i) contract_1 contract_2 amount + >>=? fun (_ : packed_operation) -> + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit + +(** Transfer zero tez to an implicit contract, with fee equals balance of src. *) +let test_transfer_zero_implicit_with_bal_src_as_fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, dest) -> + let account = Account.new_account () in + let src_pkh = account.Account.pkh in + let src = Contract.Implicit src_pkh in + Op.transaction ~force_reveal:true (B b) dest src (Tez.of_mutez_exn 100L) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Context.Contract.balance (B b) src >>=? fun bal_src -> + Assert.equal_tez ~loc:__LOC__ bal_src (Tez.of_mutez_exn 100L) >>=? fun () -> + Op.transaction ~force_reveal:true (B b) ~fee:bal_src src dest Tez.zero + >>=? fun op -> + (* Transferring zero tez should result in an application failure as + the implicit contract has been depleted. *) + let expect_apply_failure = function + | [ + Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract pkh); + ] + when pkh = src_pkh -> + return_unit + | _ -> assert false + in + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation ~expect_apply_failure i op >>=? fun inc -> + Context.Contract.balance (I inc) src >>=? fun balance -> + (* We assert that the failing operation was included and that the + fees were taken, effectively depleting the contract. *) + Assert.equal_tez ~loc:__LOC__ balance Tez.zero >>=? fun () -> + (* Empty contracts should be unrevealed *) + Context.Contract.is_manager_key_revealed (I inc) src >>=? fun revelead -> + when_ revelead (fun () -> + Stdlib.failwith "Empty account still exists and is revealed.") + +(** Transfer zero tez to an originated contract, with fee equals balance of src. *) +let test_transfer_zero_to_originated_with_bal_src_as_fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, dest) -> + let account = Account.new_account () in + let src = Contract.Implicit account.Account.pkh in + Op.transaction (B b) dest src (Tez.of_mutez_exn 100L) >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.contract_origination (B b) dest ~script:Op.dummy_script + >>=? fun (operation, new_contract) -> + Block.bake ~operation b >>=? fun b -> + Context.Contract.balance (B b) src >>=? fun bal_src -> + Op.revelation (B b) ~fee:Tez.zero account.pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.transaction (B b) ~fee:bal_src src new_contract Tez.zero + >>=? fun operation -> + Assert.equal_tez ~loc:__LOC__ bal_src (Tez.of_mutez_exn 100L) >>=? fun () -> + Block.bake ~operation b >>=? fun (_ : Block.t) -> return_unit + +(** Transfer one tez to an implicit contract, with fee equals balance of src. *) +let test_transfer_one_to_implicit_with_bal_src_as_fee () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, dest) -> + let account = Account.new_account () in + let src = Contract.Implicit account.Account.pkh in + Op.transaction (B b) dest src (Tez.of_mutez_exn 100L) >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Context.Contract.balance (B b) src >>=? fun bal_src -> + Assert.equal_tez ~loc:__LOC__ bal_src (Tez.of_mutez_exn 100L) >>=? fun () -> + Op.revelation (B b) ~fee:Tez.zero account.pk >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Op.transaction (B b) ~fee:bal_src src dest Tez.one >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op ~expect_apply_failure:(function + | Environment.Ecoproto_error (Contract_storage.Balance_too_low _ as err) + :: _ -> + Assert.test_error_encodings err ; + return_unit + | t -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t) + >>=? fun (_ : Incremental.t) -> return_unit + +(********************) +(* The following tests are for different kind of contracts: + - implicit to implicit + - implicit to originated + - originated to implicit + - originated to originated *) + +(********************) + +(** Implicit to Implicit. *) +let test_transfer_from_implicit_to_implicit_contract () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap_contract) -> + let account_a = Account.new_account () in + let account_b = Account.new_account () in + let src = Contract.Implicit account_a.Account.pkh in + two_over_n_of_balance (B b) bootstrap_contract 3L >>=? fun amount1 -> + two_over_n_of_balance (B b) bootstrap_contract 10L >>=? fun fee1 -> + Incremental.begin_construction b >>=? fun i -> + transfer_and_check_balances + ~with_burn:true + ~loc:__LOC__ + ~fee:fee1 + i + bootstrap_contract + src + amount1 + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + (* Create an implicit contract as a destination contract. *) + let dest = Contract.Implicit account_b.pkh in + two_over_n_of_balance (I i) bootstrap_contract 4L >>=? fun amount2 -> + two_over_n_of_balance (I i) bootstrap_contract 10L >>=? fun fee2 -> + (* Transfer from implicit contract to another implicit contract. *) + transfer_and_check_balances + ~with_burn:true + ~loc:__LOC__ + ~fee:fee2 + i + src + dest + amount2 + >>=? fun (b, _) -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(** Implicit to originated. *) +let test_transfer_from_implicit_to_originated_contract () = + Context.init1 ~consensus_threshold:0 () >>=? fun (b, bootstrap_contract) -> + let contract = bootstrap_contract in + let account = Account.new_account () in + let src = Contract.Implicit account.Account.pkh in + two_over_n_of_balance (B b) bootstrap_contract 3L >>=? fun amount1 -> + Incremental.begin_construction b >>=? fun i -> + (* transfer the money to implicit contract *) + transfer_and_check_balances + ~with_burn:true + ~loc:__LOC__ + i + bootstrap_contract + src + amount1 + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + (* originated contract *) + Op.contract_origination + ~force_reveal:true + (I i) + contract + ~script:Op.dummy_script + >>=? fun (operation, new_contract) -> + Incremental.add_operation i operation >>=? fun i -> + two_over_n_of_balance (I i) bootstrap_contract 4L >>=? fun amount2 -> + (* transfer from implicit contract to originated contract *) + transfer_and_check_balances ~loc:__LOC__ i src new_contract amount2 + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit + +(********************) +(* Slow tests case *) + +(********************) + +let multiple_transfer n ?fee amount = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + Incremental.begin_construction b >>=? fun b -> + n_transactions n b ?fee contract_1 contract_2 amount >>=? fun b -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(** 1- Create a block with two contracts; + 2- Apply 100 transfers. +*) +let test_block_with_multiple_transfers () = multiple_transfer 99 (of_int 1000) + +(** 1- Create a block with two contracts; + 2- Apply 100 transfers with 10tz fee. *) +let test_block_with_multiple_transfers_pay_fee () = + multiple_transfer 10 ~fee:ten_tez (of_int 1000) + +(* TODO : increase the number of operations and add a `Slow tag to it in `tests` *) + +(** 1- Create a block with 8 contracts; + 2- Apply multiple transfers without fees; + 3- Apply multiple transfers with fees. *) +let test_block_with_multiple_transfers_with_without_fee () = + Context.init_n ~consensus_threshold:0 8 () >>=? fun (b, contracts) -> + let contracts = Array.of_list contracts in + Incremental.begin_construction b >>=? fun b -> + let hundred = of_int 100 in + let ten = of_int 10 in + let twenty = of_int 20 in + n_transactions 10 b contracts.(0) contracts.(1) Tez.one >>=? fun b -> + n_transactions 30 b contracts.(1) contracts.(2) hundred >>=? fun b -> + n_transactions 30 b contracts.(1) contracts.(3) hundred >>=? fun b -> + n_transactions 30 b contracts.(4) contracts.(3) hundred >>=? fun b -> + n_transactions 20 b contracts.(0) contracts.(1) hundred >>=? fun b -> + n_transactions 10 b contracts.(1) contracts.(3) hundred >>=? fun b -> + n_transactions 10 b contracts.(1) contracts.(3) hundred >>=? fun b -> + n_transactions 20 ~fee:ten b contracts.(3) contracts.(4) ten >>=? fun b -> + n_transactions 10 ~fee:twenty b contracts.(4) contracts.(5) ten >>=? fun b -> + n_transactions 70 ~fee:twenty b contracts.(6) contracts.(0) twenty + >>=? fun b -> + n_transactions 550 ~fee:twenty b contracts.(6) contracts.(4) twenty + >>=? fun b -> + n_transactions 50 ~fee:ten b contracts.(7) contracts.(5) twenty >>=? fun b -> + n_transactions 30 ~fee:ten b contracts.(0) contracts.(7) hundred >>=? fun b -> + n_transactions 20 ~fee:ten b contracts.(1) contracts.(0) twenty >>=? fun b -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(** Build a chain that has 10 blocks. *) +let test_build_a_chain () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + let ten = of_int 10 in + List.fold_left_es + (fun b _ -> + Incremental.begin_construction b >>=? fun b -> + transfer_and_check_balances ~loc:__LOC__ b contract_1 contract_2 ten + >>=? fun (b, _) -> Incremental.finalize_block b) + b + (1 -- 10) + >>=? fun (_ : Block.t) -> return_unit + +(*********************************************************************) +(* Expected error test cases *) +(*********************************************************************) + +(** Transferring zero tez is forbidden in implicit contract. *) +let test_empty_implicit () = + Context.init1 () >>=? fun (b, dest) -> + let account = Account.new_account () in + let src = Contract.Implicit account.Account.pkh in + two_over_n_of_balance (B b) dest 3L >>=? fun amount -> + (* Transfer zero tez from an implicit contract. *) + Op.transaction (B b) src dest amount >>=? fun op -> + Incremental.begin_construction b >>=? fun incr -> + Incremental.add_operation incr op >>= fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Contract_storage.Empty_implicit_contract _ as err -> + Assert.test_error_encodings err ; + true + | _ -> false) + +(** Balance is too low to transfer. *) +let test_balance_too_low fee () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + Context.Contract.balance (B b) contract_1 >>=? fun balance1 -> + Context.Contract.balance (B b) contract_2 >>=? fun balance2 -> + (* transfer the amount of tez that is bigger than the balance in the source contract *) + Op.transaction ~fee (B b) contract_1 contract_2 max_tez >>=? fun op -> + let expect_apply_failure = function + | Environment.Ecoproto_error (Contract_storage.Balance_too_low _ as err) + :: _ -> + Assert.test_error_encodings err ; + return_unit + | t -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t + in + (* the fee is higher than the balance then raise an error "Balance_too_low" *) + Incremental.begin_construction b >>=? fun i -> + if fee > balance1 then + Incremental.add_operation ~expect_apply_failure i op >>= fun _res -> + return_unit + (* the fee is smaller than the balance, then the transfer is accepted + but it is not processed, and fees are taken *) + else + Incremental.add_operation ~expect_apply_failure i op >>=? fun i -> + (* contract_1 loses the fees *) + Assert.balance_was_debited ~loc:__LOC__ (I i) contract_1 balance1 fee + >>=? fun () -> + (* contract_2 is not credited *) + Assert.balance_was_credited ~loc:__LOC__ (I i) contract_2 balance2 Tez.zero + +(** 1- Create a block, and three contracts; + 2- Add a transfer that at the end the balance of a contract is + zero into this block; + 3- Add another transfer that send tez from a zero balance contract; + 4- Catch the expected error: Balance_too_low. *) +let test_balance_too_low_two_transfers fee () = + Context.init3 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2, contract_3)) -> + Incremental.begin_construction b >>=? fun i -> + Context.Contract.balance (I i) contract_1 >>=? fun balance -> + balance /? 3L >>?= fun res -> + res *? 2L >>?= fun two_third_of_balance -> + transfer_and_check_balances + ~loc:__LOC__ + i + contract_1 + contract_2 + two_third_of_balance + >>=? fun (i, _) -> + Incremental.finalize_block i >>=? fun b -> + Context.Contract.balance (B b) contract_1 >>=? fun balance1 -> + Context.Contract.balance (B b) contract_3 >>=? fun balance3 -> + Op.transaction ~fee (B b) contract_1 contract_3 two_third_of_balance + >>=? fun operation -> + let expect_apply_failure = function + | Environment.Ecoproto_error (Contract_storage.Balance_too_low _ as err) + :: _ -> + Assert.test_error_encodings err ; + return_unit + | t -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t + in + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation ~expect_apply_failure i operation >>=? fun i -> + (* contract_1 loses the fees *) + Assert.balance_was_debited ~loc:__LOC__ (I i) contract_1 balance1 fee + >>=? fun () -> + (* contract_3 is not credited *) + Assert.balance_was_credited ~loc:__LOC__ (I i) contract_3 balance3 Tez.zero + +(** The counter is already used for the previous operation. *) +let invalid_counter () = + Context.init2 ~consensus_threshold:0 () + >>=? fun (b, (contract_1, contract_2)) -> + Op.transaction (B b) contract_1 contract_2 Tez.one >>=? fun op1 -> + Op.transaction (B b) contract_1 contract_2 Tez.one >>=? fun op2 -> + Block.bake ~operation:op1 b >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op2 >>= fun b -> + Assert.proto_error ~loc:__LOC__ b (function + | Contract_storage.Counter_in_the_past _ as err -> + Assert.test_error_encodings err ; + true + | _ -> false) + +(** Same as before but through a different way to perform this + error. *) +let test_add_the_same_operation_twice () = + Context.init2 () >>=? fun (b, (contract_1, contract_2)) -> + Incremental.begin_construction b >>=? fun i -> + transfer_and_check_balances ~loc:__LOC__ i contract_1 contract_2 ten_tez + >>=? fun (i, op_transfer) -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + Op.transaction (I i) contract_1 contract_2 ten_tez + >>=? fun (_ : packed_operation) -> + Incremental.add_operation i op_transfer >>= fun b -> + Assert.proto_error ~loc:__LOC__ b (function + | Contract_storage.Counter_in_the_past _ as err -> + Assert.test_error_encodings err ; + true + | _ -> false) + +(** The counter is in the future *) +let invalid_counter_in_the_future () = + Context.init2 () >>=? fun (b, (contract_1, contract_2)) -> + Incremental.begin_construction b >>=? fun b -> + Context.Contract.counter (I b) contract_1 >>=? fun cpt -> + let counter = Manager_counter.Internal_for_tests.add cpt 10 in + Op.transaction (I b) contract_1 contract_2 Tez.one ~counter >>=? fun op -> + Incremental.add_operation b op >>= fun b -> + Assert.proto_error ~loc:__LOC__ b (function + | Contract_storage.Counter_in_the_future _ as err -> + Assert.test_error_encodings err ; + true + | _ -> false) + +(** Check ownership. *) +let test_ownership_sender () = + Context.init2 () >>=? fun (b, (contract_1, contract_2)) -> + Incremental.begin_construction b >>=? fun b -> + (* get the manager of the contract_1 as a sender *) + Context.Contract.manager (I b) contract_1 >>=? fun manager -> + let imcontract_1 = Alpha_context.Contract.Implicit manager.pkh in + transfer_and_check_balances ~loc:__LOC__ b imcontract_1 contract_2 Tez.one + >>=? fun (b, _) -> + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit + +(*********************************************************************) +(* Random transfer *) + +(* Return a pair of minimum and maximum random number. *) +let random_range (min, max) = + let interv = max - min + 1 in + let init = + Random.self_init () ; + Random.int interv + min + in + init + +(* Return a random contract. *) +let random_contract contract_array = + let i = Random.int (Array.length contract_array) in + contract_array.(i) + +(** Transfer by randomly choose amount 10 contracts, and randomly + choose the amount in the source contract. *) +let test_random_transfer () = + Context.init_n 10 () >>=? fun (b, contracts) -> + let contracts = Array.of_list contracts in + let source = random_contract contracts in + let dest = random_contract contracts in + let source_pkh = Context.Contract.pkh source in + (* given that source may not have a sufficient balance for the transfer + to bake, + make sure it cannot be chosen as baker *) + Context.Contract.balance (B b) source >>=? fun amount -> + if source = dest then + transfer_to_itself_and_check_balances + ~loc:__LOC__ + ~policy:(Block.Excluding [source_pkh]) + b + source + amount + >>=? fun (_, _) -> return_unit + else + Incremental.begin_construction ~policy:(Block.Excluding [source_pkh]) b + >>=? fun i -> + transfer_and_check_balances ~loc:__LOC__ i source dest amount + >>=? fun (_, _) -> return_unit + +(** Transfer random transactions. *) +let test_random_multi_transactions () = + let n = random_range (1, 100) in + multiple_transfer n (of_int 100) + +(*********************************************************************) + +let test_bad_entrypoint () = + Context.init1 () >>=? fun (b, _c) -> + Incremental.begin_construction b >>=? fun v -> + let ctxt = Incremental.alpha_ctxt v in + let storage = "Unit" in + let parameter = "Unit" in + let entrypoint = Entrypoint.of_string_strict_exn "bad entrypoint" in + (* bad entrypoint *) + Contract_helpers.run_script + ctxt + "{parameter unit; storage unit; code { CAR; NIL operation; PAIR }}" + ~entrypoint + ~storage + ~parameter + () + >>= function + | Ok _ -> Alcotest.fail "expected error" + | Error lst + when List.mem + ~equal:( = ) + (Environment.Ecoproto_error + (Script_tc_errors.No_such_entrypoint entrypoint)) + lst -> + return () + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +let test_bad_parameter () = + Context.init1 () >>=? fun (b, _c) -> + Incremental.begin_construction b >>=? fun v -> + let ctxt = Incremental.alpha_ctxt v in + let storage = "Unit" in + let parameter = "1" in + (* bad parameter *) + Contract_helpers.run_script + ctxt + "{parameter unit; storage unit; code { CAR; NIL operation; PAIR }}" + ~storage + ~parameter + () + >>= function + | Ok _ -> Alcotest.fail "expected error" + | Error lst + when List.mem + ~equal:( = ) + (Environment.Ecoproto_error + (Script_interpreter.Bad_contract_parameter + (Contract.Originated Contract_helpers.default_self))) + lst -> + return () + | Error errs -> + Alcotest.failf "Unexpected error: %a" Error_monad.pp_print_trace errs + +let transfer_to_itself_with_no_such_entrypoint () = + let entrypoint = Entrypoint.of_string_strict_exn "bad entrypoint" in + Context.init1 () >>=? fun (b, addr) -> + Incremental.begin_construction b >>=? fun i -> + Op.transaction (B b) addr addr Tez.one ~entrypoint >>=? fun transaction -> + let expect_apply_failure = function + | Environment.Ecoproto_error (Script_tc_errors.No_such_entrypoint _ as e) + :: _ -> + Assert.test_error_encodings e ; + return () + | _ -> failwith "no such entrypoint should fail" + in + Incremental.add_operation ~expect_apply_failure i transaction >>= fun _res -> + return () + +(** Originates a contract with a [script] and an initial [credit] and + [storage]. *) +let contract_originate ~baker ~block ~script ~credit ~storage ~source = + let open Lwt_result_syntax in + let code = Expr.from_string script in + let script = + Alpha_context.Script.{code = lazy_expr code; storage = lazy_expr storage} + in + let* op, dst = + Op.contract_origination_hash (B block) source ~fee:Tez.zero ~script ~credit + in + let+ state = + Block.bake ~policy:Block.(By_account baker) ~operations:[op] block + in + (state, dst) + +(** Runs a transaction from a [source] to a [destination]. *) +let transfer ?force_reveal ?parameters ~baker ~block ~source ~destination amount + = + let open Lwt_result_syntax in + let* operation = + Op.transaction + ?force_reveal + ?parameters + ~fee:Tez.zero + (B block) + source + destination + amount + in + Block.bake ~policy:Block.(By_account baker) ~operations:[operation] block + +(** The script of a contract that transfers its balance to the caller, and + stores the parameter of the call. *) +let script = + {| { parameter string ; + storage string ; + code { + CAR ; + SOURCE ; + CONTRACT unit ; + ASSERT_SOME ; + BALANCE ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } +} |} + +(** The tested scenarios are the following : + + - originate a contract with the above [script] and no initial balance, + call it from an account short of sufficient funds to cover storage fees, + and check that this indeed fails. + + - originate a contract with the above [script] and sufficient balance to + cover storage fees of a subsequent call, call the originated contract from + an account short of sufficient funds to cover storage fees, as expected, + this succeeds since the caller receives the originated contract's initial + balance. *) +let test_storage_fees_and_internal_operation () = + let open Lwt_result_syntax in + let* initial_block, contract = Context.init1 ~consensus_threshold:0 () in + let null_string = Expr.from_string "\"\"" in + let caller = Account.new_account () in + (* Initialize a caller account. *) + let* initial_block = + transfer + ~block:initial_block + ~baker:(Context.Contract.pkh contract) + ~source:contract + ~destination:(Contract.Implicit caller.pkh) + Tez.one_mutez + in + (* [originate_and_call] first, originates a contract with an empty string as + initial storage, and an initial credit of [initial_amount]. And then, calls + the originated contract from [caller] with a parameter that allocates + additional storage. *) + let originate_and_call ~initial_block ~initial_amount = + let* block, contract_hash = + contract_originate + ~block:initial_block + ~baker:(Context.Contract.pkh contract) + ~script + ~source:contract + ~credit:initial_amount + ~storage:null_string + in + let random_string = Expr.from_string "\"Abracadabra\"" in + transfer + ~force_reveal:true + ~parameters:(Alpha_context.Script.lazy_expr random_string) + ~block + ~baker:(Context.Contract.pkh contract) + ~source:(Contract.Implicit caller.pkh) + ~destination:(Contract.Originated contract_hash) + Tez.zero + in + (* Ensure failure when the initial balance of the originated contract is not + sufficient to pay storage fees. *) + let*! res = originate_and_call ~initial_block ~initial_amount:Tez.one_mutez in + let* () = + Assert.proto_error_with_info ~loc:__LOC__ res "Cannot pay storage fee" + in + (* Ensure success when the initial balance of the originated contract is + sufficient to pay storage fees. *) + let+ (_ : Block.t) = + originate_and_call ~initial_block ~initial_amount:Tez.one_cent + in + () + +let tests = + [ + (* single transfer *) + Tztest.tztest "single transfer" `Quick test_block_with_a_single_transfer; + Tztest.tztest + "single transfer with fee" + `Quick + test_block_with_a_single_transfer_with_fee; + (* transfer zero tez *) + Tztest.tztest "single transfer zero tez" `Quick test_transfer_zero_tez; + Tztest.tztest + "transfer zero tez from implicit contract" + `Quick + test_transfer_zero_implicit; + Tztest.tztest + "transfer zero tez to an implicit contract with balance of src as fee" + `Quick + test_transfer_zero_implicit_with_bal_src_as_fee; + (* transfer to originated contract *) + Tztest.tztest + "transfer to originated contract paying transaction fee" + `Quick + test_transfer_to_originate_with_fee; + Tztest.tztest + "transfer zero tez to an originated contract with balance of src as fee" + `Quick + test_transfer_zero_to_originated_with_bal_src_as_fee; + (* transfer by the balance of contract *) + Tztest.tztest + "transfer the amount from source contract balance" + `Quick + test_transfer_amount_of_contract_balance; + (* transfer to itself *) + Tztest.tztest "transfers to itself" `Quick test_transfers_to_self; + (* missing operation *) + Tztest.tztest "missing transaction" `Quick test_missing_transaction; + (* transfer from/to implicit/originated contracts*) + Tztest.tztest + "transfer from an implicit to implicit contract" + `Quick + test_transfer_from_implicit_to_implicit_contract; + Tztest.tztest + "transfer from an implicit to an originated contract" + `Quick + test_transfer_from_implicit_to_originated_contract; + (* Slow tests *) + Tztest.tztest + "block with multiple transfers" + `Slow + test_block_with_multiple_transfers; + (* TODO increase the number of transaction times *) + Tztest.tztest + "block with multiple transfer paying fee" + `Slow + test_block_with_multiple_transfers_pay_fee; + Tztest.tztest + "block with multiple transfer without paying fee" + `Slow + test_block_with_multiple_transfers_with_without_fee; + (* build the chain *) + Tztest.tztest "build a chain" `Quick test_build_a_chain; + (* Erroneous *) + Tztest.tztest "empty implicit" `Quick test_empty_implicit; + Tztest.tztest + "balance too low - transfer zero" + `Quick + (test_balance_too_low Tez.zero); + Tztest.tztest "balance too low" `Quick (test_balance_too_low Tez.one); + Tztest.tztest + "balance too low (max fee)" + `Quick + (test_balance_too_low max_tez); + Tztest.tztest + "balance too low with two transfers - transfer zero" + `Quick + (test_balance_too_low_two_transfers Tez.zero); + Tztest.tztest + "balance too low with two transfers" + `Quick + (test_balance_too_low_two_transfers Tez.one); + Tztest.tztest + "transfer one tez to an implicit contract with balance of src as fee" + `Quick + test_transfer_one_to_implicit_with_bal_src_as_fee; + Tztest.tztest "invalid_counter" `Quick invalid_counter; + Tztest.tztest + "add the same operation twice" + `Quick + test_add_the_same_operation_twice; + Tztest.tztest + "invalid_counter_in_the_future" + `Quick + invalid_counter_in_the_future; + Tztest.tztest "ownership sender" `Quick test_ownership_sender; + (* Random tests *) + Tztest.tztest "random transfer" `Quick test_random_transfer; + Tztest.tztest "random multi transfer" `Quick test_random_multi_transactions; + Tztest.tztest "bad entrypoint" `Quick test_bad_entrypoint; + Tztest.tztest "bad parameter" `Quick test_bad_parameter; + Tztest.tztest + "no such entrypoint" + `Quick + transfer_to_itself_with_no_such_entrypoint; + Tztest.tztest + "storage fees after contract call and allocation" + `Quick + test_storage_fees_and_internal_operation; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml new file mode 100644 index 000000000000..c52d8df46dea --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml @@ -0,0 +1,343 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Transfer_ticket logic + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^transfer ticket$" + Subject: Test ticket transfers +*) + +open Protocol +open Alpha_context +open Tezos_micheline +open Lwt_result_syntax + +let wrap m = m >|= Environment.wrap_tzresult + +(* In this test, a ticketer contract mints and transfers a ticket to an implicit account, + who further transfers it to another implicit account. + The ticket balance is inspected for correctness. +*) +let test_mint_deposit_withdraw_implicit_transfer () = + let* block, (account, another_account) = + Context.init2 ~consensus_threshold:0 () + in + let baker = Context.Contract.pkh account in + let* ticketer, _, block = + Contract_helpers.originate_contract_from_string + ~script: + {| + parameter (pair nat nat address) ; + storage unit ; + code { CAR ; + UNPAIR 3 ; + DIG 2 ; + CONTRACT (ticket nat) ; + ASSERT_SOME ; + # contract : nat %ct : nat %qty + PUSH mutez 0 ; + # tez : contract : nat %ct : nat %qty + DIG 3 ; + # nat %qty : tez : contract : nat %ct + DIG 3 ; + # nat %ct : nat %qty : tez : contract + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + UNIT ; + SWAP ; + PAIR } + |} + ~storage:"Unit" + ~source_contract:account + ~baker + block + in + let contents = 42 in + let* block = + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Expr_common.( + pair_n [int (Z.of_int contents); int (Z.of_int 1); address account]) + |> Micheline.strip_locations |> Script.lazy_expr) + ~fee:Tez.one + account + ticketer + (Tez.of_mutez_exn 0L) + >>=? fun operation -> Block.bake ~operation block + in + let ty = Expr.from_string "nat" in + let* block = + Op.transfer_ticket + (B block) + ~entrypoint:Entrypoint.default + ~source:account + ~ty:(Script.lazy_expr ty) + ~contents:(Script.lazy_expr @@ Expr.from_string @@ string_of_int contents) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint @@ Z.of_int 1) + ~destination:another_account + ~ticketer + >>=? fun operation -> Block.bake ~operation block + in + let make_ex_token ctxt ~ticketer ~ty ~content = + let* Script_ir_translator.Ex_comparable_ty cty, ctxt = + wrap @@ Lwt.return + @@ Script_ir_translator.parse_comparable_ty ctxt + @@ Micheline.root ty + in + let* contents, ctxt = + wrap + @@ Script_ir_translator.parse_comparable_data ctxt cty + @@ Micheline.root content + in + return + (Ticket_token.Ex_token {contents_type = cty; ticketer; contents}, ctxt) + in + let* ctxt = + Incremental.begin_construction block >|=? Incremental.alpha_ctxt + in + let* token, ctxt = + make_ex_token + ctxt + ~ticketer + ~ty + ~content:(Expr.from_string @@ string_of_int contents) + in + let* key, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract another_account) + token + in + let* amount, _ = wrap @@ Ticket_balance.get_balance ctxt key in + match amount with + | Some amount -> Assert.equal_int ~loc:__LOC__ (Z.to_int amount) 1 + | _ -> return_unit + +(* In this test, a ticketer contract is called to mint and send a ticket + to an implicit account and a contract. Both destinations are given + in a `contract (ticket nat)` value. + Transfer should be possible since the target contract has the right + parameter type under the given entrypoint. +*) +let test_contract_as_ticket_transfer_destination () = + let* block, (account, another_account) = + Context.init2 ~consensus_threshold:0 () + in + let baker = Context.Contract.pkh account in + let* ticketer, _, block = + Contract_helpers.originate_contract_from_string + ~script: + {| + parameter (pair (contract (ticket nat)) nat nat) ; + storage unit ; + code { CAR ; + UNPAIR 3 ; + # contract (ticket nat) : nat %ct : nat %qty + PUSH mutez 0 ; + # tez : contract (ticket nat) : nat %ct : nat %qty + DIG 3 ; + # nat %qty : tez : contract (ticket nat) : nat %ct + DIG 3 ; + # nat %ct : nat %qty : tez : contract (ticket nat) + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + UNIT ; + SWAP ; + PAIR } + |} + ~storage:"Unit" + ~source_contract:account + ~baker + block + in + let* bag, _, block = + Contract_helpers.originate_contract_from_string + ~script: + {| + parameter (or (ticket %save nat) (address %send)); + storage (list (ticket nat)); + code { UNPAIR ; + IF_LEFT + { CONS ; NIL operation ; PAIR } + { SWAP ; + IF_CONS + { DIG 2 ; + CONTRACT %ticket (ticket nat) ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } + { PUSH string "no ticket to send" ; FAILWITH }}} + |} + ~storage:"{}" + ~source_contract:account + ~baker + block + in + let contents = 42 in + let* block = + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Expr_common.( + pair_n + [ + string + (Destination.(to_b58check (Contract account)) + ^ Entrypoint.(to_address_suffix default)); + int (Z.of_int contents); + int (Z.of_int 1); + ]) + |> Micheline.strip_locations |> Script.lazy_expr) + ~fee:Tez.one + account + ticketer + (Tez.of_mutez_exn 0L) + >>=? fun operation -> Block.bake ~operation block + in + let ty = Expr.from_string "nat" in + let* block = + Op.transfer_ticket + (B block) + ~entrypoint:Entrypoint.default + ~source:account + ~ty:(Script.lazy_expr ty) + ~contents:(Script.lazy_expr @@ Expr.from_string @@ string_of_int contents) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint @@ Z.of_int 1) + ~destination:another_account + ~ticketer + >>=? fun operation -> Block.bake ~operation block + in + let make_ex_token ctxt ~ticketer ~ty ~content = + let* Script_ir_translator.Ex_comparable_ty cty, ctxt = + wrap @@ Lwt.return + @@ Script_ir_translator.parse_comparable_ty ctxt + @@ Micheline.root ty + in + let* contents, ctxt = + wrap + @@ Script_ir_translator.parse_comparable_data ctxt cty + @@ Micheline.root content + in + return + (Ticket_token.Ex_token {contents_type = cty; ticketer; contents}, ctxt) + in + let* ctxt = + Incremental.begin_construction block >|=? Incremental.alpha_ctxt + in + let* token, ctxt = + make_ex_token + ctxt + ~ticketer + ~ty + ~content:(Expr.from_string @@ string_of_int contents) + in + let* key, ctxt = + wrap + @@ Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract another_account) + token + in + let* amount, _ = wrap @@ Ticket_balance.get_balance ctxt key in + let* () = + match amount with + | Some amount -> Assert.equal_int ~loc:__LOC__ (Z.to_int amount) 1 + | _ -> return_unit + in + let* block = + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Expr_common.( + pair_n + [ + string + (Destination.(to_b58check (Contract bag)) + ^ Entrypoint.(to_address_suffix @@ of_string_strict_exn "save") + ); + int (Z.of_int contents); + int (Z.of_int 1); + ]) + |> Micheline.strip_locations |> Script.lazy_expr) + ~fee:Tez.one + account + ticketer + (Tez.of_mutez_exn 0L) + >>=? fun operation -> Block.bake ~operation block + in + let* ctxt = + Incremental.begin_construction block >|=? Incremental.alpha_ctxt + in + let* token, ctxt = + make_ex_token + ctxt + ~ticketer + ~ty + ~content:(Expr.from_string @@ string_of_int contents) + in + let* key, ctxt = + wrap @@ Ticket_balance_key.of_ex_token ctxt ~owner:(Contract bag) token + in + let* amount, _ = wrap @@ Ticket_balance.get_balance ctxt key in + match amount with + | Some amount -> Assert.equal_int ~loc:__LOC__ (Z.to_int amount) 1 + | _ -> return_unit + +let tests = + [ + Tztest.tztest + "Test ticket transfer operations" + `Quick + test_mint_deposit_withdraw_implicit_transfer; + Tztest.tztest + "Test 'contract (ticket cty)' as transfer destination" + `Quick + test_contract_as_ticket_transfer_destination; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml new file mode 100644 index 000000000000..6d63844630a1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml @@ -0,0 +1,5953 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Tx rollup layer 1 logic + Invocation: cd src/proto_alpha/lib_protocol/test/integration/operations \ + && dune exec ./main.exe -- test "^tx rollup$" + Subject: Test rollup +*) + +open Protocol +open Alpha_context +open Test_tez +open Error_monad_operators + +(* Similar to [Block.bake] but ensure that the operation [op] is applied + in the block *) +let add_operation b op = + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op >>=? fun i -> Incremental.finalize_block i + +(** [check_tx_rollup_exists ctxt tx_rollup] returns [()] iff [tx_rollup] + is a valid address for a transaction rollup. Otherwise, it fails. *) +let check_tx_rollup_exists ctxt tx_rollup = + Context.Tx_rollup.state ctxt tx_rollup >|=? fun (_ : Tx_rollup_state.t) -> () + +(** [check_proto_error_f f t] checks that the first error of [t] + satisfies the boolean function [f]. *) +let check_proto_error_f f t = + match t with + | Environment.Ecoproto_error e :: _ when f e -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t + +(** [check_proto_error e t] checks that the first error of [t] + equals [e]. *) +let check_proto_error e t = check_proto_error_f (( = ) e) t + +(** [check_runtime_error e t] checks that the first error of [t] is the + Michelson runtime error and the second one equals [e]. *) +let check_runtime_error e = function + | Environment.Ecoproto_error (Script_interpreter.Runtime_contract_error _) + :: Environment.Ecoproto_error second + :: _ + when second = e -> + Assert.test_error_encodings e ; + return_unit + | t -> failwith "Expected runtime error, got: %a" Error_monad.pp_print_trace t + +(** [test_disable_feature_flag] try to originate a tx rollup with the feature + flag is deactivated and check it fails *) +let test_disable_feature_flag () = + Context.init_with_constants1 + { + Context.default_test_constants with + tx_rollup = {Context.default_test_constants.tx_rollup with enable = false}; + } + >>=? fun (b, contract) -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_origination (I i) contract >>=? fun (op, _tx_rollup) -> + Incremental.add_operation + ~expect_failure: + (check_proto_error Validate_errors.Manager.Tx_rollup_feature_disabled) + i + op + >>=? fun (_i : Incremental.t) -> return_unit + +(** [test_sunset] try to originate a tx rollup after the sunset and check + that it fails *) +let test_sunset () = + Context.init_with_constants1 + { + Context.default_test_constants with + tx_rollup = + { + Context.default_test_constants.tx_rollup with + enable = true; + sunset_level = 0l; + }; + } + >>=? fun (b, contract) -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_origination (I i) contract >>=? fun (op, _tx_rollup) -> + Incremental.add_operation + ~expect_failure: + (check_proto_error Validate_errors.Manager.Tx_rollup_feature_disabled) + i + op + >>=? fun (_i : Incremental.t) -> return_unit + +(** [parsing_tests] try originating contracts using the + type [tx_rollup_l2_address], test that it only works + when rollups are enabled. + *) +let parsing_tests = + let test_origination ~tx_rollup_enable script_path initial_storage = + Context.init1 ~tx_rollup_enable ~tx_rollup_sunset_level:Int32.max_int () + >>=? fun (b, contract) -> + Contract_helpers.originate_contract + script_path + initial_storage + contract + b + (Context.Contract.pkh contract) + >>= fun res -> + if not tx_rollup_enable then + Assert.error ~loc:__LOC__ res (function + | Environment.Ecoproto_error + (Script_tc_errors.Tx_rollup_addresses_disabled _) -> + true + | _ -> false) + else + match res with + | Ok _ -> return_unit + | Error err -> + Alcotest.fail + (Format.asprintf + "Unexpected failure when parsing %s: %a" + script_path + pp_print_trace + err) + in + List.concat_map + (fun (description, path) -> + [ + Tztest.tztest + (Format.asprintf + "Originating `%s` succeeds w/ tx rollups enabled" + description) + `Quick + (fun () -> test_origination ~tx_rollup_enable:true path "Unit"); + Tztest.tztest + (Format.asprintf + "Originating `%s` fails w/ tx rollups disabled" + description) + `Quick + (fun () -> test_origination ~tx_rollup_enable:false path "Unit"); + ]) + [ + ("deposit", "contracts/tx_rollup_deposit.tz"); + ("type", "contracts/tx_rollup_parse_type.tz"); + ("comparable_type", "contracts/tx_rollup_parse_comparable_type.tz"); + ("data", "contracts/tx_rollup_parse_data.tz"); + ] + +let message_hash_testable : Tx_rollup_message_hash.t Alcotest.testable = + Alcotest.testable Tx_rollup_message_hash.pp ( = ) + +let sint_testable : _ Saturation_repr.t Alcotest.testable = + Alcotest.testable Saturation_repr.pp ( = ) + +let tx_rollup_state_testable : Tx_rollup_state.t Alcotest.testable = + Alcotest.testable Tx_rollup_state.pp ( = ) + +let zestable : Z.t Alcotest.testable = Alcotest.testable Z.pp_print Z.equal + +(** [tx_rollup_state_testable_no_storage] compares two + [Tx_rollup_state.t], but ignores differences in the fields + [allocated_storage] and [occupied_storage_size] like *) +let tx_rollup_state_testable_no_storage : Tx_rollup_state.t Alcotest.testable = + let copy_storage ~state_from state = + let open Tx_rollup_state.Internal_for_tests in + state + |> set_allocated_storage (get_allocated_storage state_from) + |> set_occupied_storage (get_occupied_storage state_from) + in + Alcotest.testable Tx_rollup_state.pp (fun a b -> + a = copy_storage ~state_from:a b) + +(** [occupied_storage_size ctxt tx_rollup] returns occupied storage size *) +let occupied_storage_size ctxt tx_rollup = + Context.Tx_rollup.state ctxt tx_rollup >|=? fun state -> + Alpha_context.Tx_rollup_state.Internal_for_tests.get_occupied_storage state + +(** [inbox_burn state size] computes the burn (per byte of message) + one has to pay to submit a message to the current inbox. *) +let inbox_burn state size = + Environment.wrap_tzresult (Tx_rollup_state.burn_cost ~limit:None state size) + +(** [burn_per_byte state] returns the cost to insert one byte inside + the inbox. *) +let burn_per_byte state = inbox_burn state 1 + +(** [context_init tup] initializes a context with no consensus rewards + to not interfere with balances prediction. It returns the created + context and contracts. *) +let context_init ?(tx_rollup_max_inboxes_count = 2100) + ?(tx_rollup_rejection_max_proof_size = 30_000) + ?(tx_rollup_max_ticket_payload_size = 10_240) + ?(tx_rollup_finality_period = 1) ?(tx_rollup_origination_size = 60_000) + ?(cost_per_byte = Tez.zero) ?(tx_rollup_hard_size_limit_per_message = 5_000) + ?(tx_max_messages_per_inbox = 1010) tup = + Context.init_with_constants_gen + tup + { + Context.default_test_constants with + consensus_threshold = 0; + tx_rollup = + { + Context.default_test_constants.tx_rollup with + enable = true; + sunset_level = Int32.max_int; + withdraw_period = 2; + max_commitments_count = 3; + finality_period = tx_rollup_finality_period; + origination_size = tx_rollup_origination_size; + rejection_max_proof_size = tx_rollup_rejection_max_proof_size; + max_inboxes_count = tx_rollup_max_inboxes_count; + hard_size_limit_per_message = tx_rollup_hard_size_limit_per_message; + max_ticket_payload_size = tx_rollup_max_ticket_payload_size; + max_messages_per_inbox = tx_max_messages_per_inbox; + }; + endorsing_reward_per_slot = Tez.zero; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + cost_per_byte; + } + +(** [context_init1] initializes a context with no consensus rewards + to not interfere with balances prediction. It returns the created + context and 1 contract. *) +let context_init1 ?tx_rollup_max_inboxes_count + ?tx_rollup_max_ticket_payload_size ?tx_rollup_rejection_max_proof_size + ?tx_rollup_finality_period ?tx_rollup_origination_size ?cost_per_byte + ?tx_rollup_hard_size_limit_per_message ?tx_max_messages_per_inbox () = + context_init + ?tx_rollup_max_inboxes_count + ?tx_rollup_max_ticket_payload_size + ?tx_rollup_rejection_max_proof_size + ?tx_rollup_finality_period + ?tx_rollup_origination_size + ?cost_per_byte + ?tx_rollup_hard_size_limit_per_message + ?tx_max_messages_per_inbox + Context.T1 + +(** [context_init2] initializes a context with no consensus rewards + to not interfere with balances prediction. It returns the created + context and 2 contracts. *) +let context_init2 ?tx_rollup_max_inboxes_count + ?tx_rollup_max_ticket_payload_size ?cost_per_byte + ?tx_rollup_hard_size_limit_per_message () = + context_init + ?tx_rollup_max_inboxes_count + ?tx_rollup_max_ticket_payload_size + ?cost_per_byte + ?tx_rollup_hard_size_limit_per_message + Context.T2 + +(** [originate b contract] originates a tx_rollup from [contract], + and returns the new block and the tx_rollup address. *) +let originate b contract = + Op.tx_rollup_origination (B b) contract >>=? fun (operation, tx_rollup) -> + Block.bake ~operation b >>=? fun b -> return (b, tx_rollup) + +(** Initializes the context, originates a tx_rollup and submits a batch. + + Returns the first contract and its balance, the originated tx_rollup, + the state with the tx_rollup, and the baked block with the batch submitted. +*) +let init_originate_and_submit ?(batch = "batch") ?tx_rollup_origination_size () + = + context_init1 ?tx_rollup_origination_size () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + Context.Contract.balance (B b) contract >>=? fun balance -> + Op.tx_rollup_submit_batch (B b) contract tx_rollup batch >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + return ((contract, balance), state, tx_rollup, b) + +let l2_parameters : Context.t -> Tx_rollup_l2_apply.parameters tzresult Lwt.t = + fun ctxt -> + Context.get_constants ctxt >>=? fun constants -> + let tx_rollup_max_withdrawals_per_batch = + constants.parametric.tx_rollup.max_withdrawals_per_batch + in + return Tx_rollup_l2_apply.{tx_rollup_max_withdrawals_per_batch} + +let commitment_compact_testable = + Alcotest.testable Tx_rollup_commitment.Compact.pp (fun r1 r2 -> + Tx_rollup_commitment_hash.equal + (Tx_rollup_commitment.Compact.hash r1) + (Tx_rollup_commitment.Compact.hash r2)) + +let commitment_hash_testable = + Alcotest.testable Tx_rollup_commitment_hash.pp Tx_rollup_commitment_hash.( = ) + +let public_key_hash_testable = + Alcotest.testable + Tezos_crypto.Signature.Public_key_hash.pp + Tezos_crypto.Signature.Public_key_hash.( = ) + +let raw_level_testable = Alcotest.testable Raw_level.pp Raw_level.( = ) + +let inbox_testable = Alcotest.testable Tx_rollup_inbox.pp Tx_rollup_inbox.( = ) + +let rng_state = Random.State.make_self_init () + +let gen_l2_account ?rng_state () = + let seed = + Option.map + (fun rng_state -> + Bytes.init 32 (fun _ -> char_of_int @@ Random.State.int rng_state 255)) + rng_state + in + let pkh, public_key, secret_key = Tezos_crypto.Bls.generate_key ?seed () in + (secret_key, public_key, pkh) + +(** [make_ticket_key ty contents ticketer tx_rollup] computes the ticket hash + of the ticket containing [contents] of type [ty], crafted by [ticketer] and + owned by [tx_rollup]. *) +let make_ticket_key ctxt ~ty ~contents ~ticketer tx_rollup = + (match ctxt with + | Context.B block -> Incremental.begin_construction block + | Context.I incr -> return incr) + >>=? fun incr -> + let ctxt = Incremental.alpha_ctxt incr in + Script_ir_translator.parse_comparable_ty ctxt ty + >>??= fun (Ex_comparable_ty contents_type, ctxt) -> + Script_ir_translator.parse_comparable_data ctxt contents_type contents + >>=?? fun (contents, ctxt) -> + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Tx_rollup tx_rollup) + (Ticket_token.Ex_token {ticketer; contents_type; contents}) + >|=?? fst + +(** [make_unit_ticket_key ticketer tx_rollup] computes the ticket hash of + the unit ticket crafted by [ticketer] and owned by [tx_rollup]. *) +let make_unit_ticket_key ctxt ~ticketer tx_rollup = + let open Tezos_micheline.Micheline in + let open Michelson_v1_primitives in + let ty = Prim (0, T_unit, [], []) in + let contents = Prim (0, D_Unit, [], []) in + make_ticket_key ctxt ~ty ~contents ~ticketer tx_rollup + +let print_deposit_arg tx_rollup account = + let open Alpha_context.Script in + Format.sprintf + "Pair \"%s\" %s" + (match tx_rollup with + | `Typed pk -> Tx_rollup.to_b58check pk + | `Raw str -> str) + (match account with + | `Hash pk -> Format.sprintf "\"%s\"" (Tx_rollup_l2_address.to_b58check pk) + | `Raw str -> str) + |> fun x -> x |> Expr.from_string |> lazy_expr + +let assert_ok res = match res with Ok r -> r | Error _ -> assert false + +let assert_some res = match res with Some r -> r | None -> assert false + +let raw_level level = assert_ok @@ Raw_level.of_int32 level + +(** Create a deposit on the layer1 side through the origination of a contract + and return the associated deposit message to apply in the layer2. *) +let make_deposit b tx_rollup l1_src addr = + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit.tz" + "Unit" + l1_src + b + (Context.Contract.pkh l1_src) + >>=? fun (contract, b) -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash addr) in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + ~fee + (B b) + l1_src + contract + Tez.zero + ~parameters + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + make_unit_ticket_key (B b) ~ticketer:contract tx_rollup + >>=? fun ticket_hash -> + let deposit, cumulated_size = + Tx_rollup_message.make_deposit + (Context.Contract.pkh l1_src) + (Tx_rollup_l2_address.Indexable.value addr) + ticket_hash + (Tx_rollup_l2_qty.of_int64_exn 100_000L) + in + return (b, (deposit, cumulated_size), ticket_hash) + +(** Create an incomplete (but valid) commitment for a given level. It is + incomplete in the sense that the Merkle roots for each message are generated + with [Tezos_crypto.Context_hash.hash_string message_index]. In the meantime provides the + list of withdraw in a association list of [batch_index -> withdraw_list]. + Be careful not to provide a too-big withdraw_list as the construction is + expensive *) +let make_incomplete_commitment_for_batch context level tx_rollup withdraw_list = + Context.Tx_rollup.inbox context tx_rollup level >>=? fun metadata -> + let metadata = assert_some metadata in + let str_for_context_hash = + Data_encoding.Binary.to_string_exn Tx_rollup_inbox.encoding metadata + in + List.init ~when_negative_length:[] metadata.inbox_length (fun i -> + Tezos_crypto.Context_hash.hash_string + [str_for_context_hash ^ string_of_int i]) + >>?= fun batches_result -> + let messages = + List.mapi + (fun i v -> + Tx_rollup_message_result_hash.hash_uncarbonated + { + context_hash = v; + withdraw_list_hash = + List.assq i withdraw_list |> Option.value ~default:[] + |> Tx_rollup_withdraw_list_hash.hash_uncarbonated; + }) + batches_result + in + (match Tx_rollup_level.pred level with + | None -> return_none + | Some predecessor_level -> + Context.Tx_rollup.commitment context tx_rollup predecessor_level + >|=? fun commitment_opt -> + Option.map + (fun Tx_rollup_commitment.Submitted_commitment.{commitment; _} -> + Tx_rollup_commitment.Compact.hash commitment) + commitment_opt) + >>=? fun predecessor -> + let inbox_merkle_root = metadata.merkle_root in + let commitment : Tx_rollup_commitment.Full.t = + {level; messages; predecessor; inbox_merkle_root} + in + return (commitment, batches_result) + +(** Check that the given contract has [count] pending bonded commitments *) +let check_bond ctxt tx_rollup contract count = + let pkh = Context.Contract.pkh contract in + Tx_rollup_commitment.pending_bonded_commitments ctxt tx_rollup pkh + >>=?? fun (_, pending) -> + Alcotest.(check int "Pending bonded commitment count correct" count pending) ; + return () + +let check_bond_from_block b tx_rollup contract count = + Incremental.begin_construction b >>=? fun i -> + check_bond (Incremental.alpha_ctxt i) tx_rollup contract count + +let rec bake_until i top = + let level = Incremental.level i in + if level >= top then return i + else + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> bake_until i top + +let assert_retired retired = + match retired with + | `Retired -> return_unit + | _ -> failwith "Expected retired" + +let assert_ticket_balance ~loc block token owner expected = + Incremental.begin_construction block >>=? fun incr -> + let ctxt = Incremental.alpha_ctxt incr in + Ticket_balance_key.of_ex_token ctxt ~owner token >>=?? fun (key_hash, ctxt) -> + Ticket_balance.get_balance ctxt key_hash >>=?? fun (balance, _) -> + match (balance, expected) with + | Some b, Some e -> Assert.equal_int ~loc (Z.to_int b) e + | Some b, None -> + failwith "%s: Expected no balance but got some %d" loc (Z.to_int b) + | None, Some b -> failwith "%s: Expected balance %d but got none" loc b + | None, None -> return () + +module Nat_ticket = struct + let ty_str = "nat" + + let ty = Expr.from_string ty_str + + let contents_nat = 1 + + let ex_token ~ticketer = + let contents = + WithExceptions.Option.get ~loc:__LOC__ + @@ Script_int.(of_int contents_nat |> is_nat) + in + Ticket_token.Ex_token + {ticketer; contents_type = Script_typed_ir.nat_t; contents} + + let contents = Expr.from_string (string_of_int contents_nat) + + let int64_amount = 10L + + let amount = Tx_rollup_l2_qty.of_int64_exn int64_amount + + let ticket_hash ctxt ~ticketer ~tx_rollup = + make_ticket_key + ctxt + ~ty:(Tezos_micheline.Micheline.root ty) + ~contents:(Tezos_micheline.Micheline.root contents) + ~ticketer + tx_rollup + + let withdrawal ctxt ~ticketer ~claimer ?(amount = amount) tx_rollup : + (Tx_rollup_withdraw.t * Tx_rollup_reveal.t) tzresult Lwt.t = + ticket_hash ctxt ~ticketer ~tx_rollup >|=? fun ticket_hash -> + let claimer = Context.Contract.pkh claimer in + ( Tx_rollup_withdraw.{claimer; ticket_hash; amount}, + Tx_rollup_reveal. + { + contents = Script.lazy_expr contents; + ty = Script.lazy_expr ty; + ticketer; + amount; + claimer; + } ) + + let init_deposit_contract amount block account = + let script = + Format.asprintf + {| parameter (pair address tx_rollup_l2_address); + storage unit; + code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %%deposit (pair (ticket nat) tx_rollup_l2_address); + ASSERT_SOME; + SWAP; + PUSH mutez 0; + SWAP; + # create a ticket + PUSH nat %a; + PUSH %s %d; + TICKET; + ASSERT_SOME; + PAIR ; + TRANSFER_TOKENS; + PUSH unit Unit; + NIL operation; + DIG 2 ; + CONS; + PAIR } |} + Z.pp_print + amount + ty_str + contents_nat + in + Contract_helpers.originate_contract_from_string + ~baker:(Context.Contract.pkh account) + ~source_contract:account + ~script + ~storage:"Unit" + block + + let deposit_op block tx_rollup pkh account deposit_contract = + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Script.lazy_expr @@ Expr.from_string + @@ Printf.sprintf {| Pair %S %S |} (Tx_rollup.to_b58check tx_rollup) pkh + ) + ~fee:Tez.one + account + deposit_contract + (Tez.of_mutez_exn 0L) + + (** Return an operation to originate a contract that will deposit [amount] + tickets to l2 address [pkh] on [tx_rollup] *) + let init_deposit amount ?(pkh = "tz4MSfZsn6kMDczShy8PMeB628TNukn9hi2K") block + tx_rollup account = + init_deposit_contract amount block account + >>=? fun (deposit_contract, _script, block) -> + deposit_op block tx_rollup pkh account deposit_contract >|=? fun op -> + (op, block, deposit_contract) +end + +let message_result_hash_in_commitment (commitment : Tx_rollup_commitment.Full.t) + ~message_position = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth commitment.messages message_position) + +let compute_message_result_path (commitment : Tx_rollup_commitment.Full.t) + ~message_position = + let tree = + List.fold_left + (fun tree m -> Tx_rollup_commitment.Merkle.snoc tree m) + Tx_rollup_commitment.Merkle.nil + commitment.messages + in + assert_ok @@ Tx_rollup_commitment.Merkle.compute_path tree message_position + +let message_result_hash_and_path (commitment : Tx_rollup_commitment.Full.t) + ~message_position = + ( message_result_hash_in_commitment commitment ~message_position, + compute_message_result_path commitment ~message_position ) + +let single_message_path message_hash = + match Tx_rollup_inbox.Merkle.compute_path [message_hash] 0 with + | Ok message_path -> message_path + | _ -> raise (Invalid_argument "Single_message_inbox.message_path") + +let message_result context_hash withdraws = + Tx_rollup_message_result. + { + context_hash; + withdraw_list_hash = + Tx_rollup_withdraw_list_hash.hash_uncarbonated withdraws; + } + +(** ---- TESTS -------------------------------------------------------------- *) + +(** [test_origination] originates a transaction rollup and checks that + it burns the expected quantity of xtz. *) +let test_origination () = + Context.init1 ~tx_rollup_enable:true ~tx_rollup_sunset_level:Int32.max_int () + >>=? fun (b, contract) -> + Context.get_constants (B b) + >>=? fun { + parametric = {tx_rollup = {origination_size; _}; cost_per_byte; _}; + _; + } -> + Context.Contract.balance (B b) contract >>=? fun balance -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_origination (I i) contract >>=? fun (op, tx_rollup) -> + Incremental.add_operation i op >>=? fun i -> + check_tx_rollup_exists (I i) tx_rollup >>=? fun () -> + cost_per_byte *? Int64.of_int origination_size + >>?= fun tx_rollup_origination_burn -> + Assert.balance_was_debited + ~loc:__LOC__ + (I i) + contract + balance + tx_rollup_origination_burn + +(** [test_two_originations] originates two transaction rollups in the + same operation and checks that they have a different address. *) +let test_two_originations () = + Context.init1 ~tx_rollup_enable:true ~tx_rollup_sunset_level:Int32.max_int () + >>=? fun (b, contract) -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_origination (I i) contract >>=? fun (op1, _false_tx_rollup1) -> + (* tx_rollup1 and tx_rollup2 are equal and both are false. The addresses are + derived from a value called `origination_nonce` that is dependent of the + tezos operation hash. Also each origination increment this value. + + Here the origination_nonce is wrong because it's not based on the injected + operation (the combined one. Also the used origination nonce is not + incremented between _false_tx_rollup1 and _false_tx_rollup2 as the protocol + do. *) + Op.tx_rollup_origination (I i) contract >>=? fun (op2, _false_tx_rollup2) -> + Op.combine_operations ~source:contract (B b) [op1; op2] >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + let nonce = + Origination_nonce.Internal_for_tests.initial (Operation.hash_packed op) + in + let txo1 = Tx_rollup.Internal_for_tests.originated_tx_rollup nonce in + let nonce = Origination_nonce.Internal_for_tests.incr nonce in + let txo2 = Tx_rollup.Internal_for_tests.originated_tx_rollup nonce in + Assert.not_equal + ~loc:__LOC__ + Tx_rollup.equal + "Two transaction rollups originated in one operation have different \ + addresses" + Tx_rollup.pp + txo1 + txo2 + >>=? fun () -> + check_tx_rollup_exists (I i) txo1 >>=? fun () -> + check_tx_rollup_exists (I i) txo2 >>=? fun () -> return_unit + +(** [test_burn_per_byte_update] checks [update_burn_per_byte] behaves + according to its docstring. *) +let test_burn_per_byte_update () = + let test ~inbox_ema ~burn_per_byte ~elapsed ~final_size ~hard_limit ~result = + let burn_per_byte = Tez.of_mutez_exn burn_per_byte in + let result = Tez.of_mutez_exn result in + let state = + Alpha_context.Tx_rollup_state.Internal_for_tests.make + ~burn_per_byte + ~inbox_ema + ~allocated_storage:Z.zero + () + in + let factor = 120 (* default factor *) in + let state = + Alpha_context.Tx_rollup_state.Internal_for_tests.update_burn_per_byte + state + ~elapsed + ~factor + ~final_size + ~hard_limit + in + let new_burn = + match Alpha_context.Tx_rollup_state.burn_cost ~limit:None state 1 with + | Ok x -> x + | Error _ -> + Stdlib.failwith "could not compute the fees for a message of 1 byte" + in + Assert.equal_tez ~loc:__LOC__ result new_burn + in + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:0 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:1_000L + >>=? fun () -> + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:10 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:816L + >>=? fun () -> + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:25 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:383L + >>=? fun () -> + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:50 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:113L + >>=? fun () -> + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:113 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:0L + >>=? fun () -> + (* Fees per byte should remain constant *) + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:0 + ~final_size:1_000 + ~hard_limit:1_100 + ~result:1_000L + >>=? fun () -> + (* Fees per byte should increase *) + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:0 + ~final_size:1_000 + ~hard_limit:1_000 + ~result:1_050L + >>=? fun () -> + (* Fees per byte should decrease *) + test + ~inbox_ema:1_000 + ~burn_per_byte:1_000L + ~elapsed:0 + ~final_size:1_000 + ~hard_limit:1_500 + ~result:950L + >>=? fun () -> + (* Fees per byte should increase even with [0] as its initial value *) + test + ~inbox_ema:1_000 + ~burn_per_byte:0L + ~elapsed:0 + ~final_size:1_000 + ~hard_limit:1_000 + ~result:1L + >>=? fun () -> return_unit + +(** [test_add_batch] originates a tx rollup and fills one of its inbox + with an arbitrary batch of data. *) +let test_add_batch () = + let contents_size = 5 in + let contents = String.make contents_size 'c' in + init_originate_and_submit ~batch:contents () + >>=? fun ((contract, balance), state, tx_rollup, b) -> + Context.Tx_rollup.inbox (B b) tx_rollup Tx_rollup_level.root >>=? fun inbox -> + let contents_hash = + Tx_rollup_message.make_batch contents + |> fst |> Tx_rollup_message_hash.hash_uncarbonated + in + let merkle_root = Tx_rollup_inbox.Merkle.merklize_list [contents_hash] in + let expected_inbox = + Tx_rollup_inbox. + {inbox_length = 1; cumulated_size = contents_size; merkle_root} + in + Alcotest.( + check + (option inbox_testable) + "Expected inbox is not the computed one" + (Some expected_inbox) + inbox) ; + inbox_burn state contents_size >>?= fun cost -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract balance cost + +(** [test_storage_burn_for_adding_batch] originates a tx rollup with small [tx_rollup_origination_size], + fills one of its inbox with an arbitrary batch of data and cause additional storage burn. *) +let test_storage_burn_for_adding_batch () = + let contents_size = 5 in + let contents = String.make contents_size 'c' in + let tx_rollup_origination_size = 1 in + init_originate_and_submit ~tx_rollup_origination_size ~batch:contents () + >>=? fun ((contract, balance), state, _tx_rollup, b) -> + Context.get_constants (B b) >>=? fun {parametric = {cost_per_byte; _}; _} -> + let final_allocated_storage = + Alpha_context.Tx_rollup_state.Internal_for_tests.get_occupied_storage state + in + let extra_storage_space = + Z.(sub final_allocated_storage @@ of_int tx_rollup_origination_size) + in + assert (Z.zero < extra_storage_space) ; + inbox_burn state contents_size >>?= fun cost -> + cost_per_byte *? Z.to_int64 extra_storage_space >>?= fun storage_burn_cost -> + cost +? storage_burn_cost >>?= fun cost -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract balance cost + +let test_add_batch_with_limit () = + (* From an empty context the burn will be [Tez.zero], we set the hard limit to + [Tez.zero], so [cost] >= [limit] *) + let burn_limit = Tez.zero in + let contents = "batch" in + context_init1 () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_submit_batch (I i) contract tx_rollup contents ~burn_limit + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Tx_rollup_errors.Submit_batch_burn_exceeded _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_add_two_batches] originates a tx rollup and adds two + arbitrary batches to one of its inboxes. Ensure that their order + is correct. *) +let test_add_two_batches () = + (* + TODO: https://gitlab.com/tezos/tezos/-/issues/2331 + This test can be generalized using a property-based approach. + *) + let contents1 = "batch" in + init_originate_and_submit ~batch:contents1 () + >>=? fun ((contract, balance), state, tx_rollup, b) -> + Op.tx_rollup_submit_batch (B b) contract tx_rollup contents1 >>=? fun op1 -> + Context.Contract.counter (B b) contract >>=? fun counter -> + let contents2 = "batch2" in + Op.tx_rollup_submit_batch + ~counter:Manager_counter.(succ counter) + (B b) + contract + tx_rollup + contents2 + >>=? fun op2 -> + Op.batch_operations ~source:contract (B b) [op1; op2] >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* There were a first inbox with one message, and we are looking for + its successor. *) + Context.Tx_rollup.inbox (B b) tx_rollup Tx_rollup_level.(succ root) + >>=? fun inbox -> + let contents1_hash = + Tx_rollup_message_hash.hash_uncarbonated + (Tx_rollup_message.make_batch contents1 |> fst) + in + let contents2_hash = + Tx_rollup_message_hash.hash_uncarbonated + (Tx_rollup_message.make_batch contents2 |> fst) + in + let merkle_root = + Tx_rollup_inbox.Merkle.merklize_list [contents1_hash; contents2_hash] + in + let expected_inbox = + Tx_rollup_inbox.{inbox_length = 2; cumulated_size = 5 + 6; merkle_root} + in + Alcotest.( + check + (option inbox_testable) + "The expected inbox is not the computed one" + inbox + (Some expected_inbox)) ; + inbox_burn state expected_inbox.cumulated_size >>?= fun cost -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract balance cost + +(** Try to add a batch too large in an inbox. *) +let test_batch_too_big () = + context_init1 () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + Context.get_constants (B b) >>=? fun constant -> + let contents = + String.make + (constant.parametric.tx_rollup.hard_size_limit_per_message + 1) + 'd' + in + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_submit_batch (I i) contract tx_rollup contents >>=? fun op -> + Incremental.add_operation + i + ~expect_failure: + (check_proto_error Tx_rollup_errors.Message_size_exceeds_limit) + op + >>=? fun (_ : Incremental.t) -> return_unit + +(** [fill_inbox b tx_rollup contract contents k] fills the inbox of + [tx_rollup] with batches containing [contents] sent by [contract]. + Before exceeding the limit size of the inbox, the continuation [k] + is called with two parameters: the incremental state of the block + with the almost full inboxes, and an operation that would cause an + error if applied. *) +let fill_inbox b tx_rollup contract contents k = + let message_size = String.length contents in + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_inbox_limit = + constant.parametric.tx_rollup.hard_size_limit_per_inbox + in + Context.Contract.counter (B b) contract >>=? fun counter -> + let rec fill_inbox inbox_size counter operations = + (* We set an arbitrary gas limit to be able to reach the size + limit of an operation. *) + Op.tx_rollup_submit_batch + ~gas_limit:(Custom_gas (Gas.Arith.integral_of_int_exn 20_000)) + ~counter + (B b) + contract + tx_rollup + contents + >>=? fun operation -> + let new_inbox_size = inbox_size + message_size in + if new_inbox_size < tx_rollup_inbox_limit then + fill_inbox + new_inbox_size + (Manager_counter.succ counter) + (operation :: operations) + else + Incremental.begin_construction b >>=? fun i -> + k i inbox_size (operation, operations) + in + fill_inbox 0 counter [] + +(** Try to add enough large batches to reach the size limit of an inbox. *) +let test_inbox_size_too_big () = + context_init1 () >>=? fun (b, contract) -> + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_batch_limit = + constant.parametric.tx_rollup.hard_size_limit_per_message - 1 + in + let contents = String.make tx_rollup_batch_limit 'd' in + originate b contract >>=? fun (b, tx_rollup) -> + fill_inbox b tx_rollup contract contents (fun i _ (op, ops) -> + Op.batch_operations + ~recompute_counters:true + ~source:contract + (I i) + (ops @ [op]) + >>=? fun op -> + Incremental.add_operation + i + op + ~check_size:false + ~expect_apply_failure: + (check_proto_error_f (function + | Tx_rollup_errors.Inbox_size_would_exceed_limit _ -> true + | _ -> false)) + >>=? fun (_i : Incremental.t) -> return_unit) + +(** Try to add enough batches to reach the batch count limit of an inbox. *) +let test_inbox_count_too_big () = + context_init1 ~tx_max_messages_per_inbox:505 () >>=? fun (b, contract) -> + let _, _, pkh = gen_l2_account () in + Context.get_constants (B b) >>=? fun constant -> + let message_count = constant.parametric.tx_rollup.max_messages_per_inbox in + let contents = "some contents" in + originate b contract >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit.tz" + "Unit" + contract + b + (Context.Contract.pkh contract) + >>=? fun (deposit_contract, b) -> + let rec fill_inbox b counter n batch = + (* By default, the [gas_limit] is the maximum gas that can be + consumed by an operation. We set a lower (arbitrary) limit to + be able to reach the size limit of an operation. *) + Op.tx_rollup_submit_batch + ~gas_limit:(Custom_gas (Gas.Arith.integral_of_int_exn 3_500)) + ~counter + (B b) + contract + tx_rollup + contents + >>=? fun op -> + (match batch with + | None -> return op + | Some batch -> + Op.batch_operations + ~recompute_counters:true + ~source:contract + (B b) + [batch; op]) + >>=? fun op -> + if n > 0 then fill_inbox b (Manager_counter.succ counter) (n - 1) (Some op) + else return (op, counter) + in + Context.Contract.counter (B b) contract >>=? fun counter -> + fill_inbox b counter message_count None >>=? fun (batch, counter) -> + Op.tx_rollup_submit_batch + ~gas_limit:(Custom_gas (Gas.Arith.integral_of_int_exn 2_500)) + ~counter + (B b) + contract + tx_rollup + contents + >>=? fun op1 -> + Op.batch_operations + ~recompute_counters:true + ~source:contract + (B b) + [batch; op1] + >>=? fun op -> + (* Submitting a new batch to a full inbox fails *) + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~check_size:false + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Inbox_count_would_exceed_limit rollup -> + rollup = tx_rollup + | _ -> false) + >>=? fun (_i : Incremental.t) -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter + ~fee + (I i) + contract + deposit_contract + Tez.zero + ~parameters + >>=? fun op2 -> + Op.batch_operations + ~recompute_counters:true + ~source:contract + (B b) + [batch; op2] + >>=? fun op -> + (* Submitting a new deposit to a full inbox fails *) + Incremental.add_operation + i + op + ~check_size:false + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Inbox_count_would_exceed_limit rollup -> + rollup = tx_rollup + | _ -> false) + >>=? fun i -> + ignore i ; + return () + +(** [test_valid_deposit] checks that a smart contract can deposit + tickets to a transaction rollup. *) +let test_valid_deposit () = + let _, _, addr = gen_l2_account () in + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup account addr + >>=? fun (b, (deposit, cumulated_size), _) -> + Context.Tx_rollup.inbox (B b) tx_rollup Tx_rollup_level.root >>=? fun inbox -> + let merkle_root = + Tx_rollup_inbox.Merkle.merklize_list + [Tx_rollup_message_hash.hash_uncarbonated deposit] + in + let expected_inbox = + Tx_rollup_inbox.{inbox_length = 1; cumulated_size; merkle_root} + in + Alcotest.( + check + (option inbox_testable) + "Expected inbox different from the computed one" + inbox + (Some expected_inbox)) ; + return_unit + +(** [test_additional_space_allocation_for_valid_deposit] originates a tx rollup with small [tx_rollup_origination_size], make a valid deposit and check additional space allocation *) +let test_additional_space_allocation_for_valid_deposit () = + let _, _, pkh = gen_l2_account () in + let tx_rollup_origination_size = 1 in + context_init1 ~tx_rollup_origination_size () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + ~fee + (B b) + account + contract + Tez.zero + ~parameters + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + occupied_storage_size (B b) tx_rollup >>=? fun final_allocated_storage -> + let extra_storage_space = + Z.(sub final_allocated_storage @@ of_int tx_rollup_origination_size) + in + return @@ assert (Z.zero < extra_storage_space) + +(** [test_valid_deposit_inexistant_rollup] checks that the Michelson + interpreter checks the existence of a transaction rollup prior to + sending a deposit order. *) +let test_valid_deposit_inexistant_rollup () = + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (b, account) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let parameters = + print_deposit_arg (`Raw "txr1UTQm2gtoVJNvJRGfwora8GmM7D5dnEcdb") (`Hash pkh) + in + let fee = Test_tez.of_int 10 in + Op.transaction ~fee (I i) account contract Tez.zero ~parameters >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Script_interpreter.Runtime_contract_error _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_invalid_deposit_not_contract] checks a smart contract cannot + deposit something that is not a ticket. *) +let test_invalid_deposit_not_ticket () = + let _, _, pkh = gen_l2_account () in + + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_incorrect_param.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + let fee = Test_tez.of_int 10 in + Op.transaction ~fee (I i) account contract Tez.zero ~parameters >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Script_interpreter.Bad_contract_parameter _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +let string_ticket_of_size expected_size = + if expected_size < 0 && expected_size mod 8 <> 0 then + Alcotest.fail + (Format.asprintf + "string_ticket_of_size: argument [expected_size] must be positive and \ + a multiple of 8") ; + let ticket_contents_ty = + Tezos_micheline.Micheline.Prim (0, Michelson_v1_primitives.T_string, [], []) + in + let _, ticket_contents_ty_size = + Script_typed_ir_size.node_size ticket_contents_ty + in + Alcotest.( + check + (option sint_testable) + "Expected size of ticket_contents type" + (Saturation_repr.of_int_opt 40) + (Some ticket_contents_ty_size)) ; + let _, empty_string_size = + Script_typed_ir_size.node_size (Expr_common.string "") + in + let ticket_contents = + Expr_common.string + (String.make + (expected_size + - Saturation_repr.to_int ticket_contents_ty_size + - Saturation_repr.to_int empty_string_size) + 'a') + in + let _, ticket_contents_size = + Script_typed_ir_size.node_size ticket_contents + in + Alcotest.( + check + (option sint_testable) + "Expected size of ticket_contents type + ticket_contents" + (Saturation_repr.of_int_opt expected_size) + (Some Saturation_repr.(add ticket_contents_ty_size ticket_contents_size))) ; + ticket_contents + +(** [test_invalid_deposit_too_big_ticket] tests that depositing a ticket that + has a content whose size exceeds [tx_rollup_max_ticket_payload_size] fails.*) +let test_invalid_deposit_too_big_ticket () = + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (b, account) -> + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_max_ticket_payload_size = + constant.parametric.tx_rollup.max_ticket_payload_size + in + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_string.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let ticket_contents = + string_ticket_of_size (tx_rollup_max_ticket_payload_size + 8) + in + let parameters = + Expr_common.( + pair_n + [ + string (Tx_rollup.to_b58check tx_rollup); + string (Tx_rollup_l2_address.to_b58check pkh); + ticket_contents; + ]) + |> Tezos_micheline.Micheline.strip_locations |> Script.lazy_expr + in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + ~fee + (B b) + account + contract + Tez.zero + ~parameters + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Tx_rollup_errors_repr.Ticket_payload_size_limit_exceeded _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_invalid_deposit_too_big_ticket_type] tests that depositing a + ticket that has a content and type whose summed size exceeds + [tx_rollup_max_ticket_payload_size] fails.*) +let test_invalid_deposit_too_big_ticket_type () = + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (b, account) -> + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_max_ticket_payload_size = + constant.parametric.tx_rollup.max_ticket_payload_size + in + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_pair_string.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let ticket_contents = + string_ticket_of_size tx_rollup_max_ticket_payload_size + in + let parameters = + Expr_common.( + pair_n + [ + string (Tx_rollup.to_b58check tx_rollup); + string (Tx_rollup_l2_address.to_b58check pkh); + ticket_contents; + ]) + |> Tezos_micheline.Micheline.strip_locations |> Script.lazy_expr + in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + ~fee + (B b) + account + contract + Tez.zero + ~parameters + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Tx_rollup_errors_repr.Ticket_payload_size_limit_exceeded _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_valid_deposit_big_ticket] tests that depositing a ticket whose size is exactly + [tx_rollup_max_ticket_payload_size] succeeds.*) +let test_valid_deposit_big_ticket () = + let _, _, pkh = gen_l2_account () in + (* [overhead] is the number of bytes introduced by the wrapping of a + string in a ticket. This encompasses the ticketer, amount and ty + fields. + + This value has been fetched from the failing test, and acts as a + regression value. *) + let overhead = 136 in + context_init1 () >>=? fun (b, account) -> + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_max_ticket_payload_size = + constant.parametric.tx_rollup.max_ticket_payload_size + in + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_string.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let ticket_contents = + string_ticket_of_size (tx_rollup_max_ticket_payload_size - overhead) + in + let parameters = + Expr_common.( + pair_n + [ + string (Tx_rollup.to_b58check tx_rollup); + string (Tx_rollup_l2_address.to_b58check pkh); + ticket_contents; + ]) + |> Tezos_micheline.Micheline.strip_locations |> Script.lazy_expr + in + let fee = Test_tez.of_int 10 in + Op.transaction + ~counter:(Manager_counter.Internal_for_tests.of_int 2) + ~fee + (B b) + account + contract + Tez.zero + ~parameters + >>=? fun op -> + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_invalid_entrypoint] checks that a transaction to an invalid entrypoint + of a transaction rollup fails. *) +let test_invalid_entrypoint () = + let _, _, pkh = gen_l2_account () in + + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_incorrect_param.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + let fee = Test_tez.of_int 10 in + Op.transaction ~fee (I i) account contract Tez.zero ~parameters >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Script_interpreter.Bad_contract_parameter _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_invalid_l2_address] checks that a smart contract cannot make + a deposit order to something that is not a valid layer-2 address. *) +let test_invalid_l2_address () = + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let parameters = + print_deposit_arg (`Typed tx_rollup) (`Raw "\"invalid L2 address\"") + in + let fee = Test_tez.of_int 10 in + Op.transaction ~fee (I i) account contract Tez.zero ~parameters >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f (function + | Script_interpreter.Bad_contract_parameter _ -> true + | _ -> false)) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_valid_deposit_invalid_amount] checks that a transaction to a + transaction rollup fails if the [amount] parameter is not null. *) +let test_valid_deposit_invalid_amount () = + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_deposit_one_mutez.tz" + "Unit" + account + b + (Context.Contract.pkh account) + >>=? fun (contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + let fee = Test_tez.of_int 10 in + Op.transaction ~fee (I i) account contract Tez.zero ~parameters >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_runtime_error + Script_interpreter_defs.Rollup_invalid_transaction_amount) + >>=? fun (_ : Incremental.t) -> return_unit + +(** [test_deposit_too_many_tickets] checks that a deposit of + too many tickets is rejected *) +let test_deposit_too_many_tickets () = + let too_many = Z.succ (Z.of_int64 Int64.max_int) in + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (block, account1) -> + originate block account1 >>=? fun (block, tx_rollup) -> + Nat_ticket.init_deposit too_many block tx_rollup account1 + >>=? fun (operation, b, deposit_contract) -> + Block.bake ~allow_manager_failures:true ~operation b >>=? fun b -> + let fee = Test_tez.of_int 10 in + let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in + Op.transaction ~fee (B b) account1 deposit_contract Tez.zero ~parameters + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + operation + ~expect_apply_failure: + (check_proto_error Apply.Tx_rollup_invalid_transaction_ticket_amount) + >>=? fun i -> + ignore i ; + return_unit + +(** Test that block finalization changes gas rates *) +let test_finalization () = + context_init2 ~tx_rollup_max_inboxes_count:5_000 () >>=? fun (b, contracts) -> + let contract, _ = contracts in + let filler = contract in + originate b contract >>=? fun (b, tx_rollup) -> + Context.get_constants (B b) + >>=? fun {parametric = {tx_rollup = {hard_size_limit_per_inbox; _}; _}; _} -> + (* Get the initial burn_per_byte. *) + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + burn_per_byte state >>?= fun cost -> + Assert.equal_tez ~loc:__LOC__ Tez.zero cost >>=? fun () -> + (* Fill the inbox. *) + Context.get_constants (B b) >>=? fun constant -> + let tx_rollup_batch_limit = + constant.parametric.tx_rollup.hard_size_limit_per_message - 1 + in + let contents = String.make tx_rollup_batch_limit 'd' in + (* Repeating fill inbox and finalize block to increase EMA + until EMA is enough to provoke a change of fees. *) + let rec increase_ema n b tx_rollup f = + f b tx_rollup >>=? fun (inbox_size, i, (_operation, ops)) -> + Op.batch_operations ~recompute_counters:true ~source:filler (I i) ops + >>=? fun op -> + Incremental.add_operation ~check_size:false i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + let inbox_ema = + Alpha_context.Tx_rollup_state.Internal_for_tests.get_inbox_ema state + in + if hard_size_limit_per_inbox * 91 / 100 < inbox_ema then + return (b, n, inbox_size) + else increase_ema (n + 1) b tx_rollup f + in + ( increase_ema 1 b tx_rollup @@ fun b tx_rollup -> + fill_inbox b tx_rollup filler contents (fun i size ops -> + return (size, i, ops)) ) + >>=? fun (b, n, inbox_size) -> + let rec update_burn_per_byte_n_time n state = + if n > 0 then + let factor = 120 (* default factor *) in + let elapsed = 0 (* the inbox was filled at every block *) in + let state = + Alpha_context.Tx_rollup_state.Internal_for_tests.update_burn_per_byte + state + ~elapsed + ~factor + ~final_size:inbox_size + ~hard_limit:hard_size_limit_per_inbox + in + update_burn_per_byte_n_time (n - 1) state + else state + in + (* Check the fees we are getting after finalization are (1) strictly + positive, and (2) the one we can predict with + [update_burn_per_byte]. + + [n - 2] comes from the following facts: + + - The [update_burn_per_byte] is called only on a new inbox + + - The [update_burn_per_byte] needs the predecessor inbox, hence + it is not called on the first inbox *) + let expected_state = update_burn_per_byte_n_time (n - 2) state in + burn_per_byte expected_state >>?= fun expected_burn_per_byte -> + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + burn_per_byte state >>?= fun burn_per_byte -> + assert (Tez.(zero < burn_per_byte)) ; + Assert.equal_tez ~loc:__LOC__ expected_burn_per_byte burn_per_byte + >>=? fun () -> + (* Insert a small batch in a new block *) + let contents_size = 5 in + let contents = String.make contents_size 'c' in + Context.Contract.balance (B b) contract >>=? fun balance -> + Context.Contract.counter (B b) contract >>=? fun counter -> + Op.tx_rollup_submit_batch ~counter (B b) contract tx_rollup contents + >>=? fun op -> + Block.bake b ~operation:op >>=? fun b -> + (* Predict the cost we had to pay. *) + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + inbox_burn state contents_size >>?= fun cost -> + (* Add upfront cost for the commitment hash *) + Context.get_constants (B b) >>=? fun {parametric = {cost_per_byte; _}; _} -> + cost_per_byte *? Int64.of_int Tx_rollup_prefixes.message_result_hash.hash_size + >>?= fun upfront_cost -> + upfront_cost +? cost >>?= fun cost -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract balance cost + +(** [test_commitment_duplication] originates a rollup, and makes a + commitment. It attempts to add a second commitment for the same + level, and ensures that this fails. It adds a commitment with + the wrong batch count and ensures that that fails. *) +let test_commitment_duplication () = + context_init2 () >>=? fun (b, (contract1, contract2)) -> + let pkh1 = Context.Contract.pkh contract1 in + originate b contract1 >>=? fun (b, tx_rollup) -> + Context.Contract.balance (B b) contract1 >>=? fun balance -> + Context.Contract.balance (B b) contract2 >>=? fun balance2 -> + (* In order to have a permissible commitment, we need a transaction. *) + let contents = "batch" in + Op.tx_rollup_submit_batch (B b) contract1 tx_rollup contents + >>=? fun operation -> + add_operation b operation >>=? fun b -> + make_incomplete_commitment_for_batch (B b) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> + (* Successfully fail to submit a different commitment from contract2 *) + let batches2 : Tx_rollup_message_result_hash.t list = + [Bytes.make 20 '1'; Bytes.make 20 '2'] + |> List.map (fun hash -> + let context_hash = Tezos_crypto.Context_hash.hash_bytes [hash] in + Tx_rollup_message_result_hash.hash_uncarbonated + { + context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + }) + in + let commitment_with_wrong_count : Tx_rollup_commitment.Full.t = + {commitment with messages = batches2} + in + Op.tx_rollup_commit (B b) contract2 tx_rollup commitment_with_wrong_count + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure:(check_proto_error Tx_rollup_errors.Wrong_batch_count) + >>=? fun i -> + (* Submit the correct one *) + Context.get_level (I i) >>?= fun level -> + let submitted_level = Raw_level.succ level in + Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + Context.get_constants (B b) >>=? fun constants -> + let cost = constants.parametric.tx_rollup.commitment_bond in + Assert.balance_was_debited ~loc:__LOC__ (B b) contract1 balance cost + >>=? fun () -> + (* Successfully fail to submit a duplicate commitment *) + Op.tx_rollup_commit (B b) contract2 tx_rollup commitment >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + (Incremental.add_operation i op >>= function + | Ok _ -> failwith "an error was expected" + | Error e -> + check_proto_error_f + (function Tx_rollup_errors.No_uncommitted_inbox -> true | _ -> false) + e) + >>=? fun () -> + (* No charge. *) + Assert.balance_was_debited ~loc:__LOC__ (I i) contract2 balance2 Tez.zero + >>=? fun () -> + Context.Tx_rollup.state (I i) tx_rollup >>=? fun state -> + let ctxt = Incremental.alpha_ctxt i in + Tx_rollup_commitment.find ctxt tx_rollup state Tx_rollup_level.root + >>=?? fun (_, commitment_opt) -> + (match commitment_opt with + | None -> raise (Invalid_argument "No commitment") + | Some + { + commitment = expected_commitment; + commitment_hash = expected_hash; + committer; + submitted_at; + finalized_at; + } -> + let compact_commitment = Tx_rollup_commitment.Full.compact commitment in + Alcotest.( + check + commitment_compact_testable + "Commitment" + expected_commitment + compact_commitment) ; + Alcotest.( + check commitment_hash_testable "Commitment hash" expected_hash + @@ Tx_rollup_commitment.Compact.hash compact_commitment) ; + Alcotest.(check public_key_hash_testable "Committer" pkh1 committer) ; + Alcotest.( + check raw_level_testable "Submitted" submitted_level submitted_at) ; + Alcotest.(check (option raw_level_testable) "Finalized" None finalized_at)) ; + check_bond ctxt tx_rollup contract1 1 >>=? fun () -> + check_bond ctxt tx_rollup contract2 0 >>=? fun () -> + ignore i ; + return () + +let test_commit_current_inbox () = + context_init2 () >>=? fun (b, (contract1, contract2)) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + (* In order to have a permissible commitment, we need a transaction. *) + Incremental.begin_construction b >>=? fun i -> + let contents = "batch" in + let message, _ = Tx_rollup_message.make_batch contents in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let inbox_hash = Tx_rollup_inbox.Merkle.merklize_list [message_hash] in + Op.tx_rollup_submit_batch (I i) contract1 tx_rollup contents + >>=? fun operation -> + Incremental.add_operation i operation >>=? fun i -> + Op.tx_rollup_commit + (I i) + contract2 + tx_rollup + { + level = Tx_rollup_level.root; + inbox_merkle_root = inbox_hash; + predecessor = None; + messages = [Tx_rollup_message_result_hash.zero]; + } + >>=? fun operation -> + Incremental.add_operation + i + operation + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.No_uncommitted_inbox) + >>=? fun i -> + ignore i ; + return_unit + +let make_transactions_in tx_rollup contract blocks b = + let contents = "batch " in + let rec aux cur blocks b = + match blocks with + | [] -> return b + | hd :: rest when hd = cur -> + Op.tx_rollup_submit_batch (B b) contract tx_rollup contents + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> aux (cur + 1) rest b + | blocks -> + let operations = [] in + Block.bake ~operations b >>=? fun b -> aux (cur + 1) blocks b + in + aux 2 blocks b + +let assert_ok res = + match res with + | Ok r -> r + | Error _ -> raise (Invalid_argument "Error: assert_ok") + +let tx_level level = assert_ok @@ Tx_rollup_level.of_int32 level + +(** [test_storage_burn_for_commitment] test storage space allocation + for adding and removing commitment and bond. *) +let test_storage_burn_for_commitment () = + let check_storage_delta ~__POS__ msg ~size_before ~size_after ~expected_delta + = + Alcotest.( + check + ~pos:__POS__ + zestable + msg + expected_delta + Z.(sub size_after size_before)) + in + let tx_rollup_origination_size = 1 in + context_init1 ~tx_rollup_origination_size () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + make_transactions_in tx_rollup contract [2; 3; 4] b >>=? fun b -> + (* test allocated storage size and balance before/after submit commitment *) + Incremental.begin_construction b >>=? fun i -> + occupied_storage_size (B b) tx_rollup >>=? fun storage_size_before_commit -> + make_incomplete_commitment_for_batch (I i) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (I i) contract tx_rollup commitment >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + occupied_storage_size (I i) tx_rollup >>=? fun storage_size_after_commit -> + (* adding a commitment frees the inbox storage *) + let commitment_add_delta = Z.neg Tx_rollup_inbox.size in + (* removing a commitment doesn't change anything storage burn related *) + let commitment_remove_delta = Z.zero in + check_storage_delta + ~__POS__ + "Size increase after adding commitment" + ~size_before:storage_size_before_commit + ~size_after:storage_size_after_commit + ~expected_delta:commitment_add_delta ; + Incremental.finalize_block i >>=? fun b -> + (* test freed storage space after finalize *) + Op.tx_rollup_finalize (B b) contract tx_rollup >>=? fun op -> + Block.bake ~operation:op b >>=? fun b -> + occupied_storage_size (B b) tx_rollup >>=? fun freed_space_after_finalize -> + (* the inbox does not allocate anything, because it was already + allocated by a freed inboxes *) + let inbox_delta = Z.zero in + check_storage_delta + ~__POS__ + "Storage space is freed after finalize" + ~size_before:storage_size_after_commit + ~size_after:freed_space_after_finalize + ~expected_delta:inbox_delta ; + (* bake one more block so the commitment may be removed *) + Block.bake b >>=? fun b -> + (* test freed storage space after remove commitment *) + Op.tx_rollup_remove_commitment (B b) contract tx_rollup >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + occupied_storage_size (B b) tx_rollup + >>=? fun freed_space_after_remove_commitment -> + let commitment_remove_delta = Z.neg commitment_remove_delta in + check_storage_delta + ~__POS__ + "Storage space is freed after removing commitment" + ~size_before:freed_space_after_finalize + ~size_after:freed_space_after_remove_commitment + ~expected_delta:commitment_remove_delta ; + (* test freed storage space after return bond *) + Op.tx_rollup_return_bond (B b) contract tx_rollup >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + occupied_storage_size (B b) tx_rollup + >>=? fun freed_space_after_return_bond -> + let bond_remove_delta = Z.zero in + check_storage_delta + ~__POS__ + "Storage space is freed after removing bond" + ~size_before:freed_space_after_remove_commitment + ~size_after:freed_space_after_return_bond + ~expected_delta:bond_remove_delta ; + return_unit + +(** [test_storage_burn_for_commitment] test storage space allocation for adding and removing commitment and bond. *) +let test_storage_burn_for_commitment_and_bond () = + let check_storage_delta ~__POS__ msg ~size_before ~size_after ~expected_delta + = + Alcotest.( + check + ~pos:__POS__ + zestable + msg + (Z.of_int expected_delta) + Z.(sub size_after size_before)) + in + let tx_rollup_origination_size = 1 in + context_init1 ~tx_rollup_origination_size () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + make_transactions_in tx_rollup contract [2; 3; 4] b >>=? fun b -> + (* test allocated storage size and balance before/after submit commitment *) + Incremental.begin_construction b >>=? fun i -> + occupied_storage_size (B b) tx_rollup >>=? fun storage_size_before_commit -> + make_incomplete_commitment_for_batch (I i) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (I i) contract tx_rollup commitment >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + occupied_storage_size (I i) tx_rollup >>=? fun storage_size_after_commit -> + (* extra space should be allocated for submitting commitment *) + let commitment_sans_preallocation_delta = 99 in + let adjust_unfinalized_commitments_count_delta = 4 in + let commitment_add_delta = + commitment_sans_preallocation_delta + + adjust_unfinalized_commitments_count_delta + in + check_storage_delta + ~__POS__ + "Size increase after adding commitment" + ~size_before:storage_size_before_commit + ~size_after:storage_size_after_commit + ~expected_delta:commitment_add_delta ; + Incremental.finalize_block i >>=? fun b -> + (* test freed storage space after finalize *) + Op.tx_rollup_finalize (B b) contract tx_rollup >>=? fun op -> + Block.bake ~operation:op b >>=? fun b -> + occupied_storage_size (B b) tx_rollup >>=? fun freed_space_after_finalize -> + let inbox_delta = -40 in + let commitment_finalization_delta = 4 in + check_storage_delta + ~__POS__ + "Storage space is freed after finalize" + ~size_before:storage_size_after_commit + ~size_after:freed_space_after_finalize + ~expected_delta:(inbox_delta + commitment_finalization_delta) ; + + (* test freed storage space after remove commitment *) + Op.tx_rollup_remove_commitment (B b) contract tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + occupied_storage_size (B b) tx_rollup + >>=? fun freed_space_after_remove_commitment -> + let commitment_remove_delta = -135 in + check_storage_delta + ~__POS__ + "Storage space is freed after removing commitment" + ~size_before:freed_space_after_finalize + ~size_after:freed_space_after_remove_commitment + ~expected_delta:commitment_remove_delta ; + Alcotest.( + check + ~pos:__POS__ + int + "The delta of adding and removing a commitment is zero (modulo \ + preallocation)" + (-commitment_add_delta - Tx_rollup_prefixes.message_result_hash.hash_size) + commitment_remove_delta) ; + (* test freed storage space after return bond *) + Op.tx_rollup_return_bond (B b) contract tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + occupied_storage_size (B b) tx_rollup + >>=? fun freed_space_after_return_bond -> + let bond_remove_delta = -4 in + check_storage_delta + ~__POS__ + "Storage space is freed after removing bond" + ~size_before:freed_space_after_remove_commitment + ~size_after:freed_space_after_return_bond + ~expected_delta:bond_remove_delta ; + return_unit + +(** [test_commitment_predecessor] tests commitment predecessor edge cases *) +let test_commitment_predecessor () = + context_init1 () >>=? fun (b, contract1) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + (* Transactions in blocks 2, 3, 6 *) + make_transactions_in tx_rollup contract1 [2; 3; 6] b >>=? fun b -> + (* Check error: Commitment for nonexistent block *) + let bogus_hash = + Tx_rollup_commitment_hash.of_bytes_exn + (Bytes.of_string "tcu1deadbeefdeadbeefdeadbeefdead") + in + make_incomplete_commitment_for_batch (B b) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> + let commitment_for_invalid_inbox = {commitment with level = tx_level 10l} in + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment_for_invalid_inbox + >>=? fun op -> + let error = + Tx_rollup_errors.Commitment_too_early + {provided = tx_level 10l; expected = tx_level 0l} + in + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op ~expect_apply_failure:(check_proto_error error) + >>=? fun (_ : Incremental.t) -> + (* Now we submit a real commitment *) + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Commitment without predecessor for block with predecessor*) + make_incomplete_commitment_for_batch + (B b) + Tx_rollup_level.(succ root) + tx_rollup + [] + >>=? fun (commitment, _) -> + let commitment_with_missing_predecessor = + {commitment with predecessor = None} + in + Op.tx_rollup_commit + (B b) + contract1 + tx_rollup + commitment_with_missing_predecessor + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_predecessor_hash {provided = None; expected} -> + expected = commitment.predecessor + | _ -> false) + >>=? fun (_i : Incremental.t) -> + (* Commitment refers to a predecessor which does not exist *) + let commitment_with_wrong_pred = + {commitment with predecessor = Some bogus_hash} + in + Op.tx_rollup_commit (I i) contract1 tx_rollup commitment_with_wrong_pred + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_predecessor_hash {provided = _; expected} -> + expected = commitment.predecessor + | _ -> false) + >>=? fun i -> + ignore i ; + return () + +let test_full_inbox () = + let constants = + { + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_test with + consensus_threshold = 0; + endorsing_reward_per_slot = Tez.zero; + baking_reward_bonus_per_slot = Tez.zero; + baking_reward_fixed_portion = Tez.zero; + tx_rollup = + { + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_test + .tx_rollup + with + enable = true; + sunset_level = Int32.max_int; + max_inboxes_count = 15; + }; + } + in + Context.init_with_constants1 constants >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + let range start top = + let rec aux n acc = if n < start then acc else aux (n - 1) (n :: acc) in + aux top [] + in + (* Transactions in blocks [2..16) *) + make_transactions_in tx_rollup contract (range 2 16) b >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_submit_batch (B b) contract tx_rollup "contents" >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure:(check_proto_error Tx_rollup_errors.Too_many_inboxes) + >>=? fun i -> + ignore i ; + return () + +(** [test_bond_finalization] tests that level retirement in fact + allows bonds to be returned. *) +let test_bond_finalization () = + context_init1 () >>=? fun (b, contract1) -> + let pkh1 = Context.Contract.pkh contract1 in + originate b contract1 >>=? fun (b, tx_rollup) -> + Context.Contract.balance (B b) contract1 >>=? fun balance -> + (* Transactions in block 2, 3, 4 *) + make_transactions_in tx_rollup contract1 [2; 3; 4] b >>=? fun b -> + (* Let’s try to remove the bond *) + Context.get_constants (B b) >>=? fun constants -> + let bond = constants.parametric.tx_rollup.commitment_bond in + Op.tx_rollup_return_bond (B b) contract1 tx_rollup >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Bond_does_not_exist a_pkh1 -> a_pkh1 = pkh1 + | _ -> false) + >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + make_incomplete_commitment_for_batch (B b) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment_a, _) -> + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment_a + >>=? fun operation -> + add_operation b operation >>=? fun b -> + Op.tx_rollup_return_bond (B b) contract1 tx_rollup >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Bond_in_use a_pkh1 -> a_pkh1 = pkh1 + | _ -> false) + >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract1 balance bond + >>=? fun () -> + (* Finalize the commitment of level 0. *) + Op.tx_rollup_finalize (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Bake enough block, and remove the commitment of level 0. *) + Block.bake b ~operations:[] >>=? fun b -> + Op.tx_rollup_remove_commitment (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Try to return the bond *) + Context.Contract.balance (B b) contract1 >>=? fun balance -> + Op.tx_rollup_return_bond (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Check the balance*) + Assert.balance_was_credited ~loc:__LOC__ (B b) contract1 balance bond + +(** [test_finalization_edge_cases] tests finalization correctly fails + in various edge cases. *) +let test_finalization_edge_cases () = + context_init1 ~tx_rollup_finality_period:2 () >>=? fun (b, contract1) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_finalize (I i) contract1 tx_rollup >>=? fun op -> + (* With no inbox and no commitment *) + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) + >>=? fun (_i : Incremental.t) -> + let message = "bogus" in + Op.tx_rollup_submit_batch (B b) contract1 tx_rollup message >>=? fun op -> + add_operation b op >>=? fun b -> + Op.tx_rollup_submit_batch (B b) contract1 tx_rollup message >>=? fun op -> + add_operation b op >>=? fun b -> + Op.tx_rollup_finalize (B b) contract1 tx_rollup >>=? fun op -> + (* With an inbox, but no commitment *) + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) + >>=? fun (_i : Incremental.t) -> + make_incomplete_commitment_for_batch (I i) (tx_level 0l) tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun op -> + (* With a commitment, but too soon after the commitment *) + Incremental.add_operation i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_finalize (I i) contract1 tx_rollup >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) + >>=? fun (_i : Incremental.t) -> + Incremental.finalize_block i >>=? fun b -> + (* Now our finalization is valid *) + add_operation b op >>=? fun (_block : Block.t) -> return_unit + +(** [test_too_many_commitments] tests that you can't submit new + commitments if there are too many finalized commitments. *) +let test_too_many_commitments () = + context_init1 () >>=? fun (b, contract1) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + (* Transactions in block 2, 3, 4, 5 *) + make_transactions_in tx_rollup contract1 [2; 3; 4; 5] b >>=? fun b -> + let rec make_commitments b level n = + if n = 0 then return (b, level) + else + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment + >>=? fun operation -> + add_operation b operation >>=? fun b -> + make_commitments b (Tx_rollup_level.succ level) (n - 1) + in + make_commitments b Tx_rollup_level.root 3 >>=? fun (b, level) -> + (* Make sure all commitments can be finalized. *) + Incremental.begin_construction b >>=? fun i -> + bake_until i 10l >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + Op.tx_rollup_finalize (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + Op.tx_rollup_finalize (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Fail to add a new commitment. *) + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Too_many_commitments) + >>=? fun i -> + (* Wait out the withdrawal period. *) + bake_until i 12l >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* Remove one finalized commitment. *) + Op.tx_rollup_remove_commitment (B b) contract1 tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Now we can add a new commitment. *) + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + ignore b ; + + return () + +module Rejection = struct + open Protocol + + exception Error of Environment.Error_monad.error + + module Prover_storage : + Tx_rollup_l2_storage_sig.STORAGE + with type t = Tezos_context_memory.Context_binary.tree + and type 'a m = 'a Lwt.t = struct + type t = Tezos_context_memory.Context_binary.tree + + type 'a m = 'a Lwt.t + + module Syntax = struct + include Lwt.Syntax + + let return = Lwt.return + + let fail e = Lwt.fail (Error e) + + let catch (m : 'a m) k h = + Lwt.catch + (fun () -> m >>= k) + (function Error e -> h e | e -> Lwt.fail e) + + let list_fold_left_m = Lwt_list.fold_left_s + end + + let path k = [Bytes.to_string k] + + let get store key = + Tezos_context_memory.Context_binary.Tree.find store (path key) + + let set store key value = + Tezos_context_memory.Context_binary.Tree.add store (path key) value + + let remove store key = + Tezos_context_memory.Context_binary.Tree.remove store (path key) + end + + module Storage : + Tx_rollup_l2_storage_sig.STORAGE + with type t = Tezos_context_memory.Context_binary.t + and type 'a m = 'a Lwt.t = struct + type t = Tezos_context_memory.Context_binary.t + + type 'a m = 'a Lwt.t + + module Syntax = struct + include Lwt.Syntax + + let return = Lwt.return + + let fail e = Lwt.fail (Error e) + + let catch (m : 'a m) k h = + Lwt.catch + (fun () -> m >>= k) + (function Error e -> h e | e -> Lwt.fail e) + + let list_fold_left_m = Lwt_list.fold_left_s + end + + let path k = [Bytes.to_string k] + + let get store key = + Tezos_context_memory.Context_binary.find store (path key) + + let set store key value = + Tezos_context_memory.Context_binary.add store (path key) value + + let remove store key = + Tezos_context_memory.Context_binary.remove store (path key) + end + + module Prover_context = Tx_rollup_l2_context.Make (Prover_storage) + module L2_Context = Tx_rollup_l2_context.Make (Storage) + module Prover_apply = Tx_rollup_l2_apply.Make (Prover_context) + module Apply = Tx_rollup_l2_apply.Make (L2_Context) + module C = Tezos_context_memory.Context_binary + + let previous_message_result : Tx_rollup_message_result.t = + { + context_hash = Tx_rollup_message_result.empty_l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + + let init_with_bogus_batch () = + context_init1 () >>=? fun (b, contract1) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + let message = "bogus" in + Op.tx_rollup_submit_batch (B b) contract1 tx_rollup message + >>=? fun operation -> + add_operation b operation >|=? fun b -> + let level = Tx_rollup_level.root in + (b, contract1, tx_rollup, level, message) + + let init_with_valid_commitment () = + init_with_bogus_batch () + >>=? fun (b, contract1, tx_rollup, level, message) -> + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _batches_result) -> + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment + >>=? fun operation -> + add_operation b operation >|=? fun b -> + (b, contract1, tx_rollup, level, message, commitment) + + let init_with_invalid_commitment () = + init_with_bogus_batch () + >>=? fun (b, contract1, tx_rollup, level, message) -> + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _batches_result) -> + let commitment = + { + commitment with + messages = + [ + Tx_rollup_message_result_hash.hash_uncarbonated + { + context_hash = + Tezos_crypto.Context_hash.of_b58check_exn + "CoUiEnajKeukmYFUgWTJF2z3v24MycpTaomF8a9hRzVy7as9hvgy"; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + }; + ]; + } + in + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op >|=? fun i -> + (i, contract1, tx_rollup, level, message, commitment) + + let run_transaction ctxt l2_parameters msg = + let open Prover_context.Syntax in + let* ctxt, _ = Prover_apply.apply_message ctxt l2_parameters msg in + return ctxt + + let time () = + Time.System.now () |> Time.System.to_notation + |> Time.Protocol.of_notation_exn + + (** [init_l2_store ()] creates the required empty storage and tree. + It creates a tree where the counters are explicitly set (it's an Irmin + restriction that we can not hash an empty tree). It returns the + persistent store containing the tree. + + {!Tx_rollup_commitment.empty_l2_context_hash} is the hash of the + tree produced in this function. + *) + let init_l2_store () = + let open L2_Context.Syntax in + let* index = C.init "/tmp" in + let store = C.empty index in + let time = time () in + let tree = C.Tree.empty store in + let* tree = Prover_context.Address_index.init_counter tree in + let* tree = Prover_context.Ticket_index.init_counter tree in + let* ctxt = C.add_tree store [] tree in + let* h = C.commit ~time ctxt in + let index = C.index ctxt in + let* store = C.checkout_exn index h in + return store + + let get_tree_from_store store = + let open L2_Context.Syntax in + let* tree_opt = C.find_tree store [] in + return @@ assert_some tree_opt + + let hash_tree_from_store store = + let open L2_Context.Syntax in + let+ tree = get_tree_from_store store in + C.Tree.hash tree + + let commit_store store = + let open L2_Context.Syntax in + let time = time () in + let* h = C.commit ~time store in + let index = C.index store in + let* store = C.checkout_exn index h in + return store + + (** See {!Tx_rollup_commitment.empty_l2_context_hash} documentation. + The constant is created from the hash of the underlying tree in + the store generated by {!init_l2_store}. We then add a regression + test to ensure these two are synchronized. *) + let test_empty_l2_context_hash () = + let open L2_Context.Syntax in + let* store = init_l2_store () in + let* hash_tree = hash_tree_from_store store in + assert ( + Tezos_crypto.Context_hash.( + hash_tree = Tx_rollup_message_result.empty_l2_context_hash)) ; + return_unit + + (** [make_proof store msg] applies [msg] on [store] and returns the + created proof. *) + let make_proof store l2_parameters msg = + let open L2_Context.Syntax in + let index = C.index store in + let* hash = hash_tree_from_store store in + let* proof, () = + C.produce_stream_proof index (`Node hash) (fun ctxt -> + catch + (run_transaction ctxt l2_parameters msg) + (fun ctxt -> return (ctxt, ())) + (fun _ -> return (ctxt, ()))) + in + return proof + + let valid_empty_proof l2_parameters = + let open L2_Context.Syntax in + let* l2_store = init_l2_store () in + let message, _ = Tx_rollup_message.make_batch "bogus" in + make_proof l2_store l2_parameters message + + let invalid_proof : Tx_rollup_l2_proof.t = + { + version = 1; + before = `Value Tx_rollup_message_result.empty_l2_context_hash; + after = `Value Tezos_crypto.Context_hash.zero; + state = Seq.empty; + } + + (** Takes a commitment and replaces the message results with valid + results. *) + let replace_commitment ~l2_parameters ~store ~commitment messages = + let open L2_Context in + let open Syntax in + let* _, rev_results = + list_fold_left_m + (fun (store, rev_results) msg -> + let* store, withdraws = + catch + (Apply.apply_message store l2_parameters msg) + (fun (store, (_, withdraws)) -> return (store, withdraws)) + (fun _reason -> return (store, [])) + in + let* hash_tree = hash_tree_from_store store in + let result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated + { + context_hash = hash_tree; + withdraw_list_hash = + Tx_rollup_withdraw_list_hash.hash_uncarbonated withdraws; + } + in + return (store, result_hash :: rev_results)) + (store, []) + messages + in + let results = List.rev rev_results in + return Tx_rollup_commitment.{commitment with messages = results} + + (** Produce an invalid commitment with {!make_incomplete_commitment_for_batch}, + then changes the Merkle roots for each message result. + + FIXME/TORU: it is not perfectly valid, the withdrawals are still missing. + see {!replace_commitment} documentation. *) + let make_valid_commitment_for_messages ctxt ~level ~tx_rollup + ?(withdrawals = []) ~store messages = + make_incomplete_commitment_for_batch ctxt level tx_rollup withdrawals + >>=? fun (commitment, _) -> + l2_parameters ctxt >>=? fun l2_parameters -> + replace_commitment ~l2_parameters ~commitment ~store messages + >>= fun commitment -> return commitment + + let init_with_deposit ?tx_rollup_hard_size_limit_per_message addr = + init_l2_store () >>= fun store -> + context_init2 ?tx_rollup_hard_size_limit_per_message () + >>=? fun (b, (account, account2)) -> + originate b account >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup account addr + >>=? fun (b, (deposit, _), ticket_hash) -> + let deposit_hash = Tx_rollup_message_hash.hash_uncarbonated deposit in + let message_path = single_message_path deposit_hash in + Incremental.begin_construction b >>=? fun i -> + make_valid_commitment_for_messages + (I i) + ~level:Tx_rollup_level.root + ~tx_rollup + ~store + [deposit] + >>=? fun commitment -> + Op.tx_rollup_commit (I i) account tx_rollup commitment >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* We try to reject the previous commitment, but as it was valid, + we can not reject a valid state. We do not really need to test this + here, as there are dedicated tests, but this behaves like a regression + test. *) + l2_parameters (I i) >>=? fun l2_parameters -> + make_proof store l2_parameters deposit >>= fun proof -> + Incremental.begin_construction b >>=? fun i -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (I i) + account + tx_rollup + Tx_rollup_level.root + deposit + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_produced_rejected_state) + >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* Finally, we apply the deposit manually to have the good resulting store + for next operations *) + Apply.apply_message store l2_parameters deposit >>= fun (store, _) -> + commit_store store >>= fun store -> + return (b, account, account2, tx_rollup, store, ticket_hash) + + let operation_content destination ticket_hash qty = + let open Tx_rollup_l2_batch.V1 in + Transfer + { + destination = Indexable.from_value destination; + ticket_hash = Indexable.from_value ticket_hash; + qty = Tx_rollup_l2_qty.of_int64_exn qty; + } + + let operation signer ?(counter = 1L) contents = + let open Tx_rollup_l2_batch.V1 in + {signer = Indexable.from_value signer; counter; contents} + + let make_transfers src counter transfers = + let rec contents acc = function + | [] -> acc + | (destination, ticket_hash, qty) :: rst -> + let acc = operation_content destination ticket_hash qty :: acc in + contents acc rst + in + let contents = contents [] transfers in + operation src ?counter contents + + let bls_pk pk = Tx_rollup_l2_batch.Bls_pk pk + + let make_and_sign_transaction ~signers transaction = + let signatures = + Tx_rollup_l2_helpers.sign_transaction signers transaction + in + let signature = + assert_some @@ Tezos_crypto.Bls.aggregate_signature_opt signatures + in + let batch = + Tx_rollup_l2_batch.V1. + {contents = [transaction]; aggregated_signature = signature} + in + let batch_bytes = + Data_encoding.Binary.to_string_exn Tx_rollup_l2_batch.encoding (V1 batch) + in + let msg = Tx_rollup_message.make_batch batch_bytes |> fst in + (msg, batch_bytes) + + let make_message_transfer ~signers all_transfers = + let transaction = + List.map + (fun (src, counter, transfers) -> make_transfers src counter transfers) + all_transfers + in + make_and_sign_transaction ~signers transaction + + (** Test that undecodable proofs are rejected by the protocol. *) + let test_undecodable_proof () = + let sk, pk, addr = gen_l2_account () in + init_with_deposit addr + >>=? fun (b, account, _, tx_rollup, store, ticket_hash) -> + hash_tree_from_store store >>= fun l2_context_hash -> + (* Create a transfer from [pk] to a new address *) + let _, _, addr2 = gen_l2_account () in + let message, batch_bytes = + make_message_transfer + ~signers:[sk] + [(bls_pk pk, None, [(addr2, ticket_hash, 1L)])] + in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + Op.tx_rollup_submit_batch (B b) account tx_rollup batch_bytes + >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Make a commitment for the submitted transfer *) + let level = Tx_rollup_level.(succ root) in + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Now we produce an invalid serialized proof that cannot be + decoded by the protocol. *) + let proof = + Tx_rollup_l2_proof.Internal_for_tests.of_bytes @@ Bytes.make 1_000 'c' + in + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_raw_reject + (B b) + account + tx_rollup + level + message + ~gas_limit:Max + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_undecodable) + i + operation + >>=? fun (_i : Incremental.t) -> return_unit + + (** Test that we can produce a simple but valid proof. *) + let test_valid_proof_on_invalid_commitment () = + let sk, pk, addr = gen_l2_account () in + init_with_deposit addr + >>=? fun (b, account, _, tx_rollup, store, ticket_hash) -> + hash_tree_from_store store >>= fun l2_context_hash -> + (* Create a transfer from [pk] to a new address *) + let _, _, addr2 = gen_l2_account () in + let message, batch_bytes = + make_message_transfer + ~signers:[sk] + [(bls_pk pk, None, [(addr2, ticket_hash, 1L)])] + in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + Op.tx_rollup_submit_batch (B b) account tx_rollup batch_bytes + >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Make an invalid commitment for the submitted transfer *) + let level = Tx_rollup_level.(succ root) in + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Now we produce a valid proof rejecting the commitment *) + l2_parameters (B b) >>=? fun l2_parameters -> + make_proof store l2_parameters message >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + level + message + ~gas_limit:Max + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + add_operation b operation >>=? fun (_ : Block.t) -> return_unit + + (** It is really similar to {!test_valid_proof_on_invalid_commitment} but it + tries to reject a valid commitment, thus, fails. *) + let test_valid_proof_on_valid_commitment () = + let sk, pk, addr = gen_l2_account () in + init_with_deposit addr + >>=? fun (b, account, _, tx_rollup, store, ticket_hash) -> + (* init_with_deposit creates a commitment -- we'll just check the bond + here so that this test is easier to read. *) + check_bond_from_block b tx_rollup account 1 >>=? fun () -> + hash_tree_from_store store >>= fun l2_context_hash -> + (* Create a transfer from [pk] to a new address *) + let _, _, addr2 = gen_l2_account () in + let message, batch_bytes = + make_message_transfer + ~signers:[sk] + [(bls_pk pk, None, [(addr2, ticket_hash, 1L)])] + in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + Op.tx_rollup_submit_batch (B b) account tx_rollup batch_bytes + >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Make an invalid commitment for the submitted transfer *) + let level = Tx_rollup_level.(succ root) in + make_valid_commitment_for_messages (B b) ~level ~tx_rollup ~store [message] + >>=? fun commitment -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Now we produce a valid proof rejecting the commitment *) + l2_parameters (B b) >>=? fun l2_parameters -> + make_proof store l2_parameters message >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Proof_produced_rejected_state -> true + | _ -> false) + >>=? fun i -> + check_bond (Incremental.alpha_ctxt i) tx_rollup account 2 >>=? fun () -> + return_unit + + (** Test that rejection rewards and slashing work: + 1. Create two messages and two commitments + 2. Reject the second commitment + 3. Ensure that slashing and rewards happen + 4. Reject the first commitment + 5. Ensure that there is no further slashing or reward + *) + let test_rejection_rewards () = + let open Error_monad_operators in + let _, _, addr = gen_l2_account () in + init_l2_store () >>= fun store -> + context_init2 () >>=? fun (b, (contract1, contract2)) -> + originate b contract1 >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup contract1 addr + >>=? fun (b, (deposit_message, _), _ticket_hash) -> + Context.Contract.balance (B b) contract1 >>=? fun balance -> + Context.Contract.balance (B b) contract2 >>=? fun balance2 -> + (* [check_frozen] checks that contract1 has [expect] frozen tez. *) + let check_frozen ~loc b expect = + Incremental.begin_construction b >>=? fun i -> + Contract.get_frozen_bonds (Incremental.alpha_ctxt i) contract1 + >>=?? fun frozen -> Assert.equal_tez ~loc expect frozen + in + (* Nothing frozen to start *) + check_frozen ~loc:__LOC__ b Tez.zero >>=? fun () -> + (* No-op batch for second inbox *) + Op.tx_rollup_submit_batch (B b) contract1 tx_rollup "fake" + >>=? fun operation -> + add_operation b operation >>=? fun b -> + l2_parameters (B b) >>=? fun l2_parameters -> + let message, _ = Tx_rollup_message.make_batch "fake" in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + hash_tree_from_store store >>= fun l2_context_hash -> + let make_invalid_commitment b level h = + (* Make some invalid commitments for the submitted messages *) + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + (* Make this commitment bogus *) + let message_result = + Tx_rollup_message_result. + { + context_hash = h; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + let message_result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated message_result + in + let commitment = {commitment with messages = [message_result_hash]} in + Op.tx_rollup_commit (B b) contract1 tx_rollup commitment + >>=? fun operation -> + add_operation b operation >|=? fun b -> (b, commitment) + in + let level0 = tx_level 0l in + let level1 = tx_level 1l in + make_invalid_commitment b level0 l2_context_hash + >>=? fun (b, commitment0) -> + make_invalid_commitment b level1 Tezos_crypto.Context_hash.zero + >>=? fun (b, commitment1) -> + Context.get_constants (B b) >>=? fun constants -> + let bond_cost = constants.parametric.tx_rollup.commitment_bond in + Assert.balance_was_debited ~loc:__LOC__ (B b) contract1 balance bond_cost + >>=? fun () -> + check_frozen ~loc:__LOC__ b bond_cost >>=? fun () -> + (* Now we produce a valid proof rejecting the second commitment *) + make_proof store l2_parameters message >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment1 ~message_position + in + Op.tx_rollup_reject + (B b) + contract2 + tx_rollup + level1 + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + add_operation b operation >>=? fun b -> + check_bond_from_block b tx_rollup contract1 0 >>=? fun () -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract1 balance bond_cost + >>=? fun () -> + (* Now we need to check that the tez is really gone -- not just frozen *) + check_frozen ~loc:__LOC__ b Tez.zero >>=? fun () -> + let reward = assert_ok Tez.(bond_cost /? 2L) in + Assert.balance_was_credited ~loc:__LOC__ (B b) contract2 balance2 reward + >>=? fun () -> + (* Now, we can still reject the root commitment, but we won't get a reward *) + Context.Contract.balance (B b) contract1 >>=? fun balance -> + Context.Contract.balance (B b) contract2 >>=? fun balance2 -> + make_proof store l2_parameters deposit_message >>= fun proof -> + let message_hash = + Tx_rollup_message_hash.hash_uncarbonated deposit_message + in + let message_position = 0 in + let message_path = single_message_path message_hash in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment0 ~message_position + in + Op.tx_rollup_reject + (B b) + contract2 + tx_rollup + level0 + deposit_message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + add_operation b operation >>=? fun b -> + check_bond_from_block b tx_rollup contract1 0 >>=? fun () -> + Assert.balance_was_debited ~loc:__LOC__ (B b) contract1 balance Tez.zero + >>=? fun () -> + (* Now we need to check that the tez still really gone -- not just frozen *) + check_frozen ~loc:__LOC__ b Tez.zero >>=? fun () -> + Assert.balance_was_credited ~loc:__LOC__ (B b) contract2 balance2 Tez.zero + + (** Test the proof production (used in this test file) and the proof + verification handles a hard failure. [make_bad_message] makes a + message whose l2 apply will fail in whatever specific way we + wish to test. *) + let do_test_proof_with_hard_fail_message make_bad_message = + let sk, pk, addr = gen_l2_account () in + init_with_deposit addr + >>=? fun (b, account, _, tx_rollup, store, ticket_hash) -> + hash_tree_from_store store >>= fun l2_context_hash -> + let message, batch_bytes = make_bad_message sk pk addr ticket_hash in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + Op.tx_rollup_submit_batch (B b) account tx_rollup batch_bytes + >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Make an invalid commitment for the submitted transfer *) + let level = Tx_rollup_level.(succ root) in + make_incomplete_commitment_for_batch (B b) level tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* Now we produce a valid proof rejecting the commitment *) + l2_parameters (B b) >>=? fun l2_parameters -> + make_proof store l2_parameters message >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:(message_result l2_context_hash []) + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op >>=? fun i -> + check_bond (Incremental.alpha_ctxt i) tx_rollup account 0 >>=? fun () -> + return_unit + + (** Test that proof production and verification can handle an invalid + signature *) + let test_proof_with_invalid_signature () = + do_test_proof_with_hard_fail_message (fun _sk pk addr ticket_hash -> + (* We build a dummy transfer, we don't care about the content, it will hard + fail on the check signature. *) + let random_sk, _, _ = gen_l2_account () in + make_message_transfer + ~signers:[random_sk] + [(Bls_pk pk, None, [(addr, ticket_hash, 1L)])]) + + (** Test that proof production and verification can handle an unparseable + message *) + let test_proof_with_unparsable_batch () = + do_test_proof_with_hard_fail_message (fun _sk _pk _addr _ticket_hash -> + let message = "wrong" in + let batch, _ = Tx_rollup_message.make_batch message in + (batch, message)) + + (** Test that proof production and verification can handle an invalid + counter *) + let test_proof_with_invalid_counter () = + do_test_proof_with_hard_fail_message (fun sk pk _addr ticket_hash -> + let _, _, addr = gen_l2_account () in + make_message_transfer + ~signers:[sk] + [(Bls_pk pk, Some 42L, [(addr, ticket_hash, 1L)])]) + + (** Test that proof production and verification can handle an invalid + transfer of zero tickets *) + let test_proof_with_zero_transfer () = + do_test_proof_with_hard_fail_message (fun sk pk addr ticket_hash -> + make_message_transfer + ~signers:[sk] + [(Bls_pk pk, None, [(addr, ticket_hash, 0L)])]) + + (** Test that proof production and verification can handle an invalid + transfer with multiple operations from the same signer *) + let test_proof_with_multiple_operations () = + do_test_proof_with_hard_fail_message (fun sk pk addr ticket_hash -> + make_message_transfer + ~signers:[sk; sk] + [ + (Bls_pk pk, None, [(addr, ticket_hash, 1L)]); + (Bls_pk pk, None, [(addr, ticket_hash, 2L)]); + ]) + + (** Test that an empty proof is not able to reject a valid commitment. *) + let test_empty_proof_on_invalid_message () = + init_with_valid_commitment () + >>=? fun (b, contract, tx_rollup, level, message, commitment) -> + let msg, _ = Tx_rollup_message.make_batch message in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated msg in + let message_path = single_message_path message_hash in + l2_parameters (B b) >>=? fun l2_parameters -> + valid_empty_proof l2_parameters >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + contract + tx_rollup + level + msg + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + add_operation b operation >>=? fun (_ : Block.t) -> return_unit + + (** Test that an empty proof is not able to reject a valid commitment. *) + let test_invalid_proof_on_invalid_commitment () = + init_with_valid_commitment () + >>=? fun (b, contract, tx_rollup, level, message, commitment) -> + let msg, _ = Tx_rollup_message.make_batch message in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated msg in + let message_path = single_message_path message_hash in + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + contract + tx_rollup + level + msg + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof:invalid_proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_failed_to_reject) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test that rejection successfully fails when there is a disagreement about + the previous state. *) + let test_invalid_agreed () = + init_with_valid_commitment () + >>=? fun (b, contract, tx_rollup, level, message, commitment) -> + let msg, _ = Tx_rollup_message.make_batch message in + (* This intentionally does not match *) + let previous_message_result : Tx_rollup_message_result.t = + { + (* Expected is Tx_rollup_commitment.empty_l2_context_hash *) + context_hash = Tezos_crypto.Context_hash.zero; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated msg in + let message_path = single_message_path message_hash in + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + contract + tx_rollup + level + msg + ~message_position + ~message_path + ~proof:invalid_proof (* doesn't matter -- we'll never check it*) + ~message_result_hash + ~message_result_path + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error + (Tx_rollup_errors.Wrong_rejection_hash + { + provided = + Tx_rollup_message_result_hash.hash_uncarbonated + previous_message_result; + expected = + `Hash + (Tx_rollup_message_result_hash.of_b58check_exn + "txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC"); + })) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test that rejection successfully fails when there's no commitment to + reject *) + let test_no_commitment () = + context_init1 () >>=? fun (b, contract) -> + originate b contract >>=? fun (b, tx_rollup) -> + let message = "bogus" in + Op.tx_rollup_submit_batch (B b) contract tx_rollup message + >>=? fun operation -> + add_operation b operation >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + let level = Tx_rollup_level.root in + let message, _size = Tx_rollup_message.make_batch message in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + l2_parameters (I i) >>=? fun l2_parameters -> + valid_empty_proof l2_parameters >>= fun proof -> + Op.tx_rollup_reject + (I i) + contract + tx_rollup + level + message + ~message_position:0 + ~message_path + ~message_result_hash:Tx_rollup_message_result_hash.zero + ~message_result_path:Tx_rollup_commitment.Merkle.dummy_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error + (Tx_rollup_errors.Cannot_reject_level + {provided = level; accepted_range = None})) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test that rejection successfully fails when the rejected commitment is + already final *) + let test_commitment_is_final () = + init_with_valid_commitment () + >>=? fun (b, contract, tx_rollup, level, message, commitment) -> + (* Create a new commitment so that once we have finalized the first one, + we still have a range of valid final commitments *) + Op.tx_rollup_submit_batch (B b) contract tx_rollup message + >>=? fun operation -> + add_operation b operation >>=? fun b -> + let level2 = Tx_rollup_level.succ level in + make_incomplete_commitment_for_batch (B b) level2 tx_rollup [] + >>=? fun (commitment2, _) -> + Op.tx_rollup_commit (B b) contract tx_rollup commitment2 + >>=? fun operation -> + add_operation b operation >>=? fun b -> + Op.tx_rollup_finalize (B b) contract tx_rollup >>=? fun operation -> + add_operation b operation >>=? fun b -> + let message, _size = Tx_rollup_message.make_batch message in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + l2_parameters (B b) >>=? fun l2_parameters -> + valid_empty_proof l2_parameters >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + contract + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error + (Tx_rollup_errors.Cannot_reject_level + {provided = level; accepted_range = Some (level2, level2)})) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test that rejection successfully fails when the message hash does not + match the one stored in the inbox *) + let test_wrong_message_hash () = + init_with_valid_commitment () + >>=? fun (b, contract1, tx_rollup, level, prev_message, commitment) -> + let prev_message, _size = Tx_rollup_message.make_batch prev_message in + let prev_message_hash = + Tx_rollup_message_hash.hash_uncarbonated prev_message + in + let expected_root = + Tx_rollup_inbox.Merkle.merklize_list [prev_message_hash] + in + let message, _size = Tx_rollup_message.make_batch "wrong message" in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + l2_parameters (B b) >>=? fun l2_parameters -> + valid_empty_proof l2_parameters >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + contract1 + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error + (Tx_rollup_errors.Wrong_message_path {expected = expected_root})) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test that rejection successfully fails when the message position does + exist in the inbox. *) + let test_wrong_message_position () = + init_with_valid_commitment () + >>=? fun (b, contract1, tx_rollup, level, message, _commitment) -> + let message, _size = Tx_rollup_message.make_batch message in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + l2_parameters (B b) >>=? fun l2_parameters -> + valid_empty_proof l2_parameters >>= fun proof -> + Op.tx_rollup_reject + (B b) + contract1 + tx_rollup + level + message + ~message_position:1 + ~message_path + ~message_result_hash:Tx_rollup_message_result_hash.zero + ~message_result_path:Tx_rollup_commitment.Merkle.dummy_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error + (Tx_rollup_errors.Wrong_message_position + {level; position = 1; length = 1})) + >>=? fun (_ : Incremental.t) -> return_unit + + (** Test rejecting a commitment to a non-trivial message -- that is, + not a no-op. *) + let test_nontrivial_rejection () = + let _, _, addr = gen_l2_account () in + init_l2_store () >>= fun store -> + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup account addr >>=? fun (b, (deposit, _), _) -> + let message_hash = Tx_rollup_message_hash.hash_uncarbonated deposit in + let message_path = single_message_path message_hash in + make_incomplete_commitment_for_batch (B b) Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + Tx_rollup_level.root + deposit + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof:invalid_proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_failed_to_reject) + >>=? fun (_i : Incremental.t) -> + (* Check with a reasonable proof *) + l2_parameters (B b) >>=? fun l2_parameters -> + make_proof store l2_parameters deposit >>= fun proof -> + Op.tx_rollup_reject + (B b) + account + tx_rollup + Tx_rollup_level.root + deposit + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + add_operation b operation >>=? fun (_ : Block.t) -> return_unit + + let add_store_to_ctxt ctxt store = + let open L2_Context.Syntax in + let time = Time.Protocol.of_seconds 0L in + let* ctxt = C.add_tree ctxt [] store in + let* h = C.commit ~time ctxt in + let index = C.index ctxt in + let* ctxt = C.checkout_exn index h in + return ctxt + + let test_large_rejection size = + let _, _, addr = gen_l2_account () in + init_l2_store () >>= fun store -> + context_init1 ~tx_rollup_rejection_max_proof_size:size () + >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup account addr >>=? fun (b, (deposit, _), _) -> + let deposit_hash = Tx_rollup_message_hash.hash_uncarbonated deposit in + let message_path = single_message_path deposit_hash in + Incremental.begin_construction b >>=? fun i -> + make_valid_commitment_for_messages + (I i) + ~level:Tx_rollup_level.root + ~tx_rollup + ~store + [deposit] + >>=? fun commitment -> + Op.tx_rollup_commit (I i) account tx_rollup commitment >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* The previous commitment produced a valid after hash. However, the + proof required is above [size], so the rejection should succeed. *) + l2_parameters (I i) >>=? fun l2_parameters -> + make_proof store l2_parameters deposit >>= fun proof -> + Incremental.begin_construction b >>=? fun i -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (I i) + account + tx_rollup + Tx_rollup_level.root + deposit + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> return (i, op) + + (** Test that a commitment which require a too-large proof can be rejected + even if the after hash is correct. *) + let test_too_large_rejection () = + (* With a limit, the commitment is rejected because the required proof + is above the limit. *) + test_large_rejection 100 >>=? fun (i, op) -> + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> + (* With a high limit, the commitment can not be rejected as it is valid *) + test_large_rejection 10_000 >>=? fun (i, op) -> + Incremental.add_operation + i + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_produced_rejected_state) + op + >>=? fun (_ : Incremental.t) -> return_unit + + (** Drop the last element of a seq, that is, the last element of a proof *) + let rec drop_last x = + let open Seq in + match x with + | Cons (x, xs) -> ( + let node = xs () in + match node with Nil -> Nil | n -> Cons (x, fun () -> drop_last n)) + | Nil -> assert false + + let rec drop_n x n = if n <= 0 then x else drop_n (drop_last x) (n - 1) + + let test_valid_proof_truncated () = + let _, _, addr = gen_l2_account () in + init_l2_store () >>= fun store -> + context_init1 ~tx_rollup_rejection_max_proof_size:100 () + >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + make_deposit b tx_rollup account addr >>=? fun (b, (deposit, _), _) -> + let deposit_hash = Tx_rollup_message_hash.hash_uncarbonated deposit in + let message_path = single_message_path deposit_hash in + Incremental.begin_construction b >>=? fun i -> + let level = Tx_rollup_level.root in + make_valid_commitment_for_messages (I i) ~level ~store ~tx_rollup [deposit] + >>=? fun commitment -> + Op.tx_rollup_commit (I i) account tx_rollup commitment >>=? fun op -> + Incremental.add_operation i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* The previous commitment produced a valid after hash. However, the + proof required is above [size], so the rejection should succeed with + a truncated proof. *) + l2_parameters (I i) >>=? fun l2_parameters -> + make_proof store l2_parameters deposit >>= fun proof -> + let proof_truncated = + let proof_node = proof.state () in + let truncated_node = drop_last proof_node in + {proof with state = (fun () -> truncated_node)} + in + (* We try to reject with the truncated proof which is already above the + size limit. *) + Incremental.begin_construction b >>=? fun i -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (I i) + account + tx_rollup + Tx_rollup_level.root + deposit + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof:proof_truncated + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> return_unit + + (** Create a context where the batcher submitted and committed for a layer2 + batch that produces [n_withdraw] withdrawals. + The commitment is created without respecting the constant in the protocol. + Therefore, a valid rejection just has to respect this limit and + send its correct state (which may have returned + [Maximum_withdraws_per_message_exceeded]) + + In other terms, the rejection created in this function must fail + if [n_withdraw <= tx_rollup_max_withdrawals_per_batch] but also must + succeed to reject if [n_withdraw > tx_rollup_max_withdrawals_per_batch]. *) + let test_reject_withdrawals_helper ?expect_apply_failure n_withdraw = + let sk, pk, addr = gen_l2_account () in + init_with_deposit ~tx_rollup_hard_size_limit_per_message:20_000 addr + >>=? fun (b, account, _, tx_rollup, store, ticket_hash) -> + hash_tree_from_store store >>= fun l2_context_hash -> + (* 1. Create a batch with [n_withdraw] withdrawals. *) + let destination = Context.Contract.pkh account in + let qty = Tx_rollup_l2_qty.one in + let operation = + let open Tx_rollup_l2_batch.V1 in + let withdraws = + Stdlib.List.init n_withdraw (fun _ -> + Withdraw {destination; ticket_hash; qty}) + in + { + signer = Indexable.from_value (bls_pk pk); + counter = 1L; + contents = withdraws; + } + in + let message, batch_bytes = + make_and_sign_transaction ~signers:[sk] [operation] + in + + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = single_message_path message_hash in + (* 2. Submit and commit the batch. *) + Op.tx_rollup_submit_batch (B b) account tx_rollup batch_bytes + >>=? fun operation -> + add_operation b operation >>=? fun b -> + let level = Tx_rollup_level.(succ root) in + let withdrawals = + Stdlib.List.init n_withdraw (fun _ -> + Tx_rollup_withdraw.{claimer = destination; ticket_hash; amount = qty}) + in + make_incomplete_commitment_for_batch + (B b) + level + tx_rollup + [(0, withdrawals)] + >>=? fun (commitment, _) -> + (* In the case where [n_withdraw] is above the limit, we want to create + a commitment that did not respect the limit. Therefore, we use a + a special [apply_message] with tweaked parameters. *) + Apply.apply_message + store + Tx_rollup_l2_apply.{tx_rollup_max_withdrawals_per_batch = n_withdraw + 42} + message + >>= fun (store', _) -> + hash_tree_from_store store' >>= fun to_commit_hash -> + let result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated + { + context_hash = to_commit_hash; + withdraw_list_hash = + Tx_rollup_withdraw_list_hash.hash_uncarbonated withdrawals; + } + in + let commitment = {commitment with messages = [result_hash]} in + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + add_operation b operation >>=? fun b -> + (* 4. Now we create a proof that used the correct layer2 apply with + the correct parameters. *) + l2_parameters (B b) >>=? fun l2_parameters -> + make_proof store l2_parameters message >>= fun proof -> + let previous_message_result : Tx_rollup_message_result.t = + { + context_hash = l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i op ?expect_apply_failure + >>=? fun (_ : Incremental.t) -> return_unit + + let test_reject_withdrawals_limit () = + context_init1 () >>=? fun (b, _) -> + l2_parameters (B b) >>=? fun l2_parameters -> + let limit = + l2_parameters.Tx_rollup_l2_apply.tx_rollup_max_withdrawals_per_batch + in + let expect_apply_failure = + check_proto_error Tx_rollup_errors.Proof_produced_rejected_state + in + (* It must not be rejected: (limit - 1) is below the limit *) + test_reject_withdrawals_helper ~expect_apply_failure (limit - 1) + >>=? fun () -> + (* It must not be rejected: limit is the limit :p. *) + test_reject_withdrawals_helper ~expect_apply_failure limit >>=? fun () -> + (* It must be rejected: (limit + 1) is above the limit *) + test_reject_withdrawals_helper (limit + 1) + + (** Fill a storage with [l2_accounts], they are all credited [100] of + [Ticket_hash.zero]. *) + let fill_store store l2_accounts = + let open L2_Context.Syntax in + let* store, _, tidx = + L2_Context.Ticket_index.get_or_associate_index store Ticket_hash.zero + in + let* store = + list_fold_left_m + (fun store (_, pk, addr) -> + let* store, _, aidx = + L2_Context.Address_index.get_or_associate_index store addr + in + let* store = + L2_Context.Address_metadata.init_with_public_key store aidx pk + in + let* store = + L2_Context.Ticket_ledger.credit + store + tidx + aidx + (Tx_rollup_l2_qty.of_int64_exn 100L) + in + return store) + store + l2_accounts + in + let time = time () in + let* (_ : Tezos_crypto.Context_hash.t) = C.commit ~time store in + return store + + (** Regression test to ensure that we can reject a commitment where the + proof is truncated to be close to the maximum size limit (i.e. 32Kb) and + the rejected message size is close to the maximum size (i.e. 5Kb). + + It also test that all required parameters for the rejection fits in a + Tezos operation even in the worst cases. + *) + let test_rejection_size_limit () = + let rng_state = Random.State.make [|42|] in + context_init1 () >>=? fun (b, account) -> + originate b account >>=? fun (b, tx_rollup) -> + Context.get_constants (B b) >>=? fun constant -> + (* We begin by creating a context for the first message, the context is + obviously invalid but we will use it as the supposedly valid base for + the second message which we will reject. *) + init_l2_store () >>= fun store -> + (* 200 accounts with this fixed random state is enough to create a proof + larger than the current max proof size (i.e. 30Kb). The more accounts + we add in the context, bigger the proofs becomes. It needs to be adjusted + so the following [message2] in this context produces a proof that + is larger to 30Kb. *) + List.init ~when_negative_length:[] 200 (fun _ -> + gen_l2_account ~rng_state ()) + >>?= fun l2_accounts -> + (* The context is filled with the generated l2 accounts. *) + fill_store store l2_accounts >>= fun store -> + hash_tree_from_store store >>= fun l2_context_hash -> + let message0_result : Tx_rollup_message_result.t = + { + context_hash = l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + let message0_result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated message0_result + in + (* Then, we build a real message which is close to the maximum message size + limit and produces a proof also close to the maximum proof size limit. *) + let _sk, _pk, addr = gen_l2_account ~rng_state () in + let signers, transfers = + List.map + (fun (sk, pk, _) -> + (sk, (bls_pk pk, None, [(addr, Ticket_hash.zero, 1L)]))) + (* 45 with this fixed random state is enough to create message + close to the maximum message size (i.e. 5Kb), but small enough so + it is not rejected by the protocol. The more we put transfers in + the operation, bigger the message becomes. *) + (List.take_n 45 l2_accounts) + |> List.split + in + l2_parameters (B b) >>=? fun l2_parameters -> + let message1, batch_bytes = make_message_transfer ~signers transfers in + let message1_hash = Tx_rollup_message_hash.hash_uncarbonated message1 in + Incremental.begin_construction b >>=? fun i -> + (* Submit the two first hand-crafted messages. *) + let message0, _ = Tx_rollup_message.make_batch "xoxo" in + let message0_hash = Tx_rollup_message_hash.hash_uncarbonated message0 in + Op.tx_rollup_submit_batch + ~gas_limit:(Custom_gas (Gas.Arith.integral_of_int_exn 2_500)) + (I i) + account + tx_rollup + "xoxo" + >>=? fun op1 -> + Op.tx_rollup_submit_batch (I i) account tx_rollup batch_bytes + >>=? fun op2 -> + let message_count = + constant.parametric.tx_rollup.max_messages_per_inbox - 2 + in + (* Fill the inbox at tx_level 0. Trying to reject a commitment for a full + inbox has the benefit of having large message paths. Thus, making the + rejection operation size even larger. *) + let ops = List.repeat message_count op1 in + Op.combine_operations ~source:account (I i) ([op1; op2] @ ops) + >>=? fun op -> + Incremental.add_operation ~check_size:false i op >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* Prepare a commitment for the tx_level 0, only the very first message + result hash will be a real value (in order to start the proof verification + from a valid state). *) + let message2_result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated previous_message_result + in + let messages = [message0; message1] @ List.repeat message_count message0 in + let message_hashes = + [message0_hash; message1_hash] @ List.repeat message_count message0_hash + in + let message_result_hashes = + [message0_result_hash; message2_result_hash] + @ List.repeat message_count message0_result_hash + in + let commitment : Tx_rollup_commitment.Full.t = + { + level = Tx_rollup_level.root; + messages = message_result_hashes; + predecessor = None; + inbox_merkle_root = Tx_rollup_inbox.Merkle.merklize_list message_hashes; + } + in + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Prepare the rejection for the second message. *) + make_proof store l2_parameters message1 >>= fun proof -> + let message_hashes = + List.map Tx_rollup_message_hash.hash_uncarbonated messages + in + let message_path = + assert_ok @@ Tx_rollup_inbox.Merkle.compute_path message_hashes 1 + in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position:1 + in + let _, previous_message_result_path = + message_result_hash_and_path commitment ~message_position:0 + in + (* The actual proof size is almost 32Kb, after the drop the truncated + proof size is 26Kb. *) + let proof_truncated = + let proof_node = proof.state () in + (* 100 is the magic number of nodes to drop in the proof. The more nodes + we drop, smaller the proof becomes. The goal here is to drop enough + nodes to have a proof close to 26Kb. *) + let truncated_node = drop_n proof_node 100 in + {proof with state = (fun () -> truncated_node)} + in + Op.tx_rollup_reject + ~gas_limit:(Custom_gas (Gas.Arith.integral_of_int_exn 100_000)) + (B b) + account + tx_rollup + Tx_rollup_level.root + message1 + ~message_position:1 + ~message_path + ~message_result_hash + ~message_result_path + ~proof:proof_truncated + ~previous_message_result:message0_result + ~previous_message_result_path + >>=? fun op -> + Incremental.begin_construction b >>=? fun i -> + (* Finally, we reject the commitment and check that the size fits in + a Tezos operation. *) + Incremental.add_operation i op >>=? fun (_i : Incremental.t) -> return_unit + + let tests = + [ + Tztest.tztest + "regression test empty_l2_context_hash" + `Quick + test_empty_l2_context_hash; + Tztest.tztest "unencodable proofs fail" `Quick test_undecodable_proof; + Tztest.tztest + "reject invalid commitment" + `Quick + test_valid_proof_on_invalid_commitment; + Tztest.tztest + "reject valid commitment fails" + `Quick + test_valid_proof_on_valid_commitment; + Tztest.tztest "rejection rewards" `Quick test_rejection_rewards; + Tztest.tztest + "proof for a hard failing message: invalid signature" + `Quick + test_proof_with_invalid_signature; + Tztest.tztest + "proof for a hard failing message: unparseable message" + `Quick + test_proof_with_unparsable_batch; + Tztest.tztest + "proof for a hard failing message: invalid counter" + `Quick + test_proof_with_invalid_counter; + Tztest.tztest + "proof for a hard failing message: zero-ticket transfer" + `Quick + test_proof_with_zero_transfer; + Tztest.tztest + "proof for a hard failing message: multiple ops from one signer" + `Quick + test_proof_with_multiple_operations; + Tztest.tztest + "reject with invalid proof" + `Quick + test_invalid_proof_on_invalid_commitment; + Tztest.tztest "reject with invalid agreed" `Quick test_invalid_agreed; + Tztest.tztest "reject with no commitment" `Quick test_no_commitment; + Tztest.tztest "reject with wrong message" `Quick test_wrong_message_hash; + Tztest.tztest + "reject with wrong message position" + `Quick + test_wrong_message_position; + Tztest.tztest "reject too-large proof" `Quick test_too_large_rejection; + Tztest.tztest "reject a final commitment" `Quick test_commitment_is_final; + Tztest.tztest + "test successful and unsuccessful rejection of nontrivial message" + `Quick + test_nontrivial_rejection; + Tztest.tztest + "reject with a truncated proof above the limit" + `Quick + test_valid_proof_truncated; + Tztest.tztest + "reject withdrawals when out of bound" + `Quick + test_reject_withdrawals_limit; + Tztest.tztest + "regression test rejection max proof size and message" + `Quick + test_rejection_size_limit; + ] +end + +module Single_message_inbox = struct + let contents = "bogus" + + let message, _ = Tx_rollup_message.make_batch contents + + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message + + let message_path = single_message_path message_hash + + let inbox_hash = Tx_rollup_inbox.Merkle.merklize_list [message_hash] + + let submit b tx_rollup account = + Op.tx_rollup_submit_batch (B b) account tx_rollup contents + >>=? fun operation -> Block.bake b ~operation + + let reject ?expect_apply_failure b tx_rollup account level commitment = + Format.printf + "Rejecting level %a (%s)\n" + Tx_rollup_level.pp + level + (if Option.is_some expect_apply_failure then "x" else "√") ; + l2_parameters (B b) >>=? fun l2_parameters -> + Rejection.valid_empty_proof l2_parameters >>= fun proof -> + let message_position = 0 in + let message_result_hash, message_result_path = + message_result_hash_and_path commitment ~message_position + in + Op.tx_rollup_reject + (B b) + account + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result:Rejection.previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation i operation ?expect_apply_failure >>=? fun i -> + Incremental.finalize_block i + + let make_commit predecessor_commit messages = + let level = + Option.fold + ~none:Tx_rollup_level.root + ~some:(fun (x : 'a Tx_rollup_commitment.template) -> + Tx_rollup_level.succ x.level) + predecessor_commit + in + let predecessor = + Option.map + (fun x -> Tx_rollup_commitment.(Compact.hash @@ Full.compact x)) + predecessor_commit + in + Tx_rollup_commitment. + {level; messages; predecessor; inbox_merkle_root = inbox_hash} + + let wrong_commit ?predecessor_commit () = + make_commit predecessor_commit [Tx_rollup_message_result_hash.zero] + + let correct_commit ?predecessor_commit () = + make_commit + predecessor_commit + [ + Tx_rollup_message_result_hash.hash_uncarbonated + Rejection.previous_message_result; + ] + + let commit ?expect_apply_failure b tx_rollup account commit = + Format.printf + "Commiting for level %a (%s)\n" + Tx_rollup_level.pp + commit.Tx_rollup_commitment.level + (if Option.is_some expect_apply_failure then "x" else "√") ; + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_commit (B b) account tx_rollup commit >>=? fun operation -> + Incremental.add_operation i operation ?expect_apply_failure >>=? fun i -> + Incremental.finalize_block i +end + +(** [test_state] tests some edge cases in state management around + rejecting commitments. *) +let test_state () = + let open Single_message_inbox in + context_init2 () >>=? fun (b, (account1, account2)) -> + originate b account1 >>=? fun (b, tx_rollup) -> + (* Submit bogus message three time to have three inboxes *) + submit b tx_rollup account1 >>=? fun b -> + submit b tx_rollup account1 >>=? fun b -> + submit b tx_rollup account1 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: + *) + Context.Tx_rollup.state (B b) tx_rollup >>=? fun initial_state -> + (* Commit to the first inbox with an incorrect commitment *) + let commit1 = wrong_commit () in + commit b tx_rollup account1 commit1 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A1] + *) + let commit2 = wrong_commit ~predecessor_commit:commit1 () in + commit b tx_rollup account2 commit2 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A1] [A2] + *) + (* Reject the commitment *) + reject b tx_rollup account1 Tx_rollup_level.root commit1 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: <A1> <A2> + *) + (* Check that we went back to the initial state *) + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state_after_reject -> + Alcotest.( + check + tx_rollup_state_testable_no_storage + "state unchanged by commit/reject at root" + initial_state + (Tx_rollup_state.Internal_for_tests.reset_commitments_watermark + state_after_reject)) ; + assert ( + Tx_rollup_state.Internal_for_tests.get_commitments_watermark + state_after_reject + = Some Tx_rollup_level.(succ root)) ; + (* Show that you cannot commit with [account1] again *) + commit + b + tx_rollup + account1 + commit1 + ~expect_apply_failure:(check_proto_error Tx_rollup_errors.Invalid_committer) + >>=? fun b -> + (* Commit an incorrect commitment again. *) + commit b tx_rollup account2 commit1 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A2] <A2> + *) + Context.Contract.balance_and_frozen_bonds (B b) account2 + >>=? fun before_slashing -> + let commit2 = wrong_commit ~predecessor_commit:commit1 () in + commit b tx_rollup account1 commit2 >>=? fun b -> + Context.get_constants (B b) >>=? fun constants -> + Assert.balance_was_debited + ~loc:__LOC__ + (B b) + account2 + before_slashing + constants.parametric.tx_rollup.commitment_bond + >>=? fun () -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A2] [A1] + *) + (* Reject the first commitment *) + reject b tx_rollup account2 Tx_rollup_level.root commit1 >>=? fun b -> + (* Check that we went back to the initial state *) + (* + Inboxes: [ ] - [ ] - [ ] + Commits: <A2> <A1> + *) + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state_after_reject -> + Alcotest.( + check + tx_rollup_state_testable_no_storage + "state unchanged by commit/reject at root" + initial_state + (Tx_rollup_state.Internal_for_tests.reset_commitments_watermark + state_after_reject)) ; + (* Commit twice *) + let commit1 = correct_commit () in + let commit2 = wrong_commit ~predecessor_commit:commit1 () in + commit b tx_rollup account1 commit1 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A1] <A1> + *) + commit b tx_rollup account2 commit2 >>=? fun b -> + (* + Inboxes: [ ] - [ ] - [ ] + Commits: [A1] [A2] + *) + (* committing empty blocks then finalizing *) + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Op.tx_rollup_finalize (B b) account1 tx_rollup >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + (* Check we cannot finalize root anymore *) + reject + b + tx_rollup + account2 + Tx_rollup_level.root + commit1 + ~expect_apply_failure: + (check_proto_error_f (function + | Tx_rollup_errors.Cannot_reject_level _ -> true + | _ -> false)) + >>=? fun b -> + (* We can reject level 1 *) + reject b tx_rollup account2 Tx_rollup_level.(succ root) commit2 >>=? fun b -> + (* There is no commitment to finalize anymore *) + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Op.tx_rollup_finalize (B b) account1 tx_rollup >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + Incremental.add_operation + i + operation + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.No_commitment_to_finalize) + >>=? fun i -> + ignore i ; + return_unit + +(** [test_state_with_deleted] tests an edge cases in state management + when rejecting commitment whose predecessor has already been + deleted. *) +let test_state_with_deleted () = + let open Single_message_inbox in + context_init1 () >>=? fun (b, account1) -> + originate b account1 >>=? fun (b, tx_rollup) -> + (* Create three inboxes *) + submit b tx_rollup account1 >>=? fun b -> + submit b tx_rollup account1 >>=? fun b -> + submit b tx_rollup account1 >>=? fun b -> + (* Commit to level 0 *) + let commit0 = + Tx_rollup_commitment. + { + level = Tx_rollup_level.root; + messages = + [ + Tx_rollup_message_result_hash.hash_uncarbonated + Rejection.previous_message_result; + ]; + predecessor = None; + inbox_merkle_root = inbox_hash; + } + in + Op.tx_rollup_commit (B b) account1 tx_rollup commit0 >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + (* Commit to level 1 *) + let commit1 = + Tx_rollup_commitment. + { + level = Tx_rollup_level.succ commit0.level; + messages = [Tx_rollup_message_result_hash.zero]; + predecessor = + Some Tx_rollup_commitment.(Compact.hash @@ Full.compact commit0); + inbox_merkle_root = inbox_hash; + } + in + Op.tx_rollup_commit (B b) account1 tx_rollup commit1 >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + (* Finalize *) + Op.tx_rollup_finalize (B b) account1 tx_rollup >>=? fun operation -> + Block.bake b ~operation >>=? fun b -> + (* fail to remove too early *) + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_remove_commitment (I i) account1 tx_rollup >>=? fun operation -> + Incremental.add_operation + i + operation + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Remove_commitment_too_early) + >>=? fun (_ : Incremental.t) -> + (* Wait for some blocks, then remove *) + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Block.bake b ~operations:[] >>=? fun b -> + Op.tx_rollup_remove_commitment (B b) account1 tx_rollup >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Reject level 1, it works *) + reject b tx_rollup account1 commit1.level commit1 >>=? fun b -> + ignore b ; + return_unit + +(** [test_state_message_storage_preallocation] verifies that message + commitment burn is charged upfront. *) +let test_state_message_storage_preallocation () = + context_init1 () >>=? fun (b, account1) -> + originate b account1 >>=? fun (b, tx_rollup) -> + Incremental.begin_construction b >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + let message, _ = Tx_rollup_message.make_batch "bogus" in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let (_inbox_hash : Tx_rollup_inbox.Merkle.root) = + Tx_rollup_inbox.Merkle.merklize_list [message_hash] + in + let state = Tx_rollup_state.initial_state ~pre_allocated_storage:Z.zero in + let occupied_storage_before = + Tx_rollup_state.Internal_for_tests.get_occupied_storage state + in + Tx_rollup_inbox.append_message ctxt tx_rollup state message + >>=?? fun (ctxt, state, _) -> + let occupied_storage_after = + Tx_rollup_state.Internal_for_tests.get_occupied_storage state + in + (* The size an empty inbox as created in + {!Tx_rollup_inbox_storage.prepare_inbox}. *) + let inbox_preparation = Tx_rollup_inbox.size in + Alcotest.check + ~pos:__POS__ + zestable + "the storage occupied by the first message is the size of the inbox plus \ + the preallocation for commiting the message" + inbox_preparation + (Z.sub occupied_storage_after occupied_storage_before) ; + let occupied_storage_before = + Tx_rollup_state.Internal_for_tests.get_occupied_storage state + in + Tx_rollup_inbox.append_message ctxt tx_rollup state message + >>=?? fun (_ctxt, state, _) -> + let occupied_storage_after = + Tx_rollup_state.Internal_for_tests.get_occupied_storage state + in + Alcotest.check + ~pos:__POS__ + zestable + "the storage occupied by the second message null thanks to the merklisation" + Z.zero + (Z.sub occupied_storage_after occupied_storage_before) ; + return_unit + +module Withdraw = struct + (** [context_init_withdraw tup] initializes a context with [tup] accounts, one rollup and a + withdrawal recipient contract. *) + let context_init_withdraw ?tx_rollup_origination_size + ?(amount = Z.of_int64 @@ Tx_rollup_l2_qty.to_int64 Nat_ticket.amount) tup + = + context_init ?tx_rollup_origination_size tup >>=? fun (block, accounts) -> + let account1 = Context.tup_hd tup accounts in + originate block account1 >>=? fun (block, tx_rollup) -> + Nat_ticket.init_deposit amount block tx_rollup account1 + >>=? fun (operation, block, deposit_contract) -> + Block.bake ~operation block >>=? fun block -> + Contract_helpers.originate_contract_from_string_hash + ~script: + (Format.sprintf + {| parameter (ticket %s); + storage (option (ticket %s)); + code { CAR ; SOME ; NIL operation ; PAIR } ;|} + Nat_ticket.ty_str + Nat_ticket.ty_str) + ~storage:"None" + ~source_contract:account1 + ~baker:(Context.Contract.pkh account1) + block + >>=? fun (withdraw_contract, _script, block) -> + return + (account1, accounts, tx_rollup, deposit_contract, withdraw_contract, block) + + (** [context_init1_withdraw] initializes a context with one account, one rollup and a + withdrawal recipient contract. *) + let context_init1_withdraw () = + context_init_withdraw Context.T1 + >>=? fun ( account1, + _accounts, + tx_rollup, + deposit_contract, + withdraw_contract, + b ) -> + return (account1, tx_rollup, deposit_contract, withdraw_contract, b) + + (** [context_init2_withdraw] initializes a context with two accounts, one rollup and a + withdrawal recipient contract. *) + let context_init2_withdraw () = + context_init_withdraw Context.T2 + >>=? fun ( account1, + (_, account2), + tx_rollup, + deposit_contract, + withdraw_contract, + b ) -> + return + (account1, account2, tx_rollup, deposit_contract, withdraw_contract, b) + + let originate_forge_withdraw_deposit_contract account block = + Contract_helpers.originate_contract_from_string_hash + ~script: + {| parameter (or (pair %default nat nat) + (or (ticket %withdraw nat) + (pair %deposit address tx_rollup_l2_address))); + storage (list (ticket nat)); + code + { + UNPAIR; + IF_LEFT + { + UNPAIR; + TICKET; + ASSERT_SOME; + CONS; + NIL operation; + PAIR + } + { + IF_LEFT + { + CONS; + NIL operation; + PAIR; + } + { + UNPAIR; + CONTRACT %deposit (pair (ticket nat) tx_rollup_l2_address); + ASSERT_SOME; + DUG 2; + SWAP; + IF_CONS + { + SWAP; + DUG 3; + PAIR; + PUSH mutez 0; + SWAP; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR + } + { FAIL } + } + } + } |} + ~storage:"{}" + ~source_contract:account + ~baker:(Context.Contract.pkh account) + block + >>=? fun (forge_withdraw_deposit_contract, _script, block) -> + return (forge_withdraw_deposit_contract, block) + + (** [finalize_all_commitment_with_withdrawals ~account ~tx_rollup ~withdrawals + b] commit and finalize all uncommitted inboxes for a tx_rollup and a + commitment containing [withdrawals] for the last unfinalized commitments + (same format as in [make_incomplete_commitment_for_batch]). + + It returns the commitment and a list of dummy context hashes for + the last inboxes committed. When [batches] is set, first it + submits [batches] in a combined manager operation*) + let finalize_all_commitment_with_withdrawals ?batches ~account ~tx_rollup + ~withdrawals b = + (match batches with + | None -> return b + | Some batches -> + List.fold_right_es + (fun batch operations -> + Op.tx_rollup_submit_batch (B b) account tx_rollup batch + >>=? fun operation -> return (operation :: operations)) + batches + [] + >>=? fun operations -> + Op.combine_operations ~source:account (B b) operations + >>=? fun operation -> Block.bake ~operation b) + >>=? fun b -> + Context.get_level (B b) >>?= fun current_level -> + Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> + Alpha_context.Tx_rollup_state.Internal_for_tests.next_commitment_level + state + (Raw_level.succ current_level) + >>??= fun next_commitment_level -> + let uncommitted_inboxes = + Alpha_context.Tx_rollup_state.Internal_for_tests.uncommitted_inboxes_count + state + in + let uncommitted_inboxes = max 0 (uncommitted_inboxes - 1) in + let rec aux b committed_inbox next_commitment_level = + if committed_inbox >= uncommitted_inboxes then + return (b, next_commitment_level) + else + (* Make a commitment for the dummy batch. Mock the list of withdrawals as + per [withdrawals]. Include the commitment in an operation and bake. *) + make_incomplete_commitment_for_batch + (B b) + next_commitment_level + tx_rollup + [] + >>=? fun (commitment, _context_hash_list) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* 3. Finalize the commitment *) + Op.tx_rollup_finalize (B b) account tx_rollup >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + aux b (committed_inbox + 1) (Tx_rollup_level.succ next_commitment_level) + in + aux b 0 next_commitment_level >>=? fun (b, next_commitment_level) -> + make_incomplete_commitment_for_batch + (B b) + next_commitment_level + tx_rollup + withdrawals + >>=? fun (commitment, context_hash_list) -> + Op.tx_rollup_commit (B b) account tx_rollup commitment >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* 3. Finalize the commitment *) + Op.tx_rollup_finalize (B b) account tx_rollup >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + return (commitment, context_hash_list, next_commitment_level, b) + + (** [test_valid_withdraw] checks that a smart contract can deposit tickets to a + transaction rollup. *) + let test_valid_withdraw () = + context_init2_withdraw () + >>=? fun ( account1, + account2, + tx_rollup, + deposit_contract, + withdraw_contract, + block ) -> + Contract_helpers.originate_contract_from_string_hash + ~script: + (Format.sprintf + {| parameter (ticket %s); + storage unit; + code { CDR; NIL operation ; PAIR } ;|} + Nat_ticket.ty_str) + ~storage:"Unit" + ~source_contract:account1 + ~baker:(Context.Contract.pkh account1) + block + >>=? fun (withdraw_dropping_contract, _script, block) -> + let token_one = Nat_ticket.ex_token ~ticketer:deposit_contract in + (* The Tx_rollup should own some tickets and the four contract none before + calling withdraw.*) + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract deposit_contract) + None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract (Originated withdraw_contract)) + None + >>=? fun () -> + assert_ticket_balance ~loc:__LOC__ block token_one (Contract account1) None + >>=? fun () -> + assert_ticket_balance ~loc:__LOC__ block token_one (Contract account2) None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Tx_rollup tx_rollup) + (Some (Int64.to_int Nat_ticket.int64_amount)) + >>=? fun () -> + (* The withdrawal execution operation must include proof that the + level it specifies allows the withdrawal it executes. + + Currently, for a withdrawal execution [(level, rollup)] + the protocol only verifies that: + - at [level], there is a commitment for [rollup] + + It does not yet verify that the effects of the inbox at [level] actually + enables a withdrawal. + + In this test, we simply add dummy batch and a commitment for that batch to + to some level, which ensures that the withdrawal can be executed. + + Instead of a dummy batch, a more complete test would add: + + - A deposit operation + - A L2->L1 operation + + This will result in a withdrawal that can be executed. + *) + + (* 1. Create a ticket and two withdrawal to empty it *) + let int64_half_amount = Int64.div Nat_ticket.int64_amount 2L in + let half_amount = Tx_rollup_l2_qty.of_int64_exn int64_half_amount in + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:half_amount + tx_rollup + >>=? fun (withdraw1, ticket_info1) -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account2 + ~amount:half_amount + tx_rollup + >>=? fun (withdraw2, ticket_info2) -> + (* 2 Add a batch message to [b], a commitment for that inbox + containing the withdrawal at index 0, and finalize that + commitment *) + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw1; withdraw2])] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let message_index = 0 in + let context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list message_index) + in + occupied_storage_size (B block) tx_rollup + >>=? fun storage_size_before_withdraw -> + (* -- At this point, everything is in place for the user to execute the + withdrawal -- *) + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + Op.tx_rollup_dispatch_tickets + (B block) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info1; ticket_info2] + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* Now the Tx_rollup should own no tickets and the two implicit contract half before + calling withdraw.*) + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract deposit_contract) + None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract (Originated withdraw_contract)) + None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract account1) + (Some (Int64.to_int int64_half_amount)) + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract account2) + (Some (Int64.to_int int64_half_amount)) + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Tx_rollup tx_rollup) + None + >>=? fun () -> + (* 3. Now execute the withdrawal. The ticket should be received by + withdraw_contract at the default entrypoint. *) + let entrypoint = Entrypoint.default in + Op.transfer_ticket + (B block) + ~source:account1 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:deposit_contract + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_z + @@ Script_int.of_int64 int64_half_amount) + ~destination:(Originated withdraw_contract) + ~entrypoint + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* 4.1 We assert that [withdraw_contract] has received the ticket as + expected *) + occupied_storage_size (B block) tx_rollup + >>=? fun storage_size_after_withdraw -> + let extra_storage_space = + Z.(sub storage_size_after_withdraw storage_size_before_withdraw) + in + (* no extra space should be allocated for withdraw*) + assert (extra_storage_space = Z.zero) ; + Incremental.begin_construction block >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + Contract.get_storage ctxt withdraw_contract + >>=?? fun (_ctxt, found_storage) -> + let expected_storage = + Format.sprintf + "(Some (Pair 0x%s (Pair %d %s)))" + (Hex.show + (Hex.of_string + (Data_encoding.Binary.to_string_exn + Contract.encoding + deposit_contract))) + Nat_ticket.contents_nat + (Tx_rollup_l2_qty.to_string half_amount) + |> Expr.from_string |> Option.some + in + (if expected_storage = found_storage then return_unit + else Alcotest.fail "Storage didn't match") + >>=? fun () -> + (* 4.2 The Tx_rollup should owns some tickets and the withdraw_contract half + of it.*) + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract deposit_contract) + None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract (Originated withdraw_contract)) + (Some (Int64.to_int int64_half_amount)) + >>=? fun () -> + assert_ticket_balance ~loc:__LOC__ block token_one (Contract account1) None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract account2) + (Some (Int64.to_int int64_half_amount)) + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Tx_rollup tx_rollup) + None + >>=? fun () -> + (* 5.1 And finally we try to drop the other half amount of ticket. *) + Op.transfer_ticket + (B block) + ~source:account2 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:deposit_contract + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_z + @@ Script_int.of_int64 int64_half_amount) + ~destination:(Originated withdraw_dropping_contract) + ~entrypoint + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* 4. Finally, we assert that [withdraw_contract] has received the ticket as + expected *) + Incremental.begin_construction block >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + Contract.get_storage ctxt withdraw_dropping_contract + >>=?? fun (_ctxt, found_storage) -> + let expected_storage = "Unit" |> Expr.from_string |> Option.some in + (if expected_storage = found_storage then return_unit + else Alcotest.fail "Storage didn't match") + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract deposit_contract) + None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract (Originated withdraw_contract)) + (Some (Int64.to_int int64_half_amount)) + >>=? fun () -> + assert_ticket_balance ~loc:__LOC__ block token_one (Contract account1) None + >>=? fun () -> + assert_ticket_balance ~loc:__LOC__ block token_one (Contract account2) None + >>=? fun () -> + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Tx_rollup tx_rollup) + None + + (** [test_invalid_reveal_withdrawals_no_commitment] checks that attempting to + reveal withdrawals from a level with no committed inbox raises an + error. *) + let test_invalid_reveal_withdrawals_no_commitment () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, deposit_contract, _withdraw_contract, block) + -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:Nat_ticket.amount + tx_rollup + >>=? fun (_withdraw, ticket_info) -> + Incremental.begin_construction block >>=? fun incr -> + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index:0 (* any indexes will fail *) + ~message_result_path:Tx_rollup_commitment.Merkle.dummy_path + tx_rollup + Tx_rollup_level.root + (Tezos_crypto.Context_hash.hash_bytes [Bytes.make 20 'c']) + (* any context hash will fail *) + [ticket_info] + (* any non-empty list will fail *) + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.No_finalized_commitment_for_level + {level; window = None} -> + Tx_rollup_level.(level = root) + | _ -> false) + incr + operation + >>=? fun (_ : Incremental.t) -> return_unit + + (** [test_invalid_reveal_withdrawals_missing_withdraw_in_commitment] tries to + reveal withdrawals when the commitment in question has no withdrawals + associated. *) + let test_invalid_reveal_withdrawals_missing_withdraw_in_commitment () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, _deposit_contract, _withdraw_contract, block) + -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B block) account1 tx_rollup batch + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + Incremental.begin_construction block >>=? fun incr -> + let message_index = 0 in + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [] + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error Tx_rollup_errors.No_withdrawals_to_dispatch) + incr + operation + >>=? fun (_ : Incremental.t) -> return_unit + + (** [test_reveal_withdrawals_invalid_tickets_info] test to reveal withdrawals with + tickets that do not correspond to the given proof and asserts that errors + are raised. *) + let test_reveal_withdrawals_invalid_tickets_info () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, deposit_contract, withdraw_contract, block) + -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B block) account1 tx_rollup batch + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + let message_index = 0 in + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + tx_rollup + >>=? fun (withdraw, ticket_info) -> + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list message_index) + in + Incremental.begin_construction block >>=? fun incr -> + (* Try with invalid amounts *) + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [{ticket_info with amount = Tx_rollup_l2_qty.of_int64_exn 9L}] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, 0)} -> + true + | _ -> false) + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Try with twice the same withdrawal *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info; ticket_info] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, 0)} -> + true + | _ -> false) + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Try with wrong type *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [{ticket_info with ty = Script.lazy_expr @@ Expr.from_string "unit"}] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure:(function + | Environment.Ecoproto_error + (Script_tc_errors.Invalid_constant (_, _, _)) + :: _ -> + return_unit + | _ -> Alcotest.fail "expected to fail with wrong type") + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Try with wrong contents *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [{ticket_info with contents = Script.lazy_expr @@ Expr.from_string "2"}] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, 0)} -> + true + | _ -> false) + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Try with wrong ticketer *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [{ticket_info with ticketer = Originated withdraw_contract}] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, 0)} -> + true + | _ -> false) + incr + operation + >>=? fun (_incr : Incremental.t) -> return_unit + + (** [test_reveal_withdrawals_twice] asserts that withdrawing the same + withdrawal twice raises an error with the ticket table accounting. *) + let test_reveal_withdrawals_twice () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, deposit_contract, _withdraw_contract, block) + -> + Nat_ticket.withdrawal + (B block) + ~amount: + (Tx_rollup_l2_qty.of_int64_exn + (Int64.div (Tx_rollup_l2_qty.to_int64 Nat_ticket.amount) 2L)) + ~ticketer:deposit_contract + ~claimer:account1 + tx_rollup + >>=? fun (withdraw, ticket_info) -> + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let message_index = 0 in + let context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list message_index) + in + + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + Op.tx_rollup_dispatch_tickets + (B block) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info] + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* Execute again *) + Op.tx_rollup_dispatch_tickets + (B block) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info] + >>=? fun operation -> + Incremental.begin_construction block >>=? fun incr -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Withdrawals_already_dispatched) + incr + operation + >>=? fun (_ : Incremental.t) -> return_unit + + (** [test_multiple_withdrawals_multiple_batches] checks that multiple withdrawals + from the same batch are possible. *) + let test_multiple_withdrawals_multiple_batches () = + context_init2_withdraw () + >>=? fun ( account1, + account2, + tx_rollup, + deposit_contract, + withdraw_contract, + block ) -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:(Tx_rollup_l2_qty.of_int64_exn 1L) + tx_rollup + >>=? fun (withdraw1, ticket_info1) -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:(Tx_rollup_l2_qty.of_int64_exn 1L) + tx_rollup + >>=? fun (withdraw2, ticket_info2) -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:(Tx_rollup_l2_qty.of_int64_exn 2L) + tx_rollup + >>=? fun (withdraw3, ticket_info3) -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account2 + ~amount:(Tx_rollup_l2_qty.of_int64_exn 2L) + tx_rollup + >>=? fun (withdraw4, ticket_info4) -> + let first_message_index = 0 in + let second_message_index = 1 in + let first_withdrawals = [withdraw1; withdraw2] in + let second_withdrawals = [withdraw3; withdraw4] in + finalize_all_commitment_with_withdrawals + ~batches:["batch1"; "batch2"] + ~account:account1 + ~tx_rollup + ~withdrawals: + [ + (first_message_index, first_withdrawals); + (second_message_index, second_withdrawals); + ] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let first_context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list first_message_index) + in + let second_context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list second_message_index) + in + let path1 = + compute_message_result_path + commitment + ~message_position:first_message_index + in + let path2 = + compute_message_result_path + commitment + ~message_position:second_message_index + in + Op.tx_rollup_dispatch_tickets + (B block) + ~source:account1 + ~message_index:first_message_index + ~message_result_path:path1 + tx_rollup + committed_level + first_context_hash + [ticket_info1; ticket_info2] + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* Execute withdraw *) + let withdraw_op source b qty = + Op.transfer_ticket + (B b) + ~source + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:deposit_contract + ~amount:qty + ~destination:(Originated withdraw_contract) + ~entrypoint:Entrypoint.default + in + (* Execute withdraw with half amount *) + withdraw_op account1 block Ticket_amount.one >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* Execute withdraw with the rest amount *) + withdraw_op account1 block Ticket_amount.one >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* Execute again, now should fail with a ticket table error *) + withdraw_op account1 block Ticket_amount.one >>=? fun operation -> + Incremental.begin_construction block >>=? fun incr -> + Incremental.add_operation + ~expect_apply_failure:(function + | Environment.Ecoproto_error + (Ticket_balance.Negative_ticket_balance {key = _; balance}) + :: _ -> + if Z.(balance = neg @@ of_int64 1L) then return_unit + (* key is ticket hash with account1 as owner *) + else Alcotest.fail "failed with wrong value" + | _ -> + Alcotest.fail "expected to fail with ticket table accounting error") + incr + operation + >>=? fun (_incr : Incremental.t) -> + (* Execute second reveal *) + Op.tx_rollup_dispatch_tickets + (B block) + ~source:account1 + ~message_index:second_message_index + ~message_result_path:path2 + tx_rollup + committed_level + second_context_hash + [ticket_info3; ticket_info4] + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + withdraw_op account1 block Ticket_amount.(add one one) + >>=? fun operation1 -> + withdraw_op account2 block Ticket_amount.(add one one) + >>=? fun operation2 -> + Block.bake ~operations:[operation1; operation2] block + >>=? fun (_block : Block.t) -> return_unit + + (** [test_invalid_index_or_context] checks that attempting to reveal withdrawal + from a level with a wrong message index or context hash raises an + error. *) + let test_invalid_index_or_context () = + context_init2_withdraw () + >>=? fun ( account1, + account2, + tx_rollup, + deposit_contract, + _withdraw_contract, + block ) -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B block) account1 tx_rollup batch + >>=? fun operation1 -> + Op.tx_rollup_submit_batch (B block) account2 tx_rollup batch + >>=? fun operation2 -> + Block.bake ~operations:[operation1; operation2] block >>=? fun block -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + tx_rollup + >>=? fun (withdraw, ticket_info) -> + make_incomplete_commitment_for_batch + (B block) + Tx_rollup_level.root + tx_rollup + [] + >>=? fun (commitment, _context_hash_list) -> + Op.tx_rollup_commit (B block) account1 tx_rollup commitment + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + Op.tx_rollup_finalize (B block) account1 tx_rollup >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + let valid_message_index = 0 in + let wrong_message_index = 1 in + make_incomplete_commitment_for_batch + (B block) + Tx_rollup_level.(succ root) + tx_rollup + [(valid_message_index, [withdraw])] + >>=? fun (commitment, context_hash_list) -> + Op.tx_rollup_commit (B block) account1 tx_rollup commitment + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* 3. Finalize the commitment *) + Op.tx_rollup_finalize (B block) account1 tx_rollup >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + let valid_context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list valid_message_index) + in + let wrong_context_hash = + WithExceptions.Option.get + ~loc:__LOC__ + (List.nth context_hash_list wrong_message_index) + in + Incremental.begin_construction block >>=? fun incr -> + (* try with wrong context hash *) + let valid_path = + compute_message_result_path + commitment + ~message_position:valid_message_index + in + let wrong_path = + compute_message_result_path + commitment + ~message_position:wrong_message_index + in + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index:valid_message_index + ~message_result_path:valid_path + tx_rollup + Tx_rollup_level.(succ root) + wrong_context_hash + [ticket_info] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, idx)} -> + Compare.Int.(idx = valid_message_index) + | _ -> false) + incr + operation + >>=? fun (_i : Incremental.t) -> + (* try with wrong message_index *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index:wrong_message_index + ~message_result_path:wrong_path + tx_rollup + Tx_rollup_level.(succ root) + valid_context_hash + [ticket_info] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, idx)} -> + Compare.Int.(idx = wrong_message_index) + | _ -> false) + incr + operation + >>=? fun (_i : Incremental.t) -> + (* 5. try with a hilariously-large message_index. If permitted, + this could cause a stack overflow. *) + let wrong_message_index = 1_000_000_000 in + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index:wrong_message_index + ~message_result_path:wrong_path + tx_rollup + Tx_rollup_level.(succ root) + valid_context_hash + [ticket_info] + >>=? fun operation -> + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.Wrong_rejection_hash + {provided = _; expected = `Valid_path (_, idx)} -> + Compare.Int.(idx = wrong_message_index) + | _ -> false) + incr + operation + >>=? fun (_i : Incremental.t) -> + (* valid reveal *) + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index:valid_message_index + ~message_result_path:valid_path + tx_rollup + Tx_rollup_level.(succ root) + valid_context_hash + [ticket_info] + >>=? fun operation -> + Incremental.add_operation incr operation >>=? fun (_i : Incremental.t) -> + return_unit + + (** [test_too_late_withdrawal] checks that attempting to withdraw from a level + of a commitment already removed fails. *) + let test_too_late_withdrawal () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, deposit_contract, _withdraw_contract, block) + -> + Nat_ticket.withdrawal + (B block) + ~ticketer:deposit_contract + ~claimer:account1 + tx_rollup + >>=? fun (withdraw, ticket_info) -> + let message_index = 0 in + (* Make a commitment for the dummy batch. Mock the list of withdrawals as + per [withdrawals]. Include the commitment in an operation and bake. *) + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(message_index, [withdraw])] + block + >>=? fun (commitment, context_hash_list, committed_level, block) -> + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth context_hash_list message_index + in + Block.bake block >>=? fun block -> + (* Remove the commitment *) + Op.tx_rollup_remove_commitment (B block) account1 tx_rollup + >>=? fun operation -> + Block.bake ~operation block >>=? fun block -> + (* At this point, the reveal can no longer be executed *) + Incremental.begin_construction block >>=? fun incr -> + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + Op.tx_rollup_dispatch_tickets + (I incr) + ~source:account1 + ~message_index + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info] + >>=? fun operation -> + (* try with correct withdraw but too late *) + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.No_finalized_commitment_for_level + {level; window = None} -> + Tx_rollup_level.(level = committed_level) + | _error -> false) + incr + operation + >>=? fun (_i : Incremental.t) -> return_unit + + (** [test_withdrawal_accounting_is_cleaned_up_after_removal] + Check that withdrawal accounting is cleaned + up along with the commitment. + *) + let test_withdrawal_accounting_is_cleaned_up_after_removal () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, deposit_contract, _withdraw_contract, b) -> + let message_position = 0 in + let assert_consumed b ~msg committed_level consumed_expected = + Incremental.begin_construction b >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + Alpha_context.Tx_rollup_reveal.mem + ctxt + tx_rollup + committed_level + ~message_position + >>=?? fun (_, consumed_actual) -> + Alcotest.(check bool msg consumed_expected consumed_actual) ; + return_unit + in + + Nat_ticket.withdrawal + (B b) + ~ticketer:deposit_contract + ~claimer:account1 + tx_rollup + >>=? fun (withdraw, ticket_info) -> + finalize_all_commitment_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(message_position, [withdraw])] + b + >>=? fun (commitment, context_hash_list, committed_level, b) -> + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ (List.nth context_hash_list 0) + in + assert_consumed + b + ~msg:"should not be consumed before withdrawal" + committed_level + false + >>=? fun () -> + (* Execute with withdrawal *) + let message_result_path = + compute_message_result_path commitment ~message_position + in + Op.tx_rollup_dispatch_tickets + (B b) + ~source:account1 + ~message_index:message_position + ~message_result_path + tx_rollup + committed_level + context_hash + [ticket_info] + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + assert_consumed + b + ~msg:"should be consumed after withdrawal" + committed_level + true + >>=? fun () -> + (* Remove the commitment *) + Op.tx_rollup_remove_commitment (B b) account1 tx_rollup + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + assert_consumed + b + committed_level + ~msg:"consumtion memory should be removed with commitment" + false + >>=? fun () -> return_unit + + (** Confirm that executing a deposit message produces the correct withdraws. + In order to check that the withdrawals are actually correct, we fail to + reject them. *) + let make_and_check_correct_commitment ctxt tx_rollup account store message + level withdrawals ~previous_message_result = + make_incomplete_commitment_for_batch ctxt level tx_rollup withdrawals + >>=? fun (commitment, _) -> + l2_parameters ctxt >>=? fun l2_parameters -> + Rejection.make_proof store l2_parameters message >>= fun proof -> + let after = + match proof.after with `Value hash -> hash | `Node hash -> hash + in + let m1_withdrawals = + match List.nth withdrawals 0 with + | Some (_idx, withdrawals) -> withdrawals + | None -> [] + in + let message_result = + Tx_rollup_message_result. + { + context_hash = after; + withdraw_list_hash = + Tx_rollup_withdraw_list_hash.hash_uncarbonated m1_withdrawals; + } + in + let message_result_hash = + Tx_rollup_message_result_hash.hash_uncarbonated message_result + in + let commitment = {commitment with messages = [message_result_hash]} in + Op.tx_rollup_commit ctxt account tx_rollup commitment >>=? fun operation -> + (match ctxt with + | B b -> Incremental.begin_construction b + | I i -> return i) + >>=? fun i -> + Incremental.add_operation i operation >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + Incremental.begin_construction b >>=? fun i -> + let message_position = 0 in + let message_path = + single_message_path @@ Tx_rollup_message_hash.hash_uncarbonated message + in + let message_result_path = + compute_message_result_path commitment ~message_position + in + Op.tx_rollup_reject + (I i) + account + tx_rollup + level + message + ~message_position + ~message_path + ~message_result_hash + ~message_result_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + >>=? fun op -> + Incremental.add_operation + i + op + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Proof_produced_rejected_state) + >>=? fun (_i : Incremental.t) -> return (i, message_result) + + (** [test_deposit_overflow_to_withdrawal] checks that a deposit that + overflows causes withdrawals to be generated. *) + let test_deposit_overflow_to_withdrawal () = + (* We deposit one less than the max, so that we can prove that the + withdraw is equal to the deposit, rather than the remainder after + we overflow. *) + let max = Int64.(sub max_int 1L) in + let _, _, pkh = gen_l2_account () in + context_init1 () >>=? fun (b, account1) -> + originate b account1 >>=? fun (b, tx_rollup) -> + let pkh_str = Tx_rollup_l2_address.to_b58check pkh in + Nat_ticket.init_deposit_contract (Z.of_int64 max) b account1 + >>=? fun (deposit_contract, _script, b) -> + let deposit_pkh = Context.Contract.pkh account1 in + let deposit b = + Nat_ticket.deposit_op b tx_rollup pkh_str account1 deposit_contract + >>=? fun operation -> Block.bake ~operation b + in + deposit b >>=? fun b -> + deposit b >>=? fun b -> + deposit b >>=? fun b -> + Nat_ticket.withdrawal + (B b) + ~ticketer:deposit_contract + ~claimer:account1 + ~amount:(Tx_rollup_l2_qty.of_int64_exn max) + tx_rollup + >>=? fun (withdraw, _) -> + Nat_ticket.ticket_hash (B b) ~ticketer:deposit_contract ~tx_rollup + >>=? fun ticket_hash -> + let deposit1, _ = + Tx_rollup_message.make_deposit + deposit_pkh + (Tx_rollup_l2_address.Indexable.value pkh) + ticket_hash + (Tx_rollup_l2_qty.of_int64_exn max) + in + Rejection.init_l2_store () >>= fun store -> + (* For the first deposit, we have no withdraws *) + make_and_check_correct_commitment + (B b) + tx_rollup + account1 + store + deposit1 + (tx_level 0l) + [] + ~previous_message_result:Rejection.previous_message_result + >>=? fun (i, previous_message_result) -> + l2_parameters (I i) >>=? fun l2_parameters -> + (* Finally, we apply the deposit manually to have the good resulting store + for next operations *) + Rejection.Apply.apply_message store l2_parameters deposit1 + >>= fun (store, _) -> + Rejection.commit_store store >>= fun store -> + (* For the second deposit, we have one. *) + make_and_check_correct_commitment + (I i) + tx_rollup + account1 + store + deposit1 + (tx_level 1l) + [(0, [withdraw])] + ~previous_message_result + >>=? fun (i, previous_message_result) -> + Rejection.Apply.apply_message store l2_parameters deposit1 + >>= fun (store, _) -> + Rejection.commit_store store >>= fun store -> + (* For the third deposit, we have one. *) + make_and_check_correct_commitment + (I i) + tx_rollup + account1 + store + deposit1 + (tx_level 2l) + [(0, [withdraw])] + ~previous_message_result + >>=? fun (_, _) -> return_unit + + (** [test_deposit_multiple_destinations_at_limit] checks that we can + deposit the maximum number of tickets to multiple destinations ] + without overflowing. *) + let test_deposit_multiple_destinations_at_limit () = + let max = Int64.max_int in + let _, _, pkh1 = gen_l2_account () in + let _, _, pkh2 = gen_l2_account () in + context_init1 () >>=? fun (b, account1) -> + originate b account1 >>=? fun (b, tx_rollup) -> + Nat_ticket.init_deposit_contract (Z.of_int64 max) b account1 + >>=? fun (deposit_contract, _script, b) -> + let deposit_pkh = Context.Contract.pkh account1 in + let deposit b pkh = + let pkh_str = Tx_rollup_l2_address.to_b58check pkh in + Nat_ticket.deposit_op b tx_rollup pkh_str account1 deposit_contract + >>=? fun operation -> Block.bake ~operation b + in + deposit b pkh1 >>=? fun b -> + deposit b pkh2 >>=? fun b -> + Nat_ticket.ticket_hash (B b) ~ticketer:deposit_contract ~tx_rollup + >>=? fun ticket_hash -> + let make_deposit pkh = + Tx_rollup_message.make_deposit + deposit_pkh + (Tx_rollup_l2_address.Indexable.value pkh) + ticket_hash + (Tx_rollup_l2_qty.of_int64_exn max) + in + let deposit1, _ = make_deposit pkh1 in + let deposit2, _ = make_deposit pkh2 in + Rejection.init_l2_store () >>= fun store -> + (* For the first deposit, we have no withdraws *) + make_and_check_correct_commitment + (B b) + tx_rollup + account1 + store + deposit1 + (tx_level 0l) + [] + ~previous_message_result:Rejection.previous_message_result + >>=? fun (i, previous_message_result) -> + l2_parameters (I i) >>=? fun l2_parameters -> + (* Finally, we apply the deposit manually to have the good resulting store + for next operations *) + Rejection.Apply.apply_message store l2_parameters deposit1 + >>= fun (store, _) -> + Rejection.commit_store store >>= fun store -> + (* For the second deposit, still no withdraws. *) + make_and_check_correct_commitment + (I i) + tx_rollup + account1 + store + deposit2 + (tx_level 1l) + [] + ~previous_message_result + >>=? fun (i, _) -> + ignore i ; + return_unit + + module Forge_deposit_withdraw (Ctxt : sig + val forge_withdraw_deposit_contract : Contract.t + + val account : Contract.t + + val tx_rollup : Tx_rollup.t + end) = + struct + open Lwt_result_syntax + + let forge_ticket block = + let* operation = + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Expr_common.( + pair_n + [ + int (Z.of_int Nat_ticket.contents_nat); + int (Tx_rollup_l2_qty.to_z Nat_ticket.amount); + ]) + |> Tezos_micheline.Micheline.strip_locations |> Script.lazy_expr) + ~fee:Tez.one + Ctxt.account + Ctxt.forge_withdraw_deposit_contract + (Tez.of_mutez_exn 0L) + in + Block.bake ~operation block + + let deposit_ticket block = + let* operation = + Op.transaction + (B block) + ~entrypoint:(Entrypoint.of_string_strict_exn "deposit") + ~parameters: + (Expr_common.( + pair_n + [ + string (Tx_rollup.to_b58check Ctxt.tx_rollup); + string "tz4MSfZsn6kMDczShy8PMeB628TNukn9hi2K"; + ]) + |> Tezos_micheline.Micheline.strip_locations |> Script.lazy_expr) + ~fee:Tez.one + Ctxt.account + Ctxt.forge_withdraw_deposit_contract + (Tez.of_mutez_exn 0L) + in + Block.bake ~operation block + + let dispatch_ticket block = + let* withdraw, ticket_info = + Nat_ticket.withdrawal + (B block) + ~ticketer:Ctxt.forge_withdraw_deposit_contract + ~claimer:Ctxt.account + Ctxt.tx_rollup + in + let message_index = 0 in + let* commitment, context_hash_list, committed_level, block = + finalize_all_commitment_with_withdrawals + ~batches:["batch"] + ~account:Ctxt.account + ~tx_rollup:Ctxt.tx_rollup + ~withdrawals:[(message_index, [withdraw])] + block + in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth context_hash_list message_index + in + let message_result_path = + compute_message_result_path commitment ~message_position:message_index + in + let* operation = + Op.tx_rollup_dispatch_tickets + (B block) + ~source:Ctxt.account + ~message_index + ~message_result_path + Ctxt.tx_rollup + committed_level + context_hash + [ticket_info] + in + Block.bake ~operation block + + let transfer_ticket block = + let* operation = + Op.transfer_ticket + (B block) + ~source:Ctxt.account + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:Ctxt.forge_withdraw_deposit_contract + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint + @@ Tx_rollup_l2_qty.to_z Nat_ticket.amount) + ~destination:Ctxt.forge_withdraw_deposit_contract + ~entrypoint:(Entrypoint.of_string_strict_exn "withdraw") + in + Block.bake ~operation block + + let token_one = + Nat_ticket.ex_token ~ticketer:Ctxt.forge_withdraw_deposit_contract + + let assert_contract_ticket_balance ~__LOC__ block balance = + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract Ctxt.forge_withdraw_deposit_contract) + balance + + let assert_account_ticket_balance ~__LOC__ block balance = + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract Ctxt.account) + balance + + let assert_tx_rollup_ticket_balance ~__LOC__ block balance = + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Tx_rollup Ctxt.tx_rollup) + balance + end + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/4083 + Remove and replace the following test with transfers between + originated and implicit accounts directly. *) + + (** [test_forge_deposit_withdraw_deposit ()] checks the following scenario: + 1. forges new tickets and stores it in contract's storage. + 2. deposits these tickets into a tx_rollup + 3. dispatches them to an account + 4. forges new tickets + 3. transfers the tickets from the account to the contract + 4. deposits the just received tickets into the tx_rollup *) + let test_forge_deposit_withdraw_deposit () = + let open Lwt_result_syntax in + let* block, account = context_init1 () in + let* block, tx_rollup = originate block account in + let* forge_withdraw_deposit_contract, block = + originate_forge_withdraw_deposit_contract account block + in + let open Forge_deposit_withdraw (struct + let forge_withdraw_deposit_contract = + Contract.Originated forge_withdraw_deposit_contract + + let account = account + + let tx_rollup = tx_rollup + end) in + (* forge tickets and store them in the contract storage. *) + let* block = forge_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block None in + (* deposit tickets from the contract storage into the tx_rollup. *) + let* block = deposit_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block None in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_account_ticket_balance ~__LOC__ block None in + (* add withdrawals, then transfer the tickets from tx_rollup to account. *) + let* block = dispatch_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block None in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block (Some 10) in + (* forge new tickets and store them in the contract storage. *) + let* block = forge_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block (Some 10) in + (* transfer tickets from account to the contract. *) + let* block = transfer_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block (Some 20) in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block None in + (* deposit back the tickets that was just transfered. *) + let* block = deposit_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block (Some 10) in + assert_account_ticket_balance ~__LOC__ block None + + (** [test_forge_deposit_withdraw_implicit_transfer ()] checks the following scenario: + 1. forges new tickets and stores them in contract's storage + 2. deposits these tickets into a tx_rollup + 3. dispatches them to an account + 4. transfers the dispatched tickets to another implicit account *) + let test_forge_deposit_withdraw_implicit_transfer () = + let open Lwt_result_syntax in + let* block, (account, another_account) = context_init2 () in + let* block, tx_rollup = originate block account in + let* forge_withdraw_deposit_contract, block = + originate_forge_withdraw_deposit_contract account block + in + let open Forge_deposit_withdraw (struct + let forge_withdraw_deposit_contract = + Contract.Originated forge_withdraw_deposit_contract + + let account = account + + let tx_rollup = tx_rollup + end) in + let transfer_ticket_to_implicit_with_wrong_type block = + let* operation = + Op.transfer_ticket + (B block) + ~source:account + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr @@ Expr.from_string "string") + ~ticketer:(Originated forge_withdraw_deposit_contract) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint + @@ Tx_rollup_l2_qty.to_z Nat_ticket.amount) + ~destination:another_account + ~entrypoint:Entrypoint.default + in + Block.bake ~operation block + in + let transfer_ticket_to_implicit_with_too_large_amount block = + let* operation = + Op.transfer_ticket + (B block) + ~source:account + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr @@ Expr.from_string "string") + ~ticketer:(Originated forge_withdraw_deposit_contract) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint @@ Z.of_int64 + @@ Int64.add Nat_ticket.int64_amount 1L) + ~destination:another_account + ~entrypoint:Entrypoint.default + in + Block.bake ~operation block + in + let transfer_ticket_to_self_implicit block = + let* operation = + Op.transfer_ticket + (B block) + ~source:account + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr @@ Expr.from_string "string") + ~ticketer:(Originated forge_withdraw_deposit_contract) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint + @@ Tx_rollup_l2_qty.to_z Nat_ticket.amount) + ~destination:account + ~entrypoint:Entrypoint.default + in + Block.bake ~operation block + in + let transfer_ticket_to_implicit block = + let* operation = + Op.transfer_ticket + (B block) + ~source:account + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:(Originated forge_withdraw_deposit_contract) + ~amount: + (WithExceptions.Option.get ~loc:__LOC__ + @@ Ticket_amount.of_zint + @@ Tx_rollup_l2_qty.to_z Nat_ticket.amount) + ~destination:another_account + ~entrypoint:Entrypoint.default + in + Block.bake ~operation block + in + let assert_another_account_ticket_balance ~__LOC__ block balance = + assert_ticket_balance + ~loc:__LOC__ + block + token_one + (Contract another_account) + balance + in + (* forge tickets and store them in the contract storage. *) + let* block = forge_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block None in + (* deposit tickets from the contract storage into the tx_rollup. *) + let* block = deposit_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block None in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_account_ticket_balance ~__LOC__ block None in + (* add withdrawals, then transfer the tickets from tx_rollup to account. *) + let* block = dispatch_ticket block in + let* () = assert_contract_ticket_balance ~__LOC__ block None in + let* () = assert_tx_rollup_ticket_balance ~__LOC__ block None in + let* () = assert_account_ticket_balance ~__LOC__ block (Some 10) in + (* transfer the tickets dispatched from tx_rollup to another implicit account (error cases). *) + let*! result = transfer_ticket_to_implicit_with_wrong_type block in + let* () = + Assert.is_error + ~pp:(fun pp _ -> + Format.pp_print_string + pp + "tickets with wrong type should not be accepted") + ~loc:__LOC__ + result + in + let*! result = transfer_ticket_to_implicit_with_too_large_amount block in + let* () = + Assert.is_error + ~pp:(fun pp _ -> + Format.pp_print_string + pp + "over-drafting tickets should not be acceptable") + ~loc:__LOC__ + result + in + let*! result = transfer_ticket_to_self_implicit block in + let* () = + Assert.is_error + ~pp:(fun pp _ -> + Format.pp_print_string + pp + "transferring tickets to oneself should not be acceptable") + ~loc:__LOC__ + result + in + let* () = assert_account_ticket_balance ~__LOC__ block (Some 10) in + let* () = assert_another_account_ticket_balance ~__LOC__ block None in + (* transfer the tickets dispatched from tx_rollup to another implicit account (success case). *) + let* block = transfer_ticket_to_implicit block in + let* () = assert_account_ticket_balance ~__LOC__ block None in + assert_another_account_ticket_balance ~__LOC__ block (Some 10) + + let tests = + [ + Tztest.tztest "Test withdraw" `Quick test_valid_withdraw; + Tztest.tztest + "Test reveal withdrawals w/ missing commitment" + `Quick + test_invalid_reveal_withdrawals_no_commitment; + Tztest.tztest + "Test reveal withdrawals w/ missing withdraw in commitment" + `Quick + test_invalid_reveal_withdrawals_missing_withdraw_in_commitment; + Tztest.tztest + "Test reveal withdrawals w/ incorrect tickets info" + `Quick + test_reveal_withdrawals_invalid_tickets_info; + Tztest.tztest + "Test to reveal withdrawals twice" + `Quick + test_reveal_withdrawals_twice; + Tztest.tztest + "Test withdraw w/ an invalid message index" + `Quick + test_invalid_index_or_context; + Tztest.tztest "Test withdrawing too late" `Quick test_too_late_withdrawal; + Tztest.tztest + "Test storage clean up" + `Quick + test_withdrawal_accounting_is_cleaned_up_after_removal; + Tztest.tztest + "Test deposits overflowing to withdrawals" + `Quick + test_deposit_overflow_to_withdrawal; + Tztest.tztest + "Test deposit to multiple destinations don't overflow" + `Quick + test_deposit_multiple_destinations_at_limit; + Tztest.tztest + "Test multiple withdrawals from the same batch and from different \ + batches" + `Quick + test_multiple_withdrawals_multiple_batches; + Tztest.tztest + "Test deposit, followed by withdrawal, followed by deposit" + `Quick + test_forge_deposit_withdraw_deposit; + Tztest.tztest + "Test deposit, followed by withdrawal, followed by transfer to an \ + implicit account" + `Quick + test_forge_deposit_withdraw_implicit_transfer; + ] +end + +let tests = + [ + Tztest.tztest + "check feature flag is disabled" + `Quick + test_disable_feature_flag; + Tztest.tztest "check sunset" `Quick test_sunset; + Tztest.tztest "check tx rollup origination and burn" `Quick test_origination; + Tztest.tztest + "check two originated tx rollup in one operation have different address" + `Quick + test_two_originations; + Tztest.tztest + "check the function that updates the burn per byte rate of a transaction \ + rollup" + `Quick + test_burn_per_byte_update; + Tztest.tztest "add one batch to a rollup" `Quick test_add_batch; + Tztest.tztest "add two batches to a rollup" `Quick test_add_two_batches; + Tztest.tztest + "add one batch and limit the burn" + `Quick + test_add_batch_with_limit; + Tztest.tztest + "Try to add a batch larger than the limit" + `Quick + test_batch_too_big; + Tztest.tztest + "Try to add several batches to reach the inbox size limit" + `Quick + test_inbox_size_too_big; + Tztest.tztest + "Try to add several batches to reach the inbox count limit" + `Quick + test_inbox_count_too_big; + Tztest.tztest "Test deposit with valid contract" `Quick test_valid_deposit; + Tztest.tztest + "Test deposit with invalid parameter" + `Quick + test_invalid_deposit_not_ticket; + Tztest.tztest + "Test deposit with too big ticket" + `Quick + test_invalid_deposit_too_big_ticket; + Tztest.tztest + "Test deposit with too big ticket type" + `Quick + test_invalid_deposit_too_big_ticket_type; + Tztest.tztest + "Test valid deposit with big ticket" + `Quick + test_valid_deposit_big_ticket; + Tztest.tztest + "Test valid deposit to inexistant rollup" + `Quick + test_valid_deposit_inexistant_rollup; + Tztest.tztest "Test invalid entrypoint" `Quick test_invalid_entrypoint; + Tztest.tztest + "Test valid deposit to invalid L2 address" + `Quick + test_invalid_l2_address; + Tztest.tztest + "Test valid deposit with non-zero amount" + `Quick + test_valid_deposit_invalid_amount; + Tztest.tztest + "Test depositing too many tickets" + `Quick + test_deposit_too_many_tickets; + Tztest.tztest "Test finalization" `Quick test_finalization; + Tztest.tztest "Smoke test commitment" `Quick test_commitment_duplication; + Tztest.tztest + "Test commitment predecessor edge cases" + `Quick + test_commitment_predecessor; + Tztest.tztest "Test full inbox" `Quick test_full_inbox; + Tztest.tztest + "Test too many finalized commitments" + `Quick + test_too_many_commitments; + Tztest.tztest + "Test finalization edge cases" + `Quick + test_finalization_edge_cases; + Tztest.tztest "Test bond finalization" `Quick test_bond_finalization; + Tztest.tztest "Test state" `Quick test_state; + Tztest.tztest + "Try to commit to the current inbox and fail" + `Quick + test_commit_current_inbox; + Tztest.tztest + "Test state with deleted commitment" + `Quick + test_state_with_deleted; + Tztest.tztest + "Test upfront message preallocation" + `Quick + test_state_message_storage_preallocation; + Tztest.tztest + "Test storage burn for submitting batch" + `Quick + test_storage_burn_for_adding_batch; + Tztest.tztest + "Test additional space allocation for deposit" + `Quick + test_additional_space_allocation_for_valid_deposit; + Tztest.tztest + "Test additional space allocation for commitment" + `Quick + test_storage_burn_for_commitment; + ] + @ Withdraw.tests @ Rejection.tests @ parsing_tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml new file mode 100644 index 000000000000..951fa00e12d7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml @@ -0,0 +1,2107 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (voting) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^voting$" + Subject: On the voting process. + +*) + +open Protocol +open Alpha_context + +(** {2 Constants and ratios used in voting} + + percent_mul denotes the percent multiplier + initial_participation is 7000 that is, 7/10 * percent_mul + the participation EMA ratio pr_ema_weight / den = 7 / 10 + the participation ratio pr_num / den = 2 / 10 + note: we use the same denominator for both participation EMA and participation rate. + supermajority rate is s_num / s_den = 8 / 10 *) +let percent_mul = 100_00 + +let den = 10 + +let initial_participation_num = 7 + +let initial_participation = initial_participation_num * percent_mul / den + +let pr_ema_weight = 8 + +let pr_num = den - pr_ema_weight + +let s_num = 8 + +let s_den = 10 + +let qr_min_num = 2 + +let qr_max_num = 7 + +let expected_qr_num participation_ema = + let participation_ema = Int32.to_int participation_ema in + let participation_ema = participation_ema * den / percent_mul in + Float.( + of_int qr_min_num + +. of_int participation_ema + *. (of_int qr_max_num -. of_int qr_min_num) + /. of_int den) + +(* Tezos_crypto.Protocol_hash.zero is "PrihK96nBAFSxVL1GLJTVhu9YnzkMFiBeuJRPA8NwuZVZCE1L6i" *) +let protos = + Array.map + (fun s -> Tezos_crypto.Protocol_hash.of_b58check_exn s) + [| + "ProtoALphaALphaALphaALphaALphaALphaALpha61322gcLUGH"; + "ProtoALphaALphaALphaALphaALphaALphaALphabc2a7ebx6WB"; + "ProtoALphaALphaALphaALphaALphaALphaALpha84efbeiF6cm"; + "ProtoALphaALphaALphaALphaALphaALphaALpha91249Z65tWS"; + "ProtoALphaALphaALphaALphaALphaALphaALpha537f5h25LnN"; + "ProtoALphaALphaALphaALphaALphaALphaALpha5c8fefgDYkr"; + "ProtoALphaALphaALphaALphaALphaALphaALpha3f31feSSarC"; + "ProtoALphaALphaALphaALphaALphaALphaALphabe31ahnkxSC"; + "ProtoALphaALphaALphaALphaALphaALphaALphabab3bgRb7zQ"; + "ProtoALphaALphaALphaALphaALphaALphaALphaf8d39cctbpk"; + "ProtoALphaALphaALphaALphaALphaALphaALpha3b981byuYxD"; + "ProtoALphaALphaALphaALphaALphaALphaALphaa116bccYowi"; + "ProtoALphaALphaALphaALphaALphaALphaALphacce68eHqboj"; + "ProtoALphaALphaALphaALphaALphaALphaALpha225c7YrWwR7"; + "ProtoALphaALphaALphaALphaALphaALphaALpha58743cJL6FG"; + "ProtoALphaALphaALphaALphaALphaALphaALphac91bcdvmJFR"; + "ProtoALphaALphaALphaALphaALphaALphaALpha1faaadhV7oW"; + "ProtoALphaALphaALphaALphaALphaALphaALpha98232gD94QJ"; + "ProtoALphaALphaALphaALphaALphaALphaALpha9d1d8cijvAh"; + "ProtoALphaALphaALphaALphaALphaALphaALphaeec52dKF6Gx"; + "ProtoALphaALphaALphaALphaALphaALphaALpha841f2cQqajX"; + |] + +(** {2 Helper functions} *) + +let assert_period_kinds expected_kinds kind loc = + if + List.exists + (fun expected_kind -> Stdlib.(expected_kind = kind)) + expected_kinds + then return_unit + else + Alcotest.failf + "%s - Unexpected voting period kind - expected %a, got %a" + loc + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt " or ") + Voting_period.pp_kind) + expected_kinds + Voting_period.pp_kind + kind + +let assert_period_kind expected_kind = assert_period_kinds [expected_kind] + +let assert_period_index expected_index index loc = + if expected_index = index then return_unit + else + Alcotest.failf + "%s - Unexpected voting period index - expected %ld, got %ld" + loc + expected_index + index + +let assert_period_position expected_position position loc = + if position = expected_position then return_unit + else + Alcotest.failf + "%s - Unexpected voting period position blocks - expected %ld, got %ld" + loc + expected_position + position + +let assert_period_remaining expected_remaining remaining loc = + if remaining = expected_remaining then return_unit + else + Alcotest.failf + "%s - Unexpected voting period remaining blocks - expected %ld, got %ld" + loc + expected_remaining + remaining + +let assert_period ?expected_kind ?expected_kinds ?expected_index + ?expected_position ?expected_remaining b loc = + let open Lwt_result_syntax in + let* {voting_period; position; remaining} = + Context.Vote.get_current_period (B b) + in + let* () = + match (expected_kind, expected_kinds) with + | None, None -> return_unit + | Some expected_kind, None -> + assert_period_kind expected_kind voting_period.kind loc + | None, Some expected_kinds -> + assert_period_kinds expected_kinds voting_period.kind loc + | Some _, Some _ -> + invalid_arg + "assert_period: arguments expected_kind and expected_kinds should \ + not both be provided." + in + let* () = + match expected_index with + | Some expected_index -> + assert_period_index expected_index voting_period.index loc + | None -> return_unit + in + let* () = + match expected_position with + | Some expected_position -> + assert_period_position expected_position position loc + | None -> return_unit + in + match expected_remaining with + | Some expected_remaining -> + assert_period_remaining expected_remaining remaining loc + | None -> return_unit + +let assert_ballots expected_ballots b loc = + Context.Vote.get_ballots (B b) >>=? fun ballots -> + Assert.equal + ~loc + Vote.equal_ballots + "Unexpected ballots" + Vote.pp_ballots + ballots + expected_ballots + +let assert_empty_ballots b loc = + assert_ballots Vote.ballots_zero b loc >>=? fun () -> + Context.Vote.get_ballot_list (B b) >>=? function + | [] -> return_unit + | _ -> failwith "%s - Unexpected ballot list" loc + +let mk_contracts_from_pkh pkh_list = + List.map (fun c -> Contract.Implicit c) pkh_list + +(* get the list of delegates and the list of their voting power from listings *) +let get_delegates_and_power_from_listings b = + Context.Vote.get_listings (B b) >|=? fun l -> + (mk_contracts_from_pkh (List.map fst l), List.map snd l) + +(* compute the voting power of each delegate *) +let get_power b delegates loc = + List.map_es + (fun delegate -> + let pkh = Context.Contract.pkh delegate in + Context.Delegate.voting_info (B b) pkh >>=? fun info -> + match info.voting_power with + | None -> failwith "%s - Missing delegate" loc + | Some power -> return power) + delegates + +(* Checks that the listings are populated *) +let assert_listings_not_empty b ~loc = + Context.Vote.get_listings (B b) >>=? function + | [] -> failwith "Unexpected empty listings (%s)" loc + | _ -> return_unit + +let equal_delegate_info a b = + Option.equal Int64.equal a.Vote.voting_power b.Vote.voting_power + && Option.equal Vote.equal_ballot a.current_ballot b.current_ballot + && List.equal + Tezos_crypto.Protocol_hash.equal + (List.sort Tezos_crypto.Protocol_hash.compare a.current_proposals) + (List.sort Tezos_crypto.Protocol_hash.compare b.current_proposals) + && Int.equal a.remaining_proposals b.remaining_proposals + +let assert_equal_info ~loc a b = + Assert.equal + ~loc + equal_delegate_info + "delegate_info" + Vote.pp_delegate_info + a + b + +let bake_until_first_block_of_next_period ?policy b = + Context.Vote.get_current_period (B b) >>=? fun {remaining; _} -> + Block.bake_n ?policy Int32.(add remaining one |> to_int) b + +let context_init_tup tup ?(blocks_per_cycle = 4l) = + (* Note that some of these tests assume (more or less) that the + accounts remain active during a voting period, which roughly + translates to the following condition being assumed to hold: + `blocks_per_voting_period <= preserved_cycles * blocks_per_cycle.` + We also set baking and endorsing rewards to zero in order to + ease accounting of exact baker stake. *) + Context.init_gen + tup + ~blocks_per_cycle + ~cycles_per_voting_period:1l + ~consensus_threshold:0 + ~endorsing_reward_per_slot:Tez.zero + ~baking_reward_bonus_per_slot:Tez.zero + ~baking_reward_fixed_portion:Tez.zero + ~nonce_revelation_threshold:2l + +(** [context_init n ()] returns [(block, contracts)] where [block] is + an initial block with [n] bootstrap accounts, and [contracts] is + the list of associated implicit contracts. + + See {!context_init_tup} and {!Context.init_gen} for optional + arguments. *) +let context_init n = context_init_tup (Context.TList n) + +(** [context_init1 ()] returns [(block, contract)] where [block] is an + initial block with one bootstrap account, and [contract] is the + associated implicit contract. *) +let context_init1 = context_init_tup Context.T1 + +(** [context_init2 ()] returns [(block, contracts)] where [block] is + an initial block with two bootstrap accounts, and [contracts] is + the pair of associated implicit contracts. *) +let context_init2 = context_init_tup Context.T2 + +(** Call {!context_init2}, then inject a Proposals operation and bake + blocks in order to move on to an Exploration period. Return a + block, a delegate (distinct from the one who submitted the + Proposals), and the current proposal. *) +let context_init_exploration ?(proposal = protos.(0)) ?blocks_per_cycle () = + let open Lwt_result_syntax in + let* block, (proposer, other_delegate) = context_init2 ?blocks_per_cycle () in + let* operation = Op.proposals (B block) proposer [proposal] in + let* block = Block.bake block ~operation in + let* block = bake_until_first_block_of_next_period block in + let* () = assert_period ~expected_kind:Exploration block __LOC__ in + return (block, other_delegate, proposal) + +let append_loc ~caller_loc loc = + Format.sprintf "%s@.Called from %s" loc caller_loc + +(** {3 Expected protocol errors} *) + +let wrong_error expected_error_name actual_error_trace loc = + failwith + "%s:@,Expected error trace [%s], but got:@,%a" + loc + expected_error_name + Error_monad.pp_print_trace + actual_error_trace + +let missing_signature loc = function + | [Environment.Ecoproto_error Operation.Missing_signature] -> return_unit + | err -> wrong_error "Missing_signature" err loc + +let invalid_signature loc = function + | [Environment.Ecoproto_error Operation.Invalid_signature] -> return_unit + | err -> wrong_error "Invalid_signature" err loc + +open Validate_errors.Voting + +let wrong_voting_period_index ~current_index ~op_index loc = function + | [ + Environment.Ecoproto_error (Wrong_voting_period_index {expected; provided}); + ] -> + let open Lwt_result_syntax in + let make_loc = append_loc ~caller_loc:loc in + let* () = + Assert.equal_int32 ~loc:(make_loc __LOC__) expected current_index + in + Assert.equal_int32 ~loc:(make_loc __LOC__) provided op_index + | err -> wrong_error "Wrong_voting_period_index" err loc + +let wrong_voting_period_kind loc = function + | [Environment.Ecoproto_error (Wrong_voting_period_kind _)] -> return_unit + | err -> wrong_error "Wrong_voting_period_kind" err loc + +let proposals_from_unregistered_delegate loc = function + | [Environment.Ecoproto_error (Proposals_from_unregistered_delegate _)] -> + return_unit + | err -> wrong_error "Proposals_from_unregistered_delegate" err loc + +let ballot_from_unregistered_delegate loc = function + | [Environment.Ecoproto_error (Ballot_from_unregistered_delegate _)] -> + return_unit + | err -> wrong_error "Ballot_from_unregistered_delegate" err loc + +let source_not_in_vote_listings loc = function + | [Environment.Ecoproto_error Source_not_in_vote_listings] -> return_unit + | err -> wrong_error "Source_not_in_vote_listings" err loc + +let empty_proposals loc = function + | [Environment.Ecoproto_error Empty_proposals] -> return_unit + | err -> wrong_error "Empty_proposals" err loc + +let proposals_contain_duplicate duplicate_proposal loc = function + | [Environment.Ecoproto_error (Proposals_contain_duplicate {proposal})] -> + Assert.equal_protocol_hash + ~loc:(append_loc ~caller_loc:loc __LOC__) + proposal + duplicate_proposal + | err -> wrong_error "Proposals_contain_duplicate" err loc + +let too_many_proposals loc = function + | [Environment.Ecoproto_error (Too_many_proposals _)] -> return_unit + | err -> wrong_error "Too_many_proposals" err loc + +let already_proposed already_proposed_proposal loc = function + | [Environment.Ecoproto_error (Already_proposed {proposal; _})] -> + Assert.equal_protocol_hash + ~loc:(append_loc ~caller_loc:loc __LOC__) + proposal + already_proposed_proposal + | err -> wrong_error "Already_proposed" err loc + +let conflicting_proposals loc = function + | [Environment.Ecoproto_error (Conflicting_proposals _)] -> return_unit + | err -> wrong_error "Conflicting_proposals" err loc + +let ballot_for_wrong_proposal ~current_proposal ~op_proposal loc = function + | [ + Environment.Ecoproto_error (Ballot_for_wrong_proposal {current; submitted}); + ] -> + let open Lwt_result_syntax in + let* () = + Assert.equal_protocol_hash + ~loc:(append_loc ~caller_loc:loc __LOC__) + current_proposal + current + in + Assert.equal_protocol_hash + ~loc:(append_loc ~caller_loc:loc __LOC__) + op_proposal + submitted + | err -> wrong_error "Ballot_for_wrong_proposal" err loc + +let already_submitted_a_ballot loc = function + | [Environment.Ecoproto_error Already_submitted_a_ballot] -> return_unit + | err -> wrong_error "Already_submitted_a_ballot" err loc + +let conflicting_ballot loc = function + | [Environment.Ecoproto_error (Conflicting_ballot _)] -> return_unit + | err -> wrong_error "Conflicting_ballot" err loc + +let assert_validate_proposals_fails ~expected_error ~proposer ~proposals ?period + block loc = + let open Lwt_result_syntax in + let* operation = Op.proposals (B block) proposer ?period proposals in + Incremental.assert_validate_operation_fails + (expected_error loc) + operation + block + +let assert_validate_ballot_fails ~expected_error ~voter ~proposal ~ballot + ?period block loc = + let open Lwt_result_syntax in + let* operation = Op.ballot (B block) voter ?period proposal ballot in + Incremental.assert_validate_operation_fails + (expected_error loc) + operation + block + +(** {2 Scenarized tests} *) + +(** A normal and successful vote sequence. *) +let test_successful_vote num_delegates () = + let open Alpha_context in + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, _) -> + (* no ballots in proposal period *) + assert_empty_ballots b __LOC__ >>=? fun () -> + (* Last baked block is first block of period Proposal *) + assert_period + ~expected_kind:Proposal + ~expected_index:0l + ~expected_position:0l + b + __LOC__ + >>=? fun () -> + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* participation EMA starts at initial_participation *) + Context.Vote.get_participation_ema b >>=? fun v -> + Assert.equal_int ~loc:__LOC__ initial_participation (Int32.to_int v) + >>=? fun () -> + (* listings must be populated in proposal period *) + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* beginning of proposal, denoted by _p1; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p1, power_p1) -> + (* no proposals at the beginning of proposal period *) + Context.Vote.get_proposals (B b) >>=? fun ps -> + (if Environment.Protocol_hash.Map.is_empty ps then return_unit + else failwith "%s - Unexpected proposals" __LOC__) + >>=? fun () -> + (* no current proposal during proposal period *) + (Context.Vote.get_current_proposal (B b) >>=? function + | None -> return_unit + | Some _ -> failwith "%s - Unexpected proposal" __LOC__) + >>=? fun () -> + let del1 = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates_p1 0 + in + let del2 = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates_p1 1 + in + let pkh1 = Context.Contract.pkh del1 in + let pkh2 = Context.Contract.pkh del2 in + let pow1 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth power_p1 0 in + let pow2 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth power_p1 1 in + let props = + List.map (fun i -> protos.(i)) (2 -- Constants.max_proposals_per_delegate) + in + Op.proposals (B b) del1 (Tezos_crypto.Protocol_hash.zero :: props) + >>=? fun ops1 -> + Op.proposals (B b) del2 [Tezos_crypto.Protocol_hash.zero] >>=? fun ops2 -> + Block.bake ~operations:[ops1; ops2] b >>=? fun b -> + Context.Delegate.voting_info (B b) pkh1 >>=? fun info1 -> + Context.Delegate.voting_info (B b) pkh2 >>=? fun info2 -> + assert_equal_info + ~loc:__LOC__ + info1 + { + voting_power = Some pow1; + current_ballot = None; + current_proposals = Tezos_crypto.Protocol_hash.zero :: props; + remaining_proposals = 0; + } + >>=? fun () -> + assert_equal_info + ~loc:__LOC__ + info2 + { + voting_power = Some pow2; + current_ballot = None; + current_proposals = [Tezos_crypto.Protocol_hash.zero]; + remaining_proposals = Constants.max_proposals_per_delegate - 1; + } + >>=? fun () -> + (* proposals are now populated *) + Context.Vote.get_proposals (B b) >>=? fun ps -> + (* correctly count the double proposal for zero *) + (let weight = + Int64.add + (WithExceptions.Option.get ~loc:__LOC__ @@ List.nth power_p1 0) + (WithExceptions.Option.get ~loc:__LOC__ @@ List.nth power_p1 1) + in + match Environment.Protocol_hash.(Map.find zero ps) with + | Some v -> + if v = weight then return_unit + else failwith "%s - Wrong count %Ld is not %Ld" __LOC__ v weight + | None -> failwith "%s - Missing proposal" __LOC__) + >>=? fun () -> + (* proposing more than maximum_proposals fails *) + assert_validate_proposals_fails + ~expected_error:too_many_proposals + ~proposer:del1 + ~proposals:(Tezos_crypto.Protocol_hash.zero :: props) + b + __LOC__ + >>=? fun () -> + (* proposing less than one proposal fails *) + assert_validate_proposals_fails + ~expected_error:empty_proposals + ~proposer:del1 + ~proposals:[] + b + __LOC__ + >>=? fun () -> + (* first block of exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* next block is first block of exploration *) + assert_period ~expected_kind:Exploration ~expected_index:1l b __LOC__ + >>=? fun () -> + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* listings must be populated in proposal period before moving to exploration period *) + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* beginning of exploration period, denoted by _p2; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p2, power_p2) -> + (* no proposals during exploration period *) + Context.Vote.get_proposals (B b) >>=? fun ps -> + (if Environment.Protocol_hash.Map.is_empty ps then return_unit + else failwith "%s - Unexpected proposals" __LOC__) + >>=? fun () -> + (* current proposal must be set during exploration period *) + (Context.Vote.get_current_proposal (B b) >>=? function + | Some v -> + if Tezos_crypto.Protocol_hash.(equal zero v) then return_unit + else failwith "%s - Wrong proposal" __LOC__ + | None -> failwith "%s - Missing proposal" __LOC__) + >>=? fun () -> + (* unanimous vote: all delegates --active when p2 started-- vote *) + List.map_es + (fun del -> Op.ballot (B b) del Tezos_crypto.Protocol_hash.zero Vote.Yay) + delegates_p2 + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + Context.Delegate.voting_info (B b) pkh1 >>=? fun info1 -> + assert_equal_info + ~loc:__LOC__ + info1 + { + voting_power = Some pow1; + current_ballot = Some Yay; + current_proposals = []; + remaining_proposals = 0; + } + >>=? fun () -> + (* Submitting a second ballot for [del1] fails (indeed, [del1] + belongs to [delegates_p2], so they have already sent a ballot + during the unanimous vote right above). *) + assert_validate_ballot_fails + ~expected_error:already_submitted_a_ballot + ~voter:del1 + ~proposal:Tezos_crypto.Protocol_hash.zero + ~ballot:Vote.Nay + b + __LOC__ + >>=? fun () -> + (* Allocate votes from weight of active delegates *) + List.fold_left (fun acc v -> Int64.(add v acc)) 0L power_p2 + |> fun power_sum -> + (* # of Yay in ballots matches votes of the delegates *) + assert_ballots Vote.{yay = power_sum; nay = 0L; pass = 0L} b __LOC__ + >>=? fun () -> + (* One Yay ballot per delegate *) + (Context.Vote.get_ballot_list (B b) >>=? function + | [] -> failwith "%s - Unexpected empty ballot list" __LOC__ + | l -> + List.iter_es + (fun delegate -> + let pkh = Context.Contract.pkh delegate in + match List.find_opt (fun (del, _) -> del = pkh) l with + | None -> failwith "%s - Missing delegate" __LOC__ + | Some (_, Vote.Yay) -> return_unit + | Some _ -> failwith "%s - Wrong ballot" __LOC__) + delegates_p2) + >>=? fun () -> + (* skip to cooldown period *) + bake_until_first_block_of_next_period b >>=? fun b -> + assert_period ~expected_index:2l ~expected_kind:Cooldown b __LOC__ + >>=? fun () -> + (* no ballots in cooldown period *) + assert_empty_ballots b __LOC__ >>=? fun () -> + (* listings must be populated in cooldown period before moving to promotion_vote period *) + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* skip to promotion period *) + bake_until_first_block_of_next_period b >>=? fun b -> + assert_period ~expected_kind:Promotion ~expected_index:3l b __LOC__ + >>=? fun () -> + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* period 3 *) + (* listings must be populated in promotion period *) + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* beginning of promotion period, denoted by _p4; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p4, power_p4) -> + (* no proposals during promotion period *) + Context.Vote.get_proposals (B b) >>=? fun ps -> + (if Environment.Protocol_hash.Map.is_empty ps then return_unit + else failwith "%s - Unexpected proposals" __LOC__) + >>=? fun () -> + (* current proposal must be set during promotion period *) + (Context.Vote.get_current_proposal (B b) >>=? function + | Some v -> + if Tezos_crypto.Protocol_hash.(equal zero v) then return_unit + else failwith "%s - Wrong proposal" __LOC__ + | None -> failwith "%s - Missing proposal" __LOC__) + >>=? fun () -> + (* unanimous vote: all delegates --active when p4 started-- vote *) + List.map_es + (fun del -> Op.ballot (B b) del Tezos_crypto.Protocol_hash.zero Vote.Yay) + delegates_p4 + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + List.fold_left (fun acc v -> Int64.(add v acc)) 0L power_p4 + |> fun power_sum -> + (* # of Yays in ballots matches voting power of the delegate *) + assert_ballots Vote.{yay = power_sum; nay = 0L; pass = 0L} b __LOC__ + >>=? fun () -> + (* One Yay ballot per delegate *) + (Context.Vote.get_ballot_list (B b) >>=? function + | [] -> failwith "%s - Unexpected empty ballot list" __LOC__ + | l -> + List.iter_es + (fun delegate -> + let pkh = Context.Contract.pkh delegate in + match List.find_opt (fun (del, _) -> del = pkh) l with + | None -> failwith "%s - Missing delegate" __LOC__ + | Some (_, Vote.Yay) -> return_unit + | Some _ -> failwith "%s - Wrong ballot" __LOC__) + delegates_p4) + >>=? fun () -> + (* skip to end of promotion period and activation*) + bake_until_first_block_of_next_period b >>=? fun b -> + assert_period ~expected_kind:Adoption ~expected_index:4l b __LOC__ + >>=? fun () -> + (* skip to end of Adoption period and bake 1 more to activate *) + bake_until_first_block_of_next_period b >>=? fun b -> + assert_period ~expected_kind:Proposal ~expected_index:5l b __LOC__ + >>=? fun () -> + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> + (* zero is the new protocol (before the vote this value is unset) *) + Context.Vote.get_protocol b >>= fun p -> + Assert.equal + ~loc:__LOC__ + Tezos_crypto.Protocol_hash.equal + "Unexpected proposal" + Tezos_crypto.Protocol_hash.pp + p + Tezos_crypto.Protocol_hash.zero + >>=? fun () -> return_unit + +(* given a list of active delegates, + return the first k active delegates with which one can have quorum, that is: + their voting power divided by the total voting power is bigger than pr_ema_weight/den *) +let get_smallest_prefix_voters_for_quorum active_delegates active_power + participation_ema = + let expected_quorum = expected_qr_num participation_ema in + List.fold_left (fun acc v -> Int64.(add v acc)) 0L active_power + |> fun active_power_sum -> + let rec loop delegates power sum selected = + match (delegates, power) with + | [], [] -> selected + | del :: delegates, del_power :: power -> + if + den * sum + < Float.to_int (expected_quorum *. Int64.to_float active_power_sum) + then + loop delegates power (sum + Int64.to_int del_power) (del :: selected) + else selected + | _, _ -> [] + in + loop active_delegates active_power 0 [] + +let get_expected_participation_ema power voter_power old_participation_ema = + (* formula to compute the updated participation_ema *) + let get_updated_participation_ema old_participation_ema participation = + ((pr_ema_weight * Int32.to_int old_participation_ema) + + (pr_num * participation)) + / den + in + List.fold_left (fun acc v -> Int64.(add v acc)) 0L power |> fun power_sum -> + List.fold_left (fun acc v -> Int64.(add v acc)) 0L voter_power + |> fun voter_power_sum -> + let participation = + Int64.(to_int (div (mul voter_power_sum (of_int percent_mul)) power_sum)) + in + get_updated_participation_ema old_participation_ema participation + +(** If not enough quorum + -- get_updated_participation_ema < pr_ema_weight/den -- + in exploration, go back to proposal period. *) +let test_not_enough_quorum_in_exploration num_delegates () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, delegates) -> + (* proposal period *) + let open Alpha_context in + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + let proposer = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 + in + Op.proposals (B b) proposer [Tezos_crypto.Protocol_hash.zero] + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* skip to exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we moved to an exploration period with one proposal *) + assert_period ~expected_kind:Exploration b __LOC__ >>=? fun () -> + Context.Vote.get_participation_ema b >>=? fun initial_participation_ema -> + (* beginning of exploration period, denoted by _p2; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p2, power_p2) -> + Context.Vote.get_participation_ema b >>=? fun participation_ema -> + get_smallest_prefix_voters_for_quorum delegates_p2 power_p2 participation_ema + |> fun voters -> + (* take the first two voters out so there cannot be quorum *) + let voters_without_quorum = + WithExceptions.Option.get ~loc:__LOC__ @@ List.tl voters + in + get_power b voters_without_quorum __LOC__ + >>=? fun voters_power_in_exploration -> + (* all voters_without_quorum vote, for yays; + no nays, so supermajority is satisfied *) + List.map_es + (fun del -> Op.ballot (B b) del Tezos_crypto.Protocol_hash.zero Vote.Yay) + voters_without_quorum + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* bake to next period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we move back to the proposal period because not enough quorum *) + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + (* check participation_ema update *) + get_expected_participation_ema + power_p2 + voters_power_in_exploration + initial_participation_ema + |> fun expected_participation_ema -> + Context.Vote.get_participation_ema b >>=? fun new_participation_ema -> + (* assert the formula to calculate participation_ema is correct *) + Assert.equal_int + ~loc:__LOC__ + expected_participation_ema + (Int32.to_int new_participation_ema) + >>=? fun () -> return_unit + +(** If not enough quorum + -- get_updated_participation_ema < pr_ema_weight/den -- + In promotion period, go back to proposal period. *) +let test_not_enough_quorum_in_promotion num_delegates () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, delegates) -> + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + let proposer = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 + in + Op.proposals (B b) proposer [Tezos_crypto.Protocol_hash.zero] + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* skip to exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we moved to an exploration period with one proposal *) + assert_period ~expected_kind:Exploration b __LOC__ >>=? fun () -> + (* beginning of exploration period, denoted by _p2; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p2, power_p2) -> + Context.Vote.get_participation_ema b >>=? fun participation_ema -> + get_smallest_prefix_voters_for_quorum delegates_p2 power_p2 participation_ema + |> fun voters -> + let open Alpha_context in + (* all voters vote, for yays; + no nays, so supermajority is satisfied *) + List.map_es + (fun del -> Op.ballot (B b) del Tezos_crypto.Protocol_hash.zero Vote.Yay) + voters + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* skip to first block cooldown period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we move to cooldown because we have supermajority and enough quorum *) + assert_period ~expected_kind:Cooldown b __LOC__ >>=? fun () -> + (* skip to first block of promotion period *) + bake_until_first_block_of_next_period b >>=? fun b -> + assert_period ~expected_kind:Promotion b __LOC__ + (* bake_until_first_block_of_next_period ~offset:1l b + * >>=? fun b -> + * assert_period ~expected_kind:Promotion b __LOC__ *) + >>=? + fun () -> + Context.Vote.get_participation_ema b >>=? fun initial_participation_ema -> + (* beginning of promotion period, denoted by _p4; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p4, power_p4) -> + Context.Vote.get_participation_ema b >>=? fun participation_ema -> + get_smallest_prefix_voters_for_quorum delegates_p4 power_p4 participation_ema + |> fun voters -> + (* take the first voter out so there cannot be quorum *) + let voters_without_quorum = + WithExceptions.Option.get ~loc:__LOC__ @@ List.tl voters + in + get_power b voters_without_quorum __LOC__ >>=? fun voter_power -> + (* all voters_without_quorum vote, for yays; + no nays, so supermajority is satisfied *) + List.map_es + (fun del -> Op.ballot (B b) del Tezos_crypto.Protocol_hash.zero Vote.Yay) + voters_without_quorum + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* skip to end of promotion period *) + bake_until_first_block_of_next_period b >>=? fun b -> + get_expected_participation_ema power_p4 voter_power initial_participation_ema + |> fun expected_participation_ema -> + Context.Vote.get_participation_ema b >>=? fun new_participation_ema -> + (* assert the formula to calculate participation_ema is correct *) + Assert.equal_int + ~loc:__LOC__ + expected_participation_ema + (Int32.to_int new_participation_ema) + >>=? fun () -> + (* we move back to the proposal period because not enough quorum *) + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + assert_listings_not_empty b ~loc:__LOC__ >>=? fun () -> return_unit + +(** Assume the initial balance of accounts allocated by Context.init_n is at + least 4 times the value of the minimal_stake constant. *) +let test_supermajority_in_proposal there_is_a_winner () = + let min_proposal_quorum = 0l in + let initial_balance = 1L in + context_init + ~min_proposal_quorum + ~bootstrap_balances:[initial_balance; initial_balance; initial_balance] + 10 + () + >>=? fun (b, delegates) -> + Context.get_constants (B b) >>=? fun {parametric = {minimal_stake; _}; _} -> + let del1 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 in + let del2 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 1 in + let del3 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 2 in + let pkhs = + List.map (fun del -> Context.Contract.pkh del) [del1; del2; del3] + in + let policy = Block.Excluding pkhs in + Op.transaction + (B b) + (WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 3) + del1 + minimal_stake + >>=? fun op1 -> + Op.transaction + (B b) + (WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 4) + del2 + minimal_stake + >>=? fun op2 -> + (if there_is_a_winner then Test_tez.( *? ) minimal_stake 3L + else + Test_tez.( *? ) minimal_stake 2L + >>? Test_tez.( +? ) (Test_tez.of_mutez_exn initial_balance)) + >>?= fun bal3 -> + Op.transaction + (B b) + (WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 5) + del3 + bal3 + >>=? fun op3 -> + Block.bake ~policy ~operations:[op1; op2; op3] b >>=? fun b -> + bake_until_first_block_of_next_period ~policy b >>=? fun b -> + (* make the proposals *) + Op.proposals (B b) del1 [protos.(0)] >>=? fun ops1 -> + Op.proposals (B b) del2 [protos.(0)] >>=? fun ops2 -> + Op.proposals (B b) del3 [protos.(1)] >>=? fun ops3 -> + Block.bake ~policy ~operations:[ops1; ops2; ops3] b >>=? fun b -> + bake_until_first_block_of_next_period ~policy b >>=? fun b -> + (* we remain in the proposal period when there is no winner, + otherwise we move to the exploration period *) + (if there_is_a_winner then assert_period ~expected_kind:Exploration b __LOC__ + else assert_period ~expected_kind:Proposal b __LOC__) + >>=? fun () -> return_unit + +(** After one voting period, if [has_quorum] then the period kind must + have been the cooldown vote. Otherwise, it should have remained in + place in the proposal period. *) +let test_quorum_in_proposal has_quorum () = + let total_tokens = 32_000_000_000_000L in + let half_tokens = Int64.div total_tokens 2L in + context_init ~bootstrap_balances:[1L; half_tokens; half_tokens] 3 () + >>=? fun (b, delegates) -> + Context.get_constants (B b) + >>=? fun {parametric = {min_proposal_quorum; _}; _} -> + let del1 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 in + let del2 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 1 in + let pkhs = List.map (fun del -> Context.Contract.pkh del) [del1; del2] in + let policy = Block.Excluding pkhs in + let quorum = + if has_quorum then Int64.of_int32 min_proposal_quorum + else Int64.(sub (of_int32 min_proposal_quorum) 10L) + in + let bal = + Int64.(div (mul total_tokens quorum) 100_00L) |> Test_tez.of_mutez_exn + in + Op.transaction (B b) del2 del1 bal >>=? fun op2 -> + Block.bake ~policy ~operation:op2 b >>=? fun b -> + bake_until_first_block_of_next_period b >>=? fun b -> + (* make the proposal *) + Op.proposals (B b) del1 [protos.(0)] >>=? fun operation -> + Block.bake ~policy ~operation b >>=? fun b -> + bake_until_first_block_of_next_period b >>=? fun b -> + (* we remain in the proposal period when there is no quorum, + otherwise we move to the cooldown vote period *) + (if has_quorum then assert_period ~expected_kind:Exploration b __LOC__ + else assert_period ~expected_kind:Proposal b __LOC__) + >>=? fun () -> return_unit + +(** If a supermajority is reached, then the voting period must be + reached. Otherwise, it remains in proposal period. *) +let test_supermajority_in_exploration supermajority () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / 100)) in + context_init ~min_proposal_quorum 100 () >>=? fun (b, delegates) -> + let del1 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 in + let proposal = protos.(0) in + Op.proposals (B b) del1 [proposal] >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + bake_until_first_block_of_next_period b >>=? fun b -> + (* move to exploration *) + assert_period ~expected_kind:Exploration b __LOC__ >>=? fun () -> + (* assert our proposal won *) + (Context.Vote.get_current_proposal (B b) >>=? function + | Some v -> + if Tezos_crypto.Protocol_hash.(equal proposal v) then return_unit + else failwith "%s - Wrong proposal" __LOC__ + | None -> failwith "%s - Missing proposal" __LOC__) + >>=? fun () -> + (* beginning of exploration period, denoted by _p2; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p2, _power_p2) -> + (* supermajority means [num_yays / (num_yays + num_nays) >= s_num / s_den], + which is equivalent with [num_yays >= num_nays * s_num / (s_den - s_num)] *) + let num_delegates = List.length delegates_p2 in + let num_nays = num_delegates / 5 in + (* any smaller number will do as well *) + let num_yays = num_nays * s_num / (s_den - s_num) in + (* majority/minority vote depending on the [supermajority] parameter *) + let num_yays = if supermajority then num_yays else num_yays - 1 in + let open Alpha_context in + let nays_delegates, rest = List.split_n num_nays delegates_p2 in + let yays_delegates, _ = List.split_n num_yays rest in + List.map_es (fun del -> Op.ballot (B b) del proposal Vote.Yay) yays_delegates + >>=? fun operations_yays -> + List.map_es (fun del -> Op.ballot (B b) del proposal Vote.Nay) nays_delegates + >>=? fun operations_nays -> + let operations = operations_yays @ operations_nays in + Block.bake ~operations b >>=? fun b -> + bake_until_first_block_of_next_period b >>=? fun b -> + (if supermajority then assert_period ~expected_kind:Cooldown b __LOC__ + else assert_period ~expected_kind:Proposal b __LOC__) + >>=? fun () -> return_unit + +(** Test also how the selection scales: all delegates propose max + proposals. *) +let test_no_winning_proposal num_delegates () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, _) -> + (* beginning of proposal, denoted by _p1; + take a snapshot of the active delegates and their voting power from listings *) + get_delegates_and_power_from_listings b >>=? fun (delegates_p1, _power_p1) -> + let open Alpha_context in + let props = + List.map (fun i -> protos.(i)) (1 -- Constants.max_proposals_per_delegate) + in + (* all delegates active in p1 propose the same proposals *) + List.map_es (fun del -> Op.proposals (B b) del props) delegates_p1 + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* skip to exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we stay in the same proposal period because no winning proposal *) + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> return_unit + +(** Vote to pass with maximum possible participation_ema (100%), it is + sufficient for the vote quorum to be equal or greater than the + maximum quorum cap. *) +let test_quorum_capped_maximum num_delegates () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, delegates) -> + (* set the participation EMA to 100% *) + Context.Vote.set_participation_ema b 100_00l >>= fun b -> + Context.get_constants (B b) >>=? fun {parametric = {quorum_max; _}; _} -> + (* proposal period *) + let open Alpha_context in + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + (* propose a new protocol *) + let protocol = Tezos_crypto.Protocol_hash.zero in + let proposer = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 + in + Op.proposals (B b) proposer [protocol] >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* skip to exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we moved to an exploration period with one proposal *) + assert_period ~expected_kind:Exploration b __LOC__ >>=? fun () -> + (* take percentage of the delegates equal or greater than quorum_max *) + let minimum_to_pass = + Float.of_int (List.length delegates) + *. Int32.(to_float quorum_max) + /. 100_00. + |> Float.ceil |> Float.to_int + in + let voters = List.take_n minimum_to_pass delegates in + (* all voters vote for yays; no nays, so supermajority is satisfied *) + List.map_es (fun del -> Op.ballot (B b) del protocol Vote.Yay) voters + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* skip to next period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* expect to move to cooldown because we have supermajority and enough quorum *) + assert_period ~expected_kind:Cooldown b __LOC__ + +(** Vote to pass with minimum possible participation_ema (0%), it is + sufficient for the vote quorum to be equal or greater than the + minimum quorum cap. *) +let test_quorum_capped_minimum num_delegates () = + let min_proposal_quorum = Int32.(of_int @@ (100_00 / num_delegates)) in + context_init ~min_proposal_quorum num_delegates () >>=? fun (b, delegates) -> + (* set the participation EMA to 0% *) + Context.Vote.set_participation_ema b 0l >>= fun b -> + Context.get_constants (B b) >>=? fun {parametric = {quorum_min; _}; _} -> + (* proposal period *) + let open Alpha_context in + assert_period ~expected_kind:Proposal b __LOC__ >>=? fun () -> + (* propose a new protocol *) + let protocol = Tezos_crypto.Protocol_hash.zero in + let proposer = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth delegates 0 + in + Op.proposals (B b) proposer [protocol] >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* skip to exploration period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* we moved to an exploration period with one proposal *) + assert_period ~expected_kind:Exploration b __LOC__ >>=? fun () -> + (* take percentage of the delegates equal or greater than quorum_min *) + let minimum_to_pass = + Float.of_int (List.length delegates) + *. Int32.(to_float quorum_min) + /. 100_00. + |> Float.ceil |> Float.to_int + in + let voters = List.take_n minimum_to_pass delegates in + (* all voters vote for yays; no nays, so supermajority is satisfied *) + List.map_es (fun del -> Op.ballot (B b) del protocol Vote.Yay) voters + >>=? fun operations -> + Block.bake ~operations b >>=? fun b -> + (* skip to next period *) + bake_until_first_block_of_next_period b >>=? fun b -> + (* expect to move to cooldown because we have supermajority and enough quorum *) + assert_period ~expected_kind:Cooldown b __LOC__ + +(* gets the voting power *) +let get_voting_power block pkhash = + let ctxt = Context.B block in + Context.get_voting_power ctxt pkhash + +(** Test that the voting power changes if the balance between bakers changes + and the blockchain moves to the next voting period. It also checks that + the total voting power coincides with the addition of the voting powers + of bakers *) +let test_voting_power_updated_each_voting_period () = + let init_bal1 = 80_000_000_000L in + let init_bal2 = 48_000_000_000L in + let init_bal3 = 40_000_000_000L in + (* Create three accounts with different amounts *) + context_init ~bootstrap_balances:[init_bal1; init_bal2; init_bal3] 3 () + >>=? fun (genesis, contracts) -> + let con1 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 in + let con2 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 1 in + let con3 = WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 2 in + (* Get the key hashes of the bakers *) + let baker1 = Context.Contract.pkh con1 in + let baker2 = Context.Contract.pkh con2 in + let baker3 = Context.Contract.pkh con3 in + (* Retrieve balance of con1 *) + let open Test_tez in + Context.Contract.balance (B genesis) con1 >>=? fun balance1 -> + Context.Delegate.current_frozen_deposits (B genesis) baker1 + >>=? fun frozen_deposits1 -> + balance1 +? frozen_deposits1 >>?= fun full_balance1 -> + Assert.equal_tez ~loc:__LOC__ full_balance1 (of_mutez_exn init_bal1) + >>=? fun () -> + (* Retrieve balance of con2 *) + Context.Contract.balance (B genesis) con2 >>=? fun balance2 -> + Context.Delegate.current_frozen_deposits (B genesis) baker2 + >>=? fun frozen_deposits2 -> + balance2 +? frozen_deposits2 >>?= fun full_balance2 -> + Assert.equal_tez ~loc:__LOC__ full_balance2 (of_mutez_exn init_bal2) + >>=? fun () -> + (* Retrieve balance of con3 *) + Context.Contract.balance (B genesis) con3 >>=? fun balance3 -> + Context.Delegate.current_frozen_deposits (B genesis) baker3 + >>=? fun frozen_deposits3 -> + balance3 +? frozen_deposits3 >>?= fun full_balance3 -> + Assert.equal_tez ~loc:__LOC__ full_balance3 (of_mutez_exn init_bal3) + >>=? fun () -> + (* Auxiliary assert_voting_power *) + let assert_voting_power ~loc n block baker = + get_voting_power block baker >>=? fun voting_power -> + Assert.equal_int64 ~loc n voting_power + in + (* Auxiliary assert_total_voting_power *) + let assert_total_voting_power ~loc n block = + Context.get_total_voting_power (B block) >>=? fun total_voting_power -> + Assert.equal_int64 ~loc n total_voting_power + in + let expected_power_of_baker_1 = Tez.to_mutez full_balance1 in + assert_voting_power ~loc:__LOC__ expected_power_of_baker_1 genesis baker1 + >>=? fun () -> + let expected_power_of_baker_2 = Tez.to_mutez full_balance2 in + assert_voting_power ~loc:__LOC__ expected_power_of_baker_2 genesis baker2 + >>=? fun () -> + (* Assert total voting power *) + let expected_power_of_baker_3 = Tez.to_mutez full_balance3 in + assert_total_voting_power + ~loc:__LOC__ + Int64.( + add + (add expected_power_of_baker_1 expected_power_of_baker_2) + expected_power_of_baker_3) + genesis + >>=? fun () -> + (* Create policy that excludes baker1 and baker2 from baking *) + let policy = Block.Excluding [baker1; baker2] in + (* Transfer 30,000 tez from baker1 to baker2 *) + let amount = Tez.of_mutez_exn 30_000_000_000L in + Op.transaction (B genesis) con1 con2 amount >>=? fun operation -> + (* Bake the block containing the transaction *) + Block.bake ~policy ~operation genesis >>=? fun block -> + (* Retrieve balance of con1 *) + Context.Contract.balance (B block) con1 >>=? fun balance1 -> + (* Assert balance has changed by deducing the amount *) + of_mutez_exn init_bal1 -? amount >>?= fun balance1_after_deducing_amount -> + Context.Delegate.current_frozen_deposits (B block) baker1 + >>=? fun frozen_deposit1 -> + balance1_after_deducing_amount -? frozen_deposit1 + >>?= Assert.equal_tez ~loc:__LOC__ balance1 + >>=? fun () -> + (* Retrieve balance of con2 *) + Context.Contract.balance (B block) con2 >>=? fun balance2 -> + (* Assert balance has changed by adding amount *) + of_mutez_exn init_bal2 +? amount >>?= fun balance2_after_adding_amount -> + Context.Delegate.current_frozen_deposits (B block) baker2 + >>=? fun frozen_deposit2 -> + balance2_after_adding_amount -? frozen_deposit2 + >>?= Assert.equal_tez ~loc:__LOC__ balance2 + >>=? fun () -> + Block.bake ~policy block >>=? fun block -> + (* Assert voting power (and total) remains the same before next voting period *) + assert_voting_power ~loc:__LOC__ expected_power_of_baker_1 block baker1 + >>=? fun () -> + assert_voting_power ~loc:__LOC__ expected_power_of_baker_2 block baker2 + >>=? fun () -> + assert_voting_power ~loc:__LOC__ expected_power_of_baker_3 block baker3 + >>=? fun () -> + assert_total_voting_power + ~loc:__LOC__ + Int64.( + add + (add expected_power_of_baker_1 expected_power_of_baker_2) + expected_power_of_baker_3) + block + >>=? fun () -> + bake_until_first_block_of_next_period block >>=? fun block -> + (* Assert voting power of baker1 has decreased by [amount] *) + let expected_power_of_baker_1 = + Int64.sub expected_power_of_baker_1 (Tez.to_mutez amount) + in + assert_voting_power ~loc:__LOC__ expected_power_of_baker_1 block baker1 + >>=? fun () -> + (* Assert voting power of baker2 has increased by [amount] *) + let expected_power_of_baker_2 = + Int64.add expected_power_of_baker_2 (Tez.to_mutez amount) + in + assert_voting_power ~loc:__LOC__ expected_power_of_baker_2 block baker2 + >>=? fun () -> + (* Retrieve voting power of baker3 *) + get_voting_power block baker3 >>=? fun power -> + let power_of_baker_3 = power in + (* Assert total voting power *) + assert_total_voting_power + ~loc:__LOC__ + Int64.( + add + (add expected_power_of_baker_1 expected_power_of_baker_2) + power_of_baker_3) + block + +let test_voting_period_pp () = + let vp = + Voting_period_repr. + { + index = Int32.of_int 123; + kind = Proposal; + start_position = Int32.of_int 321; + } + in + Assert.equal + ~loc:__LOC__ + ( = ) + "Unexpected pretty printing of voting period" + Format.pp_print_string + (Format.asprintf "%a" Voting_period_repr.pp vp) + "index: 123, kind:proposal, start_position: 321" + +(** {2 Validity tests} + + For each vote operation (Proposals and Ballot), we define a serie + of negative tests and a positive test. + + Negative tests target errors that can occur during + application. They check that the appropriate error is triggered. + + If the operation is valid, then its application must succeed when + it is baked into a block. Positive tests observe the effects of the + operation application by comparing the states before and after the + block. *) + +(** {3 Proposal -- Negative tests} *) + +(** Test that a Proposals operation fails when it is unsigned. *) +let test_proposals_missing_signature () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let* contents = Op.proposals_contents (B block) proposer [protos.(0)] in + let op = Op.pack_operation (B block) None contents in + Incremental.assert_validate_operation_fails + (missing_signature __LOC__) + op + block + +(** Test that a Proposals operation fails when its signature is invalid. *) +let test_proposals_invalid_signature () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let* contents = Op.proposals_contents (B block) proposer [protos.(0)] in + let op = + Op.pack_operation (B block) (Some Tezos_crypto.Signature.zero) contents + in + Incremental.assert_validate_operation_fails + (invalid_signature __LOC__) + op + block + +(** Test that a Proposals operation fails when the period index + provided in the operation is not the current voting period index. *) +let test_proposals_wrong_voting_period_index () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let* current_period = Context.Vote.get_current_period (B block) in + let current_index = current_period.voting_period.index in + let op_index = Int32.succ current_index in + assert_validate_proposals_fails + ~expected_error:(wrong_voting_period_index ~current_index ~op_index) + ~proposer + ~proposals:[Tezos_crypto.Protocol_hash.zero] + ~period:op_index + block + __LOC__ + +(** Test that a Proposals operation fails when it occurs in a + non-Proposal voting period. *) +let test_proposals_wrong_voting_period_kind () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let proposal = protos.(0) in + let assert_proposals_fails_with_unexpected_proposal = + assert_validate_proposals_fails + ~expected_error:wrong_voting_period_kind + ~proposer + ~proposals:[proposal] + in + (* End the initial Proposals period with a submitted + proposal, to move on to an Exploration period. *) + let* operation = Op.proposals (B block) proposer [proposal] in + let* block = Block.bake block ~operation in + let* block = bake_until_first_block_of_next_period block in + (* Proposals during Exploration. *) + let* () = assert_period ~expected_kind:Exploration block __LOC__ in + let* () = assert_proposals_fails_with_unexpected_proposal block __LOC__ in + (* End the Exploration period with enough votes to move on to a + Cooldown period. *) + let* operation = Op.ballot (B block) proposer proposal Vote.Yay in + let* block = Block.bake ~operation block in + let* block = bake_until_first_block_of_next_period block in + (* Proposals during Cooldown. *) + let* () = assert_period ~expected_kind:Cooldown block __LOC__ in + let* () = assert_proposals_fails_with_unexpected_proposal block __LOC__ in + (* Proposals during Promotion. *) + let* block = bake_until_first_block_of_next_period block in + let* () = assert_period ~expected_kind:Promotion block __LOC__ in + let* () = assert_proposals_fails_with_unexpected_proposal block __LOC__ in + (* End the Promotion period with enough votes to move on to an + Adoption period. *) + let* operation = Op.ballot (B block) proposer proposal Vote.Yay in + let* block = Block.bake ~operation block in + let* block = bake_until_first_block_of_next_period block in + (* Proposals during Adoption. *) + let* () = assert_period ~expected_kind:Adoption block __LOC__ in + assert_proposals_fails_with_unexpected_proposal block __LOC__ + +(** Test that a Proposals operation fails when the proposer is not in + the vote listings (with the same error, no matter how far the + source is from being a delegate with voting rights). *) +let test_proposals_source_not_in_vote_listings () = + let open Lwt_result_syntax in + (* The chosen [blocks_per_cycle] is an arbitrary value that we will + not reach with the blocks baked in this test. *) + let* block, funder = context_init1 ~blocks_per_cycle:10l () in + let fresh_account = Account.new_account () in + let proposer = Contract.Implicit fresh_account.pkh in + let assert_fails_with_unregistered_delegate block = + assert_validate_proposals_fails + ~expected_error:proposals_from_unregistered_delegate + ~proposer + ~proposals:[Tezos_crypto.Protocol_hash.zero] + block + in + let assert_fails_with_source_not_in_vote_listings block = + assert_validate_proposals_fails + ~expected_error:source_not_in_vote_listings + ~proposer + ~proposals:[Tezos_crypto.Protocol_hash.zero] + block + in + (* Fail when the source has no contract in the storage. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.transaction (B block) funder proposer Tez.one in + let* block = Block.bake block ~operation in + (* Fail when the contract's public key is unreavealed. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.revelation (B block) fresh_account.pk in + let* block = Block.bake block ~operation in + (* Fail when the source is not a delegate. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.delegation (B block) proposer (Some fresh_account.pkh) in + let* block = Block.bake block ~operation in + (* Fail when the source is a delegate, but not yet in the vote listings. *) + assert_fails_with_source_not_in_vote_listings block __LOC__ + +(** Test that a Proposals operation fails when its proposal list is + empty. *) +let test_empty_proposals () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + assert_validate_proposals_fails + ~expected_error:empty_proposals + ~proposer + ~proposals:[] + block + __LOC__ + +(** Test that a Proposals operation fails when its proposal list + contains multiple occurrences of the same proposal. *) +let test_proposals_contain_duplicate () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + assert_validate_proposals_fails + ~expected_error:(proposals_contain_duplicate protos.(1)) + ~proposer + ~proposals:[protos.(0); protos.(1); protos.(2); protos.(1); protos.(3)] + block + __LOC__ + +(** Test that a Proposals operation fails when it would make the total + count of proposals submitted by the proposer exceed the + [max_proposals_per_delegate] protocol constant. *) +let test_too_many_proposals () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + assert (Array.length protos >= Constants.max_proposals_per_delegate + 1) ; + let proposals = + List.map (Array.get protos) (1 -- Constants.max_proposals_per_delegate) + in + let* operation = Op.proposals (B block) proposer proposals in + let* block = Block.bake block ~operation in + assert_validate_proposals_fails + ~expected_error:too_many_proposals + ~proposer + ~proposals:[protos.(0)] + block + __LOC__ + +(** Test that a Proposals operation fails when one of its proposals has + already been submitted by the same proposer in an earlier block. *) +let test_already_proposed () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let* operation = Op.proposals (B block) proposer [protos.(0); protos.(1)] in + let* block = Block.bake block ~operation in + (* The [proposer] cannot submit protocol [0] again. *) + let* () = + assert_validate_proposals_fails + ~expected_error:(already_proposed protos.(0)) + ~proposer + ~proposals:[protos.(0)] + block + __LOC__ + in + (* The [proposer] cannot submit protocol [1] again, even among other + new proposals. *) + let* () = + assert_validate_proposals_fails + ~expected_error:(already_proposed protos.(1)) + ~proposer + ~proposals:[protos.(2); protos.(1); protos.(3)] + block + __LOC__ + in + (* The initial [operation] cannot be replayed. *) + let* () = + Incremental.assert_validate_operation_fails + (already_proposed protos.(0) __LOC__) + operation + block + in + let* block = bake_until_first_block_of_next_period block in + Incremental.assert_validate_operation_fails + (wrong_voting_period_index ~current_index:1l ~op_index:0l __LOC__) + operation + block + +(** Test that a Proposals operation fails when it would make the total + count of proposals submitted by the proposer exceed the + [max_proposals_per_delegate] protocol constant, because of + previously validated operations in the current block/mempool. *) +let test_conflict_too_many_proposals () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let n_proposals_in_previous_blocks = 5 in + assert (Array.length protos >= Constants.max_proposals_per_delegate + 1) ; + let proposals_in_previous_blocks = + List.map (Array.get protos) (1 -- n_proposals_in_previous_blocks) + in + let* operation = + Op.proposals (B block) proposer proposals_in_previous_blocks + in + let* block = Block.bake block ~operation in + let* current_block_state = Incremental.begin_construction block in + let proposals_in_current_block = + List.map + (Array.get protos) + (n_proposals_in_previous_blocks + 1 + -- Constants.max_proposals_per_delegate) + in + let* op_in_current_block = + Op.proposals (B block) proposer proposals_in_current_block + in + let* current_block_state = + Incremental.validate_operation current_block_state op_in_current_block + in + let* op = Op.proposals (B block) proposer [protos.(0)] in + let* (_i : Incremental.t) = + Incremental.validate_operation + ~expect_failure:(conflicting_proposals __LOC__) + current_block_state + op + in + return_unit + +(** Test that a Proposals operation fails when its source has already + submitted a Proposals operation in the current block/mempool. *) +let test_conflicting_proposal () = + let open Lwt_result_syntax in + let* block, proposer = context_init1 () in + let proposal = protos.(0) in + let* current_block_state = Incremental.begin_construction block in + let* op_in_current_block = Op.proposals (B block) proposer [proposal] in + let* current_block_state = + Incremental.validate_operation current_block_state op_in_current_block + in + let* op = Op.proposals (B block) proposer [proposal] in + let* (_i : Incremental.t) = + Incremental.validate_operation + ~expect_failure:(conflicting_proposals __LOC__) + current_block_state + op + in + let proposal' = protos.(1) in + let* op' = Op.proposals (B block) proposer [proposal'] in + let* (_i : Incremental.t) = + Incremental.validate_operation + ~expect_failure:(conflicting_proposals __LOC__) + current_block_state + op' + in + return_unit + +(** {3 Proposals -- Positive test} + + A Proposals operation is valid when: + + - its source is a registered delegate and belongs to the voting + listings, + + - the current voting period is a Proposal period and has the same + index as the period provided in the operation, + + - its list of proposals is not empty, + + - it won't make the total proposal count of the proposer exceed + the [max_proposals_per_delegate] protocol constant, and + + - its signature is valid. + + We can observe the successful application of the Proposals + operation from a pre-state to a post-state as follows: + + - the proposal count of the proposer has been incremented by the + number of proposals in the operation, + + - the operation proposals have been added to the recorded + proposals of the proposer, and + + - the total weight supporting each of the proposals has been + incremented by the voting power of the proposer. *) + +let observe_proposals pre_state post_state op caller_loc = + let open Lwt_result_syntax in + let make_loc = append_loc ~caller_loc in + let* (Proposals {source; period; proposals}) = + let (Operation_data {contents; _}) = op.protocol_data in + match contents with + | Single (Proposals _ as contents) -> return contents + | _ -> failwith "%s - Expected a Proposals operation" (make_loc __LOC__) + in + + (* Validity conditions *) + let proposals_num = List.length proposals in + let* () = Assert.not_equal_int ~loc:(make_loc __LOC__) 0 proposals_num in + let* () = + assert_period ~expected_kind:Proposal pre_state (make_loc __LOC__) + in + let* pre_period = Context.Vote.get_current_period (B pre_state) in + let* () = + Assert.equal_int32 + ~loc:(make_loc __LOC__) + period + pre_period.voting_period.index + in + let* del = + Context.Contract.delegate (B pre_state) (Contract.Implicit source) + in + let* () = Assert.equal_pkh ~loc:(make_loc __LOC__) source del in + let* dels, _powers = get_delegates_and_power_from_listings pre_state in + assert (List.mem ~equal:Contract.equal (Contract.Implicit source) dels) ; + let* pre_voting_infos = Context.Delegate.voting_info (B pre_state) source in + let* () = + Assert.not_equal_int + ~loc:(make_loc __LOC__) + 0 + pre_voting_infos.remaining_proposals + in + let* () = + Assert.leq_int + ~loc:(make_loc __LOC__) + proposals_num + pre_voting_infos.remaining_proposals + in + + (* Observations *) + (* Check [voting_info] update. *) + let* post_voting_infos = Context.Delegate.voting_info (B post_state) source in + let* () = + Assert.equal_int + ~loc:(make_loc __LOC__) + post_voting_infos.remaining_proposals + (pre_voting_infos.remaining_proposals - proposals_num) + in + assert ( + List.for_all + (fun a -> Stdlib.List.mem a post_voting_infos.current_proposals) + proposals) ; + (* Check [Storage.Vote.Proposals_count] update. *) + let* proposal_count_pre = + Context.Vote.get_delegate_proposal_count (B pre_state) source + in + let* proposal_count_post = + Context.Vote.get_delegate_proposal_count (B post_state) source + in + let* () = + Assert.equal_int + ~loc:(make_loc __LOC__) + (proposal_count_pre + proposals_num) + proposal_count_post + in + (* Check the update of the total weight of supporters for each proposal. *) + let* proposal_weights_pre = Context.Vote.get_proposals (B pre_state) in + let* proposal_weights_post = Context.Vote.get_proposals (B post_state) in + let* source_power = + Assert.get_some ~loc:(make_loc __LOC__) pre_voting_infos.voting_power + in + List.iter_es + (fun proposal -> + let weight_pre = + Environment.Protocol_hash.Map.find proposal proposal_weights_pre + |> Option.value ~default:Int64.zero + in + let* weight_post = + Assert.get_some + ~loc:(make_loc __LOC__) + (Environment.Protocol_hash.Map.find proposal proposal_weights_post) + in + Assert.equal_int64 + ~loc:(make_loc __LOC__) + weight_post + (Int64.add weight_pre source_power)) + proposals + +let test_too_many_proposals_in_one_operation () = + let open Lwt_result_syntax in + let* b0, proposer0 = context_init1 () in + let protos = Array.to_list protos in + Lwt.catch + (fun () -> + let* (_ : packed_operation) = Op.proposals (B b0) proposer0 protos in + failwith + "Encoding of proposals operation with too many proposals should fail") + (function + | Data_encoding.Binary.(Write_error List_invalid_length) -> return_unit + | exn -> Lwt.fail exn) + +(* Bake blocks with various valid Proposals operations, and observe + that their effects are correctly applied. *) +let test_valid_proposals () = + let open Lwt_result_syntax in + (* We use a higher [blocks_per_cycle] than the + {!default_blocks_per_cycle} (which is [4l]), so that we can bake + each operation in a separate block without reaching the end of + the voting cycle. *) + let* b0, (proposer0, proposer1) = context_init2 ~blocks_per_cycle:10l () in + let* op0 = Op.proposals (B b0) proposer0 [protos.(0)] in + let* b1 = Block.bake b0 ~operation:op0 in + let* () = observe_proposals b0 b1 op0 __LOC__ in + let* op1 = + Op.proposals (B b1) proposer0 [protos.(1); protos.(2); protos.(3)] + in + let* b2 = Block.bake b1 ~operation:op1 in + let* () = observe_proposals b1 b2 op1 __LOC__ in + let* op2 = + Op.proposals + (B b2) + proposer1 + [protos.(0); protos.(2); protos.(4); protos.(5)] + in + let* b3 = Block.bake b2 ~operation:op2 in + let* () = observe_proposals b2 b3 op2 __LOC__ in + let* op3 = Op.proposals (B b3) proposer0 [protos.(5); protos.(6)] in + let* b4 = Block.bake b3 ~operation:op3 in + observe_proposals b3 b4 op3 __LOC__ + +(** {3 Ballot -- Negative tests} *) + +(** Test that a Ballot operation fails when it is unsigned. *) +let test_ballot_missing_signature () = + let open Lwt_result_syntax in + let* block, voter, proposal = context_init_exploration () in + let* contents = Op.ballot_contents (B block) voter proposal Vote.Yay in + let op = Op.pack_operation (B block) None contents in + Incremental.assert_validate_operation_fails + (missing_signature __LOC__) + op + block + +(** Test that a Ballot operation fails when its signature is invalid. *) +let test_ballot_invalid_signature () = + let open Lwt_result_syntax in + let* block, voter, proposal = context_init_exploration () in + let* contents = Op.ballot_contents (B block) voter proposal Vote.Yay in + let op = + Op.pack_operation (B block) (Some Tezos_crypto.Signature.zero) contents + in + Incremental.assert_validate_operation_fails + (invalid_signature __LOC__) + op + block + +(** Test that a Ballot operation fails when the period index provided + in the operation is not the current voting period index. *) +let test_ballot_wrong_voting_period_index () = + let open Lwt_result_syntax in + let* block, voter = context_init1 () in + let* current_period = Context.Vote.get_current_period (B block) in + let current_index = current_period.voting_period.index in + let op_index = Int32.succ current_index in + assert_validate_ballot_fails + ~expected_error:(wrong_voting_period_index ~current_index ~op_index) + ~voter + ~proposal:protos.(0) + ~ballot:Vote.Yay + ~period:op_index + block + __LOC__ + +(** Test that a Ballot operation fails when it occurs outside of an + Exploration or Promotion voting period. *) +let test_ballot_wrong_voting_period_kind () = + let open Lwt_result_syntax in + let* block, voter = context_init1 () in + let proposal = protos.(0) in + let assert_ballot_fails_with_unexpected_ballot = + assert_validate_ballot_fails + ~expected_error:wrong_voting_period_kind + ~voter + ~proposal + ~ballot:Vote.Nay + in + (* Ballot during Proposals. *) + let* () = assert_period ~expected_kind:Proposal block __LOC__ in + let* () = assert_ballot_fails_with_unexpected_ballot block __LOC__ in + (* End the Proposals period with a submitted proposal, to move on to + an Exploration period. *) + let* operation = Op.proposals (B block) voter [proposal] in + let* block = Block.bake block ~operation in + let* block = bake_until_first_block_of_next_period block in + (* End the Exploration period with enough votes to move on to a + Cooldown period. *) + let* operation = Op.ballot (B block) voter proposal Vote.Yay in + let* block = Block.bake block ~operation in + let* block = bake_until_first_block_of_next_period block in + (* Ballot during Cooldown. *) + let* () = assert_period ~expected_kind:Cooldown block __LOC__ in + let* () = assert_ballot_fails_with_unexpected_ballot block __LOC__ in + (* End the Cooldown period, then end the Promotion period with + enough votes to move on to an Adoption period. *) + let* block = bake_until_first_block_of_next_period block in + let* operation = Op.ballot (B block) voter proposal Vote.Yay in + let* block = Block.bake ~operation block in + let* block = bake_until_first_block_of_next_period block in + (* Ballot during Adoption. *) + let* () = assert_period ~expected_kind:Adoption block __LOC__ in + assert_ballot_fails_with_unexpected_ballot block __LOC__ + +(** Test that a Ballot operation fails when its proposal is not the + current proposal. *) +let test_ballot_for_wrong_proposal () = + let open Lwt_result_syntax in + let* block, voter, current_proposal = + context_init_exploration ~proposal:protos.(0) () + in + let op_proposal = protos.(1) in + assert_validate_ballot_fails + ~expected_error:(ballot_for_wrong_proposal ~current_proposal ~op_proposal) + ~voter + ~proposal:op_proposal + ~ballot:Vote.Yay + block + __LOC__ + +(** Test that a Ballot operation fails when its source has already + submitted a Ballot. *) +let test_already_submitted_a_ballot () = + let open Lwt_result_syntax in + let* block, voter, proposal = context_init_exploration () in + let* operation = Op.ballot (B block) voter proposal Vote.Yay in + let* block = Block.bake ~operation block in + assert_validate_ballot_fails + ~expected_error:already_submitted_a_ballot + ~voter + ~proposal + ~ballot:Vote.Nay + block + __LOC__ + +(** Test that a Ballot operation fails when its source is not in the + vote listings (with the same error, no matter how far the source is + from being a delegate with voting rights). *) +let test_ballot_source_not_in_vote_listings () = + let open Lwt_result_syntax in + let* block, funder, proposal = + (* The chosen [blocks_per_cycle] is an arbitrary value that we + will not reach with the blocks baked in this test. *) + context_init_exploration ~blocks_per_cycle:10l () + in + let fresh_account = Account.new_account () in + let voter = Contract.Implicit fresh_account.pkh in + let assert_fails_with_source_not_in_vote_listings block = + assert_validate_ballot_fails + ~expected_error:source_not_in_vote_listings + ~voter + ~proposal + ~ballot:Vote.Yay + block + in + let assert_fails_with_unregistered_delegate block = + assert_validate_ballot_fails + ~expected_error:ballot_from_unregistered_delegate + ~voter + ~proposal + ~ballot:Vote.Yay + block + in + (* Fail when the source has no contract in the storage. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.transaction (B block) funder voter Tez.one in + let* block = Block.bake block ~operation in + (* Fail when the contract's public key is unreavealed. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.revelation (B block) fresh_account.pk in + let* block = Block.bake block ~operation in + (* Fail when the source is not a delegate. *) + let* () = assert_fails_with_unregistered_delegate block __LOC__ in + let* operation = Op.delegation (B block) voter (Some fresh_account.pkh) in + let* block = Block.bake block ~operation in + (* Fail when the source is a delegate, but not yet in the vote listings. *) + assert_fails_with_source_not_in_vote_listings block __LOC__ + +(** Test that a Ballot operation fails when its source has already + submitted a Ballot in a previously validated operation of the + current block. *) +let test_conflicting_ballot () = + let open Lwt_result_syntax in + let* block, voter, proposal = context_init_exploration () in + let* current_block_state = Incremental.begin_construction block in + let* op_in_current_block = Op.ballot (B block) voter proposal Vote.Yay in + let* current_block_state = + Incremental.validate_operation current_block_state op_in_current_block + in + let* op = Op.ballot (B block) voter proposal Vote.Nay in + let* (_i : Incremental.t) = + Incremental.validate_operation + ~expect_failure:(conflicting_ballot __LOC__) + current_block_state + op + in + return_unit + +(** {3 Ballot -- Positive test} + + A Ballot operation is valid when: + + - its source is a registered delegate and belongs to the voting + listings, + + - the current voting period is an Exploration or Promotion period, + and has the same index as the period provided in the operation, + + - its proposal is the current proposal in the context, + + - the voter had submitted no ballot in the current voting period + yet, and + + - its signature is valid. + + We can observe the successful application of a Ballot operation by + checking that: + + - the ballot has been recorded for the voter in the post-state, + and + + - the score of the ballot's vote (yay/nay/pass) has been + incremented by the voting power of the source. *) + +let observe_ballot pre_state post_state op caller_loc = + let open Lwt_result_syntax in + let make_loc = append_loc ~caller_loc in + let* (Ballot {source; period; proposal; ballot}) = + let (Operation_data {contents; _}) = op.protocol_data in + match contents with + | Single (Ballot _ as contents) -> return contents + | _ -> failwith "%s - Expected a Ballot operation" (make_loc __LOC__) + in + (* Validity conditions *) + let* () = + assert_period + ~expected_kinds:[Exploration; Promotion] + pre_state + (make_loc __LOC__) + in + let* pre_period = Context.Vote.get_current_period (B pre_state) in + let* () = + Assert.equal_int32 + ~loc:(make_loc __LOC__) + period + pre_period.voting_period.index + in + let* del = + Context.Contract.delegate (B pre_state) (Contract.Implicit source) + in + let* () = Assert.equal_pkh ~loc:(make_loc __LOC__) source del in + let* dels, _powers = get_delegates_and_power_from_listings pre_state in + assert (List.mem ~equal:Contract.equal (Contract.Implicit source) dels) ; + let* pre_voting_infos = Context.Delegate.voting_info (B pre_state) source in + let* () = + Assert.is_none + ~loc:(make_loc __LOC__) + ~pp:(fun fmt _ -> Format.fprintf fmt "Voter already has a ballot.@.") + pre_voting_infos.current_ballot + in + let* current_proposal = Context.Vote.get_current_proposal (B pre_state) in + let* current_proposal = + Assert.get_some ~loc:(make_loc __LOC__) current_proposal + in + assert (Tezos_crypto.Protocol_hash.equal proposal current_proposal) ; + (* Observations *) + let* post_voting_infos = Context.Delegate.voting_info (B post_state) source in + let* recorded_ballot = + Assert.get_some ~loc:(make_loc __LOC__) post_voting_infos.current_ballot + in + let* () = + Assert.equal + ~loc:(make_loc __LOC__) + Vote.equal_ballot + "Wrong ballot recorded" + Vote.pp_ballot + ballot + recorded_ballot + in + let* ballots_pre = Context.Vote.get_ballots (B pre_state) in + let* source_power = + Assert.get_some ~loc:(make_loc __LOC__) pre_voting_infos.voting_power + in + let expected_ballots_post = + match ballot with + | Yay -> {ballots_pre with yay = Int64.add ballots_pre.yay source_power} + | Nay -> {ballots_pre with nay = Int64.add ballots_pre.nay source_power} + | Pass -> {ballots_pre with pass = Int64.add ballots_pre.pass source_power} + in + assert_ballots expected_ballots_post post_state (make_loc __LOC__) + +let test_valid_ballot () = + let open Lwt_result_syntax in + (* The chosen [blocks_per_cycle] is an arbitrary value that we will + not reach with the blocks baked in this test. *) + let* block, delegates = context_init ~blocks_per_cycle:10l 4 () in + let* proposer, voter1, voter2, voter3 = + match delegates with + | [a; b; c; d] -> return (a, b, c, d) + | _ -> failwith "%s@,[context_init n] should return [n] delegates" __LOC__ + in + let proposal = protos.(0) in + let* operation = Op.proposals (B block) proposer [proposal] in + let* block = Block.bake block ~operation in + let* b0 = bake_until_first_block_of_next_period block in + let* operation = Op.ballot (B b0) voter1 proposal Vote.Yay in + let* b1 = Block.bake b0 ~operation in + let* () = observe_ballot b0 b1 operation __LOC__ in + let* operation = Op.ballot (B b1) voter2 proposal Vote.Nay in + let* b2 = Block.bake b1 ~operation in + let* () = observe_ballot b1 b2 operation __LOC__ in + let* operation = Op.ballot (B b2) voter3 proposal Vote.Pass in + let* b3 = Block.bake b2 ~operation in + observe_ballot b2 b3 operation __LOC__ + +let tests = + [ + (* Scenarized tests *) + Tztest.tztest "voting successful_vote" `Quick (test_successful_vote 137); + Tztest.tztest + "voting cooldown, not enough quorum" + `Quick + (test_not_enough_quorum_in_exploration 245); + Tztest.tztest + "voting promotion, not enough quorum" + `Quick + (test_not_enough_quorum_in_promotion 432); + Tztest.tztest + "voting proposal, with supermajority" + `Quick + (test_supermajority_in_proposal true); + Tztest.tztest + "voting proposal, without supermajority" + `Quick + (test_supermajority_in_proposal false); + Tztest.tztest + "voting proposal, with quorum" + `Quick + (test_quorum_in_proposal true); + Tztest.tztest + "voting proposal, without quorum" + `Quick + (test_quorum_in_proposal false); + Tztest.tztest + "voting cooldown, with supermajority" + `Quick + (test_supermajority_in_exploration true); + Tztest.tztest + "voting cooldown, without supermajority" + `Quick + (test_supermajority_in_exploration false); + Tztest.tztest + "voting proposal, no winning proposal" + `Quick + (test_no_winning_proposal 400); + Tztest.tztest + "voting quorum, quorum capped maximum" + `Quick + (test_quorum_capped_maximum 400); + Tztest.tztest + "voting quorum, quorum capped minimum" + `Quick + (test_quorum_capped_minimum 401); + Tztest.tztest + "voting power updated in each voting period" + `Quick + test_voting_power_updated_each_voting_period; + Tztest.tztest "voting period pretty print" `Quick test_voting_period_pp; + (* Validity tests on Proposals *) + Tztest.tztest + "Proposals missing signature" + `Quick + test_proposals_missing_signature; + Tztest.tztest + "Proposals invalid signature" + `Quick + test_proposals_invalid_signature; + Tztest.tztest + "Proposals wrong voting period index" + `Quick + test_proposals_wrong_voting_period_index; + Tztest.tztest + "Proposals wrong voting period kind" + `Quick + test_proposals_wrong_voting_period_kind; + Tztest.tztest + "Proposals source not in vote listings" + `Quick + test_proposals_source_not_in_vote_listings; + Tztest.tztest "Empty proposals" `Quick test_empty_proposals; + Tztest.tztest + "Proposals contain a duplicate proposal" + `Quick + test_proposals_contain_duplicate; + Tztest.tztest + "Too many proposals (over one operation)" + `Quick + test_too_many_proposals_in_one_operation; + Tztest.tztest + "Too many proposals (over two operations)" + `Quick + test_too_many_proposals; + Tztest.tztest + "A proposal had already been proposed" + `Quick + test_already_proposed; + Tztest.tztest + "Conflict: too many proposals in current block/mempool" + `Quick + test_conflict_too_many_proposals; + Tztest.tztest + "Conflicting proposals in current block/mempool" + `Quick + test_conflicting_proposal; + Tztest.tztest "Valid Proposals operations" `Quick test_valid_proposals; + (* Validity tests on Ballot *) + Tztest.tztest + "Ballot missing signature" + `Quick + test_ballot_missing_signature; + Tztest.tztest + "Ballot invalid signature" + `Quick + test_ballot_invalid_signature; + Tztest.tztest + "Ballot wrong voting period index" + `Quick + test_ballot_wrong_voting_period_index; + Tztest.tztest + "Ballot wrong voting period kind" + `Quick + test_ballot_wrong_voting_period_kind; + Tztest.tztest + "Ballot for wrong proposal" + `Quick + test_ballot_for_wrong_proposal; + Tztest.tztest + "Delegate has already submitted a ballot" + `Quick + test_already_submitted_a_ballot; + Tztest.tztest + "Ballot source not in vote listings" + `Quick + test_ballot_source_not_in_vote_listings; + Tztest.tztest + "Conflicting ballot in current block/mempool" + `Quick + test_conflicting_ballot; + Tztest.tztest "Valid Ballot operations" `Quick test_valid_ballot; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml new file mode 100644 index 000000000000..2c0f35f51a8a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml @@ -0,0 +1,1257 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Rollup layer 1 logic + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- test "^zk rollup$" + Subject: Test zk rollup +*) + +open Protocol +open Alpha_context +open Lwt_result_syntax +open Error_monad_operators + +exception Zk_rollup_test_error of string + +(* Number of operations in each private batch *) +let batch_size = 10 + +module Operator = Dummy_zk_rollup.Operator (struct + let batch_size = batch_size +end) + +(* Operation with payload = 1 *) +let true_op l1_dst rollup_id = + Zk_rollup.Operation. + { + op_code = 0; + price = Operator.Internal_for_tests.true_op.price; + l1_dst; + rollup_id; + payload = [|Bls12_381.Fr.one|]; + } + +let of_plonk_smap s = Zk_rollup.Account.SMap.of_seq @@ Plonk.SMap.to_seq s + +(* Operation with payload = 0 *) +let false_op l1_dst rollup_id = + {(true_op l1_dst rollup_id) with payload = [|Bls12_381.Fr.zero|]} + +(** [check_proto_error_f f t] checks that the first error of [t] + satisfies the boolean function [f]. *) +let check_proto_error_f f t = + match t with + | Environment.Ecoproto_error e :: _ when f e -> + Assert.test_error_encodings e ; + return_unit + | _ -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t + +(** [check_proto_error e t] checks that the first error of [t] + equals [e]. *) +let check_proto_error e t = check_proto_error_f (( = ) e) t + +(* Check that originating a ZKRU fails when the feature flag is disabled. *) +let test_disable_feature_flag () = + let* b, contract = + Context.init_with_constants1 + { + Context.default_test_constants with + zk_rollup = + {Context.default_test_constants.zk_rollup with enable = false}; + } + in + let* i = Incremental.begin_construction b in + let* op, _zk_rollup = + Op.zk_rollup_origination + (I i) + contract + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:1 + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_failure: + (check_proto_error Validate_errors.Manager.Zk_rollup_feature_disabled) + i + op + in + return_unit + +(** [context_init n] initializes a context for testing in which the + [zk_rollup_enable] constant is set to true. It returns the created + context and [n] contracts. *) +let context_init = + Context.init_with_constants_n + { + Context.default_test_constants with + zk_rollup = {Context.default_test_constants.zk_rollup with enable = true}; + consensus_threshold = 0; + } + +(* Check that the expected origination fees are paid. *) +let test_origination_fees () = + let* ctxt, contracts = context_init 1 in + let* constants = Context.get_constants (B ctxt) in + let contract = Stdlib.List.hd contracts in + let expected_size = + (* TODO: create ZK constant *) + let origination_size = constants.parametric.tx_rollup.origination_size in + let init_account = + Zk_rollup.Account. + { + static = + { + public_parameters = Operator.public_parameters; + state_length = 1; + circuits_info = of_plonk_smap Operator.circuits; + nb_ops = 1; + }; + dynamic = + { + state = Operator.init_state; + paid_l2_operations_storage_space = Z.of_int origination_size; + used_l2_operations_storage_space = Z.zero; + }; + } + in + let init_pl = Zk_rollup.(Empty {next_index = 0L}) in + origination_size + Zk_rollup.Address.size + + Data_encoding.Binary.length Zk_rollup.Account.encoding init_account + + Data_encoding.Binary.length Zk_rollup.pending_list_encoding init_pl + in + let expected_fees = + Tez.mul_exn constants.parametric.cost_per_byte expected_size + in + let* operation, _rollup = + Op.zk_rollup_origination + (B ctxt) + contract + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:1 + in + let* balance_before = Context.Contract.balance (B ctxt) contract in + let* i = Incremental.begin_construction ctxt in + let* i = Incremental.add_operation i operation in + Assert.balance_was_debited + ~loc:__LOC__ + (I i) + contract + balance_before + expected_fees + +let test_origination_negative_nb_ops () = + let* ctxt, contracts = context_init 1 in + let contract = Stdlib.List.hd contracts in + let* operation, _rollup = + Op.zk_rollup_origination + (B ctxt) + contract + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:(-1) + in + let* i = Incremental.begin_construction ctxt in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup_apply.Zk_rollup_negative_nb_ops) + i + operation + in + return_unit + +(** Initializes the context and originates a ZKRU. *) +let init_and_originate n = + let* ctxt, contracts = context_init n in + let contract = Stdlib.List.hd contracts in + let* operation, rollup = + Op.zk_rollup_origination + (B ctxt) + contract + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:1 + in + let* b = Block.bake ~operation ctxt in + return (b, contracts, rollup) + +let no_ticket op = (op, None) + +(* Checks that originating two ZK rollups leads to different + rollup addresses. *) +let test_originate_two_rollups () = + let* ctxt, contracts, zk_rollup1 = init_and_originate 1 in + let contract = Stdlib.List.hd contracts in + let* operation, zk_rollup2 = + Op.zk_rollup_origination + (B ctxt) + contract + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:1 + in + let* (_b : Block.t) = Block.bake ~operation ctxt in + assert (zk_rollup1 <> zk_rollup2) ; + return_unit + +(* Initializes the context and originates a ZKRU with [n_pending] + operations. *) +let init_with_pending ?(n_pending = 1) n = + let* ctxt, contracts, zk_rollup = init_and_originate n in + let contract = Stdlib.List.hd contracts in + let pkh = match contract with Implicit pkh -> pkh | _ -> assert false in + let* operation = + Op.zk_rollup_publish + (B ctxt) + contract + ~zk_rollup + ~ops: + (Stdlib.List.init n_pending (fun i -> + no_ticket + @@ + if i mod 2 = 0 then false_op pkh zk_rollup + else true_op pkh zk_rollup)) + in + let* b = Block.bake ~operation ctxt in + return (b, contracts, zk_rollup, pkh) + +(* Test for an invalid append: + The operation being appended has an invalid op code. +*) +let test_append_out_of_range_op_code () = + let* ctxt, contracts, zk_rollup = init_and_originate 1 in + let contract = Stdlib.List.hd contracts in + let pkh = match contract with Implicit pkh -> pkh | _ -> assert false in + let l2_op = false_op pkh zk_rollup in + let* i = Incremental.begin_construction ctxt in + let* operation = + Op.zk_rollup_publish + (I i) + contract + ~zk_rollup + ~ops:[no_ticket {l2_op with op_code = 1}] + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error (Zk_rollup_storage.Zk_rollup_invalid_op_code 1)) + i + operation + in + return_unit + +(* Test for an invalid append: + The operation being appended through an external op has positive price. +*) +let test_append_external_deposit () = + let* ctxt, contracts, zk_rollup = init_and_originate 1 in + let contract = Stdlib.List.hd contracts in + let pkh = match contract with Implicit pkh -> pkh | _ -> assert false in + let l2_op = false_op pkh zk_rollup in + let* i = Incremental.begin_construction ctxt in + let* operation = + Op.zk_rollup_publish + (I i) + contract + ~zk_rollup + ~ops: + [no_ticket {l2_op with price = {l2_op.price with amount = Z.of_int 10}}] + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Deposit_as_external) + i + operation + in + return_unit + +(* ------------------------- TESTS WITH TICKETS ------------------------- *) + +(** [make_ticket_key ty contents ticketer zk_rollup] computes the ticket hash + of the ticket containing [contents] of type [ty], crafted by [ticketer] and + owned by [zk_rollup]. *) +let make_ticket_key ctxt ~ty ~contents ~ticketer zk_rollup = + (match ctxt with + | Context.B block -> Incremental.begin_construction block + | Context.I incr -> return incr) + >>=? fun incr -> + let ctxt = Incremental.alpha_ctxt incr in + Script_ir_translator.parse_comparable_ty ctxt ty + >>??= fun (Ex_comparable_ty contents_type, ctxt) -> + Script_ir_translator.parse_comparable_data ctxt contents_type contents + >>=?? fun (contents, ctxt) -> + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Zk_rollup zk_rollup) + (Ticket_token.Ex_token {ticketer; contents_type; contents}) + >|=?? fst + +module Make_ticket (T : sig + val ty_str : string + + type contents + + type contents_type + + val contents_type : contents_type Script_typed_ir.comparable_ty + + val contents_to_micheline : contents -> contents_type + + val contents_to_string : contents -> string +end) (C : sig + val contents : T.contents +end) = +struct + include T + include C + + let ty = Expr.from_string ty_str + + let ex_token ~ticketer = + Ticket_token.Ex_token + {ticketer; contents_type; contents = contents_to_micheline contents} + + let contents_string = contents_to_string contents + + let contents_expr = Expr.from_string contents_string + + let ticket_hash ctxt ~ticketer ~zk_rollup = + make_ticket_key + ctxt + ~ty:(Tezos_micheline.Micheline.root ty) + ~contents:(Tezos_micheline.Micheline.root contents_expr) + ~ticketer + zk_rollup + + let zkru_ticket ~ticketer : Zk_rollup.Ticket.t = + Zk_rollup.Ticket.{contents = contents_expr; ty; ticketer} + + let init_deposit_contract amount block account = + let script = + Format.asprintf + {| parameter (pair address bytes); + storage unit; + code { + # cast the address to contract type + CAR; + UNPAIR; + CONTRACT %%deposit (pair (ticket %s) bytes); + ASSERT_SOME; + SWAP; + PUSH mutez 0; + SWAP; + # create a ticket + PUSH nat %a; + PUSH %s %s; + TICKET; + ASSERT_SOME; + PAIR ; + TRANSFER_TOKENS; + PUSH unit Unit; + NIL operation; + DIG 2 ; + CONS; + PAIR } |} + ty_str + Z.pp_print + amount + ty_str + contents_string + in + Contract_helpers.originate_contract_from_string + ~baker:(Context.Contract.pkh account) + ~source_contract:account + ~script + ~storage:"Unit" + block + + let deposit_op ~block ~zk_rollup ~(zk_op : Zk_rollup.Operation.t) ~account + ~deposit_contract = + let zk_op_literal = + let bytes = + Data_encoding.Binary.to_bytes_exn Zk_rollup.Operation.encoding zk_op + in + let (`Hex hex) = Hex.of_bytes bytes in + "0x" ^ String.uppercase_ascii hex + in + Op.transaction + (B block) + ~entrypoint:Entrypoint.default + ~parameters: + (Script.lazy_expr @@ Expr.from_string + @@ Printf.sprintf + {| Pair %S %s |} + (Zk_rollup.Address.to_b58check zk_rollup) + zk_op_literal) + ~fee:Tez.one + account + deposit_contract + (Tez.of_mutez_exn 0L) + + (** Return an operation to originate a contract that will deposit [amount] + tickets with l2 operation [op] on [zk_rollup] *) + let init_deposit ~block ~amount ~zk_op ~zk_rollup ~account = + init_deposit_contract amount block account + >>=? fun (deposit_contract, _script, block) -> + deposit_op ~block ~zk_rollup ~zk_op ~account ~deposit_contract + >|=? fun op -> (block, op, deposit_contract) +end + +module Nat_ticket = Make_ticket (struct + let ty_str = "nat" + + type contents = int + + type contents_type = Script_int.n Script_int.num + + let contents_type = Script_typed_ir.nat_t + + let contents_to_string = string_of_int + + let contents_to_micheline c = + WithExceptions.Option.get ~loc:__LOC__ @@ Script_int.(of_int c |> is_nat) +end) + +module String_ticket = Make_ticket (struct + let ty_str = "string" + + type contents = string + + type contents_type = Script_string.t + + let contents_type = Script_typed_ir.string_t + + let contents_to_string s = "\"" ^ s ^ "\"" + + let contents_to_micheline c = + WithExceptions.Result.get_ok ~loc:__LOC__ Script_string.(of_string c) +end) + +let test_append_errors () = + let open Zk_rollup.Operation in + (* Create two accounts and 1 zk rollup *) + let* block, contracts, zk_rollup = init_and_originate 2 in + let contract0 = Stdlib.List.nth contracts 0 in + let contract1 = Stdlib.List.nth contracts 1 in + (* Create and originate the deposit contract *) + let module Nat_ticket = Nat_ticket (struct + let contents = 1 + end) in + let* deposit_contract, _script, block = + Nat_ticket.init_deposit_contract (Z.of_int 10) block contract0 + in + (* Preparing operation and ticket for tests *) + let op = + let pkh = match contract0 with Implicit pkh -> pkh | _ -> assert false in + false_op pkh zk_rollup + in + let* ticket_hash = + Nat_ticket.ticket_hash (B block) ~ticketer:deposit_contract ~zk_rollup + in + let ticket = Nat_ticket.zkru_ticket ~ticketer:contract0 in + (* Start generating block *) + let* i = Incremental.begin_construction block in + (* Send ticket but price = 0 *) + let* operation = + let price = {id = ticket_hash; amount = Z.zero} in + Op.zk_rollup_publish + (I i) + contract1 + ~zk_rollup + ~ops:[({op with price}, Some ticket)] + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) + i + operation + in + (* None ticket, price < 0 *) + let* operation = + let price = {id = ticket_hash; amount = Z.of_string "-10"} in + Op.zk_rollup_publish + (I i) + contract1 + ~zk_rollup + ~ops:[no_ticket {op with price}] + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) + i + operation + in + (* Some ticket, price < 0, op.price ≠ hash(ticket, zkru) *) + let* operation = + let price = + { + id = Ticket_hash.of_bytes_exn (Bytes.create 32); + amount = Z.of_string "-10"; + } + in + Op.zk_rollup_publish + (I i) + contract1 + ~zk_rollup + ~ops:[({op with price}, Some ticket)] + in + let* (_i : Incremental.t) = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_ticket) + i + operation + in + return_unit + +let assert_ticket_balance ~loc incr token owner expected = + let ctxt = Incremental.alpha_ctxt incr in + Ticket_balance_key.of_ex_token ctxt ~owner token >>=?? fun (key_hash, ctxt) -> + Ticket_balance.get_balance ctxt key_hash >>=?? fun (balance, _) -> + match (balance, expected) with + | Some b, Some e -> Assert.equal_int ~loc (Z.to_int b) e + | Some b, None -> + failwith "%s: Expected no balance but got some %d" loc (Z.to_int b) + | None, Some b -> failwith "%s: Expected balance %d but got none" loc b + | None, None -> return () + +let test_invalid_deposit () = + (* Create 2 accounts and one zk rollups *) + let* block, contracts, zk_rollup = init_and_originate 5 in + let contract0 = Stdlib.List.nth contracts 0 in + let contract1 = Stdlib.List.nth contracts 1 in + let contract2 = Stdlib.List.nth contracts 2 in + let contract3 = Stdlib.List.nth contracts 3 in + let contract4 = Stdlib.List.nth contracts 4 in + (* Create and originate the deposit contract *) + let module Nat_ticket = Nat_ticket (struct + let contents = 1 + end) in + let* deposit_contract, _script, block = + Nat_ticket.init_deposit_contract (Z.of_int 10) block contract0 + in + let token = Nat_ticket.ex_token ~ticketer:deposit_contract in + (* Generate ticket created by deposit contract and owned by rollup *) + let* ticket_hash = + Nat_ticket.ticket_hash (B block) ~ticketer:deposit_contract ~zk_rollup + in + let pkh = match contract0 with Implicit pkh -> pkh | _ -> assert false in + (* ----- Start generating block *) + let* i = Incremental.begin_construction block in + (* check rollup exists with none of these particular tokens *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- op.price = 0 *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int 0}; + } + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract0 + ~deposit_contract + in + let* i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) + i + operation + in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- hash(ticket, zkru) <> op.price *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = + {id = Ticket_hash.of_bytes_exn (Bytes.create 32); amount = Z.of_int 10}; + } + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract1 + ~deposit_contract + in + let* i = + Incremental.add_operation + i + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_ticket) + operation + in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- op.price <> ticket amount *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int 12}; + } + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract2 + ~deposit_contract + in + let* i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) + i + operation + in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- ticket amount = 0 *) + let* deposit_contract, _script, block = + Nat_ticket.init_deposit_contract (Z.of_int 0) block contract0 + in + (* Create append/deposit operation with ticket *) + let zk_op = + {(false_op pkh zk_rollup) with price = {id = ticket_hash; amount = Z.zero}} + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract3 + ~deposit_contract + in + let* i = Incremental.begin_construction block in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + let* i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error_f (function + | Script_interpreter.Runtime_contract_error _ -> true + | _ -> false)) + i + operation + in + + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- ticket size > Constants.tx_rollup_max_ticket_payload_size *) + (* Contents size is such that, together with the ticketer address, + they exceed the maximum size of an operation *) + let contents_size = 15_000 in + let module String_ticket = String_ticket (struct + let contents = String.make contents_size 'a' + end) in + let* deposit_contract, _script, block = + String_ticket.init_deposit_contract (Z.of_int 10) block contract0 + in + let* ticket_hash = + String_ticket.ticket_hash (B block) ~ticketer:deposit_contract ~zk_rollup + in + let token = String_ticket.ex_token ~ticketer:deposit_contract in + (* Create append/deposit operation with ticket *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int 10}; + } + in + let* operation = + String_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract4 + ~deposit_contract + in + let* i = Incremental.begin_construction block in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + let* limit = + let* constants = Context.get_constants (I i) in + constants.parametric.tx_rollup.max_ticket_payload_size |> return + in + let* (_i : Incremental.t) = + let payload_size = Saturation_repr.safe_int (contents_size + 216) in + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error + (Zk_rollup.Errors.Ticket_payload_size_limit_exceeded + {payload_size; limit})) + i + operation + in + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + return_unit + +(* Test for a valid update: + - 1 private batch of 10 "true" operations + - 1 public "false" operation + On a ZKRU with the initial state and a pending list with + 1 operation ("false"). +*) +let test_update () = + let* b, contracts, zk_rollup, pkh = init_with_pending 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let n_batches = 2 in + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup + ~private_ops: + (Stdlib.List.init n_batches (fun batch -> + Stdlib.List.init batch_size + @@ Fun.const + @@ (if batch mod 2 = 0 then true_op else false_op) pkh zk_rollup)) + [false_op pkh zk_rollup]) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = Incremental.add_operation i operation in + return_unit + +(* Test for an invalid update: + - 1 public "true" operation + On a ZKRU with the initial state and a pending list with + 1 operation ("false"). + The public operation proved is different from the one in the pending list. +*) +let test_update_false_proof () = + let* b, contracts, zk_rollup, pkh = init_with_pending 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + (* Testing with proof on incorrect statement *) + let _, update = + Operator.(craft_update init_state ~zk_rollup [true_op pkh zk_rollup]) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + i + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_verification) + operation + in + (* Testing with proof with incorrect private inputs *) + let update = + let _, Zk_rollup.Update.{pending_pis; private_pis; fee_pi; proof} = + Operator.(craft_update init_state ~zk_rollup [true_op pkh zk_rollup]) + in + let private_pis = List.rev private_pis in + Zk_rollup.Update.{pending_pis; private_pis; fee_pi; proof} + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + i + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_verification) + operation + in + return_unit + +(* Test for an invalid update: + A set of inputs for a public circuit is included in the list of + inputs for private batches. +*) +let test_update_public_in_private () = + let* b, contracts, zk_rollup, pkh = init_with_pending 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.(craft_update init_state ~zk_rollup [true_op pkh zk_rollup]) + in + let update = + (* Circuit ID and inputs for a public circuit, which will be added to the + [private_pis] list *) + let name, op_pi = Stdlib.List.hd update.pending_pis in + { + update with + private_pis = + (name, {new_state = op_pi.new_state; fees = op_pi.fee}) + :: update.private_pis; + } + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + i + ~expect_apply_failure:(check_proto_error Zk_rollup.Errors.Invalid_circuit) + operation + in + return_unit + +(* Test for an invalid update: + Two ZKRUs are originated: [zk_rollup1] and [zk_rollup2]. + An L2 [op] for [zk_rollup2] is appended to [zk_rollup1]'s pending list. + This operation must be discarded, but a malicious validator tries to process + it by making a proof for an update in which [op]'s [rollup_id] is changed + from [zk_rollup2] to [zk_rollup1]. The verification must fail, because + the Protocol uses the actual [op] from the pending list as input. +*) +let test_update_for_another_rollup () = + let* b, contracts, zk_rollup1, pkh = init_with_pending 3 in + let contract0 = Stdlib.List.hd contracts in + let contract1 = Stdlib.List.nth contracts 1 in + let contract2 = Stdlib.List.nth contracts 2 in + let* i = Incremental.begin_construction b in + (* Originate [zk_rollup2] *) + let* operation, zk_rollup2 = + Op.zk_rollup_origination + (I i) + contract0 + ~public_parameters:Operator.public_parameters + ~circuits_info:(of_plonk_smap Operator.circuits) + ~init_state:Operator.init_state + ~nb_ops:1 + in + let* i = Incremental.add_operation i operation in + (* Append to [zk_rollup1] an op for [zk_rollup2] *) + let* operation = + Op.zk_rollup_publish + (I i) + contract1 + ~zk_rollup:zk_rollup1 + ~ops:[no_ticket @@ true_op pkh zk_rollup2] + in + let* i = Incremental.add_operation i operation in + (* Craft the update, changing the "true" op to have zk_rollup1 as + [rollup_id] *) + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup:zk_rollup1 + [false_op pkh zk_rollup1; true_op pkh zk_rollup1]) + in + let* operation = + Op.zk_rollup_update (I i) contract2 ~zk_rollup:zk_rollup1 ~update + in + let* _i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Invalid_verification) + i + operation + in + return_unit + +(* Test for an invalid update: + The update sent by the prover processes more public operations than + those in the pending list. +*) +let test_update_more_public_than_pending () = + (* test with number of pending operations < min_pending_to_process. *) + let* b, contracts, zk_rollup, pkh = init_with_pending 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup + [false_op pkh zk_rollup; true_op pkh zk_rollup]) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup_storage.Zk_rollup_pending_list_too_short) + i + operation + in + (* test with number of pending operations >= min_pending_to_process. *) + let* constants = Context.get_constants (I i) in + let min_pending_to_process = + constants.parametric.zk_rollup.min_pending_to_process + in + let* b, contracts, zk_rollup, pkh = + init_with_pending ~n_pending:min_pending_to_process 1 + in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup + (Stdlib.List.init (min_pending_to_process + 1) (fun i -> + if i mod 2 = 0 then false_op pkh zk_rollup + else true_op pkh zk_rollup))) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup_storage.Zk_rollup_pending_list_too_short) + i + operation + in + return_unit + +(* Test for an invalid update: + The update sent by the prover contains a set of circuit inputs in which + the [new_state] is larger than the ZKRU's [state_length]. +*) +let test_update_inconsistent_state () = + let* b, contracts, zk_rollup, pkh = init_with_pending 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.(craft_update init_state ~zk_rollup [false_op pkh zk_rollup]) + in + let open Zk_rollup.Update in + let update = + { + update with + pending_pis = + List.map + (fun (s, (op_pi : op_pi)) -> + ( s, + { + op_pi with + new_state = Array.append op_pi.new_state op_pi.new_state; + } )) + update.pending_pis; + } + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + ~expect_apply_failure: + (check_proto_error Zk_rollup.Errors.Inconsistent_state_update) + i + operation + in + return_unit + +(* Test for an invalid update: + The update sent by the prover processes fewer pending operations (p.o.) than + allowed (the exact number of p.o. or at least min_pending_to_process). + The pending list has a length of 2, while only 1 is processed. +*) +let test_update_not_enough_pending () = + let* b, contracts, zk_rollup, pkh = init_with_pending ~n_pending:2 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.(craft_update init_state ~zk_rollup [false_op pkh zk_rollup]) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = + Incremental.add_operation + ~expect_apply_failure:(check_proto_error Zk_rollup.Errors.Pending_bound) + i + operation + in + return_unit + +(* Test for a valid update: + The update sent by the prover processes a prefix of the pending list, + of the minimum length allowed. +*) +let test_update_valid_prefix () = + (* Checking when pending list has more than min_pending_to_process *) + let min_pending_to_process = + Context.default_test_constants.zk_rollup.min_pending_to_process + in + let* b, contracts, zk_rollup, pkh = + init_with_pending ~n_pending:(min_pending_to_process + 1) 1 + in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup + (Stdlib.List.init min_pending_to_process (fun i -> + if i mod 2 = 0 then false_op pkh zk_rollup + else true_op pkh zk_rollup))) + in + (* Checking when pending list has less than min_pending_to_process *) + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = Incremental.add_operation i operation in + let* b, contracts, zk_rollup, pkh = init_with_pending ~n_pending:2 1 in + let contract = Stdlib.List.hd contracts in + let* i = Incremental.begin_construction b in + let _, update = + Operator.( + craft_update + init_state + ~zk_rollup + [false_op pkh zk_rollup; true_op pkh zk_rollup]) + in + let* operation = Op.zk_rollup_update (I i) contract ~zk_rollup ~update in + let* _i = Incremental.add_operation i operation in + return_unit + +let test_valid_deposit_and_withdrawal () = + (* Create 2 accounts and one zk rollups *) + let* block, contracts, zk_rollup = init_and_originate 2 in + let contract0 = Stdlib.List.nth contracts 0 in + let contract1 = Stdlib.List.nth contracts 1 in + (* Create and originate the deposit contract *) + let module Nat_ticket = Nat_ticket (struct + let contents = 1 + end) in + let* deposit_contract, _script, block = + Nat_ticket.init_deposit_contract (Z.of_int 10) block contract0 + in + let token = Nat_ticket.ex_token ~ticketer:deposit_contract in + (* Generate ticket created by deposit contract and owned by rollup *) + let* ticket_hash = + Nat_ticket.ticket_hash (B block) ~ticketer:deposit_contract ~zk_rollup + in + let pkh = match contract0 with Implicit pkh -> pkh | _ -> assert false in + (* Create append/deposit operation with ticket *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int 10}; + } + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract0 + ~deposit_contract + in + (* ----- Start generating block *) + let* i = Incremental.begin_construction block in + (* check rollup exists with none of these particular tokens *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- Add deposit operation to block*) + let* i = Incremental.add_operation i operation in + (* check *rollup* has 10 of these particular tokens (deposit has been processed) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) (Some 10) + in + (* check *contract* has no tokens (deposit has been processed) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Contract contract0) None + in + (* Create update operation to process the zk operation (which is a + "deposit-withdrawal" for dummy rollup) *) + let _, update = + Operator.(craft_update init_state ~zk_rollup ~private_ops:[] [zk_op]) + in + let* operation = Op.zk_rollup_update (I i) contract1 ~zk_rollup ~update in + (* ----- Add update operation to block) *) + let* i = Incremental.add_operation i operation in + (* check *rollup* has no tokens (deposit was withdrawn) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* check *contract* has 10 of these particular tokens (deposit was withdrawn) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Contract contract0) (Some 10) + in + return_unit + +let test_valid_deposit_and_external_withdrawal () = + (* Create 2 accounts and one zk rollups *) + let* block, contracts, zk_rollup = init_and_originate 4 in + let contract0 = Stdlib.List.nth contracts 0 in + let contract1 = Stdlib.List.nth contracts 1 in + let contract2 = Stdlib.List.nth contracts 2 in + let contract3 = Stdlib.List.nth contracts 3 in + (* Create and originate the deposit contract *) + let module Nat_ticket = Nat_ticket (struct + let contents = 1 + end) in + let* deposit_contract, _script, block = + Nat_ticket.init_deposit_contract (Z.of_int 10) block contract0 + in + let token = Nat_ticket.ex_token ~ticketer:deposit_contract in + (* Generate ticket created by deposit contract and owned by rollup *) + let* ticket_hash = + Nat_ticket.ticket_hash (B block) ~ticketer:deposit_contract ~zk_rollup + in + let pkh = match contract0 with Implicit pkh -> pkh | _ -> assert false in + (* Create append/deposit operation with ticket *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int 10}; + } + in + let* operation = + Nat_ticket.deposit_op + ~block + ~zk_rollup + ~zk_op + ~account:contract0 + ~deposit_contract + in + (* ----- Start generating block *) + let* i = Incremental.begin_construction block in + (* check rollup exists with none of these particular tokens *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* ----- Add deposit operation to block*) + let* i = Incremental.add_operation i operation in + (* check *rollup* has 10 of these particular tokens (deposit has been processed) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) (Some 10) + in + (* check *contract* has no tokens (deposit has been processed) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Contract contract0) None + in + (* Create update operation to process the zk operation (which is a + "deposit" for dummy rollup) *) + let s, update = + Operator.( + craft_update + init_state + ~zk_rollup + ~private_ops:[] + ~exit_validities:[false] + [zk_op]) + in + let* operation = Op.zk_rollup_update (I i) contract1 ~zk_rollup ~update in + (* ----- Add update operation to block) *) + let* i = Incremental.add_operation i operation in + (* check *rollup* has 10 of these particular tokens (deposit has been processed) *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) (Some 10) + in + (* Create withdrawal operation with ticket *) + let zk_op = + { + (false_op pkh zk_rollup) with + price = {id = ticket_hash; amount = Z.of_int (-10)}; + } + in + let ticket = Nat_ticket.zkru_ticket ~ticketer:deposit_contract in + let* operation = + Op.zk_rollup_publish (I i) contract2 ~zk_rollup ~ops:[(zk_op, Some ticket)] + in + let* i = Incremental.add_operation i operation in + (* Create update to process the withdrawal *) + let _, update = + Operator.( + craft_update s ~zk_rollup ~private_ops:[] ~exit_validities:[true] [zk_op]) + in + let* operation = Op.zk_rollup_update (I i) contract3 ~zk_rollup ~update in + let* i = Incremental.add_operation i operation in + (* check *rollup* has no tokens *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Zk_rollup zk_rollup) None + in + (* check *contract* has 10 of these particular tokens *) + let* () = + assert_ticket_balance ~loc:__LOC__ i token (Contract contract0) (Some 10) + in + return_unit + +let tests = + [ + Tztest.tztest + "check feature flag is disabled" + `Quick + test_disable_feature_flag; + Tztest.tztest "origination fees" `Quick test_origination_fees; + Tztest.tztest "originate two rollups" `Quick test_originate_two_rollups; + Tztest.tztest + "origination negative nb_ops" + `Quick + test_origination_negative_nb_ops; + Tztest.tztest + "append with invalid op code" + `Quick + test_append_out_of_range_op_code; + Tztest.tztest "append external deposit" `Quick test_append_external_deposit; + Tztest.tztest "append check errors" `Quick test_append_errors; + Tztest.tztest "invalid deposit" `Quick test_invalid_deposit; + Tztest.tztest "update" `Quick test_update; + Tztest.tztest "update with false proof" `Quick test_update_false_proof; + Tztest.tztest + "update with invalid circuit" + `Quick + test_update_public_in_private; + Tztest.tztest + "update with op for another rollup" + `Quick + test_update_for_another_rollup; + Tztest.tztest + "update with more public operations than pending" + `Quick + test_update_more_public_than_pending; + Tztest.tztest + "update with inconsistent state" + `Quick + test_update_inconsistent_state; + Tztest.tztest + "update with not enough pending" + `Quick + test_update_not_enough_pending; + Tztest.tztest "update with valid prefix" `Quick test_update_valid_prefix; + Tztest.tztest "valid deposit" `Quick test_valid_deposit_and_withdrawal; + Tztest.tztest + "valid deposit and external withdrawal" + `Quick + test_valid_deposit_and_external_withdrawal; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml new file mode 100644 index 000000000000..cb491d08e30e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml @@ -0,0 +1,201 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trilitech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (baking) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "^constants$" + Subject: the consistency of parametric constants + *) + +open Test_tez + +let test_constants_consistency () = + let open Default_parameters in + List.iter_es + Block.check_constants_consistency + [constants_mainnet; constants_sandbox; constants_test] + +let test_max_operations_ttl () = + let open Protocol in + (* We check the rationale that the value for [max_operations_time_to_live] is the following: + + [minimal_time_between_blocks * max_operations_time_to_live = 3600] *) + let constants = Default_parameters.constants_mainnet in + Environment.wrap_tzresult + (Alpha_context.Period.mult + (Int32.of_int constants.max_operations_time_to_live) + constants.minimal_block_delay) + >>?= fun result -> + Assert.equal + ~loc:__LOC__ + (fun x y -> Alpha_context.Period.compare x y = 0) + "max_operations_ttl" + Alpha_context.Period.pp + Alpha_context.Period.one_hour + result + +(* Check that + [sc_rollup_challenge_window_in_blocks < sc_rollup_max_lookahead_in_blocks] + + Otherwise committers would be forced to commit at an artificially slow rate, affecting + the throughput of the rollup. *) +let test_sc_rollup_challenge_window_lt_max_lookahead () = + let constants = Default_parameters.constants_mainnet in + let max_lookahead = constants.sc_rollup.max_lookahead_in_blocks in + let challenge_window = + Int32.of_int constants.sc_rollup.challenge_window_in_blocks + in + Assert.lt_int32 ~loc:__LOC__ challenge_window max_lookahead + +(* Check that + [commitment_storage_cost * max_lookahead / commitment_period < stake_amount] + + Otherwise storage could be overallocated - since backtracking is not allowed, a staker + can allocated at most [d] nodes (where [d] is the tree depth) - the maximum storage cost + of these commitments must be at most the size of the staker's deposit. *) +let test_sc_rollup_max_commitment_storage_cost_lt_deposit () = + let constants = Default_parameters.constants_mainnet in + let open Protocol in + let cost_per_byte_mutez = + Alpha_context.Tez.to_mutez constants.cost_per_byte + in + let commitment_storage_size = + Int64.of_int Sc_rollup_stake_storage.commitment_storage_size_in_bytes + in + let commitment_storage_cost = + Int64.mul cost_per_byte_mutez commitment_storage_size + in + let max_lookahead = + Int64.of_int32 constants.sc_rollup.max_lookahead_in_blocks + in + let commitment_period = + Int64.of_int constants.sc_rollup.commitment_period_in_blocks + in + let stake_amount = + Alpha_context.Tez.to_mutez constants.sc_rollup.stake_amount + in + Assert.leq_int64 + ~loc:__LOC__ + (Int64.mul + commitment_storage_cost + (Int64.div max_lookahead commitment_period)) + stake_amount + +(* Check that + [{!Sc_rollup_stake_storage.commitment_storage_size_in_bytes} = + commitments_entry_size + commitment_stake_count_entry_size + + commitment_added_entry_size] + + Required to ensure [sc_rollup_stake_amount] and [sc_rollup_max_lookahead] are + correctly scaled with respect to each other - see + {!test_sc_rollup_max_commitment_storage_cost_lt_deposit} +*) +let test_sc_rollup_commitment_storage_size () = + let open Protocol in + Assert.get_some + ~loc:__LOC__ + (Sc_rollup_repr.Number_of_ticks.of_value 1232909L) + >>=? fun number_of_ticks -> + let commitment = + Sc_rollup_commitment_repr.to_versioned + { + predecessor = Sc_rollup_commitment_repr.Hash.zero; + inbox_level = Raw_level_repr.of_int32_exn 21l; + number_of_ticks; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let commitment_bytes = + Data_encoding.Binary.to_bytes_exn + Sc_rollup_commitment_repr.versioned_encoding + commitment + in + let level = Alpha_context.Raw_level.of_int32_exn 5l in + let level_bytes = + Data_encoding.Binary.to_bytes_exn Alpha_context.Raw_level.encoding level + in + (* commitment stake count is encoded in Int32, but is not exposed here *) + let commitment_stake_count = 300l in + let commitment_count_per_level = 3l in + let commitment_stake_count_bytes = + Data_encoding.Binary.to_bytes_exn Data_encoding.int32 commitment_stake_count + in + let commitment_count_per_level_bytes = + Data_encoding.Binary.to_bytes_exn + Data_encoding.int32 + commitment_count_per_level + in + Assert.equal_int + ~loc:__LOC__ + Sc_rollup_stake_storage.commitment_storage_size_in_bytes + (Bytes.length commitment_bytes + + Bytes.length level_bytes + + Bytes.length commitment_stake_count_bytes + + Bytes.length commitment_count_per_level_bytes) + +(** Test that the amount of the liquidity baking subsidy is epsilon smaller than + 1/16th of the maximum reward. *) +let liquidity_baking_subsidy_param () = + let constants = Default_parameters.constants_mainnet in + constants.baking_reward_bonus_per_slot + *? Int64.of_int (constants.consensus_committee_size / 3) + >>?= fun baking_reward_bonus -> + constants.baking_reward_fixed_portion +? baking_reward_bonus + >>?= fun baking_rewards -> + constants.endorsing_reward_per_slot + *? Int64.of_int constants.consensus_committee_size + >>?= fun validators_rewards -> + baking_rewards +? validators_rewards >>?= fun total_rewards -> + total_rewards /? 16L >>?= fun expected_subsidy -> + constants.liquidity_baking_subsidy -? expected_subsidy >>?= fun diff -> + let max_diff = 1000 (* mutez *) in + Assert.leq_int ~loc:__LOC__ (Int64.to_int (to_mutez diff)) max_diff + +let tests = + [ + Tztest.tztest "constants consistency" `Quick test_constants_consistency; + Tztest.tztest "max_operations_ttl" `Quick test_max_operations_ttl; + Tztest.tztest + "sc rollup challenge window less than max lookahead" + `Quick + test_sc_rollup_challenge_window_lt_max_lookahead; + Tztest.tztest + "sc rollup max commitment storage cost less than deposit" + `Quick + test_sc_rollup_max_commitment_storage_cost_lt_deposit; + Tztest.tztest + "sc rollup commitment storage size correct" + `Quick + test_sc_rollup_commitment_storage_size; + Tztest.tztest + "test liquidity_baking_subsidy parameter is 1/16th of total baking \ + rewards" + `Quick + liquidity_baking_subsidy_param; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml new file mode 100644 index 000000000000..789422bbbfa1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml @@ -0,0 +1,699 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (token) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "^frozen bonds" + Subject: Frozen bonds applicable to contracts and part of their stake. +*) + +open Protocol +open Alpha_context +open Test_tez + +let ( >>>=? ) x f = x >|= Environment.wrap_tzresult >>=? f + +let big_random_amount () = + match Tez.of_mutez (Int64.add 1L (Random.int64 10_000L)) with + | None -> assert false + | Some x -> x + +let small_random_amount () = + match Tez.of_mutez (Int64.add 1L (Random.int64 1_000L)) with + | None -> assert false + | Some x -> x + +let very_small_random_amount () = + match Tez.of_mutez (Int64.add 1L (Random.int64 100L)) with + | None -> assert false + | Some x -> x + +let nonce_zero = + Origination_nonce.Internal_for_tests.initial Tezos_crypto.Operation_hash.zero + +let mk_tx_rollup ?(nonce = nonce_zero) () = + ( Tx_rollup.Internal_for_tests.originated_tx_rollup nonce, + Origination_nonce.Internal_for_tests.incr nonce ) + +(** Creates a context with a single account. Returns the context and the public + key hash of the account. *) +let create_context () = + let (Parameters.{public_key_hash; _} as bootstrap_account) = + Account.(new_account () |> make_bootstrap_account) + in + Block.alpha_context [bootstrap_account] >|=? fun ctxt -> + (ctxt, public_key_hash) + +(** Creates a context, a user contract, and a delegate. + Returns the context, the user contract, the user account, and the + delegate's pkh. *) +let init_test ~user_is_delegate = + create_context () >>=? fun (ctxt, _) -> + let delegate, delegate_pk, _ = Tezos_crypto.Signature.generate_key () in + let delegate_contract = Contract.Implicit delegate in + let delegate_account = `Contract (Contract.Implicit delegate) in + let user_contract = + if user_is_delegate then delegate_contract + else + let user, _, _ = Tezos_crypto.Signature.generate_key () in + Contract.Implicit user + in + let user_account = `Contract user_contract in + (* Allocate contracts for user and delegate. *) + let user_balance = big_random_amount () in + Token.transfer ctxt `Minted user_account user_balance >>>=? fun (ctxt, _) -> + let delegate_balance = big_random_amount () in + Token.transfer ctxt `Minted delegate_account delegate_balance + >>>=? fun (ctxt, _) -> + (* Configure delegate, as a delegate by self-delegation, for which + revealing its manager key is a prerequisite. *) + Contract.reveal_manager_key ctxt delegate delegate_pk >>>=? fun ctxt -> + Contract.Delegate.set ctxt delegate_contract (Some delegate) >>>=? fun ctxt -> + return (ctxt, user_contract, user_account, delegate) + +(** Tested scenario : + 1. user contract delegates to 'delegate', + 2. freeze a deposit, + 3. check that staking balance of delegate has not changed, + 4. remove delegation, + 5. check staking balance decreased accordingly, + 6. unfreeze the deposit, + 7. check that staking balance is unchanged, + 8. check that user's balance is unchanged. *) +let test_delegate_then_freeze_deposit () = + init_test ~user_is_delegate:false + >>=? fun (ctxt, user_contract, user_account, delegate) -> + (* Fetch user's initial balance before freeze. *) + Token.balance ctxt user_account >>>=? fun (ctxt, user_balance) -> + (* Let user delegate to "delegate". *) + Contract.Delegate.set ctxt user_contract (Some delegate) >>>=? fun ctxt -> + (* Fetch staking balance after delegation and before freeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance -> + (* Freeze a tx-rollup deposit. *) + let tx_rollup, _ = mk_tx_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let deposit_amount = small_random_amount () in + let deposit_account = `Frozen_bonds (user_contract, bond_id) in + Token.transfer ctxt user_account deposit_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after freeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance' -> + (* Ensure staking balance did not change. *) + Assert.equal_tez ~loc:__LOC__ staking_balance' staking_balance >>=? fun () -> + (* Remove delegation. *) + Contract.Delegate.set ctxt user_contract None >>>=? fun ctxt -> + (* Fetch staking balance after delegation removal. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance'' -> + (* Ensure staking balance decreased by user's initial balance. *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance'' + (staking_balance' -! user_balance) + >>=? fun () -> + (* Unfreeze the deposit. *) + Token.transfer ctxt deposit_account user_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance of delegate. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance''' -> + (* Ensure that staking balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ staking_balance''' staking_balance'' + >>=? fun () -> + (* Fetch user's balance again. *) + Token.balance ctxt user_account >>>=? fun (_, user_balance') -> + (* Ensure user's balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ user_balance' user_balance + +(** Tested scenario: + 1. freeze a deposit, + 2. user contract delegate to 'delegate', + 3. check that staking balance of delegate has increased as expected, + 4. unfreeze the deposit, + 5. check that staking balance has not changed, + 6. remove delegation, + 7. check that staking balance has decreased as expected, + 8. check that the user's balance is unchanged. *) +let test_freeze_deposit_then_delegate () = + init_test ~user_is_delegate:false + >>=? fun (ctxt, user_contract, user_account, delegate) -> + (* Fetch user's initial balance before freeze. *) + Token.balance ctxt user_account >>>=? fun (ctxt, user_balance) -> + (* Freeze a tx-rollup deposit. *) + let tx_rollup, _ = mk_tx_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let deposit_amount = small_random_amount () in + let deposit_account = `Frozen_bonds (user_contract, bond_id) in + Token.transfer ctxt user_account deposit_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Here, user balance has decreased. + Now, fetch staking balance before delegation and after freeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance -> + (* Let user delegate to "delegate". *) + Contract.Delegate.set ctxt user_contract (Some delegate) >>>=? fun ctxt -> + (* Fetch staking balance after delegation. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance' -> + (* ensure staking balance increased by the user's balance. *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance' + (user_balance +! staking_balance) + >>=? fun () -> + (* Unfreeze the deposit. *) + Token.transfer ctxt deposit_account user_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after unfreeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance'' -> + (* Ensure that staking balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ staking_balance'' staking_balance' + >>=? fun () -> + (* Remove delegation. *) + Contract.Delegate.set ctxt user_contract None >>>=? fun ctxt -> + (* Fetch staking balance. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance''' -> + (* Check that staking balance has decreased by the user's initial balance. *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance''' + (staking_balance'' -! user_balance) + >>=? fun () -> + (* Fetch user's balance. *) + Token.balance ctxt user_account >>>=? fun (_, user_balance') -> + (* Ensure user's balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ user_balance' user_balance + +(** Tested scenario: + 1. freeze a deposit (with deposit amount = balance), + 2. check that the user contract is still allocated, + 3. punish the user contract, + 4. check that the user contract is unallocated, except if it's a delegate. *) +let test_allocated_when_frozen_deposits_exists ~user_is_delegate () = + init_test ~user_is_delegate + >>=? fun (ctxt, user_contract, user_account, _delegate) -> + (* Fetch user's initial balance before freeze. *) + Token.balance ctxt user_account >>>=? fun (ctxt, user_balance) -> + Assert.equal_bool ~loc:__LOC__ Tez.(user_balance > zero) true >>=? fun () -> + (* Freeze a tx-rollup deposit. *) + let tx_rollup, _ = mk_tx_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let deposit_amount = user_balance in + let deposit_account = `Frozen_bonds (user_contract, bond_id) in + Token.transfer ctxt user_account deposit_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Check that user contract is still allocated, despite a null balance. *) + Token.balance ctxt user_account >>>=? fun (ctxt, balance) -> + Assert.equal_tez ~loc:__LOC__ balance Tez.zero >>=? fun () -> + Token.allocated ctxt user_account >>>=? fun (ctxt, user_allocated) -> + Token.allocated ctxt deposit_account >>>=? fun (ctxt, dep_allocated) -> + Assert.equal_bool ~loc:__LOC__ (user_allocated && dep_allocated) true + >>=? fun () -> + (* Punish the user contract. *) + Token.transfer ctxt deposit_account `Burned deposit_amount + >>>=? fun (ctxt, _) -> + (* Check that user and deposit accounts have been unallocated. *) + Token.allocated ctxt user_account >>>=? fun (ctxt, user_allocated) -> + Token.allocated ctxt deposit_account >>>=? fun (_, dep_allocated) -> + if user_is_delegate then + Assert.equal_bool ~loc:__LOC__ (user_allocated && not dep_allocated) true + else Assert.equal_bool ~loc:__LOC__ (user_allocated || dep_allocated) false + +(** Tested scenario: + 1. freeze two deposits for the user contract, + 2. check that the stake of the user contract is balance + two deposits, + 3. punish for one of the deposits, + 4. check that the stake of the user contract balance + deposit, + 5. punish for the other deposit, + 6. check that the stake of the user contract is equal to balance. *) +let test_total_stake ~user_is_delegate () = + init_test ~user_is_delegate + >>=? fun (ctxt, user_contract, user_account, _delegate) -> + (* Fetch user's initial balance before freeze. *) + Token.balance ctxt user_account >>>=? fun (ctxt, user_balance) -> + Assert.equal_bool ~loc:__LOC__ Tez.(user_balance > zero) true >>=? fun () -> + (* Freeze 2 tx-rollup deposits. *) + let tx_rollup, nonce = mk_tx_rollup () in + let bond_id1 = Bond_id.Tx_rollup_bond_id tx_rollup in + let tx_rollup, _ = mk_tx_rollup ~nonce () in + let bond_id2 = Bond_id.Tx_rollup_bond_id tx_rollup in + let deposit_amount = small_random_amount () in + let deposit_account1 = `Frozen_bonds (user_contract, bond_id1) in + Token.transfer ctxt user_account deposit_account1 deposit_amount + >>>=? fun (ctxt, _) -> + let deposit_account2 = `Frozen_bonds (user_contract, bond_id2) in + Token.transfer ctxt user_account deposit_account2 deposit_amount + >>>=? fun (ctxt, _) -> + (* Test folding on bond ids. *) + Bond_id.Internal_for_tests.fold_on_bond_ids + ctxt + user_contract + ~init:[] + ~order:`Sorted + ~f:(fun id l -> Lwt.return (id :: l)) + >>= fun bond_ids -> + Assert.assert_equal_list + ~loc:__LOC__ + (fun id1 id2 -> Bond_id.compare id1 id2 = 0) + "Unexpected bond identifiers." + Bond_id.pp + (List.sort Bond_id.compare bond_ids) + (List.sort Bond_id.compare [bond_id1; bond_id2]) + >>=? fun () -> + (* Check that the stake of user contract is balance + two deposits. *) + Contract.get_balance_and_frozen_bonds ctxt user_contract >>>=? fun stake -> + Contract.get_frozen_bonds ctxt user_contract >>>=? fun frozen_bonds -> + Token.balance ctxt user_account >>>=? fun (ctxt, balance) -> + Assert.equal_tez ~loc:__LOC__ (stake -! balance) frozen_bonds >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ (stake -! balance) (deposit_amount *! 2L) + >>=? fun () -> + (* Punish for one deposit. *) + Token.transfer ctxt deposit_account2 `Burned deposit_amount + >>>=? fun (ctxt, _) -> + (* Check that stake of contract is balance + deposit. *) + Contract.get_balance_and_frozen_bonds ctxt user_contract >>>=? fun stake -> + Contract.get_frozen_bonds ctxt user_contract >>>=? fun frozen_bonds -> + Assert.equal_tez ~loc:__LOC__ (stake -! balance) frozen_bonds >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ (stake -! balance) deposit_amount >>=? fun () -> + (* Punish for the other deposit. *) + Token.transfer ctxt deposit_account1 `Burned deposit_amount + >>>=? fun (ctxt, _) -> + (* Check that stake of contract is equal to balance. *) + Contract.get_balance_and_frozen_bonds ctxt user_contract >>>=? fun stake -> + Assert.equal_tez ~loc:__LOC__ stake balance + +let check_delegated_balance_is ctxt ~loc delegate expected_balance = + (* Fetch the delegated balance of d. *) + Delegate.delegated_balance ctxt delegate >>>=? fun delegated_balance -> + (* Check that the delegated balance of [delegate] is as explected. *) + Assert.equal_tez ~loc delegated_balance expected_balance + +(** Tested scenario: + 1. freeze some bonds for the delegate, + 2. check that the delegated balance is null, + 3. let user contract delegate to 'delegate', + 4. check that the staking balance of 'delegate' has increased as expected, + 5. check that the delegated balance of 'delegate' is equal to the balance of the delegator, + 6. unfreeze the bonds, + 7. check that the staking balance has not changed, + 8. check that the delegated balance of 'delegate' is equal to the balance of the delegator, + 9. remove the delegation, + 10. check that staking balance has decreased as expected, + 11. check that the delegated balance is null, + 12. check that the user's balance is unchanged. *) +let test_delegated_balance () = + init_test ~user_is_delegate:false + >>=? fun (ctxt, user_contract, user_account, delegate) -> + let delegate_contract = Contract.Implicit delegate in + let delegate_account = `Contract delegate_contract in + (* Fetch user's initial balance before freeze. *) + Token.balance ctxt user_account >>>=? fun (ctxt, user_balance) -> + (* Fetch staking balance before freeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance -> + (* Freeze a tx-rollup deposit for the delegate. *) + let tx_rollup, _ = mk_tx_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let deposit_amount = small_random_amount () in + let deposit_account = `Frozen_bonds (delegate_contract, bond_id) in + Token.transfer ctxt delegate_account deposit_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Check that the delegated balance of [delegate] is null. *) + check_delegated_balance_is ctxt ~loc:__LOC__ delegate Tez.zero >>=? fun () -> + (* Let user delegate to "delegate". *) + Contract.Delegate.set ctxt user_contract (Some delegate) >>>=? fun ctxt -> + (* Fetch staking balance after delegation. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance' -> + (* ensure staking balance increased by the user's balance. *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance' + (user_balance +! staking_balance) + >>=? fun () -> + (* Check that the delegated balance of [delegate] is equal to [user_balance]. *) + check_delegated_balance_is ctxt ~loc:__LOC__ delegate user_balance + >>=? fun () -> + (* Unfreeze the deposit. *) + Token.transfer ctxt deposit_account delegate_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after unfreeze. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance'' -> + (* Ensure that staking balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ staking_balance'' staking_balance' + >>=? fun () -> + (* Check that the delegated balance of [delegate] is equal to [user_balance]. *) + check_delegated_balance_is ctxt ~loc:__LOC__ delegate user_balance + >>=? fun () -> + (* Remove delegation. *) + Contract.Delegate.set ctxt user_contract None >>>=? fun ctxt -> + (* Fetch staking balance. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance''' -> + (* Check that staking balance has decreased by the user's initial balance. *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance''' + (staking_balance'' -! user_balance) + >>=? fun () -> + (* Check that the delegated balance of [delegate] is null. *) + check_delegated_balance_is ctxt ~loc:__LOC__ delegate Tez.zero >>=? fun () -> + (* Fetch user's balance. *) + Token.balance ctxt user_account >>>=? fun (_, user_balance') -> + (* Ensure user's balance is unchanged. *) + Assert.equal_tez ~loc:__LOC__ user_balance' user_balance + +(** Tests that the rpcs [contract/pkh/frozen_bonds] and + [contract/pkh/balance_and_frozen_bonds] can be called successfully. + These rpcs call the functions [Contract.get_frozen_bonds] and + [Contract.get_balance_and_frozen_bonds] already tested in previous tests. *) +let test_rpcs () = + Context.init1 () >>=? fun (blk, contract) -> + Context.Contract.frozen_bonds (B blk) contract >>=? fun frozen_bonds -> + Assert.equal_tez ~loc:__LOC__ frozen_bonds Tez.zero >>=? fun () -> + Context.Contract.balance_and_frozen_bonds (B blk) contract + >>=? fun balance_and_frozen_bonds -> + Context.Contract.balance (B blk) contract >>=? fun balance -> + Assert.equal_tez ~loc:__LOC__ balance_and_frozen_bonds balance + +(** A helper to test a particular delegation/freezing scenario *) +let test_scenario scenario = + init_test ~user_is_delegate:false + >>=? fun (ctxt, user_contract, user_account, delegate1) -> + let delegate2, delegate_pk2, _ = Tezos_crypto.Signature.generate_key () in + let delegate_contract2 = Contract.Implicit delegate2 in + let delegate_account2 = `Contract delegate_contract2 in + let delegate_balance2 = big_random_amount () in + Token.transfer ctxt `Minted delegate_account2 delegate_balance2 + >>>=? fun (ctxt, _) -> + (* Configure delegate, as a delegate by self-delegation, for which + revealing its manager key is a prerequisite. *) + Contract.reveal_manager_key ctxt delegate2 delegate_pk2 >>>=? fun ctxt -> + Contract.Delegate.set ctxt delegate_contract2 (Some delegate2) + >>>=? fun ctxt -> + let tx_rollup1, nonce = mk_tx_rollup () in + let tx_rollup2, _ = mk_tx_rollup ~nonce () in + let bond_id1 = Bond_id.Tx_rollup_bond_id tx_rollup1 in + let bond_id2 = Bond_id.Tx_rollup_bond_id tx_rollup2 in + let deposit_amount = Tez.of_mutez_exn 1000L in + let deposit_account1 = `Frozen_bonds (user_contract, bond_id1) in + let deposit_account2 = `Frozen_bonds (user_contract, bond_id2) in + let do_delegate ?(delegate = delegate1) ctxt = + (* Fetch staking balance before delegation *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance -> + (* Fetch user's initial balance before delegate. *) + Contract.get_balance_and_frozen_bonds ctxt user_contract + >>>=? fun user_balance -> + (* Let user delegate to "delegate". *) + Contract.Delegate.set ctxt user_contract (Some delegate) >>>=? fun ctxt -> + (* Fetch staking balance after delegation *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance' -> + Assert.equal_tez + ~loc:__LOC__ + staking_balance' + (staking_balance +! user_balance) + >|=? fun () -> (ctxt, user_balance) + in + let do_freeze ?(deposit_account = deposit_account1) ctxt = + (* Fetch staking balance before freeze *) + Delegate.staking_balance ctxt delegate1 >>>=? fun staking_balance1 -> + Delegate.staking_balance ctxt delegate2 >>>=? fun staking_balance2 -> + (* Freeze a tx-rollup deposit. *) + Token.transfer ctxt user_account deposit_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after freeze. *) + Delegate.staking_balance ctxt delegate1 >>>=? fun staking_balance1' -> + Delegate.staking_balance ctxt delegate2 >>>=? fun staking_balance2' -> + (* Ensure staking balance did not change. *) + Assert.equal_tez ~loc:__LOC__ staking_balance1' staking_balance1 + >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ staking_balance2' staking_balance2 + >|=? fun () -> ctxt + in + let do_unfreeze ?(deposit_account = deposit_account1) ctxt = + (* Fetch staking balance before unfreeze *) + Delegate.staking_balance ctxt delegate1 >>>=? fun staking_balance1 -> + Delegate.staking_balance ctxt delegate2 >>>=? fun staking_balance2 -> + (* Unfreeze the deposit *) + Token.transfer ctxt deposit_account user_account deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after unfreeze. *) + Delegate.staking_balance ctxt delegate1 >>>=? fun staking_balance1' -> + Delegate.staking_balance ctxt delegate2 >>>=? fun staking_balance2' -> + (* Ensure staking balance did not change. *) + Assert.equal_tez ~loc:__LOC__ staking_balance1' staking_balance1 + >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ staking_balance2' staking_balance2 + >|=? fun () -> ctxt + in + let do_slash ?(deposit_account = deposit_account1) + ?(current_delegate = Some delegate1) ctxt = + (* Fetch staking balance before slash *) + (match current_delegate with + | None -> return Tez.zero + | Some current_delegate -> Delegate.staking_balance ctxt current_delegate) + >>>=? fun staking_balance -> + (* Slash the deposit *) + Token.transfer + ctxt + deposit_account + `Tx_rollup_rejection_punishments + deposit_amount + >>>=? fun (ctxt, _) -> + (* Fetch staking balance after slash. *) + (match current_delegate with + | None -> return_unit + | Some current_delegate -> + Delegate.staking_balance ctxt current_delegate + >>>=? fun staking_balance' -> + (* Ensure balance slashed *) + Assert.equal_tez + ~loc:__LOC__ + staking_balance' + (staking_balance -! deposit_amount)) + >|=? fun () -> ctxt + in + let do_undelegate ?(delegate = delegate1) ctxt amount = + (* Fetch staking balance before undelegate *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance -> + (* Fetch user's initial balance before undelegate. *) + Token.balance ctxt user_account >>>=? fun (_, user_balance) -> + (* Remove delegation. *) + Contract.Delegate.set ctxt user_contract None >>>=? fun ctxt -> + (* Fetch staking balance after delegation removal. *) + Delegate.staking_balance ctxt delegate >>>=? fun staking_balance' -> + (* Ensure staking balance decreased by delegation amount *) + Assert.equal_tez ~loc:__LOC__ staking_balance' (staking_balance -! amount) + >>=? fun () -> + (* Fetch user's balance again. *) + Token.balance ctxt user_account >>>=? fun (_, user_balance') -> + (* Ensure user's balance unchanged. *) + Assert.equal_tez ~loc:__LOC__ user_balance' user_balance >|=? fun () -> ctxt + in + let initial_ctxt = ctxt in + (* delegate-then-freeze *) + do_delegate ctxt >>=? fun (ctxt, amount_delegated) -> + do_freeze ctxt >>=? fun ctxt -> + scenario + ctxt + ~accounts:(deposit_account1, deposit_account2) + ~delegates:(delegate1, delegate2) + amount_delegated + ~do_delegate + ~do_undelegate + ~do_freeze + ~do_unfreeze + ~do_slash + >>=? fun () -> + (* freeze-then-delegate *) + let ctxt = initial_ctxt in + do_freeze ctxt >>=? fun ctxt -> + do_delegate ctxt >>=? fun (ctxt, amount_delegated) -> + scenario + ctxt + ~accounts:(deposit_account1, deposit_account2) + ~delegates:(delegate1, delegate2) + amount_delegated + ~do_delegate + ~do_undelegate + ~do_freeze + ~do_unfreeze + ~do_slash + +let test_delegate_freeze_unfreeze_undelegate () = + test_scenario + (fun + ctxt + ~accounts:_ + ~delegates:_ + amount_delegated + ~do_delegate:_ + ~do_undelegate + ~do_freeze:_ + ~do_unfreeze + ~do_slash:_ + -> + do_unfreeze ctxt >>=? fun ctxt -> + do_undelegate ctxt amount_delegated >>=? fun (_ : context) -> return_unit) + +let test_delegate_freeze_undelegate_unfreeze () = + test_scenario + (fun + ctxt + ~accounts:_ + ~delegates:_ + amount_delegated + ~do_delegate:_ + ~do_undelegate + ~do_freeze:_ + ~do_unfreeze + ~do_slash:_ + -> + do_undelegate ctxt amount_delegated >>=? fun ctxt -> + do_unfreeze ctxt >>=? fun (_ : context) -> return_unit) + +let test_delegate_double_freeze_undelegate_unfreeze () = + test_scenario + (fun + ctxt + ~accounts:(deposit_account1, deposit_account2) + ~delegates:_ + amount_delegated + ~do_delegate:_ + ~do_undelegate + ~do_freeze + ~do_unfreeze + ~do_slash:_ + -> + do_freeze ~deposit_account:deposit_account2 ctxt >>=? fun ctxt -> + do_undelegate ctxt amount_delegated >>=? fun ctxt -> + do_unfreeze ~deposit_account:deposit_account1 ctxt + >>=? fun (_ : context) -> return_unit) + +let test_delegate_freeze_redelegate_unfreeze () = + test_scenario + (fun + ctxt + ~accounts:_ + ~delegates:(_delegate1, delegate2) + _amount_delegated + ~do_delegate + ~do_undelegate + ~do_freeze:_ + ~do_unfreeze + ~do_slash:_ + -> + do_delegate ~delegate:delegate2 ctxt >>=? fun (ctxt, amount2) -> + do_unfreeze ctxt >>=? fun ctxt -> + do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun (_ : context) -> + return_unit) + +let test_delegate_freeze_unfreeze_freeze_redelegate () = + test_scenario + (fun + ctxt + ~accounts:_ + ~delegates:(_delegate1, delegate2) + _amount_delegated + ~do_delegate + ~do_undelegate + ~do_freeze + ~do_unfreeze + ~do_slash:_ + -> + do_unfreeze ctxt >>=? fun ctxt -> + do_freeze ctxt >>=? fun ctxt -> + do_delegate ~delegate:delegate2 ctxt >>=? fun (ctxt, amount2) -> + do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun (_ : context) -> + return_unit) + +let test_delegate_freeze_slash_undelegate () = + let slash_amount = Tez.of_mutez_exn 1000L in + test_scenario + (fun + ctxt + ~accounts:_ + ~delegates:_ + amount_delegated + ~do_delegate:_ + ~do_undelegate + ~do_freeze:_ + ~do_unfreeze:_ + ~do_slash + -> + do_slash ctxt >>=? fun ctxt -> + do_undelegate ctxt (amount_delegated -! slash_amount) + >>=? fun (_ : context) -> return_unit) + +let tests = + Tztest. + [ + tztest + "frozen bonds - delegate then freeze" + `Quick + test_delegate_then_freeze_deposit; + tztest + "frozen bonds - freeze then delegate" + `Quick + test_freeze_deposit_then_delegate; + tztest + "frozen bonds - contract remains allocated, user is not a delegate" + `Quick + (test_allocated_when_frozen_deposits_exists ~user_is_delegate:false); + tztest + "frozen bonds - contract remains allocated, user is a delegate" + `Quick + (test_allocated_when_frozen_deposits_exists ~user_is_delegate:true); + tztest + "frozen bonds - total stake, user is not a delegate" + `Quick + (test_total_stake ~user_is_delegate:false); + tztest + "frozen bonds - total stake, user is a delegate" + `Quick + (test_total_stake ~user_is_delegate:true); + tztest "frozen bonds - delegated balance" `Quick test_delegated_balance; + tztest "frozen bonds - test rpcs" `Quick test_rpcs; + tztest + "test: delegate, freeze, unfreeze, undelegate" + `Quick + test_delegate_freeze_unfreeze_undelegate; + tztest + "test: delegate, freeze, undelegate, unfreeze" + `Quick + test_delegate_freeze_undelegate_unfreeze; + tztest + "test: delegate, double freeze, undelegate, unfreeze" + `Quick + test_delegate_double_freeze_undelegate_unfreeze; + tztest + "test: delegate, freeze, redelegate, unfreeze" + `Quick + test_delegate_freeze_redelegate_unfreeze; + tztest + "test: delegate, freeze, unfreeze, freeze, redelegate" + `Quick + test_delegate_freeze_unfreeze_freeze_redelegate; + tztest + "test: delegate, freeze, slash, undelegate" + `Quick + test_delegate_freeze_slash_undelegate; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml new file mode 100644 index 000000000000..44a37f8fdc50 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml @@ -0,0 +1,545 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: liquidity baking + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "^liquidity baking$" + Subject: Test liquidity baking subsidies, CPMM storage updates, + and toggle vote. +*) + +open Liquidity_baking_machine +open Protocol +open Test_tez + +let generate_init_state () = + let cpmm_min_xtz_balance = 10_000_000L in + let cpmm_min_tzbtc_balance = 100_000 in + let accounts_balances = + [ + {xtz = 1_000_000L; tzbtc = 1; liquidity = 100}; + {xtz = 1_000L; tzbtc = 1000; liquidity = 100}; + {xtz = 40_000_000L; tzbtc = 350000; liquidity = 300}; + ] + in + ValidationMachine.build + {cpmm_min_xtz_balance; cpmm_min_tzbtc_balance; accounts_balances} + >>=? fun (_, _) -> return_unit + +(* The script hash of + + https://gitlab.com/dexter2tz/dexter2tz/-/blob/d98643881fe14996803997f1283e84ebd2067e35/dexter.liquidity_baking.mligo.tz +*) +let expected_cpmm_hash = + Script_expr_hash.of_b58check_exn + "exprvEBYbxZruLZ9aUDEC9cUxn5KUj361xsaZXGfCxogFoKQ1er9Np" + +(* The script hash of + + https://gitlab.com/dexter2tz/dexter2tz/-/blob/d98643881fe14996803997f1283e84ebd2067e35/lqt_fa12.mligo.tz +*) +let expected_lqt_hash = + Script_expr_hash.of_b58check_exn + "exprufAK15C2FCbxGLCEVXFe26p3eQdYuwZRk1morJUwy9NBUmEZVB" + +(* Test that the scripts of the Liquidity Baking contracts (CPMM and LQT) have the expected hashes. *) +let liquidity_baking_origination () = + Context.init1 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun cpmm_address -> + Context.Contract.script_hash (B blk) cpmm_address >>=? fun cpmm_hash -> + let lqt_address = + Contract_hash.of_b58check_exn "KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + in + Context.Contract.script_hash (B blk) lqt_address >>=? fun lqt_hash -> + Assert.equal + ~loc:__LOC__ + Script_expr_hash.equal + "Unexpected CPMM script." + Script_expr_hash.pp + cpmm_hash + expected_cpmm_hash + >>=? fun () -> + Assert.equal + ~loc:__LOC__ + Script_expr_hash.equal + "Unexpected LQT script." + Script_expr_hash.pp + lqt_hash + expected_lqt_hash + >>=? fun () -> return_unit + +(* Test that the CPMM address in storage is correct *) +let liquidity_baking_cpmm_address () = + Context.init1 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + Assert.equal + ~loc:__LOC__ + String.equal + "CPMM address in storage is incorrect" + Format.pp_print_string + (Contract_hash.to_b58check liquidity_baking) + "KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5" + >>=? fun () -> return_unit + +(* Test that after [n] blocks, the liquidity baking CPMM contract is credited [n] times the subsidy amount. *) +let liquidity_baking_subsidies n () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + let liquidity_baking = Alpha_context.Contract.Originated liquidity_baking in + Context.Contract.balance (B blk) liquidity_baking >>=? fun old_balance -> + Block.bake_n n blk >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + (liquidity_baking_subsidy *? Int64.(of_int n)) >>?= fun expected_credit -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_credit + >>=? fun () -> return_unit + +(* Test that subsidy shuts off at correct level alternating baking + blocks with liquidity_baking_toggle_vote set to [LB_on], [LB_off], and [LB_pass] followed by [bake_after_toggle] blocks with it set to [LB_pass]. *) +(* Expected level is roughly 2*(log(1-1/(2*p)) / log(0.999)) where [p] is the proportion [LB_off / (LB_on + LB_off)]. *) +let liquidity_baking_toggle ~n_vote_on ~n_vote_off ~n_vote_pass expected_level + bake_after () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + let liquidity_baking = Alpha_context.Contract.Originated liquidity_baking in + Context.Contract.balance (B blk) liquidity_baking >>=? fun old_balance -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + let rec bake_stopping blk i = + if i < expected_level then + Block.bake_n ~liquidity_baking_toggle_vote:LB_on n_vote_on blk + >>=? fun blk -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_off n_vote_off blk + >>=? fun blk -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_pass n_vote_pass blk + >>=? fun blk -> + bake_stopping blk (i + n_vote_on + n_vote_off + n_vote_pass) + else return blk + in + bake_stopping blk 0 >>=? fun blk -> + Context.Contract.balance (B blk) liquidity_baking >>=? fun balance -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_pass bake_after blk + >>=? fun blk -> + Assert.balance_is ~loc:__LOC__ (B blk) liquidity_baking balance >>=? fun () -> + liquidity_baking_subsidy *? Int64.of_int (expected_level - 1) + >>?= fun expected_final_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_final_balance + >>=? fun () -> return_unit + +(* 100% of blocks have liquidity_baking_toggle_vote = LB_off *) +let liquidity_baking_toggle_100 n () = + liquidity_baking_toggle ~n_vote_on:0 ~n_vote_off:1 ~n_vote_pass:0 1386 n () + +(* 80% of blocks have liquidity_baking_toggle_vote = LB_off *) +let liquidity_baking_toggle_80 n () = + liquidity_baking_toggle ~n_vote_on:1 ~n_vote_off:4 ~n_vote_pass:0 1963 n () + +(* 60% of blocks have liquidity_baking_toggle_vote = LB_off *) +let liquidity_baking_toggle_60 n () = + liquidity_baking_toggle ~n_vote_on:2 ~n_vote_off:3 ~n_vote_pass:0 3583 n () + +(* 50% of blocks have liquidity_baking_toggle_vote = LB_off. + Subsidy should not be stopped. + Bakes until 100 blocks after the test sunset level of 4096 used in previous protocols. *) +let liquidity_baking_toggle_50 () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + let liquidity_baking = Alpha_context.Contract.Originated liquidity_baking in + Context.Contract.balance (B blk) liquidity_baking >>=? fun old_balance -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + let rec bake_stopping blk i = + if i < 4196 then + Block.bake ~liquidity_baking_toggle_vote:LB_on blk >>=? fun blk -> + Block.bake ~liquidity_baking_toggle_vote:LB_off blk >>=? fun blk -> + bake_stopping blk (i + 2) + else return blk + in + bake_stopping blk 0 >>=? fun blk -> + Context.Contract.balance (B blk) liquidity_baking >>=? fun balance -> + Assert.balance_is ~loc:__LOC__ (B blk) liquidity_baking balance >>=? fun () -> + liquidity_baking_subsidy *? Int64.of_int 4196 + >>?= fun expected_final_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_final_balance + >>=? fun () -> return_unit + +(* Test that the subsidy can restart if LB_on votes regain majority. + Bake n_votes with LB_off, check that the subsidy is paused, bake + n_votes with LB_on, check that the subsidy flows. +*) +let liquidity_baking_restart n_votes n () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + let liquidity_baking = Alpha_context.Contract.Originated liquidity_baking in + Block.bake_n ~liquidity_baking_toggle_vote:LB_off n_votes blk >>=? fun blk -> + Context.Contract.balance (B blk) liquidity_baking + >>=? fun balance_when_paused -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_pass n blk >>=? fun blk -> + Assert.balance_is ~loc:__LOC__ (B blk) liquidity_baking balance_when_paused + >>=? fun () -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_on n_votes blk >>=? fun blk -> + Context.Contract.balance (B blk) liquidity_baking + >>=? fun balance_when_restarted -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_pass n blk >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + liquidity_baking_subsidy *? Int64.of_int n >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + balance_when_restarted + expected_balance + >>=? fun () -> return_unit + +(* Test that the toggle EMA in block metadata is correct. *) +let liquidity_baking_toggle_ema n_vote_on n_vote_off level bake_after + expected_toggle_ema () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + let rec bake_escaping blk i = + if i < level then + Block.bake_n ~liquidity_baking_toggle_vote:LB_on n_vote_on blk + >>=? fun blk -> + Block.bake_n ~liquidity_baking_toggle_vote:LB_off n_vote_off blk + >>=? fun blk -> bake_escaping blk (i + n_vote_on + n_vote_off) + else return blk + in + bake_escaping blk 0 >>=? fun blk -> + (* We only need to return the toggle EMA at the end. *) + Block.bake_n_with_liquidity_baking_toggle_ema bake_after blk + >>=? fun (_blk, toggle_ema) -> + Assert.leq_int + ~loc:__LOC__ + (toggle_ema |> Alpha_context.Liquidity_baking.Toggle_EMA.to_int32 + |> Int32.to_int) + expected_toggle_ema + >>=? fun () -> return_unit + +(* With no bakers setting the toggle vote, EMA should be zero. *) +let liquidity_baking_toggle_ema_zero () = + liquidity_baking_toggle_ema 0 0 0 100 0 () + +(* The EMA should be not much over the threshold after the subsidy has been stopped by a toggle vote. We add 1_000_000 to the constant to give room for the last update. *) +let liquidity_baking_toggle_ema_threshold () = + liquidity_baking_toggle_ema 0 1 1386 1 1_001_000_000 () + +let liquidity_baking_storage n () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + Context.get_liquidity_baking_subsidy (B blk) >>=? fun subsidy -> + let expected_storage = + Expr.from_string + (Printf.sprintf + "Pair 1\n\ + \ %d\n\ + \ 100\n\ + \ \"KT1VqarPDicMFn1ejmQqqshUkUXTCTXwmkCN\"\n\ + \ \"KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo\"" + (100 + (n * Int64.to_int (to_mutez subsidy)))) + in + Block.bake_n n blk >>=? fun blk -> + Context.Contract.storage (B blk) liquidity_baking >>=? fun storage -> + let to_string expr = + Format.asprintf "%a" Michelson_v1_printer.print_expr expr + in + Assert.equal + ~loc:__LOC__ + String.equal + "Storage isn't equal" + Format.pp_print_string + (to_string storage) + (to_string expected_storage) + >>=? fun () -> return_unit + +let liquidity_baking_balance_update () = + Context.init1 ~consensus_threshold:0 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) >>=? fun liquidity_baking -> + Context.get_constants (B blk) >>=? fun csts -> + let subsidy = csts.parametric.liquidity_baking_subsidy in + Block.bake_n_with_all_balance_updates 128 blk + >>=? fun (_blk, balance_updates) -> + let liquidity_baking_updates = + List.filter + (fun el -> + match el with + | ( Alpha_context.Receipt.Contract (Originated contract), + Alpha_context.Receipt.Credited _, + Alpha_context.Receipt.Subsidy ) -> + Contract_hash.(contract = liquidity_baking) + | _ -> false) + balance_updates + in + List.fold_left_e + (fun accum (_, update, _) -> + match update with + | Alpha_context.Receipt.Credited x -> accum +? x + | Alpha_context.Receipt.Debited _ -> assert false) + (of_int 0) + liquidity_baking_updates + >>?= fun credits -> + Assert.equal_int + ~loc:__LOC__ + (Int64.to_int (to_mutez credits)) + (128 * Int64.to_int (to_mutez subsidy)) + >>=? fun () -> return_unit + +let get_cpmm_result results = + match results with + | cpmm_result :: _results -> cpmm_result + | _ -> assert false + +let get_lqt_result results = + match results with + | _cpmm_result :: lqt_result :: _results -> lqt_result + | _ -> assert false + +let get_address_in_result result = + match result with + | Apply_results.Origination_result {originated_contracts; _} -> ( + match originated_contracts with [c] -> c | _ -> assert false) + +let get_balance_updates_in_result result = + match result with + | Apply_results.Origination_result {balance_updates; _} -> balance_updates + +let get_balance_update_in_result result = + match get_balance_updates_in_result result with + | [(Contract _, Credited balance, Protocol_migration)] -> balance + | [_; _; _; _; _; (Contract _, Credited balance, Protocol_migration)] -> + balance + | _ -> assert false + +let liquidity_baking_origination_result_cpmm_address () = + Context.init1 () >>=? fun (blk, _contract) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun cpmm_address_in_storage -> + Block.bake_n_with_origination_results 1 blk + >>=? fun (_blk, origination_results) -> + let result = get_cpmm_result origination_results in + let address = get_address_in_result result in + Assert.equal + ~loc:__LOC__ + Contract_hash.equal + "CPMM address in storage is not the same as in origination result" + Contract_hash.pp + address + cpmm_address_in_storage + >>=? fun () -> return_unit + +let liquidity_baking_origination_result_cpmm_balance () = + Context.init1 () >>=? fun (blk, _contract) -> + Block.bake_n_with_origination_results 1 blk + >>=? fun (_blk, origination_results) -> + let result = get_cpmm_result origination_results in + let balance_update = get_balance_update_in_result result in + Assert.equal_tez ~loc:__LOC__ balance_update (of_mutez_exn 100L) + >>=? fun () -> return_unit + +let liquidity_baking_origination_result_lqt_address () = + Context.init1 () >>=? fun (blk, _contract) -> + Block.bake_n_with_origination_results 1 blk + >>=? fun (_blk, origination_results) -> + let result = get_lqt_result origination_results in + let address = get_address_in_result result in + Assert.equal + ~loc:__LOC__ + String.equal + "LQT address in origination result is incorrect" + Format.pp_print_string + (Contract_hash.to_b58check address) + "KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" + >>=? fun () -> return_unit + +let liquidity_baking_origination_result_lqt_balance () = + Context.init1 () >>=? fun (blk, _contract) -> + Block.bake_n_with_origination_results 1 blk + >>=? fun (_blk, origination_results) -> + let result = get_lqt_result origination_results in + let balance_updates = get_balance_updates_in_result result in + match balance_updates with + | [ + (Liquidity_baking_subsidies, Debited am1, Protocol_migration); + (Storage_fees, Credited am2, Protocol_migration); + (Liquidity_baking_subsidies, Debited am3, Protocol_migration); + (Storage_fees, Credited am4, Protocol_migration); + ] -> + Assert.equal_tez ~loc:__LOC__ am1 am2 >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ am3 am4 >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ am1 (of_mutez_exn 64_250L) >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ am3 (of_mutez_exn 494_500L) + | _ -> failwith "Unexpected balance updates (%s)" __LOC__ + +(* Test that with no contract at the tzBTC address and the level low enough to indicate we're not on mainnet, three contracts are originated in stitching. *) +let liquidity_baking_origination_test_migration () = + Context.init1 () >>=? fun (blk, _contract) -> + Block.bake_n_with_origination_results 1 blk + >>=? fun (_blk, origination_results) -> + let num_results = List.length origination_results in + Assert.equal_int ~loc:__LOC__ num_results 3 + +(* Test that with no contract at the tzBTC address and the level high enough to indicate we could be on mainnet, no contracts are originated in stitching. *) +let liquidity_baking_origination_no_tzBTC_mainnet_migration () = + Context.init1 ~consensus_threshold:0 ~level:1_437_862l () + >>=? fun (blk, _contract) -> + (* By baking a bit we also check that the subsidy application with no CPMM present does nothing rather than stopping the chain.*) + Block.bake_n_with_origination_results 64 blk + >>=? fun (_blk, origination_results) -> + let num_results = List.length origination_results in + Assert.equal_int ~loc:__LOC__ num_results 0 + +let tests = + [ + Tztest.tztest + "test liquidity baking script hashes" + `Quick + liquidity_baking_origination; + Tztest.tztest + "test liquidity baking cpmm is originated at the expected address" + `Quick + liquidity_baking_cpmm_address; + Tztest.tztest "Init Context" `Quick generate_init_state; + Tztest.tztest + "test liquidity baking subsidy is correct" + `Quick + (liquidity_baking_subsidies 64); + Tztest.tztest + "test liquidity baking toggle vote with 100% of bakers voting LB_off \ + baking one block longer" + `Quick + (liquidity_baking_toggle_100 1); + Tztest.tztest + "test liquidity baking toggle vote with 100% of bakers voting LB_off \ + baking two blocks longer" + `Quick + (liquidity_baking_toggle_100 2); + Tztest.tztest + "test liquidity baking toggle vote with 100% of bakers voting LB_off \ + baking 100 blocks longer" + `Quick + (liquidity_baking_toggle_100 100); + Tztest.tztest + "test liquidity baking toggle vote with 80% of bakers voting LB_off \ + baking one block longer" + `Quick + (liquidity_baking_toggle_80 1); + Tztest.tztest + "test liquidity baking toggle vote with 80% of bakers voting LB_off \ + baking two blocks longer" + `Quick + (liquidity_baking_toggle_80 2); + Tztest.tztest + "test liquidity baking toggle vote with 80% of bakers voting LB_off \ + baking 100 blocks longer" + `Quick + (liquidity_baking_toggle_80 100); + Tztest.tztest + "test liquidity baking toggle vote with 60% of bakers voting LB_off \ + baking one block longer" + `Quick + (liquidity_baking_toggle_60 1); + Tztest.tztest + "test liquidity baking toggle vote with 60% of bakers voting LB_off \ + baking two blocks longer" + `Quick + (liquidity_baking_toggle_60 2); + Tztest.tztest + "test liquidity baking toggle vote with 60% of bakers voting LB_off \ + baking 100 blocks longer" + `Quick + (liquidity_baking_toggle_60 100); + Tztest.tztest + "test liquidity baking does not shut off with toggle vote at 50% and \ + baking 100 blocks longer than sunset level in previous protocols" + `Quick + liquidity_baking_toggle_50; + Tztest.tztest + "test a liquidity baking restart with 100% of bakers voting off, then \ + pass, then on" + `Quick + (liquidity_baking_restart 2000 1); + Tztest.tztest + "test liquidity baking toggle ema in block metadata is zero with no \ + bakers voting LB_off." + `Quick + liquidity_baking_toggle_ema_zero; + Tztest.tztest + "test liquidity baking toggle ema is equal to the threshold after the \ + subsidy has been stopped by a toggle vote" + `Quick + liquidity_baking_toggle_ema_threshold; + Tztest.tztest + "test liquidity baking storage is updated" + `Quick + (liquidity_baking_storage 64); + Tztest.tztest + "test liquidity baking balance updates" + `Quick + liquidity_baking_balance_update; + Tztest.tztest + "test liquidity baking CPMM address in storage matches address in the \ + origination result" + `Quick + liquidity_baking_origination_result_cpmm_address; + Tztest.tztest + "test liquidity baking CPMM balance in origination result is 100 mutez" + `Quick + liquidity_baking_origination_result_cpmm_balance; + Tztest.tztest + "test liquidity baking LQT contract is originated at expected address" + `Quick + liquidity_baking_origination_result_lqt_address; + Tztest.tztest + "test liquidity baking LQT balance in origination result is 0 mutez" + `Quick + liquidity_baking_origination_result_lqt_balance; + Tztest.tztest + "test liquidity baking originates three contracts when tzBTC does not \ + exist and level indicates we are not on mainnet" + `Quick + liquidity_baking_origination_test_migration; + Tztest.tztest + "test liquidity baking originates three contracts when tzBTC does not \ + exist and level indicates we might be on mainnet" + `Quick + liquidity_baking_origination_no_tzBTC_mainnet_migration; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_sc_rollup_wasm.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_sc_rollup_wasm.ml new file mode 100644 index 000000000000..b971b3a70cd9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_sc_rollup_wasm.ml @@ -0,0 +1,230 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: sc rollup wasm + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "^sc rollup wasm$" + Subject: Test the WASM 2.0 PVM. +*) + +open Protocol +open Alpha_context +module Context_binary = Tezos_context_memory.Context_binary + +module Tree : + Environment.Context.TREE + with type t = Context_binary.t + and type tree = Context_binary.tree + and type key = string list + and type value = bytes = struct + type t = Context_binary.t + + type tree = Context_binary.tree + + type key = Context_binary.key + + type value = Context_binary.value + + include Context_binary.Tree +end + +module WASM_P : + Protocol.Alpha_context.Sc_rollup.Wasm_2_0_0PVM.P + with type Tree.t = Context_binary.t + and type Tree.tree = Context_binary.tree + and type Tree.key = string list + and type Tree.value = bytes + and type proof = Context_binary.Proof.tree Context_binary.Proof.t = struct + module Tree = Tree + + type tree = Tree.tree + + type proof = Context_binary.Proof.tree Context_binary.Proof.t + + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding + + let kinded_hash_to_state_hash : + Context_binary.Proof.kinded_hash -> Sc_rollup.State_hash.t = function + | `Value hash | `Node hash -> + Sc_rollup.State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context_binary.Proof.before + + let proof_after proof = + kinded_hash_to_state_hash proof.Context_binary.Proof.after + + let produce_proof context tree step = + let open Lwt_syntax in + let* context = Context_binary.add_tree context [] tree in + let* (_hash : Tezos_crypto.Context_hash.t) = + Context_binary.commit ~time:Time.Protocol.epoch context + in + let index = Context_binary.index context in + match Context_binary.Tree.kinded_key tree with + | Some k -> + let* p = Context_binary.produce_tree_proof index k step in + return (Some p) + | None -> + Stdlib.failwith + "produce_proof: internal error, [kinded_key] returned [None]" + + let verify_proof proof step = + let open Lwt_syntax in + let* result = Context_binary.verify_tree_proof proof step in + match result with + | Ok v -> return (Some v) + | Error _ -> + (* We skip the error analysis here since proof verification is not a + job for the rollup node. *) + return None +end + +module Verifier = Alpha_context.Sc_rollup.Wasm_2_0_0PVM.Protocol_implementation + +module Prover = + Alpha_context.Sc_rollup.Wasm_2_0_0PVM.Make + (Environment.Wasm_2_0_0.Make) + (WASM_P) +(* Helpers *) + +(* FIXME: https://gitlab.com/tezos/tezos/-/issues/2198 + SCORU system should expose a constant upper bound for proof size. + One suggestion for this constant is 16KB. Unfortunately, the proof + that are generated in “realistic” scenarios are still too big. + + If #2198 is addressed, and a constant is added to the protocol to + limit the maximum size of a valid SCORU proof, then the value here + should reflect that. *) +let proof_size_limit = 16 * 1024 + +let check_proof_size ~loc context input_opt s = + let open Lwt_result_syntax in + let*! proof = Prover.produce_proof context input_opt s in + match proof with + | Error _ -> Stdlib.failwith "missing proof" + | Ok proof -> + let bytes = + Data_encoding.Binary.to_bytes_exn Prover.proof_encoding proof + in + Assert.leq_int ~loc (Bytes.length bytes) proof_size_limit + +(* Like [eval] but also checks the proof size. *) +let checked_eval ~loc context s = + let open Lwt_result_syntax in + let* () = check_proof_size ~loc context None s in + let*! s = Prover.eval s in + return s + +(* Like [set_input] but also checks the proof size. *) +let checked_set_input ~loc context input s = + let open Lwt_result_syntax in + let* () = check_proof_size ~loc context (Some input) s in + let*! s = Prover.set_input input s in + return s + +let find tree key encoding = + let open Lwt.Syntax in + Format.printf "f %s\n" (String.concat "/" key) ; + let+ value = Context_binary.Tree.find tree key in + match value with + | Some bytes -> + Format.printf "v %S\n" (Bytes.to_string bytes) ; + Some (Data_encoding.Binary.of_bytes_exn encoding bytes) + | None -> None + +let operator = Account.new_account + +let arbitrary_input i payload = + match Sc_rollup.Inbox_message.serialize (External payload) with + | Ok payload -> + Sc_rollup.Inbox_message + { + inbox_level = Raw_level.of_int32_exn 0l; + message_counter = Z.of_int i; + payload; + } + | Error err -> + Format.printf "%a@," Environment.Error_monad.pp_trace err ; + assert false + +(* Read the chosen `wasm_kernel` into memory. *) +let read_kernel name = + let open Tezt.Base in + let kernel_file = + project_root // Filename.dirname __FILE__ // "wasm_kernel" + // (name ^ ".wasm") + in + read_file kernel_file + +(* Kernel with allocation & simple computation only. + 9863 bytes long - will be split into 3 chunks. *) +let computation_kernel () = read_kernel "computation" + +let rec eval_until_set_input context s = + let open Lwt_result_syntax in + let*! info = Prover.get_status s in + match info with + | Computing -> + let* s = checked_eval ~loc:__LOC__ context s in + eval_until_set_input context s + | Waiting_for_reveal _ | Waiting_for_input_message -> return s + +let should_boot_computation_kernel () = + let open Lwt_result_syntax in + let boot_sector = computation_kernel () in + let*! index = Context_binary.init "/tmp" in + let context = Context_binary.empty index in + let empty = Context_binary.Tree.empty context in + let*! s = Prover.initial_state ~empty in + (* sets a reasonable nb-of-tick limit to limit test running time *) + let*! s = + Tree.add + s + ["pvm"; "max_nb_ticks"] + (Data_encoding.Binary.to_bytes_exn Data_encoding.n (Z.of_int 50_000)) + in + let*! s = Prover.install_boot_sector s boot_sector in + (* Feeding it with one input *) + let* s = + checked_set_input ~loc:__LOC__ context (arbitrary_input 0 "test") s + in + (* running until waiting for input *) + let* (_s : Prover.state) = eval_until_set_input context s in + return_unit + +let tests = + [ + Tztest.tztest + "should boot a valid kernel until reading inputs" + `Quick + should_boot_computation_kernel; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml new file mode 100644 index 000000000000..03485707c3ef --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml @@ -0,0 +1,239 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <contact@metastate.ch> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Context Storage + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test storage + Subject: Test the correctnesss of debug message from storage_functor + *) + +open Protocol +open Storage_functors +open Storage_sigs + +module Int32 = struct + type t = int32 + + let encoding = Data_encoding.int32 + + module Index = struct + type t = int + + let path_length = 1 + + let to_path c l = string_of_int c :: l + + let of_path = function + | [] | _ :: _ :: _ -> None + | [c] -> int_of_string_opt c + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = Environment.RPC_arg.int; + encoding = Data_encoding.int31; + compare = Compare.Int.compare; + } + end +end + +module Int64 = struct + type t = int64 + + let encoding = Data_encoding.int64 + + module Index = struct + type t = int64 + + let path_length = 1 + + let to_path c l = Int64.to_string c :: l + + let of_path = function + | [] | _ :: _ :: _ -> None + | [c] -> Int64.of_string_opt c + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = Environment.RPC_arg.int64; + encoding = Data_encoding.int64; + compare = Compare.Int64.compare; + } + end +end + +let create_context name : (module Raw_context.T with type t = Raw_context.t) = + (module Make_subcontext (Registered) (Raw_context) + (struct + let name = [name] + end)) + +let create_subcontext name + (module Context : Raw_context.T with type t = Raw_context.t) : + (module Raw_context.T with type t = Raw_context.t) = + (module Make_subcontext (Registered) (Context) + (struct + let name = [name] + end)) + +let create_single_data_storage name + (module Context : Raw_context.T with type t = Raw_context.t) : + (module Single_data_storage with type t = Context.t and type value = Int32.t) + = + (module Make_single_data_storage (Registered) (Context) + (struct + let name = [name] + end) + (Int32)) + +let create_indexed_subcontext_int32 + (module Context : Raw_context.T with type t = Raw_context.t) : + (module Data_set_storage with type t = Raw_context.t) = + (module Make_data_set_storage (Context) (Int32.Index)) + +let create_indexed_subcontext_int64 + (module Context : Raw_context.T with type t = Raw_context.t) : + (module Data_set_storage with type t = Raw_context.t) = + (module Make_data_set_storage (Context) (Int64.Index)) + +let must_failwith f_prog error = + try + let () = f_prog () in + Alcotest.fail "Unexpected successful result" + with exc -> + if exc = error then Lwt.return_unit + else Alcotest.fail "Unexpected error result" + +(** Test: + + This test check that creating value where value already exists + fails*) +let test_register_single_data () = + let f_prog () = + let context = create_context "context1" in + (create_single_data_storage "single_data" context + :> (module Single_data_storage)) + |> ignore ; + (create_single_data_storage "single_data" context + :> (module Single_data_storage)) + |> ignore + in + let error = + Invalid_argument + "Could not register a value at [context1 / single_data] because of an \ + existing Value." + in + must_failwith f_prog error + +(** Test: + + This test check that creating a subcontext where a value already exists + fails*) +let test_register_named_subcontext () = + let f_prog () = + let context = create_context "context2" in + let subcontext = create_subcontext "sub_context" context in + (create_single_data_storage "error_register" subcontext + :> (module Single_data_storage)) + |> ignore ; + let subcontext = create_subcontext "error_register" subcontext in + (create_single_data_storage "single_data2" subcontext + :> (module Single_data_storage)) + |> ignore + in + let error = + Invalid_argument + "Could not register a named subcontext at [context2 / sub_context / \ + error_register] because of an existing Value." + in + must_failwith f_prog error + +(** Test: + + This test check that creating a indexed subcontext where a value already + exists fails*) +let test_register_indexed_subcontext () = + let f_prog () = + let context = create_context "context3" in + (create_single_data_storage "single_value" context + :> (module Single_data_storage)) + |> ignore ; + (create_indexed_subcontext_int32 context :> (module Data_set_storage)) + |> ignore + in + let error = + Invalid_argument + "Could not register an indexed subcontext at [context3] because of an \ + existing \n\ + single_value Value." + in + must_failwith f_prog error + +(** Test: + + This test check that creating a indexed subcontext where an indexed + subcontext already exists fails*) +let test_register_indexed_subcontext_2 () = + let f_prog () = + let context = create_context "context4" in + (create_indexed_subcontext_int32 context :> (module Data_set_storage)) + |> ignore ; + (create_indexed_subcontext_int64 context :> (module Data_set_storage)) + |> ignore + in + let error = + Invalid_argument + "An indexed subcontext at [context4] already exists but has a different \ + argument: `int64` <> `int`." + in + must_failwith f_prog error + +let tests = + [ + Alcotest_lwt.test_case + "register single data in existing path" + `Quick + (fun _ -> test_register_single_data); + Alcotest_lwt.test_case + "register named subcontext in existing path" + `Quick + (fun _ -> test_register_named_subcontext); + Alcotest_lwt.test_case + "register indexed subcontext in existing path" + `Quick + (fun _ -> test_register_indexed_subcontext); + Alcotest_lwt.test_case + "register indexed subcontext with existing indexed subcontext" + `Quick + (fun _ -> test_register_indexed_subcontext_2); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml new file mode 100644 index 000000000000..6f6fcab7eafc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml @@ -0,0 +1,179 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Context Storage + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "storage tests" + Subject: Test storage functions. + *) + +open Protocol +open Storage_functors + +let assert_length ~loc ctxt key expected = + let open Lwt_result_syntax in + let*! length = Raw_context.length ctxt key in + let* () = Assert.equal_int ~loc length expected in + let*! list = Raw_context.list ctxt key in + let list_length = List.length list in + Assert.equal_int ~loc length list_length + +module Int32 = struct + type t = int32 + + let encoding = Data_encoding.int32 + + module Index = struct + type t = int + + let path_length = 1 + + let to_path c l = string_of_int c :: l + + let of_path = function + | [] | _ :: _ :: _ -> None + | [c] -> int_of_string_opt c + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = Environment.RPC_arg.int; + encoding = Data_encoding.int31; + compare = Compare.Int.compare; + } + end +end + +module String = struct + type t = string + + let encoding = Data_encoding.string +end + +module Root_raw_context = + Make_subcontext (Registered) (Raw_context) + (struct + let name = ["test_storage_functors"] + end) + +module Indexed_context = + Make_indexed_subcontext + (Make_subcontext (Registered) (Root_raw_context) + (struct + let name = ["index"] + end)) + (Int32.Index) + +module Table = + Make_carbonated_data_set_storage + (Make_subcontext (Registered) (Raw_context) + (struct + let name = ["table"] + end)) + (Int32.Index) + +let wrap m = m >|= Environment.wrap_tzresult + +(** Test: + This test checks that it is possible to add values to a + Carbonated_data_set_storage and iterate over them. *) +let test_fold_keys_unaccounted () = + let open Lwt_result_syntax in + let* ctxt = Context.default_raw_context () in + let* ctxt, _ = wrap (Table.init ctxt 1) in + let* ctxt, _ = wrap (Table.init ctxt 2) in + let*! items = + Table.fold_keys_unaccounted + ctxt + ~order:`Undefined + ~f:(fun x acc -> Lwt.return @@ (x :: acc)) + ~init:[] + in + let items = List.sort Compare.Int.compare items in + Assert.assert_equal_list + ~loc:__LOC__ + Int.equal + "Compare items" + Format.pp_print_int + [1; 2] + items + +(** Test that [length] returns the number of elements for a given path. *) +let test_length () = + let open Lwt_result_syntax in + let* ctxt = Context.default_raw_context () in + (* Add a tree to the context: + root: + left: + l1 : V1 + l2 : V2 + l3 : V3 + right: + r1 : V4 + r2 : V5 + file : V6 + *) + let*! tree = + let*! tree_left = + let tree = Raw_context.Tree.empty ctxt in + let*! tree = Raw_context.Tree.add tree ["l1"] (Bytes.of_string "V1") in + let*! tree = Raw_context.Tree.add tree ["l2"] (Bytes.of_string "V2") in + Raw_context.Tree.add tree ["c"] (Bytes.of_string "V3") + in + let*! tree_right = + let tree = Raw_context.Tree.empty ctxt in + let*! tree = Raw_context.Tree.add tree ["r1"] (Bytes.of_string "V4") in + Raw_context.Tree.add tree ["r2"] (Bytes.of_string "V5") + in + let tree = Raw_context.Tree.empty ctxt in + let*! tree = Raw_context.Tree.add_tree tree ["left"] tree_left in + let*! tree = Raw_context.Tree.add_tree tree ["right"] tree_right in + Raw_context.Tree.add tree ["file"] (Bytes.of_string "V6") + in + let* ctxt = wrap @@ Raw_context.init_tree ctxt ["root"] tree in + (* The root node contains 3 elements. *) + let* () = assert_length ctxt ~loc:__LOC__ ["root"] 3 in + (* The left branch contains 3 elements. *) + let* () = assert_length ctxt ~loc:__LOC__ ["root"; "left"] 3 in + (* The right branch contains 2 elements. *) + let* () = assert_length ctxt ~loc:__LOC__ ["root"; "right"] 2 in + (* Path [root/left/l1] is a leaf and thus returns length 0. *) + let* () = assert_length ctxt ~loc:__LOC__ ["root"; "left"; "l1"] 0 in + (* The length of a non-existing path also returns 0. *) + assert_length ctxt ~loc:__LOC__ ["root"; "right"; "non_existing"] 0 + +let tests = + [ + Tztest.tztest + "fold_keys_unaccounted smoke test" + `Quick + test_fold_keys_unaccounted; + Tztest.tztest "length test" `Quick test_length; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml new file mode 100644 index 000000000000..7b5a33155ed2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml @@ -0,0 +1,757 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (token) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- test "^token" + Subject: Token movements in the protocol. +*) + +open Protocol +open Alpha_context +open Test_tez + +let wrap e = e >|= Environment.wrap_tzresult + +(** Creates a context with a single account. Returns the context and the public + key hash of the account. *) +let create_context () = + let (Account.{pkh; _} as account) = Account.new_account () in + let bootstrap_account = Account.make_bootstrap_account account in + Block.alpha_context [bootstrap_account] >>=? fun ctxt -> return (ctxt, pkh) + +let random_amount () = + match Tez.of_mutez (Int64.add 1L (Random.int64 100L)) with + | None -> assert false + | Some x -> x + +let nonce = + Origination_nonce.Internal_for_tests.initial Tezos_crypto.Operation_hash.zero + +let mk_rollup () = Tx_rollup.Internal_for_tests.originated_tx_rollup nonce + +(** Check balances for a simple transfer from [bootstrap] to new [Implicit]. *) +let test_simple_balances () = + Random.init 0 ; + create_context () >>=? fun (ctxt, pkh) -> + let src = `Contract (Contract.Implicit pkh) in + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let dest = `Contract (Contract.Implicit pkh) in + let amount = Tez.one in + wrap (Token.transfer ctxt src dest amount) >>=? fun (ctxt', _) -> + wrap (Token.balance ctxt src) >>=? fun (ctxt, bal_src) -> + wrap (Token.balance ctxt' src) >>=? fun (ctxt', bal_src') -> + wrap (Token.balance ctxt dest) >>=? fun (_, bal_dest) -> + wrap (Token.balance ctxt' dest) >>=? fun (_, bal_dest') -> + bal_src' +? amount >>?= fun add_bal_src'_amount -> + bal_dest +? amount >>?= fun add_bal_dest_amount -> + Assert.equal_tez ~loc:__LOC__ bal_src add_bal_src'_amount >>=? fun () -> + Assert.equal_tez ~loc:__LOC__ bal_dest' add_bal_dest_amount + +(** Check balance updates for a simple transfer from [bootstrap] to new + [Implicit]. *) +let test_simple_balance_updates () = + Random.init 0 ; + create_context () >>=? fun (ctxt, pkh) -> + let src = Contract.Implicit pkh in + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let dest = Contract.Implicit pkh in + let amount = Tez.one in + wrap (Token.transfer ctxt (`Contract src) (`Contract dest) amount) + >>=? fun (_, bal_updates) -> + Alcotest.( + check + bool + "Missing balance update for source contract." + (List.mem + ~equal:( = ) + Receipt.(Contract src, Debited amount, Block_application) + bal_updates) + true) ; + Alcotest.( + check + bool + "Missing balance update for destination contract." + (List.mem + ~equal:( = ) + Receipt.(Contract dest, Credited amount, Block_application) + bal_updates) + true) ; + return_unit + +let test_allocated_and_deallocated ctxt dest initial_status status_when_empty = + wrap (Token.allocated ctxt dest) >>=? fun (ctxt, allocated) -> + Assert.equal_bool ~loc:__LOC__ allocated initial_status >>=? fun () -> + let amount = Tez.one in + wrap (Token.transfer ctxt `Minted dest amount) >>=? fun (ctxt', _) -> + wrap (Token.allocated ctxt' dest) >>=? fun (ctxt', allocated) -> + Assert.equal_bool ~loc:__LOC__ allocated true >>=? fun () -> + wrap (Token.balance ctxt' dest) >>=? fun (ctxt', bal_dest') -> + wrap (Token.transfer ctxt' dest `Burned bal_dest') >>=? fun (ctxt', _) -> + wrap (Token.allocated ctxt' dest) >>=? fun (_, allocated) -> + Assert.equal_bool ~loc:__LOC__ allocated status_when_empty >>=? fun () -> + return_unit + +let test_allocated_and_deallocated_when_empty ctxt dest = + test_allocated_and_deallocated ctxt dest false false + +let test_allocated_and_still_allocated_when_empty ctxt dest initial_status = + test_allocated_and_deallocated ctxt dest initial_status true + +let test_allocated () = + Random.init 0 ; + create_context () >>=? fun (ctxt, pkh) -> + let dest = `Delegate_balance pkh in + test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun () -> + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let dest = `Contract (Contract.Implicit pkh) in + test_allocated_and_deallocated_when_empty ctxt dest >>=? fun () -> + let dest = `Collected_commitments Blinded_public_key_hash.zero in + test_allocated_and_deallocated_when_empty ctxt dest >>=? fun () -> + let dest = `Frozen_deposits pkh in + test_allocated_and_still_allocated_when_empty ctxt dest false >>=? fun () -> + let dest = `Block_fees in + test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun () -> + let dest = + let bond_id = Bond_id.Tx_rollup_bond_id (mk_rollup ()) in + `Frozen_bonds (Contract.Implicit pkh, bond_id) + in + test_allocated_and_deallocated_when_empty ctxt dest + +let check_sink_balances ctxt ctxt' dest amount = + wrap (Token.balance ctxt dest) >>=? fun (_, bal_dest) -> + wrap (Token.balance ctxt' dest) >>=? fun (_, bal_dest') -> + bal_dest +? amount >>?= fun add_bal_dest_amount -> + Assert.equal_tez ~loc:__LOC__ bal_dest' add_bal_dest_amount + +(* Accounts of the form (`DelegateBalance pkh) are not allocated when they + receive funds for the first time. To force allocation, we transfer to + (`Contract pkh) instead. *) +let force_allocation_if_need_be ctxt account = + match account with + | `Delegate_balance pkh -> + let account = `Contract (Contract.Implicit pkh) in + wrap (Token.transfer ctxt `Minted account Tez.one_mutez) >|=? fst + | _ -> return ctxt + +let test_transferring_to_sink ctxt sink amount expected_bupds = + (* Transferring zero must be a noop, and must not return balance updates. *) + wrap (Token.transfer ctxt `Minted sink Tez.zero) >>=? fun (ctxt', bupds) -> + Assert.equal_bool ~loc:__LOC__ (ctxt == ctxt' && bupds = []) true + >>=? fun () -> + (* Force the allocation of [dest] if need be. *) + force_allocation_if_need_be ctxt sink >>=? fun ctxt -> + (* Test transferring a non null amount. *) + wrap (Token.transfer ctxt `Minted sink amount) >>=? fun (ctxt', bupds) -> + check_sink_balances ctxt ctxt' sink amount >>=? fun () -> + let expected_bupds = + Receipt.(Minted, Debited amount, Block_application) :: expected_bupds + in + Alcotest.( + check bool "Balance updates do not match." (bupds = expected_bupds) true) ; + (* Test transferring to go beyond capacity. *) + wrap (Token.balance ctxt' sink) >>=? fun (ctxt', bal) -> + let amount = Tez.of_mutez_exn Int64.max_int -! bal +! Tez.one_mutez in + wrap (Token.transfer ctxt' `Minted sink amount) >>= fun res -> + Assert.proto_error_with_info ~loc:__LOC__ res "Overflowing tez addition" + +let test_transferring_to_contract ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let dest = Contract.Implicit pkh in + let amount = random_amount () in + test_transferring_to_sink + ctxt + (`Contract dest) + amount + [(Contract dest, Credited amount, Block_application)] + +let test_transferring_to_collected_commitments ctxt = + let amount = random_amount () in + let bpkh = Blinded_public_key_hash.zero in + test_transferring_to_sink + ctxt + (`Collected_commitments bpkh) + amount + [(Commitments bpkh, Credited amount, Block_application)] + +let test_transferring_to_delegate_balance ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let dest = Contract.Implicit pkh in + let amount = random_amount () in + test_transferring_to_sink + ctxt + (`Delegate_balance pkh) + amount + [(Contract dest, Credited amount, Block_application)] + +let test_transferring_to_frozen_deposits ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let amount = random_amount () in + test_transferring_to_sink + ctxt + (`Frozen_deposits pkh) + amount + [(Deposits pkh, Credited amount, Block_application)] + +let test_transferring_to_collected_fees ctxt = + let amount = random_amount () in + test_transferring_to_sink + ctxt + `Block_fees + amount + [(Block_fees, Credited amount, Block_application)] + +let test_transferring_to_burned ctxt = + let amount = random_amount () in + let minted_bupd = Receipt.(Minted, Debited amount, Block_application) in + wrap (Token.transfer ctxt `Minted `Burned amount) >>=? fun (_, bupds) -> + Assert.equal_bool + ~loc:__LOC__ + (bupds = [minted_bupd; (Burned, Credited amount, Block_application)]) + true + >>=? fun () -> + wrap (Token.transfer ctxt `Minted `Storage_fees amount) >>=? fun (_, bupds) -> + Assert.equal_bool + ~loc:__LOC__ + (bupds = [minted_bupd; (Storage_fees, Credited amount, Block_application)]) + true + >>=? fun () -> + wrap (Token.transfer ctxt `Minted `Double_signing_punishments amount) + >>=? fun (_, bupds) -> + Assert.equal_bool + ~loc:__LOC__ + (bupds + = [ + minted_bupd; + (Double_signing_punishments, Credited amount, Block_application); + ]) + true + >>=? fun () -> + let pkh = Tezos_crypto.Signature.Public_key_hash.zero in + let p, r = (Random.bool (), Random.bool ()) in + wrap + (Token.transfer ctxt `Minted (`Lost_endorsing_rewards (pkh, p, r)) amount) + >>=? fun (_, bupds) -> + Assert.equal_bool + ~loc:__LOC__ + (bupds + = [ + minted_bupd; + (Lost_endorsing_rewards (pkh, p, r), Credited amount, Block_application); + ]) + true + >>=? fun () -> + wrap (Token.transfer ctxt `Minted `Sc_rollup_refutation_punishments amount) + >>=? fun (_, bupds) -> + Assert.equal_bool + ~loc:__LOC__ + (bupds + = [ + minted_bupd; + (Sc_rollup_refutation_punishments, Credited amount, Block_application); + ]) + true + +let test_transferring_to_frozen_bonds ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let contract = Contract.Implicit pkh in + let tx_rollup = mk_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let amount = random_amount () in + test_transferring_to_sink + ctxt + (`Frozen_bonds (contract, bond_id)) + amount + [(Frozen_bonds (contract, bond_id), Credited amount, Block_application)] + +let test_transferring_to_sink () = + Random.init 0 ; + create_context () >>=? fun (ctxt, _) -> + test_transferring_to_contract ctxt >>=? fun () -> + test_transferring_to_collected_commitments ctxt >>=? fun () -> + test_transferring_to_delegate_balance ctxt >>=? fun () -> + test_transferring_to_frozen_deposits ctxt >>=? fun () -> + test_transferring_to_collected_fees ctxt >>=? fun () -> + test_transferring_to_burned ctxt >>=? fun () -> + test_transferring_to_frozen_bonds ctxt + +let check_src_balances ctxt ctxt' src amount = + wrap (Token.balance ctxt src) >>=? fun (_, bal_src) -> + wrap (Token.balance ctxt' src) >>=? fun (_, bal_src') -> + bal_src' +? amount >>?= fun add_bal_src'_amount -> + Assert.equal_tez ~loc:__LOC__ bal_src add_bal_src'_amount + +let test_transferring_from_unbounded_source ctxt src expected_bupds = + (* Transferring zero must not return balance updates. *) + wrap (Token.transfer ctxt src `Burned Tez.zero) >>=? fun (_, bupds) -> + Assert.equal_bool ~loc:__LOC__ (bupds = []) true >>=? fun () -> + (* Test transferring a non null amount. *) + let amount = random_amount () in + wrap (Token.transfer ctxt src `Burned amount) >>=? fun (_, bupds) -> + let expected_bupds = + expected_bupds amount + @ Receipt.[(Burned, Credited amount, Block_application)] + in + Assert.equal_bool ~loc:__LOC__ (bupds = expected_bupds) true >>=? fun () -> + return_unit + +(* Returns the balance of [account] if [account] is allocated, and returns + [Tez.zero] otherwise. *) +let balance_no_fail ctxt account = + wrap (Token.allocated ctxt account) >>=? fun (ctxt, allocated) -> + if allocated then wrap (Token.balance ctxt account) + else return (ctxt, Tez.zero) + +let test_transferring_from_bounded_source ctxt src amount expected_bupds = + balance_no_fail ctxt src >>=? fun (ctxt, balance) -> + Assert.equal_tez ~loc:__LOC__ balance Tez.zero >>=? fun () -> + (* Test transferring from an empty account. *) + wrap (Token.transfer ctxt src `Burned Tez.one) >>= fun res -> + let error_title = + match src with + | `Contract _ -> "Balance too low" + | `Delegate_balance _ | `Frozen_deposits _ | `Frozen_bonds _ -> + "Storage error (fatal internal error)" + | _ -> "Underflowing tez subtraction" + in + Assert.proto_error_with_info ~loc:__LOC__ res error_title >>=? fun () -> + (* Transferring zero must be a noop, and must not return balance updates. *) + wrap (Token.transfer ctxt src `Burned Tez.zero) >>=? fun (ctxt', bupds) -> + Assert.equal_bool ~loc:__LOC__ (ctxt == ctxt' && bupds = []) true + >>=? fun () -> + (* Force the allocation of [dest] if need be. *) + force_allocation_if_need_be ctxt src >>=? fun ctxt -> + (* Test transferring everything. *) + wrap (Token.transfer ctxt `Minted src amount) >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt src `Burned amount) >>=? fun (ctxt', bupds) -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> + let expected_bupds = + expected_bupds @ Receipt.[(Burned, Credited amount, Block_application)] + in + Assert.equal_bool ~loc:__LOC__ (bupds = expected_bupds) true >>=? fun () -> + (* Test transferring a smaller amount. *) + wrap (Token.transfer ctxt `Minted src amount) >>=? fun (ctxt, _) -> + (match src with + | `Frozen_bonds _ -> + wrap (Token.transfer ctxt src `Burned amount) >>= fun res -> + let error_title = "Partial spending of frozen bonds" in + Assert.proto_error_with_info ~loc:__LOC__ res error_title + | _ -> + wrap (Token.transfer ctxt src `Burned amount) >>=? fun (ctxt', bupds) -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> + Assert.equal_bool ~loc:__LOC__ (bupds = expected_bupds) true) + >>=? fun () -> + (* Test transferring more than available. *) + wrap (Token.balance ctxt src) >>=? fun (ctxt, balance) -> + wrap (Token.transfer ctxt src `Burned (balance +! Tez.one)) >>= fun res -> + let error_title = + match src with + | `Contract _ -> "Balance too low" + | `Frozen_bonds _ -> "Partial spending of frozen bonds" + | _ -> "Underflowing tez subtraction" + in + Assert.proto_error_with_info ~loc:__LOC__ res error_title + +let test_transferring_from_contract ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let src = Contract.Implicit pkh in + let amount = random_amount () in + test_transferring_from_bounded_source + ctxt + (`Contract src) + amount + [(Contract src, Debited amount, Block_application)] + +let test_transferring_from_collected_commitments ctxt = + let amount = random_amount () in + let bpkh = Blinded_public_key_hash.zero in + test_transferring_from_bounded_source + ctxt + (`Collected_commitments bpkh) + amount + [(Commitments bpkh, Debited amount, Block_application)] + +let test_transferring_from_delegate_balance ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let amount = random_amount () in + let src = Contract.Implicit pkh in + test_transferring_from_bounded_source + ctxt + (`Delegate_balance pkh) + amount + [(Contract src, Debited amount, Block_application)] + +let test_transferring_from_frozen_deposits ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let amount = random_amount () in + test_transferring_from_bounded_source + ctxt + (`Frozen_deposits pkh) + amount + [(Deposits pkh, Debited amount, Block_application)] + +let test_transferring_from_collected_fees ctxt = + let amount = random_amount () in + test_transferring_from_bounded_source + ctxt + `Block_fees + amount + [(Block_fees, Debited amount, Block_application)] + +let test_transferring_from_frozen_bonds ctxt = + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let contract = Contract.Implicit pkh in + let tx_rollup = mk_rollup () in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + let amount = random_amount () in + test_transferring_from_bounded_source + ctxt + (`Frozen_bonds (contract, bond_id)) + amount + [(Frozen_bonds (contract, bond_id), Debited amount, Block_application)] + +let test_transferring_from_source () = + Random.init 0 ; + create_context () >>=? fun (ctxt, _) -> + test_transferring_from_unbounded_source ctxt `Invoice (fun am -> + [(Invoice, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Bootstrap (fun am -> + [(Bootstrap, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Initial_commitments (fun am -> + [(Initial_commitments, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Revelation_rewards (fun am -> + [(Nonce_revelation_rewards, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source + ctxt + `Double_signing_evidence_rewards + (fun am -> + [(Double_signing_evidence_rewards, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Endorsing_rewards (fun am -> + [(Endorsing_rewards, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Baking_rewards (fun am -> + [(Baking_rewards, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Baking_bonuses (fun am -> + [(Baking_bonuses, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source ctxt `Minted (fun am -> + [(Minted, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_unbounded_source + ctxt + `Liquidity_baking_subsidies + (fun am -> [(Liquidity_baking_subsidies, Debited am, Block_application)]) + >>=? fun () -> + test_transferring_from_contract ctxt >>=? fun () -> + test_transferring_from_collected_commitments ctxt >>=? fun () -> + test_transferring_from_delegate_balance ctxt >>=? fun () -> + test_transferring_from_frozen_deposits ctxt >>=? fun () -> + test_transferring_from_collected_fees ctxt >>=? fun () -> + test_transferring_from_frozen_bonds ctxt + +let cast_to_container_type x = + match x with + | `Burned | `Invoice | `Bootstrap | `Initial_commitments | `Minted + | `Liquidity_baking_subsidies -> + None + | `Contract _ as x -> Some x + | `Collected_commitments _ as x -> Some x + | `Delegate_balance _ as x -> Some x + | `Block_fees as x -> Some x + | `Frozen_bonds _ as x -> Some x + +(** Generates all combinations of constructors. *) +let build_test_cases () = + create_context () >>=? fun (ctxt, pkh) -> + let origin = `Contract (Contract.Implicit pkh) in + let user1, _, _ = Tezos_crypto.Signature.generate_key () in + let user1c = `Contract (Contract.Implicit user1) in + let user2, _, _ = Tezos_crypto.Signature.generate_key () in + let user2c = `Contract (Contract.Implicit user2) in + let baker1, baker1_pk, _ = Tezos_crypto.Signature.generate_key () in + let baker1c = `Contract (Contract.Implicit baker1) in + let baker2, baker2_pk, _ = Tezos_crypto.Signature.generate_key () in + let baker2c = `Contract (Contract.Implicit baker2) in + (* Allocate contracts for user1, user2, baker1, and baker2. *) + wrap (Token.transfer ctxt origin user1c (random_amount ())) + >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin user2c (random_amount ())) + >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin baker1c (random_amount ())) + >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin baker2c (random_amount ())) + >>=? fun (ctxt, _) -> + (* Configure baker1, and baker2 as delegates by self-delegation, for which + revealing their manager key is a prerequisite. *) + wrap (Contract.reveal_manager_key ctxt baker1 baker1_pk) >>=? fun ctxt -> + wrap (Contract.Delegate.set ctxt (Contract.Implicit baker1) (Some baker1)) + >>=? fun ctxt -> + wrap (Contract.reveal_manager_key ctxt baker2 baker2_pk) >>=? fun ctxt -> + wrap (Contract.Delegate.set ctxt (Contract.Implicit baker2) (Some baker2)) + (* Let user1 delegate to baker2. *) + >>=? fun ctxt -> + wrap (Contract.Delegate.set ctxt (Contract.Implicit user1) (Some baker2)) + >>=? fun ctxt -> + let tx_rollup1 = mk_rollup () in + let bond_id1 = Bond_id.Tx_rollup_bond_id tx_rollup1 in + let tx_rollup2 = mk_rollup () in + let bond_id2 = Bond_id.Tx_rollup_bond_id tx_rollup2 in + let user1ic = Contract.Implicit user1 in + let baker2ic = Contract.Implicit baker2 in + let src_list = + [ + (`Invoice, random_amount ()); + (`Bootstrap, random_amount ()); + (`Initial_commitments, random_amount ()); + (`Minted, random_amount ()); + (`Liquidity_baking_subsidies, random_amount ()); + (`Collected_commitments Blinded_public_key_hash.zero, random_amount ()); + (`Delegate_balance baker1, random_amount ()); + (`Delegate_balance baker2, random_amount ()); + (`Block_fees, random_amount ()); + (user1c, random_amount ()); + (user2c, random_amount ()); + (baker1c, random_amount ()); + (baker2c, random_amount ()); + (`Frozen_bonds (user1ic, bond_id1), random_amount ()); + (`Frozen_bonds (baker2ic, bond_id2), random_amount ()); + ] + in + let dest_list = + [ + `Collected_commitments Blinded_public_key_hash.zero; + `Delegate_balance baker1; + `Delegate_balance baker2; + `Block_fees; + user1c; + user2c; + baker1c; + baker2c; + `Frozen_bonds (user1ic, bond_id1); + `Frozen_bonds (baker2ic, bond_id2); + `Burned; + ] + in + return (ctxt, List.product src_list dest_list) + +let check_src_balances ctxt ctxt' src amount = + match cast_to_container_type src with + | None -> return_unit + | Some src -> check_src_balances ctxt ctxt' src amount + +let check_sink_balances ctxt ctxt' dest amount = + match cast_to_container_type dest with + | None -> return_unit + | Some dest -> check_sink_balances ctxt ctxt' dest amount + +let rec check_balances ctxt ctxt' src dest amount = + match (cast_to_container_type src, cast_to_container_type dest) with + | None, None -> return_unit + | ( Some (`Delegate_balance d), + Some (`Contract (Contract.Implicit c) as contract) ) + | ( Some (`Contract (Contract.Implicit c) as contract), + Some (`Delegate_balance d) ) + when d = c -> + (* src and dest are in fact referring to the same contract *) + check_balances ctxt ctxt' contract contract amount + | Some src, Some dest when src = dest -> + (* src and dest are the same contract *) + wrap (Token.balance ctxt dest) >>=? fun (_, bal_dest) -> + wrap (Token.balance ctxt' dest) >>=? fun (_, bal_dest') -> + Assert.equal_tez ~loc:__LOC__ bal_dest bal_dest' + | Some src, None -> check_src_balances ctxt ctxt' src amount + | None, Some dest -> check_sink_balances ctxt ctxt' dest amount + | Some src, Some dest -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> + check_sink_balances ctxt ctxt' dest amount + +let test_all_combinations_of_sources_and_sinks () = + Random.init 0 ; + build_test_cases () >>=? fun (ctxt, cases) -> + List.iter_es + (fun ((src, amount), dest) -> + (match cast_to_container_type src with + | None -> return ctxt + | Some src -> + wrap (Token.transfer ctxt `Minted src amount) >>=? fun (ctxt, _) -> + return ctxt) + >>=? fun ctxt -> + wrap (Token.transfer ctxt src dest amount) >>=? fun (ctxt', _) -> + check_balances ctxt ctxt' src dest amount) + cases + +(** [coalesce (account, Credited am1, origin) (account, Credited am2, origin) + = Some (account, Credited (am1+am2), origin)] + + [coalesce (account, Debited am1, origin) (account, Debited am2, origin) + = Some (account, Debited (am1+am2), origin)] + + Fails if bu1 and bu2 have different accounts or different origins, or + if one is a credit while the other is a debit. *) +let coalesce_balance_updates bu1 bu2 = + match (bu1, bu2) with + | (bu1_bal, bu1_balupd, bu1_origin), (bu2_bal, bu2_balupd, bu2_origin) -> ( + assert (bu1_bal = bu2_bal) ; + assert (bu1_origin = bu2_origin) ; + let open Receipt in + match (bu1_balupd, bu2_balupd) with + | Credited bu1_am, Credited bu2_am -> + let bu_am = + match bu1_am +? bu2_am with Ok am -> am | _ -> assert false + in + (bu1_bal, Credited bu_am, bu1_origin) + | Debited bu1_am, Debited bu2_am -> + let bu_am = + match bu1_am +? bu2_am with Ok am -> am | _ -> assert false + in + (bu1_bal, Debited bu_am, bu1_origin) + | Credited _, Debited _ | Debited _, Credited _ -> assert false) + +(** Check that elt has the same balance in ctxt1 and ctxt2. *) +let check_balances_are_consistent ctxt1 ctxt2 elt = + match elt with + | #Token.container as elt -> + Token.balance ctxt1 elt >>=? fun (_, elt_bal1) -> + Token.balance ctxt2 elt >>=? fun (_, elt_bal2) -> + assert (elt_bal1 = elt_bal2) ; + return_unit + | `Invoice | `Bootstrap | `Initial_commitments | `Minted + | `Liquidity_baking_subsidies | `Burned -> + return_unit + +(** Test that [transfer_n] is equivalent to n debits followed by n credits. *) +let test_transfer_n ctxt src dest = + (* Run transfer_n. *) + Token.transfer_n ctxt src dest >>=? fun (ctxt1, bal_updates1) -> + (* Debit all sources. *) + List.fold_left_es + (fun (ctxt, bal_updates) (src, am) -> + Token.transfer ctxt src `Burned am >>=? fun (ctxt, debit_logs) -> + return (ctxt, bal_updates @ debit_logs)) + (ctxt, []) + src + >>=? fun (ctxt, debit_logs) -> + (* remove burning balance updates *) + let debit_logs = + List.filter + (fun b -> match b with Receipt.Burned, _, _ -> false | _ -> true) + debit_logs + in + (* Credit the sink for each source. *) + List.fold_left_es + (fun (ctxt, bal_updates) (_, am) -> + Token.transfer ctxt `Minted dest am >>=? fun (ctxt, credit_logs) -> + return (ctxt, bal_updates @ credit_logs)) + (ctxt, []) + src + >>=? fun (ctxt2, credit_logs) -> + (* remove minting balance updates *) + let credit_logs = + List.filter + (fun b -> match b with Receipt.Minted, _, _ -> false | _ -> true) + credit_logs + in + (* Check equivalence of balance updates. *) + let credit_logs = + match credit_logs with + | [] -> [] + | head :: tail -> [List.fold_left coalesce_balance_updates head tail] + in + assert (bal_updates1 = debit_logs @ credit_logs) ; + (* Check balances are the same in ctxt1 and ctxt2. *) + List.(iter_es (check_balances_are_consistent ctxt1 ctxt2) (map fst src)) + >>=? fun () -> check_balances_are_consistent ctxt1 ctxt2 dest + +let test_transfer_n_with_empty_source () = + Random.init 0 ; + create_context () >>=? fun (ctxt, pkh) -> + wrap (test_transfer_n ctxt [] `Block_fees) >>=? fun () -> + let dest = `Delegate_balance pkh in + wrap (test_transfer_n ctxt [] dest) + +let test_transfer_n_with_non_empty_source () = + Random.init 0 ; + create_context () >>=? fun (ctxt, pkh) -> + let origin = `Contract (Contract.Implicit pkh) in + let user1, _, _ = Tezos_crypto.Signature.generate_key () in + let user1c = `Contract (Contract.Implicit user1) in + let user2, _, _ = Tezos_crypto.Signature.generate_key () in + let user2c = `Contract (Contract.Implicit user2) in + let user3, _, _ = Tezos_crypto.Signature.generate_key () in + let user3c = `Contract (Contract.Implicit user3) in + let user4, _, _ = Tezos_crypto.Signature.generate_key () in + let user4c = `Contract (Contract.Implicit user4) in + (* Allocate contracts for user1, user2, user3, and user4. *) + let amount = + match Tez.of_mutez 1000L with None -> assert false | Some x -> x + in + wrap (Token.transfer ctxt origin user1c amount) >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin user2c amount) >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin user3c amount) >>=? fun (ctxt, _) -> + wrap (Token.transfer ctxt origin user4c (random_amount ())) + >>=? fun (ctxt, _) -> + let sources = + [ + (user2c, random_amount ()); + (user3c, random_amount ()); + (user4c, random_amount ()); + ] + in + wrap (test_transfer_n ctxt sources user1c) >>=? fun () -> + wrap (test_transfer_n ctxt ((user1c, random_amount ()) :: sources) user1c) + +let tests = + Tztest. + [ + tztest "transfer - balances" `Quick test_simple_balances; + tztest "transfer - balance updates" `Quick test_simple_balance_updates; + tztest "transfer - test allocated" `Quick test_allocated; + tztest "transfer - test transfer to sink" `Quick test_transferring_to_sink; + tztest + "transfer - test transfer from source" + `Quick + test_transferring_from_source; + tztest + "transfer - test all (sources x sinks)" + `Quick + test_all_combinations_of_sources_and_sinks; + tztest + "transfer - test from empty sources to a destination" + `Quick + test_transfer_n_with_empty_source; + tztest + "transfer - test from n sources to a destination" + `Quick + test_transfer_n_with_non_empty_source; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune new file mode 100644 index 000000000000..2af027a6662d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune @@ -0,0 +1,28 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + alcotest-lwt + tezos-base + tezos-protocol-016-PtMumbai + qcheck-alcotest + tezos-client-alpha + tezos-alpha-test-helpers + tezos-base-test-helpers + tezos-protocol-plugin-alpha) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_alpha + -open Tezos_alpha_test_helpers + -open Tezos_base_test_helpers + -open Tezos_protocol_plugin_alpha)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.ml new file mode 100644 index 000000000000..170f0435c8da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.ml @@ -0,0 +1,925 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Validate_helpers + +type dbl_endorsement_state = { + temporary : (Block.t * Block.t) option; + slashable_preend : + (Kind.preendorsement operation * Kind.preendorsement operation) list; + slashable_end : (Kind.endorsement operation * Kind.endorsement operation) list; +} + +type state = { + block : Block.t; + pred : Block.t option; + bootstraps : public_key_hash list; + delegates : (public_key_hash * public_key_hash option) list; + voters : Contract.t list; + seed_nonce_to_reveal : (Raw_level.t * Nonce_hash.t) list; + commitments : secret_account list; + protocol_hashes : Tezos_crypto.Protocol_hash.t list; + slashable_bakes : (block_header * block_header) list; + vdf : bool; + dbl_endorsement : dbl_endorsement_state; + manager : Manager.infos; +} + +let init_manager_state bootstraps block = + let open Manager in + let ctxt = + { + block; + bootstraps; + originated_contract = None; + tx_rollup = None; + sc_rollup = None; + zk_rollup = None; + } + in + let accounts = + {sources = []; dest = None; del = None; tx = None; sc = None; zk = None} + in + {ctxt; accounts; flags = all_enabled} + +let init_dbl_endorsement_state = + {temporary = None; slashable_preend = []; slashable_end = []} + +(** Initialize the state according to [state] initialisation + for each operation kind. + + When adding a new operation kind, if such an initialization is + required, it should occur here. *) +let init_state block ~voters ~(bootstraps : Contract.t list) = + let bootstraps = + List.map + (function Contract.Implicit pkh -> pkh | _ -> assert false) + bootstraps + in + { + block; + pred = None; + bootstraps; + delegates = List.map (fun pkh -> (pkh, None)) bootstraps; + voters; + seed_nonce_to_reveal = []; + commitments = []; + protocol_hashes = []; + slashable_bakes = []; + vdf = false; + dbl_endorsement = init_dbl_endorsement_state; + manager = init_manager_state bootstraps block; + } + +type cycle_index = On of int | From of int + +type descriptor = { + parameters : Parameters.t -> Parameters.t; + required_cycle : Parameters.t -> int; + required_block : Parameters.t -> int; + prelude : + cycle_index * (state -> (packed_operation list * state) tzresult Lwt.t); + opt_prelude : + (cycle_index * (state -> (packed_operation list * state) tzresult Lwt.t)) + option; + candidates_generator : state -> packed_operation list tzresult Lwt.t; +} + +(** Each voting period lasts a whole cycle in the generation of valid operations. *) +let voting_context_params params = + let cycles_per_voting_period = 1l in + let constants = Parameters.{params.constants with cycles_per_voting_period} in + {params with constants} + +let ballot_exploration_prelude state = + let open Lwt_result_syntax in + let* ctxt = Context.to_alpha_ctxt (B state.block) in + let blocks_per_cycle = Alpha_context.Constants.blocks_per_cycle ctxt in + let rem = + Int32.rem state.block.Block.header.Block_header.shell.level blocks_per_cycle + in + if rem = 0l then + match state.voters with + | voter :: voters -> + let* prop = Op.proposals (B state.block) voter [get_n protos 0] in + let* props = + List.map_es + (fun voter -> + Op.proposals + (B state.block) + voter + [Tezos_crypto.Protocol_hash.zero]) + voters + in + return (prop :: props, state) + | _ -> assert false + else return ([], state) + +let activate_descriptor = + { + parameters = + (fun params -> + let commitments = + List.map + (fun {blinded_public_key_hash; amount; _} -> + Commitment.{blinded_public_key_hash; amount}) + secrets + in + {params with commitments}); + required_cycle = (fun _params -> 1); + required_block = (fun _params -> 0); + prelude = + (On 1, fun state -> return ([], {state with commitments = secrets})); + opt_prelude = None; + candidates_generator = + (fun state -> + let gen s = + Op.activation (B state.block) (Ed25519 s.account) s.activation_code + in + List.map_es gen state.commitments); + } + +(** During the first voting period in the setup of valid operations generations, + a proposal must win the proposal period -- hence [ballot_exploration_prelude] + takes place during the first cycle. *) +let ballot_exploration_descriptor = + { + parameters = voting_context_params; + required_cycle = + (fun params -> Int32.to_int params.constants.cycles_per_voting_period); + required_block = (fun _params -> 0); + prelude = (On 1, ballot_exploration_prelude); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen contract = + let* voting_period_info = + Context.Vote.get_current_period (B state.block) + in + assert (voting_period_info.voting_period.kind = Exploration) ; + let ballot = pick_one ballots in + Op.ballot + (B state.block) + contract + Tezos_crypto.Protocol_hash.zero + ballot + in + List.map_es gen state.voters); + } + +let proposal_descriptor = + { + parameters = voting_context_params; + required_cycle = (fun _ -> 0); + required_block = (fun _ -> 0); + prelude = + (On 0, fun state -> return ([], {state with protocol_hashes = protos})); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen contract = + let* voting_period_info = + Context.Vote.get_current_period (B state.block) + in + assert (voting_period_info.voting_period.kind = Proposal) ; + Op.proposals + (B state.block) + contract + [Tezos_crypto.Protocol_hash.zero] + in + List.map_es gen state.voters); + } + +(** [Promotion] is the 4th voting period, it requires 3 voting period + to last and be successful. [voting_context_params] set a + voting_period to 1 cycle. To generate a [Ballot] for this + promotion period: + + - the first period should conclude in a proposal wining -- 3 cycles + before generating the [Ballot], the proposal period must succeed:[ + ballot_exploration_prelude], + + - the exploration must conclude in a supermajority for this + proposal -- 2 cycles before generating the [Ballot], the + exploration period must succeed., and + + - the cooldown must last -- 1 cycle before generating the + [Ballot]. *) +let ballot_promotion_descriptor = + { + parameters = voting_context_params; + required_cycle = + (fun params -> 3 * Int32.to_int params.constants.cycles_per_voting_period); + required_block = (fun _ -> 0); + prelude = (On 3, ballot_exploration_prelude); + opt_prelude = + Some + ( On 2, + fun state -> + let open Lwt_result_syntax in + let* ctxt = Context.to_alpha_ctxt (B state.block) in + let blocks_per_cycle = + Alpha_context.Constants.blocks_per_cycle ctxt + in + let rem = + Int32.rem + state.block.Block.header.Block_header.shell.level + blocks_per_cycle + in + if rem = 0l then + let* ops = + List.map_es + (fun voter -> + Op.ballot + (B state.block) + voter + Tezos_crypto.Protocol_hash.zero + Vote.Yay) + state.voters + in + return (ops, state) + else return ([], state) ); + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen contract = + let* voting_period_info = + Context.Vote.get_current_period (B state.block) + in + assert (voting_period_info.voting_period.kind = Promotion) ; + let ballot = Stdlib.List.hd ballots in + Op.ballot + (B state.block) + contract + Tezos_crypto.Protocol_hash.zero + ballot + in + List.map_es gen state.voters); + } + +let seed_nonce_descriptor = + { + parameters = + (fun params -> + assert (params.constants.blocks_per_cycle > 3l) ; + let blocks_per_commitment = + Int32.(div params.constants.blocks_per_cycle 3l) + in + let constants = {params.constants with blocks_per_commitment} in + {params with constants}); + required_cycle = (fun _ -> 1); + required_block = (fun _ -> 0); + prelude = + ( On 1, + fun state -> + let open Lwt_result_syntax in + let b = state.block in + let* seed_nonce_to_reveal = + match + b.Block.header.Block_header.protocol_data.contents.seed_nonce_hash + with + | None -> return state.seed_nonce_to_reveal + | Some nonce_hash -> + let level = + Raw_level.of_int32_exn b.Block.header.Block_header.shell.level + in + return ((level, nonce_hash) :: state.seed_nonce_to_reveal) + in + return ([], {state with seed_nonce_to_reveal}) ); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen (level, nonce_hash) = + assert (List.length state.seed_nonce_to_reveal >= 3) ; + let nonce = + WithExceptions.Option.to_exn ~none:Not_found + @@ Registered_nonces.get nonce_hash + in + return (Op.seed_nonce_revelation (B state.block) level nonce) + in + List.map_es gen state.seed_nonce_to_reveal); + } + +(** The heads on which two slashable endorsements or preendorsement + should be made are from the previous level. Hence, the temporary + field of a double_evidence_state is used to transmit them to the + next level in order to make the slashable operations. *) +let register_temporary ba bb state : (Block.t * Block.t) option * state = + let pred_forks = state.dbl_endorsement.temporary in + let temporary = Some (ba, bb) in + let dbl_endorsement = {state.dbl_endorsement with temporary} in + (pred_forks, {state with dbl_endorsement}) + +(** During the slashable period, at each level, two different heads + for the same round are baked by the same baker. At the next level, + a delegate that either preendorses or endorses both heads makes a + pair of slashable pre- or endorsements. + + The pair of heads is placed in the temporary of the + double_evidence_state. If a pair of heads was already in this + field, hence they were baked at the previous level. + + Consequently, two pairs of slashable operations: two endorsements + and two preendorsement, can be made by two distinct endorsers. Each + pair is ordered in operation_hash order. Consequently, each pair + can appear in a denunciation operation and will be valid. *) +let dbl_endorsement_prelude state = + let open Lwt_result_syntax in + let* head_A = Block.bake ~policy:(By_round 0) state.block in + let* addr = pick_addr_endorser (B state.block) in + let ctr = Contract.Implicit addr in + let* operation = Op.transaction (B state.block) ctr ctr Tez.one_mutez in + let* head_B = Block.bake ~policy:(By_round 0) state.block ~operation in + let heads, state = register_temporary head_A head_B state in + match heads with + | None -> return ([], state) + | Some (b1, b2) -> + let* delegate1, delegate2 = pick_two_endorsers (B b1) in + let* op1 = Op.raw_preendorsement ~delegate:delegate1 b1 in + let* op2 = Op.raw_preendorsement ~delegate:delegate1 b2 in + let op1, op2 = + let comp = + Tezos_crypto.Operation_hash.compare + (Operation.hash op1) + (Operation.hash op2) + in + assert (comp <> 0) ; + if comp < 0 then (op1, op2) else (op2, op1) + in + let slashable_preend = + (op1, op2) :: state.dbl_endorsement.slashable_preend + in + let* op3 = Op.raw_endorsement ~delegate:delegate2 b1 in + let* op4 = Op.raw_endorsement ~delegate:delegate2 b2 in + let op3, op4 = + let comp = + Tezos_crypto.Operation_hash.compare + (Operation.hash op3) + (Operation.hash op4) + in + assert (comp <> 0) ; + if comp < 0 then (op3, op4) else (op4, op3) + in + let slashable_end = (op3, op4) :: state.dbl_endorsement.slashable_end in + let dbl_endorsement = + {state.dbl_endorsement with slashable_preend; slashable_end} + in + return ([], {state with dbl_endorsement}) + +let double_consensus_descriptor = + { + parameters = Fun.id; + required_cycle = (fun _params -> 2); + required_block = (fun _ -> 0); + prelude = (From 2, dbl_endorsement_prelude); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen_dbl_pre (op1, op2) = + Op.double_preendorsement (Context.B state.block) op1 op2 + in + let gen_dbl_end (op1, op2) = + Op.double_endorsement (Context.B state.block) op1 op2 + in + let candidates_pre = + List.map gen_dbl_pre state.dbl_endorsement.slashable_preend + in + let candidates_end = + List.map gen_dbl_end state.dbl_endorsement.slashable_end + in + return (candidates_pre @ candidates_end)); + } + +let double_baking_descriptor = + { + parameters = Fun.id; + required_cycle = (fun params -> params.constants.max_slashing_period); + required_block = (fun _ -> 0); + prelude = + ( From 2, + fun state -> + let open Lwt_result_syntax in + let order_block_header bh1 bh2 = + let hash1 = Block_header.hash bh1 in + let hash2 = Block_header.hash bh2 in + let c = Tezos_crypto.Block_hash.compare hash1 hash2 in + if c < 0 then (bh1, bh2) else (bh2, bh1) + in + let* ctxt = Context.to_alpha_ctxt (B state.block) in + let blocks_per_cycle = + Alpha_context.Constants.blocks_per_cycle ctxt + in + let rem = + Int32.rem + state.block.Block.header.Block_header.shell.level + blocks_per_cycle + in + if rem = 0l then return ([], state) + else + let* baker1, _baker2 = + Context.get_first_different_bakers (B state.block) + in + let* addr = pick_addr_endorser (B state.block) in + let ctr = Contract.Implicit addr in + let* operation = + Op.transaction (B state.block) ctr ctr Tez.one_mutez + in + let* ba = + Block.bake ~policy:(By_account baker1) ~operation state.block + in + let* bb = Block.bake ~policy:(By_account baker1) state.block in + let ba, bb = order_block_header ba.Block.header bb.Block.header in + let slashable_bakes = (ba, bb) :: state.slashable_bakes in + return ([], {state with slashable_bakes}) ); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen (bh1, bh2) = + return (Op.double_baking (B state.block) bh1 bh2) + in + List.map_es gen state.slashable_bakes); + } + +(** A drain delegate operation is valid when, preserved_cycle before, the + delegate has updated its key. This key must then has enough fund in order to + be revealed. + + At the first level of preserved cycle in the past, the key is funded by a + bootstrap account. At the second level, it reveals and at the third the + delegate updates its key to this key. *) +let drain_delegate_prelude state = + let open Lwt_result_syntax in + let* ctxt = Context.to_alpha_ctxt (B state.block) in + let blocks_per_cycle = Alpha_context.Constants.blocks_per_cycle ctxt in + let rem = + Int32.rem state.block.Block.header.Block_header.shell.level blocks_per_cycle + in + if rem = 0l then + (* Create (n / 2) consensus keys *) + let delegates = + List.mapi + (fun i -> function + | (delegate, None) as del -> + if i mod 2 = 0 then + let acc = Account.new_account () in + (delegate, Some acc.pkh) + else del + | del -> del (* should not happen but apparently does...*)) + state.delegates + in + let dels = + List.filter_map + (function _del, None -> None | del, Some ck -> Some (del, ck)) + delegates + in + let* ops = + List.fold_left_es + (fun ops (del, ck) -> + let* {Account.pk; _} = Account.find ck in + let* op = + Op.update_consensus_key (B state.block) (Contract.Implicit del) pk + in + return (op :: ops)) + [] + dels + in + let state = {state with delegates} in + return (ops, state) + else return ([], state) + +let drain_delegate_descriptor = + { + parameters = Fun.id; + required_cycle = (fun params -> params.constants.preserved_cycles + 1); + required_block = (fun _ -> 0); + prelude = + (On (init_params.constants.preserved_cycles + 1), drain_delegate_prelude); + opt_prelude = None; + candidates_generator = + (fun state -> + let gen (delegate, consensus_key_opt) = + let open Lwt_result_syntax in + match consensus_key_opt with + | None -> return_none + | Some consensus_key -> + let* op = + Op.drain_delegate + (B state.block) + ~consensus_key + ~delegate + ~destination:consensus_key + in + return_some op + in + List.filter_map_es gen state.delegates); + } + +let vdf_revelation_descriptor = + { + parameters = + (fun params -> + {params with constants = {params.constants with vdf_difficulty = 750L}}); + required_cycle = (fun _ -> 1); + required_block = + (fun params -> Int32.to_int params.constants.nonce_revelation_threshold); + prelude = (On 2, fun state -> return ([], {state with vdf = true})); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let* seed_status = Context.get_seed_computation (B state.block) in + let* csts = Context.get_constants (B state.block) in + match seed_status with + | Nonce_revelation_stage | Computation_finished -> assert false + | Vdf_revelation_stage info -> + (* generate the VDF discriminant and challenge *) + let discriminant, challenge = + Alpha_context.Seed.generate_vdf_setup + ~seed_discriminant:info.seed_discriminant + ~seed_challenge:info.seed_challenge + in + (* compute the VDF solution (the result and the proof ) *) + let solution = + (* generate the result and proof *) + Environment.Vdf.prove + discriminant + challenge + csts.parametric.vdf_difficulty + in + return [Op.vdf_revelation (B state.block) solution]); + } + +let preendorsement_descriptor = + { + parameters = Fun.id; + required_cycle = (fun _ -> 1); + required_block = (fun _ -> 1); + prelude = (On 1, fun state -> return ([], state)); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen (delegate, ck_opt) = + let* slots_opt = Context.get_endorser_slot (B state.block) delegate in + let delegate = Option.value ~default:delegate ck_opt in + match slots_opt with + | None -> return_none + | Some slots -> ( + match slots with + | [] -> return_none + | _ :: _ -> + let* op = Op.preendorsement ~delegate state.block in + return_some op) + in + List.filter_map_es gen state.delegates); + } + +let endorsement_descriptor = + { + parameters = Fun.id; + required_cycle = (fun _ -> 1); + required_block = (fun _ -> 1); + prelude = (On 1, fun state -> return ([], state)); + opt_prelude = None; + candidates_generator = + (fun state -> + let open Lwt_result_syntax in + let gen (delegate, ck_opt) = + let* slots_opt = Context.get_endorser_slot (B state.block) delegate in + let delegate = Option.value ~default:delegate ck_opt in + match slots_opt with + | None -> return_none + | Some slots -> ( + match slots with + | [] -> return_none + | _ :: _ -> + let* op = Op.endorsement ~delegate state.block in + return_some op) + in + List.filter_map_es gen state.delegates); + } + +let dal_slot_availibility ctxt delegate = + let open Lwt_result_syntax in + let level = Alpha_context.Level.current ctxt in + let pkh_from_tenderbake_slot slot = + Alpha_context.Stake_distribution.slot_owner ctxt level slot + >|=? fun (ctxt, consensus_pk1) -> (ctxt, consensus_pk1.delegate) + in + let* committee = + Alpha_context.Dal.Attestation.compute_committee + ctxt + pkh_from_tenderbake_slot + in + match + Environment.Signature.Public_key_hash.Map.find + delegate + committee.pkh_to_shards + with + | None -> return_none + | Some _interval -> + (* The content of the attestation does not matter for covalidity. *) + let attestation = Dal.Attestation.empty in + let level = Raw_level.succ level.Level.level in + return_some (Dal_attestation {attestor = delegate; attestation; level}) + +let dal_attestation_descriptor = + let open Lwt_result_syntax in + { + parameters = + (fun params -> + let dal = {params.constants.dal with feature_enable = true} in + let constants = {params.constants with dal} in + {params with constants}); + required_cycle = (fun _ -> 0); + required_block = (fun _ -> 0); + prelude = (On 1, fun state -> return ([], state)); + opt_prelude = None; + candidates_generator = + (fun state -> + let gen (delegate, _) = + let* ctxt = Context.to_alpha_ctxt (B state.block) in + let* op = + dal_slot_availibility ctxt delegate >|= Environment.wrap_tzresult + in + return + (op + |> Option.map (fun op -> + Op.pack_operation (B state.block) None (Single op))) + in + List.filter_map_es gen state.delegates); + } + +module Manager = Manager_operation_helpers + +let required_nb_account = 7 + +(** Convertion from [manager_state] to a {! Manager_operation_helper.infos}. *) +let infos_of_state source block infos : Manager.infos = + let open Manager in + let ({ctxt; accounts; flags} : infos) = infos in + let ctxt : ctxt = {ctxt with block} in + let accounts = {accounts with sources = [source]} in + {ctxt; accounts; flags} + +(** Updating a [manager_state] according to a {! Manager_operation_helper.infos}. *) +let update_state_with_infos {Manager.ctxt; accounts; flags} + {Manager.ctxt = ctxt2; accounts = accounts2; _} = + let ctxt = + { + ctxt with + originated_contract = ctxt2.originated_contract; + tx_rollup = ctxt2.tx_rollup; + sc_rollup = ctxt2.sc_rollup; + zk_rollup = ctxt2.zk_rollup; + } + in + let accounts = + { + accounts with + dest = accounts2.dest; + del = accounts2.del; + tx = accounts2.tx; + sc = accounts2.sc; + zk = accounts2.zk; + } + in + {Manager.ctxt; accounts; flags} + +(** According to a [Manager.infos] and a block [b], create and fund + the required contracts and accounts on [b]. In additions to the + initiation performed by {! Manager_operation_helper.init_infos}, it + registers a list of funded sources. *) +let manager_prelude (infos : Manager.infos) b = + let open Lwt_result_syntax in + let nb_sources = List.length infos.ctxt.bootstraps in + let* ops_by_bootstrap = + List.map_es + (fun bootstrap -> + let bootstrap = Contract.Implicit bootstrap in + let* counter = Context.Contract.counter (B b) bootstrap in + return (bootstrap, counter, [])) + (List.take_n nb_sources infos.ctxt.bootstraps) + in + let add bootstrap counter ops ops_by_bootstrap = + List.map + (fun (bootstrap', counter', ops') -> + if bootstrap' = bootstrap then + (bootstrap, Manager_counter.succ counter, ops) + else (bootstrap', counter', ops')) + ops_by_bootstrap + in + let batches block ops_by_bootstrap = + List.fold_left_es + (fun acc (source, _counter, operations) -> + match operations with + | [] -> return (List.rev acc) + | _ -> + let* batch = Op.batch_operations ~source (B block) operations in + return (batch :: acc)) + [] + ops_by_bootstrap + in + let create_and_fund sources ops_by_bootstrap = + let account = Account.new_account () in + let n = nb_sources - Stdlib.List.length sources in + let bootstrap, counter, ops = Stdlib.List.nth ops_by_bootstrap (n - 1) in + let amount = Tez.of_mutez (Int64.of_int 150000) in + let+ op, counter = + Manager.fund_account_op b bootstrap account.pkh amount counter + in + (account :: sources, add bootstrap counter (op :: ops) ops_by_bootstrap) + in + let* sources, src_operations = + List.fold_left_es + (fun (acc_accounts, acc_ops) _ -> create_and_fund acc_accounts acc_ops) + ([], ops_by_bootstrap) + (1 -- nb_sources) + in + let* operations = batches b src_operations in + let infos = {infos with accounts = {infos.accounts with sources}} in + let* infos2 = + Manager.init_infos + Manager.ctxt_req_default + b + (List.take_n required_nb_account infos.ctxt.bootstraps) + in + let state = update_state_with_infos infos infos2 in + return (operations, state) + +(** Build a manager operation according to the information in [infos] + on [block] for each source in the [manager_state] guaranteeing + that they are not conflicting. *) +let manager_candidates block infos batch_max_size = + let open Lwt_result_syntax in + let params = + List.map + (fun src -> + let m = gen_bounded_int 1 batch_max_size in + let kd = pick_n m Manager.revealed_subjects in + (src, kd)) + infos.Manager.accounts.sources + in + let gen (source, ks) = + let infos = infos_of_state source block infos in + let* reveal = + Manager.mk_reveal (Manager.operation_req_default Manager.K_Reveal) infos + in + let* operations = + List.map_es + (fun kd -> Manager.select_op (Manager.operation_req_default kd) infos) + ks + in + let* operations = return (reveal :: operations) in + Op.batch_operations + ~recompute_counters:true + ~source:(Contract.Implicit source.pkh) + (B block) + operations + in + List.map_es gen params + +let manager_descriptor max_batch_size nb_accounts = + { + parameters = + (fun params -> + let ctxt_req_default = Manager.ctxt_req_default in + let hard_gas_limit_per_block = + Some (Gas.Arith.integral_of_int_exn ((nb_accounts + 1) * 5_200_000)) + in + let ctxt_req = {ctxt_req_default with hard_gas_limit_per_block} in + Manager.manager_parameters params ctxt_req); + required_cycle = (fun _ -> 1); + required_block = (fun _ -> 1); + prelude = + ( On 1, + fun state -> + let open Lwt_result_syntax in + let* ops, manager = manager_prelude state.manager state.block in + let state = {state with manager} in + return (ops, state) ); + opt_prelude = None; + candidates_generator = + (fun state -> manager_candidates state.block state.manager max_batch_size); + } + +type op_kind = + | KEndorsement + | KPreendorsement + | KDalattestation + | KBallotExp + | KBallotProm + | KProposals + | KNonce + | KVdf + | KActivate + | KDbl_consensus + | KDbl_baking + | KDrain + | KManager + +let op_kind_of_packed_operation op = + let (Operation_data {contents; _}) = op.protocol_data in + match contents with + | Single (Preendorsement _) -> KPreendorsement + | Single (Endorsement _) -> KEndorsement + | Single (Dal_attestation _) -> KDalattestation + | Single (Seed_nonce_revelation _) -> KNonce + | Single (Vdf_revelation _) -> KVdf + | Single (Double_endorsement_evidence _) -> KDbl_consensus + | Single (Double_preendorsement_evidence _) -> KDbl_consensus + | Single (Double_baking_evidence _) -> KDbl_baking + | Single (Activate_account _) -> KActivate + | Single (Proposals _) -> KProposals + | Single (Ballot _) -> KBallotExp + | Single (Drain_delegate _) -> KDrain + | Single (Manager_operation _) -> KManager + | Cons (Manager_operation _, _) -> KManager + | Single (Failing_noop _) -> assert false + +let pp_op_kind fmt kind = + Format.fprintf + fmt + (match kind with + | KManager -> "manager" + | KEndorsement -> "endorsement" + | KPreendorsement -> "preendorsement" + | KDalattestation -> "dal_attestation" + | KBallotExp -> "ballot" + | KBallotProm -> "ballot" + | KProposals -> "proposals" + | KNonce -> "nonce" + | KVdf -> "vdf_revelation" + | KActivate -> "activate_account" + | KDbl_consensus -> "double_consensus" + | KDbl_baking -> "double_baking" + | KDrain -> "drain_delegate") + +let descriptor_of ~nb_bootstrap ~max_batch_size = function + | KManager -> manager_descriptor max_batch_size nb_bootstrap + | KEndorsement -> endorsement_descriptor + | KPreendorsement -> preendorsement_descriptor + | KDalattestation -> dal_attestation_descriptor + | KBallotExp -> ballot_exploration_descriptor + | KBallotProm -> ballot_promotion_descriptor + | KProposals -> proposal_descriptor + | KNonce -> seed_nonce_descriptor + | KVdf -> vdf_revelation_descriptor + | KActivate -> activate_descriptor + | KDbl_consensus -> double_consensus_descriptor + | KDbl_baking -> double_baking_descriptor + | KDrain -> drain_delegate_descriptor + +let descriptors_of ~nb_bootstrap ~max_batch_size = + List.map (descriptor_of ~nb_bootstrap ~max_batch_size) + +(** A context is in a unique voting period. *) +let voting_kinds = [KProposals; KBallotExp; KBallotProm] + +(** A context either wait for nonce revelation or vdf revelation + but not both at the same time. *) +let nonce_generation_kinds = [KNonce; KVdf] + +(** All kind list, used in the sanity check.*) +let non_exclusive_kinds = + [ + KManager; + KEndorsement; + KPreendorsement; + KDalattestation; + KActivate; + KDbl_consensus; + KDbl_baking; + KDrain; + ] + +let all_kinds = voting_kinds @ nonce_generation_kinds @ non_exclusive_kinds diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.mli b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.mli new file mode 100644 index 000000000000..b0870b34a5be --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generator_descriptors.mli @@ -0,0 +1,161 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Validate_helpers + +(** {2 Generation state} *) + +(** The state to generate valid double pre- and endorsement evidence + contains a temporary state for making the slashable evidence, and + the lists of slashables operations, one for each kind: + preendorsement and endorsement. *) +type dbl_endorsement_state = { + temporary : (Block.t * Block.t) option; + slashable_preend : + (Kind.preendorsement operation * Kind.preendorsement operation) list; + slashable_end : (Kind.endorsement operation * Kind.endorsement operation) list; +} + +(** Generic generation state collecting + information to generate any kind of operation. + + For example, {!Manager.infos} for manager + or voters (Contract.t list) for voting operations... + + When adding a new operation kind, [state] might be extended if a + new kind of information is required for this new kind valid + operations generation. *) +type state = { + block : Block.t; + pred : Block.t option; + bootstraps : public_key_hash list; + delegates : (public_key_hash * public_key_hash option) list; + voters : Contract.t list; + seed_nonce_to_reveal : (Raw_level.t * Nonce_hash.t) list; + commitments : secret_account list; + protocol_hashes : Tezos_crypto.Protocol_hash.t list; + slashable_bakes : (block_header * block_header) list; + vdf : bool; + dbl_endorsement : dbl_endorsement_state; + manager : Manager.infos; +} + +(** The initialization of a [state] requires the [voters] contracts -- + the contracts allowed to vote -- and the [bootstraps] contracts. *) +val init_state : + Block.t -> voters:Contract.t list -> bootstraps:Contract.t list -> state + +(** {2 Descriptor for valid operations generation} *) + +(** Each prelude action either takes place on a specific cycle or + from a specific cycle to the end a the context setting. *) +type cycle_index = On of int | From of int + +(** Descriptors are specific to operation kinds, [op_kind]. A + descriptor provides the information and functions used in the + context setup to generate valid operations of its kind and a + generator for such operations. + + - [parameters] enables setting constants in the initial context. + + - [required_cycle] is the number of cycles in the context setup + before generating valid operations of this kind. + + - [required_block] the number of blocks in the last cycle. + + - [prelude] is a set of actions that either gather information in + the setup [state] or perform operations in the setup blocks or both + that have to be performed according to a [cycle_index]. + + - [opt_prelude] is an optional prelude. + + - [candidates_generator] generates operations of the descriptor + [op_kind] according to the information in [state] that are valid + upon [state.block]. *) +type descriptor = { + parameters : Parameters.t -> Parameters.t; + required_cycle : Parameters.t -> int; + required_block : Parameters.t -> int; + prelude : + cycle_index * (state -> (packed_operation list * state) tzresult Lwt.t); + opt_prelude : + (cycle_index * (state -> (packed_operation list * state) tzresult Lwt.t)) + option; + candidates_generator : state -> packed_operation list tzresult Lwt.t; +} + +(** {2 Operation kinds} *) + +(** When adding a new operation: + - a new op_kind [k] should extend the [op_kind] type, + - a [descriptor] defined, + - [descriptor_of] must associate this new descriptor to [k], + - [k] must be added to [all_kinds], + - If the validity of [k] operations is not exclusive with the + validity of other [op_kind], [k] must be added to + [non_exclusive_kinds]. Otherwise, see, for example, how voting + operation op_kinds are handled in {! test_covalidity.tests}. *) +type op_kind = + | KEndorsement + | KPreendorsement + | KDalattestation + | KBallotExp + | KBallotProm + | KProposals + | KNonce + | KVdf + | KActivate + | KDbl_consensus + | KDbl_baking + | KDrain + | KManager + +val pp_op_kind : Format.formatter -> op_kind -> unit + +(** This sanity function returns the [op_kind] associated to + an [packed_operation].*) +val op_kind_of_packed_operation : packed_operation -> op_kind + +(** Associate to each [op_kind] a [descriptor]. Some descriptors are + parametrized by the number of bootstraps and the maximum size of a + batch.*) +val descriptor_of : + nb_bootstrap:int -> max_batch_size:int -> op_kind -> descriptor + +(** Given a list of [op_kind] returns the list of corresponding + descriptors as provided by [descriptor_of] for each [op_kind]. + Some descriptors are parametrized by the number of bootstraps and + the maximum size of a batch.*) +val descriptors_of : + nb_bootstrap:int -> max_batch_size:int -> op_kind list -> descriptor list + +(** List of all [op_kind] that are non exclusive (i.e. no voting +operation kind or nonce revelation kind) *) +val non_exclusive_kinds : op_kind trace + +(** List of all [op_kind] used for sanity check. *) +val all_kinds : op_kind list diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generators.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generators.ml new file mode 100644 index 000000000000..5affaba44799 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/generators.ml @@ -0,0 +1,281 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Manager_operation_helpers + +let lwt_run f = + match Lwt_main.run f with + | Error err -> + QCheck.Test.fail_reportf "@.Lwt_main.run error: %a@." pp_print_trace err + | Ok v -> v + +(** {2 Datatypes} *) + +(** Constraints on generated values. + + {ul + {li [Free] states that nothing has to be generated} + + {li [Pure n] generate n} + + {li [Less {n;origin}] (resp Greater) states the expected + constraints for the generated values that must be lesser (resp + greater) than [n] and shrink toward [origin] in case of error} + + {li [Range {min;max;origin}] states the expected constraints for + the generated values that must be between [min] and [max] and + shrink toward [origin] in case of error.}} *) +type cstrs = + | Free + | Pure of int + | Less of {n : int; origin : int} + | Greater of {n : int; origin : int} + | Range of {min : int; max : int; origin : int} + +(** Gas frequency. *) +type gas_freq = { + low : int; + max : int; + high : int; + zero : int; + custom : int * cstrs; +} + +(** Operation constraints. *) +type operation_cstrs = { + counter : cstrs; + fee : cstrs; + gas_limit : gas_freq; + storage_limit : cstrs; + force_reveal : bool option; + amount : cstrs; +} + +(** Context constraints. *) +type ctxt_cstrs = { + hard_gas_limit_per_block : cstrs; + src_cstrs : cstrs; + dest_cstrs : cstrs; + del_cstrs : cstrs; + tx_cstrs : cstrs; + sc_cstrs : cstrs; + zk_cstrs : cstrs; +} +(** {2 Default values} *) + +(** Default constraint. *) +let default_cstrs = Free + +(** Default gas frequency. *) +let default_gas_freq = + {low = 0; max = 0; high = 1; zero = 0; custom = (0, Free)} + +(** Default constraints for operation. *) +let default_operation_cstrs = + { + counter = default_cstrs; + fee = default_cstrs; + gas_limit = default_gas_freq; + storage_limit = default_cstrs; + force_reveal = None; + amount = default_cstrs; + } + +(** Default constraints for context. *) +let default_ctxt_cstrs = + { + hard_gas_limit_per_block = default_cstrs; + src_cstrs = default_cstrs; + dest_cstrs = default_cstrs; + del_cstrs = default_cstrs; + tx_cstrs = default_cstrs; + sc_cstrs = default_cstrs; + zk_cstrs = default_cstrs; + } + +(** {2 Generators} *) + +(** Generator of positive integers. *) +let gen_pos : cstrs -> int option QCheck2.Gen.t = + fun c -> + let open QCheck2.Gen in + match c with + | Free -> pure None + | Pure n -> pure (Some n) + | Less {n; origin} -> + let+ v = int_range ~origin 0 n in + Some v + | Greater {n; origin} -> + let+ v = int_range ~origin n max_int in + Some v + | Range {min; max; origin} -> + let+ v = int_range ~origin min max in + Some v + +(** Generator for Z.t that is used for gas limit. *) +let gen_z : cstrs -> Z.t option QCheck2.Gen.t = + fun cstrs -> + let open QCheck2.Gen in + let+ v = gen_pos cstrs in + Option.map Z.of_int v + +(** Generator for Manager_counter.t. *) +let gen_counter : cstrs -> Manager_counter.t option QCheck2.Gen.t = + fun cstrs -> + let open QCheck2.Gen in + let+ v = gen_pos cstrs in + Option.map Manager_counter.Internal_for_tests.of_int v + +(** Generator for Tez.t. *) +let gen_tez : cstrs -> Tez.t option QCheck2.Gen.t = + fun cstrs -> + let open QCheck2.Gen in + let+ amount = gen_pos cstrs in + match amount with + | Some amount -> + let amount = Int64.of_int amount in + Tez.of_mutez amount + | None -> None + +(** Generator for gas integral. *) +let gen_gas_integral : cstrs -> Gas.Arith.integral option QCheck2.Gen.t = + fun cstrs -> + let open QCheck2.Gen in + let+ v = gen_pos cstrs in + Option.map Gas.Arith.integral_of_int_exn v + +(** Generator for Op.gas_limit. *) +let gen_gas_limit : gas_freq -> Op.gas_limit option QCheck2.Gen.t = + fun gas_freq -> + let open QCheck2.Gen in + frequency + [ + (gas_freq.low, return (Some Op.Low)); + (gas_freq.max, return (Some Op.Max)); + (gas_freq.high, return (Some Op.High)); + (gas_freq.zero, return (Some Op.Zero)); + (let freq, cstrs = gas_freq.custom in + ( freq, + let+ gas = gen_gas_integral cstrs in + match gas with None -> None | Some g -> Some (Op.Custom_gas g) )); + ] + +(** Generator for manager_operation_kind. *) +let gen_kind : + manager_operation_kind list -> manager_operation_kind QCheck2.Gen.t = + fun subjects -> QCheck2.Gen.oneofl subjects + +(** Generator for mode. *) +let gen_mode : mode QCheck2.Gen.t = + QCheck2.Gen.oneofl [Construction; Mempool; Application] + +(** Generator for operation requirements. *) +let gen_operation_req : + operation_cstrs -> + manager_operation_kind list -> + operation_req QCheck2.Gen.t = + fun {counter; fee; gas_limit; storage_limit; force_reveal; amount} subjects -> + let open QCheck2.Gen in + let* kind = gen_kind subjects in + let* counter = gen_counter counter in + let* fee = gen_tez fee in + let* gas_limit = gen_gas_limit gas_limit in + let* storage_limit = gen_z storage_limit in + let+ amount = gen_tez amount in + {kind; counter; fee; gas_limit; storage_limit; force_reveal; amount} + +(** Generator for a pair of operations with the same source and + sequential counters.*) +let gen_2_operation_req : + operation_cstrs -> + manager_operation_kind list -> + (operation_req * operation_req) QCheck2.Gen.t = + fun op_cstrs subjects -> + let open QCheck2.Gen in + let* op1 = + gen_operation_req {op_cstrs with force_reveal = Some true} subjects + in + let counter = + match op1.counter with + | Some x -> Manager_counter.Internal_for_tests.to_int x + | None -> 1 + in + let op_cstr = + { + {op_cstrs with counter = Pure (counter + 2)} with + force_reveal = Some false; + } + in + let+ op2 = gen_operation_req op_cstr subjects in + (op1, op2) + +(** Generator for context requirement. *) +let gen_ctxt_req : ctxt_cstrs -> ctxt_req QCheck2.Gen.t = + fun { + hard_gas_limit_per_block; + src_cstrs; + dest_cstrs; + del_cstrs; + tx_cstrs; + sc_cstrs; + zk_cstrs; + } -> + let open QCheck2.Gen in + let* hard_gas_limit_per_block = gen_gas_integral hard_gas_limit_per_block in + let* fund_src = gen_tez src_cstrs in + let* fund_dest = gen_tez dest_cstrs in + let* fund_del = gen_tez del_cstrs in + let* fund_tx = gen_tez tx_cstrs in + let* fund_sc = gen_tez sc_cstrs in + let+ fund_zk = gen_tez zk_cstrs in + { + hard_gas_limit_per_block; + fund_src; + fund_dest; + fund_del; + reveal_accounts = true; + fund_tx; + fund_sc; + fund_zk; + flags = all_enabled; + } + +(** {2 Wrappers} *) + +let wrap ~name ?print ?(count = 1) ?check ~(gen : 'a QCheck2.Gen.t) + (f : 'a -> bool tzresult Lwt.t) = + Lib_test.Qcheck2_helpers.qcheck_make_result_lwt + ~name + ?print + ~count + ?check + ~extract:Lwt_main.run + ~pp_error:pp_print_trace + ~gen + f + +let wrap_mode infos op mode = validate_diagnostic ~mode infos op diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.ml new file mode 100644 index 000000000000..344152d913f9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/validate + Subject: Integration > Validate +*) + +let () = + Alcotest_lwt.run + "protocol > integration > validate" + [ + ("sanity checks", Test_sanity.tests); + ("mempool", Test_mempool.tests); + ("single manager validation", Test_manager_operation_validation.tests); + ("batched managers validation", Test_validation_batch.tests); + ("one-manager restriction", Test_1m_restriction.tests); + ("covalidity", Test_covalidity.tests); + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml new file mode 100644 index 000000000000..710a4ff05624 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml @@ -0,0 +1,1658 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Test_tez + +(** {2 Constants} *) + +(** Hard gas limit *) + +let gb_limit = Gas.Arith.(integral_of_int_exn 100_000) + +let half_gb_limit = Gas.Arith.(integral_of_int_exn 50_000) + +let default_fund = Tez.of_mutez_exn 400_000_000_000L + +(** {2 Datatypes} *) + +(** Context abstraction in a test. *) +type ctxt = { + block : Block.t; + bootstraps : public_key_hash list; + originated_contract : Contract_hash.t option; + tx_rollup : Tx_rollup.t option; + sc_rollup : Sc_rollup.t option; + zk_rollup : Zk_rollup.t option; +} + +(** Accounts manipulated in the tests. By convention, each field name + specifies the role of the account in a test. It is the case in most + of the tests. In operations smart contructors, it happens that in + impossible case, [source] is used as a dummy value. In some test that + requires a second source, [del] will be used as the second source. *) +type accounts = { + sources : Account.t list; + dest : Account.t option; + del : Account.t option; + tx : Account.t option; + sc : Account.t option; + zk : Account.t option; +} + +(** Feature flags requirements for a context setting for a test. *) +type feature_flags = {dal : bool; scoru : bool; toru : bool; zkru : bool} + +(** Infos describes the information of the setting for a test: the + context and used accounts. *) +type infos = {ctxt : ctxt; accounts : accounts; flags : feature_flags} + +(** This type should be extended for each new manager_operation kind + added in the protocol. See + [test_manager_operation_validation.ensure_kind] for more + information on how we ensure that this type is extended for each + new manager_operation kind. *) +type manager_operation_kind = + | K_Transaction + | K_Origination + | K_Register_global_constant + | K_Delegation + | K_Undelegation + | K_Self_delegation + | K_Set_deposits_limit + | K_Update_consensus_key + | K_Increase_paid_storage + | K_Reveal + | K_Tx_rollup_origination + | K_Tx_rollup_submit_batch + | K_Tx_rollup_commit + | K_Tx_rollup_return_bond + | K_Tx_rollup_finalize + | K_Tx_rollup_remove_commitment + | K_Tx_rollup_dispatch_tickets + | K_Transfer_ticket + | K_Tx_rollup_reject + | K_Sc_rollup_origination + | K_Sc_rollup_publish + | K_Sc_rollup_cement + | K_Sc_rollup_add_messages + | K_Sc_rollup_refute + | K_Sc_rollup_timeout + | K_Sc_rollup_execute_outbox_message + | K_Sc_rollup_recover_bond + | K_Dal_publish_slot_header + | K_Zk_rollup_origination + | K_Zk_rollup_publish + | K_Zk_rollup_update + +(** The requirements for a tested manager operation. *) +type operation_req = { + kind : manager_operation_kind; + counter : Manager_counter.t option; + fee : Tez.t option; + gas_limit : Op.gas_limit option; + storage_limit : Z.t option; + force_reveal : bool option; + amount : Tez.t option; +} + +(** The requirements for a context setting for a test. *) +type ctxt_req = { + hard_gas_limit_per_block : Gas.Arith.integral option; + fund_src : Tez.t option; + fund_dest : Tez.t option; + fund_del : Tez.t option; + reveal_accounts : bool; + fund_tx : Tez.t option; + fund_sc : Tez.t option; + fund_zk : Tez.t option; + flags : feature_flags; +} + +(** Validation mode. + + FIXME: https://gitlab.com/tezos/tezos/-/issues/3365 + This type should be replaced by the one defined + in validation, type mode in `validate_operation`, when it would + include the distinction between Contruction and Application. *) +type mode = Construction | Mempool | Application + +(** {2 Default values} *) +let all_enabled = {dal = true; scoru = true; toru = true; zkru = true} + +let disabled_dal = {all_enabled with dal = false} + +let disabled_scoru = {all_enabled with scoru = false} + +let disabled_toru = {all_enabled with toru = false} + +let disabled_zkru = {all_enabled with zkru = false} + +let ctxt_req_default_to_flag flags = + { + hard_gas_limit_per_block = None; + fund_src = Some default_fund; + fund_dest = Some Tez.one; + fund_del = Some default_fund; + reveal_accounts = true; + fund_tx = Some Tez.one; + fund_sc = Some Tez.one; + fund_zk = Some Tez.one; + flags; + } + +let ctxt_req_default = ctxt_req_default_to_flag all_enabled + +let operation_req_default kind = + { + kind; + counter = None; + fee = None; + gas_limit = None; + storage_limit = None; + force_reveal = None; + amount = None; + } + +(** {2 String_of data} *) +let kind_to_string = function + | K_Transaction -> "Transaction" + | K_Delegation -> "Delegation" + | K_Undelegation -> "Undelegation" + | K_Self_delegation -> "Self-delegation" + | K_Set_deposits_limit -> "Set deposits limit" + | K_Update_consensus_key -> "Update consensus key" + | K_Origination -> "Origination" + | K_Register_global_constant -> "Register global constant" + | K_Increase_paid_storage -> "Increase paid storage" + | K_Reveal -> "Revelation" + | K_Tx_rollup_origination -> "Tx_rollup_origination" + | K_Tx_rollup_submit_batch -> "Tx_rollup_submit_batch" + | K_Tx_rollup_commit -> "Tx_rollup_commit" + | K_Tx_rollup_return_bond -> "Tx_rollup_return_bond" + | K_Tx_rollup_finalize -> "Tx_rollup_finalize" + | K_Tx_rollup_remove_commitment -> "Tx_rollup_remove_commitment" + | K_Tx_rollup_dispatch_tickets -> "Tx_rollup_dispatch_tickets" + | K_Tx_rollup_reject -> "Tx_rollup_reject" + | K_Transfer_ticket -> "Transfer_ticket" + | K_Sc_rollup_origination -> "Sc_rollup_origination" + | K_Sc_rollup_publish -> "Sc_rollup_publish" + | K_Sc_rollup_cement -> "Sc_rollup_cement" + | K_Sc_rollup_timeout -> "Sc_rollup_timeout" + | K_Sc_rollup_refute -> "Sc_rollup_refute" + | K_Sc_rollup_add_messages -> "Sc_rollup_add_messages" + | K_Sc_rollup_execute_outbox_message -> "Sc_rollup_execute_outbox_message" + | K_Sc_rollup_recover_bond -> "Sc_rollup_recover_bond" + | K_Dal_publish_slot_header -> "Dal_publish_slot_header" + | K_Zk_rollup_origination -> "Zk_rollup_origination" + | K_Zk_rollup_publish -> "Zk_rollup_publish" + | K_Zk_rollup_update -> "Zk_rollup_update" + +(** {2 Pretty-printers} *) +let pp_opt pp v = + let open Format in + pp_print_option ~none:(fun fmt () -> fprintf fmt "None") pp v + +let pp_operation_req pp + {kind; counter; fee; gas_limit; storage_limit; force_reveal; amount} = + Format.fprintf + pp + "@[<v 4>Operation_req:@,\ + kind: %s@,\ + counter: %a@,\ + fee: %a@,\ + gas_limit: %a@,\ + storage_limit: %a@,\ + force_reveal: %a@,\ + amount: %a@,\ + @]" + (kind_to_string kind) + (pp_opt Manager_counter.pp) + counter + (pp_opt Tez.pp) + fee + (pp_opt Op.pp_gas_limit) + gas_limit + (pp_opt Z.pp_print) + storage_limit + (pp_opt (fun fmt -> Format.fprintf fmt "%b")) + force_reveal + (pp_opt Tez.pp) + amount + +let pp_2_operation_req pp (op_req1, op_req2) = + Format.fprintf + pp + "[<v 4> %a,@ and %a,@ @]" + pp_operation_req + op_req1 + pp_operation_req + op_req2 + +let pp_ctxt_req pp + { + hard_gas_limit_per_block; + fund_src; + fund_dest; + fund_del; + reveal_accounts; + fund_tx; + fund_sc; + fund_zk; + flags; + } = + Format.fprintf + pp + "@[<v 4>Ctxt_req:@,\ + hard_gas_limit_per_block:%a@,\ + fund_src: %a tz@,\ + fund_dest: %a tz@,\ + fund_del: %a tz@,\ + reveal_accounts: %b tz@,\ + fund_tx: %a tz@,\ + fund_sc: %a tz@,\ + fund_zk: %a tz@,\ + dal_flag: %a@,\ + scoru_flag: %a@,\ + toru_flag: %a@,\ + zkru_flag: %a@,\ + @]" + (pp_opt Gas.Arith.pp_integral) + hard_gas_limit_per_block + (pp_opt Tez.pp) + fund_src + (pp_opt Tez.pp) + fund_dest + (pp_opt Tez.pp) + fund_del + reveal_accounts + (pp_opt Tez.pp) + fund_tx + (pp_opt Tez.pp) + fund_sc + (pp_opt Tez.pp) + fund_zk + Format.pp_print_bool + flags.dal + Format.pp_print_bool + flags.scoru + Format.pp_print_bool + flags.toru + Format.pp_print_bool + flags.zkru + +let pp_mode pp = function + | Construction -> Format.fprintf pp "Construction" + | Mempool -> Format.fprintf pp "Mempool" + | Application -> Format.fprintf pp "Block" + +(** {2 Short-cuts} *) +let contract_of (account : Account.t) = Contract.Implicit account.pkh + +(** Make a [mempool_mode], aka a boolean, as used in incremental from + a [mode]. *) +let mempool_mode_of = function Mempool -> true | _ -> false + +let get_pk infos source = + let open Lwt_result_syntax in + let+ account = Context.Contract.manager infos source in + account.pk + +(** Operation for specific context. *) +let self_delegate block pkh = + let open Lwt_result_syntax in + let contract = Contract.Implicit pkh in + let* operation = + Op.delegation ~force_reveal:true (B block) contract (Some pkh) + in + let* block = Block.bake block ~operation in + let* del_opt_new = Context.Contract.delegate_opt (B block) contract in + let* del = Assert.get_some ~loc:__LOC__ del_opt_new in + let+ () = Assert.equal_pkh ~loc:__LOC__ del pkh in + block + +let delegation block source delegate = + let open Lwt_result_syntax in + let delegate_pkh = delegate.Account.pkh in + let contract_source = contract_of source in + let* operation = + Op.delegation + ~force_reveal:true + (B block) + contract_source + (Some delegate_pkh) + in + let* block = Block.bake block ~operation in + let* del_opt_new = Context.Contract.delegate_opt (B block) contract_source in + let* del = Assert.get_some ~loc:__LOC__ del_opt_new in + let* () = Assert.equal_pkh ~loc:__LOC__ del delegate_pkh in + return block + +let originate_tx_rollup block rollup_account = + let open Lwt_result_syntax in + let rollup_contract = contract_of rollup_account in + let* rollup_origination, tx_rollup = + Op.tx_rollup_origination ~force_reveal:true (B block) rollup_contract + in + let+ block = + Block.bake ~allow_manager_failures:true ~operation:rollup_origination block + in + (block, tx_rollup) + +let originate_sc_rollup block rollup_account = + let open Lwt_result_syntax in + let rollup_contract = contract_of rollup_account in + let* rollup_origination, sc_rollup = + Op.sc_rollup_origination + ~force_reveal:true + (B block) + rollup_contract + Sc_rollup.Kind.Example_arith + ~boot_sector:"" + ~parameters_ty:(Script.lazy_expr (Expr.from_string "1")) + in + let+ block = + Block.bake ~allow_manager_failures:true ~operation:rollup_origination block + in + (block, sc_rollup) + +module ZKOperator = Dummy_zk_rollup.Operator (struct + let batch_size = 10 +end) + +let originate_zk_rollup block rollup_account = + let open Lwt_result_syntax in + let rollup_contract = contract_of rollup_account in + let* rollup_origination, zk_rollup = + Op.zk_rollup_origination + ~force_reveal:true + (B block) + rollup_contract + ~public_parameters:ZKOperator.public_parameters + ~circuits_info: + (Zk_rollup.Account.SMap.of_seq @@ Plonk.SMap.to_seq ZKOperator.circuits) + ~init_state:ZKOperator.init_state + ~nb_ops:1 + in + let+ block = + Block.bake ~allow_manager_failures:true ~operation:rollup_origination block + in + (block, zk_rollup) + +(** {2 Setting's context construction} *) + +let fund_account_op block bootstrap account fund counter = + let open Lwt_result_syntax in + let* fund = + match fund with + | None -> return Tez.one + | Some fund -> + let* source_balance = Context.Contract.balance (B block) bootstrap in + if Tez.(fund > source_balance) then + Lwt.return (Environment.wrap_tzresult Tez.(source_balance -? one)) + else return fund + in + let+ op = + Op.transaction + ~counter + ~gas_limit:Op.High + (B block) + bootstrap + (Contract.Implicit account) + fund + in + (op, Manager_counter.succ counter) + +let fund_account block bootstrap account fund = + let open Lwt_result_syntax in + let* counter = Context.Contract.counter (B block) bootstrap in + let* operation, (_counter : Manager_counter.t) = + fund_account_op block bootstrap account fund counter + in + let*! b = Block.bake ~operation block in + match b with Error _ -> failwith "Funding account error" | Ok b -> return b + +(** Set the constants according to a [ctxt_req] in an existing parameters. *) +let manager_parameters : Parameters.t -> ctxt_req -> Parameters.t = + fun params {hard_gas_limit_per_block; flags; _} -> + let hard_gas_limit_per_block = + match hard_gas_limit_per_block with + | Some gb -> gb + | None -> Gas.Arith.(integral_of_int_exn 5_200_000) + in + let dal = {params.constants.dal with feature_enable = flags.dal} in + let tx_rollup = + { + params.constants.tx_rollup with + sunset_level = Int32.max_int; + enable = flags.toru; + } + in + let sc_rollup = {params.constants.sc_rollup with enable = flags.scoru} in + let zk_rollup = {params.constants.zk_rollup with enable = flags.zkru} in + let constants = + { + params.constants with + hard_gas_limit_per_block; + dal; + tx_rollup; + zk_rollup; + sc_rollup; + } + in + {params with constants} + +(** Initialize a context with the constants extracted from a context requirements + and 7 bootstrap accounts. *) +let init_ctxt_only ctxtreq = + let open Lwt_result_syntax in + let initial_params = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + {Context.default_test_constants with consensus_threshold = 0} + in + let*? _cryptobox = + Dal_helpers.mk_cryptobox initial_params.constants.dal.cryptobox_parameters + in + let* block, contracts = + Context.init_with_parameters_n (manager_parameters initial_params ctxtreq) 7 + in + return + ( block, + List.map + (function Contract.Implicit pkh -> pkh | Originated _ -> assert false) + contracts ) + +(** Build a generic setting for a test according to a context requirement + on an existing context with 7 bootstraps accounts. *) +let init_infos : + ctxt_req -> Block.t -> public_key_hash list -> infos tzresult Lwt.t = + fun ctxtreq block bootstraps -> + let { + fund_src; + fund_dest; + fund_del; + fund_tx; + fund_sc; + fund_zk; + flags; + reveal_accounts; + _; + } = + ctxtreq + in + let open Lwt_result_syntax in + let create_and_fund ?originate_rollup block bootstrap fund = + match fund with + | None -> return (block, None, None) + | Some _ -> + let account = Account.new_account () in + let* block = fund_account block bootstrap account.pkh fund in + let* block, rollup = + match originate_rollup with + | None -> return (block, None) + | Some f -> + let+ block, rollup = f block account in + (block, Some rollup) + in + return (block, Some account, rollup) + in + let reveal_accounts_operations b l = + List.filter_map_es + (function + | None -> return_none + | Some account -> + let* op = Op.revelation ~gas_limit:Low (B b) account.Account.pk in + return_some op) + l + in + let get_bootstrap bootstraps n = + Contract.Implicit (Stdlib.List.nth bootstraps n) + in + let source = Account.new_account () in + let* block = + fund_account block (get_bootstrap bootstraps 0) source.pkh fund_src + in + let* block, dest, _ = + create_and_fund block (get_bootstrap bootstraps 1) fund_dest + in + let* block, del, _ = + create_and_fund block (get_bootstrap bootstraps 2) fund_del + in + let* block, tx, tx_rollup = + if flags.toru then + create_and_fund + ~originate_rollup:originate_tx_rollup + block + (get_bootstrap bootstraps 3) + fund_tx + else return (block, None, None) + in + let* block, sc, sc_rollup = + if flags.scoru then + create_and_fund + ~originate_rollup:originate_sc_rollup + block + (get_bootstrap bootstraps 4) + fund_sc + else return (block, None, None) + in + let* block, zk, zk_rollup = + if flags.zkru then + create_and_fund + ~originate_rollup:originate_zk_rollup + block + (get_bootstrap bootstraps 5) + fund_zk + else return (block, None, None) + in + let* create_contract_hash, originated_contract = + Op.contract_origination_hash + (B block) + (get_bootstrap bootstraps 6) + ~fee:Tez.zero + ~script:Op.dummy_script + in + let* reveal_operations = + if reveal_accounts then + reveal_accounts_operations block [Some source; dest; del] + else return [] + in + let operations = create_contract_hash :: reveal_operations in + let+ block = Block.bake ~operations block in + let ctxt = + { + block; + bootstraps; + originated_contract = Some originated_contract; + tx_rollup; + sc_rollup; + zk_rollup; + } + in + {ctxt; accounts = {sources = [source]; dest; del; tx; sc; zk}; flags} + +(** The generic setting for a test is built up according to a context + requirement. It provides a context and accounts where the accounts + have been created and funded according to the context + requirements.*) +let init_ctxt : ctxt_req -> infos tzresult Lwt.t = + fun ctxtreq -> + let open Lwt_result_syntax in + let* block, bootstraps = init_ctxt_only ctxtreq in + init_infos ctxtreq block bootstraps + +(** return the first source from the list of sources in [infos] accounts. *) +let get_source infos = + match infos.accounts.sources with source :: _ -> source | [] -> assert false + +(** In addition of building up a context according to a context + requirement, source is self-delegated. + + see [init_ctxt] description. *) +let ctxt_with_self_delegation : ctxt_req -> infos tzresult Lwt.t = + fun ctxt_req -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let+ block = self_delegate infos.ctxt.block (get_source infos).pkh in + let ctxt = {infos.ctxt with block} in + {infos with ctxt} + +(** In addition of building up a context accordning to a context + requirement, source delegates to del. + + See [init_ctxt] description. *) +let ctxt_with_delegation : ctxt_req -> infos tzresult Lwt.t = + fun ctxt_req -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let* delegate = + match infos.accounts.del with + | None -> failwith "Delegate account should be funded" + | Some a -> return a + in + let* block = delegation infos.ctxt.block delegate delegate in + let+ block = delegation block (get_source infos) delegate in + let ctxt = {infos.ctxt with block} in + {infos with ctxt} + +let default_init_ctxt () = init_ctxt ctxt_req_default + +let default_init_with_flags flags = init_ctxt (ctxt_req_default_to_flag flags) + +let default_ctxt_with_self_delegation () = + ctxt_with_self_delegation ctxt_req_default + +let default_ctxt_with_delegation () = ctxt_with_delegation ctxt_req_default + +(** {2 Smart constructors} *) + +(** Smart constructors to forge manager operations according to + operation requirements in a test setting. *) + +let mk_transaction (oinfos : operation_req) (infos : infos) = + Op.transaction + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + (contract_of (get_source infos)) + (contract_of + (match infos.accounts.dest with + | None -> get_source infos + | Some dest -> dest)) + (match oinfos.amount with None -> Tez.zero | Some amount -> amount) + +let mk_delegation (oinfos : operation_req) (infos : infos) = + Op.delegation + ?force_reveal:oinfos.force_reveal + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + (contract_of (get_source infos)) + (Some + (match infos.accounts.del with + | None -> (get_source infos).pkh + | Some delegate -> delegate.pkh)) + +let mk_undelegation (oinfos : operation_req) (infos : infos) = + Op.delegation + ?force_reveal:oinfos.force_reveal + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + (contract_of (get_source infos)) + None + +let mk_self_delegation (oinfos : operation_req) (infos : infos) = + Op.delegation + ?force_reveal:oinfos.force_reveal + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + (contract_of (get_source infos)) + (Some (get_source infos).pkh) + +let mk_origination (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let+ op, _ = + Op.contract_origination + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + ~script:Op.dummy_script + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + op + +let mk_register_global_constant (oinfos : operation_req) (infos : infos) = + Op.register_global_constant + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + ~source:(contract_of (get_source infos)) + ~value:(Script_repr.lazy_expr (Expr.from_string "Pair 1 2")) + +let mk_set_deposits_limit (oinfos : operation_req) (infos : infos) = + Op.set_deposits_limit + ?force_reveal:oinfos.force_reveal + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + ?counter:oinfos.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + None + +let mk_update_consensus_key (oinfos : operation_req) (infos : infos) = + Op.update_consensus_key + ?force_reveal:oinfos.force_reveal + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + ?counter:oinfos.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + (match infos.accounts.dest with + | None -> (get_source infos).pk + | Some dest -> dest.pk) + +let mk_increase_paid_storage (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* destination = + match infos.ctxt.originated_contract with + | None -> + failwith + "infos should be initialized with an origniated contract to be able \ + to add an increase_paid_storage operation." + | Some c -> return c + in + Op.increase_paid_storage + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + ~source:(contract_of (get_source infos)) + ~destination + Z.one + +let mk_reveal (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* pk = get_pk (B infos.ctxt.block) (contract_of (get_source infos)) in + Op.revelation + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + pk + +let mk_tx_rollup_origination (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let+ op, _rollup = + Op.tx_rollup_origination + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + op + +let tx_rollup_of = function + | Some tx_rollup -> return tx_rollup + | None -> failwith "Tx_rollup not created in this context" + +let sc_rollup_of = function + | Some sc_rollup -> return sc_rollup + | None -> failwith "Sc_rollup not created in this context" + +let zk_rollup_of = function + | Some zk_rollup -> return zk_rollup + | None -> failwith "Zk_rollup not created in this context" + +let mk_tx_rollup_submit_batch (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + + Op.tx_rollup_submit_batch + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + "batch" + +let mk_tx_rollup_commit (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + let commitement : Tx_rollup_commitment.Full.t = + { + level = Tx_rollup_level.root; + messages = []; + predecessor = None; + inbox_merkle_root = Tx_rollup_inbox.Merkle.merklize_list []; + } + in + Op.tx_rollup_commit + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + commitement + +let mk_tx_rollup_return_bond (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + Op.tx_rollup_return_bond + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + +let mk_tx_rollup_finalize (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + Op.tx_rollup_finalize + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + +let mk_tx_rollup_remove_commitment (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + Op.tx_rollup_remove_commitment + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + +let mk_tx_rollup_reject (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + let message, _ = Tx_rollup_message.make_batch "" in + let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in + let message_path = + match Tx_rollup_inbox.Merkle.compute_path [message_hash] 0 with + | Ok message_path -> message_path + | _ -> raise (Invalid_argument "Single_message_inbox.message_path") + in + let proof : Tx_rollup_l2_proof.t = + { + version = 1; + before = `Value Tx_rollup_message_result.empty_l2_context_hash; + after = `Value Tezos_crypto.Context_hash.zero; + state = Seq.empty; + } + in + let previous_message_result : Tx_rollup_message_result.t = + { + context_hash = Tx_rollup_message_result.empty_l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash.empty; + } + in + Op.tx_rollup_reject + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + tx_rollup + Tx_rollup_level.root + message + ~message_position:0 + ~message_path + ~message_result_hash:Tx_rollup_message_result_hash.zero + ~message_result_path:Tx_rollup_commitment.Merkle.dummy_path + ~proof + ~previous_message_result + ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path + +let mk_transfer_ticket (oinfos : operation_req) (infos : infos) = + Op.transfer_ticket + ?fee:oinfos.fee + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + ~source:(contract_of (get_source infos)) + ~contents:(Script.lazy_expr (Expr.from_string "1")) + ~ty:(Script.lazy_expr (Expr.from_string "nat")) + ~ticketer: + (contract_of + (match infos.accounts.tx with + | None -> get_source infos + | Some tx -> tx)) + ~amount:Ticket_amount.one + ~destination: + (contract_of + (match infos.accounts.dest with + | None -> get_source infos + | Some dest -> dest)) + ~entrypoint:Entrypoint.default + +let mk_tx_rollup_dispacth_ticket (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* tx_rollup = tx_rollup_of infos.ctxt.tx_rollup in + let reveal = + Tx_rollup_reveal. + { + contents = Script.lazy_expr (Expr.from_string "1"); + ty = Script.lazy_expr (Expr.from_string "nat"); + ticketer = + contract_of + (match infos.accounts.dest with + | None -> get_source infos + | Some dest -> dest); + amount = Tx_rollup_l2_qty.of_int64_exn 10L; + claimer = + (match infos.accounts.dest with + | None -> (get_source infos).pkh + | Some dest -> dest.pkh); + } + in + Op.tx_rollup_dispatch_tickets + ?fee:oinfos.fee + ?force_reveal:oinfos.force_reveal + ?counter:oinfos.counter + ?gas_limit:oinfos.gas_limit + ?storage_limit:oinfos.storage_limit + (B infos.ctxt.block) + ~source:(contract_of (get_source infos)) + ~message_index:0 + ~message_result_path:Tx_rollup_commitment.Merkle.dummy_path + tx_rollup + Tx_rollup_level.root + Tezos_crypto.Context_hash.zero + [reveal] + +let mk_sc_rollup_origination (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let+ op, _ = + Op.sc_rollup_origination + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + Sc_rollup.Kind.Example_arith + ~boot_sector:"" + ~parameters_ty:(Script.lazy_expr (Expr.from_string "1")) + in + op + +let sc_dummy_commitment = + let number_of_ticks = + match Sc_rollup.Number_of_ticks.of_value 3000L with + | None -> assert false + | Some x -> x + in + Sc_rollup.Commitment. + { + predecessor = Sc_rollup.Commitment.Hash.zero; + inbox_level = Raw_level.of_int32_exn Int32.zero; + number_of_ticks; + compressed_state = Sc_rollup.State_hash.zero; + } + +let mk_sc_rollup_publish (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + Op.sc_rollup_publish + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + sc_rollup + sc_dummy_commitment + +let mk_sc_rollup_cement (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + Op.sc_rollup_cement + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + sc_rollup + (Sc_rollup.Commitment.hash_uncarbonated sc_dummy_commitment) + +let mk_sc_rollup_refute (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + let refutation : Sc_rollup.Game.refutation = + {choice = Sc_rollup.Tick.initial; step = Dissection []} + in + Op.sc_rollup_refute + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + sc_rollup + (match infos.accounts.dest with + | None -> (get_source infos).pkh + | Some dest -> dest.pkh) + (Some refutation) + +let mk_sc_rollup_add_messages (oinfos : operation_req) (infos : infos) = + Op.sc_rollup_add_messages + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + [""] + +let mk_sc_rollup_timeout (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + Op.sc_rollup_timeout + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + sc_rollup + (Sc_rollup.Game.Index.make + (get_source infos).pkh + (match infos.accounts.dest with + | None -> (get_source infos).pkh + | Some dest -> dest.pkh)) + +let mk_sc_rollup_execute_outbox_message (oinfos : operation_req) (infos : infos) + = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + Op.sc_rollup_execute_outbox_message + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + sc_rollup + (Sc_rollup.Commitment.hash_uncarbonated sc_dummy_commitment) + ~output_proof:"" + +let mk_sc_rollup_return_bond (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* sc_rollup = sc_rollup_of infos.ctxt.sc_rollup in + let source, staker = + match contract_of (get_source infos) with + | Implicit staker as source -> (source, staker) + | _ -> assert false + in + Op.sc_rollup_recover_bond + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + source + sc_rollup + staker + +let mk_dal_publish_slot_header (oinfos : operation_req) (infos : infos) = + let published_level = + Alpha_context.Raw_level.succ + @@ Alpha_context.Raw_level.of_int32_exn infos.ctxt.block.header.shell.level + in + let index = Alpha_context.Dal.Slot_index.zero in + let commitment = Alpha_context.Dal.Slot.Commitment.zero in + let proof = Alpha_context.Dal.Slot.Commitment_proof.zero in + let slot = + Alpha_context.Dal.Slot.Header. + {header = {id = {published_level; index}; commitment}; proof} + in + Op.dal_publish_slot_header + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + slot + +let mk_zk_rollup_origination (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* op, _ = + Op.zk_rollup_origination + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + ~public_parameters:ZKOperator.public_parameters + ~circuits_info: + (Zk_rollup.Account.SMap.of_seq @@ Plonk.SMap.to_seq ZKOperator.circuits) + ~init_state:ZKOperator.init_state + ~nb_ops:1 + in + return op + +let mk_zk_rollup_publish (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let open Zk_rollup.Operation in + let* zk_rollup = zk_rollup_of infos.ctxt.zk_rollup in + let l2_op = + {ZKOperator.Internal_for_tests.false_op with rollup_id = zk_rollup} + in + let* op = + Op.zk_rollup_publish + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + ~zk_rollup + ~ops:[(l2_op, None)] + in + return op + +let mk_zk_rollup_update (oinfos : operation_req) (infos : infos) = + let open Lwt_result_syntax in + let* zk_rollup = zk_rollup_of infos.ctxt.zk_rollup in + let* op = + Op.zk_rollup_update + ?fee:oinfos.fee + ?gas_limit:oinfos.gas_limit + ?counter:oinfos.counter + ?storage_limit:oinfos.storage_limit + ?force_reveal:oinfos.force_reveal + (B infos.ctxt.block) + (contract_of (get_source infos)) + ~zk_rollup + ~update:ZKOperator.Internal_for_tests.update_data + in + return op + +(** {2 Helpers for generation of generic check tests by manager operation} *) + +(** Generic forge for any kind of manager operation according to + operation requirements in a specific test setting. *) +let select_op (op_req : operation_req) (infos : infos) = + let mk_op = + match op_req.kind with + | K_Transaction -> mk_transaction + | K_Origination -> mk_origination + | K_Register_global_constant -> mk_register_global_constant + | K_Delegation -> mk_delegation + | K_Undelegation -> mk_undelegation + | K_Self_delegation -> mk_self_delegation + | K_Set_deposits_limit -> mk_set_deposits_limit + | K_Update_consensus_key -> mk_update_consensus_key + | K_Increase_paid_storage -> mk_increase_paid_storage + | K_Reveal -> mk_reveal + | K_Tx_rollup_origination -> mk_tx_rollup_origination + | K_Tx_rollup_submit_batch -> mk_tx_rollup_submit_batch + | K_Tx_rollup_commit -> mk_tx_rollup_commit + | K_Tx_rollup_return_bond -> mk_tx_rollup_return_bond + | K_Tx_rollup_finalize -> mk_tx_rollup_finalize + | K_Tx_rollup_remove_commitment -> mk_tx_rollup_remove_commitment + | K_Tx_rollup_reject -> mk_tx_rollup_reject + | K_Transfer_ticket -> mk_transfer_ticket + | K_Tx_rollup_dispatch_tickets -> mk_tx_rollup_dispacth_ticket + | K_Sc_rollup_origination -> mk_sc_rollup_origination + | K_Sc_rollup_publish -> mk_sc_rollup_publish + | K_Sc_rollup_cement -> mk_sc_rollup_cement + | K_Sc_rollup_refute -> mk_sc_rollup_refute + | K_Sc_rollup_add_messages -> mk_sc_rollup_add_messages + | K_Sc_rollup_timeout -> mk_sc_rollup_timeout + | K_Sc_rollup_execute_outbox_message -> mk_sc_rollup_execute_outbox_message + | K_Sc_rollup_recover_bond -> mk_sc_rollup_return_bond + | K_Dal_publish_slot_header -> mk_dal_publish_slot_header + | K_Zk_rollup_origination -> mk_zk_rollup_origination + | K_Zk_rollup_publish -> mk_zk_rollup_publish + | K_Zk_rollup_update -> mk_zk_rollup_update + in + mk_op op_req infos + +let make_tztest ?(fmt = Format.std_formatter) name test subjects info_builder = + let open Lwt_result_syntax in + Tztest.tztest name `Quick (fun () -> + let* infos = info_builder () in + List.iter_es + (fun kind -> + Format.fprintf fmt "%s: %s@." name (kind_to_string kind) ; + test infos kind) + subjects) + +let make_tztest_batched ?(fmt = Format.std_formatter) name test subjects + info_builder = + let open Lwt_result_syntax in + Tztest.tztest name `Quick (fun () -> + let* infos = info_builder () in + List.iter_es + (fun kind1 -> + let k1s = kind_to_string kind1 in + List.iter_es + (fun kind2 -> + Format.fprintf + fmt + "%s: [%s ; %s]@." + name + k1s + (kind_to_string kind2) ; + test infos kind1 kind2) + subjects) + subjects) + +(** {2 Diagnostic helpers.} *) + +(** The purpose of diagnostic helpers is to state the correct + observation according to the validate result of a test. *) + +(** For a manager operation a [probes] contains the values required + for observing its validate success. Its source, fees (sum for a + batch), gas_limit (sum of gas_limit of the batch), and the + increment of the counters aka 1 for a single operation, n for a + batch of n manager operations. *) +type probes = { + source : Tezos_crypto.Signature.Public_key_hash.t; + fee : Tez.tez; + gas_limit : Gas.Arith.integral; + nb_counter : int; +} + +let rec contents_infos : + type kind. kind Kind.manager contents_list -> probes tzresult Lwt.t = + fun op -> + let open Lwt_result_syntax in + match op with + | Single (Manager_operation {source; fee; gas_limit; _}) -> + return {source; fee; gas_limit; nb_counter = 1} + | Cons (Manager_operation manop, manops) -> + let* probes = contents_infos manops in + let*? fee = manop.fee +? probes.fee in + let gas_limit = Gas.Arith.add probes.gas_limit manop.gas_limit in + let nb_counter = succ probes.nb_counter in + let* () = Assert.equal_pkh ~loc:__LOC__ manop.source probes.source in + return {fee; source = probes.source; gas_limit; nb_counter} + +(** Computes a [probes] from a list of manager contents. *) +let manager_content_infos op = + let (Operation_data {contents; _}) = op.protocol_data in + match contents with + | Single (Manager_operation _) as op -> contents_infos op + | Cons (Manager_operation _, _) as op -> contents_infos op + | _ -> failwith "Should only handle manager operation" + +(** We need a way to get the available gas in a context of type + block. *) +let available_gas = function + | Context.I inc -> Some (Gas.block_level (Incremental.alpha_ctxt inc)) + | B _ -> None + +(** Computes the witness value in a state. The witness values are the + the initial balance of source, its initial counter and the + available gas in the state. The available gas is computed only + when the context is an incremental one. *) +let witness ctxt source = + let open Lwt_result_syntax in + let* b_in = Context.Contract.balance ctxt source in + let* c_in = Context.Contract.counter ctxt source in + let g_in = available_gas ctxt in + return (b_in, c_in, g_in) + +(** According to the witness in pre-state and the probes, computes the + expected outputs. In any mode, when the source is not deallocated, + the expected witness: + - the balance of source should be the one in the pre-state minus + the fee of probes, + - the counter of source should be the one in the pre-state plus + the number of counter in probes. + + Concerning the expected available gas in the block: + - In [Application] mode, it cannot be computed, so we do not expect + any, + - In [Mempool] mode, it is the remaining gas after removing the gas + of probes gas from an empty block, + - In the [Construction] mode, it is the remaining gas after removing + the gas of probes from the available gas in the pre-state.*) +let expected_witness witness probes ~mode ctxt = + let open Lwt_result_syntax in + let b_in, c_in, g_in = witness in + let*? b_expected = b_in -? probes.fee in + let c_expected = + Manager_counter.Internal_for_tests.add c_in probes.nb_counter + in + let* g_expected = + match (g_in, mode) with + | Some g_in, Construction -> + return_some (Gas.Arith.sub g_in (Gas.Arith.fp probes.gas_limit)) + | _, Mempool -> + Context.get_constants ctxt >>=? fun c -> + return_some + (Gas.Arith.sub + (Gas.Arith.fp c.parametric.hard_gas_limit_per_block) + (Gas.Arith.fp probes.gas_limit)) + | None, Application -> return_none + | Some _, Application -> + failwith "In application mode witness should not care about gas level" + | None, Construction -> + failwith "In Construction mode the witness should return a gas level" + in + return (b_expected, c_expected, g_expected) + +(** The validity of a test in positve case, observes that validation + of a manager operation implies the fee payment. This observation + differs according to the validation calling [mode] (see type mode + for more details) and that the [source] has been [deallocated]. + Given the values of witness in the pre-state, the probes of the + operation probes and the values of witness in the post-state, if + the validation succeeds while deallocating the [source], [source] + must be unallocated in the post-state. + + In case of successful validation Without deallocation, then we + observe in the post-state: + + The balance of source decreases at least by fee of probes when the + application has succeeded, + + Its counter in the pre-state increases by the number of counter of + probes. + + The remaining gas in the pre-state decreases at least by the gas + of probes, in [Construction] and [Mempool] mode. + + In [Mempool] mode, the remaining gas in the pre-state is always + the available gas in an empty block. + + In the [Application] mode, we do not perform any check on the + available gas. *) +let observe ~mode ~deallocated ctxt_pre ctxt_post op = + let open Lwt_result_syntax in + let check_deallocated ctxt contract = + let* actxt = Context.to_alpha_ctxt ctxt in + let*! res = Contract.must_be_allocated actxt contract in + match Environment.wrap_tzresult res with + | Ok () -> + failwith + "%a should have been deallocated@." + Tezos_crypto.Signature.Public_key_hash.pp + (Context.Contract.pkh contract) + | Error + [ + Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract _); + ] -> + return_unit + | Error errs -> + failwith "unexpected error, got %a@." Error_monad.pp_print_trace errs + in + let check_still_allocated ctxt_pre ctxt_post probes contract = + let* witness_in = witness ctxt_pre contract in + let* b_out, c_out, g_out = witness ctxt_post contract in + let* b_expected, c_expected, g_expected = + expected_witness witness_in probes ~mode ctxt_post + in + let b_cmp = + Assert.equal + ~loc:__LOC__ + Tez.( <= ) + "Balance decreases at least by fees" + Tez.pp + in + let* () = b_cmp b_out b_expected in + let* () = + Assert.equal + Manager_counter.equal + ~loc:__LOC__ + "Counter incrementation" + Manager_counter.pp + c_out + c_expected + in + let g_msg = + match mode with + | Application -> "Gas consumption (application)" + | Mempool -> "Gas consumption (mempool)" + | Construction -> "Gas consumption (construction)" + in + match g_expected with + | None -> Assert.is_none ~loc:__LOC__ ~pp:Gas.Arith.pp g_out + | Some g_expected -> + let* g_out = Assert.get_some ~loc:__LOC__ g_out in + Assert.equal + ~loc:__LOC__ + Gas.Arith.( <= ) + g_msg + Gas.Arith.pp + g_out + g_expected + in + let* probes = manager_content_infos op in + let contract = Contract.Implicit probes.source in + if deallocated then check_deallocated ctxt_post contract + else check_still_allocated ctxt_pre ctxt_post probes contract + +let observe_list ~mode ~deallocated ctxt_pre ctxt_post ops = + List.iter_es (fun op -> observe ~mode ~deallocated ctxt_pre ctxt_post op) ops + +let validate_operations_effects inc_in ops = + let open Lwt_result_syntax in + List.fold_left_es + (fun inc op -> + let* inc_out = + Incremental.add_operation ~allow_manager_failure:true inc op + in + return inc_out) + inc_in + ops + +(** In [Construction] and [Mempool] mode, the pre-state provide an + incremental, whereas in the [Application] mode, it is the block in + the setting context of the test. *) +let pre_state_of_mode ~mode infos = + let open Lwt_result_syntax in + match mode with + | Construction | Mempool -> + let* inc = Incremental.begin_construction infos.ctxt.block in + return (Context.I inc) + | Application -> return (Context.B infos.ctxt.block) + +(** In [Construction] and [Mempool] mode, the post-state is + incrementally built upon a pre-state, whereas in the [Application] + mode it is obtained by baking. *) +let post_state_of_mode ?(_only_validate = false) ~mode ctxt ops infos = + let open Lwt_result_syntax in + match (mode, ctxt) with + | (Construction | Mempool), Context.I inc_pre -> + let* inc_post = validate_operations_effects inc_pre ops in + let* block = Incremental.finalize_block inc_post in + return (Context.I inc_post, {infos with ctxt = {infos.ctxt with block}}) + | Application, Context.B b -> + let+ block = + Block.bake + ~allow_manager_failures:true + ~baking_mode:Application + ~operations:ops + b + in + (Context.B block, {infos with ctxt = {infos.ctxt with block}}) + | Application, Context.I _ -> + failwith "In Application mode, context should not be an Incremental" + | (Construction | Mempool), Context.B _ -> + failwith "In (Partial) Contruction mode, context should not be a Block" + +(** A positive test builds a pre-state from a mode, and a setting + context, then it computes a post-state from the mode, the setting + context and the operations. Finally, it observes the result + according to the [emptying] status for each operation. + + See [observe] for more details on the observational validation. + If the operation validation succeeds but should be deallocated, + then [deallocated ] must be set. + + Default mode is [Construction]. *) +let validate_diagnostic ?(deallocated = false) ?(mode = Construction) + (infos : infos) ops = + let open Lwt_result_syntax in + let* ctxt_pre = pre_state_of_mode ~mode infos in + let* ctxt_post, infos = post_state_of_mode ~mode ctxt_pre ops infos in + let* () = observe_list ~mode ~deallocated ctxt_pre ctxt_post ops in + return infos + +let add_operations ~expect_failure inc_in ops = + let open Lwt_result_syntax in + let* last, ops = + match List.rev ops with + | op :: rev_ops -> return (op, List.rev rev_ops) + | [] -> failwith "Empty list of operations given to add_operations" + in + let* inc = + List.fold_left_es + (fun inc op -> + let* inc = Incremental.validate_operation inc op in + return inc) + inc_in + ops + in + Incremental.validate_operation inc last ~expect_failure + +(** [validate_ko_diagnostic] wraps the [expect_failure] when [op] + validate failed. It is used in test that expects validate of the + last operation of a list of operations to fail. *) +let validate_ko_diagnostic ?(mode = Construction) (infos : infos) ops + expect_failure = + let open Lwt_result_syntax in + match mode with + | Construction | Mempool -> + let* i = + Incremental.begin_construction + infos.ctxt.block + ~mempool_mode:(mempool_mode_of mode) + in + let* (_ : Incremental.t) = add_operations ~expect_failure i ops in + return_unit + | Application -> ( + let*! res = + Block.bake + ~allow_manager_failures:true + ~baking_mode:Application + ~operations:ops + infos.ctxt.block + in + match res with + | Error tr -> expect_failure tr + | _ -> failwith "Block application was expected to fail") + +(** List of operation kinds that must run on generic tests. This list + should be extended for each new manager_operation kind. *) +let subjects = + [ + K_Transaction; + K_Origination; + K_Register_global_constant; + K_Delegation; + K_Undelegation; + K_Self_delegation; + K_Set_deposits_limit; + K_Update_consensus_key; + K_Increase_paid_storage; + K_Reveal; + K_Tx_rollup_origination; + K_Tx_rollup_submit_batch; + K_Tx_rollup_commit; + K_Tx_rollup_return_bond; + K_Tx_rollup_finalize; + K_Tx_rollup_remove_commitment; + K_Tx_rollup_dispatch_tickets; + K_Transfer_ticket; + K_Tx_rollup_reject; + K_Sc_rollup_origination; + K_Sc_rollup_publish; + K_Sc_rollup_cement; + K_Sc_rollup_add_messages; + K_Sc_rollup_refute; + K_Sc_rollup_timeout; + K_Sc_rollup_execute_outbox_message; + K_Sc_rollup_recover_bond; + K_Dal_publish_slot_header; + K_Zk_rollup_origination; + K_Zk_rollup_publish; + K_Zk_rollup_update; + ] + +let is_consumer = function + | K_Set_deposits_limit | K_Update_consensus_key | K_Increase_paid_storage + | K_Reveal | K_Self_delegation | K_Delegation | K_Undelegation + | K_Tx_rollup_origination | K_Tx_rollup_submit_batch | K_Tx_rollup_finalize + | K_Tx_rollup_commit | K_Tx_rollup_return_bond | K_Tx_rollup_remove_commitment + | K_Tx_rollup_reject | K_Sc_rollup_add_messages | K_Sc_rollup_origination + | K_Sc_rollup_refute | K_Sc_rollup_timeout | K_Sc_rollup_cement + | K_Sc_rollup_publish | K_Sc_rollup_execute_outbox_message + | K_Sc_rollup_recover_bond | K_Dal_publish_slot_header + | K_Zk_rollup_origination | K_Zk_rollup_publish | K_Zk_rollup_update -> + false + | K_Transaction | K_Origination | K_Register_global_constant + | K_Tx_rollup_dispatch_tickets | K_Transfer_ticket -> + true + +let gas_consumer_in_validate_subjects, not_gas_consumer_in_validate_subjects = + List.partition is_consumer subjects + +let revealed_subjects = + List.filter (function K_Reveal -> false | _ -> true) subjects + +let is_disabled flags = function + | K_Transaction | K_Origination | K_Register_global_constant | K_Delegation + | K_Undelegation | K_Self_delegation | K_Set_deposits_limit + | K_Update_consensus_key | K_Increase_paid_storage | K_Reveal -> + false + | K_Tx_rollup_origination | K_Tx_rollup_submit_batch | K_Tx_rollup_commit + | K_Tx_rollup_return_bond | K_Tx_rollup_finalize + | K_Tx_rollup_remove_commitment | K_Tx_rollup_dispatch_tickets + | K_Transfer_ticket | K_Tx_rollup_reject -> + flags.toru = false + | K_Sc_rollup_origination | K_Sc_rollup_publish | K_Sc_rollup_cement + | K_Sc_rollup_add_messages | K_Sc_rollup_refute | K_Sc_rollup_timeout + | K_Sc_rollup_execute_outbox_message | K_Sc_rollup_recover_bond -> + flags.scoru = false + | K_Dal_publish_slot_header -> flags.dal = false + | K_Zk_rollup_origination | K_Zk_rollup_publish | K_Zk_rollup_update -> + flags.zkru = false diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml new file mode 100644 index 000000000000..f4a2fbb75a99 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml @@ -0,0 +1,229 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (validate manager) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "^one-manager" + Subject: 1M restriction in validation of manager operation. +*) + +open Protocol +open Manager_operation_helpers +open Generators + +let count = 100 + +(** Local default values for the tests. *) +let ctxt_cstrs_default = + { + default_ctxt_cstrs with + src_cstrs = Pure 1500000; + dest_cstrs = Pure 15000; + del_cstrs = Pure 150000; + tx_cstrs = Pure 15000; + sc_cstrs = Pure 15000; + zk_cstrs = Pure 15000; + } + +let op_cstrs_default b = + { + default_operation_cstrs with + fee = Range {min = 0; max = 1_000; origin = 1_000}; + force_reveal = Some b; + amount = Range {min = 0; max = 10_000; origin = 10_000}; + } + +let print_one_op (ctxt_req, op_req, mode) = + Format.asprintf + "@[<v 2>Generator printer:@,%a@,%a@,%a@]" + pp_ctxt_req + ctxt_req + pp_operation_req + op_req + pp_mode + mode + +let print_two_ops (ctxt_req, op_req, op_req', mode) = + Format.asprintf + "@[<v 2>Generator printer:@,%a@,%a@,%a@,%a@]" + pp_ctxt_req + ctxt_req + pp_operation_req + op_req + pp_operation_req + op_req' + pp_mode + mode + +let print_ops_pair (ctxt_req, op_req, mode) = + Format.asprintf + "@[<v 2>Generator printer:@,%a@,%a@,%a@]" + pp_ctxt_req + ctxt_req + pp_2_operation_req + op_req + pp_mode + mode + +(** The application of a valid operation succeeds, at least, to perform + the fee payment. *) +let positive_tests = + let gen = + QCheck2.Gen.triple + (Generators.gen_ctxt_req ctxt_cstrs_default) + (Generators.gen_operation_req (op_cstrs_default true) subjects) + Generators.gen_mode + in + wrap + ~count + ~print:print_one_op + ~name:"positive validated op" + ~gen + (fun (ctxt_req, operation_req, mode) -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let* op = select_op operation_req infos in + let* (_ : infos) = wrap_mode infos [op] mode in + return_true) + +(** Under 1M restriction, neither a block nor a prevalidator's valid + pool should contain two operations with the same manager. It + raises a Manager_restriction error. *) +let two_op_from_same_manager_tests = + let gen = + QCheck2.Gen.quad + (Generators.gen_ctxt_req ctxt_cstrs_default) + (Generators.gen_operation_req (op_cstrs_default true) subjects) + (Generators.gen_operation_req (op_cstrs_default false) revealed_subjects) + Generators.gen_mode + in + let expect_failure = function + | [ + Environment.Ecoproto_error + (Validate_errors.Manager.Manager_restriction _); + ] -> + return_unit + | err -> + failwith + "Error trace:@,\ + \ %a does not match the \ + [Validate_errors.Manager.Manager_restriction] error" + Error_monad.pp_print_trace + err + in + wrap + ~count + ~print:print_two_ops + ~name:"check conflicts between managers." + ~gen + (fun (ctxt_req, operation_req, operation_req2, mode) -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let* op1 = select_op operation_req infos in + let* op2 = select_op operation_req2 infos in + let* () = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in + return_true) + +(** Under 1M restriction, a batch of two operations cannot be replaced + by two single operations. *) +let batch_is_not_singles_tests = + let gen = + QCheck2.Gen.triple + (Generators.gen_ctxt_req ctxt_cstrs_default) + (Generators.gen_2_operation_req + (op_cstrs_default false) + revealed_subjects) + Generators.gen_mode + in + let expect_failure _ = return_unit in + wrap + ~count + ~print:print_ops_pair + ~name:"batch is not sequence of Single" + ~gen + (fun (ctxt_req, operation_req, mode) -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let* op1 = select_op (fst operation_req) infos in + let* op2 = select_op (snd operation_req) infos in + let source = contract_of (get_source infos) in + let* batch = + Op.batch_operations ~source (B infos.ctxt.block) [op1; op2] + in + let* (_ : infos) = validate_diagnostic ~mode infos [batch] in + let* () = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in + return_true) + +(** The applications of two covalid operations in a certain context + succeed, at least, to perform the fee payment of both, in whatever + application order. *) +let conflict_free_tests = + let gen = + QCheck2.Gen.quad + (Generators.gen_ctxt_req ctxt_cstrs_default) + (Generators.gen_operation_req (op_cstrs_default true) revealed_subjects) + (Generators.gen_operation_req (op_cstrs_default true) revealed_subjects) + Generators.gen_mode + in + wrap + ~count + ~print:print_two_ops + ~name:"under 1M, co-valid ops commute" + ~gen + (fun (ctxt_req, operation_req, operation_req', mode) -> + let open Lwt_result_syntax in + let* infos = init_ctxt ctxt_req in + let* op1 = select_op operation_req infos in + let infos2 = + { + infos with + accounts = + { + infos.accounts with + sources = + (match infos.accounts.del with + | None -> assert false + | Some s -> [s]); + }; + } + in + let* op2 = select_op operation_req' infos2 in + let* (_ : infos) = validate_diagnostic ~mode infos [op1; op2] in + let* (_ : infos) = validate_diagnostic ~mode infos [op2; op1] in + return_true) + +open Lib_test.Qcheck2_helpers + +let tests : (string * [`Quick | `Slow] * (unit -> unit Lwt.t)) trace = + qcheck_wrap_lwt + [ + positive_tests; + two_op_from_same_manager_tests; + batch_is_not_singles_tests; + conflict_free_tests; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml new file mode 100644 index 000000000000..046d4cf44a95 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml @@ -0,0 +1,159 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (validate manager) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "^covalidity" + Subject: Validation of operation. +*) +open Validate_helpers + +open Generator_descriptors +open Valid_operations_generators +open Protocol +open Alpha_context + +(** Values of number of bootstraps to create.*) + +let default_batch_max_size = 49 + +let default_nb_bootstrap = 7 + +let nb_permutations = 30 + +let op_of_voting_period : Voting_period.kind -> op_kind = + let open Voting_period in + function + | Proposal -> KProposals + | Exploration -> KBallotExp + | Promotion -> KBallotProm + | _ -> assert false + +type seed_gen = Nonce | Vdf + +let pp_seed fmt = function + | Nonce -> Format.fprintf fmt "nonce" + | Vdf -> Format.fprintf fmt "vdf" + +let op_of_seed_gen = function Nonce -> KNonce | Vdf -> KVdf + +let is_not_preendorsement op = + let open Protocol.Alpha_context in + let (Operation_data {contents; _}) = op.protocol_data in + match contents with Single (Preendorsement _) -> false | _ -> true + +module OpkindMap = Map.Make (struct + type t = op_kind + + let compare = compare +end) + +let partition_op_kind op_kinds = + List.fold_left + (fun map op_kind -> + OpkindMap.update + op_kind + (function None -> Some 1 | Some c -> Some (succ c)) + map) + OpkindMap.empty + op_kinds + +let print_candidates candidates = + Format.printf + "@\n@[<v 2>%d operations generated:@ %a@]@." + (List.length candidates) + Format.( + pp_print_list ~pp_sep:pp_print_cut (fun fmt (op, c) -> + Format.fprintf fmt "%d: %a" c pp_op_kind op)) + (List.map op_kind_of_packed_operation candidates + |> partition_op_kind |> OpkindMap.bindings) + +(** Test that for the set of covalid operations which kinds belongs to [ks] in a + state, any permutation is covalid and can be baked into a valid block. *) +let covalid_permutation_and_bake ks nb_bootstrap = + let open Lwt_result_syntax in + let* state, candidates = + covalid ks ~nb_bootstrap ~max_batch_size:default_batch_max_size + in + print_candidates candidates ; + let* () = sequential_validate state.block candidates in + let rec loop = function + | 0 -> return_unit + | n -> + let operations = + QCheck2.Gen.shuffle_l candidates + |> QCheck2.Gen.generate1 + |> List.sort Protocol.Alpha_context.Operation.compare_by_passes + |> List.rev_filter is_not_preendorsement + in + (* Ensure that we can validate and apply this permutation *) + let* (_ : Block.t) = + Block.bake ~allow_manager_failures:true state.block ~operations + in + loop (pred n) + in + loop nb_permutations + +(** {2 Tests} *) + +let name voting_period reveal = + Format.asprintf + "scenario: '%a' period, '%a' seed" + Voting_period.pp_kind + voting_period + pp_seed + reveal + +(** Test [covalid_permutation_and_bake]. *) +let test_covalid voting_period seed_gen = + Generators.wrap + ~name:(name voting_period seed_gen) + ~gen:QCheck2.Gen.unit + (fun () -> + let open Lwt_result_syntax in + let ks = + op_of_voting_period voting_period + :: op_of_seed_gen seed_gen :: non_exclusive_kinds + in + let* () = covalid_permutation_and_bake ks default_nb_bootstrap in + return_true) + +let tests = + (* Create a list of all permutation of voting period and all + possible nonce generation *) + let voting_periods = [Voting_period.Proposal; Exploration; Promotion] in + let nonce_gens = [Nonce; Vdf] in + List.fold_left + (fun acc voting_period -> + List.fold_left + (fun acc nonce_gen -> test_covalid voting_period nonce_gen :: acc) + acc + nonce_gens) + [] + voting_periods + |> Lib_test.Qcheck2_helpers.qcheck_wrap_lwt diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml new file mode 100644 index 000000000000..5d7cbd291e3a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml @@ -0,0 +1,624 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (validate manager) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "^single" + Subject: Validation of manager operation. +*) + +open Protocol +open Alpha_context +open Manager_operation_helpers + +(** {2 Negative tests assert the case where validate must fail} *) + +(** Validate fails if the gas limit is too low. + + This test asserts that the validation of a manager operation + with a too low gas limit fails at validate with an + [Gas_quota_exceeded_init_deserialize] error. + This test applies on manager operations that do not + consume gas in their specific part of validate. *) +let low_gas_limit_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Gas_quota_exceeded_init_deserialize; + Environment.Ecoproto_error Raw_context.Operation_quota_exceeded; + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_low_gas_limit infos kind = + let open Lwt_result_syntax in + let* op = + select_op + { + (operation_req_default kind) with + gas_limit = Some Op.Low; + force_reveal = Some true; + } + infos + in + low_gas_limit_diagnostic infos [op] + +(** Validate fails if the gas limit is too high. + + This test asserts that the validation of a manager operation with + a gas limit too high fails at validate with an [Gas_limit_too_high] + error. It applies on every kind of manager operation. *) +let high_gas_limit_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error Gas.Gas_limit_too_high] -> return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_high_gas_limit infos kind = + let open Lwt_result_syntax in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + gas_limit = + Some (Op.Custom_gas (Gas.Arith.integral_of_int_exn 10_000_000)); + } + infos + in + high_gas_limit_diagnostic infos [op] + +(** Validate fails if the storage limit is too high. + + This test asserts that a manager operation with a storage limit + too high fails at validation with [Storage_limit_too_high] error. + It applies to every kind of manager operation. *) +let high_storage_limit_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error Fees_storage.Storage_limit_too_high] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_high_storage_limit infos kind = + let open Lwt_result_syntax in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + storage_limit = Some (Z.of_int max_int); + } + infos + in + high_storage_limit_diagnostic infos [op] + +(** Validate fails if the counter is in the future. + + This test asserts that the validation of + a manager operation with a counter in the + future -- aka greater than the successor of the manager counter + stored in the current context -- fails with [Counter_in_the_future] error. + It applies to every kind of manager operation. *) +let high_counter_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error (Contract_storage.Counter_in_the_future _)] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_high_counter infos kind = + let open Lwt_result_syntax in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + counter = Some (Manager_counter.Internal_for_tests.of_int max_int); + } + infos + in + high_counter_diagnostic infos [op] + +(** Validate fails if the counter is in the past. + + This test asserts that the validation of a manager operation with a + counter in the past -- aka smaller than the successor of the + manager counter stored in the current context -- fails with + [Counter_in_the_past] error. It applies to every kind of manager + operation. *) +let low_counter_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error (Contract_storage.Counter_in_the_past _)] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_low_counter infos kind = + let open Lwt_result_syntax in + let* current_counter = + Context.Contract.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + counter = + Some (Manager_counter.Internal_for_tests.add current_counter (-1)); + } + infos + in + low_counter_diagnostic infos [op] + +(** Validate fails if the source is not allocated. + + This test asserts that the validation of a manager operation which + manager contract is not allocated fails with + [Empty_implicit_contract] error. It applies on every kind of + manager operation. *) +let not_allocated_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract _)] + -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_not_allocated infos kind = + let open Lwt_result_syntax in + let* op = + select_op + {(operation_req_default kind) with force_reveal = Some false} + { + infos with + accounts = {infos.accounts with sources = [Account.(new_account ())]}; + } + in + not_allocated_diagnostic infos [op] + +(** Validate fails if the source is unrevealed. + + This test asserts that a manager operation with an unrevealed source + contract fails at validation with [Unrevealed_manager_key]. + It applies on every kind of manager operation except [Revelation]. *) +let unrevealed_key_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [ + Environment.Ecoproto_error + (Contract_manager_storage.Unrevealed_manager_key _); + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_unrevealed_key infos kind = + let open Lwt_result_syntax in + let* op = + select_op + {(operation_req_default kind) with force_reveal = Some false} + infos + in + unrevealed_key_diagnostic infos [op] + +(** Validate fails if the source balance is not enough to pay the fees. + + This test asserts that validation of a manager operation fails if the + source balance is lesser than the manager operation fee. + It applies on every kind of manager operation. *) +let high_fee_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [ + Environment.Ecoproto_error (Contract_storage.Balance_too_low _); + Environment.Ecoproto_error (Tez_repr.Subtraction_underflow _); + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_high_fee infos kind = + let open Lwt_result_syntax in + let*? fee = Tez.(one +? default_fund) |> Environment.wrap_tzresult in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + fee = Some fee; + } + infos + in + high_fee_diagnostic infos [op] + +(** Validate fails if the fee payment empties the balance of a + delegated implicit contract. + + This test asserts that in case that: + - the source is a delegated implicit contract, and + - the fee is the exact balance of source. + then, validate fails with [Empty_implicit_delegated_contract] error. + It applies to every kind of manager operation except [Revelation].*) +let emptying_delegated_implicit_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [ + Environment.Ecoproto_error + (Contract_storage.Empty_implicit_delegated_contract _); + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let test_empty_implicit infos kind = + let open Lwt_result_syntax in + let* fee = + Context.Contract.balance + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some false; + fee = Some fee; + } + infos + in + emptying_delegated_implicit_diagnostic infos [op] + +(** Validate fails if there is not enough available gas in the block. + + This test asserts that validate fails with: + - [Gas_limit_too_high;Block_quota_exceeded] in mempool mode, + - [Block_quota_exceeded] in other mode + with gas limit exceeds the available gas in the block. + It applies to every kind of manager operation. *) +let exceeding_block_gas_diagnostic ~mode (infos : infos) op = + let expect_failure errs = + match (errs, mode) with + | ( [Environment.Ecoproto_error Gas.Block_quota_exceeded], + (Construction | Application) ) -> + return_unit + | ( [ + Environment.Ecoproto_error Gas.Gas_limit_too_high; + Environment.Ecoproto_error Gas.Block_quota_exceeded; + ], + Mempool ) -> + (* In mempool_mode, batch that exceed [operation_gas_limit] needs + to be refused. [Gas.Block_quota_exceeded] only return a + temporary error. [Gas.Gas_limit_too_high], which is a + permanent error, is added to the error trace to ensure that + the batch is refused. *) + return_unit + | err, _ -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure ~mode + +let test_exceeding_block_gas ~mode infos kind = + let open Lwt_result_syntax in + let* operation = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + gas_limit = + Some + (Op.Custom_gas + (Gas.Arith.add gb_limit Gas.Arith.(integral_of_int_exn 1))); + } + infos + in + exceeding_block_gas_diagnostic ~mode infos [operation] + +(** {2 Positive tests} *) + +(** Tests that validate succeeds when: + - it empties the balance of a self_delegated implicit source, + - it empties the balance of an undelegated implicit source, and + - in case: + - the counter is the successor of the one stored in the context, + - the fee is lesser than the balance, + - the storage limit is lesser than the maximum authorized storage, + - the gas limit is: + - lesser than the available gas in the block, + - less than the maximum gas consumable by an operation, and + - greater than the minimum gas consumable by an operation. + + Notice that in the first two cases only validate succeeds while + in the last case, the full application also succeeds. + In the case of emptying the balance of an undelegated implicit source, + we observe in the output context that the source is deallocated. + + Otherwise, we observe in the output context that: + - the counter is the successor of the one stored in the initial context, + - the balance is at least decreased by fee, + - the available gas in the block decreased at least gas limit. *) + +(** Fee payment*) +let test_validate infos kind = + let open Lwt_result_syntax in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + amount = Some Tez.one; + } + infos + in + let* (_ : infos) = validate_diagnostic infos [op] in + return_unit + +(** Fee payment that emptying a self_delegated implicit. *) +let test_emptying_self_delegate infos kind = + let open Lwt_result_syntax in + let* fee = + Context.Contract.balance + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some false; + fee = Some fee; + } + infos + in + let* (_ : infos) = validate_diagnostic infos [op] in + return_unit + +(** Minimum gas cost to pass the validation: + - cost_of_manager_operation for the generic part + - 100 (empiric) for the specific part (script decoding or hash costs) *) +let empiric_minimal_gas_cost_for_validate = + Gas.Arith.integral_of_int_exn + (Michelson_v1_gas.Internal_for_tests.int_cost_of_manager_operation + 100) + +let test_empty_undelegate infos kind = + let open Lwt_result_syntax in + let* fee = + Context.Contract.balance + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + fee = Some fee; + gas_limit = Some (Op.Custom_gas empiric_minimal_gas_cost_for_validate); + } + infos + in + let* (_ : infos) = validate_diagnostic ~deallocated:true infos [op] in + return_unit + +(** No gas consumer with the minimal gas limit for manager operations + passes validate. *) +let test_low_gas_limit_no_consumer kind = + let open Lwt_result_syntax in + let* infos = default_init_ctxt () in + let* op = + select_op + { + (operation_req_default kind) with + force_reveal = Some true; + gas_limit = Some Op.Low; + } + infos + in + validate_diagnostic infos [op] + +(* Feature flags.*) + +(* Select the error according to the positionned flag. + We assume that only one feature is disabled. *) +let flag_expect_failure flags errs = + match errs with + | [ + Environment.Ecoproto_error Validate_errors.Manager.Sc_rollup_feature_disabled; + ] + when flags.scoru = false -> + return_unit + | [ + Environment.Ecoproto_error Validate_errors.Manager.Tx_rollup_feature_disabled; + ] + when flags.toru = false -> + return_unit + | [Environment.Ecoproto_error Dal_errors.Dal_feature_disabled] + when flags.dal = false -> + return_unit + | [ + Environment.Ecoproto_error Validate_errors.Manager.Zk_rollup_feature_disabled; + ] + when flags.zkru = false -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + +(* Tests that operations depending on feature flags are not valid + when the flag is set as disable. + + See [is_disabled] and the [flags] in `manager_operation_helpers`. + We assume that only one flag is set at false in flag. + + In order to forge Toru, Scoru or Dal operation when the correspondong + feature is disable, we use a [infos_op] with default requirements, + so that we have a Tx_rollup.t and a Sc_rollup.t. *) +let test_feature_flags infos kind = + let open Lwt_result_syntax in + let* counter = + Context.Contract.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let* op = + select_op + { + {(operation_req_default kind) with force_reveal = Some true} with + counter = Some counter; + } + infos + in + let flags = infos.flags in + if is_disabled flags kind then + validate_ko_diagnostic infos [op] (flag_expect_failure flags) + else + let* (_ : infos) = validate_diagnostic infos [op] in + return_unit + +let tests = + let mk_default () = default_init_ctxt () in + let mk_reveal () = + init_ctxt {ctxt_req_default with reveal_accounts = false} + in + let mk_deleg () = default_ctxt_with_delegation () in + let mk_gas () = + init_ctxt {ctxt_req_default with hard_gas_limit_per_block = Some gb_limit} + in + let mk_self_deleg () = default_ctxt_with_self_delegation () in + let mk_flags flags () = + let open Lwt_result_syntax in + let* infos_op = default_init_ctxt () in + let* infos = default_init_with_flags flags in + let infos = + { + infos with + ctxt = + { + infos.ctxt with + tx_rollup = infos_op.ctxt.tx_rollup; + sc_rollup = infos_op.ctxt.sc_rollup; + zk_rollup = infos_op.ctxt.zk_rollup; + }; + } + in + return infos + in + let all = subjects in + let gas_consum = gas_consumer_in_validate_subjects in + let revealed = revealed_subjects in + List.map + (fun (name, f, subjects, info_builder) -> + make_tztest name f subjects info_builder) + [ + (* Expected validation failure *) + ("gas limit too low", test_low_gas_limit, gas_consum, mk_default); + ("gas limit too high", test_high_gas_limit, all, mk_default); + ("storage limit too high", test_high_storage_limit, all, mk_default); + ("counter too high", test_high_counter, all, mk_default); + ("counter too low", test_low_counter, all, mk_default); + ("unallocated source", test_not_allocated, all, mk_default); + ("unrevealed source", test_unrevealed_key, revealed, mk_reveal); + ("balance too low for fee payment", test_high_fee, all, mk_default); + ("empty delegate source", test_empty_implicit, revealed, mk_deleg); + ( "too much gas consumption in block", + test_exceeding_block_gas ~mode:Construction, + all, + mk_gas ); + (* Expected validation success *) + ("fees are taken when valid", test_validate, all, mk_default); + ("empty self-delegate", test_emptying_self_delegate, all, mk_self_deleg); + ( "too much gas consumption in mempool", + test_exceeding_block_gas ~mode:Mempool, + all, + mk_gas ); + ("empty undelegated source", test_empty_undelegate, all, mk_default); + ("minimal gas for manager", test_low_gas_limit, gas_consum, mk_default); + ("check dal disabled", test_feature_flags, all, mk_flags disabled_dal); + ("check toru disabled", test_feature_flags, all, mk_flags disabled_toru); + ("check scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); + ("check zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml new file mode 100644 index 000000000000..4547bed9fa28 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml @@ -0,0 +1,389 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "^Mempool" + Subject: Integration > Validate > Mempool mode +*) + +open Protocol +open Alpha_context +module Mempool = Mempool_validation + +let extract_values ctxt (b : Block.t) = + let predecessor_level = + Level.from_raw ctxt (Raw_level.of_int32_exn b.header.shell.level) + in + let fitness = + Fitness.from_raw b.header.shell.fitness |> function + | Ok v -> v + | Error _ -> assert false + in + let predecessor_round = Fitness.round fitness in + let predecessor_hash = b.header.shell.predecessor in + let grandparent_round = Fitness.predecessor_round fitness in + (predecessor_level, predecessor_round, predecessor_hash, grandparent_round) + +let op_with_hash op = (Operation.hash_packed op, op) + +let expect_ok_added ~__LOC__ x = + match x with + | Ok (mempool, Mempool.Added) -> mempool + | _ -> Format.kasprintf Stdlib.failwith "%s: expected added" __LOC__ + +let expect_conflict ~__LOC__ x = + match (x : ('a, Mempool.add_error) result) with + | Error (Add_conflict _) -> () + | _ -> Format.kasprintf Stdlib.failwith "%s: expected conflict" __LOC__ + +let expect_conflict_handled ~__LOC__ kind x = + match (x : (Mempool.t * Mempool.add_result, Mempool.add_error) result) with + | Ok (mempool, kind') when kind = kind' -> mempool + | _ -> + Format.kasprintf Stdlib.failwith "%s: expected handled conflict" __LOC__ + +let handler_always_keep ~existing_operation:_ ~new_operation:_ = `Keep + +let handler_always_replace ~existing_operation:_ ~new_operation:_ = `Replace + +let assert_empty_mempool ~__LOC__ mempool = + let operations = Mempool.operations mempool in + Assert.equal_bool + ~loc:__LOC__ + true + (Environment.Operation_hash.Map.is_empty operations) + +let assert_operation_present_in_mempool ~__LOC__ mempool ophl = + let operations = Mempool.operations mempool in + let resulting_mempool_operations = + Environment.Operation_hash.Map.bindings operations + |> List.map fst + |> List.sort Tezos_crypto.Operation_hash.compare + in + let expected_operations = + List.sort Tezos_crypto.Operation_hash.compare ophl + in + Assert.assert_equal_list + ~loc:__LOC__ + Tezos_crypto.Operation_hash.equal + "operations present in mempool" + Tezos_crypto.Operation_hash.pp + resulting_mempool_operations + expected_operations + +let test_simple () = + let open Lwt_result_syntax in + let* block, (c1, c2) = Context.init2 () in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let vs, mempool = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + let* op1 = Op.transaction (B block) c1 c2 Tez.one_cent in + let op1 = op_with_hash op1 in + let* op1' = Op.transaction (B block) c1 c2 Tez.one in + let op1' = op_with_hash op1' in + let* op2 = Op.transaction (B block) c2 c1 Tez.one in + let op2 = op_with_hash op2 in + let*! res = Mempool.add_operation vs mempool op1 in + let mempool = expect_ok_added ~__LOC__ res in + let*! res = Mempool.add_operation vs mempool op2 in + let mempool = expect_ok_added ~__LOC__ res in + let*! res = Mempool.add_operation vs mempool op1' in + let () = expect_conflict ~__LOC__ res in + return_unit + +let test_imcompatible_mempool () = + let open Lwt_result_syntax in + let* block, _ = Context.init1 ~consensus_threshold:0 () in + let* block = Block.bake block in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let (_vs : Mempool.validation_info), mempool1 = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + (* Create a second mempool on a different block *) + let* block2 = Block.bake block in + let* ctxt2 = Block.to_alpha_ctxt block2 in + let predecessor_level, predecessor_round, predecessor_hash2, grandparent_round + = + extract_values ctxt2 block2 + in + let (_vs : Mempool.validation_info), mempool2 = + Mempool.init + ctxt2 + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash:predecessor_hash2 + ~grandparent_round + in + let () = + match Mempool.merge mempool1 mempool2 with + | Error Mempool.Incompatible_mempool -> () + | Error (Merge_conflict _) -> + Format.kasprintf + Stdlib.failwith + "%s: expected incompatible mempool" + __LOC__ + | Ok _ -> Format.kasprintf Stdlib.failwith "%s: expected conflict" __LOC__ + in + return_unit + +let test_merge () = + let open Lwt_result_syntax in + let* block, (c1, c2) = Context.init2 () in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let vs, mempool_i = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + (* Build two mempool with a conflicting operation and check that the + merge fails and succeeds when a conflict handler is provided *) + let* op1 = Op.transaction (B block) c1 c2 Tez.one_cent in + let op1 = op_with_hash op1 in + let* op2 = Op.transaction (B block) c2 c1 Tez.one in + let op2 = op_with_hash op2 in + let*! res = Mempool.add_operation vs mempool_i op1 in + let mempool1 = expect_ok_added ~__LOC__ res in + let*! res = Mempool.add_operation vs mempool_i op2 in + let mempool2 = expect_ok_added ~__LOC__ res in + let merged_non_conflicting_mempool = + match Mempool.merge mempool1 mempool2 with + | Ok mempool -> mempool + | _ -> + Format.kasprintf Stdlib.failwith "%s: expected succesful merge" __LOC__ + in + let* op1' = Op.transaction (B block) c1 c2 Tez.one in + let op1' = op_with_hash op1' in + let*! res = Mempool.add_operation vs mempool_i op1' in + let mempool3 = expect_ok_added ~__LOC__ res in + let*! res = Mempool.add_operation vs mempool3 op2 in + let mempool3 = expect_ok_added ~__LOC__ res in + let () = + match Mempool.merge merged_non_conflicting_mempool mempool3 with + | Error (Merge_conflict _) -> () + | _ -> Format.kasprintf Stdlib.failwith "%s: expected conflict" __LOC__ + in + let merged_mempool_replace = + match + Mempool.merge + ~conflict_handler:handler_always_replace + merged_non_conflicting_mempool + mempool3 + with + | Ok mempool -> mempool + | _ -> + Format.kasprintf Stdlib.failwith "%s: expected succesful merge" __LOC__ + in + let* () = + assert_operation_present_in_mempool + ~__LOC__ + merged_mempool_replace + (List.map fst [op1'; op2]) + in + let merged_mempool_keep = + match + Mempool.merge + ~conflict_handler:handler_always_keep + merged_non_conflicting_mempool + mempool3 + with + | Ok mempool -> mempool + | _ -> + Format.kasprintf Stdlib.failwith "%s: expected succesful merge" __LOC__ + in + let* () = + assert_operation_present_in_mempool + ~__LOC__ + merged_mempool_keep + (List.map fst [op1; op2]) + in + (* Check that merging a mempool with itself is a success and returns + the identity *) + let* () = + match Mempool.merge mempool1 mempool1 with + | Ok mempool -> + let expected_operations = + Environment.Operation_hash.Map.bindings (Mempool.operations mempool1) + |> List.map fst + in + assert_operation_present_in_mempool ~__LOC__ mempool expected_operations + | Error _ -> assert false + in + return_unit + +let test_add_invalid_operation () = + let open Lwt_result_syntax in + let* block, c1 = Context.init1 () in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let vs, mempool_i = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + let* op1 = Op.transaction (B block) c1 c1 ~gas_limit:Zero Tez.one_cent in + let op1 = op_with_hash op1 in + let*! res = Mempool.add_operation vs mempool_i op1 in + match res with + | Error (Mempool.Validation_error _) -> return_unit + | Error _ -> Stdlib.failwith "unexpected error" + | Ok _ -> Stdlib.failwith "unexpected success" + +let test_add_and_replace () = + let open Lwt_result_syntax in + let* block, (c1, c2) = Context.init2 () in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let info, mempool_i = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + (* Try adding a conflicting operation using both handler strategy *) + let* op1 = Op.transaction (B block) c1 c2 Tez.one_cent in + let op1 = op_with_hash op1 in + let* op1' = Op.transaction (B block) c1 c2 Tez.one in + let op1' = op_with_hash op1' in + let*! res = Mempool.add_operation info mempool_i op1 in + let mempool = expect_ok_added ~__LOC__ res in + let*! res = Mempool.add_operation info mempool op1' in + let () = expect_conflict ~__LOC__ res in + let*! res = + Mempool.add_operation + ~conflict_handler:handler_always_keep + info + mempool + op1' + in + let final_mempool = expect_conflict_handled ~__LOC__ Unchanged res in + let* () = + assert_operation_present_in_mempool ~__LOC__ final_mempool [fst op1] + in + let*! res = + Mempool.add_operation + ~conflict_handler:handler_always_replace + info + mempool + op1' + in + let final_mempool = + expect_conflict_handled ~__LOC__ (Replaced {removed = fst op1}) res + in + let* () = + assert_operation_present_in_mempool ~__LOC__ final_mempool [fst op1'] + in + return_unit + +let test_remove_operation () = + let open Lwt_result_syntax in + let* block, (c1, c2) = Context.init2 () in + let* ctxt = Block.to_alpha_ctxt block in + let predecessor_level, predecessor_round, predecessor_hash, grandparent_round + = + extract_values ctxt block + in + let info, mempool_i = + Mempool.init + ctxt + Tezos_crypto.Chain_id.zero + ~predecessor_level + ~predecessor_round + ~predecessor_hash + ~grandparent_round + in + let* op1 = Op.transaction (B block) c1 c2 Tez.one_cent in + let op1 = op_with_hash op1 in + let* op2 = Op.transaction (B block) c1 c2 Tez.one in + let op2 = op_with_hash op2 in + (* Add one operation to the mempoolg *) + let*! res = Mempool.add_operation info mempool_i op1 in + let mempool = expect_ok_added ~__LOC__ res in + let* () = assert_operation_present_in_mempool ~__LOC__ mempool [fst op1] in + (* Try removing unknown operation and check that the mempool is unchanged *) + let mempool = Mempool.remove_operation mempool (fst op2) in + let* () = assert_operation_present_in_mempool ~__LOC__ mempool [fst op1] in + (* Try removing known operation and ensure that the mempool is empty *) + let empty_mempool = Mempool.remove_operation mempool (fst op1) in + assert_empty_mempool ~__LOC__ empty_mempool + +let tests = + [ + Tztest.tztest "simple" `Quick test_simple; + Tztest.tztest "incompatible mempool" `Quick test_imcompatible_mempool; + Tztest.tztest "merge" `Quick test_merge; + Tztest.tztest "adding invalid operation" `Quick test_add_invalid_operation; + Tztest.tztest + "adding operation with conflict handler" + `Quick + test_add_and_replace; + Tztest.tztest "remove operations" `Quick test_remove_operation; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml new file mode 100644 index 000000000000..b2924d868637 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml @@ -0,0 +1,176 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (validate manager) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "sanity checks" + Subject: Validation of operation. +*) + +open Protocol +open Alpha_context +open Manager_operation_helpers + +(** The goal of this test is to ensure that [select_op] generate the + wanted kind of manager operation + + Note: if a new manager operation kind is added in the protocol, + [Manager_operation_helpers.manager_operation_kind] should be + extended. You will also have to extend + [Manager_operation_helpers.select_op] with a new `mk` for this new + operation. Finally the list [Manager_operation_helpers.subjects] + should also be extended to run the validate test on the new manager + operation kind. *) +let ensure_kind infos kind = + let open Lwt_result_syntax in + let* op = + select_op + {(operation_req_default kind) with force_reveal = Some false} + infos + in + let (Operation_data {contents; _}) = op.protocol_data in + match contents with + | Single (Manager_operation {operation; _}) -> ( + match (operation, kind) with + | Transaction _, K_Transaction + | Reveal _, K_Reveal + | Origination _, K_Origination + | Delegation _, K_Delegation + | Delegation _, K_Undelegation + | Delegation _, K_Self_delegation + | Register_global_constant _, K_Register_global_constant + | Set_deposits_limit _, K_Set_deposits_limit + | Update_consensus_key _, K_Update_consensus_key + | Increase_paid_storage _, K_Increase_paid_storage + | Tx_rollup_origination, K_Tx_rollup_origination + | Tx_rollup_submit_batch _, K_Tx_rollup_submit_batch + | Tx_rollup_commit _, K_Tx_rollup_commit + | Tx_rollup_return_bond _, K_Tx_rollup_return_bond + | Tx_rollup_finalize_commitment _, K_Tx_rollup_finalize + | Tx_rollup_remove_commitment _, K_Tx_rollup_remove_commitment + | Tx_rollup_rejection _, K_Tx_rollup_reject + | Tx_rollup_dispatch_tickets _, K_Tx_rollup_dispatch_tickets + | Transfer_ticket _, K_Transfer_ticket + | Sc_rollup_originate _, K_Sc_rollup_origination + | Sc_rollup_add_messages _, K_Sc_rollup_add_messages + | Sc_rollup_cement _, K_Sc_rollup_cement + | Sc_rollup_publish _, K_Sc_rollup_publish + | Sc_rollup_refute _, K_Sc_rollup_refute + | Sc_rollup_timeout _, K_Sc_rollup_timeout + | Sc_rollup_execute_outbox_message _, K_Sc_rollup_execute_outbox_message + | Sc_rollup_recover_bond _, K_Sc_rollup_recover_bond + | Dal_publish_slot_header _, K_Dal_publish_slot_header + | Zk_rollup_origination _, K_Zk_rollup_origination + | Zk_rollup_publish _, K_Zk_rollup_publish + | Zk_rollup_update _, K_Zk_rollup_update -> + return_unit + | ( ( Transaction _ | Origination _ | Register_global_constant _ + | Delegation _ | Set_deposits_limit _ | Update_consensus_key _ + | Increase_paid_storage _ | Reveal _ | Tx_rollup_origination + | Tx_rollup_submit_batch _ | Tx_rollup_commit _ + | Tx_rollup_return_bond _ | Tx_rollup_finalize_commitment _ + | Tx_rollup_remove_commitment _ | Tx_rollup_dispatch_tickets _ + | Transfer_ticket _ | Tx_rollup_rejection _ | Sc_rollup_originate _ + | Sc_rollup_publish _ | Sc_rollup_cement _ | Sc_rollup_add_messages _ + | Sc_rollup_refute _ | Sc_rollup_timeout _ + | Sc_rollup_execute_outbox_message _ | Sc_rollup_recover_bond _ + | Dal_publish_slot_header _ | Zk_rollup_origination _ + | Zk_rollup_publish _ | Zk_rollup_update _ ), + _ ) -> + assert false) + | Single _ -> assert false + | Cons _ -> assert false + +let ensure_manager_operation_coverage () = + let open Lwt_result_syntax in + let* infos = default_init_ctxt () in + List.iter_es (fun kind -> ensure_kind infos kind) subjects + +open Generator_descriptors +open Valid_operations_generators + +(** This test ensures that it exists a valid operation generator for + each operation. + + Note: When adding a new operation, one should refer to {! + Generator_descriptor} to see how to add its valid operation + generator. *) +let covalidation_sanity () = + let open Lwt_result_syntax in + let max_batch_size = 1 in + let nb_bootstrap = 7 in + List.iter_es + (fun kind -> + let* _, candidates = covalid [kind] ~nb_bootstrap ~max_batch_size in + match List.hd candidates with + | None -> + failwith "no candidates was generated for kind '%a'" pp_op_kind kind + | Some {protocol_data = Operation_data {contents; _}; _} -> ( + match (contents, kind) with + | Single (Preendorsement _), KPreendorsement -> return_unit + | Single (Preendorsement _), _ -> assert false + | Single (Endorsement _), KEndorsement -> return_unit + | Single (Endorsement _), _ -> assert false + | Single (Dal_attestation _), KDalattestation -> return_unit + | Single (Dal_attestation _), _ -> assert false + | Single (Seed_nonce_revelation _), KNonce -> return_unit + | Single (Seed_nonce_revelation _), _ -> assert false + | Single (Vdf_revelation _), KVdf -> return_unit + | Single (Vdf_revelation _), _ -> assert false + | Single (Double_endorsement_evidence _), KDbl_consensus -> + return_unit + | Single (Double_endorsement_evidence _), _ -> assert false + | Single (Double_preendorsement_evidence _), KDbl_consensus -> + return_unit + | Single (Double_preendorsement_evidence _), _ -> assert false + | Single (Double_baking_evidence _), KDbl_baking -> return_unit + | Single (Double_baking_evidence _), _ -> assert false + | Single (Activate_account _), KActivate -> return_unit + | Single (Activate_account _), _ -> assert false + | Single (Proposals _), KProposals -> return_unit + | Single (Proposals _), _ -> assert false + | Single (Ballot _), (KBallotExp | KBallotProm) -> return_unit + | Single (Ballot _), _ -> assert false + | Single (Drain_delegate _), KDrain -> return_unit + | Single (Drain_delegate _), _ -> assert false + | Single (Manager_operation _), KManager + | Cons (Manager_operation _, _), KManager -> + return_unit + | Single (Manager_operation _), _ | Cons (Manager_operation _, _), _ + -> + assert false + | Single (Failing_noop _), _ -> assert false)) + all_kinds + +let tests = + List.map + (fun (name, f) -> Tztest.tztest name `Quick f) + [ + ("manager operation coverage", ensure_manager_operation_coverage); + ("covalidation coverage", covalidation_sanity); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml new file mode 100644 index 000000000000..6632e3a421b7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml @@ -0,0 +1,624 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic-Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (validate manager) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- test "^batched" + Subject: Validation of batched manager operation. +*) + +open Protocol +open Alpha_context +open Manager_operation_helpers + +(** {2 Tests on operation batches} *) + +(** Revelation should not occur elsewhere than in first position + in a batch.*) +let batch_reveal_in_the_middle_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let batch_in_the_middle infos kind1 kind2 = + let open Lwt_result_syntax in + let* counter = + Context.Contract.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let counter = Manager_counter.succ counter in + let* operation1 = + select_op + { + (operation_req_default kind1) with + force_reveal = Some false; + counter = Some counter; + } + infos + in + let counter = Manager_counter.succ counter in + let* reveal = + mk_reveal + { + (operation_req_default K_Reveal) with + fee = Some Tez.one_mutez; + counter = Some counter; + } + infos + in + let counter = Manager_counter.succ counter in + let* operation2 = + select_op + { + (operation_req_default kind2) with + force_reveal = Some false; + counter = Some counter; + } + infos + in + let* batch = + Op.batch_operations + ~recompute_counters:false + ~source:(contract_of (get_source infos)) + (Context.B infos.ctxt.block) + [operation1; reveal; operation2] + in + batch_reveal_in_the_middle_diagnostic infos [batch] + +(** A batch of manager operation contains at most one Revelation.*) +let batch_two_reveals_diagnostic (infos : infos) op = + let expected_failure errs = + match errs with + | [ + Environment.Ecoproto_error + Validate_errors.Manager.Incorrect_reveal_position; + ] -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expected_failure + +let batch_two_reveals infos kind = + let open Lwt_result_syntax in + let* counter = + Context.Contract.counter + (B infos.ctxt.block) + (contract_of (get_source infos)) + in + let counter = Manager_counter.succ counter in + let* reveal = + mk_reveal + { + (operation_req_default K_Reveal) with + fee = Some Tez.one_mutez; + counter = Some counter; + } + infos + in + let counter = Manager_counter.succ counter in + let* reveal1 = + mk_reveal + { + (operation_req_default K_Reveal) with + fee = Some Tez.one_mutez; + counter = Some counter; + } + infos + in + let counter = Manager_counter.succ counter in + let* operation = + select_op + { + (operation_req_default kind) with + force_reveal = Some false; + counter = Some counter; + } + infos + in + let* batch = + Op.batch_operations + ~recompute_counters:false + ~source:(contract_of (get_source infos)) + (Context.B infos.ctxt.block) + [reveal; reveal1; operation] + in + batch_two_reveals_diagnostic infos [batch] + +(** Every manager operation in a batch concerns the same source.*) +let batch_two_sources_diagnostic (infos : infos) op = + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error Validate_errors.Manager.Inconsistent_sources] + -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + validate_ko_diagnostic infos op expect_failure + +let batch_two_sources infos kind1 kind2 = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let counter = Manager_counter.succ counter in + let* operation1 = + select_op + { + (operation_req_default kind1) with + force_reveal = Some true; + counter = Some counter; + } + infos + in + let infos = + let source2 = + match infos.accounts.del with None -> assert false | Some s -> s + in + {infos with accounts = {infos.accounts with sources = [source2]}} + in + let* operation2 = + select_op + {(operation_req_default kind2) with force_reveal = Some false} + infos + in + let* batch = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [operation1; operation2] + in + batch_two_sources_diagnostic infos [batch] + +(** Counters in a batch should be a sequence from the successor of + the stored counter associated to source in the initial context. *) +let batch_incons_counters infos kind1 kind2 = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let fee = Some Tez.one_mutez in + let op_infos = operation_req_default K_Reveal in + let op_infos = {{op_infos with fee} with counter = Some counter} in + let* reveal = mk_reveal op_infos infos in + let counter0 = counter in + let counter = Manager_counter.succ counter in + let counter2 = Manager_counter.succ counter in + let counter3 = Manager_counter.succ counter2 in + let operation counter kind = + select_op + { + (operation_req_default kind) with + counter = Some counter; + force_reveal = Some false; + } + infos + in + let op_counter = operation counter in + let op_counter0 = operation counter0 in + let op_counter2 = operation counter2 in + let op_counter3 = operation counter3 in + let* op1 = op_counter kind1 in + let* op2 = op_counter kind2 in + let* batch_same = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op1; op2] + in + let* op1 = op_counter2 kind1 in + let* op2 = op_counter3 kind2 in + let* batch_in_the_future = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op1; op2] + in + let* op1 = op_counter kind1 in + let* op2 = op_counter3 kind2 in + let* batch_missing_one = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op1; op2] + in + let* op1 = op_counter2 kind1 in + let* op2 = op_counter kind2 in + let* batch_inverse = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op1; op2] + in + let* op1 = op_counter0 kind1 in + let* op2 = op_counter kind2 in + let* batch_in_the_past = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op1; op2] + in + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error Validate_errors.Manager.Inconsistent_counters] + -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + let* i = Incremental.begin_construction infos.ctxt.block in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_same + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_in_the_future + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_missing_one + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_inverse + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_in_the_past + in + return_unit + +(** A batch that consumes all the balance for fees can only face the total + consumption at the end of the batch. *) +let batch_emptying_balance_in_the_middle infos kind1 kind2 = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let* init_bal = Context.Contract.balance (B infos.ctxt.block) source in + let counter = counter in + let* reveal = + mk_reveal + {(operation_req_default K_Reveal) with counter = Some counter} + infos + in + let counter = Manager_counter.succ counter in + let operation fee = + select_op + { + (operation_req_default kind1) with + force_reveal = Some false; + counter = Some counter; + fee = Some fee; + } + infos + in + let counter = Manager_counter.succ counter in + let operation2 fee = + select_op + { + (operation_req_default kind2) with + force_reveal = Some false; + counter = Some counter; + fee = Some fee; + } + infos + in + let* op_case1 = operation init_bal in + let* op2_case1 = operation2 Tez.zero in + let* case1 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case1; op2_case1] + in + let* i = Incremental.begin_construction infos.ctxt.block in + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error (Contract_storage.Empty_implicit_contract _)] + -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + let* (_ : Incremental.t) = + Incremental.add_operation i case1 ~expect_failure + in + return_unit + +(** A batch that consumes all the balance for fees only at the end of + the batch passes validate.*) +let batch_empty_at_end infos kind1 kind2 = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let* init_bal = Context.Contract.balance (B infos.ctxt.block) source in + let*? half_init_bal = Environment.wrap_tzresult @@ Tez.(init_bal /? 2L) in + let* reveal = + mk_reveal + {(operation_req_default K_Reveal) with counter = Some counter} + infos + in + let counter = Manager_counter.succ counter in + let operation fee = + select_op + { + (operation_req_default kind1) with + force_reveal = Some false; + counter = Some counter; + fee = Some fee; + } + infos + in + let counter = Manager_counter.succ counter in + let operation2 fee = + select_op + { + (operation_req_default kind2) with + force_reveal = Some false; + counter = Some counter; + fee = Some fee; + } + infos + in + let* op_case2 = operation Tez.zero in + let* op2_case2 = operation2 init_bal in + let* op_case3 = operation half_init_bal in + let* op2_case3 = operation2 half_init_bal in + let* case3 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case3; op2_case3] + in + let* case2 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case2; op2_case2] + in + let* (_ : infos) = validate_diagnostic ~deallocated:true infos [case2] in + let* (_ : infos) = validate_diagnostic ~deallocated:true infos [case3] in + return_unit + +(** Simple reveal followed by a transaction. *) +let batch_reveal_transaction infos = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let counter = counter in + let fee = Tez.one_mutez in + let* reveal = + mk_reveal + { + (operation_req_default K_Reveal) with + fee = Some fee; + counter = Some counter; + } + infos + in + let counter = Manager_counter.succ counter in + let* transaction = + mk_transaction + { + (operation_req_default K_Reveal) with + counter = Some counter; + force_reveal = Some false; + } + infos + in + let* batch = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; transaction] + in + let* (_ : Incremental.t) = Incremental.begin_construction infos.ctxt.block in + let* (_ : infos) = validate_diagnostic infos [batch] in + return_unit + +(** A batch of manager operation must not exceed the initial available gas in the block. *) +let batch_exceeding_block_gas ~mempool_mode infos kind1 kind2 = + let open Lwt_result_syntax in + let source = contract_of (get_source infos) in + let* counter = Context.Contract.counter (B infos.ctxt.block) source in + let g_limit = Gas.Arith.add gb_limit Gas.Arith.(integral_of_int_exn 1) in + let half_limit = + Gas.Arith.add half_gb_limit Gas.Arith.(integral_of_int_exn 1) + in + let* reveal = + mk_reveal + {(operation_req_default K_Reveal) with counter = Some counter} + infos + in + let counter = Manager_counter.succ counter in + let operation gas_limit = + select_op + { + (operation_req_default kind1) with + force_reveal = Some false; + counter = Some counter; + gas_limit = Some (Custom_gas gas_limit); + } + infos + in + let counter = Manager_counter.succ counter in + let operation2 gas_limit = + select_op + { + (operation_req_default kind2) with + force_reveal = Some false; + counter = Some counter; + gas_limit = Some (Custom_gas gas_limit); + } + infos + in + let* op_case1 = operation g_limit in + let* op2_case1 = operation2 Gas.Arith.zero in + let* op_case2 = operation half_limit in + let* op2_case2 = operation2 g_limit in + let* op_case3 = operation half_limit in + let* op2_case3 = operation2 half_limit in + let* case1 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case1; op2_case1] + in + let* case3 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case3; op2_case3] + in + let* case2 = + Op.batch_operations + ~recompute_counters:false + ~source + (Context.B infos.ctxt.block) + [reveal; op_case2; op2_case2] + in + let* i = Incremental.begin_construction infos.ctxt.block ~mempool_mode in + let expect_failure errs = + match errs with + | [Environment.Ecoproto_error Gas.Block_quota_exceeded] + when not mempool_mode -> + return_unit + | [ + Environment.Ecoproto_error Gas.Gas_limit_too_high; + Environment.Ecoproto_error Gas.Block_quota_exceeded; + ] + when mempool_mode -> + return_unit + | err -> + failwith + "Error trace:@, %a does not match the expected one" + Error_monad.pp_print_trace + err + in + let* (_ : Incremental.t) = + Incremental.add_operation i case1 ~expect_failure + in + let* (_ : Incremental.t) = + Incremental.add_operation i case3 ~expect_failure + in + let* (_ : Incremental.t) = + Incremental.add_operation i case2 ~expect_failure + in + return_unit + +let make_tztest_batched ?(fmt = Format.std_formatter) name test subjects + info_builder = + let open Lwt_result_syntax in + Tztest.tztest name `Quick (fun () -> + let* infos = info_builder () in + List.iter_es + (fun kind1 -> + let k1s = kind_to_string kind1 in + List.iter_es + (fun kind2 -> + Format.fprintf + fmt + "%s: [%s ; %s]@." + name + k1s + (kind_to_string kind2) ; + test infos kind1 kind2) + subjects) + subjects) + +let tests = + let open Lwt_result_syntax in + let mk_default () = default_init_ctxt () in + let mk_high_gas_limit () = + init_ctxt {ctxt_req_default with hard_gas_limit_per_block = Some gb_limit} + in + let revealed = revealed_subjects in + [ + ( Tztest.tztest "batch reveal and transaction" `Quick @@ fun () -> + let* infos = mk_default () in + batch_reveal_transaction infos ); + ] + @ List.map + (fun (name, f, subjects, info_builder) -> + make_tztest name f subjects info_builder) + [("batch two reveals", batch_two_reveals, revealed, mk_default)] + @ List.map + (fun (name, f, subjects, info_builder) -> + make_tztest_batched name f subjects info_builder) + [ + ("reveal in the middle", batch_in_the_middle, revealed, mk_default); + ("batch two sources", batch_two_sources, revealed, mk_default); + ("batch incons. counters", batch_incons_counters, revealed, mk_default); + ( "empty balance in middle of batch", + batch_emptying_balance_in_the_middle, + revealed, + mk_default ); + ( "empty balance at end of batch", + batch_empty_at_end, + revealed, + mk_default ); + ( "too much gas consumption", + batch_exceeding_block_gas ~mempool_mode:false, + revealed, + mk_high_gas_limit ); + ( "too much gas consumption (mempool)", + batch_exceeding_block_gas ~mempool_mode:true, + revealed, + mk_high_gas_limit ); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml new file mode 100644 index 000000000000..7fb3741fa697 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml @@ -0,0 +1,242 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Generator_descriptors + +(** {2 Building the Setup} *) + +(** Setup for generating valid operation of several kind of + operations. It gathers the following information to setup + {! Generator_descriptor.state} into which valid operations + can be generated: + - [nb_cycles] the total number of cycles to bake, + - [nb_blocks] the number of blocks to bake in the last cycle, + - [params] the constants required, and + - [prelude] that associates to each cycle to bake a list of + {! Generator_descriptors.descriptor} prelude functions. *) +type setup = { + prelude : + (int * (state -> (packed_operation list * state) tzresult Lwt.t) list) list; + nb_cycles : int; + nb_blocks : int; + params : Parameters.t; +} + +(** Select the prelude actions of a specific cycle in a setup prelude. *) +let prelude_on_cycle (c : int) + (actions : + (int * (state -> (packed_operation list * state) tzresult Lwt.t) list) + list) : (state -> (packed_operation list * state) tzresult Lwt.t) list = + match List.filter (fun (c1, _actions) -> c = c1) actions with + | (c1, actions) :: _ -> + assert (c = c1) ; + actions + | [] -> [] + +(** Knowing the total number of required cycles, normalize a prelude + on the list of the pair of a cycle and prelude actions. *) +let normalize_preludes nb_cycles (descr : descriptor) = + let normalize prelude = + match prelude with + | On n, actions -> [(nb_cycles - n, actions)] + | From n, actions -> + List.fold_left + (fun acc i -> acc @ [(nb_cycles - n + i, actions)]) + [] + (1 -- n) + in + let prim = normalize descr.prelude in + match descr.opt_prelude with + | Some prelude -> normalize prelude @ prim + | None -> prim + +(** Insert a normalized prelude in a prelude of a setup.*) +let rec insert_normalize_preludes + ((n, action) : + int * (state -> (packed_operation list * state) tzresult Lwt.t)) + (preludes : + (int * (state -> (packed_operation list * state) tzresult Lwt.t) list) + list) = + match preludes with + | [] -> [(n, [action])] + | (m, actions) :: rest -> + if m = n then (m, actions @ [action]) :: rest + else (m, actions) :: insert_normalize_preludes (n, action) rest + +(** Produce a setup prelude from a list of descriptor and a nb of + cycles*) +let compose_preludes nb_cycles descrs = + let normalized_preludes = List.map (normalize_preludes nb_cycles) descrs in + List.fold_left + (fun acc pre -> + List.fold_left (fun acc pr -> insert_normalize_preludes pr acc) acc pre) + [] + normalized_preludes + +(** Agregate the parameters of several {! Generator_descriptors.descriptor}.*) +let initiated_params descrs nb_accounts = + let consensus_committee_size = nb_accounts in + let initial_params = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + { + Context.default_test_constants with + consensus_threshold = 0; + consensus_committee_size; + } + in + let descrs_params = List.map (fun descr -> descr.parameters) descrs in + List.fold_left (fun acc f -> f acc) initial_params descrs_params + +(** Make a [setup] from a list of {! Generator_descriptors.descriptor}. The required number of + cycles and number of blocks in the last cycle are the maximum of + required cycle and number of block in the descriptors list. The + prelude is the composition of the composition of the descriptors + preludes list -- see [compose_preludes]. The parameters are the agregation of the + descriptors parameters -- see [initiated_params]. *) +let setup_of descrs nb_accounts = + let params = initiated_params descrs nb_accounts in + let max_list l = List.fold_left max 0 l in + let required_cycle_list l = + List.map (fun descr -> descr.required_cycle params) l + in + let required_block_list l = + List.map (fun descr -> descr.required_block params) l + in + let sorted_descrs = + List.sort + (fun pre1 pre2 -> + Int.compare (pre1.required_cycle params) (pre2.required_cycle params)) + descrs + in + let nb_cycles = max_list (required_cycle_list descrs) in + let nb_blocks = max_list (required_block_list descrs) in + let prelude = compose_preludes nb_cycles sorted_descrs in + {prelude; nb_cycles; nb_blocks; params} + +(** From a number of accounts and a list of descriptors set up the + prelude state. + + Thanks to the setup computing for the list of descriptors -- see [setup_of] --, + initiates a context with the setup parameters, and the number of + accounts. Initiate a state that will be fulfilled during the + preludes. During the required number of cycles of the setup, bakes + each cycle with the setup prelude by selecting the actions to + perform on it. On the last cycle, bake the required number of + blocks of the setup. Finally, adds the delegates at the end of + the prelude in the state. *) +let init nb_accounts descrs = + let open Lwt_result_syntax in + let setup = setup_of descrs nb_accounts in + let* initial_block, bootstraps = + Context.init_with_parameters_n setup.params nb_accounts + in + let* voters = Context.Vote.get_listings (B initial_block) in + let* initial_voters = + List.map_es (fun (c, _) -> return (Contract.Implicit c)) voters + in + let my_bake selected_preludes_for_cycle state = + let* state, operations = + List.fold_left_es + (fun (state, ops) prelude -> + let+ ops', state = prelude state in + let ops = ops' @ ops in + (state, ops)) + (state, []) + selected_preludes_for_cycle + in + let b = state.block in + let operations = + List.sort (fun op1 op2 -> Operation.compare_by_passes op2 op1) operations + in + let+ block = Block.bake ~operations b in + {state with block; pred = Some b} + in + let my_bake_n cycle n state = + List.fold_left_es + (fun state _ -> + let selected_preludes = prelude_on_cycle cycle setup.prelude in + my_bake selected_preludes state) + state + (1 -- n) + in + let my_bake_until_cycle_end cycle state = + let current_level = state.block.Block.header.shell.level in + let current_level = + Int32.rem current_level setup.params.constants.blocks_per_cycle + in + let delta = + Int32.sub setup.params.constants.blocks_per_cycle current_level + in + my_bake_n cycle (Int32.to_int delta) state + in + let* state = + List.fold_left_es + (fun state cycle -> my_bake_until_cycle_end cycle state) + (init_state initial_block ~voters:initial_voters ~bootstraps) + (Stdlib.List.init setup.nb_cycles Fun.id) + in + let my_bake_n_default n state = + List.fold_left_es + (fun state _ -> + let pred = state.block in + let+ block = Block.bake state.block in + {state with block; pred = Some pred}) + state + (1 -- n) + in + let* state = + if setup.nb_blocks >= 1 then my_bake_n_default setup.nb_blocks state + else return state + in + return state + +(** In a state, generates all the valid operations of a list of kinds. *) +let candidates state kinds nb_bootstrap max_batch_size = + let open Lwt_result_syntax in + let* candidates = + List.fold_left_es + (fun acc k -> + let* candidates = + (descriptor_of k ~nb_bootstrap ~max_batch_size).candidates_generator + state + in + let acc = acc @ candidates in + return acc) + [] + kinds + in + return candidates + +(** From a list of kind of operations generates all the valid + operations of this kind and the generation state. *) +let covalid ks ~nb_bootstrap ~max_batch_size = + let open Lwt_result_syntax in + let* state = + init nb_bootstrap (descriptors_of ~nb_bootstrap ~max_batch_size ks) + in + let* candidates = candidates state ks nb_bootstrap max_batch_size in + return (state, candidates) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml new file mode 100644 index 000000000000..fd61a97a14b5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml @@ -0,0 +1,396 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Registered_nonces = Nonce +open Protocol +open Alpha_context +module Manager = Manager_operation_helpers + +(** {2 Helpers} *) + +(** {3 Randomness } *) + +let gen_bounded_int min max = QCheck2.Gen.(generate1 @@ int_range min max) + +let pick_one l = QCheck2.Gen.(generate1 @@ oneofl l) + +let pick_n (n : int) (l : 'a list) : 'a list = + List.take_n n QCheck2.Gen.(generate1 @@ shuffle_l l) + +(** {3 Helpers for lists } *) + +let get_n l n = + assert (List.length l > n) ; + Stdlib.List.nth l n + +let mycombine l1 l2 = + let sz_dels = List.length l1 in + let sz_phs = List.length l2 in + let dels, phs = + if sz_dels = sz_phs then (l1, l2) + else if sz_dels < sz_phs then (l1, List.take_n sz_dels l2) + else (List.take_n sz_phs l1, l2) + in + Stdlib.List.combine dels phs + +(** {3 Global Values}*) + +let ballots = Vote.[Yay; Nay; Pass] + +let protos = + List.map + (fun s -> Tezos_crypto.Protocol_hash.of_b58check_exn s) + [ + "ProtoALphaALphaALphaALphaALphaALphaALpha61322gcLUGH"; + "ProtoALphaALphaALphaALphaALphaALphaALphabc2a7ebx6WB"; + "ProtoALphaALphaALphaALphaALphaALphaALpha84efbeiF6cm"; + "ProtoALphaALphaALphaALphaALphaALphaALpha91249Z65tWS"; + "ProtoALphaALphaALphaALphaALphaALphaALpha537f5h25LnN"; + "ProtoALphaALphaALphaALphaALphaALphaALpha5c8fefgDYkr"; + "ProtoALphaALphaALphaALphaALphaALphaALpha3f31feSSarC"; + "ProtoALphaALphaALphaALphaALphaALphaALphabe31ahnkxSC"; + "ProtoALphaALphaALphaALphaALphaALphaALphabab3bgRb7zQ"; + "ProtoALphaALphaALphaALphaALphaALphaALphaf8d39cctbpk"; + "ProtoALphaALphaALphaALphaALphaALphaALpha3b981byuYxD"; + "ProtoALphaALphaALphaALphaALphaALphaALphaa116bccYowi"; + "ProtoALphaALphaALphaALphaALphaALphaALphacce68eHqboj"; + "ProtoALphaALphaALphaALphaALphaALphaALpha225c7YrWwR7"; + "ProtoALphaALphaALphaALphaALphaALphaALpha58743cJL6FG"; + "ProtoALphaALphaALphaALphaALphaALphaALphac91bcdvmJFR"; + "ProtoALphaALphaALphaALphaALphaALphaALpha1faaadhV7oW"; + "ProtoALphaALphaALphaALphaALphaALphaALpha98232gD94QJ"; + "ProtoALphaALphaALphaALphaALphaALphaALpha9d1d8cijvAh"; + "ProtoALphaALphaALphaALphaALphaALphaALphaeec52dKF6Gx"; + "ProtoALphaALphaALphaALphaALphaALphaALpha841f2cQqajX"; + ] + +type secret_account = { + blinded_public_key_hash : Blinded_public_key_hash.t; + account : Tezos_crypto.Ed25519.Public_key_hash.t; + activation_code : Blinded_public_key_hash.activation_code; + amount : Tez.t; +} + +let secrets = + (* Exported from proto_alpha client - TODO : remove when relocated to lib_crypto *) + let read_key mnemonic email password = + match Tezos_client_base.Bip39.of_words mnemonic with + | None -> assert false + | Some t -> + (* TODO: unicode normalization (NFKD)... *) + let passphrase = Bytes.(cat (of_string email) (of_string password)) in + let sk = Tezos_client_base.Bip39.to_seed ~passphrase t in + let sk = Bytes.sub sk 0 32 in + let sk : Tezos_crypto.Signature.Secret_key.t = + Ed25519 + (Data_encoding.Binary.of_bytes_exn + Tezos_crypto.Ed25519.Secret_key.encoding + sk) + in + let pk = Tezos_crypto.Signature.Secret_key.to_public_key sk in + let pkh = Tezos_crypto.Signature.Public_key.hash pk in + (pkh, pk, sk) + in + List.map + (fun (mnemonic, secret, amount, pkh, password, email) -> + let pkh', pk, sk = read_key mnemonic email password in + let pkh = Tezos_crypto.Ed25519.Public_key_hash.of_b58check_exn pkh in + assert (Tezos_crypto.Signature.Public_key_hash.equal (Ed25519 pkh) pkh') ; + let activation_code = + Stdlib.Option.get + (Blinded_public_key_hash.activation_code_of_hex secret) + in + let bpkh = Blinded_public_key_hash.of_ed25519_pkh activation_code pkh in + let account = Account.{pkh = Ed25519 pkh; pk; sk} in + Account.add_account account ; + { + blinded_public_key_hash = bpkh; + account = pkh; + activation_code; + amount = + WithExceptions.Option.to_exn + ~none:(Invalid_argument "tez conversion") + (Tez.of_mutez (Int64.of_string amount)); + }) + [ + ( [ + "envelope"; + "hospital"; + "mind"; + "sunset"; + "cancel"; + "muscle"; + "leisure"; + "thumb"; + "wine"; + "market"; + "exit"; + "lucky"; + "style"; + "picnic"; + "success"; + ], + "0f39ed0b656509c2ecec4771712d9cddefe2afac", + "23932454669343", + "tz1MawerETND6bqJqx8GV3YHUrvMBCDasRBF", + "z0eZHQQGKt", + "cjgfoqmk.wpxnvnup@tezos.example.org" ); + ( [ + "flag"; + "quote"; + "will"; + "valley"; + "mouse"; + "chat"; + "hold"; + "prosper"; + "silk"; + "tent"; + "cruel"; + "cause"; + "demise"; + "bottom"; + "practice"; + ], + "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4", + "72954577464032", + "tz1X4maqF9tC1Yn4jULjHRAyzjAtc25Z68TX", + "MHErskWPE6", + "oklmcktr.ztljnpzc@tezos.example.org" ); + ( [ + "library"; + "away"; + "inside"; + "paper"; + "wise"; + "focus"; + "sweet"; + "expose"; + "require"; + "change"; + "stove"; + "planet"; + "zone"; + "reflect"; + "finger"; + ], + "411dfef031eeecc506de71c9df9f8e44297cf5ba", + "217487035428349", + "tz1SWBY7rWMutEuWS54Pt33MkzAS6eWkUuTc", + "0AO6BzQNfN", + "ctgnkvqm.kvtiybky@tezos.example.org" ); + ( [ + "cruel"; + "fluid"; + "damage"; + "demand"; + "mimic"; + "above"; + "village"; + "alpha"; + "vendor"; + "staff"; + "absent"; + "uniform"; + "fire"; + "asthma"; + "milk"; + ], + "08d7d355bc3391d12d140780b39717d9f46fcf87", + "4092742372031", + "tz1amUjiZaevaxQy5wKn4SSRvVoERCip3nZS", + "9kbZ7fR6im", + "bnyxxzqr.tdszcvqb@tezos.example.org" ); + ( [ + "opera"; + "divorce"; + "easy"; + "myself"; + "idea"; + "aim"; + "dash"; + "scout"; + "case"; + "resource"; + "vote"; + "humor"; + "ticket"; + "client"; + "edge"; + ], + "9b7cad042fba557618bdc4b62837c5f125b50e56", + "17590039016550", + "tz1Zaee3QBtD4ErY1SzqUvyYTrENrExu6yQM", + "suxT5H09yY", + "iilkhohu.otnyuvna@tezos.example.org" ); + ( [ + "token"; + "similar"; + "ginger"; + "tongue"; + "gun"; + "sort"; + "piano"; + "month"; + "hotel"; + "vote"; + "undo"; + "success"; + "hobby"; + "shell"; + "cart"; + ], + "124c0ca217f11ffc6c7b76a743d867c8932e5afd", + "26322312350555", + "tz1geDUUhfXK1EMj7VQdRjug1MoFe6gHWnCU", + "4odVdLykaa", + "kwhlglvr.slriitzy@tezos.example.org" ); + ( [ + "shield"; + "warrior"; + "gorilla"; + "birth"; + "steak"; + "neither"; + "feel"; + "only"; + "liberty"; + "float"; + "oven"; + "extend"; + "pulse"; + "suffer"; + "vapor"; + ], + "ac7a2125beea68caf5266a647f24dce9fea018a7", + "244951387881443", + "tz1h3nY7jcZciJgAwRhWcrEwqfVp7VQoffur", + "A6yeMqBFG8", + "lvrmlbyj.yczltcxn@tezos.example.org" ); + ( [ + "waste"; + "open"; + "scan"; + "tip"; + "subway"; + "dance"; + "rent"; + "copper"; + "garlic"; + "laundry"; + "defense"; + "clerk"; + "another"; + "staff"; + "liar"; + ], + "2b3e94be133a960fa0ef87f6c0922c19f9d87ca2", + "80065050465525", + "tz1VzL4Xrb3fL3ckvqCWy6bdGMzU2w9eoRqs", + "oVZqpq60sk", + "rfodmrha.zzdndvyk@tezos.example.org" ); + ( [ + "fiber"; + "next"; + "property"; + "cradle"; + "silk"; + "obey"; + "gossip"; + "push"; + "key"; + "second"; + "across"; + "minimum"; + "nice"; + "boil"; + "age"; + ], + "dac31640199f2babc157aadc0021cd71128ca9ea", + "3569618927693", + "tz1RUHg536oRKhPLFfttcB5gSWAhh4E9TWjX", + "FfytQTTVbu", + "owecikdy.gxnyttya@tezos.example.org" ); + ( [ + "print"; + "labor"; + "budget"; + "speak"; + "poem"; + "diet"; + "chunk"; + "eternal"; + "book"; + "saddle"; + "pioneer"; + "ankle"; + "happy"; + "only"; + "exclude"; + ], + "bb841227f250a066eb8429e56937ad504d7b34dd", + "9034781424478", + "tz1M1LFbgctcPWxstrao9aLr2ECW1fV4pH5u", + "zknAl3lrX2", + "ettilrvh.zsrqrbud@tezos.example.org" ); + ] + +(** {3 Context Manipulations } *) + +let pick_two_endorsers ctxt = + let module V = Plugin.RPC.Validators in + Context.get_endorsers ctxt >>=? function + | a :: b :: _ -> return (a.V.consensus_key, b.V.consensus_key) + | _ -> assert false + +let pick_addr_endorser ctxt = + let module V = Plugin.RPC.Validators in + Context.get_endorsers ctxt >>=? function + | a :: _ -> return a.V.consensus_key + | _ -> assert false + +let init_params = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + {Context.default_test_constants with consensus_threshold = 0} + +let delegates_of_block block = + let open Lwt_result_syntax in + let+ validators = Context.get_endorsers (B block) in + List.map + (fun Plugin.RPC.Validators.{consensus_key; slots; _} -> + (consensus_key, slots)) + validators + +(** Sequential validation of an operation list. *) +let sequential_validate ?(mempool_mode = true) block operations = + let open Lwt_result_syntax in + let* inc = Incremental.begin_construction ~mempool_mode block in + let* (_inc : Incremental.t) = + List.fold_left_es + (fun acc op -> Incremental.validate_operation acc op) + inc + operations + in + return_unit diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/README.md b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/README.md new file mode 100644 index 000000000000..a9c3e464230a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/README.md @@ -0,0 +1,56 @@ +# About +This folder contains example test kernels, used for running `SCORU WASM` integration tests. + +The test kernels have been built from [tezos/kernel](https://gitlab.com/trili/kernel.git), then manually edited to take into account a change in naming introduced by [this MR](https://gitlab.com/tezos/tezos/-/merge_requests/6914). + +```terminal +wasm2wat ${OLD_KERNEL} -o tmp.wat +sed -i -e 's/kernel_next/kernel_run/g' -e 's/rollup_safe_core/smart_rollup_core/g' tmp.wast +wat2wasm tmp.wat -o {OLD_KERNEL} +``` + +# Available kernels +It is possible to build the test kernels manually, and verify that they are bit-for-bit identical. + +## Prerequisites +You will need `docker`, `git` and `wasm-strip` installed, alongside either `bash` or `zsh`. +- `wasm-strip` is part of the [WebAssembly Binary Toolkit](https://github.com/WebAssembly/wabt). + +Next, clone the *tezos/kernel* repository: +``` shell +git clone https://gitlab.com/tezos/kernel.git wasm_kernel +cd wasm_kernel +``` +and then follow the instructions below for the required kernel. + +## [computation.wasm](./computation.wasm) +The computation kernel performs a simple computation (addition) on each call to its `kernel_run` entrypoint. +It keeps the result on the heap, and therefore uses the allocator. It makes no use of any *PVM host-capabilities*. + +It is designed to be small enough to be able to originate directly within a boot sector, but also large enough to be +used with the *gather-floppies* mechanism. + +To build the `computation.wasm` kernel, run the following from the checked-out `tezos/kernel` repo: +``` shell +git checkout 60e2dedc2b5debb9a6add98038e52e4cd0a358a6 + +# Load the required rust toolchain dockerfile +source scripts/cargo-docker.sh + +cargo build -p test_kernel --target wasm32-unknown-unknown --release \ + --no-default-features --features none,wee_alloc + +# computation_kernel.wasm is a 1.6M wasm binary. +cp target/wasm32-unknown-unknown/release/test_kernel.wasm computation_kernel.wasm + +# Strips binary down to 9.7K +wasm-strip computation_kernel.wasm +``` +# echo.wasm + +`echo.wasm` is the result of `wat2wasm echo.wast`. + +This simple kernel writes the external messages it receives in its outbox. + +To achieve that, it needs to take the encoding of the inputs into +account to extract the payload to push into the outbox. diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/computation.wasm b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/computation.wasm new file mode 100644 index 0000000000000000000000000000000000000000..1ea01d0f154dfd5fe8b8d2f6f0738629ccb9b23f GIT binary patch literal 9199 zcmZQbEY4+QU|?YM;z?ktuV<_WkqimU^<XvwLjq$xgvXG;QV$UX(;x}P`UF;x7)Tdm zJ!2h|$H46F#>~RN%ErjR%ErRZz`@DH4x*SjSXfwC*%`UG7+6>tI2ajO7#SHExfz)l z7#JBDnHd=wSeRHDnYb7jI5;>MxEYw3SXdbg7-eNynHd=b*(90k866uM4lr=nGdND^ zfzS&;G`kTCTW)G@eo-Y816OuxQC@0Jd{Jp00|Qrld`e<TVti^|3Ns^je0)Y~VnKXT zVsR=n6Q>d*gCiri45JMv7dMZfkg$NVxQv*rgqpgBrjD+jsiUo#HP>TDx66!-to6za zjsn?A3@Qu)B1{fU4vq{OOb?nJco`fS9P7<MOql4CW(OrkS6&7MMhzwgN5(8gCXm`U z%?^spAjXSk2SpYhMs7zIM-~AlkV+;;21OP}1_eelrYFq~3XF~nW+07<Opc6-%-jl$ z3QQnAg95V|(~D*YM+OBJ1?DU>rZ*rq$ixTD4vvgjU^gf*I0|H`Fz|CbZfQ8c;3%NL z;K-5Xcm%{=(r|!5z=;83uOS0B69YFtBV)Y+g94)fn<A3}6F)aM1Bj=<B*4zkEew@Y zU{YWf;80{yVBzQH1j`GU@N@GrIDTk80O9g+^CNf)OalDe=8TN>Ob!qg%nD2bd`c{! z@L*A3P+(SIRA5wK_LdfKm4YZ>0C`Y=pId<i<fL-2Rwf4pCP$_cB_;)CN9Gd8h6ctg zC1#LIyrmu68(6ZGSR4h)92k_C9qZkB85|iwL9EEk!^o|`>?ly8#O%ai&dlJ*pa{~> zV8+Cuz^uTmz~b1@P*a%Y$W&y;#J~-5iy0HhNubc>W@T_}VBux~C5P86j2!hK7icgs zD6xVZ&gfX5rO2kh;K)>>$PS9AY()-c2L)C~jx0q^P_!$sYA|sqaXB&;@-ir}Dl+mg zax*(9a4K*)))ksDF~F3tC~-N~6e@9o5)D|9BZC5`0;etmgCk?1v?3!nlLN>k1|@Eg zG9FiuIt3mDZbzm<X(euuOSl!dHJDf&nF|#-i$Jbt)nI}cs>lh_%n4G%slW+Jc+7=h zvm9#*LH-4?Sroar6<8Ix9GMHjdO>0gN}OOW1CxUSrz2A#$N)x2%7um#lLDg|6N3UH z*s}_ZimV`6m}j{`wt~}nO`#GOSdkKIwgS5+FVxct%nA$&EE-G#f()SG%W~w%Qs7cx z&sN|lRO0gGWl&&KU@hcjQec8Ox&{<npd<qF0VCMqjEbzFh~)z33I#65iYz5oCkAsS z1_iK77#zWRm>fXPVt@oND5xA66u1?*z#+#4@)VZ>7c}HpK_LeU2vFdGf)Zp83n(H$ zmVzS;>H=`sD6keOals-H6hxpX)?i`)N1y_u0+(Yg*wL)u;B;gvQUZk+$b3dekjV_( z;Do}@t-u6wB8L(yC^%Vp8MwI}8Mxb+8JVF)3$qF&%ouqY6qul<J2HdPI#Zb<D=0xa zvigH8cdXA+Vs!k^=*<htPtf!YiXo<wEJv0sPy%&qVDgk!V$fh>Fk|8Yr7BS7apcKT zU<Q>3Z$L!>uM)^2X0V6?s{)gNpd*7KqXM%A69dRxP{IQ9cp&+Q(Ts@)q)dSs%@{>S za9+}2;xS`l0L2uu0;au=S3pG&h!6nV%jBTI0!rhI3QX_}&Z5Amz=D>+86g=Q7TBQ7 zjc^pWpakh+M9tfvLI&Bj$d;qH7F=9psW2!oa$jR*WP`>73n(5Gz$G}7D<~Z+Fhc^K z$&oqBk*N$6{LIkc2Ri{2^c7i3ObSeh1jM2M3VBc=;|PfraAYVlgNp(dN1iMJVX)bt zbn94?rNj!-T2rXR21=`Jppu6jT$+H?gQ6ZJ!T}C3P@Ylb1O+skA}1)W6*$1DoCBnj zLxBUD%Gp4v9GoPT7(x0tU3nQH4y-9uWCZ6nMRsllP6b8<c1LD-8NmPwAXWuNNTHwr z@skpa%LpzZ7!}wQKu&~|q#&1oJg&qBvWC@_m(dZFHQB(9VguRA1}WfpK_x$%1{25| zpe(?qzy!`99NY@bicBD57(rDWxM&8I$zTyku4e@0dZ=5NA!RB!k%6)WD1;OkL1D;_ z5r&+|VaN<}A1KYUDRO|!W>e$<2Ol%orOcq<V+JLEaPbNWK9Gr!;Nt*!1msOeaPV<} z3II-S1r7y91yBJBE~!AOLBYpPYVd(w1_~-iP<aS<52FGzQphnQLXH^`atsQf;soR! zMlef(0o+>PR$u`)1VB~lPew*2MABAZ0hK}w-~<OQ8^Gbm<j4e0z&T1xjtv3|Ai`T( ziP4co0hCr9TN)2AfC&L!B~YGFU<H-wunf-vmQrAJWD(#3o5rHS!~hCTR8^o7g$b&U zLxBb4P9BgZ3@a3w5auf|@iKBdGD3<&CQ!N00!ow$jNohquA)H27N`hf0#$0@Ruluw z_bi~S&BEXaZtbuzFo0<_a1%p;!I32kl&ioQ9aLf|f!z$s%!~re+}to_AZJ6=IC6kB zfR!;SFgSvh9fpRkLbejP00*^ZKtajq$;$w@gT;}tM2Qhp0Vptm!<7S6ReDP+GD5-& z6j;oT0-)N_5mbACS}SHuBB06>T!agNBA6MJ7X-LLrJExosG*Z3AjRYWO0i%Ufl79e ze;7b1m01JSv=K05;0DRFC^CVa0;$O%DMW$UQ32di6fk1oUJLRB$SJ5;0TkDcjEXFv zHmL_Mxa0*liI~8qDlzl2DlqagD=;ZC^RR%TfYFSJ1*D!E6em1v+zO!V29jk2H)92u zK<!y(S6)UQCQt<lYSJ+ZuqZL}g6j~FZdlC+Ztb#w8pa@VSwQ6ls3{Bf0rz1>NTsQe zt;7T=tR2A(L~LOWYH%{+3UempFlSO=0fjjexMVS70*5&hG|ZV47#%@%l>j8nK?MOQ z&X^EM0$jMVC@_G-oJoU;MUfdL%$Y%6U_uIW9tNjxkA7_Y^l<%iR&HJfr;F=m9GTg? z>3d5(_kAXa{{*1^gT#sgqhkZuhhRs6vQC45Kd4YwV05%EbZlTOvSQ!`r7=ggGRFfT z9*-lFA}FYt96)~JP=dHfgNeZ%lr|NZ1*E~^ph#g*U<UUgI6xu{3d~swj8+T`JWSyB zonu1-3n)2*LIGwIKiDRrGRF^Ko4`D_GPpzdzydr70bWNIXeLH-E?m_EtcLJ9GD8~0 z(7X!n%_xCN7bWIw1x8R~2-E^%6p#cJD-2+NXfT0Y&jf0vFbcRzfjUbHpxzM!w*n}- zRY0YI2m{2M4B%{{!Neh;z`#8RlnEfcJZ2S8-W365cSROR=!3!#QeyBiF)%W7E3oh~ zInHT3z@P}~Xt01XC<`wm*jP|i&!WfzW-EenAShw6fHE^E4KO?IXgUDublHJ|NWeir z3#0^;&XANW!B8R&YN0dmGJx%L)K*{=umIJR+)}9Gj$axNFhHf47`UaOy*N-e@k_UZ z5|bmh0+X~LsI$*)15ad(Anyv;J3ayFRRk3l0(JsQilD5+1Zw>;f*LcRh88#xGYZHv za8GAqVyS1WQ)X~904GvVL7oL_-hgTs7HH>JkwpQNLmWA>lvqI?WKdvoVl-#w0F~g5 z99iJp<|vWnD3Ap%ur--L-8Ka#kPrt*h$9Ooq`(4ZNhmNmiex#S0fi1onShlPwEYS$ zCP9gTNt2nw9Mr!9$%AZW0jq$@Gdl8QL0rPD$;6<@roiaLXwC$xQrOIyC72u>c_5u~ zUIs7=RDLolFljPNfchJtE)Y1OfufPYv8Cw%15%a4<Y<tk!oa-^S~lSe7EnpT0V?d3 zSRjtU87z#B0`M?^1`Eg);J{!2r5`X0XRv^>3dpg{AU{BY1=-!;=!Cl4m653)9CwP~ zZVCe^E*&}Gp#fq+Lj&YzNJ~wD!Ep*oAaDzV@(r5Ue`ts(WGk_%fI91Jjtrpm*wW*m z#11ZWT6!Ennaq(vm!YG_0o?7?V4Bba8r4u_0}YihI5Jv+q_{y1Br}i{NWB8PBZCL1 zIqb*;>I$(cuvjrjD6oPWks_e3iW!pt$ethFAbaY4z`bdZg-YyZOh3AzV>k^x4&WvY zNadey2Ss)TR?r{_sK?3(YR9r_GBbdZEIYUt2Wml!2r`1*{{y5N<RW&*`Yf=C3T%$x zP8ka?BR2ymcPcOnXftrDGBQHjUrZ|CNCS0Fm_T`o1DrnuM5P!QxC0oOK%)-emIyPX zqyeW~NO{MQt-u5-??ByYCRlj~DmXyp9YYqV)d4B&7!;VYz{5q{e9%IUQ9w@0k%2oI z;tEKesQ|0xpgB|^O93URfm0`_jRH@73XI^S268bAJO^@Q30NtDQZuM2p}+_mATnTp zu~^|OV+L+}xC<CS1&*T(G%GSVHZ+5>l7s>SC^zzek`-8h16<%c&S^ftAYchMNgvKq zVc-T;WExBiQq1){4BVjB?jCkVwt7&}D*#HtpkxBUAR!JV7Dq-mQ18}}(H+$0U<T3P zVlGRORe`|~T;eOSfx0k?><WyE9H4dzg9eiXD0~$d9A!W?f(8?hAQOWkGY>PUnFChF z?4SUuU0L0DnLxHFFzYZdC~-J~(j2&61$Q`@927Vl6Tp$^$drW;Du4(vLxezWekM>g z%2onmf~$6(k|GeB+0nkRNP)xgKVzYz5NK5F14ChvV?)Cc1~*<%Kb|E^k%L=-U4c1U zfg?+iU4aeMQ)L4UG$?Q=u)2Y}vK%0nF+0|KfkPnyRI4*P7Jw)YT?UxF9J&l}dpUF& zAohZ~yqNZa#;m|zW(Q?2n5Wnkm^{IJP}`70fn9;g4cz8)WKd*QU{?h7n%J{+7#JKK zJV4RF0S;_tklUFQn599(cA!B*=!h7oHo+bT{M-r*jy#|^fpi2x6+Fl*j0#Kw&M>zy zfgQpDs-T%1nF|%!!OmrJtj}^}_J_zRFhT|onLwR8Hb(}K0~MJ;kqVAU$NlwQppg?s zu#=%2CS(pXoTJF00Lr|I%nEFvE-57R*<E=VP)!3XW6T1D1}Ku)L6HO=rs41fJBe9= zRe>X0iCvKm<XX^ZvjT%IgMt!=0*52Bo3tZyAs;gn10xeC1+poyL!8g<$XEt8kueLz zVgn6tfbD=LTt#+JCSXwnxA7zt8JHZH9Tb>B_Jf+_3JeMy3hbbAj{(%5;C5u>2X(xd z6*!<tj1g2WDlmc6fHD9$lQ1(oFgYl&DKLXtlxzxYp8N<)QH=vz1W|x9GMTyE;Y9?f z3C0Yn>_LO!3e1jcz$Jo!0yC(H0JW4D&6s2$Z7K=S@UEi-sMu2g4L4gdaNEJn0T;QT z>O%rlU4ok&ppqBV$K3-ql1G6FYB;ED<H!<FW#FF5%E$#OvJJqUIt6A&l`L@212i0M z#h{_U?9>1PETD>k8DyLSsHdU;?x9IQC;>>sLB?)4lvqK7da&{Z)I$SxAwWf^29tmy z130TX{{R0Ul(iYNlvotmzyZq$sRxum2?*5XQUKM^44^Eo!K4Byhj>99FHj}G3>sQx zfM^h8VBiHc_BpZ?LH${dEJa4J6-sQppf)|IB@E6s&@QhdYY8Y(fU?B@|Nrd^L6a6N zpsJ2Rk<pO>%`KqBf#enj5F6$eW>D{xRe>!_36$h?85qEU1?~rFGBG$Qbb<nm!BGO7 zWjR4M2q<znGAM$QF*sj>TiM`Jn2(u}fr*hDG`dov$m7VM$gaSpz>}rK0~+6waOY)I z;L%_LRhEjJpk&GpvY8VUz03;iW=x=o4*{?(2xGxMh8fH5$XuexslcVcnWe-DHxe{( z4jS2E2N}r?GLjvV%DBy#Bow$n*@wZAxg-nJ!Uy%3II=)OETG^9^^L&c%%Q;MsF0<^ z<_^l!jtq*R=^9Xf&=WM(1MWgAfIJQwqhKxp57tU6fkx0lQOkl9n68k44^SNsZdocY zaPu%YHSSn7`RnJWZ$!9dz!OXo;I!+=r@)9@IdKbsW>r9;19qQ)IX64FF~9+(dBC(T zg8(<ICj{=fuz->j0|R#*B=;O(0Jqpc<Lsao3o9t0bD*}b6j&W~vK&F9bqcJGHd&66 zpw=d<6O%cUi~_6U1#kwFP+)bGGGj7PU{zpsG{`bz(g3prvdow)z${Qtz(9f3Q6fu$ z1ys*3=3wNk2W1}x2GEFWO`#H#0z<YEvjVtr#q7ueYV9#9FlQ^VID-47pb<MoR!~X> zjXQwGL_nQ$W~9<yfx)r97+&BrDlk9>96<wbpiw|Yun4mQsG0{=OW-n|$q}i*2Mv%R z$siT@pym%tmLih^2dKd30L8ijD8Hhb2FmK7Y{jGiYAq^(3w+S%a2BW-Rshd3fl@?G zVU`jT)E-4P1y)FNg-wA;hk+4X4S@xjKy4VXAQMy&G~UMqD*V|L7_-2WQ=rZbvnwxX z2J8T6wCDh%r?e6zpcGg@6IqanD;CE;jD<>Epvg8+=Mow&YzhonpqVa3CIvP{P}K#k zW|bHn>x&)P%M=(L*~*F>8=G1<3c+nO(7+RRIp`o8Hhs7>F=b_CfdUjXm#M^{zz)ty z3Tz6Tpwf(4fhAiJGyuv`=J>zy4||~k6NJukY;0i3aTF*6HGVk2LCUSb2ATpY0qJ7} z7q85q=@d{o%Uq}gieK=^Hl(2lnu&n42Owk7j(`6D|Ic0sE&-XC9bhdDC3dJ+*s%lw zb~#88V3h*}0X7NbAOIKPHCdqP8t`-*c%+)ev9Y0{p(aa_5#%)7#(+BWjx3-608L^- z%m8&d@B|(|H)v7<)C}S029IPbLK?Lo1K>?2P;&}2uK*4n&}1lw0s}PNW`TxA;SD0t ztSK@FDd&Ki_fV(7yayg}1UHr7rh#iFMvxCcZ8jw)a0cVxKF9=~r3KZmj{Kkk0n{P~ z4I?@-C@^F@G8ZbbWPw_R3gD?{P`i^6RFNq#D}bgWtQbIbE+c4G7c}mr#H_&T2{xEj zfk}ZSTZtVsSHJ-t&;SL70!tQnE)Z0#a5yr8hC(?VnM;(|93=`BnG`rds<}YH44V63 z%La+EfaV*)b*BQW0-FL;8K`_`P-0VHDFIIwfU0&yMg>+!mMkS!1!hlZ#SAu`L4gw- zuaF5&P?3tMnwuLuZv(O&l;A<_aB$#(T0mKfte}>i0wcHv2DJbfK`j7OpE7WBf#>fP zm;_w7xnD6eGC&qqJYd!@EiTe8E=tyiE~7}zD=Df33nV8dXQb*C6*Dj}FbFUxF)%O) zGcYhHFfcGA<`ktSrc^2<<rfv@m#3zHMwmdVKr|Br0|PUN16pFjz`y_+h-YPBU|@ra zgZLoK&cMLH!N9=4$-uzCg+qOEVopwKib8^aK}lwQo|RQ;UU^Ysfre&+LVlh?qC$dS zeqL&VLRn%?X=+YpQc)tv;Uy_x#}_2#WhQ55=B0x?aGXJaL56{W!HtQ5L7stu0mgS{ zVqlPCU|`^ZVvxId85kJ&pl$>4`N6&ig#g4af(#4{LTGA0;UWSR1L*-_Q3eJEF$M+( zaRvqknBx+2a`KbG&MQhRk1tD2)+;JbPAo`F&Mc`^$S+GRO3TSFXJBAxU=&~g*^|Nu vaW@+i0|O`woxtJkTUz2;RFq%Dz#xqjZXo|zDKIdsVH5z1o?#SV0L29W)k`Tp literal 0 HcmV?d00001 diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wasm b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wasm new file mode 100644 index 0000000000000000000000000000000000000000..383db3bebf9adb36eac791f54ea6a70e18835827 GIT binary patch literal 408 zcmZQbEY4+QU|?X>U{7GKudipUPhbL*to0zkSf9XH&yc_f6=z6bU|>pQ7A($9EGmgF z%FoFuEr?IfFG}SqN=;0O&&(?*En#55l;$Zf$}CBZ&o3<jDPY7@z+GIDUz8dTR>r`@ z%*w*d!pg?V%*epVF2cl|o0`kSz?Gd^l$V+lUsRgMz{a(NkwuG<sowDygFYjJBBKJB zVp3pKU~*@1aD2kxDCEchq8J32q`0{`7!(*Bk1%9&2QaeMJN{$PWnfTbcKid?1m?0p zj9^t@6kt(gQ(#eGc4Ki+U~pv2Qebps%obpjVpU*OV1fv;XDP4=FiLTAbIUR^);r!| zbZlXAoFF5>pvd6Z!lb|;!0On-B*4tgZNUn11-Fns#PRy6d1d-VsY&_yB@B)~7`T}j Y7#SRYfoLWM$3GyNfx+<~12-ch0Av4MZU6uP literal 0 HcmV?d00001 diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wast b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wast new file mode 100644 index 000000000000..99026dba63a0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/echo.wast @@ -0,0 +1,106 @@ +(module + + (type $read_t (func (param i32 i32 i32) (result i32))) + (type $write_t (func (param i32 i32) (result i32))) + (type $store_w_t (func (param i32 i32 i32 i32 i32) (result i32))) + + (import "smart_rollup_core" "read_input" (func $read_input (type $read_t))) + (import "smart_rollup_core" "write_output" (func $write_output (type $write_t))) + (import "smart_rollup_core" "store_write" + (func $store_write (type $store_w_t))) + + (data (i32.const 100) "/kernel/env/reboot") + (data (i32.const 120) "\00\01") ;;Start_of_level + (data (i32.const 122) "\00\02") ;;End_of_level + (data (i32.const 124) "\00\00") ;;Internal Transfer + (data (i32.const 126) "\01") ;;External + + (memory 1) + (export "mem" (memory 0)) + + (func $set_reboot_flag (param $input_offset i32) ;;location of input + (local $eol i32) + (local $input_header i32) + + (local.set $eol (i32.load16_u (i32.const 122))) + (local.set $input_header + (i32.load16_u (local.get $input_offset))) + (i32.ne (local.get $eol) (local.get $input_header)) + (if (then + (call $store_write + (i32.const 100) ;; offset + (i32.const 18) ;; key size + (i32.const 0) ;; offset in the durable storage page + (i32.const 100) ;; offset in memory for the value (placeholder here) + (i32.const 0)) ;; size of the value in memory (placeholder here) + (drop))) + ) + + ;; Internal message representation + ;; (see Data_encoding.Binary.describe Sc_rollup_inbox_message_repr.encoding): + ;; - Tag (1B) `t1` + ;; - Tag (1B) `t2` + ;; - Payload (variable) `payload`, expected as a Byte + ;; + Tag (1B) `tb` + ;; + Size (4B) `size_b` + ;; + bytes (variable) + ;; - Sender (20B) `sender` + ;; - Source (21B) `source` + ;; - Destination (20B) `destination` + ;; + ;; payload = len - (t1 + t2 + tb + size_b + sender + source + destination) + ;; ==> payload = len - (1 + 1 + 1 + 4 + 20 + 21 + 20) + ;; ==> payload = len - 68 + ;; and starts at offset 7 from the input + + (func $internal_payload_size (param $input_size i32) (result i32) + (i32.sub (local.get $input_size) (i32.const 68))) ;; tag + + (func $write_message (param $input_offset i32) (param $size i32) + (local $internal i32) + (local $external i32) + (local $message_tag i32) + (local $internal_transfer_tag i32) + (local $payload_size i32) + + (local.set $external (i32.load8_u (i32.const 126))) + (local.set $internal (i32.load16_u (i32.const 124))) + (local.set $message_tag + (i32.load8_u (local.get $input_offset))) + (local.set $internal_transfer_tag + (i32.load16_u (local.get $input_offset))) + (local.set $payload_size + (call $internal_payload_size (local.get $size))) + + (if + (i32.eq (local.get $message_tag) (local.get $external)) + (then + (call $write_output + (i32.add (local.get $input_offset) (i32.const 1)) ;;Remove the header + (i32.sub (local.get $size) (i32.const 1))) ;;Size without the header + (drop)) + (else + (if + (i32.eq (local.get $internal_transfer_tag) (local.get $internal)) + (then + (call $write_output ;;See comment for the internal message representation + (i32.add (local.get $input_offset) (i32.const 7)) + (local.get $payload_size)) + (drop)) + ) + ) + ) + ) + + (func (export "kernel_run") + (local $size i32) + (local.set $size (call $read_input + (i32.const 220) ;; info_addr + (i32.const 260) ;; dst + (i32.const 3600))) ;; max_bytes + + (call $write_message (i32.const 260) + (local.get $size)) + (call $set_reboot_flag (i32.const 260)) + ) +) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm new file mode 100644 index 0000000000000000000000000000000000000000..fba1f191b6ed6a5ddb68d628afa7d2ff06255a6f GIT binary patch literal 9863 zcmZQbRLEsyU|?YM;z?ktuV<_WkqimU^<XvwLjq$xgvXG;QV$UX(;x}P`UF;x7)Tdm zJ!2h|$H46F#>~RN%ErjR%ErRZz`@DH4x*SjSXfwC*%`UG7+6>tI2ajO7#SHExfz)l z7#JBDnHd=wSeRHDnYb7jI5;>MxEYw3SXdbg7-eNynHd=b*(90k866uM4lr=nGdND^ zfzS&;G`leiTW)G@eo-Y819x_6QC@0Jd|qlr2?GOHe0)k`Nn(6zUJ5fKcYJ(CYGOfr zQetr`GZUv0BZDI&w+y2VCl@!5ppdYDvbc<xtc04nhNh0Lo~fg)nKjohH@7w>M%H@e zhK7a)21kKxB?c8RQ(y{6fXRW$!I43O=|S^>1_oXRM+V1wGYAJJ^8_TL#OTV)puniX z#Nf!7rN{)*@dhNW$P8k>05e&57`Yu;99aaKKn8<!FgY?PvN$p*Fq$!eO;KQUWH196 zp~&ROsL0H%z^K3k;xi~Pn=ye6ab!?nQDDw8V*;D*$N(}O>@-KlEU3E_7#sz%AYS0- zcHGi%0OTtL21kx8$0K0Q5)dhH2;>L`h=Vpl*h~!E!i<dd3JeO20&O56MJ5F%er|pS zkca}4Ks!i`pIaQNMuACzS)c<XrpThe!q3eMRwu9pB*M=v#NhY=<ZX~%fj*EJw+NDu z0+T>LSkRS`v7X5Rs+L)S38Ges1r(kv3JeO&3XBSj3e4Wp0!KmWrJyPqKw$$lLV<;w ziGjNuY!H)!0+S<Ci4v0nvm<kfV?zUDmJ&0_rQXtx?F}qhN-T~7WeyBV%#QW$ybO+v zptw?G=3(SkV0IKJQDSytFlT0PWKaa@XE0;pP+(SIR$y^#Xs9X7a%3tpV`AV2Im(O) z<Tg;`aI-QvHn4EBfKu9f7DkSGkP9@J7?fB+K45gL&r)PlU~ptAQDg_jbhaV~vx5Sw zBS)4ZCnyCeuxc=IC~-M57V<JEuqrb0Fmf|HC~zupIo1`LF)_fDuqbgk))Xpnf>Iz@ zkt2fwrvj%g1A`-Dp|m0+H<JU%BnBmJkTM=ukU9k(1#U;CLTM##kW07~xHXtq9GMFh zIEz58XVqYW7^=t#(##1`!>PatO2N#9V6z-+3PJt_u~`(kxD{9xxEz@a!FoYr3`(3} zE(4Q;0;eNWA;<tmNEU#G6O#g?854s7BiOSFjEbxvS(s<JLAHW3OiiH@7g&)JYqkQr zCoj~~3d{-&3M?8-0)pV|2nxb1M~*B7E(P{%1&%@`E?-^-1vUlNLS7~XCWympKtTpd zFCbqqf*sGO$O?*FE^x+D;Bu_UQet&tFlS;=0K1045v+&F0pv6WNFalP%aK8WTY(E4 zdR!onaVc;?Lyr{{dZ54n1t2ImLH4kKA_HV8IMSdl0EdqPYmpKcEFwX{1d3)2CI)aM zDljT=Io5(5%?b`uN2VerP?&+tXLJOa%)kv!Ed1OGOduz6D6xWql$Do(o7<6rdkr%q zGg8UL49WK3M8n9-puhyR#gQ45?wQIISwV@@k<}mM2*>&?B}T{pjNZJUOa@Kspx9z6 z$#P`L0wq?*1}0BwB?b*91~VoePznQOBuAbs1!hob@&;Uv^n!Aw638}Yu&@HF0+YZ* zkf0-jBBKJc1``9w0#IrL^LQYciqVXT2c%Si8Jl^EjNn|R!Ng<6!~lvvW(7=FI9>rc z0744Dox$Xwzyitxj0#Nf0)Rz<QGo@m0APd^0I-MvWqySFz~wMV7b9xk2bD(14u@C{ zAt6pcaXGk9ftJMzjNH#y8QG9xiv<>23gF6v$rY6H6__E>!{o@E<;YY9iX>)eB!L|T zilB-tB_;(XL~>(M0L2feSaO8K9XQGqnZfCR#gQjVU@|B^z~+Nex?@e25-Ui1O`#GS zD0Q=e$}4to83fV;N+ci=4sbYva+xA0C=%EdIYFsHfdiZ`I6yi%6gZ&yf(?`}z=>Fi z5u}gPm6s9X$eKb$MsWUAWan1kRA5wKcVvc_EDWFkV^v^;6eS7}e<{JZjNo#GQGrbX z<U~mM3vvm_^Ga+WYgk=*8682HnGNhHHju4skYbS+RB^CrFoC=Q$~0^WOyDfV!L7io z$OJNm5mc{&3v^IP4i<rw6O5p80_qlKNJ$J%fS?Qn3LynXP#Cgfgdrz#7&3$02g(?1 ziX0%b*%Udz!N&}CDKjYem_hjiTqr|=4`d=F_&7iw0eRCA9DE$0B7>7#fkS~&0aWaQ z%Qlc|Q1G#n8hl`vfr82rRD#0Y!>GWF6mrankYh%K9D@R=00Mc35zJCx05?&%6<FY{ z4p3!0jfs&7GpQ@EfXXliaN+}(DB!SUa%2K0=o}>`#|8lf5aBJY#OTPP07|=#EsdZS z448yuF(pt=QD6nt4Y1;Y1)@rU(UC=<3zXKu2D4}|F@QoDRVk<>VuEVsP+$Q$p9iE7 zhi!^X2&)vBcp14J86l-A6Q~+t0i{?4MsU6Z*Lt8r4^(zBf$B+c%Z>p#Xjm8&7(s0X z22dceFff2=EpW?4fx(d_3zY4^r2(k8Qv$mll;ar%nnAwe=7uQ+c><!&kprv=tdvoK z!4a<XHX|Ym6tb1zbpxp31PX6PPf&vmYA1^$V~G+YsE$!!0tY?^s7CgdR%C>PBq$h} z9R)xYup_8~0yT=vm_$HzG`MyU0Hp|KQ05Wf1{IQyjG*>ZmcT5KvzZ(~$sFuLP{jfA zBLgUTGi!iaQ3BA`CrAy8A`>_mAPomd(o$e{RDhPD{M-VYKn5~!Zv}Y{<TO;Q07@E; zjEXFvmb3>ixIhQD#F)UQD>3u3DlqagD=;ZC^RR%TiP4OS1*D!E6mL9i+zO!l3X)|6 zH@+cFbx=#3*_D@(hY3_KgIbe}0xckSC^7SbD=LsFu*w$PR%Zb<>_O(UfC?T^+Z*g7 z?%Rxr`dT4di3w2yID*@$*y04#0A|J&Crrq3!lb|giW4SqQDw#ijuR$moG>XcI)bW1 z0YsdDN*7SPG9i)>xWr~rV1UO7lLixuA~Q;yFoV3rge6XR7@WR6`myoT!}ZTuxp^6! zF0Pw#WM=cG?=AJ*-<c5p7C`bhB=!^-9UH(t2Rjy&85;!rLA8ehqoaMHV*_K66$39Q zZ91}*IUWG<cpRA&LD9kF0P-t`62yfXObqUzG_AlaFdGy-U^!6aF(@#D`$rrg5e5b3 zECog@1_mA`a1+$Ap@9XI6+j^bvyC5Yn^2kK2e55m9$OjQF??VF9)tj|BMY=pKyor% z)dQ@C@H#R>+U?MM5ALEVfyyi;=4=H<P#X=@Fk=*$3HA#}0_+zJCa@2fK<y?*Xr~C& zDO6z00{2cpNdl6t92vMJ7$9C|0B1D~CJuoGAk!GQ_k%JJqR$I09TXTGML@-gA`2vD zK;a81A^4aW7@4^hSa_Kn=YR@iMNlV+1(fSqcp1TVfEpbviY#EZA_J%tU;&kZ%%H{z zC<1mg9cTdcEcbyN017~X10a^bDi8@$4@#*lpb`a?z?dDE;8!mL>UV&8<Y4DGYAY}b z?0}jCs?k9%=VgGn)lu8=3&_n#3YZwURiWKjP#5}3_kjimB__vikO>M*(t?d32B>(B zL`k@ekbqTS5ZDh=;P?b=>_QM5RB{P`{U)#o%m?LLCQxIS5flQT#w0lBFbd2ENi%S7 zWMX2eXRL$9fdM>Mfa;<wP~#0$SF%7y6%<(%K-tuhBTI=D6iy5ZOiqmE%p9QV$B`oo zob4SYvK$4nz_pDg6Q~=jzyuQF010tq!Gsi8z$^&`CP$Gh$1~tS2B{O+1#*@Yv<(j~ z)IrIQNt2nw9MtIrsR3Ef0#*T)XLRJrf;fj+lZio*O@Yyg(VPiXDYBU}OE5V&@*svg zcp1PvSZU9wz@*760qTf>`iG$U7&P>uz~I;dauO)zKx<DXM+0c_&wT=^_#_lypu&y= zR9`8vKwOA3z!)6`;GqKzFp!hL!NdScs9+ZU00ZStaIyvY3KC!_J^@EPl27~?nd-su zs|fDaF@WORkpm^LKs=<t0)+^qy{f?AI0ZF~xJ4MS2(CsdbQQ9dSRrZGkx`KiGH%q; z14{Jl;F1x{2IYB223>{@kOX)LL4#=mhz%OkVgrp{F*q_>L8Q4sO-D0`G)SKUyCZ`K zsH@<}1nN+-DzI2FNGPy^8rUMBex4bV04SsV0B1CI$9f;|2nEP;C3Z6=urOqxtpQ{q zxQPc+{|BUAkzIimG>ilq3xH%y1y%)CO=bpA24DyGk3l^R5ooRj=>r?6$PRKPyJLM8 z)CL7MM{swSg_n_=0aQvTFbb>&C3^;LLq<lV_A0bu21P!oyT=5|!5rWmC@>YIUW$Q% zJA#o3G}Z%ds4+tdNpRMH6yXfn3QV9P95jf*B!E<egGxG35zdeWYKS4qZw3V>Q2Fi1 zz%2wVvl#{Ef$ef+;4VS94$*8-fK~L+vOyqA0VOGeQ$MH~2T$D!jNqgU@(Bwf?{j29 z^1dP{%fOmi3XHJvybT~nFu-`ND7?)Oo*#<ypyQ_s4309;!hylD0W=h7#w4M@04gAO zK&cfX!U3-K9Or;|0y`nbf$MNaf%Pc7B?z7d6N40UJr4sns1bdGosq2`ROtwS@(?H~ zLNG{(Ly5(a(G4{G;K=9>YN|1VXmG)trN|1a?3CC*T}VZC1x7^<P!o?qgGmAuH((EF zFfnK_@d!47ZC7OGVFtAn!AhAO6hI9RRySTIkc|q=It&a-9N?4<Zf<}(eM}At9F7U# zgy6`Og%B!$2r)y1K>aQzQ0s!N1jGcldU#5TKx}45`@$jx4#)qDg^og?@yrhlg+-1H z4M!N<ctHa$ELn;i+zRXp%-ISYS&HlmY@iVXHqh{p0*3;t8+b^81LQJh$9gYtNF;z7 zJIsy+Ac{km0cJ0UE(6?N4qXO_y`Z57OnX72jbJacgEBG9Q|t;%o?t$xdCj4~uE695 zZZbPEC^9RsD}s8i>{&Vt42}*Sps3&g2RJjx?Mw>H(x3rX&^Rx2EE81k;f@D>ZUqKM z9&kg273>fuM*)y`7!{ZV4ufI}<|ZbvgTTFSCP(H%MRus_`YcCge~6p{BV_oO3DnVM zb7TNHRFN4Jx!@Re++Xhn8t-BRI~~elLgp~TIf@(#pn^b=S%D2SJOGIWc2`~oRMWu9 z7_&g30*WklP-KAz*EoE^PGVMIRp7{0Vpn7XxfWC^Dlq6WC@66#a5yr%NjowZ@-Z_p zFfxHsBAWs`#QE%wjAdXG8M8nvHqg)$*bY!G1PvargE9n*BDe`Gp~%4G!0e#F46+~8 zvr%AB;80)(m9LPoR##pIZbwFbP+yl>fdiV{7(r#Q0ux9bEJJ`Z4l}a@lY;`A0yC)b z&8EQS$&auc(^#;j5Jh++n3+2SrBs2nP?<r^7I0I6*>Mf1)G%WbP+$g?DxkI_qZyM7 zqzNej8o76r0F|i<plJnY+2Vs@D7>5p)oT)v;$8$)u7V6@a@+$kpGScSW)-OD<j4|O z3QA-Q+<RFWxnQ-10lbT?!0f1!1@7;G<{+#XG!&SfK*8F;0;;dT?O_E_|4;$kUzUJS z0+6_d483tEv4Tc#A#HKc5FI0^egh4sGHEagC^CR^x#R!;|3Re!W0n$&A{#gk7$Mb= z5-81qI=l*?CI$njbkJZ@K@?-Wpsp{d4q^t4r!zn_K}XqnL0u`1EJe_$14ou3BiJe> zHeOI~iCY2G>40|MK`jo}5>R?_tj_|u#l8^KOkjb!)R6(rO_1)t1{2gx3?TO*yNMap zV_;Qa%TfZRSX~ANaKM3ko|;SyP70l%z+-Tf0Oxv6kSzj=T#gKipj-gX)}R(YB*gfb z85x)uxj_SEC5k+b42tXuTnao{N<5&U${C=jbLVAL-~kuy42qnfRL%~vofFiIW>#Pa zMLuW}4V-Nt@d7JvU`De$GM6ZFDsU-qW+`!^7z>&~0c!*q%MCJ?9g-%wLDe4@C>Js~ zGM8k5x=WyL5l0qChy@n>pk63A+&L8392K&Z*xW(IgCm0?XyOml8}|fF9D)Zn6hMIh z8eL*80gu*8D}km{KvB+u7PzjEVJlG61KyZcVBqFqaBAGKYVz05Pv3}egJN8RNdl74 z9r+X(9c4g4jYu`1Mkb`E2X?T)c2Gcavx6He98j7EOzScTz&oB`9V{SIKv{r+fqOC| zA_pE|fHzA)(=ni?7AvHwh0<_TV0F~Vas&<0DzG}*WI2LcQ=ry1s}qwslZ*nZ;{`}Y zl~7=H1dlkGF`0mxh>iwXW=tAjmOz#nlLeRs>Ma>4usTX)DX_p=9E&*^IqN|&t-t^p zcdsc_Vp3qpR$^8FHy4>5SwL-CMg`_<B^F2UU;${%R*@By$Uy@~paCw>ND4Dj9izbD zSYHgUW*8M1AVbcep;yp2up(H5*#Xqh09A_MnuW;`shR-|iz3M&RWqP=8cUWUlL7~* zn&AK?5Cu?{M>P%HoMQwj1GRvaz|{<BjvxzE_$z>CCqap)rZ7v132Kibn*uAO!NjJ( zq{F}nuKd7)OrTa2Sda-S2paKa0#!L|3XECcNlj4ykJ*(MG;?|YH2imf(NkIp5>N^( zpb1dOgeQyRAI3r@F3=<`sQV5L7d8ckEYJ+8B9j7}BB;WIR`5!Uj`hWk>}3j!j%;N` zj*U$%9EIQ}Bd8d{E(aY&#ikFJCZ?>cEKo>+a=j9R0y{X<DX=MUf(k-r1(s|@&=5FB zndAS)KkS7HOb|NDv9W<A$5EgR)b!#22PwA#8)(|F1f-7@R4V>w22H(zifZOUB~bi= z=QbcsRnQC-q!q#h8c1Pu{PX|+fA&H}M$r5-vjeQmQDTRBg&j)}V3&gg0aiIs5MYx) z4gyeF07_bnpri#$+$@fuzE@3_A|uFYxQzh~ggCN*0su7m4VoF`22~vR0*{{?G%W>c z{P1&w=Q0!_O=^$<@P-;Bh(NO;phg<FNyPw7w^^WZZ+J5dG~15MLCQIx-UifZHCZsH zxk4LgaMQq*8Y9RDOrQo56DSlEIJgfofoJzYRkR~Ns6b$VG`$!c859_@9hnQ2Sh7G9 zL<-=w3!qjnBd88kU{(N4NLev}s%=KlY5>q+q!P0Nt0&lCRs|*nmTV<<&}<P0c;E*V z7z!*|;Q3=vvBKfV2pY@gbYw13Vsn%zRAf@%1gYi%1v6;&i!B=@$^x3B23NZZtO{%j zOl6>|fI*2(fu#gIT?A?!C^9OrI<jObu_`coLhE#}=?n^-;CO{hii65lOx4`n;F&v+ z?Vtn?>IHzu+d<8%EJapOds2ZBTycXM4~(G31FBCMxcR_KL=>0=j({r<?pMr=43Gss z5192!i;MJ&i<0%B%X?DuN{TAM0?CQV8L4_j#S9D#3<3;F3=9my3=9kk3=9m3IYp_7 zDU}LI`9($f<*6y4WlkVfAexDRfq@ys0WE!EU|;~vwy-iVFt9<zL3|KqXJBC9U|?Y2 zWME+6!l6DnF()TAMIphzpd>Rt&&sMaue>O+KtnS@AwN$cQ6a%EKQA>wp)4_{G&LtP zsVEWT@RAg;;|mh=GLy42^U^^cIL;uzAj81G;KszjAkV<S0OPweF)+w6Ffi~yG00uK z3=9l>P`82j{9xaMLIC0yK?Vi}Av86ha1nuuf%Jf|C<6n77y|=?I0FL%%yEf1Ir+(8 z=M^QE$Csrh>lGCzCl(|oXO>hd<d>xurRC(8GcYhTFbXh$>`7sSxSNfMfdLeTPT=tN jEiG{^D#|ZnV30-%H<16V6c`xRFbaT0&oBxwfZ_rGXd!i+ literal 0 HcmV?d00001 diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm new file mode 100644 index 000000000000..a817ec8df9ad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm @@ -0,0 +1 @@ +2@Cϯ(haSPi9 g&4 \ No newline at end of file diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune new file mode 100644 index 000000000000..f8f1dc3ad6a6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune @@ -0,0 +1,179 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executables + (names + liquidity_baking_pbt + saturation_fuzzing + test_merkle_list + test_gas_properties + test_sampler + test_script_comparison + test_tez_repr + test_tx_rollup_l2_encoding + test_bitset + test_sc_rollup_tick_repr + test_sc_rollup_encoding + test_refutation_game + test_carbonated_map + test_zk_rollup_encoding + test_dal_slot_proof + test_compare_operations + test_operation_encoding + test_bytes_conversion) + (libraries + tezos-base + tezos-micheline + tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-context.merkle_proof_encoding + tezos-test-helpers + tezos-alpha-test-helpers + alcotest + qcheck-alcotest + tezos-benchmark + tezos-benchmark-alpha + tezos-benchmark-type-inference-alpha + tezos-sc-rollup-alpha + tezos-crypto-dal + tezos-base-test-helpers + tezos-protocol-016-PtMumbai.parameters) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_micheline + -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_alpha_test_helpers + -open Tezos_benchmark_alpha + -open Tezos_benchmark_type_inference_alpha + -open Tezos_sc_rollup_alpha + -open Tezos_crypto_dal + -open Tezos_base_test_helpers + -open Tezos_protocol_016_PtMumbai_parameters)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./liquidity_baking_pbt.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./saturation_fuzzing.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_merkle_list.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_gas_properties.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_sampler.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_script_comparison.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_tez_repr.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_tx_rollup_l2_encoding.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_bitset.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_sc_rollup_tick_repr.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_sc_rollup_encoding.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_refutation_game.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_carbonated_map.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_zk_rollup_encoding.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_dal_slot_proof.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_compare_operations.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_operation_encoding.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{dep:./test_bytes_conversion.exe}))) + +(rule (alias runtest1) (action (run %{exe:liquidity_baking_pbt.exe}))) + +(rule (alias runtest1) (action (run %{exe:saturation_fuzzing.exe}))) + +(rule (alias runtest1) (action (run %{exe:test_merkle_list.exe}))) + +(rule (alias runtest1) (action (run %{exe:test_gas_properties.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_sampler.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_script_comparison.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_tez_repr.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_tx_rollup_l2_encoding.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_bitset.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_sc_rollup_tick_repr.exe}))) + +(rule (alias runtest2) (action (run %{exe:test_sc_rollup_encoding.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_refutation_game.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_carbonated_map.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_zk_rollup_encoding.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_dal_slot_proof.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_compare_operations.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_operation_encoding.exe}))) + +(rule (alias runtest3) (action (run %{exe:test_bytes_conversion.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml new file mode 100644 index 000000000000..5c38346b763f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -0,0 +1,326 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: pbt for liquidity baking + Invocation: [QCHECK_SEED=<seed>] dune exec \ + src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.exe + Subject: Test liquidity baking contracts using randomly generated inputs. +*) + +open Protocol +open Alpha_context +open Liquidity_baking_machine + +(** We use the “machines” provided by the {! Liquidity_baking_machine} + module. Because using the [ConcreteMachine] (hence, the {! + ValidationMachine} too) is slow, we implement the following + test-suit architecture: + + - One {v QCheck2 v}-based test is used to validate consistency of + the {! SymbolicMachine} wrt. the [ConcreteMachine], thanks to + the {! ValidationMachine}. + - The rest of the tests use the {! SymbolicMachine} in order to be + more effective. *) + +(** [all_true l] waits for all promises of [l], and returns [true] iff + they all resolve to [true]. *) +let all_true = List.for_all_ep Fun.id + +let extract_qcheck_tzresult : unit tzresult Lwt.t -> bool = + fun p -> + match Lwt_main.run p with + | Ok () -> true + | Error err -> QCheck2.Test.fail_reportf "@\n%a@." pp_print_trace err + +let rec run_and_check check scenarios env state = + match scenarios with + | step :: rst -> + let state' = SymbolicMachine.step step env state in + assert (check state state') ; + run_and_check check rst env state' + | [] -> state + +let one_balance_decreases c env state state' = + let xtz = SymbolicMachine.get_xtz_balance c state in + let tzbtc = SymbolicMachine.get_tzbtc_balance c env state in + let lqt = SymbolicMachine.get_liquidity_balance c env state in + let xtz' = SymbolicMachine.get_xtz_balance c state' in + let tzbtc' = SymbolicMachine.get_tzbtc_balance c env state' in + let lqt' = SymbolicMachine.get_liquidity_balance c env state' in + xtz' < xtz || tzbtc' < tzbtc || lqt' < lqt + || (xtz' = xtz && tzbtc' = tzbtc && lqt' = lqt) + +let get_float_balances env state = + let xtz = + Int64.to_float @@ SymbolicMachine.get_xtz_balance env.cpmm_contract state + in + let tzbtc = + Int.to_float + @@ SymbolicMachine.get_tzbtc_balance env.cpmm_contract env state + in + let lqt = + Int.to_float @@ SymbolicMachine.get_cpmm_total_liquidity env state + in + (xtz, tzbtc, lqt) + +(** [is_remove_liquidity_consistent env state state'] returns [true] + iff, when the liquidity pool decreased in [state'], then the + fraction of tzbtc and xtz returned to the liquidity provider is + lesser or equal than the fraction of lqt burnt. *) +let is_remove_liquidity_consistent env state state' = + let xtz, tzbtc, lqt = get_float_balances env state in + let xtz', tzbtc', lqt' = get_float_balances env state' in + if lqt' < lqt then + let flqt = (lqt -. lqt') /. lqt in + let fxtz = (xtz -. xtz') /. xtz in + let ftzbtc = (tzbtc -. tzbtc') /. tzbtc in + fxtz <= flqt && ftzbtc <= flqt + else true + +(** [is_share_price_increasing env state state'] returns [true] iff + the product of supplies (tzbtc, and xtz) increases. + + See https://blog.nomadic-labs.com/progress-report-on-the-verification-of-liquidity-baking-smart-contracts.html#evolution-of-the-product-of-supplies *) +let is_share_price_increasing env state state' = + let xtz, tzbtc, lqt = get_float_balances env state in + let xtz', tzbtc', lqt' = get_float_balances env state' in + xtz *. tzbtc /. (lqt *. lqt) <= xtz' *. tzbtc' /. (lqt' *. lqt') + +(** [positive_pools env state] returns [true] iff the three pools of + the CPMM (as identified in [env]) are strictly positive in + [state]. *) +let positive_pools env state = + let xtz = SymbolicMachine.get_xtz_balance env.cpmm_contract state in + let tzbtc = SymbolicMachine.get_tzbtc_balance env.cpmm_contract env state in + let lqt = SymbolicMachine.get_cpmm_total_liquidity env state in + 0L < xtz && 0 < tzbtc && 0 < lqt + +(** [validate_xtz_balance c env (blk, state)] returns [true] iff the + tez balance for the contract [c] is the same in [blk] and in + [state]. *) +let validate_xtz_balance : + Contract.t -> ValidationMachine.t -> bool tzresult Lwt.t = + fun contract state -> + let open Lwt_result_syntax in + let* expected = ValidationMachine.Symbolic.get_xtz_balance contract state in + let* amount = ValidationMachine.Concrete.get_xtz_balance contract state in + return (amount = expected) + +(** [validate_tzbtc_balance c env (blk, state)] returns [true] iff the + tzbtc balance for the contract [c] is the same in [blk] and in + [state]. *) +let validate_tzbtc_balance : + Contract.t -> Contract.t env -> ValidationMachine.t -> bool tzresult Lwt.t = + fun contract env state -> + let open Lwt_result_syntax in + let* expected = + ValidationMachine.Symbolic.get_tzbtc_balance contract env state + in + let* amount = + ValidationMachine.Concrete.get_tzbtc_balance contract env state + in + return (expected = amount) + +(** [validate_liquidity_balance c env (blk, state)] returns [true] if + the contract [c] holds the same amount of liquidity in [blk] and + [state]. *) +let validate_liquidity_balance : + Contract.t -> Contract.t env -> ValidationMachine.t -> bool tzresult Lwt.t = + fun contract env state -> + let open Lwt_result_syntax in + let* expected = + ValidationMachine.Symbolic.get_liquidity_balance contract env state + in + let* amount = + ValidationMachine.Concrete.get_liquidity_balance contract env state + in + return (expected = amount) + +(** [validate_balances c env (blk, state)] returns true iff the + contract [c] holds the same amount of tez, tzbtc and liquidity in + [blk] and [state]. *) +let validate_balances : + Contract.t -> Contract.t env -> ValidationMachine.t -> bool tzresult Lwt.t = + fun contract env combined_state -> + all_true + [ + validate_xtz_balance contract combined_state; + validate_tzbtc_balance contract env combined_state; + validate_liquidity_balance contract env combined_state; + ] + +(** [validate_cpmm_total_liquidity env state] returns true iff the + CPMM has distributed the same amount of liquidity tokens in its + concrete and symbolic parts of [state]. *) +let validate_cpmm_total_liquidity env state = + let open Lwt_result_syntax in + let* concrete_cpmm_total_liquidity = + ValidationMachine.Concrete.get_cpmm_total_liquidity env state + in + let* ghost_cpmm_total_liquidity = + ValidationMachine.Symbolic.get_cpmm_total_liquidity env state + in + return (concrete_cpmm_total_liquidity = ghost_cpmm_total_liquidity) + +(** [validate_consistency env (blk, state)] checks if the accounts in + [env] (the CPMM and the implicit accounts) share the same balances + in [blk] and [state]. *) +let validate_consistency : + Contract.t env -> ValidationMachine.t -> bool tzresult Lwt.t = + (* We do not try to validate the xtz balance of [holder] in this + function. Indeed, they are hard to predict due to allocation + fees, and security deposits. *) + fun env state -> + all_true + (validate_cpmm_total_liquidity env state + :: validate_balances env.cpmm_contract env state + :: List.map + (fun account -> validate_balances account env state) + env.implicit_accounts) + +(** [validate_storage env blk] returns [true] iff the storage of the + CPMM contract is consistent wrt. to its actual balances (tez, + tzbtc, and liquidity). *) +let validate_storage : + Contract.t env -> ConcreteMachine.t -> bool tzresult Lwt.t = + fun env blk -> + let open Lwt_result_syntax in + let* cpmm_storage = + Cpmm_repr.Storage.get (B blk) ~contract:env.cpmm_contract + in + all_true + [ + (* 1. Check the CPMM's [xtzPool] is equal to the actual CPMM balance *) + (let* cpmm_xtz = ConcreteMachine.get_xtz_balance env.cpmm_contract blk in + return (cpmm_xtz = Tez.to_mutez cpmm_storage.xtzPool)); + (* 2. Check the CPMM’s [lqtTotal] is correct wrt. liquidity contract *) + (let* liquidity_storage = + Lqt_fa12_repr.Storage.get (B blk) ~contract:env.liquidity_contract + in + return (cpmm_storage.lqtTotal = liquidity_storage.totalSupply)); + (* 3. Check the CPMM’s [tokenPool] is correct *) + (let* cpmm_tzbtc = + ConcreteMachine.get_tzbtc_balance env.cpmm_contract env blk + in + return (Z.to_int cpmm_storage.tokenPool = cpmm_tzbtc)); + ] + +(** [machine_validation_tests] is a list of asynchronous tests aiming + at asserting the correctness and consistencies of the machines + themselves. *) +let machine_validation_tests = + let open Lwt_result_syntax in + [ + QCheck2.Test.make + ~count:10 + ~name:"Concrete/Symbolic Consistency" + ~print:Liquidity_baking_generator.print_scenario + (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 10) + (fun (specs, scenario) -> + extract_qcheck_tzresult + (let invariant = validate_consistency in + let* state, env = ValidationMachine.build ~invariant specs in + let* (_ : ValidationMachine.t) = + ValidationMachine.run ~invariant scenario env state + in + return_unit)); + QCheck2.Test.make + ~count:10 + ~name:"Storage consistency" + ~print:Liquidity_baking_generator.print_scenario + (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 10) + (fun (specs, scenario) -> + extract_qcheck_tzresult + (let invariant = validate_storage in + let* state, env = ConcreteMachine.build ~invariant specs in + let* (_ : Block.t) = + ConcreteMachine.run ~invariant scenario env state + in + return_unit)); + QCheck2.Test.make + ~count:50_000 + ~name:"Positive pools" + ~print:Liquidity_baking_generator.print_scenario + (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 50) + (fun (specs, scenario) -> + extract_qcheck_tzresult + (let invariant = positive_pools in + let state, env = SymbolicMachine.build ~invariant specs in + let (_ : SymbolicMachine.t) = + SymbolicMachine.run ~invariant scenario env state + in + return_unit)); + ] + +(** [economic_tests] is a list of asynchronous tests aiming at + asserting the good economic properties of the Liquidity Baking + feature. *) +let economic_tests = + [ + QCheck2.Test.make + ~count:50_000 + ~name:"No global gain" + ~print:Liquidity_baking_generator.print_adversary_scenario + (Liquidity_baking_generator.gen_adversary_scenario 1_000_000 1_000_000 50) + (fun (specs, attacker, scenario) -> + let state, env = SymbolicMachine.build ~subsidy:0L specs in + let (_ : SymbolicMachine.t) = + run_and_check (one_balance_decreases attacker env) scenario env state + in + true); + QCheck2.Test.make + ~count:50_000 + ~name:"Remove liquidities is consistent" + ~print:Liquidity_baking_generator.print_scenario + (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 50) + (fun (specs, scenario) -> + let state, env = SymbolicMachine.build ~subsidy:0L specs in + let (_ : SymbolicMachine.t) = + run_and_check (is_remove_liquidity_consistent env) scenario env state + in + true); + QCheck2.Test.make + ~count:50_000 + ~name:"Share price only increases" + ~print:Liquidity_baking_generator.print_scenario + (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 50) + (fun (specs, scenario) -> + let state, env = SymbolicMachine.build ~subsidy:0L specs in + let (_ : SymbolicMachine.t) = + run_and_check (is_share_price_increasing env) scenario env state + in + true); + ] + +let () = + let open Lib_test.Qcheck2_helpers in + Alcotest.run + "protocol > pbt > liquidity baking" + [ + ("Machines Cross-Validation", qcheck_wrap machine_validation_tests); + ("Economic Properties", qcheck_wrap economic_tests); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml new file mode 100644 index 000000000000..4a7fd692473c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -0,0 +1,201 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.exe + Subject: Operations in Saturation_repr +*) + +open Protocol.Saturation_repr +open Lib_test.Qcheck2_helpers + +(** A generator that returns a [t] that cannot be [saturated] *) +let unsatured_gen = of_option_gen @@ QCheck2.Gen.(map of_int_opt int) + +(** The general generator for [t]: generates both unsaturated values + and [saturated]. *) +let t_gen : may_saturate t QCheck2.Gen.t = + QCheck2.Gen.(frequency [(1, return saturated); (4, unsatured_gen)]) + +(* Test. + * Tests that [add] commutes. + *) +let test_add_commutes = + QCheck2.Test.make + ~name:"t1 + t2 = t2 + t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let t1_plus_t2 = add t1 t2 in + let t2_plus_t1 = add t2 t1 in + qcheck_eq ~pp t1_plus_t2 t2_plus_t1) + +(* Test. + * Tests that [mul] commutes. + *) +let test_mul_commutes = + QCheck2.Test.make + ~name:"t1 * t2 = t2 * t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let t1_times_t2 = mul t1 t2 in + let t2_times_t1 = mul t2 t1 in + qcheck_eq ~pp t1_times_t2 t2_times_t1) + +(* Test. + * Tests that [zero] is neutral for [add]. + *) +let test_add_zero = + QCheck2.Test.make ~name:"t + 0 = t" t_gen (fun t -> + let t_plus_zero = add t zero in + qcheck_eq' ~pp ~expected:t ~actual:t_plus_zero ()) + +(* Test. + * Tests that t1 + t2 >= t1 + *) +let test_add_neq = + QCheck2.Test.make + ~name:"t1 + t2 >= t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let t1_plus_t2 = add t1 t2 in + t1_plus_t2 >= t1) + +(* Test. + * Tests that 1 is neutral for [mul]. + *) +let test_mul_one = + let one = safe_int 1 in + QCheck2.Test.make ~name:"t * 1 = t" t_gen (fun t -> + let t_times_one = mul t one in + qcheck_eq' ~pp ~expected:t ~actual:t_times_one ()) + +(* Test. + * Tests that [t] times [0] equals [0]. + *) +let test_mul_zero = + QCheck2.Test.make ~name:"t * 0 = 0" t_gen (fun t -> + let t_times_zero = mul t zero in + qcheck_eq' ~pp ~expected:zero ~actual:t_times_zero ()) + +(* Test. + * Tests that [t] [sub] [zero] equals [t]. + *) +let test_sub_zero = + QCheck2.Test.make ~name:"t - 0 = t" t_gen (fun t -> + let t_sub_zero = sub t zero in + qcheck_eq' ~pp ~expected:t ~actual:t_sub_zero ()) + +(* Test. + * Tests that [t] [sub] [t] equals [zero]. + *) +let test_sub_itself = + QCheck2.Test.make ~name:"t - t = 0" t_gen (fun t -> + let t_sub_t = sub t t in + qcheck_eq' ~pp ~expected:zero ~actual:t_sub_t ()) + +(* Test. + * Tests that t1 - t2 <= t1 + *) +let test_sub_neq = + QCheck2.Test.make + ~name:"t1 - t2 <= t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let t1_minus_t2 = sub t1 t2 in + t1_minus_t2 <= t1) + +(* Test. + * Tests that (t1 + t2) - t2 <= t1 + *) +let test_add_sub = + QCheck2.Test.make + ~name:"(t1 + t2) - t2 <= t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let lhs = sub (add t1 t2) t2 in + lhs <= t1) + +(* Test. + * Tests that (t1 - t2) + t2 >= t1 + *) +let test_sub_add = + QCheck2.Test.make + ~name:"(t1 - t2) + t2 >= t1" + (QCheck2.Gen.pair t_gen t_gen) + (fun (t1, t2) -> + let lhs = add (sub t1 t2) t2 in + lhs >= t1) + +(* Test. + * Tests that [saturated] >= t + *) +let test_leq_saturated = + QCheck2.Test.make ~name:"t <= saturated" t_gen (fun t -> saturated >= t) + +(* Test. + * Tests that [zero] <= t + *) +let test_geq_zero = QCheck2.Test.make ~name:"t >= 0" t_gen (fun t -> zero <= t) + +(* Test. + * Tests that [sqrt (t * t) = t] + *) +let test_squared_sqrt = + QCheck2.Test.make ~name:"sqrt t² = t" t_gen (fun t -> + mul t t = saturated || sqrt (mul t t) = t) + +(* Test. + * Tests that [(sqrt t) * (sqrt t) <= t] + *) +let test_sqrt_squared = + QCheck2.Test.make ~name:"(sqrt t)² <= t <= (succ (sqrt t))²" t_gen (fun t -> + mul (sqrt t) (sqrt t) <= t && t <= mul (succ (sqrt t)) (succ (sqrt t))) + +let tests_add = [test_add_commutes; test_add_zero; test_add_neq] + +let tests_mul = [test_mul_commutes; test_mul_one; test_mul_zero] + +let tests_sub = [test_sub_zero; test_sub_itself; test_sub_neq] + +let tests_add_sub = [test_add_sub; test_sub_add] + +let tests_boundaries = [test_leq_saturated; test_geq_zero] + +let tests_sqrt = [test_sqrt_squared; test_squared_sqrt] + +let () = + Alcotest.run + "protocol > pbt > saturation" + [ + ("add", qcheck_wrap tests_add); + ("mul", qcheck_wrap tests_mul); + ("sub", qcheck_wrap tests_sub); + ("add and sub", qcheck_wrap tests_add_sub); + ("sqrt", qcheck_wrap tests_sqrt); + ("<= and >=", qcheck_wrap tests_boundaries); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml new file mode 100644 index 000000000000..68f3d776ad52 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/test_bitset.exe + Subject: Bitset structure +*) + +open Lib_test.Qcheck2_helpers +open Protocol.Bitset + +let gen_ofs = QCheck2.Gen.int_bound (64 * 10) + +let value_of res = + match res with + | Ok v -> v + | Error e -> + Alcotest.failf + "An unxpected error %a occurred when generating Bitset.t" + Environment.Error_monad.pp_trace + e + +let gen_storage = + let open QCheck2.Gen in + let* int_vector = list @@ int_bound 64 in + from_list int_vector |> value_of |> return + +let test_get_set (c, ofs) = + List.for_all + (fun ofs' -> + let open Result_syntax in + value_of + @@ let* c' = add c ofs in + let* v = mem c ofs' in + let* v' = mem c' ofs' in + return (if ofs = ofs' then v' = true else v = v')) + (0 -- 63) + +let test_inter (c1, c2) = + let c3 = inter c1 c2 in + List.for_all + (fun ofs -> + let open Result_syntax in + value_of + @@ let* v1 = mem c1 ofs in + let* v2 = mem c2 ofs in + let* v3 = mem c3 ofs in + return ((v1 && v2) = v3)) + (0 -- 63) + +let test_diff (c1, c2) = + let c3 = diff c1 c2 in + List.for_all + (fun ofs -> + let open Result_syntax in + value_of + @@ let* v1 = mem c1 ofs in + let* v2 = mem c2 ofs in + let* v3 = mem c3 ofs in + return ((v1 && not v2) = v3)) + (0 -- 63) + +let test_fill = + let two = Z.of_int 2 in + fun length -> + let f1 = fill ~length |> value_of |> Internal_for_tests.to_z in + let f2 = + from_list (0 -- (length - 1)) |> value_of |> Internal_for_tests.to_z + in + let f3 = Z.(pow two length |> pred) in + Z.equal f1 f2 && Z.equal f2 f3 + +let () = + Alcotest.run + "bits" + [ + ( "quantity", + qcheck_wrap + [ + QCheck2.Test.make + ~count:10000 + ~name:"get set" + QCheck2.Gen.(pair gen_storage gen_ofs) + test_get_set; + QCheck2.Test.make + ~count:10000 + ~name:"inter" + QCheck2.Gen.(pair gen_storage gen_storage) + test_inter; + QCheck2.Test.make + ~count:10000 + ~name:"diff" + QCheck2.Gen.(pair gen_storage gen_storage) + test_diff; + QCheck2.Test.make + ~count:10000 + ~name:"fill" + QCheck2.Gen.(small_nat) + test_fill; + ] ); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml new file mode 100644 index 000000000000..217ca544dee0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml @@ -0,0 +1,212 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 DaiLambda, Inc. <contact@dailambda.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: pbt for bytes <=> nat/int conversions + Invocation: [QCHECK_SEED=<seed>] dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.exe + Subject: Test the conversions between bytes and int/nat +*) + +let failwith = Stdlib.failwith + +open Protocol +open Script_int +open Script_bytes + +let gen_n = + let open QCheck2.Gen in + let* n1 = int in + let+ n2 = int in + Z.(abs (of_int n1 * of_int n2)) + +let gen_z = + let open QCheck2.Gen in + let* n1 = int in + let+ n2 = int in + Z.(of_int n1 * of_int n2) + +let gen_bytes = + let open QCheck2.Gen in + bytes_size small_nat + +let test_bytes_nat_conversion_unit () = + let test z h = + (* nat => bytes *) + let (`Hex h') = Hex.of_bytes (bytes_of_nat_be (abs (of_zint z))) in + if h <> h' then + failwith (Format.asprintf "%a => %s <> %s" Z.pp_print z h' h) ; + (* bytes => nat *) + let z' = to_zint @@ nat_of_bytes_be (Hex.to_bytes_exn (`Hex h)) in + if Z.Compare.(z <> z') then + failwith (Format.asprintf "%a <> %a <= %s" Z.pp_print z Z.pp_print z' h) ; + (* "00" ^ bytes => nat *) + let h'' = "00" ^ h in + let z'' = to_zint @@ nat_of_bytes_be (Hex.to_bytes_exn (`Hex h'')) in + if Z.Compare.(z <> z'') then + failwith (Format.asprintf "%a <> %a <= %s" Z.pp_print z Z.pp_print z' h) + in + let test' h = test (Z.of_string ("0x" ^ h)) h in + test (Z.of_int 0) "" ; + test' "123456" ; + test' "010000000000000000" + +(* Tests of nat => bytes *) +let test_bytes_of_nat_random () = + let gen = + let open QCheck2.Gen in + let* n = gen_n in + let+ leading_bytes = small_nat in + (n, leading_bytes) + in + QCheck_alcotest.to_alcotest + @@ QCheck2.Test.make ~name:"bytes_of_nat" gen + @@ fun (n, leading_zeros) -> + let bytes = bytes_of_nat_be @@ abs (of_zint n) in + (* [bytes_of_nat] encodes any [nat] to the shortest representation in [bytes], + without leading zeros. *) + if Bytes.length bytes > 0 then assert (Bytes.get bytes 0 <> '\000') ; + (* [nat_of_bytes @@ bytes_of_nat n = n] *) + Z.Compare.(to_zint (nat_of_bytes_be bytes) = n) + (* Leading zero chars do not affect the decoding *) + && + let leading_zeros = Bytes.make leading_zeros '\000' in + Z.Compare.(to_zint (nat_of_bytes_be (Bytes.cat leading_zeros bytes)) = n) + +(* Tests of bytes => nat *) +let test_nat_of_bytes_random () = + QCheck_alcotest.to_alcotest + @@ QCheck2.Test.make ~name:"nat_of_bytes" gen_bytes + @@ fun b -> + (* [nat_of_bytes] decodes any [bytes] to a [nat] *) + let n = nat_of_bytes_be b in + (* [bytes_of_nat] encodes the [nat] back to the original [bytes] + but without its leading zeros. + *) + Z.Compare.(to_zint n >= Z.zero) + && + let b' = bytes_of_nat_be n in + let diff = Bytes.length b - Bytes.length b' in + let leading_zeros = Bytes.make diff '\000' in + b = Bytes.cat leading_zeros b' + +let test_bytes_int_conversion_unit () = + let test z h = + let z = Z.of_string z in + (* int => bytes *) + let (`Hex h') = Hex.of_bytes (bytes_of_int_be (of_zint z)) in + if h <> h' then + failwith (Format.asprintf "%a => %s <> %s" Z.pp_print z h' h) ; + (* bytes => int *) + let z' = to_zint @@ int_of_bytes_be (Hex.to_bytes_exn (`Hex h)) in + if Z.Compare.(z <> z') then + failwith (Format.asprintf "%a <> %a <= %s" Z.pp_print z Z.pp_print z' h) ; + (* ("00"|"ff") ^ bytes => int + Adding 00 or ff prefixes (00 for positive and ff for negative ints) + must not change the decoding. *) + let h'' = if Z.Compare.(z < Z.zero) then "ff" ^ h else "00" ^ h in + let z'' = to_zint @@ int_of_bytes_be (Hex.to_bytes_exn (`Hex h'')) in + if Z.Compare.(z <> z'') then + failwith (Format.asprintf "%a <> %a <= %s" Z.pp_print z Z.pp_print z' h) + in + test "0" "" ; + test "1" "01" ; + test "-1" "ff" ; + test "127" "7f" ; + test "-128" "80" ; + test "128" "0080" ; + test "-129" "ff7f" ; + test "0x8000" "008000" ; + test "-33024" "ff7f00" ; + test "0x010000000000000000" "010000000000000000" ; + test "-0x010000000000000000" "ff0000000000000000" ; + test "0xcd9e7dbee9425ffc" "00cd9e7dbee9425ffc" (* once failed due to a bug *) + +(* Tests of int => bytes *) +let test_bytes_of_int_random () = + let gen = + let open QCheck2.Gen in + let* z = gen_z in + let+ leading_bytes = small_nat in + (z, leading_bytes) + in + QCheck_alcotest.to_alcotest + @@ QCheck2.Test.make ~name:"bytes_of_int" gen + @@ fun (z, leading_bytes) -> + (* [bytes_of_int] must encode any [int] to [bytes]. *) + let bytes = bytes_of_int_be @@ of_zint z in + (* [bytes_of_int] must return the shortest encoding: at most 1 char of zero + or '\255's at the head. *) + (if Bytes.length bytes >= 2 then + match (Bytes.get bytes 0, Bytes.get bytes 1) with + | '\000', '\000' | '\255', '\255' -> assert false + | _ -> ()) ; + (* [int_of_bytes @@ bytes_of_int z = z] *) + (let z' = to_zint @@ int_of_bytes_be bytes in + Z.Compare.(z = z')) + (* [int_of_bytes] must ignore the leading zeros for 0 and positive ints + and '\255's for negatives *) + && + let leading_bytes = + Bytes.make leading_bytes (if Z.Compare.(z < Z.zero) then '\255' else '\000') + in + Z.Compare.(to_zint @@ int_of_bytes_be (Bytes.cat leading_bytes bytes) = z) + +(* Tests of bytes => int *) +let test_int_of_bytes_random () = + QCheck_alcotest.to_alcotest + @@ QCheck2.Test.make ~name:"int_of_bytes" gen_bytes + @@ fun b -> + (* [int_of_bytes] decodes any [bytes] to a [int] *) + let i = int_of_bytes_be b in + (* [bytes_of_int] must encode the [int] back to the original [bytes] + but without its leading zeros for 0 and positive [int]s and '\255' + for negatives. *) + let b' = bytes_of_int_be i in + let diff = Bytes.length b - Bytes.length b' in + let leading_bytes = + Bytes.make diff (if Z.Compare.(to_zint i < Z.zero) then '\255' else '\000') + in + b = Bytes.cat leading_bytes b' + +let tests = + [ + ( "bytes_nat_conv", + [ + ("unit", `Quick, test_bytes_nat_conversion_unit); + test_bytes_of_nat_random (); + test_nat_of_bytes_random (); + ] ); + ( "bytes_int_conv", + [ + ("unit", `Quick, test_bytes_int_conversion_unit); + test_bytes_of_int_random (); + test_int_of_bytes_random (); + ] ); + ] + +let () = + Alcotest.run "protocol > script_bytes > bytes and int/nat conversion " tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml new file mode 100644 index 000000000000..6e6e7f756f72 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml @@ -0,0 +1,554 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.exe + Subject: Operations in Carbonated_map +*) + +open Lib_test.Qcheck2_helpers +open QCheck2 +open Protocol + +let wrap m = + let open Lwt_syntax in + let+ v = m in + Environment.wrap_tzresult v + +let new_ctxt () = + let open Lwt_result_syntax in + let* block, _contract = Context.init1 () in + let* incr = Incremental.begin_construction block in + return @@ Incremental.alpha_ctxt incr + +module Compare_int = struct + type t = int + + let compare = Int.compare + + let compare_cost _ = Saturation_repr.safe_int 10 +end + +module CM = + Carbonated_map.Make + (struct + type context = Alpha_context.context + + let consume = Alpha_context.Gas.consume + end) + (Compare_int) + +let unsafe_new_context () = + Result.value_f + ~default:(fun () -> Stdlib.failwith "Failed to create context") + (Lwt_main.run @@ new_ctxt ()) + +let int_map_gen = + let ctxt = unsafe_new_context () in + Gen.small_list (Gen.pair Gen.small_int Gen.small_int) + |> Gen.map (fun kvs -> + let merge_overlap ctxt x y = Ok (x + y, ctxt) in + match CM.of_list ctxt ~merge_overlap kvs with + | Ok (map, _) -> map + | Error _ -> Stdlib.failwith "Failed to construct map") + +let pp_int_map fmt map = + let pp = + Assert.pp_print_list (fun fmt (k, v) -> Format.fprintf fmt "(%d, %d)" k v) + in + Lwt_main.run + (let open Lwt_result_syntax in + let* ctxt = new_ctxt () in + let* kvs, _ = wrap @@ Lwt.return @@ CM.to_list ctxt map in + return kvs) + |> Result.value_f ~default:(fun () -> assert false) + |> Format.fprintf fmt "%a" pp + +let int_map_test name f = + Test.make + ~print:(Format.asprintf "%a" pp_int_map) + ~count:100 + ~name + int_map_gen + (fun map -> match f map with Ok b -> b | Error _ -> false) + +let int_map_pair_test name f = + Test.make + ~print:(fun (map1, map2) -> + Format.asprintf "(%a, %a)" pp_int_map map1 pp_int_map map2) + ~count:100 + ~name + (Gen.pair int_map_gen int_map_gen) + (fun (map1, map2) -> match f map1 map2 with Ok b -> b | Error _ -> false) + +let unit_test name f = + Alcotest.test_case name `Quick (fun () -> + match f () with Ok b -> assert b | _ -> assert false) + +type Environment.Error_monad.error += Dummy_error + +let dummy_fail = + Result.error (Environment.Error_monad.trace_of_error Dummy_error) + +let assert_map_contains ctxt map expected = + let open Result_syntax in + let* kvs, _ctxt = CM.to_list ctxt map in + Ok (List.sort compare kvs = List.sort compare expected) + +let assert_equal_map ctxt map expected = + let open Result_syntax in + let* kvs, ctxt = CM.to_list ctxt expected in + assert_map_contains ctxt map kvs + +(** Test that the size of an empty map is 0. *) +let test_empty = + unit_test "Size of empty map is 0" (fun () -> Ok (CM.size CM.empty = 0)) + +(** Test adding a new element *) +let test_update_add = + let open Result_syntax in + unit_test "Update add" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, 1); (2, 2); (3, 3)] + in + let update_replace ctxt key value map = + CM.update ctxt key (fun ctxt _ -> Ok (Some value, ctxt)) map + in + let* map, ctxt = update_replace ctxt 4 4 map in + assert_map_contains ctxt map [(1, 1); (2, 2); (3, 3); (4, 4)] + +(** Test replacing an existing element. *) +let test_update_replace = + let open Result_syntax in + unit_test "Update replace" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, 1); (2, 2); (3, 3)] + in + let update_replace ctxt key value map = + CM.update ctxt key (fun ctxt _ -> Ok (Some value, ctxt)) map + in + let* map, ctxt = update_replace ctxt 1 42 map in + assert_map_contains ctxt map [(1, 42); (2, 2); (3, 3)] + +(** Test merging when ignoring new overlapping keys. *) +let test_merge_overlaps_left = + let open Result_syntax in + unit_test "Merge overlap keep existing" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun ctxt left _ -> Ok (left, ctxt)) + [(1, 1); (2, 2); (3, 3); (1, 11); (2, 22); (3, 33); (4, 44)] + in + assert_map_contains ctxt map [(1, 1); (2, 2); (3, 3); (4, 44)] + +(** Test merging when replacing the element of a new overlapping key. *) +let test_merge_overlaps_right = + let open Result_syntax in + unit_test "Merge overlap replace" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun ctxt _ right -> Ok (right, ctxt)) + [(1, 1); (2, 2); (3, 3); (1, 11); (2, 22); (3, 33); (4, 44)] + in + assert_map_contains ctxt map [(1, 11); (2, 22); (3, 33); (4, 44)] + +(** Test merging when combining elements of overlapping keys. *) +let test_merge_overlaps_add = + let open Result_syntax in + unit_test "Merge overlap by adding" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun ctxt left right -> Ok (left + right, ctxt)) + [(1, 1); (2, 2); (3, 3); (1, 1); (2, 2); (3, 3); (4, 4)] + in + assert_map_contains ctxt map [(1, 2); (2, 4); (3, 6); (4, 4)] + +(** Test update with merging elements of new and existing keys by adding them. *) +let test_update_merge = + let open Result_syntax in + unit_test "Update with merge add" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, 1); (2, 2); (3, 3)] + in + let update_merge ctxt key new_value map = + CM.update + ctxt + key + (fun ctxt existing -> + match existing with + | None -> Ok (Some new_value, ctxt) + | Some old_value -> Ok (Some (new_value + old_value), ctxt)) + map + in + let* map, ctxt = update_merge ctxt 1 1 map in + let* map, ctxt = update_merge ctxt 4 4 map in + assert_map_contains ctxt map [(1, 2); (2, 2); (3, 3); (4, 4)] + +(** Test merging two maps when keeping the original value for overlapping keys. *) +let test_merge_map_keep_existing = + let open Result_syntax in + unit_test "Merge overlap keep existing" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map1, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, "a"); (2, "b"); (3, "c")] + in + let* map2, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(2, "b'"); (3, "c'"); (4, "d'")] + in + let* map, ctxt = + CM.merge ctxt ~merge_overlap:(fun ctxt left _ -> Ok (left, ctxt)) map1 map2 + in + assert_map_contains ctxt map [(1, "a"); (2, "b"); (3, "c"); (4, "d'")] + +(** Test merging two maps when replacing the value for overlapping keys. *) +let test_merge_map_replace_existing = + let open Result_syntax in + unit_test "Merge overlap replace existing" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map1, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, "a"); (2, "b"); (3, "c")] + in + let* map2, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(2, "b'"); (3, "c'"); (4, "d'")] + in + let* map, ctxt = + CM.merge + ctxt + ~merge_overlap:(fun ctxt _ right -> Ok (right, ctxt)) + map1 + map2 + in + assert_map_contains ctxt map [(1, "a"); (2, "b'"); (3, "c'"); (4, "d'")] + +(** Test deleting existing and non-existing keys. *) +let test_update_delete = + let open Result_syntax in + unit_test "Update delete" @@ fun () -> + let ctxt = unsafe_new_context () in + let* map, ctxt = + CM.of_list + ctxt + ~merge_overlap:(fun _ _ _ -> dummy_fail) + [(1, 1); (2, 2); (3, 3)] + in + let delete ctxt key map = + CM.update ctxt key (fun ctxt _ -> Ok (None, ctxt)) map + in + let* map, ctxt = delete ctxt 1 map in + let* map, ctxt = delete ctxt 4 map in + assert_map_contains ctxt map [(2, 2); (3, 3)] + +(** Test that merging [empty] with a map returns the same map. *) +let test_empty_left_identity_for_merge = + let open Result_syntax in + int_map_test "Empty map is left identity for merge" @@ fun map -> + let ctxt = unsafe_new_context () in + let* map', ctxt = + CM.merge ctxt ~merge_overlap:(fun _ _ _ -> dummy_fail) map CM.empty + in + assert_equal_map ctxt map map' + +(** Test that merging a map with [empty] returns the same map. *) +let test_empty_right_identity_for_merge = + let open Result_syntax in + int_map_test "Empty map is right identity for merge" @@ fun map -> + let ctxt = unsafe_new_context () in + let* map', ctxt = + CM.merge ctxt ~merge_overlap:(fun _ _ _ -> dummy_fail) CM.empty map + in + assert_equal_map ctxt map map' + +(** Test that [size] returns the number of key value pairs of a map. *) +let test_size = + let open Result_syntax in + int_map_test "Size returns the number of elements" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, _ = CM.to_list ctxt map in + Result.ok Compare.List_length_with.(kvs = CM.size map) + +(** Test that all keys of a map are found. *) +let test_find_existing = + let open Result_syntax in + int_map_test "Find all elements" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, _ = CM.to_list ctxt map in + let* (_ : CM.context) = + List.fold_left_e + (fun ctxt (k, v) -> + let* v_opt, ctxt = CM.find ctxt k map in + match v_opt with Some v' when v = v' -> Ok ctxt | _ -> dummy_fail) + ctxt + kvs + in + Ok true + +(** Test that find returns [None] for non-existing keys. *) +let test_find_non_existing = + let open Result_syntax in + int_map_test "Should not find non-existing" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, _ = CM.to_list ctxt map in + let key = 42 in + let* v_opt, _ = CM.find ctxt key map in + match List.find_opt (fun (k, _) -> k = key) kvs with + | Some (_, value) -> Ok (Some value = v_opt) + | None -> Ok (None = v_opt) + +(** Test that [to_list] followed by [of_list] returns the same map. *) +let test_to_list_of_list = + let open Result_syntax in + int_map_test "To-list/of-list roundtrip" @@ fun map -> + let ctxt = unsafe_new_context () in + let merge_overlap ctxt x y = Ok (x + y, ctxt) in + let* kvs, ctxt = CM.to_list ctxt map in + let* map', ctxt = CM.of_list ctxt ~merge_overlap kvs in + assert_equal_map ctxt map map' + +(** Test that merging two maps is equivalent to merging the concatenated + key-value lists of both maps. *) +let test_merge_against_list = + let open Result_syntax in + int_map_pair_test "Merge compared with list operation" @@ fun map1 map2 -> + let ctxt = unsafe_new_context () in + let merge_overlap ctxt x y = Ok (x + y, ctxt) in + let* kvs1, ctxt = CM.to_list ctxt map1 in + let* kvs2, ctxt = CM.to_list ctxt map2 in + let* map_merged1, ctxt = CM.merge ctxt ~merge_overlap map1 map2 in + let* map_merged2, ctxt = CM.of_list ~merge_overlap ctxt (kvs1 @ kvs2) in + assert_equal_map ctxt map_merged1 map_merged2 + +(** Test that merging a map with itself does not alter its size. *) +let test_size_merge_self = + let open Result_syntax in + int_map_test "Size should not change when map is merging with itself" + @@ fun map -> + let ctxt = unsafe_new_context () in + let size1 = CM.size map in + let* map2, _ = + CM.merge + ctxt + ~merge_overlap:(fun ctxt left right -> Ok (left + right, ctxt)) + map + map + in + let size2 = CM.size map2 in + Ok (size1 = size2) + +(** Test that merging with a failing merge operation yields an error. *) +let test_merge_fail = + int_map_test "Merging with failing merge-overlap" @@ fun map -> + let ctxt = unsafe_new_context () in + Result.ok + (match CM.merge ctxt ~merge_overlap:(fun _ _ _ -> dummy_fail) map map with + | Ok _ when CM.size map = 0 -> true + | Ok _ -> false + | Error _ -> true) + +(** Test that adding one key-value pair to a map increases its size by one iff + the key already exists. *) +let test_size_add_one = + let open Result_syntax in + int_map_test "Add a new element increases size by one" @@ fun map -> + let ctxt = unsafe_new_context () in + let key = 42 in + let* val_opt, ctxt = CM.find ctxt key map in + let* map', _ctxt = + CM.update + ctxt + key + (fun ctxt existing -> + match existing with + | None -> Ok (Some 42, ctxt) + | Some old_value -> Ok (Some old_value, ctxt)) + map + in + let size = CM.size map in + let size' = CM.size map' in + match val_opt with + | None -> Ok (size' = size + 1) + | Some _ -> Ok (size' = size) + +(** Test that mapping over a map is equivalent to mapping over the list of + key-value pairs and reconstructing the map. That is, the following diagram + commutes: + + [map] ----to_list---> [list] + | | + [map_e f] [List.map f] + | | + v v + [map] --- to_list --> [list] +*) +let test_map = + let open Result_syntax in + int_map_test "Test that map commutes with mapping over list" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, ctxt = CM.to_list ctxt map in + let* map', ctxt = CM.map_e ctxt (fun ctxt _ x -> Ok (x + 1, ctxt)) map in + let kvs' = List.map (fun (k, v) -> (k, v + 1)) kvs in + assert_map_contains ctxt map' kvs' + +(** Test that folding over an empty map does not invoke the accumulator + function. *) +let test_fold_empty = + let open Result_syntax in + unit_test "Fold empty" @@ fun () -> + let ctxt = unsafe_new_context () in + let* x, _ = CM.fold_e ctxt (fun _ctxt _acc _k _v -> dummy_fail) 0 CM.empty in + Ok (x = 0) + +(** Test that folding over a map is equivalent to folding over the corresponding + list of key-value pairs. That is, the following diagram commutes: + + [map] -- to_list --> [list] + | | + [fold_e f z] [List.fold_left f z] + | | + res <----- id -----> res +*) +let test_fold = + let open Result_syntax in + int_map_test "Test that fold commutes with folding over a list" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, ctxt = CM.to_list ctxt map in + let sum = List.fold_left (fun sum (k, v) -> k + v + sum) 0 kvs in + let* sum', _ = + CM.fold_e ctxt (fun ctxt sum k v -> Ok (k + v + sum, ctxt)) 0 map + in + Ok (sum = sum') + +(** Test that all key-value pairs can be collected by a fold. And that the + order is the same as for [to_list]. *) +let test_fold_to_list = + let open Result_syntax in + int_map_test "Test that fold collecting the elements agrees with to-list" + @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, ctxt = CM.to_list ctxt map in + let* kvs', _ = + CM.fold_e ctxt (fun ctxt kvs k v -> Ok ((k, v) :: kvs, ctxt)) [] map + in + Ok (kvs = List.rev kvs') + +(** Test that mapping with a failing function fails iff the list is non-empty. *) +let test_map_fail = + int_map_test "Test map with failing function" @@ fun map -> + let ctxt = unsafe_new_context () in + Result.ok + (match CM.map_e ctxt (fun _ctxt _key _val -> dummy_fail) map with + | Ok _ when CM.size map = 0 -> true + | Error _ -> true + | Ok _ -> false) + +(** Test that removing an existing key from a map decreases its size by one. *) +let test_size_remove_one = + let open Result_syntax in + int_map_test "Remove new element decreases size by one" @@ fun map -> + let ctxt = unsafe_new_context () in + let* kvs, ctxt = CM.to_list ctxt map in + let key = match kvs with (k, _) :: _ -> k | _ -> 42 in + let* val_opt, ctxt = CM.find ctxt key map in + let* map', _ctxt = CM.update ctxt key (fun ctxt _ -> Ok (None, ctxt)) map in + let size = CM.size map in + let size' = CM.size map' in + match val_opt with + | None -> Ok (size' = size) + | Some _ -> Ok (size' = size - 1) + +let qcheck_tests = + [ + test_size; + test_to_list_of_list; + test_empty_left_identity_for_merge; + test_empty_right_identity_for_merge; + test_size_merge_self; + test_size_add_one; + test_size_remove_one; + test_merge_against_list; + test_merge_fail; + test_find_non_existing; + test_find_existing; + test_map; + test_fold; + test_fold_to_list; + test_map_fail; + ] + +let unit_tests = + [ + test_empty; + test_update_add; + test_update_replace; + test_merge_overlaps_left; + test_merge_overlaps_right; + test_merge_overlaps_add; + test_update_merge; + test_merge_map_keep_existing; + test_merge_map_replace_existing; + test_update_delete; + test_fold_empty; + ] + +let tests ~rand = qcheck_wrap ~rand qcheck_tests @ unit_tests + +let () = + (* Ensure deterministic results. *) + let rand = Random.State.make [|0x1337533D; 71287309; 397060904|] in + Alcotest.run + "protocol > pbt > carbonated map" + [("Carbonated map", tests ~rand)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml new file mode 100644 index 000000000000..b09bc8055536 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml @@ -0,0 +1,101 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Operation compare) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.exe + Subject: Valid operations Comparison +*) + +open Protocol +open Alpha_context +open Operation_generator +open QCheck2 + +let lt = -1 + +let gt = 1 + +let eq = 0 + +let cmp_op op1 op2 res = Compare.Int.equal (Operation.compare op1 op2) res + +(** A strict order has an equality predicate that is symmetric, + reflexive and transitive and an lt (and gt) predicates that is + antisymmetric and transitive. + + Testing that Operation.compare is a strict order on + operations is then testing that it is symmetric, transitive and + reflexive, when Operation.compare x y = 0; that it is transitive + when Operation.compare x y = -1 and Operation.compare x y = -1; and + that Operation.compare x y = - (Operation.compare y x) when differ + from 0. *) +let eq_sym op1 op2 = if cmp_op op1 op2 eq then assert (cmp_op op2 op1 eq) + +let eq_refl op = assert (cmp_op op op eq) + +let eq_trans op1 op2 op3 = + if cmp_op op1 op2 eq && cmp_op op2 op3 eq then assert (cmp_op op1 op3 eq) + +let lt_antisym op1 op2 = if cmp_op op1 op2 lt then assert (cmp_op op2 op1 gt) + +let lt_trans op1 op2 op3 = + if cmp_op op1 op2 lt && cmp_op op2 op3 lt then assert (cmp_op op1 op3 lt) + +let gt_trans op1 op2 op3 = + if cmp_op op1 op2 gt && cmp_op op2 op3 gt then assert (cmp_op op1 op3 gt) + +let gt_antisym op1 op2 = if cmp_op op1 op2 gt then assert (cmp_op op2 op1 lt) + +(** Testing that Operation.compare is a strict order on operations. *) +let strorder op1 op2 op3 = + eq_sym op1 op2 ; + eq_refl op1 ; + eq_trans op1 op2 op3 ; + lt_antisym op1 op2 ; + lt_trans op1 op2 op3 ; + gt_trans op1 op2 op3 ; + gt_antisym op1 op2 + +let test_compare_is_strorder = + Test.make + ~name:"Compare operations is a strict total order" + (Gen.triple generate_operation generate_operation generate_operation) + (fun ((k1, op1), (k2, op2), (k3, op3)) -> + try + strorder op1 op2 op3 ; + true + with exn -> + Format.eprintf "%a vs. %a vs. %a@." pp_kind k1 pp_kind k2 pp_kind k3 ; + raise exn) + +let tests = [test_compare_is_strorder] + +let () = + Alcotest.run + "Compare operations" + [("Compare_operations", Lib_test.Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml new file mode 100644 index 000000000000..4f0663f7b4bb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml @@ -0,0 +1,216 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: PBT for refutation proofs of Dal + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.exe + Subject: Refutation proof-related functions of Dal +*) + +open Protocol + +module Make (Parameters : sig + val name : string + + val count : int + + val dal_parameters : Alpha_context.Constants.Parametric.dal +end) = +struct + open Dal_helpers.Make (struct + include Parameters + + let cryptobox = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Dal_helpers.mk_cryptobox Parameters.dal_parameters.cryptobox_parameters + end) + + (* Introduce some intermediate types. *) + + (** The slot is not confirmed (skipped) iff the boolean is [true]. *) + type slot_skipped = bool + + type slots = slot_skipped list + + type levels = slots list + + (** Given a list of {!levels}, where each element is of type {!slots} = {!slot} + list, and where each slot is a boolean, this function populates an + empty slots_history skip list and a corresponding history_cache as follows: + - the function starts from a given [start_level] (default is 1) + - levels are incremented by 2 (to allow having levels without confirmed slots + for test purpose). + - every element in the list of levels represents the slots of a single level. + - each slot of a given level is not confirmed iff the boolean is true. *) + let populate_slots_history (levels_data : levels) = + let open Result_syntax in + (* Make and insert a slot. *) + let add_slot level sindex (cell, cache, slots_info) skip_slot = + let index = + Option.value_f (Dal_slot_repr.Index.of_int sindex) ~default:(fun () -> + assert false) + in + let* _data, poly, slot = mk_slot ~level ~index () in + let* cell, cache = + if skip_slot then return (cell, cache) + else + Dal_slot_repr.History.add_confirmed_slot_headers cell cache [slot] + |> Environment.wrap_tzresult + in + return (cell, cache, (poly, slot, skip_slot) :: slots_info) + in + (* Insert the slots of a level. *) + let add_slots level accu slots_data = + (* We start at level one, and we skip even levels for test purpose (which + means that no DAL slot is confirmed for them). *) + let curr_level = + Int32.of_int (1 + (2 * level)) |> Raw_level_repr.of_int32_exn + in + List.fold_left_i_e (add_slot curr_level) accu slots_data + in + (* Insert the slots of all the levels. *) + let add_levels = List.fold_left_i_e add_slots in + add_levels (genesis_history, genesis_history_cache, []) levels_data + + (** This function returns the (correct) information of a page to + prove that it is confirmed, or None if the page's slot is skipped. *) + let request_confirmed_page (poly, slot, skip_slot) = + let open Result_syntax in + if skip_slot then + (* We cannot check that a page of an unconfirmed slot is confirmed. *) + return None + else + let* page_info, page_id = mk_page_info slot poly in + return @@ Some (page_info, page_id) + + (** This function returns information of a page to prove that it is + unconfirmed, if the page's slot is skipped, the information look correct + (but the slot is not confirmed). Otherwise, we increment the publish_level + field to simulate a non confirmed slot (as for even levels, no slot is + confirmed. See {!populate_slots_history}). *) + let request_unconfirmed_page (poly, slot, skip_slot) = + let open Result_syntax in + (* If the slot is unconfirmed, we test that a page belonging to it is not + confirmed. If the slot is confirmed, we check that the page of the + slot at the next level is unconfirmed (since we insert levels without + any confirmed slot). *) + let level = + let open Dal_slot_repr.Header in + if skip_slot then slot.id.published_level + else Raw_level_repr.succ slot.id.published_level + in + let* _page_info, page_id = mk_page_info ~level slot poly in + (* We should not provide the page's info if we want to build an + unconfirmation proof. *) + return @@ Some (None, page_id) + + (** This helper function allows to test DAL's {!produce_proof} and + {!verify_proof} functions, using the data constructed from + {!populate_slots_history} above. *) + let helper_check_pbt_pages last_cell last_cache slots_info ~page_to_request + ~check_produce ~check_verify = + let open Lwt_result_syntax in + List.iter_es + (fun item -> + let*? mk_test = page_to_request item in + match mk_test with + | None -> return_unit + | Some (page_info, page_id) -> + produce_and_verify_proof + last_cell + ~get_history:(get_history last_cache) + ~page_info + ~page_id + ~check_produce + ~check_verify) + slots_info + + (** Making some confirmation pages tests for slots that are confirmed. *) + let test_confirmed_pages (levels_data : levels) = + let open Lwt_result_syntax in + let*? last_cell, last_cache, slots_info = + populate_slots_history levels_data + in + helper_check_pbt_pages + last_cell + last_cache + slots_info + ~page_to_request:request_confirmed_page + ~check_produce:(successful_check_produce_result ~__LOC__ `Confirmed) + ~check_verify:(successful_check_verify_result ~__LOC__ `Confirmed) + + (** Making some unconfirmation pages tests for slots that are confirmed. *) + let test_unconfirmed_pages (levels_data : levels) = + let open Lwt_result_syntax in + let*? last_cell, last_cache, slots_info = + populate_slots_history levels_data + in + helper_check_pbt_pages + last_cell + last_cache + slots_info + ~page_to_request:request_unconfirmed_page + ~check_produce:(successful_check_produce_result ~__LOC__ `Unconfirmed) + ~check_verify:(successful_check_verify_result ~__LOC__ `Unconfirmed) + + let tests = + let gen_dal_config : levels QCheck2.Gen.t = + QCheck2.Gen.( + let nb_slots = pure 20 in + let nb_levels = pure 5 in + (* The slot is confirmed iff the boolean is true *) + let slot = bool in + let slots = list_size nb_slots slot in + list_size nb_levels slots) + in + [ + Tztest.tztest_qcheck2 + ~name:"Pbt tests: confirmed pages" + ~count:Parameters.count + gen_dal_config + test_confirmed_pages; + Tztest.tztest_qcheck2 + ~name:"Pbt tests: unconfirmed pages" + ~count:Parameters.count + gen_dal_config + test_unconfirmed_pages; + ] + + let tests = + [(Format.sprintf "[%s] Dal slots refutation" Parameters.name, tests)] +end + +let () = + let open Tezos_protocol_016_PtMumbai_parameters.Default_parameters in + let module Test = Make (struct + let name = "test" + + let count = 5 + + let dal_parameters = constants_test.dal + end) in + Alcotest_lwt.run "Refutation_game" Test.tests |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml new file mode 100644 index 000000000000..7d882937ddbb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml @@ -0,0 +1,144 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (gas properties) + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.exe + Subject: Arithmetic properties around gas. +*) + +open Protocol +open Lib_test.Qcheck2_helpers + +(** Extract a Tezos result for compatibility with QCheck2. *) +let extract_qcheck_result = function + | Ok pure_result -> pure_result + | Error err -> + Format.printf "@\n%a@." Environment.Error_monad.pp_trace err ; + false + +(** [Gas.free] is the neutral element of gas addition: [any_cost +@ Gas.free = Gas.free +@ any_cost = any_cost]. *) +let test_free_neutral (start, any_cost) = + let open Alpha_context in + extract_qcheck_result + (let open Result_syntax in + let* free_first = Gas.consume start Gas.free in + let* branch1 = Gas.consume free_first any_cost in + let* cost_first = Gas.consume start any_cost in + let+ branch2 = Gas.consume cost_first Gas.free in + let equal_consumption_from_start t1 t2 = + Gas.Arith.( + qcheck_eq + ~pp + ~eq:equal + (Gas.consumed ~since:start ~until:t1) + (Gas.consumed ~since:start ~until:t2)) + in + equal_consumption_from_start branch1 branch2 + && equal_consumption_from_start branch1 cost_first) + +(** Consuming [Gas.free] is equivalent to consuming nothing. *) +let test_free_consumption start = + let open Alpha_context in + extract_qcheck_result + (let open Result_syntax in + let+ after_empty_consumption = Gas.consume start Gas.free in + Gas.Arith.( + qcheck_eq + ~pp + ~eq:equal + (Gas.consumed ~since:start ~until:after_empty_consumption) + zero)) + +(** Consuming [cost1] then [cost2] is equivalent to consuming + [Gas.(cost1 +@ cost2)]. *) +let test_consume_commutes (start, cost1, cost2) = + let open Alpha_context in + extract_qcheck_result + (let open Result_syntax in + let* after_cost1 = Gas.consume start cost1 in + let* branch1 = Gas.consume after_cost1 cost2 in + let+ branch2 = Gas.consume start Gas.(cost1 +@ cost2) in + Gas.Arith.( + qcheck_eq + ~pp + ~eq:equal + (Gas.consumed ~since:start ~until:branch1) + (Gas.consumed ~since:start ~until:branch2))) + +(** Arbitrary context with a gas limit of 100_000_000. *) +let context_gen : Alpha_context.t QCheck2.Gen.t = + QCheck2.Gen.return + (Lwt_main.run + (let open Lwt_result_syntax in + let* b, _contract = Context.init1 () in + let+ inc = Incremental.begin_construction b in + Alpha_context.Gas.set_limit + (Incremental.alpha_ctxt inc) + Alpha_context.Gas.Arith.(fp (integral_of_int_exn 100_000_000))) + |> function + | Ok a -> a + | Error _ -> assert false) + +(** This arbitrary could be improved (pretty printer and shrinker) if there was a way to convert a [cost] back to an [int]. Otherwise one needs to write a custom [arbitrary] instance, but I wanted to stick to the former design of this test for the time being. *) +let gas_cost_gen : Alpha_context.Gas.cost QCheck2.Gen.t = + let open Alpha_context.Gas in + let open QCheck2.Gen in + let rand = 0 -- 1000 in + let safe_rand = map Saturation_repr.safe_int rand in + oneof + [ + map atomic_step_cost safe_rand; + map step_cost safe_rand; + map alloc_cost safe_rand; + map alloc_bytes_cost rand; + map alloc_mbytes_cost rand; + map read_bytes_cost rand; + map write_bytes_cost rand; + ] + +let tests = + [ + QCheck2.Test.make + ~count:1000 + ~name:"Consuming commutes" + QCheck2.Gen.(triple context_gen gas_cost_gen gas_cost_gen) + test_consume_commutes; + QCheck2.Test.make + ~count:1000 + ~name:"Consuming [free] consumes nothing" + context_gen + test_free_consumption; + QCheck2.Test.make + ~count:1000 + ~name:"[free] is the neutral element of Gas addition" + QCheck2.Gen.(pair context_gen gas_cost_gen) + test_free_neutral; + ] + +let () = + Alcotest.run "protocol > pbt > gas" [("gas properties", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml new file mode 100644 index 000000000000..aed9852cf3da --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml @@ -0,0 +1,125 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.exe + Subject: Tx rollup l2 encoding +*) + +open Lib_test.Qcheck2_helpers + +(* ------ generators -------------------------------------------------------- *) + +let input : bytes list QCheck2.Gen.t = + let open QCheck2.Gen in + list_size (2 -- 100) bytes_gen + +let valid_pos l = + let open QCheck2.Gen in + let* pos = 0 -- (List.length l - 1) in + return pos + +let invalid_pos l = + let open QCheck2.Gen in + let* choice = bool in + let* pos = + if choice then -20 -- -1 + else + let len = List.length l in + len -- (2 * len) + in + return pos + +let input_and_pos : (int * bytes list) QCheck2.Gen.t = + let open QCheck2.Gen in + let* l = input in + let* pos = valid_pos l in + return (pos, l) + +let input_and_pos_and_wrong_pos : (int * int * bytes list) QCheck2.Gen.t = + let open QCheck2.Gen in + let* l = input in + let* pos = valid_pos l in + let* wrong_pos = invalid_pos l in + return (pos, wrong_pos, l) + +(* ------ tests ------------------------------------------------------------- *) + +let test_scons_scons_tr_equiv ~count = + let open Merkle_list_helper in + QCheck2.Test.make ~count ~name:"scons_scons_tr_equiv" input (fun input -> + let snoc = List.fold_left snoc nil input in + let snoc_tr = List.fold_left snoc_tr nil input in + Internal_for_tests.equal snoc snoc_tr) + +let test_scons_compute_equiv ~count = + let open Merkle_list_helper in + QCheck2.Test.make ~count ~name:"scons_compute_equiv" input (fun input -> + let snoc = List.fold_left snoc nil input |> root in + let compute = compute input in + Hash.equal snoc compute) + +let ok_exn = function Ok x -> x | Error _ -> raise (Invalid_argument "ok_exn") + +let test_check_path ~count = + let open Merkle_list_helper in + QCheck2.Test.make ~count ~name:"check_path" input_and_pos (fun (pos, input) -> + let tree = List.fold_left snoc nil input in + let hash = root tree in + let path = ok_exn @@ compute_path tree pos in + ok_exn @@ check_path path pos (Stdlib.List.nth input pos) hash) + +let test_check_path_wrong ~count = + let open Merkle_list_helper in + QCheck2.Test.make + ~count + ~name:"check_path_wrong" + input_and_pos_and_wrong_pos + (fun (pos, wrong_pos, input) -> + let tree = List.fold_left snoc nil input in + let hash = root tree in + let path = ok_exn @@ compute_path tree pos in + match check_path path wrong_pos (Stdlib.List.nth input pos) hash with + | Ok b -> not b + | Error _ -> true) + +let () = + let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in + Alcotest.run + "Merkle list" + [ + ( "scons_equiv", + qcheck_wrap + [ + test_scons_scons_tr_equiv ~count:1000; + test_scons_compute_equiv ~count:1000; + ] ); + ( "check_path", + qcheck_wrap + [test_check_path ~count:1000; test_check_path_wrong ~count:1000] ); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml new file mode 100644 index 000000000000..deca56bc186e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml @@ -0,0 +1,66 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.exe + Subject: Encoding for operations +*) + +open Protocol +open QCheck2 +open Lib_test.Qcheck2_helpers + +(** {2 Generators} *) +let generate_operation = + let open Gen in + let+ _kind, (_hash, op) = Operation_generator.generate_operation in + op + +(** {2 Tests} *) + +let test_operation = + let open Alpha_context in + let gen = generate_operation in + let eq {shell = s1; protocol_data = Operation_data d1} + {shell = s2; protocol_data = Operation_data d2} = + let o1 : _ Operation.t = {shell = s1; protocol_data = d1} in + let o2 : _ Operation.t = {shell = s2; protocol_data = d2} in + match Operation.equal o1 o2 with None -> false | Some Eq -> true + in + test_roundtrip + ~count:2000 + ~title:"Operation.t" + ~gen + ~eq + Alpha_context.Operation.encoding + +let () = + let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in + Alcotest.run + "Operation_encoding" + [("roundtrip", qcheck_wrap [test_operation])] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml new file mode 100644 index 000000000000..7abd1d7404fd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml @@ -0,0 +1,1806 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: PBT for the SCORU refutation game + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.exe + Subject: SCORU refutation game +*) +open Protocol + +open Alpha_context +open Sc_rollup +open Lib_test.Qcheck2_helpers +open Sc_rollup_helpers + +(** {2 Utils} *) + +let qcheck_make_lwt = qcheck_make_lwt ~extract:Lwt_main.run + +let qcheck_make_lwt_res ?print ?count ~name ~gen f = + qcheck_make_result + ~pp_error:Error_monad.pp_print_trace + ?print + ?count + ~name + ~gen + (fun a -> Lwt_main.run (f a)) + +let tick_to_int_exn ?(__LOC__ = __LOC__) t = + WithExceptions.Option.get ~loc:__LOC__ (Tick.to_int t) + +let tick_of_int_exn ?(__LOC__ = __LOC__) n = + WithExceptions.Option.get ~loc:__LOC__ (Tick.of_int n) + +let number_of_ticks_of_int64_exn ?(__LOC__ = __LOC__) n = + WithExceptions.Option.get ~loc:__LOC__ (Number_of_ticks.of_value n) + +let game_status_of_refute_op_result = function + | [ + Apply_results.Operation_metadata + { + contents = + Single_result + (Manager_operation_result + { + operation_result = + Applied (Sc_rollup_refute_result {game_status; _}); + _; + }); + }; + ] -> + game_status + | _ -> assert false + +let list_assoc (key : Tick.t) list = List.assoc ~equal:( = ) key list + +let print_dissection_chunk = Format.asprintf "%a" Dissection_chunk.pp + +let print_dissection = Format.asprintf "%a" Game.pp_dissection + +let print_our_states _ = "<our states>" + +(** Assert that the computation fails with the given message. *) +let assert_fails_with ~__LOC__ (res : unit Environment.Error_monad.tzresult) + expected_err = + match res with + | Error trace -> + let expected_trace = + Environment.Error_monad.trace_of_error expected_err + in + if expected_trace = trace then Lwt.return true + else + let pp = Environment.Error_monad.pp_trace in + QCheck2.Test.fail_reportf + "@[Expected reason: %a@;Actual reason: %a@]" + pp + expected_trace + pp + trace + | Ok () -> Lwt.return false + +let initial_of_dissection dissection = + List.hd dissection |> WithExceptions.Option.get ~loc:__LOC__ + +(** Modify the last section of a dissection. *) +let rec modify_stop f dissection = + match dissection with + | [] -> assert false + | [chunk] -> [f chunk] + | x :: xs -> + let xs = modify_stop f xs in + x :: xs + +(** Modify the first section of a dissection. *) +let modify_start f dissection = + match dissection with + | chunk :: xs -> f chunk :: xs + | [] -> (* The dissection can not be empty. *) assert false + +(** Checks that the [dissection] is valid regarding the function + {!Sc_rollup_game_repr.check_dissection}. *) +let valid_dissection ~default_number_of_sections ~start_chunk ~stop_chunk + dissection = + Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + dissection + |> Result.is_ok + +(** [disputed_sections ~our_states dissection] returns the list of sections + in the [dissection] on which the player dissecting disagree with. + It uses [our_states], an assoc list between tick and state hashes to + compare opponent's claims against our point of view. *) +let disputed_sections ~our_states dissection = + let agree_on_state tick their_state = + let our_state = list_assoc tick our_states in + Option.equal State_hash.equal our_state their_state + in + let rec traverse acc = function + | Dissection_chunk.( + {state_hash = their_start_state; tick = start_tick} as a) + :: ({state_hash = their_stop_state; tick = stop_tick} as b) + :: dissection -> + let rst = b :: dissection in + if agree_on_state start_tick their_start_state then + (* It's a disputed section if we agree on the start state but disagree + on the stop. *) + if agree_on_state stop_tick their_stop_state then traverse acc rst + else + let disputed_section = (a, b) in + traverse (disputed_section :: acc) rst + else traverse acc rst + | _ -> acc + in + traverse [] dissection + +let pick_disputed_sections disputed_sections = + QCheck2.Gen.oneofl disputed_sections + +let single_tick_disputed_sections disputed_sections = + List.filter_map + (fun disputed_section -> + let Dissection_chunk.({tick = a_tick; _}, {tick = b_tick; _}) = + disputed_section + in + let distance = Tick.distance a_tick b_tick in + if Z.Compare.(distance = Z.one) then Some disputed_section else None) + disputed_sections + +let final_dissection ~our_states dissection = + let disputed_sections = disputed_sections ~our_states dissection in + let single_tick_disputed_sections = + single_tick_disputed_sections disputed_sections + in + Compare.List_length_with.(single_tick_disputed_sections > 0) + +(** Build a non-random dissection from [start_chunk] to [stop_chunk] using + [our_states] as the state hashes for each tick. *) +let build_dissection ~number_of_sections ~start_chunk ~stop_chunk ~our_states = + let open Lwt_result_syntax in + let state_hash_from_tick tick = return @@ list_assoc tick our_states in + let our_stop_chunk = + Dissection_chunk. + {stop_chunk with state_hash = list_assoc stop_chunk.tick our_states} + in + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3491 + + This dissection's building does not check the number of sections. Checks should + be added to verify that we don't generate invalid dissection and test the + incorrect cases. *) + Lwt_main.run + @@ let*! r = + Game_helpers.( + make_dissection ~state_hash_from_tick ~start_chunk ~our_stop_chunk + @@ default_new_dissection + ~start_chunk + ~our_stop_chunk + ~default_number_of_sections:number_of_sections) + in + Lwt.return @@ WithExceptions.Result.get_ok ~loc:__LOC__ r + +let originate_rollup originator block = + let open Lwt_result_syntax in + let* origination_operation, sc_rollup = + Op.sc_rollup_origination + (B block) + originator + Kind.Example_arith + ~boot_sector:"" + ~parameters_ty:(Script.lazy_expr @@ Expr.from_string "unit") + in + let* block = Block.bake ~operations:[origination_operation] block in + let* inbox = Context.Sc_rollup.inbox (B block) in + let+ genesis_info = Context.Sc_rollup.genesis_info (B block) sc_rollup in + (block, sc_rollup, inbox, genesis_info) + +(** [create_ctxt ()] creates a context where an arith rollup was originated, + and both [account1] and [account2] owns enough tez to stake on a + commitment. *) +let create_ctxt () = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Lwt_main.run + @@ + let open Lwt_result_syntax in + let* block, (account1, account2, account3) = + Context.init3 + ~sc_rollup_enable:true + ~consensus_threshold:0 + ~bootstrap_balances:[100_000_000_000L; 100_000_000_000L; 100_000_000_000L] + () + in + let* block, sc_rollup, inbox, genesis_info = + originate_rollup account3 block + in + return (block, sc_rollup, inbox, genesis_info, (account1, account2, account3)) + +(** {2 Context free generators} *) + +(** Generate a {!State_hash.t}. + + We use a dirty hack {!QCheck2.Gen.make_primitive} to remove the + automatic shrinking. Shrinking on the states in a dissection can + be confusing, it can leads to a shrunk list with the same states in + each cell. +*) +let gen_random_hash = + let open QCheck2.Gen in + let gen = + let* x = bytes_fixed_gen 32 in + return @@ State_hash.of_bytes_exn x + in + (* This is not beautiful, but there is currently no other way to + remove the shrinker. *) + make_primitive + ~gen:(fun rand -> generate1 ~rand gen) + ~shrink:(fun _ -> Seq.empty) + +(** Generate the number of sections in the dissection. *) +let gen_num_sections = + let open Tezos_protocol_016_PtMumbai_parameters.Default_parameters in + let testnet = constants_test.sc_rollup.number_of_sections_in_dissection in + let mainnet = constants_mainnet.sc_rollup.number_of_sections_in_dissection in + let sandbox = constants_sandbox.sc_rollup.number_of_sections_in_dissection in + QCheck2.Gen.( + frequency + [(5, pure mainnet); (4, pure testnet); (2, pure sandbox); (1, 4 -- 100)]) + +(** Generate a tick. *) +let gen_tick ?(lower_bound = 0) ?(upper_bound = 10_000) () = + let open QCheck2.Gen in + let+ tick = lower_bound -- upper_bound in + tick_of_int_exn ~__LOC__ tick + +(** Generate two chunks consisting in valid boundaries for a dissection *) +let gen_wasm_pvm_dissection_boundaries kind = + let open QCheck2.Gen in + let open Alpha_context in + let* broken = bool in + let* state_hash = gen_random_hash in + let* base = Z.of_int <$> 0 -- 10_000 in + let* len = + Z.of_int + <$> + match kind with + | `Kernel_run -> pure 1 + | `Short -> 2 -- 32 + | `Large -> 1_000 -- 10_000 + in + let+ offset = + if broken then 1 -- Z.to_int Sc_rollup.Wasm_2_0_0PVM.ticks_per_snapshot + else pure 0 + in + let start_tick = + Sc_rollup.Tick.of_z @@ Z.(base * Sc_rollup.Wasm_2_0_0PVM.ticks_per_snapshot) + in + let stop_tick = + Sc_rollup.Tick.of_z + @@ Z.( + ((base + len) * Sc_rollup.Wasm_2_0_0PVM.ticks_per_snapshot) + + Z.of_int offset) + in + let start_chunk = + Sc_rollup.Dissection_chunk. + {tick = start_tick; state_hash = Some State_hash.zero} + in + let stop_chunk = + Sc_rollup.Dissection_chunk.{tick = stop_tick; state_hash = Some state_hash} + in + (start_chunk, stop_chunk) + +(** [gen_arith_pvm_messages ~gen_size] is a `correct list` generator. + It generates a list of strings that are either integers or `+` to be + consumed by the arithmetic PVM. + If a `+` is found then the previous two element of the stack are poped + then added and the result is pushed to the stack. In particular, + lists like `[1 +]` are incorrect. *) +let gen_arith_pvm_messages ~gen_size = + let open QCheck2.Gen in + (* To preserve the correctness invariant, genlist is a recursive generator + that produce a pair `(stack_size, state_list)` where state_list is a + correct list of integers and `+` and consuming it will produce a `stack` + of length `stack_size`. + For example a result can be `(3, [1; 2; +; 3; +; 2; 2; +; 1;]). + Consuming the list will produce the stack`[6; 4; 1]` which has length 3. *) + let produce_inputs self fuel = + match fuel with + | 0 -> map (fun x -> (1, [string_of_int x])) small_nat + | n -> + (* The generator has two branches. + 1. with frequency 1 adds integers to state_list and increases the + corresponding stack_size. + 2. With frequency 2, at each step, it looks at the inductive result + [(self (n - 1)) = (stack_size, state_list)]. + + If the stack_size is smaller than 2 then it adds an integer to the + state_list and increases the stack_size. Otherwise, it adds a plus + to the state_list and decreases the stack_size. *) + frequency + [ + ( 2, + map2 + (fun x (stack_size, state_list) -> + if stack_size >= 2 then (stack_size - 1, "+" :: state_list) + else (stack_size + 1, string_of_int x :: state_list)) + small_nat + (self (n / 2)) ); + ( 1, + map2 + (fun x (i, y) -> (i + 1, string_of_int x :: y)) + small_nat + (self (n / 2)) ); + ] + in + let+ inputs = sized_size gen_size @@ fix produce_inputs in + snd inputs |> List.rev |> String.concat " " + +(** Generate a list of level and associated arith pvm messages. *) +let gen_arith_pvm_payloads_for_levels ~start_level ~max_level = + gen_payloads_for_levels + ~start_level + ~max_level + (gen_arith_pvm_messages ~gen_size:(QCheck2.Gen.pure 0)) + +(** Dissection helpers and tests *) +module Dissection = struct + (** Generate an initial *valid* dissection. The validity comes from a + mirrored implementation of {!Sc_rollup_game_repr.initial}. *) + let gen_initial_dissection ?ticks () = + let open QCheck2.Gen in + let* child_state = gen_random_hash and* parent_state = gen_random_hash in + let* ticks = + let+ ticks = + match ticks with + | None -> frequency [(1, pure 0); (9, 1 -- 1_000)] + | Some distance -> pure distance + in + Z.of_int ticks + in + let* initial_tick = gen_tick () in + if Z.Compare.(ticks = Z.zero) then + pure + [ + Dissection_chunk.{state_hash = Some child_state; tick = initial_tick}; + Dissection_chunk.{state_hash = None; tick = Tick.next initial_tick}; + ] + else + let tick = Tick.jump initial_tick ticks in + pure + [ + Dissection_chunk.{state_hash = Some parent_state; tick = initial_tick}; + Dissection_chunk.{state_hash = Some child_state; tick}; + Dissection_chunk.{state_hash = None; tick = Tick.next tick}; + ] + + (** Generate a *valid* dissection. + It returns the dissection alongside the dissected start_chunk and + stop_chunk, but also the number of sections used to generate the + dissection. *) + let gen_dissection ~number_of_sections ~our_states dissection = + let open QCheck2.Gen in + let disputed_sections = disputed_sections ~our_states dissection in + assert (Compare.List_length_with.(disputed_sections > 0)) ; + let+ start_chunk, stop_chunk = pick_disputed_sections disputed_sections in + let dissection = + build_dissection ~number_of_sections ~start_chunk ~stop_chunk ~our_states + in + (dissection, start_chunk, stop_chunk) + + let gen_initial_dissection_ticks = QCheck2.Gen.(0 -- 1_000) + + let gen_nonfinal_initial_dissection_ticks = QCheck2.Gen.(3 -- 1_000) + + (** Given an initial tick and state_hash: generates random state hashes for + every others [ticks]. + Having [our_states] provide the state hashes you believe to + be true. You can then generate a dissection from another one when + you disagree with some sections. *) + let gen_our_states start_chunk ticks = + let open QCheck2.Gen in + let Dissection_chunk.{tick = initial_tick; state_hash = initial_state_hash} + = + start_chunk + in + let initial_state_hash = + WithExceptions.Option.get ~loc:__LOC__ initial_state_hash + in + let initial_tick_int = tick_to_int_exn initial_tick in + let rec aux acc i = + if i < 0 then return acc + else if i = 0 then return ((initial_tick, initial_state_hash) :: acc) + else + let* state_hash = gen_random_hash in + let tick = tick_of_int_exn (i + initial_tick_int) in + aux ((tick, state_hash) :: acc) (i - 1) + in + aux [] ticks + + (** {3 Dissection tests} *) + + let count = 300 + + (** Test the validity of dissection generated by {!gen_dissection} on + an initial dissection generated by {!gen_initial_dissection}. + It is a self test that'll help detect issues in subsequent tests; + in case the generator does not produce valid dissections. *) + let test_valid_gen_dissection = + let open QCheck2 in + let gen = + let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = gen_initial_dissection_ticks in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + if final_dissection ~our_states dissection then + (* The initial dissection could not be dissected. *) + return (dissection, None, number_of_sections, our_states) + else + let* new_dissection, start_hash, stop_hash = + gen_dissection ~number_of_sections ~our_states dissection + in + return + ( dissection, + Some (new_dissection, start_hash, stop_hash), + number_of_sections, + our_states ) + in + let print = + Print.( + quad + print_dissection + (option + (triple + print_dissection + print_dissection_chunk + print_dissection_chunk)) + int + print_our_states) + in + qcheck_make_lwt + ~count + ~name:"gen_dissection produces a valid dissection" + ~print + ~gen + (fun (dissection, new_dissection, default_number_of_sections, our_states) + -> + let open Lwt_syntax in + match new_dissection with + | None -> return (final_dissection ~our_states dissection) + | Some (new_dissection, start_chunk, stop_chunk) -> + return + @@ valid_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + new_dissection) + + (** Truncate a [dissection] and expect the + {!Sc_rollup_game_repr.check_dissection} to fail with an invalid + number of sections, where [expected_number_of_sections] is expected. *) + let truncate_and_check_error dissection start_chunk stop_chunk + default_number_of_sections expected_number_of_sections = + let truncated_dissection = + match dissection with + | x :: _ :: z :: rst -> x :: z :: rst + | _ -> + (* If the dissection is valid, this case can not be reached. *) + assert false + in + let expected_len = Z.of_int expected_number_of_sections in + let expected_reason = + Dissection_chunk.Dissection_number_of_sections_mismatch + {expected = expected_len; given = Z.pred expected_len} + in + assert_fails_with + ~__LOC__ + (Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + truncated_dissection) + expected_reason + + (** Test that if a dissection is smaller than the default number of + sections, the length is equal to (distance + 1) of the dissected + section. *) + let test_truncated_small_dissection = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name: + "distance < nb_of_sections => (len dissection = succ (dist dissection))" + ~gen: + (let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = 3 -- (number_of_sections - 1) in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_hash, stop_hash = + gen_dissection ~number_of_sections ~our_states dissection + in + return (new_dissection, start_hash, stop_hash, number_of_sections, ticks)) + (fun ( dissection, + start_chunk, + stop_chunk, + default_number_of_sections, + distance ) -> + let expected_len = distance in + truncate_and_check_error + dissection + start_chunk + stop_chunk + default_number_of_sections + expected_len) + + (** Test that if the distance in the dissected section is larger than + the default number of sections, the dissection length is exactly the + default number of sections. *) + let test_truncated_large_dissection = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name:"distance >= nb_of_sections => (len dissection = nb_of_sections" + ~gen: + (let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = number_of_sections -- 1_000 in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_chunk, stop_chunk = + gen_dissection ~number_of_sections ~our_states dissection + in + return (new_dissection, start_chunk, stop_chunk, number_of_sections)) + (fun (dissection, start_chunk, stop_chunk, default_number_of_sections) -> + truncate_and_check_error + dissection + start_chunk + stop_chunk + default_number_of_sections + default_number_of_sections) + + (** Test that we can not change the start chunk of a section when we produce + a dissection. *) + let test_immutable_start_chunk = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name:"dissection.start_chunk can not change" + ~gen: + (let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = gen_nonfinal_initial_dissection_ticks in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_chunk, stop_chunk = + gen_dissection ~number_of_sections ~our_states dissection + in + let* new_state_hash = gen_random_hash in + return + ( new_dissection, + start_chunk, + stop_chunk, + number_of_sections, + new_state_hash )) + (fun ( dissection, + start_chunk, + stop_chunk, + default_number_of_sections, + new_state_hash ) -> + (* Check that we can not change the start hash. *) + let dissection_with_different_start = + modify_start + (fun chunk -> + Dissection_chunk.{chunk with state_hash = Some new_state_hash}) + dissection + in + assert_fails_with + ~__LOC__ + (Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + dissection_with_different_start) + (Dissection_chunk.Dissection_start_hash_mismatch + {expected = start_chunk.state_hash; given = Some new_state_hash})) + + (** Test that we can not produce a dissection that agrees with the stop hash. + Otherwise, there would be nothing to dispute. *) + let test_stop_hash_must_change = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name:"dissection.stop_chunk must change" + ~gen: + (let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = gen_nonfinal_initial_dissection_ticks in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_chunk, stop_chunk = + gen_dissection ~number_of_sections ~our_states dissection + in + return (new_dissection, start_chunk, stop_chunk, number_of_sections)) + (fun (dissection, start_chunk, stop_chunk, default_number_of_sections) -> + let open Lwt_syntax in + let check_failure_on_same_stop_hash stop_hash = + let invalid_dissection = + modify_stop + (fun chunk -> + Dissection_chunk.{chunk with state_hash = stop_hash}) + dissection + in + let stop_chunk = + Dissection_chunk.{stop_chunk with state_hash = stop_hash} + in + assert_fails_with + ~__LOC__ + (Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + invalid_dissection) + (Dissection_chunk.Dissection_stop_hash_mismatch stop_hash) + in + let* b1 = check_failure_on_same_stop_hash None in + let* b2 = check_failure_on_same_stop_hash stop_chunk.state_hash in + return (b1 && b2)) + + (** Test that we can not produce a dissection modifying the starting + end last point of a section. *) + let test_immutable_start_and_stop_ticks = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name: + "start_chunk.tick and stop_chunk.tick can not change in the dissection" + ~gen: + (let open Gen in + let* number_of_sections = gen_num_sections in + let* ticks = gen_nonfinal_initial_dissection_ticks in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_chunk, stop_chunk = + gen_dissection ~number_of_sections ~our_states dissection + in + return (new_dissection, start_chunk, stop_chunk, number_of_sections)) + (fun (dissection, start_chunk, stop_chunk, default_number_of_sections) -> + let open Lwt_syntax in + let expected_error dissection = + match (List.hd dissection, List.last_opt dissection) with + | Some Dissection_chunk.{tick = a_tick; _}, Some {tick = b_tick; _} -> + Dissection_chunk.Dissection_edge_ticks_mismatch + { + dissection_start_tick = a_tick; + dissection_stop_tick = b_tick; + chunk_start_tick = start_chunk.tick; + chunk_stop_tick = stop_chunk.tick; + } + | _ -> assert false + in + let modify_tick modify_X dissection = + let invalid_dissection = + modify_X + (fun chunk -> + Dissection_chunk.{chunk with tick = Tick.next chunk.tick}) + dissection + in + let expected_error = expected_error invalid_dissection in + assert_fails_with + ~__LOC__ + (Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + invalid_dissection) + expected_error + in + (* We modify the start tick and expect the failure. *) + let* b1 = modify_tick modify_start dissection in + (* We modify the stop tick and expect the failure. *) + let* b2 = modify_tick modify_stop dissection in + return (b1 && b2)) + + (** Test that a valid dissection must have a proper distribution of the + sections. That is, a section should not be geq than half of the + dissected section's distance. *) + let test_badly_distributed_dissection = + let open QCheck2 in + qcheck_make_lwt + ~count + ~name:"dissection must be well distributed" + ~gen: + (let open Gen in + (* The test is not general enough to support all kind of number of + sections. *) + let number_of_sections = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_mainnet + .sc_rollup + .number_of_sections_in_dissection + in + let* picked_section = 0 -- (number_of_sections - 2) in + let* ticks = 100 -- 1_000 in + let* dissection = gen_initial_dissection ~ticks () in + let* our_states = + gen_our_states (initial_of_dissection dissection) (succ ticks) + in + let* new_dissection, start_chunk, stop_chunk = + gen_dissection ~number_of_sections ~our_states dissection + in + return + ( new_dissection, + start_chunk, + stop_chunk, + number_of_sections, + picked_section )) + (fun ( dissection, + start_chunk, + stop_chunk, + default_number_of_sections, + picked_section ) -> + (* We put a distance of [1] in every section. Then, we put the + distance's left in the [picked_section], it will create + an invalid section. *) + let distance = + Z.succ @@ Tick.distance start_chunk.tick stop_chunk.tick + in + let max_section_length = + Z.(distance - of_int default_number_of_sections) + in + let section_length = Z.one in + + (* Replace the distance of the first [k] sections by [section_length]. + In practice, when [k = 0], we're at the last section of the + dissection. *) + let rec replace_distances tick k = function + | a :: b :: xs -> + let b, tick = + if k = 0 then + let tick = Tick.jump tick max_section_length in + (Dissection_chunk.{b with tick}, tick) + else + let tick = Tick.jump tick section_length in + (Dissection_chunk.{b with tick}, tick) + in + a :: replace_distances tick (k - 1) (b :: xs) + | xs -> xs + in + let invalid_dissection = + replace_distances start_chunk.tick picked_section dissection + in + let dist = Tick.distance start_chunk.tick stop_chunk.tick in + let half_dist = Z.div dist (Z.of_int 2) in + assert_fails_with + ~__LOC__ + (Game.Internal_for_tests.check_dissection + ~default_number_of_sections + ~start_chunk + ~stop_chunk + invalid_dissection) + (Dissection_chunk.Dissection_invalid_distribution half_dist)) + + let tests = + ( "Dissection", + qcheck_wrap + [ + test_valid_gen_dissection; + test_truncated_small_dissection; + test_truncated_large_dissection; + test_immutable_start_chunk; + test_stop_hash_must_change; + test_immutable_start_and_stop_ticks; + test_badly_distributed_dissection; + ] ) +end + +(** {2. ArithPVM utils} *) + +module ArithPVM = Arith_pvm + +module Arith_test_pvm = struct + include ArithPVM + + let initial_state () = + let open Lwt_syntax in + let empty = Sc_rollup_helpers.make_empty_tree () in + let* state = initial_state ~empty in + let* state = install_boot_sector state "" in + return state + + let initial_hash = + let open Lwt_syntax in + let* state = initial_state () in + state_hash state + + let consume_fuel = Option.map pred + + let continue_with_fuel ~our_states ~(tick : int) fuel state f = + let open Lwt_syntax in + match fuel with + | Some 0 -> return (state, fuel, tick, our_states) + | _ -> f tick our_states (consume_fuel fuel) state + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3498 + + the following is almost the same code as in the rollup node, expect that it + creates the association list (tick, state_hash). *) + let eval_until_input ~fuel ~our_states start_tick state = + let open Lwt_syntax in + let rec go ~our_states fuel (tick : int) state = + let* input_request = is_input_state state in + match fuel with + | Some 0 -> return (state, fuel, tick, our_states) + | None | Some _ -> ( + match input_request with + | No_input_required -> + let* state = eval state in + let* state_hash = state_hash state in + let our_states = (tick, state_hash) :: our_states in + go ~our_states (consume_fuel fuel) (tick + 1) state + | _ -> return (state, fuel, tick, our_states)) + in + go ~our_states fuel start_tick state + + let eval_metadata ~fuel ~our_states tick state ~metadata = + let open Lwt_syntax in + continue_with_fuel ~our_states ~tick fuel state + @@ fun tick our_states fuel state -> + let input = Sc_rollup.(Reveal (Metadata metadata)) in + let* state = set_input input state in + let* state_hash = state_hash state in + let our_states = (tick, state_hash) :: our_states in + let tick = succ tick in + return (state, fuel, tick, our_states) + + let feed_input ~fuel ~our_states ~tick state input = + let open Lwt_syntax in + let* state, fuel, tick, our_states = + eval_until_input ~fuel ~our_states tick state + in + continue_with_fuel ~our_states ~tick fuel state + @@ fun tick our_states fuel state -> + let* state = set_input input state in + let* state_hash = state_hash state in + let our_states = (tick, state_hash) :: our_states in + let tick = tick + 1 in + let* state, fuel, tick, our_states = + eval_until_input ~fuel ~our_states tick state + in + return (state, fuel, tick, our_states) + + let eval_inbox ?fuel ~inputs ~tick state = + let open Lwt_result_syntax in + List.fold_left_es + (fun (state, fuel, tick, our_states) input -> + let*! state, fuel, tick, our_states = + feed_input ~fuel ~our_states ~tick state input + in + return (state, fuel, tick, our_states)) + (state, fuel, tick, []) + inputs + + let eval_inputs ~metadata ?fuel inputs_per_levels = + let open Lwt_result_syntax in + let*! state = initial_state () in + let*! state_hash = state_hash state in + let tick = 0 in + let our_states = [(tick, state_hash)] in + let tick = succ tick in + (* 1. We evaluate the boot sector. *) + let*! state, fuel, tick, our_states = + eval_until_input ~fuel ~our_states tick state + in + (* 2. We evaluate the metadata. *) + let*! state, fuel, tick, our_states = + eval_metadata ~fuel ~our_states tick state ~metadata + in + (* 3. We evaluate the inbox. *) + let* state, _fuel, tick, our_states = + List.fold_left_es + (fun (state, fuel, tick, our_states) inputs -> + let* state, fuel, tick, our_states' = + eval_inbox ?fuel ~inputs ~tick state + in + return (state, fuel, tick, our_states @ our_states')) + (state, fuel, tick, our_states) + inputs_per_levels + in + let our_states = + List.sort (fun (x, _) (y, _) -> Compare.Int.compare x y) our_states + in + let our_states = + List.map + (fun (tick_int, state) -> (tick_of_int_exn tick_int, state)) + our_states + in + let tick = tick_of_int_exn tick in + return (state, tick, our_states) +end + +let construct_inbox_proto block list_of_messages contract = + let open Lwt_result_syntax in + let* block, infos_per_level = + List.fold_left_es + (fun ((block : Block.t), acc) ({messages; _} : payloads_per_level) -> + let predecessor = block.hash in + let predecessor_timestamp = block.header.shell.timestamp in + + let* block = + match messages with + | [] -> + let* block = Block.bake block in + return block + | messages -> + let* operation_add_message = + Op.sc_rollup_add_messages (B block) contract messages + in + let* block = Block.bake ~operation:operation_add_message block in + return block + in + + let acc = (predecessor_timestamp, predecessor) :: acc in + + return (block, acc)) + (block, []) + list_of_messages + in + return (block, List.rev infos_per_level) + +(** Construct the inbox for the protocol side. *) +let construct_inbox_proto block list_of_messages contract = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Lwt_main.run + @@ construct_inbox_proto block list_of_messages contract + +(** Kind of strategy a player can play + + The cheaters will have their own version of inputs. This way, they + can produce valid proofs regarding their inboxes, but discarded by + the protocol. +*) +type strategy = + | Random (** A random player will execute its own random vision of inputs. *) + | Perfect + (** A perfect player, never lies, always win. + GSW 73-9 2014-2015 mindset. *) + | Lazy (** A lazy player will not execute all messages. *) + | Eager (** A eager player will not cheat until a certain point. *) + | Keen (** A keen player will execute more messages. *) + | SOL_hater (** A SOL hater will not execute the SOL input. *) + | EOL_hater (** A EOL hater will not execute the EOL input. *) + | Info_hater (** A Info per level hater will corrupt the infos. *) + | Nostalgic + (** A nostalgic player will execute messages at origination level. *) + +let pp_strategy fmt = function + | Random -> Format.pp_print_string fmt "Random" + | Perfect -> Format.pp_print_string fmt "Perfect" + | Lazy -> Format.pp_print_string fmt "Lazy" + | Eager -> Format.pp_print_string fmt "Eager" + | Keen -> Format.pp_print_string fmt "Keen" + | SOL_hater -> Format.pp_print_string fmt "SOL hater" + | EOL_hater -> Format.pp_print_string fmt "EOL hater" + | Info_hater -> Format.pp_print_string fmt "Info per level hater" + | Nostalgic -> Format.pp_print_string fmt "Nostalgic" + +type player = { + pkh : Tezos_crypto.Signature.Public_key_hash.t; + contract : Contract.t; + strategy : strategy; + game_player : Game.player; +} + +let pp_player ppf {pkh; contract = _; strategy; game_player} = + Format.fprintf + ppf + "pkh: %a@,strategy: %a@,game_player: %s" + Tezos_crypto.Signature.Public_key_hash.pp_short + pkh + pp_strategy + strategy + (if Game.player_equal game_player Alice then "Alice" else "Bob") + +type player_client = { + player : player; + states : (Tick.t * State_hash.t) list; + final_tick : Tick.t; + inbox : + Sc_rollup.Inbox_merkelized_payload_hashes.History.t + Sc_rollup_helpers.Payloads_histories.t + * Inbox.History.t + * Inbox.t; + payloads_per_levels : payloads_per_level list; + metadata : Metadata.t; + context : Tezos_context_memory.Context_binary.t; +} + +let pp_player_client ppf + { + player; + states = _; + final_tick; + inbox = _; + payloads_per_levels = _; + metadata = _; + context = _; + } = + Format.fprintf + ppf + "@[<v 2>player:@,%a@]@,final tick: %a@" + pp_player + player + Tick.pp + final_tick + +module Player_client = struct + let empty_memory_ctxt id = + let open Lwt_syntax in + Lwt_main.run + @@ let+ index = Tezos_context_memory.Context_binary.init id in + Tezos_context_memory.Context_binary.empty index + + (** Construct an inbox based on [list_of_messages] in the player context. *) + let construct_inbox ~inbox list_of_messages = + let history = Sc_rollup.Inbox.History.empty ~capacity:10000L in + let level_tree_histories = Payloads_histories.empty in + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup_helpers.fill_inbox + ~inbox + history + level_tree_histories + list_of_messages + + (** Generate [our_states] for [payloads_per_levels] based on the strategy. + It needs [start_level] and [max_level] in case it will need to generate + new inputs. *) + let gen_our_states ~metadata strategy ~start_level ~max_level + payloads_per_levels = + let open QCheck2.Gen in + let eval_inputs (payloads_per_levels : payloads_per_level list) = + Lwt_main.run + @@ + let open Lwt_result_syntax in + let inputs_per_levels = + List.map (fun {inputs; _} -> inputs) payloads_per_levels + in + let*! r = Arith_test_pvm.eval_inputs ~metadata inputs_per_levels in + Lwt.return @@ WithExceptions.Result.get_ok ~loc:__LOC__ r + in + match strategy with + | Perfect -> + (* The perfect player does not lie, evaluates correctly the inputs. *) + let _state, tick, our_states = eval_inputs payloads_per_levels in + return (tick, our_states, payloads_per_levels) + | Random -> + (* Random player generates its own list of inputs. *) + let* new_payloads_per_levels = + gen_arith_pvm_payloads_for_levels ~start_level ~max_level + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + | Lazy -> + (* Lazy player removes inputs from [payloads_per_levels]. *) + let n = List.length payloads_per_levels in + let* remove_k = 1 -- n in + let new_inputs = List.take_n (n - remove_k) payloads_per_levels in + let _state, tick, our_states = eval_inputs new_inputs in + return (tick, our_states, new_inputs) + | Eager -> + (* Eager player executes correctly the inbox until a certain point. *) + let* corrupt_at_level = 0 -- (List.length payloads_per_levels - 1) in + let payloads_per_level = + Stdlib.List.nth payloads_per_levels corrupt_at_level + |> fun {payloads; _} -> List.length payloads + in + let* corrupt_at_k = 0 -- payloads_per_level in + let payloads_per_levels = + List.mapi + (fun l payloads_per_level -> + if l = corrupt_at_level then + let inputs = + List.mapi + (fun k input -> + if k = corrupt_at_k then + make_input + ~inbox_level:(Raw_level.of_int32_exn 42l) + ~message_counter:(Z.of_int 42) + (make_external_inbox_message "foo") + else input) + payloads_per_level.inputs + in + {payloads_per_level with inputs} + else payloads_per_level) + payloads_per_levels + in + let _state, tick, our_states = eval_inputs payloads_per_levels in + return (tick, our_states, payloads_per_levels) + | Keen -> + (* Keen player will add more inputs. *) + let* offset = 1 -- 5 in + let* new_payloads_per_levels = + gen_arith_pvm_payloads_for_levels + ~start_level:max_level + ~max_level:(max_level + offset) + in + let new_payloads_per_levels = + payloads_per_levels @ new_payloads_per_levels + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + | SOL_hater -> + let new_payloads_per_levels = + List.map + (fun payloads_per_level -> + { + payloads_per_level with + inputs = Stdlib.List.tl payloads_per_level.inputs; + }) + payloads_per_levels + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + | EOL_hater -> + let new_payloads_per_levels = + List.map + (fun payloads_per_level -> + let inputs = + let rev_inputs = List.rev payloads_per_level.inputs in + let without_eol = Stdlib.List.tl rev_inputs in + List.rev without_eol + in + {payloads_per_level with inputs}) + payloads_per_levels + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + | Info_hater -> + let* corrupt_at_l = 0 -- List.length payloads_per_levels in + let dumb_timestamp = Timestamp.of_seconds 42L in + let dumb_predecessor = Tezos_crypto.Block_hash.zero in + + let new_payloads_per_levels = + List.mapi + (fun l payloads_per_level -> + if l = corrupt_at_l then + { + payloads_per_level with + predecessor_timestamp = dumb_timestamp; + predecessor = dumb_predecessor; + } + else payloads_per_level) + payloads_per_levels + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + | Nostalgic -> + (* [payloads_per_levels] starts at [orignation_level + 1], the nostalgic + player will execute messages at [origination_level]. *) + let* messages = + small_list (gen_arith_pvm_messages ~gen_size:(pure 0)) + in + let payloads_at_origination = + Sc_rollup_helpers.wrap_messages metadata.origination_level messages + in + let new_payloads_per_levels = + payloads_at_origination :: payloads_per_levels + in + let _state, tick, our_states = eval_inputs new_payloads_per_levels in + return (tick, our_states, new_payloads_per_levels) + + (** [gen ~inbox ~rollup ~origination_level ~start_level ~max_level player + payloads_per_levels] generates a {!player_client} based on + its {!player.strategy}. *) + let gen ~inbox ~rollup ~origination_level ~start_level ~max_level player + payloads_per_levels = + let open QCheck2.Gen in + let ctxt = empty_memory_ctxt "foo" in + let metadata = Sc_rollup.Metadata.{address = rollup; origination_level} in + let* tick, our_states, payloads_per_levels = + gen_our_states + ~metadata + player.strategy + ~start_level + ~max_level + payloads_per_levels + in + let inbox = construct_inbox ~inbox payloads_per_levels in + return + { + player; + final_tick = tick; + states = our_states; + inbox; + payloads_per_levels; + metadata; + context = ctxt; + } +end + +(** [create_commitment ~predecessor ~inbox_level ~our_states] creates + a commitment using [our_states] as the vision of ticks. *) +let create_commitment ~predecessor ~inbox_level ~our_states = + let open Lwt_syntax in + let inbox_level = Int32.of_int inbox_level |> Raw_level.of_int32_exn in + let+ compressed_state = + match List.last_opt our_states with + | None -> + (* No tick evaluated. *) + Arith_test_pvm.initial_hash + | Some (_, state) -> return state + in + + let number_of_ticks = + match our_states with + | [] -> Number_of_ticks.zero + | _ -> + List.length our_states - 1 + |> Int64.of_int |> number_of_ticks_of_int64_exn + in + Commitment.{compressed_state; inbox_level; predecessor; number_of_ticks} + +(** [operation_publish_commitment block rollup lcc inbox_level p1_client] + creates a commitment and stake on it. *) +let operation_publish_commitment ctxt rollup predecessor inbox_level + player_client = + let open Lwt_result_syntax in + let*! commitment = + create_commitment ~predecessor ~inbox_level ~our_states:player_client.states + in + Op.sc_rollup_publish ctxt player_client.player.contract rollup commitment + +(** [build_proof ~player_client start_tick game] builds a valid proof + regarding the vision [player_client] has. The proof refutes the + [start_tick]. *) +let build_proof ~player_client start_tick (game : Game.t) = + let open Lwt_result_syntax in + (* No messages are added between [game.start_level] and the current level + so we can take the existing inbox of players. Otherwise, we should find the + inbox of [start_level]. *) + let payloads_histories, history, inbox = player_client.inbox in + let get_payloads_history witness_hash = + Payloads_histories.find witness_hash payloads_histories + |> WithExceptions.Option.get ~loc:__LOC__ + |> Lwt.return + in + let history_proof = Inbox.old_levels_messages inbox in + (* We start a game on a commitment that starts at [Tick.initial], the fuel + is necessarily [start_tick]. *) + let fuel = tick_to_int_exn start_tick in + let metadata = player_client.metadata in + let inputs_per_levels = + List.map (fun {inputs; _} -> inputs) player_client.payloads_per_levels + in + let*! r = Arith_test_pvm.eval_inputs ~metadata ~fuel inputs_per_levels in + let state, _, _ = WithExceptions.Result.get_ok ~loc:__LOC__ r in + let module P = struct + include Arith_test_pvm + + let initial_state ~empty:_ = initial_state () + + let context = player_client.context + + let state = state + + let reveal _ = assert false + + module Inbox_with_history = struct + let inbox = history_proof + + let get_history inbox = Inbox.History.find inbox history |> Lwt.return + + let get_payloads_history = get_payloads_history + end + + (* FIXME/DAL-REFUTATION: https://gitlab.com/tezos/tezos/-/issues/3992 + Extend refutation game to handle Dal refutation case. *) + module Dal_with_history = struct + let confirmed_slots_history = Dal.Slots_history.genesis + + let get_history _hash = Lwt.return_none + + let page_info = None + + let dal_parameters = + Default_parameters.constants_test.dal.cryptobox_parameters + + let dal_attestation_lag = + Default_parameters.constants_test.dal.attestation_lag + end + end in + let*! proof = Sc_rollup.Proof.produce ~metadata (module P) game.inbox_level in + return (WithExceptions.Result.get_ok ~loc:__LOC__ proof) + +(** [next_move ~number_of_sections ~player_client game] produces + the next move in the refutation game. + + If there is a disputed section where the distance is one tick, it + produces a proof. Otherwise, provides another dissection. +*) +let next_move ~player_client (game : Game.t) = + let open Lwt_result_syntax in + match game.game_state with + | Dissecting {dissection; default_number_of_sections} -> ( + let disputed_sections = + disputed_sections ~our_states:player_client.states dissection + in + assert (Compare.List_length_with.(disputed_sections > 0)) ; + let single_tick_disputed_sections = + single_tick_disputed_sections disputed_sections + in + match single_tick_disputed_sections with + | (start_chunk, _stop_chunk) :: _ -> + let tick = start_chunk.tick in + let+ proof = build_proof ~player_client tick game in + Game.{choice = tick; step = Proof proof} + | [] -> + (* If we reach this case, there is necessarily a disputed section. *) + let start_chunk, stop_chunk = Stdlib.List.hd disputed_sections in + let dissection = + build_dissection + ~number_of_sections:default_number_of_sections + ~start_chunk + ~stop_chunk + ~our_states:player_client.states + in + return Game.{choice = start_chunk.tick; step = Dissection dissection}) + | Final_move {agreed_start_chunk; refuted_stop_chunk = _} -> + let tick = agreed_start_chunk.tick in + let+ proof = build_proof ~player_client tick game in + Game.{choice = tick; step = Proof proof} + +type game_result_for_tests = Defender_wins | Refuter_wins + +(** Play until there is an {!game_result_for_tests}. + + A game result can happen if: + - A valid refutation was provided to the protocol and it succeeded to + win the game. + - A player played an invalid refutation and was rejected by the + protocol. +*) +let play_until_game_result ~refuter_client ~defender_client ~rollup block = + let rec play ~player_turn ~opponent block = + let open Lwt_result_syntax in + let* games = + Context.Sc_rollup.ongoing_games_for_staker + (B block) + rollup + player_turn.player.pkh + in + let game_opt = List.hd games in + let game, _, _ = WithExceptions.Option.get ~loc:__LOC__ game_opt in + let* refutation = next_move ~player_client:player_turn game in + let* incr = Incremental.begin_construction block in + let* operation_refutation = + Op.sc_rollup_refute + (I incr) + player_turn.player.contract + rollup + opponent.player.pkh + (Some refutation) + in + let* incr = Incremental.add_operation incr operation_refutation in + match game_status_of_refute_op_result (Incremental.rev_tickets incr) with + | Ongoing -> + let* block = Incremental.finalize_block incr in + play ~player_turn:opponent ~opponent:player_turn block + | Ended (Loser {reason = _; loser}) -> + if loser = Account.pkh_of_contract_exn refuter_client.player.contract + then return Defender_wins + else return Refuter_wins + | Ended Draw -> + QCheck2.Test.fail_reportf "Game ended in a draw, which is unexpected" + in + play ~player_turn:refuter_client ~opponent:defender_client block + +(** Generate two {!player}s with a given strategy. *) +let make_players ~p1_strategy ~contract1 ~p2_strategy ~contract2 = + let pkh1 = Account.pkh_of_contract_exn contract1 in + let pkh2 = Account.pkh_of_contract_exn contract2 in + let ({alice; bob = _} : Game.Index.t) = Game.Index.make pkh1 pkh2 in + let player1, player2 = + if Tezos_crypto.Signature.Public_key_hash.equal alice pkh1 then + Game.(Alice, Bob) + else Game.(Bob, Alice) + in + ( { + pkh = pkh1; + contract = contract1; + strategy = p1_strategy; + game_player = player1; + }, + { + pkh = pkh2; + contract = contract2; + strategy = p2_strategy; + game_player = player2; + } ) + +(** [gen_game ~p1_strategy ~p2_strategy] generates a context where a rollup + was originated. + It generates inputs for the rollup, and creates the players' interpretation + of these inputs in a {!player_client} for [p1_strategy] and [p2_strategy]. +*) +let gen_game ~p1_strategy ~p2_strategy = + let open QCheck2.Gen in + (* If there is no good player, we do not care about the result. *) + assert (p1_strategy = Perfect || p2_strategy = Perfect) ; + let block, rollup, inbox, genesis_info, (contract1, contract2, contract3) = + create_ctxt () + in + let p1, p2 = make_players ~p1_strategy ~contract1 ~p2_strategy ~contract2 in + + (* Create a context with a rollup originated. *) + let commitment_period = + Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_mainnet + .sc_rollup + .commitment_period_in_blocks + in + let origination_level = + Raw_level.to_int32 genesis_info.level |> Int32.to_int + in + let start_level = origination_level + 1 in + let max_level = start_level + commitment_period in + let* payloads_per_levels = + gen_arith_pvm_payloads_for_levels ~start_level ~max_level + in + + let block, infos_per_level = + construct_inbox_proto block payloads_per_levels contract3 + in + + let payloads_per_levels = + Stdlib.List.map2 + (fun payloads_per_level (predecessor_timestamp, predecessor) -> + {payloads_per_level with predecessor_timestamp; predecessor}) + payloads_per_levels + infos_per_level + in + let* p1_client = + Player_client.gen + ~inbox + ~origination_level:genesis_info.level + ~start_level + ~max_level + ~rollup + p1 + payloads_per_levels + in + let* p2_client = + Player_client.gen + ~inbox + ~origination_level:genesis_info.level + ~start_level + ~max_level + ~rollup + p2 + payloads_per_levels + in + let* p1_start = bool in + let commitment_level = origination_level + commitment_period in + return + ( block, + rollup, + commitment_level, + genesis_info.commitment_hash, + p1_client, + p2_client, + p1_start, + payloads_per_levels ) + +(** Shrinker is really slow. Deactivating it. *) +let gen_game ~p1_strategy ~p2_strategy = + let open QCheck2.Gen in + make_primitive + ~gen:(fun rand -> generate1 ~rand (gen_game ~p1_strategy ~p2_strategy)) + ~shrink:(fun _ -> Seq.empty) + +(** [prepare_game block rollup lcc commitment_level p1_client p2_client contract + list_of_messages] prepares a context where [p1_client] and [p2_client] + are in conflict for one commitment. *) +let prepare_game ~p1_start block rollup lcc commitment_level p1_client p2_client + = + let open Lwt_result_syntax in + let* p1_commitment = + operation_publish_commitment (B block) rollup lcc commitment_level p1_client + in + let* p2_commitment = + operation_publish_commitment (B block) rollup lcc commitment_level p2_client + in + let commit_then_commit_and_refute ~defender_commitment ~refuter_commitment + (refuter, defender) = + let* start_game = + Op.sc_rollup_refute + (B block) + refuter.player.contract + rollup + defender.player.pkh + None + in + let* refuter_batch = + Op.batch_operations + ~recompute_counters:true + ~source:refuter.player.contract + (B block) + [refuter_commitment; start_game] + in + let* block = + Block.bake ~operations:[defender_commitment; refuter_batch] block + in + return (block, refuter, defender) + in + if p1_start then + commit_then_commit_and_refute + ~defender_commitment:p2_commitment + ~refuter_commitment:p1_commitment + (p1_client, p2_client) + else + commit_then_commit_and_refute + ~defender_commitment:p1_commitment + ~refuter_commitment:p2_commitment + (p2_client, p1_client) + +let check_distribution = function + | fst :: snd :: rst -> + let open Dissection_chunk in + let dist = Tick.distance fst.tick snd.tick in + let _, min_len, max_len = + List.fold_left + (fun (previous_tick, min_len, max_len) chunk -> + let dist = Tick.distance previous_tick chunk.tick in + (* We only consider length that are greater or equal than + the snapshot size. The last one may not be as big, if + the PVM was stuck. *) + if Compare.Z.(dist < Sc_rollup.Wasm_2_0_0PVM.ticks_per_snapshot) + then (chunk.tick, min_len, max_len) + else (chunk.tick, Z.min min_len dist, Z.max max_len dist)) + (snd.tick, dist, dist) + rst + in + Z.(max_len - min_len <= Sc_rollup.Wasm_2_0_0PVM.ticks_per_snapshot) + | _ -> true + +let test_wasm_dissection name kind = + qcheck_make_lwt_res + ~count:1_000_000 + ~name + ~print:(fun (start_chunk, stop_chunk) -> + Format.asprintf + "dissection from %a to %a" + Dissection_chunk.pp + start_chunk + Dissection_chunk.pp + stop_chunk) + ~gen:(gen_wasm_pvm_dissection_boundaries kind) + (fun (start_chunk, stop_chunk) -> + let open Lwt_result_syntax in + let+ dissection = + Game_helpers.( + make_dissection + ~state_hash_from_tick:(fun _ -> + return_some Sc_rollup.State_hash.zero) + ~start_chunk + ~our_stop_chunk:stop_chunk + @@ Wasm.new_dissection + ~start_chunk + ~our_stop_chunk:stop_chunk + ~default_number_of_sections:32) + in + if kind <> `Kernel_run then assert (check_distribution dissection) ; + match + Wasm_2_0_0PVM.Protocol_implementation.check_dissection + ~default_number_of_sections:32 + ~start_chunk + ~stop_chunk:{stop_chunk with state_hash = Some State_hash.zero} + dissection + with + | Ok () -> true + | Error e -> + Format.printf + "dissection %a caused errors %a\n" + Game.pp_dissection + dissection + Environment.Error_monad.pp_trace + e ; + false) + +(** Create a test of [p1_strategy] against [p2_strategy]. One of them + must be a {!Perfect} player, otherwise, we do not care about which + cheater wins. *) +let test_game ?(count = 100) ~p1_strategy ~p2_strategy () = + let name = + Format.asprintf + "%a against %a" + pp_strategy + p1_strategy + pp_strategy + p2_strategy + in + qcheck_make_lwt_res + ~print: + (fun ( _block, + _rollup, + _commitment_level, + _lcc, + p1_client, + p2_client, + p1_start, + _payloads_per_levels ) -> + Format.asprintf + "@[<v>@,@[<v 2>p1:@,%a@]@,@[<v 2>p2:@,%a@]@,%s@,@]" + pp_player_client + p1_client + pp_player_client + p2_client + (if p1_start then "p1" else "p2")) + ~count + ~name + ~gen:(gen_game ~p1_strategy ~p2_strategy) + (fun ( block, + rollup, + commitment_level, + lcc, + p1_client, + p2_client, + p1_start, + _list_of_messages ) -> + let open Lwt_result_syntax in + (* Otherwise, there is no conflict. *) + QCheck2.assume + (not + (let p1_head = List.last_opt p1_client.states in + let p2_head = List.last_opt p2_client.states in + Option.equal + (fun (t1, state_hash1) (t2, state_hash2) -> + Tick.equal t1 t2 && State_hash.equal state_hash1 state_hash2) + p1_head + p2_head)) ; + let* block, refuter, defender = + prepare_game + ~p1_start + block + rollup + lcc + commitment_level + p1_client + p2_client + in + let* game_result = + play_until_game_result + ~rollup + ~refuter_client:refuter + ~defender_client:defender + block + in + match game_result with + | Defender_wins -> return (defender.player.strategy = Perfect) + | Refuter_wins -> return (refuter.player.strategy = Perfect)) + +let test_perfect_against_random = + test_game ~p1_strategy:Perfect ~p2_strategy:Random () + +let test_perfect_against_lazy = + test_game ~p1_strategy:Perfect ~p2_strategy:Lazy () + +let test_perfect_against_eager = + test_game ~p1_strategy:Perfect ~p2_strategy:Eager () + +let test_perfect_against_keen = + test_game ~p1_strategy:Perfect ~p2_strategy:Keen () + +let test_perfect_against_sol_hater = + test_game ~p1_strategy:Perfect ~p2_strategy:SOL_hater () + +let test_perfect_against_eol_hater = + test_game ~p1_strategy:Perfect ~p2_strategy:EOL_hater () + +let test_perfect_against_info_hater = + test_game ~p1_strategy:Perfect ~p2_strategy:Info_hater () + +let test_perfect_against_nostalgic = + test_game ~p1_strategy:Perfect ~p2_strategy:Nostalgic ~count:5 () + +(* This test will behave as a regression test. *) +let test_cut_at_level = + let open QCheck2 in + Test.make + ~name:"cut at level properly cuts" + ~print:(fun (origination_level, commit_inbox_level, input_level) -> + Format.asprintf + "origination_level: %a, commit_inbox_level: %a, input_level: %a" + Raw_level_repr.pp + origination_level + Raw_level_repr.pp + commit_inbox_level + Raw_level_repr.pp + input_level) + Gen.( + let level = + map + (fun i -> Raw_level_repr.of_int32_exn (Int32.of_int i)) + (0 -- 1_000_000) + in + triple level level level) + (fun (origination_level, commit_inbox_level, input_level) -> + let input : Sc_rollup_PVM_sig.input = + Inbox_message + { + inbox_level = input_level; + message_counter = Z.zero; + payload = Sc_rollup_inbox_message_repr.unsafe_of_string "foo"; + } + in + let input_cut = + Sc_rollup_proof_repr.Internal_for_tests.cut_at_level + ~origination_level + ~commit_inbox_level + input + in + let should_be_none = + Raw_level_repr.( + input_level <= origination_level || commit_inbox_level < input_level) + in + match input_cut with + | Some _input -> not should_be_none + | None -> should_be_none) + +let tests = + ( "Refutation", + qcheck_wrap + [ + test_wasm_dissection "dissection is one kernel_run" `Kernel_run; + test_wasm_dissection "dissection shorter than 32 kernel_run" `Short; + test_wasm_dissection "dissection larger than 32 kernel_run" `Large; + test_perfect_against_random; + test_perfect_against_lazy; + test_perfect_against_keen; + test_perfect_against_eager; + test_perfect_against_sol_hater; + test_perfect_against_eol_hater; + test_perfect_against_info_hater; + test_perfect_against_nostalgic; + test_cut_at_level; + ] ) + +(** {2 Entry point} *) + +let tests = [tests; Dissection.tests] + +let () = Alcotest.run "Refutation_game" tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml new file mode 100644 index 000000000000..5d77d2f35b9a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml @@ -0,0 +1,270 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_sampler.exe + Subject: Operations in Saturation_repr +*) + +open Lib_test.Qcheck2_helpers +open Protocol.Sampler + +(* ------------------------------------------------------------------------- *) +(* Helpers *) + +module Int = struct + include Int + + let hash = Hashtbl.hash +end + +let equal_array elt_eq arr1 arr2 = + Array.length arr1 = Array.length arr2 + && Stdlib.List.for_all2 elt_eq (Array.to_list arr1) (Array.to_list arr2) + +(* Support of a distribution on Z (sorted, with potential duplicates) *) +let support cmp array = + Array.to_seq array |> Seq.map fst |> List.of_seq |> List.sort cmp + |> Array.of_list + +(* Support of a distribution on Z (sorted, without duplicates) *) +let support_uniq cmp array = + Array.to_seq array |> Seq.map fst |> List.of_seq |> List.sort_uniq cmp + |> Array.of_list + +module type Std = sig + type t + + val equal : t -> t -> bool + + val compare : t -> t -> int + + val hash : t -> int +end + +module Helpers = struct + let sample_n_times (total : int) sample = + let rec loop n acc = + if n = 0 then acc + else + let res = sample () in + loop (n - 1) (res :: acc) + in + loop total [] + + let empirical_distribution : + type a. + (module Std with type t = a) -> + nsamples:int -> + (unit -> a) -> + (a * int) array = + fun (module H) ~nsamples sampler -> + let module Table = Hashtbl.Make (H) in + let samples = sample_n_times nsamples sampler in + let table = Table.create 127 in + List.iter + (fun sample -> + let count = Option.value ~default:0 (Table.find table sample) in + Table.replace table sample (count + 1)) + samples ; + let result = Table.to_seq table |> Array.of_seq in + (* check that the support of [result] has no duplicate elements (should + be true since we use [replace]). *) + assert ( + equal_array + H.equal + (support H.compare result) + (support_uniq H.compare result)) ; + result +end + +let normalize : ('a * int) array -> ('a * Q.t) array = + fun empirical -> + let total = + Array.fold_left + (fun acc (_, weight) -> Z.add (Z.of_int weight) acc) + Z.zero + empirical + in + Array.map (fun (n, weight) -> (n, Q.(Z.of_int weight /// total))) empirical + +let pp_dist pp fmtr dist = + let l = Array.to_list dist in + Format.pp_print_list + ~pp_sep:(fun fmtr () -> Format.fprintf fmtr ",") + (fun fmtr (elt, w) -> Format.fprintf fmtr "(%a, %f)" pp elt (Q.to_float w)) + fmtr + l + +let linf (dist : ('a * Q.t) array) pmf = + Array.fold_left (fun acc (n, q) -> Q.(max acc (abs (pmf n - q)))) Q.zero dist + +(* ------------------------------------------------------------------------- *) + +let state = + Random.State.make + [| + 0x1337533D; + 71287309; + 666932349; + 719132214; + 461480042; + 387006837; + 443018964; + 450865457; + 901711679; + 833353016; + 397060904; + |] + +module Make_test (Mass : sig + include Internal_for_tests.SMass + + val to_float : t -> float +end) (S : sig + val sample : int_bound:int -> mass_bound:Mass.t -> int * Mass.t +end) = +struct + let make p = + let module Probability = Internal_for_tests.Make (Mass) in + let measure = List.mapi (fun i p -> (i, p)) p in + let total_mass = List.fold_left Mass.add Mass.zero p in + let state = Probability.create measure in + let sampler = Probability.sample state in + let empirical = + normalize + @@ Helpers.empirical_distribution + (module Int) + ~nsamples:5_000_000 + (fun () -> sampler S.sample) + in + (* We need to rescale the empirical to match that the total mass is not necessarily one. *) + let empirical = + let rescaling = Q.of_float (Mass.to_float total_mass) in + Array.map (fun (x, q) -> (x, Q.mul q rescaling)) empirical + in + (* map the mass to Q to better measure the error *) + let truth = + let array = + measure |> List.to_seq + |> Seq.map (fun (_, mass) -> Q.of_float (Mass.to_float mass)) + |> Array.of_seq + in + fun i -> array.(i) + in + let error = linf empirical truth in + let max_error = 0.001 *. Mass.to_float total_mass in + if not Q.(error < Q.of_float max_error) then + QCheck2.Test.fail_reportf + "didn't converge (%f)@.%a" + (Q.to_float error) + (pp_dist Format.pp_print_int) + empirical ; + true +end + +(* Testing the alias sampler with float-valued measures *) + +module Probability_mass_float : Internal_for_tests.SMass with type t = float = +struct + type t = float + + let encoding = Data_encoding.float + + let zero = 0.0 + + let of_int = float_of_int + + let mul = ( *. ) + + let add = ( +. ) + + let sub = ( -. ) + + let ( = ) = Float.equal + + let ( <= ) (x : t) (y : t) = x <= y + + let ( < ) (x : t) (y : t) = x < y +end + +module Test_float = + Make_test + (struct + include Probability_mass_float + + let to_float x = x + end) + (struct + let sample ~int_bound ~mass_bound = + (Random.State.int state int_bound, Random.State.float state mass_bound) + end) + +(* Testing the alias sampler with Z-valued measures *) + +module Probability_mass_z : Internal_for_tests.SMass with type t = Z.t = struct + let encoding = Data_encoding.z + + include Z + include Z.Compare +end + +module Test_z = + Make_test + (struct + include Probability_mass_z + + let to_float = Z.to_float + end) + (struct + let sample ~int_bound ~mass_bound = + ( Random.State.int state int_bound, + Z.of_int64 (Random.State.int64 state (Z.to_int64 mass_bound)) ) + end) + +let qcheck_wrap = qcheck_wrap ~rand:state + +let alias_float_test = + QCheck2.Test.make + ~count:100 + ~name:"alias_float" + QCheck2.Gen.(list_size (int_range 1 20) pfloat) + Test_float.make + +let alias_z_test = + QCheck2.Test.make + ~count:100 + ~name:"alias_z" + QCheck2.Gen.( + list_size (int_range 1 20) (nat >>= fun n -> return (Z.of_int n))) + Test_z.make + +let () = + Alcotest.run + "protocol > pbt > sampling" + [("sampling", qcheck_wrap [alias_float_test; alias_z_test])] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml new file mode 100644 index 000000000000..5dcda40637de --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml @@ -0,0 +1,291 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.exe + Subject: SC rollup encoding +*) + +open Protocol +open QCheck2 +open Lib_test.Qcheck2_helpers + +let lift k = Environment.wrap_tzresult k + +(** {2 Generators} *) + +let gen_state_hash = + let open Gen in + let* bytes = bytes_fixed_gen Sc_rollup_repr.State_hash.size in + return (Sc_rollup_repr.State_hash.of_bytes_exn bytes) + +let gen_inbox_level = + let open Gen in + let* level = map Int32.abs int32 in + (* There is no inbox for level [0l]. *) + let level = if level = 0l then 1l else level in + return (Raw_level_repr.of_int32_exn level) + +let gen_start_level = + let open Gen in + let* level = map Int32.abs int32 in + let start_level = Raw_level_repr.of_int32_exn level in + return start_level + +let gen_commitment_hash = + let open Gen in + let* bytes = bytes_fixed_gen Sc_rollup_commitment_repr.Hash.size in + return (Sc_rollup_commitment_repr.Hash.of_bytes_exn bytes) + +let gen_number_of_ticks = + let open Gen in + let open Sc_rollup_repr.Number_of_ticks in + let* v = int64_range_gen min_value max_value in + return (WithExceptions.Option.get ~loc:__LOC__ (of_value v)) + +let gen_commitment = + let open Gen in + let* compressed_state = gen_state_hash + and* inbox_level = gen_inbox_level + and* predecessor = gen_commitment_hash + and* number_of_ticks = gen_number_of_ticks in + return + Sc_rollup_commitment_repr. + {compressed_state; inbox_level; predecessor; number_of_ticks} + +let gen_versioned_commitment = + let open Gen in + let* commitment = gen_commitment in + return (Sc_rollup_commitment_repr.to_versioned commitment) + +let gen_player = Gen.oneofl Sc_rollup_game_repr.[Alice; Bob] + +let gen_inbox level = + let open Gen in + let gen_msg = small_string ~gen:printable in + let* hd = gen_msg in + let* tail = small_list gen_msg in + let payloads = hd :: tail in + let witness_and_inbox = + let open Result_syntax in + let inbox = Sc_rollup_helpers.dumb_init_repr level in + lift + @@ + let witness = Sc_rollup_inbox_repr.init_witness_no_history in + let* witness = + Sc_rollup_inbox_repr.add_info_per_level_no_history + ~predecessor_timestamp:Time.Protocol.epoch + ~predecessor:Tezos_crypto.Block_hash.zero + witness + in + let* input_messages = + List.map_e + (fun msg -> Sc_rollup_inbox_message_repr.(serialize (External msg))) + payloads + in + let* witness = + Sc_rollup_inbox_repr.add_messages_no_history input_messages witness + in + Sc_rollup_inbox_repr.finalize_inbox_level_no_history inbox witness + in + return + @@ (witness_and_inbox |> function + | Ok v -> v + | Error e -> + Stdlib.failwith (Format.asprintf "%a" Error_monad.pp_print_trace e)) + +let gen_dal_slots_history () = + let open Gen in + let open Dal_slot_repr in + (* Generate a list of (level * confirmed slot ID). *) + let* list = small_list (pair small_nat small_nat) in + let list = + List.rev_map + (fun (level, slot_index) -> + let published_level = + Raw_level_repr.( + (* use succ to avoid having a published_level = 0, as it's the + genesis cell's level in the skip list. *) + succ @@ try of_int32_exn (Int32.of_int level) with _ -> root) + in + let index = Index.(of_int slot_index |> Option.value ~default:zero) in + Header.{id = {published_level; index}; commitment = Commitment.zero}) + list + in + let list = + (* Sort the list in the right ordering before adding slots to slots_history. *) + List.sort_uniq + (fun {Header.id = a; _} {id = b; _} -> + let c = Raw_level_repr.compare a.published_level b.published_level in + if c <> 0 then c else Index.compare a.index b.index) + list + in + History.(add_confirmed_slot_headers_no_cache genesis list) |> function + | Ok v -> return v + | Error e -> + return + @@ Stdlib.failwith + (Format.asprintf "%a" Error_monad.pp_print_trace + @@ Environment.wrap_tztrace e) + +let gen_inbox_history_proof inbox_level = + let open Gen in + let* inbox = gen_inbox inbox_level in + return (Sc_rollup_inbox_repr.take_snapshot inbox) + +let gen_tick = + let open Gen in + let* t = small_nat in + match Sc_rollup_tick_repr.of_int t with + | None -> assert false + | Some r -> return r + +let gen_dissection_chunk = + let open Gen in + let* state_hash = opt gen_state_hash in + let+ tick = gen_tick in + Sc_rollup_dissection_chunk_repr.{state_hash; tick} + +let gen_dissection = + let open Gen in + small_list gen_dissection_chunk + +let gen_game_state = + let open Sc_rollup_game_repr in + let open Gen in + let gen_dissecting = + let* dissection = gen_dissection in + let+ default_number_of_sections = int_range 4 100 in + Dissecting {dissection; default_number_of_sections} + in + let gen_final_move = + let* agreed_start_chunk = gen_dissection_chunk in + let+ refuted_stop_chunk = gen_dissection_chunk in + Final_move {agreed_start_chunk; refuted_stop_chunk} + in + oneof [gen_dissecting; gen_final_move] + +let gen_game = + let open Gen in + let* turn = gen_player in + let* inbox_level = gen_inbox_level in + let* start_level = gen_start_level in + let* inbox_snapshot = gen_inbox_history_proof inbox_level in + let* dal_snapshot = gen_dal_slots_history () in + let* game_state = gen_game_state in + return + Sc_rollup_game_repr. + {turn; dal_snapshot; inbox_snapshot; start_level; inbox_level; game_state} + +let gen_conflict = + let open Gen in + let other = Sc_rollup_repr.Staker.zero in + let* their_commitment = gen_commitment in + let* our_commitment = gen_commitment in + let* parent_commitment = gen_commitment_hash in + return + Sc_rollup_refutation_storage. + {other; their_commitment; our_commitment; parent_commitment} + +let gen_rollup = + let open QCheck2.Gen in + let* bytes = bytes_fixed_gen Sc_rollup_repr.Address.size in + return (Sc_rollup_repr.Address.hash_bytes [bytes]) + +let gen_inbox_message = + let open Gen in + let open Sc_rollup_inbox_message_repr in + let gen_external = + let+ s = small_string ~gen:printable in + External s + in + let gen_sol = return (Internal Start_of_level) in + let gen_eol = return (Internal End_of_level) in + let gen_deposit = + (* We won't test the encoding of these values. It's out of scope. *) + let payload = Script_repr.unit in + let sender = Contract_hash.zero in + let source = Tezos_crypto.Signature.Public_key_hash.zero in + (* But the encoding of the rollup's address is our problem. *) + let+ destination = gen_rollup in + Internal (Transfer {payload; sender; source; destination}) + in + oneof [gen_external; gen_sol; gen_eol; gen_deposit] + +(** {2 Tests} *) + +let test_commitment = + test_roundtrip + ~count:1_000 + ~title:"Sc_rollup_commitment.t" + ~gen:gen_commitment + ~eq:( = ) + Sc_rollup_commitment_repr.encoding + +let test_versioned_commitment = + test_roundtrip + ~count:1_000 + ~title:"Sc_rollup_commitment.versioned" + ~gen:gen_versioned_commitment + ~eq:( = ) + Sc_rollup_commitment_repr.versioned_encoding + +let test_game = + test_roundtrip + ~count:1_000 + ~title:"Sc_rollup_game.t" + ~gen:gen_game + ~eq:Sc_rollup_game_repr.equal + Sc_rollup_game_repr.encoding + +let test_conflict = + test_roundtrip + ~count:1_000 + ~title:"Sc_rollup_refutation_storage.conflict" + ~gen:gen_conflict + ~eq:( = ) + Sc_rollup_refutation_storage.conflict_encoding + +let test_inbox_message = + test_roundtrip + ~count:1_000 + ~title:"Sc_rollup_inbox_message_repr.t" + ~gen:gen_inbox_message + ~eq:( = ) + Sc_rollup_inbox_message_repr.encoding + +let tests = + [ + test_commitment; + test_versioned_commitment; + test_game; + test_conflict; + test_inbox_message; + ] + +let () = Alcotest.run "SC rollup encoding" [("roundtrip", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml new file mode 100644 index 000000000000..1d9424887ebb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml @@ -0,0 +1,109 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.exe + Subject: Operations in Tick_repr +*) + +open Protocol.Alpha_context.Sc_rollup +open QCheck2 + +(** A generator for ticks *) +let tick = + let open Gen in + let+ n = nat in + Option.value ~default:Tick.initial (Tick.of_int n) + +(** For all x, x = initial \/ x > initial. *) +let test_initial_is_bottom = + Test.make ~name:"x = initial \\/ x > initial" tick @@ fun x -> + Tick.(x = initial || x > initial) + +(** For all x, next x > x. *) +let test_next_is_monotonic = + Test.make ~name:"next x > x" tick @@ fun x -> Tick.(next x > x) + +(** Distance from self to self is zero *) +let test_distance_from_self = + Test.make ~name:"distance from x to x is 0" tick (fun x -> + Z.(equal (Tick.distance x x) zero)) + +(** Distance from non-self is non-zero. *) +let test_distance_from_non_self = + Test.make + ~name:"distance from non-self is non-zero" + (Gen.pair tick tick) + (fun (x, y) -> + let dist = Tick.distance x y in + if x = y then Compare.Z.(dist = Z.zero) else Compare.Z.(dist <> Z.zero)) + +(** Distance is symmetric . *) +let test_distance_symmetry = + Test.make + ~name:"distance is a distance (symmetry)" + (Gen.pair tick tick) + (fun (x, y) -> Z.(equal (Tick.distance x y) (Tick.distance y x))) + +(** Distance satisfies triangular inequality. *) +let test_distance_triangle_inequality = + Test.make + ~name:"distance is a distance (triangle inequality)" + (Gen.triple tick tick tick) + (fun (x, y, z) -> + Tick.(Z.(geq (distance x y + distance y z) (distance x z)))) + +(** Test that [of_int x = Some t] iff [x >= 0] *) +let test_of_int = + Test.make ~name:"of_int only accepts natural numbers" Gen.int (fun x -> + match Tick.of_int x with None -> x < 0 | Some _ -> x >= 0) + +(** Test [of_int o to_int = identity]. *) +let test_of_int_to_int = + Test.make ~name:"to_int o of_int = identity" tick @@ fun x -> + Tick.( + match to_int x with + | None -> (* by the tick generator definition. *) assert false + | Some i -> ( match of_int i with Some y -> y = x | None -> false)) + +let tests = + [ + test_next_is_monotonic; + test_initial_is_bottom; + test_distance_from_self; + test_distance_from_non_self; + test_distance_symmetry; + test_distance_triangle_inequality; + test_of_int; + test_of_int_to_int; + ] + +let () = + Alcotest.run + "Tick_repr" + [("Tick_repr", Lib_test.Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml new file mode 100644 index 000000000000..ecacbec36a17 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml @@ -0,0 +1,355 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Script_comparison + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.exe + Subject: PBT of the Script_comparable.compare_comparable function. +*) + +open Protocol +open Alpha_context +open Script_typed_ir +open Lib_test.Qcheck2_helpers + +(* Reference implementation *) + +let normalize_compare c = + let open Compare.Int in + if c > 0 then 1 else if c < 0 then -1 else 0 + +(* This reference implementation of the Michelson comparison function is a + simplified version of the Script_ir_translator.compare_comparable function + that was used in the Florence protocol, before a refactoring broke it in + Granada. *) +let rec reference_compare_comparable : type a. a comparable_ty -> a -> a -> int + = + fun ty x y -> + match (ty, x, y) with + | Unit_t, (), () -> 0 + | Never_t, _, _ -> . + | Signature_t, x, y -> normalize_compare @@ Script_signature.compare x y + | String_t, x, y -> normalize_compare @@ Script_string.compare x y + | Bool_t, x, y -> normalize_compare @@ Compare.Bool.compare x y + | Mutez_t, x, y -> normalize_compare @@ Tez.compare x y + | Key_hash_t, x, y -> + normalize_compare @@ Tezos_crypto.Signature.Public_key_hash.compare x y + | Key_t, x, y -> + normalize_compare @@ Tezos_crypto.Signature.Public_key.compare x y + | Int_t, x, y -> normalize_compare @@ Script_int.compare x y + | Nat_t, x, y -> normalize_compare @@ Script_int.compare x y + | Timestamp_t, x, y -> normalize_compare @@ Script_timestamp.compare x y + | Address_t, x, y -> + normalize_compare @@ Script_comparable.compare_address x y + | Tx_rollup_l2_address_t, x, y -> + normalize_compare @@ Script_comparable.compare_tx_rollup_l2_address x y + | Bytes_t, x, y -> normalize_compare @@ Compare.Bytes.compare x y + | Chain_id_t, x, y -> normalize_compare @@ Script_chain_id.compare x y + | Pair_t (tl, tr, _, YesYes), (lx, rx), (ly, ry) -> + let cl = reference_compare_comparable tl lx ly in + if Compare.Int.(cl = 0) then reference_compare_comparable tr rx ry else cl + | Union_t (tl, _, _, YesYes), L x, L y -> reference_compare_comparable tl x y + | Union_t _, L _, R _ -> -1 + | Union_t _, R _, L _ -> 1 + | Union_t (_, tr, _, YesYes), R x, R y -> reference_compare_comparable tr x y + | Option_t _, None, None -> 0 + | Option_t _, None, Some _ -> -1 + | Option_t _, Some _, None -> 1 + | Option_t (t, _, Yes), Some x, Some y -> reference_compare_comparable t x y + +(* Generation of one to three values of the same comparable type. *) + +type ex_comparable_data = + | Ex_comparable_data : 'a comparable_ty * 'a -> ex_comparable_data + +type ex_comparable_data_2 = + | Ex_comparable_data_2 : 'a comparable_ty * 'a * 'a -> ex_comparable_data_2 + +type ex_comparable_data_3 = + | Ex_comparable_data_3 : + 'a comparable_ty * 'a * 'a * 'a + -> ex_comparable_data_3 + +(* We use the Michelson samplers from lib_benchmark and turn them into QCheck2 + generators *) +module Parameters = struct + let atom_size_range : Tezos_benchmark.Base_samplers.range = + {min = 0; max = 10} + + let other_size : Tezos_benchmark.Base_samplers.range = {min = 0; max = 100} + + let parameters : Michelson_samplers.parameters = + { + base_parameters = + { + int_size = atom_size_range; + string_size = atom_size_range; + bytes_size = atom_size_range; + }; + list_size = other_size; + set_size = other_size; + map_size = other_size; + } +end + +module Crypto_samplers = +Tezos_benchmark.Crypto_samplers.Make_finite_key_pool (struct + let size = 1000 + + let algo = `Default +end) + +module Samplers : Michelson_samplers.S = + Michelson_samplers.Make (Parameters) (Crypto_samplers) + +let ex_comparable_data_sampler : + ex_comparable_data Tezos_benchmark.Base_samplers.sampler = + fun random_state -> + let size = + Tezos_benchmark.Base_samplers.sample_in_interval + ~range:{min = 1; max = 20} + random_state + in + let (Ex_comparable_ty ty) = + Samplers.Random_type.m_comparable_type ~size random_state + in + let x = Samplers.Random_value.comparable ty random_state in + Ex_comparable_data (ty, x) + +let ex_comparable_data_2_sampler : + ex_comparable_data_2 Tezos_benchmark.Base_samplers.sampler = + fun random_state -> + let size = + Tezos_benchmark.Base_samplers.sample_in_interval + ~range:{min = 1; max = 20} + random_state + in + let (Ex_comparable_ty ty) = + Samplers.Random_type.m_comparable_type ~size random_state + in + let x = Samplers.Random_value.comparable ty random_state in + let y = Samplers.Random_value.comparable ty random_state in + Ex_comparable_data_2 (ty, x, y) + +let ex_comparable_data_3_sampler : + ex_comparable_data_3 Tezos_benchmark.Base_samplers.sampler = + fun random_state -> + let size = + Tezos_benchmark.Base_samplers.sample_in_interval + ~range:{min = 1; max = 20} + random_state + in + let (Ex_comparable_ty ty) = + Samplers.Random_type.m_comparable_type ~size random_state + in + let x = Samplers.Random_value.comparable ty random_state in + let y = Samplers.Random_value.comparable ty random_state in + let z = Samplers.Random_value.comparable ty random_state in + Ex_comparable_data_3 (ty, x, y, z) + +let comparable_data_generator = + QCheck2.Gen.make_primitive ~gen:ex_comparable_data_sampler ~shrink:(fun _ -> + Seq.empty) + +let comparable_data_2_generator = + QCheck2.Gen.make_primitive ~gen:ex_comparable_data_2_sampler ~shrink:(fun _ -> + Seq.empty) + +let comparable_data_3_generator = + QCheck2.Gen.make_primitive ~gen:ex_comparable_data_3_sampler ~shrink:(fun _ -> + Seq.empty) + +(* We need a context because packing (used in one of the tests) and unparsing + (used for pretty-printing error messages) Michelson data are carbonated + operations. But since we don't care about gas consumption here we use the + same value of type context everywhere instead of threading it through the + error monad. *) + +let assert_ok = function Ok x -> x | Error _ -> assert false + +let assert_return x = assert_ok (Lwt_main.run x) + +let ctxt = + assert_return + (let open Lwt_result_syntax in + let* b, _cs = Context.init3 () in + let* v = Incremental.begin_construction b in + return (Incremental.alpha_ctxt v)) + +let unparse_comparable_ty ty = + Micheline.strip_locations + (fst (assert_ok Script_ir_unparser.(unparse_ty ~loc:() ctxt ty))) + +let unparse_comparable_data ty x = + fst (assert_return Script_ir_translator.(unparse_data ctxt Readable ty x)) + +let pack_comparable_data ty x = + fst (assert_return Script_ir_translator.(pack_data ctxt ty x)) + +let unpack_comparable_data ty bytes = + fst (assert_return (Script_interpreter_defs.unpack ctxt ~ty ~bytes)) + +let pp_comparable_ty fmt ty = + Michelson_v1_printer.print_expr fmt (unparse_comparable_ty ty) + +let pp_comparable_data ty fmt x = + Michelson_v1_printer.print_expr fmt (unparse_comparable_data ty x) + +let pp ty x y pp_c fmt c = + Format.fprintf + fmt + "Compare(ty=%a, %a, %a) = %a" + pp_comparable_ty + ty + (pp_comparable_data ty) + x + (pp_comparable_data ty) + y + pp_c + c + +let compare_through_pack ty x y = + Bytes.compare (pack_comparable_data ty x) (pack_comparable_data ty y) = 0 + +let qcheck_compare_comparable ~expected ty x y = + qcheck_eq + ~pp:(pp ty x y Format.pp_print_int) + expected + (Script_comparable.compare_comparable ty x y) + +let qcheck_compare_comparable_eq ~expected ty x y = + qcheck_eq + ~pp:(pp ty x y Format.pp_print_bool) + expected + (Script_comparable.compare_comparable ty x y = 0) + +(* Test. + * Tests that compare_comparable returns the same values than the reference + * implementation. + *) +let test_compatible_with_reference = + QCheck2.Test.make + ~name:"compatible_with_reference" + comparable_data_2_generator + (fun (Ex_comparable_data_2 (ty, x, y)) -> + qcheck_compare_comparable + ~expected:(reference_compare_comparable ty x y) + ty + x + y) + +(* Test. + * Tests that compare_comparable returns 0 iff packing then comparing the + * resulting bytes returns 0. + *) +let test_compatible_with_packing = + QCheck2.Test.make + ~name:"compatible_with_packing" + comparable_data_2_generator + (fun (Ex_comparable_data_2 (ty, x, y)) -> + qcheck_compare_comparable_eq + ~expected:(compare_through_pack ty x y) + ty + x + y) + +(* Test. + * Tests that compare_comparable is reflexive. + *) +let test_reflexivity = + QCheck2.Test.make + ~name:"reflexivity" + comparable_data_generator + (fun (Ex_comparable_data (ty, x)) -> + qcheck_compare_comparable ~expected:0 ty x x) + +(* Test. + * Tests that compare_comparable is symmetric. + *) +let test_symmetry = + QCheck2.Test.make + ~name:"symmetry" + comparable_data_2_generator + (fun (Ex_comparable_data_2 (ty, x, y)) -> + qcheck_compare_comparable + ~expected:(-Script_comparable.compare_comparable ty x y) + ty + y + x) + +(* Test. + * Tests that compare_comparable is transitive. + *) +let test_transitivity = + QCheck2.Test.make + ~name:"transitivity" + comparable_data_3_generator + (fun (Ex_comparable_data_3 (ty, x, y, z)) -> + let cxy = Script_comparable.compare_comparable ty x y in + let cyz = Script_comparable.compare_comparable ty y z in + match (cxy, cyz) with + | 0, n | n, 0 -> qcheck_compare_comparable ~expected:n ty x z + | -1, -1 -> qcheck_compare_comparable ~expected:(-1) ty x z + | 1, 1 -> qcheck_compare_comparable ~expected:1 ty x z + | _ -> QCheck2.assume_fail ()) + +(* Test. + * Tests the round-trip property for PACK and UNPACK (modulo compare_comparable). + *) +let test_pack_unpack = + QCheck2.Test.make + ~count:100_000 + (* We run this test on many more cases than the default (100) because this + is a very important property. Packing and then unpacking happens each + time data is sent from a contract to another and also each time storage + is saved at the end of a smart contract call and restored at the next + call of the same contract. Also, injectivity of packing (which is a + direct consequence of this) is an important property for big maps + (because the keys are packed and then hashed). *) + ~name:"pack_unpack" + comparable_data_generator + (fun (Ex_comparable_data (ty, x)) -> + let oty = + match option_t (-1) ty with Ok ty -> ty | Error _ -> assert false + in + qcheck_eq + ~cmp:(Script_comparable.compare_comparable oty) + ~pp:(pp_comparable_data oty) + (Some x) + (unpack_comparable_data ty (pack_comparable_data ty x))) + +let () = + Alcotest.run + "protocol > pbt > script_comparison" + [ + ("compatible_with_reference", qcheck_wrap [test_compatible_with_reference]); + ("compatible_with_packing", qcheck_wrap [test_compatible_with_packing]); + ("reflexivity", qcheck_wrap [test_reflexivity]); + ("symmetry", qcheck_wrap [test_symmetry]); + ("transitivity", qcheck_wrap [test_transitivity]); + ("pack_unpack", qcheck_wrap [test_pack_unpack]); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml new file mode 100644 index 000000000000..035bff33e6db --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml @@ -0,0 +1,136 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.exe + Subject: Operations in Tez_repr +*) + +open Protocol.Alpha_context +open Test_tez + +let z_mutez_min = Z.zero + +let z_mutez_max = Z.of_int64 Int64.max_int + +let tez_to_z (tez : Tez.t) : Z.t = Z.of_int64 (Tez.to_mutez tez) + +let z_in_mutez_bounds (z : Z.t) : bool = + Z.Compare.(z_mutez_min <= z && z <= z_mutez_max) + +let compare (c' : Z.t) (c : Tez.t tzresult) : bool = + match (z_in_mutez_bounds @@ c', c) with + | true, Ok c -> + Lib_test.Qcheck2_helpers.qcheck_eq' + ~pp:Z.pp_print + ~expected:c' + ~actual:(tez_to_z c) + () + | true, Error _ -> + QCheck2.Test.fail_reportf + "@[<h 0>Results are in Z bounds, but tez operation fails.@]" + | false, Ok _ -> + QCheck2.Test.fail_reportf + "@[<h 0>Results are not in Z bounds, but tez operation did not fail.@]" + | false, Error _ -> true + +(* [prop_binop f f' (a, b)] compares the function [f] in Tez with a model + function function [f'] in [Z]. + + If [f' a' b'] falls outside Tez bounds, it is true if [f a b] has + failed. If not, it it is true if [f a b = f' a' b'] where [a'] + (resp. [b']) are [a] (resp. [b']) in [Z]. *) +let prop_binop (f : Tez.t -> Tez.t -> Tez.t tzresult) (f' : Z.t -> Z.t -> Z.t) + ((a, b) : Tez.t * Tez.t) : bool = + compare (f' (tez_to_z a) (tez_to_z b)) (f a b) + +(* [prop_binop64 f f' (a, b)] is as [prop_binop] but for binary operations + where the second operand is of type [int64]. *) +let prop_binop64 (f : Tez.t -> int64 -> Tez.t tzresult) (f' : Z.t -> Z.t -> Z.t) + ((a, b) : Tez.t * int64) : bool = + compare (f' (tez_to_z a) (Z.of_int64 b)) (f a b) + +(** Generator for int64 by conversion from int32 *) +let gen_int64_of32 : int64 QCheck2.Gen.t = + QCheck2.Gen.(map Int64.of_int32 int32) + +(** Generator for int64 mixing small positive integers, + int64s from int32 and arbitrary int64 with equal frequency *) +let gen_int64_sizes : int64 QCheck2.Gen.t = + let open QCheck2.Gen in + oneof [map Int64.of_int (int_range (-10) 10); gen_int64_of32; int64] + +(** Generator for positive int64, mixing small positive integers, + int64s from int32 and arbitrary int64 with equal frequency *) +let gen_ui64_sizes : int64 QCheck2.Gen.t = + let open QCheck2.Gen in + map + (fun i -> + let v = if i = Int64.min_int then Int64.max_int else Int64.abs i in + assert (v >= 0L) ; + v) + gen_int64_sizes + +(** Generator for tez based on [gen_tez_sizes] *) +let gen_tez_sizes = + let open QCheck2.Gen in + map Tez.of_mutez_exn gen_ui64_sizes + +let test_coherent_mul = + QCheck2.Test.make + ~name:"Tez.(*?) is coherent w.r.t. Z.(*)" + QCheck2.Gen.(pair gen_tez_sizes gen_ui64_sizes) + (prop_binop64 ( *? ) Z.( * )) + +let test_coherent_sub = + QCheck2.Test.make + ~name:"Tez.(-?) is coherent w.r.t. Z.(-)" + QCheck2.Gen.(pair gen_tez_sizes gen_tez_sizes) + (prop_binop ( -? ) Z.( - )) + +let test_coherent_add = + QCheck2.Test.make + ~name:"Tez.(+?) is coherent w.r.t. Z.(+)" + QCheck2.Gen.(pair gen_tez_sizes gen_tez_sizes) + (prop_binop ( +? ) Z.( + )) + +let test_coherent_div = + QCheck2.Test.make + ~name:"Tez.(/?) is coherent w.r.t. Z.(/)" + QCheck2.Gen.(pair gen_tez_sizes gen_ui64_sizes) + (fun (a, b) -> + QCheck2.assume (b > 0L) ; + prop_binop64 ( /? ) Z.( / ) (a, b)) + +let tests = + [test_coherent_mul; test_coherent_sub; test_coherent_add; test_coherent_div] + +let () = + Alcotest.run + "protocol > pbt > tez_repr" + [("Tez_repr", Lib_test.Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml new file mode 100644 index 000000000000..440ffd952908 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -0,0 +1,300 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.exe + Subject: Tx rollup l2 encoding +*) + +open Lib_test.Qcheck2_helpers +open Protocol.Indexable +open Protocol.Tx_rollup_l2_batch +open Protocol.Tx_rollup_l2_apply + +(* ------ generators and compact encodings ---------------------------------- *) + +let seed_gen = bytes_fixed_gen 32 + +let l2_address, bls_pk = + (* Generating byte sequences in Qcheck2 is slow. We hard code one + 32byte IKMs: *) + let ikm = + `Hex "8fee216367c463821f82c942a1cee3a01469b1da782736ca269a2accea6e0cc4" + |> Hex.to_bytes_exn + in + let pkh, public_key, _secret_key = + Tezos_crypto.Bls.generate_key ~seed:ikm () + in + (pkh, public_key) + +let signer_gen : Signer_indexable.either QCheck2.Gen.t = + let open QCheck2.Gen in + frequency + [ + (1, return @@ from_value (Bls_pk bls_pk)); + (5, return @@ from_value (L2_addr l2_address)); + (4, from_index_exn <$> ui32); + ] + +let signer_index_gen : Signer_indexable.index QCheck2.Gen.t = + let open QCheck2.Gen in + (fun x -> Protocol.Indexable.index_exn x) <$> ui32 + +let idx_l2_address_idx_gen = + let open QCheck2.Gen in + from_index_exn <$> ui32 + +let idx_l2_address_value = from_value l2_address + +let idx_l2_address_gen = + let open QCheck2.Gen in + oneof [idx_l2_address_idx_gen; return idx_l2_address_value] + +let public_key_hash = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" + +let public_key_hash_gen = + let open QCheck2.Gen in + let+ seed = seed_gen in + let pkh, _, _ = Tx_rollup_l2_helpers.gen_l1_address ~seed () in + pkh + +let ticket_hash : Protocol.Alpha_context.Ticket_hash.t = + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2592 + we could introduce a bit more randomness here *) + let ticketer_b58 = "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" in + let ticketer_pkh = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn ticketer_b58 + in + let ticketer = Protocol.Alpha_context.Contract.Implicit ticketer_pkh in + Tx_rollup_l2_helpers.make_unit_ticket_key ticketer l2_address + +let idx_ticket_hash_idx_gen : + Protocol.Alpha_context.Ticket_hash.t either QCheck2.Gen.t = + let open QCheck2.Gen in + from_index_exn <$> ui32 + +let idx_ticket_hash_value : Protocol.Alpha_context.Ticket_hash.t either = + from_value ticket_hash + +let idx_ticket_hash_gen : + Protocol.Alpha_context.Ticket_hash.t either QCheck2.Gen.t = + let open QCheck2.Gen in + oneof [idx_ticket_hash_idx_gen; return idx_ticket_hash_value] + +let qty_gen = + let open QCheck2.Gen in + Protocol.Tx_rollup_l2_qty.of_int64_exn + <$> graft_corners ui64 [0L; 1L; 2L; Int64.max_int] () + +let v1_withdraw_gen = + let open QCheck2.Gen in + let+ destination = public_key_hash_gen and+ qty = qty_gen in + V1.Withdraw {destination; ticket_hash; qty} + +let v1_transfer_gen = + let open QCheck2.Gen in + let+ destination = idx_l2_address_gen + and+ ticket_hash = idx_ticket_hash_gen + and+ qty = qty_gen in + V1.Transfer {destination; ticket_hash; qty} + +let v1_operation_content_gen = + QCheck2.Gen.oneof [v1_withdraw_gen; v1_transfer_gen] + +let v1_operation_gen = + let open QCheck2.Gen in + let+ signer = signer_gen + and+ counter = Int64.of_int <$> int + and+ contents = small_list v1_operation_content_gen in + V1.{signer; counter; contents} + +let v1_transaction_gen = + let open QCheck2.Gen in + small_list v1_operation_gen + +let v1_batch = + let open QCheck2.Gen in + let+ contents = small_list v1_transaction_gen in + (* This it not ideal as we do not use the QCheck2 seed. We need + valid bytes since the signature encoding is "safe" and accept + only valid signatures. However, it should not impact the + tests here as the bytes length stays the same. *) + let bytes = Bls12_381.G2.(to_compressed_bytes (random ())) in + let aggregated_signature = + Bls12_381_signature.MinPk.unsafe_signature_of_bytes bytes + in + V1.{aggregated_signature; contents} + +let batch = + let open QCheck2.Gen in + (fun batch -> V1 batch) <$> v1_batch + +let indexes_gen = + let open QCheck2.Gen in + let ticket_hash_gen = + match Tx_rollup_l2_helpers.gen_n_ticket_hash 1 with + | [ticket] -> pure ticket + | _ -> assert false + in + let* address_indexes = + small_list + (pair (return l2_address) (map Protocol.Indexable.index_exn ui32)) + in + let+ ticket_indexes = + small_list (pair ticket_hash_gen (map Protocol.Indexable.index_exn ui32)) + in + {address_indexes; ticket_indexes} + +let deposit_result_gen = + let open QCheck2.Gen in + let open Message_result in + let success = + let+ indexes = indexes_gen in + Deposit_success indexes + in + (* We do no test here the encodings for every errors *) + let failure = + let error = Protocol.Tx_rollup_l2_apply.Incorrect_aggregated_signature in + pure (Deposit_failure error) + in + let+ result = oneof [success; failure] in + Deposit_result result + +(** This is a particular transaction generator, the signers are provided + with indexes only. *) +let v1_transaction_index_signer_gen : + (index_only, unknown) V1.transaction QCheck2.Gen.t = + let open QCheck2.Gen in + let operation_signer_index_gen = + let+ signer = signer_index_gen + and+ counter = Int64.of_int <$> int + and+ contents = small_list v1_operation_content_gen in + V1.{signer; counter; contents} + in + small_list operation_signer_index_gen + +let transaction_result_gen = + let open QCheck2.Gen in + let open Message_result in + let success = pure Transaction_success in + let failure = + let reason = Protocol.Tx_rollup_l2_apply.Incorrect_aggregated_signature in + let+ index = small_nat in + Transaction_failure {index; reason} + in + oneof [success; failure] + +let batch_v1_result_gen : Message_result.Batch_V1.t QCheck2.Gen.t = + let open QCheck2.Gen in + let* results = + small_list (pair v1_transaction_index_signer_gen transaction_result_gen) + in + let+ indexes = indexes_gen in + Message_result.Batch_V1.Batch_result {results; indexes} + +let message_result : Message_result.message_result QCheck2.Gen.t = + let open QCheck2.Gen in + let open Message_result in + let batch_v1_result_gen = + let+ result = batch_v1_result_gen in + Batch_V1_result result + in + frequency [(2, deposit_result_gen); (8, batch_v1_result_gen)] + +let withdrawal : Protocol.Alpha_context.Tx_rollup_withdraw.t QCheck2.Gen.t = + let open QCheck2.Gen in + let open Protocol.Alpha_context.Tx_rollup_withdraw in + let claimer = public_key_hash in + let* amount = qty_gen in + return {claimer; ticket_hash; amount} + +let message_result_withdrawal : Message_result.t QCheck2.Gen.t = + let open QCheck2.Gen in + let+ mres = message_result and+ withdrawals = list withdrawal in + (mres, withdrawals) + +(* ------ test template ----------------------------------------------------- *) + +let test_quantity ~count = + let open Protocol in + let open QCheck2.Gen in + let op_gen = oneofl [`Sub; `Add] in + let test_gen = triple op_gen qty_gen qty_gen in + let print (op, q1, q2) = + Format.asprintf + "%a %s %a" + Tx_rollup_l2_qty.pp + q1 + (match op with `Add -> "+" | `Sub -> "-") + Tx_rollup_l2_qty.pp + q2 + in + let test (op, q1, q2) = + let f_op = + match op with + | `Sub -> Tx_rollup_l2_qty.sub + | `Add -> Tx_rollup_l2_qty.add + in + match f_op q1 q2 with + | Some q -> Tx_rollup_l2_qty.(q >= zero) + | None -> ( + match op with + | `Sub -> Tx_rollup_l2_qty.(q2 > q1) + | `Add -> + Int64.add + (Tx_rollup_l2_qty.to_int64 q1) + (Tx_rollup_l2_qty.to_int64 q2) + < 0L) + in + QCheck2.Test.make ~count ~print ~name:"quantity operation" test_gen test + +let () = + let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in + Alcotest.run + "Compact_encoding" + [ + ("quantity", qcheck_wrap [test_quantity ~count:100_000]); + ( "roundtrip", + qcheck_wrap + [ + test_roundtrip + ~count:100 + ~title:"batch" + ~gen:batch + ~eq:( = ) + Protocol.Tx_rollup_l2_batch.encoding; + test_roundtrip + ~count:100 + ~title:"message_result" + ~gen:message_result_withdrawal + ~eq:( = ) + Protocol.Tx_rollup_l2_apply.Message_result.encoding; + ] ); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml new file mode 100644 index 000000000000..68b7e0daaa72 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml @@ -0,0 +1,229 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.exe + Subject: Zk rollup encodings +*) + +open Protocol +open QCheck2 +open Lib_test.Qcheck2_helpers + +(* Generators *) + +let gen_zkr_address = + let open Gen in + let+ bytes = bytes_fixed_gen Zk_rollup_repr.Address.size in + Zk_rollup_repr.Address.of_bytes_exn bytes + +let gen_scalar = + let s = Bls12_381.Fr.random () in + Gen.return s + +let gen_l2_state = + let open Gen in + array gen_scalar + +(* Number of operations in each private batch *) +let batch_size = 10 + +(* We use fixed values for Plonk types, because it's interface + doesn't expose a quick and safe way to create them randomly. *) +module Operator = Dummy_zk_rollup.Operator (struct + let batch_size = batch_size +end) + +let nat64 = int64_range_gen 0L Int64.max_int + +let gen_zkr_account = + let open Gen in + let open Zk_rollup_account_repr in + let* state = gen_l2_state in + let public_parameters = Operator.public_parameters in + let circuits_info = SMap.of_seq (Plonk.SMap.to_seq Operator.circuits) in + let* nb_ops = nat in + let static = + { + public_parameters; + state_length = Array.length state; + circuits_info; + nb_ops; + } + in + let* paid_l2_operations_storage_space = nat in + let+ used_l2_operations_storage_space = + map Z.of_int @@ int_bound paid_l2_operations_storage_space + in + let dynamic = + { + state; + paid_l2_operations_storage_space = + Z.of_int paid_l2_operations_storage_space; + used_l2_operations_storage_space; + } + in + {static; dynamic} + +let gen_ticket_hash = + let open Gen in + let+ bytes = bytes_fixed_gen Script_expr_hash.size in + Ticket_hash_repr.of_bytes_exn bytes + +let gen_pkh = + let pkh, _, _ = Tezos_crypto.Signature.generate_key ~algo:Ed25519 () in + Gen.return pkh + +let gen_z = + let open Gen in + sized @@ fun n -> map Z.of_bits (string_size (return n)) + +let gen_l2_op = + let open Gen in + let* op_code = nat in + let* price = + map2 + (fun id amount -> Zk_rollup_operation_repr.{id; amount}) + gen_ticket_hash + gen_z + in + let* l1_dst = gen_pkh in + let* rollup_id = gen_zkr_address in + let+ payload = array gen_scalar in + Zk_rollup_operation_repr.{op_code; price; l1_dst; rollup_id; payload} + +let gen_pending_list = + let open Gen in + let open Zk_rollup_repr in + let of_length next_index = function + | 0 -> Empty {next_index} + | length -> Pending {next_index; length} + in + map2 of_length nat64 uint16 + +(* Data-encoding roundtrip tests *) + +let test_roundtrip_address = + test_roundtrip + ~count:1_000 + ~title:"Zk_rollup.t" + ~gen:gen_zkr_address + ~eq:( = ) + Zk_rollup_repr.Address.encoding + +let test_roundtrip_state = + test_roundtrip + ~count:1_000 + ~title:"Zk_rollup_state_repr.t" + ~gen:gen_l2_state + ~eq:( = ) + Zk_rollup_state_repr.encoding + +let eq_account acc0 acc1 = + let open Zk_rollup_account_repr in + let pp_to_bytes pp = + Data_encoding.Binary.to_bytes_exn + Environment.Plonk.public_parameters_encoding + pp + in + acc0.dynamic = acc1.dynamic + && acc0.static.state_length = acc1.static.state_length + && acc0.static.circuits_info = acc1.static.circuits_info + && acc0.static.nb_ops = acc1.static.nb_ops + && pp_to_bytes acc0.static.public_parameters + = pp_to_bytes acc1.static.public_parameters + +let test_roundtrip_account = + test_roundtrip + ~count:1_000 + ~title:"Zk_rollup_account_repr.t" + ~gen:gen_zkr_account + ~eq:eq_account + Zk_rollup_account_repr.encoding + +let test_roundtrip_operation = + test_roundtrip + ~count:1_000 + ~title:"Zk_rollup_operation_repr.t" + ~gen:gen_l2_op + ~eq:( = ) + Zk_rollup_operation_repr.encoding + +let test_roundtrip_pending_list = + test_roundtrip + ~count:1_000 + ~title:"Zk_rollup_repr.pending_list" + ~gen:gen_pending_list + ~eq:( = ) + Zk_rollup_repr.pending_list_encoding + +let tests_roundtrip = + [ + test_roundtrip_address; + test_roundtrip_state; + test_roundtrip_account; + test_roundtrip_operation; + test_roundtrip_pending_list; + ] + +(* Scalar conversion tests *) + +let test_to_scalar ~count ~title ~gen to_scalar = + QCheck2.Test.make + ~count + ~name:(Format.asprintf "to_scalar %s" title) + gen + (fun input -> + try + ignore @@ to_scalar input ; + true + with _ -> false) + +let test_address_to_scalar = + test_to_scalar + ~count:1_000 + ~title:"Zk_rollup_repr.t" + ~gen:gen_zkr_address + Zk_rollup_repr.to_scalar + +let test_operation_to_scalar = + test_to_scalar + ~count:1_000 + ~title:"Zk_rollup_operation.t" + ~gen:gen_l2_op + Zk_rollup_operation_repr.to_scalar_array + +let tests_to_scalar = [test_address_to_scalar; test_operation_to_scalar] + +let () = + Alcotest.run + "ZK rollup encoding" + [ + ("roundtrip", qcheck_wrap tests_roundtrip); + ("to_scalar", qcheck_wrap tests_to_scalar); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/accounts.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/accounts.tz new file mode 100644 index 000000000000..e18e30ac5d57 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/accounts.tz @@ -0,0 +1,67 @@ +{ parameter + (or (key_hash %Initialize) + (pair %Withdraw (key %from) (pair (mutez %withdraw_amount) (signature %sig)))) ; + storage (map :stored_balance key_hash mutez) ; + code { DUP ; + CAR ; + IF_LEFT + { DUP ; + DIP 2 { CDR %stored_balance ; DUP } ; + DIP { SWAP } ; + GET @opt_prev_balance ; + { IF_NONE + { DIP { AMOUNT ; SOME } ; UPDATE ; NIL operation ; PAIR } + { RENAME @previous_balance ; + AMOUNT ; + ADD ; + SOME ; + SWAP ; + UPDATE ; + NIL operation ; + PAIR } } } + { DUP ; + DUP ; + DUP ; + DUP ; + CAR %from ; + DIP 2 + { { CDR ; CAR %withdraw_amount } ; PACK ; BLAKE2B @signed_amount } ; + DIP { { CDR ; CDR %sig } } ; + CHECK_SIGNATURE ; + IF {} { PUSH string "Bad signature" ; FAILWITH } ; + DIP 2 { CDR %stored_balance ; DUP } ; + CAR %from ; + HASH_KEY @from_hash ; + DUP ; + DIP { DIP { SWAP } ; SWAP } ; + GET ; + IF_NONE + { PUSH string "Account does not exist" ; PAIR ; FAILWITH } + { RENAME @previous_balance ; + DIP { DROP } ; + DUP ; + DIP 2 { DUP ; { CDR ; CAR %withdraw_amount } ; DUP } ; + DIP { { COMPARE ; LT @not_enough } } ; + SWAP ; + IF { PUSH string "Not enough funds" ; FAILWITH } + { SUB_MUTEZ @new_balance ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + DIP { DUP ; DIP { SWAP } } ; + DUP ; + PUSH @zero mutez 0 ; + { COMPARE ; EQ @null_balance } ; + IF { DROP ; NONE @new_balance mutez } { SOME @new_balance } ; + SWAP ; + CAR %from ; + HASH_KEY @from_hash ; + UPDATE ; + SWAP ; + DUP ; + { CDR ; CAR %withdraw_amount } ; + DIP { CAR %from ; HASH_KEY @from_hash ; IMPLICIT_ACCOUNT @from_account } ; + UNIT ; + TRANSFER_TOKENS @withdraw_transfer_op ; + NIL operation ; + SWAP ; + CONS ; + PAIR } } } } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/append.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/append.tz new file mode 100644 index 000000000000..7e57150a302e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/append.tz @@ -0,0 +1,10 @@ +{ parameter (pair (list int) (list int)) ; + storage (list int) ; + code { CAR ; + UNPAIR ; + NIL int ; + SWAP ; + ITER { CONS } ; + ITER { CONS } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/auction.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/auction.tz new file mode 100644 index 000000000000..cc5d87f8cbec --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/auction.tz @@ -0,0 +1,30 @@ +{ parameter key_hash ; + storage (pair timestamp (pair mutez key_hash)) ; + code { DUP ; + { CDR ; CAR } ; + DUP ; + NOW ; + { COMPARE ; GT } ; + IF { { UNIT ; FAILWITH } } {} ; + SWAP ; + DUP ; + CAR ; + DIP { { CDR ; CDR } } ; + AMOUNT ; + PAIR ; + SWAP ; + DIP { SWAP ; PAIR } ; + DUP ; + CAR ; + AMOUNT ; + { COMPARE ; LE } ; + IF { { UNIT ; FAILWITH } } {} ; + DUP ; + CAR ; + DIP { CDR ; IMPLICIT_ACCOUNT } ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/big_map_union.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/big_map_union.tz new file mode 100644 index 000000000000..c50e2e1d130a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/big_map_union.tz @@ -0,0 +1,14 @@ +{ parameter (list (pair string int)) ; + storage (pair (big_map string int) unit) ; + code { { UNPAIR ; DIP { UNPAIR } } ; + ITER { UNPAIR ; + DUP 3 ; + DUP 2 ; + GET ; + IF_NONE { PUSH int 0 } {} ; + SWAP ; + DIP { ADD ; SOME } ; + UPDATE } ; + PAIR ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/check_signature.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/check_signature.tz new file mode 100644 index 000000000000..35ca4070d450 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/check_signature.tz @@ -0,0 +1,11 @@ +{ parameter key ; + storage (pair signature string) ; + code { DUP ; + DUP ; + DIP { CDR ; DUP ; CAR ; DIP { CDR ; PACK } } ; + CAR ; + CHECK_SIGNATURE ; + IF {} { { UNIT ; FAILWITH } } ; + CDR ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-get.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-get.tz new file mode 100644 index 000000000000..7a6f7b6a361a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-get.tz @@ -0,0 +1,27 @@ +{ parameter (pair nat nat nat unit) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + PUSH nat 1 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + GET 1 ; + PUSH nat 1 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + GET 3 ; + PUSH nat 4 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + GET 5 ; + PUSH nat 2 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + GET 6 ; + UNIT ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-set.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-set.tz new file mode 100644 index 000000000000..a8c1dc5c2e7f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/comb-set.tz @@ -0,0 +1,13 @@ +{ parameter unit ; + storage (pair nat nat nat unit) ; + code { CDR ; + PUSH nat 2 ; + UPDATE 1 ; + PUSH nat 12 ; + UPDATE 3 ; + PUSH nat 8 ; + UPDATE 5 ; + UNIT ; + UPDATE 6 ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/concat.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/concat.tz new file mode 100644 index 000000000000..ffc97335652b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/concat.tz @@ -0,0 +1,9 @@ +{ parameter string ; + storage string ; + code { DUP ; + DIP { CDR ; NIL string ; SWAP ; CONS } ; + CAR ; + CONS ; + CONCAT ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/conditionals.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/conditionals.tz new file mode 100644 index 000000000000..7eea2f774d76 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/conditionals.tz @@ -0,0 +1,12 @@ +{ parameter (or string (option int)) ; + storage string ; + code { CAR ; + IF_LEFT + {} + { IF_NONE + { { UNIT ; FAILWITH } } + { PUSH int 0 ; + { COMPARE ; GT } ; + IF { { UNIT ; FAILWITH } } { PUSH string "" } } } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/cps_fact.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/cps_fact.tz new file mode 100644 index 000000000000..58a77dd722e8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/cps_fact.tz @@ -0,0 +1,28 @@ +{ storage nat ; + parameter nat ; + code { UNPAIR ; + DIP { SELF ; + ADDRESS ; + SENDER ; + { COMPARE ; EQ ; IF {} { DROP ; PUSH @storage nat 1 } } } ; + DUP ; + PUSH nat 1 ; + { COMPARE ; + GE ; + IF { DROP ; NIL operation ; PAIR } + { PUSH nat 1 ; + SWAP ; + SUB @parameter ; + ISNAT ; + IF_NONE + { NIL operation ; PAIR } + { DUP ; + DIP { PUSH nat 1 ; ADD ; MUL @storage } ; + SWAP ; + DIP { DIP { SELF ; PUSH mutez 0 } ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS } ; + SWAP ; + PAIR } } } } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dign.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dign.tz new file mode 100644 index 000000000000..bb325b83d979 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dign.tz @@ -0,0 +1,11 @@ +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + DIG 4 ; + DIP { DROP ; DROP ; DROP ; DROP } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dipn.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dipn.tz new file mode 100644 index 000000000000..a320bd5b60aa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dipn.tz @@ -0,0 +1,15 @@ +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + DIP 5 { PUSH nat 6 } ; + DROP ; + DROP ; + DROP ; + DROP ; + DROP ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dugn.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dugn.tz new file mode 100644 index 000000000000..17c3aba6949a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/dugn.tz @@ -0,0 +1,14 @@ +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + UNPAIR ; + DUG 4 ; + DROP ; + DROP ; + DROP ; + DROP ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ediv.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ediv.tz new file mode 100644 index 000000000000..018ee512ff47 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ediv.tz @@ -0,0 +1,28 @@ +{ parameter (pair int int) ; + storage + (pair (option (pair int nat)) + (option (pair int nat)) + (option (pair int nat)) + (option (pair nat nat))) ; + code { CAR ; + DUP ; + UNPAIR ; + ABS ; + DIP { ABS } ; + EDIV ; + SWAP ; + DUP ; + UNPAIR ; + ABS ; + EDIV ; + SWAP ; + DUP ; + UNPAIR ; + DIP { ABS } ; + EDIV ; + SWAP ; + UNPAIR ; + EDIV ; + { DIP 2 { PAIR } ; DIP { PAIR } ; PAIR } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/faucet.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/faucet.tz new file mode 100644 index 000000000000..00c69a330a69 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/faucet.tz @@ -0,0 +1,17 @@ +{ parameter key_hash ; + storage timestamp ; + code { UNPAIR ; + SWAP ; + PUSH int 300 ; + ADD @FIVE_MINUTES_LATER ; + NOW ; + { { COMPARE ; GE } ; IF {} { { UNIT ; FAILWITH } } } ; + IMPLICIT_ACCOUNT ; + PUSH mutez 1000000 ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + DIP { NOW } ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/get_and_update_map.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/get_and_update_map.tz new file mode 100644 index 000000000000..ec3bcd0f60b5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/get_and_update_map.tz @@ -0,0 +1,7 @@ +{ parameter string ; + storage (pair (option nat) (map string nat)) ; + code { { UNPAIR ; DIP { UNPAIR } } ; + GET_AND_UPDATE ; + PAIR ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/if.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/if.tz new file mode 100644 index 000000000000..0b9e463b6440 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/if.tz @@ -0,0 +1,7 @@ +{ parameter bool ; + storage (option bool) ; + code { CAR ; + IF { PUSH bool True } { PUSH bool False } ; + SOME ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/insertion_sort.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/insertion_sort.tz new file mode 100644 index 000000000000..79f41696956f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/insertion_sort.tz @@ -0,0 +1,21 @@ +{ parameter (list int) ; + storage (list int) ; + code { CAR ; + NIL int ; + SWAP ; + ITER { SWAP ; + DIP 2 { NIL int } ; + PUSH bool True ; + LOOP { IF_CONS + { SWAP ; + DIP { DUP ; DIP 2 { DUP } ; DIP { { COMPARE ; LT } } ; SWAP } ; + SWAP ; + IF { DIP { SWAP ; DIP { CONS } } ; PUSH bool True } + { SWAP ; CONS ; PUSH bool False } } + { NIL int ; PUSH bool False } } ; + SWAP ; + CONS ; + SWAP ; + ITER { CONS } } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/list_map_block.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/list_map_block.tz new file mode 100644 index 000000000000..f2f66dd30766 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/list_map_block.tz @@ -0,0 +1,9 @@ +{ parameter (list int) ; + storage (list int) ; + code { CAR ; + PUSH int 0 ; + SWAP ; + MAP { DIP { DUP } ; ADD ; DIP { PUSH int 1 ; ADD } } ; + NIL operation ; + PAIR ; + DIP { DROP } } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/loop_left.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/loop_left.tz new file mode 100644 index 000000000000..d491a1b32920 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/loop_left.tz @@ -0,0 +1,16 @@ +{ parameter (list string) ; + storage (list string) ; + code { CAR ; + NIL string ; + SWAP ; + PAIR ; + LEFT (list string) ; + LOOP_LEFT + { DUP ; + CAR ; + DIP { CDR } ; + IF_CONS + { SWAP ; DIP { CONS } ; PAIR ; LEFT (list string) } + { RIGHT (pair (list string) (list string)) } } ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/opt_map.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/opt_map.tz new file mode 100644 index 000000000000..51feb91f44ac --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/opt_map.tz @@ -0,0 +1,12 @@ +{ + parameter int; + storage (option int); + code { + UNPAIR; + SWAP ; + MAP { DIP { DUP } ; ADD ; } ; + DIP { DROP } ; + NIL operation ; + PAIR ; + } +} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/packunpack.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/packunpack.tz new file mode 100644 index 000000000000..8f08146fe0b6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/packunpack.tz @@ -0,0 +1,13 @@ +{ parameter (pair (pair (pair string (list int)) (set nat)) bytes) ; + storage unit ; + code { CAR ; + UNPAIR ; + DIP { DUP } ; + PACK ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + UNPACK (pair (pair string (list int)) (set nat)) ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/pexec.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/pexec.tz new file mode 100644 index 000000000000..9211a7b9c7a0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/pexec.tz @@ -0,0 +1,9 @@ +{ parameter nat ; + storage nat ; + code { LAMBDA (pair nat nat) nat { UNPAIR ; ADD } ; + SWAP ; + UNPAIR ; + DIP { APPLY } ; + EXEC ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/rec_id_unit.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/rec_id_unit.tz new file mode 100644 index 000000000000..ae143d1c2a8a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/rec_id_unit.tz @@ -0,0 +1,9 @@ +{parameter unit; + storage unit; + code { CAR ; + LAMBDA_REC unit unit + {DIP {DROP}}; + SWAP; + EXEC; + NIL operation; + PAIR}} diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/reverse_loop.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/reverse_loop.tz new file mode 100644 index 000000000000..c73aa3408bb1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/reverse_loop.tz @@ -0,0 +1,12 @@ +{ parameter (list string) ; + storage (list string) ; + code { CAR ; + NIL string ; + SWAP ; + PUSH bool True ; + LOOP { IF_CONS + { SWAP ; DIP { CONS } ; PUSH bool True } + { NIL string ; PUSH bool False } } ; + DROP ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/set_delegate.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/set_delegate.tz new file mode 100644 index 000000000000..560682be4b51 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/set_delegate.tz @@ -0,0 +1,3 @@ +{ parameter (option key_hash) ; + storage unit ; + code { UNPAIR ; SET_DELEGATE ; DIP { NIL operation } ; CONS ; PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/shifts.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/shifts.tz new file mode 100644 index 000000000000..94886af646e4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/shifts.tz @@ -0,0 +1,7 @@ +{ parameter (or (pair nat nat) (pair nat nat)) ; + storage (option nat) ; + code { CAR ; + IF_LEFT { UNPAIR ; LSL } { UNPAIR ; LSR } ; + SOME ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/spawn_identities.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/spawn_identities.tz new file mode 100644 index 000000000000..00480de0ef08 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/spawn_identities.tz @@ -0,0 +1,28 @@ +{ parameter nat ; + storage (list address) ; + code { DUP ; + CAR ; + DIP { CDR ; NIL operation } ; + PUSH bool True ; + LOOP { DUP ; + PUSH nat 0 ; + { COMPARE ; EQ } ; + IF { PUSH bool False } + { PUSH nat 1 ; + SWAP ; + SUB ; + ABS ; + PUSH string "init" ; + PUSH mutez 5000000 ; + NONE key_hash ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; + SWAP ; + DIP { SWAP ; DIP { CONS } } ; + SWAP ; + DIP { SWAP ; DIP { CONS } } ; + PUSH bool True } } ; + DROP ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_join.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_join.tz new file mode 100644 index 000000000000..b29c396b8497 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_join.tz @@ -0,0 +1,10 @@ +{ parameter (ticket nat) ; + storage (option (ticket nat)) ; + code { UNPAIR ; + SWAP ; + IF_NONE + {} + { PAIR ; JOIN_TICKETS ; { IF_NONE { { UNIT ; FAILWITH } } {} } } ; + SOME ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_split.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_split.tz new file mode 100644 index 000000000000..817c1711331f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/ticket_split.tz @@ -0,0 +1,21 @@ +{ parameter (ticket nat) ; + storage unit ; + code { CAR ; + PUSH (pair nat nat) (Pair 1 2) ; + SWAP ; + SPLIT_TICKET ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + UNPAIR ; + READ_TICKET ; + { CDR ; CDR } ; + PUSH nat 1 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DROP ; + READ_TICKET ; + { CDR ; CDR } ; + PUSH nat 2 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_fib.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_fib.tz new file mode 100644 index 000000000000..51b308e07948 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_fib.tz @@ -0,0 +1,6 @@ +{ parameter (pair nat address) ; + storage nat ; + code { CAR ; + UNPAIR ; + VIEW "fib" nat ; + { IF_NONE { { UNIT ; FAILWITH } } { NIL operation ; PAIR } } } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_toplevel_lib.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_toplevel_lib.tz new file mode 100644 index 000000000000..4cefa5f7fd62 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/view_toplevel_lib.tz @@ -0,0 +1,80 @@ +{ parameter nat ; + storage nat ; + code { CAR ; NIL operation ; PAIR } ; + view "add" nat nat { UNPAIR ; ADD } ; + view "id" nat (pair nat nat) {} ; + view "test_failwith" nat (pair nat nat) { FAILWITH } ; + view "step_constants" + unit + (pair (pair mutez mutez) (pair (pair address address) address)) + { DROP ; + SOURCE ; + SENDER ; + SELF_ADDRESS ; + PAIR ; + PAIR ; + BALANCE ; + AMOUNT ; + PAIR ; + PAIR } ; + view "succ" + (pair nat address) + nat + { CAR ; + UNPAIR ; + PUSH nat 1 ; + ADD ; + PAIR ; + DUP ; + CDR ; + SWAP ; + VIEW "is_twenty" nat ; + { IF_NONE { { UNIT ; FAILWITH } } {} } } ; + view "is_twenty" + (pair nat address) + nat + { CAR ; + DUP ; + CAR ; + PUSH nat 20 ; + COMPARE ; + EQ ; + IF { CAR } + { DUP ; + CDR ; + SWAP ; + VIEW "succ" nat ; + { IF_NONE { { UNIT ; FAILWITH } } {} } } } ; + view "fib" + nat + nat + { CAR ; + DUP ; + PUSH nat 0 ; + COMPARE ; + EQ ; + IF {} + { DUP ; + PUSH nat 1 ; + COMPARE ; + EQ ; + IF {} + { DUP ; + PUSH nat 1 ; + SWAP ; + SUB ; + ABS ; + SELF_ADDRESS ; + SWAP ; + VIEW "fib" nat ; + { IF_NONE + { { UNIT ; FAILWITH } } + { SWAP ; + PUSH nat 2 ; + SWAP ; + SUB ; + ABS ; + SELF_ADDRESS ; + SWAP ; + VIEW "fib" nat ; + { IF_NONE { { UNIT ; FAILWITH } } { ADD } } } } } } } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/xor.tz b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/xor.tz new file mode 100644 index 000000000000..6989394c9992 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/contracts/xor.tz @@ -0,0 +1,7 @@ +{ parameter (or (pair bool bool) (pair nat nat)) ; + storage (option (or bool nat)) ; + code { CAR ; + IF_LEFT { UNPAIR ; XOR ; LEFT nat } { UNPAIR ; XOR ; RIGHT bool } ; + SOME ; + NIL operation ; + PAIR } } diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/dune b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune new file mode 100644 index 000000000000..fe33ec26904e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune @@ -0,0 +1,47 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name src_proto_alpha_lib_protocol_test_regression_tezt_lib) + (instrumentation (backend bisect_ppx)) + (libraries + tezt.core + tezos-base + tezt-tezos + tezos-protocol-016-PtMumbai + tezos-client-alpha + tezos-protocol-plugin-alpha + tezos-alpha-test-helpers + tezos-micheline) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Tezos_base.TzPervasives + -open Tezt_tezos + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_alpha_test_helpers + -open Tezos_micheline) + (modules test_logging)) + +(executable + (name main) + (libraries + src_proto_alpha_lib_protocol_test_regression_tezt_lib + tezt) + (modules main)) + +(rule + (alias runtezt) + (package tezos-protocol-016-PtMumbai-tests) + (deps + (glob_files contracts/*.tz) + (glob_files expected/test_logging.ml/*.out)) + (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/accounts.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/accounts.out new file mode 100644 index 000000000000..b4fd9e3f86a4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/accounts.out @@ -0,0 +1,166 @@ + +trace + - DUP (interp) @ location: 15 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - DUP (entry) @ location: 15 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/CAR (exit) @ location: 15 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - CAR (entry) @ location: 16 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/IF_LEFT (exit) @ location: 16 + [ (Left "[PUBLIC_KEY_HASH]") + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - IF_LEFT (entry) @ location: 17 + [ (Left "[PUBLIC_KEY_HASH]") + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/DUP (exit) @ location: 17 + [ "[PUBLIC_KEY_HASH]" + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - DUP (entry) @ location: 19 + [ "[PUBLIC_KEY_HASH]" + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/DIP (exit) @ location: 19 + [ "[PUBLIC_KEY_HASH]" + "[PUBLIC_KEY_HASH]" + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - DIP (entry) @ location: 20 + [ "[PUBLIC_KEY_HASH]" + "[PUBLIC_KEY_HASH]" + (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/CDR (exit) @ location: 20 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - CDR (entry) @ location: 23 + [ (Pair (Left "[PUBLIC_KEY_HASH]") {}) ] + - log/DUP (exit) @ location: 23 + [ {} ] + - DUP (entry) @ location: 24 + [ {} ] + - log/[halt] (exit) @ location: 24 + [ {} + {} ] + - [halt] (entry) @ location: 22 + [ {} + {} ] + - control: KCons + - CONST (entry) @ location: 20 + [ {} + {} ] + - log/CONST (exit) @ location: 20 + [ "[PUBLIC_KEY_HASH]" + {} + {} ] + - CONST (entry) @ location: 20 + [ "[PUBLIC_KEY_HASH]" + {} + {} ] + - log/log/log/DIP (exit) @ location: 20 + [ "[PUBLIC_KEY_HASH]" + "[PUBLIC_KEY_HASH]" + {} + {} ] + - log/DIP (exit) @ location: 20 + [ "[PUBLIC_KEY_HASH]" + "[PUBLIC_KEY_HASH]" + {} + {} ] + - DIP (entry) @ location: 25 + [ "[PUBLIC_KEY_HASH]" + "[PUBLIC_KEY_HASH]" + {} + {} ] + - log/SWAP (exit) @ location: 25 + [ "[PUBLIC_KEY_HASH]" + {} + {} ] + - SWAP (entry) @ location: 27 + [ "[PUBLIC_KEY_HASH]" + {} + {} ] + - log/[halt] (exit) @ location: 27 + [ {} + "[PUBLIC_KEY_HASH]" + {} ] + - [halt] (entry) @ location: 27 + [ {} + "[PUBLIC_KEY_HASH]" + {} ] + - control: KUndip + - control: KCons + - log/GET (exit) @ location: 25 + [ "[PUBLIC_KEY_HASH]" + {} + "[PUBLIC_KEY_HASH]" + {} ] + - GET (entry) @ location: 28 + [ "[PUBLIC_KEY_HASH]" + {} + "[PUBLIC_KEY_HASH]" + {} ] + - log/IF_NONE (exit) @ location: 28 + [ None + "[PUBLIC_KEY_HASH]" + {} ] + - IF_NONE (entry) @ location: 30 + [ None + "[PUBLIC_KEY_HASH]" + {} ] + - log/DIP (exit) @ location: 30 + [ "[PUBLIC_KEY_HASH]" + {} ] + - DIP (entry) @ location: 32 + [ "[PUBLIC_KEY_HASH]" + {} ] + - log/AMOUNT (exit) @ location: 32 + [ {} ] + - AMOUNT (entry) @ location: 34 + [ {} ] + - log/SOME (exit) @ location: 34 + [ 0 + {} ] + - SOME (entry) @ location: 35 + [ 0 + {} ] + - log/[halt] (exit) @ location: 35 + [ (Some 0) + {} ] + - [halt] (entry) @ location: 33 + [ (Some 0) + {} ] + - control: KUndip + - control: KCons + - log/UPDATE (exit) @ location: 32 + [ "[PUBLIC_KEY_HASH]" + (Some 0) + {} ] + - UPDATE (entry) @ location: 36 + [ "[PUBLIC_KEY_HASH]" + (Some 0) + {} ] + - log/NIL (exit) @ location: 36 + [ { Elt "[PUBLIC_KEY_HASH]" 0 } ] + - NIL (entry) @ location: 37 + [ { Elt "[PUBLIC_KEY_HASH]" 0 } ] + - log/PAIR (exit) @ location: 37 + [ {} + { Elt "[PUBLIC_KEY_HASH]" 0 } ] + - PAIR (entry) @ location: 39 + [ {} + { Elt "[PUBLIC_KEY_HASH]" 0 } ] + - log/[halt] (exit) @ location: 39 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - [halt] (entry) @ location: 14 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - control: KCons + - log/[halt] (exit) @ location: 30 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - [halt] (entry) @ location: 14 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - control: KCons + - log/[halt] (exit) @ location: 17 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - [halt] (entry) @ location: 14 + [ (Pair {} { Elt "[PUBLIC_KEY_HASH]" 0 }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/append.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/append.out new file mode 100644 index 000000000000..b573fc597191 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/append.out @@ -0,0 +1,135 @@ + +trace + - CAR (interp) @ location: 12 + [ (Pair (Pair { 7 ; 8 ; 9 } { 4 ; 5 ; 6 }) { 1 ; 2 ; 3 }) ] + - CAR (entry) @ location: 12 + [ (Pair (Pair { 7 ; 8 ; 9 } { 4 ; 5 ; 6 }) { 1 ; 2 ; 3 }) ] + - log/UNPAIR (exit) @ location: 12 + [ (Pair { 7 ; 8 ; 9 } { 4 ; 5 ; 6 }) ] + - UNPAIR (entry) @ location: 13 + [ (Pair { 7 ; 8 ; 9 } { 4 ; 5 ; 6 }) ] + - log/NIL (exit) @ location: 13 + [ { 7 ; 8 ; 9 } + { 4 ; 5 ; 6 } ] + - NIL (entry) @ location: 14 + [ { 7 ; 8 ; 9 } + { 4 ; 5 ; 6 } ] + - log/SWAP (exit) @ location: 14 + [ {} + { 7 ; 8 ; 9 } + { 4 ; 5 ; 6 } ] + - SWAP (entry) @ location: 16 + [ {} + { 7 ; 8 ; 9 } + { 4 ; 5 ; 6 } ] + - log/ITER (exit) @ location: 16 + [ { 7 ; 8 ; 9 } + {} + { 4 ; 5 ; 6 } ] + - ITER (entry) @ location: 17 + [ { 7 ; 8 ; 9 } + {} + { 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 17 + [ 7 + {} + { 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 19 + [ 7 + {} + { 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 19 + [ { 7 } + { 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 17 + [ { 7 } + { 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 17 + [ 8 + { 7 } + { 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 19 + [ 8 + { 7 } + { 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 19 + [ { 8 ; 7 } + { 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 17 + [ { 8 ; 7 } + { 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 17 + [ 9 + { 8 ; 7 } + { 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 19 + [ 9 + { 8 ; 7 } + { 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 19 + [ { 9 ; 8 ; 7 } + { 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 17 + [ { 9 ; 8 ; 7 } + { 4 ; 5 ; 6 } ] + - control: KIter + - control: KCons + - log/ITER (exit) @ location: 17 + [ { 9 ; 8 ; 7 } + { 4 ; 5 ; 6 } ] + - ITER (entry) @ location: 20 + [ { 9 ; 8 ; 7 } + { 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 20 + [ 9 + { 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 22 + [ 9 + { 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 22 + [ { 9 ; 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 20 + [ { 9 ; 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 20 + [ 8 + { 9 ; 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 22 + [ 8 + { 9 ; 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 22 + [ { 8 ; 9 ; 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 20 + [ { 8 ; 9 ; 4 ; 5 ; 6 } ] + - control: KIter + - log/CONS (exit) @ location: 20 + [ 7 + { 8 ; 9 ; 4 ; 5 ; 6 } ] + - CONS (entry) @ location: 22 + [ 7 + { 8 ; 9 ; 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 22 + [ { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - [halt] (entry) @ location: 20 + [ { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - control: KIter + - control: KCons + - log/NIL (exit) @ location: 20 + [ { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - NIL (entry) @ location: 23 + [ { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - log/PAIR (exit) @ location: 23 + [ {} + { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - PAIR (entry) @ location: 25 + [ {} + { 7 ; 8 ; 9 ; 4 ; 5 ; 6 } ] + - log/[halt] (exit) @ location: 25 + [ (Pair {} { 7 ; 8 ; 9 ; 4 ; 5 ; 6 }) ] + - [halt] (entry) @ location: 11 + [ (Pair {} { 7 ; 8 ; 9 ; 4 ; 5 ; 6 }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/auction.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/auction.out new file mode 100644 index 000000000000..a99be8ed6597 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/auction.out @@ -0,0 +1,415 @@ + +trace + - DUP (interp) @ location: 11 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - DUP (entry) @ location: 11 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/CDR (exit) @ location: 11 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - CDR (entry) @ location: 13 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/CAR (exit) @ location: 13 + [ (Pair "[TIMESTAMP]" 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - CAR (entry) @ location: 14 + [ (Pair "[TIMESTAMP]" 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/DUP (exit) @ location: 14 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - DUP (entry) @ location: 15 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/NOW (exit) @ location: 15 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - NOW (entry) @ location: 16 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/COMPARE (exit) @ location: 16 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - COMPARE (entry) @ location: 18 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/GT (exit) @ location: 18 + [ -1 + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - GT (entry) @ location: 19 + [ -1 + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/IF (exit) @ location: 19 + [ False + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - IF (entry) @ location: 20 + [ False + "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/[halt] (exit) @ location: 20 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - [halt] (entry) @ location: 26 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - control: KCons + - log/SWAP (exit) @ location: 20 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - SWAP (entry) @ location: 26 + [ "[TIMESTAMP]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") ] + - log/DUP (exit) @ location: 26 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - DUP (entry) @ location: 27 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/CAR (exit) @ location: 27 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - CAR (entry) @ location: 28 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/DIP (exit) @ location: 28 + [ "[PUBLIC_KEY_HASH]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - DIP (entry) @ location: 29 + [ "[PUBLIC_KEY_HASH]" + (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/CDR (exit) @ location: 29 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - CDR (entry) @ location: 32 + [ (Pair "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" + 50000000 + "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/CDR (exit) @ location: 32 + [ (Pair "[TIMESTAMP]" 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - CDR (entry) @ location: 33 + [ (Pair "[TIMESTAMP]" 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/[halt] (exit) @ location: 33 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - [halt] (entry) @ location: 31 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - control: KUndip + - control: KCons + - log/AMOUNT (exit) @ location: 29 + [ "[PUBLIC_KEY_HASH]" + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - AMOUNT (entry) @ location: 34 + [ "[PUBLIC_KEY_HASH]" + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/PAIR (exit) @ location: 34 + [ 100000000 + "[PUBLIC_KEY_HASH]" + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - PAIR (entry) @ location: 35 + [ 100000000 + "[PUBLIC_KEY_HASH]" + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/SWAP (exit) @ location: 35 + [ (Pair 100000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - SWAP (entry) @ location: 36 + [ (Pair 100000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/DIP (exit) @ location: 36 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 100000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - DIP (entry) @ location: 37 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 100000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/SWAP (exit) @ location: 37 + [ (Pair 100000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - SWAP (entry) @ location: 39 + [ (Pair 100000000 "[PUBLIC_KEY_HASH]") + "[TIMESTAMP]" ] + - log/PAIR (exit) @ location: 39 + [ "[TIMESTAMP]" + (Pair 100000000 "[PUBLIC_KEY_HASH]") ] + - PAIR (entry) @ location: 40 + [ "[TIMESTAMP]" + (Pair 100000000 "[PUBLIC_KEY_HASH]") ] + - log/[halt] (exit) @ location: 40 + [ (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - [halt] (entry) @ location: 38 + [ (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - control: KUndip + - control: KCons + - log/DUP (exit) @ location: 37 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - DUP (entry) @ location: 41 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/CAR (exit) @ location: 41 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - CAR (entry) @ location: 42 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/AMOUNT (exit) @ location: 42 + [ 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - AMOUNT (entry) @ location: 43 + [ 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/COMPARE (exit) @ location: 43 + [ 100000000 + 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - COMPARE (entry) @ location: 45 + [ 100000000 + 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/LE (exit) @ location: 45 + [ 1 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - LE (entry) @ location: 46 + [ 1 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/IF (exit) @ location: 46 + [ False + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - IF (entry) @ location: 47 + [ False + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/[halt] (exit) @ location: 47 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - [halt] (entry) @ location: 53 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - control: KCons + - log/DUP (exit) @ location: 47 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - DUP (entry) @ location: 53 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/CAR (exit) @ location: 53 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - CAR (entry) @ location: 54 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/DIP (exit) @ location: 54 + [ 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - DIP (entry) @ location: 55 + [ 50000000 + (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/CDR (exit) @ location: 55 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - CDR (entry) @ location: 57 + [ (Pair 50000000 "[PUBLIC_KEY_HASH]") + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/IMPLICIT_ACCOUNT (exit) @ location: 57 + [ "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - IMPLICIT_ACCOUNT (entry) @ location: 58 + [ "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/[halt] (exit) @ location: 58 + [ "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - [halt] (entry) @ location: 56 + [ "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 55 + [ 50000000 + "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - CONST (entry) @ location: 59 + [ 50000000 + "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/TRANSFER_TOKENS (exit) @ location: 59 + [ Unit + 50000000 + "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - TRANSFER_TOKENS (entry) @ location: 60 + [ Unit + 50000000 + "[PUBLIC_KEY_HASH]" + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/NIL (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - NIL (entry) @ location: 61 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/SWAP (exit) @ location: 61 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - SWAP (entry) @ location: 63 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + {} + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - CONS (entry) @ location: 64 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + {} + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/PAIR (exit) @ location: 64 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - PAIR (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + (Pair "[TIMESTAMP]" 100000000 "[PUBLIC_KEY_HASH]") ] + - log/[halt] (exit) @ location: 65 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]" + 100000000 + "[PUBLIC_KEY_HASH]") ] + - [halt] (entry) @ location: 10 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000180e1eb170000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]" + 100000000 + "[PUBLIC_KEY_HASH]") ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/big_map_union.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/big_map_union.out new file mode 100644 index 000000000000..b02f28c5d6a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/big_map_union.out @@ -0,0 +1,499 @@ + +trace + - UNPAIR (interp) @ location: 15 + [ (Pair { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } { Elt "123" 123 } Unit) ] + - UNPAIR (entry) @ location: 15 + [ (Pair { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } { Elt "123" 123 } Unit) ] + - log/DIP (exit) @ location: 15 + [ { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } + (Pair { Elt "123" 123 } Unit) ] + - DIP (entry) @ location: 16 + [ { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } + (Pair { Elt "123" 123 } Unit) ] + - log/UNPAIR (exit) @ location: 16 + [ (Pair { Elt "123" 123 } Unit) ] + - UNPAIR (entry) @ location: 18 + [ (Pair { Elt "123" 123 } Unit) ] + - log/[halt] (exit) @ location: 18 + [ { Elt "123" 123 } + Unit ] + - [halt] (entry) @ location: 18 + [ { Elt "123" 123 } + Unit ] + - control: KUndip + - control: KCons + - log/ITER (exit) @ location: 16 + [ { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } + { Elt "123" 123 } + Unit ] + - ITER (entry) @ location: 19 + [ { Pair "string" 12 ; Pair "abc" 99 ; Pair "def" 3 } + { Elt "123" 123 } + Unit ] + - control: KIter + - log/UNPAIR (exit) @ location: 19 + [ (Pair "string" 12) + { Elt "123" 123 } + Unit ] + - UNPAIR (entry) @ location: 21 + [ (Pair "string" 12) + { Elt "123" 123 } + Unit ] + - log/DUP (exit) @ location: 21 + [ "string" + 12 + { Elt "123" 123 } + Unit ] + - DUP (entry) @ location: 22 + [ "string" + 12 + { Elt "123" 123 } + Unit ] + - log/DUP (exit) @ location: 22 + [ { Elt "123" 123 } + "string" + 12 + { Elt "123" 123 } + Unit ] + - DUP (entry) @ location: 24 + [ { Elt "123" 123 } + "string" + 12 + { Elt "123" 123 } + Unit ] + - log/GET (exit) @ location: 24 + [ "string" + { Elt "123" 123 } + "string" + 12 + { Elt "123" 123 } + Unit ] + - GET (entry) @ location: 26 + [ "string" + { Elt "123" 123 } + "string" + 12 + { Elt "123" 123 } + Unit ] + - log/IF_NONE (exit) @ location: 26 + [ None + "string" + 12 + { Elt "123" 123 } + Unit ] + - IF_NONE (entry) @ location: 27 + [ None + "string" + 12 + { Elt "123" 123 } + Unit ] + - log/CONST (exit) @ location: 27 + [ "string" + 12 + { Elt "123" 123 } + Unit ] + - CONST (entry) @ location: 29 + [ "string" + 12 + { Elt "123" 123 } + Unit ] + - log/[halt] (exit) @ location: 29 + [ 0 + "string" + 12 + { Elt "123" 123 } + Unit ] + - [halt] (entry) @ location: 33 + [ 0 + "string" + 12 + { Elt "123" 123 } + Unit ] + - control: KCons + - log/SWAP (exit) @ location: 27 + [ 0 + "string" + 12 + { Elt "123" 123 } + Unit ] + - SWAP (entry) @ location: 33 + [ 0 + "string" + 12 + { Elt "123" 123 } + Unit ] + - log/DIP (exit) @ location: 33 + [ "string" + 0 + 12 + { Elt "123" 123 } + Unit ] + - DIP (entry) @ location: 34 + [ "string" + 0 + 12 + { Elt "123" 123 } + Unit ] + - log/ADD (exit) @ location: 34 + [ 0 + 12 + { Elt "123" 123 } + Unit ] + - ADD (entry) @ location: 36 + [ 0 + 12 + { Elt "123" 123 } + Unit ] + - log/SOME (exit) @ location: 36 + [ 12 + { Elt "123" 123 } + Unit ] + - SOME (entry) @ location: 37 + [ 12 + { Elt "123" 123 } + Unit ] + - log/[halt] (exit) @ location: 37 + [ (Some 12) + { Elt "123" 123 } + Unit ] + - [halt] (entry) @ location: 35 + [ (Some 12) + { Elt "123" 123 } + Unit ] + - control: KUndip + - control: KCons + - log/UPDATE (exit) @ location: 34 + [ "string" + (Some 12) + { Elt "123" 123 } + Unit ] + - UPDATE (entry) @ location: 38 + [ "string" + (Some 12) + { Elt "123" 123 } + Unit ] + - log/[halt] (exit) @ location: 38 + [ { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 19 + [ { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - control: KIter + - log/UNPAIR (exit) @ location: 19 + [ (Pair "abc" 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - UNPAIR (entry) @ location: 21 + [ (Pair "abc" 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/DUP (exit) @ location: 21 + [ "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - DUP (entry) @ location: 22 + [ "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/DUP (exit) @ location: 22 + [ { Elt "123" 123 ; Elt "string" 12 } + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - DUP (entry) @ location: 24 + [ { Elt "123" 123 ; Elt "string" 12 } + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/GET (exit) @ location: 24 + [ "abc" + { Elt "123" 123 ; Elt "string" 12 } + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - GET (entry) @ location: 26 + [ "abc" + { Elt "123" 123 ; Elt "string" 12 } + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/IF_NONE (exit) @ location: 26 + [ None + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - IF_NONE (entry) @ location: 27 + [ None + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/CONST (exit) @ location: 27 + [ "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - CONST (entry) @ location: 29 + [ "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 29 + [ 0 + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 33 + [ 0 + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - control: KCons + - log/SWAP (exit) @ location: 27 + [ 0 + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - SWAP (entry) @ location: 33 + [ 0 + "abc" + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/DIP (exit) @ location: 33 + [ "abc" + 0 + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - DIP (entry) @ location: 34 + [ "abc" + 0 + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/ADD (exit) @ location: 34 + [ 0 + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - ADD (entry) @ location: 36 + [ 0 + 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/SOME (exit) @ location: 36 + [ 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - SOME (entry) @ location: 37 + [ 99 + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 37 + [ (Some 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 35 + [ (Some 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - control: KUndip + - control: KCons + - log/UPDATE (exit) @ location: 34 + [ "abc" + (Some 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - UPDATE (entry) @ location: 38 + [ "abc" + (Some 99) + { Elt "123" 123 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 38 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 19 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - control: KIter + - log/UNPAIR (exit) @ location: 19 + [ (Pair "def" 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - UNPAIR (entry) @ location: 21 + [ (Pair "def" 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/DUP (exit) @ location: 21 + [ "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - DUP (entry) @ location: 22 + [ "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/DUP (exit) @ location: 22 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - DUP (entry) @ location: 24 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/GET (exit) @ location: 24 + [ "def" + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - GET (entry) @ location: 26 + [ "def" + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/IF_NONE (exit) @ location: 26 + [ None + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - IF_NONE (entry) @ location: 27 + [ None + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/CONST (exit) @ location: 27 + [ "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - CONST (entry) @ location: 29 + [ "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 29 + [ 0 + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 33 + [ 0 + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - control: KCons + - log/SWAP (exit) @ location: 27 + [ 0 + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - SWAP (entry) @ location: 33 + [ 0 + "def" + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/DIP (exit) @ location: 33 + [ "def" + 0 + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - DIP (entry) @ location: 34 + [ "def" + 0 + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/ADD (exit) @ location: 34 + [ 0 + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - ADD (entry) @ location: 36 + [ 0 + 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/SOME (exit) @ location: 36 + [ 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - SOME (entry) @ location: 37 + [ 3 + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 37 + [ (Some 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 35 + [ (Some 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - control: KUndip + - control: KCons + - log/UPDATE (exit) @ location: 34 + [ "def" + (Some 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - UPDATE (entry) @ location: 38 + [ "def" + (Some 3) + { Elt "123" 123 ; Elt "abc" 99 ; Elt "string" 12 } + Unit ] + - log/[halt] (exit) @ location: 38 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } + Unit ] + - [halt] (entry) @ location: 19 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } + Unit ] + - control: KIter + - control: KCons + - log/PAIR (exit) @ location: 19 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } + Unit ] + - PAIR (entry) @ location: 39 + [ { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } + Unit ] + - log/NIL (exit) @ location: 39 + [ (Pair { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - NIL (entry) @ location: 40 + [ (Pair { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - log/PAIR (exit) @ location: 40 + [ {} + (Pair { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - PAIR (entry) @ location: 42 + [ {} + (Pair { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - log/[halt] (exit) @ location: 42 + [ (Pair {} { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - [halt] (entry) @ location: 13 + [ (Pair {} { Elt "123" 123 ; Elt "abc" 99 ; Elt "def" 3 ; Elt "string" 12 } Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/check_signature.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/check_signature.out new file mode 100644 index 000000000000..c817cebfc749 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/check_signature.out @@ -0,0 +1,230 @@ + +trace + - DUP (interp) @ location: 9 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - DUP (entry) @ location: 9 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/DUP (exit) @ location: 9 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - DUP (entry) @ location: 10 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/DIP (exit) @ location: 10 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - DIP (entry) @ location: 11 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/CDR (exit) @ location: 11 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CDR (entry) @ location: 13 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/DUP (exit) @ location: 13 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - DUP (entry) @ location: 14 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/CAR (exit) @ location: 14 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CAR (entry) @ location: 15 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/DIP (exit) @ location: 15 + [ "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - DIP (entry) @ location: 16 + [ "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/CDR (exit) @ location: 16 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CDR (entry) @ location: 18 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/PACK (exit) @ location: 18 + [ "TEZOS" + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - PACK (entry) @ location: 19 + [ "TEZOS" + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/[halt] (exit) @ location: 19 + [ 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - [halt] (entry) @ location: 17 + [ 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 16 + [ "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - [halt] (entry) @ location: 12 + [ "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - control: KUndip + - control: KCons + - log/CAR (exit) @ location: 11 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CAR (entry) @ location: 20 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/CHECK_SIGNATURE (exit) @ location: 20 + [ "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CHECK_SIGNATURE (entry) @ location: 21 + [ "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + 0x05010000000554455a4f53 + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/IF (exit) @ location: 21 + [ True + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - IF (entry) @ location: 22 + [ True + (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/[halt] (exit) @ location: 22 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - [halt] (entry) @ location: 28 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - control: KCons + - log/CDR (exit) @ location: 22 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - CDR (entry) @ location: 28 + [ (Pair "[PUBLIC_KEY]" + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/NIL (exit) @ location: 28 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - NIL (entry) @ location: 29 + [ (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/PAIR (exit) @ location: 29 + [ {} + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - PAIR (entry) @ location: 31 + [ {} + (Pair "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - log/[halt] (exit) @ location: 31 + [ (Pair {} + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - [halt] (entry) @ location: 8 + [ (Pair {} + "edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1" + "TEZOS") ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-get.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-get.out new file mode 100644 index 000000000000..f2940342da88 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-get.out @@ -0,0 +1,234 @@ + +trace + - CAR (interp) @ location: 11 + [ (Pair (Pair 1 4 2 Unit) Unit) ] + - CAR (entry) @ location: 11 + [ (Pair (Pair 1 4 2 Unit) Unit) ] + - log/DUP (exit) @ location: 11 + [ (Pair 1 4 2 Unit) ] + - DUP (entry) @ location: 12 + [ (Pair 1 4 2 Unit) ] + - log/CAR (exit) @ location: 12 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - CAR (entry) @ location: 13 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 13 + [ 1 + (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 14 + [ 1 + (Pair 1 4 2 Unit) ] + - log/COMPARE (exit) @ location: 14 + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - COMPARE (entry) @ location: 19 + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - log/EQ (exit) @ location: 19 + [ 0 + (Pair 1 4 2 Unit) ] + - EQ (entry) @ location: 20 + [ 0 + (Pair 1 4 2 Unit) ] + - log/IF (exit) @ location: 20 + [ True + (Pair 1 4 2 Unit) ] + - IF (entry) @ location: 21 + [ True + (Pair 1 4 2 Unit) ] + - log/[halt] (exit) @ location: 21 + [ (Pair 1 4 2 Unit) ] + - [halt] (entry) @ location: 27 + [ (Pair 1 4 2 Unit) ] + - control: KCons + - log/DUP (exit) @ location: 21 + [ (Pair 1 4 2 Unit) ] + - DUP (entry) @ location: 27 + [ (Pair 1 4 2 Unit) ] + - log/GET (exit) @ location: 27 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - GET (entry) @ location: 28 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 28 + [ 1 + (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 30 + [ 1 + (Pair 1 4 2 Unit) ] + - log/COMPARE (exit) @ location: 30 + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - COMPARE (entry) @ location: 35 + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - log/EQ (exit) @ location: 35 + [ 0 + (Pair 1 4 2 Unit) ] + - EQ (entry) @ location: 36 + [ 0 + (Pair 1 4 2 Unit) ] + - log/IF (exit) @ location: 36 + [ True + (Pair 1 4 2 Unit) ] + - IF (entry) @ location: 37 + [ True + (Pair 1 4 2 Unit) ] + - log/[halt] (exit) @ location: 37 + [ (Pair 1 4 2 Unit) ] + - [halt] (entry) @ location: 43 + [ (Pair 1 4 2 Unit) ] + - control: KCons + - log/DUP (exit) @ location: 37 + [ (Pair 1 4 2 Unit) ] + - DUP (entry) @ location: 43 + [ (Pair 1 4 2 Unit) ] + - log/GET (exit) @ location: 43 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - GET (entry) @ location: 44 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 44 + [ 4 + (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 46 + [ 4 + (Pair 1 4 2 Unit) ] + - log/COMPARE (exit) @ location: 46 + [ 4 + 4 + (Pair 1 4 2 Unit) ] + - COMPARE (entry) @ location: 51 + [ 4 + 4 + (Pair 1 4 2 Unit) ] + - log/EQ (exit) @ location: 51 + [ 0 + (Pair 1 4 2 Unit) ] + - EQ (entry) @ location: 52 + [ 0 + (Pair 1 4 2 Unit) ] + - log/IF (exit) @ location: 52 + [ True + (Pair 1 4 2 Unit) ] + - IF (entry) @ location: 53 + [ True + (Pair 1 4 2 Unit) ] + - log/[halt] (exit) @ location: 53 + [ (Pair 1 4 2 Unit) ] + - [halt] (entry) @ location: 59 + [ (Pair 1 4 2 Unit) ] + - control: KCons + - log/DUP (exit) @ location: 53 + [ (Pair 1 4 2 Unit) ] + - DUP (entry) @ location: 59 + [ (Pair 1 4 2 Unit) ] + - log/GET (exit) @ location: 59 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - GET (entry) @ location: 60 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 60 + [ 2 + (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 62 + [ 2 + (Pair 1 4 2 Unit) ] + - log/COMPARE (exit) @ location: 62 + [ 2 + 2 + (Pair 1 4 2 Unit) ] + - COMPARE (entry) @ location: 67 + [ 2 + 2 + (Pair 1 4 2 Unit) ] + - log/EQ (exit) @ location: 67 + [ 0 + (Pair 1 4 2 Unit) ] + - EQ (entry) @ location: 68 + [ 0 + (Pair 1 4 2 Unit) ] + - log/IF (exit) @ location: 68 + [ True + (Pair 1 4 2 Unit) ] + - IF (entry) @ location: 69 + [ True + (Pair 1 4 2 Unit) ] + - log/[halt] (exit) @ location: 69 + [ (Pair 1 4 2 Unit) ] + - [halt] (entry) @ location: 75 + [ (Pair 1 4 2 Unit) ] + - control: KCons + - log/DUP (exit) @ location: 69 + [ (Pair 1 4 2 Unit) ] + - DUP (entry) @ location: 75 + [ (Pair 1 4 2 Unit) ] + - log/GET (exit) @ location: 75 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - GET (entry) @ location: 76 + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 76 + [ Unit + (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 78 + [ Unit + (Pair 1 4 2 Unit) ] + - log/COMPARE (exit) @ location: 78 + [ Unit + Unit + (Pair 1 4 2 Unit) ] + - COMPARE (entry) @ location: 81 + [ Unit + Unit + (Pair 1 4 2 Unit) ] + - log/EQ (exit) @ location: 81 + [ 0 + (Pair 1 4 2 Unit) ] + - EQ (entry) @ location: 82 + [ 0 + (Pair 1 4 2 Unit) ] + - log/IF (exit) @ location: 82 + [ True + (Pair 1 4 2 Unit) ] + - IF (entry) @ location: 83 + [ True + (Pair 1 4 2 Unit) ] + - log/[halt] (exit) @ location: 83 + [ (Pair 1 4 2 Unit) ] + - [halt] (entry) @ location: 89 + [ (Pair 1 4 2 Unit) ] + - control: KCons + - log/DROP (exit) @ location: 83 + [ (Pair 1 4 2 Unit) ] + - DROP (entry) @ location: 89 + [ (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 89 + [ ] + - CONST (entry) @ location: 90 + [ ] + - log/NIL (exit) @ location: 90 + [ Unit ] + - NIL (entry) @ location: 91 + [ Unit ] + - log/PAIR (exit) @ location: 91 + [ {} + Unit ] + - PAIR (entry) @ location: 93 + [ {} + Unit ] + - log/[halt] (exit) @ location: 93 + [ (Pair {} Unit) ] + - [halt] (entry) @ location: 10 + [ (Pair {} Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-set.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-set.out new file mode 100644 index 000000000000..24ca4d9dbdd4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/comb-set.out @@ -0,0 +1,61 @@ + +trace + - CDR (interp) @ location: 11 + [ (Pair Unit 1 4 2 Unit) ] + - CDR (entry) @ location: 11 + [ (Pair Unit 1 4 2 Unit) ] + - log/CONST (exit) @ location: 11 + [ (Pair 1 4 2 Unit) ] + - CONST (entry) @ location: 12 + [ (Pair 1 4 2 Unit) ] + - log/UPDATE (exit) @ location: 12 + [ 2 + (Pair 1 4 2 Unit) ] + - UPDATE (entry) @ location: 15 + [ 2 + (Pair 1 4 2 Unit) ] + - log/CONST (exit) @ location: 15 + [ (Pair 2 4 2 Unit) ] + - CONST (entry) @ location: 17 + [ (Pair 2 4 2 Unit) ] + - log/UPDATE (exit) @ location: 17 + [ 12 + (Pair 2 4 2 Unit) ] + - UPDATE (entry) @ location: 20 + [ 12 + (Pair 2 4 2 Unit) ] + - log/CONST (exit) @ location: 20 + [ (Pair 2 12 2 Unit) ] + - CONST (entry) @ location: 22 + [ (Pair 2 12 2 Unit) ] + - log/UPDATE (exit) @ location: 22 + [ 8 + (Pair 2 12 2 Unit) ] + - UPDATE (entry) @ location: 25 + [ 8 + (Pair 2 12 2 Unit) ] + - log/CONST (exit) @ location: 25 + [ (Pair 2 12 8 Unit) ] + - CONST (entry) @ location: 27 + [ (Pair 2 12 8 Unit) ] + - log/UPDATE (exit) @ location: 27 + [ Unit + (Pair 2 12 8 Unit) ] + - UPDATE (entry) @ location: 28 + [ Unit + (Pair 2 12 8 Unit) ] + - log/NIL (exit) @ location: 28 + [ (Pair 2 12 8 Unit) ] + - NIL (entry) @ location: 30 + [ (Pair 2 12 8 Unit) ] + - log/PAIR (exit) @ location: 30 + [ {} + (Pair 2 12 8 Unit) ] + - PAIR (entry) @ location: 32 + [ {} + (Pair 2 12 8 Unit) ] + - log/[halt] (exit) @ location: 32 + [ (Pair {} 2 12 8 Unit) ] + - [halt] (entry) @ location: 10 + [ (Pair {} 2 12 8 Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/concat.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/concat.out new file mode 100644 index 000000000000..27c3dbb06237 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/concat.out @@ -0,0 +1,69 @@ + +trace + - DUP (interp) @ location: 7 + [ (Pair "abcd" "efgh") ] + - DUP (entry) @ location: 7 + [ (Pair "abcd" "efgh") ] + - log/DIP (exit) @ location: 7 + [ (Pair "abcd" "efgh") + (Pair "abcd" "efgh") ] + - DIP (entry) @ location: 8 + [ (Pair "abcd" "efgh") + (Pair "abcd" "efgh") ] + - log/CDR (exit) @ location: 8 + [ (Pair "abcd" "efgh") ] + - CDR (entry) @ location: 10 + [ (Pair "abcd" "efgh") ] + - log/NIL (exit) @ location: 10 + [ "efgh" ] + - NIL (entry) @ location: 11 + [ "efgh" ] + - log/SWAP (exit) @ location: 11 + [ {} + "efgh" ] + - SWAP (entry) @ location: 13 + [ {} + "efgh" ] + - log/CONS (exit) @ location: 13 + [ "efgh" + {} ] + - CONS (entry) @ location: 14 + [ "efgh" + {} ] + - log/[halt] (exit) @ location: 14 + [ { "efgh" } ] + - [halt] (entry) @ location: 9 + [ { "efgh" } ] + - control: KUndip + - control: KCons + - log/CAR (exit) @ location: 8 + [ (Pair "abcd" "efgh") + { "efgh" } ] + - CAR (entry) @ location: 15 + [ (Pair "abcd" "efgh") + { "efgh" } ] + - log/CONS (exit) @ location: 15 + [ "abcd" + { "efgh" } ] + - CONS (entry) @ location: 16 + [ "abcd" + { "efgh" } ] + - log/CONCAT (exit) @ location: 16 + [ { "abcd" ; "efgh" } ] + - CONCAT (entry) @ location: 17 + [ { "abcd" ; "efgh" } ] + - log/NIL (exit) @ location: 17 + [ "abcdefgh" ] + - NIL (entry) @ location: 18 + [ "abcdefgh" ] + - log/PAIR (exit) @ location: 18 + [ {} + "abcdefgh" ] + - PAIR (entry) @ location: 20 + [ {} + "abcdefgh" ] + - log/[halt] (exit) @ location: 20 + [ (Pair {} "abcdefgh") ] + - [halt] (entry) @ location: 6 + [ (Pair {} "abcdefgh") ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/conditionals.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/conditionals.out new file mode 100644 index 000000000000..9fdfb3eb56d0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/conditionals.out @@ -0,0 +1,66 @@ + +trace + - CAR (interp) @ location: 10 + [ (Pair (Right (Some 23)) "") ] + - CAR (entry) @ location: 10 + [ (Pair (Right (Some 23)) "") ] + - log/IF_LEFT (exit) @ location: 10 + [ (Right (Some 23)) ] + - IF_LEFT (entry) @ location: 11 + [ (Right (Some 23)) ] + - log/IF_NONE (exit) @ location: 11 + [ (Some 23) ] + - IF_NONE (entry) @ location: 14 + [ (Some 23) ] + - log/CONST (exit) @ location: 14 + [ 23 ] + - CONST (entry) @ location: 20 + [ 23 ] + - log/COMPARE (exit) @ location: 20 + [ 0 + 23 ] + - COMPARE (entry) @ location: 24 + [ 0 + 23 ] + - log/GT (exit) @ location: 24 + [ -1 ] + - GT (entry) @ location: 25 + [ -1 ] + - log/IF (exit) @ location: 25 + [ False ] + - IF (entry) @ location: 26 + [ False ] + - log/CONST (exit) @ location: 26 + [ ] + - CONST (entry) @ location: 32 + [ ] + - log/[halt] (exit) @ location: 32 + [ "" ] + - [halt] (entry) @ location: 35 + [ "" ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ "" ] + - [halt] (entry) @ location: 35 + [ "" ] + - control: KCons + - log/[halt] (exit) @ location: 14 + [ "" ] + - [halt] (entry) @ location: 35 + [ "" ] + - control: KCons + - log/NIL (exit) @ location: 11 + [ "" ] + - NIL (entry) @ location: 35 + [ "" ] + - log/PAIR (exit) @ location: 35 + [ {} + "" ] + - PAIR (entry) @ location: 37 + [ {} + "" ] + - log/[halt] (exit) @ location: 37 + [ (Pair {} "") ] + - [halt] (entry) @ location: 9 + [ (Pair {} "") ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/cps_fact.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/cps_fact.out new file mode 100644 index 000000000000..93e98cd385c9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/cps_fact.out @@ -0,0 +1,276 @@ + +trace + - UNPAIR (interp) @ location: 7 + [ (Pair 2 60) ] + - UNPAIR (entry) @ location: 7 + [ (Pair 2 60) ] + - log/DIP (exit) @ location: 7 + [ 2 + 60 ] + - DIP (entry) @ location: 8 + [ 2 + 60 ] + - log/SELF (exit) @ location: 8 + [ 60 ] + - SELF (entry) @ location: 10 + [ 60 ] + - log/ADDRESS (exit) @ location: 10 + [ "[CONTRACT_HASH]" + 60 ] + - ADDRESS (entry) @ location: 11 + [ "[CONTRACT_HASH]" + 60 ] + - log/SENDER (exit) @ location: 11 + [ "[CONTRACT_HASH]" + 60 ] + - SENDER (entry) @ location: 12 + [ "[CONTRACT_HASH]" + 60 ] + - log/COMPARE (exit) @ location: 12 + [ "[PUBLIC_KEY_HASH]" + "[CONTRACT_HASH]" + 60 ] + - COMPARE (entry) @ location: 14 + [ "[PUBLIC_KEY_HASH]" + "[CONTRACT_HASH]" + 60 ] + - log/EQ (exit) @ location: 14 + [ -1 + 60 ] + - EQ (entry) @ location: 15 + [ -1 + 60 ] + - log/IF (exit) @ location: 15 + [ False + 60 ] + - IF (entry) @ location: 16 + [ False + 60 ] + - log/DROP (exit) @ location: 16 + [ 60 ] + - DROP (entry) @ location: 19 + [ 60 ] + - log/CONST (exit) @ location: 19 + [ ] + - CONST (entry) @ location: 20 + [ ] + - log/[halt] (exit) @ location: 20 + [ 1 ] + - [halt] (entry) @ location: 9 + [ 1 ] + - control: KCons + - log/[halt] (exit) @ location: 16 + [ 1 ] + - [halt] (entry) @ location: 9 + [ 1 ] + - control: KUndip + - control: KCons + - log/DUP (exit) @ location: 8 + [ 2 + 1 ] + - DUP (entry) @ location: 23 + [ 2 + 1 ] + - log/CONST (exit) @ location: 23 + [ 2 + 2 + 1 ] + - CONST (entry) @ location: 24 + [ 2 + 2 + 1 ] + - log/COMPARE (exit) @ location: 24 + [ 1 + 2 + 2 + 1 ] + - COMPARE (entry) @ location: 28 + [ 1 + 2 + 2 + 1 ] + - log/GE (exit) @ location: 28 + [ -1 + 2 + 1 ] + - GE (entry) @ location: 29 + [ -1 + 2 + 1 ] + - log/IF (exit) @ location: 29 + [ False + 2 + 1 ] + - IF (entry) @ location: 30 + [ False + 2 + 1 ] + - log/CONST (exit) @ location: 30 + [ 2 + 1 ] + - CONST (entry) @ location: 37 + [ 2 + 1 ] + - log/SWAP (exit) @ location: 37 + [ 1 + 2 + 1 ] + - SWAP (entry) @ location: 40 + [ 1 + 2 + 1 ] + - log/SUB (exit) @ location: 40 + [ 2 + 1 + 1 ] + - SUB (entry) @ location: 41 + [ 2 + 1 + 1 ] + - log/ISNAT (exit) @ location: 41 + [ 1 + 1 ] + - ISNAT (entry) @ location: 42 + [ 1 + 1 ] + - log/IF_NONE (exit) @ location: 42 + [ (Some 1) + 1 ] + - IF_NONE (entry) @ location: 43 + [ (Some 1) + 1 ] + - log/DUP (exit) @ location: 43 + [ 1 + 1 ] + - DUP (entry) @ location: 49 + [ 1 + 1 ] + - log/DIP (exit) @ location: 49 + [ 1 + 1 + 1 ] + - DIP (entry) @ location: 50 + [ 1 + 1 + 1 ] + - log/CONST (exit) @ location: 50 + [ 1 + 1 ] + - CONST (entry) @ location: 52 + [ 1 + 1 ] + - log/ADD (exit) @ location: 52 + [ 1 + 1 + 1 ] + - ADD (entry) @ location: 55 + [ 1 + 1 + 1 ] + - log/MUL (exit) @ location: 55 + [ 2 + 1 ] + - MUL (entry) @ location: 56 + [ 2 + 1 ] + - log/[halt] (exit) @ location: 56 + [ 2 ] + - [halt] (entry) @ location: 51 + [ 2 ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 50 + [ 1 + 2 ] + - SWAP (entry) @ location: 57 + [ 1 + 2 ] + - log/DIP (exit) @ location: 57 + [ 2 + 1 ] + - DIP (entry) @ location: 58 + [ 2 + 1 ] + - log/DIP (exit) @ location: 58 + [ 1 ] + - DIP (entry) @ location: 60 + [ 1 ] + - log/SELF (exit) @ location: 60 + [ ] + - SELF (entry) @ location: 62 + [ ] + - log/CONST (exit) @ location: 62 + [ "[CONTRACT_HASH]" ] + - CONST (entry) @ location: 63 + [ "[CONTRACT_HASH]" ] + - log/[halt] (exit) @ location: 63 + [ 0 + "[CONTRACT_HASH]" ] + - [halt] (entry) @ location: 61 + [ 0 + "[CONTRACT_HASH]" ] + - control: KUndip + - control: KCons + - log/TRANSFER_TOKENS (exit) @ location: 60 + [ 1 + 0 + "[CONTRACT_HASH]" ] + - TRANSFER_TOKENS (entry) @ location: 66 + [ 1 + 0 + "[CONTRACT_HASH]" ] + - log/NIL (exit) @ location: 66 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 ] + - NIL (entry) @ location: 67 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 ] + - log/SWAP (exit) @ location: 67 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 ] + - SWAP (entry) @ location: 69 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 ] + - log/CONS (exit) @ location: 69 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 + {} ] + - CONS (entry) @ location: 70 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 + {} ] + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } ] + - [halt] (entry) @ location: 59 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 58 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } ] + - SWAP (entry) @ location: 71 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } ] + - log/PAIR (exit) @ location: 71 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2 ] + - PAIR (entry) @ location: 72 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2 ] + - log/[halt] (exit) @ location: 72 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - [halt] (entry) @ location: 6 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - [halt] (entry) @ location: 6 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - control: KCons + - log/[halt] (exit) @ location: 30 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - [halt] (entry) @ location: 6 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf502875890000000100014828e9aa0b3e6e970da0515b5c5d8ccf5028758900ff00000000020001 } + 2) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dign.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dign.out new file mode 100644 index 000000000000..298723394bff --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dign.out @@ -0,0 +1,107 @@ + +trace + - CAR (interp) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - CAR (entry) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - UNPAIR (entry) @ location: 16 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - log/UNPAIR (exit) @ location: 16 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - UNPAIR (entry) @ location: 17 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - log/UNPAIR (exit) @ location: 17 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - UNPAIR (entry) @ location: 18 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - log/UNPAIR (exit) @ location: 18 + [ (Pair 0 1) + 2 + 3 + 4 ] + - UNPAIR (entry) @ location: 19 + [ (Pair 0 1) + 2 + 3 + 4 ] + - log/DIG (exit) @ location: 19 + [ 0 + 1 + 2 + 3 + 4 ] + - DIG (entry) @ location: 20 + [ 0 + 1 + 2 + 3 + 4 ] + - log/DIP (exit) @ location: 20 + [ 4 + 0 + 1 + 2 + 3 ] + - DIP (entry) @ location: 22 + [ 4 + 0 + 1 + 2 + 3 ] + - log/DROP (exit) @ location: 22 + [ 0 + 1 + 2 + 3 ] + - DROP (entry) @ location: 24 + [ 0 + 1 + 2 + 3 ] + - log/DROP (exit) @ location: 24 + [ 1 + 2 + 3 ] + - DROP (entry) @ location: 25 + [ 1 + 2 + 3 ] + - log/DROP (exit) @ location: 25 + [ 2 + 3 ] + - DROP (entry) @ location: 26 + [ 2 + 3 ] + - log/DROP (exit) @ location: 26 + [ 3 ] + - DROP (entry) @ location: 27 + [ 3 ] + - log/[halt] (exit) @ location: 27 + [ ] + - [halt] (entry) @ location: 23 + [ ] + - control: KUndip + - control: KCons + - log/NIL (exit) @ location: 22 + [ 4 ] + - NIL (entry) @ location: 28 + [ 4 ] + - log/PAIR (exit) @ location: 28 + [ {} + 4 ] + - PAIR (entry) @ location: 30 + [ {} + 4 ] + - log/[halt] (exit) @ location: 30 + [ (Pair {} 4) ] + - [halt] (entry) @ location: 14 + [ (Pair {} 4) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dipn.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dipn.out new file mode 100644 index 000000000000..7c1d6266512d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dipn.out @@ -0,0 +1,165 @@ + +trace + - CAR (interp) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - CAR (entry) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - UNPAIR (entry) @ location: 16 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - log/UNPAIR (exit) @ location: 16 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - UNPAIR (entry) @ location: 17 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - log/UNPAIR (exit) @ location: 17 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - UNPAIR (entry) @ location: 18 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - log/UNPAIR (exit) @ location: 18 + [ (Pair 0 1) + 2 + 3 + 4 ] + - UNPAIR (entry) @ location: 19 + [ (Pair 0 1) + 2 + 3 + 4 ] + - log/DIP (exit) @ location: 19 + [ 0 + 1 + 2 + 3 + 4 ] + - DIP (entry) @ location: 20 + [ 0 + 1 + 2 + 3 + 4 ] + - log/CONST (exit) @ location: 20 + [ ] + - CONST (entry) @ location: 23 + [ ] + - log/[halt] (exit) @ location: 23 + [ 6 ] + - [halt] (entry) @ location: 23 + [ 6 ] + - control: KCons + - CONST (entry) @ location: 20 + [ 6 ] + - log/CONST (exit) @ location: 20 + [ 4 + 6 ] + - CONST (entry) @ location: 20 + [ 4 + 6 ] + - log/CONST (exit) @ location: 20 + [ 3 + 4 + 6 ] + - CONST (entry) @ location: 20 + [ 3 + 4 + 6 ] + - log/CONST (exit) @ location: 20 + [ 2 + 3 + 4 + 6 ] + - CONST (entry) @ location: 20 + [ 2 + 3 + 4 + 6 ] + - log/CONST (exit) @ location: 20 + [ 1 + 2 + 3 + 4 + 6 ] + - CONST (entry) @ location: 20 + [ 1 + 2 + 3 + 4 + 6 ] + - log/log/log/DROP (exit) @ location: 20 + [ 0 + 1 + 2 + 3 + 4 + 6 ] + - log/DROP (exit) @ location: 20 + [ 0 + 1 + 2 + 3 + 4 + 6 ] + - DROP (entry) @ location: 26 + [ 0 + 1 + 2 + 3 + 4 + 6 ] + - log/DROP (exit) @ location: 26 + [ 1 + 2 + 3 + 4 + 6 ] + - DROP (entry) @ location: 27 + [ 1 + 2 + 3 + 4 + 6 ] + - log/DROP (exit) @ location: 27 + [ 2 + 3 + 4 + 6 ] + - DROP (entry) @ location: 28 + [ 2 + 3 + 4 + 6 ] + - log/DROP (exit) @ location: 28 + [ 3 + 4 + 6 ] + - DROP (entry) @ location: 29 + [ 3 + 4 + 6 ] + - log/DROP (exit) @ location: 29 + [ 4 + 6 ] + - DROP (entry) @ location: 30 + [ 4 + 6 ] + - log/NIL (exit) @ location: 30 + [ 6 ] + - NIL (entry) @ location: 31 + [ 6 ] + - log/PAIR (exit) @ location: 31 + [ {} + 6 ] + - PAIR (entry) @ location: 33 + [ {} + 6 ] + - log/[halt] (exit) @ location: 33 + [ (Pair {} 6) ] + - [halt] (entry) @ location: 14 + [ (Pair {} 6) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dugn.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dugn.out new file mode 100644 index 000000000000..b782243a82af --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/dugn.out @@ -0,0 +1,97 @@ + +trace + - CAR (interp) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - CAR (entry) @ location: 15 + [ (Pair (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) 7) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - UNPAIR (entry) @ location: 16 + [ (Pair (Pair (Pair (Pair 0 1) 2) 3) 4) ] + - log/UNPAIR (exit) @ location: 16 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - UNPAIR (entry) @ location: 17 + [ (Pair (Pair (Pair 0 1) 2) 3) + 4 ] + - log/UNPAIR (exit) @ location: 17 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - UNPAIR (entry) @ location: 18 + [ (Pair (Pair 0 1) 2) + 3 + 4 ] + - log/UNPAIR (exit) @ location: 18 + [ (Pair 0 1) + 2 + 3 + 4 ] + - UNPAIR (entry) @ location: 19 + [ (Pair 0 1) + 2 + 3 + 4 ] + - log/DUG (exit) @ location: 19 + [ 0 + 1 + 2 + 3 + 4 ] + - DUG (entry) @ location: 20 + [ 0 + 1 + 2 + 3 + 4 ] + - log/DROP (exit) @ location: 20 + [ 1 + 2 + 3 + 4 + 0 ] + - DROP (entry) @ location: 22 + [ 1 + 2 + 3 + 4 + 0 ] + - log/DROP (exit) @ location: 22 + [ 2 + 3 + 4 + 0 ] + - DROP (entry) @ location: 23 + [ 2 + 3 + 4 + 0 ] + - log/DROP (exit) @ location: 23 + [ 3 + 4 + 0 ] + - DROP (entry) @ location: 24 + [ 3 + 4 + 0 ] + - log/DROP (exit) @ location: 24 + [ 4 + 0 ] + - DROP (entry) @ location: 25 + [ 4 + 0 ] + - log/NIL (exit) @ location: 25 + [ 0 ] + - NIL (entry) @ location: 26 + [ 0 ] + - log/PAIR (exit) @ location: 26 + [ {} + 0 ] + - PAIR (entry) @ location: 28 + [ {} + 0 ] + - log/[halt] (exit) @ location: 28 + [ (Pair {} 0) ] + - [halt] (entry) @ location: 14 + [ (Pair {} 0) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ediv.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ediv.out new file mode 100644 index 000000000000..7e21f457ff17 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ediv.out @@ -0,0 +1,272 @@ + +trace + - CAR (interp) @ location: 25 + [ (Pair (Pair 127 11) None None None None) ] + - CAR (entry) @ location: 25 + [ (Pair (Pair 127 11) None None None None) ] + - log/DUP (exit) @ location: 25 + [ (Pair 127 11) ] + - DUP (entry) @ location: 26 + [ (Pair 127 11) ] + - log/UNPAIR (exit) @ location: 26 + [ (Pair 127 11) + (Pair 127 11) ] + - UNPAIR (entry) @ location: 27 + [ (Pair 127 11) + (Pair 127 11) ] + - log/ABS (exit) @ location: 27 + [ 127 + 11 + (Pair 127 11) ] + - ABS (entry) @ location: 28 + [ 127 + 11 + (Pair 127 11) ] + - log/DIP (exit) @ location: 28 + [ 127 + 11 + (Pair 127 11) ] + - DIP (entry) @ location: 29 + [ 127 + 11 + (Pair 127 11) ] + - log/ABS (exit) @ location: 29 + [ 11 + (Pair 127 11) ] + - ABS (entry) @ location: 31 + [ 11 + (Pair 127 11) ] + - log/[halt] (exit) @ location: 31 + [ 11 + (Pair 127 11) ] + - [halt] (entry) @ location: 31 + [ 11 + (Pair 127 11) ] + - control: KUndip + - control: KCons + - log/EDIV (exit) @ location: 29 + [ 127 + 11 + (Pair 127 11) ] + - EDIV (entry) @ location: 32 + [ 127 + 11 + (Pair 127 11) ] + - log/SWAP (exit) @ location: 32 + [ (Some (Pair 11 6)) + (Pair 127 11) ] + - SWAP (entry) @ location: 33 + [ (Some (Pair 11 6)) + (Pair 127 11) ] + - log/DUP (exit) @ location: 33 + [ (Pair 127 11) + (Some (Pair 11 6)) ] + - DUP (entry) @ location: 34 + [ (Pair 127 11) + (Some (Pair 11 6)) ] + - log/UNPAIR (exit) @ location: 34 + [ (Pair 127 11) + (Pair 127 11) + (Some (Pair 11 6)) ] + - UNPAIR (entry) @ location: 35 + [ (Pair 127 11) + (Pair 127 11) + (Some (Pair 11 6)) ] + - log/ABS (exit) @ location: 35 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) ] + - ABS (entry) @ location: 36 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) ] + - log/EDIV (exit) @ location: 36 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) ] + - EDIV (entry) @ location: 37 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) ] + - log/SWAP (exit) @ location: 37 + [ (Some (Pair 11 6)) + (Pair 127 11) + (Some (Pair 11 6)) ] + - SWAP (entry) @ location: 38 + [ (Some (Pair 11 6)) + (Pair 127 11) + (Some (Pair 11 6)) ] + - log/DUP (exit) @ location: 38 + [ (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - DUP (entry) @ location: 39 + [ (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/UNPAIR (exit) @ location: 39 + [ (Pair 127 11) + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - UNPAIR (entry) @ location: 40 + [ (Pair 127 11) + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/DIP (exit) @ location: 40 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - DIP (entry) @ location: 41 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/ABS (exit) @ location: 41 + [ 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - ABS (entry) @ location: 43 + [ 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/[halt] (exit) @ location: 43 + [ 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - [halt] (entry) @ location: 43 + [ 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - control: KUndip + - control: KCons + - log/EDIV (exit) @ location: 41 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - EDIV (entry) @ location: 44 + [ 127 + 11 + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/SWAP (exit) @ location: 44 + [ (Some (Pair 11 6)) + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - SWAP (entry) @ location: 45 + [ (Some (Pair 11 6)) + (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/UNPAIR (exit) @ location: 45 + [ (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - UNPAIR (entry) @ location: 46 + [ (Pair 127 11) + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/EDIV (exit) @ location: 46 + [ 127 + 11 + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - EDIV (entry) @ location: 47 + [ 127 + 11 + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/DIP (exit) @ location: 47 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - DIP (entry) @ location: 49 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/PAIR (exit) @ location: 49 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - PAIR (entry) @ location: 52 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) ] + - log/[halt] (exit) @ location: 52 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - [halt] (entry) @ location: 52 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - control: KCons + - CONST (entry) @ location: 49 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/CONST (exit) @ location: 49 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - CONST (entry) @ location: 49 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/log/log/DIP (exit) @ location: 49 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/DIP (exit) @ location: 49 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - DIP (entry) @ location: 53 + [ (Some (Pair 11 6)) + (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/PAIR (exit) @ location: 53 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - PAIR (entry) @ location: 55 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/[halt] (exit) @ location: 55 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - [halt] (entry) @ location: 55 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - control: KUndip + - control: KCons + - log/PAIR (exit) @ location: 53 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - PAIR (entry) @ location: 56 + [ (Some (Pair 11 6)) + (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/NIL (exit) @ location: 56 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - NIL (entry) @ location: 57 + [ (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/PAIR (exit) @ location: 57 + [ {} + (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - PAIR (entry) @ location: 59 + [ {} + (Pair (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - log/[halt] (exit) @ location: 59 + [ (Pair {} (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - [halt] (entry) @ location: 24 + [ (Pair {} (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6)) (Some (Pair 11 6))) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/faucet.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/faucet.out new file mode 100644 index 000000000000..0eaf15b7b456 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/faucet.out @@ -0,0 +1,122 @@ + +trace + - UNPAIR (interp) @ location: 7 + [ (Pair "[PUBLIC_KEY_HASH]" "[TIMESTAMP]") ] + - UNPAIR (entry) @ location: 7 + [ (Pair "[PUBLIC_KEY_HASH]" "[TIMESTAMP]") ] + - log/SWAP (exit) @ location: 7 + [ "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" ] + - SWAP (entry) @ location: 8 + [ "[PUBLIC_KEY_HASH]" + "[TIMESTAMP]" ] + - log/CONST (exit) @ location: 8 + [ "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - CONST (entry) @ location: 9 + [ "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - log/ADD (exit) @ location: 9 + [ 300 + "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - ADD (entry) @ location: 12 + [ 300 + "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - log/NOW (exit) @ location: 12 + [ "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - NOW (entry) @ location: 13 + [ "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - log/COMPARE (exit) @ location: 13 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - COMPARE (entry) @ location: 16 + [ "[TIMESTAMP]" + "[TIMESTAMP]" + "[PUBLIC_KEY_HASH]" ] + - log/GE (exit) @ location: 16 + [ 1 + "[PUBLIC_KEY_HASH]" ] + - GE (entry) @ location: 17 + [ 1 + "[PUBLIC_KEY_HASH]" ] + - log/IF (exit) @ location: 17 + [ True + "[PUBLIC_KEY_HASH]" ] + - IF (entry) @ location: 18 + [ True + "[PUBLIC_KEY_HASH]" ] + - log/[halt] (exit) @ location: 18 + [ "[PUBLIC_KEY_HASH]" ] + - [halt] (entry) @ location: 24 + [ "[PUBLIC_KEY_HASH]" ] + - control: KCons + - log/IMPLICIT_ACCOUNT (exit) @ location: 18 + [ "[PUBLIC_KEY_HASH]" ] + - IMPLICIT_ACCOUNT (entry) @ location: 24 + [ "[PUBLIC_KEY_HASH]" ] + - log/CONST (exit) @ location: 24 + [ "[PUBLIC_KEY_HASH]" ] + - CONST (entry) @ location: 25 + [ "[PUBLIC_KEY_HASH]" ] + - log/CONST (exit) @ location: 25 + [ 1000000 + "[PUBLIC_KEY_HASH]" ] + - CONST (entry) @ location: 28 + [ 1000000 + "[PUBLIC_KEY_HASH]" ] + - log/TRANSFER_TOKENS (exit) @ location: 28 + [ Unit + 1000000 + "[PUBLIC_KEY_HASH]" ] + - TRANSFER_TOKENS (entry) @ location: 29 + [ Unit + 1000000 + "[PUBLIC_KEY_HASH]" ] + - log/NIL (exit) @ location: 29 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 ] + - NIL (entry) @ location: 30 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 ] + - log/SWAP (exit) @ location: 30 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 ] + - SWAP (entry) @ location: 32 + [ {} + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 ] + - log/CONS (exit) @ location: 32 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + {} ] + - CONS (entry) @ location: 33 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 + {} ] + - log/DIP (exit) @ location: 33 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } ] + - DIP (entry) @ location: 34 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } ] + - log/NOW (exit) @ location: 34 + [ ] + - NOW (entry) @ location: 36 + [ ] + - log/[halt] (exit) @ location: 36 + [ "[TIMESTAMP]" ] + - [halt] (entry) @ location: 36 + [ "[TIMESTAMP]" ] + - control: KUndip + - control: KCons + - log/PAIR (exit) @ location: 34 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]" ] + - PAIR (entry) @ location: 37 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]" ] + - log/[halt] (exit) @ location: 37 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]") ] + - [halt] (entry) @ location: 6 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000001c0843d0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd600 } + "[TIMESTAMP]") ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/get_and_update_map.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/get_and_update_map.out new file mode 100644 index 000000000000..43f1a2d3b72d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/get_and_update_map.out @@ -0,0 +1,53 @@ + +trace + - UNPAIR (interp) @ location: 13 + [ (Pair "abc" (Some 321) { Elt "def" 123 }) ] + - UNPAIR (entry) @ location: 13 + [ (Pair "abc" (Some 321) { Elt "def" 123 }) ] + - log/DIP (exit) @ location: 13 + [ "abc" + (Pair (Some 321) { Elt "def" 123 }) ] + - DIP (entry) @ location: 14 + [ "abc" + (Pair (Some 321) { Elt "def" 123 }) ] + - log/UNPAIR (exit) @ location: 14 + [ (Pair (Some 321) { Elt "def" 123 }) ] + - UNPAIR (entry) @ location: 16 + [ (Pair (Some 321) { Elt "def" 123 }) ] + - log/[halt] (exit) @ location: 16 + [ (Some 321) + { Elt "def" 123 } ] + - [halt] (entry) @ location: 16 + [ (Some 321) + { Elt "def" 123 } ] + - control: KUndip + - control: KCons + - log/GET_AND_UPDATE (exit) @ location: 14 + [ "abc" + (Some 321) + { Elt "def" 123 } ] + - GET_AND_UPDATE (entry) @ location: 17 + [ "abc" + (Some 321) + { Elt "def" 123 } ] + - log/PAIR (exit) @ location: 17 + [ None + { Elt "abc" 321 ; Elt "def" 123 } ] + - PAIR (entry) @ location: 18 + [ None + { Elt "abc" 321 ; Elt "def" 123 } ] + - log/NIL (exit) @ location: 18 + [ (Pair None { Elt "abc" 321 ; Elt "def" 123 }) ] + - NIL (entry) @ location: 19 + [ (Pair None { Elt "abc" 321 ; Elt "def" 123 }) ] + - log/PAIR (exit) @ location: 19 + [ {} + (Pair None { Elt "abc" 321 ; Elt "def" 123 }) ] + - PAIR (entry) @ location: 21 + [ {} + (Pair None { Elt "abc" 321 ; Elt "def" 123 }) ] + - log/[halt] (exit) @ location: 21 + [ (Pair {} None { Elt "abc" 321 ; Elt "def" 123 }) ] + - [halt] (entry) @ location: 11 + [ (Pair {} None { Elt "abc" 321 ; Elt "def" 123 }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/if.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/if.out new file mode 100644 index 000000000000..9e050efcb084 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/if.out @@ -0,0 +1,38 @@ + +trace + - CAR (interp) @ location: 8 + [ (Pair True None) ] + - CAR (entry) @ location: 8 + [ (Pair True None) ] + - log/IF (exit) @ location: 8 + [ True ] + - IF (entry) @ location: 9 + [ True ] + - log/CONST (exit) @ location: 9 + [ ] + - CONST (entry) @ location: 11 + [ ] + - log/[halt] (exit) @ location: 11 + [ True ] + - [halt] (entry) @ location: 18 + [ True ] + - control: KCons + - log/SOME (exit) @ location: 9 + [ True ] + - SOME (entry) @ location: 18 + [ True ] + - log/NIL (exit) @ location: 18 + [ (Some True) ] + - NIL (entry) @ location: 19 + [ (Some True) ] + - log/PAIR (exit) @ location: 19 + [ {} + (Some True) ] + - PAIR (entry) @ location: 21 + [ {} + (Some True) ] + - log/[halt] (exit) @ location: 21 + [ (Pair {} (Some True)) ] + - [halt] (entry) @ location: 7 + [ (Pair {} (Some True)) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/insertion_sort.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/insertion_sort.out new file mode 100644 index 000000000000..540a00937e1d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/insertion_sort.out @@ -0,0 +1,6541 @@ + +trace + - CAR (interp) @ location: 9 + [ (Pair { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } {}) ] + - CAR (entry) @ location: 9 + [ (Pair { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } {}) ] + - log/NIL (exit) @ location: 9 + [ { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } ] + - NIL (entry) @ location: 10 + [ { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } ] + - log/SWAP (exit) @ location: 10 + [ {} + { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } ] + - SWAP (entry) @ location: 12 + [ {} + { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } ] + - log/ITER (exit) @ location: 12 + [ { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } + {} ] + - ITER (entry) @ location: 13 + [ { 8 ; 3 ; 2 ; 7 ; 6 ; 9 ; 5 ; 1 ; 4 ; 0 } + {} ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 8 + {} ] + - SWAP (entry) @ location: 15 + [ 8 + {} ] + - log/DIP (exit) @ location: 15 + [ {} + 8 ] + - DIP (entry) @ location: 16 + [ {} + 8 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 8 + {} ] + - CONST (entry) @ location: 16 + [ 8 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ {} + 8 + {} ] + - log/CONST (exit) @ location: 16 + [ {} + 8 + {} ] + - CONST (entry) @ location: 21 + [ {} + 8 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + {} + 8 + {} ] + - LOOP (entry) @ location: 66 + [ True + {} + 8 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ {} + 8 + {} ] + - IF_CONS (entry) @ location: 26 + [ {} + 8 + {} ] + - log/NIL (exit) @ location: 26 + [ 8 + {} ] + - NIL (entry) @ location: 61 + [ 8 + {} ] + - log/CONST (exit) @ location: 61 + [ {} + 8 + {} ] + - CONST (entry) @ location: 63 + [ {} + 8 + {} ] + - log/[halt] (exit) @ location: 63 + [ False + {} + 8 + {} ] + - [halt] (entry) @ location: 66 + [ False + {} + 8 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + {} + 8 + {} ] + - [halt] (entry) @ location: 66 + [ False + {} + 8 + {} ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ {} + 8 + {} ] + - SWAP (entry) @ location: 66 + [ {} + 8 + {} ] + - log/CONS (exit) @ location: 66 + [ 8 + {} + {} ] + - CONS (entry) @ location: 67 + [ 8 + {} + {} ] + - log/SWAP (exit) @ location: 67 + [ { 8 } + {} ] + - SWAP (entry) @ location: 68 + [ { 8 } + {} ] + - log/ITER (exit) @ location: 68 + [ {} + { 8 } ] + - ITER (entry) @ location: 69 + [ {} + { 8 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 8 } ] + - [halt] (entry) @ location: 13 + [ { 8 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 3 + { 8 } ] + - SWAP (entry) @ location: 15 + [ 3 + { 8 } ] + - log/DIP (exit) @ location: 15 + [ { 8 } + 3 ] + - DIP (entry) @ location: 16 + [ { 8 } + 3 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 3 + {} ] + - CONST (entry) @ location: 16 + [ 3 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 8 } + 3 + {} ] + - log/CONST (exit) @ location: 16 + [ { 8 } + 3 + {} ] + - CONST (entry) @ location: 21 + [ { 8 } + 3 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 8 } + 3 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 8 } + 3 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 8 } + 3 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 8 } + 3 + {} ] + - log/SWAP (exit) @ location: 26 + [ 8 + {} + 3 + {} ] + - SWAP (entry) @ location: 28 + [ 8 + {} + 3 + {} ] + - log/DIP (exit) @ location: 28 + [ {} + 8 + 3 + {} ] + - DIP (entry) @ location: 29 + [ {} + 8 + 3 + {} ] + - log/DUP (exit) @ location: 29 + [ 8 + 3 + {} ] + - DUP (entry) @ location: 31 + [ 8 + 3 + {} ] + - log/DIP (exit) @ location: 31 + [ 8 + 8 + 3 + {} ] + - DIP (entry) @ location: 32 + [ 8 + 8 + 3 + {} ] + - log/DUP (exit) @ location: 32 + [ 3 + {} ] + - DUP (entry) @ location: 35 + [ 3 + {} ] + - log/[halt] (exit) @ location: 35 + [ 3 + 3 + {} ] + - [halt] (entry) @ location: 35 + [ 3 + 3 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 3 + 3 + {} ] + - log/CONST (exit) @ location: 32 + [ 8 + 3 + 3 + {} ] + - CONST (entry) @ location: 32 + [ 8 + 3 + 3 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 8 + 8 + 3 + 3 + {} ] + - log/DIP (exit) @ location: 32 + [ 8 + 8 + 3 + 3 + {} ] + - DIP (entry) @ location: 36 + [ 8 + 8 + 3 + 3 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 8 + 3 + 3 + {} ] + - COMPARE (entry) @ location: 39 + [ 8 + 3 + 3 + {} ] + - log/LT (exit) @ location: 39 + [ 1 + 3 + {} ] + - LT (entry) @ location: 40 + [ 1 + 3 + {} ] + - log/[halt] (exit) @ location: 40 + [ False + 3 + {} ] + - [halt] (entry) @ location: 38 + [ False + 3 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 8 + False + 3 + {} ] + - SWAP (entry) @ location: 41 + [ 8 + False + 3 + {} ] + - log/[halt] (exit) @ location: 41 + [ False + 8 + 3 + {} ] + - [halt] (entry) @ location: 30 + [ False + 8 + 3 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ {} + False + 8 + 3 + {} ] + - SWAP (entry) @ location: 42 + [ {} + False + 8 + 3 + {} ] + - log/IF (exit) @ location: 42 + [ False + {} + 8 + 3 + {} ] + - IF (entry) @ location: 43 + [ False + {} + 8 + 3 + {} ] + - log/SWAP (exit) @ location: 43 + [ {} + 8 + 3 + {} ] + - SWAP (entry) @ location: 55 + [ {} + 8 + 3 + {} ] + - log/CONS (exit) @ location: 55 + [ 8 + {} + 3 + {} ] + - CONS (entry) @ location: 56 + [ 8 + {} + 3 + {} ] + - log/CONST (exit) @ location: 56 + [ { 8 } + 3 + {} ] + - CONST (entry) @ location: 57 + [ { 8 } + 3 + {} ] + - log/[halt] (exit) @ location: 57 + [ False + { 8 } + 3 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 3 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 8 } + 3 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 3 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 8 } + 3 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 3 + {} ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 8 } + 3 + {} ] + - SWAP (entry) @ location: 66 + [ { 8 } + 3 + {} ] + - log/CONS (exit) @ location: 66 + [ 3 + { 8 } + {} ] + - CONS (entry) @ location: 67 + [ 3 + { 8 } + {} ] + - log/SWAP (exit) @ location: 67 + [ { 3 ; 8 } + {} ] + - SWAP (entry) @ location: 68 + [ { 3 ; 8 } + {} ] + - log/ITER (exit) @ location: 68 + [ {} + { 3 ; 8 } ] + - ITER (entry) @ location: 69 + [ {} + { 3 ; 8 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 3 ; 8 } ] + - [halt] (entry) @ location: 13 + [ { 3 ; 8 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 2 + { 3 ; 8 } ] + - SWAP (entry) @ location: 15 + [ 2 + { 3 ; 8 } ] + - log/DIP (exit) @ location: 15 + [ { 3 ; 8 } + 2 ] + - DIP (entry) @ location: 16 + [ { 3 ; 8 } + 2 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 2 + {} ] + - CONST (entry) @ location: 16 + [ 2 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 3 ; 8 } + 2 + {} ] + - log/CONST (exit) @ location: 16 + [ { 3 ; 8 } + 2 + {} ] + - CONST (entry) @ location: 21 + [ { 3 ; 8 } + 2 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 3 ; 8 } + 2 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 3 ; 8 } + 2 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 8 } + 2 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 8 } + 2 + {} ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 8 } + 2 + {} ] + - SWAP (entry) @ location: 28 + [ 3 + { 8 } + 2 + {} ] + - log/DIP (exit) @ location: 28 + [ { 8 } + 3 + 2 + {} ] + - DIP (entry) @ location: 29 + [ { 8 } + 3 + 2 + {} ] + - log/DUP (exit) @ location: 29 + [ 3 + 2 + {} ] + - DUP (entry) @ location: 31 + [ 3 + 2 + {} ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 2 + {} ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 2 + {} ] + - log/DUP (exit) @ location: 32 + [ 2 + {} ] + - DUP (entry) @ location: 35 + [ 2 + {} ] + - log/[halt] (exit) @ location: 35 + [ 2 + 2 + {} ] + - [halt] (entry) @ location: 35 + [ 2 + 2 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 2 + 2 + {} ] + - log/CONST (exit) @ location: 32 + [ 3 + 2 + 2 + {} ] + - CONST (entry) @ location: 32 + [ 3 + 2 + 2 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 2 + 2 + {} ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 2 + 2 + {} ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 2 + 2 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 2 + 2 + {} ] + - COMPARE (entry) @ location: 39 + [ 3 + 2 + 2 + {} ] + - log/LT (exit) @ location: 39 + [ 1 + 2 + {} ] + - LT (entry) @ location: 40 + [ 1 + 2 + {} ] + - log/[halt] (exit) @ location: 40 + [ False + 2 + {} ] + - [halt] (entry) @ location: 38 + [ False + 2 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + False + 2 + {} ] + - SWAP (entry) @ location: 41 + [ 3 + False + 2 + {} ] + - log/[halt] (exit) @ location: 41 + [ False + 3 + 2 + {} ] + - [halt] (entry) @ location: 30 + [ False + 3 + 2 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 8 } + False + 3 + 2 + {} ] + - SWAP (entry) @ location: 42 + [ { 8 } + False + 3 + 2 + {} ] + - log/IF (exit) @ location: 42 + [ False + { 8 } + 3 + 2 + {} ] + - IF (entry) @ location: 43 + [ False + { 8 } + 3 + 2 + {} ] + - log/SWAP (exit) @ location: 43 + [ { 8 } + 3 + 2 + {} ] + - SWAP (entry) @ location: 55 + [ { 8 } + 3 + 2 + {} ] + - log/CONS (exit) @ location: 55 + [ 3 + { 8 } + 2 + {} ] + - CONS (entry) @ location: 56 + [ 3 + { 8 } + 2 + {} ] + - log/CONST (exit) @ location: 56 + [ { 3 ; 8 } + 2 + {} ] + - CONST (entry) @ location: 57 + [ { 3 ; 8 } + 2 + {} ] + - log/[halt] (exit) @ location: 57 + [ False + { 3 ; 8 } + 2 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 3 ; 8 } + 2 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 3 ; 8 } + 2 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 3 ; 8 } + 2 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 3 ; 8 } + 2 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 3 ; 8 } + 2 + {} ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 3 ; 8 } + 2 + {} ] + - SWAP (entry) @ location: 66 + [ { 3 ; 8 } + 2 + {} ] + - log/CONS (exit) @ location: 66 + [ 2 + { 3 ; 8 } + {} ] + - CONS (entry) @ location: 67 + [ 2 + { 3 ; 8 } + {} ] + - log/SWAP (exit) @ location: 67 + [ { 2 ; 3 ; 8 } + {} ] + - SWAP (entry) @ location: 68 + [ { 2 ; 3 ; 8 } + {} ] + - log/ITER (exit) @ location: 68 + [ {} + { 2 ; 3 ; 8 } ] + - ITER (entry) @ location: 69 + [ {} + { 2 ; 3 ; 8 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 2 ; 3 ; 8 } ] + - [halt] (entry) @ location: 13 + [ { 2 ; 3 ; 8 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 7 + { 2 ; 3 ; 8 } ] + - SWAP (entry) @ location: 15 + [ 7 + { 2 ; 3 ; 8 } ] + - log/DIP (exit) @ location: 15 + [ { 2 ; 3 ; 8 } + 7 ] + - DIP (entry) @ location: 16 + [ { 2 ; 3 ; 8 } + 7 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 7 + {} ] + - CONST (entry) @ location: 16 + [ 7 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 8 } + 7 + {} ] + - log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 8 } + 7 + {} ] + - CONST (entry) @ location: 21 + [ { 2 ; 3 ; 8 } + 7 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 2 ; 3 ; 8 } + 7 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 2 ; 3 ; 8 } + 7 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 8 } + 7 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 8 } + 7 + {} ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 8 } + 7 + {} ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 8 } + 7 + {} ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 8 } + 2 + 7 + {} ] + - DIP (entry) @ location: 29 + [ { 3 ; 8 } + 2 + 7 + {} ] + - log/DUP (exit) @ location: 29 + [ 2 + 7 + {} ] + - DUP (entry) @ location: 31 + [ 2 + 7 + {} ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 7 + {} ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 7 + {} ] + - log/DUP (exit) @ location: 32 + [ 7 + {} ] + - DUP (entry) @ location: 35 + [ 7 + {} ] + - log/[halt] (exit) @ location: 35 + [ 7 + 7 + {} ] + - [halt] (entry) @ location: 35 + [ 7 + 7 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 7 + 7 + {} ] + - log/CONST (exit) @ location: 32 + [ 2 + 7 + 7 + {} ] + - CONST (entry) @ location: 32 + [ 2 + 7 + 7 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 7 + 7 + {} ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 7 + 7 + {} ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 7 + 7 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 7 + 7 + {} ] + - COMPARE (entry) @ location: 39 + [ 2 + 7 + 7 + {} ] + - log/LT (exit) @ location: 39 + [ -1 + 7 + {} ] + - LT (entry) @ location: 40 + [ -1 + 7 + {} ] + - log/[halt] (exit) @ location: 40 + [ True + 7 + {} ] + - [halt] (entry) @ location: 38 + [ True + 7 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + True + 7 + {} ] + - SWAP (entry) @ location: 41 + [ 2 + True + 7 + {} ] + - log/[halt] (exit) @ location: 41 + [ True + 2 + 7 + {} ] + - [halt] (entry) @ location: 30 + [ True + 2 + 7 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 8 } + True + 2 + 7 + {} ] + - SWAP (entry) @ location: 42 + [ { 3 ; 8 } + True + 2 + 7 + {} ] + - log/IF (exit) @ location: 42 + [ True + { 3 ; 8 } + 2 + 7 + {} ] + - IF (entry) @ location: 43 + [ True + { 3 ; 8 } + 2 + 7 + {} ] + - log/DIP (exit) @ location: 43 + [ { 3 ; 8 } + 2 + 7 + {} ] + - DIP (entry) @ location: 45 + [ { 3 ; 8 } + 2 + 7 + {} ] + - log/SWAP (exit) @ location: 45 + [ 2 + 7 + {} ] + - SWAP (entry) @ location: 47 + [ 2 + 7 + {} ] + - log/DIP (exit) @ location: 47 + [ 7 + 2 + {} ] + - DIP (entry) @ location: 48 + [ 7 + 2 + {} ] + - log/CONS (exit) @ location: 48 + [ 2 + {} ] + - CONS (entry) @ location: 50 + [ 2 + {} ] + - log/[halt] (exit) @ location: 50 + [ { 2 } ] + - [halt] (entry) @ location: 50 + [ { 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 7 + { 2 } ] + - [halt] (entry) @ location: 46 + [ 7 + { 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 3 ; 8 } + 7 + { 2 } ] + - CONST (entry) @ location: 51 + [ { 3 ; 8 } + 7 + { 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 8 } + 7 + { 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 8 } + 7 + { 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 8 } + 7 + { 2 } ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 8 } + 7 + { 2 } ] + - SWAP (entry) @ location: 28 + [ 3 + { 8 } + 7 + { 2 } ] + - log/DIP (exit) @ location: 28 + [ { 8 } + 3 + 7 + { 2 } ] + - DIP (entry) @ location: 29 + [ { 8 } + 3 + 7 + { 2 } ] + - log/DUP (exit) @ location: 29 + [ 3 + 7 + { 2 } ] + - DUP (entry) @ location: 31 + [ 3 + 7 + { 2 } ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 7 + { 2 } ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 7 + { 2 } ] + - log/DUP (exit) @ location: 32 + [ 7 + { 2 } ] + - DUP (entry) @ location: 35 + [ 7 + { 2 } ] + - log/[halt] (exit) @ location: 35 + [ 7 + 7 + { 2 } ] + - [halt] (entry) @ location: 35 + [ 7 + 7 + { 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 7 + 7 + { 2 } ] + - log/CONST (exit) @ location: 32 + [ 3 + 7 + 7 + { 2 } ] + - CONST (entry) @ location: 32 + [ 3 + 7 + 7 + { 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 7 + 7 + { 2 } ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 7 + 7 + { 2 } ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 7 + 7 + { 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 7 + 7 + { 2 } ] + - COMPARE (entry) @ location: 39 + [ 3 + 7 + 7 + { 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 7 + { 2 } ] + - LT (entry) @ location: 40 + [ -1 + 7 + { 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 7 + { 2 } ] + - [halt] (entry) @ location: 38 + [ True + 7 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + True + 7 + { 2 } ] + - SWAP (entry) @ location: 41 + [ 3 + True + 7 + { 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 3 + 7 + { 2 } ] + - [halt] (entry) @ location: 30 + [ True + 3 + 7 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 8 } + True + 3 + 7 + { 2 } ] + - SWAP (entry) @ location: 42 + [ { 8 } + True + 3 + 7 + { 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 8 } + 3 + 7 + { 2 } ] + - IF (entry) @ location: 43 + [ True + { 8 } + 3 + 7 + { 2 } ] + - log/DIP (exit) @ location: 43 + [ { 8 } + 3 + 7 + { 2 } ] + - DIP (entry) @ location: 45 + [ { 8 } + 3 + 7 + { 2 } ] + - log/SWAP (exit) @ location: 45 + [ 3 + 7 + { 2 } ] + - SWAP (entry) @ location: 47 + [ 3 + 7 + { 2 } ] + - log/DIP (exit) @ location: 47 + [ 7 + 3 + { 2 } ] + - DIP (entry) @ location: 48 + [ 7 + 3 + { 2 } ] + - log/CONS (exit) @ location: 48 + [ 3 + { 2 } ] + - CONS (entry) @ location: 50 + [ 3 + { 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 7 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 8 } + 7 + { 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 8 } + 7 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 7 + { 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 8 } + 7 + { 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 8 } + 7 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 8 + {} + 7 + { 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 8 + {} + 7 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ {} + 8 + 7 + { 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ {} + 8 + 7 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 8 + 7 + { 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 8 + 7 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 8 + 8 + 7 + { 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 8 + 8 + 7 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 7 + { 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 7 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 7 + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 7 + 7 + { 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 7 + 7 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 8 + 7 + 7 + { 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 8 + 7 + 7 + { 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 8 + 8 + 7 + 7 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 8 + 8 + 7 + 7 + { 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 8 + 8 + 7 + 7 + { 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 8 + 7 + 7 + { 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 8 + 7 + 7 + { 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ 1 + 7 + { 3 ; 2 } ] + - LT (entry) @ location: 40 + [ 1 + 7 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ False + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ False + 7 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 8 + False + 7 + { 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 8 + False + 7 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ False + 8 + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ False + 8 + 7 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ {} + False + 8 + 7 + { 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ {} + False + 8 + 7 + { 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ False + {} + 8 + 7 + { 3 ; 2 } ] + - IF (entry) @ location: 43 + [ False + {} + 8 + 7 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 43 + [ {} + 8 + 7 + { 3 ; 2 } ] + - SWAP (entry) @ location: 55 + [ {} + 8 + 7 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 55 + [ 8 + {} + 7 + { 3 ; 2 } ] + - CONS (entry) @ location: 56 + [ 8 + {} + 7 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 56 + [ { 8 } + 7 + { 3 ; 2 } ] + - CONST (entry) @ location: 57 + [ { 8 } + 7 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 57 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 8 } + 7 + { 3 ; 2 } ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 8 } + 7 + { 3 ; 2 } ] + - SWAP (entry) @ location: 66 + [ { 8 } + 7 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 66 + [ 7 + { 8 } + { 3 ; 2 } ] + - CONS (entry) @ location: 67 + [ 7 + { 8 } + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 67 + [ { 7 ; 8 } + { 3 ; 2 } ] + - SWAP (entry) @ location: 68 + [ { 7 ; 8 } + { 3 ; 2 } ] + - log/ITER (exit) @ location: 68 + [ { 3 ; 2 } + { 7 ; 8 } ] + - ITER (entry) @ location: 69 + [ { 3 ; 2 } + { 7 ; 8 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 3 + { 7 ; 8 } ] + - CONS (entry) @ location: 71 + [ 3 + { 7 ; 8 } ] + - log/[halt] (exit) @ location: 71 + [ { 3 ; 7 ; 8 } ] + - [halt] (entry) @ location: 69 + [ { 3 ; 7 ; 8 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 2 + { 3 ; 7 ; 8 } ] + - CONS (entry) @ location: 71 + [ 2 + { 3 ; 7 ; 8 } ] + - log/[halt] (exit) @ location: 71 + [ { 2 ; 3 ; 7 ; 8 } ] + - [halt] (entry) @ location: 69 + [ { 2 ; 3 ; 7 ; 8 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 2 ; 3 ; 7 ; 8 } ] + - [halt] (entry) @ location: 13 + [ { 2 ; 3 ; 7 ; 8 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 6 + { 2 ; 3 ; 7 ; 8 } ] + - SWAP (entry) @ location: 15 + [ 6 + { 2 ; 3 ; 7 ; 8 } ] + - log/DIP (exit) @ location: 15 + [ { 2 ; 3 ; 7 ; 8 } + 6 ] + - DIP (entry) @ location: 16 + [ { 2 ; 3 ; 7 ; 8 } + 6 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 6 + {} ] + - CONST (entry) @ location: 16 + [ 6 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - CONST (entry) @ location: 21 + [ { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 7 ; 8 } + 6 + {} ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 7 ; 8 } + 6 + {} ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 7 ; 8 } + 6 + {} ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - DIP (entry) @ location: 29 + [ { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - log/DUP (exit) @ location: 29 + [ 2 + 6 + {} ] + - DUP (entry) @ location: 31 + [ 2 + 6 + {} ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 6 + {} ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 6 + {} ] + - log/DUP (exit) @ location: 32 + [ 6 + {} ] + - DUP (entry) @ location: 35 + [ 6 + {} ] + - log/[halt] (exit) @ location: 35 + [ 6 + 6 + {} ] + - [halt] (entry) @ location: 35 + [ 6 + 6 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 6 + 6 + {} ] + - log/CONST (exit) @ location: 32 + [ 2 + 6 + 6 + {} ] + - CONST (entry) @ location: 32 + [ 2 + 6 + 6 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 6 + 6 + {} ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 6 + 6 + {} ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 6 + 6 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 6 + 6 + {} ] + - COMPARE (entry) @ location: 39 + [ 2 + 6 + 6 + {} ] + - log/LT (exit) @ location: 39 + [ -1 + 6 + {} ] + - LT (entry) @ location: 40 + [ -1 + 6 + {} ] + - log/[halt] (exit) @ location: 40 + [ True + 6 + {} ] + - [halt] (entry) @ location: 38 + [ True + 6 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + True + 6 + {} ] + - SWAP (entry) @ location: 41 + [ 2 + True + 6 + {} ] + - log/[halt] (exit) @ location: 41 + [ True + 2 + 6 + {} ] + - [halt] (entry) @ location: 30 + [ True + 2 + 6 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 7 ; 8 } + True + 2 + 6 + {} ] + - SWAP (entry) @ location: 42 + [ { 3 ; 7 ; 8 } + True + 2 + 6 + {} ] + - log/IF (exit) @ location: 42 + [ True + { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - IF (entry) @ location: 43 + [ True + { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - log/DIP (exit) @ location: 43 + [ { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - DIP (entry) @ location: 45 + [ { 3 ; 7 ; 8 } + 2 + 6 + {} ] + - log/SWAP (exit) @ location: 45 + [ 2 + 6 + {} ] + - SWAP (entry) @ location: 47 + [ 2 + 6 + {} ] + - log/DIP (exit) @ location: 47 + [ 6 + 2 + {} ] + - DIP (entry) @ location: 48 + [ 6 + 2 + {} ] + - log/CONS (exit) @ location: 48 + [ 2 + {} ] + - CONS (entry) @ location: 50 + [ 2 + {} ] + - log/[halt] (exit) @ location: 50 + [ { 2 } ] + - [halt] (entry) @ location: 50 + [ { 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 6 + { 2 } ] + - [halt] (entry) @ location: 46 + [ 6 + { 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 3 ; 7 ; 8 } + 6 + { 2 } ] + - CONST (entry) @ location: 51 + [ { 3 ; 7 ; 8 } + 6 + { 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 7 ; 8 } + 6 + { 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 7 ; 8 } + 6 + { 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 7 ; 8 } + 6 + { 2 } ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 7 ; 8 } + 6 + { 2 } ] + - SWAP (entry) @ location: 28 + [ 3 + { 7 ; 8 } + 6 + { 2 } ] + - log/DIP (exit) @ location: 28 + [ { 7 ; 8 } + 3 + 6 + { 2 } ] + - DIP (entry) @ location: 29 + [ { 7 ; 8 } + 3 + 6 + { 2 } ] + - log/DUP (exit) @ location: 29 + [ 3 + 6 + { 2 } ] + - DUP (entry) @ location: 31 + [ 3 + 6 + { 2 } ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 6 + { 2 } ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 6 + { 2 } ] + - log/DUP (exit) @ location: 32 + [ 6 + { 2 } ] + - DUP (entry) @ location: 35 + [ 6 + { 2 } ] + - log/[halt] (exit) @ location: 35 + [ 6 + 6 + { 2 } ] + - [halt] (entry) @ location: 35 + [ 6 + 6 + { 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 6 + 6 + { 2 } ] + - log/CONST (exit) @ location: 32 + [ 3 + 6 + 6 + { 2 } ] + - CONST (entry) @ location: 32 + [ 3 + 6 + 6 + { 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 6 + 6 + { 2 } ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 6 + 6 + { 2 } ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 6 + 6 + { 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 6 + 6 + { 2 } ] + - COMPARE (entry) @ location: 39 + [ 3 + 6 + 6 + { 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 6 + { 2 } ] + - LT (entry) @ location: 40 + [ -1 + 6 + { 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 6 + { 2 } ] + - [halt] (entry) @ location: 38 + [ True + 6 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + True + 6 + { 2 } ] + - SWAP (entry) @ location: 41 + [ 3 + True + 6 + { 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 3 + 6 + { 2 } ] + - [halt] (entry) @ location: 30 + [ True + 3 + 6 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 7 ; 8 } + True + 3 + 6 + { 2 } ] + - SWAP (entry) @ location: 42 + [ { 7 ; 8 } + True + 3 + 6 + { 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 7 ; 8 } + 3 + 6 + { 2 } ] + - IF (entry) @ location: 43 + [ True + { 7 ; 8 } + 3 + 6 + { 2 } ] + - log/DIP (exit) @ location: 43 + [ { 7 ; 8 } + 3 + 6 + { 2 } ] + - DIP (entry) @ location: 45 + [ { 7 ; 8 } + 3 + 6 + { 2 } ] + - log/SWAP (exit) @ location: 45 + [ 3 + 6 + { 2 } ] + - SWAP (entry) @ location: 47 + [ 3 + 6 + { 2 } ] + - log/DIP (exit) @ location: 47 + [ 6 + 3 + { 2 } ] + - DIP (entry) @ location: 48 + [ 6 + 3 + { 2 } ] + - log/CONS (exit) @ location: 48 + [ 3 + { 2 } ] + - CONS (entry) @ location: 50 + [ 3 + { 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 6 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 7 + { 8 } + 6 + { 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 7 + { 8 } + 6 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ { 8 } + 7 + 6 + { 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ { 8 } + 7 + 6 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 7 + 6 + { 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 7 + 6 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 7 + 7 + 6 + { 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 7 + 7 + 6 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 6 + { 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 6 + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 6 + 6 + { 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 6 + 6 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 7 + 6 + 6 + { 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 7 + 6 + 6 + { 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 7 + 7 + 6 + 6 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 7 + 7 + 6 + 6 + { 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 7 + 7 + 6 + 6 + { 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 7 + 6 + 6 + { 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 7 + 6 + 6 + { 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ 1 + 6 + { 3 ; 2 } ] + - LT (entry) @ location: 40 + [ 1 + 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ False + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ False + 6 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 7 + False + 6 + { 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 7 + False + 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ False + 7 + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ False + 7 + 6 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 8 } + False + 7 + 6 + { 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ { 8 } + False + 7 + 6 + { 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ False + { 8 } + 7 + 6 + { 3 ; 2 } ] + - IF (entry) @ location: 43 + [ False + { 8 } + 7 + 6 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 43 + [ { 8 } + 7 + 6 + { 3 ; 2 } ] + - SWAP (entry) @ location: 55 + [ { 8 } + 7 + 6 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 55 + [ 7 + { 8 } + 6 + { 3 ; 2 } ] + - CONS (entry) @ location: 56 + [ 7 + { 8 } + 6 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 56 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - CONST (entry) @ location: 57 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 57 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 7 ; 8 } + 6 + { 3 ; 2 } ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - SWAP (entry) @ location: 66 + [ { 7 ; 8 } + 6 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 66 + [ 6 + { 7 ; 8 } + { 3 ; 2 } ] + - CONS (entry) @ location: 67 + [ 6 + { 7 ; 8 } + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 67 + [ { 6 ; 7 ; 8 } + { 3 ; 2 } ] + - SWAP (entry) @ location: 68 + [ { 6 ; 7 ; 8 } + { 3 ; 2 } ] + - log/ITER (exit) @ location: 68 + [ { 3 ; 2 } + { 6 ; 7 ; 8 } ] + - ITER (entry) @ location: 69 + [ { 3 ; 2 } + { 6 ; 7 ; 8 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 3 + { 6 ; 7 ; 8 } ] + - CONS (entry) @ location: 71 + [ 3 + { 6 ; 7 ; 8 } ] + - log/[halt] (exit) @ location: 71 + [ { 3 ; 6 ; 7 ; 8 } ] + - [halt] (entry) @ location: 69 + [ { 3 ; 6 ; 7 ; 8 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 2 + { 3 ; 6 ; 7 ; 8 } ] + - CONS (entry) @ location: 71 + [ 2 + { 3 ; 6 ; 7 ; 8 } ] + - log/[halt] (exit) @ location: 71 + [ { 2 ; 3 ; 6 ; 7 ; 8 } ] + - [halt] (entry) @ location: 69 + [ { 2 ; 3 ; 6 ; 7 ; 8 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 2 ; 3 ; 6 ; 7 ; 8 } ] + - [halt] (entry) @ location: 13 + [ { 2 ; 3 ; 6 ; 7 ; 8 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 9 + { 2 ; 3 ; 6 ; 7 ; 8 } ] + - SWAP (entry) @ location: 15 + [ 9 + { 2 ; 3 ; 6 ; 7 ; 8 } ] + - log/DIP (exit) @ location: 15 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 ] + - DIP (entry) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 9 + {} ] + - CONST (entry) @ location: 16 + [ 9 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - CONST (entry) @ location: 21 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 6 ; 7 ; 8 } + 9 + {} ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - DIP (entry) @ location: 29 + [ { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - log/DUP (exit) @ location: 29 + [ 2 + 9 + {} ] + - DUP (entry) @ location: 31 + [ 2 + 9 + {} ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 9 + {} ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 9 + {} ] + - log/DUP (exit) @ location: 32 + [ 9 + {} ] + - DUP (entry) @ location: 35 + [ 9 + {} ] + - log/[halt] (exit) @ location: 35 + [ 9 + 9 + {} ] + - [halt] (entry) @ location: 35 + [ 9 + 9 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 9 + 9 + {} ] + - log/CONST (exit) @ location: 32 + [ 2 + 9 + 9 + {} ] + - CONST (entry) @ location: 32 + [ 2 + 9 + 9 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 9 + 9 + {} ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 9 + 9 + {} ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 9 + 9 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 9 + 9 + {} ] + - COMPARE (entry) @ location: 39 + [ 2 + 9 + 9 + {} ] + - log/LT (exit) @ location: 39 + [ -1 + 9 + {} ] + - LT (entry) @ location: 40 + [ -1 + 9 + {} ] + - log/[halt] (exit) @ location: 40 + [ True + 9 + {} ] + - [halt] (entry) @ location: 38 + [ True + 9 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + True + 9 + {} ] + - SWAP (entry) @ location: 41 + [ 2 + True + 9 + {} ] + - log/[halt] (exit) @ location: 41 + [ True + 2 + 9 + {} ] + - [halt] (entry) @ location: 30 + [ True + 2 + 9 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 6 ; 7 ; 8 } + True + 2 + 9 + {} ] + - SWAP (entry) @ location: 42 + [ { 3 ; 6 ; 7 ; 8 } + True + 2 + 9 + {} ] + - log/IF (exit) @ location: 42 + [ True + { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - IF (entry) @ location: 43 + [ True + { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - log/DIP (exit) @ location: 43 + [ { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - DIP (entry) @ location: 45 + [ { 3 ; 6 ; 7 ; 8 } + 2 + 9 + {} ] + - log/SWAP (exit) @ location: 45 + [ 2 + 9 + {} ] + - SWAP (entry) @ location: 47 + [ 2 + 9 + {} ] + - log/DIP (exit) @ location: 47 + [ 9 + 2 + {} ] + - DIP (entry) @ location: 48 + [ 9 + 2 + {} ] + - log/CONS (exit) @ location: 48 + [ 2 + {} ] + - CONS (entry) @ location: 50 + [ 2 + {} ] + - log/[halt] (exit) @ location: 50 + [ { 2 } ] + - [halt] (entry) @ location: 50 + [ { 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 9 + { 2 } ] + - [halt] (entry) @ location: 46 + [ 9 + { 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - CONST (entry) @ location: 51 + [ { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 6 ; 7 ; 8 } + 9 + { 2 } ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 6 ; 7 ; 8 } + 9 + { 2 } ] + - SWAP (entry) @ location: 28 + [ 3 + { 6 ; 7 ; 8 } + 9 + { 2 } ] + - log/DIP (exit) @ location: 28 + [ { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - DIP (entry) @ location: 29 + [ { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - log/DUP (exit) @ location: 29 + [ 3 + 9 + { 2 } ] + - DUP (entry) @ location: 31 + [ 3 + 9 + { 2 } ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 9 + { 2 } ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 9 + { 2 } ] + - log/DUP (exit) @ location: 32 + [ 9 + { 2 } ] + - DUP (entry) @ location: 35 + [ 9 + { 2 } ] + - log/[halt] (exit) @ location: 35 + [ 9 + 9 + { 2 } ] + - [halt] (entry) @ location: 35 + [ 9 + 9 + { 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 9 + 9 + { 2 } ] + - log/CONST (exit) @ location: 32 + [ 3 + 9 + 9 + { 2 } ] + - CONST (entry) @ location: 32 + [ 3 + 9 + 9 + { 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 9 + 9 + { 2 } ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 9 + 9 + { 2 } ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 9 + 9 + { 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 9 + 9 + { 2 } ] + - COMPARE (entry) @ location: 39 + [ 3 + 9 + 9 + { 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 9 + { 2 } ] + - LT (entry) @ location: 40 + [ -1 + 9 + { 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 9 + { 2 } ] + - [halt] (entry) @ location: 38 + [ True + 9 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + True + 9 + { 2 } ] + - SWAP (entry) @ location: 41 + [ 3 + True + 9 + { 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 3 + 9 + { 2 } ] + - [halt] (entry) @ location: 30 + [ True + 3 + 9 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 6 ; 7 ; 8 } + True + 3 + 9 + { 2 } ] + - SWAP (entry) @ location: 42 + [ { 6 ; 7 ; 8 } + True + 3 + 9 + { 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - IF (entry) @ location: 43 + [ True + { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - log/DIP (exit) @ location: 43 + [ { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - DIP (entry) @ location: 45 + [ { 6 ; 7 ; 8 } + 3 + 9 + { 2 } ] + - log/SWAP (exit) @ location: 45 + [ 3 + 9 + { 2 } ] + - SWAP (entry) @ location: 47 + [ 3 + 9 + { 2 } ] + - log/DIP (exit) @ location: 47 + [ 9 + 3 + { 2 } ] + - DIP (entry) @ location: 48 + [ 9 + 3 + { 2 } ] + - log/CONS (exit) @ location: 48 + [ 3 + { 2 } ] + - CONS (entry) @ location: 50 + [ 3 + { 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 9 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 6 ; 7 ; 8 } + 9 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 6 + { 7 ; 8 } + 9 + { 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 6 + { 7 ; 8 } + 9 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 6 + 9 + { 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 6 + 9 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 6 + 6 + 9 + { 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 6 + 6 + 9 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 9 + { 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 9 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 9 + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 9 + 9 + { 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 9 + 9 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 6 + 9 + 9 + { 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 6 + 9 + 9 + { 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 6 + 6 + 9 + 9 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 6 + 6 + 9 + 9 + { 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 6 + 6 + 9 + 9 + { 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 6 + 9 + 9 + { 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 6 + 9 + 9 + { 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 9 + { 3 ; 2 } ] + - LT (entry) @ location: 40 + [ -1 + 9 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ True + 9 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 6 + True + 9 + { 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 6 + True + 9 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 6 + 9 + { 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ True + 6 + 9 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 7 ; 8 } + True + 6 + 9 + { 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ { 7 ; 8 } + True + 6 + 9 + { 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - IF (entry) @ location: 43 + [ True + { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 43 + [ { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - DIP (entry) @ location: 45 + [ { 7 ; 8 } + 6 + 9 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 45 + [ 6 + 9 + { 3 ; 2 } ] + - SWAP (entry) @ location: 47 + [ 6 + 9 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 47 + [ 9 + 6 + { 3 ; 2 } ] + - DIP (entry) @ location: 48 + [ 9 + 6 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 48 + [ 6 + { 3 ; 2 } ] + - CONS (entry) @ location: 50 + [ 6 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 9 + { 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 7 ; 8 } + 9 + { 6 ; 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 7 + { 8 } + 9 + { 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 7 + { 8 } + 9 + { 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 7 + 9 + { 6 ; 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 7 + 9 + { 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 7 + 7 + 9 + { 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 7 + 7 + 9 + { 6 ; 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 9 + { 6 ; 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 9 + { 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 9 + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 9 + 9 + { 6 ; 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 9 + 9 + { 6 ; 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 7 + 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 7 + 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 7 + 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 7 + 9 + 9 + { 6 ; 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 9 + { 6 ; 3 ; 2 } ] + - LT (entry) @ location: 40 + [ -1 + 9 + { 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ True + 9 + { 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 7 + True + 9 + { 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 7 + True + 9 + { 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 7 + 9 + { 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ True + 7 + 9 + { 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 8 } + True + 7 + 9 + { 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ { 8 } + True + 7 + 9 + { 6 ; 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - IF (entry) @ location: 43 + [ True + { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 43 + [ { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 45 + [ { 8 } + 7 + 9 + { 6 ; 3 ; 2 } ] + - log/SWAP (exit) @ location: 45 + [ 7 + 9 + { 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 47 + [ 7 + 9 + { 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 47 + [ 9 + 7 + { 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 48 + [ 9 + 7 + { 6 ; 3 ; 2 } ] + - log/CONS (exit) @ location: 48 + [ 7 + { 6 ; 3 ; 2 } ] + - CONS (entry) @ location: 50 + [ 7 + { 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 8 } + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 8 + {} + 9 + { 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 8 + {} + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 8 + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 8 + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 9 + { 7 ; 6 ; 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 8 + 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 8 + 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 8 + 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 8 + 9 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - LT (entry) @ location: 40 + [ -1 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ True + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 8 + True + 9 + { 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 8 + True + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ True + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ {} + True + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ {} + True + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ True + {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - IF (entry) @ location: 43 + [ True + {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 43 + [ {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 45 + [ {} + 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/SWAP (exit) @ location: 45 + [ 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 47 + [ 8 + 9 + { 7 ; 6 ; 3 ; 2 } ] + - log/DIP (exit) @ location: 47 + [ 9 + 8 + { 7 ; 6 ; 3 ; 2 } ] + - DIP (entry) @ location: 48 + [ 9 + 8 + { 7 ; 6 ; 3 ; 2 } ] + - log/CONS (exit) @ location: 48 + [ 8 + { 7 ; 6 ; 3 ; 2 } ] + - CONS (entry) @ location: 50 + [ 8 + { 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/NIL (exit) @ location: 26 + [ 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - NIL (entry) @ location: 61 + [ 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/CONST (exit) @ location: 61 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - CONST (entry) @ location: 63 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/[halt] (exit) @ location: 63 + [ False + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 66 + [ {} + 9 + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/CONS (exit) @ location: 66 + [ 9 + {} + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - CONS (entry) @ location: 67 + [ 9 + {} + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/SWAP (exit) @ location: 67 + [ { 9 } + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - SWAP (entry) @ location: 68 + [ { 9 } + { 8 ; 7 ; 6 ; 3 ; 2 } ] + - log/ITER (exit) @ location: 68 + [ { 8 ; 7 ; 6 ; 3 ; 2 } + { 9 } ] + - ITER (entry) @ location: 69 + [ { 8 ; 7 ; 6 ; 3 ; 2 } + { 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 8 + { 9 } ] + - CONS (entry) @ location: 71 + [ 8 + { 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 7 + { 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 7 + { 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 6 + { 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 6 + { 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 3 + { 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 3 + { 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 3 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 3 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 2 + { 3 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 2 + { 3 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 13 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 5 + { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - SWAP (entry) @ location: 15 + [ 5 + { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } ] + - log/DIP (exit) @ location: 15 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 ] + - DIP (entry) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 5 + {} ] + - CONST (entry) @ location: 16 + [ 5 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - CONST (entry) @ location: 21 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + {} ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - DIP (entry) @ location: 29 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - log/DUP (exit) @ location: 29 + [ 2 + 5 + {} ] + - DUP (entry) @ location: 31 + [ 2 + 5 + {} ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 5 + {} ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 5 + {} ] + - log/DUP (exit) @ location: 32 + [ 5 + {} ] + - DUP (entry) @ location: 35 + [ 5 + {} ] + - log/[halt] (exit) @ location: 35 + [ 5 + 5 + {} ] + - [halt] (entry) @ location: 35 + [ 5 + 5 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 5 + 5 + {} ] + - log/CONST (exit) @ location: 32 + [ 2 + 5 + 5 + {} ] + - CONST (entry) @ location: 32 + [ 2 + 5 + 5 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 5 + 5 + {} ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 5 + 5 + {} ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 5 + 5 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 5 + 5 + {} ] + - COMPARE (entry) @ location: 39 + [ 2 + 5 + 5 + {} ] + - log/LT (exit) @ location: 39 + [ -1 + 5 + {} ] + - LT (entry) @ location: 40 + [ -1 + 5 + {} ] + - log/[halt] (exit) @ location: 40 + [ True + 5 + {} ] + - [halt] (entry) @ location: 38 + [ True + 5 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + True + 5 + {} ] + - SWAP (entry) @ location: 41 + [ 2 + True + 5 + {} ] + - log/[halt] (exit) @ location: 41 + [ True + 2 + 5 + {} ] + - [halt] (entry) @ location: 30 + [ True + 2 + 5 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + True + 2 + 5 + {} ] + - SWAP (entry) @ location: 42 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + True + 2 + 5 + {} ] + - log/IF (exit) @ location: 42 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - IF (entry) @ location: 43 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - log/DIP (exit) @ location: 43 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - DIP (entry) @ location: 45 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 2 + 5 + {} ] + - log/SWAP (exit) @ location: 45 + [ 2 + 5 + {} ] + - SWAP (entry) @ location: 47 + [ 2 + 5 + {} ] + - log/DIP (exit) @ location: 47 + [ 5 + 2 + {} ] + - DIP (entry) @ location: 48 + [ 5 + 2 + {} ] + - log/CONS (exit) @ location: 48 + [ 2 + {} ] + - CONS (entry) @ location: 50 + [ 2 + {} ] + - log/[halt] (exit) @ location: 50 + [ { 2 } ] + - [halt] (entry) @ location: 50 + [ { 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 5 + { 2 } ] + - [halt] (entry) @ location: 46 + [ 5 + { 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - CONST (entry) @ location: 51 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - SWAP (entry) @ location: 28 + [ 3 + { 6 ; 7 ; 8 ; 9 } + 5 + { 2 } ] + - log/DIP (exit) @ location: 28 + [ { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - DIP (entry) @ location: 29 + [ { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - log/DUP (exit) @ location: 29 + [ 3 + 5 + { 2 } ] + - DUP (entry) @ location: 31 + [ 3 + 5 + { 2 } ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 5 + { 2 } ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 5 + { 2 } ] + - log/DUP (exit) @ location: 32 + [ 5 + { 2 } ] + - DUP (entry) @ location: 35 + [ 5 + { 2 } ] + - log/[halt] (exit) @ location: 35 + [ 5 + 5 + { 2 } ] + - [halt] (entry) @ location: 35 + [ 5 + 5 + { 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 5 + 5 + { 2 } ] + - log/CONST (exit) @ location: 32 + [ 3 + 5 + 5 + { 2 } ] + - CONST (entry) @ location: 32 + [ 3 + 5 + 5 + { 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 5 + 5 + { 2 } ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 5 + 5 + { 2 } ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 5 + 5 + { 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 5 + 5 + { 2 } ] + - COMPARE (entry) @ location: 39 + [ 3 + 5 + 5 + { 2 } ] + - log/LT (exit) @ location: 39 + [ -1 + 5 + { 2 } ] + - LT (entry) @ location: 40 + [ -1 + 5 + { 2 } ] + - log/[halt] (exit) @ location: 40 + [ True + 5 + { 2 } ] + - [halt] (entry) @ location: 38 + [ True + 5 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + True + 5 + { 2 } ] + - SWAP (entry) @ location: 41 + [ 3 + True + 5 + { 2 } ] + - log/[halt] (exit) @ location: 41 + [ True + 3 + 5 + { 2 } ] + - [halt] (entry) @ location: 30 + [ True + 3 + 5 + { 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 6 ; 7 ; 8 ; 9 } + True + 3 + 5 + { 2 } ] + - SWAP (entry) @ location: 42 + [ { 6 ; 7 ; 8 ; 9 } + True + 3 + 5 + { 2 } ] + - log/IF (exit) @ location: 42 + [ True + { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - IF (entry) @ location: 43 + [ True + { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - log/DIP (exit) @ location: 43 + [ { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - DIP (entry) @ location: 45 + [ { 6 ; 7 ; 8 ; 9 } + 3 + 5 + { 2 } ] + - log/SWAP (exit) @ location: 45 + [ 3 + 5 + { 2 } ] + - SWAP (entry) @ location: 47 + [ 3 + 5 + { 2 } ] + - log/DIP (exit) @ location: 47 + [ 5 + 3 + { 2 } ] + - DIP (entry) @ location: 48 + [ 5 + 3 + { 2 } ] + - log/CONS (exit) @ location: 48 + [ 3 + { 2 } ] + - CONS (entry) @ location: 50 + [ 3 + { 2 } ] + - log/[halt] (exit) @ location: 50 + [ { 3 ; 2 } ] + - [halt] (entry) @ location: 50 + [ { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 46 + [ 5 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - CONST (entry) @ location: 51 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ True + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - IF_CONS (entry) @ location: 26 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 26 + [ 6 + { 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - SWAP (entry) @ location: 28 + [ 6 + { 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 28 + [ { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - DIP (entry) @ location: 29 + [ { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 29 + [ 6 + 5 + { 3 ; 2 } ] + - DUP (entry) @ location: 31 + [ 6 + 5 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 31 + [ 6 + 6 + 5 + { 3 ; 2 } ] + - DIP (entry) @ location: 32 + [ 6 + 6 + 5 + { 3 ; 2 } ] + - log/DUP (exit) @ location: 32 + [ 5 + { 3 ; 2 } ] + - DUP (entry) @ location: 35 + [ 5 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 35 + [ 5 + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 35 + [ 5 + 5 + { 3 ; 2 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 5 + 5 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 32 + [ 6 + 5 + 5 + { 3 ; 2 } ] + - CONST (entry) @ location: 32 + [ 6 + 5 + 5 + { 3 ; 2 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 6 + 6 + 5 + 5 + { 3 ; 2 } ] + - log/DIP (exit) @ location: 32 + [ 6 + 6 + 5 + 5 + { 3 ; 2 } ] + - DIP (entry) @ location: 36 + [ 6 + 6 + 5 + 5 + { 3 ; 2 } ] + - log/COMPARE (exit) @ location: 36 + [ 6 + 5 + 5 + { 3 ; 2 } ] + - COMPARE (entry) @ location: 39 + [ 6 + 5 + 5 + { 3 ; 2 } ] + - log/LT (exit) @ location: 39 + [ 1 + 5 + { 3 ; 2 } ] + - LT (entry) @ location: 40 + [ 1 + 5 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 40 + [ False + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 38 + [ False + 5 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 6 + False + 5 + { 3 ; 2 } ] + - SWAP (entry) @ location: 41 + [ 6 + False + 5 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 41 + [ False + 6 + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 30 + [ False + 6 + 5 + { 3 ; 2 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 7 ; 8 ; 9 } + False + 6 + 5 + { 3 ; 2 } ] + - SWAP (entry) @ location: 42 + [ { 7 ; 8 ; 9 } + False + 6 + 5 + { 3 ; 2 } ] + - log/IF (exit) @ location: 42 + [ False + { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - IF (entry) @ location: 43 + [ False + { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 43 + [ { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - SWAP (entry) @ location: 55 + [ { 7 ; 8 ; 9 } + 6 + 5 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 55 + [ 6 + { 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - CONS (entry) @ location: 56 + [ 6 + { 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/CONST (exit) @ location: 56 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - CONST (entry) @ location: 57 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/[halt] (exit) @ location: 57 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - [halt] (entry) @ location: 66 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - SWAP (entry) @ location: 66 + [ { 6 ; 7 ; 8 ; 9 } + 5 + { 3 ; 2 } ] + - log/CONS (exit) @ location: 66 + [ 5 + { 6 ; 7 ; 8 ; 9 } + { 3 ; 2 } ] + - CONS (entry) @ location: 67 + [ 5 + { 6 ; 7 ; 8 ; 9 } + { 3 ; 2 } ] + - log/SWAP (exit) @ location: 67 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 } ] + - SWAP (entry) @ location: 68 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 } ] + - log/ITER (exit) @ location: 68 + [ { 3 ; 2 } + { 5 ; 6 ; 7 ; 8 ; 9 } ] + - ITER (entry) @ location: 69 + [ { 3 ; 2 } + { 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 3 + { 5 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 3 + { 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 13 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - SWAP (entry) @ location: 15 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/DIP (exit) @ location: 15 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 ] + - DIP (entry) @ location: 16 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 1 + {} ] + - CONST (entry) @ location: 16 + [ 1 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/CONST (exit) @ location: 16 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - CONST (entry) @ location: 21 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - DIP (entry) @ location: 29 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - log/DUP (exit) @ location: 29 + [ 2 + 1 + {} ] + - DUP (entry) @ location: 31 + [ 2 + 1 + {} ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 1 + {} ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 1 + {} ] + - log/DUP (exit) @ location: 32 + [ 1 + {} ] + - DUP (entry) @ location: 35 + [ 1 + {} ] + - log/[halt] (exit) @ location: 35 + [ 1 + 1 + {} ] + - [halt] (entry) @ location: 35 + [ 1 + 1 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 1 + 1 + {} ] + - log/CONST (exit) @ location: 32 + [ 2 + 1 + 1 + {} ] + - CONST (entry) @ location: 32 + [ 2 + 1 + 1 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 1 + 1 + {} ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 1 + 1 + {} ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 1 + 1 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 1 + 1 + {} ] + - COMPARE (entry) @ location: 39 + [ 2 + 1 + 1 + {} ] + - log/LT (exit) @ location: 39 + [ 1 + 1 + {} ] + - LT (entry) @ location: 40 + [ 1 + 1 + {} ] + - log/[halt] (exit) @ location: 40 + [ False + 1 + {} ] + - [halt] (entry) @ location: 38 + [ False + 1 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + False + 1 + {} ] + - SWAP (entry) @ location: 41 + [ 2 + False + 1 + {} ] + - log/[halt] (exit) @ location: 41 + [ False + 2 + 1 + {} ] + - [halt] (entry) @ location: 30 + [ False + 2 + 1 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + False + 2 + 1 + {} ] + - SWAP (entry) @ location: 42 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + False + 2 + 1 + {} ] + - log/IF (exit) @ location: 42 + [ False + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - IF (entry) @ location: 43 + [ False + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - log/SWAP (exit) @ location: 43 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - SWAP (entry) @ location: 55 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 1 + {} ] + - log/CONS (exit) @ location: 55 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - CONS (entry) @ location: 56 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/CONST (exit) @ location: 56 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - CONST (entry) @ location: 57 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/[halt] (exit) @ location: 57 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - SWAP (entry) @ location: 66 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + {} ] + - log/CONS (exit) @ location: 66 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - CONS (entry) @ location: 67 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - log/SWAP (exit) @ location: 67 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - SWAP (entry) @ location: 68 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - log/ITER (exit) @ location: 68 + [ {} + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - ITER (entry) @ location: 69 + [ {} + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 13 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 4 + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - SWAP (entry) @ location: 15 + [ 4 + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/DIP (exit) @ location: 15 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 ] + - DIP (entry) @ location: 16 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 4 + {} ] + - CONST (entry) @ location: 16 + [ 4 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - log/CONST (exit) @ location: 16 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - CONST (entry) @ location: 21 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 1 ; 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - log/SWAP (exit) @ location: 26 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - SWAP (entry) @ location: 28 + [ 1 + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + {} ] + - log/DIP (exit) @ location: 28 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - DIP (entry) @ location: 29 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - log/DUP (exit) @ location: 29 + [ 1 + 4 + {} ] + - DUP (entry) @ location: 31 + [ 1 + 4 + {} ] + - log/DIP (exit) @ location: 31 + [ 1 + 1 + 4 + {} ] + - DIP (entry) @ location: 32 + [ 1 + 1 + 4 + {} ] + - log/DUP (exit) @ location: 32 + [ 4 + {} ] + - DUP (entry) @ location: 35 + [ 4 + {} ] + - log/[halt] (exit) @ location: 35 + [ 4 + 4 + {} ] + - [halt] (entry) @ location: 35 + [ 4 + 4 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 4 + 4 + {} ] + - log/CONST (exit) @ location: 32 + [ 1 + 4 + 4 + {} ] + - CONST (entry) @ location: 32 + [ 1 + 4 + 4 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 1 + 1 + 4 + 4 + {} ] + - log/DIP (exit) @ location: 32 + [ 1 + 1 + 4 + 4 + {} ] + - DIP (entry) @ location: 36 + [ 1 + 1 + 4 + 4 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 1 + 4 + 4 + {} ] + - COMPARE (entry) @ location: 39 + [ 1 + 4 + 4 + {} ] + - log/LT (exit) @ location: 39 + [ -1 + 4 + {} ] + - LT (entry) @ location: 40 + [ -1 + 4 + {} ] + - log/[halt] (exit) @ location: 40 + [ True + 4 + {} ] + - [halt] (entry) @ location: 38 + [ True + 4 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 1 + True + 4 + {} ] + - SWAP (entry) @ location: 41 + [ 1 + True + 4 + {} ] + - log/[halt] (exit) @ location: 41 + [ True + 1 + 4 + {} ] + - [halt] (entry) @ location: 30 + [ True + 1 + 4 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + True + 1 + 4 + {} ] + - SWAP (entry) @ location: 42 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + True + 1 + 4 + {} ] + - log/IF (exit) @ location: 42 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - IF (entry) @ location: 43 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - log/DIP (exit) @ location: 43 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - DIP (entry) @ location: 45 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 4 + {} ] + - log/SWAP (exit) @ location: 45 + [ 1 + 4 + {} ] + - SWAP (entry) @ location: 47 + [ 1 + 4 + {} ] + - log/DIP (exit) @ location: 47 + [ 4 + 1 + {} ] + - DIP (entry) @ location: 48 + [ 4 + 1 + {} ] + - log/CONS (exit) @ location: 48 + [ 1 + {} ] + - CONS (entry) @ location: 50 + [ 1 + {} ] + - log/[halt] (exit) @ location: 50 + [ { 1 } ] + - [halt] (entry) @ location: 50 + [ { 1 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 4 + { 1 } ] + - [halt] (entry) @ location: 46 + [ 4 + { 1 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - CONST (entry) @ location: 51 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - IF_CONS (entry) @ location: 26 + [ { 2 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - log/SWAP (exit) @ location: 26 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - SWAP (entry) @ location: 28 + [ 2 + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 1 } ] + - log/DIP (exit) @ location: 28 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - DIP (entry) @ location: 29 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - log/DUP (exit) @ location: 29 + [ 2 + 4 + { 1 } ] + - DUP (entry) @ location: 31 + [ 2 + 4 + { 1 } ] + - log/DIP (exit) @ location: 31 + [ 2 + 2 + 4 + { 1 } ] + - DIP (entry) @ location: 32 + [ 2 + 2 + 4 + { 1 } ] + - log/DUP (exit) @ location: 32 + [ 4 + { 1 } ] + - DUP (entry) @ location: 35 + [ 4 + { 1 } ] + - log/[halt] (exit) @ location: 35 + [ 4 + 4 + { 1 } ] + - [halt] (entry) @ location: 35 + [ 4 + 4 + { 1 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 4 + 4 + { 1 } ] + - log/CONST (exit) @ location: 32 + [ 2 + 4 + 4 + { 1 } ] + - CONST (entry) @ location: 32 + [ 2 + 4 + 4 + { 1 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 2 + 2 + 4 + 4 + { 1 } ] + - log/DIP (exit) @ location: 32 + [ 2 + 2 + 4 + 4 + { 1 } ] + - DIP (entry) @ location: 36 + [ 2 + 2 + 4 + 4 + { 1 } ] + - log/COMPARE (exit) @ location: 36 + [ 2 + 4 + 4 + { 1 } ] + - COMPARE (entry) @ location: 39 + [ 2 + 4 + 4 + { 1 } ] + - log/LT (exit) @ location: 39 + [ -1 + 4 + { 1 } ] + - LT (entry) @ location: 40 + [ -1 + 4 + { 1 } ] + - log/[halt] (exit) @ location: 40 + [ True + 4 + { 1 } ] + - [halt] (entry) @ location: 38 + [ True + 4 + { 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 2 + True + 4 + { 1 } ] + - SWAP (entry) @ location: 41 + [ 2 + True + 4 + { 1 } ] + - log/[halt] (exit) @ location: 41 + [ True + 2 + 4 + { 1 } ] + - [halt] (entry) @ location: 30 + [ True + 2 + 4 + { 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + True + 2 + 4 + { 1 } ] + - SWAP (entry) @ location: 42 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + True + 2 + 4 + { 1 } ] + - log/IF (exit) @ location: 42 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - IF (entry) @ location: 43 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - log/DIP (exit) @ location: 43 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - DIP (entry) @ location: 45 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 2 + 4 + { 1 } ] + - log/SWAP (exit) @ location: 45 + [ 2 + 4 + { 1 } ] + - SWAP (entry) @ location: 47 + [ 2 + 4 + { 1 } ] + - log/DIP (exit) @ location: 47 + [ 4 + 2 + { 1 } ] + - DIP (entry) @ location: 48 + [ 4 + 2 + { 1 } ] + - log/CONS (exit) @ location: 48 + [ 2 + { 1 } ] + - CONS (entry) @ location: 50 + [ 2 + { 1 } ] + - log/[halt] (exit) @ location: 50 + [ { 2 ; 1 } ] + - [halt] (entry) @ location: 50 + [ { 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 46 + [ 4 + { 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - CONST (entry) @ location: 51 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - IF_CONS (entry) @ location: 26 + [ { 3 ; 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - log/SWAP (exit) @ location: 26 + [ 3 + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - SWAP (entry) @ location: 28 + [ 3 + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 2 ; 1 } ] + - log/DIP (exit) @ location: 28 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - DIP (entry) @ location: 29 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - log/DUP (exit) @ location: 29 + [ 3 + 4 + { 2 ; 1 } ] + - DUP (entry) @ location: 31 + [ 3 + 4 + { 2 ; 1 } ] + - log/DIP (exit) @ location: 31 + [ 3 + 3 + 4 + { 2 ; 1 } ] + - DIP (entry) @ location: 32 + [ 3 + 3 + 4 + { 2 ; 1 } ] + - log/DUP (exit) @ location: 32 + [ 4 + { 2 ; 1 } ] + - DUP (entry) @ location: 35 + [ 4 + { 2 ; 1 } ] + - log/[halt] (exit) @ location: 35 + [ 4 + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 35 + [ 4 + 4 + { 2 ; 1 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 4 + 4 + { 2 ; 1 } ] + - log/CONST (exit) @ location: 32 + [ 3 + 4 + 4 + { 2 ; 1 } ] + - CONST (entry) @ location: 32 + [ 3 + 4 + 4 + { 2 ; 1 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 3 + 3 + 4 + 4 + { 2 ; 1 } ] + - log/DIP (exit) @ location: 32 + [ 3 + 3 + 4 + 4 + { 2 ; 1 } ] + - DIP (entry) @ location: 36 + [ 3 + 3 + 4 + 4 + { 2 ; 1 } ] + - log/COMPARE (exit) @ location: 36 + [ 3 + 4 + 4 + { 2 ; 1 } ] + - COMPARE (entry) @ location: 39 + [ 3 + 4 + 4 + { 2 ; 1 } ] + - log/LT (exit) @ location: 39 + [ -1 + 4 + { 2 ; 1 } ] + - LT (entry) @ location: 40 + [ -1 + 4 + { 2 ; 1 } ] + - log/[halt] (exit) @ location: 40 + [ True + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 38 + [ True + 4 + { 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 3 + True + 4 + { 2 ; 1 } ] + - SWAP (entry) @ location: 41 + [ 3 + True + 4 + { 2 ; 1 } ] + - log/[halt] (exit) @ location: 41 + [ True + 3 + 4 + { 2 ; 1 } ] + - [halt] (entry) @ location: 30 + [ True + 3 + 4 + { 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + True + 3 + 4 + { 2 ; 1 } ] + - SWAP (entry) @ location: 42 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + True + 3 + 4 + { 2 ; 1 } ] + - log/IF (exit) @ location: 42 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - IF (entry) @ location: 43 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - log/DIP (exit) @ location: 43 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - DIP (entry) @ location: 45 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 3 + 4 + { 2 ; 1 } ] + - log/SWAP (exit) @ location: 45 + [ 3 + 4 + { 2 ; 1 } ] + - SWAP (entry) @ location: 47 + [ 3 + 4 + { 2 ; 1 } ] + - log/DIP (exit) @ location: 47 + [ 4 + 3 + { 2 ; 1 } ] + - DIP (entry) @ location: 48 + [ 4 + 3 + { 2 ; 1 } ] + - log/CONS (exit) @ location: 48 + [ 3 + { 2 ; 1 } ] + - CONS (entry) @ location: 50 + [ 3 + { 2 ; 1 } ] + - log/[halt] (exit) @ location: 50 + [ { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 50 + [ { 3 ; 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 48 + [ 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 46 + [ 4 + { 3 ; 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 45 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - CONST (entry) @ location: 51 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/[halt] (exit) @ location: 51 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ True + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - IF_CONS (entry) @ location: 26 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/SWAP (exit) @ location: 26 + [ 5 + { 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 28 + [ 5 + { 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/DIP (exit) @ location: 28 + [ { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - DIP (entry) @ location: 29 + [ { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - log/DUP (exit) @ location: 29 + [ 5 + 4 + { 3 ; 2 ; 1 } ] + - DUP (entry) @ location: 31 + [ 5 + 4 + { 3 ; 2 ; 1 } ] + - log/DIP (exit) @ location: 31 + [ 5 + 5 + 4 + { 3 ; 2 ; 1 } ] + - DIP (entry) @ location: 32 + [ 5 + 5 + 4 + { 3 ; 2 ; 1 } ] + - log/DUP (exit) @ location: 32 + [ 4 + { 3 ; 2 ; 1 } ] + - DUP (entry) @ location: 35 + [ 4 + { 3 ; 2 ; 1 } ] + - log/[halt] (exit) @ location: 35 + [ 4 + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 35 + [ 4 + 4 + { 3 ; 2 ; 1 } ] + - control: KCons + - CONST (entry) @ location: 32 + [ 4 + 4 + { 3 ; 2 ; 1 } ] + - log/CONST (exit) @ location: 32 + [ 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - CONST (entry) @ location: 32 + [ 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - log/log/log/DIP (exit) @ location: 32 + [ 5 + 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - log/DIP (exit) @ location: 32 + [ 5 + 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - DIP (entry) @ location: 36 + [ 5 + 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - log/COMPARE (exit) @ location: 36 + [ 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - COMPARE (entry) @ location: 39 + [ 5 + 4 + 4 + { 3 ; 2 ; 1 } ] + - log/LT (exit) @ location: 39 + [ 1 + 4 + { 3 ; 2 ; 1 } ] + - LT (entry) @ location: 40 + [ 1 + 4 + { 3 ; 2 ; 1 } ] + - log/[halt] (exit) @ location: 40 + [ False + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 38 + [ False + 4 + { 3 ; 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 5 + False + 4 + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 41 + [ 5 + False + 4 + { 3 ; 2 ; 1 } ] + - log/[halt] (exit) @ location: 41 + [ False + 5 + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 30 + [ False + 5 + 4 + { 3 ; 2 ; 1 } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 6 ; 7 ; 8 ; 9 } + False + 5 + 4 + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 42 + [ { 6 ; 7 ; 8 ; 9 } + False + 5 + 4 + { 3 ; 2 ; 1 } ] + - log/IF (exit) @ location: 42 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - IF (entry) @ location: 43 + [ False + { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - log/SWAP (exit) @ location: 43 + [ { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 55 + [ { 6 ; 7 ; 8 ; 9 } + 5 + 4 + { 3 ; 2 ; 1 } ] + - log/CONS (exit) @ location: 55 + [ 5 + { 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - CONS (entry) @ location: 56 + [ 5 + { 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/CONST (exit) @ location: 56 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - CONST (entry) @ location: 57 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/[halt] (exit) @ location: 57 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - [halt] (entry) @ location: 66 + [ False + { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 66 + [ { 5 ; 6 ; 7 ; 8 ; 9 } + 4 + { 3 ; 2 ; 1 } ] + - log/CONS (exit) @ location: 66 + [ 4 + { 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 ; 1 } ] + - CONS (entry) @ location: 67 + [ 4 + { 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 ; 1 } ] + - log/SWAP (exit) @ location: 67 + [ { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 ; 1 } ] + - SWAP (entry) @ location: 68 + [ { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + { 3 ; 2 ; 1 } ] + - log/ITER (exit) @ location: 68 + [ { 3 ; 2 ; 1 } + { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - ITER (entry) @ location: 69 + [ { 3 ; 2 ; 1 } + { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 3 + { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 3 + { 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 2 + { 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 2 + { 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/CONS (exit) @ location: 69 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - CONS (entry) @ location: 71 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 71 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 69 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 13 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - log/SWAP (exit) @ location: 13 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - SWAP (entry) @ location: 15 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/DIP (exit) @ location: 15 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 ] + - DIP (entry) @ location: 16 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 ] + - log/NIL (exit) @ location: 16 + [ ] + - NIL (entry) @ location: 19 + [ ] + - log/[halt] (exit) @ location: 19 + [ {} ] + - [halt] (entry) @ location: 19 + [ {} ] + - control: KCons + - CONST (entry) @ location: 16 + [ {} ] + - log/CONST (exit) @ location: 16 + [ 0 + {} ] + - CONST (entry) @ location: 16 + [ 0 + {} ] + - log/log/log/CONST (exit) @ location: 16 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/CONST (exit) @ location: 16 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - CONST (entry) @ location: 21 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/LOOP (exit) @ location: 21 + [ True + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - LOOP (entry) @ location: 66 + [ True + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 66 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - IF_CONS (entry) @ location: 26 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/SWAP (exit) @ location: 26 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - SWAP (entry) @ location: 28 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/DIP (exit) @ location: 28 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - DIP (entry) @ location: 29 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - log/DUP (exit) @ location: 29 + [ 1 + 0 + {} ] + - DUP (entry) @ location: 31 + [ 1 + 0 + {} ] + - log/DIP (exit) @ location: 31 + [ 1 + 1 + 0 + {} ] + - DIP (entry) @ location: 32 + [ 1 + 1 + 0 + {} ] + - log/DUP (exit) @ location: 32 + [ 0 + {} ] + - DUP (entry) @ location: 35 + [ 0 + {} ] + - log/[halt] (exit) @ location: 35 + [ 0 + 0 + {} ] + - [halt] (entry) @ location: 35 + [ 0 + 0 + {} ] + - control: KCons + - CONST (entry) @ location: 32 + [ 0 + 0 + {} ] + - log/CONST (exit) @ location: 32 + [ 1 + 0 + 0 + {} ] + - CONST (entry) @ location: 32 + [ 1 + 0 + 0 + {} ] + - log/log/log/DIP (exit) @ location: 32 + [ 1 + 1 + 0 + 0 + {} ] + - log/DIP (exit) @ location: 32 + [ 1 + 1 + 0 + 0 + {} ] + - DIP (entry) @ location: 36 + [ 1 + 1 + 0 + 0 + {} ] + - log/COMPARE (exit) @ location: 36 + [ 1 + 0 + 0 + {} ] + - COMPARE (entry) @ location: 39 + [ 1 + 0 + 0 + {} ] + - log/LT (exit) @ location: 39 + [ 1 + 0 + {} ] + - LT (entry) @ location: 40 + [ 1 + 0 + {} ] + - log/[halt] (exit) @ location: 40 + [ False + 0 + {} ] + - [halt] (entry) @ location: 38 + [ False + 0 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 36 + [ 1 + False + 0 + {} ] + - SWAP (entry) @ location: 41 + [ 1 + False + 0 + {} ] + - log/[halt] (exit) @ location: 41 + [ False + 1 + 0 + {} ] + - [halt] (entry) @ location: 30 + [ False + 1 + 0 + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 29 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + False + 1 + 0 + {} ] + - SWAP (entry) @ location: 42 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + False + 1 + 0 + {} ] + - log/IF (exit) @ location: 42 + [ False + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - IF (entry) @ location: 43 + [ False + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - log/SWAP (exit) @ location: 43 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - SWAP (entry) @ location: 55 + [ { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 1 + 0 + {} ] + - log/CONS (exit) @ location: 55 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - CONS (entry) @ location: 56 + [ 1 + { 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/CONST (exit) @ location: 56 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - CONST (entry) @ location: 57 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/[halt] (exit) @ location: 57 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 43 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - control: KCons + - log/[halt] (exit) @ location: 26 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - [halt] (entry) @ location: 66 + [ False + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - control: KLoop_in + - control: KCons + - log/SWAP (exit) @ location: 66 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - SWAP (entry) @ location: 66 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + 0 + {} ] + - log/CONS (exit) @ location: 66 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - CONS (entry) @ location: 67 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - log/SWAP (exit) @ location: 67 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - SWAP (entry) @ location: 68 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } + {} ] + - log/ITER (exit) @ location: 68 + [ {} + { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - ITER (entry) @ location: 69 + [ {} + { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/[halt] (exit) @ location: 69 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - [halt] (entry) @ location: 13 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - control: KIter + - control: KCons + - log/NIL (exit) @ location: 13 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - NIL (entry) @ location: 72 + [ { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/PAIR (exit) @ location: 72 + [ {} + { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - PAIR (entry) @ location: 74 + [ {} + { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 } ] + - log/[halt] (exit) @ location: 74 + [ (Pair {} { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 }) ] + - [halt] (entry) @ location: 8 + [ (Pair {} { 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/list_map_block.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/list_map_block.out new file mode 100644 index 000000000000..5a58e884b133 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/list_map_block.out @@ -0,0 +1,451 @@ + +trace + - CAR (interp) @ location: 9 + [ (Pair { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } {}) ] + - CAR (entry) @ location: 9 + [ (Pair { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } {}) ] + - log/CONST (exit) @ location: 9 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } ] + - CONST (entry) @ location: 10 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } ] + - log/SWAP (exit) @ location: 10 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } ] + - SWAP (entry) @ location: 13 + [ 0 + { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } ] + - log/MAP (exit) @ location: 13 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } + 0 ] + - MAP (entry) @ location: 14 + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 } + 0 ] + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 1 + 0 ] + - DIP (entry) @ location: 16 + [ 1 + 0 ] + - log/DUP (exit) @ location: 16 + [ 0 ] + - DUP (entry) @ location: 18 + [ 0 ] + - log/[halt] (exit) @ location: 18 + [ 0 + 0 ] + - [halt] (entry) @ location: 18 + [ 0 + 0 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 1 + 0 + 0 ] + - ADD (entry) @ location: 19 + [ 1 + 0 + 0 ] + - log/DIP (exit) @ location: 19 + [ 1 + 0 ] + - DIP (entry) @ location: 20 + [ 1 + 0 ] + - log/CONST (exit) @ location: 20 + [ 0 ] + - CONST (entry) @ location: 22 + [ 0 ] + - log/ADD (exit) @ location: 22 + [ 1 + 0 ] + - ADD (entry) @ location: 25 + [ 1 + 0 ] + - log/[halt] (exit) @ location: 25 + [ 1 ] + - [halt] (entry) @ location: 21 + [ 1 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 1 + 1 ] + - [halt] (entry) @ location: 14 + [ 1 + 1 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 2 + 1 ] + - DIP (entry) @ location: 16 + [ 2 + 1 ] + - log/DUP (exit) @ location: 16 + [ 1 ] + - DUP (entry) @ location: 18 + [ 1 ] + - log/[halt] (exit) @ location: 18 + [ 1 + 1 ] + - [halt] (entry) @ location: 18 + [ 1 + 1 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 2 + 1 + 1 ] + - ADD (entry) @ location: 19 + [ 2 + 1 + 1 ] + - log/DIP (exit) @ location: 19 + [ 3 + 1 ] + - DIP (entry) @ location: 20 + [ 3 + 1 ] + - log/CONST (exit) @ location: 20 + [ 1 ] + - CONST (entry) @ location: 22 + [ 1 ] + - log/ADD (exit) @ location: 22 + [ 1 + 1 ] + - ADD (entry) @ location: 25 + [ 1 + 1 ] + - log/[halt] (exit) @ location: 25 + [ 2 ] + - [halt] (entry) @ location: 21 + [ 2 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 3 + 2 ] + - [halt] (entry) @ location: 14 + [ 3 + 2 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 3 + 2 ] + - DIP (entry) @ location: 16 + [ 3 + 2 ] + - log/DUP (exit) @ location: 16 + [ 2 ] + - DUP (entry) @ location: 18 + [ 2 ] + - log/[halt] (exit) @ location: 18 + [ 2 + 2 ] + - [halt] (entry) @ location: 18 + [ 2 + 2 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 3 + 2 + 2 ] + - ADD (entry) @ location: 19 + [ 3 + 2 + 2 ] + - log/DIP (exit) @ location: 19 + [ 5 + 2 ] + - DIP (entry) @ location: 20 + [ 5 + 2 ] + - log/CONST (exit) @ location: 20 + [ 2 ] + - CONST (entry) @ location: 22 + [ 2 ] + - log/ADD (exit) @ location: 22 + [ 1 + 2 ] + - ADD (entry) @ location: 25 + [ 1 + 2 ] + - log/[halt] (exit) @ location: 25 + [ 3 ] + - [halt] (entry) @ location: 21 + [ 3 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 5 + 3 ] + - [halt] (entry) @ location: 14 + [ 5 + 3 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 4 + 3 ] + - DIP (entry) @ location: 16 + [ 4 + 3 ] + - log/DUP (exit) @ location: 16 + [ 3 ] + - DUP (entry) @ location: 18 + [ 3 ] + - log/[halt] (exit) @ location: 18 + [ 3 + 3 ] + - [halt] (entry) @ location: 18 + [ 3 + 3 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 4 + 3 + 3 ] + - ADD (entry) @ location: 19 + [ 4 + 3 + 3 ] + - log/DIP (exit) @ location: 19 + [ 7 + 3 ] + - DIP (entry) @ location: 20 + [ 7 + 3 ] + - log/CONST (exit) @ location: 20 + [ 3 ] + - CONST (entry) @ location: 22 + [ 3 ] + - log/ADD (exit) @ location: 22 + [ 1 + 3 ] + - ADD (entry) @ location: 25 + [ 1 + 3 ] + - log/[halt] (exit) @ location: 25 + [ 4 ] + - [halt] (entry) @ location: 21 + [ 4 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 7 + 4 ] + - [halt] (entry) @ location: 14 + [ 7 + 4 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 5 + 4 ] + - DIP (entry) @ location: 16 + [ 5 + 4 ] + - log/DUP (exit) @ location: 16 + [ 4 ] + - DUP (entry) @ location: 18 + [ 4 ] + - log/[halt] (exit) @ location: 18 + [ 4 + 4 ] + - [halt] (entry) @ location: 18 + [ 4 + 4 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 5 + 4 + 4 ] + - ADD (entry) @ location: 19 + [ 5 + 4 + 4 ] + - log/DIP (exit) @ location: 19 + [ 9 + 4 ] + - DIP (entry) @ location: 20 + [ 9 + 4 ] + - log/CONST (exit) @ location: 20 + [ 4 ] + - CONST (entry) @ location: 22 + [ 4 ] + - log/ADD (exit) @ location: 22 + [ 1 + 4 ] + - ADD (entry) @ location: 25 + [ 1 + 4 ] + - log/[halt] (exit) @ location: 25 + [ 5 ] + - [halt] (entry) @ location: 21 + [ 5 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 9 + 5 ] + - [halt] (entry) @ location: 14 + [ 9 + 5 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 6 + 5 ] + - DIP (entry) @ location: 16 + [ 6 + 5 ] + - log/DUP (exit) @ location: 16 + [ 5 ] + - DUP (entry) @ location: 18 + [ 5 ] + - log/[halt] (exit) @ location: 18 + [ 5 + 5 ] + - [halt] (entry) @ location: 18 + [ 5 + 5 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 6 + 5 + 5 ] + - ADD (entry) @ location: 19 + [ 6 + 5 + 5 ] + - log/DIP (exit) @ location: 19 + [ 11 + 5 ] + - DIP (entry) @ location: 20 + [ 11 + 5 ] + - log/CONST (exit) @ location: 20 + [ 5 ] + - CONST (entry) @ location: 22 + [ 5 ] + - log/ADD (exit) @ location: 22 + [ 1 + 5 ] + - ADD (entry) @ location: 25 + [ 1 + 5 ] + - log/[halt] (exit) @ location: 25 + [ 6 ] + - [halt] (entry) @ location: 21 + [ 6 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 11 + 6 ] + - [halt] (entry) @ location: 14 + [ 11 + 6 ] + - control: KList_exit_body + - control: KList_enter_body + - log/DIP (exit) @ location: 14 + [ 7 + 6 ] + - DIP (entry) @ location: 16 + [ 7 + 6 ] + - log/DUP (exit) @ location: 16 + [ 6 ] + - DUP (entry) @ location: 18 + [ 6 ] + - log/[halt] (exit) @ location: 18 + [ 6 + 6 ] + - [halt] (entry) @ location: 18 + [ 6 + 6 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 16 + [ 7 + 6 + 6 ] + - ADD (entry) @ location: 19 + [ 7 + 6 + 6 ] + - log/DIP (exit) @ location: 19 + [ 13 + 6 ] + - DIP (entry) @ location: 20 + [ 13 + 6 ] + - log/CONST (exit) @ location: 20 + [ 6 ] + - CONST (entry) @ location: 22 + [ 6 ] + - log/ADD (exit) @ location: 22 + [ 1 + 6 ] + - ADD (entry) @ location: 25 + [ 1 + 6 ] + - log/[halt] (exit) @ location: 25 + [ 7 ] + - [halt] (entry) @ location: 21 + [ 7 ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 20 + [ 13 + 7 ] + - [halt] (entry) @ location: 14 + [ 13 + 7 ] + - control: KList_exit_body + - control: KList_enter_body + - control: KCons + - log/NIL (exit) @ location: 14 + [ { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 } + 7 ] + - NIL (entry) @ location: 26 + [ { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 } + 7 ] + - log/PAIR (exit) @ location: 26 + [ {} + { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 } + 7 ] + - PAIR (entry) @ location: 28 + [ {} + { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 } + 7 ] + - log/DIP (exit) @ location: 28 + [ (Pair {} { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 }) + 7 ] + - DIP (entry) @ location: 29 + [ (Pair {} { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 }) + 7 ] + - log/DROP (exit) @ location: 29 + [ 7 ] + - DROP (entry) @ location: 31 + [ 7 ] + - log/[halt] (exit) @ location: 31 + [ ] + - [halt] (entry) @ location: 31 + [ ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 29 + [ (Pair {} { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 }) ] + - [halt] (entry) @ location: 8 + [ (Pair {} { 1 ; 3 ; 5 ; 7 ; 9 ; 11 ; 13 }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/loop_left.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/loop_left.out new file mode 100644 index 000000000000..896f7396ad68 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/loop_left.out @@ -0,0 +1,253 @@ + +trace + - CAR (interp) @ location: 9 + [ (Pair { "abc" ; "xyz" } { "zyx" ; "cba" }) ] + - CAR (entry) @ location: 9 + [ (Pair { "abc" ; "xyz" } { "zyx" ; "cba" }) ] + - log/NIL (exit) @ location: 9 + [ { "abc" ; "xyz" } ] + - NIL (entry) @ location: 10 + [ { "abc" ; "xyz" } ] + - log/SWAP (exit) @ location: 10 + [ {} + { "abc" ; "xyz" } ] + - SWAP (entry) @ location: 12 + [ {} + { "abc" ; "xyz" } ] + - log/PAIR (exit) @ location: 12 + [ { "abc" ; "xyz" } + {} ] + - PAIR (entry) @ location: 13 + [ { "abc" ; "xyz" } + {} ] + - log/LEFT (exit) @ location: 13 + [ (Pair { "abc" ; "xyz" } {}) ] + - LEFT (entry) @ location: 14 + [ (Pair { "abc" ; "xyz" } {}) ] + - log/LOOP_LEFT (exit) @ location: 14 + [ (Left (Pair { "abc" ; "xyz" } {})) ] + - LOOP_LEFT (entry) @ location: 41 + [ (Left (Pair { "abc" ; "xyz" } {})) ] + - control: KLoop_in_left + - log/DUP (exit) @ location: 41 + [ (Pair { "abc" ; "xyz" } {}) ] + - DUP (entry) @ location: 19 + [ (Pair { "abc" ; "xyz" } {}) ] + - log/CAR (exit) @ location: 19 + [ (Pair { "abc" ; "xyz" } {}) + (Pair { "abc" ; "xyz" } {}) ] + - CAR (entry) @ location: 20 + [ (Pair { "abc" ; "xyz" } {}) + (Pair { "abc" ; "xyz" } {}) ] + - log/DIP (exit) @ location: 20 + [ { "abc" ; "xyz" } + (Pair { "abc" ; "xyz" } {}) ] + - DIP (entry) @ location: 21 + [ { "abc" ; "xyz" } + (Pair { "abc" ; "xyz" } {}) ] + - log/CDR (exit) @ location: 21 + [ (Pair { "abc" ; "xyz" } {}) ] + - CDR (entry) @ location: 23 + [ (Pair { "abc" ; "xyz" } {}) ] + - log/[halt] (exit) @ location: 23 + [ {} ] + - [halt] (entry) @ location: 23 + [ {} ] + - control: KUndip + - control: KCons + - log/IF_CONS (exit) @ location: 21 + [ { "abc" ; "xyz" } + {} ] + - IF_CONS (entry) @ location: 24 + [ { "abc" ; "xyz" } + {} ] + - log/SWAP (exit) @ location: 24 + [ "abc" + { "xyz" } + {} ] + - SWAP (entry) @ location: 26 + [ "abc" + { "xyz" } + {} ] + - log/DIP (exit) @ location: 26 + [ { "xyz" } + "abc" + {} ] + - DIP (entry) @ location: 27 + [ { "xyz" } + "abc" + {} ] + - log/CONS (exit) @ location: 27 + [ "abc" + {} ] + - CONS (entry) @ location: 29 + [ "abc" + {} ] + - log/[halt] (exit) @ location: 29 + [ { "abc" } ] + - [halt] (entry) @ location: 29 + [ { "abc" } ] + - control: KUndip + - control: KCons + - log/PAIR (exit) @ location: 27 + [ { "xyz" } + { "abc" } ] + - PAIR (entry) @ location: 30 + [ { "xyz" } + { "abc" } ] + - log/LEFT (exit) @ location: 30 + [ (Pair { "xyz" } { "abc" }) ] + - LEFT (entry) @ location: 31 + [ (Pair { "xyz" } { "abc" }) ] + - log/[halt] (exit) @ location: 31 + [ (Left (Pair { "xyz" } { "abc" })) ] + - [halt] (entry) @ location: 41 + [ (Left (Pair { "xyz" } { "abc" })) ] + - control: KCons + - log/[halt] (exit) @ location: 24 + [ (Left (Pair { "xyz" } { "abc" })) ] + - [halt] (entry) @ location: 41 + [ (Left (Pair { "xyz" } { "abc" })) ] + - control: KLoop_in_left + - log/DUP (exit) @ location: 41 + [ (Pair { "xyz" } { "abc" }) ] + - DUP (entry) @ location: 19 + [ (Pair { "xyz" } { "abc" }) ] + - log/CAR (exit) @ location: 19 + [ (Pair { "xyz" } { "abc" }) + (Pair { "xyz" } { "abc" }) ] + - CAR (entry) @ location: 20 + [ (Pair { "xyz" } { "abc" }) + (Pair { "xyz" } { "abc" }) ] + - log/DIP (exit) @ location: 20 + [ { "xyz" } + (Pair { "xyz" } { "abc" }) ] + - DIP (entry) @ location: 21 + [ { "xyz" } + (Pair { "xyz" } { "abc" }) ] + - log/CDR (exit) @ location: 21 + [ (Pair { "xyz" } { "abc" }) ] + - CDR (entry) @ location: 23 + [ (Pair { "xyz" } { "abc" }) ] + - log/[halt] (exit) @ location: 23 + [ { "abc" } ] + - [halt] (entry) @ location: 23 + [ { "abc" } ] + - control: KUndip + - control: KCons + - log/IF_CONS (exit) @ location: 21 + [ { "xyz" } + { "abc" } ] + - IF_CONS (entry) @ location: 24 + [ { "xyz" } + { "abc" } ] + - log/SWAP (exit) @ location: 24 + [ "xyz" + {} + { "abc" } ] + - SWAP (entry) @ location: 26 + [ "xyz" + {} + { "abc" } ] + - log/DIP (exit) @ location: 26 + [ {} + "xyz" + { "abc" } ] + - DIP (entry) @ location: 27 + [ {} + "xyz" + { "abc" } ] + - log/CONS (exit) @ location: 27 + [ "xyz" + { "abc" } ] + - CONS (entry) @ location: 29 + [ "xyz" + { "abc" } ] + - log/[halt] (exit) @ location: 29 + [ { "xyz" ; "abc" } ] + - [halt] (entry) @ location: 29 + [ { "xyz" ; "abc" } ] + - control: KUndip + - control: KCons + - log/PAIR (exit) @ location: 27 + [ {} + { "xyz" ; "abc" } ] + - PAIR (entry) @ location: 30 + [ {} + { "xyz" ; "abc" } ] + - log/LEFT (exit) @ location: 30 + [ (Pair {} { "xyz" ; "abc" }) ] + - LEFT (entry) @ location: 31 + [ (Pair {} { "xyz" ; "abc" }) ] + - log/[halt] (exit) @ location: 31 + [ (Left (Pair {} { "xyz" ; "abc" })) ] + - [halt] (entry) @ location: 41 + [ (Left (Pair {} { "xyz" ; "abc" })) ] + - control: KCons + - log/[halt] (exit) @ location: 24 + [ (Left (Pair {} { "xyz" ; "abc" })) ] + - [halt] (entry) @ location: 41 + [ (Left (Pair {} { "xyz" ; "abc" })) ] + - control: KLoop_in_left + - log/DUP (exit) @ location: 41 + [ (Pair {} { "xyz" ; "abc" }) ] + - DUP (entry) @ location: 19 + [ (Pair {} { "xyz" ; "abc" }) ] + - log/CAR (exit) @ location: 19 + [ (Pair {} { "xyz" ; "abc" }) + (Pair {} { "xyz" ; "abc" }) ] + - CAR (entry) @ location: 20 + [ (Pair {} { "xyz" ; "abc" }) + (Pair {} { "xyz" ; "abc" }) ] + - log/DIP (exit) @ location: 20 + [ {} + (Pair {} { "xyz" ; "abc" }) ] + - DIP (entry) @ location: 21 + [ {} + (Pair {} { "xyz" ; "abc" }) ] + - log/CDR (exit) @ location: 21 + [ (Pair {} { "xyz" ; "abc" }) ] + - CDR (entry) @ location: 23 + [ (Pair {} { "xyz" ; "abc" }) ] + - log/[halt] (exit) @ location: 23 + [ { "xyz" ; "abc" } ] + - [halt] (entry) @ location: 23 + [ { "xyz" ; "abc" } ] + - control: KUndip + - control: KCons + - log/IF_CONS (exit) @ location: 21 + [ {} + { "xyz" ; "abc" } ] + - IF_CONS (entry) @ location: 24 + [ {} + { "xyz" ; "abc" } ] + - log/RIGHT (exit) @ location: 24 + [ { "xyz" ; "abc" } ] + - RIGHT (entry) @ location: 35 + [ { "xyz" ; "abc" } ] + - log/[halt] (exit) @ location: 35 + [ (Right { "xyz" ; "abc" }) ] + - [halt] (entry) @ location: 41 + [ (Right { "xyz" ; "abc" }) ] + - control: KCons + - log/[halt] (exit) @ location: 24 + [ (Right { "xyz" ; "abc" }) ] + - [halt] (entry) @ location: 41 + [ (Right { "xyz" ; "abc" }) ] + - control: KLoop_in_left + - control: KCons + - log/NIL (exit) @ location: 41 + [ { "xyz" ; "abc" } ] + - NIL (entry) @ location: 41 + [ { "xyz" ; "abc" } ] + - log/PAIR (exit) @ location: 41 + [ {} + { "xyz" ; "abc" } ] + - PAIR (entry) @ location: 43 + [ {} + { "xyz" ; "abc" } ] + - log/[halt] (exit) @ location: 43 + [ (Pair {} { "xyz" ; "abc" }) ] + - [halt] (entry) @ location: 8 + [ (Pair {} { "xyz" ; "abc" }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/opt_map.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/opt_map.out new file mode 100644 index 000000000000..e46a51e6dc9b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/opt_map.out @@ -0,0 +1,82 @@ + +trace + - UNPAIR (interp) @ location: 8 + [ (Pair 7 (Some 3)) ] + - UNPAIR (entry) @ location: 8 + [ (Pair 7 (Some 3)) ] + - log/SWAP (exit) @ location: 8 + [ 7 + (Some 3) ] + - SWAP (entry) @ location: 9 + [ 7 + (Some 3) ] + - log/MAP (exit) @ location: 9 + [ (Some 3) + 7 ] + - MAP (entry) @ location: 11 + [ (Some 3) + 7 ] + - log/DIP (exit) @ location: 11 + [ 3 + 7 ] + - DIP (entry) @ location: 12 + [ 3 + 7 ] + - log/DUP (exit) @ location: 12 + [ 7 ] + - DUP (entry) @ location: 14 + [ 7 ] + - log/[halt] (exit) @ location: 14 + [ 7 + 7 ] + - [halt] (entry) @ location: 14 + [ 7 + 7 ] + - control: KUndip + - control: KCons + - log/ADD (exit) @ location: 12 + [ 3 + 7 + 7 ] + - ADD (entry) @ location: 15 + [ 3 + 7 + 7 ] + - log/[halt] (exit) @ location: 15 + [ 10 + 7 ] + - [halt] (entry) @ location: 11 + [ 10 + 7 ] + - control: KMap_head + - log/DIP (exit) @ location: 11 + [ (Some 10) + 7 ] + - DIP (entry) @ location: 16 + [ (Some 10) + 7 ] + - log/DROP (exit) @ location: 16 + [ 7 ] + - DROP (entry) @ location: 18 + [ 7 ] + - log/[halt] (exit) @ location: 18 + [ ] + - [halt] (entry) @ location: 18 + [ ] + - control: KUndip + - control: KCons + - log/NIL (exit) @ location: 16 + [ (Some 10) ] + - NIL (entry) @ location: 19 + [ (Some 10) ] + - log/PAIR (exit) @ location: 19 + [ {} + (Some 10) ] + - PAIR (entry) @ location: 21 + [ {} + (Some 10) ] + - log/[halt] (exit) @ location: 21 + [ (Pair {} (Some 10)) ] + - [halt] (entry) @ location: 7 + [ (Pair {} (Some 10)) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/packunpack.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/packunpack.out new file mode 100644 index 000000000000..ec990956eaab --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/packunpack.out @@ -0,0 +1,103 @@ + +trace + - CAR (interp) @ location: 15 + [ (Pair (Pair (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006) + Unit) ] + - CAR (entry) @ location: 15 + [ (Pair (Pair (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006) + Unit) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006) ] + - UNPAIR (entry) @ location: 16 + [ (Pair (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006) ] + - log/DIP (exit) @ location: 16 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - DIP (entry) @ location: 17 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/DUP (exit) @ location: 17 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - DUP (entry) @ location: 19 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/[halt] (exit) @ location: 19 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - [halt] (entry) @ location: 19 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - control: KUndip + - control: KCons + - log/PACK (exit) @ location: 17 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - PACK (entry) @ location: 20 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) + 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/COMPARE (exit) @ location: 20 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - COMPARE (entry) @ location: 23 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/EQ (exit) @ location: 23 + [ 0 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - EQ (entry) @ location: 24 + [ 0 + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/IF (exit) @ location: 24 + [ True + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - IF (entry) @ location: 25 + [ True + 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/[halt] (exit) @ location: 25 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - [halt] (entry) @ location: 31 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - control: KCons + - log/UNPACK (exit) @ location: 25 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - UNPACK (entry) @ location: 31 + [ 0x0507070707010000000361626302000000060001000200030200000006000400050006 ] + - log/IF_NONE (exit) @ location: 31 + [ (Some (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 })) ] + - IF_NONE (entry) @ location: 40 + [ (Some (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 })) ] + - log/[halt] (exit) @ location: 40 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) ] + - [halt] (entry) @ location: 46 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) ] + - control: KCons + - log/DROP (exit) @ location: 40 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) ] + - DROP (entry) @ location: 46 + [ (Pair (Pair "abc" { 1 ; 2 ; 3 }) { 4 ; 5 ; 6 }) ] + - log/CONST (exit) @ location: 46 + [ ] + - CONST (entry) @ location: 47 + [ ] + - log/NIL (exit) @ location: 47 + [ Unit ] + - NIL (entry) @ location: 48 + [ Unit ] + - log/PAIR (exit) @ location: 48 + [ {} + Unit ] + - PAIR (entry) @ location: 50 + [ {} + Unit ] + - log/[halt] (exit) @ location: 50 + [ (Pair {} Unit) ] + - [halt] (entry) @ location: 14 + [ (Pair {} Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/pexec.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/pexec.out new file mode 100644 index 000000000000..1ed039697338 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/pexec.out @@ -0,0 +1,83 @@ + +trace + - LAMBDA (interp) @ location: 7 + [ (Pair 7 77) ] + - LAMBDA (entry) @ location: 7 + [ (Pair 7 77) ] + - log/SWAP (exit) @ location: 7 + [ { UNPAIR ; ADD } + (Pair 7 77) ] + - SWAP (entry) @ location: 15 + [ { UNPAIR ; ADD } + (Pair 7 77) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair 7 77) + { UNPAIR ; ADD } ] + - UNPAIR (entry) @ location: 16 + [ (Pair 7 77) + { UNPAIR ; ADD } ] + - log/DIP (exit) @ location: 16 + [ 7 + 77 + { UNPAIR ; ADD } ] + - DIP (entry) @ location: 17 + [ 7 + 77 + { UNPAIR ; ADD } ] + - log/APPLY (exit) @ location: 17 + [ 77 + { UNPAIR ; ADD } ] + - APPLY (entry) @ location: 19 + [ 77 + { UNPAIR ; ADD } ] + - log/[halt] (exit) @ location: 19 + [ { PUSH nat 77 ; PAIR ; { UNPAIR ; ADD } } ] + - [halt] (entry) @ location: 19 + [ { PUSH nat 77 ; PAIR ; { UNPAIR ; ADD } } ] + - control: KUndip + - control: KCons + - log/EXEC (exit) @ location: 17 + [ 7 + { PUSH nat 77 ; PAIR ; { UNPAIR ; ADD } } ] + - EXEC (entry) @ location: 20 + [ 7 + { PUSH nat 77 ; PAIR ; { UNPAIR ; ADD } } ] + - CONST (entry) @ location: 12 + [ 7 ] + - log/PAIR (exit) @ location: 12 + [ 77 + 7 ] + - PAIR (entry) @ location: 12 + [ 77 + 7 ] + - log/UNPAIR (exit) @ location: 12 + [ (Pair 77 7) ] + - UNPAIR (entry) @ location: 13 + [ (Pair 77 7) ] + - log/ADD (exit) @ location: 13 + [ 77 + 7 ] + - ADD (entry) @ location: 14 + [ 77 + 7 ] + - log/[halt] (exit) @ location: 14 + [ 84 ] + - [halt] (entry) @ location: 12 + [ 84 ] + - control: KReturn + - control: KCons + - log/NIL (exit) @ location: 20 + [ 84 ] + - NIL (entry) @ location: 21 + [ 84 ] + - log/PAIR (exit) @ location: 21 + [ {} + 84 ] + - PAIR (entry) @ location: 23 + [ {} + 84 ] + - log/[halt] (exit) @ location: 23 + [ (Pair {} 84) ] + - [halt] (entry) @ location: 6 + [ (Pair {} 84) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/rec_id_unit.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/rec_id_unit.out new file mode 100644 index 000000000000..8ac716e1d058 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/rec_id_unit.out @@ -0,0 +1,56 @@ + +trace + - CAR (interp) @ location: 7 + [ (Pair Unit Unit) ] + - CAR (entry) @ location: 7 + [ (Pair Unit Unit) ] + - log/LAMBDA_REC (exit) @ location: 7 + [ Unit ] + - LAMBDA_REC (entry) @ location: 8 + [ Unit ] + - log/SWAP (exit) @ location: 8 + [ (Lambda_rec { DIP { DROP } }) + Unit ] + - SWAP (entry) @ location: 15 + [ (Lambda_rec { DIP { DROP } }) + Unit ] + - log/EXEC (exit) @ location: 15 + [ Unit + (Lambda_rec { DIP { DROP } }) ] + - EXEC (entry) @ location: 16 + [ Unit + (Lambda_rec { DIP { DROP } }) ] + - DIP (entry) @ location: 12 + [ Unit + (Lambda_rec { DIP { DROP } }) ] + - log/DROP (exit) @ location: 12 + [ (Lambda_rec { DIP { DROP } }) ] + - DROP (entry) @ location: 14 + [ (Lambda_rec { DIP { DROP } }) ] + - log/[halt] (exit) @ location: 14 + [ ] + - [halt] (entry) @ location: 14 + [ ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 12 + [ Unit ] + - [halt] (entry) @ location: 12 + [ Unit ] + - control: KReturn + - control: KCons + - log/NIL (exit) @ location: 16 + [ Unit ] + - NIL (entry) @ location: 17 + [ Unit ] + - log/PAIR (exit) @ location: 17 + [ {} + Unit ] + - PAIR (entry) @ location: 19 + [ {} + Unit ] + - log/[halt] (exit) @ location: 19 + [ (Pair {} Unit) ] + - [halt] (entry) @ location: 6 + [ (Pair {} Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/reverse_loop.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/reverse_loop.out new file mode 100644 index 000000000000..a0b9a50d4ffd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/reverse_loop.out @@ -0,0 +1,261 @@ + +trace + - CAR (interp) @ location: 9 + [ (Pair { "abc" ; "def" ; "ghi" } {}) ] + - CAR (entry) @ location: 9 + [ (Pair { "abc" ; "def" ; "ghi" } {}) ] + - log/NIL (exit) @ location: 9 + [ { "abc" ; "def" ; "ghi" } ] + - NIL (entry) @ location: 10 + [ { "abc" ; "def" ; "ghi" } ] + - log/SWAP (exit) @ location: 10 + [ {} + { "abc" ; "def" ; "ghi" } ] + - SWAP (entry) @ location: 12 + [ {} + { "abc" ; "def" ; "ghi" } ] + - log/CONST (exit) @ location: 12 + [ { "abc" ; "def" ; "ghi" } + {} ] + - CONST (entry) @ location: 13 + [ { "abc" ; "def" ; "ghi" } + {} ] + - log/LOOP (exit) @ location: 13 + [ True + { "abc" ; "def" ; "ghi" } + {} ] + - LOOP (entry) @ location: 33 + [ True + { "abc" ; "def" ; "ghi" } + {} ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 33 + [ { "abc" ; "def" ; "ghi" } + {} ] + - IF_CONS (entry) @ location: 18 + [ { "abc" ; "def" ; "ghi" } + {} ] + - log/SWAP (exit) @ location: 18 + [ "abc" + { "def" ; "ghi" } + {} ] + - SWAP (entry) @ location: 20 + [ "abc" + { "def" ; "ghi" } + {} ] + - log/DIP (exit) @ location: 20 + [ { "def" ; "ghi" } + "abc" + {} ] + - DIP (entry) @ location: 21 + [ { "def" ; "ghi" } + "abc" + {} ] + - log/CONS (exit) @ location: 21 + [ "abc" + {} ] + - CONS (entry) @ location: 23 + [ "abc" + {} ] + - log/[halt] (exit) @ location: 23 + [ { "abc" } ] + - [halt] (entry) @ location: 23 + [ { "abc" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 21 + [ { "def" ; "ghi" } + { "abc" } ] + - CONST (entry) @ location: 24 + [ { "def" ; "ghi" } + { "abc" } ] + - log/[halt] (exit) @ location: 24 + [ True + { "def" ; "ghi" } + { "abc" } ] + - [halt] (entry) @ location: 33 + [ True + { "def" ; "ghi" } + { "abc" } ] + - control: KCons + - log/[halt] (exit) @ location: 18 + [ True + { "def" ; "ghi" } + { "abc" } ] + - [halt] (entry) @ location: 33 + [ True + { "def" ; "ghi" } + { "abc" } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 33 + [ { "def" ; "ghi" } + { "abc" } ] + - IF_CONS (entry) @ location: 18 + [ { "def" ; "ghi" } + { "abc" } ] + - log/SWAP (exit) @ location: 18 + [ "def" + { "ghi" } + { "abc" } ] + - SWAP (entry) @ location: 20 + [ "def" + { "ghi" } + { "abc" } ] + - log/DIP (exit) @ location: 20 + [ { "ghi" } + "def" + { "abc" } ] + - DIP (entry) @ location: 21 + [ { "ghi" } + "def" + { "abc" } ] + - log/CONS (exit) @ location: 21 + [ "def" + { "abc" } ] + - CONS (entry) @ location: 23 + [ "def" + { "abc" } ] + - log/[halt] (exit) @ location: 23 + [ { "def" ; "abc" } ] + - [halt] (entry) @ location: 23 + [ { "def" ; "abc" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 21 + [ { "ghi" } + { "def" ; "abc" } ] + - CONST (entry) @ location: 24 + [ { "ghi" } + { "def" ; "abc" } ] + - log/[halt] (exit) @ location: 24 + [ True + { "ghi" } + { "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ True + { "ghi" } + { "def" ; "abc" } ] + - control: KCons + - log/[halt] (exit) @ location: 18 + [ True + { "ghi" } + { "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ True + { "ghi" } + { "def" ; "abc" } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 33 + [ { "ghi" } + { "def" ; "abc" } ] + - IF_CONS (entry) @ location: 18 + [ { "ghi" } + { "def" ; "abc" } ] + - log/SWAP (exit) @ location: 18 + [ "ghi" + {} + { "def" ; "abc" } ] + - SWAP (entry) @ location: 20 + [ "ghi" + {} + { "def" ; "abc" } ] + - log/DIP (exit) @ location: 20 + [ {} + "ghi" + { "def" ; "abc" } ] + - DIP (entry) @ location: 21 + [ {} + "ghi" + { "def" ; "abc" } ] + - log/CONS (exit) @ location: 21 + [ "ghi" + { "def" ; "abc" } ] + - CONS (entry) @ location: 23 + [ "ghi" + { "def" ; "abc" } ] + - log/[halt] (exit) @ location: 23 + [ { "ghi" ; "def" ; "abc" } ] + - [halt] (entry) @ location: 23 + [ { "ghi" ; "def" ; "abc" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 21 + [ {} + { "ghi" ; "def" ; "abc" } ] + - CONST (entry) @ location: 24 + [ {} + { "ghi" ; "def" ; "abc" } ] + - log/[halt] (exit) @ location: 24 + [ True + {} + { "ghi" ; "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ True + {} + { "ghi" ; "def" ; "abc" } ] + - control: KCons + - log/[halt] (exit) @ location: 18 + [ True + {} + { "ghi" ; "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ True + {} + { "ghi" ; "def" ; "abc" } ] + - control: KLoop_in + - log/IF_CONS (exit) @ location: 33 + [ {} + { "ghi" ; "def" ; "abc" } ] + - IF_CONS (entry) @ location: 18 + [ {} + { "ghi" ; "def" ; "abc" } ] + - log/NIL (exit) @ location: 18 + [ { "ghi" ; "def" ; "abc" } ] + - NIL (entry) @ location: 28 + [ { "ghi" ; "def" ; "abc" } ] + - log/CONST (exit) @ location: 28 + [ {} + { "ghi" ; "def" ; "abc" } ] + - CONST (entry) @ location: 30 + [ {} + { "ghi" ; "def" ; "abc" } ] + - log/[halt] (exit) @ location: 30 + [ False + {} + { "ghi" ; "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ False + {} + { "ghi" ; "def" ; "abc" } ] + - control: KCons + - log/[halt] (exit) @ location: 18 + [ False + {} + { "ghi" ; "def" ; "abc" } ] + - [halt] (entry) @ location: 33 + [ False + {} + { "ghi" ; "def" ; "abc" } ] + - control: KLoop_in + - control: KCons + - log/DROP (exit) @ location: 33 + [ {} + { "ghi" ; "def" ; "abc" } ] + - DROP (entry) @ location: 33 + [ {} + { "ghi" ; "def" ; "abc" } ] + - log/NIL (exit) @ location: 33 + [ { "ghi" ; "def" ; "abc" } ] + - NIL (entry) @ location: 34 + [ { "ghi" ; "def" ; "abc" } ] + - log/PAIR (exit) @ location: 34 + [ {} + { "ghi" ; "def" ; "abc" } ] + - PAIR (entry) @ location: 36 + [ {} + { "ghi" ; "def" ; "abc" } ] + - log/[halt] (exit) @ location: 36 + [ (Pair {} { "ghi" ; "def" ; "abc" }) ] + - [halt] (entry) @ location: 8 + [ (Pair {} { "ghi" ; "def" ; "abc" }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/set_delegate.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/set_delegate.out new file mode 100644 index 000000000000..89bf0cc887b9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/set_delegate.out @@ -0,0 +1,51 @@ + +trace + - UNPAIR (interp) @ location: 8 + [ (Pair (Some "[PUBLIC_KEY_HASH]") Unit) ] + - UNPAIR (entry) @ location: 8 + [ (Pair (Some "[PUBLIC_KEY_HASH]") Unit) ] + - log/SET_DELEGATE (exit) @ location: 8 + [ (Some "[PUBLIC_KEY_HASH]") + Unit ] + - SET_DELEGATE (entry) @ location: 9 + [ (Some "[PUBLIC_KEY_HASH]") + Unit ] + - log/DIP (exit) @ location: 9 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c + Unit ] + - DIP (entry) @ location: 10 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c + Unit ] + - log/NIL (exit) @ location: 10 + [ Unit ] + - NIL (entry) @ location: 12 + [ Unit ] + - log/[halt] (exit) @ location: 12 + [ {} + Unit ] + - [halt] (entry) @ location: 12 + [ {} + Unit ] + - control: KUndip + - control: KCons + - log/CONS (exit) @ location: 10 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c + {} + Unit ] + - CONS (entry) @ location: 14 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c + {} + Unit ] + - log/PAIR (exit) @ location: 14 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c } + Unit ] + - PAIR (entry) @ location: 15 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c } + Unit ] + - log/[halt] (exit) @ location: 15 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c } + Unit) ] + - [halt] (entry) @ location: 7 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000003ff00e7670f32038107a59a2b9cfefae36ea21f5aa63c } + Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/shifts.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/shifts.out new file mode 100644 index 000000000000..73e5b8e24058 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/shifts.out @@ -0,0 +1,44 @@ + +trace + - CAR (interp) @ location: 14 + [ (Pair (Right (Pair 3 2)) None) ] + - CAR (entry) @ location: 14 + [ (Pair (Right (Pair 3 2)) None) ] + - log/IF_LEFT (exit) @ location: 14 + [ (Right (Pair 3 2)) ] + - IF_LEFT (entry) @ location: 15 + [ (Right (Pair 3 2)) ] + - log/UNPAIR (exit) @ location: 15 + [ (Pair 3 2) ] + - UNPAIR (entry) @ location: 20 + [ (Pair 3 2) ] + - log/LSR (exit) @ location: 20 + [ 3 + 2 ] + - LSR (entry) @ location: 21 + [ 3 + 2 ] + - log/[halt] (exit) @ location: 21 + [ 0 ] + - [halt] (entry) @ location: 22 + [ 0 ] + - control: KCons + - log/SOME (exit) @ location: 15 + [ 0 ] + - SOME (entry) @ location: 22 + [ 0 ] + - log/NIL (exit) @ location: 22 + [ (Some 0) ] + - NIL (entry) @ location: 23 + [ (Some 0) ] + - log/PAIR (exit) @ location: 23 + [ {} + (Some 0) ] + - PAIR (entry) @ location: 25 + [ {} + (Some 0) ] + - log/[halt] (exit) @ location: 25 + [ (Pair {} (Some 0)) ] + - [halt] (entry) @ location: 13 + [ (Pair {} (Some 0)) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/spawn_identities.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/spawn_identities.out new file mode 100644 index 000000000000..84eeea523a6a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/spawn_identities.out @@ -0,0 +1,4341 @@ + +trace + - DUP (interp) @ location: 8 + [ (Pair 7 {}) ] + - DUP (entry) @ location: 8 + [ (Pair 7 {}) ] + - log/CAR (exit) @ location: 8 + [ (Pair 7 {}) + (Pair 7 {}) ] + - CAR (entry) @ location: 9 + [ (Pair 7 {}) + (Pair 7 {}) ] + - log/DIP (exit) @ location: 9 + [ 7 + (Pair 7 {}) ] + - DIP (entry) @ location: 10 + [ 7 + (Pair 7 {}) ] + - log/CDR (exit) @ location: 10 + [ (Pair 7 {}) ] + - CDR (entry) @ location: 12 + [ (Pair 7 {}) ] + - log/NIL (exit) @ location: 12 + [ {} ] + - NIL (entry) @ location: 13 + [ {} ] + - log/[halt] (exit) @ location: 13 + [ {} + {} ] + - [halt] (entry) @ location: 11 + [ {} + {} ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 10 + [ 7 + {} + {} ] + - CONST (entry) @ location: 15 + [ 7 + {} + {} ] + - log/LOOP (exit) @ location: 15 + [ True + 7 + {} + {} ] + - LOOP (entry) @ location: 76 + [ True + 7 + {} + {} ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 7 + {} + {} ] + - DUP (entry) @ location: 20 + [ 7 + {} + {} ] + - log/CONST (exit) @ location: 20 + [ 7 + 7 + {} + {} ] + - CONST (entry) @ location: 21 + [ 7 + 7 + {} + {} ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 7 + 7 + {} + {} ] + - COMPARE (entry) @ location: 25 + [ 0 + 7 + 7 + {} + {} ] + - log/EQ (exit) @ location: 25 + [ -1 + 7 + {} + {} ] + - EQ (entry) @ location: 26 + [ -1 + 7 + {} + {} ] + - log/IF (exit) @ location: 26 + [ False + 7 + {} + {} ] + - IF (entry) @ location: 27 + [ False + 7 + {} + {} ] + - log/CONST (exit) @ location: 27 + [ 7 + {} + {} ] + - CONST (entry) @ location: 33 + [ 7 + {} + {} ] + - log/SWAP (exit) @ location: 33 + [ 1 + 7 + {} + {} ] + - SWAP (entry) @ location: 36 + [ 1 + 7 + {} + {} ] + - log/SUB (exit) @ location: 36 + [ 7 + 1 + {} + {} ] + - SUB (entry) @ location: 37 + [ 7 + 1 + {} + {} ] + - log/ABS (exit) @ location: 37 + [ 6 + {} + {} ] + - ABS (entry) @ location: 38 + [ 6 + {} + {} ] + - log/CONST (exit) @ location: 38 + [ 6 + {} + {} ] + - CONST (entry) @ location: 39 + [ 6 + {} + {} ] + - log/CONST (exit) @ location: 39 + [ "init" + 6 + {} + {} ] + - CONST (entry) @ location: 42 + [ "init" + 6 + {} + {} ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 6 + {} + {} ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 6 + {} + {} ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 6 + {} + {} ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 6 + {} + {} ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 6 + {} + {} ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 6 + {} + {} ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 6 + {} + {} ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 6 + {} + {} ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 6 + {} + {} ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 6 + {} + {} ] + - log/DIP (exit) @ location: 62 + [ 6 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + {} + {} ] + - DIP (entry) @ location: 63 + [ 6 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + {} + {} ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + {} + {} ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + {} + {} ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - [halt] (entry) @ location: 61 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - log/DIP (exit) @ location: 66 + [ 6 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - DIP (entry) @ location: 67 + [ 6 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + {} ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + {} ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + {} ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + {} ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + {} ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 6 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 6 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 6 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 6 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 6 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 6 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 6 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 5 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 5 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 5 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 5 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 5 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 5 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 5 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 5 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 5 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 5 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 5 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 4 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 4 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 4 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 4 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 4 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 4 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 4 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 4 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 4 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 4 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 4 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 3 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 3 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 3 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 3 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 3 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 3 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 3 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 3 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 3 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 3 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 3 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 2 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 2 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 2 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 2 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 2 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 2 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 2 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 2 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 2 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 2 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 2 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 1 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 1 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 1 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 1 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ -1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ -1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ False + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ False + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 33 + [ 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 33 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 36 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SUB (exit) @ location: 36 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SUB (entry) @ location: 37 + [ 1 + 1 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/ABS (exit) @ location: 37 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - ABS (entry) @ location: 38 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 38 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 39 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 39 + [ "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 42 + [ "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/NONE (exit) @ location: 42 + [ 5000000 + "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - NONE (entry) @ location: 45 + [ 5000000 + "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CREATE_CONTRACT (exit) @ location: 45 + [ None + 5000000 + "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CREATE_CONTRACT (entry) @ location: 47 + [ None + 5000000 + "init" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 47 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 59 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + "[CONTRACT_HASH]" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 59 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 60 + [ "[CONTRACT_HASH]" + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 60 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 62 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 62 + [ 0 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 63 + [ 0 + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 63 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 65 + [ 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 65 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 63 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 61 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/SWAP (exit) @ location: 60 + [ "[CONTRACT_HASH]" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 66 + [ "[CONTRACT_HASH]" + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 66 + [ 0 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 67 + [ 0 + "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/SWAP (exit) @ location: 67 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - SWAP (entry) @ location: 69 + [ "[CONTRACT_HASH]" + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/DIP (exit) @ location: 69 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DIP (entry) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONS (exit) @ location: 70 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONS (entry) @ location: 72 + [ "[CONTRACT_HASH]" + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 72 + [ { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/[halt] (exit) @ location: 70 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 68 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KUndip + - control: KCons + - log/CONST (exit) @ location: 67 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 73 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 73 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - log/DUP (exit) @ location: 76 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DUP (entry) @ location: 20 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 20 + [ 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 21 + [ 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/COMPARE (exit) @ location: 21 + [ 0 + 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - COMPARE (entry) @ location: 25 + [ 0 + 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/EQ (exit) @ location: 25 + [ 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - EQ (entry) @ location: 26 + [ 0 + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/IF (exit) @ location: 26 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - IF (entry) @ location: 27 + [ True + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/CONST (exit) @ location: 27 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - CONST (entry) @ location: 29 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 29 + [ False + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ False + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KCons + - log/[halt] (exit) @ location: 27 + [ False + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - [halt] (entry) @ location: 76 + [ False + 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - control: KLoop_in + - control: KCons + - log/DROP (exit) @ location: 76 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - DROP (entry) @ location: 76 + [ 0 + { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/PAIR (exit) @ location: 76 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - PAIR (entry) @ location: 77 + [ { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" } ] + - log/[halt] (exit) @ location: 77 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" }) ] + - [halt] (entry) @ location: 7 + [ (Pair { 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000602c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000502c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000402c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000302c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000202c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000102c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 ; + 0x014828e9aa0b3e6e970da0515b5c5d8ccf5028758900000002c096b102000000001c02000000170500036805010368050202000000080316053d036d0342000000090100000004696e6974 } + { "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" ; + "[CONTRACT_HASH]" }) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_join.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_join.out new file mode 100644 index 000000000000..9b2173a0c4f3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_join.out @@ -0,0 +1,42 @@ + +trace + - UNPAIR (interp) @ location: 10 + [ (Pair (Pair "[CONTRACT_HASH]" 17 3) None) ] + - UNPAIR (entry) @ location: 10 + [ (Pair (Pair "[CONTRACT_HASH]" 17 3) None) ] + - log/SWAP (exit) @ location: 10 + [ (Pair "[CONTRACT_HASH]" 17 3) + None ] + - SWAP (entry) @ location: 11 + [ (Pair "[CONTRACT_HASH]" 17 3) + None ] + - log/IF_NONE (exit) @ location: 11 + [ None + (Pair "[CONTRACT_HASH]" 17 3) ] + - IF_NONE (entry) @ location: 12 + [ None + (Pair "[CONTRACT_HASH]" 17 3) ] + - log/[halt] (exit) @ location: 12 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - [halt] (entry) @ location: 24 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - control: KCons + - log/SOME (exit) @ location: 12 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - SOME (entry) @ location: 24 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - log/NIL (exit) @ location: 24 + [ (Some (Pair "[CONTRACT_HASH]" 17 3)) ] + - NIL (entry) @ location: 25 + [ (Some (Pair "[CONTRACT_HASH]" 17 3)) ] + - log/PAIR (exit) @ location: 25 + [ {} + (Some (Pair "[CONTRACT_HASH]" 17 3)) ] + - PAIR (entry) @ location: 27 + [ {} + (Some (Pair "[CONTRACT_HASH]" 17 3)) ] + - log/[halt] (exit) @ location: 27 + [ (Pair {} (Some (Pair "[CONTRACT_HASH]" 17 3))) ] + - [halt] (entry) @ location: 9 + [ (Pair {} (Some (Pair "[CONTRACT_HASH]" 17 3))) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_split.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_split.out new file mode 100644 index 000000000000..5728c0fad975 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/ticket_split.out @@ -0,0 +1,180 @@ + +trace + - CAR (interp) @ location: 8 + [ (Pair (Pair "[CONTRACT_HASH]" 17 3) Unit) ] + - CAR (entry) @ location: 8 + [ (Pair (Pair "[CONTRACT_HASH]" 17 3) Unit) ] + - log/CONST (exit) @ location: 8 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - CONST (entry) @ location: 9 + [ (Pair "[CONTRACT_HASH]" 17 3) ] + - log/SWAP (exit) @ location: 9 + [ (Pair 1 2) + (Pair "[CONTRACT_HASH]" 17 3) ] + - SWAP (entry) @ location: 16 + [ (Pair 1 2) + (Pair "[CONTRACT_HASH]" 17 3) ] + - log/SPLIT_TICKET (exit) @ location: 16 + [ (Pair "[CONTRACT_HASH]" 17 3) + (Pair 1 2) ] + - SPLIT_TICKET (entry) @ location: 17 + [ (Pair "[CONTRACT_HASH]" 17 3) + (Pair 1 2) ] + - log/IF_NONE (exit) @ location: 17 + [ (Some (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2))) ] + - IF_NONE (entry) @ location: 19 + [ (Some (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2))) ] + - log/[halt] (exit) @ location: 19 + [ (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2)) ] + - [halt] (entry) @ location: 25 + [ (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2)) ] + - control: KCons + - log/UNPAIR (exit) @ location: 19 + [ (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2)) ] + - UNPAIR (entry) @ location: 25 + [ (Pair (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2)) ] + - log/READ_TICKET (exit) @ location: 25 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - READ_TICKET (entry) @ location: 26 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CDR (exit) @ location: 26 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - CDR (entry) @ location: 28 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CDR (exit) @ location: 28 + [ (Pair 17 1) + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - CDR (entry) @ location: 29 + [ (Pair 17 1) + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CONST (exit) @ location: 29 + [ 1 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - CONST (entry) @ location: 30 + [ 1 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/COMPARE (exit) @ location: 30 + [ 1 + 1 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - COMPARE (entry) @ location: 35 + [ 1 + 1 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/EQ (exit) @ location: 35 + [ 0 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - EQ (entry) @ location: 36 + [ 0 + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/IF (exit) @ location: 36 + [ True + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - IF (entry) @ location: 37 + [ True + (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/[halt] (exit) @ location: 37 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - [halt] (entry) @ location: 43 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - control: KCons + - log/DROP (exit) @ location: 37 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - DROP (entry) @ location: 43 + [ (Pair "[CONTRACT_HASH]" 17 1) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/READ_TICKET (exit) @ location: 43 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - READ_TICKET (entry) @ location: 44 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CDR (exit) @ location: 44 + [ (Pair "[CONTRACT_HASH]" 17 2) + (Pair "[CONTRACT_HASH]" 17 2) ] + - CDR (entry) @ location: 46 + [ (Pair "[CONTRACT_HASH]" 17 2) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CDR (exit) @ location: 46 + [ (Pair 17 2) + (Pair "[CONTRACT_HASH]" 17 2) ] + - CDR (entry) @ location: 47 + [ (Pair 17 2) + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CONST (exit) @ location: 47 + [ 2 + (Pair "[CONTRACT_HASH]" 17 2) ] + - CONST (entry) @ location: 48 + [ 2 + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/COMPARE (exit) @ location: 48 + [ 2 + 2 + (Pair "[CONTRACT_HASH]" 17 2) ] + - COMPARE (entry) @ location: 53 + [ 2 + 2 + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/EQ (exit) @ location: 53 + [ 0 + (Pair "[CONTRACT_HASH]" 17 2) ] + - EQ (entry) @ location: 54 + [ 0 + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/IF (exit) @ location: 54 + [ True + (Pair "[CONTRACT_HASH]" 17 2) ] + - IF (entry) @ location: 55 + [ True + (Pair "[CONTRACT_HASH]" 17 2) ] + - log/[halt] (exit) @ location: 55 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - [halt] (entry) @ location: 61 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - control: KCons + - log/DROP (exit) @ location: 55 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - DROP (entry) @ location: 61 + [ (Pair "[CONTRACT_HASH]" 17 2) ] + - log/CONST (exit) @ location: 61 + [ ] + - CONST (entry) @ location: 62 + [ ] + - log/NIL (exit) @ location: 62 + [ Unit ] + - NIL (entry) @ location: 63 + [ Unit ] + - log/PAIR (exit) @ location: 63 + [ {} + Unit ] + - PAIR (entry) @ location: 65 + [ {} + Unit ] + - log/[halt] (exit) @ location: 65 + [ (Pair {} Unit) ] + - [halt] (entry) @ location: 7 + [ (Pair {} Unit) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_fib.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_fib.out new file mode 100644 index 000000000000..374caebbb378 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_fib.out @@ -0,0 +1,41 @@ + +trace + - CAR (interp) @ location: 9 + [ (Pair (Pair 8 "[CONTRACT_HASH]") 0) ] + - CAR (entry) @ location: 9 + [ (Pair (Pair 8 "[CONTRACT_HASH]") 0) ] + - log/UNPAIR (exit) @ location: 9 + [ (Pair 8 "[CONTRACT_HASH]") ] + - UNPAIR (entry) @ location: 10 + [ (Pair 8 "[CONTRACT_HASH]") ] + - log/VIEW (exit) @ location: 10 + [ 8 + "[CONTRACT_HASH]" ] + - VIEW (entry) @ location: 11 + [ 8 + "[CONTRACT_HASH]" ] + - control: KView_exit + - log/IF_NONE (exit) @ location: 11 + [ (Some 21) ] + - IF_NONE (entry) @ location: 15 + [ (Some 21) ] + - log/NIL (exit) @ location: 15 + [ 21 ] + - NIL (entry) @ location: 21 + [ 21 ] + - log/PAIR (exit) @ location: 21 + [ {} + 21 ] + - PAIR (entry) @ location: 23 + [ {} + 21 ] + - log/[halt] (exit) @ location: 23 + [ (Pair {} 21) ] + - [halt] (entry) @ location: 8 + [ (Pair {} 21) ] + - control: KCons + - log/[halt] (exit) @ location: 15 + [ (Pair {} 21) ] + - [halt] (entry) @ location: 8 + [ (Pair {} 21) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_toplevel_lib.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_toplevel_lib.out new file mode 100644 index 000000000000..8791bd97f511 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/view_toplevel_lib.out @@ -0,0 +1,21 @@ + +trace + - CAR (interp) @ location: 7 + [ (Pair 5 3) ] + - CAR (entry) @ location: 7 + [ (Pair 5 3) ] + - log/NIL (exit) @ location: 7 + [ 5 ] + - NIL (entry) @ location: 8 + [ 5 ] + - log/PAIR (exit) @ location: 8 + [ {} + 5 ] + - PAIR (entry) @ location: 10 + [ {} + 5 ] + - log/[halt] (exit) @ location: 10 + [ (Pair {} 5) ] + - [halt] (entry) @ location: 6 + [ (Pair {} 5) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/xor.out b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/xor.out new file mode 100644 index 000000000000..5eb5063226ee --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/expected/test_logging.ml/xor.out @@ -0,0 +1,48 @@ + +trace + - CAR (interp) @ location: 16 + [ (Pair (Left (Pair True False)) None) ] + - CAR (entry) @ location: 16 + [ (Pair (Left (Pair True False)) None) ] + - log/IF_LEFT (exit) @ location: 16 + [ (Left (Pair True False)) ] + - IF_LEFT (entry) @ location: 17 + [ (Left (Pair True False)) ] + - log/UNPAIR (exit) @ location: 17 + [ (Pair True False) ] + - UNPAIR (entry) @ location: 19 + [ (Pair True False) ] + - log/XOR (exit) @ location: 19 + [ True + False ] + - XOR (entry) @ location: 20 + [ True + False ] + - log/LEFT (exit) @ location: 20 + [ True ] + - LEFT (entry) @ location: 21 + [ True ] + - log/[halt] (exit) @ location: 21 + [ (Left True) ] + - [halt] (entry) @ location: 28 + [ (Left True) ] + - control: KCons + - log/SOME (exit) @ location: 17 + [ (Left True) ] + - SOME (entry) @ location: 28 + [ (Left True) ] + - log/NIL (exit) @ location: 28 + [ (Some (Left True)) ] + - NIL (entry) @ location: 29 + [ (Some (Left True)) ] + - log/PAIR (exit) @ location: 29 + [ {} + (Some (Left True)) ] + - PAIR (entry) @ location: 31 + [ {} + (Some (Left True)) ] + - log/[halt] (exit) @ location: 31 + [ (Pair {} (Some (Left True))) ] + - [halt] (entry) @ location: 15 + [ (Pair {} (Some (Left True))) ] + - control: KNil diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml b/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml new file mode 100644 index 000000000000..5fb8465c249c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml @@ -0,0 +1,401 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (type-checking) + Invocation: cd src/proto_alpha/lib_protocol/test/regression && \ + dune exec ./main.exe + Subject: Type-checking + *) + +open Lwt_result_syntax +open Protocol +open Alpha_context +open Tezt + +module Traced_interpreter = Plugin.RPC.Scripts.Traced_interpreter (struct + let unparsing_mode = Script_ir_unparser.Readable +end) + +type contract = {filename : string; storage : string} + +type transaction = + | Simple of {dst : contract; amount : Tez.t; parameter : string} + | With_lib of { + dst : contract; + lib : contract; + amount : Tez.t; + parameter : Contract_hash.t -> string; + } + +type element_kind = Interp | Entry | Exit + +type log_element = + | With_stack : + context + * ('a, 'b, 'c, 'd) Script_typed_ir.kinstr + * Script.location + * ('e * 'f) + * ('e, 'f) Script_typed_ir.stack_ty + * element_kind + -> log_element + | Ctrl : ('a, 'b, 'c, 'd) Script_typed_ir.continuation -> log_element + +type trace_element = + | TInstr : + Script.location + * Gas.t + * ('a, 'b, 'c, 'd) Script_typed_ir.kinstr + * Script.expr list + * element_kind + -> trace_element + | TCtrl : ('a, 'b, 'c, 'd) Script_typed_ir.continuation -> trace_element + +let transaction ?(amount = Tez.zero) ~parameter ~storage filename = + Simple {amount; parameter; dst = {filename; storage}} + +let with_lib ?(amount = Tez.zero) ~parameter ~storage ~lib ~lib_storage filename + = + With_lib + { + amount; + parameter; + dst = {storage; filename}; + lib = {filename = lib; storage = lib_storage}; + } + +let filename = function + | Simple {dst = {filename; _}; _} | With_lib {dst = {filename; _}; _} -> + filename + +let amount = function Simple {amount; _} | With_lib {amount; _} -> amount + +let storage = function + | Simple {dst = {storage; _}; _} | With_lib {dst = {storage; _}; _} -> storage + +let with_indentation fmt = function + | Interp -> + Format.fprintf + fmt + "- @[<v 0>%a (interp) @@ location: %d@,[ @[<v 0>%a ]@]@]" + | Exit -> + Format.fprintf + fmt + "- @[<v 0>%a (exit) @@ location: %d@,[ @[<v 0>%a ]@]@]@]" + | Entry -> + Format.fprintf + fmt + "@[<v 2>- @[<v 0>%a (entry) @@ location: %d@,[ @[<v 0>%a ]@]@]" + +let pp_trace fmt = function + | TInstr (loc, _gas, instr, stack, element_kind) -> + with_indentation + fmt + element_kind + Plugin.RPC.Scripts.pp_instr_name + instr + loc + (Format.pp_print_list (fun ppf e -> + Format.fprintf ppf "@[<v 0>%a@]" Michelson_v1_printer.print_expr e)) + stack + | TCtrl continuation -> ( + Format.fprintf fmt "- @[<v 0>control: %s@]" + @@ + match continuation with + | KNil -> "KNil" + | KCons _ -> "KCons" + | KReturn _ -> "KReturn" + | KView_exit _ -> "KView_exit" + | KMap_head _ -> "KMap_head" + | KUndip _ -> "KUndip" + | KLoop_in _ -> "KLoop_in" + | KLoop_in_left _ -> "KLoop_in_left" + | KIter _ -> "KIter" + | KList_enter_body _ -> "KList_enter_body" + | KList_exit_body _ -> "KList_exit_body" + | KMap_enter_body _ -> "KMap_enter_body" + | KMap_exit_body _ -> "KMap_exit_body" + | KLog _ -> "KLog") + +let logger () : + (unit -> trace_element list tzresult Lwt.t) * Script_typed_ir.logger = + let open Script_typed_ir in + let log : log_element list ref = ref [] in + let logger = + Script_interpreter_logging.make + (module struct + let log_interp : type a s b f c u. (a, s, b, f, c, u) logging_function = + fun instr ctxt loc sty stack -> + log := With_stack (ctxt, instr, loc, stack, sty, Interp) :: !log + + let log_entry instr ctxt loc sty stack = + log := With_stack (ctxt, instr, loc, stack, sty, Entry) :: !log + + let log_exit instr ctxt loc sty stack = + log := With_stack (ctxt, instr, loc, stack, sty, Exit) :: !log + + let log_control cont = log := Ctrl cont :: !log + + let get_log () = return_none + end) + in + let assemble_log () = + let open Environment.Error_monad in + let+ l = + List.map_es + (function + | With_stack (ctxt, instr, loc, stack, stack_ty, indent) -> + let+ stack = + Lwt.map Environment.wrap_tzresult + @@ Traced_interpreter.unparse_stack ctxt (stack, stack_ty) + in + TInstr (loc, Gas.level ctxt, instr, stack, indent) + | Ctrl cont -> return @@ TCtrl cont) + !log + in + List.rev l + in + (assemble_log, logger) + +(* [with_logger ~mask f] creates a fresh logger and passes it to [f]. + After [f] finishes, logs are gathered and each occurrence of each + string in [mask] list is being replaced with asterisks. Thus processed + log is captured as regression output. *) +let with_logger f = + let get_log, logger = logger () in + let* () = f logger in + let* log = get_log () in + let capture s = Tezos_regression.replace_variables s |> Regression.capture in + Format.kasprintf + capture + "@,@[<v 2>trace@,%a@]" + (Format.pp_print_list pp_trace) + log ; + return_unit + +let read_code filename = + let filename = + project_root // Filename.dirname __FILE__ // "contracts" + // (filename ^ ".tz") + in + Contract_helpers.read_file filename + +let run_script transaction () = + let script = read_code @@ filename transaction in + let* parameter, ctxt = + match transaction with + | With_lib {lib = {filename; storage}; parameter; _} -> + let* block, baker, _contract, _src2 = Contract_helpers.init () in + let sender = Contract.Implicit baker in + let* src_addr, _script, block = + Contract_helpers.originate_contract_from_string_hash + ~baker + ~source_contract:sender + ~script:(read_code filename) + ~storage + block + in + let* incr = Incremental.begin_construction block in + return (parameter src_addr, Incremental.alpha_ctxt incr) + | Simple {parameter; _} -> + let* b, _contract = Context.init1 ~consensus_threshold:0 () in + let* inc = Incremental.begin_construction b in + let ctxt = Incremental.alpha_ctxt inc in + let ctxt = + Alpha_context.Origination_nonce.init + ctxt + Tezos_crypto.Operation_hash.zero + in + return (parameter, ctxt) + in + with_logger @@ fun logger -> + let step_constants = + Contract_helpers. + { + default_step_constants with + amount = amount transaction; + now = Script_timestamp.of_int64 1649939559L; + } + in + let* _res, _ctxt = + Contract_helpers.run_script + ctxt + script + ~logger + ~storage:(storage transaction) + ~parameter + ~step_constants + ~internal:true (* Allow for forged values (e.g. tickets). *) + () + in + return_unit + +let fail_on_error f () = + let open Lwt_syntax in + let* result = f () in + match result with + | Ok () -> return () + | Error e -> Test.fail "%a" Error_monad.pp_print_trace e + +(* Make sure that after a snapshot the snapshotted version of the test + has a different [~title], because all tests are linked in [tezt/tests/main.exe]. *) +let protocol = + match __FILE__ =~* rex "^src/proto_([0-9a-zA-Z_]*)/" with + | None -> + Stdlib.failwith ("failed to extract protocol name from path: " ^ __FILE__) + | Some name -> name + +let register_script transaction = + (* [~title] must be unique across the codebase, so we prefix it with the protocol name. + [~file] however is better kept the same across protocols to simplify snapshotting. *) + let file = filename transaction in + Regression.register + ~__FILE__ + ~title:(protocol ^ ": " ^ file) + ~tags:["protocol"; "regression"; "logging"] + ~file + (fail_on_error @@ run_script transaction) + +(* These tests should always cover: + - every instruction type, which means an example of each group of instructions + which are similar to each other with respect to logging; no need to cover every + instruction whatsoever, but just every distinct kind ; + - every continuation and control structure in Michelson, because those impact + what is being logged and what is not. + We are not concerned with gas, because that's kept track of by regular regression + tests. Actually, gas is unaccounted for in all the tests in this module. *) +let () = + Array.iter + register_script + [| + transaction + ~storage:"{}" + ~parameter:"Left \"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx\"" + "accounts"; + transaction + ~storage:"{1; 2; 3}" + ~parameter:"Pair {7; 8; 9} {4; 5; 6}" + "append"; + transaction + ~amount:(Tez.of_mutez_exn 100_000_000L) + ~parameter:"\"tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv\"" + ~storage: + "Pair \"2099-12-31T23:59:59Z\" (Pair 50000000 \ + \"tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU\")" + "auction"; + transaction + ~parameter:"{Pair \"string\" 12; Pair \"abc\" 99; Pair \"def\" 3}" + ~storage:"Pair { Elt \"123\" 123 } Unit" + "big_map_union"; + transaction + ~parameter:"\"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav\"" + ~storage: + "Pair \ + \"edsigu6Ue4mQgPC5aCFqqjitU9pCs5VErXrfPTAZffyJepccGzDEEBExtuPjGuMc2ZRSTBUDR7tJMLVTeJzZn7p9jN9inh4ooV1\" \ + \"TEZOS\"" + "check_signature"; + transaction ~parameter:"Pair 1 4 2 Unit" ~storage:"Unit" "comb-get"; + transaction ~parameter:"Unit" ~storage:"Pair 1 4 2 Unit" "comb-set"; + transaction ~parameter:"\"abcd\"" ~storage:"\"efgh\"" "concat"; + transaction ~parameter:"Right (Some 23)" ~storage:"\"\"" "conditionals"; + transaction ~parameter:"2" ~storage:"60" "cps_fact"; + transaction + ~parameter:"Pair (Pair (Pair (Pair 0 1) 2) 3) 4" + ~storage:"7" + "dign"; + transaction + ~parameter:"Pair (Pair (Pair (Pair 0 1) 2) 3) 4" + ~storage:"7" + "dipn"; + transaction + ~parameter:"Pair (Pair (Pair (Pair 0 1) 2) 3) 4" + ~storage:"7" + "dugn"; + transaction + ~parameter:"Pair 127 11" + ~storage:"Pair None None None None" + "ediv"; + transaction + ~parameter:"\"tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU\"" + ~storage:"\"2020-01-01T00:00:00Z\"" + "faucet"; + transaction + ~parameter:"\"abc\"" + ~storage:"Pair (Some 321) {Elt \"def\" 123}" + "get_and_update_map"; + transaction ~parameter:"True" ~storage:"None" "if"; + transaction + ~parameter:"{8; 3; 2; 7; 6; 9; 5; 1; 4; 0}" + ~storage:"{}" + "insertion_sort"; + transaction + ~parameter:"{1; 2; 3; 4; 5; 6; 7}" + ~storage:"{}" + "list_map_block"; + transaction + ~parameter:"{\"abc\"; \"xyz\"}" + ~storage:"{\"zyx\"; \"cba\"}" + "loop_left"; + transaction + ~parameter: + "Pair (Pair (Pair \"abc\" {1; 2; 3}) {4; 5; 6}) \ + 0x0507070707010000000361626302000000060001000200030200000006000400050006" + ~storage:"Unit" + "packunpack"; + transaction ~parameter:"7" ~storage:"77" "pexec"; + transaction + ~parameter:"{\"abc\"; \"def\" ; \"ghi\"}" + ~storage:"{}" + "reverse_loop"; + transaction + ~parameter:"Some \"tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN\"" + ~storage:"Unit" + "set_delegate"; + transaction ~parameter:"Right (Pair 3 2)" ~storage:"None" "shifts"; + transaction + ~amount:(Tez.of_mutez_exn 1_200_00L) + ~parameter:"7" + ~storage:"{}" + "spawn_identities"; + transaction + ~parameter:"Pair \"KT1Ln1MPvHDJ1phLL8dNL4jrKF6Q1yQCBG1v\" 17 3" + ~storage:"None" + "ticket_join"; + transaction + ~parameter:"Pair \"KT1Ln1MPvHDJ1phLL8dNL4jrKF6Q1yQCBG1v\" 17 3" + ~storage:"Unit" + "ticket_split"; + transaction ~parameter:"5" ~storage:"3" "view_toplevel_lib"; + transaction ~parameter:"Left (Pair True False)" ~storage:"None" "xor"; + transaction ~parameter:"7" ~storage:"Some 3" "opt_map"; + with_lib + ~parameter:(Format.asprintf "Pair 8 \"%a\"" Contract_hash.pp) + ~storage:"0" + ~lib:"view_toplevel_lib" + ~lib_storage:"0" + "view_fib"; + transaction ~parameter:"Unit" ~storage:"Unit" "rec_id_unit"; + |] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune new file mode 100644 index 000000000000..c4aff854f7b3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune @@ -0,0 +1,41 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(executable + (name main) + (libraries + tezos-base + tezos-base-test-helpers + tezos-micheline + tezos-client-alpha + tezos-client-base + tezos-protocol-016-PtMumbai.parameters + tezos-protocol-environment + tezos-stdlib-unix + tezos-protocol-016-PtMumbai + tezos-alpha-test-helpers + alcotest-lwt + test_scoru_wasm_test_helpers + tezos-stdlib + tezos-crypto-dal + tezos-scoru-wasm + tezos-webassembly-interpreter-extra) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base_test_helpers + -open Tezos_micheline + -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_protocol_016_PtMumbai + -open Tezos_alpha_test_helpers + -open Test_scoru_wasm_test_helpers + -open Tezos_stdlib + -open Tezos_crypto_dal + -open Tezos_webassembly_interpreter_extra)) + +(rule + (alias runtest) + (package tezos-protocol-016-PtMumbai-tests) + (action (run %{exe:main.exe} test Unit))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/main.ml new file mode 100644 index 000000000000..f16000774d7c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/main.ml @@ -0,0 +1,90 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +module Unit_test : sig + (** + * Example: [spec "Alpha_context.ml" Test_alpha_context.test_cases] + * Unit tests needs tag in log (like "[UNIT] some test description here...") + * This function handles such meta data *) + val spec : + string -> + unit Alcotest_lwt.test_case list -> + string * unit Alcotest_lwt.test_case list + + (** Tests with description string without [Unit] are skipped *) + val skip : + string -> + unit Alcotest_lwt.test_case list -> + string * unit Alcotest_lwt.test_case list +end = struct + let spec unit_name test_cases = ("[Unit] " ^ unit_name, test_cases) + + let skip unit_name test_cases = ("[SKIPPED] " ^ unit_name, test_cases) +end + +let () = + Alcotest_lwt.run + "protocol > unit" + [ + Unit_test.spec "Alpha_context.ml" Test_alpha_context.tests; + Unit_test.spec "Raw_level_repr.ml" Test_raw_level_repr.tests; + Unit_test.skip "Raw_level_repr.ml" Test_raw_level_repr.skipped_tests; + Unit_test.spec "Tez_repr.ml" Test_tez_repr.tests; + Unit_test.spec "Contract_repr.ml" Test_contract_repr.tests; + Unit_test.spec "Destination_repr.ml" Test_destination_repr.tests; + Unit_test.spec "Operation_repr.ml" Test_operation_repr.tests; + Unit_test.spec + "Global_constants_storage.ml" + Test_global_constants_storage.tests; + Unit_test.spec "fitness" Test_fitness.tests; + Unit_test.spec "fixed point computation" Test_fixed_point.tests; + Unit_test.spec "level module" Test_level_module.tests; + Unit_test.spec "qty" Test_qty.tests; + Unit_test.spec "round" Test_round_repr.tests; + Unit_test.spec "time" Test_time_repr.tests; + Unit_test.spec "receipt encodings" Test_receipt.tests; + Unit_test.spec "saturation arithmetic" Test_saturation.tests; + Unit_test.spec "gas monad" Test_gas_monad.tests; + Unit_test.spec "sc rollup storage" Test_sc_rollup_storage.tests; + Unit_test.spec "sc rollup game" Test_sc_rollup_game.tests; + Unit_test.spec "tx rollup l2" Test_tx_rollup_l2.tests; + Unit_test.spec "tx rollup l2 apply" Test_tx_rollup_l2_apply.tests; + Unit_test.spec "liquidity baking" Test_liquidity_baking_repr.tests; + Unit_test.spec "sc rollup wasm" Test_sc_rollup_wasm.tests; + Unit_test.spec "sc rollup arith" Test_sc_rollup_arith.tests; + Unit_test.spec "merkle list" Test_merkle_list.tests; + Unit_test.spec "sc rollup inbox" Test_sc_rollup_inbox.tests; + Unit_test.spec "skip list" Test_skip_list_repr.tests; + Unit_test.spec + "sc rollup management protocol" + Test_sc_rollup_management_protocol.tests; + Unit_test.spec "Bond_id_repr.ml" Test_bond_id_repr.tests; + Unit_test.spec "zk rollup storage" Test_zk_rollup_storage.tests; + Unit_test.spec "Delegate_consensus_key.ml" Test_consensus_key.tests; + Unit_test.spec "local_contexts" Test_local_contexts.tests; + Unit_test.spec "dal slot proof" Test_dal_slot_proof.tests; + ] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml new file mode 100644 index 000000000000..77cda1e31232 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml @@ -0,0 +1,287 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** Testing + ------- + Component: Alpha_context + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test Alpha_context + Dependencies: helpers/block.ml + Subject: To test the modules (including the top-level) + in alpha_context.ml as individual units, particularly + failure cases. Superficial goal: increase coverage percentage. +*) + +(** Creates an Alpha_context without creating a full-fledged block *) +let create () = + let account = Account.new_account () in + let bootstrap_account = Account.make_bootstrap_account account in + Block.alpha_context [bootstrap_account] + +let assert_equal_key_values ~loc kvs1 kvs2 = + let sort_by_key_hash = + List.sort (fun (k1, _) (k2, _) -> Script_expr_hash.compare k1 k2) + in + Assert.assert_equal_list + ~loc + (fun (k1, v1) (k2, v2) -> + Script_expr_hash.equal k1 k2 + && String.equal (Expr.to_string v1) (Expr.to_string v2)) + "Compare key-value list" + (fun fmt (k, v) -> + Format.fprintf fmt "(%a, %s)" Script_expr_hash.pp k (Expr.to_string v)) + (sort_by_key_hash kvs1) + (sort_by_key_hash kvs2) + +module Test_Script = struct + (** Force serialise of lazy [Big_map.t] in a given [alpha_context] *) + let test_force_bytes_in_context () = + create () >>=? fun alpha_context -> + let mbytes_pp ppf t = + Format.pp_print_string ppf (Environment.Bytes.to_string t) + in + let open Alpha_context.Script in + Environment.wrap_tzresult + @@ force_bytes_in_context alpha_context + @@ lazy_expr @@ Micheline.strip_locations + @@ Prim (0, D_Unit, [], []) + >>?= fun (bytes, _) -> + Assert.equal + ~loc:__LOC__ + Environment.Bytes.equal + "script serialised incorrectly" + mbytes_pp + bytes + (`Hex "030b" |> Hex.to_bytes_exn) +end + +module Test_Big_map = struct + (** Test failure path: look for a non-existent key in a [Big_map] *) + let test_mem () = + ( create () >>=? fun alpha_context -> + Big_map.fresh ~temporary:true alpha_context >|= Environment.wrap_tzresult + >>=? fun (alpha_context, big_map_id) -> + Big_map.mem + alpha_context + big_map_id + (Script_expr_hash.hash_string ["0"; "0"]) + >|= Environment.wrap_tzresult ) + >>=? fun (_alpha_context, is_member) -> + Assert.equal_bool ~loc:__LOC__ is_member false + + (** Test failure code path of [get_opt] by looking for missing key in a [Big_map.t] *) + let test_get_opt () = + ( create () >>=? fun alpha_context -> + Big_map.fresh ~temporary:true alpha_context >|= Environment.wrap_tzresult + >>=? fun (alpha_context, big_map_id) -> + Big_map.get_opt + alpha_context + big_map_id + (Script_expr_hash.hash_string ["0"; "0"]) + >|= Environment.wrap_tzresult ) + >>=? fun (_alpha_context, value) -> + match value with + | Some _ -> + failwith "get_opt should have failed looking for a non-existent key" + | None -> return_unit + + (** Test existence of a non-existent [Big_map] in an [Alpha_context.t] *) + let test_exists () = + ( create () >>=? fun alpha_context -> + Big_map.fresh ~temporary:true alpha_context >|= Environment.wrap_tzresult + >>=? fun (alpha_context, big_map_id) -> + Big_map.exists alpha_context big_map_id >|= Environment.wrap_tzresult ) + >>=? fun (_alpha_context, value) -> + match value with + | Some _ -> + failwith "exists should have failed looking for a non-existent big_map" + | None -> return_unit + + (** Test that [Big_map.list_key_values] retrieves hashed keys and values. *) + let test_list_key_values () = + let open Lwt_result_syntax in + let* block, source = Context.init1 () in + let key_values = + [ + ("1", {|"A"|}); + ("2", {|"B"|}); + ("3", {|"C"|}); + ("4", {|"D"|}); + ("5", {|"E"|}); + ] + |> List.map (fun (k, v) -> (Expr.from_string k, Expr.from_string v)) + in + let* big_map_id, ctxt = + Big_map_helpers.make_big_map + block + ~source + ~key_type:"int" + ~value_type:"string" + key_values + in + let* _ctxt, retrieved_key_values = + Big_map.list_key_values ctxt big_map_id >|= Environment.wrap_tzresult + in + let expected_key_hash_values = + List.map + (fun (key, value) -> + let bytes = + Data_encoding.Binary.to_bytes_exn Script_repr.expr_encoding key + in + let key_hash = Script_expr_hash.hash_bytes [bytes] in + (key_hash, value)) + key_values + in + assert_equal_key_values + ~loc:__LOC__ + expected_key_hash_values + retrieved_key_values + + (** Test [Big_map.list_key_values] with [length] and [offset] arguments. *) + let test_list_key_values_parameters () = + let open Lwt_result_syntax in + let* block, source = Context.init1 () in + let hash_key key = + let bytes = + Data_encoding.Binary.to_bytes_exn Script_repr.expr_encoding key + in + Script_expr_hash.hash_bytes [bytes] + in + let check_key_values ~loc ~num_elements ?offset ?length () = + let key_values = + WithExceptions.List.init ~loc:__LOC__ num_elements (fun n -> + (string_of_int n, Printf.sprintf {|"Value %d"|} n)) + |> List.map (fun (k, v) -> (Expr.from_string k, Expr.from_string v)) + in + let sorted_key_values = + List.sort + (fun (k1, _) (k2, _) -> + Script_expr_hash.compare (hash_key k1) (hash_key k2)) + key_values + in + let* big_map_id, ctxt = + Big_map_helpers.make_big_map + block + ~source + ~key_type:"int" + ~value_type:"string" + key_values + in + let* _ctxt, retrieved_key_values = + Big_map.list_key_values ?offset ?length ctxt big_map_id + >|= Environment.wrap_tzresult + in + let expected_key_hash_values = + (* A negative length is interpreted as 0 *) + let length = + match length with + | Some l -> max l 0 + | None -> List.length sorted_key_values + in + let offset = match offset with Some o -> max o 0 | None -> 0 in + let expected = + List.take_n length @@ List.drop_n offset sorted_key_values + in + List.map + (fun (key, value) -> + let bytes = + Data_encoding.Binary.to_bytes_exn Script_repr.expr_encoding key + in + let key_hash = Script_expr_hash.hash_bytes [bytes] in + (key_hash, value)) + expected + in + let* () = + assert_equal_key_values + ~loc + retrieved_key_values + expected_key_hash_values + in + return retrieved_key_values + in + (* The following combinations should yield the same key-values. *) + let* kvs1 = check_key_values ~loc:__LOC__ ~num_elements:10 () in + let* kvs2 = check_key_values ~loc:__LOC__ ~num_elements:10 ~offset:0 () in + let* kvs3 = check_key_values ~loc:__LOC__ ~num_elements:10 ~length:10 () in + let* kvs4 = + check_key_values ~loc:__LOC__ ~num_elements:10 ~offset:0 ~length:10 () + in + let* () = assert_equal_key_values ~loc:__LOC__ kvs1 kvs2 in + let* () = assert_equal_key_values ~loc:__LOC__ kvs2 kvs3 in + let* () = assert_equal_key_values ~loc:__LOC__ kvs3 kvs4 in + (* Attempt to consume more elements then the length. *) + let* kvs1 = check_key_values ~loc:__LOC__ ~num_elements:20 () in + let* kvs2 = check_key_values ~loc:__LOC__ ~num_elements:20 ~length:100 () in + let* () = assert_equal_key_values ~loc:__LOC__ kvs1 kvs2 in + let* (_ : _ list) = + check_key_values ~loc:__LOC__ ~num_elements:100 ~offset:100 ~length:1 () + in + (* Offset greater than the length. *) + let* kvs = check_key_values ~loc:__LOC__ ~num_elements:10 ~offset:100 () in + let* () = assert_equal_key_values ~loc:__LOC__ kvs [] in + (* Negative length is treated as zero. *) + let* kvs = check_key_values ~loc:__LOC__ ~num_elements:10 ~length:(-1) () in + let* () = assert_equal_key_values ~loc:__LOC__ kvs [] in + (* Negative offset is treated as zero. *) + let* kvs1 = + check_key_values ~loc:__LOC__ ~num_elements:10 ~offset:(-5) () + in + let* kvs2 = check_key_values ~loc:__LOC__ ~num_elements:10 () in + let* () = assert_equal_key_values ~loc:__LOC__ kvs1 kvs2 in + return_unit +end + +let tests = + [ + Tztest.tztest + "Script.force_bytes_in_context: checks if it serialises a simple \ + michelson expression" + `Quick + Test_Script.test_force_bytes_in_context; + Tztest.tztest + "Big_map.mem: failure case - must return false when starting with an \ + empty map" + `Quick + Test_Big_map.test_mem; + Tztest.tztest + "Big_map.get_opt: failure case - looking up key that doesn't exist" + `Quick + Test_Big_map.test_get_opt; + Tztest.tztest + "Big_map.exists: failure case - looking up big_map that doesn't exist" + `Quick + Test_Big_map.test_exists; + Tztest.tztest + "Big_map.list_key_values basic tests" + `Quick + Test_Big_map.test_list_key_values; + Tztest.tztest + "Big_map.list_key_values: combinations of parameters" + `Quick + Test_Big_map.test_list_key_values_parameters; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml new file mode 100644 index 000000000000..e0e7d24de55c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml @@ -0,0 +1,147 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trilitech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Bond_id_repr + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test Bond_id_repr + Dependencies: -- + Subject: Test bond id representations for RPC definitions. +*) + +open Protocol +open Lwt_result_syntax + +let assert_bond_id_result_equal ~loc = + Assert.equal_result + ~loc + ~pp_ok:Bond_id_repr.pp + ~pp_error:Format.pp_print_string + Bond_id_repr.( = ) + ( = ) + +let test_destruct_sc_bond_id_repr () = + let sc_rollup_address1 = "sr1JPVatbbPoGp4vb6VfQ1jzEPMrYFcKq6VG" in + let sc_rollup_address2 = "sr1JtMTWShgi1jLrqeHohMwLYiGizpsyWzXJ" in + let invalid_sc_rollup_address = "sr1RWAV26caoU7oVMvetUPMt8CqvGmKtA8BO" in + let destruct = Bond_id_repr.Internal_for_test.destruct in + let sc_bond id = + match Sc_rollup_repr.Address.of_b58check_opt id with + | Some id -> Ok (Bond_id_repr.Sc_rollup_bond_id id) + | None -> Error "Not an sc address" + in + let* () = + assert_bond_id_result_equal + ~loc:__LOC__ + (destruct sc_rollup_address1) + (sc_bond sc_rollup_address1) + in + let* () = + assert_bond_id_result_equal + ~loc:__LOC__ + (destruct sc_rollup_address2) + (sc_bond sc_rollup_address2) + in + Assert.is_error + ~loc:__LOC__ + ~pp:Bond_id_repr.pp + (destruct invalid_sc_rollup_address) + +let test_destruct_tx_bond_id_repr () = + let tx_rollup_address1 = "txr1UTQm2gtoVJNvJRGfwora8GmM7D5dnEcdb" in + let tx_rollup_address2 = "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi" in + let invalid_tx_rollup_address = "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96Ui" in + let destruct = Bond_id_repr.Internal_for_test.destruct in + let tx_bond id = + match Tx_rollup_repr.of_b58check_opt id with + | Some id -> Ok (Bond_id_repr.Tx_rollup_bond_id id) + | None -> Error "Not a tx address" + in + let* () = + assert_bond_id_result_equal + ~loc:__LOC__ + (destruct tx_rollup_address1) + (tx_bond tx_rollup_address1) + in + let* () = + assert_bond_id_result_equal + ~loc:__LOC__ + (destruct tx_rollup_address2) + (tx_bond tx_rollup_address2) + in + Assert.is_error + ~loc:__LOC__ + ~pp:Bond_id_repr.pp + (destruct invalid_tx_rollup_address) + +let test_destruct_invalid_bond_id_repr () = + let invalid_address = "asdfasdfasdf" in + let empty_address = "" in + let destruct = Bond_id_repr.Internal_for_test.destruct in + let* () = + Assert.is_error ~loc:__LOC__ ~pp:Bond_id_repr.pp (destruct invalid_address) + in + Assert.is_error ~loc:__LOC__ ~pp:Bond_id_repr.pp (destruct empty_address) + +let test_roundtrip () = + let destruct_for_rountrip v = + let r = + match Bond_id_repr.Internal_for_test.destruct v with + | Ok r -> return r + | _ -> failwith "Destruct failed for %s" v + in + r + in + let rountrip_test loc s = + let* r = destruct_for_rountrip s in + let s2 = Bond_id_repr.Internal_for_test.construct r in + Assert.equal_string ~loc s s2 + in + let tx_rollup_address1 = "txr1UTQm2gtoVJNvJRGfwora8GmM7D5dnEcdb" in + let tx_rollup_address2 = "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi" in + let sc_rollup_address1 = "sr1JPVatbbPoGp4vb6VfQ1jzEPMrYFcKq6VG" in + let sc_rollup_address2 = "sr1JtMTWShgi1jLrqeHohMwLYiGizpsyWzXJ" in + let* () = rountrip_test __LOC__ tx_rollup_address1 in + let* () = rountrip_test __LOC__ tx_rollup_address2 in + let* () = rountrip_test __LOC__ sc_rollup_address1 in + rountrip_test __LOC__ sc_rollup_address2 + +let tests = + [ + Tztest.tztest + "Deserializing sc bond ids succeeds only when id is valid" + `Quick + test_destruct_sc_bond_id_repr; + Tztest.tztest + "Deserializing tx bond ids succeeds only when id is valid" + `Quick + test_destruct_tx_bond_id_repr; + Tztest.tztest + "Deserializing invalid bond ids fails" + `Quick + test_destruct_invalid_bond_id_repr; + Tztest.tztest "Deserialize/serialize roundtrip" `Quick test_roundtrip; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml new file mode 100644 index 000000000000..f985e4cea1e1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml @@ -0,0 +1,240 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 G.B. Fefe, <gb.fefe@protonmail.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (delegate_consensus_key) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] Delegate_consensus_key.ml" + Subject: Functions from the module `Delegate_consensus_key` +*) + +open Protocol + +let create () = + let open Lwt_result_syntax in + let*? accounts = Account.generate_accounts 2 in + let a1, a2 = match accounts with [a1; a2] -> (a1, a2) | _ -> assert false in + let* ctxt = Block.alpha_context (Account.make_bootstrap_accounts accounts) in + return (Alpha_context.Internal_for_tests.to_raw ctxt, a1, a2) + +module Consensus_key = struct + let active_key ctxt pkh = + Delegate_consensus_key.active_key ctxt pkh >|= Environment.wrap_tzresult + + let active_pubkey ctxt pkh = + Delegate_consensus_key.active_pubkey ctxt pkh >|= Environment.wrap_tzresult + + let active_pubkey_for_cycle ctxt pkh cycle = + Delegate_consensus_key.active_pubkey_for_cycle + ctxt + pkh + (Cycle_repr.of_int32_exn (Int32.of_int cycle)) + >|= Environment.wrap_tzresult + + let pending_updates ctxt pkh = + Delegate_consensus_key.pending_updates ctxt pkh + >|= Environment.wrap_tzresult + + let register_update ctxt pkh pk = + Delegate_consensus_key.register_update ctxt pkh pk + >|= Environment.wrap_tzresult + + let activate ctxt ~new_cycle = + Delegate_consensus_key.activate ctxt ~new_cycle + >|= Environment.wrap_tzresult +end + +module Assert = struct + include Assert + + let equal_pkh ~__LOC__ a b = + Assert.equal + ~loc:__LOC__ + Tezos_crypto.Signature.Public_key_hash.equal + "pkh" + Tezos_crypto.Signature.Public_key_hash.pp + a + b + + let equal_pk ~__LOC__ a b = + Assert.equal + ~loc:__LOC__ + Tezos_crypto.Signature.Public_key.equal + "pk" + Tezos_crypto.Signature.Public_key.pp + a + b + + let active_keys ~__LOC__ ctxt delegate l = + List.iter_es + (fun (c, pk) -> + let open Lwt_result_syntax in + let* active_pk = + Consensus_key.active_pubkey_for_cycle ctxt delegate c + in + equal_pk ~__LOC__ active_pk.consensus_pk pk) + l +end + +let rec add_cycles ctxt n = + if n <= 0 then return ctxt + else + let open Lwt_result_syntax in + let current_level = Raw_context.current_level ctxt in + let new_cycle = Cycle_repr.succ current_level.cycle in + let* ctxt = Consensus_key.activate ctxt ~new_cycle in + let ctxt = Raw_context.Internal_for_tests.add_cycles ctxt 1 in + add_cycles ctxt (n - 1) + +let test_consensus_key_storage () = + let open Lwt_result_syntax in + let* ctxt, del1, del2 = create () in + let a1 = Account.new_account () in + let a2 = Account.new_account () in + let preserved_cycles = Constants_storage.preserved_cycles ctxt in + let* () = Assert.equal_int ~loc:__LOC__ preserved_cycles 3 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh del1.pkh + in + let* () = + let* active_pk = Consensus_key.active_pubkey ctxt del1.pkh in + Assert.equal_pk ~__LOC__ active_pk.consensus_pk del1.pk + in + let* () = + let* active_pk = Consensus_key.active_pubkey_for_cycle ctxt del1.pkh 3 in + Assert.equal_pk ~__LOC__ active_pk.consensus_pk del1.pk + in + let* () = + let*! err = Consensus_key.register_update ctxt del1.pkh del2.pk in + Assert.proto_error ~loc:__LOC__ err (function + | Delegate_consensus_key.Invalid_consensus_key_update_active -> true + | _ -> false) + in + let* ctxt = Consensus_key.register_update ctxt del1.pkh a1.pk in + let* () = + let*! err = Consensus_key.register_update ctxt del1.pkh a1.pk in + Assert.proto_error ~loc:__LOC__ err (function + | Delegate_consensus_key.Invalid_consensus_key_update_noop c -> + c = Cycle_repr.of_int32_exn 4l + | _ -> false) + in + let* () = + let*! err = Consensus_key.register_update ctxt del2.pkh a1.pk in + Assert.proto_error ~loc:__LOC__ err (function + | Delegate_consensus_key.Invalid_consensus_key_update_active -> true + | _ -> false) + in + let* ctxt = Consensus_key.register_update ctxt del2.pkh del1.pk in + let* () = + Assert.active_keys + ~__LOC__ + ctxt + del1.pkh + [ + (0, del1.pk); + (1, del1.pk); + (2, del1.pk); + (2, del1.pk); + (3, del1.pk); + (4, a1.pk); + (5, a1.pk); + ] + in + let* ctxt = add_cycles ctxt 1 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh del1.pkh + in + let* () = + let*! err = Consensus_key.register_update ctxt del1.pkh a1.pk in + Assert.proto_error ~loc:__LOC__ err (function + | Delegate_consensus_key.Invalid_consensus_key_update_noop c -> + c = Cycle_repr.of_int32_exn 4l + | _ -> false) + in + let* ctxt = Consensus_key.register_update ctxt del1.pkh a2.pk in + let* ctxt = Consensus_key.register_update ctxt del2.pkh a1.pk in + let* ctxt = Consensus_key.register_update ctxt del2.pkh del2.pk in + let* () = + Assert.active_keys + ~__LOC__ + ctxt + del1.pkh + [ + (1, del1.pk); + (2, del1.pk); + (2, del1.pk); + (3, del1.pk); + (4, a1.pk); + (5, a2.pk); + (6, a2.pk); + ] + in + let* ctxt = add_cycles ctxt 2 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh del1.pkh + in + let* () = + let*! err = Consensus_key.register_update ctxt del1.pkh a2.pk in + Assert.proto_error ~loc:__LOC__ err (function + | Delegate_consensus_key.Invalid_consensus_key_update_noop c -> + c = Cycle_repr.of_int32_exn 5l + | _ -> false) + in + let* ctxt = Consensus_key.register_update ctxt del1.pkh a1.pk in + let* () = + Assert.active_keys + ~__LOC__ + ctxt + del1.pkh + [(3, del1.pk); (4, a1.pk); (5, a2.pk); (6, a2.pk); (7, a1.pk); (8, a1.pk)] + in + let* ctxt = add_cycles ctxt 1 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh a1.pkh + in + let* ctxt = add_cycles ctxt 1 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh a2.pkh + in + let* ctxt = add_cycles ctxt 1 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh a2.pkh + in + let* ctxt = add_cycles ctxt 1 in + let* () = + let* active_pkh = Consensus_key.active_key ctxt del1.pkh in + Assert.equal_pkh ~__LOC__ active_pkh.consensus_pkh a1.pkh + in + return () + +let tests = + [Tztest.tztest "consensus_key_storage" `Quick test_consensus_key_storage] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml new file mode 100644 index 000000000000..9a758c030b67 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml @@ -0,0 +1,120 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Contract_repr + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Contract_repr + Dependencies: contract_hash.ml + Subject: To test the modules (including the top-level) + in contract_repr.ml as individual units, particularly + failure cases. Superficial goal: increase coverage percentage. +*) +open Protocol + +open Tztest + +(* + + TODO: Remove dependence on contract_hash.ml and mock it + + *) + +module Test_contract_repr = struct + (** Assert if [is_implicit] correctly returns the implicit contract *) + open Contract_repr + + let dummy_operation_hash = + Tezos_crypto.Operation_hash.of_bytes_exn + (Bytes.of_string "test-operation-hash-of-length-32") + + let dummy_origination_nonce = Origination_nonce.initial dummy_operation_hash + + let dummy_contract_hash = + (* WARNING: Uses Contract_repr itself, which is yet to be tested. This happened because Contract_hash wasn't mocked *) + let data = + Data_encoding.Binary.to_bytes_exn + Origination_nonce.encoding + dummy_origination_nonce + in + Contract_hash.hash_bytes [data] + + let dummy_implicit_contract = + Implicit Tezos_crypto.Signature.Public_key_hash.zero + + let dummy_originated_contract = originated_contract @@ dummy_origination_nonce + + let test_to_b58check_implicit () = + Assert.equal + ~loc:__LOC__ + String.equal + "%s should have been equal to %" + Format.pp_print_string + (to_b58check dummy_implicit_contract) + Tezos_crypto.Signature.Public_key_hash.(to_b58check zero) + + let test_to_b58check_originated () = + Assert.equal + ~loc:__LOC__ + String.equal + "%s should have been equal to %" + Format.pp_print_string + (to_b58check dummy_originated_contract) + Contract_hash.(to_b58check @@ dummy_contract_hash) + + let create_dummy_contracts n = + let since = dummy_origination_nonce in + let rec incr_n_times nonce = function + | 0 -> nonce + | n -> incr_n_times (Origination_nonce.incr nonce) (n - 1) + in + let until = incr_n_times since n in + let contracts = originated_contracts ~since ~until in + contracts + + let test_originated_contracts_basic () = + let n = 5 in + let contracts = create_dummy_contracts n in + Assert.equal_int ~loc:__LOC__ (List.length contracts) n +end + +let tests = + [ + tztest + "Contract_repr.to_b58check: must correctly stringify, b58check encoded, \ + an implicit contract" + `Quick + Test_contract_repr.test_to_b58check_implicit; + tztest + "Contract_repr.originated_contract: must correctly create an originated \ + contract" + `Quick + Test_contract_repr.test_originated_contracts_basic; + tztest + "Contract_repr.to_b58check: must correctly stringify, b58check encoded, \ + an originated contract" + `Quick + Test_contract_repr.test_to_b58check_originated; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml new file mode 100644 index 000000000000..c7243abbc32a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -0,0 +1,440 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (dal slot proof) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] dal slot proof$" + Subject: These unit tests check proof-related functions of Dal slots. +*) + +open Protocol +module S = Dal_slot_repr +module H = S.Header +module P = S.Page +module Hist = S.History + +module Make (Parameters : sig + val name : string + + val dal_parameters : Alpha_context.Constants.Parametric.dal +end) = +struct + open Dal_helpers.Make (struct + include Parameters + + let cryptobox = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Dal_helpers.mk_cryptobox Parameters.dal_parameters.cryptobox_parameters + end) + + (* Tests to check insertion of slots in a dal skip list. *) + + (** Check insertion of a new slot in the given skip list. *) + let skip_list_ordering skip_list ~mk_level ~mk_slot_index ~check_result = + let open Lwt_result_syntax in + let {S.Header.id; _} = Hist.Internal_for_tests.content skip_list in + let level = mk_level id in + let index = mk_slot_index id in + let*? _data, _poly, slot = mk_slot ~level ~index () in + Hist.add_confirmed_slot_headers_no_cache skip_list [slot] + |> Environment.wrap_tzresult |> check_result + + (** This test attempts to add a slot on top of genesis cell zero which would + break the ordering. In fact, confirmed slots' skip list is ordered by slots + ID: the slots' level should increase or the level is equal in which case the + slots' index should increase. In the test below, we attempt to insert a slot + where (published_level, slot_index) doesn't increase (is the same as the + genesis cell). *) + let insertion_breaks_skip_list_ordering () = + skip_list_ordering + genesis_history + ~mk_level:(fun id -> id.H.published_level) + ~mk_slot_index:(fun id -> id.H.index) + ~check_result:(fun res -> + Assert.proto_error ~loc:__LOC__ res (function + | Hist.Add_element_in_slots_skip_list_violates_ordering -> true + | _ -> false)) + + (** This test attempts to add a slot on top of genesis cell zero which satisfies + the ordering. *) + let correct_insertion_in_skip_list_ordering_1 () = + let open Lwt_result_syntax in + skip_list_ordering + genesis_history + ~mk_level:(fun id -> Raw_level_repr.succ id.H.published_level) + ~mk_slot_index:(fun id -> id.H.index) + ~check_result:(fun res -> + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in + return_unit) + + (** This test attempts to add a slot on top of genesis cell zero which satisfies + the ordering. *) + let correct_insertion_in_skip_list_ordering_2 () = + let open Lwt_result_syntax in + skip_list_ordering + genesis_history + ~mk_level:(fun id -> id.H.published_level) + ~mk_slot_index:(fun id -> succ_slot_index id.H.index) + ~check_result:(fun res -> + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in + return_unit) + + (** This test attempts to add two slots on top of genesis cell zero which satisfies + the ordering. *) + let correct_insertion_in_skip_list_ordering_3 () = + let open Lwt_result_syntax in + skip_list_ordering + genesis_history + ~mk_level:(fun id -> id.H.published_level) + ~mk_slot_index:(fun id -> succ_slot_index id.H.index) + ~check_result:(fun res -> + let* skip_list = Assert.get_ok ~__LOC__ res in + skip_list_ordering + skip_list + ~mk_level:(fun id -> + Raw_level_repr.(succ (succ id.H.published_level))) + ~mk_slot_index:(fun id -> id.H.index) + ~check_result:(fun res -> + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in + return_unit)) + + (* Tests of construct/verify proofs that confirm/unconfirm pages on top of + genesis skip list (whose unique cell is slot zero). *) + + (** This test attempts to construct a proof to confirm a slot page from the + genesis skip list. Proof production is expected to fail. *) + let confirmed_page_on_genesis () = + let {H.id = {published_level; index}; _} = + Hist.Internal_for_tests.content genesis_history + in + let page_id = mk_page_id published_level index P.Index.zero in + produce_and_verify_proof + genesis_history + ~get_history:(get_history genesis_history_cache) + (* values of level and slot index are equal to slot zero. We would get a + page confirmation proof. But, no proof that confirms the existence of a page + in slot [zero] is possible. *) + ~page_info:None + ~page_id + ~check_produce:(slot_confirmed_but_page_data_not_provided ~__LOC__) + + (** This test attempts to construct a proof to unconfirm a slot page from the + genesis skip list. Proof production is expected to succeed. *) + let unconfirmed_page_on_genesis incr_level = + let {H.id = {published_level; index}; _} = + Hist.Internal_for_tests.content genesis_history + in + let level, sindex = + if incr_level then (Raw_level_repr.succ published_level, index) + else (published_level, succ_slot_index index) + in + let page_id = mk_page_id level sindex P.Index.zero in + produce_and_verify_proof + genesis_history + ~get_history:(get_history genesis_history_cache) + ~page_info:None + ~page_id + ~check_produce:(successful_check_produce_result ~__LOC__ `Unconfirmed) + ~check_verify:(successful_check_verify_result ~__LOC__ `Unconfirmed) + + (* Tests of construct/verify proofs that attempt to confirm pages on top of a + (confirmed) slot added in genesis_history skip list. *) + + (** Helper function that adds a slot a top of the genesis skip list. *) + let helper_confirmed_slot_on_genesis ~level ~mk_page_info ~check_produce + ?check_verify () = + let open Lwt_result_syntax in + let*? _slot_data, polynomial, slot = mk_slot ~level () in + let*? skip_list, cache = + Hist.add_confirmed_slot_headers + genesis_history + genesis_history_cache + [slot] + |> Environment.wrap_tzresult + in + let*? page_info, page_id = mk_page_info slot polynomial in + produce_and_verify_proof + skip_list + ~get_history:(get_history cache) + ~page_info + ~page_id + ?check_verify + ~check_produce + + (** Test where a slot is confirmed, requesting a proof for a confirmed page, + where the correct data and page proof are provided. *) + let confirmed_slot_on_genesis_confirmed_page_good_data = + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info + ~check_produce:(successful_check_produce_result ~__LOC__ `Confirmed) + ~check_verify:(successful_check_verify_result ~__LOC__ `Confirmed) + + (** Test where a slot is confirmed, requesting a proof for a confirmed page, + where the page data and proof are not given. *) + let confirmed_slot_on_genesis_confirmed_page_no_data = + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info:(mk_page_info ~custom_data:no_data) + ~check_produce:(slot_confirmed_but_page_data_not_provided ~__LOC__) + + (** Test where a slot is confirmed, requesting a proof for a confirmed page, + where correct data are provided, but the given page proof is wrong. *) + let confirmed_slot_on_genesis_confirmed_page_bad_page_proof = + let open Result_syntax in + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info:(fun slot poly -> + let* page_info1, _page_id1 = mk_page_info ~page_index:1 slot poly in + let* page_info2, page_id2 = mk_page_info ~page_index:2 slot poly in + assert ( + match (page_info1, page_info2) with + | Some (_d1, p1), Some (_d2, p2) -> not (eq_page_proof p1 p2) + | _ -> false) ; + return (page_info1, page_id2)) + ~check_produce: + (failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Dal_proof_error + "Wrong page content for the given page index and slot \ + commitment (page id=(published_level: 11, slot_index: 0, \ + page_index: 2)).")) + + (** Test where a slot is confirmed, requesting a proof for a confirmed page, + where correct page proof is provided, but given page data is altered. *) + let confirmed_slot_on_genesis_confirmed_page_bad_data_right_length = + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info: + (mk_page_info + ~custom_data: + (Some + (fun ~default_char page_size -> + Some + (Bytes.init page_size (fun i -> + if i = 0 then next_char default_char else default_char))))) + ~check_produce: + (failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Dal_proof_error + "Wrong page content for the given page index and slot \ + commitment (page id=(published_level: 11, slot_index: 0, \ + page_index: 0)).")) + + (** Same as {!confirmed_slot_on_genesis_confirmed_page_bad_data_right_length} + but the data is too short. *) + let confirmed_slot_on_genesis_confirmed_page_bad_data_short = + let page_size = Parameters.dal_parameters.cryptobox_parameters.page_size in + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info: + (mk_page_info + ~custom_data: + (Some + (fun ~default_char page_size -> + Some (Bytes.make (page_size - 1) default_char)))) + ~check_produce: + (failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Unexpected_page_size + {expected_size = page_size; page_size = page_size - 1})) + + (** Same as {!confirmed_slot_on_genesis_confirmed_page_bad_data_right_length} + but the data is too long. *) + let confirmed_slot_on_genesis_confirmed_page_bad_data_long = + let page_size = Parameters.dal_parameters.cryptobox_parameters.page_size in + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ level_ten) + ~mk_page_info: + (mk_page_info + ~custom_data: + (Some + (fun ~default_char page_size -> + Some (Bytes.make (page_size + 1) default_char)))) + ~check_produce: + (failing_check_produce_result + ~__LOC__ + ~expected_error: + (Hist.Unexpected_page_size + {expected_size = page_size; page_size = page_size + 1})) + + (* Variants of the tests above: Construct/verify proofs that attempt to + unconfirm pages on top of a (confirmed) slot added in genesis_history skip + list. + + All the tests are somehow equivalent when building "Unconfirmed page" proof, + because the page's data & page's proof are ignored in this case. + *) + + (** Specialisation of helper {!helper_confirmed_slot_on_genesis}, where some + parameters are fixed. *) + let helper_confirmed_slot_on_genesis_unconfirmed_page ~check_produce + ?check_verify ~page_level ~mk_page_info = + helper_confirmed_slot_on_genesis + ~level:(Raw_level_repr.succ page_level) + ~mk_page_info + ~check_produce + ?check_verify + + (** Unconfirmation proof for a page with good data. *) + let confirmed_slot_on_genesis_unconfirmed_page_good_data = + helper_confirmed_slot_on_genesis_unconfirmed_page + ~page_level:level_ten + ~mk_page_info:(mk_page_info ~level:level_ten) + ~check_produce:(slot_not_confirmed_but_page_data_provided ~__LOC__) + + (** Unconfirmation proof for a page with no data. *) + let confirmed_slot_on_genesis_unconfirmed_page_no_data = + helper_confirmed_slot_on_genesis_unconfirmed_page + ~page_level:level_ten + ~mk_page_info:(mk_page_info ~custom_data:no_data ~level:level_ten) + ~check_produce:(successful_check_produce_result ~__LOC__ `Unconfirmed) + + (** Unconfirmation proof for a page with bad page proof. *) + let confirmed_slot_on_genesis_unconfirmed_page_bad_proof = + let open Result_syntax in + let level = level_ten in + helper_confirmed_slot_on_genesis_unconfirmed_page + ~page_level:level + ~mk_page_info:(fun slot poly -> + let* page_info1, _page_id1 = + mk_page_info ~level:level_ten ~page_index:1 slot poly + in + let* _page_info2, page_id2 = + mk_page_info ~level:level_ten ~page_index:2 slot poly + in + assert ( + match (page_info1, _page_info2) with + | Some (_d1, p1), Some (_d2, p2) -> not (eq_page_proof p1 p2) + | _ -> false) ; + return (page_info1, page_id2)) + ~check_produce:(slot_not_confirmed_but_page_data_provided ~__LOC__) + + (** Unconfirmation proof for a page with bad data. *) + let confirmed_slot_on_genesis_unconfirmed_page_bad_data = + let level = level_ten in + helper_confirmed_slot_on_genesis_unconfirmed_page + ~page_level:level + ~mk_page_info: + (mk_page_info + ~level:level_ten + ~custom_data: + (Some + (fun ~default_char page_size -> + Some + (Bytes.init page_size (fun i -> + if i = 0 then next_char default_char else default_char))))) + ~check_produce:(slot_not_confirmed_but_page_data_provided ~__LOC__) + + (* The list of tests. *) + let tests = + let mk_title = Format.sprintf "[%s] %s" Parameters.name in + let tztest title test_function = + Tztest.tztest (mk_title title) `Quick test_function + in + let qcheck2 title gen test = + Tztest.tztest_qcheck2 ~name:(mk_title title) ~count:2 gen test + in + let bool = QCheck2.Gen.bool in + let ordering_tests = + [ + tztest + "add a slot on top of genesis that breaks ordering" + insertion_breaks_skip_list_ordering; + tztest + "add a slot on top of genesis that satisfies ordering (1/2)" + correct_insertion_in_skip_list_ordering_1; + tztest + "add a slot on top of genesis that satisfies ordering (2/2)" + correct_insertion_in_skip_list_ordering_2; + tztest + "add two slots on top of genesis that satisfy ordering" + correct_insertion_in_skip_list_ordering_3; + ] + in + let proofs_tests_on_genesis = + [ + tztest "Confirmed page on genesis" confirmed_page_on_genesis; + qcheck2 "Unconfirmed page on genesis" bool unconfirmed_page_on_genesis; + ] + in + + let confirmed_slot_on_genesis_confirmed_page_tests = + [ + tztest + "Confirmed slot on top of genesis: confirmed page with good data" + confirmed_slot_on_genesis_confirmed_page_good_data; + tztest + "Confirmed slot on top of genesis: confirmed page with no data" + confirmed_slot_on_genesis_confirmed_page_no_data; + tztest + "Confirmed slot on top of genesis: confirmed page with bad proof" + confirmed_slot_on_genesis_confirmed_page_bad_page_proof; + tztest + "Confirmed slot on top of genesis: confirmed page with bad data" + confirmed_slot_on_genesis_confirmed_page_bad_data_right_length; + tztest + "Confirmed slot on top of genesis: confirmed page with too short data" + confirmed_slot_on_genesis_confirmed_page_bad_data_short; + tztest + "Confirmed slot on top of genesis: confirmed page with too long data" + confirmed_slot_on_genesis_confirmed_page_bad_data_long; + ] + in + let confirmed_slot_on_genesis_unconfirmed_page_tests = + [ + tztest + "Confirmed slot on top of genesis: unconfirmed page with good data" + confirmed_slot_on_genesis_unconfirmed_page_good_data; + tztest + "Confirmed slot on top of genesis: unconfirmed page with no data" + confirmed_slot_on_genesis_unconfirmed_page_no_data; + tztest + "Confirmed slot on top of genesis: unconfirmed page with bad proof" + confirmed_slot_on_genesis_unconfirmed_page_bad_proof; + tztest + "Confirmed slot on top of genesis: unconfirmed page with bad data \ + (altered)" + confirmed_slot_on_genesis_unconfirmed_page_bad_data; + ] + in + ordering_tests @ proofs_tests_on_genesis + @ confirmed_slot_on_genesis_confirmed_page_tests + @ confirmed_slot_on_genesis_unconfirmed_page_tests +end + +let tests = + let open Tezos_protocol_016_PtMumbai_parameters.Default_parameters in + let module Test = Make (struct + let name = "test" + + let dal_parameters = constants_test.dal + end) in + Test.tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml new file mode 100644 index 000000000000..1fafdba8ce99 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml @@ -0,0 +1,225 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs. <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Destination_repr + Invocation: dune exec -- ./src/proto_alpha/lib_protocol/test/unit/main.exe \ + test Destination_repr + Subject: To test the encoding of [Destination_repr] and assert it is + compatible with [Contract_repr.encoding]. +*) + +open Protocol +open Tztest + +let dummy_operation_hash = + Tezos_crypto.Operation_hash.of_bytes_exn + (Bytes.of_string "test-operation-hash-of-length-32") + +let dummy_origination_nonce = Origination_nonce.initial dummy_operation_hash + +let contracts = + let since = dummy_origination_nonce in + let rec incr_n_times nonce = function + | 0 -> nonce + | n -> incr_n_times (Origination_nonce.incr nonce) (n - 1) + in + let until = incr_n_times since 5 in + Contract_repr.originated_contracts ~since ~until + |> List.map (fun c -> Contract_repr.Originated c) + +let dest x = Destination_repr.Contract x + +let construct = Data_encoding.Json.construct + +let destruct = Data_encoding.Json.destruct + +let to_bytes_exn = Data_encoding.Binary.to_bytes_exn + +let of_bytes_exn = Data_encoding.Binary.of_bytes_exn + +let ( !! ) = function Ok x -> x | Error _ -> raise (Invalid_argument "( !! )") + +(* The following addresses have been extracted from TzKT. *) + +let null_address = "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" + +let liquidity_baking_dex = "KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5" + +(* The following address has been extracted from + [tezt/_regressions/tx_rollup_simple_use_case.out]. *) + +let tx_rollup_address = "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi" + +(* The following address has been extracted like this: + - [dune exec tezt/tests/main.exe -- -verbose --file sc_rollup.ml + sc_rollup list] +*) +let sc_rollup_address = "sr1BAwv191dVYeZg44ZxVy8dFwfRQKW6bSqc" + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/3731 + Explain how this address was computed *) +let zk_rollup_address = "epx18RJJqrYuJQqhB636BWvukU3XBNQGbtm8C" + +let assert_compat contract destination = + match destination with + | Destination_repr.Contract contract' + when Contract_repr.equal contract contract' -> + () + | _ -> raise (Invalid_argument "assert_compat") + +(** [test_decoding_json_compat str] decodes [str] as both a [Destination_repr.t] + and [Contract_repr.t], and checks the two are equal. *) +let test_decoding_json_compat str () = + let json = + !!(Data_encoding.Json.from_string @@ Format.sprintf {|"%s"|} str) + in + let contract = destruct Contract_repr.encoding json in + let destination = destruct Destination_repr.encoding json in + + assert_compat contract destination ; + + return_unit + +(** [test_encode_contract_decode_destination str] interprets [str] as + a [Contract_repr.t], encodes it in a bytes array, then decodes it + as a [Destination_repr.t]. The resulting destination should be + equal to the initial contract. *) +let test_encode_contract_decode_destination str () = + let contract = !!(Contract_repr.of_b58check str) in + let bytes = to_bytes_exn Contract_repr.encoding contract in + let destination = of_bytes_exn Destination_repr.encoding bytes in + + assert_compat contract destination ; + + return_unit + +(** [test_encode_destination_decode_contract str] interprets [str] as + a [Destination_repr.t], encodes it in a bytes array, then decodes + it as a [Contract_repr.t]. The resulting contract should be equal + to the initial destination. *) +let test_encode_destination_decode_contract str () = + let destination = !!(Destination_repr.of_b58check str) in + let bytes = to_bytes_exn Destination_repr.encoding destination in + let contract = of_bytes_exn Contract_repr.encoding bytes in + + assert_compat contract destination ; + + return_unit + +let encoding_compat ~encode_contract ~decode_contract ~encode_destination + ~decode_destination contract = + let destination = dest contract in + + let encoded_contract = encode_contract contract in + let encoded_destination = encode_destination destination in + + let destination_of_contract = decode_destination encoded_contract in + let contract_of_destination = decode_contract encoded_destination in + + assert_compat contract_of_destination destination ; + assert_compat contract destination_of_contract ; + + return_unit + +(** [encoding_json_compat contract] creates a {!Destination_repr.t} using + a dummy contract and ensures that their JSON encodings are compatible with + each other. +*) +let encoding_json_compat contract = + encoding_compat + ~encode_contract:(construct Contract_repr.encoding) + ~decode_contract:(destruct Contract_repr.encoding) + ~encode_destination:(construct Destination_repr.encoding) + ~decode_destination:(destruct Destination_repr.encoding) + contract + +(** [encoding_json_compat contract] creates a {!Destination_repr.t} using + a dummy contract and ensures that their binary encodings are compatible with + each other. +*) +let encoding_binary_compat contract = + encoding_compat + ~encode_contract:(to_bytes_exn Contract_repr.encoding) + ~decode_contract:(of_bytes_exn Contract_repr.encoding) + ~encode_destination:(to_bytes_exn Destination_repr.encoding) + ~decode_destination:(of_bytes_exn Destination_repr.encoding) + contract + +let test_contracts f () = + List.iter (fun contract -> ignore (f contract)) contracts ; + + return_unit + +let test_encoding_binary_compat = test_contracts encoding_binary_compat + +let test_encoding_json_compat = test_contracts encoding_json_compat + +let test_compare_destination () = + let tz1 = !!(Destination_repr.of_b58check null_address) in + let kt1 = !!(Destination_repr.of_b58check liquidity_baking_dex) in + let txr1 = !!(Destination_repr.of_b58check tx_rollup_address) in + let scr1 = !!(Destination_repr.of_b58check sc_rollup_address) in + let epx1 = !!(Destination_repr.of_b58check zk_rollup_address) in + + assert (Destination_repr.(tz1 < kt1)) ; + assert (Destination_repr.(kt1 < txr1)) ; + assert (Destination_repr.(tz1 < txr1)) ; + assert (Destination_repr.(txr1 < scr1)) ; + assert (Destination_repr.(scr1 < epx1)) ; + + return_unit + +let tests = + [ + tztest "Json decoding compat implicit contract (null address)" `Quick + @@ test_decoding_json_compat null_address; + tztest "Json decoding compat smart contract (liquidity baking dex)" `Quick + @@ test_decoding_json_compat liquidity_baking_dex; + tztest "Binary Contract_repr to Destination_repr (null address)" `Quick + @@ test_encode_contract_decode_destination null_address; + tztest + "Binary Contract_repr to Destination_repr (liquidity baking dex)" + `Quick + @@ test_encode_contract_decode_destination liquidity_baking_dex; + tztest "Binary Destination_repr to Contract_repr (null address)" `Quick + @@ test_encode_destination_decode_contract null_address; + tztest + "Binary Contract_repr to Destination_repr (liquidity baking dex)" + `Quick + @@ test_encode_destination_decode_contract liquidity_baking_dex; + tztest + "Json encoding compatibility Contract_repr to Destination_repr with \ + dummy contracts" + `Quick + @@ test_encoding_json_compat; + tztest + "Binary encoding compatibility Contract_repr to Destination_repr with \ + dummy contracts" + `Quick + @@ test_encoding_json_compat; + tztest "Comparison of destinations" `Quick test_compare_destination; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml new file mode 100644 index 000000000000..3afa3421d656 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml @@ -0,0 +1,158 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (committee selection) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] fitness$" + Subject: test the fitness module +*) + +open Protocol + +let level_zero = Raw_level_repr.of_int32_exn 0l + +let round_of_int32_exn i = + match Round_repr.of_int32 i with + | Ok i -> i + | Error _ -> Stdlib.failwith "Invalid round representation" + +let make_tuple (level, r_opt, r0, r1) = + let r_opt = Option.map round_of_int32_exn r_opt in + let r0 = round_of_int32_exn r0 in + let r1 = round_of_int32_exn r1 in + (level, r_opt, r0, r1) + +let test_cases = + List.map + make_tuple + [ + (3l, Some 1l, 1l, 12l); + (10l, Some 1l, 1l, 12l); + (10l, Some 4l, 2l, 6l); + (10l, Some 4l, 1l, 12l); + (9l, Some 2l, 0l, 3l); + (7l, None, 0l, 3l); + (7l, None, 1l, 3l); + (0l, None, 0l, 0l); + (12l, Some 2l, 8l, 7l); + (10l, Some 0l, 1l, 1l); + (8l, None, 1l, 0l); + (12l, Some 1l, 8l, 7l); + (8l, None, 6l, 0l); + ] + +let rec product l1 l2 = + match l1 with + | [] -> [] + | h :: tl -> List.map (fun x -> (h, x)) l2 @ product tl l2 + +let test_product_cases = product test_cases test_cases + +let tuple_to_fitness (level, locked_round, predecessor_round, round) = + Fitness_repr.create + ~level:(Raw_level_repr.of_int32_exn level) + ~locked_round + ~predecessor_round + ~round + +let tuple_to_fitness_exn tuple = + tuple_to_fitness tuple |> function + | Ok f -> f + | Error err -> + Format.kasprintf + Stdlib.failwith + "cannot create fitness from tuple: %a" + pp_print_trace + (Environment.wrap_tztrace err) + +let test_from_to_raw_fitness tuple = + let fitness = tuple_to_fitness_exn tuple in + Fitness_repr.from_raw (Fitness_repr.to_raw fitness) |> function + | Ok new_fitness -> assert (fitness = new_fitness) + | Error _x -> assert false + +let test_from_to_raw_fitness_all () = + List.iter test_from_to_raw_fitness test_cases ; + return_unit + +let test_locked_round () = + let test_bad_cases = + List.map + make_tuple + [ + (8l, Some 7l, 1l, 1l); + (9l, Some 8l, 0l, 3l); + (10l, Some 7l, 2l, 6l); + (11l, Some 5l, 5l, 1l); + (8l, Some 2l, 1l, 1l); + (9l, Some 3l, 0l, 3l); + (11l, Some 5l, 5l, 1l); + (13l, Some 2l, 1l, 1l); + (10l, Some 4l, 1l, 1l); + (8l, Some 7l, 1l, 1l); + (10l, Some 8l, 2l, 6l); + (11l, Some 9l, 5l, 1l); + (12l, Some 10l, 8l, 7l); + (13l, Some 14l, 1l, 1l); + ] + in + List.iter_es + (fun tuple -> + Environment.wrap_tzresult @@ tuple_to_fitness tuple |> function + | Error + [ + Environment.Ecoproto_error + (Fitness_repr.Locked_round_not_less_than_round _); + ] -> + return_unit + | Error err -> failwith "unexpected failure: %a" pp_print_trace err + | Ok f -> failwith "unexpected success: %a" Fitness_repr.pp f) + test_bad_cases + +let test_compare (tuple1, tuple2) = + let fitness1 = tuple_to_fitness_exn tuple1 in + let fitness2 = tuple_to_fitness_exn tuple2 in + let raw_fitness1 = Fitness_repr.to_raw fitness1 in + let raw_fitness2 = Fitness_repr.to_raw fitness2 in + let cmp_fitness = Fitness_repr.Internal_for_tests.compare fitness1 fitness2 in + let cmp_raw_fitness = Fitness.compare raw_fitness1 raw_fitness2 in + Assert.equal_int ~loc:__LOC__ cmp_fitness cmp_raw_fitness + +let test_compare_all () = List.iter_es test_compare test_product_cases + +let tests = + [ + Tztest.tztest + "from/to raw fitness is identity" + `Quick + test_from_to_raw_fitness_all; + Tztest.tztest "locked round is smaller than round" `Quick test_locked_round; + Tztest.tztest + "compare fitness = compare raw_fitness" + `Quick + test_compare_all; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml new file mode 100644 index 000000000000..bd6c11d88fcb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml @@ -0,0 +1,175 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (fixed-point decimals) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] fixed point computation$" + Subject: On fixed-point decimal numbers. +*) + +open Protocol + +exception Fixed_point_test_error of string + +let err x = Exn (Fixed_point_test_error x) + +module type Arith = sig + type t + + val zero : t + + val equal : t -> t -> bool + + val random : unit -> t + + val add : t -> t -> t + + val sub : t -> t -> t +end + +let n = Z.of_int 42 + +let n' = Z.of_int 43 + +let basic_arith name (module A : Arith) = + let err msg = err (Format.asprintf "%s test: %s" name msg) in + let x = A.random () in + fail_unless A.(add zero x = x) (err "zero is neutral for +") >>=? fun () -> + let x = A.random () in + let y = A.random () in + fail_unless A.(add x y = add y x) (err "addition is commutative") + >>=? fun () -> + let x = A.random () in + fail_unless + A.(sub (add zero x) x = zero) + (err "addition and subtraction cancel") + >>=? fun () -> + let x = A.random () in + let y = A.random () in + let z = A.random () in + fail_unless + A.(add x (add y z) = add (add x y) z) + (err "addition is associative") + +let arith_from_integral : (module Fixed_point_repr.Full) -> (module Arith) = + fun (module FP) -> + let module Arith = struct + type t = FP.integral + + let zero = FP.zero + + let equal = FP.equal + + let random () = FP.integral_of_int_exn (Random.int 898987) + + let add = FP.add + + let sub = FP.sub + end in + (module Arith) + +let arith_from_fp : (module Fixed_point_repr.Full) -> (module Arith) = + fun (module FP) -> + let module Arith = struct + type t = FP.fp + + let zero = FP.zero + + let equal = FP.equal + + let random () = FP.unsafe_fp (Z.of_int (Random.int 898987)) + + let add = FP.add + + let sub = FP.sub + end in + (module Arith) + +let integral_tests () = + let module FP = Gas_limit_repr.Arith in + (* test roundtrips *) + fail_unless (FP.(integral_to_z (integral_exn n)) = n) (err "roundtrip > 0") + >>=? fun () -> + fail_unless + (FP.(integral_to_z (integral_exn Z.zero)) = Z.zero) + (err "roundtrip = 0") + >>=? fun () -> + (* test ceil/floor on integral *) + fail_unless + FP.(ceil (fp (integral_exn n)) = integral_exn n) + (err "integral;fp;ceil = integral") + >>=? fun () -> + fail_unless + FP.(floor (fp (integral_exn n)) = integral_exn n) + (err "integral;fp;floor = integral") + >>=? fun () -> + fail_unless + (Format.asprintf "%a" FP.pp FP.(fp (integral_exn n)) + = Format.asprintf "%a" FP.pp_integral (FP.integral_exn n)) + (err "pp_integral(integral) = pp(fp(integral))") + >>=? fun () -> basic_arith "integral arith" (arith_from_integral (module FP)) + +let fp_nonzero () = + let decimals = 3 in + let module FP = Gas_limit_repr.Arith in + let prefix msg = Format.asprintf "(%d decimals) %s" decimals msg in + let err msg = err (prefix msg) in + basic_arith (prefix "integral arith") (arith_from_integral (module FP)) + >>=? fun () -> + basic_arith (prefix "fp arith") (arith_from_fp (module FP)) >>=? fun () -> + let epsilon = FP.unsafe_fp Z.one in + fail_unless FP.(ceil epsilon = integral_exn Z.one) (err "ceil eps = 1") + >>=? fun () -> + fail_unless FP.(floor epsilon = integral_exn Z.zero) (err "floor eps = 1") + >>=? fun () -> + let x = Z.of_int (Random.int 980812) in + fail_unless + FP.( + ceil (add (fp (integral_exn x)) (unsafe_fp Z.one)) + = integral_exn (Z.succ x)) + (err "ceil (x + eps) = x + 1") + +let fp_pp () = + let module FP = Gas_limit_repr.Arith in + let prefix msg = Format.asprintf "(%d decimals) %s" 3 msg in + let err msg = err (prefix msg) in + let epsilon = FP.unsafe_fp Z.one in + let ( =:= ) x expected = Format.asprintf "%a" FP.pp x = expected in + fail_unless (epsilon =:= "0.001") (err "eps = 0.001") >>=? fun () -> + fail_unless (FP.unsafe_fp (Z.of_int 1000) =:= "1") (err "1.000 = 1") + >>=? fun () -> + fail_unless (FP.unsafe_fp (Z.of_int 1001) =:= "1.001") (err "1.001") + >>=? fun () -> + fail_unless (FP.unsafe_fp (Z.of_int 10001) =:= "10.001") (err "10.001") + >>=? fun () -> fail_unless (FP.zero =:= "0") (err "0") + +let tests = + [ + Tztest.tztest "Integral tests (3 decimals)" `Quick integral_tests; + Tztest.tztest "FP tests (3 decimals)" `Quick fp_nonzero; + Tztest.tztest "FP pp tests (3 decimals)" `Quick fp_pp; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml new file mode 100644 index 000000000000..1ef3b1b84067 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml @@ -0,0 +1,212 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Gas_monad + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] gas monad$" + Subject: Tests for the gas monad module +*) + +open Protocol +open Alpha_context +module GM = Gas_monad + +let ten_milligas = Gas.fp_of_milligas_int 10 + +let new_context ~limit = + Context.init1 () >>=? fun (b, _contract) -> + Incremental.begin_construction b >|=? fun inc -> + Gas.set_limit (Incremental.alpha_ctxt inc) limit + +let assert_gas_exhaustion ~loc ctxt gas_monad = + match GM.run ctxt gas_monad with + | Error _ -> return () + | _ -> failwith "%s: expected gas-exhaustion error" loc + +let assert_equal_gas ~loc g1 g2 = + Assert.equal ~loc Gas.Arith.equal "Compare gas" Gas.Arith.pp g1 g2 + +let assert_inner_errors ~loc ctxt gas_monad ~errors ~remaining_gas = + match GM.run ctxt gas_monad with + | Ok (Error e, ctxt) -> + let open Lwt_result_syntax in + let* () = + Assert.assert_equal_list + ~loc + ( = ) + "Inner error" + Format.pp_print_string + e + errors + in + assert_equal_gas + ~loc + (Gas.remaining_operation_gas ctxt) + (Gas.fp_of_milligas_int remaining_gas) + | _ -> failwith "%s: expected inner error" loc + +let assert_success ~loc ctxt gas_monad ~result ~remaining_gas = + match GM.run ctxt gas_monad with + | Ok (Ok x, ctxt) -> + let open Lwt_result_syntax in + let* () = Assert.equal_int ~loc x result in + assert_equal_gas + ~loc + (Gas.remaining_operation_gas ctxt) + (Gas.fp_of_milligas_int remaining_gas) + | _ -> failwith "%s: expected successful result `%d' but got error" loc result + +let with_context f ~limit = new_context ~limit >>=? f + +(** Test that consuming more gas than remaining results in a gas-exhaustion + error. *) +let test_gas_exhaustion () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 10) in + let* y = GM.return 2 in + GM.return (x + y) + in + assert_gas_exhaustion ~loc:__LOC__ ctxt gas_monad + +(** Test that consuming more gas than remaining results in a gas-exhaustion + error before an inner error is produced. *) +let test_gas_exhaustion_before_error () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 10) in + let* () = GM.of_result (error "Oh no") in + let* y = GM.return 2 in + GM.return (x + y) + in + assert_gas_exhaustion ~loc:__LOC__ ctxt gas_monad + +(** Test that consuming all remaining gas is feasible. *) +let test_successful_with_remaining_gas () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* y = GM.return 2 in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + GM.return (x + y) + in + assert_success ~loc:__LOC__ ctxt gas_monad ~result:3 ~remaining_gas:0 + +(** Test that the context has the expected amount of spare gas after the + computation. *) +let test_successful_with_spare_gas () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* y = GM.return 2 in + let* () = GM.consume_gas (Saturation_repr.safe_int 3) in + GM.return (x + y) + in + assert_success ~loc:__LOC__ ctxt gas_monad ~result:3 ~remaining_gas:2 + +(** Test that an inner error is produced rather than a gas-exhaustion error. *) +let test_inner_error () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* () = GM.of_result (error "Oh no") in + let* y = GM.return 2 in + let* () = GM.consume_gas (Saturation_repr.safe_int 10) in + GM.return (x + y) + in + assert_inner_errors + ~loc:__LOC__ + ctxt + gas_monad + ~errors:["Oh no"] + ~remaining_gas:5 + +(* Test that no gas-exhaustion error is produced and that no gas is consumed + when run in unlimited mode. +*) +let test_unlimited () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* x = GM.return 1 in + let* () = GM.consume_gas (Saturation_repr.safe_int 5) in + let* y = GM.return 2 in + let* () = GM.consume_gas (Saturation_repr.safe_int 100) in + let* () = GM.consume_gas (Saturation_repr.safe_int 3) in + GM.return (x + y) + in + assert_success + ~loc:__LOC__ + (Gas.set_unlimited ctxt) + gas_monad + ~result:3 + ~remaining_gas:10 + +let test_syntax_module () = + with_context ~limit:ten_milligas @@ fun ctxt -> + let gas_monad = + let open Gas_monad.Syntax in + let* none = return_none in + let* nil = return_nil in + let* t = return_true in + let* f = return_false in + let*? one = Ok 1 in + let+ two = return 2 in + (none, nil, t, f, one, two) + in + match GM.run ctxt gas_monad with + | Ok (Ok (None, [], true, false, 1, 2), _ctxt) -> return () + | _ -> failwith "Expected `Ok (None, [], true, false, 1, 2)`" + +let tests = + [ + Tztest.tztest "Test exhaustion" `Quick test_gas_exhaustion; + Tztest.tztest + "Test exhaustion before error" + `Quick + test_gas_exhaustion_before_error; + Tztest.tztest + "Test successful result" + `Quick + test_successful_with_remaining_gas; + Tztest.tztest "Test successful result" `Quick test_successful_with_spare_gas; + Tztest.tztest "Test inner error" `Quick test_inner_error; + Tztest.tztest "Test unlimited" `Quick test_unlimited; + Tztest.tztest "Test syntax module" `Quick test_syntax_module; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml new file mode 100644 index 000000000000..8f81545ea86d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml @@ -0,0 +1,413 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <team@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Global table of constants + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test Global_constants_storage + Dependencies: contract_hash.ml + Subject: Test the global table of constants +*) + +open Protocol +open Alpha_context +open Tztest +open Micheline +open QCheck2 +open Lib_test.Qcheck2_helpers +open Michelson_v1_primitives +open Michelson_v1_printer +open Test_global_constants + +(** [get] on a nonexistent global constant + returns an error. *) +let test_get_on_nonexistent_fails = + tztest_qcheck2 + ~name:"get on a nonexistent global constants fails" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_without_constant_gen ())) + (fun (context, expr) -> + expr_to_hash expr |> Environment.wrap_tzresult >>?= fun hash -> + Global_constants_storage.get context hash + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Nonexistent_global") + +(** If registering an expression yields a hash [h] and context [c], + then [get c h] should yield the original expression. *) +let test_get_always_returns_registered_expr = + tztest_qcheck2 + ~name:"get always returned the registered constant" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_without_constant_gen ())) + (fun (context, expr) -> + Global_constants_storage.register context expr + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _cost) -> + Global_constants_storage.get context hash >|= Environment.wrap_tzresult + >|=? fun (_context, actual_expr) -> + qcheck_eq ~pp:print_expr actual_expr expr) + +(* Attempts to register an expression that contains references + to expressions not already registered should fail. *) +let test_register_fails_with_unregistered_references = + tztest "register: fails with unregistered references" `Quick (fun () -> + let prim_with_constant = + Expr.from_string + {| Pair 1 + (constant "exprubuoE4JFvkSpxsZJXAvhTdozCNZpgfCnyg6WsiAYX79q4z3bXu")|} + in + create_context () >>=? fun context -> + Global_constants_storage.register context prim_with_constant + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Nonexistent_global") + +(** Same test as [test_register_fails_with_unregistered_references] + but with random values. *) +let test_register_fails_with_unregistered_references_pbt = + tztest_qcheck2 + ~name:"register: fails with unregistered references pbt" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_with_constant_gen ())) + (fun (context, (_, expr, _)) -> + assume_expr_not_too_large expr ; + Global_constants_storage.register context expr + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Nonexistent_global") + +let rec grow n node = + match n with n when n <= 0 -> node | n -> grow (n - 1) (Seq ((), [node])) + +(* Any expression with a depth that exceeds + [Global_constants_storage.max_allowed_global_constant_depth] + should be rejected. *) +let test_register_fails_if_too_deep = + tztest "register: fails if expression too deep" `Quick (fun () -> + let vdeep_expr = + grow + (Constants_repr.max_allowed_global_constant_depth + 1) + (Int ((), Z.of_int 1)) + |> Micheline.strip_locations + in + create_context () >>=? fun context -> + Global_constants_storage.register context vdeep_expr + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Expression_too_deep") + +(** [expand] on an expression containing a nonexistent global + constant returns an error. *) +let test_expand_nonexistent_fails = + tztest_qcheck2 + ~name: + "expand on an expression containing a nonexistent global constant fails" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_with_constant_gen ())) + @@ fun (context, (_, expr, _)) -> + assume_expr_not_too_large expr ; + Global_constants_storage.expand context expr + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Nonexistent_global" + +(** Expanding an expression without constants should yield the same expression. *) +let test_expand_no_constants = + tztest "expand: no constants case" `Quick (fun () -> + create_context () >>=? fun context -> + let expected = Expr.from_string "Pair 1 (Pair 2 3)" in + Global_constants_storage.expand context expected + >|= Environment.wrap_tzresult + >>=? fun (_, result_expr) -> + assert_expr_equal __LOC__ expected result_expr) + +(** Similar to [test_expand_no_constants], but random. *) +let test_register_and_expand_orthogonal = + tztest_qcheck2 + ~name:"register and expand are orthogonal" + (Gen.triple + (Generators.context_gen ()) + (Generators.canonical_without_constant_gen ()) + (Generators.canonical_without_constant_gen ())) + (fun (context, expr1, expr2) -> + assume_expr_not_too_large expr1 ; + assume_expr_not_too_large expr2 ; + let open Michelson_v1_printer in + Global_constants_storage.register context expr1 + >|= Environment.wrap_tzresult + >>=? fun (context, _hash, _cost) -> + Global_constants_storage.expand context expr2 + >|= Environment.wrap_tzresult + >|=? fun (_, expr2_result) -> qcheck_eq ~pp:print_expr expr2 expr2_result) + +(** Expanding should expand constants in the given + expression, then expand any new constants, etc. + recursively until no constants remain. *) +let test_expand_deep_constants = + tztest "expand: deep constants" `Quick (fun () -> + (* Should hold for any n, but this test is very slow, + hence we don't do QCheck2. *) + let n = 1000 in + let expr1 = Expr.from_string "{}" in + create_context () >>=? fun context -> + let rec n_constants_deep context node n = + Global_constants_storage.register context (strip_locations node) + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _) -> + if n <= 1 then return (context, node, hash) + else + let new_node = + Seq + ( -1, + [ + Prim + ( -1, + H_constant, + [String (-1, Script_expr_hash.to_b58check hash)], + [] ); + ] ) + in + n_constants_deep context new_node (n - 1) + in + n_constants_deep context (root expr1) n >>=? fun (context, _, hash) -> + let deep_expr = + Expr.from_string + @@ Format.sprintf + "{constant \"%s\"; CDR; NIL operation; PAIR}" + (Script_expr_hash.to_b58check hash) + in + Global_constants_storage.expand context deep_expr + >|= Environment.wrap_tzresult + >>=? fun (_, result) -> + let seq_n_deep n = + let rec advance n acc = + match n with 0 -> acc | _ -> advance (n - 1) (Seq (-1, [acc])) + in + advance (n - 1) (Seq (-1, [])) + in + let seq_str = Expr.to_string @@ strip_locations @@ seq_n_deep n in + let expected = + Expr.from_string + @@ Format.sprintf "{ %s; CDR; NIL operation; PAIR; }" + @@ seq_str + in + assert_expr_equal __LOC__ expected result) + +(** The [constant] prim is permitted only to have a + single string argument, representing a valid + Script_repr.expr hash, with no annotations *) +let test_expand_reject_ill_formed = + tztest "expand: ill formed constants are rejected" `Quick (fun () -> + (* first, create a context, register a constant and check + that its expansion works well. *) + create_context () >>=? fun context -> + let some_expr = Expr.from_string "0" in + Global_constants_storage.register context some_expr + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _) -> + let hash = Script_expr_hash.to_b58check hash in + (* check that expansion of the registered constant works *) + Global_constants_storage.expand + context + (Expr.from_string @@ Format.sprintf "constant \"%s\"" hash) + >|= Environment.wrap_tzresult + >>=? fun (context, result) -> + assert_expr_equal __LOC__ some_expr result >>=? fun () -> + let test expr = + let expected = Expr.from_string expr in + Global_constants_storage.expand context expected + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Badly_formed_constant_expression" + in + (* constant with an argument other than String fails *) + test "constant 9" >>=? fun () -> + (* same as above but nested *) + test "Pair 1 (constant (Pair 2 3))" >>=? fun () -> + (* constant with bad hash fails *) + test "constant \"foobar\"" >>=? fun () -> + (* constant with type annot *) + test @@ Format.sprintf "(constant :a \"%s\")" hash >>=? fun () -> + (* constant with var annot *) + test @@ Format.sprintf "(constant @a \"%s\")" hash >>=? fun () -> + (* constant with field annot *) + test @@ Format.sprintf "(constant %%a \"%s\")" hash) + +(** The [constant] prim is not permitted to have a + [constant] child argument. + + The idea is to have expansion like this: + + constant (constant <hash of hash>) -> constant hash -> value + + But we want to forbid this as a badly formed constant. + Asserting that every constant must be a *static* string + makes it easier to see which constants are used where, because + you can just traverse the AST (no expansion necessary). *) +let test_reject_use_of_inner_constant = + tztest + "expand: use of 'constant (constant ...)' is rejected" + `Quick + (fun () -> + (* First, create a context, register a constant and check + that its expansion works well. *) + create_context () >>=? fun context -> + let some_expr = Expr.from_string "0" in + Global_constants_storage.register context some_expr + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _) -> + let hash = Script_expr_hash.to_b58check hash in + (* Next, register the hash itself as a constant. *) + Global_constants_storage.register + context + (strip_locations (Micheline.String (-1, hash))) + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _) -> + let hash = Script_expr_hash.to_b58check hash in + Global_constants_storage.expand + context + (Expr.from_string + @@ Format.sprintf "{ constant (constant \"%s\") } " hash) + >|= Environment.wrap_tzresult + >>= assert_proto_error_id __LOC__ "Badly_formed_constant_expression") + +(** [test_expand] accepts an expression [stored] to be + registered in the store, an expression [expr] that includes a template slot for + the hash of [stored], and an [expected] expression, and generates a test that + asserts the value of [expr] after expansion matches [expected]. *) +let make_expand_test ~stored ~expr ~expected () = + create_context () >>=? fun context -> + let stored_expr = Expr.from_string stored in + Global_constants_storage.register context stored_expr + >|= Environment.wrap_tzresult + >>=? fun (context, hash, _) -> + let expected = Expr.from_string expected in + let expr_with_constant = + Format.sprintf expr (Script_expr_hash.to_b58check hash) |> Expr.from_string + in + Global_constants_storage.expand context expr_with_constant + >|= Environment.wrap_tzresult + >>=? fun (_, result_expr) -> assert_expr_equal __LOC__ expected result_expr + +let test_expand_data_example = + tztest + "expand: data" + `Quick + (make_expand_test + ~stored:"3" + ~expr:"Pair 1 (Pair 2 (constant \"%s\"))" + ~expected:"Pair 1 (Pair 2 3)") + +let test_expand_types_example = + tztest + "expand: types" + `Quick + (make_expand_test + ~stored:"big_map string string" + ~expr:"PUSH (constant \"%s\") {}" + ~expected:"PUSH (big_map string string) {}") + +let test_expand_instr_example = + tztest + "expand: instr" + `Quick + (make_expand_test + ~stored:"PUSH int 3" + ~expr:"{ DROP; constant \"%s\"; DROP }" + ~expected:"{ DROP; PUSH int 3 ; DROP }") + +(** For any expression [e], when replacing any subexpression + [e'] with a constant hash and registering [e'], calling + [expand] on the new expression yields the + original expression [e]*) +let test_expand_pbt = + let open Michelson_v1_printer in + tztest_qcheck2 + ~name:"expand: random" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_with_constant_gen ())) + (fun (context, (full_expr, expr_with_constant, sub_expr)) -> + assume_expr_not_too_large full_expr ; + assume_expr_not_too_large expr_with_constant ; + assume_expr_not_too_large sub_expr ; + Global_constants_storage.register context sub_expr + >|= Environment.wrap_tzresult + >>=? fun (context, _, _) -> + Global_constants_storage.expand context expr_with_constant + >|= Environment.wrap_tzresult + >|=? fun (_, result_expr) -> + qcheck_eq ~pp:print_expr full_expr result_expr) + +let test_expand_is_idempotent = + tztest_qcheck2 + ~name:"expand is idempotent" + (Gen.pair + (Generators.context_gen ()) + (Generators.canonical_with_constant_gen ())) + (fun (context, (full_expr, expr_with_constant, sub_expr)) -> + assume_expr_not_too_large full_expr ; + Global_constants_storage.register context sub_expr + >|= Environment.wrap_tzresult + >>=? fun (context, _, _) -> + Global_constants_storage.expand context expr_with_constant + >|= Environment.wrap_tzresult + >>=? fun (context, result1) -> + Global_constants_storage.expand context full_expr + >|= Environment.wrap_tzresult + >|=? fun (_, result2) -> qcheck_eq ~pp:print_expr result1 result2) + +(** [bottom_up_fold_cps] does not stack overflow even when + given large values. *) +let test_fold_does_not_stack_overflow = + tztest "bottom_up_fold_cps: does not stack overflow" `Quick (fun () -> + let node = grow 1_000_000 @@ Int ((), Z.zero) in + return @@ ignore + @@ Global_constants_storage.Internal_for_tests.bottom_up_fold_cps + () + node + (fun _ _ -> ()) + (fun _ node k -> k () node)) + +let tests = + [ + test_get_on_nonexistent_fails; + test_get_always_returns_registered_expr; + test_register_fails_with_unregistered_references; + test_register_fails_with_unregistered_references_pbt; + test_register_fails_if_too_deep; + test_expand_nonexistent_fails; + test_expand_no_constants; + test_register_and_expand_orthogonal; + test_expand_deep_constants; + test_expand_reject_ill_formed; + test_reject_use_of_inner_constant; + test_expand_data_example; + test_expand_types_example; + test_expand_instr_example; + test_expand_pbt; + test_expand_is_idempotent; + test_fold_does_not_stack_overflow; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml new file mode 100644 index 000000000000..26493e672686 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml @@ -0,0 +1,279 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (baking) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] level module$" + Subject: some functions in the Level module +*) + +open Protocol + +let test_create_cycle_eras () = + let empty_cycle_eras = + Level_repr.create_cycle_eras [] |> Environment.wrap_tzresult + in + Assert.proto_error_with_info + ~loc:__LOC__ + empty_cycle_eras + "Invalid cycle eras" + >>=? fun () -> + let increasing_first_levels = + [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 1l; + first_cycle = Cycle_repr.succ Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + { + first_level = Raw_level_repr.of_int32_exn 9l; + first_cycle = Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + ] + |> Level_repr.create_cycle_eras |> Environment.wrap_tzresult + in + Assert.proto_error_with_info + ~loc:__LOC__ + increasing_first_levels + "Invalid cycle eras" + >>=? fun () -> + let increasing_first_cycles = + [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 9l; + first_cycle = Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + { + first_level = Raw_level_repr.of_int32_exn 1l; + first_cycle = Cycle_repr.succ Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + ] + |> Level_repr.create_cycle_eras |> Environment.wrap_tzresult + in + Assert.proto_error_with_info + ~loc:__LOC__ + increasing_first_cycles + "Invalid cycle eras" + +let test_case_1 = + ( [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 1l; + first_cycle = Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + ], + [ + (1, (1, 0, 0, 0, false)); + (2, (2, 1, 0, 1, true)); + (3, (3, 2, 0, 2, false)); + (8, (8, 7, 0, 7, true)); + (9, (9, 8, 1, 0, false)); + (16, (16, 15, 1, 7, true)); + (17, (17, 16, 2, 0, false)); + (64, (64, 63, 7, 7, true)); + (65, (65, 64, 8, 0, false)); + ] ) + +let test_case_2 = + ( List.rev + [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 1l; + first_cycle = Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + { + first_level = Raw_level_repr.of_int32_exn 17l; + first_cycle = Cycle_repr.of_int32_exn 2l; + blocks_per_cycle = 16l; + blocks_per_commitment = 4l; + }; + ], + [ + (1, (1, 0, 0, 0, false)); + (2, (2, 1, 0, 1, true)); + (3, (3, 2, 0, 2, false)); + (8, (8, 7, 0, 7, true)); + (9, (9, 8, 1, 0, false)); + (16, (16, 15, 1, 7, true)); + (17, (17, 16, 2, 0, false)); + (32, (32, 31, 2, 15, true)); + (33, (33, 32, 3, 0, false)); + (64, (64, 63, 4, 15, true)); + (65, (65, 64, 5, 0, false)); + ] ) + +let test_case_3 = + ( List.rev + [ + Level_repr. + { + first_level = Raw_level_repr.of_int32_exn 1l; + first_cycle = Cycle_repr.root; + blocks_per_cycle = 8l; + blocks_per_commitment = 2l; + }; + { + first_level = Raw_level_repr.of_int32_exn 17l; + first_cycle = Cycle_repr.of_int32_exn 2l; + blocks_per_cycle = 16l; + blocks_per_commitment = 4l; + }; + { + first_level = Raw_level_repr.of_int32_exn 49l; + first_cycle = Cycle_repr.of_int32_exn 4l; + blocks_per_cycle = 6l; + blocks_per_commitment = 3l; + }; + ], + [ + (1, (1, 0, 0, 0, false)); + (2, (2, 1, 0, 1, true)); + (3, (3, 2, 0, 2, false)); + (8, (8, 7, 0, 7, true)); + (9, (9, 8, 1, 0, false)); + (16, (16, 15, 1, 7, true)); + (17, (17, 16, 2, 0, false)); + (32, (32, 31, 2, 15, true)); + (33, (33, 32, 3, 0, false)); + (48, (48, 47, 3, 15, true)); + (49, (49, 48, 4, 0, false)); + (64, (64, 63, 6, 3, false)); + (65, (65, 64, 6, 4, false)); + (66, (66, 65, 6, 5, true)); + (67, (67, 66, 7, 0, false)); + ] ) + +let test_level_from_raw () = + List.iter_es + (fun (cycle_eras, test_cases) -> + List.iter_es + (fun ( input_level, + ( level, + level_position, + cycle, + cycle_position, + expected_commitment ) ) -> + let raw_level = + Raw_level_repr.of_int32_exn (Int32.of_int input_level) + in + Level_repr.create_cycle_eras cycle_eras |> Environment.wrap_tzresult + >>?= fun cycle_eras -> + let level_from_raw = + Protocol.Level_repr.level_from_raw ~cycle_eras raw_level + in + Assert.equal_int + ~loc:__LOC__ + (Int32.to_int (Raw_level_repr.to_int32 level_from_raw.level)) + level + >>=? fun () -> + Assert.equal_int + ~loc:__LOC__ + (Int32.to_int level_from_raw.level_position) + level_position + >>=? fun () -> + Assert.equal_int + ~loc:__LOC__ + (Int32.to_int (Cycle_repr.to_int32 level_from_raw.cycle)) + cycle + >>=? fun () -> + Assert.equal_int + ~loc:__LOC__ + (Int32.to_int level_from_raw.cycle_position) + cycle_position + >>=? fun () -> + Assert.equal_bool + ~loc:__LOC__ + level_from_raw.expected_commitment + expected_commitment + >>=? fun () -> + let offset = + Int32.neg (Int32.add Int32.one (Int32.of_int input_level)) + in + let res = + Level_repr.level_from_raw_with_offset ~cycle_eras ~offset raw_level + in + Assert.proto_error + ~loc:__LOC__ + (Environment.wrap_tzresult res) + (fun err -> + let error_info = + Error_monad.find_info_of_error (Environment.wrap_tzerror err) + in + error_info.title = "Negative sum of level and offset")) + test_cases) + [test_case_1; test_case_2; test_case_3] + +let test_first_level_in_cycle () = + let cycle_eras = fst test_case_3 in + let test_cases = + (* cycle, level *) + [ + (0l, 1); + (1l, 9); + (2l, 17); + (3l, 33); + (4l, 49); + (5l, 55); + (6l, 61); + (7l, 67); + ] + in + let f (input_cycle, level) = + Level_repr.create_cycle_eras cycle_eras |> Environment.wrap_tzresult + >>?= fun cycle_eras -> + let input_cycle = Cycle_repr.of_int32_exn input_cycle in + let level_res = + Level_repr.first_level_in_cycle_from_eras ~cycle_eras input_cycle + in + Assert.equal_int + ~loc:__LOC__ + (Int32.to_int (Raw_level_repr.to_int32 level_res.level)) + level + in + List.iter_es f test_cases + +let tests = + [ + Tztest.tztest "create_cycle_eras" `Quick test_create_cycle_eras; + Tztest.tztest "level_from_raw" `Quick test_level_from_raw; + Tztest.tztest "first_level_in_cycle" `Quick test_first_level_in_cycle; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml new file mode 100644 index 000000000000..ac40fa0600e8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml @@ -0,0 +1,260 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Liquidity_baking_repr module + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] liquidity baking$" + Subject: Tests for the Liquidity_baking_repr module +*) + +open Protocol + +let ema_of_int32 ema = + Liquidity_baking_repr.Toggle_EMA.of_int32 ema >|= Environment.wrap_tzresult + +let ema_to_int32 = Liquidity_baking_repr.Toggle_EMA.to_int32 + +let compute_new_ema ~toggle_vote ema = + Liquidity_baking_repr.compute_new_ema ~toggle_vote ema |> ema_to_int32 + +(* Folds compute_new_ema on a list of votes *) +let compute_new_ema_n toggle_votes initial_ema = + List.fold_left + (fun ema toggle_vote -> + Liquidity_baking_repr.compute_new_ema ~toggle_vote ema) + initial_ema + toggle_votes + |> ema_to_int32 + +let ema_range = + [ + 0l; + 1l; + 10l; + 100l; + 1000l; + 10_000l; + 100_000l; + 1_000_000l; + 10_000_000l; + 100_000_000l; + 200_000_000l; + 300_000_000l; + 400_000_000l; + 500_000_000l; + 600_000_000l; + 760_000_000l; + 800_000_000l; + 900_000_000l; + 1_000_000_000l; + 1_100_000_000l; + 1_200_000_000l; + 1_300_000_000l; + 1_400_000_000l; + 1_500_000_000l; + 1_600_000_000l; + 1_700_000_000l; + 1_800_000_000l; + 1_900_000_000l; + 1_990_000_000l; + 1_999_000_000l; + 1_999_900_000l; + 1_999_990_000l; + 1_999_999_000l; + 1_999_999_900l; + 1_999_999_990l; + 1_999_999_999l; + 2_000_000_000l; + ] + +(* Test that new_ema = old_ema when voting Pass. *) +let test_ema_pass () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + Assert.equal_int32 + ~loc:__LOC__ + (compute_new_ema ~toggle_vote:LB_pass ema) + old_ema) + ema_range + +(* Test that new_ema is still between 0 and 2,000,000,000 after an Off vote. *) +let test_ema_in_bound_off () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + let new_ema = compute_new_ema ~toggle_vote:LB_off ema in + Assert.leq_int32 ~loc:__LOC__ 0l new_ema >>=? fun () -> + Assert.leq_int32 ~loc:__LOC__ new_ema 2_000_000_000l) + ema_range + +(* Test that new_ema > old_ema when voting Off, except if old_ema is + already very close to the upper bound. *) +let test_ema_increases_off () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + Assert.lt_int32 + ~loc:__LOC__ + old_ema + (compute_new_ema ~toggle_vote:LB_off ema)) + (List.filter (fun ema -> Compare.Int32.(ema < 1_999_999_000l)) ema_range) + +(* Test that the increase in EMA caused by an Off vote is bounded by 1,000,000 *) +let test_ema_increases_off_bound () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + Assert.leq_int32 + ~loc:__LOC__ + (Int32.sub (compute_new_ema ~toggle_vote:LB_off ema) old_ema) + 1_000_000l) + ema_range + +(* Test that new_ema is still between 0 and 2,000,000,000 after an Off vote. *) +let test_ema_in_bound_on () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + let new_ema = compute_new_ema ~toggle_vote:LB_on ema in + Assert.leq_int32 ~loc:__LOC__ 0l new_ema >>=? fun () -> + Assert.leq_int32 ~loc:__LOC__ new_ema 2_000_000_000l) + ema_range + +(* Test that new_ema < old_ema when voting On, except if old_ema is + already very close to the lower bound. *) +let test_ema_decreases_on () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + Assert.lt_int32 + ~loc:__LOC__ + (compute_new_ema ~toggle_vote:LB_on ema) + old_ema) + (List.filter (fun ema -> Compare.Int32.(ema > 1000l)) ema_range) + +(* Test that the decrease in EMA caused by an On vote is bounded by 1,000,000 *) +let test_ema_decreases_on_bound () = + List.iter_es + (fun old_ema -> + ema_of_int32 old_ema >>=? fun ema -> + Assert.leq_int32 + ~loc:__LOC__ + (Int32.sub (compute_new_ema ~toggle_vote:LB_on ema) old_ema) + 1_000_000l) + ema_range + +(* Test that 1385 Off votes are needed to reach the threshold from 0. *) +let test_ema_many_off () = + let open Liquidity_baking_repr in + ema_of_int32 0l >>=? fun initial_ema -> + Assert.leq_int32 + ~loc:__LOC__ + (compute_new_ema_n (Stdlib.List.init 1385 (fun _ -> LB_off)) initial_ema) + 1_000_000_000l + >>=? fun () -> + Assert.leq_int32 + ~loc:__LOC__ + 1_000_000_000l + (compute_new_ema_n (Stdlib.List.init 1386 (fun _ -> LB_off)) initial_ema) + +(* Test that 1385 On votes are needed to reach the threshold from the max value of the EMA (2,000,000,000). *) +let test_ema_many_on () = + let open Liquidity_baking_repr in + ema_of_int32 2_000_000_000l >>=? fun initial_ema -> + Assert.leq_int32 + ~loc:__LOC__ + 1_000_000_000l + (compute_new_ema_n (Stdlib.List.init 1385 (fun _ -> LB_on)) initial_ema) + >>=? fun () -> + Assert.leq_int32 + ~loc:__LOC__ + (compute_new_ema_n (Stdlib.List.init 1386 (fun _ -> LB_on)) initial_ema) + 1_000_000_000l + +(* Test that the EMA update function is symmetric: + from two dual values of the EMA (that is, two values x and y such that + x + y = 2,000,000,000), voting On on the first one decreases it by as + much than voting Off on the second one increases it. +*) +let test_ema_symmetry () = + List.iter_es + (fun ema -> + let opposite_ema = Int32.(sub 2_000_000_000l ema) in + ema_of_int32 ema >>=? fun ema -> + ema_of_int32 opposite_ema >>=? fun opposite_ema -> + let new_ema = compute_new_ema ~toggle_vote:LB_on ema in + let new_opposite_ema = compute_new_ema ~toggle_vote:LB_off opposite_ema in + Assert.equal_int32 + ~loc:__LOC__ + Int32.(add new_ema new_opposite_ema) + 2_000_000_000l) + ema_range + +let tests = + [ + Tztest.tztest + "Test EMA does not change when vote is Pass" + `Quick + test_ema_pass; + Tztest.tztest + "Test EMA remains in bounds when vote is Off" + `Quick + test_ema_in_bound_off; + Tztest.tztest + "Test EMA increases when vote is Off" + `Quick + test_ema_increases_off; + Tztest.tztest + "Test EMA does not increase too much when vote is Off" + `Quick + test_ema_increases_off_bound; + Tztest.tztest + "Test EMA remains in bounds when vote is On" + `Quick + test_ema_in_bound_on; + Tztest.tztest + "Test EMA decreases when vote is On" + `Quick + test_ema_decreases_on; + Tztest.tztest + "Test EMA does not decrease too much when vote is On" + `Quick + test_ema_decreases_on_bound; + Tztest.tztest + "Test EMA goes from 0 to one billion in 1386 Off votes" + `Quick + test_ema_many_off; + Tztest.tztest + "Test EMA goes from two billions to one billion in 1386 On votes" + `Quick + test_ema_many_on; + Tztest.tztest + "Test that voting On and Off have symmetric effects on the EMA" + `Quick + test_ema_symmetry; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml new file mode 100644 index 000000000000..40eabf7d344b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml @@ -0,0 +1,134 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 proof ninja, Inc <contact@proof-ninja.co.jp *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Local context storages by functors + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test local_contexts + Dependencies: helpers/block.ml + Subject: Tests for local contexts + +*) +open Protocol + +open Storage_functors +module A = Alpha_context + +let create () = + let account = Account.new_account () in + let bootstrap_account = Account.make_bootstrap_account account in + Block.alpha_context [bootstrap_account] >>=? fun alpha_ctxt -> + return @@ A.Internal_for_tests.to_raw alpha_ctxt + +(* /a/b/c *) +let dir1 = ["a"; "b"; "c"] + +module Sub = + Make_subcontext (Registered) (Raw_context) + (struct + let name = dir1 + end) + +module Index : INDEX with type t = string = struct + type t = string + + let path_length = 1 + + let to_path x l = x :: l + + let of_path = function [x] -> Some x | _ -> None + + type 'a ipath = 'a * t + + let args = + Storage_description.One + { + rpc_arg = Environment.RPC_arg.string; + encoding = Data_encoding.string; + compare; + } +end + +module Indexed_context = Make_indexed_subcontext (Sub) (Index) + +module Value : Storage_sigs.VALUE with type t = bytes = struct + type t = bytes + + let encoding = Data_encoding.bytes +end + +module C = + Indexed_context.Make_map + (Registered) + (struct + let name = ["name"] + end) + (Value) + +let eq_context ctxt1 ctxt2 = + let hash ctxt = + Raw_context.get_tree ctxt [] >|= Environment.wrap_tzresult >|=? fun root -> + Raw_context.Tree.hash root + in + hash ctxt1 >>=? fun x -> + hash ctxt2 >>=? fun y -> + Assert.equal + ~loc:__LOC__ + Tezos_crypto.Context_hash.equal + "check context" + Tezos_crypto.Context_hash.pp + x + y + +let write_with_local ctxt local_dir f = + Indexed_context.with_local_context ctxt local_dir (fun local -> + f local >|=? fun local -> (local, ())) + >|=? fun (ctxt, ()) -> ctxt + +let test_local_remove_existing () = + create () >>=? fun ctxt -> + let subdir = "foo" in + let value = Bytes.of_string "ABCDE" in + (* init *) + write_with_local ctxt subdir (fun local -> C.Local.init local value) + >|= Environment.wrap_tzresult + >>=? fun ctxt1 -> + C.init ctxt subdir value >|= Environment.wrap_tzresult >>=? fun ctxt2 -> + eq_context ctxt1 ctxt2 >>=? fun () -> + let ctxt = ctxt2 in + (* remove_existing *) + write_with_local ctxt subdir C.Local.remove_existing + >|= Environment.wrap_tzresult + >>=? fun ctxt1 -> + C.remove_existing ctxt subdir >|= Environment.wrap_tzresult >>=? fun ctxt2 -> + eq_context ctxt1 ctxt2 + +let tests = + [ + Tztest.tztest + "Local.remove_existing: check whether local access has the same behavior" + `Quick + test_local_remove_existing; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml new file mode 100644 index 000000000000..e7aa2cabd398 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml @@ -0,0 +1,258 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Merkle list) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "\[Unit\] merkle list" + Subject: test the ad-hoc merkle tree structure implemented to encode lists +*) + +open Merkle_list_helper + +let assert_invalid_pos : 'a Environment.Error_monad.tzresult -> _ = function + | Error err -> + let expected_error_msg msg = "Error:\n " ^ msg ^ "\n" in + let actual_error_msg : string = + Format.asprintf "%a" Environment.Error_monad.pp_trace err + in + Printf.printf "%s\n" actual_error_msg ; + assert ( + expected_error_msg "Merkle_list_invalid_position" = actual_error_msg) + | _ -> assert false + +(* Check that the result of [compute] is the expected hash *) +let test_compute () = + let open Error_monad.Result_syntax in + let elements = + Stdlib.List.init 5 (fun i -> Bytes.of_string (Int.to_string i)) + in + let element_hashes = List.map (fun e -> Hash.hash_bytes [e]) elements in + let el_hashes_a = Array.of_list element_hashes in + let h01 = hash2 el_hashes_a.(0) el_hashes_a.(1) in + let h23 = hash2 el_hashes_a.(2) el_hashes_a.(3) in + let h4e = hash2 el_hashes_a.(4) empty in + let h03 = hash2 h01 h23 in + let h4ee = hash2 h4e empty in + let expected_root = hash2 h03 h4ee in + assert (Hash.equal (compute elements) expected_root) ; + return_unit + +(* Compare the root of a tree constructed by snoc'ing to the value + given by compute and the values of the leaves *) +let test_snoc () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + + let t = List.fold_left snoc_tr nil elements in + let element_hashes = List.map (fun e -> Hash.hash_bytes [e]) elements in + + assert (Hash.equal (compute elements) (root t)) ; + assert (element_hashes = Internal_for_tests.to_list t) ; + return_unit + +(* Compare the result of the two versions of snoc *) +let test_snoc_non_tr () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let t1 = List.fold_left snoc_tr nil elements in + let t2 = List.fold_left snoc nil elements in + assert (Internal_for_tests.equal t1 t2) ; + return_unit + +(* Check that the path computed is the expected one *) +let test_compute_path () = + let open Error_monad.Result_syntax in + let elements = + Stdlib.List.init 5 (fun i -> Bytes.of_string (Int.to_string i)) + in + let t = List.fold_left snoc_tr nil elements in + + let element_hashes = List.map (fun e -> Hash.hash_bytes [e]) elements in + let el_hashes_a = Array.of_list element_hashes in + let h23 = hash2 el_hashes_a.(2) el_hashes_a.(3) in + let h4e = hash2 el_hashes_a.(4) empty in + let h4ee = hash2 h4e empty in + let expected_path_for_1 = [el_hashes_a.(0); h23; h4ee] in + let* path = compute_path t 1 in + assert (Internal_for_tests.path_to_list path = expected_path_for_1) ; + return_unit + +(* Negative test: pos < 0 *) +let test_compute_path_negative_pos () = + let open Error_monad.Result_syntax in + let n = 10 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let t = List.fold_left snoc_tr nil elements in + assert_invalid_pos @@ compute_path t (-1) ; + return_unit + +(* Negative test: pos >= size tree *) +let test_compute_path_out_of_bounds () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let t = List.fold_left snoc_tr nil elements in + assert_invalid_pos @@ compute_path t n ; + return_unit + +(* Negative test: pos = size tree, when tree is full *) +let test_compute_path_out_of_bounds_full () = + let open Error_monad.Result_syntax in + let n = 4 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let t = List.fold_left snoc_tr nil elements in + assert_invalid_pos @@ compute_path t n ; + return_unit + +(* Check that a computed root (from [check_path]) is the actual root *) +let test_check_path () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let elements_array = Array.of_list elements in + let t = List.fold_left snoc_tr nil elements in + Stdlib.List.init n (fun pos -> + let* path = compute_path t pos in + let* b = check_path path pos elements_array.(pos) (ML.root t) in + assert b ; + return_unit) + |> Environment.Error_monad.Result_syntax.tzjoin + +(* Check that a path is only valid for the position for which it + was computed *) +let test_check_path_wrong_pos () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let elements_array = Array.of_list elements in + let t = List.fold_left snoc_tr ML.nil elements in + let* path = compute_path t (n - 1) in + Stdlib.List.init (n - 2) (fun pos -> + let* b = check_path path pos elements_array.(pos) (ML.root t) in + assert (not b) ; + return_unit) + |> Environment.Error_monad.Result_syntax.tzjoin + +(* Check that a computed path is invalidated by a tree update *) +let test_check_invalidated_path () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let new_el = Bytes.of_string (Int.to_string n) in + let t = List.fold_left snoc_tr ML.nil elements in + let* path = compute_path t 0 in + let t = snoc_tr t new_el in + let* b = check_path path 0 (Stdlib.List.hd elements) (ML.root t) in + assert (not b) ; + return_unit + +(* Negative test: pos < 0 in [check_path] *) +let test_check_path_negative_pos () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let elements_array = Array.of_list elements in + let t = List.fold_left snoc_tr nil elements in + let pos = Random.int n in + let* path = compute_path t pos in + assert_invalid_pos @@ check_path path (-1) elements_array.(pos) (ML.root t) ; + return_unit + +(* Negative test: pos >= 2^depth in [check_path] *) +let test_check_path_out_of_bounds () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let elements_array = Array.of_list elements in + let t = List.fold_left snoc_tr nil elements in + let pos = Random.int n in + let* path = compute_path t pos in + (* NB: for this to be actually invalid, it is not enough to pass + a position larger than [n]. We need pos >= 2^depth. *) + assert_invalid_pos @@ check_path path 32 elements_array.(pos) (ML.root t) ; + return_unit + +(* Encoding roundtrip *) +let test_path_encoding () = + let open Error_monad.Result_syntax in + let n = 20 in + let elements = + Stdlib.List.init n (fun i -> Bytes.of_string (Int.to_string i)) + in + let t = List.fold_left snoc_tr nil elements in + let pos = n / 2 in + let* path = compute_path t pos in + let b = Data_encoding.Binary.to_bytes_exn path_encoding path in + let path' = Data_encoding.Binary.of_bytes_exn path_encoding b in + assert (path' = path) ; + return_unit + +let valid_tests = + [ + ("test_compute", test_compute); + ("test_snoc", test_snoc); + ("test_snoc_non_tr", test_snoc_non_tr); + ("test_compute_path", test_compute_path); + ("test_check_path", test_check_path); + ("test_path_encoding", test_path_encoding); + ("test_compute_path_negative_pos", test_compute_path_negative_pos); + ("test_compute_path_out_of_bounds", test_compute_path_out_of_bounds); + ("test_check_path_negative_pos", test_check_path_negative_pos); + ("test_check_path_out_of_bounds", test_check_path_out_of_bounds); + ( "test_compute_path_out_of_bounds_full", + test_compute_path_out_of_bounds_full ); + ("test_check_path_wrong_pos", test_check_path_wrong_pos); + ("test_check_invalidated_path", test_check_invalidated_path); + ] + +let wrap (n, f) = + Alcotest_lwt.test_case n `Quick (fun _ () -> + Lwt.return (f ()) >|= function Ok () -> () | Error _ -> assert false) + +let tests = List.map wrap valid_tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml new file mode 100644 index 000000000000..419f430090de --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml @@ -0,0 +1,188 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Operation_repr + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Operation_repr + Dependencies: -- + Subject: To test the modules (including the top-level) + in operation_repr.ml as individual units, particularly + failure cases. Superficial goal: increase coverage percentage. +*) +open Protocol + +open Tztest + +module Test_operation_repr = struct + open Operation_repr + + let test_of_list_single_case () = + let op = + Manager_operation + { + fee = Obj.magic 0; + operation = Obj.magic 0; + gas_limit = Obj.magic 0; + storage_limit = Obj.magic 0; + counter = Obj.magic 0; + source = Obj.magic 0; + } + in + Environment.wrap_tzresult @@ of_list [Contents op] >>?= fun contents_list -> + match contents_list with + | Contents_list (Single op') when op == Obj.magic op' -> return_unit + | _ -> failwith "Unexpected value" + + let test_of_list_multiple_case () = + let op1 = + Manager_operation + { + fee = Obj.magic 0; + operation = Obj.magic 0; + gas_limit = Obj.magic 0; + storage_limit = Obj.magic 0; + counter = Obj.magic 0; + source = Obj.magic 0; + } + in + let op2 = + Manager_operation + { + fee = Obj.magic 1; + operation = Obj.magic 0; + gas_limit = Obj.magic 0; + storage_limit = Obj.magic 0; + counter = Obj.magic 0; + source = Obj.magic 0; + } + in + Environment.wrap_tzresult @@ of_list [Contents op1; Contents op2] + >>?= fun contents_list -> + match contents_list with + | Contents_list (Cons (op1', Single op2')) + when op1 == Obj.magic op1' && op2 == Obj.magic op2' -> + return_unit + | _ -> failwith "Unexpected value" + + let test_of_list_empty_case () = + match of_list [] with + | Ok _ -> failwith "of_list of an empty list was expected to fail" + | Error _ -> return_unit + + let zero_bls = + match + Tezos_crypto.Signature.(split_signature (Bls Tezos_crypto.Bls.zero)) + with + | {prefix = None; _} -> assert false + | {prefix = Some prefix; suffix} -> + let prefix = + Data_encoding.Binary.to_bytes_exn + Tezos_crypto.Signature.prefix_encoding + prefix + in + (Bytes.cat (Bytes.of_string "\255") prefix, suffix) + + let test_split_signatures error assemble = + let op_bytes = + Data_encoding.Binary.to_bytes_exn + Operation_repr.contents_encoding + (Contents (Failing_noop "")) + in + let prefix, suffix = zero_bls in + let protocol_data_bytes = + Bytes.(concat empty) (assemble op_bytes prefix suffix) + in + match + Data_encoding.Binary.of_bytes + Operation_repr.protocol_data_encoding + protocol_data_bytes + with + | Ok _ -> failwith "Should have failed with %s" error + | Error (User_invariant_guard e) when e = error -> return_unit + | Error e -> + failwith + "Unexpected error: %a instead of %s" + Data_encoding.Binary.pp_read_error + e + error + + let test_only_signature_prefix () = + test_split_signatures "Operation lists should not be empty." + @@ fun _op_bytes prefix suffix -> [prefix; suffix] + + let test_decoding_empty_list () = + test_split_signatures "Operation lists should not be empty." + @@ fun _op_bytes _prefix suffix -> [suffix] + + let test_multiple_signature_prefix () = + test_split_signatures "Signature prefix must appear last" + @@ fun op_bytes prefix suffix -> [op_bytes; prefix; prefix; suffix] + + let test_signature_prefix_not_final () = + test_split_signatures "Signature prefix must appear last" + @@ fun op_bytes prefix suffix -> [prefix; op_bytes; suffix] + + let test_multiple_non_manager () = + test_split_signatures + "Operation list of length > 1 should only contain manager operations." + @@ fun op_bytes prefix suffix -> [op_bytes; op_bytes; prefix; suffix] +end + +let tests = + [ + tztest + "of_list: single element input list" + `Quick + Test_operation_repr.test_of_list_single_case; + tztest + "of_list: multiple element input list" + `Quick + Test_operation_repr.test_of_list_multiple_case; + tztest + "of_list: empty input list" + `Quick + Test_operation_repr.test_of_list_empty_case; + tztest + "protocol_data_encoding: only signature prefix" + `Quick + Test_operation_repr.test_only_signature_prefix; + tztest + "protocol_data_encoding: empty list" + `Quick + Test_operation_repr.test_decoding_empty_list; + tztest + "protocol_data_encoding: multiple signature prefix" + `Quick + Test_operation_repr.test_multiple_signature_prefix; + tztest + "protocol_data_encoding: signature prefix not final" + `Quick + Test_operation_repr.test_signature_prefix_not_final; + tztest + "protocol_data_encoding: multiple non manager" + `Quick + Test_operation_repr.test_multiple_non_manager; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml new file mode 100644 index 000000000000..847686adcef6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml @@ -0,0 +1,160 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (quantities) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] qty$" + Subject: On tez quantities. +*) + +open Protocol + +let known_ok_tez_literals = + [ + (0L, "0"); + (10L, "0.00001"); + (100L, "0.0001"); + (1_000L, "0.001"); + (10_000L, "0.01"); + (100_000L, "0.1"); + (1_000_000L, "1"); + (10_000_000L, "10"); + (100_000_000L, "100"); + (1_000_000_000L, "1000"); + (10_000_000_000L, "10000"); + (100_000_000_000L, "100000"); + (1_000_000_000_000L, "1000000"); + (1_000_000_000_001L, "1000000.000001"); + (1_000_000_000_010L, "1000000.00001"); + (1_000_000_000_100L, "1000000.0001"); + (1_000_000_001_000L, "1000000.001"); + (1_000_000_010_000L, "1000000.01"); + (1_000_000_100_000L, "1000000.1"); + (123_123_123_123_123_123L, "123123123123.123123"); + (999_999_999_999_999_999L, "999999999999.999999"); + ] + +let known_bad_tez_literals = + [ + "10000."; + "100,."; + "100,"; + "1,0000"; + "0.0000,1"; + "0.00,1"; + "0,1"; + "HAHA"; + "0.000,000,1"; + "0.0000000"; + "9,999,999,999,999.999,999"; + ] + +let fail expected given msg = + Format.kasprintf + Stdlib.failwith + "@[%s@ expected: %s@ got: %s@]" + msg + expected + given + +let fail_msg fmt = Format.kasprintf (fail "" "") fmt + +let default_printer _ = "" + +(** Literals which are supposed to be parsed correctly. *) +let test_known_tez_literals () = + List.iter + (fun (v, s) -> + let vv = Tez_repr.of_mutez v in + let vs = Tez_repr.of_string s in + let vs' = + Tez_repr.of_string (String.concat "" (String.split_on_char ',' s)) + in + let vv = + match vv with None -> fail_msg "could not unopt %Ld" v | Some vv -> vv + in + let vs = + match vs with None -> fail_msg "could not unopt %s" s | Some vs -> vs + in + let vs' = + match vs' with + | None -> fail_msg "could not unopt %s" s + | Some vs' -> vs' + in + assert (vv = vs) ; + assert (vv = vs') ; + assert (Tez_repr.to_string vv = s)) + known_ok_tez_literals ; + List.iter + (fun s -> + let vs = Tez_repr.of_string s in + assert (vs = None)) + known_bad_tez_literals ; + return_unit + +(** Randomly generated tez value which is printed into a string then + parsed again for their equality. *) +let test_random_tez_literals () = + for _ = 0 to 100_000 do + let v = Random.int64 12L in + let vv = Tez_repr.of_mutez v in + let vv = + match vv with None -> fail_msg "could not unopt %Ld" v | Some vv -> vv + in + let s = Tez_repr.to_string vv in + let vs = Tez_repr.of_string s in + let s' = String.concat "" (String.split_on_char ',' s) in + let vs' = Tez_repr.of_string s' in + assert (vs <> None) ; + assert (vs' <> None) ; + (match vs with + | None -> assert false + | Some vs -> + let rev = Tez_repr.to_mutez vs in + assert (v = rev)) ; + match vs' with + | None -> assert false + | Some vs' -> + let rev = Tez_repr.to_mutez vs' in + assert (v = rev) + done ; + return_unit + +let tests = + [ + ("tez-literals", fun _ -> test_known_tez_literals ()); + ("rnd-tez-literals", fun _ -> test_random_tez_literals ()); + ] + +let wrap (n, f) = + Alcotest_lwt.test_case n `Quick (fun _ () -> + f () >|= function + | Ok () -> () + | Error error -> + Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) + +let tests = List.map wrap tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml new file mode 100644 index 000000000000..4f12f21eba1d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml @@ -0,0 +1,176 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Tztest + +(** Testing + ------- + Component: Raw_level_repr + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test '^\[Unit\] Raw_level_repr.ml$' + Dependencies: -- + Subject: To test the modules (including the top-level) + in raw_level_repr.ml as individual units, particularly + failure cases. Superficial goal: increase coverage percentage. +*) + +module Test_raw_level_repr = struct + (* NOTE: Avoid assertions against too many functions from Raw_level_repr. For instance, + Raw_level_repr contains a [compare] function, but while [Assert]'ing, convert them to + int32 (or any convenient OCaml value) and compare instead of using [Raw_level_repr]'s compare *) + + (** Testing [encoding], int32 underneath, by applying it with Data_encoding *) + let test_encoding () = + let encoding = Raw_level_repr.encoding in + let bytes = Bytes.make 4 '0' in + Bytes.set_int32_ne bytes 0 0l ; + (Data_encoding.Binary.of_bytes encoding bytes |> function + | Ok x -> Lwt.return (Ok x) + | Error e -> + failwith + "Data_encoding.Binary.read shouldn't have failed with \ + Raw_level_repr.encoding: %a" + Data_encoding.Binary.pp_read_error + e) + >>=? fun v -> + Assert.equal_int ~loc:__LOC__ (Int32.to_int (Raw_level_repr.to_int32 v)) 0 + >>=? fun () -> + Bytes.set_int32_ne bytes 0 (-1l) ; + Data_encoding.Binary.of_bytes encoding bytes |> function + | Error _ -> return_unit + | Ok x -> + failwith + "Data_encoding.Binary.read shouldn't have succeeded with %a" + Raw_level_repr.pp + x + + (* TODO rpc_arg. RPC_arg needs to be unit tested separately. Preferably, with a functor *) + (* let rpc_arg () = () *) + + (** int32 interop tests *) + let test_int32_interop () = + let int32v = 100l in + Lwt.return (Raw_level_repr.of_int32 int32v) >|= Environment.wrap_tzresult + >>=? fun raw_level -> + Assert.equal_int32 ~loc:__LOC__ (Raw_level_repr.to_int32 raw_level) int32v + >>=? fun () -> + let int32v = -1l in + (Lwt.return (Raw_level_repr.of_int32 int32v) >|= Environment.wrap_tzresult + >>= function + | Ok _ -> failwith "Negative int32s should not be coerced into raw_level" + | Error _ -> return_unit) + >>=? fun () -> + try + let (_ : Raw_level_repr.t) = Raw_level_repr.of_int32_exn int32v in + failwith "Negative int32s should not be coerced into raw_level" + with Invalid_argument _ -> return_unit + + (** Asserting [root]'s runtime value. Expected to be [0l] *) + let test_root () = + let root = Raw_level_repr.root in + Assert.equal_int32 ~loc:__LOC__ (root |> Raw_level_repr.to_int32) 0l + + (** Asserting [succ] which is expected to return successor levels *) + let test_succ () = + let next_raw_level = Raw_level_repr.succ Raw_level_repr.root in + Assert.equal_int32 + ~loc:__LOC__ + (next_raw_level |> Raw_level_repr.to_int32) + 1l + >>=? fun () -> + let arbitrary_next_raw_level = + Raw_level_repr.succ (Raw_level_repr.of_int32_exn 99l) + in + Assert.equal_int32 + ~loc:__LOC__ + (arbitrary_next_raw_level |> Raw_level_repr.to_int32) + 100l + + (** Asserting [pred] which is expected to return predecessor levels *) + let test_pred () = + (match Raw_level_repr.pred (Raw_level_repr.of_int32_exn 1l) with + | Some previous_raw_level -> + Assert.equal_int32 + ~loc:__LOC__ + (previous_raw_level |> Raw_level_repr.to_int32) + 0l + | None -> + failwith + "Raw_level_repr.pred should have successfully returned 0l as the \ + predecessor of 1l") + >>=? fun () -> + Raw_level_repr.pred Raw_level_repr.root |> function + | Some _ -> + failwith + "Raw_level_repr.pred should have returned None when asked for \ + predecessor of [root]" + | None -> return_unit + + let test_skip_succ () = + let int32_limit = 0x7FFFFFFFl in + let overflown_next_raw_level = + Raw_level_repr.succ (Raw_level_repr.of_int32_exn int32_limit) + in + if Int32.compare (Raw_level_repr.to_int32 overflown_next_raw_level) 0l >= 0 + then return_unit + else + failwith + "succ of 0x7FFFFFFFl %a was expected to be non-negative" + Assert.Int32.pp + (overflown_next_raw_level |> Raw_level_repr.to_int32) +end + +let tests = + [ + tztest + "Raw_level_repr.encoding: checks if encoding is int32 as expected" + `Quick + Test_raw_level_repr.test_encoding; + tztest + "Raw_level_repr.root: check if value is 0l" + `Quick + Test_raw_level_repr.test_root; + tztest + "Raw_level_repr.succ: basic assertions" + `Quick + Test_raw_level_repr.test_succ; + tztest + "Raw_level_repr.pred: basic assertions" + `Quick + Test_raw_level_repr.test_pred; + tztest + "Raw_level_repr: int32 interop" + `Quick + Test_raw_level_repr.test_int32_interop; + ] + +let skipped_tests = + [ + tztest + "Raw_level_repr.succ: overflow" + `Quick + Test_raw_level_repr.test_skip_succ; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml new file mode 100644 index 000000000000..245ae17b0a54 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml @@ -0,0 +1,103 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (token) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] receipt" + Subject: Test receipt endocings. +*) + +open Protocol +open Alpha_context +open Data_encoding + +let random_amount () = + match Tez.of_mutez (Int64.add 1L (Random.int64 100L)) with + | None -> assert false + | Some x -> x + +(** Test that [decode (encode balance_updates) = balance_updates]. *) +let test_encodings balance = + Random.init 0 ; + let am = random_amount () in + let r1 = Receipt.(balance, Debited am, Protocol_migration) in + let r2 = Receipt.(balance, Credited am, Protocol_migration) in + let r3 = Receipt.(balance, Debited am, Subsidy) in + let r4 = Receipt.(balance, Credited am, Subsidy) in + let r5 = Receipt.(balance, Debited am, Simulation) in + let r6 = Receipt.(balance, Credited am, Simulation) in + let r7 = Receipt.(balance, Debited am, Block_application) in + let r8 = Receipt.(balance, Credited am, Block_application) in + let coded = + Json.construct + Receipt.balance_updates_encoding + [r1; r2; r3; r4; r5; r6; r7; r8] + in + let decoded = Json.destruct Receipt.balance_updates_encoding coded in + match decoded with + | [r1'; r2'; r3'; r4'; r5'; r6'; r7'; r8'] -> + assert ( + r1' = r1 && r2' = r2 && r3' = r3 && r4' = r4 && r5 = r5' && r6 = r6' + && r7 = r7' && r8 = r8') ; + return_unit + | _ -> assert false + +let test_encodings () = + let open Receipt in + let pkh = Tezos_crypto.Signature.Public_key_hash.zero in + test_encodings (Contract (Contract.Implicit pkh)) >>=? fun () -> + test_encodings Block_fees >>=? fun () -> + test_encodings (Deposits pkh) >>=? fun () -> + test_encodings Nonce_revelation_rewards >>=? fun () -> + test_encodings Double_signing_evidence_rewards >>=? fun () -> + test_encodings Endorsing_rewards >>=? fun () -> + test_encodings Baking_rewards >>=? fun () -> + test_encodings Baking_bonuses >>=? fun () -> + test_encodings Storage_fees >>=? fun () -> + test_encodings Double_signing_punishments >>=? fun () -> + test_encodings (Lost_endorsing_rewards (pkh, Random.bool (), Random.bool ())) + >>=? fun () -> + test_encodings Liquidity_baking_subsidies >>=? fun () -> + test_encodings Burned >>=? fun () -> + test_encodings (Commitments Blinded_public_key_hash.zero) >>=? fun () -> + test_encodings Bootstrap >>=? fun () -> + test_encodings Invoice >>=? fun () -> + test_encodings Initial_commitments >>=? fun () -> + test_encodings Minted >>=? fun () -> + let nonce = + Origination_nonce.Internal_for_tests.initial + Tezos_crypto.Operation_hash.zero + in + let tx_rollup = Tx_rollup.Internal_for_tests.originated_tx_rollup nonce in + let bond_id = Bond_id.Tx_rollup_bond_id tx_rollup in + test_encodings (Frozen_bonds (Contract.Implicit pkh, bond_id)) >>=? fun () -> + test_encodings Tx_rollup_rejection_punishments >>=? fun () -> + test_encodings Tx_rollup_rejection_rewards >>=? fun () -> + test_encodings Sc_rollup_refutation_punishments >>=? fun () -> + test_encodings Sc_rollup_refutation_rewards + +let tests = Tztest.[tztest "receipt - encoding" `Quick test_encodings] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml new file mode 100644 index 000000000000..91ce5492e271 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml @@ -0,0 +1,635 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: protocol + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] round$" + Subject: test the Round_repr module +*) + +open Protocol +open Alpha_context + +let ( >>>=? ) v f = v >|= Environment.wrap_tzresult >>=? f + +let ( >>>?= ) v f = v |> Environment.wrap_tzresult >>?= f + +let ( >>>? ) v f = v |> Environment.wrap_tzresult >>? f + +type round_test = { + (* input: round; output: round duration *) + round_duration : (int * int) list; + (* input: level offset; output: round, round offset *) + round_and_offset : (int * (int * int)) list; + (* input: pred_ts, pred_round, round; output: ts *) + timestamp_of_round : ((int * int * int) * int) list; + (* input: pred_ts, pred_round, ts; output: round *) + round_of_timestamp : ((int * int * int) * int) list; +} + +(* an association list of the input, output values *) +let case_3_4 = + { + round_duration = [(0, 3); (1, 4); (2, 5); (3, 6)]; + round_and_offset = + [ + (0, (0, 0)); + (1, (0, 1)); + (2, (0, 2)); + (3, (1, 0)); + (4, (1, 1)); + (5, (1, 2)); + (6, (1, 3)); + (7, (2, 0)); + (8, (2, 1)); + ]; + timestamp_of_round = [((100, 0, 6), 136); ((100, 1, 6), 137)]; + round_of_timestamp = + [ + ((100, 0, 121), 4); + ((100, 0, 122), 4); + ((100, 0, 123), 4); + ((100, 0, 124), 4); + ((100, 0, 125), 4); + ((100, 0, 126), 4); + ((100, 1, 121), 3); + ((100, 1, 122), 4); + ((100, 1, 123), 4); + ((100, 1, 124), 4); + ((100, 1, 125), 4); + ((100, 1, 126), 4); + ]; + } + +let case_3_6 = + { + round_duration = + [ + (0, 3); + (1, 6); + (2, 9); + (3, 12); + (4, 15); + (5, 18); + (6, 21); + (7, 24); + (8, 27); + ]; + round_and_offset = + [ + (0, (0, 0)); + (1, (0, 1)); + (2, (0, 2)); + (3, (1, 0)); + (4, (1, 1)); + (5, (1, 2)); + (6, (1, 3)); + (7, (1, 4)); + (8, (1, 5)); + (9, (2, 0)); + (10, (2, 1)); + (11, (2, 2)); + (97, (7, 13)); + ]; + timestamp_of_round = + [ + ((100, 0, 0), 103); + ((100, 1, 0), 106); + ((100, 0, 6), 166); + ((100, 1, 6), 169); + ]; + round_of_timestamp = + [ + ((100, 0, 103), 0); + ((100, 0, 104), 0); + ((100, 0, 105), 0); + ((100, 0, 106), 1); + ((100, 0, 111), 1); + ((100, 0, 112), 2); + ((100, 0, 120), 2); + ((100, 0, 121), 3); + ((100, 0, 132), 3); + ((100, 0, 133), 4); + ((100, 1, 106), 0); + ((100, 1, 107), 0); + ((100, 1, 108), 0); + ((100, 1, 109), 1); + ((100, 1, 114), 1); + ((100, 1, 115), 2); + ]; + } + +let test_cases = + [ + (* (first_round_duration, delay_increment_per_round), test_case_expectations *) + ((3, 1), case_3_4, "case_3_4"); + ((3, 3), case_3_6, "case_3_6"); + ] + +let round_of_int i = Round_repr.of_int i |> Environment.wrap_tzresult + +let mk_round_durations first_round_duration delay_increment_per_round = + let first_round_duration = + Period_repr.of_seconds_exn @@ Int64.of_int first_round_duration + in + let delay_increment_per_round = + Period_repr.of_seconds_exn @@ Int64.of_int delay_increment_per_round + in + (* We assume test specifications do respect round_durations + invariants and cannot fail *) + Stdlib.Option.get + @@ Round_repr.Durations.create_opt + ~first_round_duration + ~delay_increment_per_round + +let process_test_case (round_durations, ios, _) = + let open Round_repr in + List.iter_es + (fun (i, o) -> + round_of_int i >>?= fun round -> + let dur = Durations.round_duration round_durations round in + Assert.equal_int64 + ~loc:__LOC__ + (Int64.of_int o) + (Period_repr.to_seconds dur)) + ios.round_duration + >>=? fun () -> + let open Internals_for_test in + (* test [round_and_offset] *) + List.iter_es + (fun (level_offset, (round, ro)) -> + let level_offset = + Period_repr.of_seconds_exn (Int64.of_int level_offset) + in + Environment.wrap_tzresult (round_and_offset round_durations ~level_offset) + >>?= fun round_and_offset -> + Assert.equal_int32 + ~loc:__LOC__ + (Int32.of_int round) + (Round_repr.to_int32 round_and_offset.round) + >>=? fun () -> + Assert.equal_int64 + ~loc:__LOC__ + (Int64.of_int ro) + (Period_repr.to_seconds round_and_offset.offset)) + ios.round_and_offset + >>=? fun () -> + (* test [timestamp_of_round] *) + List.iter_es + (fun ((pred_ts, pred_round, round), o) -> + let predecessor_timestamp = Time_repr.of_seconds (Int64.of_int pred_ts) in + Lwt.return + ( Round_repr.of_int pred_round >>? fun predecessor_round -> + Round_repr.of_int round >>? fun round -> + timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round ) + >>>=? fun ts -> + Assert.equal_int64 ~loc:__LOC__ (Int64.of_int o) (Time_repr.to_seconds ts)) + ios.timestamp_of_round + >>=? fun () -> + (* test [round_of_timestamp] *) + List.iter_es + (fun ((pred_ts, pred_round, ts), o) -> + let predecessor_timestamp = Time_repr.of_seconds (Int64.of_int pred_ts) in + Lwt.return + ( Round_repr.of_int pred_round >>? fun predecessor_round -> + round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp:(Time_repr.of_seconds (Int64.of_int ts)) ) + >>>=? fun round -> + Assert.equal_int32 + ~loc:__LOC__ + (Int32.of_int o) + (Round_repr.to_int32 round)) + ios.round_of_timestamp + +let test_round () = + let final_test_cases = + List.map + (fun ((first_round_duration, delay_increment_per_round), ios, name) -> + ( mk_round_durations first_round_duration delay_increment_per_round, + ios, + name )) + test_cases + in + (* TODO this could be run in the error monad instead of lwt *) + List.iter_es process_test_case final_test_cases + +let ts_add ts period = + match Timestamp.(ts +? period) with + | Ok ts' -> ts' + | Error _ -> Environment.Pervasives.failwith "timestamp add" + +let test_round_of_timestamp () = + let duration0 = Period.of_seconds_exn 1L in + Environment.wrap_tzresult + @@ Round.Durations.create + ~first_round_duration:duration0 + ~delay_increment_per_round:Period.one_second + >>?= fun round_durations -> + let predecessor_timestamp = Time.Protocol.epoch in + let level_start = ts_add predecessor_timestamp duration0 in + let rec loop ~expected_round ~elapsed_time = + if elapsed_time < 1000 then + let timestamp = + ts_add level_start (Period.of_seconds_exn (Int64.of_int elapsed_time)) + in + match + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~timestamp + ~predecessor_round:Round.zero + with + | Ok round -> + Assert.equal_int32 + ~loc:__LOC__ + (Round.to_int32 round) + (Int32.of_int expected_round) + >>=? fun () -> + let elapsed_time = elapsed_time + (expected_round + 1) + and expected_round = 1 + expected_round in + loop ~expected_round ~elapsed_time + | Error _ -> failwith "error " + else return_unit + in + loop ~elapsed_time:0 ~expected_round:0 + +let round_of_timestamp_perf (duration0_int64, dipr) = + let duration0 = Period.of_seconds_exn duration0_int64 in + let delay_increment_per_round = Period.of_seconds_exn dipr in + let round_durations = + Stdlib.Option.get + @@ Round.Durations.create_opt + ~first_round_duration:duration0 + ~delay_increment_per_round + in + let predecessor_timestamp = Time.Protocol.epoch in + let level_start = ts_add predecessor_timestamp duration0 in + let max_ts = Int64.(sub (of_int32 Int32.max_int) duration0_int64) in + let rec loop i = + if i >= 0L then ( + let repeats = 100 in + let rec loop_inner sum j = + if j > 0 then + let timestamp = + ts_add level_start (Period.of_seconds_exn (Int64.sub max_ts i)) + in + let t0 = Unix.gettimeofday () in + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~timestamp + ~predecessor_round:Round.zero + >>? fun (_round : Round.t) -> + let t1 = Unix.gettimeofday () in + let time = t1 -. t0 in + loop_inner (sum +. time) (j - 1) + else ok sum + in + loop_inner 0.0 repeats >>? fun sum -> + let time = sum /. float_of_int repeats in + assert (time < 0.01) ; + loop (Int64.pred i)) + else ok () + in + Environment.wrap_tzresult (loop 1000L) >>?= fun () -> return_unit + +let default_round_durations_list = + [(1L, 1L); (1L, 2L); (1L, 3L); (2L, 3L); (2L, 4L)] + +let test_round_of_timestamp_perf () = + List.iter_es round_of_timestamp_perf default_round_durations_list + +let timestamp_of_round_perf (duration0_int64, dipr) = + let duration0 = Period.of_seconds_exn duration0_int64 in + let delay_increment_per_round = Period.of_seconds_exn dipr in + let round_durations = + Stdlib.Option.get + @@ Round.Durations.create_opt + ~first_round_duration:duration0 + ~delay_increment_per_round + in + let predecessor_timestamp = Time.Protocol.epoch in + let rec loop i = + if i >= 0l then ( + Round.of_int32 Int32.(sub max_int i) >>? fun round -> + let t0 = Unix.gettimeofday () in + Round.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round:Round.zero + ~round + >>? fun (_ts : Timestamp.time) -> + let t1 = Unix.gettimeofday () in + let time = t1 -. t0 in + assert (time < 0.01) ; + loop (Int32.pred i)) + else ok () + in + Environment.wrap_tzresult (loop 1000l) >>?= fun () -> return_unit + +let test_timestamp_of_round_perf () = + List.iter_es timestamp_of_round_perf default_round_durations_list + +let test_error_is_triggered_for_too_high_timestamp () = + let round_durations = + Stdlib.Option.get + @@ Round.Durations.create_opt + ~first_round_duration:Period.one_second + ~delay_increment_per_round:Period.one_second + in + + let predecessor_timestamp = Time.Protocol.epoch in + let res = + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round:Round.zero + ~timestamp:(Time_repr.of_seconds Int64.max_int) + in + let res = Environment.wrap_tzresult res in + match res with + | Error _ -> + Assert.proto_error_with_info ~loc:__LOC__ res "level offset too high" + | Ok _ -> Assert.error ~loc:__LOC__ res (fun _ -> false) + +let rec ( --> ) i j = + (* [i; i+1; ...; j] *) + if Compare.Int.(i > j) then [] else i :: (succ i --> j) + +let ts_of_round_inverse (duration0_int64, dipr) round_int = + let first_round_duration = Period.of_seconds_exn duration0_int64 in + let delay_increment_per_round = Period.of_seconds_exn dipr in + let round_durations = + Stdlib.Option.get + @@ Round.Durations.create_opt + ~first_round_duration + ~delay_increment_per_round + in + let predecessor_timestamp = Time.Protocol.epoch in + let predecessor_round = Round.zero in + Round.of_int round_int >>>?= fun round -> + Round.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round + >>>?= fun timestamp -> + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp + >>>?= fun round' -> + Round.to_int round' >>>?= fun round' -> + Assert.equal_int ~loc:__LOC__ round_int round' + +(* We restrict to round 134,217,727 as rounds above can lead to + integer overflow in [Round_repr.round_and_offset] and are already prevented + by returning an error. *) +let test_ts_of_round_inverse () = + List.iter_es + (fun durations -> + List.iter_es + (ts_of_round_inverse durations) + ((0 --> 20) @ (60000 --> 60010))) + default_round_durations_list + >>=? fun () -> + List.iter_es + (ts_of_round_inverse (1L, 1L)) + (List.map (fun i -> Int32.to_int 134_217_727l - i) (1 --> 20)) + +let round_of_ts_inverse ~first_round_duration ~delay_increment_per_round ts = + Format.printf "ts = %Ld@." ts ; + let first_round_duration = Period.of_seconds_exn first_round_duration in + let delay_increment_per_round = + Period.of_seconds_exn delay_increment_per_round + in + Round.Durations.create ~first_round_duration ~delay_increment_per_round + >>>?= fun round_durations -> + let predecessor_timestamp = Time.Protocol.epoch in + let predecessor_round = Round.zero in + Timestamp.( +? ) predecessor_timestamp first_round_duration + >>>?= fun level_start -> + let start_of_round timestamp = + Round.round_of_timestamp + round_durations + ~predecessor_timestamp + ~predecessor_round + ~timestamp + >>>? fun round -> + Round.timestamp_of_round + round_durations + ~predecessor_timestamp + ~predecessor_round + ~round + >>>? fun t -> ok (round, t) + in + Period.of_seconds_exn ts |> Timestamp.( +? ) level_start + >>>?= fun timestamp -> + start_of_round timestamp >>?= fun (round, ts_start_of_round) -> + Assert.leq_int64 + ~loc:__LOC__ + (Timestamp.to_seconds ts_start_of_round) + (Timestamp.to_seconds timestamp) + >>=? fun () -> + let pred ts = Period.one_second |> Timestamp.( - ) ts in + let rec iter ts = + start_of_round ts >>?= fun (round', ts_start_of_round') -> + Assert.equal_int64 + ~loc:__LOC__ + (Timestamp.to_seconds ts_start_of_round) + (Timestamp.to_seconds ts_start_of_round') + >>=? fun () -> + Assert.equal_int32 + ~loc:__LOC__ + (Round.to_int32 round) + (Round.to_int32 round') + >>=? fun () -> + if Timestamp.(ts > ts_start_of_round') then iter (pred ts) else return_unit + in + if Timestamp.(timestamp > ts_start_of_round) then iter (pred timestamp) + else return_unit + +let test_round_of_ts_inverse () = + List.iter_es + (fun (first_round_duration, delay_increment_per_round) -> + List.iter_es + (fun ts -> + round_of_ts_inverse + ~first_round_duration + ~delay_increment_per_round + (Int64.of_int ts)) + ((0 --> 20) @ (60000 --> 60010))) + default_round_durations_list + >>=? fun () -> + List.iter_es + (fun ts -> + Format.printf "%Ld@." ts ; + round_of_ts_inverse + ~first_round_duration:1L + ~delay_increment_per_round:2L + ts) + (List.map + (fun i -> Int64.of_int (Int32.to_int Int32.max_int - i)) + (0 --> 20)) + +let test_level_offset_of_round () = + let rd1 = + let first_round_duration = 3 in + let delay_increment_per_round = 1 in + mk_round_durations first_round_duration delay_increment_per_round + in + List.iter_es + (fun (round_durations, tests) -> + List.iter_es + (fun (round, expected_offset) -> + Lwt.return @@ Environment.wrap_tzresult @@ Round_repr.of_int round + >>=? fun round -> + Lwt.return @@ Environment.wrap_tzresult + @@ Round_repr.level_offset_of_round round_durations ~round + >>=? fun computed_offset -> + Assert.equal_int64 + ~loc:__LOC__ + (Period_repr.to_seconds computed_offset) + (Int64.of_int expected_offset)) + tests) + [ + (rd1, [(0, 0); (1, 3); (2, 7)]); + (mk_round_durations 3 3, [(0, 0); (1, 3); (2, 9); (3, 18)]); + ] + +(* This is the previous implementation, serving as an oracle *) +let round_and_offset_oracle (round_durations : Round_repr.Durations.t) + ~level_offset = + let level_offset_in_seconds = Period_repr.to_seconds level_offset in + (* We have the invariant [round <= level_offset] so there is no need to search + beyond [level_offset]. We set [right_bound] to [level_offset + 1] to avoid + triggering the error level_offset too high when the round equals + [level_offset]. *) + let right_bound = + if Compare.Int64.(level_offset_in_seconds < Int64.of_int32 Int32.max_int) + then Int32.of_int (Int64.to_int level_offset_in_seconds + 1) + else Int32.max_int + in + let rec bin_search min_r max_r = + if Compare.Int32.(min_r >= right_bound) then invalid_arg "foo" + else + (Round_repr.of_int32 @@ Int32.(add min_r (div (sub max_r min_r) 2l))) + >>? fun round -> + let next_round = Round_repr.succ round in + Round_repr.level_offset_of_round round_durations ~round:next_round + >>? fun next_level_offset -> + if Period_repr.(level_offset >= next_level_offset) then + bin_search (Round_repr.to_int32 next_round) max_r + else + Round_repr.level_offset_of_round round_durations ~round + >>? fun current_level_offset -> + if Period_repr.(level_offset < current_level_offset) then + bin_search min_r (Round_repr.to_int32 round) + else + ok + Round_repr.Internals_for_test. + { + round; + offset = + Period_repr.of_seconds_exn + (Int64.sub + (Period_repr.to_seconds level_offset) + (Period_repr.to_seconds current_level_offset)); + } + in + Environment.wrap_tzresult @@ bin_search 0l right_bound + +(* Test whether the new version is equivalent to the old one *) +let test_round_and_offset_correction = + Tztest.tztest_qcheck2 + ~name:"round_and_offset is correct" + QCheck2.( + Gen.pair + Lib_test.Qcheck2_helpers.(Gen.pair uint16 uint16) + (Lib_test.Qcheck2_helpers.int64_range_gen 0L 100000L)) + (fun ((first_round_duration, delay_increment_per_round), level_offset) -> + QCheck2.assume (first_round_duration > 0) ; + QCheck2.assume (delay_increment_per_round > 0) ; + let first_round_duration = + Period_repr.of_seconds_exn (Int64.of_int first_round_duration) + and delay_increment_per_round = + Period_repr.of_seconds_exn (Int64.of_int delay_increment_per_round) + and level_offset = Period_repr.of_seconds_exn level_offset in + let round_duration = + Stdlib.Option.get + (Round_repr.Durations.create_opt + ~first_round_duration + ~delay_increment_per_round) + in + let expected = round_and_offset_oracle round_duration ~level_offset in + let computed = + Round_repr.Internals_for_test.round_and_offset + round_duration + ~level_offset + in + match (computed, expected) with + | Error _, Error _ -> return_unit + | Ok {round; offset}, Ok {round = round'; offset = offset'} -> + Assert.equal_int32 + ~loc:__LOC__ + (Round_repr.to_int32 round) + (Round_repr.to_int32 round') + >>=? fun () -> + Assert.equal_int64 + ~loc:__LOC__ + (Period_repr.to_seconds offset) + (Period_repr.to_seconds offset') + | Ok _, Error _ -> failwith "expected error is ok" + | Error _, Ok _ -> failwith "expected ok is error") + +let tests = + Tztest. + [ + tztest "test_level_offset_of_round" `Quick test_level_offset_of_round; + tztest "test Round_duration" `Quick test_round; + tztest "round_of_timestamp" `Quick test_round_of_timestamp; + tztest "round_of_timestamp_perf" `Quick test_round_of_timestamp_perf; + tztest "timestamp_of_round_perf" `Quick test_timestamp_of_round_perf; + tztest + "test level offset too high error is triggered" + `Quick + test_error_is_triggered_for_too_high_timestamp; + tztest "round_of_ts (ts_of_round r) = r" `Quick test_ts_of_round_inverse; + tztest + "ts_of_round (round_of_ts ts) <= ts" + `Quick + test_round_of_ts_inverse; + test_round_and_offset_correction; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml new file mode 100644 index 000000000000..0cf2633314ca --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml @@ -0,0 +1,236 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (saturated arithmetic) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] saturation arithmetic$" + Subject: The gas is represented using saturated arithmetic. + These unit tests check that saturated arithmetic operations + are correctly implemented. +*) + +open Protocol + +let valid (z : _ Saturation_repr.t) = + let x = z |> Saturation_repr.to_int in + x >= 0 && x < max_int + +exception Saturating_test_error of string + +let err x = Exn (Saturating_test_error x) + +let small_enough (z : _ Saturation_repr.t) = + Saturation_repr.(Compare.Int.((z |> to_int) land 0x7fffffff80000000 = 0)) + +let ok_int x = + match Saturation_repr.of_int_opt x with None -> assert false | Some x -> x + +let n = ok_int 123123 + +let m = ok_int 377337 + +let add () = + Saturation_repr.( + fail_unless + (add saturated (ok_int 1) = saturated) + (err "saturated + 1 <> saturated") + >>=? fun () -> + fail_unless (add zero n = n) (err "zero + n <> n") >>=? fun () -> + fail_unless (add n zero = n) (err "n + zero <> n") >>=? fun () -> + let r = add n m in + fail_unless + (valid r && r = ok_int ((n |> to_int) + (m |> to_int))) + (err "add does not behave like + on small numbers.")) + +let sub () = + Saturation_repr.( + fail_unless (sub zero n = zero) (err "zero - n <> zero") >>=? fun () -> + let n = max n m and m = min n m in + let r = sub n m in + fail_unless + (valid r && r = ok_int ((n |> to_int) - (m |> to_int))) + (err "sub does not behave like - on small numbers.")) + +let mul_safe_of_int x = + Saturation_repr.( + match mul_safe (ok_int x) with Some x -> x | None -> assert false) + +let n' = mul_safe_of_int 1000 + +let m' = mul_safe_of_int 10000 + +let mul_fast () = + Saturation_repr.( + fail_unless (mul_fast zero n' = zero) (err "mul_fast zero x <> zero") + >>=? fun () -> + fail_unless (mul_fast n' zero = zero) (err "mul_fast x zero <> zero") + >>=? fun () -> + let r = mul_fast n' m' in + fail_unless + (valid r && r = ok_int ((n' |> to_int) * (m' |> to_int))) + (err "mul_fast does not behave like * on small numbers.")) + +let scale_fast () = + Saturation_repr.( + fail_unless (scale_fast zero n = zero) (err "scale_fast zero x <> zero") + >>=? fun () -> + fail_unless (scale_fast n' zero = zero) (err "scale_fast x zero <> zero") + >>=? fun () -> + fail_unless + (scale_fast n' saturated = saturated) + (err "scale_fast x saturated <> saturated") + >>=? fun () -> + let r = scale_fast n' m in + fail_unless + (valid r && r = ok_int ((n' |> to_int) * (m |> to_int))) + (err "mul_fast does not behave like * on small numbers.")) + +let mul () = + Saturation_repr.( + fail_unless + (mul saturated saturated = saturated) + (err "saturated * saturated <> saturated") + >>=? fun () -> + fail_unless (mul zero saturated = zero) (err "zero * saturated <> zero") + >>=? fun () -> + fail_unless (mul saturated zero = zero) (err "saturated * zero <> zero") + >>=? fun () -> + let max_squared = ok_int (1 lsl 31) in + let r = mul max_squared max_squared in + fail_unless (r = saturated) (err "2 ^ 31 * 2 ^ 31 should be saturated") + >>=? fun () -> + let safe_squared = ok_int ((1 lsl 31) - 1) in + let r = mul safe_squared safe_squared in + fail_unless + (valid r && r <> saturated) + (err "(2 ^ 31 - 1) * (2 ^ 31 - 1) should not be saturated") + >>=? fun () -> + let r = mul n m in + fail_unless + (valid r && r = ok_int ((n |> to_int) * (m |> to_int))) + (err "mul does not behave like * on small numbers.")) + +let shift_left () = + Saturation_repr.( + let must_saturate flag (k, v) = + fail_unless + (Bool.equal flag (shift_left k v = saturated)) + (err + (Printf.sprintf + "shift_left %d %d %s saturated" + (k |> to_int) + v + (if flag then "<>" else "="))) + in + List.iter_es + (must_saturate true) + [(saturated, 1); (shift_right saturated 1, 2); (ok_int 1, 62)] + >>=? fun () -> + List.iter_es + (must_saturate false) + [ + (ok_int 1, 0); + (ok_int 1, 31); + (ok_int 1, 61); + (ok_int 0, 99); + (ok_int ((1 lsl 62) - 2), 0); + ]) + +let sqrt () = + Saturation_repr.( + fail_unless (sqrt saturated = saturated) (err "sqrt saturated <> saturated") + >>=? fun () -> + fail_unless (sqrt zero = zero) (err "sqrt zero <> zero") >>=? fun () -> + fail_unless (sqrt one = one) (err "sqrt one <> one") >>=? fun () -> + fail_unless (sqrt (ok_int 4) = ok_int 2) (err "sqrt 4 <> 2") >>=? fun () -> + fail_unless + (sqrt (ok_int 5) = ok_int 2) + (err "sqrt 5 <> 2 (sqrt should round down)") + >>=? fun () -> + let safe_squared = ok_int ((1 lsl 31) - 1) in + let r = mul safe_squared safe_squared in + fail_unless + (sqrt r = safe_squared) + (err "sqrt (2 ^ 31 - 1) * (2 ^ 31 - 1) <> (2 ^ 31 - 1)")) + +let of_z_opt () = + fail_unless + (Saturation_repr.(of_z_opt (Z.succ (Z.of_int max_int))) = None) + (err + "of_z_opt should saturate when given a z integer greater than max_int.") + >>=? fun () -> + fail_unless + (Saturation_repr.(of_z_opt (Z.pred Z.zero)) = None) + (err "of_z_opt should fail on a z negative integer.") + >>=? fun () -> + fail_unless + (Saturation_repr.(of_z_opt (Z.of_int min_int)) = None) + (err "of_z_opt should fail on a z negative integer.") + +let encoding encoder () = + let check_encode_decode x = + Data_encoding.Binary.( + match to_bytes encoder (ok_int x) with + | Error _ -> + fail (err (Printf.sprintf "Problem during binary encoding of %d" x)) + | Ok bytes -> ( + match of_bytes encoder bytes with + | Error _ -> + fail + (err (Printf.sprintf "Problem during binary decoding of %d" x)) + | Ok x' -> + fail_unless + (ok_int x = x') + (err + (Printf.sprintf + "decode (encode %d) = %d <> %d" + x + (x' :> int) + x)))) + in + Error_monad.Lwt_result_syntax.tzjoin + (List.map check_encode_decode [0; 7373737373; max_int - 1]) + +let tests = + [ + Tztest.tztest "Addition" `Quick add; + Tztest.tztest "Subtraction" `Quick sub; + Tztest.tztest "Multiplication" `Quick mul; + Tztest.tztest "Multiplication (fast version)" `Quick mul_fast; + Tztest.tztest "Shift left" `Quick shift_left; + Tztest.tztest "Scale fast" `Quick scale_fast; + Tztest.tztest "Square root" `Quick sqrt; + Tztest.tztest "Conversion from Z" `Quick of_z_opt; + Tztest.tztest + "Encoding through z" + `Quick + (encoding Saturation_repr.z_encoding); + Tztest.tztest + "Encoding through n" + `Quick + (encoding Saturation_repr.n_encoding); + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml new file mode 100644 index 000000000000..b4b99941bd2e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -0,0 +1,548 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (saturated arithmetic) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup arith$" + Subject: Basic testing of the arithmetic rollup example +*) + +open Protocol +module Context_binary = Tezos_context_memory.Context_binary + +(* We first instantiate an arithmetic PVM capable of generating proofs. *) +module Tree : + Environment.Context.TREE + with type t = Context_binary.t + and type tree = Context_binary.tree + and type key = string list + and type value = bytes = struct + type t = Context_binary.t + + type tree = Context_binary.tree + + type key = Context_binary.key + + type value = Context_binary.value + + include Context_binary.Tree +end + +module Arith_Context = struct + module Tree = Tree + + type tree = Tree.tree + + let hash_tree tree = + Sc_rollup_repr.State_hash.context_hash_to_state_hash (Tree.hash tree) + + type proof = Context_binary.Proof.tree Context_binary.Proof.t + + let proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding.V2.Tree2 + .tree_proof_encoding + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup_repr.State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context_binary.Proof.before + + let proof_after proof = + kinded_hash_to_state_hash proof.Context_binary.Proof.after + + let produce_proof context tree step = + let open Lwt_syntax in + (* FIXME: With on-disk context, we cannot commit the empty + context. Is it also true in our case? *) + let* context = Context_binary.add_tree context [] tree in + let* (_hash : Tezos_crypto.Context_hash.t) = + Context_binary.commit ~time:Time.Protocol.epoch context + in + let index = Context_binary.index context in + match Context_binary.Tree.kinded_key tree with + | Some k -> + let* p = Context_binary.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let verify_proof proof step = + let open Lwt_syntax in + let* result = Context_binary.verify_tree_proof proof step in + match result with + | Ok v -> return (Some v) + | Error _ -> + (* We skip the error analysis here since proof verification is not a + job for the rollup node. *) + return None +end + +module FullArithPVM = Sc_rollup_arith.Make (Arith_Context) +open FullArithPVM + +let setup boot_sector f = + let open Lwt_syntax in + let* index = Context_binary.init "/tmp" in + let ctxt = Context_binary.empty index in + let empty = Context_binary.Tree.empty ctxt in + let* state = initial_state ~empty in + let* state = install_boot_sector state boot_sector in + f ctxt state + +let pre_boot boot_sector f = + parse_boot_sector boot_sector |> function + | None -> failwith "Invalid boot sector" + | Some boot_sector -> setup boot_sector @@ f + +let test_preboot () = + [""; "1"; "1 2 +"] + |> List.iter_es (fun boot_sector -> + pre_boot boot_sector @@ fun _ctxt _state -> return ()) + +let boot boot_sector f = + pre_boot boot_sector @@ fun ctxt state -> eval state >>= f ctxt + +let test_boot () = + let open Sc_rollup_PVM_sig in + boot "" @@ fun _ctxt state -> + is_input_state state >>= function + | Needs_reveal Reveal_metadata -> return () + | Initial | Needs_reveal _ | First_after _ -> + failwith "After booting, the machine should be waiting for the metadata." + | No_input_required -> + failwith "After booting, the machine must be waiting for input." + +let test_metadata () = + let open Sc_rollup_PVM_sig in + let open Lwt_result_syntax in + boot "" @@ fun _ctxt state -> + let metadata = + Sc_rollup_metadata_repr. + { + address = Sc_rollup_repr.Address.zero; + origination_level = Raw_level_repr.root; + } + in + let input = Reveal (Metadata metadata) in + let*! state = set_input input state in + let*! input_request = is_input_state state in + match input_request with + | Initial -> return () + | Needs_reveal _ | First_after _ | No_input_required -> + failwith + "After evaluating the metadata, the machine must be in the [Initial] \ + state." + +let test_input_message () = + let open Sc_rollup_PVM_sig in + boot "" @@ fun _ctxt state -> + let input = Sc_rollup_helpers.make_external_input_repr "MESSAGE" in + set_input input state >>= fun state -> + eval state >>= fun state -> + is_input_state state >>= function + | Initial | Needs_reveal _ | First_after _ -> + failwith + "After receiving a message, the rollup must not be waiting for input." + | No_input_required -> return () + +let go ~max_steps target_status state = + let rec aux i state = + pp state >>= fun pp -> + Format.eprintf "%a" pp () ; + if i > max_steps then + failwith "Maximum number of steps reached before target status." + else + get_status state >>= fun current_status -> + if target_status = current_status then return state + else eval state >>= aux (i + 1) + in + aux 0 state + +let test_parsing_message ~valid (source, expected_code) = + boot "" @@ fun _ctxt state -> + let input = Sc_rollup_helpers.make_external_input_repr source in + set_input input state >>= fun state -> + eval state >>= fun state -> + go ~max_steps:10000 Evaluating state >>=? fun state -> + get_parsing_result state >>= fun result -> + Assert.equal + ~loc:__LOC__ + (Option.equal Bool.equal) + "Unexpected parsing result" + (fun fmt r -> + Format.fprintf + fmt + (match r with + | None -> "No parsing running" + | Some true -> "Syntax correct" + | Some false -> "Syntax error")) + (Some valid) + result + >>=? fun () -> + if valid then + get_code state >>= fun code -> + Assert.equal + ~loc:__LOC__ + (List.equal equal_instruction) + "The parsed code is not what we expected: " + (Format.pp_print_list pp_instruction) + expected_code + code + else return () + +let syntactically_valid_messages = + List.map + (fun nums -> + ( String.concat " " (List.map string_of_int nums), + List.map (fun x -> IPush x) nums )) + [[0]; [42]; [373]; [0; 1]; [0; 123; 42; 73; 34; 13; 31]] + @ [ + ("1 2 +", [IPush 1; IPush 2; IAdd]); + ( "1 2 3 + + 3 +", + [IPush 1; IPush 2; IPush 3; IAdd; IAdd; IPush 3; IAdd] ); + ("1 2+", [IPush 1; IPush 2; IAdd]); + ("1 2 3++3+", [IPush 1; IPush 2; IPush 3; IAdd; IAdd; IPush 3; IAdd]); + ("", []); + ("1 a", [IPush 1; IStore "a"]); + ] + +let syntactically_invalid_messages = + List.map + (fun s -> (s, [])) + ["@"; " @"; " @ "; "---"; "12 +++ --"; "1a"; "a$"] + +let test_parsing_messages () = + List.iter_es (test_parsing_message ~valid:true) syntactically_valid_messages + >>=? fun () -> + List.iter_es + (test_parsing_message ~valid:false) + syntactically_invalid_messages + +let test_evaluation_message ~valid + (boot_sector, source, expected_stack, expected_vars) = + boot boot_sector @@ fun _ctxt state -> + let input = Sc_rollup_helpers.make_external_input_repr source in + set_input input state >>= fun state -> + eval state >>= fun state -> + go ~max_steps:10000 Waiting_for_input_message state >>=? fun state -> + if valid then + get_stack state >>= fun stack -> + Assert.equal + ~loc:__LOC__ + (List.equal Compare.Int.equal) + "The stack is not what we expected: " + Format.(pp_print_list (fun fmt -> fprintf fmt "%d;@;")) + expected_stack + stack + >>=? fun () -> + List.iter_es + (fun (x, v) -> + get_var state x >>= function + | None -> failwith "The variable %s cannot be found." x + | Some v' -> + Assert.equal + ~loc:__LOC__ + Compare.Int.equal + (Printf.sprintf "The variable %s has not the right value: " x) + (fun fmt x -> Format.fprintf fmt "%d" x) + v + v') + expected_vars + else + get_evaluation_result state >>= function + | Some true -> failwith "This code should lead to an evaluation error." + | None -> failwith "We should have reached the evaluation end." + | Some false -> return () + +let valid_messages = + [ + ("", "0", [0], []); + ("", "1 2", [2; 1], []); + ("", "1 2 +", [3], []); + ("", "1 2 + 3 +", [6], []); + ("", "1 2 + 3 + 1 1 + +", [8], []); + ("0 ", "", [0], []); + ("1 ", "2", [2; 1], []); + ("1 2 ", "+", [3], []); + ("1 2 + ", "3 +", [6], []); + ("1 2 + ", "3 + 1 1 + +", [8], []); + ("", "1 a", [1], [("a", 1)]); + ("", "1 a 2 + b 3 +", [6], [("a", 1); ("b", 3)]); + ("", "1 a 2 + b 3 + result", [6], [("a", 1); ("b", 3); ("result", 6)]); + ("1 a ", "2 b", [2; 1], [("a", 1); ("b", 2)]); + ("1 a ", "2 a", [2; 1], [("a", 2)]); + ("", "1 a 2 a + a", [3], [("a", 3)]); + ("", "1 a b", [1], [("a", 1); ("b", 1)]); + ("1 a", "", [1], [("a", 1)]); + ] + +let invalid_messages = + List.map + (fun s -> ("", s, [], [])) + ["+"; "1 +"; "1 1 + +"; "1 1 + 1 1 + + +"; "a"] + +let test_evaluation_messages () = + List.iter_es (test_evaluation_message ~valid:true) valid_messages + >>=? fun () -> + List.iter_es (test_evaluation_message ~valid:false) invalid_messages + +let test_output_messages_proofs ~valid ~inbox_level (source, expected_outputs) = + let open Lwt_result_syntax in + boot "" @@ fun ctxt state -> + let input = + Sc_rollup_helpers.make_external_input_repr + ~inbox_level:(Raw_level_repr.of_int32_exn (Int32.of_int inbox_level)) + source + in + let*! state = set_input input state in + let*! state = eval state in + let* state = go ~max_steps:10000 Waiting_for_input_message state in + let check_output output = + let*! result = produce_output_proof ctxt state output in + if valid then + match result with + | Ok proof -> + let*! valid = verify_output_proof proof in + fail_unless valid (Exn (Failure "An output proof is not valid.")) + | Error _ -> failwith "Error during proof generation" + else + match result with + | Ok proof -> + let*! proof_is_valid = verify_output_proof proof in + fail_when + proof_is_valid + (Exn + (Failure + (Format.asprintf + "A wrong output proof is valid: %s -> %a" + source + Sc_rollup_PVM_sig.pp_output + output))) + | Error _ -> return () + in + List.iter_es check_output expected_outputs + +let make_output ~outbox_level ~message_index n = + let open Sc_rollup_outbox_message_repr in + let unparsed_parameters = + Micheline.(Int (dummy_location, Z.of_int n) |> strip_locations) + in + let destination = Contract_hash.zero in + let entrypoint = Entrypoint_repr.default in + let transaction = {unparsed_parameters; destination; entrypoint} in + let transactions = [transaction] in + let message_index = Z.of_int message_index in + let outbox_level = Raw_level_repr.of_int32_exn (Int32.of_int outbox_level) in + let message = Atomic_transaction_batch {transactions} in + Sc_rollup_PVM_sig.{outbox_level; message_index; message} + +let test_valid_output_messages () = + let test inbox_level = + let outbox_level = inbox_level in + [ + ("1", []); + ("1 out", [make_output ~outbox_level ~message_index:0 1]); + ( "1 out 2 out", + [ + make_output ~outbox_level ~message_index:0 1; + make_output ~outbox_level ~message_index:1 2; + ] ); + ( "1 out 1 1 + out", + [ + make_output ~outbox_level ~message_index:0 1; + make_output ~outbox_level ~message_index:1 2; + ] ); + ( "1 out 1 1 + out out", + [ + make_output ~outbox_level ~message_index:0 1; + make_output ~outbox_level ~message_index:1 2; + make_output ~outbox_level ~message_index:2 2; + ] ); + ] + |> List.iter_es (test_output_messages_proofs ~valid:true ~inbox_level) + in + (* Test for different inbox/outbox levels. *) + List.iter_es test [0; 1; 2345] + +let test_invalid_output_messages () = + let inbox_level = 0 in + let outbox_level = inbox_level in + [ + ("1", [make_output ~outbox_level ~message_index:0 1]); + ("1 out", [make_output ~outbox_level ~message_index:1 1]); + ( "1 out 1 1 + out", + [ + make_output ~outbox_level ~message_index:0 0; + make_output ~outbox_level ~message_index:3 2; + ] ); + ( "1 out 1 1 + out out", + [ + make_output ~outbox_level ~message_index:0 42; + make_output ~outbox_level ~message_index:1 32; + make_output ~outbox_level ~message_index:2 13; + ] ); + ] + |> List.iter_es (test_output_messages_proofs ~valid:false ~inbox_level) + +let test_invalid_outbox_level () = + let inbox_level = 42 in + let outbox_level = inbox_level - 1 in + [ + ("1", []); + ("1 out", [make_output ~outbox_level ~message_index:0 1]); + ( "1 out 2 out", + [ + make_output ~outbox_level ~message_index:0 1; + make_output ~outbox_level ~message_index:1 2; + ] ); + ] + |> List.iter_es (test_output_messages_proofs ~valid:false ~inbox_level) + +let test_initial_state_hash_arith_pvm () = + let open Alpha_context in + let open Lwt_result_syntax in + let empty = Sc_rollup_helpers.make_empty_tree () in + let*! state = Sc_rollup_helpers.Arith_pvm.initial_state ~empty in + let*! hash = Sc_rollup_helpers.Arith_pvm.state_hash state in + let expected = Sc_rollup.ArithPVM.reference_initial_state_hash in + if Sc_rollup.State_hash.(hash = expected) then return_unit + else + failwith + "incorrect hash, expected %a, got %a" + Sc_rollup.State_hash.pp + expected + Sc_rollup.State_hash.pp + hash + +let dummy_internal_transfer address = + let open Lwt_result_syntax in + let* ctxt = + let* block, _baker, _contract, _src2 = Contract_helpers.init () in + let+ incr = Incremental.begin_construction block in + Incremental.alpha_ctxt incr + in + let sender = + Contract_hash.of_b58check_exn "KT1BuEZtb68c1Q4yjtckcNjGELqWt56Xyesc" + in + let source = + WithExceptions.Result.get_ok + ~loc:__LOC__ + (Tezos_crypto.Signature.Public_key_hash.of_b58check + "tz1RjtZUVeLhADFHDL8UwDZA6vjWWhojpu5w") + in + let payload = Bytes.of_string "foo" in + let* payload, _ctxt = + Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized + Bytes_t + payload + >|= Environment.wrap_tzresult + in + let transfer = + Sc_rollup_inbox_message_repr.Internal + (Transfer {payload; sender; source; destination = address}) + in + let*? serialized_transfer = + Environment.wrap_tzresult (Sc_rollup_inbox_message_repr.serialize transfer) + in + return serialized_transfer + +let test_filter_internal_message () = + let open Sc_rollup_PVM_sig in + let open Lwt_result_syntax in + boot "" @@ fun _ctxt state -> + let address = Sc_rollup_repr.Address.zero in + let metadata = + Sc_rollup_metadata_repr.{address; origination_level = Raw_level_repr.root} + in + let input = Reveal (Metadata metadata) in + let*! state = set_input input state in + + (* We will set an input where the destination is the same as the one given + in the static metadata. The pvm should process the input. *) + let* () = + let* internal_transfer = dummy_internal_transfer address in + let input = + Inbox_message + { + inbox_level = Raw_level_repr.root; + message_counter = Z.zero; + payload = internal_transfer; + } + in + let*! state = set_input input state in + let*! input_state = is_input_state state in + match input_state with + | No_input_required -> return () + | _ -> failwith "The arith pvm should be processing the internal transfer" + in + + (* We will set an input where the destination is *not* the same as the + one given in the static metadata. The pvm should ignore the input. *) + let* () = + let dummy_address = + Sc_rollup_repr.Address.of_b58check_exn + "sr1Fq8fPi2NjhWUXtcXBggbL6zFjZctGkmso" + in + let* internal_transfer = dummy_internal_transfer dummy_address in + let input = + Inbox_message + { + inbox_level = Raw_level_repr.root; + message_counter = Z.zero; + payload = internal_transfer; + } + in + let*! state = set_input input state in + let*! input_state = is_input_state state in + match input_state with + | No_input_required -> + failwith "The arith pvm should avoid ignored the internal transfer" + | _ -> return () + in + + return () + +let tests = + [ + Tztest.tztest "PreBoot" `Quick test_preboot; + Tztest.tztest "Boot" `Quick test_boot; + Tztest.tztest "Metadata" `Quick test_metadata; + Tztest.tztest "Input message" `Quick test_input_message; + Tztest.tztest "Parsing message" `Quick test_parsing_messages; + Tztest.tztest "Evaluating message" `Quick test_evaluation_messages; + Tztest.tztest "Valid output messages" `Quick test_valid_output_messages; + Tztest.tztest "Invalid output messages" `Quick test_invalid_output_messages; + Tztest.tztest "Invalid outbox level" `Quick test_invalid_outbox_level; + Tztest.tztest + "Initial state hash for Arith" + `Quick + test_initial_state_hash_arith_pvm; + Tztest.tztest "Filter internal message" `Quick test_filter_internal_message; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml new file mode 100644 index 000000000000..8d8bc6ac1daa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml @@ -0,0 +1,257 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Sc_rollup_refutation_storage + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup game$" + Subject: Tests for the SCORU refutation game +*) + +open Protocol +open Lwt_result_syntax +module Commitment_repr = Sc_rollup_commitment_repr +module T = Test_sc_rollup_storage +module R = Sc_rollup_refutation_storage +module D = Sc_rollup_dissection_chunk_repr +module G = Sc_rollup_game_repr +module Tick = Sc_rollup_tick_repr + +(** Assert that the computation fails with the given error. *) +let assert_fails_with ~__LOC__ k expected_err = + let*! res = k in + Assert.proto_error ~loc:__LOC__ res (( = ) expected_err) + +let assert_fails_with_f ~__LOC__ k f = + let*! res = k in + Assert.proto_error ~loc:__LOC__ res f + +let tick_of_int_exn n = + match Tick.of_int n with None -> assert false | Some t -> t + +let context_hash_of_string s = Tezos_crypto.Context_hash.hash_string [s] + +let hash_string s = + Sc_rollup_repr.State_hash.context_hash_to_state_hash + @@ context_hash_of_string s + +let hash_int n = hash_string (Format.sprintf "%d" n) + +let mk_dissection_chunk (state_hash, tick) = D.{state_hash; tick} + +let init_dissection ~size ?init_tick start_hash = + let default_init_tick i = + let hash = + if i = size - 1 then None + else Some (if i = 0 then start_hash else hash_int i) + in + mk_dissection_chunk (hash, tick_of_int_exn i) + in + let init_tick = + Option.fold + ~none:default_init_tick + ~some:(fun init_tick -> init_tick size) + init_tick + in + Stdlib.List.init (size + 1) init_tick + +let init_refutation ~size ?init_tick start_hash = + G. + { + choice = Sc_rollup_tick_repr.initial; + step = Dissection (init_dissection ~size ?init_tick start_hash); + } + +let two_stakers_in_conflict () = + let* ctxt, rollup, genesis_hash, refuter, defender = + T.originate_rollup_and_deposit_with_two_stakers () + in + let hash1 = hash_string "foo" in + let hash2 = hash_string "bar" in + let hash3 = hash_string "xyz" in + let parent_commit = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = T.valid_inbox_level ctxt 1l; + number_of_ticks = T.number_of_ticks_exn 152231L; + compressed_state = hash1; + } + in + let level l = T.valid_inbox_level ctxt l in + let* parent, _, ctxt = + T.lift @@ T.advance_level_n_refine_stake ctxt rollup defender parent_commit + in + let child1 = + Commitment_repr. + { + predecessor = parent; + inbox_level = level 2l; + number_of_ticks = T.number_of_ticks_exn 10000L; + compressed_state = hash2; + } + in + let child2 = + Commitment_repr. + { + predecessor = parent; + inbox_level = level 2l; + number_of_ticks = T.number_of_ticks_exn 10000L; + compressed_state = hash3; + } + in + let ctxt = T.advance_level_for_commitment ctxt child1 in + let* _, _, ctxt, _ = + T.lift + @@ Sc_rollup_stake_storage.publish_commitment ctxt rollup defender child1 + in + let* _, _, ctxt, _ = + T.lift + @@ Sc_rollup_stake_storage.publish_commitment ctxt rollup refuter child2 + in + return (ctxt, rollup, refuter, defender) + +(** A dissection is 'poorly distributed' if its tick counts are not +very evenly spread through the total tick-duration. Formally, the +maximum tick-distance between two consecutive states in a dissection +may not be more than half of the total tick-duration. *) +let test_poorly_distributed_dissection () = + let* ctxt, rollup, refuter, defender = two_stakers_in_conflict () in + let start_hash = hash_string "foo" in + let init_tick size i = + mk_dissection_chunk + @@ + if i = size then (None, tick_of_int_exn 10000) + else (Some (if i = 0 then start_hash else hash_int i), tick_of_int_exn i) + in + let* ctxt = + T.lift @@ R.start_game ctxt rollup ~player:refuter ~opponent:defender + in + let size = + Constants_storage.sc_rollup_number_of_sections_in_dissection ctxt + in + let move = init_refutation ~size ~init_tick start_hash in + assert_fails_with_f + ~__LOC__ + (T.lift @@ R.game_move ctxt rollup ~player:refuter ~opponent:defender move) + (function D.Dissection_invalid_distribution _ -> true | _ -> false) + +let test_single_valid_game_move () = + let* ctxt, rollup, refuter, defender = two_stakers_in_conflict () in + let start_hash = hash_string "foo" in + let size = + Constants_storage.sc_rollup_number_of_sections_in_dissection ctxt + in + let tick_per_state = 10_000 / size in + let dissection = + Stdlib.List.init (size + 1) (fun i -> + mk_dissection_chunk + @@ + if i = 0 then (Some start_hash, tick_of_int_exn 0) + else if i = size then (None, tick_of_int_exn 10000) + else (Some (hash_int i), tick_of_int_exn (i * tick_per_state))) + in + let* ctxt = + T.lift @@ R.start_game ctxt rollup ~player:refuter ~opponent:defender + in + let move = + Sc_rollup_game_repr. + {choice = Sc_rollup_tick_repr.initial; step = Dissection dissection} + in + let* game_result, _ctxt = + T.lift @@ R.game_move ctxt rollup ~player:refuter ~opponent:defender move + in + Assert.is_none ~loc:__LOC__ ~pp:Sc_rollup_game_repr.pp_game_result game_result + +module Arith_pvm = Sc_rollup_helpers.Arith_pvm + +(** Test that sending a invalid serialized inbox proof to + {Sc_rollup_proof_repr.valid} is rejected. *) +let test_invalid_serialized_inbox_proof () = + let open Lwt_result_syntax in + let open Alpha_context in + let rollup = Sc_rollup.Address.zero in + let level = Raw_level.(succ root) in + let inbox = Sc_rollup_helpers.dumb_init level in + let snapshot = Sc_rollup.Inbox.take_snapshot inbox in + let dal_snapshot = Dal.Slots_history.genesis in + let dal_parameters = Default_parameters.constants_mainnet.dal in + let ctxt = Sc_rollup_helpers.make_empty_context () in + let empty = Tezos_context_memory.Context_binary.Tree.empty ctxt in + let*! state = Arith_pvm.initial_state ~empty in + (* We evaluate the boot sector, so the [input_requested] is a + [First_after]. *) + let*! state = Arith_pvm.eval state in + let*! pvm_step = Arith_pvm.produce_proof ctxt None state in + let pvm_step = WithExceptions.Result.get_ok ~loc:__LOC__ pvm_step in + + (* We create an obviously invalid inbox *) + let inbox_proof = + Sc_rollup.Inbox.Internal_for_tests.serialized_proof_of_string + "I am the big bad wolf" + in + let inbox_proof = + Sc_rollup.Proof.Inbox_proof + {level = Raw_level.root; message_counter = Z.zero; proof = inbox_proof} + in + let proof = Sc_rollup.Proof.{pvm_step; input_proof = Some inbox_proof} in + + let metadata = + Sc_rollup.Metadata.{address = rollup; origination_level = level} + in + let*! res = + T.lift + @@ Sc_rollup.Proof.valid + ~pvm:(module Arith_pvm) + ~metadata + snapshot + Raw_level.root + dal_snapshot + dal_parameters.cryptobox_parameters + ~dal_attestation_lag:dal_parameters.attestation_lag + proof + in + Assert.proto_error + ~loc:__LOC__ + res + (( = ) Sc_rollup_proof_repr.Sc_rollup_invalid_serialized_inbox_proof) + +let tests = + [ + Tztest.tztest + "A badly distributed dissection is an invalid move." + `Quick + test_poorly_distributed_dissection; + Tztest.tztest + "A single game move with a valid dissection" + `Quick + test_single_valid_game_move; + Tztest.tztest + "Invalid serialized inbox proof is rejected." + `Quick + test_invalid_serialized_inbox_proof; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml new file mode 100644 index 000000000000..b17e1b63c899 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -0,0 +1,587 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (smart contract rollup inbox) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup inbox$" + Subject: These unit tests check the off-line inbox implementation for + smart contract rollups +*) +open Protocol + +let lift k = Environment.wrap_tzresult k + +let lift_lwt k = Lwt.map Environment.wrap_tzresult k + +module Merkelized_payload_hashes = + Alpha_context.Sc_rollup.Inbox_merkelized_payload_hashes + +module Message = Alpha_context.Sc_rollup.Inbox_message +module Inbox = Alpha_context.Sc_rollup.Inbox +open Alpha_context + +let assert_equal_payload ~__LOC__ found (expected : Message.serialized) = + Assert.equal_string + ~loc:__LOC__ + (Message.unsafe_to_string expected) + (Message.unsafe_to_string found) + +let assert_equal_payload_hash ~__LOC__ found expected = + Assert.equal + ~loc:__LOC__ + Message.Hash.equal + "Protocol hashes aren't equal" + Message.Hash.pp + expected + found + +let assert_merkelized_payload ~__LOC__ ~payload_hash ~index found = + let open Lwt_result_syntax in + let found_payload_hash = Merkelized_payload_hashes.get_payload_hash found in + let found_index = Merkelized_payload_hashes.get_index found in + let* () = + assert_equal_payload_hash ~__LOC__ found_payload_hash payload_hash + in + Assert.equal_z ~loc:__LOC__ found_index index + +let assert_equal_merkelized_payload ~__LOC__ ~found ~expected = + let payload_hash = Merkelized_payload_hashes.get_payload_hash expected in + let index = Merkelized_payload_hashes.get_index expected in + assert_merkelized_payload ~__LOC__ ~payload_hash ~index found + +let assert_inbox_proof_error ?(loc = __LOC__) expected_msg result = + Assert.error ~loc result (function + | Environment.Ecoproto_error (Sc_rollup_inbox_repr.Inbox_proof_error msg) + -> + expected_msg = msg + | _ -> false) + +let gen_payload_size = QCheck2.Gen.(1 -- 10) + +let gen_payload_string = + let open QCheck2.Gen in + string_size gen_payload_size + +let gen_payload = + let open QCheck2.Gen in + let+ payload = gen_payload_string in + Message.unsafe_of_string payload + +let gen_payloads = + let open QCheck2.Gen in + list_size (2 -- 50) gen_payload + +let gen_index payloads = + let open QCheck2.Gen in + let max_index = List.length payloads - 1 in + let+ index = 0 -- max_index in + Z.of_int index + +let gen_payloads_and_index = + let open QCheck2.Gen in + let* payloads = gen_payloads in + let* index = gen_index payloads in + return (payloads, index) + +let gen_payloads_and_two_index = + let open QCheck2.Gen in + let* payloads = gen_payloads in + let* index = gen_index payloads in + let* index' = gen_index payloads in + return (payloads, index, index') + +let gen_payloads_for_level ?(inbox_creation_level = 0) () = + let open QCheck2.Gen in + let* messages = small_list gen_payload_string in + let* level = + let+ level = inbox_creation_level + 1 -- 100_000 in + Raw_level.of_int32_exn (Int32.of_int level) + in + let+ predecessor_timestamp = + let+ seconds = 0 -- 1_000_000 in + Time.Protocol.of_seconds (Int64.of_int seconds) + in + let predecessor = Tezos_crypto.Block_hash.zero in + Sc_rollup_helpers.wrap_messages + ~predecessor_timestamp + ~predecessor + level + messages + +let gen_payloads_for_levels ?(inbox_creation_level = 0) ~max_level () = + Sc_rollup_helpers.gen_payloads_for_levels + ~start_level:(inbox_creation_level + 1) + ~max_level + gen_payload_string + +let gen_inclusion_proof_inputs ?(max_level = 15) () = + let open QCheck2.Gen in + let* payloads_per_levels = gen_payloads_for_levels ~max_level () in + let* index = 0 -- (List.length payloads_per_levels - 2) in + let level = Raw_level.of_int32_exn (Int32.of_int index) in + return (payloads_per_levels, level) + +let gen_proof_inputs ?(max_level = 4) () = + let open QCheck2.Gen in + let* payloads_per_levels = gen_payloads_for_levels ~max_level () in + let* level_index = 0 -- (List.length payloads_per_levels - 1) in + let payloads_at_level = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth payloads_per_levels level_index + in + let* counter = 0 -- (List.length payloads_at_level.inputs - 1) in + return (payloads_per_levels, payloads_at_level.level, Z.of_int counter) + +let fill_merkelized_payload history payloads = + let open Lwt_result_syntax in + let* first, payloads = + match payloads with + | x :: xs -> return (x, xs) + | [] -> failwith "empty payloads" + in + let*? history, merkelized_payload = + lift @@ Merkelized_payload_hashes.genesis history first + in + Lwt.return @@ lift + @@ List.fold_left_e + (fun (history, payloads) payload -> + Merkelized_payload_hashes.add_payload history payloads payload) + (history, merkelized_payload) + payloads + +let construct_merkelized_payload_hashes payloads = + let history = Merkelized_payload_hashes.History.empty ~capacity:1000L in + fill_merkelized_payload history payloads + +module Node_inbox = struct + type t = { + inbox : Inbox.t; + history : Inbox.History.t; + payloads_histories : Sc_rollup_helpers.payloads_histories; + } + + let new_inbox level = + { + inbox = Sc_rollup_helpers.dumb_init level; + history = Inbox.History.empty ~capacity:10000L; + payloads_histories = Sc_rollup_helpers.Payloads_histories.empty; + } + + let fill_inbox inbox payloads_per_levels = + let open Result_syntax in + let* payloads_histories, history, inbox = + Sc_rollup_helpers.fill_inbox + ~inbox:inbox.inbox + inbox.history + inbox.payloads_histories + payloads_per_levels + in + return {inbox; payloads_histories; history} + + let construct_inbox ~inbox_creation_level payloads_per_levels = + let open Result_syntax in + let* payloads_histories, history, inbox = + Sc_rollup_helpers.construct_inbox + ~inbox_creation_level + ~with_histories:true + payloads_per_levels + in + return {inbox; payloads_histories; history} +end + +module Protocol_inbox = struct + let new_inbox level = Sc_rollup_helpers.dumb_init level + + let fill_inbox inbox payloads_per_levels = + let open Result_syntax in + let* _level_tree_histories, _history, inbox = + Sc_rollup_helpers.fill_inbox + ~inbox + (Inbox.History.empty ~capacity:0L) + Sc_rollup_helpers.Payloads_histories.empty + payloads_per_levels + in + return inbox + + let add_new_level inbox messages = + let next_level = Raw_level.succ @@ Sc_rollup.Inbox.inbox_level inbox in + let payloads_per_level = + Sc_rollup_helpers.wrap_messages next_level messages + in + fill_inbox inbox [payloads_per_level] + + let add_new_empty_level inbox = + let next_level = Raw_level.succ @@ Sc_rollup.Inbox.inbox_level inbox in + let empty_level = [Sc_rollup_helpers.make_empty_level next_level] in + fill_inbox inbox empty_level + + let construct_inbox ~inbox_creation_level payloads_per_levels = + let open Result_syntax in + let* _level_tree_histories, _history, inbox = + Sc_rollup_helpers.construct_inbox + ~inbox_creation_level + ~with_histories:false + payloads_per_levels + in + return inbox +end + +let test_merkelized_payload_hashes_history payloads = + let open Lwt_result_syntax in + let nb_payloads = List.length payloads in + let* history, merkelized_payloads = + construct_merkelized_payload_hashes payloads + in + let* () = + Assert.equal_z + ~loc:__LOC__ + (Z.of_int nb_payloads) + (Z.succ (Merkelized_payload_hashes.get_index merkelized_payloads)) + in + List.iteri_es + (fun index (expected_payload : Message.serialized) -> + let expected_payload_hash = + Message.hash_serialized_message expected_payload + in + let found_merkelized_payload = + WithExceptions.Option.get ~loc:__LOC__ + @@ Merkelized_payload_hashes.Internal_for_tests.find_predecessor_payload + history + ~index:(Z.of_int index) + merkelized_payloads + in + let found_payload_hash = + Merkelized_payload_hashes.get_payload_hash found_merkelized_payload + in + assert_equal_payload_hash + ~__LOC__ + found_payload_hash + expected_payload_hash) + payloads + +let test_merkelized_payload_hashes_proof (payloads, index) = + let open Lwt_result_syntax in + let* history, merkelized_payload = + construct_merkelized_payload_hashes payloads + in + let ( Merkelized_payload_hashes. + {merkelized = target_merkelized_payload; payload = proof_payload}, + proof ) = + WithExceptions.Option.get ~loc:__LOC__ + @@ Merkelized_payload_hashes.produce_proof history ~index merkelized_payload + in + let payload : Message.serialized = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth payloads (Z.to_int index) + in + let payload_hash = Message.hash_serialized_message payload in + let* () = assert_equal_payload ~__LOC__ proof_payload payload in + let* () = + assert_merkelized_payload + ~__LOC__ + ~index + ~payload_hash + target_merkelized_payload + in + let*? proof_ancestor_merkelized, proof_current_merkelized = + lift @@ Merkelized_payload_hashes.verify_proof proof + in + let* () = + assert_equal_merkelized_payload + ~__LOC__ + ~found:proof_ancestor_merkelized + ~expected:target_merkelized_payload + in + let* () = + assert_equal_merkelized_payload + ~__LOC__ + ~found:proof_current_merkelized + ~expected:merkelized_payload + in + return_unit + +let test_inclusion_proof_production (payloads_per_levels, level) = + let open Lwt_result_syntax in + let inbox_creation_level = Raw_level.root in + let*? node_inbox = + Node_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let node_inbox_snapshot = Inbox.old_levels_messages node_inbox.inbox in + let* proof, node_old_level_messages = + lift_lwt + @@ Inbox.Internal_for_tests.produce_inclusion_proof + (Sc_rollup_helpers.get_history node_inbox.history) + node_inbox_snapshot + level + in + let*? proto_inbox = + Protocol_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let proto_inbox_snapshot = Inbox.take_snapshot proto_inbox in + let*? found_old_levels_messages = + lift @@ Inbox.verify_inclusion_proof proof proto_inbox_snapshot + in + Assert.equal + ~loc:__LOC__ + Inbox.equal_history_proof + "snapshot is the same in the proto and node" + Inbox.pp_history_proof + node_old_level_messages + found_old_levels_messages + +let test_inclusion_proof_verification (payloads_per_levels, level) = + let open Lwt_result_syntax in + let inbox_creation_level = Raw_level.root in + let*? node_inbox = + Node_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let node_inbox_snapshot = Inbox.old_levels_messages node_inbox.inbox in + let* proof, _node_old_level_messages = + lift_lwt + @@ Inbox.Internal_for_tests.produce_inclusion_proof + (Sc_rollup_helpers.get_history node_inbox.history) + node_inbox_snapshot + level + in + let*? proto_inbox = + Protocol_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let*? proto_inbox = Protocol_inbox.add_new_empty_level proto_inbox in + (* This snapshot is not the same one as node_inbox_snapshot because we + added an empty level. *) + let proto_inbox_snapshot = Inbox.take_snapshot proto_inbox in + let result = + lift @@ Inbox.verify_inclusion_proof proof proto_inbox_snapshot + in + assert_inbox_proof_error "invalid inclusion proof" result + +let test_inbox_proof_production (payloads_per_levels, level, message_counter) = + let open Lwt_result_syntax in + let inbox_creation_level = Raw_level.root in + (* We begin with a Node inbox so we can produce a proof. *) + let exp_message = + Sc_rollup_helpers.first_after payloads_per_levels level message_counter + in + let*? node_inbox = + Node_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let node_inbox_snapshot = Inbox.take_snapshot node_inbox.inbox in + let* proof, input = + lift_lwt + @@ Inbox.produce_proof + ~get_payloads_history: + (Sc_rollup_helpers.get_payloads_history + node_inbox.payloads_histories) + ~get_history:(Sc_rollup_helpers.get_history node_inbox.history) + node_inbox_snapshot + (level, message_counter) + in + (* We now switch to a protocol inbox built from the same messages for + verification. *) + let*? proto_inbox = + Protocol_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let proto_inbox_snapshot = Inbox.take_snapshot proto_inbox in + let* () = + Assert.equal + ~loc:__LOC__ + Inbox.equal_history_proof + "snapshot is the same in the proto and node" + Inbox.pp_history_proof + node_inbox_snapshot + proto_inbox_snapshot + in + let*? v_input = + lift + @@ Inbox.verify_proof (level, message_counter) proto_inbox_snapshot proof + in + let* () = + Assert.equal + ~loc:__LOC__ + (Option.equal Sc_rollup.inbox_message_equal) + "Input returns by the production is the expected one." + (Format.pp_print_option Sc_rollup.pp_inbox_message) + input + v_input + in + Assert.equal + ~loc:__LOC__ + (Option.equal Sc_rollup.inbox_message_equal) + "Input returns by the verification is the expected one." + (Format.pp_print_option Sc_rollup.pp_inbox_message) + exp_message + v_input + +let test_inbox_proof_verification (payloads_per_levels, level, message_counter) + = + let open Lwt_result_syntax in + let inbox_creation_level = Raw_level.root in + (* We begin with a Node inbox so we can produce a proof. *) + let*? node_inbox = + Node_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let get_payloads_history = + Sc_rollup_helpers.get_payloads_history node_inbox.payloads_histories + in + let node_inbox_snapshot = Inbox.old_levels_messages node_inbox.inbox in + let* proof, _input = + lift_lwt + @@ Inbox.produce_proof + ~get_payloads_history + ~get_history:(Sc_rollup_helpers.get_history node_inbox.history) + node_inbox_snapshot + (level, message_counter) + in + (* We now switch to a protocol inbox built from the same messages for + verification. *) + let*? proto_inbox = + Protocol_inbox.construct_inbox ~inbox_creation_level payloads_per_levels + in + let proto_inbox_snapshot = Inbox.take_snapshot proto_inbox in + (* The proto and node inboxes are synchronized, we make sure the verification + refuses the invalid message index. *) + let invalid_message_counter = + if Z.(equal message_counter zero) then Z.succ message_counter + else Z.pred message_counter + in + let* () = + let result = + lift + @@ Inbox.verify_proof + (level, invalid_message_counter) + proto_inbox_snapshot + proof + in + assert_inbox_proof_error + ~loc:__LOC__ + "found index in message_proof is incorrect" + result + in + + (* We move the inbox one level forward so the inbox's inclusion proof fails. *) + let*? proto_inbox = Protocol_inbox.add_new_empty_level proto_inbox in + let proto_inbox_snapshot = Inbox.take_snapshot proto_inbox in + let* () = + let result = + lift + @@ Inbox.verify_proof (level, message_counter) proto_inbox_snapshot proof + in + assert_inbox_proof_error ~loc:__LOC__ "invalid inclusion proof" result + in + + return_unit + +let test_messages_are_correctly_added_in_history + Sc_rollup_helpers.{predecessor_timestamp; predecessor; messages; _} = + let open Lwt_result_syntax in + let inbox = Sc_rollup_helpers.dumb_init Raw_level.root in + let messages = List.map (fun message -> Message.External message) messages in + let*? payloads_history, _history, _inbox, witness, messages = + lift + @@ Inbox.add_all_messages + ~predecessor_timestamp + ~predecessor + (Inbox.History.empty ~capacity:0L) + inbox + messages + in + List.iteri_es + (fun i message -> + let index = Z.of_int i in + let*? expected_payload = lift @@ Message.serialize message in + let expected_hash = Message.hash_serialized_message expected_payload in + let found_merkelized_opt = + Sc_rollup.Inbox_merkelized_payload_hashes.Internal_for_tests + .find_predecessor_payload + payloads_history + ~index + witness + in + let* found_hash = + match found_merkelized_opt with + | Some x -> + return + (Sc_rollup.Inbox_merkelized_payload_hashes.get_payload_hash x) + | None -> + failwith + "The payload was not found in the payloads_history, this is \ + unexpected" + in + Assert.equal + ~loc:__LOC__ + Message.Hash.equal + "The message was not correctly added to the payloads history" + Message.Hash.pp + expected_hash + found_hash) + messages + +let merkelized_payload_hashes_tests = + [ + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"Merkelized messages: Add messages then retrieve them from history." + gen_payloads + test_merkelized_payload_hashes_history; + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"Merkelized messages: Produce proof and verify its validity." + gen_payloads_and_index + test_merkelized_payload_hashes_proof; + ] + +let inbox_tests = + [ + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"produce inclusion proof and verifies it." + (gen_inclusion_proof_inputs ()) + test_inclusion_proof_production; + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"negative test of inclusion proof." + (gen_inclusion_proof_inputs ()) + test_inclusion_proof_verification; + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"produce inbox proof and verifies it." + (gen_proof_inputs ()) + test_inbox_proof_production; + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"negative test of inbox proof." + (gen_proof_inputs ()) + test_inbox_proof_verification; + Tztest.tztest_qcheck2 + ~count:1000 + ~name:"messages are correctly added in payloads history" + (gen_payloads_for_level ()) + test_messages_are_correctly_added_in_history; + ] + +let tests = + merkelized_payload_hashes_tests @ inbox_tests + @ Test_sc_rollup_inbox_legacy.tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml new file mode 100644 index 000000000000..0b5ad6934674 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml @@ -0,0 +1,543 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (smart contract rollup inbox) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup inbox legacy$" + Subject: These unit tests check the off-line inbox implementation for + smart contract rollups +*) + +(* This test file is going to soon disappear. Each tests here are going to be + rewritten in [test_sc_rollup_inbox] in multiples MR. *) +open Protocol +open Sc_rollup_inbox_repr + +exception Sc_rollup_inbox_test_error of string + +let lift res = Environment.wrap_tzresult res + +let err x = Exn (Sc_rollup_inbox_test_error x) + +let rollup = Sc_rollup_repr.Address.hash_string [""] + +let first_level = Raw_level_repr.(succ root) + +let inbox_message_testable = + Alcotest.testable + Sc_rollup_PVM_sig.pp_inbox_message + Sc_rollup_PVM_sig.inbox_message_equal + +module Payloads_histories = + Map.Make (Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash) + +let get_level_tree_history payloads_histories witness_hash = + Payloads_histories.find witness_hash payloads_histories + |> WithExceptions.Option.get ~loc:__LOC__ + |> Lwt.return + +let make_payload message = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Sc_rollup_inbox_message_repr.(serialize @@ External message) + +let make_message message = Sc_rollup_inbox_message_repr.(External message) + +let payloads_from_messages = + List.map (fun Sc_rollup_helpers.{input_repr = input; _} -> + match input with + | Inbox_message {payload; _} -> payload + | Reveal _ -> assert false) + +let populate_inboxes level history inbox inboxes list_of_messages = + let open Result_syntax in + let rec aux level history payloads_histories inbox inboxes witness = function + | [] -> return (payloads_histories, witness, history, inbox, inboxes) + | messages :: ps -> + let* payloads_history, history, inbox, witness, _messages = + Environment.wrap_tzresult + @@ add_all_messages + ~predecessor_timestamp:Time.Protocol.epoch + ~predecessor:Tezos_crypto.Block_hash.zero + history + inbox + messages + in + let witness_hash = + Sc_rollup_inbox_merkelized_payload_hashes_repr.hash witness + in + let payloads_histories = + Payloads_histories.add + witness_hash + payloads_history + payloads_histories + in + let level = Raw_level_repr.succ level in + aux + level + history + payloads_histories + inbox + (inbox :: inboxes) + (Some witness) + ps + in + let payloads_histories = Payloads_histories.empty in + aux level history payloads_histories inbox inboxes None list_of_messages + +let inbox = Sc_rollup_helpers.dumb_init_repr + +let setup_inbox_with_messages list_of_payloads f = + let inbox = inbox first_level in + let history = History.empty ~capacity:10000L in + populate_inboxes first_level history inbox [] list_of_payloads + >>?= fun (payloads_histories, witness, history, inbox, inboxes) -> + match witness with + | None -> fail (err "setup_inbox_with_messages called with no messages") + | Some tree -> f payloads_histories tree history inbox inboxes + +(* An external message is prefixed with a tag whose length is one byte, and + whose value is 1. *) +let encode_external_message message = + let prefix = "\001" in + Bytes.of_string (prefix ^ message) + +let check_payload messages external_message = + Environment.Context.Tree.find messages ["payload"] >>= function + | None -> fail (err "No payload in messages") + | Some payload -> + let expected_payload = encode_external_message external_message in + fail_unless + (expected_payload = payload) + (err + (Printf.sprintf + "Expected payload %s, got %s" + (Bytes.to_string expected_payload) + (Bytes.to_string payload))) + +(** This is basically identical to {!setup_inbox_with_messages}, except + that it uses the {!Node} instance instead of the protocol instance. *) +let setup_node_inbox_with_messages list_of_messages f = + let open Lwt_result_syntax in + let inbox = inbox first_level in + let history = History.empty ~capacity:10000L in + let payloads_histories = Payloads_histories.empty in + let rec aux level history payloads_histories inbox inboxes witness = function + | [] -> return (payloads_histories, witness, history, inbox, inboxes) + | messages :: ps -> + let*? payloads_history, history, inbox, witness, _messages = + Environment.wrap_tzresult + @@ add_all_messages + ~predecessor_timestamp:Time.Protocol.epoch + ~predecessor:Tezos_crypto.Block_hash.zero + history + inbox + messages + in + let witness_hash = + Sc_rollup_inbox_merkelized_payload_hashes_repr.hash witness + in + let payloads_histories = + Payloads_histories.add + witness_hash + payloads_history + payloads_histories + in + let level = Raw_level_repr.succ level in + aux + level + history + payloads_histories + inbox + (inbox :: inboxes) + (Some witness) + ps + in + let* payloads_histories, witness, history, inbox, inboxes = + aux first_level history payloads_histories inbox [] None list_of_messages + in + match witness with + | None -> failwith "setup_inbox_with_messages called with no messages" + | Some tree -> f payloads_histories tree history inbox inboxes + +let level_of_int n = Raw_level_repr.of_int32_exn (Int32.of_int n) + +let level_to_int l = Int32.to_int (Raw_level_repr.to_int32 l) + +let payload_string msg = + Sc_rollup_inbox_message_repr.unsafe_of_string + (Bytes.to_string (encode_external_message msg)) + +let inbox_message_of_input input = + match input with Sc_rollup_PVM_sig.Inbox_message x -> Some x | _ -> None + +let next_inbox_message levels_and_messages l n = + let equal = Raw_level_repr.( = ) in + let messages = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.assoc ~equal l levels_and_messages + in + match List.nth messages (Z.to_int n) with + | Some Sc_rollup_helpers.{input_repr = input; _} -> + inbox_message_of_input input + | None -> ( + (* If no input at (l, n), the next input is (l+1, 0). *) + match List.assoc ~equal (Raw_level_repr.succ l) levels_and_messages with + | None -> None + | Some messages -> + let Sc_rollup_helpers.{input_repr = input; _} = + Stdlib.List.hd messages + in + inbox_message_of_input input) + +let fail_with_proof_error_msg errors fail_msg = + let msg = + List.find_map + (function + | Environment.Ecoproto_error + (Sc_rollup_inbox_repr.Inbox_proof_error msg) -> + Some msg + | Environment.Ecoproto_error + (Sc_rollup_inbox_merkelized_payload_hashes_repr + .Merkelized_payload_hashes_proof_error msg) -> + Some msg + | _ -> None) + errors + in + let msg = Option.(msg |> map (fun s -> ": " ^ s) |> value ~default:"") in + fail (err (fail_msg ^ msg)) + +(** This helper function initializes inboxes and histories with different + capacities and populates them. *) +let init_inboxes_histories_with_different_capacities + (nb_levels, default_capacity, small_capacity, next_index) = + let open Lwt_result_syntax in + let* () = + fail_when + Int64.(of_int nb_levels <= small_capacity) + (err + (Format.sprintf + "Bad inputs: nb_levels = %d should be greater than small_capacity \ + = %Ld" + nb_levels + small_capacity)) + in + let* () = + fail_when + Int64.(of_int nb_levels >= default_capacity) + (err + (Format.sprintf + "Bad inputs: nb_levels = %d should be smaller than \ + default_capacity = %Ld" + nb_levels + default_capacity)) + in + let*? messages = + List.init ~when_negative_length:[] nb_levels (fun i -> [string_of_int i]) + in + let mk_history ?(next_index = 0L) ~capacity () = + let inbox = inbox first_level in + let history = + Sc_rollup_inbox_repr.History.Internal_for_tests.empty + ~capacity + ~next_index + in + let messages = List.map (List.map make_message) messages in + populate_inboxes first_level history inbox [] messages + in + (* Here, we have `~capacity:0L`. So no history is kept *) + mk_history ~capacity:0L () >>?= fun no_history -> + (* Here, we set a [default_capacity] supposed to be greater than [nb_levels], + and keep the default [next_index]. This history will serve as a witeness *) + mk_history ~capacity:default_capacity () >>?= fun big_history -> + (* Here, we choose a small capacity supposed to be smaller than [nb_levels] to + cover cases where the history is full and older elements should be removed. + We also set a non-default [next_index] value to cover cases where the + incremented index may overflow or is negative. *) + mk_history ~next_index ~capacity:small_capacity () >>?= fun small_history -> + return (no_history, small_history, big_history) + +(** In this test, we mainly check that the number of entries in histories + doesn't exceed their respective capacities. *) +let test_history_length + ((_nb_levels, default_capacity, small_capacity, _next_index) as params) = + let open Lwt_result_syntax in + let module I = Sc_rollup_inbox_repr in + let err expected given ~exact = + err + @@ Format.sprintf + "We expect a history of %Ld capacity (%s), but we got %d elements" + expected + (if exact then "exactly" else "at most") + given + in + let no_capacity = 0L in + let* no_history, small_history, big_history = + init_inboxes_histories_with_different_capacities params + in + let _level_tree_histories0, _level_tree0, history0, _inbox0, _inboxes0 = + no_history + in + let _level_tree_histories1, _level_tree1, history1, _inbox1, _inboxes1 = + small_history + in + let _level_tree_histories2, _level_tree2, history2, _inbox2, _inboxes2 = + big_history + in + let hh0 = I.History.Internal_for_tests.keys history0 in + let hh1 = I.History.Internal_for_tests.keys history1 in + let hh2 = I.History.Internal_for_tests.keys history2 in + (* The first history is supposed to have exactly 0 elements *) + let* () = + let len = List.length hh0 in + fail_unless + Int64.(equal no_capacity (of_int @@ len)) + (err no_capacity len ~exact:true) + in + (* The second history is supposed to have exactly [small_capacity], because + we are supposed to add _nb_level > small_capacity entries. *) + let* () = + let len = List.length hh1 in + fail_unless + Int64.(small_capacity = of_int len) + (err small_capacity len ~exact:false) + in + (* The third history's capacity, named [default_capacity], is supposed to be + greater than _nb_level. So, we don't expect this history to be full. *) + let* () = + let len = List.length hh2 in + fail_unless + Int64.(default_capacity > of_int len) + (err default_capacity len ~exact:true) + in + return () + +(** In this test, we check that for two inboxes of the same content, the entries + of the history with the lower capacity, taken in the insertion order, is a + prefix of the entries of the history with the higher capacity. *) +let test_history_prefix params = + let open Lwt_result_syntax in + let module I = Sc_rollup_inbox_repr in + let* no_history, small_history, big_history = + init_inboxes_histories_with_different_capacities params + in + let _level_tree_histories0, _level_tree0, history0, _inbox0, _inboxes0 = + no_history + in + let _level_tree_histories1, _level_tree1, history1, _inbox1, _inboxes1 = + small_history + in + let _level_tree_histories2, _level_tree2, history2, _inbox2, _inboxes2 = + big_history + in + let hh0 = I.History.Internal_for_tests.keys history0 in + let hh1 = I.History.Internal_for_tests.keys history1 in + let hh2 = I.History.Internal_for_tests.keys history2 in + let check_is_suffix sub super = + let rec aux super to_remove = + let* () = + fail_unless + (to_remove >= 0) + (err "A bigger list cannot be a suffix of a smaller one.") + in + if to_remove = 0 then + fail_unless + (List.for_all2 ~when_different_lengths:false I.Hash.equal sub super + = Ok true) + (err "The smaller list is not a prefix the bigger one.") + else + match List.tl super with + | None -> assert false + | Some super -> aux super (to_remove - 1) + in + aux super (List.length super - List.length sub) + in + (* The empty history's hashes list is supposed to be a suffix of a history + with bigger capacity. *) + let* () = check_is_suffix hh0 hh1 in + (* The history's hashes list of the smaller capacity should be a prefix of + the history's hashes list of a bigger capacity. *) + check_is_suffix hh1 hh2 + +(** In this test, we make some checks on production and verification of + inclusion proofs depending on histories' capacity. *) +let test_inclusion_proofs_depending_on_history_capacity + ((_nb_levels, _default_capacity, _small_capacity, _next_index) as params) = + let open Lwt_result_syntax in + let module I = Sc_rollup_inbox_repr in + let* no_history, small_history, big_history = + init_inboxes_histories_with_different_capacities params + in + let _level_tree_histories0, _level_tree0, history0, inbox0, _inboxes0 = + no_history + in + let _level_tree_histories1, _level_tree1, history1, inbox1, _inboxes1 = + small_history + in + let _level_tree_histories2, _level_tree2, history2, inbox2, _inboxes2 = + big_history + in + let hp0 = I.old_levels_messages inbox0 in + let hp1 = I.old_levels_messages inbox1 in + let (hp2 as hp) = I.old_levels_messages inbox2 in + let pred_level_of_hp = + WithExceptions.Option.get ~loc:__LOC__ + @@ Raw_level_repr.pred + @@ I.Internal_for_tests.get_level_of_history_proof hp + in + let* () = + fail_unless + (I.equal_history_proof hp0 hp1 && I.equal_history_proof hp1 hp2) + (err + "History proof of equal inboxes shouldn't depend on the capacity of \ + history.") + in + let proof s v = + let open Lwt_result_syntax in + let*! v = v in + match Environment.wrap_tzresult v with + | Ok v -> return v + | Error _ -> tzfail (err (s ^ ": Expecting some inclusion proof.")) + in + let get_history history inbox = History.find inbox history |> Lwt.return in + (* Producing inclusion proofs using history1 and history2 should succeed. + But, we should not be able to produce any proof with history0 as bound + is 0. *) + let*! ip0 = + I.Internal_for_tests.produce_inclusion_proof + (get_history history0) + hp + pred_level_of_hp + in + let* ip1, hp1' = + proof "history1" + @@ I.Internal_for_tests.produce_inclusion_proof + (get_history history1) + hp + pred_level_of_hp + in + let* ip2, hp2' = + proof "history2" + @@ I.Internal_for_tests.produce_inclusion_proof + (get_history history2) + hp + pred_level_of_hp + in + let* () = + fail_unless + (Result.is_error ip0) + (err + "Should not be able to get inbox inclusion proofs without a history \ + (i.e., a history with no capacity). ") + in + let*? hp1'' = verify_inclusion_proof ip1 hp1 |> Environment.wrap_tzresult in + let*? hp2'' = verify_inclusion_proof ip2 hp2 |> Environment.wrap_tzresult in + fail_unless + (hp1' = hp1'' && hp2' = hp2'' && hp1' = hp2') + (err "Inclusion proofs are expected to be valid.") + +(** This test checks that inboxes of the same levels that are supposed to contain + the same messages are equal. It also check the level trees obtained from + the last calls to add_messages are equal. *) +let test_for_successive_add_messages_with_different_histories_capacities + ((_nb_levels, _default_capacity, _small_capacity, _next_index) as params) = + let open Lwt_result_syntax in + let module I = Sc_rollup_inbox_repr in + let* no_history, small_history, big_history = + init_inboxes_histories_with_different_capacities params + in + let _level_tree_histories0, level_tree0, _history0, _inbox0, inboxes0 = + no_history + in + let _level_tree_histories1, level_tree1, _history1, _inbox1, inboxes1 = + small_history + in + let _level_tree_histories2, level_tree2, _history2, _inbox2, inboxes2 = + big_history + in + (* The latest inbox's value shouldn't depend on the value of [bound]. *) + let eq_inboxes_list = List.for_all2 ~when_different_lengths:false I.equal in + let* () = + fail_unless + (eq_inboxes_list inboxes0 inboxes1 = Ok true + && eq_inboxes_list inboxes1 inboxes2 = Ok true) + (err "Inboxes at the same level with the same content should be equal.") + in + fail_unless + (Option.equal + Sc_rollup_inbox_merkelized_payload_hashes_repr.equal + level_tree0 + level_tree1 + && Option.equal + Sc_rollup_inbox_merkelized_payload_hashes_repr.equal + level_tree1 + level_tree2) + (err "Trees of (supposedly) equal inboxes should be equal.") + +let tests = + let gen_history_params = + QCheck2.Gen.( + (* We fix the number of levels/ inboxes. *) + let* nb_levels = pure 30 in + (* The default capacity is intentionally very big compared to [nb_levels]. *) + let* default_capacity = + frequencyl [(1, Int64.of_int (1000 * nb_levels)); (1, Int64.max_int)] + in + (* The small capacity is intended to be smaller than nb_levels + (but greater than zero). *) + let* small_capacity = 3 -- (nb_levels / 2) in + let* next_index_delta = -5000 -- 5000 in + let big_next_index = Int64.(add max_int (of_int next_index_delta)) in + (* for the [next_index] counter of the history, we test both default values + (i.e., 0L) and values close to [max_int]. *) + let* next_index = frequencyl [(1, 0L); (1, big_next_index)] in + return + (nb_levels, default_capacity, Int64.of_int small_capacity, next_index)) + in + [ + Tztest.tztest_qcheck2 + ~count:10 + ~name:"Checking inboxes history length" + gen_history_params + test_history_length; + Tztest.tztest_qcheck2 + ~count:10 + ~name:"Checking inboxes history content and order" + gen_history_params + test_history_prefix; + Tztest.tztest_qcheck2 + ~count:10 + ~name:"Checking inclusion proofs validity depending on history capacity" + gen_history_params + test_inclusion_proofs_depending_on_history_capacity; + Tztest.tztest_qcheck2 + ~count:10 + ~name: + "Checking results of add_messages when histories have different \ + capacities" + gen_history_params + test_for_successive_add_messages_with_different_histories_capacities; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml new file mode 100644 index 000000000000..164f35a5bb0d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml @@ -0,0 +1,344 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Rollup Management Protocol) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup management protocol$" + Subject: Sanity checks for the Rollup Management Protocol module. +*) + +open Protocol +open Alpha_context + +let wrap m = m >|= Environment.wrap_tzresult + +let check_encode_decode_inbox_message message = + let open Lwt_result_syntax in + let open Sc_rollup_management_protocol in + let*? bytes = + Environment.wrap_tzresult @@ Sc_rollup.Inbox_message.serialize message + in + let*? message' = + Environment.wrap_tzresult + @@ Internal_for_tests.deserialize_inbox_message bytes + in + let*? bytes' = + Environment.wrap_tzresult @@ Sc_rollup.Inbox_message.serialize message' + in + Assert.equal_string + ~loc:__LOC__ + (Sc_rollup.Inbox_message.unsafe_to_string bytes) + (Sc_rollup.Inbox_message.unsafe_to_string bytes') + +let check_encode_decode_outbox_message ctxt message = + let open Lwt_result_syntax in + let open Sc_rollup_management_protocol in + let*? bytes = + Environment.wrap_tzresult + @@ Internal_for_tests.serialize_outbox_message message + in + let* message', _ctxt = + let*? message_repr = + Environment.wrap_tzresult @@ Sc_rollup.Outbox.Message.deserialize bytes + in + wrap @@ outbox_message_of_outbox_message_repr ctxt message_repr + in + let*? bytes' = + Environment.wrap_tzresult + @@ Internal_for_tests.serialize_outbox_message message' + in + Assert.equal_string + ~loc:__LOC__ + (Sc_rollup.Outbox.Message.unsafe_to_string bytes) + (Sc_rollup.Outbox.Message.unsafe_to_string bytes') + +let string_ticket ticketer contents amount = + let open WithExceptions in + let amount = + Option.get ~loc:__LOC__ @@ Ticket_amount.of_n @@ Script_int.abs + @@ Script_int.of_int amount + in + let ticketer = Result.get_ok ~loc:__LOC__ (Contract.of_b58check ticketer) in + let contents = + Result.get_ok ~loc:__LOC__ (Script_string.of_string contents) + in + Script_typed_ir.{ticketer; contents; amount} + +let init_ctxt () = + let open Lwt_result_syntax in + let* block, _baker, _contract, _src2 = Contract_helpers.init () in + let+ incr = Incremental.begin_construction block in + Incremental.alpha_ctxt incr + +let assert_encoding_failure ~loc res = + Assert.proto_error_with_info + ~loc + res + "Failed to encode a rollup management protocol inbox message value" + +let test_encode_decode_internal_inbox_message_transfer () = + let open WithExceptions in + let open Lwt_result_syntax in + let* ctxt = init_ctxt () in + let destination = Sc_rollup.Address.zero in + let sender = + Contract_hash.of_b58check_exn "KT1BuEZtb68c1Q4yjtckcNjGELqWt56Xyesc" + in + let source = + Result.get_ok + ~loc:__LOC__ + (Tezos_crypto.Signature.Public_key_hash.of_b58check + "tz1RjtZUVeLhADFHDL8UwDZA6vjWWhojpu5w") + in + let*? (Script_typed_ir.Ty_ex_c pair_nat_ticket_string_ty) = + Environment.wrap_tzresult + (let open Result_syntax in + let open Script_typed_ir in + let* ticket_t = ticket_t (-1) string_t in + pair_t (-1) nat_t ticket_t) + in + let payload = + ( Script_int.(abs @@ of_int 42), + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ) + in + let* transfer, ctxt = + wrap + @@ Sc_rollup_management_protocol.make_internal_transfer + ctxt + pair_nat_ticket_string_ty + ~payload + ~sender + ~source + ~destination + in + let* () = check_encode_decode_inbox_message transfer in + (* Check that the size of messages that can be encoded is bounded. *) + let msg = String.make 4050 'c' in + let*? payload = Environment.wrap_tzresult (Script_string.of_string msg) in + let* transfer, _ctxt = + let open Script_typed_ir in + wrap + @@ Sc_rollup_management_protocol.make_internal_transfer + ctxt + String_t + ~payload + ~sender + ~source + ~destination + in + let*! res = check_encode_decode_inbox_message transfer in + assert_encoding_failure ~loc:__LOC__ res + +let test_encode_decode_internal_inbox_message_sol () = + let sol = Sc_rollup.Inbox_message.(Internal Start_of_level) in + check_encode_decode_inbox_message sol + +let test_encode_decode_internal_inbox_message_eol () = + let eol = Sc_rollup.Inbox_message.(Internal End_of_level) in + check_encode_decode_inbox_message eol + +let test_encode_decode_external_inbox_message () = + let open Lwt_result_syntax in + let assert_prefix message = + let inbox_message = Sc_rollup.Inbox_message.External message in + let*? real_encoding = + Environment.wrap_tzresult + @@ Sc_rollup.Inbox_message.serialize inbox_message + in + let real_encoding = + Sc_rollup.Inbox_message.unsafe_to_string real_encoding + in + (* The prefix consists of a tag (0 for internal, 1 for external). *) + let real_prefix = String.get real_encoding 0 in + let expected_prefix = '\001' in + let expected_encoding = Printf.sprintf "%c%s" expected_prefix message in + (* Check that the encode/decode matches. *) + let* () = check_encode_decode_inbox_message inbox_message in + (* Check that the prefix match. *) + let* () = Assert.equal_char ~loc:__LOC__ real_prefix expected_prefix in + (* Check that the encoded string consists of the prefix followed by the + original message. *) + Assert.equal_string ~loc:__LOC__ real_encoding expected_encoding + in + let* () = assert_prefix "" in + let* () = assert_prefix "A" in + let* () = assert_prefix "0123456789" in + let* () = assert_prefix (String.init 256 (Fun.const 'A')) in + let assert_encoding_success message = + let inbox_message = Sc_rollup.Inbox_message.External message in + let*! res = check_encode_decode_inbox_message inbox_message in + assert (Result.is_ok res) ; + return_unit + in + let assert_encoding_failure message = + let inbox_message = Sc_rollup.Inbox_message.External message in + let*! res = check_encode_decode_inbox_message inbox_message in + assert_encoding_failure ~loc:__LOC__ res + in + let max_msg_size = Constants_repr.sc_rollup_message_size_limit in + let message = String.init (max_msg_size - 1) (Fun.const 'A') in + let* () = assert_encoding_success message in + let message = String.init max_msg_size (Fun.const 'b') in + let* () = assert_encoding_failure message in + assert_encoding_failure message + +let init_env () = + let open Lwt_result_syntax in + let* block, baker, contract, _src2 = Contract_helpers.init () in + return (block, baker, contract) + +let ticket_receiver = + {| + { parameter (pair nat (ticket string)); + storage (list (ticket string)); + code { UNPAIR; # [(nat, ticket) ; list] + CDR; # [ticket ; list] + CONS; # [ticket :: list] + NIL operation ; # [[] ; ticket :: list] + PAIR; # [([], ticket :: list)] + } + } + |} + +let add_or_clear = + {| + { parameter (or (pair %add nat string) (unit %clear)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { UNPAIR ; DIG 2 ; SWAP ; DIG 2 ; TICKET ; ASSERT_SOME ; CONS ; NIL operation ; PAIR } + { DROP 2 ; NIL (ticket string) ; NIL operation ; PAIR } } } + |} + +let test_encode_decode_outbox_message () = + let open Lwt_result_syntax in + let* block, baker, source_contract = init_env () in + let* ticket_receiver, _, block = + Contract_helpers.originate_contract_from_string + ~script:ticket_receiver + ~storage:"{}" + ~source_contract + ~baker + block + in + let* add_or_clear, _, block = + Contract_helpers.originate_contract_from_string + ~script:add_or_clear + ~storage:"{}" + ~source_contract + ~baker + block + in + let* incr = Incremental.begin_construction block in + let ctxt = Incremental.alpha_ctxt incr in + let ticket_receiver_destination = + match ticket_receiver with + | Contract.Originated ch -> ch + | Implicit _ -> assert false + in + let add_or_clear_destination = + match add_or_clear with + | Contract.Originated ch -> ch + | Implicit _ -> assert false + in + (* Transaction to ticket receiver. *) + let* transaction1, ctxt = + let*? (Script_typed_ir.Ty_ex_c pair_nat_ticket_string_ty) = + Environment.wrap_tzresult + (let open Result_syntax in + let open Script_typed_ir in + let* ticket_t = ticket_t (-1) string_t in + pair_t (-1) nat_t ticket_t) + in + let parameters = + ( Script_int.(abs @@ of_int 42), + string_ticket "KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" "red" 1 ) + in + wrap + @@ Sc_rollup_management_protocol.Internal_for_tests.make_transaction + ctxt + pair_nat_ticket_string_ty + ~parameters + ~destination:ticket_receiver_destination + ~entrypoint:Entrypoint.default + in + (* Transaction to the `add` endpoint of add-or-clear contract. *) + let* transaction2, ctxt = + let*? (Script_typed_ir.Ty_ex_c pair_nat_ticket_string_ty) = + Environment.wrap_tzresult Script_typed_ir.(pair_t (-1) nat_t string_t) + in + let*? content = + Environment.wrap_tzresult @@ Script_string.of_string "Hello" + in + let parameters = (Script_int.(abs @@ of_int 11), content) in + wrap + @@ Sc_rollup_management_protocol.Internal_for_tests.make_transaction + ctxt + pair_nat_ticket_string_ty + ~parameters + ~destination:add_or_clear_destination + ~entrypoint:(Entrypoint.of_string_strict_exn "add") + in + (* Transaction to the `clear` endpoint of add-or-clear contract. *) + let* transaction3, ctxt = + wrap + @@ Sc_rollup_management_protocol.Internal_for_tests.make_transaction + ctxt + Script_typed_ir.unit_t + ~parameters:() + ~destination:add_or_clear_destination + ~entrypoint:(Entrypoint.of_string_strict_exn "clear") + in + let outbox_message = + Sc_rollup_management_protocol.Internal_for_tests.make_atomic_batch + [transaction1; transaction2; transaction3] + in + check_encode_decode_outbox_message ctxt outbox_message + +let tests = + [ + Tztest.tztest + "Encode/decode internal inbox message transfer" + `Quick + test_encode_decode_internal_inbox_message_transfer; + Tztest.tztest + "Encode/decode internal inbox message start of level" + `Quick + test_encode_decode_internal_inbox_message_sol; + Tztest.tztest + "Encode/decode internal inbox message end of level" + `Quick + test_encode_decode_internal_inbox_message_eol; + Tztest.tztest + "Encode/decode external inbox message" + `Quick + test_encode_decode_external_inbox_message; + Tztest.tztest + "Encode/decode outbox message" + `Quick + test_encode_decode_outbox_message; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml new file mode 100644 index 000000000000..63a29f032ad2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -0,0 +1,2745 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Sc_rollup_storage + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup storage$" + Subject: Tests for the SCORU storage module +*) + +open Protocol +open Lwt_result_syntax +module Commitment_repr = Sc_rollup_commitment_repr + +(** Lift a computation using using environment errors to use shell errors. *) +let lift k = Lwt.map Environment.wrap_tzresult k + +(** [new_context_with_stakers n] creates a context with [n] stakers initially + credited with 100 000 tez. *) +let new_context_with_stakers nb_stakers = + let initial_balance = Int64.of_string "100_000_000_000" in + let*? bootstrap_balances = + List.init ~when_negative_length:[] nb_stakers (fun _ -> initial_balance) + in + let* b, contracts = Context.init_n ~bootstrap_balances nb_stakers () in + let+ inc = Incremental.begin_construction b in + let ctxt = Incremental.alpha_ctxt inc in + (* Necessary to originate rollups. *) + let ctxt = + Alpha_context.Origination_nonce.init ctxt Tezos_crypto.Operation_hash.zero + in + let ctxt = Alpha_context.Internal_for_tests.to_raw ctxt in + let stakers = + List.map + (function + | Alpha_context.Contract.Implicit key -> key | _ -> assert false) + contracts + in + (ctxt, stakers) + +let initial_staker_balance = Tez_repr.of_mutez_exn 100_000_000_000L + +let new_context () = + let* ctxt, _stakers = new_context_with_stakers 1 in + (* Mint some tez for staker accounts. *) + let mint_tez_for ctxt pkh_str = + let pkh = Tezos_crypto.Signature.Public_key_hash.of_b58check_exn pkh_str in + let contract = Contract_repr.Implicit pkh in + let+ ctxt, _ = + lift + @@ Token.transfer ctxt `Minted (`Contract contract) initial_staker_balance + in + ctxt + in + let* ctxt = mint_tez_for ctxt "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" in + let* ctxt = mint_tez_for ctxt "tz1RikjCkrEde1QQmuesp796jCxeiyE6t3Vo" in + mint_tez_for ctxt "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" + +let new_sc_rollup ctxt = + let+ rollup, _size, genesis_hash, ctxt = + let {Michelson_v1_parser.expanded; _}, _ = + Michelson_v1_parser.parse_expression "unit" + in + let parameters_ty = Alpha_context.Script.lazy_expr expanded in + let boot_sector = "" in + let kind = Sc_rollups.Kind.Example_arith in + let*! genesis_commitment = + Sc_rollup_helpers.genesis_commitment_raw + ~boot_sector + ~origination_level:(Raw_context.current_level ctxt).level + kind + in + Sc_rollup_storage.originate ctxt ~kind ~parameters_ty ~genesis_commitment + in + (rollup, genesis_hash, ctxt) + +let new_context_with_stakers_and_rollup nb_stakers = + let* ctxt, stakers = new_context_with_stakers nb_stakers in + let+ rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + (ctxt, rollup, genesis_hash, stakers) + +let new_context_with_rollup () = + let* ctxt = new_context () in + let+ rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + (ctxt, rollup, genesis_hash) + +let equal_tez ~loc = + Assert.equal ~loc Tez_repr.( = ) "Tez aren't equal" Tez_repr.pp + +let assert_not_exist ~loc ~pp comp_lwt = + let* _ctxt, res_opt = comp_lwt in + Assert.is_none ~loc ~pp res_opt + +let assert_balance_changed op ctxt ctxt' account amount = + let* _, balance = lift @@ Token.balance ctxt account in + let* _, balance' = lift @@ Token.balance ctxt' account in + let* balance_op_amount = lift @@ op balance amount in + equal_tez balance' ~loc:__LOC__ balance_op_amount + +let assert_balance_increased ctxt ctxt' account amount = + let ( +? ) t1 t2 = Lwt.return Tez_repr.(t1 +? t2) in + assert_balance_changed ( +? ) ctxt ctxt' account amount + +let assert_balance_decreased ctxt ctxt' account amount = + let ( -? ) t1 t2 = Lwt.return Tez_repr.(t1 -? t2) in + assert_balance_changed ( -? ) ctxt ctxt' account amount + +let perform_staking_action_and_check ctxt rollup staker do_and_check = + let staker_contract = Contract_repr.Implicit staker in + let stake = Constants_storage.sc_rollup_stake_amount ctxt in + do_and_check ctxt rollup staker_contract stake + +let deposit_stake_and_check_balances ctxt rollup staker = + perform_staking_action_and_check + ctxt + rollup + staker + (fun ctxt rollup staker_contract stake -> + let* ctxt', _, _ = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.deposit_stake + ctxt + rollup + staker + in + let* () = + assert_balance_decreased ctxt ctxt' (`Contract staker_contract) stake + in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let bonds_account = `Frozen_bonds (staker_contract, bond_id) in + let+ () = assert_balance_increased ctxt ctxt' bonds_account stake in + ctxt') + +(** Originate a rollup with [nb_stakers] stakers and make a deposit to the + initial LCC. *) +let originate_rollup_and_deposit_with_n_stakers nb_stakers = + let* ctxt, rollup, genesis_hash, stakers = + new_context_with_stakers_and_rollup nb_stakers + in + let deposit ctxt staker = + deposit_stake_and_check_balances ctxt rollup staker + in + let+ ctxt = List.fold_left_es deposit ctxt stakers in + (ctxt, rollup, genesis_hash, stakers) + +(** Originate a rollup with one staker and make a deposit to the initial LCC. *) +let originate_rollup_and_deposit_with_one_staker () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let+ ctxt = deposit_stake_and_check_balances ctxt rollup staker in + (ctxt, rollup, genesis_hash, staker) + +(** Originate a rollup with two stakers and make a deposit to the initial LCC. +*) +let originate_rollup_and_deposit_with_two_stakers () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker1 = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let staker2 = + Sc_rollup_repr.Staker.of_b58check_exn "tz1RikjCkrEde1QQmuesp796jCxeiyE6t3Vo" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker1 in + let+ ctxt = deposit_stake_and_check_balances ctxt rollup staker2 in + (ctxt, rollup, genesis_hash, staker1, staker2) + +(** Originate a rollup with three stakers and make a deposit to the initial LCC. +*) +let originate_rollup_and_deposit_with_three_stakers () = + let+ ctxt, rollup, genesis_hash, stakers = + originate_rollup_and_deposit_with_n_stakers 3 + in + match stakers with + | [staker1; staker2; staker3] -> + (ctxt, rollup, genesis_hash, staker1, staker2, staker3) + | _ -> assert false + +(** Trivial assertion. + + By convention, context is passed linearly as [ctxt]. This takes a context + argument to allow this. +*) +let assert_true _ctxt = return () + +(** Assert that the computation fails with the given message. *) +let assert_fails_with ~loc k expected_err = + let open Lwt_result_syntax in + let*! res = k in + let res = Environment.wrap_tzresult res in + Assert.proto_error ~loc res (( = ) expected_err) + +(** Assert operation fails because of missing rollup *) +let assert_fails_with_missing_rollup ~loc op = + let* ctxt = new_context () in + let rollup = Sc_rollup_repr.Address.hash_bytes [] in + assert_fails_with + ~loc + (op ctxt rollup) (* Hash of empty sequence *) + (Sc_rollup_errors.Sc_rollup_does_not_exist rollup) + +(** Assert commitment hash equality. + + By convention, context is passed linearly as [ctxt]. This takes a context + argument to allow this. + *) +let assert_commitment_hash_equal ~loc _ctxt x y = + Assert.equal + ~loc + Commitment_repr.Hash.equal + "Compare commitment hash" + Commitment_repr.Hash.pp + x + y + +let assert_commitment_equal ~loc x y = + Assert.equal + ~loc + (fun Commitment_repr. + { + compressed_state = c1; + inbox_level = l1; + predecessor = p1; + number_of_ticks = n1; + } + Commitment_repr. + { + compressed_state = c2; + inbox_level = l2; + predecessor = p2; + number_of_ticks = n2; + } -> + Sc_rollup_repr.State_hash.equal c1 c2 + && Raw_level_repr.equal l1 l2 + && Commitment_repr.Hash.equal p1 p2 + && Sc_rollup_repr.Number_of_ticks.equal n1 n2) + "Compare commitment" + Commitment_repr.pp + x + y + +let assert_commitments_with_levels_equal ~loc cs1 cs2 = + let commitment_with_level_pp ppf (hash, level) = + Format.fprintf + ppf + "(%a, %a)" + Sc_rollup_commitment_repr.Hash.pp + hash + Raw_level_repr.pp + level + in + Assert.assert_equal_list + ~loc + (fun (commitment1, level1) (commitment2, level2) -> + Sc_rollup_commitment_repr.Hash.(commitment1 = commitment2) + && Raw_level_repr.(level1 = level2)) + "Unexpected list of cemented commitments" + commitment_with_level_pp + cs1 + cs2 + +let assert_kinds_are_equal ~loc x y = + Assert.equal + ~loc + (Option.equal Sc_rollups.Kind.equal) + "Compare optional kind" + (Format.pp_print_option Sc_rollups.Kind.pp) + x + y + +(* Artificially advance current level to make stake refinement possible. + The commitment can be posted after the inbox level commited. For example, + if you post a commitment for the inbox level 32, you will be able to + publish the commitment at level 33. +*) +let advance_level_for_commitment ctxt (commitment : Commitment_repr.t) = + let cur_level = Level_storage.(current ctxt).level in + if cur_level > commitment.inbox_level then ctxt + else + let offset = + let open Raw_level_repr in + let open Int32 in + succ @@ sub (to_int32 commitment.inbox_level) (to_int32 cur_level) + in + Raw_context.Internal_for_tests.add_level ctxt (Int32.to_int offset) + +let advance_level_n_refine_stake ctxt rollup staker ?staked_on commitment = + let ctxt = advance_level_for_commitment ctxt commitment in + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + ?staked_on + staker + commitment + +let test_deposit_to_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.Internal_for_tests.deposit_stake + ctxt + rollup + Sc_rollup_repr.Staker.zero) + +let test_last_cemented_commitment_hash_with_level_when_genesis () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let* c1, inbox_level, ctxt = + lift + @@ Sc_rollup_commitment_storage.last_cemented_commitment_hash_with_level + ctxt + rollup + in + let* () = assert_commitment_hash_equal ~loc:__LOC__ ctxt genesis_hash c1 in + Assert.equal_int32 + ~loc:__LOC__ + (Raw_level_repr.to_int32 (Raw_context.current_level ctxt).level) + (Raw_level_repr.to_int32 inbox_level) + +let test_deposit_by_underfunded_staker () = + let* ctxt, sc_rollup, _genesis_hash = new_context_with_rollup () in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1hhNZvjed6McQQLWtR7MRzPHpgSFZTXxdW" + in + let stake = Constants_storage.sc_rollup_stake_amount ctxt in + let* () = + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.deposit_stake + ctxt + sc_rollup + staker) + (Sc_rollup_errors.Sc_rollup_staker_funds_too_low + { + staker; + sc_rollup; + staker_balance = Tez_repr.zero; + min_expected_balance = stake; + }) + in + let staker_balance = Tez_repr.div_exn stake 2 in + let staker_contract = Contract_repr.Implicit staker in + let* ctxt, _ = + lift + @@ Token.transfer ctxt `Minted (`Contract staker_contract) staker_balance + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.deposit_stake + ctxt + sc_rollup + staker) + (Sc_rollup_errors.Sc_rollup_staker_funds_too_low + {staker; sc_rollup; staker_balance; min_expected_balance = stake}) + +let test_initial_state_is_pre_boot () = + let* ctxt, rollup, genesis_hash = new_context_with_rollup () in + let* lcc, ctxt = + lift @@ Sc_rollup_commitment_storage.last_cemented_commitment ctxt rollup + in + assert_commitment_hash_equal ~loc:__LOC__ ctxt lcc genesis_hash + +let test_deposit_to_existing_rollup () = + let* ctxt, _rollup, _genesis_hash, _staker = + originate_rollup_and_deposit_with_one_staker () + in + assert_true ctxt + +let assert_balance_unchanged ctxt ctxt' account = + let* _, balance = lift @@ Token.balance ctxt account in + let* _, balance' = lift @@ Token.balance ctxt' account in + equal_tez ~loc:__LOC__ balance' balance + +let remove_staker_and_check_balances ctxt rollup staker = + perform_staking_action_and_check + ctxt + rollup + staker + (fun ctxt rollup staker_contract stake -> + let* ctxt', _ = + lift @@ Sc_rollup_stake_storage.remove_staker ctxt rollup staker + in + let* () = + assert_balance_unchanged ctxt ctxt' (`Contract staker_contract) + in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let bonds_account = `Frozen_bonds (staker_contract, bond_id) in + let+ () = assert_balance_decreased ctxt ctxt' bonds_account stake in + ctxt') + +let test_removing_staker_from_lcc_fails () = + let* ctxt, rollup, _genesis_hash, staker = + originate_rollup_and_deposit_with_one_staker () + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.remove_staker ctxt rollup staker) + Sc_rollup_errors.Sc_rollup_remove_lcc + +let withdraw_stake_and_check_balances ctxt rollup staker = + perform_staking_action_and_check + ctxt + rollup + staker + (fun ctxt rollup staker_contract stake -> + let* ctxt', _ = + lift @@ Sc_rollup_stake_storage.withdraw_stake ctxt rollup staker + in + let* () = + assert_balance_increased ctxt ctxt' (`Contract staker_contract) stake + in + let bond_id = Bond_id_repr.Sc_rollup_bond_id rollup in + let bonds_account = `Frozen_bonds (staker_contract, bond_id) in + let+ () = assert_balance_decreased ctxt ctxt' bonds_account stake in + ctxt') + +let test_deposit_then_withdraw () = + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let* ctxt = withdraw_stake_and_check_balances ctxt rollup staker in + assert_true ctxt + +let test_withdrawal_from_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.withdraw_stake + ctxt + rollup + Sc_rollup_repr.Staker.zero) + +let test_withdraw_when_not_staked () = + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.withdraw_stake ctxt rollup staker) + Sc_rollup_errors.Sc_rollup_not_staked + +let test_withdrawing_twice () = + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Tezos_crypto.Signature.Public_key_hash.of_b58check_exn + "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let* ctxt = withdraw_stake_and_check_balances ctxt rollup staker in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.withdraw_stake ctxt rollup staker) + Sc_rollup_errors.Sc_rollup_not_staked + +let number_of_ticks_exn n = + match Sc_rollup_repr.Number_of_ticks.of_value n with + | Some x -> x + | None -> Stdlib.failwith "Bad Number_of_ticks" + +let valid_inbox_level ctxt = + let root_level = Level_storage.(current ctxt).level in + let commitment_freq = + Constants_storage.sc_rollup_commitment_period_in_blocks ctxt + in + fun i -> + Raw_level_repr.add + root_level + Int32.(to_int (mul (of_int commitment_freq) i)) + +(** A more precise version of {!valid_inbox_level}. Not used everywhere + as it requires more information than {!valid_inbox_level} and is in + the lwt tzresult monad. *) +let proper_valid_inbox_level (ctxt, rollup) i = + let+ _, {level = genesis_level; _} = + Sc_rollup_storage.genesis_info ctxt rollup + in + let commitment_freq = + Constants_storage.sc_rollup_commitment_period_in_blocks ctxt + in + Raw_level_repr.add genesis_level (commitment_freq * i) + +let produce_and_refine ctxt ~number_of_commitments ?(start_at_level = 1) + ~predecessor staker rollup = + let inbox_level = proper_valid_inbox_level (ctxt, rollup) in + let rec aux ctxt n l predecessor result = + if n = 0 then return @@ (List.rev result, ctxt) + else + let* inbox_level = inbox_level l in + let commitment = + Commitment_repr. + { + predecessor; + inbox_level; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker commitment + in + aux ctxt (n - 1) (l + 1) c (c :: result) + in + aux ctxt number_of_commitments start_at_level predecessor [] + +let rec cement_commitments ctxt commitments rollup = + match commitments with + | [] -> return ctxt + | c :: commitments -> + let* ctxt, _commitment = + Sc_rollup_stake_storage.cement_commitment ctxt rollup c + in + cement_commitments ctxt commitments rollup + +let test_deposit_then_refine () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = + Sc_rollup_repr.State_hash.zero (* genesis.compressed_state; *); + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + assert_true ctxt + +let test_deposit_then_refine_bad_inbox () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = Raw_level_repr.of_int32_exn 22l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment) + Sc_rollup_errors.Sc_rollup_bad_inbox_level + +let test_publish () = + let* ctxt = new_context () in + lift + @@ let* rollup, genesis_hash, ctxt = new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn + "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 152231L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let ctxt = advance_level_for_commitment ctxt commitment in + let* _node, _level, ctxt, _balance_updates = + Sc_rollup_stake_storage.publish_commitment ctxt rollup staker commitment + in + assert_true ctxt + +let test_publish_returns_oldest_publish_level () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 152231L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let ctxt = advance_level_for_commitment ctxt commitment in + let* _node, level1, ctxt, _balance_updates = + lift + @@ Sc_rollup_stake_storage.publish_commitment ctxt rollup staker1 commitment + in + let current_level = + Raw_level_repr.to_int32 (Raw_context.current_level ctxt).level + in + let* () = + Assert.equal_int32 + ~loc:__LOC__ + (Raw_level_repr.to_int32 level1) + current_level + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt 10 in + let* _node, level2, _ctxt, _balance_updates = + lift + @@ Sc_rollup_stake_storage.publish_commitment ctxt rollup staker2 commitment + in + Assert.equal_int32 + ~loc:__LOC__ + (Raw_level_repr.to_int32 level1) + (Raw_level_repr.to_int32 level2) + +let test_withdraw_and_cement () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment + in + let* ctxt = withdraw_stake_and_check_balances ctxt rollup staker2 in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_true ctxt + +let test_refine_commitment_different_stakers () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + assert_true ctxt + +let test_refine_stake_twice_different_stakers () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _c, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment + in + let* ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment + in + assert_true ctxt + +let test_refine_stake_twice_same_staker () = + let* ctxt, rollup, genesis_hash, staker = + originate_rollup_and_deposit_with_one_staker () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment) + Sc_rollup_errors.Sc_rollup_staker_backtracked + +let test_refine_commitment_fails_on_commitment_from_future () = + let* ctxt, rollup, genesis_hash, staker = + originate_rollup_and_deposit_with_one_staker () + in + let level = valid_inbox_level ctxt in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment) + (Sc_rollup_errors.Sc_rollup_commitment_from_future + { + current_level = Raw_level_repr.of_int32_exn 1l; + inbox_level = Raw_level_repr.of_int32_exn 31l; + }) + +let test_refine_commitment_with_inbox_greater_than_current () = + let* ctxt, rollup, genesis_hash, staker = + originate_rollup_and_deposit_with_one_staker () + in + let level = valid_inbox_level ctxt in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let cur_level = Level_storage.(current ctxt).level in + let ctxt = + Raw_context.Internal_for_tests.add_level + ctxt + Int32.( + to_int @@ succ + @@ sub + (Raw_level_repr.to_int32 commitment.inbox_level) + (Raw_level_repr.to_int32 cur_level)) + in + let* ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment + in + assert_true ctxt + +let test_deposit_then_publish () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 152231L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let ctxt = advance_level_for_commitment ctxt commitment in + let* _node, _level, ctxt, _balance_updates = + lift + @@ Sc_rollup_stake_storage.publish_commitment ctxt rollup staker commitment + in + assert_true ctxt + +let test_publish_missing_rollup () = + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let commitment ctxt = + Commitment_repr. + { + predecessor = Commitment_repr.Hash.zero; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.publish_commitment + ctxt + rollup + staker + (commitment ctxt)) + +let test_cement () = + let* ctxt = new_context () in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + let* old_lcc_hash, ctxt = + lift @@ Sc_rollup_commitment_storage.last_cemented_commitment ctxt rollup + in + let* old_lcc, ctxt = + lift + @@ Sc_rollup_commitment_storage.get_commitment_unsafe + ctxt + rollup + old_lcc_hash + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, _commitment = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + (* Ensures that all the old LCC's metadata cleaned up properly *) + let int32_pp fmt i = Format.fprintf fmt "%ld" i in + let* () = + assert_not_exist ~loc:__LOC__ ~pp:Raw_level_repr.pp + @@ lift + @@ Storage.Sc_rollup.Commitment_added.find (ctxt, rollup) old_lcc_hash + in + let* () = + assert_not_exist ~loc:__LOC__ ~pp:int32_pp + @@ lift + @@ Storage.Sc_rollup.Commitment_stake_count.find (ctxt, rollup) old_lcc_hash + in + let* () = + assert_not_exist ~loc:__LOC__ ~pp:Raw_level_repr.pp + @@ lift + @@ Storage.Sc_rollup.Commitment_first_publication_level.find + (ctxt, rollup) + old_lcc.inbox_level + in + let* () = + assert_not_exist ~loc:__LOC__ ~pp:int32_pp + @@ lift + @@ Storage.Sc_rollup.Commitment_count_per_inbox_level.find + (ctxt, rollup) + old_lcc.inbox_level + in + assert_true ctxt + +(* Create and cement three commitments: + + [c3 -> c2 -> c1 -> Commitment_hash.zero] + + This is useful to catch potential issues with de-allocation of [c2], + as we deallocate the old LCC when a new LCC is cemented. +*) +let test_cement_three_commitments () = + let* ctxt, rollup, genesis_hash, staker = + originate_rollup_and_deposit_with_one_staker () + in + let level = valid_inbox_level ctxt in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let ctxt = advance_level_for_commitment ctxt commitment2 in + let* c2, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment2 + in + let commitment3 = + Commitment_repr. + { + predecessor = c2; + inbox_level = level 3l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c3, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment3 + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, commitment1' = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + let* ctxt, commitment2' = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c2 + in + let* ctxt, commitment3' = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c3 + in + let* () = assert_commitment_equal ~loc:__LOC__ commitment1' commitment1 in + let* () = assert_commitment_equal ~loc:__LOC__ commitment2' commitment2 in + let* () = assert_commitment_equal ~loc:__LOC__ commitment3' commitment3 in + assert_true ctxt + +let test_cement_then_remove () = + let* ctxt = new_context () in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, _ = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.remove_staker ctxt rollup staker) + Sc_rollup_errors.Sc_rollup_remove_lcc + +let test_cement_unknown_commitment_fails () = + let* ctxt = new_context () in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment + ctxt + rollup + Commitment_repr.Hash.zero) + (Sc_rollup_errors.Sc_rollup_unknown_commitment Commitment_repr.Hash.zero) + +let test_cement_with_zero_stakers_fails () = + let* ctxt = new_context () in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt = remove_staker_and_check_balances ctxt rollup staker in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment ctxt rollup c1) + Sc_rollup_errors.Sc_rollup_no_stakers + +let test_cement_fail_too_recent () = + let* ctxt = new_context () in + let level = valid_inbox_level ctxt in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + let min_cementation_level = Raw_level_repr.add level challenge_window in + let* () = + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment ctxt rollup c1) + (Sc_rollup_errors.Sc_rollup_commitment_too_recent + {current_level = level; min_level = min_cementation_level}) + in + let ctxt = + Raw_context.Internal_for_tests.add_level ctxt (challenge_window - 1) + in + let level = (Raw_context.current_level ctxt).level in + let* () = + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment ctxt rollup c1) + (Sc_rollup_errors.Sc_rollup_commitment_too_recent + {current_level = level; min_level = min_cementation_level}) + in + assert_true ctxt + +let test_cement_deadline_uses_oldest_add_time () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + + let* c2, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment + in + let* ctxt = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_commitment_hash_equal ~loc:__LOC__ ctxt c1 c2 + +let test_last_cemented_commitment_hash_with_level () = + let* ctxt = new_context () in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let inbox_level = valid_inbox_level ctxt 1l in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, _ = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + let* c1', inbox_level', ctxt = + lift + @@ Sc_rollup_commitment_storage.last_cemented_commitment_hash_with_level + ctxt + rollup + in + let* () = assert_commitment_hash_equal ~loc:__LOC__ ctxt c1 c1' in + Assert.equal_int32 + ~loc:__LOC__ + (Raw_level_repr.to_int32 inbox_level) + (Raw_level_repr.to_int32 inbox_level') + +let test_withdrawal_fails_when_not_staked_on_lcc () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.withdraw_stake ctxt rollup staker) + Sc_rollup_errors.Sc_rollup_not_staked_on_lcc + +let test_genesis_info_of_rollup () = + let* ctxt = new_context () in + let level_before_rollup = (Raw_context.current_level ctxt).level in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt 10 in + let* _ctxt, genesis_info = + lift @@ Sc_rollup_storage.genesis_info ctxt rollup + in + let initial_level = genesis_info.level in + Assert.equal_int32 + ~loc:__LOC__ + (Raw_level_repr.to_int32 level_before_rollup) + (Raw_level_repr.to_int32 initial_level) + +let test_stake_on_existing_node () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + lift + @@ let* _node, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker1 commitment + in + let* _node, _level, ctxt = + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment + in + assert_true ctxt + +let test_cement_with_two_stakers () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + lift + @@ let* c1, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = + Raw_context.Internal_for_tests.add_level ctxt challenge_window + in + + let* ctxt = Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 in + assert_true ctxt + +let test_can_remove_staker () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let* ctxt = remove_staker_and_check_balances ctxt rollup staker1 in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_true ctxt + +let test_can_remove_staker2 () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let* ctxt = remove_staker_and_check_balances ctxt rollup staker2 in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_true ctxt + +let test_removed_staker_can_not_withdraw () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let* ctxt, _ = + lift @@ Sc_rollup_stake_storage.remove_staker ctxt rollup staker2 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.withdraw_stake ctxt rollup staker2) + Sc_rollup_errors.Sc_rollup_not_staked + +let test_no_cement_on_conflict () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 44L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment2 + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt 5000 in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment ctxt rollup c1) + Sc_rollup_errors.Sc_rollup_disputed + +let test_non_cemented_parent () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c2, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.cement_commitment ctxt rollup c2) + Sc_rollup_errors.Sc_rollup_parent_not_lcc + +let test_finds_conflict_point_at_lcc () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 55L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _c2, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment2 + in + let* (left, _right), ctxt = + lift + @@ Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + assert_commitment_hash_equal ~loc:__LOC__ ctxt left.hash c1 + +let test_finds_conflict_point_beneath_lcc () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c2, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment2 + in + let commitment3 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 7373L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c3, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment3 + in + let* (left, right), ctxt = + lift + @@ Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + let* () = assert_commitment_hash_equal ~loc:__LOC__ ctxt left.hash c2 in + assert_commitment_hash_equal ~loc:__LOC__ ctxt right.hash c3 + +let test_conflict_point_is_first_point_of_disagreement () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c2, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment2 + in + let commitment3 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 7373L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c3, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment3 + in + let commitment4 = + Commitment_repr. + { + predecessor = c2; + inbox_level = level 3l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _c4, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment4 + in + let* (left, right), ctxt = + lift + @@ Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + let* () = assert_commitment_hash_equal ~loc:__LOC__ ctxt left.hash c2 in + assert_commitment_hash_equal ~loc:__LOC__ ctxt right.hash c3 + +let test_conflict_point_computation_fits_in_gas_limit () = + (* Worst case of conflict point computation: two branches of maximum + length rooted just after the LCC. *) + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let max_commits = + let commitment_freq = + Constants_storage.sc_rollup_commitment_period_in_blocks ctxt + in + Int32.div + (Constants_storage.sc_rollup_max_lookahead_in_blocks ctxt) + (Int32.of_int commitment_freq) + in + let root_commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* root_commitment_hash, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 root_commitment + in + let* _node, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + root_commitment + in + let rec branch ctxt staker_id predecessor i max acc = + let open Result_syntax in + let commitment = + Commitment_repr. + { + predecessor; + inbox_level = level i; + number_of_ticks = number_of_ticks_exn staker_id; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* ctxt, commitment_hash = + Sc_rollup_commitment_storage.hash ctxt commitment + in + if i = max then + return (List.rev ((commitment, commitment_hash) :: acc), ctxt) + else + branch + ctxt + staker_id + commitment_hash + (Int32.succ i) + max + ((commitment, commitment_hash) :: acc) + in + let*? branch_1, ctxt = + Environment.wrap_tzresult + @@ branch ctxt 1L root_commitment_hash 2l max_commits [] + in + let*? branch_2, ctxt = + Environment.wrap_tzresult + @@ branch ctxt 2L root_commitment_hash 2l max_commits [] + in + let both_branches = List.combine_drop branch_1 branch_2 in + let* ctxt = + lift + @@ List.fold_left_es + (fun ctxt ((c1, _c1h), (c2, _c2h)) -> + let* _ch, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker1 c1 + in + let+ _ch, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker2 c2 + in + ctxt) + ctxt + both_branches + in + let ctxt = + Raw_context.set_gas_limit + ctxt + (Constants_storage.hard_gas_limit_per_operation ctxt) + in + let* (left, right), ctxt = + lift + @@ Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + let head_hash branch = + match List.hd branch with Some x -> snd x | None -> assert false + in + let* () = + assert_commitment_hash_equal + ~loc:__LOC__ + ctxt + left.hash + (head_hash branch_1) + in + assert_commitment_hash_equal ~loc:__LOC__ ctxt right.hash (head_hash branch_2) + +let test_no_conflict_point_one_staker_at_lcc_preboot () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2) + Sc_rollup_errors.Sc_rollup_no_conflict + +let test_no_conflict_point_both_stakers_at_lcc_preboot () = + let* ctxt, rollup, _genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2) + Sc_rollup_errors.Sc_rollup_no_conflict + +let test_no_conflict_point_one_staker_at_lcc () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _node, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, _ = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2) + Sc_rollup_errors.Sc_rollup_no_conflict + +let test_no_conflict_point_both_stakers_at_lcc () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let* _node, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment1 + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + let* ctxt, _ = + lift @@ Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2) + Sc_rollup_errors.Sc_rollup_no_conflict + +let test_staker_cannot_backtrack () = + let* ctxt = new_context () in + let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let staker = + Sc_rollup_repr.Staker.of_b58check_exn "tz1SdKt9kjPp1HRQFkBmXtBhgMfvdgFhSjmG" + in + let* ctxt = deposit_stake_and_check_balances ctxt rollup staker in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker commitment2 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment1) + Sc_rollup_errors.Sc_rollup_staker_backtracked + +let test_staker_cannot_change_branch () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c2, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment2 + in + let commitment3 = + Commitment_repr. + { + predecessor = c1; + inbox_level = level 2l; + number_of_ticks = number_of_ticks_exn 7373L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + + let* _c3, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment3 + in + let commitment4 = + Commitment_repr. + { + predecessor = c2; + inbox_level = level 3l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* _c4, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment4 + in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment4) + Sc_rollup_errors.Sc_rollup_staker_backtracked + +let test_kind_of_missing_rollup () = + let rollup = Sc_rollup_repr.Address.hash_bytes [] in + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt _ -> + Sc_rollup_storage.kind ctxt rollup) + +let test_refine_stake_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + Sc_rollup_repr.Staker.zero + ~staked_on:Sc_rollup_commitment_repr.Hash.zero + Commitment_repr. + { + predecessor = Commitment_repr.Hash.zero; + inbox_level = valid_inbox_level ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + }) + +let test_last_cemented_commitment_of_missing_rollup () = + assert_fails_with_missing_rollup + ~loc:__LOC__ + Sc_rollup_commitment_storage.last_cemented_commitment + +let test_last_cemented_commitment_hash_with_level_of_missing_rollup () = + assert_fails_with_missing_rollup + ~loc:__LOC__ + Sc_rollup_commitment_storage.last_cemented_commitment_hash_with_level + +let test_cement_commitment_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.cement_commitment + ctxt + rollup + Commitment_repr.Hash.zero) + +let test_get_conflict_point_on_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + Sc_rollup_repr.Staker.zero + Sc_rollup_repr.Staker.zero) + +let test_get_commitment_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_commitment_storage.get_commitment + ctxt + rollup + Commitment_repr.Hash.zero) + +let test_get_missing_commitment () = + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let commitment_hash = Commitment_repr.Hash.zero in + assert_fails_with + ~loc:__LOC__ + (Sc_rollup_commitment_storage.get_commitment ctxt rollup commitment_hash) + (Sc_rollup_errors.Sc_rollup_unknown_commitment commitment_hash) + +let test_remove_staker_from_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_stake_storage.remove_staker + ctxt + rollup + Sc_rollup_repr.Staker.zero) + +let test_genesis_info_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ Sc_rollup_storage.genesis_info + +let test_concurrent_refinement_point_of_conflict () = + let* before_ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level before_ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let commitment2 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 7373L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* (c1, c2), _ctxt = + lift + @@ let* _c1, _level, ctxt = + advance_level_n_refine_stake before_ctxt rollup staker1 commitment1 + in + let* _c2, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker2 commitment2 + in + Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + let* (c1', c2'), ctxt = + lift + @@ let* _c2, _level, ctxt = + advance_level_n_refine_stake before_ctxt rollup staker2 commitment2 + in + let* _c1, _level, ctxt = + advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + Sc_rollup_refutation_storage.Internal_for_tests.get_conflict_point + ctxt + rollup + staker1 + staker2 + in + let* () = assert_commitment_hash_equal ~loc:__LOC__ ctxt c1.hash c1'.hash in + assert_commitment_hash_equal ~loc:__LOC__ ctxt c2.hash c2'.hash + +let test_concurrent_refinement_cement () = + let* before_ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let commitment = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = valid_inbox_level before_ctxt 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _ctxt = + lift + @@ let* c1, _level, ctxt = + advance_level_n_refine_stake before_ctxt rollup staker1 commitment + in + let* _c2, _level, ctxt = + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = + Raw_context.Internal_for_tests.add_level ctxt challenge_window + in + let* ctxt, _ = + Sc_rollup_stake_storage.cement_commitment ctxt rollup c1 + in + Sc_rollup_commitment_storage.last_cemented_commitment ctxt rollup + in + let* c2, ctxt = + lift + @@ let* c2, _level, ctxt = + advance_level_n_refine_stake before_ctxt rollup staker2 commitment + in + let* _c1, _level, ctxt = + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker1 + commitment + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + let ctxt = + Raw_context.Internal_for_tests.add_level ctxt challenge_window + in + let* ctxt, _ = + Sc_rollup_stake_storage.cement_commitment ctxt rollup c2 + in + Sc_rollup_commitment_storage.last_cemented_commitment ctxt rollup + in + assert_commitment_hash_equal ~loc:__LOC__ ctxt c1 c2 + +let check_gas_consumed ~since ~until = + let open Raw_context in + let as_cost = Gas_limit_repr.cost_of_gas @@ gas_consumed ~since ~until in + Saturation_repr.to_int as_cost + +let record ctxt rollup level message_index = + Sc_rollup_outbox_storage.record_applied_message + ctxt + rollup + (Raw_level_repr.of_int32_exn @@ Int32.of_int level) + ~message_index + +(* Recreating the indexing logic to make sure messages are applied. *) +let assert_is_already_applied ~loc ctxt rollup level message_index = + let level = Raw_level_repr.of_int32_exn (Int32.of_int level) in + let level_index = + let max_active_levels = + Constants_storage.sc_rollup_max_active_outbox_levels ctxt + in + Int32.rem (Raw_level_repr.to_int32 level) max_active_levels + in + let* _ctxt, level_and_bitset_opt = + lift + @@ Storage.Sc_rollup.Applied_outbox_messages.find (ctxt, rollup) level_index + in + match level_and_bitset_opt with + | Some (existing_level, bitset) when Raw_level_repr.(existing_level = level) + -> + let*? is_set = + Environment.wrap_tzresult @@ Bitset.mem bitset message_index + in + Assert.equal_bool ~loc is_set true + | _ -> Stdlib.failwith "Expected a bitset and a matching level." + +(** Test outbox for applied messages. *) +let test_storage_outbox () = + let* ctxt = new_context () in + let* rollup1, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let level1 = 100 in + (* Test that is-applied is false for non-recorded messages. *) + let* _size_diff, ctxt = lift @@ record ctxt rollup1 level1 1 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup1 level1 1 in + (* Record the same level and message twice should fail. *) + let* () = + assert_fails_with + ~loc:__LOC__ + (record ctxt rollup1 level1 1) + Sc_rollup_errors.Sc_rollup_outbox_message_already_applied + in + let* _size_diff, ctxt = lift @@ record ctxt rollup1 level1 2 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup1 level1 2 in + (* Record messages for new level. *) + let level2 = level1 + 3 in + let* _size_diff, ctxt = lift @@ record ctxt rollup1 level2 47 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup1 level2 47 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup1 level1 1 in + (* Record for a new rollup. *) + let* rollup2, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let* _size_diff, ctxt = lift @@ record ctxt rollup2 level1 1 in + let* _size_diff, ctxt = lift @@ record ctxt rollup2 level1 3 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup2 level1 1 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup2 level1 3 in + assert_is_already_applied ~loc:__LOC__ ctxt rollup1 level1 1 + +(** Test limits for applied outbox messages. *) +let test_storage_outbox_exceed_limits () = + let level = 1234 in + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + (* Assert that recording a message index that exceeds max outbox messages per + level fails. *) + let* () = + let max_message_index = + Constants_storage.sc_rollup_max_outbox_messages_per_level ctxt + in + assert_fails_with + ~loc:__LOC__ + (record ctxt rollup level max_message_index) + Sc_rollup_errors.Sc_rollup_invalid_outbox_message_index + in + let* () = + assert_fails_with + ~loc:__LOC__ + (record ctxt rollup level (-1)) + Sc_rollup_errors.Sc_rollup_invalid_outbox_message_index + in + let max_active_levels = + Int32.to_int @@ Constants_storage.sc_rollup_max_active_outbox_levels ctxt + in + (* Record message 42 at level 15 *) + let* _size_diff, ctxt = lift @@ record ctxt rollup 15 42 in + let* () = assert_is_already_applied ~loc:__LOC__ ctxt rollup 15 42 in + (* Record message 42 at level [max_active_levels + 15] *) + let* _size_diff, ctxt = + lift @@ record ctxt rollup (max_active_levels + 15) 42 + in + (* Record message 42 at level 15 again should fail as it's expired. *) + let* () = + assert_fails_with + ~loc:__LOC__ + (record ctxt rollup 15 42) + Sc_rollup_errors.Sc_rollup_outbox_level_expired + in + return () + +(** Test storage outbox size diff. Note that these tests depend on the constant. + [sc_rollup_max_outbox_messages_per_level] which controls the maximum size + of bitsets required to store applied messages per level. + + Here's a breakdown of the size for applied-outbox-messages storage: + - [size_of_level = 4] + - [max_size_per_level < (2 * (sc_rollup_max_outbox_messages_per_level / 8))] + - [max_size_per_level < size_of_level + size_of_bitset] + - [total_size < sc_rollup_max_active_outbox_levels * max_size_per_level] + *) +let test_storage_outbox_size_diff () = + (* This is the maximum additional storage space required to store one message. + It depends on [sc_rollup_max_outbox_messages_per_level]. *) + let max_size_diff = 19 in + let* ctxt = new_context () in + let* rollup, _genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in + let level = 15 in + let max_message_index = + Constants_storage.sc_rollup_max_outbox_messages_per_level ctxt - 1 + in + let max_active_levels = + Int32.to_int @@ Constants_storage.sc_rollup_max_active_outbox_levels ctxt + in + (* Record a new message. *) + let* size_diff, ctxt = lift @@ record ctxt rollup level 1 in + (* Size diff is 11 bytes. 4 bytes for level and 7 bytes for a new Z.t *) + let* () = Assert.equal_int ~loc:__LOC__ (Z.to_int size_diff) 5 in + let* size_diff, ctxt = lift @@ record ctxt rollup level 2 in + (* Recording a new message in the bitset at a lower index does not occupy + any additional space. *) + let* () = Assert.equal_int ~loc:__LOC__ (Z.to_int size_diff) 0 in + (* Record a new message at the highest index at an existing level. This + expands the bitset but does not charge for the level. *) + let* size_diff, ctxt = lift @@ record ctxt rollup level max_message_index in + let* () = Assert.equal_int ~loc:__LOC__ (Z.to_int size_diff) 14 in + (* Record a new message at the highest index at a new level. This charges for + space for level and maximum bitset. *) + let* size_diff, ctxt = + lift @@ record ctxt rollup (level + 1) max_message_index + in + let* () = Assert.equal_int ~loc:__LOC__ (Z.to_int size_diff) max_size_diff in + (* Record a new message for a level that resets an index. This replaces the + bitset with a smaller one. Hence we get a negative size diff. *) + let* size_diff, _ctxt = + lift @@ record ctxt rollup (level + max_active_levels) 0 + in + let* () = Assert.equal_int ~loc:__LOC__ (Z.to_int size_diff) (-14) in + return () + +let test_get_cemented_commitments_with_levels_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_commitment_storage.Internal_for_tests + .get_cemented_commitments_with_levels + ctxt + rollup) + +let test_get_cemented_commitments_with_levels () = + let* ctxt, rollup, c0, staker = + originate_rollup_and_deposit_with_one_staker () + in + let level = valid_inbox_level ctxt in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + (* Produce and stake on n commitments, each on top of the other. *) + (* Fetch number of stored commitments in context. *) + let max_num_stored_cemented_commitments = + (Raw_context.constants ctxt).sc_rollup + .max_number_of_stored_cemented_commitments + in + (* Produce and stake more commitments than the number of cemented + commitments that can be stored. *) + let number_of_commitments = max_num_stored_cemented_commitments + 5 in + let* commitments, ctxt = + lift + @@ produce_and_refine + ~number_of_commitments + ~predecessor:c0 + ctxt + staker + rollup + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + (* Cement all commitments that have been produced. *) + let* ctxt = lift @@ cement_commitments ctxt commitments rollup in + (* Add genesis commitment to list of produced commitments. *) + let commitments = c0 :: commitments in + let number_of_cemented_commitments = List.length commitments in + (* Fetch cemented commitments that are kept in context. *) + let* cemented_commitments_with_levels, _ctxt = + lift + @@ Sc_rollup_commitment_storage.Internal_for_tests + .get_cemented_commitments_with_levels + ctxt + rollup + in + (* Check that only ctxt.sc_rollup.max_number_of_stored_cemented_commitments + are kept in context. *) + let* () = + Assert.equal_int + ~loc:__LOC__ + (List.length cemented_commitments_with_levels) + max_num_stored_cemented_commitments + in + (* Check that the commitments that are kept in context are the + last [ctxt.sc_rollup.max_number_of_stored_cemented_commitments]. + commitments that have been cemented. *) + let dropped_commitments = + number_of_cemented_commitments - max_num_stored_cemented_commitments + in + let expected_commitments_with_levels = + commitments + |> List.drop_n dropped_commitments + |> List.mapi (fun i c -> + (c, level @@ Int32.of_int (i + dropped_commitments))) + in + assert_commitments_with_levels_equal + ~loc:__LOC__ + cemented_commitments_with_levels + expected_commitments_with_levels + +(* Produces [max_num_stored_cemented_commitments] number of commitments and + verifies that each of them is an ancestor of the last cemented commitment. *) +let test_are_commitments_related_when_related () = + let* ctxt, rollup, c0, staker = + originate_rollup_and_deposit_with_one_staker () + in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + (* Produce and stake on n commitments, each on top of the other. *) + (* Fetch number of stored commitments in context. *) + let max_num_stored_cemented_commitments = + (Raw_context.constants ctxt).sc_rollup + .max_number_of_stored_cemented_commitments + in + (* Produce and store a number of commitments equal to the maximum number of + cemented commitments that can be stored. *) + let number_of_commitments = max_num_stored_cemented_commitments in + let* commitments, ctxt = + lift + @@ produce_and_refine + ~number_of_commitments + ~predecessor:c0 + ctxt + staker + rollup + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + (* Cement all commitments that have been produced. *) + let* ctxt = lift @@ cement_commitments ctxt commitments rollup in + (* Check that check_if_commitments_are_related detects that each + cemented commitment is an ancestor of the last cemented commitment. *) + let* lcc, ctxt = + lift @@ Sc_rollup_commitment_storage.last_cemented_commitment ctxt rollup + in + commitments + |> List.iter_es (fun commitment -> + let* is_commitment_cemented, _ctxt = + lift + @@ Sc_rollup_commitment_storage.check_if_commitments_are_related + ctxt + rollup + ~descendant:lcc + ~ancestor:commitment + in + Assert.equal_bool ~loc:__LOC__ is_commitment_cemented true) + +(** Tests that [check_if_commitments_are_related] returns false for two + unrelated commitments. *) +let test_unrelated_commitments () = + let* ctxt, rollup, genesis_hash, staker1, staker2 = + originate_rollup_and_deposit_with_two_stakers () + in + let level = valid_inbox_level ctxt in + let commitment1 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 1232909L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c1, _level, ctxt = + lift @@ advance_level_n_refine_stake ctxt rollup staker1 commitment1 + in + let commitment2 = + Commitment_repr. + { + predecessor = genesis_hash; + inbox_level = level 1l; + number_of_ticks = number_of_ticks_exn 44L; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c2, _level, ctxt = + lift + @@ Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker2 + commitment2 + in + let* are_commitments_related, _ctxt = + lift + @@ Sc_rollup_commitment_storage.check_if_commitments_are_related + ctxt + rollup + ~descendant:c1 + ~ancestor:c2 + in + Assert.equal_bool ~loc:__LOC__ are_commitments_related false + +let tests = + [ + Tztest.tztest + "deposit to missing rollup fails" + `Quick + test_deposit_to_missing_rollup; + Tztest.tztest + "deposit by underfunded staker" + `Quick + test_deposit_by_underfunded_staker; + Tztest.tztest + "deposit to existing rollup" + `Quick + test_deposit_to_existing_rollup; + Tztest.tztest "deposit, then withdraw" `Quick test_deposit_then_withdraw; + Tztest.tztest + "cement with zero stakers fails" + `Quick + test_cement_with_zero_stakers_fails; + Tztest.tztest + "withdrawing when not staked fails" + `Quick + test_withdraw_when_not_staked; + Tztest.tztest "withdrawing twice fails" `Quick test_withdrawing_twice; + Tztest.tztest "stake on new node" `Quick test_deposit_then_refine; + Tztest.tztest + "Do not refine with wrong inbox level" + `Quick + test_deposit_then_refine_bad_inbox; + Tztest.tztest "stake on existing node" `Quick test_stake_on_existing_node; + Tztest.tztest "publish commitment" `Quick test_publish; + Tztest.tztest + "publish commitment returns level when commitment was first published" + `Quick + test_publish_returns_oldest_publish_level; + Tztest.tztest + "withdraw stake of another staker before cementing" + `Quick + test_withdraw_and_cement; + Tztest.tztest + "refine a commitment published by another staker is allowed" + `Quick + test_refine_stake_twice_different_stakers; + Tztest.tztest + "Different stakers staking on same commitment is allowed" + `Quick + test_refine_commitment_different_stakers; + Tztest.tztest + "staking twice on same commitment from same staker is not allowed" + `Quick + test_refine_stake_twice_same_staker; + Tztest.tztest + "staking on commitment with inbox level greater than current level is \ + not allowed" + `Quick + test_refine_commitment_fails_on_commitment_from_future; + Tztest.tztest + "staking on commitment with inbox level greater than the current level \ + is allowed" + `Quick + test_refine_commitment_with_inbox_greater_than_current; + Tztest.tztest "stake then publish" `Quick test_deposit_then_publish; + Tztest.tztest "publish with no rollup" `Quick test_publish_missing_rollup; + Tztest.tztest + "withdrawal from missing rollup fails" + `Quick + test_withdrawal_from_missing_rollup; + Tztest.tztest + "withdrawal fails when not staked on LCC" + `Quick + test_withdrawal_fails_when_not_staked_on_lcc; + Tztest.tztest + "initial_level returns correct level" + `Quick + test_genesis_info_of_rollup; + Tztest.tztest + "rollup starts in pre-boot state" + `Quick + test_initial_state_is_pre_boot; + Tztest.tztest "cement" `Quick test_cement; + Tztest.tztest + "cement three commitments" + `Quick + test_cement_three_commitments; + Tztest.tztest "cannot unstake staker at LCC" `Quick test_cement_then_remove; + Tztest.tztest + "cement unknown commitment fails" + `Quick + test_cement_unknown_commitment_fails; + Tztest.tztest + "cement fails when too recent" + `Quick + test_cement_fail_too_recent; + Tztest.tztest + "cement deadline uses oldest add time" + `Quick + test_cement_deadline_uses_oldest_add_time; + Tztest.tztest + "last cemented commitment hash and level returns correct information" + `Quick + test_last_cemented_commitment_hash_with_level; + Tztest.tztest "cement with two stakers" `Quick test_cement_with_two_stakers; + Tztest.tztest "no cement on conflict" `Quick test_no_cement_on_conflict; + Tztest.tztest + "refuse cementing when parent commitment is not the LCC" + `Quick + test_non_cemented_parent; + Tztest.tztest + "finds conflict point at LCC" + `Quick + test_finds_conflict_point_at_lcc; + Tztest.tztest + "finds conflict point beneath LCC" + `Quick + test_finds_conflict_point_beneath_lcc; + Tztest.tztest + "finds first point of disagreement when as point of conflict" + `Quick + test_conflict_point_is_first_point_of_disagreement; + Tztest.tztest + "finds no conflict point with two stakers, one of which is at LCC (PVM \ + in preboot)" + `Quick + test_no_conflict_point_one_staker_at_lcc_preboot; + Tztest.tztest + "finds no conflict point when both stakers commit to LCC (PVM in preboot)" + `Quick + test_no_conflict_point_both_stakers_at_lcc_preboot; + Tztest.tztest + "finds no conflict point with two stakers, one of which is at LCC" + `Quick + test_no_conflict_point_one_staker_at_lcc; + Tztest.tztest + "finds no conflict point when both stakers commit to LCC" + `Quick + test_no_conflict_point_both_stakers_at_lcc; + Tztest.tztest + "test_conflict_point_computation_fits_in_gas_limit" + `Quick + test_conflict_point_computation_fits_in_gas_limit; + Tztest.tztest "staker cannot backtrack" `Quick test_staker_cannot_backtrack; + Tztest.tztest + "staker cannot change branch" + `Quick + test_staker_cannot_change_branch; + Tztest.tztest "can remove staker 1" `Quick test_can_remove_staker; + Tztest.tztest "can remove staker 2" `Quick test_can_remove_staker2; + Tztest.tztest + "removed staker can not withdraw" + `Quick + test_removed_staker_can_not_withdraw; + Tztest.tztest + "removing staker from the LCC fails" + `Quick + test_removing_staker_from_lcc_fails; + Tztest.tztest + "kind of missing rollup is None" + `Quick + test_kind_of_missing_rollup; + Tztest.tztest + "refining stake of missing rollup fails" + `Quick + test_refine_stake_of_missing_rollup; + Tztest.tztest + "fetching last final commitment of missing rollup fails" + `Quick + test_last_cemented_commitment_of_missing_rollup; + Tztest.tztest + "fetching last final commitment hash and level of missing rollup fails" + `Quick + test_last_cemented_commitment_hash_with_level_of_missing_rollup; + Tztest.tztest + "Finalizing commitment of missing rollup fails" + `Quick + test_cement_commitment_of_missing_rollup; + Tztest.tztest + "fetching conflict point of missing rollup fails" + `Quick + test_get_conflict_point_on_missing_rollup; + Tztest.tztest + "fetching commitment of missing rollup fails" + `Quick + test_get_commitment_of_missing_rollup; + Tztest.tztest + "fetching non-existing commitment of rollup fails" + `Quick + test_get_missing_commitment; + Tztest.tztest + "removing staker from missing rollup fails" + `Quick + test_remove_staker_from_missing_rollup; + Tztest.tztest + "initial level of missing rollup fails" + `Quick + test_genesis_info_of_missing_rollup; + Tztest.tztest + "Refinement operations are commutative (point of conflict)" + `Quick + test_concurrent_refinement_point_of_conflict; + Tztest.tztest + "Refinement operations are commutative (cement)" + `Quick + test_concurrent_refinement_cement; + Tztest.tztest "Record messages in storage outbox" `Quick test_storage_outbox; + Tztest.tztest + "Record messages in storage outbox limits" + `Quick + test_storage_outbox_exceed_limits; + Tztest.tztest + "Record messages size diffs" + `Quick + test_storage_outbox_size_diff; + Tztest.tztest + "Originating a rollup creates a genesis commitment" + `Quick + test_last_cemented_commitment_hash_with_level_when_genesis; + Tztest.tztest + "Getting cemented commitments with levels of missing rollups fails" + `Quick + test_get_cemented_commitments_with_levels_of_missing_rollup; + Tztest.tztest + "Getting cemented commitments returns multiple cemented commitments" + `Quick + test_get_cemented_commitments_with_levels; + Tztest.tztest + "All cemented commitments are ancestors of last cemented commitment" + `Quick + test_are_commitments_related_when_related; + Tztest.tztest + "Unrelated commitments are classified as such" + `Quick + test_unrelated_commitments; + ] + +(* FIXME: https://gitlab.com/tezos/tezos/-/issues/2460 + Further tests to be added. +*) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml new file mode 100644 index 000000000000..184147b9d8c5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml @@ -0,0 +1,305 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Rollup layer 1 logic + Invocation: dune exec \ + src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] sc rollup wasm$" + Subject: Unit test for the Wasm PVM +*) + +open Protocol +open Tezos_micheline.Micheline +open Michelson_v1_primitives +open Tezos_webassembly_interpreter +module Context = Tezos_context_memory.Context_binary +open Wasm_utils + +module Proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding + +module Wasm_context = struct + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + end + + type tree = Context.tree + + type proof = Context.Proof.tree Context.Proof.t + + let verify_proof p f = + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof context tree step = + let open Lwt_syntax in + let* context = Context.add_tree context [] tree in + let* (_hash : Tezos_crypto.Context_hash.t) = + Context.commit ~time:Time.Protocol.epoch context + in + let index = Context.index context in + match Context.Tree.kinded_key tree with + | Some k -> + let* p = Context.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup_repr.State_hash.context_hash_to_state_hash hash + + let proof_before proof = kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = Proof_encoding.V2.Tree2.tree_proof_encoding +end + +module Full_Wasm = + Sc_rollup_wasm.V2_0_0.Make (Environment.Wasm_2_0_0.Make) (Wasm_context) + +let test_initial_state_hash_wasm_pvm () = + let open Alpha_context in + let open Lwt_result_syntax in + let empty = Sc_rollup_helpers.make_empty_tree () in + let*! state = Sc_rollup_helpers.Wasm_pvm.initial_state ~empty in + let*! hash = Sc_rollup_helpers.Wasm_pvm.state_hash state in + let expected = Sc_rollup.Wasm_2_0_0PVM.reference_initial_state_hash in + if Sc_rollup.State_hash.(hash = expected) then return_unit + else + failwith + "incorrect hash, expected %a, got %a" + Sc_rollup.State_hash.pp + expected + Sc_rollup.State_hash.pp + hash + +let test_metadata_size () = + let address = Sc_rollup_repr.Address.of_bytes_exn (Bytes.make 20 '\000') in + let metadata = + Sc_rollup_metadata_repr.{address; origination_level = Raw_level_repr.root} + in + let bytes = + Data_encoding.Binary.to_bytes_exn Sc_rollup_metadata_repr.encoding metadata + in + assert ( + Bytes.length bytes + = Tezos_scoru_wasm.Host_funcs.Internal_for_tests.metadata_size) ; + Lwt_result_syntax.return_unit + +let test_l1_input_kind () = + let open Lwt_result_syntax in + let open Sc_rollup_inbox_message_repr in + let open Tezos_scoru_wasm in + let check_msg msg expected = + let*? msg = Environment.wrap_tzresult @@ serialize msg in + let msg = unsafe_to_string msg |> Pvm_input_kind.from_raw_input in + assert (msg = expected) ; + return_unit + in + let* () = check_msg (Internal Start_of_level) (Internal Start_of_level) in + let* () = check_msg (Internal End_of_level) (Internal End_of_level) in + let* () = check_msg (External "payload") External in + + return_unit + +let make_transaction value text contract = + let entrypoint = Entrypoint_repr.default in + let destination : Contract_hash.t = + Contract_hash.of_bytes_exn @@ Bytes.of_string contract + in + let unparsed_parameters = + strip_locations + @@ Prim + ( 0, + I_TICKET, + [Prim (0, I_PAIR, [Int (0, Z.of_int32 value); String (1, text)], [])], + [] ) + in + Sc_rollup_outbox_message_repr.{unparsed_parameters; entrypoint; destination} + +let make_transactions () = + let l = + QCheck2.Gen.( + generate1 + @@ list_size + (return 3) + (triple (string_size @@ return 20) int32 (small_string ~gen:char))) + in + List.map (fun (contract, i, s) -> make_transaction i s contract) l + +(* This is simple "echo kernel" it spits out the first three inputs (SOL, input, + EOL) it receives. It uses the [write_output] host function and so it is used + to test this function. *) +let test_output () = + let open Lwt_result_syntax in + let level_offset = 20 in + let dst = 60 in + let max_bytes = 3600 in + let dst_without_header = dst + 2 in + let modul = + Format.sprintf + {| + (module + (type $t0 (func (param i32 i32) (result i32))) + (type $t3 (func (param i32 i32 i32) (result i32))) + (import "smart_rollup_core" "read_input" (func $read_input (type $t3))) + (import "smart_rollup_core" "write_output" (func $write_output (type $t0))) + (memory 1) + (export "memory" (memory 0)) + (func (export "kernel_run") + (local $size i32) + (local.set $size (call $read_input + (i32.const %d) + (i32.const %d) + (i32.const %d))) + (call $write_output (i32.const %d) + (i32.sub (local.get $size) (i32.const 2))) + (local.set $size (call $read_input + (i32.const %d) + (i32.const %d) + (i32.const %d))) + (call $write_output (i32.const %d) + (i32.sub (local.get $size) (i32.const 2))) + (local.set $size (call $read_input + (i32.const %d) + (i32.const %d) + (i32.const %d))) + (call $write_output (i32.const %d) + (local.get $size)) + drop) + ) + + |} + level_offset + dst + max_bytes + dst_without_header + level_offset + dst + max_bytes + dst_without_header + level_offset + dst + max_bytes + dst_without_header + in + + let*! dummy = Context.init "/tmp" in + let dummy_context = Context.empty dummy in + let (empty_tree : Wasm.tree) = Context.Tree.empty dummy_context in + let parsed = Parse.string_to_module modul in + let parsed = + match parsed.it with Script.Textual m -> m | _ -> assert false + in + let*! boot_sector = Encode.encode parsed in + let*! tree = Wasm.initial_state empty_tree in + let*! tree = + Wasm.install_boot_sector + ~ticks_per_snapshot:Sc_rollup_wasm.V2_0_0.ticks_per_snapshot + ~outbox_validity_period:Sc_rollup_wasm.V2_0_0.outbox_validity_period + ~outbox_message_limit:Sc_rollup_wasm.V2_0_0.outbox_message_limit + boot_sector + tree + in + let*! tree = + Wasm.Internal_for_tests.set_max_nb_ticks (Z.of_int64 50_000_000L) tree + in + let transactions = make_transactions () in + let out = + Sc_rollup_outbox_message_repr.(Atomic_transaction_batch {transactions}) + in + let string_input_message = + Data_encoding.Binary.to_string_exn + Sc_rollup_outbox_message_repr.encoding + out + in + let*! tree = eval_until_input_requested tree in + let*! tree = set_full_input_step [string_input_message] 0l tree in + let*! final_tree = eval_until_input_requested tree in + let*! output = Wasm.Internal_for_tests.get_output_buffer final_tree in + let* last_outbox_level = + match output.Tezos_webassembly_interpreter.Output_buffer.last_level with + | Some level -> return level + | None -> failwith "The PVM output buffer does not contain any outbox." + in + let*! last_outbox = + Tezos_webassembly_interpreter.Output_buffer.get_outbox + output + last_outbox_level + in + let* end_of_level_message_index = + match Output_buffer.get_outbox_last_message_index last_outbox with + | Some index -> return index + | None -> failwith "The PVM output buffer does not contain any outbox." + in + (* The last message in the outbox corresponds to EOL, due to the nature of the + kernel. As such we must take the one preceding it. *) + let message_index = Z.pred end_of_level_message_index in + + let*! bytes_output_message = + Tezos_webassembly_interpreter.Output_buffer.( + get_message output {outbox_level = last_outbox_level; message_index}) + in + assert (string_input_message = Bytes.to_string bytes_output_message) ; + let message = + Data_encoding.Binary.of_bytes_exn + Sc_rollup_outbox_message_repr.encoding + bytes_output_message + in + assert (message = out) ; + let*? outbox_level = + Environment.wrap_tzresult @@ Raw_level_repr.of_int32 last_outbox_level + in + let output = Sc_rollup_PVM_sig.{outbox_level; message_index; message} in + + let*! pf = Full_Wasm.produce_output_proof dummy_context final_tree output in + + match pf with + | Ok proof -> + let*! valid = Full_Wasm.verify_output_proof proof in + fail_unless valid (Exn (Failure "An output proof is not valid.")) + | Error _ -> failwith "Error during proof generation" + +let tests = + [ + Tztest.tztest + "initial state hash for Wasm" + `Quick + test_initial_state_hash_wasm_pvm; + Tztest.tztest "size of a rollup metadata" `Quick test_metadata_size; + Tztest.tztest "l1 input kind" `Quick test_l1_input_kind; + Tztest.tztest "test output proofs" `Quick test_output; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml new file mode 100644 index 000000000000..89630b220c44 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml @@ -0,0 +1,535 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (skip lists) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] skip list$" + Subject: Test skip list implementation +*) + +open Protocol + +exception Skip_list_test_error of string + +let err x = Exn (Skip_list_test_error x) + +module TestNat (Parameters : sig + val basis : int +end) = +struct + open Parameters + include Skip_list_repr.Make (Parameters) + + (* This represents cells of skip lists whose content are even + numbers from {!val:initial_value} and increase 2 by 2. *) + type t = {size : int; cells : (int * (int, int) cell) list} + + let deref list i = List.assoc ~equal:Compare.Int.equal i list.cells + + (* Must be an even number. See {!val:succ}. *) + let initial_value = 10 + + (* Since the list was initialised once/computed once, we can get + back its content from its index directly. *) + let content_from_index ~default list i = + match deref list i with None -> default | Some x -> content x + + let show_cell cell = + Printf.sprintf + "{ content = %d; back_pointers = %s }" + (content cell) + (back_pointers cell |> List.map string_of_int |> String.concat " ") + + let show_cells cells = + String.concat + "; " + (List.map + (fun (i, cell) -> Printf.sprintf "%d:%s" i (show_cell cell)) + cells) + + let show_list list = + Printf.sprintf + "basis: %d, size: %d, cells = %s" + basis + list.size + (show_cells list.cells) + + let show_path path = String.concat " " (List.map string_of_int path) + + let head list = + match List.hd list.cells with None -> assert false | Some h -> h + + let zero = {size = 1; cells = [(0, genesis initial_value)]} + + let succ list = + let prev_cell_ptr, prev_cell = head list in + (* Content of cells are only even numbers so that searching odd numbers will always fail. *) + let cell = + next ~prev_cell ~prev_cell_ptr ((2 * list.size) + initial_value) + in + {size = list.size + 1; cells = (list.size, cell) :: list.cells} + + let back_path list start stop = + back_path ~deref:(deref list) ~cell_ptr:start ~target_index:(Z.of_int stop) + + let find list start stop = + find ~deref:(deref list) ~cell_ptr:start ~target_index:(Z.of_int stop) + + let search list start target_content = + search + ~deref:(deref list) + ~compare:(fun x -> Compare.Int.(compare x target_content)) + ~cell:start + + let valid_back_path list start stop path = + valid_back_path + ~equal_ptr:( = ) + ~deref:(deref list) + ~cell_ptr:start + ~target_ptr:stop + path + + let rec nlist basis n = if n = 0 then zero else succ (nlist basis (n - 1)) + + let check_find i j = + let open Lwt_result_syntax in + let l = nlist basis i in + let*? () = + match find l i j with + | None -> error (err (Printf.sprintf "There must be a cell (%d)" i)) + | Some cell -> + let index = Z.to_int (index cell) in + error_unless + (index = j) + (err + (Printf.sprintf + "Found cell is not the correct one (found %d, expected %d)" + index + j)) + in + let*? path = + match back_path l i j with + | None -> + error (err (Printf.sprintf "There must be path from %d to %d" i j)) + | Some path -> ok path + in + let*? () = + match List.(hd (rev path)) with + | None -> + error + (err + (Printf.sprintf + " There can't be an empty path from %d to %d" + i + j)) + | Some stop_cell -> + error_unless + (j = stop_cell) + (err + (Printf.sprintf + "Found cell is not equal to stop cell of back path (%d to %d)" + i + j)) + in + return_unit + + let check_invalid_find i = + let open Lwt_result_syntax in + let l = nlist basis i in + let check_nothing_found i j = + match find l i j with + | None -> ok () + | Some _v -> + error + (err + (Printf.sprintf + "There should be no value found at %d from %d" + i + j)) + in + let*? () = check_nothing_found i (-1) in + let rec aux j = + if i <= j then return_unit + else + let*? () = check_nothing_found j i in + aux (j + 1) + in + aux 0 + + let check_path i j back_path_fn = + let open Lwt_result_syntax in + let l = nlist basis i in + let*! path = back_path_fn l i j in + match path with + | None -> + tzfail (err (Printf.sprintf "There must be path from %d to %d" i j)) + | Some path -> + let len = List.length path in + let log_basis x = + int_of_float @@ ceil (log (float_of_int x) /. log (float_of_int basis)) + in + let log_ij = log_basis (i - j + 1) in + let expected = max 1 (log_ij * basis) in + fail_unless + (len <= expected) + (err + (Format.sprintf + "The proof is too long! Expected = %d < len = %d [basis = %d, \ + i = %d, log = %d, j = %d]\n" + expected + len + basis + i + log_ij + j)) + >>=? fun () -> + fail_unless + (valid_back_path l i j path) + (err + (Printf.sprintf + "The path %s does not connect %d to %d (or is \ + invalid/non-minimal)" + (show_path path) + i + j)) + + let check_invalid_paths i = + let l = nlist basis i in + let rec aux j = + if i <= j then return () + else + (match back_path l j i with + | None -> return () + | Some _path -> + fail + (err + (Printf.sprintf + "There should be no path connecting %d to %d" + j + i))) + >>=? fun () -> aux (j + 1) + in + aux 0 + + let check_lower_path history rev_path target = + match rev_path with + | [] -> + (* checked before. *) + assert false + | [cell_x] -> + if + (* If there is a single element, we check the content of the + cell is smaller than the target. *) + Compare.Int.(content cell_x < target) + then return () + else fail (err (Printf.sprintf "Invalid path: %d" target)) + | rev_path -> ( + (* The path is returned from the start cell to the target. The + invariant we want to check is in the opposite direction. *) + match rev_path with + | cell_x :: cell_z :: _ -> ( + let i = Z.to_int (index cell_x) in + let next_index = i + 1 in + match + List.nth history.cells (List.length history.cells - next_index - 1) + with + | None -> assert false + | Some (_y, cell_y) -> + if + Compare.Int.( + content cell_x < target + && target < content cell_y + && content cell_y <= content cell_z) + then return () + else + fail (err (Printf.sprintf "Invariant for 'Lower' is broken"))) + | _ -> assert false) + + let check_invalid_search_paths i = + let open Lwt_result_syntax in + let l = nlist basis i in + let rec aux j = + if i <= j then return () + else + (* An odd number to make the search fails. *) + let shift_size = 5 in + (* delta is chosen so that j + delta is not in the list and + can be below the smallest element and greater than the + largest element. *) + let delta = + if List.length l.cells mod 2 = 0 then -shift_size else shift_size + in + let t = content_from_index ~default:(-1) l j + delta in + (* By construction, deref never fails since j <= List.length list. *) + match deref l i with + | None -> assert false + | Some start_content -> + (* For each case below, we check whether the last cell + returned is valid with respect to the current path. Two + cases are not possible. *) + (match search l start_content t with + | {last_cell = No_exact_or_lower_ptr; rev_path} -> ( + (* In that case, we check the path returned by search + is above the target. *) + match rev_path with + | [] -> tzfail (err (Printf.sprintf "unexpected empty path")) + | head :: _ -> + if Compare.Int.(content head > t) then return () + else + tzfail + (err + (Printf.sprintf + "Invariant for 'No_exact_or_lower_ptr' broken"))) + | {last_cell = Nearest _; rev_path} -> + (* In that case, we check the property of being a lower path. *) + check_lower_path l rev_path t + | {last_cell = Deref_returned_none; _} -> + (* deref should always work *) + assert false + | {last_cell = Found _; _} -> + (* Because we search for a cell that which is not in + the list, if the cell was found, we fail. *) + tzfail + (err + (Printf.sprintf + "There should be no search path connecting %d to a \ + node with content %d" + i + t))) + >>=? fun () -> aux (j + 1) + in + aux 0 + + let pp_search_result fmt = + pp_search_result + ~pp_cell:(fun fmt cell -> Format.fprintf fmt "%s" (show_cell cell)) + fmt +end + +let test_skip_list_nat_check_path (basis, i, j) = + let module M = TestNat (struct + let basis = basis + end) in + let back_path list start stop = Lwt.return (M.back_path list start stop) in + M.check_path i j back_path + +let test_skip_list_nat_check_find (basis, i, j) = + let module M = TestNat (struct + let basis = basis + end) in + M.check_find i j + +let test_skip_list_nat_check_invalid_find (basis, i) = + let module M = TestNat (struct + let basis = basis + end) in + M.check_invalid_find i + +let test_skip_list_nat_check_invalid_path (basis, i) = + let module M = TestNat (struct + let basis = basis + end) in + M.check_invalid_paths i + +let test_minimal_back_path () = + let basis = 2 in + let module M = TestNat (struct + let basis = basis + end) in + let l = M.nlist basis 20 in + let check_minimal_path = function + | None, _ -> failwith "empty path" + | Some path, expected_path -> + if path = expected_path then return () + else + failwith + "non-minimal path:[%s] != expected_path:[%s]" + (M.show_path path) + (M.show_path expected_path) + in + let cases = + [ + (6, 1, [6; 3; 1]); + (6, 3, [6; 3]); + (10, 3, [10; 7; 3]); + (10, 5, [10; 7; 5]); + (10, 7, [10; 7]); + (10, 9, [10; 9]); + ] + in + List.iter_es + check_minimal_path + (List.map + (fun (start, target, expected_path) -> + (M.back_path l start target, expected_path)) + cases) + +let test_search_non_minimal_back_path () = + let open Lwt_result_syntax in + let basis = 2 in + let module M = TestNat (struct + let basis = basis + end) in + let l = M.nlist basis 100 in + let index_of_content candidate = + match List.find (fun (_, cell) -> cell = candidate) l.cells with + | None -> assert false + | Some (x, _) -> x + in + let deref x = match M.deref l x with None -> assert false | Some x -> x in + (* This target is chosen to demonstrate that the path is not always + minimal, but this happens only on the very last node. [target] + must be odd to ensure the content is not in the list. *) + let target = 17 in + let start_index = 100 in + let start = deref start_index in + (* Since we are only checking the minimality of the path returned by + search, we assume the other part of the [search] specification to + be correct below (hence the [assert false]). *) + match M.search l start target with + | M.{last_cell = Nearest {lower; upper = Some upper}; rev_path} -> ( + match rev_path with + | [] -> + (* By specification of the function [search]. *) + assert false + | _lower :: upper_path as lower_path -> ( + (* We check the upper path is minimal. *) + let upper_index = index_of_content upper in + match M.back_path l start_index upper_index with + | None -> + (* By specification of the function [search]. *) + assert false + | Some upper_expected_path -> + if List.rev upper_path = List.map deref upper_expected_path then + (* We check the lower path is not minimal. *) + let lower_index = index_of_content lower in + match M.back_path l start_index lower_index with + | None -> + (* By specification of the function [search]. *) + assert false + | Some lower_expected_path -> + if List.rev lower_path = List.map deref lower_expected_path + then + failwith + "The path returned is minimal while it should not be \ + the case." + else return () + else (* By specification of the function [search]. *) + assert false)) + | _ -> + (* The cell does not exist in the list. *) + assert false + +let test_skip_list_nat_check_path_with_search (basis, i, j) = + let module M = TestNat (struct + let basis = basis + end) in + M.check_path i j (fun l i j -> + let target = M.content_from_index ~default:(-1) l j in + let start = + match M.deref l i with None -> assert false | Some start -> start + in + match M.search l start target with + | {last_cell = Found _; rev_path} -> + List.rev_map + (fun cell -> + let x = M.content cell in + (x - 10) / 2) + rev_path + |> Lwt.return_some + | _result -> Lwt.return_none) + +let test_skip_list_nat_check_invalid_path_with_search (basis, i) = + let module M = TestNat (struct + let basis = basis + end) in + M.check_invalid_search_paths i + +let tests = + [ + Tztest.tztest_qcheck2 + ~name:"Skip list: produce paths with `back_path` and check" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 100 in + let* j = 0 -- i in + return (basis, i, j)) + test_skip_list_nat_check_path; + Tztest.tztest_qcheck2 + ~name:"Skip list: find cell with `find` and `check`" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 100 in + let* j = 0 -- i in + return (basis, i, j)) + test_skip_list_nat_check_find; + Tztest.tztest_qcheck2 + ~name:"Skip list: `find` won't produce invalid value" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 100 in + return (basis, i)) + test_skip_list_nat_check_invalid_find; + Tztest.tztest_qcheck2 + ~name:"Skip list: `back_path` won't produce invalid paths" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 100 in + return (basis, i)) + test_skip_list_nat_check_invalid_path; + Tztest.tztest + "Skip list: check if the back_path is minimal" + `Quick + test_minimal_back_path; + Tztest.tztest_qcheck2 + ~name:"Skip list: produce paths with `search` and check" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 100 in + let* j = 0 -- i in + return (basis, i, j)) + test_skip_list_nat_check_path_with_search; + Tztest.tztest_qcheck2 + ~name:"Skip list: `search` won't produce invalid paths" + ~count:10 + QCheck2.Gen.( + let* basis = frequency [(5, pure 2); (1, 2 -- 73)] in + let* i = 0 -- 10 in + return (basis, i)) + test_skip_list_nat_check_invalid_path_with_search; + (* We cheat here to avoid mixing non-pbt tests with pbt tests. *) + Tztest.tztest_qcheck2 + ~name:"Skip list: `search` may not produce minimal path" + ~count:10 + QCheck2.Gen.unit + test_search_non_minimal_back_path; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml new file mode 100644 index 000000000000..9367d4a9a088 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml @@ -0,0 +1,202 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Tez_repr + Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Tez_repr + Dependencies: -- + Subject: To test the modules (including the top-level) + in tez_repr.ml as individual units, particularly + failure cases. Superficial goal: increase coverage percentage. +*) +open Protocol + +open Tztest + +module Test_tez_repr = struct + (** Testing predefined units: zero, one_mutez etc *) + let test_predefined_values () = + let zero_int64 = Tez_repr.to_mutez Tez_repr.zero in + Assert.equal_int64 ~loc:__LOC__ zero_int64 0L >>=? fun () -> + let one_mutez_int64 = Tez_repr.to_mutez Tez_repr.one_mutez in + Assert.equal_int64 ~loc:__LOC__ one_mutez_int64 1L >>=? fun () -> + let one_cent_int64 = Tez_repr.to_mutez Tez_repr.one_cent in + Assert.equal_int64 ~loc:__LOC__ one_cent_int64 10000L >>=? fun () -> + let fifty_cents_int64 = Tez_repr.to_mutez Tez_repr.fifty_cents in + Assert.equal_int64 ~loc:__LOC__ fifty_cents_int64 500000L >>=? fun () -> + let one_int64 = Tez_repr.to_mutez Tez_repr.one in + Assert.equal_int64 ~loc:__LOC__ one_int64 1000000L + + let test_subtract () = + (Lwt.return @@ Tez_repr.(one -? zero)) >|= Environment.wrap_tzresult + >>=? fun res -> + Assert.equal_int64 ~loc:__LOC__ (Tez_repr.to_mutez res) 1000000L + + let test_substract_underflow () = + (Lwt.return @@ Tez_repr.(zero -? one)) >|= Environment.wrap_tzresult + >>= function + | Ok _ -> failwith "Expected to underflow" + | Error _ -> return_unit + + let test_addition () = + (Lwt.return @@ Tez_repr.(one +? zero)) >|= Environment.wrap_tzresult + >>=? fun res -> + Assert.equal_int64 ~loc:__LOC__ (Tez_repr.to_mutez res) 1000000L + + let test_addition_overflow () = + (Lwt.return @@ Tez_repr.(of_mutez_exn 0x7fffffffffffffffL +? one)) + >|= Environment.wrap_tzresult + >>= function + | Ok _ -> failwith "Expected to overflow" + | Error _ -> return_unit + + let test_mul () = + (Lwt.return @@ Tez_repr.(zero *? 1L)) >|= Environment.wrap_tzresult + >>=? fun res -> Assert.equal_int64 ~loc:__LOC__ (Tez_repr.to_mutez res) 0L + + let test_mul_overflow () = + (Lwt.return @@ Tez_repr.(of_mutez_exn 0x7fffffffffffffffL *? 2L)) + >|= Environment.wrap_tzresult + >>= function + | Ok _ -> failwith "Expected to overflow" + | Error _ -> return_unit + + let test_div () = + (Lwt.return @@ Tez_repr.(one *? 1L)) >|= Environment.wrap_tzresult + >>=? fun res -> + Assert.equal_int64 ~loc:__LOC__ (Tez_repr.to_mutez res) 1000000L + + let test_div_by_zero () = + (Lwt.return @@ Tez_repr.(one /? 0L)) >|= Environment.wrap_tzresult + >>= function + | Ok _ -> failwith "Expected to overflow" + | Error _ -> return_unit + + let test_to_mutez () = + let int64v = Tez_repr.(to_mutez one) in + Assert.equal_int64 ~loc:__LOC__ int64v 1000000L + + let test_of_mutez_non_negative () = + match Tez_repr.of_mutez 1000000L with + | Some tz -> + Assert.equal_int64 + ~loc:__LOC__ + (Tez_repr.to_mutez tz) + Tez_repr.(to_mutez one) + | None -> failwith "should have successfully converted 1000000L to tez" + + let test_of_mutez_negative () = + match Tez_repr.of_mutez (-1000000L) with + | Some _ -> failwith "should have failed to converted -1000000L to tez" + | None -> return_unit + + let test_of_mutez_exn () = + try + let tz = Tez_repr.of_mutez_exn 1000000L in + Assert.equal_int64 + ~loc:__LOC__ + (Tez_repr.to_mutez tz) + Tez_repr.(to_mutez one) + with e -> + let msg = Printexc.to_string e and stack = Printexc.get_backtrace () in + failwith "Unexpected exception: %s %s" msg stack + + let test_of_mutez_exn_negative () = + try + let (_ : Tez_repr.t) = Tez_repr.of_mutez_exn (-1000000L) in + failwith "should have failed to converted -1000000L to tez" + with + | Invalid_argument _ -> return_unit + | e -> + let msg = Printexc.to_string e and stack = Printexc.get_backtrace () in + failwith "Unexpected exception: %s %s" msg stack + + (* NOTE: Avoid assertions against too many functions from Tez_repr. Convert them to + int64 and compare instead of using [Tez_repr]'s compare *) + + (** Testing [encoding], int64 underneath, by applying it with Data_encoding *) + let test_data_encoding () = + let encoding = Tez_repr.encoding in + let bytes = + Data_encoding.Binary.to_bytes_exn Data_encoding.n (Z.of_int 1000000) + in + (Data_encoding.Binary.of_bytes encoding bytes |> function + | Ok x -> Lwt.return (Ok x) + | Error e -> + failwith + "Data_encoding.Binary.read shouldn't have failed with \ + Tez_repr.encoding: %a" + Data_encoding.Binary.pp_read_error + e) + >>=? fun v -> Assert.equal_int64 ~loc:__LOC__ (Tez_repr.to_mutez v) 1000000L +end + +let tests = + [ + tztest + "Check if predefined values hold expected values" + `Quick + Test_tez_repr.test_predefined_values; + tztest "Tez.substract: basic behaviour" `Quick Test_tez_repr.test_subtract; + tztest + "Tez.substract: underflow case" + `Quick + Test_tez_repr.test_substract_underflow; + tztest + "Tez.add: basic behaviour (one + zero)" + `Quick + Test_tez_repr.test_addition; + tztest "Tez.add: overflow" `Quick Test_tez_repr.test_addition_overflow; + tztest "Tez.mul: basic case" `Quick Test_tez_repr.test_mul; + tztest "Tez.mul: overflow case" `Quick Test_tez_repr.test_mul_overflow; + tztest "Tez.div: basic case" `Quick Test_tez_repr.test_div; + tztest "Tez.div: division by zero" `Quick Test_tez_repr.test_div_by_zero; + tztest "Tez.to_mutez: basic assertion" `Quick Test_tez_repr.test_to_mutez; + tztest + "Tez.of_mutez: of non-negative ints" + `Quick + Test_tez_repr.test_of_mutez_non_negative; + tztest + "Tez.of_mutez: of non-negative ints" + `Quick + Test_tez_repr.test_of_mutez_non_negative; + tztest + "Tez.of_mutez: of negative ints" + `Quick + Test_tez_repr.test_of_mutez_negative; + tztest + "Tez.of_mutez_exn: of non-negative ints" + `Quick + Test_tez_repr.test_of_mutez_non_negative; + tztest + "Tez.of_mutez_exn: of negative ints" + `Quick + Test_tez_repr.test_of_mutez_negative; + tztest + "Tez.data_encoding: must encode tezzies correctly" + `Quick + Test_tez_repr.test_data_encoding; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml new file mode 100644 index 000000000000..3eb21525727c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml @@ -0,0 +1,45 @@ +(** Testing + ------- + Component: Protocol (time repr) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "^\[Unit\] time$" + Subject: Error handling of time operations +*) + +open Protocol + +let test_nominal_add () = + let t = Time_repr.of_seconds (Int64.of_int 2) in + let addition = + Period_repr.of_seconds Int64.one >>? fun p -> Time_repr.( +? ) t p + in + match addition with + | Ok v -> + Assert.equal + ~loc:__LOC__ + Time_repr.equal + "test_nominal_add" + Time_repr.pp_hum + v + (Time_repr.of_seconds (Int64.of_int 3)) + | Error _ -> failwith "Addition has overflowed" + +let test_overflow_add () = + let t = Time_repr.of_seconds Int64.max_int in + match Period_repr.of_seconds Int64.one with + | Error _ -> failwith "period_repr conversion" + | Ok p -> ( + match Time_repr.( +? ) t p with + | Error _ -> return_unit + | Ok tres -> + failwith + "No overflow: %Ld + %Ld = %Ld" + (Time_repr.to_seconds t) + (Period_repr.to_seconds p) + (Time_repr.to_seconds tres)) + +let tests = + [ + Tztest.tztest "non-overflowing addition" `Quick test_nominal_add; + Tztest.tztest "overflowing addition" `Quick test_overflow_add; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml new file mode 100644 index 000000000000..a9ac5e8e606e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml @@ -0,0 +1,575 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (tx rollup l2) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "tx rollup l2" + Subject: test the layer-2 implementation of transaction rollup +*) + +open Tztest +open Tx_rollup_l2_helpers +open Protocol +open Tx_rollup_l2_context_sig + +(** {1. Storage and context tests. } *) + +let wrap_test t () = + t () >|= function + | Ok x -> Ok x + | Error err -> Error [Environment.Ecoproto_error err] + +let wrap_tztest_tests = + List.map (fun (name, test) -> tztest name `Quick @@ wrap_test test) + +(** {2. Storage tests. } *) + +type Environment.Error_monad.error += Test + +(* FIXME: https://gitlab.com/tezos/tezos/-/issues/2362 + Use the Irmin store provided by [lib_context] for layer-2 + solutions, once available. + As of now, we define a ad-hoc [STORAGE] implementation to run our + tests, but eventually we need to actually make use of the same + implementation as the transaction rollup node and the protocol. *) + +(** [test_irmin_storage] checks that the implementation of [STORAGE] + has the expected properties. *) +let test_irmin_storage () = + let open Irmin_storage.Syntax in + let store = empty_storage in + + let k1 = Bytes.of_string "k1" in + let k2 = Bytes.of_string "k2" in + let v1 = Bytes.of_string "v1" in + let v2 = Bytes.of_string "v2" in + + (* 1. get (set store k1 v1) k1 == Some v1 *) + let* store = Irmin_storage.set store k1 v1 in + let* v1' = Irmin_storage.get store k1 in + assert (v1' = Some v1) ; + + (* 2. k1 != k2 -> get (set store k2 v2) k1 = get store k1*) + let* store = Irmin_storage.set store k2 v2 in + let* v1'' = Irmin_storage.get store k1 in + assert (v1' = v1'') ; + + (* 3. catch (fail e) f return == e *) + let* e = catch (fail Test) (fun _ -> assert false) return in + assert (e = Test) ; + + (* 4. get (remove store k1) k1 = None *) + let* store = Irmin_storage.remove store k1 in + let* v = Irmin_storage.get store k1 in + assert (v = None) ; + + return_unit + +(** {2. Context tests. } *) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2461 + A lot of l2-context properties can be property-based tested. *) + +(** {3. Utils } *) + +let context_with_one_addr = + let open Context_l2 in + let open Syntax in + let ctxt = empty_context in + let _, _, addr1 = gen_l2_address () in + let+ ctxt, _, idx1 = Address_index.get_or_associate_index ctxt addr1 in + (ctxt, idx1) + +let ((_, pk, addr) as l2_addr1) = gen_l2_address () + +(** {3. Test Address_metadata.} *) + +module Test_Address_medata = struct + open Context_l2 + open Address_metadata + open Syntax + + (** Test that an initilized metadata has a counter of zero and is correctly + incremented. *) + let test_init_and_incr () = + let* ctxt, idx = context_with_one_addr in + + let* metadata = get ctxt idx in + assert (metadata = None) ; + + let* ctxt = init_with_public_key ctxt idx pk in + let* metadata = get ctxt idx in + assert (metadata = Some {counter = 0L; public_key = pk}) ; + + let* ctxt = incr_counter ctxt idx in + let* metadata = get ctxt idx in + assert (metadata = Some {counter = 1L; public_key = pk}) ; + + return_unit + + (** Test that initializing an index to a public key fails if the index + has already been initialized. *) + let test_init_twice_fails () = + let* ctxt, idx = context_with_one_addr in + + let* ctxt = init_with_public_key ctxt idx pk in + + let* () = + expect_error + (init_with_public_key ctxt idx pk) + (Metadata_already_initialized (Indexable.index_exn 0l)) + in + + return_unit + + (** Test that incrementing the counter of an unknown index fails. *) + let test_incr_unknown_index () = + let ctxt = empty_context in + + let idx = Indexable.index_exn 0l in + + let* () = + expect_error + (incr_counter ctxt idx) + (Unknown_address_index (Indexable.index_exn 0l)) + in + + return_unit + + (** Test that crediting more than {!Int64.max_int} causes an overflow. *) + let test_counter_overflow () = + let* ctxt, idx = context_with_one_addr in + let* ctxt = init_with_public_key ctxt idx pk in + + let* ctxt = + Internal_for_tests.set ctxt idx {counter = Int64.max_int; public_key = pk} + in + + let* () = expect_error (incr_counter ctxt idx) Counter_overflow in + + return_unit + + let tests = + wrap_tztest_tests + [ + ("test init and increments", test_init_and_incr); + ("test init twice fails", test_init_twice_fails); + ("test incr unknown index", test_incr_unknown_index); + ("test overflow counter", test_counter_overflow); + ] +end + +(** {3. Test indexes. } *) + +module type S = sig + open Context_l2 + + type value + + type index = value Indexable.index + + val name : string + + val init_context_n : int -> (t * value list) m + + val count : t -> int32 m + + val set_count : t -> int32 -> t m + + val get_or_associate_index : + t -> value -> (t * [`Created | `Existed] * index) m + + val get : t -> value -> index option m + + val too_many : Environment.Error_monad.error +end + +module Test_index (Index : S) = struct + let init_context_1 () = + let open Context_l2.Syntax in + let* ctxt, values = Index.init_context_n 1 in + let value = nth_exn values 0 in + return (ctxt, value) + + (** Test that first associating a value creates an index and getting the index + from the value gives the same index. *) + let test_set_and_get () = + let open Context_l2.Syntax in + let* ctxt, value = init_context_1 () in + + let* ctxt, created, idx1 = Index.get_or_associate_index ctxt value in + assert (created = `Created) ; + let* idx2 = Index.get ctxt value in + + assert (Some idx1 = idx2) ; + + return_unit + + (** Test that the empty context has no address indexes and associating a new + address increments the count. *) + let test_associate_fresh_index () = + let open Context_l2.Syntax in + let* ctxt, value = init_context_1 () in + + let* count = Index.count ctxt in + assert (count = 0l) ; + + let* idx = Index.get ctxt value in + assert (idx = None) ; + + let* ctxt, created, idx = Index.get_or_associate_index ctxt value in + assert (created = `Created) ; + let* count = Index.count ctxt in + + assert (count = 1l) ; + assert (idx = Indexable.index_exn 0l) ; + + return_unit + + (** Test that associating twice the same value give the same index. *) + let test_associate_value_twice () = + let open Context_l2.Syntax in + let* ctxt, value = init_context_1 () in + + let expected = Indexable.index_exn 0l in + + let* ctxt, created, idx = Index.get_or_associate_index ctxt value in + assert (created = `Created) ; + assert (idx = expected) ; + + let* idx = Index.get ctxt value in + assert (idx = Some (Indexable.index_exn 0l)) ; + + let* ctxt, existed, idx = Index.get_or_associate_index ctxt value in + assert (existed = `Existed) ; + assert (idx = expected) ; + + let* count = Index.count ctxt in + assert (count = 1l) ; + + return_unit + + let test_reach_too_many_l2 () = + let open Context_l2.Syntax in + let* ctxt, value = init_context_1 () in + let* ctxt = Index.set_count ctxt Int32.max_int in + + let* () = + expect_error (Index.get_or_associate_index ctxt value) Index.too_many + in + + return_unit + + let tests = + wrap_tztest_tests + [ + ("test set and get", test_set_and_get); + ("test associate fresh index", test_associate_fresh_index); + ("test associate same value twice", test_associate_value_twice); + ("test the limit of indexes", test_reach_too_many_l2); + ] +end + +module Test_Address_index = Test_index (struct + include Context_l2.Address_index + + let name = "Address" + + type value = Tx_rollup_l2_address.t + + type index = value Indexable.index + + let init_context_n n = + let open Context_l2.Syntax in + let ctxt = empty_context in + let addresses = gen_n_address n in + let addresses = List.map (fun (_, _, x) -> x) addresses in + return (ctxt, addresses) + + let set_count = Internal_for_tests.set_count + + let too_many = Too_many_l2_addresses +end) + +(** [gen_n_ticket_hash n] generates [n] {!Alpha_context.Ticket_hash.t} based on + {!gen_n_address} and {!make_unit_ticket_key}. + + TODO: Is there a more convenient way to forge such hashes? Are dumb hashes + enough? +*) +let gen_n_ticket_hash n = + let x = + Lwt_main.run + ( Context.init_n n () >>=? fun (_b, contracts) -> + let addressess = gen_n_address n in + let tickets = + List.map2 + ~when_different_lengths:[] + (fun contract (_, _, address) -> + Tx_rollup_l2_helpers.make_unit_ticket_key contract address) + contracts + addressess + in + match tickets with Ok x -> return x | Error _ -> assert false ) + in + + match x with Ok x -> x | Error _ -> assert false + +module Test_Ticket_index = Test_index (struct + include Context_l2.Ticket_index + + let name = "Ticket" + + type value = Alpha_context.Ticket_hash.t + + type index = value Indexable.index + + let init_context_n n = + let open Context_l2.Syntax in + let ctxt = empty_context in + let tickets = gen_n_ticket_hash n in + return (ctxt, tickets) + + let set_count = Internal_for_tests.set_count + + let too_many = Too_many_l2_tickets +end) + +module Test_Ticket_ledger = struct + open Context_l2 + open Ticket_ledger + open Syntax + + let ticket_idx1 = Indexable.index_exn 0l + + (** Test that crediting a ticket index to an index behaves correctly. *) + let test_credit () = + let* ctxt, idx1 = context_with_one_addr in + + let* amount = get ctxt ticket_idx1 idx1 in + assert (Tx_rollup_l2_qty.(amount = zero)) ; + + let one = Tx_rollup_l2_qty.of_int64_exn 1L in + let* ctxt = credit ctxt ticket_idx1 idx1 one in + let* amount = get ctxt ticket_idx1 idx1 in + assert (Tx_rollup_l2_qty.(amount = one)) ; + + return_unit + + (** Test that crediting more than {!Int64.max_int} causes an overflow. *) + let test_credit_too_much () = + let* ctxt, idx1 = context_with_one_addr in + + let* ctxt = + credit ctxt ticket_idx1 idx1 (Tx_rollup_l2_qty.of_int64_exn Int64.max_int) + in + + let* () = + expect_error + (credit ctxt ticket_idx1 idx1 (Tx_rollup_l2_qty.of_int64_exn Int64.one)) + Balance_overflow + in + + return_unit + + (** Test that an index can be credited ticket indexes even if its not associated + to an address. *) + let test_credit_unknown_index () = + let ctxt = empty_context in + let* (_ctxt : t) = + credit + ctxt + ticket_idx1 + (Indexable.index_exn 0l) + (Tx_rollup_l2_qty.of_int64_exn 1L) + in + return_unit + + (** Test that spending a ticket from an index to another one behaves correctly *) + let test_spend_valid () = + let* ctxt, idx1 = context_with_one_addr in + + let* ctxt = + credit ctxt ticket_idx1 idx1 (Tx_rollup_l2_qty.of_int64_exn 10L) + in + + let* amount = get ctxt ticket_idx1 idx1 in + assert (Tx_rollup_l2_qty.(amount = of_int64_exn 10L)) ; + + let* ctxt = + spend ctxt ticket_idx1 idx1 (Tx_rollup_l2_qty.of_int64_exn 5L) + in + + let* amount = get ctxt ticket_idx1 idx1 in + assert (Tx_rollup_l2_qty.(amount = of_int64_exn 5L)) ; + + return_unit + + (** Test that spending a ticket without the required balance fails. *) + let test_spend_without_balance () = + let* ctxt, idx1 = context_with_one_addr in + + let* () = + expect_error + (spend ctxt ticket_idx1 idx1 (Tx_rollup_l2_qty.of_int64_exn 1L)) + Balance_too_low + in + + return_unit + + let test_remove_empty_balance () = + let* ctxt, idx1 = context_with_one_addr in + + let* ctxt = credit ctxt ticket_idx1 idx1 Tx_rollup_l2_qty.one in + let* qty = Internal_for_tests.get_opt ctxt ticket_idx1 idx1 in + assert (qty = Some Tx_rollup_l2_qty.one) ; + + let* ctxt = spend ctxt ticket_idx1 idx1 Tx_rollup_l2_qty.one in + let* qty = Internal_for_tests.get_opt ctxt ticket_idx1 idx1 in + assert (qty = None) ; + + let* qty = get ctxt ticket_idx1 idx1 in + assert (qty = Tx_rollup_l2_qty.zero) ; + + return_unit + + let tests = + wrap_tztest_tests + [ + ("test credit", test_credit); + ("test credit too much", test_credit_too_much); + ("test credit unknown index", test_credit_unknown_index); + ("test spend", test_spend_valid); + ("test spend without required balance", test_spend_without_balance); + ("test remove empty balance", test_remove_empty_balance); + ] +end + +(* ------ L2 Batch encodings ------------------------------------------------ *) + +module Test_batch_encodings = struct + open Lwt_result_syntax + open Protocol.Tx_rollup_l2_batch.V1 + open Data_encoding + + (* Encoding from compact encoding *) + let operation_content_encoding = + Compact.make ~tag_size:`Uint8 compact_operation_content + + let operation_encoding = Compact.make ~tag_size:`Uint8 compact_operation + + let transaction_encoding = Compact.make ~tag_size:`Uint8 compact_transaction + + (* Helper functions to encode and decode *) + let encode_content op = Binary.to_bytes_exn operation_content_encoding op + + let decode_content buffer = + Data_encoding.Binary.of_bytes_exn operation_content_encoding buffer + + let encode_operation op = Binary.to_bytes_exn operation_encoding op + + let decode_operation buffer = Binary.of_bytes_exn operation_encoding buffer + + let encode_transaction t = Binary.to_bytes_exn transaction_encoding t + + let decode_transaction buffer = + Binary.of_bytes_exn transaction_encoding buffer + + let operation_content_pp fmt = function + | Transfer {destination; ticket_hash; qty} -> + Format.fprintf + fmt + "@[<hov 2>Transfer:@ destination=%a,@ ticket_hash=%a,@ qty:%a@]" + Tx_rollup_l2_address.Indexable.pp + destination + Tx_rollup_l2_context_sig.Ticket_indexable.pp + ticket_hash + Tx_rollup_l2_qty.pp + qty + | Withdraw {destination; ticket_hash; qty} -> + Format.fprintf + fmt + "@[<hov 2>Withdraw:@ destination=%a,@ ticket_hash=%a,@ qty:%a@]" + Tezos_crypto.Signature.Public_key_hash.pp + destination + Alpha_context.Ticket_hash.pp + ticket_hash + Tx_rollup_l2_qty.pp + qty + + let test_l2_transaction_size () = + (* Assert the smallest operation_content size is 5 *) + let opc = + Transfer + { + destination = Indexable.from_index_exn 0l; + ticket_hash = Indexable.from_index_exn 1l; + qty = Tx_rollup_l2_qty.of_int64_exn 12L; + } + in + let buffer = encode_content opc in + let opc' = decode_content buffer in + + Alcotest.(check int "smallest operation content" 4 (Bytes.length buffer)) ; + assert (opc = opc') ; + + (* Assert the smallest operation size is 7 *) + let op = + {signer = Indexable.from_index_exn 2l; counter = 0L; contents = [opc]} + in + let buffer = encode_operation op in + let op' = decode_operation buffer in + + Alcotest.(check int "smallest operation" 7 (Bytes.length buffer)) ; + assert (op = op') ; + + (* Assert the smallest transaction size is 8 *) + let t = [op] in + let buffer = encode_transaction t in + let t' = decode_transaction buffer in + + Alcotest.(check int "smallest transaction" 8 (Bytes.length buffer)) ; + assert (t = t') ; + + return_unit + + let tests = + [ + tztest + "test layer-2 transaction encoding size" + `Quick + test_l2_transaction_size; + ] +end + +let tests = + [tztest "test irmin storage" `Quick @@ wrap_test test_irmin_storage] + @ Test_Address_index.tests @ Test_Ticket_index.tests + @ Test_Address_medata.tests @ Test_Ticket_ledger.tests + @ Test_batch_encodings.tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml new file mode 100644 index 000000000000..767190f5ba0e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml @@ -0,0 +1,1796 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (tx rollup l2) + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- test "tx rollup l2 apply" + Subject: test the layer-2 apply implementation of transaction rollup +*) + +open Tztest +open Tx_rollup_l2_helpers +open Protocol +open Alpha_context +open Apply_l2 +open Context_l2 +open Tx_rollup_message +open Tx_rollup_l2_apply +open Tx_rollup_l2_batch.V1 +open Indexable + +(** {2. Utils. } *) + +(** {3. Various helpers to facilitate the tests. } *) + +let pkh = Tezos_crypto.Signature.Public_key_hash.zero + +let ((_, pk1, addr1) as l2_addr1) = gen_l2_address () + +let ((_, pk2, addr2) as l2_addr2) = gen_l2_address () + +let wrap_test t () = + t () >|= function + | Ok x -> Ok x + | Error err -> Error [Environment.Ecoproto_error err] + +let wrap_tztest_tests = + List.map (fun (name, test) -> tztest name `Quick @@ wrap_test test) + +let get_opt = function + | Some x -> return x + | None -> fail_msg "Expected a Some value" + +let expect_error_status ~msg error status cont = + let open Message_result in + match status with + | Transaction_success -> fail_msg msg + | Transaction_failure {reason; _} when error = reason -> cont + | Transaction_failure {reason; _} -> + let msg = + Format.asprintf + "Expected error: %a\nActual error: %a\n" + Environment.Error_monad.pp + error + Environment.Error_monad.pp + reason + in + fail_msg msg + +let aggregate_signature_exn : signature list -> signature = + fun signatures -> + match Tezos_crypto.Bls.aggregate_signature_opt signatures with + | Some res -> res + | None -> raise (Invalid_argument "aggregate_signature_exn") + +let ticket1, ticket2 = + match gen_n_ticket_hash 2 with [x; y] -> (x, y) | _ -> assert false + +let empty_indexes = {address_indexes = []; ticket_indexes = []} + +let unexpected_result = fail_msg "Unexpected result operation" + +let signer_of_address_index : + Tx_rollup_l2_address.Indexable.index -> + Tx_rollup_l2_batch.Signer_indexable.index = + fun x -> Indexable.(index_exn (to_int32 x)) + +(** {3. Various Alcotest helpers to check the context. } *) + +let eq_qty = Alcotest.of_pp Tx_rollup_l2_qty.pp + +let check_balance ctxt name_account name_ticket description tidx aidx + expected_value = + let open Syntax in + let expected_value = Tx_rollup_l2_qty.of_int64_exn expected_value in + let* res = Ticket_ledger.get ctxt tidx aidx in + Alcotest.( + check + eq_qty + (Format.sprintf + "balance for %s of %s (%s)" + name_account + name_ticket + description) + expected_value + res) ; + return () + +let pp_metadata fmt Tx_rollup_l2_context_sig.{counter; public_key} = + let counter = Int64.to_int counter in + Format.fprintf + fmt + "{counter=%d; public_key=%a}" + counter + Tezos_crypto.Bls.Public_key.pp + public_key + +let eq_metadata = Alcotest.of_pp pp_metadata + +let check_metadata ctxt name_account description counter addr pk = + let open Syntax in + (* We ignore the created [ctxt] because it should be a get only. *) + let* _ctxt, _, aidx = Address_index.get_or_associate_index ctxt addr in + let* metadata = Address_metadata.get ctxt aidx in + Alcotest.( + check + (option eq_metadata) + (Format.sprintf "metadata for %s (%s)" name_account description) + (Some Tx_rollup_l2_context_sig.{counter; public_key = pk}) + metadata) ; + return () + +let eq_address = Alcotest.of_pp Tx_rollup_l2_address.pp + +let eq_ticket = Alcotest.of_pp Ticket_hash.pp + +let pp_withdrawal fmt = function + | Tx_rollup_withdraw.{claimer; ticket_hash; amount} -> + Format.fprintf + fmt + "{claimer=%a; ticket_hash=%a; amount=%a}" + Tezos_crypto.Signature.Public_key_hash.pp + claimer + Ticket_hash.pp + ticket_hash + Tx_rollup_l2_qty.pp + amount + +let eq_withdrawal = Alcotest.of_pp pp_withdrawal + +let check_indexes expected_addr_indexes expected_ticket_indexes indexes = + let open Syntax in + let strip_indexes l = + List.map (fun (v, idx) -> (v, Indexable.to_int32 idx)) l + |> List.sort (fun x y -> Int32.compare (snd x) (snd y)) + in + Alcotest.( + check + (list (pair eq_address int32)) + "indexables address created" + expected_addr_indexes + (strip_indexes indexes.address_indexes)) ; + Alcotest.( + check + (list (pair eq_ticket int32)) + "indexables ticket created" + expected_ticket_indexes + (strip_indexes indexes.ticket_indexes)) ; + return () + +(** {3. Helpers to build apply related values. } *) + +let with_initial_setup tickets contracts = + let open Context_l2.Syntax in + let ctxt = empty_context in + + let* ctxt, rev_tidxs = + list_fold_left_m + (fun (ctxt, rev_tidxs) ticket -> + let* ctxt, _, tidx = Ticket_index.get_or_associate_index ctxt ticket in + return (ctxt, tidx :: rev_tidxs)) + (ctxt, []) + tickets + in + let tidxs = List.rev rev_tidxs in + + let* ctxt, rev_contracts = + list_fold_left_m + (fun (ctxt, rev_contracts) balances -> + let pkh, _, _ = gen_l1_address () in + let sk, pk, addr = gen_l2_address () in + let* ctxt, _, idx = Address_index.get_or_associate_index ctxt addr in + + let* ctxt = + list_fold_left_m + (fun ctxt (ticket, qty) -> + let qty = Tx_rollup_l2_qty.of_int64_exn qty in + let* ctxt, _, tidx = + Ticket_index.get_or_associate_index ctxt ticket + in + Ticket_ledger.credit ctxt tidx idx qty) + ctxt + balances + in + + return (ctxt, (sk, pk, addr, idx, pkh) :: rev_contracts)) + (ctxt, []) + contracts + in + let rev_contracts = List.rev rev_contracts in + + return (ctxt, tidxs, rev_contracts) + +let operation_content ?(counter = 1L) ~signer content = + let open Tx_rollup_l2_batch.V1 in + {signer = from_value signer; counter; contents = [content]} + +let transfer ?counter ~signer ~dest ~ticket qty = + let qty = Tx_rollup_l2_qty.of_int64_exn qty in + let content = + Transfer + {destination = from_value dest; ticket_hash = from_value ticket; qty} + in + operation_content ?counter ~signer content + +let signer_pk x = Tx_rollup_l2_batch.Bls_pk x + +let signer_addr x = Tx_rollup_l2_batch.L2_addr x + +let withdraw ?counter ~signer ~dest ~ticket qty = + let qty = Tx_rollup_l2_qty.of_int64_exn qty in + let content = Withdraw {destination = dest; ticket_hash = ticket; qty} in + operation_content ?counter ~signer content + +let transfers = + List.map (fun (pk_source, dest, ticket, amount, counter) -> + transfer ~signer:pk_source ~dest ~ticket ?counter amount) + +let batch signatures contents = + let open Tx_rollup_l2_batch.V1 in + let aggregated_signature = aggregate_signature_exn signatures in + {aggregated_signature; contents} + +let create_batch_v1 + (transactions : ('signer, 'content) Tx_rollup_l2_batch.V1.transaction list) + sks_l = + assert (List.(length transactions = length sks_l)) ; + let signatures = + List.map2 + ~when_different_lengths:[] + (fun transaction sks -> sign_transaction sks transaction) + transactions + sks_l + |> function + | Ok xs -> List.concat xs + | _ -> assert false + in + batch signatures transactions + +(** Takes almost the same parameters as {!transfers} but takes also the + secret keys to sign and create a valid message. *) +let batch_from_transfers inputs = + let all_sks = + List.fold_left + (fun all_sks input -> + List.fold_left + (fun acc (sk, _, _, _, _, _) -> + if List.mem ~equal:Tezos_crypto.Bls.Secret_key.equal sk acc then acc + else sk :: acc) + [] + input + :: all_sks) + [] + inputs + in + let transactions = + List.fold_left + (fun transactions input -> + List.map + (fun (_, pk, dest, ticket, amount, counter) -> + transfer ~signer:(signer_pk pk) ~dest ~ticket ?counter amount) + input + :: transactions) + [] + inputs + in + let batch = create_batch_v1 (List.rev transactions) (List.rev all_sks) in + let buf = + Data_encoding.Binary.to_string_exn Tx_rollup_l2_batch.encoding (V1 batch) + in + make_batch buf |> fst + +(** {2. Tests } *) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2461 + A lot of l2-context properties can be property-based tested. *) + +(** Test that deposit tickets in the layer2 updates the context. *) +let test_simple_deposit () = + let open Context_l2.Syntax in + let ctxt = empty_context in + let amount = Tx_rollup_l2_qty.of_int64_exn 50L in + + let deposit = + {sender = pkh; destination = value addr1; ticket_hash = ticket1; amount} + in + let* ctxt, result, withdrawal_opt = apply_deposit ctxt deposit in + + (* Applying the deposit should create an idx for both [addr1] and [ticket]. *) + match (result, withdrawal_opt) with + | Deposit_success indexes, None -> + let* () = check_indexes [(addr1, 0l)] [(ticket1, 0l)] indexes in + let* aidx_opt = Address_index.get ctxt addr1 in + let* aidx = get_opt aidx_opt in + + let* tidx_opt = Ticket_index.get ctxt ticket1 in + let* tidx = get_opt tidx_opt in + + let* amount' = Context_l2.Ticket_ledger.get ctxt tidx aidx in + assert (amount = amount') ; + + return_unit + | _ -> unexpected_result + +(** Test that deposit overflow withdraws the amount sent. *) +let test_returned_deposit () = + let open Context_l2.Syntax in + let balance = Int64.max_int in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1] [[(ticket1, balance)]] + in + let tidx1 = nth_exn tidxs 0 in + let _sk1, _pk1, addr1, idx1, pkh = nth_exn accounts 0 in + + (* my cup runneth over *) + let amount = Tx_rollup_l2_qty.one in + let deposit = + {sender = pkh; destination = value addr1; ticket_hash = ticket1; amount} + in + let* ctxt, result, withdrawal_opt = apply_deposit ctxt deposit in + + (* Applying the deposit will result in a Deposit_failure, an + unchanged context and a withdrawal of the deposit *) + match (result, withdrawal_opt) with + | Deposit_failure Tx_rollup_l2_context_sig.Balance_overflow, Some withdrawal + -> + (* balance is unchanged *) + let* balance' = Context_l2.Ticket_ledger.get ctxt tidx1 idx1 in + Alcotest.( + check + eq_qty + "An overflowing deposit should not modify balance" + (Tx_rollup_l2_qty.of_int64_exn balance) + balance') ; + Alcotest.( + check + eq_withdrawal + "Resulting withdrawal from overflowing L1->L2 deposit" + withdrawal + {claimer = pkh; ticket_hash = ticket1; amount}) ; + return_unit + | Deposit_failure reason, _ -> + let msg = + Format.asprintf + "Unexpected failure for overflowing deposit: %a" + Environment.Error_monad.pp + reason + in + fail_msg msg + | Deposit_success _result, _ -> + fail_msg "Did not expect overflowing deposit to be succesful" + +let apply_l2_parameters : Protocol.Tx_rollup_l2_apply.parameters = + {tx_rollup_max_withdrawals_per_batch = 5} + +let apply_l2_batch ctxt batch = + Batch_V1.apply_batch ctxt apply_l2_parameters batch + +let apply_l2_message ctxt msg = apply_message ctxt apply_l2_parameters msg + +let test_indexes_creation_bad () = + let open Context_l2.Syntax in + let ctxt = empty_context in + let contracts = gen_n_address 3 in + + let sk1, pk1, addr1 = nth_exn contracts 0 in + let _, _, addr2 = nth_exn contracts 1 in + let _, _, addr3 = nth_exn contracts 2 in + + let deposit = + { + sender = pkh; + destination = value addr1; + ticket_hash = ticket1; + amount = Tx_rollup_l2_qty.of_int64_exn 20L; + } + in + let* ctxt, _, _withdrawal_opt = apply_deposit ctxt deposit in + + let transaction1 = + (* This transaction will fail because the number of tickets required is + more than its own. *) + [ + transfer + ~counter:1L + ~signer:(signer_pk pk1) + ~dest:addr2 + ~ticket:ticket1 + 10000L; + ] + in + let signature1 = sign_transaction [sk1] transaction1 in + let transaction2 = + (* This is ok *) + [ + transfer ~counter:2L ~signer:(signer_pk pk1) ~dest:addr3 ~ticket:ticket1 1L; + ] + in + let signature2 = sign_transaction [sk1] transaction2 in + + let batch = + batch (List.concat [signature1; signature2]) [transaction1; transaction2] + in + + let* ctxt, Batch_result {results; indexes}, _withdrawals = + apply_l2_batch ctxt batch + in + + (* Only the indexes from the second transaction should exist, the first + should have failed *) + let* () = + match results with + | [(_t1, Transaction_failure _); (_t2, Transaction_success)] -> return_unit + | _ -> assert false + in + + let* () = check_indexes [(addr3, 1l)] [] indexes in + + let* idx = Address_index.get ctxt addr2 in + assert (idx = None) ; + + let* idx = Address_index.get ctxt addr3 in + assert (idx = Some (index_exn 1l)) ; + + return_unit + +(** The test consists of [addr1] sending [ticket1] to [addr2]. + In exchange [addr2] will send [ticket2] to [addr1]. We check both + the transaction's status and the balances afterwards. *) +let test_simple_l2_transaction () = + let open Context_l2.Syntax in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + let sk1, pk1, addr1, idx1, _ = nth_exn accounts 0 in + let sk2, pk2, addr2, idx2, _ = nth_exn accounts 1 in + + (* Then, we build a transaction with: + [addr1] -> [addr2] & [addr2] -> [addr1]. *) + let transaction = + transfers + [ + (signer_pk pk1, addr2, ticket1, 10L, None); + (signer_pk pk2, addr1, ticket2, 20L, None); + ] + in + let batch = create_batch_v1 [transaction] [[sk1; sk2]] in + + let* ctxt, Batch_result {results; _}, _withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + match (status, _withdrawals) with + | Transaction_success, [] -> + (* Check the balance after the transaction has been applied, we omit + the check the indexes to not pollute this test. *) + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be emptied" + tidx1 + idx1 + 0L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket1 should be credited" + tidx1 + idx2 + 10L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr2.ticket2 should be emptied" + tidx2 + idx2 + 0L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr1.ticket2 should be credited" + tidx2 + idx1 + 20L + in + return_unit + | Transaction_success, _ -> fail_msg "Did not expect any withdrawals" + | Transaction_failure _, _ -> fail_msg "The transaction should be a success" + +(** Test that a signer can be layer2 address. *) +let test_l2_transaction_l2_addr_signer_good () = + let open Context_l2 in + let open Syntax in + let* ctxt, _tidxs, accounts = with_initial_setup [] [[(ticket1, 10L)]; []] in + let sk1, pk1, addr1, idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, addr2, _idx2, _pkh2 = nth_exn accounts 1 in + let* ctxt = Address_metadata.init_with_public_key ctxt idx1 pk1 in + let transfer = + [transfer ~signer:(signer_addr addr1) ~dest:addr2 ~ticket:ticket1 10L] + in + let signature = sign_transaction [sk1] transfer in + let batch = batch signature [transfer] in + let* _ctxt, Batch_result {results; indexes = _}, _withdrawals = + apply_l2_batch ctxt batch + in + let status = nth_exn results 0 in + match status with + | _, Transaction_success -> return_unit + | _, Transaction_failure _ -> fail_msg "The transaction should be a success" + +(** Test that signing with a layer2 address needs a proper context. *) +let test_l2_transaction_l2_addr_signer_bad () = + let open Context_l2 in + let open Syntax in + let ctxt = empty_context in + let sk1, pk1, addr1 = gen_l2_address () in + let _sk2, _pk2, addr2 = gen_l2_address () in + (* The address has no index in the context *) + let transfer = + [transfer ~signer:(signer_addr addr1) ~dest:addr2 ~ticket:ticket1 10L] + in + let signature = sign_transaction [sk1] transfer in + let batch = batch signature [transfer] in + let* () = + expect_error + ~msg_if_valid:"The check should fail with an unknown address" + (apply_l2_batch ctxt batch) + (Tx_rollup_l2_apply.Unknown_address addr1) + in + (* Now we add the index but the metadata is still missing *) + let* ctxt, _, idx1 = Address_index.get_or_associate_index ctxt addr1 in + let* () = + expect_error + ~msg_if_valid:"The check should fail with unknown metadata" + (apply_l2_batch ctxt batch) + (Tx_rollup_l2_apply.Unallocated_metadata 0l) + in + (* Finally we add the metadata and the test pass *) + let* ctxt = Address_metadata.init_with_public_key ctxt idx1 pk1 in + let* ctxt, _, tidx = Ticket_index.get_or_associate_index ctxt ticket1 in + let* ctxt = + Ticket_ledger.credit ctxt tidx idx1 (Tx_rollup_l2_qty.of_int64_exn 100L) + in + let* _ctxt, Batch_result {results; indexes = _}, _withdrawals = + apply_l2_batch ctxt batch + in + let status = nth_exn results 0 in + match status with + | _, Transaction_success -> return_unit + | _, Transaction_failure _ -> fail_msg "The transaction should succeed" + +(** The test consists of [pk1] sending [ticket1] to [pkh2]. + This results in a withdrawal. *) +let test_simple_l1_transaction () = + let open Context_l2.Syntax in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1] [[(ticket1, 10L)]; []] + in + + let tidx1 = nth_exn tidxs 0 in + + let sk1, pk1, _addr1, idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, _idx2, pkh2 = nth_exn accounts 1 in + + (* Then, we build a transaction with: + [addr1] -> [pkh2] *) + let withdraw = + withdraw ~signer:(signer_pk pk1) ~dest:pkh2 ~ticket:ticket1 10L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + match (status, withdrawals) with + | Transaction_success, [withdrawal] -> + (* Check the balance after the transaction has been applied, we omit + the check the indexes to not pollute this test. *) + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be emptied" + tidx1 + idx1 + 0L + in + Alcotest.( + check + eq_withdrawal + "Resulting withdrawal from L2->L1 transfer" + withdrawal + { + claimer = pkh2; + ticket_hash = ticket1; + amount = Tx_rollup_l2_qty.of_int64_exn 10L; + }) ; + return_unit + | Transaction_success, _ -> fail_msg "Expected exactly one withdrawal" + | Transaction_failure _, _ -> fail_msg "The transaction should be a success" + +let rec repeat n f acc = if n <= 0 then acc else repeat (n - 1) f (f n acc) + +(** This function crafts a batch containing [nb_withdraws]. Then, it applies it + on an L2 context, and checks the status, depending on the value of + [should_succeed] *) +let helper_test_withdrawal_limits_per_batch nb_withdraws ~should_succeed = + let open Context_l2.Syntax in + (* create sufficiently many accounts *) + let accounts = repeat nb_withdraws (fun _i l -> [(ticket1, 2L)] :: l) [] in + let* ctxt, _tidxs, accounts = with_initial_setup [ticket1] ([] :: accounts) in + (* destination of withdrawals *) + let _skD, _pkD, _addrD, _idxD, pkhD = nth_exn accounts 0 in + (* transfer 1 ticket from [nb_withdraws] accounts to the dest *) + let transactions, sks = + repeat + nb_withdraws + (fun i (transactions, sks) -> + let sk, pk, _addr, _idx, _pkh = nth_exn accounts i in + let withdraw = + withdraw ~signer:(signer_pk pk) ~dest:pkhD ~ticket:ticket1 1L + in + (withdraw :: transactions, sk :: sks)) + ([], []) + in + let batch = create_batch_v1 [transactions] [sks] in + (* apply the batch, and handle the success and error cases *) + Irmin_storage.Syntax.catch + (apply_l2_batch ctxt batch) + (fun _success -> + if should_succeed then return_unit + else fail_msg "The transaction should fail") + (fun error -> + let expected_error = "Maximum tx-rollup withdraws per message exceeded" in + let ({title = error_title; _} as _error_info) = + Error_monad.find_info_of_error (Environment.wrap_tzerror error) + in + if should_succeed then + fail_msg + ("The transaction should be a success, but failed: " ^ error_title) + else if error_title <> expected_error then + fail_msg + @@ Format.sprintf + "Expected error %s but got %s" + expected_error + error_title + else return_unit) + +(* Three tests that use the helper above *) +let nb_withdrawals_per_batch_below_limit () = + helper_test_withdrawal_limits_per_batch + (apply_l2_parameters.tx_rollup_max_withdrawals_per_batch - 1) + ~should_succeed:true + +let nb_withdrawals_per_batch_equals_limit () = + helper_test_withdrawal_limits_per_batch + apply_l2_parameters.tx_rollup_max_withdrawals_per_batch + ~should_succeed:true + +let nb_withdrawals_per_batch_above_limit () = + helper_test_withdrawal_limits_per_batch + (apply_l2_parameters.tx_rollup_max_withdrawals_per_batch + 1) + ~should_succeed:false + +(** Test that [Missing_ticket] is raised if a transfer is attempted to + a ticket absent from the rollup. *) +let test_l1_transaction_inexistant_ticket () = + let open Context_l2.Syntax in + (* empty context *) + let* ctxt, _tidxs, accounts = with_initial_setup [] [[]; []] in + + let sk1, pk1, _addr1, _idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, _idx2, pkh2 = nth_exn accounts 1 in + + (* We build an invalid transaction with: [addr1] -> [pkh2] *) + let withdraw = + withdraw ~signer:(signer_pk pk1) ~dest:pkh2 ~ticket:ticket1 10L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* _ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + (* Expect no withdrawals *) + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 transfer" + withdrawals + []) ; + + (* Expect error returned *) + let status = nth_exn results 0 |> snd in + expect_error_status + ~msg:"an invalid transaction must fail" + (Tx_rollup_l2_apply.Missing_ticket ticket1) + status + return_unit + +(** If the signer of a L2->L1 transaction does not exist (has no balance), + then batch application fails with Balance_too_low. *) +let test_l1_transaction_inexistant_signer () = + let open Context_l2.Syntax in + let* ctxt, _tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let _sk1, _pk1, _addr1, _idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, _idx2, pkh2 = nth_exn accounts 1 in + let sk_unknown, pk_unknown, _ = gen_l2_address () in + + (* Then, we build an invalid transaction with: + [pk_unknown] -> [pkh2] *) + let withdraw = + withdraw ~signer:(signer_pk pk_unknown) ~dest:pkh2 ~ticket:ticket1 10L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk_unknown]] in + + let* _ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + (* Expect no withdrawals *) + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 transfer" + withdrawals + []) ; + + (* Expect error returned *) + let status = nth_exn results 0 |> snd in + expect_error_status + ~msg:"an invalid transaction must fail" + Tx_rollup_l2_context_sig.Balance_too_low + status + return_unit + +(** Test that [Balance_too_low] is raised if a transfer is attempted with a + quantity superior to the senders balance. *) +let test_l1_transaction_overdraft () = + let open Context_l2.Syntax in + let initial_balances = [[(ticket1, 10L)]; [(ticket2, 20L)]] in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] initial_balances + in + + let sk1, pk1, _addr1, idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, idx2, pkh2 = nth_exn accounts 1 in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + (* Then, we build an transaction with: [addr1] -> [pkh2] where addr1 attempts to spend too much*) + let withdraw = + withdraw ~signer:(signer_pk pk1) ~dest:pkh2 ~ticket:ticket1 30L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + (* Expect no withdrawals *) + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 transfer" + withdrawals + []) ; + + (* Expect error returned *) + let status = nth_exn results 0 |> snd in + expect_error_status + ~msg:"an invalid transaction must fail" + Tx_rollup_l2_context_sig.Balance_too_low + status + (let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be unchanged" + tidx1 + idx1 + 10L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket1 should be unchanged" + tidx2 + idx2 + 20L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr1.ticket2 should be unchanged (empty)" + tidx2 + idx1 + 0L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr2.ticket1 should be unchanged (empty)" + tidx1 + idx2 + 0L + in + return_unit) + +(** Test that withdrawals with quantity zero are not possible. *) +let test_l1_transaction_zero () = + let open Context_l2.Syntax in + let initial_balances = [[(ticket1, 10L)]; [(ticket2, 20L)]] in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] initial_balances + in + + let sk1, pk1, _addr1, idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, idx2, pkh2 = nth_exn accounts 1 in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + (* Then, we build an transaction with: [addr1] -> [pkh2] with amount 0 *) + let withdraw = + withdraw ~signer:(signer_pk pk1) ~dest:pkh2 ~ticket:ticket1 0L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + (* Expect one zero-withdrawal *) + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 transfer" + [] + withdrawals) ; + + match results with + | [ + ( [_], + Transaction_failure + {index = 0; reason = Tx_rollup_l2_apply.Invalid_zero_transfer} ); + ] -> + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be unchanged" + tidx1 + idx1 + 10L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket2 should be unchanged" + tidx2 + idx2 + 20L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr1.ticket2 should be unchanged (empty)" + tidx2 + idx1 + 0L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr2.ticket1 should be unchanged (empty)" + tidx1 + idx2 + 0L + in + return_unit + | _ -> fail_msg "Zero-transactions should be a failure" + +(** Test partial L2 to L1 transaction. Ensure that a withdrawal is emitted + for the transferred amount and that the remainder is in the sender's + account. *) +let test_l1_transaction_partial () = + let open Context_l2.Syntax in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let sk1, pk1, _addr1, idx1, _pkh1 = nth_exn accounts 0 in + let _sk2, _pk2, _addr2, idx2, pkh2 = nth_exn accounts 1 in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + (* Then, we build an transaction with: [addr1] -> [pkh2] , addr1 spending the ticket partially *) + let withdraw = + withdraw ~signer:(signer_pk pk1) ~dest:pkh2 ~ticket:ticket1 5L + in + let transaction = [withdraw] in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + (* Expect one partial withdrawal *) + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 transfer" + withdrawals + [ + { + claimer = pkh2; + ticket_hash = ticket1; + amount = Tx_rollup_l2_qty.of_int64_exn 5L; + }; + ]) ; + + match results with + | [([_], Transaction_success)] -> + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be debited" + tidx1 + idx1 + 5L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket2 should be unchanged" + tidx2 + idx2 + 20L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr1.ticket2 should be unchanged (empty)" + tidx2 + idx1 + 0L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr2.ticket1 should be unchanged (empty)" + tidx1 + idx2 + 0L + in + return_unit + | _ -> fail_msg "Zero-transactions should be successful" + +(** Test that a valid transaction containing both indexes and values is a + success. *) +let test_transaction_with_unknown_indexable () = + let open Context_l2.Syntax in + let open Tx_rollup_l2_batch.V1 in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + let sk1, pk1, addr1, aidx1, _ = nth_exn accounts 0 in + let sk2, pk2, addr2, aidx2, _ = nth_exn accounts 1 in + + (* Note that {!with_initial_setup} does not initialize metadatas for the + public keys. If it was the case, we could not use this function + to test the pre processing of operations during the application of a + batch. + *) + let* ctxt = Address_metadata.init_with_public_key ctxt aidx1 pk1 in + let* ctxt = Address_metadata.init_with_public_key ctxt aidx2 pk2 in + + let transfer1 : (Indexable.unknown, Indexable.unknown) operation = + { + signer = from_value (signer_pk pk1); + counter = 1L; + contents = + [ + Transfer + { + destination = forget aidx2; + ticket_hash = from_value ticket1; + qty = Tx_rollup_l2_qty.of_int64_exn 5L; + }; + Transfer + { + destination = from_value addr2; + ticket_hash = forget tidx1; + qty = Tx_rollup_l2_qty.of_int64_exn 5L; + }; + ]; + } + in + let transfer2 : (Indexable.unknown, Indexable.unknown) operation = + { + signer = signer_of_address_index aidx2 |> Indexable.forget; + counter = 1L; + contents = + [ + Transfer + { + destination = forget aidx1; + ticket_hash = from_value ticket2; + qty = Tx_rollup_l2_qty.of_int64_exn 10L; + }; + Transfer + { + destination = from_value addr1; + ticket_hash = forget tidx2; + qty = Tx_rollup_l2_qty.of_int64_exn 10L; + }; + ]; + } + in + + let transaction = [transfer1; transfer2] in + let signatures = sign_transaction [sk1; sk2] transaction in + let batch = batch signatures [transaction] in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + match (status, withdrawals) with + | Transaction_success, [] -> + (* Check the balance after the transaction has been applied, we omit + the check the indexes to not pollute this test. *) + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be emptied" + tidx1 + aidx1 + 0L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket1 should be credited" + tidx1 + aidx2 + 10L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr2.ticket2 should be emptied" + tidx2 + aidx2 + 0L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr1.ticket2 should be credited" + tidx2 + aidx1 + 20L + in + return_unit + | Transaction_success, _ -> fail_msg "Did not expect any withdrawals" + | Transaction_failure _, _ -> fail_msg "The transaction should be a success" + +(** Test that a transaction containing at least one invalid operation + fails and does not change the context. It is similar to + {!test_simple_l2_transaction} but the second addr does not + possess the tickets. *) +let test_invalid_transaction () = + let open Context_l2.Syntax in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; []] + in + + let tidx1 = nth_exn tidxs 0 in + + let sk1, pk1, addr1, idx1, _ = nth_exn accounts 0 in + let sk2, pk2, addr2, idx2, _ = nth_exn accounts 1 in + + (* Then, we build a transaction with: + [addr1] -> [addr2] & [addr2] -> [addr1]. *) + let transaction = + transfers + [ + (signer_pk pk1, addr2, ticket1, 10L, None); + (signer_pk pk2, addr1, ticket2, 20L, None); + ] + in + let batch = create_batch_v1 [transaction] [[sk1; sk2]] in + + let* ctxt, Batch_result {results; _}, _withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + let* () = + expect_error_status + ~msg:"an invalid transaction must fail" + Tx_rollup_l2_context_sig.Balance_too_low + status + (let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 has not changed" + tidx1 + idx1 + 10L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket1 has not changed" + tidx1 + idx2 + 0L + in + + return_unit) + in + return_unit + +(** Test that submitting an invalid counter fails. *) +let test_invalid_counter () = + let open Context_l2.Syntax in + let* ctxt, _, accounts = with_initial_setup [ticket1] [[]] in + + let sk1, pk1, addr1, _idx1, _ = nth_exn accounts 0 in + + let counter = 10L in + let transaction = + transfers [(signer_pk pk1, addr2, ticket1, 10L, Some counter)] + in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* _ctxt, Batch_result {results; _}, _withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + let* () = + expect_error_status + ~msg:"the invalid counter must be detected" + (Tx_rollup_l2_apply.Counter_mismatch + {account = addr1; expected = 1L; provided = counter}) + status + return_unit + in + return_unit + +(** Test that submitting a transaction updates the counters (expect when + the batch is incorrectly signed). *) +let test_update_counter () = + let open Context_l2.Syntax in + let* ctxt, _, accounts = with_initial_setup [ticket1] [[]] in + + let sk1, pk1, addr1, _idx1, _ = nth_exn accounts 0 in + + let transactions = + transfers + [ + (signer_pk pk1, addr2, ticket1, 10L, Some 1L); + (signer_pk pk1, addr2, ticket1, 20L, Some 2L); + (signer_pk pk1, addr2, ticket1, 30L, Some 3L); + (signer_pk pk1, addr2, ticket1, 40L, Some 4L); + (signer_pk pk1, addr2, ticket1, 50L, Some 5L); + ] + |> List.map (fun x -> [x]) + in + + let batch = + create_batch_v1 transactions [[sk1]; [sk1]; [sk1]; [sk1]; [sk1]] + in + + let* ctxt, Batch_result {results; _}, withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 |> snd in + + match (status, withdrawals) with + | ( Transaction_failure + {reason = Tx_rollup_l2_apply.Incorrect_aggregated_signature; _}, + _ ) -> + fail_msg "This test should not raise [Incorrect_aggregated_signature]" + | _ -> + let* () = + check_metadata + ctxt + "addr1" + "the counter should have been incremented" + 5L + addr1 + pk1 + in + return_unit + +let test_pre_apply_batch () = + let open Context_l2.Syntax in + let* ctxt, _tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let sk1, pk1, addr1, _idx1, _ = nth_exn accounts 0 in + let sk2, pk2, addr2, _idx2, _ = nth_exn accounts 1 in + + let transaction = + transfers + [ + (signer_pk pk1, addr2, ticket1, 10L, None); + (signer_pk pk2, addr1, ticket2, 20L, None); + ] + in + let batch1 = create_batch_v1 [transaction] [[sk1; sk2]] in + let* ctxt, _indexes, _ = Batch_V1.check_signature ctxt batch1 in + + let* () = + check_metadata + ctxt + "pk1" + "check_signature must have created a metadata" + 0L + addr1 + pk1 + in + let* () = + check_metadata + ctxt + "pk1" + "check_signature must have created a metadata" + 0L + addr2 + pk2 + in + + (* We can now produce invalid signatures and expect a failure. *) + let batch2 = create_batch_v1 [transaction] [[sk1; sk1]] in + let* () = + expect_error + ~msg_if_valid:"The check should fail with an invalid signature" + (Batch_V1.check_signature ctxt batch2) + Incorrect_aggregated_signature + in + + return_unit + +(** Deposits and batches are tested individually in the tests above, we now + test that the toplevel functions correctly calls the subsequent functions. +*) + +let test_apply_message_batch () = + let open Context_l2.Syntax in + let* ctxt, _, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let sk1, pk1, addr1, _, _ = nth_exn accounts 0 in + let sk2, pk2, addr2, _, _ = nth_exn accounts 1 in + + (* Then, we build a transaction with: + [addr1] -> [addr2] & [addr2] -> [addr1]. *) + let transaction = + transfers + [ + (signer_pk pk1, addr2, ticket1, 10L, None); + (signer_pk pk2, addr1, ticket2, 20L, None); + ] + in + let batch = create_batch_v1 [transaction] [[sk1; sk2]] in + let msg, _ = + Tx_rollup_message.make_batch + (Data_encoding.Binary.to_string_exn + Tx_rollup_l2_batch.encoding + (V1 batch)) + in + + let* _ctxt, result = apply_l2_message ctxt msg in + + match result with + | Message_result.Batch_V1_result _, [] -> + (* We do not check the result inside as we consider it is + covered by other tests. *) + return_unit + | _ -> fail_msg "Invalid apply message result" + +(** Test a batch of transfers where some of the transfers will emit + withdrawals. *) +let test_apply_message_batch_withdrawals () = + let open Context_l2.Syntax in + let* ctxt, tidxs, accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + + let sk1, pk1, addr1, idx1, pkh1 = nth_exn accounts 0 in + let sk2, pk2, addr2, idx2, pkh2 = nth_exn accounts 1 in + + let tidx1 = nth_exn tidxs 0 in + let tidx2 = nth_exn tidxs 1 in + + (* Then, we build a transaction with: + - [pk1] -> [addr2] + - [pk1] -> [pkh2] (-> withdrawal) + - [pk2] -> [addr1] + - [pk2] -> [pkh1] (-> withdrawal) + *) + let transactions = + [ + [ + transfer + ~signer:(signer_pk pk1) + ~dest:addr2 + ~ticket:ticket1 + ~counter:1L + 5L; + ]; + [ + withdraw + ~signer:(signer_pk pk1) + ~dest:pkh2 + ~ticket:ticket1 + ~counter:2L + 5L; + ]; + [ + transfer + ~signer:(signer_pk pk2) + ~dest:addr1 + ~ticket:ticket2 + ~counter:1L + 10L; + ]; + [ + withdraw + ~signer:(signer_pk pk2) + ~dest:pkh1 + ~ticket:ticket2 + ~counter:2L + 10L; + ]; + ] + in + let batch = create_batch_v1 transactions [[sk1]; [sk1]; [sk2]; [sk2]] in + let msg, _ = + Tx_rollup_message.make_batch + (Data_encoding.Binary.to_string_exn + Tx_rollup_l2_batch.encoding + (V1 batch)) + in + + let* ctxt, result = apply_l2_message ctxt msg in + + match result with + | ( Message_result.Batch_V1_result + (Message_result.Batch_V1.Batch_result + { + results = + [ + (_, Transaction_success); + (_, Transaction_success); + (_, Transaction_success); + (_, Transaction_success); + ]; + _; + }), + withdrawals ) -> + Alcotest.( + check + (list eq_withdrawal) + "Resulting withdrawal from L2->L1 batch" + withdrawals + [ + { + claimer = pkh2; + ticket_hash = ticket1; + amount = Tx_rollup_l2_qty.of_int64_exn 5L; + }; + { + claimer = pkh1; + ticket_hash = ticket2; + amount = Tx_rollup_l2_qty.of_int64_exn 10L; + }; + ]) ; + let* () = + check_balance + ctxt + "addr1" + "ticket1" + "addr1.ticket1 should be spent" + tidx1 + idx1 + 0L + in + let* () = + check_balance + ctxt + "addr2" + "ticket1" + "addr2.ticket1 should be credited" + tidx1 + idx2 + 5L + in + + let* () = + check_balance + ctxt + "addr2" + "ticket2" + "addr1.ticket2 should be credited" + tidx2 + idx1 + 10L + in + let* () = + check_balance + ctxt + "addr1" + "ticket2" + "addr2.ticket2 should be spent" + tidx2 + idx2 + 0L + in + return_unit + | ( Message_result.Batch_V1_result + (Message_result.Batch_V1.Batch_result {results; _}), + _ ) -> + let* () = + if List.length results <> 4 then + fail_msg + ("Expected 4 results, got " ^ string_of_int @@ List.length results) + else return_unit + in + List.iter_es + (fun res -> + match res with + | _, Message_result.Transaction_success -> return_unit + | _, Transaction_failure {index; reason} -> + let msg = + Format.asprintf + "Result at position %d unexpectedly failed: %a" + index + Environment.Error_monad.pp + reason + in + fail_msg msg) + results + | _ -> fail_msg "Unexpected apply message result" + +let test_apply_message_deposit () = + let open Context_l2.Syntax in + let ctxt = empty_context in + let amount = 50L in + + let msg, _ = + Tx_rollup_message.make_deposit + pkh + (value addr1) + ticket1 + (Tx_rollup_l2_qty.of_int64_exn amount) + in + + let* _ctxt, result = apply_l2_message ctxt msg in + + match result with + | Message_result.Deposit_result _, [] -> + (* We do not check the result inside as we consider it is + covered by other tests. *) + return_unit + | _ -> fail_msg "Invalid apply message result" + +(** Test an unparsable message. *) +let test_apply_message_unparsable () = + let open Context_l2.Syntax in + let* ctxt, _tidxs, _accounts = + with_initial_setup [ticket1; ticket2] [[(ticket1, 10L)]; [(ticket2, 20L)]] + in + let msg, _ = + Tx_rollup_message.make_batch + "Yo, let me bust the funky lyrics (You can't parse this)!" + in + apply_l2_message ctxt msg >>= fun result -> + match result with + | Error Invalid_batch_encoding -> return_unit + | _ -> fail_msg "Unexpected apply message result" + +let test_transfer_to_self () = + let open Context_l2.Syntax in + let* ctxt, _, accounts = with_initial_setup [ticket1] [[(ticket1, 10L)]] in + let sk1, pk1, addr1, _idx1, _ = nth_exn accounts 0 in + let transaction = + [transfer ~signer:(signer_pk pk1) ~dest:addr1 ~ticket:ticket1 1L] + in + let batch = create_batch_v1 [transaction] [[sk1]] in + + let* _ctxt, Batch_result {results; _}, _withdrawals = + apply_l2_batch ctxt batch + in + + let status = nth_exn results 0 in + + match status with + | ( _, + Transaction_failure + {index = 0; reason = Tx_rollup_l2_apply.Invalid_self_transfer} ) -> + return_unit + | _, _ -> + fail_msg "The transaction should have failed with [Invalid_destination]" + +module Indexes = struct + (** The context should be dropped during an invalid deposit, as the + indexes should be. *) + let test_drop_on_wrong_deposit () = + let open Context_l2.Syntax in + let deposit, _ = + make_deposit pkh (value addr1) ticket1 Tx_rollup_l2_qty.one + in + (* We make the apply fail with an enormous address count *) + let* ctxt = + Address_index.Internal_for_tests.set_count empty_context Int32.max_int + in + let* ctxt, _ = apply_l2_message ctxt deposit in + let* ticket_count = Ticket_index.count ctxt in + Alcotest.(check int32) "Ticket count should not change" 0l ticket_count ; + (* We make the apply fail with an enormous ticket count *) + let* ctxt = + Ticket_index.Internal_for_tests.set_count empty_context Int32.max_int + in + let* ctxt, _ = apply_l2_message ctxt deposit in + let* address_count = Address_index.count ctxt in + Alcotest.(check int32) "Address count should not change" 0l address_count ; + return_unit + + (** A deposit should created if they don't exist an index for both the ticket + and the destination. *) + let test_creation_on_deposit () = + let open Context_l2.Syntax in + let deposit, _ = + make_deposit pkh (value addr1) ticket1 Tx_rollup_l2_qty.one + in + let* ctxt, (result, _) = apply_l2_message empty_context deposit in + let* ticket_count = Ticket_index.count ctxt in + Alcotest.(check int32) "Ticket count should change" 1l ticket_count ; + let* address_count = Address_index.count ctxt in + Alcotest.(check int32) "Address count should change" 1l address_count ; + match result with + | Deposit_result (Deposit_success indexes) -> + check_indexes [(addr1, 0l)] [(ticket1, 0l)] indexes + | _ -> fail_msg "Should be a success" + + (** Deposit tickets in the layer2 does not create new indexes if they already + existed. *) + let test_deposit_with_existing_indexes () = + let open Context_l2.Syntax in + let* ctxt, _, _ = + Address_index.get_or_associate_index empty_context addr1 + in + let* ctxt, _, _ = Ticket_index.get_or_associate_index ctxt ticket1 in + let deposit, _ = + make_deposit pkh (value addr1) ticket1 Tx_rollup_l2_qty.one + in + let* _, (result, _) = apply_l2_message ctxt deposit in + match result with + | Deposit_result (Deposit_success indexes) -> check_indexes [] [] indexes + | _ -> fail_msg "Should be a success" + + let test_creation_on_valid_batch () = + let open Context_l2.Syntax in + let contracts = gen_n_address 3 in + let sk1, pk1, addr1 = nth_exn contracts 0 in + let _, _, addr2 = nth_exn contracts 1 in + let _, _, addr3 = nth_exn contracts 2 in + let deposit, _ = + make_deposit + (Obj.magic pk1) + (value addr1) + ticket1 + (Tx_rollup_l2_qty.of_int64_exn 10L) + in + let* ctxt, _ = apply_l2_message empty_context deposit in + let batch = + batch_from_transfers + [ + [(sk1, pk1, addr2, ticket1, 1L, Some 1L)]; + [(sk1, pk1, addr3, ticket1, 1L, Some 2L)]; + ] + in + let* _, (result, _) = apply_l2_message ctxt batch in + match result with + | Batch_V1_result (Batch_result {indexes; _}) -> + check_indexes [(addr2, 1l); (addr3, 2l)] [] indexes + | _ -> assert false + + let test_drop_on_wrong_batch () = + let open Context_l2.Syntax in + let contracts = gen_n_address 4 in + let sk1, pk1, addr1 = nth_exn contracts 0 in + let sk2, pk2, addr2 = nth_exn contracts 1 in + let _, _, addr3 = nth_exn contracts 2 in + let _, _, addr4 = nth_exn contracts 3 in + let deposit, _ = + make_deposit + (Obj.magic pk1) + (value addr1) + ticket1 + (Tx_rollup_l2_qty.of_int64_exn 10L) + in + let* ctxt, _ = apply_l2_message empty_context deposit in + let batch = + batch_from_transfers + [ + (* This will be valid and create an index for [addr2] *) + [(sk1, pk1, addr2, ticket1, 1L, Some 1L)]; + (* This will be wrong and must not create an index for [addr3] *) + [(sk1, pk1, addr3, ticket1, 1L, Some 1L)]; + (* This has a valid transfer and an invalid one, both + indexes must be dropped. *) + [ + (sk1, pk1, addr4, ticket1, 1L, Some 1L); + (sk2, pk2, addr3, ticket1, 1L, Some 1L); + ]; + ] + in + let* _ctxt, (result, _) = apply_l2_message ctxt batch in + match result with + | Batch_V1_result (Batch_result {indexes; _}) -> + check_indexes [(addr2, 1l)] [] indexes + | _ -> assert false + + let tests = + [ + ("indexes are dropped on deposit failure", test_drop_on_wrong_deposit); + ("indexes are created on deposit success", test_creation_on_deposit); + ("deposit with existing indexes", test_deposit_with_existing_indexes); + ( "indexes are created on valid transfers transaction", + test_creation_on_valid_batch ); + ( "indexes are dropped on invalid transfers transaction", + test_drop_on_wrong_batch ); + ] +end + +let tests = + wrap_tztest_tests + ([ + ("simple transaction", test_simple_deposit); + ("returned transaction", test_returned_deposit); + ("test simple l1 transaction", test_simple_l1_transaction); + ( "test simple l1 transaction: inexistant ticket", + test_l1_transaction_inexistant_ticket ); + ( "test simple l1 transaction: inexistant signer", + test_l1_transaction_inexistant_signer ); + ("test simple l1 transaction: overdraft", test_l1_transaction_overdraft); + ("test simple l1 transaction: zero", test_l1_transaction_zero); + ("test simple l1 transaction: partial", test_l1_transaction_partial); + ("test simple l2 transaction", test_simple_l2_transaction); + ( "test l2 transaction with l2 addr: good", + test_l2_transaction_l2_addr_signer_good ); + ( "test l2 transaction with l2 addr: bad", + test_l2_transaction_l2_addr_signer_bad ); + ( "test simple transaction with indexes and values", + test_transaction_with_unknown_indexable ); + ("invalid transaction", test_invalid_transaction); + ("invalid counter", test_invalid_counter); + ("update counter", test_update_counter); + ("pre apply batch", test_pre_apply_batch); + ("apply batch from message", test_apply_message_batch); + ( "apply batch from message with withdrawals", + test_apply_message_batch_withdrawals ); + ("apply deposit from message", test_apply_message_deposit); + ("apply unparseable message", test_apply_message_unparsable); + ("test transfer to self fail", test_transfer_to_self); + ( "nb withdrawals per batch below limit", + nb_withdrawals_per_batch_below_limit ); + ( "nb withdrawals per batch equals limit", + nb_withdrawals_per_batch_equals_limit ); + ( "nb withdrawals per batch above limit", + nb_withdrawals_per_batch_above_limit ); + ] + @ Indexes.tests) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml new file mode 100644 index 000000000000..894f361439b0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml @@ -0,0 +1,397 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol (Zk_rollup) + Invocation: cd src/proto_alpha/lib_protocol/test/unit && \ + dune exec ./main.exe -- test "^\[Unit\] zk rollup storage$" + Subject: On ZK Rollup storage +*) + +open Protocol + +let wrap e = Lwt.return (Environment.wrap_tzresult e) + +let ( let** ) m f = + let open Lwt_result_syntax in + let* x = m >>= wrap in + f x + +let batch_size = 10 + +module ZKRU = struct + include Alpha_context.Zk_rollup + + type pkh = Tezos_crypto.Signature.Public_key_hash.t + + let pkh_encoding = Tezos_crypto.Signature.Public_key_hash.encoding + + type ticket_hash = Alpha_context.Ticket_hash.t + + let ticket_hash_encoding = Alpha_context.Ticket_hash.encoding +end + +module Operator = Dummy_zk_rollup.Operator (struct + let batch_size = batch_size +end) + +let no_ticket op = (op, None) + +module Raw_context_tests = struct + module Helpers = struct + let is_empty : Zk_rollup_repr.pending_list -> bool = function + | Zk_rollup_repr.Empty _ -> true + | _ -> false + + let pending_length : Zk_rollup_repr.pending_list -> int = + let open Zk_rollup_repr in + function Empty _ -> 0 | Pending {length; _} -> length + + let get_pending_list = + let open Lwt_result_syntax in + let open Zk_rollup_repr in + fun ctx rollup -> function + | Empty _ -> return (ctx, []) + | Pending {next_index; length} -> + let head = Int64.(sub next_index (of_int length)) in + let to_get = + Stdlib.List.init length (fun x -> Int64.(add (of_int x) head)) + in + let* ctx, ops = + List.fold_left_es + (fun (ctx, acc) i -> + let** ctx, op = + Storage.Zk_rollup.Pending_operation.get (ctx, rollup) i + in + return (ctx, op :: acc)) + (ctx, []) + to_get + in + return (ctx, List.rev ops) + end + + let initial_ctx () = + let open Lwt_result_syntax in + let* b, contract = Context.init1 () in + let** ctx = + Raw_context.prepare + b.context + ~level:b.header.shell.level + ~predecessor_timestamp:b.header.shell.timestamp + ~timestamp:b.header.shell.timestamp + in + let nonce = Tezos_crypto.Operation_hash.hash_string ["nonce_hash"] in + return (Raw_context.init_origination_nonce ctx nonce, contract) + + (* Context with an originated ZKRU *) + let originate_ctx () = + let open Lwt_result_syntax in + let open Zk_rollup_account_repr in + let* ctx, contract = initial_ctx () in + let public_parameters = Operator.public_parameters in + let state = Operator.init_state in + let state_length = Array.length state in + let circuits_info = SMap.of_seq @@ Plonk.SMap.to_seq Operator.circuits in + let nb_ops = 1 in + let* ctx, rollup, _size = + Zk_rollup_storage.originate + ctx + {public_parameters; state_length; circuits_info; nb_ops} + ~init_state:state + >>= wrap + in + return (ctx, rollup, contract) + + (* Check that the pending list of a new ZKRU is empty *) + let pending_list_origination_is_empty () = + let open Lwt_result_syntax in + let* ctx, rollup, _contract = originate_ctx () in + let** _ctx, pending = Storage.Zk_rollup.Pending_list.get ctx rollup in + assert (Helpers.is_empty pending) ; + return_unit + + (* Check that appending an L2 operation with the [add_to_pending] helper + correctly updates both the pending list descriptor and the actual + operations under the [pending_operations] directory. *) + let pending_list_append () = + let open Lwt_result_syntax in + let* ctx, rollup, _contract = originate_ctx () in + let pkh, _, _ = Tezos_crypto.Signature.generate_key () in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [||]; + } + in + (* Append first operation *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op] in + let** ctx, pending = Storage.Zk_rollup.Pending_list.get ctx rollup in + assert (Helpers.pending_length pending = 1) ; + let* ctx, ops = Helpers.get_pending_list ctx rollup pending in + assert (List.length ops = 1) ; + (* Append second operation *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op] in + let** ctx, pending = Storage.Zk_rollup.Pending_list.get ctx rollup in + let* _ctx, ops = Helpers.get_pending_list ctx rollup pending in + assert (Helpers.pending_length pending = 2) ; + assert (List.length ops = 2) ; + return_unit + + let pending_list_append_errors () = + let open Lwt_result_syntax in + let* ctx, rollup, _contract = originate_ctx () in + let pkh, _, _ = Tezos_crypto.Signature.generate_key () in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [||]; + } + in + (* Append first operation *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op] in + let** ctx, pending = Storage.Zk_rollup.Pending_list.get ctx rollup in + assert (Helpers.pending_length pending = 1) ; + let* ctx, ops = Helpers.get_pending_list ctx rollup pending in + assert (List.length ops = 1) ; + (* Invalid op code *) + let wrong_op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 1; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [||]; + } + in + let*! e = Zk_rollup_storage.add_to_pending ctx rollup [wrong_op] >>= wrap in + let* () = + Assert.proto_error_with_info ~loc:__LOC__ e "Invalid op code in append" + in + (* Invalid rollup address *) + let* _ctx, nonce = Raw_context.increment_origination_nonce ctx |> wrap in + let* address = + Zk_rollup_repr.Address.from_nonce (Origination_nonce.incr nonce) |> wrap + in + let*! e = Zk_rollup_storage.add_to_pending ctx address [op] >>= wrap in + let expected_message = "Storage error (fatal internal error)" in + Assert.proto_error_with_info ~loc:__LOC__ e expected_message + + (* Check that the [get_prefix] helper actually returns a list of the + desired length. *) + let pending_list_get () = + let open Lwt_result_syntax in + let* ctx, rollup, _contract = originate_ctx () in + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [|Bls12_381.Fr.one|]; + } + in + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op; op] in + let** _ctx, prefix = Zk_rollup_storage.get_prefix ctx rollup 1 in + assert (List.length prefix = 1) ; + return_unit + + (* Check the [get_prefix] errors. *) + let pending_list_errors () = + let open Lwt_result_syntax in + let* ctx, rollup, _contract = originate_ctx () in + let pkh, _pk, _sk = Tezos_crypto.Signature.generate_key () in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [|Bls12_381.Fr.one|]; + } + in + (* Initialise the pending list with 2 operations *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op; op] in + (* Check that retrieving too many ops returns an error *) + let*! e = Zk_rollup_storage.get_prefix ctx rollup 3 >>= wrap in + let* () = + Assert.proto_error_with_info ~loc:__LOC__ e "Pending list is too short" + in + (* Check that retrieving a negative number of ops returns an error *) + let*! e = Zk_rollup_storage.get_prefix ctx rollup (-1) >>= wrap in + let* () = + Assert.proto_error_with_info + ~loc:__LOC__ + e + "Negative length for pending list prefix" + in + (* Check that get prefix fails with invalid zkru address *) + let* _ctx, nonce = Raw_context.increment_origination_nonce ctx |> wrap in + let* address = + Zk_rollup_repr.Address.from_nonce (Origination_nonce.incr nonce) |> wrap + in + let*! e = Zk_rollup_storage.get_prefix ctx address (-1) >>= wrap in + Assert.proto_error_with_info + ~loc:__LOC__ + e + "Storage error (fatal internal error)" + + (* Check that the [update] helper correctly removes a prefix of the + pending list (both in the descriptor and the actual operations storage). + *) + let test_update () = + let open Lwt_result_syntax in + (* Originate rollup and contract *) + let* ctx, rollup, contract = originate_ctx () in + let pkh = + match contract with Originated _ -> assert false | Implicit pkh -> pkh + in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [|Bls12_381.Fr.one|]; + } + in + (* Populate rollup with 2 ops *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op; op] in + let** ctx, acc = Storage.Zk_rollup.Account.get ctx rollup in + (* Processing first pending op *) + let** ctx = + Zk_rollup_storage.update ctx rollup ~pending_to_drop:1 ~new_account:acc + in + (* Check that op at index 0 has been removed *) + let** ctx, opt = + Storage.Zk_rollup.Pending_operation.find (ctx, rollup) 0L + in + assert (Option.is_none opt) ; + (* Check that pending list still has one op *) + let** ctx, pending = Storage.Zk_rollup.Pending_list.get ctx rollup in + assert (Helpers.pending_length pending = 1) ; + let* _ctx, ops = Helpers.get_pending_list ctx rollup pending in + assert (List.length ops = 1) ; + return_unit + + let test_update_errors () = + let open Lwt_result_syntax in + (* Originate rollup and contract *) + let* ctx, rollup, contract = originate_ctx () in + let pkh = + match contract with Originated _ -> assert false | Implicit pkh -> pkh + in + let op = + no_ticket + Zk_rollup_operation_repr. + { + op_code = 0; + price = {id = Ticket_hash_repr.zero; amount = Z.zero}; + l1_dst = pkh; + rollup_id = rollup; + payload = [|Bls12_381.Fr.one|]; + } + in + (* Populate rollup with 2 ops *) + let** ctx, _size = Zk_rollup_storage.add_to_pending ctx rollup [op; op] in + let** ctx, acc = Storage.Zk_rollup.Account.get ctx rollup in + (* Processing too many ops *) + let*! e = + Zk_rollup_storage.update ctx rollup ~pending_to_drop:3 ~new_account:acc + >>= wrap + in + let* () = + Assert.proto_error_with_info ~loc:__LOC__ e "Pending list is too short" + in + (* Processing negative number of ops *) + let*! e = + Zk_rollup_storage.update ctx rollup ~pending_to_drop:(-3) ~new_account:acc + >>= wrap + in + let* () = + Assert.proto_error_with_info + ~loc:__LOC__ + e + "Negative length for pending list prefix" + in + (* Update with wrong address *) + let* _ctx, nonce = Raw_context.increment_origination_nonce ctx |> wrap in + let* address = + Zk_rollup_repr.Address.from_nonce (Origination_nonce.incr nonce) |> wrap + in + let*! e = + Zk_rollup_storage.update ctx address ~pending_to_drop:1 ~new_account:acc + >>= wrap + in + Assert.proto_error_with_info + ~loc:__LOC__ + e + "Storage error (fatal internal error)" +end + +let tests = + [ + Tztest.tztest + "origination_pending_is_empty" + `Quick + Raw_context_tests.pending_list_origination_is_empty; + Tztest.tztest + "pending_list_append" + `Quick + Raw_context_tests.pending_list_append; + Tztest.tztest + "pending_list_append errors" + `Quick + Raw_context_tests.pending_list_append_errors; + Tztest.tztest "pending_list_get" `Quick Raw_context_tests.pending_list_get; + Tztest.tztest + "pending_list_get errors" + `Quick + Raw_context_tests.pending_list_errors; + Tztest.tztest "test_update" `Quick Raw_context_tests.test_update; + Tztest.tztest + "test_update errors" + `Quick + Raw_context_tests.test_update_errors; + ] diff --git a/src/proto_016_PtMumbai/lib_protocol/tez_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tez_repr.ml new file mode 100644 index 000000000000..2c16dfa99dbe --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tez_repr.ml @@ -0,0 +1,285 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let id = "tez" + +let name = "mutez" + +open Compare.Int64 (* invariant: positive *) + +type repr = t + +type t = Tez_tag of repr [@@ocaml.unboxed] + +type error += + | Addition_overflow of t * t (* `Temporary *) + | Subtraction_underflow of t * t (* `Temporary *) + | Multiplication_overflow of t * int64 (* `Temporary *) + | Negative_multiplicator of t * int64 (* `Temporary *) + | Invalid_divisor of t * int64 + +(* `Temporary *) + +let zero = Tez_tag 0L + +(* all other constant are defined from the value of one micro tez *) +let one_mutez = Tez_tag 1L + +let max_mutez = Tez_tag Int64.max_int + +let mul_int (Tez_tag tez) i = Tez_tag (Int64.mul tez i) + +let one_cent = mul_int one_mutez 10_000L + +let fifty_cents = mul_int one_cent 50L + +(* 1 tez = 100 cents = 1_000_000 mutez *) +let one = mul_int one_cent 100L + +let of_string s = + let triplets = function + | hd :: tl -> + let len = String.length hd in + Compare.Int.( + len <= 3 && len > 0 && List.for_all (fun s -> String.length s = 3) tl) + | [] -> false + in + let integers s = triplets (String.split_on_char ',' s) in + let decimals s = + let l = String.split_on_char ',' s in + if Compare.List_length_with.(l > 2) then false else triplets (List.rev l) + in + let parse left right = + let remove_commas s = String.concat "" (String.split_on_char ',' s) in + let pad_to_six s = + let len = String.length s in + String.init 6 (fun i -> if Compare.Int.(i < len) then s.[i] else '0') + in + let prepared = remove_commas left ^ pad_to_six (remove_commas right) in + Option.map (fun i -> Tez_tag i) (Int64.of_string_opt prepared) + in + match String.split_on_char '.' s with + | [left; right] -> + if String.contains s ',' then + if integers left && decimals right then parse left right else None + else if + Compare.Int.(String.length right > 0) + && Compare.Int.(String.length right <= 6) + then parse left right + else None + | [left] -> + if (not (String.contains s ',')) || integers left then parse left "" + else None + | _ -> None + +let pp ppf (Tez_tag amount) = + let mult_int = 1_000_000L in + let rec left ppf amount = + let d, r = (Int64.(div amount 1000L), Int64.(rem amount 1000L)) in + if d > 0L then Format.fprintf ppf "%a%03Ld" left d r + else Format.fprintf ppf "%Ld" r + in + let right ppf amount = + let triplet ppf v = + if Compare.Int.(v mod 10 > 0) then Format.fprintf ppf "%03d" v + else if Compare.Int.(v mod 100 > 0) then Format.fprintf ppf "%02d" (v / 10) + else Format.fprintf ppf "%d" (v / 100) + in + let hi, lo = (amount / 1000, amount mod 1000) in + if Compare.Int.(lo = 0) then Format.fprintf ppf "%a" triplet hi + else Format.fprintf ppf "%03d%a" hi triplet lo + in + let ints, decs = + (Int64.(div amount mult_int), Int64.(to_int (rem amount mult_int))) + in + left ppf ints ; + if Compare.Int.(decs > 0) then Format.fprintf ppf ".%a" right decs + +let to_string t = Format.asprintf "%a" pp t + +let ( -? ) tez1 tez2 = + let (Tez_tag t1) = tez1 in + let (Tez_tag t2) = tez2 in + if t2 <= t1 then ok (Tez_tag (Int64.sub t1 t2)) + else error (Subtraction_underflow (tez1, tez2)) + +let sub_opt (Tez_tag t1) (Tez_tag t2) = + if t2 <= t1 then Some (Tez_tag (Int64.sub t1 t2)) else None + +let ( +? ) tez1 tez2 = + let (Tez_tag t1) = tez1 in + let (Tez_tag t2) = tez2 in + let t = Int64.add t1 t2 in + if t < t1 then error (Addition_overflow (tez1, tez2)) else ok (Tez_tag t) + +let ( *? ) tez m = + let (Tez_tag t) = tez in + if m < 0L then error (Negative_multiplicator (tez, m)) + else if m = 0L then ok (Tez_tag 0L) + else if t > Int64.(div max_int m) then + error (Multiplication_overflow (tez, m)) + else ok (Tez_tag (Int64.mul t m)) + +let ( /? ) tez d = + let (Tez_tag t) = tez in + if d <= 0L then error (Invalid_divisor (tez, d)) + else ok (Tez_tag (Int64.div t d)) + +let mul_exn t m = + match t *? Int64.(of_int m) with + | Ok v -> v + | Error _ -> invalid_arg "mul_exn" + +let div_exn t d = + match t /? Int64.(of_int d) with + | Ok v -> v + | Error _ -> invalid_arg "div_exn" + +let of_mutez t = if t < 0L then None else Some (Tez_tag t) + +let of_mutez_exn x = + match of_mutez x with None -> invalid_arg "Tez.of_mutez" | Some v -> v + +let to_mutez (Tez_tag t) = t + +let encoding = + let open Data_encoding in + let decode (Tez_tag t) = Z.of_int64 t in + let encode = Json.wrap_error (fun i -> Tez_tag (Z.to_int64 i)) in + Data_encoding.def name (check_size 10 (conv decode encode n)) + +let () = + let open Data_encoding in + register_error_kind + `Temporary + ~id:(id ^ ".addition_overflow") + ~title:("Overflowing " ^ id ^ " addition") + ~pp:(fun ppf (opa, opb) -> + Format.fprintf + ppf + "Overflowing addition of %a %s and %a %s" + pp + opa + id + pp + opb + id) + ~description:("An addition of two " ^ id ^ " amounts overflowed") + (obj1 (req "amounts" (tup2 encoding encoding))) + (function Addition_overflow (a, b) -> Some (a, b) | _ -> None) + (fun (a, b) -> Addition_overflow (a, b)) ; + register_error_kind + `Temporary + ~id:(id ^ ".subtraction_underflow") + ~title:("Underflowing " ^ id ^ " subtraction") + ~pp:(fun ppf (opa, opb) -> + Format.fprintf + ppf + "Underflowing subtraction of %a %s and %a %s" + pp + opa + id + pp + opb + id) + ~description: + ("A subtraction of two " ^ id + ^ " amounts underflowed (i.e., would have led to a negative amount)") + (obj1 (req "amounts" (tup2 encoding encoding))) + (function Subtraction_underflow (a, b) -> Some (a, b) | _ -> None) + (fun (a, b) -> Subtraction_underflow (a, b)) ; + register_error_kind + `Temporary + ~id:(id ^ ".multiplication_overflow") + ~title:("Overflowing " ^ id ^ " multiplication") + ~pp:(fun ppf (opa, opb) -> + Format.fprintf + ppf + "Overflowing multiplication of %a %s and %Ld" + pp + opa + id + opb) + ~description: + ("A multiplication of a " ^ id ^ " amount by an integer overflowed") + (obj2 (req "amount" encoding) (req "multiplicator" int64)) + (function Multiplication_overflow (a, b) -> Some (a, b) | _ -> None) + (fun (a, b) -> Multiplication_overflow (a, b)) ; + register_error_kind + `Temporary + ~id:(id ^ ".negative_multiplicator") + ~title:("Negative " ^ id ^ " multiplicator") + ~pp:(fun ppf (opa, opb) -> + Format.fprintf + ppf + "Multiplication of %a %s by negative integer %Ld" + pp + opa + id + opb) + ~description:("Multiplication of a " ^ id ^ " amount by a negative integer") + (obj2 (req "amount" encoding) (req "multiplicator" int64)) + (function Negative_multiplicator (a, b) -> Some (a, b) | _ -> None) + (fun (a, b) -> Negative_multiplicator (a, b)) ; + register_error_kind + `Temporary + ~id:(id ^ ".invalid_divisor") + ~title:("Invalid " ^ id ^ " divisor") + ~pp:(fun ppf (opa, opb) -> + Format.fprintf + ppf + "Division of %a %s by non positive integer %Ld" + pp + opa + id + opb) + ~description: + ("Multiplication of a " ^ id ^ " amount by a non positive integer") + (obj2 (req "amount" encoding) (req "divisor" int64)) + (function Invalid_divisor (a, b) -> Some (a, b) | _ -> None) + (fun (a, b) -> Invalid_divisor (a, b)) + +type tez = t + +let compare (Tez_tag x) (Tez_tag y) = compare x y + +let ( = ) (Tez_tag x) (Tez_tag y) = x = y + +let ( <> ) (Tez_tag x) (Tez_tag y) = x <> y + +let ( < ) (Tez_tag x) (Tez_tag y) = x < y + +let ( > ) (Tez_tag x) (Tez_tag y) = x > y + +let ( <= ) (Tez_tag x) (Tez_tag y) = x <= y + +let ( >= ) (Tez_tag x) (Tez_tag y) = x >= y + +let equal (Tez_tag x) (Tez_tag y) = equal x y + +let max (Tez_tag x) (Tez_tag y) = Tez_tag (max x y) + +let min (Tez_tag x) (Tez_tag y) = Tez_tag (min x y) diff --git a/src/proto_016_PtMumbai/lib_protocol/tez_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tez_repr.mli new file mode 100644 index 000000000000..d602044d3f2e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tez_repr.mli @@ -0,0 +1,91 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Internal representation of the Tez currency. Behaves mostly like a natural + number where number 1 represents 1/1,000,000 Tez (1 micro-Tez or mutez). + It's protected from ever becoming negative and overflowing by special + arithmetic functions, which fail in case something undesired would happen. + When divided, it's always rounded down to 1 mutez. + + Internally encoded as [int64], which may be relevant to guard against + overflow errors. *) +type repr + +(** [t] is made algebraic in order to distinguish it from the other type + parameters of [Script_typed_ir.ty]. *) +type t = Tez_tag of repr [@@ocaml.unboxed] + +type error += Subtraction_underflow of t * t (* `Temporary *) + +type tez = t + +val zero : t + +val one_mutez : t + +val one_cent : t + +val fifty_cents : t + +val one : t + +val max_mutez : t + +val ( -? ) : t -> t -> t tzresult + +(** Same as ( -? ) but returns None instead of an error. *) +val sub_opt : t -> t -> t option + +val ( +? ) : t -> t -> t tzresult + +val ( *? ) : t -> int64 -> t tzresult + +val ( /? ) : t -> int64 -> t tzresult + +val to_mutez : t -> int64 + +(** [of_mutez n] (micro tez) is None if n is negative *) +val of_mutez : int64 -> t option + +(** [of_mutez_exn n] fails if n is negative. + It should only be used at toplevel for constants. *) +val of_mutez_exn : int64 -> t + +(** It should only be used at toplevel for constants. *) +val mul_exn : t -> int -> t + +(** It should only be used at toplevel for constants. *) +val div_exn : t -> int -> t + +val encoding : t Data_encoding.t + +include Compare.S with type t := t + +val pp : Format.formatter -> t -> unit + +val of_string : string -> t option + +val to_string : t -> string diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.ml new file mode 100644 index 000000000000..ae2b6f756b90 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.ml @@ -0,0 +1,296 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += Invalid_ticket_transfer of {ticketer : string; amount : Z.t} + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"invalid_ticket_transfer" + ~title:"Invalid ticket transfer" + ~description:"Invalid ticket transfer detected in ticket balance update." + ~pp:(fun ppf (ticketer, amount) -> + Format.fprintf + ppf + "Attempted to send %a unit(s) of a ticket created by %s." + Z.pp_print + amount + ticketer) + (obj2 (req "ticketer" (string Plain)) (req "amount" z)) + (function + | Invalid_ticket_transfer {ticketer; amount} -> Some (ticketer, amount) + | _ -> None) + (fun (ticketer, amount) -> Invalid_ticket_transfer {ticketer; amount}) + +module Ticket_token_map = struct + include Ticket_token_map + + let balance_diff ctxt token map = + let open Lwt_result_syntax in + let+ amnt_opt, ctxt = Ticket_token_map.find ctxt token map in + (Option.value ~default:Z.zero amnt_opt, ctxt) + + let merge_overlap ctxt b1 b2 = + let open Result_syntax in + let+ ctxt = Gas.consume ctxt (Ticket_costs.add_z_cost b1 b2) in + (Z.add b1 b2, ctxt) + + let of_list ctxt token_amounts = + Ticket_token_map.of_list ctxt ~merge_overlap token_amounts + + let add ctxt = Ticket_token_map.merge ctxt ~merge_overlap + + let sub ctxt m1 m2 = + let open Result_syntax in + let* m2, ctxt = + map_e + ctxt + (fun ctxt _ex_token amount -> + let+ ctxt = Gas.consume ctxt (Ticket_costs.negate_cost amount) in + (Z.neg amount, ctxt)) + m2 + in + add ctxt m1 m2 +end + +let ticket_balances_of_value ctxt ~include_lazy ty value = + let open Lwt_result_syntax in + let* tickets, ctxt = + Ticket_scanner.tickets_of_value ~include_lazy ctxt ty value + in + let accum_ticket_balances (acc, ctxt) ticket = + let open Result_syntax in + let token, amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ticket + in + let+ ctxt = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + in + ( (token, Script_int.to_zint (amount :> Script_int.n Script_int.num)) :: acc, + ctxt ) + in + let*? token_amounts, ctxt = + List.fold_left_e accum_ticket_balances ([], ctxt) tickets + in + Ticket_token_map.of_list ctxt token_amounts + +let update_ticket_balances ctxt ~total_storage_diff token destinations = + let open Lwt_result_syntax in + List.fold_left_es + (fun (tot_storage_diff, ctxt) (owner, delta) -> + let* key_hash, ctxt = Ticket_balance_key.of_ex_token ctxt ~owner token in + let* storage_diff, ctxt = + Ticket_balance.adjust_balance ctxt key_hash ~delta + in + let*? ctxt = + Gas.consume + ctxt + (Ticket_costs.add_z_cost total_storage_diff storage_diff) + in + return (Z.add tot_storage_diff storage_diff, ctxt)) + (total_storage_diff, ctxt) + destinations + +let invalid_ticket_transfer_error + ~ticket_token: + (Ticket_token.Ex_token {ticketer; contents_type = _; contents = _}) + ~amount = + Invalid_ticket_transfer {ticketer = Contract.to_b58check ticketer; amount} + +let update_ticket_balances_for_self_contract ctxt ~self_contract ticket_diffs = + let open Lwt_result_syntax in + List.fold_left_es + (fun (total_storage_diff, ctxt) (ticket_token, amount) -> + (* Diff is valid iff either: + - the balance has decreased (delta <= 0), or + - the ticket-token was created by the [self] contract. *) + let is_valid_balance_update = + let (Ticket_token.Ex_token {ticketer; _}) = ticket_token in + Compare.Z.(amount <= Z.zero) || Contract.equal ticketer self_contract + in + let*? () = + error_unless + is_valid_balance_update + (invalid_ticket_transfer_error ~ticket_token ~amount) + in + update_ticket_balances + ctxt + ~total_storage_diff + ticket_token + [(Destination.Contract self_contract, amount)]) + (Z.zero, ctxt) + ticket_diffs + +let ticket_diffs_of_lazy_storage_diff ctxt ~storage_type_has_tickets + lazy_storage_diff = + let open Lwt_result_syntax in + (* Only scan lazy-diffs for tickets in case the storage contains tickets. *) + if Ticket_scanner.has_tickets storage_type_has_tickets then + let* diffs, ctxt = + Ticket_lazy_storage_diff.ticket_diffs_of_lazy_storage_diff + ctxt + lazy_storage_diff + in + Ticket_token_map.of_list ctxt diffs + else return (Ticket_token_map.empty, ctxt) + +(* TODO #2465 + Move the docs from HackMd to [docs/alpha] folder. + The documentation referenced here should be moved to a permanent place and + the comment below should be updated. +*) + +(** Description here: + https://hackmd.io/lutm_5JNRVW-nNFSFkCXLQ?view#Implementation + + - [old_storage_strict] the amount S_1^{strict} of ticket-tokens in the strict part of + the old storage. + + - [new_storage_strict] the amount S_2^{strict} of ticket-tokens in the strict part of the + new storage. + + - [lazy_storage_diff] the amount S_{\delta}^{lazy} of ticket-tokens added to the lazy part of + the storage. + + - [arg_tickets] the amount I of ticket-tokens contained in the incoming + arguments. + + We calculate the ticket diff as the following: + [new_storage_strict] + [lazy_storage_diff] - ([old_storage_strict] + [arg_tickets]) + + Additionally, we calculate the ticket receipt as below. + We do not subtract the [arg_tickets] since we only want to display the tickets updated in storage for the receipt. + [new_storage_strict] + [lazy_storage_diff] - [storage_strict] + *) +let ticket_diffs ctxt ~self_contract ~arg_type_has_tickets + ~storage_type_has_tickets ~arg ~old_storage ~new_storage ~lazy_storage_diff + = + let open Lwt_result_syntax in + (* Collect ticket-token balances of the incoming parameters. *) + let* arg_tickets, ctxt = + ticket_balances_of_value ctxt ~include_lazy:true arg_type_has_tickets arg + in + let* lazy_storage_diff, ctxt = + ticket_diffs_of_lazy_storage_diff + ctxt + ~storage_type_has_tickets + lazy_storage_diff + in + let* old_storage_strict, ctxt = + ticket_balances_of_value + ctxt + ~include_lazy:false + storage_type_has_tickets + old_storage + in + let* new_storage_strict, ctxt = + ticket_balances_of_value + ctxt + ~include_lazy:false + storage_type_has_tickets + new_storage + in + let*? additions, ctxt = + Ticket_token_map.add ctxt new_storage_strict lazy_storage_diff + in + let*? total_storage_diff, ctxt = + Ticket_token_map.sub ctxt additions old_storage_strict + in + let*? diff, ctxt = Ticket_token_map.sub ctxt total_storage_diff arg_tickets in + let* ticket_receipt, ctxt = + Ticket_token_map.to_ticket_receipt + ctxt + ~owner:Destination.(Contract self_contract) + total_storage_diff + in + return (diff, ticket_receipt, ctxt) + +let update_ticket_balances ctxt ~self_contract ~ticket_diffs operations = + let open Lwt_result_syntax in + let validate_spending_budget ctxt + (Ticket_token.Ex_token {ticketer; _} as ticket_token) amount = + if Contract.equal ticketer self_contract then + (* It's okay to send any amount of ticket-tokens minted by the current + contract (self). Hence tickets stored by their ticketer are not + stored in the ticket table and don't need to be updated here. *) + return (true, ctxt) + else + let+ balance_diff, ctxt = + Ticket_token_map.balance_diff ctxt ticket_token ticket_diffs + in + (* The balance-diff represents the number of units of a ticket-token, + that is changed for the [self] contract. A negative diff means that + an amount of ticket-tokens were not saved in the storage and are + eligible for transfer to another contract. + + For example, if 5 units of a ticket-token "Alice Red" were pulled from + the storage, the corresponding diff is -5. That means at most 5 units + of "Alice Red" can be transferred. Any amount exceeding that would + result in a validation error. + *) + (Compare.Z.(Script_int.to_zint amount <= Z.neg balance_diff), ctxt) + in + (* Collect diffs from operations *) + let* ticket_op_diffs, ctxt = + Ticket_operations_diff.ticket_diffs_of_operations ctxt operations + in + (* Update balances for self-contract. *) + let*? ticket_diffs, ctxt = Ticket_token_map.to_list ctxt ticket_diffs in + let* total_storage_diff, ctxt = + update_ticket_balances_for_self_contract ctxt ~self_contract ticket_diffs + in + (* Update balances for operations. *) + List.fold_left_es + (fun (total_storage_diff, ctxt) + {Ticket_operations_diff.ticket_token; total_amount; destinations} -> + (* Verify that we are able to spend the given amount of ticket-tokens. *) + let* is_valid_balance_update, ctxt = + validate_spending_budget ctxt ticket_token total_amount + in + let*? () = + error_unless + is_valid_balance_update + (invalid_ticket_transfer_error + ~ticket_token + ~amount:(Script_int.to_zint total_amount)) + in + let*? destinations, ctxt = + List.fold_left_e + (fun (acc, ctxt) (token, (amount : Script_typed_ir.ticket_amount)) -> + (* Consume some gas for traversing the list. *) + let open Result_syntax in + let+ ctxt = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + in + ((token, Script_int.(to_zint (amount :> n num))) :: acc, ctxt)) + ([], ctxt) + destinations + in + update_ticket_balances ctxt ~total_storage_diff ticket_token destinations) + (total_storage_diff, ctxt) + ticket_op_diffs diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.mli new file mode 100644 index 000000000000..621fb196a8ec --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_accounting.mli @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** [ticket_diffs ctxt ~arg_type_has_tickets ~storage_type_has_tickets arg + old_storage new_storage lazy_storage_diff] returns a map from + ticket-tokens to balance-differences that represents the change in balance + for a contract due to changes of tickets in the storage. The assumption is + that before calling [ticket_diffs], all tickets that are owned by a contract + exist either in the [old_storage] or the [arg]. After execution, only + tickets in [new_storage] are owned by the contract. Note that this function + avoids traversing the lazy part of the storage. +*) +val ticket_diffs : + context -> + self_contract:Contract.t -> + arg_type_has_tickets:'arg Ticket_scanner.has_tickets -> + storage_type_has_tickets:'storage Ticket_scanner.has_tickets -> + arg:'arg -> + old_storage:'storage -> + new_storage:'storage -> + lazy_storage_diff:Lazy_storage.diffs_item list -> + (Z.t Ticket_token_map.t * Ticket_receipt.t * context) tzresult Lwt.t + +(** [ticket_balances_of_value ctxt ~include_lazy has_tickets value] + scans all tickets in the given [value] using the type-witness [has_tickets] + and returns a map from ticket-tokens to the amount. *) +val ticket_balances_of_value : + context -> + include_lazy:bool -> + 'a Ticket_scanner.has_tickets -> + 'a -> + (Z.t Ticket_token_map.t * context) tzresult Lwt.t + +(** [update_ticket_balances ctxt ~self_contract ~ticket_diffs operations] updates the + ticket balances according to the [ticket_diffs] map and the set of + operations. The function also returns the storage size diff resulting from + updating the ticket-balance table in the context. + + Invariant: this function must be called after applying the lazy-storage + diffs affecting any contracts in the given operations. + + The function fails in case an invalid ticket-token-balance update is + detected. The [ticket_diffs] argument represents the change of ticket-tokens + for the [self] contract. It also specifies a "budget" for outgoing + ticket-tokens. +*) +val update_ticket_balances : + context -> + self_contract:Contract.t -> + ticket_diffs:Z.t Ticket_token_map.t -> + Script_typed_ir.packed_internal_operation list -> + (Z.t * context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_amount.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_amount.ml new file mode 100644 index 000000000000..9bc9cbbfebf6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_amount.ml @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_int + +type t = n num + +let of_n n = + if Compare.Int.(Script_int.(compare n zero_n) > 0) then Some (n : t) else None + +let of_z z = Option.bind (is_nat z) of_n + +let of_zint z = of_z @@ of_zint z + +let add = add_n + +let sub a b = of_z @@ sub a b + +let one = one_n + +let encoding = + let open Data_encoding in + conv_with_guard + to_zint + (fun n -> Option.value_e ~error:"expecting positive number" @@ of_zint n) + n diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_amount.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_amount.mli new file mode 100644 index 000000000000..191e0949cc70 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_amount.mli @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_int + +(* A type for ticket amount values to ensure positivity *) +type t = private n num + +val encoding : t Data_encoding.t + +(* Converts a natural number to a ticket amount value unless the input is zero *) +val of_n : n num -> t option + +(* Converts a integral number to a ticket amount value unless the input is not positive *) +val of_z : z num -> t option + +val of_zint : Z.t -> t option + +val add : t -> t -> t + +(* Subtract among ticket amount values unless the resultant amount is not positive *) +val sub : t -> t -> t option + +val one : t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.ml new file mode 100644 index 000000000000..915f803d1f7f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.ml @@ -0,0 +1,88 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let make ctxt ~owner ~ticketer ~contents_type ~contents = + let open Lwt_result_syntax in + let ticketer_address = + Script_typed_ir. + {destination = Contract ticketer; entrypoint = Entrypoint.default} + in + let owner_address = + Script_typed_ir.{destination = owner; entrypoint = Entrypoint.default} + in + let* ticketer, ctxt = + Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized_legacy + Script_typed_ir.address_t + ticketer_address + in + let* owner, ctxt = + Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized_legacy + Script_typed_ir.address_t + owner_address + in + Lwt.return + @@ Ticket_hash.make + ctxt + ~ticketer:(Micheline.root ticketer) + ~ty:contents_type + ~contents + ~owner:(Micheline.root owner) + +(* This function extracts nodes of: + - Ticketer + - Type of content + - Content + - Owner + to generate at ticket-balance key-hash.*) +let of_ex_token ctxt ~owner + (Ticket_token.Ex_token {ticketer; contents_type; contents}) = + let loc = Micheline.dummy_location in + Script_ir_unparser.unparse_ty ~loc ctxt contents_type + >>?= fun (cont_ty_unstripped, ctxt) -> + (* We strip the annotations from the content type in order to map + tickets with the same content type, but with different annotations, to the + same hash. *) + Gas.consume ctxt (Script.strip_annotations_cost cont_ty_unstripped) + >>?= fun ctxt -> + let ty = Script.strip_annotations cont_ty_unstripped in + Script_ir_unparser.unparse_comparable_data + ctxt + Script_ir_unparser.Optimized_legacy + contents_type + contents + >>=? fun (contents, ctxt) -> + make + ctxt + ~owner + ~ticketer + ~contents_type:ty + ~contents:(Micheline.root contents) diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.mli new file mode 100644 index 000000000000..53af20ca9ada --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_balance_key.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** This module exposes a function for generating a ticket-balance key-hash + given an owner and a ticket-token. The key-hash is used for populating the + global ticket-balance table that tracks ownership of tickets for different tokens. + *) + +(** [make ~owner ~ticketer ~contents_type ~contents] returns [key_hash] of the + given [owner], [ticketer], [contents_type] and [contents]. Note that the + [location] of the [Script.node] values [contents_type] and [contents] are + irrelevant since [Ticket_hash.make] will strip the locations before calculating the hash. *) +val make : + context -> + owner:Destination.t -> + ticketer:Contract.t -> + contents_type:Script.node -> + contents:Script.node -> + (Ticket_hash.t * context) tzresult Lwt.t + +(** [of_ex_token ctxt ~owner ex_token] returns the [key_hash] of the + given [owner] and [ex_token]. *) +val of_ex_token : + context -> + owner:Destination.t -> + Ticket_token.ex_token -> + (Ticket_hash.t * context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_costs.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_costs.ml new file mode 100644 index 000000000000..932f2ae8fa30 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_costs.ml @@ -0,0 +1,64 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +module S = Saturation_repr + +module Constants = struct + let cost_collect_tickets_step = S.safe_int 80 + + let cost_has_tickets_of_ty type_size = + S.add (S.safe_int 10) (S.mul (S.safe_int 6) type_size) + + let cost_compare_ticket_hash = S.safe_int 10 + + let cost_compare_key_contract = S.safe_int 10 +end + +let consume_gas_steps ctxt ~step_cost ~num_steps = + let ( * ) = S.mul in + if Compare.Int.(num_steps <= 0) then Ok ctxt + else + let gas = + Gas.atomic_step_cost (step_cost * Saturation_repr.safe_int num_steps) + in + Gas.consume ctxt gas + +let has_tickets_of_ty_cost ty = + Constants.cost_has_tickets_of_ty + Script_typed_ir.(ty_size ty |> Type_size.to_int) + +(** Reusing the gas model from [Michelson_v1_gas.Cost_of.neg] + Approximating 0.066076 x term *) +let negate_cost z = + let size = (7 + Z.numbits z) / 8 in + Gas.(S.safe_int 25 +@ S.shift_right (S.safe_int size) 4) + +(** Reusing the gas model from [Michelson_v1_gas.Cost_of.add] *) +let add_int_cost = Michelson_v1_gas.Cost_of.Interpreter.add_int + +(** Reusing the gas model from [Michelson_v1_gas.Cost_of.add] *) +let add_z_cost z1 z2 = + add_int_cost (Script_int.of_zint z1) (Script_int.of_zint z2) diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_costs.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_costs.mli new file mode 100644 index 000000000000..5fa21acf9f5d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_costs.mli @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module contains constants and utility functions for gas metering + functions used for extracting and handling tickets for the global ticket + balance table. *) + +module Constants : sig + val cost_collect_tickets_step : Alpha_context.Gas.cost + + val cost_compare_ticket_hash : Alpha_context.Gas.cost + + val cost_compare_key_contract : Alpha_context.Gas.cost +end + +(** [consume_gas_steps ctxt ~num_steps] consumes gas corresponding to + a given [num_steps] and [step_cost]. It's useful for paying for gas + upfront where the number of steps can be determined. + + This function is generic and should probably be moved. See issue + https://gitlab.com/tezos/tezos/-/issues/1950. + + *) +val consume_gas_steps : + Alpha_context.t -> + step_cost:Alpha_context.Gas.cost -> + num_steps:int -> + Alpha_context.t tzresult + +(** [has_tickets_of_ty_cost ty] returns the cost of producing a [has_tickets], + used internally in the [Ticket_scanner] module. *) +val has_tickets_of_ty_cost : + ('a, _) Script_typed_ir.ty -> Saturation_repr.may_saturate Saturation_repr.t + +(** [negate_cost z] returns the cost of negating the given value [z]. *) +val negate_cost : Z.t -> Alpha_context.Gas.cost + +(** [add_int_cost n1 n2] returns the cost of adding the values [n1] and [n2]. *) +val add_int_cost : + Script_int.n Script_int.num -> + Script_int.n Script_int.num -> + Alpha_context.Gas.cost + +(** [add_z_cost z1 z2] returns the cost of adding the values [z1] and [z2]. *) +val add_z_cost : Z.t -> Z.t -> Alpha_context.Gas.cost diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.ml new file mode 100644 index 000000000000..fc7f79181e18 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.ml @@ -0,0 +1,80 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Failed_to_hash_node + +let () = + register_error_kind + `Branch + ~id:"Failed_to_hash_node" + ~title:"Failed to hash node" + ~description:"Failed to hash node for a key in the ticket-balance table" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Failed to hash node for a key in the ticket-balance table") + Data_encoding.empty + (function Failed_to_hash_node -> Some () | _ -> None) + (fun () -> Failed_to_hash_node) + +let hash_bytes_cost bytes = + let module S = Saturation_repr in + let ( + ) = S.add in + let v0 = S.safe_int @@ Bytes.length bytes in + let ( lsr ) = S.shift_right in + S.safe_int 200 + (v0 + (v0 lsr 2)) |> Gas_limit_repr.atomic_step_cost + +let hash_of_node ctxt node = + Raw_context.consume_gas ctxt (Script_repr.strip_locations_cost node) + >>? fun ctxt -> + let node = Micheline.strip_locations node in + Result.of_option + ~error:(Error_monad.trace_of_error Failed_to_hash_node) + (Data_encoding.Binary.to_bytes_opt Script_repr.expr_encoding node) + >>? fun bytes -> + Raw_context.consume_gas ctxt (hash_bytes_cost bytes) >|? fun ctxt -> + ( Ticket_hash_repr.of_script_expr_hash @@ Script_expr_hash.hash_bytes [bytes], + ctxt ) + +let hash_of_node_uncarbonated node = + let node = Micheline.strip_locations node in + Result.of_option + ~error:(Error_monad.trace_of_error Failed_to_hash_node) + (Data_encoding.Binary.to_bytes_opt Script_repr.expr_encoding node) + >|? fun bytes -> + Ticket_hash_repr.of_script_expr_hash @@ Script_expr_hash.hash_bytes [bytes] + +let make ctxt ~ticketer ~ty ~contents ~owner = + hash_of_node ctxt + @@ Micheline.Seq (Micheline.dummy_location, [ticketer; ty; contents; owner]) + +let make_uncarbonated ~ticketer ~ty ~contents ~owner = + hash_of_node_uncarbonated + @@ Micheline.Seq (Micheline.dummy_location, [ticketer; ty; contents; owner]) + +module Internal_for_tests = struct + let make_uncarbonated = make_uncarbonated +end diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.mli new file mode 100644 index 000000000000..1ade9e0dda8d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_builder.mli @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [make ctxt ~ticketer ~ty ~contents ~owner] creates a hashed + representation of the given [ticketer], [ty], [contents] and + [owner]. +*) +val make : + Raw_context.t -> + ticketer:Script_repr.node -> + ty:Script_repr.node -> + contents:Script_repr.node -> + owner:Script_repr.node -> + (Ticket_hash_repr.t * Raw_context.t) tzresult + +module Internal_for_tests : sig + (** As [make] but do not account for gas consumption *) + val make_uncarbonated : + ticketer:Script_repr.node -> + ty:Script_repr.node -> + contents:Script_repr.node -> + owner:Script_repr.node -> + Ticket_hash_repr.t tzresult +end diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.ml new file mode 100644 index 000000000000..21c186911404 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.ml @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Script_expr_hash + +let of_script_expr_hash t = t + +let zero = zero + +include Compare.Make (struct + type nonrec t = t + + let compare = compare +end) + +module Index = Script_expr_hash diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.mli new file mode 100644 index 000000000000..fa3b36f3029c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_hash_repr.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Ticket hashes are used to uniquely identify pairs made of + Michelson ticktes and their owner. + + They are used by the protocol to keep record of a tickets ledger, + that is how many tickets smart contracts own. More precisely, they + are used as keys for the {!Storage.Ticket_balance} table. *) + +(** A ticket hash is computed by the function [make] and is a + combination of a [ticketer], a [content type], a [content], and an + [owner]. + + {b Note:} This invariant can be invalidated if the [key_hash] is + created from the [encoding]. *) +type t + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +val to_b58check : t -> string + +val of_b58check_opt : string -> t option + +val of_b58check_exn : string -> t + +val of_bytes_exn : bytes -> t + +val of_bytes_opt : bytes -> t option + +include Compare.S with type t := t + +val zero : t + +val of_script_expr_hash : Script_expr_hash.t -> t + +module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.ml new file mode 100644 index 000000000000..d49fe0b3cc5d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.ml @@ -0,0 +1,283 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += Failed_to_load_big_map_value_type of Big_map.Id.t + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"Failed_to_load_big_map_value_type" + ~title:"Failed to load big-map value type" + ~description: + "Failed to load big-map value type when computing ticket diffs." + ~pp:(fun ppf big_map_id -> + Format.fprintf + ppf + "Failed to load big-map value type for big-map-id: '%a'" + Z.pp_print + (Big_map.Id.unparse_to_z big_map_id)) + (obj1 (req "big_map_id" Big_map.Id.encoding)) + (function + | Failed_to_load_big_map_value_type big_map_id -> Some big_map_id + | _ -> None) + (fun big_map_id -> Failed_to_load_big_map_value_type big_map_id) + +(** Extracts the ticket-token and amount from an ex_ticket value. *) +let token_and_amount ctxt ex_ticket = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + >|? fun ctxt -> + let token, amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ex_ticket + in + ((token, Script_int.(to_zint (amount :> n num))), ctxt) + +(** Extracts the ticket-token and amount from an ex_ticket value and returns + the opposite of the amount. This is used to account for removal of tickets inside + big maps when either a ticket is taken out of a big map or a whole big map is + dropped. *) +let neg_token_and_amount ctxt ex_ticket = + token_and_amount ctxt ex_ticket >>? fun ((token, amount), ctxt) -> + Gas.consume ctxt (Ticket_costs.negate_cost amount) >|? fun ctxt -> + ((token, Z.neg amount), ctxt) + +let parse_value_type ctxt value_type = + Script_ir_translator.parse_big_map_value_ty + ctxt + ~legacy:true + (Micheline.root value_type) + +(** Collects all ticket-token balances contained in the given node and prepends + them to the accumulator [acc]. The given [get_token_and_amount] function + extracts the ticket-token and amount (either positive or negative) from an + [ex_ticket] value, depending on whether the diff stems from adding or + removing a value containing tickets. *) +let collect_token_diffs_of_node ctxt has_tickets node ~get_token_and_amount acc + = + Ticket_scanner.tickets_of_node + ctxt + (* It's currently not possible to have nested lazy structures, but this is + for future proofing. *) + ~include_lazy:true + has_tickets + (Micheline.root node) + >>=? fun (ex_tickets, ctxt) -> + List.fold_left_e + (fun (acc, ctxt) ticket -> + get_token_and_amount ctxt ticket >|? fun (item, ctxt) -> + (item :: acc, ctxt)) + (acc, ctxt) + ex_tickets + >>?= return + +(** A module for keeping track of script-key-hashes. It's used for looking up + keys for multiple big-map updates referencing the same key. + *) + +module Key_hash_map = + Carbonated_map.Make + (struct + type context = Alpha_context.context + + let consume = Alpha_context.Gas.consume + end) + (struct + type t = Script_expr_hash.t + + let compare = Script_expr_hash.compare + + let compare_cost _ = Ticket_costs.Constants.cost_compare_ticket_hash + end) + +(** Collects all ticket-token diffs from a big-map update and prepends them + to the accumulator [acc]. *) +let collect_token_diffs_of_big_map_update ctxt ~big_map_id has_tickets + {Lazy_storage_kind.Big_map.key = _; key_hash; value} already_updated acc = + let collect_token_diffs_of_node_option ctxt ~get_token_and_amount expr_opt acc + = + match expr_opt with + | Some expr -> + collect_token_diffs_of_node + ctxt + has_tickets + expr + ~get_token_and_amount + acc + | None -> return (acc, ctxt) + in + (* First check if the key-hash has already been updated, in that case pull the + value from the [already_updated] map. Note that this should not happen with + the current implementation of big-map overlays as it guarantees that keys + are unique. The extra check is used for future proofing. + *) + ( Key_hash_map.find ctxt key_hash already_updated >>?= fun (val_opt, ctxt) -> + match val_opt with + | Some updated_value -> return (updated_value, ctxt) + | None -> + (* Load tickets from the old value that was removed. *) + Big_map.get_opt ctxt big_map_id key_hash >|=? fun (ctxt, old_value) -> + (old_value, ctxt) ) + >>=? fun (old_value, ctxt) -> + collect_token_diffs_of_node_option + ctxt + ~get_token_and_amount:neg_token_and_amount + old_value + acc + >>=? fun (acc, ctxt) -> + Key_hash_map.update + ctxt + key_hash + (fun ctxt _ -> ok (Some value, ctxt)) + already_updated + >>?= fun (already_updated, ctxt) -> + (* TODO: #2303 + Avoid re-parsing the value. + In order to find tickets from the new value, we need to parse it. It would + be more efficient if the value was already present. + *) + collect_token_diffs_of_node_option + ctxt + ~get_token_and_amount:token_and_amount + value + acc + >|=? fun (tickets, ctxt) -> (tickets, already_updated, ctxt) + +(** Collects all ticket-token diffs from a list of big-map updates and prepends + them to the accumulator [acc]. *) +let collect_token_diffs_of_big_map_updates ctxt big_map_id ~value_type updates + acc = + (* TODO: #2303 + Avoid re-parsing the value type. + We should have the non-serialized version of the value type. + *) + parse_value_type ctxt value_type + >>?= fun (Script_typed_ir.Ex_ty value_type, ctxt) -> + Ticket_scanner.type_has_tickets ctxt value_type + >>?= fun (has_tickets, ctxt) -> + List.fold_left_es + (fun (acc, already_updated, ctxt) update -> + collect_token_diffs_of_big_map_update + ctxt + ~big_map_id + has_tickets + update + already_updated + acc) + (acc, Key_hash_map.empty, ctxt) + updates + >|=? fun (acc, _already_updated, ctxt) -> (acc, ctxt) + +(** Given a big-map id, this function collects ticket-token diffs and prepends + them to the accumulator [acc]. *) +let collect_token_diffs_of_big_map ctxt ~get_token_and_amount big_map_id acc = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + >>?= fun ctxt -> + Big_map.exists ctxt big_map_id >>=? fun (ctxt, key_val_tys) -> + match key_val_tys with + | Some (_key_ty, value_ty) -> + (* TODO: #2303 + Avoid re-parsing the value type. + In order to find tickets from the value, we need to parse the value + type. It would be more efficient if the value preserved. + *) + parse_value_type ctxt value_ty + >>?= fun (Script_typed_ir.Ex_ty value_type, ctxt) -> + Ticket_scanner.type_has_tickets ctxt value_type + >>?= fun (has_tickets, ctxt) -> + (* Iterate over big-map items. *) + Big_map.list_key_values ctxt big_map_id >>=? fun (ctxt, exprs) -> + List.fold_left_es + (fun (acc, ctxt) (_key_hash, node) -> + collect_token_diffs_of_node + ctxt + has_tickets + node + ~get_token_and_amount + acc) + (acc, ctxt) + exprs + | None -> tzfail (Failed_to_load_big_map_value_type big_map_id) + +(** Collects ticket-token diffs from a big-map and a list of updates, and + prepends them to the given accumulator [acc]. *) +let collect_token_diffs_of_big_map_and_updates ctxt big_map_id updates acc = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + >>?= fun ctxt -> + Big_map.exists ctxt big_map_id >>=? fun (ctxt, key_val_opt) -> + match key_val_opt with + | Some (_val, value_type) -> + collect_token_diffs_of_big_map_updates + ctxt + big_map_id + ~value_type + updates + acc + | None -> tzfail (Failed_to_load_big_map_value_type big_map_id) + +(** Inspects the given [Lazy_storage.diffs_item] and prepends all ticket-token + diffs, resulting from the updates, to the given accumulator [acc]. *) +let collect_token_diffs_of_big_map_diff ctxt diff_item acc = + Gas.consume ctxt Ticket_costs.Constants.cost_collect_tickets_step + >>?= fun ctxt -> + match diff_item with + | Lazy_storage.Item (Lazy_storage_kind.Big_map, big_map_id, Remove) -> + (* Collect all removed tokens from the big-map. *) + collect_token_diffs_of_big_map + ctxt + ~get_token_and_amount:neg_token_and_amount + big_map_id + acc + | Item (Lazy_storage_kind.Big_map, big_map_id, Update {init; updates}) -> ( + match init with + | Lazy_storage.Existing -> + (* Collect token diffs from the updates to the big-map. *) + collect_token_diffs_of_big_map_and_updates ctxt big_map_id updates acc + | Copy {src} -> + (* Collect tokens diffs from the source of the copied big-map. *) + collect_token_diffs_of_big_map + ctxt + ~get_token_and_amount:token_and_amount + src + acc + >>=? fun (acc, ctxt) -> + (* Collect token diffs from the updates to the copied big-map. *) + collect_token_diffs_of_big_map_and_updates ctxt src updates acc + | Alloc {key_type = _; value_type} -> + collect_token_diffs_of_big_map_updates + ctxt + big_map_id + ~value_type + updates + acc) + | Item (Sapling_state, _, _) -> return (acc, ctxt) + +let ticket_diffs_of_lazy_storage_diff ctxt diffs_items = + List.fold_left_es + (fun (acc, ctxt) diff_item -> + collect_token_diffs_of_big_map_diff ctxt diff_item acc) + ([], ctxt) + diffs_items diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.mli new file mode 100644 index 000000000000..726b37539c5e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_lazy_storage_diff.mli @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [ticket_diffs_of_lazy_storage_diff ctxt diffs] returns a list of ticket-token + balance differences, given a list, [diffs], of lazy storage diff items. + *) +val ticket_diffs_of_lazy_storage_diff : + Alpha_context.context -> + Alpha_context.Lazy_storage.diffs_item list -> + ((Ticket_token.ex_token * Z.t) list * Alpha_context.context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.ml new file mode 100644 index 000000000000..e17a24ff4dc8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.ml @@ -0,0 +1,299 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type ticket_transfer = { + destination : Destination.t; + tickets : Ticket_scanner.ex_ticket list; +} + +type ticket_token_diff = { + ticket_token : Ticket_token.ex_token; + total_amount : Script_int.n Script_int.num; + destinations : (Destination.t * Ticket_amount.t) list; +} + +type error += Failed_to_get_script of Contract.t | Contract_not_originated + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"Failed_to_get_script" + ~title:"Failed to get script for contract" + ~description: + "Failed to get script for contract when scanning operations for tickets" + ~pp:(fun ppf contract -> + Format.fprintf + ppf + "Failed to get script for contract %a" + Contract.pp + contract) + (obj1 (req "contract" Contract.encoding)) + (function Failed_to_get_script c -> Some c | _ -> None) + (fun c -> Failed_to_get_script c) ; + register_error_kind + `Permanent + ~id:"contract_not_originated" + ~title:"Contract not originated" + ~description:"Non originated contract detected in ticket update." + ~pp:(fun ppf () -> Format.fprintf ppf "Contract was not pre-originated") + unit + (function Contract_not_originated -> Some () | _ -> None) + (fun () -> Contract_not_originated) + +(** A carbonated map where the keys are destination (contract or tx_rollup). *) +module Destination_map = + Carbonated_map.Make + (struct + type context = Alpha_context.context + + let consume = Alpha_context.Gas.consume + end) + (struct + type t = Destination.t + + let compare = Destination.compare + + (* TODO: #2667 + Change cost-function to one for comparing destinations. + Not expected to have any performance impact but we should update for + completeness. + *) + let compare_cost _ = Ticket_costs.Constants.cost_compare_key_contract + end) + +(** A module for mapping ticket-tokens to a map of contract destinations and + amounts. The values specify how to distribute the spending of a ticket-token + across different contracts. + + In the example below, there is a total of 4 Token1 ticket-tokens + transferred: three units are sent to contract K1 and one unit to K2. + Additionally, there are 12 units of Token2 sent to K2, K7 and K8. And one + unit of Token3 sent to K1. + { + Token1 -> { K1 -> 3, K2 -> 1 } + Token2 -> { K2 -> 1, K7 -> 10, K8 -> 1} + Token3 -> { K1 -> 1 } + } +*) +module Ticket_token_map = struct + include Ticket_token_map + + (** Adds a ticket-token with a destination and an amount to the map. + The layout of the map parameter is as described above. Its type is: + + (n num Destination_map.t) Ticket_token_map.t + + As explained above, the inner map expresses a list of destination + contracts and outgoing amount pairs. + + Invariant: + - The internal contract-indexed map cannot be empty. + + *) + let add ctxt ~ticket_token ~destination ~(amount : Ticket_amount.t) map = + Ticket_token_map.update + ctxt + ticket_token + (fun ctxt old_val -> + match old_val with + | None -> + (* Create a new map with a single contract-and amount pair. *) + let map = Destination_map.singleton destination amount in + ok (Some map, ctxt) + | Some destination_map -> + (* Update the inner contract map *) + let update ctxt prev_amt_opt = + match prev_amt_opt with + | Some (prev_amount : Ticket_amount.t) -> + Gas.consume + ctxt + Script_int.( + Ticket_costs.add_int_cost + (prev_amount :> n num) + (amount :> n num)) + >|? fun ctxt -> + (Some (Ticket_amount.add prev_amount amount), ctxt) + | None -> ok (Some amount, ctxt) + in + Destination_map.update ctxt destination update destination_map + >|? fun (destination_map, ctxt) -> (Some destination_map, ctxt)) + map +end + +let tickets_of_transaction ctxt ~destination ~parameters_ty ~parameters = + Ticket_scanner.type_has_tickets ctxt parameters_ty + >>?= fun (has_tickets, ctxt) -> + Ticket_scanner.tickets_of_value ~include_lazy:true ctxt has_tickets parameters + >>=? fun (tickets, ctxt) -> return (Some {destination; tickets}, ctxt) + +(** Extract tickets of an origination operation by scanning the storage. *) +let tickets_of_origination ctxt ~preorigination ~storage_type ~storage = + (* Extract any tickets from the storage. Note that if the type of the contract + storage does not contain tickets, storage is not scanned. *) + Ticket_scanner.type_has_tickets ctxt storage_type + >>?= fun (has_tickets, ctxt) -> + Ticket_scanner.tickets_of_value ctxt ~include_lazy:true has_tickets storage + >|=? fun (tickets, ctxt) -> + let destination = Destination.Contract (Originated preorigination) in + (Some {tickets; destination}, ctxt) + +let tickets_of_operation ctxt + (Script_typed_ir.Internal_operation {source = _; operation; nonce = _}) = + match operation with + | Transaction_to_implicit _ -> return (None, ctxt) + | Transaction_to_implicit_with_ticket + { + destination; + ticket; + ticket_ty = Script_typed_ir.Ticket_t (ty, _); + unparsed_ticket = _; + amount = _; + } -> + return + ( Some + { + destination = Destination.Contract (Implicit destination); + tickets = [Ex_ticket (ty, ticket)]; + }, + ctxt ) + | Transaction_to_smart_contract + { + amount = _; + unparsed_parameters = _; + entrypoint = _; + destination; + location = _; + parameters_ty; + parameters; + } -> + tickets_of_transaction + ctxt + ~destination:(Destination.Contract (Originated destination)) + ~parameters_ty + ~parameters + | Transaction_to_tx_rollup + {destination; unparsed_parameters = _; parameters_ty; parameters} -> + let Tx_rollup_parameters.{ex_ticket; l2_destination = _} = + Tx_rollup_parameters.get_deposit_parameters parameters_ty parameters + in + return + ( Some + { + destination = Destination.Tx_rollup destination; + tickets = [ex_ticket]; + }, + ctxt ) + | Transaction_to_sc_rollup + { + destination; + entrypoint = _; + parameters_ty; + parameters; + unparsed_parameters = _; + } -> + (* Note that zero-amount tickets to a rollup is not permitted. *) + tickets_of_transaction + ctxt + ~destination:(Destination.Sc_rollup destination) + ~parameters_ty + ~parameters + | Transaction_to_zk_rollup + { + destination; + unparsed_parameters = _; + parameters_ty = Pair_t (Ticket_t (ty, _), Bytes_t, _, _); + parameters = ticket, _op; + } -> + let ex_ticket = Ticket_scanner.Ex_ticket (ty, ticket) in + return + ( Some + { + destination = Destination.Zk_rollup destination; + tickets = [ex_ticket]; + }, + ctxt ) + | Origination + { + delegate = _; + code = _; + unparsed_storage = _; + credit = _; + preorigination; + storage_type; + storage; + } -> + tickets_of_origination ctxt ~preorigination ~storage_type ~storage + | Delegation _ | Event _ -> return (None, ctxt) + +let add_transfer_to_token_map ctxt token_map {destination; tickets} = + List.fold_left_es + (fun (token_map, ctxt) ticket -> + let ticket_token, amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ticket + in + Ticket_token_map.add ctxt ~ticket_token ~destination ~amount token_map) + (token_map, ctxt) + tickets + +let ticket_token_map_of_operations ctxt ops = + List.fold_left_es + (fun (token_map, ctxt) op -> + tickets_of_operation ctxt op >>=? fun (res, ctxt) -> + match res with + | Some ticket_trans -> + add_transfer_to_token_map ctxt token_map ticket_trans + | None -> return (token_map, ctxt)) + (Ticket_token_map.empty, ctxt) + ops + +(** Traverses a list of operations and scans for tickets. *) +let ticket_diffs_of_operations ctxt operations = + ticket_token_map_of_operations ctxt operations >>=? fun (token_map, ctxt) -> + Ticket_token_map.fold_e + ctxt + (fun ctxt acc ticket_token destination_map -> + (* Calculate the total amount of outgoing units for the current + ticket-token. *) + Destination_map.fold_e + ctxt + (fun ctxt total_amount _destination (amount : Ticket_amount.t) -> + Gas.consume + ctxt + Script_int.( + Ticket_costs.add_int_cost total_amount (amount :> n num)) + >|? fun ctxt -> + (Script_int.(add_n total_amount (amount :> n num)), ctxt)) + Script_int.zero_n + destination_map + >>? fun (total_amount, ctxt) -> + Destination_map.to_list ctxt destination_map + >|? fun (destinations, ctxt) -> + ({ticket_token; total_amount; destinations} :: acc, ctxt)) + [] + token_map + |> Lwt.return diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.mli new file mode 100644 index 000000000000..d413a81da9e6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_operations_diff.mli @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A module that provides functionality for extracting ticket-token differences + from a list of operations. *) + +(** A type representing ticket-token balance differences. Each value consists + of: + - [ticket_token] - the type of the ticket. + - [total_amount] - the total amount of transferred ticket-tokens. + - [destinations] - a list of amount and contract pairs. + Invariant: [total_amount] is the sum of the amounts in [destinations]. *) +type ticket_token_diff = private { + ticket_token : Ticket_token.ex_token; + total_amount : Script_int.n Script_int.num; + destinations : + (Alpha_context.Destination.t * Script_typed_ir.ticket_amount) list; +} + +(** [ticket_diffs_of_operations ctxt ops] returns a + list of ticket-tokens diffs given a context, [ctxt], and list of packed + operations, [ops]. The diffs result from either a [Transaction] operation + with parameters containing tickets, or an [Origination] operation with the + initial storage containing tickets. + + Tickets with amount zero are *not* allowed. If a zero-amount ticket is + encountered, a {!Ticket_scanner.Forbidden_zero_ticket_quantity} error is + returned. *) +val ticket_diffs_of_operations : + Alpha_context.context -> + Script_typed_ir.packed_internal_operation list -> + (ticket_token_diff list * Alpha_context.context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.ml new file mode 100644 index 000000000000..8f16bf97db82 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.ml @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type update = {account : Destination.t; amount : Z.t} + +type item = {ticket_token : Ticket_token.unparsed_token; updates : update list} + +type t = item list + +let update_encoding = + let open Data_encoding in + conv + (fun {account; amount} -> (account, amount)) + (fun (account, amount) -> {account; amount}) + (obj2 (req "account" Destination.encoding) (req "amount" z)) + +let item_encoding = + let open Data_encoding in + conv + (fun {ticket_token; updates} -> (ticket_token, updates)) + (fun (ticket_token, updates) -> {ticket_token; updates}) + (obj2 + (req "ticket_token" Ticket_token.unparsed_token_encoding) + (req "updates" (list update_encoding))) + +let encoding = Data_encoding.list item_encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.mli new file mode 100644 index 000000000000..d1397553d26a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_receipt.mli @@ -0,0 +1,42 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** A module for representing the increase/decrease of tickets in the storage. + It will be used to display ticket update information in the operation receipt. *) + +(** Represents that [account]'s storage has delta [amount] for a given ticket *) +type update = {account : Destination.t; amount : Z.t} + +(** List of updates for a [ticket] *) +type item = {ticket_token : Ticket_token.unparsed_token; updates : update list} + +(** A list of ticket tokens and their corresponding updates *) +type t = item list + +val item_encoding : item Data_encoding.t + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.ml new file mode 100644 index 000000000000..152e51c1c635 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.ml @@ -0,0 +1,562 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += + | (* Permanent *) Unsupported_non_empty_overlay + | (* Permanent *) Unsupported_type_operation + +let () = + register_error_kind + `Branch + ~id:"Unsupported_non_empty_overlay" + ~title:"Unsupported non empty overlay" + ~description:"Unsupported big-map value with non-empty overlay" + ~pp:(fun ppf () -> + Format.fprintf ppf "Unsupported big-map value with non-empty overlay") + Data_encoding.empty + (function Unsupported_non_empty_overlay -> Some () | _ -> None) + (fun () -> Unsupported_non_empty_overlay) ; + register_error_kind + `Branch + ~id:"Unsupported_type_operation" + ~title:"Unsupported type operation" + ~description:"Types embedding operations are not supported" + ~pp:(fun ppf () -> + Format.fprintf ppf "Types embedding operations are not supported") + Data_encoding.empty + (function Unsupported_type_operation -> Some () | _ -> None) + (fun () -> Unsupported_type_operation) + +type ex_ticket = + | Ex_ticket : + 'a Script_typed_ir.comparable_ty * 'a Script_typed_ir.ticket + -> ex_ticket + +module Ticket_inspection = struct + (* TODO: 1951 + Replace with use of meta-data for ['a ty] type. + Once ['a ty] values can be extended with custom meta data, this type + can be removed. + *) + (** + Witness flag for whether a type can be populated by a value containing a + ticket. [False_ht] must be used only when a value of the type cannot + contain a ticket. + + This flag is necessary for avoiding ticket collection (see below) to have + quadratic complexity in the order of: size-of-the-type * size-of-value. + + This type is local to the [Ticket_scanner] module and should not be + exported. + + *) + type 'a has_tickets = + | True_ht : _ Script_typed_ir.ticket has_tickets + | False_ht : _ has_tickets + | Pair_ht : + 'a has_tickets * 'b has_tickets + -> ('a, 'b) Script_typed_ir.pair has_tickets + | Union_ht : + 'a has_tickets * 'b has_tickets + -> ('a, 'b) Script_typed_ir.union has_tickets + | Option_ht : 'a has_tickets -> 'a option has_tickets + | List_ht : 'a has_tickets -> 'a Script_list.t has_tickets + | Set_ht : 'k has_tickets -> 'k Script_typed_ir.set has_tickets + | Map_ht : + 'k has_tickets * 'v has_tickets + -> ('k, 'v) Script_typed_ir.map has_tickets + | Big_map_ht : + 'k has_tickets * 'v has_tickets + -> ('k, 'v) Script_typed_ir.big_map has_tickets + + (* Returns whether or not a comparable type embeds tickets. Currently + this function returns [false] for all input. + + The only reason we keep this code is so that in the future, if tickets were + ever to be comparable, the compiler would detect a missing pattern match + case. + + Note that in case tickets are made comparable, this function needs to change + so that constructors like [Union_t] and [Pair_t] are traversed + recursively. + *) + let has_tickets_of_comparable : + type a ret. + a Script_typed_ir.comparable_ty -> (a has_tickets -> ret) -> ret = + fun key_ty k -> + let open Script_typed_ir in + match key_ty with + | Unit_t -> (k [@ocaml.tailcall]) False_ht + | Never_t -> (k [@ocaml.tailcall]) False_ht + | Int_t -> (k [@ocaml.tailcall]) False_ht + | Nat_t -> (k [@ocaml.tailcall]) False_ht + | Signature_t -> (k [@ocaml.tailcall]) False_ht + | String_t -> (k [@ocaml.tailcall]) False_ht + | Bytes_t -> (k [@ocaml.tailcall]) False_ht + | Mutez_t -> (k [@ocaml.tailcall]) False_ht + | Bool_t -> (k [@ocaml.tailcall]) False_ht + | Key_hash_t -> (k [@ocaml.tailcall]) False_ht + | Key_t -> (k [@ocaml.tailcall]) False_ht + | Timestamp_t -> (k [@ocaml.tailcall]) False_ht + | Chain_id_t -> (k [@ocaml.tailcall]) False_ht + | Address_t -> (k [@ocaml.tailcall]) False_ht + | Tx_rollup_l2_address_t -> (k [@ocaml.tailcall]) False_ht + | Pair_t (_, _, _, YesYes) -> (k [@ocaml.tailcall]) False_ht + | Union_t (_, _, _, YesYes) -> (k [@ocaml.tailcall]) False_ht + | Option_t (_, _, Yes) -> (k [@ocaml.tailcall]) False_ht + + (* Short circuit pairing of two [has_tickets] values. + If neither left nor right branch contains a ticket, [False_ht] is + returned. *) + let pair_has_tickets pair ht1 ht2 = + match (ht1, ht2) with False_ht, False_ht -> False_ht | _ -> pair ht1 ht2 + + let map_has_tickets map ht = + match ht with False_ht -> False_ht | _ -> map ht + + type ('a, 'r) continuation = 'a has_tickets -> 'r tzresult + + (* Creates a [has_tickets] type-witness value from the given ['a ty]. + The returned value matches the given shape of the [ty] value, except + it collapses whole branches where no types embed tickets to [False_ht]. + *) + let rec has_tickets_of_ty : + type a ac ret. + (a, ac) Script_typed_ir.ty -> (a, ret) continuation -> ret tzresult = + fun ty k -> + let open Script_typed_ir in + match ty with + | Ticket_t _ -> (k [@ocaml.tailcall]) True_ht + | Unit_t -> (k [@ocaml.tailcall]) False_ht + | Int_t -> (k [@ocaml.tailcall]) False_ht + | Nat_t -> (k [@ocaml.tailcall]) False_ht + | Signature_t -> (k [@ocaml.tailcall]) False_ht + | String_t -> (k [@ocaml.tailcall]) False_ht + | Bytes_t -> (k [@ocaml.tailcall]) False_ht + | Mutez_t -> (k [@ocaml.tailcall]) False_ht + | Key_hash_t -> (k [@ocaml.tailcall]) False_ht + | Key_t -> (k [@ocaml.tailcall]) False_ht + | Timestamp_t -> (k [@ocaml.tailcall]) False_ht + | Address_t -> (k [@ocaml.tailcall]) False_ht + | Tx_rollup_l2_address_t -> (k [@ocaml.tailcall]) False_ht + | Bool_t -> (k [@ocaml.tailcall]) False_ht + | Pair_t (ty1, ty2, _, _) -> + (has_tickets_of_pair [@ocaml.tailcall]) + ty1 + ty2 + ~pair:(fun ht1 ht2 -> Pair_ht (ht1, ht2)) + k + | Union_t (ty1, ty2, _, _) -> + (has_tickets_of_pair [@ocaml.tailcall]) + ty1 + ty2 + ~pair:(fun ht1 ht2 -> Union_ht (ht1, ht2)) + k + | Lambda_t (_, _, _) -> + (* As of H, closures cannot contain tickets because APPLY requires + a packable type and tickets are not packable. *) + (k [@ocaml.tailcall]) False_ht + | Option_t (ty, _, _) -> + (has_tickets_of_ty [@ocaml.tailcall]) ty (fun ht -> + let opt_hty = map_has_tickets (fun ht -> Option_ht ht) ht in + (k [@ocaml.tailcall]) opt_hty) + | List_t (ty, _) -> + (has_tickets_of_ty [@ocaml.tailcall]) ty (fun ht -> + let list_hty = map_has_tickets (fun ht -> List_ht ht) ht in + (k [@ocaml.tailcall]) list_hty) + | Set_t (key_ty, _) -> + (has_tickets_of_comparable [@ocaml.tailcall]) key_ty (fun ht -> + let set_hty = map_has_tickets (fun ht -> Set_ht ht) ht in + (k [@ocaml.tailcall]) set_hty) + | Map_t (key_ty, val_ty, _) -> + (has_tickets_of_key_and_value [@ocaml.tailcall]) + key_ty + val_ty + ~pair:(fun ht1 ht2 -> Map_ht (ht1, ht2)) + k + | Big_map_t (key_ty, val_ty, _) -> + (has_tickets_of_key_and_value [@ocaml.tailcall]) + key_ty + val_ty + ~pair:(fun ht1 ht2 -> Big_map_ht (ht1, ht2)) + k + | Contract_t _ -> (k [@ocaml.tailcall]) False_ht + | Sapling_transaction_t _ -> (k [@ocaml.tailcall]) False_ht + | Sapling_transaction_deprecated_t _ -> (k [@ocaml.tailcall]) False_ht + | Sapling_state_t _ -> (k [@ocaml.tailcall]) False_ht + | Operation_t -> + (* Operations may contain tickets but they should never be passed + why we fail in this case. *) + error Unsupported_type_operation + | Chain_id_t -> (k [@ocaml.tailcall]) False_ht + | Never_t -> (k [@ocaml.tailcall]) False_ht + | Bls12_381_g1_t -> (k [@ocaml.tailcall]) False_ht + | Bls12_381_g2_t -> (k [@ocaml.tailcall]) False_ht + | Bls12_381_fr_t -> (k [@ocaml.tailcall]) False_ht + | Chest_t -> (k [@ocaml.tailcall]) False_ht + | Chest_key_t -> (k [@ocaml.tailcall]) False_ht + + and has_tickets_of_pair : + type a ac b bc c ret. + (a, ac) Script_typed_ir.ty -> + (b, bc) Script_typed_ir.ty -> + pair:(a has_tickets -> b has_tickets -> c has_tickets) -> + (c, ret) continuation -> + ret tzresult = + fun ty1 ty2 ~pair k -> + (has_tickets_of_ty [@ocaml.tailcall]) ty1 (fun ht1 -> + (has_tickets_of_ty [@ocaml.tailcall]) ty2 (fun ht2 -> + (k [@ocaml.tailcall]) (pair_has_tickets pair ht1 ht2))) + + and has_tickets_of_key_and_value : + type k v vc t ret. + k Script_typed_ir.comparable_ty -> + (v, vc) Script_typed_ir.ty -> + pair:(k has_tickets -> v has_tickets -> t has_tickets) -> + (t, ret) continuation -> + ret tzresult = + fun key_ty val_ty ~pair k -> + (has_tickets_of_comparable [@ocaml.tailcall]) key_ty (fun ht1 -> + (has_tickets_of_ty [@ocaml.tailcall]) val_ty (fun ht2 -> + (k [@ocaml.tailcall]) (pair_has_tickets pair ht1 ht2))) + + let has_tickets_of_ty ctxt ty = + Gas.consume ctxt (Ticket_costs.has_tickets_of_ty_cost ty) >>? fun ctxt -> + has_tickets_of_ty ty ok >|? fun ht -> (ht, ctxt) +end + +module Ticket_collection = struct + let consume_gas_steps = + Ticket_costs.consume_gas_steps + ~step_cost:Ticket_costs.Constants.cost_collect_tickets_step + + type accumulator = ex_ticket list + + type 'a continuation = context -> accumulator -> 'a tzresult Lwt.t + + (* Currently this always returns the original list. + + If comparables are ever extended to support tickets, this function + needs to be modified. In particular constructors like [Option] and [Pair] + would have to recurse on their arguments. *) + + let tickets_of_comparable : + type a ret. + context -> + a Script_typed_ir.comparable_ty -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ctxt comp_ty acc k -> + let open Script_typed_ir in + match comp_ty with + | Unit_t -> (k [@ocaml.tailcall]) ctxt acc + | Never_t -> (k [@ocaml.tailcall]) ctxt acc + | Int_t -> (k [@ocaml.tailcall]) ctxt acc + | Nat_t -> (k [@ocaml.tailcall]) ctxt acc + | Signature_t -> (k [@ocaml.tailcall]) ctxt acc + | String_t -> (k [@ocaml.tailcall]) ctxt acc + | Bytes_t -> (k [@ocaml.tailcall]) ctxt acc + | Mutez_t -> (k [@ocaml.tailcall]) ctxt acc + | Bool_t -> (k [@ocaml.tailcall]) ctxt acc + | Key_hash_t -> (k [@ocaml.tailcall]) ctxt acc + | Key_t -> (k [@ocaml.tailcall]) ctxt acc + | Timestamp_t -> (k [@ocaml.tailcall]) ctxt acc + | Chain_id_t -> (k [@ocaml.tailcall]) ctxt acc + | Address_t -> (k [@ocaml.tailcall]) ctxt acc + | Tx_rollup_l2_address_t -> (k [@ocaml.tailcall]) ctxt acc + | Pair_t (_, _, _, YesYes) -> (k [@ocaml.tailcall]) ctxt acc + | Union_t (_, _, _, YesYes) -> (k [@ocaml.tailcall]) ctxt acc + | Option_t (_, _, Yes) -> (k [@ocaml.tailcall]) ctxt acc + + let tickets_of_set : + type a ret. + context -> + a Script_typed_ir.comparable_ty -> + a Script_typed_ir.set -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ctxt key_ty _set acc k -> + consume_gas_steps ctxt ~num_steps:1 >>?= fun ctxt -> + (* This is only invoked to support any future extensions making tickets + comparable. *) + (tickets_of_comparable [@ocaml.tailcall]) ctxt key_ty acc k + + let rec tickets_of_value : + type a ac ret. + include_lazy:bool -> + context -> + a Ticket_inspection.has_tickets -> + (a, ac) Script_typed_ir.ty -> + a -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ~include_lazy ctxt hty ty x acc k -> + let open Script_typed_ir in + consume_gas_steps ctxt ~num_steps:1 >>?= fun ctxt -> + match (hty, ty) with + | False_ht, _ -> (k [@ocaml.tailcall]) ctxt acc + | Pair_ht (hty1, hty2), Pair_t (ty1, ty2, _, _) -> + let l, r = x in + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + hty1 + ty1 + l + acc + (fun ctxt acc -> + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + hty2 + ty2 + r + acc + k) + | Union_ht (htyl, htyr), Union_t (tyl, tyr, _, _) -> ( + match x with + | L v -> + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + htyl + tyl + v + acc + k + | R v -> + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + htyr + tyr + v + acc + k) + | Option_ht el_hty, Option_t (el_ty, _, _) -> ( + match x with + | Some x -> + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + el_hty + el_ty + x + acc + k + | None -> (k [@ocaml.tailcall]) ctxt acc) + | List_ht el_hty, List_t (el_ty, _) -> + let elements = Script_list.to_list x in + (tickets_of_list [@ocaml.tailcall]) + ctxt + ~include_lazy + el_hty + el_ty + elements + acc + k + | Set_ht _, Set_t (key_ty, _) -> + (tickets_of_set [@ocaml.tailcall]) ctxt key_ty x acc k + | Map_ht (_, val_hty), Map_t (key_ty, val_ty, _) -> + (tickets_of_comparable [@ocaml.tailcall]) + ctxt + key_ty + acc + (fun ctxt acc -> + (tickets_of_map [@ocaml.tailcall]) + ctxt + ~include_lazy + val_hty + val_ty + x + acc + k) + | Big_map_ht (_, val_hty), Big_map_t (key_ty, _, _) -> + if include_lazy then + (tickets_of_big_map [@ocaml.tailcall]) ctxt val_hty key_ty x acc k + else (k [@ocaml.tailcall]) ctxt acc + | True_ht, Ticket_t (comp_ty, _) -> + (k [@ocaml.tailcall]) ctxt (Ex_ticket (comp_ty, x) :: acc) + + and tickets_of_list : + type a ac ret. + context -> + include_lazy:bool -> + a Ticket_inspection.has_tickets -> + (a, ac) Script_typed_ir.ty -> + a list -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ctxt ~include_lazy el_hty el_ty elements acc k -> + consume_gas_steps ctxt ~num_steps:1 >>?= fun ctxt -> + match elements with + | elem :: elems -> + (tickets_of_value [@ocaml.tailcall]) + ~include_lazy + ctxt + el_hty + el_ty + elem + acc + (fun ctxt acc -> + (tickets_of_list [@ocaml.tailcall]) + ~include_lazy + ctxt + el_hty + el_ty + elems + acc + k) + | [] -> (k [@ocaml.tailcall]) ctxt acc + + and tickets_of_map : + type k v vc ret. + include_lazy:bool -> + context -> + v Ticket_inspection.has_tickets -> + (v, vc) Script_typed_ir.ty -> + (k, v) Script_typed_ir.map -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ~include_lazy ctxt val_hty val_ty map acc k -> + let (module M) = Script_map.get_module map in + consume_gas_steps ctxt ~num_steps:1 >>?= fun ctxt -> + (* Pay gas for folding over the values *) + consume_gas_steps ctxt ~num_steps:M.size >>?= fun ctxt -> + let values = M.OPS.fold (fun _ v vs -> v :: vs) M.boxed [] in + (tickets_of_list [@ocaml.tailcall]) + ~include_lazy + ctxt + val_hty + val_ty + values + acc + k + + and tickets_of_big_map : + type k v ret. + context -> + v Ticket_inspection.has_tickets -> + k Script_typed_ir.comparable_ty -> + (k, v) Script_typed_ir.big_map -> + accumulator -> + ret continuation -> + ret tzresult Lwt.t = + fun ctxt + val_hty + key_ty + (Big_map {id; diff = {map = _; size}; key_type = _; value_type}) + acc + k -> + consume_gas_steps ctxt ~num_steps:1 >>?= fun ctxt -> + (* Require empty overlay *) + if Compare.Int.(size > 0) then tzfail Unsupported_non_empty_overlay + else + (* Traverse the keys for tickets, although currently keys should never + contain any tickets. *) + (tickets_of_comparable [@ocaml.tailcall]) ctxt key_ty acc (fun ctxt acc -> + (* Accumulate tickets from values of the big-map stored in the context *) + match id with + | Some id -> + let accum (values, ctxt) (_key_hash, exp) = + Script_ir_translator.parse_data + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ctxt + ~allow_forged:true + value_type + (Micheline.root exp) + >|=? fun (v, ctxt) -> (v :: values, ctxt) + in + Big_map.list_key_values ctxt id >>=? fun (ctxt, exps) -> + List.fold_left_es accum ([], ctxt) exps >>=? fun (values, ctxt) -> + (tickets_of_list [@ocaml.tailcall]) + ~include_lazy:true + ctxt + val_hty + value_type + values + acc + k + | None -> (k [@ocaml.tailcall]) ctxt acc) + + let tickets_of_value ctxt ~include_lazy ht ty x = + tickets_of_value ctxt ~include_lazy ht ty x [] (fun ctxt ex_tickets -> + return (ex_tickets, ctxt)) +end + +type 'a has_tickets = + | Has_tickets : + 'a Ticket_inspection.has_tickets * ('a, _) Script_typed_ir.ty + -> 'a has_tickets + +let type_has_tickets ctxt ty = + Ticket_inspection.has_tickets_of_ty ctxt ty >|? fun (has_tickets, ctxt) -> + (Has_tickets (has_tickets, ty), ctxt) + +let tickets_of_value ctxt ~include_lazy (Has_tickets (ht, ty)) = + Ticket_collection.tickets_of_value ctxt ~include_lazy ht ty + +let has_tickets (Has_tickets (ht, _)) = + match ht with Ticket_inspection.False_ht -> false | _ -> true + +let tickets_of_node ctxt ~include_lazy has_tickets expr = + let (Has_tickets (ht, ty)) = has_tickets in + match ht with + | Ticket_inspection.False_ht -> return ([], ctxt) + | _ -> + Script_ir_translator.parse_data + ctxt + ~elab_conf:Script_ir_translator_config.(make ~legacy:true ()) + ~allow_forged:true + ty + expr + >>=? fun (value, ctxt) -> + tickets_of_value ctxt ~include_lazy has_tickets value + +let ex_ticket_size ctxt (Ex_ticket (ty, ticket)) = + (* type *) + Script_typed_ir.ticket_t Micheline.dummy_location ty >>?= fun ty -> + Script_ir_unparser.unparse_ty ~loc:() ctxt ty >>?= fun (ty', ctxt) -> + let ty_nodes, ty_size = Script_typed_ir_size.node_size ty' in + let ty_size_cost = Script_typed_ir_size_costs.nodes_cost ~nodes:ty_nodes in + Gas.consume ctxt ty_size_cost >>?= fun ctxt -> + (* contents *) + let val_nodes, val_size = Script_typed_ir_size.value_size ty ticket in + let val_size_cost = Script_typed_ir_size_costs.nodes_cost ~nodes:val_nodes in + Gas.consume ctxt val_size_cost >>?= fun ctxt -> + (* gas *) + return (Saturation_repr.add ty_size val_size, ctxt) + +let ex_token_and_amount_of_ex_ticket + (Ex_ticket (contents_type, {Script_typed_ir.ticketer; contents; amount})) = + (Ticket_token.Ex_token {ticketer; contents_type; contents}, amount) diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.mli new file mode 100644 index 000000000000..49d3a11b7eeb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_scanner.mli @@ -0,0 +1,104 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides an API for extracting tickets of arbitrary types + from an OCaml values, given a type-witness. *) + +open Alpha_context + +(** A type for representing existentially quantified tickets (tickets with + different types of payloads). An [ex_ticket] value consists of: + - A type-witness representing the type of the content of the ticket. + - A ticket value of the particular content type. + *) +type ex_ticket = + | Ex_ticket : + 'a Script_typed_ir.comparable_ty * 'a Script_typed_ir.ticket + -> ex_ticket + +(** A type-witness that contains information about which branches of a type ['a] + include tickets. This value is used for traversing only the relevant + branches of values when scanning for tickets. *) +type 'a has_tickets + +(** [type_has_tickets ctxt ty] returns a [has_tickets] witness of the given + shape [ty]. + *) +val type_has_tickets : + context -> ('a, _) Script_typed_ir.ty -> ('a has_tickets * context) tzresult + +(** [tickets_of_value ctxt ~include_lazy ht value] extracts all tickets from + the given [value], using the type-witness [ht]. The [include_lazy] flag + determines whether or not to traverse lazy structures (values from the context). + In case the [include_lazy] flag is [true], any big-map contained in the value + must have an empty overlay or else an error of type + [Unsupported_non_empty_overlay] is returned. The reason for this restriction + is that we assume that all lazy big-map diffs should be applied before + calling this function. Dealing with non-empty overlays would be possible + in theory, but practically difficult. The challenge is to distinguish + between overlapping keys between the context and the overlay. + *) +val tickets_of_value : + context -> + include_lazy:bool -> + 'a has_tickets -> + 'a -> + (ex_ticket list * context) tzresult Lwt.t + +(** [tickets_of_node ctxt ~include_lazy ht node] extracts all tickets from + the given [node], using the type-witness [ht].If [ht] indicates that + values of the corresponding type may not contain tickets, the node value is + not parsed. The [include_lazy] flag determines whether or not to traverse + lazy structures (values from the context). In case the [include_lazy] flag + is [true], any big-map contained in the value must have an empty overlay or + else an error of type [Unsupported_non_empty_overlay] is returned. The + reason for this restriction is that we assume that all lazy big-map diffs + should be applied before calling this function. Dealing with non-empty + overlays would be possible in theory, but practically difficult. The + challenge is to distinguish between overlapping keys between the context and + the overlay. + *) +val tickets_of_node : + context -> + include_lazy:bool -> + 'a has_tickets -> + Script.node -> + (ex_ticket list * context) tzresult Lwt.t + +(** [has_tickets ht] returns whether or not the type of the given [has_tickets] + witness [ht] has tickets. *) +val has_tickets : 'a has_tickets -> bool + +(** [ex_ticket_size ctxt ex_ticket] returns the size of the in-memory representation of + [ex_ticket] in bytes. *) +val ex_ticket_size : + context -> + ex_ticket -> + (Saturation_repr.may_saturate Saturation_repr.t * context) tzresult Lwt.t + +(** [ex_token_and_amount_of_ex_ticket ex_ticket] returns the token and amount of + the given ticket [ex_ticket]. *) +val ex_token_and_amount_of_ex_ticket : + ex_ticket -> Ticket_token.ex_token * Script_typed_ir.ticket_amount diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_storage.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_storage.ml new file mode 100644 index 000000000000..f008125c8bd5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_storage.ml @@ -0,0 +1,121 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Negative_ticket_balance of {key : Ticket_hash_repr.t; balance : Z.t} + | Used_storage_space_underflow + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"Negative_ticket_balance" + ~title:"Negative ticket balance" + ~description:"Attempted to set a negative ticket balance value" + ~pp:(fun ppf (key, balance) -> + Format.fprintf + ppf + "Attempted to set negative ticket balance value '%a' for key %a." + Z.pp_print + balance + Ticket_hash_repr.pp + key) + (obj2 (req "key" Ticket_hash_repr.encoding) (req "balance" Data_encoding.z)) + (function + | Negative_ticket_balance {key; balance} -> Some (key, balance) + | _ -> None) + (fun (key, balance) -> Negative_ticket_balance {key; balance}) ; + register_error_kind + `Permanent + ~id:"Used_storage_underflow" + ~title:"Ticket balance used storage underflow" + ~description: + "Attempt to free more bytes than allocated for the tickets balance" + empty + (function Used_storage_space_underflow -> Some () | _ -> None) + (fun () -> Used_storage_space_underflow) + +let get_balance ctxt key = + Storage.Ticket_balance.Table.find ctxt key >|=? fun (ctxt, res) -> (res, ctxt) + +let set_balance ctxt key balance = + let cost_of_key = Z.of_int 65 in + fail_when + Compare.Z.(balance < Z.zero) + (Negative_ticket_balance {key; balance}) + >>=? fun () -> + if Compare.Z.(balance = Z.zero) then + Storage.Ticket_balance.Table.remove ctxt key + >|=? fun (ctxt, freed, existed) -> + (* If we remove an existing entry, then we return the freed size for + both the key and the value. *) + let freed = + if existed then Z.neg @@ Z.add cost_of_key (Z.of_int freed) else Z.zero + in + (freed, ctxt) + else + Storage.Ticket_balance.Table.add ctxt key balance + >|=? fun (ctxt, size_diff, existed) -> + let size_diff = + let z_diff = Z.of_int size_diff in + (* For a new entry we also charge the space for storing the key *) + if existed then z_diff else Z.add cost_of_key z_diff + in + (size_diff, ctxt) + +let adjust_balance ctxt key ~delta = + get_balance ctxt key >>=? fun (res, ctxt) -> + let old_balance = Option.value ~default:Z.zero res in + set_balance ctxt key (Z.add old_balance delta) + +let adjust_storage_space ctxt ~storage_diff = + if Compare.Z.(storage_diff = Z.zero) then return (Z.zero, ctxt) + else + Storage.Ticket_balance.Used_storage_space.find ctxt >>=? fun used_storage -> + let used_storage = Option.value ~default:Z.zero used_storage in + Storage.Ticket_balance.Paid_storage_space.find ctxt >>=? fun paid_storage -> + let paid_storage = Option.value ~default:Z.zero paid_storage in + let new_used_storage = Z.add used_storage storage_diff in + error_when + Compare.Z.(new_used_storage < Z.zero) + Used_storage_space_underflow + >>?= fun () -> + Storage.Ticket_balance.Used_storage_space.add ctxt new_used_storage + >>= fun ctxt -> + let diff = Z.sub new_used_storage paid_storage in + if Compare.Z.(Z.zero < diff) then + Storage.Ticket_balance.Paid_storage_space.add ctxt new_used_storage + >>= fun ctxt -> return (diff, ctxt) + else return (Z.zero, ctxt) + +module Internal_for_tests = struct + let used_storage_space c = + Storage.Ticket_balance.Used_storage_space.find c + >|=? Option.value ~default:Z.zero + + let paid_storage_space c = + Storage.Ticket_balance.Paid_storage_space.find c + >|=? Option.value ~default:Z.zero +end diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_storage.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_storage.mli new file mode 100644 index 000000000000..3aa3cc35a00f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_storage.mli @@ -0,0 +1,75 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Negative_ticket_balance of {key : Ticket_hash_repr.t; balance : Z.t} + | Used_storage_space_underflow + +(** [get_balance ctxt key] receives the ticket balance for the given + [key] in the context [ctxt]. The [key] represents a ticket content and a + ticket creator pair. In case there exists no value for the given [key], + [None] is returned. + *) +val get_balance : + Raw_context.t -> + Ticket_hash_repr.t -> + (Z.t option * Raw_context.t) tzresult Lwt.t + +(** [adjust_balance ctxt key ~delta] adjusts the balance of the + given key (representing a ticket content, creator and owner pair) + and [delta]. The value of [delta] can be positive as well as negative. + If there is no pre-exising balance for the given ticket type and owner, + it is assumed to be 0 and the new balance is [delta]. The function also + returns the difference between the old and the new size of the storage. + Note that the difference may be negative. For example, because when + setting the balance to zero, an entry is removed. + + The function fails with a [Negative_ticket_balance] error + in case the resulting balance is negative. + *) +val adjust_balance : + Raw_context.t -> + Ticket_hash_repr.t -> + delta:Z.t -> + (Z.t * Raw_context.t) tzresult Lwt.t + +(** [adjust_storage_space ctxt ~storage_diff] updates the used storage space + for the ticket-table according to [storage_diff]. The additional positive + amount of unpaid storage is returned. If no unpaid storage is consumed, + this amount is 0. + + Note that when storage space for the ticket table is released we may later + use that space for free. For this reason, the amount returned may be less + than the given (positive) [storage_diff]. *) +val adjust_storage_space : + Raw_context.t -> storage_diff:Z.t -> (Z.t * Raw_context.t) tzresult Lwt.t + +module Internal_for_tests : sig + (** [used_storage_space ctxt] returns the used ticket storage space. *) + val used_storage_space : Raw_context.t -> (Z.t, error trace) result Lwt.t + + (** [paid_storage_space ctxt] returns the paid ticket storage space. *) + val paid_storage_space : Raw_context.t -> (Z.t, error trace) result Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_token.ml new file mode 100644 index 000000000000..ebf39367f0fe --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token.ml @@ -0,0 +1,52 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type 'a parsed_token = { + ticketer : Contract.t; + contents_type : 'a Script_typed_ir.comparable_ty; + contents : 'a; +} + +type ex_token = Ex_token : 'a parsed_token -> ex_token + +type unparsed_token = { + ticketer : Contract.t; + contents_type : Script.expr; + contents : Script.expr; +} + +let unparsed_token_encoding = + let open Data_encoding in + conv + (fun {ticketer; contents_type; contents} -> + (ticketer, contents_type, contents)) + (fun (ticketer, contents_type, contents) -> + {ticketer; contents_type; contents}) + (obj3 + (req "ticketer" Contract.encoding) + (req "content_type" Script.expr_encoding) + (req "content" Script.expr_encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_token.mli new file mode 100644 index 000000000000..b79865fadbf0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** A module for handling ticket-tokens. A ticket-token represents the + combination of a ticketer (creator of a ticket) and the content. That is, + a ticket comprises a ticket-token and an amount. + *) + +type 'a parsed_token = { + ticketer : Contract.t; + contents_type : 'a Script_typed_ir.comparable_ty; + contents : 'a; +} + +(** A type for representing existentially quantified ticket-tokens. A + ticket-token consists of a pair of ticketer and contents. *) +type ex_token = Ex_token : 'a parsed_token -> ex_token + +(** Unparsed version of [parsed_token]. + Used to encode/decode ticket-token in receipt, RPC, etc. *) +type unparsed_token = { + ticketer : Contract.t; + contents_type : Script.expr; + contents : Script.expr; +} + +val unparsed_token_encoding : unparsed_token Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.ml new file mode 100644 index 000000000000..655e007b3c3d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.ml @@ -0,0 +1,135 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** A carbonated map where the keys are [Ticket_hash.t] values. *) +module Ticket_token_map = + Carbonated_map.Make + (struct + type context = Alpha_context.context + + let consume = Gas.consume + end) + (struct + type t = Ticket_hash.t + + let compare = Ticket_hash.compare + + let compare_cost _ = Ticket_costs.Constants.cost_compare_ticket_hash + end) + +(** Conceptually a map from [Ticket_token.ex_token] to values. Since + ticket-tokens are expensive to compare we use [Ticket_hash.t] keys instead, + and store the ticket-token along with the value. *) +type 'a t = (Ticket_token.ex_token * 'a) Ticket_token_map.t + +let empty = Ticket_token_map.empty + +let key_of_ticket_token ctxt (Ticket_token.Ex_token {ticketer; _} as token) = + (* We use the [ticket_balance_key] function for generating a key-hash + for comparing tokens. Since an owner contract is required we use [ticketer] + but any dummy value would work as long as it's consistent. + *) + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Destination.Contract ticketer) + token + +let update ctxt key f m = + key_of_ticket_token ctxt key >>=? fun (key_hash, ctxt) -> + let f ctxt val_opt = + (match val_opt with + | Some (_tkn, value) -> f ctxt (Some value) + | None -> f ctxt None) + >|? fun (val_opt, ctxt) -> (Option.map (fun v -> (key, v)) val_opt, ctxt) + in + Ticket_token_map.update ctxt key_hash f m |> Lwt.return + +let fold_e ctxt f = + Ticket_token_map.fold_e ctxt (fun ctxt acc _key_hash (tkn, value) -> + f ctxt acc tkn value) + +let fold_es ctxt f = + Ticket_token_map.fold_es ctxt (fun ctxt acc _key_hash (tkn, value) -> + f ctxt acc tkn value) + +let find ctxt ticket_token map = + key_of_ticket_token ctxt ticket_token >>=? fun (key_hash, ctxt) -> + Ticket_token_map.find ctxt key_hash map >>?= fun (val_opt, ctxt) -> + return (Option.map snd val_opt, ctxt) + +let lift_merge_overlap merge_overlap ctxt (tkn1, v1) (_tkn2, v2) = + merge_overlap ctxt v1 v2 >|? fun (v, ctxt) -> ((tkn1, v), ctxt) + +let of_list ctxt ~merge_overlap token_values = + List.fold_left_es + (fun (map, ctxt) (token, value) -> + key_of_ticket_token ctxt token >>=? fun (key_hash, ctxt) -> + Lwt.return + (Ticket_token_map.update + ctxt + key_hash + (fun ctxt old_val -> + match old_val with + | None -> ok (Some (token, value), ctxt) + | Some old -> + lift_merge_overlap merge_overlap ctxt old (token, value) + >|? fun (x, ctxt) -> (Some x, ctxt)) + map)) + (Ticket_token_map.empty, ctxt) + token_values + +let map_e ctxt f = + Ticket_token_map.map_e ctxt (fun ctxt _key (tkn, value) -> + f ctxt tkn value >|? fun (new_value, ctxt) -> ((tkn, new_value), ctxt)) + +let to_list ctxt map = + Ticket_token_map.to_list ctxt map >>? fun (list, ctxt) -> + (* Consume gas for traversing the list again and remove the key-hash. *) + Gas.consume + ctxt + (Carbonated_map_costs.fold_cost ~size:(Ticket_token_map.size map)) + >|? fun ctxt -> (List.map snd list, ctxt) + +let merge ctxt ~merge_overlap = + Ticket_token_map.merge ctxt ~merge_overlap:(lift_merge_overlap merge_overlap) + +let to_ticket_receipt ctxt ~owner ticket_token_map = + let open Lwt_result_syntax in + Ticket_token_map.fold_es + ctxt + (fun ctxt acc _ticket_hash (ex_ticket, amount) -> + if Z.(equal amount zero) then return (acc, ctxt) + else + let* ticket_token, ctxt = + Ticket_token_unparser.unparse ctxt ex_ticket + in + let update = + Ticket_receipt.{ticket_token; updates = [{account = owner; amount}]} + in + return (update :: acc, ctxt)) + [] + ticket_token_map diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.mli new file mode 100644 index 000000000000..19fa9a260355 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token_map.mli @@ -0,0 +1,123 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** A module exposing a carbonated map where keys are [Ticket_token.ex_token] + values. *) + +(** A map where keys are [Ticket_token.ex_token] values. *) +type 'a t + +(** [empty] is a map without any elements. *) +val empty : 'a t + +(** [update ctxt k f map] updates or adds the value of the key [k] using [f]. + The function accounts for the gas cost for finding the element. [f] must + account for its own gas costs. *) +val update : + context -> + Ticket_token.ex_token -> + (context -> 'a option -> ('a option * context) tzresult) -> + 'a t -> + ('a t * context) tzresult Lwt.t + +(** [fold_e ctxt f z m] folds over the map [m] using the initial value [z] and + the accumulator function [f]. [f] must account for its own gas costs. *) +val fold_e : + context -> + (context -> + 'state -> + Ticket_token.ex_token -> + 'a -> + ('state * context) tzresult) -> + 'state -> + 'a t -> + ('state * context) tzresult + +(** Lwt-aware variant of {!fold_e}. *) +val fold_es : + context -> + (context -> + 'state -> + Ticket_token.ex_token -> + 'a -> + ('state * context) tzresult Lwt.t) -> + 'state -> + 'a t -> + ('state * context) tzresult Lwt.t + +(** [find ctxt k m] looks up the value with key [k] in the given map [m] and + also accounts for the gas cost of finding the key. *) +val find : + context -> + Ticket_token.ex_token -> + 'a t -> + ('a option * context) tzresult Lwt.t + +(** [of_list ctxt ~merge_overlaps m] creates a map from a list of key-value + pairs. In case there are overlapping keys, their values are combined + using the [merge_overlap] function. The function accounts for gas for + traversing the elements. [merge_overlap] should account for its own gas + cost. *) +val of_list : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context, error trace) result) -> + (Ticket_token.ex_token * 'a) list -> + ('a t * context) tzresult Lwt.t + +(** [to_list m] transforms a map [m] into a list. It also accounts for the gas + cost for traversing the elements. *) +val to_list : + context -> 'a t -> ((Ticket_token.ex_token * 'a) list * context) tzresult + +(** [map_e ctxt f m] maps over all key-value pairs in the map [m] using the + function [f]. It accounts for gas costs associated with traversing the + elements. [f] must account for its own gas cost. *) +val map_e : + context -> + (context -> Ticket_token.ex_token -> 'a -> ('b * context) tzresult) -> + 'a t -> + ('b t * context) tzresult + +(** [merge ctxt ~merge_overlap m1 m2] merges the maps [m1] and [m2]. In case + there are overlapping keys, their values are combined using the + [merge_overlap] function. Gas costs for traversing all elements from both + maps are accounted for. [merge_overlap] must account for its own gas + costs. *) +val merge : + context -> + merge_overlap:(context -> 'a -> 'a -> ('a * context) tzresult) -> + 'a t -> + 'a t -> + ('a t * context) tzresult + +(** [to_ticket_receipt ctxt ~owner t] converts a ticket token map into a ticket receipt. + It also accounts for the gas cost for traversing map and unparsing the elements. *) +val to_ticket_receipt : + context -> + owner:Destination.t -> + Z.t t -> + (Ticket_receipt.t * context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.ml new file mode 100644 index 000000000000..0d0a5ab55f73 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.ml @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/4167 + + Disclaimer: + A more natural place to place [unparse] would be in [Ticket_token] module. + But unfortunantly, we could not put it there due to circular dependency. + The root cause of this circular dependency is the dependency + from [Script_ir_translator] to [Apply_internal_result], but removing this + dependency would require a relatively large refactor. *) + +let unparse ctxt (Ticket_token.Ex_token {ticketer; contents_type; contents}) = + let open Lwt_result_syntax in + let open Script_ir_unparser in + let* contents, ctxt = + unparse_comparable_data ctxt Optimized_legacy contents_type contents + in + let*? ty_unstripped, ctxt = + unparse_ty ~loc:Micheline.dummy_location ctxt contents_type + in + let*? ctxt = Gas.consume ctxt (Script.strip_annotations_cost ty_unstripped) in + let ty = Script.strip_annotations ty_unstripped in + let*? ctxt = Gas.consume ctxt (Script.strip_locations_cost ty) in + let contents_type = Micheline.strip_locations ty in + let ticket_token = Ticket_token.{ticketer; contents_type; contents} in + return (ticket_token, ctxt) diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.mli new file mode 100644 index 000000000000..92a27fb35162 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_token_unparser.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** [unparse ctxt ex_token] returns the unparsed version of [ex_token] where + each ticket field is converted to a Micheline representation. The gas is + being consumed from [ctxt]. *) +val unparse : + context -> + Ticket_token.ex_token -> + (Ticket_token.unparsed_token * context) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.ml b/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.ml new file mode 100644 index 000000000000..57b295a6730e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.ml @@ -0,0 +1,93 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Margiold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +let parse_ticket ~consume_deserialization_gas ~ticketer ~contents ~ty ctxt = + Script.force_decode_in_context ~consume_deserialization_gas ctxt ty + >>?= fun (ty, ctxt) -> + Script.force_decode_in_context ~consume_deserialization_gas ctxt contents + >>?= fun (contents, ctxt) -> + Script_ir_translator.parse_comparable_ty ctxt (Micheline.root ty) + >>?= fun (Ex_comparable_ty contents_type, ctxt) -> + Script_ir_translator.parse_comparable_data + ctxt + contents_type + (Micheline.root contents) + >>=? fun (contents, ctxt) -> + let token = Ticket_token.Ex_token {ticketer; contents_type; contents} in + return (ctxt, token) + +let parse_ticket_and_operation ~consume_deserialization_gas ~ticketer ~contents + ~ty ~source ~destination ~entrypoint ~amount ctxt = + parse_ticket ~consume_deserialization_gas ~ticketer ~contents ~ty ctxt + >>=? fun ( ctxt, + (Ticket_token.Ex_token {contents; contents_type; ticketer} as + token) ) -> + Script_typed_ir.ticket_t Micheline.dummy_location contents_type + >>?= fun ticket_ty -> + let ticket = Script_typed_ir.{ticketer; contents; amount} in + Script_ir_translator.unparse_data ctxt Optimized ticket_ty ticket + >>=? fun (unparsed_parameters, ctxt) -> + fresh_internal_nonce ctxt >>?= fun (ctxt, nonce) -> + let op = + Script_typed_ir.Internal_operation + { + source; + nonce; + operation = + Transaction_to_smart_contract + { + amount = Tez.zero; + unparsed_parameters; + destination; + entrypoint; + location = Micheline.dummy_location; + parameters_ty = ticket_ty; + parameters = ticket; + }; + } + in + return (ctxt, token, op) + +let transfer_ticket_with_hashes ctxt ~src_hash ~dst_hash (qty : Ticket_amount.t) + = + let qty = Script_int.(to_zint (qty :> n num)) in + Ticket_balance.adjust_balance ctxt src_hash ~delta:(Z.neg qty) + >>=? fun (src_storage_diff, ctxt) -> + Ticket_balance.adjust_balance ctxt dst_hash ~delta:qty + >>=? fun (dst_storage_diff, ctxt) -> + Ticket_balance.adjust_storage_space + ctxt + ~storage_diff:(Z.add src_storage_diff dst_storage_diff) + >>=? fun (diff, ctxt) -> return (ctxt, diff) + +let transfer_ticket ctxt ~src ~dst ex_token qty = + Ticket_balance_key.of_ex_token ctxt ~owner:src ex_token + >>=? fun (src_hash, ctxt) -> + Ticket_balance_key.of_ex_token ctxt ~owner:dst ex_token + >>=? fun (dst_hash, ctxt) -> + transfer_ticket_with_hashes ctxt ~src_hash ~dst_hash qty diff --git a/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.mli b/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.mli new file mode 100644 index 000000000000..b7c31684d6fa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/ticket_transfer.mli @@ -0,0 +1,90 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Margiold <contact@marigold.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** [parse_ticket ~ticketer ~contents ~ty + ctxt] reconstructs a ticket from individual parts submitted as + part of a layer-1 operation. *) +val parse_ticket : + consume_deserialization_gas:Script.consume_deserialization_gas -> + ticketer:Contract.t -> + contents:Script.lazy_expr -> + ty:Script.lazy_expr -> + context -> + (context * Ticket_token.ex_token, error trace) result Lwt.t + +(** Same as [parse_ticket], but in addition, build a transaction to + let [source] transfers [amount] units of said ticket to + [destination]. *) +val parse_ticket_and_operation : + consume_deserialization_gas:Script.consume_deserialization_gas -> + ticketer:Contract.t -> + contents:Script.lazy_expr -> + ty:Script.lazy_expr -> + source:Contract.t -> + destination:Contract_hash.t -> + entrypoint:Entrypoint.t -> + amount:Script_typed_ir.ticket_amount -> + context -> + (context * Ticket_token.ex_token * Script_typed_ir.packed_internal_operation) + tzresult + Lwt.t + +(** [transfer_ticket_with_hashes ctxt ~src_hash ~dst_hash qty] updates + the table of tickets moves [qty] units of a given ticket from a + source to a destination, as encoded by [src_hash] and [dst_hash]. + + Consistency between [src_hash] and [dst_hash] is the + responsibility of the caller. Whenever possible, [transfer_ticket] + should be preferred, but [transfer_ticket_with_hashes] could be + preferred to reduce gas comsumption (e.g., to reuse hashes already + computed). + + In addition to an updated context, this function returns the + number of bytes that were newly allocated for the table of + tickets. *) +val transfer_ticket_with_hashes : + context -> + src_hash:Ticket_hash.t -> + dst_hash:Ticket_hash.t -> + Ticket_amount.t -> + (context * Z.t) tzresult Lwt.t + +(** [transfer_ticket ctxt ~src ~dst ex_token qty] updates the table of + tickets moves [qty] units of [ex_token] from [src] to [dst], as + encoded by [src_hash] and [dst_hash]. + + In addition to an updated context, this function returns the + number of bytes that were newly allocated for the table of + tickets. *) +val transfer_ticket : + context -> + src:Destination.t -> + dst:Destination.t -> + Ticket_token.ex_token -> + Ticket_amount.t -> + (context * Z.t, error trace) result Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/time_repr.ml b/src/proto_016_PtMumbai/lib_protocol/time_repr.ml new file mode 100644 index 000000000000..d19897b7122e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/time_repr.ml @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +include Time + +type time = Time.t + +type error += Timestamp_add (* `Permanent *) + +type error += Timestamp_sub (* `Permanent *) + +let () = + register_error_kind + `Permanent + ~id:"timestamp_add" + ~title:"Timestamp add" + ~description:"Overflow when adding timestamps." + ~pp:(fun ppf () -> Format.fprintf ppf "Overflow when adding timestamps.") + Data_encoding.empty + (function Timestamp_add -> Some () | _ -> None) + (fun () -> Timestamp_add) ; + register_error_kind + `Permanent + ~id:"timestamp_sub" + ~title:"Timestamp sub" + ~description:"Subtracting timestamps resulted in negative period." + ~pp:(fun ppf () -> + Format.fprintf ppf "Subtracting timestamps resulted in negative period.") + Data_encoding.empty + (function Timestamp_sub -> Some () | _ -> None) + (fun () -> Timestamp_sub) + +let of_seconds_string s = Option.map Time.of_seconds (Int64.of_string_opt s) + +let to_seconds_string s = Int64.to_string (to_seconds s) + +let pp = pp_hum + +let ( +? ) x y = + let span = Period_repr.to_seconds y in + let t64 = Time.add x span in + (* As long as span and time representations are int64, we cannont overflow if + x is negative. *) + if x < Time.of_seconds 0L then ok t64 + else if t64 < Time.of_seconds 0L then error Timestamp_add + else ok t64 + +let ( -? ) x y = + record_trace Timestamp_sub (Period_repr.of_seconds (Time.diff x y)) + +let ( - ) x y = + Time.of_seconds Int64.(sub (Time.to_seconds x) (Period_repr.to_seconds y)) diff --git a/src/proto_016_PtMumbai/lib_protocol/time_repr.mli b/src/proto_016_PtMumbai/lib_protocol/time_repr.mli new file mode 100644 index 000000000000..c35b2da6f283 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/time_repr.mli @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include module type of struct + include Time +end + +(** Internal timestamp representation. *) +type time = t + +(** Pretty-prints the time stamp using RFC3339 format. *) +val pp : Format.formatter -> t -> unit + +(** Parses RFC3339 representation and returns a timestamp. *) +val of_seconds_string : string -> time option + +(** Returns the timestamp encoded in RFC3339 format. *) +val to_seconds_string : time -> string + +(** Adds a time span to a timestamp. + This function fails on integer overflow *) +val ( +? ) : time -> Period_repr.t -> time tzresult + +(** Returns the difference between two timestamps as a time span. + This function fails when the difference is negative *) +val ( -? ) : time -> time -> Period_repr.t tzresult + +(** [t - p] Returns a timestamps [p] seconds before [t]. + + TODO: https://gitlab.com/tezos/tezos/-/issues/2054 + This function should be made available in the environment. + *) +val ( - ) : time -> Period_repr.t -> time diff --git a/src/proto_016_PtMumbai/lib_protocol/token.ml b/src/proto_016_PtMumbai/lib_protocol/token.ml new file mode 100644 index 000000000000..072cb8e262a4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/token.ml @@ -0,0 +1,253 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type container = + [ `Contract of Contract_repr.t + | `Collected_commitments of Blinded_public_key_hash.t + | `Delegate_balance of Signature.Public_key_hash.t + | `Frozen_deposits of Signature.Public_key_hash.t + | `Block_fees + | `Frozen_bonds of Contract_repr.t * Bond_id_repr.t ] + +type infinite_source = + [ `Invoice + | `Bootstrap + | `Initial_commitments + | `Revelation_rewards + | `Double_signing_evidence_rewards + | `Endorsing_rewards + | `Baking_rewards + | `Baking_bonuses + | `Minted + | `Liquidity_baking_subsidies + | `Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards ] + +type source = [infinite_source | container] + +type infinite_sink = + [ `Storage_fees + | `Double_signing_punishments + | `Lost_endorsing_rewards of Signature.Public_key_hash.t * bool * bool + | `Tx_rollup_rejection_punishments + | `Sc_rollup_refutation_punishments + | `Burned ] + +type sink = [infinite_sink | container] + +let allocated ctxt stored = + match stored with + | `Contract contract -> + Contract_storage.allocated ctxt contract >|= fun allocated -> + ok (ctxt, allocated) + | `Collected_commitments bpkh -> + Commitment_storage.exists ctxt bpkh >|= fun allocated -> + ok (ctxt, allocated) + | `Delegate_balance delegate -> + let contract = Contract_repr.Implicit delegate in + Contract_storage.allocated ctxt contract >|= fun allocated -> + ok (ctxt, allocated) + | `Frozen_deposits delegate -> + let contract = Contract_repr.Implicit delegate in + Frozen_deposits_storage.allocated ctxt contract >|= fun allocated -> + ok (ctxt, allocated) + | `Block_fees -> return (ctxt, true) + | `Frozen_bonds (contract, bond_id) -> + Contract_storage.bond_allocated ctxt contract bond_id + +let balance ctxt stored = + match stored with + | `Contract contract -> + Contract_storage.get_balance ctxt contract >|=? fun balance -> + (ctxt, balance) + | `Collected_commitments bpkh -> + Commitment_storage.committed_amount ctxt bpkh >|=? fun balance -> + (ctxt, balance) + | `Delegate_balance delegate -> + let contract = Contract_repr.Implicit delegate in + Storage.Contract.Spendable_balance.get ctxt contract >|=? fun balance -> + (ctxt, balance) + | `Frozen_deposits delegate -> + let contract = Contract_repr.Implicit delegate in + Frozen_deposits_storage.find ctxt contract >|=? fun frozen_deposits -> + let balance = + match frozen_deposits with + | None -> Tez_repr.zero + | Some frozen_deposits -> frozen_deposits.current_amount + in + (ctxt, balance) + | `Block_fees -> return (ctxt, Raw_context.get_collected_fees ctxt) + | `Frozen_bonds (contract, bond_id) -> + Contract_storage.find_bond ctxt contract bond_id + >|=? fun (ctxt, balance_opt) -> + (ctxt, Option.value ~default:Tez_repr.zero balance_opt) + +let credit ctxt dest amount origin = + let open Receipt_repr in + (match dest with + | #infinite_sink as infinite_sink -> + let sink = + match infinite_sink with + | `Storage_fees -> Storage_fees + | `Double_signing_punishments -> Double_signing_punishments + | `Lost_endorsing_rewards (d, p, r) -> Lost_endorsing_rewards (d, p, r) + | `Tx_rollup_rejection_punishments -> Tx_rollup_rejection_punishments + | `Sc_rollup_refutation_punishments -> Sc_rollup_refutation_punishments + | `Burned -> Burned + in + return (ctxt, sink) + | #container as container -> ( + match container with + | `Contract dest -> + Contract_storage.credit_only_call_from_token ctxt dest amount + >|=? fun ctxt -> (ctxt, Contract dest) + | `Collected_commitments bpkh -> + Commitment_storage.increase_commitment_only_call_from_token + ctxt + bpkh + amount + >|=? fun ctxt -> (ctxt, Commitments bpkh) + | `Delegate_balance delegate -> + let contract = Contract_repr.Implicit delegate in + Contract_storage.increase_balance_only_call_from_token + ctxt + contract + amount + >|=? fun ctxt -> (ctxt, Contract contract) + | `Frozen_deposits delegate as dest -> + allocated ctxt dest >>=? fun (ctxt, allocated) -> + (if not allocated then Frozen_deposits_storage.init ctxt delegate + else return ctxt) + >>=? fun ctxt -> + Frozen_deposits_storage.credit_only_call_from_token + ctxt + delegate + amount + >|=? fun ctxt -> (ctxt, Deposits delegate) + | `Block_fees -> + Raw_context.credit_collected_fees_only_call_from_token ctxt amount + >>?= fun ctxt -> return (ctxt, Block_fees) + | `Frozen_bonds (contract, bond_id) -> + Contract_storage.credit_bond_only_call_from_token + ctxt + contract + bond_id + amount + >>=? fun ctxt -> return (ctxt, Frozen_bonds (contract, bond_id)))) + >|=? fun (ctxt, balance) -> (ctxt, (balance, Credited amount, origin)) + +let spend ctxt src amount origin = + let open Receipt_repr in + (match src with + | #infinite_source as infinite_source -> + let src = + match infinite_source with + | `Bootstrap -> Bootstrap + | `Invoice -> Invoice + | `Initial_commitments -> Initial_commitments + | `Minted -> Minted + | `Liquidity_baking_subsidies -> Liquidity_baking_subsidies + | `Revelation_rewards -> Nonce_revelation_rewards + | `Double_signing_evidence_rewards -> Double_signing_evidence_rewards + | `Endorsing_rewards -> Endorsing_rewards + | `Baking_rewards -> Baking_rewards + | `Baking_bonuses -> Baking_bonuses + | `Tx_rollup_rejection_rewards -> Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards -> Sc_rollup_refutation_rewards + in + return (ctxt, src) + | #container as container -> ( + match container with + | `Contract src -> + Contract_storage.spend_only_call_from_token ctxt src amount + >|=? fun ctxt -> (ctxt, Contract src) + | `Collected_commitments bpkh -> + Commitment_storage.decrease_commitment_only_call_from_token + ctxt + bpkh + amount + >|=? fun ctxt -> (ctxt, Commitments bpkh) + | `Delegate_balance delegate -> + let contract = Contract_repr.Implicit delegate in + Contract_storage.decrease_balance_only_call_from_token + ctxt + contract + amount + >|=? fun ctxt -> (ctxt, Contract contract) + | `Frozen_deposits delegate -> + Frozen_deposits_storage.spend_only_call_from_token + ctxt + delegate + amount + >|=? fun ctxt -> (ctxt, Deposits delegate) + | `Block_fees -> + Raw_context.spend_collected_fees_only_call_from_token ctxt amount + >>?= fun ctxt -> return (ctxt, Block_fees) + | `Frozen_bonds (contract, bond_id) -> + Contract_storage.spend_bond_only_call_from_token + ctxt + contract + bond_id + amount + >>=? fun ctxt -> return (ctxt, Frozen_bonds (contract, bond_id)))) + >|=? fun (ctxt, balance) -> (ctxt, (balance, Debited amount, origin)) + +let transfer_n ?(origin = Receipt_repr.Block_application) ctxt src dest = + let sources = List.filter (fun (_, am) -> Tez_repr.(am <> zero)) src in + match sources with + | [] -> + (* Avoid accessing context data when there is nothing to transfer. *) + return (ctxt, []) + | _ :: _ -> + (* Withdraw from sources. *) + List.fold_left_es + (fun (ctxt, total, debit_logs) (source, amount) -> + spend ctxt source amount origin >>=? fun (ctxt, debit_log) -> + Tez_repr.(amount +? total) >>?= fun total -> + return (ctxt, total, debit_log :: debit_logs)) + (ctxt, Tez_repr.zero, []) + sources + >>=? fun (ctxt, amount, debit_logs) -> + credit ctxt dest amount origin >>=? fun (ctxt, credit_log) -> + (* Deallocate implicit contracts with no stake. This must be done after + spending and crediting. If done in between then a transfer of all the + balance from (`Contract c) to (`Frozen_bonds (c,_)) would leave the + contract c unallocated. *) + List.fold_left_es + (fun ctxt (source, _amount) -> + match source with + | `Contract contract | `Frozen_bonds (contract, _) -> + Contract_storage.ensure_deallocated_if_empty ctxt contract + | #source -> return ctxt) + ctxt + sources + >|=? fun ctxt -> + (* Make sure the order of balance updates is : debit logs in the order of + of the parameter [src], and then the credit log. *) + let balance_updates = List.rev (credit_log :: debit_logs) in + (ctxt, balance_updates) + +let transfer ?(origin = Receipt_repr.Block_application) ctxt src dest amount = + transfer_n ~origin ctxt [(src, amount)] dest diff --git a/src/proto_016_PtMumbai/lib_protocol/token.mli b/src/proto_016_PtMumbai/lib_protocol/token.mli new file mode 100644 index 000000000000..6610e1e74324 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/token.mli @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020-2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The aim of this module is to manage operations involving tokens such as + minting, transferring, and burning. Every constructor of the types [source], + [container], or [sink] represents a kind of account that holds a given (or + possibly infinite) amount of tokens. + + Tokens can be transferred from a [source] to a [sink]. To uniformly handle + all cases, special constructors of sources and sinks may be used. For + example, the source [`Minted] is used to express a transfer of minted tokens + to a destination, and the sink [`Burned] is used to express the action of + burning a given amount of tokens taken from a source. Thanks to uniformity, + it is easier to track transfers of tokens throughout the protocol by running + [grep -R "Token.transfer" src/proto_alpha]. *) + +(** [container] is the type of token holders with finite capacity, and whose assets + are contained in the context. Let [d] be a delegate. Be aware that transferring + to/from [`Delegate_balance d] will not update [d]'s stake, while transferring + to/from [`Contract (Contract_repr.Implicit d)] will update [d]'s + stake. *) + +type container = + [ `Contract of Contract_repr.t + | `Collected_commitments of Blinded_public_key_hash.t + | `Delegate_balance of Signature.Public_key_hash.t + | `Frozen_deposits of Signature.Public_key_hash.t + | `Block_fees + | `Frozen_bonds of Contract_repr.t * Bond_id_repr.t ] + +(** [infinite_source] defines types of tokens provides which are considered to be + ** of infinite capacity. *) +type infinite_source = + [ `Invoice + | `Bootstrap + | `Initial_commitments + | `Revelation_rewards + | `Double_signing_evidence_rewards + | `Endorsing_rewards + | `Baking_rewards + | `Baking_bonuses + | `Minted + | `Liquidity_baking_subsidies + | `Tx_rollup_rejection_rewards + | `Sc_rollup_refutation_rewards ] + +(** [source] is the type of token providers. Token providers that are not + containers are considered to have infinite capacity. *) +type source = [infinite_source | container] + +type infinite_sink = + [ `Storage_fees + | `Double_signing_punishments + | `Lost_endorsing_rewards of Signature.Public_key_hash.t * bool * bool + | `Tx_rollup_rejection_punishments + | `Sc_rollup_refutation_punishments + | `Burned ] + +(** [sink] is the type of token receivers. Token receivers that are not + containers are considered to have infinite capacity. *) +type sink = [infinite_sink | container] + +(** [allocated ctxt container] returns a new context because of possible access + to carbonated data, and a boolean that is [true] when + [balance ctxt container] is guaranteed not to fail, and [false] when + [balance ctxt container] may fail. *) +val allocated : + Raw_context.t -> container -> (Raw_context.t * bool) tzresult Lwt.t + +(** [balance ctxt container] returns a new context because of an access to + carbonated data, and the balance associated to the token holder. + This function may fail if [allocated ctxt container] returns [false]. + Returns an error with the message "get_balance" if [container] refers to an + originated contract that is not allocated. + Returns a {!Storage_Error Missing_key} error if [container] is of the form + [`Delegate_balance pkh], where [pkh] refers to an implicit contract that is + not allocated. *) +val balance : + Raw_context.t -> container -> (Raw_context.t * Tez_repr.t) tzresult Lwt.t + +(** [transfer_n ?origin ctxt sources dest] transfers [amount] Tez from [src] to + [dest] for each [(src, amount)] pair in [sources], and returns a new + context, and the list of corresponding balance updates. The function behaves + as though [transfer src dest amount] was invoked for each pair + [(src, amount)] in [sources], however a single balance update is generated + for the total amount transferred to [dest]. + When [sources] is an empty list, the function does nothing to the context, + and returns an empty list of balance updates. *) +val transfer_n : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + ([< source] * Tez_repr.t) list -> + [< sink] -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t + +(** [transfer ?origin ctxt src dest amount] transfers [amount] Tez from source + [src] to destination [dest], and returns a new context, and the list of + corresponding balance updates tagged with [origin]. By default, [~origin] is + set to [Receipt_repr.Block_application]. + Returns {!Storage_Error Missing_key} if [src] refers to a contract that is + not allocated. + Returns a [Balance_too_low] error if [src] refers to a contract whose + balance is less than [amount]. + Returns a [Subtraction_underflow] error if [src] refers to a source that is + not a contract and whose balance is less than [amount]. + Returns a [Empty_implicit_delegated_contract] error if [src] is an + implicit contract that delegates to a different contract, and whose balance + is equal to [amount]. + Returns a [Non_existing_contract] error if + [dest] refers to an originated contract that is not allocated. + Returns a [Non_existing_contract] error if [amount <> Tez_repr.zero], and + [dest] refers to an originated contract that is not allocated. + Returns a [Addition_overflow] error if [dest] refers to a sink whose balance + is greater than [Int64.max - amount]. + Returns a [Wrong_level] error if [src] or [dest] refer to a level that is + not the current level. *) +val transfer : + ?origin:Receipt_repr.update_origin -> + Raw_context.t -> + [< source] -> + [< sink] -> + Tez_repr.t -> + (Raw_context.t * Receipt_repr.balance_updates) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.ml new file mode 100644 index 000000000000..9ac9323952dd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.ml @@ -0,0 +1,240 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Hash = struct + let commitment_hash = Tx_rollup_prefixes.commitment_hash.b58check_prefix + + module H = + Blake2B.Make + (Base58) + (struct + let name = "Commitment_hash" + + let title = "A commitment ID" + + let b58check_prefix = commitment_hash + + let size = Some Tx_rollup_prefixes.commitment_hash.hash_size + end) + + include H + + let () = Tx_rollup_prefixes.(check_encoding commitment_hash b58check_encoding) + + include Path_encoding.Make_hex (H) + + let rpc_arg = + let construct = Data_encoding.Binary.to_string_exn encoding in + let destruct str = + Option.value_e ~error:"Failed to decode commitment" + @@ Data_encoding.Binary.of_string_opt encoding str + in + RPC_arg.make + ~descr:"A tx_rollup commitment." + ~name:"tx_rollup_commitment" + ~construct + ~destruct + () +end + +module Merkle_hash = struct + module H = + Blake2B.Make + (Base58) + (struct + let name = "Message_result_list_hash" + + let title = "A merklised message result list hash" + + let b58check_prefix = + Tx_rollup_prefixes.message_result_list_hash.b58check_prefix + + let size = Some Tx_rollup_prefixes.message_result_list_hash.hash_size + end) + + include H + include Path_encoding.Make_hex (H) + + let () = + Tx_rollup_prefixes.( + check_encoding message_result_list_hash b58check_encoding) +end + +module Merkle = + Merkle_list.Make (Tx_rollup_message_result_hash_repr) (Merkle_hash) + +type 'a template = { + level : Tx_rollup_level_repr.t; + messages : 'a; + predecessor : Hash.t option; + inbox_merkle_root : Tx_rollup_inbox_repr.Merkle.root; +} + +let map_template f x = {x with messages = f x.messages} + +let pp_template : + (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a template -> unit + = + fun pp_messages fmt t -> + Format.fprintf + fmt + "Level: %a@,Messages: %a@,Predecessor: %a@,Inbox merkle root: %a" + Tx_rollup_level_repr.pp + t.level + pp_messages + t.messages + (Format.pp_print_option + ~none:(fun fmt () -> Format.pp_print_string fmt "None") + Hash.pp) + t.predecessor + Tx_rollup_inbox_repr.Merkle.pp_root + t.inbox_merkle_root + +let encoding_template encoding = + let open Data_encoding in + conv + (fun {level; messages; predecessor; inbox_merkle_root} -> + (level, messages, predecessor, inbox_merkle_root)) + (fun (level, messages, predecessor, inbox_merkle_root) -> + {level; messages; predecessor; inbox_merkle_root}) + (obj4 + (req "level" Tx_rollup_level_repr.encoding) + (req "messages" encoding) + (req "predecessor" (option Hash.encoding)) + (req "inbox_merkle_root" Tx_rollup_inbox_repr.Merkle.root_encoding)) + +module Compact = struct + type excerpt = { + count : int; + root : Merkle.h; + last_result_message_hash : Tx_rollup_message_result_hash_repr.t; + } + + type t = excerpt template + + let pp = + pp_template (fun fmt {count; root; last_result_message_hash} -> + Format.fprintf + fmt + "Count: %d@, Merkle root hash: %a@,Last result message hash: %a" + count + Merkle_hash.pp + root + Tx_rollup_message_result_hash_repr.pp + last_result_message_hash) + + let encoding = + encoding_template + Data_encoding.( + conv + (fun {count; root; last_result_message_hash} -> + (count, root, last_result_message_hash)) + (fun (count, root, last_result_message_hash) -> + {count; root; last_result_message_hash}) + @@ obj3 + (req "count" int31) + (req "root" Merkle_hash.encoding) + (req + "last_message_result_hash" + Tx_rollup_message_result_hash_repr.encoding)) + + let hash t = + let bytes = Data_encoding.Binary.to_bytes_exn encoding t in + Hash.hash_bytes [bytes] +end + +module Full = struct + type t = Tx_rollup_message_result_hash_repr.t list template + + let pp = + pp_template (Format.pp_print_list Tx_rollup_message_result_hash_repr.pp) + + let encoding : t Data_encoding.t = + encoding_template + (Data_encoding.list Tx_rollup_message_result_hash_repr.encoding) + + let compact full = + map_template + (fun list -> + let root = Merkle.compute list in + List.fold_left + (fun (acc, _) m -> (acc + 1, m)) + (0, Tx_rollup_message_result_hash_repr.zero) + list + |> fun (count, last_result_message_hash) -> + Compact.{count; root; last_result_message_hash}) + full +end + +module Index = struct + type t = Hash.t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn Hash.encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt Hash.encoding) + | _ -> None + + let rpc_arg = Hash.rpc_arg + + let encoding = Hash.encoding + + let compare = Hash.compare +end + +module Submitted_commitment = struct + type nonrec t = { + commitment : Compact.t; + commitment_hash : Hash.t; + committer : Signature.Public_key_hash.t; + submitted_at : Raw_level_repr.t; + finalized_at : Raw_level_repr.t option; + } + + let encoding = + let compact = Compact.encoding in + let open Data_encoding in + conv + (fun {commitment; commitment_hash; committer; submitted_at; finalized_at} -> + (commitment, commitment_hash, committer, submitted_at, finalized_at)) + (fun (commitment, commitment_hash, committer, submitted_at, finalized_at) -> + {commitment; commitment_hash; committer; submitted_at; finalized_at}) + (obj5 + (req "commitment" compact) + (req "commitment_hash" Hash.encoding) + (req "committer" Signature.Public_key_hash.encoding) + (req "submitted_at" Raw_level_repr.encoding) + (opt "finalized_at" Raw_level_repr.encoding)) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.mli new file mode 100644 index 000000000000..8a396f24d398 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_repr.mli @@ -0,0 +1,101 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing commitments with + "toc1" as a base58 prefix *) +module Hash : sig + val commitment_hash : string + + include S.HASH +end + +module Merkle_hash : S.HASH + +module Merkle : + Merkle_list.T + with type elt = Tx_rollup_message_result_hash_repr.t + and type h = Merkle_hash.t + +(** A commitment describes the interpretation of the messages stored in the + inbox of a particular [level], on top of a particular layer-2 context. + + It includes one Merkle tree root for each of the [batches]. It has + a [predecessor], which is the identifier of the commitment for the + previous inbox. The [predecessor] is used to get the Merkle root + of the layer-2 context before any inboxes are processed. If + [predecessor] is [None], the commitment is for the first inbox + with messages in this rollup, and the initial Merkle root is the + empty tree. *) +type 'a template = { + level : Tx_rollup_level_repr.t; + messages : 'a; + predecessor : Hash.t option; + inbox_merkle_root : Tx_rollup_inbox_repr.Merkle.root; +} + +module Compact : sig + type excerpt = { + count : int; + root : Merkle.h; + last_result_message_hash : Tx_rollup_message_result_hash_repr.t; + } + + type t = excerpt template + + val pp : Format.formatter -> t -> unit + + val encoding : t Data_encoding.t + + val hash : t -> Hash.t +end + +module Full : sig + type t = Tx_rollup_message_result_hash_repr.t list template + + val encoding : t Data_encoding.t + + val pp : Format.formatter -> t -> unit + + val compact : t -> Compact.t +end + +module Index : Storage_description.INDEX with type t = Hash.t + +module Submitted_commitment : sig + (** When a commitment is submitted, we store the [committer] and the + block the commitment was [submitted_at] along with the + [commitment] itself with its hash. *) + type nonrec t = { + commitment : Compact.t; + commitment_hash : Hash.t; + committer : Signature.Public_key_hash.t; + submitted_at : Raw_level_repr.t; + finalized_at : Raw_level_repr.t option; + } + + val encoding : t Data_encoding.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.ml new file mode 100644 index 000000000000..797c2a7f25a0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.ml @@ -0,0 +1,411 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_commitment_repr +open Tx_rollup_errors_repr + +(* + + {{Note}} The functions of this module ignore storage allocations on + purposes. This is because any storage allocated here is done under + the condition that a user has agreed to freeze a significant bond + of tez. + + Not only this bond covers the maximum number of bytes a transaction + rollup can allocate, but it can be recovered iff the storage + associated with this bond is deallocated. In other word, rollup + operators have an incentive to keep the storage clean. + + {{Note inbox}} The only storage that is not directly covered by the + bond are the inboxes. As a consequence, inboxes allocations are + still recorded normally. However, as soon as an inbox is committed + to, then it needs to be deleted for the bond to be retreived (as + part of the commitment finalization). As a consequence, we + virtually free the storage by an inbox (as accounted for by the + rollup) when it is committed to. + + *) + +let check_message_result ctxt {messages; _} result ~path ~index = + (match result with + | `Hash hash -> ok (ctxt, hash) + | `Result result -> Tx_rollup_hash_builder.message_result ctxt result) + >>? fun (ctxt, computed) -> + Tx_rollup_gas.consume_check_path_commitment_cost ctxt >>? fun ctxt -> + let cond = + match + Merkle.check_path + path + index + computed + messages.Tx_rollup_commitment_repr.Compact.root + with + | Ok x -> x + | Error _ -> false + in + error_unless + cond + Tx_rollup_errors_repr.( + Wrong_rejection_hash + {provided = computed; expected = `Valid_path (messages.root, index)}) + >>? fun () -> ok ctxt + +let adjust_commitments_count ctxt tx_rollup pkh ~(dir : [`Incr | `Decr]) = + let delta = match dir with `Incr -> 1 | `Decr -> -1 in + Storage.Tx_rollup.Commitment_bond.find (ctxt, tx_rollup) pkh + >>=? fun (ctxt, commitment) -> + let count = + match commitment with Some count -> count + delta | None -> delta + in + fail_when Compare.Int.(count < 0) (Commitment_bond_negative count) + >>=? fun () -> + Storage.Tx_rollup.Commitment_bond.add (ctxt, tx_rollup) pkh count + >>=? fun (ctxt, _, _) -> return ctxt + +let remove_bond : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + Raw_context.t tzresult Lwt.t = + fun ctxt tx_rollup contract -> + Storage.Tx_rollup.Commitment_bond.find (ctxt, tx_rollup) contract + >>=? fun (ctxt, bond) -> + match bond with + | None -> tzfail (Bond_does_not_exist contract) + | Some 0 -> + Storage.Tx_rollup.Commitment_bond.remove (ctxt, tx_rollup) contract + >>=? fun (ctxt, _, _) -> return ctxt + | Some _ -> tzfail (Bond_in_use contract) + +let slash_bond ctxt tx_rollup contract = + Storage.Tx_rollup.Commitment_bond.find (ctxt, tx_rollup) contract + >>=? fun (ctxt, bond_counter) -> + match bond_counter with + | None -> return (ctxt, false) + | Some c -> + Storage.Tx_rollup.Commitment_bond.remove (ctxt, tx_rollup) contract + >>=? fun (ctxt, _, _) -> return (ctxt, Compare.Int.(0 < c)) + +let find : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Submitted_commitment.t option) tzresult Lwt.t = + fun ctxt tx_rollup state level -> + if Tx_rollup_state_repr.has_valid_commitment_at state level then + Storage.Tx_rollup.Commitment.find (ctxt, tx_rollup) level + >>=? fun (ctxt, commitment) -> + match commitment with + | None -> + Tx_rollup_state_storage.assert_exist ctxt tx_rollup >>=? fun ctxt -> + return (ctxt, None) + | Some res -> return (ctxt, Some res) + else return (ctxt, None) + +let get : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Submitted_commitment.t) tzresult Lwt.t = + fun ctxt tx_rollup state level -> + find ctxt tx_rollup state level >>=? fun (ctxt, commitment) -> + match commitment with + | None -> tzfail @@ Tx_rollup_errors_repr.Commitment_does_not_exist level + | Some commitment -> return (ctxt, commitment) + +let get_finalized : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Submitted_commitment.t) tzresult Lwt.t = + fun ctxt tx_rollup state level -> + let window = Tx_rollup_state_repr.finalized_commitments_range state in + (match window with + | Some (first, last) -> + error_unless + Tx_rollup_level_repr.(first <= level && level <= last) + (Tx_rollup_errors_repr.No_finalized_commitment_for_level {level; window}) + | None -> + error + (Tx_rollup_errors_repr.No_finalized_commitment_for_level {level; window})) + >>?= fun () -> + Storage.Tx_rollup.Commitment.find (ctxt, tx_rollup) level + >>=? fun (ctxt, commitment) -> + match commitment with + | None -> tzfail @@ Tx_rollup_errors_repr.Commitment_does_not_exist level + | Some commitment -> return (ctxt, commitment) + +let check_commitment_level current_level state commitment = + Tx_rollup_state_repr.next_commitment_level state current_level + >>? fun expected_level -> + error_when + Tx_rollup_level_repr.(commitment.level < expected_level) + (Level_already_has_commitment commitment.level) + >>? fun () -> + error_when + Tx_rollup_level_repr.(expected_level < commitment.level) + (Commitment_too_early + {provided = commitment.level; expected = expected_level}) + +(** [check_commitment_predecessor ctxt tx_rollup state commitment] + will raise an error if the [predecessor] field of [commitment] is + not consistent with the context, assuming its [level] field is + correct. *) +let check_commitment_predecessor ctxt state commitment = + match + ( commitment.predecessor, + Tx_rollup_state_repr.next_commitment_predecessor state ) + with + | Some pred_hash, Some expected_hash when Hash.(pred_hash = expected_hash) -> + return ctxt + | None, None -> return ctxt + | provided, expected -> tzfail (Wrong_predecessor_hash {provided; expected}) + +let check_commitment_batches_and_merkle_root ctxt state inbox commitment = + let Tx_rollup_inbox_repr.{inbox_length; merkle_root; _} = inbox in + fail_unless + Compare.List_length_with.(commitment.messages = inbox_length) + Wrong_batch_count + >>=? fun () -> + fail_unless + Tx_rollup_inbox_repr.Merkle.(commitment.inbox_merkle_root = merkle_root) + Wrong_inbox_hash + >>=? fun () -> return (ctxt, state) + +let add_commitment ctxt tx_rollup state pkh commitment = + let commitment_limit = + Constants_storage.tx_rollup_max_commitments_count ctxt + in + fail_when + Compare.Int.( + Tx_rollup_state_repr.commitments_count state >= commitment_limit) + Too_many_commitments + >>=? fun () -> + (* Check the commitment has the correct values *) + let current_level = (Raw_context.current_level ctxt).level in + check_commitment_level current_level state commitment >>?= fun () -> + check_commitment_predecessor ctxt state commitment >>=? fun ctxt -> + Tx_rollup_inbox_storage.get ctxt commitment.level tx_rollup + >>=? fun (ctxt, inbox) -> + check_commitment_batches_and_merkle_root ctxt state inbox commitment + >>=? fun (ctxt, state) -> + (* De we need to slash someone? *) + Storage.Tx_rollup.Commitment.find (ctxt, tx_rollup) commitment.level + >>=? fun (ctxt, invalid_commitment) -> + Option.map_e + (fun x -> + let to_slash = x.Submitted_commitment.committer in + error_when Signature.Public_key_hash.(pkh = to_slash) Invalid_committer + >>? fun () -> ok to_slash) + invalid_commitment + >>?= fun to_slash -> + (* Everything has been sorted out, let’s update the storage *) + Tx_rollup_gas.consume_compact_commitment_cost ctxt inbox.inbox_length + >>?= fun ctxt -> + let commitment = Tx_rollup_commitment_repr.Full.compact commitment in + Tx_rollup_hash_builder.compact_commitment ctxt commitment + >>?= fun (ctxt, commitment_hash) -> + let submitted : Tx_rollup_commitment_repr.Submitted_commitment.t = + { + commitment; + commitment_hash; + committer = pkh; + submitted_at = current_level; + finalized_at = None; + } + in + Storage.Tx_rollup.Commitment.add (ctxt, tx_rollup) commitment.level submitted + >>=? fun (ctxt, _commitment_size_alloc, _) -> + (* See {{Note}} for a rationale on why ignoring storage allocation is safe. *) + Tx_rollup_state_repr.record_commitment_creation + state + commitment.level + commitment_hash + >>?= fun state -> + adjust_commitments_count ctxt tx_rollup pkh ~dir:`Incr >>=? fun ctxt -> + return (ctxt, state, to_slash) + +let pending_bonded_commitments : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + (Raw_context.t * int) tzresult Lwt.t = + fun ctxt tx_rollup pkh -> + Storage.Tx_rollup.Commitment_bond.find (ctxt, tx_rollup) pkh + >|=? fun (ctxt, pending) -> (ctxt, Option.value ~default:0 pending) + +let has_bond : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + (Raw_context.t * bool) tzresult Lwt.t = + fun ctxt tx_rollup pkh -> + Storage.Tx_rollup.Commitment_bond.find (ctxt, tx_rollup) pkh + >|=? fun (ctxt, pending) -> (ctxt, Option.is_some pending) + +let finalize_commitment ctxt rollup state = + match Tx_rollup_state_repr.next_commitment_to_finalize state with + | Some oldest_inbox_level -> + (* Since the commitment head is not null, we know the oldest + inbox has a commitment. *) + get ctxt rollup state oldest_inbox_level >>=? fun (ctxt, commitment) -> + (* Is the finality period for this commitment over? *) + let finality_period = Constants_storage.tx_rollup_finality_period ctxt in + let current_level = (Raw_context.current_level ctxt).level in + fail_when + Raw_level_repr.( + current_level < add commitment.submitted_at finality_period) + No_commitment_to_finalize + >>=? fun () -> + (* We remove the inbox *) + Tx_rollup_inbox_storage.remove ctxt oldest_inbox_level rollup + >>=? fun ctxt -> + (* We update the commitment to mark it as finalized *) + Storage.Tx_rollup.Commitment.update + (ctxt, rollup) + oldest_inbox_level + {commitment with finalized_at = Some current_level} + >>=? fun (ctxt, _commitment_size_alloc) -> + (* See {{Note}} for a rationale on why ignoring storage + allocation is safe. *) + (* We update the state *) + Tx_rollup_state_repr.record_inbox_deletion state oldest_inbox_level + >>?= fun state -> return (ctxt, state, oldest_inbox_level) + | None -> tzfail No_commitment_to_finalize + +let remove_commitment ctxt rollup state = + match Tx_rollup_state_repr.next_commitment_to_remove state with + | Some tail -> + (* We check the commitment is old enough *) + get ctxt rollup state tail >>=? fun (ctxt, commitment) -> + (match commitment.finalized_at with + | Some finalized_at -> + let withdraw_period = + Constants_storage.tx_rollup_withdraw_period ctxt + in + let current_level = (Raw_context.current_level ctxt).level in + fail_when + Raw_level_repr.(current_level < add finalized_at withdraw_period) + Remove_commitment_too_early + | None -> + (* unreachable code if the implementation is correct *) + tzfail (Internal_error "Missing finalized_at field")) + >>=? fun () -> + (* Decrement the bond count of the committer *) + adjust_commitments_count ctxt rollup commitment.committer ~dir:`Decr + >>=? fun ctxt -> + (* We remove the commitment *) + Storage.Tx_rollup.Commitment.remove (ctxt, rollup) tail + >>=? fun (ctxt, _freed_size, _existed) -> + (* See {{Note}} for a rationale on why ignoring storage + allocation is safe. *) + Tx_rollup_reveal_storage.remove ctxt rollup tail >>=? fun ctxt -> + (* We update the state *) + let msg_hash = commitment.commitment.messages.last_result_message_hash in + Tx_rollup_state_repr.record_commitment_deletion + state + tail + commitment.commitment_hash + msg_hash + >>?= fun state -> return (ctxt, state, tail) + | None -> tzfail No_commitment_to_remove + +let check_agreed_and_disputed_results ctxt tx_rollup state + (submitted_commitment : Submitted_commitment.t) ~agreed_result + ~agreed_result_path ~disputed_result ~disputed_position + ~disputed_result_path = + let commitment = submitted_commitment.commitment in + Tx_rollup_state_repr.check_level_can_be_rejected state commitment.level + >>?= fun () -> + check_message_result + ctxt + commitment + (`Hash disputed_result) + ~path:disputed_result_path + ~index:disputed_position + >>?= fun ctxt -> + if Compare.Int.(disputed_position = 0) then + Tx_rollup_hash_builder.message_result ctxt agreed_result + >>?= fun (ctxt, agreed) -> + match Tx_rollup_level_repr.pred commitment.level with + | None -> + let expected = Tx_rollup_message_result_hash_repr.init in + fail_unless + Tx_rollup_message_result_hash_repr.(agreed = expected) + (Wrong_rejection_hash {provided = agreed; expected = `Hash expected}) + >>=? fun () -> return ctxt + | Some pred_level -> ( + Storage.Tx_rollup.Commitment.find (ctxt, tx_rollup) pred_level + >>=? fun (ctxt, candidate) -> + match candidate with + | Some commitment -> + let expected = + commitment.commitment.messages.last_result_message_hash + in + fail_unless + Tx_rollup_message_result_hash_repr.(agreed = expected) + (Wrong_rejection_hash + {provided = agreed; expected = `Hash expected}) + >>=? fun () -> return ctxt + | None -> ( + match Tx_rollup_state_repr.last_removed_commitment_hashes state with + | Some (last_hash, _) -> + fail_unless + Tx_rollup_message_result_hash_repr.(agreed = last_hash) + (Wrong_rejection_hash + {provided = agreed; expected = `Hash last_hash}) + >>=? fun () -> return ctxt + | None -> tzfail (Internal_error "Missing commitment predecessor"))) + else + check_message_result + ctxt + commitment + (`Result agreed_result) + ~path:agreed_result_path + ~index:(disputed_position - 1) + >>?= fun ctxt -> return ctxt + +let reject_commitment ctxt rollup state level = + Tx_rollup_state_repr.check_level_can_be_rejected state level >>?= fun () -> + (* Fetching the next predecessor hash to be used *) + (match Tx_rollup_level_repr.pred level with + | Some pred_level -> + find ctxt rollup state pred_level >>=? fun (ctxt, pred_commitment) -> + let pred_hash = + Option.map + (fun (x : Submitted_commitment.t) -> x.commitment_hash) + pred_commitment + in + return (ctxt, pred_hash) + | None -> return (ctxt, None)) + (* We record in the state *) + >>=? fun (ctxt, pred_hash) -> + Tx_rollup_state_repr.record_commitment_rejection state level pred_hash + >>?= fun state -> return (ctxt, state) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.mli new file mode 100644 index 000000000000..41af2357a012 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_commitment_storage.mli @@ -0,0 +1,201 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2021 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module introduces various functions to manipulate the storage related + to commitments for transaction rollups. *) + +val check_message_result : + Raw_context.t -> + Tx_rollup_commitment_repr.Compact.t -> + [ `Hash of Tx_rollup_message_result_hash_repr.t + | `Result of Tx_rollup_message_result_repr.t ] -> + path:Tx_rollup_commitment_repr.Merkle.path -> + index:int -> + Raw_context.t tzresult + +(** [add_commitment context tx_rollup contract commitment] adds a + commitment to a rollup. It returns the new context, the new state, + and the committer of the previous commitment stored for this + level if any. + + In case this committer exists, then it means its bond needs to be + slashed. + + This function returns the errors + + {ul {li [Level_already_has_commitment] iff there is already a + valid commitment ({i i.e.}, not orphan) at this level.} + {li [Invalid_committer] iff an orphan commitment from the same + committer already is in the storage.} + {li [Missing_commitment_predecessor] iff the predecessor does + not match the already-stored predecessor commitment.} + {li [Wrong_commitment_predecessor_level] iff there is no + predecessor level, but a predecessor commitment is + provided (or no predecessor commitment is provided but + there is a precessor level)} + {li [Wrong_batch_count] iff the number of batches does not + equal the length of the inbox.}} *) +val add_commitment : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Signature.Public_key_hash.t -> + Tx_rollup_commitment_repr.Full.t -> + (Raw_context.t * Tx_rollup_state_repr.t * Signature.public_key_hash option) + tzresult + Lwt.t + +(** [remove_bond context state tx_rollup contract] removes the bond for an + implicit contract. This will fail if either the bond does not exist, + or if the bond is currently in use. *) +val remove_bond : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + Raw_context.t tzresult Lwt.t + +(** [slash_bond ctxt tx_rollup contract] removes the bond counter for + an implicit contract if it exists. Besides, it returns a boolean + to determine if this counter was strictly superior to 0. *) +val slash_bond : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + (Raw_context.t * bool) tzresult Lwt.t + +(** [find context tx_rollup state level] returns the commitment for a + level, if any exists and is not orphan (that is, one of its + ancestors has been rejected). If the rollup does not exist, the + error [Tx_rollup_does_not_exist] is returned. *) +val find : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t option) + tzresult + Lwt.t + +(** [get context tx_rollup state level] returns the commitment for a + level, if any exists. If the rollup does not exist, the error + [Tx_rollup_does_not_exist] is returned. If there is no commitment + in the storage, or if a commitment exists but it is orphan (that + is, one of its ancestors has been rejected), then + [Commitment_does_not_exist] is returned. *) +val get : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t) tzresult + Lwt.t + +(** [get_finalized context tx_rollup level] returns the + commitment for a level, if any exists and is finalized. If the rollup does not + exist, the error [Tx_rollup_does_not_exist] is returned. If the commitment + is not finalized the error [Tx_rollup_commitment_not_final] is returned *) +val get_finalized : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t) tzresult + Lwt.t + +(** [pending_bonded_commitments ctxt tx_rollup contract] returns the + number of commitments that [contract] has made that are still + in the storage. *) +val pending_bonded_commitments : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + (Raw_context.t * int) tzresult Lwt.t + +(** [has_bond ctxt tx_rollup contract] returns true if we have + already collected a bond for [contract] for commitments on + [tx_rollup]. *) +val has_bond : + Raw_context.t -> + Tx_rollup_repr.t -> + Signature.public_key_hash -> + (Raw_context.t * bool) tzresult Lwt.t + +(** [finalize_commitment ctxt tx_rollup state] marks the commitment of + the oldest inbox as final, if the commitment exists and if it is + old enough. Otherwise, this function returns the error + [No_commitment_to_finalize]. + + The number of {!pending_bonded_commitments} is not updated, it + is decremented when the commitment is removed (see {!remove_commitment}). + It is done to force the rollup operators to clean up the commitment storage. + + The state of the rollup is adjusted accordingly, and the finalized + level is returned. Besides, the inbox at said level is removed + from the context. This function returns the new context, and the + new state. *) +val finalize_commitment : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t * Tx_rollup_level_repr.t) tzresult + Lwt.t + +(** [remove_commitment ctxt tx_rollup state] tries to remove the + oldest finalized commitment from the layer-1 storage, if it + exists, and if it is old enough. Otherwise, this functions returns + the error [No_commitment_to_remove]. + + The state of the rollup is adjusted accordingly. *) +val remove_commitment : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t * Tx_rollup_level_repr.t) tzresult + Lwt.t + +(** [reject_commitment context tx_rollup state level] removes the + commitment at [level]. It should only be called after a + successful rejection operation. The [state] is updated to reflect + the rejection, and returned. *) +val reject_commitment : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t) tzresult Lwt.t + +val check_agreed_and_disputed_results : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_commitment_repr.Submitted_commitment.t -> + agreed_result:Tx_rollup_message_result_repr.t -> + agreed_result_path:Tx_rollup_commitment_repr.Merkle.path -> + disputed_result:Tx_rollup_message_result_hash_repr.t -> + disputed_position:int -> + disputed_result_path:Tx_rollup_commitment_repr.Merkle.path -> + Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_errors_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_errors_repr.ml new file mode 100644 index 000000000000..3c71b9c8a080 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_errors_repr.ml @@ -0,0 +1,678 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Tx_rollup_already_exists of Tx_rollup_repr.t + | Tx_rollup_does_not_exist of Tx_rollup_repr.t + | Submit_batch_burn_exceeded of {burn : Tez_repr.t; limit : Tez_repr.t} + | Inbox_does_not_exist of Tx_rollup_repr.t * Tx_rollup_level_repr.t + | Inbox_size_would_exceed_limit of Tx_rollup_repr.t + | Inbox_count_would_exceed_limit of Tx_rollup_repr.t + | No_uncommitted_inbox + | Message_size_exceeds_limit + | Too_many_inboxes + | Too_many_commitments + | Too_many_withdrawals + | Wrong_batch_count + | Commitment_too_early of { + provided : Tx_rollup_level_repr.t; + expected : Tx_rollup_level_repr.t; + } + | Level_already_has_commitment of Tx_rollup_level_repr.t + | Wrong_inbox_hash + | Bond_does_not_exist of Signature.public_key_hash + | Bond_in_use of Signature.public_key_hash + | No_commitment_to_finalize + | No_commitment_to_remove + | Remove_commitment_too_early + | Commitment_does_not_exist of Tx_rollup_level_repr.t + | Wrong_predecessor_hash of { + provided : Tx_rollup_commitment_repr.Hash.t option; + expected : Tx_rollup_commitment_repr.Hash.t option; + } + | Internal_error of string + | Wrong_message_position of { + level : Tx_rollup_level_repr.t; + position : int; + length : int; + } + | Wrong_path_depth of { + kind : [`Inbox | `Commitment]; + provided : int; + limit : int; + } + | Wrong_message_path of {expected : Tx_rollup_inbox_repr.Merkle.root} + | No_finalized_commitment_for_level of { + level : Tx_rollup_level_repr.t; + window : (Tx_rollup_level_repr.t * Tx_rollup_level_repr.t) option; + } + | Withdraw_invalid_path + | Withdraw_already_consumed + | Withdrawals_invalid_path + | Withdrawals_already_dispatched + | Invalid_committer + | Commitment_bond_negative of int + | Cannot_reject_level of { + provided : Tx_rollup_level_repr.t; + accepted_range : (Tx_rollup_level_repr.t * Tx_rollup_level_repr.t) option; + } + | Wrong_rejection_hash of { + provided : Tx_rollup_message_result_hash_repr.t; + expected : + [ `Valid_path of Tx_rollup_commitment_repr.Merkle.h * int + | `Hash of Tx_rollup_message_result_hash_repr.t ]; + } + | Ticket_payload_size_limit_exceeded of { + payload_size : Saturation_repr.may_saturate Saturation_repr.t; + limit : int; + } + | Proof_undecodable + | Proof_failed_to_reject + | Proof_produced_rejected_state + | Proof_invalid_before of {agreed : Context_hash.t; provided : Context_hash.t} + | No_withdrawals_to_dispatch + +let check_path_depth kind provided ~count_limit = + let limit = Merkle_list.max_depth ~count_limit in + error_when Compare.Int.(limit < provided) + @@ Wrong_path_depth {kind; provided; limit} + +let () = + let open Data_encoding in + (* Tx_rollup_submit_batch_burn_exceeded *) + register_error_kind + `Temporary + ~id:"operation.tx_rollup_submit_batch_burn_exceeded" + ~title:"Submit batch exceeded burn limit" + ~description: + "The submit batch would exceed the burn limit, we withdraw the submit." + ~pp:(fun ppf (burn, limit) -> + Format.fprintf + ppf + "Cannot submit the batch of L2 operations as the cost (%a) would \ + exceed the burn limit (%a)" + Tez_repr.pp + burn + Tez_repr.pp + limit) + Data_encoding.( + obj2 (req "burn" Tez_repr.encoding) (req "limit" Tez_repr.encoding)) + (function + | Submit_batch_burn_exceeded {burn; limit} -> Some (burn, limit) + | _ -> None) + (fun (burn, limit) -> Submit_batch_burn_exceeded {burn; limit}) ; + (* Tx_rollup_inbox_does_not_exist *) + register_error_kind + `Temporary + ~id:"tx_rollup_inbox_does_not_exist" + ~title:"Missing transaction rollup inbox" + ~description:"The transaction rollup does not have an inbox at this level" + ~pp:(fun ppf (addr, level) -> + Format.fprintf + ppf + "Transaction rollup %a does not have an inbox at level %a" + Tx_rollup_repr.pp + addr + Tx_rollup_level_repr.pp + level) + (obj2 + (req "tx_rollup_address" Tx_rollup_repr.encoding) + (req "raw_level" Tx_rollup_level_repr.encoding)) + (function + | Inbox_does_not_exist (rollup, level) -> Some (rollup, level) | _ -> None) + (fun (rollup, level) -> Inbox_does_not_exist (rollup, level)) ; + register_error_kind + `Temporary + ~id:"tx_rollup_inbox_size_would_exceed_limit" + ~title:"Transaction rollup inbox’s size would exceed the limit" + ~description: + "Transaction rollup inbox’s size in bytes would exceed the limit" + ~pp:(fun ppf addr -> + Format.fprintf + ppf + "Adding the submitted message would make the inbox of %a exceed the \ + authorized size in bytes at this level" + Tx_rollup_repr.pp + addr) + (obj1 (req "tx_rollup_address" Tx_rollup_repr.encoding)) + (function Inbox_size_would_exceed_limit rollup -> Some rollup | _ -> None) + (fun rollup -> Inbox_size_would_exceed_limit rollup) ; + (* Tx_rollup_message_count_would_exceed_limit *) + register_error_kind + `Temporary + ~id:"tx_rollup_inbox_count_would_exceed_limit" + ~title:"Transaction rollup inbox’s message count would exceed the limit" + ~description: + "Transaction rollup inbox’s message count would exceed the limit" + ~pp:(fun ppf addr -> + Format.fprintf + ppf + "Adding the submitted message would make the inbox of %a exceed the \ + authorized message count at this level" + Tx_rollup_repr.pp + addr) + (obj1 (req "tx_rollup_address" Tx_rollup_repr.encoding)) + (function + | Inbox_count_would_exceed_limit rollup -> Some rollup | _ -> None) + (fun rollup -> Inbox_count_would_exceed_limit rollup) ; + (* Tx_rollup_message_size_exceed_limit *) + register_error_kind + `Temporary + ~id:"tx_rollup_no_uncommitted_inbox" + ~title:"There is no inbox awaiting a commitment." + ~description:"There is no inbox awaiting a commitment." + empty + (function No_uncommitted_inbox -> Some () | _ -> None) + (fun () -> No_uncommitted_inbox) ; + (* Tx_rollup_message_size_exceed_limit *) + register_error_kind + `Temporary + ~id:"tx_rollup_message_size_exceeds_limit" + ~title:"A message submitted to a transaction rollup inbox exceeds limit" + ~description: + "A message submitted to a transaction rollup inbox exceeds limit" + empty + (function Message_size_exceeds_limit -> Some () | _ -> None) + (fun () -> Message_size_exceeds_limit) ; + (* Tx_rollup_too_many_inboxes *) + register_error_kind + `Temporary + ~id:"tx_rollup_too_many_inboxes" + ~title:"Cannot create a new inbox because there are too many already" + ~description:"Cannot create a new inbox because there are too many already" + empty + (function Too_many_inboxes -> Some () | _ -> None) + (fun () -> Too_many_inboxes) ; + (* Tx_rollup_too_many_commitments *) + register_error_kind + `Temporary + ~id:"tx_rollup_too_many_commitments" + ~title:"Too many commitments" + ~description: + "Cannot create a new commitment because there are too many already" + empty + (function Too_many_commitments -> Some () | _ -> None) + (fun () -> Too_many_commitments) ; + (* Tx_rollup_too_many_withdrawals *) + register_error_kind + `Temporary + ~id:"tx_rollup_too_many_withdrawals" + ~title:"Cannot dispatch that many withdrawals" + ~description:"Cannot dispatch that many withdrawals" + empty + (function Too_many_withdrawals -> Some () | _ -> None) + (fun () -> Too_many_withdrawals) ; + (* Wrong_batch_count *) + register_error_kind + `Temporary + ~id:"tx_rollup_wrong_batch_count" + ~title:"This commitment has the wrong number of batches" + ~description: + "This commitment has a different number of batches than its inbox" + unit + (function Wrong_batch_count -> Some () | _ -> None) + (fun () -> Wrong_batch_count) ; + (* Commitment_too_early *) + register_error_kind + `Temporary + ~id:"tx_rollup_commitment_too_early" + ~title:"Cannot submit a commitment for this level yet" + ~description: + "It is not possible to submit a commitment for this level just yet." + (obj2 + (req "provided" Tx_rollup_level_repr.encoding) + (req "expected" Tx_rollup_level_repr.encoding)) + (function + | Commitment_too_early {provided; expected} -> Some (provided, expected) + | _ -> None) + (fun (provided, expected) -> Commitment_too_early {provided; expected}) ; + (* Level_already_has_commitment *) + register_error_kind + `Temporary + ~id:"tx_rollup_level_already_has_commitment" + ~title:"This commitment is for a level that already has a commitment" + ~description:"This commitment is for a level that already has a commitment" + (obj1 (req "level" Tx_rollup_level_repr.encoding)) + (function Level_already_has_commitment level -> Some level | _ -> None) + (fun level -> Level_already_has_commitment level) ; + (* Wrong_inbox_hash *) + register_error_kind + `Branch + ~id:"Wrong_inbox_hash" + ~title:"This commitment has the wrong inbox hash" + ~description:"This commitment has a different hash than its inbox" + unit + (function Wrong_inbox_hash -> Some () | _ -> None) + (fun () -> Wrong_inbox_hash) ; + (* Bond_does_not_exist *) + register_error_kind + `Temporary + ~id:"tx_rollup_bond_does_not_exist" + ~title:"This account does not have a bond for this rollup" + ~description:"This account does not have a bond for this rollup" + (obj1 (req "contract" Signature.Public_key_hash.encoding)) + (function Bond_does_not_exist contract -> Some contract | _ -> None) + (fun contract -> Bond_does_not_exist contract) ; + (* Bond_in_use *) + register_error_kind + `Temporary + ~id:"tx_rollup_bond_in_use" + ~title:"This account's bond is in use for one or more commitments" + ~description:"This account's bond is in use for one or more commitments" + (obj1 (req "contract" Signature.Public_key_hash.encoding)) + (function Bond_in_use contract -> Some contract | _ -> None) + (fun contract -> Bond_in_use contract) ; + (* No_commitment_to_finalize *) + register_error_kind + `Temporary + ~id:"tx_rollup_no_commitment_to_finalize" + ~title:"There is no commitment to finalize" + ~description:"There is no commitment to finalize" + empty + (function No_commitment_to_finalize -> Some () | _ -> None) + (fun () -> No_commitment_to_finalize) ; + (* No_commitment_to_remove *) + register_error_kind + `Temporary + ~id:"tx_rollup_no_commitment_to_remove" + ~title:"There is no commitment to remove" + ~description:"There is no commitment to remove" + empty + (function No_commitment_to_remove -> Some () | _ -> None) + (fun () -> No_commitment_to_remove) ; + (* Remove_commitment_too_early *) + register_error_kind + `Temporary + ~id:"tx_rollup_remove_commitment_too_early" + ~title:"It's too early to try to remove a commitment" + ~description:"It's too early to try to remove the oldest final commitment" + empty + (function Remove_commitment_too_early -> Some () | _ -> None) + (fun () -> Remove_commitment_too_early) ; + (* Commitment_does_not_exist *) + register_error_kind + `Temporary + ~id:"tx_rollup_commitment_does_not_exist" + ~title:"There is no commitment at the requested level" + ~description:"There is no commitment at the requested level" + (obj1 (req "provided" Tx_rollup_level_repr.encoding)) + (function Commitment_does_not_exist l -> Some l | _ -> None) + (fun l -> Commitment_does_not_exist l) ; + (* Wrong_predecessor_hash *) + register_error_kind + `Temporary + ~id:"tx_rollup_wrong_predecessor_hash" + ~title:"The commitment refers to a commitment that is not in the context" + ~description: + "The commitment refers to a commitment that is not in the context" + (obj2 + (req "provided" (option Tx_rollup_commitment_repr.Hash.encoding)) + (req "expected" (option Tx_rollup_commitment_repr.Hash.encoding))) + (function + | Wrong_predecessor_hash {provided; expected} -> Some (provided, expected) + | _ -> None) + (fun (provided, expected) -> Wrong_predecessor_hash {provided; expected}) ; + (* Tx_rollup_already_exists *) + register_error_kind + `Permanent + ~id:"tx_rollup_already_exists" + ~title:"Transaction rollup was already created" + ~description: + "The protocol tried to originate the same transaction rollup twice" + ~pp:(fun ppf addr -> + Format.fprintf + ppf + "Transaction rollup %a is already used for an existing transaction \ + rollup. This should not happen, and indicates there is a bug in the \ + protocol. If you can, please report this bug \ + (https://gitlab.com/tezos/tezos/-/issues.)" + Tx_rollup_repr.pp + addr) + (obj1 (req "rollup_address" Tx_rollup_repr.encoding)) + (function Tx_rollup_already_exists rollup -> Some rollup | _ -> None) + (fun rollup -> Tx_rollup_already_exists rollup) ; + (* Tx_rollup_does_not_exist *) + register_error_kind + `Temporary + ~id:"tx_rollup_does_not_exist" + ~title:"Transaction rollup does not exist" + ~description:"An invalid transaction rollup address was submitted" + ~pp:(fun ppf addr -> + Format.fprintf + ppf + "Invalid transaction rollup address %a" + Tx_rollup_repr.pp + addr) + (obj1 (req "rollup_address" Tx_rollup_repr.encoding)) + (function Tx_rollup_does_not_exist rollup -> Some rollup | _ -> None) + (fun rollup -> Tx_rollup_does_not_exist rollup) ; + (* Internal_error *) + register_error_kind + `Permanent + ~id:"tx_rollup_internal_error" + ~title:"An internal error occurred" + ~description:"An internal error occurred" + (obj1 (req "description" (string Plain))) + (function Internal_error str -> Some str | _ -> None) + (fun str -> Internal_error str) ; + (* Wrong_message_position *) + register_error_kind + `Branch + ~id:"tx_rollup_wrong_message_position" + ~title:"Wrong message index in rejection" + ~description: + "The rejection references the {position}^th message of the inbox {l} \ + which contains only {inbox_length} messages" + (obj3 + (req "level" Tx_rollup_level_repr.encoding) + (req "position" int31) + (req "length" int31)) + (function + | Wrong_message_position {level; position; length} -> + Some (level, position, length) + | _ -> None) + (fun (level, position, length) -> + Wrong_message_position {level; position; length}) ; + (* Wrong_path_depth *) + register_error_kind + `Permanent + ~id:"tx_rollup_wrong_message_path_depth" + ~title:"Wrong message path depth" + ~description: + "A path submitted as argument of this operation exceeds the maximum \ + depth that can be witnessed." + (obj3 + (req + "target" + (union + [ + case + (Tag 0) + ~title:"Inbox" + (constant "inbox") + (function `Inbox -> Some () | _ -> None) + (fun () -> `Inbox); + case + (Tag 1) + ~title:"Commitment" + (constant "commitment") + (function `Commitment -> Some () | _ -> None) + (fun () -> `Commitment); + ])) + (req "provided" int31) + (req "limit" int31)) + (function + | Wrong_path_depth {kind; provided; limit} -> Some (kind, provided, limit) + | _ -> None) + (fun (kind, provided, limit) -> Wrong_path_depth {kind; provided; limit}) ; + (* Wrong_message_hash *) + register_error_kind + `Branch + ~id:"tx_rollup_wrong_message_path" + ~title:"Wrong message path in rejection." + ~description: + "This rejection has sent a message and a path that does not fit the \ + current merkle root hash in the corresponding inbox" + (obj1 + (req "expected_merkle_root" Tx_rollup_inbox_repr.Merkle.root_encoding)) + (function Wrong_message_path {expected} -> Some expected | _ -> None) + (fun expected -> Wrong_message_path {expected}) ; + (* No_finalized_commitment_for_level *) + register_error_kind + `Temporary + ~id:"operation.tx_rollup_no_finalized_commitment_for_level" + ~title:"Operation is about a commitment that is not yet finalized" + ~description:"This operation must be about a finalized commitment" + ~pp:(fun ppf (level, window) -> + match window with + | Some (first, last) -> + Format.fprintf + ppf + "This operation is only allowed on finalized and existing \ + commitments, but its level %a is not in the existing and \ + finalized window of commitments: [%a; %a]." + Tx_rollup_level_repr.pp + level + Tx_rollup_level_repr.pp + first + Tx_rollup_level_repr.pp + last + | None -> + Format.fprintf + ppf + "This operation was about level %a but no finalized commitment \ + exists yet." + Tx_rollup_level_repr.pp + level) + Data_encoding.( + obj2 + (req "received" Tx_rollup_level_repr.encoding) + (req + "commitment_head_level" + (option + (tup2 Tx_rollup_level_repr.encoding Tx_rollup_level_repr.encoding)))) + (function + | No_finalized_commitment_for_level {level; window} -> Some (level, window) + | _ -> None) + (fun (level, window) -> No_finalized_commitment_for_level {level; window}) ; + (* Withdraw_invalid_proof *) + register_error_kind + `Branch + ~id:"tx_rollup_withdraw_invalid_path" + ~title:"The validation path submitted for a withdrawal is invalid" + ~description: + "The validation path submitted for a withdrawal is not valid for the \ + given withdrawal and message index" + empty + (function Withdraw_invalid_path -> Some () | _ -> None) + (fun () -> Withdraw_invalid_path) ; + (* Withdrawals_invalid_path *) + register_error_kind + `Branch + ~id:"tx_rollup_withdrawals_invalid_path" + ~title:"The validation path submitted for a withdrawal is invalid" + ~description: + "The validation path submitted for a withdrawal is not valid for the \ + given withdrawal and message index" + empty + (function Withdrawals_invalid_path -> Some () | _ -> None) + (fun () -> Withdrawals_invalid_path) ; + (* Withdrawals_already_dispatched *) + register_error_kind + `Branch + ~id:"operation.withdrawals_already_dispatched" + ~title:"withdrawals already dispatched" + ~description: + "The withdrawals have already been dispatched to their layer-1 \ + beneficiary" + Data_encoding.unit + (function Withdrawals_already_dispatched -> Some () | _ -> None) + (fun () -> Withdrawals_already_dispatched) ; + register_error_kind + `Temporary + ~id:"operation.withdraw_already_consumed" + ~title:"withdraw already consumed" + ~description:"The submitted withdraw has already been consumed" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The submitted withdraw exists but it has already been consumed \ + earlier.") + Data_encoding.unit + (function Withdraw_already_consumed -> Some () | _ -> None) + (fun () -> Withdraw_already_consumed) ; + (* Invalid_committer *) + register_error_kind + `Temporary + ~id:"tx_rollup_invalid_committer" + ~title:"Committer cannot propose a commitment for this level" + ~description: + "The committer is trying to propose a commitment, but their bond is \ + about to be slashed because a commitment they authored will be \ + overwritten." + Data_encoding.unit + (function Invalid_committer -> Some () | _ -> None) + (fun () -> Invalid_committer) ; + register_error_kind + `Permanent + ~id:"tx_rollup_commitment_bond_negative" + ~title: + "The number of commitments associated with an implicit account is \ + negative" + ~description: + "A negative number of commitment is associated with an implicit account \ + and its associated bound. This error is internal and should never \ + happen." + ~pp:(fun ppf count -> + Format.fprintf + ppf + "The number of commitments %d associated with this implicit account is \ + negative" + count) + (obj1 (req "count" Data_encoding.int31)) + (function Commitment_bond_negative count -> Some count | _ -> None) + (fun count -> Commitment_bond_negative count) ; + (* Cannot_reject_level *) + register_error_kind + `Temporary + ~id:"tx_rollup_cannot_reject_level" + ~title:"Cannot reject a commitment at the requested level" + ~description:"Cannot reject a commitment at the requested level" + (obj2 + (req "provided" Tx_rollup_level_repr.encoding) + (req + "accepted_range" + (option + (obj2 + (req "min" Tx_rollup_level_repr.encoding) + (req "max" Tx_rollup_level_repr.encoding))))) + (function + | Cannot_reject_level {provided; accepted_range} -> + Some (provided, accepted_range) + | _ -> None) + (fun (provided, accepted_range) -> + Cannot_reject_level {provided; accepted_range}) ; + (* Wrong_rejection_hash *) + register_error_kind + `Temporary + ~id:"tx_rollup_wrong_rejection_hashes" + ~title: + "The message result hash recomputed from the rejection argument is \ + invalid" + ~description: + "The message result hash recomputed from the rejection argument is \ + invalid" + (obj2 + (req "provided" Tx_rollup_message_result_hash_repr.encoding) + (req + "expected" + (union + [ + case + (Tag 0) + ~title:"hash" + Tx_rollup_message_result_hash_repr.encoding + (function `Hash h -> Some h | _ -> None) + (fun h -> `Hash h); + case + (Tag 1) + ~title:"valid_path" + (obj2 + (req "root" Tx_rollup_commitment_repr.Merkle_hash.encoding) + (req "index" int31)) + (function `Valid_path (h, i) -> Some (h, i) | _ -> None) + (fun (h, i) -> `Valid_path (h, i)); + ]))) + (function + | Wrong_rejection_hash {provided; expected} -> Some (provided, expected) + | _ -> None) + (fun (provided, expected) -> Wrong_rejection_hash {provided; expected}) ; + (* ticket_payload_size_limit_exceeded *) + register_error_kind + `Permanent + ~id:"tx_rollup_ticket_payload_size_limit_exceeded" + ~title:"The payload of the deposited ticket exceeded the size limit" + ~description:"The payload of the deposited ticket exceeded the size limit" + (obj2 (req "payload_size" Saturation_repr.n_encoding) (req "limit" int31)) + (function + | Ticket_payload_size_limit_exceeded {payload_size; limit} -> + Some (payload_size, limit) + | _ -> None) + (fun (payload_size, limit) -> + Ticket_payload_size_limit_exceeded {payload_size; limit}) ; + register_error_kind + `Permanent + ~id:"tx_rollup_proof_undecodable" + ~title:"Could not decode the proof" + ~description:"The proof submitted as argument could not be decoded" + empty + (function Proof_undecodable -> Some () | _ -> None) + (fun () -> Proof_undecodable) ; + (* Proof_failed_to_reject *) + register_error_kind + `Temporary + ~id:"tx_rollup_proof_failed_to_reject" + ~title:"Proof failed to reject the commitment" + ~description: + "The proof verification failed and was unable to reject the commitment" + empty + (function Proof_failed_to_reject -> Some () | _ -> None) + (fun () -> Proof_failed_to_reject) ; + (* Proof_produced_rejected_state *) + register_error_kind + `Temporary + ~id:"tx_rollup_proof_produced_rejected_state" + ~title:"Proof produced the rejected state" + ~description: + "The proof submitted did not refute the rejected commitment. The proof \ + produced the same committed state" + empty + (function Proof_produced_rejected_state -> Some () | _ -> None) + (fun () -> Proof_produced_rejected_state) ; + (* Proof_invalid_before *) + register_error_kind + `Temporary + ~id:"tx_rollup_proof_invalid_before" + ~title:"Proof started from an invalid hash" + ~description: + "The proof started from a hash which is not the one agreed on (i.e. in \ + the previous commitment)" + (obj2 + (req "agreed" Context_hash.encoding) + (req "provided" Context_hash.encoding)) + (function + | Proof_invalid_before {agreed; provided} -> Some (agreed, provided) + | _ -> None) + (fun (agreed, provided) -> Proof_invalid_before {agreed; provided}) ; + register_error_kind + `Permanent + ~id:"tx_rollup_no_withdrawals_to_dispatch" + ~title:"Trying to dispatch withdrawals when none happened" + ~description:"Cannot dispatch an empty list of withdrawals" + empty + (function No_withdrawals_to_dispatch -> Some () | _ -> None) + (fun () -> No_withdrawals_to_dispatch) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.ml new file mode 100644 index 000000000000..6ae5cb451f10 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.ml @@ -0,0 +1,138 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Tx_rollup_negative_input_size + +module S = Saturation_repr + +(** The model in {!Michelson_v1_gas.N_IBlake2b}, plus the allocation + of bytes from {!Storage_functor}. *) +let hash_cost input_size = + error_unless Compare.Int.(0 <= input_size) Tx_rollup_negative_input_size + >>? fun () -> + let ( + ) = S.add in + let cost_serialization = Gas_limit_repr.alloc_mbytes_cost input_size in + let v0 = Saturation_repr.safe_int input_size in + let cost_N_IBlake2b = S.safe_int 430 + v0 + S.shift_right v0 3 in + let cost_blake2b = Gas_limit_repr.atomic_step_cost cost_N_IBlake2b in + ok @@ (cost_serialization + cost_blake2b) + +(** Model from {!Ticket_costs.Constants.cost_compare_ticket_hash} since they are + Blake2B hashes too. *) +let compare_blake2b_hash = S.safe_int 10 + +let check_path_cost element_size path_depth = + let ( + ) = S.add in + error_unless Compare.Int.(0 <= path_depth) Tx_rollup_negative_input_size + >>? fun () -> + (* We hash the element *) + hash_cost element_size >>? fun element_hash_cost -> + (* At each step of the way, we hash 2 hashes together *) + hash_cost 64 >>? fun hash_cost -> + let rec acc_hash_cost acc i = + if Compare.Int.(i <= 0) then acc else acc_hash_cost (hash_cost + acc) (i - 1) + in + + ok (element_hash_cost + acc_hash_cost compare_blake2b_hash path_depth) + +let consume_check_path_inbox_cost ctxt = + let count_limit = Constants_storage.tx_rollup_max_messages_per_inbox ctxt in + let max_depth = Merkle_list.max_depth ~count_limit in + check_path_cost Tx_rollup_prefixes.message_hash.hash_size max_depth + >>? fun cost -> Raw_context.consume_gas ctxt cost + +let consume_check_path_commitment_cost ctxt = + let count_limit = Constants_storage.tx_rollup_max_messages_per_inbox ctxt in + let max_depth = Merkle_list.max_depth ~count_limit in + check_path_cost Tx_rollup_prefixes.message_result_hash.hash_size max_depth + >>? fun cost -> Raw_context.consume_gas ctxt cost + +(** As generated by the model [inbox_add_message_codegen] in + [lib_benchmarks_proto/tx_rollup_benchmarks.ml]. *) +let model_inbox_add_message_codegen inbox_length = + (* We assume that the Merkle_tree implementation computes a tree + whose depth is logarithmic in the number of leaves. The cost of + inserting an element in this structure, in the worst case, is the + cost of hashing the element and hashing the concatenation of two + elements at each level in the tree, that is: + + cost_of_hashing(32 bytes) + log2(inbox_length) * + inbox_max_length * cost_of_hashing(32 bytes + 32 bytes) + + This cost is captured by the following cost function which is + inferred emperically through the benchmark & model mentioned + above. *) + let log2 n = S.safe_int (1 + S.numbits n) in + S.mul (S.safe_int 445) (log2 (S.safe_int inbox_length)) + +let consume_add_message_cost ctxt = + let max_messages_per_inbox = + Constants_storage.tx_rollup_max_messages_per_inbox ctxt + in + (* as a safe, constant, over-approximation, suppose the inbox is + the maximum size allowed *) + let cost = model_inbox_add_message_codegen max_messages_per_inbox in + Raw_context.consume_gas ctxt cost + +(** As generated by the model [model_commitment_full_compact] in + [lib_benchmarks_proto/tx_rollup_benchmarks.ml]. We add one to + [inbox_length] so that the cost is never zero. *) +let model_commitment_full_compact inbox_length = + S.mul (S.safe_int 915) (S.safe_int (1 + inbox_length)) + +let consume_compact_commitment_cost ctxt inbox_length = + let cost = model_commitment_full_compact inbox_length in + Raw_context.consume_gas ctxt cost + +let hash ~hash_f ctxt encoding input = + match Data_encoding.Binary.to_bytes_opt encoding input with + | Some buffer -> + let len = Bytes.length buffer in + hash_cost len >>? fun cost -> + Raw_context.consume_gas ctxt cost >>? fun ctxt -> + ok (ctxt, hash_f [buffer]) + | None -> + error + (Tx_rollup_errors_repr.Internal_error + "Cannot serialize input to hash function") + +let () = + let open Data_encoding in + (* Tx_rollup_negative_message_size *) + register_error_kind + `Permanent + ~id:"tx_rollup_negative_input_size" + ~title: + "The protocol has computed a negative size for the input of a hash \ + function" + ~description: + "The protocol has computed a negative size for the input of a hash \ + function. This is an internal error, and denotes a bug in the protocol \ + implementation." + unit + (function Tx_rollup_negative_input_size -> Some () | _ -> None) + (fun () -> Tx_rollup_negative_input_size) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.mli new file mode 100644 index 000000000000..4340dd40557d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_gas.mli @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Tx_rollup_negative_input_size + +(** A generic helper to hash an input *) +val hash : + hash_f:(bytes list -> 'b) -> + Raw_context.t -> + 'a Data_encoding.t -> + 'a -> + (Raw_context.t * 'b) tzresult + +(** [hash_cost size] returns the cost of gas for hashing a buffer of + [size] bytes. + + Raises [Tx_rollup_negative_input_size] iff [size < 0]. *) +val hash_cost : int -> Gas_limit_repr.cost tzresult + +val consume_check_path_inbox_cost : Raw_context.t -> Raw_context.t tzresult + +val consume_check_path_commitment_cost : Raw_context.t -> Raw_context.t tzresult + +(** [consume_add_message_cost ctxt] consume the gas cost of adding a + message to an inbox and return the new context. *) +val consume_add_message_cost : Raw_context.t -> Raw_context.t tzresult + +val consume_compact_commitment_cost : + Raw_context.t -> int -> Raw_context.t tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_hash_builder.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_hash_builder.ml new file mode 100644 index 000000000000..c623e15ff150 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_hash_builder.ml @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let message : + Raw_context.t -> + Tx_rollup_message_repr.t -> + (Raw_context.t * Tx_rollup_message_hash_repr.t) tzresult = + fun ctxt input -> + Tx_rollup_gas.hash + ~hash_f:Tx_rollup_message_hash_repr.hash_bytes + ctxt + Tx_rollup_message_repr.encoding + input + +let message_result : + Raw_context.t -> + Tx_rollup_message_result_repr.t -> + (Raw_context.t * Tx_rollup_message_result_hash_repr.t) tzresult = + fun ctxt input -> + Tx_rollup_gas.hash + ~hash_f:Tx_rollup_message_result_hash_repr.hash_bytes + ctxt + Tx_rollup_message_result_repr.encoding + input + +let compact_commitment : + Raw_context.t -> + Tx_rollup_commitment_repr.Compact.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Hash.t) tzresult = + fun ctxt input -> + Tx_rollup_gas.hash + ~hash_f:Tx_rollup_commitment_repr.Hash.hash_bytes + ctxt + Tx_rollup_commitment_repr.Compact.encoding + input + +let withdraw_list : + Raw_context.t -> + Tx_rollup_withdraw_repr.t list -> + (Raw_context.t * Tx_rollup_withdraw_list_hash_repr.t) tzresult = + fun ctxt input -> + Tx_rollup_gas.hash + ~hash_f:Tx_rollup_withdraw_list_hash_repr.hash_bytes + ctxt + (Data_encoding.list Tx_rollup_withdraw_repr.encoding) + input diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.ml new file mode 100644 index 000000000000..808dc32a1ab6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.ml @@ -0,0 +1,129 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module El = struct + type t = Tx_rollup_message_hash_repr.t + + let to_bytes = + Data_encoding.Binary.to_bytes_exn Tx_rollup_message_hash_repr.encoding +end + +module Prefix = struct + let name = "Inbox_list_hash" + + let title = "A merkle root hash for inboxes" + + let b58check_prefix = Tx_rollup_prefixes.inbox_list_hash.b58check_prefix + + let size = Some Tx_rollup_prefixes.inbox_list_hash.hash_size +end + +module H = Blake2B.Make (Base58) (Prefix) +module Merkle_list = Merkle_list.Make (El) (H) + +module Merkle = struct + type tree = Merkle_list.t + + type root = Merkle_list.h + + type path = Merkle_list.path + + let empty = Merkle_list.nil + + let root = Merkle_list.root + + let ( = ) = H.( = ) + + let compare = H.compare + + let root_encoding = H.encoding + + let root_of_b58check_opt = H.of_b58check_opt + + let pp_root = H.pp + + let path_encoding = Merkle_list.path_encoding + + let add_message = Merkle_list.snoc + + let tree_of_messages = List.fold_left Merkle_list.snoc Merkle_list.nil + + let compute_path messages position = + let tree = tree_of_messages messages in + Merkle_list.compute_path tree position + + let check_path = Merkle_list.check_path + + let path_depth = Merkle_list.path_depth + + let merklize_list messages = + let tree = tree_of_messages messages in + root tree +end + +type t = {inbox_length : int; cumulated_size : int; merkle_root : Merkle.root} + +let ( = ) + { + inbox_length = inbox_length_left; + cumulated_size = cumulated_size_left; + merkle_root = merkle_root_left; + } + { + inbox_length = inbox_length_right; + cumulated_size = cumulated_size_right; + merkle_root = merkle_root_right; + } = + Compare.Int.(inbox_length_left = inbox_length_right) + && Compare.Int.(cumulated_size_left = cumulated_size_right) + && Merkle.(merkle_root_left = merkle_root_right) + +let encoding = + let open Data_encoding in + conv + (fun {inbox_length; cumulated_size; merkle_root} -> + (inbox_length, cumulated_size, merkle_root)) + (fun (inbox_length, cumulated_size, merkle_root) -> + {inbox_length; cumulated_size; merkle_root}) + (obj3 + (req "inbox_length" int31) + (req "cumulated_size" int31) + (req "merkle_root" Merkle.root_encoding)) + +let empty = + {inbox_length = 0; cumulated_size = 0; merkle_root = Merkle_list.empty} + +let size = Z.of_int @@ Data_encoding.Binary.length encoding empty + +let pp fmt {inbox_length; cumulated_size; merkle_root} = + Format.fprintf + fmt + "Inbox with length %d, size %d, merkle root %a" + inbox_length + cumulated_size + Merkle.pp_root + merkle_root diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.mli new file mode 100644 index 000000000000..4d3d30e1a320 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_repr.mli @@ -0,0 +1,85 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Merkle : sig + (** See {!Merkle_List} for the documentation of those functions. *) + + type tree + + type root + + type path + + val empty : tree + + val root : tree -> root + + val ( = ) : root -> root -> bool + + val compare : root -> root -> int + + val root_encoding : root Data_encoding.t + + val root_of_b58check_opt : string -> root option + + val pp_root : Format.formatter -> root -> unit + + val path_encoding : path Data_encoding.t + + val add_message : tree -> Tx_rollup_message_hash_repr.t -> tree + + val compute_path : Tx_rollup_message_hash_repr.t list -> int -> path tzresult + + val check_path : + path -> int -> Tx_rollup_message_hash_repr.t -> root -> bool tzresult + + val path_depth : path -> int + + (** [merklize_list messages] construct a merkle root by build a + tree, appending the [messages] one by one in the same order of + the list and finally computing the root. *) + val merklize_list : Tx_rollup_message_hash_repr.t list -> root +end + +(** The view of an inbox: stores the [cumulated_size] in bytes for the + inbox, the [inbox_length] ({i i.e.}, the number of messages), and + the cumulative [hash] of the inbox contents. For newly created + inboxes, the [hash] is initialized as an array 32 null + byte. *) +type t = {inbox_length : int; cumulated_size : int; merkle_root : Merkle.root} + +(** [size] is the number of bytes necessary to store an inbox in the + layer-1 storage. *) +val size : Z.t + +val ( = ) : t -> t -> bool + +val encoding : t Data_encoding.t + +val empty : t + +val pp : Format.formatter -> t -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.ml new file mode 100644 index 000000000000..6ee40893346d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.ml @@ -0,0 +1,228 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_errors_repr + +let find : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_inbox_repr.t option) tzresult Lwt.t = + fun ctxt level tx_rollup -> + Storage.Tx_rollup.Inbox.find (ctxt, tx_rollup) level + +let get : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_inbox_repr.t) tzresult Lwt.t = + fun ctxt level tx_rollup -> + find ctxt level tx_rollup >>=? function + | _, None -> tzfail (Inbox_does_not_exist (tx_rollup, level)) + | ctxt, Some inbox -> return (ctxt, inbox) + +(** [prepare_inbox ctxt rollup state level] prepares the metadata + for an inbox at [level], which may imply creating it if it does + not already exist. *) +let prepare_inbox : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Raw_level_repr.t -> + (Raw_context.t + * Tx_rollup_state_repr.t + * Tx_rollup_level_repr.t + * Tx_rollup_inbox_repr.t + * Z.t) + tzresult + Lwt.t = + fun ctxt rollup state level -> + (* First, check if there are too many inboxes *) + fail_when + Compare.Int.( + Constants_storage.tx_rollup_max_inboxes_count ctxt + <= Tx_rollup_state_repr.inboxes_count state) + Too_many_inboxes + >>=? fun () -> + let current_levels = Tx_rollup_state_repr.head_levels state in + match current_levels with + | Some (_, tezos_lvl) when Raw_level_repr.(level < tezos_lvl) -> + tzfail (Internal_error "Trying to write into an inbox from the past") + | Some (tx_lvl, tezos_lvl) when Raw_level_repr.(tezos_lvl = level) -> + (* An inbox should already exists *) + Storage.Tx_rollup.Inbox.get (ctxt, rollup) tx_lvl + >>=? fun (ctxt, metadata) -> return (ctxt, state, tx_lvl, metadata, Z.zero) + | _ -> + let pred_level_and_tx_level = + Option.bind current_levels (fun (tx_level, tezos_level) -> + Option.map (fun pred -> (pred, tezos_level)) + @@ Tx_rollup_level_repr.pred tx_level) + in + (match pred_level_and_tx_level with + | None -> return (ctxt, state) + | Some (tx_level, tezos_level) -> + find ctxt tx_level rollup >>=? fun (ctxt, minbox) -> + (* If the previous inbox is no longer in the storage, then + quite some Tezos blocks have been created without any + activity regarding this rollup. We can consider the inbox + was empty, it does not change much. *) + let final_size = + match minbox with Some inbox -> inbox.cumulated_size | None -> 0 + in + let hard_limit = + Constants_storage.tx_rollup_hard_size_limit_per_inbox ctxt + in + let factor = + Constants_storage.tx_rollup_cost_per_byte_ema_factor ctxt + in + let diff = Raw_level_repr.diff level tezos_level in + (* Only [diff = Int32.one] should be checked + theoretically. If [diff < Int32.one], it likely + means there is a problem in the state machine since + this function was called twice for the same + level. This problem is caught at other + places. However, if this assumption is broken, I + prefer to consider that it counts as if there was + no empty blocks between the first call and the + second call to this function. *) + let elapsed = + if Compare.Int32.(diff <= Int32.one) then 0 else Int32.to_int diff + in + let state = + Tx_rollup_state_repr.update_burn_per_byte + state + ~elapsed + ~factor + ~final_size + ~hard_limit + in + Storage.Tx_rollup.State.add ctxt rollup state >|=? fun (ctxt, _, _) -> + (ctxt, state)) + >>=? fun (ctxt, state) -> + (* We need a new inbox *) + Tx_rollup_state_repr.record_inbox_creation state level + >>?= fun (state, tx_level, paid_storage_space_diff) -> + let inbox = Tx_rollup_inbox_repr.empty in + Storage.Tx_rollup.Inbox.init (ctxt, rollup) tx_level inbox + >>=? fun (ctxt, _inbox_size_alloc) -> + (* Storage accounting is done by + [Tx_rollup_state_repr.record_inbox_creation], so we can + ignore [inbox_size_alloc]. *) + return (ctxt, state, tx_level, inbox, paid_storage_space_diff) + +(** [update_inbox inbox msg_size] updates [metadata] to account + for a new message of [msg_size] bytes. *) +let update_inbox : + Tx_rollup_inbox_repr.t -> + int -> + Tx_rollup_inbox_repr.Merkle.root -> + Tx_rollup_inbox_repr.t = + fun metadata msg_size merkle_root -> + Tx_rollup_inbox_repr. + { + inbox_length = 1 + metadata.inbox_length; + cumulated_size = msg_size + metadata.cumulated_size; + merkle_root; + } + +let append_message : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_message_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t * Z.t) tzresult Lwt.t = + fun ctxt rollup state message -> + let level = (Raw_context.current_level ctxt).level in + let message_size = Tx_rollup_message_repr.size message in + (* Update the burn cost to pay for appending new messages *) + prepare_inbox ctxt rollup state level + >>=? fun ( ctxt, + new_state, + tx_level, + inbox, + paid_storage_space_diff_for_init_inbox ) -> + fail_when + Compare.Int.( + inbox.inbox_length + >= Constants_storage.tx_rollup_max_messages_per_inbox ctxt) + (Inbox_count_would_exceed_limit rollup) + >>=? fun () -> + Tx_rollup_hash_builder.message ctxt message >>?= fun (ctxt, message_hash) -> + Tx_rollup_gas.consume_add_message_cost ctxt >>?= fun ctxt -> + let ctxt, inbox_merkle_root = + Raw_context.Tx_rollup.add_message ctxt rollup message_hash + in + let new_inbox = update_inbox inbox message_size inbox_merkle_root in + let new_size = new_inbox.cumulated_size in + let inbox_limit = + Constants_storage.tx_rollup_hard_size_limit_per_inbox ctxt + in + fail_unless + Compare.Int.(new_size <= inbox_limit) + (Inbox_size_would_exceed_limit rollup) + >>=? fun () -> + (* Checks have passed, so we can actually record in the storage. *) + Storage.Tx_rollup.Inbox.add (ctxt, rollup) tx_level new_inbox + >>=? fun (ctxt, new_inbox_size_alloc, _) -> + Tx_rollup_state_repr.adjust_storage_allocation + new_state + ~delta:Z.(of_int new_inbox_size_alloc) + >>?= fun (new_state, paid_storage_space_diff) -> + return + ( ctxt, + new_state, + Z.add paid_storage_space_diff_for_init_inbox paid_storage_space_diff ) + +let remove : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + Raw_context.t tzresult Lwt.t = + fun ctxt level rollup -> + Storage.Tx_rollup.Inbox.remove (ctxt, rollup) level + >>=? fun (ctxt, _freed, _) -> return ctxt + +let check_message_hash : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + position:int -> + Tx_rollup_message_repr.t -> + Tx_rollup_inbox_repr.Merkle.path -> + Raw_context.t tzresult Lwt.t = + fun ctxt level tx_rollup ~position message path -> + Storage.Tx_rollup.Inbox.get (ctxt, tx_rollup) level >>=? fun (ctxt, inbox) -> + Tx_rollup_hash_builder.message ctxt message >>?= fun (ctxt, message_hash) -> + Tx_rollup_gas.consume_check_path_inbox_cost ctxt >>?= fun ctxt -> + Tx_rollup_inbox_repr.Merkle.check_path + path + position + message_hash + inbox.merkle_root + >>?= fun b -> + fail_unless b (Wrong_message_path {expected = inbox.merkle_root}) + >>=? fun () -> return ctxt diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.mli new file mode 100644 index 000000000000..d184958bfa06 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_inbox_storage.mli @@ -0,0 +1,112 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Functions to manipulate transaction rollup’s inboxes. + + Except explicit mention of the contrary, all the functions of this + module are carbonated. *) + +(** [append_message ctxt tx_rollup state message] tries to append + [message] to the inbox of [tx_rollup] at the current level, creating + it in the process if need be. This function returns the size of the + appended message (in bytes), in order for the appropriate burn to be + taken from the message author, the new state, as well as the storage + size diff. It is the caller's responsibility to store the returned state. + + {b Note:} [tx_rollup] needs to be a valid transaction address. It + is the responsibility of the caller to assert it. + + Returns the error + + {ul {li [Inbox_size_would_exceed_limit] if appending [message] to + the inbox would make it exceed the maximum size specified + by the [tx_rollup_hard_size_limit_per_inbox] protocol + parameter.} + {li [Message_size_exceeds_limit] if the size of [message] is + greater than the [tx_rollup_hard_size_limit_per_message] + protocol parameter.}} *) +val append_message : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Tx_rollup_message_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t * Z.t) tzresult Lwt.t + +(** [get ctxt level tx_rollup] returns the inbox of [tx_rollup] at + level [level]. + + Returns the errors + + {ul {li [Inbox_does_not_exist] iff [tx_rollup] does not have an + inbox at level [level]. }} *) +val get : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_inbox_repr.t) tzresult Lwt.t + +(** [find ctxt level tx_rollup] returns the inbox of [tx_rollup] at + level [level]. + + Returns [None] when the similar function [get] returns an + error. *) +val find : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_inbox_repr.t option) tzresult Lwt.t + +(** [remove ctxt level tx_rollup] removes from the context the inbox + of [level]. + + It is expected that this function is only called for inboxes that + has been “adopted” by a commitment. As a consequence, the storage + accounting is not performed by this function. + + This function will returns the error [Inbox_does_not_exist] if + there is no inbox for [level] in the storage. It is the + reponsibility of the caller to ensure the [tx_rollup] actually + exists. *) +val remove : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [check_message_hash ctxt level tx_rollup position message path] + checks that [message] is part of the [tx_rollup] inbox for [level] + by checking the merkelised proof given by [path]. + + If the proof failed, returns [Wrong_message_path]. *) +val check_message_hash : + Raw_context.t -> + Tx_rollup_level_repr.t -> + Tx_rollup_repr.t -> + position:int -> + Tx_rollup_message_repr.t -> + Tx_rollup_inbox_repr.Merkle.path -> + Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.ml new file mode 100644 index 000000000000..8959062241ae --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.ml @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Bls.Public_key_hash + +type address = t + +let in_memory_size : t -> Cache_memory_helpers.sint = + fun _ -> + let open Cache_memory_helpers in + header_size +! word_size +! string_size_gen Bls.Public_key_hash.size + +let size _ = Bls.Public_key_hash.size + +module Indexable = struct + include Indexable.Make (struct + type nonrec t = t + + let encoding = encoding + + let compare = compare + + let pp = pp + end) + + let in_memory_size x = Indexable.in_memory_size in_memory_size x + + let size x = Indexable.size size x +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.mli new file mode 100644 index 000000000000..534551d427df --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_address.mli @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module introduces the types used to identify ticket holders + within a transaction rollup. *) + +(** The hash of a BLS public key is used as the primary identifier + of ticket holders within a transaction rollup. *) +include module type of Bls.Public_key_hash with type t = Bls.Public_key_hash.t + +type address = t + +(** [in_memory_size a] returns the number of bytes allocated in RAM for [a]. *) +val in_memory_size : t -> Cache_memory_helpers.sint + +(** [size a] returns the number of bytes allocated in an inbox to store [a]. *) +val size : t -> int + +module Indexable : sig + type nonrec 'state t = ('state, address) Indexable.t + + type nonrec index = address Indexable.index + + type nonrec value = address Indexable.value + + type nonrec either = address Indexable.either + + val encoding : either Data_encoding.t + + val index_encoding : index Data_encoding.t + + val compare_values : value -> value -> int + + val value_encoding : value Data_encoding.t + + val compare : 'state t -> 'state' t -> int + + val value : address -> value + + val index : int32 -> index tzresult + + val index_exn : int32 -> index + + val pp : Format.formatter -> 'state t -> unit + + val size : 'state t -> int + + val in_memory_size : 'state t -> Cache_memory_helpers.sint +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.ml new file mode 100644 index 000000000000..f7b1a7d4edcf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.ml @@ -0,0 +1,778 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Tx_rollup_l2_context_sig +open Tx_rollup_l2_batch + +type error += + | Counter_mismatch of { + account : Tx_rollup_l2_address.t; + expected : int64; + provided : int64; + } + | Incorrect_aggregated_signature + | Unallocated_metadata of int32 + | Multiple_operations_for_signer of Bls.Public_key.t + | Invalid_transaction_encoding + | Invalid_batch_encoding + | Unexpectedly_indexed_ticket + | Missing_ticket of Ticket_hash.t + | Unknown_address of Tx_rollup_l2_address.t + | Invalid_self_transfer + | Invalid_zero_transfer + | Maximum_withdraws_per_message_exceeded of {current : int; maximum : int} + +let () = + let open Data_encoding in + (* Counter mismatch *) + register_error_kind + `Branch + ~id:"tx_rollup_operation_counter_mismatch" + ~title:"Operation counter mismatch" + ~description: + "A transaction rollup operation has been submitted with an incorrect \ + counter" + (obj3 + (req "account" Tx_rollup_l2_address.encoding) + (req "expected" int64) + (req "provided" int64)) + (function + | Counter_mismatch {account; expected; provided} -> + Some (account, expected, provided) + | _ -> None) + (fun (account, expected, provided) -> + Counter_mismatch {account; expected; provided}) ; + (* Incorrect aggregated signature *) + register_error_kind + `Permanent + ~id:"tx_rollup_incorrect_aggregated_signature" + ~title:"Incorrect aggregated signature" + ~description:"The aggregated signature is incorrect" + empty + (function Incorrect_aggregated_signature -> Some () | _ -> None) + (function () -> Incorrect_aggregated_signature) ; + (* Unallocated metadata *) + register_error_kind + `Branch + ~id:"tx_rollup_unknown_metadata" + ~title:"Unknown metadata" + ~description: + "A public key index was provided but the account information for this \ + index is not present in the context." + (obj1 (req "idx" int32)) + (function Unallocated_metadata i -> Some i | _ -> None) + (function i -> Unallocated_metadata i) ; + (* Invalid transaction *) + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_transaction" + ~title:"Invalid transaction" + ~description: + "The signer signed multiple operations in the same transaction. He must \ + gather all the contents in a single operation" + (obj1 (req "pk" Bls.Public_key.encoding)) + (function Multiple_operations_for_signer idx -> Some idx | _ -> None) + (function idx -> Multiple_operations_for_signer idx) ; + (* Invalid transaction encoding *) + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_transaction_encoding" + ~title:"Invalid transaction encoding" + ~description:"The transaction could not be decoded from bytes" + empty + (function Invalid_transaction_encoding -> Some () | _ -> None) + (function () -> Invalid_transaction_encoding) ; + (* Invalid batch encoding *) + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_batch_encoding" + ~title:"Invalid batch encoding" + ~description:"The batch could not be decoded from bytes" + empty + (function Invalid_batch_encoding -> Some () | _ -> None) + (function () -> Invalid_batch_encoding) ; + (* Unexpectedly indexed ticket *) + register_error_kind + `Permanent + ~id:"tx_rollup_unexpectedly_indexed_ticket" + ~title:"Unexpected indexed ticket in deposit or transfer" + ~description: + "Tickets in layer2-to-layer1 transfers must be referenced by value." + empty + (function Unexpectedly_indexed_ticket -> Some () | _ -> None) + (function () -> Unexpectedly_indexed_ticket) ; + (* Missing ticket *) + register_error_kind + `Temporary + ~id:"tx_rollup_missing_ticket" + ~title:"Attempted to withdraw from a ticket missing in the rollup" + ~description: + "A withdrawal must reference a ticket that already exists in the rollup." + (obj1 (req "ticket_hash" Ticket_hash.encoding)) + (function Missing_ticket ticket_hash -> Some ticket_hash | _ -> None) + (function ticket_hash -> Missing_ticket ticket_hash) ; + (* Unknown address *) + register_error_kind + `Temporary + ~id:"tx_rollup_unknown_address" + ~title:"Attempted to sign a transfer with an unknown address" + ~description: + "The address must exist in the context when signing a transfer with it." + (obj1 (req "address" Tx_rollup_l2_address.encoding)) + (function Unknown_address addr -> Some addr | _ -> None) + (function addr -> Unknown_address addr) ; + (* Invalid self transfer *) + register_error_kind + `Temporary + ~id:"tx_rollup_invalid_self_transfer" + ~title:"Attempted to transfer ticket to self" + ~description:"The index for the destination is the same as the sender" + empty + (function Invalid_self_transfer -> Some () | _ -> None) + (function () -> Invalid_self_transfer) ; + (* Invalid zero transfer *) + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_zero_transfer" + ~title:"Attempted to transfer zero ticket" + ~description:"A transfer's amount must be greater than zero." + empty + (function Invalid_zero_transfer -> Some () | _ -> None) + (function () -> Invalid_zero_transfer) ; + (* Maximum_withdraws_per_message_exceeded *) + register_error_kind + `Permanent + ~id:"tx_rollup_maximum_withdraws_per_message_exceeded" + ~title:"Maximum tx-rollup withdraws per message exceeded" + ~description: + "The maximum number of withdraws allowed per tx-rollup message exceeded" + (obj2 (req "current" int31) (req "limit" int31)) + (function + | Maximum_withdraws_per_message_exceeded {current; maximum} -> + Some (current, maximum) + | _ -> None) + (fun (current, maximum) -> + Maximum_withdraws_per_message_exceeded {current; maximum}) + +type indexes = { + address_indexes : + (Tx_rollup_l2_address.t * Tx_rollup_l2_address.Indexable.index) list; + ticket_indexes : (Ticket_hash.t * Ticket_indexable.index) list; +} + +let encoding_indexes : indexes Data_encoding.t = + let open Data_encoding in + conv + (fun {address_indexes; ticket_indexes} -> (address_indexes, ticket_indexes)) + (fun (address_indexes, ticket_indexes) -> {address_indexes; ticket_indexes}) + @@ obj2 + (req + "address_indexes" + (list + (tup2 + Tx_rollup_l2_address.encoding + Tx_rollup_l2_address.Indexable.index_encoding))) + (req + "ticket_indexes" + (list (tup2 Ticket_hash.encoding Ticket_indexable.index_encoding))) + +module Message_result = struct + type transaction_result = + | Transaction_success + | Transaction_failure of {index : int; reason : error} + + type deposit_result = Deposit_success of indexes | Deposit_failure of error + + let encoding_transaction_result = + let open Data_encoding in + union + [ + (let kind = "transaction_success" in + case + ~title:kind + (Tag 0) + (constant kind) + (function Transaction_success -> Some () | _ -> None) + (fun () -> Transaction_success)); + (let kind = "transaction_failure" in + case + ~title:kind + (Tag 1) + (obj1 + (req + kind + (obj2 + (req "transaction_index" Data_encoding.int31) + (req "reason" Error_monad.error_encoding)))) + (function + | Transaction_failure {index; reason} -> Some (index, reason) + | _ -> None) + (fun (index, reason) -> Transaction_failure {index; reason})); + ] + + let encoding_deposit_result = + let open Data_encoding in + union + [ + (let kind = "deposit_success" in + case + ~title:kind + (Tag 0) + (obj1 (req kind encoding_indexes)) + (function Deposit_success indexes -> Some indexes | _ -> None) + (fun indexes -> Deposit_success indexes)); + (let kind = "deposit_failure" in + case + ~title:kind + (Tag 1) + (obj1 (req kind (obj1 (req "reason" Error_monad.error_encoding)))) + (function Deposit_failure reason -> Some reason | _ -> None) + (fun reason -> Deposit_failure reason)); + ] + + module Batch_V1 = struct + type t = + | Batch_result of { + results : + ((Indexable.index_only, Indexable.unknown) V1.transaction + * transaction_result) + list; + indexes : indexes; + } + + let encoding = + let open Data_encoding in + conv + (fun (Batch_result {results; indexes}) -> (results, indexes)) + (fun (results, indexes) -> Batch_result {results; indexes}) + (obj2 + (req "results" + @@ list + (Data_encoding.tup2 + (Compact.make + ~tag_size:`Uint8 + V1.compact_transaction_signer_index) + encoding_transaction_result)) + (req "allocated_indexes" encoding_indexes)) + end + + type message_result = + | Deposit_result of deposit_result + | Batch_V1_result of Batch_V1.t + + let message_result_encoding = + let open Data_encoding in + union + [ + (let kind = "deposit_result" in + case + ~title:kind + (Tag 0) + (obj1 (req kind encoding_deposit_result)) + (function Deposit_result result -> Some result | _ -> None) + (fun result -> Deposit_result result)); + (let kind = "batch_v1_result" in + case + ~title:kind + (Tag 1) + (obj1 (req kind Batch_V1.encoding)) + (function Batch_V1_result result -> Some result | _ -> None) + (fun result -> Batch_V1_result result)); + ] + + type t = message_result * Tx_rollup_withdraw.t list + + let encoding = + Data_encoding.( + tup2 message_result_encoding (list Tx_rollup_withdraw.encoding)) +end + +type parameters = { + (* Maximum number of allowed L2-to-L1 withdraws per batch *) + tx_rollup_max_withdrawals_per_batch : int; +} + +module Make (Context : CONTEXT) = struct + open Context + open Syntax + open Message_result + + type ctxt = Context.t + + (** {3. Indexes. } *) + + (** The application of a message can (and is supposed to) use and + create several indexes during the application of a {Tx_rollup_message.t}. + *) + + let index get_or_associate_index add_index ctxt indexes indexable = + let open Indexable in + match destruct indexable with + | Right v -> ( + let+ ctxt, created, idx = get_or_associate_index ctxt v in + match created with + | `Existed -> (ctxt, indexes, idx) + | `Created -> (ctxt, add_index indexes (v, idx), idx)) + | Left i -> return (ctxt, indexes, i) + + let address_index ctxt indexes indexable = + let get_or_associate_index = Address_index.get_or_associate_index in + let add_index indexes x = + {indexes with address_indexes = x :: indexes.address_indexes} + in + index get_or_associate_index add_index ctxt indexes indexable + + let ticket_index ctxt indexes indexable = + let get_or_associate_index = Ticket_index.get_or_associate_index in + let add_index indexes x = + {indexes with ticket_indexes = x :: indexes.ticket_indexes} + in + index get_or_associate_index add_index ctxt indexes indexable + + let address_of_signer_index : + Signer_indexable.index -> Tx_rollup_l2_address.Indexable.index = + fun idx -> Indexable.(index_exn (to_int32 idx)) + + let signer_of_address_index : + Tx_rollup_l2_address.Indexable.index -> Signer_indexable.index = + fun idx -> Indexable.(index_exn (to_int32 idx)) + + let empty_indexes = {address_indexes = []; ticket_indexes = []} + + let assert_non_zero_quantity qty = + fail_when Tx_rollup_l2_qty.(qty = zero) Invalid_zero_transfer + + (** {2. Counter } *) + + (** [get_metadata ctxt idx] returns the metadata associated to [idx] in + [ctxt]. It must have an associated metadata in the context, otherwise, + something went wrong in {!check_signature}. *) + let get_metadata : ctxt -> address_index -> metadata m = + fun ctxt idx -> + let open Address_metadata in + let* metadata = get ctxt idx in + match metadata with + | None -> fail (Unallocated_metadata (Indexable.to_int32 idx)) + | Some metadata -> return metadata + + (** [get_metadata_signer] gets the metadata for a signer using {!get_metadata}. + It transforms a signer index to an address one. *) + let get_metadata_signer : ctxt -> Signer_indexable.index -> metadata m = + fun ctxt signer_idx -> get_metadata ctxt (address_of_signer_index signer_idx) + + (** [transfers ctxt source_idx destination_idx tidx amount] transfers [amount] + from [source_idx] to [destination_idx] of [tidx]. *) + let transfer ctxt source_idx destination_idx tidx amount = + let* () = + fail_unless + Compare.Int.(Indexable.compare_indexes source_idx destination_idx <> 0) + Invalid_self_transfer + in + let* () = assert_non_zero_quantity amount in + let* ctxt = Ticket_ledger.spend ctxt tidx source_idx amount in + Ticket_ledger.credit ctxt tidx destination_idx amount + + (** [deposit ctxt aidx tidx amount] credits [amount] of [tidx] to [aidx]. + They are deposited from the layer1 and created in the layer2 context, but, + we only handle the creation part (i.e. in the layer2) in this module. *) + let deposit ctxt aidx tidx amount = Ticket_ledger.credit ctxt tidx aidx amount + + module Batch_V1 = struct + open Tx_rollup_l2_batch.V1 + + (** [operation_with_signer_index ctxt indexes op] takes an operation + and performs multiple get/sets on the context to return an operation + where the signer is replaced by its index. + + It performs on the [ctxt]: + {ul {li If the signer is an index, we read the public key from the + [ctxt].} + {li If the signer is a public key, we associate a new index to + it in the [ctxt]. The public key is also added to the metadata + if not already present.}} + + {b Note:} If the context already contains all the required information, + we only read from it. *) + let operation_with_signer_index : + ctxt -> + indexes -> + ('signer, 'content) operation -> + (ctxt + * indexes + * (Indexable.index_only, 'content) operation + * Bls.Public_key.t) + m = + fun ctxt indexes op -> + let* ctxt, indexes, pk, idx = + match Indexable.destruct op.signer with + | Left signer_index -> + (* Get the public key from the index. *) + let address_index = address_of_signer_index signer_index in + let* metadata = get_metadata ctxt address_index in + let pk = metadata.public_key in + return (ctxt, indexes, pk, address_index) + | Right (Bls_pk signer_pk) -> ( + (* Initialize the ctxt with public_key if it's necessary. *) + let addr = Bls.Public_key.hash signer_pk in + let* ctxt, created, idx = + Address_index.get_or_associate_index ctxt addr + in + + (* If the address is created, we add it to [indexes]. *) + match created with + | `Existed -> + (* If the public key existed in the context, it should not + be added in [indexes]. However, the metadata might not + have been initialized for the public key. Especially during + a deposit, the deposit destination is a layer2 address and + it contains no information about the public key. + *) + let* ctxt = + let* metadata = Address_metadata.get ctxt idx in + match metadata with + | Some _ -> + (* If the metadata exists, then the public key necessarily + exists, we do not need to change the context. *) + return ctxt + | None -> + Address_metadata.init_with_public_key ctxt idx signer_pk + in + return (ctxt, indexes, signer_pk, idx) + | `Created -> + (* If the index is created, we need to add to indexes and + initialize the metadata. *) + let indexes = + { + indexes with + address_indexes = (addr, idx) :: indexes.address_indexes; + } + in + let* ctxt = + Address_metadata.init_with_public_key ctxt idx signer_pk + in + return (ctxt, indexes, signer_pk, idx)) + | Right (L2_addr signer_addr) -> ( + (* In order to get the public key associated to [signer_addr], there + needs to be both an index associated to it, and a metadata for this + index. *) + let* idx = Address_index.get ctxt signer_addr in + match idx with + | None -> fail (Unknown_address signer_addr) + | Some idx -> + let* metadata = get_metadata ctxt idx in + return (ctxt, indexes, metadata.public_key, idx)) + in + let op : (Indexable.index_only, 'content) operation = + {op with signer = signer_of_address_index idx} + in + return (ctxt, indexes, op, pk) + + (** [check_transaction ctxt indexes transmitted transaction] performs an + *active* check of an operation. + We consider this as an *active* check because the function is likely to + write in the [ctxt], since it replaces the signer's public key + (if provided) by its index in {!operation_with_signer_index}. + + Outside of the active preprocessing, we check that a signer signs + at most one operation in the [transaction]. + + It also associates the signer to the bytes representation of a + transaction in [transmitted], which is used to check the aggregated + signature. + *) + let check_transaction ctxt indexes transmitted transaction = + let* buf = + match + Data_encoding.Binary.to_bytes_opt + (Data_encoding.Compact.make ~tag_size:`Uint8 compact_transaction) + transaction + with + | Some buf -> return buf + | None -> fail Invalid_transaction_encoding + in + let* ctxt, indexes, transmitted, _, rev_ops = + list_fold_left_m + (fun (ctxt, indexes, transmitted, signers, ops) op -> + let* ctxt, indexes, op, pk = + operation_with_signer_index ctxt indexes op + in + if List.mem ~equal:Bls.Public_key.equal pk signers then + fail (Multiple_operations_for_signer pk) + else + return + ( ctxt, + indexes, + (pk, buf) :: transmitted, + pk :: signers, + op :: ops )) + (ctxt, indexes, transmitted, [], []) + transaction + in + return (ctxt, indexes, transmitted, List.rev rev_ops) + + let check_signature : + ctxt -> + ('signer, 'content) t -> + (ctxt * indexes * (Indexable.index_only, 'content) t) m = + fun ctxt ({contents = transactions; aggregated_signature} as batch) -> + let* ctxt, indexes, transmitted, rev_new_transactions = + list_fold_left_m + (fun (ctxt, indexes, transmitted, new_transactions) transaction -> + (* To check the signature, we need the list of [buf] each signer + signed. That is, the [buf] is the binary encoding of the + [transaction]. *) + let* ctxt, indexes, transmitted, transaction = + check_transaction ctxt indexes transmitted transaction + in + return (ctxt, indexes, transmitted, transaction :: new_transactions)) + (ctxt, empty_indexes, [], []) + transactions + in + (* Once we collected the public keys for each signer and the buffers + they signed, we can check the signature. *) + let* b = bls_verify transmitted aggregated_signature in + let* () = fail_unless b Incorrect_aggregated_signature in + let batch = {batch with contents = List.rev rev_new_transactions} in + return (ctxt, indexes, batch) + + (** {2. Apply } *) + + (** [apply_operation_content ctxt source content] performs the transfer + on the [ctxt]. The validity of the transfer is checked in + the context itself, e.g. for an invalid balance. + + It returns the potential created indexes: + + {ul {li The destination address index.} + {li The ticket exchanged index.}} + *) + let apply_operation_content : + ctxt -> + indexes -> + Signer_indexable.index -> + 'content operation_content -> + (ctxt * indexes * Tx_rollup_withdraw.t option) m = + fun ctxt indexes source_idx op_content -> + match op_content with + | Withdraw {destination = claimer; ticket_hash; qty = amount} -> + (* To withdraw, the ticket must already exist in the + rollup and be indexed (the ticket must have already been + assigned an index in the content: otherwise the ticket has + not been seen before and we can't withdraw from it). *) + let* tidx_opt = Ticket_index.get ctxt ticket_hash in + let*? tidx = + Option.value_e ~error:(Missing_ticket ticket_hash) tidx_opt + in + let source_idx = address_of_signer_index source_idx in + + (* spend the ticket -- this is responsible for checking that + the source has the required balance *) + let* () = assert_non_zero_quantity amount in + let* ctxt = Ticket_ledger.spend ctxt tidx source_idx amount in + let withdrawal = Tx_rollup_withdraw.{claimer; ticket_hash; amount} in + return (ctxt, indexes, Some withdrawal) + | Transfer {destination; ticket_hash; qty} -> + let* ctxt, indexes, dest_idx = + address_index ctxt indexes destination + in + let* ctxt, indexes, tidx = ticket_index ctxt indexes ticket_hash in + let source_idx = address_of_signer_index source_idx in + let* ctxt = transfer ctxt source_idx dest_idx tidx qty in + return (ctxt, indexes, None) + + (** [check_counter ctxt signer counter] asserts that the provided [counter] is the + successor of the one associated to the [signer] in the [ctxt]. *) + let check_counter : + ctxt -> Indexable.index_only Signer_indexable.t -> int64 -> unit m = + fun ctxt signer counter -> + let* metadata = get_metadata_signer ctxt signer in + fail_unless + Compare.Int64.(counter = Int64.succ metadata.counter) + (Counter_mismatch + { + account = Bls.Public_key.hash metadata.public_key; + expected = Int64.succ metadata.counter; + provided = counter; + }) + + (** [apply_operation ctxt indexes op] checks the counter validity for the [op.signer] with + {!check_counter}, and then calls {!apply_operation_content} for each content in [op]. *) + let apply_operation : + ctxt -> + indexes -> + (Indexable.index_only, Indexable.unknown) operation -> + (ctxt * indexes * Tx_rollup_withdraw.t list) m = + fun ctxt indexes {signer; counter; contents} -> + (* Before applying any operation, we check the counter *) + let* () = check_counter ctxt signer counter in + let* ctxt, indexes, rev_withdrawals = + list_fold_left_m + (fun (ctxt, indexes, withdrawals) content -> + let* ctxt, indexes, withdrawal_opt = + apply_operation_content ctxt indexes signer content + in + return (ctxt, indexes, Option.to_list withdrawal_opt @ withdrawals)) + (ctxt, indexes, []) + contents + in + return (ctxt, indexes, rev_withdrawals |> List.rev) + + (** [apply_transaction ctxt indexes transaction] applies each operation in + the [transaction]. It returns a {!transaction_result}, i.e. either + every operation in the [transaction] succedeed and the [ctxt] is + modified, or the [transaction] is a failure and the context + is left untouched. + *) + let apply_transaction : + ctxt -> + indexes -> + (Indexable.index_only, Indexable.unknown) transaction -> + (ctxt * indexes * transaction_result * Tx_rollup_withdraw.t list) m = + fun initial_ctxt initial_indexes transaction -> + let rec fold (ctxt, prev_indexes, withdrawals) index ops = + match ops with + | [] -> return (ctxt, prev_indexes, Transaction_success, withdrawals) + | op :: rst -> + let* ctxt, indexes, status, withdrawals = + catch + (apply_operation ctxt prev_indexes op) + (fun (ctxt, indexes, op_withdrawals) -> + fold + (ctxt, indexes, withdrawals @ op_withdrawals) + (index + 1) + rst) + (fun reason -> + return + ( initial_ctxt, + initial_indexes, + Transaction_failure {index; reason}, + [] )) + in + return (ctxt, indexes, status, withdrawals) + in + fold (initial_ctxt, initial_indexes, []) 0 transaction + + (** [update_counters ctxt status transaction] updates the counters for + the signers of operations in [transaction]. If the [transaction] + failed because of a [Counter_mismatch] the counters are left + untouched. + *) + let update_counters ctxt status transaction = + match status with + | Transaction_failure {reason = Counter_mismatch _; _} -> return ctxt + | Transaction_failure _ | Transaction_success -> + list_fold_left_m + (fun ctxt (op : (Indexable.index_only, _) operation) -> + Address_metadata.incr_counter ctxt + @@ address_of_signer_index op.signer) + ctxt + transaction + + let apply_batch : + ctxt -> + parameters -> + (Indexable.unknown, Indexable.unknown) t -> + (ctxt * Message_result.Batch_V1.t * Tx_rollup_withdraw.t list) m = + fun ctxt parameters batch -> + let* ctxt, indexes, batch = check_signature ctxt batch in + let {contents; _} = batch in + let* ctxt, indexes, rev_results, withdrawals = + list_fold_left_m + (fun (prev_ctxt, prev_indexes, results, withdrawals) transaction -> + let* new_ctxt, new_indexes, status, transaction_withdrawals = + apply_transaction prev_ctxt prev_indexes transaction + in + let* new_ctxt = update_counters new_ctxt status transaction in + return + ( new_ctxt, + new_indexes, + (transaction, status) :: results, + withdrawals @ transaction_withdrawals )) + (ctxt, indexes, [], []) + contents + in + let limit = parameters.tx_rollup_max_withdrawals_per_batch in + if Compare.List_length_with.(withdrawals > limit) then + fail + (Maximum_withdraws_per_message_exceeded + {current = List.length withdrawals; maximum = limit}) + else + let results = List.rev rev_results in + return + ( ctxt, + Message_result.Batch_V1.Batch_result {results; indexes}, + withdrawals ) + end + + let apply_deposit : + ctxt -> + Tx_rollup_message.deposit -> + (ctxt * deposit_result * Tx_rollup_withdraw.t option) m = + fun initial_ctxt Tx_rollup_message.{sender; destination; ticket_hash; amount} -> + let apply_deposit () = + let* ctxt, indexes, aidx = + address_index initial_ctxt empty_indexes destination + in + let* ctxt, indexes, tidx = + ticket_index ctxt indexes Indexable.(value ticket_hash) + in + let* ctxt = deposit ctxt aidx tidx amount in + return (ctxt, indexes) + in + catch + (apply_deposit ()) + (fun (ctxt, indexes) -> return (ctxt, Deposit_success indexes, None)) + (fun reason -> + (* Should there be an error during the deposit, then return + the full [amount] to [sender] in the form of a + withdrawal. *) + let withdrawal = + Tx_rollup_withdraw.{claimer = sender; ticket_hash; amount} + in + return (initial_ctxt, Deposit_failure reason, Some withdrawal)) + + let apply_message : + ctxt -> parameters -> Tx_rollup_message.t -> (ctxt * Message_result.t) m = + fun ctxt parameters msg -> + let open Tx_rollup_message in + match msg with + | Deposit deposit -> + let* ctxt, result, withdrawl_opt = apply_deposit ctxt deposit in + return (ctxt, (Deposit_result result, Option.to_list withdrawl_opt)) + | Batch str -> ( + let batch = + Data_encoding.Binary.of_string_opt Tx_rollup_l2_batch.encoding str + in + match batch with + | Some (V1 batch) -> + let* ctxt, result, withdrawals = + Batch_V1.apply_batch ctxt parameters batch + in + return (ctxt, (Batch_V1_result result, withdrawals)) + | None -> fail Invalid_batch_encoding) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.mli new file mode 100644 index 000000000000..1f71544e556f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_apply.mli @@ -0,0 +1,226 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context +open Tx_rollup_l2_context_sig +open Tx_rollup_l2_batch + +(** This module introduces the interpretation (off-chain) of layer2 operations + read from its inboxes. + + The main concern is now to interpret operations in the layer2 context + with a high-throughput and process a significant number of operations + “per second.” + + The operations can be crafted with indexes (see {!Indexable}). It is meant + to reduce the size of operations, and therefore, increase the number + of those in a message to the layer2. You will see in this file indexables + which are yet unknowns (see {!Indexable.unknown}). They can be later on + modified to indexes only (see {!Indexable.index_only}) when the potential + values have been replaced by their indexes. + + Therefore, we need to have the minimal number of accesses to the context. + Thus, when a value is read from its index in the context, it *must* be + done once. +*) + +type error += + | Counter_mismatch of { + account : Tx_rollup_l2_address.t; + expected : int64; + provided : int64; + } + | Incorrect_aggregated_signature + | Unallocated_metadata of int32 + | Multiple_operations_for_signer of Bls.Public_key.t + | Invalid_transaction_encoding + | Invalid_batch_encoding + | Unexpectedly_indexed_ticket + | Missing_ticket of Ticket_hash.t + | Unknown_address of Tx_rollup_l2_address.t + | Invalid_self_transfer + | Invalid_zero_transfer + | Maximum_withdraws_per_message_exceeded of {current : int; maximum : int} + +(** Applying operations in the layer2 can result in creating indexes + associated to both the addresses and the ticket hashes. We keep track + of these creations in order to replace the values by their indexes + in future operations. *) +type indexes = { + address_indexes : + (Tx_rollup_l2_address.t * Tx_rollup_l2_address.Indexable.index) list; + ticket_indexes : (Ticket_hash.t * Ticket_indexable.index) list; +} + +module Message_result : sig + (** A transaction inside a batch can either be a success or a failure. + + In the case of a failure, we store the operation's index which failed + with the reason it failed. *) + type transaction_result = + | Transaction_success + | Transaction_failure of {index : int; reason : error} + + (** A deposit can either be a success or a failure. The created indexes + must are kept only when the deposit is a success. In the other case, + we return the reason why the deposit failed. *) + type deposit_result = Deposit_success of indexes | Deposit_failure of error + + (** The operations are versioned (see {!Tx_rollup_l2_batch}). Therefore, we + introduce the operation results for each version. *) + + module Batch_V1 : sig + type t = + | Batch_result of { + results : + ((Indexable.index_only, Indexable.unknown) V1.transaction + * transaction_result) + list; + indexes : indexes; + } + end + + type message_result = + | Deposit_result of deposit_result + | Batch_V1_result of Batch_V1.t + + (* In addition to [message_result] the result contains the list of + withdrawals that result from failing deposits and layer2-to-layer1 + transfers. *) + type t = message_result * Tx_rollup_withdraw.t list + + val encoding : t Data_encoding.t +end + +(** The record of parameters used during the application of messages. *) +type parameters = { + (* Maximum number of allowed L2-to-L1 withdraws per batch *) + tx_rollup_max_withdrawals_per_batch : int; +} + +module Make (Context : CONTEXT) : sig + open Context + + type ctxt = t + + (** The operations are versioned (see {!Tx_rollup_l2_batch}), + so their interpretations are. *) + + module Batch_V1 : sig + open Tx_rollup_l2_batch.V1 + + (** [apply_batch ctxt parameters batch] interprets the batch + {!Tx_rollup_l2_batch.V1.t}. + + By construction, a failing transaction will not affect the [ctxt] + and other transactions will still be interpreted. + That is, this function can only fail because of internals errors. + Otherwise, the errors that caused the transactions to fail can be + observed in the result (see {!Message_result.Batch_V1.t}). + + The counters are incremented when the operation is part of a transaction + that is correctly signed and whose every operations have the expected + counter. In particular, the result of the application is not important + (i.e. the counters are updated even if the transaction failed). + + In addition, the list of withdrawals resulting from each + layer2-to-layer1 transfer message in the batch is returned. + *) + val apply_batch : + ctxt -> + parameters -> + (Indexable.unknown, Indexable.unknown) t -> + (ctxt * Message_result.Batch_V1.t * Tx_rollup_withdraw.t list) m + + (** [check_signature ctxt batch] asserts that [batch] is correctly signed. + + We recall that [batch] may contain indexes, that is integers which + replace larger values. The [signer] field of the + {!Tx_rollup_l2_batch.operation} type is concerned. This field is either + the public key to be used to check the signature, or an index. + In case of the public key, [check_signature] will check whether or not + the related {!Tx_rollup_l2_address.t} has already an index assigned, + and allocate one if not. + + Overall, [check_signature] returns the revised context, the list of + newly allocated indexes, and an updated version of the batches where + all [signer] field have been replaced by valid indexes. + + {b Note:} What a user is expected to sign is the version of the + operation it sends to the network. This is potentially unsafe, + because it means the user signs indexes, not addresses nor + ticket hashes. This poses two threats: Tezos reorganization, + and malicious provider of indexes. A Tezos reorganization may + imply that an index allocated to one address in a given branch + is allocated to another address in another branch. We deal with + this issue by making the rollup node aware of the Tezos level at + each time an index is allocated. This allows to implement a RPC that + can safely tell a client to use either the full value or the index, + thanks to Tenderbake finality. To prevent the rollup node to lie, + we will make the rollup node provide Merkle proofs that allows the + client to verify that the index is correct. + *) + val check_signature : + ctxt -> + (Indexable.unknown, Indexable.unknown) t -> + (ctxt * indexes * (Indexable.index_only, Indexable.unknown) t) m + end + + (** [apply_deposit ctxt deposit] credits a quantity of tickets to a layer2 + address in [ctxt]. + + This function can fail if the [deposit.amount] is not strictly-positive. + + If the [deposit] causes an error, then a withdrawal returning + the funds to the deposit's sender is returned. + *) + val apply_deposit : + ctxt -> + Tx_rollup_message.deposit -> + (ctxt * Message_result.deposit_result * Tx_rollup_withdraw.t option) m + + (** [apply_message ctxt parameters message] interprets the [message] in the + [ctxt]. + + That is, + + {ul {li Deposit tickets if the message is a deposit. } + {li Decodes the batch and interprets it for the + correct batch version. }} + + The function can fail with {!Invalid_batch_encoding} if it's not able + to decode the batch. + + The function can also return errors from subsequent functions, + see {!apply_deposit} and batch interpretations for various versions. + + The list of withdrawals in the message result followed the ordering + of the contents in the message. + *) + val apply_message : + ctxt -> parameters -> Tx_rollup_message.t -> (ctxt * Message_result.t) m +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.ml new file mode 100644 index 000000000000..a04ee146e063 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.ml @@ -0,0 +1,318 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_l2_context_sig + +let tag_size = `Uint8 + +type signer = Bls_pk of Bls.Public_key.t | L2_addr of Tx_rollup_l2_address.t + +module Signer_indexable = Indexable.Make (struct + type t = signer + + let pp fmt = function + | Bls_pk _ -> Format.pp_print_string fmt "<bls_signature>" + | L2_addr addr -> Tx_rollup_l2_address.pp fmt addr + + let compare x y = + match (x, y) with + | Bls_pk pk1, Bls_pk pk2 -> Bls.Public_key.compare pk1 pk2 + | L2_addr addr1, L2_addr addr2 -> Tx_rollup_l2_address.compare addr1 addr2 + | L2_addr _, Bls_pk _ -> -1 + | Bls_pk _, L2_addr _ -> 1 + + let encoding = + let open Data_encoding in + union + [ + case + ~title:"bls_pk" + (Tag 0) + Bls.Public_key.encoding + (function Bls_pk pk -> Some pk | _ -> None) + (fun pk -> Bls_pk pk); + case + ~title:"l2_addr" + (Tag 1) + Tx_rollup_l2_address.encoding + (function L2_addr addr -> Some addr | _ -> None) + (fun addr -> L2_addr addr); + ] +end) + +module V1 = struct + type 'status operation_content = + | Withdraw of { + destination : Signature.Public_key_hash.t; + ticket_hash : Alpha_context.Ticket_hash.t; + qty : Tx_rollup_l2_qty.t; + } + | Transfer of { + destination : 'status Tx_rollup_l2_address.Indexable.t; + ticket_hash : 'status Ticket_indexable.t; + qty : Tx_rollup_l2_qty.t; + } + + type ('signer, 'content) operation = { + signer : 'signer Signer_indexable.t; + counter : int64; + contents : 'content operation_content list; + } + + type ('signer, 'content) transaction = ('signer, 'content) operation list + + type signature = Bls.t + + type ('signer, 'content) t = { + contents : ('signer, 'content) transaction list; + aggregated_signature : signature; + } + + (* --- ENCODING ------------------------------------------------------------- *) + + (* --- [operation_content] *) + + let compact_binary_operation_content = + let open Data_encoding.Compact in + union + [ + case + ~title:"withdraw" + (obj3 + (req "destination" (payload Signature.Public_key_hash.encoding)) + (req "ticket_hash" (payload Alpha_context.Ticket_hash.encoding)) + (req "qty" Tx_rollup_l2_qty.compact_encoding)) + (function + | Withdraw {destination; ticket_hash; qty} -> + Some (destination, ticket_hash, qty) + | _ -> None) + (fun (destination, ticket_hash, qty) -> + Withdraw {destination; ticket_hash; qty}); + case + ~title:"transfer" + (obj3 + (req + "destination" + (Indexable.compact Tx_rollup_l2_address.encoding)) + (req "ticket_hash" Ticket_indexable.compact) + (req "qty" Tx_rollup_l2_qty.compact_encoding)) + (function + | Transfer {destination; ticket_hash; qty} -> + Some (destination, ticket_hash, qty) + | _ -> None) + (fun (destination, ticket_hash, qty) -> + Transfer {destination; ticket_hash; qty}); + ] + + let non_tz4_public_key_hash_encoding = + let open Data_encoding in + conv_with_guard + (fun pkh -> pkh) + (fun (pkh : Signature.public_key_hash) -> + match pkh with + | (Ed25519 _ | Secp256k1 _ | P256 _) as pkh -> Ok pkh + | Bls _ -> + Error + "Withdraw to tz4 address is not supported in the deprecated \ + encoding.") + Signature.Public_key_hash.encoding + + (** JSON encoding for [operation_content] which allows to represent + withdrawals to tz4 accounts. The [deprecated_] variants are kept for + backward compatibility purpose. *) + let json_operation_content = + let open Data_encoding in + let withdraw_deprecated destination = + obj3 + (req "destination" destination) + (req "ticket_hash" Alpha_context.Ticket_hash.encoding) + (req "qty" (Compact.make ~tag_size Tx_rollup_l2_qty.compact_encoding)) + in + let withdraw = + merge_objs + (obj1 (req "direction" (constant "withdraw"))) + (withdraw_deprecated Signature.Public_key_hash.encoding) + in + let transfer_deprecated = + obj3 + (req "destination" (Indexable.encoding Tx_rollup_l2_address.encoding)) + (req "ticket_hash" (Compact.make ~tag_size Ticket_indexable.compact)) + (req "qty" (Compact.make ~tag_size Tx_rollup_l2_qty.compact_encoding)) + in + let transfer = + merge_objs + (obj1 (req "direction" (constant "transfer"))) + transfer_deprecated + in + matching + (function + | Withdraw {destination; ticket_hash; qty} -> + matched 0 withdraw ((), (destination, ticket_hash, qty)) + | Transfer {destination; ticket_hash; qty} -> + matched 1 transfer ((), (destination, ticket_hash, qty))) + [ + case + Json_only + ~title:"withdraw" + withdraw + (function + | Withdraw {destination; ticket_hash; qty} -> + Some ((), (destination, ticket_hash, qty)) + | _ -> None) + (fun ((), (destination, ticket_hash, qty)) -> + Withdraw {destination; ticket_hash; qty}); + case + Json_only + ~title:"transfer" + transfer + (function + | Transfer {destination; ticket_hash; qty} -> + Some ((), (destination, ticket_hash, qty)) + | _ -> None) + (fun ((), (destination, ticket_hash, qty)) -> + Transfer {destination; ticket_hash; qty}); + case + Json_only + ~title:"deprecated_withdraw" + (withdraw_deprecated non_tz4_public_key_hash_encoding) + (function + | Withdraw {destination; ticket_hash; qty} -> + Some (destination, ticket_hash, qty) + | _ -> None) + (fun (destination, ticket_hash, qty) -> + Withdraw {destination; ticket_hash; qty}); + case + Json_only + ~title:"deprecated_transfer" + transfer_deprecated + (function + | Transfer {destination; ticket_hash; qty} -> + Some (destination, ticket_hash, qty) + | _ -> None) + (fun (destination, ticket_hash, qty) -> + Transfer {destination; ticket_hash; qty}); + ] + + let compact_operation_content = + (* This is equivalent to Data_encoding.Compact.splitted *) + Data_encoding.Compact.conv + ~json:json_operation_content + (fun x -> x) + (fun x -> x) + compact_binary_operation_content + + let operation_content_encoding = + Data_encoding.Compact.make ~tag_size compact_operation_content + + let compact_operation encoding_signer = + Data_encoding.Compact.( + conv + (fun {signer; counter; contents} -> (signer, counter, contents)) + (fun (signer, counter, contents) -> {signer; counter; contents}) + @@ obj3 + (req "signer" encoding_signer) + (req "counter" int64) + (req "contents" @@ list ~bits:4 operation_content_encoding)) + + let operation_encoding encoding_signer = + Data_encoding.Compact.(make ~tag_size (compact_operation encoding_signer)) + + let compact_transaction encoding_signer = + Data_encoding.Compact.list ~bits:8 (operation_encoding encoding_signer) + + let transaction_encoding : + 'a -> ('b, Indexable.unknown) transaction Data_encoding.t = + fun encoding_signer -> + Data_encoding.Compact.(make ~tag_size (compact_transaction encoding_signer)) + + let compact_signer_index = + Data_encoding.Compact.(conv Indexable.to_int32 Indexable.index_exn int32) + + let compact_signer_either = Signer_indexable.compact + + let compact_operation = compact_operation compact_signer_either + + let compact_transaction_signer_index = + compact_transaction compact_signer_index + + let compact_transaction = compact_transaction compact_signer_either + + let transaction_encoding = transaction_encoding compact_signer_either + + let compact ~bits : + (Indexable.unknown, Indexable.unknown) t Data_encoding.Compact.t = + Data_encoding.Compact.( + conv + (fun {aggregated_signature; contents} -> + (aggregated_signature, contents)) + (fun (aggregated_signature, contents) -> + {aggregated_signature; contents}) + @@ obj2 + (req "aggregated_signature" @@ payload Bls.encoding) + (req "contents" @@ list ~bits transaction_encoding)) +end + +type ('signer, 'content) t = V1 of ('signer, 'content) V1.t + +(** We use two bits for the versioning of the layer-2 batches, which + leaves six bits in the shared tag of compact encoding. We use + these six bits to efficiently encode small lists. + + To ensure backward compatibility, the value of the label + [tag_bits] cannot be modified. To have more than 3 versions of the + encoding, one would have to use the fourth case to wrap a new + union. + +{[ + union + ~tag_bits:2 + ~inner_bits:6 + [ + case "V1" ...; + case "V2" ...; + case "V3" ...; + case "V_next" ... + (union [ case "V4" ... ; ... ]); + ] +]} *) +let compact = + Data_encoding.Compact.( + union + ~union_tag_bits:2 + ~cases_tag_bits:6 + [ + case + ~title:"V1" + (V1.compact ~bits:6) + (function V1 x -> Some x) + (fun x -> V1 x); + ]) + +(** An encoding for [t] that uses a specialized, space-efficient encoding + for the list of transactions. *) +let encoding : (Indexable.unknown, Indexable.unknown) t Data_encoding.t = + Data_encoding.Compact.make ~tag_size compact diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.mli new file mode 100644 index 000000000000..de97740fb5c9 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_batch.mli @@ -0,0 +1,256 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_l2_context_sig + +(** This module introduces the batches of transactions that the + layer-2 (1) reads from its inboxes (see + {!Tx_rollup_message_repr.Batch}), and (2) interprets off-chain. + + One of the main concerns of the transaction rollups is to provide + a high-throughput to its participants. That is, transaction + rollups are expected to be able to process a significant number of + operations “per second.” + + Putting aside the computational power required by the rollup node, + the main limit to the throughput of a transaction rollup is the + number of operations that can fit in a Tezos block. As such, the + number of bytes that are necessary to store the batches is of key + importance. + + To estimate the theoretical maximum throughput of the transaction + rollups as a feature, we can use the following methodology: + + {ul {li Determine the number of bytes that can be allocated to + layer-2 batches in a Tezos block, under the hypothesis + that only layer-2 batch submissions and the + consensus-related operations are included in said + block. Ideally, this needs to take into account the + limitation of the size of a layer-2 batch imposed by the + layer-1 protocol, and the size of the signature that comes + with an individual batch.} + {li Divide this number by the average size of a layer-2 + operation, this gives an estimate of the maximum layer-2 + operations per block.} + {li Divide again the result by the average time (in seconds) + between two Tezos blocks; the result is the theoretical + maximum number of operations per second the transaction + rollups allow to process.}} + + That is, there is three parameters that decide the throughput of + transaction rollups, and the average size of an operation is the + only one under the control of the layer-2 implementation. + Henceforth, both the definitions of types of this module and the + implementation of their encodings have been carefully crafted in + order to allow for compact batches. *) + +(** Represents the [signer] of an layer-2 operation. This is either a + BLS public key or a layer-2 address index, whose metadata in turn + contains a corresponding BLS public. key *) +type signer = + | Bls_pk of Bls.Public_key.t (** A signer identified by a BLS public key. *) + | L2_addr of Tx_rollup_l2_address.t + (** A signer identified by a layer-2 address. Each such adress + is in turn identified with a BLS public key. *) + +module Signer_indexable : sig + type nonrec 'state t = ('state, signer) Indexable.t + + type nonrec index = signer Indexable.index + + type nonrec value = signer Indexable.value + + type either = signer Indexable.either + + val encoding : either Data_encoding.t + + val compare : either -> either -> int + + val pp : Format.formatter -> either -> unit +end + +(** {1 Layer-2 Batches Definitions} *) + +(** The operations are versioned, to let the possibility to propose + new features in future iterations of the protocol. *) + +module V1 : sig + type 'status operation_content = + | Withdraw of { + destination : Signature.Public_key_hash.t; + ticket_hash : Alpha_context.Ticket_hash.t; + qty : Tx_rollup_l2_qty.t; + } + (** A [Withdraw] removes [qty] of the tickets represented by + [ticket_hash] from the operation's signer in layer-2, and + permits [destination] to retrieve those tickets in layer-1 + through a [Tx_rollup_withdraw] operation. *) + | Transfer of { + destination : 'status Tx_rollup_l2_address.Indexable.t; + ticket_hash : 'status Ticket_indexable.t; + qty : Tx_rollup_l2_qty.t; + } + (** A [Transfer] moves [qty] of the tickets represented by + [ticket_hash] from the operation's signer in layer-2 to + [destination] in layer-2. *) + + type ('signer, 'content) operation = { + signer : 'signer Signer_indexable.t; + counter : int64; + contents : 'content operation_content list; + } + + type ('signer, 'content) transaction = ('signer, 'content) operation list + + type signature = Bls.t + + type ('signer, 'content) t = { + contents : ('signer, 'content) transaction list; + aggregated_signature : signature; + } + + (** [compact ~bits] is a specialized, space-efficient encoding for a + batch of layer-2 operations, such as the [bits] first bits of + the first byte of the resulting binary array are used to encode + small lists of transactions. *) + val compact : + bits:int -> (Indexable.unknown, Indexable.unknown) t Data_encoding.Compact.t + + (** A specialized, space-efficient encoding for [transaction]. + + The first byte of the resulting binary array is used to encode + the size of lists of less than 254 elements. For larger lists, + the tag is [11111111] and the list is prefixed by its size, + which consumes eight bytes. *) + val compact_transaction : + (Indexable.unknown, Indexable.unknown) transaction Data_encoding.Compact.t + + (** A specialized {!compact_transaction} where the signers are indexes only. *) + val compact_transaction_signer_index : + (Indexable.index_only, Indexable.unknown) transaction + Data_encoding.Compact.t + + (** The encoding of reference used to sign a transaction. It is + derived from {!compact_transaction}. *) + val transaction_encoding : + (Indexable.unknown, Indexable.unknown) transaction Data_encoding.t + + (** A specialized, space-efficient encoding for [operation]. + + The first byte of the binary output describes precisely the layout + of the encoded value. + + Considering the tag [ooooccss], [ss] describes the format of + [signer], [cc] of [counter] and [oooo] of [contents]. + + More precisely, for [signer], + + {ul {li [00] means an index fitting on 1 byte.} + {li [01] means an index fitting on 2 bytes.} + {li [10] means an index fitting on 4 bytes.} + {li [11] means a value of type {!Bls.Public_key.t}.}} + + The [counter] field follows a similar logic, + + {ul {li [00] means an index fitting on 1 byte.} + {li [01] means an index fitting on 2 bytes.} + {li [10] means an index fitting on 4 bytes.} + {li [11] means an integer fitting on 8 bytes.} + } + + Finally, the [contents] field follows this pattern + + {ul {li From [0000] to [1110], the tag encodes the size of the + list of [operation_content], {i e.g.}, [0010] means that + there is two elements in [contents].} + {li [1111] means that [contents] is prefixed by its number + of elements.} + } *) + val compact_operation : + (Indexable.unknown, Indexable.unknown) operation Data_encoding.Compact.t + + (** A specialized, space-efficient encoding for [operation_content]. + + The first byte of the binary output describes precisely the layout + of the encoded value. + + Considering the tag [0qqttddd], [ddd] describes the format of + [destination], [tt] of [ticket_hash] and [qq] of [qty]. More + precisely, for [destination], + + {ul {li [000] means a layer-1 address.} + {li [100] means an index for a layer-2 address, fitting on 1 byte.} + {li [101] means an index for a layer-2 address, fitting on 2 bytes.} + {li [110] means an index for a layer-2 address, fitting on 4 bytes.} + {li [111] means a value (of type {!Tx_rollup_l2_address.t}, + that is a layer-2 address.} + } + + The [ticket_hash] is encoded using this logic: + + {ul {li [00] means an index for a ticket hash, fitting on 1 byte.} + {li [01] means an index for a ticket hash, fitting on 2 bytes.} + {li [10] means an index for a ticket hash, fitting on 4 bytes.} + {li [11] means a value (of type {!Ticket_hash.t}.} + } + + The [qty] field follows a similar logic, + + {ul {li [00] means an integer fitting on 1 byte.} + {li [01] means an integer fitting on 2 bytes.} + {li [10] means an integer fitting on 4 bytes.} + {li [11] means an integer fitting on 8 bytes.} + } + + If used to read, respectively write, a value where the + the [destination] is a layer-1 address and the ticket_hash is an + index, which is not allowed by the layer-2 protocol, then a + + - [Data_encoding.Binary.Read_error (Exception_raised_in_user_function ...)], + + respectively + + - [Data_encoding.Binary.Write_error (Exception_raised_in_user_function ...)] + + exception is raised. + *) + val compact_operation_content : + Indexable.unknown operation_content Data_encoding.Compact.t +end + +(** {1 Versioning} *) + +(** To pave the road towards being able to update the semantics of the + transaction rollups without having to interfere with the rejection + mechanism, we preemptively back the notion of semantics versioning + into the definition of a layer-2 batch. *) + +type ('signer, 'content) t = V1 of ('signer, 'content) V1.t + +(** An encoding for [t] that uses a specialized, space-efficient encoding + for the list of transactions. *) +val encoding : (Indexable.unknown, Indexable.unknown) t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context.ml new file mode 100644 index 000000000000..5173ce5c768b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context.ml @@ -0,0 +1,374 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_l2_storage_sig +open Tx_rollup_l2_context_sig + +let metadata_encoding = + Data_encoding.( + conv + (fun {counter; public_key} -> (counter, public_key)) + (fun (counter, public_key) -> {counter; public_key}) + (obj2 (req "counter" int64) (req "public_key" Bls.Public_key.encoding))) + +(** {1 Type-Safe Storage Access and Gas Accounting} *) + +(** A value of type ['a key] identifies a value of type ['a] in an + underlying, untyped storage. + + This GADT is used to enforce type-safety of the abstraction of + the transactions rollup context. For this abstraction to work, + it is necessary to ensure that the serialization of values ['a + key] and ['b key] cannot collide. To that end, we use + [Data_encoding] (see {!packed_key_encoding}). *) +type _ key = + | Address_metadata : address_index -> metadata key + | Address_count : int32 key + | Address_index : Tx_rollup_l2_address.t -> address_index key + | Ticket_count : int32 key + | Ticket_index : Alpha_context.Ticket_hash.t -> ticket_index key + | Ticket_ledger : ticket_index * address_index -> Tx_rollup_l2_qty.t key + +(** A monomorphic version of {!Key}, used for serialization purposes. *) +type packed_key = Key : 'a key -> packed_key + +(** The encoding used to serialize keys to be used with an untyped storage. *) +let packed_key_encoding : packed_key Data_encoding.t = + Data_encoding.( + union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Address_metadata" + Tx_rollup_l2_address.Indexable.index_encoding + (function Key (Address_metadata idx) -> Some idx | _ -> None) + (fun idx -> Key (Address_metadata idx)); + case + (Tag 1) + ~title:"Address_count" + empty + (function Key Address_count -> Some () | _ -> None) + (fun () -> Key Address_count); + case + (Tag 2) + ~title:"Address_index" + Tx_rollup_l2_address.encoding + (function Key (Address_index addr) -> Some addr | _ -> None) + (fun addr -> Key (Address_index addr)); + case + (Tag 3) + ~title:"Ticket_count" + empty + (function Key Ticket_count -> Some () | _ -> None) + (fun () -> Key Ticket_count); + case + (Tag 4) + ~title:"Ticket_index" + Alpha_context.Ticket_hash.encoding + (function Key (Ticket_index ticket) -> Some ticket | _ -> None) + (fun ticket -> Key (Ticket_index ticket)); + case + (Tag 5) + ~title:"Ticket_ledger" + (tup2 + Ticket_indexable.index_encoding + Tx_rollup_l2_address.Indexable.index_encoding) + (function + | Key (Ticket_ledger (ticket, address)) -> Some (ticket, address) + | _ -> None) + (fun (ticket, address) -> Key (Ticket_ledger (ticket, address))); + ]) + +(** [value_encoding key] returns the encoding to be used to serialize + and deserialize values associated to a [key] from and to the + underlying storage. *) +let value_encoding : type a. a key -> a Data_encoding.t = + let open Data_encoding in + function + | Address_metadata _ -> metadata_encoding + | Address_count -> int32 + | Address_index _ -> Tx_rollup_l2_address.Indexable.index_encoding + | Ticket_count -> int32 + | Ticket_index _ -> Ticket_indexable.index_encoding + | Ticket_ledger _ -> Tx_rollup_l2_qty.encoding + +(** {1 Errors} *) + +type error += Key_cannot_be_serialized + +type error += Value_cannot_be_serialized + +type error += Value_cannot_be_deserialized + +let () = + let open Data_encoding in + (* Key cannot be serialized *) + register_error_kind + `Permanent + ~id:"tx_rollup_key_cannot_be_serialized" + ~title:"Key cannot be serialized" + ~description:"Tried to serialize an invalid key." + empty + (function Key_cannot_be_serialized -> Some () | _ -> None) + (fun () -> Key_cannot_be_serialized) ; + (* Value cannot be serialized *) + register_error_kind + `Permanent + ~id:"tx_rollup_value_cannot_be_serialized" + ~title:"Value cannot be serialized" + ~description:"Tried to serialize an invalid value." + empty + (function Value_cannot_be_serialized -> Some () | _ -> None) + (fun () -> Value_cannot_be_serialized) ; + (* Value cannot be deserialized *) + register_error_kind + `Permanent + ~id:"tx_rollup_value_cannot_be_deserialized" + ~title:"Value cannot be deserialized" + ~description: + "A value has been serialized in the Tx_rollup store, but cannot be \ + deserialized." + empty + (function Value_cannot_be_deserialized -> Some () | _ -> None) + (fun () -> Value_cannot_be_deserialized) + +(** {1 The Context Functor} *) + +module Make (S : STORAGE) : CONTEXT with type t = S.t and type 'a m = 'a S.m = +struct + type t = S.t + + type 'a m = 'a S.m + + module Syntax = struct + include S.Syntax + + let ( let*? ) res f = + match res with Result.Ok v -> f v | Result.Error error -> fail error + + let fail_unless cond error = + let open S.Syntax in + if cond then return () else fail error + + let fail_when cond error = + let open S.Syntax in + if cond then fail error else return () + end + + let bls_verify : (Bls.Public_key.t * bytes) list -> signature -> bool m = + fun accounts aggregated_signature -> + let open Syntax in + let msgs = List.map (fun (pk, msg) -> (pk, None, msg)) accounts in + return (Bls.aggregate_check msgs aggregated_signature) + + let unwrap_or : type a. a option -> error -> a S.m = + fun opt err -> + match opt with Some x -> S.Syntax.return x | None -> S.Syntax.fail err + + let serialize_key : type a. a key -> bytes m = + fun key -> + unwrap_or + (Data_encoding.Binary.to_bytes_opt packed_key_encoding (Key key)) + Key_cannot_be_serialized + + let serialize_value : type a. a Data_encoding.t -> a -> bytes m = + fun encoding value -> + unwrap_or + (Data_encoding.Binary.to_bytes_opt encoding value) + Value_cannot_be_serialized + + let deserialize_value : type a. a Data_encoding.t -> bytes -> a m = + fun encoding value -> + unwrap_or + (Data_encoding.Binary.of_bytes_opt encoding value) + Value_cannot_be_deserialized + + (** [get ctxt key] is a type-safe [get] function. *) + let get : type a. t -> a key -> a option m = + fun ctxt key -> + let open Syntax in + let value_encoding = value_encoding key in + let* key = serialize_key key in + let* value = S.get ctxt key in + match value with + | Some value -> + let* value = deserialize_value value_encoding value in + return (Some value) + | None -> return None + + (** [set ctxt key value] is a type-safe [set] function. *) + let set : type a. t -> a key -> a -> t m = + fun ctxt key value -> + let open Syntax in + let value_encoding = value_encoding key in + let* key = serialize_key key in + let* value = serialize_value value_encoding value in + S.set ctxt key value + + let remove : type a. t -> a key -> t m = + fun ctxt key -> + let open Syntax in + let* key = serialize_key key in + S.remove ctxt key + + module Address_metadata = struct + let get ctxt idx = get ctxt (Address_metadata idx) + + let incr_counter ctxt idx = + let open Syntax in + let* metadata = get ctxt idx in + match metadata with + | Some meta -> + let new_counter = Int64.succ meta.counter in + let* () = + fail_unless + Compare.Int64.(new_counter >= meta.counter) + Counter_overflow + in + set ctxt (Address_metadata idx) {meta with counter = new_counter} + | None -> fail (Unknown_address_index idx) + + let init_with_public_key ctxt idx public_key = + let open Syntax in + let* metadata = get ctxt idx in + match metadata with + | None -> set ctxt (Address_metadata idx) {counter = 0L; public_key} + | Some _ -> fail (Metadata_already_initialized idx) + + module Internal_for_tests = struct + let set ctxt idx metadata = set ctxt (Address_metadata idx) metadata + end + end + + module Address_index = struct + let count ctxt = + let open Syntax in + let+ count = get ctxt Address_count in + Option.value ~default:0l count + + let init_counter ctxt = set ctxt Address_count 0l + + let associate_index ctxt addr = + let open Syntax in + let* i = count ctxt in + let new_count = Int32.succ i in + let* () = + fail_unless Compare.Int32.(new_count >= i) Too_many_l2_addresses + in + (* This can not fail as by construction [count ctxt] is always positive. *) + let idx = Indexable.index_exn i in + let* ctxt = set ctxt (Address_index addr) idx in + let+ ctxt = set ctxt Address_count new_count in + (ctxt, idx) + + let get ctxt addr = get ctxt (Address_index addr) + + let get_or_associate_index ctxt addr = + let open Syntax in + let* index_opt = get ctxt addr in + match index_opt with + | Some idx -> return (ctxt, `Existed, idx) + | None -> + let+ ctxt, idx = associate_index ctxt addr in + (ctxt, `Created, idx) + + module Internal_for_tests = struct + let set_count ctxt count = set ctxt Address_count count + end + end + + module Ticket_index = struct + let count ctxt = + let open Syntax in + let+ count = get ctxt Ticket_count in + Option.value ~default:0l count + + let init_counter ctxt = set ctxt Ticket_count 0l + + let associate_index ctxt ticket = + let open Syntax in + let* i = count ctxt in + let new_count = Int32.succ i in + let* () = + fail_unless Compare.Int32.(new_count >= i) Too_many_l2_tickets + in + (* This can not fail as by construction [count ctxt] is always positive. *) + let idx = Indexable.index_exn i in + let* ctxt = set ctxt (Ticket_index ticket) idx in + let+ ctxt = set ctxt Ticket_count new_count in + (ctxt, idx) + + let get ctxt ticket = get ctxt (Ticket_index ticket) + + let get_or_associate_index ctxt ticket = + let open Syntax in + let* index_opt = get ctxt ticket in + match index_opt with + | Some idx -> return (ctxt, `Existed, idx) + | None -> + let+ ctxt, idx = associate_index ctxt ticket in + (ctxt, `Created, idx) + + module Internal_for_tests = struct + let set_count ctxt count = set ctxt Ticket_count count + end + end + + module Ticket_ledger = struct + let get_opt ctxt tidx aidx = get ctxt (Ticket_ledger (tidx, aidx)) + + let get ctxt tidx aidx = + let open Syntax in + let+ res = get_opt ctxt tidx aidx in + Option.value ~default:Tx_rollup_l2_qty.zero res + + let set ctxt tidx aidx = set ctxt (Ticket_ledger (tidx, aidx)) + + let remove ctxt tidx aidx = remove ctxt (Ticket_ledger (tidx, aidx)) + + let spend ctxt tidx aidx qty = + let open Syntax in + let* src_balance = get ctxt tidx aidx in + match Tx_rollup_l2_qty.sub src_balance qty with + | None -> fail Balance_too_low + | Some remainder when Tx_rollup_l2_qty.(remainder > zero) -> + set ctxt tidx aidx remainder + | Some _ -> remove ctxt tidx aidx + + let credit ctxt tidx aidx qty = + let open Syntax in + let* balance = get ctxt tidx aidx in + match Tx_rollup_l2_qty.add balance qty with + | None -> fail Balance_overflow + | Some new_balance -> set ctxt tidx aidx new_balance + + module Internal_for_tests = struct + let get_opt = get_opt + end + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.ml new file mode 100644 index 000000000000..7130ee021d0d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.ml @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include + Blake2B.Make + (Base58) + (struct + let name = "tx_rollup_context_hash" + + let title = "Hash of a transaction rollup context" + + let b58check_prefix = "\017\143\019" (* CTx(53) *) + + let size = Some 32 + end) + +let () = Base58.check_encoded_prefix b58check_encoding "CTx" 53 diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.mli new file mode 100644 index 000000000000..a3077bb4d3e1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_hash.mli @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A specialized Blake2B implementation for hashing tx_rollup contexts. *) + +include S.HASH diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_sig.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_sig.ml new file mode 100644 index 000000000000..26de4e453ae0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_context_sig.ml @@ -0,0 +1,374 @@ +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type signature = Bls.t + +module Ticket_indexable = Indexable.Make (Alpha_context.Ticket_hash) + +(** An integer used to identified a layer-2 address. See + {!Tx_rollup_l2_address.index}. *) +type address_index = Tx_rollup_l2_address.Indexable.index + +(** An integer used to identified a layer-1 ticket deposited in a + transaction rollup. *) +type ticket_index = Ticket_indexable.index + +(** The metadata associated to a layer-2 address. + + The counter is an counter-measure against replay attack. Each + operation is signed with an integer (its counter). The counter + is incremented when the operation is applied. This prevents the + operation to be applied once again, since its integer will not + be in sync with the counter of the account. The choice of [int64] + for the type of the counter theoretically prevents the rollup to + an integer overflow. However, it can only happen if a single account + makes more than [1.8446744e+19] operations. If an account sends 1000 + operations per seconds, it would take them more than 5845420 + centuries to achieve that. + + The [public_key] allows to authenticate the owner of the address, + by verifying BLS signatures. *) +type metadata = {counter : int64; public_key : Bls.Public_key.t} + +type error += + | Balance_too_low + | Balance_overflow + | Invalid_quantity + | Unknown_address_index of address_index + | Metadata_already_initialized of address_index + | Too_many_l2_addresses + | Too_many_l2_tickets + | Counter_overflow + +let () = + let open Data_encoding in + (* Unknown address index *) + register_error_kind + `Temporary + ~id:"tx_rollup_unknown_address_index" + ~title:"Unknown address index" + ~description:"Tried to increment the counter of an unknown address index" + (obj1 (req "index" Tx_rollup_l2_address.Indexable.index_encoding)) + (function Unknown_address_index x -> Some x | _ -> None) + (fun x -> Unknown_address_index x) ; + (* Balance too low *) + register_error_kind + `Temporary + ~id:"tx_rollup_balance_too_low" + ~title:"Balance too low" + ~description: + "Tried to spend a ticket index from an index without the required balance" + empty + (function Balance_too_low -> Some () | _ -> None) + (fun () -> Balance_too_low) ; + (* Balance overflow *) + register_error_kind + `Temporary + ~id:"tx_rollup_balance_overflow" + ~title:"Balance overflow" + ~description: + "Tried to credit a ticket index to an index to a new balance greater \ + than the integer 32 limit" + empty + (function Balance_overflow -> Some () | _ -> None) + (fun () -> Balance_overflow) ; + (* Invalid_quantity *) + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_quantity" + ~title:"Invalid quantity" + ~description: + "Tried to credit a ticket index to an index with a quantity non-strictly \ + positive" + empty + (function Invalid_quantity -> Some () | _ -> None) + (fun () -> Invalid_quantity) ; + (* Metadata already initialized *) + register_error_kind + `Branch + ~id:"tx_rollup_metadata_already_initialized" + ~title:"Metadata already initiliazed" + ~description: + "Tried to initialize a metadata for an index which was already \ + initiliazed" + (obj1 (req "index" Tx_rollup_l2_address.Indexable.index_encoding)) + (function Metadata_already_initialized x -> Some x | _ -> None) + (fun x -> Metadata_already_initialized x) ; + (* Too many l2 addresses associated *) + register_error_kind + `Branch + ~id:"tx_rollup_too_many_l2_addresses" + ~title:"Too many l2 addresses" + ~description:"The number of l2 addresses has reached the integer 32 limit" + empty + (function Too_many_l2_addresses -> Some () | _ -> None) + (fun () -> Too_many_l2_addresses) ; + (* Too many l2 tickets associated *) + register_error_kind + `Branch + ~id:"tx_rollup_too_many_l2_tickets" + ~title:"Too many l2 tickets" + ~description:"The number of l2 tickets has reached the integer 32 limit" + empty + (function Too_many_l2_tickets -> Some () | _ -> None) + (fun () -> Too_many_l2_tickets) ; + (* Counter overflow *) + register_error_kind + `Branch + ~id:"tx_rollup_counter_overflow" + ~title:"Counter overflow" + ~description: + "Tried to increment the counter of an address and reached the integer 64 \ + limit" + empty + (function Counter_overflow -> Some () | _ -> None) + (fun () -> Counter_overflow) + +(** This module type describes the API of the [Tx_rollup] context, + which is used to implement the semantics of the L2 operations. *) +module type CONTEXT = sig + (** The state of the [Tx_rollup] context. + + The context provides a type-safe, functional API to interact + with the state of a transaction rollup. The functions of this + module, manipulating and creating values of type [t] are called + “context operations” afterwards. *) + type t + + (** The monad used by the context. + + {b Note:} It is likely to be the monad of the underlying + storage. In the case of the proof verifier, as it is expected to + be run into the L1, the monad will also be used to perform gas + accounting. This is why all the functions of this module type + needs to be inside the monad [m]. *) + type 'a m + + (** The necessary monadic operators the storage monad is required to + provide. *) + module Syntax : sig + val ( let+ ) : 'a m -> ('a -> 'b) -> 'b m + + val ( let* ) : 'a m -> ('a -> 'b m) -> 'b m + + (** [let*?] is for binding the value from Result-only + expressions into the storage monad. *) + val ( let*? ) : ('a, error) result -> ('a -> 'b m) -> 'b m + + (** [fail err] shortcuts the current computation by raising an + error. + + Said error can be handled with the [catch] combinator. *) + val fail : error -> 'a m + + (** [catch p k h] tries to executes the monadic computation [p]. + If [p] terminates without an error, then its result is passed + to the continuation [k]. On the contrary, if an error [err] is + raised, it is passed to the error handler [h]. *) + val catch : 'a m -> ('a -> 'b m) -> (error -> 'b m) -> 'b m + + (** [return x] is the simplest computation inside the monad [m] which simply + computes [x] and nothing else. *) + val return : 'a -> 'a m + + (** [list_fold_left_m f] is a monadic version of [List.fold_left + f], wherein [f] is not a pure computation, but a computation + in the monad [m]. *) + val list_fold_left_m : ('a -> 'b -> 'a m) -> 'a -> 'b list -> 'a m + + (** [fail_unless cond err] raises [err] iff [cond] is [false]. *) + val fail_unless : bool -> error -> unit m + + (** [fail_when cond err] raises [err] iff [cond] is [true]. *) + val fail_when : bool -> error -> unit m + end + + (** [bls_aggregate_verify] allows to verify the aggregated signature + of a batch. *) + val bls_verify : (Bls.Public_key.t * bytes) list -> signature -> bool m + + (** The metadata associated to an address. *) + module Address_metadata : sig + (** [get ctxt idx] returns the current metadata associated to the + address indexed by [idx]. *) + val get : t -> address_index -> metadata option m + + (** [incr_counter ctxt idx] increments the counter of the + address indexed by [idx]. + + This function can fail with [Counter_overflow] iff the counter + has reached the [Int64.max_int] limit. + + This function can fail with [Unknown_address_index] if [idx] + has not been associated with a layer-2 address already. *) + val incr_counter : t -> address_index -> t m + + (** [init_with_public_key ctxt idx pk] initializes the metadata + associated to the address indexed by [idx]. + + This can fails with [Metadata_already_initialized] if this + function has already been called with [idx]. *) + val init_with_public_key : t -> address_index -> Bls.Public_key.t -> t m + + (**/**) + + module Internal_for_tests : sig + val set : t -> address_index -> metadata -> t m + end + end + + (** Mapping between {!Tx_rollup_l2_address.address} and {!address_index}. + + Addresses are supposed to be associated to a {!address_index} in + order to reduce the batches' size submitted from the layer1 to the + layer2. Therefore, the first time an address is used in a layer2 + operation, we associate it to a address_index that should be use + in future layer2 operations. + *) + module Address_index : sig + (** [init_counter ctxt] writes the default counter (i.e. [0L]) in + the context. *) + val init_counter : t -> t m + + (** [get ctxt addr] returns the index associated to [addr], if + any. *) + val get : t -> Tx_rollup_l2_address.t -> address_index option m + + (** [get_or_associate_index ctxt addr] associates a fresh [address_index] + to [addr], and returns it. If the [addr] has already been associated to + an index, it returns it. + It also returns the information on whether the index was created or + already existed. + + This function can fail with [Too_many_l2_addresses] iff there + is no fresh index available. *) + val get_or_associate_index : + t -> + Tx_rollup_l2_address.t -> + (t * [`Created | `Existed] * address_index) m + + (** [count ctxt] returns the number of addresses that have been + involved in the transaction rollup. *) + val count : t -> int32 m + + (**/**) + + module Internal_for_tests : sig + (** [set ctxt count] sets the [count] in [ctxt]. It is used to test + the behavior of [Too_many_l2_addresses]. *) + val set_count : t -> int32 -> t m + end + end + + (** Mapping between {!Ticket_hash.t} and {!ticket_index}. + + Ticket hashes are supposed to be associated to a {!ticket_index} in + order to reduce the batches' size submitted from the layer1 to the + layer2. Therefore, the first time a ticket hash is used in a layer2 + operation, we associate it to a ticket_index that should be use + in future layer2 operations. + *) + module Ticket_index : sig + (** [init_counter ctxt] writes the default counter (i.e. [0L]) in + the context. *) + val init_counter : t -> t m + + (** [get ctxt ticket] returns the index associated to [ticket], if + any. *) + val get : t -> Alpha_context.Ticket_hash.t -> ticket_index option m + + (** [get_or_associate_index ctxt ticket] associates a fresh [ticket_index] + to [ticket], and returns it. If the [ticket] has already been associated + to an index, it returns it. + It also returns the information on whether the index was created or + already existed. + + This function can fail with [Too_many_l2_tickets] iff there + is no fresh index available. *) + val get_or_associate_index : + t -> + Alpha_context.Ticket_hash.t -> + (t * [`Created | `Existed] * ticket_index) m + + (** [count ctxt] returns the number of tickets that have been + involved in the transaction rollup. *) + val count : t -> int32 m + + (**/**) + + module Internal_for_tests : sig + (** [set_count ctxt count] sets the [count] in [ctxt]. It is used to test + the behavior of [Too_many_l2_addresses]. *) + val set_count : t -> int32 -> t m + end + end + + (** The ledger of the layer 2 where are registered the amount of a + given ticket a L2 [account] has in its possession. *) + module Ticket_ledger : sig + (** [get ctxt tidx aidx] returns the quantity of tickets ([tidx]) [aidx] + owns. + + {b Note:} It is the responsibility of the caller to verify that [aidx] + and [tidx] have been associated to an address and + a ticket respectively. The function will return zero when the address + has no such ticket. *) + val get : t -> ticket_index -> address_index -> Tx_rollup_l2_qty.t m + + (** [credit ctxt tidx aidx qty] updates the ledger to + increase the number of tickets indexed by [tidx] the address + [aidx] owns by [qty] units. + + This function can fail with [Balance_overflow] if adding + [qty] to the current balance of [aidx] causes an integer + overflow. + + This function can fail with [Invalid_quantity] if [qty] + is not strictly positive. + + {b Note:} It is the responsibility of the caller to verify that [aidx] + and [tidx] have been associated to an address and + a ticket respectively. *) + val credit : t -> ticket_index -> address_index -> Tx_rollup_l2_qty.t -> t m + + (** [spend ctxt tidx aidx qty] updates the ledger to + decrease the number of tickets indexed by [tidx] the address + [aidx] owns by [qty] units. + + This function can fail with [Balance_too_low] if [aidx] + does not own at least [qty] ticket. + + {b Note:} It is the responsibility of the caller to verify + that [aidx] and [tidx] have been associated to an address and + a ticket respectively. *) + val spend : t -> ticket_index -> address_index -> Tx_rollup_l2_qty.t -> t m + + module Internal_for_tests : sig + val get_opt : + t -> ticket_index -> address_index -> Tx_rollup_l2_qty.t option m + end + end +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.ml new file mode 100644 index 000000000000..12d54391045b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.ml @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Context.Proof.stream Context.Proof.t + +let encoding = Context.Proof_encoding.V2.Tree2.stream_proof_encoding + +type serialized = string + +let length = String.length + +let serialized_encoding = Data_encoding.(string Hex) + +let proof_of_serialized_opt = Data_encoding.Binary.of_string_opt encoding + +let serialize_proof_exn = Data_encoding.Binary.to_string_exn encoding + +module Internal_for_tests = struct + let of_bytes = Bytes.to_string +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.mli new file mode 100644 index 000000000000..1e2a9245c045 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_proof.mli @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* The type of a Merkle proof for a L2 message *) +type t = Context.Proof.stream Context.Proof.t + +val encoding : t Data_encoding.t + +(** A compact binary representation of the proofs. *) +type serialized = private string + +val length : serialized -> int + +val serialized_encoding : serialized Data_encoding.t + +val proof_of_serialized_opt : serialized -> t option + +val serialize_proof_exn : t -> serialized + +module Internal_for_tests : sig + (** [of_bytes] can be used to generate invalid serialized proofs, + that cannot be turned into valid proofs. *) + val of_bytes : bytes -> serialized +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.ml new file mode 100644 index 000000000000..32d7fc0bdb4c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.ml @@ -0,0 +1,63 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Compare.Int64 + +let zero = 0L + +let one = 1L + +let of_int64 q = if q < 0L then None else Some q + +let of_int64_exn q = + match of_int64 q with + | Some q -> q + | None -> invalid_arg "Tx_rollup_l2_qty.of_int64_exn" + +let to_int64 q = q + +let to_z = Z.of_int64 + +let to_string q = Int64.to_string q + +let of_string q = Option.bind (Int64.of_string_opt q) of_int64 + +let pp fmt q = Format.pp_print_string fmt (to_string q) + +let compact_encoding = Data_encoding.Compact.(conv to_int64 of_int64_exn int64) + +let encoding = Data_encoding.Compact.(make ~tag_size:`Uint8 compact_encoding) + +let sub q1 q2 = if q2 <= q1 then Some (Int64.sub q1 q2) else None + +let add q1 q2 = + let q = Int64.add q1 q2 in + if q < q1 then None else Some q + +let succ q = add q one + +let ( - ) = sub + +let ( + ) = add diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.mli new file mode 100644 index 000000000000..24aeb023b1f6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_qty.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module is an abstraction on top of int64 to build positive (or zero) + quantities within the int64 bounds. It comes with a compact encoding to be + used in the transaction rollup batches. *) + +(** Type of postive quantities. Quantities are bounded by {!Int64.max_int}. *) +type t + +(** The zero quantity. *) +val zero : t + +(** One quantity. *) +val one : t + +(** Build a quantity from an int64. Returns [None] if the argument is negative. *) +val of_int64 : int64 -> t option + +(** Build a quantity from an int64 and raise [Invalid_argument] on negative quantities. *) +val of_int64_exn : int64 -> t + +(** Convert a quantity to [int64]. *) +val to_int64 : t -> int64 + +(** Convert a quantity to [z]. *) +val to_z : t -> Z.t + +(** Returns a string representation of a quantity. *) +val to_string : t -> string + +(** Parse a quantity from a string. Returns [None] if the string is not a valid + quantity representation. *) +val of_string : string -> t option + +(** Pretty-printer for quantities. *) +val pp : Format.formatter -> t -> unit + +(** Compact encoding for quantities *) +val compact_encoding : t Data_encoding.Compact.t + +(** Encoding for quantities *) +val encoding : t Data_encoding.t + +(** Substract two quantities. Returns [None] on subtraction underflow. *) +val sub : t -> t -> t option + +(** Add two quantities. Returns [None] on addition overflow. *) +val add : t -> t -> t option + +(** Return the [t] successor. Returns [None] on overflow. *) +val succ : t -> t option + +(** Quantities substraction. *) +val ( - ) : t -> t -> t option + +(** Quantities addition. *) +val ( + ) : t -> t -> t option + +include Compare.S with type t := t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_storage_sig.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_storage_sig.ml new file mode 100644 index 000000000000..4a81f9cd4180 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_storage_sig.ml @@ -0,0 +1,89 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module type is the minimal API a storage backend has to + implement to be compatible with the [Tx_rollup] layer-2 + implementation. + + In a nutshell, the [Tx_rollup] only needs a simple key-value + store, where both keys and values are raw bytes buffers. We build + a type-safe abstraction on top of this simple (but potentially + unsafe) interface in [Tx_rollup_l2_context]. *) +module type STORAGE = sig + (** The state of the storage. + + The API adopts a functional paradigm, where the [set] function + returns a new state for the storage, and where it should be + possible to reuse a previous state. *) + type t + + (** The monad of the storage backend. *) + type 'a m + + (** The necessary monadic operators the monad of the storage backend + is required to provide. *) + module Syntax : sig + val ( let+ ) : 'a m -> ('a -> 'b) -> 'b m + + val ( let* ) : 'a m -> ('a -> 'b m) -> 'b m + + (** [fail err] shortcuts the current computation by raising an + error. + + Said error can be handled with the [catch] combinator. *) + val fail : error -> 'a m + + (** [catch p k h] tries to executes the monadic computation [p]. + If [p] terminates without an error, then its result is passed + to the continuation [k]. On the contrary, if an error [err] is + raised, it is passed to the error handler [h]. *) + val catch : 'a m -> ('a -> 'b m) -> (error -> 'b m) -> 'b m + + (** [return x] is the simplest computation inside the monad [m] which simply + computes [x] and nothing else. *) + val return : 'a -> 'a m + + (** [list_fold_left_m f] is a monadic version of [List.fold_left + f], wherein [f] is not a pure computation, but a computation + in the monad [m]. *) + val list_fold_left_m : ('a -> 'b -> 'a m) -> 'a -> 'b list -> 'a m + end + + (** [get storage key] returns the value stored in [storage] for + [key], if it exists. Returns [None] if it does not. *) + val get : t -> bytes -> bytes option m + + (** [set storage key] computes a new state for the storage wherein + the value associated to [key] is [value]. + + [storage] is expected to remain usable and consistent even after + the execution of [set]. *) + val set : t -> bytes -> bytes -> t m + + (** [remove storage key] removes [key] from the [storage]. *) + val remove : t -> bytes -> t m +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.ml new file mode 100644 index 000000000000..50270fbe30c5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.ml @@ -0,0 +1,197 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_errors_repr +open Alpha_context + +(* {{Note}} This model should be part of [Tx_rollup_gas]. + Unfortunately, this is not possible, because this module is defined + on top of [Alpha_context], while [Tx_rollup_gas] is defined on top + of [Raw_context]. *) + +let verify_proof_model message_size proof_size = + let open Saturation_repr in + (* The cost of verifiying the proof depends bilinearly on the size + of the message (that is expected to capture the algoritmic + complexity of computation to make) and the size of the proof + (that is expected to capture the overhead of the storage). *) + let proof_size_coeff = safe_int 124 in + let message_size_coeff = safe_int 8_416 in + + let ( * ) = mul in + let ( + ) = add in + + (proof_size_coeff * safe_int proof_size) + + (message_size_coeff * safe_int message_size) + +let consume_verify_proof_cost ctxt ~message_size ~proof_size = + let max_proof_size = + Alpha_context.Constants.tx_rollup_rejection_max_proof_size ctxt + in + (* We are interested in having a safe over-approximation of the + overhead of the proof interpretation. We have trained the model + on data coming from contexts of various “size” (i.e., number of + leafs), but there is an edge case when it comes to proof + verification that is hard to consider correctly: when the context + is empty, the size is ridiculously small, no matter how many + transactions are executed. + + As a safety net, we systematically compute a gas cost as if the + proof is at least the big enough to declare the message as + invalid (using the [tx_rollup_rejection_max_proof_size] + parametric constant). *) + Gas.consume ctxt + @@ verify_proof_model message_size (Compare.Int.max proof_size max_proof_size) + +module Verifier_storage : + Tx_rollup_l2_storage_sig.STORAGE + with type t = Context.tree + and type 'a m = ('a, error) result Lwt.t = struct + type t = Context.tree + + type 'a m = ('a, error) result Lwt.t + + module Syntax = struct + let ( let* ) = ( >>=? ) + + let ( let+ ) = ( >|=? ) + + let return = return + + let fail e = Lwt.return (Error e) + + let catch (m : 'a m) k h = m >>= function Ok x -> k x | Error e -> h e + + let list_fold_left_m = List.fold_left_es + end + + let path k = [Bytes.to_string k] + + let get store key = Context.Tree.find store (path key) >>= return + + let set store key value = Context.Tree.add store (path key) value >>= return + + let remove store key = Context.Tree.remove store (path key) >>= return +end + +module Verifier_context = Tx_rollup_l2_context.Make (Verifier_storage) +module Verifier_apply = Tx_rollup_l2_apply.Make (Verifier_context) + +let hash_message_result ctxt after withdraw = + Tx_rollup_hash.message_result + ctxt + {context_hash = after; withdraw_list_hash = withdraw} + +(** [after_hash_when_proof_failed before] produces the + {!Alpha_context.Tx_rollup_message_result_hash} expected if a proof failed. + That is, the after hash is the same as [before] and it produced zero + withdrawals. *) +let after_hash_when_proof_failed ctxt before = + hash_message_result ctxt before Tx_rollup_withdraw_list_hash.empty + +let verify_l2_proof proof parameters message = + Context.verify_stream_proof proof (fun tree -> + Verifier_apply.apply_message tree parameters message >>= function + | Ok (tree, (_, withdrawals)) -> Lwt.return (tree, withdrawals) + | Error _ -> Lwt.return (tree, [])) + +(** [compute_proof_after_hash ~max_proof_size agreed proof message] computes the + after hash expected while verifying [proof] on [message] starting from + [agreed]. + + Note that if the proof is incorrect this function fails and the commit + can not be rejected. *) +let compute_proof_after_hash ~proof_length ~max_proof_size ctxt parameters + agreed (proof : Tx_rollup_l2_proof.t) message = + let message_length = + Data_encoding.Binary.length Tx_rollup_message.encoding message + in + (* When considering “proof large enough to make a batch invalid, + even if truncated”, we actually need to take into consideration + the size of the message. + + [max_proof_size] is the upper bound, but we need to make room for + the message itself. So the real limit for the proof size is + reduced to that end. This way, we save a bit of TPS compared to + just having a lower [max_proof_size] constant. *) + let max_proof_size = max_proof_size - message_length in + let proof_is_too_long = Compare.Int.(proof_length > max_proof_size) in + let before = match proof.before with `Node x -> x | `Value x -> x in + let agreed_is_correct = Context_hash.(before = agreed) in + fail_unless + agreed_is_correct + (Proof_invalid_before {provided = before; agreed}) + >>=? fun () -> + consume_verify_proof_cost + ctxt + ~message_size:message_length + ~proof_size:proof_length + >>?= fun ctxt -> + verify_l2_proof proof parameters message >>= fun res -> + match res with + | (Ok _ | Error (`Stream_too_short _)) when proof_is_too_long -> + (* If the proof is larger than [max_proof_size] we care about 2 cases: + + - The proof verification succedeed but should not be considered valid + since it is larger than the size limit + - The proof verification failed because it was truncated but was + already larger than the size limit + + In those two cases, the expected after hash is + [after_hash_when_proof_failed] because the correct commitment is + "we were not able to apply this message, so after is the same + as before" + *) + after_hash_when_proof_failed ctxt agreed >>?= fun res -> return res + | Ok (tree, withdrawals) -> + (* The proof is small enough, we compare the computed hash with the + committed one *) + let tree_hash = Context.Tree.hash tree in + Tx_rollup_hash.withdraw_list ctxt withdrawals + >>?= fun (ctxt, withdrawals) -> + hash_message_result ctxt tree_hash withdrawals >>?= fun res -> return res + | Error _ -> + (* Finally, the proof verification leads to an internal Irmin error *) + tzfail Proof_failed_to_reject + +let verify_proof ctxt parameters message proof ~proof_length + ~(agreed : Tx_rollup_message_result.t) ~rejected ~max_proof_size = + compute_proof_after_hash + ctxt + parameters + agreed.context_hash + ~proof_length + ~max_proof_size + proof + message + >>=? fun (ctxt, computed_result) -> + if Alpha_context.Tx_rollup_message_result_hash.(computed_result <> rejected) + then return ctxt + else tzfail Proof_produced_rejected_state + +module Internal_for_tests = struct + let verify_l2_proof = verify_l2_proof +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.mli new file mode 100644 index 000000000000..7edeca2f2509 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_l2_verifier.mli @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +module Verifier_storage : sig + include + Tx_rollup_l2_storage_sig.STORAGE + with type t = Context.tree + and type 'a m = ('a, error) result Lwt.t +end + +module Verifier_context : sig + include Tx_rollup_l2_context_sig.CONTEXT with type t = Verifier_storage.t +end + +(** [verify_proof ctxt message proof ~proof_length ~agreed ~rejected ~max_proof_size] + verifies a Merkle proof for a L2 message, starting from the state + [agreed]. If the [proof] is correct, and the final Merkle hash is + not equal to [rejected], then [verify_proof] passes. + + Note that if [proof_length] is larger than [max_proof_size] and the final + Merkle hash is equal to [rejected], the needed proof for the rejected + commitment is too large, thus, [verify_proof] passes and the commitment + is rejected. *) +val verify_proof : + Alpha_context.t -> + Tx_rollup_l2_apply.parameters -> + Tx_rollup_message.t -> + Tx_rollup_l2_proof.t -> + proof_length:int -> + agreed:Tx_rollup_message_result.t -> + rejected:Tx_rollup_message_result_hash.t -> + max_proof_size:int -> + Alpha_context.t tzresult Lwt.t + +(**/**) + +module Internal_for_tests : sig + val verify_l2_proof : + Context.Proof.stream Context.Proof.t -> + Tx_rollup_l2_apply.parameters -> + Tx_rollup_message.t -> + ( Context.tree * Tx_rollup_withdraw.order list, + [ `Proof_mismatch of string + | `Stream_too_long of string + | `Stream_too_short of string ] ) + result + Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.ml new file mode 100644 index 000000000000..d5f43d1e8d6f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.ml @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Raw_level_repr + +type level = t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.mli new file mode 100644 index 000000000000..b1ad65ce3d50 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_level_repr.mli @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +type t + +type level = t + +(** @raise Invalid_argument when the level to encode is not positive *) +val encoding : level Data_encoding.t + +val rpc_arg : level RPC_arg.arg + +val pp : Format.formatter -> level -> unit + +include Compare.S with type t := level + +val to_int32 : level -> int32 + +(** @raise Invalid_argument when the level to encode is negative *) +val of_int32_exn : int32 -> level + +(** Can trigger Unexpected_level error when the level to encode is negative *) +val of_int32 : int32 -> level tzresult + +val diff : level -> level -> int32 + +val root : level + +val succ : level -> level + +val pred : level -> level option + +(** [add l i] i must be positive *) +val add : level -> int -> level + +(** [sub l i] i must be positive *) +val sub : level -> int -> level option + +module Index : Storage_description.INDEX with type t = level diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.ml new file mode 100644 index 000000000000..6470536935a7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.ml @@ -0,0 +1,49 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let hash_size = Tx_rollup_prefixes.message_hash.hash_size + +module Message_hash = + Blake2B.Make + (Base58) + (struct + let name = "Tx_rollup_inbox_message_hash" + + let title = "The hash of a transaction rollup inbox’s message" + + let b58check_prefix = Tx_rollup_prefixes.message_hash.b58check_prefix + + let size = Some hash_size + end) + +let () = + Tx_rollup_prefixes.( + check_encoding message_hash Message_hash.b58check_encoding) + +include Message_hash + +let hash_uncarbonated msg = + Message_hash.hash_bytes + [Data_encoding.Binary.to_bytes_exn Tx_rollup_message_repr.encoding msg] diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.mli new file mode 100644 index 000000000000..1a69f74c1d5f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_hash_repr.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The Blake2B hash of a message. + + To avoid unnecessary storage duplication, the inboxes in the + layer-1 do not contain the messages, but their hashes (see + {!Tx_rollup_inbox_storage.append_message}). This is possible + because the content of the messages can be reconstructed off-chain + by looking at the layer-1 operations and their receipt. *) + +include S.HASH + +(** [hash_uncarbonated msg] computes the hash of the given message + without any gas consumption. *) +val hash_uncarbonated : Tx_rollup_message_repr.t -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.ml new file mode 100644 index 000000000000..a4a79ada9046 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.ml @@ -0,0 +1,113 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type deposit = { + sender : Signature.Public_key_hash.t; + destination : Tx_rollup_l2_address.Indexable.value; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +let deposit_encoding = + let open Data_encoding in + conv + (fun {sender; destination; ticket_hash; amount} -> + (sender, destination, ticket_hash, amount)) + (fun (sender, destination, ticket_hash, amount) -> + {sender; destination; ticket_hash; amount}) + @@ obj4 + (req "sender" Signature.Public_key_hash.encoding) + (req "destination" Tx_rollup_l2_address.Indexable.value_encoding) + (req "ticket_hash" Ticket_hash_repr.encoding) + (req "amount" Tx_rollup_l2_qty.encoding) + +type t = Batch of string | Deposit of deposit + +let encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Batch" + (obj1 (req "batch" (string Hex))) + (function Batch batch -> Some batch | _ -> None) + (fun batch -> Batch batch); + case + (Tag 1) + ~title:"Deposit" + (obj1 (req "deposit" deposit_encoding)) + (function Deposit deposit -> Some deposit | _ -> None) + (fun deposit -> Deposit deposit); + ] + +let pp fmt = + let open Format in + function + | Batch str -> + let subsize = 10 in + let str, ellipsis = + if Compare.Int.(subsize < String.length str) then + let substring = String.sub str 0 subsize in + (substring, "...") + else (str, "") + in + fprintf + fmt + "@[<hov 2>Batch:@ %s%s@]" + (Hex.of_string str |> Hex.show) + ellipsis + | Deposit {sender; destination; ticket_hash; amount} -> + fprintf + fmt + "@[<hov 2>Deposit:@ sender=%a,@ destination=%a,@ ticket_hash=%a,@ \ + amount:%a@]" + Signature.Public_key_hash.pp + sender + Tx_rollup_l2_address.Indexable.pp + destination + Ticket_hash_repr.pp + ticket_hash + Tx_rollup_l2_qty.pp + amount + +let size = function + | Batch batch -> String.length batch + | Deposit {sender = _; destination = d; ticket_hash = _; amount = _} -> + (* Size of a BLS public key, that is the underlying type of a + l2 address. See [Tx_rollup_l2_address] *) + let sender_size = Signature.Public_key_hash.size in + (* Size of a BLS public key, that is the underlying type of a + l2 address. See [Tx_rollup_l2_address] *) + let destination_size = Tx_rollup_l2_address.Indexable.size d in + (* Size of a [Script_expr_hash.t], that is the underlying type + of [Ticket_hash_repr.t]. *) + let key_hash_size = 32 in + (* [int64] *) + let amount_size = 8 in + sender_size + destination_size + key_hash_size + amount_size diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.mli new file mode 100644 index 000000000000..aeed7d50603d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_repr.mli @@ -0,0 +1,66 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Communication from the layer-1 (Tezos) to the layer-2 (a + transaction rollup) happens thanks to messages, crafted in the + layer-1 to be interpreted in the layer-2. + + Messages are constructed and gathered in the layer-1, in + inboxes (see {!Tx_rollup_repr_storage.append_message}). *) + +(** Smart contract on the layer-1 can deposit tickets into a + transaction rollup, for the benefit of a {!Tx_rollup_l2_address.t}. + The [sender] is an implicit account where the deposit is returned in form of + a withdrawal, should the application of the deposit fail. + *) +type deposit = { + sender : Signature.Public_key_hash.t; + destination : Tx_rollup_l2_address.Indexable.value; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +(** A [message] is a piece of data originated from the layer-1 to be + interpreted by the layer-2. + + Transaction rollups feature two kind of messages: + + {ul {li An array of bytes that supposedly contains a valid + sequence of layer-2 operations; their interpretation and + validation is deferred to the layer-2..} + {li A deposit order for a L1 ticket.}} *) +type t = Batch of string | Deposit of deposit + +(** [size msg] returns the number of bytes that are allocated in an + inbox by [msg]. *) +val size : t -> int + +val deposit_encoding : deposit Data_encoding.t + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.ml new file mode 100644 index 000000000000..d956fdcb4320 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.ml @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let message_result_hash = Tx_rollup_prefixes.message_result_hash.b58check_prefix + +module H = + Blake2B.Make + (Base58) + (struct + let name = "Message_result_hash" + + let title = "A message result hash" + + let b58check_prefix = message_result_hash + + let size = Some Tx_rollup_prefixes.message_result_hash.hash_size + end) + +include H +include Path_encoding.Make_hex (H) + +let () = + Tx_rollup_prefixes.(check_encoding message_result_hash b58check_encoding) + +let hash_uncarbonated result = + let bytes = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_message_result_repr.encoding + result + in + H.hash_bytes [bytes] + +let init = hash_uncarbonated Tx_rollup_message_result_repr.init diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.mli new file mode 100644 index 000000000000..7016002dde4c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_hash_repr.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The hash of the result of a layer-2 operation: that is, the hash + of [(l2_ctxt_hash ^ withdraw_hash)] where [l2_ctxt_hash] is the Merkle + tree root of the L2 context after any message (ie. deposit or batch), + and [withdraw_hash] is a [Tx_rollup_withdraw_repr.withdraw_list_hash] *) + +include S.HASH + +(** [hash_uncarbonated result] computes the hash of the given context + hash and withdraw list hash without any gas consumption. *) +val hash_uncarbonated : Tx_rollup_message_result_repr.t -> t + +val init : t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.ml new file mode 100644 index 000000000000..87d1d09d07a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.ml @@ -0,0 +1,52 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + context_hash : Context_hash.t; + withdraw_list_hash : Tx_rollup_withdraw_list_hash_repr.t; +} + +let encoding = + let open Data_encoding in + conv + (fun {context_hash; withdraw_list_hash} -> + (context_hash, withdraw_list_hash)) + (fun (context_hash, withdraw_list_hash) -> + {context_hash; withdraw_list_hash}) + (obj2 + (req "context_hash" Context_hash.encoding) + (req "withdraw_list_hash" Tx_rollup_withdraw_list_hash_repr.encoding)) + +let empty_l2_context_hash = + Context_hash.of_b58check_exn + "CoVu7Pqp1Gh3z33mink5T5Q2kAQKtnn3GHxVhyehdKZpQMBxFBGF" + +let init = + { + context_hash = empty_l2_context_hash; + withdraw_list_hash = Tx_rollup_withdraw_list_hash_repr.empty; + } diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.mli new file mode 100644 index 000000000000..f5147ca1da88 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_message_result_repr.mli @@ -0,0 +1,47 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + context_hash : Context_hash.t; + withdraw_list_hash : Tx_rollup_withdraw_list_hash_repr.t; +} + +val encoding : t Data_encoding.t + +val init : t + +(** [empty_l2_context_hash] is the context hash of the layer-2 context + just after its origination. + + The empty layer2 context hash is the hash of the underlying Irmin tree. + One important note is: an empty tree *must* not be hashed when it's empty. + See https://github.com/mirage/irmin/issues/1304. + + Our solution is to write data in the tree to have a non-empty one. + We write the {!Tx_rollup_l2_context.Ticket_count} default value (i.e. 0) + and the {!Tx_rollup_l2_context.Address_count} as well in the tree. Then + we hash the resulting tree to create this constant. +*) +val empty_l2_context_hash : Context_hash.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.ml new file mode 100644 index 000000000000..f79d341c7642 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.ml @@ -0,0 +1,42 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Script_typed_ir + +type deposit_parameters = { + ex_ticket : Ticket_scanner.ex_ticket; + l2_destination : tx_rollup_l2_address; +} + +let get_deposit_parameters : + type a comparable. + ((a ticket, tx_rollup_l2_address) pair, comparable) ty -> + (a ticket, tx_rollup_l2_address) pair -> + deposit_parameters = + fun (Pair_t (Ticket_t (ty, _), Tx_rollup_l2_address_t, _, _)) + (ticket, l2_destination) -> + {ex_ticket = Ticket_scanner.Ex_ticket (ty, ticket); l2_destination} diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.mli new file mode 100644 index 000000000000..76bd40127701 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_parameters.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A module for representing and extracting typed transactional rollup + parameters. *) + +open Script_typed_ir + +(** A type representing deposit parameters for transactional rollups. Deposit + parameters consist of a ticket of arbitrary content along with a + layer-2 destination address. *) +type deposit_parameters = { + ex_ticket : Ticket_scanner.ex_ticket; + l2_destination : tx_rollup_l2_address; +} + +(** [get_deposit_parameters ty value] returns [ex_ticket] and a + [tx_rollup_l2_address] from a michelson typed value. + + This function is intended to be used to enforce the type of the transaction + to a [tx_rollup%deposit]. It must be used both in [ticket_diffs_of_operations] + to account for the ticket deposited and in [apply] to retrieve the ticket + when applying the transaction to a tx_rollup. *) +val get_deposit_parameters : + (('a ticket, tx_rollup_l2_address) pair, 'comparable) ty -> + ('a ticket, tx_rollup_l2_address) pair -> + deposit_parameters diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.ml new file mode 100644 index 000000000000..dfaad858befb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.ml @@ -0,0 +1,92 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + b58check_prefix : string; + prefix : string; + hash_size : int; + b58check_size : int; +} + +let rollup_address = + { + b58check_prefix = "\001\128\120\031"; + prefix = "txr1"; + hash_size = 20; + b58check_size = 37; + } + +let inbox_hash = + { + b58check_prefix = "\079\148\196"; + prefix = "txi"; + hash_size = 32; + b58check_size = 53; + } + +let inbox_list_hash = inbox_hash + +let message_hash = + { + b58check_prefix = "\079\149\030"; + prefix = "txm"; + hash_size = 32; + b58check_size = 53; + } + +let commitment_hash = + { + b58check_prefix = "\079\148\017"; + prefix = "txc"; + hash_size = 32; + b58check_size = 53; + } + +let message_result_hash = + { + b58check_prefix = "\018\007\206\087"; + prefix = "txmr"; + hash_size = 32; + b58check_size = 54; + } + +let message_result_list_hash = + { + b58check_prefix = "\079\146\082"; + prefix = "txM"; + hash_size = 32; + b58check_size = 53; + } + +let withdraw_list_hash = + { + b58check_prefix = "\079\150\072"; + prefix = "txw"; + hash_size = 32; + b58check_size = 53; + } + +let check_encoding {prefix; b58check_size; _} encoding = + Base58.check_encoded_prefix encoding prefix b58check_size diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.mli new file mode 100644 index 000000000000..caef92440612 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_prefixes.mli @@ -0,0 +1,59 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + b58check_prefix : string; + prefix : string; + hash_size : int; + b58check_size : int; +} + +(** See {!Tx_rollup_repr}. *) +val rollup_address : t + +(** See {!Tx_rollup_inbox_repr}. *) +val inbox_hash : t + +(** See {!Tx_rollup_message_repr}. *) +val message_hash : t + +(** See {!Tx_rollup_commitment_repr}. *) +val commitment_hash : t + +(** See {!Tx_rollup_commitment_repr}. *) +val message_result_hash : t + +(** See {!Tx_rollup_message_result_repr.Merkle}. *) +val message_result_list_hash : t + +(** See {!Tx_rollup_withdraw_repr}. *) +val withdraw_list_hash : t + +(** See {!Tx_rollup_inbox_repr.inbox_hash}. *) +val inbox_list_hash : t + +(** [check_encoding spec encoding] checks that [encoding] satisfies + [spec]. Raises an exception otherwise. *) +val check_encoding : t -> 'a Base58.encoding -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.ml new file mode 100644 index 000000000000..f9e8e568dc43 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.ml @@ -0,0 +1,162 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021-2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021-2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += (* `Permanent *) Invalid_rollup_notation of string + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"rollup.invalid_tx_rollup_notation" + ~title:"Invalid tx rollup notation" + ~pp:(fun ppf x -> Format.fprintf ppf "Invalid tx rollup notation %S" x) + ~description: + "A malformed tx rollup notation was given to an RPC or in a script." + (obj1 (req "notation" (string Plain))) + (function Invalid_rollup_notation loc -> Some loc | _ -> None) + (fun loc -> Invalid_rollup_notation loc) + +module Hash = struct + let rollup_hash = Tx_rollup_prefixes.rollup_address.b58check_prefix + + module H = + Blake2B.Make + (Base58) + (struct + let name = "Rollup_hash" + + let title = "A rollup ID" + + let b58check_prefix = rollup_hash + + let size = Some Tx_rollup_prefixes.rollup_address.hash_size + end) + + include H + + let () = Tx_rollup_prefixes.(check_encoding rollup_address b58check_encoding) + + include Path_encoding.Make_hex (H) +end + +type t = Hash.t + +module Compare_impl = Compare.Make (struct + type nonrec t = t + + let compare r1 r2 = Hash.compare r1 r2 +end) + +include Compare_impl + +let in_memory_size _ = + let open Cache_memory_helpers in + header_size +! word_size + +! string_size_gen Tx_rollup_prefixes.rollup_address.hash_size + +let to_b58check rollup = Hash.to_b58check rollup + +let of_b58data = function Hash.Data hash -> Some hash | _ -> None + +let of_b58check_opt s = Option.bind (Base58.decode s) of_b58data + +let of_b58check s = + match of_b58check_opt s with + | Some hash -> ok hash + | _ -> error (Invalid_rollup_notation s) + +let pp ppf hash = Hash.pp ppf hash + +let encoding = + let open Data_encoding in + def + "tx_rollup_id" + ~title:"A tx rollup handle" + ~description: + "A tx rollup notation as given to an RPC or inside scripts, is a base58 \ + tx rollup hash" + @@ splitted + ~binary:Hash.encoding + ~json: + (conv + to_b58check + (fun s -> + match of_b58check s with + | Ok s -> s + | Error _ -> Json.cannot_destruct "Invalid tx rollup notation.") + (string Plain)) + +let originated_tx_rollup nonce = + let data = + Data_encoding.Binary.to_bytes_exn Origination_nonce.encoding nonce + in + Hash.hash_bytes [data] + +let rpc_arg = + let construct = to_b58check in + let destruct hash = + Result.map_error (fun _ -> "Cannot parse tx rollup id") (of_b58check hash) + in + RPC_arg.make + ~descr:"A tx rollup identifier encoded in b58check." + ~name:"tx_rollup_id" + ~construct + ~destruct + () + +module Index = struct + type nonrec t = t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt encoding) + | _ -> None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end + +module Cmp = struct + type nonrec t = t + + let compare = compare +end + +module Set = Set.Make (Cmp) +module Map = Map.Make (Cmp) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.mli new file mode 100644 index 000000000000..18f15b2b7c11 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_repr.mli @@ -0,0 +1,69 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module defines identifiers for transaction only rollup (or + tx rollup). It also specifies how to compute originated + tx rollup's hash from origination nonce. *) + +(** A specialized Blake2B implementation for hashing tx_rollup identifiers with + "txr1" as a base58 prefix *) +module Hash : sig + val rollup_hash : string + + include S.HASH +end + +type t = private Hash.t + +include Compare.S with type t := t + +(** [in_memory_size tx_rollup] returns the number of bytes [tx_rollup] + uses in RAM. *) +val in_memory_size : t -> Cache_memory_helpers.sint + +val to_b58check : t -> string + +val of_b58data : Base58.data -> t option + +val of_b58check : string -> t tzresult + +val of_b58check_opt : string -> t option + +val pp : Format.formatter -> t -> unit + +val encoding : t Data_encoding.t + +(** [originated_tx_rollup nonce] is the tx_rollup address originated from + [nonce]. See [Origination_nonce.t] for more information. *) +val originated_tx_rollup : Origination_nonce.t -> t + +val rpc_arg : t RPC_arg.arg + +module Index : Storage_description.INDEX with type t = t + +module Set : Set.S with type elt = t + +module Map : Map.S with type key = t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.ml new file mode 100644 index 000000000000..79f345c77b7f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.ml @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + contents : Script_repr.lazy_expr; + ty : Script_repr.lazy_expr; + ticketer : Contract_repr.t; + amount : Tx_rollup_l2_qty.t; + claimer : Signature.Public_key_hash.t; +} + +let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun {contents; ty; ticketer; amount; claimer} -> + (contents, ty, ticketer, amount, claimer)) + (fun (contents, ty, ticketer, amount, claimer) -> + {contents; ty; ticketer; amount; claimer}) + (obj5 + (req "contents" Script_repr.lazy_expr_encoding) + (req "ty" Script_repr.lazy_expr_encoding) + (req "ticketer" Contract_repr.encoding) + (req "amount" Tx_rollup_l2_qty.encoding) + (req "claimer" Signature.Public_key_hash.encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.mli new file mode 100644 index 000000000000..8edf6de3d627 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_repr.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A reveal provides what is necessary to recompute a + {!Tx_rollup_withdrawal.t} message. *) +type t = { + contents : Script_repr.lazy_expr; + ty : Script_repr.lazy_expr; + ticketer : Contract_repr.t; + amount : Tx_rollup_l2_qty.t; + claimer : Signature.Public_key_hash.t; +} + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.ml new file mode 100644 index 000000000000..3223990f9c03 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.ml @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let record ctxt tx_rollup level ~message_position = + Storage.Tx_rollup.Revealed_withdrawals.find (ctxt, tx_rollup) level + >>=? fun (ctxt, revealed_withdrawals_opt) -> + Bitset.add + (Option.value ~default:Bitset.empty revealed_withdrawals_opt) + message_position + >>?= fun revealed_withdrawals -> + Storage.Tx_rollup.Revealed_withdrawals.add + (ctxt, tx_rollup) + level + revealed_withdrawals + >>=? fun (ctxt, _new_size, _is_new) -> return ctxt +(* See {{Note}} in [Tx_rollup_commitment_storage] for a rationale on + why ignoring storage allocation is safe. *) + +let mem ctxt tx_rollup level ~message_position = + Storage.Tx_rollup.Revealed_withdrawals.find (ctxt, tx_rollup) level + >>=? fun (ctxt, revealed_withdrawals_opt) -> + match revealed_withdrawals_opt with + | Some field -> + Bitset.mem field message_position >>?= fun res -> return (ctxt, res) + | None -> return (ctxt, false) + +let remove ctxt tx_rollup level = + Storage.Tx_rollup.Revealed_withdrawals.remove (ctxt, tx_rollup) level + >>=? fun (ctxt, _freed_size, _existed) -> return ctxt +(* See {{Note}} in [Tx_rollup_commitment_storage] for a rationale on + why ignoring storage allocation is safe. *) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.mli new file mode 100644 index 000000000000..a5d1e726ee83 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_reveal_storage.mli @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [record ctxt tx_rollup lvl message_position] adds + [message_position] to the list of message with revealed + withdrawals for [tx_rollup] at [lvl]. *) +val record : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_position:int -> + Raw_context.t tzresult Lwt.t + +(** [mem ctxt tx_rollup lvl message_position] checks if + [message_position] has already had its withdrawals revealed for + [tx_rollup] at [lvl]. *) +val mem : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_position:int -> + (Raw_context.t * bool) tzresult Lwt.t + +(** [remove ctxt tx_rollup lvl] clean-up the reveal accounting data + from the layer-1 storage. *) +val remove : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.ml new file mode 100644 index 000000000000..49d7589d484f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.ml @@ -0,0 +1,94 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Alpha_context + +let custom_root = + (RPC_path.(open_root / "context" / "tx_rollup") + : RPC_context.t RPC_path.context) + +module S = struct + let state = + RPC_service.get_service + ~description:"Access the state of a rollup." + ~query:RPC_query.empty + ~output:Tx_rollup_state.encoding + RPC_path.(custom_root /: Tx_rollup.rpc_arg / "state") + + let inbox = + RPC_service.get_service + ~description:"Get the inbox of a transaction rollup" + ~query:RPC_query.empty + ~output:Data_encoding.(option Tx_rollup_inbox.encoding) + RPC_path.( + custom_root /: Tx_rollup.rpc_arg / "inbox" /: Tx_rollup_level.rpc_arg) + + let commitment = + RPC_service.get_service + ~description:"Return the commitment for a level, if any" + ~query:RPC_query.empty + ~output: + Data_encoding.( + option Tx_rollup_commitment.Submitted_commitment.encoding) + RPC_path.( + custom_root /: Tx_rollup.rpc_arg / "commitment" + /: Tx_rollup_level.rpc_arg) + + let pending_bonded_commitments = + RPC_service.get_service + ~description: + "Get the number of pending bonded commitments for a pkh on a rollup" + ~query:RPC_query.empty + ~output:Data_encoding.int32 + RPC_path.( + custom_root /: Tx_rollup.rpc_arg / "pending_bonded_commitments" + /: Signature.Public_key_hash.rpc_arg) +end + +let register () = + let open Services_registration in + opt_register1 ~chunked:false S.state (fun ctxt tx_rollup () () -> + Tx_rollup_state.find ctxt tx_rollup >|=? snd) ; + register2 ~chunked:false S.inbox (fun ctxt tx_rollup level () () -> + Tx_rollup_inbox.find ctxt level tx_rollup >|=? snd) ; + register2 ~chunked:false S.commitment (fun ctxt tx_rollup level () () -> + Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_commitment.find ctxt tx_rollup state level + >|=? fun (_, commitment) -> commitment) ; + register2 + ~chunked:false + S.pending_bonded_commitments + (fun ctxt tx_rollup pkh () () -> + Tx_rollup_commitment.pending_bonded_commitments ctxt tx_rollup pkh + >|=? fun (_, count) -> Int32.of_int count) + +let state ctxt block tx_rollup = + RPC_context.make_call1 S.state ctxt block tx_rollup () () + +let inbox ctxt block tx_rollup level = + RPC_context.make_call2 S.inbox ctxt block tx_rollup level () () + +let commitment ctxt block tx_rollup level = + RPC_context.make_call2 S.commitment ctxt block tx_rollup level () () diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.mli new file mode 100644 index 000000000000..74ba514a1fa6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_services.mli @@ -0,0 +1,55 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +val state : + 'a #RPC_context.simple -> + 'a -> + Tx_rollup.t -> + Tx_rollup_state.t shell_tzresult Lwt.t + +(** Returns the inbox for a transaction rollup for a given rollup + level. + + Returns [Not_found] if the transaction rollup exists, but does not + have inbox at that level. Fails if the transaction rollup does not + exist. *) +val inbox : + 'a #RPC_context.simple -> + 'a -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_inbox.t option shell_tzresult Lwt.t + +val commitment : + 'a #RPC_context.simple -> + 'a -> + Tx_rollup.t -> + Tx_rollup_level.t -> + Tx_rollup_commitment.Submitted_commitment.t option shell_tzresult Lwt.t + +val register : unit -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.ml new file mode 100644 index 000000000000..104b9f1e00d1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.ml @@ -0,0 +1,721 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_errors_repr + +type range = + | Interval of { + oldest : Tx_rollup_level_repr.t; + newest : Tx_rollup_level_repr.t; + } + | Empty of {next : Tx_rollup_level_repr.t} + +let range_newest = function Interval {newest; _} -> Some newest | _ -> None + +let range_oldest = function Interval {oldest; _} -> Some oldest | _ -> None + +let extend = function + | Empty {next} -> (Interval {oldest = next; newest = next}, next) + | Interval {oldest; newest} -> + let newest = Tx_rollup_level_repr.succ newest in + (Interval {oldest; newest}, newest) + +let shrink = function + | Empty _ -> error (Internal_error "cannot shrink range") + | Interval {oldest; newest} when Tx_rollup_level_repr.(oldest < newest) -> + ok (Interval {oldest = Tx_rollup_level_repr.succ oldest; newest}) + | Interval {newest; oldest = _} -> + ok (Empty {next = Tx_rollup_level_repr.succ newest}) + +let belongs_to range level = + match range with + | Empty _ -> false + | Interval {oldest; newest} -> + Tx_rollup_level_repr.(oldest <= level && level <= newest) + +let right_cut range level = + match Tx_rollup_level_repr.pred level with + | None -> ok (Empty {next = Tx_rollup_level_repr.root}) + | Some predecessor -> ( + match range with + | Interval {oldest; newest = _} when belongs_to range level -> + if Tx_rollup_level_repr.(oldest <= predecessor) then + ok (Interval {oldest; newest = predecessor}) + else ok (Empty {next = level}) + | _ -> error (Internal_error "cannot cut range")) + +let left_extend range level = + match range with + | Interval {oldest = _; newest} -> ok (Interval {oldest = level; newest}) + | Empty {next} -> + let newest = + Option.value ~default:level (Tx_rollup_level_repr.pred next) + in + ok (Interval {oldest = level; newest}) + +let range_count = function + | Empty _ -> 0 + | Interval {oldest; newest} -> + Int32.(succ @@ Tx_rollup_level_repr.diff newest oldest |> to_int) + +let range_encoding : range Data_encoding.t = + Data_encoding.( + union + [ + case + (Tag 0) + ~title:"empty" + (obj1 (req "next" Tx_rollup_level_repr.encoding)) + (function Empty {next} -> Some next | _ -> None) + (fun next -> Empty {next}); + case + (Tag 1) + ~title:"interval" + (obj2 + (req "newest" Tx_rollup_level_repr.encoding) + (req "oldest" Tx_rollup_level_repr.encoding)) + (function + | Interval {newest; oldest} -> Some (newest, oldest) | _ -> None) + (fun (newest, oldest) -> Interval {newest; oldest}); + ]) + +let pp_range fmt = function + | Empty {next} -> Format.(fprintf fmt "next: %a" Tx_rollup_level_repr.pp next) + | Interval {oldest; newest} -> + Format.( + fprintf + fmt + "oldest: %a newest: %a" + Tx_rollup_level_repr.pp + oldest + Tx_rollup_level_repr.pp + newest) + +type watermark = Tx_rollup_level_repr.t option + +let is_above_watermark watermark level = + match watermark with + | Some watermark -> Tx_rollup_level_repr.(watermark < level) + | None -> true + +let make_watermark level = Some level + +(** The state of a transaction rollup is composed of [burn_per_byte] + and [inbox_ema] fields. [initial_state] introduces their initial + values. Both values are updated by [update_burn_per_byte] as the + rollup progresses. + + [burn_per_byte] state the cost of burn per byte to be paid for + each byte submitted to a transaction rollup inbox. [inbox_ema] + is a key factor to impact the update of [burn_per_byte]. + + [inbox_ema] is the N-block EMA to react to recent N-inbox size + changes. N-block EMA is an exponential moving average (EMA), that + is a type of moving average that places a greater weight and + significance on the most N data points. The purpose of [inbox_ema] + is to get lessened volatility of burn, that is more resistant to + spurious spikes of [burn_per_byte]. + + The state of the transaction rollup also keeps track of four pointers + to four different rollup levels. + + - The [commitment_oldest_level] is the level of the oldest + finalized commitment still stored in the layer-1 storage. + + - The [commitment_newest_level] is the level of the most recent + unfinalized commitment in the layer-1 storage. + + - The [oldest_inbox_level] is the level of the oldest inbox still stored + in the layer-1 storage. + + - The [newest_level] is the level of the most recent inbox in the + layer-1 storage. +*) +type t = { + last_removed_commitment_hashes : + (Tx_rollup_message_result_hash_repr.t * Tx_rollup_commitment_repr.Hash.t) + option; + finalized_commitments : range; + unfinalized_commitments : range; + uncommitted_inboxes : range; + commitment_newest_hash : Tx_rollup_commitment_repr.Hash.t option; + tezos_head_level : Raw_level_repr.t option; + burn_per_byte : Tez_repr.t; + inbox_ema : int; + allocated_storage : Z.t; + occupied_storage : Z.t; + commitments_watermark : watermark; +} + +(* + + The main use of a transaction rollup state is to keep track of four + pointers to four different rollup levels (see above). + + When the rollup is created, these four pointers are initialized with + the [None] value, because no inboxes or commitments have been created + yet. Because inboxes and commitments can be removed from the layer-1 + context under certain circumstances, they can be reset to [None]. + + The state allows us to keep track of three intervals: the finalized + commitments (whose inboxes have been removed from the layer-1 + storage), the unfinalized commitments (whose inboxes are still in + the layer-1 storage), and uncommitted inboxes (that is, inboxes + which are still waiting for a commitment). + + finalized uncommitted + ^^^^^^ ^^^^^^^^ + [------------] commitments + [--------------] inboxes + ^^^^^^^^ + unfinalized + + Note that this layout is not the only one that we can witness in + the layer-1 storage, even if it is the more common. It is possible + for instance that there is no unfinalized commitments at a given + time. + + finalized + ^^^^^^ + [----] commitments + [--------------] inboxes + ^^^^^^^^^^^^^^^^ + uncommitted + + Or that we have no more inboxes, but only finalized commitments. + + finalized + ^^^^^^ + CT + [-----] commitments + inboxes + + *) + +let initial_state ~pre_allocated_storage = + { + last_removed_commitment_hashes = None; + finalized_commitments = Empty {next = Tx_rollup_level_repr.root}; + unfinalized_commitments = Empty {next = Tx_rollup_level_repr.root}; + uncommitted_inboxes = Empty {next = Tx_rollup_level_repr.root}; + commitment_newest_hash = None; + tezos_head_level = None; + burn_per_byte = Tez_repr.zero; + inbox_ema = 0; + allocated_storage = pre_allocated_storage; + occupied_storage = Z.zero; + commitments_watermark = None; + } + +let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun { + last_removed_commitment_hashes; + finalized_commitments; + unfinalized_commitments; + uncommitted_inboxes; + commitment_newest_hash; + tezos_head_level; + burn_per_byte; + allocated_storage; + occupied_storage; + inbox_ema; + commitments_watermark; + } -> + ( ( last_removed_commitment_hashes, + finalized_commitments, + unfinalized_commitments, + uncommitted_inboxes, + commitment_newest_hash, + tezos_head_level, + burn_per_byte, + allocated_storage, + occupied_storage, + inbox_ema ), + commitments_watermark )) + (fun ( ( last_removed_commitment_hashes, + finalized_commitments, + unfinalized_commitments, + uncommitted_inboxes, + commitment_newest_hash, + tezos_head_level, + burn_per_byte, + allocated_storage, + occupied_storage, + inbox_ema ), + commitments_watermark ) -> + { + last_removed_commitment_hashes; + finalized_commitments; + unfinalized_commitments; + uncommitted_inboxes; + commitment_newest_hash; + tezos_head_level; + burn_per_byte; + allocated_storage; + occupied_storage; + inbox_ema; + commitments_watermark; + }) + (merge_objs + (obj10 + (req + "last_removed_commitment_hashes" + (option + @@ obj2 + (req + "last_message_hash" + Tx_rollup_message_result_hash_repr.encoding) + (req + "commitment_hash" + Tx_rollup_commitment_repr.Hash.encoding))) + (req "finalized_commitments" range_encoding) + (req "unfinalized_commitments" range_encoding) + (req "uncommitted_inboxes" range_encoding) + (req + "commitment_newest_hash" + (option Tx_rollup_commitment_repr.Hash.encoding)) + (req "tezos_head_level" (option Raw_level_repr.encoding)) + (req "burn_per_byte" Tez_repr.encoding) + (req "allocated_storage" n) + (req "occupied_storage" n) + (req "inbox_ema" int31)) + (obj1 + (req "commitments_watermark" @@ option Tx_rollup_level_repr.encoding))) + +let pp fmt + { + last_removed_commitment_hashes; + finalized_commitments; + unfinalized_commitments; + uncommitted_inboxes; + commitment_newest_hash; + tezos_head_level; + burn_per_byte; + allocated_storage; + occupied_storage; + inbox_ema; + commitments_watermark; + } = + Format.( + fprintf + fmt + "cost_per_byte: %a inbox_ema: %d finalized_commitments: %a \ + unfinalized_commitments: %a uncommitted_inboxes: %a \ + commitment_newest_hash: %a tezos_head_level: %a \ + last_removed_commitment_hashes: %a allocated_storage: %a \ + occupied_storage: %a commitments_watermark: %a" + Tez_repr.pp + burn_per_byte + inbox_ema + pp_range + finalized_commitments + pp_range + unfinalized_commitments + pp_range + uncommitted_inboxes + (pp_print_option Tx_rollup_commitment_repr.Hash.pp) + commitment_newest_hash + (pp_print_option Raw_level_repr.pp) + tezos_head_level + (pp_print_option (fun fmt (m, c) -> + fprintf + fmt + "(message result: %a, commitment: %a)" + Tx_rollup_message_result_hash_repr.pp + m + Tx_rollup_commitment_repr.Hash.pp + c)) + last_removed_commitment_hashes + Z.pp_print + allocated_storage + Z.pp_print + occupied_storage + (pp_print_option Tx_rollup_level_repr.pp) + commitments_watermark) + +let adjust_storage_allocation : t -> delta:Z.t -> (t * Z.t) tzresult = + fun state ~delta -> + if Z.(equal zero delta) then ok (state, Z.zero) + else + let occupied_storage' = Z.add state.occupied_storage delta in + if Compare.Z.(occupied_storage' < Z.zero) then + (* returns [Internal_error] if [delta < 0] and [| delta | > state.occupied_storage]. + This error should never happen. *) + error + @@ Internal_error + "Storage size should be positive after occupied space is freed." + else + let diff = Z.sub occupied_storage' state.allocated_storage in + if Compare.Z.(diff > Z.zero) then + let state = + { + state with + occupied_storage = occupied_storage'; + allocated_storage = occupied_storage'; + } + in + ok (state, diff) + else + let state = {state with occupied_storage = occupied_storage'} in + ok (state, Z.zero) + +let update_burn_per_byte_helper : + t -> factor:int -> final_size:int -> hard_limit:int -> t = + fun ({burn_per_byte; inbox_ema; _} as state) ~factor ~final_size ~hard_limit -> + let threshold_increase = 90 in + let threshold_decrease = 80 in + let variation_factor = 5L in + let smoothing = 2 in + (* The formula of the multiplier of EMA : + + smoothing / (1 + N) + + Suppose the period we want to observe is given by the + [factor]. The common choice of smoothing is 2. + *) + let inbox_ema = + inbox_ema + ((final_size - inbox_ema) * smoothing / (1 + factor)) + in + let percentage = inbox_ema * 100 / hard_limit in + let computation = + let open Compare.Int in + if threshold_decrease < percentage && percentage <= threshold_increase then + (* constant case *) + ok burn_per_byte + else + Tez_repr.(burn_per_byte *? variation_factor >>? fun x -> x /? 100L) + >>? fun variation -> + let variation = + if Tez_repr.(variation = zero) then Tez_repr.one_mutez else variation + in + (* increase case *) + if threshold_increase < percentage then + Tez_repr.(burn_per_byte +? variation) + else if percentage < threshold_decrease && Tez_repr.(zero < burn_per_byte) + then + (* decrease case, and strictly positive burn *) + Tez_repr.(burn_per_byte -? variation) + else (* decrease case, and burn equals zero *) + ok burn_per_byte + in + match computation with + | Ok burn_per_byte -> {state with burn_per_byte; inbox_ema} + (* In the (very unlikely) event of an overflow, we force the burn to + be the maximum amount. *) + | Error _ -> {state with burn_per_byte = Tez_repr.max_mutez; inbox_ema} + +let rec update_burn_per_byte : + t -> elapsed:int -> factor:int -> final_size:int -> hard_limit:int -> t = + fun state ~elapsed ~factor ~final_size ~hard_limit -> + (* factor is expected to be a low number ~ 100 *) + if Compare.Int.(elapsed > factor) then + (* We do not need to compute precisely the new state. *) + {state with burn_per_byte = Tez_repr.zero; inbox_ema = 0} + else if Compare.Int.(elapsed <= 0) then + (* Base case, we take into a account the [final_size] once. *) + update_burn_per_byte_helper state ~factor ~final_size ~hard_limit + else + (* For all the blocks that do not contain inboxes, we act as if + the inbox size was [0]. *) + let state' = + update_burn_per_byte_helper state ~factor ~final_size:0 ~hard_limit + in + let elapsed = elapsed - 1 in + update_burn_per_byte state' ~elapsed ~factor ~final_size ~hard_limit + +let has_valid_commitment_at {finalized_commitments; unfinalized_commitments; _} + level = + belongs_to finalized_commitments level + || belongs_to unfinalized_commitments level + +let inboxes_count {unfinalized_commitments; uncommitted_inboxes; _} = + range_count unfinalized_commitments + range_count uncommitted_inboxes + +let uncommitted_inboxes_count {uncommitted_inboxes; _} = + range_count uncommitted_inboxes + +let commitments_count {finalized_commitments; unfinalized_commitments; _} = + range_count unfinalized_commitments + range_count finalized_commitments + +let record_inbox_creation t level = + (match t.tezos_head_level with + | Some tezos_lvl -> + error_when + Raw_level_repr.(level <= tezos_lvl) + (Internal_error "Trying to create an inbox in the past") + | None -> ok ()) + >>? fun () -> + let uncommitted_inboxes, new_level = extend t.uncommitted_inboxes in + adjust_storage_allocation t ~delta:Tx_rollup_inbox_repr.size + >>? fun (t, diff) -> + ok + ( {t with tezos_head_level = Some level; uncommitted_inboxes}, + new_level, + diff ) + +let next_commitment_predecessor state = state.commitment_newest_hash + +let finalized_commitment_oldest_level state = + range_oldest state.finalized_commitments + +let next_commitment_level state current_level = + match + ( range_oldest state.uncommitted_inboxes, + range_newest state.uncommitted_inboxes ) + with + | Some oldest_level, Some newest_level -> ( + if + (* We want to return an error if there is only one inbox in the + storage, and this inbox has been created in the current + block. *) + Tx_rollup_level_repr.(oldest_level < newest_level) + then + (* If [oldest_level < newest_level], we know we are not in + this setup, and we can safely return [oldest_level]. *) + ok oldest_level + else + (* Otherwise, we know that [oldest_level = newest_level], and we + need to check at which Tezos level is has been created. *) + match state.tezos_head_level with + | Some newest_inbox_creation -> + error_when + Raw_level_repr.(current_level <= newest_inbox_creation) + No_uncommitted_inbox + >>? fun () -> ok oldest_level + | None -> error (Internal_error "tezos_head_level was not properly set") + ) + | None, None -> error No_uncommitted_inbox + | Some _, None | None, Some _ -> + error (Internal_error "rollup state is inconsistent") + +let next_commitment_to_finalize state = + range_oldest state.unfinalized_commitments + +let next_commitment_to_remove state = range_oldest state.finalized_commitments + +let record_inbox_deletion state candidate = + match range_oldest state.unfinalized_commitments with + | Some level when Tx_rollup_level_repr.(candidate = level) -> + shrink state.unfinalized_commitments >>? fun unfinalized_commitments -> + let finalized_commitments, _ = extend state.finalized_commitments in + ok {state with unfinalized_commitments; finalized_commitments} + | _ -> error (Internal_error "Trying to delete the wrong inbox") + +let record_commitment_creation state level hash = + match range_oldest state.uncommitted_inboxes with + | Some oldest -> + error_unless + Tx_rollup_level_repr.(level = oldest) + (Internal_error "Trying to create the wrong commitment") + >>? fun () -> + shrink state.uncommitted_inboxes >>? fun uncommitted_inboxes -> + let unfinalized_commitments, _ = extend state.unfinalized_commitments in + let state = + { + state with + uncommitted_inboxes; + unfinalized_commitments; + commitment_newest_hash = Some hash; + } + in + if is_above_watermark state.commitments_watermark level then + (* See {{Note inbox}} in [Tx_rollup_commitment_storage] for + why it is safe to “free” the inbox storage when it is + committed too. *) + adjust_storage_allocation state ~delta:(Z.neg Tx_rollup_inbox_repr.size) + >>? fun (state, _) -> + ok {state with commitments_watermark = make_watermark level} + else ok state + | None -> + error (Internal_error "Cannot create a commitment due to lack of inbox") + +let record_commitment_rejection state level predecessor_hash = + let unwrap_option msg = function + | Some x -> ok x + | _ -> error (Internal_error msg) + in + let check_none msg = function + | None -> ok () + | Some _ -> error (Internal_error msg) + in + left_extend state.uncommitted_inboxes level >>? fun uncommitted_inboxes -> + let state = {state with uncommitted_inboxes} in + right_cut state.unfinalized_commitments level + >>? fun unfinalized_commitments -> + match Tx_rollup_level_repr.pred level with + | Some pred_level + when belongs_to state.unfinalized_commitments pred_level + || belongs_to state.finalized_commitments pred_level -> + (* Case 1. Predecessor level of the rejected commitments has a commitment in the storage *) + unwrap_option "Missing predecessor commitment" predecessor_hash + >>? fun predecessor_hash -> + ok + { + state with + unfinalized_commitments; + commitment_newest_hash = Some predecessor_hash; + } + | Some _ -> + (* Case 2. Predecessor level of the rejected commitments has its + commitment removed from the storage *) + check_none "Unexpected predecessor hash" predecessor_hash >>? fun () -> + unwrap_option + "Missing commitment hash" + state.last_removed_commitment_hashes + >>? fun (_, pred_hash) -> + ok + { + state with + unfinalized_commitments; + commitment_newest_hash = Some pred_hash; + } + | None -> + (* Case 3. The rejected commitment is the commitment of the root level *) + ok {state with unfinalized_commitments; commitment_newest_hash = None} + +let record_commitment_deletion state level hash message_hash = + match range_oldest state.finalized_commitments with + | Some oldest when Tx_rollup_level_repr.(level = oldest) -> + shrink state.finalized_commitments >>? fun finalized_commitments -> + ok + { + state with + finalized_commitments; + last_removed_commitment_hashes = Some (message_hash, hash); + } + | _ -> error (Internal_error "Trying to remove an incorrect commitment") + +let burn_cost ~limit state size = + Tez_repr.(state.burn_per_byte *? Int64.of_int size) >>? fun burn -> + match limit with + | Some limit when Tez_repr.(limit >= burn) -> + error (Submit_batch_burn_exceeded {burn; limit}) + | _ -> ok burn + +let finalized_commitments_range state = + match + ( range_oldest state.finalized_commitments, + range_newest state.finalized_commitments ) + with + | Some oldest, Some newest -> Some (oldest, newest) + | _ -> None + +let check_level_can_be_rejected state level = + match + ( range_oldest state.unfinalized_commitments, + range_newest state.unfinalized_commitments ) + with + | Some oldest, Some newest -> + error_unless Tx_rollup_level_repr.(oldest <= level && level <= newest) + @@ Cannot_reject_level + {provided = level; accepted_range = Some (oldest, newest)} + | _ -> error @@ Cannot_reject_level {provided = level; accepted_range = None} + +let last_removed_commitment_hashes state = state.last_removed_commitment_hashes + +let head_levels state = + match (state.uncommitted_inboxes, state.tezos_head_level) with + | Empty {next = l}, Some tz_level -> + Option.map (fun l -> (l, tz_level)) (Tx_rollup_level_repr.pred l) + | Interval {newest; _}, Some tz_level -> Some (newest, tz_level) + | _ -> None + +module Internal_for_tests = struct + let make : + ?burn_per_byte:Tez_repr.t -> + ?inbox_ema:int -> + ?last_removed_commitment_hashes: + Tx_rollup_message_result_hash_repr.t * Tx_rollup_commitment_repr.Hash.t -> + ?finalized_commitments:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?unfinalized_commitments:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?uncommitted_inboxes:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?commitment_newest_hash:Tx_rollup_commitment_repr.Hash.t -> + ?tezos_head_level:Raw_level_repr.t -> + ?occupied_storage:Z.t -> + ?commitments_watermark:Tx_rollup_level_repr.t -> + allocated_storage:Z.t -> + unit -> + t = + fun ?(burn_per_byte = Tez_repr.zero) + ?(inbox_ema = 0) + ?last_removed_commitment_hashes + ?finalized_commitments + ?unfinalized_commitments + ?uncommitted_inboxes + ?commitment_newest_hash + ?tezos_head_level + ?(occupied_storage = Z.zero) + ?commitments_watermark + ~allocated_storage + () -> + let to_range = function + | Some (oldest, newest) -> + assert (Tx_rollup_level_repr.(oldest <= newest)) ; + Interval {oldest; newest} + | _ -> Empty {next = Tx_rollup_level_repr.root} + in + + let unfinalized_commitments = to_range unfinalized_commitments in + let finalized_commitments = to_range finalized_commitments in + let uncommitted_inboxes = to_range uncommitted_inboxes in + + { + last_removed_commitment_hashes; + burn_per_byte; + occupied_storage; + allocated_storage; + inbox_ema; + finalized_commitments; + unfinalized_commitments; + uncommitted_inboxes; + commitment_newest_hash; + tezos_head_level; + commitments_watermark; + } + + let get_inbox_ema : t -> int = fun {inbox_ema; _} -> inbox_ema + + let get_occupied_storage : t -> Z.t = + fun {occupied_storage; _} -> occupied_storage + + let set_occupied_storage : Z.t -> t -> t = + fun occupied_storage st -> {st with occupied_storage} + + let get_allocated_storage : t -> Z.t = + fun {allocated_storage; _} -> allocated_storage + + let set_allocated_storage : Z.t -> t -> t = + fun allocated_storage st -> {st with allocated_storage} + + let reset_commitments_watermark : t -> t = + fun st -> {st with commitments_watermark = None} + + let get_commitments_watermark : t -> Tx_rollup_level_repr.t option = + fun st -> st.commitments_watermark +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.mli new file mode 100644 index 000000000000..91289c3c4baf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_repr.mli @@ -0,0 +1,255 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The state of a transaction rollup is a set of variables whose values vary + in time, as the rollup progresses. *) +type t + +(** [initial_state pre_allocated_storage] returns the initial state of + a transaction rollup (after its origination) with + [pre_allocated_storage] bytes of storage already paid for. *) +val initial_state : pre_allocated_storage:Z.t -> t + +val encoding : t Data_encoding.t + +val pp : Format.formatter -> t -> unit + +(** [update_burn_per_byte state ~elapsed ~factor ~final_size + ~hard_limit] updates the cost per byte to be paid for each message + submitted to the rollup. This is done by computing a moving + average for [factor] snapshots. Each snapshot being the size of the + total messages for the rollup. Hence each snapshot contributes to + [1/(1 + factor)] to the average. + + It may happen that the rollup does not receive any message for + some period of time. The parameter [elapsed] allows that to be taken + into account. If [elapsed=n] with [n>=1] it is similar as if + [update_burn_per_byte] was called [n] times with [final_size=0]. + + Once the exponential moving average [ema] is computed, we use the + [hard limit] to know whether the cost per byte should be updated: + + 1. If [ema <= 80] then the cost per byte is decreased + + 2. If [80 < ema <= 90] then the cost per byte is stable + + 3. If [90 < ema] then the cost ber byte is increased + + The rationale behind this mechanics is to adapt the cost of a + transactional rollup depending on its activity. This can be used + to prevent from some spamming attacks. *) +val update_burn_per_byte : + t -> elapsed:int -> factor:int -> final_size:int -> hard_limit:int -> t + +(** [burn_cost ~limit state size] computes the burn to be paid to submit + [size] bytes in the inbox of the transactional rollup. + + Returns [Tx_rollup_submit_batch_burn_exceeded] if the (computed) burn + exceeds [limit]. +*) +val burn_cost : limit:Tez_repr.t option -> t -> int -> Tez_repr.t tzresult + +(** [has_valid_commitment_at state level] returns [true] iff there is + a valid commitment for [level] in the layer-1 storage. + + On the contrary, if there is not commitment for [level] in the + layer-1 storage, or if there exists an orphan commitment (that is, + a commitment which has been rejected, or with one of its ancestors + that has been rejected) at [level], this function returns + [false]. *) +val has_valid_commitment_at : t -> Tx_rollup_level_repr.t -> bool + +(** [uncommitted_inboxes_count state] returns the number of inboxes + the rollup current has in the storage which did not receive a + commitment yet. *) +val uncommitted_inboxes_count : t -> int + +(** [commitments_count t] returns the number of commitment still in + the layer-1 context. *) +val commitments_count : t -> int + +(** [inboxes_count state] returns the number of inboxes the rollup + current has in the storage. *) +val inboxes_count : t -> int + +(** [next_commitment_to_finalize state] returns the rollup level of + the next commitment to be finalized. *) +val next_commitment_to_finalize : t -> Tx_rollup_level_repr.t option + +(** [next_commitment_to_remove state] returns the rollup level of the + next commitment to be removed from the layer-1 context. *) +val next_commitment_to_remove : t -> Tx_rollup_level_repr.t option + +(** [finalized_commitment_oldest_level state] returns the rollup level + of the oldest finalized commitment. *) +val finalized_commitment_oldest_level : t -> Tx_rollup_level_repr.t option + +(** [next_commitment_level current_level state] returns the expected + level of the next valid commitment. + + This function can return the error [No_uncommitted_inbox] if + there is no inbox awaiting a commitment. *) +val next_commitment_level : + t -> Raw_level_repr.t -> Tx_rollup_level_repr.t tzresult + +(** [next_commitment_predecessor state] returns the expected + predecessor hash of the next valid commitment. *) +val next_commitment_predecessor : t -> Tx_rollup_commitment_repr.Hash.t option + +(** [record_inbox_creation state level] updates the state of a rollup + to take into account the creation of of a new inbox at the given + Tezos [level], and returns the rollup level to associate to this + inbox and the number of bytes allocated for the inbox. + + This function may return an [Internal_error] iff an inbox has + already been created at a level greater (or equal) than + [level]. It is the responsibility of the caller to avoid that. *) +val record_inbox_creation : + t -> Raw_level_repr.t -> (t * Tx_rollup_level_repr.t * Z.t) tzresult + +(** [record_inbox_deletion state level] updates [state] to take into + account the deletion of the inbox stored at Tezos [level] from the + storage. + + This function returns an [Internal_error] iff there is no inbox + in the storage of the layer-1, or if [level] is not the oldest + level of rollup. *) +val record_inbox_deletion : t -> Tx_rollup_level_repr.t -> t tzresult + +(** [record_commitment_creation state level] updates [state] to take + into account the creation of a commitment at a given Tezos + [level]. + + This function returns an [Internal_error] if [level] is not the + successor level of the current commitment head, or if [level] is + greater than the inbox head. *) +val record_commitment_creation : + t -> Tx_rollup_level_repr.t -> Tx_rollup_commitment_repr.Hash.t -> t tzresult + +(** [record_commitment_rejection state level pred_hash] updates + [state] to take into account the fact that the commitment for the + inbox at [level] has been rejected. + + The caller is expected to provide the predecessor hash the next + valid commitment needs to use. It can be omitted under two + circumstances: if [level = root], or if the commitment identified + by [pred_hash] is no longer in the layer-1 context. *) +val record_commitment_rejection : + t -> + Tx_rollup_level_repr.t -> + Tx_rollup_commitment_repr.Hash.t option -> + t tzresult + +(** [record_commitment_deletion state level msg_hash commitment_hash] + updates [state] to take into account the deletion of a commitment + at a given rollup [level], and of given [commitment_hash] and + whose last message commitment is [msg_hash]. + + This function returns an [Internal_error] if [level] is not the + commitment tail, that is the oldest finalized commitment. *) +val record_commitment_deletion : + t -> + Tx_rollup_level_repr.t -> + Tx_rollup_commitment_repr.Hash.t -> + Tx_rollup_message_result_hash_repr.t -> + t tzresult + +(** [finalized_commitments_range state] returns the window of finalized + commitments that have not yet been cleaned out + + This function returns an [Internal_error] if the state is inconsistent, + which should not be possible. *) +val finalized_commitments_range : + t -> (Tx_rollup_level_repr.t * Tx_rollup_level_repr.t) option + +(** [check_level_can_be_rejected state level] raises + [Cannot_reject_level] iff there does not exist a commitment at + [level] that is not yet finalized. *) +val check_level_can_be_rejected : t -> Tx_rollup_level_repr.t -> unit tzresult + +(** [last_removed_commitment_hashes state] returns two hashes + associated to the last removed commitment: the message result + hash and the last commitment hash. *) +val last_removed_commitment_hashes : + t -> + (Tx_rollup_message_result_hash_repr.t * Tx_rollup_commitment_repr.Hash.t) + option + +(** [head_levels state] returns the level of the last inbox which has + been created in the layer-1 context, along with the Tezos level at + which said inbox has been created. *) +val head_levels : t -> (Tx_rollup_level_repr.t * Raw_level_repr.t) option + +(** [adjust_storage_allocation state ~delta] accounts for a change in + [delta] number of bytes used storage space by a transaction rollup. + + A positive [delta] indicates that the occupied storage of the + rollup increased. A negative [delta] indicates that the + occupied storage of the rollup decreased. + + Along with an updated state, a diff of storage space + is returned. The diff is + [max(0, allocated_storage - (occupied_storage + delta))]. + That is, 0 if no new storage was allocated, and the number of bytes + allocated otherwise. + + This function returns [Tx_rollup_errors.Internal_error] if + submitted [delta] would make [occupied_storage] negative. *) +val adjust_storage_allocation : t -> delta:Z.t -> (t * Z.t) tzresult + +module Internal_for_tests : sig + (** [make] returns a state for tests *) + val make : + ?burn_per_byte:Tez_repr.t -> + ?inbox_ema:int -> + ?last_removed_commitment_hashes: + Tx_rollup_message_result_hash_repr.t * Tx_rollup_commitment_repr.Hash.t -> + ?finalized_commitments:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?unfinalized_commitments:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?uncommitted_inboxes:Tx_rollup_level_repr.t * Tx_rollup_level_repr.t -> + ?commitment_newest_hash:Tx_rollup_commitment_repr.Hash.t -> + ?tezos_head_level:Raw_level_repr.t -> + ?occupied_storage:Z.t -> + ?commitments_watermark:Tx_rollup_level_repr.t -> + allocated_storage:Z.t -> + unit -> + t + + val get_inbox_ema : t -> int + + val get_occupied_storage : t -> Z.t + + val set_occupied_storage : Z.t -> t -> t + + val get_allocated_storage : t -> Z.t + + val set_allocated_storage : Z.t -> t -> t + + val reset_commitments_watermark : t -> t + + val get_commitments_watermark : t -> Tx_rollup_level_repr.t option +end diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.ml new file mode 100644 index 000000000000..e31fa5f273fd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.ml @@ -0,0 +1,72 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Tx_rollup_errors_repr + +let init : Raw_context.t -> Tx_rollup_repr.t -> Raw_context.t tzresult Lwt.t = + fun ctxt tx_rollup -> + Storage.Tx_rollup.State.mem ctxt tx_rollup >>=? fun (ctxt, already_exists) -> + fail_when already_exists (Tx_rollup_already_exists tx_rollup) >>=? fun () -> + let pre_allocated_storage = + Z.of_int @@ Constants_storage.tx_rollup_origination_size ctxt + in + Storage.Tx_rollup.State.init ctxt tx_rollup + @@ Tx_rollup_state_repr.initial_state ~pre_allocated_storage + >|=? fst + +let find : + Raw_context.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t option) tzresult Lwt.t = + Storage.Tx_rollup.State.find + +let get : + Raw_context.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t) tzresult Lwt.t = + fun ctxt tx_rollup -> + find ctxt tx_rollup >>=? fun (ctxt, state) -> + match state with + | Some state -> return (ctxt, state) + | None -> tzfail (Tx_rollup_does_not_exist tx_rollup) + +let assert_exist : + Raw_context.t -> Tx_rollup_repr.t -> Raw_context.t tzresult Lwt.t = + fun ctxt tx_rollup -> + Storage.Tx_rollup.State.mem ctxt tx_rollup + >>=? fun (ctxt, tx_rollup_exists) -> + fail_unless tx_rollup_exists (Tx_rollup_does_not_exist tx_rollup) + >>=? fun () -> return ctxt + +let update : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Raw_context.t tzresult Lwt.t = + fun ctxt tx_rollup t -> + Storage.Tx_rollup.State.update ctxt tx_rollup t >>=? fun (ctxt, _) -> + return ctxt diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.mli new file mode 100644 index 000000000000..6c2d39204cbb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_state_storage.mli @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A collection of functions to manipulate the state of a transaction + rollup. + + Except if the contrary is explicitly stated, the functions of this + module are carbonated. *) + +(** [init ctxt tx_rollup] initializes the state of [tx_rollup]. + + Returns the error [Tx_rollup_already_exists] iff this function has + already been called for [tx_rollup], which is definitely something + that should not happen, because the protocol is expected to pick + fresh addresses when it originates new transaction rollups (and + does so by relying on the “origination nonce” derived from the + hash of the operation responsible for the origination, using the + same procedure as smart contracts). + + Raising this error would therefore indicate a bug in the + protocol. *) +val init : Raw_context.t -> Tx_rollup_repr.t -> Raw_context.t tzresult Lwt.t + +(** [find ctxt tx_rollup] returns the current state of [tx_rollup]. If + [tx_rollup] is not the address of an existing transaction rollup, + [None] is returned instead. *) +val find : + Raw_context.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t option) tzresult Lwt.t + +(** [get ctxt tx_rollup] returns the current state of [tx_rollup] in + the context. + + Returns the [Tx_rollup_does_not_exist] error iff [tx_rollup] is + not the address of an existing transaction rollup. *) +val get : + Raw_context.t -> + Tx_rollup_repr.t -> + (Raw_context.t * Tx_rollup_state_repr.t) tzresult Lwt.t + +(** [update ctxt tx_rollup new_state] replaces the stored state of + [tx_rollup] with [new_state]. *) +val update : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_state_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [assert_exist ctxt tx_rollup] fails with + [Tx_rollup_does_not_exist] when [tx_rollup] is not a valid + transaction rollup address. *) +val assert_exist : + Raw_context.t -> Tx_rollup_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.ml new file mode 100644 index 000000000000..4201c2550763 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.ml @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let fresh_tx_rollup_from_current_nonce ctxt = + Raw_context.increment_origination_nonce ctxt >|? fun (ctxt, nonce) -> + (ctxt, Tx_rollup_repr.originated_tx_rollup nonce) + +let originate ctxt = + fresh_tx_rollup_from_current_nonce ctxt >>?= fun (ctxt, tx_rollup) -> + Tx_rollup_state_storage.init ctxt tx_rollup >|=? fun ctxt -> (ctxt, tx_rollup) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.mli new file mode 100644 index 000000000000..ee3300db7153 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_storage.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** [originate context] originates a new tx rollup and returns its hash + generated from the [origination_nonce] in context. It also increment the + [origination_nonce]. *) +val originate : + Raw_context.t -> (Raw_context.t * Tx_rollup_repr.t) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.ml new file mode 100644 index 000000000000..3e455f33080b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.ml @@ -0,0 +1,54 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let prefix = Tx_rollup_prefixes.withdraw_list_hash.b58check_prefix + +module H = + Blake2B.Make + (Base58) + (struct + let name = "Withdraw_list_hash" + + let title = "A list of withdraw orders" + + let b58check_prefix = prefix + + let size = Some Tx_rollup_prefixes.withdraw_list_hash.hash_size + end) + +include H +include Path_encoding.Make_hex (H) + +let () = + Tx_rollup_prefixes.(check_encoding withdraw_list_hash b58check_encoding) + +let hash_uncarbonated l = + let bytes = + Data_encoding.( + Binary.to_bytes_exn (list Tx_rollup_withdraw_repr.encoding) l) + in + H.hash_bytes [bytes] + +let empty = hash_uncarbonated [] diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.mli new file mode 100644 index 000000000000..9126cd94d7fd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_list_hash_repr.mli @@ -0,0 +1,30 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include S.HASH + +val hash_uncarbonated : Tx_rollup_withdraw_repr.t list -> t + +val empty : t diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.ml b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.ml new file mode 100644 index 000000000000..78291161d39c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type order = { + claimer : Signature.Public_key_hash.t; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +type t = order + +let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun {claimer; ticket_hash; amount} -> (claimer, ticket_hash, amount)) + (fun (claimer, ticket_hash, amount) -> {claimer; ticket_hash; amount}) + (obj3 + (req "claimer" Signature.Public_key_hash.encoding) + (req "ticket_hash" Ticket_hash_repr.encoding) + (req "amount" Tx_rollup_l2_qty.encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.mli b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.mli new file mode 100644 index 000000000000..59d3f522c44b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/tx_rollup_withdraw_repr.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold <contact@marigold.dev> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxheadalpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A withdraw order gives right to a L1 address [claimer] to retrieve + the quantity [amount] of a ticket whose hash is [ticket_hash]. + Withdrawals result from layer-2-to-layer-1 transfers, and from + failed layer-2 deposits.*) +type order = { + claimer : Signature.Public_key_hash.t; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +type t = order + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/validate.ml b/src/proto_016_PtMumbai/lib_protocol/validate.ml new file mode 100644 index 000000000000..46f058000e41 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/validate.ml @@ -0,0 +1,3320 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Validate_errors +open Alpha_context + +(** Since the expected features of preendorsement and endorsement are + the same for all operations in the considered block, we compute + them once and for all at the begining of the block. + + See [expected_features_for_application], + [expected_features_for_construction], and + [expected_features_for_partial_construction] in the [Consensus] + module below. *) +type expected_features = { + level : Raw_level.t; + round : Round.t option; + (** This always contains a value, except for the case of + preendorsements during block construction. See + [Consensus.check_round_equal] below for its usage. *) + branch : Block_hash.t; + payload_hash : Block_payload_hash.t; +} + +type expected_preendorsement = + | Expected_preendorsement of { + expected_features : expected_features; + block_round : Round.t option; + (** During block validation or construction, we must also check that + the preendorsement round is lower than the block round. In + mempool mode, this field is [None]. *) + } + | No_locked_round_for_block_validation_preendorsement + (** A preexisting block whose fitness indicates no locked round + should contain no preendorsements. *) + | Fresh_proposal_for_construction_preendorsement + (** A constructed block with a fresh proposal should contain no + preendorsements. *) + | No_expected_branch_for_partial_construction_preendorsement of { + expected_level : Raw_level.t; + } + (** See [No_expected_branch_for_partial_construction_endorsement] below. *) + | No_predecessor_info_cannot_validate_preendorsement + (** We do not have access to predecessor level, round, etc. so any + preendorsement validation will fail. *) + +type expected_endorsement = + | Expected_endorsement of {expected_features : expected_features} + | No_expected_branch_for_block_endorsement + (** The context contains no branch: this happens to the first block + that uses the Tenderbake consensus algorithm. This block contains + no endorsements. *) + | No_expected_branch_for_partial_construction_endorsement of { + expected_level : Raw_level.t; + } + (** Same as [No_expected_branch_for_block_endorsement]. This has a + separate constructor because the error raised is distinct: in + mempool mode, we simply assume that we have received a + preendorsement for a future block to which we have not switched + yet. *) + | No_predecessor_info_cannot_validate_endorsement + (** We do not have access to predecessor level, round, etc. so any + endorsement validation will fail. *) + +type all_expected_consensus_features = { + expected_preendorsement : expected_preendorsement; + expected_endorsement : expected_endorsement; + expected_grandparent_endorsement_for_partial_construction : + expected_features option; + (** This only has a value in Mempool mode and when the [ctxt] has a + [grandparent_branch]; it is [None] in all other cases. *) +} + +type consensus_info = { + all_expected_features : all_expected_consensus_features; + preendorsement_slot_map : (Consensus_key.pk * int) Slot.Map.t; + endorsement_slot_map : (Consensus_key.pk * int) Slot.Map.t; +} + +let init_consensus_info ctxt all_expected_features = + { + all_expected_features; + preendorsement_slot_map = Consensus.allowed_preendorsements ctxt; + endorsement_slot_map = Consensus.allowed_endorsements ctxt; + } + +module Consensus_content_map = Map.Make (struct + type t = consensus_content + + let compare {slot; level; round; block_payload_hash} + { + slot = slot'; + level = level'; + round = round'; + block_payload_hash = block_payload_hash'; + } = + Compare.or_else (Raw_level.compare level level') @@ fun () -> + Compare.or_else (Slot.compare slot slot') @@ fun () -> + Compare.or_else (Round.compare round round') @@ fun () -> + Compare.or_else + (Block_payload_hash.compare block_payload_hash block_payload_hash') + @@ fun () -> 0 +end) + +type consensus_state = { + predecessor_level : Raw_level.t; + preendorsements_seen : Operation_hash.t Slot.Map.t; + endorsements_seen : Operation_hash.t Slot.Map.t; + grandparent_endorsements_seen : Operation_hash.t Slot.Map.t; + dal_attestation_seen : Operation_hash.t Signature.Public_key_hash.Map.t; +} + +let slot_map_encoding element_encoding = + let open Data_encoding in + conv + (fun slot_map -> Slot.Map.bindings slot_map) + (fun l -> Slot.Map.(List.fold_left (fun m (k, v) -> add k v m) empty l)) + (list (tup2 Slot.encoding element_encoding)) + +let consensus_state_encoding = + let open Data_encoding in + def "consensus_state" + @@ conv + (fun { + predecessor_level; + preendorsements_seen; + endorsements_seen; + grandparent_endorsements_seen; + dal_attestation_seen; + } -> + ( predecessor_level, + preendorsements_seen, + endorsements_seen, + grandparent_endorsements_seen, + dal_attestation_seen )) + (fun ( predecessor_level, + preendorsements_seen, + endorsements_seen, + grandparent_endorsements_seen, + dal_attestation_seen ) -> + { + predecessor_level; + preendorsements_seen; + endorsements_seen; + grandparent_endorsements_seen; + dal_attestation_seen; + }) + (obj5 + (req "predecessor_level" Raw_level.encoding) + (req + "preendorsements_seen" + (slot_map_encoding Operation_hash.encoding)) + (req "endorsements_seen" (slot_map_encoding Operation_hash.encoding)) + (req + "grandparent_endorsements_seen" + (slot_map_encoding Operation_hash.encoding)) + (req + "dal_attestation_seen" + (Signature.Public_key_hash.Map.encoding Operation_hash.encoding))) + +let init_consensus_state ~predecessor_level = + { + predecessor_level; + preendorsements_seen = Slot.Map.empty; + endorsements_seen = Slot.Map.empty; + grandparent_endorsements_seen = Slot.Map.empty; + dal_attestation_seen = Signature.Public_key_hash.Map.empty; + } + +type voting_state = { + proposals_seen : Operation_hash.t Signature.Public_key_hash.Map.t; + (** To each delegate that has submitted a Proposals operation in a + previously validated operation, associates the hash of this + operation. This includes Proposals from a potential Testnet + Dictator. *) + ballots_seen : Operation_hash.t Signature.Public_key_hash.Map.t; + (** To each delegate that has submitted a ballot in a previously + validated operation, associates the hash of this operation. *) +} + +let voting_state_encoding = + let open Data_encoding in + def "voting_state" + @@ conv + (fun {proposals_seen; ballots_seen} -> (proposals_seen, ballots_seen)) + (fun (proposals_seen, ballots_seen) -> {proposals_seen; ballots_seen}) + (obj2 + (req + "proposals_seen" + (Signature.Public_key_hash.Map.encoding Operation_hash.encoding)) + (req + "ballots_seen" + (Signature.Public_key_hash.Map.encoding Operation_hash.encoding))) + +module Double_baking_evidence_map = struct + include Map.Make (struct + type t = Raw_level.t * Round.t + + let compare (l, r) (l', r') = + Compare.or_else (Raw_level.compare l l') @@ fun () -> + Compare.or_else (Round.compare r r') @@ fun () -> 0 + end) + + let encoding elt_encoding = + Data_encoding.conv + (fun map -> bindings map) + (fun l -> List.fold_left (fun m (k, v) -> add k v m) empty l) + Data_encoding.( + list (tup2 (tup2 Raw_level.encoding Round.encoding) elt_encoding)) +end + +module Double_endorsing_evidence_map = struct + include Map.Make (struct + type t = Raw_level.t * Round.t * Slot.t + + let compare (l, r, s) (l', r', s') = + Compare.or_else (Raw_level.compare l l') @@ fun () -> + Compare.or_else (Round.compare r r') @@ fun () -> + Compare.or_else (Slot.compare s s') @@ fun () -> 0 + end) + + let encoding elt_encoding = + Data_encoding.conv + (fun map -> bindings map) + (fun l -> List.fold_left (fun m (k, v) -> add k v m) empty l) + Data_encoding.( + list + (tup2 + (tup3 Raw_level.encoding Round.encoding Slot.encoding) + elt_encoding)) +end + +(** State used and modified when validating anonymous operations. + These fields are used to enforce that we do not validate the same + operation multiple times. + + Note that as part of {!state}, these maps live + in memory. They are not explicitly bounded here, however: + + - In block validation mode, they are bounded by the number of + anonymous operations allowed in the block. + + - In mempool mode, bounding the number of operations in this map + is the responsability of the prevalidator on the shell side. *) +type anonymous_state = { + activation_pkhs_seen : Operation_hash.t Ed25519.Public_key_hash.Map.t; + double_baking_evidences_seen : Operation_hash.t Double_baking_evidence_map.t; + double_endorsing_evidences_seen : + Operation_hash.t Double_endorsing_evidence_map.t; + seed_nonce_levels_seen : Operation_hash.t Raw_level.Map.t; + vdf_solution_seen : Operation_hash.t option; +} + +let raw_level_map_encoding elt_encoding = + let open Data_encoding in + conv + (fun map -> Raw_level.Map.bindings map) + (fun l -> + Raw_level.Map.(List.fold_left (fun m (k, v) -> add k v m) empty l)) + (list (tup2 Raw_level.encoding elt_encoding)) + +let anonymous_state_encoding = + let open Data_encoding in + def "anonymous_state" + @@ conv + (fun { + activation_pkhs_seen; + double_baking_evidences_seen; + double_endorsing_evidences_seen; + seed_nonce_levels_seen; + vdf_solution_seen; + } -> + ( activation_pkhs_seen, + double_baking_evidences_seen, + double_endorsing_evidences_seen, + seed_nonce_levels_seen, + vdf_solution_seen )) + (fun ( activation_pkhs_seen, + double_baking_evidences_seen, + double_endorsing_evidences_seen, + seed_nonce_levels_seen, + vdf_solution_seen ) -> + { + activation_pkhs_seen; + double_baking_evidences_seen; + double_endorsing_evidences_seen; + seed_nonce_levels_seen; + vdf_solution_seen; + }) + (obj5 + (req + "activation_pkhs_seen" + (Ed25519.Public_key_hash.Map.encoding Operation_hash.encoding)) + (req + "double_baking_evidences_seen" + (Double_baking_evidence_map.encoding Operation_hash.encoding)) + (req + "double_endorsing_evidences_seen" + (Double_endorsing_evidence_map.encoding Operation_hash.encoding)) + (req + "seed_nonce_levels_seen" + (raw_level_map_encoding Operation_hash.encoding)) + (opt "vdf_solution_seen" Operation_hash.encoding)) + +let empty_anonymous_state = + { + activation_pkhs_seen = Ed25519.Public_key_hash.Map.empty; + double_baking_evidences_seen = Double_baking_evidence_map.empty; + double_endorsing_evidences_seen = Double_endorsing_evidence_map.empty; + seed_nonce_levels_seen = Raw_level.Map.empty; + vdf_solution_seen = None; + } + +(** Static information used to validate manager operations. *) +type manager_info = { + hard_storage_limit_per_operation : Z.t; + hard_gas_limit_per_operation : Gas.Arith.integral; +} + +let init_manager_info ctxt = + { + hard_storage_limit_per_operation = + Constants.hard_storage_limit_per_operation ctxt; + hard_gas_limit_per_operation = Constants.hard_gas_limit_per_operation ctxt; + } + +(** State used and modified when validating manager operations. *) +type manager_state = { + managers_seen : Operation_hash.t Signature.Public_key_hash.Map.t; + (** To enforce the one-operation-per manager-per-block restriction + (1M). The operation hash lets us indicate the conflicting + operation in the {!Manager_restriction} error. + + Note that as part of {!state}, this map + lives in memory. It is not explicitly bounded here, however: + + - In block validation mode, it is bounded by the number of + manager operations allowed in the block. + + - In mempool mode, bounding the number of operations in this + map is the responsability of the mempool. (E.g. the plugin used + by Octez has a [max_prechecked_manager_operations] parameter to + ensure this.) *) +} + +let manager_state_encoding = + let open Data_encoding in + def "manager_state" + @@ conv + (fun {managers_seen} -> managers_seen) + (fun managers_seen -> {managers_seen}) + (obj1 + (req + "managers_seen" + (Signature.Public_key_hash.Map.encoding Operation_hash.encoding))) + +let empty_manager_state = {managers_seen = Signature.Public_key_hash.Map.empty} + +(** Mode-dependent information needed in final checks. *) +type block_finalization_info = { + fitness : Fitness.t; + block_producer : Consensus_key.pk; + payload_producer : Consensus_key.pk; + predecessor_hash : Block_hash.t; + block_data_contents : Block_header.contents; +} + +(** Circumstances in which operations are validated, and corresponding + information. + + - [Application] is used for the validation of a preexisting block, + often in preparation for its future application. + + - [Partial_validation] is used to quickly but partially validate a + preexisting block, e.g. to quickly decide whether an alternate + branch seems viable. In this mode, the initial {!type:context} may + come from an ancestor block instead of the predecessor block. Only + consensus operations are validated in this mode. + + - [Construction] is used for the construction of a new block. + + - [Mempool] is used by the {!module:Mempool} and by the + [Partial_construction] mode in {!module:Main}, which may itself be + used by RPCs or by another mempool implementation. (The [Mempool] + mode is also used by the plugin.) + + If you add a new mode, please make sure that it has a way to bound + the size of the map {!recfield:manager_state.managers_seen}. *) +type mode = + | Application of block_finalization_info + | Partial_validation of block_finalization_info + | Construction of { + predecessor_round : Round.t; + predecessor_hash : Block_hash.t; + round : Round.t; + block_data_contents : Block_header.contents; + block_producer : Consensus_key.pk; + payload_producer : Consensus_key.pk; + } + | Mempool + +(** {2 Definition and initialization of [info] and [state]} *) + +type info = { + ctxt : t; (** The context at the beginning of the block or mempool. *) + mode : mode; + chain_id : Chain_id.t; (** Needed for signature checks. *) + current_level : Level.t; + consensus_info : consensus_info; + manager_info : manager_info; +} + +type operation_conflict_state = { + consensus_state : consensus_state; + voting_state : voting_state; + anonymous_state : anonymous_state; + manager_state : manager_state; +} + +let operation_conflict_state_encoding = + let open Data_encoding in + def "operation_conflict_state" + @@ conv + (fun {consensus_state; voting_state; anonymous_state; manager_state} -> + (consensus_state, voting_state, anonymous_state, manager_state)) + (fun (consensus_state, voting_state, anonymous_state, manager_state) -> + {consensus_state; voting_state; anonymous_state; manager_state}) + (obj4 + (req "consensus_state" consensus_state_encoding) + (req "voting_state" voting_state_encoding) + (req "anonymous_state" anonymous_state_encoding) + (req "manager_state" manager_state_encoding)) + +type block_state = { + op_count : int; + remaining_block_gas : Gas.Arith.fp; + recorded_operations_rev : Operation_hash.t list; + last_op_validation_pass : int option; + locked_round_evidence : (Round.t * int) option; + endorsement_power : int; +} + +type validation_state = { + info : info; + operation_state : operation_conflict_state; + block_state : block_state; +} + +let ok_unit = Result_syntax.return_unit + +let init_info ctxt mode chain_id all_expected_consensus_characteristics = + { + ctxt; + mode; + chain_id; + current_level = Level.current ctxt; + consensus_info = + init_consensus_info ctxt all_expected_consensus_characteristics; + manager_info = init_manager_info ctxt; + } + +let empty_voting_state = + { + proposals_seen = Signature.Public_key_hash.Map.empty; + ballots_seen = Signature.Public_key_hash.Map.empty; + } + +let init_operation_conflict_state ~predecessor_level = + { + consensus_state = init_consensus_state ~predecessor_level; + voting_state = empty_voting_state; + anonymous_state = empty_anonymous_state; + manager_state = empty_manager_state; + } + +let init_block_state vi = + { + op_count = 0; + remaining_block_gas = + Gas.Arith.fp (Constants.hard_gas_limit_per_block vi.ctxt); + recorded_operations_rev = []; + last_op_validation_pass = None; + locked_round_evidence = None; + endorsement_power = 0; + } + +let get_initial_ctxt {info; _} = info.ctxt + +(** Validation of consensus operations (validation pass [0]): + preendorsement, endorsement, and dal_attestation. *) +module Consensus = struct + let expected_endorsement_features ~predecessor_level ~predecessor_round branch + payload_hash = + { + level = predecessor_level.Level.level; + round = Some predecessor_round; + branch; + payload_hash; + } + + (** Expected endorsement features for all modes in which a block is + considered: application, partial validation, and construction. *) + let expected_endorsement_for_block ctxt ~predecessor_level ~predecessor_round + : expected_endorsement = + match Consensus.endorsement_branch ctxt with + | None -> No_expected_branch_for_block_endorsement + | Some (branch, payload_hash) -> + let expected_features = + expected_endorsement_features + ~predecessor_level + ~predecessor_round + branch + payload_hash + in + Expected_endorsement {expected_features} + + (** Retrieve the expected consensus features for both application and + partial validation modes. *) + let expected_features_for_application ctxt fitness payload_hash + ~predecessor_level ~predecessor_round ~predecessor_hash = + let expected_preendorsement = + match Fitness.locked_round fitness with + | None -> No_locked_round_for_block_validation_preendorsement + | Some locked_round -> + let expected_features = + { + level = (Level.current ctxt).level; + round = Some locked_round; + branch = predecessor_hash; + payload_hash; + } + in + let block_round = Some (Fitness.round fitness) in + Expected_preendorsement {expected_features; block_round} + in + let expected_endorsement = + expected_endorsement_for_block ctxt ~predecessor_level ~predecessor_round + in + { + expected_preendorsement; + expected_endorsement; + expected_grandparent_endorsement_for_partial_construction = None; + } + + let expected_features_for_construction ctxt round payload_hash + ~predecessor_level ~predecessor_round ~predecessor_hash = + let expected_preendorsement = + if Block_payload_hash.(payload_hash = zero) then + (* When the proposal is fresh, a fake [payload_hash] of [zero] + has been provided. In this case, the block should not + contain any preendorsements. *) + Fresh_proposal_for_construction_preendorsement + else + let expected_features = + { + level = (Level.current ctxt).level; + round = None; + branch = predecessor_hash; + payload_hash; + } + in + Expected_preendorsement {expected_features; block_round = Some round} + in + let expected_endorsement = + expected_endorsement_for_block ctxt ~predecessor_level ~predecessor_round + in + { + expected_preendorsement; + expected_endorsement; + expected_grandparent_endorsement_for_partial_construction = None; + } + + let expected_features_for_partial_construction ctxt ~predecessor_level + ~predecessor_round ~grandparent_round = + let expected_preendorsement, expected_endorsement = + match Consensus.endorsement_branch ctxt with + | None -> + let expected_level = predecessor_level.Level.level in + ( No_expected_branch_for_partial_construction_preendorsement + {expected_level}, + No_expected_branch_for_partial_construction_endorsement + {expected_level} ) + | Some (branch, payload_hash) -> + let expected_features = + expected_endorsement_features + ~predecessor_level + ~predecessor_round + branch + payload_hash + in + ( Expected_preendorsement {expected_features; block_round = None}, + Expected_endorsement {expected_features} ) + in + let expected_grandparent_endorsement_for_partial_construction = + match + ( Consensus.grand_parent_branch ctxt, + Raw_level.pred predecessor_level.level ) + with + | None, _ | _, None -> None + | Some (branch, payload_hash), Some level -> + Some {level; round = Some grandparent_round; branch; payload_hash} + in + { + expected_preendorsement; + expected_endorsement; + expected_grandparent_endorsement_for_partial_construction; + } + + open Validate_errors.Consensus + + let check_frozen_deposits_are_positive ctxt delegate_pkh = + let open Lwt_result_syntax in + let* frozen_deposits = Delegate.frozen_deposits ctxt delegate_pkh in + fail_unless + Tez.(frozen_deposits.current_amount > zero) + (Zero_frozen_deposits delegate_pkh) + + let check_level_equal kind expected_features + (consensus_content : consensus_content) = + let expected = expected_features.level in + let provided = consensus_content.level in + error_unless + (Raw_level.equal expected provided) + (if Raw_level.(expected > provided) then + Consensus_operation_for_old_level {kind; expected; provided} + else Consensus_operation_for_future_level {kind; expected; provided}) + + let check_round kind expected (consensus_content : consensus_content) = + let provided = consensus_content.round in + error_unless + (Round.equal expected provided) + (if Round.(expected > provided) then + Consensus_operation_for_old_round {kind; expected; provided} + else Consensus_operation_for_future_round {kind; expected; provided}) + + let check_round_equal kind expected_features + (consensus_content : consensus_content) = + match expected_features.round with + | Some expected -> check_round kind expected consensus_content + | None -> ok_unit + + let check_branch_equal kind expected_features (operation : 'a operation) = + let expected = expected_features.branch in + let provided = operation.shell.branch in + error_unless + (Block_hash.equal expected provided) + (Wrong_consensus_operation_branch {kind; expected; provided}) + + let check_payload_hash_equal kind expected_features + (consensus_content : consensus_content) = + let expected = expected_features.payload_hash in + let provided = consensus_content.block_payload_hash in + error_unless + (Block_payload_hash.equal expected provided) + (Wrong_payload_hash_for_consensus_operation {kind; expected; provided}) + + let check_consensus_features kind (expected : expected_features) + (consensus_content : consensus_content) (operation : 'a operation) = + let open Result_syntax in + let* () = check_level_equal kind expected consensus_content in + let* () = check_round_equal kind expected consensus_content in + let* () = check_branch_equal kind expected operation in + check_payload_hash_equal kind expected consensus_content + + let get_expected_preendorsements_features consensus_info consensus_content = + match consensus_info.all_expected_features.expected_preendorsement with + | Expected_preendorsement {expected_features; block_round} -> + ok (expected_features, block_round) + | No_locked_round_for_block_validation_preendorsement + | Fresh_proposal_for_construction_preendorsement -> + error Unexpected_preendorsement_in_block + | No_expected_branch_for_partial_construction_preendorsement + {expected_level} -> + error + (Consensus_operation_for_future_level + { + kind = Preendorsement; + expected = expected_level; + provided = consensus_content.Alpha_context.level; + }) + | No_predecessor_info_cannot_validate_preendorsement -> + error Consensus_operation_not_allowed + + let check_round_not_too_high ~block_round ~provided = + match block_round with + | None -> ok_unit + | Some block_round -> + error_unless + Round.(provided < block_round) + (Preendorsement_round_too_high {block_round; provided}) + + let get_delegate_details slot_map kind consensus_content = + Result.of_option + (Slot.Map.find consensus_content.slot slot_map) + ~error:(trace_of_error (Wrong_slot_used_for_consensus_operation {kind})) + + let check_preendorsement vi ~check_signature + (operation : Kind.preendorsement operation) = + let open Lwt_result_syntax in + let (Single (Preendorsement consensus_content)) = + operation.protocol_data.contents + in + let kind = Preendorsement in + let*? expected_features, block_round = + get_expected_preendorsements_features vi.consensus_info consensus_content + in + let*? () = + check_round_not_too_high ~block_round ~provided:consensus_content.round + in + let*? () = + check_consensus_features + kind + expected_features + consensus_content + operation + in + let*? consensus_key, voting_power = + get_delegate_details + vi.consensus_info.preendorsement_slot_map + kind + consensus_content + in + let* () = + check_frozen_deposits_are_positive vi.ctxt consensus_key.delegate + in + let*? () = + if check_signature then + Operation.check_signature + consensus_key.consensus_pk + vi.chain_id + operation + else ok_unit + in + return voting_power + + let check_preendorsement_conflict vs oph (op : Kind.preendorsement operation) + = + let (Single (Preendorsement consensus_content)) = + op.protocol_data.contents + in + match + Slot.Map.find_opt + consensus_content.slot + vs.consensus_state.preendorsements_seen + with + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + | None -> ok_unit + + let wrap_preendorsement_conflict = function + | Ok () -> ok_unit + | Error conflict -> + error + Validate_errors.Consensus.( + Conflicting_consensus_operation {kind = Preendorsement; conflict}) + + let add_preendorsement vs oph (op : Kind.preendorsement operation) = + let (Single (Preendorsement consensus_content)) = + op.protocol_data.contents + in + let preendorsements_seen = + Slot.Map.add + consensus_content.slot + oph + vs.consensus_state.preendorsements_seen + in + {vs with consensus_state = {vs.consensus_state with preendorsements_seen}} + + let may_update_locked_round_evidence block_state mode + (consensus_content : consensus_content) voting_power = + let locked_round_evidence = + match mode with + | Mempool -> None + | Application _ | Partial_validation _ | Construction _ -> ( + match block_state.locked_round_evidence with + | None -> Some (consensus_content.round, voting_power) + | Some (_stored_round, evidences) -> + (* [_stored_round] is always equal to [consensus_content.round]. + Indeed, this is ensured by {!check_round_equal} in + application and partial validation modes, and by + {!check_construction_preendorsement_round_consistency} in + construction mode. *) + Some (consensus_content.round, evidences + voting_power)) + in + {block_state with locked_round_evidence} + + (* Hypothesis: this function will only be called in mempool mode *) + let remove_preendorsement vs (operation : Kind.preendorsement operation) = + (* As we are in mempool mode, we do not update + [locked_round_evidence]. *) + let (Single (Preendorsement consensus_content)) = + operation.protocol_data.contents + in + let preendorsements_seen = + Slot.Map.remove + consensus_content.slot + vs.consensus_state.preendorsements_seen + in + {vs with consensus_state = {vs.consensus_state with preendorsements_seen}} + + (** Validate an endorsement pointing to the grandparent block. This + function will only be called in [Partial_construction] mode. *) + let check_grandparent_endorsement vi ~check_signature expected operation + (consensus_content : consensus_content) = + let open Lwt_result_syntax in + let kind = Grandparent_endorsement in + let level = Level.from_raw vi.ctxt consensus_content.level in + let* (_ctxt : t), consensus_key = + Stake_distribution.slot_owner vi.ctxt level consensus_content.slot + in + let*? () = + check_consensus_features kind expected consensus_content operation + in + let*? () = + if check_signature then + Operation.check_signature + consensus_key.consensus_pk + vi.chain_id + operation + else ok_unit + in + return_unit + + let add_grandparent_endorsement vs oph (consensus_content : consensus_content) + = + { + vs with + consensus_state = + { + vs.consensus_state with + grandparent_endorsements_seen = + Slot.Map.add + consensus_content.slot + oph + vs.consensus_state.grandparent_endorsements_seen; + }; + } + + let check_grandparent_endorsement_conflict vs oph + (consensus_content : consensus_content) = + match + Slot.Map.find_opt + consensus_content.slot + vs.consensus_state.grandparent_endorsements_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let remove_grandparent_endorsement vs (consensus_content : consensus_content) + = + let grandparent_endorsements_seen = + Slot.Map.remove + consensus_content.slot + vs.consensus_state.grandparent_endorsements_seen + in + { + vs with + consensus_state = {vs.consensus_state with grandparent_endorsements_seen}; + } + + let get_expected_endorsements_features consensus_info consensus_content = + match consensus_info.all_expected_features.expected_endorsement with + | Expected_endorsement {expected_features} -> ok expected_features + | No_expected_branch_for_block_endorsement -> + error Unexpected_endorsement_in_block + | No_expected_branch_for_partial_construction_endorsement {expected_level} + -> + error + (Consensus_operation_for_future_level + { + kind = Endorsement; + expected = expected_level; + provided = consensus_content.Alpha_context.level; + }) + | No_predecessor_info_cannot_validate_endorsement -> + error Consensus_operation_not_allowed + + type endorsement_kind = Grandparent_endorsement | Normal_endorsement of int + + (** Validate an endorsement pointing to the predecessor, aka a + "normal" endorsement. Only this kind of endorsement may be found + during block validation or construction. *) + let check_normal_endorsement vi ~check_signature + (operation : Kind.endorsement operation) = + let open Lwt_result_syntax in + let (Single (Endorsement consensus_content)) = + operation.protocol_data.contents + in + let kind = Endorsement in + let*? expected_features = + get_expected_endorsements_features vi.consensus_info consensus_content + in + let*? () = + check_consensus_features + kind + expected_features + consensus_content + operation + in + let*? consensus_key, voting_power = + get_delegate_details + vi.consensus_info.endorsement_slot_map + kind + consensus_content + in + let* () = + check_frozen_deposits_are_positive vi.ctxt consensus_key.delegate + in + let*? () = + if check_signature then + Operation.check_signature + consensus_key.consensus_pk + vi.chain_id + operation + else ok_unit + in + return voting_power + + let check_normal_endorsement_conflict vs oph + (consensus_content : consensus_content) = + match + Slot.Map.find_opt + consensus_content.slot + vs.consensus_state.endorsements_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let add_normal_endorsement vs oph (consensus_content : consensus_content) = + { + vs with + consensus_state = + { + vs.consensus_state with + endorsements_seen = + Slot.Map.add + consensus_content.slot + oph + vs.consensus_state.endorsements_seen; + }; + } + + (* Hypothesis: this function will only be called in mempool mode *) + let remove_normal_endorsement vs (consensus_content : consensus_content) = + (* We do not remove the endorsement power because it is not + relevant for the mempool mode. *) + let endorsements_seen = + Slot.Map.remove + consensus_content.slot + vs.consensus_state.endorsements_seen + in + {vs with consensus_state = {vs.consensus_state with endorsements_seen}} + + let check_endorsement vi ~check_signature + (operation : Kind.endorsement operation) = + let open Lwt_result_syntax in + let (Single (Endorsement consensus_content)) = + operation.protocol_data.contents + in + match + vi.consensus_info.all_expected_features + .expected_grandparent_endorsement_for_partial_construction + with + | Some expected_grandparent_endorsement + when Raw_level.( + consensus_content.level = expected_grandparent_endorsement.level) + -> + let* () = + check_grandparent_endorsement + vi + ~check_signature + expected_grandparent_endorsement + operation + (consensus_content : consensus_content) + in + return Grandparent_endorsement + | _ -> + let* voting_power = + check_normal_endorsement vi ~check_signature operation + in + return (Normal_endorsement voting_power) + + let is_normal_endorsement_assuming_valid vs + (consensus_content : consensus_content) = + Raw_level.equal vs.consensus_state.predecessor_level consensus_content.level + + let check_endorsement_conflict vs oph (operation : Kind.endorsement operation) + = + let (Single (Endorsement consensus_content)) = + operation.protocol_data.contents + in + if is_normal_endorsement_assuming_valid vs consensus_content then + check_normal_endorsement_conflict vs oph consensus_content + else check_grandparent_endorsement_conflict vs oph consensus_content + + let wrap_endorsement_conflict = function + | Ok () -> ok_unit + | Error conflict -> + error + Validate_errors.Consensus.( + Conflicting_consensus_operation {kind = Endorsement; conflict}) + + let add_endorsement vs oph (op : Kind.endorsement operation) endorsement_kind + = + let (Single (Endorsement consensus_content)) = op.protocol_data.contents in + match endorsement_kind with + | Grandparent_endorsement -> + add_grandparent_endorsement vs oph consensus_content + | Normal_endorsement _voting_power -> + add_normal_endorsement vs oph consensus_content + + let may_update_endorsement_power block_state = function + | Grandparent_endorsement -> block_state + | Normal_endorsement voting_power -> + { + block_state with + endorsement_power = block_state.endorsement_power + voting_power; + } + + let remove_endorsement vs (op : Kind.endorsement operation) = + let (Single (Endorsement consensus_content)) = op.protocol_data.contents in + if is_normal_endorsement_assuming_valid vs consensus_content then + remove_normal_endorsement vs consensus_content + else remove_grandparent_endorsement vs consensus_content + + let check_dal_attestation vi (operation : Kind.dal_attestation operation) = + (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3115 + This is a temporary operation. Some checks are missing for the + moment. In particular, the signature is not + checked. Consequently, it is really important to ensure this + operation cannot be included into a block when the feature flag + is not set. This is done in order to avoid modifying the + endorsement encoding. However, once the DAL is ready, this + operation should be merged with an endorsement or at least + refined. *) + let open Lwt_result_syntax in + let (Single (Dal_attestation op)) = operation.protocol_data.contents in + let*? () = + (* Note that this function checks the dal feature flag. *) + Dal_apply.validate_attestation vi.ctxt op + in + return_unit + + let check_dal_attestation_conflict vs oph + (operation : Kind.dal_attestation operation) = + let (Single (Dal_attestation {attestor; attestation = _; level = _})) = + operation.protocol_data.contents + in + match + Signature.Public_key_hash.Map.find_opt + attestor + vs.consensus_state.dal_attestation_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_dal_attestation_conflict = function + | Ok () -> ok_unit + | Error conflict -> + error + Validate_errors.Consensus.( + Conflicting_consensus_operation {kind = Dal_attestation; conflict}) + + let add_dal_attestation vs oph (operation : Kind.dal_attestation operation) = + let (Single (Dal_attestation {attestor; attestation = _; level = _})) = + operation.protocol_data.contents + in + { + vs with + consensus_state = + { + vs.consensus_state with + dal_attestation_seen = + Signature.Public_key_hash.Map.add + attestor + oph + vs.consensus_state.dal_attestation_seen; + }; + } + + let remove_dal_attestation vs (operation : Kind.dal_attestation operation) = + let (Single (Dal_attestation {attestor; attestation = _; level = _})) = + operation.protocol_data.contents + in + let dal_attestation_seen = + Signature.Public_key_hash.Map.remove + attestor + vs.consensus_state.dal_attestation_seen + in + {vs with consensus_state = {vs.consensus_state with dal_attestation_seen}} + + let check_construction_preendorsement_round_consistency vi block_state kind + (consensus_content : consensus_content) = + let open Result_syntax in + let* expected_features, _block_round = + get_expected_preendorsements_features vi.consensus_info consensus_content + in + match expected_features.round with + | Some _ -> + (* When [expected_features.round] has a value (ie. in + application and partial validation modes when the block + fitness has a [locked_round], and always in mempool mode), + [check_preendorsement] already checks that all + preendorsements have this expected round, so checking + anything here would be redundant. Also note that when the + fitness contains no [locked_round], this code is + unreachable because [get_expected_preendorsements_features] + returns an error. *) + return_unit + | None -> ( + (* For preendorsements in block construction mode, + [expected_features.round] has been set to [None] because we + could not know yet whether there is a locked round. *) + match block_state.locked_round_evidence with + | None -> + (* This is the first validated preendorsement in + construction mode: there is nothing to check. *) + return_unit + | Some (expected, _power) -> + (* Other preendorsements have already been validated: we + check that the current operation has the same round as + them. *) + check_round kind expected consensus_content) + + let validate_preendorsement ~check_signature info operation_state block_state + oph (operation : Kind.preendorsement operation) = + let open Lwt_result_syntax in + let (Single (Preendorsement consensus_content)) = + operation.protocol_data.contents + in + let* voting_power = check_preendorsement info ~check_signature operation in + let*? () = + check_construction_preendorsement_round_consistency + info + block_state + Preendorsement + consensus_content + in + let*? () = + check_preendorsement_conflict operation_state oph operation + |> wrap_preendorsement_conflict + in + (* We need to update the block state *) + let block_state = + may_update_locked_round_evidence + block_state + info.mode + consensus_content + voting_power + in + let operation_state = add_preendorsement operation_state oph operation in + return {info; operation_state; block_state} + + let validate_endorsement ~check_signature info operation_state block_state oph + operation = + let open Lwt_result_syntax in + let* kind = check_endorsement info ~check_signature operation in + let*? () = + check_endorsement_conflict operation_state oph operation + |> wrap_endorsement_conflict + in + let block_state = may_update_endorsement_power block_state kind in + let operation_state = add_endorsement operation_state oph operation kind in + return {info; operation_state; block_state} +end + +(** {2 Validation of voting operations} + + There are two kinds of voting operations: + + - Proposals: A delegate submits a list of protocol amendment + proposals. This operation is only accepted during a Proposal period + (see above). + + - Ballot: A delegate casts a vote for/against the current proposal + (or pass). This operation is only accepted during an Exploration + or Promotion period (see above). *) + +module Voting = struct + open Validate_errors.Voting + + let check_period_index ~expected period_index = + error_unless + Compare.Int32.(expected = period_index) + (Wrong_voting_period_index {expected; provided = period_index}) + + let check_proposals_source_is_registered ctxt source = + let open Lwt_result_syntax in + let*! is_registered = Delegate.registered ctxt source in + fail_unless is_registered (Proposals_from_unregistered_delegate source) + + (** Check that the list of proposals is not empty and does not contain + duplicates. *) + let check_proposal_list_sanity proposals = + let open Result_syntax in + let* () = + match proposals with [] -> error Empty_proposals | _ :: _ -> ok_unit + in + let* (_ : Protocol_hash.Set.t) = + List.fold_left_e + (fun previous_elements proposal -> + let* () = + error_when + (Protocol_hash.Set.mem proposal previous_elements) + (Proposals_contain_duplicate {proposal}) + in + return (Protocol_hash.Set.add proposal previous_elements)) + Protocol_hash.Set.empty + proposals + in + return_unit + + let check_period_kind_for_proposals current_period = + match current_period.Voting_period.kind with + | Proposal -> ok_unit + | (Exploration | Cooldown | Promotion | Adoption) as current -> + error (Wrong_voting_period_kind {current; expected = [Proposal]}) + + let check_in_listings ctxt source = + let open Lwt_result_syntax in + let*! in_listings = Vote.in_listings ctxt source in + fail_unless in_listings Source_not_in_vote_listings + + let check_count ~count_in_ctxt ~proposals_length = + (* The proposal count of the proposer in the context should never + have been increased above [max_proposals_per_delegate]. *) + assert (Compare.Int.(count_in_ctxt <= Constants.max_proposals_per_delegate)) ; + error_unless + Compare.Int.( + count_in_ctxt + proposals_length <= Constants.max_proposals_per_delegate) + (Too_many_proposals + {previous_count = count_in_ctxt; operation_count = proposals_length}) + + let check_already_proposed ctxt proposer proposals = + let open Lwt_result_syntax in + List.iter_es + (fun proposal -> + let*! already_proposed = Vote.has_proposed ctxt proposer proposal in + fail_when already_proposed (Already_proposed {proposal})) + proposals + + (** Check that the [apply_testnet_dictator_proposals] function in + {!module:Amendment} will not fail. + + The current function is designed to be exclusively called by + [check_proposals] right below. + + @return [Error Testnet_dictator_multiple_proposals] if + [proposals] has more than one element. *) + let check_testnet_dictator_proposals chain_id proposals = + (* This assertion should be ensured by the fact that + {!Amendment.is_testnet_dictator} cannot be [true] on mainnet + (so the current function cannot be called there). However, we + still double check it because of its criticality. *) + assert (Chain_id.(chain_id <> Constants.mainnet_id)) ; + match proposals with + | [] | [_] -> + (* In [Amendment.apply_testnet_dictator_proposals], the call to + {!Vote.init_current_proposal} (in the singleton list case) + cannot fail because {!Vote.clear_current_proposal} is called + right before. + + The calls to + {!Voting_period.Testnet_dictator.overwrite_current_kind} may + usually fail when the voting period is not + initialized. However, this cannot happen here because the + current function is only called in [check_proposals] after a + successful call to {!Voting_period.get_current}. *) + ok_unit + | _ :: _ :: _ -> error Testnet_dictator_multiple_proposals + + (** Check that a Proposals operation can be safely applied. + + @return [Error Wrong_voting_period_index] if the operation's + period and the current period in the {!type:context} do not have + the same index. + + @return [Error Proposals_from_unregistered_delegate] if the + source is not a registered delegate. + + @return [Error Empty_proposals] if the list of proposals is empty. + + @return [Error Proposals_contain_duplicate] if the list of + proposals contains a duplicate element. + + @return [Error Wrong_voting_period_kind] if the voting period is + not of the Proposal kind. + + @return [Error Source_not_in_vote_listings] if the source is not + in the vote listings. + + @return [Error Too_many_proposals] if the operation causes the + source's total number of proposals during the current voting + period to exceed {!Constants.max_proposals_per_delegate}. + + @return [Error Already_proposed] if one of the proposals has + already been proposed by the source in the current voting period. + + @return [Error Testnet_dictator_multiple_proposals] if the + source is a testnet dictator and the operation contains more than + one proposal. + + @return [Error Operation.Missing_signature] or [Error + Operation.Invalid_signature] if the operation is unsigned or + incorrectly signed. *) + let check_proposals vi ~check_signature (operation : Kind.proposals operation) + = + let open Lwt_result_syntax in + let (Single (Proposals {source; period; proposals})) = + operation.protocol_data.contents + in + let* current_period = Voting_period.get_current vi.ctxt in + let*? () = check_period_index ~expected:current_period.index period in + let* () = + if Amendment.is_testnet_dictator vi.ctxt vi.chain_id source then + let*? () = check_testnet_dictator_proposals vi.chain_id proposals in + return_unit + else + let* () = check_proposals_source_is_registered vi.ctxt source in + let*? () = check_proposal_list_sanity proposals in + let*? () = check_period_kind_for_proposals current_period in + let* () = check_in_listings vi.ctxt source in + let* count_in_ctxt = Vote.get_delegate_proposal_count vi.ctxt source in + let proposals_length = List.length proposals in + let*? () = check_count ~count_in_ctxt ~proposals_length in + check_already_proposed vi.ctxt source proposals + in + if check_signature then + (* Retrieving the public key should not fail as it *should* be + called after checking that the delegate is in the vote + listings (or is a testnet dictator), which implies that it + is a manager with a revealed key. *) + let* public_key = Contract.get_manager_key vi.ctxt source in + Lwt.return (Operation.check_signature public_key vi.chain_id operation) + else return_unit + + (** Check that a Proposals operation is compatible with previously + validated operations in the current block/mempool. + + @return [Error Operation_conflict] if the current block/mempool + already contains a Proposals operation from the same source + (regardless of whether this source is a testnet dictator or an + ordinary manager). *) + let check_proposals_conflict vs oph (operation : Kind.proposals operation) = + let open Result_syntax in + let (Single (Proposals {source; _})) = operation.protocol_data.contents in + match + Signature.Public_key_hash.Map.find_opt + source + vs.voting_state.proposals_seen + with + | None -> return_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_proposals_conflict = function + | Ok () -> ok_unit + | Error conflict -> + error Validate_errors.Voting.(Conflicting_proposals conflict) + + let add_proposals vs oph (operation : Kind.proposals operation) = + let (Single (Proposals {source; _})) = operation.protocol_data.contents in + let proposals_seen = + Signature.Public_key_hash.Map.add + source + oph + vs.voting_state.proposals_seen + in + let voting_state = {vs.voting_state with proposals_seen} in + {vs with voting_state} + + let remove_proposals vs (operation : Kind.proposals operation) = + let (Single (Proposals {source; _})) = operation.protocol_data.contents in + let proposals_seen = + Signature.Public_key_hash.Map.remove source vs.voting_state.proposals_seen + in + {vs with voting_state = {vs.voting_state with proposals_seen}} + + let check_ballot_source_is_registered ctxt source = + let open Lwt_result_syntax in + let*! is_registered = Delegate.registered ctxt source in + fail_unless is_registered (Ballot_from_unregistered_delegate source) + + let check_period_kind_for_ballot current_period = + match current_period.Voting_period.kind with + | Exploration | Promotion -> ok_unit + | (Cooldown | Proposal | Adoption) as current -> + error + (Wrong_voting_period_kind + {current; expected = [Exploration; Promotion]}) + + let check_current_proposal ctxt op_proposal = + let open Lwt_result_syntax in + let* current_proposal = Vote.get_current_proposal ctxt in + fail_unless + (Protocol_hash.equal op_proposal current_proposal) + (Ballot_for_wrong_proposal + {current = current_proposal; submitted = op_proposal}) + + let check_source_has_not_already_voted ctxt source = + let open Lwt_result_syntax in + let*! has_ballot = Vote.has_recorded_ballot ctxt source in + fail_when has_ballot Already_submitted_a_ballot + + (** Check that a Ballot operation can be safely applied. + + @return [Error Ballot_from_unregistered_delegate] if the source + is not a registered delegate. + + @return [Error Wrong_voting_period_index] if the operation's + period and the current period in the {!type:context} do not have + the same index. + + @return [Error Wrong_voting_period_kind] if the voting period is + not of the Exploration or Promotion kind. + + @return [Error Ballot_for_wrong_proposal] if the operation's + proposal is different from the current proposal in the context. + + @return [Error Already_submitted_a_ballot] if the source has + already voted during the current voting period. + + @return [Error Source_not_in_vote_listings] if the source is not + in the vote listings. + + @return [Error Operation.Missing_signature] or [Error + Operation.Invalid_signature] if the operation is unsigned or + incorrectly signed. *) + let check_ballot vi ~check_signature (operation : Kind.ballot operation) = + let open Lwt_result_syntax in + let (Single (Ballot {source; period; proposal; ballot = _})) = + operation.protocol_data.contents + in + let* () = check_ballot_source_is_registered vi.ctxt source in + let* current_period = Voting_period.get_current vi.ctxt in + let*? () = check_period_index ~expected:current_period.index period in + let*? () = check_period_kind_for_ballot current_period in + let* () = check_current_proposal vi.ctxt proposal in + let* () = check_source_has_not_already_voted vi.ctxt source in + let* () = check_in_listings vi.ctxt source in + when_ check_signature (fun () -> + (* Retrieving the public key cannot fail. Indeed, we have + already checked that the delegate is in the vote listings, + which implies that it is a manager with a revealed key. *) + let* public_key = Contract.get_manager_key vi.ctxt source in + Lwt.return (Operation.check_signature public_key vi.chain_id operation)) + + (** Check that a Ballot operation is compatible with previously + validated operations in the current block/mempool. + + @return [Error Operation_conflict] if the current block/mempool + already contains a Ballot operation from the same source. *) + let check_ballot_conflict vs oph (operation : Kind.ballot operation) = + let (Single (Ballot {source; _})) = operation.protocol_data.contents in + match + Signature.Public_key_hash.Map.find_opt source vs.voting_state.ballots_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_ballot_conflict = function + | Ok () -> ok_unit + | Error conflict -> error (Conflicting_ballot conflict) + + let add_ballot vs oph (operation : Kind.ballot operation) = + let (Single (Ballot {source; _})) = operation.protocol_data.contents in + let ballots_seen = + Signature.Public_key_hash.Map.add source oph vs.voting_state.ballots_seen + in + let voting_state = {vs.voting_state with ballots_seen} in + {vs with voting_state} + + let remove_ballot vs (operation : Kind.ballot operation) = + let (Single (Ballot {source; _})) = operation.protocol_data.contents in + let ballots_seen = + Signature.Public_key_hash.Map.remove source vs.voting_state.ballots_seen + in + {vs with voting_state = {vs.voting_state with ballots_seen}} +end + +module Anonymous = struct + open Validate_errors.Anonymous + + let check_activate_account vi (operation : Kind.activate_account operation) = + let (Single (Activate_account {id = edpkh; activation_code})) = + operation.protocol_data.contents + in + let open Lwt_result_syntax in + let blinded_pkh = + Blinded_public_key_hash.of_ed25519_pkh activation_code edpkh + in + let*! exists = Commitment.exists vi.ctxt blinded_pkh in + let*? () = error_unless exists (Invalid_activation {pkh = edpkh}) in + return_unit + + let check_activate_account_conflict vs oph + (operation : Kind.activate_account operation) = + let (Single (Activate_account {id = edpkh; _})) = + operation.protocol_data.contents + in + match + Ed25519.Public_key_hash.Map.find_opt + edpkh + vs.anonymous_state.activation_pkhs_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_activate_account_conflict + (operation : Kind.activate_account operation) = function + | Ok () -> ok_unit + | Error conflict -> + let (Single (Activate_account {id = edpkh; _})) = + operation.protocol_data.contents + in + error (Conflicting_activation {edpkh; conflict}) + + let add_activate_account vs oph (operation : Kind.activate_account operation) + = + let (Single (Activate_account {id = edpkh; _})) = + operation.protocol_data.contents + in + let activation_pkhs_seen = + Ed25519.Public_key_hash.Map.add + edpkh + oph + vs.anonymous_state.activation_pkhs_seen + in + {vs with anonymous_state = {vs.anonymous_state with activation_pkhs_seen}} + + let remove_activate_account vs (operation : Kind.activate_account operation) = + let (Single (Activate_account {id = edpkh; _})) = + operation.protocol_data.contents + in + let activation_pkhs_seen = + Ed25519.Public_key_hash.Map.remove + edpkh + vs.anonymous_state.activation_pkhs_seen + in + {vs with anonymous_state = {vs.anonymous_state with activation_pkhs_seen}} + + let check_denunciation_age vi kind given_level = + let open Result_syntax in + let current_cycle = vi.current_level.cycle in + let given_cycle = (Level.from_raw vi.ctxt given_level).cycle in + let max_slashing_period = Constants.max_slashing_period vi.ctxt in + let last_slashable_cycle = Cycle.add given_cycle max_slashing_period in + let* () = + error_unless + Cycle.(given_cycle <= current_cycle) + (Too_early_denunciation + {kind; level = given_level; current = vi.current_level.level}) + in + error_unless + Cycle.(last_slashable_cycle > current_cycle) + (Outdated_denunciation + {kind; level = given_level; last_cycle = last_slashable_cycle}) + + let check_double_endorsing_evidence (type kind) + ~consensus_operation:denunciation_kind vi + (op1 : kind Kind.consensus Operation.t) + (op2 : kind Kind.consensus Operation.t) = + let open Lwt_result_syntax in + match (op1.protocol_data.contents, op2.protocol_data.contents) with + | Single (Preendorsement e1), Single (Preendorsement e2) + | Single (Endorsement e1), Single (Endorsement e2) -> + let op1_hash = Operation.hash op1 in + let op2_hash = Operation.hash op2 in + let*? () = + error_unless + (Raw_level.(e1.level = e2.level) + && Round.(e1.round = e2.round) + && (not + (Block_payload_hash.equal + e1.block_payload_hash + e2.block_payload_hash)) + && (* we require an order on hashes to avoid the existence of + equivalent evidences *) + Operation_hash.(op1_hash < op2_hash)) + (Invalid_denunciation denunciation_kind) + in + (* Disambiguate: levels are equal *) + let level = Level.from_raw vi.ctxt e1.level in + let*? () = check_denunciation_age vi denunciation_kind level.level in + let* ctxt, consensus_key1 = + Stake_distribution.slot_owner vi.ctxt level e1.slot + in + let* ctxt, consensus_key2 = + Stake_distribution.slot_owner ctxt level e2.slot + in + let delegate1, delegate2 = + (consensus_key1.delegate, consensus_key2.delegate) + in + let*? () = + error_unless + (Signature.Public_key_hash.equal delegate1 delegate2) + (Inconsistent_denunciation + {kind = denunciation_kind; delegate1; delegate2}) + in + let delegate_pk, delegate = (consensus_key1.consensus_pk, delegate1) in + let* already_slashed = + Delegate.already_slashed_for_double_endorsing ctxt delegate level + in + let*? () = + error_unless + (not already_slashed) + (Already_denounced {kind = denunciation_kind; delegate; level}) + in + let*? () = Operation.check_signature delegate_pk vi.chain_id op1 in + let*? () = Operation.check_signature delegate_pk vi.chain_id op2 in + return_unit + + let check_double_preendorsement_evidence vi + (operation : Kind.double_preendorsement_evidence operation) = + let (Single (Double_preendorsement_evidence {op1; op2})) = + operation.protocol_data.contents + in + check_double_endorsing_evidence + ~consensus_operation:Preendorsement + vi + op1 + op2 + + let check_double_endorsement_evidence vi + (operation : Kind.double_endorsement_evidence operation) = + let (Single (Double_endorsement_evidence {op1; op2})) = + operation.protocol_data.contents + in + check_double_endorsing_evidence ~consensus_operation:Endorsement vi op1 op2 + + let check_double_endorsing_evidence_conflict (type kind) vs oph + (op1 : kind Kind.consensus Operation.t) = + match op1.protocol_data.contents with + | Single (Preendorsement e1) | Single (Endorsement e1) -> ( + match + Double_endorsing_evidence_map.find + (e1.level, e1.round, e1.slot) + vs.anonymous_state.double_endorsing_evidences_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph})) + + let check_double_preendorsement_evidence_conflict vs oph + (operation : Kind.double_preendorsement_evidence operation) = + let (Single (Double_preendorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + check_double_endorsing_evidence_conflict vs oph op1 + + let check_double_endorsement_evidence_conflict vs oph + (operation : Kind.double_endorsement_evidence operation) = + let (Single (Double_endorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + check_double_endorsing_evidence_conflict vs oph op1 + + let wrap_denunciation_conflict kind = function + | Ok () -> ok_unit + | Error conflict -> error (Conflicting_denunciation {kind; conflict}) + + let add_double_endorsing_evidence (type kind) vs oph + (op1 : kind Kind.consensus Operation.t) = + match op1.protocol_data.contents with + | Single (Preendorsement e1) | Single (Endorsement e1) -> + let double_endorsing_evidences_seen = + Double_endorsing_evidence_map.add + (e1.level, e1.round, e1.slot) + oph + vs.anonymous_state.double_endorsing_evidences_seen + in + { + vs with + anonymous_state = + {vs.anonymous_state with double_endorsing_evidences_seen}; + } + + let add_double_endorsement_evidence vs oph + (operation : Kind.double_endorsement_evidence operation) = + let (Single (Double_endorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + add_double_endorsing_evidence vs oph op1 + + let add_double_preendorsement_evidence vs oph + (operation : Kind.double_preendorsement_evidence operation) = + let (Single (Double_preendorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + add_double_endorsing_evidence vs oph op1 + + let remove_double_endorsing_evidence (type kind) vs + (op : kind Kind.consensus Operation.t) = + match op.protocol_data.contents with + | Single (Endorsement e) | Single (Preendorsement e) -> + let double_endorsing_evidences_seen = + Double_endorsing_evidence_map.remove + (e.level, e.round, e.slot) + vs.anonymous_state.double_endorsing_evidences_seen + in + let anonymous_state = + {vs.anonymous_state with double_endorsing_evidences_seen} + in + {vs with anonymous_state} + + let remove_double_preendorsement_evidence vs + (operation : Kind.double_preendorsement_evidence operation) = + let (Single (Double_preendorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + remove_double_endorsing_evidence vs op1 + + let remove_double_endorsement_evidence vs + (operation : Kind.double_endorsement_evidence operation) = + let (Single (Double_endorsement_evidence {op1; _})) = + operation.protocol_data.contents + in + remove_double_endorsing_evidence vs op1 + + let check_double_baking_evidence vi + (operation : Kind.double_baking_evidence operation) = + let open Lwt_result_syntax in + let (Single (Double_baking_evidence {bh1; bh2})) = + operation.protocol_data.contents + in + let hash1 = Block_header.hash bh1 in + let hash2 = Block_header.hash bh2 in + let*? bh1_fitness = Fitness.from_raw bh1.shell.fitness in + let round1 = Fitness.round bh1_fitness in + let*? bh2_fitness = Fitness.from_raw bh2.shell.fitness in + let round2 = Fitness.round bh2_fitness in + let*? level1 = Raw_level.of_int32 bh1.shell.level in + let*? level2 = Raw_level.of_int32 bh2.shell.level in + let*? () = + error_unless + (Raw_level.(level1 = level2) + && Round.(round1 = round2) + && (* we require an order on hashes to avoid the existence of + equivalent evidences *) + Block_hash.(hash1 < hash2)) + (Invalid_double_baking_evidence + {hash1; level1; round1; hash2; level2; round2}) + in + let*? () = check_denunciation_age vi Block level1 in + let level = Level.from_raw vi.ctxt level1 in + let committee_size = Constants.consensus_committee_size vi.ctxt in + let*? slot1 = Round.to_slot round1 ~committee_size in + let* ctxt, consensus_key1 = + Stake_distribution.slot_owner vi.ctxt level slot1 + in + let*? slot2 = Round.to_slot round2 ~committee_size in + let* ctxt, consensus_key2 = + Stake_distribution.slot_owner ctxt level slot2 + in + let delegate1, delegate2 = + (consensus_key1.delegate, consensus_key2.delegate) + in + let*? () = + error_unless + Signature.Public_key_hash.(delegate1 = delegate2) + (Inconsistent_denunciation {kind = Block; delegate1; delegate2}) + in + let delegate_pk, delegate = (consensus_key1.consensus_pk, delegate1) in + let* already_slashed = + Delegate.already_slashed_for_double_baking ctxt delegate level + in + let*? () = + error_unless + (not already_slashed) + (Already_denounced {kind = Block; delegate; level}) + in + let*? () = Block_header.check_signature bh1 vi.chain_id delegate_pk in + let*? () = Block_header.check_signature bh2 vi.chain_id delegate_pk in + return_unit + + let check_double_baking_evidence_conflict vs oph + (operation : Kind.double_baking_evidence operation) = + let (Single (Double_baking_evidence {bh1; _})) = + operation.protocol_data.contents + in + let bh1_fitness = + Fitness.from_raw bh1.shell.fitness |> function + | Ok f -> f + | Error _ -> + (* We assume the operation valid, it cannot fail anymore *) + assert false + in + let round = Fitness.round bh1_fitness in + let level = Fitness.level bh1_fitness in + match + Double_baking_evidence_map.find + (level, round) + vs.anonymous_state.double_baking_evidences_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let add_double_baking_evidence vs oph + (operation : Kind.double_baking_evidence operation) = + let (Single (Double_baking_evidence {bh1; _})) = + operation.protocol_data.contents + in + let bh1_fitness = + Fitness.from_raw bh1.shell.fitness |> function + | Ok f -> f + | Error _ -> assert false + in + let round = Fitness.round bh1_fitness in + let level = Fitness.level bh1_fitness in + let double_baking_evidences_seen = + Double_baking_evidence_map.add + (level, round) + oph + vs.anonymous_state.double_baking_evidences_seen + in + { + vs with + anonymous_state = {vs.anonymous_state with double_baking_evidences_seen}; + } + + let remove_double_baking_evidence vs + (operation : Kind.double_baking_evidence operation) = + let (Single (Double_baking_evidence {bh1; _})) = + operation.protocol_data.contents + in + let bh1_fitness, level = + match + (Fitness.from_raw bh1.shell.fitness, Raw_level.of_int32 bh1.shell.level) + with + | Ok v, Ok v' -> (v, v') + | _ -> + (* The operation is valid therefore decoding cannot fail *) + assert false + in + let round = Fitness.round bh1_fitness in + let double_baking_evidences_seen = + Double_baking_evidence_map.remove + (level, round) + vs.anonymous_state.double_baking_evidences_seen + in + let anonymous_state = + {vs.anonymous_state with double_baking_evidences_seen} + in + {vs with anonymous_state} + + let check_drain_delegate info ~check_signature + (operation : Kind.drain_delegate Operation.t) = + let open Lwt_result_syntax in + let (Single (Drain_delegate {delegate; destination; consensus_key})) = + operation.protocol_data.contents + in + let*! is_registered = Delegate.registered info.ctxt delegate in + let* () = + fail_unless + is_registered + (Drain_delegate_on_unregistered_delegate delegate) + in + let* active_pk = Delegate.Consensus_key.active_pubkey info.ctxt delegate in + let* () = + fail_unless + (Signature.Public_key_hash.equal active_pk.consensus_pkh consensus_key) + (Invalid_drain_delegate_inactive_key + { + delegate; + consensus_key; + active_consensus_key = active_pk.consensus_pkh; + }) + in + let* () = + fail_when + (Signature.Public_key_hash.equal active_pk.consensus_pkh delegate) + (Invalid_drain_delegate_no_consensus_key delegate) + in + let* () = + fail_when + (Signature.Public_key_hash.equal destination delegate) + (Invalid_drain_delegate_noop delegate) + in + let*! is_destination_allocated = + Contract.allocated info.ctxt (Contract.Implicit destination) + in + let* balance = + Contract.get_balance info.ctxt (Contract.Implicit delegate) + in + let*? origination_burn = + if is_destination_allocated then ok Tez.zero + else + let cost_per_byte = Constants.cost_per_byte info.ctxt in + let origination_size = Constants.origination_size info.ctxt in + Tez.(cost_per_byte *? Int64.of_int origination_size) + in + let* drain_fees = + let*? one_percent = Tez.(balance /? 100L) in + return Tez.(max one one_percent) + in + let*? min_amount = Tez.(origination_burn +? drain_fees) in + let* () = + fail_when + Tez.(balance < min_amount) + (Invalid_drain_delegate_insufficient_funds_for_burn_or_fees + {delegate; destination; min_amount}) + in + let*? () = + if check_signature then + Operation.check_signature active_pk.consensus_pk info.chain_id operation + else ok_unit + in + return_unit + + let check_drain_delegate_conflict state oph + (operation : Kind.drain_delegate Operation.t) = + let (Single (Drain_delegate {delegate; _})) = + operation.protocol_data.contents + in + match + Signature.Public_key_hash.Map.find_opt + delegate + state.manager_state.managers_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_drain_delegate_conflict (operation : Kind.drain_delegate Operation.t) + = + let (Single (Drain_delegate {delegate; _})) = + operation.protocol_data.contents + in + function + | Ok () -> ok_unit + | Error conflict -> error (Conflicting_drain_delegate {delegate; conflict}) + + let add_drain_delegate state oph (operation : Kind.drain_delegate Operation.t) + = + let (Single (Drain_delegate {delegate; _})) = + operation.protocol_data.contents + in + let managers_seen = + Signature.Public_key_hash.Map.add + delegate + oph + state.manager_state.managers_seen + in + {state with manager_state = {managers_seen}} + + let remove_drain_delegate state (operation : Kind.drain_delegate Operation.t) + = + let (Single (Drain_delegate {delegate; _})) = + operation.protocol_data.contents + in + let managers_seen = + Signature.Public_key_hash.Map.remove + delegate + state.manager_state.managers_seen + in + {state with manager_state = {managers_seen}} + + let check_seed_nonce_revelation vi + (operation : Kind.seed_nonce_revelation operation) = + let open Lwt_result_syntax in + let (Single (Seed_nonce_revelation {level = commitment_raw_level; nonce})) = + operation.protocol_data.contents + in + let commitment_level = Level.from_raw vi.ctxt commitment_raw_level in + let* () = Nonce.check_unrevealed vi.ctxt commitment_level nonce in + return_unit + + let check_seed_nonce_revelation_conflict vs oph + (operation : Kind.seed_nonce_revelation operation) = + let (Single (Seed_nonce_revelation {level = commitment_raw_level; _})) = + operation.protocol_data.contents + in + match + Raw_level.Map.find_opt + commitment_raw_level + vs.anonymous_state.seed_nonce_levels_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_seed_nonce_revelation_conflict = function + | Ok () -> ok_unit + | Error conflict -> error (Conflicting_nonce_revelation conflict) + + let add_seed_nonce_revelation vs oph + (operation : Kind.seed_nonce_revelation operation) = + let (Single (Seed_nonce_revelation {level = commitment_raw_level; _})) = + operation.protocol_data.contents + in + let seed_nonce_levels_seen = + Raw_level.Map.add + commitment_raw_level + oph + vs.anonymous_state.seed_nonce_levels_seen + in + let anonymous_state = {vs.anonymous_state with seed_nonce_levels_seen} in + {vs with anonymous_state} + + let remove_seed_nonce_revelation vs + (operation : Kind.seed_nonce_revelation operation) = + let (Single (Seed_nonce_revelation {level = commitment_raw_level; _})) = + operation.protocol_data.contents + in + let seed_nonce_levels_seen = + Raw_level.Map.remove + commitment_raw_level + vs.anonymous_state.seed_nonce_levels_seen + in + let anonymous_state = {vs.anonymous_state with seed_nonce_levels_seen} in + {vs with anonymous_state} + + let check_vdf_revelation vi (operation : Kind.vdf_revelation operation) = + let open Lwt_result_syntax in + let (Single (Vdf_revelation {solution})) = + operation.protocol_data.contents + in + let* () = Seed.check_vdf vi.ctxt solution in + return_unit + + let check_vdf_revelation_conflict vs oph = + match vs.anonymous_state.vdf_solution_seen with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_vdf_revelation_conflict = function + | Ok () -> ok_unit + | Error conflict -> error (Conflicting_vdf_revelation conflict) + + let add_vdf_revelation vs oph = + { + vs with + anonymous_state = {vs.anonymous_state with vdf_solution_seen = Some oph}; + } + + let remove_vdf_revelation vs = + let anonymous_state = {vs.anonymous_state with vdf_solution_seen = None} in + {vs with anonymous_state} +end + +module Manager = struct + open Validate_errors.Manager + + (** State that simulates changes from individual operations that have + an effect on future operations inside the same batch. *) + type batch_state = { + balance : Tez.t; + (** Remaining balance in the contract, used to simulate the + payment of fees by each operation in the batch. *) + is_allocated : bool; + (** Track whether the contract is still allocated. Indeed, + previous operations' fee payment may empty the contract and + this may deallocate the contract. + + TODO: https://gitlab.com/tezos/tezos/-/issues/3209 Change + empty account cleanup mechanism to avoid the need for this + field. *) + total_gas_used : Gas.Arith.fp; + } + + (** Check a few simple properties of the batch, and return the + initial {!batch_state} and the contract public key. + + Invariants checked: + + - All operations in a batch have the same source. + + - The source's contract is allocated. + + - The counters in a batch are successive, and the first of them + is the source's next expected counter. + + - A batch contains at most one Reveal operation that must occur + in first position. + + - The source's public key has been revealed (either before the + considered batch, or during its first operation). + + Note that currently, the [op] batch contains only one signature, + so all operations in the batch are required to originate from the + same manager. This may change in the future, in order to allow + several managers to group-sign a sequence of operations. *) + let check_sanity_and_find_public_key vi + (contents_list : _ Kind.manager contents_list) = + let open Result_syntax in + let check_source_and_counter ~expected_source ~source ~previous_counter + ~counter = + let* () = + error_unless + (Signature.Public_key_hash.equal expected_source source) + Inconsistent_sources + in + error_unless + Manager_counter.(succ previous_counter = counter) + Inconsistent_counters + in + let rec check_batch_tail_sanity : + type kind. + public_key_hash -> + Manager_counter.t -> + kind Kind.manager contents_list -> + unit tzresult = + fun expected_source previous_counter -> function + | Single (Manager_operation {operation = Reveal _key; _}) -> + error Incorrect_reveal_position + | Cons (Manager_operation {operation = Reveal _key; _}, _res) -> + error Incorrect_reveal_position + | Single (Manager_operation {source; counter; _}) -> + check_source_and_counter + ~expected_source + ~source + ~previous_counter + ~counter + | Cons (Manager_operation {source; counter; _}, rest) -> + let open Result_syntax in + let* () = + check_source_and_counter + ~expected_source + ~source + ~previous_counter + ~counter + in + check_batch_tail_sanity source counter rest + in + let check_batch : + type kind. + kind Kind.manager contents_list -> + (public_key_hash * public_key option * Manager_counter.t) tzresult = + fun contents_list -> + match contents_list with + | Single (Manager_operation {source; operation = Reveal key; counter; _}) + -> + ok (source, Some key, counter) + | Single (Manager_operation {source; counter; _}) -> + ok (source, None, counter) + | Cons + (Manager_operation {source; operation = Reveal key; counter; _}, rest) + -> + check_batch_tail_sanity source counter rest >>? fun () -> + ok (source, Some key, counter) + | Cons (Manager_operation {source; counter; _}, rest) -> + check_batch_tail_sanity source counter rest >>? fun () -> + ok (source, None, counter) + in + let open Lwt_result_syntax in + let*? source, revealed_key, first_counter = check_batch contents_list in + let* balance = Contract.check_allocated_and_get_balance vi.ctxt source in + let* () = Contract.check_counter_increment vi.ctxt source first_counter in + let* pk = + (* Note that it is important to always retrieve the public + key. This includes the case where the key ends up not being + used because the signature check is skipped in + {!validate_manager_operation} called with + [~check_signature:false]. Indeed, the mempool may use + this argument when it has already checked the signature of + the operation in the past; but if there has been a branch + reorganization since then, the key might not be revealed in + the new branch anymore, in which case + {!Contract.get_manager_key} will return an error. *) + match revealed_key with + | Some pk -> return pk + | None -> Contract.get_manager_key vi.ctxt source + in + let initial_batch_state = + { + balance; + (* Initial contract allocation is ensured by the success of + the call to {!Contract.check_allocated_and_get_balance} + above. *) + is_allocated = true; + total_gas_used = Gas.Arith.zero; + } + in + return (initial_batch_state, pk) + + let check_gas_limit info ~gas_limit = + Gas.check_gas_limit + ~hard_gas_limit_per_operation: + info.manager_info.hard_gas_limit_per_operation + ~gas_limit + + let check_storage_limit vi storage_limit = + error_unless + Compare.Z.( + storage_limit <= vi.manager_info.hard_storage_limit_per_operation + && storage_limit >= Z.zero) + Fees.Storage_limit_too_high + + let assert_tx_rollup_feature_enabled vi = + let open Result_syntax in + let* sunset = + Raw_level.of_int32 (Constants.tx_rollup_sunset_level vi.ctxt) + in + error_unless + (Constants.tx_rollup_enable vi.ctxt + && Raw_level.(vi.current_level.level < sunset)) + Tx_rollup_feature_disabled + + let assert_sc_rollup_feature_enabled vi = + error_unless (Constants.sc_rollup_enable vi.ctxt) Sc_rollup_feature_disabled + + let assert_not_zero_messages messages = + match messages with + | [] -> error Sc_rollup_errors.Sc_rollup_add_zero_messages + | _ -> ok_unit + + let assert_zk_rollup_feature_enabled vi = + error_unless (Constants.zk_rollup_enable vi.ctxt) Zk_rollup_feature_disabled + + let consume_decoding_gas remaining_gas lexpr = + record_trace Gas_quota_exceeded_init_deserialize + @@ (* Fail early if the operation does not have enough gas to + cover the deserialization cost. We always consider the full + deserialization cost, independently from the internal state + of the lazy_expr. Otherwise we might risk getting different + results if the operation has already been deserialized + before (e.g. when retrieved in JSON format). Note that the + lazy_expr is not actually decoded here; its deserialization + cost is estimated from the size of its bytes. *) + Script.consume_decoding_gas remaining_gas lexpr + + let validate_tx_rollup_submit_batch vi remaining_gas content = + let open Result_syntax in + let* () = assert_tx_rollup_feature_enabled vi in + let _message, message_size = Tx_rollup_message.make_batch content in + let* cost = Tx_rollup_gas.hash_cost message_size in + let size_limit = Constants.tx_rollup_hard_size_limit_per_message vi.ctxt in + let* (_ : Gas.Arith.fp) = Gas.consume_from remaining_gas cost in + error_unless + Compare.Int.(message_size <= size_limit) + Tx_rollup_errors.Message_size_exceeds_limit + + let validate_tx_rollup_dispatch_tickets vi remaining_gas operation = + let open Result_syntax in + let* () = assert_tx_rollup_feature_enabled vi in + let (Tx_rollup_dispatch_tickets {tickets_info; message_result_path; _}) = + operation + in + let Constants.Parametric. + {max_messages_per_inbox; max_withdrawals_per_batch; _} = + Constants.tx_rollup vi.ctxt + in + let* () = + Tx_rollup_errors.check_path_depth + `Commitment + (Tx_rollup_commitment.Merkle.path_depth message_result_path) + ~count_limit:max_messages_per_inbox + in + let* () = + error_when + Compare.List_length_with.(tickets_info = 0) + Tx_rollup_errors.No_withdrawals_to_dispatch + in + let* () = + error_when + Compare.List_length_with.(tickets_info > max_withdrawals_per_batch) + Tx_rollup_errors.Too_many_withdrawals + in + let* (_ : Gas.Arith.fp) = + record_trace + Gas_quota_exceeded_init_deserialize + (List.fold_left_e + (fun remaining_gas Tx_rollup_reveal.{contents; ty; _} -> + let* remaining_gas = + Script.consume_decoding_gas remaining_gas contents + in + Script.consume_decoding_gas remaining_gas ty) + remaining_gas + tickets_info) + in + return_unit + + let validate_tx_rollup_rejection vi operation = + let open Result_syntax in + let* () = assert_tx_rollup_feature_enabled vi in + let (Tx_rollup_rejection + {message_path; message_result_path; previous_message_result_path; _}) + = + operation + in + let Constants.Parametric.{max_messages_per_inbox; _} = + Constants.tx_rollup vi.ctxt + in + let* () = + Tx_rollup_errors.check_path_depth + `Inbox + (Tx_rollup_inbox.Merkle.path_depth message_path) + ~count_limit:max_messages_per_inbox + in + let* () = + Tx_rollup_errors.check_path_depth + `Commitment + (Tx_rollup_commitment.Merkle.path_depth message_result_path) + ~count_limit:max_messages_per_inbox + in + Tx_rollup_errors.check_path_depth + `Commitment + (Tx_rollup_commitment.Merkle.path_depth previous_message_result_path) + ~count_limit:max_messages_per_inbox + + let may_trace_gas_limit_too_high info = + match info.mode with + | Application _ | Partial_validation _ | Construction _ -> fun x -> x + | Mempool -> + (* [Gas.check_limit] will only + raise a "temporary" error, however when + {!validate_operation} is called on a batch in isolation + (like e.g. in the mempool) it must "refuse" operations + whose total gas limit (the sum of the [gas_limit]s of each + operation) is already above the block limit. We add the + "permanent" error [Gas.Gas_limit_too_high] on top of the + trace to this effect. *) + record_trace Gas.Gas_limit_too_high + + let check_contents (type kind) vi batch_state + (contents : kind Kind.manager contents) remaining_block_gas = + let open Lwt_result_syntax in + let (Manager_operation + {source; fee; counter = _; operation; gas_limit; storage_limit}) = + contents + in + let*? () = check_gas_limit vi ~gas_limit in + let total_gas_used = + Gas.Arith.(add batch_state.total_gas_used (fp gas_limit)) + in + let*? () = + may_trace_gas_limit_too_high vi + @@ error_unless + Gas.Arith.(fp total_gas_used <= remaining_block_gas) + Gas.Block_quota_exceeded + in + let*? remaining_gas = + record_trace + Insufficient_gas_for_manager + (Gas.consume_from + (Gas.Arith.fp gas_limit) + Michelson_v1_gas.Cost_of.manager_operation) + in + let*? () = check_storage_limit vi storage_limit in + let*? () = + (* {!Contract.must_be_allocated} has already been called while + initializing [batch_state]. This checks that the contract has + not been emptied by spending fees for previous operations in + the batch. *) + error_unless + batch_state.is_allocated + (Contract_storage.Empty_implicit_contract source) + in + let*? () = + let open Result_syntax in + match operation with + | Reveal pk -> Contract.check_public_key pk source + | Transaction {parameters; _} -> + let* (_ : Gas.Arith.fp) = + consume_decoding_gas remaining_gas parameters + in + return_unit + | Origination {script; _} -> + let* remaining_gas = consume_decoding_gas remaining_gas script.code in + let* (_ : Gas.Arith.fp) = + consume_decoding_gas remaining_gas script.storage + in + return_unit + | Register_global_constant {value} -> + let* (_ : Gas.Arith.fp) = consume_decoding_gas remaining_gas value in + return_unit + | Delegation (Some pkh) -> Delegate.check_not_tz4 pkh + | Update_consensus_key pk -> Delegate.Consensus_key.check_not_tz4 pk + | Delegation None | Set_deposits_limit _ | Increase_paid_storage _ -> + return_unit + | Tx_rollup_origination -> assert_tx_rollup_feature_enabled vi + | Tx_rollup_submit_batch {content; _} -> + validate_tx_rollup_submit_batch vi remaining_gas content + | Tx_rollup_commit _ | Tx_rollup_return_bond _ + | Tx_rollup_finalize_commitment _ | Tx_rollup_remove_commitment _ -> + assert_tx_rollup_feature_enabled vi + | Transfer_ticket {contents; ty; _} -> + let* () = assert_tx_rollup_feature_enabled vi in + let* remaining_gas = consume_decoding_gas remaining_gas contents in + let* (_ : Gas.Arith.fp) = consume_decoding_gas remaining_gas ty in + return_unit + | Tx_rollup_dispatch_tickets _ -> + validate_tx_rollup_dispatch_tickets vi remaining_gas operation + | Tx_rollup_rejection _ -> validate_tx_rollup_rejection vi operation + | Sc_rollup_originate _ | Sc_rollup_cement _ | Sc_rollup_publish _ + | Sc_rollup_refute _ | Sc_rollup_timeout _ + | Sc_rollup_execute_outbox_message _ -> + assert_sc_rollup_feature_enabled vi + | Sc_rollup_add_messages {messages; _} -> + let* () = assert_sc_rollup_feature_enabled vi in + assert_not_zero_messages messages + | Sc_rollup_recover_bond _ -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3063 + Should we successfully precheck Sc_rollup_recover_bond and any + (simple) Sc rollup operation, or should we add some some checks to make + the operations Branch_delayed if they cannot be successfully + prechecked? *) + assert_sc_rollup_feature_enabled vi + | Dal_publish_slot_header slot_header -> + Dal_apply.validate_publish_slot_header vi.ctxt slot_header + | Zk_rollup_origination _ | Zk_rollup_publish _ | Zk_rollup_update _ -> + assert_zk_rollup_feature_enabled vi + in + (* Gas should no longer be consumed below this point, because it + would not take into account any gas consumed during the pattern + matching right above. If you really need to consume gas here, then you + must make this pattern matching return the [remaining_gas].*) + let* balance, is_allocated = + Contract.simulate_spending + vi.ctxt + ~balance:batch_state.balance + ~amount:fee + source + in + return {total_gas_used; balance; is_allocated} + + (** This would be [fold_left_es (check_contents vi) batch_state + contents_list] if [contents_list] were an ordinary [list]. *) + let rec check_contents_list : + type kind. + info -> + batch_state -> + kind Kind.manager contents_list -> + Gas.Arith.fp -> + Gas.Arith.fp tzresult Lwt.t = + fun vi batch_state contents_list remaining_gas -> + let open Lwt_result_syntax in + match contents_list with + | Single contents -> + let* batch_state = + check_contents vi batch_state contents remaining_gas + in + return batch_state.total_gas_used + | Cons (contents, tail) -> + let* batch_state = + check_contents vi batch_state contents remaining_gas + in + check_contents_list vi batch_state tail remaining_gas + + let check_manager_operation vi ~check_signature + (operation : _ Kind.manager operation) remaining_block_gas = + let open Lwt_result_syntax in + let contents_list = operation.protocol_data.contents in + let* batch_state, source_pk = + check_sanity_and_find_public_key vi contents_list + in + let* gas_used = + check_contents_list vi batch_state contents_list remaining_block_gas + in + let*? () = + if check_signature then + Operation.check_signature source_pk vi.chain_id operation + else ok_unit + in + return gas_used + + let check_manager_operation_conflict (type kind) vs oph + (operation : kind Kind.manager operation) = + let source = + match operation.protocol_data.contents with + | Single (Manager_operation {source; _}) + | Cons (Manager_operation {source; _}, _) -> + source + in + (* One-operation-per-manager-per-block restriction (1M) *) + match + Signature.Public_key_hash.Map.find_opt + source + vs.manager_state.managers_seen + with + | None -> ok_unit + | Some existing -> + Error (Operation_conflict {existing; new_operation = oph}) + + let wrap_check_manager_operation_conflict (type kind) + (operation : kind Kind.manager operation) = + let source = + match operation.protocol_data.contents with + | Single (Manager_operation {source; _}) + | Cons (Manager_operation {source; _}, _) -> + source + in + function + | Ok () -> ok_unit + | Error conflict -> error (Manager_restriction {source; conflict}) + + let add_manager_operation (type kind) vs oph + (operation : kind Kind.manager operation) = + let source = + match operation.protocol_data.contents with + | Single (Manager_operation {source; _}) + | Cons (Manager_operation {source; _}, _) -> + source + in + let managers_seen = + Signature.Public_key_hash.Map.add + source + oph + vs.manager_state.managers_seen + in + {vs with manager_state = {managers_seen}} + + (* Return the new [block_state] with the updated remaining gas used: + - In non-mempool modes, this value is + [block_state.remaining_block_gas], in which the gas from the + validated operation has been subtracted. + + - In [Mempool] mode, the [block_state] should remain + unchanged. Indeed, we only want each batch to not exceed the + block limit individually, without taking other operations + into account. *) + let may_update_remaining_gas_used mode (block_state : block_state) + operation_gas_used = + match mode with + | Application _ | Partial_validation _ | Construction _ -> + let remaining_block_gas = + Gas.Arith.(sub block_state.remaining_block_gas operation_gas_used) + in + {block_state with remaining_block_gas} + | Mempool -> block_state + + let remove_manager_operation (type kind) vs + (operation : kind Kind.manager operation) = + let source = + match operation.protocol_data.contents with + | Single (Manager_operation {source; _}) + | Cons (Manager_operation {source; _}, _) -> + source + in + let managers_seen = + Signature.Public_key_hash.Map.remove source vs.manager_state.managers_seen + in + {vs with manager_state = {managers_seen}} + + let validate_manager_operation ~check_signature info operation_state + block_state oph operation = + let open Lwt_result_syntax in + let* gas_used = + check_manager_operation + info + ~check_signature + operation + block_state.remaining_block_gas + in + let*? () = + check_manager_operation_conflict operation_state oph operation + |> wrap_check_manager_operation_conflict operation + in + let operation_state = add_manager_operation operation_state oph operation in + let block_state = + may_update_remaining_gas_used info.mode block_state gas_used + in + return {info; operation_state; block_state} +end + +let init_validation_state ctxt mode chain_id all_expected_consensus_features + ~predecessor_level = + let info = init_info ctxt mode chain_id all_expected_consensus_features in + let operation_state = init_operation_conflict_state ~predecessor_level in + let block_state = init_block_state info in + {info; operation_state; block_state} + +(* Pre-condition: Shell block headers' checks have already been done. + These checks must ensure that: + - the block header level is the succ of the predecessor block level + - the timestamp of the predecessor is lower than the current block's + - the fitness of the block is greater than its predecessor's + - the number of operations by validation passes does not exceed the quota + established by the protocol + - the size of an operation does not exceed [max_operation_data_length] +*) +let begin_any_application ctxt chain_id ~predecessor_level + ~predecessor_timestamp (block_header : Block_header.t) fitness ~is_partial = + let open Lwt_result_syntax in + let predecessor_round = Fitness.predecessor_round fitness in + let round = Fitness.round fitness in + let current_level = Level.current ctxt in + let* ctxt, _slot, block_producer = + Stake_distribution.baking_rights_owner ctxt current_level ~round + in + let*? () = + Block_header.begin_validate_block_header + ~block_header + ~chain_id + ~predecessor_timestamp + ~predecessor_round + ~fitness + ~timestamp:block_header.shell.timestamp + ~delegate_pk:block_producer.consensus_pk + ~round_durations:(Constants.round_durations ctxt) + ~proof_of_work_threshold:(Constants.proof_of_work_threshold ctxt) + ~expected_commitment:current_level.expected_commitment + in + let* () = + Consensus.check_frozen_deposits_are_positive ctxt block_producer.delegate + in + let* ctxt, _slot, payload_producer = + Stake_distribution.baking_rights_owner + ctxt + current_level + ~round:block_header.protocol_data.contents.payload_round + in + let payload_hash = block_header.protocol_data.contents.payload_hash in + let predecessor_hash = block_header.shell.predecessor in + let block_finalization_info = + { + fitness; + block_producer; + payload_producer; + predecessor_hash; + block_data_contents = block_header.protocol_data.contents; + } + in + let mode = + if is_partial then Partial_validation block_finalization_info + else Application block_finalization_info + in + let all_expected_consensus_features = + Consensus.expected_features_for_application + ctxt + fitness + payload_hash + ~predecessor_level + ~predecessor_round + ~predecessor_hash + in + let predecessor_level = predecessor_level.level in + return + (init_validation_state + ctxt + mode + chain_id + all_expected_consensus_features + ~predecessor_level) + +let begin_partial_validation ctxt chain_id ~predecessor_level + ~predecessor_timestamp block_header fitness = + begin_any_application + ctxt + chain_id + ~predecessor_level + ~predecessor_timestamp + block_header + fitness + ~is_partial:true + +let begin_application ctxt chain_id ~predecessor_level ~predecessor_timestamp + block_header fitness = + begin_any_application + ctxt + chain_id + ~predecessor_level + ~predecessor_timestamp + block_header + fitness + ~is_partial:false + +let begin_full_construction ctxt chain_id ~predecessor_level ~predecessor_round + ~predecessor_timestamp ~predecessor_hash round + (header_contents : Block_header.contents) = + let open Lwt_result_syntax in + let round_durations = Constants.round_durations ctxt in + let timestamp = Timestamp.current ctxt in + let*? () = + Block_header.check_timestamp + round_durations + ~timestamp + ~round + ~predecessor_timestamp + ~predecessor_round + in + let current_level = Level.current ctxt in + let* ctxt, _slot, block_producer = + Stake_distribution.baking_rights_owner ctxt current_level ~round + in + let* () = + Consensus.check_frozen_deposits_are_positive ctxt block_producer.delegate + in + let* ctxt, _slot, payload_producer = + Stake_distribution.baking_rights_owner + ctxt + current_level + ~round:header_contents.payload_round + in + let all_expected_consensus_features = + Consensus.expected_features_for_construction + ctxt + round + header_contents.payload_hash + ~predecessor_level + ~predecessor_round + ~predecessor_hash + in + let predecessor_level = predecessor_level.level in + let validation_state = + init_validation_state + ctxt + (Construction + { + predecessor_round; + predecessor_hash; + round; + block_data_contents = header_contents; + block_producer; + payload_producer; + }) + chain_id + all_expected_consensus_features + ~predecessor_level + in + return validation_state + +let begin_partial_construction ctxt chain_id ~predecessor_level + ~predecessor_round ~grandparent_round = + let all_expected_consensus_features = + Consensus.expected_features_for_partial_construction + ctxt + ~predecessor_level + ~predecessor_round + ~grandparent_round + in + let predecessor_level = predecessor_level.level in + let validation_state = + init_validation_state + ctxt + Mempool + chain_id + all_expected_consensus_features + ~predecessor_level + in + validation_state + +let begin_no_predecessor_info ctxt chain_id = + let all_expected_consensus_features = + { + expected_preendorsement = + No_predecessor_info_cannot_validate_preendorsement; + expected_endorsement = No_predecessor_info_cannot_validate_endorsement; + expected_grandparent_endorsement_for_partial_construction = None; + } + in + let current_level = Level.current ctxt in + let predecessor_level = + match Raw_level.pred current_level.level with + | None -> current_level.level + | Some level -> level + in + init_validation_state + ctxt + Mempool + chain_id + all_expected_consensus_features + ~predecessor_level + +let check_operation ?(check_signature = true) info (type kind) + (operation : kind operation) : unit tzresult Lwt.t = + let open Lwt_result_syntax in + match operation.protocol_data.contents with + | Single (Preendorsement _) -> + let* (_voting_power : int) = + Consensus.check_preendorsement info ~check_signature operation + in + return_unit + | Single (Endorsement _) -> + let* (_kind : Consensus.endorsement_kind) = + Consensus.check_endorsement info ~check_signature operation + in + return_unit + | Single (Dal_attestation _) -> Consensus.check_dal_attestation info operation + | Single (Proposals _) -> + Voting.check_proposals info ~check_signature operation + | Single (Ballot _) -> Voting.check_ballot info ~check_signature operation + | Single (Activate_account _) -> + Anonymous.check_activate_account info operation + | Single (Double_preendorsement_evidence _) -> + Anonymous.check_double_preendorsement_evidence info operation + | Single (Double_endorsement_evidence _) -> + Anonymous.check_double_endorsement_evidence info operation + | Single (Double_baking_evidence _) -> + Anonymous.check_double_baking_evidence info operation + | Single (Drain_delegate _) -> + Anonymous.check_drain_delegate info ~check_signature operation + | Single (Seed_nonce_revelation _) -> + Anonymous.check_seed_nonce_revelation info operation + | Single (Vdf_revelation _) -> Anonymous.check_vdf_revelation info operation + | Single (Manager_operation _) -> + let remaining_gas = + Gas.Arith.fp (Constants.hard_gas_limit_per_block info.ctxt) + in + let* (_remaining_gas : Gas.Arith.fp) = + Manager.check_manager_operation + info + ~check_signature + operation + remaining_gas + in + return_unit + | Cons (Manager_operation _, _) -> + let remaining_gas = + Gas.Arith.fp (Constants.hard_gas_limit_per_block info.ctxt) + in + let* (_remaining_gas : Gas.Arith.fp) = + Manager.check_manager_operation + info + ~check_signature + operation + remaining_gas + in + return_unit + | Single (Failing_noop _) -> tzfail Validate_errors.Failing_noop_error + +let check_operation_conflict (type kind) operation_conflict_state oph + (operation : kind operation) = + match operation.protocol_data.contents with + | Single (Preendorsement _) -> + Consensus.check_preendorsement_conflict + operation_conflict_state + oph + operation + | Single (Endorsement _) -> + Consensus.check_endorsement_conflict + operation_conflict_state + oph + operation + | Single (Dal_attestation _) -> + Consensus.check_dal_attestation_conflict + operation_conflict_state + oph + operation + | Single (Proposals _) -> + Voting.check_proposals_conflict operation_conflict_state oph operation + | Single (Ballot _) -> + Voting.check_ballot_conflict operation_conflict_state oph operation + | Single (Activate_account _) -> + Anonymous.check_activate_account_conflict + operation_conflict_state + oph + operation + | Single (Double_preendorsement_evidence _) -> + Anonymous.check_double_preendorsement_evidence_conflict + operation_conflict_state + oph + operation + | Single (Double_endorsement_evidence _) -> + Anonymous.check_double_endorsement_evidence_conflict + operation_conflict_state + oph + operation + | Single (Double_baking_evidence _) -> + Anonymous.check_double_baking_evidence_conflict + operation_conflict_state + oph + operation + | Single (Drain_delegate _) -> + Anonymous.check_drain_delegate_conflict + operation_conflict_state + oph + operation + | Single (Seed_nonce_revelation _) -> + Anonymous.check_seed_nonce_revelation_conflict + operation_conflict_state + oph + operation + | Single (Vdf_revelation _) -> + Anonymous.check_vdf_revelation_conflict operation_conflict_state oph + | Single (Manager_operation _) -> + Manager.check_manager_operation_conflict + operation_conflict_state + oph + operation + | Cons (Manager_operation _, _) -> + Manager.check_manager_operation_conflict + operation_conflict_state + oph + operation + | Single (Failing_noop _) -> (* Nothing to do *) ok_unit + +let add_valid_operation operation_conflict_state oph (type kind) + (operation : kind operation) = + match operation.protocol_data.contents with + | Single (Preendorsement _) -> + Consensus.add_preendorsement operation_conflict_state oph operation + | Single (Endorsement consensus_content) -> + let endorsement_kind = + if + Consensus.is_normal_endorsement_assuming_valid + operation_conflict_state + consensus_content + then Consensus.Normal_endorsement 0 + else Grandparent_endorsement + in + Consensus.add_endorsement + operation_conflict_state + oph + operation + endorsement_kind + | Single (Dal_attestation _) -> + Consensus.add_dal_attestation operation_conflict_state oph operation + | Single (Proposals _) -> + Voting.add_proposals operation_conflict_state oph operation + | Single (Ballot _) -> + Voting.add_ballot operation_conflict_state oph operation + | Single (Activate_account _) -> + Anonymous.add_activate_account operation_conflict_state oph operation + | Single (Double_preendorsement_evidence _) -> + Anonymous.add_double_preendorsement_evidence + operation_conflict_state + oph + operation + | Single (Double_endorsement_evidence _) -> + Anonymous.add_double_endorsement_evidence + operation_conflict_state + oph + operation + | Single (Double_baking_evidence _) -> + Anonymous.add_double_baking_evidence + operation_conflict_state + oph + operation + | Single (Drain_delegate _) -> + Anonymous.add_drain_delegate operation_conflict_state oph operation + | Single (Seed_nonce_revelation _) -> + Anonymous.add_seed_nonce_revelation operation_conflict_state oph operation + | Single (Vdf_revelation _) -> + Anonymous.add_vdf_revelation operation_conflict_state oph + | Single (Manager_operation _) -> + Manager.add_manager_operation operation_conflict_state oph operation + | Cons (Manager_operation _, _) -> + Manager.add_manager_operation operation_conflict_state oph operation + | Single (Failing_noop _) -> (* Nothing to do *) operation_conflict_state + +(* Hypothesis: + - the [operation] has been validated and is present in [vs]; + - this function is only valid for the mempool mode. *) +let remove_operation operation_conflict_state (type kind) + (operation : kind operation) = + match operation.protocol_data.contents with + | Single (Preendorsement _) -> + Consensus.remove_preendorsement operation_conflict_state operation + | Single (Endorsement _) -> + Consensus.remove_endorsement operation_conflict_state operation + | Single (Dal_attestation _) -> + Consensus.remove_dal_attestation operation_conflict_state operation + | Single (Proposals _) -> + Voting.remove_proposals operation_conflict_state operation + | Single (Ballot _) -> Voting.remove_ballot operation_conflict_state operation + | Single (Activate_account _) -> + Anonymous.remove_activate_account operation_conflict_state operation + | Single (Double_preendorsement_evidence _) -> + Anonymous.remove_double_preendorsement_evidence + operation_conflict_state + operation + | Single (Double_endorsement_evidence _) -> + Anonymous.remove_double_endorsement_evidence + operation_conflict_state + operation + | Single (Double_baking_evidence _) -> + Anonymous.remove_double_baking_evidence operation_conflict_state operation + | Single (Drain_delegate _) -> + Anonymous.remove_drain_delegate operation_conflict_state operation + | Single (Seed_nonce_revelation _) -> + Anonymous.remove_seed_nonce_revelation operation_conflict_state operation + | Single (Vdf_revelation _) -> + Anonymous.remove_vdf_revelation operation_conflict_state + | Single (Manager_operation _) -> + Manager.remove_manager_operation operation_conflict_state operation + | Cons (Manager_operation _, _) -> + Manager.remove_manager_operation operation_conflict_state operation + | Single (Failing_noop _) -> (* Nothing to do *) operation_conflict_state + +let check_validation_pass_consistency vi vs validation_pass = + let open Lwt_result_syntax in + match vi.mode with + | Mempool | Construction _ -> return vs + | Application _ | Partial_validation _ -> ( + match (vs.last_op_validation_pass, validation_pass) with + | None, validation_pass -> + return {vs with last_op_validation_pass = validation_pass} + | Some previous_vp, Some validation_pass -> + let* () = + fail_unless + Compare.Int.(previous_vp <= validation_pass) + (Validate_errors.Block.Inconsistent_validation_passes_in_block + {expected = previous_vp; provided = validation_pass}) + in + return {vs with last_op_validation_pass = Some validation_pass} + | Some _, None -> tzfail Validate_errors.Failing_noop_error) + +(** Increment [vs.op_count] for all operations, and record + non-consensus operation hashes in [vs.recorded_operations_rev]. *) +let record_operation vs ophash validation_pass_opt = + let op_count = vs.op_count + 1 in + match validation_pass_opt with + | Some n when Compare.Int.(n = Operation_repr.consensus_pass) -> + {vs with op_count} + | _ -> + { + vs with + op_count; + recorded_operations_rev = ophash :: vs.recorded_operations_rev; + } + +let validate_operation ?(check_signature = true) + {info; operation_state; block_state} oph + (packed_operation : packed_operation) = + let open Lwt_result_syntax in + let {shell; protocol_data = Operation_data protocol_data} = + packed_operation + in + let validation_pass_opt = Operation.acceptable_pass packed_operation in + let* block_state = + check_validation_pass_consistency info block_state validation_pass_opt + in + let block_state = record_operation block_state oph validation_pass_opt in + let operation : _ operation = {shell; protocol_data} in + match (info.mode, validation_pass_opt) with + | Partial_validation _, Some n + when Compare.Int.(n <> Operation_repr.consensus_pass) -> + (* Do not validate non-consensus operation in [Partial_validation] mode *) + return {info; operation_state; block_state} + | Partial_validation _, _ | Mempool, _ | Construction _, _ | Application _, _ + -> ( + match operation.protocol_data.contents with + | Single (Preendorsement _) -> + Consensus.validate_preendorsement + ~check_signature + info + operation_state + block_state + oph + operation + | Single (Endorsement _) -> + Consensus.validate_endorsement + ~check_signature + info + operation_state + block_state + oph + operation + | Single (Dal_attestation _) -> + let open Consensus in + let* () = check_dal_attestation info operation in + let*? () = + check_dal_attestation_conflict operation_state oph operation + |> wrap_dal_attestation_conflict + in + let operation_state = + add_dal_attestation operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Proposals _) -> + let open Voting in + let* () = check_proposals info ~check_signature operation in + let*? () = + check_proposals_conflict operation_state oph operation + |> wrap_proposals_conflict + in + let operation_state = add_proposals operation_state oph operation in + return {info; operation_state; block_state} + | Single (Ballot _) -> + let open Voting in + let* () = check_ballot info ~check_signature operation in + let*? () = + check_ballot_conflict operation_state oph operation + |> wrap_ballot_conflict + in + let operation_state = add_ballot operation_state oph operation in + return {info; operation_state; block_state} + | Single (Activate_account _) -> + let open Anonymous in + let* () = check_activate_account info operation in + let*? () = + check_activate_account_conflict operation_state oph operation + |> wrap_activate_account_conflict operation + in + let operation_state = + add_activate_account operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Double_preendorsement_evidence _) -> + let open Anonymous in + let* () = check_double_preendorsement_evidence info operation in + let*? () = + check_double_preendorsement_evidence_conflict + operation_state + oph + operation + |> wrap_denunciation_conflict Preendorsement + in + let operation_state = + add_double_preendorsement_evidence operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Double_endorsement_evidence _) -> + let open Anonymous in + let* () = check_double_endorsement_evidence info operation in + let*? () = + check_double_endorsement_evidence_conflict + operation_state + oph + operation + |> wrap_denunciation_conflict Endorsement + in + let operation_state = + add_double_endorsement_evidence operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Double_baking_evidence _) -> + let open Anonymous in + let* () = check_double_baking_evidence info operation in + let*? () = + check_double_baking_evidence_conflict operation_state oph operation + |> wrap_denunciation_conflict Block + in + let operation_state = + add_double_baking_evidence operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Drain_delegate _) -> + let open Anonymous in + let* () = check_drain_delegate info ~check_signature operation in + let*? () = + check_drain_delegate_conflict operation_state oph operation + |> wrap_drain_delegate_conflict operation + in + let operation_state = + add_drain_delegate operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Seed_nonce_revelation _) -> + let open Anonymous in + let* () = check_seed_nonce_revelation info operation in + let*? () = + check_seed_nonce_revelation_conflict operation_state oph operation + |> wrap_seed_nonce_revelation_conflict + in + let operation_state = + add_seed_nonce_revelation operation_state oph operation + in + return {info; operation_state; block_state} + | Single (Vdf_revelation _) -> + let open Anonymous in + let* () = check_vdf_revelation info operation in + let*? () = + check_vdf_revelation_conflict operation_state oph + |> wrap_vdf_revelation_conflict + in + let operation_state = add_vdf_revelation operation_state oph in + return {info; operation_state; block_state} + | Single (Manager_operation _) -> + Manager.validate_manager_operation + ~check_signature + info + operation_state + block_state + oph + operation + | Cons (Manager_operation _, _) -> + Manager.validate_manager_operation + ~check_signature + info + operation_state + block_state + oph + operation + | Single (Failing_noop _) -> tzfail Validate_errors.Failing_noop_error) + +let are_endorsements_required vi = + let open Lwt_result_syntax in + let+ first_level = First_level_of_protocol.get vi.ctxt in + (* [Comment from Legacy_apply] NB: the first level is the level + of the migration block. There are no endorsements for this + block. Therefore the block at the next level cannot contain + endorsements. *) + let level_position_in_protocol = + Raw_level.diff vi.current_level.level first_level + in + Compare.Int32.(level_position_in_protocol > 1l) + +let check_endorsement_power vi bs = + let required = Constants.consensus_threshold vi.ctxt in + let provided = bs.endorsement_power in + error_unless + Compare.Int.(provided >= required) + (Validate_errors.Block.Not_enough_endorsements {required; provided}) + +let finalize_validate_block_header vi vs checkable_payload_hash + (block_header_contents : Block_header.contents) round fitness = + let locked_round_evidence = + Option.map + (fun (preendorsement_round, preendorsement_count) -> + Block_header.{preendorsement_round; preendorsement_count}) + vs.locked_round_evidence + in + Block_header.finalize_validate_block_header + ~block_header_contents + ~round + ~fitness + ~checkable_payload_hash + ~locked_round_evidence + ~consensus_threshold:(Constants.consensus_threshold vi.ctxt) + +let compute_payload_hash block_state + (block_header_contents : Block_header.contents) ~predecessor_hash = + Block_payload.hash + ~predecessor_hash + ~payload_round:block_header_contents.payload_round + (List.rev block_state.recorded_operations_rev) + +let finalize_block {info; block_state; _} = + let open Lwt_result_syntax in + match info.mode with + | Application {fitness; predecessor_hash; block_data_contents; _} -> + let* are_endorsements_required = are_endorsements_required info in + let*? () = + if are_endorsements_required then + check_endorsement_power info block_state + else ok_unit + in + let block_payload_hash = + compute_payload_hash block_state block_data_contents ~predecessor_hash + in + let round = Fitness.round fitness in + let*? () = + finalize_validate_block_header + info + block_state + (Block_header.Expected_payload_hash block_payload_hash) + block_data_contents + round + fitness + in + return_unit + | Partial_validation _ -> + let* are_endorsements_required = are_endorsements_required info in + let*? () = + if are_endorsements_required then + check_endorsement_power info block_state + else ok_unit + in + return_unit + | Construction + {predecessor_round; predecessor_hash; round; block_data_contents; _} -> + let block_payload_hash = + compute_payload_hash block_state block_data_contents ~predecessor_hash + in + let locked_round_evidence = block_state.locked_round_evidence in + let checkable_payload_hash = + match locked_round_evidence with + | Some _ -> Block_header.Expected_payload_hash block_payload_hash + | None -> + (* In full construction, when there is no locked round + evidence (and thus no preendorsements), the baker cannot + know the payload hash before selecting the operations. We + may dismiss checking the initially given + payload_hash. However, to be valid, the baker must patch + the resulting block header with the actual payload + hash. *) + Block_header.No_check + in + let* are_endorsements_required = are_endorsements_required info in + let*? () = + if are_endorsements_required then + check_endorsement_power info block_state + else ok_unit + in + let* fitness = + let locked_round = + match locked_round_evidence with + | None -> None + | Some (preendorsement_round, _power) -> Some preendorsement_round + in + let level = (Level.current info.ctxt).level in + let*? fitness = + Fitness.create ~level ~round ~predecessor_round ~locked_round + in + return fitness + in + let*? () = + finalize_validate_block_header + info + block_state + checkable_payload_hash + block_data_contents + round + fitness + in + return_unit + | Mempool -> + (* Nothing to do for the mempool mode*) + return_unit diff --git a/src/proto_016_PtMumbai/lib_protocol/validate.mli b/src/proto_016_PtMumbai/lib_protocol/validate.mli new file mode 100644 index 000000000000..ccfaaeac9596 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/validate.mli @@ -0,0 +1,339 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides functions pertaining to the validation of + blocks and operations. Most elements in this module are either used + or wrapped in the {!Main} module (though some of them are also + directly used by the plugin). + + The purpose of validation is to decide quickly whether a block or + an operation is valid, with minimal computations and without + writing anything in the storage. A block is considered valid if it + can be applied without failure (see {!Apply}). An operation is + valid if it can be safely included in a block without causing it to + fail. Therefore, the current module is responsible for ensuring + that calling functions from {!Apply} on validated blocks and + operations will not fail. + + {2 Block validation} + + The process of validation of a block may be started by calling one + of the following functions, depending on the circumstances (aka + mode): + + - [begin_application] is used for the validation of a preexisting + block, typically received through the network, and usually in + preparation for its future application. + + - [begin_partial_validation] is used to quickly but partially + validate an existing block. It is intended for quickly assessing a + series of blocks in an alternate branch (multipass validation). For + this reason, in this mode, the initial {!Alpha_context.t} may be + based on an ancestor block of the block to validate, instead of + necessarily its predecessor as in other modes. + + - [begin_full_construction] is used for the construction of a new + block, typically by a baker. + + Then, [validate_operation] should be called on every operation in + the block (in order of validation pass: see + {!Operation_repr.acceptable_pass}). Lastly, [finalize_block] + performs final checks on the block; if this function succeeds then + the block is valid. + + {2 Validation state} + + The process of block validation relies on a [validation_state] + transmitted throughout the aforementioned function calls. More + precisely, this immutable functional state is initialized by the + [begin_...] functions, read and updated by [validate_operation] + (as in, a slightly different [validation_state] is returned), and + required by [finalize_block]. It consists in three fields: + + - [info] contains static information required by + [validate_operation] and [finalize_block], notably the initial + {!Alpha_context.t}. It is fully filled in by the [begin_...] + functions, then only read, never updated. + + - [operation_conflict_state] keeps track of every validated + operation in the block, so that it can detect any conflict between + operations (e.g. two manager operations from the same + source). Consequently, it is both filled in and read by + [validate_operation], but not used at all by [finalize_block]. + + - [block_state] registers global block metrics such as total gas + used or endorsement power. It is filled in by [validate_operation], + which also uses it, e.g. to immediately return an error if the + block gas limit is exceeded. It is also essential to several checks + in [finalize_block]. + + The immutability of the [validation_state] allows the caller to + pause, replay, or backtrack throughout the steps of the validation + process. + + {2 Operation validation} + + Operations may be validated either as part of the validation of a + block in which they are included (see above), or on their own: + + - [begin_partial_construction] allows to initialize a + [validation_state] for the validation of operations outside of the + process of validation of a block. It is intended for mempools (see + {!Mempool_validation}) and for some RPCs. The global block + properties such as total block gas and endorsement power are not + checked. Calling [finalize_block] on such a [validation_state] does + not make much sense and simply returns unit. + + - [begin_no_predecessor_info] is a special weaker version of + [begin_partial_construction]: see its own documentation below. + + Even outside of the context of a given block validation, the + validation of operations aims at deciding whether they could + theoretically be included in a future block. Indeed, for a mempool, + this means that they are worth transmitting to a baker and + propagating to peers; or for the caller of an RPC, it means that + the tested operations may be injected in the node. + + An important property to maintain is that applying (see + {!Apply.apply_operation}) any subset of validated operations should + always succeed, even if they are not applied in the same order as + they were validated (as long as the order of application respects + the validation passes ordering). In other words, for all operations + A and B that have both been validated: if A has an earlier or the + same validation pass as B, then applying A then B must succeed; and + if B has an earlier or the same validation pass as A, then applying + B then A must succeed. Some restrictions, such as + one-operation-per-manager-per-block (1M), have been introduced to + preserve this property, and are enforced with the help of the + [operation_conflict_state]. An important consequence of this + property is that a baker may select any subset of validated + operations to bake into a new block, which is then guaranteed to be + applicable (provided that it verifies some additional global + properties such as including enough (pre)endorsing power; the baker + is responsible for ensuring this). + + For a manager operation, validity is mainly solvability, ie. the + operation must be well-formed and we must be able to take its + fees. Indeed, this is sufficient for the safe inclusion of the + operation in a block: even if there is an error during the + subsequent application of the manager operation, this will cause + the operation to have no further effects, but won't impact the + success of the block's application. The solvability of a manager + operation notably requires that it is correctly signed: indeed, we + can't take anything from a manager without having checked their + signature. + + A non-manager operation is only valid if its effects can be fully + applied in an {!Alpha_context.t} without failure. Indeed, any error + during the application of such an operation would cause the whole + block to fail; unlike manager operations, there is no notion of + failing to have an effect without impacting the application of the + whole block. More detailled documentation on checks performed and + potential errors can be found in the [validate.ml] file for some + non-manager operations. *) + +open Alpha_context +open Validate_errors + +(** Static information required to validate blocks and operations. *) +type info + +(** State used to keep track of previously validated operations and + detect potential conflicts. This state is serializable which allows + it to be exchanged with another source. See {!Mempool_validation}. *) +type operation_conflict_state + +(** Encoding for the [operation_conflict_state]. *) +val operation_conflict_state_encoding : operation_conflict_state Data_encoding.t + +(** State used to register global block properties which are relevant + to the validity of a block, e.g. the total gas used in the block so + far. This state is both used and updated by the [validate_operation] + function, and is also required by [finalize_block]. *) +type block_state + +(** Validation state (see above). *) +type validation_state = { + info : info; + operation_state : operation_conflict_state; + block_state : block_state; +} + +(** Return the context stored in the state. + + Note that this is the context at the beginning of the block / + mempool: indeed, it is not modified by [validate_operation]. *) +val get_initial_ctxt : validation_state -> context + +(** Initialize the {!validation_state} for the validation of an + existing block, usually in preparation for its future application. *) +val begin_application : + context -> + Chain_id.t -> + predecessor_level:Level.t -> + predecessor_timestamp:Time.t -> + Block_header.t -> + Fitness.t -> + validation_state tzresult Lwt.t + +(** Initialize the {!validation_state} for the partial validation of + an existing block. + + The partial validation mode is intended for quickly assessing a + series of blocks in a cousin branch (multipass + validation). Therefore, it is the only mode in which the given + {!type:context} may be based on any recent ancestor block of the + block to validate, instead of only its predecessor (where recent + means having a greater level than the [last_allowed_fork_level] of + the current head). *) +val begin_partial_validation : + context -> + Chain_id.t -> + predecessor_level:Level.t -> + predecessor_timestamp:Time.t -> + Block_header.t -> + Fitness.t -> + validation_state tzresult Lwt.t + +(** Initialize the {!validation_state} for the full construction of a + fresh block. *) +val begin_full_construction : + context -> + Chain_id.t -> + predecessor_level:Level.t -> + predecessor_round:Round.t -> + predecessor_timestamp:Time.t -> + predecessor_hash:Block_hash.t -> + Round.t -> + Block_header.contents -> + validation_state tzresult Lwt.t + +(** Initialize the {!validation_state} for the validation of + operations outside of the process of validation of a block. The + partial construction mode is mainly used to implement the mempool + (see {!Mempool_validation}), but may also be used by some RPCs. *) +val begin_partial_construction : + context -> + Chain_id.t -> + predecessor_level:Level.t -> + predecessor_round:Round.t -> + grandparent_round:Round.t -> + validation_state + +(** Similar to [begin_partial_construction] but do not require + predecessor information that is essential to the validation of + preendorsement and endorsement operations. As a consequence, the + validation of these operations will always fail. + + This function is used by the plugin RPC [run_operation], which + does not support consensus operations anyway. *) +val begin_no_predecessor_info : context -> Chain_id.t -> validation_state + +(** Check the validity of the given operation and return the updated + {!validation_state}. + + See the documentation at the top of this module on operation validation. + + @param check_signature indicates whether the signature check + should happen. It defaults to [true] because the signature needs to + be correct for the operation to be valid. This argument exists for + special cases where it is acceptable to bypass this check, e.g.: + + - A mempool implementation may keep track of operations whose + signatures have already been checked: if such an operation needs to + be validated again (typically when the head block changes), then + the mempool may call [validate_operation] with + [check_signature:false]. + + - The [run_operation] RPC provided by the plugin explicitly + excludes signature checks: see its documentation in + [lib_plugin/RPC.Scripts.S.run_operation]. *) +val validate_operation : + ?check_signature:bool -> + validation_state -> + Operation_hash.t -> + packed_operation -> + validation_state tzresult Lwt.t + +(** Finish the validation of a block. + + This function should only be used after {!validate_operation} has + been called on every operation in the block. It checks the + consistency of the block_header with the information computed while + validating the block's operations (Endorsement power, payload hash, + etc.) Checks vary depending on the mode (ie. which of the + [begin_...] functions above was used to initialize the + [validation_state]). *) +val finalize_block : validation_state -> unit tzresult Lwt.t + +(** The remaining functions are intended for the mempool. + See {!Mempool_validation}. *) + +(** Check the operation validity, similarly to {!validate_operation}. + + However, this function does not check for conflicts with + previously validated operations, nor global block properties such + as the respect of the block gas limit. This allows the function to + only take an {!info} as input rather than a full {!validation_state}. + + This function is intended for {!Mempool_validation} exclusively. *) +val check_operation : + ?check_signature:bool -> info -> 'kind operation -> unit tzresult Lwt.t + +(** Check that the operation does not conflict with other operations + already validated and recorded in the {!operation_conflict_state}. + + This function is intended for {!Mempool_validation} exclusively. *) +val check_operation_conflict : + operation_conflict_state -> + Operation_hash.t -> + 'kind operation -> + (unit, operation_conflict) result + +(** Add a valid operation to the {!operation_conflict_state}. + + The operation should have been previously validated by calling + both {!check_operation} and {!check_operation_conflict}. + + This function is intended for {!Mempool_validation} exclusively. *) +val add_valid_operation : + operation_conflict_state -> + Operation_hash.t -> + 'kind operation -> + operation_conflict_state + +(** Remove a valid operation from the {!operation_conflict_state}. + + Preconditions: + - The operation has already been validated and added to the + [operation_conflict_state]. + - The [operation_conflict_state] and other states used to validate + the operation have been initialized by calling + {!begin_partial_construction}. + + This function is intended for {!Mempool_validation}, though it is + also called by the plugin. *) +val remove_operation : + operation_conflict_state -> 'kind operation -> operation_conflict_state diff --git a/src/proto_016_PtMumbai/lib_protocol/validate_errors.ml b/src/proto_016_PtMumbai/lib_protocol/validate_errors.ml new file mode 100644 index 000000000000..efea3cb7c2fa --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/validate_errors.ml @@ -0,0 +1,1351 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type operation_conflict = + | Operation_conflict of { + existing : Operation_hash.t; + new_operation : Operation_hash.t; + } + +let operation_conflict_encoding = + let open Data_encoding in + def + "operation_conflict" + ~title:"Conflict error" + ~description:"Conflict between two operations" + @@ conv + (function + | Operation_conflict {existing; new_operation} -> + (existing, new_operation)) + (fun (existing, new_operation) -> + Operation_conflict {existing; new_operation}) + (obj2 + (req "existing" Operation_hash.encoding) + (req "new_operation" Operation_hash.encoding)) + +module Consensus = struct + type error += Zero_frozen_deposits of Signature.Public_key_hash.t + + let () = + register_error_kind + `Permanent + ~id:"validate.zero_frozen_deposits" + ~title:"Zero frozen deposits" + ~description:"The delegate has zero frozen deposits." + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "Delegate %a has zero frozen deposits; it is not allowed to \ + bake/preendorse/endorse." + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Zero_frozen_deposits delegate -> Some delegate | _ -> None) + (fun delegate -> Zero_frozen_deposits delegate) + + (** This type is only used in consensus operation errors to make + them more informative. *) + type consensus_operation_kind = + | Preendorsement + | Endorsement + | Grandparent_endorsement + | Dal_attestation + + let consensus_operation_kind_encoding = + Data_encoding.string_enum + [ + ("Preendorsement", Preendorsement); + ("Endorsement", Endorsement); + ("Grandparent_endorsement", Grandparent_endorsement); + ("Dal_attestation", Dal_attestation); + ] + + let consensus_operation_kind_pp fmt = function + | Preendorsement -> Format.fprintf fmt "Preendorsement" + | Endorsement -> Format.fprintf fmt "Endorsement" + | Grandparent_endorsement -> Format.fprintf fmt "Grandparent endorsement" + | Dal_attestation -> Format.fprintf fmt "Dal_attestation" + + (** Errors for preendorsements and endorsements. *) + type error += + | Consensus_operation_for_old_level of { + kind : consensus_operation_kind; + expected : Raw_level.t; + provided : Raw_level.t; + } + | Consensus_operation_for_future_level of { + kind : consensus_operation_kind; + expected : Raw_level.t; + provided : Raw_level.t; + } + | Consensus_operation_for_old_round of { + kind : consensus_operation_kind; + expected : Round.t; + provided : Round.t; + } + | Consensus_operation_for_future_round of { + kind : consensus_operation_kind; + expected : Round.t; + provided : Round.t; + } + | Wrong_consensus_operation_branch of { + kind : consensus_operation_kind; + expected : Block_hash.t; + provided : Block_hash.t; + } + | Wrong_payload_hash_for_consensus_operation of { + kind : consensus_operation_kind; + expected : Block_payload_hash.t; + provided : Block_payload_hash.t; + } + | Unexpected_preendorsement_in_block + | Unexpected_endorsement_in_block + | Preendorsement_round_too_high of { + block_round : Round.t; + provided : Round.t; + } + | Wrong_slot_used_for_consensus_operation of { + kind : consensus_operation_kind; + } + | Conflicting_consensus_operation of { + kind : consensus_operation_kind; + conflict : operation_conflict; + } + | Consensus_operation_not_allowed + + let () = + register_error_kind + `Outdated + ~id:"validate.consensus_operation_for_old_level" + ~title:"Consensus operation for old level" + ~description:"Consensus operation for old level." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a for old level (expected: %a, provided: %a)." + consensus_operation_kind_pp + kind + Raw_level.pp + expected + Raw_level.pp + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected" Raw_level.encoding) + (req "provided" Raw_level.encoding)) + (function + | Consensus_operation_for_old_level {kind; expected; provided} -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Consensus_operation_for_old_level {kind; expected; provided}) ; + register_error_kind + `Temporary + ~id:"validate.consensus_operation_for_future_level" + ~title:"Consensus operation for future level" + ~description:"Consensus operation for future level." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a for future level (expected: %a, provided: %a)." + consensus_operation_kind_pp + kind + Raw_level.pp + expected + Raw_level.pp + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected" Raw_level.encoding) + (req "provided" Raw_level.encoding)) + (function + | Consensus_operation_for_future_level {kind; expected; provided} -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Consensus_operation_for_future_level {kind; expected; provided}) ; + register_error_kind + `Branch + ~id:"validate.consensus_operation_for_old_round" + ~title:"Consensus operation for old round" + ~description:"Consensus operation for old round." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a for old round (expected_min: %a, provided: %a)." + consensus_operation_kind_pp + kind + Round.pp + expected + Round.pp + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected_min" Round.encoding) + (req "provided" Round.encoding)) + (function + | Consensus_operation_for_old_round {kind; expected; provided} -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Consensus_operation_for_old_round {kind; expected; provided}) ; + register_error_kind + `Temporary + ~id:"validate.consensus_operation_for_future_round" + ~title:"Consensus operation for future round" + ~description:"Consensus operation for future round." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a for future round (expected: %a, provided: %a)." + consensus_operation_kind_pp + kind + Round.pp + expected + Round.pp + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected_max" Round.encoding) + (req "provided" Round.encoding)) + (function + | Consensus_operation_for_future_round {kind; expected; provided} -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Consensus_operation_for_future_round {kind; expected; provided}) ; + register_error_kind + `Temporary + ~id:"validate.wrong_consensus_operation_branch" + ~title:"Wrong consensus operation branch" + ~description: + "Trying to include an endorsement or preendorsement which points to \ + the wrong block. It should be the predecessor for preendorsements and \ + the grandfather for endorsements." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a with wrong branch (expected: %a, provided: %a)." + consensus_operation_kind_pp + kind + Block_hash.pp + expected + Block_hash.pp + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected" Block_hash.encoding) + (req "provided" Block_hash.encoding)) + (function + | Wrong_consensus_operation_branch {kind; expected; provided} -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Wrong_consensus_operation_branch {kind; expected; provided}) ; + register_error_kind + (* Note: in Mempool mode this used to be + Consensus_operation_on_competing_proposal (which was + [`Branch] so we kept this classification). *) + `Branch + ~id:"validate.wrong_payload_hash_for_consensus_operation" + ~title:"Wrong payload hash for consensus operation" + ~description:"Wrong payload hash for consensus operation." + ~pp:(fun ppf (kind, expected, provided) -> + Format.fprintf + ppf + "%a with wrong payload hash (expected: %a, provided: %a)." + consensus_operation_kind_pp + kind + Block_payload_hash.pp_short + expected + Block_payload_hash.pp_short + provided) + Data_encoding.( + obj3 + (req "kind" consensus_operation_kind_encoding) + (req "expected" Block_payload_hash.encoding) + (req "provided" Block_payload_hash.encoding)) + (function + | Wrong_payload_hash_for_consensus_operation {kind; expected; provided} + -> + Some (kind, expected, provided) + | _ -> None) + (fun (kind, expected, provided) -> + Wrong_payload_hash_for_consensus_operation {kind; expected; provided}) ; + register_error_kind + `Permanent + ~id:"validate.unexpected_preendorsement_in_block" + ~title:"Unexpected preendorsement in block" + ~description:"Unexpected preendorsement in block." + ~pp:(fun ppf () -> + Format.fprintf ppf "Unexpected preendorsement in block.") + Data_encoding.empty + (function Unexpected_preendorsement_in_block -> Some () | _ -> None) + (fun () -> Unexpected_preendorsement_in_block) ; + register_error_kind + `Permanent + ~id:"validate.unexpected_endorsement_in_block" + ~title:"Unexpected endorsement in block" + ~description:"Unexpected endorsement in block." + ~pp:(fun ppf () -> Format.fprintf ppf "Unexpected endorsement in block.") + Data_encoding.empty + (function Unexpected_endorsement_in_block -> Some () | _ -> None) + (fun () -> Unexpected_endorsement_in_block) ; + register_error_kind + `Permanent + ~id:"validate.preendorsement_round_too_high" + ~title:"Preendorsement round too high" + ~description:"Preendorsement round too high." + ~pp:(fun ppf (block_round, provided) -> + Format.fprintf + ppf + "Preendorsement round too high (block_round: %a, provided: %a)." + Round.pp + block_round + Round.pp + provided) + Data_encoding.( + obj2 (req "block_round" Round.encoding) (req "provided" Round.encoding)) + (function + | Preendorsement_round_too_high {block_round; provided} -> + Some (block_round, provided) + | _ -> None) + (fun (block_round, provided) -> + Preendorsement_round_too_high {block_round; provided}) ; + register_error_kind + `Permanent + ~id:"validate.wrong_slot_for_consensus_operation" + ~title:"Wrong slot for consensus operation" + ~description:"Wrong slot used for a preendorsement or endorsement." + ~pp:(fun ppf kind -> + Format.fprintf + ppf + "Wrong slot used for a %a." + consensus_operation_kind_pp + kind) + Data_encoding.(obj1 (req "kind" consensus_operation_kind_encoding)) + (function + | Wrong_slot_used_for_consensus_operation {kind} -> Some kind + | _ -> None) + (fun kind -> Wrong_slot_used_for_consensus_operation {kind}) ; + register_error_kind + `Branch + ~id:"validate.double_inclusion_of_consensus_operation" + ~title:"Double inclusion of consensus operation" + ~description:"Double inclusion of consensus operation." + ~pp:(fun ppf (kind, Operation_conflict {existing; new_operation}) -> + Format.fprintf + ppf + "%a operation %a conflicts with existing %a" + consensus_operation_kind_pp + kind + Operation_hash.pp + new_operation + Operation_hash.pp + existing) + Data_encoding.( + obj2 + (req "kind" consensus_operation_kind_encoding) + (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_consensus_operation {kind; conflict} -> + Some (kind, conflict) + | _ -> None) + (fun (kind, conflict) -> Conflicting_consensus_operation {kind; conflict}) ; + register_error_kind + `Branch + ~id:"validate.consensus_operation_not_allowed" + ~title:"Consensus operation not allowed" + ~description:"Consensus operation not allowed." + ~pp:(fun ppf () -> + Format.fprintf ppf "Validation of consensus operation if forbidden ") + Data_encoding.empty + (function Consensus_operation_not_allowed -> Some () | _ -> None) + (fun () -> Consensus_operation_not_allowed) +end + +module Voting = struct + type error += + | (* Shared voting errors *) + Wrong_voting_period_index of { + expected : int32; + provided : int32; + } + | Wrong_voting_period_kind of { + current : Voting_period.kind; + expected : Voting_period.kind list; + } + | Source_not_in_vote_listings + | (* Proposals errors *) + Empty_proposals + | Proposals_contain_duplicate of {proposal : Protocol_hash.t} + | Already_proposed of {proposal : Protocol_hash.t} + | Too_many_proposals of {previous_count : int; operation_count : int} + | Conflicting_proposals of operation_conflict + | Testnet_dictator_multiple_proposals + | Proposals_from_unregistered_delegate of Signature.Public_key_hash.t + | (* Ballot errors *) + Ballot_for_wrong_proposal of { + current : Protocol_hash.t; + submitted : Protocol_hash.t; + } + | Already_submitted_a_ballot + | Ballot_from_unregistered_delegate of Signature.Public_key_hash.t + | Conflicting_ballot of operation_conflict + + let () = + (* Shared voting errors *) + register_error_kind + `Temporary + ~id:"validate.operation.wrong_voting_period_index" + ~title:"Wrong voting period index" + ~description: + "The voting operation contains a voting period index different from \ + the current one." + ~pp:(fun ppf (expected, provided) -> + Format.fprintf + ppf + "The voting operation is meant for voting period %ld, whereas the \ + current period is %ld." + provided + expected) + Data_encoding.( + obj2 (req "current_index" int32) (req "provided_index" int32)) + (function + | Wrong_voting_period_index {expected; provided} -> + Some (expected, provided) + | _ -> None) + (fun (expected, provided) -> + Wrong_voting_period_index {expected; provided}) ; + register_error_kind + `Temporary + ~id:"validate.operation.wrong_voting_period_kind" + ~title:"Wrong voting period kind" + ~description: + "The voting operation is incompatible the current voting period kind." + ~pp:(fun ppf (current, expected) -> + Format.fprintf + ppf + "The voting operation is only valid during a %a voting period, but \ + we are currently in a %a period." + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt " or ") + Voting_period.pp_kind) + expected + Voting_period.pp_kind + current) + Data_encoding.( + obj2 + (req "current" Voting_period.kind_encoding) + (req "expected" (list Voting_period.kind_encoding))) + (function + | Wrong_voting_period_kind {current; expected} -> + Some (current, expected) + | _ -> None) + (fun (current, expected) -> Wrong_voting_period_kind {current; expected}) ; + let description = "The delegate is not in the vote listings." in + register_error_kind + `Temporary + ~id:"validate.operation.source_not_in_vote_listings" + ~title:"Source not in vote listings" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Source_not_in_vote_listings -> Some () | _ -> None) + (fun () -> Source_not_in_vote_listings) ; + + (* Proposals errors *) + let description = "Proposal list cannot be empty." in + register_error_kind + `Permanent + ~id:"validate.operation.empty_proposals" + ~title:"Empty proposals" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Empty_proposals -> Some () | _ -> None) + (fun () -> Empty_proposals) ; + register_error_kind + `Permanent + ~id:"validate.operation.proposals_contain_duplicate" + ~title:"Proposals contain duplicate" + ~description:"The list of proposals contains a duplicate element." + ~pp:(fun ppf proposal -> + Format.fprintf + ppf + "The list of proposals contains multiple occurrences of the proposal \ + %a." + Protocol_hash.pp + proposal) + Data_encoding.(obj1 (req "proposal" Protocol_hash.encoding)) + (function + | Proposals_contain_duplicate {proposal} -> Some proposal | _ -> None) + (fun proposal -> Proposals_contain_duplicate {proposal}) ; + register_error_kind + `Branch + ~id:"validate.operation.already_proposed" + ~title:"Already proposed" + ~description: + "The delegate has already submitted one of the operation's proposals." + ~pp:(fun ppf proposal -> + Format.fprintf + ppf + "The delegate has already submitted the proposal %a." + Protocol_hash.pp + proposal) + Data_encoding.(obj1 (req "proposal" Protocol_hash.encoding)) + (function Already_proposed {proposal} -> Some proposal | _ -> None) + (fun proposal -> Already_proposed {proposal}) ; + register_error_kind + `Temporary + ~id:"validate.operation.conflict_too_many_proposals" + ~title:"Conflict too many proposals" + ~description: + "The delegate exceeded the maximum number of allowed proposals due to, \ + among others, previous Proposals operations in the current \ + block/mempool." + ~pp:(fun ppf (previous_count, operation_count) -> + Format.fprintf + ppf + "The delegate cannot submit too many protocol proposals: it \ + currently voted for %d and is trying to vote for %d more." + previous_count + operation_count) + Data_encoding.( + obj2 (req "previous_count" int8) (req "operation_count" int31)) + (function + | Too_many_proposals {previous_count; operation_count} -> + Some (previous_count, operation_count) + | _ -> None) + (fun (previous_count, operation_count) -> + Too_many_proposals {previous_count; operation_count}) ; + register_error_kind + `Temporary + ~id:"validate.operation.conflicting_proposals" + ~title:"Conflicting proposals" + ~description: + "The current block/mempool already contains a testnest dictator \ + proposals operation, so it cannot have any other voting operation." + ~pp:(fun ppf (Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "The current block/mempool already contains a conflicting operation \ + %a." + Operation_hash.pp + existing) + Data_encoding.(obj1 (req "conflict" operation_conflict_encoding)) + (function Conflicting_proposals conflict -> Some conflict | _ -> None) + (fun conflict -> Conflicting_proposals conflict) ; + let description = + "A testnet dictator cannot submit more than one proposal at a time." + in + register_error_kind + `Permanent + ~id:"validate.operation.testnet_dictator_multiple_proposals" + ~title:"Testnet dictator multiple proposals" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Testnet_dictator_multiple_proposals -> Some () | _ -> None) + (fun () -> Testnet_dictator_multiple_proposals) ; + register_error_kind + `Permanent + ~id:"operation.proposals_from_unregistered_delegate" + ~title:"Proposals from an unregistered delegate" + ~description:"Cannot submit proposals with an unregistered delegate." + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Cannot submit proposals with public key hash %a (unregistered \ + delegate)." + Signature.Public_key_hash.pp + c) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Proposals_from_unregistered_delegate c -> Some c | _ -> None) + (fun c -> Proposals_from_unregistered_delegate c) ; + + (* Ballot errors *) + register_error_kind + `Branch + ~id:"validate.operation.ballot_for_wrong_proposal" + ~title:"Ballot for wrong proposal" + ~description:"Ballot provided for a proposal that is not the current one." + ~pp:(fun ppf (current, submitted) -> + Format.fprintf + ppf + "Ballot provided for proposal %a whereas the current proposal is %a." + Protocol_hash.pp + submitted + Protocol_hash.pp + current) + Data_encoding.( + obj2 + (req "current_proposal" Protocol_hash.encoding) + (req "ballot_proposal" Protocol_hash.encoding)) + (function + | Ballot_for_wrong_proposal {current; submitted} -> + Some (current, submitted) + | _ -> None) + (fun (current, submitted) -> + Ballot_for_wrong_proposal {current; submitted}) ; + let description = + "The delegate has already submitted a ballot for the current voting \ + period." + in + register_error_kind + `Branch + ~id:"validate.operation.already_submitted_a_ballot" + ~title:"Already submitted a ballot" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Already_submitted_a_ballot -> Some () | _ -> None) + (fun () -> Already_submitted_a_ballot) ; + register_error_kind + `Permanent + ~id:"operation.ballot_from_unregistered_delegate" + ~title:"Ballot from an unregistered delegate" + ~description:"Cannot cast a ballot for an unregistered delegate." + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Cannot cast a ballot for public key hash %a (unregistered delegate)." + Signature.Public_key_hash.pp + c) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Ballot_from_unregistered_delegate c -> Some c | _ -> None) + (fun c -> Ballot_from_unregistered_delegate c) ; + register_error_kind + `Temporary + ~id:"validate.operation.conflicting_ballot" + ~title:"Conflicting ballot" + ~description: + "The delegate has already submitted a ballot in a previously validated \ + operation of the current block or mempool." + ~pp:(fun ppf (Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "The delegate has already submitted a ballot in the previously \ + validated operation %a of the current block or mempool." + Operation_hash.pp + existing) + Data_encoding.(obj1 (req "conflict" operation_conflict_encoding)) + (function Conflicting_ballot conflict -> Some conflict | _ -> None) + (fun conflict -> Conflicting_ballot conflict) +end + +module Anonymous = struct + type error += + | Invalid_activation of {pkh : Ed25519.Public_key_hash.t} + | Conflicting_activation of { + edpkh : Ed25519.Public_key_hash.t; + conflict : operation_conflict; + } + + let () = + register_error_kind + `Permanent + ~id:"validate.operation.invalid_activation" + ~title:"Invalid activation" + ~description: + "The given key and secret do not correspond to any existing \ + preallocated contract." + ~pp:(fun ppf pkh -> + Format.fprintf + ppf + "Invalid activation. The public key %a and accompanying secret do \ + not match any commitment." + Ed25519.Public_key_hash.pp + pkh) + Data_encoding.(obj1 (req "pkh" Ed25519.Public_key_hash.encoding)) + (function Invalid_activation {pkh} -> Some pkh | _ -> None) + (fun pkh -> Invalid_activation {pkh}) ; + register_error_kind + `Branch + ~id:"validate.operation.conflicting_activation" + ~title:"Account already activated in current validation_state" + ~description: + "The account has already been activated by a previous operation in the \ + current validation state." + ~pp:(fun ppf (edpkh, Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "Invalid activation: the account %a has already been activated in \ + the current validation state by operation %a." + Ed25519.Public_key_hash.pp + edpkh + Operation_hash.pp + existing) + Data_encoding.( + obj2 + (req "edpkh" Ed25519.Public_key_hash.encoding) + (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_activation {edpkh; conflict} -> Some (edpkh, conflict) + | _ -> None) + (fun (edpkh, conflict) -> Conflicting_activation {edpkh; conflict}) + + type denunciation_kind = Preendorsement | Endorsement | Block + + let denunciation_kind_encoding = + let open Data_encoding in + string_enum + [ + ("preendorsement", Preendorsement); + ("endorsement", Endorsement); + ("block", Block); + ] + + let pp_denunciation_kind fmt : denunciation_kind -> unit = function + | Preendorsement -> Format.fprintf fmt "preendorsement" + | Endorsement -> Format.fprintf fmt "endorsement" + | Block -> Format.fprintf fmt "block" + + type error += + | Invalid_double_baking_evidence of { + hash1 : Block_hash.t; + level1 : Raw_level.t; + round1 : Round.t; + hash2 : Block_hash.t; + level2 : Raw_level.t; + round2 : Round.t; + } + | Invalid_denunciation of denunciation_kind + | Inconsistent_denunciation of { + kind : denunciation_kind; + delegate1 : Signature.Public_key_hash.t; + delegate2 : Signature.Public_key_hash.t; + } + | Already_denounced of { + kind : denunciation_kind; + delegate : Signature.Public_key_hash.t; + level : Level.t; + } + | Conflicting_denunciation of { + kind : denunciation_kind; + conflict : operation_conflict; + } + | Too_early_denunciation of { + kind : denunciation_kind; + level : Raw_level.t; + current : Raw_level.t; + } + | Outdated_denunciation of { + kind : denunciation_kind; + level : Raw_level.t; + last_cycle : Cycle.t; + } + + let () = + register_error_kind + `Permanent + ~id:"validate.block.invalid_double_baking_evidence" + ~title:"Invalid double baking evidence" + ~description: + "A double-baking evidence is inconsistent (two distinct levels)" + ~pp:(fun ppf (hash1, level1, round1, hash2, level2, round2) -> + Format.fprintf + ppf + "Invalid double-baking evidence (hash: %a and %a, levels/rounds: \ + (%ld,%ld) and (%ld,%ld))" + Block_hash.pp + hash1 + Block_hash.pp + hash2 + (Raw_level.to_int32 level1) + (Round.to_int32 round1) + (Raw_level.to_int32 level2) + (Round.to_int32 round2)) + Data_encoding.( + obj6 + (req "hash1" Block_hash.encoding) + (req "level1" Raw_level.encoding) + (req "round1" Round.encoding) + (req "hash2" Block_hash.encoding) + (req "level2" Raw_level.encoding) + (req "round2" Round.encoding)) + (function + | Invalid_double_baking_evidence + {hash1; level1; round1; hash2; level2; round2} -> + Some (hash1, level1, round1, hash2, level2, round2) + | _ -> None) + (fun (hash1, level1, round1, hash2, level2, round2) -> + Invalid_double_baking_evidence + {hash1; level1; round1; hash2; level2; round2}) ; + register_error_kind + `Permanent + ~id:"validate.operation.block.invalid_denunciation" + ~title:"Invalid denunciation" + ~description:"A denunciation is malformed" + ~pp:(fun ppf kind -> + Format.fprintf + ppf + "Malformed double-%a evidence" + pp_denunciation_kind + kind) + Data_encoding.(obj1 (req "kind" denunciation_kind_encoding)) + (function Invalid_denunciation kind -> Some kind | _ -> None) + (fun kind -> Invalid_denunciation kind) ; + register_error_kind + `Permanent + ~id:"validate.operation.block.inconsistent_denunciation" + ~title:"Inconsistent denunciation" + ~description: + "A denunciation operation is inconsistent (two distinct delegates)" + ~pp:(fun ppf (kind, delegate1, delegate2) -> + Format.fprintf + ppf + "Inconsistent double-%a evidence (distinct delegate: %a and %a)" + pp_denunciation_kind + kind + Signature.Public_key_hash.pp_short + delegate1 + Signature.Public_key_hash.pp_short + delegate2) + Data_encoding.( + obj3 + (req "kind" denunciation_kind_encoding) + (req "delegate1" Signature.Public_key_hash.encoding) + (req "delegate2" Signature.Public_key_hash.encoding)) + (function + | Inconsistent_denunciation {kind; delegate1; delegate2} -> + Some (kind, delegate1, delegate2) + | _ -> None) + (fun (kind, delegate1, delegate2) -> + Inconsistent_denunciation {kind; delegate1; delegate2}) ; + register_error_kind + `Branch + ~id:"validate.operation.already_denounced" + ~title:"Already denounced" + ~description:"The same denunciation has already been validated." + ~pp:(fun ppf (kind, delegate, level) -> + Format.fprintf + ppf + "Delegate %a at level %a has already been denounced for a double %a." + pp_denunciation_kind + kind + Signature.Public_key_hash.pp + delegate + Level.pp + level) + Data_encoding.( + obj3 + (req "denunciation_kind" denunciation_kind_encoding) + (req "delegate" Signature.Public_key_hash.encoding) + (req "level" Level.encoding)) + (function + | Already_denounced {kind; delegate; level} -> + Some (kind, delegate, level) + | _ -> None) + (fun (kind, delegate, level) -> Already_denounced {kind; delegate; level}) ; + register_error_kind + `Branch + ~id:"validate.operation.conflicting_denunciation" + ~title:"Conflicting denunciation in current validation state" + ~description: + "The same denunciation has already been validated in the current \ + validation state." + ~pp:(fun ppf (kind, Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "Double %a evidence already exists in the current validation state \ + as operation %a." + pp_denunciation_kind + kind + Operation_hash.pp + existing) + Data_encoding.( + obj2 + (req "denunciation_kind" denunciation_kind_encoding) + (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_denunciation {kind; conflict} -> Some (kind, conflict) + | _ -> None) + (fun (kind, conflict) -> Conflicting_denunciation {kind; conflict}) ; + register_error_kind + `Temporary + ~id:"validate.operation.block.too_early_denunciation" + ~title:"Too early denunciation" + ~description:"A denunciation is too far in the future" + ~pp:(fun ppf (kind, level, current) -> + Format.fprintf + ppf + "A double-%a denunciation is too far in the future (current level: \ + %a, given level: %a)" + pp_denunciation_kind + kind + Raw_level.pp + current + Raw_level.pp + level) + Data_encoding.( + obj3 + (req "kind" denunciation_kind_encoding) + (req "level" Raw_level.encoding) + (req "current" Raw_level.encoding)) + (function + | Too_early_denunciation {kind; level; current} -> + Some (kind, level, current) + | _ -> None) + (fun (kind, level, current) -> + Too_early_denunciation {kind; level; current}) ; + register_error_kind + `Permanent + ~id:"validate.operation.block.outdated_denunciation" + ~title:"Outdated denunciation" + ~description:"A denunciation is outdated." + ~pp:(fun ppf (kind, level, last_cycle) -> + Format.fprintf + ppf + "A double-%a denunciation is outdated (last acceptable cycle: %a, \ + given level: %a)." + pp_denunciation_kind + kind + Cycle.pp + last_cycle + Raw_level.pp + level) + Data_encoding.( + obj3 + (req "kind" denunciation_kind_encoding) + (req "level" Raw_level.encoding) + (req "last" Cycle.encoding)) + (function + | Outdated_denunciation {kind; level; last_cycle} -> + Some (kind, level, last_cycle) + | _ -> None) + (fun (kind, level, last_cycle) -> + Outdated_denunciation {kind; level; last_cycle}) + + type error += Conflicting_nonce_revelation of operation_conflict + + let () = + register_error_kind + `Branch + ~id:"validate.operation.conflicting_nonce_revelation" + ~title:"Conflicting nonce revelation in the current validation state)." + ~description: + "A revelation for the same nonce has already been validated for the \ + current validation state." + ~pp:(fun ppf (Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "This nonce revelation is conflicting with an existing revelation %a" + Operation_hash.pp + existing) + Data_encoding.(obj1 (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_nonce_revelation conflict -> Some conflict | _ -> None) + (fun conflict -> Conflicting_nonce_revelation conflict) + + type error += Conflicting_vdf_revelation of operation_conflict + + let () = + register_error_kind + `Branch + ~id:"validate.operation.conflicting_vdf_revelation" + ~title:"Conflicting vdf revelation in the current validation state)." + ~description: + "A revelation for the same vdf has already been validated for the \ + current validation state." + ~pp:(fun ppf (Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "This vdf revelation is conflicting with an existing revelation %a" + Operation_hash.pp + existing) + Data_encoding.(obj1 (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_vdf_revelation conflict -> Some conflict | _ -> None) + (fun conflict -> Conflicting_vdf_revelation conflict) + + type error += + | Drain_delegate_on_unregistered_delegate of Signature.Public_key_hash.t + | Invalid_drain_delegate_inactive_key of { + delegate : Signature.Public_key_hash.t; + consensus_key : Signature.Public_key_hash.t; + active_consensus_key : Signature.Public_key_hash.t; + } + | Invalid_drain_delegate_no_consensus_key of Signature.Public_key_hash.t + | Invalid_drain_delegate_noop of Signature.Public_key_hash.t + | Invalid_drain_delegate_insufficient_funds_for_burn_or_fees of { + delegate : Signature.Public_key_hash.t; + destination : Signature.Public_key_hash.t; + min_amount : Tez.t; + } + | Conflicting_drain_delegate of { + delegate : Signature.Public_key_hash.t; + conflict : operation_conflict; + } + + let () = + register_error_kind + `Temporary + ~id:"operation.drain_delegate_key_on_unregistered_delegate" + ~title:"Drain delegate key on an unregistered delegate" + ~description:"Cannot drain an unregistered delegate." + ~pp:(fun ppf c -> + Format.fprintf + ppf + "Cannot drain an unregistered delegate %a." + Signature.Public_key_hash.pp + c) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function + | Drain_delegate_on_unregistered_delegate c -> Some c | _ -> None) + (fun c -> Drain_delegate_on_unregistered_delegate c) ; + register_error_kind + `Temporary + ~id:"operation.invalid_drain.inactive_key" + ~title:"Drain delegate with an inactive consensus key" + ~description:"Cannot drain with an inactive consensus key." + ~pp:(fun ppf (delegate, consensus_key, active_consensus_key) -> + Format.fprintf + ppf + "Consensus key %a is not the active consensus key for delegate %a. \ + The active consensus key is %a." + Signature.Public_key_hash.pp + consensus_key + Signature.Public_key_hash.pp + delegate + Signature.Public_key_hash.pp + active_consensus_key) + Data_encoding.( + obj3 + (req "delegate" Signature.Public_key_hash.encoding) + (req "consensus_key" Signature.Public_key_hash.encoding) + (req "active_consensus_key" Signature.Public_key_hash.encoding)) + (function + | Invalid_drain_delegate_inactive_key + {delegate; consensus_key; active_consensus_key} -> + Some (delegate, consensus_key, active_consensus_key) + | _ -> None) + (fun (delegate, consensus_key, active_consensus_key) -> + Invalid_drain_delegate_inactive_key + {delegate; consensus_key; active_consensus_key}) ; + register_error_kind + `Temporary + ~id:"operation.invalid_drain.no_consensus_key" + ~title:"Drain a delegate without consensus key" + ~description:"Cannot drain a delegate without consensus key." + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "There is no active consensus key for delegate %a." + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function + | Invalid_drain_delegate_no_consensus_key c -> Some c | _ -> None) + (fun c -> Invalid_drain_delegate_no_consensus_key c) ; + register_error_kind + `Temporary + ~id:"operation.invalid_drain.noop" + ~title:"Invalid drain delegate: noop" + ~description:"Cannot drain a delegate to itself." + ~pp:(fun ppf delegate -> + Format.fprintf + ppf + "The destination of a drain operation cannot be the delegate itself \ + (%a)." + Signature.Public_key_hash.pp + delegate) + Data_encoding.(obj1 (req "delegate" Signature.Public_key_hash.encoding)) + (function Invalid_drain_delegate_noop c -> Some c | _ -> None) + (fun c -> Invalid_drain_delegate_noop c) ; + register_error_kind + `Temporary + ~id:"operation.invalid_drain.insufficient_funds_for_burn_or_fees" + ~title: + "Drain delegate without enough balance for allocation burn or drain \ + fees" + ~description:"Cannot drain without enough allocation burn and drain fees." + ~pp:(fun ppf (delegate, destination, min_amount) -> + Format.fprintf + ppf + "Cannot drain delegate from %a to %a: not enough funds for the drain \ + fees in the delegate account (minimum balance required: %a)." + Signature.Public_key_hash.pp + delegate + Signature.Public_key_hash.pp + destination + Tez.pp + min_amount) + Data_encoding.( + obj3 + (req "delegate" Signature.Public_key_hash.encoding) + (req "destination" Signature.Public_key_hash.encoding) + (req "min_amount" Tez.encoding)) + (function + | Invalid_drain_delegate_insufficient_funds_for_burn_or_fees + {delegate; destination; min_amount} -> + Some (delegate, destination, min_amount) + | _ -> None) + (fun (delegate, destination, min_amount) -> + Invalid_drain_delegate_insufficient_funds_for_burn_or_fees + {delegate; destination; min_amount}) ; + register_error_kind + `Branch + ~id:"validate.operation.conflicting_drain" + ~title:"Conflicting drain in the current validation state)." + ~description: + "A manager operation or another drain operation is in conflict." + ~pp:(fun ppf (delegate, Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "This drain operation conflicts with operation %a for the delegate %a" + Operation_hash.pp + existing + Signature.Public_key_hash.pp + delegate) + Data_encoding.( + obj2 + (req "delegate" Signature.Public_key_hash.encoding) + (req "conflict" operation_conflict_encoding)) + (function + | Conflicting_drain_delegate {delegate; conflict} -> + Some (delegate, conflict) + | _ -> None) + (fun (delegate, conflict) -> + Conflicting_drain_delegate {delegate; conflict}) +end + +module Manager = struct + type error += + | Manager_restriction of { + source : Signature.Public_key_hash.t; + conflict : operation_conflict; + } + | Inconsistent_sources + | Inconsistent_counters + | Incorrect_reveal_position + | Insufficient_gas_for_manager + | Gas_quota_exceeded_init_deserialize + | Tx_rollup_feature_disabled + | Sc_rollup_feature_disabled + | Zk_rollup_feature_disabled + + let () = + register_error_kind + `Temporary + ~id:"validate.operation.manager_restriction" + ~title:"Manager restriction" + ~description: + "An operation with the same manager has already been validated in the \ + current block." + ~pp:(fun ppf (source, Operation_conflict {existing; _}) -> + Format.fprintf + ppf + "Manager %a already has the operation %a in the current block." + Signature.Public_key_hash.pp + source + Operation_hash.pp + existing) + Data_encoding.( + obj2 + (req "source" Signature.Public_key_hash.encoding) + (req "conflict" operation_conflict_encoding)) + (function + | Manager_restriction {source; conflict} -> Some (source, conflict) + | _ -> None) + (fun (source, conflict) -> Manager_restriction {source; conflict}) ; + let inconsistent_sources_description = + "The operation batch includes operations from different sources." + in + register_error_kind + `Permanent + ~id:"validate.operation.inconsistent_sources" + ~title:"Inconsistent sources in operation batch" + ~description:inconsistent_sources_description + ~pp:(fun ppf () -> + Format.fprintf ppf "%s" inconsistent_sources_description) + Data_encoding.empty + (function Inconsistent_sources -> Some () | _ -> None) + (fun () -> Inconsistent_sources) ; + let inconsistent_counters_description = + "Inconsistent counters in operation. Counters of an operation must be \ + successive." + in + register_error_kind + `Permanent + ~id:"validate.operation.inconsistent_counters" + ~title:"Inconsistent counters in operation" + ~description:inconsistent_counters_description + ~pp:(fun ppf () -> + Format.fprintf ppf "%s" inconsistent_counters_description) + Data_encoding.empty + (function Inconsistent_counters -> Some () | _ -> None) + (fun () -> Inconsistent_counters) ; + let incorrect_reveal_description = + "Incorrect reveal operation position in batch: only allowed in first \ + position." + in + register_error_kind + `Permanent + ~id:"validate.operation.incorrect_reveal_position" + ~title:"Incorrect reveal position" + ~description:incorrect_reveal_description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" incorrect_reveal_description) + Data_encoding.empty + (function Incorrect_reveal_position -> Some () | _ -> None) + (fun () -> Incorrect_reveal_position) ; + register_error_kind + `Permanent + ~id:"validate.operation.insufficient_gas_for_manager" + ~title:"Not enough gas for initial manager cost" + ~description: + (Format.asprintf + "Gas limit is too low to cover the initial cost of manager \ + operations: a minimum of %a gas units is required." + Gas.pp_cost_as_gas + Michelson_v1_gas.Cost_of.manager_operation) + Data_encoding.empty + (function Insufficient_gas_for_manager -> Some () | _ -> None) + (fun () -> Insufficient_gas_for_manager) ; + let gas_deserialize_description = + "Gas limit was not high enough to deserialize the transaction parameters \ + or origination script code or initial storage etc., making the \ + operation impossible to parse within the provided gas bounds." + in + register_error_kind + `Permanent + ~id:"validate.operation.gas_quota_exceeded_init_deserialize" + ~title:"Not enough gas for initial deserialization of script expressions" + ~description:gas_deserialize_description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" gas_deserialize_description) + Data_encoding.empty + (function Gas_quota_exceeded_init_deserialize -> Some () | _ -> None) + (fun () -> Gas_quota_exceeded_init_deserialize) ; + register_error_kind + `Permanent + ~id:"validate.operation.tx_rollup_is_disabled" + ~title:"Tx rollup is disabled" + ~description:"Cannot originate a tx rollup as it is disabled." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Cannot apply a tx rollup operation as it is disabled. This feature \ + will be enabled in a future proposal") + Data_encoding.unit + (function Tx_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Tx_rollup_feature_disabled) ; + let scoru_disabled_description = + "Smart contract rollups will be enabled in a future proposal." + in + register_error_kind + `Permanent + ~id:"validate.operation.sc_rollup_disabled" + ~title:"Smart contract rollups are disabled" + ~description:scoru_disabled_description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" scoru_disabled_description) + Data_encoding.unit + (function Sc_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Sc_rollup_feature_disabled) ; + let zkru_disabled_description = + "ZK rollups will be enabled in a future proposal." + in + register_error_kind + `Permanent + ~id:"validate.operation.zk_rollup_disabled" + ~title:"ZK rollups are disabled" + ~description:zkru_disabled_description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" zkru_disabled_description) + Data_encoding.unit + (function Zk_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Zk_rollup_feature_disabled) +end + +type error += Failing_noop_error + +let () = + let description = "A failing_noop operation can never be validated." in + register_error_kind + `Permanent + ~id:"validate.operation.failing_noop_error" + ~title:"Failing_noop error" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.empty + (function Failing_noop_error -> Some () | _ -> None) + (fun () -> Failing_noop_error) + +module Block = struct + type error += + | Not_enough_endorsements of {required : int; provided : int} + | Inconsistent_validation_passes_in_block of { + expected : int; + provided : int; + } + + let () = + register_error_kind + `Permanent + ~id:"validate.block.not_enough_endorsements" + ~title:"Not enough endorsements" + ~description: + "The block being validated does not include the required minimum \ + number of endorsements." + ~pp:(fun ppf (required, provided) -> + Format.fprintf + ppf + "Wrong number of endorsements (%i), at least %i are expected" + provided + required) + Data_encoding.(obj2 (req "required" int31) (req "provided" int31)) + (function + | Not_enough_endorsements {required; provided} -> + Some (required, provided) + | _ -> None) + (fun (required, provided) -> Not_enough_endorsements {required; provided}) ; + register_error_kind + `Permanent + ~id:"validate.block.inconsistent_validation_passes_in_block" + ~title:"Inconsistent validation passes in block" + ~description: + "Validation of operation should be ordered by their validation passes \ + in a block." + ~pp:(fun ppf (expected, provided) -> + Format.fprintf + ppf + "Validation of operation should be ordered by their validation \ + passes in a block. Got an operation with validation pass: %d while \ + the last validated operation had the validation pass %d." + provided + expected) + Data_encoding.(obj2 (req "expected" int31) (req "provided" int31)) + (function + | Inconsistent_validation_passes_in_block {expected; provided} -> + Some (expected, provided) + | _ -> None) + (fun (expected, provided) -> + Inconsistent_validation_passes_in_block {expected; provided}) +end diff --git a/src/proto_016_PtMumbai/lib_protocol/validate_errors.mli b/src/proto_016_PtMumbai/lib_protocol/validate_errors.mli new file mode 100644 index 000000000000..4fac7b0195dc --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/validate_errors.mli @@ -0,0 +1,213 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +(** type used for conflicting operation. *) +type operation_conflict = + | Operation_conflict of { + existing : Operation_hash.t; + new_operation : Operation_hash.t; + } + +(** Errors that may arise while validating a consensus operation. *) +module Consensus : sig + type consensus_operation_kind = + | Preendorsement + | Endorsement + | Grandparent_endorsement + | Dal_attestation + + (** Errors for preendorsements and endorsements. *) + type error += + | Zero_frozen_deposits of Signature.Public_key_hash.t + | Consensus_operation_not_allowed + | Consensus_operation_for_old_level of { + kind : consensus_operation_kind; + expected : Raw_level.t; + provided : Raw_level.t; + } + | Consensus_operation_for_future_level of { + kind : consensus_operation_kind; + expected : Raw_level.t; + provided : Raw_level.t; + } + | Consensus_operation_for_old_round of { + kind : consensus_operation_kind; + expected : Round.t; + provided : Round.t; + } + | Consensus_operation_for_future_round of { + kind : consensus_operation_kind; + expected : Round.t; + provided : Round.t; + } + | Wrong_consensus_operation_branch of { + kind : consensus_operation_kind; + expected : Block_hash.t; + provided : Block_hash.t; + } + | Wrong_payload_hash_for_consensus_operation of { + kind : consensus_operation_kind; + expected : Block_payload_hash.t; + provided : Block_payload_hash.t; + } + | Unexpected_preendorsement_in_block + | Unexpected_endorsement_in_block + | Preendorsement_round_too_high of { + block_round : Round.t; + provided : Round.t; + } + | Wrong_slot_used_for_consensus_operation of { + kind : consensus_operation_kind; + } + | Conflicting_consensus_operation of { + kind : consensus_operation_kind; + conflict : operation_conflict; + } +end + +(** Errors that may arise while validating a voting operation. *) +module Voting : sig + type error += + | (* Shared voting errors *) + Wrong_voting_period_index of { + expected : int32; + provided : int32; + } + | Wrong_voting_period_kind of { + current : Voting_period.kind; + expected : Voting_period.kind list; + } + | Source_not_in_vote_listings + | (* Proposals errors *) + Empty_proposals + | Proposals_contain_duplicate of {proposal : Protocol_hash.t} + | Already_proposed of {proposal : Protocol_hash.t} + | Too_many_proposals of {previous_count : int; operation_count : int} + | Conflicting_proposals of operation_conflict + | Testnet_dictator_multiple_proposals + | Proposals_from_unregistered_delegate of Signature.Public_key_hash.t + | (* Ballot errors *) + Ballot_for_wrong_proposal of { + current : Protocol_hash.t; + submitted : Protocol_hash.t; + } + | Already_submitted_a_ballot + | Ballot_from_unregistered_delegate of Signature.Public_key_hash.t + | Conflicting_ballot of operation_conflict +end + +(** Errors that may arise while validating an anonymous operation. *) +module Anonymous : sig + type denunciation_kind = Preendorsement | Endorsement | Block + + type error += + | Invalid_activation of {pkh : Ed25519.Public_key_hash.t} + | Conflicting_activation of { + edpkh : Ed25519.Public_key_hash.t; + conflict : operation_conflict; + } + | Invalid_denunciation of denunciation_kind + | Invalid_double_baking_evidence of { + hash1 : Block_hash.t; + level1 : Raw_level.t; + round1 : Round.t; + hash2 : Block_hash.t; + level2 : Raw_level.t; + round2 : Round.t; + } + | Inconsistent_denunciation of { + kind : denunciation_kind; + delegate1 : Signature.Public_key_hash.t; + delegate2 : Signature.Public_key_hash.t; + } + | Already_denounced of { + kind : denunciation_kind; + delegate : Signature.Public_key_hash.t; + level : Level.t; + } + | Conflicting_denunciation of { + kind : denunciation_kind; + conflict : operation_conflict; + } + | Too_early_denunciation of { + kind : denunciation_kind; + level : Raw_level.t; + current : Raw_level.t; + } + | Outdated_denunciation of { + kind : denunciation_kind; + level : Raw_level.t; + last_cycle : Cycle.t; + } + | Conflicting_nonce_revelation of operation_conflict + | Conflicting_vdf_revelation of operation_conflict + | Drain_delegate_on_unregistered_delegate of Signature.Public_key_hash.t + | Invalid_drain_delegate_inactive_key of { + delegate : Signature.Public_key_hash.t; + consensus_key : Signature.Public_key_hash.t; + active_consensus_key : Signature.Public_key_hash.t; + } + | Invalid_drain_delegate_no_consensus_key of Signature.Public_key_hash.t + | Invalid_drain_delegate_noop of Signature.Public_key_hash.t + | Invalid_drain_delegate_insufficient_funds_for_burn_or_fees of { + delegate : Signature.Public_key_hash.t; + destination : Signature.Public_key_hash.t; + min_amount : Tez.t; + } + | Conflicting_drain_delegate of { + delegate : Signature.Public_key_hash.t; + conflict : operation_conflict; + } +end + +(** Errors that may arise while validating a manager operation. *) +module Manager : sig + type error += + | Manager_restriction of { + source : Signature.Public_key_hash.t; + conflict : operation_conflict; + } + | Inconsistent_sources + | Inconsistent_counters + | Incorrect_reveal_position + | Insufficient_gas_for_manager + | Gas_quota_exceeded_init_deserialize + | Tx_rollup_feature_disabled + | Sc_rollup_feature_disabled + | Zk_rollup_feature_disabled +end + +type error += Failing_noop_error + +module Block : sig + type error += + | Not_enough_endorsements of {required : int; provided : int} + | Inconsistent_validation_passes_in_block of { + expected : int; + provided : int; + } +end diff --git a/src/proto_016_PtMumbai/lib_protocol/vote_repr.ml b/src/proto_016_PtMumbai/lib_protocol/vote_repr.ml new file mode 100644 index 000000000000..493b5b194683 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/vote_repr.ml @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type proposal = Protocol_hash.t + +type ballot = Yay | Nay | Pass + +let ballot_encoding = + let of_int8 = function + | 0 -> Ok Yay + | 1 -> Ok Nay + | 2 -> Ok Pass + | _ -> Error "ballot_of_int8" + in + let to_int8 = function Yay -> 0 | Nay -> 1 | Pass -> 2 in + let open Data_encoding in + (* union *) + splitted + ~binary:(conv_with_guard to_int8 of_int8 int8) + ~json:(string_enum [("yay", Yay); ("nay", Nay); ("pass", Pass)]) + +let equal_ballot a b = + match (a, b) with Yay, Yay | Nay, Nay | Pass, Pass -> true | _ -> false + +let pp_ballot ppf = function + | Yay -> Format.fprintf ppf "yay" + | Nay -> Format.fprintf ppf "nay" + | Pass -> Format.fprintf ppf "pass" diff --git a/src/proto_016_PtMumbai/lib_protocol/vote_repr.mli b/src/proto_016_PtMumbai/lib_protocol/vote_repr.mli new file mode 100644 index 000000000000..adfd1a167d09 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/vote_repr.mli @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** a protocol change proposal *) +type proposal = Protocol_hash.t + +(** votes can be for, against or neutral. + Neutral serves to count towards a quorum *) +type ballot = Yay | Nay | Pass + +val ballot_encoding : ballot Data_encoding.t + +val equal_ballot : ballot -> ballot -> bool + +val pp_ballot : Format.formatter -> ballot -> unit diff --git a/src/proto_016_PtMumbai/lib_protocol/vote_storage.ml b/src/proto_016_PtMumbai/lib_protocol/vote_storage.ml new file mode 100644 index 000000000000..f2d110f8844b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/vote_storage.ml @@ -0,0 +1,269 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let get_delegate_proposal_count ctxt proposer = + Storage.Vote.Proposals_count.find ctxt proposer >|=? Option.value ~default:0 + +let set_delegate_proposal_count ctxt proposer count = + Storage.Vote.Proposals_count.add ctxt proposer count + +let has_proposed ctxt proposer proposal = + Storage.Vote.Proposals.mem ctxt (proposal, proposer) + +let add_proposal ctxt proposer proposal = + Storage.Vote.Proposals.add ctxt (proposal, proposer) + +let get_proposals ctxt = + Storage.Vote.Proposals.fold + ctxt + ~order:`Sorted + ~init:(ok Protocol_hash.Map.empty) + ~f:(fun (proposal, delegate) acc -> + (* Assuming the same listings is used at votings *) + Storage.Vote.Listings.get ctxt delegate >>=? fun weight -> + Lwt.return + ( acc >|? fun acc -> + let previous = + match Protocol_hash.Map.find proposal acc with + | None -> 0L + | Some x -> x + in + Protocol_hash.Map.add proposal (Int64.add weight previous) acc )) + +let clear_proposals ctxt = + Storage.Vote.Proposals_count.clear ctxt >>= fun ctxt -> + Storage.Vote.Proposals.clear ctxt + +type ballots = {yay : int64; nay : int64; pass : int64} + +let ballots_zero = {yay = 0L; nay = 0L; pass = 0L} + +let ballots_encoding = + let open Data_encoding in + conv + (fun {yay; nay; pass} -> (yay, nay, pass)) + (fun (yay, nay, pass) -> {yay; nay; pass}) + @@ obj3 (req "yay" int64) (req "nay" int64) (req "pass" int64) + +let equal_ballots b1 b2 = + Int64.(equal b1.yay b2.yay && equal b1.nay b2.nay && equal b1.pass b2.pass) + +let pp_ballots ppf b = + Format.fprintf ppf "{ yay = %Ld; nay = %Ld; pass = %Ld }" b.yay b.nay b.pass + +let has_recorded_ballot = Storage.Vote.Ballots.mem + +let record_ballot = Storage.Vote.Ballots.init + +let get_ballots ctxt = + Storage.Vote.Ballots.fold + ctxt + ~order:`Sorted + ~f:(fun delegate ballot (ballots : ballots tzresult) -> + (* Assuming the same listings is used at votings *) + Storage.Vote.Listings.get ctxt delegate >>=? fun weight -> + let count = Int64.add weight in + Lwt.return + ( ballots >|? fun ballots -> + match ballot with + | Yay -> {ballots with yay = count ballots.yay} + | Nay -> {ballots with nay = count ballots.nay} + | Pass -> {ballots with pass = count ballots.pass} )) + ~init:(ok ballots_zero) + +let get_ballot_list = Storage.Vote.Ballots.bindings + +let clear_ballots = Storage.Vote.Ballots.clear + +let listings_encoding = + Data_encoding.( + list + (obj2 + (req "pkh" Signature.Public_key_hash.encoding) + (req "voting_power" int64))) + +let update_listings ctxt = + Storage.Vote.Listings.clear ctxt >>= fun ctxt -> + Stake_storage.fold + ctxt + (ctxt, 0L) + ~order:`Sorted + ~f:(fun (delegate, stake) (ctxt, total) -> + let weight = Tez_repr.to_mutez stake in + Storage.Vote.Listings.init ctxt delegate weight >>=? fun ctxt -> + return (ctxt, Int64.add total weight)) + >>=? fun (ctxt, total) -> + Storage.Vote.Voting_power_in_listings.add ctxt total >>= fun ctxt -> + return ctxt + +type delegate_info = { + voting_power : Int64.t option; + current_ballot : Vote_repr.ballot option; + current_proposals : Protocol_hash.t list; + remaining_proposals : int; +} + +let pp_delegate_info ppf info = + match info.voting_power with + | None -> Format.fprintf ppf "Voting power: none" + | Some p -> ( + Format.fprintf + ppf + "Voting power: %a" + Tez_repr.pp + (Tez_repr.of_mutez_exn p) ; + (match info.current_ballot with + | None -> () + | Some ballot -> + Format.fprintf ppf "@,Current ballot: %a" Vote_repr.pp_ballot ballot) ; + match info.current_proposals with + | [] -> + if Compare.Int.(info.remaining_proposals <> 0) then + Format.fprintf + ppf + "@,Remaining proposals: %d" + info.remaining_proposals + | proposals -> + Format.fprintf ppf "@,@[<v 2>Current proposals:" ; + List.iter + (fun p -> Format.fprintf ppf "@,- %a" Protocol_hash.pp p) + proposals ; + Format.fprintf ppf "@]" ; + Format.fprintf + ppf + "@,Remaining proposals: %d" + info.remaining_proposals) + +let delegate_info_encoding = + let open Data_encoding in + conv + (fun {voting_power; current_ballot; current_proposals; remaining_proposals} -> + (voting_power, current_ballot, current_proposals, remaining_proposals)) + (fun (voting_power, current_ballot, current_proposals, remaining_proposals) -> + {voting_power; current_ballot; current_proposals; remaining_proposals}) + (obj4 + (opt "voting_power" int64) + (opt "current_ballot" Vote_repr.ballot_encoding) + (dft "current_proposals" (list Protocol_hash.encoding) []) + (dft "remaining_proposals" int31 0)) + +let in_listings = Storage.Vote.Listings.mem + +let get_listings = Storage.Vote.Listings.bindings + +let get_delegate_info ctxt delegate = + Storage.Vote.Listings.find ctxt delegate >>=? fun voting_power -> + match voting_power with + | None -> + return + { + voting_power; + current_proposals = []; + current_ballot = None; + remaining_proposals = 0; + } + | Some _ -> + Voting_period_storage.get_current_kind ctxt >>=? fun period -> + (match period with + | Exploration | Promotion -> Storage.Vote.Ballots.find ctxt delegate + | Proposal | Cooldown | Adoption -> return None) + >>=? fun current_ballot -> + (match period with + | Exploration | Promotion | Cooldown | Adoption -> Lwt.return [] + | Proposal -> + Storage.Vote.Proposals.fold + ctxt + ~order:`Undefined + ~init:[] + ~f:(fun (h, d) acc -> + if Signature.Public_key_hash.equal d delegate then + Lwt.return (h :: acc) + else Lwt.return acc)) + >>= fun current_proposals -> + let remaining_proposals = + match period with + | Proposal -> + Constants_repr.max_proposals_per_delegate + - List.length current_proposals + | _ -> 0 + in + return + {voting_power; current_ballot; current_proposals; remaining_proposals} + +let get_voting_power_free ctxt owner = + Storage.Vote.Listings.find ctxt owner >|=? Option.value ~default:0L + +(* This function bypasses the carbonated functors to account for gas consumption. + This is a temporary situation intended to be fixed by adding the right + carbonated functors in a future amendment *) +let get_voting_power ctxt owner = + let open Raw_context in + (* Always consume read access to memory *) + (* Accessing an int64 at /votes/listings/<KeyKind>/<hash> *) + consume_gas ctxt (Storage_costs.read_access ~path_length:4 ~read_bytes:8) + >>?= fun ctxt -> + Storage.Vote.Listings.find ctxt owner >|=? function + | None -> (ctxt, 0L) + | Some power -> (ctxt, power) + +let get_total_voting_power_free = Storage.Vote.Voting_power_in_listings.get + +(* This function bypasses the carbonated functors to account for gas consumption. + This is a temporary situation intended to be fixed by adding the right + carbonated functors in a future amendment *) +let get_total_voting_power ctxt = + let open Raw_context in + (* Accessing an int64 at /votes/total_voting_power *) + consume_gas ctxt (Storage_costs.read_access ~path_length:2 ~read_bytes:8) + >>?= fun ctxt -> + get_total_voting_power_free ctxt >|=? fun total_voting_power -> + (ctxt, total_voting_power) + +let get_current_quorum ctxt = + Storage.Vote.Participation_ema.get ctxt >|=? fun participation_ema -> + let quorum_min = Constants_storage.quorum_min ctxt in + let quorum_max = Constants_storage.quorum_max ctxt in + let quorum_diff = Int32.sub quorum_max quorum_min in + Int32.(add quorum_min (div (mul participation_ema quorum_diff) 100_00l)) + +let get_participation_ema = Storage.Vote.Participation_ema.get + +let set_participation_ema = Storage.Vote.Participation_ema.update + +let current_proposal_exists = Storage.Vote.Current_proposal.mem + +let get_current_proposal = Storage.Vote.Current_proposal.get + +let find_current_proposal = Storage.Vote.Current_proposal.find + +let init_current_proposal = Storage.Vote.Current_proposal.init + +let clear_current_proposal = Storage.Vote.Current_proposal.remove + +let init ctxt ~start_position = + (* participation EMA is in centile of a percentage *) + let participation_ema = Constants_storage.quorum_max ctxt in + Storage.Vote.Participation_ema.init ctxt participation_ema >>=? fun ctxt -> + Voting_period_storage.init_first_period ctxt ~start_position diff --git a/src/proto_016_PtMumbai/lib_protocol/vote_storage.mli b/src/proto_016_PtMumbai/lib_protocol/vote_storage.mli new file mode 100644 index 000000000000..69d0619f781a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/vote_storage.mli @@ -0,0 +1,184 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Manages all the voting related storage in Storage.Vote. *) + +(** [get_delegate_proposal_count ctxt proposer] returns the number of + proposals already made by [proposer] in the current voting cycle. + + This number of proposals, aka [count], has its own storage bucket. + + @return [0] if the [count] of the proposer was not initialized. + + @return [Error Storage_error] if the deserialization of [count] + fails. *) +val get_delegate_proposal_count : + Raw_context.t -> Signature.public_key_hash -> int tzresult Lwt.t + +(** [set_delegate_proposal_count ctxt proposer count] sets + [proposer]'s number of submitted proposals to [count]. + + More precisely, the relevant storage bucket is allocated and + initialized to [count] if it didn't exist; otherwise it is simply + updated. *) +val set_delegate_proposal_count : + Raw_context.t -> Signature.public_key_hash -> int -> Raw_context.t Lwt.t + +(** [has_proposed ctxt proposer proposal] indicates whether the + [proposer] has already proposed the [proposal]. *) +val has_proposed : + Raw_context.t -> Signature.public_key_hash -> Protocol_hash.t -> bool Lwt.t + +(** [add_proposal ctxt proposer proposal] records the submission of + [proposal] by [proposer]. *) +val add_proposal : + Raw_context.t -> + Signature.public_key_hash -> + Protocol_hash.t -> + Raw_context.t Lwt.t + +(** Computes for each proposal how many delegates proposed it. *) +val get_proposals : Raw_context.t -> int64 Protocol_hash.Map.t tzresult Lwt.t + +val clear_proposals : Raw_context.t -> Raw_context.t Lwt.t + +(** Counts of the votes *) +type ballots = {yay : int64; nay : int64; pass : int64} + +(** All vote counts set to zero. *) +val ballots_zero : ballots + +(** Encoding for {!ballots}. *) +val ballots_encoding : ballots Data_encoding.t + +(** Equality check for {!ballots}. *) +val equal_ballots : ballots -> ballots -> bool + +(** Pretty printer for {!ballots}. *) +val pp_ballots : Format.formatter -> ballots -> unit + +val has_recorded_ballot : + Raw_context.t -> Signature.Public_key_hash.t -> bool Lwt.t + +(** Records a vote for a delegate, returns a {!Storage_error Existing_key} if + the vote was already registered *) +val record_ballot : + Raw_context.t -> + Signature.Public_key_hash.t -> + Vote_repr.ballot -> + Raw_context.t tzresult Lwt.t + +(** Computes the sum of the current ballots weighted by stake. *) +val get_ballots : Raw_context.t -> ballots tzresult Lwt.t + +val get_ballot_list : + Raw_context.t -> (Signature.Public_key_hash.t * Vote_repr.ballot) list Lwt.t + +val clear_ballots : Raw_context.t -> Raw_context.t Lwt.t + +val listings_encoding : + (Signature.Public_key_hash.t * int64) list Data_encoding.t + +(** Populates [!Storage.Vote.Listings] using the currently existing + staking power and sets `Voting_power_in_listings`. Inactive + delegates or delegates without the minimal required stake are not + included in the listings. *) +val update_listings : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** Verifies the presence of a delegate in the listing. *) +val in_listings : Raw_context.t -> Signature.Public_key_hash.t -> bool Lwt.t + +val get_listings : + Raw_context.t -> (Signature.Public_key_hash.t * int64) list Lwt.t + +type delegate_info = { + voting_power : Int64.t option; + current_ballot : Vote_repr.ballot option; + current_proposals : Protocol_hash.t list; + remaining_proposals : int; +} + +val pp_delegate_info : Format.formatter -> delegate_info -> unit + +val delegate_info_encoding : delegate_info Data_encoding.t + +val get_delegate_info : + Raw_context.t -> Signature.public_key_hash -> delegate_info tzresult Lwt.t + +val get_voting_power_free : + Raw_context.t -> Signature.public_key_hash -> int64 tzresult Lwt.t + +val get_voting_power : + Raw_context.t -> + Signature.public_key_hash -> + (Raw_context.t * int64) tzresult Lwt.t + +(** Returns the sum of all voting power in the listings, + without accounting for gas cost. *) +val get_total_voting_power_free : Raw_context.t -> int64 tzresult Lwt.t + +(** Returns the sum of all voting power in the listings. *) +val get_total_voting_power : + Raw_context.t -> (Raw_context.t * int64) tzresult Lwt.t + +val get_current_quorum : Raw_context.t -> int32 tzresult Lwt.t + +val get_participation_ema : Raw_context.t -> int32 tzresult Lwt.t + +val set_participation_ema : + Raw_context.t -> int32 -> Raw_context.t tzresult Lwt.t + +(** Indicates whether there is a current proposal in the storage. *) +val current_proposal_exists : Raw_context.t -> bool Lwt.t + +(** Retrieves the current proposal. + + @return [Error Storage_error] if there is no current proposal, or + if the deserialization fails. *) +val get_current_proposal : Raw_context.t -> Protocol_hash.t tzresult Lwt.t + +(** Retrieves the current proposal. + + @return [None] if there is no current proposal. + + @return [Error Storage_error] if the deserialization fails. *) +val find_current_proposal : + Raw_context.t -> Protocol_hash.t option tzresult Lwt.t + +(** Registers a current proposal. + + @return [Error (Storage_error Existing_key)] if there was already + a current proposal. *) +val init_current_proposal : + Raw_context.t -> Protocol_hash.t -> Raw_context.t tzresult Lwt.t + +(** Removes the current proposal. Does nothing if there was no current + proposal. *) +val clear_current_proposal : Raw_context.t -> Raw_context.t Lwt.t + +(** Sets the initial quorum to 80% and period kind to proposal. *) +val init : + Raw_context.t -> start_position:Int32.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.ml b/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.ml new file mode 100644 index 000000000000..de4cf915bc46 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.ml @@ -0,0 +1,175 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type kind = Proposal | Exploration | Cooldown | Promotion | Adoption + +let string_of_kind = function + | Proposal -> "proposal" + | Exploration -> "exploration" + | Cooldown -> "cooldown" + | Promotion -> "promotion" + | Adoption -> "adoption" + +let pp_kind ppf kind = Format.fprintf ppf "%s" @@ string_of_kind kind + +let kind_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + (Tag 0) + ~title:"Proposal" + (constant "proposal") + (function Proposal -> Some () | _ -> None) + (fun () -> Proposal); + case + (Tag 1) + ~title:"exploration" + (constant "exploration") + (function Exploration -> Some () | _ -> None) + (fun () -> Exploration); + case + (Tag 2) + ~title:"Cooldown" + (constant "cooldown") + (function Cooldown -> Some () | _ -> None) + (fun () -> Cooldown); + case + (Tag 3) + ~title:"Promotion" + (constant "promotion") + (function Promotion -> Some () | _ -> None) + (fun () -> Promotion); + case + (Tag 4) + ~title:"Adoption" + (constant "adoption") + (function Adoption -> Some () | _ -> None) + (fun () -> Adoption); + ] + +let succ_kind = function + | Proposal -> Exploration + | Exploration -> Cooldown + | Cooldown -> Promotion + | Promotion -> Adoption + | Adoption -> Proposal + +type voting_period = {index : int32; kind : kind; start_position : int32} + +type t = voting_period + +type info = {voting_period : t; position : int32; remaining : int32} + +let root ~start_position = {index = 0l; kind = Proposal; start_position} + +let pp ppf {index; kind; start_position} = + Format.fprintf + ppf + "@[<hv 2>index: %ld,@ kind:%a,@ start_position: %ld@]" + index + pp_kind + kind + start_position + +let pp_info ppf {voting_period; position; remaining} = + Format.fprintf + ppf + "@[<hv 2>voting_period: %a,@ position:%ld,@ remaining: %ld@]" + pp + voting_period + position + remaining + +let encoding = + let open Data_encoding in + conv + (fun {index; kind; start_position} -> (index, kind, start_position)) + (fun (index, kind, start_position) -> {index; kind; start_position}) + (obj3 + (req + "index" + ~description: + "The voting period's index. Starts at 0 with the first block of \ + the Alpha family of protocols." + int32) + (req + ~description: + "One of the several kinds of periods in the voting procedure." + "kind" + kind_encoding) + (req + ~description: + "The relative position of the first level of the period with \ + respect to the first level of the Alpha family of protocols." + "start_position" + int32)) + +let info_encoding = + let open Data_encoding in + conv + (fun {voting_period; position; remaining} -> + (voting_period, position, remaining)) + (fun (voting_period, position, remaining) -> + {voting_period; position; remaining}) + (obj3 + (req + ~description:"The voting period to which the block belongs." + "voting_period" + encoding) + (req + ~description:"The position of the block within the voting period." + "position" + int32) + (req + ~description: + "The number of blocks remaining till the end of the voting period." + "remaining" + int32)) + +include Compare.Make (struct + type nonrec t = t + + let compare p p' = Compare.Int32.compare p.index p'.index +end) + +let raw_reset period ~start_position = + let index = Int32.succ period.index in + let kind = Proposal in + {index; kind; start_position} + +let raw_succ period ~start_position = + let index = Int32.succ period.index in + let kind = succ_kind period.kind in + {index; kind; start_position} + +let position_since (level : Level_repr.t) (voting_period : t) = + Int32.(sub level.level_position voting_period.start_position) + +let remaining_blocks (level : Level_repr.t) (voting_period : t) + ~blocks_per_voting_period = + let position = position_since level voting_period in + Int32.(sub blocks_per_voting_period (succ position)) diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.mli b/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.mli new file mode 100644 index 000000000000..92e87bf1236c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_period_repr.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The voting period kinds are ordered as follows: + Proposal -> Exploration -> Cooldown -> Promotion -> Adoption. + This order is the one used be the function [succ] below. + *) +type kind = + | Proposal (** protocols can be proposed *) + | Exploration (** a proposal can be voted *) + | Cooldown (** a delay before the second vote of the Promotion period. *) + | Promotion (** activation can be voted *) + | Adoption (** a delay before activation *) + +val kind_encoding : kind Data_encoding.t + +(** A voting period can be of several kinds and is uniquely identified by + the counter 'index'. The 'start_position' represents the relative + position of the first level of the period with respect to the + first level of the Alpha family of protocols. *) +type voting_period = {index : Int32.t; kind : kind; start_position : Int32.t} + +type t = voting_period + +(** Information about a block with respect to the voting period it + belongs to: the voting period, the position within the voting + period and the number of remaining blocks till the end of the + period. The following invariant is satisfied: + `position + remaining + 1 = blocks_per_voting_period` *) +type info = {voting_period : t; position : Int32.t; remaining : Int32.t} + +val root : start_position:Int32.t -> t + +include Compare.S with type t := voting_period + +val encoding : t Data_encoding.t + +val info_encoding : info Data_encoding.t + +val pp : Format.formatter -> t -> unit + +val pp_info : Format.formatter -> info -> unit + +val pp_kind : Format.formatter -> kind -> unit + +(** [raw_reset period ~start_position] increment the index by one and set the + kind to Proposal which is the period kind that start the voting + process. [start_position] is the level at wich this voting_period started. +*) +val raw_reset : t -> start_position:Int32.t -> t + +(** [raw_succ period ~start_position] increment the index by one and set the + kind to its successor. [start_position] is the level at which this + voting_period started. *) +val raw_succ : t -> start_position:Int32.t -> t + +val position_since : Level_repr.t -> t -> Int32.t + +val remaining_blocks : + Level_repr.t -> t -> blocks_per_voting_period:Int32.t -> Int32.t diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.ml b/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.ml new file mode 100644 index 000000000000..cf080ff404d8 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.ml @@ -0,0 +1,210 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* Copyright (c) 2022 Trili Tech <contact@trili.tech> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* + The shell uses the convention that a context at level n is the resulting + context of the application of block n. + Therefore when using an RPC on the last level of a voting period, the context + that is inspected is the resulting one. + + However [Amendment.may_start_new_voting_period] is run at the end of voting + period and it has to prepare the context for validating operations of the next + period. This causes the counter-intuitive result that the info returned by RPCs + at last level of a voting period mention data of the next voting period. + + For example, when validating the last block of a proposal period at level n + we have: + - Input context: + + voting_period = { kind = Proposal; + index = i; + start_position = n - blocks_per_voting_period} + + - position = n - start_position = blocks_per_voting_period + - remaining = blocks_per_voting_period - (position + 1) = 0 + + - Output context: + + voting_period = { kind = Exploration; + index = i + 1; + start_position = n + 1} + + Now if we calculate position and remaining in the voting period we get + strange results: + - position = n - (n + 1) = -1 + - remaining = blocks_per_voting_period + + To work around this issue, two RPCs were added + `Voting_period_storage.get_rpc_current_info`, which returns the correct + info also for the last context of a period, and + `Voting_period_storage.get_rpc_succ_info`, which can be used at the last + context of a period to craft operations that will be valid for the first + block of the new period. + + This odd behaviour could be fixed if [Amendment.may_start_new_voting_period] + was called when we start validating the first block of a voting period instead + that at the end of the validation of the last block of a voting period. + This should be carefully done because the voting period listing depends on + the rolls and it might break some invariant. + + When this is implemented one should: + - edit the function [reset_current] and [inc_current] to use the + current level and not the next one. + - remove the storage for pred_kind + - make Voting_period_repr.t abstract + + You can also look at the MR description here: + https://gitlab.com/metastatedev/tezos/-/merge_requests/333 + *) + +(* Voting periods start at the first block of a cycle. More formally, + the invariant of start_position with respect to cycle_position is: + cycle_position mod blocks_per_cycle == + position_in_period mod blocks_per_cycle *) + +let blocks_per_voting_period ctxt = + let open Constants_storage in + Int32.(mul (cycles_per_voting_period ctxt) (blocks_per_cycle ctxt)) + +let set_current = Storage.Vote.Current_period.update + +let get_current = Storage.Vote.Current_period.get + +let init = Storage.Vote.Current_period.init + +let init_first_period ctxt ~start_position = + init ctxt @@ Voting_period_repr.root ~start_position >>=? fun ctxt -> + Storage.Vote.Pred_period_kind.init ctxt Voting_period_repr.Proposal + +let common ctxt = + get_current ctxt >>=? fun current_period -> + Storage.Vote.Pred_period_kind.update ctxt current_period.kind >|=? fun ctxt -> + let start_position = + (* because we are preparing the voting period for the next block we need to + use the next level. *) + Int32.succ (Level_storage.current ctxt).level_position + in + (ctxt, current_period, start_position) + +let reset ctxt = + common ctxt >>=? fun (ctxt, current_period, start_position) -> + Voting_period_repr.raw_reset current_period ~start_position + |> set_current ctxt + +let succ ctxt = + common ctxt >>=? fun (ctxt, current_period, start_position) -> + Voting_period_repr.raw_succ current_period ~start_position |> set_current ctxt + +let get_current_kind ctxt = get_current ctxt >|=? fun {kind; _} -> kind + +let get_current_info ctxt = + get_current ctxt >|=? fun voting_period -> + let blocks_per_voting_period = blocks_per_voting_period ctxt in + let level = Level_storage.current ctxt in + let position = Voting_period_repr.position_since level voting_period in + let remaining = + Voting_period_repr.remaining_blocks + level + voting_period + ~blocks_per_voting_period + in + Voting_period_repr.{voting_period; position; remaining} + +let get_current_remaining ctxt = + get_current ctxt >|=? fun voting_period -> + let blocks_per_voting_period = blocks_per_voting_period ctxt in + Voting_period_repr.remaining_blocks + (Level_storage.current ctxt) + voting_period + ~blocks_per_voting_period + +let is_last_block ctxt = + get_current_remaining ctxt >|=? fun remaining -> + Compare.Int32.(remaining = 0l) + +let blocks_before_activation ctxt = + get_current ctxt >>=? function + | Voting_period_repr.{kind = Adoption; _} -> + get_current_remaining ctxt >>=? return_some + | _ -> return_none + +let get_rpc_current_info ctxt = + get_current_info ctxt + >>=? fun ({voting_period; position; _} as voting_period_info) -> + if Compare.Int32.(position = Int32.minus_one) then + let level = Level_storage.current ctxt in + let blocks_per_voting_period = blocks_per_voting_period ctxt in + Storage.Vote.Pred_period_kind.get ctxt >|=? fun pred_kind -> + let voting_period : Voting_period_repr.t = + { + index = Int32.pred voting_period.index; + kind = pred_kind; + start_position = + Int32.(sub voting_period.start_position blocks_per_voting_period); + } + in + let position = Voting_period_repr.position_since level voting_period in + let remaining = + Voting_period_repr.remaining_blocks + level + voting_period + ~blocks_per_voting_period + in + ({voting_period; remaining; position} : Voting_period_repr.info) + else return voting_period_info + +let get_rpc_succ_info ctxt = + Level_storage.from_raw_with_offset + ctxt + ~offset:1l + (Level_storage.current ctxt).level + >>?= fun level -> + get_current ctxt >|=? fun voting_period -> + let blocks_per_voting_period = blocks_per_voting_period ctxt in + let position = Voting_period_repr.position_since level voting_period in + let remaining = + Voting_period_repr.remaining_blocks + level + voting_period + ~blocks_per_voting_period + in + Voting_period_repr.{voting_period; position; remaining} + +module Testnet_dictator = struct + (* This error must never happen. It is deliberately unregistered so + that the execution fails loudly if [overwrite_current_kind] is + ever called on mainnet. *) + type error += Forbidden_on_mainnet + + let overwrite_current_kind ctxt chain_id kind = + error_when + Chain_id.(chain_id = Constants_repr.mainnet_id) + Forbidden_on_mainnet + >>?= fun () -> + get_current ctxt >>=? fun current_period -> + let new_period = {current_period with kind} in + set_current ctxt new_period +end diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.mli b/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.mli new file mode 100644 index 000000000000..2d8a4ea2d8a1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_period_storage.mli @@ -0,0 +1,76 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2020 Metastate AG <hello@metastate.dev> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Initializes the current context with voting period information. *) +val init : Raw_context.t -> Voting_period_repr.t -> Raw_context.t tzresult Lwt.t + +(** Sets the initial period to [{voting_period = root; kind = Proposal; + start_position}]. *) +val init_first_period : + Raw_context.t -> start_position:Int32.t -> Raw_context.t tzresult Lwt.t + +(** Increment the index by one and set the kind to Proposal. *) +val reset : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** Increment the index by one and set the kind to its successor. *) +val succ : Raw_context.t -> Raw_context.t tzresult Lwt.t + +(** Returns information about the current voting period. *) +val get_current : Raw_context.t -> Voting_period_repr.t tzresult Lwt.t + +(** Returns the current voting period kind. *) +val get_current_kind : Raw_context.t -> Voting_period_repr.kind tzresult Lwt.t + +(** Returns true if the context level is the last of current voting period. *) +val is_last_block : Raw_context.t -> bool tzresult Lwt.t + +(** [blocks_before_activation ctxt] returns [Some b] if the current + voting period is the Adoption and [b] blocks must be waited before activation + of the next protocol amendment. Returns [None] if the current period is not + Adoption (then more than [Constants_storage.blocks_per_voting_period] must + be waited before activation). *) +val blocks_before_activation : Raw_context.t -> int32 option tzresult Lwt.t + +(** Returns the voting period information for the current level. *) +val get_rpc_current_info : + Raw_context.t -> Voting_period_repr.info tzresult Lwt.t + +(** Returns the voting period information for the next level. *) +val get_rpc_succ_info : Raw_context.t -> Voting_period_repr.info tzresult Lwt.t + +module Testnet_dictator : sig + (** Overwrites the kind of the current voting period WITHOUT + incrementing the index. + + Must ONLY be called by the testnet dictator on a testnet. + + @return [Error Storage_error] if the current voting period is + not set or its deserialization fails. *) + val overwrite_current_kind : + Raw_context.t -> + Chain_id.t -> + Voting_period_repr.kind -> + Raw_context.t tzresult Lwt.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_services.ml b/src/proto_016_PtMumbai/lib_protocol/voting_services.ml new file mode 100644 index 000000000000..b005d4d47a9c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_services.ml @@ -0,0 +1,147 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +module S = struct + let path = RPC_path.(open_root / "votes") + + let ballots = + RPC_service.get_service + ~description:"Sum of ballots casted so far during a voting period." + ~query:RPC_query.empty + ~output:Vote.ballots_encoding + RPC_path.(path / "ballots") + + let ballot_list = + RPC_service.get_service + ~description:"Ballots casted so far during a voting period." + ~query:RPC_query.empty + ~output: + Data_encoding.( + list + (obj2 + (req "pkh" Signature.Public_key_hash.encoding) + (req "ballot" Vote.ballot_encoding))) + RPC_path.(path / "ballot_list") + + let current_period = + RPC_service.get_service + ~description: + "Returns the voting period (index, kind, starting position) and \ + related information (position, remaining) of the interrogated block." + ~query:RPC_query.empty + ~output:Voting_period.info_encoding + RPC_path.(path / "current_period") + + let successor_period = + RPC_service.get_service + ~description: + "Returns the voting period (index, kind, starting position) and \ + related information (position, remaining) of the next block.Useful to \ + craft operations that will be valid in the next block." + ~query:RPC_query.empty + ~output:Voting_period.info_encoding + RPC_path.(path / "successor_period") + + let current_quorum = + RPC_service.get_service + ~description:"Current expected quorum." + ~query:RPC_query.empty + ~output:Data_encoding.int32 + RPC_path.(path / "current_quorum") + + let listings = + RPC_service.get_service + ~description:"List of delegates with their voting power." + ~query:RPC_query.empty + ~output:Vote.listings_encoding + RPC_path.(path / "listings") + + let proposals = + RPC_service.get_service + ~description:"List of proposals with number of supporters." + ~query:RPC_query.empty + ~output:(Protocol_hash.Map.encoding Data_encoding.int64) + RPC_path.(path / "proposals") + + let current_proposal = + RPC_service.get_service + ~description:"Current proposal under evaluation." + ~query:RPC_query.empty + ~output:(Data_encoding.option Protocol_hash.encoding) + RPC_path.(path / "current_proposal") + + let total_voting_power = + RPC_service.get_service + ~description:"Total voting power in the voting listings." + ~query:RPC_query.empty + ~output:Data_encoding.int64 + RPC_path.(path / "total_voting_power") +end + +let register () = + let open Services_registration in + register0 ~chunked:false S.ballots (fun ctxt () () -> Vote.get_ballots ctxt) ; + register0 ~chunked:true S.ballot_list (fun ctxt () () -> + Vote.get_ballot_list ctxt >|= ok) ; + register0 ~chunked:false S.current_period (fun ctxt () () -> + Voting_period.get_rpc_current_info ctxt) ; + register0 ~chunked:false S.successor_period (fun ctxt () () -> + Voting_period.get_rpc_succ_info ctxt) ; + register0 ~chunked:false S.current_quorum (fun ctxt () () -> + Vote.get_current_quorum ctxt) ; + register0 ~chunked:true S.proposals (fun ctxt () () -> + Vote.get_proposals ctxt) ; + register0 ~chunked:true S.listings (fun ctxt () () -> + Vote.get_listings ctxt >|= ok) ; + register0 ~chunked:false S.current_proposal (fun ctxt () () -> + Vote.find_current_proposal ctxt) ; + register0 ~chunked:false S.total_voting_power (fun ctxt () () -> + Vote.get_total_voting_power_free ctxt) + +let ballots ctxt block = RPC_context.make_call0 S.ballots ctxt block () () + +let ballot_list ctxt block = + RPC_context.make_call0 S.ballot_list ctxt block () () + +let current_period ctxt block = + RPC_context.make_call0 S.current_period ctxt block () () + +let successor_period ctxt block = + RPC_context.make_call0 S.successor_period ctxt block () () + +let current_quorum ctxt block = + RPC_context.make_call0 S.current_quorum ctxt block () () + +let listings ctxt block = RPC_context.make_call0 S.listings ctxt block () () + +let proposals ctxt block = RPC_context.make_call0 S.proposals ctxt block () () + +let current_proposal ctxt block = + RPC_context.make_call0 S.current_proposal ctxt block () () + +let total_voting_power ctxt block = + RPC_context.make_call0 S.total_voting_power ctxt block () () diff --git a/src/proto_016_PtMumbai/lib_protocol/voting_services.mli b/src/proto_016_PtMumbai/lib_protocol/voting_services.mli new file mode 100644 index 000000000000..693ac397e915 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/voting_services.mli @@ -0,0 +1,63 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module provides RPC services that return voting-related information. *) + +open Alpha_context + +val ballots : 'a #RPC_context.simple -> 'a -> Vote.ballots shell_tzresult Lwt.t + +val ballot_list : + 'a #RPC_context.simple -> + 'a -> + (Signature.Public_key_hash.t * Vote.ballot) list shell_tzresult Lwt.t + +val current_period : + 'a #RPC_context.simple -> 'a -> Voting_period.info shell_tzresult Lwt.t + +val successor_period : + 'a #RPC_context.simple -> 'a -> Voting_period.info shell_tzresult Lwt.t + +val current_quorum : + 'a #RPC_context.simple -> 'a -> Int32.t shell_tzresult Lwt.t + +val listings : + 'a #RPC_context.simple -> + 'a -> + (Signature.Public_key_hash.t * int64) list shell_tzresult Lwt.t + +val proposals : + 'a #RPC_context.simple -> + 'a -> + Int64.t Protocol_hash.Map.t shell_tzresult Lwt.t + +val current_proposal : + 'a #RPC_context.simple -> 'a -> Protocol_hash.t option shell_tzresult Lwt.t + +val register : unit -> unit + +val total_voting_power : + 'a #RPC_context.simple -> 'a -> Int64.t shell_tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.ml new file mode 100644 index 000000000000..70efc0015660 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.ml @@ -0,0 +1,127 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module SMap = Map.Make (String) + +type static = { + public_parameters : Plonk.public_parameters; + state_length : int; + circuits_info : [`Public | `Private | `Fee] SMap.t; + nb_ops : int; +} + +type dynamic = { + state : Zk_rollup_state_repr.t; + paid_l2_operations_storage_space : Z.t; + used_l2_operations_storage_space : Z.t; +} + +type t = {static : static; dynamic : dynamic} + +let circuits_info_encoding : [`Public | `Private | `Fee] SMap.t Data_encoding.t + = + let open Data_encoding in + let variant_encoding = + let public_tag, public_encoding = (0, obj1 @@ req "public" unit) in + let private_tag, private_encoding = (1, obj1 @@ req "private" unit) in + let fee_tag, fee_encoding = (2, obj1 @@ req "fee" unit) in + matching + (function + | `Public -> matched public_tag public_encoding () + | `Private -> matched private_tag private_encoding () + | `Fee -> matched fee_tag fee_encoding ()) + [ + case + ~title:"Public" + (Tag public_tag) + public_encoding + (function `Public -> Some () | _ -> None) + (fun () -> `Public); + case + ~title:"Private" + (Tag private_tag) + private_encoding + (function `Private -> Some () | _ -> None) + (fun () -> `Private); + case + ~title:"Fee" + (Tag fee_tag) + fee_encoding + (function `Fee -> Some () | _ -> None) + (fun () -> `Fee); + ] + in + conv_with_guard + (fun m -> List.of_seq @@ SMap.to_seq m) + (fun l -> + let m = SMap.of_seq @@ List.to_seq l in + if + (* Check that the list has no duplicated keys *) + Compare.List_length_with.(l <> SMap.cardinal m) + then Error "Zk_rollup_origination: circuits_info has duplicated keys" + else Ok m) + (list (tup2 (string Plain) variant_encoding)) + +let encoding = + let open Data_encoding in + let static_encoding = + conv + (fun {public_parameters; state_length; circuits_info; nb_ops} -> + (public_parameters, state_length, circuits_info, nb_ops)) + (fun (public_parameters, state_length, circuits_info, nb_ops) -> + {public_parameters; state_length; circuits_info; nb_ops}) + (obj4 + (req "public_parameters" Plonk.public_parameters_encoding) + (req "state_length" int31) + (req "circuits_info" circuits_info_encoding) + (req "nb_ops" int31)) + in + let dynamic_encoding = + conv + (fun { + state; + paid_l2_operations_storage_space; + used_l2_operations_storage_space; + } -> + ( state, + paid_l2_operations_storage_space, + used_l2_operations_storage_space )) + (fun ( state, + paid_l2_operations_storage_space, + used_l2_operations_storage_space ) -> + { + state; + paid_l2_operations_storage_space; + used_l2_operations_storage_space; + }) + (obj3 + (req "state" Zk_rollup_state_repr.encoding) + (req "paid_l2_operations_storage_space" n) + (req "used_l2_operations_storage_space" n)) + in + conv + (fun {static; dynamic} -> (static, dynamic)) + (fun (static, dynamic) -> {static; dynamic}) + (obj2 (req "static" static_encoding) (req "dynamic" dynamic_encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.mli new file mode 100644 index 000000000000..57c133098a1a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_account_repr.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module SMap : Map.S with type key = string + +(** Representation of a ZK Rollup account. *) + +(** Static part of a ZKRU account. These are set at origination, + after which they cannot be modified. *) +type static = { + public_parameters : Plonk.public_parameters; + (** Input to the Plonk verifier that are fixed once the circuits + are decided. *) + state_length : int; (** Number of scalars in the state. *) + circuits_info : [`Public | `Private | `Fee] SMap.t; + (** Circuit names, alongside a tag indicating its kind. *) + nb_ops : int; (** Valid op codes of L2 operations must be in \[0, nb_ops) *) +} + +(** Dynamic part of a ZKRU account. *) +type dynamic = { + state : Zk_rollup_state_repr.t; + (** Array of scalars representing the state of the rollup + at a given level. *) + paid_l2_operations_storage_space : Z.t; + (** Number of bytes for storage of L2 operations that have + been already paid for. *) + used_l2_operations_storage_space : Z.t; + (** Number of bytes for storage of L2 operations that are + being used. *) +} + +type t = {static : static; dynamic : dynamic} + +val encoding : t Data_encoding.t + +(* Encoding for the [circuits_info] field. + Checks that keys are not duplicated in serialized representation. *) +val circuits_info_encoding : [`Public | `Private | `Fee] SMap.t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.ml new file mode 100644 index 000000000000..166df1b8bb5a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.ml @@ -0,0 +1,491 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Alpha_context + +type error += Zk_rollup_feature_disabled | Zk_rollup_negative_nb_ops + +let () = + let description = "ZK rollups will be enabled in a future proposal." in + register_error_kind + `Permanent + ~id:"operation.zk_rollup_disabled" + ~title:"ZK rollups are disabled" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Zk_rollup_feature_disabled -> Some () | _ -> None) + (fun () -> Zk_rollup_feature_disabled) ; + let description = "The value of [nb_ops] should never be negative." in + register_error_kind + `Permanent + ~id:"operation.zk_rollup_negative_nb_ops" + ~title:"ZK rollups negative number of operations" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + Data_encoding.unit + (function Zk_rollup_negative_nb_ops -> Some () | _ -> None) + (fun () -> Zk_rollup_negative_nb_ops) + +let assert_feature_enabled ctxt = + error_unless (Constants.zk_rollup_enable ctxt) Zk_rollup_feature_disabled + +let originate ~ctxt_before_op ~ctxt ~public_parameters ~circuits_info + ~init_state ~nb_ops = + let open Lwt_result_syntax in + let*? () = assert_feature_enabled ctxt in + let*? () = error_when Compare.Int.(nb_ops < 0) Zk_rollup_negative_nb_ops in + let+ ctxt, originated_zk_rollup, storage_size = + Zk_rollup.originate + ctxt + { + public_parameters; + state_length = Array.length init_state; + circuits_info; + nb_ops; + } + ~init_state + in + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Apply_results.Zk_rollup_origination_result + { + balance_updates = []; + originated_zk_rollup; + (* TODO https://gitlab.com/tezos/tezos/-/issues/3544 + Carbonate ZKRU operations *) + consumed_gas; + storage_size; + } + in + (ctxt, result, []) + +(** [parse_ticket ~ticketer ~contents ~ty ctxt] reconstructs a ticket from + individual parts submitted as part of a Zk_rollup_publish operation. *) +let parse_ticket ~ticketer ~contents ~ty ctxt = + Script_ir_translator.parse_comparable_ty ctxt (Micheline.root ty) + >>?= fun (Ex_comparable_ty contents_type, ctxt) -> + Script_ir_translator.parse_comparable_data + ctxt + contents_type + (Micheline.root contents) + >>=? fun (contents, ctxt) -> + return @@ (ctxt, Ticket_token.Ex_token {ticketer; contents_type; contents}) + +let publish ~ctxt_before_op ~ctxt ~zk_rollup ~l2_ops = + let open Lwt_result_syntax in + let*? () = assert_feature_enabled ctxt in + let open Zk_rollup.Operation in + (* Deposits (i.e. L2 operations with a positive price) cannot be published + through an external operation *) + let*? () = + error_unless + (List.for_all + (fun (l2_op, _ticket_opt) -> Compare.Z.(l2_op.price.amount <= Z.zero)) + l2_ops) + Zk_rollup.Errors.Deposit_as_external + in + (* Check that for every operation to publish: + 1. Their price is zero iff they have no ticket representation + 2. The "token id" of its price is the correct ticket hash + Additionally, for operations with tickets, the hash of the ticket + with the l1 destination from the operation's header is computed. + *) + let* ctxt, l2_ops_with_ticket_hashes = + List.fold_left_map_es + (fun ctxt (l2_op, ticket_opt) -> + match ticket_opt with + | None -> + let*? () = + error_unless + Compare.Z.(l2_op.price.amount = Z.zero) + Zk_rollup.Errors.Invalid_deposit_amount + in + return (ctxt, (l2_op, None)) + | Some Zk_rollup.Ticket.{ticketer; ty; contents} -> + let*? () = + error_when + Compare.Z.(l2_op.price.amount = Z.zero) + Zk_rollup.Errors.Invalid_deposit_amount + in + let* ctxt, ticket_token = + parse_ticket ~ticketer ~contents ~ty ctxt + in + (* Compute the ticket hash with L1 address to be able + to perform an exit / return token *) + let* receiver_ticket_hash, ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract (Implicit l2_op.l1_dst)) + ticket_token + in + (* Compute the ticket with zk rollup as owner, this is the hash + that is used as token identifier inside the ZKRU (and this + should be price's identifier in this L2 op) *) + let* source_ticket_hash, ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Zk_rollup zk_rollup) + ticket_token + in + let*? () = + error_unless + Ticket_hash.(equal l2_op.price.id source_ticket_hash) + Zk_rollup.Errors.Invalid_deposit_ticket + in + return (ctxt, (l2_op, Some receiver_ticket_hash))) + ctxt + l2_ops + in + let+ ctxt, paid_storage_size_diff = + Zk_rollup.add_to_pending ctxt zk_rollup l2_ops_with_ticket_hashes + in + (* TODO https://gitlab.com/tezos/tezos/-/issues/3544 + Carbonate ZKRU operations *) + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Apply_results.Zk_rollup_publish_result + {balance_updates = []; consumed_gas; paid_storage_size_diff} + in + (ctxt, result, []) + +let transaction_to_zk_rollup ~ctxt ~parameters_ty ~parameters ~dst_rollup ~since + = + let open Lwt_result_syntax in + let*? () = assert_feature_enabled ctxt in + let*? {ex_ticket; zkru_operation} = + Zk_rollup_parameters.get_deposit_parameters parameters_ty parameters + in + let* ticket_size, ctxt = Ticket_scanner.ex_ticket_size ctxt ex_ticket in + let limit = Constants.tx_rollup_max_ticket_payload_size ctxt in + let*? () = + error_when + Saturation_repr.(ticket_size >! limit) + (Zk_rollup.Errors.Ticket_payload_size_limit_exceeded + {payload_size = ticket_size; limit}) + in + let ex_token, ticket_amount = + Ticket_scanner.ex_token_and_amount_of_ex_ticket ex_ticket + in + (* Compute the ticket hash with zk rollup as owner *) + let* ticket_hash, ctxt = + Ticket_balance_key.of_ex_token ctxt ~owner:(Zk_rollup dst_rollup) ex_token + in + let ticket_amount = Script_int.(to_zint (ticket_amount :> n num)) in + (* Check that the amount and id of the transferred ticket are what + the operation's price claims. *) + let*? () = + error_unless + Compare.Z.(ticket_amount = zkru_operation.price.amount) + Zk_rollup.Errors.Invalid_deposit_amount + in + let*? () = + error_unless + Ticket_hash.(equal ticket_hash zkru_operation.price.id) + Zk_rollup.Errors.Invalid_deposit_ticket + in + (* Compute the ticket hash with L1 address to be able + to perform an exit / return token *) + let* receiver_ticket_hash, ctxt = + Ticket_balance_key.of_ex_token + ctxt + ~owner:(Contract (Implicit zkru_operation.l1_dst)) + ex_token + in + (* Add it to the rollup pending list *) + let+ ctxt, paid_storage_size_diff = + Zk_rollup.add_to_pending + ctxt + Zk_rollup.Operation.(zkru_operation.rollup_id) + [(zkru_operation, Some receiver_ticket_hash)] + in + (* TODO https://gitlab.com/tezos/tezos/-/issues/3544 + Carbonate ZKRU operations *) + let result = + Apply_internal_results.( + ITransaction_result + (Transaction_to_zk_rollup_result + { + balance_updates = []; + consumed_gas = Gas.consumed ~since ~until:ctxt; + ticket_hash; + paid_storage_size_diff; + })) + in + (ctxt, result, []) + +(* + A ZKRU Update will set a new ZKRU state if the proof sent in the payload + is verified. In order to verify this proof, the protocol needs to + compute the "public inputs" expected by the Plonk circuits that define + a given ZKRU. + The proof's public inputs have to be collected by the protocol, as some of + them will be passed in the operation's payload, but some must be computed + by the protocol (e.g. the current L2 state). + These public inputs will be collected as a string map linking + the circuit identifier to a list of inputs for it (as a circuit might have + been used several times in a proof). + As explained in the documentation, circuits in ZKRUs will be grouped into + three categories: pending (public) operations, private batches and + fee circuit. + Each of these expects a different set of public inputs. For this reason, + the collection of circuit inputs will be collected in three separate steps. +*) + +module SMap = Map.Make (String) + +(* Helper function to collect inputs *) +let insert s x = + SMap.update s (function None -> Some [x] | Some l -> Some (x :: l)) + +(* Traverse the list of pending L2 operations paired with their corresponding + inputs sent in the [Update] computing the full set of inputs for each of + them. + Collect the L2 fees of all L2 operations, and the list of boolean flags + determining whether each L2 operation will trigger an exit. +*) +let collect_pending_ops_inputs ~zk_rollup ~account ~rev_pi_map + ~pending_ops_and_pis = + let open Lwt_result_syntax in + let open Zk_rollup.Update in + let open Zk_rollup.Account in + let* rev_pi_map, new_state, fees, rev_exit_validites = + List.fold_left_es + (fun (rev_pi_map, old_state, fees, rev_exit_validites) + ((l2_op, _ticket_hash_opt), (name, (sent_pi : op_pi))) -> + let new_state = sent_pi.new_state in + let*? () = + error_unless + Compare.Int.(Array.length new_state = account.static.state_length) + Zk_rollup.Errors.Inconsistent_state_update + in + let pi = + Zk_rollup.Circuit_public_inputs.( + Pending_op + { + old_state; + new_state; + fee = sent_pi.fee; + exit_validity = sent_pi.exit_validity; + zk_rollup; + l2_op; + }) + in + let rev_pi_map = + insert + name + (Zk_rollup.Circuit_public_inputs.to_scalar_array pi) + rev_pi_map + in + return + ( rev_pi_map, + new_state, + Bls.Primitive.Fr.add fees sent_pi.fee, + sent_pi.exit_validity :: rev_exit_validites )) + (rev_pi_map, account.dynamic.state, Bls.Primitive.Fr.zero, []) + pending_ops_and_pis + in + return (rev_pi_map, new_state, fees, List.rev rev_exit_validites) + +(* Traverse the partial inputs for the batches of private operations + that the [update] claims to process, computing the full set of inputs. + Check that all circuit identifiers used here are allowed to be used for + private operations and collect the L2 fees. *) +let collect_pivate_batch_inputs ~zk_rollup ~account ~rev_pi_map ~update + ~prev_state ~fees = + let open Lwt_result_syntax in + let open Zk_rollup.Update in + let open Zk_rollup.Account in + let is_private = function Some `Private -> true | _ -> false in + List.fold_left_es + (fun (rev_pi_map, old_state, fees) (name, (sent_pi : private_inner_pi)) -> + let*? () = + error_unless + (is_private + (Zk_rollup.Account.SMap.find name account.static.circuits_info)) + Zk_rollup.Errors.Invalid_circuit + in + let new_state = sent_pi.new_state in + let*? () = + error_unless + Compare.Int.(Array.length new_state = account.static.state_length) + Zk_rollup.Errors.Inconsistent_state_update + in + let pi = + Zk_rollup.Circuit_public_inputs.( + Private_batch {old_state; new_state; fees = sent_pi.fees; zk_rollup}) + in + let rev_pi_map = + insert + name + (Zk_rollup.Circuit_public_inputs.to_scalar_array pi) + rev_pi_map + in + + return (rev_pi_map, new_state, Bls.Primitive.Fr.add fees sent_pi.fees)) + (rev_pi_map, prev_state, fees) + update.private_pis + +let collect_fee_inputs ~prev_state ~update ~fees ~rev_pi_map = + let open Zk_rollup.Update in + let old_state = prev_state in + let new_state = update.fee_pi.new_state in + let pi = Zk_rollup.Circuit_public_inputs.(Fee {old_state; new_state; fees}) in + let rev_pi_map = + insert "fee" (Zk_rollup.Circuit_public_inputs.to_scalar_array pi) rev_pi_map + in + (rev_pi_map, new_state) + +(* Collect and validate the public inputs for the verification *) +let collect_inputs ~zk_rollup ~account ~rev_pi_map ~pending_ops_and_pis ~update + = + let open Lwt_result_syntax in + (* Collect the inputs for the pending L2 ops *) + let* rev_pi_map, new_state, fees, exit_validities = + collect_pending_ops_inputs + ~zk_rollup + ~account + ~rev_pi_map + ~pending_ops_and_pis + in + (* Collect the inputs for private batches of L2 ops *) + let* rev_pi_map, new_state, fees = + collect_pivate_batch_inputs + ~zk_rollup + ~account + ~rev_pi_map + ~update + ~prev_state:new_state + ~fees + in + (* Collect the inputs for the fee circuit, always identified as "fee" *) + let rev_pi_map, new_state = + collect_fee_inputs ~prev_state:new_state ~update ~fees ~rev_pi_map + in + let pi_map = SMap.map List.rev rev_pi_map in + return (pi_map, exit_validities, new_state) + +(* Perform the exits corresponding to the processed public l2 operations *) +let perform_exits ctxt exits = + let open Lwt_result_syntax in + List.fold_left_es + (fun (ctxt, storage_diff) ((op, ticket_hash_opt), exit_validity) -> + let open Zk_rollup.Operation in + match ticket_hash_opt with + | None -> + let*? () = + error_unless + Compare.Z.(Z.zero = op.price.amount) + Zk_rollup.Errors.Invalid_deposit_amount + in + return (ctxt, storage_diff) + | Some receiver_ticket_hash -> + if exit_validity then + let*? amount = + Option.value_e + ~error: + (Error_monad.trace_of_error + Zk_rollup.Errors.Invalid_deposit_amount) + (Ticket_amount.of_zint (Z.abs @@ op.price.amount)) + in + let* ctxt, diff = + Ticket_transfer.transfer_ticket_with_hashes + ctxt + ~src_hash:op.price.id + ~dst_hash:receiver_ticket_hash + amount + in + return (ctxt, Z.add diff storage_diff) + else return (ctxt, storage_diff)) + (ctxt, Z.zero) + exits + +let update ~ctxt_before_op ~ctxt ~zk_rollup ~update = + let open Lwt_result_syntax in + let open Zk_rollup.Update in + let*? () = assert_feature_enabled ctxt in + let rev_pi_map = SMap.empty in + let* ctxt, account = Zk_rollup.account ctxt zk_rollup in + let update_public_length = List.length update.pending_pis in + let* ctxt, pending_list_length = + Zk_rollup.get_pending_length ctxt zk_rollup + in + let min_pending_to_process = + Constants.zk_rollup_min_pending_to_process ctxt + in + (* The number of pending operations processed by an update must be at least + [min(pending_list_length, min_pending_to_process)] and at most + [pending_list_length].*) + let*? () = + error_when + Compare.Int.( + update_public_length < pending_list_length + && update_public_length < min_pending_to_process) + Zk_rollup.Errors.Pending_bound + in + let* ctxt, pending_ops = + Zk_rollup.get_prefix ctxt zk_rollup update_public_length + in + (* It's safe to use [combine_drop], as at this point both lists will have the + same length. *) + let pending_ops_and_pis = List.combine_drop pending_ops update.pending_pis in + (* Collect the inputs for the verification *) + let* pi_map, exit_validities, new_state = + collect_inputs ~zk_rollup ~account ~rev_pi_map ~pending_ops_and_pis ~update + in + (* Run the verification of the Plonk proof *) + let verified = + Plonk.verify + account.static.public_parameters + (SMap.bindings pi_map) + update.proof + in + let*? () = error_unless verified Zk_rollup.Errors.Invalid_verification in + (* Update the ZKRU storage with the new state and dropping the processed + public L2 operations from the pending list *) + let* ctxt = + Zk_rollup.update + ctxt + zk_rollup + ~pending_to_drop:update_public_length + ~new_account: + {account with dynamic = {account.dynamic with state = new_state}} + in + (* Perform exits of processed public L2 operations *) + let exits = List.combine_drop pending_ops exit_validities in + let* ctxt, exits_paid_storage_size_diff = perform_exits ctxt exits in + + (* TODO https://gitlab.com/tezos/tezos/-/issues/3544 + Carbonate ZKRU operations *) + let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in + let result = + Apply_results.Zk_rollup_update_result + { + balance_updates = []; + consumed_gas; + paid_storage_size_diff = exits_paid_storage_size_diff; + } + in + return (ctxt, result, []) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.mli new file mode 100644 index 000000000000..7e01854acc3a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_apply.mli @@ -0,0 +1,292 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module handles all the validation/application of any operation + related to the ZK Rollup. + All of the functions defined in this module require that the ZKRU + feature flag is enabled. +*) + +(** In the ZK Rollup, L2 operations are validated in two steps: + {ol + {li The Protocol does the first pass of (light) validation and + appends the L2 operation to a pending list.} + {li The ZKRU Operator does the second pass of validation for a prefix + of the pending list and posts a proof on chain of the validity of + each of them. + Based on this proof, the Protocol is going to remove the prefix + from the pending list, and apply their effect on the ZKRU L2 state + and on the L1 balances.} + } + + The first step of validation is split into two cases, depending on + the type of L2 operation that is being submitted: + {ul + {li If the application of said L2 operation results in a transfer + of a ticket from L1 to L2 (i.e. it is a ZKRU {i deposit}), the + L2 operation has to be submitted through a call to the ZKRU + [%deposit] entrypoint from a smart contract. + This constraint is imposed by the fact that implicit accounts + cannot transfer tickets. + Then, the validation of these L2 operations will be performed + when applying the internal Tezos operation emitted by the call + to the ZKRU's deposit entrypoint. This is implemented by the + [transaction_to_zk_rollup] function in this module. + } + {li If its application results in a ticket transfer from L2 to L1 + (i.e. it is a ZKRU {i withdrawal}) or it has no transfer between + layers, the L2 operation has to be submitted through a + [Zk_rollup_publish] external Tezos operation. + The checks for these L2 operations will be perform upon application + of said external Tezos operation, whose logic is implemented by the + [publish] function in this module. + } + } + + Although L2 operations are mostly opaque, they expose a header that is + transparent to the Protocol (see {!Zk_rollup_operation_repr.t}). + In this header there's a field for the [price] of an L2 operation, which + will expose its kind. Concretely, the [price] encodes the net ticket + transfer from L1 to L2 caused by an L2 operation. Then, deposits have + a positive price, withdrawals a negative one, and pure L2 operations + must have a price of zero. + + An L2 operation's price also encodes which ticket is being transferred, + by storing the ticket's hash (see {!Ticket_hash_repr}). These hashes are + used as token identifiers inside the ZKRU. In both cases, the L2 operations + with a non-zero price (i.e. deposits and withdrawals) will be submitted + alongside the values describing the ticket being transferred + (see {!Zk_rollup_ticket_repr}). These values have to be consistent with + the token identifier used in the L2 operation's price. + + NB: if ticket transfers by implicit accounts was supported, these two cases + could be unified into the application of the [Zk_rollup_publish] operation. +*) + +open Alpha_context + +(** These errors are only to be matched in tests. *) +type error += + | Zk_rollup_feature_disabled + (** Emitted when trying to apply a ZK Rollup operation while the ZKRU + feature flag is not active. *) + | Zk_rollup_negative_nb_ops + (** Emitted when originating a ZK Rollup with a negative [nb_ops]. *) + +(** [assert_feature_enabled ctxt] asserts that the ZK Rollup feature flag + is activated. + + May fail with: + {ul + {li [Zk_rollup_feature_disabled] if the ZKRU feature flag is not + activated.} + } +*) +val assert_feature_enabled : t -> unit tzresult + +(** [originate ~ctxt_before_op ~ctxt ~public_parameters ~transcript + ~circuits_info ~init_state ~nb_ops] + applies the origination operation for a ZK rollup. + See {!Zk_rollup_storage:originate}. + + May fail with: + {ul + {li [Zk_rollup_feature_disabled] if the ZKRU feature flag is not + activated.} + {li [Zk_rollup_negative_nb_ops] if [nb_ops] is negative.} + } +*) +val originate : + ctxt_before_op:t -> + ctxt:t -> + public_parameters:Plonk.public_parameters -> + circuits_info:[`Public | `Private | `Fee] Zk_rollup.Account.SMap.t -> + init_state:Zk_rollup.State.t -> + nb_ops:int -> + (t + * Kind.zk_rollup_origination Apply_results.successful_manager_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t + +(** [publish ~ctxt_before_op ~ctxt ~zk_rollup ~l2_ops] + applies a publish operation to [zk_rollup] by adding [l2_ops] to its + pending list. + + All L2 operations in [l2_ops] must claim a non-positive [price] + (see {!Zk_rollup_operation_repr}). In other words, no deposit is + allowed in this operation, as those must go through an internal + transaction. + + This function will first perform a series of validation checks over + the L2 operations in [l2_ops]. If all of them are successful, these L2 + operations will be added to [dst_rollup]'s pending list. + + May fail with: + {ul + {li [Zk_rollup_feature_disabled] if the ZKRU feature flag is not + activated. + } + {li [Zk_rollup.Errors.Deposit_as_external] if the price of an L2 + operation from [ops] is positive. + } + {li [Zk_rollup.Errors.Invalid_deposit_amount] if an L2 operation + declares no ticket but has a non-zero price or if it declares + a ticket with a price of zero. + } + {li [Zk_rollup.Errors.Invalid_deposit_ticket] if an L2 operation's + ticket identifier (see [Zk_rollup_operation_repr]) is different from + the hash of its corresponding ticket and [l1_dst]. + } + {li [Zk_rollup_storage.Zk_rollup_invalid_op_code op_code] if the + [op_code] of one of the [operations] is greater or equal + to the number of declared operations for this [zk_rollup]. + } + } +*) +val publish : + ctxt_before_op:t -> + ctxt:t -> + zk_rollup:Zk_rollup.t -> + l2_ops:(Zk_rollup.Operation.t * Zk_rollup.Ticket.t option) list -> + (t + * Kind.zk_rollup_publish Apply_results.successful_manager_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t + +(** [transaction_to_zk_rollup + ~ctxt ~parameters_ty ~parameters ~payer ~dst_rollup ~since] applies an + internal transaction to a ZK [dst_rollup]. + + Internal transactions are used for deposits into ZK rollups, which can + be seen as a special case of the publish ZK rollup operation. + The [parameters] should include a ticket and a ZKRU L2 operation, as + explained in the {!Zk_rollup_parameters} module's documentation. + + This function will first perform a series of validation checks. + If successful, the L2 operation from the [parameters] will be added + to [dst_rollup]'s pending list, and [payer] will pay for the + added storage. + + May fail with: + {ul + {li [Zk_rollup_feature_disabled] if the ZKRU feature flag is not + activated. + } + {li [Zk_rollup.Errors.Ticket_payload_size_limit_exceeded] if the ticket + found in the [parameters] exceeds the maximum ticket size. + } +u {li [Script_tc_errors.Forbidden_zero_ticket_quantity] if the ticket + amount is zero. + } + {li [Zk_rollup.Errors.Invalid_deposit_amount] if the amount of the ticket + transferred to the [dst_rollup] is different from the [price] + (see {!Zk_rollup_operation_repr}) claimed by the L2 operation. + } + {li [Zk_rollup.Errors.Invalid_deposit_ticket] if the L2 operation's + ticket identifier (see {!Zk_rollup_operation_repr}) is different to + the hash of the transferred ticket and [dst_rollup]. + } + {li [Zk_rollup_storage.Zk_rollup_invalid_op_code op_code] if the + [op_code] of the operation from the [parameters] is greater or equal + to the number of declared operations for this rollup. + } + {li [Zk_rollup.Errors.Wrong_deposit_parameters] if the [parameters] + are not of the expected type. See {!Zk_rollup_parameters}. + } + } +*) +val transaction_to_zk_rollup : + ctxt:t -> + parameters_ty: + ( ('a Script_typed_ir.ticket, bytes) Script_typed_ir.pair, + 'b ) + Script_typed_ir.ty -> + parameters:('a Script_typed_ir.ticket, bytes) Script_typed_ir.pair -> + dst_rollup:Zk_rollup.t -> + since:t -> + (t + * Kind.transaction Apply_internal_results.successful_internal_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t + +(** [update ~ctxt_before_op ~ctxt ~zk_rollup ~update ~source_contract] + applies an [update] to [zk_rollup]. + + A ZKRU update will verify three sorts of ZK circuits: + {ul + {li Public operation circuits, that handle a single L2 operation + from the pending list.} + {li Private batch circuits, that handle a batch of private L2 + operations.} + {li Fee circuit, which credits the ZKRU operator with all the aggregated + fees from the update.} + } + + The [update] provides some inputs required to perform this verification, + alongside the proof. See {!Zk_rollup_update_repr}. + + If the verification is successful, the [zk_rollup]'s state is updated, + a prefix of its pending list is dropped and the exits from the ZKRU are + performed. + + May fail with: + {ul + {li [Zk_rollup_feature_disabled] if the ZKRU feature flag is not + activated. + } + {li [Zk_rollup.Errors.Pending_bound] if the [update] processes fewer + public operation than allowed. + } + {li [Zk_rollup.Errors.Inconsistent_state_update] if the [update] declares + a new state of incorrect length. + } + {li [Zk_rollup.Errors.Invalid_circuit] if a public operation circuit is + ran as private. + } + {li [Zk_rollup.Errors.Invalid_verification] if the PlonK verification + fails. + } + {li [Zk_rollup.Errors.Invalid_deposit_amount] if an L2 operation without + a corresponding ticket in the pending list has a non-zero price. + } + {li [Zk_rollup_storage.Zk_rollup_pending_list_too_short] + if the [update] tries to process more public operations than those in + the pending list. + } + } +*) +val update : + ctxt_before_op:t -> + ctxt:t -> + zk_rollup:Zk_rollup.t -> + update:Zk_rollup.Update.t -> + (t + * Kind.zk_rollup_update Apply_results.successful_manager_operation_result + * Script_typed_ir.packed_internal_operation list) + tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.ml new file mode 100644 index 000000000000..6ed68ffd02a5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.ml @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type pending_op_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fee : Zk_rollup_scalar.t; + exit_validity : bool; + zk_rollup : Zk_rollup_repr.t; + l2_op : Zk_rollup_operation_repr.t; +} + +type private_batch_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; + zk_rollup : Zk_rollup_repr.t; +} + +type fee_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; +} + +type t = + | Pending_op of pending_op_public_inputs + | Private_batch of private_batch_public_inputs + | Fee of fee_public_inputs + +let bool_to_scalar b = + if b then Zk_rollup_scalar.of_z Z.one else Zk_rollup_scalar.of_z Z.zero + +let to_scalar_array = function + | Pending_op {old_state; new_state; fee; exit_validity; zk_rollup; l2_op} -> + Array.concat + [ + old_state; + new_state; + [| + fee; + bool_to_scalar exit_validity; + Zk_rollup_repr.to_scalar zk_rollup; + |]; + Zk_rollup_operation_repr.to_scalar_array l2_op; + ] + | Private_batch {old_state; new_state; fees; zk_rollup} -> + Array.concat + [old_state; new_state; [|fees; Zk_rollup_repr.to_scalar zk_rollup|]] + | Fee {old_state; new_state; fees} -> + Array.concat [old_state; new_state; [|fees|]] diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.mli new file mode 100644 index 000000000000..74985106c63f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_circuit_public_inputs_repr.mli @@ -0,0 +1,67 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** + Abstraction layer for the public inputs to the ZKRU aPlonk circuits. + + As explained in the documentation, circuits in ZKRUs will be grouped into + three categories: pending (public) operations, private batches and + fee circuit. Each of these expects a different set of public inputs. +*) + +(** Public inputs expected by circuits that handle single public + L2 operations. *) +type pending_op_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fee : Zk_rollup_scalar.t; + exit_validity : bool; + zk_rollup : Zk_rollup_repr.t; + l2_op : Zk_rollup_operation_repr.t; +} + +(** Public inputs expected by circuits that handle a batch of private + L2 operations. *) +type private_batch_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; + zk_rollup : Zk_rollup_repr.t; +} + +(** Public inputs expected by the circuit that handles the L2 fees. *) +type fee_public_inputs = { + old_state : Zk_rollup_state_repr.t; + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; +} + +type t = + | Pending_op of pending_op_public_inputs + | Private_batch of private_batch_public_inputs + | Fee of fee_public_inputs + +(** Conversion to the type the aPlonk verifier expects. *) +val to_scalar_array : t -> Zk_rollup_scalar.t array diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_errors.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_errors.ml new file mode 100644 index 000000000000..38bbcf2283f5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_errors.ml @@ -0,0 +1,136 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Deposit_as_external + | Invalid_deposit_amount + | Invalid_deposit_ticket + | Wrong_deposit_parameters + | Ticket_payload_size_limit_exceeded of { + payload_size : Saturation_repr.may_saturate Saturation_repr.t; + limit : int; + } + | Invalid_verification + | Invalid_circuit + | Inconsistent_state_update + | Pending_bound + +let () = + register_error_kind + `Temporary + ~id:"operation.zk_rollup_deposit_as_external" + ~title:"Zk_rollup: attempted a deposit through an external op" + ~description:"Zk_rollup: attempted a deposit through an external op" + ~pp:(fun ppf () -> + Format.fprintf ppf "Zk_rollup: attempted a deposit through an external op") + Data_encoding.empty + (function Deposit_as_external -> Some () | _ -> None) + (fun () -> Deposit_as_external) ; + register_error_kind + `Temporary + ~id:"operation.zk_rollup_invalid_deposit_amount" + ~title:"Zk_rollup: attempted a deposit with an invalid amount" + ~description:"Zk_rollup: attempted a deposit with an invalid amount" + ~pp:(fun ppf () -> + Format.fprintf ppf "Zk_rollup: attempted a deposit with an invalid amount") + Data_encoding.empty + (function Invalid_deposit_amount -> Some () | _ -> None) + (fun () -> Invalid_deposit_amount) ; + register_error_kind + `Temporary + ~id:"operation.zk_rollup_invalid_deposit_ticket" + ~title:"Zk_rollup: attempted a deposit with an invalid ticket" + ~description:"Zk_rollup: attempted a deposit with an invalid ticket" + ~pp:(fun ppf () -> + Format.fprintf ppf "Zk_rollup: attempted a deposit with an invalid ticket") + Data_encoding.empty + (function Invalid_deposit_ticket -> Some () | _ -> None) + (fun () -> Invalid_deposit_ticket) ; + register_error_kind + `Permanent + ~id:"operation.zk_rollup_wrong_deposit_parameters" + ~title:"Zk_rollup: attempted a deposit with invalid parameters" + ~description:"Zk_rollup: attempted a deposit with invalid parameters" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Zk_rollup: attempted a deposit with an invalid parameters") + Data_encoding.empty + (function Wrong_deposit_parameters -> Some () | _ -> None) + (fun () -> Wrong_deposit_parameters) ; + register_error_kind + `Permanent + ~id:"zk_rollup_ticket_payload_size_limit_exceeded" + ~title:"The payload of the deposited ticket exceeded the size limit" + ~description:"The payload of the deposited ticket exceeded the size limit" + Data_encoding.( + obj2 (req "payload_size" Saturation_repr.n_encoding) (req "limit" int31)) + (function + | Ticket_payload_size_limit_exceeded {payload_size; limit} -> + Some (payload_size, limit) + | _ -> None) + (fun (payload_size, limit) -> + Ticket_payload_size_limit_exceeded {payload_size; limit}) ; + register_error_kind + `Temporary + ~id:"operation.zk_rollup_failed_verification" + ~title:"Zk_rollup_update: failed verification" + ~description:"Zk_rollup_update: failed verification" + ~pp:(fun ppf () -> Format.fprintf ppf "The proof verification failed") + Data_encoding.empty + (function Invalid_verification -> Some () | _ -> None) + (fun () -> Invalid_verification) ; + register_error_kind + `Permanent + ~id:"operation.zk_rollup_invalid_circuit" + ~title:"Zk_rollup_update: invalid circuit" + ~description:"Zk_rollup_update: invalid circuit" + ~pp:(fun ppf () -> + Format.fprintf ppf "Invalid circuit in proof verification") + Data_encoding.empty + (function Invalid_circuit -> Some () | _ -> None) + (fun () -> Invalid_circuit) ; + register_error_kind + `Permanent + ~id:"operation.zk_rollup_inconsistent_state_update" + ~title:"Zk_rollup_update: inconsistent state update" + ~description:"Zk_rollup_update: new state is of incorrect size" + ~pp:(fun ppf () -> + Format.fprintf ppf "Zk_rollup_update: new state is of incorrect size") + Data_encoding.empty + (function Inconsistent_state_update -> Some () | _ -> None) + (fun () -> Inconsistent_state_update) ; + register_error_kind + `Temporary + ~id:"operation.zk_rollup_pending_bound" + ~title:"Zk_rollup_update: update with fewer pending ops than allowed" + ~description:"Zk_rollup_update: update with fewer pending ops than allowed" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Zk_rollup_update: update with fewer pending ops than allowed") + Data_encoding.empty + (function Pending_bound -> Some () | _ -> None) + (fun () -> Pending_bound) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.ml new file mode 100644 index 000000000000..b7a13d345f34 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.ml @@ -0,0 +1,78 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type price = {id : Ticket_hash_repr.t; amount : Z.t} + +type t = { + op_code : int; + price : price; + l1_dst : Signature.Public_key_hash.t; + rollup_id : Zk_rollup_repr.t; + payload : Zk_rollup_scalar.t array; +} + +let int_to_scalar x = Zk_rollup_scalar.of_z (Z.of_int x) + +let pkh_to_scalar x = + Zk_rollup_scalar.of_bits + (Data_encoding.Binary.to_string_exn Signature.Public_key_hash.encoding x) + +let ticket_hash_to_scalar ticket_hash = + Zk_rollup_scalar.of_bits + @@ Data_encoding.Binary.to_string_exn Ticket_hash_repr.encoding ticket_hash + +let to_scalar_array {op_code; price; l1_dst; rollup_id; payload} = + Array.concat + [ + [| + int_to_scalar op_code; + ticket_hash_to_scalar price.id; + Zk_rollup_scalar.of_z @@ Z.abs price.amount; + pkh_to_scalar l1_dst; + Zk_rollup_repr.to_scalar rollup_id; + |]; + payload; + ] + +let price_encoding = + Data_encoding.( + conv + (fun {id; amount} -> (id, amount)) + (fun (id, amount) -> {id; amount}) + (obj2 (req "id" Ticket_hash_repr.encoding) (req "amount" z))) + +let encoding = + Data_encoding.( + conv + (fun {op_code; price; l1_dst; rollup_id; payload} -> + (op_code, price, l1_dst, rollup_id, payload)) + (fun (op_code, price, l1_dst, rollup_id, payload) -> + {op_code; price; l1_dst; rollup_id; payload}) + (obj5 + (req "op_code" int31) + (req "price" price_encoding) + (req "l1_dst" Signature.Public_key_hash.encoding) + (req "rollup_id" Zk_rollup_repr.Address.encoding) + (req "payload" Plonk.scalar_array_encoding))) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.mli new file mode 100644 index 000000000000..85ce349461bb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_operation_repr.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The [price] of an L2 operation represents the net ticket + transfer from L1 to L2 that it will produce. + [id] is a ticket hash used as a ticket identifier and [amount] + is positive if the operation transfers tickets from L1 to L2, + negative if it does so from L2 to L1, and zero when no transfer + is done between layers. +*) +type price = {id : Ticket_hash_repr.t; amount : Z.t} + +(** A ZK rollup L2 operation has two parts: a transparent header and + an opaque payload. + The header is made up by: + {ul + {li An [op_code] in the range \[0, nb_ops)} + {li The [price] of this L2 operation} + {li [l1_dst] is the public key hash of the implicit account that will + be credited with the withdrawal generated by this operation, if any} + {li [rollup_id] is the address of the rollup this operation targets} + } + + This type represents the L1's view of L2 operations. It's important + to remember that this is only used for public operations, as the + protocol isn't aware of private ones. +*) +type t = { + op_code : int; + price : price; + l1_dst : Signature.Public_key_hash.t; + rollup_id : Zk_rollup_repr.t; + payload : Zk_rollup_scalar.t array; +} + +val encoding : t Data_encoding.t + +(** Special encoding needed to feed L2 operations to the Plonk verifier *) +val to_scalar_array : t -> Zk_rollup_scalar.t array diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.ml new file mode 100644 index 000000000000..d41389d53e41 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.ml @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type deposit_parameters = { + ex_ticket : Ticket_scanner.ex_ticket; + zkru_operation : Alpha_context.Zk_rollup.Operation.t; +} + +let get_deposit_parameters : + type a comparable. + ( (a Script_typed_ir.ticket, bytes) Script_typed_ir.pair, + comparable ) + Script_typed_ir.ty -> + (a Script_typed_ir.ticket, bytes) Script_typed_ir.pair -> + deposit_parameters tzresult = + fun ty contents -> + let open Script_typed_ir in + match (ty, contents) with + | Pair_t (Ticket_t (ty, _), Bytes_t, _, _), (ticket, op_bytes) -> ( + match + Data_encoding.Binary.of_bytes_opt + Alpha_context.Zk_rollup.Operation.encoding + op_bytes + with + | None -> error Alpha_context.Zk_rollup.Errors.Wrong_deposit_parameters + | Some zkru_operation -> + ok {ex_ticket = Ticket_scanner.Ex_ticket (ty, ticket); zkru_operation} + ) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.mli new file mode 100644 index 000000000000..386d036b13be --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_parameters.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A module for representing and extracting typed ZK rollup + parameters. *) + +(** A type representing deposit parameters for ZK rollups. Deposit + parameters consist of a ticket of arbitrary content along with a + layer-2 ZKRU operation byte representation. *) +type deposit_parameters = { + ex_ticket : Ticket_scanner.ex_ticket; + zkru_operation : Alpha_context.Zk_rollup.Operation.t; +} + +(** [get_deposit_parameters ty value] returns [ex_ticket] and a + [zkru_operation] from a michelson typed value. if [ty] is not of a + pair of ticket and [bytes] then it fails with + [Zk_rollup_errors.Wrong_deposit_parameters]. + + This function is intended to be used to enforce the type of the transaction + to a [zk_rollup%deposit]. It must be used both in [ticket_diffs_of_operations] + to account for the ticket deposited and in [apply] to retrieve the ticket + when applying the transaction to a zk_rollup. *) +val get_deposit_parameters : + ( ('a Script_typed_ir.ticket, bytes) Script_typed_ir.pair, + 'comparable ) + Script_typed_ir.ty -> + ('a Script_typed_ir.ticket, bytes) Script_typed_ir.pair -> + deposit_parameters tzresult diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.ml new file mode 100644 index 000000000000..52fe03aa9b9a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.ml @@ -0,0 +1,153 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Address = struct + let prefix = "epx1" + + let encoded_size = 37 + + let decoded_prefix = "\001\023\224\125" + + module H = + Blake2B.Make + (Base58) + (struct + let name = "Zk_rollup_hash" + + let title = "A zk rollup address" + + let b58check_prefix = decoded_prefix + + let size = Some 20 + end) + + include H + + let () = Base58.check_encoded_prefix b58check_encoding prefix encoded_size + + include Path_encoding.Make_hex (H) + + type error += (* `Permanent *) Error_zk_rollup_address_generation + + let () = + let open Data_encoding in + let msg = "Error while generating rollup address" in + register_error_kind + `Permanent + ~id:"rollup.error_zk_rollup_address_generation" + ~title:msg + ~pp:(fun ppf () -> Format.fprintf ppf "%s" msg) + ~description:msg + unit + (function Error_zk_rollup_address_generation -> Some () | _ -> None) + (fun () -> Error_zk_rollup_address_generation) + + let from_nonce nonce = + Data_encoding.Binary.to_bytes_opt Origination_nonce.encoding nonce + |> function + | None -> error Error_zk_rollup_address_generation + | Some nonce -> ok @@ hash_bytes [nonce] + + let of_b58data = function H.Data h -> Some h | _ -> None +end + +type t = Address.t + +let to_scalar x = + Zk_rollup_scalar.of_bits + (Data_encoding.Binary.to_string_exn Address.encoding x) + +type pending_list = + | Empty of {next_index : int64} + | Pending of {next_index : int64; length : int} + +let pending_list_encoding : pending_list Data_encoding.t = + let open Data_encoding in + let empty_tag, pending_tag = (0, 1) in + let empty_encoding = + obj1 (req "next_index" Compact.(make ~tag_size:`Uint8 int64)) + in + let pending_encoding = + obj2 + (req "next_index" Compact.(make ~tag_size:`Uint8 int64)) + (req "length" uint16) + in + matching + (function + | Empty {next_index} -> matched empty_tag empty_encoding next_index + | Pending {next_index; length} -> + matched pending_tag pending_encoding (next_index, length)) + [ + case + ~title:"Empty" + (Tag empty_tag) + empty_encoding + (function Empty {next_index} -> Some next_index | _ -> None) + (fun next_index -> Empty {next_index}); + case + ~title:"Pending" + (Tag pending_tag) + pending_encoding + (function + | Pending {next_index; length} -> Some (next_index, length) + | _ -> None) + (fun (next_index, length) -> Pending {next_index; length}); + ] + +module Index = struct + type nonrec t = t + + let path_length = 1 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn Address.encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + key :: l + + let of_path = function + | [key] -> + Option.bind + (Hex.to_bytes (`Hex key)) + (Data_encoding.Binary.of_bytes_opt Address.encoding) + | _ -> None + + let rpc_arg = Address.rpc_arg + + let encoding = Address.encoding + + let compare = Address.compare +end + +let in_memory_size (_ : t) = + let open Cache_memory_helpers in + h1w +! string_size_gen Address.size + +module Internal_for_tests = struct + let originated_zk_rollup nonce = + let data = + Data_encoding.Binary.to_bytes_exn Origination_nonce.encoding nonce + in + Address.hash_bytes [data] +end diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.mli new file mode 100644 index 000000000000..d36a047fc21f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_repr.mli @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A ZK rollup has an address starting with "epx1". + ZKRU addresses have a length of 20 bytes, which means + that they have an injective encoding as BLS12-381 scalars. +*) +module Address : sig + include S.HASH + + (** [from_nonce nonce] produces an address completely determined by + an operation hash and an origination counter. *) + val from_nonce : Origination_nonce.t -> t tzresult + + (** [encoded_size] is the number of bytes needed to represent an address. *) + val encoded_size : int + + val of_b58data : Base58.data -> t option + + val prefix : string +end + +type t = Address.t + +(** [to_scalar address] returns the scalar corresponding to [address] *) +val to_scalar : t -> Zk_rollup_scalar.t + +(** Description of a ZK rollup's pending list. *) +type pending_list = + | Empty of {next_index : int64} + (** Empty pending list but starting point will be [next_index] + when adding to the list *) + | Pending of {next_index : int64; length : int} + (** Pending list with + [(next_index - length) .. (next_index - 1)]. + [length] is encoded as a [uint16]. *) + +val pending_list_encoding : pending_list Data_encoding.t + +module Index : Storage_description.INDEX with type t = t + +(** [in_memory_size zk_rollup] returns the number of bytes a [zk_rollup] + address uses in RAM. *) +val in_memory_size : t -> Cache_memory_helpers.sint + +module Internal_for_tests : sig + val originated_zk_rollup : Origination_nonce.t -> Address.t +end diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.ml new file mode 100644 index 000000000000..77ac1b1d7299 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Bls.Primitive.Fr.t + +let of_z z = + (* In case [z] is outside of the field, i.e. Z >= Fr.order, + [Bls.Primitive.Fr.of_z] will apply a modulo reduction to ge + t a field element *) + Bls.Primitive.Fr.of_z z + +let of_bits bs = + (* The bits are interpreted as a Z integer *) + let z = Z.of_bits bs in + of_z z diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.mli new file mode 100644 index 000000000000..cdd18d5b38bd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_scalar.mli @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Representation of scalars used by the ZK Rollup alongside + manipulation functions *) + +(** Scalars are transparently BLS12-381 scalars *) +type t = Bls.Primitive.Fr.t + +(** Safe conversion from Z.t. + If the numerical value is not in the field, modulo reduction + is applied. *) +val of_z : Z.t -> t + +(** Safe conversion from bits, represented as a string. + If the numerical value is not in the field, modulo reduction + is applied. *) +val of_bits : string -> t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.ml new file mode 100644 index 000000000000..64ccb1bdde37 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.ml @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = Zk_rollup_scalar.t array + +let encoding = Plonk.scalar_array_encoding diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.mli new file mode 100644 index 000000000000..359074016ab0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_state_repr.mli @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** The state of a ZK Rollup is an opaque array of scalars, and represents + the L1's view of the L2 state. + Although the length of this array is unbound, this type should describe + a succinct representation of the entire RU state. Upon origination, the + length of a ZKRU's state is fixed. +*) +type t = Zk_rollup_scalar.t array + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.ml new file mode 100644 index 000000000000..26ad6dda3b71 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.ml @@ -0,0 +1,314 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += + | Zk_rollup_does_not_exist of Zk_rollup_repr.t + | Zk_rollup_invalid_op_code of int + | Zk_rollup_pending_list_too_short + | Zk_rollup_negative_length + +let () = + register_error_kind + `Temporary + ~id:"Zk_rollup_does_not_exist" + ~title:"ZK Rollup does not exist" + ~description:"Attempted to use a ZK rollup that has not been originated." + ~pp:(fun ppf x -> + Format.fprintf ppf "Rollup %a does not exist" Zk_rollup_repr.Address.pp x) + Data_encoding.(obj1 (req "rollup" Zk_rollup_repr.Address.encoding)) + (function Zk_rollup_does_not_exist x -> Some x | _ -> None) + (fun x -> Zk_rollup_does_not_exist x) ; + register_error_kind + `Permanent + ~id:"Zk_rollup_invalid_op code" + ~title:"Invalid op code in append" + ~description:"Invalid op code in append" + ~pp:(fun ppf oc -> + Format.fprintf ppf "Op code %d is not valid for this ZK Rollup" oc) + Data_encoding.(obj1 (req "op_code" int31)) + (function Zk_rollup_invalid_op_code oc -> Some oc | _ -> None) + (fun oc -> Zk_rollup_invalid_op_code oc) ; + register_error_kind + `Temporary + ~id:"Zk_rollup_pending_list_too_short" + ~title:"Pending list is too short" + ~description:"Pending list is too short" + Data_encoding.unit + (function Zk_rollup_pending_list_too_short -> Some () | _ -> None) + (fun () -> Zk_rollup_pending_list_too_short) ; + register_error_kind + `Permanent + ~id:"Zk_rollup_negative_length" + ~title:"Negative length for pending list prefix" + ~description:"Negative length for pending list prefix" + Data_encoding.unit + (function Zk_rollup_negative_length -> Some () | _ -> None) + (fun () -> Zk_rollup_negative_length) + +let account = Storage.Zk_rollup.Account.get + +let pending_list = Storage.Zk_rollup.Pending_list.get + +let pending_op ctxt id = Storage.Zk_rollup.Pending_operation.get (ctxt, id) + +let originate ctxt static ~init_state = + let open Lwt_result_syntax in + let*? ctxt, nonce = Raw_context.increment_origination_nonce ctxt in + let*? address = Zk_rollup_repr.Address.from_nonce nonce in + let origination_size = Constants_storage.zk_rollup_origination_size ctxt in + let initial_account = + Zk_rollup_account_repr. + { + static; + dynamic = + { + state = init_state; + paid_l2_operations_storage_space = Z.of_int origination_size; + used_l2_operations_storage_space = Z.zero; + }; + } + in + let* ctxt, account_size = + Storage.Zk_rollup.Account.init ctxt address initial_account + in + let init_pl = Zk_rollup_repr.(Empty {next_index = 0L}) in + let* ctxt, pl_size = + Storage.Zk_rollup.Pending_list.init ctxt address init_pl + in + let address_size = Zk_rollup_repr.Address.size in + let size = + Z.of_int (origination_size + address_size + account_size + pl_size) + in + return (ctxt, address, size) + +let add_to_pending ctxt rollup ops = + let open Lwt_result_syntax in + let open Zk_rollup_repr in + let open Zk_rollup_operation_repr in + let* ctxt, acc = account ctxt rollup in + let*? () = + List.iter_e + (fun (op, _ticket_hash_opt) -> + if Compare.Int.(op.op_code >= acc.static.nb_ops || op.op_code < 0) then + error @@ Zk_rollup_invalid_op_code op.op_code + else ok ()) + ops + in + let* ctxt, pl = Storage.Zk_rollup.Pending_list.get ctxt rollup in + let next_index, length = + match pl with + | Empty {next_index} -> (next_index, 0) + | Pending {next_index; length} -> (next_index, length) + in + let* ctxt, next_index, length, storage_diff = + List.fold_left_es + (fun (ctxt, next_index, length, storage_diff) op -> + let* ctxt, new_storage_diff, _was_bound = + Storage.Zk_rollup.Pending_operation.add (ctxt, rollup) next_index op + in + return + ( ctxt, + Int64.succ next_index, + length + 1, + new_storage_diff + storage_diff )) + (ctxt, next_index, length, 0) + ops + in + let used_l2_operations_storage_space = + Z.(add acc.dynamic.used_l2_operations_storage_space (Z.of_int storage_diff)) + in + let l2_operations_storage_space_to_pay = + Z.( + max + zero + (sub + used_l2_operations_storage_space + acc.dynamic.paid_l2_operations_storage_space)) + in + let paid_l2_operations_storage_space = + Z.( + add + acc.dynamic.paid_l2_operations_storage_space + l2_operations_storage_space_to_pay) + in + let acc = + { + acc with + dynamic = + { + acc.dynamic with + paid_l2_operations_storage_space; + used_l2_operations_storage_space; + }; + } + in + + let pl = + if Compare.Int.(length = 0) then Empty {next_index} + else Pending {next_index; length} + in + (* Users aren't charged for storage diff in the account or pending list + description of a ZKRU. + When updating a ZKRU account, the storage diff can only come from the + dynamically sized [Z.t] used for the watermark. These changes + in storage size will not be accounted for. + As for the pending list description, the storage size is fixed for + each of the two cases (empty / non-empty). Then, there will be a storage + diff when switching between these two, which won't be accounted for + either. + *) + let* ctxt, _diff_acc = Storage.Zk_rollup.Account.update ctxt rollup acc in + let* ctxt, _diff_pl = Storage.Zk_rollup.Pending_list.update ctxt rollup pl in + return (ctxt, l2_operations_storage_space_to_pay) + +let pending_length = + let open Zk_rollup_repr in + function Empty _ -> 0 | Pending {length; _} -> length + +let head = + let open Zk_rollup_repr in + function + | Empty _ -> error Zk_rollup_pending_list_too_short + | Pending {next_index; length} -> + Result_syntax.return Int64.(sub next_index (of_int length)) + +let next_index = + let open Zk_rollup_repr in + function + | Empty {next_index} -> next_index | Pending {next_index; _} -> next_index + +let get_pending_length ctxt rollup = + let open Lwt_result_syntax in + let* ctxt, pl = pending_list ctxt rollup in + return (ctxt, pending_length pl) + +(** Same as [Tezos_stdlib.Utils.fold_n_times] but with Lwt and Error monad *) +let fold_n_times_es ~when_negative n f e = + let open Lwt_result_syntax in + if Compare.Int.(n < 0) then tzfail when_negative + else + let rec go acc = function + | 0 -> return acc + | n -> + let* acc = f acc in + (go [@ocaml.tailcall]) acc (n - 1) + in + go e n + +let get_prefix ctxt rollup n = + let open Lwt_result_syntax in + if Compare.Int.(n = 0) then return (ctxt, []) + else + let* ctxt, pl = pending_list ctxt rollup in + let pl_length = pending_length pl in + let*? () = + error_when Compare.Int.(n > pl_length) Zk_rollup_pending_list_too_short + in + let*? hd = head pl in + let* ctxt, ops, _i = + (* Get the l2 ops corresponding to indeces [hd + n - 1 .. hd], + so that the accumulated list is in the right order *) + fold_n_times_es + ~when_negative:Zk_rollup_negative_length + n + (fun (ctxt, ops, i) -> + let* ctxt, op = pending_op ctxt rollup i in + return (ctxt, op :: ops, Int64.pred i)) + (ctxt, [], Int64.(sub (add hd (of_int n)) 1L)) + in + return (ctxt, ops) + +let update ctxt rollup ~pending_to_drop ~new_account = + let open Lwt_result_syntax in + let open Zk_rollup_repr in + let open Zk_rollup_account_repr in + let* ctxt, pl = pending_list ctxt rollup in + let* ctxt, acc = account ctxt rollup in + let pl_length = pending_length pl in + let*? () = + error_when + Compare.Int.(pending_to_drop > pl_length) + Zk_rollup_pending_list_too_short + in + let next_index = next_index pl in + (* Drop the indeces from [head] to [head + pending_to_drop - 1] + from the storage of L2 operations. *) + let* ctxt, freed = + match head pl with + | Error _e -> + (* If the pending list is empty, then [pending_to_drop] must be 0. *) + return (ctxt, 0) + | Ok head -> + let* ctxt, freed, _i = + fold_n_times_es + ~when_negative:Zk_rollup_negative_length + pending_to_drop + (fun (ctxt, freed, i) -> + let* ctxt, new_freed, _bound = + Storage.Zk_rollup.Pending_operation.remove (ctxt, rollup) i + in + return (ctxt, freed + new_freed, Int64.succ i)) + (ctxt, 0, head) + in + return (ctxt, freed) + in + (* Subtract the bytes freed by removing pending operations from + acc.dynamic.used_l2_operations_storage_space, and update + [new_account]. + *) + let used_l2_operations_storage_space = + Z.(sub acc.dynamic.used_l2_operations_storage_space (Z.of_int freed)) + in + let new_account = + { + new_account with + dynamic = + { + state = new_account.dynamic.state; + paid_l2_operations_storage_space = + new_account.dynamic.paid_l2_operations_storage_space; + used_l2_operations_storage_space; + }; + } + in + let* ctxt, _diff_acc = + Storage.Zk_rollup.Account.update ctxt rollup new_account + in + (* Update the pending list descriptor *) + let pl_length = pl_length - pending_to_drop in + let pl = + if Compare.Int.(pl_length = 0) then Empty {next_index} + else Pending {next_index; length = pl_length} + in + let* ctxt, _diff_pl = Storage.Zk_rollup.Pending_list.update ctxt rollup pl in + return ctxt + +let assert_exist ctxt rollup = + let open Lwt_result_syntax in + let* ctxt, exists = Storage.Zk_rollup.Account.mem ctxt rollup in + let*? () = error_unless exists (Zk_rollup_does_not_exist rollup) in + return ctxt + +let exists ctxt rollup = Storage.Zk_rollup.Account.mem ctxt rollup diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.mli new file mode 100644 index 000000000000..7f4c06e42e8a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_storage.mli @@ -0,0 +1,158 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** These errors are only to be matched in tests. *) +type error += + | Zk_rollup_does_not_exist of Zk_rollup_repr.t + (** Emitted when trying to perform an operation over a ZK rollup + that hasn't been initialised. *) + | Zk_rollup_invalid_op_code of int + (** Emitted when trying to add to the pending list and operation + with an invalid op code. *) + | Zk_rollup_pending_list_too_short + (** Emitted when trying to process more public operations than + those available in the pending list. *) + +(** [account context rollup] fetches the ZK [rollup]'s account from the + storage. +*) +val account : + Raw_context.t -> + Zk_rollup_repr.t -> + (Raw_context.t * Zk_rollup_account_repr.t) tzresult Lwt.t + +(* [pending_list context rollup] fetches the ZK [rollup]'s + pending list description from the storage. + See {! Zk_rollup_repr.pending_list}. *) +val pending_list : + Raw_context.t -> + Zk_rollup_repr.t -> + (Raw_context.t * Zk_rollup_repr.pending_list) tzresult Lwt.t + +(* [pending_op context rollup i] fetches the [i]th L2 operation from + ZK [rollup]'s pending list, alongside an optional ticket hash + to perform an exit (see {!Zk_rollup_apply} for more details). +*) +val pending_op : + Raw_context.t -> + Zk_rollup_repr.t -> + int64 -> + (Raw_context.t * (Zk_rollup_operation_repr.t * Ticket_hash_repr.t option)) + tzresult + Lwt.t + +(** [originate context static ~init_state] produces an address [a] for + a ZK rollup storage using the [origination_nonce] from + the [context]. This function also initializes the storage, + indexing the initial ZKRU account by [a]. + + Returns the new context and ZKRU address, alongside the size + of the new account. +*) +val originate : + Raw_context.t -> + Zk_rollup_account_repr.static -> + init_state:Zk_rollup_state_repr.t -> + (Raw_context.t * Zk_rollup_repr.t * Z.t) tzresult Lwt.t + +(** [add_to_pending context rollup operations] appends to the + ZK [rollup]'s pending list a list of L2 [operations]. + Returns the new context alongside the size of the new operations. + + May fail with: + {ul + {li [Zk_rollup_invalid_op_code op_code] if the [op_code] + of one of the [operations] is greater or equal to the + number of declared operations for this [rollup]. + } + } +*) +val add_to_pending : + Raw_context.t -> + Zk_rollup_repr.t -> + (Zk_rollup_operation_repr.t * Ticket_hash_repr.t option) list -> + (Raw_context.t * Z.t) tzresult Lwt.t + +(** [get_pending_length context rollup] returns the length of a + ZK [rollup]'s pending list. +*) +val get_pending_length : + Raw_context.t -> Zk_rollup_repr.t -> (Raw_context.t * int) tzresult Lwt.t + +(** [get_prefix context rollup n] returns the prefix of length [n] + of the [rollup]'s pending list. + + May fail with: + {ul + {li [Zk_rollup_pending_list_too_short] if [n] is greater than + the length of the pending list.} + {li [Zk_rollup_negative_length] if [n] is negative.} + } +*) +val get_prefix : + Raw_context.t -> + Zk_rollup_repr.t -> + int -> + (Raw_context.t + * (Zk_rollup_operation_repr.t * Ticket_hash_repr.t option) list) + tzresult + Lwt.t + +(** [update context rollup ~pending_to_drop ~new_account] sets the + [rollup]'s account to [new_account]. Additionally, it removes + the first [pending_to_drop] entries from the [rollup]'s pending + list. + Returns the new context. + + May fail with: + {ul + {li [Zk_rollup_pending_list_too_short] if [pending_to_drop] is + greater than the length of the pending list.} + {li [Zk_rollup_negative_length] if [pending_to_drop] is negative.} + } +*) +val update : + Raw_context.t -> + Zk_rollup_repr.t -> + pending_to_drop:int -> + new_account:Zk_rollup_account_repr.t -> + Raw_context.t tzresult Lwt.t + +(** [assert_exist context rollup] asserts that [rollup] has been initialized. + Returns the new context. + + May fail with: + {ul + {li [Zk_rollup_does_not_exist] if [rollup] is not found.} + } +*) +val assert_exist : + Raw_context.t -> Zk_rollup_repr.t -> Raw_context.t tzresult Lwt.t + +(** [exists context rollup] returns a boolean representing whether + [rollup] has been initialized. +*) +val exists : + Raw_context.t -> Zk_rollup_repr.t -> (Raw_context.t * bool) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.ml new file mode 100644 index 000000000000..a8dfc557c5ac --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.ml @@ -0,0 +1,40 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + contents : Script_repr.expr; + ty : Script_repr.expr; + ticketer : Contract_repr.t; +} + +let encoding : t Data_encoding.t = + let open Data_encoding in + conv + (fun {contents; ty; ticketer} -> (contents, ty, ticketer)) + (fun (contents, ty, ticketer) -> {contents; ty; ticketer}) + (obj3 + (req "contents" Script_repr.expr_encoding) + (req "ty" Script_repr.expr_encoding) + (req "ticketer" Contract_repr.encoding)) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.mli new file mode 100644 index 000000000000..34574e7c4f02 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_ticket_repr.mli @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Representation of tickets for the ZKRU. + This data is used by the [Zk_rollup_publish] operation to compute the + ticket hashes needed to transfer tickets from the ZK Rollup to an + implicit account. +*) +type t = { + contents : Script_repr.expr; + ty : Script_repr.expr; + ticketer : Contract_repr.t; +} + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.ml b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.ml new file mode 100644 index 000000000000..5357f923beb2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.ml @@ -0,0 +1,86 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type op_pi = { + new_state : Zk_rollup_state_repr.t; + fee : Zk_rollup_scalar.t; + exit_validity : bool; +} + +type private_inner_pi = { + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; +} + +type fee_pi = {new_state : Zk_rollup_state_repr.t} + +(* Data sent to an update operation *) +type t = { + pending_pis : (string * op_pi) list; + private_pis : (string * private_inner_pi) list; + fee_pi : fee_pi; + proof : Plonk.proof; +} + +let op_pi_encoding : op_pi Data_encoding.t = + Data_encoding.( + conv + (fun {new_state; fee; exit_validity} -> (new_state, fee, exit_validity)) + (fun (new_state, fee, exit_validity) -> {new_state; fee; exit_validity}) + (obj3 + (req "new_state" Zk_rollup_state_repr.encoding) + (req "fee" Plonk.scalar_encoding) + (req "exit_validity" bool))) + +let private_inner_pi_encoding : private_inner_pi Data_encoding.t = + Data_encoding.( + conv + (fun ({new_state; fees} : private_inner_pi) -> (new_state, fees)) + (fun (new_state, fees) -> {new_state; fees}) + (obj2 + (req "new_state" Zk_rollup_state_repr.encoding) + (req "fee" Plonk.scalar_encoding))) + +let fee_pi_encoding : fee_pi Data_encoding.t = + Data_encoding.( + conv + (fun {new_state} -> new_state) + (fun new_state -> {new_state}) + (obj1 (req "new_state" Zk_rollup_state_repr.encoding))) + +let encoding : t Data_encoding.t = + Data_encoding.( + conv + (fun {pending_pis; private_pis; fee_pi; proof} -> + (pending_pis, private_pis, fee_pi, proof)) + (fun (pending_pis, private_pis, fee_pi, proof) -> + {pending_pis; private_pis; fee_pi; proof}) + (obj4 + (req "pending_pis" (list @@ tup2 (string Plain) op_pi_encoding)) + (req + "private_pis" + (list @@ tup2 (string Plain) private_inner_pi_encoding)) + (req "fee_pi" fee_pi_encoding) + (req "proof" Plonk.proof_encoding))) diff --git a/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.mli b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.mli new file mode 100644 index 000000000000..a8a2dfaee70d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/zk_rollup_update_repr.mli @@ -0,0 +1,60 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Payload of a ZK Rollup update operation. + The operator only needs to send a subset of the public inputs + defined in {!Zk_rollup_circuit_public_inputs_repr}, the rest + is provided by the protocol. +*) + +(** Minimal subset of public inputs for the public L2 operations' circuits. *) +type op_pi = { + new_state : Zk_rollup_state_repr.t; + fee : Zk_rollup_scalar.t; + exit_validity : bool; +} + +(** Minimal subset of public inputs for the circuits for batches of + private L2 operations *) +type private_inner_pi = { + new_state : Zk_rollup_state_repr.t; + fees : Zk_rollup_scalar.t; +} + +(** Minimal subset of public inputs for the "fee" circuit. *) +type fee_pi = {new_state : Zk_rollup_state_repr.t} + +(** Payload of an update operation. + Includes the proof and the public inputs that are needed to verify it. + Each set of public inputs also carries the string that identifies the + circuit which they are for. *) +type t = { + pending_pis : (string * op_pi) list; + private_pis : (string * private_inner_pi) list; + fee_pi : fee_pi; + proof : Plonk.proof; +} + +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/dune b/src/proto_016_PtMumbai/lib_sc_rollup/dune new file mode 100644 index 000000000000..759a44c274e0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/dune @@ -0,0 +1,24 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_sc_rollup_alpha) + (public_name tezos-sc-rollup-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-protocol-alpha + tezos-protocol-plugin-alpha + tezos-protocol-alpha.parameters + tezos-rpc + tezos-injector-alpha) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha + -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_alpha_parameters + -open Tezos_injector_alpha)) diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.ml b/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.ml new file mode 100644 index 000000000000..7ae2e54fda11 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.ml @@ -0,0 +1,176 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context.Sc_rollup + +let default_new_dissection ~default_number_of_sections + ~(start_chunk : Game.dissection_chunk) + ~(our_stop_chunk : Game.dissection_chunk) = + let max_number_of_sections = Z.of_int default_number_of_sections in + let trace_length = Tick.distance our_stop_chunk.tick start_chunk.tick in + let number_of_sections = Z.min max_number_of_sections trace_length in + let rem = Z.(rem trace_length number_of_sections) in + let first_section_length, section_length = + if Compare.Z.(trace_length <= max_number_of_sections) then + (* In this case, every section is of length one. *) + Z.(one, one) + else + let section_length = Z.(max one (div trace_length number_of_sections)) in + if Compare.Z.(section_length = Z.one) && not Compare.Z.(rem = Z.zero) then + (* If we put [section_length] in this situation, we will most likely + have a very long last section. *) + (rem, section_length) + else (section_length, section_length) + in + (* [k] is the number of sections in [rev_dissection]. *) + let rec make rev_dissection k tick = + if Z.(equal k number_of_sections) then List.rev rev_dissection + else + let next_tick = Tick.jump tick section_length in + make (tick :: rev_dissection) (Z.succ k) next_tick + in + make [] Z.one (Tick.jump start_chunk.tick first_section_length) + +let make_dissection ~state_hash_from_tick ~start_chunk ~our_stop_chunk ticks = + let rec make_dissection_aux ticks acc = + let open Lwt_result_syntax in + match ticks with + | tick :: rst -> + let* state_hash = state_hash_from_tick tick in + let chunk = Dissection_chunk.{tick; state_hash} in + make_dissection_aux rst (chunk :: acc) + | [] -> return @@ List.rev (our_stop_chunk :: acc) + in + make_dissection_aux ticks [start_chunk] + +module Wasm = struct + let new_dissection ~default_number_of_sections ~start_chunk ~our_stop_chunk = + let open Dissection_chunk in + let dist = Tick.distance start_chunk.tick our_stop_chunk.tick in + let ticks_per_snapshot = Wasm_2_0_0PVM.ticks_per_snapshot in + if Compare.Z.(dist <= ticks_per_snapshot) then + (* + There are two cases that require us to fall back to the + default behavior. Either [start_chunk] is not aligned on the + size of a snapshot (meaning the PVM is stuck) or the distance + between the start and stop chunk is lesser than a snapshot, + meaning we have already found the kernel_run invocation we + were looking for. + *) + default_new_dissection + ~default_number_of_sections + ~start_chunk + ~our_stop_chunk + else + let is_stop_chunk_aligned = + Compare.Z.( + Z.rem (Tick.to_z our_stop_chunk.tick) ticks_per_snapshot = Z.zero) + in + let final_tick = + Tick.of_z + Z.( + div (Tick.to_z our_stop_chunk.tick) ticks_per_snapshot + * ticks_per_snapshot) + in + let dist = Tick.distance start_chunk.tick final_tick in + let max_number_of_sections = Z.(div dist ticks_per_snapshot) in + let number_of_sections = + Z.min + (Z.of_int + (* If [is_stop_chunk_aligned] is false, we allocate one + sections for the surplus. *) + (if is_stop_chunk_aligned then default_number_of_sections + else default_number_of_sections - 1)) + max_number_of_sections + in + + (* [go remaining_sections last_tick dist] tries to compute + [remaining_sections] sections as evenly as possible, starting + from [last_tick] and covering [dist] ticks. *) + let rec go remaining_sections last_tick dist rev_acc = + (* The last section is created by [make_dissection] when it + adds the [stop_chunk]. *) + if Z.(remaining_sections <= one) then + let rev_acc = + (* If [is_stop_chunk_aligned] is false, we insert the + last snapshot point. *) + if is_stop_chunk_aligned then rev_acc else final_tick :: rev_acc + in + List.rev rev_acc + else + (* + We compute the length of the next section of the + dissection as the maximum size such that if we would give + this number to all remaining sections, we would not + consume more than [dist] ticks. This is ensured by + [Z.div], which computes a lower rounding. + *) + let section_len = + Z.( + dist + / (ticks_per_snapshot * remaining_sections) + * ticks_per_snapshot) + in + let next_tick = Tick.jump last_tick section_len in + let next_dist = Z.(dist - section_len) in + (* + There are two cases to consider here. + + 1. Either [dist] was a multiple of + [ticks_per_snapshot]. In that case, the same + [section_len] will be computed in all subsequent + calls of [go]. + 2. Or [dist] was not a multiple of + [ticks_per_snapshot]. In that case, the next + [section_len] in float will be slightly higher than + the previous one, because it will benefit from the + unconsumed reminder of the previous computation, + until enough is left that [dist] becomes a + multiplier of [ticks_per_snapshot]. In that case, we + will fall back to case 1. + + Take case of dividing 60 into 32 chunks. + + - [remaining_sections = 60], [remaining_sections = 32], and + [section_len = 1] (60 / 32 ~= 1.87) + - [remaining_sections = 59], [remaining_sections = 31], and + [section_len = 1] (59 / 31 ~= 1.90) + - [remaining_sections = 58], [remaining_sections = 30], and + [section_len = 1] (58 / 30 ~= 1.93) + - [remaining_sections = 57], [remaining_sections = 29], and + [section_len = 1] (57 / 29 ~= 1.97) + - [remaining_sections = 56], [remaining_sections = 28], and + [section_len = 2] (56 / 28 = 2) + + All remaining sections will be of length 2. + *) + go + Z.(pred remaining_sections) + next_tick + next_dist + (next_tick :: rev_acc) + in + go number_of_sections start_chunk.tick dist [] +end diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.mli b/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.mli new file mode 100644 index 000000000000..eb59b3bc9512 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/game_helpers.mli @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context.Sc_rollup + +(** [default_new_dissection ~default_number_of_sections ~start_chunk + ~our_stop_chunk] computes a list of intermediary ticks that can + later be turned into new dissection from between [start_chunk] and + [our_stop_chunk] with [make_dissection]. The algorithm satisfies + the default predicate on dissection exported by the protocol. *) +val default_new_dissection : + default_number_of_sections:int -> + start_chunk:Game.dissection_chunk -> + our_stop_chunk:Game.dissection_chunk -> + Tick.t list + +(** [make_dissection ~state_hash_from_tick ~start_chunk + ~our_stop_chunk intermediary_ticks] computes a new dissection from + a list of intermediary ticks between [start_chunk] and + [our_stop_chunk]. + + This function assumes [intermediary_ticks] encodes a valid + dissection from [start_chunk] to [our_stop_chunk], and recomputes + the state hash associated to each ticks. *) +val make_dissection : + state_hash_from_tick:(Tick.t -> State_hash.t option tzresult Lwt.t) -> + start_chunk:Dissection_chunk.t -> + our_stop_chunk:Dissection_chunk.t -> + Tick.t trace -> + Dissection_chunk.t list tzresult Lwt.t + +module Wasm : sig + (** [new_dissection ~default_number_of_sections ~start_chunk + ~our_stop_chunk] computes a dissection that satisfies the + dissection predicate of the WASM PVM, that is all the ticks in + the dissection are aligned with the size of a snapshot. + + If [start_chunk] is not a multiple of the size of a snapshot or + if the distance between [start_chunk] and [stop_chunk] is not + greater than the size of a snapshot, then + {!default_new_dissection} is called, because it means the WASM + PVM is stuck. *) + val new_dissection : + default_number_of_sections:int -> + start_chunk:Game.dissection_chunk -> + our_stop_chunk:Game.dissection_chunk -> + Tick.t list +end diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.ml b/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.ml new file mode 100644 index 000000000000..71987dc50b8d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.ml @@ -0,0 +1,72 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + counter : Z.t; + (** Each message is given a unique counter to allow for the batcher to + receive multiple identical messages. *) + content : string; (** The actual content of the message. *) +} + +let content_encoding = + let open Data_encoding in + def "sc_l2_message" ~description:"A hex encoded smart contact rollup message" + @@ string' Hex + +let encoding = + let open Data_encoding in + conv + (fun {counter; content} -> (counter, content)) + (fun (counter, content) -> {counter; content}) + @@ obj2 (req "counter" z) (req "content" content_encoding) + +let make = + let counter = ref Z.zero in + fun content -> + let m = {content; counter = !counter} in + counter := Z.succ !counter ; + m + +let content m = m.content + +module Hash = + Tezos_crypto.Blake2B.Make + (Tezos_crypto.Base58) + (struct + let name = "sc_rollup_l2_message" + + let title = "A SCORU L2 message" + + let b58check_prefix = "\003\250\179\247\196" (* scmsg(55) *) + + let size = None + end) + +let () = + Tezos_crypto.Base58.check_encoded_prefix Hash.b58check_encoding "scmsg" 55 + +type hash = Hash.t + +let hash t = Hash.hash_bytes [Data_encoding.Binary.to_bytes_exn encoding t] diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.mli b/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.mli new file mode 100644 index 000000000000..456950222651 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/l2_message.mli @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Type of L2 messages. *) +type t + +(** [make message] constructs a message with content [message]. *) +val make : string -> t + +(** [content message] returns the string content of [message], i.e. + [content (make s) = s]. *) +val content : t -> string + +(** Hash with b58check encoding scmsg(55), for hashes of L2 messages. *) +module Hash : Tezos_crypto.S.HASH + +(** Alias for message hash *) +type hash = Hash.t + +(** {2 Serialization} *) + +val content_encoding : string Data_encoding.t + +val encoding : t Data_encoding.t + +val hash : t -> Hash.t diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/sc_rollup_services.ml b/src/proto_016_PtMumbai/lib_sc_rollup/sc_rollup_services.ml new file mode 100644 index 000000000000..ad563962fe17 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_sc_rollup/sc_rollup_services.ml @@ -0,0 +1,662 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(* We distinguish RPC endpoints served by the rollup node into `global` and + `local`. The difference between the two lies in whether the responses + given by different rollup nodes in the same state (see below for an + exact definition) must be the same (in the case of global endpoints) + or can differ (in the case of local endpoints). + + More formally, two rollup nodes are in the same quiescent state if they are + subscribed to the same rollup address, and have processed the same set of + heads from the layer1. We only consider quiescent states, that is those + where rollup nodes are not actively processing a head received from layer1. + + Examples of global endpoints are `current_inbox` and + `last_stored_commitment`, as the responses returned by these endpoints + is expected to be consistent across rollup nodes in the same state. + + An example of local endpoint is `last_published_commitments`, as two rollup + nodes in the same state may either publish or not publish a commitment, + according to whether its inbox level is below the inbox level of the + last cemented commitment at the time they tried to publish the commitment. + See below for a more detailed explanation. +*) + +type eval_result = { + state_hash : Sc_rollup.State_hash.t; + status : string; + output : Sc_rollup.output list; + inbox_level : Raw_level.t; + num_ticks : Z.t; +} + +type simulate_input = { + messages : string list; + reveal_pages : string list option; +} + +type inbox_info = {finalized : bool; cemented : bool} + +type commitment_info = { + commitment : Sc_rollup.Commitment.t; + commitment_hash : Sc_rollup.Commitment.Hash.t; + published_at : Raw_level.t; +} + +type message_status = + | Unknown + | Pending_batch + | Pending_injection of L1_operation.t + | Injected of Injector_sigs.injected_info + | Included of Injector_sigs.included_info * inbox_info + | Committed of Injector_sigs.included_info * inbox_info * commitment_info + +module Encodings = struct + open Data_encoding + + let commitment_with_hash_and_level = + obj3 + (req "commitment" Sc_rollup.Commitment.encoding) + (req "hash" Sc_rollup.Commitment.Hash.encoding) + (opt "published_at_level" Raw_level.encoding) + + let hex_string = conv Bytes.of_string Bytes.to_string bytes + + let eval_result = + conv + (fun {state_hash; status; output; inbox_level; num_ticks} -> + (state_hash, status, output, inbox_level, num_ticks)) + (fun (state_hash, status, output, inbox_level, num_ticks) -> + {state_hash; status; output; inbox_level; num_ticks}) + @@ obj5 + (req + "state_hash" + Sc_rollup.State_hash.encoding + ~description: + "Hash of the state after execution of the PVM on the input \ + messages") + (req "status" string ~description:"Status of the PVM after evaluation") + (req + "output" + (list Sc_rollup.output_encoding) + ~description:"Output produced by evaluation of the messages") + (req + "inbox_level" + Raw_level.encoding + ~description:"Level of the inbox that would contain these messages") + (req + "num_ticks" + z + ~description:"Ticks taken by the PVM for evaluating the messages") + + let simulate_input = + conv + (fun {messages; reveal_pages} -> (messages, reveal_pages)) + (fun (messages, reveal_pages) -> {messages; reveal_pages}) + @@ obj2 + (req + "messages" + (list hex_string) + ~description:"Input messages for simulation") + (opt + "reveal_pages" + (list hex_string) + ~description:"Pages (at most 4kB) to be used for revelation ticks") + + let queued_message = + obj2 + (req "hash" L2_message.Hash.encoding) + (req "message" L2_message.encoding) + + let batcher_queue = list queued_message + + let inbox_info = + conv + (fun {finalized; cemented} -> (finalized, cemented)) + (fun (finalized, cemented) -> {finalized; cemented}) + @@ obj2 (req "finalized" bool) (req "cemented" bool) + + let commitment_info = + conv + (fun {commitment; commitment_hash; published_at} -> + (commitment, (commitment_hash, published_at))) + (fun (commitment, (commitment_hash, published_at)) -> + {commitment; commitment_hash; published_at}) + @@ merge_objs + Sc_rollup.Commitment.encoding + (obj2 + (req "hash" Sc_rollup.Commitment.Hash.encoding) + (req "published_at" Raw_level.encoding)) + + let message_status = + union + [ + case + (Tag 0) + ~title:"unknown" + ~description:"The message is not known by the batcher." + (obj1 (req "status" (constant "unknown"))) + (function Unknown -> Some () | _ -> None) + (fun () -> Unknown); + case + (Tag 1) + ~title:"pending_batch" + ~description:"The message is in the batcher queue." + (obj1 (req "status" (constant "pending_batch"))) + (function Pending_batch -> Some () | _ -> None) + (fun () -> Pending_batch); + case + (Tag 2) + ~title:"pending_injection" + ~description:"The message is batched but not injected yet." + (obj2 + (req "status" (constant "pending_injection")) + (req "operation" L1_operation.encoding)) + (function Pending_injection op -> Some ((), op) | _ -> None) + (fun ((), op) -> Pending_injection op); + case + (Tag 3) + ~title:"injected" + ~description: + "The message is injected as part of an L1 operation but it is not \ + included in a block." + (merge_objs + (obj1 (req "status" (constant "injected"))) + Injector_sigs.injected_info_encoding) + (function Injected info -> Some ((), info) | _ -> None) + (fun ((), info) -> Injected info); + case + (Tag 4) + ~title:"included" + ~description:"The message is included in an inbox in an L1 block." + (merge_objs + (obj1 (req "status" (constant "included"))) + (merge_objs Injector_sigs.included_info_encoding inbox_info)) + (function + | Included (info, inbox_info) -> Some ((), (info, inbox_info)) + | _ -> None) + (fun ((), (info, inbox_info)) -> Included (info, inbox_info)); + case + (Tag 5) + ~title:"committed" + ~description:"The message is included in a committed inbox on L1." + (merge_objs (obj1 (req "status" (constant "committed"))) + @@ merge_objs Injector_sigs.included_info_encoding + @@ merge_objs inbox_info (obj1 (req "commitment" commitment_info))) + (function + | Committed (info, inbox_info, commitment) -> + Some ((), (info, (inbox_info, commitment))) + | _ -> None) + (fun ((), (info, (inbox_info, commitment))) -> + Committed (info, inbox_info, commitment)); + ] + + let message_status_output = + merge_objs (obj1 (opt "content" hex_string)) message_status +end + +module Arg = struct + type block_id = + [ `Head + | `Hash of Tezos_crypto.Block_hash.t + | `Level of Int32.t + | `Finalized + | `Cemented ] + + let construct_block_id = function + | `Head -> "head" + | `Hash h -> Tezos_crypto.Block_hash.to_b58check h + | `Level l -> Int32.to_string l + | `Finalized -> "finalized" + | `Cemented -> "cemented" + + let destruct_block_id h = + match h with + | "head" -> Ok `Head + | "finalized" -> Ok `Finalized + | "cemented" -> Ok `Cemented + | _ -> ( + match Int32.of_string_opt h with + | Some l -> Ok (`Level l) + | None -> ( + match Tezos_crypto.Block_hash.of_b58check_opt h with + | Some b -> Ok (`Hash b) + | None -> Error "Cannot parse block id")) + + let block_id : block_id Tezos_rpc.Arg.t = + Tezos_rpc.Arg.make + ~descr:"An L1 block identifier." + ~name:"block_id" + ~construct:construct_block_id + ~destruct:destruct_block_id + () + + let l2_message_hash : L2_message.hash Tezos_rpc.Arg.t = + Tezos_rpc.Arg.make + ~descr:"A L2 message hash." + ~name:"l2_message_hash" + ~construct:L2_message.Hash.to_b58check + ~destruct:(fun s -> + L2_message.Hash.of_b58check_opt s + |> Option.to_result ~none:"Invalid L2 message hash") + () +end + +module type PREFIX = sig + type prefix + + val prefix : (unit, prefix) Tezos_rpc.Path.t +end + +module Make_services (P : PREFIX) = struct + include P + + let path : prefix Tezos_rpc.Path.context = Tezos_rpc.Path.open_root + + let make_call s = + Tezos_rpc.Context.make_call (Tezos_rpc.Service.prefix prefix s) + + let make_call1 s = + Tezos_rpc.Context.make_call1 (Tezos_rpc.Service.prefix prefix s) + + let make_call2 s = + Tezos_rpc.Context.make_call2 (Tezos_rpc.Service.prefix prefix s) +end + +type simulate_query = {fuel : int64 option} + +let simulate_query : simulate_query Tezos_rpc.Query.t = + let open Tezos_rpc.Query in + query (fun fuel -> {fuel}) + |+ opt_field "fuel" Tezos_rpc.Arg.int64 (fun t -> t.fuel) + |> seal + +module Global = struct + open Tezos_rpc.Path + + include Make_services (struct + type prefix = unit + + let prefix = open_root / "global" + end) + + let sc_rollup_address = + Tezos_rpc.Service.get_service + ~description:"Smart-contract rollup address" + ~query:Tezos_rpc.Query.empty + ~output:Sc_rollup.Address.encoding + (path / "sc_rollup_address") + + let current_tezos_head = + Tezos_rpc.Service.get_service + ~description:"Tezos head known to the smart-contract rollup node" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Tezos_crypto.Block_hash.encoding) + (path / "tezos_head") + + let current_tezos_level = + Tezos_rpc.Service.get_service + ~description:"Tezos level known to the smart-contract rollup node" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Data_encoding.int32) + (path / "tezos_level") + + let last_stored_commitment = + Tezos_rpc.Service.get_service + ~description:"Last commitment computed by the node" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Encodings.commitment_with_hash_and_level) + (path / "last_stored_commitment") + + module Helpers = struct + include Make_services (struct + type prefix = unit + + let prefix = open_root / "helpers" + end) + + let outbox_proof_query = + let open Tezos_rpc.Query in + let open Sc_rollup in + let invalid_message e = + raise + (Invalid + (Format.asprintf + "Invalid message (%a)" + Environment.Error_monad.pp_trace + e)) + in + query (fun outbox_level message_index serialized_outbox_message -> + let req name f = function + | None -> + raise + (Invalid + (Format.sprintf "Query parameter %s is required" name)) + | Some arg -> f arg + in + let outbox_level = + req "outbox_level" Raw_level.of_int32_exn outbox_level + in + let message_index = req "message_index" Z.of_int64 message_index in + let message = + req + "serialized_outbox_message" + (fun s -> Outbox.Message.(unsafe_of_string s |> deserialize)) + serialized_outbox_message + in + match message with + | Error e -> invalid_message e + | Ok message -> {outbox_level; message_index; message}) + |+ opt_field "outbox_level" Tezos_rpc.Arg.int32 (fun o -> + Some (Raw_level.to_int32 o.outbox_level)) + |+ opt_field "message_index" Tezos_rpc.Arg.int64 (fun o -> + Some (Z.to_int64 o.message_index)) + |+ opt_field "serialized_outbox_message" Tezos_rpc.Arg.string (fun o -> + match Outbox.Message.serialize o.message with + | Ok message -> Some (Outbox.Message.unsafe_to_string message) + | Error e -> invalid_message e) + |> seal + + let outbox_proof = + Tezos_rpc.Service.get_service + ~description:"Generate serialized output proof for some outbox message" + ~query:outbox_proof_query + ~output: + Data_encoding.( + obj2 + (req "commitment" Sc_rollup.Commitment.Hash.encoding) + (req "proof" Encodings.hex_string)) + (path / "proofs" / "outbox") + end + + module Block = struct + include Make_services (struct + type prefix = unit * Arg.block_id + + let prefix = prefix / "block" /: Arg.block_id + end) + + let hash = + Tezos_rpc.Service.get_service + ~description: + "Tezos block hash of block known to the smart-contract rollup node" + ~query:Tezos_rpc.Query.empty + ~output:Tezos_crypto.Block_hash.encoding + (path / "hash") + + let level = + Tezos_rpc.Service.get_service + ~description: + "Level of Tezos block known to the smart-contract rollup node" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.int32 + (path / "level") + + let inbox = + Tezos_rpc.Service.get_service + ~description:"Rollup inbox for block" + ~query:Tezos_rpc.Query.empty + ~output:Sc_rollup.Inbox.encoding + (path / "inbox") + + let ticks = + Tezos_rpc.Service.get_service + ~description:"Number of ticks for specified level" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.z + (path / "ticks") + + let total_ticks = + Tezos_rpc.Service.get_service + ~description:"Total number of ticks at specified block" + ~query:Tezos_rpc.Query.empty + ~output:Sc_rollup.Tick.encoding + (path / "total_ticks") + + let num_messages = + Tezos_rpc.Service.get_service + ~description:"Number of messages for specified block" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.z + (path / "num_messages") + + let state_hash = + Tezos_rpc.Service.get_service + ~description:"State hash for this block" + ~query:Tezos_rpc.Query.empty + ~output:Sc_rollup.State_hash.encoding + (path / "state_hash") + + let state_current_level = + Tezos_rpc.Service.get_service + ~description:"Retrieve the current level of a PVM" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Raw_level.encoding) + (path / "state_current_level") + + type state_value_query = {key : string} + + let state_value_query : state_value_query Tezos_rpc.Query.t = + let open Tezos_rpc.Query in + query (fun key -> {key}) + |+ field "key" Tezos_rpc.Arg.string "" (fun t -> t.key) + |> seal + + let state_value = + Tezos_rpc.Service.get_service + ~description:"Retrieve value from key is PVM state of specified block" + ~query:state_value_query + ~output:Data_encoding.bytes + (path / "state") + + let status = + Tezos_rpc.Service.get_service + ~description:"PVM status at block" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.string + (path / "status") + + let outbox_level_query = + let open Tezos_rpc.Query in + query (fun outbox_level -> + let req name f = function + | None -> + raise + (Invalid + (Format.sprintf "Query parameter %s is required" name)) + | Some arg -> f arg + in + req "outbox_level" Raw_level.of_int32_exn outbox_level) + |+ opt_field "outbox_level" Tezos_rpc.Arg.int32 (fun o -> + Some (Raw_level.to_int32 o)) + |> seal + + let outbox = + Tezos_rpc.Service.get_service + ~description:"Outbox at block for a given outbox level" + ~query:outbox_level_query + ~output:Data_encoding.(list Sc_rollup.output_encoding) + (path / "outbox") + + let simulate = + Tezos_rpc.Service.post_service + ~description:"Simulate messages evaluation by the PVM" + ~query:Tezos_rpc.Query.empty + ~input:Encodings.simulate_input + ~output:Encodings.eval_result + (path / "simulate") + + let dal_slots = + Tezos_rpc.Service.get_service + ~description:"Availability slots for a given block" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.list Dal.Slot.Header.encoding) + (path / "dal" / "slot_headers") + + let dal_confirmed_slot_pages = + Tezos_rpc.Service.get_service + ~description: + "Data availability confirmed & downloaded slot pages for a given \ + block hash" + ~query:Tezos_rpc.Query.empty + ~output: + (* DAL/FIXME: https://gitlab.com/tezos/tezos/-/issues/3873 + Estimate size of binary encoding and add a check_size to the + encoding. *) + Data_encoding.( + list + @@ obj2 + (req "index" Dal.Slot_index.encoding) + (req "contents" (list Dal.Page.content_encoding))) + (path / "dal" / "confirmed_slot_pages") + + type dal_slot_page_query = {index : Dal.Slot_index.t; page : int} + + let dal_slot_page_query = + let open Tezos_rpc.Query in + let req name f = function + | None -> + raise + (Invalid (Format.sprintf "Query parameter %s is required" name)) + | Some arg -> f arg + in + let invalid_parameter i = + raise (Invalid (Format.asprintf "Invalid parameter (%d)" i)) + in + query (fun raw_index raw_page -> + let index = req "index" Dal.Slot_index.of_int raw_index in + let page = req "page" (fun p -> p) raw_page in + match index with + | None -> invalid_parameter @@ Option.value ~default:0 raw_index + | Some index -> + if page < 0 then invalid_parameter page else {index; page}) + |+ opt_field "index" Tezos_rpc.Arg.int (fun q -> + Some (Dal.Slot_index.to_int q.index)) + |+ opt_field "slot_page" Tezos_rpc.Arg.int (fun q -> Some q.page) + |> seal + + let dal_slot_page = + Tezos_rpc.Service.get_service + ~description: + "Data availability downloaded slot pages for a given block hash" + ~query:dal_slot_page_query + ~output: + Data_encoding.( + obj2 + (req "result" string) + (opt "contents" Dal.Page.content_encoding)) + (path / "dal" / "slot_page") + + module Outbox = struct + let level_param = + let destruct s = + match Int32.of_string_opt s with + | None -> Error "Invalid level" + | Some l -> ( + match Raw_level.of_int32 l with + | Error _ -> Error "Invalid level" + | Ok l -> Ok l) + in + let construct = Format.asprintf "%a" Raw_level.pp in + Tezos_rpc.Arg.make ~name:"level" ~construct ~destruct () + + include Make_services (struct + type nonrec prefix = prefix * Raw_level.t + + let prefix = prefix / "outbox" /: level_param + end) + + let messages = + Tezos_rpc.Service.get_service + ~description:"Outbox at block for a given outbox level" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.(list Sc_rollup.output_encoding) + (path / "messages") + end + end +end + +module Local = struct + open Tezos_rpc.Path + + include Make_services (struct + type prefix = unit + + let prefix = open_root / "local" + end) + + (* commitments are published only if their inbox level is above the last + cemented commitment level inbox level. Because this information is + fetched from the head of the tezos node to which the rollup node is + connected, it is possible that two rollup nodes that have processed + the same set of heads, but whose corresponding layer1 node has + different information about the last cemented commitment, will + decide to publish and not to publish a commitment, respectively. + As a consequence, the results returned by the endpoint below + in the rollup node will be different. + *) + let last_published_commitment = + Tezos_rpc.Service.get_service + ~description:"Last commitment published by the node" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Encodings.commitment_with_hash_and_level) + (path / "last_published_commitment") + + let injection = + Tezos_rpc.Service.post_service + ~description:"Inject messages in the batcher's queue" + ~query:Tezos_rpc.Query.empty + ~input: + Data_encoding.( + def + "messages" + ~description:"Messages to inject" + (list L2_message.content_encoding)) + ~output: + Data_encoding.( + def + "message_hashes" + ~description:"Hashes of injected L2 messages" + (list L2_message.Hash.encoding)) + (path / "batcher" / "injection") + + let batcher_queue = + Tezos_rpc.Service.get_service + ~description:"List messages present in the batcher's queue" + ~query:Tezos_rpc.Query.empty + ~output:Encodings.batcher_queue + (path / "batcher" / "queue") + + let batcher_message = + Tezos_rpc.Service.get_service + ~description:"Retrieve an L2 message and its status" + ~query:Tezos_rpc.Query.empty + ~output:Encodings.message_status_output + (path / "batcher" / "queue" /: Arg.l2_message_hash) +end diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/RPC.ml b/src/proto_016_PtMumbai/lib_tx_rollup/RPC.ml new file mode 100644 index 000000000000..7b683e61678b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/RPC.ml @@ -0,0 +1,903 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type block_id = + [ `Head + | `L2_block of L2block.hash + | `Tezos_block of Tezos_crypto.Block_hash.t + | `Level of L2block.level ] + +type context_id = [block_id | `Context of Tx_rollup_l2_context_hash.t] + +let context_of_l2_block state b = + Stores.L2_block_store.context state.State.stores.blocks b + +let context_of_block_id state block_id = + let open Lwt_syntax in + match block_id with + | `L2_block b -> context_of_l2_block state b + | `Tezos_block b -> ( + let* b = State.get_tezos_l2_block_hash state b in + match b with None -> return_none | Some b -> context_of_l2_block state b) + | `Head -> ( + match State.get_head state with + | None -> return_none + | Some head -> return_some head.header.context) + | `Level l -> ( + let* b = State.get_level state l in + match b with None -> return_none | Some b -> context_of_l2_block state b) + +let context_of_id state context_id = + match context_id with + | #block_id as block_id -> context_of_block_id state block_id + | `Context c -> Lwt.return_some c + +let construct_block_id = function + | `Head -> "head" + | `L2_block h -> L2block.Hash.to_b58check h + | `Tezos_block h -> Tezos_crypto.Block_hash.to_b58check h + | `Level l -> L2block.level_to_string l + +let destruct_block_id h = + match h with + | "head" -> Ok `Head + | "genesis" -> Ok (`Level Tx_rollup_level.root) + | _ -> ( + match Int32.of_string_opt h with + | Some l -> ( + match Tx_rollup_level.of_int32 l with + | Error _ -> Error "Invalid rollup level" + | Ok l -> Ok (`Level l)) + | None -> ( + match Tezos_crypto.Block_hash.of_b58check_opt h with + | Some b -> Ok (`Tezos_block b) + | None -> ( + match L2block.Hash.of_b58check_opt h with + | Some b -> Ok (`L2_block b) + | None -> Error "Cannot parse block id"))) + +let construct_context_id = function + | #block_id as id -> construct_block_id id + | `Context h -> Tx_rollup_l2_context_hash.to_b58check h + +let destruct_context_id h = + match destruct_block_id h with + | Ok b -> Ok b + | Error _ -> ( + match Tx_rollup_l2_context_hash.of_b58check_opt h with + | Some c -> Ok (`Context c) + | None -> Error "Cannot parse block or context hash") + +module Arg = struct + let indexable ~kind ~construct ~destruct = + let construct i = + match Indexable.destruct i with + | Left i -> Int32.to_string @@ Indexable.to_int32 i + | Right x -> construct x + in + let destruct s = + match destruct s with + | Some a -> Ok Indexable.(forget @@ from_value a) + | None -> ( + match Int32.of_string_opt s with + | Some i -> + Indexable.from_index i + |> Result.map_error (fun _ -> "Invalid index") + |> Result.map Indexable.forget + | None -> Error ("Cannot parse index or " ^ kind)) + in + Tezos_rpc.Arg.make + ~descr: + (Format.sprintf "An index or an L2 %s in the rollup in b58check." kind) + ~name:(kind ^ "_indexable") + ~construct + ~destruct + () + + let address_indexable = + indexable + ~kind:"address" + ~construct:Tx_rollup_l2_address.to_b58check + ~destruct:Tx_rollup_l2_address.of_b58check_opt + + let ticket_indexable = + let open Alpha_context in + indexable + ~kind:"ticket_hash" + ~construct:Ticket_hash.to_b58check + ~destruct:Ticket_hash.of_b58check_opt + + let block_id : block_id Tezos_rpc.Arg.t = + Tezos_rpc.Arg.make + ~descr:"An L2 block identifier." + ~name:"block_id" + ~construct:construct_block_id + ~destruct:destruct_block_id + () + + let context_id : context_id Tezos_rpc.Arg.t = + Tezos_rpc.Arg.make + ~descr:"An L2 block or context identifier." + ~name:"context_id" + ~construct:construct_context_id + ~destruct:destruct_context_id + () + + let l2_transaction : L2_transaction.hash Tezos_rpc.Arg.t = + Tezos_rpc.Arg.make + ~descr:"An L2 transaction identifier." + ~name:"l2_transaction_hash" + ~construct:L2_transaction.Hash.to_b58check + ~destruct:(fun s -> + match L2_transaction.Hash.of_b58check_opt s with + | None -> Error "Cannot parse L2 transaction hash" + | Some h -> Ok h) + () +end + +module Encodings = struct + open Data_encoding + + let header = + merge_objs (obj1 (req "hash" L2block.Hash.encoding)) L2block.header_encoding + + type any_block = Raw of L2block.t | Fancy of Fancy_l2block.t + + let block block_encoding = + merge_objs block_encoding (obj1 (req "metadata" L2block.metadata_encoding)) + + let raw_block = block L2block.encoding + + let any_block = + block + @@ union + [ + case + ~title:"raw" + (Tag 0) + L2block.encoding + (function Raw b -> Some b | _ -> None) + (fun b -> Raw b); + case + ~title:"fancy" + (Tag 1) + Fancy_l2block.encoding + (function Fancy b -> Some b | _ -> None) + (fun b -> Fancy b); + ] + + let block = block Fancy_l2block.encoding + + let synchroniztion_level = + conv + (fun State.{processed_tezos_level; known_tezos_level} -> + (processed_tezos_level, known_tezos_level)) + (fun (processed_tezos_level, known_tezos_level) -> + State.{processed_tezos_level; known_tezos_level}) + @@ obj2 (req "processed_tezos_level" int32) (req "known_tezos_level" int32) + + let synchronization_result = + union + [ + case + ~title:"synchronized" + (Tag 0) + (constant "synchronized") + (function `Synchronized -> Some () | _ -> None) + (fun () -> `Synchronized); + case + ~title:"synchronizing" + (Tag 1) + (obj1 (req "synchronizing" synchroniztion_level)) + (function `Synchronizing levels -> Some levels | _ -> None) + (fun levels -> `Synchronizing levels); + ] +end + +module Block = struct + open Lwt_result_syntax + + let format_query = + let open Tezos_rpc.Query in + query (fun format -> format) + |+ field + ~descr: + "Whether to return the L2 block in raw format (raw) or as a more \ + human readable version (fancy, default)." + "format" + (Tezos_rpc.Arg.make + ~name:"format" + ~destruct:(function + | "raw" -> Ok `Raw + | "fancy" -> Ok `Fancy + | s -> + Error + (Printf.sprintf + "Invalid value (%s) for parameter format, possible \ + values are: raw, fancy." + s)) + ~construct:(function `Raw -> "raw" | `Fancy -> "fancy") + ()) + `Fancy + (fun format -> format) + |> seal + + let path : (unit * block_id) Tezos_rpc.Path.context = + Tezos_rpc.Path.(open_root) + + let prefix = Tezos_rpc.Path.(open_root / "block" /: Arg.block_id) + + let directory : (State.t * block_id) Tezos_rpc.Directory.t ref = + ref Tezos_rpc.Directory.empty + + let register service f = + directory := Tezos_rpc.Directory.register !directory service f + + let register0 service f = register (Tezos_rpc.Service.subst0 service) f + + let register1 service f = register (Tezos_rpc.Service.subst1 service) f + + let export_service s = + let p = Tezos_rpc.Path.prefix prefix path in + Tezos_rpc.Service.prefix p s + + let block = + Tezos_rpc.Service.get_service + ~description:"Get the L2 block in the tx-rollup-node" + ~query:format_query + ~output:(Data_encoding.option Encodings.any_block) + path + + let header = + Tezos_rpc.Service.get_service + ~description:"Get the L2 block header in the tx-rollup-node" + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Encodings.header) + Tezos_rpc.Path.(path / "header") + + let inbox = + Tezos_rpc.Service.get_service + ~description:"Get the tx-rollup-node inbox for a given block" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.(option Inbox.encoding) + Tezos_rpc.Path.(path / "inbox") + + let block_of_id state block_id = + let open Lwt_syntax in + match block_id with + | `L2_block b -> State.get_block state b + | `Tezos_block b -> State.get_tezos_l2_block state b + | `Head -> return (State.get_head state) + | `Level l -> State.get_level_l2_block state l + + let proof = + Tezos_rpc.Service.get_service + ~description: + "Get the merkle proof for a given message for a given block inbox" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.(option Protocol.Tx_rollup_l2_proof.encoding) + Tezos_rpc.Path.(path / "proof" / "message" /: Tezos_rpc.Arg.int) + + let () = + register0 block @@ fun (state, block_id) style () -> + let*! block = block_of_id state block_id in + match block with + | None -> return_none + | Some block -> ( + let*! metadata = State.get_block_metadata state block.header in + match style with + | `Raw -> return_some (Encodings.Raw block, metadata) + | `Fancy -> ( + let hash = block.hash in + let*! ctxt_hash_opt = context_of_l2_block state hash in + match ctxt_hash_opt with + | Some ctxt_hash -> + let*! ctxt = + Context.checkout_exn state.context_index ctxt_hash + in + let*! fancy_block = Fancy_l2block.of_l2block ctxt block in + return_some (Encodings.Fancy fancy_block, metadata) + | None -> + failwith + "The block %a can not be retrieved" + L2block.Hash.pp + hash)) + + let () = + register0 header @@ fun (state, block_id) () () -> + let*! block = block_of_id state block_id in + match block with + | None -> return_none + | Some L2block.{hash; header; _} -> return_some (hash, header) + + let () = + register0 inbox @@ fun (state, block_id) () () -> + let*! block = block_of_id state block_id in + match block with + | None -> return_none + | Some block -> ( + match block_id with + | `Tezos_block b + when Tezos_crypto.Block_hash.(block.header.tezos_block <> b) -> + (* Tezos block has no l2 inbox *) + return_none + | _ -> return_some block.inbox) + + let () = + register1 proof @@ fun ((state, block_id), message_pos) () () -> + let*! block = block_of_id state block_id in + match block with + | None -> return_none + | Some block -> + let*? () = + match block_id with + | `Tezos_block b + when Tezos_crypto.Block_hash.(block.header.tezos_block <> b) -> + (* Tezos block has no l2 inbox *) + error_with + "The tezos block (%a) has not L2 inbox" + Tezos_crypto.Block_hash.pp + b + | _ -> ok () + in + let*? () = + error_when + (List.compare_length_with block.inbox message_pos < 0) + (Error.Tx_rollup_invalid_message_position_in_inbox message_pos) + in + let* proof, _ = + (* We build a rejection for our commitment because we are only + interested in the proof *) + Accuser.build_rejection + state + ~reject_commitment:block.commitment + block + ~position:message_pos + in + return_some proof + + let build_directory state = + !directory + |> Tezos_rpc.Directory.map (fun ((), block_id) -> + Lwt.return (state, block_id)) + |> Tezos_rpc.Directory.prefix + Tezos_rpc.Path.(open_root / "block" /: Arg.block_id) +end + +module Context_RPC = struct + open Lwt_result_syntax + + let path : (unit * context_id) Tezos_rpc.Path.context = + Tezos_rpc.Path.open_root + + let prefix = Tezos_rpc.Path.(open_root / "context" /: Arg.context_id) + + let directory : Context.t Tezos_rpc.Directory.t ref = + ref Tezos_rpc.Directory.empty + + let register service f = + directory := Tezos_rpc.Directory.register !directory service f + + let register0 service f = register (Tezos_rpc.Service.subst0 service) f + + let register1 service f = register (Tezos_rpc.Service.subst1 service) f + + let register2 service f = register (Tezos_rpc.Service.subst2 service) f + + let export_service s = + let p = Tezos_rpc.Path.prefix prefix path in + Tezos_rpc.Service.prefix p s + + type address_metadata = { + index : Tx_rollup_l2_context_sig.address_index; + counter : int64; + public_key : Tezos_crypto.Bls.Public_key.t; + } + + let address_metadata_encoding = + Data_encoding.( + conv + (fun {index; counter; public_key} -> (index, counter, public_key)) + (fun (index, counter, public_key) -> {index; counter; public_key}) + @@ obj3 + (req "index" Tx_rollup_l2_address.Indexable.index_encoding) + (req "counter" int64) + (req "public_key" Tezos_crypto.Bls.Public_key.encoding)) + + let balance = + Tezos_rpc.Service.get_service + ~description:"Get the balance for an l2-address and a ticket" + ~query:Tezos_rpc.Query.empty + ~output:Tx_rollup_l2_qty.encoding + Tezos_rpc.Path.( + path / "tickets" /: Arg.ticket_indexable / "balance" + /: Arg.address_indexable) + + let tickets_count = + Tezos_rpc.Service.get_service + ~description: + "Get the number of tickets that have been involved in the transaction \ + rollup." + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.int32 + Tezos_rpc.Path.(path / "count" / "tickets") + + let addresses_count = + Tezos_rpc.Service.get_service + ~description: + "Get the number of addresses that have been involved in the \ + transaction rollup." + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.int32 + Tezos_rpc.Path.(path / "count" / "addresses") + + let ticket_index = + Tezos_rpc.Service.get_service + ~description: + "Get the index for the given ticket hash, or null if the ticket is not \ + known by the rollup." + ~query:Tezos_rpc.Query.empty + ~output: + (Data_encoding.option + Tx_rollup_l2_context_sig.Ticket_indexable.index_encoding) + Tezos_rpc.Path.(path / "tickets" /: Arg.ticket_indexable / "index") + + let address_metadata = + Tezos_rpc.Service.get_service + ~description: + "Get the metadata associated to a given address, or null if the \ + address has not performed any transfer or withdraw on the rollup." + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option address_metadata_encoding) + Tezos_rpc.Path.(path / "addresses" /: Arg.address_indexable / "metadata") + + let address_index = + Tezos_rpc.Service.get_service + ~description: + "Get the index for the given address, or null if the address is not \ + known by the rollup." + ~query:Tezos_rpc.Query.empty + ~output: + (Data_encoding.option Tx_rollup_l2_address.Indexable.index_encoding) + Tezos_rpc.Path.(path / "addresses" /: Arg.address_indexable / "index") + + let address_counter = + Tezos_rpc.Service.get_service + ~description:"Get the current counter for the given address." + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.int64 + Tezos_rpc.Path.(path / "addresses" /: Arg.address_indexable / "counter") + + let address_public_key = + Tezos_rpc.Service.get_service + ~description: + "Get the BLS public key associated to the given address, or null if \ + the address has not performed any transfer or withdraw on the rollup." + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option Tezos_crypto.Bls.Public_key.encoding) + Tezos_rpc.Path.( + path / "addresses" /: Arg.address_indexable / "public_key") + + let ticket = + Tezos_rpc.Service.get_service + ~description: + "Get a ticket from its hash (or index), or null if the ticket is not \ + known by the rollup" + ~query:Tezos_rpc.Query.empty + ~output:Data_encoding.(option Ticket.encoding) + Tezos_rpc.Path.(path / "tickets" /: Arg.ticket_indexable) + + let get_index ?(check_index = false) (context : Context.t) + (i : (_, _) Indexable.t) get count = + match Indexable.destruct i with + | Left i -> + if check_index then + let* number_indexes = count context in + if Indexable.to_int32 i >= number_indexes then return_none + else return_some i + else return_some i + | Right v -> get context v + + let get_address_index ?check_index context address = + get_index + ?check_index + context + address + Context.Address_index.get + Context.Address_index.count + + let get_ticket_index ?check_index context ticket = + get_index + ?check_index + context + ticket + Context.Ticket_index.get + Context.Ticket_index.count + + let () = + register2 balance @@ fun ((c, ticket), address) () () -> + let* ticket_id = get_ticket_index c ticket in + let* address_id = get_address_index c address in + match (ticket_id, address_id) with + | None, _ | _, None -> return Tx_rollup_l2_qty.zero + | Some ticket_id, Some address_id -> + Context.Ticket_ledger.get c ticket_id address_id + + let () = + register0 tickets_count @@ fun c () () -> Context.Ticket_index.count c + + let () = + register0 addresses_count @@ fun c () () -> Context.Address_index.count c + + let () = + register1 ticket_index @@ fun (c, ticket) () () -> + get_ticket_index ~check_index:true c ticket + + let () = + register1 address_index @@ fun (c, address) () () -> + get_address_index ~check_index:true c address + + let () = + register1 address_metadata @@ fun (c, address) () () -> + let* address_index = get_address_index c address in + match address_index with + | None -> return_none + | Some address_index -> ( + let* metadata = Context.Address_metadata.get c address_index in + match metadata with + | None -> return_none + | Some {counter; public_key} -> + return_some {index = address_index; counter; public_key}) + + let () = + register1 address_counter @@ fun (c, address) () () -> + let* address_index = get_address_index c address in + match address_index with + | None -> return 0L + | Some address_index -> ( + let* metadata = Context.Address_metadata.get c address_index in + match metadata with + | None -> return 0L + | Some {counter; _} -> return counter) + + let () = + register1 address_public_key @@ fun (c, address) () () -> + let* address_index = get_address_index c address in + match address_index with + | None -> return_none + | Some address_index -> ( + let* metadata = Context.Address_metadata.get c address_index in + match metadata with + | None -> return_none + | Some {public_key; _} -> return_some public_key) + + let () = + register1 ticket @@ fun (c, ticket_id) () () -> + let open Lwt_result_syntax in + let* ticket_index = get_ticket_index c ticket_id in + match ticket_index with + | None -> return_none + | Some ticket_index -> + let*! ticket = Context.get_ticket c ticket_index in + return ticket + + let build_directory state = + !directory + |> Tezos_rpc.Directory.map (fun ((), context_id) -> + let open Lwt_syntax in + let* context_hash = context_of_id state context_id in + let context_hash = + match context_hash with + | None -> + Stdlib.failwith @@ "Unknown context id " + ^ construct_context_id context_id + | Some ch -> ch + in + Context.checkout_exn state.State.context_index context_hash) + |> Tezos_rpc.Directory.prefix + Tezos_rpc.Path.(open_root / "context" /: Arg.context_id) +end + +module Injection = struct + let path : unit Tezos_rpc.Path.context = Tezos_rpc.Path.(open_root / "queue") + + let prefix = Tezos_rpc.Path.(open_root) + + let directory : unit Tezos_rpc.Directory.t ref = ref Tezos_rpc.Directory.empty + + let register service f = + directory := Tezos_rpc.Directory.register !directory service f + + let register0 service f = register (Tezos_rpc.Service.subst0 service) f + + let register1 service f = register (Tezos_rpc.Service.subst1 service) f + + let export_service s = Tezos_rpc.Service.prefix prefix s + + let build_directory _state = + if Batcher.active () then !directory + else + (* No queue/batching RPC if batcher is inactive *) + Tezos_rpc.Directory.empty + + let inject_query = + let open Tezos_rpc.Query in + query (fun eager_batch -> + object + method eager_batch = eager_batch + end) + |+ flag "eager_batch" (fun t -> t#eager_batch) + |> seal + + let inject_transaction = + Tezos_rpc.Service.post_service + ~description:"Inject an L2 transaction in the queue of the rollup node." + ~query:inject_query + ~input:L2_transaction.encoding + ~output:L2_transaction.Hash.encoding + Tezos_rpc.Path.(path / "injection" / "transaction") + + let get_transaction = + Tezos_rpc.Service.get_service + ~description:"Retrieve an L2 transaction in the queue." + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.option L2_transaction.encoding) + Tezos_rpc.Path.(path / "transaction" /: Arg.l2_transaction) + + let get_queue = + Tezos_rpc.Service.get_service + ~description:"Get the whole queue of L2 transactions." + ~query:Tezos_rpc.Query.empty + ~output:(Data_encoding.list L2_transaction.encoding) + path + + let () = + register0 inject_transaction (fun () q transaction -> + Batcher.register_transaction ~eager_batch:q#eager_batch transaction) + + let () = + register1 get_transaction (fun ((), tr_hash) () () -> + let open Lwt_result_syntax in + let*? tr = Batcher.find_transaction tr_hash in + return tr) + + let () = + register0 get_queue (fun () () () -> + let open Lwt_result_syntax in + let*? q = Batcher.get_queue () in + return q) +end + +module Monitor = struct + let path : unit Tezos_rpc.Path.context = Tezos_rpc.Path.open_root + + let prefix = Tezos_rpc.Path.(open_root / "monitor") + + let directory : State.t Tezos_rpc.Directory.t ref = + ref Tezos_rpc.Directory.empty + + let gen_register service f = + directory := Tezos_rpc.Directory.gen_register !directory service f + + let gen_register0 service f = + gen_register (Tezos_rpc.Service.subst0 service) f + + let export_service s = + let p = Tezos_rpc.Path.prefix prefix path in + Tezos_rpc.Service.prefix p s + + let build_directory state = + !directory + |> Tezos_rpc.Directory.map (fun () -> Lwt.return state) + |> Tezos_rpc.Directory.prefix prefix + + let synchronized = + Tezos_rpc.Service.get_service + ~description: + "Wait for the node to have synchronized its L2 chain with the L1 \ + chain, streaming its progress." + ~query:Tezos_rpc.Query.empty + ~output:Encodings.synchronization_result + Tezos_rpc.Path.(path / "synchronized") + + let () = + gen_register0 synchronized (fun state () () -> + let open Lwt_syntax in + let levels_stream, stopper = + Lwt_watcher.create_stream state.sync.sync_level_input + in + let synced = ref false in + let next () = + if !synced then Lwt.return_none + else + let levels = + let+ levels = Lwt_stream.get levels_stream in + match levels with + | None -> + synced := true ; + `Synchronized + | Some levels -> `Synchronizing levels + in + let synchronized = + let+ () = State.synchronized state in + synced := true ; + `Synchronized + in + let+ result = Lwt.pick [levels; synchronized] in + Some result + in + let shutdown () = Lwt_watcher.shutdown stopper in + Tezos_rpc.Answer.return_stream {next; shutdown}) +end + +let register state = + List.fold_left + (fun dir f -> Tezos_rpc.Directory.merge dir (f state)) + Tezos_rpc.Directory.empty + [ + Block.build_directory; + Context_RPC.build_directory; + Injection.build_directory; + Monitor.build_directory; + ] + +let sanitize_cors_headers ~default headers = + List.map String.lowercase_ascii headers + |> String.Set.of_list + |> String.Set.(union (of_list default)) + |> String.Set.elements + +let start_server configuration state = + let open Lwt_result_syntax in + let Node_config.{rpc_addr; cors_origins; cors_headers; _} = configuration in + let host, rpc_port = rpc_addr in + let host = P2p_addr.to_string host in + let dir = register state in + let node = `TCP (`Port rpc_port) in + let acl = RPC_server.Acl.allow_all in + let cors_headers = + sanitize_cors_headers ~default:["Content-Type"] cors_headers + in + let server = + RPC_server.init_server + dir + ~acl + ~cors:{allowed_headers = cors_headers; allowed_origins = cors_origins} + ~media_types:Media_type.all_media_types + in + Lwt.catch + (fun () -> + let*! () = + RPC_server.launch + ~host + server + ~callback:(RPC_server.resto_callback server) + node + in + let*! () = Event.(emit rpc_server_is_ready) rpc_addr in + return server) + fail_with_exn + +let balance ctxt (block : block_id) ticket tz4 = + let ticket = Indexable.from_value ticket in + let tz4 = Indexable.from_value tz4 in + let block = + match destruct_context_id (construct_context_id block) with + | Ok v -> v + | _ -> assert false + in + Tezos_rpc.Context.make_call3 + Context_RPC.(export_service balance) + ctxt + block + ticket + tz4 + () + () + +let counter ctxt (block : block_id) tz4 = + let block = + match destruct_context_id (construct_context_id block) with + | Ok v -> v + | _ -> assert false + in + let tz4 = Indexable.from_value tz4 in + Tezos_rpc.Context.make_call2 + Context_RPC.(export_service address_counter) + ctxt + block + tz4 + () + () + +let inbox ctxt block = + Tezos_rpc.Context.make_call1 Block.(export_service inbox) ctxt block () () + +let raw_block ctxt block = + let open Lwt_result_syntax in + let+ raw_block = + Tezos_rpc.Context.make_call1 Block.(export_service block) ctxt block `Raw () + in + Option.map + (function Encodings.Raw b, metadata -> (b, metadata) | _ -> assert false) + raw_block + +let block ctxt block = + let open Lwt_result_syntax in + let+ raw_block = + Tezos_rpc.Context.make_call1 + Block.(export_service block) + ctxt + block + `Fancy + () + in + Option.map + (function + | Encodings.Fancy b, metadata -> (b, metadata) | _ -> assert false) + raw_block + +let get_queue ctxt = + Tezos_rpc.Context.make_call Injection.(export_service get_queue) ctxt () () () + +let get_transaction ctxt hash = + Tezos_rpc.Context.make_call1 + Injection.(export_service get_transaction) + ctxt + hash + () + () + +let inject_transaction ctxt ?(eager_batch = false) transaction = + Tezos_rpc.Context.make_call + Injection.(export_service inject_transaction) + ctxt + () + (object + method eager_batch = eager_batch + end) + transaction + +let get_message_proof ctxt block ~message_position = + Tezos_rpc.Context.make_call2 + Block.(export_service proof) + ctxt + block + message_position + () + () + +let monitor_synchronized ctxt = + Tezos_rpc.Context.make_streamed_call + Monitor.(export_service synchronized) + ctxt + () + () + () diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/RPC.mli b/src/proto_016_PtMumbai/lib_tx_rollup/RPC.mli new file mode 100644 index 000000000000..e3062f64be6b --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/RPC.mli @@ -0,0 +1,119 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Tezos_rpc_http_server +open Protocol + +type block_id = + [ `Head + | `L2_block of L2block.hash + | `Tezos_block of Tezos_crypto.Block_hash.t + | `Level of L2block.level ] + +val destruct_block_id : string -> (block_id, string) result + +type context_id = [block_id | `Context of Tx_rollup_l2_context_hash.t] + +module Encodings : sig + val header : (L2block.hash * L2block.header) Data_encoding.t + + type any_block = Raw of L2block.t | Fancy of Fancy_l2block.t + + val block : (Fancy_l2block.t * L2block.metadata) Data_encoding.t + + val raw_block : (L2block.t * L2block.metadata) Data_encoding.t + + val any_block : (any_block * L2block.metadata) Data_encoding.t +end + +(** Starts the RPC server of the tx_rollup_node. *) +val start_server : Node_config.t -> State.t -> RPC_server.server tzresult Lwt.t + +(** Returns the balance for an l2-address and a ticket. *) +val balance : + #Tezos_rpc.Context.simple -> + block_id -> + Alpha_context.Ticket_hash.t -> + Tx_rollup_l2_address.t -> + Tx_rollup_l2_qty.t Error_monad.tzresult Lwt.t + +(** Returns the current counter for the given address. *) +val counter : + #Tezos_rpc.Context.simple -> + block_id -> + Tx_rollup_l2_address.t -> + int64 Error_monad.tzresult Lwt.t + +(** Returns the tx-rollup-node inbox for a given block. *) +val inbox : + #Tezos_rpc.Context.simple -> + block_id -> + Inbox.t option Error_monad.tzresult Lwt.t + +(** Returns the L2 block in the tx-rollup-node in the raw format. *) +val raw_block : + #Tezos_rpc.Context.simple -> + block_id -> + (L2block.t * L2block.metadata) option Error_monad.tzresult Lwt.t + +(** Returns the L2 block in the tx-rollup-node. *) +val block : + #Tezos_rpc.Context.simple -> + block_id -> + (Fancy_l2block.t * L2block.metadata) option Error_monad.tzresult Lwt.t + +(** Returns the whole queue of L2 transactions. *) +val get_queue : + #Tezos_rpc.Context.simple -> L2_transaction.t list Error_monad.tzresult Lwt.t + +(** Returns an L2 transaction in the queue given a transaction hash. *) +val get_transaction : + #Tezos_rpc.Context.simple -> + L2_transaction.hash -> + L2_transaction.t option Error_monad.tzresult Lwt.t + +(** Inject an L2 transaction in the queue of the rollup node and returns + the transaction hash. *) +val inject_transaction : + #Tezos_rpc.Context.simple -> + ?eager_batch:bool -> + L2_transaction.t -> + L2_transaction.hash Error_monad.tzresult Lwt.t + +(** Get the merkle proof associated to a message position in the block's inbox. *) +val get_message_proof : + #Tezos_rpc.Context.simple -> + block_id -> + message_position:int -> + Tx_rollup_l2_proof.t option Error_monad.tzresult Lwt.t + +(** Monitors the synchronized progress of the rollup node with respect to L1. *) +val monitor_synchronized : + #Tezos_rpc.Context.streamed -> + ([`Synchronizing of State.sync_levels | `Synchronized] Lwt_stream.t + * Tezos_rpc.Context.stopper) + tzresult + Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/accuser.ml b/src/proto_016_PtMumbai/lib_tx_rollup/accuser.ml new file mode 100644 index 000000000000..8380ac4b4f3d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/accuser.ml @@ -0,0 +1,246 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type error += Tx_rollup_missing_block of L2block.hash + +let () = + register_error_kind + ~id:"tx_rollup.node.missing_block" + ~title:"A block cannot be found" + ~description:"An L2 block cannot be found." + ~pp:(fun ppf b -> + Format.fprintf ppf "The L2 block %a cannot be found." L2block.Hash.pp b) + `Permanent + Data_encoding.(obj1 (req "block" L2block.Hash.encoding)) + (function Tx_rollup_missing_block b -> Some b | _ -> None) + (fun b -> Tx_rollup_missing_block b) + +let eq_merkle_roots r1 r2 = + let mekle_root_to_bytes r = + Data_encoding.Binary.to_bytes_exn Tx_rollup_inbox.Merkle.root_encoding r + in + let r1 = mekle_root_to_bytes r1 in + let r2 = mekle_root_to_bytes r2 in + Bytes.equal r1 r2 + +(* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2925 + Strengthen accuser *) +let rejectable_commitment (state : State.t) + (commitment : Tx_rollup_commitment.Full.t) = + let open Lwt_result_syntax in + let*! finalized_level = State.get_finalized_level state in + match finalized_level with + | Some finalized_level + when Tx_rollup_level.(commitment.level <= finalized_level) -> + (* This commitment is already finalized, nothing we can do anyway. *) + let*! () = + Event.(emit Accuser.bad_finalized_commitment) commitment.level + in + return `Don't_reject + | _ -> ( + let*! block = State.get_level_l2_block state commitment.level in + match block with + | None -> + (* Should not happen. We have no block for that level, so we cannot + know if the commitment is bad. *) + let*! () = Debug_events.(emit should_not_happen) __LOC__ in + tzfail (Error.Tx_rollup_internal __LOC__) + | Some block -> ( + let our_commitment = block.commitment in + let* () = + if + eq_merkle_roots + commitment.inbox_merkle_root + our_commitment.inbox_merkle_root + then return_unit + else + let*! () = + Event.(emit Accuser.inbox_merkle_root_mismatch) + ( commitment.inbox_merkle_root, + our_commitment.inbox_merkle_root ) + in + tzfail (Error.Tx_rollup_internal __LOC__) + in + if + not + @@ Option.equal + Tx_rollup_commitment_hash.equal + commitment.predecessor + our_commitment.predecessor + then + (* Commitments have different predecessors, we cannot construct + rejection. This means that the commitment is on top of a bad + commitment so it will be slashed automatically. *) + let*! () = + Event.(emit Accuser.commitment_predecessor_mismatch) + (commitment.predecessor, our_commitment.predecessor) + in + return `Don't_reject + else + match + List.fold_left2_e + ~when_different_lengths:None + (fun position m1 m2 -> + if Tx_rollup_message_result_hash.(m1 = m2) then + Ok (position + 1) + else Error (Some position)) + 0 + commitment.messages + our_commitment.messages + with + | Ok _ -> return `Don't_reject + | Error None -> + (* Should not happen if the inboxes are the same *) + let*! () = Debug_events.(emit should_not_happen) __LOC__ in + tzfail (Error.Tx_rollup_internal __LOC__) + | Error (Some position) -> + (* We found a bad commitment *) + let*! () = + Event.(emit Accuser.bad_commitment) + (commitment.level, position) + in + return (`Reject (position, block)))) + +let build_rejection state ~(reject_commitment : Tx_rollup_commitment.Full.t) + (block : L2block.t) ~position = + let open Lwt_result_syntax in + let inbox_message = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth block.inbox position + in + let message = inbox_message.message in + let message_result_hash = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth reject_commitment.messages position + in + let*? message_result_path = + let open Tx_rollup_commitment.Merkle in + let tree = List.fold_left snoc nil reject_commitment.messages in + Environment.wrap_tzresult @@ compute_path tree position + in + let* previous_message_result, previous_message_result_path, previous_context = + match (block.header.predecessor, position) with + | None, 0 -> + (* Rejecting first message of first level, no predecessor *) + let*! context = Context.init_context state.State.context_index in + return + ( Tx_rollup_message_result.init, + Tx_rollup_commitment.Merkle.dummy_path, + context ) + | predecessor, _ -> + let* inbox_of_previous_message, previous_message_position = + match (predecessor, position) with + | None, 0 -> assert false (* handled above *) + | Some predecessor_hash, 0 -> + let*! predecessor = State.get_block state predecessor_hash in + let*? predecessor = + Result.of_option + predecessor + ~error:[Tx_rollup_missing_block predecessor_hash] + in + return (predecessor.inbox, List.length predecessor.inbox - 1) + | _ -> return (block.inbox, position - 1) + in + let previous_message_results = + Inbox.proto_message_results inbox_of_previous_message + in + let previous_message_results_hashes = + List.map + Tx_rollup_message_result_hash.hash_uncarbonated + previous_message_results + in + let previous_message_result = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth previous_message_results previous_message_position + in + let*? previous_message_result_path = + let open Tx_rollup_commitment.Merkle in + let tree = List.fold_left snoc nil previous_message_results_hashes in + Environment.wrap_tzresult + @@ compute_path tree previous_message_position + in + let previous_message = + WithExceptions.Option.get ~loc:__LOC__ + @@ List.nth inbox_of_previous_message previous_message_position + in + let+ previous_context = + Context.checkout + state.context_index + previous_message.l2_context_hash.irmin_hash + in + (previous_message_result, previous_message_result_path, previous_context) + in + let message_hashes = + List.map + (fun Inbox.{message; _} -> + Tx_rollup_message_hash.hash_uncarbonated message) + block.inbox + in + let*? message_path = + Environment.wrap_tzresult + @@ Tx_rollup_inbox.Merkle.compute_path message_hashes position + in + let l2_parameters = + Protocol.Tx_rollup_l2_apply. + { + tx_rollup_max_withdrawals_per_batch = + state.constants.parametric.tx_rollup.max_withdrawals_per_batch; + } + in + let+ proof, _ = + Prover_apply.apply_message previous_context l2_parameters message + in + let serialized = Tx_rollup_l2_proof.serialize_proof_exn proof in + ( proof, + Tx_rollup_rejection + { + tx_rollup = state.rollup_info.rollup_id; + level = block.commitment.level; + message; + message_position = position; + message_path; + message_result_hash; + message_result_path; + previous_message_result; + previous_message_result_path; + proof = serialized; + } ) + +let reject_bad_commitment ~source (state : State.t) + (commitment : Tx_rollup_commitment.Full.t) = + let open Lwt_result_syntax in + let* rejectable = rejectable_commitment state commitment in + match rejectable with + | `Don't_reject -> return_unit + | `Reject (position, block) -> + (* This commitment is bad, because of message result at [position], we + should inject a rejection *) + let* _, rejection_operation = + build_rejection state block ~reject_commitment:commitment ~position + in + let* _hash = Injector.add_pending_operation ~source rejection_operation in + return_unit diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/accuser.mli b/src/proto_016_PtMumbai/lib_tx_rollup/accuser.mli new file mode 100644 index 000000000000..23e56026d7d4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/accuser.mli @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(** [build_rejection state ~reject_commitment block ~position] constructs a + rejection operation for rejecting message at position [position] in the (bad) + commitment [reject_commitment], using the actual L2 block [block]. *) +val build_rejection : + State.t -> + reject_commitment:Tx_rollup_commitment.Full.t -> + L2block.t -> + position:int -> + (Protocol.Tx_rollup_l2_proof.t * Kind.tx_rollup_rejection manager_operation) + tzresult + Lwt.t + +(** [reject_bad_commitment ~source state commitment] injects a rejection + operation with [source] if the [commitment] is rejectable. *) +val reject_bad_commitment : + source:Tezos_crypto.Signature.Public_key_hash.t -> + State.t -> + Tx_rollup_commitment.Full.t -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/batcher.ml b/src/proto_016_PtMumbai/lib_tx_rollup/batcher.ml new file mode 100644 index 000000000000..ca8fd4b7482e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/batcher.ml @@ -0,0 +1,382 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context +open Batcher_worker_types +module Tx_queue = Hash_queue.Make (L2_transaction.Hash) (L2_transaction) + +type state = { + rollup : Tx_rollup.t; + constants : Constants.t; + batch_burn_limit : Tez.t option; + index : Context.index; + signer : Tezos_crypto.Signature.public_key_hash; + transactions : Tx_queue.t; + mutable incr_context : Context.t; + lock : Lwt_mutex.t; +} + +let encode_batch batch = + Data_encoding.Binary.to_string Tx_rollup_l2_batch.encoding batch + |> Result.map_error (fun err -> [Data_encoding_wrapper.Encoding_error err]) + +let inject_batches state batches = + let open Lwt_result_syntax in + List.iter_es + (fun batch -> + let*? batch_content = encode_batch batch in + let batch_operation = + Tx_rollup_submit_batch + { + tx_rollup = state.rollup; + content = batch_content; + burn_limit = state.batch_burn_limit; + } + in + let* _hash = + Injector.add_pending_operation ~source:state.signer batch_operation + in + return_unit) + batches + +(** [is_batch_valid] returns whether the batch is valid or not based on two + criteria: + + The proof produced by the batch interpretation must be smaller than + [constants.parametric.tx_rollup.rejection_max_proof_size]. Otherwise, the + associated commitment can be rejected because of the size. + + The batch exceeds the + [constants.parametric.tx_rollup.hard_size_limit_per_message], the submit + batch operation will fail. *) +let is_batch_valid ctxt (constants : Constants.t) batch = + let open Lwt_result_syntax in + (* The batch is ok if: + 1. The proof is small enough + 2. The batch is small enough *) + let batch_size_ok = + let size = Data_encoding.Binary.length Tx_rollup_l2_batch.encoding batch in + size <= constants.parametric.tx_rollup.hard_size_limit_per_message + in + if batch_size_ok then + let parameters = + Tx_rollup_l2_apply. + { + tx_rollup_max_withdrawals_per_batch = + constants.parametric.tx_rollup.max_withdrawals_per_batch; + } + in + let*! res_interp = + Interpreter.interpret_batch + ctxt + parameters + ~rejection_max_proof_size: + constants.parametric.tx_rollup.rejection_max_proof_size + batch + in + let b_proof_size = Result.is_ok res_interp in + return b_proof_size + else return_false + +let get_batches ctxt constants queue = + let open Lwt_result_syntax in + let* rev_batches, rev_current_trs, to_remove = + Tx_queue.fold_es + (fun tr_hash tr (batches, rev_current_trs, to_remove) -> + let new_trs = tr :: rev_current_trs in + let*? batch = L2_transaction.batch (List.rev new_trs) in + let* b = is_batch_valid ctxt constants batch in + if b then return (batches, new_trs, tr_hash :: to_remove) + else + match rev_current_trs with + | [_] -> + (* If only one transaction makes the batch invalid, we remove it + from the current transactions and it'll be removed later. *) + let*! () = Event.(emit Batcher.invalid_transaction) tr in + return (batches, [], tr_hash :: to_remove) + | _ -> + let*? batch = L2_transaction.batch (List.rev rev_current_trs) in + let new_batches = batch :: batches in + (* We add the batch to the accumulator and we go on. *) + let*? batch = L2_transaction.batch [tr] in + let* b = is_batch_valid ctxt constants batch in + if b then return (new_batches, [tr], tr_hash :: to_remove) + else + let*! () = Event.(emit Batcher.invalid_transaction) tr in + return (new_batches, [], tr_hash :: to_remove)) + queue + ([], [], []) + in + let*? batches = + let open Result_syntax in + if rev_current_trs <> [] then + let+ last_batch = L2_transaction.batch (List.rev rev_current_trs) in + List.rev (last_batch :: rev_batches) + else return (List.rev rev_batches) + in + return (batches, to_remove) + +let on_batch state = + let open Lwt_result_syntax in + let* batches, to_remove = + get_batches state.incr_context state.constants state.transactions + in + match batches with + | [] -> return_unit + | _ -> + let*! () = + Event.(emit Batcher.batch) (List.length batches, List.length to_remove) + in + let* () = inject_batches state batches in + let*! () = Event.(emit Batcher.batch_success) () in + List.iter + (fun tr_hash -> Tx_queue.remove state.transactions tr_hash) + to_remove ; + return_unit + +let on_register state ~apply (tr : L2_transaction.t) = + let open Lwt_result_syntax in + Lwt_mutex.with_lock state.lock @@ fun () -> + let*? aggregated_signature = + match Tezos_crypto.Bls.aggregate_signature_opt tr.signatures with + | Some s -> ok s + | None -> error_with "could not aggregate signatures of transaction" + in + let batch = + Tx_rollup_l2_batch.V1.{contents = [tr.transaction]; aggregated_signature} + in + let batch_string = + Data_encoding.Binary.to_string_exn Tx_rollup_l2_batch.encoding (V1 batch) + in + let _msg, msg_size = Tx_rollup_message.make_batch batch_string in + let* () = + fail_when + (msg_size + >= state.constants.parametric.tx_rollup.hard_size_limit_per_message) + (Error.Transaction_too_large + { + actual = msg_size; + limit = + state.constants.parametric.tx_rollup.hard_size_limit_per_message; + }) + in + let context = state.incr_context in + let prev_context = context in + let* context = + if apply then + let* new_context, result, _withdrawals = + let parameters = + Tx_rollup_l2_apply. + { + tx_rollup_max_withdrawals_per_batch = + state.constants.parametric.tx_rollup.max_withdrawals_per_batch; + } + in + L2_apply.Batch_V1.apply_batch context parameters batch + in + let open Tx_rollup_l2_apply.Message_result in + let+ context = + match result with + | Batch_V1.Batch_result {results = [(_tr, Transaction_success)]; _} -> + return new_context + | Batch_V1.Batch_result + {results = [(_tr, Transaction_failure {reason; _})]; _} -> + tzfail (Environment.wrap_tzerror reason) + | _ -> return context + in + context + else return context + in + let tr_hash = L2_transaction.hash tr in + Tx_queue.replace state.transactions tr_hash tr ; + let*! () = Event.(emit Batcher.queue) tr_hash in + if state.incr_context == prev_context then + (* Only update internal context if it was not changed due to a head block + change in the meantime. *) + state.incr_context <- context ; + return tr_hash + +let on_new_head state head = + let open Lwt_result_syntax in + let+ context = Context.checkout state.index head.L2block.header.context in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2816 + Flush and reapply queue *) + state.incr_context <- context + +let init_batcher_state ~rollup ~signer ~batch_burn_limit index constants = + let open Lwt_syntax in + let+ incr_context = Context.init_context index in + { + rollup; + index; + signer; + constants; + batch_burn_limit; + transactions = Tx_queue.create 500_000; + incr_context; + lock = Lwt_mutex.create (); + } + +module Types = struct + type nonrec state = state + + type parameters = { + signer : Tezos_crypto.Signature.public_key_hash; + index : Context.index; + constants : Constants.t; + batch_burn_limit : Tez.t option; + } +end + +module Worker = Worker.MakeSingle (Name) (Request) (Types) + +type worker = Worker.infinite Worker.queue Worker.t + +module Handlers = struct + type self = worker + + let on_request : + type r request_error. + worker -> (r, request_error) Request.t -> (r, request_error) result Lwt.t + = + fun w request -> + let open Lwt_result_syntax in + let state = Worker.state w in + match request with + | Request.Register {tr; apply; eager_batch = _} -> + protect @@ fun () -> + let* tr_hash = on_register state ~apply tr in + return tr_hash + | Request.Batch -> protect @@ fun () -> on_batch state + | Request.New_head head -> protect @@ fun () -> on_new_head state head + + type launch_error = error trace + + let on_launch _w rollup Types.{signer; index; constants; batch_burn_limit} = + let open Lwt_result_syntax in + let*! state = + init_batcher_state ~rollup ~signer ~batch_burn_limit index constants + in + return state + + let on_error (type a b) _w st (r : (a, b) Request.t) (errs : b) : + unit tzresult Lwt.t = + let open Lwt_result_syntax in + let request_view = Request.view r in + let emit_and_return_errors errs = + let*! () = + Event.(emit Batcher.Worker.request_failed) (request_view, st, errs) + in + return_unit + in + match r with + | Request.Register _ -> emit_and_return_errors errs + | Request.Batch -> emit_and_return_errors errs + | Request.New_head _ -> emit_and_return_errors errs + + let on_completion _w r _ st = + match Request.view r with + | Request.View (Register _ | New_head _) -> + Event.(emit Batcher.Worker.request_completed_debug) (Request.view r, st) + | View Batch -> + Event.(emit Batcher.Worker.request_completed_notice) (Request.view r, st) + + let on_no_request _ = Lwt.return_unit + + let on_close _w = Lwt.return_unit +end + +let table = Worker.create_table Queue + +let worker_promise, worker_waker = Lwt.task () + +let init ~rollup ~signer ~batch_burn_limit index constants = + let open Lwt_result_syntax in + let+ worker = + Worker.launch + table + rollup + {signer; index; constants; batch_burn_limit} + (module Handlers) + in + Lwt.wakeup worker_waker worker + +(* This is a batcher worker for a single tx rollup *) +let worker = + lazy + (match Lwt.state worker_promise with + | Lwt.Return worker -> ok worker + | Lwt.Fail _ | Lwt.Sleep -> error Error.No_batcher) + +let active () = + match Lwt.state worker_promise with + | Lwt.Return _ -> true + | Lwt.Fail _ | Lwt.Sleep -> false + +let find_transaction tr_hash = + let open Result_syntax in + let+ w = Lazy.force worker in + let state = Worker.state w in + Tx_queue.find_opt state.transactions tr_hash + +let get_queue () = + let open Result_syntax in + let+ w = Lazy.force worker in + let state = Worker.state w in + Tx_queue.elements state.transactions + +let handle_request_error rq = + let open Lwt_syntax in + let* rq = rq in + match rq with + | Ok res -> return_ok res + | Error (Worker.Request_error errs) -> Lwt.return_error errs + | Error (Closed None) -> Lwt.return_error [Worker_types.Terminated] + | Error (Closed (Some errs)) -> Lwt.return_error errs + | Error (Any exn) -> Lwt.return_error [Exn exn] + +let register_transaction ?(eager_batch = false) ?(apply = true) tr = + let open Lwt_result_syntax in + let*? w = Lazy.force worker in + Worker.Queue.push_request_and_wait + w + (Request.Register {tr; apply; eager_batch}) + |> handle_request_error + +let batch () = + let open Lwt_result_syntax in + let*? w = Lazy.force worker in + Worker.Queue.push_request_and_wait w Request.Batch |> handle_request_error + +let new_head b = + let open Lwt_result_syntax in + let*? w = Lazy.force worker in + let*! (_pushed : bool) = Worker.Queue.push_request w (Request.New_head b) in + return_unit + +let shutdown () = + let w = Lazy.force worker in + match w with Error _ -> Lwt.return_unit | Ok w -> Worker.shutdown w diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/batcher.mli b/src/proto_016_PtMumbai/lib_tx_rollup/batcher.mli new file mode 100644 index 000000000000..6a287c15683f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/batcher.mli @@ -0,0 +1,68 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context + +(** Initialize the internal state of the batcher. *) +val init : + rollup:Tx_rollup.t -> + signer:Tezos_crypto.Signature.public_key_hash -> + batch_burn_limit:Tez.t option -> + Context.index -> + Constants.t -> + unit tzresult Lwt.t + +(** Returns [true] if the batcher was started for this node. *) +val active : unit -> bool + +(** Retrieve an L2 transaction from the queue. *) +val find_transaction : L2_transaction.hash -> L2_transaction.t option tzresult + +(** List all queued transactions in the order they appear in the queue, i.e. the + message that were added first to the queue are at the end of list. *) +val get_queue : unit -> L2_transaction.t list tzresult + +(** [register_transaction ?apply state tx] registers a new L2 transaction [tx] + in the queue of the batcher for future injection on L1. If [apply] is [true] + (defaults to [true]), the transaction is applied on the batcher's incremental + context. In this case, when the application fails, the transaction is not + queued. A batch is injected asynchronously if a full batch can be constructed + and [eager_batch] is [true]. *) +val register_transaction : + ?eager_batch:bool -> + ?apply:bool -> + L2_transaction.t -> + L2_transaction.hash tzresult Lwt.t + +(** Create L2 batches of operations from the queue and pack them in an L1 batch + operation. The batch operation is queued in the injector for injection on the + Tezos node. *) +val batch : unit -> unit tzresult Lwt.t + +(** Notifies a new L2 head to the batcher worker. *) +val new_head : L2block.t -> unit tzresult Lwt.t + +(** Shutdown the batcher, waiting for the ongoing request to be processed. *) +val shutdown : unit -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.ml b/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.ml new file mode 100644 index 000000000000..771d57d0ab24 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.ml @@ -0,0 +1,104 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol +open Alpha_context + +module Request = struct + type ('a, 'b) t = + | Register : { + tr : L2_transaction.t; + apply : bool; + eager_batch : bool; + } + -> (L2_transaction.hash, error trace) t + | New_head : L2block.t -> (unit, error trace) t + | Batch : (unit, error trace) t + + type view = View : _ t -> view + + let view req = View req + + let encoding = + let open Data_encoding in + union + [ + case + (Tag 0) + ~title:"Register" + (obj4 + (req "request" (constant "register")) + (req "transaction" L2_transaction.encoding) + (dft "apply" bool true) + (dft "eager_batch" bool false)) + (function + | View (Register {tr; apply; eager_batch}) -> + Some ((), tr, apply, eager_batch) + | _ -> None) + (fun ((), tr, apply, eager_batch) -> + View (Register {tr; apply; eager_batch})); + case + (Tag 1) + ~title:"New_head" + (obj2 + (req "request" (constant "new_head")) + (req "block" L2block.encoding)) + (function View (New_head b) -> Some ((), b) | _ -> None) + (fun ((), b) -> View (New_head b)); + case + (Tag 2) + ~title:"Batch" + (obj1 (req "request" (constant "batch"))) + (function View Batch -> Some () | _ -> None) + (fun () -> View Batch); + ] + + let pp ppf (View r) = + match r with + | Register {tr; _} -> + Format.fprintf + ppf + "register new L2 transaction %a" + L2_transaction.Hash.pp + (L2_transaction.hash tr) + | New_head b -> + Format.fprintf + ppf + "switching to new L2 head %a" + L2block.Hash.pp + (L2block.hash_header b.header) + | Batch -> Format.pp_print_string ppf "batch" +end + +module Name = struct + type t = Tx_rollup.t + + let encoding = Tx_rollup.encoding + + let base = ["tx_rollup_batcher"] + + let pp = Tx_rollup.pp + + let equal = Tx_rollup.equal +end diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.mli b/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.mli new file mode 100644 index 000000000000..5aee971110b6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/batcher_worker_types.mli @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Request : sig + type ('a, 'b) t = + | Register : { + tr : L2_transaction.t; + apply : bool; + eager_batch : bool; + } + -> (L2_transaction.hash, error trace) t + | New_head : L2block.t -> (unit, error trace) t + | Batch : (unit, error trace) t + + type view = View : _ t -> view + + include + Worker_intf.REQUEST + with type ('a, 'request_error) t := ('a, 'request_error) t + and type view := view +end + +module Name : Worker_intf.NAME with type t = Tx_rollup.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/committer.ml b/src/proto_016_PtMumbai/lib_tx_rollup/committer.ml new file mode 100644 index 000000000000..9f338ef83780 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/committer.ml @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let commitment_of_inbox ~predecessor level (inbox : Inbox.t) = + let message_results = Inbox.proto_message_results inbox in + let messages = + List.map Tx_rollup_message_result_hash.hash_uncarbonated message_results + in + let inbox_merkle_root = Inbox.merkle_root inbox in + let predecessor = + Option.map (fun b -> b.L2block.header.commitment) predecessor + in + Tx_rollup_commitment.{level; messages; predecessor; inbox_merkle_root} + +let commit_block ~operator tx_rollup block = + let open Lwt_result_syntax in + let commit_operation = + Tx_rollup_commit {tx_rollup; commitment = block.L2block.commitment} + in + let* _hash = + Injector.add_pending_operation ~source:operator commit_operation + in + return_unit diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/committer.mli b/src/proto_016_PtMumbai/lib_tx_rollup/committer.mli new file mode 100644 index 000000000000..6149b285813c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/committer.mli @@ -0,0 +1,39 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +(** Build the commitment for an inbox. *) +val commitment_of_inbox : + predecessor:L2block.t option -> + Tx_rollup_level.t -> + Inbox.t -> + Tx_rollup_commitment.Full.t + +(** Commit a block on the L1 chain. This takes the commitment embedded in the + block an produces a commitment operation that is queued for injection in the + injector. *) +val commit_block : + operator:public_key_hash -> Tx_rollup.t -> L2block.t -> unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/context.ml b/src/proto_016_PtMumbai/lib_tx_rollup/context.ml new file mode 100644 index 000000000000..bf3f172fc419 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/context.ml @@ -0,0 +1,281 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* The L2 context for the rollup node has the form of a binary Merkle tree. We + reuse the implementation provided by [Tezos_context] as it is stable. Proofs + produced by the node will be verifiable by the protocol. *) +module Raw = Tezos_context.Context_binary +include Raw + +module Keys = struct + let l2_context = ["l2_context"] + + let tickets = ["tickets"] + + let address_indexes = ["addresses"] +end + +module Irmin_storage : + Protocol.Tx_rollup_l2_storage_sig.STORAGE + with type t = context + and type 'a m = 'a tzresult Lwt.t = struct + type t = context + + type 'a m = 'a tzresult Lwt.t + + let path k = Keys.l2_context @ [Bytes.to_string k] + + let get (ctxt : context) key : bytes option m = + let open Lwt_result_syntax in + let*! res = Raw.find ctxt (path key) in + return res + + let set ctxt key value = + let open Lwt_result_syntax in + let*! ctxt = Raw.add ctxt (path key) value in + return ctxt + + let remove ctxt key = + let open Lwt_result_syntax in + let*! ctxt = Raw.remove ctxt (path key) in + return ctxt + + module Syntax = struct + include Lwt_result_syntax + + let catch m k h = + let open Lwt_syntax in + let* res = m in + match res with + | Ok x -> k x + | Error (Environment.Ecoproto_error e :: _) -> h e + | Error err -> + (* TODO/TORU: replace error either in STORAGE or here *) + (* Should not happen *) + let* () = Debug_events.(emit should_not_happen) __LOC__ in + fail err + + let fail e = + let e = Environment.wrap_tzerror e in + Lwt.return (Error [e]) + + let list_fold_left_m = List.fold_left_es + end +end + +include Protocol.Tx_rollup_l2_context.Make (Irmin_storage) + +let context_hash_to_l2 hash = + Tezos_crypto.Context_hash.to_bytes hash + |> Protocol.Tx_rollup_l2_context_hash.of_bytes_exn + +let l2_to_context_hash hash = + Protocol.Tx_rollup_l2_context_hash.to_bytes hash + |> Tezos_crypto.Context_hash.of_bytes_exn + +let exists index hash = Raw.exists index (l2_to_context_hash hash) + +(* The context hashes are not dependant on the time, we use EPOCH (i.e. 0) to + commit (and hash). *) + +let hash ?(message = "") context = + Raw.hash ~time:Time.Protocol.epoch ~message context |> context_hash_to_l2 + +let commit ?(message = "") context = + let open Lwt_syntax in + if Raw.is_empty context then + (* We cannot commit empty contexts with Irmin 3 *) + return (hash ~message context) + else + let+ hash = Raw.commit ~time:Time.Protocol.epoch ~message context in + context_hash_to_l2 hash + +let checkout_opt index context_hash = + let open Lwt_syntax in + let+ context = Raw.checkout index (l2_to_context_hash context_hash) in + match context with + | Some context -> Some context + | None -> + let empty = Raw.empty index in + let hash_empty = hash empty in + if Protocol.Tx_rollup_l2_context_hash.(context_hash = hash_empty) then + Some empty + else None + +let checkout_exn index hash = + let open Lwt_syntax in + let+ context = checkout_opt index hash in + match context with None -> raise Not_found | Some context -> context + +let checkout index hash = + let open Lwt_syntax in + let+ context = checkout_opt index hash in + Option.to_result ~none:[Error.Tx_rollup_cannot_checkout_context hash] context + +(** {2 Prover context} *) + +exception Error of Environment.Error_monad.error + +module Prover_storage : + Protocol.Tx_rollup_l2_storage_sig.STORAGE + with type t = tree + and type 'a m = 'a Lwt.t = struct + type t = tree + + type 'a m = 'a Lwt.t + + module Syntax = struct + include Lwt.Syntax + + let return = Lwt.return + + let fail e = Lwt.fail (Error e) + + let catch (m : 'a m) k h = + Lwt.catch + (fun () -> m >>= k) + (function Error e -> h e | e -> Lwt.fail e) + + let list_fold_left_m = Lwt_list.fold_left_s + end + + let path k = [Bytes.to_string k] + + let get store key = Raw.Tree.find store (path key) + + let set store key value = Raw.Tree.add store (path key) value + + let remove store key = Raw.Tree.remove store (path key) +end + +module Prover_context = Protocol.Tx_rollup_l2_context.Make (Prover_storage) + +type 'a produce_proof_result = {tree : tree; result : 'a} + +let get_tree ctxt = + let open Lwt_result_syntax in + let*! tree_opt = Raw.find_tree ctxt Keys.l2_context in + match tree_opt with + | Some tree -> return tree + | None -> fail [Error.Tx_rollup_tree_not_found] + +let produce_proof ctxt f = + let open Lwt_result_syntax in + let index = Raw.index ctxt in + let* tree = get_tree ctxt in + let* kinded_key = + match Raw.Tree.kinded_key tree with + | Some kinded_key -> return kinded_key + | None -> fail [Error.Tx_rollup_tree_kinded_key_not_found] + in + let*! proof, result = + Raw.produce_stream_proof index kinded_key (fun tree -> + let*! res = f tree in + Lwt.return (res.tree, res)) + in + return (proof, result) + +let hash_tree = Raw.Tree.hash + +let tree_hash_of_context ctxt = + let open Lwt_result_syntax in + let+ tree = get_tree ctxt in + hash_tree tree + +let add_tree ctxt tree = + let open Lwt_syntax in + let* ctxt = Raw.add_tree ctxt Keys.l2_context tree in + (* Irmin requires that we commit the context before generating the proof. *) + let* ctxt_hash = commit ctxt in + return (ctxt, ctxt_hash) + +(** The initial context must be constructed using the internal empty tree. + This tree however, *needs* to be non-empty. Otherwise, its hash will + be inconsistent. + See {!Protocol.Tx_rollup_commitment_repr.empty_l2_context_hash} for more + context. +*) +let init_context index = + let open Prover_context.Syntax in + let ctxt = Raw.empty index in + let tree = Raw.Tree.empty ctxt in + let* tree = Prover_context.Address_index.init_counter tree in + let* tree = Prover_context.Ticket_index.init_counter tree in + let tree_hash = hash_tree tree in + assert ( + Tezos_crypto.Context_hash.( + tree_hash = Protocol.Tx_rollup_message_result_repr.empty_l2_context_hash)) ; + let* ctxt, _ = add_tree ctxt tree in + return ctxt + +(** {2 Sub-context for tickets } *) + +module Ticket_indexable = + Protocol.Indexable.Make (Protocol.Alpha_context.Ticket_hash) + +let register_ticket ctxt + (ticket_index : Protocol.Tx_rollup_l2_context_sig.ticket_index) ticket = + let index_int32 = Protocol.Indexable.to_int32 ticket_index in + let key = Keys.tickets @ [Int32.to_string index_int32] in + let value = Data_encoding.Binary.to_bytes_exn Ticket.encoding ticket in + Raw.add ctxt key value + +let get_ticket ctxt + (ticket_index : Protocol.Tx_rollup_l2_context_sig.ticket_index) = + let open Lwt_syntax in + let index_int32 = Protocol.Indexable.to_int32 ticket_index in + let key = Keys.tickets @ [Int32.to_string index_int32] in + let* value = Raw.find ctxt key in + match value with + | None -> return_none + | Some value -> + return_some (Data_encoding.Binary.of_bytes_exn Ticket.encoding value) + +(** {2 Sub-context for address indexes } *) + +let register_address ctxt + (index : Protocol.Tx_rollup_l2_context_sig.address_index) + (address : Protocol.Tx_rollup_l2_address.t) = + let index_int32 = Protocol.Indexable.to_int32 index in + let key = Keys.address_indexes @ [Int32.to_string index_int32] in + let value = + Data_encoding.Binary.to_bytes_exn + Protocol.Tx_rollup_l2_address.encoding + address + in + Raw.add ctxt key value + +let get_address ctxt (index : Protocol.Tx_rollup_l2_context_sig.address_index) = + let open Lwt_syntax in + let index_int32 = Protocol.Indexable.to_int32 index in + let key = Keys.address_indexes @ [Int32.to_string index_int32] in + let* value = Raw.find ctxt key in + match value with + | None -> return_none + | Some value -> + return_some + (Data_encoding.Binary.of_bytes_exn + Protocol.Tx_rollup_l2_address.encoding + value) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/context.mli b/src/proto_016_PtMumbai/lib_tx_rollup/context.mli new file mode 100644 index 000000000000..154f5818a386 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/context.mli @@ -0,0 +1,170 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A block-indexed (key x value) store directory. *) +type index + +(** Type of persitant context. *) +type context + +include + Protocol.Tx_rollup_l2_context_sig.CONTEXT + with type t = context + and type 'a m = 'a tzresult Lwt.t + +val index : context -> index + +(** Open or initialize a versioned store at a given path. *) +val init : + ?patch_context:(context -> context tzresult Lwt.t) -> + ?readonly:bool -> + ?indexing_strategy:[`Always | `Minimal] -> + ?index_log_size:int -> + string -> + index Lwt.t + +(** Initialize an "empty" context from an index. It is not really empty in the + sense that the underlying tree is not empty, it is then committed. *) +val init_context : index -> t Lwt.t + +(** Close the index. Does not fail when the context is already closed. *) +val close : index -> unit Lwt.t + +(** Sync the context with disk. Only useful for read-only instances. + Does not fail when the context is not in read-only mode. *) +val sync : index -> unit Lwt.t + +(** {2 Accessing and Updating Versions} *) + +(** Returns true if there is a commit with this context hash *) +val exists : index -> Protocol.Tx_rollup_l2_context_hash.t -> bool Lwt.t + +(** Checkout the context associated to a context hash. The context must have + been committed (with {!commit}). Resolves with [None] if there is no such + commit. *) +val checkout_opt : + index -> Protocol.Tx_rollup_l2_context_hash.t -> context option Lwt.t + +(** Same as {!checkout_opt} but resolves with an exception if there is no such + commit. *) +val checkout_exn : + index -> Protocol.Tx_rollup_l2_context_hash.t -> context Lwt.t + +(** Same as {!checkout_opt} but resolves with an error if there is no such + commit. *) +val checkout : + index -> Protocol.Tx_rollup_l2_context_hash.t -> context tzresult Lwt.t + +(** Hash a context. The hash can be done with an additional [message]. *) +val hash : ?message:string -> t -> Protocol.Tx_rollup_l2_context_hash.t + +(** Create a commit and return the context hash. The hash can be done with an + additional [message]. *) +val commit : + ?message:string -> context -> Protocol.Tx_rollup_l2_context_hash.t Lwt.t + +(** {2 Prover Context} *) + +(** The prover context is a subset of the context. It uses the internal + context tree to produce proofs. *) + +type tree + +module Prover_context : + Protocol.Tx_rollup_l2_context_sig.CONTEXT + with type t = tree + and type 'a m = 'a Lwt.t + +(** ['a produce_proof_result] is the result type needed for the {!produce_proof} + callback function. *) +type 'a produce_proof_result = { + tree : tree; (** the tree modified by the callback function *) + result : 'a; (** the callback result. *) +} + +(** [produce_proof ctxt f] applies [f] in the {!tree} inside [ctxt]. + + It returns a proof that is produced by applying [f], the proof is + constructed using low-levels accesses to the three, that is, it needs the + modified tree to be included in the [f]'s result to calculate the proof. + + Beside the proof production, this function can be used to perform semantical + changes in the {!Prover_context}. Thus, we give the possibility to return a + result in {!'a produce_proof_result} to observe [f]'s results. +*) +val produce_proof : + context -> + (tree -> 'a produce_proof_result Lwt.t) -> + (Protocol.Tx_rollup_l2_proof.t * 'a produce_proof_result) tzresult Lwt.t + +val hash_tree : tree -> Tezos_crypto.Context_hash.t + +(** [add_tree ctxt tree] adds [tree] in the [ctxt]. In order to perform + actions on the tree (e.g. proof production), it needs to be persistent. Thus, + the context is committed on disk after we added the tree, that is, after + every modification on the tree such as a message interpretation. + + FIXME: https://gitlab.com/tezos/tezos/-/issues/2780 + We would like to avoid the commit in this function for performance + matters. +*) +val add_tree : + context -> tree -> (context * Protocol.Tx_rollup_l2_context_hash.t) Lwt.t + +val tree_hash_of_context : context -> Tezos_crypto.Context_hash.t tzresult Lwt.t + +(** {2 Sub-context for tickets } *) + +(** Adds a new association [ticket index -> ticket] in the context. *) +val register_ticket : + context -> + Protocol.Tx_rollup_l2_context_sig.ticket_index -> + Ticket.t -> + context Lwt.t + +(** [get_ticket ctxt ticket_index] retrieves the ticket associated to + [ticket_index] in the context [ctxt]. Resolves with [None] if there is no + ticket associated to [ticket_hash]. *) +val get_ticket : + context -> + Protocol.Tx_rollup_l2_context_sig.ticket_index -> + Ticket.t option Lwt.t + +(** {2 Sub-context for address indexes } *) + +(** Adds a new association [address index -> address] in the context. *) +val register_address : + context -> + Protocol.Tx_rollup_l2_context_sig.address_index -> + Protocol.Tx_rollup_l2_address.t -> + context Lwt.t + +(** [get_address ctxt address_index] retrieves the address associated to + [address_index] in the context [ctxt]. Resolves with [None] if there is no + address associated to [address_index]. *) +val get_address : + context -> + Protocol.Tx_rollup_l2_context_sig.address_index -> + Protocol.Tx_rollup_l2_address.t option Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/daemon.ml b/src/proto_016_PtMumbai/lib_tx_rollup/daemon.ml new file mode 100644 index 000000000000..b69f364e8ff0 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/daemon.ml @@ -0,0 +1,1046 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Apply_results +open Protocol.Apply_internal_results +open Tezos_shell_services +open Protocol_client_context +open Protocol +open Alpha_context +open Error + +let parse_tx_rollup_l2_address : + Script.node -> Protocol.Tx_rollup_l2_address.Indexable.value tzresult = + let open Protocol in + let open Micheline in + function + | Bytes (loc, bytes) (* As unparsed with [Optimized]. *) -> ( + match Tx_rollup_l2_address.of_bytes_opt bytes with + | Some txa -> ok (Tx_rollup_l2_address.Indexable.value txa) + | None -> error (Error.Tx_rollup_invalid_l2_address loc)) + | String (loc, str) (* As unparsed with [Readable]. *) -> ( + match Tx_rollup_l2_address.of_b58check_opt str with + | Some txa -> ok (Tx_rollup_l2_address.Indexable.value txa) + | None -> error (Error.Tx_rollup_invalid_l2_address loc)) + | Int (loc, _) | Prim (loc, _, _, _) | Seq (loc, _) -> + error (Error.Tx_rollup_invalid_l2_address loc) + +let parse_ticketer : Script.node -> Contract.t tzresult = + let open Micheline in + function + | Bytes (_loc, bytes) (* As unparsed with [Optimized]. *) -> + Result.of_option ~error:[Wrong_deposit_parameters] + @@ Data_encoding.Binary.of_bytes_opt Contract.encoding bytes + | String (_loc, str) (* As unparsed with [Readable]. *) -> + Environment.wrap_tzresult @@ Contract.of_b58check str + | Int _ | Prim _ | Seq _ -> error Wrong_deposit_parameters + +let parse_tx_rollup_deposit_parameters : + Script.expr -> + (Contract.t + * Script.expr + * Script.expr + * Protocol.Tx_rollup_l2_qty.t + * Protocol.Script_typed_ir.tx_rollup_l2_address) + tzresult = + fun parameters -> + let open Result_syntax in + let open Micheline in + let open Protocol in + (* /!\ This pattern matching needs to remain in sync with the deposit + parameters. See the transaction to Tx_rollup case in + Protocol.Apply.Apply.apply_internal_operation_contents *) + match root parameters with + | Seq + ( _, + [ + Prim + ( _, + D_Pair, + [ + Prim + ( _, + D_Pair, + [ticketer; Prim (_, D_Pair, [contents; amount], _)], + _ ); + bls; + ], + _ ); + ty; + ] ) -> + let* destination = parse_tx_rollup_l2_address bls in + let* amount = + match amount with + | Int (_, v) + when Compare.Z.(Z.zero < v && v <= Z.of_int64 Int64.max_int) -> + ok @@ Tx_rollup_l2_qty.of_int64_exn (Z.to_int64 v) + | Int (_, invalid_amount) -> + error (Error.Tx_rollup_invalid_ticket_amount invalid_amount) + | _expr -> error Error.Tx_rollup_invalid_deposit + in + let* ticketer = parse_ticketer ticketer in + let ty = strip_locations ty in + let contents = strip_locations contents in + return (ticketer, ty, contents, amount, destination) + | _expr -> error Error.Tx_rollup_invalid_deposit + +let extract_messages_from_block block_info rollup_id = + let managed_operation = + List.nth_opt + block_info.Alpha_block_services.operations + State.rollup_operation_index + in + let add_message_ticket (msg, _size) new_ticket (messages, tickets) = + let tickets = + match new_ticket with None -> tickets | Some ticket -> ticket :: tickets + in + (msg :: messages, tickets) + in + let get_messages_of_internal_operation ~source messages_tickets + (Internal_operation_result + ( { + operation; + source = _use_the_source_of_the_external_operation; + nonce = _; + }, + result )) = + match (operation, result) with + | ( Transaction + {amount = _; parameters; destination = Tx_rollup dst; entrypoint}, + Applied + (ITransaction_result + (Transaction_to_tx_rollup_result {ticket_hash; _})) ) + when Tx_rollup.equal dst rollup_id + && Entrypoint.(entrypoint = Entrypoint.deposit) -> + (* Deposit message *) + ( Option.bind (Data_encoding.force_decode parameters) + @@ fun parameters -> + parse_tx_rollup_deposit_parameters parameters |> Result.to_option ) + |> Option.fold + ~none:messages_tickets + ~some:(fun (ticketer, ty, contents, amount, destination) -> + let deposit = + Tx_rollup_message.make_deposit + source + destination + ticket_hash + amount + in + add_message_ticket + deposit + (Some Ticket.{ticketer; ty; contents; hash = ticket_hash}) + messages_tickets) + | _ -> messages_tickets + in + let get_messages : + type kind. + source:public_key_hash -> + kind manager_operation -> + kind manager_operation_result -> + packed_internal_operation_result list -> + Tx_rollup_message.t list * Ticket.t list -> + Tx_rollup_message.t list * Ticket.t list = + fun ~source op result internal_operation_results messages_tickets -> + let acc = + match (op, result) with + | ( Tx_rollup_submit_batch {tx_rollup; content; burn_limit = _}, + Applied (Tx_rollup_submit_batch_result _) ) + when Tx_rollup.equal rollup_id tx_rollup -> + (* Batch message *) + add_message_ticket + (Tx_rollup_message.make_batch content) + None + messages_tickets + | _, _ -> messages_tickets + in + (* Add messages from internal operations *) + List.fold_left + (get_messages_of_internal_operation ~source) + acc + internal_operation_results + in + let rec get_related_messages : + type kind. + Tx_rollup_message.t list * Ticket.t list -> + kind contents_and_result_list -> + Tx_rollup_message.t list * Ticket.t list = + fun acc -> function + | Single_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _} ) -> + get_messages + ~source + operation + operation_result + internal_operation_results + acc + | Single_and_result (_, _) -> acc + | Cons_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _}, + rest ) -> + let acc = + get_messages + ~source + operation + operation_result + internal_operation_results + acc + in + get_related_messages acc rest + in + let finalize_receipt acc operation = + match Alpha_block_services.(operation.protocol_data, operation.receipt) with + | ( Operation_data {contents = operation_contents; _}, + Receipt (Operation_metadata {contents = result_contents}) ) -> ( + match kind_equal_list operation_contents result_contents with + | Some Eq -> + let operation_and_result = + pack_contents_list operation_contents result_contents + in + ok (get_related_messages acc operation_and_result) + | None -> + (* Should not happen *) + ok acc) + | _, Receipt No_operation_metadata | _, Empty | _, Too_large -> + error (Tx_rollup_no_operation_metadata operation.hash) + in + match managed_operation with + | None -> ok ([], []) + | Some managed_operations -> + let open Result_syntax in + let+ rev_messages, new_tickets = + List.fold_left_e finalize_receipt ([], []) managed_operations + in + (List.rev rev_messages, new_tickets) + +let check_inbox state tezos_block level inbox = + let open Lwt_result_syntax in + trace (Error.Tx_rollup_cannot_check_inbox level) + @@ let* proto_inbox = + Protocol.Tx_rollup_services.inbox + state.State.cctxt + (state.State.cctxt#chain, `Hash (tezos_block, 0)) + state.State.rollup_info.rollup_id + level + in + let*? protocol_inbox = + Result.of_option + ~error:[Error.Tx_rollup_no_proto_inbox (level, tezos_block)] + proto_inbox + in + let reconstructed_inbox = Inbox.to_proto inbox in + fail_unless + Tx_rollup_inbox.(reconstructed_inbox = protocol_inbox) + (Error.Tx_rollup_inbox_mismatch + {level; reconstructed_inbox; protocol_inbox}) + +let commit_block_on_l1 state block = + match state.State.signers.operator with + | None -> return_unit + | Some operator -> + Committer.commit_block ~operator state.State.rollup_info.rollup_id block + +let store_indexes ctxt contents = + let open Lwt_syntax in + let register_indexes_from_result ctxt result = + let indexes = + let open Protocol.Tx_rollup_l2_apply.Message_result in + match result with + | Deposit_result (Deposit_success indexes) -> indexes + | Batch_V1_result (Batch_result {indexes; _}) -> indexes + | _ -> assert false + in + List.fold_left_s + (fun ctxt (address, index) -> Context.register_address ctxt index address) + ctxt + indexes.address_indexes + in + + List.fold_left_s + (fun ctxt Inbox.{result; _} -> + match result with + | Interpreted (result, _) -> register_indexes_from_result ctxt result + | Discarded _ -> return ctxt) + ctxt + contents + +let process_messages_and_inboxes (state : State.t) + ~(predecessor : L2block.t option) ?predecessor_context block_info = + let open Lwt_result_syntax in + let current_hash = block_info.Alpha_block_services.hash in + let*? messages, new_tickets = + extract_messages_from_block block_info state.State.rollup_info.rollup_id + in + let*! () = Event.(emit messages_application) (List.length messages) in + let* predecessor_context = + match predecessor_context with + | Some context -> return context + | None -> ( + match predecessor with + | None -> + let*! ctxt = Context.init_context state.context_index in + return ctxt + | Some predecessor -> + Context.checkout state.context_index predecessor.header.context) + in + let parameters = + Protocol.Tx_rollup_l2_apply. + { + tx_rollup_max_withdrawals_per_batch = + state.constants.parametric.tx_rollup.max_withdrawals_per_batch; + } + in + let context = predecessor_context in + let* context, contents = + Interpreter.interpret_messages + context + parameters + ~rejection_max_proof_size: + state.constants.parametric.tx_rollup.rejection_max_proof_size + messages + in + let* context = + List.fold_left_es + (fun context ticket -> + let* ticket_index = + Context.Ticket_index.get context ticket.Ticket.hash + in + match ticket_index with + | None -> + (* Can only happen if the interpretation of the corresponding deposit + fails (with an overflow on amounts or indexes). *) + return context + | Some ticket_index -> + let*! context = + Context.register_ticket context ticket_index ticket + in + return context) + context + new_tickets + in + match contents with + | None -> + (* No inbox at this block *) + return (`Old predecessor, predecessor_context) + | Some inbox -> + let*! context = store_indexes context inbox in + let*! context_hash = Context.commit context in + let level, predecessor_hash = + match predecessor with + | None -> (Tx_rollup_level.root, None) + | Some {hash; header = {level; _}; _} -> + (Tx_rollup_level.succ level, Some hash) + in + let* () = check_inbox state current_hash level inbox in + let commitment = Committer.commitment_of_inbox ~predecessor level inbox in + let header : L2block.header = + { + level; + tezos_block = current_hash; + predecessor = predecessor_hash; + context = context_hash; + commitment = + Tx_rollup_commitment.(Compact.hash (Full.compact commitment)); + } + in + let hash = L2block.hash_header header in + let block = L2block.{hash; header; inbox; commitment} in + let*! () = State.save_block state block in + let*! () = + Event.(emit rollup_block) (header.level, hash, header.tezos_block) + in + return (`New block, context) + +let set_head state head = + let open Lwt_result_syntax in + let* _l2_reorg = State.set_head state head in + let*! new_head_batcher = Batcher.new_head head in + match new_head_batcher with + | Error [No_batcher] -> return_unit + | Ok () -> return_unit + | Error _ as res -> Lwt.return res + +let originated_in_block rollup_id block = + let check_origination_content_result : type kind. kind contents_result -> bool + = function + | Manager_operation_result + { + operation_result = + Applied (Tx_rollup_origination_result {originated_tx_rollup; _}); + _; + } -> + Tx_rollup.(originated_tx_rollup = rollup_id) + | _ -> false + in + let rec check_origination_content_result_list : + type kind. kind contents_result_list -> bool = function + | Single_result x -> check_origination_content_result x + | Cons_result (x, xs) -> + check_origination_content_result x + || check_origination_content_result_list xs + in + let manager_operations = + List.nth_opt + block.Alpha_block_services.operations + State.rollup_operation_index + in + let has_rollup_origination operation = + match operation.Alpha_block_services.receipt with + | Receipt (Operation_metadata {contents}) -> + check_origination_content_result_list contents + | Receipt No_operation_metadata | Empty | Too_large -> false + in + match manager_operations with + | None -> false + | Some ops -> List.exists has_rollup_origination ops + +let rec process_block state current_hash = + let open Lwt_result_syntax in + let rollup_id = state.State.rollup_info.rollup_id in + let*! l2_block = State.tezos_block_already_processed state current_hash in + match l2_block with + | `Known maybe_l2_block -> + (* Already processed *) + let*! () = Event.(emit block_already_processed) current_hash in + let* () = + match maybe_l2_block with + | Some l2_block -> set_head state l2_block + | None -> return_unit + in + return (maybe_l2_block, None, []) + | `Unknown -> + state.State.sync.synchronized <- false ; + let* block_info = State.fetch_tezos_block state current_hash in + let predecessor_hash = block_info.header.shell.predecessor in + let block_level = block_info.header.shell.level in + let* () = + match state.State.rollup_info.origination_level with + | Some origination_level when block_level < origination_level -> + tzfail Tx_rollup_originated_in_fork + | _ -> return_unit + in + (* Handle predecessor Tezos block first *) + let*! () = + Event.(emit processing_block_predecessor) + (predecessor_hash, Int32.pred block_level) + in + let* l2_predecessor, predecessor_context, blocks_to_commit = + if originated_in_block rollup_id block_info then + let*! () = + Event.(emit detected_origination) (rollup_id, current_hash) + in + let* () = + State.set_rollup_info state rollup_id ~origination_level:block_level + in + return (None, None, []) + else process_block state predecessor_hash + in + let*! () = + Event.(emit processing_block) (current_hash, predecessor_hash) + in + let* l2_block, context = + process_messages_and_inboxes + state + ~predecessor:l2_predecessor + ?predecessor_context + block_info + in + let blocks_to_commit = + match l2_block with + | `Old _ -> blocks_to_commit + | `New l2_block -> l2_block :: blocks_to_commit + in + let*! () = + let maybe_l2_block_hash = + match l2_block with + | `Old None -> None + | `Old (Some l2_block) | `New l2_block -> Some l2_block.hash + in + State.save_tezos_block_info + state + current_hash + maybe_l2_block_hash + ~level:block_info.header.shell.level + ~predecessor:block_info.header.shell.predecessor + in + let* l2_block = + match l2_block with + | `Old None -> return_none + | `Old (Some l2_block) | `New l2_block -> + let* () = set_head state l2_block in + return_some l2_block + in + State.notify_processed_tezos_level state block_info.header.shell.level ; + let*! () = + Event.(emit tezos_block_processed) (current_hash, block_level) + in + return (l2_block, Some context, blocks_to_commit) + +let batch () = if Batcher.active () then Batcher.batch () else return_unit + +let notify_head state head reorg = + let open Lwt_result_syntax in + let* head = State.fetch_tezos_block state head in + let*! () = Injector.new_tezos_head head reorg in + return_unit + +let queue_gc_operations state = + let open Lwt_result_syntax in + let tx_rollup = state.State.rollup_info.rollup_id in + let queue_finalize_commitment state = + match state.State.signers.finalize_commitment with + | None -> return_unit + | Some source -> + let* _hash = + Injector.add_pending_operation + ~source + (Tx_rollup_finalize_commitment {tx_rollup}) + in + return_unit + in + let queue_remove_commitment state = + match state.State.signers.remove_commitment with + | None -> return_unit + | Some source -> + let* _hash = + Injector.add_pending_operation + ~source + (Tx_rollup_remove_commitment {tx_rollup}) + in + return_unit + in + let* () = queue_finalize_commitment state in + queue_remove_commitment state + +let dispatch_withdrawals_on_l1 state level = + let open Lwt_result_syntax in + match state.State.signers.dispatch_withdrawals with + | None -> return_unit + | Some source -> ( + let*! block = State.get_level_l2_block state level in + match block with + | None -> return_unit + | Some block -> Dispatcher.dispatch_withdrawals ~source state block) + +let reject_bad_commitment state commitment = + let open Lwt_result_syntax in + match state.State.signers.rejection with + | None -> return_unit + | Some source -> Accuser.reject_bad_commitment ~source state commitment + +let fail_when_slashed (type kind) state l1_operation + (result : kind manager_operation_result) = + let open Lwt_result_syntax in + let open Apply_results in + match state.State.signers.operator with + | None -> return_unit + | Some operator -> ( + (* This function handles external operations only. Internal operations have + to be handled in [handle] in [handle_l1_operation] below. *) + match result with + | Applied result -> + let balance_updates = + match result with + | Tx_rollup_commit_result {balance_updates; _} + | Tx_rollup_rejection_result {balance_updates; _} -> + (* These are the only two operations which can slash a bond. *) + balance_updates + | _ -> [] + in + let frozen_debit, punish = + List.fold_left + (fun (frozen_debit, punish) -> function + | Receipt.(Tx_rollup_rejection_punishments, Credited _, _) -> + (* Someone was punished *) + (frozen_debit, true) + | Frozen_bonds (committer, _), Debited _, _ + when Contract.(committer = Implicit operator) -> + (* Our frozen bonds are gone *) + (true, punish) + | _ -> (frozen_debit, punish)) + (false, false) + balance_updates + in + fail_when + (frozen_debit && punish) + (Error.Tx_rollup_deposit_slashed l1_operation) + | _ -> return_unit) + +let process_op (type kind) (state : State.t) l1_block l1_operation ~source:_ + (op : kind manager_operation) (result : kind manager_operation_result) + (acc : 'acc) : 'acc tzresult Lwt.t = + let open Lwt_result_syntax in + let is_my_rollup tx_rollup = + Tx_rollup.equal state.rollup_info.rollup_id tx_rollup + in + let* () = fail_when_slashed state l1_operation result in + (* This function handles external operations only. Internal operations have + to be handled in [handle] in [handle_l1_operation] below. *) + match (op, result) with + | ( Tx_rollup_commit {commitment; tx_rollup}, + Applied (Tx_rollup_commit_result _) ) + when is_my_rollup tx_rollup -> + let commitment_hash = + Tx_rollup_commitment.(Compact.hash (Full.compact commitment)) + in + let*! () = + State.set_commitment_included + state + commitment_hash + l1_block + l1_operation + in + let* () = reject_bad_commitment state commitment in + return acc + | ( Tx_rollup_finalize_commitment {tx_rollup}, + Applied (Tx_rollup_finalize_commitment_result {level; _}) ) + when is_my_rollup tx_rollup -> + let* () = dispatch_withdrawals_on_l1 state level in + State.set_finalized_level state level + | _, _ -> return acc + +let rollback_op (type kind) (state : State.t) _l1_block _l1_operation ~source:_ + (op : kind manager_operation) (result : kind manager_operation_result) + (acc : 'acc) : 'acc tzresult Lwt.t = + let open Lwt_result_syntax in + let is_my_rollup tx_rollup = + Tx_rollup.equal state.rollup_info.rollup_id tx_rollup + in + (* This function handles external operations only. Internal operations have + to be handled in [handle] in [handle_l1_operation] below. *) + match (op, result) with + | ( Tx_rollup_commit {commitment; tx_rollup}, + Applied (Tx_rollup_commit_result _) ) + when is_my_rollup tx_rollup -> + let commitment_hash = + Tx_rollup_commitment.(Compact.hash (Full.compact commitment)) + in + let*! () = State.unset_commitment_included state commitment_hash in + return acc + | ( Tx_rollup_finalize_commitment {tx_rollup}, + Applied (Tx_rollup_finalize_commitment_result {level; _}) ) + when is_my_rollup tx_rollup -> ( + match Tx_rollup_level.pred level with + | None -> + let*! () = State.delete_finalized_level state in + return_unit + | Some level -> State.set_finalized_level state level) + | _, _ -> return acc + +let handle_l1_operation direction (block : Alpha_block_services.block_info) + state acc (operation : Alpha_block_services.operation) = + let open Lwt_result_syntax in + let handle_op = + match direction with `Rollback -> rollback_op | `Process -> process_op + in + let handle : + type kind. + source:public_key_hash -> + kind manager_operation -> + kind manager_operation_result -> + packed_internal_operation_result list -> + 'acc -> + 'acc tzresult Lwt.t = + fun ~source op result _internal_operation_results acc -> + handle_op state ~source block.hash operation.hash op result acc + (* There are no messages to handle for internal operations for now. *) + in + let rec handle_list : + type kind. 'acc -> kind contents_and_result_list -> 'acc tzresult Lwt.t = + fun acc -> function + | Single_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _} ) -> + handle ~source operation operation_result internal_operation_results acc + | Single_and_result (_, _) -> return acc + | Cons_and_result + ( Manager_operation {operation; source; _}, + Manager_operation_result + {operation_result; internal_operation_results; _}, + rest ) -> + let* acc = + handle + ~source + operation + operation_result + internal_operation_results + acc + in + handle_list acc rest + in + match (operation.protocol_data, operation.receipt) with + | _, Receipt No_operation_metadata | _, Empty | _, Too_large -> + fail [Tx_rollup_no_operation_metadata operation.hash] + | ( Operation_data {contents = operation_contents; _}, + Receipt (Operation_metadata {contents = result_contents}) ) -> ( + match kind_equal_list operation_contents result_contents with + | None -> + let*! () = Debug_events.(emit should_not_happen) __LOC__ in + return acc + | Some Eq -> + let operation_and_result = + pack_contents_list operation_contents result_contents + in + handle_list acc operation_and_result) + +let handle_l1_block direction state acc block = + List.fold_left_es + (List.fold_left_es (handle_l1_operation direction block state)) + acc + block.Alpha_block_services.operations + +let handle_l1_reorg state acc reorg = + let open Lwt_result_syntax in + let* acc = + List.fold_left_es + (handle_l1_block `Rollback state) + acc + (List.rev reorg.Injector_common.old_chain) + in + let* acc = + List.fold_left_es + (handle_l1_block `Process state) + acc + reorg.Injector_common.new_chain + in + return acc + +let notify_synchronized state = + let old_value = state.State.sync.synchronized in + state.State.sync.synchronized <- true ; + if old_value = false then + Lwt_condition.broadcast state.State.sync.on_synchronized () + +let process_head ?(notify_sync = true) state + (current_hash, (current_header : Tezos_base.Block_header.t option)) = + let open Lwt_result_syntax in + (if notify_sync then + match current_header with + | None -> () + | Some current_header -> + State.set_known_tezos_level state current_header.shell.level) ; + let*! () = Event.(emit new_block) current_hash in + let* _, _, blocks_to_commit = process_block state current_hash in + let* l1_reorg = State.set_tezos_head state current_hash in + if notify_sync then notify_synchronized state ; + let* () = handle_l1_reorg state () l1_reorg in + let* () = List.iter_es (commit_block_on_l1 state) blocks_to_commit in + let* () = batch () in + let* () = queue_gc_operations state in + let* () = notify_head state current_hash l1_reorg in + let*! () = + match current_header with + | None -> Lwt.return_unit + | Some header -> Injector.inject ~header () + in + return_unit + +let look_for_origination_block state block_list = + let open Lwt_result_syntax in + let rollup_id = state.State.rollup_info.rollup_id in + state.State.sync.synchronized <- false ; + let rec loop = function + | [] -> return_none + | block_hash :: rest as block_list -> + let* block = State.fetch_tezos_block state block_hash in + let*! () = + Event.(emit look_for_origination) + (block.hash, block.header.shell.level) + in + if originated_in_block rollup_id block then return_some block_list + else ( + State.notify_processed_tezos_level state block.header.shell.level ; + loop rest) + in + loop block_list + +let catch_up_on_commitments state = + let open Lwt_result_syntax in + let*! () = Event.(emit catch_up_commitments) () in + let* proto_rollup_state = + Protocol.Tx_rollup_services.state + state.State.cctxt + (state.State.cctxt#chain, `Head 0) + state.State.rollup_info.rollup_id + and* tezos_head = + Shell_services.Blocks.Header.shell_header + state.State.cctxt + ~chain:state.State.cctxt#chain + ~block:(`Head 0) + () + in + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2957 + We have to serialize the state to access the required information *) + let proto_rollup_state = + let open Data_encoding.Binary in + to_bytes_exn Tx_rollup_state.encoding proto_rollup_state + |> of_bytes_exn Tx_rollup_state_repr.encoding + in + let next_commitment_level = + match + Tx_rollup_state_repr.next_commitment_level + proto_rollup_state + (* Next commitment will be included in next block *) + Raw_level_repr.(succ @@ of_int32_exn tezos_head.level) + with + | Ok l -> Some l + | Error _ -> + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2957 + We assume the error is Tx_rollup_errors.No_uncommitted_inbox as we + cannot match on it. *) + None + in + match next_commitment_level with + | None -> return_unit + | Some next_commitment_level -> + let rec missing_commitments to_commit block = + let open Lwt_syntax in + match block with + | None -> return to_commit + | Some ({L2block.header = {level; _}; _} as block) -> + if + Tx_rollup_level.to_int32 level + < Tx_rollup_level_repr.to_int32 next_commitment_level + then + (* We have iterated over all missing commitments *) + return to_commit + else + let*! predecessor = + Option.filter_map_s + (State.get_block state) + block.header.predecessor + in + missing_commitments (block :: to_commit) predecessor + in + let head = State.get_head state in + let*! to_commit = missing_commitments [] head in + List.iter_es (commit_block_on_l1 state) to_commit + +let catch_up_on_blocks (state : State.t) origination_level = + let open Lwt_result_syntax in + let* head = Alpha_block_services.Header.shell_header state.cctxt () in + let* last_tezos_block = State.get_tezos_head state in + let first_handle_level = + match last_tezos_block with + | Some b -> Some (Int32.succ b.header.shell.level) + | None -> origination_level + in + match first_handle_level with + | None -> return_unit + | Some first_handle_level -> + let missing_levels = + Int32.to_int head.level - Int32.to_int first_handle_level + 1 + in + let*! () = Event.(emit missing_blocks) missing_levels in + if missing_levels <= 0 then return_unit + else + let* missing_blocks = + Chain_services.Blocks.list state.cctxt ~length:missing_levels () + in + let missing_blocks = + match missing_blocks with + | missing_blocks :: _ -> List.rev missing_blocks + | [] -> [] + in + State.set_known_tezos_level state head.level ; + let* missing_blocks = + match State.get_head state with + | Some _ -> return missing_blocks + | None -> ( + (* No L2 blocks processed yet, look for origination first *) + let* missing_blocks = + look_for_origination_block state missing_blocks + in + match missing_blocks with + | None -> tzfail Tx_rollup_originated_in_fork + | Some missing_blocks -> return missing_blocks) + in + let+ () = + List.iter_es + (fun block -> + let*! res = process_head ~notify_sync:false state (block, None) in + match res with + | Error (Tx_rollup_originated_in_fork :: _) -> return_unit + | _ -> Lwt.return res) + missing_blocks + in + notify_synchronized state + +let catch_up state = + let open Lwt_result_syntax in + let* () = catch_up_on_commitments state in + catch_up_on_blocks state state.State.rollup_info.origination_level +(* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2958 + We may also need to catch up on finalization/removal of commitments here. *) + +let check_operator_deposit state config = + let open Lwt_result_syntax in + match state.State.signers.operator with + | None -> + (* No operator for this node, no commitments will be made. *) + return_unit + | Some operator -> + let* has_deposit = + Plugin.RPC.Tx_rollup.has_bond + state.State.cctxt + (state.State.cctxt#chain, `Head 0) + state.State.rollup_info.rollup_id + operator + in + if has_deposit then + (* The operator already has a deposit for this rollup, no other check + necessary. *) + return_unit + else + (* Operator never made a deposit for this rollup, ensure they are ready to + make one. *) + fail_unless + config.Node_config.allow_deposit + Error.Tx_rollup_deposit_not_allowed + +let main_exit_callback state rpc_server _exit_status = + let open Lwt_syntax in + let* () = state.State.cctxt#message "Stopping RPC server ..." in + let* () = RPC_server.shutdown rpc_server in + let* () = state.State.cctxt#message "Stopping injector ..." in + let* () = Injector.shutdown () in + let* () = state.State.cctxt#message "Stopping batcher ..." in + let* () = Batcher.shutdown () in + let* () = state.State.cctxt#message "Closing stores ..." in + let* () = Stores.close state.State.stores in + let* () = state.State.cctxt#message "Closing context ..." in + let* () = Context.close state.State.context_index in + let* () = state.State.cctxt#message "Shutting down" in + return_unit + +let rec connect ~delay cctxt = + let open Lwt_syntax in + let* res = Monitor_services.heads cctxt cctxt#chain in + match res with + | Ok (stream, stopper) -> return_ok (stream, stopper) + | Error _ -> + let* () = Event.(emit cannot_connect) delay in + let* () = Lwt_unix.sleep delay in + connect ~delay cctxt + +let is_connection_error trace = + List.exists + (function + | RPC_client_errors.(Request_failed {error = Connection_failed _; _}) -> + true + | _ -> false) + trace + +(* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/1845 + Clean exit *) +let run configuration cctxt = + let open Lwt_result_syntax in + let*! () = Event.(emit starting_node) () in + let {Node_config.signers; reconnection_delay; rollup_id; batch_burn_limit; _} + = + configuration + in + let* state = State.init cctxt configuration in + let* () = check_operator_deposit state configuration in + let* () = + Injector.init + state.cctxt + ~data_dir:configuration.data_dir + state + ~signers: + (List.filter_map + (function + | None, _, _ -> None + | Some x, strategy, tags -> Some (x, strategy, tags)) + [ + (signers.operator, `Each_block, [Injector.Commitment]); + (* Batches of L2 operations are submitted with a delay after each + block, to allow for more operations to arrive and be included in + the following block. *) + (signers.submit_batch, `Delay_block 0.5, [Submit_batch]); + (signers.finalize_commitment, `Each_block, [Finalize_commitment]); + (signers.remove_commitment, `Each_block, [Remove_commitment]); + (signers.rejection, `Each_block, [Rejection]); + (signers.dispatch_withdrawals, `Each_block, [Dispatch_withdrawals]); + ]) + in + let* () = + Option.iter_es + (fun signer -> + Batcher.init + ~rollup:rollup_id + ~signer + ~batch_burn_limit + state.State.context_index + state.State.constants) + signers.submit_batch + in + let* rpc_server = RPC.start_server configuration state in + let _ = + (* Register cleaner callback *) + Lwt_exit.register_clean_up_callback + ~loc:__LOC__ + (main_exit_callback state rpc_server) + in + let*! () = Event.(emit node_is_ready) () in + let* () = catch_up state in + let rec loop () = + let* () = + Lwt.catch + (fun () -> + let* block_stream, interupt = + connect ~delay:reconnection_delay cctxt + in + let*! () = + Lwt_stream.iter_s + (fun (head, header) -> + let*! r = process_head state (head, Some header) in + match r with + | Ok _ -> Lwt.return () + | Error trace when is_connection_error trace -> + Format.eprintf + "@[<v 2>Connection error:@ %a@]@." + pp_print_trace + trace ; + interupt () ; + Lwt.return () + | Error e -> + Format.eprintf "%a@.Exiting.@." pp_print_trace e ; + Lwt_exit.exit_and_raise 1) + block_stream + in + let*! () = Event.(emit connection_lost) () in + loop ()) + fail_with_exn + in + Lwt_utils.never_ending () + in + loop () diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/daemon.mli b/src/proto_016_PtMumbai/lib_tx_rollup/daemon.mli new file mode 100644 index 000000000000..14fc7f0afb3c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/daemon.mli @@ -0,0 +1,41 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Deamon provides the [run] function that tracks the head of Tezos nodes to compute + the state of a rollup asynchronously. *) + +(** [run daemon ~data_dir cctxt] starts the main daemon loop. The goal of + this loop is to track the head of the Tezos node behind [cctxt], in order to + keep the [daemon] state up-to-date with what happens on layer 1. + + If the connection with layer 1 is lost, the function will regularly try + to reconnect to it. The initial delay between two attempts can be specified + using the [reconnection_delay] field in the configuration file. + + When the daemon needs to send Tezos operations, it does so by assuming the + identity in the state. *) +val run : Node_config.t -> Protocol_client_context.full -> unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/debug_events.ml b/src/proto_016_PtMumbai/lib_tx_rollup/debug_events.ml new file mode 100644 index 000000000000..766bfa9dfbb7 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/debug_events.ml @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Internal_event.Simple + +let section = ["tx_rollup_node"] + +let should_not_happen = + declare_1 + ~section + ~name:"tx_rollup_node_should_not_happen" + ~msg:"This should not happen at {loc}" + ~level:Warning + ("loc", Data_encoding.string) + ~pp1:Format.pp_print_string diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.ml b/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.ml new file mode 100644 index 000000000000..dd86da2586bf --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.ml @@ -0,0 +1,119 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +let withdawals_reveals_of_message_result ctxt msg = + let open Lwt_result_syntax in + let withdrawals = + match msg.Inbox.result with + | Inbox.Discarded _ -> [] + | Interpreted (_result, withdrawals) -> withdrawals + in + List.map_es + (fun Tx_rollup_withdraw.{claimer; ticket_hash; amount} -> + let* ticket_index = Context.Ticket_index.get ctxt ticket_hash in + let*? ticket_index = + Result.of_option + ~error: + [ + Error.Tx_rollup_unknown_ticket + Protocol.( + Indexable.forget + @@ Protocol.Tx_rollup_l2_context_sig.Ticket_indexable.value + ticket_hash); + ] + ticket_index + in + let*! ticket = Context.get_ticket ctxt ticket_index in + let*? Ticket.{ticketer; contents; ty; hash = _} = + Result.of_option + ~error: + [ + Error.Tx_rollup_unknown_ticket + (Protocol.Indexable.forget ticket_index); + ] + ticket + in + return + Tx_rollup_reveal. + { + contents = Script.lazy_expr contents; + ty = Script.lazy_expr ty; + ticketer; + amount; + claimer; + }) + withdrawals + +let dispatch_operations_of_block (state : State.t) (block : L2block.t) = + let open Lwt_result_syntax in + let level = block.header.level in + let* ctxt = Context.checkout state.context_index block.header.context in + let tx_rollup = state.rollup_info.rollup_id in + let commitment = block.commitment in + let+ rev_ops, _ = + List.fold_left_es + (fun (acc, message_index) msg -> + let context_hash = msg.Inbox.l2_context_hash.tree_hash in + let* tickets_info = withdawals_reveals_of_message_result ctxt msg in + let+ acc = + match tickets_info with + | [] -> + (* No withdrawals for this message *) + return acc + | _ -> + let*? message_result_path = + let open Tx_rollup_commitment.Merkle in + let tree = List.fold_left snoc nil commitment.messages in + Environment.wrap_tzresult @@ compute_path tree message_index + in + return + (Tx_rollup_dispatch_tickets + { + tx_rollup; + level; + context_hash; + message_index; + message_result_path; + tickets_info; + } + :: acc) + in + (acc, message_index + 1)) + ([], 0) + block.inbox + in + List.rev rev_ops + +let dispatch_withdrawals ~source state block = + let open Lwt_result_syntax in + let* operations = dispatch_operations_of_block state block in + List.iter_es + (fun op -> + let* _hash = Injector.add_pending_operation ~source op in + return_unit) + operations diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.mli b/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.mli new file mode 100644 index 000000000000..e143b73b8ceb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/dispatcher.mli @@ -0,0 +1,32 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Produce dispatch of withdrawals operations and sends them to the + injector. *) +val dispatch_withdrawals : + source:Tezos_crypto.Signature.Public_key_hash.t -> + State.t -> + L2block.t -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/dune b/src/proto_016_PtMumbai/lib_tx_rollup/dune new file mode 100644 index 000000000000..a922e7feda9e --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/dune @@ -0,0 +1,51 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_tx_rollup_alpha) + (public_name tezos-tx-rollup-alpha) + (instrumentation (backend bisect_ppx)) + (libraries + index + tezos-base + tezos-crypto + tezos-protocol-alpha + tezos-client-alpha + tezos-client-commands + tezos-context.encoding + tezos-baking-alpha-commands + tezos-stdlib-unix + tezos-rpc + tezos-rpc-http + tezos-rpc-http-client-unix + tezos-rpc-http-server + tezos-micheline + tezos-client-base + tezos-client-base-unix + tezos-shell + tezos-store + tezos-workers + tezos-protocol-plugin-alpha + tezos-injector-alpha) + (inline_tests (flags -verbose) (modes native)) + (preprocess (pps ppx_expect)) + (library_flags (:standard -linkall)) + (flags + (:standard) + -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals + -open Tezos_base + -open Tezos_protocol_alpha + -open Tezos_client_alpha + -open Tezos_client_commands + -open Tezos_baking_alpha_commands + -open Tezos_stdlib_unix + -open Tezos_rpc_http + -open Tezos_rpc_http_client_unix + -open Tezos_rpc_http_server + -open Tezos_micheline + -open Tezos_client_base + -open Tezos_client_base_unix + -open Tezos_workers + -open Tezos_protocol_plugin_alpha + -open Tezos_injector_alpha)) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/error.ml b/src/proto_016_PtMumbai/lib_tx_rollup/error.ml new file mode 100644 index 000000000000..5e95ec3c32f2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/error.ml @@ -0,0 +1,565 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Tx_rollup_internal of string + +let () = + register_error_kind + ~id:"tx_rollup.node.internal" + ~title:"Internal error in rollup node" + ~description:"Internal error encountered" + ~pp:(fun ppf loc -> + Format.fprintf ppf "Internal error in rollup node at %s" loc) + `Permanent + Data_encoding.(obj1 (req "loc" string)) + (function Tx_rollup_internal loc -> Some loc | _ -> None) + (fun loc -> Tx_rollup_internal loc) + +type error += + | Tx_rollup_not_originated_in_the_given_block of + Protocol.Alpha_context.Tx_rollup.t + +let () = + register_error_kind + ~id:"tx_rollup.node.not_originated_in_the_given_block" + ~title:"transaction rollup not originated within the given block." + ~description: + "The transaction rollup was not originated inside the given block." + ~pp:(fun ppf rollup_id -> + Format.fprintf + ppf + "The transaction rollup %a was not originated inside the given block." + Protocol.Alpha_context.Tx_rollup.pp + rollup_id) + `Permanent + Data_encoding.( + obj1 (req "rollup_id" Protocol.Alpha_context.Tx_rollup.encoding)) + (function + | Tx_rollup_not_originated_in_the_given_block rollup_id -> Some rollup_id + | _ -> None) + (fun rollup_id -> Tx_rollup_not_originated_in_the_given_block rollup_id) + +type error += Tx_rollup_originated_in_fork + +let () = + register_error_kind + ~id:"tx_rollup.node.originated_in_fork" + ~title:"transaction rollup was originated in another branch" + ~description:"The transaction rollup was originated in another branch." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The transaction rollup was originated in another branch.") + `Permanent + Data_encoding.(unit) + (function Tx_rollup_originated_in_fork -> Some () | _ -> None) + (fun () -> Tx_rollup_originated_in_fork) + +type error += Tx_rollup_configuration_file_does_not_exists of string + +let () = + register_error_kind + ~id:"tx_rollup.node.configuration_file_does_not_exits" + ~title:"Unable to find configuration file" + ~description:"The configuration file does not seem to exist" + ~pp:(fun ppf filepath -> + Format.fprintf ppf "The configuration file '%s' does not exist." filepath) + `Permanent + Data_encoding.(obj1 (req "filepath" string)) + (function + | Tx_rollup_configuration_file_does_not_exists path -> Some path + | _ -> None) + (fun path -> Tx_rollup_configuration_file_does_not_exists path) + +type error += Tx_rollup_configuration_file_already_exists of string + +let () = + register_error_kind + ~id:"tx_rollup.node.configuration_file_already_exits" + ~title:"Unable to overwrite configuration file" + ~description:"A configuration file already exists" + ~pp:(fun ppf filepath -> + Format.fprintf + ppf + "The configuration file '%s' already exists. Use --force to overwrite." + filepath) + `Permanent + Data_encoding.(obj1 (req "filepath" string)) + (function + | Tx_rollup_configuration_file_already_exists path -> Some path + | _ -> None) + (fun path -> Tx_rollup_configuration_file_already_exists path) + +type error += Tx_rollup_unable_to_write_configuration_file of string + +let () = + register_error_kind + ~id:"tx_rollup.node.unable_to_write_configuration_file" + ~title:"Unable to write configuration file" + ~description:"Unable to write configuration file" + ~pp:(fun ppf file -> + Format.fprintf ppf "Unable to write the configuration file %s" file) + `Permanent + Data_encoding.(obj1 (req "file" string)) + (function + | Tx_rollup_unable_to_write_configuration_file path -> Some path + | _ -> None) + (fun path -> Tx_rollup_unable_to_write_configuration_file path) + +type error += Tx_rollup_invalid_l2_address of Micheline.canonical_location + +let () = + register_error_kind + ~id:"tx_rollup.node.invalid_l2_address" + ~title:"Invalid transaction rollup L2 address" + ~description:"Not a valid transaction rollup L2 address" + ~pp:(fun ppf loc -> + Format.fprintf ppf "Not a valid transaction rollup l2 address at %d" loc) + `Permanent + Data_encoding.(obj1 (req "loc" int31)) + (function Tx_rollup_invalid_l2_address loc -> Some loc | _ -> None) + (fun loc -> Tx_rollup_invalid_l2_address loc) + +type error += Tx_rollup_invalid_ticket_amount of Z.t + +let () = + register_error_kind + ~id:"tx_rollup.node.invalid_ticket_amount" + ~title:"Invalid transaction rollup ticket amount" + ~description:"Not a valid transaction rollup ticket amount" + ~pp:(fun ppf amount -> + Format.fprintf + ppf + "Not a valid transaction rollup ticket amount: %a" + Z.pp_print + amount) + `Permanent + Data_encoding.(obj1 (req "amount" z)) + (function + | Tx_rollup_invalid_ticket_amount amount -> Some amount | _ -> None) + (fun amount -> Tx_rollup_invalid_ticket_amount amount) + +type error += Tx_rollup_invalid_deposit + +let () = + let description = "Not a valid transaction rollup deposit" in + register_error_kind + ~id:"tx_rollup.node.invalid_deposit" + ~title:"Invalid transaction rollup Deposit" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + `Permanent + Data_encoding.empty + (function Tx_rollup_invalid_deposit -> Some () | _ -> None) + (fun () -> Tx_rollup_invalid_deposit) + +type error += + | Tx_rollup_cannot_checkout_context of Protocol.Tx_rollup_l2_context_hash.t + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_checkout_context" + ~title:"Cannot checkout the L2 context" + ~description:"The rollup node cannot checkout the L2 context." + ~pp:(fun ppf ctxt -> + Format.fprintf + ppf + "Cannot checkout L2 context %a" + Protocol.Tx_rollup_l2_context_hash.pp + ctxt) + `Permanent + Data_encoding.( + obj1 (req "context" Protocol.Tx_rollup_l2_context_hash.encoding)) + (function Tx_rollup_cannot_checkout_context c -> Some c | _ -> None) + (fun c -> Tx_rollup_cannot_checkout_context c) + +type error += Tx_rollup_no_rollup_info_on_disk_and_no_rollup_genesis_given + +let () = + let description = + "No rollup information on disk and no rollup genesis provided" + in + register_error_kind + ~id:"tx_rollup.node.no_rollup_info_and_no_rollup_genesis_given" + ~title:"No rollup information on disk and none provided" + ~description + ~pp:(fun ppf () -> Format.fprintf ppf "%s" description) + `Permanent + Data_encoding.empty + (function + | Tx_rollup_no_rollup_info_on_disk_and_no_rollup_genesis_given -> Some () + | _ -> None) + (fun () -> Tx_rollup_no_rollup_info_on_disk_and_no_rollup_genesis_given) + +type error += + | Tx_rollup_different_disk_stored_origination_rollup_and_given_rollup_genesis of { + disk_rollup_origination : Tezos_crypto.Block_hash.t; + given_rollup_genesis : Tezos_crypto.Block_hash.t; + } + +let () = + register_error_kind + ~id: + "tx_rollup.node.different_disk_stored_origination_rollup_and_given_rollup_genesis" + ~title:"Rollup origination on disk is different from the one provided" + ~description: + "Rollup origination on disk is different from the provided rollup genesis" + ~pp:(fun ppf (disk_rollup, given_rollup) -> + Format.fprintf + ppf + "Rollup origination on disk (%a) is different from the provided rollup \ + genesis (%a)" + Tezos_crypto.Block_hash.pp + disk_rollup + Tezos_crypto.Block_hash.pp + given_rollup) + `Permanent + Data_encoding.( + obj2 + (req "disk_rollup" Tezos_crypto.Block_hash.encoding) + (req "given_rollup" Tezos_crypto.Block_hash.encoding)) + (function + | Tx_rollup_different_disk_stored_origination_rollup_and_given_rollup_genesis + {disk_rollup_origination; given_rollup_genesis} -> + Some (disk_rollup_origination, given_rollup_genesis) + | _ -> None) + (fun (disk_rollup_origination, given_rollup_genesis) -> + Tx_rollup_different_disk_stored_origination_rollup_and_given_rollup_genesis + {disk_rollup_origination; given_rollup_genesis}) + +type error += Tx_rollup_no_operation_metadata of Tezos_crypto.Operation_hash.t + +let () = + register_error_kind + ~id:"tx_rollup.node.no_operation_metadata" + ~title:"Operation receipt unavailable" + ~description:"The operation receipt is unavailable." + ~pp:(fun ppf op -> + Format.fprintf + ppf + "The operation receipt of %a is unavailable. Please make sure that the \ + history mode of the Tezos node you are connecting to matches the \ + requirements." + Tezos_crypto.Operation_hash.pp + op) + `Permanent + Data_encoding.(obj1 (req "context" Tezos_crypto.Operation_hash.encoding)) + (function Tx_rollup_no_operation_metadata o -> Some o | _ -> None) + (fun o -> Tx_rollup_no_operation_metadata o) + +type error += Tx_rollup_mismatch + +let () = + register_error_kind + ~id:"tx_rollup.node.different_disk_stored_rollup" + ~title:"Rollup on disk is different from the one provided" + ~description:"Rollup on disk is different from the provided rollup" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "Rollup origination on disk is different from the provided rollup") + `Permanent + Data_encoding.unit + (function Tx_rollup_mismatch -> Some () | _ -> None) + (fun () -> Tx_rollup_mismatch) + +type error += Tx_rollup_cannot_fetch_tezos_block of Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_fetch_tezos_block" + ~title:"A Tezos block cannot be fetched" + ~description:"A Tezos block cannot be fetched." + ~pp:(fun ppf b -> + Format.fprintf + ppf + "The Tezos block %a cannot be fetched from the node." + Tezos_crypto.Block_hash.pp + b) + `Permanent + Data_encoding.(obj1 (req "block" Tezos_crypto.Block_hash.encoding)) + (function Tx_rollup_cannot_fetch_tezos_block b -> Some b | _ -> None) + (fun b -> Tx_rollup_cannot_fetch_tezos_block b) + +type error += Tx_rollup_tree_not_found + +let () = + register_error_kind + ~id:"tx_rollup.node.tree_not_found" + ~title:"Tree not found in context" + ~description:"The tree is not found in the context." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The tree was not found in the context. The merkle proof associated to \ + a message can not be produced, the rollup can not interpret the \ + message.") + `Permanent + Data_encoding.empty + (function Tx_rollup_tree_not_found -> Some () | _ -> None) + (fun () -> Tx_rollup_tree_not_found) + +type error += Tx_rollup_tree_kinded_key_not_found + +let () = + register_error_kind + ~id:"tx_rollup.node.tree_kinded_key_not_found" + ~title:"Kinded key not found in tree" + ~description:"The kinded key is not found in the tree." + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The kinded key was not found in the tree. The merkle proof associated \ + to a message can not be produced, the rollup can not interpret the \ + message.") + `Permanent + Data_encoding.empty + (function Tx_rollup_tree_kinded_key_not_found -> Some () | _ -> None) + (fun () -> Tx_rollup_tree_kinded_key_not_found) + +type error += Tx_rollup_invalid_message_position_in_inbox of int + +let () = + register_error_kind + ~id:"tx_rollup.node.invalid_message_position" + ~title:"Message position invalid in the inbox" + ~description:"The message position is invalid the inbox." + ~pp:(fun ppf i -> + Format.fprintf ppf "The message position %d is invalid in the inbox" i) + `Permanent + Data_encoding.(obj1 (req "message_position" int31)) + (function + | Tx_rollup_invalid_message_position_in_inbox i -> Some i | _ -> None) + (fun i -> Tx_rollup_invalid_message_position_in_inbox i) + +type error += No_batcher + +let () = + register_error_kind + ~id:"tx_rollup.node.no_batcher" + ~title:"No batcher for this node" + ~description:"This node does not have a batcher" + ~pp:(fun ppf () -> + Format.fprintf ppf "This rollup node does not have batcher.") + `Permanent + Data_encoding.unit + (function No_batcher -> Some () | _ -> None) + (fun () -> No_batcher) + +type error += + | Tx_rollup_unknown_ticket of + Protocol.Tx_rollup_l2_context_sig.Ticket_indexable.either + +let () = + register_error_kind + ~id:"tx_rollup.node.unknown_ticket" + ~title:"No ticket registered for indexable ticket hash" + ~description:"A ticket indexable has not ticket associated in the context." + ~pp:(fun ppf s -> + Format.fprintf + ppf + "Unknown ticket for ticket indexable %a" + Protocol.Tx_rollup_l2_context_sig.Ticket_indexable.pp + s) + `Permanent + Data_encoding.( + obj1 + (req + "ticket_index" + Protocol.Tx_rollup_l2_context_sig.Ticket_indexable.encoding)) + (function Tx_rollup_unknown_ticket t -> Some t | _ -> None) + (fun t -> Tx_rollup_unknown_ticket t) + +type error += + | Tx_rollup_no_proto_inbox of + Protocol.Alpha_context.Tx_rollup_level.t * Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"tx_rollup.node.no_proto_inbox" + ~title:"No inbox on L1 node" + ~description:"Inbox on L1 node cannot be retrieved." + ~pp:(fun ppf (l, b) -> + Format.fprintf + ppf + "No inbox on L1 for rollup level %a at block %a" + Protocol.Alpha_context.Tx_rollup_level.pp + l + Tezos_crypto.Block_hash.pp + b) + `Permanent + Data_encoding.( + obj2 + (req "level" Protocol.Alpha_context.Tx_rollup_level.encoding) + (req "block" Tezos_crypto.Block_hash.encoding)) + (function Tx_rollup_no_proto_inbox (l, b) -> Some (l, b) | _ -> None) + (fun (l, b) -> Tx_rollup_no_proto_inbox (l, b)) + +type error += + | Tx_rollup_inbox_mismatch of { + level : Protocol.Alpha_context.Tx_rollup_level.t; + reconstructed_inbox : Protocol.Alpha_context.Tx_rollup_inbox.t; + protocol_inbox : Protocol.Alpha_context.Tx_rollup_inbox.t; + } + +let () = + register_error_kind + ~id:"tx_rollup.node.inbox_mismatch" + ~title:"Inbox mismatch between L1 and L2" + ~description: + "Inbox reconstructed on L2 does not match the one stored on the L1 node." + ~pp:(fun ppf (level, reconstructed_inbox, protocol_inbox) -> + Format.fprintf + ppf + "@[<v 2>Inbox reconstructed for rollup level %a does not match the one \ + stored on the Tezos node.@,\ + @[<hov 2>Reconstructed:@ %a@]@,\ + @[<hov 2>Stored on Tezos:@ %a@]@,\ + @]" + Protocol.Alpha_context.Tx_rollup_level.pp + level + Protocol.Alpha_context.Tx_rollup_inbox.pp + reconstructed_inbox + Protocol.Alpha_context.Tx_rollup_inbox.pp + protocol_inbox) + `Permanent + Data_encoding.( + obj3 + (req "level" Protocol.Alpha_context.Tx_rollup_level.encoding) + (req + "reconstructed_inbox" + Protocol.Alpha_context.Tx_rollup_inbox.encoding) + (req "protocol_inbox" Protocol.Alpha_context.Tx_rollup_inbox.encoding)) + (function + | Tx_rollup_inbox_mismatch {level; reconstructed_inbox; protocol_inbox} -> + Some (level, reconstructed_inbox, protocol_inbox) + | _ -> None) + (fun (level, reconstructed_inbox, protocol_inbox) -> + Tx_rollup_inbox_mismatch {level; reconstructed_inbox; protocol_inbox}) + +type error += + | Tx_rollup_cannot_check_inbox of Protocol.Alpha_context.Tx_rollup_level.t + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_check_inbox" + ~title:"Cannot check the inbox with the L1 node" + ~description:"Reconstructed inbox cannot be checked." + ~pp:(fun ppf l -> + Format.fprintf + ppf + "Cannot check the reconstructed inbox at level %a with the L1 node" + Protocol.Alpha_context.Tx_rollup_level.pp + l) + `Permanent + Data_encoding.( + obj1 (req "level" Protocol.Alpha_context.Tx_rollup_level.encoding)) + (function Tx_rollup_cannot_check_inbox l -> Some l | _ -> None) + (fun l -> Tx_rollup_cannot_check_inbox l) + +type error += Transaction_too_large of {actual : int; limit : int} + +let () = + register_error_kind + ~id:"tx_rollup.node.transaction_too_large" + ~title:"transaction too large to be batched" + ~description:"The transaction is too large to be batched." + `Permanent + Data_encoding.(obj2 (req "actual" int31) (req "limit" int31)) + (function + | Transaction_too_large {actual; limit} -> Some (actual, limit) + | _ -> None) + (fun (actual, limit) -> Transaction_too_large {actual; limit}) + +type error += + | Tx_rollup_missing_mode_signers of { + mode : string; + missing_signers : string list; + } + +let () = + register_error_kind + ~id:"tx_rollup.node.missing_mode_signers" + ~title:"Missing signers for the chosen mode" + ~description:"Missing signers for the chosen mode." + ~pp:(fun ppf (mode, missing_signers) -> + Format.fprintf + ppf + "@[<hov>Missing signers %a for mode %s.@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ ") + Format.pp_print_string) + missing_signers + mode) + `Permanent + Data_encoding.( + obj2 (req "mode" string) (req "missing_signers" (list string))) + (function + | Tx_rollup_missing_mode_signers {mode; missing_signers} -> + Some (mode, missing_signers) + | _ -> None) + (fun (mode, missing_signers) -> + Tx_rollup_missing_mode_signers {mode; missing_signers}) + +type error += Tx_rollup_deposit_not_allowed + +let () = + register_error_kind + ~id:"tx_rollup.node.deposit_not_allowed" + ~title:"Deposit not allowed for operator" + ~description:"This node is not authorized to make a deposit" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "This rollup node is not authorized to make a deposit for the operator \ + and the operator has never made a deposit for the rollup. Please \ + restart/configure the node with --allow-deposit.") + `Permanent + Data_encoding.unit + (function Tx_rollup_deposit_not_allowed -> Some () | _ -> None) + (fun () -> Tx_rollup_deposit_not_allowed) + +type error += Tx_rollup_deposit_slashed of Tezos_crypto.Operation_hash.t + +let () = + register_error_kind + ~id:"tx_rollup.node.deposit_slashed" + ~title:"Deposit slashed" + ~description:"Deposit slashed." + ~pp:(fun ppf op -> + Format.fprintf + ppf + "The deposit for our operator was slashed in operation %a. Aborting to \ + investigate." + Tezos_crypto.Operation_hash.pp + op) + `Permanent + Data_encoding.(obj1 (req "operation" Tezos_crypto.Operation_hash.encoding)) + (function Tx_rollup_deposit_slashed o -> Some o | _ -> None) + (fun o -> Tx_rollup_deposit_slashed o) + +type error += Wrong_deposit_parameters diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/error.mli b/src/proto_016_PtMumbai/lib_tx_rollup/error.mli new file mode 100644 index 000000000000..2d2f7286b60f --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/error.mli @@ -0,0 +1,136 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Internal error in rollup node *) +type error += Tx_rollup_internal of string + +(** Error issued when the rollup referenced by its hash has not been created + on the block referenced by its hash. The node computes a state from the + block that created the rollup. *) +type error += + | Tx_rollup_not_originated_in_the_given_block of + Protocol.Alpha_context.Tx_rollup.t + +(** Error issued when the rollup genesis block is (or moves) to a different + branch. *) +type error += Tx_rollup_originated_in_fork + +(** Error issued when the configuration file does not exists. *) +type error += Tx_rollup_configuration_file_does_not_exists of string + +(** Error issued when the configuration already exists and we try to save it. *) +type error += Tx_rollup_configuration_file_already_exists of string + +(** Error issued when the configuration file cannot be write. *) +type error += Tx_rollup_unable_to_write_configuration_file of string + +(** Error issued when the Tx rollup node try to parse an invalid rollup l2 address. *) +type error += Tx_rollup_invalid_l2_address of Micheline.canonical_location + +(** Error issued when a ticket amount is invalid. *) +type error += Tx_rollup_invalid_ticket_amount of Z.t + +(** Error issued when a deposit is invalid. *) +type error += Tx_rollup_invalid_deposit + +(** Error issued when context cannot be retrieved. *) +type error += + | Tx_rollup_cannot_checkout_context of Protocol.Tx_rollup_l2_context_hash.t + +(** Error issued when the Tx rollup node starts without a rollup origination + stored on disk and when there is no given rollup genesis. *) +type error += Tx_rollup_no_rollup_info_on_disk_and_no_rollup_genesis_given + +(** Error issued when the Tx rollup node starts with a rollup origination stored on disk + different from the given rollup genesis. *) +type error += + | Tx_rollup_different_disk_stored_origination_rollup_and_given_rollup_genesis of { + disk_rollup_origination : Tezos_crypto.Block_hash.t; + given_rollup_genesis : Tezos_crypto.Block_hash.t; + } + +(** Error when operation metadata is not available. *) +type error += Tx_rollup_no_operation_metadata of Tezos_crypto.Operation_hash.t + +(** Error when rollup stored on disk is different from the expected one. *) +type error += Tx_rollup_mismatch + +(** Error when Tezos block cannot be fetched. *) +type error += Tx_rollup_cannot_fetch_tezos_block of Tezos_crypto.Block_hash.t + +(** Error when the tree is not found in the context. *) +type error += Tx_rollup_tree_not_found + +(** Error when the kinded key is not found in the tree. *) +type error += Tx_rollup_tree_kinded_key_not_found + +(** Error when a message position does not exist in the inbox for the proof RPC *) +type error += Tx_rollup_invalid_message_position_in_inbox of int + +(** Error when we want to interact with the batcher but it was not started. *) +type error += No_batcher + +(** Error when a ticket is not registered for a ticket index *) +type error += + | Tx_rollup_unknown_ticket of + Protocol.Tx_rollup_l2_context_sig.Ticket_indexable.either + +(** Error when the tezos node does not know the inbox *) +type error += + | Tx_rollup_no_proto_inbox of + Protocol.Alpha_context.Tx_rollup_level.t * Tezos_crypto.Block_hash.t + +(** Error when the node reconstructed a different inbox than the one stored on L1 *) +type error += + | Tx_rollup_inbox_mismatch of { + level : Protocol.Alpha_context.Tx_rollup_level.t; + reconstructed_inbox : Protocol.Alpha_context.Tx_rollup_inbox.t; + protocol_inbox : Protocol.Alpha_context.Tx_rollup_inbox.t; + } + +(** Error when the cannot check the inbox with L1 *) +type error += + | Tx_rollup_cannot_check_inbox of Protocol.Alpha_context.Tx_rollup_level.t + +(** Error when the transaction submitted to the batcher produces a too large + message regarding the layer1 limit. *) +type error += Transaction_too_large of {actual : int; limit : int} + +(** Missing signers for the chosen mode. *) +type error += + | Tx_rollup_missing_mode_signers of { + mode : string; + missing_signers : string list; + } + +(** Error returned when the rollup node is not authorized to make deposits *) +type error += Tx_rollup_deposit_not_allowed + +(** Error (fatal) when we are slashed *) +type error += Tx_rollup_deposit_slashed of Tezos_crypto.Operation_hash.t + +type error += Wrong_deposit_parameters diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/event.ml b/src/proto_016_PtMumbai/lib_tx_rollup/event.ml new file mode 100644 index 000000000000..10ca84b2e084 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/event.ml @@ -0,0 +1,348 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Internal_event.Simple + +let section = ["tx_rollup_node"] + +let preamble_warning = + declare_0 + ~section + ~name:"tx_rollup_node_preamble_warning" + ~msg: + "this node is primarily being developed for testing purposes at the \ + moment" + ~level:Warning + () + +let configuration_was_written = + declare_1 + ~section + ~name:"tx_rollup_node_configuration_written" + ~msg:"configuration written in {file}" + ~level:Notice + ("file", Data_encoding.string) + +let starting_node = + declare_0 + ~section + ~name:"tx_rollup_node_starting" + ~msg:"starting the transaction rollup node" + ~level:Notice + () + +let rpc_server_is_ready = + declare_1 + ~section + ~name:"tx_rollup_node_rpc_server_is_ready" + ~msg:"the transaction rollup node RPC server is listening on {addr}" + ~level:Notice + ("addr", P2p_point.Id.encoding) + +let node_is_ready = + declare_0 + ~section + ~name:"tx_rollup_node_is_ready" + ~msg:"the transaction rollup node is ready" + ~level:Notice + () + +let cannot_connect = + declare_1 + ~section + ~name:"tx_rollup_node_cannot_connect" + ~msg:"cannot connect to a node, retrying in {delay}s" + ~level:Warning + ("delay", Data_encoding.float) + +let connection_lost = + declare_0 + ~section + ~name:"tx_rollup_node_connection_lost" + ~msg:"connection to the node has been lost" + ~level:Warning + () + +let catch_up_commitments = + declare_0 + ~section + ~name:"tx_rollup_node_catch_up_commitments" + ~msg:"Catching up on commitments" + ~level:Notice + () + +let new_block = + declare_1 + ~section + ~name:"tx_rollup_node_new_block" + ~msg:"new block with hash: {block_hash}" + ~level:Notice + ("block_hash", Tezos_crypto.Block_hash.encoding) + +let processing_block = + declare_2 + ~section + ~name:"tx_rollup_node_processing_block" + ~msg:"processing block: {block_hash} (pred: {predecessor_hash})" + ~level:Debug + ("block_hash", Tezos_crypto.Block_hash.encoding) + ("predecessor_hash", Tezos_crypto.Block_hash.encoding) + +let missing_blocks = + declare_1 + ~section + ~name:"tx_rollup_node_missing_blocks" + ~msg:"Rollup node needs to process {nb} missing Tezos blocks" + ~level:Notice + ("nb", Data_encoding.int31) + +let look_for_origination = + declare_2 + ~section + ~name:"tx_rollup_node_look_for_origination" + ~msg:"Looking for rollup origination in block {block} level {level}" + ~level:Notice + ("block", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + +let detected_origination = + declare_2 + ~section + ~name:"tx_rollup_node_detected_origination" + ~msg:"Detected rollup {rollup} origination in {block}" + ~level:Notice + ("rollup", Protocol.Alpha_context.Tx_rollup.encoding) + ("block", Tezos_crypto.Block_hash.encoding) + +let tezos_block_processed = + declare_2 + ~section + ~name:"tx_rollup_node_tezos_block_processed" + ~msg:"tezos block {block_hash} at level {level} was sucessfully processed" + ~level:Notice + ("block_hash", Tezos_crypto.Block_hash.encoding) + ("level", Data_encoding.int32) + +let block_already_processed = + declare_1 + ~section + ~name:"tx_rollup_node_block_already_processed" + ~msg: + "the block {block_hash} has already been processed, nothing more to be \ + done" + ~level:Debug + ("block_hash", Tezos_crypto.Block_hash.encoding) + +let processing_block_predecessor = + declare_2 + ~section + ~name:"tx_rollup_node_processing_block_predecessor" + ~msg: + "processing block predecessor {predecessor_hash} at level \ + {predecessor_level}" + ~level:Debug + ("predecessor_hash", Tezos_crypto.Block_hash.encoding) + ("predecessor_level", Data_encoding.int32) + +let messages_application = + declare_1 + ~section + ~name:"tx_rollup_node_messages_application" + ~msg:"has {number} messages to apply" + ~level:Notice + ("number", Data_encoding.int31) + +let rollup_block = + declare_3 + ~section + ~name:"tx_rollup_level" + ~msg:"Level {level}: L2 block {hash} at Tezos {tezos_hash}" + ~level:Notice + ("level", L2block.level_encoding) + ("hash", L2block.Hash.encoding) + ("tezos_hash", Tezos_crypto.Block_hash.encoding) + +let inbox_stored = + declare_4 + ~section + ~name:"tx_rollup_node_inbox_stored" + ~msg: + "an inbox with size {cumulated_size} and resulting context hash \ + {context_hash} has been stored for {block_hash}: {messages}" + ~level:Notice + ("block_hash", Tezos_crypto.Block_hash.encoding) + ("messages", Data_encoding.list Inbox.message_encoding) + ("cumulated_size", Data_encoding.int31) + ("context_hash", Protocol.Tx_rollup_l2_context_hash.encoding) + +let irmin_store_loaded = + declare_1 + ~section + ~name:"tx_rollup_node_irmin_store_loaded" + ~msg:"an Irmin store has been loaded from {data_dir}" + ~level:Notice + ("data_dir", Data_encoding.string) + +let new_tezos_head = + declare_1 + ~section + ~name:"tx_rollup_node_new_tezos_head" + ~msg:"a new tezos head ({tezos_head}) is stored" + ~level:Notice + ("tezos_head", Tezos_crypto.Block_hash.encoding) + +module Batcher = struct + let section = section @ ["batcher"] + + let queue = + declare_1 + ~section + ~name:"queue" + ~msg:"adding {tr_hash} to queue" + ~level:Notice + ("tr_hash", L2_transaction.Hash.encoding) + + let batch = + declare_2 + ~section + ~name:"batch" + ~msg:"batching {nb_transactions} transactions into {nb_batches} batches" + ~level:Notice + ("nb_batches", Data_encoding.int31) + ("nb_transactions", Data_encoding.int31) + + let no_full_batch = + declare_0 + ~section + ~name:"no_full_batch" + ~msg:"No full batch to inject and we requested so" + ~level:Info + () + + let batch_success = + declare_0 + ~section + ~name:"batch_success" + ~msg:"transactions were successfully batched" + ~level:Notice + () + + let invalid_transaction = + declare_1 + ~section + ~name:"invalid_transaction" + ~msg:"a batch with this only transaction is invalid: {tr}" + ("tr", L2_transaction.encoding) + + module Worker = struct + open Batcher_worker_types + + let section = section @ ["worker"] + + let request_failed = + declare_3 + ~section + ~name:"request_failed" + ~msg:"request {view} failed ({worker_status}): {errors}" + ~level:Warning + ("view", Request.encoding) + ~pp1:Request.pp + ("worker_status", Worker_types.request_status_encoding) + ~pp2:Worker_types.pp_status + ("errors", Error_monad.trace_encoding) + ~pp3:Error_monad.pp_print_trace + + let request_completed_notice = + declare_2 + ~section + ~name:"request_completed_notice" + ~msg:"{view} {worker_status}" + ~level:Notice + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status + + let request_completed_debug = + declare_2 + ~section + ~name:"request_completed_debug" + ~msg:"{view} {worker_status}" + ~level:Debug + ("view", Request.encoding) + ("worker_status", Worker_types.request_status_encoding) + ~pp1:Request.pp + ~pp2:Worker_types.pp_status + end +end + +module Accuser = struct + let section = section @ ["accuser"] + + let bad_finalized_commitment = + declare_1 + ~name:"bad_finalized_commitment" + ~msg:"Commitment at level {level} is bad but already finalized!!!" + ~level:Error + ("level", Protocol.Alpha_context.Tx_rollup_level.encoding) + + let inbox_merkle_root_mismatch = + declare_2 + ~name:"inbox_merkle_root_mismatch" + ~msg: + "Inbox merkle root for commitment on L1 {l1_merkle_root} is different \ + from the one computed by the rollup node {our_merkle_root}" + ~level:Warning + ( "l1_merkle_root", + Protocol.Alpha_context.Tx_rollup_inbox.Merkle.root_encoding ) + ( "our_merkle_root", + Protocol.Alpha_context.Tx_rollup_inbox.Merkle.root_encoding ) + + let commitment_predecessor_mismatch = + declare_2 + ~name:"commitment_predecessor_mismatch" + ~msg: + "Commitment predecessor L1 {l1_predecessor} is different from the one \ + computed by the rollup node {our_predecessor}" + ~level:Warning + ( "l1_predecessor", + Data_encoding.option + Protocol.Alpha_context.Tx_rollup_commitment_hash.encoding ) + ( "our_predecessor", + Data_encoding.option + Protocol.Alpha_context.Tx_rollup_commitment_hash.encoding ) + + let bad_commitment = + declare_2 + ~name:"bad_commitment" + ~msg: + "Detected a bad (rejectable) commitment at level {level} for message \ + at position {position}" + ~level:Warning + ("level", Protocol.Alpha_context.Tx_rollup_level.encoding) + ("position", Data_encoding.int31) +end diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.ml b/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.ml new file mode 100644 index 000000000000..196a618b57d6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.ml @@ -0,0 +1,345 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type l2_message = + | Ok_deposit of Tx_rollup_message.t * Tx_rollup_l2_apply.indexes + | Failing_deposit of { + message : Tx_rollup_message.t; + reason : Environment.Error_monad.error; + withdrawal : Tx_rollup_withdraw.t; + } + | Ok_batch of { + transactions_and_results : + (( Indexable.unknown, + Indexable.unknown ) + Tx_rollup_l2_batch.V1.transaction + * Tx_rollup_l2_apply.Message_result.transaction_result) + list; + withdrawals : Tx_rollup_withdraw.t list; + indexes : Tx_rollup_l2_apply.indexes; + aggregated_signature : Tx_rollup_l2_batch.V1.signature; + } + | Failing_batch of { + transactions : + (Indexable.unknown, Indexable.unknown) Tx_rollup_l2_batch.V1.transaction + list; + reasons : tztrace; + aggregated_signature : Tx_rollup_l2_batch.V1.signature; + } + | Unparsable_batch of string + +type fancy_message = { + message : l2_message; + l2_context_hash : Inbox.l2_context_hash; +} + +type inbox = fancy_message list + +type t = inbox L2block.block + +let ticket_hash_value ctxt ticket_hash = + let open Indexable in + let open Lwt_syntax in + match destruct ticket_hash with + | Left index -> ( + let* ticket_opt = Context.get_ticket ctxt index in + match ticket_opt with + | Some Ticket.{hash; _} -> + return + (Tx_rollup_l2_context_sig.Ticket_indexable.value hash + |> Indexable.forget) + | None -> return ticket_hash) + | Right _ -> return ticket_hash + +let address_value ctxt addr = + let open Indexable in + let open Lwt_syntax in + match destruct addr with + | Left index -> ( + let* addr_opt = Context.get_address ctxt index in + match addr_opt with + | Some addr -> + return (Tx_rollup_l2_address.Indexable.value addr |> Indexable.forget) + | None -> return addr) + | Right _ -> return addr + +let signer_value ctxt signer = + (* After interpretation, the signer always has an associated address *) + let open Indexable in + let open Lwt_syntax in + match destruct signer with + | Left index -> ( + let index = to_int32 index in + let index = from_index_exn index in + let* addr = address_value ctxt index in + match destruct addr with + | Right addr -> return (value (Tx_rollup_l2_batch.L2_addr addr) |> forget) + | Left _ -> assert false) + | Right Tx_rollup_l2_batch.(L2_addr _) -> return signer + | Right Tx_rollup_l2_batch.(Bls_pk pk) -> + let addr = Tezos_crypto.Bls.Public_key.hash pk in + return (value (Tx_rollup_l2_batch.L2_addr addr) |> forget) + +let transaction_replace_indexes ctxt transaction = + let open Tx_rollup_l2_batch.V1 in + let open Lwt_syntax in + let operation_content_replace_index = function + | Transfer {destination; ticket_hash; qty} -> + let* ticket_hash = ticket_hash_value ctxt ticket_hash in + let* destination = address_value ctxt destination in + return (Transfer {destination; ticket_hash; qty}) + | Withdraw _ as x -> return x + in + let operation_replace_indexes {signer; counter; contents} = + let* contents = List.map_s operation_content_replace_index contents in + let* signer = signer_value ctxt signer in + return {signer; counter; contents} + in + let* operations = List.map_s operation_replace_indexes transaction in + return operations + +let fancy_message_of_message ctxt Inbox.{message; result; l2_context_hash} = + let open Lwt_syntax in + let* (l2_message : l2_message) = + match (message, result) with + | Batch s, Discarded tztrace -> ( + let batch_opt = + Data_encoding.Binary.of_string_opt Tx_rollup_l2_batch.encoding s + in + match batch_opt with + | Some (V1 batch) -> + return + (Failing_batch + { + transactions = batch.contents; + reasons = tztrace; + aggregated_signature = batch.aggregated_signature; + }) + | None -> return (Unparsable_batch s)) + | ( Batch s, + Interpreted + (Batch_V1_result (Batch_result {results; indexes}), withdrawals) ) -> + let (V1 batch) = + Data_encoding.Binary.of_string_exn Tx_rollup_l2_batch.encoding s + in + let _, results = List.split results in + let* transactions = + List.map_s (transaction_replace_indexes ctxt) batch.contents + in + let transactions_and_results = + Stdlib.List.combine transactions results + in + return + (Ok_batch + { + transactions_and_results; + withdrawals; + indexes; + aggregated_signature = batch.aggregated_signature; + }) + | Deposit _, Interpreted (Deposit_result (Deposit_success indexes), _) -> + return (Ok_deposit (message, indexes)) + | ( Deposit _, + Interpreted (Deposit_result (Deposit_failure error), [withdrawal]) ) -> + return (Failing_deposit {message; reason = error; withdrawal}) + | _ -> assert false + in + return {message = l2_message; l2_context_hash} + +let of_l2block ctxt L2block.{hash; header; inbox; commitment} = + let open Lwt_syntax in + let+ fancy_inbox = Lwt_list.map_s (fancy_message_of_message ctxt) inbox in + L2block.{hash; header; inbox = fancy_inbox; commitment} + +let indexes_encoding = + let open Data_encoding in + let open Tx_rollup_l2_apply in + let indexable value_encoding index_encoding = + obj2 (req "value" value_encoding) (req "index" index_encoding) + in + conv + (fun {address_indexes; ticket_indexes} -> (address_indexes, ticket_indexes)) + (fun (address_indexes, ticket_indexes) -> {address_indexes; ticket_indexes}) + @@ obj2 + (req + "address_indexes" + (list + (indexable + Tx_rollup_l2_address.encoding + Tx_rollup_l2_address.Indexable.index_encoding))) + (req + "ticket_indexes" + (list + (indexable + Ticket_hash.encoding + Tx_rollup_l2_context_sig.Ticket_indexable.index_encoding))) + +(** TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2957 + Copy-pasted from the protocol. *) +let transaction_result_encoding = + let open Data_encoding in + let open Tx_rollup_l2_apply.Message_result in + union + [ + (let kind = "success" in + case + ~title:kind + (Tag 0) + (constant kind) + (function Transaction_success -> Some () | _ -> None) + (fun () -> Transaction_success)); + (let kind = "failure" in + case + ~title:kind + (Tag 1) + (obj1 + (req + kind + (obj2 + (req "transaction_index" Data_encoding.int31) + (req "reason" Environment.Error_monad.error_encoding)))) + (function + | Transaction_failure {index; reason} -> Some (index, reason) + | _ -> None) + (fun (index, reason) -> Transaction_failure {index; reason})); + ] + +(** TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2957 + Copy-pasted from the protocol. *) +let batch_encoding = + let open Data_encoding in + let json = conv Bytes.of_string Bytes.to_string bytes in + splitted ~json ~binary:string + +let l2_message_encoding = + let open Data_encoding in + union + [ + case + ~title:"ok_deposit" + (Tag 0) + (merge_objs + Tx_rollup_message.encoding + (obj2 + (req "result" (constant "success")) + (req "indexes" indexes_encoding))) + (function + | Ok_deposit (deposit, indexes) -> Some (deposit, ((), indexes)) + | _ -> None) + (fun (deposit, ((), indexes)) -> Ok_deposit (deposit, indexes)); + case + ~title:"failing_deposit" + (Tag 1) + (obj4 + (req "deposit" Tx_rollup_message.encoding) + (req "result" (constant "failed")) + (req "reason" Environment.Error_monad.error_encoding) + (req "withdrawal" Tx_rollup_withdraw.encoding)) + (function + | Failing_deposit {message; reason; withdrawal} -> + Some (message, (), reason, withdrawal) + | _ -> None) + (fun (message, (), reason, withdrawal) -> + Failing_deposit {message; reason; withdrawal}); + case + ~title:"ok_batch" + (Tag 2) + (obj4 + (req + "transactions_and_results" + (list + (obj2 + (req + "transaction" + Tx_rollup_l2_batch.V1.transaction_encoding) + (req "result" transaction_result_encoding)))) + (req "withdrawals" (list Tx_rollup_withdraw.encoding)) + (req "indexes" indexes_encoding) + (req "aggregated_signature" Tezos_crypto.Bls.encoding)) + (function + | Ok_batch + { + transactions_and_results; + withdrawals; + indexes; + aggregated_signature; + } -> + Some + ( transactions_and_results, + withdrawals, + indexes, + aggregated_signature ) + | _ -> None) + (fun ( transactions_and_results, + withdrawals, + indexes, + aggregated_signature ) -> + Ok_batch + { + transactions_and_results; + withdrawals; + indexes; + aggregated_signature; + }); + case + ~title:"failing_batch" + (Tag 3) + (obj3 + (req + "transactions" + (list Tx_rollup_l2_batch.V1.transaction_encoding)) + (req "errors" Error_monad.trace_encoding) + (req "aggregated_signature" Tezos_crypto.Bls.encoding)) + (function + | Failing_batch {transactions; reasons; aggregated_signature} -> + Some (transactions, reasons, aggregated_signature) + | _ -> None) + (fun (transactions, reasons, aggregated_signature) -> + Failing_batch {transactions; reasons; aggregated_signature}); + case + ~title:"unparsable_batch" + (Tag 4) + (obj2 + (req "batch" batch_encoding) + (req "result" (constant "failed to parse"))) + (function Unparsable_batch s -> Some (s, ()) | _ -> None) + (fun (s, ()) -> Unparsable_batch s); + ] + +let fancy_message_encoding : fancy_message Data_encoding.t = + let open Data_encoding in + conv + (fun {message; l2_context_hash} -> (message, l2_context_hash)) + (fun (message, l2_context_hash) -> {message; l2_context_hash}) + (obj2 + (req "l2_message" l2_message_encoding) + (req "l2_context_hash" Inbox.l2_context_hash_encoding)) + +let inbox_encoding = Data_encoding.list fancy_message_encoding + +let encoding = L2block.block_encoding inbox_encoding diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.mli b/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.mli new file mode 100644 index 000000000000..86f8762e02d4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/fancy_l2block.mli @@ -0,0 +1,81 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** This module describes a fancy representation of a {!L2block.t}. We define + a fancy block with an associated encoding. The encoded JSON will later on + be used in RPCs to provide a cleaner and easier to use JSON object. *) + +type l2_message = + | Ok_deposit of Tx_rollup_message.t * Tx_rollup_l2_apply.indexes + (** The deposit was interpreted with no error, we display only the created indexes if any. *) + | Failing_deposit of { + message : Tx_rollup_message.t; + reason : Environment.Error_monad.error; + withdrawal : Tx_rollup_withdraw.t; + } (** The deposit failed with an error, it produced a withdraw. *) + | Ok_batch of { + transactions_and_results : + (( Indexable.unknown, + Indexable.unknown ) + Tx_rollup_l2_batch.V1.transaction + * Tx_rollup_l2_apply.Message_result.transaction_result) + list; + withdrawals : Tx_rollup_withdraw.t list; + indexes : Tx_rollup_l2_apply.indexes; + aggregated_signature : Tx_rollup_l2_batch.V1.signature; + } + (** The batch was interpreted, we list all transaction alongside their results. + The transactions are marked as [(unknown, unknown) transaction] but we + try to replace as much as we can the indexes by their values. *) + | Failing_batch of { + transactions : + (Indexable.unknown, Indexable.unknown) Tx_rollup_l2_batch.V1.transaction + list; + reasons : tztrace; + aggregated_signature : Tx_rollup_l2_batch.V1.signature; + } + (** The batch was discarded, it could not be interpreted with the l2-apply because of [tztrace]. *) + | Unparsable_batch of string (** The batch is unparsable. *) + +type fancy_message = { + message : l2_message; + l2_context_hash : Inbox.l2_context_hash; +} + +type inbox = fancy_message list + +(** A fancy block is a classic block where the contents are reorganized. *) +type t = inbox L2block.block + +(** [of_l2block ctxt block] uses the [ctxt] to transform a {!L2block.t} to a {!t}. + It tries to replace the indexes in [block] when there are associated values + in the [ctxt]. *) +val of_l2block : Context.t -> L2block.t -> t Lwt.t + +(** Encoding used for block RPCs. *) +val encoding : t Data_encoding.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/inbox.ml b/src/proto_016_PtMumbai/lib_tx_rollup/inbox.ml new file mode 100644 index 000000000000..40bdec5a250a --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/inbox.ml @@ -0,0 +1,128 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +type message_result = + | Interpreted of Tx_rollup_l2_apply.Message_result.t + | Discarded of tztrace + +type l2_context_hash = { + irmin_hash : Tx_rollup_l2_context_hash.t; + tree_hash : Tezos_crypto.Context_hash.t; +} + +type message = { + message : Tx_rollup_message.t; + result : message_result; + l2_context_hash : l2_context_hash; +} + +type t = message list + +let message_result_encoding = + let open Data_encoding in + union + [ + case + ~title:"interpreted" + (Tag 0) + Tx_rollup_l2_apply.Message_result.encoding + (function Interpreted r -> Some r | _ -> None) + (fun r -> Interpreted r); + case + ~title:"discarded" + (Tag 1) + (obj1 + (req "discarded" (obj1 (req "reason" Error_monad.trace_encoding)))) + (function Discarded e -> Some e | _ -> None) + (fun e -> Discarded e); + ] + +let l2_context_hash_encoding = + let open Data_encoding in + conv + (fun {irmin_hash; tree_hash} -> (irmin_hash, tree_hash)) + (fun (irmin_hash, tree_hash) -> {irmin_hash; tree_hash}) + (obj2 + (req "irmin_hash" Tx_rollup_l2_context_hash.encoding) + (req "tree_hash" Tezos_crypto.Context_hash.encoding)) + +let message_encoding = + let open Data_encoding in + conv + (fun {message; result; l2_context_hash} -> + (message, result, l2_context_hash)) + (fun (message, result, l2_context_hash) -> + {message; result; l2_context_hash}) + (obj3 + (req "message" Tx_rollup_message.encoding) + (req "result" message_result_encoding) + (req "l2_context_hash" l2_context_hash_encoding)) + +let encoding = + let open Data_encoding in + list message_encoding + +let merkle_root inbox = + let message_hashes = + List.map + (fun msg -> Tx_rollup_message_hash.hash_uncarbonated msg.message) + inbox + in + Tx_rollup_inbox.Merkle.merklize_list message_hashes + +let to_proto inbox = + let inbox_length = List.length inbox in + let cumulated_size = + List.fold_left + (fun acc {message; _} -> + (* TORU/FIXME: https://gitlab.com/tezos/tezos/-/issues/2957 + We need to expose [Alpha_context.Tx_rollup_message.size]. *) + acc + Tx_rollup_message_repr.size (Obj.magic message)) + 0 + inbox + in + let merkle_root = merkle_root inbox in + Tx_rollup_inbox.{inbox_length; cumulated_size; merkle_root} + +let proto_message_results inbox = + List.map + (fun msg -> + let withdrawals = + match msg.result with + | Discarded _ -> [] + | Interpreted (_result, withdrawals) -> withdrawals + in + Tx_rollup_message_result. + { + context_hash = msg.l2_context_hash.tree_hash; + withdraw_list_hash = + Tx_rollup_withdraw_list_hash.hash_uncarbonated withdrawals; + }) + inbox diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/inbox.mli b/src/proto_016_PtMumbai/lib_tx_rollup/inbox.mli new file mode 100644 index 000000000000..9b874b09d866 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/inbox.mli @@ -0,0 +1,79 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** A non-compact representation of inboxes that represents complete messages + and not their hashes. *) + +open Protocol +open Alpha_context + +(** Result of application of an inbox message *) +type message_result = + | Interpreted of Tx_rollup_l2_apply.Message_result.t + (** The message was interpreted by the rollup node but may have failed *) + | Discarded of tztrace + (** The message was discarded because it could not be interpreted *) + +type l2_context_hash = { + irmin_hash : Tx_rollup_l2_context_hash.t; + (** The context hash of the commited context, used for checkout *) + tree_hash : Tezos_crypto.Context_hash.t; + (** The tree hash is the hash of the underlying tree in the {!Context}, + used to produce proofs *) +} + +(** Type of inbox message with the context hash resulting from the application + of the message *) +type message = { + message : Tx_rollup_message.t; + result : message_result; + l2_context_hash : l2_context_hash; +} + +(** The type representing an inbox whose contents are the messages and not the + hashed messages. *) +type t = message list + +(** Encoding for l2 context hashes *) +val l2_context_hash_encoding : l2_context_hash Data_encoding.t + +(** Encoding for inbox messages *) +val message_encoding : message Data_encoding.t + +(** Encoding for inboxes *) +val encoding : t Data_encoding.t + +(** Returns the Merkle root of the (contents of the) inbox. *) +val merkle_root : t -> Tx_rollup_inbox.Merkle.root + +(** Returns the protocol inbox from an L2 inbox. The protocol inbox corresponds + to the structure that is stored on L1, i.e. an inbox with Merklized + contents. *) +val to_proto : t -> Tx_rollup_inbox.t + +(** Return protocol message results for an inbox *) +val proto_message_results : t -> Tx_rollup_message_result.t list diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/injector.ml b/src/proto_016_PtMumbai/lib_tx_rollup/injector.ml new file mode 100644 index 000000000000..3a47e1158fdd --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/injector.ml @@ -0,0 +1,194 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context +open Injector_sigs + +type tag = + | Commitment + | Submit_batch + | Finalize_commitment + | Remove_commitment + | Rejection + | Dispatch_withdrawals + +module Parameters = struct + type rollup_node_state = State.t + + let events_section = ["tx_rollup_node"; "injector"] + + module Tag = struct + type t = tag + + let compare = Stdlib.compare + + let equal = Stdlib.( = ) + + let hash = Hashtbl.hash + + let string_of_tag : t -> string = function + | Submit_batch -> "submit_batch" + | Commitment -> "commitment" + | Finalize_commitment -> "finalize_commitment" + | Remove_commitment -> "remove_commitment" + | Rejection -> "rejection" + | Dispatch_withdrawals -> "dispatch_withdrawals" + + let pp ppf t = Format.pp_print_string ppf (string_of_tag t) + + let encoding : t Data_encoding.t = + let open Data_encoding in + string_enum + (List.map + (fun t -> (string_of_tag t, t)) + [ + Submit_batch; + Commitment; + Finalize_commitment; + Remove_commitment; + Rejection; + Dispatch_withdrawals; + ]) + end + + (* Very coarse approximation for the number of operation we expect for each + block *) + let table_estimated_size = function + | Commitment -> 3 + | Submit_batch -> 509 + | Finalize_commitment -> 3 + | Remove_commitment -> 3 + | Rejection -> 3 + | Dispatch_withdrawals -> 89 + + let tag_operation (type kind) (op : kind manager_operation) = + match op with + | Tx_rollup_submit_batch _ -> Some Submit_batch + | Tx_rollup_commit _ -> Some Commitment + | Tx_rollup_finalize_commitment _ -> Some Finalize_commitment + | Tx_rollup_remove_commitment _ -> Some Remove_commitment + | Tx_rollup_rejection _ -> Some Rejection + | Tx_rollup_dispatch_tickets _ -> Some Dispatch_withdrawals + | _ -> None + + let fee_parameter (rollup_node_state : State.t) op = + let Node_config.{fee_cap; burn_cap} = + Option.fold + (tag_operation op) + ~none:Node_config.default_cost_caps + ~some:(function + | Commitment -> rollup_node_state.caps.operator + | Submit_batch -> rollup_node_state.caps.submit_batch + | Finalize_commitment -> rollup_node_state.caps.finalize_commitment + | Remove_commitment -> rollup_node_state.caps.remove_commitment + | Rejection -> rollup_node_state.caps.rejection + | Dispatch_withdrawals -> rollup_node_state.caps.dispatch_withdrawals) + in + Injection. + { + minimal_fees = Tez.of_mutez_exn 100L; + minimal_nanotez_per_byte = Q.of_int 1000; + minimal_nanotez_per_gas_unit = Q.of_int 100; + force_low_fee = false; + fee_cap; + burn_cap; + } + + (* Below are dummy values that are only used to approximate the + size. It is thus important that they remain above the real + values if we want the computed size to be an over_approximation + (without having to do a simulation first). *) + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2812 + check the size, or compute them wrt operation kind *) + let approximate_fee_bound _ _ = + { + fee = Tez.of_mutez_exn 3_000_000L; + counter = Manager_counter.Internal_for_tests.of_int 500_000; + gas_limit = Gas.Arith.integral_of_int_exn 500_000; + storage_limit = Z.of_int 500_000; + } + + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2813 + Decide if some operations must all succeed *) + let batch_must_succeed _ = `At_least_one + + (** Returns [true] if an included operation should be re-queued for injection + when the block in which it is included is reverted (due to a + reorganization). *) + let requeue_reverted_operation (type kind) state + (operation : kind manager_operation) = + let open Lwt_syntax in + match operation with + | Tx_rollup_rejection _ -> + (* TODO: check if rejected commitment in still in main chain *) + return_true + | Tx_rollup_commit {commitment; _} -> ( + let level = commitment.level in + let* l2_block = State.get_level_l2_block state level in + match l2_block with + | None -> + (* We don't know this L2 block, should not happen *) + let+ () = Debug_events.(emit should_not_happen) __LOC__ in + false + | Some l2_block -> + let commit_hash = + Tx_rollup_commitment.(Compact.hash (Full.compact commitment)) + in + (* Do not re-queue if commitment for this level has changed *) + return + Tx_rollup_commitment_hash.( + l2_block.L2block.header.commitment = commit_hash)) + | _ -> return_true + + let retry_unsuccessful_operation (type kind) state + (op : kind manager_operation) status = + let open Lwt_syntax in + match status with + | Backtracked | Skipped -> + (* Always retry backtracked or skipped operations *) + return Retry + | Other_branch -> + let+ retry = requeue_reverted_operation state op in + if retry then Retry else Forget + | Failed error -> ( + match op with + | Tx_rollup_remove_commitment _ | Tx_rollup_finalize_commitment _ -> + (* We can ignore these operations as they are injected + preemptively. *) + return Forget + | _ -> return (Abort error)) + + let operation_tag (type kind) (operation : kind manager_operation) = + match operation with + | Tx_rollup_rejection _ -> Some Rejection + | Tx_rollup_commit _ -> Some Commitment + | Tx_rollup_submit_batch _ -> Some Submit_batch + | Tx_rollup_finalize_commitment _ -> Some Finalize_commitment + | Tx_rollup_remove_commitment _ -> Some Remove_commitment + | Tx_rollup_dispatch_tickets _ -> Some Dispatch_withdrawals + | _ -> None +end + +include Injector_functor.Make (Parameters) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/injector.mli b/src/proto_016_PtMumbai/lib_tx_rollup/injector.mli new file mode 100644 index 000000000000..f23eda69a9a4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/injector.mli @@ -0,0 +1,35 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type tag = + | Commitment + | Submit_batch + | Finalize_commitment + | Remove_commitment + | Rejection + | Dispatch_withdrawals + +include + Injector_sigs.S with type rollup_node_state := State.t and type tag := tag diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.ml b/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.ml new file mode 100644 index 000000000000..23284a1680ad --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.ml @@ -0,0 +1,129 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Tx_rollup_message_proof_too_large of {limit : int; actual : int} + +let () = + register_error_kind + ~id:"tx_rollup.node.message_proof_too_large" + ~title:"Message's application proof is too large" + ~description: + "The proof associated to the application of the message is too large" + ~pp:(fun ppf (limit, actual) -> + Format.fprintf + ppf + "The message produces a proof of size %d where the protocol limit is \ + %d. It will be rejected by the protocol." + limit + actual) + `Permanent + Data_encoding.(obj2 (req "limit" int31) (req "actual" int31)) + (function + | Tx_rollup_message_proof_too_large {limit; actual} -> Some (limit, actual) + | _ -> None) + (fun (limit, actual) -> Tx_rollup_message_proof_too_large {limit; actual}) + +(** Interpret a message in the context. The function needs to be synchronised + with the [Tx_rollup_l2_verifier] module of the protocol, in particular + the proof size boundaries. *) +let interpret_message ~rejection_max_proof_size ctxt l2_parameters message = + let open Lwt_result_syntax in + let* proof, res = Prover_apply.apply_message ctxt l2_parameters message in + let proof_size = Prover_apply.proof_size proof in + let message_size = + Data_encoding.Binary.length + Protocol.Alpha_context.Tx_rollup_message.encoding + message + in + let result = + if proof_size > rejection_max_proof_size - message_size then + (* The proof is too large, we can not commit this state. The + result is discarded. *) + Inbox.Discarded + [ + Tx_rollup_message_proof_too_large + {limit = rejection_max_proof_size; actual = proof_size}; + ] + else res.Context.result + in + return (res.Context.tree, result) + +let interpret_messages ~rejection_max_proof_size ctxt l2_parameters messages = + let open Lwt_result_syntax in + let ctxt_hash = Context.hash ctxt in + let* tree_hash = Context.tree_hash_of_context ctxt in + let+ ctxt, _ctxt_hash, _tree_hash, rev_contents = + List.fold_left_es + (fun (ctxt, ctxt_hash, tree_hash, acc) message -> + let* tree, result = + interpret_message ~rejection_max_proof_size ctxt l2_parameters message + in + let* ctxt, ctxt_hash, tree_hash = + match result with + | Inbox.Interpreted _ -> + (* The message was successfully interpreted but the status in + [result] may indicate that the application failed. The context + may have been modified with e.g. updated counters. *) + let tree_hash = Context.hash_tree tree in + let*! ctxt, ctxt_hash = Context.add_tree ctxt tree in + return (ctxt, ctxt_hash, tree_hash) + | Inbox.Discarded _ -> + (* The message was discarded before attempting to interpret it. The + context is not modified. For instance if a batch is unparsable, + or the BLS signature is incorrect, or a counter is wrong, etc. *) + return (ctxt, ctxt_hash, tree_hash) + in + let inbox_message = + Inbox. + { + message; + result; + l2_context_hash = {irmin_hash = ctxt_hash; tree_hash}; + } + in + return (ctxt, ctxt_hash, tree_hash, inbox_message :: acc)) + (ctxt, ctxt_hash, tree_hash, []) + messages + in + match rev_contents with + | [] -> (ctxt, None) + | _ -> + let contents = List.rev rev_contents in + (ctxt, Some contents) + +let interpret_batch ~rejection_max_proof_size ctxt l2_parameters batch = + let open Lwt_result_syntax in + let batch_bytes = + Data_encoding.Binary.to_string_exn + Protocol.Tx_rollup_l2_batch.encoding + batch + in + let message, _ = + Protocol.Alpha_context.Tx_rollup_message.make_batch batch_bytes + in + let* _tree, result = + interpret_message ~rejection_max_proof_size ctxt l2_parameters message + in + match result with Inbox.Discarded trace -> fail trace | _ -> return () diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.mli b/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.mli new file mode 100644 index 000000000000..77f38c8287a5 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/interpreter.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Error result when the message's application produces a too large proof. + It overrides the layer2 apply message result. *) +type error += Tx_rollup_message_proof_too_large of {limit : int; actual : int} + +(** Interpreting the [messages] in the context. + + It uses internally the {!Prover_apply} to produce a proof associated + to the interpretation of each message. In the case where the proof is + larger than the configuration limit, the message's interpretation is + discarded alongside the modified context. +*) +val interpret_messages : + rejection_max_proof_size:int -> + Context.context -> + Protocol.Tx_rollup_l2_apply.parameters -> + Protocol.Alpha_context.Tx_rollup_message.t trace -> + (Context.context * Inbox.message list option) tzresult Lwt.t + +(** Interpreting the [batch] in the context. + + Similarly to {!interp_messages}, it uses internally the {!Prover_apply}. + However, the function fails if the interpretation produces a proof + that is larger than the configuration limit. + We here want to check only if the batch is interpretable, the modified + tree is discarded. + + TODO/TORU: maybe we could check the results for each transaction in the batch +*) +val interpret_batch : + rejection_max_proof_size:int -> + Context.context -> + Protocol.Tx_rollup_l2_apply.parameters -> + ( Protocol.Indexable.unknown, + Protocol.Indexable.unknown ) + Protocol.Tx_rollup_l2_batch.t -> + unit tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/l2_apply.ml b/src/proto_016_PtMumbai/lib_tx_rollup/l2_apply.ml new file mode 100644 index 000000000000..ac3713510d23 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/l2_apply.ml @@ -0,0 +1,26 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Protocol.Tx_rollup_l2_apply.Make (Context) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.ml b/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.ml new file mode 100644 index 000000000000..15aa8a7e9041 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.ml @@ -0,0 +1,72 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +type t = { + transaction : + (Indexable.unknown, Indexable.unknown) Tx_rollup_l2_batch.V1.transaction; + signatures : Tx_rollup_l2_batch.V1.signature list; +} + +let encoding = + let open Data_encoding in + conv + (fun {transaction; signatures} -> (transaction, signatures)) + (fun (transaction, signatures) -> {transaction; signatures}) + @@ obj2 + (req "transaction" Tx_rollup_l2_batch.V1.transaction_encoding) + (req "signatures" (list Tezos_crypto.Bls.encoding)) + +let batch l = + let contents = List.map (fun {transaction; _} -> transaction) l in + let aggregated_signature = + List.concat_map (fun {signatures; _} -> signatures) l + |> Tezos_crypto.Bls.aggregate_signature_opt + in + match aggregated_signature with + | None -> error_with "Cannot aggregate signatures" + | Some aggregated_signature -> + ok Tx_rollup_l2_batch.(V1 V1.{contents; aggregated_signature}) + +module Hash = + Tezos_crypto.Blake2B.Make + (Tezos_crypto.Base58) + (struct + let name = "tx_rollup_l2_transaction_hash" + + let title = "An tx_rollup L2 transaction" + + let b58check_prefix = "\018\007\031\191" (* txL2(54) *) + + let size = None + end) + +let () = + Tezos_crypto.Base58.check_encoded_prefix Hash.b58check_encoding "txL2" 54 + +type hash = Hash.t + +let hash t = Hash.hash_bytes [Data_encoding.Binary.to_bytes_exn encoding t] diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.mli b/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.mli new file mode 100644 index 000000000000..d431b65218d6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/l2_transaction.mli @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol + +(** {2 Types for L2 transactions} *) + +type t = { + transaction : + (Indexable.unknown, Indexable.unknown) Tx_rollup_l2_batch.V1.transaction; + signatures : Tx_rollup_l2_batch.V1.signature list; +} + +(** Hash with b58check encoding txL2(54), for hashes of L2 transactions *) +module Hash : Tezos_crypto.S.HASH + +(** Alias for transaction hash *) +type hash = Hash.t + +(** {2 Serialization} *) + +val encoding : t Data_encoding.encoding + +val hash : t -> Hash.t + +(** {2 Batching} *) + +(** Build a L2 batch of transactions by aggregating the BLS signatures of + individual transactions *) +val batch : + t list -> (Indexable.unknown, Indexable.unknown) Tx_rollup_l2_batch.t tzresult diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/l2block.ml b/src/proto_016_PtMumbai/lib_tx_rollup/l2block.ml new file mode 100644 index 000000000000..aa1f6ff01081 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/l2block.ml @@ -0,0 +1,126 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +module Hash = + Tezos_crypto.Blake2B.Make + (Tezos_crypto.Base58) + (struct + let name = "tx_rollup_l2_block_hash" + + let title = "An tx_rollup L2 block identifier" + + let b58check_prefix = "\016\006\254" (* BTx(53) *) + + let size = None + end) + +let () = + Tezos_crypto.Base58.check_encoded_prefix Hash.b58check_encoding "BTx" 53 + +type hash = Hash.t + +type level = Tx_rollup_level.t + +type header = { + level : level; + tezos_block : Tezos_crypto.Block_hash.t; + predecessor : hash option; + context : Tx_rollup_l2_context_hash.t; + commitment : Tx_rollup_commitment_hash.t; +} + +type 'inbox block = { + hash : hash; + header : header; + inbox : 'inbox; + commitment : Tx_rollup_commitment.Full.t; +} + +type t = Inbox.t block + +type commitment_included_info = { + block : Tezos_crypto.Block_hash.t; + operation : Tezos_crypto.Operation_hash.t; +} + +type metadata = { + commitment_included : commitment_included_info option; + finalized : bool; +} + +let level_encoding = Tx_rollup_level.encoding + +let level_to_string l = Int32.to_string (Tx_rollup_level.to_int32 l) + +let header_encoding = + let open Data_encoding in + conv + (fun {level; tezos_block; predecessor; context; commitment} -> + (level, tezos_block, predecessor, context, commitment)) + (fun (level, tezos_block, predecessor, context, commitment) -> + {level; tezos_block; predecessor; context; commitment}) + (obj5 + (req "level" Tx_rollup_level.encoding) + (req "tezos_block" Tezos_crypto.Block_hash.encoding) + (opt "predecessor" Hash.encoding) + (req "context" Tx_rollup_l2_context_hash.encoding) + (req "commitment" Tx_rollup_commitment_hash.encoding)) + +let block_encoding inbox_encoding : 'inbox block Data_encoding.t = + let open Data_encoding in + conv + (fun {hash; header; inbox; commitment} -> (hash, header, inbox, commitment)) + (fun (hash, header, inbox, commitment) -> {hash; header; inbox; commitment}) + (obj4 + (req "hash" Hash.encoding) + (req "header" header_encoding) + (req "inbox" inbox_encoding) + (req "commitment" Tx_rollup_commitment.Full.encoding)) + +let encoding : t Data_encoding.t = block_encoding Inbox.encoding + +let commitment_included_info_encoding = + let open Data_encoding in + conv + (fun {block; operation} -> (block, operation)) + (fun (block, operation) -> {block; operation}) + (obj2 + (req "block" Tezos_crypto.Block_hash.encoding) + (req "operation" Tezos_crypto.Operation_hash.encoding)) + +let metadata_encoding = + let open Data_encoding in + conv + (fun {commitment_included; finalized} -> (commitment_included, finalized)) + (fun (commitment_included, finalized) -> {commitment_included; finalized}) + (obj2 + (opt "commitment_included" commitment_included_info_encoding) + (req "finalized" bool)) + +let hash_header h = + Hash.hash_bytes [Data_encoding.Binary.to_bytes_exn header_encoding h] diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/l2block.mli b/src/proto_016_PtMumbai/lib_tx_rollup/l2block.mli new file mode 100644 index 000000000000..a5176b6a5db6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/l2block.mli @@ -0,0 +1,95 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol +open Alpha_context + +(** {2 Types for L2 block and header} *) + +(** Hash with b58check encoding BTx(53), for hashes of L2 block headers *) +module Hash : Tezos_crypto.S.HASH + +(** Alias for block (header) hashes *) +type hash = Hash.t + +(** The level of an L2 block *) +type level = Tx_rollup_level.t + +(** Type of L2 block headers *) +type header = { + level : level; (** The level of the L2 block *) + tezos_block : Tezos_crypto.Block_hash.t; + (** The Tezos block on which this L2 block in anchored, i.e. the Tezos block + in which the inbox was sent *) + predecessor : hash option; (** The hash predecessor L2 block *) + context : Tx_rollup_l2_context_hash.t; + (** The hash of the context resulting of the application of the L2 block's inbox *) + commitment : Tx_rollup_commitment_hash.t; + (** The hash of the commitment for the inbox of this block *) +} + +(** L2 blocks are composed of a header and an inbox. The inbox contains the + actual messages. The hash in the block structure corresponds the hash of the + header. *) +type 'inbox block = { + hash : hash; + header : header; + inbox : 'inbox; + commitment : Tx_rollup_commitment.Full.t; +} + +type t = Inbox.t block + +type commitment_included_info = { + block : Tezos_crypto.Block_hash.t; + operation : Tezos_crypto.Operation_hash.t; +} + +(** Metadata for the block *) +type metadata = { + commitment_included : commitment_included_info option; + (** Contains information if the commitment for this block has been included on L1 *) + finalized : bool; + (** Flag to signal if the commitment for this block is finalized on L1 *) +} + +(** {2 Encoding} *) + +val level_encoding : level Data_encoding.t + +val level_to_string : level -> string + +val header_encoding : header Data_encoding.t + +val block_encoding : 'inbox Data_encoding.t -> 'inbox block Data_encoding.t + +val encoding : t Data_encoding.t + +val metadata_encoding : metadata Data_encoding.t + +(** {2 Hashing} *) + +(** Returns the hash of an L2 block header *) +val hash_header : header -> hash diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/node_config.ml b/src/proto_016_PtMumbai/lib_tx_rollup/node_config.ml new file mode 100644 index 000000000000..80c54b6d5647 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/node_config.ml @@ -0,0 +1,524 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +type mode = Observer | Accuser | Batcher | Maintenance | Operator | Custom + +type 'a purposed = { + operator : 'a; + submit_batch : 'a; + finalize_commitment : 'a; + remove_commitment : 'a; + rejection : 'a; + dispatch_withdrawals : 'a; +} + +type signers = Tezos_crypto.Signature.public_key_hash option purposed + +type cost_caps = { + fee_cap : Protocol.Alpha_context.Tez.t; + burn_cap : Protocol.Alpha_context.Tez.t; +} + +type caps = cost_caps purposed + +type t = { + data_dir : string; + rollup_id : Protocol.Alpha_context.Tx_rollup.t; + origination_level : int32 option; + rpc_addr : P2p_point.Id.t; + cors_origins : string list; + cors_headers : string list; + reconnection_delay : float; + mode : mode; + signers : signers; + allow_deposit : bool; + l2_blocks_cache_size : int; + caps : caps; + batch_burn_limit : Protocol.Alpha_context.Tez.t option; +} + +let default_data_dir rollup_id = + let open Lwt_syntax in + let home = Sys.getenv "HOME" in + let dir = + ".tezos-tx-rollup-node-" + ^ Protocol.Alpha_context.Tx_rollup.to_b58check rollup_id + in + let dir = Filename.concat home dir in + let+ () = Lwt_utils_unix.create_dir dir in + dir + +let default_rpc_addr = (Ipaddr.V6.localhost, 9999) + +let default_reconnection_delay = 2.0 + +let default_l2_blocks_cache_size = 64 + +let modes = [Observer; Accuser; Batcher; Maintenance; Operator; Custom] + +let string_of_mode = function + | Observer -> "observer" + | Accuser -> "accuser" + | Batcher -> "batcher" + | Maintenance -> "maintenance" + | Operator -> "operator" + | Custom -> "custom" + +let mode_of_string = function + | "observer" -> Ok Observer + | "accuser" -> Ok Accuser + | "batcher" -> Ok Batcher + | "maintenance" -> Ok Maintenance + | "operator" -> Ok Operator + | "custom" -> Ok Custom + | _ -> Error [Exn (Failure "Invalid mode")] + +let mode_encoding = + Data_encoding.string_enum + [ + ("observer", Observer); + ("accuser", Accuser); + ("batcher", Batcher); + ("maintenance", Maintenance); + ("operator", Operator); + ("custom", Custom); + ] + +let tez t = Tez.of_mutez_exn Int64.(mul (of_int t) 1_000_000L) + +let default_cost_caps = {fee_cap = Tez.one; burn_cap = tez 2} + +let default_commitment_caps = {fee_cap = tez 2; burn_cap = tez 3} + +let default_submit_batch_caps = {fee_cap = tez 5; burn_cap = tez 5} + +let default_finalize_commitment_caps = default_cost_caps + +let default_remove_commitment_caps = default_cost_caps + +let default_rejection_caps = {fee_cap = tez 10; burn_cap = tez 10} + +let default_dispatch_withdrawals_caps = {fee_cap = tez 2; burn_cap = tez 3} + +let default_caps = + { + operator = default_commitment_caps; + submit_batch = default_submit_batch_caps; + finalize_commitment = default_finalize_commitment_caps; + remove_commitment = default_remove_commitment_caps; + rejection = default_rejection_caps; + dispatch_withdrawals = default_dispatch_withdrawals_caps; + } + +let signers_encoding = + let open Data_encoding in + conv + (fun { + operator; + submit_batch; + finalize_commitment; + remove_commitment; + rejection; + dispatch_withdrawals; + } -> + ( operator, + submit_batch, + finalize_commitment, + remove_commitment, + rejection, + dispatch_withdrawals )) + (fun ( operator, + submit_batch, + finalize_commitment, + remove_commitment, + rejection, + dispatch_withdrawals ) -> + { + operator; + submit_batch; + finalize_commitment; + remove_commitment; + rejection; + dispatch_withdrawals; + }) + @@ obj6 + (opt + ~description:"The operator of the rollup (public key hash) if any" + "operator" + Tezos_crypto.Signature.Public_key_hash.encoding) + (opt + "submit_batch" + Tezos_crypto.Signature.Public_key_hash.encoding + ~description:"The public key hash of the signer for batch submission") + (opt + "finalize_commitment" + Tezos_crypto.Signature.Public_key_hash.encoding + ~description: + "The public key hash of the signer for finalization of commitments") + (opt + "remove_commitment" + Tezos_crypto.Signature.Public_key_hash.encoding + ~description: + "The public key hash of the signer for removals of commitments") + (opt + "rejection" + Tezos_crypto.Signature.Public_key_hash.encoding + ~description:"The public key hash of the signer for rejections") + (opt + "dispatch_withdrawals" + Tezos_crypto.Signature.Public_key_hash.encoding + ~description: + "The public key hash of the signer for the dispatch of withdrawals") + +let cost_caps_encoding = + let open Data_encoding in + conv + (fun {fee_cap; burn_cap} -> (fee_cap, burn_cap)) + (fun (fee_cap, burn_cap) -> {fee_cap; burn_cap}) + @@ obj2 (req "fee_cap" Tez.encoding) (req "burn_cap" Tez.encoding) + +let caps_encoding = + let open Data_encoding in + conv + (fun { + operator; + submit_batch; + finalize_commitment; + remove_commitment; + rejection; + dispatch_withdrawals; + } -> + ( operator, + submit_batch, + finalize_commitment, + remove_commitment, + rejection, + dispatch_withdrawals )) + (fun ( operator, + submit_batch, + finalize_commitment, + remove_commitment, + rejection, + dispatch_withdrawals ) -> + { + operator; + submit_batch; + finalize_commitment; + remove_commitment; + rejection; + dispatch_withdrawals; + }) + @@ obj6 + (dft + ~description:"The caps for the cost of commitment operations" + "commitment" + cost_caps_encoding + default_commitment_caps) + (dft + ~description:"The caps for the cost of submit batch operations" + "submit_batch" + cost_caps_encoding + default_submit_batch_caps) + (dft + ~description:"The caps for the cost of finalize commitment operations" + "finalized_commitment" + cost_caps_encoding + default_finalize_commitment_caps) + (dft + ~description:"The caps for the cost of remove commitment operations" + "remove_commitment" + cost_caps_encoding + default_remove_commitment_caps) + (dft + ~description:"The caps for the cost of rejection operations" + "rejection" + cost_caps_encoding + default_rejection_caps) + (dft + ~description: + "The caps for the cost of dispatch withdrawals operations" + "dispatch_withdrawals" + cost_caps_encoding + default_dispatch_withdrawals_caps) + +let encoding data_dir = + let open Data_encoding in + conv + (fun { + data_dir = _; + rollup_id; + origination_level; + rpc_addr; + cors_origins; + cors_headers; + reconnection_delay; + mode; + signers; + allow_deposit; + l2_blocks_cache_size; + caps; + batch_burn_limit; + } -> + ( ( (), + rollup_id, + origination_level, + rpc_addr, + reconnection_delay, + mode, + signers, + allow_deposit, + l2_blocks_cache_size, + caps ), + (batch_burn_limit, cors_origins, cors_headers) )) + (fun ( ( (), + rollup_id, + origination_level, + rpc_addr, + reconnection_delay, + mode, + signers, + allow_deposit, + l2_blocks_cache_size, + caps ), + (batch_burn_limit, cors_origins, cors_headers) ) -> + { + data_dir; + rollup_id; + origination_level; + rpc_addr; + cors_origins; + cors_headers; + reconnection_delay; + mode; + signers; + allow_deposit; + l2_blocks_cache_size; + caps; + batch_burn_limit; + }) + @@ merge_objs + (obj10 + (dft + ~description: + "Location where the rollup node data (store, context, etc.) is \ + stored" + "data_dir" + (constant data_dir) + ()) + (req + ~description:"Rollup id of the rollup to target" + "rollup_id" + Protocol.Alpha_context.Tx_rollup.encoding) + (opt + ~description:"Level of the block where the rollup was originated" + "origination_level" + int32) + (dft + ~description:"RPC address on which the rollup node listens" + "rpc_addr" + P2p_point.Id.encoding + default_rpc_addr) + (dft + ~description: + "The reconnection (to the tezos node) delay in seconds" + "reconnection_delay" + float + default_reconnection_delay) + (req + ~description:"The mode for this rollup node" + "mode" + mode_encoding) + (req + ~description:"The signers for the various tx rollup operations" + "signers" + signers_encoding) + (dft + ~description: + "Allow the operator to make a first deposit for commitments" + "allow_deposit" + bool + false) + (dft + ~description:"The size of the L2 block cache in number of blocks" + "l2_blocks_cache_size" + int31 + default_l2_blocks_cache_size) + (dft + ~description:"The cost caps for the injection of operations" + "caps" + caps_encoding + default_caps)) + (obj3 + (opt + ~description: + "The burn limit in for a batch (to be paid for the submission \ + of messages in the protocol inbox)" + "batch_burn_limit" + Tez.encoding) + (dft + ~description: + "CORS origin allowed by the RPC server via \ + Access-Control-Allow-Origin" + "cors-origins" + (list string) + []) + (dft + ~description: + "Headers reported by Access-Control-Allow-Headers reported \ + during CORS" + "cors-headers" + (list string) + [])) + +let get_configuration_filename data_dir = + let filename = "config.json" in + Filename.concat data_dir filename + +module SigKindSet = struct + include Set.Make (struct + type t = + [ `operator + | `submit_batch + | `finalize_commitment + | `remove_commitment + | `rejection + | `dispatch_withdrawals ] + + let compare = Stdlib.compare + end) + + let elt_to_string = function + | `operator -> "operator" + | `submit_batch -> "submit_batch" + | `finalize_commitment -> "finalize_commitment" + | `remove_commitment -> "remove_commitment" + | `rejection -> "rejection" + | `dispatch_withdrawals -> "dispatch_withdrawals" + + let to_string_list s = elements s |> List.map elt_to_string +end + +let check_mode config = + let with_signers signers = + let config_signers = + let add signer name acc = + Option.fold ~none:acc ~some:(fun _ -> SigKindSet.add name acc) signer + in + SigKindSet.empty + |> add config.signers.operator `operator + |> add config.signers.submit_batch `submit_batch + |> add config.signers.finalize_commitment `finalize_commitment + |> add config.signers.remove_commitment `remove_commitment + |> add config.signers.rejection `rejection + |> add config.signers.dispatch_withdrawals `dispatch_withdrawals + in + let signers = SigKindSet.of_list signers in + if SigKindSet.equal config_signers signers then Ok config + else + let missing_signers = + SigKindSet.(diff signers config_signers |> to_string_list) + in + if missing_signers <> [] then + let mode = string_of_mode config.mode in + Error [Error.Tx_rollup_missing_mode_signers {mode; missing_signers}] + else + let extra_signers = SigKindSet.(diff config_signers signers) in + let remove kind signers = + match kind with + | `operator -> {signers with operator = None} + | `submit_batch -> {signers with submit_batch = None} + | `finalize_commitment -> {signers with finalize_commitment = None} + | `remove_commitment -> {signers with remove_commitment = None} + | `rejection -> {signers with rejection = None} + | `dispatch_withdrawals -> {signers with dispatch_withdrawals = None} + in + let signers = SigKindSet.fold remove extra_signers config.signers in + Ok {config with signers} + in + match config.mode with + | Observer -> with_signers [] + | Accuser -> with_signers [`rejection] + | Batcher -> with_signers [`submit_batch] + | Maintenance -> + with_signers + [ + `operator; + `finalize_commitment; + `remove_commitment; + `rejection; + `dispatch_withdrawals; + ] + | Operator -> + with_signers + [ + `operator; + `submit_batch; + `finalize_commitment; + `remove_commitment; + `rejection; + `dispatch_withdrawals; + ] + | Custom -> Ok config + +let save ~force configuration = + let open Lwt_result_syntax in + let json = + Data_encoding.Json.construct (encoding configuration.data_dir) configuration + in + let*! () = Lwt_utils_unix.create_dir configuration.data_dir in + let file = get_configuration_filename configuration.data_dir in + let*! exists = Lwt_unix.file_exists file in + let* () = + fail_when + (exists && not force) + (Error.Tx_rollup_configuration_file_already_exists file) + in + let*! v = + Lwt_utils_unix.with_atomic_open_out file (fun chan -> + let content = Data_encoding.Json.to_string json in + Lwt_utils_unix.write_string chan content) + in + let* () = + Lwt.return + (Result.map_error + (fun _ -> [Error.Tx_rollup_unable_to_write_configuration_file file]) + v) + in + return file + +let load ~data_dir = + let open Lwt_result_syntax in + let file = get_configuration_filename data_dir in + let*! exists = Lwt_unix.file_exists file in + let* () = + fail_unless exists (Error.Tx_rollup_configuration_file_does_not_exists file) + in + let* json = Lwt_utils_unix.Json.read_file file in + let config = Data_encoding.Json.destruct (encoding data_dir) json in + return config diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/node_config.mli b/src/proto_016_PtMumbai/lib_tx_rollup/node_config.mli new file mode 100644 index 000000000000..31a006cc418c --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/node_config.mli @@ -0,0 +1,113 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* TODO: https://gitlab.com/tezos/tezos/-/issues/2458 + Provide a default configuration +*) + +(** Mode for the rollup node *) +type mode = + | Observer (** Only follows the chain and reconstructs L2 blocks *) + | Accuser (** Follows the chain and rejects bad commitments *) + | Batcher (** Accept transactions in its queue and batches them on the L1 *) + | Maintenance + (** Follows the chain and injects commitments (and rejects bad ones) *) + | Operator (** Equivalent to maintenance + batcher *) + | Custom + (** This mode allows to tweak which operations are injected by selecting the + signers *) + +type 'a purposed = { + operator : 'a; + submit_batch : 'a; + finalize_commitment : 'a; + remove_commitment : 'a; + rejection : 'a; + dispatch_withdrawals : 'a; +} + +type signers = Tezos_crypto.Signature.public_key_hash option purposed + +type cost_caps = { + fee_cap : Protocol.Alpha_context.Tez.t; + burn_cap : Protocol.Alpha_context.Tez.t; +} + +type caps = cost_caps purposed + +type t = { + data_dir : string; + rollup_id : Protocol.Alpha_context.Tx_rollup.t; + origination_level : int32 option; + rpc_addr : P2p_point.Id.t; + cors_origins : string list; + cors_headers : string list; + reconnection_delay : float; + mode : mode; + signers : signers; + allow_deposit : bool; + l2_blocks_cache_size : int; + caps : caps; + batch_burn_limit : Protocol.Alpha_context.Tez.t option; +} + +(** [default_data_dir] creates and returns the default value for [data_dir]. *) +val default_data_dir : Protocol.Alpha_context.Tx_rollup.t -> string Lwt.t + +(** [default_rpc_addr] is the default value for [rpc_addr]. *) +val default_rpc_addr : P2p_point.Id.t + +(** [default_reconnection_delay] is the default value for [reconnection-delay] *) +val default_reconnection_delay : float + +(** [default_l2_blocks_cache_size] is the default number of L2 blocks that are + cached by the rollup node *) +val default_l2_blocks_cache_size : int + +(** The default fees/burn caps *) +val default_cost_caps : cost_caps + +(** The default fees/burn caps for operations of the injector *) +val default_caps : caps + +val modes : mode list + +val string_of_mode : mode -> string + +val mode_of_string : string -> mode tzresult + +(** [check_mode config] ensures the signers correspond to the chosen mode and + removes the extra ones. *) +val check_mode : t -> t tzresult + +(** [save ~force configuration] writes the [configuration] file and returns the + filename. If [force] is [true] then configuration is overwritten when it + exists. *) +val save : force:bool -> t -> string tzresult Lwt.t + +(** [load ~data_dir] loads a configuration stored in [data_dir]. *) +val load : data_dir:string -> t tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/node_data.ml b/src/proto_016_PtMumbai/lib_tx_rollup/node_data.ml new file mode 100644 index 000000000000..d37357ea1a02 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/node_data.ml @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Filename.Infix + +type t = string + +let store_dir data_dir = data_dir // "store" + +let context_dir data_dir = data_dir // "context" + +let l2blocks_index data_dir = store_dir data_dir // "l2blocks_index" + +let l2blocks_data data_dir = store_dir data_dir // "l2blocks_data" + +let tezos_blocks_index data_dir = store_dir data_dir // "tezos_blocks_index" + +let commitments_index data_dir = store_dir data_dir // "commitments_index" + +let levels_index data_dir = store_dir data_dir // "levels_index" + +let head_file data_dir = store_dir data_dir // "head" + +let mkdir ?(perm = 0o777) dir = + let open Lwt_syntax in + let* b = Lwt_unix.file_exists dir in + match b with false -> Lwt_unix.mkdir dir perm | true -> Lwt.return_unit + +let mk_store_dir ?perm data_dir = mkdir ?perm (store_dir data_dir) + +let mk_context_dir ?perm data_dir = mkdir ?perm (context_dir data_dir) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.ml b/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.ml new file mode 100644 index 000000000000..ffab8478891d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.ml @@ -0,0 +1,50 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Prover_apply = Protocol.Tx_rollup_l2_apply.Make (Context.Prover_context) + +type proof = Protocol.Tx_rollup_l2_proof.t + +let proof_size proof = + (* The 4 additional bytes are added by data-encoding when we + “re-encode” the proof as raw bytes. We need to take these 4 bytes + into account in the unlikely scenario where they are enough to + cross the limit. *) + 4 + Data_encoding.Binary.length Protocol.Tx_rollup_l2_proof.encoding proof + +let apply_message ctxt parameters message = + let open Lwt_result_syntax in + let f tree = + Context.Prover_context.Syntax.catch + (Prover_apply.apply_message tree parameters message) + (fun (tree, result) -> + Lwt.return Context.{tree; result = Inbox.Interpreted result}) + (fun err -> + Lwt.return + Context. + {tree; result = Inbox.Discarded [Environment.wrap_tzerror err]}) + in + let* proof, result = Context.produce_proof ctxt f in + return (proof, result) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.mli b/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.mli new file mode 100644 index 000000000000..f951e5cd33a2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/prover_apply.mli @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type proof = Protocol.Tx_rollup_l2_proof.t + +val proof_size : proof -> int + +(** [apply_message ctxt parameters message] applies [message] on [ctxt] + using [parameters]. + + It uses internally the {!Context.Prover_context} to generate the associated + proof of the application. + + The modified prover context state is returned and can be either dropped or + committed. Note that if the underlying tree is meant to be kept, it + must be committed on disk, no others proofs can be generated on a + non-persistent tree. +*) +val apply_message : + Context.context -> + Protocol.Tx_rollup_l2_apply.parameters -> + Protocol.Alpha_context.Tx_rollup_message.t -> + (proof * Inbox.message_result Context.produce_proof_result) tzresult Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/state.ml b/src/proto_016_PtMumbai/lib_tx_rollup/state.ml new file mode 100644 index 000000000000..ac7fc5caf9f2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/state.ml @@ -0,0 +1,392 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context +open Protocol_client_context +open Injector_common +module Tezos_blocks_cache = + Aches_lwt.Lache.Make_option + (Aches.Rache.Transfer (Aches.Rache.LRU) (Tezos_crypto.Block_hash)) + +type rollup_info = Stores.rollup_info = { + rollup_id : Tx_rollup.t; + origination_level : int32 option; +} + +type sync_levels = {processed_tezos_level : int32; known_tezos_level : int32} + +type sync_info = { + mutable synchronized : bool; + on_synchronized : unit Lwt_condition.t; + mutable current_levels : sync_levels; + sync_level_input : sync_levels Lwt_watcher.input; +} + +type t = { + stores : Stores.t; + cctxt : Protocol_client_context.full; + context_index : Context.index; + mutable head : L2block.t option; + rollup_info : rollup_info; + tezos_blocks_cache : Alpha_block_services.block_info Tezos_blocks_cache.t; + constants : Constants.t; + signers : Node_config.signers; + caps : Node_config.caps; + sync : sync_info; +} + +(* Stands for the manager operation pass, in which the rollup transactions are + stored. *) +let rollup_operation_index = 3 + +let get_head state = state.head + +let fetch_tezos_block state hash = + trace (Error.Tx_rollup_cannot_fetch_tezos_block hash) + @@ fetch_tezos_block state.cctxt hash ~find_in_cache:(fun h mk -> + Tezos_blocks_cache.bind_or_put state.tezos_blocks_cache h mk Lwt.return) + +let set_tezos_head state new_head_hash = + let open Lwt_result_syntax in + let*! old_head_hash = Stores.Tezos_head_store.read state.stores.tezos_head in + let* reorg = + match old_head_hash with + | None -> + (* No known tezos head, consider the new head as being on top of a previous + tezos block. *) + let+ new_head = fetch_tezos_block state new_head_hash in + {old_chain = []; new_chain = [new_head]} + | Some old_head_hash -> + tezos_reorg (fetch_tezos_block state) ~old_head_hash ~new_head_hash + in + let* () = + Stores.Tezos_head_store.write state.stores.tezos_head new_head_hash + in + return reorg + +let get_tezos_head state = + let open Lwt_result_syntax in + let*! block = Stores.Tezos_head_store.read state.stores.tezos_head in + match block with + | None -> return None + | Some block -> + let+ block = fetch_tezos_block state block in + Some block + +let save_tezos_block_info state block l2_block ~level ~predecessor = + Stores.Tezos_block_store.add + state.stores.tezos_blocks + block + {Stores.Tezos_block_store.l2_block; level; predecessor} + +let get_tezos_l2_block_hash state block = + let open Lwt_syntax in + let+ info = Stores.Tezos_block_store.find state.stores.tezos_blocks block in + Option.bind info (fun i -> i.Stores.Tezos_block_store.l2_block) + +let get_block_store stores hash = + Stores.L2_block_store.read_block stores.Stores.blocks hash + +let get_block state hash = get_block_store state.stores hash + +let get_header state hash = + let open Lwt_syntax in + let+ block = get_block state hash in + Option.map (fun b -> b.L2block.header) block + +let save_block state block = + Stores.L2_block_store.append_block state.stores.blocks block + +let get_inbox state hash = + let open Lwt_syntax in + let+ block = get_block state hash in + Option.map (fun b -> b.L2block.inbox) block + +let get_tezos_l2_block state block = + let open Lwt_syntax in + let* l2_hash = get_tezos_l2_block_hash state block in + match l2_hash with + | None -> return None + | Some l2_hash -> get_block state l2_hash + +let get_level state level = Stores.Level_store.find state.stores.levels level + +let save_level state level hash = + Stores.Level_store.add state.stores.levels level hash + +let get_level_l2_block_header state level = + let open Lwt_syntax in + let* l2_hash = get_level state level in + match l2_hash with + | None -> return None + | Some l2_hash -> get_header state l2_hash + +let get_level_l2_block state level = + let open Lwt_syntax in + let* l2_hash = get_level state level in + match l2_hash with + | None -> return None + | Some l2_hash -> get_block state l2_hash + +let save_block state (block : L2block.t) = + let open Lwt_syntax in + join [save_level state block.header.level block.hash; save_block state block] + +let distance_l2_levels l1 l2 = + Int32.sub (Tx_rollup_level.to_int32 l2) (Tx_rollup_level.to_int32 l1) + +(* Compute the reorganization of L2 blocks from the chain whose head is + [old_head_hash] and the chain whose head [new_head_hash]. *) +let rollup_reorg state ~old_head ~new_head = + let open Lwt_syntax in + let get_pred b = + match b.L2block.header.predecessor with + | None -> Lwt.return_none + | Some b -> get_block state b + in + let rec loop old_chain new_chain old_head new_head = + match (old_head, new_head) with + | None, _ | _, None -> + return {old_chain = List.rev old_chain; new_chain = List.rev new_chain} + | Some old_head, Some new_head -> + if L2block.Hash.(old_head.L2block.hash = new_head.L2block.hash) then + return + {old_chain = List.rev old_chain; new_chain = List.rev new_chain} + else + let diff = + distance_l2_levels + old_head.L2block.header.level + new_head.L2block.header.level + in + let* old_chain, new_chain, old, new_ = + if diff = 0l then + (* Heads at same level *) + let new_chain = new_head :: new_chain in + let old_chain = old_head :: old_chain in + let* new_head = get_pred new_head in + let+ old_head = get_pred old_head in + (old_chain, new_chain, old_head, new_head) + else if diff > 0l then + (* New chain is longer *) + let new_chain = new_head :: new_chain in + let+ new_head = get_pred new_head in + (old_chain, new_chain, Some old_head, new_head) + else + (* Old chain was longer *) + let old_chain = old_head :: old_chain in + let+ old_head = get_pred old_head in + (old_chain, new_chain, old_head, Some new_head) + in + loop old_chain new_chain old new_ + in + loop [] [] (Some old_head) (Some new_head) + +let patch_l2_levels state (reorg : L2block.t reorg) = + let open Lwt_result_syntax in + let*! () = + List.iter_s + (fun old -> + Stores.Level_store.remove state.stores.levels old.L2block.header.level) + reorg.old_chain + in + List.iter_s + (fun new_ -> save_level state new_.L2block.header.level new_.L2block.hash) + reorg.new_chain + +let set_head state head = + let open Lwt_result_syntax in + state.head <- Some head ; + let*! old_head = Stores.Head_store.read state.stores.head in + let hash = head.L2block.hash in + let* () = Stores.Head_store.write state.stores.head hash in + let*! l2_reorg = + match old_head with + | None -> Lwt.return no_reorg + | Some old_head_hash -> ( + let*! old_head = get_block state old_head_hash in + match old_head with + | None -> Lwt.return no_reorg + | Some old_head -> rollup_reorg state ~old_head ~new_head:head) + in + let*! () = patch_l2_levels state l2_reorg in + return l2_reorg + +let tezos_block_already_processed state block = + let open Lwt_syntax in + let* info = Stores.Tezos_block_store.find state.stores.tezos_blocks block in + match info with + | None -> return `Unknown + | Some {l2_block = None; _} -> return (`Known None) + | Some {l2_block = Some l2_hash; _} -> + let+ block = get_block state l2_hash in + `Known block + +let get_included_commitment state commitment_hash = + let open Lwt_syntax in + let+ info = + Stores.Commitment_store.find state.stores.commitments commitment_hash + in + Option.map + (fun Stores.Commitment_store.{block; operation} -> + L2block.{block; operation}) + info + +let set_commitment_included state commitment_hash block operation = + Stores.Commitment_store.add + state.stores.commitments + commitment_hash + Stores.Commitment_store.{block; operation} + +let unset_commitment_included state commitment_hash = + Stores.Commitment_store.remove state.stores.commitments commitment_hash + +let get_finalized_level state = + Stores.Finalized_level_store.read state.stores.finalized_level + +let set_finalized_level state l = + Stores.Finalized_level_store.write state.stores.finalized_level l + +let delete_finalized_level state = + Stores.Finalized_level_store.delete state.stores.finalized_level + +let get_block_metadata state (header : L2block.header) = + let open Lwt_syntax in + let* commitment_included = get_included_commitment state header.commitment in + let+ finalized_level = get_finalized_level state in + let finalized = + match finalized_level with + | None -> false + | Some l -> Tx_rollup_level.(header.level <= l) + in + L2block.{commitment_included; finalized} + +let get_block_and_metadata state hash = + let open Lwt_syntax in + let* block = get_block state hash in + match block with + | None -> return_none + | Some block -> + let* metadata = get_block_metadata state block.header in + return_some (block, metadata) + +let set_rollup_info state rollup_id ~origination_level = + let rollup_info = {rollup_id; origination_level = Some origination_level} in + Stores.Rollup_info_store.write state.stores.Stores.rollup_info rollup_info + +let init_rollup_info stores ?origination_level rollup_id = + let open Lwt_result_syntax in + let*! stored_info = Stores.Rollup_info_store.read stores.Stores.rollup_info in + let* rollup_info = + match stored_info with + | Some stored when Tx_rollup.(stored.rollup_id <> rollup_id) -> + fail [Error.Tx_rollup_mismatch] + | Some stored -> return stored + | None -> + let rollup_info = {rollup_id; origination_level} in + let* () = + Stores.Rollup_info_store.write stores.rollup_info rollup_info + in + return rollup_info + in + return rollup_info + +let init_context ~data_dir = + let open Lwt_result_syntax in + let*! index = Context.init (Node_data.context_dir data_dir) in + return index + +let read_head (stores : Stores.t) = + let open Lwt_syntax in + let* hash = Stores.Head_store.read stores.head in + match hash with + | None -> return_none + | Some hash -> get_block_store stores hash + +let retrieve_constants cctxt = + Protocol.Constants_services.all cctxt (cctxt#chain, cctxt#block) + +let init (cctxt : #Protocol_client_context.full) ?(readonly = false) + configuration = + let open Lwt_result_syntax in + let { + Node_config.data_dir; + rollup_id; + origination_level; + signers; + l2_blocks_cache_size; + caps; + _; + } = + configuration + in + let*! stores = + Stores.init ~data_dir ~readonly ~blocks_cache_size:l2_blocks_cache_size + in + let* rollup_info, context_index = + both + (init_rollup_info stores ?origination_level rollup_id) + (init_context ~data_dir) + |> lwt_map_error (function [] -> [] | trace :: _ -> trace) + in + let*! head = read_head stores in + let* constants = retrieve_constants cctxt in + (* L1 blocks are cached to handle reorganizations efficiently *) + let tezos_blocks_cache = Tezos_blocks_cache.create 32 in + let sync = + { + synchronized = false; + on_synchronized = Lwt_condition.create (); + current_levels = {processed_tezos_level = 0l; known_tezos_level = 0l}; + sync_level_input = Lwt_watcher.create_input (); + } + in + return + { + stores; + cctxt = (cctxt :> Protocol_client_context.full); + context_index; + head; + rollup_info; + tezos_blocks_cache; + constants; + signers; + caps; + sync; + } + +let notify_processed_tezos_level state processed_tezos_level = + state.sync.current_levels <- + {state.sync.current_levels with processed_tezos_level} ; + Lwt_watcher.notify state.sync.sync_level_input state.sync.current_levels + +let set_known_tezos_level state known_tezos_level = + state.sync.current_levels <- + {state.sync.current_levels with known_tezos_level} + +let synchronized state = + if state.sync.synchronized then Lwt.return_unit + else Lwt_condition.wait state.sync.on_synchronized diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/state.mli b/src/proto_016_PtMumbai/lib_tx_rollup/state.mli new file mode 100644 index 000000000000..dd73a1ce51f6 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/state.mli @@ -0,0 +1,224 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Protocol.Alpha_context +open Protocol_client_context +open Injector_common + +(** The RPC server and the Daemon main loop are sharing a variable of the + type stored in the Irmin store. The [State] module allows access to this stored + data. *) + +module Tezos_blocks_cache : + Aches_lwt.Lache.MAP_OPTION with type key = Tezos_crypto.Block_hash.t + +(** Information about the rollup that is kept in the state. *) +type rollup_info = Stores.rollup_info = { + rollup_id : Tx_rollup.t; + origination_level : int32 option; +} + +type sync_levels = {processed_tezos_level : int32; known_tezos_level : int32} + +type sync_info = { + mutable synchronized : bool; + on_synchronized : unit Lwt_condition.t; + mutable current_levels : sync_levels; + sync_level_input : sync_levels Lwt_watcher.input; +} + +type t = private { + stores : Stores.t; + cctxt : Protocol_client_context.full; + context_index : Context.index; + mutable head : L2block.t option; + rollup_info : rollup_info; + tezos_blocks_cache : Alpha_block_services.block_info Tezos_blocks_cache.t; + constants : Constants.t; + signers : Node_config.signers; + caps : Node_config.caps; + sync : sync_info; +} + +(** [init cctxt config] creates a new state for the rollup node with a new store + and context. If the [rollup_genesis] block hash is provided in [config], + checks that the rollup [rollup_id] is created inside the block identified by + the hash. Otherwise, the genesis information is read from the disk. Note that + if a [rollup_genesis] is provided, it must also match the one on disk. L2 + block are cached (controlled by l2_blocks_cache_size) for performance + improvements w.r.t. access to the store. *) +val init : + #Protocol_client_context.full -> + ?readonly:bool -> + Node_config.t -> + t tzresult Lwt.t + +(** {2 Reading the state from disk} *) + +(** Retrieve the current head of the rollup. Note that the current head can go + in the past or change in case of reorganisations at the L1 layer. *) +val get_head : t -> L2block.t option + +val get_tezos_head : t -> Alpha_block_services.block_info option tzresult Lwt.t + +(** Retrieve an L2 block by its hash *) +val get_block : t -> L2block.hash -> L2block.t option Lwt.t + +(** Retrieve the block hash associated to a given level in the current + chain. Note that levels can be reaffected in case of reorganisation at the L1 + layer. *) +val get_level : t -> L2block.level -> L2block.hash option Lwt.t + +(** Retrieve an inbox associated to an L2 block *) +val get_inbox : t -> L2block.hash -> Inbox.t option Lwt.t + +(** Retrieve the header of an L2 block *) +val get_header : t -> L2block.hash -> L2block.header option Lwt.t + +(** Retrieve the L2 block hash corresponding to the given Tezos block. When + there is no inbox for an L1 block, we associate to it the L2 block of its + predecessor. So [get_tezos_l2_block_hash state h] returns L2 block hash at + which the rollup was when the Tezos node was at block [h]. *) +val get_tezos_l2_block_hash : + t -> Tezos_crypto.Block_hash.t -> L2block.hash option Lwt.t + +(** Same as {!get_tezos_block} but retrieves the associated L2 block at the same time. *) +val get_tezos_l2_block : + t -> Tezos_crypto.Block_hash.t -> L2block.t option Lwt.t + +(** Same as {!get_level} but retrieves the associated header at the same time. *) +val get_level_l2_block_header : + t -> L2block.level -> L2block.header option Lwt.t + +(** Same as {!get_level} but retrieves the associated L2 block at the same time. *) +val get_level_l2_block : t -> L2block.level -> L2block.t option Lwt.t + +(** Returns [`Known block] if the Tezos block was already processed by the + rollup node where [block] is either [Some l2_block], when there is an L2 + block for the Tezos block, or [None] otherwise. It returns [`Unknown] when + the Tezos block has never been processed. *) +val tezos_block_already_processed : + t -> + Tezos_crypto.Block_hash.t -> + [> `Known of L2block.t option | `Unknown] Lwt.t + +(** Returns the inclusion info for a commitment. *) +val get_included_commitment : + t -> + Tx_rollup_commitment_hash.t -> + L2block.commitment_included_info option Lwt.t + +(** Returns the last finalized (on L1) rollup level. *) +val get_finalized_level : t -> Tx_rollup_level.t option Lwt.t + +(** Retrieve an L2 block metadata from its header *) +val get_block_metadata : t -> L2block.header -> L2block.metadata Lwt.t + +(** Retrieve an L2 block and associated metadata by its hash *) +val get_block_and_metadata : + t -> L2block.hash -> (L2block.t * L2block.metadata) option Lwt.t + +(** {2 Saving the state to disk} *) + +(** Set the current head of the rollup and return the blocks (hashes) that were + reorganized. *) +val set_head : t -> L2block.t -> L2block.t reorg tzresult Lwt.t + +(** Set the Tezos head and returns the reorganization of L1 blocks. *) +val set_tezos_head : + t -> + Tezos_crypto.Block_hash.t -> + Alpha_block_services.block_info reorg tzresult Lwt.t + +(** Save an L2 block to disk: + - Save both the header and the inbox + - Make the level point to this block + *) +val save_block : t -> L2block.t -> unit Lwt.t + +(** Make a level point to a given L2 block. If the level already points to a + block, it is changed. *) +val save_level : t -> L2block.level -> L2block.hash -> unit Lwt.t + +(** Associate an L2 block to a Tezos block, and register its level and + predecessor as well. *) +val save_tezos_block_info : + t -> + Tezos_crypto.Block_hash.t -> + L2block.hash option -> + level:int32 -> + predecessor:Tezos_crypto.Block_hash.t -> + unit Lwt.t + +(** Register a commitment as included on L1. *) +val set_commitment_included : + t -> + Tx_rollup_commitment_hash.t -> + Tezos_crypto.Block_hash.t -> + Tezos_crypto.Operation_hash.t -> + unit Lwt.t + +(** Register a commitment as not included on L1. *) +val unset_commitment_included : t -> Tx_rollup_commitment_hash.t -> unit Lwt.t + +(** Register the last finalized (on L1) rollup level. *) +val set_finalized_level : t -> Tx_rollup_level.t -> unit tzresult Lwt.t + +(** Delete the last finalized (on L1) rollup level. *) +val delete_finalized_level : t -> unit Lwt.t + +(** Register the origination level of the rollup for this node. *) +val set_rollup_info : + t -> Tx_rollup.t -> origination_level:int32 -> unit tzresult Lwt.t + +(** {2 Misc} *) + +(** [rollup_operation_index] returns the index in which the rollup operation are + stored into a [Block_info.t]. Currently, the manager operation validation + pass is used. *) +val rollup_operation_index : int + +(** Fetch a Tezos block from the cache or the node *) +val fetch_tezos_block : + t -> + Tezos_crypto.Block_hash.t -> + Alpha_block_services.block_info tzresult Lwt.t + +(** Compute the reorganization of L2 blocks from the chain whose head is + [old_head_hash] and the chain whose head [new_head_hash]. *) +val rollup_reorg : + t -> old_head:L2block.t -> new_head:L2block.t -> L2block.t reorg Lwt.t + +(** [synchronized state] is a promise that resolves when the rollup node whose + state is [state] is synchronized with L1. If the node is already + synchronized, it resolves immediately. *) +val synchronized : t -> unit Lwt.t + +(** Notify the processed Tezos level to watchers on the sync_levels input. *) +val notify_processed_tezos_level : t -> int32 -> unit + +(** Set the latest known Tezos level but do not notify sync levels input. *) +val set_known_tezos_level : t -> int32 -> unit diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/stores.ml b/src/proto_016_PtMumbai/lib_tx_rollup/stores.ml new file mode 100644 index 000000000000..7687f5fbf552 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/stores.ml @@ -0,0 +1,809 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type error += Cannot_encode_block of L2block.hash + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_encode_block" + ~title:"An L2 block cannot be encoded" + ~description:"An L2 block cannot be encoded to be stored on disk." + ~pp:(fun ppf b -> + Format.fprintf + ppf + "The L2 block %a cannot be encoded to be stored on disk." + L2block.Hash.pp + b) + `Permanent + Data_encoding.(obj1 (req "block" L2block.Hash.encoding)) + (function Cannot_encode_block b -> Some b | _ -> None) + (fun b -> Cannot_encode_block b) + +type error += Cannot_encode_data of string + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_encode_data" + ~title:"Data cannot be encoded" + ~description:"Data cannot be encoded to be stored on disk." + ~pp:(fun ppf name -> + Format.fprintf ppf "Data %s cannot be encoded to be stored on disk." name) + `Permanent + Data_encoding.(obj1 (req "name" string)) + (function Cannot_encode_data n -> Some n | _ -> None) + (fun n -> Cannot_encode_data n) + +type error += Cannot_write_file of string + +let () = + register_error_kind + ~id:"tx_rollup.node.cannot_write_file" + ~title:"File cannot be written" + ~description:"File cannot be written to disk." + ~pp:(fun ppf name -> + Format.fprintf ppf "File %s cannot be written to disk." name) + `Permanent + Data_encoding.(obj1 (req "name" string)) + (function Cannot_write_file n -> Some n | _ -> None) + (fun n -> Cannot_write_file n) + +(* Helper functions to copy byte sequences or integers in [src] to another byte + sequence [dst] at offset [offset], with named arguments to avoid + confusion. These functions return the offset in the destination at which to + copy the more data. *) + +let blit ~src ~dst offset = + let len = Bytes.length src in + Bytes.blit src 0 dst offset len ; + offset + len + +let bytes_set_int64 ~src ~dst offset = + Bytes.set_int64_be dst offset src ; + offset + 8 + +let bytes_set_int32 ~src ~dst offset = + Bytes.set_int32_be dst offset src ; + offset + 4 + +let bytes_set_int8 ~src ~dst offset = + Bytes.set_int8 dst offset src ; + offset + 1 + +(* Helper functions to read data (strings with a decoding function, or integers) + from a binary string. These functions return, as the second component, the + offset in the string at which to read more data. *) + +let read_str str ~offset ~len decode = + let s = String.sub str offset len in + (decode s, offset + len) + +let read_int64 str offset = + let i = TzEndian.get_int64_string str offset in + (i, offset + 8) + +let read_int32 str offset = + let i = TzEndian.get_int32_string str offset in + (i, offset + 4) + +let read_int8 str offset = + let i = TzEndian.get_int8_string str offset in + (i, offset + 1) + +(* Functors to build stores on indexes *) + +module type SINGLETON_STORE = sig + type t + + type value + + val read : t -> value option Lwt.t + + val write : t -> value -> unit tzresult Lwt.t + + val delete : t -> unit Lwt.t +end + +module type INDEXABLE_STORE = sig + type t + + type key + + type value + + val mem : t -> key -> bool Lwt.t + + val find : t -> key -> value option Lwt.t + + val add : ?flush:bool -> t -> key -> value -> unit Lwt.t +end + +module type INDEXABLE_REMOVABLE_STORE = sig + include INDEXABLE_STORE + + val remove : ?flush:bool -> t -> key -> unit Lwt.t +end + +module Make_indexable + (K : Index.Key.S) + (V : Index.Value.S) (P : sig + val path : data_dir:string -> string + end) = +struct + module I = Index_unix.Make (K) (V) (Index.Cache.Unbounded) + + type t = {index : I.t; scheduler : Lwt_idle_waiter.t} + + let log_size = 10_000 + + let mem store k = + Lwt_idle_waiter.task store.scheduler @@ fun () -> + Lwt.return (I.mem store.index k) + + let find store k = + let open Lwt_syntax in + Lwt_idle_waiter.task store.scheduler @@ fun () -> + Option.catch_os @@ fun () -> + let v = I.find store.index k in + return_some v + + let add ?(flush = true) store k v = + Lwt_idle_waiter.force_idle store.scheduler @@ fun () -> + I.replace store.index k v ; + if flush then I.flush store.index ; + Lwt.return_unit + + let init ~data_dir ~readonly = + let index = I.v ~log_size ~readonly (P.path ~data_dir) in + let scheduler = Lwt_idle_waiter.create () in + Lwt.return {index; scheduler} + + let close store = + Lwt_idle_waiter.force_idle store.scheduler @@ fun () -> + (try I.close store.index with Index.Closed -> ()) ; + Lwt.return_unit +end + +module Make_indexable_removable + (K : Index.Key.S) + (V : Index.Value.S) (P : sig + val path : data_dir:string -> string + end) = +struct + module V_opt = struct + (* The values stored in the index are optional values. When we "remove" a + key from the store, we're not really removing it from the index, but + simply setting its association to [None] (encoded with zero bytes here). + *) + + type t = V.t option + + let t = Repr.option V.t + + let encoded_size = 1 + V.encoded_size + + let encode v = + let dst = Bytes.create encoded_size in + let tag, value_bytes = + match v with + | None -> (0, Bytes.make V.encoded_size '\000') + | Some v -> (1, V.encode v |> Bytes.unsafe_of_string) + in + let offset = bytes_set_int8 ~dst ~src:tag 0 in + let _ = blit ~src:value_bytes ~dst offset in + Bytes.unsafe_to_string dst + + let decode str offset = + let tag, offset = read_int8 str offset in + match tag with + | 0 -> None + | 1 -> + let value = V.decode str offset in + Some value + | _ -> assert false + end + + include Make_indexable (K) (V_opt) (P) + + let find store k = + let open Lwt_syntax in + let+ v = find store k in + match v with None | Some None -> None | Some (Some v) -> Some v + + let mem store hash = + let open Lwt_syntax in + let+ b = find store hash in + Option.is_some b + + let add ?flush store k v = add ?flush store k (Some v) + + let remove ?(flush = true) store k = + Lwt_idle_waiter.force_idle store.scheduler @@ fun () -> + let exists = I.mem store.index k in + if not exists then Lwt.return_unit + else ( + I.replace store.index k None ; + if flush then I.flush store.index ; + Lwt.return_unit) +end + +module Make_singleton (S : sig + type t + + val name : string + + val encoding : t Data_encoding.t +end) = +struct + type t = {file : string} + + let read store = + let open Lwt_syntax in + let* exists = Lwt_unix.file_exists store.file in + match exists with + | false -> return_none + | true -> + Lwt_io.with_file + ~flags:[Unix.O_RDONLY; O_CLOEXEC] + ~mode:Input + store.file + @@ fun channel -> + let+ bytes = Lwt_io.read channel in + Data_encoding.Binary.of_bytes_opt + S.encoding + (Bytes.unsafe_of_string bytes) + + let write store x = + let open Lwt_result_syntax in + let*! res = + Lwt_utils_unix.with_atomic_open_out ~overwrite:true store.file + @@ fun fd -> + let* block_bytes = + match Data_encoding.Binary.to_bytes_opt S.encoding x with + | None -> tzfail (Cannot_encode_data S.name) + | Some bytes -> return bytes + in + let*! () = Lwt_utils_unix.write_bytes fd block_bytes in + return_unit + in + match res with + | Ok res -> Lwt.return res + | Error _ -> tzfail (Cannot_write_file S.name) + + let delete store = + let open Lwt_syntax in + let* exists = Lwt_unix.file_exists store.file in + match exists with + | false -> return_unit + | true -> Lwt_unix.unlink store.file + + let init ~data_dir = + let file = Filename.Infix.(Node_data.store_dir data_dir // S.name) in + Lwt.return {file} +end + +module L2_block_key = struct + include L2block.Hash + + (* [hash] in Tezos_crypto.Blake2B.Make is {!Stdlib.Hashtbl.hash} which is 30 bits *) + let hash_size = 30 (* in bits *) + + let t = + let open Repr in + map + (bytes_of (`Fixed hash_size)) + (fun b -> of_bytes_exn b) + (fun bh -> to_bytes bh) + + let encode bh = to_string bh + + let encoded_size = size (* in bytes *) + + let decode str off = + let str = String.sub str off encoded_size in + of_string_exn str +end + +module L2_level_key = struct + type t = L2block.level + + let to_int32 = Protocol.Alpha_context.Tx_rollup_level.to_int32 + + let of_int32 l = + WithExceptions.Result.get_ok ~loc:__LOC__ + @@ Protocol.Alpha_context.Tx_rollup_level.of_int32 l + + let t = + let open Repr in + map int32 of_int32 to_int32 + + let equal x y = Compare.Int32.equal (to_int32 x) (to_int32 y) + + let hash = Stdlib.Hashtbl.hash + + (* {!Stdlib.Hashtbl.hash} is 30 bits as per {!Index__.Data.Key} *) + let hash_size = 30 (* in bits *) + + let encoded_size = 4 (* in bytes *) + + let encode l = + let b = Bytes.create encoded_size in + TzEndian.set_int32 b 0 (to_int32 l) ; + Bytes.unsafe_to_string b + + let decode str i = TzEndian.get_int32_string str i |> of_int32 +end + +module Operation_key = struct + include Tezos_crypto.Operation_hash + + (* [hash] in Tezos_crypto.Blake2B.Make is {!Stdlib.Hashtbl.hash} which is 30 bits *) + let hash_size = 30 (* in bits *) + + let t = + let open Repr in + map + (bytes_of (`Fixed hash_size)) + (fun b -> of_bytes_exn b) + (fun bh -> to_bytes bh) +end + +module Commitment_key = struct + include Protocol.Alpha_context.Tx_rollup_commitment_hash + + let hash = Stdlib.Hashtbl.hash + + (* {!Stdlib.Hashtbl.hash} is 30 bits *) + let hash_size = 30 (* in bits *) + + let t = + let open Repr in + map + (bytes_of (`Fixed hash_size)) + (fun b -> of_bytes_exn b) + (fun bh -> to_bytes bh) + + let encode bh = Bytes.unsafe_to_string (to_bytes bh) + + let encoded_size = size (* in bytes *) + + let decode str off = + let str = String.sub str off encoded_size in + of_bytes_exn (Bytes.unsafe_of_string str) +end + +module L2_block_info = struct + type t = { + offset : int; + (* subset of L2 block header for efficiency *) + predecessor : L2block.hash option; + context : Protocol.Tx_rollup_l2_context_hash.t; + } + + let encoded_size = + 8 (* offset *) + L2block.Hash.size + Protocol.Tx_rollup_l2_context_hash.size + + let l2_context_hash_repr = + let open Repr in + map + (bytes_of (`Fixed 31)) + (fun c -> Protocol.Tx_rollup_l2_context_hash.of_bytes_exn c) + (fun ch -> Protocol.Tx_rollup_l2_context_hash.to_bytes ch) + + let t = + let open Repr in + map + (triple int (option L2_block_key.t) l2_context_hash_repr) + (fun (offset, predecessor, context) -> {offset; predecessor; context}) + (fun {offset; predecessor; context} -> (offset, predecessor, context)) + + let encode v = + let dst = Bytes.create encoded_size in + let offset = bytes_set_int64 ~src:(Int64.of_int v.offset) ~dst 0 in + let pred_bytes = + match v.predecessor with + | None -> L2block.Hash.(to_bytes zero) + | Some b -> L2block.Hash.to_bytes b + in + let offset = blit ~src:pred_bytes ~dst offset in + let _ = + blit + ~src:(Protocol.Tx_rollup_l2_context_hash.to_bytes v.context) + ~dst + offset + in + Bytes.unsafe_to_string dst + + let decode str offset = + let file_offset, offset = read_int64 str offset in + let predecessor, offset = + read_str str ~offset ~len:L2block.Hash.size L2block.Hash.of_string_exn + in + let predecessor = + if L2block.Hash.(predecessor = zero) then None else Some predecessor + in + let context, _ = + read_str + str + ~offset + ~len:Protocol.Tx_rollup_l2_context_hash.size + (fun s -> + Bytes.unsafe_of_string s + |> Protocol.Tx_rollup_l2_context_hash.of_bytes_exn) + in + {offset = Int64.to_int file_offset; predecessor; context} +end + +module Tezos_block_info = struct + type t = { + l2_block : L2block.hash option; + level : int32; + predecessor : Tezos_crypto.Block_hash.t; + } + + let t = + let open Repr in + map + (triple (option L2_block_key.t) int32 Tezos_store_shared.Block_key.t) + (fun (l2_block, level, predecessor) -> {l2_block; level; predecessor}) + (fun {l2_block; level; predecessor} -> (l2_block, level, predecessor)) + + let encoded_size = + L2block.Hash.size + 4 (* level *) + Tezos_crypto.Block_hash.size + + let encode v = + let dst = Bytes.create encoded_size in + let l2_block_bytes = + match v.l2_block with + | Some b -> L2block.Hash.to_bytes b + | None -> L2block.Hash.(to_bytes zero) + in + let offset = blit ~src:l2_block_bytes ~dst 0 in + let offset = bytes_set_int32 ~dst ~src:v.level offset in + let _ = + blit ~src:(Tezos_crypto.Block_hash.to_bytes v.predecessor) ~dst offset + in + Bytes.unsafe_to_string dst + + let decode str offset = + let l2_block, offset = + read_str str ~offset ~len:L2block.Hash.size @@ fun s -> + let block_hash = L2block.Hash.of_string_exn s in + if L2block.Hash.(block_hash = zero) then None else Some block_hash + in + let level, offset = read_int32 str offset in + let predecessor, _ = + read_str + str + ~offset + ~len:Tezos_crypto.Block_hash.size + Tezos_crypto.Block_hash.of_string_exn + in + {l2_block; level; predecessor} +end + +module Commitment_info = struct + type t = { + block : Tezos_crypto.Block_hash.t; + operation : Tezos_crypto.Operation_hash.t; + } + + let t = + let open Repr in + map + (pair Tezos_store_shared.Block_key.t Operation_key.t) + (fun (block, operation) -> {block; operation}) + (fun {block; operation} -> (block, operation)) + + let encoded_size = + Tezos_crypto.Block_hash.size + Tezos_crypto.Operation_hash.size + + let encode v = + let dst = Bytes.create encoded_size in + let offset = blit ~src:(Tezos_crypto.Block_hash.to_bytes v.block) ~dst 0 in + let _ = + blit ~src:(Tezos_crypto.Operation_hash.to_bytes v.operation) ~dst offset + in + Bytes.unsafe_to_string dst + + let decode str offset = + let block, offset = + read_str + str + ~offset + ~len:Tezos_crypto.Block_hash.size + Tezos_crypto.Block_hash.of_string_exn + in + let operation, _ = + read_str + str + ~offset + ~len:Tezos_crypto.Operation_hash.size + Tezos_crypto.Operation_hash.of_string_exn + in + {block; operation} +end + +module Tezos_block_store = struct + type value = Tezos_block_info.t = { + l2_block : L2block.hash option; + level : int32; + predecessor : Tezos_crypto.Block_hash.t; + } + + include + Make_indexable (Tezos_store_shared.Block_key) (Tezos_block_info) + (struct + let path ~data_dir = Node_data.tezos_blocks_index data_dir + end) +end + +module Level_store = + Make_indexable_removable (L2_level_key) (L2_block_key) + (struct + let path ~data_dir = Node_data.levels_index data_dir + end) + +module Commitment_store = struct + type value = Commitment_info.t = { + block : Tezos_crypto.Block_hash.t; + operation : Tezos_crypto.Operation_hash.t; + } + + include + Make_indexable_removable (Commitment_key) (Commitment_info) + (struct + let path ~data_dir = Node_data.commitments_index data_dir + end) +end + +module L2_block_store = struct + open L2_block_info + module Cache = + Aches_lwt.Lache.Make_option + (Aches.Rache.Transfer (Aches.Rache.LRU) (L2block.Hash)) + module L2_block_index = + Index_unix.Make (L2_block_key) (L2_block_info) (Index.Cache.Unbounded) + + module L2_blocks_file = struct + let encoding = Data_encoding.dynamic_size ~kind:`Uint30 L2block.encoding + + let pread_block_exn fd ~file_offset = + let open Lwt_syntax in + (* Read length *) + let length_bytes = Bytes.create 4 in + let* () = + Lwt_utils_unix.read_bytes ~file_offset ~pos:0 ~len:4 fd length_bytes + in + let block_length_int32 = Bytes.get_int32_be length_bytes 0 in + let block_length = Int32.to_int block_length_int32 in + let block_bytes = Bytes.extend length_bytes 0 block_length in + let* () = + Lwt_utils_unix.read_bytes + ~file_offset:(file_offset + 4) + ~pos:4 + ~len:block_length + fd + block_bytes + in + Lwt.return + ( Data_encoding.Binary.of_bytes_exn encoding block_bytes, + 4 + block_length ) + + let pread_block fd ~file_offset = + Option.catch_s (fun () -> pread_block_exn fd ~file_offset) + end + + type t = { + index : L2_block_index.t; + fd : Lwt_unix.file_descr; + scheduler : Lwt_idle_waiter.t; + cache : L2block.t Cache.t; + } + + (* The log_size corresponds to the maximum size of the memory zone + allocated in memory before flushing it onto the disk. It is + basically a cache which is use for the index. The cache size is + `log_size * log_entry` where a `log_entry` is roughly 56 bytes. *) + let blocks_log_size = 10_000 + + let mem store hash = + Lwt_idle_waiter.task store.scheduler @@ fun () -> + Lwt.return (L2_block_index.mem store.index hash) + + let predecessor store hash = + Lwt_idle_waiter.task store.scheduler @@ fun () -> + try + let {predecessor; _} = L2_block_index.find store.index hash in + Lwt.return predecessor + with Not_found -> Lwt.return_none + + let context store hash = + Lwt_idle_waiter.task store.scheduler @@ fun () -> + try + let {context; _} = L2_block_index.find store.index hash in + Lwt.return_some context + with Not_found -> Lwt.return_none + + let read_block store hash = + let open Lwt_syntax in + Lwt_idle_waiter.task store.scheduler @@ fun () -> + Option.catch_os @@ fun () -> + let read_from_disk hash = + let {offset; _} = L2_block_index.find store.index hash in + let* o = L2_blocks_file.pread_block store.fd ~file_offset:offset in + match o with + | Some (block, _) -> Lwt.return_some block + | None -> Lwt.return_none + in + Cache.bind_or_put store.cache hash read_from_disk Lwt.return + + let locked_write_block store ~offset ~block ~hash = + let open Lwt_result_syntax in + let* block_bytes = + match Data_encoding.Binary.to_bytes_opt L2_blocks_file.encoding block with + | None -> tzfail (Cannot_encode_block hash) + | Some bytes -> return bytes + in + let block_length = Bytes.length block_bytes in + let*! () = + Lwt_utils_unix.write_bytes ~pos:0 ~len:block_length store.fd block_bytes + in + L2_block_index.replace + store.index + hash + { + offset; + predecessor = block.header.predecessor; + context = block.header.context; + } ; + return block_length + + let append_block ?(flush = true) store (block : L2block.t) = + let open Lwt_syntax in + Lwt_idle_waiter.force_idle store.scheduler @@ fun () -> + let hash = block.hash in + Cache.put store.cache hash (return_some block) ; + let* offset = Lwt_unix.lseek store.fd 0 Unix.SEEK_END in + let* _written_len = locked_write_block store ~offset ~block ~hash in + if flush then L2_block_index.flush store.index ; + Lwt.return_unit + + let init ~data_dir ~readonly ~cache_size = + let open Lwt_syntax in + let flag, perms = + if readonly then (Unix.O_RDONLY, 0o444) else (Unix.O_RDWR, 0o644) + in + let* fd = + Lwt_unix.openfile + (Node_data.l2blocks_data data_dir) + [Unix.O_CREAT; O_CLOEXEC; flag] + perms + in + let index = + L2_block_index.v + ~log_size:blocks_log_size + ~readonly + (Node_data.l2blocks_index data_dir) + in + let scheduler = Lwt_idle_waiter.create () in + let cache = Cache.create cache_size in + Lwt.return {index; fd; scheduler; cache} + + let close store = + let open Lwt_syntax in + Lwt_idle_waiter.force_idle store.scheduler @@ fun () -> + (try L2_block_index.close store.index with Index.Closed -> ()) ; + let* _ignore = Lwt_utils_unix.safe_close store.fd in + Lwt.return_unit +end + +module Head_store = Make_singleton (struct + type t = L2block.hash + + let name = "head" + + let encoding = L2block.Hash.encoding +end) + +module Tezos_head_store = Make_singleton (struct + type t = Tezos_crypto.Block_hash.t + + let name = "tezos_head" + + let encoding = Tezos_crypto.Block_hash.encoding +end) + +type rollup_info = { + rollup_id : Protocol.Alpha_context.Tx_rollup.t; + origination_level : int32 option; +} + +module Rollup_info_store = Make_singleton (struct + type t = rollup_info + + let name = "rollup_info" + + let encoding = + let open Data_encoding in + conv + (fun {rollup_id; origination_level} -> (rollup_id, origination_level)) + (fun (rollup_id, origination_level) -> {rollup_id; origination_level}) + @@ obj2 + (req "rollup_id" Protocol.Alpha_context.Tx_rollup.encoding) + (opt "origination_level" int32) +end) + +module Finalized_level_store = Make_singleton (struct + type t = Protocol.Alpha_context.Tx_rollup_level.t + + let name = "finalized_level" + + let encoding = Protocol.Alpha_context.Tx_rollup_level.encoding +end) + +type t = { + blocks : L2_block_store.t; + tezos_blocks : Tezos_block_store.t; + levels : Level_store.t; + commitments : Commitment_store.t; + head : Head_store.t; + tezos_head : Tezos_head_store.t; + rollup_info : Rollup_info_store.t; + finalized_level : Finalized_level_store.t; +} + +let init ~data_dir ~readonly ~blocks_cache_size = + let open Lwt_syntax in + let* () = Node_data.mk_store_dir data_dir in + let* blocks = + L2_block_store.init ~data_dir ~readonly ~cache_size:blocks_cache_size + and* tezos_blocks = Tezos_block_store.init ~data_dir ~readonly + and* levels = Level_store.init ~data_dir ~readonly + and* commitments = Commitment_store.init ~data_dir ~readonly + and* head = Head_store.init ~data_dir + and* tezos_head = Tezos_head_store.init ~data_dir + and* rollup_info = Rollup_info_store.init ~data_dir + and* finalized_level = Finalized_level_store.init ~data_dir in + return + { + blocks; + tezos_blocks; + commitments; + levels; + head; + tezos_head; + rollup_info; + finalized_level; + } + +let close stores = + let open Lwt_syntax in + let* () = L2_block_store.close stores.blocks + and* () = Tezos_block_store.close stores.tezos_blocks + and* () = Level_store.close stores.levels + and* () = Commitment_store.close stores.commitments in + return_unit diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/stores.mli b/src/proto_016_PtMumbai/lib_tx_rollup/stores.mli new file mode 100644 index 000000000000..cae8329b0109 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/stores.mli @@ -0,0 +1,203 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* Copyright (c) 2022 Marigold, <contact@marigold.dev> *) +(* Copyright (c) 2022 Oxhead Alpha <info@oxhead-alpha.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Describes the different representations that can be stored persistently. *) + +(** {2 Signatures} *) + +(** A store composed of a single file on disk *) +module type SINGLETON_STORE = sig + (** The type of the singleton store. *) + type t + + (** The type of values stored in this singleton store. *) + type value + + (** Reads the current value from the disk. Returns [None] if the + file does not exist or if it is corrupted. *) + val read : t -> value option Lwt.t + + (** Write the value to disk. *) + val write : t -> value -> unit tzresult Lwt.t + + (** Deletes the value from the disk. *) + val delete : t -> unit Lwt.t +end + +(** An index store mapping keys to values. It is composed of an index only. *) +module type INDEXABLE_STORE = sig + (** The type of store build in indexes *) + type t + + (** The type of keys for the *) + type key + + (** The type of values stored in the index *) + type value + + (** Returns [true] if the key has a value associated in + the store. *) + val mem : t -> key -> bool Lwt.t + + (** Returns the value associated to a key in the store, + or [None] otherwise. *) + val find : t -> key -> value option Lwt.t + + (** Add an association from a key to a value in the + store. If [flush] (default to [true]) is set, the index is written on disk + right away. *) + val add : ?flush:bool -> t -> key -> value -> unit Lwt.t +end + +(** An index store mapping keys to values. Keys are associated to optional + values in the index which allows them to be removed. *) +module type INDEXABLE_REMOVABLE_STORE = sig + include INDEXABLE_STORE + + (** Removes an association from the store. Does nothing if the key was not + registered. *) + val remove : ?flush:bool -> t -> key -> unit Lwt.t +end + +(** {2 Indexed stores} *) + +(** A persistent store on disk for storing L2 blocks. It is composed of an index + file and a data file which contains the actual blocks. The keys of the index + are the L2 block hashes. *) +module L2_block_store : sig + (** The type of store for L2 blocks *) + type t + + (** Returns [true] if the L2 block hash exists in the index, i.e. if the block + exists in the store. *) + val mem : t -> L2block.hash -> bool Lwt.t + + (** Returns the predecessor of the block (by only querying the index, without + reading the block data). *) + val predecessor : t -> L2block.hash -> L2block.hash option Lwt.t + + (** Returns the context hash of the block (by only querying the index, without + reading the block data). *) + val context : + t -> L2block.hash -> Protocol.Tx_rollup_l2_context_hash.t option Lwt.t + + (** Read a block from the file on disk, given a L2 block hash. Returns [None] + if the block is not stored. *) + val read_block : t -> L2block.hash -> L2block.t option Lwt.t + + (** [append_block ?flush store block] stores the [block] in [store] updating + its index and flushing if [flush] is set to [true] (defaults to [true]).*) + val append_block : ?flush:bool -> t -> L2block.t -> unit Lwt.t +end + +(** {2 Pure index stores} *) + +(** An index store to map Tezos block hashes to L2 block hashes. It is composed + of an index only. This store is used to remember which Tezos blocks have been + processed by the Tx rollup node. When there is no inbox for a Tezos block, we + associate to it the L2 block of its predecessor. *) +module Tezos_block_store : sig + type value = { + l2_block : L2block.hash option; + level : int32; + predecessor : Tezos_crypto.Block_hash.t; + } + + include + INDEXABLE_STORE + with type key := Tezos_crypto.Block_hash.t + and type value := value +end + +(** An index store to map L2 block level to L2 block hashes. It is composed + of an index only. *) +module Level_store : + INDEXABLE_REMOVABLE_STORE + with type key := L2block.level + and type value := L2block.hash + +(** An index store to map commitment hashes to their inclusion information. *) +module Commitment_store : sig + type value = { + block : Tezos_crypto.Block_hash.t; + (** Tezos block in which the commitment is included. *) + operation : Tezos_crypto.Operation_hash.t; + (** Operation of the block in which the commitment is included. *) + } + + include + INDEXABLE_REMOVABLE_STORE + with type key := Protocol.Alpha_context.Tx_rollup_commitment_hash.t + and type value := value +end + +(** {2 Singleton stores} *) + +(** A store composed of a single file on disk to store the current head *) +module Head_store : SINGLETON_STORE with type value := L2block.hash + +(** A store composed of a single file on disk to store the current Tezos head *) +module Tezos_head_store : + SINGLETON_STORE with type value := Tezos_crypto.Block_hash.t + +(** Type for on disk information about a rollup *) +type rollup_info = { + rollup_id : Protocol.Alpha_context.Tx_rollup.t; + origination_level : int32 option; +} + +(** A store composed of a single file on disk to store the rollup + information. This is used to guarantee consistency between several runs of + the Tx rollup node. *) +module Rollup_info_store : SINGLETON_STORE with type value := rollup_info + +(** A store composed of a single file on disk to store the last finalized rollup + level (on L1) *) +module Finalized_level_store : + SINGLETON_STORE with type value := Protocol.Alpha_context.Tx_rollup_level.t + +(** The type of all stores of the Tx rollup node. *) +type t = { + blocks : L2_block_store.t; + tezos_blocks : Tezos_block_store.t; + levels : Level_store.t; + commitments : Commitment_store.t; + head : Head_store.t; + tezos_head : Tezos_head_store.t; + rollup_info : Rollup_info_store.t; + finalized_level : Finalized_level_store.t; +} + +(** [init ~data_dir ~readonly ~blocks_cache_size] creates or loads existing + stores located in the directory [data_dir]. If [readonly] (defaults to + [false]) is set, the stores can only be read. An LRU cache of size + [blocks_cache_size] is used for reading L2 blocks. *) +val init : data_dir:string -> readonly:bool -> blocks_cache_size:int -> t Lwt.t + +(** [close store] closes all the stores by closing the indexes and the + associated opened file descriptors. *) +val close : t -> unit Lwt.t diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/ticket.ml b/src/proto_016_PtMumbai/lib_tx_rollup/ticket.ml new file mode 100644 index 000000000000..208a488f6b20 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/ticket.ml @@ -0,0 +1,44 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +type t = { + ticketer : Contract.t; + ty : Script.expr; + contents : Script.expr; + hash : Ticket_hash.t; +} + +let encoding = + let open Data_encoding in + conv + (fun {ticketer; ty; contents; hash} -> (ticketer, ty, contents, hash)) + (fun (ticketer, ty, contents, hash) -> {ticketer; ty; contents; hash}) + @@ obj4 + (req "ticketer" Contract.encoding) + (req "ty" Script.expr_encoding) + (req "contents" Script.expr_encoding) + (req "hash" Ticket_hash.encoding) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/ticket.mli b/src/proto_016_PtMumbai/lib_tx_rollup/ticket.mli new file mode 100644 index 000000000000..b98f74bbbc84 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_tx_rollup/ticket.mli @@ -0,0 +1,35 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Protocol.Alpha_context + +type t = { + ticketer : Contract.t; + ty : Script.expr; + contents : Script.expr; + hash : Ticket_hash.t; +} + +val encoding : t Data_encoding.encoding diff --git a/src/proto_016_PtMumbai/parameters/dune b/src/proto_016_PtMumbai/parameters/dune new file mode 100644 index 000000000000..ed909e037d66 --- /dev/null +++ b/src/proto_016_PtMumbai/parameters/dune @@ -0,0 +1,4 @@ +(copy_files + (alias copy-parameters) + (mode (promote (until-clean))) + (files ../lib_parameters/*.json)) \ No newline at end of file diff --git a/src/proto_alpha/lib_benchmark/michelson_samplers.ml b/src/proto_alpha/lib_benchmark/michelson_samplers.ml index fafdce74e0c3..edb666c749d0 100644 --- a/src/proto_alpha/lib_benchmark/michelson_samplers.ml +++ b/src/proto_alpha/lib_benchmark/michelson_samplers.ml @@ -540,12 +540,13 @@ end) fun arg_ty -> let open M in let* ru = sc_rollup in + let* entrypoint = entrypoint in let destination = Alpha_context.Destination.Sc_rollup ru in return (Typed_contract.Internal_for_tests.typed_exn arg_ty destination - Alpha_context.Entrypoint.default) + entrypoint) let generate_any_type_contract : type arg argc. diff --git a/src/proto_alpha/lib_protocol/main.ml b/src/proto_alpha/lib_protocol/main.ml index ebb66598b180..8dba30c32503 100644 --- a/src/proto_alpha/lib_protocol/main.ml +++ b/src/proto_alpha/lib_protocol/main.ml @@ -422,4 +422,4 @@ module Mempool = struct ~grandparent_round) end -(* Vanity nonce: TBD *) +(* Vanity nonce: 6455568396538124 *) diff --git a/tests_python/contracts_016/attic/accounts.tz b/tests_python/contracts_016/attic/accounts.tz new file mode 100644 index 000000000000..de80046b29a6 --- /dev/null +++ b/tests_python/contracts_016/attic/accounts.tz @@ -0,0 +1,54 @@ +# This is a very simple accounts system. +# (Left key) initializes or deposits into an account +# (Right key (pair mutez (signed mutez))) withdraws mutez amount to a +# IMPLICIT_ACCOUNT created from the key if the balance is available +# and the key is correctly signed +parameter (or (key_hash %Initialize) + (pair %Withdraw + (key %from) + (pair + (mutez %withdraw_amount) + (signature %sig)))); +# Maps the key to the balance they have stored +storage (map :stored_balance key_hash mutez); +code { DUP; CAR; + # Deposit into account + IF_LEFT { DUP; DIIP{ CDR %stored_balance; DUP }; + DIP{ SWAP }; GET @opt_prev_balance; + # Create the account + IF_SOME # Add to an existing account + { RENAME @previous_balance; + AMOUNT; ADD; SOME; SWAP; UPDATE; NIL operation; PAIR } + { DIP{ AMOUNT; SOME }; UPDATE; NIL operation; PAIR }} + # Withdrawal + { DUP; DUP; DUP; DUP; + # Check signature on data + CAR %from; + DIIP{ CDAR %withdraw_amount; PACK ; BLAKE2B @signed_amount }; + DIP{ CDDR %sig }; CHECK_SIGNATURE; + IF {} { PUSH string "Bad signature"; FAILWITH }; + # Get user account information + DIIP{ CDR %stored_balance; DUP }; + CAR %from; HASH_KEY @from_hash; DUP; DIP{ DIP { SWAP }; SWAP}; GET; + # Account does not exist + IF_NONE { PUSH string "Account does not exist"; PAIR; FAILWITH } + # Account exists + { RENAME @previous_balance; + DIP { DROP }; + DUP; DIIP{ DUP; CDAR %withdraw_amount; DUP }; + # Ensure funds are available + DIP{ CMPLT @not_enough }; SWAP; + IF { PUSH string "Not enough funds"; FAILWITH } + { SUB_MUTEZ @new_balance; ASSERT_SOME; DIP{ DUP; DIP{ SWAP }}; DUP; + # Delete account if balance is 0 + PUSH @zero mutez 0; CMPEQ @null_balance; + IF { DROP; NONE @new_balance mutez } + # Otherwise update storage with new balance + { SOME @new_balance }; + SWAP; CAR %from; HASH_KEY @from_hash; UPDATE; + SWAP; DUP; CDAR %withdraw_amount; + # Execute the transfer + DIP{ CAR %from; HASH_KEY @from_hash; IMPLICIT_ACCOUNT @from_account}; UNIT; + TRANSFER_TOKENS @withdraw_transfer_op; + NIL operation; SWAP; CONS; + PAIR }}}} diff --git a/tests_python/contracts_016/attic/add1.tz b/tests_python/contracts_016/attic/add1.tz new file mode 100644 index 000000000000..78d4f9d1c020 --- /dev/null +++ b/tests_python/contracts_016/attic/add1.tz @@ -0,0 +1,7 @@ +parameter int; +storage int; +code {CAR; # Get the parameter + PUSH int 1; # We're adding 1, so we need to put 1 on the stack + ADD; # Add the two numbers + NIL operation; # We put an empty list of operations on the stack + PAIR} # Create the end value diff --git a/tests_python/contracts_016/attic/add1_list.tz b/tests_python/contracts_016/attic/add1_list.tz new file mode 100644 index 000000000000..c11616286475 --- /dev/null +++ b/tests_python/contracts_016/attic/add1_list.tz @@ -0,0 +1,6 @@ +parameter (list int); +storage (list int); +code { CAR; # Get the parameter + MAP { PUSH int 1; ADD }; # Map over the list adding one + NIL operation; # No internal op + PAIR } # Match the calling convention diff --git a/tests_python/contracts_016/attic/after_strategy.tz b/tests_python/contracts_016/attic/after_strategy.tz new file mode 100644 index 000000000000..70812e52b200 --- /dev/null +++ b/tests_python/contracts_016/attic/after_strategy.tz @@ -0,0 +1,3 @@ +parameter nat; +storage (pair (pair nat bool) timestamp); +code {DUP; CAR; DIP{CDDR; DUP; NOW; CMPGT}; PAIR; PAIR ; NIL operation ; PAIR}; diff --git a/tests_python/contracts_016/attic/always.tz b/tests_python/contracts_016/attic/always.tz new file mode 100644 index 000000000000..a7802fec96c8 --- /dev/null +++ b/tests_python/contracts_016/attic/always.tz @@ -0,0 +1,4 @@ +parameter nat; +storage (pair nat bool); +code { CAR; PUSH bool True; SWAP; + PAIR; NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/append.tz b/tests_python/contracts_016/attic/append.tz new file mode 100644 index 000000000000..3b8335455dcd --- /dev/null +++ b/tests_python/contracts_016/attic/append.tz @@ -0,0 +1,8 @@ +parameter (pair (list int) (list int)); +storage (list int); +code { CAR; UNPAIR ; # Unpack lists + NIL int; SWAP; # Setup reverse accumulator + ITER {CONS}; # Reverse list + ITER {CONS}; # Append reversed list + NIL operation; + PAIR} diff --git a/tests_python/contracts_016/attic/at_least.tz b/tests_python/contracts_016/attic/at_least.tz new file mode 100644 index 000000000000..6c6d2968cd12 --- /dev/null +++ b/tests_python/contracts_016/attic/at_least.tz @@ -0,0 +1,6 @@ +parameter unit; +storage mutez; # How much you have to send me +code {CDR; DUP; # Get the amount required (once for comparison, once to save back in storage) + AMOUNT; CMPLT; # Check to make sure no one is wasting my time + IF {FAIL} # Reject the person + {NIL operation;PAIR}} # Finish the transaction diff --git a/tests_python/contracts_016/attic/auction.tz b/tests_python/contracts_016/attic/auction.tz new file mode 100644 index 000000000000..af8aedfb7c22 --- /dev/null +++ b/tests_python/contracts_016/attic/auction.tz @@ -0,0 +1,8 @@ +parameter key_hash; +storage (pair timestamp (pair mutez key_hash)); +code { DUP; CDAR; DUP; NOW; CMPGT; IF {FAIL} {}; SWAP; # Check if auction has ended + DUP; CAR; DIP{CDDR}; AMOUNT; PAIR; SWAP; DIP{SWAP; PAIR}; # Setup replacement storage + DUP; CAR; AMOUNT; CMPLE; IF {FAIL} {}; # Check to make sure that the new amount is greater + DUP; CAR; # Get amount of refund + DIP{CDR; IMPLICIT_ACCOUNT}; UNIT; TRANSFER_TOKENS; # Make refund + NIL operation; SWAP; CONS; PAIR} # Calling convention diff --git a/tests_python/contracts_016/attic/bad_lockup.tz b/tests_python/contracts_016/attic/bad_lockup.tz new file mode 100644 index 000000000000..f334e899e71c --- /dev/null +++ b/tests_python/contracts_016/attic/bad_lockup.tz @@ -0,0 +1,6 @@ +parameter unit; +storage (pair timestamp (pair address address)); +code { CDR; DUP; CAR; NOW; CMPLT; IF {FAIL} {}; + DUP; CDAR; CONTRACT unit ; ASSERT_SOME ; PUSH mutez 100000000; UNIT; TRANSFER_TOKENS; SWAP; + DUP; CDDR; CONTRACT unit ; ASSERT_SOME ; PUSH mutez 100000000; UNIT; TRANSFER_TOKENS; DIP {SWAP} ; + NIL operation ; SWAP ; CONS ; SWAP ; CONS ; PAIR } diff --git a/tests_python/contracts_016/attic/big_map_union.tz b/tests_python/contracts_016/attic/big_map_union.tz new file mode 100644 index 000000000000..0c971ff11ce9 --- /dev/null +++ b/tests_python/contracts_016/attic/big_map_union.tz @@ -0,0 +1,8 @@ +parameter (list (pair string int)) ; +storage (pair (big_map string int) unit) ; +code { UNPAPAIR ; + ITER { UNPAIR ; DUUUP ; DUUP; GET ; + IF_NONE { PUSH int 0 } {} ; + SWAP ; DIP { ADD ; SOME } ; + UPDATE } ; + PAIR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/attic/cadr_annotation.tz b/tests_python/contracts_016/attic/cadr_annotation.tz new file mode 100644 index 000000000000..3f4978aebf9e --- /dev/null +++ b/tests_python/contracts_016/attic/cadr_annotation.tz @@ -0,0 +1,3 @@ +parameter (pair (pair %p1 unit (string %no_name)) bool); +storage unit; +code { CAR @param; CADR @name %no_name; DROP; UNIT; NIL operation; PAIR } diff --git a/tests_python/contracts_016/attic/concat.tz b/tests_python/contracts_016/attic/concat.tz new file mode 100644 index 000000000000..26814afca55a --- /dev/null +++ b/tests_python/contracts_016/attic/concat.tz @@ -0,0 +1,7 @@ +parameter string; +storage string; +code { DUP; + DIP { CDR ; NIL string ; SWAP ; CONS } ; + CAR ; CONS ; + CONCAT; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/conditionals.tz b/tests_python/contracts_016/attic/conditionals.tz new file mode 100644 index 000000000000..16bf8e91645c --- /dev/null +++ b/tests_python/contracts_016/attic/conditionals.tz @@ -0,0 +1,9 @@ +parameter (or string (option int)); +storage string; +code { CAR; # Access the storage + IF_LEFT {} # The string is on top of the stack, nothing to do + { IF_NONE { FAIL} # Fail if None + { PUSH int 0; CMPGT; # Check for negative number + IF {FAIL} # Fail if negative + {PUSH string ""}}}; # Push the empty string + NIL operation; PAIR} # Calling convention diff --git a/tests_python/contracts_016/attic/cons_twice.tz b/tests_python/contracts_016/attic/cons_twice.tz new file mode 100644 index 000000000000..4761b23f71f1 --- /dev/null +++ b/tests_python/contracts_016/attic/cons_twice.tz @@ -0,0 +1,9 @@ +parameter nat; +storage (list nat); +code { DUP; # Duplicate the storage and parameter + CAR; # Extract the parameter + DIP{CDR}; # Extract the storage + DUP; # Duplicate the parameter + DIP{CONS}; # Add the first instance of the parameter to the list + CONS; # Add the second instance of the parameter to the list + NIL operation; PAIR} # Finish the calling convention diff --git a/tests_python/contracts_016/attic/cps_fact.tz b/tests_python/contracts_016/attic/cps_fact.tz new file mode 100644 index 000000000000..6c8ee7146290 --- /dev/null +++ b/tests_python/contracts_016/attic/cps_fact.tz @@ -0,0 +1,16 @@ +storage nat ; +parameter nat ; +code { UNPAIR ; + DIP { SELF ; ADDRESS ; SENDER; + IFCMPEQ {} { DROP ; PUSH @storage nat 1 } }; + DUP ; + PUSH nat 1 ; + IFCMPGE + { DROP ; NIL operation ; PAIR } + { PUSH nat 1 ; SWAP ; SUB @parameter ; ISNAT ; + IF_NONE + { NIL operation ; PAIR } + { DUP ; DIP { PUSH nat 1 ; ADD ; MUL @storage } ; SWAP; + DIP { DIP { SELF; PUSH mutez 0 } ; + TRANSFER_TOKENS ; NIL operation ; SWAP ; CONS } ; + SWAP ; PAIR } } } \ No newline at end of file diff --git a/tests_python/contracts_016/attic/create_add1_lists.tz b/tests_python/contracts_016/attic/create_add1_lists.tz new file mode 100644 index 000000000000..5a4245966379 --- /dev/null +++ b/tests_python/contracts_016/attic/create_add1_lists.tz @@ -0,0 +1,14 @@ +parameter unit; +storage address; +code { DROP; NIL int; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter (list int) ; + storage (list int) ; + code + { CAR; + MAP {PUSH int 1; ADD}; + NIL operation; + PAIR } }; + NIL operation; SWAP; CONS; PAIR} # Ending calling convention stuff diff --git a/tests_python/contracts_016/attic/data_publisher.tz b/tests_python/contracts_016/attic/data_publisher.tz new file mode 100644 index 000000000000..9240d63021bc --- /dev/null +++ b/tests_python/contracts_016/attic/data_publisher.tz @@ -0,0 +1,8 @@ +parameter (pair signature (pair string nat)); +storage (pair (pair key nat) string); +code { DUP; CAR; DIP{CDR; DUP}; + SWAP; DIP{DUP}; CAAR; DIP{DUP; CAR; DIP{CDR; PACK ; BLAKE2B}}; + CHECK_SIGNATURE; + IF { CDR; DUP; DIP{CAR; DIP{CAAR}}; CDR; PUSH nat 1; ADD; + DIP{SWAP}; SWAP; PAIR; PAIR; NIL operation; PAIR} + {FAIL}} diff --git a/tests_python/contracts_016/attic/dispatch.tz b/tests_python/contracts_016/attic/dispatch.tz new file mode 100644 index 000000000000..9c185133ac7f --- /dev/null +++ b/tests_python/contracts_016/attic/dispatch.tz @@ -0,0 +1,9 @@ +parameter (or string (pair string (lambda unit string))); +storage (pair string (map string (lambda unit string))); +code { DUP; DIP{CDDR}; CAR; # Unpack stack + IF_LEFT { DIP{DUP}; GET; # Get lambda if it exists + IF_NONE {FAIL} {}; # Fail if it doesn't + UNIT; EXEC } # Execute the lambda + { DUP; CAR; DIP {CDR; SOME}; UPDATE; PUSH string ""}; # Update the storage + PAIR; + NIL operation; PAIR} # Calling convention diff --git a/tests_python/contracts_016/attic/empty.tz b/tests_python/contracts_016/attic/empty.tz new file mode 100644 index 000000000000..d3aecdb25066 --- /dev/null +++ b/tests_python/contracts_016/attic/empty.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code {CDR; NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/fail_amount.tz b/tests_python/contracts_016/attic/fail_amount.tz new file mode 100644 index 000000000000..95b71c4f0ff1 --- /dev/null +++ b/tests_python/contracts_016/attic/fail_amount.tz @@ -0,0 +1,6 @@ +# Fail if the amount transferred is less than 10 +parameter unit; +storage unit; +code { DROP; + AMOUNT; PUSH mutez 10000000; CMPGT; IF {FAIL} {}; + UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/faucet.tz b/tests_python/contracts_016/attic/faucet.tz new file mode 100644 index 000000000000..0c92a0744d94 --- /dev/null +++ b/tests_python/contracts_016/attic/faucet.tz @@ -0,0 +1,7 @@ +parameter key_hash ; +storage timestamp ; +code { UNPAIR ; SWAP ; + PUSH int 300 ; ADD @FIVE_MINUTES_LATER ; + NOW ; ASSERT_CMPGE ; + IMPLICIT_ACCOUNT ; PUSH mutez 1000000 ; UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; DIP { NOW } ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/attic/forward.tz b/tests_python/contracts_016/attic/forward.tz new file mode 100644 index 000000000000..829192f5a313 --- /dev/null +++ b/tests_python/contracts_016/attic/forward.tz @@ -0,0 +1,150 @@ +parameter + (or string nat) ; +storage + (pair + (pair nat (pair mutez mutez)) # counter from_buyer from_seller + (pair + (pair nat (pair timestamp timestamp)) # Q T Z + (pair + (pair mutez mutez) # K C + (pair + (pair address address) # B S + address)))) ; # W +code + { DUP ; CDDADDR ; # Z + PUSH int 86400 ; SWAP ; ADD ; # one day in second + NOW ; COMPARE ; LT ; + IF { # Before Z + 24 + DUP ; CAR ; # we must receive (Left "buyer") or (Left "seller") + IF_LEFT + { DUP ; PUSH string "buyer" ; COMPARE ; EQ ; + IF { DROP ; + DUP ; CDADAR ; # amount already versed by the buyer + DIP { AMOUNT } ; ADD ; # transaction + # then we rebuild the globals + DIP { DUP ; CDADDR } ; PAIR ; # seller amount + PUSH nat 0 ; PAIR ; # delivery counter at 0 + DIP { CDDR } ; PAIR ; # parameters + # and return Unit + NIL operation ; PAIR } + { PUSH string "seller" ; COMPARE ; EQ ; + IF { DUP ; CDADDR ; # amount already versed by the seller + DIP { AMOUNT } ; ADD ; # transaction + # then we rebuild the globals + DIP { DUP ; CDADAR } ; SWAP ; PAIR ; # buyer amount + PUSH nat 0 ; PAIR ; # delivery counter at 0 + DIP { CDDR } ; PAIR ; # parameters + # and return Unit + NIL operation ; PAIR } + { FAIL } } } # (Left _) + { FAIL } } # (Right _) + { # After Z + 24 + # if balance is emptied, just fail + BALANCE ; PUSH mutez 0 ; IFCMPEQ { FAIL } {} ; + # test if the required amount is reached + DUP ; CDDAAR ; # Q + DIP { DUP ; CDDDADR } ; MUL ; # C + PUSH nat 2 ; MUL ; + BALANCE ; COMPARE ; LT ; # balance < 2 * (Q * C) + IF { # refund the parties + CDR ; DUP ; CADAR ; # amount versed by the buyer + DIP { DUP ; CDDDAAR } ; # B + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; SWAP ; + DUP ; CADDR ; # amount versed by the seller + DIP { DUP ; CDDDADR } ; # S + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; SWAP ; + DIP { CONS } ; + DUP ; CADAR ; DIP { DUP ; CADDR } ; ADD ; + BALANCE ; SUB_MUTEZ ; ASSERT_SOME; # bonus to the warehouse + DIP { DUP ; CDDDDR } ; # W + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + DIP { SWAP } ; CONS ; + # leave the storage as-is, as the balance is now 0 + PAIR } + { # otherwise continue + DUP ; CDDADAR ; # T + NOW ; COMPARE ; LT ; + IF { FAIL } # Between Z + 24 and T + { # after T + DUP ; CDDADAR ; # T + PUSH int 86400 ; ADD ; # one day in second + NOW ; COMPARE ; LT ; + IF { # Between T and T + 24 + # we only accept transactions from the buyer + DUP ; CAR ; # we must receive (Left "buyer") + IF_LEFT + { PUSH string "buyer" ; COMPARE ; EQ ; + IF { DUP ; CDADAR ; # amount already versed by the buyer + DIP { AMOUNT } ; ADD ; # transaction + # The amount must not exceed Q * K + DUP ; + DIIP { DUP ; CDDAAR ; # Q + DIP { DUP ; CDDDAAR } ; MUL ; } ; # K + DIP { COMPARE ; GT ; # new amount > Q * K + IF { FAIL } { } } ; # abort or continue + # then we rebuild the globals + DIP { DUP ; CDADDR } ; PAIR ; # seller amount + PUSH nat 0 ; PAIR ; # delivery counter at 0 + DIP { CDDR } ; PAIR ; # parameters + # and return Unit + NIL operation ; PAIR } + { FAIL } } # (Left _) + { FAIL } } # (Right _) + { # After T + 24 + # test if the required payment is reached + DUP ; CDDAAR ; # Q + DIP { DUP ; CDDDAAR } ; MUL ; # K + DIP { DUP ; CDADAR } ; # amount already versed by the buyer + COMPARE ; NEQ ; + IF { # not reached, pay the seller + BALANCE ; + DIP { DUP ; CDDDDADR } ; # S + DIIP { CDR } ; + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; PAIR } + { # otherwise continue + DUP ; CDDADAR ; # T + PUSH int 86400 ; ADD ; + PUSH int 86400 ; ADD ; # two days in second + NOW ; COMPARE ; LT ; + IF { # Between T + 24 and T + 48 + # We accept only delivery notifications, from W + DUP ; CDDDDDR ; # W + SENDER ; + COMPARE ; NEQ ; + IF { FAIL } {} ; # fail if not the warehouse + DUP ; CAR ; # we must receive (Right amount) + IF_LEFT + { FAIL } # (Left _) + { # We increment the counter + DIP { DUP ; CDAAR } ; ADD ; + # And rebuild the globals in advance + DIP { DUP ; CDADR } ; PAIR ; + DIP { CDDR } ; PAIR ; + UNIT ; PAIR ; + # We test if enough have been delivered + DUP ; CDAAR ; + DIP { DUP ; CDDAAR } ; + COMPARE ; LT ; # counter < Q + IF { CDR ; NIL operation } # wait for more + { # Transfer all the money to the seller + BALANCE ; + DIP { DUP ; CDDDDADR } ; # S + DIIP { CDR } ; + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS } } ; + PAIR } + { # after T + 48, transfer everything to the buyer + BALANCE ; + DIP { DUP ; CDDDDAAR } ; # B + DIIP { CDR } ; + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; + PAIR} } } } } } } \ No newline at end of file diff --git a/tests_python/contracts_016/attic/id.tz b/tests_python/contracts_016/attic/id.tz new file mode 100644 index 000000000000..4eee565ca2e9 --- /dev/null +++ b/tests_python/contracts_016/attic/id.tz @@ -0,0 +1,3 @@ +parameter string; +storage string; +code {CAR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/attic/infinite_loop.tz b/tests_python/contracts_016/attic/infinite_loop.tz new file mode 100644 index 000000000000..77cdbc48c0d1 --- /dev/null +++ b/tests_python/contracts_016/attic/infinite_loop.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { DROP; PUSH bool True; LOOP {PUSH bool True}; UNIT; NIL operation; PAIR } diff --git a/tests_python/contracts_016/attic/insertion_sort.tz b/tests_python/contracts_016/attic/insertion_sort.tz new file mode 100644 index 000000000000..34eca64d092c --- /dev/null +++ b/tests_python/contracts_016/attic/insertion_sort.tz @@ -0,0 +1,16 @@ +parameter (list int) ; +storage (list int) ; +code { CAR ; + NIL int ; SWAP ; + ITER { SWAP; DIIP{NIL int} ; PUSH bool True ; + LOOP + { IF_CONS + { SWAP ; + DIP{DUP ; DIIP{DUP} ; DIP{CMPLT} ; SWAP} ; + SWAP ; + IF { DIP{SWAP ; DIP{CONS}} ; PUSH bool True} + { SWAP ; CONS ; PUSH bool False}} + { NIL int ; PUSH bool False}} ; + SWAP ; CONS ; SWAP ; + ITER {CONS}} ; + NIL operation ; PAIR } diff --git a/tests_python/contracts_016/attic/int_publisher.tz b/tests_python/contracts_016/attic/int_publisher.tz new file mode 100644 index 000000000000..6ee49b979e2c --- /dev/null +++ b/tests_python/contracts_016/attic/int_publisher.tz @@ -0,0 +1,17 @@ +# (signed hash of the string, string) +parameter (option (pair signature int)); +storage (pair key int); +code {DUP; DUP; CAR; + IF_NONE {PUSH mutez 1000000; # Fee pattern from July 26 + AMOUNT; CMPLE; IF {FAIL} {}; + # Provide the data + CDR; DIP {CDDR}} + {DUP; DIP{SWAP}; SWAP; CDAR; # Move key to the top + DIP {DUP; CAR; DIP {CDR; PACK ; BLAKE2B}}; # Arrange the new piece of data + CHECK_SIGNATURE; # Check to ensure the data is authentic + # Update data + IF {CDR; SWAP; DIP{DUP}; CDAR; PAIR} + # Revert the update. This could be replaced with FAIL + {DROP; DUP; CDR; DIP{CDDR}}}; + # Cleanup + DIP{DROP}; NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/king_of_tez.tz b/tests_python/contracts_016/attic/king_of_tez.tz new file mode 100644 index 000000000000..033ead7f168c --- /dev/null +++ b/tests_python/contracts_016/attic/king_of_tez.tz @@ -0,0 +1,19 @@ +parameter key_hash; +storage (pair timestamp (pair mutez key_hash)); +code { DUP; CDAR; + # If the time is more than 2 weeks, any amount makes you king + NOW; CMPGT; + # User becomes king of mutez + IF { CAR; AMOUNT; PAIR; NOW; PUSH int 604800; ADD; PAIR; + NIL operation } + # Check balance to see if user has paid enough to become the new king + { DUP; CDDAR; AMOUNT; CMPLT; + IF { FAIL } # user has not paid out + { CAR; DUP; + # New storage + DIP{ AMOUNT; PAIR; NOW; PUSH int 604800; ADD; PAIR }; + # Pay funds to old king + IMPLICIT_ACCOUNT; AMOUNT; UNIT; TRANSFER_TOKENS; + NIL operation; SWAP; CONS}}; + # Cleanup + PAIR }; diff --git a/tests_python/contracts_016/attic/list_of_transactions.tz b/tests_python/contracts_016/attic/list_of_transactions.tz new file mode 100644 index 000000000000..620ceedd5a67 --- /dev/null +++ b/tests_python/contracts_016/attic/list_of_transactions.tz @@ -0,0 +1,8 @@ +parameter unit; +storage (list address); +code { CDR; DUP; + DIP {NIL operation}; PUSH bool True; # Setup loop + LOOP {IF_CONS { CONTRACT unit ; ASSERT_SOME ; PUSH mutez 1000000; UNIT; TRANSFER_TOKENS; # Make transfer + SWAP; DIP {CONS}; PUSH bool True} # Setup for next round of loop + { NIL address ; PUSH bool False}}; # Data to satisfy types and end loop + DROP; PAIR}; # Calling convention diff --git a/tests_python/contracts_016/attic/queue.tz b/tests_python/contracts_016/attic/queue.tz new file mode 100644 index 000000000000..a074906ddf91 --- /dev/null +++ b/tests_python/contracts_016/attic/queue.tz @@ -0,0 +1,24 @@ +parameter (option string); +storage (pair (option string) (pair (pair nat nat) (map nat string))); +code { DUP; CAR; + # Retrieving an element + IF_NONE { CDDR; DUP; CAR; DIP{CDR; DUP}; DUP; + CAR; SWAP; DIP{GET}; # Check if an element is available + SWAP; + # Put NONE on stack and finish + IF_NONE { NONE string; DIP{PAIR}; PAIR} + # Reoption the element and remove the entry from the map + { SOME; + DIP{ DUP; DIP{ CAR; DIP{ NONE string }; UPDATE }; + # Increment the counter and cleanup + DUP; CAR; PUSH nat 1; ADD; DIP{ CDR }; PAIR; PAIR}; + PAIR }} + # Arrange the stack + { DIP{DUP; CDDAR; DIP{CDDDR}; DUP}; SWAP; CAR; + # Add the element to the map + DIP{ SOME; SWAP; CDR; DUP; DIP{UPDATE}; + # Increment the second number + PUSH nat 1; ADD}; + # Cleanup and finish + PAIR; PAIR; NONE string; PAIR }; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/attic/reduce_map.tz b/tests_python/contracts_016/attic/reduce_map.tz new file mode 100644 index 000000000000..aab8ea60d367 --- /dev/null +++ b/tests_python/contracts_016/attic/reduce_map.tz @@ -0,0 +1,16 @@ + +parameter (pair (lambda int int) (list int)); +storage (list int); +code { DIP{NIL int}; + CAR; + DUP; + DIP{CAR; PAIR}; # Unpack data and setup accumulator + CDR; + ITER {PAIR; + DUP; CDAR; + DIP{ DUP; DIP{CDAR}; DUP; + CAR; DIP{CDDR; SWAP}; EXEC; CONS}; + PAIR}; + CDR; DIP{NIL int}; # First reduce + ITER {CONS}; # Reverse + NIL operation; PAIR} # Calling convention diff --git a/tests_python/contracts_016/attic/reentrancy.tz b/tests_python/contracts_016/attic/reentrancy.tz new file mode 100644 index 000000000000..b9e614a4e53e --- /dev/null +++ b/tests_python/contracts_016/attic/reentrancy.tz @@ -0,0 +1,7 @@ +parameter unit; +storage (pair address address); +code { CDR; DUP; CAR; + CONTRACT unit ; ASSERT_SOME ; PUSH mutez 5000000; UNIT; TRANSFER_TOKENS; + DIP {DUP; CDR; + CONTRACT unit ; ASSERT_SOME ; PUSH mutez 5000000; UNIT; TRANSFER_TOKENS}; + DIIP{NIL operation};DIP{CONS};CONS;PAIR}; diff --git a/tests_python/contracts_016/attic/reservoir.tz b/tests_python/contracts_016/attic/reservoir.tz new file mode 100644 index 000000000000..291e09b262b5 --- /dev/null +++ b/tests_python/contracts_016/attic/reservoir.tz @@ -0,0 +1,25 @@ +parameter unit ; +storage + (pair + (pair (timestamp %T) (mutez %N)) + (pair (address %A) (address %B))) ; +code + { CDR ; DUP ; CAAR %T; # T + NOW ; COMPARE ; LE ; + IF { DUP ; CADR %N; # N + BALANCE ; + COMPARE ; LE ; + IF { NIL operation ; PAIR } + { DUP ; CDDR %B; # B + CONTRACT unit ; ASSERT_SOME ; + BALANCE ; UNIT ; + TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; + PAIR } } + { DUP ; CDAR %A; # A + CONTRACT unit ; ASSERT_SOME ; + BALANCE ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; + PAIR } } diff --git a/tests_python/contracts_016/attic/scrutable_reservoir.tz b/tests_python/contracts_016/attic/scrutable_reservoir.tz new file mode 100644 index 000000000000..d415cdda0f54 --- /dev/null +++ b/tests_python/contracts_016/attic/scrutable_reservoir.tz @@ -0,0 +1,67 @@ +parameter unit ; +storage + (pair + string # S + (pair + timestamp # T + (pair + (pair mutez mutez) # P N + (pair + address # X + (pair address address))))) ; # A B +code + { DUP ; CDAR ; # S + PUSH string "open" ; + COMPARE ; NEQ ; + IF { FAIL } # on "success", "timeout" or a bad init value + { DUP ; CDDAR ; # T + NOW ; + COMPARE ; LT ; + IF { # Before timeout + # We compute (P + N) mutez + PUSH mutez 0 ; + DIP { DUP ; CDDDAAR } ; ADD ; # P + DIP { DUP ; CDDDADR } ; ADD ; # N + # We compare to the cumulated amount + BALANCE ; + COMPARE; LT ; + IF { # Not enough cash, we just accept the transaction + # and leave the global untouched + CDR ; NIL operation ; PAIR } + { # Enough cash, successful ending + # We update the global + CDDR ; PUSH string "success" ; PAIR ; + # We transfer the fee to the broker + DUP ; CDDAAR ; # P + DIP { DUP ; CDDDAR } ; # X + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS ; + # We transfer the rest to A + DIP { DUP ; CDDADR ; # N + DIP { DUP ; CDDDDAR } ; # A + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS } ; + NIL operation ; SWAP ; CONS ; SWAP ; CONS ; + PAIR } } + { # After timeout, we refund + # We update the global + CDDR ; PUSH string "timeout" ; PAIR ; + # We try to transfer the fee to the broker + BALANCE ; # available + DIP { DUP ; CDDAAR } ; # P + COMPARE ; LT ; # available < P + IF { BALANCE ; # available + DIP { DUP ; CDDDAR } ; # X + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS } + { DUP ; CDDAAR ; # P + DIP { DUP ; CDDDAR } ; # X + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS } ; + # We transfer the rest to B + DIP { BALANCE ; # available + DIP { DUP ; CDDDDDR } ; # B + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT ; TRANSFER_TOKENS } ; + NIL operation ; SWAP ; CONS ; SWAP ; CONS ; + PAIR } } } diff --git a/tests_python/contracts_016/attic/spawn_identities.tz b/tests_python/contracts_016/attic/spawn_identities.tz new file mode 100644 index 000000000000..2208e0d0928d --- /dev/null +++ b/tests_python/contracts_016/attic/spawn_identities.tz @@ -0,0 +1,20 @@ +parameter nat; +storage (list address); +code { DUP; + CAR; # Get the number + DIP{CDR; NIL operation}; # Put the accumulators on the stack + PUSH bool True; # Push true so we have a do while loop + LOOP { DUP; PUSH nat 0; CMPEQ; # Check if the number is 0 + IF { PUSH bool False} # End the loop + { PUSH nat 1; SWAP; SUB; ABS; # Subtract 1. The ABS is to make it back into a nat + PUSH string "init"; # Storage type + PUSH mutez 5000000; # Starting balance + NONE key_hash; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; # Make the contract + SWAP ; DIP { SWAP ; DIP { CONS } } ; # emit the operation + SWAP ; DIP { SWAP ; DIP { CONS } } ; # add to the list + PUSH bool True}}; # Continue the loop + DROP; PAIR} # Calling convention diff --git a/tests_python/contracts_016/entrypoints/big_map_entrypoints.tz b/tests_python/contracts_016/entrypoints/big_map_entrypoints.tz new file mode 100644 index 000000000000..d49e6257167a --- /dev/null +++ b/tests_python/contracts_016/entrypoints/big_map_entrypoints.tz @@ -0,0 +1,31 @@ +storage + (pair (big_map string nat) (big_map string nat)) ; +parameter + (or (unit %default) + (or (or %mem (string %mem_left) (string %mem_right)) + (or (or %add (pair %add_left string nat) (pair %add_right string nat)) + (or %rem (string %rem_left) (string %rem_right))))) ; +code { UNPAIR ; + IF_LEFT + { DROP ; + DUP ; CAR ; + PUSH mutez 0 ; + NONE key_hash ; + CREATE_CONTRACT + { parameter string ; + storage (big_map string nat) ; + code { UNPAIR ; DROP ; NIL operation ; PAIR }} ; + DIP { DROP } ; + NIL operation ; SWAP ; CONS ; PAIR } + { IF_LEFT + { IF_LEFT + { DIP { UNPAIR } ; DIP { DUP } ; MEM ; ASSERT } + { DIP { UNPAIR ; SWAP } ; DIP { DUP } ; MEM ; ASSERT ; SWAP } } + { IF_LEFT + { IF_LEFT + { UNPAIR ; DIIP { UNPAIR } ; DIP { SOME } ; UPDATE } + { UNPAIR ; DIIP { UNPAIR ; SWAP } ; DIP { SOME } ; UPDATE ; SWAP } } + { IF_LEFT + { DIP { UNPAIR } ; DIP { NONE nat } ; UPDATE } + { DIP { UNPAIR ; SWAP } ; DIP { NONE nat } ; UPDATE ; SWAP } } } ; + PAIR ; NIL operation ; PAIR } } diff --git a/tests_python/contracts_016/entrypoints/delegatable_target.tz b/tests_python/contracts_016/entrypoints/delegatable_target.tz new file mode 100644 index 000000000000..0db00f4945ed --- /dev/null +++ b/tests_python/contracts_016/entrypoints/delegatable_target.tz @@ -0,0 +1,79 @@ +# Michelson pseudo-code to transform from source script. + # This transformation adds 'set_delegate' entrypoint, e.g.: + # + # parameter <parameter_expr> ; + # storage <storage_expr> ; + # code <code_expr> ; + # + # to: +parameter + (or + (or (key_hash %set_delegate) + (unit %remove_delegate)) + (or %default string nat) + ) ; + +storage + (pair + key_hash # manager + (pair string nat) + ) ; + +code { + DUP ; + CAR ; + IF_LEFT + { # 'set_delegate'/'remove_delegate' entrypoints + # Assert no token was sent: + # to send tokens, the default entry point should be used + PUSH mutez 0 ; + AMOUNT ; + ASSERT_CMPEQ ; + # Assert that the sender is the manager + DUUP ; + CDR ; + CAR ; + IMPLICIT_ACCOUNT ; ADDRESS ; + SENDER ; + IFCMPNEQ + { SENDER ; + PUSH string "Only the owner can operate." ; + PAIR ; + FAILWITH ; + } + { DIP { CDR ; NIL operation } ; + IF_LEFT + { # 'set_delegate' entrypoint + SOME ; + SET_DELEGATE ; + CONS ; + PAIR ; + } + { # 'remove_delegate' entrypoint + DROP ; + NONE key_hash ; + SET_DELEGATE ; + CONS ; + PAIR ; + } + } + } + { # Transform the inputs to the original script types + DIP { CDR ; DUP ; CDR } ; + PAIR ; + + # 'default' entrypoint - original code + { UNPAIR; + IF_LEFT + { DIP { UNPAIR ; DROP } } + { DUG 1; UNPAIR ; DIP { DROP } } ; + PAIR ; NIL operation ; PAIR } + # Transform the outputs to the new script types (manager's storage is unchanged) + SWAP ; + CAR ; + SWAP ; + UNPAIR ; + DIP { SWAP ; PAIR } ; + PAIR ; + } + } diff --git a/tests_python/contracts_016/entrypoints/manager.tz b/tests_python/contracts_016/entrypoints/manager.tz new file mode 100644 index 000000000000..06d9b1067bf4 --- /dev/null +++ b/tests_python/contracts_016/entrypoints/manager.tz @@ -0,0 +1,31 @@ +parameter + (or + (lambda %do unit (list operation)) + (unit %default)); +storage key_hash; +code + { UNPAIR ; + IF_LEFT + { # 'do' entrypoint + # Assert no token was sent: + # to send tokens, the default entry point should be used + PUSH mutez 0 ; + AMOUNT ; + ASSERT_CMPEQ ; + # Assert that the sender is the manager + DUUP ; + IMPLICIT_ACCOUNT ; + ADDRESS ; + SENDER ; + ASSERT_CMPEQ ; + # Execute the lambda argument + UNIT ; + EXEC ; + PAIR ; + } + { # 'default' entrypoint + DROP ; + NIL operation ; + PAIR ; + } + }; diff --git a/tests_python/contracts_016/entrypoints/no_default_target.tz b/tests_python/contracts_016/entrypoints/no_default_target.tz new file mode 100644 index 000000000000..48d5d53df996 --- /dev/null +++ b/tests_python/contracts_016/entrypoints/no_default_target.tz @@ -0,0 +1,11 @@ +storage (pair string nat) ; +parameter + (or unit (or %data string nat)) ; +code { UNPAIR ; + IF_LEFT + { DROP ; NIL operation ; PAIR } + { IF_LEFT + { DIP { UNPAIR ; DROP } } + { DUG 1; UNPAIR ; DIP { DROP } } ; + PAIR ; NIL operation ; PAIR } + } diff --git a/tests_python/contracts_016/entrypoints/no_entrypoint_target.tz b/tests_python/contracts_016/entrypoints/no_entrypoint_target.tz new file mode 100644 index 000000000000..d8041507d58c --- /dev/null +++ b/tests_python/contracts_016/entrypoints/no_entrypoint_target.tz @@ -0,0 +1,11 @@ +storage (pair string nat) ; +parameter + (or unit (or string nat)) ; +code { UNPAIR ; + IF_LEFT + { DROP ; NIL operation ; PAIR } + { IF_LEFT + { DIP { UNPAIR ; DROP } } + { DUG 1; UNPAIR ; DIP { DROP } } ; + PAIR ; NIL operation ; PAIR } + } diff --git a/tests_python/contracts_016/entrypoints/rooted_target.tz b/tests_python/contracts_016/entrypoints/rooted_target.tz new file mode 100644 index 000000000000..2ca2dfb1296d --- /dev/null +++ b/tests_python/contracts_016/entrypoints/rooted_target.tz @@ -0,0 +1,11 @@ +storage (pair string nat) ; +parameter + (or %root unit (or %default string nat)) ; +code { UNPAIR ; + IF_LEFT + { DROP ; NIL operation ; PAIR } + { IF_LEFT + { DIP { UNPAIR ; DROP } } + { DUG 1; UNPAIR ; DIP { DROP } } ; + PAIR ; NIL operation ; PAIR } + } diff --git a/tests_python/contracts_016/entrypoints/simple_entrypoints.tz b/tests_python/contracts_016/entrypoints/simple_entrypoints.tz new file mode 100644 index 000000000000..7b7abb7cb86e --- /dev/null +++ b/tests_python/contracts_016/entrypoints/simple_entrypoints.tz @@ -0,0 +1,4 @@ +# A trivial contract with some entrypoints +parameter (or (unit %A) (or (string %B) (nat %C))) ; +storage unit; +code { CDR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/ill_typed/big_dip.tz b/tests_python/contracts_016/ill_typed/big_dip.tz new file mode 100644 index 000000000000..697370fdc87e --- /dev/null +++ b/tests_python/contracts_016/ill_typed/big_dip.tz @@ -0,0 +1,4 @@ +parameter unit; +storage unit; +code { DIP 1073741824 { }; # = 0x3fffffff + 1 + DROP; } diff --git a/tests_python/contracts_016/ill_typed/big_drop.tz b/tests_python/contracts_016/ill_typed/big_drop.tz new file mode 100644 index 000000000000..40d81cf8448b --- /dev/null +++ b/tests_python/contracts_016/ill_typed/big_drop.tz @@ -0,0 +1,4 @@ +parameter unit; +storage unit; +code { DROP 1073741824; # = 0x3fffffff + 1 + DROP; } diff --git a/tests_python/contracts_016/ill_typed/chain_id_arity.tz b/tests_python/contracts_016/ill_typed/chain_id_arity.tz new file mode 100644 index 000000000000..4bc9f4f70107 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/chain_id_arity.tz @@ -0,0 +1,3 @@ +parameter (chain_id nat); +storage unit; +code { CDR; NIL operation; PAIR } diff --git a/tests_python/contracts_016/ill_typed/comb0.tz b/tests_python/contracts_016/ill_typed/comb0.tz new file mode 100644 index 000000000000..ab3c79153035 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/comb0.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { PAIR 0 } diff --git a/tests_python/contracts_016/ill_typed/comb1.tz b/tests_python/contracts_016/ill_typed/comb1.tz new file mode 100644 index 000000000000..07b709d61cfd --- /dev/null +++ b/tests_python/contracts_016/ill_typed/comb1.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { PAIR 1 } diff --git a/tests_python/contracts_016/ill_typed/contract_annotation_default.tz b/tests_python/contracts_016/ill_typed/contract_annotation_default.tz new file mode 100644 index 000000000000..742e140c5e48 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/contract_annotation_default.tz @@ -0,0 +1,11 @@ +parameter (contract (or (or (int %A) (nat %B)) (unit %default))); +storage unit; +code { + CAR; + # CONTRACT %default nat == CONTRACT nat and the former is not allowed. + DUP; ADDRESS; CONTRACT %default nat; ASSERT_SOME; DROP; + DROP; + UNIT; + NIL operation; + PAIR + }; diff --git a/tests_python/contracts_016/ill_typed/create_contract_rootname.tz b/tests_python/contracts_016/ill_typed/create_contract_rootname.tz new file mode 100644 index 000000000000..b85b4cf8bb41 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/create_contract_rootname.tz @@ -0,0 +1,15 @@ +# this contract creates a contract +parameter unit; +storage (option address); +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter %root unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {SOME;NIL operation}; CONS ; PAIR} # Ending calling convention stuff diff --git a/tests_python/contracts_016/ill_typed/dip_failwith.tz b/tests_python/contracts_016/ill_typed/dip_failwith.tz new file mode 100644 index 000000000000..fe3a17b7b1ab --- /dev/null +++ b/tests_python/contracts_016/ill_typed/dip_failwith.tz @@ -0,0 +1,4 @@ +# Test that DIP {FAILWITH} is not allowed by the typechecker +parameter string; +storage nat; +code { UNPAIR; DIP {FAILWITH} } diff --git a/tests_python/contracts_016/ill_typed/dup0.tz b/tests_python/contracts_016/ill_typed/dup0.tz new file mode 100644 index 000000000000..2e46599e490a --- /dev/null +++ b/tests_python/contracts_016/ill_typed/dup0.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { DUP 0 } diff --git a/tests_python/contracts_016/ill_typed/failwith_big_map.tz b/tests_python/contracts_016/ill_typed/failwith_big_map.tz new file mode 100644 index 000000000000..33d73c26123c --- /dev/null +++ b/tests_python/contracts_016/ill_typed/failwith_big_map.tz @@ -0,0 +1,22 @@ +# This contract uses FAILWITH to expose a big map diff +# See https://gitlab.com/tezos/tezos/-/issues/1708#note_667884499 + +parameter (big_map int int); + +# Even if the stored big_map is dropped by the initial CAR instruction, +# it can still be accessed by its big-map id and sent as parameter so +# it is important that the type of the storage matches the type of the +# parameter. + +# This test is now ill-typed because FAILWITH accepts only packable types + +storage (big_map int int); + +code { CAR; + PUSH (option int) (Some 1); + PUSH int 1; + UPDATE; + PUSH (option int) None; + PUSH int 2; + UPDATE; + FAILWITH } diff --git a/tests_python/contracts_016/ill_typed/invalid_self_entrypoint.tz b/tests_python/contracts_016/ill_typed/invalid_self_entrypoint.tz new file mode 100644 index 000000000000..4fac9c635044 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/invalid_self_entrypoint.tz @@ -0,0 +1,10 @@ +parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C))); +storage unit; +code { + DROP; + # This entrypoint does not exist + SELF %D; DROP; + UNIT; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/ill_typed/map_failwith.tz b/tests_python/contracts_016/ill_typed/map_failwith.tz new file mode 100644 index 000000000000..e3e19c0784ce --- /dev/null +++ b/tests_python/contracts_016/ill_typed/map_failwith.tz @@ -0,0 +1,4 @@ +# Test that MAP {FAILWITH} is not allowed by the typechecker +parameter (list nat); +storage unit; +code { UNPAIR; MAP {FAILWITH}; DROP; NIL operation; PAIR } diff --git a/tests_python/contracts_016/ill_typed/missing_only_code_field.tz b/tests_python/contracts_016/ill_typed/missing_only_code_field.tz new file mode 100644 index 000000000000..4b5b2cd62f56 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/missing_only_code_field.tz @@ -0,0 +1,2 @@ +storage unit; +parameter nat; \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/missing_only_parameter_field.tz b/tests_python/contracts_016/ill_typed/missing_only_parameter_field.tz new file mode 100644 index 000000000000..1f7e8ac75da9 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/missing_only_parameter_field.tz @@ -0,0 +1,4 @@ +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/missing_only_storage_field.tz b/tests_python/contracts_016/ill_typed/missing_only_storage_field.tz new file mode 100644 index 000000000000..2aa28922287a --- /dev/null +++ b/tests_python/contracts_016/ill_typed/missing_only_storage_field.tz @@ -0,0 +1,4 @@ +parameter nat; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/missing_parameter_and_storage_fields.tz b/tests_python/contracts_016/ill_typed/missing_parameter_and_storage_fields.tz new file mode 100644 index 000000000000..18e7b35b0a8c --- /dev/null +++ b/tests_python/contracts_016/ill_typed/missing_parameter_and_storage_fields.tz @@ -0,0 +1,3 @@ +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/multiple_code_field.tz b/tests_python/contracts_016/ill_typed/multiple_code_field.tz new file mode 100644 index 000000000000..cd47b356d14e --- /dev/null +++ b/tests_python/contracts_016/ill_typed/multiple_code_field.tz @@ -0,0 +1,6 @@ +parameter nat; +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR }; +code {} \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/multiple_parameter_field.tz b/tests_python/contracts_016/ill_typed/multiple_parameter_field.tz new file mode 100644 index 000000000000..e59fb9fe05be --- /dev/null +++ b/tests_python/contracts_016/ill_typed/multiple_parameter_field.tz @@ -0,0 +1,6 @@ +parameter nat; +parameter nat; +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/multiple_storage_and_code_fields.tz b/tests_python/contracts_016/ill_typed/multiple_storage_and_code_fields.tz new file mode 100644 index 000000000000..3b32484dc200 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/multiple_storage_and_code_fields.tz @@ -0,0 +1,7 @@ +parameter nat; +storage unit; +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR }; +code {} \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/multiple_storage_field.tz b/tests_python/contracts_016/ill_typed/multiple_storage_field.tz new file mode 100644 index 000000000000..06c25f51d3b2 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/multiple_storage_field.tz @@ -0,0 +1,6 @@ +parameter nat; +storage unit; +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/never_literal.tz b/tests_python/contracts_016/ill_typed/never_literal.tz new file mode 100644 index 000000000000..ba36b3b5f205 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/never_literal.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + PUSH never {}; + FAILWITH + } diff --git a/tests_python/contracts_016/ill_typed/pack_big_map.tz b/tests_python/contracts_016/ill_typed/pack_big_map.tz new file mode 100644 index 000000000000..29ae0d665051 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/pack_big_map.tz @@ -0,0 +1,7 @@ +parameter unit; +storage (pair (big_map int int) unit); +code { CDAR; + DUP; PACK; DROP; + UNIT; SWAP; PAIR; + NIL operation; + PAIR; } diff --git a/tests_python/contracts_016/ill_typed/pack_operation.tz b/tests_python/contracts_016/ill_typed/pack_operation.tz new file mode 100644 index 000000000000..349ca053af27 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/pack_operation.tz @@ -0,0 +1,20 @@ +parameter unit; +storage unit; +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP { DROP }; + # invalid PACK + PACK; + DROP; + UNIT; + NIL operation; + PAIR; } diff --git a/tests_python/contracts_016/ill_typed/pack_sapling_state.tz b/tests_python/contracts_016/ill_typed/pack_sapling_state.tz new file mode 100644 index 000000000000..0524d9b27911 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/pack_sapling_state.tz @@ -0,0 +1,13 @@ +# Verify SAPLING_STATE is not packable. The contract should not typecheck when using `PACK`. +# The lines below PACK are present only in case of PACK allows SAPLING_STATE to +# make the typechecker happy. +parameter unit; +storage (sapling_state 8); +code { UNPAIR; + DROP; + PACK; + DROP; + SAPLING_EMPTY_STATE 8; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/ill_typed/push_big_map_with_id_with_parens.tz b/tests_python/contracts_016/ill_typed/push_big_map_with_id_with_parens.tz new file mode 100644 index 000000000000..2c659e9a639d --- /dev/null +++ b/tests_python/contracts_016/ill_typed/push_big_map_with_id_with_parens.tz @@ -0,0 +1,10 @@ +# This contract verifies it is not possible to use the instruction `PUSH big_map +# tk tv i` where i is the ID of an existing big_map +parameter int; +storage (big_map string nat); +code { UNPAIR; + DROP; + PUSH (big_map string nat) 0; + NIL operation; + PAIR + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/push_big_map_with_id_without_parens.tz b/tests_python/contracts_016/ill_typed/push_big_map_with_id_without_parens.tz new file mode 100644 index 000000000000..c5eeef97c7e3 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/push_big_map_with_id_without_parens.tz @@ -0,0 +1,11 @@ +# This contract verifies it is not possible to use the instruction `PUSH big_map +# tk tv i` where i is the ID of an existing big_map +parameter int; +storage (big_map string nat); +code { + UNPAIR; + DROP; + PUSH big_map string nat 0; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/sapling_build_empty_state_with_int_parameter.tz b/tests_python/contracts_016/ill_typed/sapling_build_empty_state_with_int_parameter.tz new file mode 100644 index 000000000000..21b48391060b --- /dev/null +++ b/tests_python/contracts_016/ill_typed/sapling_build_empty_state_with_int_parameter.tz @@ -0,0 +1,10 @@ +parameter nat; +storage (sapling_state 8); +code { + UNPAIR; + SWAP; + DROP; + SAPLING_EMPTY_STATE; + NIL operation; + PAIR; + }; diff --git a/tests_python/contracts_016/ill_typed/set_update_non_comparable.tz b/tests_python/contracts_016/ill_typed/set_update_non_comparable.tz new file mode 100644 index 000000000000..4a70691793c7 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/set_update_non_comparable.tz @@ -0,0 +1,9 @@ +# This contract tests the error message in case the UPDATE instruction on set +# is used with a non-comparable type +parameter (set nat); +storage unit; +code { CAR; + PUSH bool True; + NIL operation; + UPDATE; + UNIT; NIL operation; PAIR; } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undig2able.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undig2able.tz new file mode 100644 index 000000000000..6f7061e004a0 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undig2able.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code { + DIG 2; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undigable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undigable.tz new file mode 100644 index 000000000000..2aba7d303eaf --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undigable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + DIG 0; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undip2able.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undip2able.tz new file mode 100644 index 000000000000..e048a24f74b8 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undip2able.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DUP; + DIP 2 { DUP }; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undipable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undipable.tz new file mode 100644 index 000000000000..09f94b133e50 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undipable.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code { + DIP { DUP }; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undropable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undropable.tz new file mode 100644 index 000000000000..d33142cdb82b --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undropable.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code { + DROP 2; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undug2able.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undug2able.tz new file mode 100644 index 000000000000..5eef1da706f2 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undug2able.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code { + DUG 2; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undugable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undugable.tz new file mode 100644 index 000000000000..eaf5d7d486e7 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undugable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + DUG 0; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_undup2able.tz b/tests_python/contracts_016/ill_typed/stack_bottom_undup2able.tz new file mode 100644 index 000000000000..c760764fd5b2 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_undup2able.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code { + DUP 2; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unfailwithable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unfailwithable.tz new file mode 100644 index 000000000000..c8cf263e5dcc --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unfailwithable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + FAILWITH; + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_ungetable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_ungetable.tz new file mode 100644 index 000000000000..6bc5a629e2a4 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_ungetable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + GET; + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unleftable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unleftable.tz new file mode 100644 index 000000000000..0bc846effa3b --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unleftable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + LEFT unit; + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unpairable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unpairable.tz new file mode 100644 index 000000000000..70f7e3a40c10 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unpairable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + UNPAIR; + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unpopable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unpopable.tz new file mode 100644 index 000000000000..0f1d8ea456a2 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unpopable.tz @@ -0,0 +1,10 @@ +parameter unit; +storage unit; +code { + DROP ; + DUP ; + DROP ; + PUSH unit Unit ; + NIL operation ; + PAIR + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unpopable_in_lambda.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unpopable_in_lambda.tz new file mode 100644 index 000000000000..4299b8bef474 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unpopable_in_lambda.tz @@ -0,0 +1,10 @@ +parameter unit; +storage unit; +code { + DROP ; + LAMBDA int unit { DROP ; DUP }; + DROP ; + PUSH unit Unit ; + NIL operation ; + PAIR + } diff --git a/tests_python/contracts_016/ill_typed/stack_bottom_unrightable.tz b/tests_python/contracts_016/ill_typed/stack_bottom_unrightable.tz new file mode 100644 index 000000000000..a7cf3d06a470 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/stack_bottom_unrightable.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { + DROP; + RIGHT unit; + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/ticket_apply.tz b/tests_python/contracts_016/ill_typed/ticket_apply.tz new file mode 100644 index 000000000000..a77fb08a6611 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/ticket_apply.tz @@ -0,0 +1,17 @@ +# This script attempts to duplicate a ticket by capturing it using APPLY. +# Is should fail at parsing because tickets are not packable so they are +# not allowed to be captured by APPLY. +parameter (ticket unit); +storage (option (pair (ticket unit) (ticket unit))); +code { + CAR; + LAMBDA (pair (ticket unit) unit) (ticket unit) { CAR }; + SWAP; APPLY; + DUP; + UNIT; EXEC; SWAP; + UNIT; EXEC; + PAIR; + SOME; + NIL operation; + PAIR + } diff --git a/tests_python/contracts_016/ill_typed/ticket_dup.tz b/tests_python/contracts_016/ill_typed/ticket_dup.tz new file mode 100644 index 000000000000..fee0ea3785bc --- /dev/null +++ b/tests_python/contracts_016/ill_typed/ticket_dup.tz @@ -0,0 +1,3 @@ +parameter (ticket %store nat) ; +storage unit; +code { UNPAIR; DUP; DROP 2; NIL operation; PAIR } diff --git a/tests_python/contracts_016/ill_typed/ticket_in_ticket.tz b/tests_python/contracts_016/ill_typed/ticket_in_ticket.tz new file mode 100644 index 000000000000..ef6a1dcb49fe --- /dev/null +++ b/tests_python/contracts_016/ill_typed/ticket_in_ticket.tz @@ -0,0 +1,17 @@ +# This script attempts to duplicate a ticket by storing it +# in another ticket and calling READ_TICKET twice on it. +# It should fail at parsing because ticket contents must be +# comparable so (ticket (ticket unit)) cannot be built. +parameter (ticket unit); +storage (option (pair (ticket unit) (ticket unit))); +code { + CAR; + PUSH nat 0; + SWAP; + TICKET; + ASSERT_SOME; + READ_TICKET; CDR; CAR; + SWAP; READ_TICKET; CDR; CAR; + SWAP; DROP; + PAIR; SOME; NIL operation; PAIR + } \ No newline at end of file diff --git a/tests_python/contracts_016/ill_typed/ticket_unpack.tz b/tests_python/contracts_016/ill_typed/ticket_unpack.tz new file mode 100644 index 000000000000..888746f42eb0 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/ticket_unpack.tz @@ -0,0 +1,5 @@ +# UNPACK on ticket should produce a type error +parameter unit; +storage (option (ticket nat)); +code { DROP ; PUSH nat 2 ; PACK ; UNPACK (ticket nat) ; + NIL operation ; PAIR } diff --git a/tests_python/contracts_016/ill_typed/uncomb0.tz b/tests_python/contracts_016/ill_typed/uncomb0.tz new file mode 100644 index 000000000000..9c3370912937 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/uncomb0.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { UNPAIR 0 } diff --git a/tests_python/contracts_016/ill_typed/uncomb1.tz b/tests_python/contracts_016/ill_typed/uncomb1.tz new file mode 100644 index 000000000000..6cc515335072 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/uncomb1.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { UNPAIR 1 } diff --git a/tests_python/contracts_016/ill_typed/unpack_sapling_state.tz b/tests_python/contracts_016/ill_typed/unpack_sapling_state.tz new file mode 100644 index 000000000000..a80f81eb84b6 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/unpack_sapling_state.tz @@ -0,0 +1,12 @@ +# Verify SAPLING_STATE is not packable. The contract should not typecheck when using `UNPACK`. +# The lines below UNPACK are present only in case of UNPACK allows SAPLING_STATE to +# make the typechecker happy. +parameter bytes; +storage (unit); +code { CAR; + UNPACK (sapling_state 8); + DROP; + PUSH unit Unit; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_char_set.tz b/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_char_set.tz new file mode 100644 index 000000000000..1bc14a4facef --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_char_set.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "^$&*!#~(-=)" nat ; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_type.tz b/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_type.tz new file mode 100644 index 000000000000..4bde2b617adc --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_bad_name_invalid_type.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW 1 nat ; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_bad_name_non_printable_char.tz b/tests_python/contracts_016/ill_typed/view_op_bad_name_non_printable_char.tz new file mode 100644 index 000000000000..22b3f5665af5 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_bad_name_non_printable_char.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "\\x00" nat ; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_bad_name_too_long.tz b/tests_python/contracts_016/ill_typed/view_op_bad_name_too_long.tz new file mode 100644 index 000000000000..263ecba19684 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_bad_name_too_long.tz @@ -0,0 +1,4 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" nat ; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; + diff --git a/tests_python/contracts_016/ill_typed/view_op_bad_return_type.tz b/tests_python/contracts_016/ill_typed/view_op_bad_return_type.tz new file mode 100644 index 000000000000..3c9ef69e7ffa --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_bad_return_type.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "add" string; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_dupable_type.tz b/tests_python/contracts_016/ill_typed/view_op_dupable_type.tz new file mode 100644 index 000000000000..45e7ebc43704 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_dupable_type.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "add" (ticket nat); DROP ; PUSH nat 1 ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_invalid_arity.tz b/tests_python/contracts_016/ill_typed/view_op_invalid_arity.tz new file mode 100644 index 000000000000..a56f40d15c54 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_invalid_arity.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "add" ; IF_SOME { } { PUSH nat 1 } ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/ill_typed/view_op_lazy_storage.tz b/tests_python/contracts_016/ill_typed/view_op_lazy_storage.tz new file mode 100644 index 000000000000..82bfb31f0bce --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_lazy_storage.tz @@ -0,0 +1,8 @@ +parameter address; +storage (big_map string nat); +code { + CAR; + UNIT; + VIEW "get_map" (big_map string nat); + IF_SOME { PUSH nat 10 ; SOME ; PUSH string "bar"; UPDATE; NIL operation; PAIR; } { FAIL; } + } diff --git a/tests_python/contracts_016/ill_typed/view_op_lazy_storage_type.tz b/tests_python/contracts_016/ill_typed/view_op_lazy_storage_type.tz new file mode 100644 index 000000000000..82bfb31f0bce --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_op_lazy_storage_type.tz @@ -0,0 +1,8 @@ +parameter address; +storage (big_map string nat); +code { + CAR; + UNIT; + VIEW "get_map" (big_map string nat); + IF_SOME { PUSH nat 10 ; SOME ; PUSH string "bar"; UPDATE; NIL operation; PAIR; } { FAIL; } + } diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_input_type.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_input_type.tz new file mode 100644 index 000000000000..9d1551d24285 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_input_type.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "add" string nat { UNPAIR; ADD } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_char_set.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_char_set.tz new file mode 100644 index 000000000000..f9d2a3f1ad5b --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_char_set.tz @@ -0,0 +1,5 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "^$&*!#~(-=)" nat nat { UNPAIR ; ADD } ; + diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_type.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_type.tz new file mode 100644 index 000000000000..fafd89ffd29a --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_invalid_type.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view 1 nat nat { UNPAIR ; ADD } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_non_printable_char.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_non_printable_char.tz new file mode 100644 index 000000000000..7a1128527518 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_non_printable_char.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "\\x00" nat nat { UNPAIR ; ADD } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_too_long.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_too_long.tz new file mode 100644 index 000000000000..4f61ae081410 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_name_too_long.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" nat nat { UNPAIR ; ADD } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_return_type.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_return_type.tz new file mode 100644 index 000000000000..4572674664ca --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_return_type.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "add" nat nat { DROP ; PUSH unit Unit } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_bad_type.tz b/tests_python/contracts_016/ill_typed/view_toplevel_bad_type.tz new file mode 100644 index 000000000000..a56d7bc4f88e --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_bad_type.tz @@ -0,0 +1,7 @@ +{ parameter nat; + storage nat; + code { CAR; NIL operation ; PAIR }; + view "add_v" nat nat { UNPAIR; ADD }; + view "mul_v" nat nat { UNPAIR; PUSH nat 30; LSR; }; +} + diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_input.tz b/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_input.tz new file mode 100644 index 000000000000..c252b2eddb28 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_input.tz @@ -0,0 +1,5 @@ +parameter nat; +storage nat; +code { CAR ; NIL operation ; PAIR } ; +view "dup" (ticket nat) nat { DROP; PUSH nat 1; PUSH nat 1 ; PAIR} ; + diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_output.tz b/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_output.tz new file mode 100644 index 000000000000..17919d0004dc --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_dupable_type_output.tz @@ -0,0 +1,4 @@ +parameter nat; +storage nat; +code { CAR ; NIL operation ; PAIR } ; +view "dup" address (ticket nat) { DROP; PUSH nat 1; PUSH nat 1 ; TICKET } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_duplicated_name.tz b/tests_python/contracts_016/ill_typed/view_toplevel_duplicated_name.tz new file mode 100644 index 000000000000..680b0ab585d1 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_duplicated_name.tz @@ -0,0 +1,5 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "add" nat nat { UNPAIR ; ADD } ; +view "add" nat unit { DROP ; PUSH unit Unit } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_invalid_arity.tz b/tests_python/contracts_016/ill_typed/view_toplevel_invalid_arity.tz new file mode 100644 index 000000000000..929e27b6a766 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_invalid_arity.tz @@ -0,0 +1,4 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "add" nat nat nat { UNPAIR ; ADD } ; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_input.tz b/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_input.tz new file mode 100644 index 000000000000..3ae7f626a1cf --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_input.tz @@ -0,0 +1,4 @@ +parameter unit; +storage nat; +code { FAIL }; +view "map" (big_map string nat) unit { DROP; UNIT;}; diff --git a/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_output.tz b/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_output.tz new file mode 100644 index 000000000000..b0ecc0503343 --- /dev/null +++ b/tests_python/contracts_016/ill_typed/view_toplevel_lazy_storage_output.tz @@ -0,0 +1,4 @@ +parameter unit; +storage nat; +code { FAIL; }; +view "get_map" unit (big_map string nat) { CDR; CDR; }; diff --git a/tests_python/contracts_016/legacy/create_account.tz b/tests_python/contracts_016/legacy/create_account.tz new file mode 100644 index 000000000000..7cd38465a10b --- /dev/null +++ b/tests_python/contracts_016/legacy/create_account.tz @@ -0,0 +1,29 @@ +/* +- optional storage: the address of the created account +- param: Left [hash]: + + Create an account with manager [hash]; then perform a recursive call + on Right [addr] where [addr] is the address of the newly created + account. + + The created account has an initial balance of 100tz. It is not + delegatable. + +- param: Right [addr]: + + Check that the sender is self and that [addr] is a contract of type + [unit]. Finally store [addr]. + +*/ +parameter (or key_hash address) ; +storage (option address) ; +code { CAR; + IF_LEFT + { DIP { PUSH mutez 100000000 ; PUSH bool False ; NONE key_hash }; + CREATE_ACCOUNT ; + DIP { RIGHT key_hash ; DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS } ; + CONS ; NONE address ; SWAP ; PAIR } + { SELF ; ADDRESS ; SENDER ; IFCMPNEQ { FAIL } {} ; + DUP ; CONTRACT unit ; IF_SOME { DROP ; SOME } { FAIL } ; + NIL operation ; PAIR } } ; diff --git a/tests_python/contracts_016/legacy/create_contract.tz b/tests_python/contracts_016/legacy/create_contract.tz new file mode 100644 index 000000000000..a162044ac62b --- /dev/null +++ b/tests_python/contracts_016/legacy/create_contract.tz @@ -0,0 +1,18 @@ +parameter (or key_hash address); +storage unit; +code { CAR; + IF_LEFT + { DIP { PUSH string "dummy"; + PUSH mutez 100000000 ; PUSH bool False ; + PUSH bool False ; NONE key_hash } ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; + DIP { RIGHT key_hash ; DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS } ; + CONS ; UNIT ; SWAP ; PAIR } + { SELF ; ADDRESS ; SENDER ; IFCMPNEQ { FAIL } {} ; + CONTRACT string ; IF_SOME {} { FAIL } ; + PUSH mutez 0 ; PUSH string "abcdefg" ; TRANSFER_TOKENS ; + NIL operation; SWAP; CONS ; UNIT ; SWAP ; PAIR } }; diff --git a/tests_python/contracts_016/legacy/create_contract_flags.tz b/tests_python/contracts_016/legacy/create_contract_flags.tz new file mode 100644 index 000000000000..888637dd7266 --- /dev/null +++ b/tests_python/contracts_016/legacy/create_contract_flags.tz @@ -0,0 +1,26 @@ +parameter (pair key_hash (pair bool bool)); +storage unit; +code { CAR; + + UNPAPAIR @mgr @spendable @deletagable; + DIP { NONE @delegate key_hash } ; + DIIIIP { UNIT @init; + PUSH @credit mutez 100000000 ; + }; + # type of legacy create_contract + # :: key_hash : option key_hash : bool : bool : mutez : 'g : 'S + # -> operation : address : 'S + CREATE_CONTRACT + { parameter (string %default) ; + storage unit ; + code { DROP; UNIT ; NIL operation ; PAIR } } ; + # simulate create_contract but typecheck for dev + # DROP 6; + # PUSH address "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; + # NONE key_hash; SET_DELEGATE @origination; + DIP { DROP }; + + NIL operation; + SWAP; CONS; + UNIT; SWAP; PAIR + }; diff --git a/tests_python/contracts_016/legacy/create_contract_rootname.tz b/tests_python/contracts_016/legacy/create_contract_rootname.tz new file mode 100644 index 000000000000..13e24ae5cc24 --- /dev/null +++ b/tests_python/contracts_016/legacy/create_contract_rootname.tz @@ -0,0 +1,18 @@ +parameter (or key_hash address); +storage unit; +code { CAR; + IF_LEFT + { DIP { PUSH string "dummy"; + PUSH mutez 100000000 ; PUSH bool False ; + PUSH bool False ; NONE key_hash } ; + CREATE_CONTRACT + { parameter (string %root) ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; + DIP { RIGHT key_hash ; DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS } ; + CONS ; UNIT ; SWAP ; PAIR } + { SELF ; ADDRESS ; SENDER ; IFCMPNEQ { FAIL } {} ; + CONTRACT string ; IF_SOME {} { FAIL } ; + PUSH mutez 0 ; PUSH string "abcdefg" ; TRANSFER_TOKENS ; + NIL operation; SWAP; CONS ; UNIT ; SWAP ; PAIR } }; diff --git a/tests_python/contracts_016/legacy/originator.tz b/tests_python/contracts_016/legacy/originator.tz new file mode 100644 index 000000000000..c454e230dc6d --- /dev/null +++ b/tests_python/contracts_016/legacy/originator.tz @@ -0,0 +1,16 @@ +parameter nat ; +storage (list address) ; +code + { DUP ; CAR ; PUSH nat 0 ; CMPNEQ ; + DIP { DUP ; CAR ; DIP { CDR ; NIL operation } } ; + LOOP + { PUSH mutez 5000000 ; + PUSH bool True ; # delegatable + NONE key_hash ; # delegate + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ; # manager + CREATE_ACCOUNT ; + SWAP ; DIP { SWAP ; DIP { CONS } } ; + SWAP ; DIP { SWAP ; DIP { CONS } } ; + PUSH nat 1 ; SWAP ; SUB ; ABS ; + DUP ; PUSH nat 0 ; CMPNEQ } ; + DROP ; PAIR } diff --git a/tests_python/contracts_016/legacy/steps_to_quota.tz b/tests_python/contracts_016/legacy/steps_to_quota.tz new file mode 100644 index 000000000000..78e76e308931 --- /dev/null +++ b/tests_python/contracts_016/legacy/steps_to_quota.tz @@ -0,0 +1,12 @@ +parameter int ; +storage nat ; +code { CAR; + DUP; + GT; + LOOP { PUSH int 1; SWAP; SUB; DUP; GT; }; + DROP; + STEPS_TO_QUOTA; + # PUSH nat 1; + NIL operation; + PAIR; + }; diff --git a/tests_python/contracts_016/macros/assert.tz b/tests_python/contracts_016/macros/assert.tz new file mode 100644 index 000000000000..6c5ce503b551 --- /dev/null +++ b/tests_python/contracts_016/macros/assert.tz @@ -0,0 +1,3 @@ +parameter bool; +storage unit; +code {CAR; ASSERT; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmpeq.tz b/tests_python/contracts_016/macros/assert_cmpeq.tz new file mode 100644 index 000000000000..55621bac8fe3 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmpeq.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPEQ; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmpge.tz b/tests_python/contracts_016/macros/assert_cmpge.tz new file mode 100644 index 000000000000..e98b17044541 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmpge.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPGE; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmpgt.tz b/tests_python/contracts_016/macros/assert_cmpgt.tz new file mode 100644 index 000000000000..7a44174b7259 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmpgt.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPGT; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmple.tz b/tests_python/contracts_016/macros/assert_cmple.tz new file mode 100644 index 000000000000..e4b61cfc44c3 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmple.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPLE; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmplt.tz b/tests_python/contracts_016/macros/assert_cmplt.tz new file mode 100644 index 000000000000..290b495378df --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmplt.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPLT; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_cmpneq.tz b/tests_python/contracts_016/macros/assert_cmpneq.tz new file mode 100644 index 000000000000..86b601393b8c --- /dev/null +++ b/tests_python/contracts_016/macros/assert_cmpneq.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; ASSERT_CMPNEQ; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_eq.tz b/tests_python/contracts_016/macros/assert_eq.tz new file mode 100644 index 000000000000..338096a6277c --- /dev/null +++ b/tests_python/contracts_016/macros/assert_eq.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_EQ; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_ge.tz b/tests_python/contracts_016/macros/assert_ge.tz new file mode 100644 index 000000000000..06bb3cec944b --- /dev/null +++ b/tests_python/contracts_016/macros/assert_ge.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_GE; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_gt.tz b/tests_python/contracts_016/macros/assert_gt.tz new file mode 100644 index 000000000000..d041093b0ebf --- /dev/null +++ b/tests_python/contracts_016/macros/assert_gt.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_GT; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_le.tz b/tests_python/contracts_016/macros/assert_le.tz new file mode 100644 index 000000000000..8250f3f3bdb1 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_le.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_LE; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_lt.tz b/tests_python/contracts_016/macros/assert_lt.tz new file mode 100644 index 000000000000..e387e9d74070 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_lt.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_LT; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/assert_neq.tz b/tests_python/contracts_016/macros/assert_neq.tz new file mode 100644 index 000000000000..83f19559e1d1 --- /dev/null +++ b/tests_python/contracts_016/macros/assert_neq.tz @@ -0,0 +1,3 @@ +parameter (pair int int); +storage unit; +code {CAR; DUP; CAR; DIP{CDR}; COMPARE; ASSERT_NEQ; UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/big_map_get_add.tz b/tests_python/contracts_016/macros/big_map_get_add.tz new file mode 100644 index 000000000000..2dcf1ce69a08 --- /dev/null +++ b/tests_python/contracts_016/macros/big_map_get_add.tz @@ -0,0 +1,7 @@ +parameter (pair (pair %set_pair int (option int)) (pair %check_pair int (option int))) ; +storage (pair (big_map int int) unit) ; +code { DUP ; DIP { CDAR } ; + DUP ; DIP { CADR; DUP ; CAR ; DIP { CDR } ; UPDATE ; DUP } ; + CADR ; DUP ; CDR ; DIP { CAR ; GET } ; + IF_SOME { SWAP ; IF_SOME { ASSERT_CMPEQ } {FAIL}} { ASSERT_NONE } ; + UNIT ; SWAP ; PAIR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/macros/big_map_mem.tz b/tests_python/contracts_016/macros/big_map_mem.tz new file mode 100644 index 000000000000..55736ab89da6 --- /dev/null +++ b/tests_python/contracts_016/macros/big_map_mem.tz @@ -0,0 +1,5 @@ +# Fails if the boolean does not match the membership criteria +parameter (pair int bool) ; +storage (pair (big_map int unit) unit) ; +code { DUP ; DUP ; CADR ; DIP { CAAR ; DIP { CDAR ; DUP } ; MEM } ; + ASSERT_CMPEQ ; UNIT ; SWAP ; PAIR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/macros/build_list.tz b/tests_python/contracts_016/macros/build_list.tz new file mode 100644 index 000000000000..842056d913ce --- /dev/null +++ b/tests_python/contracts_016/macros/build_list.tz @@ -0,0 +1,6 @@ +parameter nat; +storage (list nat); +code { CAR @counter; NIL @acc nat; SWAP; DUP @cmp_num; PUSH nat 0; CMPNEQ; + LOOP { DUP; DIP {SWAP}; CONS @acc; SWAP; PUSH nat 1; SWAP; SUB @counter; + DUP; DIP{ABS}; PUSH int 0; CMPNEQ}; + CONS; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/macros/carn_and_cdrn.tz b/tests_python/contracts_016/macros/carn_and_cdrn.tz new file mode 100644 index 000000000000..cc3cdccee81a --- /dev/null +++ b/tests_python/contracts_016/macros/carn_and_cdrn.tz @@ -0,0 +1,26 @@ +# Same as ../opcodes/comb-get.tz but using the CAR n and CDR n macros instead of GET +parameter (pair nat nat nat unit); +storage unit; +code { + CAR ; + + # Checking the first element + DUP ; CAR ; + PUSH nat 1 ; ASSERT_CMPEQ ; + DUP ; CAR 0 ; + PUSH nat 1 ; ASSERT_CMPEQ ; + + # Checking the second element + DUP ; CAR 1 ; + PUSH nat 4 ; ASSERT_CMPEQ ; + + # Checking the third element + DUP ; CAR 2 ; + PUSH nat 2 ; ASSERT_CMPEQ ; + + # Checking the last (fourth) element + DUP ; CDR 3 ; + UNIT ; ASSERT_CMPEQ ; + + DROP ; UNIT ; NIL operation ; PAIR + } diff --git a/tests_python/contracts_016/macros/compare.tz b/tests_python/contracts_016/macros/compare.tz new file mode 100644 index 000000000000..698ef3e695ed --- /dev/null +++ b/tests_python/contracts_016/macros/compare.tz @@ -0,0 +1,9 @@ +parameter (pair mutez mutez); +storage (list bool); +code {CAR; DUP; DUP; DUP; DUP; DIIIIIP {NIL bool}; + DIIIIP {DUP; CAR; DIP {CDR}; COMPARE; LE; CONS}; + DIIIP {DUP; CAR; DIP {CDR}; COMPARE; GE; CONS}; + DIIP{DUP; CAR; DIP {CDR}; COMPARE; LT; CONS}; + DIP {DUP; CAR; DIP {CDR}; COMPARE; GT; CONS}; + DUP; CAR; DIP {CDR}; COMPARE; EQ; CONS; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/macros/compare_bytes.tz b/tests_python/contracts_016/macros/compare_bytes.tz new file mode 100644 index 000000000000..3b5e5a9c400c --- /dev/null +++ b/tests_python/contracts_016/macros/compare_bytes.tz @@ -0,0 +1,9 @@ +parameter (pair bytes bytes); +storage (list bool); +code {CAR; DUP; DUP; DUP; DUP; DIIIIIP {NIL bool}; + DIIIIP {DUP; CAR; DIP {CDR}; COMPARE; LE; CONS}; + DIIIP {DUP; CAR; DIP {CDR}; COMPARE; GE; CONS}; + DIIP{DUP; CAR; DIP {CDR}; COMPARE; LT; CONS}; + DIP {DUP; CAR; DIP {CDR}; COMPARE; GT; CONS}; + DUP; CAR; DIP {CDR}; COMPARE; EQ; CONS; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/macros/fail.tz b/tests_python/contracts_016/macros/fail.tz new file mode 100644 index 000000000000..7f8bde252130 --- /dev/null +++ b/tests_python/contracts_016/macros/fail.tz @@ -0,0 +1,5 @@ +parameter unit; +storage unit; +code + { # This contract will never accept a incoming transaction + FAIL}; diff --git a/tests_python/contracts_016/macros/guestbook.tz b/tests_python/contracts_016/macros/guestbook.tz new file mode 100644 index 000000000000..b362f94b957e --- /dev/null +++ b/tests_python/contracts_016/macros/guestbook.tz @@ -0,0 +1,10 @@ +parameter string; +storage (map address (option string)); + +code { UNPAIR @message @guestbook; SWAP; + DUP; SENDER; GET @previous_message; + ASSERT_SOME; + ASSERT_NONE; + SWAP; SOME; SOME; SENDER; UPDATE; + NIL operation; + PAIR } diff --git a/tests_python/contracts_016/macros/macro_annotations.tz b/tests_python/contracts_016/macros/macro_annotations.tz new file mode 100644 index 000000000000..f48f18e3d942 --- /dev/null +++ b/tests_python/contracts_016/macros/macro_annotations.tz @@ -0,0 +1,6 @@ +parameter unit; +storage (pair (unit %truc) unit); +code { DROP; UNIT ; UNIT ; PAIR %truc ; UNIT ; + DUUP @new_storage ; + DIP { DROP ; DROP } ; + NIL operation ; PAIR } diff --git a/tests_python/contracts_016/macros/map_caddaadr.tz b/tests_python/contracts_016/macros/map_caddaadr.tz new file mode 100644 index 000000000000..45509839cc01 --- /dev/null +++ b/tests_python/contracts_016/macros/map_caddaadr.tz @@ -0,0 +1,4 @@ +parameter unit; +storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat); +code { MAP_CDADDAADR @new_storage %value { PUSH mutez 1000000 ; ADD } ; + NIL operation ; SWAP; SET_CAR }; diff --git a/tests_python/contracts_016/macros/max_in_list.tz b/tests_python/contracts_016/macros/max_in_list.tz new file mode 100644 index 000000000000..89c4955e9374 --- /dev/null +++ b/tests_python/contracts_016/macros/max_in_list.tz @@ -0,0 +1,9 @@ +parameter (list int); +storage (option int); +code {CAR; DIP{NONE int}; + ITER {SWAP; + IF_NONE {SOME} + {DIP {DUP}; DUP; DIP{SWAP}; + CMPLE; IF {DROP} {DIP {DROP}}; + SOME}}; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/macros/min.tz b/tests_python/contracts_016/macros/min.tz new file mode 100644 index 000000000000..cedd835bbac8 --- /dev/null +++ b/tests_python/contracts_016/macros/min.tz @@ -0,0 +1,11 @@ + +parameter (pair int int); +storage int; +code { CAR; # Ignore the storage + DUP; # Duplicate so we can get both the numbers passed as parameters + DUP; # Second dup so we can access the lesser number + CAR; DIP{CDR}; # Unpack the numbers on top of the stack + CMPLT; # Compare the two numbers, placing a boolean on top of the stack + IF {CAR} {CDR}; # Access the first number if the boolean was true + NIL operation; # Return no op + PAIR} # Pair the numbers satisfying the calling convention diff --git a/tests_python/contracts_016/macros/pair_macro.tz b/tests_python/contracts_016/macros/pair_macro.tz new file mode 100644 index 000000000000..55c70a3be3e9 --- /dev/null +++ b/tests_python/contracts_016/macros/pair_macro.tz @@ -0,0 +1,6 @@ +parameter unit; +storage unit; +code { UNIT; UNIT; UNIT; UNIT; UNIT; + PAPAPAPAIR @name %x1 %x2 %x3 %x4 %x5; + CDDDAR %x4 @fourth; + DROP; CDR; NIL operation; PAIR} diff --git a/tests_python/contracts_016/macros/set_caddaadr.tz b/tests_python/contracts_016/macros/set_caddaadr.tz new file mode 100644 index 000000000000..e98671e40989 --- /dev/null +++ b/tests_python/contracts_016/macros/set_caddaadr.tz @@ -0,0 +1,5 @@ +parameter mutez; +storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat); +code { DUP ; CAR ; SWAP ; CDR ; + SET_CADDAADR @toplevel_pair_name %value ; + NIL operation ; PAIR }; diff --git a/tests_python/contracts_016/macros/take_my_money.tz b/tests_python/contracts_016/macros/take_my_money.tz new file mode 100644 index 000000000000..bb502d041849 --- /dev/null +++ b/tests_python/contracts_016/macros/take_my_money.tz @@ -0,0 +1,9 @@ +parameter key_hash; +storage unit; +code { CAR; IMPLICIT_ACCOUNT; # Create an account for the recipient of the funds + DIP{UNIT}; # Push a value of the storage type below the contract + PUSH mutez 1000000; # The person can have a ꜩ + UNIT; # Push the contract's argument type + TRANSFER_TOKENS; # Run the transfer + NIL operation; SWAP; CONS; + PAIR }; # Cleanup and put the return values diff --git a/tests_python/contracts_016/macros/unpair_macro.tz b/tests_python/contracts_016/macros/unpair_macro.tz new file mode 100644 index 000000000000..384b6839d88b --- /dev/null +++ b/tests_python/contracts_016/macros/unpair_macro.tz @@ -0,0 +1,9 @@ +parameter (unit :param_unit); +storage (unit :u1); +code { DROP ; + UNIT :u4 @a4; UNIT :u3 @a3; UNIT :u2 @a2; UNIT :u1 @a1; + PAIR; UNPAIR @x1 @x2; + PPAIPAIR @p1 %x1 %x2 %x3 %x4; UNPPAIPAIR %x1 % %x3 %x4 @uno @due @tre @quattro; + PAPAPAIR @p2 %x1 %x2 %x3 %x4; UNPAPAPAIR @un @deux @trois @quatre; + PAPPAIIR @p3 %x1 %x2 %x3 %x4; UNPAPPAIIR @one @two @three @four; + DIP { DROP; DROP; DROP }; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/add_clear_tickets.tz b/tests_python/contracts_016/mini_scenarios/add_clear_tickets.tz new file mode 100644 index 000000000000..ed8cf6ce2b6d --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/add_clear_tickets.tz @@ -0,0 +1,6 @@ +parameter (or (pair %add nat string) (unit %clear)) ; +storage (list (ticket string)) ; +code { UNPAIR ; + IF_LEFT + { UNPAIR ; DIG 2 ; SWAP ; DIG 2 ; TICKET ; ASSERT_SOME ; CONS ; NIL operation ; PAIR } + { DROP 2 ; NIL (ticket string) ; NIL operation ; PAIR } } diff --git a/tests_python/contracts_016/mini_scenarios/authentication.tz b/tests_python/contracts_016/mini_scenarios/authentication.tz new file mode 100644 index 000000000000..021bbd26361a --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/authentication.tz @@ -0,0 +1,30 @@ +/* + +This contract is an example of using a cryptographic signature to +handle authentication. A public key is stored, and only the owner of +the secret key associated to this public key can interact with the +contract. She is allowed to perform any list of operations by sending +them wrapped in a lambda to the contract with a cryptographic +signature. + +To ensure that each signature is used only once and is not replayed by +an attacker, not only the lambda is signed but also the unique +identifier of the contract (a pair of the contract address and the +chain id) and a counter that is incremented at each successful call. + +More precisely, the signature should check against pack ((chain_id, +self) (param, counter)). + +*/ +parameter (pair (lambda unit (list operation)) signature); +storage (pair (nat %counter) key); +code + { + UNPPAIPAIR; + DUUUP; DUUP ; SELF; CHAIN_ID ; PPAIPAIR; PACK; + DIP { SWAP }; DUUUUUP ; DIP { SWAP }; + DUUUP; DIP {CHECK_SIGNATURE}; SWAP; IF {DROP} {FAILWITH}; + UNIT; EXEC; + DIP { PUSH nat 1; ADD }; + PAPAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/big_map_entrypoints.tz b/tests_python/contracts_016/mini_scenarios/big_map_entrypoints.tz new file mode 100644 index 000000000000..d49e6257167a --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/big_map_entrypoints.tz @@ -0,0 +1,31 @@ +storage + (pair (big_map string nat) (big_map string nat)) ; +parameter + (or (unit %default) + (or (or %mem (string %mem_left) (string %mem_right)) + (or (or %add (pair %add_left string nat) (pair %add_right string nat)) + (or %rem (string %rem_left) (string %rem_right))))) ; +code { UNPAIR ; + IF_LEFT + { DROP ; + DUP ; CAR ; + PUSH mutez 0 ; + NONE key_hash ; + CREATE_CONTRACT + { parameter string ; + storage (big_map string nat) ; + code { UNPAIR ; DROP ; NIL operation ; PAIR }} ; + DIP { DROP } ; + NIL operation ; SWAP ; CONS ; PAIR } + { IF_LEFT + { IF_LEFT + { DIP { UNPAIR } ; DIP { DUP } ; MEM ; ASSERT } + { DIP { UNPAIR ; SWAP } ; DIP { DUP } ; MEM ; ASSERT ; SWAP } } + { IF_LEFT + { IF_LEFT + { UNPAIR ; DIIP { UNPAIR } ; DIP { SOME } ; UPDATE } + { UNPAIR ; DIIP { UNPAIR ; SWAP } ; DIP { SOME } ; UPDATE ; SWAP } } + { IF_LEFT + { DIP { UNPAIR } ; DIP { NONE nat } ; UPDATE } + { DIP { UNPAIR ; SWAP } ; DIP { NONE nat } ; UPDATE ; SWAP } } } ; + PAIR ; NIL operation ; PAIR } } diff --git a/tests_python/contracts_016/mini_scenarios/big_map_magic.tz b/tests_python/contracts_016/mini_scenarios/big_map_magic.tz new file mode 100644 index 000000000000..f4e36f639bff --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/big_map_magic.tz @@ -0,0 +1,41 @@ +# this contracts handles two big_maps +storage + (or (pair (big_map string string) (big_map string string)) unit) ; +parameter + # it has 5 entry points + # swap: swaps the two maps. + (or (unit %swap) + # reset: resets storage, either to a new pair of maps, or to unit + (or (or %reset (pair (big_map string string) (big_map string string)) unit) + # import: drops the existing storage and creates two maps + # from the given lists of string pairs. + (or (pair %import (list (pair string string)) (list (pair string string))) + # add: adds the given list of key - value pairs into the + # first map + (or (list %add (pair string string)) + # rem: removes the given list of key - value pairs + # from the first map + (list %rem string))))) ; +code { UNPAIR ; + IF_LEFT + { DROP ; ASSERT_LEFT ; UNPAIR ; SWAP ; PAIR ; LEFT unit } + { IF_LEFT + { SWAP ; DROP } + { IF_LEFT + { DIP { ASSERT_RIGHT ; DROP } ; + UNPAIR ; + DIP { EMPTY_BIG_MAP string string } ; + ITER { UNPAIR ; DIP { SOME } ; UPDATE } ; + SWAP ; + DIP { EMPTY_BIG_MAP string string } ; + ITER { UNPAIR ; DIP { SOME } ; UPDATE } ; + SWAP ; + PAIR ; LEFT unit } + { IF_LEFT + { DIP { ASSERT_LEFT ; UNPAIR } ; + ITER { UNPAIR ; DIP { SOME } ; UPDATE } ; + PAIR ; LEFT unit } + { DIP { ASSERT_LEFT ; UNPAIR } ; + ITER { DIP { NONE string } ; UPDATE } ; + PAIR ; LEFT unit } }} } ; + NIL operation ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/big_map_read.tz b/tests_python/contracts_016/mini_scenarios/big_map_read.tz new file mode 100644 index 000000000000..60d666e28f29 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/big_map_read.tz @@ -0,0 +1,9 @@ +storage (nat); +parameter (big_map nat nat); +code { CAR; + PUSH nat 1; + GET; + ASSERT_SOME; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/mini_scenarios/big_map_store.tz b/tests_python/contracts_016/mini_scenarios/big_map_store.tz new file mode 100644 index 000000000000..4dc68145a691 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/big_map_store.tz @@ -0,0 +1,8 @@ +storage (big_map nat nat); +parameter (unit); +code { DROP; + EMPTY_BIG_MAP nat nat; + NIL operation; + PAIR; + } + diff --git a/tests_python/contracts_016/mini_scenarios/big_map_write.tz b/tests_python/contracts_016/mini_scenarios/big_map_write.tz new file mode 100644 index 000000000000..bde3b19baa3d --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/big_map_write.tz @@ -0,0 +1,10 @@ +storage (unit); +parameter (big_map nat nat); +code { UNPAIR ; + PUSH (option nat) (Some 1); + PUSH nat 1; + UPDATE; + DROP; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/mini_scenarios/create_contract.tz b/tests_python/contracts_016/mini_scenarios/create_contract.tz new file mode 100644 index 000000000000..0d09a1fdfca6 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/create_contract.tz @@ -0,0 +1,33 @@ +/* +- param: None: + + Create a contract then perform a recursive call on Some [addr] where + [addr] is the address of the newly created contract. + + The created contract simply stores its parameter (a string). It is + initialized with the storage "dummy" and has an initial balance of + 100tz. It has no delegate so these 100tz are totally frozen. + +- param: Some [addr]: + + Check that the sender is self, call the contract at address [addr] + with param "abcdefg" transferring 0tz. + +*/ +parameter (option address) ; +storage unit ; +code { CAR ; + IF_NONE + { PUSH string "dummy" ; + PUSH mutez 100000000 ; NONE key_hash ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; + DIP { SOME ; DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS } ; + CONS ; UNIT ; SWAP ; PAIR } + { SELF ; ADDRESS ; SENDER ; IFCMPNEQ { FAIL } {} ; + CONTRACT string ; IF_SOME {} { FAIL } ; + PUSH mutez 0 ; PUSH string "abcdefg" ; TRANSFER_TOKENS ; + NIL operation; SWAP; CONS ; UNIT ; SWAP ; PAIR } } ; \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/create_contract_simple.tz b/tests_python/contracts_016/mini_scenarios/create_contract_simple.tz new file mode 100644 index 000000000000..2a5185d74889 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/create_contract_simple.tz @@ -0,0 +1,14 @@ +parameter unit; +storage unit; +code { CAR; + PUSH string "foo"; + PUSH mutez 0; + NONE key_hash; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } ; + DROP; DROP; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/mini_scenarios/default_account.tz b/tests_python/contracts_016/mini_scenarios/default_account.tz new file mode 100644 index 000000000000..74e7693d7ba5 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/default_account.tz @@ -0,0 +1,9 @@ +/* +Send 100 tz to the implicit account given as parameter. +*/ + +parameter key_hash; +storage unit; +code {DIP{UNIT}; CAR; IMPLICIT_ACCOUNT; + PUSH mutez 100000000; UNIT; TRANSFER_TOKENS; + NIL operation; SWAP; CONS; PAIR} diff --git a/tests_python/contracts_016/mini_scenarios/execution_order_appender.tz b/tests_python/contracts_016/mini_scenarios/execution_order_appender.tz new file mode 100644 index 000000000000..9a519f780924 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/execution_order_appender.tz @@ -0,0 +1,17 @@ +# Given a storage (adr, str), calls the contract at adr with the +# parameter str +parameter unit; +storage (pair address string); +code { + CDR; + DUP; + UNPAIR; + CONTRACT string; + ASSERT_SOME; + PUSH mutez 0; + DIG 2; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR }; diff --git a/tests_python/contracts_016/mini_scenarios/execution_order_caller.tz b/tests_python/contracts_016/mini_scenarios/execution_order_caller.tz new file mode 100644 index 000000000000..ead37544f4e8 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/execution_order_caller.tz @@ -0,0 +1,17 @@ +# Given storage [adr1; ...; adrn], emits operations +# [ TRANSFER_TOKENS Unit (Mutez 0) adr1 ; +# ... ; +# TRANSFER_TOKENS Unit (Mutez 0) adrn ] +parameter unit; +storage (list address); +code { + CDR; + DUP; + MAP { + CONTRACT unit; + ASSERT_SOME; + PUSH mutez 0; + UNIT; + TRANSFER_TOKENS; + }; + PAIR }; diff --git a/tests_python/contracts_016/mini_scenarios/execution_order_storer.tz b/tests_python/contracts_016/mini_scenarios/execution_order_storer.tz new file mode 100644 index 000000000000..2bfc7505e9cd --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/execution_order_storer.tz @@ -0,0 +1,4 @@ +# Appends the parameter to the string in storage +parameter (string); +storage (string); +code { UNPAIR; SWAP; CONCAT; NIL operation; PAIR }; diff --git a/tests_python/contracts_016/mini_scenarios/fa12_reference.tz b/tests_python/contracts_016/mini_scenarios/fa12_reference.tz new file mode 100644 index 000000000000..7c2265072db4 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/fa12_reference.tz @@ -0,0 +1,749 @@ +# This contract comes from the gitlab.com/tzip/tzip repository. It is +# distributed under the CC0 1.0 license, which can be found at +# https://gitlab.com/tzip/tzip/-/blob/4b3c67aad5abbf04ec36caea4a1809e7b6e55bb8/LICENSE + +# Its purpose is to serve as a reference contract for TZIP-7, which +# defines Financial Assets 1.2. The original file can be found at +# https://gitlab.com/tzip/tzip/-/blob/4b3c67aad5abbf04ec36caea4a1809e7b6e55bb8/proposals/tzip-7/ManagedLedger.tz + +# This contract was generated from +# https://gitlab.com/morley-framework/morley/tree/ce28076a79b93d48aa7745271e6a1395b8b9e50d/lorentz-contracts/src/Lorentz/Contracts/ManagedLedger.hs +# Storage annotations were added manually. + +parameter (or (or (or (pair %transfer (address :from) + (pair (address :to) + (nat :value))) + (pair %approve (address :spender) + (nat :value))) + (or (pair %getAllowance (pair (address :owner) + (address :spender)) + (contract nat)) + (or (pair %getBalance (address :owner) + (contract nat)) + (pair %getTotalSupply unit + (contract nat))))) + (or (or (bool %setPause) + (address %setAdministrator)) + (or (pair %getAdministrator unit + (contract address)) + (or (pair %mint (address :to) + (nat :value)) + (pair %burn (address :from) + (nat :value)))))); +storage (pair (big_map %ledger (address :user) + (pair (nat :balance) + (map :approvals (address :spender) + (nat :value)))) + (pair (address %admin) + (pair (bool %paused) + (nat %totalSupply)))); +code { CAST (pair (or (or (or (pair address (pair address nat)) (pair address nat)) (or (pair (pair address address) (contract nat)) (or (pair address (contract nat)) (pair unit (contract nat))))) (or (or bool address) (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) (pair (big_map address (pair nat (map address nat))) (pair address (pair bool nat)))); + DUP; + CAR; + DIP { CDR }; + IF_LEFT { IF_LEFT { IF_LEFT { DIP { DUP; + CDR; + CDR; + CAR; + IF { UNIT; + PUSH string "TokenOperationsArePaused"; + PAIR; + FAILWITH } + { } }; + DUP; + DUP; + CDR; + CAR; + DIP { CAR }; + COMPARE; + EQ; + IF { DROP } + { DUP; + CAR; + SENDER; + COMPARE; + EQ; + IF { } + { DUP; + DIP { DUP; + DIP { DIP { DUP }; + CAR; + SENDER; + PAIR; + DUP; + DIP { CDR; + DIP { CAR }; + GET; + IF_NONE { EMPTY_MAP (address) nat } + { CDR } }; + CAR; + GET; + IF_NONE { PUSH nat 0 } + { } }; + DUP; + CAR; + DIP { SENDER; + DIP { DUP; + CDR; + CDR; + DIP { DIP { DUP }; + SWAP }; + SWAP; + SUB; + ISNAT; + IF_NONE { DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + CDR; + CDR; + PAIR; + PUSH string "NotEnoughAllowance"; + PAIR; + FAILWITH } + { } }; + PAIR }; + PAIR; + DIP { DROP; + DROP }; + DIP { DUP }; + SWAP; + DIP { DUP; + CAR }; + SWAP; + DIP { CAR }; + GET; + IF_NONE { PUSH nat 0; + DIP { EMPTY_MAP (address) nat }; + PAIR; + EMPTY_MAP (address) nat } + { DUP; + CDR }; + DIP { DIP { DUP }; + SWAP }; + SWAP; + CDR; + CDR; + DUP; + INT; + EQ; + IF { DROP; + NONE nat } + { SOME }; + DIP { DIP { DIP { DUP }; + SWAP }; + SWAP }; + SWAP; + CDR; + CAR; + UPDATE; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + CAR; + DIP { SOME }; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR } }; + DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + CDR; + CAR; + DIP { CAR }; + GET; + IF_NONE { DUP; + CDR; + CDR; + INT; + EQ; + IF { NONE (pair nat (map address nat)) } + { DUP; + CDR; + CDR; + DIP { EMPTY_MAP (address) nat }; + PAIR; + SOME } } + { DIP { DUP }; + SWAP; + CDR; + CDR; + DIP { DUP; + CAR }; + ADD; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + SOME }; + SWAP; + DUP; + DIP { CDR; + CAR; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR }; + DUP; + DIP { CDR; + CDR; + INT; + DIP { DUP; + CDR; + CDR; + CDR }; + ADD; + ISNAT; + IF_NONE { PUSH string "Internal: Negative total supply"; + FAILWITH } + { }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR }; + DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + CAR; + DIP { CAR }; + GET; + IF_NONE { CDR; + CDR; + PUSH nat 0; + SWAP; + PAIR; + PUSH string "NotEnoughBalance"; + PAIR; + FAILWITH } + { }; + DUP; + CAR; + DIP { DIP { DUP }; + SWAP }; + SWAP; + CDR; + CDR; + SWAP; + SUB; + ISNAT; + IF_NONE { CAR; + DIP { DUP }; + SWAP; + CDR; + CDR; + PAIR; + PUSH string "NotEnoughBalance"; + PAIR; + FAILWITH } + { }; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + DIP { DUP }; + SWAP; + DIP { DUP; + CAR; + INT; + EQ; + IF { DUP; + CDR; + SIZE; + INT; + EQ; + IF { DROP; + NONE (pair nat (map address nat)) } + { SOME } } + { SOME }; + SWAP; + CAR; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR }; + DUP; + DIP { CDR; + CDR; + NEG; + DIP { DUP; + CDR; + CDR; + CDR }; + ADD; + ISNAT; + IF_NONE { PUSH string "Internal: Negative total supply"; + FAILWITH } + { }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR }; + DROP }; + NIL operation; + PAIR } + { SENDER; + PAIR; + DIP { DUP; + CDR; + CDR; + CAR; + IF { UNIT; + PUSH string "TokenOperationsArePaused"; + PAIR; + FAILWITH } + { } }; + DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + DUP; + DIP { CAR; + DIP { CAR }; + GET; + IF_NONE { EMPTY_MAP (address) nat } + { CDR } }; + CDR; + CAR; + GET; + IF_NONE { PUSH nat 0 } + { }; + DUP; + INT; + EQ; + IF { DROP } + { DIP { DUP }; + SWAP; + CDR; + CDR; + INT; + EQ; + IF { DROP } + { PUSH string "UnsafeAllowanceChange"; + PAIR; + FAILWITH } }; + DIP { DUP }; + SWAP; + DIP { DUP; + CAR }; + SWAP; + DIP { CAR }; + GET; + IF_NONE { PUSH nat 0; + DIP { EMPTY_MAP (address) nat }; + PAIR; + EMPTY_MAP (address) nat } + { DUP; + CDR }; + DIP { DIP { DUP }; + SWAP }; + SWAP; + CDR; + CDR; + DUP; + INT; + EQ; + IF { DROP; + NONE nat } + { SOME }; + DIP { DIP { DIP { DUP }; + SWAP }; + SWAP }; + SWAP; + CDR; + CAR; + UPDATE; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + CAR; + DIP { SOME }; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + NIL operation; + PAIR } } + { IF_LEFT { DUP; + CAR; + DIP { CDR }; + DIP { DIP { DUP }; + SWAP }; + PAIR; + DUP; + CAR; + DIP { CDR }; + DUP; + DIP { CAR; + DIP { CAR }; + GET; + IF_NONE { EMPTY_MAP (address) nat } + { CDR } }; + CDR; + GET; + IF_NONE { PUSH nat 0 } + { }; + DIP { AMOUNT }; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR } + { IF_LEFT { DUP; + CAR; + DIP { CDR }; + DIP { DIP { DUP }; + SWAP }; + PAIR; + DUP; + CAR; + DIP { CDR }; + DIP { CAR }; + GET; + IF_NONE { PUSH nat 0 } + { CAR }; + DIP { AMOUNT }; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR } + { DUP; + CAR; + DIP { CDR }; + DIP { DIP { DUP }; + SWAP }; + PAIR; + CDR; + CDR; + CDR; + CDR; + DIP { AMOUNT }; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR } } } } + { IF_LEFT { IF_LEFT { DIP { DUP; + CDR; + CAR; + SENDER; + COMPARE; + EQ; + IF { } + { UNIT; + PUSH string "SenderIsNotAdmin"; + PAIR; + FAILWITH } }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + SWAP; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + NIL operation; + PAIR } + { DIP { DUP; + CDR; + CAR; + SENDER; + COMPARE; + EQ; + IF { } + { UNIT; + PUSH string "SenderIsNotAdmin"; + PAIR; + FAILWITH } }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + NIL operation; + PAIR } } + { IF_LEFT { DUP; + CAR; + DIP { CDR }; + DIP { DIP { DUP }; + SWAP }; + PAIR; + CDR; + CDR; + CAR; + DIP { AMOUNT }; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + PAIR } + { IF_LEFT { DIP { DUP; + CDR; + CAR; + SENDER; + COMPARE; + EQ; + IF { } + { UNIT; + PUSH string "SenderIsNotAdmin"; + PAIR; + FAILWITH } }; + DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + CAR; + DIP { CAR }; + GET; + IF_NONE { DUP; + CDR; + INT; + EQ; + IF { NONE (pair nat (map address nat)) } + { DUP; + CDR; + DIP { EMPTY_MAP (address) nat }; + PAIR; + SOME } } + { DIP { DUP }; + SWAP; + CDR; + DIP { DUP; + CAR }; + ADD; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + SOME }; + SWAP; + DUP; + DIP { CAR; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR }; + DUP; + DIP { CDR; + INT; + DIP { DUP; + CDR; + CDR; + CDR }; + ADD; + ISNAT; + IF_NONE { PUSH string "Internal: Negative total supply"; + FAILWITH } + { }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR }; + DROP; + NIL operation; + PAIR } + { DIP { DUP; + CDR; + CAR; + SENDER; + COMPARE; + EQ; + IF { } + { UNIT; + PUSH string "SenderIsNotAdmin"; + PAIR; + FAILWITH } }; + DIP { DUP }; + SWAP; + DIP { DUP }; + SWAP; + CAR; + DIP { CAR }; + GET; + IF_NONE { CDR; + PUSH nat 0; + SWAP; + PAIR; + PUSH string "NotEnoughBalance"; + PAIR; + FAILWITH } + { }; + DUP; + CAR; + DIP { DIP { DUP }; + SWAP }; + SWAP; + CDR; + SWAP; + SUB; + ISNAT; + IF_NONE { CAR; + DIP { DUP }; + SWAP; + CDR; + PAIR; + PUSH string "NotEnoughBalance"; + PAIR; + FAILWITH } + { }; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR; + DIP { DUP }; + SWAP; + DIP { DUP; + CAR; + INT; + EQ; + IF { DUP; + CDR; + SIZE; + INT; + EQ; + IF { DROP; + NONE (pair nat (map address nat)) } + { SOME } } + { SOME }; + SWAP; + CAR; + DIP { DIP { DUP; + CAR } }; + UPDATE; + DIP { DUP; + DIP { CDR }; + CAR }; + DIP { DROP }; + PAIR }; + DUP; + DIP { CDR; + NEG; + DIP { DUP; + CDR; + CDR; + CDR }; + ADD; + ISNAT; + IF_NONE { PUSH string "Internal: Negative total supply"; + FAILWITH } + { }; + DIP { DUP; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR; + SWAP; + PAIR; + DIP { DUP; + DIP { CAR }; + CDR }; + DIP { DROP }; + SWAP; + PAIR }; + DROP; + NIL operation; + PAIR } } } } }; diff --git a/tests_python/contracts_016/mini_scenarios/generic_multisig.tz b/tests_python/contracts_016/mini_scenarios/generic_multisig.tz new file mode 100644 index 000000000000..2e78f1cea983 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/generic_multisig.tz @@ -0,0 +1,92 @@ +# Source: https://github.com/murbard/smart-contracts/blob/master/multisig/michelson/generic.tz +parameter (or (unit %default) + (pair %main + (pair :payload + (nat %counter) # counter, used to prevent replay attacks + (or :action # payload to sign, represents the requested action + (lambda %operation unit (list operation)) + (pair %change_keys # change the keys controlling the multisig + (nat %threshold) # new threshold + (list %keys key)))) # new list of keys + (list %sigs (option signature)))); # signatures + +storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; + +code + { + UNPAIR ; + IF_LEFT + { # Default entry point: do nothing + # This entry point can be used to send tokens to this contract + DROP ; NIL operation ; PAIR } + { # Main entry point + # Assert no token was sent: + # to send tokens, the default entry point should be used + PUSH mutez 0 ; AMOUNT ; ASSERT_CMPEQ ; + SWAP ; DUP ; DIP { SWAP } ; + DIP + { + UNPAIR ; + # pair the payload with the current contract address, to ensure signatures + # can't be replayed accross different contracts if a key is reused. + DUP ; SELF ; ADDRESS ; CHAIN_ID ; PAIR ; PAIR ; + PACK ; # form the binary payload that we expect to be signed + DIP { UNPAIR @counter ; DIP { SWAP } } ; SWAP + } ; + + # Check that the counters match + UNPAIR @stored_counter; DIP { SWAP }; + ASSERT_CMPEQ ; + + # Compute the number of valid signatures + DIP { SWAP } ; UNPAIR @threshold @keys; + DIP + { + # Running count of valid signatures + PUSH @valid nat 0; SWAP ; + ITER + { + DIP { SWAP } ; SWAP ; + IF_CONS + { + IF_SOME + { SWAP ; + DIP + { + SWAP ; DIIP { DUUP } ; + # Checks signatures, fails if invalid + { DUUUP; DIP {CHECK_SIGNATURE}; SWAP; IF {DROP} {FAILWITH} }; + PUSH nat 1 ; ADD @valid } } + { SWAP ; DROP } + } + { + # There were fewer signatures in the list + # than keys. Not all signatures must be present, but + # they should be marked as absent using the option type. + FAIL + } ; + SWAP + } + } ; + # Assert that the threshold is less than or equal to the + # number of valid signatures. + ASSERT_CMPLE ; + # Assert no unchecked signature remains + IF_CONS {FAIL} {} ; + DROP ; + + # Increment counter and place in storage + DIP { UNPAIR ; PUSH nat 1 ; ADD @new_counter ; PAIR} ; + + # We have now handled the signature verification part, + # produce the operation requested by the signers. + IF_LEFT + { # Get operation + UNIT ; EXEC + } + { + # Change set of signatures + DIP { CAR } ; SWAP ; PAIR ; NIL operation + }; + PAIR } + } diff --git a/tests_python/contracts_016/mini_scenarios/groth16.tz b/tests_python/contracts_016/mini_scenarios/groth16.tz new file mode 100644 index 000000000000..66ff23a5e73b --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/groth16.tz @@ -0,0 +1,74 @@ +# The contract returns if the proof verifies, and fails otherwise. +# The verifying key, proof, and inputs are generated from +# ZoKrates, modified to use BLS12-381. +# The circuit proves knowledge of a square root of 113569. +storage unit; + +# The parameter is a pair consisting of: +# * A pair of Fr element inputs, x and y +# * A proof, consisting of +# * G1 points `a` and `c` +# * G2 point `b` +parameter (pair (pair (bls12_381_fr %input_x) (bls12_381_fr %input_y)) + (pair (pair (bls12_381_g1 %proof_a) (bls12_381_g2 %proof_b)) + (bls12_381_g1 %proof_c))); + +code + { + # Discard storage and unpair. Result stack should be + # input{x:y} : proof{a:b:c}. + CAR; UNPPAIPPAIIR; + + # Push the verifying key. Result stack should be + # input{x:y} + # : proof{a:b:c} + # : vk_{a:b:gamma:delta:gamma_{a:b:c}} + DIP 5 + { + PUSH @vk_gamma_c bls12_381_g1 0x063bd6e11e2fcaac1dd8cf68c6b1925a73c3c583e298ed37c41c3715115cf96358a42dbe85a0228cbfd8a6c8a8c54cd015b5ae2860d1cc47f84698d951f14d9448d03f04df2ca0ffe609a2067d6f1a892163a5e05e541279134cae52b1f23c6b; + + PUSH @vk_gamma_b bls12_381_g1 0x11f5b5db1da7f1f26217edcce2219d016003af6e5b4d1ca3ad0ff477e354717e658bf16beddc4f4fb76ce39d3327811e0601709dc7ed98c70463cfa1ba33f99851b52b51d1a042d7425bec6277287441c399973632445ce61e7fdd63a70f0f60; + + PUSH @vk_gamma_a bls12_381_g1 0x03535a322edd23c55b0ca025e54d450d95df49cc9ee873dcd500e8219f4771264bf159b3b105954d85c7bea8ffe1ea0400c767fe58989366c2837fba76f1b4f46644f19be8ad01e22d894b649e427e0d7e04677ee3919d982f0f96bb0a2f0c34; + + PUSH @vk_delta bls12_381_g2 0x10c6d5cdca84fc3c7f33061add256f48e0ab03a697832b338901898b650419eb6f334b28153fb73ad2ecd1cd2ac67053161e9f46cfbdaf7b1132a4654a55162850249650f9b873ac3113fa8c02ef1cd1df481480a4457f351d28f4da89d19fa405c3d77f686dc9a24d2681c9184bf2b091f62e6b24df651a3da8bd7067e14e7908fb02f8955b84af5081614cb5bc49b416d9edf914fc608c441b3f2eb8b6043736ddb9d4e4d62334a23b5625c14ef3e1a7e99258386310221b22d83a5eac035c; + + PUSH @vk_gamma bls12_381_g2 0x16dcbd28bff336c2649c7dd1d8391ac7ce6f7ef0124a9db7a4a485a124199eded7ce963c1c18aee1eca9994fe06f192c00e0fb653e1fc737d8d0e2f2f91424ca01f6e6e7c5c04f1c43db03a2900cf6b942aaed6ae77daea6200e094b78c38d770028d531a9d1a118ec23d5a39be7aa6dc28f778da1988856d2235c4a35e81fa48380f050d4baf7ebd7b5e058bf294da916afc34562f097c02a8fcbcf62a00de44f8ae6cfa7acb8ad254e3aeea8b2af12f65b7ee0f54855cb9bd432f3436f238f; + + PUSH @vk_b bls12_381_g2 0x0e9383f98df2c6e8b5b45f3876c3384596a0cdbc41349f83c4380bf463a050cdbd1d5057aa483a642e66486d1ed7362a1869e423c3877095e215c17282b11108601166f928043254bbce603bf86f4cec9f2e97e9660e98e4f5bce9b2b3bbacb40946b702ccfcc9a31e0bfc1543a2128edcc95807740a2310ae25eb47b935648e392c58dfae5b5e899d3b970d64e4e9e209741ea8bfedcfcc16b3fd890ff02c788ec0943feaaf01bbb354317acb85fcfd611133e4e563d53ca4e0f50e21cf2e7e; + + PUSH @vk_a bls12_381_g1 0x1040577c7d349e332735fc947c868c24a665f812f5dc1e7f60e65e2df80be2267a4b7341ed2287285fccd517acd96d910abba947235c364553aa6445f2f2b3a1a728225a330286ba5197ab87f0edc560d89fc7b623812f7d0d633341726e597a + }; + + # Compute vk_x as + # (vk_gamma_b * input_x) + (vk_gamma_c * input_y) + vk_gamma_a + # Result stack should be + # vk_x + # : input{x:y} + # : proof{a:b:c} + # : vk_{a:b:gamma:delta:gamma_{a:b:c}} + DUP; DUP 12; MUL; + DUP 3; DUP 14; MUL; + ADD; DUP 11; ADD @vk_x; + + # Push the list for the pairing check. The list should be + # [ (proof_a, proof_b); + # (-vk_x, vk_gamma); + # (-proof_c, vk_delta); + # (-vk_a, vk_b) ] + NIL (pair bls12_381_g1 bls12_381_g2); + DUP 9; DUP 9; NEG; PAIR; CONS; + DUP 11; DUP 8; NEG; PAIR; CONS; + DUP 10; DUP 3; NEG; PAIR; CONS; + DUP 6; DUP 6; PAIR; CONS; + + # Compute the pairing check and fail if it doesn't succeed + PAIRING_CHECK; ASSERT; + + # Drop the stack + DROP 13; + + # return no operations + UNIT; NIL operation; PAIR + + } diff --git a/tests_python/contracts_016/mini_scenarios/hardlimit.tz b/tests_python/contracts_016/mini_scenarios/hardlimit.tz new file mode 100644 index 000000000000..464062a52166 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/hardlimit.tz @@ -0,0 +1,5 @@ +parameter unit ; +storage int ; +code { # This contract stops accepting transactions after N incoming transactions + CDR ; DUP ; PUSH int 0 ; CMPLT; IF {PUSH int -1 ; ADD} {FAIL}; + NIL operation ; PAIR} ; diff --git a/tests_python/contracts_016/mini_scenarios/legacy_multisig.tz b/tests_python/contracts_016/mini_scenarios/legacy_multisig.tz new file mode 100644 index 000000000000..98ea6c603898 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/legacy_multisig.tz @@ -0,0 +1,78 @@ +parameter (pair + (pair :payload + (nat %counter) # counter, used to prevent replay attacks + (or :action # payload to sign, represents the requested action + (pair :transfer # transfer tokens + (mutez %amount) # amount to transfer + (contract %dest unit)) # destination to transfer to + (or + (option %delegate key_hash) # change the delegate to this address + (pair %change_keys # change the keys controlling the multisig + (nat %threshold) # new threshold + (list %keys key))))) # new list of keys + (list %sigs (option signature))); # signatures +storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; +code + { + UNPAIR ; SWAP ; DUP ; DIP { SWAP } ; + DIP + { + UNPAIR ; + # pair the payload with the current contract address, to ensure signatures + # can't be replayed across different contracts if a key is reused. + DUP ; SELF ; ADDRESS ; CHAIN_ID ; PAIR ; PAIR ; + PACK ; # form the binary payload that we expect to be signed + DIP { UNPAIR @counter ; DIP { SWAP } } ; SWAP + } ; + # Check that the counters match + UNPAIR @stored_counter; DIP { SWAP }; + ASSERT_CMPEQ ; + # Compute the number of valid signatures + DIP { SWAP } ; UNPAIR @threshold @keys; + DIP + { + # Running count of valid signatures + PUSH @valid nat 0; SWAP ; + ITER + { + DIP { SWAP } ; SWAP ; + IF_CONS + { + IF_SOME + { SWAP ; + DIP + { + SWAP ; DIIP { DUUP } ; + # Checks signatures, fails if invalid + { DUUUP; DIP {CHECK_SIGNATURE}; SWAP; IF {DROP} {FAILWITH} }; + PUSH nat 1 ; ADD @valid } } + { SWAP ; DROP } + } + { + # There were fewer signatures in the list + # than keys. Not all signatures must be present, but + # they should be marked as absent using the option type. + FAIL + } ; + SWAP + } + } ; + # Assert that the threshold is less than or equal to the + # number of valid signatures. + ASSERT_CMPLE ; + DROP ; DROP ; + # Increment counter and place in storage + DIP { UNPAIR ; PUSH nat 1 ; ADD @new_counter ; PAIR} ; + # We have now handled the signature verification part, + # produce the operation requested by the signers. + NIL operation ; SWAP ; + IF_LEFT + { # Transfer tokens + UNPAIR ; UNIT ; TRANSFER_TOKENS ; CONS } + { IF_LEFT { + # Change delegate + SET_DELEGATE ; CONS } + { + # Change set of signatures + DIP { SWAP ; CAR } ; SWAP ; PAIR ; SWAP }} ; + PAIR } diff --git a/tests_python/contracts_016/mini_scenarios/lockup.tz b/tests_python/contracts_016/mini_scenarios/lockup.tz new file mode 100644 index 000000000000..a8ff43aa0f85 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/lockup.tz @@ -0,0 +1,19 @@ +parameter unit; +storage (pair timestamp (pair mutez address)); +code { CDR; # Ignore the parameter + DUP; # Duplicate the storage + CAR; # Get the timestamp + NOW; # Push the current timestamp + CMPLT; # Compare to the current time + IF {FAIL} {}; # Fail if it is too soon + DUP; # Duplicate the storage value + # this must be on the bottom of the stack for us to call transfer tokens + CDR; # Ignore the timestamp, focussing in on the transfer data + DUP; # Duplicate the transfer information + CAR; # Get the amount of the transfer on top of the stack + DIP{CDR}; # Put the contract underneath it + DIP { CONTRACT unit ; ASSERT_SOME } ; + UNIT; # Put the contract's argument type on top of the stack + TRANSFER_TOKENS; # Emit the transfer + NIL operation; SWAP; CONS;# Make a singleton list of internal operations + PAIR} # Pair up to meet the calling convention diff --git a/tests_python/contracts_016/mini_scenarios/lqt_fa12.mligo.tz b/tests_python/contracts_016/mini_scenarios/lqt_fa12.mligo.tz new file mode 100644 index 000000000000..7f606cea3243 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/lqt_fa12.mligo.tz @@ -0,0 +1,328 @@ +# FA1.2 implementation used for Liquidity Baking + +{ parameter + (or (or (or (pair %approve (address %spender) (nat %value)) + (pair %getAllowance + (pair %request (address %owner) (address %spender)) + (contract %callback nat))) + (or (pair %getBalance (address %owner) (contract %callback nat)) + (pair %getTotalSupply (unit %request) (contract %callback nat)))) + (or (pair %mintOrBurn (int %quantity) (address %target)) + (pair %transfer (address %from) (pair (address %to) (nat %value))))) ; + storage + (pair (big_map %tokens address nat) + (pair (big_map %allowances (pair (address %owner) (address %spender)) nat) + (pair (address %admin) (nat %total_supply)))) ; + code { DUP ; + CDR ; + PUSH mutez 0 ; + AMOUNT ; + COMPARE ; + NEQ ; + IF { PUSH string "DontSendTez" ; FAILWITH } {} ; + SWAP ; + CAR ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + SWAP ; + DUP ; + DUG 2 ; + CAR ; + SENDER ; + PAIR ; + PUSH nat 0 ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + COMPARE ; + GT ; + PUSH nat 0 ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 3 ; + DUP ; + DUG 4 ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + COMPARE ; + GT ; + AND ; + IF { PUSH string "UnsafeAllowanceChange" ; FAILWITH } {} ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + DIG 2 ; + DIG 3 ; + CDR ; + PUSH nat 0 ; + SWAP ; + DUP ; + DUG 2 ; + COMPARE ; + EQ ; + IF { DROP ; NONE nat } { SOME } ; + DIG 3 ; + UPDATE ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + PUSH mutez 0 ; + DIG 4 ; + CDR ; + CAR ; + DIG 4 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + TRANSFER_TOKENS ; + CONS ; + PAIR } } + { IF_LEFT + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + PUSH mutez 0 ; + DIG 4 ; + CAR ; + DIG 4 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + TRANSFER_TOKENS ; + CONS ; + PAIR } + { SWAP ; + DUP ; + DIG 2 ; + NIL operation ; + SWAP ; + CDR ; + PUSH mutez 0 ; + DIG 3 ; + CDR ; + CDR ; + CDR ; + TRANSFER_TOKENS ; + CONS ; + PAIR } } } + { IF_LEFT + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CDR ; + CAR ; + SENDER ; + COMPARE ; + NEQ ; + IF { PUSH string "OnlyAdmin" ; FAILWITH } {} ; + DUP ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + ADD ; + ISNAT ; + IF_NONE + { PUSH string "Cannot burn more than the target's balance." ; FAILWITH } + {} ; + SWAP ; + DUP ; + DUG 2 ; + CAR ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + CDR ; + ADD ; + ABS ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + DIG 4 ; + CAR ; + PUSH nat 0 ; + DIG 4 ; + DUP ; + DUG 5 ; + COMPARE ; + EQ ; + IF { DIG 3 ; DROP ; NONE nat } { DIG 3 ; SOME } ; + DIG 4 ; + CDR ; + UPDATE ; + PAIR ; + DUP ; + DUG 2 ; + CDR ; + CDR ; + CAR ; + PAIR ; + SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } + { SWAP ; + DUP ; + DUG 2 ; + CDR ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + DIG 2 ; + DUP ; + DUG 3 ; + CAR ; + SENDER ; + COMPARE ; + EQ ; + IF { SWAP } + { SENDER ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + PAIR ; + DIG 3 ; + DUP ; + DUG 4 ; + CDR ; + CDR ; + DIG 3 ; + DUP ; + DUG 4 ; + DIG 2 ; + DUP ; + DUG 3 ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + SUB ; + ISNAT ; + IF_NONE { PUSH string "NotEnoughAllowance" ; FAILWITH } {} ; + DIG 3 ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 2 ; + UPDATE } ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CDR ; + DIG 2 ; + DUP ; + DUG 3 ; + DIG 4 ; + DUP ; + DUG 5 ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + SUB ; + ISNAT ; + IF_NONE { PUSH string "NotEnoughBalance" ; FAILWITH } {} ; + DIG 2 ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 3 ; + DUP ; + DUG 4 ; + CAR ; + UPDATE ; + DIG 2 ; + DUP ; + DUG 3 ; + CDR ; + CDR ; + SWAP ; + DUP ; + DUG 2 ; + DIG 4 ; + DUP ; + DUG 5 ; + CDR ; + CAR ; + GET ; + IF_NONE { PUSH nat 0 } {} ; + ADD ; + SWAP ; + PUSH nat 0 ; + DIG 2 ; + DUP ; + DUG 3 ; + COMPARE ; + EQ ; + IF { SWAP ; DROP ; NONE nat } { SWAP ; SOME } ; + DIG 3 ; + CDR ; + CAR ; + UPDATE ; + DIG 2 ; + CDR ; + SWAP ; + PAIR ; + DUP ; + CDR ; + CDR ; + DIG 2 ; + PAIR ; + SWAP ; + CAR ; + PAIR ; + NIL operation ; + PAIR } } } } diff --git a/tests_python/contracts_016/mini_scenarios/multiple_en2.tz b/tests_python/contracts_016/mini_scenarios/multiple_en2.tz new file mode 100644 index 000000000000..a1acafd48706 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/multiple_en2.tz @@ -0,0 +1,77 @@ +{ parameter unit ; + storage (option address) ; + code { SENDER ; + SELF ; + ADDRESS ; + { COMPARE ; + EQ ; + IF { CDR ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + DIP { NIL operation } ; + DUP ; + CONTRACT %add unit ; + { IF_NONE {} { { UNIT ; FAILWITH } } } ; + DUP ; + CONTRACT %fact nat ; + { IF_NONE {} { { UNIT ; FAILWITH } } } ; + DUP ; + CONTRACT %add nat ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + PUSH mutez 0 ; + PUSH nat 12 ; + TRANSFER_TOKENS ; + SWAP ; + DIP { CONS } ; + DUP ; + CONTRACT unit ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + PUSH mutez 0 ; + PUSH unit Unit ; + TRANSFER_TOKENS ; + SWAP ; + DIP { CONS } ; + DUP ; + CONTRACT %sub nat ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + PUSH mutez 0 ; + PUSH nat 3 ; + TRANSFER_TOKENS ; + SWAP ; + DIP { CONS } ; + DUP ; + CONTRACT %add nat ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + PUSH mutez 0 ; + PUSH nat 5 ; + TRANSFER_TOKENS ; + SWAP ; + DIP { CONS } ; + DROP ; + DIP { NONE address } ; + PAIR } + { CAR ; + DUP ; + DIP { DIP { PUSH int 0 ; PUSH mutez 0 ; NONE key_hash } ; + DROP ; + CREATE_CONTRACT + { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; + storage int ; + code { AMOUNT ; + PUSH mutez 0 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + { { DUP ; CAR ; DIP { CDR } } } ; + IF_LEFT + { IF_LEFT { ADD } { SWAP ; SUB } } + { DROP ; DROP ; PUSH int 0 } ; + NIL operation ; + PAIR } } } ; + DIP { SELF ; PUSH mutez 0 } ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + SWAP ; + CONS ; + DIP { SOME } ; + PAIR } } + } } diff --git a/tests_python/contracts_016/mini_scenarios/multiple_entrypoints_counter.tz b/tests_python/contracts_016/mini_scenarios/multiple_entrypoints_counter.tz new file mode 100644 index 000000000000..740190697171 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/multiple_entrypoints_counter.tz @@ -0,0 +1,29 @@ +{ parameter unit ; + storage (option address) ; + code { SENDER ; SELF ; ADDRESS ; + IFCMPEQ + { CDR ; ASSERT_SOME ; + DIP { NIL operation } ; + DUP ; CONTRACT %add unit ; ASSERT_NONE ; + DUP ; CONTRACT %fact nat ; ASSERT_NONE ; + DUP ; CONTRACT %add nat ; ASSERT_SOME ; PUSH mutez 0 ; PUSH nat 12 ; TRANSFER_TOKENS ; SWAP ; DIP { CONS } ; + DUP ; CONTRACT unit ; ASSERT_SOME ; PUSH mutez 0 ; PUSH unit Unit ; TRANSFER_TOKENS ; SWAP ; DIP { CONS } ; + DUP ; CONTRACT %sub nat ; ASSERT_SOME ; PUSH mutez 0 ; PUSH nat 3 ; TRANSFER_TOKENS ; SWAP ; DIP { CONS } ; + DUP ; CONTRACT %add nat ; ASSERT_SOME ; PUSH mutez 0 ; PUSH nat 5 ; TRANSFER_TOKENS ; SWAP ; DIP { CONS } ; + DROP ; DIP { NONE address } ; PAIR } + { CAR ; DUP ; + DIP + { DIP { PUSH int 0 ; PUSH mutez 0 ; NONE key_hash } ; + DROP ; + CREATE_CONTRACT + { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; + storage int ; + code { AMOUNT ; PUSH mutez 0 ; ASSERT_CMPEQ ; + UNPAIR ; + IF_LEFT + { IF_LEFT { ADD } { SWAP ; SUB } } + { DROP ; DROP ; PUSH int 0 } ; + NIL operation ; PAIR } } } ; + DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; SWAP ; CONS ; + DIP { SOME } ; PAIR } } } \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/originate_contract.tz b/tests_python/contracts_016/mini_scenarios/originate_contract.tz new file mode 100644 index 000000000000..473143da42f5 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/originate_contract.tz @@ -0,0 +1,14 @@ +parameter unit; +storage unit; +code { DROP; + UNIT; + AMOUNT; + NONE key_hash; + CREATE_CONTRACT + { parameter unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {DROP; PUSH unit Unit; NIL operation};CONS ; PAIR} diff --git a/tests_python/contracts_016/mini_scenarios/parameterized_multisig.tz b/tests_python/contracts_016/mini_scenarios/parameterized_multisig.tz new file mode 100644 index 000000000000..16f785ae0a25 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/parameterized_multisig.tz @@ -0,0 +1,24 @@ +storage (pair bool (pair (map nat (pair bool bool)) (pair key key))); +parameter (or nat (pair signature nat)); +code { DUP; CAR; DIP{CDDR}; # Stack tangling + IF_LEFT { DIP{DUP; CAR}; GET; # Get the value stored for that index + IF_NONE { PUSH bool False} # If not referenced, reject + { DUP; CAR; DIP{CDR}; AND}; + PAIR} + { DUP; CAR; DIP{CDR; DUP; PACK ; BLAKE2B}; PAIR; SWAP; # Create the signature pair + DIP{ DIP{DUP; CDR; DIP{CAR}; DUP}; + SWAP; CAR; DIP{DUP; UNPAIR}; CHECK_SIGNATURE }; # Check the first signature + SWAP; + # If the signature typechecked, get and update the first element of the pair + IF { DIP{DROP; SWAP; DUP}; DUP; + DIP{ GET; IF_NONE{PUSH (pair bool bool) (Pair False False)} {}; + CDR; PUSH bool True; PAIR; SOME }} + # Check the second signature + { DIP{DIP{DUP; CDR}; SWAP; DIP {UNPAIR}; CHECK_SIGNATURE}; SWAP; + IF { DUP; DIP{DIP{SWAP; DUP}; GET}; SWAP; + IF_NONE {PUSH (pair bool bool) (Pair False False)} {}; + CAR; PUSH bool True; SWAP; PAIR; SOME; SWAP} + {FAIL}}; + # Update the stored value and finish off + UPDATE; PAIR; PUSH bool False; PAIR}; + NIL operation; PAIR } diff --git a/tests_python/contracts_016/mini_scenarios/receive_tickets_in_big_map.tz b/tests_python/contracts_016/mini_scenarios/receive_tickets_in_big_map.tz new file mode 100644 index 000000000000..f8af0da0173a --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/receive_tickets_in_big_map.tz @@ -0,0 +1,3 @@ +parameter (big_map int (ticket string)); +storage (big_map int (ticket string)); +code { CAR; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/mini_scenarios/replay.tz b/tests_python/contracts_016/mini_scenarios/replay.tz new file mode 100644 index 000000000000..e03ac4ab2113 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/replay.tz @@ -0,0 +1,8 @@ +# This contract always fail because it tries to execute twice the same operation +parameter unit ; +storage unit ; +code { CDR ; NIL operation ; + SOURCE ; CONTRACT unit ; ASSERT_SOME ; + PUSH mutez 1 ; UNIT ; TRANSFER_TOKENS ; + DUP ; DIP { CONS } ; CONS ; + PAIR } diff --git a/tests_python/contracts_016/mini_scenarios/reveal_signed_preimage.tz b/tests_python/contracts_016/mini_scenarios/reveal_signed_preimage.tz new file mode 100644 index 000000000000..1a7e97eb8a68 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/reveal_signed_preimage.tz @@ -0,0 +1,13 @@ +parameter (pair bytes signature) ; +storage (pair bytes key) ; +code { + #check that sha256(param.bytes) == storage.bytes + DUP ; UNPAIR ; CAR; SHA256; DIP { CAR } ; ASSERT_CMPEQ ; + + # check that the sig is a valid signature of the preimage + DUP ; UNPAIR ; SWAP ; DIP { UNPAIR ; SWAP } ; CDR ; CHECK_SIGNATURE ; ASSERT ; + + # send all our tokens to the implicit account corresponding to the stored public key + CDR ; DUP ; CDR ; HASH_KEY ; IMPLICIT_ACCOUNT ; + BALANCE ; UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/self_address_receiver.tz b/tests_python/contracts_016/mini_scenarios/self_address_receiver.tz new file mode 100644 index 000000000000..6ebda8daad9e --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/self_address_receiver.tz @@ -0,0 +1,12 @@ +# See self_address_sender.tz +parameter (lambda unit address); +storage unit; +code { + UNPAIR; + UNIT; + EXEC; + SELF_ADDRESS; + ASSERT_CMPEQ; + NIL operation; + PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/self_address_sender.tz b/tests_python/contracts_016/mini_scenarios/self_address_sender.tz new file mode 100644 index 000000000000..b0f74073c2ff --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/self_address_sender.tz @@ -0,0 +1,17 @@ +# This tests that the SELF_ADDRESS inside a lambda returns the address +# of the contract executing the lambda (not the contract defining it). +# To do so, two contracts called the sender and the receiver are used. +# The sender (this contract) sends the lambda { DROP; SELF_ADDRESS } +# to the receiver (see self_address_receiver.tz) who checks that the +# returned value is the same as its SELF_ADDRESS. +parameter (contract (lambda unit address)); +storage unit; +code { + CAR; + BALANCE; + LAMBDA unit address { DROP; SELF_ADDRESS }; + TRANSFER_TOKENS; + DIP { UNIT; NIL operation }; + CONS; + PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/send_tickets_in_big_map.tz b/tests_python/contracts_016/mini_scenarios/send_tickets_in_big_map.tz new file mode 100644 index 000000000000..050d64cd6071 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/send_tickets_in_big_map.tz @@ -0,0 +1,47 @@ +# This contract takes an address, mints 100 string tickets, puts them in a +# big-map and sends the big-map to the given address. +parameter address ; +storage unit ; +code { CAR ; + CONTRACT (big_map int (ticket string)) ; + IF_NONE + { PUSH string "Contract of type `big_map(ticket(string))` not found" ; + FAILWITH } + { EMPTY_BIG_MAP int (ticket string) ; + PUSH int 100 ; + SWAP ; + PAIR ; + LEFT (big_map int (ticket string)) ; + LOOP_LEFT + { UNPAIR ; + SWAP ; + DUP ; + DUG 2 ; + PUSH int 0 ; + COMPARE ; + LT ; + IF { PUSH int 1 ; + DUP 3 ; + SUB ; + SWAP ; + PUSH nat 1 ; + PUSH string "BLUE" ; + TICKET ; + ASSERT_SOME ; + DIG 3 ; + SWAP ; + SOME ; + SWAP ; + UPDATE ; + PAIR ; + LEFT (big_map int (ticket string)) } + { SWAP ; DROP ; RIGHT (pair (big_map int (ticket string)) int) } } ; + SWAP ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } diff --git a/tests_python/contracts_016/mini_scenarios/ticket_builder_fungible.tz b/tests_python/contracts_016/mini_scenarios/ticket_builder_fungible.tz new file mode 100644 index 000000000000..17a0be3750ac --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/ticket_builder_fungible.tz @@ -0,0 +1,40 @@ +## A simple fungible token contract implemented using tickets of type +## [ticket unit]. + +## To store and transfer the tokens see ticket_wallet_fungible.tz + +## For non-fungible tokens, see ticket_builder_non_fungible.tz + +parameter (or (ticket %burn unit) (pair %mint (contract %destination (ticket unit)) (nat %amount))); +storage address; +code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR; + IF_LEFT + { + # Burn entrypoint + + # Check that the ticket is ticketed by ourselves + READ_TICKET; CAR; SELF_ADDRESS; ASSERT_CMPEQ; + + # Drop the ticket + DROP; + + # Finish + NIL operation + } + { + # Mint entrypoint + + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + UNPAIR; + SWAP; UNIT; TICKET; ASSERT_SOME; + PUSH mutez 0; SWAP; TRANSFER_TOKENS; + NIL operation; SWAP; CONS + }; + PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/ticket_builder_non_fungible.tz b/tests_python/contracts_016/mini_scenarios/ticket_builder_non_fungible.tz new file mode 100644 index 000000000000..df7e19a4f349 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/ticket_builder_non_fungible.tz @@ -0,0 +1,47 @@ +## A simple non-fungible token contract implemented using tickets of +## type [ticket nat] with amounts of 1. + +## To store and transfer the tokens see ticket_wallet_non_fungible.tz + +## For fungible tokens, see ticket_builder_fungible.tz + +parameter (or (ticket %burn nat) (contract %mint_destination (ticket nat))); +storage (pair (address %manager) (nat %counter)); +code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR 3; + IF_LEFT + { + # Burn entrypoint + + # Check that the ticket is ticketed by ourselves + READ_TICKET; CAR; SELF_ADDRESS; ASSERT_CMPEQ; + + # Drop the ticket + DROP; + + # Finish + NIL operation + } + { + # Mint entrypoint + + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + # Mint the token + PUSH @amount nat 1; + DUP @counter 4; + TICKET; ASSERT_SOME; # This is safe because the amount is not zero + + # Send it + PUSH mutez 0; SWAP; TRANSFER_TOKENS; + NIL operation; SWAP; CONS; + + # Increment counter + DIP 2 {PUSH nat 1; ADD}; + }; + PAIR 3 + } diff --git a/tests_python/contracts_016/mini_scenarios/ticket_wallet_fungible.tz b/tests_python/contracts_016/mini_scenarios/ticket_wallet_fungible.tz new file mode 100644 index 000000000000..2824f21e7b88 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/ticket_wallet_fungible.tz @@ -0,0 +1,103 @@ +## A simple wallet for fungible tokens implemented using tickets of +## type [ticket unit]. + +## For actually minting or burning the tokens, see ticket_builder_fungible.tz + +## For non-fungible tokens, see ticket_wallet_non_fungible.tz + +parameter (or (ticket %receive unit) (pair %send (contract %destination (ticket unit)) (nat %amount) (address %ticketer))); +storage (pair (address %manager) (big_map %tickets address (ticket unit))); +code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR 3; + IF_LEFT + { + # Receive entrypoint + + # Get the ticketer + READ_TICKET; CAR @ticketer; DUP; + + # Extract the associated ticket, if any, from the stored big map + DIG 4; + NONE (ticket unit); + DIG 2; + GET_AND_UPDATE; + + # Join it with the parameter + IF_SOME + { + DIG 3; + PAIR; + JOIN_TICKETS; + ASSERT_SOME + } + { DIG 2 }; + SOME; + DIG 2; + GET_AND_UPDATE; + ASSERT_NONE; + SWAP; + PAIR; + NIL operation + } + { + # Send entrypoints + + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + UNPAIR 3; + + # Get the ticket associated to the requested ticketer + DIG 4; + NONE (ticket unit); + DUP @ticketer 5; + GET_AND_UPDATE; + ASSERT_SOME; + + # Substract the requested amount + READ_TICKET; + GET @total_amount 4; + DUP @amount 5; + SWAP; SUB; + DUP; EQ; + IF + { + # Drop @remaining_amount because it is zero + DROP; + # Drop @amount because this is now irrelevant + DIG 3; DROP; + # Drop @ticketer because we are not storing any ticket in this wallet + DIG 3; DROP; + # Bring the big map to the stack top since the ticket entry is already striked out + DUG 3 + } + { + ISNAT; ASSERT_SOME @remaining_amount; + + # Split the ticket + DIG 4; PAIR; SWAP; SPLIT_TICKET; + ASSERT_SOME; UNPAIR @to_send @to_keep; + + # Store the ticket to keep + DUG 5; + SOME; + DIG 3; + GET_AND_UPDATE; + ASSERT_NONE; + }; + DIG 2; PAIR; + + # Send the ticket + SWAP; + PUSH mutez 0; + DIG 3; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + }; + PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/ticket_wallet_non_fungible.tz b/tests_python/contracts_016/mini_scenarios/ticket_wallet_non_fungible.tz new file mode 100644 index 000000000000..ba0170ae830e --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/ticket_wallet_non_fungible.tz @@ -0,0 +1,61 @@ +## A simple wallet for non-fungible tokens implemented using tickets +## of type [ticket nat]. + +## For each nat [n], the ticketer is assumed to produce at most one +## ticket containing [n] and to always use amounts of exactly one. + +## For fungible tokens, see ticket_wallet_fungible.tz + +parameter (or (ticket %receive nat) (pair %send (contract %destination (ticket nat)) (address %ticketer) (nat %id))); +storage (pair (address %manager) (big_map %tickets (pair address nat) (ticket nat))); +code + { + AMOUNT; PUSH mutez 0; ASSERT_CMPEQ; + + UNPAIR 3; + IF_LEFT + { + # Receive entrypoint + + # Get the ticketer and id + READ_TICKET; CAST (pair (address %ticketer) (nat %id) (nat %amount)); + UNPAIR 3; + DIG 2; PUSH nat 1; ASSERT_CMPEQ; # This checks that the amount is 1 + PAIR; + + # Extract the associated ticket, if any, from the stored big map + DIP {SOME; DIP {SWAP}}; + GET_AND_UPDATE; + ASSERT_NONE; + + SWAP; + PAIR; + NIL operation + } + { + # Send entrypoints + + # Authenticate SENDER + DUP @manager 2; SENDER; ASSERT_CMPEQ; + + UNPAIR; + + # Get the ticket associated to the requested ticketer and id + DIG 3; + NONE (ticket nat); + DIG 3; + GET_AND_UPDATE; + ASSERT_SOME; + + SWAP; DIG 3; PAIR; DUG 2; + + # Send the ticket + PUSH mutez 0; + SWAP; + TRANSFER_TOKENS; + NIL operation; + SWAP; + CONS; + }; + PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/vote_for_delegate.tz b/tests_python/contracts_016/mini_scenarios/vote_for_delegate.tz new file mode 100644 index 000000000000..1155c073f588 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/vote_for_delegate.tz @@ -0,0 +1,30 @@ +parameter (option key_hash) ; +storage (pair + (pair %mgr1 (address %addr) (option %key key_hash)) + (pair %mgr2 (address %addr) (option %key key_hash))) ; +code { # Update the storage + DUP ; CDAAR %addr @%; SENDER ; PAIR %@ %@; UNPAIR; + IFCMPEQ + { UNPAIR ; SWAP ; SET_CADR %key @changed_mgr1_key } + { DUP ; CDDAR ; SENDER ; + IFCMPEQ + { UNPAIR ; SWAP ; SET_CDDR %key } + { FAIL } } ; + # Now compare the proposals + DUP ; CADR ; + DIP { DUP ; CDDR } ; + IF_NONE + { IF_NONE + { NONE key_hash ; + SET_DELEGATE ; NIL operation ; SWAP ; CONS } + { DROP ; NIL operation } } + { SWAP ; + IF_SOME + { DIP { DUP } ; + IFCMPEQ + { SOME ; + SET_DELEGATE ; NIL operation ; SWAP ; CONS } + { DROP ; + NIL operation }} + { DROP ; NIL operation }} ; + PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/mini_scenarios/weather_insurance.tz b/tests_python/contracts_016/mini_scenarios/weather_insurance.tz new file mode 100644 index 000000000000..e7e99e018335 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/weather_insurance.tz @@ -0,0 +1,19 @@ +parameter (pair (signature %signed_weather_data) (nat :rain %actual_level)); +# (pair (under_key over_key) (pair weather_service_key (pair rain_level days_in_future))) +storage (pair (pair (address %under_key) + (address %over_key)) + (pair (nat :rain %rain_level) (key %weather_service_key))); +code { DUP; DUP; + CAR; MAP_CDR{PACK ; BLAKE2B}; + SWAP; CDDDR %weather_service_key; + DIP {UNPAIR} ; CHECK_SIGNATURE @sigok; # Check if the data has been correctly signed + ASSERT; # If signature is not correct, end the execution + DUP; DUP; DUP; DIIIP{CDR %storage}; # Place storage type on bottom of stack + DIIP{CDAR}; # Place contracts below numbers + DIP{CADR %actual_level}; # Get actual rain + CDDAR %rain_level; # Get rain threshold + CMPLT; IF {CAR %under_key} {CDR %over_key}; # Select contract to receive tokens + CONTRACT unit ; ASSERT_SOME ; + BALANCE; UNIT ; TRANSFER_TOKENS @trans.op; # Setup and execute transfer + NIL operation ; SWAP ; CONS ; + PAIR }; diff --git a/tests_python/contracts_016/mini_scenarios/xcat.tz b/tests_python/contracts_016/mini_scenarios/xcat.tz new file mode 100644 index 000000000000..83e6c7ac1d50 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/xcat.tz @@ -0,0 +1,48 @@ +parameter (bytes); +storage (unit); +code { + # Extract parameter from initial stack. + CAR @preimage; + DIP { + # Push contract constants to the stack. + # + # There's a temptation to use @storage to parametrize + # a contract but, in general, there's no reason to encumber + # @storage with immutable values. + PUSH @from key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; #changeme + IMPLICIT_ACCOUNT ; + PUSH @to key_hash "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN"; #changeme + IMPLICIT_ACCOUNT ; + PUSH @target_hash bytes 0x123456; #changeme + PUSH @deadline timestamp "2018-08-08 00:00:00Z"; #changeme + }; + # Test if the deadline has passed. + SWAP; NOW; + IFCMPLT + # In case the deadline did pass: + { + # Ignore parameter, just transfer xtz balance back to @from + DROP; DROP; DROP; BALANCE; UNIT; TRANSFER_TOKENS; + } + # In case the deadline hasn't passed yet: + { + # Test length of parameter. + DUP; SIZE; + PUSH @max_length nat 32; + IFCMPLT + { PUSH string "preimage too long"; FAILWITH; } + { + # Test if it's a preimage of @target_hash. + SHA256 @candidate_hash; + IFCMPNEQ + { PUSH string "invalid preimage"; FAILWITH; } + { + # Transfer xtz balance to @to. + BALANCE; UNIT; TRANSFER_TOKENS; DIP { DROP }; + }; + }; + }; + # Transform single operation into a list. + NIL operation; SWAP; CONS; + UNIT; SWAP; PAIR + } diff --git a/tests_python/contracts_016/mini_scenarios/xcat_dapp.tz b/tests_python/contracts_016/mini_scenarios/xcat_dapp.tz new file mode 100644 index 000000000000..86ca62c5ac50 --- /dev/null +++ b/tests_python/contracts_016/mini_scenarios/xcat_dapp.tz @@ -0,0 +1,79 @@ +parameter (or + # First possible action is funding, to create an xcat + (pair %fund + (address %dest) + (pair %settings (bytes %target_hash) (timestamp %deadline))) + + # Other possible action is to claim the tokens (or ask a refund) + (or %claim_refund + (bytes %preimage_claim) + (bytes %refund_hash))); + +storage (pair + (big_map + bytes # The target hash is used as a key + (pair + # We store in %from the person who funded the xcat + (pair %recipients (address %from) (address %dest)) + (pair %settings (mutez %amount) (timestamp %deadline))) + ) + unit); + +code { + NIL @operations operation; SWAP; + UNPAPAIR @% @% @%; DIP {DUP}; + IF_LEFT # Let's fund a new xcat! + { + # Unpack the parameters + UNPAIR @% @%; + # Assert that the destination address is of type unit. + # This costs a bit more gas but limits foot-shooting. + DUP; CONTRACT @dest unit; ASSERT_SOME; DROP; + SWAP; UNPAIR @% @%; + DIP + { + AMOUNT @amount; + SENDER; + DUP; CONTRACT @from unit; ASSERT_SOME; DROP; + DIP { PAIR; SWAP; }; PAIR; PAIR; SOME @xcat; + SWAP; + }; + DUP; DIP { MEM; NOT; ASSERT }; # Assert that this target hash isn't already in the map + UPDATE; PAIR @new_storage; SWAP; PAIR; + } + { + # Let's process a claim or a refund + IF_LEFT + { # It's a claim! + DUP; SIZE; PUSH nat 32; ASSERT_CMPGE; + SHA256 @hash; DUP; DIP {SWAP}; + DIIP { + GET; ASSERT_SOME; + # Check deadline and prepare transaction. + DUP; CADR @%; CONTRACT @dest unit; ASSERT_SOME; + SWAP; CDR @%; + UNPAIR @% @%; SWAP; + # The deadline must not have passed + NOW; ASSERT_CMPLT; + # prepare transaction + UNIT; TRANSFER_TOKENS; + }; + } + { # It's a refund! + DUP; + DIP + { + GET; ASSERT_SOME; + DUP; CAAR @%; CONTRACT @from unit; ASSERT_SOME; SWAP; CDR; + UNPAIR @% @%; SWAP; + # The deadline must not HAVE passed + NOW; ASSERT_CMPGE; + UNIT; TRANSFER_TOKENS; SWAP; + }; + }; + # Clear the big map + NONE @none (pair (pair address address) (pair mutez timestamp)); + SWAP; UPDATE @cleared_map; SWAP; DIP { PAIR; SWAP }; + CONS; PAIR; + } + } \ No newline at end of file diff --git a/tests_python/contracts_016/non_regression/bad_annot_contract.tz b/tests_python/contracts_016/non_regression/bad_annot_contract.tz new file mode 100644 index 000000000000..cec7bccd1adf --- /dev/null +++ b/tests_python/contracts_016/non_regression/bad_annot_contract.tz @@ -0,0 +1,6 @@ +parameter bytes; +storage (option (lambda unit unit)); +code { CAR; + UNPACK (lambda unit unit); + NIL operation; + PAIR } diff --git a/tests_python/contracts_016/non_regression/bug_262.tz b/tests_python/contracts_016/non_regression/bug_262.tz new file mode 100644 index 000000000000..63475c5ac185 --- /dev/null +++ b/tests_python/contracts_016/non_regression/bug_262.tz @@ -0,0 +1,5 @@ +{ parameter unit ; + storage unit ; + code { DROP ; + LAMBDA unit unit {} ; UNIT ; EXEC ; + NIL operation ; PAIR } } \ No newline at end of file diff --git a/tests_python/contracts_016/non_regression/bug_843.tz b/tests_python/contracts_016/non_regression/bug_843.tz new file mode 100644 index 000000000000..394b16a4e341 --- /dev/null +++ b/tests_python/contracts_016/non_regression/bug_843.tz @@ -0,0 +1,10 @@ +# This script is used to test that the optimized representation is used for everything (the script, expressions in the storage, and lambdas in the storage) at origination. The script itself differs from its optimized representation because it uses a readable address literal. It also stores a lambda so that another address literal appearing as argument to PUSH can also be tested in the storage. + +parameter never; +storage (pair address (lambda unit unit)); +code { + CAR; + PUSH address "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; + DROP; + NEVER + } diff --git a/tests_python/contracts_016/non_regression/pairk_annot.tz b/tests_python/contracts_016/non_regression/pairk_annot.tz new file mode 100644 index 000000000000..8b0cf242bd9c --- /dev/null +++ b/tests_python/contracts_016/non_regression/pairk_annot.tz @@ -0,0 +1,7 @@ +# Test for old PAIR k annotation handling bug +parameter unit; +storage unit; +code { SENDER; SOURCE; PAIR 2; + SOURCE; SENDER; PAIR 2; + COMPARE; DROP; + CDR; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/abs.tz b/tests_python/contracts_016/opcodes/abs.tz new file mode 100644 index 000000000000..d03d0883fe73 --- /dev/null +++ b/tests_python/contracts_016/opcodes/abs.tz @@ -0,0 +1,5 @@ +parameter nat; +storage unit; +code { CAR; + DUP; NEG; ABS; COMPARE; ASSERT_EQ; + UNIT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/add.tz b/tests_python/contracts_016/opcodes/add.tz new file mode 100644 index 000000000000..cbefea08a7a4 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add.tz @@ -0,0 +1,25 @@ +parameter unit; +storage unit; +code + { + CAR; + + PUSH int 2; PUSH int 2; ADD; PUSH int 4; ASSERT_CMPEQ; + PUSH int 2; PUSH int 2; ADD; PUSH int 4; ASSERT_CMPEQ; + PUSH int 2; PUSH nat 2; ADD; PUSH int 4; ASSERT_CMPEQ; + PUSH nat 2; PUSH int 2; ADD; PUSH int 4; ASSERT_CMPEQ; + PUSH nat 2; PUSH nat 2; ADD; PUSH nat 4; ASSERT_CMPEQ; + + # Offset a timestamp by 60 seconds + PUSH int 60; PUSH timestamp "2019-09-09T12:08:37Z"; ADD; + PUSH timestamp "2019-09-09T12:09:37Z"; ASSERT_CMPEQ; + + PUSH timestamp "2019-09-09T12:08:37Z"; PUSH int 60; ADD; + PUSH timestamp "2019-09-09T12:09:37Z"; ASSERT_CMPEQ; + + PUSH mutez 1000; PUSH mutez 1000; ADD; + PUSH mutez 2000; ASSERT_CMPEQ; + + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/opcodes/add_bls12_381_fr.tz b/tests_python/contracts_016/opcodes/add_bls12_381_fr.tz new file mode 100644 index 000000000000..e7b60dedc932 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add_bls12_381_fr.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_fr bls12_381_fr); +storage (option (bls12_381_fr)); +code {CAR; UNPAIR; ADD; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/add_bls12_381_g1.tz b/tests_python/contracts_016/opcodes/add_bls12_381_g1.tz new file mode 100644 index 000000000000..9f817c88d8a5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add_bls12_381_g1.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_g1 bls12_381_g1); +storage (option (bls12_381_g1)); +code {CAR; UNPAIR; ADD; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/add_bls12_381_g2.tz b/tests_python/contracts_016/opcodes/add_bls12_381_g2.tz new file mode 100644 index 000000000000..1d1c0688c1d2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add_bls12_381_g2.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_g2 bls12_381_g2); +storage (option (bls12_381_g2)); +code {CAR; UNPAIR; ADD; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/add_delta_timestamp.tz b/tests_python/contracts_016/opcodes/add_delta_timestamp.tz new file mode 100644 index 000000000000..b9ed86901726 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add_delta_timestamp.tz @@ -0,0 +1,3 @@ +parameter (pair int timestamp); +storage (option timestamp); +code { CAR; DUP; CAR; DIP{CDR}; ADD; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/add_timestamp_delta.tz b/tests_python/contracts_016/opcodes/add_timestamp_delta.tz new file mode 100644 index 000000000000..766bf9f91f51 --- /dev/null +++ b/tests_python/contracts_016/opcodes/add_timestamp_delta.tz @@ -0,0 +1,3 @@ +parameter (pair timestamp int); +storage (option timestamp); +code { CAR; DUP; CAR; DIP{CDR}; ADD; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/address.tz b/tests_python/contracts_016/opcodes/address.tz new file mode 100644 index 000000000000..7e6bcdec337b --- /dev/null +++ b/tests_python/contracts_016/opcodes/address.tz @@ -0,0 +1,3 @@ +parameter (contract unit); +storage (option address); +code {CAR; ADDRESS; SOME; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/amount_after_fib_view.tz b/tests_python/contracts_016/opcodes/amount_after_fib_view.tz new file mode 100644 index 000000000000..50fdf3d7c139 --- /dev/null +++ b/tests_python/contracts_016/opcodes/amount_after_fib_view.tz @@ -0,0 +1,24 @@ +# This contract calls the view `fib` on the address passed as +# parameter. After returning from the view it stores its AMOUNT. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 3 ; + VIEW "fib" nat; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + AMOUNT; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + diff --git a/tests_python/contracts_016/opcodes/amount_after_nonexistent_view.tz b/tests_python/contracts_016/opcodes/amount_after_nonexistent_view.tz new file mode 100644 index 000000000000..d373e1c9e52b --- /dev/null +++ b/tests_python/contracts_016/opcodes/amount_after_nonexistent_view.tz @@ -0,0 +1,23 @@ +# This contract calls the non-existent view on the address +# passed as parameter. After returning from the view it +# stores it's AMOUNT. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "nonexistent" (pair nat nat) ; + ASSERT_NONE ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + AMOUNT; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; diff --git a/tests_python/contracts_016/opcodes/amount_after_view.tz b/tests_python/contracts_016/opcodes/amount_after_view.tz new file mode 100644 index 000000000000..eab7c02256ef --- /dev/null +++ b/tests_python/contracts_016/opcodes/amount_after_view.tz @@ -0,0 +1,26 @@ +# This contract calls the view `id` on the address passed as +# parameter. After returning from the view it stores its AMOUNT. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" (pair nat nat) ; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + AMOUNT; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + + diff --git a/tests_python/contracts_016/opcodes/and.tz b/tests_python/contracts_016/opcodes/and.tz new file mode 100644 index 000000000000..48e346ca04f3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/and.tz @@ -0,0 +1,3 @@ +parameter (pair :param (bool %first) (bool %second)); +storage (option bool); +code { CAR ; UNPAIR; AND @and; SOME @res; NIL @noop operation; PAIR; UNPAIR @x @y; PAIR %a %b }; diff --git a/tests_python/contracts_016/opcodes/and_binary.tz b/tests_python/contracts_016/opcodes/and_binary.tz new file mode 100644 index 000000000000..96f60082c713 --- /dev/null +++ b/tests_python/contracts_016/opcodes/and_binary.tz @@ -0,0 +1,27 @@ +parameter unit; +storage unit; +code { DROP; + + # 0101 & 0110 = 0100 + PUSH nat 5; PUSH nat 6; AND; PUSH nat 4; ASSERT_CMPEQ; + + # 0110 & 0101 = 0100 + PUSH nat 6; PUSH int 5; AND; PUSH nat 4; ASSERT_CMPEQ; + + # Negative numbers are represented as with a initial virtual + # infinite series of 1's. + # Hence, AND with -1 (1111...) is identity: + + # 12 = ...1100 + # & -1 = ...1111 + # ---- + # = 12 = ...1100 + PUSH nat 12; PUSH int -1; AND; PUSH nat 12; ASSERT_CMPEQ; + + # 12 = ...0001100 + # & -5 = ...1111011 + # ----------------- + # 8 = ...0001000 + PUSH nat 12; PUSH int -5; AND; PUSH nat 8; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/and_bytes.tz b/tests_python/contracts_016/opcodes/and_bytes.tz new file mode 100644 index 000000000000..2e7ca80e48f2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/and_bytes.tz @@ -0,0 +1,15 @@ +parameter unit; +storage unit; +code { DROP; + + # 0x05 & 0x06 = 0x04 + PUSH bytes 0x05; PUSH bytes 0x06; AND; PUSH bytes 0x04; ASSERT_CMPEQ; + + # 0x0005 & 0x0106 = 0x0004, not 0x04 + PUSH bytes 0x0005; PUSH bytes 0x0106; AND; PUSH bytes 0x0004; ASSERT_CMPEQ; + + # Longer bytes is cut its prefix to have the same length as the shorter one + # 0x05 & 0x0106 = 0x05 & 0x06 = 0x04, not 0x0004 + PUSH bytes 0x05; PUSH bytes 0x0106; AND; PUSH bytes 0x04; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/and_logical_1.tz b/tests_python/contracts_016/opcodes/and_logical_1.tz new file mode 100644 index 000000000000..20743c0bfdf9 --- /dev/null +++ b/tests_python/contracts_016/opcodes/and_logical_1.tz @@ -0,0 +1,3 @@ +parameter (pair bool bool); +storage bool; +code { CAR ; UNPAIR; AND @and; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/balance.tz b/tests_python/contracts_016/opcodes/balance.tz new file mode 100644 index 000000000000..0a9bfc61494c --- /dev/null +++ b/tests_python/contracts_016/opcodes/balance.tz @@ -0,0 +1,3 @@ +parameter unit; +storage mutez; +code {DROP; BALANCE; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/balance_after_fib_view.tz b/tests_python/contracts_016/opcodes/balance_after_fib_view.tz new file mode 100644 index 000000000000..b9a52d1e895a --- /dev/null +++ b/tests_python/contracts_016/opcodes/balance_after_fib_view.tz @@ -0,0 +1,25 @@ +# This contract calls the view `fib` on the address passed as +# parameter. After returning from the view it stores its BALANCE. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 3 ; + VIEW "fib" nat; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + BALANCE; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + diff --git a/tests_python/contracts_016/opcodes/balance_after_nonexistent_view.tz b/tests_python/contracts_016/opcodes/balance_after_nonexistent_view.tz new file mode 100644 index 000000000000..96bb623530df --- /dev/null +++ b/tests_python/contracts_016/opcodes/balance_after_nonexistent_view.tz @@ -0,0 +1,22 @@ +# This contract calls the noneexistent view on the address passed as +# parameter. After returning from the view it stores it's BALANCE. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "nonexistent" (pair nat nat) ; + ASSERT_NONE ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + BALANCE; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; diff --git a/tests_python/contracts_016/opcodes/balance_after_view.tz b/tests_python/contracts_016/opcodes/balance_after_view.tz new file mode 100644 index 000000000000..c2acc0320cdc --- /dev/null +++ b/tests_python/contracts_016/opcodes/balance_after_view.tz @@ -0,0 +1,25 @@ +# This contract calls the view `id` on the address passed as +# parameter. After returning from the view it stores its BALANCE. +parameter address ; +storage mutez; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" (pair nat nat) ; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 15000000 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + BALANCE; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + diff --git a/tests_python/contracts_016/opcodes/big_map_mem_nat.tz b/tests_python/contracts_016/opcodes/big_map_mem_nat.tz new file mode 100644 index 000000000000..71ecaf2c4a75 --- /dev/null +++ b/tests_python/contracts_016/opcodes/big_map_mem_nat.tz @@ -0,0 +1,7 @@ +parameter nat; +storage (pair (big_map nat nat) (option bool)) ; +# stores (map, Some flag) where flag = parameter is a member of +# the map in first component of storage +code { UNPAIR; + DIP { CAR; DUP }; + MEM; SOME; SWAP; PAIR; NIL operation; PAIR;} diff --git a/tests_python/contracts_016/opcodes/big_map_mem_string.tz b/tests_python/contracts_016/opcodes/big_map_mem_string.tz new file mode 100644 index 000000000000..8c557f7dc1f8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/big_map_mem_string.tz @@ -0,0 +1,7 @@ +parameter string; +storage (pair (big_map string nat) (option bool)) ; +# stores (map, Some flag) where flag = parameter is a member of +# the map in first component of storage +code { UNPAIR; + DIP { CAR; DUP }; + MEM; SOME; SWAP; PAIR; NIL operation; PAIR;} diff --git a/tests_python/contracts_016/opcodes/big_map_to_self.tz b/tests_python/contracts_016/opcodes/big_map_to_self.tz new file mode 100644 index 000000000000..6a9442b9f3e5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/big_map_to_self.tz @@ -0,0 +1,22 @@ +parameter (or (pair %have_fun (big_map string nat) unit) (unit %default)); +storage (big_map string nat); +code { + UNPAIR; + DIP {NIL operation}; + IF_LEFT { + DROP + } + { + DROP; + SELF %have_fun; + PUSH mutez 0; + DUP 4; + PUSH (option nat) (Some 8); + PUSH string "hahaha"; + UPDATE; + UNIT; SWAP; PAIR; + TRANSFER_TOKENS; + CONS + }; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz new file mode 100644 index 000000000000..fd4142914d2c --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz @@ -0,0 +1,9 @@ +parameter unit; +storage (option bls12_381_fr); +code { + DROP; + PUSH bls12_381_fr 0x00; + SOME; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz new file mode 100644 index 000000000000..314b97f2a6b9 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz @@ -0,0 +1,9 @@ +parameter unit; +storage (option bls12_381_fr); +code { + DROP; + PUSH bls12_381_fr 16; + SOME; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz new file mode 100644 index 000000000000..67e2c9b080b1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz @@ -0,0 +1,8 @@ +parameter bls12_381_fr; +storage int; +code { + CAR; + INT; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz new file mode 100644 index 000000000000..39630958e515 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz @@ -0,0 +1,12 @@ +parameter bls12_381_fr; +storage mutez; +code { + CAR; + INT; + ISNAT; + ASSERT_SOME; + PUSH mutez 1; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz new file mode 100644 index 000000000000..67018c55faba --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz @@ -0,0 +1,8 @@ +parameter int; +storage (bls12_381_fr); +code { + UNPAIR; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz b/tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz new file mode 100644 index 000000000000..1376e0c39561 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz @@ -0,0 +1,8 @@ +parameter nat; +storage (bls12_381_fr); +code { + UNPAIR; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz b/tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz new file mode 100644 index 000000000000..783fb3c0d660 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz @@ -0,0 +1,9 @@ +parameter int; +storage (bls12_381_fr); +code { + UNPAIR; + SWAP; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz b/tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz new file mode 100644 index 000000000000..1210e36db0e1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz @@ -0,0 +1,9 @@ +parameter nat; +storage (bls12_381_fr); +code { + UNPAIR; + SWAP; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bytes.tz b/tests_python/contracts_016/opcodes/bytes.tz new file mode 100644 index 000000000000..e4dd8445eecc --- /dev/null +++ b/tests_python/contracts_016/opcodes/bytes.tz @@ -0,0 +1,11 @@ +# A contract that accepts bytes in a default entry point and does nothing. +# Useful for testing transfers of arbitrary sizes. +parameter bytes; +storage unit; +code + { + CDR; # @storage + # == default == # @storage + NIL operation; # list operation : @storage + PAIR; # pair (list operation) @storage + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/bytes_of_int.tz b/tests_python/contracts_016/opcodes/bytes_of_int.tz new file mode 100644 index 000000000000..761e6d4c4414 --- /dev/null +++ b/tests_python/contracts_016/opcodes/bytes_of_int.tz @@ -0,0 +1,25 @@ +parameter unit; +storage unit; +code { DROP; + + PUSH int 0; BYTES; PUSH bytes 0x; ASSERT_CMPEQ; + PUSH int 1; BYTES; PUSH bytes 0x01; ASSERT_CMPEQ; + PUSH int 1193046; BYTES; PUSH bytes 0x123456; ASSERT_CMPEQ; + + PUSH bytes 0x123456; INT; PUSH int 1193046; ASSERT_CMPEQ; + PUSH bytes 0x0000123456; INT; PUSH int 1193046; ASSERT_CMPEQ; + PUSH bytes 0x; INT; PUSH int 0; ASSERT_CMPEQ; + PUSH bytes 0x0000; INT; PUSH int 0; ASSERT_CMPEQ; + + PUSH int -128; BYTES; PUSH bytes 0x80; ASSERT_CMPEQ; + PUSH int -129; BYTES; PUSH bytes 0xff7f; ASSERT_CMPEQ; + PUSH int -33024; BYTES; PUSH bytes 0xff7f00; ASSERT_CMPEQ; + PUSH int -4294967296; BYTES; PUSH bytes 0xff00000000; ASSERT_CMPEQ; + + PUSH bytes 0x80; INT; PUSH int -128; ASSERT_CMPEQ; + PUSH bytes 0xff7f; INT; PUSH int -129; ASSERT_CMPEQ; + PUSH bytes 0xff7f00; INT; PUSH int -33024; ASSERT_CMPEQ; + PUSH bytes 0xffffff7f00; INT; PUSH int -33024; ASSERT_CMPEQ; + PUSH bytes 0xff00000000; INT; PUSH int -4294967296; ASSERT_CMPEQ; + + UNIT; NIL operation; PAIR; } diff --git a/tests_python/contracts_016/opcodes/bytes_of_nat.tz b/tests_python/contracts_016/opcodes/bytes_of_nat.tz new file mode 100644 index 000000000000..c620bc3e236f --- /dev/null +++ b/tests_python/contracts_016/opcodes/bytes_of_nat.tz @@ -0,0 +1,14 @@ +parameter unit; +storage unit; +code { DROP; + + PUSH nat 0; BYTES; PUSH bytes 0x; ASSERT_CMPEQ; + PUSH nat 1; BYTES; PUSH bytes 0x01; ASSERT_CMPEQ; + PUSH nat 1193046; BYTES; PUSH bytes 0x123456; ASSERT_CMPEQ; + + PUSH bytes 0x123456; NAT; PUSH nat 1193046; ASSERT_CMPEQ; + PUSH bytes 0x0000123456; NAT; PUSH nat 1193046; ASSERT_CMPEQ; + PUSH bytes 0x; NAT; PUSH nat 0; ASSERT_CMPEQ; + PUSH bytes 0x0000; NAT; PUSH nat 0; ASSERT_CMPEQ; + + UNIT; NIL operation; PAIR; } diff --git a/tests_python/contracts_016/opcodes/car.tz b/tests_python/contracts_016/opcodes/car.tz new file mode 100644 index 000000000000..8fd03ba51052 --- /dev/null +++ b/tests_python/contracts_016/opcodes/car.tz @@ -0,0 +1,3 @@ +parameter (pair (nat :l) (nat :r)); +storage nat; +code { CAR; CAR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/cdr.tz b/tests_python/contracts_016/opcodes/cdr.tz new file mode 100644 index 000000000000..dae260c5be74 --- /dev/null +++ b/tests_python/contracts_016/opcodes/cdr.tz @@ -0,0 +1,3 @@ +parameter (pair (nat :l) (nat :r)); +storage nat; +code { CAR; CDR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/chain_id.tz b/tests_python/contracts_016/opcodes/chain_id.tz new file mode 100644 index 000000000000..783d13fa0afc --- /dev/null +++ b/tests_python/contracts_016/opcodes/chain_id.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code { CHAIN_ID; DROP; CAR; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/chain_id_store.tz b/tests_python/contracts_016/opcodes/chain_id_store.tz new file mode 100644 index 000000000000..11e57fd210c7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/chain_id_store.tz @@ -0,0 +1,3 @@ +parameter unit; +storage (option chain_id); +code { DROP; CHAIN_ID; SOME; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/check_signature.tz b/tests_python/contracts_016/opcodes/check_signature.tz new file mode 100644 index 000000000000..b5d5b2842648 --- /dev/null +++ b/tests_python/contracts_016/opcodes/check_signature.tz @@ -0,0 +1,10 @@ +parameter key; +storage (pair signature string); +code { + DUP; DUP; + DIP{ CDR; DUP; CAR; + DIP{CDR; PACK}}; + CAR; CHECK_SIGNATURE; + IF {} {FAIL} ; + CDR; NIL operation ; PAIR}; + diff --git a/tests_python/contracts_016/opcodes/comb-get.tz b/tests_python/contracts_016/opcodes/comb-get.tz new file mode 100644 index 000000000000..5493d68f2696 --- /dev/null +++ b/tests_python/contracts_016/opcodes/comb-get.tz @@ -0,0 +1,27 @@ +# See also ../macros/carn_and_cdrn.tz for the same test using the +# CAR n and CDR n macros. +parameter (pair nat nat nat unit); +storage unit; +code { + CAR ; + + # Checking the first element + DUP ; CAR ; + PUSH nat 1 ; ASSERT_CMPEQ ; + DUP ; GET 1 ; + PUSH nat 1 ; ASSERT_CMPEQ ; + + # Checking the second element + DUP ; GET 3 ; + PUSH nat 4 ; ASSERT_CMPEQ ; + + # Checking the third element + DUP ; GET 5 ; + PUSH nat 2 ; ASSERT_CMPEQ ; + + # Checking the last (fourth) element + DUP ; GET 6 ; + UNIT ; ASSERT_CMPEQ ; + + DROP ; UNIT ; NIL operation ; PAIR + } diff --git a/tests_python/contracts_016/opcodes/comb-literals.tz b/tests_python/contracts_016/opcodes/comb-literals.tz new file mode 100644 index 000000000000..2a2b217d7857 --- /dev/null +++ b/tests_python/contracts_016/opcodes/comb-literals.tz @@ -0,0 +1,9 @@ +# This pushes a list of combs to test the effect of the normalize script command +parameter unit; +storage unit; +code { + PUSH + (list (pair nat nat nat nat)) + {Pair 0 3 6 9; Pair 1 (Pair 4 (Pair 7 10)); {2; 5; 8; 11}}; + DROP 2; UNIT; NIL operation; PAIR + } diff --git a/tests_python/contracts_016/opcodes/comb-set-2.tz b/tests_python/contracts_016/opcodes/comb-set-2.tz new file mode 100644 index 000000000000..757acfd380e6 --- /dev/null +++ b/tests_python/contracts_016/opcodes/comb-set-2.tz @@ -0,0 +1,10 @@ +# This tests UPDATE on combs. Contrary to comb-set.tz, both the values +# and their types are updated. +parameter (pair nat nat nat unit); +storage (option (pair int nat string bytes)); +code { + CAR ; + PUSH int 2 ; UPDATE 1 ; + PUSH string "toto" ; UPDATE 5 ; + PUSH bytes 0x01 ; UPDATE 6 ; + SOME ; NIL operation ; PAIR ; } diff --git a/tests_python/contracts_016/opcodes/comb-set.tz b/tests_python/contracts_016/opcodes/comb-set.tz new file mode 100644 index 000000000000..fe407571923e --- /dev/null +++ b/tests_python/contracts_016/opcodes/comb-set.tz @@ -0,0 +1,10 @@ +# This tests UPDATE on combs. See also comb-set-2.tz for tests of +# UPDATE that also change the type of fields. +parameter unit; +storage (pair nat nat nat unit); +code { CDR ; + PUSH nat 2 ; UPDATE 1 ; + PUSH nat 12 ; UPDATE 3 ; + PUSH nat 8 ; UPDATE 5 ; + UNIT ; UPDATE 6 ; + NIL operation ; PAIR ; } diff --git a/tests_python/contracts_016/opcodes/comb.tz b/tests_python/contracts_016/opcodes/comb.tz new file mode 100644 index 000000000000..6709bde8b883 --- /dev/null +++ b/tests_python/contracts_016/opcodes/comb.tz @@ -0,0 +1,9 @@ +parameter unit; +storage (pair nat nat nat); +code { DROP ; + PUSH nat 3 ; + PUSH nat 2 ; + PUSH nat 1 ; + NIL operation ; + PAIR 4 + } diff --git a/tests_python/contracts_016/opcodes/compare.tz b/tests_python/contracts_016/opcodes/compare.tz new file mode 100644 index 000000000000..963215fb46cd --- /dev/null +++ b/tests_python/contracts_016/opcodes/compare.tz @@ -0,0 +1,52 @@ +parameter unit; +storage unit; +code { + DROP; + + # bool + PUSH bool True; DUP; COMPARE; ASSERT_EQ; + PUSH bool False; DUP; COMPARE; ASSERT_EQ; + PUSH bool False; PUSH bool True; COMPARE; ASSERT_GT; + PUSH bool True; PUSH bool False; COMPARE; ASSERT_LT; + + # bytes + PUSH bytes 0xAABBCC; DUP; COMPARE; ASSERT_EQ; + PUSH bytes 0x; PUSH bytes 0x; COMPARE; ASSERT_EQ; + PUSH bytes 0x; PUSH bytes 0x01; COMPARE; ASSERT_GT; + PUSH bytes 0x01; PUSH bytes 0x02; COMPARE; ASSERT_GT; + PUSH bytes 0x02; PUSH bytes 0x01; COMPARE; ASSERT_LT; + + # int + PUSH int 1; DUP; COMPARE; ASSERT_EQ; + PUSH int 10; PUSH int 5; COMPARE; ASSERT_LT; + PUSH int -4; PUSH int 1923; COMPARE; ASSERT_GT; + + # nat + PUSH nat 1; DUP; COMPARE; ASSERT_EQ; + PUSH nat 10; PUSH nat 5; COMPARE; ASSERT_LT; + PUSH nat 4; PUSH nat 1923; COMPARE; ASSERT_GT; + + # key_hash + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; DUP; COMPARE; ASSERT_EQ; + PUSH key_hash "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv"; PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; COMPARE; ASSERT_LT; + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; PUSH key_hash "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv"; COMPARE; ASSERT_GT; + + # mutez + PUSH mutez 1; DUP; COMPARE; ASSERT_EQ; + PUSH mutez 10; PUSH mutez 5; COMPARE; ASSERT_LT; + PUSH mutez 4; PUSH mutez 1923; COMPARE; ASSERT_GT; + + # string + PUSH string "AABBCC"; DUP; COMPARE; ASSERT_EQ; + PUSH string ""; PUSH string ""; COMPARE; ASSERT_EQ; + PUSH string ""; PUSH string "a"; COMPARE; ASSERT_GT; + PUSH string "a"; PUSH string "b"; COMPARE; ASSERT_GT; + PUSH string "b"; PUSH string "a"; COMPARE; ASSERT_LT; + + # timestamp + PUSH timestamp "2019-09-16T08:38:05Z"; DUP; COMPARE; ASSERT_EQ; + PUSH timestamp "2017-09-16T08:38:04Z"; PUSH timestamp "2019-09-16T08:38:05Z"; COMPARE; ASSERT_GT; + PUSH timestamp "2019-09-16T08:38:05Z"; PUSH timestamp "2019-09-16T08:38:04Z"; COMPARE; ASSERT_LT; + + UNIT; NIL operation; PAIR; + } diff --git a/tests_python/contracts_016/opcodes/compare_big_type.tz b/tests_python/contracts_016/opcodes/compare_big_type.tz new file mode 100644 index 000000000000..666ad3137777 --- /dev/null +++ b/tests_python/contracts_016/opcodes/compare_big_type.tz @@ -0,0 +1,20 @@ +# This contract should cost a lot of gas to typecheck +# because big types are compared in COMPARE +parameter unit; +storage unit; +code { DROP; PUSH nat 0 ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DROP ; UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/compare_big_type2.tz b/tests_python/contracts_016/opcodes/compare_big_type2.tz new file mode 100644 index 000000000000..126217d79fdf --- /dev/null +++ b/tests_python/contracts_016/opcodes/compare_big_type2.tz @@ -0,0 +1,22 @@ +# Like compare_big_type.tz but with an extra line +# DUP ; DUP ; COMPARE ; DROP ; +# so that we can measure how much it costs +parameter unit; +storage unit; +code { DROP; PUSH nat 0 ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; PAIR ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DUP ; DUP ; COMPARE ; DROP ; + DROP ; UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/comparisons.tz b/tests_python/contracts_016/opcodes/comparisons.tz new file mode 100644 index 000000000000..c603f07339ce --- /dev/null +++ b/tests_python/contracts_016/opcodes/comparisons.tz @@ -0,0 +1,15 @@ +parameter (list int); +storage (list (list bool)); +code { + CAR; + + NIL (list bool); + DIP {DUP; MAP { EQ; };}; SWAP; CONS; + DIP {DUP; MAP { NEQ; };}; SWAP; CONS; + DIP {DUP; MAP { LE; };}; SWAP; CONS; + DIP {DUP; MAP { LT; };}; SWAP; CONS; + DIP {DUP; MAP { GE; };}; SWAP; CONS; + DIP {MAP { GT; };}; SWAP; CONS; + + NIL operation; PAIR; + } diff --git a/tests_python/contracts_016/opcodes/concat_hello.tz b/tests_python/contracts_016/opcodes/concat_hello.tz new file mode 100644 index 000000000000..e290b90fb2ad --- /dev/null +++ b/tests_python/contracts_016/opcodes/concat_hello.tz @@ -0,0 +1,4 @@ +parameter (list string); +storage (list string); +code{ CAR; + MAP { PUSH @hello string "Hello "; CONCAT }; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/concat_hello_bytes.tz b/tests_python/contracts_016/opcodes/concat_hello_bytes.tz new file mode 100644 index 000000000000..55f8ab7a216b --- /dev/null +++ b/tests_python/contracts_016/opcodes/concat_hello_bytes.tz @@ -0,0 +1,4 @@ +parameter (list bytes); +storage (list bytes); +code{ CAR; + MAP { PUSH bytes 0xFF; CONCAT }; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/concat_list.tz b/tests_python/contracts_016/opcodes/concat_list.tz new file mode 100644 index 000000000000..b570027ff68e --- /dev/null +++ b/tests_python/contracts_016/opcodes/concat_list.tz @@ -0,0 +1,5 @@ +parameter (list string); +storage string; +code {CAR; PUSH string ""; SWAP; + ITER {SWAP; DIP{NIL string; SWAP; CONS}; CONS; CONCAT}; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/cons.tz b/tests_python/contracts_016/opcodes/cons.tz new file mode 100644 index 000000000000..5189b47c36b4 --- /dev/null +++ b/tests_python/contracts_016/opcodes/cons.tz @@ -0,0 +1,3 @@ +parameter int; +storage (list int); +code { UNPAIR; CONS; NIL operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/contains_all.tz b/tests_python/contracts_016/opcodes/contains_all.tz new file mode 100644 index 000000000000..fe4160f87227 --- /dev/null +++ b/tests_python/contracts_016/opcodes/contains_all.tz @@ -0,0 +1,7 @@ +parameter (pair (list string) (list string)); +storage (option bool); +code {CAR; DUP; CAR; DIP{CDR}; EMPTY_SET string; SWAP; + ITER {PAIR; DUP; CAR; DIP{CDR}; PUSH bool True; SWAP; UPDATE}; + PUSH bool True; SWAP; PAIR; SWAP; + ITER {PAIR; DUP; DUP; CAR; DIP{CDAR; DIP{CDDR}; DUP}; MEM; DIP{SWAP}; AND; SWAP; PAIR}; + CDR; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/contract.tz b/tests_python/contracts_016/opcodes/contract.tz new file mode 100644 index 000000000000..939337918d1c --- /dev/null +++ b/tests_python/contracts_016/opcodes/contract.tz @@ -0,0 +1,11 @@ +parameter address; +storage unit; +code { + CAR; + CONTRACT unit; + ASSERT_SOME; + DROP; + UNIT; + NIL operation; + PAIR + }; diff --git a/tests_python/contracts_016/opcodes/create_contract.tz b/tests_python/contracts_016/opcodes/create_contract.tz new file mode 100644 index 000000000000..d3fb8dc617a8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/create_contract.tz @@ -0,0 +1,14 @@ +parameter unit; +storage (option address); +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {SOME;NIL operation};CONS ; PAIR} # Ending calling convention stuff diff --git a/tests_python/contracts_016/opcodes/create_contract_rootname.tz b/tests_python/contracts_016/opcodes/create_contract_rootname.tz new file mode 100644 index 000000000000..85fb97922fe7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/create_contract_rootname.tz @@ -0,0 +1,15 @@ +# this contract creates a contract +parameter unit; +storage (option address); +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter (unit %root) ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {SOME;NIL operation}; CONS ; PAIR} # Ending calling convention stuff diff --git a/tests_python/contracts_016/opcodes/create_contract_rootname_alt.tz b/tests_python/contracts_016/opcodes/create_contract_rootname_alt.tz new file mode 100644 index 000000000000..226a9abba298 --- /dev/null +++ b/tests_python/contracts_016/opcodes/create_contract_rootname_alt.tz @@ -0,0 +1,14 @@ +parameter unit; +storage (option address); +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter (unit %root) ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {SOME;NIL operation}; CONS ; PAIR} # Ending calling convention stuff diff --git a/tests_python/contracts_016/opcodes/create_contract_with_view.tz b/tests_python/contracts_016/opcodes/create_contract_with_view.tz new file mode 100644 index 000000000000..c8b591e9d3bc --- /dev/null +++ b/tests_python/contracts_016/opcodes/create_contract_with_view.tz @@ -0,0 +1,17 @@ +parameter unit; +storage (option address); +code { DROP; + UNIT; # starting storage for contract + AMOUNT; # Push the starting balance + NONE key_hash; # No delegate + CREATE_CONTRACT # Create the contract + { parameter unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } ; + view "const" nat nat { CAR; } ; + }; + DIP {SOME;NIL operation};CONS ; PAIR} # Ending calling convention stuff + diff --git a/tests_python/contracts_016/opcodes/diff_timestamps.tz b/tests_python/contracts_016/opcodes/diff_timestamps.tz new file mode 100644 index 000000000000..f1991a37a5d2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/diff_timestamps.tz @@ -0,0 +1,3 @@ +parameter (pair timestamp timestamp); +storage int; +code { CAR; DUP; CAR; DIP{CDR}; SUB; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/dig_eq.tz b/tests_python/contracts_016/opcodes/dig_eq.tz new file mode 100644 index 000000000000..aaafc4271fae --- /dev/null +++ b/tests_python/contracts_016/opcodes/dig_eq.tz @@ -0,0 +1,14 @@ +parameter (pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat); +storage unit; +# this contract receives a 17-tuple, unpairs it, reverses the order, reverses it again, and pairs it and verifies that the result is the same as the original tuple. +code { CAR; + DUP; + + UNPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAIR; + DIG 0; DIG 1; DIG 2; DIG 3; DIG 4; DIG 5; DIG 6; DIG 7; DIG 8; DIG 9; DIG 10; DIG 11; DIG 12; DIG 13; DIG 14; DIG 15; DIG 16; + # PUSH nat 1; ADD; + DIG 0; DIG 1; DIG 2; DIG 3; DIG 4; DIG 5; DIG 6; DIG 7; DIG 8; DIG 9; DIG 10; DIG 11; DIG 12; DIG 13; DIG 14; DIG 15; DIG 16; + PAPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAIR; + ASSERT_CMPEQ; + + UNIT; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/dign.tz b/tests_python/contracts_016/opcodes/dign.tz new file mode 100644 index 000000000000..ec8a339dd48c --- /dev/null +++ b/tests_python/contracts_016/opcodes/dign.tz @@ -0,0 +1,3 @@ +parameter (pair (pair (pair (pair nat nat) nat) nat) nat); +storage nat; +code {CAR; UNPAIR ; UNPAIR ; UNPAIR ; UNPAIR ; DIG 4 ; DIP { DROP ; DROP ; DROP ; DROP } ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/dip.tz b/tests_python/contracts_016/opcodes/dip.tz new file mode 100644 index 000000000000..f0c32a838747 --- /dev/null +++ b/tests_python/contracts_016/opcodes/dip.tz @@ -0,0 +1,8 @@ +parameter (pair nat nat); +storage (pair nat nat); +code{ + CAR; UNPAIR; + DUP; DIP { ADD }; + PAIR; + NIL operation; + PAIR}; diff --git a/tests_python/contracts_016/opcodes/dipn.tz b/tests_python/contracts_016/opcodes/dipn.tz new file mode 100644 index 000000000000..55d088e5518f --- /dev/null +++ b/tests_python/contracts_016/opcodes/dipn.tz @@ -0,0 +1,3 @@ +parameter (pair (pair (pair (pair nat nat) nat) nat) nat); +storage nat; +code {CAR; UNPAIR ; UNPAIR ; UNPAIR ; UNPAIR ; DIP 5 {PUSH nat 6} ; DROP ; DROP ; DROP ; DROP ; DROP ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/dropn.tz b/tests_python/contracts_016/opcodes/dropn.tz new file mode 100644 index 000000000000..4b5379b3a3b3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/dropn.tz @@ -0,0 +1,3 @@ +parameter (pair (pair (pair (pair nat nat) nat) nat) nat); +storage nat; +code {CAR; UNPAIR ; UNPAIR ; UNPAIR ; UNPAIR ; DROP 4 ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/dugn.tz b/tests_python/contracts_016/opcodes/dugn.tz new file mode 100644 index 000000000000..521c052f1fcd --- /dev/null +++ b/tests_python/contracts_016/opcodes/dugn.tz @@ -0,0 +1,3 @@ +parameter (pair (pair (pair (pair nat nat) nat) nat) nat); +storage nat; +code {CAR; UNPAIR ; UNPAIR ; UNPAIR ; UNPAIR ; DUG 4 ; DROP ; DROP ; DROP ; DROP ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/dup-n.tz b/tests_python/contracts_016/opcodes/dup-n.tz new file mode 100644 index 000000000000..7e530c0971d0 --- /dev/null +++ b/tests_python/contracts_016/opcodes/dup-n.tz @@ -0,0 +1,18 @@ +parameter unit; +storage unit; +code + { + DROP ; + PUSH nat 5 ; + PUSH nat 4 ; + PUSH nat 3 ; + PUSH nat 2 ; + PUSH nat 1 ; + DUP 1 ; PUSH nat 1 ; ASSERT_CMPEQ ; + DUP 2 ; PUSH nat 2 ; ASSERT_CMPEQ ; + DUP 3 ; PUSH nat 3 ; ASSERT_CMPEQ ; + DUP 4 ; PUSH nat 4 ; ASSERT_CMPEQ ; + DUP 5 ; PUSH nat 5 ; ASSERT_CMPEQ ; + DROP 5 ; + UNIT ; NIL operation ; PAIR ; + }; diff --git a/tests_python/contracts_016/opcodes/ediv.tz b/tests_python/contracts_016/opcodes/ediv.tz new file mode 100644 index 000000000000..a1fc89992a02 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ediv.tz @@ -0,0 +1,13 @@ +parameter (pair int int); +storage (pair (option (pair int nat)) (option (pair int nat)) (option (pair int nat)) (option (pair nat nat))); +code { CAR; + # :: nat : nat : 'S -> option (pair nat nat) : 'S + DUP; UNPAIR; ABS; DIP { ABS; }; EDIV; SWAP; + # :: nat : int : 'S -> option (pair int nat) : 'S + DUP; UNPAIR; ABS; EDIV; SWAP; + # :: int : nat : 'S -> option (pair int nat) : 'S + DUP; UNPAIR; DIP { ABS; }; EDIV; SWAP; + # :: int : int : 'S -> option (pair int nat) : 'S + UNPAIR; EDIV; + PAPAPAIR; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/ediv_mutez.tz b/tests_python/contracts_016/opcodes/ediv_mutez.tz new file mode 100644 index 000000000000..2df73dd4a0e3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ediv_mutez.tz @@ -0,0 +1,12 @@ +parameter (pair mutez (or mutez nat)); +storage (or (option (pair nat mutez)) (option (pair mutez mutez))); +code { CAR; + UNPAIR; + SWAP; + IF_LEFT { + SWAP; EDIV; LEFT (option (pair mutez mutez)); + } + { + SWAP; EDIV; RIGHT (option (pair nat mutez)); + }; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/emit.tz b/tests_python/contracts_016/opcodes/emit.tz new file mode 100644 index 000000000000..d104dc6bb51e --- /dev/null +++ b/tests_python/contracts_016/opcodes/emit.tz @@ -0,0 +1,16 @@ +{ parameter unit ; + storage unit ; + code { DROP ; + UNIT ; + PUSH nat 10 ; + LEFT string ; + EMIT %event ; + PUSH string "lorem ipsum" ; + RIGHT nat ; + EMIT %event (or (nat %number) (string %words)) ; + NIL operation ; + SWAP ; + CONS ; + SWAP ; + CONS ; + PAIR } } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/empty_map.tz b/tests_python/contracts_016/opcodes/empty_map.tz new file mode 100644 index 000000000000..9023fe847b3f --- /dev/null +++ b/tests_python/contracts_016/opcodes/empty_map.tz @@ -0,0 +1,6 @@ +storage (map string string); +parameter unit; +code {DROP; + EMPTY_MAP string string; + PUSH string "world"; SOME; PUSH string "hello"; UPDATE; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/exec_concat.tz b/tests_python/contracts_016/opcodes/exec_concat.tz new file mode 100644 index 000000000000..0265f1557f0e --- /dev/null +++ b/tests_python/contracts_016/opcodes/exec_concat.tz @@ -0,0 +1,7 @@ +parameter string; +storage string; +code {CAR; + LAMBDA string string + {PUSH string "_abc"; NIL string ; + SWAP ; CONS ; SWAP ; CONS ; CONCAT}; + SWAP; EXEC; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/first.tz b/tests_python/contracts_016/opcodes/first.tz new file mode 100644 index 000000000000..6e47b4c008e8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/first.tz @@ -0,0 +1,3 @@ +parameter (list nat); +storage nat; +code{CAR; IF_CONS {DIP{DROP}} {FAIL}; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/get_and_update_big_map.tz b/tests_python/contracts_016/opcodes/get_and_update_big_map.tz new file mode 100644 index 000000000000..3b39c9a6f733 --- /dev/null +++ b/tests_python/contracts_016/opcodes/get_and_update_big_map.tz @@ -0,0 +1,9 @@ +parameter string; +storage (pair (option nat) (big_map string nat)); +code { + UNPAPAIR; + GET_AND_UPDATE; + PAIR; + NIL operation; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/get_and_update_map.tz b/tests_python/contracts_016/opcodes/get_and_update_map.tz new file mode 100644 index 000000000000..b67f08ce7746 --- /dev/null +++ b/tests_python/contracts_016/opcodes/get_and_update_map.tz @@ -0,0 +1,9 @@ +parameter string; +storage (pair (option nat) (map string nat)); +code { + UNPAPAIR; + GET_AND_UPDATE; + PAIR; + NIL operation; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/get_big_map_value.tz b/tests_python/contracts_016/opcodes/get_big_map_value.tz new file mode 100644 index 000000000000..4ca52343d45a --- /dev/null +++ b/tests_python/contracts_016/opcodes/get_big_map_value.tz @@ -0,0 +1,6 @@ +parameter string; +storage (pair (big_map string string) (option string)); +# retrieves the values stored in the big_map on the left side of the +# pair at the key denoted by the parameter and puts it in the right +# hand side of the storage +code {DUP; CAR; DIP{CDAR; DUP}; GET; SWAP; PAIR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/get_map_value.tz b/tests_python/contracts_016/opcodes/get_map_value.tz new file mode 100644 index 000000000000..f46639649a34 --- /dev/null +++ b/tests_python/contracts_016/opcodes/get_map_value.tz @@ -0,0 +1,3 @@ +parameter string; +storage (pair (option string) (map string string)); +code {DUP; CAR; DIP{CDDR; DUP}; GET; PAIR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/hash_consistency_checker.tz b/tests_python/contracts_016/opcodes/hash_consistency_checker.tz new file mode 100644 index 000000000000..fb98a39da496 --- /dev/null +++ b/tests_python/contracts_016/opcodes/hash_consistency_checker.tz @@ -0,0 +1,3 @@ +parameter (pair mutez (pair timestamp int)) ; +storage bytes ; +code { CAR ; PACK ; BLAKE2B ; NIL operation ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/hash_key.tz b/tests_python/contracts_016/opcodes/hash_key.tz new file mode 100644 index 000000000000..6c7f78b4aaf6 --- /dev/null +++ b/tests_python/contracts_016/opcodes/hash_key.tz @@ -0,0 +1,3 @@ +parameter key; +storage (option key_hash); +code {CAR; HASH_KEY; SOME ;NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/hash_string.tz b/tests_python/contracts_016/opcodes/hash_string.tz new file mode 100644 index 000000000000..b0b8ddea6403 --- /dev/null +++ b/tests_python/contracts_016/opcodes/hash_string.tz @@ -0,0 +1,3 @@ +parameter string; +storage bytes; +code {CAR; PACK ; BLAKE2B; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/if.tz b/tests_python/contracts_016/opcodes/if.tz new file mode 100644 index 000000000000..4bc0e353daeb --- /dev/null +++ b/tests_python/contracts_016/opcodes/if.tz @@ -0,0 +1,3 @@ +parameter bool; +storage (option bool); +code {CAR; IF {PUSH bool True} {PUSH bool False}; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/if_some.tz b/tests_python/contracts_016/opcodes/if_some.tz new file mode 100644 index 000000000000..5c3138b2272b --- /dev/null +++ b/tests_python/contracts_016/opcodes/if_some.tz @@ -0,0 +1,3 @@ +parameter (option string); +storage string; +code { CAR; IF_SOME {} {PUSH string ""}; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/int.tz b/tests_python/contracts_016/opcodes/int.tz new file mode 100644 index 000000000000..3f199881392a --- /dev/null +++ b/tests_python/contracts_016/opcodes/int.tz @@ -0,0 +1,5 @@ +parameter nat; +storage (option int); +# this contract takes a natural number as parameter, converts it to an +# integer and stores it. +code { CAR; INT; SOME; NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/iter_fail.tz b/tests_python/contracts_016/opcodes/iter_fail.tz new file mode 100644 index 000000000000..4021e8b57efc --- /dev/null +++ b/tests_python/contracts_016/opcodes/iter_fail.tz @@ -0,0 +1,4 @@ +# Test that ITER {FAILWITH} is allowed by the typechecker +parameter (set nat); +storage unit; +code { UNPAIR; ITER {FAILWITH}; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/keccak.tz b/tests_python/contracts_016/opcodes/keccak.tz new file mode 100644 index 000000000000..e96256100999 --- /dev/null +++ b/tests_python/contracts_016/opcodes/keccak.tz @@ -0,0 +1,8 @@ +storage (option bytes); +parameter bytes; +code + { + CAR; + KECCAK; SOME; + NIL operation; PAIR + } diff --git a/tests_python/contracts_016/opcodes/left_right.tz b/tests_python/contracts_016/opcodes/left_right.tz new file mode 100644 index 000000000000..d5650c03422e --- /dev/null +++ b/tests_python/contracts_016/opcodes/left_right.tz @@ -0,0 +1,3 @@ +parameter (or bool string); +storage (or string bool); +code {CAR; IF_LEFT {RIGHT string} {LEFT bool}; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/level.tz b/tests_python/contracts_016/opcodes/level.tz new file mode 100644 index 000000000000..7e3adb9d05f4 --- /dev/null +++ b/tests_python/contracts_016/opcodes/level.tz @@ -0,0 +1,3 @@ +parameter unit; +storage nat; +code {DROP; LEVEL; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/list_concat.tz b/tests_python/contracts_016/opcodes/list_concat.tz new file mode 100644 index 000000000000..d7bfb7d134ea --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_concat.tz @@ -0,0 +1,3 @@ +parameter (list string); +storage string; +code { UNPAIR ; SWAP ; CONS ; CONCAT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/list_concat_bytes.tz b/tests_python/contracts_016/opcodes/list_concat_bytes.tz new file mode 100644 index 000000000000..0fc8e1620669 --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_concat_bytes.tz @@ -0,0 +1,3 @@ +parameter (list bytes); +storage bytes; +code { UNPAIR ; SWAP ; CONS ; CONCAT; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/list_id.tz b/tests_python/contracts_016/opcodes/list_id.tz new file mode 100644 index 000000000000..6cd3693a1e14 --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_id.tz @@ -0,0 +1,3 @@ +parameter (list string); +storage (list string); +code {CAR; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/list_id_map.tz b/tests_python/contracts_016/opcodes/list_id_map.tz new file mode 100644 index 000000000000..38b4493e8e0f --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_id_map.tz @@ -0,0 +1,3 @@ +parameter (list string); +storage (list string); +code {CAR; MAP {}; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/list_iter.tz b/tests_python/contracts_016/opcodes/list_iter.tz new file mode 100644 index 000000000000..df904d882234 --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_iter.tz @@ -0,0 +1,5 @@ +parameter (list int); +storage int; +code { CAR; PUSH int 1; SWAP; + ITER { MUL }; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/list_map_block.tz b/tests_python/contracts_016/opcodes/list_map_block.tz new file mode 100644 index 000000000000..b5202dd9b6fb --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_map_block.tz @@ -0,0 +1,5 @@ +parameter (list int); +storage (list int); +code { CAR; PUSH int 0; SWAP; + MAP { DIP{DUP}; ADD; DIP{PUSH int 1; ADD}}; + NIL operation; PAIR; DIP{DROP}} diff --git a/tests_python/contracts_016/opcodes/list_size.tz b/tests_python/contracts_016/opcodes/list_size.tz new file mode 100644 index 000000000000..6ced12799187 --- /dev/null +++ b/tests_python/contracts_016/opcodes/list_size.tz @@ -0,0 +1,3 @@ +parameter (list int); +storage nat; +code {CAR; SIZE; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/loop_failwith.tz b/tests_python/contracts_016/opcodes/loop_failwith.tz new file mode 100644 index 000000000000..f81a552c8ebc --- /dev/null +++ b/tests_python/contracts_016/opcodes/loop_failwith.tz @@ -0,0 +1,4 @@ +# Test that LOOP {FAILWITH} is allowed by the typechecker +parameter bool; +storage unit; +code { UNPAIR; LOOP {FAILWITH}; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/loop_left.tz b/tests_python/contracts_016/opcodes/loop_left.tz new file mode 100644 index 000000000000..64bcc76c89cc --- /dev/null +++ b/tests_python/contracts_016/opcodes/loop_left.tz @@ -0,0 +1,7 @@ +parameter (list string); +storage (list string); +code { CAR; NIL string; SWAP; PAIR; LEFT (list string); + LOOP_LEFT { DUP; CAR; DIP{CDR}; + IF_CONS { SWAP; DIP{CONS}; PAIR; LEFT (list string) } + { RIGHT (pair (list string) (list string)) }; }; + NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/loop_left_failwith.tz b/tests_python/contracts_016/opcodes/loop_left_failwith.tz new file mode 100644 index 000000000000..98971e409511 --- /dev/null +++ b/tests_python/contracts_016/opcodes/loop_left_failwith.tz @@ -0,0 +1,4 @@ +# Test that LOOP_LEFT {FAILWITH} is allowed by the typechecker +parameter (or string nat); +storage nat; +code { CAR; LOOP_LEFT {FAILWITH}; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/lsl_bytes.tz b/tests_python/contracts_016/opcodes/lsl_bytes.tz new file mode 100644 index 000000000000..b0a4155034b9 --- /dev/null +++ b/tests_python/contracts_016/opcodes/lsl_bytes.tz @@ -0,0 +1,19 @@ +parameter unit; +storage unit; +code { DROP; + + # If shift is 0, LSL returns the bytes untouched + # 0x06 LSL 0 = 0x06 + PUSH nat 0; PUSH bytes 0x06; LSL; PUSH bytes 0x06; ASSERT_CMPEQ; + + # If shift is not 0, LSL returns a bytes longer than the original + # 0x06 LSL 1 = 0x000c (not 0x0c) + PUSH nat 1; PUSH bytes 0x06; LSL; PUSH bytes 0x000c; ASSERT_CMPEQ; + + # 0x06 LSL 8 = 0x0600 + PUSH nat 8; PUSH bytes 0x06; LSL; PUSH bytes 0x0600; ASSERT_CMPEQ; + + # 0x0006 LSL 1 = 0x00000c (not 0x0c nor 0x000c) + PUSH nat 1; PUSH bytes 0x0006; LSL; PUSH bytes 0x00000c; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/lsr_bytes.tz b/tests_python/contracts_016/opcodes/lsr_bytes.tz new file mode 100644 index 000000000000..2daecc5ed018 --- /dev/null +++ b/tests_python/contracts_016/opcodes/lsr_bytes.tz @@ -0,0 +1,23 @@ +parameter unit; +storage unit; +code { DROP; + + # 0x06 LSR 1 = 0x03 + PUSH nat 1; PUSH bytes 0x06; LSR; PUSH bytes 0x03; ASSERT_CMPEQ; + + # 0x06 LSR 8 = 0x (empty bytes) + PUSH nat 8; PUSH bytes 0x06; LSR; PUSH bytes 0x; ASSERT_CMPEQ; + + # 0x0006 LSR 1 = 0x0003 (not 0x03) + PUSH nat 1; PUSH bytes 0x0006; LSR; PUSH bytes 0x0003; ASSERT_CMPEQ; + + # 0x0006 LSR 8 = 0x00 + PUSH nat 8; PUSH bytes 0x0006; LSR; PUSH bytes 0x00; ASSERT_CMPEQ; + + # 0x001234 LSR 0 = 0x001234 + PUSH nat 0; PUSH bytes 0x001234; LSR; PUSH bytes 0x001234; ASSERT_CMPEQ; + + # 0x001234 LSR 30 = 0x + PUSH nat 30; PUSH bytes 0x001234; LSR; PUSH bytes 0x; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/map_car.tz b/tests_python/contracts_016/opcodes/map_car.tz new file mode 100644 index 000000000000..b763590ece2c --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_car.tz @@ -0,0 +1,5 @@ +parameter bool; +storage (pair (bool %b) (nat %n)); +code { DUP; CAR; DIP{CDR}; SWAP; + MAP_CAR @new_storage %b { AND }; + NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/map_id.tz b/tests_python/contracts_016/opcodes/map_id.tz new file mode 100644 index 000000000000..ff0a3bbbf213 --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_id.tz @@ -0,0 +1,3 @@ +parameter (map nat nat); +storage (map nat nat); +code { CAR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/map_iter.tz b/tests_python/contracts_016/opcodes/map_iter.tz new file mode 100644 index 000000000000..3ab5c35c73b8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_iter.tz @@ -0,0 +1,7 @@ +parameter (map (int :k) (int :e)); +storage (pair (int :k) (int :e)); +code { CAR; PUSH @acc_e (int :e) 0; PUSH @acc_k (int :k) 0; PAIR % %r; SWAP; + ITER + { DIP {DUP; CAR; DIP{CDR}}; DUP; # Last instr + DIP{CAR; ADD}; SWAP; DIP{CDR; ADD}; PAIR % %r }; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/map_map.tz b/tests_python/contracts_016/opcodes/map_map.tz new file mode 100644 index 000000000000..4acbd63c32c4 --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_map.tz @@ -0,0 +1,8 @@ +parameter nat; +storage (map string nat); +# this contract adds the value passed by parameter to each entry in +# the stored map. +code { UNPAIR; SWAP; + MAP { CDR; DIP {DUP}; ADD; }; + DIP { DROP; }; + NIL operation; PAIR; } diff --git a/tests_python/contracts_016/opcodes/map_map_sideeffect.tz b/tests_python/contracts_016/opcodes/map_map_sideeffect.tz new file mode 100644 index 000000000000..960b02a553ce --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_map_sideeffect.tz @@ -0,0 +1,12 @@ +parameter nat; +storage (pair (map string nat) nat); +# this contract adds the value passed by parameter to each entry in +# the stored map, and it sets the second component of the pair to the +# sum of the map's elements +code { UNPAIR; SWAP; CAR; + DIP 2 { PUSH @sum nat 0; }; + MAP { CDR; DIP {DUP}; ADD; + DUP; DUG 2; DIP 2 { ADD @sum }; + }; + DIP { DROP; }; PAIR; + NIL operation; PAIR; } diff --git a/tests_python/contracts_016/opcodes/map_mem_nat.tz b/tests_python/contracts_016/opcodes/map_mem_nat.tz new file mode 100644 index 000000000000..0c245d7e0a65 --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_mem_nat.tz @@ -0,0 +1,7 @@ +parameter nat; +storage (pair (map nat nat) (option bool)) ; +# stores (map, Some flag) where flag = parameter is a member of +# the map in first component of storage +code { UNPAIR; + DIP { CAR; DUP }; + MEM; SOME; SWAP; PAIR; NIL operation; PAIR;} diff --git a/tests_python/contracts_016/opcodes/map_mem_string.tz b/tests_python/contracts_016/opcodes/map_mem_string.tz new file mode 100644 index 000000000000..3fa5cd5b579f --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_mem_string.tz @@ -0,0 +1,7 @@ +parameter string; +storage (pair (map string nat) (option bool)) ; +# stores (map, Some flag) where flag = parameter is a member of +# the map in first component of storage +code { UNPAIR; + DIP { CAR; DUP }; + MEM; SOME; SWAP; PAIR; NIL operation; PAIR;} diff --git a/tests_python/contracts_016/opcodes/map_size.tz b/tests_python/contracts_016/opcodes/map_size.tz new file mode 100644 index 000000000000..4bd6417e6d79 --- /dev/null +++ b/tests_python/contracts_016/opcodes/map_size.tz @@ -0,0 +1,3 @@ +parameter (map string nat); +storage nat; +code {CAR; SIZE; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/merge_comparable_pairs.tz b/tests_python/contracts_016/opcodes/merge_comparable_pairs.tz new file mode 100644 index 000000000000..14fcc73411c7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/merge_comparable_pairs.tz @@ -0,0 +1,14 @@ +# tests that merging comparable pair types works +parameter (set (pair (nat %n) (pair %p (string %s) (int %i)))); +storage nat; +code {UNPAIR; + SWAP; + PUSH nat 3; + COMPARE; + GT; + IF {} + {DROP; + EMPTY_SET (pair nat (pair string int));}; + SIZE; + NIL operation; + PAIR;} diff --git a/tests_python/contracts_016/opcodes/mul.tz b/tests_python/contracts_016/opcodes/mul.tz new file mode 100644 index 000000000000..8432394b526d --- /dev/null +++ b/tests_python/contracts_016/opcodes/mul.tz @@ -0,0 +1,48 @@ +parameter unit ; +storage unit ; +code { CAR ; + DROP ; + # tez-nat, no overflow + PUSH nat 7987 ; + PUSH mutez 10 ; + MUL ; + PUSH mutez 79870 ; + COMPARE ; + ASSERT_EQ ; + # nat-tez, no overflow + PUSH mutez 10 ; + PUSH nat 7987 ; + MUL ; + PUSH mutez 79870 ; + COMPARE ; + ASSERT_EQ ; + # int-int, no overflow + PUSH int 10 ; + PUSH int -7987 ; + MUL ; + PUSH int -79870 ; + COMPARE ; + ASSERT_EQ ; + # int-nat, no overflow + PUSH nat 10 ; + PUSH int -7987 ; + MUL ; + PUSH int -79870 ; + COMPARE ; + ASSERT_EQ ; + # nat-int, no overflow + PUSH int -10 ; + PUSH nat 7987 ; + MUL ; + PUSH int -79870 ; + COMPARE ; + ASSERT_EQ ; + # nat-nat, no overflow + PUSH nat 10 ; + PUSH nat 7987 ; + MUL ; + PUSH nat 79870 ; + COMPARE ; + ASSERT_EQ ; + + UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/mul_bls12_381_fr.tz b/tests_python/contracts_016/opcodes/mul_bls12_381_fr.tz new file mode 100644 index 000000000000..dd201863b034 --- /dev/null +++ b/tests_python/contracts_016/opcodes/mul_bls12_381_fr.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_fr bls12_381_fr); +storage (option (bls12_381_fr)); +code {CAR; UNPAIR; MUL; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/mul_bls12_381_g1.tz b/tests_python/contracts_016/opcodes/mul_bls12_381_g1.tz new file mode 100644 index 000000000000..af3f376501da --- /dev/null +++ b/tests_python/contracts_016/opcodes/mul_bls12_381_g1.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_g1 bls12_381_fr); +storage (option (bls12_381_g1)); +code {CAR; UNPAIR; MUL; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/mul_bls12_381_g2.tz b/tests_python/contracts_016/opcodes/mul_bls12_381_g2.tz new file mode 100644 index 000000000000..1875e8e3dac8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/mul_bls12_381_g2.tz @@ -0,0 +1,3 @@ +parameter (pair bls12_381_g2 bls12_381_fr); +storage (option (bls12_381_g2)); +code {CAR; UNPAIR; MUL; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/mul_overflow.tz b/tests_python/contracts_016/opcodes/mul_overflow.tz new file mode 100644 index 000000000000..5d2b3a3dcff2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/mul_overflow.tz @@ -0,0 +1,18 @@ +parameter (or unit unit) ; +storage unit ; +code { CAR ; + IF_LEFT + { + PUSH nat 922337203685477580700 ; + PUSH mutez 10 ; + MUL ; # FAILURE + DROP + } + { + PUSH mutez 10 ; + PUSH nat 922337203685477580700 ; + MUL ; # FAILURE + DROP + } ; + + NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/munch.tz b/tests_python/contracts_016/opcodes/munch.tz new file mode 100644 index 000000000000..7efe43ca092d --- /dev/null +++ b/tests_python/contracts_016/opcodes/munch.tz @@ -0,0 +1,14 @@ +# A contract that accepts bytes in a default entry point and does nothing. +# Useful for testing transfers of arbitrary sizes. +parameter (or (bytes %bytes) + (or (lambda %lambda unit unit) + (or (nat %nat) + (list %list_nat nat)))); +storage unit; +code + { + CDR; # @storage + # == default == # @storage + NIL operation; # list operation : @storage + PAIR; # pair (list operation) @storage + }; diff --git a/tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz b/tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz new file mode 100644 index 000000000000..fefc038474da --- /dev/null +++ b/tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz @@ -0,0 +1,14 @@ +parameter mutez; +storage bls12_381_fr; +code { + CAR; + PUSH mutez 1; + SWAP; + EDIV; + ASSERT_SOME; + CAR; + PUSH bls12_381_fr 1; + MUL; + NIL operation; + PAIR; + }; \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/neg.tz b/tests_python/contracts_016/opcodes/neg.tz new file mode 100644 index 000000000000..9cedf765f1b2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/neg.tz @@ -0,0 +1,8 @@ +parameter (or int nat); +storage int; +code { + CAR; + IF_LEFT {NEG} {NEG}; + NIL operation; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/neg_bls12_381_fr.tz b/tests_python/contracts_016/opcodes/neg_bls12_381_fr.tz new file mode 100644 index 000000000000..cd9b0a945cc5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/neg_bls12_381_fr.tz @@ -0,0 +1,3 @@ +parameter bls12_381_fr; +storage (option (bls12_381_fr)); +code {CAR; NEG; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/neg_bls12_381_g1.tz b/tests_python/contracts_016/opcodes/neg_bls12_381_g1.tz new file mode 100644 index 000000000000..60806deada20 --- /dev/null +++ b/tests_python/contracts_016/opcodes/neg_bls12_381_g1.tz @@ -0,0 +1,3 @@ +parameter bls12_381_g1; +storage (option (bls12_381_g1)); +code {CAR; NEG; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/neg_bls12_381_g2.tz b/tests_python/contracts_016/opcodes/neg_bls12_381_g2.tz new file mode 100644 index 000000000000..593052546258 --- /dev/null +++ b/tests_python/contracts_016/opcodes/neg_bls12_381_g2.tz @@ -0,0 +1,3 @@ +parameter bls12_381_g2; +storage (option (bls12_381_g2)); +code {CAR; NEG; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/none.tz b/tests_python/contracts_016/opcodes/none.tz new file mode 100644 index 000000000000..473a288b4926 --- /dev/null +++ b/tests_python/contracts_016/opcodes/none.tz @@ -0,0 +1,3 @@ +parameter unit; +storage (option nat); +code { DROP; NONE nat; NIL operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/noop.tz b/tests_python/contracts_016/opcodes/noop.tz new file mode 100644 index 000000000000..bd19da15cf49 --- /dev/null +++ b/tests_python/contracts_016/opcodes/noop.tz @@ -0,0 +1,3 @@ +parameter unit; +storage unit; +code {CDR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/not.tz b/tests_python/contracts_016/opcodes/not.tz new file mode 100644 index 000000000000..f89394072d2a --- /dev/null +++ b/tests_python/contracts_016/opcodes/not.tz @@ -0,0 +1,3 @@ +parameter bool; +storage (option bool); +code {CAR; NOT; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/not_binary.tz b/tests_python/contracts_016/opcodes/not_binary.tz new file mode 100644 index 000000000000..c1e0f97979d7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/not_binary.tz @@ -0,0 +1,12 @@ +parameter (or int nat); +storage (option int); +code { CAR; + IF_LEFT + { + NOT; + } + { + NOT; + } ; + SOME; NIL operation ; PAIR + } diff --git a/tests_python/contracts_016/opcodes/not_bytes.tz b/tests_python/contracts_016/opcodes/not_bytes.tz new file mode 100644 index 000000000000..8e872787f088 --- /dev/null +++ b/tests_python/contracts_016/opcodes/not_bytes.tz @@ -0,0 +1,14 @@ +parameter unit; +storage unit; +code { DROP; + + # ~0x05 = 0xfa + PUSH bytes 0x05; NOT; PUSH bytes 0xfa; ASSERT_CMPEQ; + + # ~0x0005 = 0xfffa + PUSH bytes 0x0005; NOT; PUSH bytes 0xfffa; ASSERT_CMPEQ; + + # ~0xff05 = 0x00fa, not 0xfa + PUSH bytes 0xff05; NOT; PUSH bytes 0x00fa; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/or.tz b/tests_python/contracts_016/opcodes/or.tz new file mode 100644 index 000000000000..89d533c4483e --- /dev/null +++ b/tests_python/contracts_016/opcodes/or.tz @@ -0,0 +1,3 @@ +parameter (pair bool bool); +storage (option bool); +code {CAR; DUP; CAR; SWAP; CDR; OR; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/or_binary.tz b/tests_python/contracts_016/opcodes/or_binary.tz new file mode 100644 index 000000000000..a31f109827ef --- /dev/null +++ b/tests_python/contracts_016/opcodes/or_binary.tz @@ -0,0 +1,9 @@ +parameter (pair nat nat); +storage (option nat); +# This contract takes a pair of natural numbers as argument and +# stores the result of their binary OR. +code { CAR; + UNPAIR; + OR; + SOME; NIL operation; PAIR + } diff --git a/tests_python/contracts_016/opcodes/or_bytes.tz b/tests_python/contracts_016/opcodes/or_bytes.tz new file mode 100644 index 000000000000..be14afe5c380 --- /dev/null +++ b/tests_python/contracts_016/opcodes/or_bytes.tz @@ -0,0 +1,15 @@ +parameter unit; +storage unit; +code { DROP; + + # 0x05 | 0x06 = 0x07 + PUSH bytes 0x05; PUSH bytes 0x06; OR; PUSH bytes 0x07; ASSERT_CMPEQ; + + # 0x0005 | 0x0106 = 0x0107 + PUSH bytes 0x0005; PUSH bytes 0x0106; OR; PUSH bytes 0x0107; ASSERT_CMPEQ; + + # Shorter bytes 0-padded to the left to have the same length as the longer one + # 0x05 & 0x0106 = 0x0005 | 0x0106 = 0x0107, not 0x07 + PUSH bytes 0x05; PUSH bytes 0x0106; OR; PUSH bytes 0x0107; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/originate_big_map.tz b/tests_python/contracts_016/opcodes/originate_big_map.tz new file mode 100644 index 000000000000..97d7db669fe8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/originate_big_map.tz @@ -0,0 +1,3 @@ +parameter (big_map int int); +storage (big_map int int); +code { CAR; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/packunpack.tz b/tests_python/contracts_016/opcodes/packunpack.tz new file mode 100644 index 000000000000..ad313fa8aee6 --- /dev/null +++ b/tests_python/contracts_016/opcodes/packunpack.tz @@ -0,0 +1,6 @@ +parameter (pair (pair (pair string (list int)) (set nat)) bytes) ; +storage unit ; +code { CAR ; UNPAIR ; DIP { DUP } ; + PACK ; ASSERT_CMPEQ ; + UNPACK (pair (pair string (list int)) (set nat)) ; ASSERT_SOME ; DROP ; + UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/packunpack_rev.tz b/tests_python/contracts_016/opcodes/packunpack_rev.tz new file mode 100644 index 000000000000..9c94cd68dcc1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/packunpack_rev.tz @@ -0,0 +1,43 @@ +parameter (pair + int + nat + string + bytes + mutez + bool + key_hash + timestamp address); +storage unit ; +code { CAR; + # Check the int + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK int; ASSERT_SOME; ASSERT_CMPEQ; + # Check the nat + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK nat; ASSERT_SOME; ASSERT_CMPEQ; + # Check the string + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK string; ASSERT_SOME; ASSERT_CMPEQ; + # Check the bytes + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK bytes; ASSERT_SOME; ASSERT_CMPEQ; + # Check the mutez + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK mutez; ASSERT_SOME; ASSERT_CMPEQ; + # Check the bool + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK bool; ASSERT_SOME; ASSERT_CMPEQ; + # Check the key_hash + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK key_hash; ASSERT_SOME; ASSERT_CMPEQ; + # Check the timestamp + DUP; CAR; DIP { UNPAIR; }; PACK; UNPACK timestamp; ASSERT_SOME; ASSERT_CMPEQ; + # Check the address + DUP; PACK; UNPACK address; ASSERT_SOME; ASSERT_CMPEQ; + + # Assert failure modes of unpack + PUSH int 0; PACK; UNPACK nat; ASSERT_SOME; DROP; + PUSH int -1; PACK; UNPACK nat; ASSERT_NONE; + + # Try deserializing invalid byte sequence (no magic number) + PUSH bytes 0x; UNPACK nat; ASSERT_NONE; + PUSH bytes 0x04; UNPACK nat; ASSERT_NONE; + + # Assert failure for byte sequences that do not correspond to + # any micheline value + PUSH bytes 0x05; UNPACK nat; ASSERT_NONE; + + UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/packunpack_rev_cty.tz b/tests_python/contracts_016/opcodes/packunpack_rev_cty.tz new file mode 100644 index 000000000000..7ca7ca64a3c3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/packunpack_rev_cty.tz @@ -0,0 +1,31 @@ +parameter (pair key unit signature (option signature) (list unit) (set bool) (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes)); +storage unit ; +# for each uncomparable type t (we take an arbitrary parameter for +# parametric data-types e.g. pair, list), +# that is packable (which excludes big_map, operation, and contract) +# this contract receives a parameter v_t. +# it verifies that pack v_t == pack (unpack (pack v_t)) +code { CAR; + # packable uncomparable types + # checking: key + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK key; ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: unit + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK unit; ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: signature + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (signature); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: option signature + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (option signature); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: list unit + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (list unit); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: set bool + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (set bool); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: pair int int + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (pair int int); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: or key_hash timestamp + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (or key_hash timestamp); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: map int string + DUP; CAR; DIP { UNPAIR; }; PACK; DIP { PACK; UNPACK (map int string); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + # checking: lambda string bytes + DUP; PACK; DIP { PACK; UNPACK (lambda string bytes); ASSERT_SOME; PACK; }; ASSERT_CMPEQ; + + UNIT ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/pair_id.tz b/tests_python/contracts_016/opcodes/pair_id.tz new file mode 100644 index 000000000000..3bfedf2d8cdf --- /dev/null +++ b/tests_python/contracts_016/opcodes/pair_id.tz @@ -0,0 +1,3 @@ +parameter (pair bool bool); +storage (option (pair bool bool)); +code {CAR; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/pairing_check.tz b/tests_python/contracts_016/opcodes/pairing_check.tz new file mode 100644 index 000000000000..3b829f315c05 --- /dev/null +++ b/tests_python/contracts_016/opcodes/pairing_check.tz @@ -0,0 +1,3 @@ +parameter (list (pair bls12_381_g1 bls12_381_g2)); +storage (option bool); +code {CAR; PAIRING_CHECK; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/pexec.tz b/tests_python/contracts_016/opcodes/pexec.tz new file mode 100644 index 000000000000..eab0c71b4f59 --- /dev/null +++ b/tests_python/contracts_016/opcodes/pexec.tz @@ -0,0 +1,6 @@ +parameter nat; +storage nat; +code { + LAMBDA (pair nat nat) nat + {UNPAIR ; ADD}; + SWAP; UNPAIR ; DIP { APPLY } ; EXEC ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/pexec_2.tz b/tests_python/contracts_016/opcodes/pexec_2.tz new file mode 100644 index 000000000000..d64f7442f50e --- /dev/null +++ b/tests_python/contracts_016/opcodes/pexec_2.tz @@ -0,0 +1,11 @@ +parameter int; +storage (list int); +code { + UNPAIR @p @s ; # p :: s + LAMBDA (pair int (pair int int)) int + { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL }; # l :: p :: s + SWAP ; APPLY ; # l :: s + PUSH int 3 ; APPLY ; # l :: s + SWAP ; MAP { DIP { DUP } ; EXEC } ; # s :: l + DIP { DROP } ; # s + NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/proxy.tz b/tests_python/contracts_016/opcodes/proxy.tz new file mode 100644 index 000000000000..185bbcd321cc --- /dev/null +++ b/tests_python/contracts_016/opcodes/proxy.tz @@ -0,0 +1,13 @@ +/* This proxy contract transfers the received amount to the contract given as parameter. + It is used to test the SOURCE and SENDER opcodes; see source.tz and sender.tz. */ +parameter (contract unit) ; +storage unit ; +code{ + UNPAIR; + AMOUNT ; + UNIT ; + TRANSFER_TOKENS; + DIP {NIL operation} ; + CONS; + PAIR + } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/ret_int.tz b/tests_python/contracts_016/opcodes/ret_int.tz new file mode 100644 index 000000000000..720a99568e96 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ret_int.tz @@ -0,0 +1,3 @@ +parameter unit; +storage (option nat); +code {DROP; PUSH nat 300; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/reverse.tz b/tests_python/contracts_016/opcodes/reverse.tz new file mode 100644 index 000000000000..5a851f3e29d0 --- /dev/null +++ b/tests_python/contracts_016/opcodes/reverse.tz @@ -0,0 +1,5 @@ +parameter (list string); +storage (list string); +code { CAR; NIL string; SWAP; + ITER {CONS}; + NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/reverse_loop.tz b/tests_python/contracts_016/opcodes/reverse_loop.tz new file mode 100644 index 000000000000..d8117135c984 --- /dev/null +++ b/tests_python/contracts_016/opcodes/reverse_loop.tz @@ -0,0 +1,5 @@ +parameter (list string); +storage (list string); +code { CAR; NIL string; SWAP; PUSH bool True; + LOOP { IF_CONS {SWAP; DIP{CONS}; PUSH bool True} {NIL string; PUSH bool False}}; + DROP; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/sapling_empty_state.tz b/tests_python/contracts_016/opcodes/sapling_empty_state.tz new file mode 100644 index 000000000000..6a568da92dd3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/sapling_empty_state.tz @@ -0,0 +1,3 @@ +parameter unit; +storage (sapling_state 8); +code { DROP; SAPLING_EMPTY_STATE 8; NIL operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/self.tz b/tests_python/contracts_016/opcodes/self.tz new file mode 100644 index 000000000000..d96457fd1331 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self.tz @@ -0,0 +1,3 @@ +parameter unit ; +storage address ; +code { DROP ; SELF ; ADDRESS ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/self_address.tz b/tests_python/contracts_016/opcodes/self_address.tz new file mode 100644 index 000000000000..73f4779bab24 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_address.tz @@ -0,0 +1,11 @@ +parameter unit; +storage unit; +code { + DROP; + LAMBDA unit address { DROP; SELF_ADDRESS }; + UNIT; + EXEC; + SELF; ADDRESS; + ASSERT_CMPEQ; + UNIT; NIL operation; PAIR + } diff --git a/tests_python/contracts_016/opcodes/self_address_after_fib_view.tz b/tests_python/contracts_016/opcodes/self_address_after_fib_view.tz new file mode 100644 index 000000000000..0cf80651050a --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_address_after_fib_view.tz @@ -0,0 +1,25 @@ +# This contract calls the view `fib` on the address passed as +# parameter. After returning from the view it stores its +# SELF_ADDRESS. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 3 ; + VIEW "fib" nat; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF_ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + diff --git a/tests_python/contracts_016/opcodes/self_address_after_nonexistent_view.tz b/tests_python/contracts_016/opcodes/self_address_after_nonexistent_view.tz new file mode 100644 index 000000000000..6b174437425c --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_address_after_nonexistent_view.tz @@ -0,0 +1,26 @@ +# This contract calls the non-existent view on the address passed as +# parameter. After returning from the view it stores it's +# SELF_ADDRESS. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" string ; + ASSERT_NONE ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF_ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + + diff --git a/tests_python/contracts_016/opcodes/self_address_after_view.tz b/tests_python/contracts_016/opcodes/self_address_after_view.tz new file mode 100644 index 000000000000..012c3ce15171 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_address_after_view.tz @@ -0,0 +1,24 @@ +# This contract calls the view `id` on the address passed as +# parameter. After returning from the view it stores its +# SELF_ADDRESS. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" (pair nat nat) ; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF_ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; diff --git a/tests_python/contracts_016/opcodes/self_after_fib_view.tz b/tests_python/contracts_016/opcodes/self_after_fib_view.tz new file mode 100644 index 000000000000..5bacaeb17673 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_after_fib_view.tz @@ -0,0 +1,27 @@ +# This contract calls the view `fib` on the address passed as +# parameter. After returning from the view it stores its +# address from SELF. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 3 ; + VIEW "fib" nat; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF ; + ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + diff --git a/tests_python/contracts_016/opcodes/self_after_nonexistent_view.tz b/tests_python/contracts_016/opcodes/self_after_nonexistent_view.tz new file mode 100644 index 000000000000..74236b85f7f4 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_after_nonexistent_view.tz @@ -0,0 +1,28 @@ +# This contract calls the non-existent view on the address passed as +# parameter. After returning from the view it stores its +# address from SELF. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "nonexistent" string ; + ASSERT_NONE ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF ; + ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + + + diff --git a/tests_python/contracts_016/opcodes/self_after_view.tz b/tests_python/contracts_016/opcodes/self_after_view.tz new file mode 100644 index 000000000000..1dab8f98115d --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_after_view.tz @@ -0,0 +1,26 @@ +# This contract calls the view `id` on the address passed as +# parameter. After returning from the view it stores its +# address from SELF. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" (pair nat nat) ; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SELF ; + ADDRESS ; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + diff --git a/tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz b/tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz new file mode 100644 index 000000000000..47f848c0d5a1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz @@ -0,0 +1,19 @@ +parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %default) (string %C))); +storage unit; +code { + DROP; + SELF; DROP; + # Refers to entrypoint A of the current contract. + SELF %A; DROP; + # Refers to the default entry of the current contract + SELF %default; PACK; + # "SELF" w/o annotation also refers to the default + # entry of the current contract. Internally, they are equal. + SELF; PACK; ASSERT_CMPEQ; + # The following instruction would not typecheck: + # SELF %D, + # since there is no entrypoint D. + UNIT; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/opcodes/self_with_entrypoint.tz b/tests_python/contracts_016/opcodes/self_with_entrypoint.tz new file mode 100644 index 000000000000..ea6f8e1898e2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/self_with_entrypoint.tz @@ -0,0 +1,26 @@ +parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C))); +storage unit; +code { + DROP; + # Refers to entrypoint A of the current contract. + SELF %A; PACK @Apacked; + # Refers to the default entry of the current contract + SELF %default; PACK @defpacked; DUP; DIP { SWAP }; ASSERT_CMPNEQ; + # "SELF" w/o annotation also refers to the default + # entry of the current contract + SELF; PACK @selfpacked; ASSERT_CMPEQ; + + # Verify the types of the different entrypoints. CAST is noop + # if its argument is convertible with the type of the top of + # the stack. + SELF %A; CAST (contract nat); DROP; + SELF %B; CAST (contract bool); DROP; + SELF %maybe_C; CAST (contract (or (unit) (string))); DROP; + SELF %Z; CAST (contract unit); DROP; + SELF; CAST (contract (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))); DROP; + SELF %default; CAST (contract (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))); DROP; + + UNIT; + NIL operation; + PAIR; + } diff --git a/tests_python/contracts_016/opcodes/sender.tz b/tests_python/contracts_016/opcodes/sender.tz new file mode 100644 index 000000000000..fb174179aca5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/sender.tz @@ -0,0 +1,8 @@ +parameter unit ; +storage address ; +code{ + DROP ; + SENDER; + NIL operation ; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/sender_after_fib_view.tz b/tests_python/contracts_016/opcodes/sender_after_fib_view.tz new file mode 100644 index 000000000000..902e1bc8885e --- /dev/null +++ b/tests_python/contracts_016/opcodes/sender_after_fib_view.tz @@ -0,0 +1,26 @@ +# This contract calls the view `fib` on the address passed as +# parameter. After returning from the view it stores its +# SENDER. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 3 ; + VIEW "fib" nat; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SENDER; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + diff --git a/tests_python/contracts_016/opcodes/sender_after_nonexistent_view.tz b/tests_python/contracts_016/opcodes/sender_after_nonexistent_view.tz new file mode 100644 index 000000000000..9744af68417f --- /dev/null +++ b/tests_python/contracts_016/opcodes/sender_after_nonexistent_view.tz @@ -0,0 +1,25 @@ +# This contract calls the non-existent view on the address passed as +# parameter. After returning from the view it stores it's +# SENDER. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" string ; + ASSERT_NONE ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SENDER; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + + diff --git a/tests_python/contracts_016/opcodes/sender_after_view.tz b/tests_python/contracts_016/opcodes/sender_after_view.tz new file mode 100644 index 000000000000..b266defa5f3b --- /dev/null +++ b/tests_python/contracts_016/opcodes/sender_after_view.tz @@ -0,0 +1,25 @@ +# This contract calls the view `id` on the address passed as +# parameter. After returning from the view it stores its +# SENDER. +parameter address ; +storage address ; +code + { CAR ; + DUP ; + PUSH nat 0 ; + VIEW "id" (pair nat nat) ; + ASSERT_SOME ; + DROP ; + CONTRACT nat ; + ASSERT_SOME ; + PUSH mutez 1500 ; + PUSH nat 0 ; + TRANSFER_TOKENS ; + SENDER; + SWAP ; + NIL operation ; + SWAP ; + CONS ; + PAIR + } ; + diff --git a/tests_python/contracts_016/opcodes/set_car.tz b/tests_python/contracts_016/opcodes/set_car.tz new file mode 100644 index 000000000000..460b33856743 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_car.tz @@ -0,0 +1,3 @@ +parameter string; +storage (pair (string %s) (nat %n)); +code { DUP; CDR; DIP{CAR}; SET_CAR %s; NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/set_cdr.tz b/tests_python/contracts_016/opcodes/set_cdr.tz new file mode 100644 index 000000000000..d725756bbcaa --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_cdr.tz @@ -0,0 +1,3 @@ +parameter nat; +storage (pair (string %s) (nat %n)); +code { DUP; CDR; DIP{CAR}; SET_CDR %n; NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/set_delegate.tz b/tests_python/contracts_016/opcodes/set_delegate.tz new file mode 100644 index 000000000000..a7e051e50494 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_delegate.tz @@ -0,0 +1,9 @@ +parameter (option key_hash); +storage unit; +code { + UNPAIR; + SET_DELEGATE; + DIP {NIL operation}; + CONS; + PAIR + } diff --git a/tests_python/contracts_016/opcodes/set_id.tz b/tests_python/contracts_016/opcodes/set_id.tz new file mode 100644 index 000000000000..ede301b0e979 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_id.tz @@ -0,0 +1,3 @@ +parameter (set string); +storage (set string); +code { CAR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/set_iter.tz b/tests_python/contracts_016/opcodes/set_iter.tz new file mode 100644 index 000000000000..55d8ae34aba7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_iter.tz @@ -0,0 +1,3 @@ +parameter (set int); +storage int; +code { CAR; PUSH int 0; SWAP; ITER { ADD }; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/set_member.tz b/tests_python/contracts_016/opcodes/set_member.tz new file mode 100644 index 000000000000..ae97cce14345 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_member.tz @@ -0,0 +1,3 @@ +parameter string; +storage (pair (set string) (option bool)); +code {DUP; DUP; CAR; DIP{CDAR}; MEM; SOME; DIP {CDAR}; SWAP; PAIR ; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/set_size.tz b/tests_python/contracts_016/opcodes/set_size.tz new file mode 100644 index 000000000000..aa055cb02192 --- /dev/null +++ b/tests_python/contracts_016/opcodes/set_size.tz @@ -0,0 +1,3 @@ +parameter (set int); +storage nat; +code {CAR; SIZE; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/sets.tz b/tests_python/contracts_016/opcodes/sets.tz new file mode 100644 index 000000000000..42873aca228c --- /dev/null +++ b/tests_python/contracts_016/opcodes/sets.tz @@ -0,0 +1,40 @@ +parameter unit; +storage unit; +code + { + DROP; + + # Numerical types + PUSH (set nat) {0; 1; 3}; DROP; + PUSH (set int) {-1 ; 0; 3}; DROP; + PUSH (set mutez) {1; 4; 5; 10; 1923}; DROP; + PUSH + (set timestamp) + {-1; 0; "2017-09-16T08:38:04Z"; "2019-09-16T08:38:05Z"}; + DROP; + + # Booleans + PUSH (set bool) {}; DROP; + PUSH (set bool) {True}; DROP; + PUSH (set bool) {False}; DROP; + PUSH (set bool) {False; True}; DROP; + + # Strings and bytes + PUSH (set string) {""; "A"; "B"; "a"; "aa"; "b"}; DROP; + PUSH (set bytes) {0x; 0x01; 0x02; 0xAABBCC}; DROP; + + # Addresses + PUSH + (set key_hash) + { "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; + "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" }; + DROP; + PUSH + (set address) + { "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; + "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv"; + "KT1TZCh8fmUbuDqFxetPWC2fsQanAHzLx4W9"}; + DROP; + + UNIT; NIL operation; PAIR; + } diff --git a/tests_python/contracts_016/opcodes/sha3.tz b/tests_python/contracts_016/opcodes/sha3.tz new file mode 100644 index 000000000000..3ce8cde000e3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/sha3.tz @@ -0,0 +1,8 @@ +storage (option bytes); +parameter bytes; +code + { + CAR; + SHA3; SOME; + NIL operation; PAIR + } diff --git a/tests_python/contracts_016/opcodes/shifts.tz b/tests_python/contracts_016/opcodes/shifts.tz new file mode 100644 index 000000000000..71964750c0b8 --- /dev/null +++ b/tests_python/contracts_016/opcodes/shifts.tz @@ -0,0 +1,18 @@ +parameter (or (pair nat nat) (pair nat nat)); +storage (option nat); +# this contract takes either (Left a b) and stores (a << b) +# or (Right a b) and stores (a >> b). +# i.e., in the first case, the first component shifted to the left by +# the second, and the second case, component shifted to the right by +# the second. +code { CAR; + IF_LEFT { + UNPAIR; LSL; + } + { + UNPAIR; LSR; + }; + SOME; + NIL operation; + PAIR; + }; diff --git a/tests_python/contracts_016/opcodes/slice.tz b/tests_python/contracts_016/opcodes/slice.tz new file mode 100644 index 000000000000..3461bb5533d1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/slice.tz @@ -0,0 +1,5 @@ +parameter (pair nat nat); +storage (option string); +code { UNPAIR; SWAP; + IF_SOME {SWAP; UNPAIR; SLICE;} {DROP; NONE string;}; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/slice_bytes.tz b/tests_python/contracts_016/opcodes/slice_bytes.tz new file mode 100644 index 000000000000..c0f60f358765 --- /dev/null +++ b/tests_python/contracts_016/opcodes/slice_bytes.tz @@ -0,0 +1,5 @@ +parameter (pair nat nat); +storage (option bytes); +code { UNPAIR; SWAP; + IF_SOME {SWAP; UNPAIR; SLICE;} {DROP; NONE bytes;}; + NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/slices.tz b/tests_python/contracts_016/opcodes/slices.tz new file mode 100644 index 000000000000..fa76827261c0 --- /dev/null +++ b/tests_python/contracts_016/opcodes/slices.tz @@ -0,0 +1,11 @@ +parameter (pair bytes signature) ; +storage key ; +code { DUP ; + CAAR ; DUP ; SIZE ; PUSH nat 128 ; SWAP ; SUB ; ISNAT ; IF_SOME {} { FAIL } ; + PUSH nat 128 ; SLICE @payload ; ASSERT_SOME ; + DUP ; DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; SHA256 ; ASSERT_CMPEQ } ; + DUP ; DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; BLAKE2B ; ASSERT_CMPEQ } ; + DUP ; DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; SHA512 ; ASSERT_CMPEQ } ; + DIP { DUP ; CDR ; DIP { DUP ; CADR }} ; SWAP ; DIP { SWAP } ; CHECK_SIGNATURE ; ASSERT ; + CDR ; DUP ; HASH_KEY ; IMPLICIT_ACCOUNT ; BALANCE ; UNIT ; TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/source.tz b/tests_python/contracts_016/opcodes/source.tz new file mode 100644 index 000000000000..fc3c642027d3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/source.tz @@ -0,0 +1,10 @@ +parameter unit ; + +storage address ; + +code{ + DROP ; + SOURCE; + NIL operation ; + PAIR + } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/split_bytes.tz b/tests_python/contracts_016/opcodes/split_bytes.tz new file mode 100644 index 000000000000..f3b623b3c4b3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/split_bytes.tz @@ -0,0 +1,16 @@ +parameter bytes ; +storage (list bytes) ; +code { UNPAIR ; + DIP { NIL bytes ; SWAP ; ITER { CONS } } ; + DUP ; SIZE ; PUSH nat 0 ; CMPNEQ ; + DIP { PUSH @index nat 0 } ; + LOOP + { PAIR ; DUP ; + DIP { UNPAIR ; DIP { PUSH nat 1 } ; SLICE ; ASSERT_SOME ; CONS @storage } ; + UNPAIR ; + PUSH nat 1 ; ADD @index ; + DUP ; DIP { DIP { DUP } ; SWAP ; SIZE ; CMPNEQ } ; SWAP ; + } ; + DROP ; DROP ; + NIL bytes ; SWAP ; ITER { CONS } ; + NIL operation ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/split_string.tz b/tests_python/contracts_016/opcodes/split_string.tz new file mode 100644 index 000000000000..909ba604742d --- /dev/null +++ b/tests_python/contracts_016/opcodes/split_string.tz @@ -0,0 +1,16 @@ +parameter string ; +storage (list string) ; +code { UNPAIR ; + DIP { NIL string ; SWAP ; ITER { CONS } } ; + DUP ; SIZE ; PUSH nat 0 ; CMPNEQ ; + DIP { PUSH @index nat 0 } ; + LOOP + { PAIR ; DUP ; + DIP { UNPAIR ; DIP { PUSH nat 1 } ; SLICE ; ASSERT_SOME ; CONS @storage } ; + UNPAIR ; + PUSH nat 1 ; ADD @index ; + DUP ; DIP { DIP { DUP } ; SWAP ; SIZE ; CMPNEQ } ; SWAP ; + } ; + DROP ; DROP ; + NIL string ; SWAP ; ITER { CONS } ; + NIL operation ; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/store_bls12_381_fr.tz b/tests_python/contracts_016/opcodes/store_bls12_381_fr.tz new file mode 100644 index 000000000000..b40aa9b4ad1c --- /dev/null +++ b/tests_python/contracts_016/opcodes/store_bls12_381_fr.tz @@ -0,0 +1,3 @@ +parameter bls12_381_fr; +storage (option (bls12_381_fr)); +code {CAR; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/store_bls12_381_g1.tz b/tests_python/contracts_016/opcodes/store_bls12_381_g1.tz new file mode 100644 index 000000000000..1bc148f54282 --- /dev/null +++ b/tests_python/contracts_016/opcodes/store_bls12_381_g1.tz @@ -0,0 +1,3 @@ +parameter bls12_381_g1; +storage (option (bls12_381_g1)); +code {CAR; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/store_bls12_381_g2.tz b/tests_python/contracts_016/opcodes/store_bls12_381_g2.tz new file mode 100644 index 000000000000..b64087706265 --- /dev/null +++ b/tests_python/contracts_016/opcodes/store_bls12_381_g2.tz @@ -0,0 +1,3 @@ +parameter bls12_381_g2; +storage (option (bls12_381_g2)); +code {CAR; SOME; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/store_input.tz b/tests_python/contracts_016/opcodes/store_input.tz new file mode 100644 index 000000000000..4eee565ca2e9 --- /dev/null +++ b/tests_python/contracts_016/opcodes/store_input.tz @@ -0,0 +1,3 @@ +parameter string; +storage string; +code {CAR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/store_now.tz b/tests_python/contracts_016/opcodes/store_now.tz new file mode 100644 index 000000000000..1a868ac06f14 --- /dev/null +++ b/tests_python/contracts_016/opcodes/store_now.tz @@ -0,0 +1,3 @@ +parameter unit; +storage timestamp; +code {DROP; NOW; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/str_id.tz b/tests_python/contracts_016/opcodes/str_id.tz new file mode 100644 index 000000000000..f9e0710c328f --- /dev/null +++ b/tests_python/contracts_016/opcodes/str_id.tz @@ -0,0 +1,3 @@ +parameter string; +storage (option string); +code { CAR ; SOME ; NIL operation ; PAIR }; diff --git a/tests_python/contracts_016/opcodes/sub_timestamp_delta.tz b/tests_python/contracts_016/opcodes/sub_timestamp_delta.tz new file mode 100644 index 000000000000..f154e952414f --- /dev/null +++ b/tests_python/contracts_016/opcodes/sub_timestamp_delta.tz @@ -0,0 +1,3 @@ +parameter (pair timestamp int); +storage timestamp; +code { CAR; DUP; CAR; DIP{CDR}; SUB; NIL operation; PAIR} diff --git a/tests_python/contracts_016/opcodes/subset.tz b/tests_python/contracts_016/opcodes/subset.tz new file mode 100644 index 000000000000..a16ef1695cb2 --- /dev/null +++ b/tests_python/contracts_016/opcodes/subset.tz @@ -0,0 +1,12 @@ +parameter (pair (set string) (set string)); +storage bool; +code { CAR; DUP; CDR; DIP{CAR}; # Unpack lists + PUSH bool True; + PAIR; SWAP; # Setup accumulator + ITER { DIP{ DUP; DUP; CDR; + DIP{CAR; DIP{CDR}}}; + MEM; # Check membership + AND; # Combine accumulator and input + PAIR}; + CAR; # Get the accumulator value + NIL operation; PAIR} # Calling convention diff --git a/tests_python/contracts_016/opcodes/tez_add_sub.tz b/tests_python/contracts_016/opcodes/tez_add_sub.tz new file mode 100644 index 000000000000..990fb2ffac4d --- /dev/null +++ b/tests_python/contracts_016/opcodes/tez_add_sub.tz @@ -0,0 +1,5 @@ +parameter (pair mutez mutez); +storage (option (pair mutez mutez)); +code {CAR; DUP; DUP; CAR; DIP{CDR}; ADD; + DIP{DUP; CAR; DIP{CDR}; SUB_MUTEZ; ASSERT_SOME}; + PAIR; SOME; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/ticket_bad.tz b/tests_python/contracts_016/opcodes/ticket_bad.tz new file mode 100644 index 000000000000..e183ac5278b5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_bad.tz @@ -0,0 +1,5 @@ +# Although this contract is correctly typed, originating it with a forged +# ticket should be refused +parameter unit; +storage (ticket nat); +code { CDR ; NIL operation ; PAIR } diff --git a/tests_python/contracts_016/opcodes/ticket_big_store.tz b/tests_python/contracts_016/opcodes/ticket_big_store.tz new file mode 100644 index 000000000000..05cb7725bfaf --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_big_store.tz @@ -0,0 +1,3 @@ +parameter nat ; +storage (big_map unit (ticket nat)); +code { UNPAIR ; PUSH nat 1 ; SWAP ; TICKET ; ASSERT_SOME; SOME ; UNIT ; UPDATE ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/ticket_join.tz b/tests_python/contracts_016/opcodes/ticket_join.tz new file mode 100644 index 000000000000..3aef469a48c5 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_join.tz @@ -0,0 +1,7 @@ +parameter (ticket nat); +storage (option (ticket nat)); +code { UNPAIR ; SWAP ; + IF_NONE {} { PAIR ; JOIN_TICKETS ; ASSERT_SOME } ; + SOME ; + NIL operation ; + PAIR } diff --git a/tests_python/contracts_016/opcodes/ticket_read.tz b/tests_python/contracts_016/opcodes/ticket_read.tz new file mode 100644 index 000000000000..c41176a5fee0 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_read.tz @@ -0,0 +1,8 @@ +parameter (ticket nat); +storage address; +code { CAR ; + READ_TICKET ; DIP { DROP } ; UNPAIR ; DIP { UNPAIR } ; + DIIP { PUSH nat 1 ; ASSERT_CMPEQ } ; + DIP { PUSH nat 42 ; ASSERT_CMPEQ } ; + NIL operation ; + PAIR } diff --git a/tests_python/contracts_016/opcodes/ticket_split.tz b/tests_python/contracts_016/opcodes/ticket_split.tz new file mode 100644 index 000000000000..a2587beb717e --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_split.tz @@ -0,0 +1,11 @@ +parameter (ticket nat) ; +storage unit; +code + { CAR ; + PUSH (pair nat nat) (Pair 1 2) ; SWAP; + SPLIT_TICKET; ASSERT_SOME; UNPAIR; + READ_TICKET; CDDR; PUSH nat 1; ASSERT_CMPEQ; + DROP; + READ_TICKET; CDDR; PUSH nat 2; ASSERT_CMPEQ; + DROP; + UNIT ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/ticket_store-2.tz b/tests_python/contracts_016/opcodes/ticket_store-2.tz new file mode 100644 index 000000000000..cab3dd79d012 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_store-2.tz @@ -0,0 +1,3 @@ +parameter (option (ticket nat)) ; +storage (option (ticket nat)); +code { CAR ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/ticket_store.tz b/tests_python/contracts_016/opcodes/ticket_store.tz new file mode 100644 index 000000000000..926a04aa1e88 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticket_store.tz @@ -0,0 +1,3 @@ +parameter (ticket nat) ; +storage (option (ticket nat)); +code { CAR ; SOME ; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/ticketer-2.tz b/tests_python/contracts_016/opcodes/ticketer-2.tz new file mode 100644 index 000000000000..fe81daf47632 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticketer-2.tz @@ -0,0 +1,9 @@ +parameter (pair (pair address nat) nat) ; +storage unit; +code { CAR ; UNPAIR ; UNPAIR ; + CONTRACT (ticket nat) ; ASSERT_SOME ; + DIP { TICKET ; ASSERT_SOME } ; + SWAP ; DIP { PUSH mutez 0 } ; + TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; + UNIT ; SWAP ; PAIR } diff --git a/tests_python/contracts_016/opcodes/ticketer.tz b/tests_python/contracts_016/opcodes/ticketer.tz new file mode 100644 index 000000000000..d6660d1fe600 --- /dev/null +++ b/tests_python/contracts_016/opcodes/ticketer.tz @@ -0,0 +1,11 @@ +parameter address; +storage nat; +code { UNPAIR ; DIP { DUP } ; + SWAP ; + PUSH nat 1 ; SWAP ; + TICKET ; + ASSERT_SOME ; + DIP { CONTRACT (ticket nat) ; ASSERT_SOME ; PUSH mutez 0 } ; + TRANSFER_TOKENS ; + NIL operation ; SWAP ; CONS ; + PAIR } diff --git a/tests_python/contracts_016/opcodes/transfer_amount.tz b/tests_python/contracts_016/opcodes/transfer_amount.tz new file mode 100644 index 000000000000..973c64f04dcc --- /dev/null +++ b/tests_python/contracts_016/opcodes/transfer_amount.tz @@ -0,0 +1,3 @@ +parameter unit; +storage mutez; +code { DROP; AMOUNT; NIL operation; PAIR }; diff --git a/tests_python/contracts_016/opcodes/transfer_tokens.tz b/tests_python/contracts_016/opcodes/transfer_tokens.tz new file mode 100644 index 000000000000..599b4dae180f --- /dev/null +++ b/tests_python/contracts_016/opcodes/transfer_tokens.tz @@ -0,0 +1,5 @@ +parameter (contract unit); +storage unit; +code { CAR; DIP{UNIT}; PUSH mutez 100000000; UNIT; + TRANSFER_TOKENS; + NIL operation; SWAP; CONS; PAIR}; diff --git a/tests_python/contracts_016/opcodes/uncomb.tz b/tests_python/contracts_016/opcodes/uncomb.tz new file mode 100644 index 000000000000..84c3ced7ca9c --- /dev/null +++ b/tests_python/contracts_016/opcodes/uncomb.tz @@ -0,0 +1,8 @@ +parameter (pair nat nat nat); +storage nat; +code { CAR ; + UNPAIR 3 ; + PUSH nat 100 ; MUL ; + SWAP ; PUSH nat 10 ; MUL ; + ADD ; ADD ; + NIL operation ; PAIR ; } diff --git a/tests_python/contracts_016/opcodes/unpair.tz b/tests_python/contracts_016/opcodes/unpair.tz new file mode 100644 index 000000000000..b45f30a03d38 --- /dev/null +++ b/tests_python/contracts_016/opcodes/unpair.tz @@ -0,0 +1,71 @@ +parameter (unit :param_unit); +storage (unit :u1); +code { DROP ; + + # No annotation + UNIT; UNIT; PAIR; UNPAIR; DROP 2; + + # Variable annotations are overriden by UNPAIR + UNIT @b; UNIT @a; PAIR; UNPAIR @c @d; DROP 2; + + UNIT @b; UNIT @a; PAIR %@ %@; + DUP; UNPAIR %a %b; DROP 2; + DUP; UNPAIR % %b; DROP 2; + DUP; UNPAIR %a %; DROP 2; + DUP; UNPAIR % %; DROP 2; + DUP; UNPAIR %a; DROP 2; + DUP; UNPAIR %; DROP 2; + DUP; UNPAIR; DROP 2; + DUP; UNPAIR %a %b @a @b; DROP 2; + DUP; UNPAIR @a @b %a %b; DROP 2; + DUP; UNPAIR @a @% %a %b; DROP 2; + DUP; UNPAIR @% @% %a %b; DROP 2; + DUP; UNPAIR @% @b %a %b; DROP 2; + DROP; + + # Same test with non-matching field and variable annotations + UNIT @d; UNIT @c; PAIR %a %b; + DUP; UNPAIR %a %b; DROP 2; + DUP; UNPAIR % %b; DROP 2; + DUP; UNPAIR %a %; DROP 2; + DUP; UNPAIR % %; DROP 2; + DUP; UNPAIR %a; DROP 2; + DUP; UNPAIR %; DROP 2; + DUP; UNPAIR; DROP 2; + DUP; UNPAIR %a %b @a @b; DROP 2; + DUP; UNPAIR @a @b %a %b; DROP 2; + DUP; UNPAIR @a @% %a %b; DROP 2; + DUP; UNPAIR @% @% %a %b; DROP 2; + DUP; UNPAIR @% @b %a %b; DROP 2; + DROP; + + # Same tests without the variable annotations in input + UNIT; UNIT; PAIR %a %b; + DUP; UNPAIR %a %b; DROP 2; + DUP; UNPAIR % %b; DROP 2; + DUP; UNPAIR %a %; DROP 2; + DUP; UNPAIR % %; DROP 2; + DUP; UNPAIR %a; DROP 2; + DUP; UNPAIR %; DROP 2; + DUP; UNPAIR; DROP 2; + DUP; UNPAIR %a %b @a @b; DROP 2; + DUP; UNPAIR @a @b %a %b; DROP 2; + DUP; UNPAIR @a @% %a %b; DROP 2; + DUP; UNPAIR @% @% %a %b; DROP 2; + DUP; UNPAIR @% @b %a %b; DROP 2; + DROP; + + # Tests for @%% + UNIT; UNIT; PAIR %a %b @p; + DUP; UNPAIR @%% @b; DROP 2; + DUP; UNPAIR @a @%%; DROP 2; + DUP; UNPAIR @%% @%%; DROP 2; + DUP; UNPAIR @% @%%; DROP 2; + DUP; UNPAIR @%% @%; DROP 2; + DROP; + + # Swapping variable annotations + UNIT @b; UNIT @a; PAIR @c; UNPAIR @b @a; DROP 2; + + # End of test + UNIT; NIL operation; PAIR } \ No newline at end of file diff --git a/tests_python/contracts_016/opcodes/unpair_field_annotation_mismatch.tz b/tests_python/contracts_016/opcodes/unpair_field_annotation_mismatch.tz new file mode 100644 index 000000000000..c2b3fe0a498d --- /dev/null +++ b/tests_python/contracts_016/opcodes/unpair_field_annotation_mismatch.tz @@ -0,0 +1,10 @@ +parameter (unit :param_unit); +storage (unit :u1); +code { DROP ; + + UNIT @b; UNIT @a; PAIR %@ %@; + # Field annotations must match (or be ommited) + DUP; UNPAIR %c %d; DROP 2; + DROP; + + UNIT; NIL operation; PAIR } diff --git a/tests_python/contracts_016/opcodes/update_big_map.tz b/tests_python/contracts_016/opcodes/update_big_map.tz new file mode 100644 index 000000000000..c403975a38fb --- /dev/null +++ b/tests_python/contracts_016/opcodes/update_big_map.tz @@ -0,0 +1,6 @@ +storage (pair (big_map string string) unit); +parameter (map string (option string)); +# this contract the stored big_map according to the map taken in parameter +code { UNPAPAIR; + ITER { UNPAIR; UPDATE; } ; + PAIR; NIL operation; PAIR}; diff --git a/tests_python/contracts_016/opcodes/utxo_read.tz b/tests_python/contracts_016/opcodes/utxo_read.tz new file mode 100644 index 000000000000..aec29b79730b --- /dev/null +++ b/tests_python/contracts_016/opcodes/utxo_read.tz @@ -0,0 +1,9 @@ +parameter (pair (ticket nat) nat); +storage address; +code { CAR ; + UNPAIR ; + READ_TICKET ; DIP { DROP } ; UNPAIR ; DIP { UNPAIR } ; + DIIP { ASSERT_CMPEQ } ; + DIP { PUSH nat 42 ; ASSERT_CMPEQ } ; + NIL operation ; + PAIR } diff --git a/tests_python/contracts_016/opcodes/utxor.tz b/tests_python/contracts_016/opcodes/utxor.tz new file mode 100644 index 000000000000..1720512520c3 --- /dev/null +++ b/tests_python/contracts_016/opcodes/utxor.tz @@ -0,0 +1,25 @@ +parameter (pair address address); +storage nat; +code { UNPAIR ; DIP { DUP } ; + SWAP ; + PUSH nat 5 ; SWAP ; + TICKET ; + ASSERT_SOME ; + PUSH nat 2 ; PUSH nat 3 ; PAIR ; + SWAP ; + SPLIT_TICKET ; + ASSERT_SOME ; + UNPAIR ; + DIP { DIP { DUP ; CAR ; + CONTRACT (pair (ticket nat) nat) ; ASSERT_SOME ; + PUSH mutez 0 } ; + PUSH nat 2 ; SWAP ; PAIR ; } ; + DIP { TRANSFER_TOKENS } ; + SWAP ; + DIP { DIP { CDR ; + CONTRACT (pair (ticket nat) nat) ; ASSERT_SOME ; + PUSH mutez 0 } ; + PUSH nat 3 ; SWAP ; PAIR ; } ; + DIP { TRANSFER_TOKENS } ; + NIL operation ; SWAP ; CONS ; SWAP ; CONS ; + PAIR } diff --git a/tests_python/contracts_016/opcodes/view_fib.tz b/tests_python/contracts_016/opcodes/view_fib.tz new file mode 100644 index 000000000000..1b44288dd4a1 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_fib.tz @@ -0,0 +1,9 @@ +parameter (pair nat address) ; +storage nat; +code { + CAR; + UNPAIR; + VIEW "fib" nat; + IF_SOME {NIL operation ; PAIR;} { FAIL } + } + diff --git a/tests_python/contracts_016/opcodes/view_mutual_recursion.tz b/tests_python/contracts_016/opcodes/view_mutual_recursion.tz new file mode 100644 index 000000000000..9446a195b6e7 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_mutual_recursion.tz @@ -0,0 +1,11 @@ +parameter (pair nat address) ; +storage nat; +code { + CAR; + DUP; + CDR; + SWAP; + VIEW "is_twenty" nat; + IF_SOME {NIL operation ; PAIR;} { FAIL } + } + diff --git a/tests_python/contracts_016/opcodes/view_op_add.tz b/tests_python/contracts_016/opcodes/view_op_add.tz new file mode 100644 index 000000000000..e0c611cd3e8c --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_add.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat ; +code { CAR ; UNPAIR ; VIEW "add" nat ; IF_SOME { } { FAIL }; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_op_constant.tz b/tests_python/contracts_016/opcodes/view_op_constant.tz new file mode 100644 index 000000000000..5fc8b427884a --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_constant.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage nat; +code { CAR ; UNPAIR ; VIEW "const" nat ; IF_SOME { } { FAIL }; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_op_id.tz b/tests_python/contracts_016/opcodes/view_op_id.tz new file mode 100644 index 000000000000..7eb267bda064 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_id.tz @@ -0,0 +1,4 @@ +parameter (pair nat address) ; +storage (pair nat nat) ; +code { CAR ; UNPAIR ; VIEW "id" (pair nat nat) ; IF_SOME { } { FAIL }; NIL operation ; PAIR } ; + diff --git a/tests_python/contracts_016/opcodes/view_op_nonexistent_addr.tz b/tests_python/contracts_016/opcodes/view_op_nonexistent_addr.tz new file mode 100644 index 000000000000..f6947732e00e --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_nonexistent_addr.tz @@ -0,0 +1,5 @@ +parameter (pair nat address) ; +storage bool ; +code { DROP; PUSH address "tz1SuakBpFdG9b4twyfrSMqZzruxhpMeSrE5"; PUSH nat 0; + VIEW "test" bool; IF_SOME { DROP ; PUSH bool True } { PUSH bool False } ; + NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_op_nonexistent_func.tz b/tests_python/contracts_016/opcodes/view_op_nonexistent_func.tz new file mode 100644 index 000000000000..ca8ae6be4d34 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_nonexistent_func.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage bool ; +code { CAR ; UNPAIR ; VIEW "not_exist" bool ; IF_SOME { DROP; PUSH bool True } { PUSH bool False }; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_op_test_step_contants.tz b/tests_python/contracts_016/opcodes/view_op_test_step_contants.tz new file mode 100644 index 000000000000..42106d2a6087 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_test_step_contants.tz @@ -0,0 +1,8 @@ +parameter address ; +storage (option (pair (pair mutez mutez) (pair (pair address address) address ))); +code { CAR ; + UNIT; + VIEW "step_constants" (pair (pair mutez mutez) (pair (pair address address) address )) ; + NIL operation ; + PAIR } ; + diff --git a/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_input_type.tz b/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_input_type.tz new file mode 100644 index 000000000000..d99353ace3d9 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_input_type.tz @@ -0,0 +1,3 @@ +parameter (pair int address) ; +storage nat; +code { CAR ; UNPAIR ; VIEW "add" nat ; IF_SOME { DROP ; PUSH nat 1 } { PUSH nat 0 }; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_output_type.tz b/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_output_type.tz new file mode 100644 index 000000000000..258cf616793c --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_output_type.tz @@ -0,0 +1,3 @@ +parameter (pair nat address) ; +storage bool; +code { CAR ; UNPAIR ; VIEW "add" bool; IF_SOME { DROP ; PUSH bool True} { PUSH bool False }; NIL operation ; PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_rec.tz b/tests_python/contracts_016/opcodes/view_rec.tz new file mode 100644 index 000000000000..490c72d29498 --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_rec.tz @@ -0,0 +1,12 @@ +parameter unit ; +storage unit ; +view "loop" address never { CAR; DUP; VIEW "loop" never; ASSERT_SOME } ; +code { CDR ; + SELF ; + ADDRESS ; + DUP ; + VIEW "loop" never ; + ASSERT_SOME ; + DROP ; + NIL operation ; + PAIR } ; diff --git a/tests_python/contracts_016/opcodes/view_toplevel_lib.tz b/tests_python/contracts_016/opcodes/view_toplevel_lib.tz new file mode 100644 index 000000000000..1810a8a8ec4c --- /dev/null +++ b/tests_python/contracts_016/opcodes/view_toplevel_lib.tz @@ -0,0 +1,67 @@ +parameter nat ; +storage nat ; +code { CAR ; NIL operation ; PAIR } ; +view "add" nat nat { UNPAIR ; ADD } ; +view "id" nat (pair nat nat) { } ; +view "test_failwith" nat (pair nat nat) { FAILWITH } ; +view "step_constants" unit (pair (pair mutez mutez) (pair (pair address address) address )) + { DROP ; + SOURCE; + SENDER; + SELF_ADDRESS; + PAIR; + PAIR; + BALANCE; + AMOUNT; + PAIR; + PAIR; + } ; + +view "succ" (pair nat address) nat + { CAR; + UNPAIR; + PUSH nat 1; ADD; + PAIR; + DUP; CDR; SWAP; + VIEW "is_twenty" nat; ASSERT_SOME; + } ; +view "is_twenty" (pair nat address) nat + { + CAR; + DUP; + CAR; + PUSH nat 20 ; + COMPARE; + EQ ; + IF { CAR; } + { DUP; CDR; SWAP; VIEW "succ" nat; ASSERT_SOME } + } ; +view "fib" nat nat + { + CAR; + DUP; + PUSH nat 0 ; + COMPARE ; + EQ ; + IF { } + { DUP; + PUSH nat 1; + COMPARE; + EQ; + IF { } + { DUP; + PUSH nat 1; SWAP; SUB; ABS; + SELF_ADDRESS; + SWAP; + VIEW "fib" nat; + IF_SOME { SWAP; + PUSH nat 2; SWAP; SUB; ABS; + SELF_ADDRESS; + SWAP; + VIEW "fib" nat; + IF_SOME { ADD; } { FAIL } + } + { FAIL }; + } + } + } diff --git a/tests_python/contracts_016/opcodes/voting_power.tz b/tests_python/contracts_016/opcodes/voting_power.tz new file mode 100644 index 000000000000..741bb196788d --- /dev/null +++ b/tests_python/contracts_016/opcodes/voting_power.tz @@ -0,0 +1,7 @@ +parameter key; # A public key +storage (pair nat nat); +code { CAR; + HASH_KEY; VOTING_POWER; # Get the number of rolls for the key + DIP { TOTAL_VOTING_POWER }; # Get the total number of rolls + PAIR; + NIL operation; PAIR; }; diff --git a/tests_python/contracts_016/opcodes/xor.tz b/tests_python/contracts_016/opcodes/xor.tz new file mode 100644 index 000000000000..557eaa642b9a --- /dev/null +++ b/tests_python/contracts_016/opcodes/xor.tz @@ -0,0 +1,13 @@ +parameter (or (pair bool bool) (pair nat nat)); +storage (option (or bool nat)); +code { + CAR; + IF_LEFT + { + UNPAIR; XOR; LEFT nat + } + { + UNPAIR; XOR; RIGHT bool + } ; + SOME; NIL operation ; PAIR + } diff --git a/tests_python/contracts_016/opcodes/xor_bytes.tz b/tests_python/contracts_016/opcodes/xor_bytes.tz new file mode 100644 index 000000000000..33f806c73470 --- /dev/null +++ b/tests_python/contracts_016/opcodes/xor_bytes.tz @@ -0,0 +1,15 @@ +parameter unit; +storage unit; +code { DROP; + + # 0x05 ^ 0x06 = 0x03 + PUSH bytes 0x05; PUSH bytes 0x06; XOR; PUSH bytes 0x03; ASSERT_CMPEQ; + + # 0x0005 ^ 0x0106 = 0x0103 + PUSH bytes 0x0005; PUSH bytes 0x0106; XOR; PUSH bytes 0x0103; ASSERT_CMPEQ; + + # Shorter bytes 0-padded to the left to have the same length as the longer one + # 0x05 ^ 0x0106 = 0x0005 ^ 0x0106 = 0x0103, not 0x03 + PUSH bytes 0x05; PUSH bytes 0x0106; XOR; PUSH bytes 0x0103; ASSERT_CMPEQ; + + UNIT; NIL @noop operation; PAIR; }; diff --git a/tests_python/tests_016/__init__.py b/tests_python/tests_016/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert.tz].out new file mode 100644 index 000000000000..9d25272c43d3 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert.tz].out @@ -0,0 +1,9 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert.tz] + +{ parameter bool ; + storage unit ; + code { CAR ; + { IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpeq.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpeq.tz].out new file mode 100644 index 000000000000..55de4e2f4c97 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpeq.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmpeq.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpge.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpge.tz].out new file mode 100644 index 000000000000..e722ff098362 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpge.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmpge.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; GE } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpgt.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpgt.tz].out new file mode 100644 index 000000000000..2d05af7960b4 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpgt.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmpgt.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; GT } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmple.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmple.tz].out new file mode 100644 index 000000000000..62dadfc741d4 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmple.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmple.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; LE } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmplt.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmplt.tz].out new file mode 100644 index 000000000000..d178c78c16b0 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmplt.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmplt.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; LT } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpneq.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpneq.tz].out new file mode 100644 index 000000000000..41288cac1bdf --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_cmpneq.tz].out @@ -0,0 +1,12 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_cmpneq.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + { { COMPARE ; NEQ } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_eq.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_eq.tz].out new file mode 100644 index 000000000000..b318d5148938 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_eq.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_eq.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { EQ ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_ge.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_ge.tz].out new file mode 100644 index 000000000000..b80888a2a113 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_ge.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_ge.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { GE ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_gt.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_gt.tz].out new file mode 100644 index 000000000000..fce53219e57d --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_gt.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_gt.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { GT ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_le.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_le.tz].out new file mode 100644 index 000000000000..63c86a9eb1d6 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_le.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_le.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { LE ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_lt.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_lt.tz].out new file mode 100644 index 000000000000..aba419d9878a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_lt.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_lt.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { LT ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_neq.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_neq.tz].out new file mode 100644 index 000000000000..afb4f08ea54a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--assert_neq.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/assert_neq.tz] + +{ parameter (pair int int) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + { NEQ ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_get_add.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_get_add.tz].out new file mode 100644 index 000000000000..25451dd2ba91 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_get_add.tz].out @@ -0,0 +1,23 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/big_map_get_add.tz] + +{ parameter (pair (pair %set_pair int (option int)) (pair %check_pair int (option int))) ; + storage (pair (big_map int int) unit) ; + code { DUP ; + DIP { { CDR ; CAR } } ; + DUP ; + DIP { { CAR ; CDR } ; DUP ; CAR ; DIP { CDR } ; UPDATE ; DUP } ; + { CAR ; CDR } ; + DUP ; + CDR ; + DIP { CAR ; GET } ; + { IF_NONE + { { IF_NONE {} { { UNIT ; FAILWITH } } } } + { SWAP ; + { IF_NONE + { { UNIT ; FAILWITH } } + { { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } } } } } ; + UNIT ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_mem.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_mem.tz].out new file mode 100644 index 000000000000..186af4263c26 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--big_map_mem.tz].out @@ -0,0 +1,14 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/big_map_mem.tz] + +{ parameter (pair int bool) ; + storage (pair (big_map int unit) unit) ; + code { DUP ; + DUP ; + { CAR ; CDR } ; + DIP { { CAR ; CAR } ; DIP { { CDR ; CAR } ; DUP } ; MEM } ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + UNIT ; + SWAP ; + PAIR ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--build_list.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--build_list.tz].out new file mode 100644 index 000000000000..17c1c438d400 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--build_list.tz].out @@ -0,0 +1,24 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/build_list.tz] + +{ parameter nat ; + storage (list nat) ; + code { CAR @counter ; + NIL @acc nat ; + SWAP ; + DUP @cmp_num ; + PUSH nat 0 ; + { COMPARE ; NEQ } ; + LOOP { DUP ; + DIP { SWAP } ; + CONS @acc ; + SWAP ; + PUSH nat 1 ; + SWAP ; + SUB @counter ; + DUP ; + DIP { ABS } ; + PUSH int 0 ; + { COMPARE ; NEQ } } ; + CONS ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--carn_and_cdrn.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--carn_and_cdrn.tz].out new file mode 100644 index 000000000000..9c232f540b64 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--carn_and_cdrn.tz].out @@ -0,0 +1,29 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/carn_and_cdrn.tz] + +{ parameter (pair nat nat nat unit) ; + storage unit ; + code { CAR ; + DUP ; + CAR ; + PUSH nat 1 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + { GET 1 } ; + PUSH nat 1 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + { GET 3 } ; + PUSH nat 4 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + { GET 5 } ; + PUSH nat 2 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DUP ; + { GET 6 } ; + UNIT ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare.tz].out new file mode 100644 index 000000000000..864b8d2d431b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare.tz].out @@ -0,0 +1,22 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/compare.tz] + +{ parameter (pair mutez mutez) ; + storage (list bool) ; + code { CAR ; + DUP ; + DUP ; + DUP ; + DUP ; + DIP 5 { NIL bool } ; + DIP 4 { DUP ; CAR ; DIP { CDR } ; COMPARE ; LE ; CONS } ; + DIP 3 { DUP ; CAR ; DIP { CDR } ; COMPARE ; GE ; CONS } ; + DIP 2 { DUP ; CAR ; DIP { CDR } ; COMPARE ; LT ; CONS } ; + DIP { DUP ; CAR ; DIP { CDR } ; COMPARE ; GT ; CONS } ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + EQ ; + CONS ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare_bytes.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare_bytes.tz].out new file mode 100644 index 000000000000..3143fc4251d5 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--compare_bytes.tz].out @@ -0,0 +1,22 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/compare_bytes.tz] + +{ parameter (pair bytes bytes) ; + storage (list bool) ; + code { CAR ; + DUP ; + DUP ; + DUP ; + DUP ; + DIP 5 { NIL bool } ; + DIP 4 { DUP ; CAR ; DIP { CDR } ; COMPARE ; LE ; CONS } ; + DIP 3 { DUP ; CAR ; DIP { CDR } ; COMPARE ; GE ; CONS } ; + DIP 2 { DUP ; CAR ; DIP { CDR } ; COMPARE ; LT ; CONS } ; + DIP { DUP ; CAR ; DIP { CDR } ; COMPARE ; GT ; CONS } ; + DUP ; + CAR ; + DIP { CDR } ; + COMPARE ; + EQ ; + CONS ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--fail.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--fail.tz].out new file mode 100644 index 000000000000..97baba6bf814 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--fail.tz].out @@ -0,0 +1,3 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/fail.tz] + +{ parameter unit ; storage unit ; code { { UNIT ; FAILWITH } } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--guestbook.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--guestbook.tz].out new file mode 100644 index 000000000000..fdb6853a806f --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--guestbook.tz].out @@ -0,0 +1,18 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/guestbook.tz] + +{ parameter string ; + storage (map address (option string)) ; + code { UNPAIR @message @guestbook ; + SWAP ; + DUP ; + SENDER ; + GET @previous_message ; + { IF_NONE { { UNIT ; FAILWITH } } {} } ; + { IF_NONE {} { { UNIT ; FAILWITH } } } ; + SWAP ; + SOME ; + SOME ; + SENDER ; + UPDATE ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--macro_annotations.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--macro_annotations.tz].out new file mode 100644 index 000000000000..a2bc58c76575 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--macro_annotations.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/macro_annotations.tz] + +{ parameter unit ; + storage (pair (unit %truc) unit) ; + code { DROP ; + UNIT ; + UNIT ; + PAIR %truc ; + UNIT ; + DUP @new_storage 2 ; + DIP { DROP ; DROP } ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--map_caddaadr.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--map_caddaadr.tz].out new file mode 100644 index 000000000000..1b00beab2dc3 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--map_caddaadr.tz].out @@ -0,0 +1,40 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/map_caddaadr.tz] + +{ parameter unit ; + storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat) ; + code { { DUP ; + DIP { CDR @%% ; + { DUP ; + DIP { CAR @%% ; + { DUP ; + DIP { CDR @%% ; + { DUP ; + DIP { CDR @%% ; + { DUP ; + DIP { CAR @%% ; + { DUP ; + DIP { CAR @%% ; + { DUP ; + CDR @value ; + { PUSH mutez 1000000 ; ADD } ; + SWAP ; + CAR @%% ; + PAIR %@ %value } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ } } ; + CAR @%% ; + PAIR %@ %@ } } ; + CAR @%% ; + PAIR %@ %@ } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ } } ; + CAR @%% ; + PAIR %@ %@ @new_storage } ; + NIL operation ; + SWAP ; + { CDR @%% ; SWAP ; PAIR % %@ } } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--max_in_list.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--max_in_list.tz].out new file mode 100644 index 000000000000..dbcc1f87cb85 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--max_in_list.tz].out @@ -0,0 +1,17 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/max_in_list.tz] + +{ parameter (list int) ; + storage (option int) ; + code { CAR ; + DIP { NONE int } ; + ITER { SWAP ; + IF_NONE + { SOME } + { DIP { DUP } ; + DUP ; + DIP { SWAP } ; + { COMPARE ; LE } ; + IF { DROP } { DIP { DROP } } ; + SOME } } ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--min.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--min.tz].out new file mode 100644 index 000000000000..69d91fb64904 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--min.tz].out @@ -0,0 +1,13 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/min.tz] + +{ parameter (pair int int) ; + storage int ; + code { CAR ; + DUP ; + DUP ; + CAR ; + DIP { CDR } ; + { COMPARE ; LT } ; + IF { CAR } { CDR } ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--pair_macro.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--pair_macro.tz].out new file mode 100644 index 000000000000..e20c0190d19b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--pair_macro.tz].out @@ -0,0 +1,18 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/pair_macro.tz] + +{ parameter unit ; + storage unit ; + code { UNIT ; + UNIT ; + UNIT ; + UNIT ; + UNIT ; + { DIP 3 { PAIR %x4 %x5 } ; + DIP 2 { PAIR %x3 } ; + DIP { PAIR %x2 } ; + PAIR %x1 @name } ; + { CDR ; CDR ; CDR ; CAR %x4 @fourth } ; + DROP ; + CDR ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--set_caddaadr.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--set_caddaadr.tz].out new file mode 100644 index 000000000000..5591b4e6a082 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--set_caddaadr.tz].out @@ -0,0 +1,33 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/set_caddaadr.tz] + +{ parameter mutez ; + storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat) ; + code { DUP ; + CAR ; + SWAP ; + CDR ; + { DUP ; + DIP { CAR @%% ; + { DUP ; + DIP { CDR @%% ; + { DUP ; + DIP { CDR @%% ; + { DUP ; + DIP { CAR @%% ; + { DUP ; + DIP { CAR @%% ; { DUP ; CDR %value ; DROP ; CAR @%% ; PAIR %@ %value } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ } } ; + CAR @%% ; + PAIR %@ %@ } } ; + CAR @%% ; + PAIR %@ %@ } } ; + CDR @%% ; + SWAP ; + PAIR %@ %@ @toplevel_pair_name } ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--take_my_money.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--take_my_money.tz].out new file mode 100644 index 000000000000..65caa48a4025 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--take_my_money.tz].out @@ -0,0 +1,14 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/take_my_money.tz] + +{ parameter key_hash ; + storage unit ; + code { CAR ; + IMPLICIT_ACCOUNT ; + DIP { UNIT } ; + PUSH mutez 1000000 ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--unpair_macro.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--unpair_macro.tz].out new file mode 100644 index 000000000000..6ced70fa1c8d --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_macros.TestMacroExpansion::test_macro_expansion[macros--unpair_macro.tz].out @@ -0,0 +1,20 @@ +tests_016/test_contract_macros.py::TestMacroExpansion::test_macro_expansion[macros/unpair_macro.tz] + +{ parameter (unit :param_unit) ; + storage (unit :u1) ; + code { DROP ; + UNIT :u4 @a4 ; + UNIT :u3 @a3 ; + UNIT :u2 @a2 ; + UNIT :u1 @a1 ; + PAIR ; + UNPAIR @x1 @x2 ; + { DIP 2 { PAIR %x3 %x4 } ; PAIR %x1 %x2 ; PAIR @p1 } ; + { UNPAIR ; UNPAIR ; DIP 2 { UNPAIR } } ; + { DIP 2 { PAIR %x3 %x4 } ; DIP { PAIR %x2 } ; PAIR %x1 @p2 } ; + { UNPAIR ; DIP { UNPAIR } ; DIP 2 { UNPAIR } } ; + { DIP { PAIR %x2 %x3 } ; DIP { PAIR % %x4 } ; PAIR %x1 @p3 } ; + { UNPAIR ; DIP { UNPAIR } ; DIP { UNPAIR } } ; + DIP { DROP ; DROP ; DROP } ; + NIL operation ; + PAIR } } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_diff.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_diff.out new file mode 100644 index 000000000000..a575b0e0d14b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_diff.out @@ -0,0 +1,29 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_origination_diff + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (big_map int int) ; + storage (big_map int int) ; + code { CAR ; NIL operation ; PAIR } } + Initial storage: (Pair 0 { Elt 1 (Some 4) }) + No delegate for this contract + This operation FAILED. + +Ill typed data: 1: (Pair 0 { Elt 1 (Some 4) }) +is not an expression of type big_map int int +At line 1 characters 0 to 26, value (Pair 0 { Elt 1 (Some 4) }) +is invalid for type big_map int int. +At line 1 characters 6 to 7, +Unexpected forged value. +Fatal error: + origination simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_id.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_id.out new file mode 100644 index 000000000000..c02344912111 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_id.out @@ -0,0 +1,27 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_origination_id + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (big_map int int) ; + storage (big_map int int) ; + code { CAR ; NIL operation ; PAIR } } + Initial storage: 0 + No delegate for this contract + This operation FAILED. + +Ill typed data: 1: 0 is not an expression of type big_map int int +At line 1 characters 0 to 1, value 0 is invalid for type big_map int int. +At line 1 characters 0 to 1, +Unexpected forged value. +Fatal error: + origination simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out new file mode 100644 index 000000000000..1ffd73a9de96 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_origination_literal.out @@ -0,0 +1,50 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_origination_literal + +Node is bootstrapped. +Estimated gas: 1643.536 units (will add 100 for safety) +Estimated storage: 403 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000461 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1744 + Storage limit: 423 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000461 + payload fees(the block proposer) ....... +ꜩ0.000461 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (big_map int int) ; + storage (big_map int int) ; + code { CAR ; NIL operation ; PAIR } } + Initial storage: { Elt 0 0 } + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 146 bytes + Updated big_maps: + New map(4) of type (big_map int int) + Set map(4)[0] to 0 + Paid storage size diff: 146 bytes + Consumed gas: 1643.536 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0365 + storage fees ........................... +ꜩ0.0365 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as originate_big_map_literal. +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_diff.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_diff.out new file mode 100644 index 000000000000..23bc447c6942 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_diff.out @@ -0,0 +1,23 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_transfer_diff + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair 0 { Elt 1 (Some 4) }) + This operation FAILED. + +Invalid argument passed to contract [CONTRACT_HASH]. +At (unshown) location 0, value (Pair 0 { Elt 1 (Some 4) }) +is invalid for type big_map int int. +At (unshown) location 1, Unexpected forged value. +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_id.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_id.out new file mode 100644 index 000000000000..9bf8bc00f29e --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractBigMapOrigination::test_big_map_transfer_id.out @@ -0,0 +1,22 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractBigMapOrigination::test_big_map_transfer_id + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: 0 + This operation FAILED. + +Invalid argument passed to contract [CONTRACT_HASH]. +At (unshown) location 0, value 0 is invalid for type big_map int int. +At (unshown) location 0, Unexpected forged value. +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainLevel::test_level.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainLevel::test_level.out new file mode 100644 index 000000000000..acd82e24cba3 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainLevel::test_level.out @@ -0,0 +1,123 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainLevel::test_level + +Node is bootstrapped. +Estimated gas: 1410.239 units (will add 100 for safety) +Estimated storage: 300 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000425 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1511 + Storage limit: 320 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000425 + payload fees(the block proposer) ....... +ꜩ0.000425 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ100 + Script: + { parameter unit ; + storage nat ; + code { DROP ; LEVEL ; NIL operation ; PAIR } } + Initial storage: 9999999 + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 43 bytes + Paid storage size diff: 43 bytes + Consumed gas: 1410.239 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01075 + storage fees ........................... +ꜩ0.01075 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +New contract [CONTRACT_HASH] originated. +Contract memorized as level. +Injected block at minimal timestamp +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2109.345 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000473 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2210 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000473 + payload fees(the block proposer) ....... +ꜩ0.000473 + Transaction: + Amount: ꜩ500 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: 4 + Storage size: 40 bytes + Consumed gas: 2109.345 + Balance updates: + [CONTRACT_HASH] ... -ꜩ500 + [CONTRACT_HASH] ... +ꜩ500 + +Injected block at minimal timestamp +{ "level": [LEVEL], "proto": 1, + "predecessor": "[BLOCK_HASH]", + "timestamp": "[TIMESTAMP]", "validation_pass": 4, + "operations_hash": "[OPERATION_HASH]", + "fitness": "[FITNESS]", + "context": "[CONTEXT]" } +4 +Injected block at minimal timestamp +Injected block at minimal timestamp +4 +Node is bootstrapped. +Estimated gas: 1203.092 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000383 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1304 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000383 + payload fees(the block proposer) ....... +ꜩ0.000383 + Transaction: + Amount: ꜩ500 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: 7 + Storage size: 40 bytes + Consumed gas: 1203.092 + Balance updates: + [CONTRACT_HASH] ... -ꜩ500 + [CONTRACT_HASH] ... +ꜩ500 + +Injected block at minimal timestamp +7 diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_contract_fails.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_contract_fails.out new file mode 100644 index 000000000000..9ed1be45991b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_contract_fails.out @@ -0,0 +1,2 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_contract_fails + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_gen_keys.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_gen_keys.out new file mode 100644 index 000000000000..5cb8a35f9bd0 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_gen_keys.out @@ -0,0 +1,2 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_gen_keys + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_init_proxy.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_init_proxy.out new file mode 100644 index 000000000000..0bb97fc5016d --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_init_proxy.out @@ -0,0 +1,53 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_init_proxy + +Node is bootstrapped. +Estimated gas: 1415.542 units (will add 100 for safety) +Estimated storage: 312 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000438 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1516 + Storage limit: 332 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000438 + payload fees(the block proposer) ....... +ꜩ0.000438 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (contract unit) ; + storage unit ; + code { UNPAIR ; + AMOUNT ; + UNIT ; + TRANSFER_TOKENS ; + DIP { NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 55 bytes + Paid storage size diff: 55 bytes + Consumed gas: 1415.542 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01375 + storage fees ........................... +ꜩ0.01375 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as proxy. +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_now.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_now.out new file mode 100644 index 000000000000..214395cfe94a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_now.out @@ -0,0 +1,2 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_now + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_self.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_self.out new file mode 100644 index 000000000000..0f796458a0a8 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_self.out @@ -0,0 +1,2 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_self + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_sender.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_sender.out new file mode 100644 index 000000000000..181fb96a54c3 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_sender.out @@ -0,0 +1,2 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_sender + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out new file mode 100644 index 000000000000..81096a95b95e --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_set_delegate.out @@ -0,0 +1,123 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_set_delegate + +Node is bootstrapped. +Estimated gas: 1413.394 units (will add 100 for safety) +Estimated storage: 308 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000434 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1514 + Storage limit: 328 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000434 + payload fees(the block proposer) ....... +ꜩ0.000434 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (option key_hash) ; + storage unit ; + code { UNPAIR ; SET_DELEGATE ; DIP { NIL operation } ; CONS ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 51 bytes + Paid storage size diff: 51 bytes + Consumed gas: 1413.394 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01275 + storage fees ........................... +ꜩ0.01275 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as set_delegate. +Injected block at minimal timestamp +Injected block at minimal timestamp +none +Node is bootstrapped. +Estimated gas: 3115.444 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000618 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3216 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000618 + payload fees(the block proposer) ....... +ꜩ0.000618 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Some "[CONTRACT_HASH]") + This transaction was successfully applied + Updated storage: Unit + Storage size: 51 bytes + Consumed gas: 2115.444 + Internal operations: + Internal Delegation: + Contract: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This delegation was successfully applied + Consumed gas: 1000 + +Injected block at minimal timestamp +[CONTRACT_HASH] (known as bootstrap5) +Node is bootstrapped. +Estimated gas: 2203.153 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000486 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2304 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000486 + payload fees(the block proposer) ....... +ꜩ0.000486 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: None + This transaction was successfully applied + Updated storage: Unit + Storage size: 51 bytes + Consumed gas: 1203.153 + Internal operations: + Internal Delegation: + Contract: [CONTRACT_HASH] + To: nobody + This delegation was successfully applied + Consumed gas: 1000 + +Injected block at minimal timestamp +none diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice.out new file mode 100644 index 000000000000..89ecf33b693c --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice.out @@ -0,0 +1,87 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice + +Node is bootstrapped. +Estimated gas: 1891.694 units (will add 100 for safety) +Estimated storage: 835 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.00103 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1992 + Storage limit: 855 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.00103 + payload fees(the block proposer) ....... +ꜩ0.00103 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (pair bytes signature) ; + storage key ; + code { DUP ; + CAAR ; + DUP ; + SIZE ; + PUSH nat 128 ; + SWAP ; + SUB ; + ISNAT ; + ASSERT_SOME ; + PUSH nat 128 ; + SLICE @payload ; + ASSERT_SOME ; + DUP ; + DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + SHA256 ; + ASSERT_CMPEQ } ; + DUP ; + DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + BLAKE2B ; + ASSERT_CMPEQ } ; + DUP ; + DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + SHA512 ; + ASSERT_CMPEQ } ; + DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + SWAP ; + DIP { SWAP } ; + CHECK_SIGNATURE ; + ASSERT ; + CDR ; + DUP ; + HASH_KEY ; + IMPLICIT_ACCOUNT ; + BALANCE ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } } + Initial storage: + "[OPERATION_HASH]na" + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 578 bytes + Paid storage size diff: 578 bytes + Consumed gas: 1891.694 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.1445 + storage fees ........................... +ꜩ0.1445 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as slices. +Injected block at minimal timestamp diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0 \"spsig1PPUFZucuAQybs5wsqs.818025e860.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0 \"spsig1PPUFZucuAQybs5wsqs.818025e860.out" new file mode 100644 index 000000000000..d8ebb2e6e2be --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0 \"spsig1PPUFZucuAQybs5wsqs.818025e860.out" @@ -0,0 +1,66 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm")] + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair 0xe009ab79e8b84ef0 + "sp[SIGNATURE]m") + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter (pair bytes signature) ; + 02: storage key ; + 03: code { DUP ; + 04: CAAR ; + 05: DUP ; + 06: SIZE ; + 07: PUSH nat 128 ; + 08: SWAP ; + 09: SUB ; + 10: ISNAT ; + 11: ASSERT_SOME ; + 12: PUSH nat 128 ; + 13: SLICE @payload ; + 14: ASSERT_SOME ; + 15: DUP ; + 16: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + 17: SHA256 ; + 18: ASSERT_CMPEQ } ; + 19: DUP ; + 20: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + 21: BLAKE2B ; + 22: ASSERT_CMPEQ } ; + 23: DUP ; + 24: DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + 25: SHA512 ; + 26: ASSERT_CMPEQ } ; + 27: DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + 28: SWAP ; + 29: DIP { SWAP } ; + 30: CHECK_SIGNATURE ; + 31: ASSERT ; + 32: CDR ; + 33: DUP ; + 34: HASH_KEY ; + 35: IMPLICIT_ACCOUNT ; + 36: BALANCE ; + 37: UNIT ; + 38: TRANSFER_TOKENS ; + 39: NIL operation ; + 40: SWAP ; + 41: CONS ; + 42: PAIR } } +At line 11 characters 9 to 20, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.2d6806d54e.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.2d6806d54e.out new file mode 100644 index 000000000000..48534fc93580 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.2d6806d54e.out @@ -0,0 +1,66 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2deaad01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm")] + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair [OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH]000085341554349535345 + "sp[SIGNATURE]m") + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter (pair bytes signature) ; + 02: storage key ; + 03: code { DUP ; + 04: CAAR ; + 05: DUP ; + 06: SIZE ; + 07: PUSH nat 128 ; + 08: SWAP ; + 09: SUB ; + 10: ISNAT ; + 11: ASSERT_SOME ; + 12: PUSH nat 128 ; + 13: SLICE @payload ; + 14: ASSERT_SOME ; + 15: DUP ; + 16: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + 17: SHA256 ; + 18: ASSERT_CMPEQ } ; + 19: DUP ; + 20: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + 21: BLAKE2B ; + 22: ASSERT_CMPEQ } ; + 23: DUP ; + 24: DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + 25: SHA512 ; + 26: ASSERT_CMPEQ } ; + 27: DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + 28: SWAP ; + 29: DIP { SWAP } ; + 30: CHECK_SIGNATURE ; + 31: ASSERT ; + 32: CDR ; + 33: DUP ; + 34: HASH_KEY ; + 35: IMPLICIT_ACCOUNT ; + 36: BALANCE ; + 37: UNIT ; + 38: TRANSFER_TOKENS ; + 39: NIL operation ; + 40: SWAP ; + 41: CONS ; + 42: PAIR } } +At line 22 characters 15 to 27, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.378d03ae2d.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.378d03ae2d.out new file mode 100644 index 000000000000..60e5ce5603c9 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.378d03ae2d.out @@ -0,0 +1,66 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150733eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm")] + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair [OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH]000085341554349535345 + "sp[SIGNATURE]m") + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter (pair bytes signature) ; + 02: storage key ; + 03: code { DUP ; + 04: CAAR ; + 05: DUP ; + 06: SIZE ; + 07: PUSH nat 128 ; + 08: SWAP ; + 09: SUB ; + 10: ISNAT ; + 11: ASSERT_SOME ; + 12: PUSH nat 128 ; + 13: SLICE @payload ; + 14: ASSERT_SOME ; + 15: DUP ; + 16: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + 17: SHA256 ; + 18: ASSERT_CMPEQ } ; + 19: DUP ; + 20: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + 21: BLAKE2B ; + 22: ASSERT_CMPEQ } ; + 23: DUP ; + 24: DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + 25: SHA512 ; + 26: ASSERT_CMPEQ } ; + 27: DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + 28: SWAP ; + 29: DIP { SWAP } ; + 30: CHECK_SIGNATURE ; + 31: ASSERT ; + 32: CDR ; + 33: DUP ; + 34: HASH_KEY ; + 35: IMPLICIT_ACCOUNT ; + 36: BALANCE ; + 37: UNIT ; + 38: TRANSFER_TOKENS ; + 39: NIL operation ; + 40: SWAP ; + 41: CONS ; + 42: PAIR } } +At line 26 characters 15 to 27, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.57fdc7ad1c.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.57fdc7ad1c.out new file mode 100644 index 000000000000..f0096c8b0c2c --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75.57fdc7ad1c.out @@ -0,0 +1,66 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_fails[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "p2sigsceCzcDw2AeYDzUonj4JT341WC9Px4wdhHBxbZcG1FhfqFVuG7f2fGCzrEHSAZgrsrQWpxduDPk9qZRgrpzwJnSHC3gZJ")] + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair [OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH]000085341554349535345 + "p2[SIGNATURE]") + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter (pair bytes signature) ; + 02: storage key ; + 03: code { DUP ; + 04: CAAR ; + 05: DUP ; + 06: SIZE ; + 07: PUSH nat 128 ; + 08: SWAP ; + 09: SUB ; + 10: ISNAT ; + 11: ASSERT_SOME ; + 12: PUSH nat 128 ; + 13: SLICE @payload ; + 14: ASSERT_SOME ; + 15: DUP ; + 16: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + 17: SHA256 ; + 18: ASSERT_CMPEQ } ; + 19: DUP ; + 20: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + 21: BLAKE2B ; + 22: ASSERT_CMPEQ } ; + 23: DUP ; + 24: DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + 25: SHA512 ; + 26: ASSERT_CMPEQ } ; + 27: DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + 28: SWAP ; + 29: DIP { SWAP } ; + 30: CHECK_SIGNATURE ; + 31: ASSERT ; + 32: CDR ; + 33: DUP ; + 34: HASH_KEY ; + 35: IMPLICIT_ACCOUNT ; + 36: BALANCE ; + 37: UNIT ; + 38: TRANSFER_TOKENS ; + 39: NIL operation ; + 40: SWAP ; + 41: CONS ; + 42: PAIR } } +At line 31 characters 9 to 15, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75.c583c796bf.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75.c583c796bf.out new file mode 100644 index 000000000000..d493a9bba6cd --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_fails[(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75.c583c796bf.out @@ -0,0 +1,66 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_fails[(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm")] + +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair [OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH]000085341554349535345 + "sp[SIGNATURE]m") + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter (pair bytes signature) ; + 02: storage key ; + 03: code { DUP ; + 04: CAAR ; + 05: DUP ; + 06: SIZE ; + 07: PUSH nat 128 ; + 08: SWAP ; + 09: SUB ; + 10: ISNAT ; + 11: ASSERT_SOME ; + 12: PUSH nat 128 ; + 13: SLICE @payload ; + 14: ASSERT_SOME ; + 15: DUP ; + 16: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 0 ; SLICE ; ASSERT_SOME } ; + 17: SHA256 ; + 18: ASSERT_CMPEQ } ; + 19: DUP ; + 20: DIP { DIP { DUP ; CAAR ; PUSH nat 32 ; PUSH nat 32 ; SLICE ; ASSERT_SOME } ; + 21: BLAKE2B ; + 22: ASSERT_CMPEQ } ; + 23: DUP ; + 24: DIP { DIP { DUP ; CAAR ; PUSH nat 64 ; PUSH nat 64 ; SLICE ; ASSERT_SOME } ; + 25: SHA512 ; + 26: ASSERT_CMPEQ } ; + 27: DIP { DUP ; CDR ; DIP { DUP ; CADR } } ; + 28: SWAP ; + 29: DIP { SWAP } ; + 30: CHECK_SIGNATURE ; + 31: ASSERT ; + 32: CDR ; + 33: DUP ; + 34: HASH_KEY ; + 35: IMPLICIT_ACCOUNT ; + 36: BALANCE ; + 37: UNIT ; + 38: TRANSFER_TOKENS ; + 39: NIL operation ; + 40: SWAP ; + 41: CONS ; + 42: PAIR } } +At line 18 characters 15 to 27, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out new file mode 100644 index 000000000000..fd2a7121fab6 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b.7da5c9014e.out @@ -0,0 +1,46 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_slice_success[(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm")] + +Node is bootstrapped. +Estimated gas: 3595.334 units (will add 100 for safety) +Estimated storage: 257 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000877 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3696 + Storage limit: 277 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000877 + payload fees(the block proposer) ....... +ꜩ0.000877 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair [OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH][OPERATION_HASH]000085341554349535345 + "sp[SIGNATURE]m") + This transaction was successfully applied + Updated storage: + [OPERATION_HASH]48f709699019725ba + Storage size: 578 bytes + Consumed gas: 2595.334 + Internal operations: + Internal Transaction: + Amount: ꜩ1000 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000 + Balance updates: + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out new file mode 100644 index 000000000000..4aa8f717b0c1 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_source.out @@ -0,0 +1,119 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_source + +Node is bootstrapped. +Estimated gas: 1414.707 units (will add 100 for safety) +Estimated storage: 322 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000462 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1515 + Storage limit: 342 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000462 + payload fees(the block proposer) ....... +ꜩ0.000462 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter unit ; + storage address ; + code { DROP ; SOURCE ; NIL operation ; PAIR } } + Initial storage: "[CONTRACT_HASH]" + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 65 bytes + Paid storage size diff: 65 bytes + Consumed gas: 1414.707 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01625 + storage fees ........................... +ꜩ0.01625 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as source. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2110.879 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.00047 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2211 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.00047 + payload fees(the block proposer) ....... +ꜩ0.00047 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c + Storage size: 65 bytes + Consumed gas: 2110.879 + +Injected block at minimal timestamp +"[CONTRACT_HASH]" +[CONTRACT_HASH] + +Node is bootstrapped. +Estimated gas: 3772.724 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000682 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3873 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000682 + payload fees(the block proposer) ....... +ꜩ0.000682 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 55 bytes + Consumed gas: 2569.152 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c + Storage size: 65 bytes + Consumed gas: 1203.572 + +Injected block at minimal timestamp +"[CONTRACT_HASH]" diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_bytes.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_bytes.out new file mode 100644 index 000000000000..b051f9357d02 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_bytes.out @@ -0,0 +1,139 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_split_bytes + +Node is bootstrapped. +Estimated gas: 1473.672 units (will add 100 for safety) +Estimated storage: 511 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000643 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1574 + Storage limit: 531 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000643 + payload fees(the block proposer) ....... +ꜩ0.000643 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter bytes ; + storage (list bytes) ; + code { UNPAIR ; + DIP { NIL bytes ; SWAP ; ITER { CONS } } ; + DUP ; + SIZE ; + PUSH nat 0 ; + CMPNEQ ; + DIP { PUSH @index nat 0 } ; + LOOP { PAIR ; + DUP ; + DIP { UNPAIR ; DIP { PUSH nat 1 } ; SLICE ; ASSERT_SOME ; CONS @storage } ; + UNPAIR ; + PUSH nat 1 ; + ADD @index ; + DUP ; + DIP { DIP { DUP } ; SWAP ; SIZE ; CMPNEQ } ; + SWAP } ; + DROP ; + DROP ; + NIL bytes ; + SWAP ; + ITER { CONS } ; + NIL operation ; + PAIR } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 254 bytes + Paid storage size diff: 254 bytes + Consumed gas: 1473.672 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0635 + storage fees ........................... +ꜩ0.0635 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as split_bytes. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2151.619 units (will add 100 for safety) +Estimated storage: 18 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000487 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2252 + Storage limit: 38 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000487 + payload fees(the block proposer) ....... +ꜩ0.000487 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: 0xaabbcc + This transaction was successfully applied + Updated storage: { 0xaa ; 0xbb ; 0xcc } + Storage size: 272 bytes + Paid storage size diff: 18 bytes + Consumed gas: 2151.619 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0045 + storage fees ........................... +ꜩ0.0045 + +Injected block at minimal timestamp +{ 0xaa ; 0xbb ; 0xcc } +Node is bootstrapped. +Estimated gas: 1207.658 units (will add 100 for safety) +Estimated storage: 18 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000392 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1308 + Storage limit: 38 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000392 + payload fees(the block proposer) ....... +ꜩ0.000392 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: 0xddeeff + This transaction was successfully applied + Updated storage: { 0xaa ; 0xbb ; 0xcc ; 0xdd ; 0xee ; 0xff } + Storage size: 290 bytes + Paid storage size diff: 18 bytes + Consumed gas: 1207.658 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0045 + storage fees ........................... +ꜩ0.0045 + +Injected block at minimal timestamp +{ 0xaa ; 0xbb ; 0xcc ; 0xdd ; 0xee ; 0xff } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_string.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_string.out new file mode 100644 index 000000000000..e49be3e07aa1 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_split_string.out @@ -0,0 +1,139 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_split_string + +Node is bootstrapped. +Estimated gas: 1473.672 units (will add 100 for safety) +Estimated storage: 511 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000643 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1574 + Storage limit: 531 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000643 + payload fees(the block proposer) ....... +ꜩ0.000643 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter string ; + storage (list string) ; + code { UNPAIR ; + DIP { NIL string ; SWAP ; ITER { CONS } } ; + DUP ; + SIZE ; + PUSH nat 0 ; + CMPNEQ ; + DIP { PUSH @index nat 0 } ; + LOOP { PAIR ; + DUP ; + DIP { UNPAIR ; DIP { PUSH nat 1 } ; SLICE ; ASSERT_SOME ; CONS @storage } ; + UNPAIR ; + PUSH nat 1 ; + ADD @index ; + DUP ; + DIP { DIP { DUP } ; SWAP ; SIZE ; CMPNEQ } ; + SWAP } ; + DROP ; + DROP ; + NIL string ; + SWAP ; + ITER { CONS } ; + NIL operation ; + PAIR } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 254 bytes + Paid storage size diff: 254 bytes + Consumed gas: 1473.672 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0635 + storage fees ........................... +ꜩ0.0635 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as split_string. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2151.683 units (will add 100 for safety) +Estimated storage: 18 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000487 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2252 + Storage limit: 38 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000487 + payload fees(the block proposer) ....... +ꜩ0.000487 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "abc" + This transaction was successfully applied + Updated storage: { "a" ; "b" ; "c" } + Storage size: 272 bytes + Paid storage size diff: 18 bytes + Consumed gas: 2151.683 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0045 + storage fees ........................... +ꜩ0.0045 + +Injected block at minimal timestamp +{ "a" ; "b" ; "c" } +Node is bootstrapped. +Estimated gas: 1207.722 units (will add 100 for safety) +Estimated storage: 18 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000392 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1308 + Storage limit: 38 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000392 + payload fees(the block proposer) ....... +ꜩ0.000392 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "def" + This transaction was successfully applied + Updated storage: { "a" ; "b" ; "c" ; "d" ; "e" ; "f" } + Storage size: 290 bytes + Paid storage size diff: 18 bytes + Consumed gas: 1207.722 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0045 + storage fees ........................... +ꜩ0.0045 + +Injected block at minimal timestamp +{ "a" ; "b" ; "c" ; "d" ; "e" ; "f" } diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_store_input.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_store_input.out new file mode 100644 index 000000000000..9e7755fab99c --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_store_input.out @@ -0,0 +1,185 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_store_input + +Node is bootstrapped. +Estimated gas: 1000.040 units (will add 0 for safety) +Estimated storage: 257 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000354 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1001 + Storage limit: 277 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000354 + payload fees(the block proposer) ....... +ꜩ0.000354 + Transaction: + Amount: ꜩ1000 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000.040 + Balance updates: + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 1000.040 units (will add 0 for safety) +Estimated storage: 257 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000354 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1001 + Storage limit: 277 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000354 + payload fees(the block proposer) ....... +ꜩ0.000354 + Transaction: + Amount: ꜩ2000 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000.040 + Balance updates: + [CONTRACT_HASH] ... -ꜩ2000 + [CONTRACT_HASH] ... +ꜩ2000 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +Injected block at minimal timestamp +1000 ꜩ +2000 ꜩ +Node is bootstrapped. +Estimated gas: 1409.111 units (will add 100 for safety) +Estimated storage: 298 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000422 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1510 + Storage limit: 318 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000422 + payload fees(the block proposer) ....... +ꜩ0.000422 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ100 + Script: + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } + Initial storage: "" + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 41 bytes + Paid storage size diff: 41 bytes + Consumed gas: 1409.111 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01025 + storage fees ........................... +ꜩ0.01025 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +New contract [CONTRACT_HASH] originated. +Contract memorized as store_input. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2109.125 units (will add 100 for safety) +Estimated storage: 7 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000489 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2210 + Storage limit: 27 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000489 + payload fees(the block proposer) ....... +ꜩ0.000489 + Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "abcdefg" + This transaction was successfully applied + Updated storage: "abcdefg" + Storage size: 48 bytes + Paid storage size diff: 7 bytes + Consumed gas: 2109.125 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.00175 + storage fees ........................... +ꜩ0.00175 + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +Injected block at minimal timestamp +200 ꜩ +"abcdefg" +Node is bootstrapped. +Estimated gas: 1203.280 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000395 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1304 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000395 + payload fees(the block proposer) ....... +ꜩ0.000395 + Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "xyz" + This transaction was successfully applied + Updated storage: "xyz" + Storage size: 44 bytes + Consumed gas: 1203.280 + Balance updates: + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +Injected block at minimal timestamp +"xyz" diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type.tz].out new file mode 100644 index 000000000000..71baa3a72d12 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type.tz].out @@ -0,0 +1,93 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_trace_origination[compare_big_type.tz] + +Node is bootstrapped. +Estimated gas: 2439.320 units (will add 100 for safety) +Estimated storage: 385 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000613 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2540 + Storage limit: 405 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000613 + payload fees(the block proposer) ....... +ꜩ0.000613 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + PUSH nat 0 ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 128 bytes + Paid storage size diff: 128 bytes + Consumed gas: 2439.320 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.032 + storage fees ........................... +ꜩ0.032 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as compare_big_type. +Injected block at minimal timestamp +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type2.tz].out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type2.tz].out new file mode 100644 index 000000000000..40672e01537f --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_trace_origination[compare_big_type2.tz].out @@ -0,0 +1,97 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_trace_origination[compare_big_type2.tz] + +Node is bootstrapped. +Estimated gas: 2599.209 units (will add 100 for safety) +Estimated storage: 393 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000637 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2700 + Storage limit: 413 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000637 + payload fees(the block proposer) ....... +ꜩ0.000637 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + PUSH nat 0 ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + PAIR ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DUP ; + DUP ; + COMPARE ; + DROP ; + DROP ; + UNIT ; + NIL operation ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 136 bytes + Paid storage size diff: 136 bytes + Consumed gas: 2599.209 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.034 + storage fees ........................... +ꜩ0.034 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as compare_big_type2. +Injected block at minimal timestamp +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_amount.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_amount.out new file mode 100644 index 000000000000..9bc2fea5e427 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_amount.out @@ -0,0 +1,83 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_transfer_amount + +Node is bootstrapped. +Estimated gas: 1410.017 units (will add 100 for safety) +Estimated storage: 297 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000422 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1511 + Storage limit: 317 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000422 + payload fees(the block proposer) ....... +ꜩ0.000422 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ100 + Script: + { parameter unit ; + storage mutez ; + code { DROP ; AMOUNT ; NIL operation ; PAIR } } + Initial storage: 0 + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 40 bytes + Paid storage size diff: 40 bytes + Consumed gas: 1410.017 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01 + storage fees ........................... +ꜩ0.01 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +New contract [CONTRACT_HASH] originated. +Contract memorized as transfer_amount. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 2109.385 units (will add 100 for safety) +Estimated storage: 4 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000473 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2210 + Storage limit: 24 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000473 + payload fees(the block proposer) ....... +ꜩ0.000473 + Transaction: + Amount: ꜩ500 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: 500000000 + Storage size: 44 bytes + Paid storage size diff: 4 bytes + Consumed gas: 2109.385 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.001 + storage fees ........................... +ꜩ0.001 + [CONTRACT_HASH] ... -ꜩ500 + [CONTRACT_HASH] ... +ꜩ500 + +Injected block at minimal timestamp +500000000 diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out new file mode 100644 index 000000000000..e55c0615f1e2 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_onchain_opcodes.TestContractOnchainOpcodes::test_transfer_tokens.out @@ -0,0 +1,238 @@ +tests_016/test_contract_onchain_opcodes.py::TestContractOnchainOpcodes::test_transfer_tokens + +Node is bootstrapped. +Estimated gas: 1409.025 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000419 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1510 + Storage limit: 315 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000419 + payload fees(the block proposer) ....... +ꜩ0.000419 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ100 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1409.025 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +New contract [CONTRACT_HASH] originated. +Contract memorized as test_transfer_account1. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 1409.025 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000419 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1510 + Storage limit: 315 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000419 + payload fees(the block proposer) ....... +ꜩ0.000419 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ20 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1409.025 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ20 + [CONTRACT_HASH] ... +ꜩ20 + +New contract [CONTRACT_HASH] originated. +Contract memorized as test_transfer_account2. +Injected block at minimal timestamp +Node is bootstrapped. +Estimated gas: 1419.177 units (will add 100 for safety) +Estimated storage: 323 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000449 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1520 + Storage limit: 343 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000449 + payload fees(the block proposer) ....... +ꜩ0.000449 + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1000 + Script: + { parameter (contract unit) ; + storage unit ; + code { CAR ; + DIP { UNIT } ; + PUSH mutez 100000000 ; + UNIT ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 66 bytes + Paid storage size diff: 66 bytes + Consumed gas: 1419.177 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1000 + [CONTRACT_HASH] ... +ꜩ1000 + +New contract [CONTRACT_HASH] originated. +Contract memorized as transfer_tokens. +Injected block at minimal timestamp +100 ꜩ +[CONTRACT_HASH] + +Node is bootstrapped. +Estimated gas: 4679.592 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000775 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 4780 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000775 + payload fees(the block proposer) ....... +ꜩ0.000775 + Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 66 bytes + Consumed gas: 2571.151 + Balance updates: + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + Internal operations: + Internal Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 38 bytes + Consumed gas: 2108.441 + Balance updates: + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +Injected block at minimal timestamp +200 ꜩ +[CONTRACT_HASH] + +Node is bootstrapped. +Estimated gas: 3768.025 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000684 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3869 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000684 + payload fees(the block proposer) ....... +ꜩ0.000684 + Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 66 bytes + Consumed gas: 1659.584 + Balance updates: + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + Internal operations: + Internal Transaction: + Amount: ꜩ100 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 38 bytes + Consumed gas: 2108.441 + Balance updates: + [CONTRACT_HASH] ... -ꜩ100 + [CONTRACT_HASH] ... +ꜩ100 + +Injected block at minimal timestamp +120 ꜩ diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.f6092ac5d6.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.f6092ac5d6.out" new file mode 100644 index 000000000000..18a768a769b3 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.f6092ac5d6.out" @@ -0,0 +1,35 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-"hello"-(Pair None 4)-big_map_diff10] + +storage + (Pair None 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["hello"] to 4 +trace + - location: 13 (just consumed gas: 8.579) + [ (Pair "hello" (Some 4) {}) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair (Some 4) {}) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 4) {}) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 4) + {} ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + (Some 4) + {} ] + - location: 17 (just consumed gas: 0.787) + [ None + { Elt "hello" 4 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" 4 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None { Elt "hello" 4 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None { Elt "hello" 4 }) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0427752f13.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0427752f13.out" new file mode 100644 index 000000000000..31a68d6e366b --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0427752f13.out" @@ -0,0 +1,35 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt "hello" 4 })-"hello"-(Pair (Some 4) 4)-big_map_diff12] + +storage + (Pair (Some 4) 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["hello"] to 5 +trace + - location: 13 (just consumed gas: 9.609) + [ (Pair "hello" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.792) + [ (Some 4) + { Elt "hello" 5 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 4) { Elt "hello" 5 }) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0793dc66d5.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0793dc66d5.out" new file mode 100644 index 000000000000..008eea6babd2 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.0793dc66d5.out" @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt "hello" 4 })-"hi"-(Pair None 4)-big_map_diff13] + +storage + (Pair None 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["hello"] to 4 + Set map(4)["hi"] to 5 +trace + - location: 13 (just consumed gas: 9.579) + [ (Pair "hi" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hi" + (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hi" + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.759) + [ None + { Elt "hello" 4 ; Elt "hi" 5 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None { Elt "hello" 4 ; Elt "hi" 5 }) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .df114499b8.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .df114499b8.out" new file mode 100644 index 000000000000..187b1b73ff74 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .df114499b8.out" @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "1" 1 ; Elt "2" 2 })-"1"-(Pair (Some 1) 4)-big_map_diff14] + +storage + (Pair (Some 1) 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["2"] to 2 + Unset map(4)["1"] +trace + - location: 13 (just consumed gas: 10.367) + [ (Pair "1" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (just consumed gas: 0.010) + [ "1" + (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (just consumed gas: 0.025) + [ "1" + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (just consumed gas: 0.751) + [ (Some 1) + { Elt "2" 2 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 1) { Elt "2" 2 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 1) { Elt "2" 2 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .f9bea98de9.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .f9bea98de9.out" new file mode 100644 index 000000000000..b4ccb70ad54e --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .f9bea98de9.out" @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "1" 1 ; Elt "2" 2 })-"1"-(Pair (Some 1) 4)-big_map_diff15] + +storage + (Pair (Some 1) 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["2"] to 2 + Unset map(4)["1"] +trace + - location: 13 (just consumed gas: 10.367) + [ (Pair "1" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (just consumed gas: 0.010) + [ "1" + (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (just consumed gas: 0.025) + [ "1" + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (just consumed gas: 0.751) + [ (Some 1) + { Elt "2" 2 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 1) { Elt "2" 2 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 1) { Elt "2" 2 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.1db12cd837.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.1db12cd837.out" new file mode 100644 index 000000000000..bcc3b52f7e9c --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.1db12cd837.out" @@ -0,0 +1,35 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "hello" 4 })-"hello"-(Pair (Some 4) 4)-big_map_diff11] + +storage + (Pair (Some 4) 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Unset map(4)["hello"] +trace + - location: 13 (just consumed gas: 9.509) + [ (Pair "hello" None { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair None { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + None + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.792) + [ (Some 4) + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 4) {}) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 4) {}) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 4) {}) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.6fc7d0acf2.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.6fc7d0acf2.out" new file mode 100644 index 000000000000..495cedf22a6a --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.6fc7d0acf2.out" @@ -0,0 +1,35 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-"hello"-(Pair None 4)-big_map_diff9] + +storage + (Pair None 4) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Unset map(4)["hello"] +trace + - location: 13 (just consumed gas: 8.479) + [ (Pair "hello" None {}) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair None {}) ] + - location: 14 (just consumed gas: 0) + [ (Pair None {}) ] + - location: 16 (just consumed gas: 0.010) + [ None + {} ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + None + {} ] + - location: 17 (just consumed gas: 0.787) + [ None + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None {}) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None {}) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None {}) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.524c5459f8.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.524c5459f8.out" new file mode 100644 index 000000000000..99512e2efd4d --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.524c5459f8.out" @@ -0,0 +1,46 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } None)-"1"-(Pair 4 (Some "one"))-big_map_diff2] + +storage + (Pair 4 (Some "one")) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Set map(4)["1"] to "one" +trace + - location: 12 (just consumed gas: 13.526) + [ (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) + (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 13 (just consumed gas: 0.010) + [ "1" + (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 14 (just consumed gas: 0.025) + [ "1" + { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 20 (just consumed gas: 0.712) + [ (Some "one") + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 21 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + (Some "one") ] + - location: 22 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".33eba403e7.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".33eba403e7.out" new file mode 100644 index 000000000000..f7cc7c1a6d54 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".33eba403e7.out" @@ -0,0 +1,45 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "hello" "hi" } None)-""-(Pair 4 None)-big_map_diff1] + +storage + (Pair 4 None) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["hello"] to "hi" +trace + - location: 12 (just consumed gas: 12.564) + [ (Pair "" { Elt "hello" "hi" } None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "" { Elt "hello" "hi" } None) + (Pair "" { Elt "hello" "hi" } None) ] + - location: 13 (just consumed gas: 0.010) + [ "" + (Pair "" { Elt "hello" "hi" } None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "" { Elt "hello" "hi" } None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair { Elt "hello" "hi" } None) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (just consumed gas: 0.025) + [ "" + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (just consumed gas: 0.700) + [ None + { Elt "hello" "hi" } ] + - location: 21 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + None ] + - location: 22 (just consumed gas: 0.010) + [ (Pair { Elt "hello" "hi" } None) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Pair { Elt "hello" "hi" } None) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} { Elt "hello" "hi" } None) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.a5cd1005c9.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.a5cd1005c9.out" new file mode 100644 index 000000000000..5c3e27440436 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.a5cd1005c9.out" @@ -0,0 +1,45 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "hello" "hi" } None)-"hello"-(Pair 4 (Some "hi"))-big_map_diff0] + +storage + (Pair 4 (Some "hi")) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["hello"] to "hi" +trace + - location: 12 (just consumed gas: 12.614) + [ (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "hello" { Elt "hello" "hi" } None) + (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair { Elt "hello" "hi" } None) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (just consumed gas: 0.756) + [ (Some "hi") + { Elt "hello" "hi" } ] + - location: 21 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + (Some "hi") ] + - location: 22 (just consumed gas: 0.010) + [ (Pair { Elt "hello" "hi" } (Some "hi")) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Pair { Elt "hello" "hi" } (Some "hi")) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} { Elt "hello" "hi" } (Some "hi")) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .6f3d35b151.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .6f3d35b151.out" new file mode 100644 index 000000000000..a27f5211b4df --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .6f3d35b151.out" @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{}-(Pair 4 Unit)-big_map_diff3] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Set map(4)["1"] to "one" +trace + - location: 15 (just consumed gas: 12.065) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ {} + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .76aeaa0706.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .76aeaa0706.out" new file mode 100644 index 000000000000..11aa0e229585 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .76aeaa0706.out" @@ -0,0 +1,48 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "1" (Some "two") }-(Pair 4 Unit)-big_map_diff4] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Set map(4)["1"] to "two" +trace + - location: 15 (just consumed gas: 12.515) + [ (Pair { Elt "1" (Some "two") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "1" (Some "two") } + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ { Elt "1" (Some "two") } + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ (Pair "1" (Some "two")) + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (just consumed gas: 0.010) + [ "1" + (Some "two") + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (just consumed gas: 0.727) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0.015) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7e7197f248.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7e7197f248.out" new file mode 100644 index 000000000000..ec34e73ed271 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7e7197f248.out" @@ -0,0 +1,48 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "1" (Some "two") }-(Pair 4 Unit)-big_map_diff8] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Set map(4)["1"] to "two" +trace + - location: 15 (just consumed gas: 12.515) + [ (Pair { Elt "1" (Some "two") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "1" (Some "two") } + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ { Elt "1" (Some "two") } + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ (Pair "1" (Some "two")) + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (just consumed gas: 0.010) + [ "1" + (Some "two") + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (just consumed gas: 0.727) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0.015) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7ef2c415a7.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7ef2c415a7.out" new file mode 100644 index 000000000000..7a510a2d647a --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .7ef2c415a7.out" @@ -0,0 +1,49 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "3" (Some "three") }-(Pair 4 Unit)-big_map_diff5] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Set map(4)["3"] to "three" + Set map(4)["1"] to "one" +trace + - location: 15 (just consumed gas: 12.535) + [ (Pair { Elt "3" (Some "three") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "3" (Some "three") } + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ { Elt "3" (Some "three") } + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ (Pair "3" (Some "three")) + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (just consumed gas: 0.010) + [ "3" + (Some "three") + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (just consumed gas: 0.727) + [ { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } + Unit ] + - location: 19 (just consumed gas: 0.015) + [ { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .b688cc94a7.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .b688cc94a7.out" new file mode 100644 index 000000000000..70ed586cdfcf --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .b688cc94a7.out" @@ -0,0 +1,49 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "3" None }-(Pair 4 Unit)-big_map_diff6] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" + Unset map(4)["3"] + Set map(4)["1"] to "one" +trace + - location: 15 (just consumed gas: 12.371) + [ (Pair { Elt "3" None } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "3" None } + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ { Elt "3" None } + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ (Pair "3" None) + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (just consumed gas: 0.010) + [ "3" + None + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (just consumed gas: 0.727) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0.015) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c68db221ed.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c68db221ed.out" new file mode 100644 index 000000000000..fd33cffea9e4 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c68db221ed.out" @@ -0,0 +1,48 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "2" None }-(Pair 4 Unit)-big_map_diff7] + +storage + (Pair 4 Unit) +emitted operations + +big_map diff + New map(4) of type (big_map string string) + Unset map(4)["2"] + Set map(4)["1"] to "one" +trace + - location: 15 (just consumed gas: 12.371) + [ (Pair { Elt "2" None } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "2" None } + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 16 (just consumed gas: 0) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (just consumed gas: 0.025) + [ { Elt "2" None } + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (just consumed gas: 0) + [ (Pair "2" None) + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (just consumed gas: 0.010) + [ "2" + None + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (just consumed gas: 0.727) + [ { Elt "1" "one" } + Unit ] + - location: 19 (just consumed gas: 0.015) + [ { Elt "1" "one" } + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" } Unit) ] + - location: 24 (just consumed gas: 0.010) + [ {} + (Pair { Elt "1" "one" } Unit) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} { Elt "1" "one" } Unit) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Left Unit].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Left Unit].out new file mode 100644 index 000000000000..4bcfb4ec6511 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Left Unit].out @@ -0,0 +1,40 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Left Unit] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or unit unit) ; + 02: storage unit ; + 03: code { CAR ; + 04: IF_LEFT + 05: { + 06: PUSH nat 922337203685477580700 ; + 07: PUSH mutez 10 ; + 08: MUL ; # FAILURE + 09: DROP + 10: } + 11: { + 12: PUSH mutez 10 ; + 13: PUSH nat 922337203685477580700 ; + 14: MUL ; # FAILURE + 15: DROP + 16: } ; + 17: + 18: NIL operation ; PAIR } + 19: +At line 8 characters 11 to 14, +unexpected arithmetic overflow +trace + - location: 9 (just consumed gas: 11.246) + [ (Pair (Left Unit) Unit) ] + - location: 9 (just consumed gas: 0.010) + [ (Left Unit) ] + - location: 10 (just consumed gas: 0) + [ Unit ] + - location: 12 (just consumed gas: 0.010) + [ 922337203685477580700 + Unit ] + - location: 15 (just consumed gas: 0.010) + [ 10 + 922337203685477580700 + Unit ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Right Unit].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Right Unit].out new file mode 100644 index 000000000000..ef11c86c8a7a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Right Unit].out @@ -0,0 +1,40 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[mul_overflow.tz-Unit-Right Unit] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or unit unit) ; + 02: storage unit ; + 03: code { CAR ; + 04: IF_LEFT + 05: { + 06: PUSH nat 922337203685477580700 ; + 07: PUSH mutez 10 ; + 08: MUL ; # FAILURE + 09: DROP + 10: } + 11: { + 12: PUSH mutez 10 ; + 13: PUSH nat 922337203685477580700 ; + 14: MUL ; # FAILURE + 15: DROP + 16: } ; + 17: + 18: NIL operation ; PAIR } + 19: +At line 14 characters 11 to 14, +unexpected arithmetic overflow +trace + - location: 9 (just consumed gas: 11.246) + [ (Pair (Right Unit) Unit) ] + - location: 9 (just consumed gas: 0.010) + [ (Right Unit) ] + - location: 10 (just consumed gas: 0) + [ Unit ] + - location: 21 (just consumed gas: 0.010) + [ 10 + Unit ] + - location: 24 (just consumed gas: 0.010) + [ 922337203685477580700 + 10 + Unit ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 1 257))].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 1 257))].out new file mode 100644 index 000000000000..fbcc4f778f42 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 1 257))].out @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 1 257))] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or (pair nat nat) (pair nat nat)); + 02: storage (option nat); + 03: # this contract takes either (Left a b) and stores (a << b) + 04: # or (Right a b) and stores (a >> b). + 05: # i.e., in the first case, the first component shifted to the left by + 06: # the second, and the second case, component shifted to the right by + 07: # the second. + 08: code { CAR; + 09: IF_LEFT { + 10: UNPAIR; LSL; + 11: } + 12: { + 13: UNPAIR; LSR; + 14: }; + 15: SOME; + 16: NIL operation; + 17: PAIR; + 18: }; + 19: +At line 10 characters 25 to 28, +unexpected arithmetic overflow +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 1 257)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 1 257)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 1 257) ] + - location: 17 (just consumed gas: 0.010) + [ 1 + 257 ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 123 257))].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 123 257))].out new file mode 100644 index 000000000000..fa15b80a7252 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 123 257))].out @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Left (Pair 123 257))] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or (pair nat nat) (pair nat nat)); + 02: storage (option nat); + 03: # this contract takes either (Left a b) and stores (a << b) + 04: # or (Right a b) and stores (a >> b). + 05: # i.e., in the first case, the first component shifted to the left by + 06: # the second, and the second case, component shifted to the right by + 07: # the second. + 08: code { CAR; + 09: IF_LEFT { + 10: UNPAIR; LSL; + 11: } + 12: { + 13: UNPAIR; LSR; + 14: }; + 15: SOME; + 16: NIL operation; + 17: PAIR; + 18: }; + 19: +At line 10 characters 25 to 28, +unexpected arithmetic overflow +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 123 257)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 123 257)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 123 257) ] + - location: 17 (just consumed gas: 0.010) + [ 123 + 257 ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 1 257))].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 1 257))].out new file mode 100644 index 000000000000..33b6d53b0a36 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 1 257))].out @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 1 257))] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or (pair nat nat) (pair nat nat)); + 02: storage (option nat); + 03: # this contract takes either (Left a b) and stores (a << b) + 04: # or (Right a b) and stores (a >> b). + 05: # i.e., in the first case, the first component shifted to the left by + 06: # the second, and the second case, component shifted to the right by + 07: # the second. + 08: code { CAR; + 09: IF_LEFT { + 10: UNPAIR; LSL; + 11: } + 12: { + 13: UNPAIR; LSR; + 14: }; + 15: SOME; + 16: NIL operation; + 17: PAIR; + 18: }; + 19: +At line 13 characters 25 to 28, +unexpected arithmetic overflow +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 1 257)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 1 257)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 1 257) ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 257 ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 123 257))].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 123 257))].out new file mode 100644 index 000000000000..87730fce051d --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 123 257))].out @@ -0,0 +1,36 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_arithmetic_overflow[shifts.tz-None-(Right (Pair 123 257))] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter (or (pair nat nat) (pair nat nat)); + 02: storage (option nat); + 03: # this contract takes either (Left a b) and stores (a << b) + 04: # or (Right a b) and stores (a >> b). + 05: # i.e., in the first case, the first component shifted to the left by + 06: # the second, and the second case, component shifted to the right by + 07: # the second. + 08: code { CAR; + 09: IF_LEFT { + 10: UNPAIR; LSL; + 11: } + 12: { + 13: UNPAIR; LSR; + 14: }; + 15: SOME; + 16: NIL operation; + 17: PAIR; + 18: }; + 19: +At line 13 characters 25 to 28, +unexpected arithmetic overflow +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 123 257)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 123 257)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 123 257) ] + - location: 20 (just consumed gas: 0.010) + [ 123 + 257 ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0.5].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0.5].out new file mode 100644 index 000000000000..ab078df47393 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0.5].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[0.5] + +storage + 500000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 500000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 500000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 500000) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0].out new file mode 100644 index 000000000000..47e83d96cda4 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[0].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[0] + +storage + 0 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1000].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1000].out new file mode 100644 index 000000000000..28ccf08c334b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1000].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[1000] + +storage + 1000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 1000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 1000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 1000000000) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1].out new file mode 100644 index 000000000000..bc4485378ead --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[1] + +storage + 1000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 1000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 1000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 1000000) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1e-06].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1e-06].out new file mode 100644 index 000000000000..13e024d18e76 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[1e-06].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[1e-06] + +storage + 1 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 1 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[5].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[5].out new file mode 100644 index 000000000000..4624054012dd --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[5].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[5] + +storage + 5000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 5000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 5000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 5000000) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[8000000000000.0].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[8000000000000.0].out new file mode 100644 index 000000000000..7d3d8842ecf4 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_balance[8000000000000.0].out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_balance[8000000000000.0] + +storage + 8000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 0) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 8000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 8000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 8000000000000000000) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.7492e8cdea.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.7492e8cdea.out" new file mode 100644 index 000000000000..173c87f37056 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.7492e8cdea.out" @@ -0,0 +1,90 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }) )-(Right (Right (Right (Left { Pair "3" "three" }))))-(Left (Pair 4 5))-big_map_diff4] + +storage + (Left (Pair 4 5)) +emitted operations + +big_map diff + New map(5) of type (big_map string string) + Set map(5)["2"] to "two" + New map(4) of type (big_map string string) + Set map(4)["3"] to "three" + Set map(4)["1"] to "one" +trace + - location: 43 (just consumed gas: 63.036) + [ (Pair (Right (Right (Right (Left { Pair "3" "three" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (just consumed gas: 0.010) + [ (Right (Right (Right (Left { Pair "3" "three" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0) + [ (Right (Right (Left { Pair "3" "three" }))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0) + [ (Right (Left { Pair "3" "three" })) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 65 (just consumed gas: 0) + [ (Left { Pair "3" "three" }) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 108 (just consumed gas: 0) + [ { Pair "3" "three" } + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 110 (just consumed gas: 0) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 113 (just consumed gas: 0) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 113 (just consumed gas: 0.015) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 119 (just consumed gas: 0.010) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 110 (just consumed gas: 0.025) + [ { Pair "3" "three" } + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 120 (just consumed gas: 0) + [ (Pair "3" "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 122 (just consumed gas: 0.010) + [ "3" + "three" + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 123 (just consumed gas: 0) + [ "three" + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 125 (just consumed gas: 0.010) + [ (Some "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 123 (just consumed gas: 0.025) + [ "3" + (Some "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 126 (just consumed gas: 0.724) + [ { Elt "1" "one" ; Elt "3" "three" } + { Elt "2" "two" } ] + - location: 120 (just consumed gas: 0.015) + [ { Elt "1" "one" ; Elt "3" "three" } + { Elt "2" "two" } ] + - location: 127 (just consumed gas: 0.010) + [ (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" }) ] + - location: 128 (just consumed gas: 0.010) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 108 (just consumed gas: 0.015) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 65 (just consumed gas: 0.015) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0.015) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0.015) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" }))) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.21b30dd90f.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.21b30dd90f.out" new file mode 100644 index 000000000000..9af5d92583ef --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.21b30dd90f.out" @@ -0,0 +1,44 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Left Unit)-(Left (Pair 4 5))-big_map_diff0] + +storage + (Left (Pair 4 5)) +emitted operations + +big_map diff + New map(5) of type (big_map string string) + Set map(5)["1"] to "one" + New map(4) of type (big_map string string) + Set map(4)["2"] to "two" +trace + - location: 43 (just consumed gas: 62.128) + [ (Pair (Left Unit) (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (just consumed gas: 0.010) + [ (Left Unit) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0) + [ Unit + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 46 (just consumed gas: 0.010) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 48 (just consumed gas: 0) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 48 (just consumed gas: 0.015) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 54 (just consumed gas: 0.010) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 55 (just consumed gas: 0.010) + [ { Elt "2" "two" } + { Elt "1" "one" } ] + - location: 56 (just consumed gas: 0.010) + [ (Pair { Elt "2" "two" } { Elt "1" "one" }) ] + - location: 57 (just consumed gas: 0.010) + [ (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: 44 (just consumed gas: 0.015) + [ (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Left (Pair { Elt "2" "two" } { Elt "1" "one" }))) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .2873ef610c.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .2873ef610c.out" new file mode 100644 index 000000000000..696087d0139a --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .2873ef610c.out" @@ -0,0 +1,39 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))))-(Left (Pair 4 5))-big_map_diff1] + +storage + (Left (Pair 4 5)) +emitted operations + +big_map diff + New map(5) of type (big_map string string) + Set map(5)["4"] to "four" + New map(4) of type (big_map string string) + Set map(4)["3"] to "three" +trace + - location: 43 (just consumed gas: 65.416) + [ (Pair (Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (just consumed gas: 0.010) + [ (Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0) + [ (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 62 (just consumed gas: 0.010) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) + (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 63 (just consumed gas: 0.010) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 60 (just consumed gas: 0.015) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 44 (just consumed gas: 0.015) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .8a6f480005.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .8a6f480005.out" new file mode 100644 index 000000000000..981f5368af84 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .8a6f480005.out" @@ -0,0 +1,35 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Right (Left (Right Unit)))-(Right Unit)-big_map_diff2] + +storage + (Right Unit) +emitted operations + +big_map diff + +trace + - location: 43 (just consumed gas: 62.768) + [ (Pair (Right (Left (Right Unit))) (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (just consumed gas: 0.010) + [ (Right (Left (Right Unit))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0) + [ (Left (Right Unit)) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0) + [ (Right Unit) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 62 (just consumed gas: 0.010) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) + (Right Unit) ] + - location: 63 (just consumed gas: 0.010) + [ (Right Unit) ] + - location: 60 (just consumed gas: 0.015) + [ (Right Unit) ] + - location: 44 (just consumed gas: 0.015) + [ (Right Unit) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Right Unit) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Right Unit)) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.d336ca1903.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.d336ca1903.out" new file mode 100644 index 000000000000..9c6394398ee9 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.d336ca1903.out" @@ -0,0 +1,83 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Right (Right (Right (Right { "1" }))))-(Left (Pair 4 5))-big_map_diff5] + +storage + (Left (Pair 4 5)) +emitted operations + +big_map diff + New map(5) of type (big_map string string) + Set map(5)["2"] to "two" + New map(4) of type (big_map string string) + Unset map(4)["1"] +trace + - location: 43 (just consumed gas: 62.772) + [ (Pair (Right (Right (Right (Right { "1" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (just consumed gas: 0.010) + [ (Right (Right (Right (Right { "1" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0) + [ (Right (Right (Right { "1" }))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0) + [ (Right (Right { "1" })) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 65 (just consumed gas: 0) + [ (Right { "1" }) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 108 (just consumed gas: 0) + [ { "1" } + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 131 (just consumed gas: 0) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) ] + - location: 134 (just consumed gas: 0) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 134 (just consumed gas: 0.015) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) ] + - location: 140 (just consumed gas: 0.010) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 131 (just consumed gas: 0.025) + [ { "1" } + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 141 (just consumed gas: 0) + [ "1" + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 143 (just consumed gas: 0) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 145 (just consumed gas: 0.010) + [ None + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 143 (just consumed gas: 0.025) + [ "1" + None + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 147 (just consumed gas: 0.724) + [ {} + { Elt "2" "two" } ] + - location: 141 (just consumed gas: 0.015) + [ {} + { Elt "2" "two" } ] + - location: 148 (just consumed gas: 0.010) + [ (Pair {} { Elt "2" "two" }) ] + - location: 149 (just consumed gas: 0.010) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 108 (just consumed gas: 0.015) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 65 (just consumed gas: 0.015) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 60 (just consumed gas: 0.015) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 44 (just consumed gas: 0.015) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Left (Pair {} { Elt "2" "two" })) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Left (Pair {} { Elt "2" "two" }))) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.7f2ee47600.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.7f2ee47600.out" new file mode 100644 index 000000000000..f088fc076989 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.7f2ee47600.out" @@ -0,0 +1,135 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }) )))-(Left (Pair 4 5))-big_map_diff3] + +storage + (Left (Pair 4 5)) +emitted operations + +big_map diff + New map(5) of type (big_map string string) + Set map(5)["gaz"] to "baz" + New map(4) of type (big_map string string) + Set map(4)["foo"] to "bar" +trace + - location: 43 (just consumed gas: 60.906) + [ (Pair (Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" })))) (Right Unit)) ] + - location: 43 (just consumed gas: 0.010) + [ (Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" })))) + (Right Unit) ] + - location: 44 (just consumed gas: 0) + [ (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }))) + (Right Unit) ] + - location: 60 (just consumed gas: 0) + [ (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" })) + (Right Unit) ] + - location: 65 (just consumed gas: 0) + [ (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }) + (Right Unit) ] + - location: 67 (just consumed gas: 0) + [ (Right Unit) ] + - location: 70 (just consumed gas: 0) + [ Unit ] + - location: 70 (just consumed gas: 0.015) + [ Unit ] + - location: 76 (just consumed gas: 0.010) + [ ] + - location: 67 (just consumed gas: 0.025) + [ (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }) ] + - location: 77 (just consumed gas: 0.010) + [ { Pair "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 78 (just consumed gas: 0) + [ { Pair "gaz" "baz" } ] + - location: 80 (just consumed gas: 0.300) + [ {} + { Pair "gaz" "baz" } ] + - location: 78 (just consumed gas: 0.025) + [ { Pair "foo" "bar" } + {} + { Pair "gaz" "baz" } ] + - location: 83 (just consumed gas: 0) + [ (Pair "foo" "bar") + {} + { Pair "gaz" "baz" } ] + - location: 85 (just consumed gas: 0.010) + [ "foo" + "bar" + {} + { Pair "gaz" "baz" } ] + - location: 86 (just consumed gas: 0) + [ "bar" + {} + { Pair "gaz" "baz" } ] + - location: 88 (just consumed gas: 0.010) + [ (Some "bar") + {} + { Pair "gaz" "baz" } ] + - location: 86 (just consumed gas: 0.025) + [ "foo" + (Some "bar") + {} + { Pair "gaz" "baz" } ] + - location: 89 (just consumed gas: 0.744) + [ { Elt "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 83 (just consumed gas: 0.015) + [ { Elt "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 90 (just consumed gas: 0.010) + [ { Pair "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 91 (just consumed gas: 0) + [ { Elt "foo" "bar" } ] + - location: 93 (just consumed gas: 0.300) + [ {} + { Elt "foo" "bar" } ] + - location: 91 (just consumed gas: 0.025) + [ { Pair "gaz" "baz" } + {} + { Elt "foo" "bar" } ] + - location: 96 (just consumed gas: 0) + [ (Pair "gaz" "baz") + {} + { Elt "foo" "bar" } ] + - location: 98 (just consumed gas: 0.010) + [ "gaz" + "baz" + {} + { Elt "foo" "bar" } ] + - location: 99 (just consumed gas: 0) + [ "baz" + {} + { Elt "foo" "bar" } ] + - location: 101 (just consumed gas: 0.010) + [ (Some "baz") + {} + { Elt "foo" "bar" } ] + - location: 99 (just consumed gas: 0.025) + [ "gaz" + (Some "baz") + {} + { Elt "foo" "bar" } ] + - location: 102 (just consumed gas: 0.744) + [ { Elt "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 96 (just consumed gas: 0.015) + [ { Elt "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 103 (just consumed gas: 0.010) + [ { Elt "foo" "bar" } + { Elt "gaz" "baz" } ] + - location: 104 (just consumed gas: 0.010) + [ (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" }) ] + - location: 105 (just consumed gas: 0.010) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 65 (just consumed gas: 0.015) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 60 (just consumed gas: 0.015) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 44 (just consumed gas: 0.015) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 151 (just consumed gas: 0.010) + [ {} + (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 153 (just consumed gas: 0.010) + [ (Pair {} (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" }))) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_check_signature.out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_check_signature.out new file mode 100644 index 000000000000..9a6207b797d5 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_check_signature.out @@ -0,0 +1,241 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_check_signature + +storage + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 346.280) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 11 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 14 (just consumed gas: 0.010) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 15 (just consumed gas: 0.010) + [ "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 16 (just consumed gas: 0) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 18 (just consumed gas: 0.010) + [ "hello" + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 19 (just consumed gas: 0.266) + [ 0x05010000000568656c6c6f + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 16 (just consumed gas: 0.025) + [ "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000568656c6c6f + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000568656c6c6f + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 20 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000568656c6c6f + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 21 (just consumed gas: 65.812) + [ True + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 22 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 22 (just consumed gas: 0.015) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 28 (just consumed gas: 0.010) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "hello") ] + +Runtime error in contract [CONTRACT_HASH]: + 01: parameter key; + 02: storage (pair signature string); + 03: code { + 04: DUP; DUP; + 05: DIP{ CDR; DUP; CAR; + 06: DIP{CDR; PACK}}; + 07: CAR; CHECK_SIGNATURE; + 08: IF {} {FAIL} ; + 09: CDR; NIL operation ; PAIR}; + 10: + 11: +At line 8 characters 14 to 18, +script reached FAILWITH instruction +with Unit +trace + - location: 9 (just consumed gas: 346.270) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 11 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 14 (just consumed gas: 0.010) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 15 (just consumed gas: 0.010) + [ "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 16 (just consumed gas: 0) + [ (Pair "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 18 (just consumed gas: 0.010) + [ "abcd" + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 19 (just consumed gas: 0.256) + [ 0x05010000000461626364 + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 16 (just consumed gas: 0.025) + [ "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000461626364 + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000461626364 + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 20 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + 0x05010000000461626364 + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 21 (just consumed gas: 65.811) + [ False + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 22 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] + - location: 26 (just consumed gas: 0.010) + [ Unit + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF" + "abcd") ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_hash_consistency_michelson_cli.out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_hash_consistency_michelson_cli.out new file mode 100644 index 000000000000..474530acdf2a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_hash_consistency_michelson_cli.out @@ -0,0 +1,51 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_hash_consistency_michelson_cli + +Raw packed data: 0x0507070080acd2c6a501070700bcc485a30b0022 +Script-expression-ID-Hash: expruenXhGp5JQoHJTGv4DzBR8Zm3HGvea8Q8BaMPywsY2bxrHAEgC +Raw Script-expression-ID-Hash: 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc +Ledger Blake2b hash: B5B7PuGGVUrdHUW9Df8wPNJQRuUmx56aH1XVpvbUZvW7 +Raw Sha256 hash: 0x538634a0f81b55f1c946c1207a25c262479566d20bd3d5cd2cdbb2940fc45774 +Raw Sha512 hash: 0x49d5c19c2da4ee74f85225c95625a4b77b94724f4285b436b9d4be27d40491354bdc8e9d8a3d9b2857e5fb59b172605edd02fc4b61ce3cd3f84aa11ed1731ff6 +Gas remaining: 1039997.762 units remaining +storage + 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 6.144) + [ (Pair (Pair 22220000000 "2017-12-13T04:49:00Z" 34) 0x00) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 22220000000 "2017-12-13T04:49:00Z" 34) ] + - location: 12 (just consumed gas: 1.330) + [ 0x0507070080acd2c6a501070700bcc485a30b0022 ] + - location: 13 (just consumed gas: 0.452) + [ 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc ] + - location: 14 (just consumed gas: 0.010) + [ {} + 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc) ] + +storage + 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 6.144) + [ (Pair (Pair 22220000000 "2017-12-13T04:49:00Z" 34) 0x00) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 22220000000 "2017-12-13T04:49:00Z" 34) ] + - location: 12 (just consumed gas: 1.330) + [ 0x0507070080acd2c6a501070700bcc485a30b0022 ] + - location: 13 (just consumed gas: 0.452) + [ 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc ] + - location: 14 (just consumed gas: 0.010) + [ {} + 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} 0x95a69fcbbf773989333dc9b31e246575812dbea19d25089f83a2aeeea16ab4bc) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_level.out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_level.out new file mode 100644 index 000000000000..4e0170f89878 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_level.out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_level + +storage + 10 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 9999999) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 10 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 10 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 10) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"bar\" 5 ; Elt \"foo\" 1 } .480b9afc63.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"bar\" 5 ; Elt \"foo\" 1 } .480b9afc63.out" new file mode 100644 index 000000000000..702dc0897247 --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"bar\" 5 ; Elt \"foo\" 1 } .480b9afc63.out" @@ -0,0 +1,155 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt "bar" 5 ; Elt "foo" 1 } 6)-15-(Pair { Elt "bar" 20 ; Elt "foo" 16 } 36)] + +storage + (Pair { Elt "bar" 20 ; Elt "foo" 16 } 36) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 17.272) + [ (Pair 15 { Elt "bar" 5 ; Elt "foo" 1 } 6) ] + - location: 11 (just consumed gas: 0.010) + [ 15 + (Pair { Elt "bar" 5 ; Elt "foo" 1 } 6) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 5 ; Elt "foo" 1 } 6) + 15 ] + - location: 13 (just consumed gas: 0.010) + [ { Elt "bar" 5 ; Elt "foo" 1 } + 15 ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 17 (just consumed gas: 0.010) + [ 0 ] + - location: 14 (just consumed gas: 0.025) + [ 15 + 0 ] + - location: 14 (just consumed gas: 0.010) + [ { Elt "bar" 5 ; Elt "foo" 1 } + 15 + 0 ] + - location: 14 (just consumed gas: 0) + [ { Elt "bar" 5 ; Elt "foo" 1 } + 15 + 0 ] + - location: 20 (just consumed gas: 0) + [ (Pair "bar" 5) + 15 + 0 ] + - location: 22 (just consumed gas: 0.010) + [ 5 + 15 + 0 ] + - location: 23 (just consumed gas: 0) + [ 15 + 0 ] + - location: 25 (just consumed gas: 0.010) + [ 15 + 15 + 0 ] + - location: 23 (just consumed gas: 0.025) + [ 5 + 15 + 15 + 0 ] + - location: 26 (just consumed gas: 0.035) + [ 20 + 15 + 0 ] + - location: 27 (just consumed gas: 0.010) + [ 20 + 20 + 15 + 0 ] + - location: 28 (just consumed gas: 0.048) + [ 20 + 15 + 20 + 0 ] + - location: 30 (just consumed gas: 0) + [ 20 + 0 ] + - location: 33 (just consumed gas: 0.035) + [ 20 ] + - location: 30 (just consumed gas: 0.025) + [ 15 + 20 ] + - location: 30 (just consumed gas: 0.010) + [ 20 + 15 + 20 ] + - location: 30 (just consumed gas: 0) + [ 20 + 15 + 20 ] + - location: 20 (just consumed gas: 0.015) + [ (Pair "foo" 1) + 15 + 20 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 15 + 20 ] + - location: 23 (just consumed gas: 0) + [ 15 + 20 ] + - location: 25 (just consumed gas: 0.010) + [ 15 + 15 + 20 ] + - location: 23 (just consumed gas: 0.025) + [ 1 + 15 + 15 + 20 ] + - location: 26 (just consumed gas: 0.035) + [ 16 + 15 + 20 ] + - location: 27 (just consumed gas: 0.010) + [ 16 + 16 + 15 + 20 ] + - location: 28 (just consumed gas: 0.048) + [ 16 + 15 + 16 + 20 ] + - location: 30 (just consumed gas: 0) + [ 16 + 20 ] + - location: 33 (just consumed gas: 0.035) + [ 36 ] + - location: 30 (just consumed gas: 0.025) + [ 15 + 36 ] + - location: 30 (just consumed gas: 0.010) + [ 16 + 15 + 36 ] + - location: 30 (just consumed gas: 0) + [ 16 + 15 + 36 ] + - location: 20 (just consumed gas: 0.015) + [ { Elt "bar" 20 ; Elt "foo" 16 } + 15 + 36 ] + - location: 34 (just consumed gas: 0) + [ 15 + 36 ] + - location: 36 (just consumed gas: 0.010) + [ 36 ] + - location: 34 (just consumed gas: 0.025) + [ { Elt "bar" 20 ; Elt "foo" 16 } + 36 ] + - location: 37 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 20 ; Elt "foo" 16 } 36) ] + - location: 38 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 20 ; Elt "foo" 16 } 36) ] + - location: 40 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 20 ; Elt "foo" 16 } 36) ] + diff --git "a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"foo\" 1 } 1)-10-(Pair { .811573b5a7.out" "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"foo\" 1 } 1)-10-(Pair { .811573b5a7.out" new file mode 100644 index 000000000000..845975a8622d --- /dev/null +++ "b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt \"foo\" 1 } 1)-10-(Pair { .811573b5a7.out" @@ -0,0 +1,105 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair { Elt "foo" 1 } 1)-10-(Pair { Elt "foo" 11 } 11)] + +storage + (Pair { Elt "foo" 11 } 11) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 16.901) + [ (Pair 10 { Elt "foo" 1 } 1) ] + - location: 11 (just consumed gas: 0.010) + [ 10 + (Pair { Elt "foo" 1 } 1) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 1 } 1) + 10 ] + - location: 13 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + 10 ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 17 (just consumed gas: 0.010) + [ 0 ] + - location: 14 (just consumed gas: 0.025) + [ 10 + 0 ] + - location: 14 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + 10 + 0 ] + - location: 14 (just consumed gas: 0) + [ { Elt "foo" 1 } + 10 + 0 ] + - location: 20 (just consumed gas: 0) + [ (Pair "foo" 1) + 10 + 0 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 10 + 0 ] + - location: 23 (just consumed gas: 0) + [ 10 + 0 ] + - location: 25 (just consumed gas: 0.010) + [ 10 + 10 + 0 ] + - location: 23 (just consumed gas: 0.025) + [ 1 + 10 + 10 + 0 ] + - location: 26 (just consumed gas: 0.035) + [ 11 + 10 + 0 ] + - location: 27 (just consumed gas: 0.010) + [ 11 + 11 + 10 + 0 ] + - location: 28 (just consumed gas: 0.048) + [ 11 + 10 + 11 + 0 ] + - location: 30 (just consumed gas: 0) + [ 11 + 0 ] + - location: 33 (just consumed gas: 0.035) + [ 11 ] + - location: 30 (just consumed gas: 0.025) + [ 10 + 11 ] + - location: 30 (just consumed gas: 0.010) + [ 11 + 10 + 11 ] + - location: 30 (just consumed gas: 0) + [ 11 + 10 + 11 ] + - location: 20 (just consumed gas: 0.015) + [ { Elt "foo" 11 } + 10 + 11 ] + - location: 34 (just consumed gas: 0) + [ 10 + 11 ] + - location: 36 (just consumed gas: 0.010) + [ 11 ] + - location: 34 (just consumed gas: 0.025) + [ { Elt "foo" 11 } + 11 ] + - location: 37 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 11 } 11) ] + - location: 38 (just consumed gas: 0.010) + [ {} + (Pair { Elt "foo" 11 } 11) ] + - location: 40 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 11 } 11) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair {} 0)-10-(Pair {} 0)].out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair {} 0)-10-(Pair {} 0)].out new file mode 100644 index 000000000000..c2adda8e8c44 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair {} 0)-10-(Pair {} 0)].out @@ -0,0 +1,55 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_map_map_sideeffect[map_map_sideeffect.tz-(Pair {} 0)-10-(Pair {} 0)] + +storage + (Pair {} 0) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 16.571) + [ (Pair 10 {} 0) ] + - location: 11 (just consumed gas: 0.010) + [ 10 + (Pair {} 0) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0) + 10 ] + - location: 13 (just consumed gas: 0.010) + [ {} + 10 ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 17 (just consumed gas: 0.010) + [ 0 ] + - location: 14 (just consumed gas: 0.025) + [ 10 + 0 ] + - location: 14 (just consumed gas: 0.010) + [ {} + 10 + 0 ] + - location: 14 (just consumed gas: 0) + [ {} + 10 + 0 ] + - location: 20 (just consumed gas: 0) + [ {} + 10 + 0 ] + - location: 34 (just consumed gas: 0) + [ 10 + 0 ] + - location: 36 (just consumed gas: 0.010) + [ 0 ] + - location: 34 (just consumed gas: 0.025) + [ {} + 0 ] + - location: 37 (just consumed gas: 0.010) + [ (Pair {} 0) ] + - location: 38 (just consumed gas: 0.010) + [ {} + (Pair {} 0) ] + - location: 40 (just consumed gas: 0.010) + [ (Pair {} {} 0) ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_now.out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_now.out new file mode 100644 index 000000000000..90aa1731687b --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_now.out @@ -0,0 +1,21 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_now + +storage + "2021-10-13T10:16:52Z" +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.375) + [ (Pair Unit "2017-07-13T09:19:01Z") ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ "2021-10-13T10:16:52Z" ] + - location: 9 (just consumed gas: 0.010) + [ {} + "2021-10-13T10:16:52Z" ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} "2021-10-13T10:16:52Z") ] + diff --git a/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_packunpack.out b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_packunpack.out new file mode 100644 index 000000000000..8ffbe3b5c0ff --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_packunpack.out @@ -0,0 +1,106 @@ +tests_016/test_contract_opcodes.py::TestContractOpcodes::test_packunpack + +storage + Unit +emitted operations + +big_map diff + +trace + - location: 15 (just consumed gas: 19.769) + [ (Pair (Pair (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003) + Unit) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 17 (just consumed gas: 0) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 19 (just consumed gas: 0.010) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 17 (just consumed gas: 0.025) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 20 (just consumed gas: 2.807) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 23 (just consumed gas: 0.035) + [ 0 + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 24 (just consumed gas: 0.010) + [ True + 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 25 (just consumed gas: 0) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 25 (just consumed gas: 0.015) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 ] + - location: 31 (just consumed gas: 2.753) + [ (Some (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 })) ] + - location: 40 (just consumed gas: 0) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) ] + - location: 46 (just consumed gas: 0.010) + [ ] + - location: 47 (just consumed gas: 0.010) + [ Unit ] + - location: 48 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 50 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + +Runtime error in contract [CONTRACT_HASH]: + 1: parameter (pair (pair (pair string (list int)) (set nat)) bytes) ; + 2: storage unit ; + 3: code { CAR ; UNPAIR ; DIP { DUP } ; + 4: PACK ; ASSERT_CMPEQ ; + 5: UNPACK (pair (pair string (list int)) (set nat)) ; ASSERT_SOME ; DROP ; + 6: UNIT ; NIL operation ; PAIR } + 7: +At line 4 characters 14 to 26, +script reached FAILWITH instruction +with Unit +trace + - location: 15 (just consumed gas: 19.769) + [ (Pair (Pair (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004) + Unit) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 17 (just consumed gas: 0) + [ 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 19 (just consumed gas: 0.010) + [ 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 17 (just consumed gas: 0.025) + [ (Pair (Pair "toto" { 3 ; 7 ; 9 ; 1 }) { 1 ; 2 ; 3 }) + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 20 (just consumed gas: 2.807) + [ 0x05070707070100000004746f746f020000000800030007000900010200000006000100020003 + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 23 (just consumed gas: 0.035) + [ -1 + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 24 (just consumed gas: 0.010) + [ False + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 25 (just consumed gas: 0) + [ 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] + - location: 29 (just consumed gas: 0.010) + [ Unit + 0x05070707070100000004746f746f0200000008000300070009000102000000060001000200030004 ] +Fatal error: + error running script diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out new file mode 100644 index 000000000000..49cea3fbb03f --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_add_liquidity.out @@ -0,0 +1,83 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_add_liquidity + +Node is bootstrapped. +Estimated gas: 8555.847 units (will add 100 for safety) +Estimated storage: 147 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.001221 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 8656 + Storage limit: 167 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.001221 + payload fees(the block proposer) ....... +ꜩ0.001221 + Transaction: + Amount: ꜩ9001 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: addLiquidity + Parameter: (Pair "[CONTRACT_HASH]" 0 1000000000 "[TIMESTAMP]") + This transaction was successfully applied + Updated storage: + { 21599 ; + 9001416765 ; + 2159830 ; + 0x01e927f00ef734dfc85919635e9afc9166c83ef9fc00 ; + 0x0115eb0104481a6d7921160bc982c5e0a561cd8a3a00 } + Storage size: 4635 bytes + Paid storage size diff: 6 bytes + Consumed gas: 2278.202 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0015 + storage fees ........................... +ꜩ0.0015 + [CONTRACT_HASH] ... -ꜩ9001 + [CONTRACT_HASH] ... +ꜩ9001 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + (Pair 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 21598)) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 999978402 + Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 99978402 + Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 21598 + Storage size: 2264 bytes + Paid storage size diff: 69 bytes + Consumed gas: 3064.106 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01725 + storage fees ........................... +ꜩ0.01725 + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: mintOrBurn + Parameter: (Pair 2159730 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78) + This transaction was successfully applied + Updated storage: + { 2 ; 3 ; 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 ; 2159830 } + Updated big_maps: + Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 2159730 + Storage size: 2050 bytes + Paid storage size diff: 72 bytes + Consumed gas: 3213.539 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.018 + storage fees ........................... +ꜩ0.018 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out new file mode 100644 index 000000000000..4cdf37ec6ff5 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approval.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_approval + +Node is bootstrapped. +Estimated gas: 1679.581 units (will add 100 for safety) +Estimated storage: 68 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000485 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 88 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000485 + payload fees(the block proposer) ....... +ꜩ0.000485 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000) + This transaction was successfully applied + Updated storage: + { 2 ; 3 ; 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 ; 2159830 } + Updated big_maps: + Set map(3)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c)] to 1000 + Storage size: 2118 bytes + Paid storage size diff: 68 bytes + Consumed gas: 1679.581 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.017 + storage fees ........................... +ꜩ0.017 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out new file mode 100644 index 000000000000..06f438af890e --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_approved_transfer.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_approved_transfer + +Node is bootstrapped. +Estimated gas: 3042.409 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000672 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3143 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000672 + payload fees(the block proposer) ....... +ꜩ0.000672 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair "[CONTRACT_HASH]" + "[CONTRACT_HASH]" + 1000) + This transaction was successfully applied + Updated storage: + { 2 ; 3 ; 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 ; 2159830 } + Updated big_maps: + Unset map(3)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c)] + Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 2158730 + Set map(2)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 1000 + Storage size: 2118 bytes + Consumed gas: 3042.409 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out new file mode 100644 index 000000000000..1a94c369bc2c --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve1.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve1 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2053 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out new file mode 100644 index 000000000000..dc4b29336f41 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve2.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve2 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2124 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out new file mode 100644 index 000000000000..26cdaee37a95 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_approve3.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_approve3 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2195 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out new file mode 100644 index 000000000000..f9c24fc7e4c5 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_call_mint_or_burn.out @@ -0,0 +1,40 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_call_mint_or_burn + +Node is bootstrapped. +Estimated gas: 3217.516 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000644 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3318 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000644 + payload fees(the block proposer) ....... +ꜩ0.000644 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: mintOrBurn + Parameter: (Pair 100000000 "[CONTRACT_HASH]") + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 100000000 + Storage size: 1982 bytes + Paid storage size diff: 71 bytes + Consumed gas: 3217.989 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_dex_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_dex_storage.out new file mode 100644 index 000000000000..ad073658bcb4 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_dex_storage.out @@ -0,0 +1,7 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_dex_storage + +Pair 21589 + 8997498998 + 2158830 + "[CONTRACT_HASH]" + "[CONTRACT_HASH]" diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_lqt_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_lqt_storage.out new file mode 100644 index 000000000000..737750d50968 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_lqt_storage.out @@ -0,0 +1,3 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_lqt_storage + +Pair 2 3 "[CONTRACT_HASH]" 2158830 diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out new file mode 100644 index 000000000000..4616d37fca05 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_remove_liquidity.out @@ -0,0 +1,80 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_remove_liquidity + +Node is bootstrapped. +Estimated gas: 7520.791 units (will add 100 for safety) +Estimated storage: 67 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.001115 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 7621 + Storage limit: 87 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.001115 + payload fees(the block proposer) ....... +ꜩ0.001115 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: removeLiquidity + Parameter: (Pair "[CONTRACT_HASH]" 1000 0 0 "[TIMESTAMP]") + This transaction was successfully applied + Updated storage: + { 21589 ; + 8997498998 ; + 2158830 ; + 0x01e927f00ef734dfc85919635e9afc9166c83ef9fc00 ; + 0x0115eb0104481a6d7921160bc982c5e0a561cd8a3a00 } + Storage size: 4635 bytes + Consumed gas: 2279.807 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: mintOrBurn + Parameter: (Pair -1000 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c) + This transaction was successfully applied + Updated storage: + { 2 ; 3 ; 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 ; 2158830 } + Updated big_maps: + Unset map(2)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] + Storage size: 2050 bytes + Consumed gas: 1873.473 + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 + (Pair 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c 10)) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 21588 + Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 10 + Storage size: 2331 bytes + Paid storage size diff: 67 bytes + Consumed gas: 2367.511 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01675 + storage fees ........................... +ꜩ0.01675 + Internal Transaction: + Amount: ꜩ4.167766 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000 + Balance updates: + [CONTRACT_HASH] ... -ꜩ4.167766 + [CONTRACT_HASH] ... +ꜩ4.167766 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_setup.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_setup.out new file mode 100644 index 000000000000..78031605ebd5 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_setup.out @@ -0,0 +1,8 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_setup + +"[CONTRACT_HASH]" +Pair 1 + 100 + 100 + "[CONTRACT_HASH]" + "[CONTRACT_HASH]" diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_tok_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_tok_storage.out new file mode 100644 index 000000000000..59cc0a7ac37f --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestAddApproveTransferRemove::test_tok_storage.out @@ -0,0 +1,3 @@ +tests_016/test_liquidity_baking.py::TestAddApproveTransferRemove::test_tok_storage + +Pair 0 1 "[CONTRACT_HASH]" 100010000 diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out new file mode 100644 index 000000000000..bb7264189bae --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_add_liquidity.out @@ -0,0 +1,83 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_add_liquidity + +Node is bootstrapped. +Estimated gas: 8555.847 units (will add 100 for safety) +Estimated storage: 147 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.001221 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 8656 + Storage limit: 167 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.001221 + payload fees(the block proposer) ....... +ꜩ0.001221 + Transaction: + Amount: ꜩ9001 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: addLiquidity + Parameter: (Pair "[CONTRACT_HASH]" 0 1000000000 "[TIMESTAMP]") + This transaction was successfully applied + Updated storage: + { 21599 ; + 9001416765 ; + 2159830 ; + 0x01e927f00ef734dfc85919635e9afc9166c83ef9fc00 ; + 0x0115eb0104481a6d7921160bc982c5e0a561cd8a3a00 } + Storage size: 4635 bytes + Paid storage size diff: 6 bytes + Consumed gas: 2278.202 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.0015 + storage fees ........................... +ꜩ0.0015 + [CONTRACT_HASH] ... -ꜩ9001 + [CONTRACT_HASH] ... +ꜩ9001 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + (Pair 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 21598)) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 999978402 + Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 99978402 + Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 21598 + Storage size: 2264 bytes + Paid storage size diff: 69 bytes + Consumed gas: 3064.106 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01725 + storage fees ........................... +ꜩ0.01725 + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: mintOrBurn + Parameter: (Pair 2159730 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78) + This transaction was successfully applied + Updated storage: + { 2 ; 3 ; 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 ; 2159830 } + Updated big_maps: + Set map(2)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 2159730 + Storage size: 2050 bytes + Paid storage size diff: 72 bytes + Consumed gas: 3213.539 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.018 + storage fees ........................... +ꜩ0.018 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out new file mode 100644 index 000000000000..af93711c1b53 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_buy_tok.out @@ -0,0 +1,75 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_buy_tok + +Node is bootstrapped. +Estimated gas: 5115.557 units (will add 100 for safety) +Estimated storage: 327 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000869 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 5216 + Storage limit: 347 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000869 + payload fees(the block proposer) ....... +ꜩ0.000869 + Transaction: + Amount: ꜩ9001 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: xtzToToken + Parameter: (Pair "[CONTRACT_HASH]" 0 "[TIMESTAMP]") + This transaction was successfully applied + Updated storage: + { 10811 ; + 17993499098 ; + 2159830 ; + 0x01e927f00ef734dfc85919635e9afc9166c83ef9fc00 ; + 0x0115eb0104481a6d7921160bc982c5e0a561cd8a3a00 } + Storage size: 4636 bytes + Paid storage size diff: 1 bytes + Consumed gas: 1748.012 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.00025 + storage fees ........................... +ꜩ0.00025 + [CONTRACT_HASH] ... -ꜩ9001 + [CONTRACT_HASH] ... +ꜩ9001 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 + (Pair 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c 10788)) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 10810 + Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 10788 + Storage size: 2333 bytes + Paid storage size diff: 69 bytes + Consumed gas: 2367.545 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01725 + storage fees ........................... +ꜩ0.01725 + Internal Transaction: + Amount: ꜩ9.001 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000 + Balance updates: + [CONTRACT_HASH] ... -ꜩ9.001 + [CONTRACT_HASH] ... +ꜩ9.001 + [CONTRACT_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out new file mode 100644 index 000000000000..eb17ad57d970 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve1.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_call_approve1 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2053 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out new file mode 100644 index 000000000000..c0617ba0825e --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve2.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_call_approve2 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2124 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out new file mode 100644 index 000000000000..dc8e95945056 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_approve3.out @@ -0,0 +1,41 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_call_approve3 + +Node is bootstrapped. +Estimated gas: 1679.703 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000488 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 1780 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000488 + payload fees(the block proposer) ....... +ꜩ0.000488 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: approve + Parameter: (Pair "[CONTRACT_HASH]" 1000000000) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 1000000000 + Storage size: 2195 bytes + Paid storage size diff: 71 bytes + Consumed gas: 1679.703 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out new file mode 100644 index 000000000000..00fdac07622f --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_call_mint_or_burn.out @@ -0,0 +1,40 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_call_mint_or_burn + +Node is bootstrapped. +Estimated gas: 3217.516 units (will add 100 for safety) +Estimated storage: 71 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000644 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 3318 + Storage limit: 91 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000644 + payload fees(the block proposer) ....... +ꜩ0.000644 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: mintOrBurn + Parameter: (Pair 100000000 "[CONTRACT_HASH]") + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(0)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 100000000 + Storage size: 1982 bytes + Paid storage size diff: 71 bytes + Consumed gas: 3217.989 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.01775 + storage fees ........................... +ꜩ0.01775 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_dex_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_dex_storage.out new file mode 100644 index 000000000000..300fb5389813 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_dex_storage.out @@ -0,0 +1,7 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_dex_storage + +Pair 10911 + 17828916091 + 2159830 + "[CONTRACT_HASH]" + "[CONTRACT_HASH]" diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_lqt_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_lqt_storage.out new file mode 100644 index 000000000000..0a138d697b35 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_lqt_storage.out @@ -0,0 +1,3 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_lqt_storage + +Pair 2 3 "[CONTRACT_HASH]" 2159830 diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out new file mode 100644 index 000000000000..574351477459 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_sell_tok.out @@ -0,0 +1,74 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_sell_tok + +Node is bootstrapped. +Estimated gas: 7012.582 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.001057 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 7113 + Storage limit: 0 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.001057 + payload fees(the block proposer) ....... +ꜩ0.001057 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: tokenToXtz + Parameter: (Pair "[CONTRACT_HASH]" 100 0 "[TIMESTAMP]") + This transaction was successfully applied + Updated storage: + { 10911 ; + 17828916091 ; + 2159830 ; + 0x01e927f00ef734dfc85919635e9afc9166c83ef9fc00 ; + 0x0115eb0104481a6d7921160bc982c5e0a561cd8a3a00 } + Storage size: 4636 bytes + Consumed gas: 1748.660 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair 0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6 + (Pair 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600 100)) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(1)[(Pair 0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6 + 0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600)] to 999999900 + Unset map(0)[0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6] + Set map(0)[0x01d496def47a3be89f5d54c6e6bb13cc6645d6e16600] to 10910 + Storage size: 2333 bytes + Consumed gas: 3263.922 + Internal Transaction: + Amount: ꜩ164.584923 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000 + Balance updates: + [CONTRACT_HASH] ... -ꜩ164.584923 + [CONTRACT_HASH] ... +ꜩ164.584923 + Internal Transaction: + Amount: ꜩ0.16475 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Consumed gas: 1000 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.16475 + [CONTRACT_HASH] ... +ꜩ0.16475 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_setup.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_setup.out new file mode 100644 index 000000000000..3034bed99ca7 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_setup.out @@ -0,0 +1,8 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_setup + +"[CONTRACT_HASH]" +Pair 1 + 100 + 100 + "[CONTRACT_HASH]" + "[CONTRACT_HASH]" diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_tok_storage.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_tok_storage.out new file mode 100644 index 000000000000..0bd2dca31150 --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_tok_storage.out @@ -0,0 +1,3 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_tok_storage + +Pair 0 1 "[CONTRACT_HASH]" 100010000 diff --git a/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out new file mode 100644 index 000000000000..82a7d513fb1a --- /dev/null +++ b/tests_python/tests_016/_regtest_outputs/test_liquidity_baking.TestTrades::test_transfer.out @@ -0,0 +1,43 @@ +tests_016/test_liquidity_baking.py::TestTrades::test_transfer + +Node is bootstrapped. +Estimated gas: 2376.215 units (will add 100 for safety) +Estimated storage: 68 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[BLOCK_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [CONTRACT_HASH] + Fee to the baker: ꜩ0.000605 + Expected counter: [EXPECTED_COUNTER] + Gas limit: 2477 + Storage limit: 88 bytes + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000605 + payload fees(the block proposer) ....... +ꜩ0.000605 + Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: transfer + Parameter: (Pair "[CONTRACT_HASH]" + "[CONTRACT_HASH]" + 100) + This transaction was successfully applied + Updated storage: + { 0 ; 1 ; 0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78 ; 100010000 } + Updated big_maps: + Set map(0)[0x0000dac9f52543da1aed0bc1d6b46bf7c10db7014cd6] to 100 + Set map(0)[0x0000e7670f32038107a59a2b9cfefae36ea21f5aa63c] to 10688 + Storage size: 2401 bytes + Paid storage size diff: 68 bytes + Consumed gas: 2376.215 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.017 + storage fees ........................... +ꜩ0.017 + +Injected block at minimal timestamp diff --git a/tests_python/tests_016/conftest.py b/tests_python/tests_016/conftest.py new file mode 100644 index 000000000000..1feefd3ef211 --- /dev/null +++ b/tests_python/tests_016/conftest.py @@ -0,0 +1,121 @@ +"""Protocol-specific hooks and fixtures""" + +import tempfile +from typing import Optional, Iterator, List +import pytest +from launchers.sandbox import Sandbox +from tools import constants, utils +from tools.client_regression import ClientRegression +from client.client import Client +from client.client_output import CreateMockupResult + +from . import protocol + + +@pytest.fixture(scope="class") +def client(sandbox: Sandbox) -> Iterator[Client]: + """One node with protocol 016. + + Activate protocol 016 one year in the past. This avoids waiting + when baking blocks manually from the client using `bake for` + """ + sandbox.add_node(0, params=constants.NODE_PARAMS) + client = sandbox.client(0) + parameters = protocol.get_parameters() + parameters['consensus_threshold'] = 0 + protocol.activate(client, parameters=parameters, activate_in_the_past=True) + yield client + + +@pytest.fixture(scope="class") +def client_regtest_bis(sandbox: Sandbox) -> Iterator[Client]: + """One node with protocol 016, regression test enabled. + + Activate protocol 016 one year in the past. (see fixture client). + """ + + def reg_client_factory( + client_path: str, + admin_client_path: str, + host: Optional[str] = None, + base_dir: Optional[str] = None, + rpc_port: Optional[int] = None, + use_tls: Optional[bool] = None, + endpoint: Optional[str] = 'http://127.0.0.1:8732', + mode: str = None, + disable_disclaimer: bool = True, + ) -> ClientRegression: + client = ClientRegression( + client_path=client_path, + admin_client_path=admin_client_path, + host=host, + base_dir=base_dir, + rpc_port=rpc_port, + use_tls=use_tls, + endpoint=endpoint, + mode=mode, + disable_disclaimer=disable_disclaimer, + ) + return client + + sandbox.add_node( + 1, client_factory=reg_client_factory, params=constants.NODE_PARAMS + ) + client = sandbox.client(1) + parameters = protocol.get_parameters() + parameters['consensus_threshold'] = 0 + protocol.activate(client, activate_in_the_past=True, parameters=parameters) + yield client + + +@pytest.fixture(scope="class") +def clients(sandbox: Sandbox, request) -> Iterator[List[Client]]: + """N node with protocol 016. Parameterized by the number of nodes. + + Number of nodes is specified as a class annotation. + @pytest.mark.parametrize('clients', [N], indirect=True) + + Activate protocol 016 one year in the past. (see fixture client). + """ + assert request.param is not None + num_nodes = request.param + for i in range(num_nodes): + # Large number may increases peers connection time + sandbox.add_node(i, params=constants.NODE_PARAMS) + parameters = protocol.get_parameters() + parameters['consensus_threshold'] = 0 + parameters['minimal_block_delay'] = '1' + parameters['delay_increment_per_round'] = '1' + protocol.activate( + sandbox.client(0), parameters=parameters, activate_in_the_past=True + ) + + clients = sandbox.all_clients() + for client in clients: + proto = protocol.HASH + assert utils.check_protocol(client, proto) + yield clients + + +@pytest.fixture +def mockup_client(sandbox: Sandbox) -> Iterator[Client]: + """ + Returns a mockup client with its persistent directory created + + This is done in two steps, because we want to create the mockup + with a client that doesn't have "--mode mockup" (as per + the public documentation) but we want to return a + client that has "--mode mockup" and uses the base-dir created + in the first step. + + There is no way around this pattern. If you want to create + a mockup using custom arguments; you MUST do the same + as this method. + """ + with tempfile.TemporaryDirectory(prefix='octez-client.') as base_dir: + unmanaged_client = sandbox.create_client(base_dir=base_dir) + res = unmanaged_client.create_mockup( + protocol=protocol.HASH + ).create_mockup_result + assert res == CreateMockupResult.OK + yield sandbox.create_client(base_dir=base_dir, mode="mockup") diff --git a/tests_python/tests_016/contract_paths.py b/tests_python/tests_016/contract_paths.py new file mode 100644 index 000000000000..c518ed3fc521 --- /dev/null +++ b/tests_python/tests_016/contract_paths.py @@ -0,0 +1,20 @@ +from os import path +from typing import List +from tools import paths + + +def all_contracts(directories: List[str] = None) -> List[str]: + return paths.all_contracts(CONTRACT_PATH, directories) + + +def all_legacy_contracts() -> List[str]: + return all_contracts(['legacy']) + + +CONTRACT_PATH = path.join(paths.TEZOS_HOME, 'tests_python', 'contracts_016') +ATTIC_CONTRACT_PATH = path.join(CONTRACT_PATH, 'attic') +MACROS_CONTRACT_PATH = path.join(CONTRACT_PATH, 'macros') +ILLTYPED_CONTRACT_PATH = path.join(CONTRACT_PATH, 'ill_typed') +LEGACY_CONTRACT_PATH = path.join(CONTRACT_PATH, 'legacy') +OPCODES_CONTRACT_PATH = path.join(CONTRACT_PATH, 'opcodes') +MINI_SCENARIOS_CONTRACT_PATH = path.join(CONTRACT_PATH, 'mini_scenarios') diff --git a/tests_python/tests_016/operations_files/empty_operations.json b/tests_python/tests_016/operations_files/empty_operations.json new file mode 100644 index 000000000000..fe51488c7066 --- /dev/null +++ b/tests_python/tests_016/operations_files/empty_operations.json @@ -0,0 +1 @@ +[] diff --git a/tests_python/tests_016/protocol.py b/tests_python/tests_016/protocol.py new file mode 100644 index 000000000000..313b43a1e90e --- /dev/null +++ b/tests_python/tests_016/protocol.py @@ -0,0 +1,69 @@ +import datetime +from enum import Enum, auto +from typing import Optional +from copy import deepcopy +from tools import constants, utils + +HASH = constants.MUMBAI +DAEMON = constants.MUMBAI_DAEMON +PARAMETERS = constants.MUMBAI_PARAMETERS + +TENDERBAKE_PARAMETERS = deepcopy(PARAMETERS) +TENDERBAKE_PARAMETERS['consensus_threshold'] = 45 +TENDERBAKE_PARAMETERS['consensus_committee_size'] = 67 + +FOLDER = constants.MUMBAI_FOLDER + +PREV_HASH = constants.LIMA +PREV_DAEMON = constants.LIMA_DAEMON +PREV_PARAMETERS = constants.LIMA_PARAMETERS + + +def activate( + client, + parameters=PARAMETERS, + proto=HASH, + timestamp=None, + activate_in_the_past=False, +): + utils.activate_protocol( + client, proto, parameters, timestamp, activate_in_the_past + ) + + +class Protocol(Enum): + CURRENT = auto() + PREV = auto() + + +def get_parameters(protocol: Optional[Protocol] = Protocol.CURRENT): + """ + Args: + protocol (Protocol): protocol id (either CURRENT or PREV). + Defaults to CURRENT + + Returns: + A fresh copy of the protocol parameters w.r.t to protocol + """ + # deepcopy call prevents any unforeseen and unwanted side effects + # on the array parameters + # e.g., bootstrap_accounts, commitments, endorsement_reward + return deepcopy( + dict((PARAMETERS if protocol is Protocol.CURRENT else PREV_PARAMETERS)) + ) + + +def get_now(client) -> str: + """Returns the timestamp of next-to-last block, + offset by the minimum time between blocks""" + + timestamp_date = client.get_block_timestamp(block='head~1') + + constants = client.rpc('get', '/chains/main/blocks/head/context/constants') + + delta = datetime.timedelta(seconds=int(constants['minimal_block_delay'])) + + now_date = timestamp_date + delta + + rfc3399_format = "%Y-%m-%dT%H:%M:%SZ" + return now_date.strftime(rfc3399_format) diff --git a/tests_python/tests_016/test_accuser.py b/tests_python/tests_016/test_accuser.py new file mode 100644 index 000000000000..1104ed5c67c0 --- /dev/null +++ b/tests_python/tests_016/test_accuser.py @@ -0,0 +1,126 @@ +import time + +import pytest +from tools import utils, constants +from launchers.sandbox import Sandbox +from . import protocol + + +NUM_NODES = 2 + + +@pytest.mark.multinode +@pytest.mark.incremental +class TestAccuser: + """Constructs a double endorsement, and lets the accuser inject + the evidence.""" + + def test_init(self, sandbox: Sandbox): + for i in range(NUM_NODES): + sandbox.add_node(i, params=constants.NODE_PARAMS) + protocol.activate(sandbox.client(0), activate_in_the_past=True) + # We inject 3 blocks so that the double-endorsement-evidence operation + # is always branched from a known predecessor. (If the level of the + # evidence is smaller than 5, then the operation is branched from the + # head; however the node might change branch, and then the operation + # becomes invalid, namely "branch refused".) + for i in range(3): + utils.bake(sandbox.client(0)) + + def test_level(self, sandbox: Sandbox): + level = 4 + for client in sandbox.all_clients(): + assert utils.check_level(client, level) + + def test_terminate_node_1(self, sandbox: Sandbox): + sandbox.node(1).terminate() + + def test_bake_node_0(self, sandbox: Sandbox): + """Client 0 bakes block A at level 5, not communicated to node 1. + Inject an operation (transfer) to ensure a different hash""" + sandbox.client(0).transfer(1, 'bootstrap4', 'bootstrap5') + sandbox.client(0).propose( + delegates=['bootstrap1'], args=['--minimal-timestamp'] + ) + + def test_endorse_node_0(self, sandbox: Sandbox, session: dict): + """bootstrap1 builds an endorsement for block A""" + client = sandbox.client(0) + client.run(["endorse", "for", 'bootstrap3', '--force']) + mempool = client.get_mempool() + endorsement = mempool['applied'][0] + session['endorsement1'] = endorsement + utils.bake(client, bake_for='bootstrap2') + + def test_terminate_node_0(self, sandbox: Sandbox): + sandbox.node(0).terminate() + + def test_restart_node_1(self, sandbox: Sandbox): + sandbox.node(1).run() + assert sandbox.client(1).check_node_listening() + + def test_start_accuser(self, sandbox: Sandbox): + sandbox.add_accuser(1, proto=protocol.DAEMON) + # We make sure that there is enough time for the accuser to start + # listing to the node's block stream, otherwise the accuser might miss + # the next two blocks. + time.sleep(2) + + def test_bake_node_1(self, sandbox: Sandbox): + """Client 1 bakes block B at level 5, not communicated to node 0""" + sandbox.client(1).propose( + delegates=['bootstrap1'], args=['--minimal-timestamp'] + ) + + def test_endorse_node_2(self, sandbox: Sandbox, session: dict): + """bootstrap1 builds an endorsement for block B, which is included in + a new block at level 6 by bootstrap2""" + client = sandbox.client(1) + client.run(["endorse", "for", 'bootstrap3', "--force"]) + mempool = client.get_mempool() + endorsement = mempool['applied'][0] + session['endorsement2'] = endorsement + utils.bake(client, bake_for='bootstrap2') + mempool = client.get_mempool() + client.get_operations("4") + + def test_restart_node_0(self, sandbox: Sandbox): + sandbox.node(0).run() + sandbox.client(0).check_node_listening() + + def test_check_level(self, sandbox: Sandbox): + """All nodes are at level 6, head is either block A or B""" + level = 6 + for client in sandbox.all_clients(): + assert utils.check_level(client, level) + + def test_bake_block(self, sandbox: Sandbox): + """Bake a block on node 0, which makes the chain on node 0 longer; in + this way, we make sure that node 1 sees the block at level 6, + which containts the conflicting endorsement. + """ + utils.bake(sandbox.client(0)) + + @pytest.mark.xfail(reason="Works locally - CI fails") + def test_double_baking_evidence_generated(self, sandbox: Sandbox): + """Check that a double baking evidence operation is in the + mempool of node 1 or in the block at level 7, depending on + whether the double endorsement operation has reached node 1 + before or after node 1 sees the block at level 7. + """ + in_mempool = False + in_block = False + + mempool = sandbox.client(1).get_mempool() + applied = mempool['applied'] + evidence_kind = "double_baking_evidence" + + if len(applied) > 0 and len(applied[0]['contents']) > 0: + in_mempool = applied[0]['contents'][0]['kind'] == evidence_kind + + if not in_mempool: + ops = sandbox.client(1).get_operations() + if len(ops[2]) > 0 and len(ops[2][0]['contents']) > 0: + in_block = ops[2][0]['contents'][0]['kind'] == evidence_kind + + assert in_mempool or in_block diff --git a/tests_python/tests_016/test_baker_operations_cli_options.py b/tests_python/tests_016/test_baker_operations_cli_options.py new file mode 100644 index 000000000000..cec086e7af77 --- /dev/null +++ b/tests_python/tests_016/test_baker_operations_cli_options.py @@ -0,0 +1,376 @@ +"""Simple tests to check support for the following operations-related options +for baking + - --ignore-node-mempool + - --operations-pool [file|uri] +""" + + +import os +import os.path +import json +import time + +from http.server import HTTPServer, SimpleHTTPRequestHandler +from multiprocessing import Process + +from typing import List, Any + +import pytest + +from client.client import Client +from tools import constants, utils +from launchers.sandbox import Sandbox +from . import protocol + +PORT = 12121 +OPERATIONS_FILES_DIRECTORY = "operations_files" +EMPTY_OPERATIONS = "empty_operations" +ABSENT_OPERATIONS = "this_file_should_not_exist" +SINGLETON_OPERATIONS = "singleton_operations" +TEST_DIR = "tests_016" + + +class MyHttpServer: + """Simple HTTP server launching in a separate process""" + + def __init__(self): + server_address = ('localhost', PORT) + httpd = HTTPServer(server_address, SimpleHTTPRequestHandler) + process = Process(target=httpd.serve_forever, args=()) + self.process = process + self.server = httpd + + def run(self): + self.process.start() + + def close(self): + self.server.server_close() + self.process.terminate() + + +@pytest.fixture +def http_server(): + server = MyHttpServer() + server.run() + yield server + server.close() + + +def get_filename(basename: str) -> str: + return os.path.join( + TEST_DIR, OPERATIONS_FILES_DIRECTORY, f"{basename}.json" + ) + + +class TestIgnoreNodeMempool: + def test_ignore(self, client: Client): + """Check that a transfer injected into the node is dutifully ignored + when baking with --ignore-node-mempool + """ + sender = "bootstrap4" + balance0 = client.get_balance(sender) + client.transfer(2, sender, 'bootstrap5') + utils.bake( + client, bake_args=['--minimal-timestamp', "--ignore-node-mempool"] + ) + balance1 = client.get_balance(sender) + # Make sure the operations has not been included, indirectly through + # balance checks + assert balance1 == balance0 + assert client.get_level() == 2 + + def test_no_ignore(self, client: Client): + """Check that a transfer injected, then ignored, can be injected at the + next block""" + sender = "bootstrap4" + balance0 = client.get_balance(sender) + utils.bake(client, bake_args=['--minimal-timestamp']) + balance1 = client.get_balance(sender) + assert balance1 != balance0 + assert client.get_level() == 3 + + +def all_empty(lls: List[List[Any]]) -> bool: + return all(map(lambda l: len(l) == 0, lls)) + + +def only_has_endorsements(lls: List[List[Any]]) -> bool: + return all(map(lambda x: x[0] == 0 or len(x[1]) == 0, enumerate(lls))) + + +def mempool_to_operations(mempool): + def to_op(applied_op): + operation = {} + operation['branch'] = applied_op['branch'] + operation['contents'] = applied_op['contents'] + operation['signature'] = applied_op['signature'] + return operation + + return [to_op(applied_op) for applied_op in mempool['applied']] + + +def get_operations(client: Client) -> List[dict]: + return mempool_to_operations(client.get_mempool()) + + +class TestExternalOperations: + def test_bake_empty_operations_file(self, client: Client): + level = client.get_level() + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + get_filename(EMPTY_OPERATIONS), + ], + ) + assert client.get_level() == level + 1 + head = client.get_head() + assert all_empty(head['operations']) + + # http_server is a fixture that auto- runs and closes said HTTP server + # pylint: disable=W0613 + def test_bake_empty_operations_http(self, client: Client, http_server): + level = client.get_level() + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + f"http://localhost:{PORT}/{get_filename(EMPTY_OPERATIONS)}", + ], + ) + assert client.get_level() == level + 1 + head = client.get_head() + assert only_has_endorsements(head['operations']) + + def test_bake_absent_operations_file(self, client: Client): + """The absent resource should simply be ignored.""" + level = client.get_level() + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + f"{ABSENT_OPERATIONS}", + ], + ) + assert client.get_level() == level + 1 + head = client.get_head() + assert only_has_endorsements(head['operations']) + + # pylint: disable=W0613 + def test_bake_absent_operations_http(self, client: Client, http_server): + """The absent resource should simply be ignored.""" + level = client.get_level() + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + # any fake URL would do here + f"http://localhost:{PORT}/{ABSENT_OPERATIONS}", + ], + ) + assert client.get_level() == level + 1 + head = client.get_head() + assert only_has_endorsements(head['operations']) + + def test_bake_singleton_operations_file_pre( + self, client: Client, session: dict + ): + """Construct a transaction over the current state, and bake it. + Store it into the context to serves as a dynamic oracle for the next + steps. + """ + sender = 'bootstrap2' + balance0 = client.get_mutez_balance(sender) + session['amount'] = 2 + client.transfer(session['amount'], sender, 'bootstrap3') + + # Baking + utils.bake(client, bake_args=['--minimal-timestamp']) + balance1 = client.get_mutez_balance(sender) + session['difference'] = balance0 - balance1 + assert session['difference'] >= session['amount'] + utils.bake(client) + + def test_bake_singleton_operations_file( + self, client: Client, session: dict + ): + """Construct a transaction over the current state, put it into a file, + and bake it into the chain through --operations-pool option. + + This additionally compares the balance to a normal transfer (through the + node's mempool) to check that there is no observable difference in + behaviors between passing through a node's mempool or a hand-rolled + operations file. + """ + sender = 'bootstrap4' + balance0 = client.get_mutez_balance(sender) + client.transfer(session['amount'], sender, 'bootstrap3') + + pending_ops = get_operations(client) + assert len(pending_ops) == 1 + assert len(pending_ops[0]['contents']) == 1 + + # Write the transaction to a file + file = get_filename(SINGLETON_OPERATIONS) + with open(file, 'w') as fdesc: + fdesc.write(json.dumps(pending_ops)) + + # Baking + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + file, + '--ignore-node-mempool', + ], + ) + balance1 = client.get_mutez_balance(sender) + assert balance0 - balance1 == session['difference'] + # cleanup the generated file + os.remove(file) + + # pylint: disable=W0613 + def test_bake_singleton_operations_http( + self, client: Client, sandbox: Sandbox, session: dict, http_server + ): + # Restart + sandbox.node(0).terminate() + time.sleep(3) + sandbox.node(0).run() + client.check_node_listening() + + sender = 'bootstrap2' + balance0 = client.get_mutez_balance(sender) + client.transfer(session['amount'], sender, 'bootstrap3') + + pending_ops = get_operations(client) + assert len(pending_ops) == 1 + assert len(pending_ops[0]['contents']) == 1 + + # Write the transaction to a file + file = get_filename(SINGLETON_OPERATIONS) + with open(file, 'w') as fdesc: + fdesc.write(json.dumps(pending_ops)) + + utils.bake( + client, + bake_args=[ + '--minimal-timestamp', + "--operations-pool", + f"http://localhost:{PORT}/{file}", + '--ignore-node-mempool', + ], + ) + + sandbox.client(0).rpc('get', '/chains/main/blocks/head') + balance1 = client.get_mutez_balance(sender) + assert balance0 - balance1 == session['difference'] + # cleanup the generated file + os.remove(file) + + +# The 5 bootstrap accounts +ALL_BOOTSTRAP_ACCOUNTS = [f'bootstrap{i + 1}' for i in range(5)] + + +@pytest.mark.incremental +class TestBakerExternalOperations: + """Test adding an external operations source (file) {}to a baker daemon""" + + def test_init(self, sandbox: Sandbox): + sandbox.add_node(0, params=constants.NODE_PARAMS) + parameters = protocol.get_parameters() + parameters['minimal_block_delay'] = "1" + parameters["delay_increment_per_round"] = "1" + protocol.activate( + sandbox.client(0), + parameters=parameters, + activate_in_the_past=False, + ) + + def test_gen_operations(self, sandbox: Sandbox, session: dict): + """Generate a transfer operation and save it to a file""" + client = sandbox.client(0) + client.multibake(args=['--minimal-timestamp']) + client.transfer(3, 'bootstrap1', 'bootstrap3') + client.multibake(args=['--minimal-timestamp']) + + client.multibake(args=['--minimal-timestamp']) + + # We are now at level 2, next block at level 4 + level = client.get_level() + session['level'] = level + assert level == 4 + assert len(get_operations(client)) == 0 + time.sleep(3) + session['transfer_value'] = 2 + client.transfer(session['transfer_value'], 'bootstrap1', 'bootstrap3') + + pending_ops = get_operations(client) + + # Write the transaction to a file + filename = get_filename(SINGLETON_OPERATIONS) + session['operations_file'] = filename + with open(filename, 'w') as fdesc: + fdesc.write(json.dumps(pending_ops)) + + def test_terminate_sandbox(self, sandbox: Sandbox): + """Cleanup the node's mempool. Forget about the last transfer""" + sandbox.node(0).terminate() + # let the node end gracefully before restarting + time.sleep(1) + + def test_baker(self, sandbox: Sandbox, session: dict): + """Restart the node and add a baker daemon""" + sandbox.node(0).run() + assert sandbox.client(0).check_node_listening() + assert os.path.isfile(session['operations_file']) + + sandbox.add_baker( + 0, + ALL_BOOTSTRAP_ACCOUNTS, + proto=protocol.DAEMON, + log_levels=constants.TENDERBAKE_BAKER_LOG_LEVELS, + run_params=[ + '--operations-pool', + session['operations_file'], + '--liquidity-baking-toggle-vote', + 'pass', + ], + ) + + @pytest.mark.timeout(30) + def test_wait_until_high_enough_level( + self, sandbox: Sandbox, session: dict + ): + """Wait until we have seen enough blocks. + This should not take much time.""" + while sandbox.client(0).get_level() < 2 * session['level']: + time.sleep(1) + + def test_check_block_baked(self, sandbox: Sandbox, session: dict): + """Check that block exactly contains the operations that we put into + our operations file""" + expected_level = session['level'] + block = sandbox.client(0).rpc( + 'get', f'/chains/main/blocks/{expected_level}' + ) + manager_ops = block['operations'][3] + assert len(manager_ops) == 1 + assert int( + manager_ops[0]['contents'][0]['amount'] + ) == utils.mutez_of_tez(session['transfer_value']) + + def test_check_block_after_baked(self, sandbox: Sandbox, session: dict): + """Check that block is empty of operations""" + level = session['level'] + 1 + block = sandbox.client(0).rpc('get', f'/chains/main/blocks/{level}') + assert only_has_endorsements(block['operations']) + + # cleanup the operation file + os.remove(session['operations_file']) diff --git a/tests_python/tests_016/test_basic.py b/tests_python/tests_016/test_basic.py new file mode 100644 index 000000000000..b5702c307f92 --- /dev/null +++ b/tests_python/tests_016/test_basic.py @@ -0,0 +1,476 @@ +from os import path +from typing import List +import pytest +from client.client import Client +from tools import constants, utils +from tools.paths import ACCOUNT_PATH +from tools.utils import assert_run_failure +from .contract_paths import CONTRACT_PATH + + +BAKE_ARGS: List[str] = [] +TRANSFER_ARGS = ['--burn-cap', '0.257'] + + +@pytest.mark.incremental +class TestRawContext: + def test_delegates(self, client: Client): + path = '/chains/main/blocks/head/context/raw/bytes/delegates/?depth=2' + res = client.rpc('get', path) + expected = { + "ed25519": { + "02298c03ed7d454a101eb7022bc95f7e5f41ac78": None, + "a9ceae0f8909125492a7c4700acc59274cc6c846": None, + "c55cf02dbeecc978d9c84625dcae72bb77ea4fbd": None, + "dac9f52543da1aed0bc1d6b46bf7c10db7014cd6": None, + "e7670f32038107a59a2b9cfefae36ea21f5aa63c": None, + } + } + assert res == expected + + def test_no_service_1(self, client: Client): + path = '/chains/main/blocks/head/context/raw/bytes/non-existent' + with assert_run_failure('No service found at this URL'): + client.rpc('get', path) + + def test_no_service_2(self, client: Client): + path = ( + '/chains/main/blocks/head/context/raw/bytes/' + 'non-existent?depth=-1' + ) + expected = r'Failed to parse argument \'depth\' \("-1"\)' + with assert_run_failure(expected): + client.rpc('get', path) + + def test_no_service_3(self, client: Client): + path = '/chains/main/blocks/head/context/raw/bytes/non-existent?depth=0' + with assert_run_failure('No service found at this URL'): + client.rpc('get', path) + + def test_bake(self, client: Client): + utils.bake(client, 'bootstrap4') + + @pytest.mark.parametrize( + "identity, message, expected_signature", + [ + ( + 'bootstrap1', + 'msg1', + 'edsigtz68o4FdbpvycnAMDLaa7hpmmhjDx' + 'hx4Zu3QWHLYJtcY1mVhW9m6CCvsciFXwf1' + 'zLmah8fJP51cqaeaciBPGy5osH11AnR', + ), + ( + 'bootstrap2', + 'msg2', + 'edsigtZqhR5SW6vbRSmqwzfS1KiJZLYLe' + 'FhLcCEw7WxjBDxotVx83M2rLe4Baq52SUT' + 'jxfXhQ5J3TabCwqt78kNpoU8j42GDEk4', + ), + ( + 'bootstrap3', + 'msg3', + 'edsigu2PvAWxVYY3jQFVfBRW2Dg61xZMN' + 'esHiNbwCTmpJSyfcJMW8Ch9WABHqsgHQRB' + 'aSs6zZNHVGXfHSBnGCxT9x2b49L2zpMW', + ), + ( + 'bootstrap4', + 'msg4', + 'edsigu5jieost8eeD3JwVrpPuSnKzLLvR3' + 'aqezLPDTvxC3p41qwBEpxuViKriipxig5' + '2NQmJ7AFXTzhM3xgKM2ZaADcSMYWztuJ', + ), + ], + ) + def test_sign_message(self, client, identity, message, expected_signature): + assert client.sign_message(message, identity) == expected_signature + + @pytest.mark.parametrize( + "identity, message, signature", + [ + ( + 'bootstrap1', + 'msg1', + 'edsigtz68o4FdbpvycnAMDLaa7hpmmhjDx' + 'hx4Zu3QWHLYJtcY1mVhW9m6CCvsciFXwf1' + 'zLmah8fJP51cqaeaciBPGy5osH11AnR', + ), + ( + 'bootstrap2', + 'msg2', + 'edsigtZqhR5SW6vbRSmqwzfS1KiJZLYLe' + 'FhLcCEw7WxjBDxotVx83M2rLe4Baq52SUT' + 'jxfXhQ5J3TabCwqt78kNpoU8j42GDEk4', + ), + ( + 'bootstrap3', + 'msg3', + 'edsigu2PvAWxVYY3jQFVfBRW2Dg61xZMN' + 'esHiNbwCTmpJSyfcJMW8Ch9WABHqsgHQRB' + 'aSs6zZNHVGXfHSBnGCxT9x2b49L2zpMW', + ), + ( + 'bootstrap4', + 'msg4', + 'edsigu5jieost8eeD3JwVrpPuSnKzLLvR3' + 'aqezLPDTvxC3p41qwBEpxuViKriipxig5' + '2NQmJ7AFXTzhM3xgKM2ZaADcSMYWztuJ', + ), + ], + ) + def test_check_message(self, client, identity, message, signature): + assert client.check_message(message, identity, signature) + + @pytest.mark.parametrize( + "identity, message, head_block", + [ + ("bootstrap1", "msg1", False), + ("bootstrap2", "msg2", False), + ("bootstrap3", "msg3", True), + ("bootstrap4", "msg4", True), + ], + ) + def test_fail_inject_signed_arbitrary_ope( + self, client, identity, message, head_block + ): + if head_block: + signature = client.sign_message(message, identity, block="head") + else: + signature = client.sign_message(message, identity) + chain_id = client.rpc('get', '/chains/main/chain_id') + head_hash = client.rpc('get', '/chains/main/blocks/head/hash') + run_json = { + 'operation': { + "branch": head_hash, + "contents": [ + { + "kind": "failing_noop", + "arbitrary": bytes(message, 'utf-8').hex(), + } + ], + 'signature': signature, + }, + 'chain_id': chain_id, + } + run_operation_path = ( + '/chains/main/blocks/head/helpers/scripts/run_operation' + ) + with assert_run_failure( + 'A failing_noop operation can never be validated' + ): + client.rpc('post', run_operation_path, data=run_json) + + def test_gen_keys(self, client: Client, session): + session['keys'] = ['foo', 'bar', 'boo'] + sigs = [None, 'secp256k1', 'ed25519'] + for key, sig in zip(session['keys'], sigs): + args = [] if sig is None else ['--sig', sig] + client.gen_key(key, args) + + def test_transfers(self, client: Client, session): + client.transfer(1000, 'bootstrap1', session['keys'][0], TRANSFER_ARGS) + utils.bake(client) + client.transfer(2000, 'bootstrap1', session['keys'][1], TRANSFER_ARGS) + utils.bake(client) + client.transfer(3000, 'bootstrap1', session['keys'][2], TRANSFER_ARGS) + utils.bake(client) + + def test_balances(self, client: Client, session): + assert client.get_balance(session['keys'][0]) == 1000 + assert client.get_balance(session['keys'][1]) == 2000 + assert client.get_balance(session['keys'][2]) == 3000 + + def test_transfer_bar_foo(self, client: Client, session): + client.reveal(session['keys'][1], ['--fee', '0', '--force-low-fee']) + utils.bake(client) + client.transfer( + 1000, + session['keys'][1], + session['keys'][0], + ['--fee', '0', '--force-low-fee'], + ) + utils.bake(client) + + def test_balances_bar_foo(self, client: Client, session): + assert client.get_balance(session['keys'][0]) == 2000 + assert client.get_balance(session['keys'][1]) == 1000 + + def test_transfer_foo_bar(self, client: Client, session): + client.reveal(session['keys'][0], ['--fee', '0', '--force-low-fee']) + utils.bake(client) + client.transfer( + 1000, session['keys'][0], session['keys'][1], ['--fee', '0.05'] + ) + utils.bake(client) + + def test_balances_foo_bar(self, client: Client, session): + # 999.95 = 1000 - transfer fees + assert client.get_balance(session['keys'][0]) == 999.95 + assert client.get_balance(session['keys'][1]) == 2000 + + def test_transfer_failure(self, client: Client, session): + with pytest.raises(Exception): + client.transfer(999.95, session['keys'][0], session['keys'][1]) + + def test_originate_contract_noop(self, client: Client): + contract = path.join(CONTRACT_PATH, 'opcodes', 'noop.tz') + client.remember('noop', contract) + client.typecheck(contract) + client.originate( + 'noop', 1000, 'bootstrap1', contract, ['--burn-cap', '0.295'] + ) + utils.bake(client) + + def test_transfer_to_noop(self, client: Client): + client.transfer(10, 'bootstrap1', 'noop', ['--arg', 'Unit']) + utils.bake(client) + + def test_contract_hardlimit(self, client: Client): + contract = path.join(CONTRACT_PATH, 'mini_scenarios', 'hardlimit.tz') + client.originate( + 'hardlimit', + 1000, + 'bootstrap1', + contract, + ['--init', '3', '--burn-cap', '0.341'], + ) + utils.bake(client) + client.transfer(10, 'bootstrap1', 'hardlimit', ['--arg', 'Unit']) + utils.bake(client) + client.transfer(10, 'bootstrap1', 'hardlimit', ['--arg', 'Unit']) + utils.bake(client) + + def test_transfers_bootstraps5_bootstrap1(self, client: Client): + bootstrap5 = constants.IDENTITIES['bootstrap5']['identity'] + all_deposits = client.frozen_deposits(bootstrap5) + balance = client.get_mutez_balance('bootstrap5') + assert balance + all_deposits == utils.mutez_of_tez(4000000.0) + client.transfer( + 400000, + 'bootstrap5', + 'bootstrap1', + ['--fee', '0', '--force-low-fee'], + ) + utils.bake(client) + client.transfer( + 400000, + 'bootstrap1', + 'bootstrap5', + ['--fee', '0', '--force-low-fee'], + ) + utils.bake(client) + all_deposits = client.frozen_deposits(bootstrap5) + assert client.get_mutez_balance( + 'bootstrap5' + ) + all_deposits == utils.mutez_of_tez(4000000.0) + + def test_activate_accounts(self, client: Client, session): + account = f"{ACCOUNT_PATH}/king_commitment.json" + session['keys'] += ['king', 'queen'] + client.activate_account(session['keys'][3], account) + utils.bake(client) + account = f"{ACCOUNT_PATH}/queen_commitment.json" + client.activate_account(session['keys'][4], account) + utils.bake(client) + assert client.get_balance(session['keys'][3]) == 23932454.669343 + assert client.get_balance(session['keys'][4]) == 72954577.464032 + + def test_transfer_king_queen(self, client: Client, session): + keys = session['keys'] + client.transfer(10, keys[3], keys[4], TRANSFER_ARGS) + utils.bake(client) + + def test_duplicate_alias(self, client: Client): + client.add_address("baz", "foo", force=True) + show_foo = client.show_address("foo", show_secret=True) + assert show_foo.secret_key is not None + + +@pytest.mark.incremental +class TestRememberContract: + @pytest.mark.parametrize( + "contract_name,non_originated_contract_address", + [ + ("test", "KT1BuEZtb68c1Q4yjtckcNjGELqWt56Xyesc"), + ("test-2", "KT1TZCh8fmUbuDqFxetPWC2fsQanAHzLx4W9"), + ], + ) + def test_non_originated_contract_no_forcing_not_saved_before( + self, + client, + contract_name, + non_originated_contract_address, + ): + client.remember_contract(contract_name, non_originated_contract_address) + + # As it is always the same client, the contracts have been saved + # before + @pytest.mark.parametrize( + "contract_name,non_originated_contract_address", + [ + ("test", "KT1BuEZtb68c1Q4yjtckcNjGELqWt56Xyesc"), + ("test-2", "KT1TZCh8fmUbuDqFxetPWC2fsQanAHzLx4W9"), + ], + ) + def test_non_originated_contract_with_forcing_and_saved_before( + self, + client, + contract_name, + non_originated_contract_address, + ): + client.remember_contract( + contract_name, non_originated_contract_address, force=True + ) + + # As it is always the same client, the contracts have been saved + # before + @pytest.mark.parametrize( + "contract_name,non_originated_contract_address", + [ + ("test", "KT1BuEZtb68c1Q4yjtckcNjGELqWt56Xyesc"), + ("test-2", "KT1TZCh8fmUbuDqFxetPWC2fsQanAHzLx4W9"), + ], + ) + def test_non_originated_contract_no_forcing_and_saved_before( + self, + client, + contract_name, + non_originated_contract_address, + ): + expected_error = f"The contract alias {contract_name} already exists" + + with assert_run_failure(expected_error): + client.remember_contract( + contract_name, non_originated_contract_address, force=False + ) + + # Test operation size. + def test_operation_size_originate_byte_contract(self, client: Client): + contract = path.join(CONTRACT_PATH, 'opcodes', 'bytes.tz') + client.remember('bytes', contract) + client.typecheck(contract) + client.originate( + 'bytes', 1000, 'bootstrap1', contract, ['--burn-cap', '0.295'] + ) + utils.bake(client) + + # Test that operations under 16KB can be injected in the node. + def test_operation_size_small(self, client: Client): + bytes_arg = "0x" + ("00" * 6 * 1024) # 6 KB of data. + + client.transfer(10, 'bootstrap1', 'bytes', ['--arg', bytes_arg]) + utils.bake(client) + + # Test that operations between 16KB and 32KB can be injected in the node. + def test_operation_size_medium(self, client: Client): + bytes_arg = "0x" + ("00" * 24 * 1024) # 24 KB of data. + + client.transfer(10, 'bootstrap1', 'bytes', ['--arg', bytes_arg]) + utils.bake(client) + + # Test that operations above 32KB fail to be injected. + def test_operation_size_oversized(self, client: Client): + bytes_arg = "0x" + ("00" * 36 * 1024) # 36 KB of data. + + expected_error = "Oversized operation" + with assert_run_failure(expected_error): + client.transfer(10, 'bootstrap1', 'bytes', ['--arg', bytes_arg]) + + # Test operation size with various data types. + def test_operation_size_originate_munch_contract(self, client: Client): + contract = path.join(CONTRACT_PATH, 'opcodes', 'munch.tz') + client.remember('munch', contract) + client.typecheck(contract) + client.originate( + 'munch', 1000, 'bootstrap1', contract, ['--burn-cap', '0.295'] + ) + utils.bake(client) + + # Test that a large operation under 32KB can be injected in the node + # (variant using a lambda with deep nesting). + def test_operation_size_with_lambda_ok(self, client: Client): + # Each pair of braces is encoded on 5 bytes so this takes + # 5 * 6 * 1024 = 30 KB < 32KB + big_arg = ("{" * 6 * 1024) + ("}" * 6 * 1024) + + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "lambda"], + ) + utils.bake(client) + + # Test that a large operation over 32KB cannot be injected in the node, + # and the error is not a stack overflow + # (variant using a lambda with deep nesting). + def test_operation_size_with_lambda_fail(self, client: Client): + # Each pair of braces is encoded on 5 bytes so this takes + # 5 * 7 * 1024 = 35 KB > 32KB + big_arg = ("{" * 7 * 1024) + ("}" * 7 * 1024) + + expected_error = "Oversized operation" + with assert_run_failure(expected_error): + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "lambda"], + ) + + # Test that a large operation under 32KB can be injected in the node + # (variant using a long list). + def test_operation_size_with_list_ok(self, client: Client): + # Each element in the list takes 2 bytes so about 30KB in total + big_arg = "{" + ("0; " * 15 * 1024) + "}" + + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "list_nat"], + ) + utils.bake(client) + + def test_operation_size_with_list_syntax_error(self, client: Client): + # Each element in the list takes 2 bytes so about 30KB in total + big_arg = "{" + ("0; " * 15 * 1024) + "'foo;'" + "}" + + expected_error = "transfer simulation failed" + with assert_run_failure(expected_error): + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "list_nat"], + ) + + def test_operation_size_with_list_ill_typed(self, client: Client): + # Each element in the list takes 2 bytes so about 30KB in total + big_arg = "{" + ("0; " * 15 * 1024) + "Unit;" + "}" + + expected_error = "transfer simulation failed" + with assert_run_failure(expected_error): + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "list_nat"], + ) + + # Test that a large operation over 32KB cannot be injected in the node, + # and the error is not a stack overflow + # (variant using a long list). + def test_operation_size_with_list_fail(self, client: Client): + # Each element in the list takes 2 bytes so about 34KB in total + big_arg = "{" + ("0; " * 17 * 1024) + "}" + + expected_error = "Oversized operation" + with assert_run_failure(expected_error): + client.transfer( + 10, + 'bootstrap1', + 'munch', + ['--arg', big_arg, "--entrypoint", "list_nat"], + ) diff --git a/tests_python/tests_016/test_binaries.py b/tests_python/tests_016/test_binaries.py new file mode 100644 index 000000000000..384b6c45e2b2 --- /dev/null +++ b/tests_python/tests_016/test_binaries.py @@ -0,0 +1,47 @@ +""" +Tests common utility functionality of binaries shipped with Tezos. +""" + +import subprocess +from typing import List + +from process import process_utils +from tools import paths +from . import protocol + + +PROTO_BINARIES = [ + binary + "-" + protocol.DAEMON + for binary in ["octez-baker", "octez-accuser"] +] + +BINARIES = [ + "octez-codec", + "octez-client", + "octez-admin-client", + "octez-protocol-compiler", + "octez-node", + "octez-snoop", +] + PROTO_BINARIES + + +def run_cmd(cmd: List[str]) -> str: + """Pretty print a command. Execute it, print and return its standard + output.""" + print(process_utils.format_command(cmd)) + process_ret = subprocess.run( + cmd, check=True, capture_output=True, text=True + ) + print(process_ret.stdout) + return process_ret.stdout.strip() + + +class TestBinaries: + def test_version(self): + """Tests that all binaries accept the --version flag and that the + report the same version""" + versions = set() + for binary in BINARIES: + version = run_cmd([paths.TEZOS_HOME + binary, "--version"]) + versions.add(version) + assert len(versions) == 1, "All binaries should report the same version" diff --git a/tests_python/tests_016/test_client.py b/tests_python/tests_016/test_client.py new file mode 100644 index 000000000000..45230c0ab4fe --- /dev/null +++ b/tests_python/tests_016/test_client.py @@ -0,0 +1,35 @@ +import pytest +from client.client import Client +from tools.utils import assert_run_failure, bake + + +@pytest.mark.client +@pytest.mark.incremental +@pytest.mark.usefixtures("encrypted_account_with_tez") +class TestSimulation: + """Tests the behavior of the --simulation flag.""" + + def test_transfer_simulation(self, client: Client): + """Tests that --simulation does not ask for the key password.""" + client.transfer( + 0.1, "encrypted_account", "bootstrap1", ["--simulation"] + ) + + def test_transfer_without_simulation(self, client: Client): + """Tests that the client asks for the password w/o --simulation.""" + with assert_run_failure("End_of_file", mode="stdout"): + client.transfer(0.1, "encrypted_account", "bootstrap1") + + def test_delegate_simulation(self, client: Client): + """Tests that --simulation does not ask for the key password.""" + client.gen_key("delegate") + client.transfer(100, "bootstrap1", "delegate", ["--burn-cap", "1.0"]) + bake(client, bake_for="bootstrap1") + client.register_delegate("delegate") + bake(client, bake_for="bootstrap1") + client.set_delegate("encrypted_account", "delegate", ["--simulation"]) + + def test_delegate_without_simulation(self, client: Client): + """Tests that the client asks for the password w/o --simulation.""" + with assert_run_failure("End_of_file", mode="stdout"): + client.set_delegate("encrypted_account", "delegate") diff --git a/tests_python/tests_016/test_client_without_node.py b/tests_python/tests_016/test_client_without_node.py new file mode 100644 index 000000000000..f07d0da3cc67 --- /dev/null +++ b/tests_python/tests_016/test_client_without_node.py @@ -0,0 +1,450 @@ +"""Node-less tests for the client. + +Some client tests do not require a node running, nor a +persistent mockup environment. These can be placed here. +""" +import json +import os +import subprocess +import tempfile +from typing import List, Optional +import pytest +from client.client import Client +from tools.utils import assert_run_failure + +# Note that specifying "endpoint" and "web_port" is required +# for the final assertion of test_config_init_roundtrip to pass. That's because +# `config init -o` writes them even if unspecified by `--config-file` +# (it's a fine behavior, I just wanted to highlight it). +_INPUT_CONFIG_FILE = { + "confirmations": 1, + "endpoint": "http://127.0.0.1:8732", + "remote_signer": "http://127.0.0.2", + "web_port": 8080, + "password_filename": "/tmp/doesnt_exist", +} +_INPUT_CONFIG_FILES = [None, _INPUT_CONFIG_FILE] +_CMD_LINE_ARGS = { + "--endpoint": "http://127.0.0.1:9732", + "--wait": "3", + "--remote-signer": "http://10.0.0.2", + "--password-filename": "/tmp/doesnt_exist_either", +} +_CONFIG_FILE_FLAG = "--config-file" + + +@pytest.mark.client +class TestImportKeyMnemonic: + """Checks that the keys are correctly imported from a mnemonic.""" + + @pytest.fixture + def mnemonic(self): + return ( + "seek paddle siege sting siege sick kidney " + + "detect coral because comfort long enforce napkin enter" + ) + + @pytest.fixture + def passphrase(self): + return "very_secure_passphrase" + + def test_import_simple(self, client: Client): + """Tests a simple import.""" + mnemonic = "release easy pulp drop select attack false math cook \ +angry spin ostrich round dress acoustic" + prms = ["import", "keys", "from", "mnemonic", "zebra", "--force"] + stdin = mnemonic + "\n\n" + client.run_generic(prms, stdin=stdin) + addr = client.get_known_addresses() + assert addr.wallet["zebra"] == "tz1aGUKE72eN21iWztoDEeH4FeKaxWb7SAUb" + + def test_import_already_present_alias(self, client: Client, mnemonic): + """Tests that importing fails if the alias is already present.""" + prms = [ + "import", + "keys", + "from", + "mnemonic", + "super_original", + "--force", + ] + stdin = mnemonic + "\n\n" + client.run_generic(prms, stdin=stdin) + prms = ["import", "keys", "from", "mnemonic", "super_original"] + expected_error = "The secret_key alias super_original already exists." + with assert_run_failure(expected_error): + client.run_generic(prms, stdin=stdin) + + def test_import_passphrase(self, client: Client, mnemonic, passphrase): + """Tests an import where the user specifies a passphrase.""" + stdin = mnemonic + "\n" + passphrase + "\n" + prms = ["import", "keys", "from", "mnemonic", "key", "--force"] + client.run_generic(prms, stdin=stdin) + addr = client.get_known_addresses() + assert addr.wallet["key"] == "tz1QSF4TSVzaosgbaxnFJpRbs7798Skeb8Re" + + def test_encrypted(self, client: Client, mnemonic, passphrase): + """Tests an import where the user wants to encrypt the key.""" + encrypt_pwd = "imgonnaencryptthiskeysohard" + stdin = ( + mnemonic + + "\n" + + passphrase + + "\n" + + encrypt_pwd + + "\n" + + encrypt_pwd + + "\n" + ) + prms = [ + "import", + "keys", + "from", + "mnemonic", + "cryptkey", + "--encrypt", + "--force", + ] + client.run_generic(prms, stdin=stdin) + addr = client.get_known_addresses() + pkh = addr.wallet["cryptkey"] + secret_key = client.show_address( + "cryptkey", show_secret=True + ).secret_key + assert secret_key is not None + assert secret_key.startswith("encrypted:") + assert pkh == "tz1QSF4TSVzaosgbaxnFJpRbs7798Skeb8Re" + + def test_gen_key_from_menmonic_bad_mnemonic(self, client: Client): + """Tests that the command fails if the user gives a bad mnemonic.""" + prms = ["import", "keys", "from", "mnemonic", "alias", "--force"] + stdin = "hello\n\n" + expected_error = '"hello" is not a valid BIP39 mnemonic.' + with assert_run_failure(expected_error): + client.run_generic(prms, stdin=stdin) + + +@pytest.mark.usefixtures("encrypted_account_with_tez") +class TestStopLoopPassword: + """Tests that the client stops asking for the password after + three erroneous passwords given by the user""" + + @pytest.mark.parametrize('stdin', ["\n\n\n", "\n\n\nign", "\n\n\npassword"]) + def test_stops_after_three_tries(self, client: Client, stdin): + with assert_run_failure("3 incorrect password attempt"): + client.transfer(0.1, 'encrypted_account', 'bootstrap1', stdin=stdin) + + @pytest.mark.parametrize( + 'stdin', ["password\n", "\npassword\n", "\n\npassword\n"] + ) + def test_password_succeed_before_three_tries(self, client: Client, stdin): + client.transfer(0.1, 'encrypted_account', 'bootstrap1', stdin=stdin) + + +@pytest.mark.client +class TestChainId: + def test_chain_id_block_hash(self, nodeless_client: Client): + block_hash = 'BKyFui5WPY1n3e9aKF3qd2kGBKBtHu3rtm5miYFnUagJC1BdHTF' + prms = ['compute', 'chain', 'id', 'from', 'block', 'hash', block_hash] + assert nodeless_client.run(prms).strip() == 'NetXuwrXPL4VeX5' + + def test_chain_id_seed(self, nodeless_client: Client): + seed = 'choucroute' + prms = ['compute', 'chain', 'id', 'from', 'seed', seed] + assert nodeless_client.run(prms).strip() == 'NetXLGmPi3c5DXf' + + +def _write_config_file( + client: Client, filename: str, config_dict: Optional[dict] +): + """Writes `config_dict` to `filename`. Returns the json effectively + written""" + assert client is not None + assert filename is not None + assert config_dict is not None + + augmented_dict = dict(config_dict) # Copy for safety + # We need to set base_dir, it's required in the config file + augmented_dict["base_dir"] = client.base_dir + with open(filename, 'w') as handle: + json.dump(augmented_dict, handle) + + return augmented_dict + + +def _with_config_file_cmd(config_file: Optional[str], cmd: List[str]): + """Prefixes `cmd` with ["--config-file", config_file] if + config_file is not None""" + return ([_CONFIG_FILE_FLAG, config_file] if config_file else []) + cmd + + +def _gen_assert_msg(flag, sent, received): + result = f"Json sent with --{flag} differs from" + result += " json received" + result += f"\nJson sent is:\n{sent}" + result += f"\nwhile json received is:\n{received}" + + +@pytest.mark.client +@pytest.mark.parametrize('config_dict', _INPUT_CONFIG_FILES) +class TestConfigInit: + def test_config_init( + self, nodeless_client: Client, config_dict: Optional[dict] + ): + """ + Tests that calling + `[--config-file config_dict]? config init -o tmp_file` + works and yields valid json. + """ + try: + out_file = tempfile.mktemp(prefix='octez-client.config_file') + in_file = None + + if config_dict is not None: + in_file = tempfile.mktemp(prefix='octez-client.config_file') + _write_config_file(nodeless_client, in_file, config_dict) + + cmd = _with_config_file_cmd( + in_file, ["config", "init", "-o", out_file] + ) + nodeless_client.run(cmd) + # Try loading the file as json, to check it is valid + with open(out_file) as handle: + json.load(handle) + finally: + if in_file is not None: + os.remove(in_file) + os.remove(out_file) + + def test_config_init_roundtrip( + self, nodeless_client: Client, config_dict: Optional[dict] + ): + """Tests that calling `config init -o tmp_file` and + feeding its result to `octez-client --config-file` works + and yields the same result (i.e. calling `octez-client + --config-file tmp_file config init -o tmp_file2 yields + a `tmp_file2` that is similar to `tmp_file`). + + `config_dict` specifies the content of the initial config file + to use or None not to specify one. + """ + try: + if config_dict is None: + # Take initial json from default output of `config init` + + tmp_file1 = tempfile.mktemp(prefix='octez-client.config_file') + cmd = ["config", "init", "-o", tmp_file1] + nodeless_client.run(cmd) + with open(tmp_file1) as handle: + json1 = json.load(handle) + + # Execute an arbitrary effectless command: + list_protos = ["list", "understood", "protocols"] + # This checks that + # `--config-file tmp_file1 arbitrary command` works + cmd = _with_config_file_cmd(tmp_file1, list_protos) + nodeless_client.run(cmd) + else: + # Take initial json from config_dict + + # Write config_dict to a file + tmp_file1 = tempfile.mktemp(prefix='octez-client.config_file') + json1 = _write_config_file( + nodeless_client, tmp_file1, config_dict + ) + + # Execute `config init -o` + tmp_file2 = tempfile.mktemp(prefix='octez-client.config_file') + cmd = _with_config_file_cmd( + tmp_file1, ["config", "init", "-o", tmp_file2] + ) + nodeless_client.run(cmd) + + # Load file generated by `config init -o` + with open(tmp_file2) as handle: + json2 = json.load(handle) + + # and finally check that the json generated by `config init -o` + # matches the input data (either the default one or the one + # specified with --config-file) + assert json1 == json2, _gen_assert_msg( + _CONFIG_FILE_FLAG, json1, json2 + ) + finally: + os.remove(tmp_file1) + os.remove(tmp_file2) + + +def _cmd_line_flag_to_json_field(cmd_line_flag: str): + if cmd_line_flag == "--wait": + return "confirmations" + result = cmd_line_flag + if cmd_line_flag.startswith("--"): + result = result[2:] + return result.replace("-", "_") + + +@pytest.mark.client +@pytest.mark.parametrize('config_dict', _INPUT_CONFIG_FILES) +class TestConfigShow: + """Tests of `octez-client config show`""" + + def test_config_show( + self, nodeless_client: Client, config_dict: Optional[dict] + ): + """ + Tests that calling `config show` works, with or without + specifying `--config-file` + """ + try: + tmp_file = None + if config_dict is not None: + tmp_file = tempfile.mktemp(prefix='octez-client.config_file') + _write_config_file(nodeless_client, tmp_file, config_dict) + + cmd = _with_config_file_cmd(tmp_file, ["config", "show"]) + nodeless_client.run(cmd) + finally: + if tmp_file is not None: + os.remove(tmp_file) + + @pytest.mark.parametrize('cmd_line_args', [{}, _CMD_LINE_ARGS]) + def test_config_show_roundtrip( + self, + nodeless_client: Client, + config_dict: Optional[dict], + cmd_line_args: dict, + ): + """ + Tests calling `config show` with or without `--config-file` + and with some command line parameters (`cmd_line_arg`). It + then parses the output to check its valid json and to check + that command line parameters were honored. + + Then it feeds this output to a new call to `--config-file file + config show` and checks that the json returned by this second call + agrees with what was specified by `file`. + + This is a roundtrip test using a small matrix. + """ + try: + in_file1 = None + in_file2 = None + if config_dict is not None: + in_file1 = tempfile.mktemp(prefix='octez-client.config_file') + _write_config_file(nodeless_client, in_file1, config_dict) + + cmd = [] + # Pass command line parameters + for (flag, value) in cmd_line_args.items(): + cmd += [flag, value] + cmd += ["config", "show"] + cmd = _with_config_file_cmd(in_file1, cmd) + # Take standard output + (stdout, _, _) = nodeless_client.run_generic(cmd) + + output_json1 = json.loads(stdout) + # Verify that command line parameters were honored + for (flag, value) in cmd_line_args.items(): + input_value = cmd_line_args[flag] + assert isinstance(input_value, str) + output_value = output_json1[_cmd_line_flag_to_json_field(flag)] + output_value = str(output_value) + err_msg = ( + f"Value of command line flag {flag} is not honored:" + f" passed {input_value} but" + f" config show yielded {output_value}" + ) + assert output_value == input_value, err_msg + in_file2 = tempfile.mktemp(prefix='octez-client.config_file') + # Write output of first call to `config show` to disk, + # to pass it to second call below + with open(in_file2, 'w') as handle: + handle.write(json.dumps(output_json1)) + + # Use previous ouput file as input now + cmd = _with_config_file_cmd(in_file2, ["config", "show"]) + (stdout, _, _) = nodeless_client.run_generic(cmd) + + output_json2 = json.loads(stdout) + + # And finally check that the final output matches the input + assert output_json1 == output_json2, _gen_assert_msg( + _CONFIG_FILE_FLAG, output_json1, output_json2 + ) + finally: + for in_file in [in_file1, in_file2]: + if in_file is not None: + os.remove(in_file) + + +@pytest.mark.client +class TestConfigValid: + """Tests of validity of octez-client config""" + + def test_config_node_port(self, nodeless_client: Client): + """ + Tests that calling `config show` works, with a valid node port + """ + self._run_config_show_with_node_port(nodeless_client, 8732) + self._run_config_show_with_node_port(nodeless_client, 58732) + pytest.raises( + subprocess.CalledProcessError, + self._run_config_show_with_node_port, + nodeless_client, + 158732, + ) + pytest.raises( + subprocess.CalledProcessError, + self._run_config_show_with_node_port, + nodeless_client, + -8732, + ) + + def test_config_web_port(self, nodeless_client: Client): + """ + Tests that calling `config show` works, with a valid node port + """ + self._run_config_show_with_web_port(nodeless_client, 8732) + self._run_config_show_with_web_port(nodeless_client, 58732) + pytest.raises( + subprocess.CalledProcessError, + self._run_config_show_with_web_port, + nodeless_client, + 158732, + ) + pytest.raises( + subprocess.CalledProcessError, + self._run_config_show_with_web_port, + nodeless_client, + -8732, + ) + + def _run_config_show_with_temp_config_file( + self, nodeless_client: Client, config_dict: dict + ): + try: + tmp_file = tempfile.mktemp(prefix='octez-client.config_file') + _write_config_file(nodeless_client, tmp_file, config_dict) + + cmd = _with_config_file_cmd(tmp_file, ["config", "show"]) + nodeless_client.run(cmd) + finally: + if tmp_file is not None: + os.remove(tmp_file) + + def _run_config_show_with_node_port( + self, nodeless_client: Client, port: int + ): + config_dict = {"node_port": port} + self._run_config_show_with_temp_config_file( + nodeless_client, config_dict + ) + + def _run_config_show_with_web_port( + self, nodeless_client: Client, port: int + ): + config_dict = {"web_port": port} + self._run_config_show_with_temp_config_file( + nodeless_client, config_dict + ) diff --git a/tests_python/tests_016/test_contract.py b/tests_python/tests_016/test_contract.py new file mode 100644 index 000000000000..09bc5db1c214 --- /dev/null +++ b/tests_python/tests_016/test_contract.py @@ -0,0 +1,1146 @@ +import os +import pytest + +from client.client import Client +from tools import utils +from tools.constants import IDENTITIES +from tools.utils import originate +from .contract_paths import ( + CONTRACT_PATH, + ILLTYPED_CONTRACT_PATH, + all_legacy_contracts, +) + + +ID_SCRIPT_LITERAL = ''' +parameter unit; storage unit; code {CAR; NIL operation; PAIR} +'''.strip() +ID_SCRIPT_HASH = ''' +exprtpyospPfMqcARmu5FGukprC7kbbe4jb4zxFd4Gxrp2vcCPjRNa +'''.strip() + + +@pytest.mark.contract +@pytest.mark.incremental +class TestManager: + def test_manager_origination(self, client: Client, session: dict): + path = os.path.join(CONTRACT_PATH, 'entrypoints', 'manager.tz') + pubkey = IDENTITIES['bootstrap2']['identity'] + originate(client, session, path, f'"{pubkey}"', 1000) + originate( + client, session, path, f'"{pubkey}"', 1000, contract_name="manager2" + ) + + def test_delegatable_origination(self, client: Client, session: dict): + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'delegatable_target.tz' + ) + pubkey = IDENTITIES['bootstrap2']['identity'] + originate( + client, session, path, f'Pair "{pubkey}" (Pair "hello" 45)', 1000 + ) + + def test_target_with_entrypoints_origination(self, client: Client, session): + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'big_map_entrypoints.tz' + ) + originate( + client, session, path, 'Pair {} {}', 1000, contract_name='target' + ) + + def test_target_without_entrypoints_origination( + self, client: Client, session + ): + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'no_entrypoint_target.tz' + ) + originate( + client, + session, + path, + 'Pair "hello" 42', + 1000, + contract_name='target_no_entrypoints', + ) + + def test_target_without_default_origination(self, client: Client, session): + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'no_default_target.tz' + ) + originate( + client, + session, + path, + 'Pair "hello" 42', + 1000, + contract_name='target_no_default', + ) + + def test_target_with_root_origination(self, client: Client, session): + path = os.path.join(CONTRACT_PATH, 'entrypoints', 'rooted_target.tz') + originate( + client, + session, + path, + 'Pair "hello" 42', + 1000, + contract_name='rooted_target', + ) + + def test_manager_set_delegate(self, client: Client): + client.set_delegate('manager', 'bootstrap2', []) + utils.bake(client, bake_for='bootstrap5') + bootstrap2_pkh = IDENTITIES['bootstrap2']['identity'] + client.set_delegate('delegatable_target', bootstrap2_pkh, []) + utils.bake(client, bake_for='bootstrap5') + delegate = IDENTITIES['bootstrap2']['identity'] + assert client.get_delegate('manager', []).delegate == delegate + assert ( + client.get_delegate('delegatable_target', []).delegate == delegate + ) + client.set_delegate('manager', 'bootstrap3', []) + utils.bake(client, bake_for='bootstrap5') + client.set_delegate('delegatable_target', 'bootstrap3', []) + utils.bake(client, bake_for='bootstrap5') + delegate = IDENTITIES['bootstrap3']['identity'] + assert client.get_delegate('manager', []).delegate == delegate + assert ( + client.get_delegate('delegatable_target', []).delegate == delegate + ) + + def test_manager_withdraw_delegate(self, client: Client): + client.withdraw_delegate('manager', []) + utils.bake(client, bake_for='bootstrap5') + client.withdraw_delegate('delegatable_target', []) + utils.bake(client, bake_for='bootstrap5') + assert client.get_delegate('manager', []).delegate is None + assert client.get_delegate('delegatable_target', []).delegate is None + + def test_transfer_to_manager(self, client: Client): + balance = client.get_mutez_balance('manager') + balance_bootstrap = client.get_mutez_balance('bootstrap2') + amount = 10.001 + amount_mutez = utils.mutez_of_tez(amount) + client.transfer( + amount, + 'bootstrap2', + 'manager', + ['--gas-limit', f'{128 * 15450 + 108}'], + ) + utils.bake(client, bake_for='bootstrap5') + new_balance = client.get_mutez_balance('manager') + new_balance_bootstrap = client.get_mutez_balance('bootstrap2') + fee = 0.000382 + fee_mutez = utils.mutez_of_tez(fee) + assert balance + amount_mutez == new_balance + assert ( + balance_bootstrap - fee_mutez - amount_mutez + == new_balance_bootstrap + ) + + def test_simple_transfer_from_manager_to_implicit(self, client: Client): + balance = client.get_mutez_balance('manager') + balance_bootstrap = client.get_mutez_balance('bootstrap2') + amount = 10.1 + amount_mutez = utils.mutez_of_tez(amount) + client.transfer( + amount, + 'manager', + 'bootstrap2', + ['--gas-limit', f'{128 * 26350 + 12}'], + ) + utils.bake(client, bake_for='bootstrap5') + new_balance = client.get_mutez_balance('manager') + new_balance_bootstrap = client.get_mutez_balance('bootstrap2') + fee = 0.000542 + fee_mutez = utils.mutez_of_tez(fee) + assert balance - amount_mutez == new_balance + assert ( + balance_bootstrap + amount_mutez - fee_mutez + == new_balance_bootstrap + ) + + def test_transfer_from_manager_to_manager(self, client: Client): + balance = client.get_mutez_balance('manager') + balance_dest = client.get_mutez_balance('manager2') + balance_bootstrap = client.get_mutez_balance('bootstrap2') + amount = 10 + amount_mutez = utils.mutez_of_tez(amount) + client.transfer( + amount, + 'manager', + 'manager2', + ['--gas-limit', f'{128 * 44950 + 112}'], + ) + utils.bake(client, bake_for='bootstrap5') + new_balance = client.get_mutez_balance('manager') + new_balance_dest = client.get_mutez_balance('manager2') + new_balance_bootstrap = client.get_mutez_balance('bootstrap2') + fee = 0.000731 + fee_mutez = utils.mutez_of_tez(fee) + assert balance - amount_mutez == new_balance + assert balance_dest + amount_mutez == new_balance_dest + assert balance_bootstrap - fee_mutez == new_balance_bootstrap + + def test_transfer_from_manager_to_default(self, client: Client): + client.transfer( + 10, 'manager', 'bootstrap2', ['--entrypoint', 'default'] + ) + utils.bake(client, bake_for='bootstrap5') + client.transfer(10, 'manager', 'manager', ['--entrypoint', 'default']) + utils.bake(client, bake_for='bootstrap5') + + def test_transfer_from_manager_to_target(self, client: Client): + client.transfer(10, 'manager', 'target', ['--burn-cap', '0.356']) + utils.bake(client, bake_for='bootstrap5') + + def test_transfer_from_manager_to_entrypoint_with_args( + self, client: Client + ): + arg = 'Pair "hello" 42' + # using 'transfer' + client.transfer( + 0, + 'manager', + 'target', + ['--entrypoint', 'add_left', '--arg', arg, '--burn-cap', '0.067'], + ) + utils.bake(client, bake_for='bootstrap5') + client.transfer( + 0, + 'manager', + 'target', + ['--entrypoint', 'mem_left', '--arg', '"hello"'], + ) + utils.bake(client, bake_for='bootstrap5') + + # using 'call' + client.call( + 'manager', + 'target', + ['--entrypoint', 'add_left', '--arg', arg, '--burn-cap', '0.067'], + ) + utils.bake(client, bake_for='bootstrap5') + client.call( + 'manager', + 'target', + ['--entrypoint', 'mem_left', '--arg', '"hello"'], + ) + utils.bake(client, bake_for='bootstrap5') + + def test_transfer_from_manager_no_entrypoint_with_args( + self, client: Client + ): + arg = 'Left Unit' + client.transfer(0, 'manager', 'target_no_entrypoints', ['--arg', arg]) + utils.bake(client, bake_for='bootstrap5') + + client.call('manager', 'target_no_entrypoints', ['--arg', arg]) + utils.bake(client, bake_for='bootstrap5') + + def test_transfer_from_manager_to_no_default_with_args( + self, client: Client + ): + arg = 'Left Unit' + client.transfer(0, 'manager', 'target_no_default', ['--arg', arg]) + utils.bake(client, bake_for='bootstrap5') + + client.call('manager', 'target_no_default', ['--arg', arg]) + utils.bake(client, bake_for='bootstrap5') + + def test_transfer_from_manager_to_rooted_target_with_args( + self, client: Client + ): + arg = 'Left Unit' + client.transfer( + 0, + 'manager', + 'rooted_target', + ['--arg', arg, '--entrypoint', 'root'], + ) + utils.bake(client, bake_for='bootstrap5') + + client.call( + 'manager', 'rooted_target', ['--arg', arg, '--entrypoint', 'root'] + ) + utils.bake(client, bake_for='bootstrap5') + + +@pytest.mark.slow +@pytest.mark.contract +class TestContracts: + """Test type checking errors""" + + @pytest.mark.parametrize("contract", all_legacy_contracts()) + def test_deprecated_typecheck_breaks(self, client, contract): + if contract in [ + "legacy/create_contract.tz", + "legacy/create_contract_flags.tz", + "legacy/create_contract_rootname.tz", + ]: + with utils.assert_run_failure(r'ill-typed script'): + client.typecheck(os.path.join(CONTRACT_PATH, contract)) + else: + with utils.assert_run_failure(r'Use of deprecated instruction'): + client.typecheck(os.path.join(CONTRACT_PATH, contract)) + + @pytest.mark.parametrize("contract", all_legacy_contracts()) + def test_deprecated_typecheck_in_legacy(self, client, contract): + if contract in [ + "legacy/create_contract.tz", + "legacy/create_contract_flags.tz", + "legacy/create_contract_rootname.tz", + ]: + with utils.assert_run_failure(r'ill-typed script'): + client.typecheck( + os.path.join(CONTRACT_PATH, contract), legacy=True + ) + else: + with utils.assert_run_failure(r'Use of deprecated instruction'): + client.typecheck( + os.path.join(CONTRACT_PATH, contract), legacy=True + ) + + @pytest.mark.parametrize( + "contract,error_pattern", + [ + # Even though the interpreter uses a nonempty stack internally, + # the typechecker should not be able to observe it. + ( + "stack_bottom_unfailwithable.tz", + r'wrong stack type for instruction FAILWITH', + ), + ( + "stack_bottom_unrightable.tz", + r'wrong stack type for instruction RIGHT', + ), + ( + "stack_bottom_unleftable.tz", + r'wrong stack type for instruction LEFT', + ), + ( + "stack_bottom_ungetable.tz", + r'wrong stack type for instruction GET', + ), + ( + "stack_bottom_unpairable.tz", + r'wrong stack type for instruction UNPAIR', + ), + ( + "stack_bottom_undug2able.tz", + r'wrong stack type for instruction DUG', + ), + ( + "stack_bottom_undugable.tz", + r'wrong stack type for instruction DUG', + ), + ( + "stack_bottom_undig2able.tz", + r'wrong stack type for instruction DIG', + ), + ( + "stack_bottom_undigable.tz", + r'wrong stack type for instruction DIG', + ), + ( + "stack_bottom_undip2able.tz", + r'wrong stack type for instruction DUP', + ), + ( + "stack_bottom_undipable.tz", + r'wrong stack type for instruction DUP', + ), + ( + "stack_bottom_undup2able.tz", + r'wrong stack type for instruction DUP', + ), + ( + "stack_bottom_undropable.tz", + r'wrong stack type for instruction DROP', + ), + ( + "stack_bottom_unpopable.tz", + r'wrong stack type for instruction DUP', + ), + ( + "stack_bottom_unpopable_in_lambda.tz", + r'wrong stack type for instruction DUP', + ), + # operations cannot be PACKed + ( + "pack_operation.tz", + r'operation type forbidden in parameter, storage and constants', + ), + # big_maps cannot be PACKed + ( + "pack_big_map.tz", + r'big_map or sapling_state type not expected here', + ), + ( + "invalid_self_entrypoint.tz", + r'Contract has no entrypoint named D', + ), + ( + "contract_annotation_default.tz", + r'unexpected_default_entrypoint', + ), + # Missing field + ( + "missing_only_storage_field.tz", + r'Missing contract field: storage', + ), + ("missing_only_code_field.tz", r'Missing contract field: code'), + ( + "missing_only_parameter_field.tz", + r'Missing contract field: parameter', + ), + ( + "missing_parameter_and_storage_fields.tz", + r'Missing contract field: parameter', + ), + # Duplicated field + ( + "multiple_parameter_field.tz", + r'duplicate contract field: parameter', + ), + ("multiple_code_field.tz", r'duplicate contract field: code'), + ("multiple_storage_field.tz", r'duplicate contract field: storage'), + # The first duplicated field is reported, storage in this case + ( + "multiple_storage_and_code_fields.tz", + r'duplicate contract field: storage', + ), + # error message for set update on non-comparable type + ( + "set_update_non_comparable.tz", + r'Type nat\s+is not compatible with type list operation', + ), + # error message for the arity of the chain_id type + ( + "chain_id_arity.tz", + r'primitive chain_id expects 0 arguments but is given 1', + ), + # error message for DIP over the limit + ("big_dip.tz", r'expected a positive 10-bit integer'), + # error message for DROP over the limit + ("big_drop.tz", r'expected a positive 10-bit integer'), + # error message for attempting to push a value of type never + ("never_literal.tz", r'type never has no inhabitant.'), + # COMB, UNCOMB, and DUP cannot take 0 as argument + ("comb0.tz", r"PAIR expects an argument of at least 2"), + ("comb1.tz", r"PAIR expects an argument of at least 2"), + ("uncomb0.tz", r"UNPAIR expects an argument of at least 2"), + ("uncomb1.tz", r"UNPAIR expects an argument of at least 2"), + ("dup0.tz", r"DUP n expects an argument of at least 1"), + ( + "push_big_map_with_id_with_parens.tz", + r"big_map or sapling_state type not expected here", + ), + ( + "push_big_map_with_id_without_parens.tz", + r"primitive PUSH expects 2 arguments but is given 4", + ), + # sapling_state is not packable + ( + "pack_sapling_state.tz", + r"big_map or sapling_state type not expected here", + ), + # sapling_state is not packable + ( + "unpack_sapling_state.tz", + r"big_map or sapling_state type not expected here", + ), + # Ticket duplication attempt + ( + "ticket_dup.tz", + r'ticket nat cannot be used here because it is not duplicable', + ), + # error message for ticket unpack + ("ticket_unpack.tz", r'Ticket in unauthorized position'), + # error message for attempting to use APPLY to capture a ticket + ("ticket_apply.tz", r'Ticket in unauthorized position'), + # error message for attempting to wrap a ticket in a ticket + ( + "ticket_in_ticket.tz", + r'comparable type expected.Type ticket unit is not comparable', + ), + # error message for DIP { FAILWITH } + ( + "dip_failwith.tz", + r'The FAIL instruction must appear in a tail position.', + ), + # error message for MAP { FAILWITH } + ( + "map_failwith.tz", + r'The proper type of the return list cannot be inferred.', + ), + ], + ) + def test_ill_typecheck(self, client: Client, contract, error_pattern): + with utils.assert_run_failure(error_pattern): + client.typecheck(os.path.join(ILLTYPED_CONTRACT_PATH, contract)) + + def test_zero_transfer_to_implicit_contract(self, client): + pubkey = IDENTITIES['bootstrap3']['identity'] + err = ( + 'Transactions of 0ꜩ towards a contract without code are ' + rf'forbidden \({pubkey}\).' + ) + with utils.assert_run_failure(err): + client.transfer(0, 'bootstrap2', 'bootstrap3', []) + + def test_zero_transfer_to_nonexistent_contract(self, client): + nonexistent = "KT1Fcq4inD44aMhmUiTEHR1QMQwJT7p2u641" + err = rf'Contract {nonexistent} does not exist' + with utils.assert_run_failure(err): + client.transfer(0, 'bootstrap2', nonexistent, []) + + +@pytest.mark.incremental +@pytest.mark.contract +class TestView: + def test_deploy_view_lib(self, client, session): + path = f'{CONTRACT_PATH}/opcodes/view_toplevel_lib.tz' + originate(client, session, path, '3', 999) + session['lib'] = session['contract'] + client.bake('bootstrap3', ["--minimal-timestamp"]) + + @pytest.mark.parametrize( + "contract,init_storage,expected", + [ + ('view_op_id', '(Pair 0 0)', 'Pair 10 3'), + ('view_op_add', '42', '13'), + ('view_fib', '0', '55'), + ('view_mutual_recursion', '0', '20'), + ('view_op_nonexistent_func', 'True', 'False'), + ('view_op_nonexistent_addr', 'True', 'False'), + ('view_op_toplevel_inconsistent_input_type', '5', '0'), + ('view_op_toplevel_inconsistent_output_type', 'True', 'False'), + ], + ) + def test_runtime(self, client, session, contract, init_storage, expected): + path = f'{CONTRACT_PATH}/opcodes/' + contract + '.tz' + originate(client, session, path, init_storage, 0) + client.transfer( + 0, + 'bootstrap1', + contract, + [ + "--arg", + "(Pair 10 \"" + session['lib'] + "\")", + '--gas-limit', + '1000000', + "--burn-cap", + "0.1", + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + assert client.get_storage(contract) == expected + + def test_create_contract( + self, + client, + session, + ): + contract = 'create_contract_with_view' + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + originate(client, session, path, 'None', 0) + client.transfer( + 0, + 'bootstrap1', + contract, + [ + "--arg", + "Unit", + "--burn-cap", + "0.1", + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + + addr = client.get_storage(contract).split()[1] + contract = 'view_op_constant' + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + originate(client, session, path, '2', 0) + expected = "10" + + client.transfer( + 0, + "bootstrap1", + contract, + [ + "--arg", + f"(Pair {expected} {addr})", + "--burn-cap", + "0.1", + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + + assert client.get_storage(contract) == expected + + def test_step_constants(self, client, session): + contract = 'view_op_test_step_contants' + path = f'{CONTRACT_PATH}/opcodes/' + contract + '.tz' + originate(client, session, path, 'None', 0) + client.transfer( + 0, + 'bootstrap1', + contract, + [ + "--arg", + "\"" + session['lib'] + "\"", + '--gas-limit', + '5000', + "--burn-cap", + "0.1", + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + + source = IDENTITIES['bootstrap1']['identity'] + self_address = session['lib'] + sender = session['contract'] + expected = ( + 'Some (Pair (Pair 0 999000000)\n' + + ' (Pair "' + + self_address + + '" "' + + sender + + '")\n' + + ' "' + + source + + '")' + ) + + assert client.get_storage(contract) == expected + + @pytest.mark.parametrize( + "contract", + [ + 'self_after_view', + 'self_after_fib_view', + 'self_after_nonexistent_view', + ], + ) + def test_self(self, client, session, contract): + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + lib_address = session['lib'] + originate(client, session, path, f'"{lib_address}"', 1000) + client.bake('bootstrap2', ["--minimal-timestamp"]) + self_address = session['contract'] + client.transfer( + 0, + 'bootstrap1', + contract, + [ + '--arg', + f'"{lib_address}"', + '--burn-cap', + '0.1', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + assert client.get_storage(contract) == f'"{self_address}"' + + @pytest.mark.parametrize( + "contract", + [ + 'self_address_after_view', + 'self_address_after_fib_view', + 'self_address_after_nonexistent_view', + ], + ) + def test_self_address(self, client, session, contract): + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + lib_address = session['lib'] + originate(client, session, path, f'"{lib_address}"', 1000) + client.bake('bootstrap2', ["--minimal-timestamp"]) + self_address = session['contract'] + client.transfer( + 0, + 'bootstrap1', + contract, + [ + '--arg', + f'"{lib_address}"', + '--burn-cap', + '0.1', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + assert client.get_storage(contract) == f'"{self_address}"' + + @pytest.mark.parametrize( + "contract", + [ + 'sender_after_view', + 'sender_after_fib_view', + 'sender_after_nonexistent_view', + ], + ) + def test_sender(self, client, session, contract): + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + lib_address = session['lib'] + originate(client, session, path, f'"{lib_address}"', 1000) + client.bake('bootstrap2', ["--minimal-timestamp"]) + sender = IDENTITIES['bootstrap1']['identity'] + client.transfer( + 0, + 'bootstrap1', + contract, + [ + '--arg', + f'"{lib_address}"', + '--burn-cap', + '0.1', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + assert client.get_storage(contract) == f'"{sender}"' + + @pytest.mark.parametrize( + "contract", + [ + 'balance_after_view', + 'balance_after_fib_view', + 'balance_after_nonexistent_view', + ], + ) + def test_balance_after_view(self, client, session, contract): + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + lib_address = session['lib'] + initial_balance = 1000 + originate(client, session, path, '0', initial_balance) + client.bake('bootstrap2', ["--minimal-timestamp"]) + amount = 10 + client.transfer( + amount, + 'bootstrap1', + contract, + [ + '--arg', + f'"{lib_address}"', + '--burn-cap', + '0.1', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + expected_balance = initial_balance + amount + assert ( + client.get_storage(contract) + == f'{utils.mutez_of_tez(expected_balance)}' + ) + + @pytest.mark.parametrize( + "contract", + [ + 'amount_after_view', + 'amount_after_fib_view', + 'amount_after_nonexistent_view', + ], + ) + def test_amount_after_view(self, client, session, contract): + path = f'{CONTRACT_PATH}/opcodes/{contract}.tz' + lib_address = session['lib'] + originate(client, session, path, '0', 1000) + client.bake('bootstrap2', ["--minimal-timestamp"]) + amount = 3 + client.transfer( + amount, + 'bootstrap1', + contract, + [ + '--arg', + f'"{lib_address}"', + '--burn-cap', + '0.1', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + assert client.get_storage(contract) == f'{utils.mutez_of_tez(amount)}' + + def test_recursion(self, client, session): + contract = 'view_rec' + path = f'{CONTRACT_PATH}/opcodes/' + contract + '.tz' + originate(client, session, path, 'Unit', 0) + with utils.assert_run_failure( + "Gas limit exceeded during typechecking or execution." + ): + client.transfer( + 0, + 'bootstrap1', + contract, + [ + "--arg", + "Unit", + '--gas-limit', + '5000', + ], + ) + client.bake('bootstrap2', ["--minimal-timestamp"]) + + @pytest.mark.parametrize( + "contract,expected_error", + [ + ( + 'view_toplevel_bad_type', + 'the return of a view block did not match the expected type.', + ), + ( + 'view_toplevel_bad_return_type', + 'the return of a view block did not match the expected type.', + ), + ( + 'view_toplevel_bad_input_type', + 'operator ADD is undefined between string', + ), + ( + 'view_toplevel_invalid_arity', + 'primitive view expects 4 arguments', + ), + ( + 'view_toplevel_bad_name_too_long', + 'exceeds the maximum length of 31 characters', + ), + ( + 'view_toplevel_bad_name_invalid_type', + 'only a string can be used here', + ), + ( + 'view_toplevel_bad_name_non_printable_char', + 'string \\[a-zA-Z0-9_.%@\\]', + ), + ( + 'view_toplevel_bad_name_invalid_char_set', + 'string \\[a-zA-Z0-9_.%@\\]', + ), + ( + 'view_toplevel_duplicated_name', + 'the name of view in toplevel should be unique', + ), + ( + 'view_toplevel_dupable_type_output', + 'Ticket in unauthorized position', + ), + ( + 'view_toplevel_dupable_type_input', + 'Ticket in unauthorized position', + ), + ( + 'view_toplevel_lazy_storage_input', + 'big_map or sapling_state type not expected here', + ), + ( + 'view_toplevel_lazy_storage_output', + 'big_map or sapling_state type not expected here', + ), + ('view_op_invalid_arity', 'primitive VIEW expects 2 arguments'), + ( + 'view_op_bad_name_invalid_type', + 'unexpected int, only a string', + ), + ( + 'view_op_bad_name_too_long', + 'exceeds the maximum length of 31 characters', + ), + ( + 'view_op_bad_name_non_printable_char', + 'string \\[a-zA-Z0-9_.%@\\]', + ), + ( + 'view_op_bad_name_invalid_char_set', + 'string \\[a-zA-Z0-9_.%@\\]', + ), + ( + 'view_op_bad_return_type', + 'two branches don\'t end with the same stack type', + ), + ( + 'view_op_dupable_type', + 'Ticket in unauthorized position', + ), + ( + 'view_op_lazy_storage', + 'big_map or sapling_state type not expected here', + ), + ], + ) + def test_typechecking_error( + self, client, session, contract, expected_error + ): + path = f'{CONTRACT_PATH}/ill_typed/' + contract + '.tz' + with utils.assert_run_failure(expected_error): + originate(client, session, path, '4', 0) + + +@pytest.mark.contract +class TestScriptHashMultiple: + """Test octez-client hash script with diffent number and type of + arguments""" + + def test_contract_hashes_empty(self, client: Client): + assert client.hash_script([]) == [] + + def test_contract_hashes_single(self, client: Client): + assert client.hash_script([ID_SCRIPT_LITERAL]) == [ + (ID_SCRIPT_HASH, None) + ] + + def test_contract_hashes_single_display_names(self, client: Client): + assert client.hash_script([ID_SCRIPT_LITERAL], display_names=True,) == [ + ( + ID_SCRIPT_HASH, + 'Literal script 1', + ) + ] + + def test_contract_hashes_mixed(self, client: Client): + contract_path = os.path.join(CONTRACT_PATH, 'attic', 'empty.tz') + script_empty_hash = ''' +expruat2BS4KCwn9kbopeX1ZwxtrtJbyFhpnpnG6A5KdCBCwHNsdod + '''.strip() + with open(contract_path, 'r') as contract_file: + script = contract_file.read() + + hashes = client.hash_script([contract_path, script]) + + assert hashes == [ + ( + script_empty_hash, + None, + ), + ( + script_empty_hash, + None, + ), + ] + + hashes = client.hash_script( + [contract_path, script], display_names=True + ) + + assert hashes == [ + ( + script_empty_hash, + contract_path, + ), + ( + script_empty_hash, + 'Literal script 2', + ), + ] + + @pytest.mark.parametrize( + "for_script, display_names, results", + [ + ('csv', True, (ID_SCRIPT_HASH, 'Literal script 1')), + ('csv', False, (ID_SCRIPT_HASH, None)), + ('tsv', True, (ID_SCRIPT_HASH, 'Literal script 1')), + ('tsv', False, (ID_SCRIPT_HASH, None)), + ], + ) + def test_contract_hashes_for_script( + self, client: Client, for_script, display_names, results + ): + assert client.hash_script( + [ID_SCRIPT_LITERAL], + display_names=display_names, + for_script=for_script, + ) == [results] + + +@pytest.mark.contract +@pytest.mark.incremental +class TestContractTypeChecking: + """Typechecking tests for the address and (contract _) types.""" + + def check_address(self, client, address): + """An address followed by an entrypoint typechecks at type address if + and only if the entrypoint is not "default".""" + + address_a = f'"{address}%a"' + address_opt = client.normalize( + f'"{address}"', 'address', 'Optimized' + ).strip() + address_opt_a = client.normalize( + address_a, 'address', 'Optimized' + ).strip() + + client.typecheck_data(f'"{address}"', 'address') + client.typecheck_data(f'{address_a}', 'address') + client.typecheck_data(f'{address_opt}', 'address') + client.typecheck_data(f'{address_opt_a}', 'address') + + unexpected_default_error = "unexpected_default_entrypoint" + not_an_address_error = "not an expression of type address" + + with utils.assert_run_failure(unexpected_default_error): + client.typecheck_data(f'"{address}%default"', 'address') + + # 64656661756c74 is "default" in hexa + with utils.assert_run_failure(not_an_address_error): + client.typecheck_data(address_opt + '64656661756c74', 'address') + + def check_contract_ok(self, client, address, entrypoint, typ): + """Helper to check that an address followed by an entrypoint typechecks + at type (contract typ) using both readable and optimised + representations.""" + + address_readable = f'"{address}"' + if entrypoint is not None: + address_readable = f'"{address}%{entrypoint}"' + + address_opt = client.normalize( + address_readable, 'address', 'Optimized' + ).strip() + + client.typecheck_data(address_readable, f'contract ({typ})') + client.typecheck_data(address_opt, f'contract ({typ})') + + client.run_script( + f""" +parameter unit; +storage address; +code {{ + CDR; + CONTRACT ({typ}); + ASSERT_SOME; + ADDRESS; + NIL operation; + PAIR }}""", + address_readable, + 'Unit', + file=False, + ) + + def check_contract_ko( + self, client, address, entrypoint, typ, expected_error + ): + """Helper to check that an address followed by an entrypoint does not + typecheck at type (contract typ) using both readable and optimised + representations.""" + + address_readable = f'"{address}"' + if entrypoint is not None: + address_readable = f'"{address}%{entrypoint}"' + + address_opt = client.normalize( + address_readable, 'address', 'Optimized' + ).strip() + + with utils.assert_run_failure(expected_error): + client.typecheck_data(address_readable, f'contract ({typ})') + with utils.assert_run_failure(expected_error): + client.typecheck_data(address_opt, f'contract ({typ})') + + client.run_script( + f""" +parameter unit; +storage address; +code {{ + CDR; + DUP; + CONTRACT ({typ}); + ASSERT_NONE; + NIL operation; + PAIR }}""", + address_readable, + 'Unit', + file=False, + ) + + def test_implicit(self, client): + """The address of an implicit account followed by some entrypoint + typechecks: + - at type address if the entrypoint is not "default", + - at type (contract <ty>) if the entrypoint is empty and ty is unit.""" + + tz1 = 'tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx' + + self.check_address(client, tz1) + self.check_contract_ok(client, tz1, None, 'unit') + + no_entrypoint_error = 'Contract has no entrypoint named a' + type_mismatch_error = 'Type nat is not compatible with type unit.' + self.check_contract_ko(client, tz1, 'a', 'unit', no_entrypoint_error) + self.check_contract_ko(client, tz1, 'a', 'nat', no_entrypoint_error) + self.check_contract_ko(client, tz1, None, 'nat', type_mismatch_error) + + def test_originated_inexistent(self, client): + """The address of an inexistent originated account followed by some + entrypoint typechecks: + - at type address if the entrypoint is not "default", + - at no (contract _) type.""" + + kt1 = 'KT1RvwLgpxVv9ANCKsDb5vBgTaZRG1W4bKWP' + + self.check_address(client, kt1) + + invalid_contract_error = 'invalid contract.' + self.check_contract_ko( + client, kt1, None, 'unit', invalid_contract_error + ) + self.check_contract_ko(client, kt1, 'a', 'unit', invalid_contract_error) + self.check_contract_ko(client, kt1, None, 'nat', invalid_contract_error) + self.check_contract_ko(client, kt1, 'a', 'nat', invalid_contract_error) + + def test_originated_no_default(self, client, session): + """The address of an existent originated account that does not specify + a default entrypoint followed by some entrypoint typechecks: + - at type address if the entrypoint is not "default", + - at type (contract <ty>) if + - the entrypoint is empty and <ty> is the root type + - the entrypoint is non-empty, one of the declared entrypoints, and + <ty> is the type associated to that entrypoint.""" + + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'simple_entrypoints.tz' + ) + origination = originate(client, session, path, 'Unit', 0) + kt1 = origination.contract + root_type = 'or (unit %A) (or (string %B) (nat %C))' + a_type = 'unit' + b_type = 'string' + + self.check_address(client, kt1) + self.check_contract_ok(client, kt1, None, root_type) + self.check_contract_ok(client, kt1, 'A', a_type) + self.check_contract_ok(client, kt1, 'B', b_type) + + no_entrypoint_error = 'Contract has no entrypoint named a' + self.check_contract_ko(client, kt1, 'a', a_type, no_entrypoint_error) + + def test_originated_with_default(self, client, session): + """The address of an existent originated account that specifies + a default entrypoint followed by some entrypoint typechecks: + - at type address if the entrypoint is not "default", + - at type (contract <ty>) if + - the entrypoint is empty and <ty> is the type of the default + entrypoint + - the entrypoint is non-empty, one of the declared entrypoints, and + <ty> is the type associated to that entrypoint.""" + + path = os.path.join( + CONTRACT_PATH, 'entrypoints', 'delegatable_target.tz' + ) + initial_storage = 'Pair "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" "" 0' + origination = originate(client, session, path, initial_storage, 0) + kt1 = origination.contract + root_type = ( + 'or (or (key_hash %set_delegate) (unit %remove_delegate))' + '(or %default string nat)' + ) + default_type = 'or string nat' + + self.check_address(client, kt1) + self.check_contract_ok(client, kt1, None, default_type) + self.check_contract_ok(client, kt1, 'set_delegate', 'key_hash') + + no_entrypoint_error = 'Contract has no entrypoint named a' + self.check_contract_ko(client, kt1, 'a', root_type, no_entrypoint_error) + + type_mismatch_error = 'is not compatible with type' + self.check_contract_ko( + client, kt1, None, root_type, type_mismatch_error + ) diff --git a/tests_python/tests_016/test_contract_annotations.py b/tests_python/tests_016/test_contract_annotations.py new file mode 100644 index 000000000000..b1f67007c914 --- /dev/null +++ b/tests_python/tests_016/test_contract_annotations.py @@ -0,0 +1,108 @@ +import pytest +from tools.utils import assert_typecheck_data_failure, assert_typecheck_failure +from client.client import Client + + +@pytest.mark.slow +@pytest.mark.contract +class TestAnnotations: + """Tests of Michelson annotations.""" + + def test_annotation_length_success(self, client: Client): + client.typecheck_data('3', f"(int :{'a' * 254})") + + def test_annotation_length_failure(self, client: Client): + assert_typecheck_data_failure( + client, + '3', + f"(int :{'a' * 255})", + r'annotation exceeded maximum length \(255 chars\)', + ) + + def test_field_annotation_in_type_alphabetic(self, client): + client.typecheck_data('Pair 0 0', 'pair (nat %x) (int %y)') + + def test_field_annotation_in_type_numeral(self, client): + client.typecheck_data('Pair 0 0', 'pair (nat %1) (int %2)') + + def test_field_annotation_in_type_invalid_character(self, client): + assert_typecheck_data_failure( + client, + 'Pair 0 0', + 'pair (nat %.) (int %.)', + 'unexpected annotation', + ) + + def test_field_annotation_in_instruction_alphabetic(self, client): + client.typecheck_data( + '{ CAR %x }', 'lambda (pair (nat %x) (int %y)) nat' + ) + + def test_field_annotation_in_instruction_numeral(self, client): + client.typecheck_data( + '{ CAR %1 }', 'lambda (pair (nat %1) (int %2)) nat' + ) + + def test_field_annotation_in_instruction_invalid_character(self, client): + assert_typecheck_data_failure( + client, + '{ CAR %. }', + 'lambda (pair (nat %.) (int %.)) nat', + 'unexpected annotation', + ) + + def test_field_annotation_in_root_alphabetic_legacy(self, client): + client.typecheck( + 'parameter %r unit; storage unit; code {FAILWITH}', + file=False, + legacy=True, + ) + + def test_field_annotation_in_root_numeral_legacy(self, client): + client.typecheck( + 'parameter %1 unit; storage unit; code {FAILWITH}', + file=False, + legacy=True, + ) + + def test_field_annotation_in_root_alphabetic(self, client): + assert_typecheck_failure( + client, + 'parameter %r unit; storage unit; code {FAILWITH}', + 'unexpected annotation', + file=False, + ) + + def test_field_annotation_in_root_numeral(self, client): + assert_typecheck_failure( + client, + 'parameter %1 unit; storage unit; code {FAILWITH}', + 'unexpected annotation', + file=False, + ) + + def test_field_annotation_in_root_invalid_character(self, client): + assert_typecheck_failure( + client, + 'parameter %. unit; storage unit; code {FAILWITH}', + 'unexpected annotation', + file=False, + ) + + def test_field_annotation_in_root_type_alphabetic(self, client): + client.typecheck( + 'parameter (unit %r); storage unit; code {FAILWITH}', file=False + ) + + def test_field_annotation_in_root_type_numeral(self, client): + client.typecheck( + 'parameter (unit %1); storage unit; code {FAILWITH}', file=False + ) + + def test_field_annotation_in_root_type_invalid_character(self, client): + assert_typecheck_failure( + client, + 'parameter (unit %.); storage unit; code {FAILWITH}', + 'unexpected annotation', + file=False, + ) diff --git a/tests_python/tests_016/test_contract_baker.py b/tests_python/tests_016/test_contract_baker.py new file mode 100644 index 000000000000..013ca9e138c4 --- /dev/null +++ b/tests_python/tests_016/test_contract_baker.py @@ -0,0 +1,55 @@ +import os +import pytest +from tools import constants, utils +from client.client import Client +from . import contract_paths + + +@pytest.mark.contract +@pytest.mark.baker +@pytest.mark.incremental +class TestOriginationCall: + """Test a simple contract origination and call""" + + def test_originate(self, client: Client, session: dict): + initial_storage = 'Unit' + contract = os.path.join( + contract_paths.OPCODES_CONTRACT_PATH, 'transfer_tokens.tz' + ) + args = ['--init', initial_storage, '--burn-cap', '0.400'] + origination = client.originate( + 'foobar', 1000, 'bootstrap1', contract, args + ) + session['contract'] = origination.contract + utils.bake(client, bake_for="bootstrap5") + + # Unsolved mystery: + # client.wait_for_inclusion(origination.operation_hash) + # fails sometimes with octez-client crashing. Maybe caused with + # subprocess captured of forked process output? + # + # Safer to poll with `check_block_contain_operations` + assert utils.check_block_contains_operations( + client, [origination.operation_hash] + ) + + def test_call(self, client: Client, session: dict): + contract = session['contract'] + bootstrap3 = '"tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU"' + transfer = client.call('bootstrap2', contract, ['--arg', bootstrap3]) + utils.bake(client, bake_for="bootstrap5") + assert utils.check_block_contains_operations( + client, [transfer.operation_hash] + ) + + def test_balance(self, client: Client): + bootstrap3 = constants.IDENTITIES['bootstrap3']['identity'] + deposit = client.frozen_deposits(bootstrap3) + balance = client.get_mutez_balance('bootstrap3') + assert balance + deposit == utils.mutez_of_tez(4000100.0) + + def test_query_storage(self, client: Client, session: dict): + contract = session['contract'] + url = f'/chains/main/blocks/head/context/contracts/{contract}/storage' + res = client.rpc('get', url) + assert res['prim'] == 'Unit' diff --git a/tests_python/tests_016/test_contract_macros.py b/tests_python/tests_016/test_contract_macros.py new file mode 100644 index 000000000000..8528f37165f7 --- /dev/null +++ b/tests_python/tests_016/test_contract_macros.py @@ -0,0 +1,447 @@ +from os import path +import pytest +from tools.utils import ( + assert_run_script_failwith, + assert_transfer_failwith, + init_with_transfer, + bake, + assert_storage_contains, +) +from tools.client_regression import ClientRegression +from client.client import Client +from .contract_paths import MACROS_CONTRACT_PATH, CONTRACT_PATH, all_contracts + + +@pytest.mark.contract +class TestContractMacros: + """Tests for contracts using macros that do not require origination.""" + + @pytest.mark.parametrize( + "contract,param,storage,expected", + [ # FORMAT: assert_output contract_file storage input expected_result + # Build list + ('build_list.tz', '{}', '0', '{ 0 }'), + ('build_list.tz', '{}', '3', '{ 0 ; 1 ; 2 ; 3 }'), + ( + 'build_list.tz', + '{}', + '10', + '{ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10 }', + ), + # Find maximum int in list -- returns None if not found + ('max_in_list.tz', 'None', '{}', 'None'), + ('max_in_list.tz', 'None', '{ 1 }', '(Some 1)'), + ('max_in_list.tz', 'None', '{ -1 }', '(Some -1)'), + ( + 'max_in_list.tz', + 'None', + '{ 10 ; -1 ; -20 ; 100 ; 0 }', + '(Some 100)', + ), + ( + 'max_in_list.tz', + 'None', + '{ 10 ; -1 ; -20 ; 100 ; 0 }', + '(Some 100)', + ), + ( + 'max_in_list.tz', + 'None', + '{ -10 ; -1 ; -20 ; -100 }', + '(Some -1)', + ), + # Test comparisons on tez { EQ ; GT ; LT ; GE ; LE } + ( + 'compare.tz', + '{}', + '(Pair 1000000 2000000)', + '{ False ; False ; True ; False ; True }', + ), + ( + 'compare.tz', + '{}', + '(Pair 2000000 1000000)', + '{ False ; True ; False ; True ; False }', + ), + ( + 'compare.tz', + '{}', + '(Pair 2370000 2370000)', + '{ True ; False ; False ; True ; True }', + ), + # Test ASSERT + ('assert.tz', 'Unit', 'True', 'Unit'), + # ASSERT_{OP} + ('assert_eq.tz', 'Unit', '(Pair -1 -1)', 'Unit'), + ('assert_eq.tz', 'Unit', '(Pair -1 -1)', 'Unit'), + ('assert_neq.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + ('assert_lt.tz', 'Unit', '(Pair -1 0)', 'Unit'), + ('assert_le.tz', 'Unit', '(Pair 0 0)', 'Unit'), + ('assert_le.tz', 'Unit', '(Pair -1 0)', 'Unit'), + ('assert_gt.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + ('assert_ge.tz', 'Unit', '(Pair 0 0)', 'Unit'), + ('assert_ge.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + # ASSERT_CMP{OP} + ('assert_cmpeq.tz', 'Unit', '(Pair -1 -1)', 'Unit'), + ('assert_cmpneq.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + ('assert_cmplt.tz', 'Unit', '(Pair -1 0)', 'Unit'), + ('assert_cmple.tz', 'Unit', '(Pair -1 0)', 'Unit'), + ('assert_cmple.tz', 'Unit', '(Pair 0 0)', 'Unit'), + ('assert_cmpgt.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + ('assert_cmpge.tz', 'Unit', '(Pair 0 -1)', 'Unit'), + ('assert_cmpge.tz', 'Unit', '(Pair 0 0)', 'Unit'), + # Tests the SET_CAR and SET_CDR instructions + ( + 'set_caddaadr.tz', + '(Pair (Pair 1 2 (Pair (Pair 3 0) 4) 5) 6)', + '3000000', + '(Pair (Pair 1 2 (Pair (Pair 3 3000000) 4) 5) 6)', + ), + ( + 'map_caddaadr.tz', + '(Pair (Pair 1 2 (Pair (Pair 3 0) 4) 5) 6)', + 'Unit', + '(Pair (Pair 1 2 (Pair (Pair 3 1000000) 4) 5) 6)', + ), + # Test comparisons on bytes { EQ ; GT ; LT ; GE ; LE } + ( + 'compare_bytes.tz', + '{}', + '(Pair 0x33 0x34)', + '{ False ; False ; True ; False ; True }', + ), + ( + 'compare_bytes.tz', + '{}', + '(Pair 0x33 0x33aa)', + '{ False ; False ; True ; False ; True }', + ), + ( + 'compare_bytes.tz', + '{}', + '(Pair 0x33 0x33)', + '{ True ; False ; False ; True ; True }', + ), + ( + 'compare_bytes.tz', + '{}', + '(Pair 0x34 0x33)', + '{ False ; True ; False ; True ; False }', + ), + ], + ) + def test_contract_input_output( + self, + client: Client, + contract: str, + param: str, + storage: str, + expected: str, + ): + assert contract.endswith( + '.tz' + ), "test contract should have .tz extension" + contract = path.join(MACROS_CONTRACT_PATH, contract) + run_script_res = client.run_script(contract, param, storage) + assert run_script_res.storage == expected + + @pytest.mark.parametrize( + "contract,param,storage", + [ # FORMAT: assert_output contract_file storage input expected_result + ('assert.tz', 'Unit', 'False'), + ('assert_eq.tz', 'Unit', '(Pair 0 -1)'), + ('assert_eq.tz', 'Unit', '(Pair 0 -1)'), + ('assert_neq.tz', 'Unit', '(Pair -1 -1)'), + ('assert_lt.tz', 'Unit', '(Pair 0 -1)'), + ('assert_lt.tz', 'Unit', '(Pair 0 0)'), + ('assert_le.tz', 'Unit', '(Pair 0 -1)'), + ('assert_gt.tz', 'Unit', '(Pair -1 0)'), + ('assert_gt.tz', 'Unit', '(Pair 0 0)'), + ('assert_ge.tz', 'Unit', '(Pair -1 0)'), + ('assert_cmpeq.tz', 'Unit', '(Pair 0 -1)'), + ('assert_cmpneq.tz', 'Unit', '(Pair -1 -1)'), + ('assert_cmplt.tz', 'Unit', '(Pair 0 0)'), + ('assert_cmplt.tz', 'Unit', '(Pair 0 -1)'), + ('assert_cmple.tz', 'Unit', '(Pair 0 -1)'), + ('assert_cmpgt.tz', 'Unit', '(Pair 0 0)'), + ('assert_cmpgt.tz', 'Unit', '(Pair -1 0)'), + ('assert_cmpge.tz', 'Unit', '(Pair -1 0)'), + ], + ) + def test_contract_failures(self, client: Client, contract, param, storage): + contract = path.join(MACROS_CONTRACT_PATH, contract) + assert_run_script_failwith(client, contract, param, storage) + + +@pytest.mark.slow +@pytest.mark.contract +class TestGuestBook: + """Test on the guestbook contract.""" + + def test_guestbook(self, client: Client): + contract = path.join(MACROS_CONTRACT_PATH, 'guestbook.tz') + + init_with_transfer( + client, + contract, + '{ Elt "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" None }', + 100, + 'bootstrap1', + ) + + assert_transfer_failwith( + client, + 0, + 'bootstrap2', + 'guestbook', + ['--arg', '"Pas moi"', '--burn-cap', '10'], + ) + + client.transfer( + 0, + 'bootstrap1', + 'guestbook', + ['-arg', '"Coucou"', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains( + client, + 'guestbook', + '{ Elt "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" (Some "Coucou") }', + ) + + assert_transfer_failwith( + client, + 0, + 'bootstrap3', + 'guestbook', + ['--arg', '"Pas moi non plus"', '--burn-cap', '10'], + ) + assert_transfer_failwith( + client, + 0, + 'bootstrap1', + 'guestbook', + ['--arg', '"Recoucou ?"', '--burn-cap', '10'], + ) + + +@pytest.mark.slow +@pytest.mark.contract +class TestBigmap: + """Tests on the big_map_mem contract.""" + + def test_bigmap(self, client: Client): + contract = path.join(MACROS_CONTRACT_PATH, 'big_map_mem.tz') + + init_with_transfer( + client, + contract, + '(Pair { Elt 1 Unit ; Elt 2 Unit ; Elt 3 Unit } Unit)', + 100, + 'bootstrap1', + ) + + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['-arg', '(Pair 0 False)', '--burn-cap', '10'], + ) + bake(client) + + assert_transfer_failwith( + client, + 0, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 0 True)', '--burn-cap', '10'], + ) + + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 0 False)', '--burn-cap', '10'], + ) + bake(client) + assert_transfer_failwith( + client, + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 0 True)', '--burn-cap', '10'], + ) + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 1 True)', '--burn-cap', '10'], + ) + bake(client) + assert_transfer_failwith( + client, + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 1 False)', '--burn-cap', '10'], + ) + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 2 True)', '--burn-cap', '10'], + ) + bake(client) + assert_transfer_failwith( + client, + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 2 False)', '--burn-cap', '10'], + ) + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 3 True)', '--burn-cap', '10'], + ) + bake(client) + assert_transfer_failwith( + client, + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 3 False)', '--burn-cap', '10'], + ) + client.transfer( + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 4 False)', '--burn-cap', '10'], + ) + bake(client) + assert_transfer_failwith( + client, + 1, + 'bootstrap1', + 'big_map_mem', + ['--arg', '(Pair 4 True)', '--burn-cap', '10'], + ) + + +@pytest.mark.slow +@pytest.mark.contract +class TestBigmapGetAdd: + """Tests on the big_map_get_add contract.""" + + def test_bigmap(self, client: Client): + contract = path.join(MACROS_CONTRACT_PATH, 'big_map_get_add.tz') + + init_with_transfer( + client, + contract, + '(Pair { Elt 0 1 ; Elt 1 2 ; Elt 2 3 } Unit)', + 100, + 'bootstrap1', + ) + + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 200 (Some 2)) (Pair 200 (Some 2)))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 200 None) (Pair 200 None))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 200 None) (Pair 300 None))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 1 None) (Pair 200 None))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 1 (Some 2)) (Pair 0 (Some 1)))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 400 (Some 1232)) (Pair 400 (Some 1232)))', + '--burn-cap', + '10', + ], + ) + bake(client) + client.transfer( + 1, + 'bootstrap1', + 'big_map_get_add', + [ + '--arg', + '(Pair (Pair 401 (Some 0)) (Pair 400 (Some 1232)))', + '--burn-cap', + '10', + ], + ) + bake(client) + + +@pytest.mark.regression +class TestMacroExpansion: + """Test expanding macros""" + + @pytest.mark.parametrize("contract", all_contracts(['macros'])) + def test_macro_expansion( + self, client_regtest: ClientRegression, contract: str + ): + """This test expands macros in all macro test contracts, with + regression detection enabled. This test should fail if the definition + of any macros change. + """ + client_regtest.expand_macros(path.join(CONTRACT_PATH, contract)) diff --git a/tests_python/tests_016/test_contract_onchain_opcodes.py b/tests_python/tests_016/test_contract_onchain_opcodes.py new file mode 100644 index 000000000000..d35cd04f703b --- /dev/null +++ b/tests_python/tests_016/test_contract_onchain_opcodes.py @@ -0,0 +1,1325 @@ +from os import path + +import pytest +from tools.client_regression import ClientRegression +from tools import paths +from tools.utils import ( + assert_run_failure, + assert_storage_contains, + bake, + init_with_transfer, + assert_balance, +) +from tools.constants import IDENTITIES +from .contract_paths import OPCODES_CONTRACT_PATH, MINI_SCENARIOS_CONTRACT_PATH +from . import protocol + +KEY1 = 'foo' +KEY2 = 'bar' + + +@pytest.mark.incremental +@pytest.mark.slow +@pytest.mark.contract +@pytest.mark.regression +class TestContractOnchainOpcodes: + """Tests for individual opcodes that requires origination.""" + + def test_gen_keys(self, client_regtest_scrubbed: ClientRegression): + """Add keys used by later tests.""" + client = client_regtest_scrubbed + client.gen_key(KEY1) + client.gen_key(KEY2) + + def test_store_input(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + client.transfer(1000, "bootstrap1", KEY1, ['--burn-cap', '0.257']) + bake(client) + + client.transfer(2000, "bootstrap1", KEY2, ['--burn-cap', '0.257']) + bake(client) + + assert_balance(client, KEY1, 1000) + assert_balance(client, KEY2, 2000) + + # Create a contract and transfer 100 ꜩ to it + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'store_input.tz'), + '""', + 100, + 'bootstrap1', + ) + + client.transfer( + 100, + "bootstrap1", + "store_input", + ["-arg", '"abcdefg"', '--burn-cap', '10'], + ) + bake(client) + + assert_balance(client, "store_input", 200) + + assert_storage_contains(client, "store_input", '"abcdefg"') + + client.transfer( + 100, + "bootstrap1", + "store_input", + ["-arg", '"xyz"', '--burn-cap', '10'], + ) + bake(client) + + assert_storage_contains(client, "store_input", '"xyz"') + + def test_transfer_amount(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'transfer_amount.tz'), + '0', + 100, + 'bootstrap1', + ) + + client.transfer( + 500, + "bootstrap1", + 'transfer_amount', + ['-arg', 'Unit', '--burn-cap', '10'], + ) + + bake(client) + + assert_storage_contains(client, "transfer_amount", '500000000') + + def test_now(self, client_regtest_scrubbed: ClientRegression): + # Regtest is disabled for this test, since one would need to + # scrub storage for this one as it changes (the timestamp) + # on every run. + client = client_regtest_scrubbed + client.set_regtest(None) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'store_now.tz'), + '"2017-07-13T09:19:01Z"', + 100, + 'bootstrap1', + ) + + client.transfer( + 500, "bootstrap1", 'store_now', ['-arg', 'Unit', '--burn-cap', '10'] + ) + bake(client) + + assert_storage_contains( + client, 'store_now', f'"{protocol.get_now(client)}"' + ) + + def test_transfer_tokens(self, client_regtest_scrubbed: ClientRegression): + """Tests TRANSFER_TOKENS.""" + client = client_regtest_scrubbed + client.originate( + 'test_transfer_account1', + 100, + 'bootstrap1', + path.join(OPCODES_CONTRACT_PATH, 'noop.tz'), + ['--burn-cap', '10'], + ) + bake(client) + + client.originate( + 'test_transfer_account2', + 20, + 'bootstrap1', + path.join(OPCODES_CONTRACT_PATH, 'noop.tz'), + ['--burn-cap', '10'], + ) + bake(client) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'transfer_tokens.tz'), + 'Unit', + 1000, + 'bootstrap1', + ) + + assert_balance(client, 'test_transfer_account1', 100) + + account1_addr = client.get_contract_address('test_transfer_account1') + client.transfer( + 100, + 'bootstrap1', + 'transfer_tokens', + ['-arg', f'"{account1_addr}"', '--burn-cap', '10'], + ) + bake(client) + + # Why isn't this 200 ꜩ? Baking fee? + assert_balance(client, 'test_transfer_account1', 200) + + account2_addr = client.get_contract_address('test_transfer_account2') + client.transfer( + 100, + 'bootstrap1', + 'transfer_tokens', + ['-arg', f'"{account2_addr}"', '--burn-cap', '10'], + ) + bake(client) + + assert_balance(client, 'test_transfer_account2', 120) + + def test_self(self, client_regtest_scrubbed: ClientRegression): + # Regtest is disabled for this test, since one would need to + # scrub storage for this one as it changes (the contract + # address) on every run. + client = client_regtest_scrubbed + client.set_regtest(None) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'self.tz'), + '"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"', + 1000, + 'bootstrap1', + ) + + client.transfer(0, 'bootstrap1', 'self', ['--burn-cap', '10']) + bake(client) + + self_addr = client.get_contract_address('self') + assert_storage_contains(client, 'self', f'"{self_addr}"') + + def test_contract_fails(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + client.set_regtest(None) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'contract.tz'), + 'Unit', + 1000, + 'bootstrap1', + ) + + client.transfer(0, 'bootstrap1', 'self', ['--burn-cap', '10']) + bake(client) + addr = client.get_contract_address('contract') + + with assert_run_failure(r'script reached FAILWITH instruction'): + client.transfer( + 0, + 'bootstrap1', + 'contract', + ['-arg', f'"{addr}"', '--burn-cap', '10'], + ) + + def test_init_proxy(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'proxy.tz'), + 'Unit', + 1000, + 'bootstrap1', + ) + + def test_source(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_store = IDENTITIES['bootstrap4']['identity'] + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'source.tz'), + f'"{init_store}"', + 1000, + 'bootstrap1', + ) + + # direct transfer to the contract + client.transfer(0, 'bootstrap2', 'source', ['--burn-cap', '10']) + bake(client) + + source_addr = IDENTITIES['bootstrap2']['identity'] + assert_storage_contains(client, 'source', f'"{source_addr}"') + + # indirect transfer to the contract through proxy + contract_addr = client.get_contract_address('source') + client.transfer( + 0, + 'bootstrap2', + 'proxy', + ['--burn-cap', '10', '--arg', f'"{contract_addr}"'], + ) + bake(client) + assert_storage_contains(client, 'source', f'"{source_addr}"') + + def test_sender(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + client.set_regtest(None) + + init_store = IDENTITIES['bootstrap4']['identity'] + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'sender.tz'), + f'"{init_store}"', + 1000, + 'bootstrap1', + ) + + # direct transfer to the contract + client.transfer(0, 'bootstrap2', 'sender', ['--burn-cap', '10']) + bake(client) + + sender_addr = IDENTITIES['bootstrap2']['identity'] + assert_storage_contains(client, 'sender', f'"{sender_addr}"') + + # indirect transfer to the contract through proxy + contract_addr = client.get_contract_address('sender') + proxy_addr = client.get_contract_address('proxy') + client.transfer( + 0, + 'bootstrap2', + 'proxy', + ['--burn-cap', '10', '--arg', f'"{contract_addr}"'], + ) + bake(client) + assert_storage_contains(client, 'sender', f'"{proxy_addr}"') + + def test_slice(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'slices.tz'), + '"sppk7dBPqMPjDjXgKbb5f7V3PuKUrA4Zuwc3c3H7XqQerqPUWbK7Hna"', + 1000, + 'bootstrap1', + ) + + @pytest.mark.parametrize( + 'contract_arg', + [ + line.rstrip('\n') + for line in open( + f'{paths.TEZOS_HOME}' + + '/tests_python/tests_016/' + + 'test_slice_fails_params.txt' + ) + ], + ) + def test_slice_fails( + self, client_regtest_scrubbed: ClientRegression, contract_arg: str + ): + client = client_regtest_scrubbed + + with assert_run_failure(r'script reached FAILWITH instruction'): + client.transfer( + 0, + 'bootstrap1', + 'slices', + ['-arg', contract_arg, '--burn-cap', '10'], + ) + # bake(client) + + @pytest.mark.parametrize( + 'contract_arg', + [ + line.rstrip('\n') + for line in open( + f'{paths.TEZOS_HOME}' + + '/tests_python/tests_016/' + + 'test_slice_success_params.txt' + ) + ], + ) + def test_slice_success( + self, client_regtest_scrubbed: ClientRegression, contract_arg: str + ): + client = client_regtest_scrubbed + client.transfer( + 0, + 'bootstrap1', + 'slices', + ['-arg', contract_arg, '--burn-cap', '10'], + ) + bake(client) + + def test_split_string(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'split_string.tz'), + '{}', + 1000, + 'bootstrap1', + ) + + client.transfer( + 0, + 'bootstrap1', + 'split_string', + ['-arg', '"abc"', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains(client, 'split_string', '{ "a" ; "b" ; "c" }') + + client.transfer( + 0, + 'bootstrap1', + 'split_string', + ['-arg', '"def"', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains( + client, 'split_string', '{ "a" ; "b" ; "c" ; "d" ; "e" ; "f" }' + ) + + def test_split_bytes(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'split_bytes.tz'), + '{}', + 1000, + 'bootstrap1', + ) + + client.transfer( + 0, + 'bootstrap1', + 'split_bytes', + ['-arg', '0xaabbcc', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains(client, 'split_bytes', '{ 0xaa ; 0xbb ; 0xcc }') + + client.transfer( + 0, + 'bootstrap1', + 'split_bytes', + ['-arg', '0xddeeff', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains( + client, 'split_bytes', '{ 0xaa ; 0xbb ; 0xcc ; 0xdd ; 0xee ; 0xff }' + ) + + def test_set_delegate(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'set_delegate.tz'), + 'Unit', + 1000, + 'bootstrap1', + ) + bake(client) + + assert client.get_delegate('set_delegate').delegate is None + + addr = IDENTITIES['bootstrap5']['identity'] + client.transfer( + 0, 'bootstrap1', 'set_delegate', ['-arg', f'(Some "{addr}")'] + ) + bake(client) + + assert client.get_delegate('set_delegate').delegate == addr + + client.transfer(0, 'bootstrap1', 'set_delegate', ['-arg', 'None']) + bake(client) + + assert client.get_delegate('set_delegate').delegate is None + + @pytest.mark.parametrize( + 'contract', + [ + 'compare_big_type.tz', + 'compare_big_type2.tz', + ], + ) + def test_trace_origination(self, client_regtest_scrubbed, contract): + client = client_regtest_scrubbed + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, contract), + 'Unit', + 1000, + 'bootstrap1', + ) + bake(client) + + +@pytest.mark.incremental +class TestTickets: + """Tests for tickets.""" + + def test_ticket_user_forge(self, client): + bake(client) + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_store-2.tz'), + 'None', + 100, + 'bootstrap1', + 'storer', + ) + + # Create parameter by hand with a ticket type but no ticket in it + client.transfer( + 100, 'bootstrap1', 'storer', ['-arg', 'None', '--burn-cap', '10'] + ) + + with assert_run_failure(r'Unexpected forged value'): + # Create parameter by hand with a ticket in it + client.transfer( + 100, + 'bootstrap1', + 'storer', + ['-arg', 'Some 1', '--burn-cap', '10'], + ) + + with assert_run_failure(r'Unexpected forged value'): + # Create storage by hand with a ticket in it + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_bad.tz'), + '1', + 100, + 'bootstrap1', + 'ticket_bad', + ) + + def test_ticket_user_big_forge(self, client): + bake(client) + contract_name = 'big_storer' + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_big_store.tz'), + '{}', + 100, + 'bootstrap1', + contract_name, + ) + bake(client) + client.transfer( + 100, 'bootstrap1', contract_name, ['-arg', '42', '--burn-cap', '10'] + ) + bake(client) + storage = client.get_storage(contract_name) + + with assert_run_failure(r'Unexpected forged value'): + # Create a storage with the ID of a big map that has tickets in it + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_big_store.tz'), + storage, + 100, + 'bootstrap1', + 'thief', + ) + + with assert_run_failure(r'Unexpected forged value'): + # Create a storage with the ID of a big map that has tickets in it + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_big_store.tz'), + '(Pair ' + storage + ' {})', + 100, + 'bootstrap1', + 'thief', + ) + + def test_ticket_read(self, client): + """Test TICKETS""" + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticketer.tz'), + '42', + 100, + 'bootstrap1', + 'ticketer_read', + ) + bake(client) + ticketer_addr = client.get_contract_address('ticketer_read') + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_read.tz'), + '"' + ticketer_addr + '"', + 100, + 'bootstrap1', + 'reader', + ) + bake(client) + reader_addr = client.get_contract_address('reader') + client.transfer( + 100, + 'bootstrap1', + 'ticketer_read', + ['-arg', '"' + reader_addr + '"', '--burn-cap', '10'], + ) + bake(client) + assert_storage_contains(client, "reader", '"' + ticketer_addr + '"') + + def test_bad_ticket(self, client): + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticketer.tz'), + '42', + 100, + 'bootstrap1', + 'ticketer_bad', + ) + bake(client) + ticketer_addr = client.get_contract_address('ticketer_bad') + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_read.tz'), + '"' + ticketer_addr + '"', + 100, + 'bootstrap1', + 'reader_bad', + ) + bake(client) + with assert_run_failure(r'Unexpected forged value'): + client.transfer( + 100, + 'bootstrap1', + 'reader_bad', + ['-arg', '1', '--burn-cap', '10'], + ) + bake(client) + + def test_ticket_utxo(self, client): + """Test UTXOs""" + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'utxor.tz'), + '42', + 100, + 'bootstrap1', + ) + bake(client) + utxor_addr = client.get_contract_address('utxor') + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'utxo_read.tz'), + '"' + utxor_addr + '"', + 100, + 'bootstrap1', + "reader_a", + ) + bake(client) + reader_a_addr = client.get_contract_address('reader_a') + utxor_addr = client.get_contract_address('utxor') + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'utxo_read.tz'), + '"' + utxor_addr + '"', + 100, + 'bootstrap1', + "reader_b", + ) + bake(client) + reader_b_addr = client.get_contract_address('reader_b') + client.transfer( + 100, + 'bootstrap1', + 'utxor', + [ + '-arg', + '(Pair "' + reader_a_addr + '" "' + reader_b_addr + '")', + '--burn-cap', + '10', + ], + ) + bake(client) + + def test_ticket_split(self, client): + def ticket(target_addr, param, utxo_amount): + param = ( + '(Pair (Pair "' + + target_addr + + '" ' + + str(param) + + ') ' + + str(utxo_amount) + + ')' + ) + client.transfer( + 100, + 'bootstrap1', + 'ticketer', + ['-arg', param, '--burn-cap', '10'], + ) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticketer-2.tz'), + 'Unit', + 100, + 'bootstrap1', + 'ticketer', + ) + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_split.tz'), + 'Unit', + 100, + 'bootstrap1', + 'splitter', + ) + bake(client) + splitter_addr = client.get_contract_address('splitter') + ticket(splitter_addr, 42, 3) + with assert_run_failure(r'script reached FAILWITH instruction'): + # Wrong Split Amount + ticket(splitter_addr, 42, 4) + bake(client) + + def test_ticket_join(self, client): + """Test JOIN""" + + def params(target_addr, utxo_amount, param): + return ( + '(Pair (Pair "' + + target_addr + + '" ' + + str(param) + + ') ' + + str(utxo_amount) + + ')' + ) + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticketer-2.tz'), + 'Unit', + 100, + 'bootstrap1', + 'ticketer_a', + ) + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticketer-2.tz'), + 'Unit', + 100, + 'bootstrap1', + 'ticketer_b', + ) + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'ticket_join.tz'), + 'None', + 100, + 'bootstrap1', + 'joiner', + ) + bake(client) + joiner_addr = client.get_contract_address('joiner') + client.transfer( + 100, + 'bootstrap1', + 'ticketer_a', + ['-arg', params(joiner_addr, 42, 1), '--burn-cap', '10'], + ) + bake(client) + client.transfer( + 100, + 'bootstrap1', + 'ticketer_a', + ['-arg', params(joiner_addr, 144, 1), '--burn-cap', '10'], + ) + bake(client) + with assert_run_failure(r'script reached FAILWITH instruction'): + # Different Ticketer + client.transfer( + 100, + 'bootstrap1', + 'ticketer_b', + ['-arg', params(joiner_addr, 23, 1), '--burn-cap', '10'], + ) + with assert_run_failure(r'script reached FAILWITH instruction'): + # Different Content + client.transfer( + 100, + 'bootstrap1', + 'ticketer_a', + ['-arg', params(joiner_addr, 21, 23), '--burn-cap', '10'], + ) + + def test_ticket_fungible_originations(self, client, session): + """Test the origination of builder and wallet contracts for fungible + tokens implemented using tickets.""" + + builder_path = path.join( + MINI_SCENARIOS_CONTRACT_PATH, 'ticket_builder_fungible.tz' + ) + + wallet_path = path.join( + MINI_SCENARIOS_CONTRACT_PATH, 'ticket_wallet_fungible.tz' + ) + + manager_address = IDENTITIES['bootstrap1']['identity'] + + builders = {} + wallets = {} + + # Helper functions + def originate_builder(name): + """Create a fungible token contract managed by bootstrap1.""" + origination = client.originate( + contract_name=f'builder_{name}', + amount="0", + sender='bootstrap1', + contract=builder_path, + args=['--init', f'"{manager_address}"', '--burn-cap', "10"], + ) + builders[name] = origination.contract + bake(client) + + def originate_wallet(name): + """Create a fungible token wallet managed by bootstrap1.""" + origination = client.originate( + contract_name=f'wallet_{name}', + amount="0", + sender='bootstrap1', + contract=wallet_path, + args=[ + '--init', + f'Pair "{manager_address}" {{}}', + '--burn-cap', + "10", + ], + ) + wallets[name] = origination.contract + bake(client) + + # Create 3 token contracts "A", "B", and "C". + originate_builder("A") + originate_builder("B") + originate_builder("C") + + # Create 2 wallets "Alice" and "Bob". + originate_wallet("Alice") + originate_wallet("Bob") + + session['fungible_builders'] = builders + session['fungible_wallets'] = wallets + + def test_ticket_fungible_transfers(self, client, session): + """Test the life cycle of fungible tokens implemented using tickets.""" + + manager_address = IDENTITIES['bootstrap1']['identity'] + + builders = session['fungible_builders'] + wallets = session['fungible_wallets'] + + def mint(builder, wallet, amount): + """Mint fungible tokens.""" + wallet_address = wallets[wallet] + parameter = f'(Pair "{wallet_address}%receive" {amount})' + client.transfer( + amount=0, + giver=manager_address, + receiver=f'builder_{builder}', + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'mint', + '--arg', + parameter, + ], + ) + bake(client) + + def burn(builder, wallet, amount): + """Burn fungible tokens.""" + builder_addr = builders[builder] + parameter = f'Pair "{builder_addr}%burn" {amount} "{builder_addr}"' + client.transfer( + amount=0, + giver=manager_address, + receiver=f'wallet_{wallet}', + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'send', + '--arg', + parameter, + ], + ) + bake(client) + + def transfer(builder, source_wallet, destination_wallet, amount): + """Transfer fungible tokens.""" + builder_addr = builders[builder] + dest_addr = wallets[destination_wallet] + parameter = f'Pair "{dest_addr}%receive" {amount} "{builder_addr}"' + client.transfer( + amount=0, + giver=manager_address, + receiver=f'wallet_{source_wallet}', + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'send', + '--arg', + parameter, + ], + ) + bake(client) + + # 100A --> Alice + mint(builder="A", wallet="Alice", amount=100) + # 100B --> Alice + mint(builder="B", wallet="Alice", amount=100) + + # Fail: Alice --1C--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="C", + source_wallet="Alice", + destination_wallet="Bob", + amount=1, + ) + + # Fail: Alice --0C--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="C", + source_wallet="Alice", + destination_wallet="Bob", + amount=0, + ) + + # Fail: Alice --150A--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + amount=150, + ) + + # Fail: Bob --50A--> Alice + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Alice", + amount=50, + ) + + # Alice --50A--> Bob + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + amount=50, + ) + + # Alice --50A--> Bob + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + amount=50, + ) + + # Alice --0A--> Bob + # This fails because we are not allowed to keep a ticket + # with zero amount in big maps. + # In the last transfer, Alice's wallet contract has depleted all + # A-tokens. + # Therefore, this contract call fails on A-token look-up. + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + amount=0, + ) + + # Fail: Alice --1A--> Bob + # Similarly, this contract call fails because there is no + # big map entry for A-tokens in Alice's wallet contract. + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + amount=1, + ) + + # Bob --100A--> Bob + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Bob", + amount=100, + ) + + # Fail: Bob --150A--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Bob", + amount=150, + ) + + # Bob --100A--> + burn(builder="A", wallet="Bob", amount=100) + + # Bob --0A--> + # The last `burn` call depletes all A-tokens in Bob's wallet. + # Since no ticket of amount zero is allowed in big map, + # this call fails because there is no A-token entry in Bob's + # wallet contract. + with assert_run_failure(r'script reached FAILWITH instruction'): + burn(builder="A", wallet="Bob", amount=0) + + # Fail: Bob --1A--> + with assert_run_failure(r'script reached FAILWITH instruction'): + burn(builder="A", wallet="Bob", amount=1) + + def test_ticket_non_fungible_originations(self, client, session): + """Test the origination of builder and wallet contracts for + non-fungible tokens implemented using tickets.""" + + builder_path = path.join( + MINI_SCENARIOS_CONTRACT_PATH, 'ticket_builder_non_fungible.tz' + ) + + wallet_path = path.join( + MINI_SCENARIOS_CONTRACT_PATH, 'ticket_wallet_non_fungible.tz' + ) + + manager_address = IDENTITIES['bootstrap1']['identity'] + + builders = {} + wallets = {} + + # Helper functions + def originate_builder(name): + """Create a non-fungible token contract managed by bootstrap1.""" + storage = f'(Pair "{manager_address}" 0)' + origination = client.originate( + contract_name=f'nft_builder_{name}', + amount="0", + sender='bootstrap1', + contract=builder_path, + args=['--init', storage, '--burn-cap', "10"], + ) + builders[name] = origination.contract + bake(client) + + def originate_wallet(name): + """Create a non-fungible token wallet managed by bootstrap1.""" + origination = client.originate( + contract_name=f'nft_wallet_{name}', + amount="0", + sender='bootstrap1', + contract=wallet_path, + args=[ + '--init', + f'Pair "{manager_address}" {{}}', + '--burn-cap', + "10", + ], + ) + wallets[name] = origination.contract + bake(client) + + # Create 3 token contracts "A", "B", and "C". + originate_builder("A") + originate_builder("B") + originate_builder("C") + + # Create 2 wallets "Alice" and "Bob". + originate_wallet("Alice") + originate_wallet("Bob") + + session['non_fungible_builders'] = builders + session['non_fungible_wallets'] = wallets + + def test_ticket_non_fungible_transfers(self, client, session): + """Test the life cycle of non-fungible tokens implemented using + tickets.""" + + manager_address = IDENTITIES['bootstrap1']['identity'] + + builders = session['non_fungible_builders'] + wallets = session['non_fungible_wallets'] + + def mint(builder, wallet, token_id): + """Mint a non-fungible token and assert that it has the expected + id.""" + builder_alias = f'nft_builder_{builder}' + expected_builder_storage = f'Pair "{manager_address}" {token_id}' + actual_builder_storage = client.get_storage(builder_alias) + assert expected_builder_storage == actual_builder_storage + + wallet_address = wallets[wallet] + parameter = f'"{wallet_address}%receive"' + client.transfer( + amount=0, + giver=manager_address, + receiver=builder_alias, + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'mint_destination', + '--arg', + parameter, + ], + ) + bake(client) + + def burn(builder, wallet, token_id): + """Burn a non-fungible token.""" + builder_addr = builders[builder] + parameter = ( + f'Pair "{builder_addr}%burn" "{builder_addr}" {token_id}' + ) + client.transfer( + amount=0, + giver=manager_address, + receiver=f'nft_wallet_{wallet}', + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'send', + '--arg', + parameter, + ], + ) + bake(client) + + def transfer(builder, source_wallet, destination_wallet, token_id): + """Transfer fungible tokens.""" + builder_addr = builders[builder] + dest_addr = wallets[destination_wallet] + parameter = ( + f'Pair "{dest_addr}%receive" "{builder_addr}" {token_id}' + ) + client.transfer( + amount=0, + giver=manager_address, + receiver=f'nft_wallet_{source_wallet}', + args=[ + '--burn-cap', + '2', + '--entrypoint', + 'send', + '--arg', + parameter, + ], + ) + bake(client) + + # A0 --> Alice + mint(builder="A", wallet="Alice", token_id=0) + # A1 --> Alice + mint(builder="A", wallet="Alice", token_id=1) + # B0 --> Alice + mint(builder="B", wallet="Alice", token_id=0) + + # Fail: Alice --C0--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="C", + source_wallet="Alice", + destination_wallet="Bob", + token_id=0, + ) + + # Fail: Alice --A2--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + token_id=2, + ) + + # Fail: Bob --A0--> Alice + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Alice", + token_id=0, + ) + + # Fail: Bob --A1--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Bob", + token_id=1, + ) + + # Alice --A1--> Bob + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + token_id=1, + ) + + # Alice --A0--> Bob + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + token_id=0, + ) + + # Fail: Alice --A1--> Bob + with assert_run_failure(r'script reached FAILWITH instruction'): + transfer( + builder="A", + source_wallet="Alice", + destination_wallet="Bob", + token_id=1, + ) + + # Bob --A0--> Bob + transfer( + builder="A", + source_wallet="Bob", + destination_wallet="Bob", + token_id=0, + ) + + # Bob --A0--> + burn(builder="A", wallet="Bob", token_id=0) + + # Bob --A1--> + burn(builder="A", wallet="Bob", token_id=1) + + # Fail: Bob --B0--> + with assert_run_failure(r'script reached FAILWITH instruction'): + burn(builder="B", wallet="Bob", token_id=0) + + # Alice --B0--> + burn(builder="B", wallet="Alice", token_id=0) + + +ORIGINATE_BIG_MAP_FILE = path.join( + OPCODES_CONTRACT_PATH, 'originate_big_map.tz' +) + + +@pytest.mark.incremental +@pytest.mark.contract +@pytest.mark.regression +class TestContractBigMapOrigination: + def test_big_map_origination_literal(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + # originate a first version of the contract from a literal so + # that a big_map with id 0 exists + init_with_transfer( + client, + ORIGINATE_BIG_MAP_FILE, + '{Elt 0 0}', + 1000, + 'bootstrap1', + contract_name='originate_big_map_literal', + ) + + def test_big_map_origination_id(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + # originate again the same script from the big-map id 0 + with assert_run_failure(r'Unexpected forged value'): + init_with_transfer( + client, + ORIGINATE_BIG_MAP_FILE, + '0', + 1000, + 'bootstrap1', + contract_name='originate_big_map_id', + ) + + def test_big_map_origination_diff(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + + # originate again the same script from a big-diff + with assert_run_failure(r'Unexpected forged value'): + init_with_transfer( + client, + ORIGINATE_BIG_MAP_FILE, + 'Pair 0 {Elt 1 (Some 4)}', + 1000, + 'bootstrap1', + contract_name='originate_big_map_diff', + ) + + def test_big_map_transfer_id(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + # call the first contract, passing an id as parameter + with assert_run_failure(r'Unexpected forged value'): + client.call( + source='bootstrap1', + destination='originate_big_map_literal', + args=['--arg', '0'], + ) + + def test_big_map_transfer_diff(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + # call the first contract, passing a diff as parameter + with assert_run_failure(r'Unexpected forged value'): + client.call( + source='bootstrap1', + destination='originate_big_map_literal', + args=['--arg', 'Pair 0 {Elt 1 (Some 4)}'], + ) + + +@pytest.mark.incremental +@pytest.mark.slow +@pytest.mark.contract +@pytest.mark.regression +class TestContractOnchainLevel: + """Onchain tests for LEVEL.""" + + # This test needs to be in a separate class to not depend on the number + # of operations happening before + + def test_level(self, client_regtest_scrubbed: ClientRegression): + client = client_regtest_scrubbed + + init_with_transfer( + client, + path.join(OPCODES_CONTRACT_PATH, 'level.tz'), + '9999999', + 100, + 'bootstrap1', + ) + bake(client) + client.transfer( + 500, "bootstrap1", 'level', ['-arg', 'Unit', '--burn-cap', '10'] + ) + bake(client) + level = client.get_level() + slevel = str(level) + assert_storage_contains(client, 'level', slevel) + bake(client) + bake(client) + # checks the storage hasn't changed even though the current level has + assert_storage_contains(client, 'level', slevel) + # Run again to check the storage gets updated + client.transfer( + 500, "bootstrap1", 'level', ['-arg', 'Unit', '--burn-cap', '10'] + ) + bake(client) + assert_storage_contains(client, 'level', str(level + 3)) diff --git a/tests_python/tests_016/test_contract_opcodes.py b/tests_python/tests_016/test_contract_opcodes.py new file mode 100644 index 000000000000..7d8d784d5f41 --- /dev/null +++ b/tests_python/tests_016/test_contract_opcodes.py @@ -0,0 +1,500 @@ +from os import path + +import pytest + +from tools.client_regression import ClientRegression +from tools.constants import IDENTITIES +from tools.utils import ( + assert_run_failure, + assert_run_script_failwith, + assert_run_script_success, +) +from .contract_paths import MINI_SCENARIOS_CONTRACT_PATH, OPCODES_CONTRACT_PATH + + +PUBLIC_KEY = IDENTITIES['bootstrap1']['public'] + + +@pytest.mark.slow +@pytest.mark.contract +@pytest.mark.regression +class TestContractOpcodes: + """Tests for individual opcodes that do not require origination.""" + + @pytest.mark.parametrize("balance", [0, 0.000001, 0.5, 1, 5, 1000, 8e12]) + def test_balance(self, client_regtest: ClientRegression, balance: float): + client = client_regtest + contract = 'balance.tz' + contract = path.join(OPCODES_CONTRACT_PATH, contract) + run_script_res = client.run_script( + contract, '0', 'Unit', balance=balance, trace_stack=True + ) + assert run_script_res.storage == str(int(1000000 * balance)) + + def test_now(self, client_regtest: ClientRegression): + """Test that the --now flag of 'octez-client run script' affects the + value returned by the NOW instruction. See also + test_contract_onchain_opcodes.py for a complementary test of the NOW + instruction.""" + client = client_regtest + contract = 'store_now.tz' + initial_storage = '"2017-07-13T09:19:01Z"' + now = '2021-10-13T10:16:52Z' + contract = path.join(OPCODES_CONTRACT_PATH, contract) + run_script_res = client.run_script( + contract, + storage=initial_storage, + inp='Unit', + now=now, + trace_stack=True, + ) + assert run_script_res.storage == f'"{now}"' + + def test_level(self, client_regtest: ClientRegression): + """Test that the --level flag of 'octez-client run script' affects the + value returned by the LEVEL instruction. See also + test_contract_onchain_opcodes.py for a complementary test of the LEVEL + instuction.""" + client = client_regtest + contract = 'level.tz' + initial_storage = '9999999' + level = 10 + contract = path.join(OPCODES_CONTRACT_PATH, contract) + run_script_res = client.run_script( + contract, + storage=initial_storage, + inp='Unit', + level=level, + trace_stack=True, + ) + assert run_script_res.storage == f'{level}' + + @pytest.mark.parametrize( + "contract,param,storage,expected,big_map_diff", + [ # FORMAT: assert_output contract_file storage input expected_result + # expected_diffs + # Get the value stored at the given key in the big map + ( + 'get_big_map_value.tz', + '(Pair { Elt "hello" "hi" } None)', + '"hello"', + '(Pair 4 (Some "hi"))', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["hello"] to "hi"'], + ], + ), + ( + 'get_big_map_value.tz', + '(Pair { Elt "hello" "hi" } None)', + '""', + '(Pair 4 None)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["hello"] to "hi"'], + ], + ), + ( + 'get_big_map_value.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } None)', + '"1"', + '(Pair 4 (Some "one"))', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Set map(4)["1"] to "one"'], + ], + ), + # Test updating big maps + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{}', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Set map(4)["1"] to "one"'], + ], + ), + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{ Elt "1" (Some "two") }', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Set map(4)["1"] to "two"'], + ], + ), + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{ Elt "3" (Some "three") }', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Set map(4)["3"] to "three"'], + ['Set map(4)["1"] to "one"'], + ], + ), + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{ Elt "3" None }', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Unset map(4)["3"]'], + ['Set map(4)["1"] to "one"'], + ], + ), + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{ Elt "2" None }', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Unset map(4)["2"]'], + ['Set map(4)["1"] to "one"'], + ], + ), + ( + 'update_big_map.tz', + '(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)', + '{ Elt "1" (Some "two") }', + '(Pair 4 Unit)', + [ + ["New map(4) of type (big_map string string)"], + ['Set map(4)["2"] to "two"'], + ['Set map(4)["1"] to "two"'], + ], + ), + # test the GET_AND_UPDATE instruction on big maps + # Get and update the value stored at the given key in the map + ( + 'get_and_update_big_map.tz', + '(Pair None {})', + '"hello"', + '(Pair None 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Unset map(4)["hello"]'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair (Some 4) {})', + '"hello"', + '(Pair None 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Set map(4)["hello"] to 4'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair None { Elt "hello" 4 })', + '"hello"', + '(Pair (Some 4) 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Unset map(4)["hello"]'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair (Some 5) { Elt "hello" 4 })', + '"hello"', + '(Pair (Some 4) 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Set map(4)["hello"] to 5'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair (Some 5) { Elt "hello" 4 })', + '"hi"', + '(Pair None 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Set map(4)["hello"] to 4'], + ['Set map(4)["hi"] to 5'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair None { Elt "1" 1 ; \ + Elt "2" 2 })', + '"1"', + '(Pair (Some 1) 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Set map(4)["2"] to 2'], + ['Unset map(4)["1"]'], + ], + ), + ( + 'get_and_update_big_map.tz', + '(Pair None { Elt "1" 1 ; \ + Elt "2" 2 })', + '"1"', + '(Pair (Some 1) 4)', + [ + ["New map(4) of type (big_map string nat)"], + ['Set map(4)["2"] to 2'], + ['Unset map(4)["1"]'], + ], + ), + ], + ) + def test__big_map_contract_io( + self, + client_regtest: ClientRegression, + contract: str, + param: str, + storage: str, + expected: str, + big_map_diff: str, + ): + client = client_regtest + contract = path.join(OPCODES_CONTRACT_PATH, contract) + run_script_res = client.run_script( + contract, param, storage, trace_stack=True + ) + assert run_script_res.storage == expected + assert run_script_res.big_map_diff == big_map_diff + + @pytest.mark.parametrize( + "storage,param,expected,big_map_diff", + [ # test swap + ( + '(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))', + '(Left Unit)', + '(Left (Pair 4 5))', + [ + ['New map(5) of type (big_map string string)'], + ['Set map(5)["1"] to "one"'], + ['New map(4) of type (big_map string string)'], + ['Set map(4)["2"] to "two"'], + ], + ), + # test reset with new map + ( + '(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))', + '(Right (Left (Left (Pair { Elt "3" "three" } ' + + '{ Elt "4" "four" }))))', + '(Left (Pair 4 5))', + [ + ['New map(5) of type (big_map string string)'], + ['Set map(5)["4"] to "four"'], + ['New map(4) of type (big_map string string)'], + ['Set map(4)["3"] to "three"'], + ], + ), + # test reset to unit + ( + '(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))', + '(Right (Left (Right Unit)))', + '(Right Unit)', + [], + ), + # test import to big_map + ( + '(Right Unit)', + '(Right (Right (Left (Pair { Pair "foo" "bar" } ' + + '{ Pair "gaz" "baz" }) )))', + '(Left (Pair 4 5))', + [ + ['New map(5) of type (big_map string string)'], + ['Set map(5)["gaz"] to "baz"'], + ['New map(4) of type (big_map string string)'], + ['Set map(4)["foo"] to "bar"'], + ], + ), + # test add to big_map + ( + '(Left (Pair { Elt "1" "one" } { Elt "2" "two" }) )', + '(Right (Right (Right (Left { Pair "3" "three" }))))', + '(Left (Pair 4 5))', + [ + ['New map(5) of type (big_map string string)'], + ['Set map(5)["2"] to "two"'], + ['New map(4) of type (big_map string string)'], + ['Set map(4)["3"] to "three"'], + ['Set map(4)["1"] to "one"'], + ], + ), + # test remove from big_map + ( + '(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))', + '(Right (Right (Right (Right { "1" }))))', + '(Left (Pair 4 5))', + [ + ['New map(5) of type (big_map string string)'], + ['Set map(5)["2"] to "two"'], + ['New map(4) of type (big_map string string)'], + ['Unset map(4)["1"]'], + ], + ), + ], + ) + def test_big_map_magic( + self, + client_regtest: ClientRegression, + storage: str, + param: str, + expected: str, + big_map_diff: str, + ): + client = client_regtest + contract = path.join(MINI_SCENARIOS_CONTRACT_PATH, 'big_map_magic.tz') + run_script_res = client.run_script( + contract, storage, param, trace_stack=True + ) + assert run_script_res.storage == expected + assert run_script_res.big_map_diff == big_map_diff + + def test_packunpack(self, client_regtest: ClientRegression): + """Test PACK/UNPACK and binary format.""" + client = client_regtest + assert_run_script_success( + client, + path.join(OPCODES_CONTRACT_PATH, 'packunpack.tz'), + 'Unit', + '(Pair (Pair (Pair "toto" {3;7;9;1}) {1;2;3}) ' + + '0x05070707070100000004746f746f020000000800030' + + '007000900010200000006000100020003)', + ) + assert_run_script_failwith( + client, + path.join(OPCODES_CONTRACT_PATH, 'packunpack.tz'), + 'Unit', + '(Pair (Pair (Pair "toto" {3;7;9;1}) {1;2;3}) ' + + '0x05070707070100000004746f746f020000000800030' + + '0070009000102000000060001000200030004)', + ) + + def test_check_signature(self, client_regtest: ClientRegression): + client = client_regtest + sig = ( + 'edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt' + + '9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF' + ) + assert_run_script_success( + client, + path.join(OPCODES_CONTRACT_PATH, 'check_signature.tz'), + f'(Pair "{sig}" "hello")', + '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"', + ) + assert_run_script_failwith( + client, + path.join(OPCODES_CONTRACT_PATH, 'check_signature.tz'), + f'(Pair "{sig}" "abcd")', + '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"', + ) + + def test_hash_consistency_michelson_cli( + self, client_regtest: ClientRegression + ): + client = client_regtest + hash_result = client.hash( + '(Pair 22220000000 (Pair "2017-12-13T04:49:00Z" 034))', + '(pair mutez (pair timestamp int))', + ).blake2b + hash_contract = path.join( + OPCODES_CONTRACT_PATH, 'hash_consistency_checker.tz' + ) + run_script_res = client.run_script( + hash_contract, + '0x00', + '(Pair 22220000000 (Pair "2017-12-13T04:49:00Z" 034))', + trace_stack=True, + ) + assert run_script_res.storage == hash_result + run_script_res = client.run_script( + hash_contract, + '0x00', + '(Pair 22220000000 (Pair "2017-12-13T04:49:00Z" 034))', + trace_stack=True, + ) + assert run_script_res.storage == hash_result + + @pytest.mark.parametrize( + "contract,param,storage", + [ # FORMAT: assert_output contract_file storage input + # Test overflow in shift + ('shifts.tz', 'None', '(Left (Pair 1 257))'), + ('shifts.tz', 'None', '(Left (Pair 123 257))'), + ('shifts.tz', 'None', '(Right (Pair 1 257))'), + ('shifts.tz', 'None', '(Right (Pair 123 257))'), + ('mul_overflow.tz', 'Unit', 'Left Unit'), + ('mul_overflow.tz', 'Unit', 'Right Unit'), + ], + ) + def test_arithmetic_overflow( + self, + client_regtest_scrubbed: ClientRegression, + contract: str, + param: str, + storage: str, + ): + client = client_regtest_scrubbed + contract = path.join(OPCODES_CONTRACT_PATH, contract) + + with assert_run_failure(r'unexpected arithmetic overflow'): + client.run_script(contract, param, storage, trace_stack=True) + + @pytest.mark.skip(reason="Bug in annotation system") + def test_fails_annotated_set_car_cdr( + self, client_regtest: ClientRegression + ): + """Tests the SET_CAR and SET_CDR instructions.""" + client = client_regtest + + with assert_run_failure(r'The two annotations do not match'): + client.run_script( + path.join(OPCODES_CONTRACT_PATH, 'set_car.tz'), + '(Pair %wrong %field "hello" 0)', + '""', + trace_stack=True, + ) + + @pytest.mark.parametrize( + "contract,storage,param,expected", + [ # FORMAT: assert_output contract_file storage input expected_result + # Mapping over maps + ('map_map_sideeffect.tz', '(Pair {} 0)', '10', '(Pair {} 0)'), + ( + 'map_map_sideeffect.tz', + '(Pair { Elt "foo" 1 } 1)', + '10', + '(Pair { Elt "foo" 11 } 11)', + ), + ( + 'map_map_sideeffect.tz', + '(Pair { Elt "bar" 5 ; Elt "foo" 1 } 6)', + '15', + '(Pair { Elt "bar" 20 ; Elt "foo" 16 } 36)', + ), + ], + ) + def test_map_map_sideeffect( + self, + client_regtest: ClientRegression, + contract: str, + param: str, + storage: str, + expected: str, + ): + client = client_regtest + contract = path.join(OPCODES_CONTRACT_PATH, contract) + run_script_res = client.run_script( + contract, storage, param, trace_stack=True + ) + assert run_script_res.storage == expected diff --git a/tests_python/tests_016/test_cors.py b/tests_python/tests_016/test_cors.py new file mode 100644 index 000000000000..80b064285d86 --- /dev/null +++ b/tests_python/tests_016/test_cors.py @@ -0,0 +1,47 @@ +import pytest +from daemons.node import Node +from launchers.sandbox import Sandbox +from tools import utils + + +@pytest.fixture(scope="class") +def node(sandbox: Sandbox): + """Launches one node in sandbox mode (genesis)""" + sandbox.add_node(0, params=['--cors-origin', '*']) + yield sandbox.node(0) + + +class TestCors: + def test_preflight(self, node: Node): + origin = 'localhost' + port = node.rpc_port + headers = { + 'Origin': origin, + 'Access-Control-Request-Method': 'GET', + 'Access-Control-Request-Headers': 'Content-Type', + } + res = utils.rpc( + origin, + port, + 'options', + '/chains/main/blocks/head/header/shell', + headers=headers, + ) + print(res.headers) + assert res.headers["access-control-allow-origin"] == '*' + assert res.headers["access-control-allow-methods"] == 'GET' + assert res.headers["access-control-allow-headers"] == 'Content-Type' + + def test_request(self, node: Node): + origin = 'localhost' + port = node.rpc_port + headers = {'Origin': origin, 'Content-Type': 'application/json'} + res = utils.rpc( + origin, + port, + 'get', + '/chains/main/blocks/head/header/shell', + headers=headers, + ) + print(res.headers) + assert res.headers["access-control-allow-origin"] == '*' diff --git a/tests_python/tests_016/test_forge_block.py b/tests_python/tests_016/test_forge_block.py new file mode 100755 index 000000000000..7d7ba2ed06ed --- /dev/null +++ b/tests_python/tests_016/test_forge_block.py @@ -0,0 +1,46 @@ +import datetime +import pytest +from tools import constants +from tools.constants import PROTO_DEMO_NOOPS +from launchers.sandbox import Sandbox + + +@pytest.mark.slow +@pytest.mark.incremental +class TestForgeBlock: + """Check that a block more than 5 seconds in the future is rejected""" + + def test_setup_network(self, sandbox: Sandbox): + sandbox.add_node(1, params=constants.NODE_PARAMS) + + def test_protocol_exists(self, sandbox: Sandbox): + client = sandbox.client(1) + protocols = client.list_protocols() + assert PROTO_DEMO_NOOPS in protocols + + def test_activate_proto_demo_time_shifted_ok(self, sandbox: Sandbox): + parameters = {} # type: dict + delta = datetime.timedelta(seconds=5) + sandbox.client(1).activate_protocol_json( + PROTO_DEMO_NOOPS, + parameters, + key='activator', + timestamp=(datetime.datetime.utcnow() + delta).strftime( + "%Y-%m-%dT%H:%M:%SZ" + ), + fitness='1', + ) + + @pytest.mark.xfail + def test_activate_proto_demo_time_shifted_ko(self, sandbox: Sandbox): + parameters = {} # type: dict + delta = datetime.timedelta(seconds=30) + sandbox.client(1).activate_protocol_json( + PROTO_DEMO_NOOPS, + parameters, + key='activator', + timestamp=(datetime.datetime.utcnow() + delta).strftime( + "%Y-%m-%dT%H:%M:%SZ" + ), + fitness='1', + ) diff --git a/tests_python/tests_016/test_fork.py b/tests_python/tests_016/test_fork.py new file mode 100644 index 000000000000..0ce7d92a6a53 --- /dev/null +++ b/tests_python/tests_016/test_fork.py @@ -0,0 +1,88 @@ +import pytest +from tools import utils, constants +from launchers.sandbox import Sandbox +from . import protocol + + +NUM_NODES = 3 + + +@pytest.mark.multinode +@pytest.mark.incremental +class TestFork: + """Constructs two independent branches on disconnected subsets of nodes, + one head has higher fitness. At reconnection, check the the highest + fitness head is the chosen one""" + + def test_init(self, sandbox: Sandbox): + for i in range(NUM_NODES): + sandbox.add_node(i, params=constants.NODE_PARAMS) + parameters = protocol.get_parameters() + parameters['consensus_threshold'] = 0 + protocol.activate( + sandbox.client(0), parameters=parameters, activate_in_the_past=True + ) + + def test_level(self, sandbox: Sandbox): + level = 1 + for client in sandbox.all_clients(): + assert utils.check_level(client, level) + + def test_terminate_nodes_1_and_2(self, sandbox: Sandbox): + sandbox.node(1).terminate() + sandbox.node(2).terminate() + + def test_bake_node_0(self, sandbox: Sandbox): + """Client 0 bakes block A at level 2, not communicated to 1 and 2""" + utils.bake(sandbox.client(0)) + + def test_endorse_node_0(self, sandbox: Sandbox, session: dict): + """bootstrap1 builds an endorsement for block A""" + client = sandbox.client(0) + client.run(["endorse", "for", "bootstrap1", "--force"]) + mempool = client.get_mempool() + endorsement = mempool['applied'][0] + session['endorsement1'] = endorsement + + def test_bake_node_0_again(self, sandbox: Sandbox): + """Client 0 bakes block A' at level 3, not communicated to 1 and 2""" + utils.bake(sandbox.client(0), bake_for='bootstrap1') + + def test_first_branch(self, sandbox: Sandbox, session: dict): + head = sandbox.client(0).get_head() + assert head['header']['level'] == 3 + session['hash1'] = head['hash'] + assert len(head['operations'][0]) == 1 + + def test_terminate_node_0(self, sandbox: Sandbox): + sandbox.node(0).terminate() + + def test_restart_node_2(self, sandbox: Sandbox): + sandbox.node(2).run() + assert sandbox.client(2).check_node_listening() + + def test_bake_node_2(self, sandbox: Sandbox): + """Client 2 bakes block B at level 2, not communicated to 0 and 1""" + utils.bake(sandbox.client(2), bake_for='bootstrap1') + + def test_bake_node_2_again(self, sandbox: Sandbox): + """Client 2 bakes block B' at level 3, not communicated to 0 and 1""" + utils.bake(sandbox.client(2), bake_for='bootstrap1') + + def test_second_branch(self, sandbox: Sandbox, session: dict): + head = sandbox.client(2).get_head() + session['hash2'] = head['hash'] + assert head['header']['level'] == 3 + assert len(head['operations'][0]) == 1 + + def test_restart_all(self, sandbox: Sandbox): + sandbox.node(0).run() + sandbox.node(1).run() + assert sandbox.client(0).check_node_listening() + assert sandbox.client(1).check_node_listening() + + def test_check_head(self, sandbox: Sandbox, session: dict): + """All nodes are at level 3, head should be hash1""" + for client in sandbox.all_clients(): + head = client.get_head() + assert session['hash1'] == head['hash'] diff --git a/tests_python/tests_016/test_liquidity_baking.py b/tests_python/tests_016/test_liquidity_baking.py new file mode 100644 index 000000000000..17aaafa06305 --- /dev/null +++ b/tests_python/tests_016/test_liquidity_baking.py @@ -0,0 +1,279 @@ +import pytest + +from tools import utils +from tools.constants import IDENTITIES + +DEX = "KT1TxqZ8QtKvLu3V3JH7Gx58n7Co8pgtpQU5" +TOK = "KT1VqarPDicMFn1ejmQqqshUkUXTCTXwmkCN" +LQT = "KT1AafHA1C1vk959wvHWBispY9Y2f3fxBUUo" +BOOTSTRAP1 = IDENTITIES['bootstrap1']['identity'] +TOK_ADMIN = BOOTSTRAP1 +BOOTSTRAP2 = IDENTITIES['bootstrap2']['identity'] +BOOTSTRAP3 = IDENTITIES['bootstrap3']['identity'] +FUTURE = "2050-01-01T00:00:00Z" + + +@pytest.mark.contract +@pytest.mark.regression +@pytest.mark.incremental +class SetupMintAndApprove: + """Test calling entrypoints of liquidity baking contracts""" + + def test_setup(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + assert DEX == client.rpc( + 'get', + "/chains/main/blocks/head/context/liquidity_baking/cpmm_address", + ) + dex_storage = client.get_storage(DEX).split() + assert dex_storage[4].strip('"') == TOK + assert dex_storage[5].strip('"') == LQT + + # mint some test TOK (1 tzBTC?) for ourselves + def test_call_mint_or_burn(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + TOK_ADMIN, + TOK, + [ + '--entrypoint', + 'mintOrBurn', + '--arg', + f'(Pair 100000000 "{BOOTSTRAP1}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # pre-approve big allowances in TOK for DEX + def test_call_approve1(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap1', + TOK, + [ + '--entrypoint', + 'approve', + '--arg', + f'(Pair "{DEX}" 1000000000)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + def test_call_approve2(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap2', + TOK, + [ + '--entrypoint', + 'approve', + '--arg', + f'(Pair "{DEX}" 1000000000)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + def test_call_approve3(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap3', + TOK, + [ + '--entrypoint', + 'approve', + '--arg', + f'(Pair "{DEX}" 1000000000)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + +@pytest.mark.contract +@pytest.mark.regression +@pytest.mark.incremental +class TestAddApproveTransferRemove(SetupMintAndApprove): + """Test add/approve/transfer/remove liquidity""" + + # first add liquidity on DEX so that we have some LQT + def test_add_liquidity(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.transfer( + 9001, + 'bootstrap1', + DEX, + [ + '--entrypoint', + 'addLiquidity', + '--arg', + f'(Pair "{BOOTSTRAP1}" 0 1000000000 "{FUTURE}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # test LQT approval + def test_approval(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap1', + LQT, + [ + '--entrypoint', + 'approve', + '--arg', + f'(Pair "{BOOTSTRAP2}" 1000)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # transfer LQT to bootstrap2 (using approval) + def test_approved_transfer(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap2', + LQT, + [ + '--entrypoint', + 'transfer', + '--arg', + f'(Pair "{BOOTSTRAP1}" "{BOOTSTRAP2}" 1000)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # now remove LQT for bootstrap2 + def test_remove_liquidity(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap2', + DEX, + [ + '--entrypoint', + 'removeLiquidity', + '--arg', + f'(Pair "{BOOTSTRAP2}" 1000 0 0 "{FUTURE}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # check DEX storage + def test_dex_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(DEX) + + # check LQT storage + def test_lqt_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(LQT) + + # check TOK storage + def test_tok_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(TOK) + + +@pytest.mark.contract +@pytest.mark.regression +@pytest.mark.incremental +class TestTrades(SetupMintAndApprove): + """Test trades""" + + # add liquidity + def test_add_liquidity(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.transfer( + 9001, + 'bootstrap1', + DEX, + [ + '--entrypoint', + 'addLiquidity', + '--arg', + f'(Pair "{BOOTSTRAP1}" 0 1000000000 "{FUTURE}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # bootstrap2 buys some TOK + def test_buy_tok(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.transfer( + 9001, + 'bootstrap2', + DEX, + [ + '--entrypoint', + 'xtzToToken', + '--arg', + f'(Pair "{BOOTSTRAP2}" 0 "{FUTURE}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # bootstrap2 transfers TOK to bootstrap3 + def test_transfer(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap2', + TOK, + [ + '--entrypoint', + 'transfer', + '--arg', + f'(Pair "{BOOTSTRAP2}" "{BOOTSTRAP3}" 100)', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # bootstrap3 sells TOK + def test_sell_tok(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.call( + 'bootstrap3', + DEX, + [ + '--entrypoint', + 'tokenToXtz', + '--arg', + f'(Pair "{BOOTSTRAP3}" 100 0 "{FUTURE}")', + '--burn-cap', + '10', + ], + ) + utils.bake(client, 'bootstrap5') + + # check DEX storage + def test_dex_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(DEX) + + # check LQT storage + def test_lqt_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(LQT) + + # check TOK storage + def test_tok_storage(self, client_regtest_scrubbed): + client = client_regtest_scrubbed + client.get_storage(TOK) diff --git a/tests_python/tests_016/test_many_bakers.py b/tests_python/tests_016/test_many_bakers.py new file mode 100644 index 000000000000..b08bc4e2ecdb --- /dev/null +++ b/tests_python/tests_016/test_many_bakers.py @@ -0,0 +1,47 @@ +import time +import pytest +from tools import utils, constants +from launchers.sandbox import Sandbox +from . import protocol + +# TODO parameterize test + +MINIMAL_BLOCK_DELAY = 15 + + +@pytest.mark.baker +@pytest.mark.multinode +@pytest.mark.slow +@pytest.mark.incremental +class TestManyBakers: + """Run 5 bakers and num nodes, wait and check logs""" + + def test_init(self, sandbox: Sandbox): + for i in range(10): + sandbox.add_node(i, params=constants.NODE_PARAMS) + protocol.activate(sandbox.client(0)) + for i in range(5): + sandbox.add_baker( + i, + [f'bootstrap{i + 1}'], + proto=protocol.DAEMON, + run_params=['--liquidity-baking-toggle-vote', 'pass'], + ) + + def test_wait(self): + # expects two level to be added to level start + time.sleep(2 * MINIMAL_BLOCK_DELAY) + + def test_progress(self, sandbox: Sandbox): + min_level = min( + [client.get_level() for client in sandbox.all_clients()] + ) + assert min_level >= 3 + + @pytest.mark.xfail + def test_check_logs(self, sandbox: Sandbox): + if not sandbox.log_dir: + pytest.skip() + assert sandbox.logs + error_pattern = r"canceled|crashed" + assert utils.check_logs(sandbox.logs, error_pattern) diff --git a/tests_python/tests_016/test_many_nodes.py b/tests_python/tests_016/test_many_nodes.py new file mode 100644 index 000000000000..e6a9eed2f7b1 --- /dev/null +++ b/tests_python/tests_016/test_many_nodes.py @@ -0,0 +1,71 @@ +import random +import time +import pytest +from tools import utils, constants +from launchers.sandbox import Sandbox +from . import protocol + +NUM_NODES = 5 +NEW_NODES = 3 +REPLACE = False +ERROR_PATTERN = r"Uncaught|registered" + + +@pytest.mark.baker +@pytest.mark.multinode +@pytest.mark.slow +@pytest.mark.incremental +class TestManyNodesBootstrap: + """Run many nodes, wait a while, run more nodes, check logs""" + + def test_init(self, sandbox: Sandbox): + sandbox.add_node(0, params=constants.NODE_PARAMS) + parameters = dict(protocol.PARAMETERS) + # smaller threshold to make (almost sure) that 3/5 of the delegates + # have enough endorsing power + parameters['consensus_threshold'] = 5 + parameters['minimal_block_delay'] = '3' + parameters['delay_increment_per_round'] = '1' + protocol.activate(sandbox.client(0), parameters) + for i in range(1, NEW_NODES): + sandbox.add_node(i, params=constants.NODE_PARAMS) + for i in range(3): + sandbox.add_baker( + i, + [f'bootstrap{i + 1}'], + proto=protocol.DAEMON, + run_params=['--liquidity-baking-toggle-vote', 'pass'], + ) + + def test_add_nodes(self, sandbox: Sandbox): + for i in range(NEW_NODES, NUM_NODES): + sandbox.add_node(i, params=constants.NODE_PARAMS) + + def test_sleep_30s(self): + time.sleep(30) + + def test_add_more_nodes(self, sandbox: Sandbox): + new_node = NUM_NODES + for i in range(NEW_NODES): + if REPLACE: + running_nodes = list(sandbox.nodes.keys()) + sandbox.rm_node(random.choice(running_nodes)) + sandbox.add_node(new_node + i, params=constants.NODE_PARAMS) + + def test_kill_baker(self, sandbox: Sandbox): + assert utils.check_logs(sandbox.logs, ERROR_PATTERN) + for i in range(3): + sandbox.rm_baker(i, proto=protocol.DAEMON) + + def test_synchronize(self, sandbox: Sandbox): + utils.synchronize(sandbox.all_clients()) + + def test_progress(self, sandbox: Sandbox): + level = sandbox.client(0).get_level() + assert level >= 5 + + def test_check_logs(self, sandbox: Sandbox): + if not sandbox.log_dir: + pytest.skip() + assert sandbox.logs + assert utils.check_logs(sandbox.logs, ERROR_PATTERN) diff --git a/tests_python/tests_016/test_mempool.py b/tests_python/tests_016/test_mempool.py new file mode 100644 index 000000000000..f10c3d523a42 --- /dev/null +++ b/tests_python/tests_016/test_mempool.py @@ -0,0 +1,66 @@ +import pytest +from tools import utils, constants +from launchers.sandbox import Sandbox + +from . import protocol + + +@pytest.mark.mempool +@pytest.mark.multinode +@pytest.mark.slow +@pytest.mark.incremental +class TestMempool: + "Tests mempool" + + def test_init(self, sandbox: Sandbox): + sandbox.add_node(1, params=constants.NODE_PARAMS) + sandbox.add_node(2, params=constants.NODE_PARAMS) + sandbox.add_node( + 3, params=constants.NODE_PARAMS + ['--disable-mempool'] + ) + protocol.activate(sandbox.client(1), activate_in_the_past=True) + + def test_level1(self, sandbox: Sandbox): + level = 1 + for client in sandbox.all_clients(): + assert utils.check_level(client, level) + + def test_running_prevalidators(self, sandbox: Sandbox): + assert sandbox.client(1).get_prevalidator() + assert sandbox.client(2).get_prevalidator() + assert not sandbox.client(3).get_prevalidator() + + def test_mempool_empty(self, sandbox: Sandbox): + for i in range(1, 4): + assert sandbox.client(i).mempool_is_empty() + + def test_transfer(self, sandbox: Sandbox, session: dict): + client = sandbox.client(1) + session['trsfr_hash'] = client.transfer( + 1.000, 'bootstrap1', 'bootstrap2' + ).operation_hash + + def test_mempool_include_transfer(self, sandbox: Sandbox, session: dict): + assert utils.check_mempool_contains_operations( + sandbox.client(1), [session['trsfr_hash']] + ) + assert utils.check_mempool_contains_operations( + sandbox.client(2), [session['trsfr_hash']] + ) + assert sandbox.client(3).mempool_is_empty() + + def test_bake_for1(self, sandbox: Sandbox): + utils.bake(sandbox.client(1)) + + def test_level2(self, sandbox: Sandbox): + level = 2 + for client in sandbox.all_clients(): + assert utils.check_level(client, level) + + def test_mempools_are_empty(self, sandbox: Sandbox): + for i in range(1, 4): + assert sandbox.client(i).mempool_is_empty() + + def test_injection_fails_on_mempool_disabled_node(self, sandbox: Sandbox): + with pytest.raises(Exception): + sandbox.client(3).transfer(2.000, 'bootstrap2', 'bootstrap3') diff --git a/tests_python/tests_016/test_multinode_storage_reconstruction.py b/tests_python/tests_016/test_multinode_storage_reconstruction.py new file mode 100644 index 000000000000..e232799c7bbc --- /dev/null +++ b/tests_python/tests_016/test_multinode_storage_reconstruction.py @@ -0,0 +1,191 @@ +import pytest +from tools import utils +from launchers.sandbox import Sandbox +from . import protocol + +NODE_PARAMS = ['--bootstrap-threshold', '0'] +parameters = protocol.get_parameters() + +# the default number of cycles stored by a full/rolling node +DEFAULT_ADDITIONAL_CYCLES = 5 +ALPHA_ACTIVATION_LEVEL = 1 +# BATCH_1 represents the number of levels needed for the whole store +# to be cemented +BATCH_1 = ( + parameters['preserved_cycles'] + DEFAULT_ADDITIONAL_CYCLES +) * parameters['blocks_per_cycle'] + ALPHA_ACTIVATION_LEVEL + +# To be able to reconstruct the storage we need to bake enough blocks +# in order to exceed both the max_op_ttl and the lafl, plus a few +# blocks to escape the activation block and the trigger of the store's +# cementing. +BATCH_2 = ( + parameters['max_operations_time_to_live'] + + parameters['preserved_cycles'] * parameters['blocks_per_cycle'] + + 5 +) + +SNAPSHOT_1 = f'snapshot_block_{BATCH_1}.full' +SNAPSHOT_2 = f'snapshot_block_{BATCH_2}.full' + + +def clear_cache(sandbox, node_id): + # Restart node to clear the store's cache + sandbox.node(node_id).terminate_or_kill() + sandbox.node(node_id).run() + assert sandbox.client(node_id).check_node_listening() + + +@pytest.mark.multinode +@pytest.mark.incremental +@pytest.mark.snapshot +@pytest.mark.slow +class TestMultiNodeStorageReconstruction: + def test_init(self, sandbox: Sandbox): + sandbox.add_node(0, params=NODE_PARAMS) + protocol.activate( + sandbox.client(0), parameters=parameters, activate_in_the_past=True + ) + # Keep node 3 in the dance + # History mode by default (full) + sandbox.add_node(3, params=NODE_PARAMS) + + # Node 0 bakes a few blocks + def test_bake_node0_level_a(self, sandbox: Sandbox, session: dict): + for _ in range(BATCH_1): + utils.bake(sandbox.client(0)) + session['head_hash'] = sandbox.client(0).get_head()['hash'] + session['head_level'] = sandbox.client(0).get_head()['header']['level'] + + # Node 3 tries to reconstruct its storage after the first batch. + # Reconstruct is expected to fail: nothing to reconstruct + def test_reconstruct_on_bootstrapped_node(self, sandbox: Sandbox): + # Stop, reconstruct the storage and restart the node + sandbox.node(3).terminate_or_kill() + pattern = 'nothing to reconstruct.' + with utils.assert_run_failure(pattern): + sandbox.node(3).reconstruct() + sandbox.node(3).run() + assert sandbox.client(3).check_node_listening() + + # Node 0 exports a snapshot + def test_export_snapshot_batch1(self, sandbox: Sandbox, session: dict): + node_export = sandbox.node(0) + session['snapshot_1_head_hash'] = session['head_hash'] + session['snapshot_1_head_level'] = session['head_level'] + file = f'{sandbox.node(0).node_dir}/{SNAPSHOT_1}' + export_level = session['head_level'] + assert export_level == (BATCH_1 + 1) + node_export.snapshot_export(file, params=['--block', f'{export_level}']) + + # Node 1 import and reconstruct (using the `--reconstruct` + # flag of the `snapshot import` command) + def test_node1_import_and_reconstruct( + self, sandbox: Sandbox, session: dict + ): + n0_tmpdir = sandbox.node(0).node_dir + file = f'{n0_tmpdir}/{SNAPSHOT_1}' + sandbox.add_node( + 1, + snapshot=file, + reconstruct=True, + params=NODE_PARAMS, + ) + assert utils.check_level(sandbox.client(1), session['head_level']) + clear_cache(sandbox, 1) + + # Test that all the reconstructed blocks can be requested + # with their metadata + def test_node1_request_all_blocks_with_metadata( + self, sandbox: Sandbox, session: dict + ): + for i in range(session['head_level']): + assert utils.get_block_at_level(sandbox.client(1), i) + + # Node 2 import and then reconstruct using the dedicated command. + def test_import_before_reconstruct(self, sandbox: Sandbox, session: dict): + n0_tmpdir = sandbox.node(0).node_dir + file = f'{n0_tmpdir}/{SNAPSHOT_1}' + sandbox.add_node(2, snapshot=file) + assert utils.check_level(sandbox.client(2), session['head_level']) + + # Checking node's 2 storage + def test_unavailable_blocks_node2(self, sandbox: Sandbox, session: dict): + # We must fail while requesting those pruned blocks + for i in range(1, session['snapshot_1_head_level'] - 1): + utils.get_block_metadata_at_level( + sandbox.client(2), i, expect_failure=True + ) + + # Call the reconstruct command on Node 2 + def test_reconstruct_after_snapshot_import(self, sandbox: Sandbox): + # Stop, reconstruct the storage and restart the node + sandbox.node(2).terminate_or_kill() + sandbox.node(2).reconstruct() + sandbox.node(2).run() + assert sandbox.client(2).check_node_listening() + + # Test that all the reconstructed blocks can be requested + # with their metadata + def test_available_blocks_node_2(self, sandbox: Sandbox, session: dict): + # We should now success requesting those reconstructed blocks + for i in range(session['head_level']): + assert utils.get_block_at_level(sandbox.client(2), i) + + # Second batch + + # Bake a few blocks + def test_bake_node0_level_b(self, sandbox: Sandbox, session: dict): + for _ in range(BATCH_2 - BATCH_1): + utils.bake(sandbox.client(0)) + session['head_hash'] = sandbox.client(0).get_head()['hash'] + session['head_level'] = sandbox.client(0).get_head()['header']['level'] + assert utils.check_level(sandbox.client(0), session['head_level']) + assert utils.check_level(sandbox.client(1), session['head_level']) + assert utils.check_level(sandbox.client(2), session['head_level']) + + # Node 0 exports a snapshot (with no floating to reconstruct) + def test_export_snapshot_batch2(self, sandbox: Sandbox, session: dict): + node_export = sandbox.node(0) + # to export on a cemented cycle + export_block_level = 64 + export_block = utils.get_block_at_level( + sandbox.client(0), export_block_level + ) + export_block_hash = export_block['hash'] + session['snapshot_2_head_hash'] = export_block_hash + session['snapshot_2_head_level'] = export_block_level + file = f'{sandbox.node(0).node_dir}/{SNAPSHOT_2}' + node_export.snapshot_export( + file, params=['--block', f'{export_block_level}'] + ) + + # Check that node 3 (full bootstrapped) can be reconstructed + def test_sync_node3(self, sandbox: Sandbox, session: dict): + assert utils.check_level(sandbox.client(3), session['head_level']) + clear_cache(sandbox, 3) + + # Checking node's 3 storage + def test_unavailable_blocks_node3(self, sandbox: Sandbox): + savepoint = int(sandbox.client(3).get_savepoint()) + assert utils.get_block_at_level(sandbox.client(3), savepoint) + # We must fail while requesting blocks before savepoint + for i in range(1, savepoint): + utils.get_block_metadata_at_level( + sandbox.client(3), i, expect_failure=True + ) + + def test_reconstruct_command_after_bootstrap(self, sandbox: Sandbox): + # Stop, reconstruct the storage and restart the node + sandbox.node(3).terminate_or_kill() + sandbox.node(3).reconstruct() + # History mode is now archive + sandbox.node(3).run() + assert sandbox.client(3).check_node_listening() + + def test_available_blocks_node3(self, sandbox: Sandbox, session: dict): + assert sandbox.client(3).get_savepoint() == 0 + assert sandbox.client(3).get_caboose() == 0 + # We should now success requesting those reconstructed blocks + for i in range(session['head_level']): + assert utils.get_block_at_level(sandbox.client(3), i) diff --git a/tests_python/tests_016/test_multiple_transfers.py b/tests_python/tests_016/test_multiple_transfers.py new file mode 100644 index 000000000000..cb56ff9945e5 --- /dev/null +++ b/tests_python/tests_016/test_multiple_transfers.py @@ -0,0 +1,133 @@ +"""Test the multiple transfer feature of octez-client""" +import os +import json +import pytest + +from client.client import Client +from tools import utils +from tools.constants import IDENTITIES +from .contract_paths import CONTRACT_PATH + + +def manager(client: Client) -> str: + """Originate and return the alias of a manager contract""" + alias = 'manager' + path = os.path.join(CONTRACT_PATH, 'entrypoints', alias + '.tz') + pubkey = IDENTITIES['bootstrap2']['identity'] + utils.init_with_transfer( + client, path, f'"{pubkey}"', 1000, sender='bootstrap1' + ) + return alias + + +@pytest.fixture(scope="class") +def big_map_entrypoints(client: Client) -> str: + """Originate and return the alias of a big_map_entrypoints contract""" + alias = 'big_map_entrypoints' + path = os.path.join(CONTRACT_PATH, 'entrypoints', alias + '.tz') + utils.init_with_transfer( + client, path, 'Pair {} {Elt "Hello" 42}', 1000, sender='bootstrap1' + ) + return alias + + +@pytest.fixture +def source(client: Client, request) -> str: + """A contract alias that will be used as source for a multiple transfers + command. + + This fixture is indirectly instantiated: the argument specifies + whether the alias of an originated manager contract should be + returned (if argument equals 'manager'). Otherwise, the alias is + assumed to already exist in the client's wallet and is returned + unmodified. + """ + alias = request.param + return manager(client) if alias == 'manager' else alias + + +@pytest.mark.contract +@pytest.mark.incremental +class TestMultipleTransfers: + def test_empty(self, client: Client): + with utils.assert_run_failure(r'Empty operation list'): + json_obj = '[]' + client.run(client.cmd_batch('bootstrap1', json_obj)) + + @pytest.mark.parametrize( + "payer, source", + [('bootstrap2', 'manager'), ('bootstrap4', 'bootstrap4')], + indirect=["source"], + ) + def test_transfer_json_to_entrypoint_with_args( + self, big_map_entrypoints: str, client: Client, payer: str, source: str + ): + """Test the multiple transfers command with a single transfer + to a contract's entrypoint, with implicit accounts or a manager + contract as source as per parametrization. + """ + balance_source = client.get_mutez_balance(source) + balance_payer = client.get_mutez_balance(payer) + fee = 0.0123 + fee_mutez = utils.mutez_of_tez(fee) + json_obj = [ + { + "destination": big_map_entrypoints, + "amount": "0", + "fee": str(fee), + "gas-limit": "65942", + "storage-limit": "1024", + "arg": '"Hello"', + "entrypoint": "mem_right", + } + ] + json_ops = json.dumps(json_obj, separators=(',', ':')) + client.run(client.cmd_batch(source, json_ops)) + utils.bake(client, 'bootstrap5') + new_balance_source = client.get_mutez_balance(source) + new_balance_payer = client.get_mutez_balance(payer) + + if payer != source: + assert balance_source == new_balance_source + + assert balance_payer - fee_mutez == new_balance_payer + + @pytest.mark.parametrize( + "payer, source", + [('bootstrap2', 'manager'), ('bootstrap4', 'bootstrap4')], + ) + def test_multiple_transfers(self, client: Client, payer: str, source: str): + """Test a multiple transfers to implicit accounts, with implicit + accounts or a manager contract as source as per parametrization. + """ + balance_source = client.get_mutez_balance(source) + balance_bootstrap1 = client.get_mutez_balance('bootstrap1') + balance_bootstrap3 = client.get_mutez_balance('bootstrap3') + amount_1 = 10.1 + amount_mutez_1 = utils.mutez_of_tez(amount_1) + amount_3 = 11.01 + amount_mutez_3 = utils.mutez_of_tez(amount_3) + json_obj = [ + {"destination": "bootstrap1", "amount": str(amount_1)}, + {"destination": "bootstrap3", "amount": str(amount_3)}, + ] + json_ops = json.dumps(json_obj, separators=(',', ':')) + client.run(client.cmd_batch(source, json_ops)) + utils.bake(client, 'bootstrap5') + new_balance_source = client.get_mutez_balance(source) + new_balance_bootstrap1 = client.get_mutez_balance('bootstrap1') + new_balance_bootstrap3 = client.get_mutez_balance('bootstrap3') + + if payer == source: + fee_first_transfer = 352 + fee_second_transfer = 256 + source_fee_mutez = fee_first_transfer + fee_second_transfer + else: + source_fee_mutez = 0 + + assert ( + balance_source - amount_mutez_1 - amount_mutez_3 - source_fee_mutez + == new_balance_source + ) + assert balance_bootstrap1 + amount_mutez_1 == new_balance_bootstrap1 + assert balance_bootstrap3 + amount_mutez_3 == new_balance_bootstrap3 diff --git a/tests_python/tests_016/test_multisig.py b/tests_python/tests_016/test_multisig.py new file mode 100644 index 000000000000..625085301b3a --- /dev/null +++ b/tests_python/tests_016/test_multisig.py @@ -0,0 +1,620 @@ +# octez-client has builtin support for multisig smart contracts. See +# docs/user/multisig.rst for more details about it. + +# This file tests the client multisig support; more precisely it tests +# that both the generic and the legacy versions of the multisig smart +# contract behave as intended. For all commands, we check that we can +# interact with the multisig contract when invoking it by its address +# or by its alias. + +import os +import re +from typing import List +import pytest +from tools import utils, constants +from client.client import Client +from .contract_paths import MINI_SCENARIOS_CONTRACT_PATH, ATTIC_CONTRACT_PATH + + +def get_keys(client): + """Generate 3 pairs of keys using various schemes and return the list + of aliases.""" + keys = ['foo', 'bar', 'boo'] + sigs = [None, 'secp256k1', 'ed25519'] + for key, sig in zip(keys, sigs): + args = [] if sig is None else ['--sig', sig] + client.gen_key(key, args) + return keys + + +@pytest.fixture(scope="class") +def keys(client): + return get_keys(client) + + +def msig_path(msig_version: str) -> str: + return os.path.join( + MINI_SCENARIOS_CONTRACT_PATH, f'{msig_version}_multisig.tz' + ) + + +MSIG_PARAMS = [ + {'by_address': by_address, 'msig_version': msig_version} + for msig_version in ['generic', 'legacy'] + for by_address in [True, False] +] + + +def parse_msig_storage(storage: str): + """Parse the storage of a multisig contract to get its counter (as a + number), threshold (as a number), and the keys of the signers (as + Micheline sequence in a string).""" + # put everything on a single line + storage = ' '.join(storage.split('\n')) + storage_regexp = r'Pair\s+?([0-9]+)\s+?([0-9]+)\s+?(.*)\s*' + match = re.search(storage_regexp, storage) + assert match is not None + return { + 'counter': int(match[1]), + 'threshold': int(match[2]), + 'keys': match[3], + } + + +def resolve_key_alias(client: Client, alias: str) -> str: + """Convert a key alias into a public key that can be understood in + Michelson.""" + ret = client.show_address(alias).public_key + assert ret is not None + return ret + + +def build_michelson_key_list(client: Client, keys: List[str]): + """From a list of key aliases, build a Michelson list of public keys.""" + keys = [resolve_key_alias(client, k) for k in keys] + return '{"' + '"; "'.join(keys) + '"}' + + +def build_msig_storage( + client: Client, counter: int, threshold: int, keys: List[str] +): + """Build a multisig storage from its components: a counter, a + threshold and the list of signer public keys.""" + keys = build_michelson_key_list(client, keys) + return f'Pair {counter} {threshold} {keys}' + + +def assert_michelson_eq(client, data1, data2, typ): + """Check that two Michelson expressions of the same type are equal by + normalizing them.""" + normalized1 = client.normalize(data=data1, typ=typ) + normalized2 = client.normalize(data=data2, typ=typ) + assert normalized1 == normalized2 + + +def assert_msig_storage_eq(client, data1, data2): + """Check that two multisig storages are equal.""" + assert_michelson_eq(client, data1, data2, 'pair nat nat (list key)') + + +def assert_msig_counter_incr(current_storage, new_storage): + """Check that [new_storage] is the same multisig storage than + [current_storage] except that it uses the next counter.""" + current_storage = parse_msig_storage(current_storage) + new_storage = parse_msig_storage(new_storage) + assert new_storage['counter'] == 1 + current_storage['counter'] + assert new_storage['threshold'] == current_storage['threshold'] + assert new_storage['keys'] == current_storage['keys'] + + +@pytest.fixture(scope="class", params=MSIG_PARAMS) +def msig(client: Client, keys, request): + """This fixture originates a multisig contract with a threshold of 2 + and the keys given as parameter. The version of the script is given by + the msig_version parameter, it can be either 'generic' or + 'legacy'. This fixture returns a dictionary containing: + + - a [handle] that can be used to interact with the contract: + either the address of the script or an alias, depending on the + [by_address] parameter + + - the list of [keys] that are stored in the contract which is a + copy of the [keys] parameter + + - the [version], which is a copy of the [msig_version] parameter + + """ + + # We use the same alias for all multisig originations, this makes + # testing simpler but requires using the '--force' option. + msig_alias = 'msig' + msig_version = request.param['msig_version'] + by_address = request.param['by_address'] + initial_storage = build_msig_storage( + client=client, counter=0, threshold=2, keys=keys + ) + deployment = client.originate( + msig_alias, + 100, + 'bootstrap1', + msig_path(msig_version), + # Initialize with empty key list and null threshold + ['--init', initial_storage, '--burn-cap', '100', '--force'], + ) + utils.bake(client) + handle = deployment.contract if by_address else msig_alias + return {'handle': handle, 'keys': keys, 'version': msig_version} + + +@pytest.mark.incremental +class TestMultisig: + def test_deploy_multisig(self, msig, client: Client): + """Test that: + - the script originated by the "deploy multisig" command, + - the generic_multisig.tz script found in the mini_scenarios + directory, and + - the script printed by the "show multisig script" + are the same.""" + keys = msig['keys'] + + # The command cannot originate the legacy contract so there is + # nothing to test in the legacy case. + if msig['version'] == 'generic': + client.deploy_msig( + 'dummy_msig', + 100, + 'bootstrap1', + 2, + keys, + ['--burn-cap', '100', '--force'], + ) + utils.bake(client) + expected_hash = ( + 'exprub9UzpxmhedNQnsv1J1DazWGJnj1dLhtG1fxkUoWSdFLBGLqJ4' + ) + assert expected_hash in client.run( + ['show', 'supported', 'multisig', 'hashes'] + ) + assert client.get_script_hash(msig['handle']) == expected_hash + assert client.get_script_hash('dummy_msig') == expected_hash + assert client.hash_script( + [client.run(['show', 'multisig', 'script'])] + ) == [(expected_hash, None)] + assert client.get_balance('dummy_msig') == 100 + + def test_transfer(self, msig, client: Client, session: dict): + """Test the client command for signing a multisig transfer from key + number 0 and store the signature in the session.""" + keys = msig['keys'] + key = keys[0] + session['sig0'] = client.msig_sign_transfer( + msig['handle'], 10, 'bootstrap2', key + ) + + def test_prepare_msig_transfer(self, msig, client: Client): + """Test the client command for preparing a transfer. The result of the + command is ignored in this test, we only test that the command + succeeds.""" + client.msig_prepare_transfer(msig['handle'], 10, 'bootstrap2') + + def test_prepare_msig_sign(self, msig, client: Client, session: dict): + """Produce signatures for keys number 1 and 2 using the the + preparation command together with the sign_bytes client command. The + signatures are stored in the session.""" + to_sign = client.msig_prepare_transfer( + msig['handle'], 10, 'bootstrap2', ['--bytes-only'] + ) + session['sig1'] = client.sign_bytes_of_string(to_sign, msig['keys'][1]) + session['sig2'] = client.sign_bytes_of_string(to_sign, msig['keys'][2]) + + def test_transfer_failure(self, msig, client: Client, session: dict): + """Test transfer failure when there are too few signatures.""" + error_pattern = ( + r"Not enough signatures: " + + r"only 1 signatures were given " + + r"but the threshold is currently 2" + ) + + with utils.assert_run_failure(error_pattern): + client.msig_transfer( + msig['handle'], + 10, + 'bootstrap2', + 'bootstrap1', + [session['sig2']], + ) + + def test_transfer_success(self, msig, client: Client, session: dict): + """Test a successful transfer using signatures obtained by different + methods. The signatures are taken from the session.""" + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + + client.msig_transfer( + msig['handle'], + 10, + 'bootstrap2', + 'bootstrap1', + [session['sig0'], session['sig2']], + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + new_balance = client.get_balance(msig['handle']) + assert new_balance == current_balance - 10 + + def test_default_entrypoint(self, msig, client): + """The generic multisig contract features an unauthorized default + entrypoint to receive donations but the legacy one does not.""" + + def cmd(): + client.transfer( + amount=100, giver='bootstrap1', receiver=msig['handle'] + ) + + if msig['version'] == 'legacy': + error_pattern = r'Invalid argument passed to contract' + with utils.assert_run_failure(error_pattern): + cmd() + else: + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + cmd() + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert new_storage == current_storage + assert new_balance == current_balance + 100 + + def test_transfer_with_entrypoint(self, msig, client: Client): + """Both versions of the contract can call arbitrary entrypoints of + type unit. This test uses the two possible methods to produce the + signatures.""" + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + contract = ( + 'parameter (or (unit %a) (string %b)); ' + 'storage unit; ' + 'code {CDR; NIL operation; PAIR}' + ) + client.originate( + 'dest_entrypoint', + 0, + 'bootstrap1', + contract, + args=['--burn-cap', '10.0', '--force'], + ) + args = ['--entrypoint', 'a'] + utils.bake(client) + to_sign = client.msig_prepare_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest_entrypoint', + args=args + ['--bytes-only'], + ) + sig0 = client.sign_bytes_of_string(to_sign, msig['keys'][0]) + sig2 = client.msig_sign_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest_entrypoint', + secret_key=msig['keys'][2], + args=args, + ) + client.msig_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest_entrypoint', + src='bootstrap1', + signatures=[sig0, sig2], + args=args, + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + assert new_balance == current_balance - 10 + + def test_transfer_with_arg(self, msig, client: Client): + """The generic multisig contract can call other contracts with + arbitrary parameters but the legacy one can only send Unit.""" + contract = ( + 'parameter (or (int %a) (string %b)); ' + 'storage unit; ' + 'code {CDR; NIL operation; PAIR}' + ) + client.originate( + 'dest', + 0, + 'bootstrap1', + contract, + args=['--burn-cap', '10.0', '--force'], + ) + args = ['--entrypoint', 'a', '--arg', '42'] + utils.bake(client) + + def cmd(): + return client.msig_prepare_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest', + args=args + ['--bytes-only'], + ) + + if msig['version'] == 'legacy': + error_pattern = ( + r'This multisig contract can only transfer tokens to' + ' contracts of type unit; calling a contract with argument 42' + ' is not supported.' + ) + with utils.assert_run_failure(error_pattern): + cmd() + else: + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + to_sign = cmd() + utils.bake(client) + sig0 = client.sign_bytes_of_string(to_sign, msig['keys'][0]) + sig2 = client.msig_sign_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest', + secret_key=msig['keys'][2], + args=args, + ) + client.msig_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest', + src='bootstrap1', + signatures=[sig0, sig2], + args=args, + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + assert new_balance == current_balance - 10 + + def test_transfer_ill_typed(self, msig, client: Client): + """Test that the multisig transfer preparation command type checks the + parameter.""" + error_pattern = ( + ( + r'The entrypoint b of contract .* ' + 'called from a multisig contract is of type string; ' + 'the provided parameter 42 is ill-typed.' + ) + if msig['version'] == 'generic' + else ( + r'This multisig contract can only transfer tokens to' + ' contracts of type unit; calling a contract with argument 42' + ' is not supported.' + ) + ) + + args = ['--entrypoint', 'b', '--arg', '42'] + + def cmd(): + client.msig_prepare_transfer( + msig_name=msig['handle'], + amount=10, + dest='dest', + args=args + ['--bytes-only'], + ) + + with utils.assert_run_failure(error_pattern): + cmd() + + def test_transfer_too_high(self, msig, client: Client): + """Test that the multisig transfer preparation command checks the + balance.""" + expected_warning = ( + 'Transferred amount is bigger than current multisig balance' + ) + + client.msig_prepare_transfer( + msig_name=msig['handle'], + amount=1000, + dest='bootstrap1', + args=['--bytes-only'], + expected_warning=expected_warning, + ) + + def test_multiple_operations(self, msig, client: Client): + """The generic multisig client can run lambdas, this can be used to + atomically run several operations.""" + bootstrap1_address = constants.IDENTITIES['bootstrap1']['identity'] + bootstrap2_address = constants.IDENTITIES['bootstrap2']['identity'] + bootstrap3_address = constants.IDENTITIES['bootstrap3']['identity'] + lam = ( + '{ DROP; NIL operation; ' + f'PUSH key_hash "{bootstrap1_address}"; IMPLICIT_ACCOUNT; ' + 'PUSH mutez 1000000; UNIT; TRANSFER_TOKENS; CONS; ' + f'PUSH key_hash "{bootstrap2_address}"; IMPLICIT_ACCOUNT; ' + 'PUSH mutez 2000000; UNIT; TRANSFER_TOKENS; CONS; ' + f'PUSH key_hash "{bootstrap3_address}"; SOME; ' + 'SET_DELEGATE; CONS}' + ) + lam = client.normalize( + lam, typ='lambda unit (list operation)', mode='Optimized' + ) + + def cmd(): + return client.msig_prepare_lambda( + msig_name=msig['handle'], lam=lam, args=['--bytes-only'] + ) + + if msig['version'] == 'legacy': + error_pattern = 'This multisig contract has a fixed set of actions' + with utils.assert_run_failure(error_pattern): + cmd() + else: + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + to_sign = cmd() + sig0 = client.sign_bytes_of_string(to_sign, msig['keys'][0]) + sig2 = client.msig_sign_lambda( + msig_name=msig['handle'], lam=lam, secret_key=msig['keys'][2] + ) + client.msig_run_lambda( + msig_name=msig['handle'], + lam=lam, + src='bootstrap1', + signatures=[sig0, sig2], + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + assert new_balance == current_balance - 3 + # TODO: check the delegate change + + def test_multiple_operations_failure(self, msig, client: Client): + """Test for the error message for ill-typed lambdas.""" + lam = '{ DROP }' + + def cmd(): + client.msig_prepare_lambda( + msig_name=msig['handle'], lam=lam, args=['--bytes-only'] + ) + + error_pattern = ( + ( + r'The provided lambda .* for multisig contract' + r' is ill-typed; .* is expected.' + ) + if msig['version'] == 'generic' + else 'This multisig contract has a fixed set of actions' + ) + + with utils.assert_run_failure(error_pattern): + cmd() + + def test_delegate_change(self, msig, client: Client): + """Test the multisig command for changing delegate.""" + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + sig0 = client.msig_sign_set_delegate( + msig['handle'], 'bootstrap5', msig['keys'][0] + ) + to_sign = client.msig_prepare_set_delegate( + msig['handle'], 'bootstrap5', ['--bytes-only'] + ) + sig2 = client.sign_bytes_of_string(to_sign, msig['keys'][2]) + client.msig_set_delegate( + msig['handle'], 'bootstrap5', 'bootstrap1', [sig0, sig2] + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + assert new_balance == current_balance + + def test_delegate_withdraw(self, msig, client: Client): + """Test the multisig command for removing delegation.""" + current_storage = client.get_storage(msig['handle']) + current_balance = client.get_balance(msig['handle']) + sig0 = client.msig_sign_withdrawing_delegate( + msig['handle'], msig['keys'][0] + ) + to_sign = client.msig_prepare_withdrawing_delegate( + msig['handle'], ['--bytes-only'] + ) + + sig1 = client.sign_bytes_of_string(to_sign, msig['keys'][1]) + client.msig_withdrawing_delegate( + msig['handle'], 'bootstrap1', [sig0, sig1] + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + new_balance = client.get_balance(msig['handle']) + assert_msig_counter_incr(current_storage, new_storage) + assert new_balance == current_balance + + def test_run_transaction_change_keys_and_threshold( + self, msig, client: Client + ): + """Test changing the keys and threshold with the `run transaction` + command.""" + current_storage = client.get_storage(msig['handle']) + current_counter = parse_msig_storage(storage=current_storage)['counter'] + current_balance = client.get_balance(msig['handle']) + keys = msig['keys'] + sig0 = client.msig_sign_setting_threshold( + msig['handle'], keys[0], 2, [keys[0], keys[2]] + ) + to_sign = client.msig_prepare_setting_threshold( + msig['handle'], 2, [keys[0], keys[2]], ['--bytes-only'] + ) + sig2 = client.sign_bytes_of_string(to_sign, msig['keys'][2]) + client.msig_run_transaction( + msig['handle'], to_sign, 'bootstrap1', [sig0, sig2] + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + expected_counter = 1 + current_counter + expected_storage = build_msig_storage( + client=client, + counter=expected_counter, + threshold=2, + keys=[keys[0], keys[2]], + ) + assert_msig_storage_eq(client, new_storage, expected_storage) + new_balance = client.get_balance(msig['handle']) + assert new_balance == current_balance + + def test_change_keys_and_threshold(self, msig, client: Client): + """Test changing the keys and threshold with `set threshold of + multisig` command.""" + current_storage = client.get_storage(msig['handle']) + current_counter = parse_msig_storage(storage=current_storage)['counter'] + current_balance = client.get_balance(msig['handle']) + keys = msig['keys'] + new_keys = [keys[0], keys[2]] + sig0 = client.msig_sign_setting_threshold( + msig['handle'], keys[0], 2, new_keys + ) + to_sign = client.msig_prepare_setting_threshold( + msig['handle'], 2, new_keys, ['--bytes-only'] + ) + sig2 = client.sign_bytes_of_string(to_sign, msig['keys'][2]) + client.msig_set_threshold( + msig['handle'], 2, new_keys, 'bootstrap1', [sig0, sig2] + ) + utils.bake(client) + new_storage = client.get_storage(msig['handle']) + expected_counter = 1 + current_counter + expected_storage = build_msig_storage( + client=client, + counter=expected_counter, + threshold=2, + keys=[keys[0], keys[2]], + ) + assert_msig_storage_eq(client, new_storage, expected_storage) + new_balance = client.get_balance(msig['handle']) + assert new_balance == current_balance + + +class TestUnsupportedMultisig: + """Verify that non-multisig contracts are rejected""" + + def test_deploy_nonmultisig(self, client: Client): + contract = os.path.join(ATTIC_CONTRACT_PATH, 'id.tz') + client.originate( + 'id', + 0, + 'bootstrap1', + contract, + args=['--burn-cap', '10.0', '--force', '--init', '""'], + ) + utils.bake(client) + + error_pattern = ( + 'The hash of this script is ' + 'exprv8K6ceBpFH5SFjQm4BRYSLJCHQBFeQU6BFTdvQSRPaPkzdLyAL, ' + 'it was not found among in the list of known multisig ' + 'script hashes.' + ) + + with utils.assert_run_failure(error_pattern): + client.msig_transfer('id', 10, 'bootstrap2', 'bootstrap1', []) diff --git a/tests_python/tests_016/test_nonce_seed_revelation.py b/tests_python/tests_016/test_nonce_seed_revelation.py new file mode 100644 index 000000000000..06b51ca5c6c3 --- /dev/null +++ b/tests_python/tests_016/test_nonce_seed_revelation.py @@ -0,0 +1,134 @@ +import time +import pytest +from tools import constants +from launchers.sandbox import Sandbox +from . import protocol + + +BLOCKS_PER_COMMITMENT = protocol.PARAMETERS['blocks_per_commitment'] +BLOCKS_PER_CYCLE = protocol.PARAMETERS['blocks_per_cycle'] +FIRST_PROTOCOL_BLOCK = 1 +TIMEOUT = 60 + +MINIMAL_BLOCK_DELAY = 1 +DELAY_INCREMENT_PER_ROUND = 1 +TEST_DURATION = ( + FIRST_PROTOCOL_BLOCK + 2 * BLOCKS_PER_CYCLE +) * MINIMAL_BLOCK_DELAY +NUM_NODES = 5 + + +@pytest.mark.incremental +@pytest.mark.slow +@pytest.mark.baker +class TestNonceSeedRevelation: + """Test baker injection of nonce revelations. + + See http://tezos.gitlab.io/016_mumbai/proof_of_stake.html + + Runs a node and a baker. The baker bakes two full cycles. + We collect nonce hashes from the first cycle. And check + that they are revealed in the second cycle""" + + def test_init(self, sandbox: Sandbox): + """Run a node and a baker. + + The node runs in archive mode to get metadata in `client.get_block()`. + The protocol is activated in the past so the baker can submit blocks + immediately without waiting for current time.""" + + node_params = constants.NODE_PARAMS + ['--history-mode', 'archive'] + for i in range(NUM_NODES): + sandbox.add_node(i, params=node_params) + + # client setup + parameters = protocol.get_parameters() + parameters['minimal_block_delay'] = str(MINIMAL_BLOCK_DELAY) + parameters['delay_increment_per_round'] = str(DELAY_INCREMENT_PER_ROUND) + protocol.activate(sandbox.client(0), parameters=parameters) + + # baker setup + # delegated_accounts = [f'bootstrap{i}' for i in range(1, 6)] + for i in range(NUM_NODES): + sandbox.add_baker( + i, + [f"bootstrap{i + 1}"], + proto=protocol.DAEMON, + log_levels=constants.TENDERBAKE_BAKER_LOG_LEVELS, + run_params=['--liquidity-baking-toggle-vote', 'pass'], + ) + + @pytest.mark.timeout(2 * TEST_DURATION) + def test_wait_for_two_cycles(self, sandbox: Sandbox): + """Poll the node until target level is reached""" + target = FIRST_PROTOCOL_BLOCK + 2 * BLOCKS_PER_CYCLE + level = target - 1 + while level < target: + time.sleep( + 4 * MINIMAL_BLOCK_DELAY + ) # sleep first to avoid useless first query + if sandbox.client(0).get_level() >= target: + break + # No need to bake more + for i in range(NUM_NODES): + sandbox.rm_baker(i, proto=protocol.DAEMON) + + def test_get_all_blocks(self, sandbox: Sandbox, session: dict): + """Retrieve all blocks for two full cycles.""" + blocks = [ + sandbox.client(0).get_block(FIRST_PROTOCOL_BLOCK + i) + for i in range(2 * BLOCKS_PER_CYCLE) + ] + session['blocks'] = blocks + + def test_cycle_alignment(self, session): + """Test cycles start where they are supposed to start. + + Not really needed but helps clarifying cycles positions.""" + + blocks = session['blocks'] + # blocks[0] is considered cycle = 0, cycle_position = 0 for the new + # protocol, but because it is a protocol transition block, it + # doesn't have the "cycle" and "cycle_position" metadata (unlike + # the remaining blocks) + initial_block_level = blocks[1]['metadata']['level_info'] + assert initial_block_level['cycle'] == 0 + assert initial_block_level['cycle_position'] == 1 + final_block_level = blocks[BLOCKS_PER_CYCLE]['metadata']['level_info'] + assert final_block_level['cycle'] == 1 + assert final_block_level['cycle_position'] == 0 + + def test_collect_seed_nonce_hashes(self, session): + """Collect nonce hashes in the block headers in the first cycle""" + seed_nonce_hashes = {} + blocks = session['blocks'] + for i in range(BLOCKS_PER_CYCLE // BLOCKS_PER_COMMITMENT): + level = (i + 1) * BLOCKS_PER_COMMITMENT - 1 + seed_nonce_hash = blocks[level]['header']['seed_nonce_hash'] + seed_nonce_hashes[level] = seed_nonce_hash + session['seed_nonce_hashes'] = seed_nonce_hashes + + def test_check_revelations(self, session): + """Collect reveal ops in second cycle and check they match + the nonce hashes from first cycle.""" + blocks = session['blocks'] + seed_nonce_hashes = session['seed_nonce_hashes'] + ops = [] + # collect all operations + for i in range(BLOCKS_PER_CYCLE, 2 * BLOCKS_PER_CYCLE): + ops.extend(blocks[i]['operations'][2]) + reveal_ops = {} + for operation in ops: + content = operation['contents'][0] + # there should be only revelations there + assert content['kind'] == "seed_nonce_revelation" + level = content['level'] - FIRST_PROTOCOL_BLOCK + # Can't submit twice the same reveal op + assert level not in reveal_ops + # level should match a seed + assert level in seed_nonce_hashes + reveal_ops[level] = content['nonce'] + + # check all nonce hashes have been revealed + assert len(reveal_ops) == len(seed_nonce_hashes) + # we could go a step further and check that revelations are correct diff --git a/tests_python/tests_016/test_openapi.py b/tests_python/tests_016/test_openapi.py new file mode 100644 index 000000000000..3e3425792dc4 --- /dev/null +++ b/tests_python/tests_016/test_openapi.py @@ -0,0 +1,71 @@ +""" Tests generating the implementation of openapi/swagger: + https://swagger.io/ + + This script launches a sandbox node, activates folder specific + protocol, gets the RPC descriptions as JSON, and converts this JSON + into an OpenAPI specification. + + This test mimicks src/openapi/generate.sh. +""" + +# import json +# import subprocess +# from pathlib import Path +# import requests +# import openapi_spec_validator +# import pytest + +# from launchers.sandbox import Sandbox +# from tools.constants import NODE_PARAMS +# from tools.utils import get_tezos_node_version +# from . import protocol + + +# class TestOpenAPI: +# @pytest.fixture(scope="class") +# def sandbox(self, sandbox: Sandbox): +# sandbox.add_node(0, params=NODE_PARAMS) +# client = sandbox.client(0) +# protocol.activate(client) +# return sandbox + +# @pytest.mark.parametrize( +# "rpc_path", ["describe", "describe/chains/main/blocks/head/"] +# ) +# def test_validity(self, sandbox: Sandbox, rpc_path: str, tmp_path: Path): +# """ +# Mimicks the script src/openapi/generate.sh. Generates the API +# and check it generates a valid OpenAPI specification. +# """ +# FIXME: https://gitlab.com/tezos/tezos/-/issues/3148 +# We deactivate this test temporarily. The encodings of +# Irmin proofs generate either an assert false in +# src/lib_openapi/convert.ml:188 or an infinite loop (!?) in +# the conversion from Json Schema to OpenAPI (depending on the +# version of the proof trees used). + +# node = sandbox.node(0) +# addr = f"http://localhost:{node.rpc_port}/{rpc_path}?recurse=yes" +# json_path = tmp_path / "result.json" +# with open(json_path, "w") as o_file: +# json_res = requests.get(addr).json() +# json.dump(json_res, o_file) + +# # If you need to debug, insert time.sleep(15) in there, +# # to give you time to inspect generated files before the +# # enclosing 'with' block finishes or to execute the dune +# # command manually while the temporary files are still there. +# version = get_tezos_node_version() +# cmd = [ +# "dune", +# "exec", +# "../src/bin_openapi/rpc_openapi.exe", +# "--", +# version, +# str(json_path.absolute()), +# ] +# process_ret = subprocess.run( +# cmd, check=True, capture_output=True, text=True +# ) +# res = json.loads(process_ret.stdout) +# openapi_spec_validator.validate_spec(res) diff --git a/tests_python/tests_016/test_p2p.py b/tests_python/tests_016/test_p2p.py new file mode 100644 index 000000000000..95f1b25bf37f --- /dev/null +++ b/tests_python/tests_016/test_p2p.py @@ -0,0 +1,147 @@ +import time +import pytest +from tools import constants +from launchers.sandbox import Sandbox + + +NUM_NODES = 5 +NUM_RETRIES = 20 # empirical values for testing a liveness property +POLLING_TIME = 10 # NUM_RETRY * POLLING_TIME = 200s, should be conservative + + +@pytest.mark.multinode +@pytest.mark.incremental +class TestTrustedRing: + """This test sets up a network of public peers (running the default + p2p protocol), with no initial bootstrap peers. It initializes a + trusted ring relationship, and checks that points are advertised + correctly to the whole network.""" + + def test_init(self, sandbox: Sandbox): + for i in range(NUM_NODES): + sandbox.add_node( + i, + private=False, + peers=[], + params=constants.NODE_PARAMS, + config_client=False, + ) + + def test_no_peers(self, sandbox: Sandbox): + """Initially, nobody knows other peers.""" + for client in sandbox.all_clients(): + res = client.p2p_stat() + assert not res.peers + + def test_add_peers(self, sandbox: Sandbox): + """Set up a trusted ring topology.""" + base_p2p = sandbox.p2p + for i in range(NUM_NODES): + client = sandbox.client(i) + client.trust_peer(base_p2p + ((i + 1) % NUM_NODES)) + + def test_check_clique(self, sandbox: Sandbox): + """Everyone should be connected to everyone else. This is a + liveness property. Its realization depends on the timing of the + p2p maintenance process. The check is repeated up to NUM_RETRIES + times with a POLLING_TIME seconds wait.""" + for i in range(NUM_NODES): + client = sandbox.client(i) + for _ in range(NUM_RETRIES): + points = client.p2p_stat().points.values() + num_connected = len( + [point for point in points if point.is_connected] + ) + if num_connected == NUM_NODES - 1: + break + time.sleep(POLLING_TIME) + assert num_connected == NUM_NODES - 1 + + def test_check_tables(self, sandbox: Sandbox): + """Test various assumptions on the point/peer tables. + Each peer has exactly one trusted neighbor. Tables don't + contain their own peer/point id and contain exactly NUM_NODES - 1 + values. + + The previous test should guarantee that maintenance has been + performed when this test is run.""" + base_p2p = sandbox.p2p + for i in range(NUM_NODES): + client = sandbox.client(i) + point_id = f'127.0.0.1:{base_p2p + i}' + peer_id = client.rpc('get', '/network/self') + res = client.p2p_stat() + assert peer_id not in res.peers + assert point_id not in res.points + num_trusted = 0 + for point_id, point in res.points.items(): + num_trusted += point.is_trusted + assert num_trusted == 1 + assert len(res.peers) == NUM_NODES - 1 + assert len(res.points) == NUM_NODES - 1 + + def test_set_expected_peers(self, sandbox: Sandbox): + """For all nodes, we add one expected peer_id + for the successor node.""" + peers_id = {} + for i in range(NUM_NODES): + client = sandbox.client(i) + peers_id[i] = client.rpc('get', '/network/self') + + for i in range(NUM_NODES): + client = sandbox.client(i) + client.set_expected_peer_id( + sandbox.p2p + ((i + 1) % NUM_NODES), + peers_id[(i + 1) % NUM_NODES], + ) + + def test_expected_peers(self, sandbox: Sandbox): + """For all nodes, we check that expected peer_id was + set properly.""" + peers_id = {} + for i in range(NUM_NODES): + client = sandbox.client(i) + peers_id[i] = client.rpc('get', '/network/self') + + for i in range(NUM_NODES): + client = sandbox.client(i) + expected_id = client.get_expected_peer_id( + sandbox.p2p + ((i + 1) % NUM_NODES) + ) + assert expected_id == peers_id[(i + 1) % NUM_NODES] + + def test_wrong_expected_peer(self, sandbox: Sandbox): + """We change the expected peer_id set previously to a wrong + expected peer_id.""" + peers_id = {} + for i in range(NUM_NODES): + client = sandbox.client(i) + peers_id[i] = client.rpc('get', '/network/self') + + for i in range(NUM_NODES): + client = sandbox.client(i) + client.set_expected_peer_id( + sandbox.p2p + ((i + 2) % NUM_NODES), peers_id[i] + ) + + def test_check_stat_with_wrong_expected_peers(self, sandbox: Sandbox): + """All nodes are public, everyone should be connected. But + only one neighbor should be trusted.""" + base_p2p = sandbox.p2p + for i in range(NUM_NODES): + client = sandbox.client(i) + point_id = '127.0.0.1:' + str(base_p2p + i) + peer_id = client.rpc('get', '/network/self') + res = client.p2p_stat() + assert peer_id not in res.peers + assert point_id not in res.points + num_trusted = 0 + num_connected = 0 + for point_id, point in res.points.items(): + num_trusted += point.is_trusted + num_connected += point.is_connected + assert len(res.peers) == NUM_NODES - 1 + assert len(res.points) == NUM_NODES - 1 + assert num_trusted == 1 + # We lost two connections + assert num_connected == NUM_NODES - 1 - 2 diff --git a/tests_python/tests_016/test_proto_demo_counter.py b/tests_python/tests_016/test_proto_demo_counter.py new file mode 100644 index 000000000000..12c2c7bb5e68 --- /dev/null +++ b/tests_python/tests_016/test_proto_demo_counter.py @@ -0,0 +1,88 @@ +import time +import pytest +from tools import constants +from tools.constants import PROTO_DEMO_COUNTER, PROTO_GENESIS +from client.client import Client + +PARAMS = ['-p', PROTO_GENESIS] + + +@pytest.fixture(scope="class") +def client(sandbox): + """One node with genesis.""" + sandbox.add_node(0, params=constants.NODE_PARAMS) + client = sandbox.client(0) + yield client + + +@pytest.mark.incremental +class TestProtoDemo: + """Activate protocol demo_counter, inject operations and bake block. + + This test relies on the fixture client which launches a single + sandboxed node. + """ + + def test_proto_known(self, client: Client): + res = client.list_protocols() + assert PROTO_DEMO_COUNTER in res + + def test_proto_client_known(self, client: Client): + res = client.list_understood_protocols() + assert PROTO_DEMO_COUNTER[:12] in res + + def test_first_protocol(self, client: Client): + proto = 'PrihK96nBAFSxVL1GLJTVhu9YnzkMFiBeuJRPA8NwuZVZCE1L6i' + assert client.get_protocol() == proto + + def test_activate_proto(self, client: Client): + parameters = {'init_a': 100, 'init_b': 100} + res = client.activate_protocol_json( + PROTO_DEMO_COUNTER, parameters, key='activator', fitness='1' + ) + assert res.block_hash + + def test_level1(self, client: Client): + assert client.get_level() == 1 + + def test_protocol_genesis(self, client: Client): + assert client.get_protocol() == PROTO_GENESIS + + def test_bake_command(self, client: Client): + time.sleep(1) + client.run(['bake', 'This is block 2']) + + def test_level2(self, client: Client): + head = client.rpc('get', '/chains/main/blocks/head/') + assert head['header']['level'] == 2 + + def test_inject_operations(self, client: Client): + client.run(['increment', 'a']) + client.run(['increment', 'b']) + client.run(['transfer', '10']) + + def test_mempool(self, client: Client): + ops = client.get_mempool() + assert len(ops['applied']) == 3 + + def test_bake_command_2(self, client: Client): + time.sleep(1) + client.run(['bake', 'This is block 3']) + + def test_level3(self, client: Client): + head = client.rpc('get', '/chains/main/blocks/head/') + assert head['header']['level'] == 3 + + def test_rpc_counter_a(self, client: Client): + head = client.rpc('get', '/chains/main/blocks/head/counter/a') + assert head == 91 + + def test_rpc_counter_b(self, client: Client): + head = client.rpc('get', '/chains/main/blocks/head/counter/b') + assert head == 111 + + def test_get_counter_commands(self, client: Client): + message_a = client.run(['get', 'a']) + assert message_a == "The counter value is 91\n" + message_b = client.run(['get', 'b']) + assert message_b == "The counter value is 111\n" diff --git a/tests_python/tests_016/test_proto_demo_noops_manual_bake.py b/tests_python/tests_016/test_proto_demo_noops_manual_bake.py new file mode 100644 index 000000000000..215f2ed99f1e --- /dev/null +++ b/tests_python/tests_016/test_proto_demo_noops_manual_bake.py @@ -0,0 +1,97 @@ +import time +import pytest +from tools.constants import PROTO_DEMO_NOOPS, PROTO_GENESIS +from client.client import Client + +PARAMS = ['-p', PROTO_GENESIS] + + +@pytest.fixture(scope="class") +def client(sandbox): + """One node with genesis.""" + sandbox.add_node(0) + client = sandbox.client(0) + yield client + + +def forge_block_header_data(protocol_data): + """ + Returns a binary encoding for a dict of the form + `{'block_header_data: string}`, as expected by the protocol. + + This corresponds to the encoding given by + `data_encoding.(obj1 (req "block_header_data" string))`. See + `lib_data_encoding/data_encoding.mli` for the spec. + """ + assert len(protocol_data) == 1 and 'block_header_data' in protocol_data + string = protocol_data['block_header_data'] + tag = '0000' + padded_hex_len = f'{len(string):#06x}'[2:] + return tag + padded_hex_len + bytes(string, 'utf-8').hex() + + +@pytest.mark.incremental +class TestProtoDemo: + """Activate protocol demo_noops, injection some operations and bake block. + + This test relies on the fixture client which launches a single + sandboxed node. + """ + + def test_proto_known(self, client: Client): + res = client.list_protocols() + assert PROTO_DEMO_NOOPS in res + + def test_first_protocol(self, client: Client): + proto = 'PrihK96nBAFSxVL1GLJTVhu9YnzkMFiBeuJRPA8NwuZVZCE1L6i' + assert client.get_protocol() == proto + + def test_activate_proto(self, client: Client): + parameters = {} # type: dict + res = client.activate_protocol_json( + PROTO_DEMO_NOOPS, parameters, key='activator', fitness='1' + ) + assert res.block_hash + + def test_level1(self, client: Client): + assert client.get_level(params=PARAMS) == 1 + + def test_protocol_genesis(self, client: Client): + assert client.get_protocol(params=PARAMS) == PROTO_GENESIS + + def test_manual_bake(self, client: Client): + time.sleep(1) + message = "hello world" + + data = { + "protocol_data": { + "protocol": PROTO_DEMO_NOOPS, + "block_header_data": message, + }, + "operations": [], + } + block = client.rpc( + 'post', + '/chains/main/blocks/head/helpers/preapply/block', + data=data, + params=PARAMS, + ) + + protocol_data = {'block_header_data': message} + encoded = forge_block_header_data(protocol_data) + + shell_header = block['shell_header'] + shell_header['protocol_data'] = encoded + encoded = client.rpc( + 'post', + '/chains/main/blocks/head/helpers/forge_block_header', + data=shell_header, + params=PARAMS, + ) + + inject = {'data': encoded['block'], 'operations': []} + client.rpc('post', '/injection/block', data=inject, params=PARAMS) + + def test_level2(self, client: Client): + head = client.rpc('get', '/chains/main/blocks/head/', params=PARAMS) + assert head['header']['level'] == 2 diff --git a/tests_python/tests_016/test_sapling.py b/tests_python/tests_016/test_sapling.py new file mode 100644 index 000000000000..35e729eb3f6e --- /dev/null +++ b/tests_python/tests_016/test_sapling.py @@ -0,0 +1,968 @@ +import json +import re +from os import path +import pytest +from tools import utils, paths, constants +from tools.utils import assert_run_failure +from . import contract_paths +from . import protocol + +CONTRACT_PATH = path.join( + paths.TEZOS_HOME, + 'src', + protocol.FOLDER, + 'lib_protocol', + 'test', + 'integration', + 'michelson', +) +TX_AMOUNT = 100.0 + + +# TODO: Use a random valid memo size for shielded-tez and others +@pytest.fixture +def contract_path(): + return CONTRACT_PATH + + +@pytest.fixture(scope="class") +def sandbox(sandbox): + sandbox.add_node(0, params=constants.NODE_PARAMS) + parameters = protocol.get_parameters() + parameters['consensus_threshold'] = 0 + protocol.activate( + sandbox.client(0), parameters=parameters, activate_in_the_past=True + ) + return sandbox + + +@pytest.fixture(scope="class") +def node(sandbox): + return sandbox.node(0) + + +@pytest.fixture(scope="class") +def client(sandbox, node): + client = sandbox.get_new_client(node) + return client + + +@pytest.fixture +def mnemonic(): + return [ + "morning", + "dinosaur", + "estate", + "youth", + "sausage", + "feature", + "apology", + "bullet", + "square", + "type", + "zoo", + "coyote", + "extra", + "fabric", + "grain", + "phone", + "pipe", + "despair", + "razor", + "ranch", + "blouse", + "debris", + "urge", + "evidence", + ] + + +@pytest.fixture +def non_originated_contract_address(): + return "KT1MXuZJJFg4EVpLQeLeuHvznTRiNefh3yCs" + + +@pytest.fixture +def non_originated_contract_name(): + return "fake-contract" + + +@pytest.fixture +def key_name(): + return "test_key_name" + + +# here baker 'account' has baked a block and has sent 'tx_amount' +def check_baker_balance(client, account, tx_amount): + parameters = dict(protocol.PARAMETERS) + initial_amount = float(parameters["bootstrap_accounts"][0][1]) + identity = constants.IDENTITIES[account]['identity'] + all_deposits = client.frozen_deposits(identity) + # sender's balance without fees + expected_baker_balance = ( + initial_amount / 1000000 - all_deposits / 1000000 - tx_amount + ) + baker_balance = client.get_balance(account) + # the fees are assumed to be at most 1 tez + fees_upper_bound = 3 + assert expected_baker_balance - fees_upper_bound <= baker_balance + assert baker_balance <= expected_baker_balance + + +@pytest.mark.client +class TestSaplingWalletImportKey: + @pytest.fixture + def client( + self, + sandbox, + node, + non_originated_contract_name, + non_originated_contract_address, + ): + """ + A client with a pre-registered contract to link the wallet with. + """ + client = sandbox.get_new_client(node) + client.remember_contract( + non_originated_contract_name, non_originated_contract_address + ) + return client + + def test_import_key_no_force(self, client, mnemonic, key_name): + """ + Import key without forcing and without pre-existing alias + """ + client.sapling_import_key(key_name, mnemonic, force=False) + + def test_import_key_force_and_non_previously_saved( + self, + client, + mnemonic, + key_name, + ): + """ + Import key with forcing and without pre-existing alias + """ + client.sapling_import_key(key_name, mnemonic, force=True) + + def test_import_key_force_and_previously_saved( + self, + client, + mnemonic, + key_name, + ): + """ + Import key with forcing and with pre-existing alias + """ + client.sapling_import_key(key_name, mnemonic, force=False) + client.sapling_import_key(key_name, mnemonic, force=True) + + +class TestSaplingWalletAddressGeneration: + @pytest.fixture + def client(self, sandbox, node, key_name, mnemonic): + """ + A client with a sapling wallet + """ + client = sandbox.get_new_client(node) + client.sapling_import_key(key_name, mnemonic, force=False) + return client + + @pytest.mark.parametrize( + "expected_address,expected_index", + [ + ( + "zet13XtyU5Bkasoj1b19sy4DJc7U13XydbxLHqLUdf8Y5tarGb" + "HgFLgDrT6J6FYJoHGL3", + 0, + ) + ], + ) + def test_generate_first_address_of_key( + self, client, key_name, expected_address, expected_index + ): + result = client.sapling_gen_address(key_name) + assert result.index == expected_index + assert result.address == expected_address + + @pytest.mark.parametrize( + "requested_index,expected_address,expected_index", + [ + ( + 0, + "zet13XtyU5Bkasoj1b19sy4DJc7U13XydbxLHqLUdf8Y5tarGb" + "HgFLgDrT6J6FYJoHGL3", + 0, + ), + ( + 1, + "zet13mN26QV67FgPzMSzrigXjKZNMMtCubhi9L3kUePnFYdXqEj" + "c8pmjw1h2wC6NLZf5F", + 1, + ), + ( + 2, + "zet12hzbYRRKbWwKPY61FkjLg7CRWTcjooqeH7VH18fA6Vxnwy7" + "WyTrAEqBXmEdHp9woU", + 4, + ), + ( + 3, + "zet12hzbYRRKbWwKPY61FkjLg7CRWTcjooqeH7VH18fA6Vxnwy7" + "WyTrAEqBXmEdHp9woU", + 4, + ), + ( + 4, + "zet12hzbYRRKbWwKPY61FkjLg7CRWTcjooqeH7VH18fA6Vxnwy7" + "WyTrAEqBXmEdHp9woU", + 4, + ), + ( + 100, + "zet14LmgdAzVrTtQKpeuD3f2y7wFSjXTMEexNNuiEWhGimm25en" + "xkqmwmbdFsC4y6YmYx", + 100, + ), + ( + 143534, + "zet14EWNxZYoHJASHFpcCYSfTfQokWSMzdJeV5SfaGEPDtiYiDC" + "X5jz8QkMF5jZaK5F4k", + 143536, + ), + ( + 42, + "zet143WVQUmNodhSe4ytHL6gvtdXYhRp7bywDWASUFYUCMGAS71" + "juXT6AyWY89fjg3eZn", + 42, + ), + ( + 90870987456348, + "zet13CiUqFsVEr2LdMnyyUQNL3Nh74sa4LdU6V3oD3YfcizbwuF" + "tftPRYvRrB2zsVaEw1", + 90870987456348, + ), + ], + ) + def test_generate_address_with_address_index( + self, + client, + key_name, + expected_address, + expected_index, + requested_index, + ): + result = client.sapling_gen_address(key_name, index=requested_index) + assert result.index == expected_index + assert result.address == expected_address + + +@pytest.mark.client +@pytest.mark.contract +@pytest.mark.incremental +class TestSaplingShieldedTez: + """ + Tests involving sapling key management and shielded transactions using + the shielded tez example contract. + """ + + @pytest.fixture + def contract_path(self): + return path.join(CONTRACT_PATH, 'contracts', 'sapling_contract.tz') + + @pytest.fixture + def contract_name(self): + return "sapling" + + @pytest.fixture(scope="session") + def tmpdir(self, tmpdir_factory): + """ + Temporary directory. Forged transactions will be saved + in this directory. + FIXME/IMPROVEME: tmpdir_factory is a fixture provided by pytest. It is + session-scoped, then the fixture tmpdir must be session-scoped. + Would be nice to have a class-scoped fixture. + """ + tmpdir = tmpdir_factory.mktemp("sapling_transactions_shielded_tez") + return tmpdir + + def test_originate_sapling_contract( + self, contract_path, client, session, contract_name + ): + sender = "bootstrap1" + origination = client.originate( + contract_name=contract_name, + amount=0, + sender=sender, + contract=contract_path, + args=["--init", "{ }", "--burn-cap", "3.0"], + ) + session["contract_address"] = origination.contract + utils.bake(client, bake_for=sender) + assert utils.check_block_contains_operations( + client, + [origination.operation_hash], + ) + + def test_generate_bob(self, client, session, contract_name): + key_name = "bob" + result = client.sapling_gen_key(key_name=key_name) + client.sapling_use_key_for_contract( + key_name, contract_name, memo_size=8 + ) + session['bob_mnemonic'] = result.mnemonic + + def test_list_keys_bob(self, client): + keys = client.sapling_list_keys() + assert keys == ["bob"] + + def test_list_keys_with_alice_and_bob(self, client, contract_name): + """ + NB: another key (ali) is generated in the test, but the mnemonic + is not saved. + We add this test to verify the list keys command orders alphabetically + """ + key_name = "ali" + client.sapling_gen_key(key_name=key_name) + client.sapling_use_key_for_contract( + key_name=key_name, contract_name=contract_name + ) + keys = client.sapling_list_keys() + assert keys == ["ali", "bob"] + + def test_generate_bob_address_0(self, client, session): + result = client.sapling_gen_address( + key_name="bob", + ) + session['last_address_index'] = result.index + session['bob_address_0'] = result.address + + def test_generate_bob_address_1(self, client, session): + result = client.sapling_gen_address( + key_name="bob", + ) + assert result.index > session['last_address_index'] + session['bob_address_1'] = result.address + + def test_check_bob_balance(self, client, contract_name): + result = client.sapling_get_balance( + key_name="bob", + contract_name=contract_name, + ) + assert result.balance == 0 + + def test_shield_bob_address_0(self, client, session, contract_name): + client.sapling_shield( + amount=TX_AMOUNT, + src="bootstrap2", + dest=session['bob_address_0'], + contract=contract_name, + args=["--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap1") + check_baker_balance(client, "bootstrap2", TX_AMOUNT) + bob_balance = client.sapling_get_balance( + key_name="bob", contract_name=contract_name + ).balance + assert bob_balance == TX_AMOUNT + + def test_check_contract_balance_after_shielding( + self, client, contract_name + ): + assert client.get_balance(contract_name) == TX_AMOUNT + + def test_regenerate_bob_from_mnemonic(self, client, session): + # Overwrite the old 'bob' key with one restored from the mnemonic. + key_name = "bob" + client.sapling_import_key( + key_name=key_name, + mnemonic=session['bob_mnemonic'], + force=True, + ) + + def test_derive_alice(self, client, contract_name): + result = client.sapling_derive_key( + source_key_name='bob', + target_key_name='alice', + contract_name=contract_name, + index='0', + ) + assert result.path == '0/0' + + def test_derive_yves(self, client, contract_name): + result = client.sapling_derive_key( + source_key_name='bob', + target_key_name='yves', + contract_name=contract_name, + index='1', + ) + assert result.path == '0/1' + + def test_generate_alice_address_0(self, client, session): + result = client.sapling_gen_address( + key_name="alice", + ) + session['alice_address_0'] = result.address + + def test_alice_shields_money_insufficient_funds( + self, client, session, contract_name + ): + bootstrap3 = constants.IDENTITIES['bootstrap3']['identity'] + alice_balance = int(client.get_balance('bootstrap3')) + amount = 2 * alice_balance + with assert_run_failure( + r"Balance of contract {} too low \({}\) to spend {}".format( + bootstrap3, alice_balance, amount + ) + ): + client.sapling_shield( + amount=amount, + src="bootstrap3", + dest=session['alice_address_0'], + contract=contract_name, + args=["--burn-cap", "3.0"], + ) + + def test_alice_shields_money(self, client, session, contract_name): + client.sapling_shield( + amount=TX_AMOUNT, + src="bootstrap3", + dest=session['alice_address_0'], + contract=contract_name, + args=[ + "--burn-cap", + "3.0", + ], + ) + utils.bake(client, bake_for="bootstrap1") + check_baker_balance(client, "bootstrap3", TX_AMOUNT) + alice_balance = client.sapling_get_balance( + key_name="alice", contract_name=contract_name + ).balance + assert alice_balance == TX_AMOUNT + + @pytest.mark.parametrize( + "transaction_file,use_json", + [ + ("sapling_transaction.bin", False), + ("sapling_transaction.json", True), + ], + ) + def test_forge_alice_to_bob_insufficient_funds( + self, + client, + tmpdir, + contract_name, + session, + transaction_file, + use_json, + ): + transaction_file = f'{tmpdir}/{transaction_file}' + amount = 2100000000.0 + account = 'alice' + additional_args = [] + if use_json: + additional_args += ["--json"] + + with assert_run_failure( + r"Balance too low \({}\) to spend {}".format(100, int(amount)) + ): + client.sapling_forge_transaction( + amount=amount, + src=account, + dest=session['bob_address_1'], + contract=contract_name, + file=transaction_file, + args=additional_args, + ) + + def test_forge_alice_to_bob_address_0( + self, tmpdir, session, client, contract_name + ): + transaction_file = f'{tmpdir}/sapling_transaction0.bin' + client.sapling_forge_transaction( + amount=TX_AMOUNT, + src='alice', + dest=session['bob_address_0'], + contract=contract_name, + file=transaction_file, + ) + + def test_forge_alice_to_bob_address_1_binary_format( + self, tmpdir, session, client, contract_name + ): + transaction_file = f'{tmpdir}/sapling_transaction1.bin' + client.sapling_forge_transaction( + amount=50.0, + src='alice', + dest=session['bob_address_1'], + contract=contract_name, + file=transaction_file, + ) + + @pytest.mark.parametrize( + "key_name,expected_balance", [("alice", TX_AMOUNT), ("bob", TX_AMOUNT)] + ) + def test_check_sapling_balances_post_forge_binary_format( + self, client, contract_name, key_name, expected_balance + ): + result = client.sapling_get_balance( + key_name=key_name, + contract_name=contract_name, + ) + assert result.balance == expected_balance + + def test_submit_alice_to_bob_address_1_binary_format( + self, client, tmpdir, contract_name + ): + transaction_file = f'{tmpdir}/sapling_transaction1.bin' + additional_args = ["--burn-cap", "3.0"] + client.sapling_submit( + file=transaction_file, + fee_payer='bootstrap2', + contract=contract_name, + args=additional_args, + ) + utils.bake(client, bake_for="bootstrap2") + + @pytest.mark.parametrize( + "key_name,expected_balance", [("alice", 50.0), ("bob", 150.0)] + ) + def test_check_sapling_balances_after_successfull_transaction_in_binary( + self, client, contract_name, key_name, expected_balance + ): + balance = client.sapling_get_balance( + key_name=key_name, contract_name=contract_name + ).balance + assert balance == expected_balance + + def test_forge_alice_to_bob_address_1_json_format( + self, tmpdir, session, client, contract_name + ): + transaction_file = f'{tmpdir}/sapling_transaction1.json' + client.sapling_forge_transaction( + amount=50.0, + src='alice', + dest=session['bob_address_1'], + contract=contract_name, + file=transaction_file, + args=['--json'], + ) + # Try to load the file as JSON. Must not fail. + with open(transaction_file, "r") as file_descriptor: + json.load(file_descriptor) + + @pytest.mark.parametrize( + "key_name,expected_balance", [("alice", 50.0), ("bob", 150.0)] + ) + def test_check_sapling_balances_post_forge_json_format( + self, client, contract_name, key_name, expected_balance + ): + result = client.sapling_get_balance( + key_name=key_name, + contract_name=contract_name, + ) + assert result.balance == expected_balance + + def test_submit_alice_to_bob_address_1_json_format( + self, client, tmpdir, contract_name + ): + transaction_file = f'{tmpdir}/sapling_transaction1.json' + additional_args = ["--burn-cap", "3.0", "--json"] + client.sapling_submit( + file=transaction_file, + fee_payer='bootstrap2', + contract=contract_name, + args=additional_args, + ) + utils.bake(client, bake_for="bootstrap2") + + @pytest.mark.parametrize( + "key_name,expected_balance", [("alice", 0.0), ("bob", 200.0)] + ) + def test_check_sapling_balances_after_successfull_transaction_in_json( + self, client, contract_name, key_name, expected_balance + ): + balance = client.sapling_get_balance( + key_name=key_name, contract_name=contract_name + ).balance + assert balance == expected_balance + + @pytest.mark.parametrize( + "transaction_file,use_json", + [ + ("sapling_transaction0.bin", False), + # ("sapling_transaction0.json", True), + ], + ) + def test_submit_alice_to_bob0( + self, client, transaction_file, use_json, tmpdir, contract_name + ): + transaction_file = f'{tmpdir}/{transaction_file}' + additional_args = ["--burn-cap", "3.0"] + if use_json: + additional_args.append("--json") + + with assert_run_failure(r'transfer simulation failed'): + client.sapling_submit( + file=transaction_file, + fee_payer='bootstrap2', + contract=contract_name, + args=additional_args, + ) + + @pytest.mark.parametrize( + "requested_token,real_balance,key_name", + [ + (2100000000, 200, "bob"), + (300, 200, "bob"), + (2100000000, 0, "alice"), + (100, 0, "alice"), + ], + ) + def test_unshields_money_insufficient_funds( + self, client, contract_name, requested_token, real_balance, key_name + ): + with assert_run_failure( + r'Balance too low \({}\) to spend {}'.format( + real_balance, requested_token + ) + ): + client.sapling_unshield( + amount=requested_token, + src=key_name, + dest="bootstrap4", + contract=contract_name, + args=["--burn-cap", "3.0"], + ) + + def test_bob_unshields_money(self, client, contract_name): + bootstrap4_prev_balance = client.get_balance('bootstrap4') + amount = 90.0 + client.sapling_unshield( + amount=amount, + src="bob", + dest="bootstrap4", + contract=contract_name, + args=["--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap2") + bob_balance = client.sapling_get_balance( + key_name="bob", contract_name=contract_name + ).balance + assert bob_balance == 200.0 - amount + bootstrap4_balance = client.get_balance("bootstrap4") + # The receiver pays fees by default so it will not get the full amount, + # but still, it should have more than before + assert bootstrap4_balance >= bootstrap4_prev_balance + assert bootstrap4_balance <= bootstrap4_prev_balance + amount + + def test_check_state_with_another_client( + self, sandbox, node, contract_name, session + ): + client = sandbox.get_new_client(node) + client.remember_contract(contract_name, session["contract_address"]) + key_name = "bob" + # Restore bob's key from mnemonic: + client.sapling_import_key( + key_name=key_name, + mnemonic=session['bob_mnemonic'], + ) + client.sapling_use_key_for_contract( + key_name, contract_name, memo_size=8 + ) + # Check Bob's balance again, it should be the same: + bob_balance = client.sapling_get_balance( + key_name=key_name, contract_name=contract_name + ).balance + assert bob_balance == 110.0 + + @pytest.mark.parametrize( + "transparent_signer,baker", [("bootstrap4", "bootstrap2")] + ) + def test_shielded_transfer_using_non_sapling_transfer_method( + self, client, contract_name, session, transparent_signer, baker, tmpdir + ): + transaction_filename = f'{tmpdir}/sapling_transaction_2.bin' + client.sapling_forge_transaction( + amount=10.0, + src='bob', + dest=session['bob_address_1'], + contract=contract_name, + file=transaction_filename, + args=[], + ) + with open(transaction_filename, "r") as file_descriptor: + content = re.sub(r'\s+', ' ', file_descriptor.read()) + client.transfer( + 0, + giver=transparent_signer, + receiver=contract_name, + args=[ + "--arg", + '{%s }' % content, + "--burn-cap", + "3.0", + ], + ) + utils.bake(client, bake_for=baker) + + @pytest.mark.parametrize( + "key_name,expected_balance", [("alice", 0.0), ("bob", 110.0)] + ) + def test_check_sapling_balances_after_calling_smart_contract( + self, client, contract_name, key_name, expected_balance + ): + balance = client.sapling_get_balance( + key_name=key_name, contract_name=contract_name + ).balance + assert balance == expected_balance + + +class TestSaplingMemoSize: + @pytest.fixture(scope="class") + def contract_name(self): + return "sapling_memo_size" + + @pytest.fixture(scope="class") + def contract_generator(self): + def generator(memo_size): + return ''' +parameter unit; +storage (sapling_state %s); +code { + DROP; + SAPLING_EMPTY_STATE %s; + NIL operation; + PAIR; + } +''' % ( + memo_size, + memo_size, + ) + + return generator + + @pytest.mark.parametrize("memo_size", [0, 1, 10, 42, 100, 65535]) + def test_originate_with_valid_size_and_update_with_valid_size( + self, client, memo_size, contract_name, tmpdir, contract_generator + ): + contract_path = tmpdir.join("c.tz") + contract_path.write(contract_generator(memo_size)) + sender = "bootstrap1" + client.originate( + contract_name=contract_name, + amount=0, + sender=sender, + contract=str(contract_path), + args=["--init", '{ }', "--burn-cap", "3.0", "--force"], + ) + utils.bake(client, bake_for="bootstrap1") + client.transfer( + 0, + giver="bootstrap1", + receiver=contract_name, + args=["--arg", "Unit", "--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap1") + + @pytest.mark.parametrize("memo_size", [-1, 65536, 65598909, 908923434]) + def test_originate_with_invalid_size( + self, + client, + memo_size, + contract_path, + contract_name, + contract_generator, + tmpdir, + ): + contract_path = tmpdir.join("c.tz") + contract_path.write(contract_generator(memo_size)) + sender = "bootstrap1" + err = r"expected a positive 16-bit integer" + with assert_run_failure(err): + client.originate( + contract_name=contract_name, + amount=0, + sender=sender, + contract=str(contract_path), + args=["--init", "{ }", "--burn-cap", "3.0", "--force"], + ) + + +@pytest.mark.incremental +class TestSaplingStateCorruption: + @pytest.fixture(scope="session") + def tmpdir(self, tmpdir_factory): + """ + Temporary directory. Forged transactions will be saved + in this directory. + FIXME/IMPROVEME: tmpdir_factory is a fixture provided by pytest. It is + session-scoped, then the fixture tmpdir must be session-scoped. + Would be nice to have a class-scoped fixture. + """ + tmpdir = tmpdir_factory.mktemp("sapling_transactions_shielded_tez") + return tmpdir + + def test_push_sapling_state_with_id_is_forbidden( + self, client, contract_path + ): + contract_name = ( + f"{contract_path}/contracts/sapling_push_sapling_state.tz" + ) + sender = "bootstrap1" + msg = r"big_map or sapling_state type not expected here" + with assert_run_failure(msg): + client.originate( + contract_name="push_sapling_state", + amount=0, + sender=sender, + contract=contract_name, + args=["--init", "Unit", "--burn-cap", "3.0"], + ) + + def test_originate_with_empty(self, client): + """ + Makes sure sapling state with id 0 exists + """ + contract = path.join( + contract_paths.OPCODES_CONTRACT_PATH, "sapling_empty_state.tz" + ) + client.originate( + amount=0, + sender="bootstrap1", + contract=contract, + contract_name="sapling_empty_state", + args=["--init", "{}", "--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap1") + + def test_originate_with_id_is_forbidden(self, client): + contract = path.join( + contract_paths.OPCODES_CONTRACT_PATH, "sapling_empty_state.tz" + ) + with assert_run_failure(r'Unexpected forged value'): + client.originate( + amount=0, + sender="bootstrap1", + contract=contract, + contract_name="sapling_empty_state2", + args=["--init", "0", "--burn-cap", "3.0"], + ) + + +class TestSaplingDifferentMemosize: + """ + Deploy a sapling contract using a sapling state with a memo size N and + create transactions with a memo size of M + """ + + @pytest.fixture + def contract_path(self): + return f'{CONTRACT_PATH}/contracts/sapling_contract.tz' + + def test_shield_with_different_memo_size(self, contract_path, client): + contract_name = "sapling_memo_size_different" + implicit_account = "bootstrap1" + contract_address = client.originate( + contract_name=contract_name, + amount=0, + sender=implicit_account, + contract=contract_path, + args=["--init", "{ }", "--burn-cap", "3.0"], + ).contract + utils.bake(client, bake_for=implicit_account) + client.sapling_gen_key(key_name='alice') + client.sapling_use_key_for_contract( + 'alice', contract_name, memo_size=16 + ) + address = client.sapling_gen_address(key_name='alice').address + # Key was registered with a memo_size of 16, it should fail + with assert_run_failure(r"Memo sizes of two sapling states"): + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address, + contract=contract_address, + args=["--burn-cap", "3.0"], + ) + + +class TestSaplingRightMemosize: + """ + Deploy a sapling contract using a sapling state with a memo size N and + create transactions with a memo size of N and diverse messages + """ + + @pytest.fixture + def contract_path(self): + return f'{CONTRACT_PATH}/contracts/sapling_contract.tz' + + def test_shield_with_same_memo_size(self, contract_path, client): + contract_name = "sapling_memo_size_same" + implicit_account = "bootstrap1" + contract_address = client.originate( + contract_name=contract_name, + amount=0, + sender=implicit_account, + contract=contract_path, + args=["--init", "{ }", "--burn-cap", "3.0"], + ).contract + utils.bake(client, bake_for=implicit_account) + client.sapling_gen_key(key_name='alice') + client.sapling_use_key_for_contract('alice', contract_name, memo_size=8) + address = client.sapling_gen_address(key_name='alice').address + # Should pass since memo-sizes are equal and message is + # filled with 0's + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address, + contract=contract_address, + args=["--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap2") + # Deriving a new key should work as well since + # the memo-size is kept + client.sapling_derive_key( + source_key_name='alice', + target_key_name='bob', + contract_name=contract_name, + index=10, + ) + address_derived = client.sapling_gen_address(key_name='bob').address + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address_derived, + contract=contract_address, + args=["--burn-cap", "3.0"], + ) + utils.bake(client, bake_for="bootstrap2") + # Now with a too short message + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address, + contract=contract_address, + args=["--burn-cap", "3.0", "--message", "aB"], + ) + utils.bake(client, bake_for="bootstrap2") + # Now with a right length message + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address, + contract=contract_address, + args=["--burn-cap", "3.0", "--message", "aBbf19F00a"], + ) + utils.bake(client, bake_for="bootstrap2") + # Now with a too long message + client.sapling_shield( + amount=TX_AMOUNT, + src=implicit_account, + dest=address, + contract=contract_address, + args=["--burn-cap", "3.0", "--message", "aBbf19F00aaBbf19F00aC"], + ) + utils.bake(client, bake_for="bootstrap2") diff --git a/tests_python/tests_016/test_slice_fails_params.txt b/tests_python/tests_016/test_slice_fails_params.txt new file mode 100644 index 000000000000..7241bd22aff3 --- /dev/null +++ b/tests_python/tests_016/test_slice_fails_params.txt @@ -0,0 +1,5 @@ +(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "p2sigsceCzcDw2AeYDzUonj4JT341WC9Px4wdhHBxbZcG1FhfqFVuG7f2fGCzrEHSAZgrsrQWpxduDPk9qZRgrpzwJnSHC3gZJ") +(Pair 0xeaa9ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm") +(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2deaad01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm") +(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150733eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm") +(Pair 0xe009ab79e8b84ef0 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm") diff --git a/tests_python/tests_016/test_slice_success_params.txt b/tests_python/tests_016/test_slice_success_params.txt new file mode 100644 index 000000000000..8c0d89bd8142 --- /dev/null +++ b/tests_python/tests_016/test_slice_success_params.txt @@ -0,0 +1 @@ +(Pair 0xe009ab79e8b84ef0e55c43a9a857214d8761e67b75ba63500a5694fb2ffe174acc2de22d01ccb7259342437f05e1987949f0ad82e9f32e9a0b79cb252d7f7b8236ad728893f4e7150742eefdbeda254970f9fcd92c6228c178e1a923e5600758eb83f2a05edd0be7625657901f2ba81eaf145d003dbef78e33f43a32a3788bdf0501000000085341554349535345 "spsig1PPUFZucuAQybs5wsqsNQ68QNgFaBnVKMFaoZZfi1BtNnuCAWnmL9wVy5HfHkR6AeodjVGxpBVVSYcJKyMURn6K1yknYLm") diff --git a/tests_python/tests_016/test_tls.py b/tests_python/tests_016/test_tls.py new file mode 100755 index 000000000000..475d786823bb --- /dev/null +++ b/tests_python/tests_016/test_tls.py @@ -0,0 +1,23 @@ +import pytest +from tools import constants +from client.client import Client + + +@pytest.fixture(scope="class") +def client(sandbox): + sandbox.add_node( + 0, + use_tls=(constants.TEZOS_CRT, constants.TEZOS_KEY), + params=constants.NODE_PARAMS, + ) + yield sandbox.client(0) + + +@pytest.mark.vote +@pytest.mark.incremental +@pytest.mark.skip(reason="requires to install a custom CA") +class TestTLS: + """Test voting protocol with manual baking, 4 blocks per voting period.""" + + def test_bootstrapped(self, client: Client): + assert client.bootstrapped() diff --git a/tests_python/tests_016/test_voting.py b/tests_python/tests_016/test_voting.py new file mode 100644 index 000000000000..8e8f229d35ae --- /dev/null +++ b/tests_python/tests_016/test_voting.py @@ -0,0 +1,256 @@ +import copy +import shutil +import pytest +from client.client import Client +from tools import constants, paths, utils +from . import protocol + +pytestmark = pytest.mark.skipif( + utils.check_static_binary(constants.COMPILER), + reason="cannot inject with statically compiled binaries", +) + + +@pytest.fixture(scope="class") +def client(sandbox): + """One node, 4 blocks per voting period.""" + proto_params = dict(protocol.PARAMETERS) + parameters = copy.deepcopy(proto_params) + parameters["blocks_per_cycle"] = 4 + parameters["nonce_revelation_threshold"] = 2 + parameters["cycles_per_voting_period"] = 1 + parameters['consensus_threshold'] = 0 + sandbox.add_node(0, params=constants.NODE_PARAMS) + protocol.activate(sandbox.client(0), parameters, activate_in_the_past=True) + yield sandbox.client(0) + + +@pytest.mark.vote +@pytest.mark.incremental +class TestManualBaking: + """Test voting protocol with manual baking, 1 cycle per voting period.""" + + def test_current_period(self, client: Client): + period_info = client.get_current_period() + level = client.get_current_level() + assert level["level_position"] == 0 + assert period_info["voting_period"]["index"] == 0 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 0 + assert period_info["position"] == 0 + assert period_info["remaining"] == 3 + + def test_succ_period(self, client: Client): + period_info = client.get_succ_period() + assert period_info["voting_period"]["index"] == 0 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 0 + assert period_info["position"] == 1 + assert period_info["remaining"] == 2 + + def test_level_info_offset(self, client: Client): + level = client.get_current_level(offset=1) + assert level["level_position"] == 1 + level = client.get_current_level(offset=4) + assert level["level_position"] == 4 + level = client.get_current_level(offset=10) + assert level["level_position"] == 10 + + def test_bake_two_blocks(self, client: Client): + utils.bake(client) + utils.bake(client) + period_info = client.get_current_period() + level = client.get_current_level() + assert level["level_position"] == 2 + assert period_info["voting_period"]["index"] == 0 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 0 + assert period_info["position"] == 2 + assert period_info["remaining"] == 1 + + def test_last_block_of_proposal_period(self, client: Client): + # last block of voting period 0 + utils.bake(client) + period_info = client.get_current_period() + assert period_info["voting_period"]["index"] == 0 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 0 + assert period_info["position"] == 3 + assert period_info["remaining"] == 0 + + def test_listing_is_not_empty(self, client: Client): + assert client.get_listings() != [] + + def test_inject_proto1(self, client: Client, tmpdir): + proto_fp = ( + f'{paths.TEZOS_HOME}/src/bin_client/test/proto_test_injection' + ) + + for i in range(1, 4): + proto = f'{tmpdir}/proto{i}' + shutil.copytree(proto_fp, proto) + main = f'{proto}/main.ml' + print(main) + with open(main, "a") as file: + file.write(f'(* {i} *)') + client.inject_protocol(proto) + + # this is maybe useless because the protocol already knows more than 4 + # protocol + def test_known_protocol(self, client: Client, session: dict): + protos = client.list_protocols() + assert len(protos) >= 4 + session['protos'] = protos[:4] + + def test_proposals_is_empty(self, client: Client): + assert client.get_proposals() == [] + + def test_show_voting_period2(self, client: Client): + client.show_voting_period() + + def test_bake_first_block_of_proposal_period(self, client: Client): + # using the client it's not possible to add voting operation on the + # first block of a voting period. This is to be fixed in a future + # protocol + utils.bake(client) + period_info = client.get_current_period() + assert period_info["voting_period"]["index"] == 1 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 4 + assert period_info["position"] == 0 + assert period_info["remaining"] == 3 + + def test_submit_proposals(self, client: Client, session: dict): + protos = session['protos'] + client.submit_proposals('bootstrap1', [protos[0]]) + client.submit_proposals('bootstrap2', [protos[0], protos[1]]) + client.submit_proposals('bootstrap3', [protos[1]]) + client.submit_proposals('bootstrap4', [protos[2]]) + + def test_bake_one_block(self, client: Client): + utils.bake(client) + period_info = client.get_current_period() + assert period_info["voting_period"]["index"] == 1 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 4 + assert period_info["position"] == 1 + assert period_info["remaining"] == 2 + + def test_proposals_is_not_empty(self, client: Client): + assert client.get_proposals() != [] + + def test_bake_until_prev_last_block_of_voting_period(self, client: Client): + utils.bake(client) + period_info = client.get_current_period() + assert period_info["position"] == 2 + assert period_info["remaining"] == 1 + + def test_break_proposal_tie(self, client: Client, session: dict): + protos = session['protos'] + client.submit_proposals('bootstrap4', [protos[1]]) + + def test_bake_last_block_of_proposal_period(self, client: Client): + utils.bake(client) + period_info = client.get_current_period() + metadata = client.get_metadata() + level = client.get_current_level() + level_info = metadata["level_info"] + meta_period_info = metadata["voting_period_info"] + expected_commitment = level["expected_commitment"] + assert level["level"] == level_info["level"] + assert level["level_position"] == level_info["level_position"] + assert level["cycle"] == level_info["cycle"] + assert level["cycle_position"] == level_info["cycle_position"] + assert expected_commitment == level_info["expected_commitment"] + assert level["level_position"] == 7 + assert period_info["voting_period"]["index"] == 1 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 4 + assert period_info["position"] == 3 + assert period_info["remaining"] == 0 + assert meta_period_info == period_info + + def test_listing_is_not_empty2(self, client: Client): + assert client.get_listings() != [] + + def test_current_proposal(self, client: Client, session: dict): + expected = session['protos'][1] + assert expected == client.get_current_proposal() + + def test_bake_first_block_of_cooldown_vote_period(self, client: Client): + # using the client it's not possible to add voting operation on the + # first block of a voting period. This is to be fixed in a future + # protocol + utils.bake(client) + period_info = client.get_current_period() + assert period_info["voting_period"]["index"] == 2 + assert period_info["voting_period"]["kind"] == "exploration" + assert period_info["voting_period"]["start_position"] == 8 + assert period_info["position"] == 0 + assert period_info["remaining"] == 3 + + def test_submit_ballot(self, client: Client, session: dict): + # next block is going to be of 'exploration' kind + proto = session['protos'][1] + for i in range(1, 4): + client.submit_ballot(f'bootstrap{i}', proto, 'yay') + + def test_bake_until_prev_last_block_of_voting_period2(self, client: Client): + utils.bake(client) + utils.bake(client) + period_info = client.get_current_period() + level = client.get_current_level() + assert level["level_position"] == 10 + assert period_info["voting_period"]["index"] == 2 + assert period_info["voting_period"]["kind"] == "exploration" + assert period_info["voting_period"]["start_position"] == 8 + assert period_info["position"] == 2 + assert period_info["remaining"] == 1 + + def test_submit_failing_ballot(self, client: Client, session: dict): + proto = session['protos'][1] + client.submit_ballot(f'bootstrap{4}', proto, 'nay') + + def test_level_info_offset2(self, client: Client): + level = client.get_current_level(block='head~1') + assert level["level_position"] == 9 + level = client.get_current_level(block='head~4') + assert level["level_position"] == 6 + level = client.get_current_level(block='head~10') + assert level["level_position"] == 0 + + def test_bake_first_block_of_new_proposal_period(self, client: Client): + utils.bake(client) + # Because of the current hack in proposal here we make sure we get the + # correct value + level = client.get_current_level() + period_info = client.get_current_period() + metadata = client.get_metadata() + level_info = metadata["level_info"] + meta_period_info = metadata["voting_period_info"] + expected_commitment = level["expected_commitment"] + assert level["level"] == level_info["level"] + assert level["level_position"] == level_info["level_position"] + assert level["cycle"] == level_info["cycle"] + assert level["cycle_position"] == level_info["cycle_position"] + assert expected_commitment == level_info["expected_commitment"] + assert level["level_position"] == 11 + assert period_info["voting_period"]["index"] == 2 + assert period_info["voting_period"]["kind"] == "exploration" + assert period_info["voting_period"]["start_position"] == 8 + assert period_info["position"] == 3 + assert period_info["remaining"] == 0 + assert meta_period_info == period_info + utils.bake(client) + period_info = client.get_current_period() + level = client.get_current_level() + assert level["level_position"] == 12 + assert period_info["voting_period"]["index"] == 3 + assert period_info["voting_period"]["kind"] == "proposal" + assert period_info["voting_period"]["start_position"] == 12 + assert period_info["position"] == 0 + assert period_info["remaining"] == 3 + assert client.get_listings() != '[]' + # strange behavior here, RPC returns 'null' on stderr + assert client.get_current_proposal() is None + assert client.get_ballot_list() == [] diff --git a/tests_python/tests_016/test_voting_full.py b/tests_python/tests_016/test_voting_full.py new file mode 100644 index 000000000000..9203fb194174 --- /dev/null +++ b/tests_python/tests_016/test_voting_full.py @@ -0,0 +1,228 @@ +import time + +import subprocess +import pytest + +from launchers.sandbox import Sandbox +from client.client import Client +from tools import utils, constants +from . import protocol + +CYCLES_PER_VOTING_PERIOD = 2 +OFFSET = 4 +POLLING_TIME = 5 +BAKING_RATE = 1 +NUM_NODES = 5 +BAKER = "bootstrap1" +ERROR_PATTERN = r"Uncaught|registered|error" + +PROTO_A = protocol.PREV_HASH +PROTO_A_DAEMON = protocol.PREV_DAEMON +PROTO_A_PATH = f"proto_{PROTO_A_DAEMON.replace('-','_')}" +PROTO_B = protocol.HASH +PROTO_B_DAEMON = protocol.DAEMON + + +def client_get_current_period_kind(client) -> dict: + res = client.get_current_period() + return res['voting_period']['kind'] + + +def tenderbake(client: Client): + """Call to 'bake for' that uses the multi-account command for Tenderbake. + + In particular, this allows to never get a 'Delegates do not have enough + voting power' error in sandboxed mode since we bake for all known accounts + (aka all bootstrap accounts) by default in method multibake. + + """ + client.multibake(args=['--minimal-timestamp']) + + +def bake_n_blocks(client: Client, baker: str, n_blocks: int): + for _ in range(n_blocks): + utils.bake(client, bake_for=baker) + + +def bake_until_next_voting_period(client: Client, baker: str, offset: int = 0): + period_info = client.get_current_period() + remaining_blocks = period_info["remaining"] + # if offset is the constant OFFSET, it will take us to + # the middle of the next voting period + bake_n_blocks(client, baker, 1 + remaining_blocks + offset) + + +@pytest.mark.timeout(60) +def wait_until_level(clients, level): + print(f"Waiting until {level}") + for client in clients: + while client.get_level() < level: + time.sleep(1) + + +def assert_all_clients_in_period(clients, period): + for client in clients: + assert client_get_current_period_kind(client) == period + + +@pytest.mark.vote +@pytest.mark.slow +@pytest.mark.baker +@pytest.mark.incremental +class TestVotingFull: + """This tests the migration from PROTO_A to PROTO_B using the voting + procedure. PROTO_A and PROTO_B are the previous and + respectively the current protocol as given by the 'protocol' + module. + + This test advances through all the periods of the voting procedure + until the last one (adoption), by manually baking the right number + of blocks. Once the adoption period is reached, a baker takes over + to bake the remaining blocks of the period. From there the baker + for the next protocol, which was started at the beginning of the + test, takes over. (Bakers are used to make the test more + realistic. However, to be sure that proposals and ballots are + injected at the right moment, manual baking is used instead.) + + This test differs in the following aspects from test_voting.py: + - it uses more nodes, not just one + - it goes through all voting periods, not just the first two + - it uses bakers + - it uses already registered protocols, instead of injecting a + new dummy protocol + """ + + def test_add_initial_nodes(self, sandbox: Sandbox): + for i in range(NUM_NODES): + sandbox.add_node(i, params=constants.NODE_PARAMS) + + def test_activate_proto_a(self, sandbox: Sandbox): + parameters = protocol.get_parameters(protocol.Protocol.PREV) + parameters["cycles_per_voting_period"] = CYCLES_PER_VOTING_PERIOD + utils.activate_protocol( + sandbox.client(0), + PROTO_A, + parameters=parameters, + activate_in_the_past=True, + ) + + # def test_add_bakers(self, sandbox: Sandbox): + # """Add a baker per node""" + # sandbox.add_baker( + # 1, [f"bootstrap{i}" for i in range(1, 6)], proto=PROTO_B_DAEMON, + # run_params=['--liquidity-baking-toggle-vote', 'pass'], + # ) + + def test_client_knows_proto_b(self, sandbox: Sandbox): + client = sandbox.client(0) + protos = client.list_protocols() + assert PROTO_B in protos + + def test_proposal_period(self, sandbox: Sandbox): + assert_all_clients_in_period(sandbox.all_clients(), 'proposal') + + def test_submit_proto_b_proposal(self, sandbox): + client = sandbox.client(0) + proposals = client.submit_proposals(BAKER, [PROTO_B]) + # bake a block for the submit proposal to be included + bake_n_blocks(client, BAKER, 1) + client.wait_for_inclusion(proposals.operation_hash, check_previous=1) + + def test_check_proto_b_proposed(self, sandbox: Sandbox): + clients = sandbox.all_clients() + wait_until_level(clients, sandbox.client(0).get_level()) + for client in clients: + proposals = client.get_proposals() + assert PROTO_B in [proto for (proto, _) in proposals] + + def test_wait_for_exploration_period(self, sandbox: Sandbox): + client = sandbox.client(0) + bake_until_next_voting_period(client, BAKER, OFFSET) + clients = sandbox.all_clients() + wait_until_level(clients, client.get_level()) + assert_all_clients_in_period(clients, 'exploration') + + def test_delegates_vote_proto_b(self, sandbox: Sandbox): + client = sandbox.client(0) + listings = client.get_listings() + # submit ballot for all bakers with listings + for listing in listings: + client.submit_ballot(listing["pkh"], PROTO_B, 'yay') + + def test_wait_for_cooldown(self, sandbox: Sandbox): + client = sandbox.client(0) + bake_until_next_voting_period(client, BAKER, OFFSET) + clients = sandbox.all_clients() + wait_until_level(clients, client.get_level()) + assert_all_clients_in_period(clients, 'cooldown') + + def test_wait_for_promotion_period(self, sandbox: Sandbox): + client = sandbox.client(0) + bake_until_next_voting_period(client, BAKER, OFFSET) + clients = sandbox.all_clients() + wait_until_level(clients, client.get_level()) + assert_all_clients_in_period(clients, 'promotion') + + def test_vote_in_promotion_phase(self, sandbox: Sandbox): + client = sandbox.client(0) + listings = client.get_listings() + for listing in listings: + client.submit_ballot(listing["pkh"], PROTO_B, 'yay') + + def test_wait_for_adoption(self, sandbox: Sandbox): + client = sandbox.client(0) + bake_until_next_voting_period(client, BAKER) + clients = sandbox.all_clients() + wait_until_level(clients, client.get_level()) + assert_all_clients_in_period(clients, 'adoption') + + @pytest.mark.timeout(600) + def test_all_nodes_run_proto_b(self, sandbox: Sandbox): + # we let a PROTO_A baker bake the last blocks of PROTO_A + # sandbox.add_baker( + # 0, [f"bootstrap{i}" for i in range(1, 6)], proto=PROTO_A_DAEMON, + # run_params=['--liquidity-baking-toggle-vote', 'pass'], + # ) + # for i in range(1,NUM_NODES): + # sandbox.add_baker( + # i, [f"bootstrap{i}"], proto=PROTO_B_DAEMON, + # run_params=['--liquidity-baking-toggle-vote', 'pass'], + # ) + clients = sandbox.all_clients() + client = clients[0] + utils.bake(client, bake_for="bootstrap2") + all_have_proto_b = False + while not all_have_proto_b: + try: + utils.bake(client, bake_for="bootstrap2") + except subprocess.CalledProcessError: + # A fatal error is raised when we do not have enough endorsing + # power. + # This is typical of a simple bake for call in Tenderbake + # Therefore this means we actually have migrated to Tenderbake + # Let's use a baking call that is sure to pass + tenderbake(client) + # either succeeds out of the loop or fails due to the timeout header + client_protocols = [client.get_protocol() for c in clients] + all_have_proto_b = all(p == PROTO_B for p in client_protocols) + time.sleep(POLLING_TIME) + + def test_new_chain_progress(self, sandbox: Sandbox): + # sandbox.rm_baker(0, proto=PROTO_A_DAEMON) + client = sandbox.client(0) + level_before = client.get_level(chain='main') + tenderbake(client) + print(f"level before {level_before}") + assert utils.check_level_greater_than(client, level_before + 1) + + def test_submit_again(self, sandbox: Sandbox): + # check that the voting procedure can still be initiated + # after the migration + client = sandbox.client(0) + proposals = client.submit_proposals(BAKER, [PROTO_B]) + tenderbake(client) + client.wait_for_inclusion(proposals.operation_hash, check_previous=1) + + @pytest.mark.xfail + def test_check_logs(self, sandbox: Sandbox): + assert utils.check_logs(sandbox.logs, ERROR_PATTERN) diff --git a/tests_python/tools/constants.py b/tests_python/tools/constants.py index 12bedfa366fb..e44b37839d05 100644 --- a/tests_python/tools/constants.py +++ b/tests_python/tools/constants.py @@ -99,6 +99,11 @@ LIMA_DAEMON = "PtLimaPt" LIMA_FOLDER = "proto_015_PtLimaPt" LIMA_PARAMETERS = get_parameters(LIMA_FOLDER) +MUMBAI = "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD" +MUMBAI_DAEMON = "016-PtMumbai" +MUMBAI_FOLDER = "proto_016_PtMumbai" +MUMBAI_PARAMETERS = get_parameters(MUMBAI_FOLDER) + TEZOS_CRT = """ Certificate: Data: -- GitLab From 5d075b3e8467e8bb3f5a0ac927413d02ebdb1111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 17:14:04 +0000 Subject: [PATCH 02/18] Build: Link Mumbai --- .gitlab/ci/jobs/packaging/opam_package.yml | 226 +++++++++++-- .gitlab/ci/jobs/test/unit.yml | 45 ++- devtools/get_contracts/dune | 2 + .../get_contracts_016_PtMumbai.ml | 303 ++++++++++++++++++ devtools/yes_wallet/dune | 1 + .../yes_wallet/get_delegates_016_PtMumbai.ml | 70 ++++ dune-project | 24 ++ manifest/main.ml | 2 + opam/octez-accuser-PtMumbai.opam | 26 ++ opam/octez-baker-PtMumbai.opam | 26 ++ opam/octez-client.opam | 3 + opam/octez-codec.opam | 1 + opam/octez-dal-node.opam | 1 + opam/octez-node.opam | 2 + opam/octez-proxy-server.opam | 2 + opam/octez-sc-rollup-client-PtMumbai.opam | 30 ++ opam/octez-sc-rollup-node-PtMumbai.opam | 48 +++ opam/octez-tx-rollup-client-PtMumbai.opam | 26 ++ opam/octez-tx-rollup-node-PtMumbai.opam | 25 ++ opam/octez-wasm-repl.opam | 5 +- opam/tezos-016-PtMumbai-test-helpers.opam | 31 ++ opam/tezos-baking-016-PtMumbai-commands.opam | 29 ++ opam/tezos-baking-016-PtMumbai.opam | 48 +++ opam/tezos-benchmark-016-PtMumbai.opam | 31 ++ ...benchmark-type-inference-016-PtMumbai.opam | 26 ++ opam/tezos-benchmarks-proto-016-PtMumbai.opam | 34 ++ opam/tezos-client-016-PtMumbai.opam | 42 +++ opam/tezos-dal-016-PtMumbai.opam | 30 ++ .../tezos-embedded-protocol-016-PtMumbai.opam | 21 ++ opam/tezos-injector-016-PtMumbai.opam | 29 ++ opam/tezos-layer2-utils-016-PtMumbai.opam | 22 ++ opam/tezos-protocol-016-PtMumbai-tests.opam | 45 +++ opam/tezos-protocol-016-PtMumbai.opam | 20 ++ ...otocol-plugin-016-PtMumbai-registerer.opam | 22 ++ ...os-protocol-plugin-016-PtMumbai-tests.opam | 28 ++ opam/tezos-protocol-plugin-016-PtMumbai.opam | 20 ++ opam/tezos-sc-rollup-016-PtMumbai.opam | 24 ++ opam/tezos-tx-rollup-016-PtMumbai.opam | 40 +++ script-inputs/active_protocol_versions | 1 + .../active_protocol_versions_without_number | 1 + script-inputs/released-executables | 6 + src/bin_client/dune | 3 + src/bin_codec/dune | 4 + src/bin_dal_node/dune | 1 + src/bin_node/dune | 2 + src/bin_proxy_server/dune | 8 + src/proto_016_PtMumbai/bin_accuser/dune | 18 +- src/proto_016_PtMumbai/bin_baker/dune | 18 +- .../bin_sc_rollup_client/dune | 18 +- .../bin_sc_rollup_node/dune | 34 +- .../bin_tx_rollup_client/dune | 24 +- .../bin_tx_rollup_node/dune | 18 +- src/proto_016_PtMumbai/bin_wasm_repl/dune | 20 +- src/proto_016_PtMumbai/lib_benchmark/dune | 18 +- .../lib_benchmark_type_inference/dune | 8 +- .../lib_benchmark_type_inference/test/dune | 12 +- .../lib_benchmark/test/dune | 16 +- .../lib_benchmarks_proto/dune | 34 +- src/proto_016_PtMumbai/lib_client/dune | 16 +- src/proto_016_PtMumbai/lib_client/test/dune | 16 +- .../lib_client_commands/dune | 48 +-- .../lib_client_sapling/dune | 20 +- src/proto_016_PtMumbai/lib_dal/dune | 20 +- src/proto_016_PtMumbai/lib_dal/test/dune | 14 +- src/proto_016_PtMumbai/lib_delegate/dune | 52 +-- src/proto_016_PtMumbai/lib_delegate/test/dune | 20 +- .../lib_delegate/test/mockup_simulator/dune | 26 +- .../lib_delegate/test/tenderbrute/dune | 12 +- .../lib_delegate/test/tenderbrute/lib/dune | 12 +- src/proto_016_PtMumbai/lib_injector/dune | 16 +- src/proto_016_PtMumbai/lib_layer2_utils/dune | 12 +- src/proto_016_PtMumbai/lib_parameters/dune | 18 +- src/proto_016_PtMumbai/lib_plugin/dune | 20 +- src/proto_016_PtMumbai/lib_plugin/test/dune | 24 +- src/proto_016_PtMumbai/lib_protocol/dune | 22 +- .../lib_protocol/test/helpers/dune | 12 +- .../test/integration/consensus/dune | 8 +- .../lib_protocol/test/integration/dune | 8 +- .../lib_protocol/test/integration/gas/dune | 4 +- .../test/integration/michelson/dune | 20 +- .../test/integration/operations/dune | 12 +- .../test/integration/validate/dune | 12 +- .../lib_protocol/test/pbt/dune | 20 +- .../lib_protocol/test/regression/dune | 16 +- .../lib_protocol/test/unit/dune | 8 +- src/proto_016_PtMumbai/lib_sc_rollup/dune | 20 +- src/proto_016_PtMumbai/lib_tx_rollup/dune | 24 +- tezt/tests/dune | 1 + 88 files changed, 1786 insertions(+), 421 deletions(-) create mode 100644 devtools/get_contracts/get_contracts_016_PtMumbai.ml create mode 100644 devtools/yes_wallet/get_delegates_016_PtMumbai.ml create mode 100644 opam/octez-accuser-PtMumbai.opam create mode 100644 opam/octez-baker-PtMumbai.opam create mode 100644 opam/octez-sc-rollup-client-PtMumbai.opam create mode 100644 opam/octez-sc-rollup-node-PtMumbai.opam create mode 100644 opam/octez-tx-rollup-client-PtMumbai.opam create mode 100644 opam/octez-tx-rollup-node-PtMumbai.opam create mode 100644 opam/tezos-016-PtMumbai-test-helpers.opam create mode 100644 opam/tezos-baking-016-PtMumbai-commands.opam create mode 100644 opam/tezos-baking-016-PtMumbai.opam create mode 100644 opam/tezos-benchmark-016-PtMumbai.opam create mode 100644 opam/tezos-benchmark-type-inference-016-PtMumbai.opam create mode 100644 opam/tezos-benchmarks-proto-016-PtMumbai.opam create mode 100644 opam/tezos-client-016-PtMumbai.opam create mode 100644 opam/tezos-dal-016-PtMumbai.opam create mode 100644 opam/tezos-embedded-protocol-016-PtMumbai.opam create mode 100644 opam/tezos-injector-016-PtMumbai.opam create mode 100644 opam/tezos-layer2-utils-016-PtMumbai.opam create mode 100644 opam/tezos-protocol-016-PtMumbai-tests.opam create mode 100644 opam/tezos-protocol-016-PtMumbai.opam create mode 100644 opam/tezos-protocol-plugin-016-PtMumbai-registerer.opam create mode 100644 opam/tezos-protocol-plugin-016-PtMumbai-tests.opam create mode 100644 opam/tezos-protocol-plugin-016-PtMumbai.opam create mode 100644 opam/tezos-sc-rollup-016-PtMumbai.opam create mode 100644 opam/tezos-tx-rollup-016-PtMumbai.opam diff --git a/.gitlab/ci/jobs/packaging/opam_package.yml b/.gitlab/ci/jobs/packaging/opam_package.yml index 5927db752a42..b298cdc88166 100644 --- a/.gitlab/ci/jobs/packaging/opam_package.yml +++ b/.gitlab/ci/jobs/packaging/opam_package.yml @@ -213,6 +213,13 @@ opam:octez-accuser-PtLimaPt: variables: package: octez-accuser-PtLimaPt +opam:octez-accuser-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-accuser-PtMumbai + # Ignoring unreleased package octez-accuser-alpha. opam:octez-baker-PtKathma: @@ -229,6 +236,13 @@ opam:octez-baker-PtLimaPt: variables: package: octez-baker-PtLimaPt +opam:octez-baker-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-baker-PtMumbai + # Ignoring unreleased package octez-baker-alpha. opam:octez-client: @@ -257,7 +271,7 @@ opam:octez-node: opam:octez-node-config: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: octez-node-config @@ -271,18 +285,32 @@ opam:octez-protocol-compiler: opam:octez-proxy-server: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: octez-proxy-server +opam:octez-sc-rollup-client-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-sc-rollup-client-PtMumbai + # Ignoring unreleased package octez-sc-rollup-client-alpha. +opam:octez-sc-rollup-node-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-sc-rollup-node-PtMumbai + # Ignoring unreleased package octez-sc-rollup-node-alpha. opam:octez-signer: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: octez-signer @@ -302,6 +330,13 @@ opam:octez-tx-rollup-client-PtLimaPt: variables: package: octez-tx-rollup-client-PtLimaPt +opam:octez-tx-rollup-client-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-tx-rollup-client-PtMumbai + # Ignoring unreleased package octez-tx-rollup-client-alpha. opam:octez-tx-rollup-node-PtKathma: @@ -318,6 +353,13 @@ opam:octez-tx-rollup-node-PtLimaPt: variables: package: octez-tx-rollup-node-PtLimaPt +opam:octez-tx-rollup-node-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: octez-tx-rollup-node-PtMumbai + # Ignoring unreleased package octez-tx-rollup-node-alpha. # Ignoring unreleased package octez-wasm-repl. @@ -326,12 +368,14 @@ opam:octez-tx-rollup-node-PtLimaPt: # Ignoring unreleased package tezos-015-PtLimaPt-test-helpers. +# Ignoring unreleased package tezos-016-PtMumbai-test-helpers. + # Ignoring unreleased package tezos-alpha-test-helpers. opam:tezos-baking-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-baking-014-PtKathma @@ -345,7 +389,7 @@ opam:tezos-baking-014-PtKathma-commands: opam:tezos-baking-015-PtLimaPt: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-baking-015-PtLimaPt @@ -356,10 +400,24 @@ opam:tezos-baking-015-PtLimaPt-commands: variables: package: tezos-baking-015-PtLimaPt-commands -opam:tezos-baking-alpha: +opam:tezos-baking-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_2 + variables: + package: tezos-baking-016-PtMumbai + +opam:tezos-baking-016-PtMumbai-commands: extends: - .opam_template - .rules_template__trigger_opam_batch_1 + variables: + package: tezos-baking-016-PtMumbai-commands + +opam:tezos-baking-alpha: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_2 variables: package: tezos-baking-alpha @@ -380,7 +438,7 @@ opam:tezos-base: opam:tezos-base-test-helpers: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_7 variables: package: tezos-base-test-helpers @@ -390,6 +448,8 @@ opam:tezos-base-test-helpers: # Ignoring unreleased package tezos-benchmark-015-PtLimaPt. +# Ignoring unreleased package tezos-benchmark-016-PtMumbai. + # Ignoring unreleased package tezos-benchmark-alpha. # Ignoring unreleased package tezos-benchmark-examples. @@ -400,12 +460,16 @@ opam:tezos-base-test-helpers: # Ignoring unreleased package tezos-benchmark-type-inference-015-PtLimaPt. +# Ignoring unreleased package tezos-benchmark-type-inference-016-PtMumbai. + # Ignoring unreleased package tezos-benchmark-type-inference-alpha. # Ignoring unreleased package tezos-benchmarks-proto-014-PtKathma. # Ignoring unreleased package tezos-benchmarks-proto-015-PtLimaPt. +# Ignoring unreleased package tezos-benchmarks-proto-016-PtMumbai. + # Ignoring unreleased package tezos-benchmarks-proto-alpha. opam:tezos-clic: @@ -418,14 +482,14 @@ opam:tezos-clic: opam:tezos-client-000-Ps9mPmXa: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-client-000-Ps9mPmXa opam:tezos-client-001-PtCJ7pwo: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-client-001-PtCJ7pwo @@ -527,6 +591,13 @@ opam:tezos-client-015-PtLimaPt: variables: package: tezos-client-015-PtLimaPt +opam:tezos-client-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_2 + variables: + package: tezos-client-016-PtMumbai + opam:tezos-client-alpha: extends: - .opam_template @@ -544,7 +615,7 @@ opam:tezos-client-base: opam:tezos-client-base-unix: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-client-base-unix @@ -597,11 +668,23 @@ opam:tezos-crypto-dal: variables: package: tezos-crypto-dal +# Ignoring unreleased package tezos-dal-016-PtMumbai. + # Ignoring unreleased package tezos-dal-alpha. -# Ignoring unreleased package tezos-dal-node-lib. +opam:tezos-dal-node-lib: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_2 + variables: + package: tezos-dal-node-lib -# Ignoring unreleased package tezos-dal-node-services. +opam:tezos-dal-node-services: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_7 + variables: + package: tezos-dal-node-services opam:tezos-embedded-protocol-000-Ps9mPmXa: extends: @@ -641,42 +724,42 @@ opam:tezos-embedded-protocol-004-Pt24m4xi: opam:tezos-embedded-protocol-005-PsBABY5H: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-005-PsBABY5H opam:tezos-embedded-protocol-005-PsBabyM1: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-005-PsBabyM1 opam:tezos-embedded-protocol-006-PsCARTHA: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-006-PsCARTHA opam:tezos-embedded-protocol-007-PsDELPH1: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-007-PsDELPH1 opam:tezos-embedded-protocol-008-PtEdo2Zk: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-008-PtEdo2Zk opam:tezos-embedded-protocol-008-PtEdoTez: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-embedded-protocol-008-PtEdoTez @@ -729,6 +812,13 @@ opam:tezos-embedded-protocol-015-PtLimaPt: variables: package: tezos-embedded-protocol-015-PtLimaPt +opam:tezos-embedded-protocol-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_4 + variables: + package: tezos-embedded-protocol-016-PtMumbai + opam:tezos-embedded-protocol-alpha: extends: - .opam_template @@ -792,20 +882,39 @@ opam:tezos-hacl: opam:tezos-injector-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-injector-014-PtKathma opam:tezos-injector-015-PtLimaPt: extends: - .opam_template - - .rules_template__trigger_opam_batch_1 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-injector-015-PtLimaPt +opam:tezos-injector-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: tezos-injector-016-PtMumbai + # Ignoring unreleased package tezos-injector-alpha. -# Ignoring unreleased package tezos-layer2-store. +opam:tezos-layer2-store: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_6 + variables: + package: tezos-layer2-store + +opam:tezos-layer2-utils-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_2 + variables: + package: tezos-layer2-utils-016-PtMumbai # Ignoring unreleased package tezos-layer2-utils-alpha. @@ -874,7 +983,7 @@ opam:tezos-p2p: opam:tezos-p2p-services: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_7 variables: package: tezos-p2p-services @@ -979,14 +1088,14 @@ opam:tezos-protocol-011-PtHangz2: opam:tezos-protocol-012-Psithaca: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-protocol-012-Psithaca opam:tezos-protocol-013-PtJakart: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-protocol-013-PtJakart @@ -1008,6 +1117,15 @@ opam:tezos-protocol-015-PtLimaPt: # Ignoring unreleased package tezos-protocol-015-PtLimaPt-tests. +opam:tezos-protocol-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_6 + variables: + package: tezos-protocol-016-PtMumbai + +# Ignoring unreleased package tezos-protocol-016-PtMumbai-tests. + opam:tezos-protocol-alpha: extends: - .opam_template @@ -1118,7 +1236,7 @@ opam:tezos-protocol-plugin-011-PtHangz2-registerer: opam:tezos-protocol-plugin-012-Psithaca: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-plugin-012-Psithaca @@ -1132,7 +1250,7 @@ opam:tezos-protocol-plugin-012-Psithaca-registerer: opam:tezos-protocol-plugin-013-PtJakart: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-plugin-013-PtJakart @@ -1146,14 +1264,14 @@ opam:tezos-protocol-plugin-013-PtJakart-registerer: opam:tezos-protocol-plugin-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-plugin-014-PtKathma opam:tezos-protocol-plugin-014-PtKathma-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-protocol-plugin-014-PtKathma-registerer @@ -1162,19 +1280,35 @@ opam:tezos-protocol-plugin-014-PtKathma-registerer: opam:tezos-protocol-plugin-015-PtLimaPt: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-plugin-015-PtLimaPt opam:tezos-protocol-plugin-015-PtLimaPt-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-protocol-plugin-015-PtLimaPt-registerer # Ignoring unreleased package tezos-protocol-plugin-015-PtLimaPt-tests. +opam:tezos-protocol-plugin-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_5 + variables: + package: tezos-protocol-plugin-016-PtMumbai + +opam:tezos-protocol-plugin-016-PtMumbai-registerer: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_3 + variables: + package: tezos-protocol-plugin-016-PtMumbai-registerer + +# Ignoring unreleased package tezos-protocol-plugin-016-PtMumbai-tests. + opam:tezos-protocol-plugin-alpha: extends: - .opam_template @@ -1185,7 +1319,7 @@ opam:tezos-protocol-plugin-alpha: opam:tezos-protocol-plugin-alpha-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-protocol-plugin-alpha-registerer @@ -1261,6 +1395,13 @@ opam:tezos-sapling: variables: package: tezos-sapling +opam:tezos-sc-rollup-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: tezos-sc-rollup-016-PtMumbai + # Ignoring unreleased package tezos-sc-rollup-alpha. opam:tezos-scoru-wasm: @@ -1272,7 +1413,12 @@ opam:tezos-scoru-wasm: # Ignoring unreleased package tezos-scoru-wasm-benchmark. -# Ignoring unreleased package tezos-scoru-wasm-fast. +opam:tezos-scoru-wasm-fast: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_6 + variables: + package: tezos-scoru-wasm-fast # Ignoring unreleased package tezos-scoru-wasm-test. @@ -1281,7 +1427,7 @@ opam:tezos-scoru-wasm: opam:tezos-shell: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-shell @@ -1386,6 +1532,13 @@ opam:tezos-tx-rollup-015-PtLimaPt: variables: package: tezos-tx-rollup-015-PtLimaPt +opam:tezos-tx-rollup-016-PtMumbai: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_1 + variables: + package: tezos-tx-rollup-016-PtMumbai + # Ignoring unreleased package tezos-tx-rollup-alpha. opam:tezos-validation: @@ -1402,7 +1555,12 @@ opam:tezos-version: variables: package: tezos-version -# Ignoring unreleased package tezos-wasmer. +opam:tezos-wasmer: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_7 + variables: + package: tezos-wasmer opam:tezos-webassembly-interpreter: extends: diff --git a/.gitlab/ci/jobs/test/unit.yml b/.gitlab/ci/jobs/test/unit.yml index 307a5be2ca0f..b976756d22e0 100644 --- a/.gitlab/ci/jobs/test/unit.yml +++ b/.gitlab/ci/jobs/test/unit.yml @@ -118,6 +118,50 @@ unit:015_PtLimaPt: - scripts/test_wrapper.sh $TEST_TARGETS ${!TEST_TARGETS} - ./scripts/ci/merge_coverage.sh +unit:016_PtMumbai: + extends: + - .unit_test_template_x86_64_coverage + # We use an extra level of indirection for TEST_TARGETS, to avoid + # overly long job names causing GitLab CI to silently fail. + variables: + # Note the use of @ resp. @@ to select tests recursively resp. non-recursively + proto_016_PtMumbai__lib_protocol__1: > + @@src/proto_016_PtMumbai/lib_protocol/test/integration/runtest + @src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/runtest + @src/proto_016_PtMumbai/lib_protocol/test/integration/gas/runtest + proto_016_PtMumbai__lib_protocol__2: > + @src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/runtest + @src/proto_016_PtMumbai/lib_protocol/test/integration/operations/runtest + @src/proto_016_PtMumbai/lib_protocol/test/integration/validate/runtest + proto_016_PtMumbai__lib_protocol__3: > + @src/proto_016_PtMumbai/lib_protocol/test/unit/runtest + @src/proto_016_PtMumbai/lib_protocol/runtezt + proto_016_PtMumbai__lib_protocol__pbt1: > + @src/proto_016_PtMumbai/lib_protocol/test/pbt/runtest1 + proto_016_PtMumbai__lib_protocol__pbt2: > + @src/proto_016_PtMumbai/lib_protocol/test/pbt/runtest2 + proto_016_PtMumbai__lib_protocol__pbt3: > + @src/proto_016_PtMumbai/lib_protocol/test/pbt/runtest3 + proto_016_PtMumbai: > + @src/proto_016_PtMumbai/lib_benchmark/runtest + @src/proto_016_PtMumbai/lib_client/runtest + @src/proto_016_PtMumbai/lib_plugin/runtest + @src/proto_016_PtMumbai/lib_delegate/runtest + @src/proto_016_PtMumbai/lib_dal/runtest + parallel: + matrix: + - TEST_TARGETS: + - proto_016_PtMumbai__lib_protocol__1 + - proto_016_PtMumbai__lib_protocol__2 + - proto_016_PtMumbai__lib_protocol__3 + - proto_016_PtMumbai__lib_protocol__pbt1 + - proto_016_PtMumbai__lib_protocol__pbt2 + - proto_016_PtMumbai__lib_protocol__pbt3 + - proto_016_PtMumbai + script: + - scripts/test_wrapper.sh $TEST_TARGETS ${!TEST_TARGETS} + - ./scripts/ci/merge_coverage.sh + unit:alpha: extends: - .unit_test_template_x86_64_coverage @@ -161,7 +205,6 @@ unit:alpha: script: - scripts/test_wrapper.sh $TEST_TARGETS ${!TEST_TARGETS} - ./scripts/ci/merge_coverage.sh - unit:non-proto-x86_64: extends: - .unit_test_template_x86_64_coverage diff --git a/devtools/get_contracts/dune b/devtools/get_contracts/dune index 9ea41cb9240e..eade1ca0c2dd 100644 --- a/devtools/get_contracts/dune +++ b/devtools/get_contracts/dune @@ -11,6 +11,8 @@ tezos-client-014-PtKathma tezos-protocol-015-PtLimaPt tezos-client-015-PtLimaPt + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-protocol-alpha tezos-client-alpha) (library_flags (:standard -linkall)) diff --git a/devtools/get_contracts/get_contracts_016_PtMumbai.ml b/devtools/get_contracts/get_contracts_016_PtMumbai.ml new file mode 100644 index 000000000000..f7b9c811d89e --- /dev/null +++ b/devtools/get_contracts/get_contracts_016_PtMumbai.ml @@ -0,0 +1,303 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) +open Tezos_protocol_016_PtMumbai +open Tezos_client_016_PtMumbai +open Protocol + +module Proto = struct + let hash = hash + + let wrap_tzresult = Environment.wrap_tzresult + + module Context = struct + type t = Raw_context.t + + let prepare ~level ~predecessor_timestamp ~timestamp ctxt = + let open Lwt_result_syntax in + let+ ctxt = + Lwt.map wrap_tzresult + @@ Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ctxt + in + Raw_context.set_gas_limit + ctxt + (Gas_limit_repr.fp_of_milligas_int (max_int - 1)) + end + + type context = Context.t + + module Contract = struct + type repr = Contract_repr.t + + let pp = Contract_repr.pp + + let is_implicit = function + | Contract_repr.Implicit _ -> true + | Contract_repr.Originated _ -> false + + let get_code ctxt contract = + Lwt.map wrap_tzresult @@ Storage.Contract.Code.get ctxt contract + + let get_storage ctxt contract = + Lwt.map wrap_tzresult @@ Storage.Contract.Storage.get ctxt contract + + let fold ctxt ~init ~f = + Storage.Contract.fold ctxt ~order:`Undefined ~init ~f + end + + module Script = struct + include Alpha_context.Script + module Hash = Script_expr_hash + + let print_expr = Michelson_v1_printer.print_expr + + let decode_and_costs lazy_expr = + let open Result_syntax in + let decode_cost = Script_repr.stable_force_decode_cost lazy_expr in + let+ expr = wrap_tzresult @@ Script_repr.force_decode lazy_expr in + let encode_cost = + let decoded_lazy_expr = Script_repr.lazy_expr expr in + Script_repr.force_bytes_cost decoded_lazy_expr + in + (expr, (decode_cost :> int), (encode_cost :> int)) + end + + module Translator = struct + type toplevel = Script_ir_translator.toplevel + + type ('a, 'b) ty = ('a, 'b) Script_typed_ir.ty + + type ex_ty = Ex_ty : ('a, 'b) ty -> ex_ty + + type ex_code = Script_ir_translator.ex_code + + let expected_code_size Script_ir_translator.(Ex_code (Code {code_size; _})) + = + (code_size :> int) + + let actual_code_size Script_ir_translator.(Ex_code (Code {code; _})) = + 8 * Obj.(reachable_words @@ repr code) + + let parse_ty (raw_ctxt : Raw_context.t) ~allow_lazy_storage ~allow_operation + ~allow_contract ~allow_ticket script = + let open Result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ Script_typed_ir.Ex_ty ty, updated_ctxt = + wrap_tzresult + @@ Script_ir_translator.parse_ty + ctxt + ~legacy:true + ~allow_lazy_storage + ~allow_operation + ~allow_contract + ~allow_ticket + script + in + let consumed = + (Alpha_context.Gas.consumed ~since:ctxt ~until:updated_ctxt :> int) + in + assert (consumed > 0) ; + (Ex_ty ty, consumed) + + let parse_data (raw_ctxt : Raw_context.t) ~allow_forged ty expr = + let open Lwt_result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ data, updated_ctxt = + Lwt.map wrap_tzresult + @@ Script_ir_translator.parse_data + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ctxt + ~allow_forged + ty + expr + in + let consumed = + (Alpha_context.Gas.consumed ~since:ctxt ~until:updated_ctxt :> int) + in + assert (consumed > 0) ; + (data, consumed) + + let unparse_data_cost (raw_ctxt : Raw_context.t) ty data = + let open Lwt_result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ _expr, updated_ctxt = + Lwt.map wrap_tzresult + @@ Script_ir_translator.unparse_data + ctxt + Script_ir_unparser.Optimized + ty + data + in + let consumed = + (Alpha_context.Gas.consumed ~since:ctxt ~until:updated_ctxt :> int) + in + assert (consumed > 0) ; + consumed + + let unparse_ty (raw_ctxt : Raw_context.t) (Ex_ty ty) = + let open Result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ expr, _ = + wrap_tzresult @@ Script_ir_unparser.unparse_ty ~loc:0 ctxt ty + in + expr + + let parse_toplevel (raw_ctxt : Raw_context.t) expr = + let open Lwt_result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ toplevel, updated_ctxt = + Lwt.map wrap_tzresult + @@ Script_ir_translator.parse_toplevel ctxt ~legacy:true expr + in + let consumed = + (Alpha_context.Gas.consumed ~since:ctxt ~until:updated_ctxt :> int) + in + assert (consumed > 0) ; + (toplevel, consumed) + + let parse_code (raw_ctxt : Raw_context.t) code = + let open Lwt_result_syntax in + let ctxt : Alpha_context.context = Obj.magic raw_ctxt in + let+ parsed_code, _ = + Lwt.map wrap_tzresult + @@ Script_ir_translator.parse_code + ctxt + ~elab_conf:(Script_ir_translator_config.make ~legacy:true ()) + ~code + in + parsed_code + end + + module Storage = struct + type big_map_id = Storage.Big_map.id + + let id_to_z = Lazy_storage_kind.Big_map.Id.unparse_to_z + + let list_values ?offset ?length (ctxt, id) = + let open Lwt_result_syntax in + let* ctxt, key_values = + Lwt.map wrap_tzresult + @@ Storage.Big_map.Contents.list_key_values ?offset ?length (ctxt, id) + in + let values = List.map snd key_values in + return (ctxt, values) + + let get ctxt id = + Lwt.map wrap_tzresult @@ Storage.Big_map.Value_type.get ctxt id + + let fold ctxt ~init ~f = + Storage.Big_map.fold ctxt ~order:`Undefined ~init ~f + end + + module Lambda = struct + type ex_lambda = + | Ex_lambda : + (('a, 'b) Script_typed_ir.lambda, _) Script_typed_ir.ty + * ('a, 'b) Script_typed_ir.lambda + -> ex_lambda + + type ex_ty_lambdas = + | Ex_ty_lambdas : + ('a, _) Script_typed_ir.ty * ('a -> ex_lambda list) list + -> ex_ty_lambdas + + let lam_node node = + match node with + | Ex_lambda (_, Lam (_, node)) | Ex_lambda (_, LamRec (_, node)) -> node + + let rec find_lambda_tys : + type a c. (a, c) Script_typed_ir.ty -> (a -> ex_lambda list) list = + fun ty -> + let open Script_typed_ir in + match ty with + | Unit_t | Int_t | Nat_t | Signature_t | String_t | Bytes_t | Mutez_t + | Key_hash_t | Key_t | Timestamp_t | Address_t | Bool_t | Set_t _ + | Big_map_t _ | Contract_t _ | Operation_t | Sapling_transaction_t _ + | Sapling_transaction_deprecated_t _ | Sapling_state_t _ | Never_t + | Bls12_381_g1_t | Bls12_381_g2_t | Bls12_381_fr_t | Ticket_t _ + | Chain_id_t | Chest_key_t | Chest_t | Tx_rollup_l2_address_t -> + [] + | Pair_t (t1, t2, _, _) -> + let g1 = List.map (fun g (v, _) -> g v) @@ find_lambda_tys t1 in + let g2 = List.map (fun g (_, v) -> g v) @@ find_lambda_tys t2 in + g1 @ g2 + | Union_t (t1, t2, _, _) -> + let g1 = + List.map (fun g -> function L v -> g v | R _ -> []) + @@ find_lambda_tys t1 + in + let g2 = + List.map (fun g -> function L _ -> [] | R v -> g v) + @@ find_lambda_tys t2 + in + g1 @ g2 + | Lambda_t _ -> [(fun g -> [Ex_lambda (ty, g)])] + | Option_t (t, _, _) -> + List.map (fun g -> function None -> [] | Some v -> g v) + @@ find_lambda_tys t + | List_t (t, _) -> + List.map (fun g l -> + List.flatten @@ List.map g @@ Script_list.to_list l) + @@ find_lambda_tys t + | Map_t (_, tv, _) -> find_lambda_tys_map tv + + and find_lambda_tys_map : + type tk tv c. + (tv, c) Script_typed_ir.ty -> + ((tk, tv) Script_typed_ir.map -> ex_lambda list) list = + fun tv -> + let open Script_typed_ir in + List.map (fun g (Map_tag (module Box) : (tk, tv) map) -> + Box.OPS.fold (fun _k v acc -> g v @ acc) Box.boxed []) + @@ find_lambda_tys tv + + let collect_lambda_tys (Translator.Ex_ty ty) = + match find_lambda_tys ty with + | [] -> None + | lams -> Some (Ex_ty_lambdas (ty, lams)) + + let fold_ex_ty_lambdas (type a) ~(ctxt : Context.t) ~(expr : Script.node) + ~(f : a -> Script.node -> ex_lambda list -> a) ~(acc : a) + (Ex_ty_lambdas (ty, getters)) = + let open Lwt_syntax in + let+ parse_result = + Translator.parse_data ctxt ~allow_forged:true ty expr + in + match parse_result with + | Error _ -> acc + | Ok (data, _cost) -> ( + match Script_ir_unparser.unparse_ty ~loc:0 (Obj.magic ctxt) ty with + | Error _ -> assert false + | Ok (ty_expr, _) -> + List.fold_left (fun acc g -> f acc ty_expr @@ g data) acc getters) + end + + let is_unpack = function + | Michelson_v1_primitives.I_UNPACK -> true + | _ -> false + + let code_storage_type ({storage_type; _} : Translator.toplevel) = storage_type +end + +let () = Known_protocols.register (module Proto) diff --git a/devtools/yes_wallet/dune b/devtools/yes_wallet/dune index 30b6721b00c3..11980739ee2c 100644 --- a/devtools/yes_wallet/dune +++ b/devtools/yes_wallet/dune @@ -13,6 +13,7 @@ tezos-context tezos-protocol-014-PtKathma tezos-protocol-015-PtLimaPt + tezos-protocol-016-PtMumbai tezos-protocol-alpha) (library_flags (:standard -linkall)) (flags diff --git a/devtools/yes_wallet/get_delegates_016_PtMumbai.ml b/devtools/yes_wallet/get_delegates_016_PtMumbai.ml new file mode 100644 index 000000000000..b2b77722e81a --- /dev/null +++ b/devtools/yes_wallet/get_delegates_016_PtMumbai.ml @@ -0,0 +1,70 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, <contact@nomadic-labs.com> *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Get_delegates = struct + open Tezos_protocol_016_PtMumbai + open Protocol + + type context = Alpha_context.t + + let hash = hash + + module Tez = struct + include Alpha_context.Tez + + let ( +? ) a b = Environment.wrap_tzresult (a +? b) + end + + module Signature = struct + include Tezos_crypto.Signature.V1 + module To_latest = Tezos_crypto.Signature.Of_V1 + end + + module Delegate = struct + open Alpha_context.Delegate + + let fold ctxt ~order ~init ~f = fold ctxt ~order ~init ~f + + let pubkey ctxt pkh = + Alpha_context.Contract.get_manager_key ctxt pkh + |> Lwt.map Environment.wrap_tzresult + + let staking_balance ctxt pkh = + staking_balance ctxt pkh |> Lwt.map Environment.wrap_tzresult + + let deactivated ctxt pkh = + deactivated ctxt pkh |> Lwt.map Environment.wrap_tzresult + end + + let prepare_context ctxt ~level ~predecessor_timestamp ~timestamp = + let open Lwt_result_syntax in + let+ ctxt, _, _ = + Alpha_context.prepare ctxt ~level ~predecessor_timestamp ~timestamp + |> Lwt.map Environment.wrap_tzresult + in + ctxt +end + +let () = Known_protocols.register (module Get_delegates) diff --git a/dune-project b/dune-project index 4b5354a590fa..374729252c1d 100644 --- a/dune-project +++ b/dune-project @@ -5,9 +5,11 @@ (package (name internal-devtools)) (package (name octez-accuser-PtKathma)) (package (name octez-accuser-PtLimaPt)) +(package (name octez-accuser-PtMumbai)) (package (name octez-accuser-alpha)) (package (name octez-baker-PtKathma)) (package (name octez-baker-PtLimaPt)) +(package (name octez-baker-PtMumbai)) (package (name octez-baker-alpha)) (package (name octez-client)) (package (name octez-codec)) @@ -16,24 +18,31 @@ (package (name octez-node-config)) (package (name octez-protocol-compiler)) (package (name octez-proxy-server)) +(package (name octez-sc-rollup-client-PtMumbai)) (package (name octez-sc-rollup-client-alpha)) +(package (name octez-sc-rollup-node-PtMumbai)) (package (name octez-sc-rollup-node-alpha)) (package (name octez-signer)) (package (name octez-snoop)) (package (name octez-tx-rollup-client-PtKathma)) (package (name octez-tx-rollup-client-PtLimaPt)) +(package (name octez-tx-rollup-client-PtMumbai)) (package (name octez-tx-rollup-client-alpha)) (package (name octez-tx-rollup-node-PtKathma)) (package (name octez-tx-rollup-node-PtLimaPt)) +(package (name octez-tx-rollup-node-PtMumbai)) (package (name octez-tx-rollup-node-alpha)) (package (name octez-wasm-repl)) (package (name tezos-014-PtKathma-test-helpers)) (package (name tezos-015-PtLimaPt-test-helpers)) +(package (name tezos-016-PtMumbai-test-helpers)) (package (name tezos-alpha-test-helpers)) (package (name tezos-baking-014-PtKathma)) (package (name tezos-baking-014-PtKathma-commands)) (package (name tezos-baking-015-PtLimaPt)) (package (name tezos-baking-015-PtLimaPt-commands)) +(package (name tezos-baking-016-PtMumbai)) +(package (name tezos-baking-016-PtMumbai-commands)) (package (name tezos-baking-alpha)) (package (name tezos-baking-alpha-commands)) (package (name tezos-base)) @@ -41,14 +50,17 @@ (package (name tezos-benchmark)) (package (name tezos-benchmark-014-PtKathma)) (package (name tezos-benchmark-015-PtLimaPt)) +(package (name tezos-benchmark-016-PtMumbai)) (package (name tezos-benchmark-alpha)) (package (name tezos-benchmark-examples)) (package (name tezos-benchmark-tests)(allow_empty)) (package (name tezos-benchmark-type-inference-014-PtKathma)) (package (name tezos-benchmark-type-inference-015-PtLimaPt)) +(package (name tezos-benchmark-type-inference-016-PtMumbai)) (package (name tezos-benchmark-type-inference-alpha)) (package (name tezos-benchmarks-proto-014-PtKathma)) (package (name tezos-benchmarks-proto-015-PtLimaPt)) +(package (name tezos-benchmarks-proto-016-PtMumbai)) (package (name tezos-benchmarks-proto-alpha)) (package (name tezos-clic)) (package (name tezos-client-000-Ps9mPmXa)) @@ -67,6 +79,7 @@ (package (name tezos-client-013-PtJakart)) (package (name tezos-client-014-PtKathma)) (package (name tezos-client-015-PtLimaPt)) +(package (name tezos-client-016-PtMumbai)) (package (name tezos-client-alpha)) (package (name tezos-client-base)) (package (name tezos-client-base-unix)) @@ -77,6 +90,7 @@ (package (name tezos-context-ops)) (package (name tezos-crypto)) (package (name tezos-crypto-dal)) +(package (name tezos-dal-016-PtMumbai)) (package (name tezos-dal-alpha)) (package (name tezos-dal-node-lib)(allow_empty)) (package (name tezos-dal-node-services)(allow_empty)) @@ -98,6 +112,7 @@ (package (name tezos-embedded-protocol-013-PtJakart)) (package (name tezos-embedded-protocol-014-PtKathma)) (package (name tezos-embedded-protocol-015-PtLimaPt)) +(package (name tezos-embedded-protocol-016-PtMumbai)) (package (name tezos-embedded-protocol-alpha)) (package (name tezos-embedded-protocol-demo-counter)) (package (name tezos-embedded-protocol-demo-noops)) @@ -110,8 +125,10 @@ (package (name tezos-injector-013-PtJakart)) (package (name tezos-injector-014-PtKathma)) (package (name tezos-injector-015-PtLimaPt)) +(package (name tezos-injector-016-PtMumbai)) (package (name tezos-injector-alpha)) (package (name tezos-layer2-store)(allow_empty)) +(package (name tezos-layer2-utils-016-PtMumbai)) (package (name tezos-layer2-utils-alpha)) (package (name tezos-lazy-containers)) (package (name tezos-lazy-containers-tests)(allow_empty)) @@ -145,6 +162,8 @@ (package (name tezos-protocol-014-PtKathma-tests)(allow_empty)) (package (name tezos-protocol-015-PtLimaPt)) (package (name tezos-protocol-015-PtLimaPt-tests)(allow_empty)) +(package (name tezos-protocol-016-PtMumbai)) +(package (name tezos-protocol-016-PtMumbai-tests)(allow_empty)) (package (name tezos-protocol-alpha)) (package (name tezos-protocol-alpha-tests)(allow_empty)) (package (name tezos-protocol-demo-counter)) @@ -171,6 +190,9 @@ (package (name tezos-protocol-plugin-015-PtLimaPt)) (package (name tezos-protocol-plugin-015-PtLimaPt-registerer)) (package (name tezos-protocol-plugin-015-PtLimaPt-tests)(allow_empty)) +(package (name tezos-protocol-plugin-016-PtMumbai)) +(package (name tezos-protocol-plugin-016-PtMumbai-registerer)) +(package (name tezos-protocol-plugin-016-PtMumbai-tests)(allow_empty)) (package (name tezos-protocol-plugin-alpha)) (package (name tezos-protocol-plugin-alpha-registerer)) (package (name tezos-protocol-plugin-alpha-tests)(allow_empty)) @@ -184,6 +206,7 @@ (package (name tezos-rpc-http-client-unix)) (package (name tezos-rpc-http-server)) (package (name tezos-sapling)) +(package (name tezos-sc-rollup-016-PtMumbai)) (package (name tezos-sc-rollup-alpha)) (package (name tezos-scoru-wasm)) (package (name tezos-scoru-wasm-benchmark)(allow_empty)) @@ -209,6 +232,7 @@ (package (name tezos-tree-encoding-test)(allow_empty)) (package (name tezos-tx-rollup-014-PtKathma)) (package (name tezos-tx-rollup-015-PtLimaPt)) +(package (name tezos-tx-rollup-016-PtMumbai)) (package (name tezos-tx-rollup-alpha)) (package (name tezos-validation)) (package (name tezos-version)) diff --git a/manifest/main.ml b/manifest/main.ml index 8d8411201d66..9a1ff5c87f9a 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -5277,6 +5277,8 @@ module Protocol = Protocol let _015_PtLimaPt = active (Name.v "PtLimaPt" 015) + let _016_PtMumbai = active (Name.v "PtMumbai" 016) + let alpha = active Name.alpha let all = List.rev !all_rev diff --git a/opam/octez-accuser-PtMumbai.opam b/opam/octez-accuser-PtMumbai.opam new file mode 100644 index 000000000000..7cdfbaa8e141 --- /dev/null +++ b/opam/octez-accuser-PtMumbai.opam @@ -0,0 +1,26 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-baking-016-PtMumbai-commands" + "tezos-stdlib-unix" + "tezos-client-base-unix" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: accuser binary" diff --git a/opam/octez-baker-PtMumbai.opam b/opam/octez-baker-PtMumbai.opam new file mode 100644 index 000000000000..28c68beb5374 --- /dev/null +++ b/opam/octez-baker-PtMumbai.opam @@ -0,0 +1,26 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-baking-016-PtMumbai-commands" + "tezos-stdlib-unix" + "tezos-client-base-unix" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: baker binary" diff --git a/opam/octez-client.opam b/opam/octez-client.opam index 73577a610ad0..04d03fc0490b 100644 --- a/opam/octez-client.opam +++ b/opam/octez-client.opam @@ -27,6 +27,9 @@ depends: [ "tezos-client-015-PtLimaPt" "tezos-baking-015-PtLimaPt-commands" "tezos-protocol-plugin-015-PtLimaPt" + "tezos-client-016-PtMumbai" + "tezos-baking-016-PtMumbai-commands" + "tezos-protocol-plugin-016-PtMumbai" ] depopts: [ "tezos-client-genesis" diff --git a/opam/octez-codec.opam b/opam/octez-codec.opam index 756bd8801540..0a51bfe32443 100644 --- a/opam/octez-codec.opam +++ b/opam/octez-codec.opam @@ -30,6 +30,7 @@ depopts: [ "tezos-client-013-PtJakart" "tezos-client-014-PtKathma" "tezos-client-015-PtLimaPt" + "tezos-client-016-PtMumbai" "tezos-client-alpha" ] build: [ diff --git a/opam/octez-dal-node.opam b/opam/octez-dal-node.opam index 5e7f2fcaaff7..6316d9582327 100644 --- a/opam/octez-dal-node.opam +++ b/opam/octez-dal-node.opam @@ -26,6 +26,7 @@ depends: [ "tezos-crypto-dal" "irmin-pack" { >= "3.4.3" & < "3.5.0" } "irmin" { >= "3.4.3" & < "3.5.0" } + "tezos-dal-016-PtMumbai" ] depopts: [ "tezos-dal-alpha" diff --git a/opam/octez-node.opam b/opam/octez-node.opam index 9c6fc969518c..55b6e654ec55 100644 --- a/opam/octez-node.opam +++ b/opam/octez-node.opam @@ -35,6 +35,8 @@ depends: [ "tezos-protocol-plugin-014-PtKathma-registerer" "tezos-embedded-protocol-015-PtLimaPt" "tezos-protocol-plugin-015-PtLimaPt-registerer" + "tezos-embedded-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai-registerer" ] depopts: [ "tezos-embedded-protocol-genesis" diff --git a/opam/octez-proxy-server.opam b/opam/octez-proxy-server.opam index 0ac252ab5396..a63041ab5cfe 100644 --- a/opam/octez-proxy-server.opam +++ b/opam/octez-proxy-server.opam @@ -52,6 +52,8 @@ depopts: [ "tezos-protocol-plugin-014-PtKathma" "tezos-client-015-PtLimaPt" "tezos-protocol-plugin-015-PtLimaPt" + "tezos-client-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" "tezos-client-alpha" "tezos-protocol-plugin-alpha" ] diff --git a/opam/octez-sc-rollup-client-PtMumbai.opam b/opam/octez-sc-rollup-client-PtMumbai.opam new file mode 100644 index 000000000000..24bc40812a2d --- /dev/null +++ b/opam/octez-sc-rollup-client-PtMumbai.opam @@ -0,0 +1,30 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-client-base" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-stdlib-unix" + "tezos-client-base-unix" + "tezos-rpc-http" + "tezos-rpc-http-client-unix" + "tezos-protocol-016-PtMumbai" + "tezos-sc-rollup-016-PtMumbai" + "uri" { >= "2.2.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: `octez-sc-rollup-client-alpha` client binary" diff --git a/opam/octez-sc-rollup-node-PtMumbai.opam b/opam/octez-sc-rollup-node-PtMumbai.opam new file mode 100644 index 000000000000..0114b7ee3992 --- /dev/null +++ b/opam/octez-sc-rollup-node-PtMumbai.opam @@ -0,0 +1,48 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-client-commands" + "tezos-stdlib-unix" + "tezos-client-base" + "tezos-client-base-unix" + "tezos-client-016-PtMumbai" + "tezos-context" + "tezos-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-rpc" + "tezos-rpc-http" + "tezos-rpc-http-server" + "tezos-workers" + "tezos-dal-node-services" + "tezos-dal-node-lib" + "tezos-shell-services" + "tezos-sc-rollup-016-PtMumbai" + "tezos-layer2-utils-016-PtMumbai" + "tezos-layer2-store" + "data-encoding" { >= "0.7.1" & < "1.0.0" } + "irmin-pack" { >= "3.4.3" & < "3.5.0" } + "irmin" { >= "3.4.3" & < "3.5.0" } + "aches" { >= "1.0.0" } + "aches-lwt" { >= "1.0.0" } + "tezos-injector-016-PtMumbai" + "tezos-scoru-wasm-fast" + "tezos-crypto-dal" + "prometheus-app" { >= "1.2" } + "octez-node-config" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: Smart Contract Rollup node binary" diff --git a/opam/octez-tx-rollup-client-PtMumbai.opam b/opam/octez-tx-rollup-client-PtMumbai.opam new file mode 100644 index 000000000000..508c463f6e2f --- /dev/null +++ b/opam/octez-tx-rollup-client-PtMumbai.opam @@ -0,0 +1,26 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-client-base-unix" + "tezos-stdlib-unix" + "tezos-tx-rollup-016-PtMumbai" + "uri" { >= "2.2.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: `octez-tx-rollup-client-alpha` client binary" diff --git a/opam/octez-tx-rollup-node-PtMumbai.opam b/opam/octez-tx-rollup-node-PtMumbai.opam new file mode 100644 index 000000000000..479d95f429f1 --- /dev/null +++ b/opam/octez-tx-rollup-node-PtMumbai.opam @@ -0,0 +1,25 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-client-base" + "tezos-client-base-unix" + "tezos-tx-rollup-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: Transaction Rollup node binary" diff --git a/opam/octez-wasm-repl.opam b/opam/octez-wasm-repl.opam index 37772737892a..30abe0ec1bf3 100644 --- a/opam/octez-wasm-repl.opam +++ b/opam/octez-wasm-repl.opam @@ -17,11 +17,14 @@ depends: [ "tezos-context" "tezos-base-test-helpers" "tezos-client-base" - "tezos-client-alpha" + "tezos-client-016-PtMumbai" "tezos-scoru-wasm" "tezos-scoru-wasm-test-helpers" "tezos-webassembly-interpreter" "tezos-webassembly-interpreter-extra" + "tezos-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-client-alpha" "tezos-protocol-alpha" "tezos-protocol-plugin-alpha" ] diff --git a/opam/tezos-016-PtMumbai-test-helpers.opam b/opam/tezos-016-PtMumbai-test-helpers.opam new file mode 100644 index 000000000000..bca3e46ef43c --- /dev/null +++ b/opam/tezos-016-PtMumbai-test-helpers.opam @@ -0,0 +1,31 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "alcotest-lwt" { >= "1.5.0" } + "qcheck-alcotest" { >= "0.18" } + "tezos-test-helpers" + "tezos-base" + "tezos-micheline" + "tezos-stdlib-unix" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-protocol-environment" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-shell-services" + "tezos-plompiler" { >= "1.0.1" & < "2.0.0" } + "tezos-crypto-dal" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol testing framework" diff --git a/opam/tezos-baking-016-PtMumbai-commands.opam b/opam/tezos-baking-016-PtMumbai-commands.opam new file mode 100644 index 000000000000..54bff0692ea7 --- /dev/null +++ b/opam/tezos-baking-016-PtMumbai-commands.opam @@ -0,0 +1,29 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-protocol-016-PtMumbai" + "tezos-stdlib-unix" + "tezos-protocol-environment" + "tezos-shell-services" + "tezos-client-base" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-baking-016-PtMumbai" + "tezos-rpc" + "uri" { >= "2.2.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol-specific commands for baking" diff --git a/opam/tezos-baking-016-PtMumbai.opam b/opam/tezos-baking-016-PtMumbai.opam new file mode 100644 index 000000000000..20bbac9e0db7 --- /dev/null +++ b/opam/tezos-baking-016-PtMumbai.opam @@ -0,0 +1,48 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-clic" + "tezos-version" + "tezos-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-protocol-environment" + "tezos-shell-services" + "tezos-client-base" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-stdlib" + "tezos-stdlib-unix" + "tezos-shell-context" + "tezos-context" + "tezos-rpc-http-client-unix" + "tezos-context-ops" + "tezos-rpc" + "tezos-rpc-http" + "lwt-canceler" { >= "0.3" & < "0.4" } + "lwt-exit" + "uri" { >= "2.2.0" } + "data-encoding" { >= "0.7.1" & < "1.0.0" } + "tezos-client-base-unix" + "tezos-mockup" + "tezos-mockup-proxy" + "tezos-mockup-commands" + "tezos-micheline" {with-test} + "tezos-base-test-helpers" {with-test} + "tezos-crypto" {with-test} + "alcotest-lwt" { with-test & >= "1.5.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: base library for `tezos-baker/accuser`" diff --git a/opam/tezos-benchmark-016-PtMumbai.opam b/opam/tezos-benchmark-016-PtMumbai.opam new file mode 100644 index 000000000000..beb5feef20f8 --- /dev/null +++ b/opam/tezos-benchmark-016-PtMumbai.opam @@ -0,0 +1,31 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-stdlib" + "tezos-base" + "tezos-error-monad" + "tezos-micheline" + "tezos-micheline-rewriting" + "tezos-benchmark" + "tezos-benchmark-type-inference-016-PtMumbai" + "tezos-protocol-016-PtMumbai" + "tezos-crypto" + "hashcons" + "tezos-016-PtMumbai-test-helpers" + "prbnmcn-stats" { = "0.0.4" } + "alcotest-lwt" { with-test & >= "1.5.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: library for writing benchmarks (protocol-specific part)" diff --git a/opam/tezos-benchmark-type-inference-016-PtMumbai.opam b/opam/tezos-benchmark-type-inference-016-PtMumbai.opam new file mode 100644 index 000000000000..bba0545f9e9c --- /dev/null +++ b/opam/tezos-benchmark-type-inference-016-PtMumbai.opam @@ -0,0 +1,26 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-stdlib" + "tezos-error-monad" + "tezos-crypto" + "tezos-micheline" + "tezos-micheline-rewriting" + "tezos-protocol-016-PtMumbai" + "hashcons" + "tezos-client-016-PtMumbai" {with-test} +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos: type inference for partial Michelson expressions" diff --git a/opam/tezos-benchmarks-proto-016-PtMumbai.opam b/opam/tezos-benchmarks-proto-016-PtMumbai.opam new file mode 100644 index 000000000000..3de7e1abbaf7 --- /dev/null +++ b/opam/tezos-benchmarks-proto-016-PtMumbai.opam @@ -0,0 +1,34 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-stdlib" + "tezos-base" + "tezos-error-monad" + "tezos-protocol-016-PtMumbai" + "tezos-lazy-containers" + "tezos-benchmark" + "tezos-benchmark-016-PtMumbai" + "tezos-benchmark-type-inference-016-PtMumbai" + "tezos-crypto" + "tezos-shell-benchmarks" + "tezos-micheline" + "tezos-016-PtMumbai-test-helpers" + "tezos-sapling" + "tezos-client-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-protocol-environment" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol benchmarks" diff --git a/opam/tezos-client-016-PtMumbai.opam b/opam/tezos-client-016-PtMumbai.opam new file mode 100644 index 000000000000..ba3d9b79cbb5 --- /dev/null +++ b/opam/tezos-client-016-PtMumbai.opam @@ -0,0 +1,42 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "tezos-base" + "tezos-clic" + "tezos-shell-services" + "tezos-client-base" + "tezos-protocol-016-PtMumbai" + "tezos-mockup-registration" + "tezos-proxy" + "tezos-signer-backends" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-rpc" + "uri" { >= "2.2.0" } + "tezos-micheline" {with-test} + "tezos-base-test-helpers" {with-test} + "tezos-test-helpers" {with-test} + "alcotest-lwt" { with-test & >= "1.5.0" } + "qcheck-alcotest" { with-test & >= "0.18" } + "tezos-stdlib-unix" + "tezos-protocol-environment" + "tezos-mockup" + "tezos-mockup-commands" + "tezos-client-commands" + "tezos-client-base-unix" + "tezos-crypto" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library for `tezos-client`" diff --git a/opam/tezos-dal-016-PtMumbai.opam b/opam/tezos-dal-016-PtMumbai.opam new file mode 100644 index 000000000000..1628f6895fa5 --- /dev/null +++ b/opam/tezos-dal-016-PtMumbai.opam @@ -0,0 +1,30 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "tezos-base" + "octez-protocol-compiler" + "tezos-stdlib-unix" + "tezos-dal-node-lib" + "tezos-client-016-PtMumbai" + "tezos-embedded-protocol-016-PtMumbai" + "tezos-layer2-utils-016-PtMumbai" + "tezos-protocol-016-PtMumbai" + "tezos-base-test-helpers" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} + "alcotest-lwt" { with-test & >= "1.5.0" } +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library for the Data availability Layer" diff --git a/opam/tezos-embedded-protocol-016-PtMumbai.opam b/opam/tezos-embedded-protocol-016-PtMumbai.opam new file mode 100644 index 000000000000..9e84c1617062 --- /dev/null +++ b/opam/tezos-embedded-protocol-016-PtMumbai.opam @@ -0,0 +1,21 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-protocol-016-PtMumbai" + "tezos-protocol-updater" + "tezos-protocol-environment" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: economic-protocol definition, embedded in `octez-node`" diff --git a/opam/tezos-injector-016-PtMumbai.opam b/opam/tezos-injector-016-PtMumbai.opam new file mode 100644 index 000000000000..40ab5d1b8f80 --- /dev/null +++ b/opam/tezos-injector-016-PtMumbai.opam @@ -0,0 +1,29 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "tezos-base" + "tezos-stdlib-unix" + "tezos-crypto" + "tezos-protocol-016-PtMumbai" + "tezos-micheline" + "tezos-client-016-PtMumbai" + "tezos-client-base" + "tezos-workers" + "tezos-shell" + "tezos-layer2-utils-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library building injectors" diff --git a/opam/tezos-layer2-utils-016-PtMumbai.opam b/opam/tezos-layer2-utils-016-PtMumbai.opam new file mode 100644 index 000000000000..d9eadc552aee --- /dev/null +++ b/opam/tezos-layer2-utils-016-PtMumbai.opam @@ -0,0 +1,22 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "tezos-base" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library for Layer 2 utils" diff --git a/opam/tezos-protocol-016-PtMumbai-tests.opam b/opam/tezos-protocol-016-PtMumbai-tests.opam new file mode 100644 index 000000000000..e153b49d8f37 --- /dev/null +++ b/opam/tezos-protocol-016-PtMumbai-tests.opam @@ -0,0 +1,45 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "alcotest-lwt" { with-test & >= "1.5.0" } + "tezos-base" {with-test} + "tezos-protocol-016-PtMumbai" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} + "tezos-base-test-helpers" {with-test} + "tezos-protocol-plugin-016-PtMumbai" {with-test} + "tezos-client-016-PtMumbai" {with-test} + "tezos-benchmark" {with-test} + "tezos-micheline" {with-test} + "tezos-benchmark-016-PtMumbai" {with-test} + "tezos-benchmark-type-inference-016-PtMumbai" {with-test} + "qcheck-alcotest" { with-test & >= "0.18" } + "tezt" {with-test} + "tezos-context" {with-test} + "tezos-test-helpers" {with-test} + "alcotest" { with-test & >= "1.5.0" } + "tezos-sc-rollup-016-PtMumbai" {with-test} + "tezos-crypto-dal" {with-test} + "tezos-client-base" {with-test} + "tezos-protocol-environment" {with-test} + "tezos-stdlib-unix" {with-test} + "tezos-scoru-wasm-test-helpers" {with-test} + "tezos-stdlib" {with-test} + "tezos-scoru-wasm" {with-test} + "tezos-webassembly-interpreter-extra" {with-test} + "tezt-tezos" {with-test} +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: tests for economic-protocol definition" diff --git a/opam/tezos-protocol-016-PtMumbai.opam b/opam/tezos-protocol-016-PtMumbai.opam new file mode 100644 index 000000000000..a7ac2f52c9da --- /dev/null +++ b/opam/tezos-protocol-016-PtMumbai.opam @@ -0,0 +1,20 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-protocol-environment" + "tezos-base" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: economic-protocol definition" diff --git a/opam/tezos-protocol-plugin-016-PtMumbai-registerer.opam b/opam/tezos-protocol-plugin-016-PtMumbai-registerer.opam new file mode 100644 index 000000000000..e313861c4764 --- /dev/null +++ b/opam/tezos-protocol-plugin-016-PtMumbai-registerer.opam @@ -0,0 +1,22 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-embedded-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-shell" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol plugin registerer" diff --git a/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam b/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam new file mode 100644 index 000000000000..81f5e87f8928 --- /dev/null +++ b/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam @@ -0,0 +1,28 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" {with-test} + "tezos-base-test-helpers" {with-test} + "alcotest-lwt" { with-test & >= "1.5.0" } + "tezos-test-helpers" {with-test} + "qcheck-alcotest" { with-test & >= "0.18" } + "tezos-stdlib-unix" {with-test} + "tezos-micheline" {with-test} + "tezos-protocol-plugin-016-PtMumbai" {with-test} + "tezos-protocol-016-PtMumbai" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol plugin tests" diff --git a/opam/tezos-protocol-plugin-016-PtMumbai.opam b/opam/tezos-protocol-plugin-016-PtMumbai.opam new file mode 100644 index 000000000000..475651d4b3af --- /dev/null +++ b/opam/tezos-protocol-plugin-016-PtMumbai.opam @@ -0,0 +1,20 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "tezos-base" + "tezos-protocol-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol plugin" diff --git a/opam/tezos-sc-rollup-016-PtMumbai.opam b/opam/tezos-sc-rollup-016-PtMumbai.opam new file mode 100644 index 000000000000..c673f1f37d82 --- /dev/null +++ b/opam/tezos-sc-rollup-016-PtMumbai.opam @@ -0,0 +1,24 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "tezos-base" + "tezos-protocol-016-PtMumbai" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-rpc" + "tezos-injector-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library for `tezos-sc-rollup`" diff --git a/opam/tezos-tx-rollup-016-PtMumbai.opam b/opam/tezos-tx-rollup-016-PtMumbai.opam new file mode 100644 index 000000000000..c0932b1fe9c4 --- /dev/null +++ b/opam/tezos-tx-rollup-016-PtMumbai.opam @@ -0,0 +1,40 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ppx_expect" + "index" { >= "1.6.0" & < "1.7.0" } + "tezos-base" + "tezos-crypto" + "tezos-protocol-016-PtMumbai" + "tezos-client-016-PtMumbai" + "tezos-client-commands" + "tezos-context" + "tezos-baking-016-PtMumbai-commands" + "tezos-stdlib-unix" + "tezos-rpc" + "tezos-rpc-http" + "tezos-rpc-http-client-unix" + "tezos-rpc-http-server" + "tezos-micheline" + "tezos-client-base" + "tezos-client-base-unix" + "tezos-shell" + "tezos-store" + "tezos-workers" + "tezos-protocol-plugin-016-PtMumbai" + "tezos-injector-016-PtMumbai" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Tezos/Protocol: protocol specific library for `tezos-tx-rollup`" diff --git a/script-inputs/active_protocol_versions b/script-inputs/active_protocol_versions index e0a8cdf0f840..0ba1edee08cc 100644 --- a/script-inputs/active_protocol_versions +++ b/script-inputs/active_protocol_versions @@ -1,3 +1,4 @@ 014-PtKathma 015-PtLimaPt +016-PtMumbai alpha diff --git a/script-inputs/active_protocol_versions_without_number b/script-inputs/active_protocol_versions_without_number index e8214a22ba14..db33dc9abefc 100644 --- a/script-inputs/active_protocol_versions_without_number +++ b/script-inputs/active_protocol_versions_without_number @@ -1,3 +1,4 @@ PtKathma PtLimaPt +PtMumbai alpha diff --git a/script-inputs/released-executables b/script-inputs/released-executables index 89fb860afb8b..ee414a742048 100644 --- a/script-inputs/released-executables +++ b/script-inputs/released-executables @@ -4,6 +4,12 @@ octez-codec octez-client octez-admin-client octez-node +octez-tx-rollup-node-PtMumbai +octez-tx-rollup-client-PtMumbai +octez-sc-rollup-node-PtMumbai +octez-sc-rollup-client-PtMumbai +octez-accuser-PtMumbai +octez-baker-PtMumbai octez-tx-rollup-node-PtLimaPt octez-tx-rollup-client-PtLimaPt octez-accuser-PtLimaPt diff --git a/src/bin_client/dune b/src/bin_client/dune index f9ddb8603046..d50799d911a9 100644 --- a/src/bin_client/dune +++ b/src/bin_client/dune @@ -95,6 +95,9 @@ tezos-client-015-PtLimaPt.commands-registration tezos-baking-015-PtLimaPt-commands.registration tezos-protocol-plugin-015-PtLimaPt + tezos-client-016-PtMumbai.commands-registration + tezos-baking-016-PtMumbai-commands.registration + tezos-protocol-plugin-016-PtMumbai (select void_for_linking-tezos-client-alpha-commands-registration from (tezos-client-alpha.commands-registration -> void_for_linking-tezos-client-alpha-commands-registration.empty) (-> void_for_linking-tezos-client-alpha-commands-registration.empty)) diff --git a/src/bin_codec/dune b/src/bin_codec/dune index 685c86eecbc6..d974cd3ebe90 100644 --- a/src/bin_codec/dune +++ b/src/bin_codec/dune @@ -49,6 +49,9 @@ (select void_for_linking-tezos-client-015-PtLimaPt from (tezos-client-015-PtLimaPt -> void_for_linking-tezos-client-015-PtLimaPt.empty) (-> void_for_linking-tezos-client-015-PtLimaPt.empty)) + (select void_for_linking-tezos-client-016-PtMumbai from + (tezos-client-016-PtMumbai -> void_for_linking-tezos-client-016-PtMumbai.empty) + (-> void_for_linking-tezos-client-016-PtMumbai.empty)) (select void_for_linking-tezos-client-alpha from (tezos-client-alpha -> void_for_linking-tezos-client-alpha.empty) (-> void_for_linking-tezos-client-alpha.empty))) @@ -78,4 +81,5 @@ (write-file void_for_linking-tezos-client-013-PtJakart.empty "") (write-file void_for_linking-tezos-client-014-PtKathma.empty "") (write-file void_for_linking-tezos-client-015-PtLimaPt.empty "") + (write-file void_for_linking-tezos-client-016-PtMumbai.empty "") (write-file void_for_linking-tezos-client-alpha.empty "")))) diff --git a/src/bin_dal_node/dune b/src/bin_dal_node/dune index d3e194b9415a..e37e55fe1146 100644 --- a/src/bin_dal_node/dune +++ b/src/bin_dal_node/dune @@ -26,6 +26,7 @@ irmin-pack irmin-pack.unix irmin + tezos-dal-016-PtMumbai (select void_for_linking-tezos-dal-alpha from (tezos-dal-alpha -> void_for_linking-tezos-dal-alpha.empty) (-> void_for_linking-tezos-dal-alpha.empty))) diff --git a/src/bin_node/dune b/src/bin_node/dune index 5561d39f0fbb..defce85ee461 100644 --- a/src/bin_node/dune +++ b/src/bin_node/dune @@ -112,6 +112,8 @@ tezos-protocol-plugin-014-PtKathma-registerer tezos-embedded-protocol-015-PtLimaPt tezos-protocol-plugin-015-PtLimaPt-registerer + tezos-embedded-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai-registerer (select void_for_linking-tezos-embedded-protocol-alpha from (tezos-embedded-protocol-alpha -> void_for_linking-tezos-embedded-protocol-alpha.empty) (-> void_for_linking-tezos-embedded-protocol-alpha.empty)) diff --git a/src/bin_proxy_server/dune b/src/bin_proxy_server/dune index 8bdcd7a90207..bcf14c15d6f6 100644 --- a/src/bin_proxy_server/dune +++ b/src/bin_proxy_server/dune @@ -103,6 +103,12 @@ (select void_for_linking-tezos-protocol-plugin-015-PtLimaPt from (tezos-protocol-plugin-015-PtLimaPt -> void_for_linking-tezos-protocol-plugin-015-PtLimaPt.empty) (-> void_for_linking-tezos-protocol-plugin-015-PtLimaPt.empty)) + (select void_for_linking-tezos-client-016-PtMumbai from + (tezos-client-016-PtMumbai -> void_for_linking-tezos-client-016-PtMumbai.empty) + (-> void_for_linking-tezos-client-016-PtMumbai.empty)) + (select void_for_linking-tezos-protocol-plugin-016-PtMumbai from + (tezos-protocol-plugin-016-PtMumbai -> void_for_linking-tezos-protocol-plugin-016-PtMumbai.empty) + (-> void_for_linking-tezos-protocol-plugin-016-PtMumbai.empty)) (select void_for_linking-tezos-client-alpha from (tezos-client-alpha -> void_for_linking-tezos-client-alpha.empty) (-> void_for_linking-tezos-client-alpha.empty)) @@ -148,5 +154,7 @@ (write-file void_for_linking-tezos-protocol-plugin-014-PtKathma.empty "") (write-file void_for_linking-tezos-client-015-PtLimaPt.empty "") (write-file void_for_linking-tezos-protocol-plugin-015-PtLimaPt.empty "") + (write-file void_for_linking-tezos-client-016-PtMumbai.empty "") + (write-file void_for_linking-tezos-protocol-plugin-016-PtMumbai.empty "") (write-file void_for_linking-tezos-client-alpha.empty "") (write-file void_for_linking-tezos-protocol-plugin-alpha.empty "")))) diff --git a/src/proto_016_PtMumbai/bin_accuser/dune b/src/proto_016_PtMumbai/bin_accuser/dune index bfa85eafe9cf..e4e777e16b00 100644 --- a/src/proto_016_PtMumbai/bin_accuser/dune +++ b/src/proto_016_PtMumbai/bin_accuser/dune @@ -2,17 +2,17 @@ ; Edit file manifest/main.ml instead. (executable - (name main_accuser_alpha) - (public_name octez-accuser-alpha) - (package octez-accuser-alpha) + (name main_accuser_016_PtMumbai) + (public_name octez-accuser-PtMumbai) + (package octez-accuser-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-client-commands - tezos-baking-alpha-commands + tezos-baking-016-PtMumbai-commands tezos-stdlib-unix tezos-client-base-unix) (link_flags @@ -22,9 +22,9 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha_commands + -open Tezos_baking_016_PtMumbai_commands -open Tezos_stdlib_unix -open Tezos_client_base_unix)) diff --git a/src/proto_016_PtMumbai/bin_baker/dune b/src/proto_016_PtMumbai/bin_baker/dune index 68fc1d13b200..6c7e96d88d16 100644 --- a/src/proto_016_PtMumbai/bin_baker/dune +++ b/src/proto_016_PtMumbai/bin_baker/dune @@ -2,17 +2,17 @@ ; Edit file manifest/main.ml instead. (executable - (name main_baker_alpha) - (public_name octez-baker-alpha) - (package octez-baker-alpha) + (name main_baker_016_PtMumbai) + (public_name octez-baker-PtMumbai) + (package octez-baker-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-client-commands - tezos-baking-alpha-commands + tezos-baking-016-PtMumbai-commands tezos-stdlib-unix tezos-client-base-unix) (link_flags @@ -22,9 +22,9 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha_commands + -open Tezos_baking_016_PtMumbai_commands -open Tezos_stdlib_unix -open Tezos_client_base_unix)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/dune b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune index 2efb5907ffbd..368c1f16751a 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_client/dune +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune @@ -2,22 +2,22 @@ ; Edit file manifest/main.ml instead. (executable - (name main_sc_rollup_client_alpha) - (public_name octez-sc-rollup-client-alpha) - (package octez-sc-rollup-client-alpha) + (name main_sc_rollup_client_016_PtMumbai) + (public_name octez-sc-rollup-client-PtMumbai) + (package octez-sc-rollup-client-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands tezos-stdlib-unix tezos-client-base-unix tezos-rpc-http tezos-rpc-http-client-unix - tezos-protocol-alpha - tezos-sc-rollup-alpha + tezos-protocol-016-PtMumbai + tezos-sc-rollup-016-PtMumbai uri) (link_flags (:standard) @@ -26,10 +26,10 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands -open Tezos_stdlib_unix -open Tezos_client_base_unix -open Tezos_rpc_http_client_unix - -open Tezos_protocol_alpha - -open Tezos_sc_rollup_alpha)) + -open Tezos_protocol_016_PtMumbai + -open Tezos_sc_rollup_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dune b/src/proto_016_PtMumbai/bin_sc_rollup_node/dune index f2aa7ccb6255..b0933eb851cd 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_node/dune +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dune @@ -2,9 +2,9 @@ ; Edit file manifest/main.ml instead. (executable - (name main_sc_rollup_node_alpha) - (public_name octez-sc-rollup-node-alpha) - (package octez-sc-rollup-node-alpha) + (name main_sc_rollup_node_016_PtMumbai) + (public_name octez-sc-rollup-node-PtMumbai) + (package octez-sc-rollup-node-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base @@ -13,12 +13,12 @@ tezos-stdlib-unix tezos-client-base tezos-client-base-unix - tezos-client-alpha + tezos-client-016-PtMumbai tezos-context.encoding tezos-context.helpers - tezos-protocol-alpha - tezos-protocol-plugin-alpha - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-rpc tezos-rpc-http tezos-rpc-http-server @@ -26,8 +26,8 @@ tezos_dal_node_services tezos_dal_node_lib tezos-shell-services - tezos-sc-rollup-alpha - tezos-layer2-utils-alpha + tezos-sc-rollup-016-PtMumbai + tezos-layer2-utils-016-PtMumbai tezos_layer2_store data-encoding irmin-pack @@ -35,7 +35,7 @@ irmin aches aches-lwt - tezos-injector-alpha + tezos-injector-016-PtMumbai tezos-scoru-wasm-fast tezos-crypto-dal prometheus-app @@ -52,15 +52,15 @@ -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_base_unix - -open Tezos_client_alpha - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_alpha_parameters + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_workers -open Tezos_dal_node_lib -open Tezos_shell_services - -open Tezos_sc_rollup_alpha - -open Tezos_layer2_utils_alpha + -open Tezos_sc_rollup_016_PtMumbai + -open Tezos_layer2_utils_016_PtMumbai -open Tezos_layer2_store - -open Tezos_injector_alpha + -open Tezos_injector_016_PtMumbai -open Tezos_crypto_dal)) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/dune b/src/proto_016_PtMumbai/bin_tx_rollup_client/dune index 9389a79136e2..6cf7e64cdba7 100644 --- a/src/proto_016_PtMumbai/bin_tx_rollup_client/dune +++ b/src/proto_016_PtMumbai/bin_tx_rollup_client/dune @@ -2,19 +2,19 @@ ; Edit file manifest/main.ml instead. (executable - (name main_tx_rollup_client_alpha) - (public_name octez-tx-rollup-client-alpha) - (package octez-tx-rollup-client-alpha) + (name main_tx_rollup_client_016_PtMumbai) + (public_name octez-tx-rollup-client-PtMumbai) + (package octez-tx-rollup-client-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-client-alpha - tezos-client-alpha.commands + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai + tezos-client-016-PtMumbai.commands tezos-client-base-unix tezos-stdlib-unix - tezos-tx-rollup-alpha + tezos-tx-rollup-016-PtMumbai uri) (link_flags (:standard) @@ -23,10 +23,10 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha.Protocol - -open Tezos_client_alpha - -open Tezos_client_alpha_commands + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai.Protocol + -open Tezos_client_016_PtMumbai + -open Tezos_client_016_PtMumbai_commands -open Tezos_client_base_unix -open Tezos_stdlib_unix - -open Tezos_tx_rollup_alpha)) + -open Tezos_tx_rollup_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_node/dune b/src/proto_016_PtMumbai/bin_tx_rollup_node/dune index 7fbae62f8e39..26e8f1286236 100644 --- a/src/proto_016_PtMumbai/bin_tx_rollup_node/dune +++ b/src/proto_016_PtMumbai/bin_tx_rollup_node/dune @@ -2,18 +2,18 @@ ; Edit file manifest/main.ml instead. (executable - (name main_tx_rollup_node_alpha) - (public_name octez-tx-rollup-node-alpha) - (package octez-tx-rollup-node-alpha) + (name main_tx_rollup_node_016_PtMumbai) + (public_name octez-tx-rollup-node-PtMumbai) + (package octez-tx-rollup-node-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-client-base tezos-client-base-unix - tezos-tx-rollup-alpha) + tezos-tx-rollup-016-PtMumbai) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp)) @@ -22,8 +22,8 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base - -open Tezos_protocol_alpha - -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_016_PtMumbai -open Tezos_client_base -open Tezos_client_base_unix - -open Tezos_tx_rollup_alpha)) + -open Tezos_tx_rollup_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/dune b/src/proto_016_PtMumbai/bin_wasm_repl/dune index 335edec6db1b..551aea6804c7 100644 --- a/src/proto_016_PtMumbai/bin_wasm_repl/dune +++ b/src/proto_016_PtMumbai/bin_wasm_repl/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (executable - (name main_wasm_repl_alpha) - (public_name octez-wasm-repl-alpha) + (name main_wasm_repl_016_PtMumbai) + (public_name octez-wasm-repl-PtMumbai) (package octez-wasm-repl) (instrumentation (backend bisect_ppx)) (libraries @@ -14,14 +14,14 @@ tezos-context.disk tezos-base-test-helpers tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-scoru-wasm test_scoru_wasm_test_helpers tezos-webassembly-interpreter tezos-webassembly-interpreter-extra - tezos-protocol-alpha - tezos-protocol-plugin-alpha - tezos-protocol-alpha.parameters) + tezos-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters) (preprocess (staged_pps ppx_import ppx_deriving.show)) (link_flags (:standard) @@ -30,10 +30,10 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base_test_helpers - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Test_scoru_wasm_test_helpers -open Tezos_webassembly_interpreter -open Tezos_webassembly_interpreter_extra - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_alpha_parameters)) + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/dune b/src/proto_016_PtMumbai/lib_benchmark/dune index 3a29e3bb29ae..a61edd295222 100644 --- a/src/proto_016_PtMumbai/lib_benchmark/dune +++ b/src/proto_016_PtMumbai/lib_benchmark/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_benchmark_alpha) - (public_name tezos-benchmark-alpha) + (name tezos_benchmark_016_PtMumbai) + (public_name tezos-benchmark-016-PtMumbai) (libraries tezos-stdlib tezos-base @@ -11,12 +11,12 @@ tezos-micheline tezos-micheline-rewriting tezos-benchmark - tezos-benchmark-type-inference-alpha - tezos-protocol-alpha + tezos-benchmark-type-inference-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-crypto - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai.parameters hashcons - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers prbnmcn-stats) (library_flags (:standard -linkall)) (flags @@ -28,7 +28,7 @@ -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_benchmark - -open Tezos_benchmark_type_inference_alpha - -open Tezos_protocol_alpha - -open Tezos_alpha_test_helpers) + -open Tezos_benchmark_type_inference_016_PtMumbai + -open Tezos_protocol_016_PtMumbai + -open Tezos_016_PtMumbai_test_helpers) (private_modules kernel rules state_space)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune index d77fee8c6414..907af7e2d754 100644 --- a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_benchmark_type_inference_alpha) - (public_name tezos-benchmark-type-inference-alpha) + (name tezos_benchmark_type_inference_016_PtMumbai) + (public_name tezos-benchmark-type-inference-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-stdlib @@ -11,7 +11,7 @@ tezos-crypto tezos-micheline tezos-micheline-rewriting - tezos-protocol-alpha + tezos-protocol-016-PtMumbai hashcons) (flags (:standard) @@ -20,4 +20,4 @@ -open Tezos_crypto -open Tezos_micheline -open Tezos_micheline_rewriting - -open Tezos_protocol_alpha)) + -open Tezos_protocol_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune index de2cd72795d6..0cab546f2f06 100644 --- a/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune +++ b/src/proto_016_PtMumbai/lib_benchmark/lib_benchmark_type_inference/test/dune @@ -6,21 +6,21 @@ (libraries tezos-micheline tezos-micheline-rewriting - tezos-benchmark-type-inference-alpha - tezos-protocol-alpha + tezos-benchmark-type-inference-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-error-monad - tezos-client-alpha) + tezos-client-016-PtMumbai) (flags (:standard) -open Tezos_micheline - -open Tezos_benchmark_type_inference_alpha)) + -open Tezos_benchmark_type_inference_016_PtMumbai)) (rule (alias runtest) - (package tezos-benchmark-type-inference-alpha) + (package tezos-benchmark-type-inference-016-PtMumbai) (action (run %{dep:./test_uf.exe}))) (rule (alias runtest) - (package tezos-benchmark-type-inference-alpha) + (package tezos-benchmark-type-inference-016-PtMumbai) (action (run %{dep:./test_inference.exe}))) diff --git a/src/proto_016_PtMumbai/lib_benchmark/test/dune b/src/proto_016_PtMumbai/lib_benchmark/test/dune index 6cf42fc7f09e..894ffc560d82 100644 --- a/src/proto_016_PtMumbai/lib_benchmark/test/dune +++ b/src/proto_016_PtMumbai/lib_benchmark/test/dune @@ -11,11 +11,11 @@ tezos-base tezos-micheline tezos-micheline-rewriting - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-benchmark - tezos-benchmark-type-inference-alpha - tezos-benchmark-alpha - tezos-alpha-test-helpers + tezos-benchmark-type-inference-016-PtMumbai + tezos-benchmark-016-PtMumbai + tezos-016-PtMumbai-test-helpers tezos-error-monad alcotest-lwt prbnmcn-stats) @@ -23,11 +23,11 @@ (:standard) -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline - -open Tezos_protocol_alpha + -open Tezos_protocol_016_PtMumbai -open Tezos_benchmark - -open Tezos_benchmark_type_inference_alpha - -open Tezos_benchmark_alpha - -open Tezos_alpha_test_helpers)) + -open Tezos_benchmark_type_inference_016_PtMumbai + -open Tezos_benchmark_016_PtMumbai + -open Tezos_016_PtMumbai_test_helpers)) (rule (alias runtest_micheline_rewriting_data) diff --git a/src/proto_016_PtMumbai/lib_benchmarks_proto/dune b/src/proto_016_PtMumbai/lib_benchmarks_proto/dune index dfcf71e1bf12..e66fde315d24 100644 --- a/src/proto_016_PtMumbai/lib_benchmarks_proto/dune +++ b/src/proto_016_PtMumbai/lib_benchmarks_proto/dune @@ -2,27 +2,27 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_benchmarks_proto_alpha) - (public_name tezos-benchmarks-proto-alpha) + (name tezos_benchmarks_proto_016_PtMumbai) + (public_name tezos-benchmarks-proto-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries str tezos-stdlib tezos-base tezos-error-monad - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai.parameters tezos-lazy-containers tezos-benchmark - tezos-benchmark-alpha - tezos-benchmark-type-inference-alpha - tezos-protocol-alpha + tezos-benchmark-016-PtMumbai + tezos-benchmark-type-inference-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-crypto tezos-shell-benchmarks tezos-micheline - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers tezos-sapling - tezos-client-alpha - tezos-protocol-plugin-alpha + tezos-client-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai tezos-protocol-environment) (library_flags (:standard -linkall)) (flags @@ -32,14 +32,14 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad - -open Tezos_protocol_alpha_parameters + -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_lazy_containers -open Tezos_benchmark - -open Tezos_benchmark_alpha - -open Tezos_benchmark_type_inference_alpha - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha.Protocol + -open Tezos_benchmark_016_PtMumbai + -open Tezos_benchmark_type_inference_016_PtMumbai + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai.Protocol -open Tezos_micheline - -open Tezos_alpha_test_helpers - -open Tezos_client_alpha - -open Tezos_protocol_plugin_alpha)) + -open Tezos_016_PtMumbai_test_helpers + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_client/dune b/src/proto_016_PtMumbai/lib_client/dune index 438d559c06b4..3148dc22d912 100644 --- a/src/proto_016_PtMumbai/lib_client/dune +++ b/src/proto_016_PtMumbai/lib_client/dune @@ -2,20 +2,20 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_client_alpha) - (public_name tezos-client-alpha) + (name tezos_client_016_PtMumbai) + (public_name tezos-client-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic tezos-shell-services tezos-client-base - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-mockup-registration tezos-proxy tezos-signer-backends - tezos-protocol-plugin-alpha - tezos-protocol-alpha.parameters + tezos-protocol-plugin-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-rpc uri) (inline_tests (flags -verbose) (modes native)) @@ -27,6 +27,6 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_alpha_parameters)) + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters)) diff --git a/src/proto_016_PtMumbai/lib_client/test/dune b/src/proto_016_PtMumbai/lib_client/test/dune index d64599de9795..baf3eff640de 100644 --- a/src/proto_016_PtMumbai/lib_client/test/dune +++ b/src/proto_016_PtMumbai/lib_client/test/dune @@ -10,8 +10,8 @@ (libraries tezos-base tezos-micheline - tezos-client-alpha - tezos-protocol-alpha + tezos-client-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-base-test-helpers tezos-test-helpers alcotest-lwt @@ -21,27 +21,27 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline - -open Tezos_client_alpha - -open Tezos_protocol_alpha + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers -open Lib_test)) (rule (alias runtest) - (package tezos-client-alpha) + (package tezos-client-016-PtMumbai) (action (run %{dep:./test_michelson_v1_macros.exe}))) (rule (alias runtest) - (package tezos-client-alpha) + (package tezos-client-016-PtMumbai) (action (run %{dep:./test_client_proto_contracts.exe}))) (rule (alias runtest) - (package tezos-client-alpha) + (package tezos-client-016-PtMumbai) (action (run %{dep:./test_client_proto_context.exe}))) (rule (alias runtest) - (package tezos-client-alpha) + (package tezos-client-016-PtMumbai) (action (run %{dep:./test_proxy.exe}))) diff --git a/src/proto_016_PtMumbai/lib_client_commands/dune b/src/proto_016_PtMumbai/lib_client_commands/dune index 695b2495f0f6..d096ec41db77 100644 --- a/src/proto_016_PtMumbai/lib_client_commands/dune +++ b/src/proto_016_PtMumbai/lib_client_commands/dune @@ -2,14 +2,14 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_client_alpha_commands) - (public_name tezos-client-alpha.commands) + (name tezos_client_016_PtMumbai_commands) + (public_name tezos-client-016-PtMumbai.commands) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-stdlib-unix tezos-protocol-environment tezos-shell-services @@ -17,56 +17,56 @@ tezos-mockup-registration tezos-mockup-commands tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands tezos-rpc tezos-client-base-unix - tezos-protocol-plugin-alpha + tezos-protocol-plugin-016-PtMumbai uri) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha_parameters + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_stdlib_unix -open Tezos_shell_services -open Tezos_client_base - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands -open Tezos_client_base_unix - -open Tezos_protocol_plugin_alpha) + -open Tezos_protocol_plugin_016_PtMumbai) (modules (:standard \ alpha_commands_registration))) (library - (name tezos_client_alpha_commands_registration) - (public_name tezos-client-alpha.commands-registration) + (name tezos_client_016_PtMumbai_commands_registration) + (public_name tezos-client-016-PtMumbai.commands-registration) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic - tezos-protocol-alpha - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-protocol-environment tezos-shell-services tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands - tezos-client-alpha.commands - tezos-client-alpha.sapling + tezos-client-016-PtMumbai.commands + tezos-client-016-PtMumbai.sapling tezos-rpc - tezos-protocol-plugin-alpha) + tezos-protocol-plugin-016-PtMumbai) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha_parameters + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_shell_services -open Tezos_client_base - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_client_alpha_commands - -open Tezos_client_sapling_alpha - -open Tezos_protocol_plugin_alpha) + -open Tezos_client_016_PtMumbai_commands + -open Tezos_client_sapling_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai) (modules alpha_commands_registration)) diff --git a/src/proto_016_PtMumbai/lib_client_sapling/dune b/src/proto_016_PtMumbai/lib_client_sapling/dune index 63e26f9de414..3321c31a83a0 100644 --- a/src/proto_016_PtMumbai/lib_client_sapling/dune +++ b/src/proto_016_PtMumbai/lib_client_sapling/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_client_sapling_alpha) - (public_name tezos-client-alpha.sapling) + (name tezos_client_sapling_016_PtMumbai) + (public_name tezos-client-016-PtMumbai.sapling) (instrumentation (backend bisect_ppx)) (libraries tezos-base @@ -12,10 +12,10 @@ tezos-stdlib-unix tezos-client-base tezos-signer-backends - tezos-client-alpha - tezos-client-alpha.commands - tezos-protocol-alpha - tezos-protocol-plugin-alpha) + tezos-client-016-PtMumbai + tezos-client-016-PtMumbai.commands + tezos-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai) (library_flags (:standard -linkall)) (flags (:standard) @@ -23,7 +23,7 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base - -open Tezos_client_alpha - -open Tezos_client_alpha_commands - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha)) + -open Tezos_client_016_PtMumbai + -open Tezos_client_016_PtMumbai_commands + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_dal/dune b/src/proto_016_PtMumbai/lib_dal/dune index 9f21d8ff282e..d715171682b3 100644 --- a/src/proto_016_PtMumbai/lib_dal/dune +++ b/src/proto_016_PtMumbai/lib_dal/dune @@ -2,18 +2,18 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_dal_alpha) - (public_name tezos-dal-alpha) + (name tezos_dal_016_PtMumbai) + (public_name tezos-dal-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base octez-protocol-compiler.registerer tezos-stdlib-unix tezos_dal_node_lib - tezos-client-alpha - tezos-embedded-protocol-alpha - tezos-layer2-utils-alpha - tezos-protocol-alpha) + tezos-client-016-PtMumbai + tezos-embedded-protocol-016-PtMumbai + tezos-layer2-utils-016-PtMumbai + tezos-protocol-016-PtMumbai) (inline_tests (flags -verbose) (modes native)) (preprocess (pps ppx_expect)) (library_flags (:standard -linkall)) @@ -24,7 +24,7 @@ -open Tezos_protocol_registerer -open Tezos_stdlib_unix -open Tezos_dal_node_lib - -open Tezos_client_alpha - -open Tezos_embedded_protocol_alpha - -open Tezos_layer2_utils_alpha - -open Tezos_protocol_alpha)) + -open Tezos_client_016_PtMumbai + -open Tezos_embedded_protocol_016_PtMumbai + -open Tezos_layer2_utils_016_PtMumbai + -open Tezos_protocol_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_dal/test/dune b/src/proto_016_PtMumbai/lib_dal/test/dune index e5272d58827c..c935b1c299dc 100644 --- a/src/proto_016_PtMumbai/lib_dal/test/dune +++ b/src/proto_016_PtMumbai/lib_dal/test/dune @@ -5,21 +5,21 @@ (name main) (libraries tezos-base - tezos-dal-alpha - tezos-protocol-alpha + tezos-dal-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-base-test-helpers - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers alcotest-lwt) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_dal_alpha - -open Tezos_protocol_alpha + -open Tezos_dal_016_PtMumbai + -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers - -open Tezos_alpha_test_helpers)) + -open Tezos_016_PtMumbai_test_helpers)) (rule (alias runtest) - (package tezos-dal-alpha) + (package tezos-dal-016-PtMumbai) (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_delegate/dune b/src/proto_016_PtMumbai/lib_delegate/dune index f12049506044..e81fde09cd33 100644 --- a/src/proto_016_PtMumbai/lib_delegate/dune +++ b/src/proto_016_PtMumbai/lib_delegate/dune @@ -2,19 +2,19 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_baking_alpha) - (public_name tezos-baking-alpha) + (name tezos_baking_016_PtMumbai) + (public_name tezos-baking-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-clic tezos-version - tezos-protocol-alpha - tezos-protocol-plugin-alpha + tezos-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai tezos-protocol-environment tezos-shell-services tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands tezos-stdlib tezos-stdlib-unix @@ -33,11 +33,11 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai -open Tezos_shell_services -open Tezos_client_base - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands -open Tezos_stdlib -open Tezos_stdlib_unix @@ -48,19 +48,19 @@ (modules (:standard \ Baking_commands Baking_commands_registration))) (library - (name tezos_baking_alpha_commands) - (public_name tezos-baking-alpha-commands) + (name tezos_baking_016_PtMumbai_commands) + (public_name tezos-baking-016-PtMumbai-commands) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-stdlib-unix tezos-protocol-environment tezos-shell-services tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands - tezos-baking-alpha + tezos-baking-016-PtMumbai tezos-rpc uri) (library_flags (:standard -linkall)) @@ -68,39 +68,39 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha + -open Tezos_protocol_016_PtMumbai -open Tezos_stdlib_unix -open Tezos_shell_services -open Tezos_client_base - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha) + -open Tezos_baking_016_PtMumbai) (modules Baking_commands)) (library - (name tezos_baking_alpha_commands_registration) - (public_name tezos-baking-alpha-commands.registration) + (name tezos_baking_016_PtMumbai_commands_registration) + (public_name tezos-baking-016-PtMumbai-commands.registration) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-protocol-environment tezos-shell-services tezos-client-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-commands - tezos-baking-alpha - tezos-baking-alpha-commands + tezos-baking-016-PtMumbai + tezos-baking-016-PtMumbai-commands tezos-rpc) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha + -open Tezos_protocol_016_PtMumbai -open Tezos_shell_services -open Tezos_client_base - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha - -open Tezos_baking_alpha_commands) + -open Tezos_baking_016_PtMumbai + -open Tezos_baking_016_PtMumbai_commands) (modules Baking_commands_registration)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/dune b/src/proto_016_PtMumbai/lib_delegate/test/dune index e2d734e974fb..72f54abeb0b8 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/dune @@ -6,12 +6,12 @@ (libraries tezos-base tezos-micheline - tezos-client-alpha - tezos-protocol-alpha + tezos-client-016-PtMumbai + tezos-protocol-016-PtMumbai tezos-base-test-helpers - tezos-baking-alpha.mockup-simulator - tezos-baking-alpha - tezos-protocol-alpha.parameters + tezos-baking-016-PtMumbai.mockup-simulator + tezos-baking-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-crypto alcotest-lwt uri) @@ -20,13 +20,13 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline - -open Tezos_client_alpha - -open Tezos_protocol_alpha + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers - -open Tezos_alpha_mockup_simulator - -open Tezos_baking_alpha)) + -open Tezos_016_PtMumbai_mockup_simulator + -open Tezos_baking_016_PtMumbai)) (rule (alias runtest) - (package tezos-baking-alpha) + (package tezos-baking-016-PtMumbai) (action (run %{dep:./main.exe}))) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune index c459c163af1f..dca22937564d 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/mockup_simulator/dune @@ -2,31 +2,31 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_alpha_mockup_simulator) - (public_name tezos-baking-alpha.mockup-simulator) + (name tezos_016_PtMumbai_mockup_simulator) + (public_name tezos-baking-016-PtMumbai.mockup-simulator) (libraries tezos-base - tezos-protocol-alpha - tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-client-commands - tezos-baking-alpha + tezos-baking-016-PtMumbai tezos-stdlib-unix tezos-client-base-unix - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai.parameters tezos-mockup tezos-mockup-proxy tezos-mockup-commands - tezos-baking-alpha.tenderbrute) + tezos-baking-016-PtMumbai.tenderbrute) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha.Protocol - -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai.Protocol + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha + -open Tezos_baking_016_PtMumbai -open Tezos_stdlib_unix -open Tezos_client_base_unix - -open Tezos_protocol_alpha_parameters - -open Tenderbrute_alpha)) + -open Tezos_protocol_016_PtMumbai_parameters + -open Tenderbrute_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune index aec676a97675..afb897a8673d 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/dune @@ -6,9 +6,9 @@ (libraries tezos-base tezos-client-base - tezos-client-alpha - tezos-protocol-alpha - tezos-baking-alpha.tenderbrute) + tezos-client-016-PtMumbai + tezos-protocol-016-PtMumbai + tezos-baking-016-PtMumbai.tenderbrute) (link_flags (:standard -linkall)) (flags @@ -17,6 +17,6 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base -open Tezos_client_base - -open Tezos_client_alpha - -open Tezos_protocol_alpha - -open Tenderbrute_alpha)) + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_016_PtMumbai + -open Tenderbrute_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune index bdeb6478d39c..a1e0e3c5be3b 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/tenderbrute/lib/dune @@ -2,21 +2,21 @@ ; Edit file manifest/main.ml instead. (library - (name tenderbrute_alpha) - (public_name tezos-baking-alpha.tenderbrute) + (name tenderbrute_016_PtMumbai) + (public_name tezos-baking-016-PtMumbai.tenderbrute) (libraries data-encoding tezos-base tezos-base.unix - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-client-base - tezos-client-alpha) + tezos-client-016-PtMumbai) (flags (:standard) -open Data_encoding -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base - -open Tezos_protocol_alpha + -open Tezos_protocol_016_PtMumbai -open Tezos_client_base - -open Tezos_client_alpha)) + -open Tezos_client_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_injector/dune b/src/proto_016_PtMumbai/lib_injector/dune index 8fe34ddecfc3..9410d3996fa2 100644 --- a/src/proto_016_PtMumbai/lib_injector/dune +++ b/src/proto_016_PtMumbai/lib_injector/dune @@ -2,21 +2,21 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_injector_alpha) - (public_name tezos-injector-alpha) + (name tezos_injector_016_PtMumbai) + (public_name tezos-injector-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-base.unix tezos-stdlib-unix tezos-crypto - tezos-protocol-alpha + tezos-protocol-016-PtMumbai tezos-micheline - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-base tezos-workers tezos-shell - tezos-layer2-utils-alpha) + tezos-layer2-utils-016-PtMumbai) (inline_tests (flags -verbose) (modes native)) (preprocess (pps ppx_expect)) (library_flags (:standard -linkall)) @@ -26,9 +26,9 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base -open Tezos_stdlib_unix - -open Tezos_protocol_alpha + -open Tezos_protocol_016_PtMumbai -open Tezos_micheline - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_client_base -open Tezos_workers - -open Tezos_layer2_utils_alpha)) + -open Tezos_layer2_utils_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/dune b/src/proto_016_PtMumbai/lib_layer2_utils/dune index 0caa6c78b11b..6a91309350ac 100644 --- a/src/proto_016_PtMumbai/lib_layer2_utils/dune +++ b/src/proto_016_PtMumbai/lib_layer2_utils/dune @@ -2,18 +2,18 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_layer2_utils_alpha) - (public_name tezos-layer2-utils-alpha) + (name tezos_layer2_utils_016_PtMumbai) + (public_name tezos-layer2-utils-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-protocol-alpha - tezos-client-alpha) + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai) (inline_tests (flags -verbose) (modes native)) (preprocess (pps ppx_expect)) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha - -open Tezos_client_alpha)) + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_parameters/dune b/src/proto_016_PtMumbai/lib_parameters/dune index ba6228fc1b09..e7fb336f03ea 100644 --- a/src/proto_016_PtMumbai/lib_parameters/dune +++ b/src/proto_016_PtMumbai/lib_parameters/dune @@ -2,33 +2,33 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_protocol_alpha_parameters) - (public_name tezos-protocol-alpha.parameters) + (name tezos_protocol_016_PtMumbai_parameters) + (public_name tezos-protocol-016-PtMumbai.parameters) (instrumentation (backend bisect_ppx)) (libraries tezos-base tezos-protocol-environment - tezos-protocol-alpha) + tezos-protocol-016-PtMumbai) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha) + -open Tezos_protocol_016_PtMumbai) (modules (:standard \ gen))) (executable (name gen) (libraries tezos-base - tezos-protocol-alpha.parameters - tezos-protocol-alpha) + tezos-protocol-016-PtMumbai.parameters + tezos-protocol-016-PtMumbai) (link_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha_parameters - -open Tezos_protocol_alpha) + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_protocol_016_PtMumbai) (modules gen)) (rule @@ -47,6 +47,6 @@ (action (run %{deps} --mainnet))) (install - (package tezos-protocol-alpha) + (package tezos-protocol-016-PtMumbai) (section lib) (files sandbox-parameters.json test-parameters.json mainnet-parameters.json)) diff --git a/src/proto_016_PtMumbai/lib_plugin/dune b/src/proto_016_PtMumbai/lib_plugin/dune index 148f8d0e9c9c..74187995cbc1 100644 --- a/src/proto_016_PtMumbai/lib_plugin/dune +++ b/src/proto_016_PtMumbai/lib_plugin/dune @@ -2,33 +2,33 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_protocol_plugin_alpha) - (public_name tezos-protocol-plugin-alpha) + (name tezos_protocol_plugin_016_PtMumbai) + (public_name tezos-protocol-plugin-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-protocol-alpha) + tezos-protocol-016-PtMumbai) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha) + -open Tezos_protocol_016_PtMumbai) (modules (:standard \ Plugin_registerer))) (library - (name tezos_protocol_plugin_alpha_registerer) - (public_name tezos-protocol-plugin-alpha-registerer) + (name tezos_protocol_plugin_016_PtMumbai_registerer) + (public_name tezos-protocol-plugin-016-PtMumbai-registerer) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-embedded-protocol-alpha - tezos-protocol-plugin-alpha + tezos-embedded-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai tezos-shell) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_embedded_protocol_alpha - -open Tezos_protocol_plugin_alpha + -open Tezos_embedded_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai -open Tezos_shell) (modules Plugin_registerer)) diff --git a/src/proto_016_PtMumbai/lib_plugin/test/dune b/src/proto_016_PtMumbai/lib_plugin/test/dune index 8217d9534bc0..0bab03714d0e 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/dune +++ b/src/proto_016_PtMumbai/lib_plugin/test/dune @@ -12,33 +12,33 @@ qcheck-alcotest tezos-stdlib-unix tezos-micheline - tezos-protocol-plugin-alpha - tezos-protocol-alpha - tezos-protocol-alpha.parameters - tezos-alpha-test-helpers) + tezos-protocol-plugin-016-PtMumbai + tezos-protocol-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters + tezos-016-PtMumbai-test-helpers) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline - -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha.Protocol - -open Tezos_protocol_alpha_parameters - -open Tezos_alpha_test_helpers)) + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_016_PtMumbai.Protocol + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_016_PtMumbai_test_helpers)) (rule (alias runtest) - (package tezos-protocol-plugin-alpha-tests) + (package tezos-protocol-plugin-016-PtMumbai-tests) (action (run %{dep:./test_consensus_filter.exe}))) (rule (alias runtest) - (package tezos-protocol-plugin-alpha-tests) + (package tezos-protocol-plugin-016-PtMumbai-tests) (action (run %{dep:./test_filter_state.exe}))) (rule (alias runtest) - (package tezos-protocol-plugin-alpha-tests) + (package tezos-protocol-plugin-016-PtMumbai-tests) (action (run %{dep:./test_plugin.exe}))) diff --git a/src/proto_016_PtMumbai/lib_protocol/dune b/src/proto_016_PtMumbai/lib_protocol/dune index d9b296a01344..f1871d7ccd91 100644 --- a/src/proto_016_PtMumbai/lib_protocol/dune +++ b/src/proto_016_PtMumbai/lib_protocol/dune @@ -2,20 +2,20 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_protocol_environment_alpha) + (name tezos_protocol_environment_016_PtMumbai) (public_name tezos-protocol-016-PtMumbai.environment) (instrumentation (backend bisect_ppx)) (libraries tezos-protocol-environment) (library_flags (:standard -linkall)) - (modules Tezos_protocol_environment_alpha)) + (modules Tezos_protocol_environment_016_PtMumbai)) (rule - (targets tezos_protocol_environment_alpha.ml) + (targets tezos_protocol_environment_016_PtMumbai.ml) (action (write-file %{targets} - "module Name = struct let name = \"alpha\" end\ninclude Tezos_protocol_environment.V8.Make(Name)()\n"))) + "module Name = struct let name = \"016-PtMumbai\" end\ninclude Tezos_protocol_environment.V8.Make(Name)()\n"))) (library (name tezos_raw_protocol_016_PtMumbai) @@ -28,9 +28,9 @@ (:standard) -nostdlib -nopervasives - -open Tezos_protocol_environment_alpha - -open Tezos_protocol_environment_alpha.Pervasives - -open Tezos_protocol_environment_alpha.Error_monad) + -open Tezos_protocol_environment_016_PtMumbai + -open Tezos_protocol_environment_016_PtMumbai.Pervasives + -open Tezos_protocol_environment_016_PtMumbai.Error_monad) (modules Misc Non_empty_string @@ -296,14 +296,14 @@ (action (write-file %{targets} - "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\"\nlet name = Tezos_protocol_environment_alpha.Name.name\ninclude Tezos_raw_protocol_016_PtMumbai\ninclude Tezos_raw_protocol_alpha.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD\"\nlet name = Tezos_protocol_environment_016_PtMumbai.Name.name\ninclude Tezos_raw_protocol_016_PtMumbai\ninclude Tezos_raw_protocol_016_PtMumbai.Main\n"))) (rule (targets tezos_protocol_016_PtMumbai.ml) (action (write-file %{targets} - "\nmodule Environment = Tezos_protocol_environment_alpha\nmodule Protocol = Protocol\n"))) + "\nmodule Environment = Tezos_protocol_environment_016_PtMumbai\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -554,7 +554,7 @@ alpha_services.ml alpha_services.mli main.ml main.mli (:src_dir TEZOS_PROTOCOL)) - (action (run %{bin:octez-protocol-compiler} -no-hash-check -warn-error +a .))) + (action (run %{bin:octez-protocol-compiler} -warn-error +a .))) (library (name tezos_protocol_016_PtMumbai_functor) @@ -1085,4 +1085,4 @@ %{targets} (chdir %{workspace_root} - (run %{bin:octez-embedded-protocol-packer} %{src_dir} alpha))))) + (run %{bin:octez-embedded-protocol-packer} %{src_dir} 016_PtMumbai))))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune index e0b06837bd91..b70435330038 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_alpha_test_helpers) - (public_name tezos-alpha-test-helpers) + (name tezos_016_PtMumbai_test_helpers) + (public_name tezos-016-PtMumbai-test-helpers) (instrumentation (backend bisect_ppx)) (libraries alcotest-lwt @@ -13,10 +13,10 @@ tezos-micheline tezos-stdlib-unix tezos-protocol-016-PtMumbai - tezos-client-alpha + tezos-client-016-PtMumbai tezos-protocol-016-PtMumbai.parameters tezos-protocol-environment - tezos-protocol-plugin-alpha + tezos-protocol-plugin-016-PtMumbai tezos-shell-services tezos-plompiler tezos-crypto-dal) @@ -27,7 +27,7 @@ -open Tezos_micheline -open Tezos_stdlib_unix -open Tezos_protocol_016_PtMumbai - -open Tezos_client_alpha - -open Tezos_protocol_plugin_alpha + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai -open Tezos_shell_services -open Tezos_crypto_dal)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune index da895ae2b7c6..3290fb708f32 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune @@ -7,19 +7,19 @@ alcotest-lwt tezos-base tezos-protocol-016-PtMumbai - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers tezos-protocol-016-PtMumbai.parameters - tezos-protocol-plugin-alpha) + tezos-protocol-plugin-016-PtMumbai) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai - -open Tezos_alpha_test_helpers + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers -open Tezos_protocol_016_PtMumbai_parameters - -open Tezos_protocol_plugin_alpha)) + -open Tezos_protocol_plugin_016_PtMumbai)) (rule (alias runtest) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune index 37f09ac5c5a6..8314557b4134 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune @@ -8,19 +8,19 @@ tezos-context alcotest-lwt tezos-base - tezos-client-alpha + tezos-client-016-PtMumbai tezos-protocol-016-PtMumbai tezos-protocol-016-PtMumbai.parameters - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_protocol_016_PtMumbai -open Tezos_protocol_016_PtMumbai_parameters - -open Tezos_alpha_test_helpers + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers)) (rule diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune index b6b619a82da8..13d5cf50c0ec 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune @@ -7,14 +7,14 @@ alcotest-lwt tezos-base tezos-protocol-016-PtMumbai - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai - -open Tezos_alpha_test_helpers + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers)) (rule diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune index 4def0a0e6f5a..8fc9869b8780 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune @@ -7,27 +7,27 @@ alcotest-lwt tezos-base tezos-protocol-016-PtMumbai - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers - tezos-client-alpha + tezos-client-016-PtMumbai tezos-benchmark tezos-micheline - tezos-benchmark-alpha - tezos-benchmark-type-inference-alpha - tezos-protocol-plugin-alpha + tezos-benchmark-016-PtMumbai + tezos-benchmark-type-inference-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai tezos-protocol-016-PtMumbai.parameters) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai - -open Tezos_alpha_test_helpers + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_micheline - -open Tezos_benchmark_alpha - -open Tezos_benchmark_type_inference_alpha - -open Tezos_protocol_plugin_alpha)) + -open Tezos_benchmark_016_PtMumbai + -open Tezos_benchmark_type_inference_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai)) (rule (alias runtest) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune index d20198296492..2e09908120ca 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune @@ -7,19 +7,19 @@ alcotest-lwt tezos-base tezos-protocol-016-PtMumbai - tezos-client-alpha - tezos-alpha-test-helpers + tezos-client-016-PtMumbai + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers - tezos-protocol-plugin-alpha) + tezos-protocol-plugin-016-PtMumbai) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai - -open Tezos_client_alpha - -open Tezos_alpha_test_helpers + -open Tezos_client_016_PtMumbai + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers - -open Tezos_protocol_plugin_alpha)) + -open Tezos_protocol_plugin_016_PtMumbai)) (rule (alias runtest) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune index 2af027a6662d..e87848a8c1f4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune @@ -8,19 +8,19 @@ tezos-base tezos-protocol-016-PtMumbai qcheck-alcotest - tezos-client-alpha - tezos-alpha-test-helpers + tezos-client-016-PtMumbai + tezos-016-PtMumbai-test-helpers tezos-base-test-helpers - tezos-protocol-plugin-alpha) + tezos-protocol-plugin-016-PtMumbai) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai - -open Tezos_client_alpha - -open Tezos_alpha_test_helpers + -open Tezos_client_016_PtMumbai + -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers - -open Tezos_protocol_plugin_alpha)) + -open Tezos_protocol_plugin_016_PtMumbai)) (rule (alias runtest) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune index f8f1dc3ad6a6..203636cabb7d 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune @@ -24,17 +24,17 @@ (libraries tezos-base tezos-micheline - tezos-client-alpha + tezos-client-016-PtMumbai tezos-protocol-016-PtMumbai tezos-context.merkle_proof_encoding tezos-test-helpers - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers alcotest qcheck-alcotest tezos-benchmark - tezos-benchmark-alpha - tezos-benchmark-type-inference-alpha - tezos-sc-rollup-alpha + tezos-benchmark-016-PtMumbai + tezos-benchmark-type-inference-016-PtMumbai + tezos-sc-rollup-016-PtMumbai tezos-crypto-dal tezos-base-test-helpers tezos-protocol-016-PtMumbai.parameters) @@ -42,12 +42,12 @@ (:standard) -open Tezos_base.TzPervasives -open Tezos_micheline - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_protocol_016_PtMumbai - -open Tezos_alpha_test_helpers - -open Tezos_benchmark_alpha - -open Tezos_benchmark_type_inference_alpha - -open Tezos_sc_rollup_alpha + -open Tezos_016_PtMumbai_test_helpers + -open Tezos_benchmark_016_PtMumbai + -open Tezos_benchmark_type_inference_016_PtMumbai + -open Tezos_sc_rollup_016_PtMumbai -open Tezos_crypto_dal -open Tezos_base_test_helpers -open Tezos_protocol_016_PtMumbai_parameters)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/dune b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune index fe33ec26904e..65df3f9f2d15 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/regression/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune @@ -2,16 +2,16 @@ ; Edit file manifest/main.ml instead. (library - (name src_proto_alpha_lib_protocol_test_regression_tezt_lib) + (name src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib) (instrumentation (backend bisect_ppx)) (libraries tezt.core tezos-base tezt-tezos tezos-protocol-016-PtMumbai - tezos-client-alpha - tezos-protocol-plugin-alpha - tezos-alpha-test-helpers + tezos-client-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai + tezos-016-PtMumbai-test-helpers tezos-micheline) (library_flags (:standard -linkall)) (flags @@ -21,16 +21,16 @@ -open Tezos_base.TzPervasives -open Tezt_tezos -open Tezos_protocol_016_PtMumbai - -open Tezos_client_alpha - -open Tezos_protocol_plugin_alpha - -open Tezos_alpha_test_helpers + -open Tezos_client_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_016_PtMumbai_test_helpers -open Tezos_micheline) (modules test_logging)) (executable (name main) (libraries - src_proto_alpha_lib_protocol_test_regression_tezt_lib + src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib tezt) (modules main)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune index c4aff854f7b3..2e883eb18af7 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune @@ -7,13 +7,13 @@ tezos-base tezos-base-test-helpers tezos-micheline - tezos-client-alpha + tezos-client-016-PtMumbai tezos-client-base tezos-protocol-016-PtMumbai.parameters tezos-protocol-environment tezos-stdlib-unix tezos-protocol-016-PtMumbai - tezos-alpha-test-helpers + tezos-016-PtMumbai-test-helpers alcotest-lwt test_scoru_wasm_test_helpers tezos-stdlib @@ -26,10 +26,10 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline - -open Tezos_client_alpha + -open Tezos_client_016_PtMumbai -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_protocol_016_PtMumbai - -open Tezos_alpha_test_helpers + -open Tezos_016_PtMumbai_test_helpers -open Test_scoru_wasm_test_helpers -open Tezos_stdlib -open Tezos_crypto_dal diff --git a/src/proto_016_PtMumbai/lib_sc_rollup/dune b/src/proto_016_PtMumbai/lib_sc_rollup/dune index 759a44c274e0..8ca6db89fc4f 100644 --- a/src/proto_016_PtMumbai/lib_sc_rollup/dune +++ b/src/proto_016_PtMumbai/lib_sc_rollup/dune @@ -2,23 +2,23 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_sc_rollup_alpha) - (public_name tezos-sc-rollup-alpha) + (name tezos_sc_rollup_016_PtMumbai) + (public_name tezos-sc-rollup-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries tezos-base - tezos-protocol-alpha - tezos-protocol-plugin-alpha - tezos-protocol-alpha.parameters + tezos-protocol-016-PtMumbai + tezos-protocol-plugin-016-PtMumbai + tezos-protocol-016-PtMumbai.parameters tezos-rpc - tezos-injector-alpha) + tezos-injector-016-PtMumbai) (inline_tests (flags -verbose) (modes native)) (preprocess (pps ppx_expect)) (library_flags (:standard -linkall)) (flags (:standard) -open Tezos_base.TzPervasives - -open Tezos_protocol_alpha - -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_alpha_parameters - -open Tezos_injector_alpha)) + -open Tezos_protocol_016_PtMumbai + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_protocol_016_PtMumbai_parameters + -open Tezos_injector_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/lib_tx_rollup/dune b/src/proto_016_PtMumbai/lib_tx_rollup/dune index a922e7feda9e..55a8e28587e6 100644 --- a/src/proto_016_PtMumbai/lib_tx_rollup/dune +++ b/src/proto_016_PtMumbai/lib_tx_rollup/dune @@ -2,18 +2,18 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_tx_rollup_alpha) - (public_name tezos-tx-rollup-alpha) + (name tezos_tx_rollup_016_PtMumbai) + (public_name tezos-tx-rollup-016-PtMumbai) (instrumentation (backend bisect_ppx)) (libraries index tezos-base tezos-crypto - tezos-protocol-alpha - tezos-client-alpha + tezos-protocol-016-PtMumbai + tezos-client-016-PtMumbai tezos-client-commands tezos-context.encoding - tezos-baking-alpha-commands + tezos-baking-016-PtMumbai-commands tezos-stdlib-unix tezos-rpc tezos-rpc-http @@ -25,8 +25,8 @@ tezos-shell tezos-store tezos-workers - tezos-protocol-plugin-alpha - tezos-injector-alpha) + tezos-protocol-plugin-016-PtMumbai + tezos-injector-016-PtMumbai) (inline_tests (flags -verbose) (modes native)) (preprocess (pps ppx_expect)) (library_flags (:standard -linkall)) @@ -35,10 +35,10 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base - -open Tezos_protocol_alpha - -open Tezos_client_alpha + -open Tezos_protocol_016_PtMumbai + -open Tezos_client_016_PtMumbai -open Tezos_client_commands - -open Tezos_baking_alpha_commands + -open Tezos_baking_016_PtMumbai_commands -open Tezos_stdlib_unix -open Tezos_rpc_http -open Tezos_rpc_http_client_unix @@ -47,5 +47,5 @@ -open Tezos_client_base -open Tezos_client_base_unix -open Tezos_workers - -open Tezos_protocol_plugin_alpha - -open Tezos_injector_alpha)) + -open Tezos_protocol_plugin_016_PtMumbai + -open Tezos_injector_016_PtMumbai)) diff --git a/tezt/tests/dune b/tezt/tests/dune index 07e057280a14..198e1acba248 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -14,6 +14,7 @@ tezos-stdlib-unix tezos-protocol-alpha src_proto_alpha_lib_protocol_test_regression_tezt_lib + src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_regression_tezt_lib src_proto_014_PtKathma_lib_protocol_test_regression_tezt_lib) (flags -- GitLab From 7d010e3e6ead35a06fda9d262a0ba0f6f75c9fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 17:14:45 +0000 Subject: [PATCH 03/18] Update .ocamlformat files --- .../lib_protocol/.ocamlformat-ignore | 455 ++++++++++++++++++ 1 file changed, 455 insertions(+) create mode 100644 src/proto_016_PtMumbai/lib_protocol/.ocamlformat-ignore diff --git a/src/proto_016_PtMumbai/lib_protocol/.ocamlformat-ignore b/src/proto_016_PtMumbai/lib_protocol/.ocamlformat-ignore new file mode 100644 index 000000000000..887929f17746 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/.ocamlformat-ignore @@ -0,0 +1,455 @@ +alpha_context.ml +alpha_context.mli +alpha_services.ml +alpha_services.mli +amendment.ml +amendment.mli +apply.ml +apply.mli +apply_internal_results.ml +apply_internal_results.mli +apply_operation_result.ml +apply_operation_result.mli +apply_results.ml +apply_results.mli +baking.ml +baking.mli +bitset.ml +bitset.mli +blinded_public_key_hash.ml +blinded_public_key_hash.mli +block_header_repr.ml +block_header_repr.mli +block_payload_hash.ml +block_payload_hash.mli +block_payload_repr.ml +block_payload_repr.mli +bond_id_repr.ml +bond_id_repr.mli +bootstrap_storage.ml +bootstrap_storage.mli +bounded_history_repr.ml +bounded_history_repr.mli +cache_memory_helpers.ml +cache_repr.ml +cache_repr.mli +carbonated_map.ml +carbonated_map.mli +carbonated_map_costs.ml +carbonated_map_costs.mli +commitment_repr.ml +commitment_repr.mli +commitment_storage.ml +commitment_storage.mli +constants_parametric_previous_repr.ml +constants_parametric_previous_repr.mli +constants_parametric_repr.ml +constants_parametric_repr.mli +constants_repr.ml +constants_repr.mli +constants_services.ml +constants_services.mli +constants_storage.ml +constants_storage.mli +context_binary_proof.ml +context_binary_proof.mli +contract_delegate_storage.ml +contract_delegate_storage.mli +contract_hash.ml +contract_hash.mli +contract_manager_storage.ml +contract_manager_storage.mli +contract_repr.ml +contract_repr.mli +contract_services.ml +contract_services.mli +contract_storage.ml +contract_storage.mli +cycle_repr.ml +cycle_repr.mli +dal_apply.ml +dal_apply.mli +dal_attestation_repr.ml +dal_attestation_repr.mli +dal_errors_repr.ml +dal_services.ml +dal_services.mli +dal_slot_repr.ml +dal_slot_repr.mli +dal_slot_storage.ml +dal_slot_storage.mli +delegate_activation_storage.ml +delegate_activation_storage.mli +delegate_consensus_key.ml +delegate_consensus_key.mli +delegate_cycles.ml +delegate_cycles.mli +delegate_missed_endorsements_storage.ml +delegate_missed_endorsements_storage.mli +delegate_sampler.ml +delegate_sampler.mli +delegate_services.ml +delegate_services.mli +delegate_slashed_deposits_storage.ml +delegate_slashed_deposits_storage.mli +delegate_storage.ml +delegate_storage.mli +dependent_bool.ml +dependent_bool.mli +destination_repr.ml +destination_repr.mli +entrypoint_repr.ml +entrypoint_repr.mli +fees_storage.ml +fees_storage.mli +fitness_repr.ml +fitness_repr.mli +fixed_point_repr.ml +fixed_point_repr.mli +frozen_deposits_storage.ml +frozen_deposits_storage.mli +gas_comparable_input_size.ml +gas_comparable_input_size.mli +gas_input_size.ml +gas_input_size.mli +gas_limit_repr.ml +gas_limit_repr.mli +gas_monad.ml +gas_monad.mli +global_constants_costs.ml +global_constants_costs.mli +global_constants_storage.ml +global_constants_storage.mli +indexable.ml +indexable.mli +init_storage.ml +init_storage.mli +lazy_storage_diff.ml +lazy_storage_diff.mli +lazy_storage_kind.ml +lazy_storage_kind.mli +legacy_script_patches.ml +level_repr.ml +level_repr.mli +level_storage.ml +level_storage.mli +liquidity_baking_cpmm.ml +liquidity_baking_lqt.ml +liquidity_baking_migration.ml +liquidity_baking_migration.mli +liquidity_baking_repr.ml +liquidity_baking_repr.mli +liquidity_baking_storage.ml +liquidity_baking_storage.mli +local_gas_counter.ml +local_gas_counter.mli +main.ml +main.mli +manager_counter_repr.ml +manager_counter_repr.mli +manager_repr.ml +manager_repr.mli +mempool_validation.ml +mempool_validation.mli +merkle_list.ml +merkle_list.mli +michelson_v1_gas.ml +michelson_v1_gas.mli +michelson_v1_gas_costs.ml +michelson_v1_gas_costs_generated.ml +michelson_v1_primitives.ml +michelson_v1_primitives.mli +migration_repr.ml +migration_repr.mli +misc.ml +misc.mli +non_empty_string.ml +non_empty_string.mli +nonce_hash.ml +nonce_hash.mli +nonce_storage.ml +nonce_storage.mli +operation_repr.ml +operation_repr.mli +origination_nonce.ml +origination_nonce.mli +parameters_repr.ml +parameters_repr.mli +path_encoding.ml +path_encoding.mli +period_repr.ml +period_repr.mli +ratio_repr.ml +ratio_repr.mli +raw_context.ml +raw_context.mli +raw_context_intf.ml +raw_level_repr.ml +raw_level_repr.mli +receipt_repr.ml +receipt_repr.mli +round_repr.ml +round_repr.mli +sampler.ml +sampler.mli +sapling_repr.ml +sapling_services.ml +sapling_storage.ml +sapling_validator.ml +saturation_repr.ml +saturation_repr.mli +sc_rollup_PVM_sig.ml +sc_rollup_arith.ml +sc_rollup_arith.mli +sc_rollup_commitment_repr.ml +sc_rollup_commitment_repr.mli +sc_rollup_commitment_storage.ml +sc_rollup_commitment_storage.mli +sc_rollup_costs.ml +sc_rollup_costs.mli +sc_rollup_data_version_sig.ml +sc_rollup_dissection_chunk_repr.ml +sc_rollup_dissection_chunk_repr.mli +sc_rollup_errors.ml +sc_rollup_game_repr.ml +sc_rollup_game_repr.mli +sc_rollup_inbox_merkelized_payload_hashes_repr.ml +sc_rollup_inbox_merkelized_payload_hashes_repr.mli +sc_rollup_inbox_message_repr.ml +sc_rollup_inbox_message_repr.mli +sc_rollup_inbox_repr.ml +sc_rollup_inbox_repr.mli +sc_rollup_inbox_storage.ml +sc_rollup_inbox_storage.mli +sc_rollup_management_protocol.ml +sc_rollup_management_protocol.mli +sc_rollup_metadata_repr.ml +sc_rollup_metadata_repr.mli +sc_rollup_operations.ml +sc_rollup_operations.mli +sc_rollup_outbox_message_repr.ml +sc_rollup_outbox_message_repr.mli +sc_rollup_outbox_storage.ml +sc_rollup_outbox_storage.mli +sc_rollup_proof_repr.ml +sc_rollup_proof_repr.mli +sc_rollup_refutation_storage.ml +sc_rollup_refutation_storage.mli +sc_rollup_repr.ml +sc_rollup_repr.mli +sc_rollup_reveal_hash.ml +sc_rollup_reveal_hash.mli +sc_rollup_stake_storage.ml +sc_rollup_stake_storage.mli +sc_rollup_storage.ml +sc_rollup_storage.mli +sc_rollup_tick_repr.ml +sc_rollup_tick_repr.mli +sc_rollup_wasm.ml +sc_rollup_wasm.mli +sc_rollups.ml +sc_rollups.mli +script_big_map.ml +script_big_map.mli +script_bytes.ml +script_bytes.mli +script_cache.ml +script_cache.mli +script_comparable.ml +script_comparable.mli +script_expr_hash.ml +script_expr_hash.mli +script_int.ml +script_int.mli +script_interpreter.ml +script_interpreter.mli +script_interpreter_defs.ml +script_ir_annot.ml +script_ir_annot.mli +script_ir_translator.ml +script_ir_translator.mli +script_ir_translator_config.ml +script_ir_unparser.ml +script_ir_unparser.mli +script_list.ml +script_list.mli +script_map.ml +script_map.mli +script_repr.ml +script_repr.mli +script_set.ml +script_set.mli +script_string.ml +script_string.mli +script_tc_context.ml +script_tc_context.mli +script_tc_errors.ml +script_tc_errors_registration.ml +script_tc_errors_registration.mli +script_timestamp.ml +script_timestamp.mli +script_typed_ir.ml +script_typed_ir.mli +script_typed_ir_size.ml +script_typed_ir_size.mli +script_typed_ir_size_costs.ml +script_typed_ir_size_costs.mli +seed_repr.ml +seed_repr.mli +seed_storage.ml +seed_storage.mli +services_registration.ml +services_registration.mli +skip_list_costs.ml +skip_list_costs.mli +skip_list_repr.ml +skip_list_repr.mli +slot_repr.ml +slot_repr.mli +stake_storage.ml +stake_storage.mli +state_hash.ml +state_hash.mli +storage.ml +storage.mli +storage_costs.ml +storage_costs.mli +storage_description.ml +storage_description.mli +storage_functors.ml +storage_functors.mli +storage_sigs.ml +tez_repr.ml +tez_repr.mli +ticket_accounting.ml +ticket_accounting.mli +ticket_amount.ml +ticket_amount.mli +ticket_balance_key.ml +ticket_balance_key.mli +ticket_costs.ml +ticket_costs.mli +ticket_hash_builder.ml +ticket_hash_builder.mli +ticket_hash_repr.ml +ticket_hash_repr.mli +ticket_lazy_storage_diff.ml +ticket_lazy_storage_diff.mli +ticket_operations_diff.ml +ticket_operations_diff.mli +ticket_receipt.ml +ticket_receipt.mli +ticket_scanner.ml +ticket_scanner.mli +ticket_storage.ml +ticket_storage.mli +ticket_token.ml +ticket_token.mli +ticket_token_map.ml +ticket_token_map.mli +ticket_token_unparser.ml +ticket_token_unparser.mli +ticket_transfer.ml +ticket_transfer.mli +time_repr.ml +time_repr.mli +token.ml +token.mli +tx_rollup_commitment_repr.ml +tx_rollup_commitment_repr.mli +tx_rollup_commitment_storage.ml +tx_rollup_commitment_storage.mli +tx_rollup_errors_repr.ml +tx_rollup_gas.ml +tx_rollup_gas.mli +tx_rollup_hash_builder.ml +tx_rollup_inbox_repr.ml +tx_rollup_inbox_repr.mli +tx_rollup_inbox_storage.ml +tx_rollup_inbox_storage.mli +tx_rollup_l2_address.ml +tx_rollup_l2_address.mli +tx_rollup_l2_apply.ml +tx_rollup_l2_apply.mli +tx_rollup_l2_batch.ml +tx_rollup_l2_batch.mli +tx_rollup_l2_context.ml +tx_rollup_l2_context_hash.ml +tx_rollup_l2_context_hash.mli +tx_rollup_l2_context_sig.ml +tx_rollup_l2_proof.ml +tx_rollup_l2_proof.mli +tx_rollup_l2_qty.ml +tx_rollup_l2_qty.mli +tx_rollup_l2_storage_sig.ml +tx_rollup_l2_verifier.ml +tx_rollup_l2_verifier.mli +tx_rollup_level_repr.ml +tx_rollup_level_repr.mli +tx_rollup_message_hash_repr.ml +tx_rollup_message_hash_repr.mli +tx_rollup_message_repr.ml +tx_rollup_message_repr.mli +tx_rollup_message_result_hash_repr.ml +tx_rollup_message_result_hash_repr.mli +tx_rollup_message_result_repr.ml +tx_rollup_message_result_repr.mli +tx_rollup_parameters.ml +tx_rollup_parameters.mli +tx_rollup_prefixes.ml +tx_rollup_prefixes.mli +tx_rollup_repr.ml +tx_rollup_repr.mli +tx_rollup_reveal_repr.ml +tx_rollup_reveal_repr.mli +tx_rollup_reveal_storage.ml +tx_rollup_reveal_storage.mli +tx_rollup_services.ml +tx_rollup_services.mli +tx_rollup_state_repr.ml +tx_rollup_state_repr.mli +tx_rollup_state_storage.ml +tx_rollup_state_storage.mli +tx_rollup_storage.ml +tx_rollup_storage.mli +tx_rollup_withdraw_list_hash_repr.ml +tx_rollup_withdraw_list_hash_repr.mli +tx_rollup_withdraw_repr.ml +tx_rollup_withdraw_repr.mli +validate.ml +validate.mli +validate_errors.ml +validate_errors.mli +vote_repr.ml +vote_repr.mli +vote_storage.ml +vote_storage.mli +voting_period_repr.ml +voting_period_repr.mli +voting_period_storage.ml +voting_period_storage.mli +voting_services.ml +voting_services.mli +zk_rollup_account_repr.ml +zk_rollup_account_repr.mli +zk_rollup_apply.ml +zk_rollup_apply.mli +zk_rollup_circuit_public_inputs_repr.ml +zk_rollup_circuit_public_inputs_repr.mli +zk_rollup_errors.ml +zk_rollup_operation_repr.ml +zk_rollup_operation_repr.mli +zk_rollup_parameters.ml +zk_rollup_parameters.mli +zk_rollup_repr.ml +zk_rollup_repr.mli +zk_rollup_scalar.ml +zk_rollup_scalar.mli +zk_rollup_state_repr.ml +zk_rollup_state_repr.mli +zk_rollup_storage.ml +zk_rollup_storage.mli +zk_rollup_ticket_repr.ml +zk_rollup_ticket_repr.mli +zk_rollup_update_repr.ml +zk_rollup_update_repr.mli -- GitLab From 4ca011539fa2a094356b1c7efbafeaf296b6b678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 17:17:48 +0000 Subject: [PATCH 04/18] Fix OCaml formatting --- src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml | 3 ++- .../lib_protocol/test/integration/operations/test_tx_rollup.ml | 3 ++- .../test/integration/validate/manager_operation_helpers.ml | 3 ++- .../test/integration/validate/valid_operations_generators.ml | 3 ++- .../lib_protocol/test/integration/validate/validate_helpers.ml | 3 ++- .../lib_protocol/test/pbt/test_refutation_game.ml | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml index e263b66df612..3676d34f84cb 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/context.ml @@ -539,7 +539,8 @@ let init_with_constants_gen tup constants = let n = tup_n tup in let*? bootstrap_accounts, contracts = create_bootstrap_accounts n in let parameters = - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .parameters_of_constants ~bootstrap_accounts constants in diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml index 6d63844630a1..26f764d3196b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml @@ -1975,7 +1975,8 @@ let test_full_inbox () = baking_reward_fixed_portion = Tez.zero; tx_rollup = { - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_test + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .constants_test .tx_rollup with enable = true; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml index 710a4ff05624..17943921b8d8 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/manager_operation_helpers.ml @@ -470,7 +470,8 @@ let manager_parameters : Parameters.t -> ctxt_req -> Parameters.t = let init_ctxt_only ctxtreq = let open Lwt_result_syntax in let initial_params = - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .parameters_of_constants {Context.default_test_constants with consensus_threshold = 0} in let*? _cryptobox = diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml index 7fb3741fa697..b6cd531485b4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/valid_operations_generators.ml @@ -101,7 +101,8 @@ let compose_preludes nb_cycles descrs = let initiated_params descrs nb_accounts = let consensus_committee_size = nb_accounts in let initial_params = - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .parameters_of_constants { Context.default_test_constants with consensus_threshold = 0; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml index fd61a97a14b5..715b19a4d705 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/validate_helpers.ml @@ -372,7 +372,8 @@ let pick_addr_endorser ctxt = | _ -> assert false let init_params = - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.parameters_of_constants + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .parameters_of_constants {Context.default_test_constants with consensus_threshold = 0} let delegates_of_block block = diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml index 7abd1d7404fd..097c628da12a 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml @@ -751,7 +751,8 @@ module Dissection = struct (* The test is not general enough to support all kind of number of sections. *) let number_of_sections = - Tezos_protocol_016_PtMumbai_parameters.Default_parameters.constants_mainnet + Tezos_protocol_016_PtMumbai_parameters.Default_parameters + .constants_mainnet .sc_rollup .number_of_sections_in_dissection in -- GitLab From 73a2086b1c7fe11a01bc7cb8a8e2b91d1b364e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 17:45:16 +0000 Subject: [PATCH 05/18] Doc: Generate RPC and commands docs --- docs/Makefile | 7 +++++-- docs/doc_gen/dune | 1 + docs/doc_gen/rpc_doc.ml | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 7b616b86b4d2..85aee01393a4 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,17 +12,19 @@ P2PDOCEXE = $(TOPBUILDDIR)/docs/$(DOCGENDIR)/p2p_doc.exe RPCDOCEXE = $(TOPBUILDDIR)/docs/$(DOCGENDIR)/rpc_doc.exe ERRDOCEXE = $(TOPBUILDDIR)/docs/$(DOCERRORDIR)/error_doc.exe -NAMED_PROTOS = kathmandu lima +NAMED_PROTOS = kathmandu lima mumbai PROTOCOLS = $(NAMED_PROTOS) alpha # The following variables names are lowercase, so their names can be computed # from the names of the corresponding protocol directories kathmandu_long = PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg lima_long = PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW +mumbai_long = PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD alpha_long = ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK kathmandu_short = PtKathma lima_short = PtLimaPt +mumbai_short = PtMumbai alpha_short = alpha SCRIPTSDIR = scripts @@ -101,6 +103,7 @@ redirectcheck: html xrefscheck: $(CHECKXREFS) kathmandu $(CHECKXREFS) -l lima + $(CHECKXREFS) -l mumbai $(CHECKXREFS) -l alpha scriptsindoccheck: @@ -202,4 +205,4 @@ lint: pylint pycodestyle lint_black clean: @-rm -Rf "$(BUILDDIR)" linkcheck @-rm -Rf api/errors.rst developer/metrics.csv user/node-config.json alpha/rpc.rst shell/rpc.rst shell/p2p_api.rst user/default-acl.json CHANGES-dev.rst - @-rm -Rf api/octez-*.html api/octez-*.txt active/octez-*.html kathmandu/octez-*.html lima/octez-*.html alpha/octez-*.html + @-rm -Rf api/octez-*.html api/octez-*.txt active/octez-*.html kathmandu/octez-*.html lima/octez-*.html mumbai/octez-*.html alpha/octez-*.html diff --git a/docs/doc_gen/dune b/docs/doc_gen/dune index 04ed2cf21836..d53b50a940a4 100644 --- a/docs/doc_gen/dune +++ b/docs/doc_gen/dune @@ -11,6 +11,7 @@ tezos-embedded-protocol-genesis tezos-embedded-protocol-014-PtKathma tezos-embedded-protocol-015-PtLimaPt + tezos-embedded-protocol-016-PtMumbai tezos-embedded-protocol-alpha data-encoding re) diff --git a/docs/doc_gen/rpc_doc.ml b/docs/doc_gen/rpc_doc.ml index 956696aab291..efbcaf084ffe 100644 --- a/docs/doc_gen/rpc_doc.ml +++ b/docs/doc_gen/rpc_doc.ml @@ -41,6 +41,10 @@ let protocols = "Lima", Some "/include/rpc_introduction.rst.inc", "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW" ); + ( "mumbai", + "Mumbai", + Some "/include/rpc_introduction.rst.inc", + "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD" ); ] let pp_name ppf = function -- GitLab From 4ea27d99c1bc7e521ee1e7f7fd9c4ab61bbfb895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 17:55:50 +0000 Subject: [PATCH 06/18] Test: add Mumbai to Tezt tests --- tezt/lib_tezos/protocol.ml | 15 ++++++++++++--- tezt/lib_tezos/protocol.mli | 2 +- tezt/tests/baker_test.ml | 2 +- tezt/tests/client_commands.ml | 6 +++--- tezt/tests/manager_operations.ml | 2 +- tezt/tests/mockup.ml | 2 +- tezt/tests/prevalidator.ml | 4 ++-- tezt/tests/run_script.ml | 2 +- tezt/tests/tx_rollup.ml | 2 +- tezt/tests/tx_rollup_l2_node.ml | 2 +- 10 files changed, 24 insertions(+), 15 deletions(-) diff --git a/tezt/lib_tezos/protocol.ml b/tezt/lib_tezos/protocol.ml index 26b16d99ba81..df8f70a64add 100644 --- a/tezt/lib_tezos/protocol.ml +++ b/tezt/lib_tezos/protocol.ml @@ -25,7 +25,7 @@ (*****************************************************************************) (* Declaration order must respect the version order. *) -type t = Kathmandu | Lima | Alpha +type t = Kathmandu | Lima | Mumbai | Alpha type constants = Constants_sandbox | Constants_mainnet | Constants_test @@ -33,13 +33,19 @@ let name = function | Alpha -> "Alpha" | Kathmandu -> "Kathmandu" | Lima -> "Lima" + | Mumbai -> "Mumbai" -let number = function Kathmandu -> 014 | Lima -> 015 | Alpha -> 016 +let number = function + | Kathmandu -> 014 + | Lima -> 015 + | Mumbai -> 016 + | Alpha -> 017 let directory = function | Alpha -> "proto_alpha" | Kathmandu -> "proto_014_PtKathma" | Lima -> "proto_015_PtLimaPt" + | Mumbai -> "proto_016_PtMumbai" (* Test tags must be lowercase. *) let tag protocol = String.lowercase_ascii (name protocol) @@ -48,6 +54,7 @@ let hash = function | Alpha -> "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" | Kathmandu -> "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg" | Lima -> "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW" + | Mumbai -> "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD" let genesis_hash = "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" @@ -163,14 +170,16 @@ let write_parameter_file : let next_protocol = function | Kathmandu -> Some Lima | Lima -> Some Alpha + | Mumbai -> Some Alpha | Alpha -> None let previous_protocol = function | Alpha -> Some Lima + | Mumbai -> Some Lima | Lima -> Some Kathmandu | Kathmandu -> None -let all = [Alpha; Kathmandu; Lima] +let all = [Alpha; Kathmandu; Lima; Mumbai] type supported_protocols = | Any_protocol diff --git a/tezt/lib_tezos/protocol.mli b/tezt/lib_tezos/protocol.mli index dbc0017027eb..aa5312053331 100644 --- a/tezt/lib_tezos/protocol.mli +++ b/tezt/lib_tezos/protocol.mli @@ -24,7 +24,7 @@ (*****************************************************************************) (** Protocols we may want to test with. *) -type t = Kathmandu | Lima | Alpha +type t = Kathmandu | Lima | Mumbai | Alpha (** Protocol parameters. diff --git a/tezt/tests/baker_test.ml b/tezt/tests/baker_test.ml index f360c8a0a14c..8799153fc41a 100644 --- a/tezt/tests/baker_test.ml +++ b/tezt/tests/baker_test.ml @@ -116,7 +116,7 @@ let baker_bls_test = let msg = match protocol with | Kathmandu | Lima -> rex "Invalid protocol_parameters" - | Alpha -> + | Mumbai | Alpha -> rex "The delegate tz4.*\\w is forbidden as it is a BLS public key hash" in Process.check_error activate_process ~exit_code:1 ~msg diff --git a/tezt/tests/client_commands.ml b/tezt/tests/client_commands.ml index fd4a8b610340..5e3d5a8d6cec 100644 --- a/tezt/tests/client_commands.ml +++ b/tezt/tests/client_commands.ml @@ -53,7 +53,7 @@ module Helpers = struct @@ RPC.get_chain_block_context_contract_balance ~id:pkh () let supported_signature_schemes = function - | Protocol.Alpha -> ["ed25519"; "secp256k1"; "p256"; "bls"] + | Protocol.Alpha | Mumbai -> ["ed25519"; "secp256k1"; "p256"; "bls"] | Lima | Kathmandu -> ["ed25519"; "secp256k1"; "p256"] let airdrop_and_reveal client accounts = @@ -464,7 +464,7 @@ module Transfer = struct let* () = match protocol with | Kathmandu | Lima -> unit - | Alpha -> + | Mumbai | Alpha -> let* () = Client.import_secret_key client Constant.tz4_account in airdrop_and_reveal client [Constant.tz4_account] in @@ -477,7 +477,7 @@ module Transfer = struct let msg = match protocol with | Kathmandu | Lima -> rex "Invalid contract notation \"tz4.*\"" - | Alpha -> + | Mumbai | Alpha -> rex "The delegate tz4.*\\w is forbidden as it is a BLS public key hash" in diff --git a/tezt/tests/manager_operations.ml b/tezt/tests/manager_operations.ml index 59609aa474f1..fb515c9836c9 100644 --- a/tezt/tests/manager_operations.ml +++ b/tezt/tests/manager_operations.ml @@ -866,7 +866,7 @@ module Deserialisation = struct (* Gas to execute call to noop contract without deserialization *) let gas_to_execute_rest_noop = function - | Protocol.Kathmandu | Lima | Alpha -> 2109 + | Protocol.Kathmandu | Lima | Mumbai | Alpha -> 2109 let inject_call_with_bytes ?(source = Constant.bootstrap5) ?protocol ~contract ~size_kB ~gas_limit client = diff --git a/tezt/tests/mockup.ml b/tezt/tests/mockup.ml index f60610f552b8..80773f69864a 100644 --- a/tezt/tests/mockup.ml +++ b/tezt/tests/mockup.ml @@ -1192,7 +1192,7 @@ let test_create_mockup_config_show_init_roundtrip protocols = (sf "./tezt/tests/mockup_protocol_constants/protocol_constants-%d.json" (Protocol.number protocol)) - | Lima | Alpha -> + | Lima | Mumbai | Alpha -> (* This function should work on all protocols since Lima. *) protocol_constants_fixture_rpc protocol in diff --git a/tezt/tests/prevalidator.ml b/tezt/tests/prevalidator.ml index 5f459646a720..3e71cb8554b4 100644 --- a/tezt/tests/prevalidator.ml +++ b/tezt/tests/prevalidator.ml @@ -42,7 +42,7 @@ "prevalidator" section regardless of the protocol version. *) let prevalidator_worker_event_section = function | Protocol.Kathmandu -> "legacy_prevalidator" - | Lima | Alpha -> "prevalidator" + | Lima | Mumbai | Alpha -> "prevalidator" (** The [event_sections_levels] argument that should be provided to {!Node.init} in order to observe all debug-level prevalidator @@ -52,7 +52,7 @@ let prevalidator_worker_event_section = function let prevalidator_debug = function | Protocol.Kathmandu -> [("prevalidator", `Debug); ("legacy_prevalidator", `Debug)] - | Lima | Alpha -> [("prevalidator", `Debug)] + | Lima | Mumbai | Alpha -> [("prevalidator", `Debug)] (* FIXME: https://gitlab.com/tezos/tezos/-/issues/1657 diff --git a/tezt/tests/run_script.ml b/tezt/tests/run_script.ml index 7f0a03711b7e..4b4939386d4c 100644 --- a/tezt/tests/run_script.ml +++ b/tezt/tests/run_script.ml @@ -164,7 +164,7 @@ let test_source_and_sender = let expected_source = match protocol with | Kathmandu -> Format.sprintf "%S" bootstrap1.public_key_hash - | Lima | Alpha -> "0x00000000000000000000000000000000000000000000" + | Lima | Mumbai | Alpha -> "0x00000000000000000000000000000000000000000000" in let* _storage = Client.run_script diff --git a/tezt/tests/tx_rollup.ml b/tezt/tests/tx_rollup.ml index 1825831b86c3..d4fa66508dcc 100644 --- a/tezt/tests/tx_rollup.ml +++ b/tezt/tests/tx_rollup.ml @@ -877,7 +877,7 @@ let test_submit_from_originated_source = in let msg = match protocol with - | Lima | Alpha -> rex "Erroneous command line argument" + | Lima | Mumbai | Alpha -> rex "Erroneous command line argument" | Kathmandu -> rex "Only implicit accounts can submit transaction rollup batches" in diff --git a/tezt/tests/tx_rollup_l2_node.ml b/tezt/tests/tx_rollup_l2_node.ml index 80b8ed10c56e..1ecbe0cc0636 100644 --- a/tezt/tests/tx_rollup_l2_node.ml +++ b/tezt/tests/tx_rollup_l2_node.ml @@ -2734,7 +2734,7 @@ let test_withdraw_command = let dest = match protocol with | Lima | Kathmandu -> Constant.bootstrap2.public_key_hash - | Alpha -> Constant.tz4_account.public_key_hash + | Mumbai | Alpha -> Constant.tz4_account.public_key_hash in inject_withdraw ~counter:2L -- GitLab From cfaf3dafc9328fa688af6f01ca4e5a2a9aaddc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Fri, 9 Dec 2022 15:52:23 +0000 Subject: [PATCH 07/18] Backport merge request 7095 --- .../bin_sc_rollup_node/dal_slots_tracker.ml | 22 ++----------------- .../bin_sc_rollup_node/dal_slots_tracker.mli | 2 -- .../lib_dal/dal_plugin_registration.ml | 21 ++++++++++-------- .../lib_layer2_utils/layer1_services.ml | 18 +++++++++++++++ .../lib_layer2_utils/layer1_services.mli | 2 ++ 5 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml index 1279f4e636e9..3a1af0ef8950 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.ml @@ -27,24 +27,6 @@ open Protocol open Alpha_context module Block_services = Block_services.Make (Protocol) (Protocol) -type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t - -let () = - register_error_kind - ~id:"sc_rollup.node.cannot_read_receipt_of_block" - ~title:"Cannot read receipt of block from L1" - ~description:"The receipt of a block could not be read." - ~pp:(fun ppf hash -> - Format.fprintf - ppf - "Could not read block receipt for block with hash %a." - Tezos_crypto.Block_hash.pp - hash) - `Temporary - Data_encoding.(obj1 (req "hash" Tezos_crypto.Block_hash.encoding)) - (function Cannot_read_block_metadata hash -> Some hash | _ -> None) - (fun hash -> Cannot_read_block_metadata hash) - let ancestor_hash ~number_of_levels {Node_context.genesis_info; l1_ctxt; _} head = let genesis_level = genesis_info.level in @@ -106,7 +88,7 @@ let slots_info node_ctxt (Layer1.{hash; _} as head) = in let*? metadata = Option.to_result - ~none:(TzTrace.make @@ Cannot_read_block_metadata hash) + ~none:(TzTrace.make @@ Layer1_services.Cannot_read_block_metadata hash) metadata in (* `metadata.protocol_data.dal_attestation` is `None` if we are behind @@ -139,7 +121,7 @@ let is_slot_confirmed node_ctxt (Layer1.{hash; _} as head) slot_index = let open Lwt_result_syntax in let* slots_info_opt = slots_info node_ctxt head in match slots_info_opt with - | None -> tzfail @@ Cannot_read_block_metadata hash + | None -> tzfail @@ Layer1_services.Cannot_read_block_metadata hash | Some {confirmed_slots_indexes; _} -> let*? is_confirmed = Environment.wrap_tzresult diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli index c5da7b2ebcb3..0e77b548a601 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/dal_slots_tracker.mli @@ -33,8 +33,6 @@ open Alpha_context The state of slots per block is persistent. *) -type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t - (** [is_slot_confirmed node_ctxt head slot_index] checks whether the slot with index [slot_index] has been confirmed in [head]. *) val is_slot_confirmed : diff --git a/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml index 7c3a450b8c9f..3308cda47b34 100644 --- a/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml +++ b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml @@ -26,29 +26,32 @@ module Plugin = struct module Proto = Registerer.Registered + type block_info = Protocol_client_context.Alpha_block_services.block_info + let get_constants chain block ctxt = let cpctxt = new Protocol_client_context.wrap_full ctxt in let open Lwt_result_syntax in let* constants = Protocol.Constants_services.all cpctxt (chain, block) in return constants.parametric.dal.cryptobox_parameters + let block_info ?chain ?block ~metadata ctxt = + let cpctxt = new Protocol_client_context.wrap_full ctxt in + Protocol_client_context.Alpha_block_services.info + cpctxt + ?chain + ?block + ~metadata + () + (* Turn the given value of type {!Protocol.Apply_operation_result.operation_result} into a value of type {!Dal_plugin.operation_application_result}. *) let status_of_result = function | Protocol.Apply_operation_result.Applied _ -> Dal_plugin.Succeeded | _ -> Dal_plugin.Failed - let get_published_slot_headers block ctxt = + let get_published_slot_headers (block : block_info) = let open Lwt_result_syntax in let open Protocol.Alpha_context in - let cpctxt = new Protocol_client_context.wrap_full ctxt in - let* block = - Protocol_client_context.Alpha_block_services.info - cpctxt - ~block - ~metadata:`Always - () - in let apply_internal acc ~source:_ _op _res = acc in let apply (type kind) acc ~source:_ (op : kind manager_operation) (result : (kind, _, _) Protocol.Apply_operation_result.operation_result) diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml index 22773e17db82..6c1cfa5ad007 100644 --- a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml +++ b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml @@ -28,6 +28,24 @@ open Alpha_context open Apply_results open Protocol_client_context.Alpha_block_services +type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t + +let () = + register_error_kind + ~id:"cannot_read_receipt_of_block" + ~title:"Cannot read receipt of block from L1" + ~description:"The receipt of a block could not be read." + ~pp:(fun ppf hash -> + Format.fprintf + ppf + "Could not read block receipt for block with hash %a." + Tezos_crypto.Block_hash.pp + hash) + `Temporary + Data_encoding.(obj1 (req "hash" Tezos_crypto.Block_hash.encoding)) + (function Cannot_read_block_metadata hash -> Some hash | _ -> None) + (fun hash -> Cannot_read_block_metadata hash) + type 'accu successful_operation_processor = { apply : 'kind. diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli index bbcf372491af..1255d70b764e 100644 --- a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli +++ b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.mli @@ -27,6 +27,8 @@ open Protocol open Alpha_context open Protocol_client_context.Alpha_block_services +type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t + type 'accu successful_operation_processor = { apply : 'kind. -- GitLab From 846ba68c04df6246daddd2db3a8d3bcad8219b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Fri, 9 Dec 2022 17:32:26 +0000 Subject: [PATCH 08/18] DAL: Decouple error registration --- src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml | 3 ++- src/proto_alpha/lib_layer2_utils/layer1_services.ml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml index 6c1cfa5ad007..7f8742082e1c 100644 --- a/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml +++ b/src/proto_016_PtMumbai/lib_layer2_utils/layer1_services.ml @@ -26,7 +26,8 @@ open Protocol open Alpha_context open Apply_results -open Protocol_client_context.Alpha_block_services +open Protocol_client_context +open Alpha_block_services type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t diff --git a/src/proto_alpha/lib_layer2_utils/layer1_services.ml b/src/proto_alpha/lib_layer2_utils/layer1_services.ml index 6c1cfa5ad007..7f8742082e1c 100644 --- a/src/proto_alpha/lib_layer2_utils/layer1_services.ml +++ b/src/proto_alpha/lib_layer2_utils/layer1_services.ml @@ -26,7 +26,8 @@ open Protocol open Alpha_context open Apply_results -open Protocol_client_context.Alpha_block_services +open Protocol_client_context +open Alpha_block_services type error += Cannot_read_block_metadata of Tezos_crypto.Block_hash.t -- GitLab From 42321119e6363f93e0872bea2bc652bdba274f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Tue, 13 Dec 2022 12:24:49 +0000 Subject: [PATCH 09/18] Backport merge request 7075 --- .../bin_sc_rollup_node/wasm_2_0_0_pvm.ml | 2 +- src/proto_016_PtMumbai/bin_wasm_repl/commands.ml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml b/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml index e4fca38ca161..7197297ae7b8 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml +++ b/src/proto_016_PtMumbai/bin_sc_rollup_node/wasm_2_0_0_pvm.ml @@ -88,7 +88,7 @@ module Impl : Pvm.S = struct module Backend = Make_backend (Wasm_2_0_0_proof_format.Tree) - let eval_many = Backend.compute_step_many + let eval_many = Backend.compute_step_many ~debug_flag:false end include Impl diff --git a/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml b/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml index 84b1b1f937e6..4691ff0aaac7 100644 --- a/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml +++ b/src/proto_016_PtMumbai/bin_wasm_repl/commands.ml @@ -80,7 +80,7 @@ let parse_commands s = let compute_step tree = let open Lwt_syntax in trap_exn (fun () -> - let+ tree = Wasm.compute_step tree in + let+ tree = Wasm.compute_step_with_debug ~debug_flag:true tree in (tree, 1L)) (** [eval_to_result tree] tries to evaluates the PVM until the next `SK_Result` @@ -118,6 +118,7 @@ let eval_to_result tree = in let* pvm_state, ticks = Tezos_scoru_wasm.Wasm_vm.compute_step_many_until + ~debug_flag:true ~max_steps:Int64.max_int should_compute pvm_state @@ -146,7 +147,12 @@ let eval_until_input_requested tree = let open Lwt_syntax in trap_exn (fun () -> let* info_before = Wasm.get_info tree in - let* tree = eval_until_input_requested ~max_steps:Int64.max_int tree in + let* tree = + eval_until_input_requested + ~debug_flag:true + ~max_steps:Int64.max_int + tree + in let+ info_after = Wasm.get_info tree in ( tree, Z.to_int64 @@ Z.sub info_after.current_tick info_before.current_tick )) -- GitLab From 8cbff48268104bf7558aaba7d220917d31e8bc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 14 Dec 2022 10:56:09 +0000 Subject: [PATCH 10/18] DAL: Backport plugin-related changes --- .../lib_dal/dal_plugin_registration.ml | 73 ++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml index 3308cda47b34..3b2282ee4fd7 100644 --- a/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml +++ b/src/proto_016_PtMumbai/lib_dal/dal_plugin_registration.ml @@ -23,16 +23,41 @@ (* *) (*****************************************************************************) +open Protocol +open Alpha_context + module Plugin = struct module Proto = Registerer.Registered type block_info = Protocol_client_context.Alpha_block_services.block_info - let get_constants chain block ctxt = + let parametric_constants chain block ctxt = let cpctxt = new Protocol_client_context.wrap_full ctxt in + Protocol.Constants_services.parametric cpctxt (chain, block) + + let get_constants chain block ctxt = let open Lwt_result_syntax in - let* constants = Protocol.Constants_services.all cpctxt (chain, block) in - return constants.parametric.dal.cryptobox_parameters + let* parametric = parametric_constants chain block ctxt in + let { + Constants.Parametric.feature_enable; + number_of_slots; + attestation_lag; + availability_threshold; + cryptobox_parameters; + } = + parametric.dal + in + return + { + Dal_plugin.feature_enable; + number_of_slots; + attestation_lag; + availability_threshold; + cryptobox_parameters; + blocks_per_epoch = + (* This is a protocol constant in future protocol. *) + 32l; + } let block_info ?chain ?block ~metadata ctxt = let cpctxt = new Protocol_client_context.wrap_full ctxt in @@ -75,6 +100,48 @@ module Plugin = struct }, status )) + let check_is_in_range slot_index = + let zero = Dal.Slot_index.(to_int zero) in + let max_value = 255 in + if Compare.Int.(slot_index >= zero && slot_index <= max_value) then + Result_syntax.return_unit + else Stdlib.failwith "Invalid_slot_index" + + let slots_range ~lower ~upper = + let open Result_syntax in + let* () = check_is_in_range lower in + let* () = check_is_in_range upper in + return Misc.(lower --> upper) + + let slot_headers_attestation hash (block : block_info) ~number_of_slots = + let open Lwt_result_syntax in + let*? metadata = + Option.to_result + block.metadata + ~none:(TzTrace.make @@ Layer1_services.Cannot_read_block_metadata hash) + in + let confirmed_slots = + Option.value + ~default:Dal.Attestation.empty + metadata.protocol_data.dal_attestation + in + let*? all_slots = + slots_range ~lower:0 ~upper:(number_of_slots - 1) + |> Environment.wrap_tzresult + in + let attested, unattested = + List.map + (fun i -> + match Dal.Slot_index.of_int i with + | None -> assert false + | Some i -> i) + all_slots + |> List.partition (Dal.Attestation.is_attested confirmed_slots) + in + return + ( `Attested (List.map Dal.Slot_index.to_int attested), + `Unattested (List.map Dal.Slot_index.to_int unattested) ) + module RPC = RPC end -- GitLab From e90dee14df6546631e0ef7daaf1a1c94cf15804c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 18:03:27 +0000 Subject: [PATCH 11/18] Test: add encoding samples for Mumbai and update regression tests --- .../block_header.raw.sample.json | 11 + .../block_header.unsigned.sample.json | 18 + .../block_header/block_header.sample.json | 19 + .../big_map_diff-alloc.sample.json | 10 + .../big_map_diff-copy.sample.json | 5 + .../big_map_diff-remove.sample.json | 4 + .../big_map_diff-update.sample.json | 11 + .../contract/contract-implicit.sample.json | 1 + .../contract/contract-originated.sample.json | 1 + .../mumbai/cycle/cycle-positive.sample.json | 1 + .../mumbai/cycle/cycle-zero.sample.json | 1 + .../mumbai/fitness/fitness.sample.json | 1 + .../gas.cost/gas.cost-positive.sample.json | 1 + .../mumbai/gas.cost/gas.cost-zero.sample.json | 1 + .../mumbai/gas/gas-positive.sample.json | 1 + .../mumbai/gas/gas-unaccounted.sample.json | 1 + .../mumbai/gas/gas-zero.sample.json | 1 + .../mumbai/level/level.sample.json | 7 + .../mumbai/nonce/nonce.sample.json | 1 + ...internal-delegation-withdrawal.sample.json | 5 + .../operation.internal-delegation.sample.json | 6 + ...operation.internal-origination.sample.json | 48 + ...ternal-transaction-to-implicit.sample.json | 7 + ...rnal-transaction-to-originated.sample.json | 13 + .../operation.raw/operation.raw.sample.json | 4 + ...tion.unsigned-activate-account.sample.json | 8 + .../operation.unsigned-ballot.sample.json | 10 + ...unsigned-delegation-withdrawal.sample.json | 11 + .../operation.unsigned-delegation.sample.json | 12 + ...nsigned-double-baking-evidence.sample.json | 44 + ...ed-double-endorsement-evidence.sample.json | 30 + ...operation.unsigned-endorsement.sample.json | 12 + ...operation.unsigned-origination.sample.json | 54 + .../operation.unsigned-proposals.sample.json | 11 + .../operation.unsigned-reveal.sample.json | 12 + ...unsigned-seed-nonce-revelation.sample.json | 8 + ...signed-transaction-to-implicit.sample.json | 13 + ...gned-transaction-to-originated.sample.json | 19 + .../operation-activate-account.sample.json | 9 + .../operation/operation-ballot.sample.json | 11 + ...peration-delegation-withdrawal.sample.json | 12 + .../operation-delegation.sample.json | 13 + ...eration-double-baking-evidence.sample.json | 37 + ...on-double-endorsement-evidence.sample.json | 31 + ...peration-endorsement-with-slot.sample.json | 13 + .../operation-endorsement.sample.json | 13 + .../operation-origination.sample.json | 55 + .../operation/operation-proposals.sample.json | 12 + .../operation/operation-reveal.sample.json | 13 + ...peration-seed-nonce-revelation.sample.json | 9 + ...ration-transaction-to-implicit.sample.json | 14 + ...tion-transaction-to-originated.sample.json | 20 + .../mumbai/period/period-positive.sample.json | 1 + .../mumbai/period/period-zero.sample.json | 1 + .../raw_level/raw_level-positive.sample.json | 1 + .../raw_level/raw_level-zero.sample.json | 1 + ...ance_updates-contract-implicit.sample.json | 6 + ...ce_updates-contract-originated.sample.json | 6 + ...lance_updates-freezer-deposits.sample.json | 7 + ...t.balance_updates-freezer-fees.sample.json | 8 + ...pdates-freezer-legacy_deposits.sample.json | 8 + ...updates-freezer-legacy_rewards.sample.json | 8 + ...alance_updates-freezer-rewards.sample.json | 7 + ...es-migration-contract-implicit.sample.json | 6 + ...-migration-contract-originated.sample.json | 6 + .../mumbai/roll/roll-positive.sample.json | 1 + .../mumbai/roll/roll-zero.sample.json | 1 + .../mumbai/seed/seed.sample.json | 1 + .../mumbai/tez/tez-positive.sample.json | 1 + .../mumbai/tez/tez-zero.sample.json | 1 + .../mumbai/timestamp/timestamp.sample.json | 1 + .../vote.ballot/vote.ballot-nay.sample.json | 1 + .../vote.ballot/vote.ballot-pass.sample.json | 1 + .../vote.ballot/vote.ballot-yay.sample.json | 1 + .../vote.ballots/vote.ballots.sample.json | 5 + .../vote.listings/vote.listings.sample.json | 9 + ...ing_period.kind-promotion-vote.sample.json | 1 + .../voting_period.kind-proposal.sample.json | 1 + ...oting_period.kind-testing-vote.sample.json | 1 + .../voting_period.kind-testing.sample.json | 1 + .../voting_period-positive.sample.json | 5 + .../voting_period-zero.sample.json | 5 + ...lient) RPC regression tests- contracts.out | 553 +++ ...lient) RPC regression tests- delegates.out | 95 + ... client) RPC regression tests- mempool.out | 246 + ...t) RPC regression tests- misc_protocol.out | 106 + ...de client) RPC regression tests- votes.out | 78 + ...light) RPC regression tests- contracts.out | 553 +++ ...light) RPC regression tests- delegates.out | 95 + ...t) RPC regression tests- misc_protocol.out | 106 + ...ode light) RPC regression tests- votes.out | 78 + ...proxy) RPC regression tests- contracts.out | 553 +++ ...proxy) RPC regression tests- delegates.out | 95 + ...e proxy) RPC regression tests- mempool.out | 246 + ...y) RPC regression tests- misc_protocol.out | 106 + ...ode proxy) RPC regression tests- votes.out | 78 + ...a_dir) RPC regression tests- contracts.out | 553 +++ ...a_dir) RPC regression tests- delegates.out | 95 + ...r) RPC regression tests- misc_protocol.out | 106 + ..._data_dir) RPC regression tests- votes.out | 78 + ...r_rpc) RPC regression tests- contracts.out | 553 +++ ...r_rpc) RPC regression tests- delegates.out | 95 + ...c) RPC regression tests- misc_protocol.out | 106 + ...erver_rpc) RPC regression tests- votes.out | 78 + ....tz--storage125992234--input254251340-.out | 38 + ....tz--storage125992234--input420401245-.out | 38 + ....tz--storage125992234--input680650890-.out | 38 + ....tz--storage125992234--input125992234-.out | 211 + ....tz--storage921624073--input322109491-.out | 30 + ....tz--storage921624073--input461261325-.out | 30 + ....tz--storage921624073--input530006774-.out | 30 + ....tz--storage921624073--input712570300-.out | 30 + ....tz--storage921624073--input249636002-.out | 36 + ....tz--storage921624073--input267363182-.out | 36 + ....tz--storage921624073--input438561129-.out | 36 + ....tz--storage921624073--input249636002-.out | 36 + ....tz--storage921624073--input307538219-.out | 36 + ....tz--storage921624073--input373737581-.out | 36 + ....tz--storage921624073--input117475800-.out | 23 + ....tz--storage921624073--input106930123-.out | 31 + ....tz--storage921624073--input181204719-.out | 31 + ....tz--storage921624073--input223774825-.out | 31 + ....tz--storage921624073--input908807505-.out | 31 + ....tz--storage125992234--input125992234-.out | 93 + ....tz--storage125992234--input125992234-.out | 75 + ....tz--storage570553153--input106930123-.out | 24 + ....tz--storage570553153--input181204719-.out | 24 + ....tz--storage570553153--input223774825-.out | 24 + ....tz--storage570553153--input908807505-.out | 24 + ....tz--storage492856247--input125992234-.out | 21 + ....tz--storage495706788--input453441034-.out | 42 + ...t.tz--storage56274299--input453441034-.out | 44 + ...t.tz--storage56274299--input564400327-.out | 44 + ...t.tz--storage56274299--input654274102-.out | 44 + ....tz--storage690637660--input453441034-.out | 43 + ....tz--storage806237530--input453441034-.out | 43 + ...tz--storage109689253--input1071610051-.out | 44 + ....tz--storage109689253--input700475845-.out | 44 + ....tz--storage109689253--input905318451-.out | 44 + ....tz--storage495706788--input700475845-.out | 42 + ....tz--storage915708427--input700475845-.out | 43 + ....tz--storage936682951--input905318451-.out | 43 + ...ot_padded.tz--storage921624073--input1.out | 24 + ....tz--storage921624073--input125992234-.out | 24 + ...tz--storage680650890--input1043734173-.out | 21 + ....tz--storage680650890--input151303925-.out | 21 + ....tz--storage680650890--input520610122-.out | 22 + ....tz--storage680650890--input558805129-.out | 22 + ....tz--storage680650890--input229402968-.out | 32 + ...tz--storage287336412--input1019409032-.out | 23 + ....tz--storage698210250--input949526473-.out | 23 + ....tz--storage739946440--input166435292-.out | 23 + ....tz--storage739946440--input583291483-.out | 23 + ...tz--storage994282947--input1055524890-.out | 23 + ....tz--storage994282947--input453441034-.out | 22 + ....tz--storage994282947--input564400327-.out | 22 + ....tz--storage994282947--input585234482-.out | 22 + ....tz--storage994282947--input680650890-.out | 22 + ....tz--storage994282947--input701858804-.out | 22 + ...tz--storage287336412--input1019409032-.out | 23 + ....tz--storage698210250--input949526473-.out | 23 + ....tz--storage739946440--input166435292-.out | 23 + ....tz--storage739946440--input583291483-.out | 23 + ...tz--storage994282947--input1055524890-.out | 23 + ....tz--storage994282947--input453441034-.out | 22 + ....tz--storage994282947--input564400327-.out | 22 + ....tz--storage994282947--input680650890-.out | 22 + ...tz--storage287336412--input1019409032-.out | 26 + ....tz--storage698210250--input949526473-.out | 26 + ....tz--storage739946440--input166435292-.out | 26 + ....tz--storage739946440--input583291483-.out | 26 + ...tz--storage994282947--input1055524890-.out | 26 + ....tz--storage994282947--input453441034-.out | 25 + ....tz--storage994282947--input564400327-.out | 25 + ....tz--storage994282947--input585234482-.out | 25 + ....tz--storage994282947--input680650890-.out | 25 + ....tz--storage994282947--input701858804-.out | 25 + ...tz--storage287336412--input1019409032-.out | 26 + ....tz--storage698210250--input949526473-.out | 26 + ....tz--storage739946440--input166435292-.out | 26 + ....tz--storage739946440--input583291483-.out | 26 + ...tz--storage994282947--input1055524890-.out | 26 + ....tz--storage994282947--input453441034-.out | 25 + ....tz--storage994282947--input564400327-.out | 25 + ....tz--storage994282947--input680650890-.out | 25 + ....tz--storage125992234--input125992234-.out | 261 + ....tz--storage125992234--input125992234-.out | 126 + ....tz--storage680650890--input783124233-.out | 21 + ....tz--storage680650890--input783124233-.out | 21 + ....tz--storage109160754--input125992234-.out | 23 + ....tz--storage921624073--input125992234-.out | 23 + ....tz--storage981066851--input125992234-.out | 23 + ....tz--storage125992234--input186507116-.out | 123 + ....tz--storage921624073--input186507116-.out | 36 + ....tz--storage186507116--input125992234-.out | 39 + ....tz--storage950292965--input125992234-.out | 30 + ....tz--storage125992234--input125992234-.out | 398 ++ ....tz--storage457300675--input281780712-.out | 350 ++ ....tz--storage457300675--input392583650-.out | 35 + ....tz--storage457300675--input457300675-.out | 21 + ....tz--storage457300675--input640104625-.out | 28 + ....tz--storage457300675--input354091714-.out | 35 + ....tz--storage457300675--input441061063-.out | 28 + ....tz--storage457300675--input457300675-.out | 21 + ...t.tz--storage79230375--input264787654-.out | 96 + ...t.tz--storage79230375--input316676251-.out | 119 + ...t.tz--storage79230375--input457300675-.out | 27 + ....tz--storage457300675--input798141440-.out | 22 + ....tz--storage581876226--input166122047-.out | 22 + ....tz--storage793461282--input781487591-.out | 22 + ....tz--storage921624073--input315650912-.out | 166 + ...l.tz--storage921624073--input51111414-.out | 410 ++ ....tz--storage921624073--input545734274-.out | 166 + ....tz--storage921624073--input772794967-.out | 63 + ....tz--storage921624073--input917967660-.out | 437 ++ ....tz--storage921624073--input964818218-.out | 166 + ....tz--storage125992234--input117475800-.out | 29 + ....tz--storage921624073--input125992234-.out | 49 + ...tz--storage492856247--input1011138251-.out | 34 + ...tz--storage492856247--input1018564342-.out | 34 + ...tz--storage492856247--input1031049988-.out | 34 + ....tz--storage492856247--input685590443-.out | 34 + ....tz--storage125992234--input246866101-.out | 3431 +++++++++++++ ...q.tz--storage125992234--input26856104-.out | 3431 +++++++++++++ ....tz--storage680650890--input529388602-.out | 61 + ...tz--storage1011138251--input590117173-.out | 36 + ...tz--storage1011138251--input850887554-.out | 36 + ....tz--storage680650890--input529388602-.out | 93 + ....tz--storage680650890--input529388602-.out | 39 + ....tz--storage680650890--input529388602-.out | 57 + ....tz--storage125992234--input125992234-.out | 248 + ....tz--storage994417987--input247451205-.out | 142 + ....tz--storage994417987--input250545589-.out | 142 + ...v.tz--storage994417987--input79625541-.out | 142 + ....tz--storage977883604--input147133089-.out | 37 + ....tz--storage977883604--input215785357-.out | 37 + ....tz--storage977883604--input389351431-.out | 37 + ...z.tz--storage977883604--input44513000-.out | 37 + ....tz--storage977883604--input635398196-.out | 37 + ....tz--storage977883604--input734264738-.out | 37 + ....tz--storage977883604--input993071382-.out | 37 + ....tz--storage125992234--input125992234-.out | 72 + ....tz--storage457300675--input125992234-.out | 33 + ....tz--storage398998998--input246262487-.out | 48 + ...t.tz--storage398998998--input79230375-.out | 48 + ....tz--storage492856247--input478406404-.out | 30 + ....tz--storage492856247--input962874972-.out | 30 + ...tz--storage1026405794--input329240220-.out | 34 + ....tz--storage382368661--input329240220-.out | 34 + ....tz--storage496578814--input329240220-.out | 34 + ....tz--storage496578814--input507231566-.out | 34 + ....tz--storage547821324--input329240220-.out | 34 + ....tz--storage796012494--input156280093-.out | 34 + ....tz--storage796012494--input228164856-.out | 34 + ....tz--storage139236239--input329240220-.out | 41 + ...e.tz--storage139236239--input79230375-.out | 41 + ....tz--storage329396864--input156280093-.out | 41 + ...tz--storage921624073--input1040351577-.out | 23 + ....tz--storage921624073--input153350004-.out | 23 + ...ng.tz--storage151303925--input3431716-.out | 23 + ....tz--storage151303925--input535018041-.out | 23 + ....tz--storage921624073--input570553153-.out | 27 + ....tz--storage921624073--input954397288-.out | 27 + ....tz--storage398998998--input288201633-.out | 23 + ....tz--storage398998998--input921624073-.out | 25 + ....tz--storage921624073--input453441034-.out | 23 + ....tz--storage921624073--input535454136-.out | 23 + ....tz--storage921624073--input680650890-.out | 23 + ...tz--storage921624073--input1008262038-.out | 24 + ...ht.tz--storage4177631--input202098045-.out | 25 + ...ght.tz--storage4177631--input44576556-.out | 25 + ....tz--storage492856247--input125992234-.out | 21 + ....tz--storage717096222--input457300675-.out | 27 + ....tz--storage717096222--input546523343-.out | 27 + ....tz--storage149262694--input220724351-.out | 27 + ....tz--storage149262694--input457300675-.out | 27 + ...s.tz--storage65410082--input457300675-.out | 27 + ....tz--storage726220441--input972761363-.out | 27 + ....tz--storage528921618--input264787654-.out | 19 + ....tz--storage528921618--input457300675-.out | 19 + ....tz--storage528921618--input656499821-.out | 19 + ....tz--storage528921618--input264787654-.out | 27 + ....tz--storage528921618--input457300675-.out | 21 + ....tz--storage528921618--input656499821-.out | 27 + ....tz--storage680650890--input568817463-.out | 42 + ....tz--storage680650890--input737923774-.out | 42 + ....tz--storage907453363--input457300675-.out | 36 + ....tz--storage907453363--input648737279-.out | 136 + ....tz--storage907453363--input908379154-.out | 136 + ....tz--storage492856247--input403499055-.out | 21 + ....tz--storage492856247--input457300675-.out | 21 + ....tz--storage492856247--input469078912-.out | 21 + ....tz--storage492856247--input802622031-.out | 21 + ....tz--storage528921618--input457300675-.out | 52 + ....tz--storage528921618--input851203613-.out | 163 + ....tz--storage125992234--input125992234-.out | 93 + ....tz--storage125992234--input125992234-.out | 129 + ...tz--storage457300675--input1027566226-.out | 19 + ....tz--storage457300675--input276660554-.out | 19 + ....tz--storage457300675--input599923743-.out | 19 + ...tz--storage1011138251--input403579222-.out | 152 + ...tz--storage1011138251--input532072758-.out | 152 + ....tz--storage457300675--input798141440-.out | 32 + ....tz--storage794999348--input152441147-.out | 68 + ...p.tz--storage88008216--input798141440-.out | 50 + ....tz--storage495706788--input453441034-.out | 42 + ...t.tz--storage56274299--input453441034-.out | 42 + ...t.tz--storage56274299--input564400327-.out | 42 + ...t.tz--storage56274299--input654274102-.out | 42 + ....tz--storage690637660--input453441034-.out | 42 + ....tz--storage806237530--input453441034-.out | 42 + ...tz--storage109689253--input1071610051-.out | 42 + ....tz--storage109689253--input700475845-.out | 42 + ....tz--storage109689253--input905318451-.out | 42 + ....tz--storage495706788--input700475845-.out | 42 + ....tz--storage915708427--input700475845-.out | 42 + ....tz--storage936682951--input905318451-.out | 42 + ...e.tz--storage492856247--input15265129-.out | 21 + ....tz--storage492856247--input158311065-.out | 21 + ....tz--storage492856247--input456982702-.out | 21 + ....tz--storage492856247--input457300675-.out | 21 + ....tz--storage125992234--input125992234-.out | 131 + ....tz--storage151303925--input216277421-.out | 38 + ....tz--storage287799761--input485842614-.out | 38 + ...tz--storage680650890--input1067298059-.out | 25 + ....tz--storage680650890--input380029349-.out | 25 + ....tz--storage680650890--input563503226-.out | 25 + ....tz--storage680650890--input788662499-.out | 25 + ....tz--storage680650890--input972832189-.out | 25 + ...e.tz--storage11179311--input125992234-.out | 21 + ....tz--storage921624073--input570553153-.out | 23 + ....tz--storage921624073--input954397288-.out | 23 + ...tz--storage921624073--input1051197453-.out | 27 + ....tz--storage921624073--input123939249-.out | 27 + ...y.tz--storage921624073--input24243730-.out | 27 + ....tz--storage921624073--input518945720-.out | 27 + ....tz--storage921624073--input788662499-.out | 27 + ....tz--storage921624073--input906118781-.out | 27 + ....tz--storage921624073--input921874253-.out | 27 + ....tz--storage921624073--input972832189-.out | 27 + ....tz--storage125992234--input125992234-.out | 66 + ....tz--storage921624073--input106930123-.out | 35 + ....tz--storage921624073--input181204719-.out | 35 + ....tz--storage921624073--input223774825-.out | 35 + ....tz--storage921624073--input908807505-.out | 35 + ...tz--storage921624073--input1056991424-.out | 26 + ....tz--storage921624073--input375993021-.out | 26 + ....tz--storage921624073--input673240563-.out | 26 + ....tz--storage921624073--input747448890-.out | 26 + ....tz--storage921624073--input832403787-.out | 26 + ....tz--storage921624073--input858098961-.out | 26 + ....tz--storage125992234--input125992234-.out | 75 + ....tz--storage125992234--input305844558-.out | 845 ++++ ....tz--storage125992234--input646365167-.out | 845 ++++ ...tz--storage125992234--input1028781121-.out | 1194 +++++ ....tz--storage125992234--input802670583-.out | 1032 ++++ ....tz--storage921624073--input106930123-.out | 21 + ....tz--storage921624073--input181204719-.out | 21 + ....tz--storage921624073--input223774825-.out | 21 + ....tz--storage921624073--input908807505-.out | 21 + ...tz--storage256947135--input1050356042-.out | 47 + ....tz--storage197120858--input179371027-.out | 282 ++ ....tz--storage921624073--input125992234-.out | 23 + ....tz--storage528921618--input457300675-.out | 27 + ....tz--storage528921618--input851203613-.out | 42 + ....tz--storage528921618--input457300675-.out | 50 + ....tz--storage528921618--input851203613-.out | 131 + ....tz--storage457300675--input125992234-.out | 21 + ....tz--storage125992234--input125992234-.out | 46 + ...int.tz--storage125992234--input1259922.out | 47 + ....tz--storage125992234--input289072903-.out | 93 + ....tz--storage224747103--input620760059-.out | 49 + ....tz--storage224747103--input717096222-.out | 49 + ...r.tz--storage224747103--input79230375-.out | 49 + ....tz--storage205576101--input654274102-.out | 46 + ....tz--storage224747103--input453441034-.out | 46 + ....tz--storage611418174--input967284912-.out | 46 + ....tz--storage457300675--input264787654-.out | 19 + ....tz--storage457300675--input457300675-.out | 19 + ....tz--storage457300675--input989507347-.out | 19 + ....tz--storage492856247--input457300675-.out | 27 + ....tz--storage492856247--input701684511-.out | 47 + ....tz--storage492856247--input802622031-.out | 32 + ...r.tz--storage495706788--input33757838-.out | 61 + ...r.tz--storage550087893--input79230375-.out | 61 + ...r.tz--storage605111220--input33757838-.out | 61 + ....tz--storage492856247--input403499055-.out | 21 + ....tz--storage492856247--input457300675-.out | 21 + ....tz--storage492856247--input469078912-.out | 21 + ....tz--storage492856247--input802622031-.out | 21 + ...tz--storage921624073--input1008262038-.out | 24 + ....tz--storage921624073--input115382786-.out | 30 + ....tz--storage921624073--input271566295-.out | 30 + ....tz--storage921624073--input340971987-.out | 30 + ....tz--storage921624073--input374168553-.out | 30 + ....tz--storage921624073--input413621582-.out | 30 + ....tz--storage921624073--input424849461-.out | 30 + ....tz--storage921624073--input485030042-.out | 30 + ....tz--storage921624073--input705767726-.out | 30 + ....tz--storage921624073--input769385932-.out | 30 + ....tz--storage921624073--input913715337-.out | 30 + ...e.tz--storage351480851--input65907686-.out | 38 + ....tz--storage364922380--input198821575-.out | 37 + ....tz--storage364922380--input359592843-.out | 37 + ....tz--storage364922380--input551316239-.out | 37 + ....tz--storage364922380--input722749044-.out | 37 + ....tz--storage364922380--input839234860-.out | 37 + ....tz--storage364922380--input919180079-.out | 37 + ....tz--storage921624073--input551316239-.out | 31 + ....tz--storage229749865--input198821575-.out | 37 + ....tz--storage229749865--input462551352-.out | 37 + ....tz--storage229749865--input489157380-.out | 37 + ....tz--storage229749865--input551316239-.out | 37 + ....tz--storage229749865--input669330759-.out | 37 + ....tz--storage229749865--input743596105-.out | 37 + ....tz--storage229749865--input839234860-.out | 37 + ...s.tz--storage504917929--input65907686-.out | 38 + ....tz--storage921624073--input462551352-.out | 31 + ...tz--storage921624073--input1016369050-.out | 21 + ...d.tz--storage921624073--input93477117-.out | 21 + ....tz--storage492856247--input249636002-.out | 34 + ....tz--storage492856247--input307538219-.out | 34 + ....tz--storage492856247--input831449542-.out | 34 + ....tz--storage921624073--input706350605-.out | 71 + ....tz--storage921624073--input856198194-.out | 71 + ....tz--storage680650890--input394061083-.out | 50 + ....tz--storage125992234--input125992234-.out | 462 ++ ...z--storage1011138251--input1040351577-.out | 32 + ...tz--storage921624073--input1058477720-.out | 32 + ...tz--storage921624073--input1073176155-.out | 32 + ....tz--storage921624073--input246594902-.out | 32 + ....tz--storage921624073--input506603577-.out | 32 + ....tz--storage921624073--input576248088-.out | 32 + ....tz--storage921624073--input612012282-.out | 32 + ....tz--storage921624073--input617591686-.out | 32 + ....tz--storage921624073--input639311176-.out | 32 + ....tz--storage921624073--input688315180-.out | 32 + ....tz--storage921624073--input967929605-.out | 32 + ....tz--storage125992234--input125992234-.out | 75 + ...python-contracts_016-attic-accounts.tz.out | 215 + ...sts_python-contracts_016-attic-add1.tz.out | 16 + ...ython-contracts_016-attic-add1_list.tz.out | 14 + ...-contracts_016-attic-after_strategy.tz.out | 25 + ...s_python-contracts_016-attic-always.tz.out | 18 + ...s_python-contracts_016-attic-append.tz.out | 22 + ...python-contracts_016-attic-at_least.tz.out | 18 + ..._python-contracts_016-attic-auction.tz.out | 66 + ...thon-contracts_016-attic-bad_lockup.tz.out | 59 + ...n-contracts_016-attic-big_map_union.tz.out | 34 + ...contracts_016-attic-cadr_annotation.tz.out | 17 + ...s_python-contracts_016-attic-concat.tz.out | 27 + ...on-contracts_016-attic-conditionals.tz.out | 20 + ...thon-contracts_016-attic-cons_twice.tz.out | 22 + ...python-contracts_016-attic-cps_fact.tz.out | 66 + ...ntracts_016-attic-create_add1_lists.tz.out | 29 + ...-contracts_016-attic-data_publisher.tz.out | 73 + ...python-contracts_016-attic-dispatch.tz.out | 55 + ...ts_python-contracts_016-attic-empty.tz.out | 12 + ...hon-contracts_016-attic-fail_amount.tz.out | 20 + ...s_python-contracts_016-attic-faucet.tz.out | 35 + ..._python-contracts_016-attic-forward.tz.out | 1775 +++++++ ...tests_python-contracts_016-attic-id.tz.out | 12 + ...n-contracts_016-attic-infinite_loop.tz.out | 18 + ...-contracts_016-attic-insertion_sort.tz.out | 63 + ...n-contracts_016-attic-int_publisher.tz.out | 87 + ...hon-contracts_016-attic-king_of_tez.tz.out | 70 + ...acts_016-attic-list_of_transactions.tz.out | 42 + ...ts_python-contracts_016-attic-queue.tz.out | 106 + ...thon-contracts_016-attic-reduce_map.tz.out | 56 + ...thon-contracts_016-attic-reentrancy.tz.out | 43 + ...ython-contracts_016-attic-reservoir.tz.out | 78 + ...racts_016-attic-scrutable_reservoir.tz.out | 247 + ...ontracts_016-attic-spawn_identities.tz.out | 61 + ...016-entrypoints-big_map_entrypoints.tz.out | 120 + ..._016-entrypoints-delegatable_target.tz.out | 119 + ...n-contracts_016-entrypoints-manager.tz.out | 35 + ...s_016-entrypoints-no_default_target.tz.out | 29 + ...16-entrypoints-no_entrypoint_target.tz.out | 29 + ...racts_016-entrypoints-rooted_target.tz.out | 29 + ..._016-entrypoints-simple_entrypoints.tz.out | 12 + ..._python-contracts_016-macros-assert.tz.out | 15 + ...n-contracts_016-macros-assert_cmpeq.tz.out | 21 + ...n-contracts_016-macros-assert_cmpge.tz.out | 21 + ...n-contracts_016-macros-assert_cmpgt.tz.out | 21 + ...n-contracts_016-macros-assert_cmple.tz.out | 21 + ...n-contracts_016-macros-assert_cmplt.tz.out | 21 + ...-contracts_016-macros-assert_cmpneq.tz.out | 21 + ...thon-contracts_016-macros-assert_eq.tz.out | 23 + ...thon-contracts_016-macros-assert_ge.tz.out | 23 + ...thon-contracts_016-macros-assert_gt.tz.out | 23 + ...thon-contracts_016-macros-assert_le.tz.out | 23 + ...thon-contracts_016-macros-assert_lt.tz.out | 23 + ...hon-contracts_016-macros-assert_neq.tz.out | 23 + ...ontracts_016-macros-big_map_get_add.tz.out | 55 + ...on-contracts_016-macros-big_map_mem.tz.out | 31 + ...hon-contracts_016-macros-build_list.tz.out | 45 + ...-contracts_016-macros-carn_and_cdrn.tz.out | 47 + ...python-contracts_016-macros-compare.tz.out | 92 + ...-contracts_016-macros-compare_bytes.tz.out | 92 + ...ts_python-contracts_016-macros-fail.tz.out | 5 + ...thon-contracts_016-macros-guestbook.tz.out | 33 + ...tracts_016-macros-macro_annotations.tz.out | 24 + ...n-contracts_016-macros-map_caddaadr.tz.out | 18 + ...on-contracts_016-macros-max_in_list.tz.out | 29 + ...sts_python-contracts_016-macros-min.tz.out | 22 + ...hon-contracts_016-macros-pair_macro.tz.out | 26 + ...n-contracts_016-macros-set_caddaadr.tz.out | 20 + ...-contracts_016-macros-take_my_money.tz.out | 26 + ...n-contracts_016-macros-unpair_macro.tz.out | 32 + ...16-mini_scenarios-add_clear_tickets.tz.out | 34 + ...s_016-mini_scenarios-authentication.tz.out | 44 + ...-mini_scenarios-big_map_entrypoints.tz.out | 120 + ...ts_016-mini_scenarios-big_map_magic.tz.out | 103 + ...cts_016-mini_scenarios-big_map_read.tz.out | 17 + ...ts_016-mini_scenarios-big_map_store.tz.out | 14 + ...ts_016-mini_scenarios-big_map_write.tz.out | 20 + ..._016-mini_scenarios-create_contract.tz.out | 74 + ...ni_scenarios-create_contract_simple.tz.out | 27 + ..._016-mini_scenarios-default_account.tz.out | 26 + ..._scenarios-execution_order_appender.tz.out | 29 + ...ni_scenarios-execution_order_caller.tz.out | 22 + ...ni_scenarios-execution_order_storer.tz.out | 16 + ...s_016-mini_scenarios-fa12_reference.tz.out | 2707 +++++++++++ ...016-mini_scenarios-generic_multisig.tz.out | 245 + ...ontracts_016-mini_scenarios-groth16.tz.out | 194 + ...tracts_016-mini_scenarios-hardlimit.tz.out | 18 + ..._016-mini_scenarios-legacy_multisig.tz.out | 254 + ...contracts_016-mini_scenarios-lockup.tz.out | 42 + ...s_016-mini_scenarios-lqt_fa12.mligo.tz.out | 1385 ++++++ ...cts_016-mini_scenarios-multiple_en2.tz.out | 165 + ..._scenarios-multiple_entrypoints_counte.out | 148 + ...6-mini_scenarios-originate_contract.tz.out | 28 + ...ni_scenarios-parameterized_multisig.tz.out | 166 + ..._scenarios-receive_tickets_in_big_map..out | 12 + ...contracts_016-mini_scenarios-replay.tz.out | 29 + ...ni_scenarios-reveal_signed_preimage.tz.out | 63 + ...ini_scenarios-self_address_receiver.tz.out | 19 + ...-mini_scenarios-self_address_sender.tz.out | 23 + ...i_scenarios-send_tickets_in_big_map.tz.out | 133 + ...i_scenarios-ticket_builder_fungible.tz.out | 58 + ..._scenarios-ticket_builder_non_fungible.out | 56 + ...ni_scenarios-ticket_wallet_fungible.tz.out | 194 + ..._scenarios-ticket_wallet_non_fungible..out | 116 + ...16-mini_scenarios-vote_for_delegate.tz.out | 114 + ...16-mini_scenarios-weather_insurance.tz.out | 87 + ...n-contracts_016-mini_scenarios-xcat.tz.out | 83 + ...tracts_016-mini_scenarios-xcat_dapp.tz.out | 308 ++ ...6-non_regression-bad_annot_contract.tz.out | 14 + ...ontracts_016-non_regression-bug_262.tz.out | 18 + ...ontracts_016-non_regression-bug_843.tz.out | 14 + ...acts_016-non_regression-pairk_annot.tz.out | 28 + ...ts_python-contracts_016-opcodes-abs.tz.out | 23 + ...ts_python-contracts_016-opcodes-add.tz.out | 84 + ...tracts_016-opcodes-add_bls12_381_fr.tz.out | 18 + ...tracts_016-opcodes-add_bls12_381_g1.tz.out | 18 + ...tracts_016-opcodes-add_bls12_381_g2.tz.out | 18 + ...cts_016-opcodes-add_delta_timestamp.tz.out | 22 + ...cts_016-opcodes-add_timestamp_delta.tz.out | 22 + ...ython-contracts_016-opcodes-address.tz.out | 16 + ...s_016-opcodes-amount_after_fib_view.tz.out | 38 + ...codes-amount_after_nonexistent_view.tz.out | 36 + ...racts_016-opcodes-amount_after_view.tz.out | 38 + ...ts_python-contracts_016-opcodes-and.tz.out | 22 + ...on-contracts_016-opcodes-and_binary.tz.out | 50 + ...hon-contracts_016-opcodes-and_bytes.tz.out | 41 + ...contracts_016-opcodes-and_logical_1.tz.out | 16 + ...ython-contracts_016-opcodes-balance.tz.out | 14 + ..._016-opcodes-balance_after_fib_view.tz.out | 38 + ...odes-balance_after_nonexistent_view.tz.out | 36 + ...acts_016-opcodes-balance_after_view.tz.out | 38 + ...ntracts_016-opcodes-big_map_mem_nat.tz.out | 22 + ...acts_016-opcodes-big_map_mem_string.tz.out | 25 + ...ntracts_016-opcodes-big_map_to_self.tz.out | 56 + ...des-bls12_381_fr_push_bytes_not_padded.out | 16 + ...s_016-opcodes-bls12_381_fr_push_nat.tz.out | 16 + ...cts_016-opcodes-bls12_381_fr_to_int.tz.out | 14 + ...s_016-opcodes-bls12_381_fr_to_mutez.tz.out | 21 + ...acts_016-opcodes-bls12_381_fr_z_int.tz.out | 14 + ...acts_016-opcodes-bls12_381_fr_z_nat.tz.out | 14 + ...acts_016-opcodes-bls12_381_z_fr_int.tz.out | 16 + ...acts_016-opcodes-bls12_381_z_fr_nat.tz.out | 16 + ..._python-contracts_016-opcodes-bytes.tz.out | 12 + ...-contracts_016-opcodes-bytes_of_int.tz.out | 126 + ...-contracts_016-opcodes-bytes_of_nat.tz.out | 63 + ...ts_python-contracts_016-opcodes-car.tz.out | 14 + ...ts_python-contracts_016-opcodes-cdr.tz.out | 14 + ...thon-contracts_016-opcodes-chain_id.tz.out | 16 + ...ontracts_016-opcodes-chain_id_store.tz.out | 16 + ...ntracts_016-opcodes-check_signature.tz.out | 34 + ...thon-contracts_016-opcodes-comb-get.tz.out | 51 + ...contracts_016-opcodes-comb-literals.tz.out | 17 + ...on-contracts_016-opcodes-comb-set-2.tz.out | 26 + ...thon-contracts_016-opcodes-comb-set.tz.out | 28 + ...s_python-contracts_016-opcodes-comb.tz.out | 18 + ...ython-contracts_016-opcodes-compare.tz.out | 217 + ...tracts_016-opcodes-compare_big_type.tz.out | 3737 ++++++++++++++ ...racts_016-opcodes-compare_big_type2.tz.out | 4302 +++++++++++++++++ ...n-contracts_016-opcodes-comparisons.tz.out | 65 + ...-contracts_016-opcodes-concat_hello.tz.out | 14 + ...acts_016-opcodes-concat_hello_bytes.tz.out | 14 + ...n-contracts_016-opcodes-concat_list.tz.out | 30 + ...s_python-contracts_016-opcodes-cons.tz.out | 14 + ...-contracts_016-opcodes-contains_all.tz.out | 75 + ...thon-contracts_016-opcodes-contract.tz.out | 19 + ...ntracts_016-opcodes-create_contract.tz.out | 27 + ...16-opcodes-create_contract_rootname.tz.out | 29 + ...pcodes-create_contract_rootname_alt.tz.out | 29 + ...6-opcodes-create_contract_with_view.tz.out | 30 + ...ntracts_016-opcodes-diff_timestamps.tz.out | 20 + ...python-contracts_016-opcodes-dig_eq.tz.out | 157 + ...s_python-contracts_016-opcodes-dign.tz.out | 24 + ...ts_python-contracts_016-opcodes-dip.tz.out | 20 + ...s_python-contracts_016-opcodes-dipn.tz.out | 32 + ..._python-contracts_016-opcodes-dropn.tz.out | 22 + ...s_python-contracts_016-opcodes-dugn.tz.out | 30 + ..._python-contracts_016-opcodes-dup-n.tz.out | 51 + ...s_python-contracts_016-opcodes-ediv.tz.out | 67 + ...on-contracts_016-opcodes-ediv_mutez.tz.out | 30 + ...s_python-contracts_016-opcodes-emit.tz.out | 34 + ...hon-contracts_016-opcodes-empty_map.tz.out | 22 + ...n-contracts_016-opcodes-exec_concat.tz.out | 34 + ..._python-contracts_016-opcodes-first.tz.out | 13 + ..._016-opcodes-get_and_update_big_map.tz.out | 15 + ...acts_016-opcodes-get_and_update_map.tz.out | 15 + ...racts_016-opcodes-get_big_map_value.tz.out | 23 + ...contracts_016-opcodes-get_map_value.tz.out | 21 + ...16-opcodes-hash_consistency_checker.tz.out | 16 + ...thon-contracts_016-opcodes-hash_key.tz.out | 16 + ...n-contracts_016-opcodes-hash_string.tz.out | 16 + ...sts_python-contracts_016-opcodes-if.tz.out | 15 + ...ython-contracts_016-opcodes-if_some.tz.out | 13 + ...ts_python-contracts_016-opcodes-int.tz.out | 16 + ...hon-contracts_016-opcodes-iter_fail.tz.out | 14 + ...python-contracts_016-opcodes-keccak.tz.out | 16 + ...on-contracts_016-opcodes-left_right.tz.out | 15 + ..._python-contracts_016-opcodes-level.tz.out | 14 + ...n-contracts_016-opcodes-list_concat.tz.out | 18 + ...racts_016-opcodes-list_concat_bytes.tz.out | 18 + ...ython-contracts_016-opcodes-list_id.tz.out | 12 + ...n-contracts_016-opcodes-list_id_map.tz.out | 14 + ...hon-contracts_016-opcodes-list_iter.tz.out | 18 + ...ontracts_016-opcodes-list_map_block.tz.out | 25 + ...hon-contracts_016-opcodes-list_size.tz.out | 14 + ...contracts_016-opcodes-loop_failwith.tz.out | 14 + ...hon-contracts_016-opcodes-loop_left.tz.out | 40 + ...acts_016-opcodes-loop_left_failwith.tz.out | 14 + ...hon-contracts_016-opcodes-lsl_bytes.tz.out | 50 + ...hon-contracts_016-opcodes-lsr_bytes.tz.out | 68 + ...ython-contracts_016-opcodes-map_car.tz.out | 19 + ...python-contracts_016-opcodes-map_id.tz.out | 12 + ...thon-contracts_016-opcodes-map_iter.tz.out | 38 + ...ython-contracts_016-opcodes-map_map.tz.out | 23 + ...acts_016-opcodes-map_map_sideeffect.tz.out | 35 + ...n-contracts_016-opcodes-map_mem_nat.tz.out | 22 + ...ontracts_016-opcodes-map_mem_string.tz.out | 22 + ...thon-contracts_016-opcodes-map_size.tz.out | 14 + ..._016-opcodes-merge_comparable_pairs.tz.out | 27 + ...ts_python-contracts_016-opcodes-mul.tz.out | 82 + ...tracts_016-opcodes-mul_bls12_381_fr.tz.out | 18 + ...tracts_016-opcodes-mul_bls12_381_g1.tz.out | 18 + ...tracts_016-opcodes-mul_bls12_381_g2.tz.out | 18 + ...-contracts_016-opcodes-mul_overflow.tz.out | 29 + ..._python-contracts_016-opcodes-munch.tz.out | 13 + ...s_016-opcodes-mutez_to_bls12_381_fr.tz.out | 25 + ...ts_python-contracts_016-opcodes-neg.tz.out | 13 + ...tracts_016-opcodes-neg_bls12_381_fr.tz.out | 16 + ...tracts_016-opcodes-neg_bls12_381_g1.tz.out | 16 + ...tracts_016-opcodes-neg_bls12_381_g2.tz.out | 16 + ...s_python-contracts_016-opcodes-none.tz.out | 14 + ...s_python-contracts_016-opcodes-noop.tz.out | 12 + ...ts_python-contracts_016-opcodes-not.tz.out | 16 + ...on-contracts_016-opcodes-not_binary.tz.out | 15 + ...hon-contracts_016-opcodes-not_bytes.tz.out | 35 + ...sts_python-contracts_016-opcodes-or.tz.out | 24 + ...hon-contracts_016-opcodes-or_binary.tz.out | 18 + ...thon-contracts_016-opcodes-or_bytes.tz.out | 41 + ...racts_016-opcodes-originate_big_map.tz.out | 12 + ...on-contracts_016-opcodes-packunpack.tz.out | 27 + ...ontracts_016-opcodes-packunpack_rev.tz.out | 162 + ...acts_016-opcodes-packunpack_rev_cty.tz.out | 611 +++ ...ython-contracts_016-opcodes-pair_id.tz.out | 14 + ...contracts_016-opcodes-pairing_check.tz.out | 16 + ..._python-contracts_016-opcodes-pexec.tz.out | 23 + ...ython-contracts_016-opcodes-pexec_2.tz.out | 41 + ..._python-contracts_016-opcodes-proxy.tz.out | 20 + ...ython-contracts_016-opcodes-ret_int.tz.out | 16 + ...ython-contracts_016-opcodes-reverse.tz.out | 18 + ...-contracts_016-opcodes-reverse_loop.tz.out | 32 + ...cts_016-opcodes-sapling_empty_state.tz.out | 14 + ...s_python-contracts_016-opcodes-self.tz.out | 16 + ...-contracts_016-opcodes-self_address.tz.out | 28 + ...opcodes-self_address_after_fib_view.tz.out | 38 + ...des-self_address_after_nonexistent_vie.out | 36 + ...016-opcodes-self_address_after_view.tz.out | 38 + ...cts_016-opcodes-self_after_fib_view.tz.out | 40 + ...opcodes-self_after_nonexistent_view.tz.out | 38 + ...ntracts_016-opcodes-self_after_view.tz.out | 40 + ...pcodes-self_with_default_entrypoint.tz.out | 31 + ...ts_016-opcodes-self_with_entrypoint.tz.out | 68 + ...python-contracts_016-opcodes-sender.tz.out | 14 + ...s_016-opcodes-sender_after_fib_view.tz.out | 38 + ...codes-sender_after_nonexistent_view.tz.out | 36 + ...racts_016-opcodes-sender_after_view.tz.out | 38 + ...ython-contracts_016-opcodes-set_car.tz.out | 17 + ...ython-contracts_016-opcodes-set_cdr.tz.out | 17 + ...-contracts_016-opcodes-set_delegate.tz.out | 16 + ...python-contracts_016-opcodes-set_id.tz.out | 12 + ...thon-contracts_016-opcodes-set_iter.tz.out | 18 + ...on-contracts_016-opcodes-set_member.tz.out | 32 + ...thon-contracts_016-opcodes-set_size.tz.out | 14 + ...s_python-contracts_016-opcodes-sets.tz.out | 68 + ...s_python-contracts_016-opcodes-sha3.tz.out | 16 + ...python-contracts_016-opcodes-shifts.tz.out | 17 + ..._python-contracts_016-opcodes-slice.tz.out | 22 + ...n-contracts_016-opcodes-slice_bytes.tz.out | 22 + ...python-contracts_016-opcodes-slices.tz.out | 116 + ...python-contracts_016-opcodes-source.tz.out | 14 + ...n-contracts_016-opcodes-split_bytes.tz.out | 71 + ...-contracts_016-opcodes-split_string.tz.out | 71 + ...acts_016-opcodes-store_bls12_381_fr.tz.out | 14 + ...acts_016-opcodes-store_bls12_381_g1.tz.out | 14 + ...acts_016-opcodes-store_bls12_381_g2.tz.out | 14 + ...n-contracts_016-opcodes-store_input.tz.out | 12 + ...hon-contracts_016-opcodes-store_now.tz.out | 14 + ...python-contracts_016-opcodes-str_id.tz.out | 14 + ...cts_016-opcodes-sub_timestamp_delta.tz.out | 20 + ...python-contracts_016-opcodes-subset.tz.out | 45 + ...n-contracts_016-opcodes-tez_add_sub.tz.out | 36 + ...on-contracts_016-opcodes-ticket_bad.tz.out | 12 + ...tracts_016-opcodes-ticket_big_store.tz.out | 25 + ...n-contracts_016-opcodes-ticket_join.tz.out | 23 + ...n-contracts_016-opcodes-ticket_read.tz.out | 24 + ...-contracts_016-opcodes-ticket_split.tz.out | 39 + ...ontracts_016-opcodes-ticket_store-2.tz.out | 12 + ...-contracts_016-opcodes-ticket_store.tz.out | 14 + ...on-contracts_016-opcodes-ticketer-2.tz.out | 35 + ...thon-contracts_016-opcodes-ticketer.tz.out | 35 + ...ntracts_016-opcodes-transfer_amount.tz.out | 14 + ...ntracts_016-opcodes-transfer_tokens.tz.out | 24 + ...python-contracts_016-opcodes-uncomb.tz.out | 28 + ...python-contracts_016-opcodes-unpair.tz.out | 322 ++ ...des-unpair_field_annotation_mismatch.t.out | 28 + ...ontracts_016-opcodes-update_big_map.tz.out | 18 + ...hon-contracts_016-opcodes-utxo_read.tz.out | 26 + ..._python-contracts_016-opcodes-utxor.tz.out | 93 + ...thon-contracts_016-opcodes-view_fib.tz.out | 18 + ...s_016-opcodes-view_mutual_recursion.tz.out | 22 + ...n-contracts_016-opcodes-view_op_add.tz.out | 17 + ...tracts_016-opcodes-view_op_constant.tz.out | 17 + ...on-contracts_016-opcodes-view_op_id.tz.out | 17 + ...16-opcodes-view_op_nonexistent_addr.tz.out | 21 + ...16-opcodes-view_op_nonexistent_func.tz.out | 19 + ...-opcodes-view_op_test_step_contants.tz.out | 18 + ...des-view_op_toplevel_inconsistent_inpu.out | 17 + ...des-view_op_toplevel_inconsistent_outp.out | 19 + ...thon-contracts_016-opcodes-view_rec.tz.out | 33 + ...racts_016-opcodes-view_toplevel_lib.tz.out | 143 + ...-contracts_016-opcodes-voting_power.tz.out | 20 + ...ts_python-contracts_016-opcodes-xor.tz.out | 17 + ...hon-contracts_016-opcodes-xor_bytes.tz.out | 41 + .../Mumbai- Create contract.out | 109 + .../Mumbai- set deposits limit.out | 26 + .../Mumbai- unset deposits limit.out | 26 + ...encoding regression test- block_header.out | 35 + ...ding regression test- block_header.raw.out | 26 + ...regression test- block_header.unsigned.out | 32 + ...col encoding regression test- contract.out | 12 + ...otocol encoding regression test- cycle.out | 12 + ...ocol encoding regression test- fitness.out | 11 + ...col encoding regression test- gas.cost.out | 12 + ...protocol encoding regression test- gas.out | 18 + ...otocol encoding regression test- level.out | 13 + ...otocol encoding regression test- nonce.out | 6 + ...ng regression test- operation.internal.out | 140 + ...ol encoding regression test- operation.out | 531 ++ ...ncoding regression test- operation.raw.out | 11 + ...ng regression test- operation.unsigned.out | 468 ++ ...tocol encoding regression test- period.out | 12 + ...ol encoding regression test- raw_level.out | 12 + ...rotocol encoding regression test- seed.out | 6 + ...protocol encoding regression test- tez.out | 12 + ...ol encoding regression test- timestamp.out | 6 + ... encoding regression test- vote.ballot.out | 18 + ...encoding regression test- vote.ballots.out | 10 + ...ncoding regression test- vote.listings.out | 16 + ...ng regression test- voting_period.kind.out | 24 + ...ncoding regression test- voting_period.out | 20 + ...mbai- Test normalize in unparsing mode.out | 14 + .../Mumbai- Test normalize script.out | 42 + .../Mumbai- Test normalize type.out | 24 + ...umbai- Test normalize with legacy flag.out | 10 + .../Mumbai- Test script hash regression.out | 399 ++ .../Mumbai- Self address transfer.out | 141 + .../Mumbai- Create and remove tickets.out | 220 + ...art-contract rollup should succeed wit.out | 55 + ...rom implicit accounts must be rejected.out | 210 + ...inated contracts and implicit accounts.out | 387 ++ ... implicit accounts with some Tez along.out | 115 + ...licit accounts with the wrong type mus.out | 195 + ...ts from contracts to implicit accounts.out | 111 + .../Mumbai- Send tickets in bigmap.out | 296 ++ ... contract storage to implicit accounts.out | 294 ++ ...rom implicit accounts must be rejected.out | 129 + ...art-contract rollup should succeed wit.out | 111 + ... accounts or originated contracts acce.out | 197 + ...rom implicit accounts must be rejected.out | 174 + ...PC (tx_rollup- regression) - rejection.out | 132 + ...i- RPC (tx_rollup- regression) - state.out | 39 + ..._rollups- regression) - batch encoding.out | 59 + ...llups- regression) - commitment remove.out | 235 + ... (tx_rollups- regression) - commitment.out | 117 + ...- regression) - inbox merkle tree hash.out | 22 + ...- regression) - inbox merkle tree path.out | 67 + ...lups- regression) - inbox message hash.out | 7 + ...- RPC (tx_rollups- regression) - inbox.out | 62 + ...gression) - pending bonded commitments.out | 99 + ... an invalid rollup address should fail.out | 36 + ...eration for a commitment in the future.out | 76 + ...ize commitment operation without batch.out | 48 + ...ommitment operation without commitment.out | 76 + .../Mumbai- Submit empty batch.out | 58 + .../Mumbai- Submit maximum size batch.out | 66 + .../Mumbai- Submit maximum size inbox.out | 4259 ++++++++++++++++ ...ry to finalize a too recent commitment.out | 111 + 824 files changed, 69192 insertions(+) create mode 100644 tezt/tests/encoding_samples/mumbai/block_header.raw/block_header.raw.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/block_header.unsigned/block_header.unsigned.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/block_header/block_header.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-alloc.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-copy.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-remove.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-update.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract/contract-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/contract/contract-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/cycle/cycle-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/cycle/cycle-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/fitness/fitness.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/gas/gas-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/gas/gas-unaccounted.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/gas/gas-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/level/level.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/nonce/nonce.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation-withdrawal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-origination.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.raw/operation.raw.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-activate-account.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-ballot.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation-withdrawal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-endorsement-evidence.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-endorsement.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-origination.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-proposals.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-reveal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-seed-nonce-revelation.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-activate-account.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-ballot.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-delegation-withdrawal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-delegation.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-double-baking-evidence.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-double-endorsement-evidence.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-endorsement-with-slot.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-endorsement.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-origination.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-proposals.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-reveal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-seed-nonce-revelation.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/period/period-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/period/period-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/raw_level/raw_level-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/raw_level/raw_level-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-deposits.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-fees.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_deposits.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_rewards.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-rewards.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-implicit.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-originated.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/roll/roll-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/roll/roll-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/seed/seed.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/tez/tez-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/tez/tez-zero.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/timestamp/timestamp.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-nay.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-pass.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-yay.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/vote.ballots/vote.ballots.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/vote.listings/vote.listings.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-promotion-vote.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-proposal.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing-vote.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period/voting_period-positive.sample.json create mode 100644 tezt/tests/encoding_samples/mumbai/voting_period/voting_period-zero.sample.json create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- contracts.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- delegates.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- mempool.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- misc_protocol.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- votes.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- contracts.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- delegates.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- misc_protocol.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- votes.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- contracts.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- delegates.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- mempool.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- misc_protocol.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- votes.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- contracts.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- delegates.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- votes.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- contracts.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- delegates.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out create mode 100644 tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- votes.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input254251340-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input420401245-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input322109491-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input461261325-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input530006774-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input712570300-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input249636002-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input267363182-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input438561129-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input249636002-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input307538219-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input373737581-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -address.tz--storage921624073--input117475800-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input106930123-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input181204719-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input223774825-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input908807505-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_binary.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input106930123-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input181204719-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input223774825-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input908807505-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -balance.tz--storage492856247--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage495706788--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input654274102-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage690637660--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage806237530--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input1071610051-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input905318451-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage495706788--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage915708427--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage936682951--input905318451-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_bytes_not_padded.tz--storage921624073--input1.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_nat.tz--storage921624073--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input1043734173-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input151303925-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input520610122-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input558805129-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_mutez.tz--storage680650890--input229402968-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage287336412--input1019409032-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage698210250--input949526473-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input166435292-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input583291483-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input1055524890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input585234482-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input701858804-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage287336412--input1019409032-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage698210250--input949526473-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input166435292-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input583291483-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input1055524890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage287336412--input1019409032-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage698210250--input949526473-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input166435292-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input583291483-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input1055524890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input585234482-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input701858804-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage287336412--input1019409032-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage698210250--input949526473-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input166435292-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input583291483-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input1055524890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_int.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_nat.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -car.tz--storage680650890--input783124233-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cdr.tz--storage680650890--input783124233-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage109160754--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage921624073--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage981066851--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-get.tz--storage125992234--input186507116-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set-2.tz--storage921624073--input186507116-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set.tz--storage186507116--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb.tz--storage950292965--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -compare.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comparisons.tz--storage457300675--input281780712-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input392583650-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input640104625-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input354091714-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input441061063-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input264787654-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input316676251-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage457300675--input798141440-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage581876226--input166122047-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage793461282--input781487591-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input315650912-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input51111414-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input545734274-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input772794967-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input917967660-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input964818218-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contract.tz--storage125992234--input117475800-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -create_contract.tz--storage921624073--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1011138251-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1018564342-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1031049988-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input685590443-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input246866101-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input26856104-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dign.tz--storage680650890--input529388602-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input590117173-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input850887554-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dipn.tz--storage680650890--input529388602-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dropn.tz--storage680650890--input529388602-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dugn.tz--storage680650890--input529388602-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dup-n.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input247451205-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input250545589-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input79625541-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input147133089-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input215785357-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input389351431-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input44513000-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input635398196-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input734264738-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input993071382-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -emit.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -empty_map.tz--storage457300675--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input246262487-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input79230375-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input478406404-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input962874972-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage1026405794--input329240220-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage382368661--input329240220-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input329240220-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input507231566-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage547821324--input329240220-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input156280093-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input228164856-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input329240220-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input79230375-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage329396864--input156280093-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input1040351577-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input153350004-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input3431716-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input535018041-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input570553153-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input954397288-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input288201633-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input921624073-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input535454136-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input680650890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -keccak.tz--storage921624073--input1008262038-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input202098045-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input44576556-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -level.tz--storage492856247--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input546523343-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input220724351-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage65410082--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage726220441--input972761363-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input264787654-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input656499821-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input264787654-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input656499821-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input568817463-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input737923774-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input648737279-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input908379154-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input403499055-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input469078912-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input802622031-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input851203613-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsl_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsr_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input1027566226-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input276660554-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input599923743-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input403579222-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input532072758-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage457300675--input798141440-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage794999348--input152441147-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage88008216--input798141440-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage495706788--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input564400327-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input654274102-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage690637660--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage806237530--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input1071610051-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input905318451-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage495706788--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage915708427--input700475845-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage936682951--input905318451-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input15265129-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input158311065-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input456982702-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mul.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage151303925--input216277421-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage287799761--input485842614-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input1067298059-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input380029349-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input563503226-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input788662499-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input972832189-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -none.tz--storage11179311--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input570553153-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input954397288-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input1051197453-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input123939249-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input24243730-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input518945720-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input788662499-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input906118781-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input921874253-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input972832189-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input106930123-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input181204719-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input223774825-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input908807505-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input1056991424-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input375993021-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input673240563-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input747448890-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input832403787-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input858098961-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input305844558-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input646365167-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input1028781121-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input802670583-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input106930123-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input181204719-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input223774825-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input908807505-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec.tz--storage256947135--input1050356042-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec_2.tz--storage197120858--input179371027-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ret_int.tz--storage921624073--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input851203613-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input851203613-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sapling_empty_state.tz--storage457300675--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_address.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_default_entrypoint.tz--storage125992234--input1259922.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_entrypoint.tz--storage125992234--input289072903-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input620760059-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input717096222-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input79230375-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage205576101--input654274102-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage224747103--input453441034-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage611418174--input967284912-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input264787654-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input989507347-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input701684511-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input802622031-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage495706788--input33757838-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage550087893--input79230375-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage605111220--input33757838-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input403499055-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input457300675-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input469078912-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input802622031-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sha3.tz--storage921624073--input1008262038-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input115382786-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input271566295-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input340971987-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input374168553-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input413621582-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input424849461-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input485030042-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input705767726-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input769385932-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input913715337-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage351480851--input65907686-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input198821575-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input359592843-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input551316239-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input722749044-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input839234860-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input919180079-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage921624073--input551316239-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input198821575-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input462551352-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input489157380-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input551316239-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input669330759-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input743596105-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input839234860-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage504917929--input65907686-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage921624073--input462551352-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input1016369050-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input93477117-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input249636002-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input307538219-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input831449542-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input706350605-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input856198194-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -uncomb.tz--storage680650890--input394061083-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -unpair.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -voting_power.tz--storage1011138251--input1040351577-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1058477720-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1073176155-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input246594902-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input506603577-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input576248088-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input612012282-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input617591686-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input639311176-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input688315180-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input967929605-.out create mode 100644 tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor_bytes.tz--storage125992234--input125992234-.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-accounts.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1_list.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-after_strategy.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-always.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-append.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-at_least.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-auction.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-bad_lockup.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-big_map_union.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cadr_annotation.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-concat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-conditionals.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cons_twice.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cps_fact.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-create_add1_lists.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-data_publisher.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-dispatch.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-empty.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-fail_amount.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-faucet.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-forward.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-infinite_loop.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-insertion_sort.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-int_publisher.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-king_of_tez.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-list_of_transactions.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-queue.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reduce_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reentrancy.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reservoir.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-scrutable_reservoir.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-spawn_identities.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-big_map_entrypoints.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-delegatable_target.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-manager.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_default_target.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_entrypoint_target.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-rooted_target.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-simple_entrypoints.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpeq.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpge.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpgt.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmple.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmplt.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpneq.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_eq.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_ge.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_gt.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_le.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_lt.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_neq.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_get_add.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_mem.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-build_list.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-carn_and_cdrn.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-fail.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-guestbook.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-macro_annotations.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-map_caddaadr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-max_in_list.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-min.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-pair_macro.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-set_caddaadr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-take_my_money.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-unpair_macro.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-add_clear_tickets.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-authentication.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_entrypoints.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_magic.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_read.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_store.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_write.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract_simple.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-default_account.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_appender.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_caller.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_storer.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-fa12_reference.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-generic_multisig.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-groth16.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-hardlimit.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-legacy_multisig.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lockup.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lqt_fa12.mligo.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_en2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_entrypoints_counte.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-originate_contract.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-parameterized_multisig.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-receive_tickets_in_big_map..out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-replay.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-reveal_signed_preimage.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_receiver.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_sender.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-send_tickets_in_big_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_fungible.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_non_fungible.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_fungible.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_non_fungible..out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-vote_for_delegate.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-weather_insurance.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat_dapp.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bad_annot_contract.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_262.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_843.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-pairk_annot.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-abs.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_fr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_delta_timestamp.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_timestamp_delta.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-address.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_fib_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_nonexistent_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_binary.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_logical_1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_fib_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_nonexistent_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_string.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_to_self.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_bytes_not_padded.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_mutez.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-car.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cdr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id_store.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-check_signature.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-get.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-literals.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set-2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comparisons.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_list.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cons.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contains_all.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contract.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname_alt.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_with_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-diff_timestamps.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dig_eq.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dign.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dip.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dipn.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dropn.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dugn.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dup-n.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv_mutez.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-emit.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-empty_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-exec_concat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-first.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_big_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_big_map_value.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_map_value.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_consistency_checker.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_key.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_string.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if_some.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-iter_fail.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-keccak.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-left_right.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-level.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_iter.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_map_block.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_size.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_failwith.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left_failwith.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsl_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsr_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_car.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_iter.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map_sideeffect.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_nat.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_string.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_size.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-merge_comparable_pairs.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_fr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_overflow.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-munch.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mutez_to_bls12_381_fr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_fr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-none.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-noop.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_binary.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_binary.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-originate_big_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev_cty.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pair_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pairing_check.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec_2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-proxy.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ret_int.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse_loop.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sapling_empty_state.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_fib_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_nonexistent_vie.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_fib_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_nonexistent_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_default_entrypoint.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_entrypoint.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_fib_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_nonexistent_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_view.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_car.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_cdr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_delegate.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_iter.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_member.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_size.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sets.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sha3.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-shifts.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slices.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-source.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_bytes.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_string.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_fr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g1.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_input.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_now.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-str_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sub_timestamp_delta.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-subset.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-tez_add_sub.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_bad.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_big_store.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_join.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_read.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_split.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store-2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer-2.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_amount.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_tokens.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-uncomb.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair_field_annotation_mismatch.t.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-update_big_map.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxo_read.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxor.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_fib.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_mutual_recursion.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_add.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_constant.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_id.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_addr.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_func.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_test_step_contants.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_inpu.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_outp.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_rec.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_toplevel_lib.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-voting_power.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor.tz.out create mode 100644 tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor_bytes.tz.out create mode 100644 tezt/tests/expected/create_contract.ml/Mumbai- Create contract.out create mode 100644 tezt/tests/expected/deposits_limit.ml/Mumbai- set deposits limit.out create mode 100644 tezt/tests/expected/deposits_limit.ml/Mumbai- unset deposits limit.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.raw.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.unsigned.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- contract.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- cycle.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- fitness.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.cost.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- level.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- nonce.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.internal.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.raw.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.unsigned.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- period.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- raw_level.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- seed.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- tez.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- timestamp.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballot.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballots.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.listings.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.kind.out create mode 100644 tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.out create mode 100644 tezt/tests/expected/normalize.ml/Mumbai- Test normalize in unparsing mode.out create mode 100644 tezt/tests/expected/normalize.ml/Mumbai- Test normalize script.out create mode 100644 tezt/tests/expected/normalize.ml/Mumbai- Test normalize type.out create mode 100644 tezt/tests/expected/normalize.ml/Mumbai- Test normalize with legacy flag.out create mode 100644 tezt/tests/expected/script_hash_regression.ml/Mumbai- Test script hash regression.out create mode 100644 tezt/tests/expected/self_address_transfer.ml/Mumbai- Self address transfer.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Create and remove tickets.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Minting then sending tickets to smart-contract rollup should succeed wit.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Overdrafting ticket from implicit accounts must be rejected.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Send tickets between originated contracts and implicit accounts.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with some Tez along.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with the wrong type mus.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Send tickets in bigmap.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Sending ticket from contract storage to implicit accounts.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Sending ticket of wrong type from implicit accounts must be rejected.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Sending tickets from storage to smart-contract rollup should succeed wit.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Sending tickets to either implicit accounts or originated contracts acce.out create mode 100644 tezt/tests/expected/tickets.ml/Mumbai- Sending zero ticket from implicit accounts must be rejected.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out create mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out diff --git a/tezt/tests/encoding_samples/mumbai/block_header.raw/block_header.raw.sample.json b/tezt/tests/encoding_samples/mumbai/block_header.raw/block_header.raw.sample.json new file mode 100644 index 000000000000..221910309fe0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/block_header.raw/block_header.raw.sample.json @@ -0,0 +1,11 @@ +{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": ["01", "000000000000000a"], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "protocol_data": "521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" +} diff --git a/tezt/tests/encoding_samples/mumbai/block_header.unsigned/block_header.unsigned.sample.json b/tezt/tests/encoding_samples/mumbai/block_header.unsigned/block_header.unsigned.sample.json new file mode 100644 index 000000000000..51a6450fc42a --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/block_header.unsigned/block_header.unsigned.sample.json @@ -0,0 +1,18 @@ +{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 +} diff --git a/tezt/tests/encoding_samples/mumbai/block_header/block_header.sample.json b/tezt/tests/encoding_samples/mumbai/block_header/block_header.sample.json new file mode 100644 index 000000000000..af21dd2f4598 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/block_header/block_header.sample.json @@ -0,0 +1,19 @@ +{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 +} diff --git a/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-alloc.sample.json b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-alloc.sample.json new file mode 100644 index 000000000000..b114496b7578 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-alloc.sample.json @@ -0,0 +1,10 @@ +[{ + "action": "alloc", + "big_map": "0", + "key_type": [{ + "prim": "nat" + }], + "value_type": [{ + "prim": "unit" + }] +}] diff --git a/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-copy.sample.json b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-copy.sample.json new file mode 100644 index 000000000000..5f43f0cecfc5 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-copy.sample.json @@ -0,0 +1,5 @@ +[{ + "action": "copy", + "source_big_map": "0", + "destination_big_map": "1" +}] diff --git a/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-remove.sample.json b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-remove.sample.json new file mode 100644 index 000000000000..f654587236f4 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-remove.sample.json @@ -0,0 +1,4 @@ +[{ + "action": "remove", + "big_map": "0" +}] diff --git a/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-update.sample.json b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-update.sample.json new file mode 100644 index 000000000000..1b129b22c4e5 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract.big_map_diff/big_map_diff-update.sample.json @@ -0,0 +1,11 @@ +[{ + "action": "update", + "big_map": "0", + "key_hash": "exprv6UsC1sN3Fk2XfgcJCL8NCerP5rCGy1PRESZAqr7L2JdzX55EN", + "key": [{ + "int": "1" + }], + "value": [{ + "prim": "UNIT" + }] +}] diff --git a/tezt/tests/encoding_samples/mumbai/contract/contract-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/contract/contract-implicit.sample.json new file mode 100644 index 000000000000..27b113be04b2 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract/contract-implicit.sample.json @@ -0,0 +1 @@ +"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" diff --git a/tezt/tests/encoding_samples/mumbai/contract/contract-originated.sample.json b/tezt/tests/encoding_samples/mumbai/contract/contract-originated.sample.json new file mode 100644 index 000000000000..72ab1777f3a7 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/contract/contract-originated.sample.json @@ -0,0 +1 @@ +"KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat" diff --git a/tezt/tests/encoding_samples/mumbai/cycle/cycle-positive.sample.json b/tezt/tests/encoding_samples/mumbai/cycle/cycle-positive.sample.json new file mode 100644 index 000000000000..a51fa7d1efef --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/cycle/cycle-positive.sample.json @@ -0,0 +1 @@ +2147483647 diff --git a/tezt/tests/encoding_samples/mumbai/cycle/cycle-zero.sample.json b/tezt/tests/encoding_samples/mumbai/cycle/cycle-zero.sample.json new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/cycle/cycle-zero.sample.json @@ -0,0 +1 @@ +0 diff --git a/tezt/tests/encoding_samples/mumbai/fitness/fitness.sample.json b/tezt/tests/encoding_samples/mumbai/fitness/fitness.sample.json new file mode 100644 index 000000000000..56ae2f8d6f07 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/fitness/fitness.sample.json @@ -0,0 +1 @@ +{"level": 1, "locked_round": 1, "predecessor_round": 1, "round": 2} diff --git a/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-positive.sample.json b/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-positive.sample.json new file mode 100644 index 000000000000..0e55e062cab5 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-positive.sample.json @@ -0,0 +1 @@ +"8920392083423078" diff --git a/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-zero.sample.json b/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-zero.sample.json new file mode 100644 index 000000000000..9bc20d262a9e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/gas.cost/gas.cost-zero.sample.json @@ -0,0 +1 @@ +"0" diff --git a/tezt/tests/encoding_samples/mumbai/gas/gas-positive.sample.json b/tezt/tests/encoding_samples/mumbai/gas/gas-positive.sample.json new file mode 100644 index 000000000000..94715b79899c --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/gas/gas-positive.sample.json @@ -0,0 +1 @@ +"1238" diff --git a/tezt/tests/encoding_samples/mumbai/gas/gas-unaccounted.sample.json b/tezt/tests/encoding_samples/mumbai/gas/gas-unaccounted.sample.json new file mode 100644 index 000000000000..839f1ecf5a57 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/gas/gas-unaccounted.sample.json @@ -0,0 +1 @@ +"unaccounted" diff --git a/tezt/tests/encoding_samples/mumbai/gas/gas-zero.sample.json b/tezt/tests/encoding_samples/mumbai/gas/gas-zero.sample.json new file mode 100644 index 000000000000..9bc20d262a9e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/gas/gas-zero.sample.json @@ -0,0 +1 @@ +"0" diff --git a/tezt/tests/encoding_samples/mumbai/level/level.sample.json b/tezt/tests/encoding_samples/mumbai/level/level.sample.json new file mode 100644 index 000000000000..9a8e74b082e7 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/level/level.sample.json @@ -0,0 +1,7 @@ +{ + "level": 1331, + "level_position": 2147483647, + "cycle": 300, + "cycle_position": 600, + "expected_commitment": true +} diff --git a/tezt/tests/encoding_samples/mumbai/nonce/nonce.sample.json b/tezt/tests/encoding_samples/mumbai/nonce/nonce.sample.json new file mode 100644 index 000000000000..ca23c3b6a461 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/nonce/nonce.sample.json @@ -0,0 +1 @@ +"0000000000000000000000000000000000000000000000000000000000000000" diff --git a/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation-withdrawal.sample.json b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation-withdrawal.sample.json new file mode 100644 index 000000000000..e26fb0179e4e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation-withdrawal.sample.json @@ -0,0 +1,5 @@ +{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "delegation" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation.sample.json b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation.sample.json new file mode 100644 index 000000000000..4bc7ec935564 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-delegation.sample.json @@ -0,0 +1,6 @@ +{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "delegation", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-origination.sample.json b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-origination.sample.json new file mode 100644 index 000000000000..b176be7dba11 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-origination.sample.json @@ -0,0 +1,48 @@ +{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "origination", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [{ + "prim": "parameter", + "args": [{ + "prim": "string" + }] + }, + { + "prim": "storage", + "args": [{ + "prim": "option", + "args": [{ + "prim": "string" + }] + }] + }, + { + "prim": "code", + "args": [ + [{ + "prim": "CAR" + }, { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [{ + "prim": "operation" + }] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [{ + "string": "test" + }] + } +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-implicit.sample.json new file mode 100644 index 000000000000..d1dc4108ad5d --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-implicit.sample.json @@ -0,0 +1,7 @@ +{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 3, + "kind": "transaction", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-originated.sample.json b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-originated.sample.json new file mode 100644 index 000000000000..e43cfd06b7bb --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.internal/operation.internal-transaction-to-originated.sample.json @@ -0,0 +1,13 @@ +{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "transaction", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [{ + "prim": "UNIT" + }] + } +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.raw/operation.raw.sample.json b/tezt/tests/encoding_samples/mumbai/operation.raw/operation.raw.sample.json new file mode 100644 index 000000000000..9f8e4f094af1 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.raw/operation.raw.sample.json @@ -0,0 +1,4 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "data": "000000053366804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-activate-account.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-activate-account.sample.json new file mode 100644 index 000000000000..6e0f40dd83fc --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-activate-account.sample.json @@ -0,0 +1,8 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-ballot.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-ballot.sample.json new file mode 100644 index 000000000000..c272cedc4f20 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-ballot.sample.json @@ -0,0 +1,10 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "ballot", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation-withdrawal.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation-withdrawal.sample.json new file mode 100644 index 000000000000..5e3eaa739a99 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation-withdrawal.sample.json @@ -0,0 +1,11 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation.sample.json new file mode 100644 index 000000000000..401bed1ed6a2 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-delegation.sample.json @@ -0,0 +1,12 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json new file mode 100644 index 000000000000..8eed2982138e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json @@ -0,0 +1,44 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_baking_evidence", + "bh1": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 + }, + "bh2": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 + } + } + ] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-endorsement-evidence.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-endorsement-evidence.sample.json new file mode 100644 index 000000000000..284e5fe6bef2 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-double-endorsement-evidence.sample.json @@ -0,0 +1,30 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_endorsement_evidence", + "op1": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + }, + "op2": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + } + } + ] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-endorsement.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-endorsement.sample.json new file mode 100644 index 000000000000..ffee281b959d --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-endorsement.sample.json @@ -0,0 +1,12 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-origination.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-origination.sample.json new file mode 100644 index 000000000000..e3937027e89c --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-origination.sample.json @@ -0,0 +1,54 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [{ + "prim": "parameter", + "args": [{ + "prim": "string" + }] + }, + { + "prim": "storage", + "args": [{ + "prim": "option", + "args": [{ + "prim": "string" + }] + }] + }, + { + "prim": "code", + "args": [ + [{ + "prim": "CAR" + }, { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [{ + "prim": "operation" + }] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [{ + "string": "test" + }] + } + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-proposals.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-proposals.sample.json new file mode 100644 index 000000000000..ee628b836024 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-proposals.sample.json @@ -0,0 +1,11 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposals": ["PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" + ] + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-reveal.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-reveal.sample.json new file mode 100644 index 000000000000..b2bd1b78e79f --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-reveal.sample.json @@ -0,0 +1,12 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "reveal", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-seed-nonce-revelation.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-seed-nonce-revelation.sample.json new file mode 100644 index 000000000000..3f5b02050587 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-seed-nonce-revelation.sample.json @@ -0,0 +1,8 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "seed_nonce_revelation", + "level": 1331, + "nonce": "0000000000000000000000000000000000000000000000000000000000000000" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-implicit.sample.json new file mode 100644 index 000000000000..6a22e4a8afa3 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-implicit.sample.json @@ -0,0 +1,13 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-originated.sample.json b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-originated.sample.json new file mode 100644 index 000000000000..d376b224eb7a --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation.unsigned/operation.unsigned-transaction-to-originated.sample.json @@ -0,0 +1,19 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [{ + "prim": "UNIT" + }] + } + }] +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-activate-account.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-activate-account.sample.json new file mode 100644 index 000000000000..db9a00a60009 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-activate-account.sample.json @@ -0,0 +1,9 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-ballot.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-ballot.sample.json new file mode 100644 index 000000000000..e635a124295c --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-ballot.sample.json @@ -0,0 +1,11 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "ballot", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-delegation-withdrawal.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-delegation-withdrawal.sample.json new file mode 100644 index 000000000000..a0f728f65b07 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-delegation-withdrawal.sample.json @@ -0,0 +1,12 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-delegation.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-delegation.sample.json new file mode 100644 index 000000000000..7b5149b953fa --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-delegation.sample.json @@ -0,0 +1,13 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-double-baking-evidence.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-double-baking-evidence.sample.json new file mode 100644 index 000000000000..1c8f236c2dee --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-double-baking-evidence.sample.json @@ -0,0 +1,37 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "double_baking_evidence", + "bh1": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": ["01", "000000000000000a"], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 + }, + "bh2": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": ["01", "000000000000000a"], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round":0 + } + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-double-endorsement-evidence.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-double-endorsement-evidence.sample.json new file mode 100644 index 000000000000..838a3abe65d0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-double-endorsement-evidence.sample.json @@ -0,0 +1,31 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_endorsement_evidence", + "op1": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + }, + "op2": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + } + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement-with-slot.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement-with-slot.sample.json new file mode 100644 index 000000000000..d948f617b95f --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement-with-slot.sample.json @@ -0,0 +1,13 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement.sample.json new file mode 100644 index 000000000000..d948f617b95f --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-endorsement.sample.json @@ -0,0 +1,13 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-origination.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-origination.sample.json new file mode 100644 index 000000000000..1bb84ef5d469 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-origination.sample.json @@ -0,0 +1,55 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [{ + "prim": "parameter", + "args": [{ + "prim": "string" + }] + }, + { + "prim": "storage", + "args": [{ + "prim": "option", + "args": [{ + "prim": "string" + }] + }] + }, + { + "prim": "code", + "args": [ + [{ + "prim": "CAR" + }, { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [{ + "prim": "operation" + }] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [{ + "string": "test" + }] + } + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-proposals.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-proposals.sample.json new file mode 100644 index 000000000000..a7f958de001d --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-proposals.sample.json @@ -0,0 +1,12 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposals": ["PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" + ] + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-reveal.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-reveal.sample.json new file mode 100644 index 000000000000..5e5c37e058f0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-reveal.sample.json @@ -0,0 +1,13 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "reveal", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-seed-nonce-revelation.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-seed-nonce-revelation.sample.json new file mode 100644 index 000000000000..19dd3b8d9cc1 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-seed-nonce-revelation.sample.json @@ -0,0 +1,9 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "seed_nonce_revelation", + "level": 1331, + "nonce": "0000000000000000000000000000000000000000000000000000000000000000" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-implicit.sample.json new file mode 100644 index 000000000000..a8385a84d26e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-implicit.sample.json @@ -0,0 +1,14 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-originated.sample.json b/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-originated.sample.json new file mode 100644 index 000000000000..c9bf769a3eea --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/operation/operation-transaction-to-originated.sample.json @@ -0,0 +1,20 @@ +{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [{ + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [{ + "prim": "UNIT" + }] + } + }], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +} diff --git a/tezt/tests/encoding_samples/mumbai/period/period-positive.sample.json b/tezt/tests/encoding_samples/mumbai/period/period-positive.sample.json new file mode 100644 index 000000000000..48fbee6018c0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/period/period-positive.sample.json @@ -0,0 +1 @@ +"2789" diff --git a/tezt/tests/encoding_samples/mumbai/period/period-zero.sample.json b/tezt/tests/encoding_samples/mumbai/period/period-zero.sample.json new file mode 100644 index 000000000000..9bc20d262a9e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/period/period-zero.sample.json @@ -0,0 +1 @@ +"0" diff --git a/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-positive.sample.json b/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-positive.sample.json new file mode 100644 index 000000000000..a51fa7d1efef --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-positive.sample.json @@ -0,0 +1 @@ +2147483647 diff --git a/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-zero.sample.json b/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-zero.sample.json new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/raw_level/raw_level-zero.sample.json @@ -0,0 +1 @@ +0 diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-implicit.sample.json new file mode 100644 index 000000000000..e5da1e57aac2 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-implicit.sample.json @@ -0,0 +1,6 @@ +[{ + "kind": "contract", + "contract": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "change": "0", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-originated.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-originated.sample.json new file mode 100644 index 000000000000..ee5fcec131c6 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-contract-originated.sample.json @@ -0,0 +1,6 @@ +[{ + "kind": "contract", + "contract": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "change": "-1", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-deposits.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-deposits.sample.json new file mode 100644 index 000000000000..4bccdc9ace82 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-deposits.sample.json @@ -0,0 +1,7 @@ +[{ + "kind": "freezer", + "category": "deposits", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "change": "-1", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-fees.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-fees.sample.json new file mode 100644 index 000000000000..7b8b05caabac --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-fees.sample.json @@ -0,0 +1,8 @@ +[{ + "kind": "freezer", + "category": "fees", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "cycle": 2147483647, + "change": "1", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_deposits.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_deposits.sample.json new file mode 100644 index 000000000000..558faea8ced4 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_deposits.sample.json @@ -0,0 +1,8 @@ +[{ + "kind": "freezer", + "category": "legacy_deposits", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "cycle": 5, + "change": "-1", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_rewards.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_rewards.sample.json new file mode 100644 index 000000000000..e6a164345a63 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-legacy_rewards.sample.json @@ -0,0 +1,8 @@ +[{ + "kind": "freezer", + "category": "legacy_rewards", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "cycle": 0, + "change": "0", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-rewards.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-rewards.sample.json new file mode 100644 index 000000000000..610a116aa271 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-freezer-rewards.sample.json @@ -0,0 +1,7 @@ +[{ + "kind": "freezer", + "category": "rewards", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "change": "0", + "origin": "block" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-implicit.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-implicit.sample.json new file mode 100644 index 000000000000..3d003864885c --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-implicit.sample.json @@ -0,0 +1,6 @@ +[{ + "kind": "contract", + "contract": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "change": "0", + "origin": "migration" +}] diff --git a/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-originated.sample.json b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-originated.sample.json new file mode 100644 index 000000000000..d84f63598da2 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/receipt.balance_updates/receipt.balance_updates-migration-contract-originated.sample.json @@ -0,0 +1,6 @@ +[{ + "kind": "contract", + "contract": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "change": "-1", + "origin": "migration" +}] diff --git a/tezt/tests/encoding_samples/mumbai/roll/roll-positive.sample.json b/tezt/tests/encoding_samples/mumbai/roll/roll-positive.sample.json new file mode 100644 index 000000000000..a51fa7d1efef --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/roll/roll-positive.sample.json @@ -0,0 +1 @@ +2147483647 diff --git a/tezt/tests/encoding_samples/mumbai/roll/roll-zero.sample.json b/tezt/tests/encoding_samples/mumbai/roll/roll-zero.sample.json new file mode 100644 index 000000000000..573541ac9702 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/roll/roll-zero.sample.json @@ -0,0 +1 @@ +0 diff --git a/tezt/tests/encoding_samples/mumbai/seed/seed.sample.json b/tezt/tests/encoding_samples/mumbai/seed/seed.sample.json new file mode 100644 index 000000000000..c0e649a61b00 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/seed/seed.sample.json @@ -0,0 +1 @@ +"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8" diff --git a/tezt/tests/encoding_samples/mumbai/tez/tez-positive.sample.json b/tezt/tests/encoding_samples/mumbai/tez/tez-positive.sample.json new file mode 100644 index 000000000000..eed79abebfe4 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/tez/tez-positive.sample.json @@ -0,0 +1 @@ +"7322135" diff --git a/tezt/tests/encoding_samples/mumbai/tez/tez-zero.sample.json b/tezt/tests/encoding_samples/mumbai/tez/tez-zero.sample.json new file mode 100644 index 000000000000..9bc20d262a9e --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/tez/tez-zero.sample.json @@ -0,0 +1 @@ +"0" diff --git a/tezt/tests/encoding_samples/mumbai/timestamp/timestamp.sample.json b/tezt/tests/encoding_samples/mumbai/timestamp/timestamp.sample.json new file mode 100644 index 000000000000..020ef41de1d5 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/timestamp/timestamp.sample.json @@ -0,0 +1 @@ +"2020-04-20T16:19:59Z" diff --git a/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-nay.sample.json b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-nay.sample.json new file mode 100644 index 000000000000..3e3bb6e1b47d --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-nay.sample.json @@ -0,0 +1 @@ +"nay" diff --git a/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-pass.sample.json b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-pass.sample.json new file mode 100644 index 000000000000..3cf9c0f1f9ab --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-pass.sample.json @@ -0,0 +1 @@ +"pass" diff --git a/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-yay.sample.json b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-yay.sample.json new file mode 100644 index 000000000000..3bf44eff71c0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/vote.ballot/vote.ballot-yay.sample.json @@ -0,0 +1 @@ +"yay" diff --git a/tezt/tests/encoding_samples/mumbai/vote.ballots/vote.ballots.sample.json b/tezt/tests/encoding_samples/mumbai/vote.ballots/vote.ballots.sample.json new file mode 100644 index 000000000000..2de18504c9af --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/vote.ballots/vote.ballots.sample.json @@ -0,0 +1,5 @@ +{ + "yay": "2147483647", + "nay": "0", + "pass": "455" +} diff --git a/tezt/tests/encoding_samples/mumbai/vote.listings/vote.listings.sample.json b/tezt/tests/encoding_samples/mumbai/vote.listings/vote.listings.sample.json new file mode 100644 index 000000000000..13b3be07b4ec --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/vote.listings/vote.listings.sample.json @@ -0,0 +1,9 @@ +[{ + "pkh": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "voting_power": "20115" + }, + { + "pkh": "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN", + "voting_power": "9000" + } +] diff --git a/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-promotion-vote.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-promotion-vote.sample.json new file mode 100644 index 000000000000..abfc62e579c4 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-promotion-vote.sample.json @@ -0,0 +1 @@ +"promotion" diff --git a/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-proposal.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-proposal.sample.json new file mode 100644 index 000000000000..feced6294a44 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-proposal.sample.json @@ -0,0 +1 @@ +"proposal" diff --git a/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing-vote.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing-vote.sample.json new file mode 100644 index 000000000000..779e4dd6eac8 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing-vote.sample.json @@ -0,0 +1 @@ +"exploration" diff --git a/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing.sample.json new file mode 100644 index 000000000000..345cbbb98109 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period.kind/voting_period.kind-testing.sample.json @@ -0,0 +1 @@ +"cooldown" diff --git a/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-positive.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-positive.sample.json new file mode 100644 index 000000000000..c964039ce13b --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-positive.sample.json @@ -0,0 +1,5 @@ +{ + "start_position": 1159026, + "kind": "proposal", + "index": 0 +} diff --git a/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-zero.sample.json b/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-zero.sample.json new file mode 100644 index 000000000000..02b1793b2fe0 --- /dev/null +++ b/tezt/tests/encoding_samples/mumbai/voting_period/voting_period-zero.sample.json @@ -0,0 +1,5 @@ +{ + "start_position": 0, + "kind": "proposal", + "index": 0 +} diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- contracts.out new file mode 100644 index 000000000000..4fbd5e0f6a1f --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- contracts.out @@ -0,0 +1,553 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "3800000000000", + "delegate": "[PUBLIC_KEY_HASH]", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"3800000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "0", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "100000000", "counter": "1" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"100000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"1" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", + "counter": "4" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"99999393" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"4" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": + { "prim": "Some", "args": [ { "string": "initial storage" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": {} } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": { "prim": "Some", "args": [ { "string": "initial storage" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Some", "args": [ { "string": "initial storage" } ] } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", + "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": + [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": + { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": + { "rem_right": { "prim": "string" }, "rem_left": { "prim": "string" }, + "rem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%rem_left" ] }, + { "prim": "string", "annots": [ "%rem_right" ] } ] }, + "mem_right": { "prim": "string" }, "mem_left": { "prim": "string" }, + "mem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", "annots": [ "%mem_right" ] } ] }, + "default": { "prim": "unit" }, + "add_right": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add_left": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add": + { "prim": "or", + "args": + [ { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_right" ] } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "test" + }, + "type": { + "prim": "string" + } +}' +null + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "dup" + }, + "type": { + "prim": "string" + } +}' +null diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- delegates.out new file mode 100644 index 000000000000..11c9db29ab4c --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- delegates.out @@ -0,0 +1,95 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +{ "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", "remaining_proposals": 20, + "active_consensus_key": "[PUBLIC_KEY_HASH]" } + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +"200000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +false + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +[ "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +5 + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +Fatal error: + Command failed: The implicit account ([PUBLIC_KEY_HASH]) whose balance was requested is not a registered delegate. To get the balance of this account you can use the ../context/contracts/[PUBLIC_KEY_HASH]/balance RPC. + The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- mempool.out new file mode 100644 index 000000000000..f5bd26763b22 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- mempool.out @@ -0,0 +1,246 @@ + +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +[] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.016-PtMumbai.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.016-PtMumbai.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"}] + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=true&refused=true&outdated=true&branch_delayed=true&branch_refused=true' +{ "applied": + [ { "hash": "[OPERATION_HASH]", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]" } ], + "refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", "fee": "0", + "counter": "1", "gas_limit": "1040", "storage_limit": "257", + "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "permanent", + "id": "proto.016-PtMumbai.prefilter.fees_too_low" } ] } ], + "outdated": [], + "branch_refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "branch", + "id": "proto.016-PtMumbai.contract.counter_in_the_past", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "2", "found": "1" } ] } ], + "branch_delayed": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "5", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "temporary", + "id": "proto.016-PtMumbai.contract.counter_in_the_future", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "1", "found": "5" } ] } ], "unprocessed": [] } + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=true&refused=false&outdated=false&branch_delayed=false&branch_refused=false' +{ "applied": + [ { "hash": "[OPERATION_HASH]", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]" } ], + "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], + "unprocessed": [] } + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=true&outdated=false&branch_delayed=false&branch_refused=false' +{ "applied": [], + "refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", "fee": "0", + "counter": "1", "gas_limit": "1040", "storage_limit": "257", + "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "permanent", + "id": "proto.016-PtMumbai.prefilter.fees_too_low" } ] } ], + "outdated": [], "branch_refused": [], "branch_delayed": [], + "unprocessed": [] } + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=false&branch_delayed=true&branch_refused=false' +{ "applied": [], "refused": [], "outdated": [], "branch_refused": [], + "branch_delayed": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "5", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "temporary", + "id": "proto.016-PtMumbai.contract.counter_in_the_future", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "1", "found": "5" } ] } ], "unprocessed": [] } + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=false&branch_delayed=false&branch_refused=true' +{ "applied": [], "refused": [], "outdated": [], + "branch_refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "branch", + "id": "proto.016-PtMumbai.contract.counter_in_the_past", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "2", "found": "1" } ] } ], "branch_delayed": [], + "unprocessed": [] } + +./octez-client rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=true&branch_delayed=false&branch_refused=false' +{ "applied": [], "refused": [], "outdated": [], "branch_refused": [], + "branch_delayed": [], "unprocessed": [] } + +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.016-PtMumbai.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.016-PtMumbai.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.016-PtMumbai.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] + +./octez-client rpc get /chains/main/mempool/filter +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=false' +{} + +./octez-client rpc post /chains/main/mempool/filter with '{ + "minimal_fees": "50", + "minimal_nanotez_per_gas_unit": [ + "201", + "5" + ], + "minimal_nanotez_per_byte": [ + "56", + "3" + ], + "allow_script_failure": false +}' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get /chains/main/mempool/filter +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=false' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false } + +./octez-client rpc post /chains/main/mempool/filter with '{ + "minimal_fees": "200", + "allow_script_failure": true +}' +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get /chains/main/mempool/filter +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=false' +{ "minimal_fees": "200" } + +./octez-client rpc post /chains/main/mempool/filter with '{}' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get /chains/main/mempool/filter +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client rpc get '/chains/main/mempool/filter?include_default=false' +{} diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- misc_protocol.out new file mode 100644 index 000000000000..9791c9158c85 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- misc_protocol.out @@ -0,0 +1,106 @@ + +./octez-client rpc get /chains/main/blocks/head/context/constants +{ "proof_of_work_nonce_size": 8, "nonce_length": 32, + "max_anon_ops_per_block": 132, "max_operation_data_length": 32768, + "max_proposals_per_delegate": 20, "max_micheline_node_count": 50000, + "max_micheline_bytes_limit": 50000, + "max_allowed_global_constants_depth": 10000, "cache_layout_size": 3, + "michelson_maximum_type_size": 2001, + "sc_max_wrapped_proof_binary_size": 30000, + "sc_rollup_message_size_limit": 4096, + "sc_rollup_max_number_of_messages_per_level": "1000000", + "preserved_cycles": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, + "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, + "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "hard_gas_limit_per_block": "2600000", "proof_of_work_threshold": "-1", + "minimal_stake": "6000000000", "vdf_difficulty": "50000", + "seed_nonce_revelation_tip": "125000", "origination_size": 257, + "baking_reward_fixed_portion": "333333", + "baking_reward_bonus_per_slot": "3921", + "endorsing_reward_per_slot": "2604", "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, + "liquidity_baking_subsidy": "83333", + "liquidity_baking_toggle_ema_threshold": 1000000000, + "max_operations_time_to_live": 240, "minimal_block_delay": "1", + "delay_increment_per_round": "1", "consensus_committee_size": 256, + "consensus_threshold": 0, + "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, + "max_slashing_period": 2, "frozen_deposits_percentage": 5, + "double_baking_punishment": "640000000", + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, + "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, + "tx_rollup_enable": true, "tx_rollup_origination_size": 4000, + "tx_rollup_hard_size_limit_per_inbox": 500000, + "tx_rollup_hard_size_limit_per_message": 5000, + "tx_rollup_max_withdrawals_per_batch": 15, + "tx_rollup_commitment_bond": "10000000000", + "tx_rollup_finality_period": 40000, "tx_rollup_withdraw_period": 40000, + "tx_rollup_max_inboxes_count": 40100, + "tx_rollup_max_messages_per_inbox": 1010, + "tx_rollup_max_commitments_count": 80100, + "tx_rollup_cost_per_byte_ema_factor": 120, + "tx_rollup_max_ticket_payload_size": 2048, + "tx_rollup_rejection_max_proof_size": 30000, + "tx_rollup_sunset_level": 3473409, + "dal_parametric": + { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 1, + "availability_threshold": 50, "redundancy_factor": 8, "page_size": 128, + "slot_size": 32768, "number_of_shards": 64 }, + "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, + "sc_rollup_challenge_window_in_blocks": 20160, + "sc_rollup_stake_amount": "10000000000", + "sc_rollup_commitment_period_in_blocks": 30, + "sc_rollup_max_lookahead_in_blocks": 30000, + "sc_rollup_max_active_outbox_levels": 20160, + "sc_rollup_max_outbox_messages_per_level": 100, + "sc_rollup_number_of_sections_in_dissection": 32, + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5, + "sc_rollup_max_number_of_parallel_games": 32, "zk_rollup_enable": false, + "zk_rollup_origination_size": 4000, + "zk_rollup_min_pending_to_process": 10 } + +./octez-client rpc get /chains/main/blocks/head/helpers/baking_rights +[ { "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]" } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/current_level?offset=0' +{ "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, + "expected_commitment": false } + +./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights +[ { "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]" } ] } ] + +./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle +{ "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- votes.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- votes.out new file mode 100644 index 000000000000..7a6be820083a --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode client) RPC regression tests- votes.out @@ -0,0 +1,78 @@ + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "0", "nay": "0", "pass": "0" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 1, "remaining": 2 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +null + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[ [ "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp", "4000000000000" ] ] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 2, "remaining": 1 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000000000000" + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[ { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "nay" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "pass" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "yay" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "4000001978209", "nay": "4000000000000", "pass": "4000000000000" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 0, "remaining": 3 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000001978209" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 1, "remaining": 2 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000001978209" diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- contracts.out new file mode 100644 index 000000000000..30a6e86687d9 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- contracts.out @@ -0,0 +1,553 @@ + +./octez-client --mode light rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode light rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "3800000000000", + "delegate": "[PUBLIC_KEY_HASH]", "counter": "0" } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"3800000000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"0" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "0", "counter": "0" } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "100000000", "counter": "1" } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"100000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"1" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +null + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", + "counter": "4" } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"99999393" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"4" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": + { "prim": "Some", "args": [ { "string": "initial storage" } ] } } } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": {} } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": { "prim": "Some", "args": [ { "string": "initial storage" } ] } } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Some", "args": [ { "string": "initial storage" } ] } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", + "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": + [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": + { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client --mode light rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": + { "rem_right": { "prim": "string" }, "rem_left": { "prim": "string" }, + "rem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%rem_left" ] }, + { "prim": "string", "annots": [ "%rem_right" ] } ] }, + "mem_right": { "prim": "string" }, "mem_left": { "prim": "string" }, + "mem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", "annots": [ "%mem_right" ] } ] }, + "default": { "prim": "unit" }, + "add_right": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add_left": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add": + { "prim": "or", + "args": + [ { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_right" ] } ] } } } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } + +./octez-client --mode light rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "test" + }, + "type": { + "prim": "string" + } +}' +null + +./octez-client --mode light rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "dup" + }, + "type": { + "prim": "string" + } +}' +null diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- delegates.out new file mode 100644 index 000000000000..bafaa8f0dfbd --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- delegates.out @@ -0,0 +1,95 @@ + +./octez-client --mode light rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode light rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +{ "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", "remaining_proposals": 20, + "active_consensus_key": "[PUBLIC_KEY_HASH]" } + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +"4000000000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +"200000000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +false + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +"0" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +[ "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +5 + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +"4000000000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +"4000000000000" + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +Fatal error: + Command failed: The implicit account ([PUBLIC_KEY_HASH]) whose balance was requested is not a registered delegate. To get the balance of this account you can use the ../context/contracts/[PUBLIC_KEY_HASH]/balance RPC. + The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- misc_protocol.out new file mode 100644 index 000000000000..94771e38790e --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- misc_protocol.out @@ -0,0 +1,106 @@ + +./octez-client --mode light rpc get /chains/main/blocks/head/context/constants +{ "proof_of_work_nonce_size": 8, "nonce_length": 32, + "max_anon_ops_per_block": 132, "max_operation_data_length": 32768, + "max_proposals_per_delegate": 20, "max_micheline_node_count": 50000, + "max_micheline_bytes_limit": 50000, + "max_allowed_global_constants_depth": 10000, "cache_layout_size": 3, + "michelson_maximum_type_size": 2001, + "sc_max_wrapped_proof_binary_size": 30000, + "sc_rollup_message_size_limit": 4096, + "sc_rollup_max_number_of_messages_per_level": "1000000", + "preserved_cycles": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, + "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, + "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "hard_gas_limit_per_block": "2600000", "proof_of_work_threshold": "-1", + "minimal_stake": "6000000000", "vdf_difficulty": "50000", + "seed_nonce_revelation_tip": "125000", "origination_size": 257, + "baking_reward_fixed_portion": "333333", + "baking_reward_bonus_per_slot": "3921", + "endorsing_reward_per_slot": "2604", "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, + "liquidity_baking_subsidy": "83333", + "liquidity_baking_toggle_ema_threshold": 1000000000, + "max_operations_time_to_live": 240, "minimal_block_delay": "1", + "delay_increment_per_round": "1", "consensus_committee_size": 256, + "consensus_threshold": 0, + "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, + "max_slashing_period": 2, "frozen_deposits_percentage": 5, + "double_baking_punishment": "640000000", + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, + "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, + "tx_rollup_enable": true, "tx_rollup_origination_size": 4000, + "tx_rollup_hard_size_limit_per_inbox": 500000, + "tx_rollup_hard_size_limit_per_message": 5000, + "tx_rollup_max_withdrawals_per_batch": 15, + "tx_rollup_commitment_bond": "10000000000", + "tx_rollup_finality_period": 40000, "tx_rollup_withdraw_period": 40000, + "tx_rollup_max_inboxes_count": 40100, + "tx_rollup_max_messages_per_inbox": 1010, + "tx_rollup_max_commitments_count": 80100, + "tx_rollup_cost_per_byte_ema_factor": 120, + "tx_rollup_max_ticket_payload_size": 2048, + "tx_rollup_rejection_max_proof_size": 30000, + "tx_rollup_sunset_level": 3473409, + "dal_parametric": + { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 1, + "availability_threshold": 50, "redundancy_factor": 8, "page_size": 128, + "slot_size": 32768, "number_of_shards": 64 }, + "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, + "sc_rollup_challenge_window_in_blocks": 20160, + "sc_rollup_stake_amount": "10000000000", + "sc_rollup_commitment_period_in_blocks": 30, + "sc_rollup_max_lookahead_in_blocks": 30000, + "sc_rollup_max_active_outbox_levels": 20160, + "sc_rollup_max_outbox_messages_per_level": 100, + "sc_rollup_number_of_sections_in_dissection": 32, + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5, + "sc_rollup_max_number_of_parallel_games": 32, "zk_rollup_enable": false, + "zk_rollup_origination_size": 4000, + "zk_rollup_min_pending_to_process": 10 } + +./octez-client --mode light rpc get /chains/main/blocks/head/helpers/baking_rights +[ { "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]" } ] + +./octez-client --mode light rpc get '/chains/main/blocks/head/helpers/current_level?offset=0' +{ "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, + "expected_commitment": false } + +./octez-client --mode light rpc get /chains/main/blocks/head/helpers/endorsing_rights +[ { "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]" } ] } ] + +./octez-client --mode light rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle +{ "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- votes.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- votes.out new file mode 100644 index 000000000000..ed1465430a6d --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode light) RPC regression tests- votes.out @@ -0,0 +1,78 @@ + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/ballot_list +[] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "0", "nay": "0", "pass": "0" } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 1, "remaining": 2 } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_proposal +null + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" } ] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/proposals +[ [ "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp", "4000000000000" ] ] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 2, "remaining": 1 } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/total_voting_power +"20000000000000" + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/ballot_list +[ { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "nay" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "pass" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "yay" } ] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "4000001978209", "nay": "4000000000000", "pass": "4000000000000" } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 0, "remaining": 3 } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_proposal +"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000001978209" } ] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/proposals +[] + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 1, "remaining": 2 } + +./octez-client --mode light rpc get /chains/main/blocks/head/votes/total_voting_power +"20000001978209" diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- contracts.out new file mode 100644 index 000000000000..4d0485654270 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- contracts.out @@ -0,0 +1,553 @@ + +./octez-client --mode proxy rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "3800000000000", + "delegate": "[PUBLIC_KEY_HASH]", "counter": "0" } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"3800000000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"0" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "0", "counter": "0" } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "100000000", "counter": "1" } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"100000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"1" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +null + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", + "counter": "4" } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"99999393" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"4" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": + { "prim": "Some", "args": [ { "string": "initial storage" } ] } } } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": {} } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": { "prim": "Some", "args": [ { "string": "initial storage" } ] } } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Some", "args": [ { "string": "initial storage" } ] } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", + "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": + [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": + { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client --mode proxy rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": + { "rem_right": { "prim": "string" }, "rem_left": { "prim": "string" }, + "rem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%rem_left" ] }, + { "prim": "string", "annots": [ "%rem_right" ] } ] }, + "mem_right": { "prim": "string" }, "mem_left": { "prim": "string" }, + "mem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", "annots": [ "%mem_right" ] } ] }, + "default": { "prim": "unit" }, + "add_right": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add_left": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add": + { "prim": "or", + "args": + [ { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_right" ] } ] } } } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } + +./octez-client --mode proxy rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "test" + }, + "type": { + "prim": "string" + } +}' +null + +./octez-client --mode proxy rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "dup" + }, + "type": { + "prim": "string" + } +}' +null diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- delegates.out new file mode 100644 index 000000000000..50ec0944ea21 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- delegates.out @@ -0,0 +1,95 @@ + +./octez-client --mode proxy rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +{ "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", "remaining_proposals": 20, + "active_consensus_key": "[PUBLIC_KEY_HASH]" } + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +"4000000000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +"200000000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +false + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +"0" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +[ "[PUBLIC_KEY_HASH]" ] + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +5 + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +"4000000000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +"4000000000000" + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +Fatal error: + Command failed: The implicit account ([PUBLIC_KEY_HASH]) whose balance was requested is not a registered delegate. To get the balance of this account you can use the ../context/contracts/[PUBLIC_KEY_HASH]/balance RPC. + The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- mempool.out new file mode 100644 index 000000000000..081ef4fadae7 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- mempool.out @@ -0,0 +1,246 @@ + +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +[] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.016-PtMumbai.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.016-PtMumbai.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"}] +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"}] + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=true&refused=true&outdated=true&branch_delayed=true&branch_refused=true' +{ "applied": + [ { "hash": "[OPERATION_HASH]", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]" } ], + "refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", "fee": "0", + "counter": "1", "gas_limit": "1040", "storage_limit": "257", + "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "permanent", + "id": "proto.016-PtMumbai.prefilter.fees_too_low" } ] } ], + "outdated": [], + "branch_refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "branch", + "id": "proto.016-PtMumbai.contract.counter_in_the_past", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "2", "found": "1" } ] } ], + "branch_delayed": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "5", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "temporary", + "id": "proto.016-PtMumbai.contract.counter_in_the_future", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "1", "found": "5" } ] } ], "unprocessed": [] } + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=true&refused=false&outdated=false&branch_delayed=false&branch_refused=false' +{ "applied": + [ { "hash": "[OPERATION_HASH]", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]" } ], + "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], + "unprocessed": [] } + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=true&outdated=false&branch_delayed=false&branch_refused=false' +{ "applied": [], + "refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", "fee": "0", + "counter": "1", "gas_limit": "1040", "storage_limit": "257", + "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "permanent", + "id": "proto.016-PtMumbai.prefilter.fees_too_low" } ] } ], + "outdated": [], "branch_refused": [], "branch_delayed": [], + "unprocessed": [] } + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=false&branch_delayed=true&branch_refused=false' +{ "applied": [], "refused": [], "outdated": [], "branch_refused": [], + "branch_delayed": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "5", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "temporary", + "id": "proto.016-PtMumbai.contract.counter_in_the_future", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "1", "found": "5" } ] } ], "unprocessed": [] } + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=false&branch_delayed=false&branch_refused=true' +{ "applied": [], "refused": [], "outdated": [], + "branch_refused": + [ { "hash": "[OPERATION_HASH]", + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": "[BRANCH_HASH]", + "contents": + [ { "kind": "transaction", + "source": "[PUBLIC_KEY_HASH]", + "fee": "1000", "counter": "1", "gas_limit": "1040", + "storage_limit": "257", "amount": "1000000", + "destination": "[PUBLIC_KEY_HASH]" } ], + "signature": + "[SIGNATURE]", + "error": + [ { "kind": "branch", + "id": "proto.016-PtMumbai.contract.counter_in_the_past", + "contract": "[PUBLIC_KEY_HASH]", + "expected": "2", "found": "1" } ] } ], "branch_delayed": [], + "unprocessed": [] } + +./octez-client --mode proxy rpc get '/chains/main/mempool/pending_operations?version=1&applied=false&refused=false&outdated=true&branch_delayed=false&branch_refused=false' +{ "applied": [], "refused": [], "outdated": [], "branch_refused": [], + "branch_delayed": [], "unprocessed": [] } + +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +[{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.016-PtMumbai.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.016-PtMumbai.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.016-PtMumbai.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] + +./octez-client --mode proxy rpc get /chains/main/mempool/filter +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=false' +{} + +./octez-client --mode proxy rpc post /chains/main/mempool/filter with '{ + "minimal_fees": "50", + "minimal_nanotez_per_gas_unit": [ + "201", + "5" + ], + "minimal_nanotez_per_byte": [ + "56", + "3" + ], + "allow_script_failure": false +}' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get /chains/main/mempool/filter +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=false' +{ "minimal_fees": "50", "minimal_nanotez_per_gas_unit": [ "201", "5" ], + "minimal_nanotez_per_byte": [ "56", "3" ], "allow_script_failure": false } + +./octez-client --mode proxy rpc post /chains/main/mempool/filter with '{ + "minimal_fees": "200", + "allow_script_failure": true +}' +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get /chains/main/mempool/filter +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "200", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=false' +{ "minimal_fees": "200" } + +./octez-client --mode proxy rpc post /chains/main/mempool/filter with '{}' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get /chains/main/mempool/filter +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=true' +{ "minimal_fees": "100", "minimal_nanotez_per_gas_unit": [ "100", "1" ], + "minimal_nanotez_per_byte": [ "1000", "1" ], "allow_script_failure": true, + "replace_by_fee_factor": [ "21", "20" ], + "max_prechecked_manager_operations": 5000 } + +./octez-client --mode proxy rpc get '/chains/main/mempool/filter?include_default=false' +{} diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- misc_protocol.out new file mode 100644 index 000000000000..9d57a015a373 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- misc_protocol.out @@ -0,0 +1,106 @@ + +./octez-client --mode proxy rpc get /chains/main/blocks/head/context/constants +{ "proof_of_work_nonce_size": 8, "nonce_length": 32, + "max_anon_ops_per_block": 132, "max_operation_data_length": 32768, + "max_proposals_per_delegate": 20, "max_micheline_node_count": 50000, + "max_micheline_bytes_limit": 50000, + "max_allowed_global_constants_depth": 10000, "cache_layout_size": 3, + "michelson_maximum_type_size": 2001, + "sc_max_wrapped_proof_binary_size": 30000, + "sc_rollup_message_size_limit": 4096, + "sc_rollup_max_number_of_messages_per_level": "1000000", + "preserved_cycles": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, + "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, + "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "hard_gas_limit_per_block": "2600000", "proof_of_work_threshold": "-1", + "minimal_stake": "6000000000", "vdf_difficulty": "50000", + "seed_nonce_revelation_tip": "125000", "origination_size": 257, + "baking_reward_fixed_portion": "333333", + "baking_reward_bonus_per_slot": "3921", + "endorsing_reward_per_slot": "2604", "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, + "liquidity_baking_subsidy": "83333", + "liquidity_baking_toggle_ema_threshold": 1000000000, + "max_operations_time_to_live": 240, "minimal_block_delay": "1", + "delay_increment_per_round": "1", "consensus_committee_size": 256, + "consensus_threshold": 0, + "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, + "max_slashing_period": 2, "frozen_deposits_percentage": 5, + "double_baking_punishment": "640000000", + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, + "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, + "tx_rollup_enable": true, "tx_rollup_origination_size": 4000, + "tx_rollup_hard_size_limit_per_inbox": 500000, + "tx_rollup_hard_size_limit_per_message": 5000, + "tx_rollup_max_withdrawals_per_batch": 15, + "tx_rollup_commitment_bond": "10000000000", + "tx_rollup_finality_period": 40000, "tx_rollup_withdraw_period": 40000, + "tx_rollup_max_inboxes_count": 40100, + "tx_rollup_max_messages_per_inbox": 1010, + "tx_rollup_max_commitments_count": 80100, + "tx_rollup_cost_per_byte_ema_factor": 120, + "tx_rollup_max_ticket_payload_size": 2048, + "tx_rollup_rejection_max_proof_size": 30000, + "tx_rollup_sunset_level": 3473409, + "dal_parametric": + { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 1, + "availability_threshold": 50, "redundancy_factor": 8, "page_size": 128, + "slot_size": 32768, "number_of_shards": 64 }, + "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, + "sc_rollup_challenge_window_in_blocks": 20160, + "sc_rollup_stake_amount": "10000000000", + "sc_rollup_commitment_period_in_blocks": 30, + "sc_rollup_max_lookahead_in_blocks": 30000, + "sc_rollup_max_active_outbox_levels": 20160, + "sc_rollup_max_outbox_messages_per_level": 100, + "sc_rollup_number_of_sections_in_dissection": 32, + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5, + "sc_rollup_max_number_of_parallel_games": 32, "zk_rollup_enable": false, + "zk_rollup_origination_size": 4000, + "zk_rollup_min_pending_to_process": 10 } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/baking_rights +[ { "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]" } ] + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/helpers/current_level?offset=0' +{ "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, + "expected_commitment": false } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/endorsing_rights +[ { "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]" } ] } ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle +{ "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- votes.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- votes.out new file mode 100644 index 000000000000..3ad2df934604 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy) RPC regression tests- votes.out @@ -0,0 +1,78 @@ + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/ballot_list +[] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "0", "nay": "0", "pass": "0" } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 1, "remaining": 2 } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_proposal +null + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" } ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/proposals +[ [ "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp", "4000000000000" ] ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 2, "remaining": 1 } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/total_voting_power +"20000000000000" + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/ballot_list +[ { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "nay" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "pass" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "yay" } ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "4000001978209", "nay": "4000000000000", "pass": "4000000000000" } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 0, "remaining": 3 } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_proposal +"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000001978209" } ] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/proposals +[] + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 1, "remaining": 2 } + +./octez-client --mode proxy rpc get /chains/main/blocks/head/votes/total_voting_power +"20000001978209" diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- contracts.out new file mode 100644 index 000000000000..4fbd5e0f6a1f --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- contracts.out @@ -0,0 +1,553 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "3800000000000", + "delegate": "[PUBLIC_KEY_HASH]", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"3800000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "0", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "100000000", "counter": "1" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"100000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"1" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", + "counter": "4" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"99999393" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"4" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": + { "prim": "Some", "args": [ { "string": "initial storage" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": {} } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": { "prim": "Some", "args": [ { "string": "initial storage" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Some", "args": [ { "string": "initial storage" } ] } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", + "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": + [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": + { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": + { "rem_right": { "prim": "string" }, "rem_left": { "prim": "string" }, + "rem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%rem_left" ] }, + { "prim": "string", "annots": [ "%rem_right" ] } ] }, + "mem_right": { "prim": "string" }, "mem_left": { "prim": "string" }, + "mem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", "annots": [ "%mem_right" ] } ] }, + "default": { "prim": "unit" }, + "add_right": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add_left": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add": + { "prim": "or", + "args": + [ { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_right" ] } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "test" + }, + "type": { + "prim": "string" + } +}' +null + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "dup" + }, + "type": { + "prim": "string" + } +}' +null diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- delegates.out new file mode 100644 index 000000000000..11c9db29ab4c --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- delegates.out @@ -0,0 +1,95 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +{ "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", "remaining_proposals": 20, + "active_consensus_key": "[PUBLIC_KEY_HASH]" } + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +"200000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +false + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +[ "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +5 + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +Fatal error: + Command failed: The implicit account ([PUBLIC_KEY_HASH]) whose balance was requested is not a registered delegate. To get the balance of this account you can use the ../context/contracts/[PUBLIC_KEY_HASH]/balance RPC. + The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out new file mode 100644 index 000000000000..1b08b3512c50 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -0,0 +1,106 @@ + +./octez-client rpc get /chains/main/blocks/head/context/constants +{ "proof_of_work_nonce_size": 8, "nonce_length": 32, + "max_anon_ops_per_block": 132, "max_operation_data_length": 32768, + "max_proposals_per_delegate": 20, "max_micheline_node_count": 50000, + "max_micheline_bytes_limit": 50000, + "max_allowed_global_constants_depth": 10000, "cache_layout_size": 3, + "michelson_maximum_type_size": 2001, + "sc_max_wrapped_proof_binary_size": 30000, + "sc_rollup_message_size_limit": 4096, + "sc_rollup_max_number_of_messages_per_level": "1000000", + "preserved_cycles": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, + "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, + "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "hard_gas_limit_per_block": "2600000", "proof_of_work_threshold": "-1", + "minimal_stake": "6000000000", "vdf_difficulty": "50000", + "seed_nonce_revelation_tip": "125000", "origination_size": 257, + "baking_reward_fixed_portion": "333333", + "baking_reward_bonus_per_slot": "3921", + "endorsing_reward_per_slot": "2604", "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, + "liquidity_baking_subsidy": "83333", + "liquidity_baking_toggle_ema_threshold": 1000000000, + "max_operations_time_to_live": 240, "minimal_block_delay": "1", + "delay_increment_per_round": "1", "consensus_committee_size": 256, + "consensus_threshold": 0, + "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, + "max_slashing_period": 2, "frozen_deposits_percentage": 5, + "double_baking_punishment": "640000000", + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, + "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, + "tx_rollup_enable": true, "tx_rollup_origination_size": 4000, + "tx_rollup_hard_size_limit_per_inbox": 500000, + "tx_rollup_hard_size_limit_per_message": 5000, + "tx_rollup_max_withdrawals_per_batch": 15, + "tx_rollup_commitment_bond": "10000000000", + "tx_rollup_finality_period": 40000, "tx_rollup_withdraw_period": 40000, + "tx_rollup_max_inboxes_count": 40100, + "tx_rollup_max_messages_per_inbox": 1010, + "tx_rollup_max_commitments_count": 80100, + "tx_rollup_cost_per_byte_ema_factor": 120, + "tx_rollup_max_ticket_payload_size": 2048, + "tx_rollup_rejection_max_proof_size": 30000, + "tx_rollup_sunset_level": 3473409, + "dal_parametric": + { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 1, + "availability_threshold": 50, "redundancy_factor": 8, "page_size": 128, + "slot_size": 32768, "number_of_shards": 64 }, + "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, + "sc_rollup_challenge_window_in_blocks": 20160, + "sc_rollup_stake_amount": "10000000000", + "sc_rollup_commitment_period_in_blocks": 30, + "sc_rollup_max_lookahead_in_blocks": 30000, + "sc_rollup_max_active_outbox_levels": 20160, + "sc_rollup_max_outbox_messages_per_level": 100, + "sc_rollup_number_of_sections_in_dissection": 32, + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5, + "sc_rollup_max_number_of_parallel_games": 32, "zk_rollup_enable": false, + "zk_rollup_origination_size": 4000, + "zk_rollup_min_pending_to_process": 10 } + +./octez-client rpc get /chains/main/blocks/head/helpers/baking_rights +[ { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 0, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 1, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 2, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 3, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 4, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/current_level?offset=0' +{ "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, + "expected_commitment": false } + +./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 10, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 3, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "endorsing_power": 65, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "endorsing_power": 41, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle +{ "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- votes.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- votes.out new file mode 100644 index 000000000000..8c859f49f493 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_data_dir) RPC regression tests- votes.out @@ -0,0 +1,78 @@ + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "0", "nay": "0", "pass": "0" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 2, "remaining": 1 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +null + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[ [ "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp", "4000000000000" ] ] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 3, "remaining": 0 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000000000000" + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[ { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "nay" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "pass" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "yay" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "4000001978209", "nay": "4000000000000", "pass": "4000000000000" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 1, "remaining": 2 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000001978209" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 2, "remaining": 1 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000001978209" diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- contracts.out new file mode 100644 index 000000000000..4fbd5e0f6a1f --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- contracts.out @@ -0,0 +1,553 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "3800000000000", + "delegate": "[PUBLIC_KEY_HASH]", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"3800000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "0", "counter": "0" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "100000000", "counter": "1" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"100000000" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"1" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' +{ "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", + "counter": "4" } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/balance' +"99999393" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/counter' +"4" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/manager_key' +"[PUBLIC_KEY]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' +"[PUBLIC_KEY_HASH]" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": + { "prim": "Some", "args": [ { "string": "initial storage" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": {} } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": { "prim": "Some", "args": [ { "string": "initial storage" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Some", "args": [ { "string": "initial storage" } ] } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' +{ "balance": "0", + "script": + { "code": + [ { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", + "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": + [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": + "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": + { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' +Fatal error: + No service found at this URL + + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' +Fatal error: + No service found at this URL + + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "int": "0" + }, + "type": { + "prim": "int" + } +}' +null + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/entrypoints' +{ "entrypoints": + { "rem_right": { "prim": "string" }, "rem_left": { "prim": "string" }, + "rem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%rem_left" ] }, + { "prim": "string", "annots": [ "%rem_right" ] } ] }, + "mem_right": { "prim": "string" }, "mem_left": { "prim": "string" }, + "mem": + { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", "annots": [ "%mem_right" ] } ] }, + "default": { "prim": "unit" }, + "add_right": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add_left": + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + "add": + { "prim": "or", + "args": + [ { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": [ { "prim": "string" }, { "prim": "nat" } ], + "annots": [ "%add_right" ] } ] } } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/script' +{ "code": + [ { "prim": "storage", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] }, + { "prim": "big_map", + "args": [ { "prim": "string" }, { "prim": "nat" } ] } ] } ] }, + { "prim": "parameter", + "args": + [ { "prim": "or", + "args": + [ { "prim": "unit", "annots": [ "%default" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "string", "annots": [ "%mem_left" ] }, + { "prim": "string", + "annots": [ "%mem_right" ] } ], + "annots": [ "%mem" ] }, + { "prim": "or", + "args": + [ { "prim": "or", + "args": + [ { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_left" ] }, + { "prim": "pair", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ], + "annots": [ "%add_right" ] } ], + "annots": [ "%add" ] }, + { "prim": "or", + "args": + [ { "prim": "string", + "annots": [ "%rem_left" ] }, + { "prim": "string", + "annots": [ "%rem_right" ] } ], + "annots": [ "%rem" ] } ] } ] } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DROP" }, { "prim": "DUP" }, + { "prim": "CAR" }, + { "prim": "PUSH", + "args": [ { "prim": "mutez" }, { "int": "0" } ] }, + { "prim": "NONE", "args": [ { "prim": "key_hash" } ] }, + { "prim": "CREATE_CONTRACT", + "args": + [ [ { "prim": "parameter", + "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "big_map", + "args": + [ { "prim": "string" }, + { "prim": "nat" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DROP" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] }, + { "prim": "DIP", "args": [ [ { "prim": "DROP" } ] ] }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "SWAP" }, { "prim": "CONS" }, + { "prim": "PAIR" } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ] ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": [ [ { "prim": "DUP" } ] ] }, + { "prim": "MEM" }, + [ { "prim": "IF", + "args": + [ [], + [ [ { "prim": "UNIT" }, + { "prim": "FAILWITH" } ] ] ] } ], + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "UNPAIR" }, + { "prim": "DIP", + "args": + [ { "int": "2" }, + [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "SOME" } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ], + [ { "prim": "IF_LEFT", + "args": + [ [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" } ], + [ { "prim": "DIP", + "args": + [ [ { "prim": "UNPAIR" }, + { "prim": "SWAP" } ] ] }, + { "prim": "DIP", + "args": + [ [ { "prim": "NONE", + "args": + [ { "prim": "nat" } ] } ] ] }, + { "prim": "UPDATE" }, + { "prim": "SWAP" } ] ] } ] ] } ] ] }, + { "prim": "PAIR" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ] ] } ], + "storage": { "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } } + +./octez-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/storage' +{ "prim": "Pair", "args": [ { "int": "4" }, { "int": "5" } ] } + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "test" + }, + "type": { + "prim": "string" + } +}' +null + +./octez-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ + "key": { + "string": "dup" + }, + "type": { + "prim": "string" + } +}' +null diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- delegates.out new file mode 100644 index 000000000000..11c9db29ab4c --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- delegates.out @@ -0,0 +1,95 @@ + +./octez-client rpc get /chains/main/blocks/head/context/contracts +[ "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get /chains/main/blocks/head/context/delegates +[ "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]", + "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +{ "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", "remaining_proposals": 20, + "active_consensus_key": "[PUBLIC_KEY_HASH]" } + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +"200000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +false + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +"0" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +[ "[PUBLIC_KEY_HASH]" ] + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +5 + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +"4000000000000" + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/full_balance' +Fatal error: + Command failed: The implicit account ([PUBLIC_KEY_HASH]) whose balance was requested is not a registered delegate. To get the balance of this account you can use the ../context/contracts/[PUBLIC_KEY_HASH]/balance RPC. + The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/frozen_deposits' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + + +./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/voting_power' +Fatal error: + Command failed: The provided public key hash ([PUBLIC_KEY_HASH]) is not the address of a registered delegate. If you own this account and want to register it as a delegate, use a delegation operation to delegate the account to itself. + diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out new file mode 100644 index 000000000000..1b08b3512c50 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -0,0 +1,106 @@ + +./octez-client rpc get /chains/main/blocks/head/context/constants +{ "proof_of_work_nonce_size": 8, "nonce_length": 32, + "max_anon_ops_per_block": 132, "max_operation_data_length": 32768, + "max_proposals_per_delegate": 20, "max_micheline_node_count": 50000, + "max_micheline_bytes_limit": 50000, + "max_allowed_global_constants_depth": 10000, "cache_layout_size": 3, + "michelson_maximum_type_size": 2001, + "sc_max_wrapped_proof_binary_size": 30000, + "sc_rollup_message_size_limit": 4096, + "sc_rollup_max_number_of_messages_per_level": "1000000", + "preserved_cycles": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, + "nonce_revelation_threshold": 4, "blocks_per_stake_snapshot": 4, + "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", + "hard_gas_limit_per_block": "2600000", "proof_of_work_threshold": "-1", + "minimal_stake": "6000000000", "vdf_difficulty": "50000", + "seed_nonce_revelation_tip": "125000", "origination_size": 257, + "baking_reward_fixed_portion": "333333", + "baking_reward_bonus_per_slot": "3921", + "endorsing_reward_per_slot": "2604", "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, + "liquidity_baking_subsidy": "83333", + "liquidity_baking_toggle_ema_threshold": 1000000000, + "max_operations_time_to_live": 240, "minimal_block_delay": "1", + "delay_increment_per_round": "1", "consensus_committee_size": 256, + "consensus_threshold": 0, + "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, + "max_slashing_period": 2, "frozen_deposits_percentage": 5, + "double_baking_punishment": "640000000", + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, + "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, + "tx_rollup_enable": true, "tx_rollup_origination_size": 4000, + "tx_rollup_hard_size_limit_per_inbox": 500000, + "tx_rollup_hard_size_limit_per_message": 5000, + "tx_rollup_max_withdrawals_per_batch": 15, + "tx_rollup_commitment_bond": "10000000000", + "tx_rollup_finality_period": 40000, "tx_rollup_withdraw_period": 40000, + "tx_rollup_max_inboxes_count": 40100, + "tx_rollup_max_messages_per_inbox": 1010, + "tx_rollup_max_commitments_count": 80100, + "tx_rollup_cost_per_byte_ema_factor": 120, + "tx_rollup_max_ticket_payload_size": 2048, + "tx_rollup_rejection_max_proof_size": 30000, + "tx_rollup_sunset_level": 3473409, + "dal_parametric": + { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 1, + "availability_threshold": 50, "redundancy_factor": 8, "page_size": 128, + "slot_size": 32768, "number_of_shards": 64 }, + "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, + "sc_rollup_challenge_window_in_blocks": 20160, + "sc_rollup_stake_amount": "10000000000", + "sc_rollup_commitment_period_in_blocks": 30, + "sc_rollup_max_lookahead_in_blocks": 30000, + "sc_rollup_max_active_outbox_levels": 20160, + "sc_rollup_max_outbox_messages_per_level": 100, + "sc_rollup_number_of_sections_in_dissection": 32, + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5, + "sc_rollup_max_number_of_parallel_games": 32, "zk_rollup_enable": false, + "zk_rollup_origination_size": 4000, + "zk_rollup_min_pending_to_process": 10 } + +./octez-client rpc get /chains/main/blocks/head/helpers/baking_rights +[ { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 0, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 1, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 2, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 3, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", + "round": 4, "estimated_time": "[TIMESTAMP]", + "consensus_key": "[PUBLIC_KEY_HASH]" } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/current_level?offset=0' +{ "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, + "expected_commitment": false } + +./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 10, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 3, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "endorsing_power": 65, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "endorsing_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "endorsing_power": 41, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle +{ "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- votes.out b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- votes.out new file mode 100644 index 000000000000..8c859f49f493 --- /dev/null +++ b/tezt/tests/expected/RPC_test.ml/Mumbai- (mode proxy_server_rpc) RPC regression tests- votes.out @@ -0,0 +1,78 @@ + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "0", "nay": "0", "pass": "0" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 2, "remaining": 1 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +null + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[ [ "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp", "4000000000000" ] ] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 0, "kind": "proposal", "start_position": 0 }, + "position": 3, "remaining": 0 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000000000000" + +./octez-client rpc get /chains/main/blocks/head/votes/ballot_list +[ { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "nay" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "pass" }, + { "pkh": "[PUBLIC_KEY_HASH]", "ballot": "yay" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/ballots +{ "yay": "4000001978209", "nay": "4000000000000", "pass": "4000000000000" } + +./octez-client rpc get /chains/main/blocks/head/votes/current_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 1, "remaining": 2 } + +./octez-client rpc get /chains/main/blocks/head/votes/current_proposal +"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" + +./octez-client rpc get /chains/main/blocks/head/votes/current_quorum +5500 + +./octez-client rpc get /chains/main/blocks/head/votes/listings +[ { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000000000000" }, + { "pkh": "[PUBLIC_KEY_HASH]", + "voting_power": "4000001978209" } ] + +./octez-client rpc get /chains/main/blocks/head/votes/proposals +[] + +./octez-client rpc get /chains/main/blocks/head/votes/successor_period +{ "voting_period": { "index": 1, "kind": "exploration", "start_position": 4 }, + "position": 2, "remaining": 1 } + +./octez-client rpc get /chains/main/blocks/head/votes/total_voting_power +"20000001978209" diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input254251340-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input254251340-.out new file mode 100644 index 000000000000..e7b68fbfc81b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input254251340-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/abs.tz on storage Unit and input 948 --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.211) + [ (Pair 948 Unit) ] + - location: 7 (just consumed gas: 0.010) + [ 948 ] + - location: 8 (just consumed gas: 0.010) + [ 948 + 948 ] + - location: 9 (just consumed gas: 0.026) + [ -948 + 948 ] + - location: 10 (just consumed gas: 0.021) + [ 948 + 948 ] + - location: 11 (just consumed gas: 0.035) + [ 0 ] + - location: 13 (just consumed gas: 0.010) + [ True ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 14 (just consumed gas: 0.015) + [ ] + - location: 20 (just consumed gas: 0.010) + [ Unit ] + - location: 21 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input420401245-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input420401245-.out new file mode 100644 index 000000000000..10c7210a77ee --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input420401245-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/abs.tz on storage Unit and input 12039123919239192312931 --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.211) + [ (Pair 12039123919239192312931 Unit) ] + - location: 7 (just consumed gas: 0.010) + [ 12039123919239192312931 ] + - location: 8 (just consumed gas: 0.010) + [ 12039123919239192312931 + 12039123919239192312931 ] + - location: 9 (just consumed gas: 0.030) + [ -12039123919239192312931 + 12039123919239192312931 ] + - location: 10 (just consumed gas: 0.025) + [ 12039123919239192312931 + 12039123919239192312931 ] + - location: 11 (just consumed gas: 0.035) + [ 0 ] + - location: 13 (just consumed gas: 0.010) + [ True ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 14 (just consumed gas: 0.015) + [ ] + - location: 20 (just consumed gas: 0.010) + [ Unit ] + - location: 21 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input680650890-.out new file mode 100644 index 000000000000..76c7e2d08c63 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -abs.tz--storage125992234--input680650890-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/abs.tz on storage Unit and input 0 --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.211) + [ (Pair 0 Unit) ] + - location: 7 (just consumed gas: 0.010) + [ 0 ] + - location: 8 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 9 (just consumed gas: 0.025) + [ 0 + 0 ] + - location: 10 (just consumed gas: 0.020) + [ 0 + 0 ] + - location: 11 (just consumed gas: 0.035) + [ 0 ] + - location: 13 (just consumed gas: 0.010) + [ True ] + - location: 14 (just consumed gas: 0) + [ ] + - location: 14 (just consumed gas: 0.015) + [ ] + - location: 20 (just consumed gas: 0.010) + [ Unit ] + - location: 21 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..383c4be37403 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add.tz--storage125992234--input125992234-.out @@ -0,0 +1,211 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 68.449) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ Unit ] + - location: 8 (just consumed gas: 0.010) + [ 2 + Unit ] + - location: 11 (just consumed gas: 0.010) + [ 2 + 2 + Unit ] + - location: 14 (just consumed gas: 0.035) + [ 4 + Unit ] + - location: 15 (just consumed gas: 0.010) + [ 4 + 4 + Unit ] + - location: 20 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 21 (just consumed gas: 0.010) + [ True + Unit ] + - location: 22 (just consumed gas: 0) + [ Unit ] + - location: 22 (just consumed gas: 0.015) + [ Unit ] + - location: 28 (just consumed gas: 0.010) + [ 2 + Unit ] + - location: 31 (just consumed gas: 0.010) + [ 2 + 2 + Unit ] + - location: 34 (just consumed gas: 0.035) + [ 4 + Unit ] + - location: 35 (just consumed gas: 0.010) + [ 4 + 4 + Unit ] + - location: 40 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 41 (just consumed gas: 0.010) + [ True + Unit ] + - location: 42 (just consumed gas: 0) + [ Unit ] + - location: 42 (just consumed gas: 0.015) + [ Unit ] + - location: 48 (just consumed gas: 0.010) + [ 2 + Unit ] + - location: 51 (just consumed gas: 0.010) + [ 2 + 2 + Unit ] + - location: 54 (just consumed gas: 0.035) + [ 4 + Unit ] + - location: 55 (just consumed gas: 0.010) + [ 4 + 4 + Unit ] + - location: 60 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 61 (just consumed gas: 0.010) + [ True + Unit ] + - location: 62 (just consumed gas: 0) + [ Unit ] + - location: 62 (just consumed gas: 0.015) + [ Unit ] + - location: 68 (just consumed gas: 0.010) + [ 2 + Unit ] + - location: 71 (just consumed gas: 0.010) + [ 2 + 2 + Unit ] + - location: 74 (just consumed gas: 0.035) + [ 4 + Unit ] + - location: 75 (just consumed gas: 0.010) + [ 4 + 4 + Unit ] + - location: 80 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 81 (just consumed gas: 0.010) + [ True + Unit ] + - location: 82 (just consumed gas: 0) + [ Unit ] + - location: 82 (just consumed gas: 0.015) + [ Unit ] + - location: 88 (just consumed gas: 0.010) + [ 2 + Unit ] + - location: 91 (just consumed gas: 0.010) + [ 2 + 2 + Unit ] + - location: 94 (just consumed gas: 0.035) + [ 4 + Unit ] + - location: 95 (just consumed gas: 0.010) + [ 4 + 4 + Unit ] + - location: 100 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 101 (just consumed gas: 0.010) + [ True + Unit ] + - location: 102 (just consumed gas: 0) + [ Unit ] + - location: 102 (just consumed gas: 0.015) + [ Unit ] + - location: 108 (just consumed gas: 0.010) + [ 60 + Unit ] + - location: 111 (just consumed gas: 0.010) + [ "2019-09-09T12:08:37Z" + 60 + Unit ] + - location: 114 (just consumed gas: 0.037) + [ "2019-09-09T12:09:37Z" + Unit ] + - location: 115 (just consumed gas: 0.010) + [ "2019-09-09T12:09:37Z" + "2019-09-09T12:09:37Z" + Unit ] + - location: 120 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 121 (just consumed gas: 0.010) + [ True + Unit ] + - location: 122 (just consumed gas: 0) + [ Unit ] + - location: 122 (just consumed gas: 0.015) + [ Unit ] + - location: 128 (just consumed gas: 0.010) + [ "2019-09-09T12:08:37Z" + Unit ] + - location: 131 (just consumed gas: 0.010) + [ 60 + "2019-09-09T12:08:37Z" + Unit ] + - location: 134 (just consumed gas: 0.037) + [ "2019-09-09T12:09:37Z" + Unit ] + - location: 135 (just consumed gas: 0.010) + [ "2019-09-09T12:09:37Z" + "2019-09-09T12:09:37Z" + Unit ] + - location: 140 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 141 (just consumed gas: 0.010) + [ True + Unit ] + - location: 142 (just consumed gas: 0) + [ Unit ] + - location: 142 (just consumed gas: 0.015) + [ Unit ] + - location: 148 (just consumed gas: 0.010) + [ 1000 + Unit ] + - location: 151 (just consumed gas: 0.010) + [ 1000 + 1000 + Unit ] + - location: 154 (just consumed gas: 0.020) + [ 2000 + Unit ] + - location: 155 (just consumed gas: 0.010) + [ 2000 + 2000 + Unit ] + - location: 160 (just consumed gas: 0.035) + [ 0 + Unit ] + - location: 161 (just consumed gas: 0.010) + [ True + Unit ] + - location: 162 (just consumed gas: 0) + [ Unit ] + - location: 162 (just consumed gas: 0.015) + [ Unit ] + - location: 168 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 170 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input322109491-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input322109491-.out new file mode 100644 index 000000000000..801a9184a11b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input322109491-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_bls12_381_fr.tz on storage None and input 'Pair 0x01 0x00' --level 1 --trace-stack +storage + (Some 0x0100000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.381) + [ (Pair (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) + None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 11 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.030) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x0100000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input461261325-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input461261325-.out new file mode 100644 index 000000000000..7d5116173df0 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input461261325-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_bls12_381_fr.tz on storage None and input 'Pair 0x010000 0x010000' --level 1 --trace-stack +storage + (Some 0x0200000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.381) + [ (Pair (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0100000000000000000000000000000000000000000000000000000000000000) + None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 11 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.030) + [ 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 0x0200000000000000000000000000000000000000000000000000000000000000) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 0x0200000000000000000000000000000000000000000000000000000000000000) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x0200000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input530006774-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input530006774-.out new file mode 100644 index 000000000000..65c1896d7027 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input530006774-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_bls12_381_fr.tz on storage None and input 'Pair 0x010000 0x00' --level 1 --trace-stack +storage + (Some 0x0100000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.381) + [ (Pair (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) + None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 11 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.030) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x0100000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input712570300-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input712570300-.out new file mode 100644 index 000000000000..7ccc90af3328 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_bls12_381_fr.tz--storage921624073--input712570300-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_bls12_381_fr.tz on storage None and input 'Pair 0x00 0x00' --level 1 --trace-stack +storage + (Some 0x0000000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.381) + [ (Pair (Pair 0x0000000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) + None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0x0000000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 11 (just consumed gas: 0.010) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.030) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x0000000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input249636002-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input249636002-.out new file mode 100644 index 000000000000..7e07be17c257 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input249636002-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_delta_timestamp.tz on storage None and input '(Pair 100 100)' --level 1 --trace-stack +storage + (Some "1970-01-01T00:03:20Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.232) + [ (Pair (Pair 100 "1970-01-01T00:01:40Z") None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 100 "1970-01-01T00:01:40Z") ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 100 "1970-01-01T00:01:40Z") + (Pair 100 "1970-01-01T00:01:40Z") ] + - location: 12 (just consumed gas: 0.010) + [ 100 + (Pair 100 "1970-01-01T00:01:40Z") ] + - location: 13 (just consumed gas: 0) + [ (Pair 100 "1970-01-01T00:01:40Z") ] + - location: 15 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" ] + - location: 13 (just consumed gas: 0.025) + [ 100 + "1970-01-01T00:01:40Z" ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:03:20Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:03:20Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:03:20Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:03:20Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input267363182-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input267363182-.out new file mode 100644 index 000000000000..8a503d00339c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input267363182-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_delta_timestamp.tz on storage None and input '(Pair -100 100)' --level 1 --trace-stack +storage + (Some "1970-01-01T00:00:00Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.232) + [ (Pair (Pair -100 "1970-01-01T00:01:40Z") None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair -100 "1970-01-01T00:01:40Z") ] + - location: 11 (just consumed gas: 0.010) + [ (Pair -100 "1970-01-01T00:01:40Z") + (Pair -100 "1970-01-01T00:01:40Z") ] + - location: 12 (just consumed gas: 0.010) + [ -100 + (Pair -100 "1970-01-01T00:01:40Z") ] + - location: 13 (just consumed gas: 0) + [ (Pair -100 "1970-01-01T00:01:40Z") ] + - location: 15 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" ] + - location: 13 (just consumed gas: 0.025) + [ -100 + "1970-01-01T00:01:40Z" ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:00:00Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:00:00Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:00:00Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:00:00Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input438561129-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input438561129-.out new file mode 100644 index 000000000000..ea0de0ac4c6f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_delta_timestamp.tz--storage921624073--input438561129-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_delta_timestamp.tz on storage None and input '(Pair 0 "1970-01-01T00:00:00Z")' --level 1 --trace-stack +storage + (Some "1970-01-01T00:00:00Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.340) + [ (Pair (Pair 0 "1970-01-01T00:00:00Z") None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 "1970-01-01T00:00:00Z") ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 0 "1970-01-01T00:00:00Z") + (Pair 0 "1970-01-01T00:00:00Z") ] + - location: 12 (just consumed gas: 0.010) + [ 0 + (Pair 0 "1970-01-01T00:00:00Z") ] + - location: 13 (just consumed gas: 0) + [ (Pair 0 "1970-01-01T00:00:00Z") ] + - location: 15 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" ] + - location: 13 (just consumed gas: 0.025) + [ 0 + "1970-01-01T00:00:00Z" ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:00:00Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:00:00Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:00:00Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:00:00Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input249636002-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input249636002-.out new file mode 100644 index 000000000000..41e141e4d75a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input249636002-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_timestamp_delta.tz on storage None and input '(Pair 100 100)' --level 1 --trace-stack +storage + (Some "1970-01-01T00:03:20Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.232) + [ (Pair (Pair "1970-01-01T00:01:40Z" 100) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 100) + (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 12 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" + (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 13 (just consumed gas: 0) + [ (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 15 (just consumed gas: 0.010) + [ 100 ] + - location: 13 (just consumed gas: 0.025) + [ "1970-01-01T00:01:40Z" + 100 ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:03:20Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:03:20Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:03:20Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:03:20Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input307538219-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input307538219-.out new file mode 100644 index 000000000000..2175ddd83234 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input307538219-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_timestamp_delta.tz on storage None and input '(Pair 100 -100)' --level 1 --trace-stack +storage + (Some "1970-01-01T00:00:00Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.232) + [ (Pair (Pair "1970-01-01T00:01:40Z" -100) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" -100) + (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 12 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" + (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 13 (just consumed gas: 0) + [ (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 15 (just consumed gas: 0.010) + [ -100 ] + - location: 13 (just consumed gas: 0.025) + [ "1970-01-01T00:01:40Z" + -100 ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:00:00Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:00:00Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:00:00Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:00:00Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input373737581-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input373737581-.out new file mode 100644 index 000000000000..c44041d83e9b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -add_timestamp_delta.tz--storage921624073--input373737581-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/add_timestamp_delta.tz on storage None and input '(Pair "1970-01-01T00:00:00Z" 0)' --level 1 --trace-stack +storage + (Some "1970-01-01T00:00:00Z") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.340) + [ (Pair (Pair "1970-01-01T00:00:00Z" 0) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" 0) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" 0) + (Pair "1970-01-01T00:00:00Z" 0) ] + - location: 12 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" + (Pair "1970-01-01T00:00:00Z" 0) ] + - location: 13 (just consumed gas: 0) + [ (Pair "1970-01-01T00:00:00Z" 0) ] + - location: 15 (just consumed gas: 0.010) + [ 0 ] + - location: 13 (just consumed gas: 0.025) + [ "1970-01-01T00:00:00Z" + 0 ] + - location: 16 (just consumed gas: 0.035) + [ "1970-01-01T00:00:00Z" ] + - location: 17 (just consumed gas: 0.010) + [ (Some "1970-01-01T00:00:00Z") ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Some "1970-01-01T00:00:00Z") ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some "1970-01-01T00:00:00Z")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -address.tz--storage921624073--input117475800-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -address.tz--storage921624073--input117475800-.out new file mode 100644 index 000000000000..414107ef8ed3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -address.tz--storage921624073--input117475800-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/address.tz on storage None and input '"tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5"' --level 1 --trace-stack +storage + (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 8.761) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" None) ] + - location: 9 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 10 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 11 (just consumed gas: 0.010) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 12 (just consumed gas: 0.010) + [ {} + (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input106930123-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input106930123-.out new file mode 100644 index 000000000000..64f198c6c805 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input106930123-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and.tz on storage None and input '(Pair False True)' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 7.572) + [ (Pair (Pair False True) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair False True) ] + - location: 11 (just consumed gas: 0.010) + [ False + True ] + - location: 12 (just consumed gas: 0.010) + [ False ] + - location: 13 (just consumed gas: 0.010) + [ (Some False) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input181204719-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input181204719-.out new file mode 100644 index 000000000000..8ecf05160ffc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input181204719-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and.tz on storage None and input '(Pair True False)' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 7.572) + [ (Pair (Pair True False) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair True False) ] + - location: 11 (just consumed gas: 0.010) + [ True + False ] + - location: 12 (just consumed gas: 0.010) + [ False ] + - location: 13 (just consumed gas: 0.010) + [ (Some False) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input223774825-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input223774825-.out new file mode 100644 index 000000000000..7089c0ec55c8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input223774825-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and.tz on storage None and input '(Pair False False)' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 7.572) + [ (Pair (Pair False False) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair False False) ] + - location: 11 (just consumed gas: 0.010) + [ False + False ] + - location: 12 (just consumed gas: 0.010) + [ False ] + - location: 13 (just consumed gas: 0.010) + [ (Some False) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input908807505-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input908807505-.out new file mode 100644 index 000000000000..c18d23249df8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and.tz--storage921624073--input908807505-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and.tz on storage None and input '(Pair True True)' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 7.572) + [ (Pair (Pair True True) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair True True) ] + - location: 11 (just consumed gas: 0.010) + [ True + True ] + - location: 12 (just consumed gas: 0.010) + [ True ] + - location: 13 (just consumed gas: 0.010) + [ (Some True) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_binary.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_binary.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..a3d37c0aa232 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_binary.tz--storage125992234--input125992234-.out @@ -0,0 +1,93 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_binary.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 36.249) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 5 ] + - location: 11 (just consumed gas: 0.010) + [ 6 + 5 ] + - location: 14 (just consumed gas: 0.035) + [ 4 ] + - location: 15 (just consumed gas: 0.010) + [ 4 + 4 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 6 ] + - location: 31 (just consumed gas: 0.010) + [ 5 + 6 ] + - location: 34 (just consumed gas: 0.035) + [ 4 ] + - location: 35 (just consumed gas: 0.010) + [ 4 + 4 ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 12 ] + - location: 51 (just consumed gas: 0.010) + [ -1 + 12 ] + - location: 54 (just consumed gas: 0.035) + [ 12 ] + - location: 55 (just consumed gas: 0.010) + [ 12 + 12 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ 12 ] + - location: 71 (just consumed gas: 0.010) + [ -5 + 12 ] + - location: 74 (just consumed gas: 0.035) + [ 8 ] + - location: 75 (just consumed gas: 0.010) + [ 8 + 8 ] + - location: 80 (just consumed gas: 0.035) + [ 0 ] + - location: 81 (just consumed gas: 0.010) + [ True ] + - location: 82 (just consumed gas: 0) + [ ] + - location: 82 (just consumed gas: 0.015) + [ ] + - location: 88 (just consumed gas: 0.010) + [ Unit ] + - location: 89 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 91 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..3763605993a2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,75 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 28.329) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0x05 ] + - location: 11 (just consumed gas: 0.010) + [ 0x06 + 0x05 ] + - location: 14 (just consumed gas: 0.030) + [ 0x04 ] + - location: 15 (just consumed gas: 0.010) + [ 0x04 + 0x04 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 0x0005 ] + - location: 31 (just consumed gas: 0.010) + [ 0x0106 + 0x0005 ] + - location: 34 (just consumed gas: 0.031) + [ 0x0004 ] + - location: 35 (just consumed gas: 0.010) + [ 0x0004 + 0x0004 ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 0x05 ] + - location: 51 (just consumed gas: 0.010) + [ 0x0106 + 0x05 ] + - location: 54 (just consumed gas: 0.030) + [ 0x04 ] + - location: 55 (just consumed gas: 0.010) + [ 0x04 + 0x04 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ Unit ] + - location: 69 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 71 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input106930123-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input106930123-.out new file mode 100644 index 000000000000..7dfd56889463 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input106930123-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_logical_1.tz on storage False and input '(Pair False True)' --level 1 --trace-stack +storage + False +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.366) + [ (Pair (Pair False True) False) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair False True) ] + - location: 10 (just consumed gas: 0.010) + [ False + True ] + - location: 11 (just consumed gas: 0.010) + [ False ] + - location: 12 (just consumed gas: 0.010) + [ {} + False ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} False) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input181204719-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input181204719-.out new file mode 100644 index 000000000000..4f2a376d00bd --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input181204719-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_logical_1.tz on storage False and input '(Pair True False)' --level 1 --trace-stack +storage + False +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.366) + [ (Pair (Pair True False) False) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair True False) ] + - location: 10 (just consumed gas: 0.010) + [ True + False ] + - location: 11 (just consumed gas: 0.010) + [ False ] + - location: 12 (just consumed gas: 0.010) + [ {} + False ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} False) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input223774825-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input223774825-.out new file mode 100644 index 000000000000..992755753053 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input223774825-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_logical_1.tz on storage False and input '(Pair False False)' --level 1 --trace-stack +storage + False +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.366) + [ (Pair (Pair False False) False) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair False False) ] + - location: 10 (just consumed gas: 0.010) + [ False + False ] + - location: 11 (just consumed gas: 0.010) + [ False ] + - location: 12 (just consumed gas: 0.010) + [ {} + False ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} False) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input908807505-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input908807505-.out new file mode 100644 index 000000000000..aa5bdfc806eb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -and_logical_1.tz--storage570553153--input908807505-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/and_logical_1.tz on storage False and input '(Pair True True)' --level 1 --trace-stack +storage + True +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.366) + [ (Pair (Pair True True) False) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair True True) ] + - location: 10 (just consumed gas: 0.010) + [ True + True ] + - location: 11 (just consumed gas: 0.010) + [ True ] + - location: 12 (just consumed gas: 0.010) + [ {} + True ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} True) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -balance.tz--storage492856247--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -balance.tz--storage492856247--input125992234-.out new file mode 100644 index 000000000000..5a88f2a8caac --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -balance.tz--storage492856247--input125992234-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/balance.tz on storage 111 and input Unit --level 1 --trace-stack +storage + 4000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 111) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 4000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 4000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 4000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage495706788--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage495706788--input453441034-.out new file mode 100644 index 000000000000..f39e66fb98ac --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage495706788--input453441034-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair {} None)' and input 1 --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) +trace + - location: 12 (just consumed gas: 9.936) + [ (Pair 1 {} None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair {} None) ] + - location: 13 (just consumed gas: 0) + [ (Pair {} None) ] + - location: 15 (just consumed gas: 0.010) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.025) + [ 1 + {} + {} ] + - location: 17 (just consumed gas: 0.720) + [ False + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + {} ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair {} (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input453441034-.out new file mode 100644 index 000000000000..4e2949633f1a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input453441034-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 1 --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) + Set map(4)[1] to 4 + Set map(4)[2] to 11 +trace + - location: 12 (just consumed gas: 11.838) + [ (Pair 1 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.723) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input564400327-.out new file mode 100644 index 000000000000..a5c3a2c5784e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input564400327-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 2 --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) + Set map(4)[1] to 4 + Set map(4)[2] to 11 +trace + - location: 12 (just consumed gas: 11.838) + [ (Pair 2 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 2 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 2 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.723) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input654274102-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input654274102-.out new file mode 100644 index 000000000000..1b9cb5101ab8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage56274299--input654274102-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 3 --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) + Set map(4)[1] to 4 + Set map(4)[2] to 11 +trace + - location: 12 (just consumed gas: 11.838) + [ (Pair 3 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 3 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 3 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.723) + [ False + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage690637660--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage690637660--input453441034-.out new file mode 100644 index 000000000000..195854ddd154 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage690637660--input453441034-.out @@ -0,0 +1,43 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair { Elt 1 0 } None)' and input 1 --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) + Set map(4)[1] to 0 +trace + - location: 12 (just consumed gas: 10.868) + [ (Pair 1 { Elt 1 0 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 1 0 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 0 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 0 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 1 0 } + { Elt 1 0 } ] + - location: 17 (just consumed gas: 0.722) + [ True + { Elt 1 0 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 0 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 0 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 0 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 0 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 0 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage806237530--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage806237530--input453441034-.out new file mode 100644 index 000000000000..402f5f82c00f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_nat.tz--storage806237530--input453441034-.out @@ -0,0 +1,43 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_nat.tz on storage '(Pair { Elt 0 1 } None)' and input 1 --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map nat nat) + Set map(4)[0] to 1 +trace + - location: 12 (just consumed gas: 10.843) + [ (Pair 1 { Elt 0 1 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 0 1 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 0 1 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 0 1 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 0 1 } + { Elt 0 1 } ] + - location: 17 (just consumed gas: 0.722) + [ False + { Elt 0 1 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt 0 1 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 0 1 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 0 1 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 0 1 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 0 1 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input1071610051-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input1071610051-.out new file mode 100644 index 000000000000..3693f574af02 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input1071610051-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"baz"' --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["bar"] to 4 + Set map(4)["foo"] to 11 +trace + - location: 12 (just consumed gas: 11.994) + [ (Pair "baz" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "baz" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "baz" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.735) + [ False + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input700475845-.out new file mode 100644 index 000000000000..0d8ef824163e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input700475845-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["bar"] to 4 + Set map(4)["foo"] to 11 +trace + - location: 12 (just consumed gas: 11.994) + [ (Pair "bar" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.735) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input905318451-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input905318451-.out new file mode 100644 index 000000000000..0cddd71ff8b7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage109689253--input905318451-.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"foo"' --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["bar"] to 4 + Set map(4)["foo"] to 11 +trace + - location: 12 (just consumed gas: 11.994) + [ (Pair "foo" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "foo" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "foo" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.735) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage495706788--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage495706788--input700475845-.out new file mode 100644 index 000000000000..0dcddfb76d9c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage495706788--input700475845-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair {} None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) +trace + - location: 12 (just consumed gas: 9.980) + [ (Pair "bar" {} None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair {} None) ] + - location: 13 (just consumed gas: 0) + [ (Pair {} None) ] + - location: 15 (just consumed gas: 0.010) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + {} + {} ] + - location: 17 (just consumed gas: 0.732) + [ False + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + {} ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair {} (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage915708427--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage915708427--input700475845-.out new file mode 100644 index 000000000000..d51c86524f4e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage915708427--input700475845-.out @@ -0,0 +1,43 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair { Elt "foo" 1 } None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair 4 (Some False)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["foo"] to 1 +trace + - location: 12 (just consumed gas: 10.968) + [ (Pair "bar" { Elt "foo" 1 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair { Elt "foo" 1 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "foo" 1 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "foo" 1 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 17 (just consumed gas: 0.734) + [ False + { Elt "foo" 1 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt "foo" 1 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 1 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "foo" 1 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 1 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage936682951--input905318451-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage936682951--input905318451-.out new file mode 100644 index 000000000000..629ba97136fa --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -big_map_mem_string.tz--storage936682951--input905318451-.out @@ -0,0 +1,43 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/big_map_mem_string.tz on storage '(Pair { Elt "foo" 0 } None)' and input '"foo"' --level 1 --trace-stack +storage + (Pair 4 (Some True)) +emitted operations + +big_map diff + New map(4) of type (big_map string nat) + Set map(4)["foo"] to 0 +trace + - location: 12 (just consumed gas: 10.968) + [ (Pair "foo" { Elt "foo" 0 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "foo" + (Pair { Elt "foo" 0 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "foo" 0 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "foo" 0 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 13 (just consumed gas: 0.025) + [ "foo" + { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 17 (just consumed gas: 0.734) + [ True + { Elt "foo" 0 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "foo" 0 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "foo" 0 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 0 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "foo" 0 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 0 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_bytes_not_padded.tz--storage921624073--input1.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_bytes_not_padded.tz--storage921624073--input1.out new file mode 100644 index 000000000000..9bb065bf0d8b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_bytes_not_padded.tz--storage921624073--input1.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz on storage None and input Unit --level 1 --trace-stack +storage + (Some 0x0000000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.634) + [ (Pair Unit None) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Some 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 13 (just consumed gas: 0.010) + [ {} + (Some 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x0000000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_nat.tz--storage921624073--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_nat.tz--storage921624073--input125992234-.out new file mode 100644 index 000000000000..d8c100415bc9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_push_nat.tz--storage921624073--input125992234-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz on storage None and input Unit --level 1 --trace-stack +storage + (Some 0x1000000000000000000000000000000000000000000000000000000000000000) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.634) + [ (Pair Unit None) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ 0x1000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Some 0x1000000000000000000000000000000000000000000000000000000000000000) ] + - location: 13 (just consumed gas: 0.010) + [ {} + (Some 0x1000000000000000000000000000000000000000000000000000000000000000) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair {} + (Some 0x1000000000000000000000000000000000000000000000000000000000000000)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input1043734173-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input1043734173-.out new file mode 100644 index 000000000000..e86b7205e920 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input1043734173-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz on storage 0 and input 0x01 --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0x0100000000000000000000000000000000000000000000000000000000000000 0) ] + - location: 7 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.115) + [ 1 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input151303925-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input151303925-.out new file mode 100644 index 000000000000..a198fc1296ba --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input151303925-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz on storage 0 and input 0x00 --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0x0000000000000000000000000000000000000000000000000000000000000000 0) ] + - location: 7 (just consumed gas: 0.010) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.115) + [ 0 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input520610122-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input520610122-.out new file mode 100644 index 000000000000..6fa41914906a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input520610122-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz on storage 0 and input 0xb9e8abf8dc324a010007addde986fe0f7c81fab16d26819d0534b7691c0b0719 --level 1 --trace-stack +storage + 11320265829256585830781521966149529460476767408210445238902869222031333517497 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0xb9e8abf8dc324a010007addde986fe0f7c81fab16d26819d0534b7691c0b0719 0) ] + - location: 7 (just consumed gas: 0.010) + [ 0xb9e8abf8dc324a010007addde986fe0f7c81fab16d26819d0534b7691c0b0719 ] + - location: 8 (just consumed gas: 0.115) + [ 11320265829256585830781521966149529460476767408210445238902869222031333517497 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 11320265829256585830781521966149529460476767408210445238902869222031333517497 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} + 11320265829256585830781521966149529460476767408210445238902869222031333517497) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input558805129-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input558805129-.out new file mode 100644 index 000000000000..6522dc0fc6e9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_int.tz--storage680650890--input558805129-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz on storage 0 and input 0x28db8e57af88d9576acd181b89f24e50a89a6423f939026ed91349fc9af16c27 --level 1 --trace-stack +storage + 17832688077013577776524784494464728518213913213412866604053735695200962927400 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0x28db8e57af88d9576acd181b89f24e50a89a6423f939026ed91349fc9af16c27 0) ] + - location: 7 (just consumed gas: 0.010) + [ 0x28db8e57af88d9576acd181b89f24e50a89a6423f939026ed91349fc9af16c27 ] + - location: 8 (just consumed gas: 0.115) + [ 17832688077013577776524784494464728518213913213412866604053735695200962927400 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 17832688077013577776524784494464728518213913213412866604053735695200962927400 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} + 17832688077013577776524784494464728518213913213412866604053735695200962927400) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_mutez.tz--storage680650890--input229402968-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_mutez.tz--storage680650890--input229402968-.out new file mode 100644 index 000000000000..a1abd3b3bd6f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_to_mutez.tz--storage680650890--input229402968-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz on storage 0 and input 0x10 --level 1 --trace-stack +storage + 16 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 9.316) + [ (Pair 0x1000000000000000000000000000000000000000000000000000000000000000 0) ] + - location: 7 (just consumed gas: 0.010) + [ 0x1000000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.115) + [ 16 ] + - location: 9 (just consumed gas: 0.010) + [ (Some 16) ] + - location: 11 (just consumed gas: 0) + [ 16 ] + - location: 11 (just consumed gas: 0.015) + [ 16 ] + - location: 17 (just consumed gas: 0.010) + [ 1 + 16 ] + - location: 20 (just consumed gas: 0) + [ 16 ] + - location: 21 (just consumed gas: 0.010) + [ {} + 16 ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} 16) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage287336412--input1019409032-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage287336412--input1019409032-.out new file mode 100644 index 000000000000..88091ca18be6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage287336412--input1019409032-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f and input 22620284817922784902564672469917992996328211127984472897491698543785655336309 --level 1 --trace-stack +storage + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f) ] + - location: 7 (just consumed gas: 0.010) + [ 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f ] + - location: 8 (just consumed gas: 0.299) + [ 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage698210250--input949526473-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage698210250--input949526473-.out new file mode 100644 index 000000000000..e2e26f3d2b31 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage698210250--input949526473-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f and input 33644916630334844239120348434626468649534186770809802792596996408934105684394 --level 1 --trace-stack +storage + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f) ] + - location: 7 (just consumed gas: 0.010) + [ 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f ] + - location: 8 (just consumed gas: 0.299) + [ 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input166435292-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input166435292-.out new file mode 100644 index 000000000000..cd8f07e78d08 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input166435292-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 69615968247920749285624776342583898043608129789011377475114141186797415307882 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input583291483-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input583291483-.out new file mode 100644 index 000000000000..c392f22431ca --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage739946440--input583291483-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 17180093072794558806177035834397932205917577288483739652510482486858834123369 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input1055524890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input1055524890-.out new file mode 100644 index 000000000000..6498b52137eb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input1055524890-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 52435875175126190479447740508185965837690552500527637822603658699938581184514 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.299) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input453441034-.out new file mode 100644 index 000000000000..d6679b31af48 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input453441034-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 1 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input564400327-.out new file mode 100644 index 000000000000..7ac78767e0ef --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input564400327-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 2 --level 1 --trace-stack +storage + 0x0200000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 2 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 2 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0200000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input585234482-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input585234482-.out new file mode 100644 index 000000000000..2a986001c3d1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input585234482-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input -42 --level 1 --trace-stack +storage + 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair -42 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ -42 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input680650890-.out new file mode 100644 index 000000000000..f7fc1a465c4e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input680650890-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 0 --level 1 --trace-stack +storage + 0x0000000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 0 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.265) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0000000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input701858804-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input701858804-.out new file mode 100644 index 000000000000..4e8053a31c17 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_int.tz--storage994282947--input701858804-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input -1 --level 1 --trace-stack +storage + 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair -1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ -1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage287336412--input1019409032-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage287336412--input1019409032-.out new file mode 100644 index 000000000000..7b80b4cf719b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage287336412--input1019409032-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f and input 22620284817922784902564672469917992996328211127984472897491698543785655336309 --level 1 --trace-stack +storage + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f) ] + - location: 7 (just consumed gas: 0.010) + [ 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f ] + - location: 8 (just consumed gas: 0.299) + [ 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage698210250--input949526473-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage698210250--input949526473-.out new file mode 100644 index 000000000000..b0adb38011ec --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage698210250--input949526473-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f and input 33644916630334844239120348434626468649534186770809802792596996408934105684394 --level 1 --trace-stack +storage + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f) ] + - location: 7 (just consumed gas: 0.010) + [ 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f ] + - location: 8 (just consumed gas: 0.299) + [ 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input166435292-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input166435292-.out new file mode 100644 index 000000000000..dc4ce03942cb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input166435292-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 69615968247920749285624776342583898043608129789011377475114141186797415307882 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input583291483-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input583291483-.out new file mode 100644 index 000000000000..c38ce26632c1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage739946440--input583291483-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 17180093072794558806177035834397932205917577288483739652510482486858834123369 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input1055524890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input1055524890-.out new file mode 100644 index 000000000000..065686b19d67 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input1055524890-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 52435875175126190479447740508185965837690552500527637822603658699938581184514 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.299) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input453441034-.out new file mode 100644 index 000000000000..ca5205702472 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input453441034-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 1 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input564400327-.out new file mode 100644 index 000000000000..28ce3b90187a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input564400327-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 2 --level 1 --trace-stack +storage + 0x0200000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 2 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 2 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.266) + [ 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0200000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input680650890-.out new file mode 100644 index 000000000000..c02b99059b3f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_fr_z_nat.tz--storage994282947--input680650890-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 0 --level 1 --trace-stack +storage + 0x0000000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.387) + [ (Pair 0 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 0 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.265) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 0x0000000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage287336412--input1019409032-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage287336412--input1019409032-.out new file mode 100644 index 000000000000..b25ce8043685 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage287336412--input1019409032-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f and input 22620284817922784902564672469917992996328211127984472897491698543785655336309 --level 1 --trace-stack +storage + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f) ] + - location: 7 (just consumed gas: 0.010) + [ 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f ] + - location: 8 (just consumed gas: 0.010) + [ 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f + 22620284817922784902564672469917992996328211127984472897491698543785655336309 ] + - location: 9 (just consumed gas: 0.299) + [ 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage698210250--input949526473-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage698210250--input949526473-.out new file mode 100644 index 000000000000..04db33389ad9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage698210250--input949526473-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f and input 33644916630334844239120348434626468649534186770809802792596996408934105684394 --level 1 --trace-stack +storage + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f) ] + - location: 7 (just consumed gas: 0.010) + [ 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f ] + - location: 8 (just consumed gas: 0.010) + [ 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f + 33644916630334844239120348434626468649534186770809802792596996408934105684394 ] + - location: 9 (just consumed gas: 0.299) + [ 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input166435292-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input166435292-.out new file mode 100644 index 000000000000..bb9cec1b2306 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input166435292-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 69615968247920749285624776342583898043608129789011377475114141186797415307882 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.010) + [ 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d + 69615968247920749285624776342583898043608129789011377475114141186797415307882 ] + - location: 9 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input583291483-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input583291483-.out new file mode 100644 index 000000000000..8999960077da --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage739946440--input583291483-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 17180093072794558806177035834397932205917577288483739652510482486858834123369 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.010) + [ 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d + 17180093072794558806177035834397932205917577288483739652510482486858834123369 ] + - location: 9 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input1055524890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input1055524890-.out new file mode 100644 index 000000000000..b88993dde3b5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input1055524890-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 52435875175126190479447740508185965837690552500527637822603658699938581184514 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 52435875175126190479447740508185965837690552500527637822603658699938581184514 ] + - location: 9 (just consumed gas: 0.299) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input453441034-.out new file mode 100644 index 000000000000..d01558104779 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input453441034-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 1 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 1 ] + - location: 9 (just consumed gas: 0.266) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input564400327-.out new file mode 100644 index 000000000000..435cd108e987 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input564400327-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 2 --level 1 --trace-stack +storage + 0x0200000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 2 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 2 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 2 ] + - location: 9 (just consumed gas: 0.266) + [ 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0200000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input585234482-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input585234482-.out new file mode 100644 index 000000000000..3bf61a9bb08a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input585234482-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input -42 --level 1 --trace-stack +storage + 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair -42 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ -42 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + -42 ] + - location: 9 (just consumed gas: 0.266) + [ 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xd7fffffffefffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input680650890-.out new file mode 100644 index 000000000000..8caa1227378f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input680650890-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 0 --level 1 --trace-stack +storage + 0x0000000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 0 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 0 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 0 ] + - location: 9 (just consumed gas: 0.265) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0000000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input701858804-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input701858804-.out new file mode 100644 index 000000000000..0843750216d4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_int.tz--storage994282947--input701858804-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input -1 --level 1 --trace-stack +storage + 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair -1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ -1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + -1 ] + - location: 9 (just consumed gas: 0.266) + [ 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x00000000fffffffffe5bfeff02a4bd5305d8a10908d83933487d9d2953a7ed73) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage287336412--input1019409032-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage287336412--input1019409032-.out new file mode 100644 index 000000000000..0c1570da709c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage287336412--input1019409032-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f and input 22620284817922784902564672469917992996328211127984472897491698543785655336309 --level 1 --trace-stack +storage + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f) ] + - location: 7 (just consumed gas: 0.010) + [ 22620284817922784902564672469917992996328211127984472897491698543785655336309 + 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f ] + - location: 8 (just consumed gas: 0.010) + [ 0x4147a5ad0a633e4880d2296f08ec5c12d03e3fa4a6b49ecbd16a30a3cfcdbe3f + 22620284817922784902564672469917992996328211127984472897491698543785655336309 ] + - location: 9 (just consumed gas: 0.299) + [ 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x4e387e0ebfb3d1633153c195036e0c0b672955c4a0e420f93ec20a76fe677c62) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage698210250--input949526473-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage698210250--input949526473-.out new file mode 100644 index 000000000000..288fe68551bc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage698210250--input949526473-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f and input 33644916630334844239120348434626468649534186770809802792596996408934105684394 --level 1 --trace-stack +storage + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f) ] + - location: 7 (just consumed gas: 0.010) + [ 33644916630334844239120348434626468649534186770809802792596996408934105684394 + 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f ] + - location: 8 (just consumed gas: 0.010) + [ 0x5b0ecd0fa853810e356f1eb79721e80b30510fcc3a455f4fc02fdd9a90c5401f + 33644916630334844239120348434626468649534186770809802792596996408934105684394 ] + - location: 9 (just consumed gas: 0.299) + [ 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x2ef123703093cbbbd124e15f2054fa5781ed0b8d092ec3c6e5d76b4ca918a221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input166435292-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input166435292-.out new file mode 100644 index 000000000000..785b38ad3dbe --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input166435292-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 69615968247920749285624776342583898043608129789011377475114141186797415307882 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 69615968247920749285624776342583898043608129789011377475114141186797415307882 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.010) + [ 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d + 69615968247920749285624776342583898043608129789011377475114141186797415307882 ] + - location: 9 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input583291483-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input583291483-.out new file mode 100644 index 000000000000..c4200f5f09e3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage739946440--input583291483-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d and input 17180093072794558806177035834397932205917577288483739652510482486858834123369 --level 1 --trace-stack +storage + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d) ] + - location: 7 (just consumed gas: 0.010) + [ 17180093072794558806177035834397932205917577288483739652510482486858834123369 + 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d ] + - location: 8 (just consumed gas: 0.010) + [ 0x8578be1766f92cd82c5e5135c374a03a8562e263ea953a3f9711b0153b7fcf2d + 17180093072794558806177035834397932205917577288483739652510482486858834123369 ] + - location: 9 (just consumed gas: 0.299) + [ 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xfaa60dacea8e26112e524d379720fe4f95fbc5a26f1b1a67e229e26ddecbf221) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input1055524890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input1055524890-.out new file mode 100644 index 000000000000..06e472886f24 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input1055524890-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 52435875175126190479447740508185965837690552500527637822603658699938581184514 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 52435875175126190479447740508185965837690552500527637822603658699938581184514 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 52435875175126190479447740508185965837690552500527637822603658699938581184514 ] + - location: 9 (just consumed gas: 0.299) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input453441034-.out new file mode 100644 index 000000000000..54664b454744 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input453441034-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 1 --level 1 --trace-stack +storage + 0x0100000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 1 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 1 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 1 ] + - location: 9 (just consumed gas: 0.266) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0100000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input564400327-.out new file mode 100644 index 000000000000..08973385e698 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input564400327-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 2 --level 1 --trace-stack +storage + 0x0200000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 2 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 2 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 2 ] + - location: 9 (just consumed gas: 0.266) + [ 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0200000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0200000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input680650890-.out new file mode 100644 index 000000000000..ee7a603fa9ee --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bls12_381_z_fr_nat.tz--storage994282947--input680650890-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz on storage 0x0100000000000000000000000000000000000000000000000000000000000000 and input 0 --level 1 --trace-stack +storage + 0x0000000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.940) + [ (Pair 0 0x0100000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 0 + 0x0100000000000000000000000000000000000000000000000000000000000000 ] + - location: 8 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 0 ] + - location: 9 (just consumed gas: 0.265) + [ 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x0000000000000000000000000000000000000000000000000000000000000000 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x0000000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_int.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_int.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..e79e8bf56b73 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_int.tz--storage125992234--input125992234-.out @@ -0,0 +1,261 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bytes_of_int.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 118.175) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0 ] + - location: 11 (just consumed gas: 0.070) + [ 0x ] + - location: 12 (just consumed gas: 0.010) + [ 0x + 0x ] + - location: 17 (just consumed gas: 0.035) + [ 0 ] + - location: 18 (just consumed gas: 0.010) + [ True ] + - location: 19 (just consumed gas: 0) + [ ] + - location: 19 (just consumed gas: 0.015) + [ ] + - location: 25 (just consumed gas: 0.010) + [ 1 ] + - location: 28 (just consumed gas: 0.072) + [ 0x01 ] + - location: 29 (just consumed gas: 0.010) + [ 0x01 + 0x01 ] + - location: 34 (just consumed gas: 0.035) + [ 0 ] + - location: 35 (just consumed gas: 0.010) + [ True ] + - location: 36 (just consumed gas: 0) + [ ] + - location: 36 (just consumed gas: 0.015) + [ ] + - location: 42 (just consumed gas: 0.010) + [ 1193046 ] + - location: 45 (just consumed gas: 0.076) + [ 0x123456 ] + - location: 46 (just consumed gas: 0.010) + [ 0x123456 + 0x123456 ] + - location: 51 (just consumed gas: 0.035) + [ 0 ] + - location: 52 (just consumed gas: 0.010) + [ True ] + - location: 53 (just consumed gas: 0) + [ ] + - location: 53 (just consumed gas: 0.015) + [ ] + - location: 59 (just consumed gas: 0.010) + [ 0x123456 ] + - location: 62 (just consumed gas: 0.036) + [ 1193046 ] + - location: 63 (just consumed gas: 0.010) + [ 1193046 + 1193046 ] + - location: 68 (just consumed gas: 0.035) + [ 0 ] + - location: 69 (just consumed gas: 0.010) + [ True ] + - location: 70 (just consumed gas: 0) + [ ] + - location: 70 (just consumed gas: 0.015) + [ ] + - location: 76 (just consumed gas: 0.010) + [ 0x0000123456 ] + - location: 79 (just consumed gas: 0.040) + [ 1193046 ] + - location: 80 (just consumed gas: 0.010) + [ 1193046 + 1193046 ] + - location: 85 (just consumed gas: 0.035) + [ 0 ] + - location: 86 (just consumed gas: 0.010) + [ True ] + - location: 87 (just consumed gas: 0) + [ ] + - location: 87 (just consumed gas: 0.015) + [ ] + - location: 93 (just consumed gas: 0.010) + [ 0x ] + - location: 96 (just consumed gas: 0.030) + [ 0 ] + - location: 97 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 102 (just consumed gas: 0.035) + [ 0 ] + - location: 103 (just consumed gas: 0.010) + [ True ] + - location: 104 (just consumed gas: 0) + [ ] + - location: 104 (just consumed gas: 0.015) + [ ] + - location: 110 (just consumed gas: 0.010) + [ 0x0000 ] + - location: 113 (just consumed gas: 0.034) + [ 0 ] + - location: 114 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 119 (just consumed gas: 0.035) + [ 0 ] + - location: 120 (just consumed gas: 0.010) + [ True ] + - location: 121 (just consumed gas: 0) + [ ] + - location: 121 (just consumed gas: 0.015) + [ ] + - location: 127 (just consumed gas: 0.010) + [ -128 ] + - location: 130 (just consumed gas: 0.072) + [ 0x80 ] + - location: 131 (just consumed gas: 0.010) + [ 0x80 + 0x80 ] + - location: 136 (just consumed gas: 0.035) + [ 0 ] + - location: 137 (just consumed gas: 0.010) + [ True ] + - location: 138 (just consumed gas: 0) + [ ] + - location: 138 (just consumed gas: 0.015) + [ ] + - location: 144 (just consumed gas: 0.010) + [ -129 ] + - location: 147 (just consumed gas: 0.072) + [ 0xff7f ] + - location: 148 (just consumed gas: 0.010) + [ 0xff7f + 0xff7f ] + - location: 153 (just consumed gas: 0.035) + [ 0 ] + - location: 154 (just consumed gas: 0.010) + [ True ] + - location: 155 (just consumed gas: 0) + [ ] + - location: 155 (just consumed gas: 0.015) + [ ] + - location: 161 (just consumed gas: 0.010) + [ -33024 ] + - location: 164 (just consumed gas: 0.074) + [ 0xff7f00 ] + - location: 165 (just consumed gas: 0.010) + [ 0xff7f00 + 0xff7f00 ] + - location: 170 (just consumed gas: 0.035) + [ 0 ] + - location: 171 (just consumed gas: 0.010) + [ True ] + - location: 172 (just consumed gas: 0) + [ ] + - location: 172 (just consumed gas: 0.015) + [ ] + - location: 178 (just consumed gas: 0.010) + [ -4294967296 ] + - location: 181 (just consumed gas: 0.081) + [ 0xff00000000 ] + - location: 182 (just consumed gas: 0.010) + [ 0xff00000000 + 0xff00000000 ] + - location: 187 (just consumed gas: 0.035) + [ 0 ] + - location: 188 (just consumed gas: 0.010) + [ True ] + - location: 189 (just consumed gas: 0) + [ ] + - location: 189 (just consumed gas: 0.015) + [ ] + - location: 195 (just consumed gas: 0.010) + [ 0x80 ] + - location: 198 (just consumed gas: 0.032) + [ -128 ] + - location: 199 (just consumed gas: 0.010) + [ -128 + -128 ] + - location: 204 (just consumed gas: 0.035) + [ 0 ] + - location: 205 (just consumed gas: 0.010) + [ True ] + - location: 206 (just consumed gas: 0) + [ ] + - location: 206 (just consumed gas: 0.015) + [ ] + - location: 212 (just consumed gas: 0.010) + [ 0xff7f ] + - location: 215 (just consumed gas: 0.034) + [ -129 ] + - location: 216 (just consumed gas: 0.010) + [ -129 + -129 ] + - location: 221 (just consumed gas: 0.035) + [ 0 ] + - location: 222 (just consumed gas: 0.010) + [ True ] + - location: 223 (just consumed gas: 0) + [ ] + - location: 223 (just consumed gas: 0.015) + [ ] + - location: 229 (just consumed gas: 0.010) + [ 0xff7f00 ] + - location: 232 (just consumed gas: 0.036) + [ -33024 ] + - location: 233 (just consumed gas: 0.010) + [ -33024 + -33024 ] + - location: 238 (just consumed gas: 0.035) + [ 0 ] + - location: 239 (just consumed gas: 0.010) + [ True ] + - location: 240 (just consumed gas: 0) + [ ] + - location: 240 (just consumed gas: 0.015) + [ ] + - location: 246 (just consumed gas: 0.010) + [ 0xffffff7f00 ] + - location: 249 (just consumed gas: 0.040) + [ -33024 ] + - location: 250 (just consumed gas: 0.010) + [ -33024 + -33024 ] + - location: 255 (just consumed gas: 0.035) + [ 0 ] + - location: 256 (just consumed gas: 0.010) + [ True ] + - location: 257 (just consumed gas: 0) + [ ] + - location: 257 (just consumed gas: 0.015) + [ ] + - location: 263 (just consumed gas: 0.010) + [ 0xff00000000 ] + - location: 266 (just consumed gas: 0.040) + [ -4294967296 ] + - location: 267 (just consumed gas: 0.010) + [ -4294967296 + -4294967296 ] + - location: 272 (just consumed gas: 0.035) + [ 0 ] + - location: 273 (just consumed gas: 0.010) + [ True ] + - location: 274 (just consumed gas: 0) + [ ] + - location: 274 (just consumed gas: 0.015) + [ ] + - location: 280 (just consumed gas: 0.010) + [ Unit ] + - location: 281 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 283 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_nat.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_nat.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..47e14dcd5541 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -bytes_of_nat.tz--storage125992234--input125992234-.out @@ -0,0 +1,126 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/bytes_of_nat.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 53.702) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0 ] + - location: 11 (just consumed gas: 0.070) + [ 0x ] + - location: 12 (just consumed gas: 0.010) + [ 0x + 0x ] + - location: 17 (just consumed gas: 0.035) + [ 0 ] + - location: 18 (just consumed gas: 0.010) + [ True ] + - location: 19 (just consumed gas: 0) + [ ] + - location: 19 (just consumed gas: 0.015) + [ ] + - location: 25 (just consumed gas: 0.010) + [ 1 ] + - location: 28 (just consumed gas: 0.072) + [ 0x01 ] + - location: 29 (just consumed gas: 0.010) + [ 0x01 + 0x01 ] + - location: 34 (just consumed gas: 0.035) + [ 0 ] + - location: 35 (just consumed gas: 0.010) + [ True ] + - location: 36 (just consumed gas: 0) + [ ] + - location: 36 (just consumed gas: 0.015) + [ ] + - location: 42 (just consumed gas: 0.010) + [ 1193046 ] + - location: 45 (just consumed gas: 0.076) + [ 0x123456 ] + - location: 46 (just consumed gas: 0.010) + [ 0x123456 + 0x123456 ] + - location: 51 (just consumed gas: 0.035) + [ 0 ] + - location: 52 (just consumed gas: 0.010) + [ True ] + - location: 53 (just consumed gas: 0) + [ ] + - location: 53 (just consumed gas: 0.015) + [ ] + - location: 59 (just consumed gas: 0.010) + [ 0x123456 ] + - location: 62 (just consumed gas: 0.036) + [ 1193046 ] + - location: 63 (just consumed gas: 0.010) + [ 1193046 + 1193046 ] + - location: 68 (just consumed gas: 0.035) + [ 0 ] + - location: 69 (just consumed gas: 0.010) + [ True ] + - location: 70 (just consumed gas: 0) + [ ] + - location: 70 (just consumed gas: 0.015) + [ ] + - location: 76 (just consumed gas: 0.010) + [ 0x0000123456 ] + - location: 79 (just consumed gas: 0.040) + [ 1193046 ] + - location: 80 (just consumed gas: 0.010) + [ 1193046 + 1193046 ] + - location: 85 (just consumed gas: 0.035) + [ 0 ] + - location: 86 (just consumed gas: 0.010) + [ True ] + - location: 87 (just consumed gas: 0) + [ ] + - location: 87 (just consumed gas: 0.015) + [ ] + - location: 93 (just consumed gas: 0.010) + [ 0x ] + - location: 96 (just consumed gas: 0.030) + [ 0 ] + - location: 97 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 102 (just consumed gas: 0.035) + [ 0 ] + - location: 103 (just consumed gas: 0.010) + [ True ] + - location: 104 (just consumed gas: 0) + [ ] + - location: 104 (just consumed gas: 0.015) + [ ] + - location: 110 (just consumed gas: 0.010) + [ 0x0000 ] + - location: 113 (just consumed gas: 0.034) + [ 0 ] + - location: 114 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 119 (just consumed gas: 0.035) + [ 0 ] + - location: 120 (just consumed gas: 0.010) + [ True ] + - location: 121 (just consumed gas: 0) + [ ] + - location: 121 (just consumed gas: 0.015) + [ ] + - location: 127 (just consumed gas: 0.010) + [ Unit ] + - location: 128 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 130 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -car.tz--storage680650890--input783124233-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -car.tz--storage680650890--input783124233-.out new file mode 100644 index 000000000000..0a6e8374d59e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -car.tz--storage680650890--input783124233-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/car.tz on storage 0 and input '(Pair 34 17)' --level 1 --trace-stack +storage + 34 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.723) + [ (Pair (Pair 34 17) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair 34 17) ] + - location: 10 (just consumed gas: 0.010) + [ 34 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 34 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 34) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cdr.tz--storage680650890--input783124233-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cdr.tz--storage680650890--input783124233-.out new file mode 100644 index 000000000000..ca39e725b472 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cdr.tz--storage680650890--input783124233-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/cdr.tz on storage 0 and input '(Pair 34 17)' --level 1 --trace-stack +storage + 17 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.723) + [ (Pair (Pair 34 17) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair 34 17) ] + - location: 10 (just consumed gas: 0.010) + [ 17 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 17 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 17) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage109160754--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage109160754--input125992234-.out new file mode 100644 index 000000000000..e84a6c95ad8c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage109160754--input125992234-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/chain_id_store.tz on storage '(Some 0x7a06a770)' and input Unit --level 1 --trace-stack +storage + (Some "NetXynUjJNZm7wi") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.203) + [ (Pair Unit (Some "NetXdQprcVkpaWU")) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.015) + [ "NetXynUjJNZm7wi" ] + - location: 10 (just consumed gas: 0.010) + [ (Some "NetXynUjJNZm7wi") ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some "NetXynUjJNZm7wi") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some "NetXynUjJNZm7wi")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage921624073--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage921624073--input125992234-.out new file mode 100644 index 000000000000..56d242a2dd7e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage921624073--input125992234-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/chain_id_store.tz on storage None and input Unit --level 1 --trace-stack +storage + (Some "NetXynUjJNZm7wi") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair Unit None) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.015) + [ "NetXynUjJNZm7wi" ] + - location: 10 (just consumed gas: 0.010) + [ (Some "NetXynUjJNZm7wi") ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some "NetXynUjJNZm7wi") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some "NetXynUjJNZm7wi")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage981066851--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage981066851--input125992234-.out new file mode 100644 index 000000000000..1313e03cf5d9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -chain_id_store.tz--storage981066851--input125992234-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/chain_id_store.tz on storage '(Some "NetXynUjJNZm7wi")' and input Unit --level 1 --trace-stack +storage + (Some "NetXynUjJNZm7wi") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 6.753) + [ (Pair Unit (Some "NetXynUjJNZm7wi")) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.015) + [ "NetXynUjJNZm7wi" ] + - location: 10 (just consumed gas: 0.010) + [ (Some "NetXynUjJNZm7wi") ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some "NetXynUjJNZm7wi") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some "NetXynUjJNZm7wi")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-get.tz--storage125992234--input186507116-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-get.tz--storage125992234--input186507116-.out new file mode 100644 index 000000000000..7197efd6507d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-get.tz--storage125992234--input186507116-.out @@ -0,0 +1,123 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/comb-get.tz on storage Unit and input '(Pair 1 4 2 Unit)' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 43.348) + [ (Pair (Pair 1 4 2 Unit) Unit) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - location: 13 (just consumed gas: 0.010) + [ 1 + (Pair 1 4 2 Unit) ] + - location: 14 (just consumed gas: 0.010) + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - location: 19 (just consumed gas: 0.035) + [ 0 + (Pair 1 4 2 Unit) ] + - location: 20 (just consumed gas: 0.010) + [ True + (Pair 1 4 2 Unit) ] + - location: 21 (just consumed gas: 0) + [ (Pair 1 4 2 Unit) ] + - location: 21 (just consumed gas: 0.015) + [ (Pair 1 4 2 Unit) ] + - location: 27 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - location: 28 (just consumed gas: 0.020) + [ 1 + (Pair 1 4 2 Unit) ] + - location: 30 (just consumed gas: 0.010) + [ 1 + 1 + (Pair 1 4 2 Unit) ] + - location: 35 (just consumed gas: 0.035) + [ 0 + (Pair 1 4 2 Unit) ] + - location: 36 (just consumed gas: 0.010) + [ True + (Pair 1 4 2 Unit) ] + - location: 37 (just consumed gas: 0) + [ (Pair 1 4 2 Unit) ] + - location: 37 (just consumed gas: 0.015) + [ (Pair 1 4 2 Unit) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - location: 44 (just consumed gas: 0.021) + [ 4 + (Pair 1 4 2 Unit) ] + - location: 46 (just consumed gas: 0.010) + [ 4 + 4 + (Pair 1 4 2 Unit) ] + - location: 51 (just consumed gas: 0.035) + [ 0 + (Pair 1 4 2 Unit) ] + - location: 52 (just consumed gas: 0.010) + [ True + (Pair 1 4 2 Unit) ] + - location: 53 (just consumed gas: 0) + [ (Pair 1 4 2 Unit) ] + - location: 53 (just consumed gas: 0.015) + [ (Pair 1 4 2 Unit) ] + - location: 59 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - location: 60 (just consumed gas: 0.022) + [ 2 + (Pair 1 4 2 Unit) ] + - location: 62 (just consumed gas: 0.010) + [ 2 + 2 + (Pair 1 4 2 Unit) ] + - location: 67 (just consumed gas: 0.035) + [ 0 + (Pair 1 4 2 Unit) ] + - location: 68 (just consumed gas: 0.010) + [ True + (Pair 1 4 2 Unit) ] + - location: 69 (just consumed gas: 0) + [ (Pair 1 4 2 Unit) ] + - location: 69 (just consumed gas: 0.015) + [ (Pair 1 4 2 Unit) ] + - location: 75 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) + (Pair 1 4 2 Unit) ] + - location: 76 (just consumed gas: 0.023) + [ Unit + (Pair 1 4 2 Unit) ] + - location: 78 (just consumed gas: 0.010) + [ Unit + Unit + (Pair 1 4 2 Unit) ] + - location: 81 (just consumed gas: 0.010) + [ 0 + (Pair 1 4 2 Unit) ] + - location: 82 (just consumed gas: 0.010) + [ True + (Pair 1 4 2 Unit) ] + - location: 83 (just consumed gas: 0) + [ (Pair 1 4 2 Unit) ] + - location: 83 (just consumed gas: 0.015) + [ (Pair 1 4 2 Unit) ] + - location: 89 (just consumed gas: 0.010) + [ ] + - location: 90 (just consumed gas: 0.010) + [ Unit ] + - location: 91 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 93 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set-2.tz--storage921624073--input186507116-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set-2.tz--storage921624073--input186507116-.out new file mode 100644 index 000000000000..0e1332bf0feb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set-2.tz--storage921624073--input186507116-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/comb-set-2.tz on storage None and input '(Pair 1 4 2 Unit)' --level 1 --trace-stack +storage + (Some (Pair 2 4 "toto" 0x01)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 12.844) + [ (Pair (Pair 1 4 2 Unit) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) ] + - location: 17 (just consumed gas: 0.010) + [ 2 + (Pair 1 4 2 Unit) ] + - location: 20 (just consumed gas: 0.021) + [ (Pair 2 4 2 Unit) ] + - location: 22 (just consumed gas: 0.010) + [ "toto" + (Pair 2 4 2 Unit) ] + - location: 25 (just consumed gas: 0.026) + [ (Pair 2 4 "toto" Unit) ] + - location: 27 (just consumed gas: 0.010) + [ 0x01 + (Pair 2 4 "toto" Unit) ] + - location: 30 (just consumed gas: 0.027) + [ (Pair 2 4 "toto" 0x01) ] + - location: 32 (just consumed gas: 0.010) + [ (Some (Pair 2 4 "toto" 0x01)) ] + - location: 33 (just consumed gas: 0.010) + [ {} + (Some (Pair 2 4 "toto" 0x01)) ] + - location: 35 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair 2 4 "toto" 0x01))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set.tz--storage186507116--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set.tz--storage186507116--input125992234-.out new file mode 100644 index 000000000000..96ef7f968288 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb-set.tz--storage186507116--input125992234-.out @@ -0,0 +1,39 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/comb-set.tz on storage '(Pair 1 4 2 Unit)' and input Unit --level 1 --trace-stack +storage + (Pair 2 12 8 Unit) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 12.667) + [ (Pair Unit 1 4 2 Unit) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 1 4 2 Unit) ] + - location: 12 (just consumed gas: 0.010) + [ 2 + (Pair 1 4 2 Unit) ] + - location: 15 (just consumed gas: 0.021) + [ (Pair 2 4 2 Unit) ] + - location: 17 (just consumed gas: 0.010) + [ 12 + (Pair 2 4 2 Unit) ] + - location: 20 (just consumed gas: 0.023) + [ (Pair 2 12 2 Unit) ] + - location: 22 (just consumed gas: 0.010) + [ 8 + (Pair 2 12 2 Unit) ] + - location: 25 (just consumed gas: 0.026) + [ (Pair 2 12 8 Unit) ] + - location: 27 (just consumed gas: 0.010) + [ Unit + (Pair 2 12 8 Unit) ] + - location: 28 (just consumed gas: 0.027) + [ (Pair 2 12 8 Unit) ] + - location: 30 (just consumed gas: 0.010) + [ {} + (Pair 2 12 8 Unit) ] + - location: 32 (just consumed gas: 0.010) + [ (Pair {} 2 12 8 Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb.tz--storage950292965--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb.tz--storage950292965--input125992234-.out new file mode 100644 index 000000000000..3fc537822646 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comb.tz--storage950292965--input125992234-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/comb.tz on storage '(Pair 0 0 0)' and input Unit --level 1 --trace-stack +storage + (Pair 1 2 3) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.221) + [ (Pair Unit 0 0 0) ] + - location: 10 (just consumed gas: 0.010) + [ ] + - location: 11 (just consumed gas: 0.010) + [ 3 ] + - location: 14 (just consumed gas: 0.010) + [ 2 + 3 ] + - location: 17 (just consumed gas: 0.010) + [ 1 + 2 + 3 ] + - location: 20 (just consumed gas: 0.010) + [ {} + 1 + 2 + 3 ] + - location: 22 (just consumed gas: 0.014) + [ (Pair {} 1 2 3) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -compare.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -compare.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..d85a25585fc5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -compare.tz--storage125992234--input125992234-.out @@ -0,0 +1,398 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/compare.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 198.972) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ True ] + - location: 11 (just consumed gas: 0.010) + [ True + True ] + - location: 12 (just consumed gas: 0.035) + [ 0 ] + - location: 14 (just consumed gas: 0.010) + [ True ] + - location: 15 (just consumed gas: 0) + [ ] + - location: 15 (just consumed gas: 0.015) + [ ] + - location: 21 (just consumed gas: 0.010) + [ False ] + - location: 24 (just consumed gas: 0.010) + [ False + False ] + - location: 25 (just consumed gas: 0.035) + [ 0 ] + - location: 27 (just consumed gas: 0.010) + [ True ] + - location: 28 (just consumed gas: 0) + [ ] + - location: 28 (just consumed gas: 0.015) + [ ] + - location: 34 (just consumed gas: 0.010) + [ False ] + - location: 37 (just consumed gas: 0.010) + [ True + False ] + - location: 40 (just consumed gas: 0.035) + [ 1 ] + - location: 42 (just consumed gas: 0.010) + [ True ] + - location: 43 (just consumed gas: 0) + [ ] + - location: 43 (just consumed gas: 0.015) + [ ] + - location: 49 (just consumed gas: 0.010) + [ True ] + - location: 52 (just consumed gas: 0.010) + [ False + True ] + - location: 55 (just consumed gas: 0.035) + [ -1 ] + - location: 57 (just consumed gas: 0.010) + [ True ] + - location: 58 (just consumed gas: 0) + [ ] + - location: 58 (just consumed gas: 0.015) + [ ] + - location: 64 (just consumed gas: 0.010) + [ 0xaabbcc ] + - location: 67 (just consumed gas: 0.010) + [ 0xaabbcc + 0xaabbcc ] + - location: 68 (just consumed gas: 0.035) + [ 0 ] + - location: 70 (just consumed gas: 0.010) + [ True ] + - location: 71 (just consumed gas: 0) + [ ] + - location: 71 (just consumed gas: 0.015) + [ ] + - location: 77 (just consumed gas: 0.010) + [ 0x ] + - location: 80 (just consumed gas: 0.010) + [ 0x + 0x ] + - location: 83 (just consumed gas: 0.035) + [ 0 ] + - location: 85 (just consumed gas: 0.010) + [ True ] + - location: 86 (just consumed gas: 0) + [ ] + - location: 86 (just consumed gas: 0.015) + [ ] + - location: 92 (just consumed gas: 0.010) + [ 0x ] + - location: 95 (just consumed gas: 0.010) + [ 0x01 + 0x ] + - location: 98 (just consumed gas: 0.035) + [ 1 ] + - location: 100 (just consumed gas: 0.010) + [ True ] + - location: 101 (just consumed gas: 0) + [ ] + - location: 101 (just consumed gas: 0.015) + [ ] + - location: 107 (just consumed gas: 0.010) + [ 0x01 ] + - location: 110 (just consumed gas: 0.010) + [ 0x02 + 0x01 ] + - location: 113 (just consumed gas: 0.035) + [ 1 ] + - location: 115 (just consumed gas: 0.010) + [ True ] + - location: 116 (just consumed gas: 0) + [ ] + - location: 116 (just consumed gas: 0.015) + [ ] + - location: 122 (just consumed gas: 0.010) + [ 0x02 ] + - location: 125 (just consumed gas: 0.010) + [ 0x01 + 0x02 ] + - location: 128 (just consumed gas: 0.035) + [ -1 ] + - location: 130 (just consumed gas: 0.010) + [ True ] + - location: 131 (just consumed gas: 0) + [ ] + - location: 131 (just consumed gas: 0.015) + [ ] + - location: 137 (just consumed gas: 0.010) + [ 1 ] + - location: 140 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 141 (just consumed gas: 0.035) + [ 0 ] + - location: 143 (just consumed gas: 0.010) + [ True ] + - location: 144 (just consumed gas: 0) + [ ] + - location: 144 (just consumed gas: 0.015) + [ ] + - location: 150 (just consumed gas: 0.010) + [ 10 ] + - location: 153 (just consumed gas: 0.010) + [ 5 + 10 ] + - location: 156 (just consumed gas: 0.035) + [ -1 ] + - location: 158 (just consumed gas: 0.010) + [ True ] + - location: 159 (just consumed gas: 0) + [ ] + - location: 159 (just consumed gas: 0.015) + [ ] + - location: 165 (just consumed gas: 0.010) + [ -4 ] + - location: 168 (just consumed gas: 0.010) + [ 1923 + -4 ] + - location: 171 (just consumed gas: 0.035) + [ 1 ] + - location: 173 (just consumed gas: 0.010) + [ True ] + - location: 174 (just consumed gas: 0) + [ ] + - location: 174 (just consumed gas: 0.015) + [ ] + - location: 180 (just consumed gas: 0.010) + [ 1 ] + - location: 183 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 184 (just consumed gas: 0.035) + [ 0 ] + - location: 186 (just consumed gas: 0.010) + [ True ] + - location: 187 (just consumed gas: 0) + [ ] + - location: 187 (just consumed gas: 0.015) + [ ] + - location: 193 (just consumed gas: 0.010) + [ 10 ] + - location: 196 (just consumed gas: 0.010) + [ 5 + 10 ] + - location: 199 (just consumed gas: 0.035) + [ -1 ] + - location: 201 (just consumed gas: 0.010) + [ True ] + - location: 202 (just consumed gas: 0) + [ ] + - location: 202 (just consumed gas: 0.015) + [ ] + - location: 208 (just consumed gas: 0.010) + [ 4 ] + - location: 211 (just consumed gas: 0.010) + [ 1923 + 4 ] + - location: 214 (just consumed gas: 0.035) + [ 1 ] + - location: 216 (just consumed gas: 0.010) + [ True ] + - location: 217 (just consumed gas: 0) + [ ] + - location: 217 (just consumed gas: 0.015) + [ ] + - location: 223 (just consumed gas: 0.010) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 226 (just consumed gas: 0.010) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 227 (just consumed gas: 0.036) + [ 0 ] + - location: 229 (just consumed gas: 0.010) + [ True ] + - location: 230 (just consumed gas: 0) + [ ] + - location: 230 (just consumed gas: 0.015) + [ ] + - location: 236 (just consumed gas: 0.010) + [ "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" ] + - location: 239 (just consumed gas: 0.010) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" ] + - location: 242 (just consumed gas: 0.036) + [ -1 ] + - location: 244 (just consumed gas: 0.010) + [ True ] + - location: 245 (just consumed gas: 0) + [ ] + - location: 245 (just consumed gas: 0.015) + [ ] + - location: 251 (just consumed gas: 0.010) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 254 (just consumed gas: 0.010) + [ "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" + "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 257 (just consumed gas: 0.036) + [ 1 ] + - location: 259 (just consumed gas: 0.010) + [ True ] + - location: 260 (just consumed gas: 0) + [ ] + - location: 260 (just consumed gas: 0.015) + [ ] + - location: 266 (just consumed gas: 0.010) + [ 1 ] + - location: 269 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 270 (just consumed gas: 0.035) + [ 0 ] + - location: 272 (just consumed gas: 0.010) + [ True ] + - location: 273 (just consumed gas: 0) + [ ] + - location: 273 (just consumed gas: 0.015) + [ ] + - location: 279 (just consumed gas: 0.010) + [ 10 ] + - location: 282 (just consumed gas: 0.010) + [ 5 + 10 ] + - location: 285 (just consumed gas: 0.035) + [ -1 ] + - location: 287 (just consumed gas: 0.010) + [ True ] + - location: 288 (just consumed gas: 0) + [ ] + - location: 288 (just consumed gas: 0.015) + [ ] + - location: 294 (just consumed gas: 0.010) + [ 4 ] + - location: 297 (just consumed gas: 0.010) + [ 1923 + 4 ] + - location: 300 (just consumed gas: 0.035) + [ 1 ] + - location: 302 (just consumed gas: 0.010) + [ True ] + - location: 303 (just consumed gas: 0) + [ ] + - location: 303 (just consumed gas: 0.015) + [ ] + - location: 309 (just consumed gas: 0.010) + [ "AABBCC" ] + - location: 312 (just consumed gas: 0.010) + [ "AABBCC" + "AABBCC" ] + - location: 313 (just consumed gas: 0.035) + [ 0 ] + - location: 315 (just consumed gas: 0.010) + [ True ] + - location: 316 (just consumed gas: 0) + [ ] + - location: 316 (just consumed gas: 0.015) + [ ] + - location: 322 (just consumed gas: 0.010) + [ "" ] + - location: 325 (just consumed gas: 0.010) + [ "" + "" ] + - location: 328 (just consumed gas: 0.035) + [ 0 ] + - location: 330 (just consumed gas: 0.010) + [ True ] + - location: 331 (just consumed gas: 0) + [ ] + - location: 331 (just consumed gas: 0.015) + [ ] + - location: 337 (just consumed gas: 0.010) + [ "" ] + - location: 340 (just consumed gas: 0.010) + [ "a" + "" ] + - location: 343 (just consumed gas: 0.035) + [ 1 ] + - location: 345 (just consumed gas: 0.010) + [ True ] + - location: 346 (just consumed gas: 0) + [ ] + - location: 346 (just consumed gas: 0.015) + [ ] + - location: 352 (just consumed gas: 0.010) + [ "a" ] + - location: 355 (just consumed gas: 0.010) + [ "b" + "a" ] + - location: 358 (just consumed gas: 0.035) + [ 1 ] + - location: 360 (just consumed gas: 0.010) + [ True ] + - location: 361 (just consumed gas: 0) + [ ] + - location: 361 (just consumed gas: 0.015) + [ ] + - location: 367 (just consumed gas: 0.010) + [ "b" ] + - location: 370 (just consumed gas: 0.010) + [ "a" + "b" ] + - location: 373 (just consumed gas: 0.035) + [ -1 ] + - location: 375 (just consumed gas: 0.010) + [ True ] + - location: 376 (just consumed gas: 0) + [ ] + - location: 376 (just consumed gas: 0.015) + [ ] + - location: 382 (just consumed gas: 0.010) + [ "2019-09-16T08:38:05Z" ] + - location: 385 (just consumed gas: 0.010) + [ "2019-09-16T08:38:05Z" + "2019-09-16T08:38:05Z" ] + - location: 386 (just consumed gas: 0.035) + [ 0 ] + - location: 388 (just consumed gas: 0.010) + [ True ] + - location: 389 (just consumed gas: 0) + [ ] + - location: 389 (just consumed gas: 0.015) + [ ] + - location: 395 (just consumed gas: 0.010) + [ "2017-09-16T08:38:04Z" ] + - location: 398 (just consumed gas: 0.010) + [ "2019-09-16T08:38:05Z" + "2017-09-16T08:38:04Z" ] + - location: 401 (just consumed gas: 0.035) + [ 1 ] + - location: 403 (just consumed gas: 0.010) + [ True ] + - location: 404 (just consumed gas: 0) + [ ] + - location: 404 (just consumed gas: 0.015) + [ ] + - location: 410 (just consumed gas: 0.010) + [ "2019-09-16T08:38:05Z" ] + - location: 413 (just consumed gas: 0.010) + [ "2019-09-16T08:38:04Z" + "2019-09-16T08:38:05Z" ] + - location: 416 (just consumed gas: 0.035) + [ -1 ] + - location: 418 (just consumed gas: 0.010) + [ True ] + - location: 419 (just consumed gas: 0) + [ ] + - location: 419 (just consumed gas: 0.015) + [ ] + - location: 425 (just consumed gas: 0.010) + [ Unit ] + - location: 426 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 428 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comparisons.tz--storage457300675--input281780712-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comparisons.tz--storage457300675--input281780712-.out new file mode 100644 index 000000000000..4c3a16a7452f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -comparisons.tz--storage457300675--input281780712-.out @@ -0,0 +1,350 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/comparisons.tz on storage '{}' and input '{ -9999999; -1 ; 0 ; 1 ; 9999999 }' --level 1 --trace-stack +storage + { { False ; False ; False ; True ; True } ; + { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 29.633) + [ (Pair { -9999999 ; -1 ; 0 ; 1 ; 9999999 } {}) ] + - location: 10 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 11 (just consumed gas: 0.010) + [ {} + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 14 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 16 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0) + [ -9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 19 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0.015) + [ -1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 19 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0.015) + [ 0 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 19 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0.015) + [ 1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 19 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0.015) + [ 9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 19 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 17 (just consumed gas: 0.015) + [ { False ; False ; True ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 14 (just consumed gas: 0.025) + [ {} + { False ; False ; True ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 20 (just consumed gas: 0.010) + [ { False ; False ; True ; False ; False } + {} + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 21 (just consumed gas: 0.010) + [ { { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 22 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 24 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0) + [ -9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 27 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0.015) + [ -1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 27 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0.015) + [ 0 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 27 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0.015) + [ 1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 27 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0.015) + [ 9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 27 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 25 (just consumed gas: 0.015) + [ { True ; True ; False ; True ; True } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 22 (just consumed gas: 0.025) + [ { { False ; False ; True ; False ; False } } + { True ; True ; False ; True ; True } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 28 (just consumed gas: 0.010) + [ { True ; True ; False ; True ; True } + { { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 29 (just consumed gas: 0.010) + [ { { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 30 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 32 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0) + [ -9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 35 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0.015) + [ -1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 35 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0.015) + [ 0 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 35 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0.015) + [ 1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 35 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0.015) + [ 9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 35 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 33 (just consumed gas: 0.015) + [ { True ; True ; True ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 30 (just consumed gas: 0.025) + [ { { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { True ; True ; True ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 36 (just consumed gas: 0.010) + [ { True ; True ; True ; False ; False } + { { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 37 (just consumed gas: 0.010) + [ { { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 38 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 40 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0) + [ -9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 43 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0.015) + [ -1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 43 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0.015) + [ 0 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 43 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0.015) + [ 1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 43 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0.015) + [ 9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 43 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 41 (just consumed gas: 0.015) + [ { True ; True ; False ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 38 (just consumed gas: 0.025) + [ { { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { True ; True ; False ; False ; False } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 44 (just consumed gas: 0.010) + [ { True ; True ; False ; False ; False } + { { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 45 (just consumed gas: 0.010) + [ { { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 46 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 48 (just consumed gas: 0.010) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0) + [ -9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 51 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0.015) + [ -1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 51 (just consumed gas: 0.010) + [ False + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0.015) + [ 0 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 51 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0.015) + [ 1 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 51 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0.015) + [ 9999999 + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 51 (just consumed gas: 0.010) + [ True + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 49 (just consumed gas: 0.015) + [ { False ; False ; True ; True ; True } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 46 (just consumed gas: 0.025) + [ { { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { False ; False ; True ; True ; True } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 52 (just consumed gas: 0.010) + [ { False ; False ; True ; True ; True } + { { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 53 (just consumed gas: 0.010) + [ { { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 54 (just consumed gas: 0) + [ { -9999999 ; -1 ; 0 ; 1 ; 9999999 } ] + - location: 56 (just consumed gas: 0) + [ -9999999 ] + - location: 58 (just consumed gas: 0.010) + [ False ] + - location: 56 (just consumed gas: 0.015) + [ -1 ] + - location: 58 (just consumed gas: 0.010) + [ False ] + - location: 56 (just consumed gas: 0.015) + [ 0 ] + - location: 58 (just consumed gas: 0.010) + [ False ] + - location: 56 (just consumed gas: 0.015) + [ 1 ] + - location: 58 (just consumed gas: 0.010) + [ True ] + - location: 56 (just consumed gas: 0.015) + [ 9999999 ] + - location: 58 (just consumed gas: 0.010) + [ True ] + - location: 56 (just consumed gas: 0.015) + [ { False ; False ; False ; True ; True } ] + - location: 54 (just consumed gas: 0.025) + [ { { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } + { False ; False ; False ; True ; True } ] + - location: 59 (just consumed gas: 0.010) + [ { False ; False ; False ; True ; True } + { { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } ] + - location: 60 (just consumed gas: 0.010) + [ { { False ; False ; False ; True ; True } ; + { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } ] + - location: 61 (just consumed gas: 0.010) + [ {} + { { False ; False ; False ; True ; True } ; + { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } } ] + - location: 63 (just consumed gas: 0.010) + [ (Pair {} + { { False ; False ; False ; True ; True } ; + { False ; False ; True ; True ; True } ; + { True ; True ; False ; False ; False } ; + { True ; True ; True ; False ; False } ; + { True ; True ; False ; True ; True } ; + { False ; False ; True ; False ; False } }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input392583650-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input392583650-.out new file mode 100644 index 000000000000..e0c3cc8b10df --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input392583650-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello.tz on storage '{}' and input '{ "test1" ; "test2" }' --level 1 --trace-stack +storage + { "Hello test1" ; "Hello test2" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.769) + [ (Pair { "test1" ; "test2" } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { "test1" ; "test2" } ] + - location: 10 (just consumed gas: 0) + [ "test1" ] + - location: 12 (just consumed gas: 0.010) + [ "Hello " + "test1" ] + - location: 15 (just consumed gas: 0.050) + [ "Hello test1" ] + - location: 10 (just consumed gas: 0.015) + [ "test2" ] + - location: 12 (just consumed gas: 0.010) + [ "Hello " + "test2" ] + - location: 15 (just consumed gas: 0.050) + [ "Hello test2" ] + - location: 10 (just consumed gas: 0.015) + [ { "Hello test1" ; "Hello test2" } ] + - location: 16 (just consumed gas: 0.010) + [ {} + { "Hello test1" ; "Hello test2" } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} { "Hello test1" ; "Hello test2" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input457300675-.out new file mode 100644 index 000000000000..c6158f63e745 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello.tz on storage '{}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.441) + [ (Pair {} {}) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input640104625-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input640104625-.out new file mode 100644 index 000000000000..0a191efec0de --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello.tz--storage457300675--input640104625-.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello.tz on storage '{}' and input '{ "World!" }' --level 1 --trace-stack +storage + { "Hello World!" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.615) + [ (Pair { "World!" } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { "World!" } ] + - location: 10 (just consumed gas: 0) + [ "World!" ] + - location: 12 (just consumed gas: 0.010) + [ "Hello " + "World!" ] + - location: 15 (just consumed gas: 0.051) + [ "Hello World!" ] + - location: 10 (just consumed gas: 0.015) + [ { "Hello World!" } ] + - location: 16 (just consumed gas: 0.010) + [ {} + { "Hello World!" } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} { "Hello World!" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input354091714-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input354091714-.out new file mode 100644 index 000000000000..7136734009e4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input354091714-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello_bytes.tz on storage '{}' and input '{ 0xab ; 0xcd }' --level 1 --trace-stack +storage + { 0xffab ; 0xffcd } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.522) + [ (Pair { 0xab ; 0xcd } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { 0xab ; 0xcd } ] + - location: 10 (just consumed gas: 0) + [ 0xab ] + - location: 12 (just consumed gas: 0.010) + [ 0xff + 0xab ] + - location: 15 (just consumed gas: 0.046) + [ 0xffab ] + - location: 10 (just consumed gas: 0.015) + [ 0xcd ] + - location: 12 (just consumed gas: 0.010) + [ 0xff + 0xcd ] + - location: 15 (just consumed gas: 0.046) + [ 0xffcd ] + - location: 10 (just consumed gas: 0.015) + [ { 0xffab ; 0xffcd } ] + - location: 16 (just consumed gas: 0.010) + [ {} + { 0xffab ; 0xffcd } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} { 0xffab ; 0xffcd }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input441061063-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input441061063-.out new file mode 100644 index 000000000000..e8140e338d09 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input441061063-.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello_bytes.tz on storage '{}' and input '{ 0xcd }' --level 1 --trace-stack +storage + { 0xffcd } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.422) + [ (Pair { 0xcd } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { 0xcd } ] + - location: 10 (just consumed gas: 0) + [ 0xcd ] + - location: 12 (just consumed gas: 0.010) + [ 0xff + 0xcd ] + - location: 15 (just consumed gas: 0.046) + [ 0xffcd ] + - location: 10 (just consumed gas: 0.015) + [ { 0xffcd } ] + - location: 16 (just consumed gas: 0.010) + [ {} + { 0xffcd } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} { 0xffcd }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input457300675-.out new file mode 100644 index 000000000000..60c349141cd3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_hello_bytes.tz--storage457300675--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_hello_bytes.tz on storage '{}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.322) + [ (Pair {} {}) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input264787654-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input264787654-.out new file mode 100644 index 000000000000..6b86ee655229 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input264787654-.out @@ -0,0 +1,96 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_list.tz on storage '""' and input '{ "a" ; "b" ; "c" }' --level 1 --trace-stack +storage + "abc" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 10.864) + [ (Pair { "a" ; "b" ; "c" } "") ] + - location: 8 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 9 (just consumed gas: 0.010) + [ "" + { "a" ; "b" ; "c" } ] + - location: 12 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } + "" ] + - location: 13 (just consumed gas: 0) + [ "a" + "" ] + - location: 15 (just consumed gas: 0.010) + [ "" + "a" ] + - location: 16 (just consumed gas: 0) + [ "a" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "a" ] + - location: 20 (just consumed gas: 0.010) + [ "a" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "a" } ] + - location: 16 (just consumed gas: 0.025) + [ "" + { "a" } ] + - location: 22 (just consumed gas: 0.010) + [ { "" ; "a" } ] + - location: 23 (just consumed gas: 0.120) + [ "a" ] + - location: 13 (just consumed gas: 0.015) + [ "b" + "a" ] + - location: 15 (just consumed gas: 0.010) + [ "a" + "b" ] + - location: 16 (just consumed gas: 0) + [ "b" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "b" ] + - location: 20 (just consumed gas: 0.010) + [ "b" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "b" } ] + - location: 16 (just consumed gas: 0.025) + [ "a" + { "b" } ] + - location: 22 (just consumed gas: 0.010) + [ { "a" ; "b" } ] + - location: 23 (just consumed gas: 0.121) + [ "ab" ] + - location: 13 (just consumed gas: 0.015) + [ "c" + "ab" ] + - location: 15 (just consumed gas: 0.010) + [ "ab" + "c" ] + - location: 16 (just consumed gas: 0) + [ "c" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "c" ] + - location: 20 (just consumed gas: 0.010) + [ "c" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "c" } ] + - location: 16 (just consumed gas: 0.025) + [ "ab" + { "c" } ] + - location: 22 (just consumed gas: 0.010) + [ { "ab" ; "c" } ] + - location: 23 (just consumed gas: 0.121) + [ "abc" ] + - location: 13 (just consumed gas: 0.015) + [ "abc" ] + - location: 24 (just consumed gas: 0.010) + [ {} + "abc" ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} "abc") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input316676251-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input316676251-.out new file mode 100644 index 000000000000..27974f26669a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input316676251-.out @@ -0,0 +1,119 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_list.tz on storage '""' and input '{ "Hello" ; " " ; "World" ; "!" }' --level 1 --trace-stack +storage + "Hello World!" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 11.068) + [ (Pair { "Hello" ; " " ; "World" ; "!" } "") ] + - location: 8 (just consumed gas: 0.010) + [ { "Hello" ; " " ; "World" ; "!" } ] + - location: 9 (just consumed gas: 0.010) + [ "" + { "Hello" ; " " ; "World" ; "!" } ] + - location: 12 (just consumed gas: 0.010) + [ { "Hello" ; " " ; "World" ; "!" } + "" ] + - location: 13 (just consumed gas: 0) + [ "Hello" + "" ] + - location: 15 (just consumed gas: 0.010) + [ "" + "Hello" ] + - location: 16 (just consumed gas: 0) + [ "Hello" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "Hello" ] + - location: 20 (just consumed gas: 0.010) + [ "Hello" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "Hello" } ] + - location: 16 (just consumed gas: 0.025) + [ "" + { "Hello" } ] + - location: 22 (just consumed gas: 0.010) + [ { "" ; "Hello" } ] + - location: 23 (just consumed gas: 0.122) + [ "Hello" ] + - location: 13 (just consumed gas: 0.015) + [ " " + "Hello" ] + - location: 15 (just consumed gas: 0.010) + [ "Hello" + " " ] + - location: 16 (just consumed gas: 0) + [ " " ] + - location: 18 (just consumed gas: 0.010) + [ {} + " " ] + - location: 20 (just consumed gas: 0.010) + [ " " + {} ] + - location: 21 (just consumed gas: 0.010) + [ { " " } ] + - location: 16 (just consumed gas: 0.025) + [ "Hello" + { " " } ] + - location: 22 (just consumed gas: 0.010) + [ { "Hello" ; " " } ] + - location: 23 (just consumed gas: 0.123) + [ "Hello " ] + - location: 13 (just consumed gas: 0.015) + [ "World" + "Hello " ] + - location: 15 (just consumed gas: 0.010) + [ "Hello " + "World" ] + - location: 16 (just consumed gas: 0) + [ "World" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "World" ] + - location: 20 (just consumed gas: 0.010) + [ "World" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "World" } ] + - location: 16 (just consumed gas: 0.025) + [ "Hello " + { "World" } ] + - location: 22 (just consumed gas: 0.010) + [ { "Hello " ; "World" } ] + - location: 23 (just consumed gas: 0.125) + [ "Hello World" ] + - location: 13 (just consumed gas: 0.015) + [ "!" + "Hello World" ] + - location: 15 (just consumed gas: 0.010) + [ "Hello World" + "!" ] + - location: 16 (just consumed gas: 0) + [ "!" ] + - location: 18 (just consumed gas: 0.010) + [ {} + "!" ] + - location: 20 (just consumed gas: 0.010) + [ "!" + {} ] + - location: 21 (just consumed gas: 0.010) + [ { "!" } ] + - location: 16 (just consumed gas: 0.025) + [ "Hello World" + { "!" } ] + - location: 22 (just consumed gas: 0.010) + [ { "Hello World" ; "!" } ] + - location: 23 (just consumed gas: 0.126) + [ "Hello World!" ] + - location: 13 (just consumed gas: 0.015) + [ "Hello World!" ] + - location: 24 (just consumed gas: 0.010) + [ {} + "Hello World!" ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} "Hello World!") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input457300675-.out new file mode 100644 index 000000000000..b362fa4e3184 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -concat_list.tz--storage79230375--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/concat_list.tz on storage '""' and input '{}' --level 1 --trace-stack +storage + "" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 10.492) + [ (Pair {} "") ] + - location: 8 (just consumed gas: 0.010) + [ {} ] + - location: 9 (just consumed gas: 0.010) + [ "" + {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + "" ] + - location: 13 (just consumed gas: 0) + [ "" ] + - location: 24 (just consumed gas: 0.010) + [ {} + "" ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} "") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage457300675--input798141440-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage457300675--input798141440-.out new file mode 100644 index 000000000000..8d62fa10d387 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage457300675--input798141440-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/cons.tz on storage '{}' and input 10 --level 1 --trace-stack +storage + { 10 } +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.560) + [ (Pair 10 {}) ] + - location: 8 (just consumed gas: 0.010) + [ 10 + {} ] + - location: 9 (just consumed gas: 0.010) + [ { 10 } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { 10 } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { 10 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage581876226--input166122047-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage581876226--input166122047-.out new file mode 100644 index 000000000000..d83301aa549e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage581876226--input166122047-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/cons.tz on storage '{ 10 }' and input -5 --level 1 --trace-stack +storage + { -5 ; 10 } +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.660) + [ (Pair -5 { 10 }) ] + - location: 8 (just consumed gas: 0.010) + [ -5 + { 10 } ] + - location: 9 (just consumed gas: 0.010) + [ { -5 ; 10 } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { -5 ; 10 } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { -5 ; 10 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage793461282--input781487591-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage793461282--input781487591-.out new file mode 100644 index 000000000000..e63eacdbb413 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -cons.tz--storage793461282--input781487591-.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/cons.tz on storage '{ -5 ; 10 }' and input 99 --level 1 --trace-stack +storage + { 99 ; -5 ; 10 } +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.760) + [ (Pair 99 { -5 ; 10 }) ] + - location: 8 (just consumed gas: 0.010) + [ 99 + { -5 ; 10 } ] + - location: 9 (just consumed gas: 0.010) + [ { 99 ; -5 ; 10 } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { 99 ; -5 ; 10 } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { 99 ; -5 ; 10 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input315650912-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input315650912-.out new file mode 100644 index 000000000000..75db7b837635 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input315650912-.out @@ -0,0 +1,166 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair { "B" } { "B" })' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.251) + [ (Pair (Pair { "B" } { "B" }) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { "B" } { "B" }) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "B" } { "B" }) + (Pair { "B" } { "B" }) ] + - location: 14 (just consumed gas: 0.010) + [ { "B" } + (Pair { "B" } { "B" }) ] + - location: 15 (just consumed gas: 0) + [ (Pair { "B" } { "B" }) ] + - location: 17 (just consumed gas: 0.010) + [ { "B" } ] + - location: 15 (just consumed gas: 0.025) + [ { "B" } + { "B" } ] + - location: 18 (just consumed gas: 0.300) + [ {} + { "B" } + { "B" } ] + - location: 20 (just consumed gas: 0.010) + [ { "B" } + {} + { "B" } ] + - location: 21 (just consumed gas: 0) + [ "B" + {} + { "B" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "B" {}) + { "B" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "B" {}) + (Pair "B" {}) + { "B" } ] + - location: 25 (just consumed gas: 0.010) + [ "B" + (Pair "B" {}) + { "B" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "B" {}) + { "B" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "B" } ] + - location: 26 (just consumed gas: 0.025) + [ "B" + {} + { "B" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "B" + {} + { "B" } ] + - location: 32 (just consumed gas: 0.010) + [ "B" + True + {} + { "B" } ] + - location: 33 (just consumed gas: 0.132) + [ { "B" } + { "B" } ] + - location: 21 (just consumed gas: 0.015) + [ { "B" } + { "B" } ] + - location: 34 (just consumed gas: 0.010) + [ True + { "B" } + { "B" } ] + - location: 37 (just consumed gas: 0.010) + [ { "B" } + True + { "B" } ] + - location: 38 (just consumed gas: 0.010) + [ (Pair { "B" } True) + { "B" } ] + - location: 39 (just consumed gas: 0.010) + [ { "B" } + (Pair { "B" } True) ] + - location: 40 (just consumed gas: 0) + [ "B" + (Pair { "B" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "B" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "B" } True) + (Pair "B" { "B" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "B" } True) + (Pair "B" { "B" } True) + (Pair "B" { "B" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "B" } True) + (Pair "B" { "B" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "B" } True) + (Pair "B" { "B" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" } True) + (Pair "B" { "B" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" } + (Pair "B" { "B" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "B" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" } + { "B" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "B" } + { "B" } + True ] + - location: 57 (just consumed gas: 0.117) + [ True + { "B" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" } True) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair { "B" } True) ] + - location: 64 (just consumed gas: 0.010) + [ True ] + - location: 65 (just consumed gas: 0.010) + [ (Some True) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input51111414-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input51111414-.out new file mode 100644 index 000000000000..ed472f2a0209 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input51111414-.out @@ -0,0 +1,410 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" })' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.931) + [ (Pair (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) + (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) ] + - location: 14 (just consumed gas: 0.010) + [ { "B" ; "B" ; "asdf" ; "C" } + (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) ] + - location: 15 (just consumed gas: 0) + [ (Pair { "B" ; "B" ; "asdf" ; "C" } { "B" ; "C" ; "asdf" }) ] + - location: 17 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } ] + - location: 15 (just consumed gas: 0.025) + [ { "B" ; "B" ; "asdf" ; "C" } + { "B" ; "C" ; "asdf" } ] + - location: 18 (just consumed gas: 0.300) + [ {} + { "B" ; "B" ; "asdf" ; "C" } + { "B" ; "C" ; "asdf" } ] + - location: 20 (just consumed gas: 0.010) + [ { "B" ; "B" ; "asdf" ; "C" } + {} + { "B" ; "C" ; "asdf" } ] + - location: 21 (just consumed gas: 0) + [ "B" + {} + { "B" ; "C" ; "asdf" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "B" {}) + { "B" ; "C" ; "asdf" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "B" {}) + (Pair "B" {}) + { "B" ; "C" ; "asdf" } ] + - location: 25 (just consumed gas: 0.010) + [ "B" + (Pair "B" {}) + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "B" {}) + { "B" ; "C" ; "asdf" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0.025) + [ "B" + {} + { "B" ; "C" ; "asdf" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "B" + {} + { "B" ; "C" ; "asdf" } ] + - location: 32 (just consumed gas: 0.010) + [ "B" + True + {} + { "B" ; "C" ; "asdf" } ] + - location: 33 (just consumed gas: 0.132) + [ { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 21 (just consumed gas: 0.015) + [ "B" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "B" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "B" { "B" }) + (Pair "B" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 25 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "B" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 28 (just consumed gas: 0.010) + [ { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0.025) + [ "B" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "B" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 32 (just consumed gas: 0.010) + [ "B" + True + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 33 (just consumed gas: 0.134) + [ { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 21 (just consumed gas: 0.015) + [ "asdf" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" }) + (Pair "asdf" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 25 (just consumed gas: 0.010) + [ "asdf" + (Pair "asdf" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "asdf" { "B" }) + { "B" ; "C" ; "asdf" } ] + - location: 28 (just consumed gas: 0.010) + [ { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0.025) + [ "asdf" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "asdf" + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 32 (just consumed gas: 0.010) + [ "asdf" + True + { "B" } + { "B" ; "C" ; "asdf" } ] + - location: 33 (just consumed gas: 0.146) + [ { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 21 (just consumed gas: 0.015) + [ "C" + { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "asdf" }) + { "B" ; "C" ; "asdf" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "asdf" }) + (Pair "C" { "B" ; "asdf" }) + { "B" ; "C" ; "asdf" } ] + - location: 25 (just consumed gas: 0.010) + [ "C" + (Pair "C" { "B" ; "asdf" }) + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "C" { "B" ; "asdf" }) + { "B" ; "C" ; "asdf" } ] + - location: 28 (just consumed gas: 0.010) + [ { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 26 (just consumed gas: 0.025) + [ "C" + { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "C" + { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 32 (just consumed gas: 0.010) + [ "C" + True + { "B" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 33 (just consumed gas: 0.136) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 21 (just consumed gas: 0.015) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 34 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } ] + - location: 37 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True + { "B" ; "C" ; "asdf" } ] + - location: 38 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + { "B" ; "C" ; "asdf" } ] + - location: 39 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0) + [ "B" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.118) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ "C" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "C" + (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "C" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.118) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ "asdf" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "asdf" + (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "asdf" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.127) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 64 (just consumed gas: 0.010) + [ True ] + - location: 65 (just consumed gas: 0.010) + [ (Some True) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input545734274-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input545734274-.out new file mode 100644 index 000000000000..f7047cecbf8f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input545734274-.out @@ -0,0 +1,166 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair { "A" } { "B" })' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.251) + [ (Pair (Pair { "A" } { "B" }) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { "A" } { "B" }) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "A" } { "B" }) + (Pair { "A" } { "B" }) ] + - location: 14 (just consumed gas: 0.010) + [ { "A" } + (Pair { "A" } { "B" }) ] + - location: 15 (just consumed gas: 0) + [ (Pair { "A" } { "B" }) ] + - location: 17 (just consumed gas: 0.010) + [ { "B" } ] + - location: 15 (just consumed gas: 0.025) + [ { "A" } + { "B" } ] + - location: 18 (just consumed gas: 0.300) + [ {} + { "A" } + { "B" } ] + - location: 20 (just consumed gas: 0.010) + [ { "A" } + {} + { "B" } ] + - location: 21 (just consumed gas: 0) + [ "A" + {} + { "B" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "A" {}) + { "B" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "A" {}) + (Pair "A" {}) + { "B" } ] + - location: 25 (just consumed gas: 0.010) + [ "A" + (Pair "A" {}) + { "B" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "A" {}) + { "B" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "B" } ] + - location: 26 (just consumed gas: 0.025) + [ "A" + {} + { "B" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "A" + {} + { "B" } ] + - location: 32 (just consumed gas: 0.010) + [ "A" + True + {} + { "B" } ] + - location: 33 (just consumed gas: 0.132) + [ { "A" } + { "B" } ] + - location: 21 (just consumed gas: 0.015) + [ { "A" } + { "B" } ] + - location: 34 (just consumed gas: 0.010) + [ True + { "A" } + { "B" } ] + - location: 37 (just consumed gas: 0.010) + [ { "A" } + True + { "B" } ] + - location: 38 (just consumed gas: 0.010) + [ (Pair { "A" } True) + { "B" } ] + - location: 39 (just consumed gas: 0.010) + [ { "B" } + (Pair { "A" } True) ] + - location: 40 (just consumed gas: 0) + [ "B" + (Pair { "A" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "A" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "A" } True) + (Pair "B" { "A" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "A" } True) + (Pair "B" { "A" } True) + (Pair "B" { "A" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "A" } True) + (Pair "B" { "A" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "A" } True) + (Pair "B" { "A" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "A" } True) + (Pair "B" { "A" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "A" } + (Pair "B" { "A" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "A" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "A" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "A" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "A" } + { "A" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "A" } + { "A" } + True ] + - location: 57 (just consumed gas: 0.117) + [ False + { "A" } + True ] + - location: 58 (just consumed gas: 0) + [ { "A" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "A" } ] + - location: 58 (just consumed gas: 0.025) + [ False + True + { "A" } ] + - location: 61 (just consumed gas: 0.010) + [ False + { "A" } ] + - location: 62 (just consumed gas: 0.010) + [ { "A" } + False ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "A" } False) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair { "A" } False) ] + - location: 64 (just consumed gas: 0.010) + [ False ] + - location: 65 (just consumed gas: 0.010) + [ (Some False) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input772794967-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input772794967-.out new file mode 100644 index 000000000000..5bfc13b2d748 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input772794967-.out @@ -0,0 +1,63 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair {} {})' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.003) + [ (Pair (Pair {} {}) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} {}) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} {}) + (Pair {} {}) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Pair {} {}) ] + - location: 15 (just consumed gas: 0) + [ (Pair {} {}) ] + - location: 17 (just consumed gas: 0.010) + [ {} ] + - location: 15 (just consumed gas: 0.025) + [ {} + {} ] + - location: 18 (just consumed gas: 0.300) + [ {} + {} + {} ] + - location: 20 (just consumed gas: 0.010) + [ {} + {} + {} ] + - location: 21 (just consumed gas: 0) + [ {} + {} ] + - location: 34 (just consumed gas: 0.010) + [ True + {} + {} ] + - location: 37 (just consumed gas: 0.010) + [ {} + True + {} ] + - location: 38 (just consumed gas: 0.010) + [ (Pair {} True) + {} ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Pair {} True) ] + - location: 40 (just consumed gas: 0) + [ (Pair {} True) ] + - location: 64 (just consumed gas: 0.010) + [ True ] + - location: 65 (just consumed gas: 0.010) + [ (Some True) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input917967660-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input917967660-.out new file mode 100644 index 000000000000..37e4085e617a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input917967660-.out @@ -0,0 +1,437 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" })' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.931) + [ (Pair (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) + (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) ] + - location: 14 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) ] + - location: 15 (just consumed gas: 0) + [ (Pair { "B" ; "C" ; "asdf" } { "B" ; "B" ; "asdf" ; "C" }) ] + - location: 17 (just consumed gas: 0.010) + [ { "B" ; "B" ; "asdf" ; "C" } ] + - location: 15 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 18 (just consumed gas: 0.300) + [ {} + { "B" ; "C" ; "asdf" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 20 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 21 (just consumed gas: 0) + [ "B" + {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "B" {}) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "B" {}) + (Pair "B" {}) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 25 (just consumed gas: 0.010) + [ "B" + (Pair "B" {}) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "B" {}) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0.025) + [ "B" + {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "B" + {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 32 (just consumed gas: 0.010) + [ "B" + True + {} + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 33 (just consumed gas: 0.132) + [ { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 21 (just consumed gas: 0.015) + [ "C" + { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "C" { "B" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "C" { "B" }) + (Pair "C" { "B" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 25 (just consumed gas: 0.010) + [ "C" + (Pair "C" { "B" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "C" { "B" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 28 (just consumed gas: 0.010) + [ { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0.025) + [ "C" + { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "C" + { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 32 (just consumed gas: 0.010) + [ "C" + True + { "B" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 33 (just consumed gas: 0.134) + [ { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 21 (just consumed gas: 0.015) + [ "asdf" + { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" }) + (Pair "asdf" { "B" ; "C" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 25 (just consumed gas: 0.010) + [ "asdf" + (Pair "asdf" { "B" ; "C" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "asdf" { "B" ; "C" }) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 28 (just consumed gas: 0.010) + [ { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 26 (just consumed gas: 0.025) + [ "asdf" + { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "asdf" + { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 32 (just consumed gas: 0.010) + [ "asdf" + True + { "B" ; "C" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 33 (just consumed gas: 0.154) + [ { "B" ; "C" ; "asdf" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 21 (just consumed gas: 0.015) + [ { "B" ; "C" ; "asdf" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 34 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 37 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 38 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + { "B" ; "B" ; "asdf" ; "C" } ] + - location: 39 (just consumed gas: 0.010) + [ { "B" ; "B" ; "asdf" ; "C" } + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0) + [ "B" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.118) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ "B" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.118) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ "asdf" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "asdf" + (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "asdf" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "asdf" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.127) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ "C" + (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "C" + (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "C" { "B" ; "C" ; "asdf" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "C" + { "B" ; "C" ; "asdf" } + { "B" ; "C" ; "asdf" } + True ] + - location: 57 (just consumed gas: 0.118) + [ True + { "B" ; "C" ; "asdf" } + True ] + - location: 58 (just consumed gas: 0) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 58 (just consumed gas: 0.025) + [ True + True + { "B" ; "C" ; "asdf" } ] + - location: 61 (just consumed gas: 0.010) + [ True + { "B" ; "C" ; "asdf" } ] + - location: 62 (just consumed gas: 0.010) + [ { "B" ; "C" ; "asdf" } + True ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair { "B" ; "C" ; "asdf" } True) ] + - location: 64 (just consumed gas: 0.010) + [ True ] + - location: 65 (just consumed gas: 0.010) + [ (Some True) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input964818218-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input964818218-.out new file mode 100644 index 000000000000..7e9186a12cb1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contains_all.tz--storage921624073--input964818218-.out @@ -0,0 +1,166 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contains_all.tz on storage None and input '(Pair { "c" } { "B" })' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 32.251) + [ (Pair (Pair { "c" } { "B" }) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair { "c" } { "B" }) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "c" } { "B" }) + (Pair { "c" } { "B" }) ] + - location: 14 (just consumed gas: 0.010) + [ { "c" } + (Pair { "c" } { "B" }) ] + - location: 15 (just consumed gas: 0) + [ (Pair { "c" } { "B" }) ] + - location: 17 (just consumed gas: 0.010) + [ { "B" } ] + - location: 15 (just consumed gas: 0.025) + [ { "c" } + { "B" } ] + - location: 18 (just consumed gas: 0.300) + [ {} + { "c" } + { "B" } ] + - location: 20 (just consumed gas: 0.010) + [ { "c" } + {} + { "B" } ] + - location: 21 (just consumed gas: 0) + [ "c" + {} + { "B" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair "c" {}) + { "B" } ] + - location: 24 (just consumed gas: 0.010) + [ (Pair "c" {}) + (Pair "c" {}) + { "B" } ] + - location: 25 (just consumed gas: 0.010) + [ "c" + (Pair "c" {}) + { "B" } ] + - location: 26 (just consumed gas: 0) + [ (Pair "c" {}) + { "B" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "B" } ] + - location: 26 (just consumed gas: 0.025) + [ "c" + {} + { "B" } ] + - location: 29 (just consumed gas: 0.010) + [ True + "c" + {} + { "B" } ] + - location: 32 (just consumed gas: 0.010) + [ "c" + True + {} + { "B" } ] + - location: 33 (just consumed gas: 0.132) + [ { "c" } + { "B" } ] + - location: 21 (just consumed gas: 0.015) + [ { "c" } + { "B" } ] + - location: 34 (just consumed gas: 0.010) + [ True + { "c" } + { "B" } ] + - location: 37 (just consumed gas: 0.010) + [ { "c" } + True + { "B" } ] + - location: 38 (just consumed gas: 0.010) + [ (Pair { "c" } True) + { "B" } ] + - location: 39 (just consumed gas: 0.010) + [ { "B" } + (Pair { "c" } True) ] + - location: 40 (just consumed gas: 0) + [ "B" + (Pair { "c" } True) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair "B" { "c" } True) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair "B" { "c" } True) + (Pair "B" { "c" } True) ] + - location: 44 (just consumed gas: 0.010) + [ (Pair "B" { "c" } True) + (Pair "B" { "c" } True) + (Pair "B" { "c" } True) ] + - location: 45 (just consumed gas: 0.010) + [ "B" + (Pair "B" { "c" } True) + (Pair "B" { "c" } True) ] + - location: 46 (just consumed gas: 0) + [ (Pair "B" { "c" } True) + (Pair "B" { "c" } True) ] + - location: 49 (just consumed gas: 0.010) + [ (Pair { "c" } True) + (Pair "B" { "c" } True) ] + - location: 50 (just consumed gas: 0.010) + [ { "c" } + (Pair "B" { "c" } True) ] + - location: 51 (just consumed gas: 0) + [ (Pair "B" { "c" } True) ] + - location: 54 (just consumed gas: 0.010) + [ (Pair { "c" } True) ] + - location: 55 (just consumed gas: 0.010) + [ True ] + - location: 51 (just consumed gas: 0.025) + [ { "c" } + True ] + - location: 56 (just consumed gas: 0.010) + [ { "c" } + { "c" } + True ] + - location: 46 (just consumed gas: 0.025) + [ "B" + { "c" } + { "c" } + True ] + - location: 57 (just consumed gas: 0.117) + [ False + { "c" } + True ] + - location: 58 (just consumed gas: 0) + [ { "c" } + True ] + - location: 60 (just consumed gas: 0.010) + [ True + { "c" } ] + - location: 58 (just consumed gas: 0.025) + [ False + True + { "c" } ] + - location: 61 (just consumed gas: 0.010) + [ False + { "c" } ] + - location: 62 (just consumed gas: 0.010) + [ { "c" } + False ] + - location: 63 (just consumed gas: 0.010) + [ (Pair { "c" } False) ] + - location: 40 (just consumed gas: 0.015) + [ (Pair { "c" } False) ] + - location: 64 (just consumed gas: 0.010) + [ False ] + - location: 65 (just consumed gas: 0.010) + [ (Some False) ] + - location: 66 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 68 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contract.tz--storage125992234--input117475800-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contract.tz--storage125992234--input117475800-.out new file mode 100644 index 000000000000..242ffdc71803 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -contract.tz--storage125992234--input117475800-.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/contract.tz on storage Unit and input '"tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5"' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 11.810) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" Unit) ] + - location: 7 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 8 (just consumed gas: 0.310) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 11 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 11 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 17 (just consumed gas: 0.010) + [ ] + - location: 18 (just consumed gas: 0.010) + [ Unit ] + - location: 19 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -create_contract.tz--storage921624073--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -create_contract.tz--storage921624073--input125992234-.out new file mode 100644 index 000000000000..bebf7e5faf2d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -create_contract.tz--storage921624073--input125992234-.out @@ -0,0 +1,49 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/create_contract.tz on storage None and input Unit --level 1 --trace-stack +storage + (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") +emitted operations + Internal Origination: + From: KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi + Credit: ꜩ0.05 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract +big_map diff + +trace + - location: 8 (just consumed gas: 12.061) + [ (Pair Unit None) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ Unit ] + - location: 10 (just consumed gas: 0.010) + [ 50000 + Unit ] + - location: 11 (just consumed gas: 0.010) + [ None + 50000 + Unit ] + - location: 13 (just consumed gas: 0.716) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000002d08603000000001c02000000170500036c0501036c050202000000080317053d036d034200000002030b + "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm" ] + - location: 25 (just consumed gas: 0) + [ "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm" ] + - location: 27 (just consumed gas: 0.010) + [ (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") ] + - location: 28 (just consumed gas: 0.010) + [ {} + (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") ] + - location: 25 (just consumed gas: 0.025) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000002d08603000000001c02000000170500036c0501036c050202000000080317053d036d034200000002030b + {} + (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") ] + - location: 30 (just consumed gas: 0.010) + [ { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000002d08603000000001c02000000170500036c0501036c050202000000080317053d036d034200000002030b } + (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm") ] + - location: 31 (just consumed gas: 0.010) + [ (Pair { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000002d08603000000001c02000000170500036c0501036c050202000000080317053d036d034200000002030b } + (Some "KT1Mjjcb6tmSsLm7Cb3DSQszePjfchPM4Uxm")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1011138251-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1011138251-.out new file mode 100644 index 000000000000..f254aa2a34f3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1011138251-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/diff_timestamps.tz on storage 111 and input '(Pair 0 0)' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") 111) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") + (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" + (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:00Z") ] + - location: 14 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:00:00Z" + "1970-01-01T00:00:00Z" ] + - location: 15 (just consumed gas: 0.035) + [ 0 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1018564342-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1018564342-.out new file mode 100644 index 000000000000..bc70a50b6828 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1018564342-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/diff_timestamps.tz on storage 111 and input '(Pair 0 1)' --level 1 --trace-stack +storage + -1 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") 111) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") + (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" + (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:00:00Z" "1970-01-01T00:00:01Z") ] + - location: 14 (just consumed gas: 0.010) + [ "1970-01-01T00:00:01Z" ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:00:00Z" + "1970-01-01T00:00:01Z" ] + - location: 15 (just consumed gas: 0.035) + [ -1 ] + - location: 16 (just consumed gas: 0.010) + [ {} + -1 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} -1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1031049988-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1031049988-.out new file mode 100644 index 000000000000..f5279801b905 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input1031049988-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/diff_timestamps.tz on storage 111 and input '(Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z")' --level 1 --trace-stack +storage + 200 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.653) + [ (Pair (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") 111) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") + (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:03:20Z" + (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:03:20Z" "1970-01-01T00:00:00Z") ] + - location: 14 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:03:20Z" + "1970-01-01T00:00:00Z" ] + - location: 15 (just consumed gas: 0.035) + [ 200 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 200 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 200) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input685590443-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input685590443-.out new file mode 100644 index 000000000000..4196856a54e8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -diff_timestamps.tz--storage492856247--input685590443-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/diff_timestamps.tz on storage 111 and input '(Pair 1 0)' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") 111) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") + (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:00:01Z" + (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:00:01Z" "1970-01-01T00:00:00Z") ] + - location: 14 (just consumed gas: 0.010) + [ "1970-01-01T00:00:00Z" ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:00:01Z" + "1970-01-01T00:00:00Z" ] + - location: 15 (just consumed gas: 0.035) + [ 1 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input246866101-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input246866101-.out new file mode 100644 index 000000000000..cba72ba4f72b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input246866101-.out @@ -0,0 +1,3431 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dig_eq.tz on storage Unit and input '(Pair 17 (Pair 16 (Pair 15 (Pair 14 (Pair 13 (Pair 12 (Pair 11 (Pair 10 (Pair 9 (Pair 8 (Pair 7 (Pair 6 (Pair 5 (Pair 4 (Pair 3 (Pair 2 1))))))))))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 24 (just consumed gas: 159.743) + [ (Pair (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) Unit) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 27 (just consumed gas: 0.010) + [ 17 + (Pair 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 28 (just consumed gas: 0) + [ (Pair 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 30 (just consumed gas: 0.010) + [ 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 28 (just consumed gas: 0.025) + [ 17 + 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 31 (just consumed gas: 0) + [ (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 34 (just consumed gas: 0.010) + [ 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 31 (just consumed gas: 0.025) + [ 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 31 (just consumed gas: 0.010) + [ 17 + 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 31 (just consumed gas: 0) + [ 17 + 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 35 (just consumed gas: 0) + [ (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 38 (just consumed gas: 0.010) + [ 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 35 (just consumed gas: 0.025) + [ 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 35 (just consumed gas: 0.010) + [ 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 35 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 35 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0) + [ (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 42 (just consumed gas: 0.010) + [ 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0.025) + [ 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0.010) + [ 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 39 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0) + [ (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 46 (just consumed gas: 0.010) + [ 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0.025) + [ 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0.010) + [ 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 43 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0) + [ (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 50 (just consumed gas: 0.010) + [ 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.025) + [ 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.010) + [ 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 47 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0) + [ (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 54 (just consumed gas: 0.010) + [ 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.025) + [ 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 51 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0) + [ (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 58 (just consumed gas: 0.010) + [ 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.025) + [ 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 55 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0) + [ (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 62 (just consumed gas: 0.010) + [ 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.025) + [ 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 59 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0) + [ (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 66 (just consumed gas: 0.010) + [ 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.025) + [ 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 63 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0) + [ (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 70 (just consumed gas: 0.010) + [ 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.025) + [ 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 67 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0) + [ (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 74 (just consumed gas: 0.010) + [ 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.025) + [ 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 71 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0) + [ (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 78 (just consumed gas: 0.010) + [ 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.025) + [ 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 75 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0) + [ (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 82 (just consumed gas: 0.010) + [ 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.025) + [ 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 79 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0) + [ (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 86 (just consumed gas: 0.010) + [ 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.025) + [ 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 83 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 87 (just consumed gas: 0.030) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 89 (just consumed gas: 0.036) + [ 16 + 17 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 91 (just consumed gas: 0.043) + [ 15 + 16 + 17 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 93 (just consumed gas: 0.049) + [ 14 + 15 + 16 + 17 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 95 (just consumed gas: 0.057) + [ 13 + 14 + 15 + 16 + 17 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 97 (just consumed gas: 0.063) + [ 12 + 13 + 14 + 15 + 16 + 17 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 99 (just consumed gas: 0.070) + [ 11 + 12 + 13 + 14 + 15 + 16 + 17 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 101 (just consumed gas: 0.076) + [ 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 103 (just consumed gas: 0.084) + [ 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 105 (just consumed gas: 0.090) + [ 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 107 (just consumed gas: 0.097) + [ 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 109 (just consumed gas: 0.103) + [ 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 111 (just consumed gas: 0.111) + [ 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 113 (just consumed gas: 0.117) + [ 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 115 (just consumed gas: 0.124) + [ 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 117 (just consumed gas: 0.130) + [ 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 119 (just consumed gas: 0.138) + [ 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 121 (just consumed gas: 0.030) + [ 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 123 (just consumed gas: 0.036) + [ 2 + 1 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 125 (just consumed gas: 0.043) + [ 3 + 2 + 1 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 127 (just consumed gas: 0.049) + [ 4 + 3 + 2 + 1 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 129 (just consumed gas: 0.057) + [ 5 + 4 + 3 + 2 + 1 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 131 (just consumed gas: 0.063) + [ 6 + 5 + 4 + 3 + 2 + 1 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 133 (just consumed gas: 0.070) + [ 7 + 6 + 5 + 4 + 3 + 2 + 1 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 135 (just consumed gas: 0.076) + [ 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 137 (just consumed gas: 0.084) + [ 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 139 (just consumed gas: 0.090) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 141 (just consumed gas: 0.097) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 12 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 143 (just consumed gas: 0.103) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 13 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 145 (just consumed gas: 0.111) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 14 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 147 (just consumed gas: 0.117) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 15 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 149 (just consumed gas: 0.124) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 16 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 151 (just consumed gas: 0.130) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 17 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 153 (just consumed gas: 0.138) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0) + [ 2 + 1 + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 159 (just consumed gas: 0.010) + [ (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.025) + [ 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 156 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0) + [ 3 + (Pair 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 163 (just consumed gas: 0.010) + [ (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.025) + [ 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 160 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0) + [ 4 + (Pair 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 167 (just consumed gas: 0.010) + [ (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.025) + [ 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 164 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0) + [ 5 + (Pair 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 171 (just consumed gas: 0.010) + [ (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.025) + [ 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 168 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0) + [ 6 + (Pair 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 175 (just consumed gas: 0.010) + [ (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.025) + [ 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 172 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0) + [ 7 + (Pair 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 179 (just consumed gas: 0.010) + [ (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.025) + [ 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 176 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0) + [ 8 + (Pair 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 183 (just consumed gas: 0.010) + [ (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.025) + [ 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 180 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0) + [ 9 + (Pair 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 187 (just consumed gas: 0.010) + [ (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.025) + [ 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 184 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0) + [ 10 + (Pair 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 191 (just consumed gas: 0.010) + [ (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.025) + [ 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 188 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0) + [ 11 + (Pair 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 195 (just consumed gas: 0.010) + [ (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.025) + [ 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.010) + [ 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.010) + [ 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.010) + [ 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 192 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0) + [ 12 + (Pair 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 199 (just consumed gas: 0.010) + [ (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0.025) + [ 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0.010) + [ 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0.010) + [ 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0.010) + [ 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 196 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0) + [ 13 + (Pair 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 203 (just consumed gas: 0.010) + [ (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0.025) + [ 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0.010) + [ 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0.010) + [ 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0.010) + [ 17 + 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 200 (just consumed gas: 0) + [ 17 + 16 + 15 + 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 204 (just consumed gas: 0) + [ 14 + (Pair 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 207 (just consumed gas: 0.010) + [ (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 204 (just consumed gas: 0.025) + [ 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 204 (just consumed gas: 0.010) + [ 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 204 (just consumed gas: 0.010) + [ 17 + 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 204 (just consumed gas: 0) + [ 17 + 16 + 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 208 (just consumed gas: 0) + [ 15 + (Pair 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 211 (just consumed gas: 0.010) + [ (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 208 (just consumed gas: 0.025) + [ 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 208 (just consumed gas: 0.010) + [ 17 + 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 208 (just consumed gas: 0) + [ 17 + 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 212 (just consumed gas: 0) + [ 16 + (Pair 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 214 (just consumed gas: 0.010) + [ (Pair 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 212 (just consumed gas: 0.025) + [ 17 + (Pair 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 215 (just consumed gas: 0.010) + [ (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) + (Pair 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) ] + - location: 218 (just consumed gas: 0.755) + [ 0 ] + - location: 219 (just consumed gas: 0.010) + [ True ] + - location: 220 (just consumed gas: 0) + [ ] + - location: 220 (just consumed gas: 0.015) + [ ] + - location: 226 (just consumed gas: 0.010) + [ Unit ] + - location: 227 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 229 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input26856104-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input26856104-.out new file mode 100644 index 000000000000..cc6e9ea45b3f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dig_eq.tz--storage125992234--input26856104-.out @@ -0,0 +1,3431 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dig_eq.tz on storage Unit and input '(Pair 2 (Pair 3 (Pair 12 (Pair 16 (Pair 10 (Pair 14 (Pair 19 (Pair 9 (Pair 18 (Pair 6 (Pair 8 (Pair 11 (Pair 4 (Pair 13 (Pair 15 (Pair 5 1))))))))))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 24 (just consumed gas: 159.743) + [ (Pair (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) Unit) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 27 (just consumed gas: 0.010) + [ 2 + (Pair 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 28 (just consumed gas: 0) + [ (Pair 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 30 (just consumed gas: 0.010) + [ 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 28 (just consumed gas: 0.025) + [ 2 + 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 31 (just consumed gas: 0) + [ (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 34 (just consumed gas: 0.010) + [ 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 31 (just consumed gas: 0.025) + [ 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 31 (just consumed gas: 0.010) + [ 2 + 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 31 (just consumed gas: 0) + [ 2 + 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 35 (just consumed gas: 0) + [ (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 38 (just consumed gas: 0.010) + [ 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 35 (just consumed gas: 0.025) + [ 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 35 (just consumed gas: 0.010) + [ 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 35 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 35 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0) + [ (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 42 (just consumed gas: 0.010) + [ 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0.025) + [ 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0.010) + [ 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 39 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0) + [ (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 46 (just consumed gas: 0.010) + [ 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0.025) + [ 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0.010) + [ 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 43 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0) + [ (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 50 (just consumed gas: 0.010) + [ 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.025) + [ 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.010) + [ 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 47 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0) + [ (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 54 (just consumed gas: 0.010) + [ 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.025) + [ 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 51 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0) + [ (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 58 (just consumed gas: 0.010) + [ 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.025) + [ 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 55 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0) + [ (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 62 (just consumed gas: 0.010) + [ 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.025) + [ 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 59 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0) + [ (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 66 (just consumed gas: 0.010) + [ 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.025) + [ 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 63 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0) + [ (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 70 (just consumed gas: 0.010) + [ 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.025) + [ 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 67 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0) + [ (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 74 (just consumed gas: 0.010) + [ 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.025) + [ 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 71 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0) + [ (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 78 (just consumed gas: 0.010) + [ 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.025) + [ 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 75 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0) + [ (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 82 (just consumed gas: 0.010) + [ 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.025) + [ 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 79 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0) + [ (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 86 (just consumed gas: 0.010) + [ 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.025) + [ 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 83 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 87 (just consumed gas: 0.030) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 89 (just consumed gas: 0.036) + [ 3 + 2 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 91 (just consumed gas: 0.043) + [ 12 + 3 + 2 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 93 (just consumed gas: 0.049) + [ 16 + 12 + 3 + 2 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 95 (just consumed gas: 0.057) + [ 10 + 16 + 12 + 3 + 2 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 97 (just consumed gas: 0.063) + [ 14 + 10 + 16 + 12 + 3 + 2 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 99 (just consumed gas: 0.070) + [ 19 + 14 + 10 + 16 + 12 + 3 + 2 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 101 (just consumed gas: 0.076) + [ 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 103 (just consumed gas: 0.084) + [ 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 105 (just consumed gas: 0.090) + [ 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 107 (just consumed gas: 0.097) + [ 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 109 (just consumed gas: 0.103) + [ 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 111 (just consumed gas: 0.111) + [ 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 113 (just consumed gas: 0.117) + [ 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 115 (just consumed gas: 0.124) + [ 15 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 117 (just consumed gas: 0.130) + [ 5 + 15 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 119 (just consumed gas: 0.138) + [ 1 + 5 + 15 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 121 (just consumed gas: 0.030) + [ 1 + 5 + 15 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 123 (just consumed gas: 0.036) + [ 5 + 1 + 15 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 125 (just consumed gas: 0.043) + [ 15 + 5 + 1 + 13 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 127 (just consumed gas: 0.049) + [ 13 + 15 + 5 + 1 + 4 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 129 (just consumed gas: 0.057) + [ 4 + 13 + 15 + 5 + 1 + 11 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 131 (just consumed gas: 0.063) + [ 11 + 4 + 13 + 15 + 5 + 1 + 8 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 133 (just consumed gas: 0.070) + [ 8 + 11 + 4 + 13 + 15 + 5 + 1 + 6 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 135 (just consumed gas: 0.076) + [ 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 18 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 137 (just consumed gas: 0.084) + [ 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 9 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 139 (just consumed gas: 0.090) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 19 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 141 (just consumed gas: 0.097) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 14 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 143 (just consumed gas: 0.103) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 10 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 145 (just consumed gas: 0.111) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 16 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 147 (just consumed gas: 0.117) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 12 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 149 (just consumed gas: 0.124) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 3 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 151 (just consumed gas: 0.130) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + 2 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 153 (just consumed gas: 0.138) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0) + [ 5 + 1 + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 159 (just consumed gas: 0.010) + [ (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.025) + [ 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 156 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0) + [ 15 + (Pair 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 163 (just consumed gas: 0.010) + [ (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.025) + [ 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 160 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0) + [ 13 + (Pair 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 167 (just consumed gas: 0.010) + [ (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.025) + [ 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 164 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0) + [ 4 + (Pair 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 171 (just consumed gas: 0.010) + [ (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.025) + [ 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 168 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0) + [ 11 + (Pair 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 175 (just consumed gas: 0.010) + [ (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.025) + [ 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 172 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0) + [ 8 + (Pair 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 179 (just consumed gas: 0.010) + [ (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.025) + [ 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 176 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0) + [ 6 + (Pair 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 183 (just consumed gas: 0.010) + [ (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.025) + [ 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 180 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0) + [ 18 + (Pair 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 187 (just consumed gas: 0.010) + [ (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.025) + [ 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 184 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0) + [ 9 + (Pair 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 191 (just consumed gas: 0.010) + [ (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.025) + [ 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 188 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0) + [ 19 + (Pair 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 195 (just consumed gas: 0.010) + [ (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.025) + [ 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.010) + [ 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.010) + [ 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.010) + [ 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 192 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0) + [ 14 + (Pair 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 199 (just consumed gas: 0.010) + [ (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0.025) + [ 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0.010) + [ 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0.010) + [ 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0.010) + [ 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 196 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0) + [ 10 + (Pair 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 203 (just consumed gas: 0.010) + [ (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0.025) + [ 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0.010) + [ 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0.010) + [ 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0.010) + [ 2 + 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 200 (just consumed gas: 0) + [ 2 + 3 + 12 + 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 204 (just consumed gas: 0) + [ 16 + (Pair 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 207 (just consumed gas: 0.010) + [ (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 204 (just consumed gas: 0.025) + [ 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 204 (just consumed gas: 0.010) + [ 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 204 (just consumed gas: 0.010) + [ 2 + 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 204 (just consumed gas: 0) + [ 2 + 3 + 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 208 (just consumed gas: 0) + [ 12 + (Pair 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 211 (just consumed gas: 0.010) + [ (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 208 (just consumed gas: 0.025) + [ 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 208 (just consumed gas: 0.010) + [ 2 + 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 208 (just consumed gas: 0) + [ 2 + 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 212 (just consumed gas: 0) + [ 3 + (Pair 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 214 (just consumed gas: 0.010) + [ (Pair 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 212 (just consumed gas: 0.025) + [ 2 + (Pair 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 215 (just consumed gas: 0.010) + [ (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) + (Pair 2 3 12 16 10 14 19 9 18 6 8 11 4 13 15 5 1) ] + - location: 218 (just consumed gas: 0.755) + [ 0 ] + - location: 219 (just consumed gas: 0.010) + [ True ] + - location: 220 (just consumed gas: 0) + [ ] + - location: 220 (just consumed gas: 0.015) + [ ] + - location: 226 (just consumed gas: 0.010) + [ Unit ] + - location: 227 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 229 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dign.tz--storage680650890--input529388602-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dign.tz--storage680650890--input529388602-.out new file mode 100644 index 000000000000..bf8e496ea737 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dign.tz--storage680650890--input529388602-.out @@ -0,0 +1,61 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dign.tz on storage 0 and input '(Pair (Pair (Pair (Pair 1 2) 3) 4) 5)' --level 1 --trace-stack +storage + 5 +emitted operations + +big_map diff + +trace + - location: 15 (just consumed gas: 11.955) + [ (Pair (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) 0) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair (Pair 1 2) 3) 4) + 5 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair (Pair 1 2) 3) + 4 + 5 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 1 2) + 3 + 4 + 5 ] + - location: 19 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 20 (just consumed gas: 0.057) + [ 5 + 1 + 2 + 3 + 4 ] + - location: 22 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 ] + - location: 24 (just consumed gas: 0.010) + [ 2 + 3 + 4 ] + - location: 25 (just consumed gas: 0.010) + [ 3 + 4 ] + - location: 26 (just consumed gas: 0.010) + [ 4 ] + - location: 27 (just consumed gas: 0.010) + [ ] + - location: 22 (just consumed gas: 0.025) + [ 5 ] + - location: 28 (just consumed gas: 0.010) + [ {} + 5 ] + - location: 30 (just consumed gas: 0.010) + [ (Pair {} 5) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input590117173-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input590117173-.out new file mode 100644 index 000000000000..b5f590a3ed50 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input590117173-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dip.tz on storage '(Pair 0 0)' and input '(Pair 1 1)' --level 1 --trace-stack +storage + (Pair 1 2) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 7.912) + [ (Pair (Pair 1 1) 0 0) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 1 1) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 13 (just consumed gas: 0.010) + [ 1 + 1 + 1 ] + - location: 14 (just consumed gas: 0) + [ 1 + 1 ] + - location: 16 (just consumed gas: 0.035) + [ 2 ] + - location: 14 (just consumed gas: 0.025) + [ 1 + 2 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair 1 2) ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Pair 1 2) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} 1 2) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input850887554-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input850887554-.out new file mode 100644 index 000000000000..9420835da5f5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dip.tz--storage1011138251--input850887554-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dip.tz on storage '(Pair 0 0)' and input '(Pair 15 9)' --level 1 --trace-stack +storage + (Pair 15 24) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 7.912) + [ (Pair (Pair 15 9) 0 0) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair 15 9) ] + - location: 12 (just consumed gas: 0.010) + [ 15 + 9 ] + - location: 13 (just consumed gas: 0.010) + [ 15 + 15 + 9 ] + - location: 14 (just consumed gas: 0) + [ 15 + 9 ] + - location: 16 (just consumed gas: 0.035) + [ 24 ] + - location: 14 (just consumed gas: 0.025) + [ 15 + 24 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair 15 24) ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Pair 15 24) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} 15 24) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dipn.tz--storage680650890--input529388602-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dipn.tz--storage680650890--input529388602-.out new file mode 100644 index 000000000000..da6abb23e461 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dipn.tz--storage680650890--input529388602-.out @@ -0,0 +1,93 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dipn.tz on storage 0 and input '(Pair (Pair (Pair (Pair 1 2) 3) 4) 5)' --level 1 --trace-stack +storage + 6 +emitted operations + +big_map diff + +trace + - location: 15 (just consumed gas: 13.205) + [ (Pair (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) 0) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair (Pair 1 2) 3) 4) + 5 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair (Pair 1 2) 3) + 4 + 5 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 1 2) + 3 + 4 + 5 ] + - location: 19 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 20 (just consumed gas: 0) + [ ] + - location: 23 (just consumed gas: 0.010) + [ 6 ] + - location: 20 (just consumed gas: 0.025) + [ 5 + 6 ] + - location: 20 (just consumed gas: 0.010) + [ 4 + 5 + 6 ] + - location: 20 (just consumed gas: 0.010) + [ 3 + 4 + 5 + 6 ] + - location: 20 (just consumed gas: 0.010) + [ 2 + 3 + 4 + 5 + 6 ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 + 6 ] + - location: 20 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 + 6 ] + - location: 26 (just consumed gas: 0.010) + [ 2 + 3 + 4 + 5 + 6 ] + - location: 27 (just consumed gas: 0.010) + [ 3 + 4 + 5 + 6 ] + - location: 28 (just consumed gas: 0.010) + [ 4 + 5 + 6 ] + - location: 29 (just consumed gas: 0.010) + [ 5 + 6 ] + - location: 30 (just consumed gas: 0.010) + [ 6 ] + - location: 31 (just consumed gas: 0.010) + [ {} + 6 ] + - location: 33 (just consumed gas: 0.010) + [ (Pair {} 6) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dropn.tz--storage680650890--input529388602-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dropn.tz--storage680650890--input529388602-.out new file mode 100644 index 000000000000..30cafdaead5e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dropn.tz--storage680650890--input529388602-.out @@ -0,0 +1,39 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dropn.tz on storage 0 and input '(Pair (Pair (Pair (Pair 1 2) 3) 4) 5)' --level 1 --trace-stack +storage + 5 +emitted operations + +big_map diff + +trace + - location: 15 (just consumed gas: 9.048) + [ (Pair (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) 0) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair (Pair 1 2) 3) 4) + 5 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair (Pair 1 2) 3) + 4 + 5 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 1 2) + 3 + 4 + 5 ] + - location: 19 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 20 (just consumed gas: 0.040) + [ 5 ] + - location: 22 (just consumed gas: 0.010) + [ {} + 5 ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} 5) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dugn.tz--storage680650890--input529388602-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dugn.tz--storage680650890--input529388602-.out new file mode 100644 index 000000000000..3e51e92ec539 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dugn.tz--storage680650890--input529388602-.out @@ -0,0 +1,57 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dugn.tz on storage 0 and input '(Pair (Pair (Pair (Pair 1 2) 3) 4) 5)' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 15 (just consumed gas: 11.279) + [ (Pair (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) 0) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair (Pair (Pair (Pair 1 2) 3) 4) 5) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair (Pair (Pair 1 2) 3) 4) + 5 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair (Pair 1 2) 3) + 4 + 5 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 1 2) + 3 + 4 + 5 ] + - location: 19 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 20 (just consumed gas: 0.062) + [ 2 + 3 + 4 + 5 + 1 ] + - location: 22 (just consumed gas: 0.010) + [ 3 + 4 + 5 + 1 ] + - location: 23 (just consumed gas: 0.010) + [ 4 + 5 + 1 ] + - location: 24 (just consumed gas: 0.010) + [ 5 + 1 ] + - location: 25 (just consumed gas: 0.010) + [ 1 ] + - location: 26 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 28 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dup-n.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dup-n.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..2c5bc2f0f906 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -dup-n.tz--storage125992234--input125992234-.out @@ -0,0 +1,248 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/dup-n.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 42.228) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 5 ] + - location: 11 (just consumed gas: 0.010) + [ 4 + 5 ] + - location: 14 (just consumed gas: 0.010) + [ 3 + 4 + 5 ] + - location: 17 (just consumed gas: 0.010) + [ 2 + 3 + 4 + 5 ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 23 (just consumed gas: 0.021) + [ 1 + 1 + 2 + 3 + 4 + 5 ] + - location: 25 (just consumed gas: 0.010) + [ 1 + 1 + 1 + 2 + 3 + 4 + 5 ] + - location: 30 (just consumed gas: 0.035) + [ 0 + 1 + 2 + 3 + 4 + 5 ] + - location: 31 (just consumed gas: 0.010) + [ True + 1 + 2 + 3 + 4 + 5 ] + - location: 32 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 32 (just consumed gas: 0.015) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 38 (just consumed gas: 0.022) + [ 2 + 1 + 2 + 3 + 4 + 5 ] + - location: 40 (just consumed gas: 0.010) + [ 2 + 2 + 1 + 2 + 3 + 4 + 5 ] + - location: 45 (just consumed gas: 0.035) + [ 0 + 1 + 2 + 3 + 4 + 5 ] + - location: 46 (just consumed gas: 0.010) + [ True + 1 + 2 + 3 + 4 + 5 ] + - location: 47 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 47 (just consumed gas: 0.015) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 53 (just consumed gas: 0.023) + [ 3 + 1 + 2 + 3 + 4 + 5 ] + - location: 55 (just consumed gas: 0.010) + [ 3 + 3 + 1 + 2 + 3 + 4 + 5 ] + - location: 60 (just consumed gas: 0.035) + [ 0 + 1 + 2 + 3 + 4 + 5 ] + - location: 61 (just consumed gas: 0.010) + [ True + 1 + 2 + 3 + 4 + 5 ] + - location: 62 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 62 (just consumed gas: 0.015) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 68 (just consumed gas: 0.025) + [ 4 + 1 + 2 + 3 + 4 + 5 ] + - location: 70 (just consumed gas: 0.010) + [ 4 + 4 + 1 + 2 + 3 + 4 + 5 ] + - location: 75 (just consumed gas: 0.035) + [ 0 + 1 + 2 + 3 + 4 + 5 ] + - location: 76 (just consumed gas: 0.010) + [ True + 1 + 2 + 3 + 4 + 5 ] + - location: 77 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 77 (just consumed gas: 0.015) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 83 (just consumed gas: 0.026) + [ 5 + 1 + 2 + 3 + 4 + 5 ] + - location: 85 (just consumed gas: 0.010) + [ 5 + 5 + 1 + 2 + 3 + 4 + 5 ] + - location: 90 (just consumed gas: 0.035) + [ 0 + 1 + 2 + 3 + 4 + 5 ] + - location: 91 (just consumed gas: 0.010) + [ True + 1 + 2 + 3 + 4 + 5 ] + - location: 92 (just consumed gas: 0) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 92 (just consumed gas: 0.015) + [ 1 + 2 + 3 + 4 + 5 ] + - location: 98 (just consumed gas: 0.042) + [ ] + - location: 100 (just consumed gas: 0.010) + [ Unit ] + - location: 101 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 103 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input247451205-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input247451205-.out new file mode 100644 index 000000000000..fc6cf99337eb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input247451205-.out @@ -0,0 +1,142 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv.tz on storage '(Pair None None None None)' and input '(Pair 10 0)' --level 1 --trace-stack +storage + (Pair None None None None) +emitted operations + +big_map diff + +trace + - location: 25 (just consumed gas: 25.562) + [ (Pair (Pair 10 0) None None None None) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair 10 0) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair 10 0) + (Pair 10 0) ] + - location: 27 (just consumed gas: 0.010) + [ 10 + 0 + (Pair 10 0) ] + - location: 28 (just consumed gas: 0.020) + [ 10 + 0 + (Pair 10 0) ] + - location: 29 (just consumed gas: 0) + [ 0 + (Pair 10 0) ] + - location: 31 (just consumed gas: 0.020) + [ 0 + (Pair 10 0) ] + - location: 29 (just consumed gas: 0.025) + [ 10 + 0 + (Pair 10 0) ] + - location: 32 (just consumed gas: 0.105) + [ None + (Pair 10 0) ] + - location: 33 (just consumed gas: 0.010) + [ (Pair 10 0) + None ] + - location: 34 (just consumed gas: 0.010) + [ (Pair 10 0) + (Pair 10 0) + None ] + - location: 35 (just consumed gas: 0.010) + [ 10 + 0 + (Pair 10 0) + None ] + - location: 36 (just consumed gas: 0.020) + [ 10 + 0 + (Pair 10 0) + None ] + - location: 37 (just consumed gas: 0.105) + [ None + (Pair 10 0) + None ] + - location: 38 (just consumed gas: 0.010) + [ (Pair 10 0) + None + None ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 10 0) + (Pair 10 0) + None + None ] + - location: 40 (just consumed gas: 0.010) + [ 10 + 0 + (Pair 10 0) + None + None ] + - location: 41 (just consumed gas: 0) + [ 0 + (Pair 10 0) + None + None ] + - location: 43 (just consumed gas: 0.020) + [ 0 + (Pair 10 0) + None + None ] + - location: 41 (just consumed gas: 0.025) + [ 10 + 0 + (Pair 10 0) + None + None ] + - location: 44 (just consumed gas: 0.105) + [ None + (Pair 10 0) + None + None ] + - location: 45 (just consumed gas: 0.010) + [ (Pair 10 0) + None + None + None ] + - location: 46 (just consumed gas: 0.010) + [ 10 + 0 + None + None + None ] + - location: 47 (just consumed gas: 0.105) + [ None + None + None + None ] + - location: 49 (just consumed gas: 0) + [ None + None ] + - location: 52 (just consumed gas: 0.010) + [ (Pair None None) ] + - location: 49 (just consumed gas: 0.025) + [ None + (Pair None None) ] + - location: 49 (just consumed gas: 0.010) + [ None + None + (Pair None None) ] + - location: 49 (just consumed gas: 0) + [ None + None + (Pair None None) ] + - location: 53 (just consumed gas: 0) + [ None + (Pair None None) ] + - location: 55 (just consumed gas: 0.010) + [ (Pair None None None) ] + - location: 53 (just consumed gas: 0.025) + [ None + (Pair None None None) ] + - location: 56 (just consumed gas: 0.010) + [ (Pair None None None None) ] + - location: 57 (just consumed gas: 0.010) + [ {} + (Pair None None None None) ] + - location: 59 (just consumed gas: 0.010) + [ (Pair {} None None None None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input250545589-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input250545589-.out new file mode 100644 index 000000000000..66acdc60e6c3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input250545589-.out @@ -0,0 +1,142 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv.tz on storage '(Pair None None None None)' and input '(Pair -8 2)' --level 1 --trace-stack +storage + (Pair (Some (Pair -4 0)) (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) +emitted operations + +big_map diff + +trace + - location: 25 (just consumed gas: 25.562) + [ (Pair (Pair -8 2) None None None None) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair -8 2) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair -8 2) + (Pair -8 2) ] + - location: 27 (just consumed gas: 0.010) + [ -8 + 2 + (Pair -8 2) ] + - location: 28 (just consumed gas: 0.020) + [ 8 + 2 + (Pair -8 2) ] + - location: 29 (just consumed gas: 0) + [ 2 + (Pair -8 2) ] + - location: 31 (just consumed gas: 0.020) + [ 2 + (Pair -8 2) ] + - location: 29 (just consumed gas: 0.025) + [ 8 + 2 + (Pair -8 2) ] + - location: 32 (just consumed gas: 0.105) + [ (Some (Pair 4 0)) + (Pair -8 2) ] + - location: 33 (just consumed gas: 0.010) + [ (Pair -8 2) + (Some (Pair 4 0)) ] + - location: 34 (just consumed gas: 0.010) + [ (Pair -8 2) + (Pair -8 2) + (Some (Pair 4 0)) ] + - location: 35 (just consumed gas: 0.010) + [ -8 + 2 + (Pair -8 2) + (Some (Pair 4 0)) ] + - location: 36 (just consumed gas: 0.020) + [ 8 + 2 + (Pair -8 2) + (Some (Pair 4 0)) ] + - location: 37 (just consumed gas: 0.105) + [ (Some (Pair 4 0)) + (Pair -8 2) + (Some (Pair 4 0)) ] + - location: 38 (just consumed gas: 0.010) + [ (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 39 (just consumed gas: 0.010) + [ (Pair -8 2) + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 40 (just consumed gas: 0.010) + [ -8 + 2 + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 41 (just consumed gas: 0) + [ 2 + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 43 (just consumed gas: 0.020) + [ 2 + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 41 (just consumed gas: 0.025) + [ -8 + 2 + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 44 (just consumed gas: 0.105) + [ (Some (Pair -4 0)) + (Pair -8 2) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 45 (just consumed gas: 0.010) + [ (Pair -8 2) + (Some (Pair -4 0)) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 46 (just consumed gas: 0.010) + [ -8 + 2 + (Some (Pair -4 0)) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 47 (just consumed gas: 0.105) + [ (Some (Pair -4 0)) + (Some (Pair -4 0)) + (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 49 (just consumed gas: 0) + [ (Some (Pair 4 0)) + (Some (Pair 4 0)) ] + - location: 52 (just consumed gas: 0.010) + [ (Pair (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 49 (just consumed gas: 0.025) + [ (Some (Pair -4 0)) + (Pair (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 49 (just consumed gas: 0.010) + [ (Some (Pair -4 0)) + (Some (Pair -4 0)) + (Pair (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 49 (just consumed gas: 0) + [ (Some (Pair -4 0)) + (Some (Pair -4 0)) + (Pair (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 53 (just consumed gas: 0) + [ (Some (Pair -4 0)) + (Pair (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 55 (just consumed gas: 0.010) + [ (Pair (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 53 (just consumed gas: 0.025) + [ (Some (Pair -4 0)) + (Pair (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 56 (just consumed gas: 0.010) + [ (Pair (Some (Pair -4 0)) (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 57 (just consumed gas: 0.010) + [ {} + (Pair (Some (Pair -4 0)) (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) ] + - location: 59 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair -4 0)) (Some (Pair -4 0)) (Some (Pair 4 0)) (Some (Pair 4 0))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input79625541-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input79625541-.out new file mode 100644 index 000000000000..7253ac320690 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv.tz--storage994417987--input79625541-.out @@ -0,0 +1,142 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv.tz on storage '(Pair None None None None)' and input '(Pair 10 -3)' --level 1 --trace-stack +storage + (Pair (Some (Pair -3 1)) (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) +emitted operations + +big_map diff + +trace + - location: 25 (just consumed gas: 25.562) + [ (Pair (Pair 10 -3) None None None None) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair 10 -3) ] + - location: 26 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Pair 10 -3) ] + - location: 27 (just consumed gas: 0.010) + [ 10 + -3 + (Pair 10 -3) ] + - location: 28 (just consumed gas: 0.020) + [ 10 + -3 + (Pair 10 -3) ] + - location: 29 (just consumed gas: 0) + [ -3 + (Pair 10 -3) ] + - location: 31 (just consumed gas: 0.020) + [ 3 + (Pair 10 -3) ] + - location: 29 (just consumed gas: 0.025) + [ 10 + 3 + (Pair 10 -3) ] + - location: 32 (just consumed gas: 0.105) + [ (Some (Pair 3 1)) + (Pair 10 -3) ] + - location: 33 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Some (Pair 3 1)) ] + - location: 34 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Pair 10 -3) + (Some (Pair 3 1)) ] + - location: 35 (just consumed gas: 0.010) + [ 10 + -3 + (Pair 10 -3) + (Some (Pair 3 1)) ] + - location: 36 (just consumed gas: 0.020) + [ 10 + -3 + (Pair 10 -3) + (Some (Pair 3 1)) ] + - location: 37 (just consumed gas: 0.105) + [ (Some (Pair -3 1)) + (Pair 10 -3) + (Some (Pair 3 1)) ] + - location: 38 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 40 (just consumed gas: 0.010) + [ 10 + -3 + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 41 (just consumed gas: 0) + [ -3 + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 43 (just consumed gas: 0.020) + [ 3 + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 41 (just consumed gas: 0.025) + [ 10 + 3 + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 44 (just consumed gas: 0.105) + [ (Some (Pair 3 1)) + (Pair 10 -3) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 45 (just consumed gas: 0.010) + [ (Pair 10 -3) + (Some (Pair 3 1)) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 46 (just consumed gas: 0.010) + [ 10 + -3 + (Some (Pair 3 1)) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 47 (just consumed gas: 0.105) + [ (Some (Pair -3 1)) + (Some (Pair 3 1)) + (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 49 (just consumed gas: 0) + [ (Some (Pair -3 1)) + (Some (Pair 3 1)) ] + - location: 52 (just consumed gas: 0.010) + [ (Pair (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 49 (just consumed gas: 0.025) + [ (Some (Pair 3 1)) + (Pair (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 49 (just consumed gas: 0.010) + [ (Some (Pair -3 1)) + (Some (Pair 3 1)) + (Pair (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 49 (just consumed gas: 0) + [ (Some (Pair -3 1)) + (Some (Pair 3 1)) + (Pair (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 53 (just consumed gas: 0) + [ (Some (Pair 3 1)) + (Pair (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 55 (just consumed gas: 0.010) + [ (Pair (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 53 (just consumed gas: 0.025) + [ (Some (Pair -3 1)) + (Pair (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 56 (just consumed gas: 0.010) + [ (Pair (Some (Pair -3 1)) (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 57 (just consumed gas: 0.010) + [ {} + (Pair (Some (Pair -3 1)) (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) ] + - location: 59 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair -3 1)) (Some (Pair 3 1)) (Some (Pair -3 1)) (Some (Pair 3 1))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input147133089-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input147133089-.out new file mode 100644 index 000000000000..e49a83a9a949 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input147133089-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Right 0))' --level 1 --trace-stack +storage + (Right None) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Right 0)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Right 0)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Right 0) ] + - location: 21 (just consumed gas: 0.010) + [ (Right 0) + 10 ] + - location: 22 (just consumed gas: 0) + [ 0 + 10 ] + - location: 32 (just consumed gas: 0.010) + [ 10 + 0 ] + - location: 33 (just consumed gas: 0.070) + [ None ] + - location: 34 (just consumed gas: 0.010) + [ (Right None) ] + - location: 22 (just consumed gas: 0.015) + [ (Right None) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Right None) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Right None)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input215785357-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input215785357-.out new file mode 100644 index 000000000000..9e65acc40e8a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input215785357-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Right 3))' --level 1 --trace-stack +storage + (Right (Some (Pair 3 1))) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Right 3)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Right 3)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Right 3) ] + - location: 21 (just consumed gas: 0.010) + [ (Right 3) + 10 ] + - location: 22 (just consumed gas: 0) + [ 3 + 10 ] + - location: 32 (just consumed gas: 0.010) + [ 10 + 3 ] + - location: 33 (just consumed gas: 0.070) + [ (Some (Pair 3 1)) ] + - location: 34 (just consumed gas: 0.010) + [ (Right (Some (Pair 3 1))) ] + - location: 22 (just consumed gas: 0.015) + [ (Right (Some (Pair 3 1))) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Right (Some (Pair 3 1))) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Right (Some (Pair 3 1)))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input389351431-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input389351431-.out new file mode 100644 index 000000000000..7a9ad760e4ac --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input389351431-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Left 10))' --level 1 --trace-stack +storage + (Left (Some (Pair 1 0))) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Left 10)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Left 10)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Left 10) ] + - location: 21 (just consumed gas: 0.010) + [ (Left 10) + 10 ] + - location: 22 (just consumed gas: 0) + [ 10 + 10 ] + - location: 24 (just consumed gas: 0.010) + [ 10 + 10 ] + - location: 25 (just consumed gas: 0.080) + [ (Some (Pair 1 0)) ] + - location: 26 (just consumed gas: 0.010) + [ (Left (Some (Pair 1 0))) ] + - location: 22 (just consumed gas: 0.015) + [ (Left (Some (Pair 1 0))) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Left (Some (Pair 1 0))) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Left (Some (Pair 1 0)))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input44513000-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input44513000-.out new file mode 100644 index 000000000000..8c250bdd900e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input44513000-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Left 0))' --level 1 --trace-stack +storage + (Left None) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Left 0)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Left 0)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Left 0) ] + - location: 21 (just consumed gas: 0.010) + [ (Left 0) + 10 ] + - location: 22 (just consumed gas: 0) + [ 0 + 10 ] + - location: 24 (just consumed gas: 0.010) + [ 10 + 0 ] + - location: 25 (just consumed gas: 0.080) + [ None ] + - location: 26 (just consumed gas: 0.010) + [ (Left None) ] + - location: 22 (just consumed gas: 0.015) + [ (Left None) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Left None) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Left None)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input635398196-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input635398196-.out new file mode 100644 index 000000000000..aa719891cae5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input635398196-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Left 3))' --level 1 --trace-stack +storage + (Left (Some (Pair 3 1))) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Left 3)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Left 3)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Left 3) ] + - location: 21 (just consumed gas: 0.010) + [ (Left 3) + 10 ] + - location: 22 (just consumed gas: 0) + [ 3 + 10 ] + - location: 24 (just consumed gas: 0.010) + [ 10 + 3 ] + - location: 25 (just consumed gas: 0.080) + [ (Some (Pair 3 1)) ] + - location: 26 (just consumed gas: 0.010) + [ (Left (Some (Pair 3 1))) ] + - location: 22 (just consumed gas: 0.015) + [ (Left (Some (Pair 3 1))) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Left (Some (Pair 3 1))) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Left (Some (Pair 3 1)))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input734264738-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input734264738-.out new file mode 100644 index 000000000000..0754f91c551b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input734264738-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 10 (Right 10))' --level 1 --trace-stack +storage + (Right (Some (Pair 1 0))) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 10 (Right 10)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 (Right 10)) ] + - location: 20 (just consumed gas: 0.010) + [ 10 + (Right 10) ] + - location: 21 (just consumed gas: 0.010) + [ (Right 10) + 10 ] + - location: 22 (just consumed gas: 0) + [ 10 + 10 ] + - location: 32 (just consumed gas: 0.010) + [ 10 + 10 ] + - location: 33 (just consumed gas: 0.070) + [ (Some (Pair 1 0)) ] + - location: 34 (just consumed gas: 0.010) + [ (Right (Some (Pair 1 0))) ] + - location: 22 (just consumed gas: 0.015) + [ (Right (Some (Pair 1 0))) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Right (Some (Pair 1 0))) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Right (Some (Pair 1 0)))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input993071382-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input993071382-.out new file mode 100644 index 000000000000..f49de1e841fd --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ediv_mutez.tz--storage977883604--input993071382-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ediv_mutez.tz on storage '(Left None)' and input '(Pair 5 (Right 10))' --level 1 --trace-stack +storage + (Right (Some (Pair 0 5))) +emitted operations + +big_map diff + +trace + - location: 19 (just consumed gas: 14.009) + [ (Pair (Pair 5 (Right 10)) (Left None)) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 5 (Right 10)) ] + - location: 20 (just consumed gas: 0.010) + [ 5 + (Right 10) ] + - location: 21 (just consumed gas: 0.010) + [ (Right 10) + 5 ] + - location: 22 (just consumed gas: 0) + [ 10 + 5 ] + - location: 32 (just consumed gas: 0.010) + [ 5 + 10 ] + - location: 33 (just consumed gas: 0.070) + [ (Some (Pair 0 5)) ] + - location: 34 (just consumed gas: 0.010) + [ (Right (Some (Pair 0 5))) ] + - location: 22 (just consumed gas: 0.015) + [ (Right (Some (Pair 0 5))) ] + - location: 39 (just consumed gas: 0.010) + [ {} + (Right (Some (Pair 0 5))) ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} (Right (Some (Pair 0 5)))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -emit.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -emit.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..fdac0efa8ac8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -emit.tz--storage125992234--input125992234-.out @@ -0,0 +1,72 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/emit.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + Internal Event: + From: KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi + Type: (or nat string) + Tag: event + Payload: (Left 10) + Internal Event: + From: KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi + Type: (or (nat %number) (string %words)) + Tag: event + Payload: (Right "lorem ipsum") +big_map diff + +trace + - location: 7 (just consumed gas: 13.135) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ Unit ] + - location: 9 (just consumed gas: 0.010) + [ 10 + Unit ] + - location: 12 (just consumed gas: 0.010) + [ (Left 10) + Unit ] + - location: 14 (just consumed gas: 0.487) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 15 (just consumed gas: 0.010) + [ "lorem ipsum" + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 18 (just consumed gas: 0.010) + [ (Right "lorem ipsum") + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 20 (just consumed gas: 0.572) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 24 (just consumed gas: 0.010) + [ {} + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 26 (just consumed gas: 0.010) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d + {} + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 27 (just consumed gas: 0.010) + [ { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d } + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + Unit ] + - location: 28 (just consumed gas: 0.010) + [ 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a + { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d } + Unit ] + - location: 29 (just consumed gas: 0.010) + [ { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a ; + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d } + Unit ] + - location: 30 (just consumed gas: 0.010) + [ (Pair { 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600000004076403620368ffff056576656e74ff0505000a ; + 0x011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe6000001040764046200000007256e756d62657204680000000625776f726473ffff056576656e74ff0508010000000b6c6f72656d20697073756d } + Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -empty_map.tz--storage457300675--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -empty_map.tz--storage457300675--input125992234-.out new file mode 100644 index 000000000000..002e800eba69 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -empty_map.tz--storage457300675--input125992234-.out @@ -0,0 +1,33 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/empty_map.tz on storage '{}' and input Unit --level 1 --trace-stack +storage + { Elt "hello" "world" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 8.379) + [ (Pair Unit {}) ] + - location: 9 (just consumed gas: 0.010) + [ ] + - location: 10 (just consumed gas: 0.300) + [ {} ] + - location: 13 (just consumed gas: 0.010) + [ "world" + {} ] + - location: 16 (just consumed gas: 0.010) + [ (Some "world") + {} ] + - location: 17 (just consumed gas: 0.010) + [ "hello" + (Some "world") + {} ] + - location: 20 (just consumed gas: 0.090) + [ { Elt "hello" "world" } ] + - location: 21 (just consumed gas: 0.010) + [ {} + { Elt "hello" "world" } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "hello" "world" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input246262487-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input246262487-.out new file mode 100644 index 000000000000..9fbfe7d5ce3a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input246262487-.out @@ -0,0 +1,48 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/exec_concat.tz on storage '"?"' and input '"test"' --level 1 --trace-stack +storage + "test_abc" +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.941) + [ (Pair "test" "?") ] + - location: 7 (just consumed gas: 0.010) + [ "test" ] + - location: 8 (just consumed gas: 0.010) + [ { PUSH string "_abc" ; NIL string ; SWAP ; CONS ; SWAP ; CONS ; CONCAT } + "test" ] + - location: 22 (just consumed gas: 0.010) + [ "test" + { PUSH string "_abc" ; NIL string ; SWAP ; CONS ; SWAP ; CONS ; CONCAT } ] + - location: 12 (just consumed gas: 0.010) + [ "_abc" + "test" ] + - location: 15 (just consumed gas: 0.010) + [ {} + "_abc" + "test" ] + - location: 17 (just consumed gas: 0.010) + [ "_abc" + {} + "test" ] + - location: 18 (just consumed gas: 0.010) + [ { "_abc" } + "test" ] + - location: 19 (just consumed gas: 0.010) + [ "test" + { "_abc" } ] + - location: 20 (just consumed gas: 0.010) + [ { "test" ; "_abc" } ] + - location: 21 (just consumed gas: 0.124) + [ "test_abc" ] + - location: 23 (just consumed gas: 0.025) + [ "test_abc" ] + - location: 24 (just consumed gas: 0.010) + [ {} + "test_abc" ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} "test_abc") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input79230375-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input79230375-.out new file mode 100644 index 000000000000..7c787711dad4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -exec_concat.tz--storage398998998--input79230375-.out @@ -0,0 +1,48 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/exec_concat.tz on storage '"?"' and input '""' --level 1 --trace-stack +storage + "_abc" +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.901) + [ (Pair "" "?") ] + - location: 7 (just consumed gas: 0.010) + [ "" ] + - location: 8 (just consumed gas: 0.010) + [ { PUSH string "_abc" ; NIL string ; SWAP ; CONS ; SWAP ; CONS ; CONCAT } + "" ] + - location: 22 (just consumed gas: 0.010) + [ "" + { PUSH string "_abc" ; NIL string ; SWAP ; CONS ; SWAP ; CONS ; CONCAT } ] + - location: 12 (just consumed gas: 0.010) + [ "_abc" + "" ] + - location: 15 (just consumed gas: 0.010) + [ {} + "_abc" + "" ] + - location: 17 (just consumed gas: 0.010) + [ "_abc" + {} + "" ] + - location: 18 (just consumed gas: 0.010) + [ { "_abc" } + "" ] + - location: 19 (just consumed gas: 0.010) + [ "" + { "_abc" } ] + - location: 20 (just consumed gas: 0.010) + [ { "" ; "_abc" } ] + - location: 21 (just consumed gas: 0.122) + [ "_abc" ] + - location: 23 (just consumed gas: 0.025) + [ "_abc" ] + - location: 24 (just consumed gas: 0.010) + [ {} + "_abc" ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} "_abc") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input478406404-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input478406404-.out new file mode 100644 index 000000000000..47ec7505fbcc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input478406404-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/first.tz on storage 111 and input '{ 4 }' --level 1 --trace-stack +storage + 4 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.522) + [ (Pair { 4 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 4 } ] + - location: 9 (just consumed gas: 0) + [ 4 + {} ] + - location: 11 (just consumed gas: 0) + [ {} ] + - location: 13 (just consumed gas: 0.010) + [ ] + - location: 11 (just consumed gas: 0.025) + [ 4 ] + - location: 9 (just consumed gas: 0.015) + [ 4 ] + - location: 18 (just consumed gas: 0.010) + [ {} + 4 ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} 4) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input962874972-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input962874972-.out new file mode 100644 index 000000000000..702e75dccde6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -first.tz--storage492856247--input962874972-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/first.tz on storage 111 and input '{ 1 ; 2 ; 3 ; 4 }' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.822) + [ (Pair { 1 ; 2 ; 3 ; 4 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 ; 4 } ] + - location: 9 (just consumed gas: 0) + [ 1 + { 2 ; 3 ; 4 } ] + - location: 11 (just consumed gas: 0) + [ { 2 ; 3 ; 4 } ] + - location: 13 (just consumed gas: 0.010) + [ ] + - location: 11 (just consumed gas: 0.025) + [ 1 ] + - location: 9 (just consumed gas: 0.015) + [ 1 ] + - location: 18 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage1026405794--input329240220-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage1026405794--input329240220-.out new file mode 100644 index 000000000000..9f90661e30d1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage1026405794--input329240220-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair None { Elt "hello" 4 })' and input '"hello"' --level 1 --trace-stack +storage + (Pair (Some 4) {}) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.333) + [ (Pair "hello" None { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair None { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + None + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.110) + [ (Some 4) + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 4) {}) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 4) {}) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 4) {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage382368661--input329240220-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage382368661--input329240220-.out new file mode 100644 index 000000000000..db7731502efa --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage382368661--input329240220-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair (Some 4) {})' and input '"hello"' --level 1 --trace-stack +storage + (Pair None { Elt "hello" 4 }) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.079) + [ (Pair "hello" (Some 4) {}) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair (Some 4) {}) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 4) {}) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 4) + {} ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + (Some 4) + {} ] + - location: 17 (just consumed gas: 0.095) + [ None + { Elt "hello" 4 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" 4 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None { Elt "hello" 4 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None { Elt "hello" 4 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input329240220-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input329240220-.out new file mode 100644 index 000000000000..165c3803daf2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input329240220-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair (Some 5) { Elt "hello" 4 })' and input '"hello"' --level 1 --trace-stack +storage + (Pair (Some 4) { Elt "hello" 5 }) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.433) + [ (Pair "hello" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.110) + [ (Some 4) + { Elt "hello" 5 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 4) { Elt "hello" 5 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input507231566-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input507231566-.out new file mode 100644 index 000000000000..1040064b8d72 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage496578814--input507231566-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair (Some 5) { Elt "hello" 4 })' and input '"hi"' --level 1 --trace-stack +storage + (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.403) + [ (Pair "hi" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (just consumed gas: 0.010) + [ "hi" + (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair (Some 5) { Elt "hello" 4 }) ] + - location: 16 (just consumed gas: 0.010) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (just consumed gas: 0.025) + [ "hi" + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (just consumed gas: 0.092) + [ None + { Elt "hello" 4 ; Elt "hi" 5 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None { Elt "hello" 4 ; Elt "hi" 5 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage547821324--input329240220-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage547821324--input329240220-.out new file mode 100644 index 000000000000..1468d28f6190 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage547821324--input329240220-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair None {})' and input '"hello"' --level 1 --trace-stack +storage + (Pair None {}) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 7.979) + [ (Pair "hello" None {}) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair None {}) ] + - location: 14 (just consumed gas: 0) + [ (Pair None {}) ] + - location: 16 (just consumed gas: 0.010) + [ None + {} ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + None + {} ] + - location: 17 (just consumed gas: 0.095) + [ None + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair None {}) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair None {}) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} None {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input156280093-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input156280093-.out new file mode 100644 index 000000000000..bca0ee5504db --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input156280093-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair None { Elt "1" 1 ; Elt "2" 2 })' and input '"1"' --level 1 --trace-stack +storage + (Pair (Some 1) { Elt "2" 2 }) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.588) + [ (Pair "1" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (just consumed gas: 0.010) + [ "1" + (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (just consumed gas: 0.025) + [ "1" + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (just consumed gas: 0.089) + [ (Some 1) + { Elt "2" 2 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 1) { Elt "2" 2 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 1) { Elt "2" 2 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input228164856-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input228164856-.out new file mode 100644 index 000000000000..bfc9ad61e0d7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_and_update_map.tz--storage796012494--input228164856-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_and_update_map.tz on storage '(Pair None { Elt "1" 1 ; Elt "2" 2 })' and input '"2"' --level 1 --trace-stack +storage + (Pair (Some 2) { Elt "1" 1 }) +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 8.588) + [ (Pair "2" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (just consumed gas: 0.010) + [ "2" + (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 14 (just consumed gas: 0) + [ (Pair None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 16 (just consumed gas: 0.010) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (just consumed gas: 0.025) + [ "2" + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (just consumed gas: 0.089) + [ (Some 2) + { Elt "1" 1 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair (Some 2) { Elt "1" 1 }) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Pair (Some 2) { Elt "1" 1 }) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some 2) { Elt "1" 1 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input329240220-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input329240220-.out new file mode 100644 index 000000000000..de863c00b1ba --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input329240220-.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_map_value.tz on storage '(Pair None { Elt "hello" "hi" })' and input '"hello"' --level 1 --trace-stack +storage + (Pair (Some "hi") { Elt "hello" "hi" }) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.880) + [ (Pair "hello" None { Elt "hello" "hi" }) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "hello" None { Elt "hello" "hi" }) + (Pair "hello" None { Elt "hello" "hi" }) ] + - location: 13 (just consumed gas: 0.010) + [ "hello" + (Pair "hello" None { Elt "hello" "hi" }) ] + - location: 14 (just consumed gas: 0) + [ (Pair "hello" None { Elt "hello" "hi" }) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" "hi" }) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (just consumed gas: 0.025) + [ "hello" + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (just consumed gas: 0.090) + [ (Some "hi") + { Elt "hello" "hi" } ] + - location: 21 (just consumed gas: 0.010) + [ (Pair (Some "hi") { Elt "hello" "hi" }) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Pair (Some "hi") { Elt "hello" "hi" }) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some "hi") { Elt "hello" "hi" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input79230375-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input79230375-.out new file mode 100644 index 000000000000..c2dcfb0d9c93 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage139236239--input79230375-.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_map_value.tz on storage '(Pair None { Elt "hello" "hi" })' and input '""' --level 1 --trace-stack +storage + (Pair None { Elt "hello" "hi" }) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.830) + [ (Pair "" None { Elt "hello" "hi" }) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "" None { Elt "hello" "hi" }) + (Pair "" None { Elt "hello" "hi" }) ] + - location: 13 (just consumed gas: 0.010) + [ "" + (Pair "" None { Elt "hello" "hi" }) ] + - location: 14 (just consumed gas: 0) + [ (Pair "" None { Elt "hello" "hi" }) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" "hi" }) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (just consumed gas: 0.025) + [ "" + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (just consumed gas: 0.080) + [ None + { Elt "hello" "hi" } ] + - location: 21 (just consumed gas: 0.010) + [ (Pair None { Elt "hello" "hi" }) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Pair None { Elt "hello" "hi" }) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None { Elt "hello" "hi" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage329396864--input156280093-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage329396864--input156280093-.out new file mode 100644 index 000000000000..6a9c0d886e3d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -get_map_value.tz--storage329396864--input156280093-.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/get_map_value.tz on storage '(Pair None { Elt "1" "one" ; Elt "2" "two" })' and input '"1"' --level 1 --trace-stack +storage + (Pair (Some "one") { Elt "1" "one" ; Elt "2" "two" }) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 11.189) + [ (Pair "1" None { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "1" None { Elt "1" "one" ; Elt "2" "two" }) + (Pair "1" None { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 13 (just consumed gas: 0.010) + [ "1" + (Pair "1" None { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 14 (just consumed gas: 0) + [ (Pair "1" None { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair None { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 18 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 14 (just consumed gas: 0.025) + [ "1" + { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 20 (just consumed gas: 0.083) + [ (Some "one") + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 21 (just consumed gas: 0.010) + [ (Pair (Some "one") { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Pair (Some "one") { Elt "1" "one" ; Elt "2" "two" }) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some "one") { Elt "1" "one" ; Elt "2" "two" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input1040351577-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input1040351577-.out new file mode 100644 index 000000000000..de6007d56cc4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input1040351577-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/hash_key.tz on storage None and input '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"' --level 1 --trace-stack +storage + (Some "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 330.053) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" None) ] + - location: 8 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" ] + - location: 9 (just consumed gas: 0.605) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 10 (just consumed gas: 0.010) + [ (Some "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx") ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input153350004-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input153350004-.out new file mode 100644 index 000000000000..8afe3f3d08f5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_key.tz--storage921624073--input153350004-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/hash_key.tz on storage None and input '"edpkuJqtDcA2m2muMxViSM47MPsGQzmyjnNTawUPqR8vZTAMcx61ES"' --level 1 --trace-stack +storage + (Some "tz1XPTDmvT3vVE5Uunngmixm7gj7zmdbPq6k") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 330.053) + [ (Pair "edpkuJqtDcA2m2muMxViSM47MPsGQzmyjnNTawUPqR8vZTAMcx61ES" None) ] + - location: 8 (just consumed gas: 0.010) + [ "edpkuJqtDcA2m2muMxViSM47MPsGQzmyjnNTawUPqR8vZTAMcx61ES" ] + - location: 9 (just consumed gas: 0.605) + [ "tz1XPTDmvT3vVE5Uunngmixm7gj7zmdbPq6k" ] + - location: 10 (just consumed gas: 0.010) + [ (Some "tz1XPTDmvT3vVE5Uunngmixm7gj7zmdbPq6k") ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some "tz1XPTDmvT3vVE5Uunngmixm7gj7zmdbPq6k") ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some "tz1XPTDmvT3vVE5Uunngmixm7gj7zmdbPq6k")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input3431716-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input3431716-.out new file mode 100644 index 000000000000..2a3268ec1096 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input3431716-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/hash_string.tz on storage 0x00 and input '"abcdefg"' --level 1 --trace-stack +storage + 0x46fdbcb4ea4eadad5615cdaa17d67f783e01e21149ce2b27de497600b4cd8f4e +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.949) + [ (Pair "abcdefg" 0x00) ] + - location: 7 (just consumed gas: 0.010) + [ "abcdefg" ] + - location: 8 (just consumed gas: 0.286) + [ 0x05010000000761626364656667 ] + - location: 9 (just consumed gas: 0.444) + [ 0x46fdbcb4ea4eadad5615cdaa17d67f783e01e21149ce2b27de497600b4cd8f4e ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0x46fdbcb4ea4eadad5615cdaa17d67f783e01e21149ce2b27de497600b4cd8f4e ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0x46fdbcb4ea4eadad5615cdaa17d67f783e01e21149ce2b27de497600b4cd8f4e) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input535018041-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input535018041-.out new file mode 100644 index 000000000000..ae87b5f3a6ae --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -hash_string.tz--storage151303925--input535018041-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/hash_string.tz on storage 0x00 and input '"12345"' --level 1 --trace-stack +storage + 0xb4c26c20de52a4eaf0d8a340db47ad8cb1e74049570859c9a9a3952b204c772f +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.929) + [ (Pair "12345" 0x00) ] + - location: 7 (just consumed gas: 0.010) + [ "12345" ] + - location: 8 (just consumed gas: 0.266) + [ 0x0501000000053132333435 ] + - location: 9 (just consumed gas: 0.442) + [ 0xb4c26c20de52a4eaf0d8a340db47ad8cb1e74049570859c9a9a3952b204c772f ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0xb4c26c20de52a4eaf0d8a340db47ad8cb1e74049570859c9a9a3952b204c772f ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0xb4c26c20de52a4eaf0d8a340db47ad8cb1e74049570859c9a9a3952b204c772f) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input570553153-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input570553153-.out new file mode 100644 index 000000000000..01ec58ad2fec --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input570553153-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/if.tz on storage None and input False --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.320) + [ (Pair False None) ] + - location: 8 (just consumed gas: 0.010) + [ False ] + - location: 9 (just consumed gas: 0) + [ ] + - location: 15 (just consumed gas: 0.010) + [ False ] + - location: 9 (just consumed gas: 0.015) + [ False ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input954397288-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input954397288-.out new file mode 100644 index 000000000000..acfddc97fc68 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if.tz--storage921624073--input954397288-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/if.tz on storage None and input True --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.320) + [ (Pair True None) ] + - location: 8 (just consumed gas: 0.010) + [ True ] + - location: 9 (just consumed gas: 0) + [ ] + - location: 11 (just consumed gas: 0.010) + [ True ] + - location: 9 (just consumed gas: 0.015) + [ True ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input288201633-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input288201633-.out new file mode 100644 index 000000000000..02d97746ac1e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input288201633-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/if_some.tz on storage '"?"' and input '(Some "hello")' --level 1 --trace-stack +storage + "hello" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 6.419) + [ (Pair (Some "hello") "?") ] + - location: 8 (just consumed gas: 0.010) + [ (Some "hello") ] + - location: 10 (just consumed gas: 0) + [ "hello" ] + - location: 10 (just consumed gas: 0.015) + [ "hello" ] + - location: 16 (just consumed gas: 0.010) + [ {} + "hello" ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} "hello") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input921624073-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input921624073-.out new file mode 100644 index 000000000000..d7e65f62cd6a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -if_some.tz--storage398998998--input921624073-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/if_some.tz on storage '"?"' and input None --level 1 --trace-stack +storage + "" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 6.255) + [ (Pair None "?") ] + - location: 8 (just consumed gas: 0.010) + [ None ] + - location: 10 (just consumed gas: 0) + [ ] + - location: 12 (just consumed gas: 0.010) + [ "" ] + - location: 10 (just consumed gas: 0.015) + [ "" ] + - location: 16 (just consumed gas: 0.010) + [ {} + "" ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} "") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input453441034-.out new file mode 100644 index 000000000000..28e05df4a60b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input453441034-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/int.tz on storage None and input 1 --level 1 --trace-stack +storage + (Some 1) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair 1 None) ] + - location: 8 (just consumed gas: 0.010) + [ 1 ] + - location: 9 (just consumed gas: 0.010) + [ 1 ] + - location: 10 (just consumed gas: 0.010) + [ (Some 1) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some 1) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some 1)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input535454136-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input535454136-.out new file mode 100644 index 000000000000..d38b08cc70fa --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input535454136-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/int.tz on storage None and input 9999 --level 1 --trace-stack +storage + (Some 9999) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair 9999 None) ] + - location: 8 (just consumed gas: 0.010) + [ 9999 ] + - location: 9 (just consumed gas: 0.010) + [ 9999 ] + - location: 10 (just consumed gas: 0.010) + [ (Some 9999) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some 9999) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some 9999)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input680650890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input680650890-.out new file mode 100644 index 000000000000..91aad4b4577b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -int.tz--storage921624073--input680650890-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/int.tz on storage None and input 0 --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair 0 None) ] + - location: 8 (just consumed gas: 0.010) + [ 0 ] + - location: 9 (just consumed gas: 0.010) + [ 0 ] + - location: 10 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -keccak.tz--storage921624073--input1008262038-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -keccak.tz--storage921624073--input1008262038-.out new file mode 100644 index 000000000000..294f432f9fa7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -keccak.tz--storage921624073--input1008262038-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/keccak.tz on storage None and input 0x48656c6c6f2c20776f726c6421 --level 1 --trace-stack +storage + (Some 0xb6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair 0x48656c6c6f2c20776f726c6421 None) ] + - location: 8 (just consumed gas: 0.010) + [ 0x48656c6c6f2c20776f726c6421 ] + - location: 9 (just consumed gas: 1.457) + [ 0xb6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4 ] + - location: 10 (just consumed gas: 0.010) + [ (Some 0xb6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some 0xb6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} + (Some 0xb6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input202098045-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input202098045-.out new file mode 100644 index 000000000000..61e2bf16a596 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input202098045-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/left_right.tz on storage '(Left "X")' and input '(Left True)' --level 1 --trace-stack +storage + (Right True) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 7.244) + [ (Pair (Left True) (Left "X")) ] + - location: 11 (just consumed gas: 0.010) + [ (Left True) ] + - location: 12 (just consumed gas: 0) + [ True ] + - location: 14 (just consumed gas: 0.010) + [ (Right True) ] + - location: 12 (just consumed gas: 0.015) + [ (Right True) ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Right True) ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Right True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input44576556-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input44576556-.out new file mode 100644 index 000000000000..84d122b4a1ea --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -left_right.tz--storage4177631--input44576556-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/left_right.tz on storage '(Left "X")' and input '(Right "a")' --level 1 --trace-stack +storage + (Left "a") +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 7.268) + [ (Pair (Right "a") (Left "X")) ] + - location: 11 (just consumed gas: 0.010) + [ (Right "a") ] + - location: 12 (just consumed gas: 0) + [ "a" ] + - location: 17 (just consumed gas: 0.010) + [ (Left "a") ] + - location: 12 (just consumed gas: 0.015) + [ (Left "a") ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Left "a") ] + - location: 21 (just consumed gas: 0.010) + [ (Pair {} (Left "a")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -level.tz--storage492856247--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -level.tz--storage492856247--input125992234-.out new file mode 100644 index 000000000000..5b6f0ec9c613 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -level.tz--storage492856247--input125992234-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/level.tz on storage 111 and input Unit --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 4.267) + [ (Pair Unit 111) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 1 ] + - location: 9 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 11 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input457300675-.out new file mode 100644 index 000000000000..d9d97601d07c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat.tz on storage '"abc"' and input '{}' --level 1 --trace-stack +storage + "abc" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.605) + [ (Pair {} "abc") ] + - location: 8 (just consumed gas: 0.010) + [ {} + "abc" ] + - location: 9 (just consumed gas: 0.010) + [ "abc" + {} ] + - location: 10 (just consumed gas: 0.010) + [ { "abc" } ] + - location: 11 (just consumed gas: 0.111) + [ "abc" ] + - location: 12 (just consumed gas: 0.010) + [ {} + "abc" ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} "abc") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input546523343-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input546523343-.out new file mode 100644 index 000000000000..114d4131adcb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat.tz--storage717096222--input546523343-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat.tz on storage '"abc"' and input '{ "d" ; "e" ; "f" }' --level 1 --trace-stack +storage + "abcdef" +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.977) + [ (Pair { "d" ; "e" ; "f" } "abc") ] + - location: 8 (just consumed gas: 0.010) + [ { "d" ; "e" ; "f" } + "abc" ] + - location: 9 (just consumed gas: 0.010) + [ "abc" + { "d" ; "e" ; "f" } ] + - location: 10 (just consumed gas: 0.010) + [ { "abc" ; "d" ; "e" ; "f" } ] + - location: 11 (just consumed gas: 0.143) + [ "abcdef" ] + - location: 12 (just consumed gas: 0.010) + [ {} + "abcdef" ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} "abcdef") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input220724351-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input220724351-.out new file mode 100644 index 000000000000..80081156bde8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input220724351-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat_bytes.tz on storage 0x and input '{ 0x00 ; 0x11 ; 0x00 }' --level 1 --trace-stack +storage + 0x001100 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.861) + [ (Pair { 0x00 ; 0x11 ; 0x00 } 0x) ] + - location: 8 (just consumed gas: 0.010) + [ { 0x00 ; 0x11 ; 0x00 } + 0x ] + - location: 9 (just consumed gas: 0.010) + [ 0x + { 0x00 ; 0x11 ; 0x00 } ] + - location: 10 (just consumed gas: 0.010) + [ { 0x ; 0x00 ; 0x11 ; 0x00 } ] + - location: 11 (just consumed gas: 0.141) + [ 0x001100 ] + - location: 12 (just consumed gas: 0.010) + [ {} + 0x001100 ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} 0x001100) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input457300675-.out new file mode 100644 index 000000000000..05ecc7a72703 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage149262694--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat_bytes.tz on storage 0x and input '{}' --level 1 --trace-stack +storage + 0x +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.561) + [ (Pair {} 0x) ] + - location: 8 (just consumed gas: 0.010) + [ {} + 0x ] + - location: 9 (just consumed gas: 0.010) + [ 0x + {} ] + - location: 10 (just consumed gas: 0.010) + [ { 0x } ] + - location: 11 (just consumed gas: 0.110) + [ 0x ] + - location: 12 (just consumed gas: 0.010) + [ {} + 0x ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} 0x) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage65410082--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage65410082--input457300675-.out new file mode 100644 index 000000000000..9e8c1e57f1ef --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage65410082--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat_bytes.tz on storage 0xabcd and input '{}' --level 1 --trace-stack +storage + 0xabcd +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.561) + [ (Pair {} 0xabcd) ] + - location: 8 (just consumed gas: 0.010) + [ {} + 0xabcd ] + - location: 9 (just consumed gas: 0.010) + [ 0xabcd + {} ] + - location: 10 (just consumed gas: 0.010) + [ { 0xabcd } ] + - location: 11 (just consumed gas: 0.111) + [ 0xabcd ] + - location: 12 (just consumed gas: 0.010) + [ {} + 0xabcd ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} 0xabcd) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage726220441--input972761363-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage726220441--input972761363-.out new file mode 100644 index 000000000000..90c14c7ad067 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_concat_bytes.tz--storage726220441--input972761363-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_concat_bytes.tz on storage 0x00ab and input '{ 0xcd ; 0xef ; 0x00 }' --level 1 --trace-stack +storage + 0x00abcdef00 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.861) + [ (Pair { 0xcd ; 0xef ; 0x00 } 0x00ab) ] + - location: 8 (just consumed gas: 0.010) + [ { 0xcd ; 0xef ; 0x00 } + 0x00ab ] + - location: 9 (just consumed gas: 0.010) + [ 0x00ab + { 0xcd ; 0xef ; 0x00 } ] + - location: 10 (just consumed gas: 0.010) + [ { 0x00ab ; 0xcd ; 0xef ; 0x00 } ] + - location: 11 (just consumed gas: 0.142) + [ 0x00abcdef00 ] + - location: 12 (just consumed gas: 0.010) + [ {} + 0x00abcdef00 ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} 0x00abcdef00) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input264787654-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input264787654-.out new file mode 100644 index 000000000000..4362e2edbfb8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input264787654-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id.tz on storage '{""}' and input '{ "a" ; "b" ; "c" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.561) + [ (Pair { "a" ; "b" ; "c" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input457300675-.out new file mode 100644 index 000000000000..4e0e317bd616 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input457300675-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id.tz on storage '{""}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.189) + [ (Pair {} { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + {} ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input656499821-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input656499821-.out new file mode 100644 index 000000000000..f1f877ee965e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id.tz--storage528921618--input656499821-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id.tz on storage '{""}' and input '{ "1" ; "2" ; "3" }' --level 1 --trace-stack +storage + { "1" ; "2" ; "3" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.561) + [ (Pair { "1" ; "2" ; "3" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "1" ; "2" ; "3" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "1" ; "2" ; "3" } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { "1" ; "2" ; "3" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input264787654-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input264787654-.out new file mode 100644 index 000000000000..bee836271344 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input264787654-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id_map.tz on storage '{""}' and input '{ "a" ; "b" ; "c" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.447) + [ (Pair { "a" ; "b" ; "c" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 10 (just consumed gas: 0) + [ "a" ] + - location: 10 (just consumed gas: 0.015) + [ "b" ] + - location: 10 (just consumed gas: 0.015) + [ "c" ] + - location: 10 (just consumed gas: 0.015) + [ { "a" ; "b" ; "c" } ] + - location: 12 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input457300675-.out new file mode 100644 index 000000000000..d4918521a4ca --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id_map.tz on storage '{""}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.075) + [ (Pair {} { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0) + [ {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + {} ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input656499821-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input656499821-.out new file mode 100644 index 000000000000..3db67c22d715 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_id_map.tz--storage528921618--input656499821-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_id_map.tz on storage '{""}' and input '{ "1" ; "2" ; "3" }' --level 1 --trace-stack +storage + { "1" ; "2" ; "3" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.447) + [ (Pair { "1" ; "2" ; "3" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "1" ; "2" ; "3" } ] + - location: 10 (just consumed gas: 0) + [ "1" ] + - location: 10 (just consumed gas: 0.015) + [ "2" ] + - location: 10 (just consumed gas: 0.015) + [ "3" ] + - location: 10 (just consumed gas: 0.015) + [ { "1" ; "2" ; "3" } ] + - location: 12 (just consumed gas: 0.010) + [ {} + { "1" ; "2" ; "3" } ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} { "1" ; "2" ; "3" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input568817463-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input568817463-.out new file mode 100644 index 000000000000..bc3398c7805e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input568817463-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_iter.tz on storage 0 and input '{ 10 ; 2 ; 1 }' --level 1 --trace-stack +storage + 20 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.002) + [ (Pair { 10 ; 2 ; 1 } 0) ] + - location: 8 (just consumed gas: 0.010) + [ { 10 ; 2 ; 1 } ] + - location: 9 (just consumed gas: 0.010) + [ 1 + { 10 ; 2 ; 1 } ] + - location: 12 (just consumed gas: 0.010) + [ { 10 ; 2 ; 1 } + 1 ] + - location: 13 (just consumed gas: 0) + [ 10 + 1 ] + - location: 15 (just consumed gas: 0.059) + [ 10 ] + - location: 13 (just consumed gas: 0.015) + [ 2 + 10 ] + - location: 15 (just consumed gas: 0.059) + [ 20 ] + - location: 13 (just consumed gas: 0.015) + [ 1 + 20 ] + - location: 15 (just consumed gas: 0.059) + [ 20 ] + - location: 13 (just consumed gas: 0.015) + [ 20 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 20 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 20) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input737923774-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input737923774-.out new file mode 100644 index 000000000000..3e2f57b389f2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_iter.tz--storage680650890--input737923774-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_iter.tz on storage 0 and input '{ 3 ; 6 ; 9 }' --level 1 --trace-stack +storage + 162 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.002) + [ (Pair { 3 ; 6 ; 9 } 0) ] + - location: 8 (just consumed gas: 0.010) + [ { 3 ; 6 ; 9 } ] + - location: 9 (just consumed gas: 0.010) + [ 1 + { 3 ; 6 ; 9 } ] + - location: 12 (just consumed gas: 0.010) + [ { 3 ; 6 ; 9 } + 1 ] + - location: 13 (just consumed gas: 0) + [ 3 + 1 ] + - location: 15 (just consumed gas: 0.059) + [ 3 ] + - location: 13 (just consumed gas: 0.015) + [ 6 + 3 ] + - location: 15 (just consumed gas: 0.059) + [ 18 ] + - location: 13 (just consumed gas: 0.015) + [ 9 + 18 ] + - location: 15 (just consumed gas: 0.059) + [ 162 ] + - location: 13 (just consumed gas: 0.015) + [ 162 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 162 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 162) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input457300675-.out new file mode 100644 index 000000000000..0e81637086bc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input457300675-.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_map_block.tz on storage '{0}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 11.941) + [ (Pair {} { 0 }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ 0 + {} ] + - location: 13 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 14 (just consumed gas: 0) + [ {} + 0 ] + - location: 26 (just consumed gas: 0.010) + [ {} + {} + 0 ] + - location: 28 (just consumed gas: 0.010) + [ (Pair {} {}) + 0 ] + - location: 29 (just consumed gas: 0) + [ 0 ] + - location: 31 (just consumed gas: 0.010) + [ ] + - location: 29 (just consumed gas: 0.025) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input648737279-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input648737279-.out new file mode 100644 index 000000000000..f79d1d2e19c5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input648737279-.out @@ -0,0 +1,136 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_map_block.tz on storage '{0}' and input '{ 1 ; 2 ; 3 ; 0 }' --level 1 --trace-stack +storage + { 1 ; 3 ; 5 ; 3 } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 12.341) + [ (Pair { 1 ; 2 ; 3 ; 0 } { 0 }) ] + - location: 9 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 ; 0 } ] + - location: 10 (just consumed gas: 0.010) + [ 0 + { 1 ; 2 ; 3 ; 0 } ] + - location: 13 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 ; 0 } + 0 ] + - location: 14 (just consumed gas: 0) + [ 1 + 0 ] + - location: 16 (just consumed gas: 0) + [ 0 ] + - location: 18 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 16 (just consumed gas: 0.025) + [ 1 + 0 + 0 ] + - location: 19 (just consumed gas: 0.035) + [ 1 + 0 ] + - location: 20 (just consumed gas: 0) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 0 ] + - location: 25 (just consumed gas: 0.035) + [ 1 ] + - location: 20 (just consumed gas: 0.025) + [ 1 + 1 ] + - location: 14 (just consumed gas: 0.015) + [ 2 + 1 ] + - location: 16 (just consumed gas: 0) + [ 1 ] + - location: 18 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 16 (just consumed gas: 0.025) + [ 2 + 1 + 1 ] + - location: 19 (just consumed gas: 0.035) + [ 3 + 1 ] + - location: 20 (just consumed gas: 0) + [ 1 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 25 (just consumed gas: 0.035) + [ 2 ] + - location: 20 (just consumed gas: 0.025) + [ 3 + 2 ] + - location: 14 (just consumed gas: 0.015) + [ 3 + 2 ] + - location: 16 (just consumed gas: 0) + [ 2 ] + - location: 18 (just consumed gas: 0.010) + [ 2 + 2 ] + - location: 16 (just consumed gas: 0.025) + [ 3 + 2 + 2 ] + - location: 19 (just consumed gas: 0.035) + [ 5 + 2 ] + - location: 20 (just consumed gas: 0) + [ 2 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 2 ] + - location: 25 (just consumed gas: 0.035) + [ 3 ] + - location: 20 (just consumed gas: 0.025) + [ 5 + 3 ] + - location: 14 (just consumed gas: 0.015) + [ 0 + 3 ] + - location: 16 (just consumed gas: 0) + [ 3 ] + - location: 18 (just consumed gas: 0.010) + [ 3 + 3 ] + - location: 16 (just consumed gas: 0.025) + [ 0 + 3 + 3 ] + - location: 19 (just consumed gas: 0.035) + [ 3 + 3 ] + - location: 20 (just consumed gas: 0) + [ 3 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 3 ] + - location: 25 (just consumed gas: 0.035) + [ 4 ] + - location: 20 (just consumed gas: 0.025) + [ 3 + 4 ] + - location: 14 (just consumed gas: 0.015) + [ { 1 ; 3 ; 5 ; 3 } + 4 ] + - location: 26 (just consumed gas: 0.010) + [ {} + { 1 ; 3 ; 5 ; 3 } + 4 ] + - location: 28 (just consumed gas: 0.010) + [ (Pair {} { 1 ; 3 ; 5 ; 3 }) + 4 ] + - location: 29 (just consumed gas: 0) + [ 4 ] + - location: 31 (just consumed gas: 0.010) + [ ] + - location: 29 (just consumed gas: 0.025) + [ (Pair {} { 1 ; 3 ; 5 ; 3 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input908379154-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input908379154-.out new file mode 100644 index 000000000000..fc871e5834f6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_map_block.tz--storage907453363--input908379154-.out @@ -0,0 +1,136 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_map_block.tz on storage '{0}' and input '{ 1 ; 1 ; 1 ; 1 }' --level 1 --trace-stack +storage + { 1 ; 2 ; 3 ; 4 } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 12.341) + [ (Pair { 1 ; 1 ; 1 ; 1 } { 0 }) ] + - location: 9 (just consumed gas: 0.010) + [ { 1 ; 1 ; 1 ; 1 } ] + - location: 10 (just consumed gas: 0.010) + [ 0 + { 1 ; 1 ; 1 ; 1 } ] + - location: 13 (just consumed gas: 0.010) + [ { 1 ; 1 ; 1 ; 1 } + 0 ] + - location: 14 (just consumed gas: 0) + [ 1 + 0 ] + - location: 16 (just consumed gas: 0) + [ 0 ] + - location: 18 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 16 (just consumed gas: 0.025) + [ 1 + 0 + 0 ] + - location: 19 (just consumed gas: 0.035) + [ 1 + 0 ] + - location: 20 (just consumed gas: 0) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 0 ] + - location: 25 (just consumed gas: 0.035) + [ 1 ] + - location: 20 (just consumed gas: 0.025) + [ 1 + 1 ] + - location: 14 (just consumed gas: 0.015) + [ 1 + 1 ] + - location: 16 (just consumed gas: 0) + [ 1 ] + - location: 18 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 16 (just consumed gas: 0.025) + [ 1 + 1 + 1 ] + - location: 19 (just consumed gas: 0.035) + [ 2 + 1 ] + - location: 20 (just consumed gas: 0) + [ 1 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 25 (just consumed gas: 0.035) + [ 2 ] + - location: 20 (just consumed gas: 0.025) + [ 2 + 2 ] + - location: 14 (just consumed gas: 0.015) + [ 1 + 2 ] + - location: 16 (just consumed gas: 0) + [ 2 ] + - location: 18 (just consumed gas: 0.010) + [ 2 + 2 ] + - location: 16 (just consumed gas: 0.025) + [ 1 + 2 + 2 ] + - location: 19 (just consumed gas: 0.035) + [ 3 + 2 ] + - location: 20 (just consumed gas: 0) + [ 2 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 2 ] + - location: 25 (just consumed gas: 0.035) + [ 3 ] + - location: 20 (just consumed gas: 0.025) + [ 3 + 3 ] + - location: 14 (just consumed gas: 0.015) + [ 1 + 3 ] + - location: 16 (just consumed gas: 0) + [ 3 ] + - location: 18 (just consumed gas: 0.010) + [ 3 + 3 ] + - location: 16 (just consumed gas: 0.025) + [ 1 + 3 + 3 ] + - location: 19 (just consumed gas: 0.035) + [ 4 + 3 ] + - location: 20 (just consumed gas: 0) + [ 3 ] + - location: 22 (just consumed gas: 0.010) + [ 1 + 3 ] + - location: 25 (just consumed gas: 0.035) + [ 4 ] + - location: 20 (just consumed gas: 0.025) + [ 4 + 4 ] + - location: 14 (just consumed gas: 0.015) + [ { 1 ; 2 ; 3 ; 4 } + 4 ] + - location: 26 (just consumed gas: 0.010) + [ {} + { 1 ; 2 ; 3 ; 4 } + 4 ] + - location: 28 (just consumed gas: 0.010) + [ (Pair {} { 1 ; 2 ; 3 ; 4 }) + 4 ] + - location: 29 (just consumed gas: 0) + [ 4 ] + - location: 31 (just consumed gas: 0.010) + [ ] + - location: 29 (just consumed gas: 0.025) + [ (Pair {} { 1 ; 2 ; 3 ; 4 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input403499055-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input403499055-.out new file mode 100644 index 000000000000..9eeec9ac1ddc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input403499055-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_size.tz on storage 111 and input '{ 1 ; 2 ; 3 ; 4 ; 5 ; 6 }' --level 1 --trace-stack +storage + 6 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.995) + [ (Pair { 1 ; 2 ; 3 ; 4 ; 5 ; 6 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 } ] + - location: 9 (just consumed gas: 0.010) + [ 6 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 6 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 6) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input457300675-.out new file mode 100644 index 000000000000..c413dbfcb6d0 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_size.tz on storage 111 and input '{}' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.395) + [ (Pair {} 111) ] + - location: 8 (just consumed gas: 0.010) + [ {} ] + - location: 9 (just consumed gas: 0.010) + [ 0 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input469078912-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input469078912-.out new file mode 100644 index 000000000000..a822ef285dac --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input469078912-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_size.tz on storage 111 and input '{ 1 ; 2 ; 3 }' --level 1 --trace-stack +storage + 3 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.695) + [ (Pair { 1 ; 2 ; 3 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 } ] + - location: 9 (just consumed gas: 0.010) + [ 3 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 3 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 3) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input802622031-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input802622031-.out new file mode 100644 index 000000000000..da63e4b4a915 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -list_size.tz--storage492856247--input802622031-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/list_size.tz on storage 111 and input '{ 1 }' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.495) + [ (Pair { 1 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 } ] + - location: 9 (just consumed gas: 0.010) + [ 1 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input457300675-.out new file mode 100644 index 000000000000..f5e0bfc57121 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input457300675-.out @@ -0,0 +1,52 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/loop_left.tz on storage '{""}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 17.263) + [ (Pair {} { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} {}) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair {} {})) ] + - location: 41 (just consumed gas: 0) + [ (Pair {} {}) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} {}) + (Pair {} {}) ] + - location: 20 (just consumed gas: 0.010) + [ {} + (Pair {} {}) ] + - location: 21 (just consumed gas: 0) + [ (Pair {} {}) ] + - location: 23 (just consumed gas: 0.010) + [ {} ] + - location: 21 (just consumed gas: 0.025) + [ {} + {} ] + - location: 24 (just consumed gas: 0) + [ {} ] + - location: 35 (just consumed gas: 0.010) + [ (Right {}) ] + - location: 24 (just consumed gas: 0.015) + [ (Right {}) ] + - location: 41 (just consumed gas: 0.015) + [ {} ] + - location: 41 (just consumed gas: 0.010) + [ {} + {} ] + - location: 43 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input851203613-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input851203613-.out new file mode 100644 index 000000000000..44daed051f71 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -loop_left.tz--storage528921618--input851203613-.out @@ -0,0 +1,163 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/loop_left.tz on storage '{""}' and input '{ "c" ; "b" ; "a" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 17.635) + [ (Pair { "c" ; "b" ; "a" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "c" ; "b" ; "a" } ] + - location: 12 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } + {} ] + - location: 13 (just consumed gas: 0.010) + [ (Pair { "c" ; "b" ; "a" } {}) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair { "c" ; "b" ; "a" } {})) ] + - location: 41 (just consumed gas: 0) + [ (Pair { "c" ; "b" ; "a" } {}) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair { "c" ; "b" ; "a" } {}) + (Pair { "c" ; "b" ; "a" } {}) ] + - location: 20 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } + (Pair { "c" ; "b" ; "a" } {}) ] + - location: 21 (just consumed gas: 0) + [ (Pair { "c" ; "b" ; "a" } {}) ] + - location: 23 (just consumed gas: 0.010) + [ {} ] + - location: 21 (just consumed gas: 0.025) + [ { "c" ; "b" ; "a" } + {} ] + - location: 24 (just consumed gas: 0) + [ "c" + { "b" ; "a" } + {} ] + - location: 26 (just consumed gas: 0.010) + [ { "b" ; "a" } + "c" + {} ] + - location: 27 (just consumed gas: 0) + [ "c" + {} ] + - location: 29 (just consumed gas: 0.010) + [ { "c" } ] + - location: 27 (just consumed gas: 0.025) + [ { "b" ; "a" } + { "c" } ] + - location: 30 (just consumed gas: 0.010) + [ (Pair { "b" ; "a" } { "c" }) ] + - location: 31 (just consumed gas: 0.010) + [ (Left (Pair { "b" ; "a" } { "c" })) ] + - location: 24 (just consumed gas: 0.015) + [ (Left (Pair { "b" ; "a" } { "c" })) ] + - location: 41 (just consumed gas: 0.015) + [ (Pair { "b" ; "a" } { "c" }) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair { "b" ; "a" } { "c" }) + (Pair { "b" ; "a" } { "c" }) ] + - location: 20 (just consumed gas: 0.010) + [ { "b" ; "a" } + (Pair { "b" ; "a" } { "c" }) ] + - location: 21 (just consumed gas: 0) + [ (Pair { "b" ; "a" } { "c" }) ] + - location: 23 (just consumed gas: 0.010) + [ { "c" } ] + - location: 21 (just consumed gas: 0.025) + [ { "b" ; "a" } + { "c" } ] + - location: 24 (just consumed gas: 0) + [ "b" + { "a" } + { "c" } ] + - location: 26 (just consumed gas: 0.010) + [ { "a" } + "b" + { "c" } ] + - location: 27 (just consumed gas: 0) + [ "b" + { "c" } ] + - location: 29 (just consumed gas: 0.010) + [ { "b" ; "c" } ] + - location: 27 (just consumed gas: 0.025) + [ { "a" } + { "b" ; "c" } ] + - location: 30 (just consumed gas: 0.010) + [ (Pair { "a" } { "b" ; "c" }) ] + - location: 31 (just consumed gas: 0.010) + [ (Left (Pair { "a" } { "b" ; "c" })) ] + - location: 24 (just consumed gas: 0.015) + [ (Left (Pair { "a" } { "b" ; "c" })) ] + - location: 41 (just consumed gas: 0.015) + [ (Pair { "a" } { "b" ; "c" }) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair { "a" } { "b" ; "c" }) + (Pair { "a" } { "b" ; "c" }) ] + - location: 20 (just consumed gas: 0.010) + [ { "a" } + (Pair { "a" } { "b" ; "c" }) ] + - location: 21 (just consumed gas: 0) + [ (Pair { "a" } { "b" ; "c" }) ] + - location: 23 (just consumed gas: 0.010) + [ { "b" ; "c" } ] + - location: 21 (just consumed gas: 0.025) + [ { "a" } + { "b" ; "c" } ] + - location: 24 (just consumed gas: 0) + [ "a" + {} + { "b" ; "c" } ] + - location: 26 (just consumed gas: 0.010) + [ {} + "a" + { "b" ; "c" } ] + - location: 27 (just consumed gas: 0) + [ "a" + { "b" ; "c" } ] + - location: 29 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 27 (just consumed gas: 0.025) + [ {} + { "a" ; "b" ; "c" } ] + - location: 30 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + - location: 31 (just consumed gas: 0.010) + [ (Left (Pair {} { "a" ; "b" ; "c" })) ] + - location: 24 (just consumed gas: 0.015) + [ (Left (Pair {} { "a" ; "b" ; "c" })) ] + - location: 41 (just consumed gas: 0.015) + [ (Pair {} { "a" ; "b" ; "c" }) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) + (Pair {} { "a" ; "b" ; "c" }) ] + - location: 20 (just consumed gas: 0.010) + [ {} + (Pair {} { "a" ; "b" ; "c" }) ] + - location: 21 (just consumed gas: 0) + [ (Pair {} { "a" ; "b" ; "c" }) ] + - location: 23 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 21 (just consumed gas: 0.025) + [ {} + { "a" ; "b" ; "c" } ] + - location: 24 (just consumed gas: 0) + [ { "a" ; "b" ; "c" } ] + - location: 35 (just consumed gas: 0.010) + [ (Right { "a" ; "b" ; "c" }) ] + - location: 24 (just consumed gas: 0.015) + [ (Right { "a" ; "b" ; "c" }) ] + - location: 41 (just consumed gas: 0.015) + [ { "a" ; "b" ; "c" } ] + - location: 41 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 43 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsl_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsl_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..100817409b21 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsl_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,93 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/lsl_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 36.249) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0 ] + - location: 11 (just consumed gas: 0.010) + [ 0x06 + 0 ] + - location: 14 (just consumed gas: 0.070) + [ 0x06 ] + - location: 15 (just consumed gas: 0.010) + [ 0x06 + 0x06 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 1 ] + - location: 31 (just consumed gas: 0.010) + [ 0x06 + 1 ] + - location: 34 (just consumed gas: 0.070) + [ 0x000c ] + - location: 35 (just consumed gas: 0.010) + [ 0x000c + 0x000c ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 8 ] + - location: 51 (just consumed gas: 0.010) + [ 0x06 + 8 ] + - location: 54 (just consumed gas: 0.070) + [ 0x0600 ] + - location: 55 (just consumed gas: 0.010) + [ 0x0600 + 0x0600 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ 1 ] + - location: 71 (just consumed gas: 0.010) + [ 0x0006 + 1 ] + - location: 74 (just consumed gas: 0.071) + [ 0x00000c ] + - location: 75 (just consumed gas: 0.010) + [ 0x00000c + 0x00000c ] + - location: 80 (just consumed gas: 0.035) + [ 0 ] + - location: 81 (just consumed gas: 0.010) + [ True ] + - location: 82 (just consumed gas: 0) + [ ] + - location: 82 (just consumed gas: 0.015) + [ ] + - location: 88 (just consumed gas: 0.010) + [ Unit ] + - location: 89 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 91 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsr_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsr_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..9430ec693b8c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -lsr_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,129 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/lsr_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 52.699) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 1 ] + - location: 11 (just consumed gas: 0.010) + [ 0x06 + 1 ] + - location: 14 (just consumed gas: 0.070) + [ 0x03 ] + - location: 15 (just consumed gas: 0.010) + [ 0x03 + 0x03 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 8 ] + - location: 31 (just consumed gas: 0.010) + [ 0x06 + 8 ] + - location: 34 (just consumed gas: 0.070) + [ 0x ] + - location: 35 (just consumed gas: 0.010) + [ 0x + 0x ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 1 ] + - location: 51 (just consumed gas: 0.010) + [ 0x0006 + 1 ] + - location: 54 (just consumed gas: 0.071) + [ 0x0003 ] + - location: 55 (just consumed gas: 0.010) + [ 0x0003 + 0x0003 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ 8 ] + - location: 71 (just consumed gas: 0.010) + [ 0x0006 + 8 ] + - location: 74 (just consumed gas: 0.070) + [ 0x00 ] + - location: 75 (just consumed gas: 0.010) + [ 0x00 + 0x00 ] + - location: 80 (just consumed gas: 0.035) + [ 0 ] + - location: 81 (just consumed gas: 0.010) + [ True ] + - location: 82 (just consumed gas: 0) + [ ] + - location: 82 (just consumed gas: 0.015) + [ ] + - location: 88 (just consumed gas: 0.010) + [ 0 ] + - location: 91 (just consumed gas: 0.010) + [ 0x001234 + 0 ] + - location: 94 (just consumed gas: 0.071) + [ 0x001234 ] + - location: 95 (just consumed gas: 0.010) + [ 0x001234 + 0x001234 ] + - location: 100 (just consumed gas: 0.035) + [ 0 ] + - location: 101 (just consumed gas: 0.010) + [ True ] + - location: 102 (just consumed gas: 0) + [ ] + - location: 102 (just consumed gas: 0.015) + [ ] + - location: 108 (just consumed gas: 0.010) + [ 30 ] + - location: 111 (just consumed gas: 0.010) + [ 0x001234 + 30 ] + - location: 114 (just consumed gas: 0.070) + [ 0x ] + - location: 115 (just consumed gas: 0.010) + [ 0x + 0x ] + - location: 120 (just consumed gas: 0.035) + [ 0 ] + - location: 121 (just consumed gas: 0.010) + [ True ] + - location: 122 (just consumed gas: 0) + [ ] + - location: 122 (just consumed gas: 0.015) + [ ] + - location: 128 (just consumed gas: 0.010) + [ Unit ] + - location: 129 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 131 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input1027566226-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input1027566226-.out new file mode 100644 index 000000000000..31a4b882f0af --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input1027566226-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_id.tz on storage '{}' and input '{ Elt 0 0 }' --level 1 --trace-stack +storage + { Elt 0 0 } +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 4.716) + [ (Pair { Elt 0 0 } {}) ] + - location: 11 (just consumed gas: 0.010) + [ { Elt 0 0 } ] + - location: 12 (just consumed gas: 0.010) + [ {} + { Elt 0 0 } ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} { Elt 0 0 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input276660554-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input276660554-.out new file mode 100644 index 000000000000..c09ca14ede0e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input276660554-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_id.tz on storage '{}' and input '{ Elt 0 0 ; Elt 3 4 }' --level 1 --trace-stack +storage + { Elt 0 0 ; Elt 3 4 } +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 5.031) + [ (Pair { Elt 0 0 ; Elt 3 4 } {}) ] + - location: 11 (just consumed gas: 0.010) + [ { Elt 0 0 ; Elt 3 4 } ] + - location: 12 (just consumed gas: 0.010) + [ {} + { Elt 0 0 ; Elt 3 4 } ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} { Elt 0 0 ; Elt 3 4 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input599923743-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input599923743-.out new file mode 100644 index 000000000000..ade96af1f3f2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_id.tz--storage457300675--input599923743-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_id.tz on storage '{}' and input '{ Elt 0 1 }' --level 1 --trace-stack +storage + { Elt 0 1 } +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 4.716) + [ (Pair { Elt 0 1 } {}) ] + - location: 11 (just consumed gas: 0.010) + [ { Elt 0 1 } ] + - location: 12 (just consumed gas: 0.010) + [ {} + { Elt 0 1 } ] + - location: 14 (just consumed gas: 0.010) + [ (Pair {} { Elt 0 1 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input403579222-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input403579222-.out new file mode 100644 index 000000000000..4952a4138512 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input403579222-.out @@ -0,0 +1,152 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_iter.tz on storage '(Pair 0 0)' and input '{ Elt 1 1 ; Elt 2 100 }' --level 1 --trace-stack +storage + (Pair 3 101) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 18.616) + [ (Pair { Elt 1 1 ; Elt 2 100 } 0 0) ] + - location: 11 (just consumed gas: 0.010) + [ { Elt 1 1 ; Elt 2 100 } ] + - location: 12 (just consumed gas: 0.010) + [ 0 + { Elt 1 1 ; Elt 2 100 } ] + - location: 15 (just consumed gas: 0.010) + [ 0 + 0 + { Elt 1 1 ; Elt 2 100 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 0 0) + { Elt 1 1 ; Elt 2 100 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 1 ; Elt 2 100 } + (Pair 0 0) ] + - location: 20 (just consumed gas: 0) + [ (Pair 1 1) + (Pair 0 0) ] + - location: 22 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 0 0) + (Pair 0 0) ] + - location: 25 (just consumed gas: 0.010) + [ 0 + (Pair 0 0) ] + - location: 26 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 28 (just consumed gas: 0.010) + [ 0 ] + - location: 26 (just consumed gas: 0.025) + [ 0 + 0 ] + - location: 22 (just consumed gas: 0.025) + [ (Pair 1 1) + 0 + 0 ] + - location: 29 (just consumed gas: 0.010) + [ (Pair 1 1) + (Pair 1 1) + 0 + 0 ] + - location: 30 (just consumed gas: 0) + [ (Pair 1 1) + 0 + 0 ] + - location: 32 (just consumed gas: 0.010) + [ 1 + 0 + 0 ] + - location: 33 (just consumed gas: 0.035) + [ 1 + 0 ] + - location: 30 (just consumed gas: 0.025) + [ (Pair 1 1) + 1 + 0 ] + - location: 34 (just consumed gas: 0.010) + [ 1 + (Pair 1 1) + 0 ] + - location: 35 (just consumed gas: 0) + [ (Pair 1 1) + 0 ] + - location: 37 (just consumed gas: 0.010) + [ 1 + 0 ] + - location: 38 (just consumed gas: 0.035) + [ 1 ] + - location: 35 (just consumed gas: 0.025) + [ 1 + 1 ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 1 1) ] + - location: 20 (just consumed gas: 0.015) + [ (Pair 2 100) + (Pair 1 1) ] + - location: 22 (just consumed gas: 0) + [ (Pair 1 1) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 1 1) + (Pair 1 1) ] + - location: 25 (just consumed gas: 0.010) + [ 1 + (Pair 1 1) ] + - location: 26 (just consumed gas: 0) + [ (Pair 1 1) ] + - location: 28 (just consumed gas: 0.010) + [ 1 ] + - location: 26 (just consumed gas: 0.025) + [ 1 + 1 ] + - location: 22 (just consumed gas: 0.025) + [ (Pair 2 100) + 1 + 1 ] + - location: 29 (just consumed gas: 0.010) + [ (Pair 2 100) + (Pair 2 100) + 1 + 1 ] + - location: 30 (just consumed gas: 0) + [ (Pair 2 100) + 1 + 1 ] + - location: 32 (just consumed gas: 0.010) + [ 2 + 1 + 1 ] + - location: 33 (just consumed gas: 0.035) + [ 3 + 1 ] + - location: 30 (just consumed gas: 0.025) + [ (Pair 2 100) + 3 + 1 ] + - location: 34 (just consumed gas: 0.010) + [ 3 + (Pair 2 100) + 1 ] + - location: 35 (just consumed gas: 0) + [ (Pair 2 100) + 1 ] + - location: 37 (just consumed gas: 0.010) + [ 100 + 1 ] + - location: 38 (just consumed gas: 0.035) + [ 101 ] + - location: 35 (just consumed gas: 0.025) + [ 3 + 101 ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 3 101) ] + - location: 20 (just consumed gas: 0.015) + [ (Pair 3 101) ] + - location: 40 (just consumed gas: 0.010) + [ {} + (Pair 3 101) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair {} 3 101) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input532072758-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input532072758-.out new file mode 100644 index 000000000000..c2d5a5edda90 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_iter.tz--storage1011138251--input532072758-.out @@ -0,0 +1,152 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_iter.tz on storage '(Pair 0 0)' and input '{ Elt 0 100 ; Elt 2 100 }' --level 1 --trace-stack +storage + (Pair 2 200) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 18.616) + [ (Pair { Elt 0 100 ; Elt 2 100 } 0 0) ] + - location: 11 (just consumed gas: 0.010) + [ { Elt 0 100 ; Elt 2 100 } ] + - location: 12 (just consumed gas: 0.010) + [ 0 + { Elt 0 100 ; Elt 2 100 } ] + - location: 15 (just consumed gas: 0.010) + [ 0 + 0 + { Elt 0 100 ; Elt 2 100 } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair 0 0) + { Elt 0 100 ; Elt 2 100 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 0 100 ; Elt 2 100 } + (Pair 0 0) ] + - location: 20 (just consumed gas: 0) + [ (Pair 0 100) + (Pair 0 0) ] + - location: 22 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 0 0) + (Pair 0 0) ] + - location: 25 (just consumed gas: 0.010) + [ 0 + (Pair 0 0) ] + - location: 26 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 28 (just consumed gas: 0.010) + [ 0 ] + - location: 26 (just consumed gas: 0.025) + [ 0 + 0 ] + - location: 22 (just consumed gas: 0.025) + [ (Pair 0 100) + 0 + 0 ] + - location: 29 (just consumed gas: 0.010) + [ (Pair 0 100) + (Pair 0 100) + 0 + 0 ] + - location: 30 (just consumed gas: 0) + [ (Pair 0 100) + 0 + 0 ] + - location: 32 (just consumed gas: 0.010) + [ 0 + 0 + 0 ] + - location: 33 (just consumed gas: 0.035) + [ 0 + 0 ] + - location: 30 (just consumed gas: 0.025) + [ (Pair 0 100) + 0 + 0 ] + - location: 34 (just consumed gas: 0.010) + [ 0 + (Pair 0 100) + 0 ] + - location: 35 (just consumed gas: 0) + [ (Pair 0 100) + 0 ] + - location: 37 (just consumed gas: 0.010) + [ 100 + 0 ] + - location: 38 (just consumed gas: 0.035) + [ 100 ] + - location: 35 (just consumed gas: 0.025) + [ 0 + 100 ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 0 100) ] + - location: 20 (just consumed gas: 0.015) + [ (Pair 2 100) + (Pair 0 100) ] + - location: 22 (just consumed gas: 0) + [ (Pair 0 100) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair 0 100) + (Pair 0 100) ] + - location: 25 (just consumed gas: 0.010) + [ 0 + (Pair 0 100) ] + - location: 26 (just consumed gas: 0) + [ (Pair 0 100) ] + - location: 28 (just consumed gas: 0.010) + [ 100 ] + - location: 26 (just consumed gas: 0.025) + [ 0 + 100 ] + - location: 22 (just consumed gas: 0.025) + [ (Pair 2 100) + 0 + 100 ] + - location: 29 (just consumed gas: 0.010) + [ (Pair 2 100) + (Pair 2 100) + 0 + 100 ] + - location: 30 (just consumed gas: 0) + [ (Pair 2 100) + 0 + 100 ] + - location: 32 (just consumed gas: 0.010) + [ 2 + 0 + 100 ] + - location: 33 (just consumed gas: 0.035) + [ 2 + 100 ] + - location: 30 (just consumed gas: 0.025) + [ (Pair 2 100) + 2 + 100 ] + - location: 34 (just consumed gas: 0.010) + [ 2 + (Pair 2 100) + 100 ] + - location: 35 (just consumed gas: 0) + [ (Pair 2 100) + 100 ] + - location: 37 (just consumed gas: 0.010) + [ 100 + 100 ] + - location: 38 (just consumed gas: 0.035) + [ 200 ] + - location: 35 (just consumed gas: 0.025) + [ 2 + 200 ] + - location: 39 (just consumed gas: 0.010) + [ (Pair 2 200) ] + - location: 20 (just consumed gas: 0.015) + [ (Pair 2 200) ] + - location: 40 (just consumed gas: 0.010) + [ {} + (Pair 2 200) ] + - location: 42 (just consumed gas: 0.010) + [ (Pair {} 2 200) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage457300675--input798141440-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage457300675--input798141440-.out new file mode 100644 index 000000000000..79ee80e7d7b6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage457300675--input798141440-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_map.tz on storage '{}' and input 10 --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 9.216) + [ (Pair 10 {}) ] + - location: 9 (just consumed gas: 0.010) + [ 10 + {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + 10 ] + - location: 11 (just consumed gas: 0) + [ {} + 10 ] + - location: 18 (just consumed gas: 0) + [ 10 ] + - location: 20 (just consumed gas: 0.010) + [ ] + - location: 18 (just consumed gas: 0.025) + [ {} ] + - location: 21 (just consumed gas: 0.010) + [ {} + {} ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage794999348--input152441147-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage794999348--input152441147-.out new file mode 100644 index 000000000000..db9d3c6c203b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage794999348--input152441147-.out @@ -0,0 +1,68 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_map.tz on storage '{ Elt "bar" 5 ; Elt "foo" 1 }' and input 15 --level 1 --trace-stack +storage + { Elt "bar" 20 ; Elt "foo" 16 } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 9.917) + [ (Pair 15 { Elt "bar" 5 ; Elt "foo" 1 }) ] + - location: 9 (just consumed gas: 0.010) + [ 15 + { Elt "bar" 5 ; Elt "foo" 1 } ] + - location: 10 (just consumed gas: 0.010) + [ { Elt "bar" 5 ; Elt "foo" 1 } + 15 ] + - location: 11 (just consumed gas: 0) + [ (Pair "bar" 5) + 15 ] + - location: 13 (just consumed gas: 0.010) + [ 5 + 15 ] + - location: 14 (just consumed gas: 0) + [ 15 ] + - location: 16 (just consumed gas: 0.010) + [ 15 + 15 ] + - location: 14 (just consumed gas: 0.025) + [ 5 + 15 + 15 ] + - location: 17 (just consumed gas: 0.035) + [ 20 + 15 ] + - location: 11 (just consumed gas: 0.015) + [ (Pair "foo" 1) + 15 ] + - location: 13 (just consumed gas: 0.010) + [ 1 + 15 ] + - location: 14 (just consumed gas: 0) + [ 15 ] + - location: 16 (just consumed gas: 0.010) + [ 15 + 15 ] + - location: 14 (just consumed gas: 0.025) + [ 1 + 15 + 15 ] + - location: 17 (just consumed gas: 0.035) + [ 16 + 15 ] + - location: 11 (just consumed gas: 0.015) + [ { Elt "bar" 20 ; Elt "foo" 16 } + 15 ] + - location: 18 (just consumed gas: 0) + [ 15 ] + - location: 20 (just consumed gas: 0.010) + [ ] + - location: 18 (just consumed gas: 0.025) + [ { Elt "bar" 20 ; Elt "foo" 16 } ] + - location: 21 (just consumed gas: 0.010) + [ {} + { Elt "bar" 20 ; Elt "foo" 16 } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 20 ; Elt "foo" 16 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage88008216--input798141440-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage88008216--input798141440-.out new file mode 100644 index 000000000000..b96acb5f8df6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_map.tz--storage88008216--input798141440-.out @@ -0,0 +1,50 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_map.tz on storage '{ Elt "foo" 1 }' and input 10 --level 1 --trace-stack +storage + { Elt "foo" 11 } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 9.546) + [ (Pair 10 { Elt "foo" 1 }) ] + - location: 9 (just consumed gas: 0.010) + [ 10 + { Elt "foo" 1 } ] + - location: 10 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + 10 ] + - location: 11 (just consumed gas: 0) + [ (Pair "foo" 1) + 10 ] + - location: 13 (just consumed gas: 0.010) + [ 1 + 10 ] + - location: 14 (just consumed gas: 0) + [ 10 ] + - location: 16 (just consumed gas: 0.010) + [ 10 + 10 ] + - location: 14 (just consumed gas: 0.025) + [ 1 + 10 + 10 ] + - location: 17 (just consumed gas: 0.035) + [ 11 + 10 ] + - location: 11 (just consumed gas: 0.015) + [ { Elt "foo" 11 } + 10 ] + - location: 18 (just consumed gas: 0) + [ 10 ] + - location: 20 (just consumed gas: 0.010) + [ ] + - location: 18 (just consumed gas: 0.025) + [ { Elt "foo" 11 } ] + - location: 21 (just consumed gas: 0.010) + [ {} + { Elt "foo" 11 } ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 11 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage495706788--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage495706788--input453441034-.out new file mode 100644 index 000000000000..770967a5ca76 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage495706788--input453441034-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair {} None)' and input 1 --level 1 --trace-stack +storage + (Pair {} (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.436) + [ (Pair 1 {} None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair {} None) ] + - location: 13 (just consumed gas: 0) + [ (Pair {} None) ] + - location: 15 (just consumed gas: 0.010) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.025) + [ 1 + {} + {} ] + - location: 17 (just consumed gas: 0.080) + [ False + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + {} ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair {} (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input453441034-.out new file mode 100644 index 000000000000..f6e1cd3bd2a1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input453441034-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 1 --level 1 --trace-stack +storage + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.031) + [ (Pair 1 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.080) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input564400327-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input564400327-.out new file mode 100644 index 000000000000..63ec54cb9894 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input564400327-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 2 --level 1 --trace-stack +storage + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.031) + [ (Pair 2 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 2 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 2 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.080) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input654274102-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input654274102-.out new file mode 100644 index 000000000000..e0f1b05dbbe7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage56274299--input654274102-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair { Elt 1 4 ; Elt 2 11 } None)' and input 3 --level 1 --trace-stack +storage + (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.031) + [ (Pair 3 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 3 + (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 4 ; Elt 2 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (just consumed gas: 0.025) + [ 3 + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (just consumed gas: 0.080) + [ False + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 4 ; Elt 2 11 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage690637660--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage690637660--input453441034-.out new file mode 100644 index 000000000000..d7f180984a0a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage690637660--input453441034-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair { Elt 1 0 } None)' and input 1 --level 1 --trace-stack +storage + (Pair { Elt 1 0 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.716) + [ (Pair 1 { Elt 1 0 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 1 0 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 1 0 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 1 0 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 1 0 } + { Elt 1 0 } ] + - location: 17 (just consumed gas: 0.080) + [ True + { Elt 1 0 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt 1 0 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 1 0 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 1 0 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 1 0 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 1 0 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage806237530--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage806237530--input453441034-.out new file mode 100644 index 000000000000..0ab43b77f895 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_nat.tz--storage806237530--input453441034-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_nat.tz on storage '(Pair { Elt 0 1 } None)' and input 1 --level 1 --trace-stack +storage + (Pair { Elt 0 1 } (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.716) + [ (Pair 1 { Elt 0 1 } None) ] + - location: 12 (just consumed gas: 0.010) + [ 1 + (Pair { Elt 0 1 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt 0 1 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt 0 1 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: 13 (just consumed gas: 0.025) + [ 1 + { Elt 0 1 } + { Elt 0 1 } ] + - location: 17 (just consumed gas: 0.080) + [ False + { Elt 0 1 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt 0 1 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt 0 1 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt 0 1 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt 0 1 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt 0 1 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input1071610051-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input1071610051-.out new file mode 100644 index 000000000000..81c64f1d6432 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input1071610051-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"baz"' --level 1 --trace-stack +storage + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.181) + [ (Pair "baz" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "baz" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "baz" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.089) + [ False + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input700475845-.out new file mode 100644 index 000000000000..f8c20cd106f9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input700475845-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.181) + [ (Pair "bar" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.089) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input905318451-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input905318451-.out new file mode 100644 index 000000000000..c7e7881bd1b3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage109689253--input905318451-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)' and input '"foo"' --level 1 --trace-stack +storage + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 10.181) + [ (Pair "foo" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "foo" + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (just consumed gas: 0.025) + [ "foo" + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (just consumed gas: 0.089) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage495706788--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage495706788--input700475845-.out new file mode 100644 index 000000000000..3de2b19f400b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage495706788--input700475845-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair {} None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair {} (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.480) + [ (Pair "bar" {} None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair {} None) ] + - location: 13 (just consumed gas: 0) + [ (Pair {} None) ] + - location: 15 (just consumed gas: 0.010) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + {} + {} ] + - location: 17 (just consumed gas: 0.083) + [ False + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + {} ] + - location: 19 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair {} (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage915708427--input700475845-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage915708427--input700475845-.out new file mode 100644 index 000000000000..732bcf3961df --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage915708427--input700475845-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair { Elt "foo" 1 } None)' and input '"bar"' --level 1 --trace-stack +storage + (Pair { Elt "foo" 1 } (Some False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.810) + [ (Pair "bar" { Elt "foo" 1 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "bar" + (Pair { Elt "foo" 1 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "foo" 1 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "foo" 1 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 13 (just consumed gas: 0.025) + [ "bar" + { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 17 (just consumed gas: 0.086) + [ False + { Elt "foo" 1 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some False) + { Elt "foo" 1 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "foo" 1 } + (Some False) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 1 } (Some False)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "foo" 1 } (Some False)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 1 } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage936682951--input905318451-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage936682951--input905318451-.out new file mode 100644 index 000000000000..ced3773aad93 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_mem_string.tz--storage936682951--input905318451-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_mem_string.tz on storage '(Pair { Elt "foo" 0 } None)' and input '"foo"' --level 1 --trace-stack +storage + (Pair { Elt "foo" 0 } (Some True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 9.810) + [ (Pair "foo" { Elt "foo" 0 } None) ] + - location: 12 (just consumed gas: 0.010) + [ "foo" + (Pair { Elt "foo" 0 } None) ] + - location: 13 (just consumed gas: 0) + [ (Pair { Elt "foo" 0 } None) ] + - location: 15 (just consumed gas: 0.010) + [ { Elt "foo" 0 } ] + - location: 16 (just consumed gas: 0.010) + [ { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 13 (just consumed gas: 0.025) + [ "foo" + { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 17 (just consumed gas: 0.086) + [ True + { Elt "foo" 0 } ] + - location: 18 (just consumed gas: 0.010) + [ (Some True) + { Elt "foo" 0 } ] + - location: 19 (just consumed gas: 0.010) + [ { Elt "foo" 0 } + (Some True) ] + - location: 20 (just consumed gas: 0.010) + [ (Pair { Elt "foo" 0 } (Some True)) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair { Elt "foo" 0 } (Some True)) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} { Elt "foo" 0 } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input15265129-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input15265129-.out new file mode 100644 index 000000000000..166f62c0323e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input15265129-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_size.tz on storage 111 and input '{ Elt "a" 1 }' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.829) + [ (Pair { Elt "a" 1 } 111) ] + - location: 9 (just consumed gas: 0.010) + [ { Elt "a" 1 } ] + - location: 10 (just consumed gas: 0.010) + [ 1 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input158311065-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input158311065-.out new file mode 100644 index 000000000000..9afc10a5a649 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input158311065-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_size.tz on storage 111 and input '{ Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 }' --level 1 --trace-stack +storage + 3 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 5.517) + [ (Pair { Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 } 111) ] + - location: 9 (just consumed gas: 0.010) + [ { Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 } ] + - location: 10 (just consumed gas: 0.010) + [ 3 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 3 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 3) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input456982702-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input456982702-.out new file mode 100644 index 000000000000..b5f22dfe4de4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input456982702-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_size.tz on storage 111 and input '{ Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 ; Elt "d" 4 ; Elt "e" 5 ; Elt "f" 6 }' --level 1 --trace-stack +storage + 6 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.556) + [ (Pair { Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 ; Elt "d" 4 ; Elt "e" 5 ; Elt "f" 6 } 111) ] + - location: 9 (just consumed gas: 0.010) + [ { Elt "a" 1 ; Elt "b" 2 ; Elt "c" 3 ; Elt "d" 4 ; Elt "e" 5 ; Elt "f" 6 } ] + - location: 10 (just consumed gas: 0.010) + [ 6 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 6 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 6) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input457300675-.out new file mode 100644 index 000000000000..9de64fa7bd25 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -map_size.tz--storage492856247--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/map_size.tz on storage 111 and input '{}' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.523) + [ (Pair {} 111) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ 0 ] + - location: 11 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mul.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mul.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..dc2064f90855 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mul.tz--storage125992234--input125992234-.out @@ -0,0 +1,131 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/mul.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 50.799) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ Unit ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ 7987 ] + - location: 12 (just consumed gas: 0.010) + [ 10 + 7987 ] + - location: 15 (just consumed gas: 0) + [ 79870 ] + - location: 16 (just consumed gas: 0.010) + [ 79870 + 79870 ] + - location: 19 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 10 ] + - location: 31 (just consumed gas: 0.010) + [ 7987 + 10 ] + - location: 34 (just consumed gas: 0) + [ 79870 ] + - location: 35 (just consumed gas: 0.010) + [ 79870 + 79870 ] + - location: 38 (just consumed gas: 0.035) + [ 0 ] + - location: 40 (just consumed gas: 0.010) + [ True ] + - location: 41 (just consumed gas: 0) + [ ] + - location: 41 (just consumed gas: 0.015) + [ ] + - location: 47 (just consumed gas: 0.010) + [ 10 ] + - location: 50 (just consumed gas: 0.010) + [ -7987 + 10 ] + - location: 53 (just consumed gas: 0.061) + [ -79870 ] + - location: 54 (just consumed gas: 0.010) + [ -79870 + -79870 ] + - location: 57 (just consumed gas: 0.035) + [ 0 ] + - location: 59 (just consumed gas: 0.010) + [ True ] + - location: 60 (just consumed gas: 0) + [ ] + - location: 60 (just consumed gas: 0.015) + [ ] + - location: 66 (just consumed gas: 0.010) + [ 10 ] + - location: 69 (just consumed gas: 0.010) + [ -7987 + 10 ] + - location: 72 (just consumed gas: 0.061) + [ -79870 ] + - location: 73 (just consumed gas: 0.010) + [ -79870 + -79870 ] + - location: 76 (just consumed gas: 0.035) + [ 0 ] + - location: 78 (just consumed gas: 0.010) + [ True ] + - location: 79 (just consumed gas: 0) + [ ] + - location: 79 (just consumed gas: 0.015) + [ ] + - location: 85 (just consumed gas: 0.010) + [ -10 ] + - location: 88 (just consumed gas: 0.010) + [ 7987 + -10 ] + - location: 91 (just consumed gas: 0.061) + [ -79870 ] + - location: 92 (just consumed gas: 0.010) + [ -79870 + -79870 ] + - location: 95 (just consumed gas: 0.035) + [ 0 ] + - location: 97 (just consumed gas: 0.010) + [ True ] + - location: 98 (just consumed gas: 0) + [ ] + - location: 98 (just consumed gas: 0.015) + [ ] + - location: 104 (just consumed gas: 0.010) + [ 10 ] + - location: 107 (just consumed gas: 0.010) + [ 7987 + 10 ] + - location: 110 (just consumed gas: 0.061) + [ 79870 ] + - location: 111 (just consumed gas: 0.010) + [ 79870 + 79870 ] + - location: 114 (just consumed gas: 0.035) + [ 0 ] + - location: 116 (just consumed gas: 0.010) + [ True ] + - location: 117 (just consumed gas: 0) + [ ] + - location: 117 (just consumed gas: 0.015) + [ ] + - location: 123 (just consumed gas: 0.010) + [ Unit ] + - location: 124 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 126 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage151303925--input216277421-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage151303925--input216277421-.out new file mode 100644 index 000000000000..a550c6057926 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage151303925--input216277421-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz on storage 0x00 and input 257 --level 1 --trace-stack +storage + 0x0101000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.947) + [ (Pair 257 0x0000000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 257 ] + - location: 8 (just consumed gas: 0.010) + [ 1 + 257 ] + - location: 11 (just consumed gas: 0.010) + [ 257 + 1 ] + - location: 12 (just consumed gas: 0.080) + [ (Some (Pair 257 0)) ] + - location: 14 (just consumed gas: 0) + [ (Pair 257 0) ] + - location: 14 (just consumed gas: 0.015) + [ (Pair 257 0) ] + - location: 20 (just consumed gas: 0.010) + [ 257 ] + - location: 21 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 257 ] + - location: 24 (just consumed gas: 0.267) + [ 0x0101000000000000000000000000000000000000000000000000000000000000 ] + - location: 25 (just consumed gas: 0.010) + [ {} + 0x0101000000000000000000000000000000000000000000000000000000000000 ] + - location: 27 (just consumed gas: 0.010) + [ (Pair {} 0x0101000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage287799761--input485842614-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage287799761--input485842614-.out new file mode 100644 index 000000000000..9af664a7391c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -mutez_to_bls12_381_fr.tz--storage287799761--input485842614-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz on storage 0x02 and input 16 --level 1 --trace-stack +storage + 0x1000000000000000000000000000000000000000000000000000000000000000 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 10.947) + [ (Pair 16 0x0200000000000000000000000000000000000000000000000000000000000000) ] + - location: 7 (just consumed gas: 0.010) + [ 16 ] + - location: 8 (just consumed gas: 0.010) + [ 1 + 16 ] + - location: 11 (just consumed gas: 0.010) + [ 16 + 1 ] + - location: 12 (just consumed gas: 0.080) + [ (Some (Pair 16 0)) ] + - location: 14 (just consumed gas: 0) + [ (Pair 16 0) ] + - location: 14 (just consumed gas: 0.015) + [ (Pair 16 0) ] + - location: 20 (just consumed gas: 0.010) + [ 16 ] + - location: 21 (just consumed gas: 0.010) + [ 0x0100000000000000000000000000000000000000000000000000000000000000 + 16 ] + - location: 24 (just consumed gas: 0.266) + [ 0x1000000000000000000000000000000000000000000000000000000000000000 ] + - location: 25 (just consumed gas: 0.010) + [ {} + 0x1000000000000000000000000000000000000000000000000000000000000000 ] + - location: 27 (just consumed gas: 0.010) + [ (Pair {} 0x1000000000000000000000000000000000000000000000000000000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input1067298059-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input1067298059-.out new file mode 100644 index 000000000000..d56b22b7c5e5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input1067298059-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/neg.tz on storage 0 and input '(Left -2)' --level 1 --trace-stack +storage + 2 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.169) + [ (Pair (Left -2) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Left -2) ] + - location: 10 (just consumed gas: 0) + [ -2 ] + - location: 12 (just consumed gas: 0.025) + [ 2 ] + - location: 10 (just consumed gas: 0.015) + [ 2 ] + - location: 15 (just consumed gas: 0.010) + [ {} + 2 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} 2) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input380029349-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input380029349-.out new file mode 100644 index 000000000000..a9ceb484b962 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input380029349-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/neg.tz on storage 0 and input '(Right 2)' --level 1 --trace-stack +storage + -2 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.169) + [ (Pair (Right 2) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Right 2) ] + - location: 10 (just consumed gas: 0) + [ 2 ] + - location: 14 (just consumed gas: 0.025) + [ -2 ] + - location: 10 (just consumed gas: 0.015) + [ -2 ] + - location: 15 (just consumed gas: 0.010) + [ {} + -2 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} -2) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input563503226-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input563503226-.out new file mode 100644 index 000000000000..54434f2243fc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input563503226-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/neg.tz on storage 0 and input '(Left 2)' --level 1 --trace-stack +storage + -2 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.169) + [ (Pair (Left 2) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Left 2) ] + - location: 10 (just consumed gas: 0) + [ 2 ] + - location: 12 (just consumed gas: 0.025) + [ -2 ] + - location: 10 (just consumed gas: 0.015) + [ -2 ] + - location: 15 (just consumed gas: 0.010) + [ {} + -2 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} -2) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input788662499-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input788662499-.out new file mode 100644 index 000000000000..8e38b7a77ae9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input788662499-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/neg.tz on storage 0 and input '(Right 0)' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.169) + [ (Pair (Right 0) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Right 0) ] + - location: 10 (just consumed gas: 0) + [ 0 ] + - location: 14 (just consumed gas: 0.025) + [ 0 ] + - location: 10 (just consumed gas: 0.015) + [ 0 ] + - location: 15 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input972832189-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input972832189-.out new file mode 100644 index 000000000000..98477c30f52c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -neg.tz--storage680650890--input972832189-.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/neg.tz on storage 0 and input '(Left 0)' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.169) + [ (Pair (Left 0) 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Left 0) ] + - location: 10 (just consumed gas: 0) + [ 0 ] + - location: 12 (just consumed gas: 0.025) + [ 0 ] + - location: 10 (just consumed gas: 0.015) + [ 0 ] + - location: 15 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -none.tz--storage11179311--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -none.tz--storage11179311--input125992234-.out new file mode 100644 index 000000000000..82d297c185eb --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -none.tz--storage11179311--input125992234-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/none.tz on storage 'Some 10' and input Unit --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.773) + [ (Pair Unit (Some 10)) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ None ] + - location: 11 (just consumed gas: 0.010) + [ {} + None ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input570553153-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input570553153-.out new file mode 100644 index 000000000000..bb2b3e10e447 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input570553153-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not.tz on storage None and input False --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair False None) ] + - location: 8 (just consumed gas: 0.010) + [ False ] + - location: 9 (just consumed gas: 0.010) + [ True ] + - location: 10 (just consumed gas: 0.010) + [ (Some True) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input954397288-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input954397288-.out new file mode 100644 index 000000000000..b4d07549f8d5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not.tz--storage921624073--input954397288-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not.tz on storage None and input True --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair True None) ] + - location: 8 (just consumed gas: 0.010) + [ True ] + - location: 9 (just consumed gas: 0.010) + [ False ] + - location: 10 (just consumed gas: 0.010) + [ (Some False) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input1051197453-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input1051197453-.out new file mode 100644 index 000000000000..b4f5c6e99834 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input1051197453-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Right 8)' --level 1 --trace-stack +storage + (Some -9) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Right 8) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Right 8) ] + - location: 11 (just consumed gas: 0) + [ 8 ] + - location: 15 (just consumed gas: 0.025) + [ -9 ] + - location: 11 (just consumed gas: 0.015) + [ -9 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -9) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -9) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -9)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input123939249-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input123939249-.out new file mode 100644 index 000000000000..b1aaf14833b1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input123939249-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Left 7)' --level 1 --trace-stack +storage + (Some -8) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Left 7) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Left 7) ] + - location: 11 (just consumed gas: 0) + [ 7 ] + - location: 13 (just consumed gas: 0.025) + [ -8 ] + - location: 11 (just consumed gas: 0.015) + [ -8 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -8) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -8) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -8)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input24243730-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input24243730-.out new file mode 100644 index 000000000000..f50bf987b976 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input24243730-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Left -8)' --level 1 --trace-stack +storage + (Some 7) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Left -8) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Left -8) ] + - location: 11 (just consumed gas: 0) + [ -8 ] + - location: 13 (just consumed gas: 0.025) + [ 7 ] + - location: 11 (just consumed gas: 0.015) + [ 7 ] + - location: 16 (just consumed gas: 0.010) + [ (Some 7) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some 7) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some 7)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input518945720-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input518945720-.out new file mode 100644 index 000000000000..bf59b7ba1336 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input518945720-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Left 8)' --level 1 --trace-stack +storage + (Some -9) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Left 8) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Left 8) ] + - location: 11 (just consumed gas: 0) + [ 8 ] + - location: 13 (just consumed gas: 0.025) + [ -9 ] + - location: 11 (just consumed gas: 0.015) + [ -9 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -9) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -9) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -9)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input788662499-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input788662499-.out new file mode 100644 index 000000000000..1cb7ba4b6dc7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input788662499-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Right 0)' --level 1 --trace-stack +storage + (Some -1) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Right 0) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Right 0) ] + - location: 11 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.025) + [ -1 ] + - location: 11 (just consumed gas: 0.015) + [ -1 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -1) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -1)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input906118781-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input906118781-.out new file mode 100644 index 000000000000..c74f4b05a4e0 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input906118781-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Right 7)' --level 1 --trace-stack +storage + (Some -8) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Right 7) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Right 7) ] + - location: 11 (just consumed gas: 0) + [ 7 ] + - location: 15 (just consumed gas: 0.025) + [ -8 ] + - location: 11 (just consumed gas: 0.015) + [ -8 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -8) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -8) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -8)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input921874253-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input921874253-.out new file mode 100644 index 000000000000..e8116332633c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input921874253-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Left -9)' --level 1 --trace-stack +storage + (Some 8) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Left -9) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Left -9) ] + - location: 11 (just consumed gas: 0) + [ -9 ] + - location: 13 (just consumed gas: 0.025) + [ 8 ] + - location: 11 (just consumed gas: 0.015) + [ 8 ] + - location: 16 (just consumed gas: 0.010) + [ (Some 8) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some 8) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some 8)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input972832189-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input972832189-.out new file mode 100644 index 000000000000..0ac4602812b6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_binary.tz--storage921624073--input972832189-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_binary.tz on storage None and input '(Left 0)' --level 1 --trace-stack +storage + (Some -1) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.965) + [ (Pair (Left 0) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Left 0) ] + - location: 11 (just consumed gas: 0) + [ 0 ] + - location: 13 (just consumed gas: 0.025) + [ -1 ] + - location: 11 (just consumed gas: 0.015) + [ -1 ] + - location: 16 (just consumed gas: 0.010) + [ (Some -1) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some -1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some -1)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..bf55c1efbbfc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -not_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,66 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/not_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 25.094) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0x05 ] + - location: 11 (just consumed gas: 0.030) + [ 0xfa ] + - location: 12 (just consumed gas: 0.010) + [ 0xfa + 0xfa ] + - location: 17 (just consumed gas: 0.035) + [ 0 ] + - location: 18 (just consumed gas: 0.010) + [ True ] + - location: 19 (just consumed gas: 0) + [ ] + - location: 19 (just consumed gas: 0.015) + [ ] + - location: 25 (just consumed gas: 0.010) + [ 0x0005 ] + - location: 28 (just consumed gas: 0.031) + [ 0xfffa ] + - location: 29 (just consumed gas: 0.010) + [ 0xfffa + 0xfffa ] + - location: 34 (just consumed gas: 0.035) + [ 0 ] + - location: 35 (just consumed gas: 0.010) + [ True ] + - location: 36 (just consumed gas: 0) + [ ] + - location: 36 (just consumed gas: 0.015) + [ ] + - location: 42 (just consumed gas: 0.010) + [ 0xff05 ] + - location: 45 (just consumed gas: 0.031) + [ 0x00fa ] + - location: 46 (just consumed gas: 0.010) + [ 0x00fa + 0x00fa ] + - location: 51 (just consumed gas: 0.035) + [ 0 ] + - location: 52 (just consumed gas: 0.010) + [ True ] + - location: 53 (just consumed gas: 0) + [ ] + - location: 53 (just consumed gas: 0.015) + [ ] + - location: 59 (just consumed gas: 0.010) + [ Unit ] + - location: 60 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 62 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input106930123-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input106930123-.out new file mode 100644 index 000000000000..36c71e89510e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input106930123-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or.tz on storage None and input '(Pair False True)' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.115) + [ (Pair (Pair False True) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair False True) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair False True) + (Pair False True) ] + - location: 12 (just consumed gas: 0.010) + [ False + (Pair False True) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair False True) + False ] + - location: 14 (just consumed gas: 0.010) + [ True + False ] + - location: 15 (just consumed gas: 0.010) + [ True ] + - location: 16 (just consumed gas: 0.010) + [ (Some True) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input181204719-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input181204719-.out new file mode 100644 index 000000000000..b3f80ea811b3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input181204719-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or.tz on storage None and input '(Pair True False)' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.115) + [ (Pair (Pair True False) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair True False) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair True False) + (Pair True False) ] + - location: 12 (just consumed gas: 0.010) + [ True + (Pair True False) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair True False) + True ] + - location: 14 (just consumed gas: 0.010) + [ False + True ] + - location: 15 (just consumed gas: 0.010) + [ True ] + - location: 16 (just consumed gas: 0.010) + [ (Some True) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input223774825-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input223774825-.out new file mode 100644 index 000000000000..d7e82daabd7f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input223774825-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or.tz on storage None and input '(Pair False False)' --level 1 --trace-stack +storage + (Some False) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.115) + [ (Pair (Pair False False) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair False False) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair False False) + (Pair False False) ] + - location: 12 (just consumed gas: 0.010) + [ False + (Pair False False) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair False False) + False ] + - location: 14 (just consumed gas: 0.010) + [ False + False ] + - location: 15 (just consumed gas: 0.010) + [ False ] + - location: 16 (just consumed gas: 0.010) + [ (Some False) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input908807505-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input908807505-.out new file mode 100644 index 000000000000..65cbf8d92cb6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or.tz--storage921624073--input908807505-.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or.tz on storage None and input '(Pair True True)' --level 1 --trace-stack +storage + (Some True) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 8.115) + [ (Pair (Pair True True) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair True True) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair True True) + (Pair True True) ] + - location: 12 (just consumed gas: 0.010) + [ True + (Pair True True) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair True True) + True ] + - location: 14 (just consumed gas: 0.010) + [ True + True ] + - location: 15 (just consumed gas: 0.010) + [ True ] + - location: 16 (just consumed gas: 0.010) + [ (Some True) ] + - location: 17 (just consumed gas: 0.010) + [ {} + (Some True) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair {} (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input1056991424-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input1056991424-.out new file mode 100644 index 000000000000..f3c629f72ec3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input1056991424-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 0 8)' --level 1 --trace-stack +storage + (Some 8) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 0 8) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 8) ] + - location: 11 (just consumed gas: 0.010) + [ 0 + 8 ] + - location: 12 (just consumed gas: 0.035) + [ 8 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 8) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 8) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 8)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input375993021-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input375993021-.out new file mode 100644 index 000000000000..15e7a3d933be --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input375993021-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 14 1)' --level 1 --trace-stack +storage + (Some 15) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 14 1) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 14 1) ] + - location: 11 (just consumed gas: 0.010) + [ 14 + 1 ] + - location: 12 (just consumed gas: 0.035) + [ 15 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 15) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 15) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 15)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input673240563-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input673240563-.out new file mode 100644 index 000000000000..d35afecadb7d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input673240563-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 8 0)' --level 1 --trace-stack +storage + (Some 8) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 8 0) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 8 0) ] + - location: 11 (just consumed gas: 0.010) + [ 8 + 0 ] + - location: 12 (just consumed gas: 0.035) + [ 8 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 8) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 8) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 8)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input747448890-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input747448890-.out new file mode 100644 index 000000000000..b967c05ba072 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input747448890-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 7 7)' --level 1 --trace-stack +storage + (Some 7) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 7 7) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 7 7) ] + - location: 11 (just consumed gas: 0.010) + [ 7 + 7 ] + - location: 12 (just consumed gas: 0.035) + [ 7 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 7) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 7) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 7)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input832403787-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input832403787-.out new file mode 100644 index 000000000000..fe4e2218b249 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input832403787-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 15 4)' --level 1 --trace-stack +storage + (Some 15) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 15 4) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 15 4) ] + - location: 11 (just consumed gas: 0.010) + [ 15 + 4 ] + - location: 12 (just consumed gas: 0.035) + [ 15 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 15) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 15) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 15)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input858098961-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input858098961-.out new file mode 100644 index 000000000000..63b6e11321c6 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_binary.tz--storage921624073--input858098961-.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_binary.tz on storage None and input '(Pair 4 8)' --level 1 --trace-stack +storage + (Some 12) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 6.141) + [ (Pair (Pair 4 8) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 4 8) ] + - location: 11 (just consumed gas: 0.010) + [ 4 + 8 ] + - location: 12 (just consumed gas: 0.035) + [ 12 ] + - location: 13 (just consumed gas: 0.010) + [ (Some 12) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some 12) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some 12)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..939ffc693d0b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -or_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,75 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/or_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 28.329) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0x05 ] + - location: 11 (just consumed gas: 0.010) + [ 0x06 + 0x05 ] + - location: 14 (just consumed gas: 0.030) + [ 0x07 ] + - location: 15 (just consumed gas: 0.010) + [ 0x07 + 0x07 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 0x0005 ] + - location: 31 (just consumed gas: 0.010) + [ 0x0106 + 0x0005 ] + - location: 34 (just consumed gas: 0.031) + [ 0x0107 ] + - location: 35 (just consumed gas: 0.010) + [ 0x0107 + 0x0107 ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 0x05 ] + - location: 51 (just consumed gas: 0.010) + [ 0x0106 + 0x05 ] + - location: 54 (just consumed gas: 0.031) + [ 0x0107 ] + - location: 55 (just consumed gas: 0.010) + [ 0x0107 + 0x0107 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ Unit ] + - location: 69 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 71 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input305844558-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input305844558-.out new file mode 100644 index 000000000000..bac21899e9a2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input305844558-.out @@ -0,0 +1,845 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/packunpack_rev.tz on storage Unit and input '(Pair -1 (Pair 1 (Pair "foobar" (Pair 0x00AABBCC (Pair 1000 (Pair False (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5"))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 148.183) + [ (Pair (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + Unit) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 17 (just consumed gas: 0.010) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 18 (just consumed gas: 0.010) + [ -1 + (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 19 (just consumed gas: 0) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 21 (just consumed gas: 0.010) + [ -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 19 (just consumed gas: 0.025) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 22 (just consumed gas: 0.241) + [ 0x050041 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 23 (just consumed gas: 0.421) + [ (Some -1) + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 26 (just consumed gas: 0) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 26 (just consumed gas: 0.015) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 34 (just consumed gas: 0.035) + [ 0 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 35 (just consumed gas: 0.010) + [ True + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 36 (just consumed gas: 0) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 36 (just consumed gas: 0.015) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 42 (just consumed gas: 0.010) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 43 (just consumed gas: 0.010) + [ 1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 44 (just consumed gas: 0) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 46 (just consumed gas: 0.010) + [ 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 44 (just consumed gas: 0.025) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 47 (just consumed gas: 0.241) + [ 0x050001 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 48 (just consumed gas: 0.421) + [ (Some 1) + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 51 (just consumed gas: 0) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 51 (just consumed gas: 0.015) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 59 (just consumed gas: 0.035) + [ 0 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 60 (just consumed gas: 0.010) + [ True + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 61 (just consumed gas: 0) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 61 (just consumed gas: 0.015) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 67 (just consumed gas: 0.010) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 68 (just consumed gas: 0.010) + [ "foobar" + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 69 (just consumed gas: 0) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 71 (just consumed gas: 0.010) + [ "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 69 (just consumed gas: 0.025) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 72 (just consumed gas: 0.276) + [ 0x050100000006666f6f626172 + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 73 (just consumed gas: 0.680) + [ (Some "foobar") + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 76 (just consumed gas: 0) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 76 (just consumed gas: 0.015) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 84 (just consumed gas: 0.035) + [ 0 + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 85 (just consumed gas: 0.010) + [ True + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 86 (just consumed gas: 0) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 86 (just consumed gas: 0.015) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 92 (just consumed gas: 0.010) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 93 (just consumed gas: 0.010) + [ 0x00aabbcc + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 94 (just consumed gas: 0) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 96 (just consumed gas: 0.010) + [ 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 94 (just consumed gas: 0.025) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 97 (just consumed gas: 0.256) + [ 0x050a0000000400aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 98 (just consumed gas: 0.565) + [ (Some 0x00aabbcc) + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 101 (just consumed gas: 0) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 101 (just consumed gas: 0.015) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 109 (just consumed gas: 0.035) + [ 0 + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 110 (just consumed gas: 0.010) + [ True + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 111 (just consumed gas: 0) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 111 (just consumed gas: 0.015) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 117 (just consumed gas: 0.010) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 118 (just consumed gas: 0.010) + [ 1000 + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 119 (just consumed gas: 0) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 121 (just consumed gas: 0.010) + [ 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 119 (just consumed gas: 0.025) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 122 (just consumed gas: 0.266) + [ 0x0500a80f + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 123 (just consumed gas: 0.442) + [ (Some 1000) + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 126 (just consumed gas: 0) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 126 (just consumed gas: 0.015) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 134 (just consumed gas: 0.035) + [ 0 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 135 (just consumed gas: 0.010) + [ True + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 136 (just consumed gas: 0) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 136 (just consumed gas: 0.015) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 142 (just consumed gas: 0.010) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 143 (just consumed gas: 0.010) + [ False + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 144 (just consumed gas: 0) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 146 (just consumed gas: 0.010) + [ False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 144 (just consumed gas: 0.025) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 147 (just consumed gas: 0.216) + [ 0x050303 + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 148 (just consumed gas: 0.421) + [ (Some False) + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 151 (just consumed gas: 0) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 151 (just consumed gas: 0.015) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 159 (just consumed gas: 0.035) + [ 0 + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 160 (just consumed gas: 0.010) + [ True + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 161 (just consumed gas: 0) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 161 (just consumed gas: 0.015) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 167 (just consumed gas: 0.010) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 168 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 169 (just consumed gas: 0) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 171 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 169 (just consumed gas: 0.025) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 172 (just consumed gas: 0.496) + [ 0x050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 173 (just consumed gas: 0.963) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 176 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 176 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 184 (just consumed gas: 0.036) + [ 0 + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 185 (just consumed gas: 0.010) + [ True + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 186 (just consumed gas: 0) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 186 (just consumed gas: 0.015) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 192 (just consumed gas: 0.010) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 193 (just consumed gas: 0.010) + [ "2019-09-09T08:35:33Z" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 194 (just consumed gas: 0) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 196 (just consumed gas: 0.010) + [ "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 194 (just consumed gas: 0.025) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 197 (just consumed gas: 0.316) + [ 0x050095bbb0d70b + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 198 (just consumed gas: 0.503) + [ (Some "2019-09-09T08:35:33Z") + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 201 (just consumed gas: 0) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 201 (just consumed gas: 0.015) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 209 (just consumed gas: 0.035) + [ 0 + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 210 (just consumed gas: 0.010) + [ True + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 211 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 211 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 217 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 218 (just consumed gas: 0.506) + [ 0x050a000000160000bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 219 (just consumed gas: 0.984) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 222 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 222 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 230 (just consumed gas: 0.036) + [ 0 ] + - location: 231 (just consumed gas: 0.010) + [ True ] + - location: 232 (just consumed gas: 0) + [ ] + - location: 232 (just consumed gas: 0.015) + [ ] + - location: 238 (just consumed gas: 0.010) + [ 0 ] + - location: 241 (just consumed gas: 0.216) + [ 0x050000 ] + - location: 242 (just consumed gas: 0.421) + [ (Some 0) ] + - location: 245 (just consumed gas: 0) + [ 0 ] + - location: 245 (just consumed gas: 0.015) + [ 0 ] + - location: 251 (just consumed gas: 0.010) + [ ] + - location: 252 (just consumed gas: 0.010) + [ -1 ] + - location: 255 (just consumed gas: 0.241) + [ 0x050041 ] + - location: 256 (just consumed gas: 96.321) + [ None ] + - location: 259 (just consumed gas: 0) + [ ] + - location: 259 (just consumed gas: 0.015) + [ ] + - location: 265 (just consumed gas: 0.010) + [ 0x ] + - location: 268 (just consumed gas: 0.260) + [ None ] + - location: 271 (just consumed gas: 0) + [ ] + - location: 271 (just consumed gas: 0.015) + [ ] + - location: 277 (just consumed gas: 0.010) + [ 0x04 ] + - location: 280 (just consumed gas: 0.280) + [ None ] + - location: 283 (just consumed gas: 0) + [ ] + - location: 283 (just consumed gas: 0.015) + [ ] + - location: 289 (just consumed gas: 0.010) + [ 0x05 ] + - location: 292 (just consumed gas: 0.280) + [ None ] + - location: 295 (just consumed gas: 0) + [ ] + - location: 295 (just consumed gas: 0.015) + [ ] + - location: 301 (just consumed gas: 0.010) + [ Unit ] + - location: 302 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 304 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input646365167-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input646365167-.out new file mode 100644 index 000000000000..4abf2e896b0e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev.tz--storage125992234--input646365167-.out @@ -0,0 +1,845 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/packunpack_rev.tz on storage Unit and input '(Pair -1 (Pair 1 (Pair "foobar" (Pair 0x00AABBCC (Pair 1000 (Pair False (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5"))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 148.183) + [ (Pair (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + Unit) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 17 (just consumed gas: 0.010) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 18 (just consumed gas: 0.010) + [ -1 + (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 19 (just consumed gas: 0) + [ (Pair -1 + 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 21 (just consumed gas: 0.010) + [ -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 19 (just consumed gas: 0.025) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 22 (just consumed gas: 0.241) + [ 0x050041 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 23 (just consumed gas: 0.421) + [ (Some -1) + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 26 (just consumed gas: 0) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 26 (just consumed gas: 0.015) + [ -1 + -1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 34 (just consumed gas: 0.035) + [ 0 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 35 (just consumed gas: 0.010) + [ True + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 36 (just consumed gas: 0) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 36 (just consumed gas: 0.015) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 42 (just consumed gas: 0.010) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 43 (just consumed gas: 0.010) + [ 1 + (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 44 (just consumed gas: 0) + [ (Pair 1 + "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 46 (just consumed gas: 0.010) + [ 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 44 (just consumed gas: 0.025) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 47 (just consumed gas: 0.241) + [ 0x050001 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 48 (just consumed gas: 0.421) + [ (Some 1) + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 51 (just consumed gas: 0) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 51 (just consumed gas: 0.015) + [ 1 + 1 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 59 (just consumed gas: 0.035) + [ 0 + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 60 (just consumed gas: 0.010) + [ True + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 61 (just consumed gas: 0) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 61 (just consumed gas: 0.015) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 67 (just consumed gas: 0.010) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 68 (just consumed gas: 0.010) + [ "foobar" + (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 69 (just consumed gas: 0) + [ (Pair "foobar" + 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 71 (just consumed gas: 0.010) + [ "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 69 (just consumed gas: 0.025) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 72 (just consumed gas: 0.276) + [ 0x050100000006666f6f626172 + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 73 (just consumed gas: 0.680) + [ (Some "foobar") + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 76 (just consumed gas: 0) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 76 (just consumed gas: 0.015) + [ "foobar" + "foobar" + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 84 (just consumed gas: 0.035) + [ 0 + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 85 (just consumed gas: 0.010) + [ True + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 86 (just consumed gas: 0) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 86 (just consumed gas: 0.015) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 92 (just consumed gas: 0.010) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 93 (just consumed gas: 0.010) + [ 0x00aabbcc + (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 94 (just consumed gas: 0) + [ (Pair 0x00aabbcc + 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 96 (just consumed gas: 0.010) + [ 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 94 (just consumed gas: 0.025) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 97 (just consumed gas: 0.256) + [ 0x050a0000000400aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 98 (just consumed gas: 0.565) + [ (Some 0x00aabbcc) + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 101 (just consumed gas: 0) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 101 (just consumed gas: 0.015) + [ 0x00aabbcc + 0x00aabbcc + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 109 (just consumed gas: 0.035) + [ 0 + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 110 (just consumed gas: 0.010) + [ True + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 111 (just consumed gas: 0) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 111 (just consumed gas: 0.015) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 117 (just consumed gas: 0.010) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 118 (just consumed gas: 0.010) + [ 1000 + (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 119 (just consumed gas: 0) + [ (Pair 1000 + False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 121 (just consumed gas: 0.010) + [ 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 119 (just consumed gas: 0.025) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 122 (just consumed gas: 0.266) + [ 0x0500a80f + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 123 (just consumed gas: 0.442) + [ (Some 1000) + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 126 (just consumed gas: 0) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 126 (just consumed gas: 0.015) + [ 1000 + 1000 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 134 (just consumed gas: 0.035) + [ 0 + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 135 (just consumed gas: 0.010) + [ True + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 136 (just consumed gas: 0) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 136 (just consumed gas: 0.015) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 142 (just consumed gas: 0.010) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 143 (just consumed gas: 0.010) + [ False + (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 144 (just consumed gas: 0) + [ (Pair False + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 146 (just consumed gas: 0.010) + [ False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 144 (just consumed gas: 0.025) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 147 (just consumed gas: 0.216) + [ 0x050303 + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 148 (just consumed gas: 0.421) + [ (Some False) + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 151 (just consumed gas: 0) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 151 (just consumed gas: 0.015) + [ False + False + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 159 (just consumed gas: 0.035) + [ 0 + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 160 (just consumed gas: 0.010) + [ True + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 161 (just consumed gas: 0) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 161 (just consumed gas: 0.015) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 167 (just consumed gas: 0.010) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 168 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 169 (just consumed gas: 0) + [ (Pair "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 171 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 169 (just consumed gas: 0.025) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 172 (just consumed gas: 0.496) + [ 0x050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 173 (just consumed gas: 0.963) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 176 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 176 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 184 (just consumed gas: 0.036) + [ 0 + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 185 (just consumed gas: 0.010) + [ True + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 186 (just consumed gas: 0) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 186 (just consumed gas: 0.015) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 192 (just consumed gas: 0.010) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 193 (just consumed gas: 0.010) + [ "2019-09-09T08:35:33Z" + (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 194 (just consumed gas: 0) + [ (Pair "2019-09-09T08:35:33Z" "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") ] + - location: 196 (just consumed gas: 0.010) + [ "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 194 (just consumed gas: 0.025) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 197 (just consumed gas: 0.316) + [ 0x050095bbb0d70b + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 198 (just consumed gas: 0.503) + [ (Some "2019-09-09T08:35:33Z") + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 201 (just consumed gas: 0) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 201 (just consumed gas: 0.015) + [ "2019-09-09T08:35:33Z" + "2019-09-09T08:35:33Z" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 209 (just consumed gas: 0.035) + [ 0 + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 210 (just consumed gas: 0.010) + [ True + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 211 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 211 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 217 (just consumed gas: 0.010) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 218 (just consumed gas: 0.506) + [ 0x050a000000160000bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 219 (just consumed gas: 0.984) + [ (Some "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 222 (just consumed gas: 0) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 222 (just consumed gas: 0.015) + [ "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" + "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5" ] + - location: 230 (just consumed gas: 0.036) + [ 0 ] + - location: 231 (just consumed gas: 0.010) + [ True ] + - location: 232 (just consumed gas: 0) + [ ] + - location: 232 (just consumed gas: 0.015) + [ ] + - location: 238 (just consumed gas: 0.010) + [ 0 ] + - location: 241 (just consumed gas: 0.216) + [ 0x050000 ] + - location: 242 (just consumed gas: 0.421) + [ (Some 0) ] + - location: 245 (just consumed gas: 0) + [ 0 ] + - location: 245 (just consumed gas: 0.015) + [ 0 ] + - location: 251 (just consumed gas: 0.010) + [ ] + - location: 252 (just consumed gas: 0.010) + [ -1 ] + - location: 255 (just consumed gas: 0.241) + [ 0x050041 ] + - location: 256 (just consumed gas: 96.321) + [ None ] + - location: 259 (just consumed gas: 0) + [ ] + - location: 259 (just consumed gas: 0.015) + [ ] + - location: 265 (just consumed gas: 0.010) + [ 0x ] + - location: 268 (just consumed gas: 0.260) + [ None ] + - location: 271 (just consumed gas: 0) + [ ] + - location: 271 (just consumed gas: 0.015) + [ ] + - location: 277 (just consumed gas: 0.010) + [ 0x04 ] + - location: 280 (just consumed gas: 0.280) + [ None ] + - location: 283 (just consumed gas: 0) + [ ] + - location: 283 (just consumed gas: 0.015) + [ ] + - location: 289 (just consumed gas: 0.010) + [ 0x05 ] + - location: 292 (just consumed gas: 0.280) + [ None ] + - location: 295 (just consumed gas: 0) + [ ] + - location: 295 (just consumed gas: 0.015) + [ ] + - location: 301 (just consumed gas: 0.010) + [ Unit ] + - location: 302 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 304 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input1028781121-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input1028781121-.out new file mode 100644 index 000000000000..e38a8a743b6d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input1028781121-.out @@ -0,0 +1,1194 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/packunpack_rev_cty.tz on storage Unit and input '(Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" (Pair Unit (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") (Pair { Unit } (Pair { True } (Pair (Pair 19 10) (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK } )))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 28 (just consumed gas: 502.307) + [ (Pair (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + Unit) ] + - location: 28 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 29 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 30 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 31 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 33 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 31 (just consumed gas: 0.025) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 34 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 35 (just consumed gas: 0) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 37 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 38 (just consumed gas: 321.159) + [ (Some "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav") + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 41 (just consumed gas: 0) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 41 (just consumed gas: 0.015) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 47 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 35 (just consumed gas: 0.025) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 50 (just consumed gas: 0.035) + [ 0 + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 51 (just consumed gas: 0.010) + [ True + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 52 (just consumed gas: 0) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 52 (just consumed gas: 0.015) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 58 (just consumed gas: 0.010) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 59 (just consumed gas: 0.010) + [ Unit + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 60 (just consumed gas: 0) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 62 (just consumed gas: 0.010) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 60 (just consumed gas: 0.025) + [ Unit + Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 63 (just consumed gas: 0.216) + [ 0x05030b + Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 64 (just consumed gas: 0) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 66 (just consumed gas: 0.216) + [ 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 67 (just consumed gas: 0.421) + [ (Some Unit) + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 70 (just consumed gas: 0) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 70 (just consumed gas: 0.015) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 76 (just consumed gas: 0.216) + [ 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 64 (just consumed gas: 0.025) + [ 0x05030b + 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 79 (just consumed gas: 0.035) + [ 0 + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 80 (just consumed gas: 0.010) + [ True + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 81 (just consumed gas: 0) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 81 (just consumed gas: 0.015) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 87 (just consumed gas: 0.010) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 88 (just consumed gas: 0.010) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 89 (just consumed gas: 0) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 91 (just consumed gas: 0.010) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 89 (just consumed gas: 0.025) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 92 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 93 (just consumed gas: 0) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 95 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 96 (just consumed gas: 1.830) + [ (Some "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe") + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 99 (just consumed gas: 0) + [ "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 99 (just consumed gas: 0.015) + [ "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe" + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 105 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 93 (just consumed gas: 0.025) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 108 (just consumed gas: 0.036) + [ 0 + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 109 (just consumed gas: 0.010) + [ True + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 110 (just consumed gas: 0) + [ (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 110 (just consumed gas: 0.015) + [ (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 116 (just consumed gas: 0.010) + [ (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 117 (just consumed gas: 0.010) + [ (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 118 (just consumed gas: 0) + [ (Pair (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 120 (just consumed gas: 0.010) + [ (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 118 (just consumed gas: 0.025) + [ (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 121 (just consumed gas: 1.117) + [ 0x0505090a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 122 (just consumed gas: 0) + [ (Some "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 124 (just consumed gas: 1.117) + [ 0x0505090a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 125 (just consumed gas: 1.971) + [ (Some (Some "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe")) + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 129 (just consumed gas: 0) + [ (Some "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 129 (just consumed gas: 0.015) + [ (Some "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe") + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 135 (just consumed gas: 1.117) + [ 0x0505090a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 122 (just consumed gas: 0.025) + [ 0x0505090a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + 0x0505090a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 138 (just consumed gas: 0.036) + [ 0 + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 139 (just consumed gas: 0.010) + [ True + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 140 (just consumed gas: 0) + [ (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 140 (just consumed gas: 0.015) + [ (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 146 (just consumed gas: 0.010) + [ (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 147 (just consumed gas: 0.010) + [ { Unit } + (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 148 (just consumed gas: 0) + [ (Pair { Unit } + { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 150 (just consumed gas: 0.010) + [ { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 148 (just consumed gas: 0.025) + [ { Unit } + { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 151 (just consumed gas: 0.432) + [ 0x050200000002030b + { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 152 (just consumed gas: 0) + [ { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 154 (just consumed gas: 0.432) + [ 0x050200000002030b + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 155 (just consumed gas: 0.624) + [ (Some { Unit }) + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 159 (just consumed gas: 0) + [ { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 159 (just consumed gas: 0.015) + [ { Unit } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 165 (just consumed gas: 0.432) + [ 0x050200000002030b + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 152 (just consumed gas: 0.025) + [ 0x050200000002030b + 0x050200000002030b + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 168 (just consumed gas: 0.035) + [ 0 + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 169 (just consumed gas: 0.010) + [ True + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 170 (just consumed gas: 0) + [ (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 170 (just consumed gas: 0.015) + [ (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 176 (just consumed gas: 0.010) + [ (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 177 (just consumed gas: 0.010) + [ { True } + (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 178 (just consumed gas: 0) + [ (Pair { True } + (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 180 (just consumed gas: 0.010) + [ { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 178 (just consumed gas: 0.025) + [ { True } + { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 181 (just consumed gas: 0.432) + [ 0x050200000002030a + { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 182 (just consumed gas: 0) + [ { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 184 (just consumed gas: 0.432) + [ 0x050200000002030a + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 185 (just consumed gas: 0.756) + [ (Some { True }) + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 189 (just consumed gas: 0) + [ { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 189 (just consumed gas: 0.015) + [ { True } + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 195 (just consumed gas: 0.432) + [ 0x050200000002030a + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 182 (just consumed gas: 0.025) + [ 0x050200000002030a + 0x050200000002030a + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 198 (just consumed gas: 0.035) + [ 0 + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 199 (just consumed gas: 0.010) + [ True + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 200 (just consumed gas: 0) + [ (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 200 (just consumed gas: 0.015) + [ (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 206 (just consumed gas: 0.010) + [ (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 207 (just consumed gas: 0.010) + [ (Pair 19 10) + (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 208 (just consumed gas: 0) + [ (Pair (Pair 19 10) + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 210 (just consumed gas: 0.010) + [ (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 208 (just consumed gas: 0.025) + [ (Pair 19 10) + (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 211 (just consumed gas: 0.698) + [ 0x0507070013000a + (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 212 (just consumed gas: 0) + [ (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 214 (just consumed gas: 0.698) + [ 0x0507070013000a + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 215 (just consumed gas: 0.703) + [ (Some (Pair 19 10)) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 220 (just consumed gas: 0) + [ (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 220 (just consumed gas: 0.015) + [ (Pair 19 10) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 226 (just consumed gas: 0.698) + [ 0x0507070013000a + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 212 (just consumed gas: 0.025) + [ 0x0507070013000a + 0x0507070013000a + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 229 (just consumed gas: 0.035) + [ 0 + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 230 (just consumed gas: 0.010) + [ True + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 231 (just consumed gas: 0) + [ (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 231 (just consumed gas: 0.015) + [ (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 237 (just consumed gas: 0.010) + [ (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 238 (just consumed gas: 0.010) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 239 (just consumed gas: 0) + [ (Pair (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK }) ] + - location: 241 (just consumed gas: 0.010) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 239 (just consumed gas: 0.025) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 242 (just consumed gas: 0.712) + [ 0x0505050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 243 (just consumed gas: 0) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 245 (just consumed gas: 0.712) + [ 0x0505050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 246 (just consumed gas: 1.104) + [ (Some (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5")) + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 251 (just consumed gas: 0) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 251 (just consumed gas: 0.015) + [ (Left "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5") + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 257 (just consumed gas: 0.712) + [ 0x0505050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 243 (just consumed gas: 0.025) + [ 0x0505050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + 0x0505050a0000001500bdfe3885e846fdea23c9acbe3bb1cfcca9c03e4a + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 260 (just consumed gas: 0.035) + [ 0 + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 261 (just consumed gas: 0.010) + [ True + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 262 (just consumed gas: 0) + [ (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 262 (just consumed gas: 0.015) + [ (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 268 (just consumed gas: 0.010) + [ (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 269 (just consumed gas: 0.010) + [ { Elt 0 "foo" ; Elt 1 "bar" } + (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 270 (just consumed gas: 0) + [ (Pair { Elt 0 "foo" ; Elt 1 "bar" } { PACK }) ] + - location: 272 (just consumed gas: 0.010) + [ { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 270 (just consumed gas: 0.025) + [ { Elt 0 "foo" ; Elt 1 "bar" } + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 273 (just consumed gas: 1.467) + [ 0x050200000018070400000100000003666f6f070400010100000003626172 + { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 274 (just consumed gas: 0) + [ { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 276 (just consumed gas: 1.467) + [ 0x050200000018070400000100000003666f6f070400010100000003626172 + { PACK } ] + - location: 277 (just consumed gas: 1.658) + [ (Some { Elt 0 "foo" ; Elt 1 "bar" }) + { PACK } ] + - location: 282 (just consumed gas: 0) + [ { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 282 (just consumed gas: 0.015) + [ { Elt 0 "foo" ; Elt 1 "bar" } + { PACK } ] + - location: 288 (just consumed gas: 1.467) + [ 0x050200000018070400000100000003666f6f070400010100000003626172 + { PACK } ] + - location: 274 (just consumed gas: 0.025) + [ 0x050200000018070400000100000003666f6f070400010100000003626172 + 0x050200000018070400000100000003666f6f070400010100000003626172 + { PACK } ] + - location: 291 (just consumed gas: 0.035) + [ 0 + { PACK } ] + - location: 292 (just consumed gas: 0.010) + [ True + { PACK } ] + - location: 293 (just consumed gas: 0) + [ { PACK } ] + - location: 293 (just consumed gas: 0.015) + [ { PACK } ] + - location: 299 (just consumed gas: 0.010) + [ { PACK } + { PACK } ] + - location: 300 (just consumed gas: 0.597) + [ 0x050200000002030c + { PACK } ] + - location: 301 (just consumed gas: 0) + [ { PACK } ] + - location: 303 (just consumed gas: 0.597) + [ 0x050200000002030c ] + - location: 304 (just consumed gas: 1.024) + [ (Some { PACK }) ] + - location: 309 (just consumed gas: 0) + [ { PACK } ] + - location: 309 (just consumed gas: 0.015) + [ { PACK } ] + - location: 315 (just consumed gas: 0.597) + [ 0x050200000002030c ] + - location: 301 (just consumed gas: 0.025) + [ 0x050200000002030c + 0x050200000002030c ] + - location: 318 (just consumed gas: 0.035) + [ 0 ] + - location: 319 (just consumed gas: 0.010) + [ True ] + - location: 320 (just consumed gas: 0) + [ ] + - location: 320 (just consumed gas: 0.015) + [ ] + - location: 326 (just consumed gas: 0.010) + [ Unit ] + - location: 327 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 329 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input802670583-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input802670583-.out new file mode 100644 index 000000000000..b701e35a9636 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -packunpack_rev_cty.tz--storage125992234--input802670583-.out @@ -0,0 +1,1032 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/packunpack_rev_cty.tz on storage Unit and input '(Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" (Pair Unit (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" (Pair None (Pair { } (Pair { } (Pair (Pair 40 -10) (Pair (Right "2019-09-09T08:35:33Z") (Pair { } { DUP ; DROP ; PACK } )))))))))' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 28 (just consumed gas: 492.580) + [ (Pair (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + Unit) ] + - location: 28 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 29 (just consumed gas: 0.010) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 30 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 31 (just consumed gas: 0) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 33 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 31 (just consumed gas: 0.025) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 34 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 35 (just consumed gas: 0) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 37 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 38 (just consumed gas: 321.159) + [ (Some "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav") + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 41 (just consumed gas: 0) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 41 (just consumed gas: 0.015) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 47 (just consumed gas: 1.001) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 35 (just consumed gas: 0.025) + [ 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + 0x050a00000021004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 50 (just consumed gas: 0.035) + [ 0 + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 51 (just consumed gas: 0.010) + [ True + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 52 (just consumed gas: 0) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 52 (just consumed gas: 0.015) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 58 (just consumed gas: 0.010) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 59 (just consumed gas: 0.010) + [ Unit + (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 60 (just consumed gas: 0) + [ (Pair Unit + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 62 (just consumed gas: 0.010) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 60 (just consumed gas: 0.025) + [ Unit + Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 63 (just consumed gas: 0.216) + [ 0x05030b + Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 64 (just consumed gas: 0) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 66 (just consumed gas: 0.216) + [ 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 67 (just consumed gas: 0.421) + [ (Some Unit) + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 70 (just consumed gas: 0) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 70 (just consumed gas: 0.015) + [ Unit + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 76 (just consumed gas: 0.216) + [ 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 64 (just consumed gas: 0.025) + [ 0x05030b + 0x05030b + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 79 (just consumed gas: 0.035) + [ 0 + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 80 (just consumed gas: 0.010) + [ True + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 81 (just consumed gas: 0) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 81 (just consumed gas: 0.015) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 87 (just consumed gas: 0.010) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 88 (just consumed gas: 0.010) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 89 (just consumed gas: 0) + [ (Pair "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 91 (just consumed gas: 0.010) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 89 (just consumed gas: 0.025) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 92 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 93 (just consumed gas: 0) + [ "edsigthTzJ8X7MPmNeEwybRAvdxS1pupqcM5Mk4uCuyZAe7uEk68YpuGDeViW8wSXMrCi5CwoNgqs8V2w8ayB5dMJzrYCHhD8C7" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 95 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 96 (just consumed gas: 1.830) + [ (Some "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe") + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 99 (just consumed gas: 0) + [ "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 99 (just consumed gas: 0.015) + [ "sigXeXB5JD5TaLb3xgTPKjgf9W45judiCmNP9UBdZBdmtHSGBxL1M8ZSUb6LpjGP2MdfUBTB4WHs5APnvyRV1LooU6QHJuDe" + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 105 (just consumed gas: 0.901) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 93 (just consumed gas: 0.025) + [ 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + 0x050a0000004049d47dba27bd76208b092f3e500f64818920c817491b8b9094f28c2c2b9c6721b257b8878ce47182122b8ea84aeacd84a8aa28cb1f1fe48a26355a7bca4b8306 + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 108 (just consumed gas: 0.036) + [ 0 + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 109 (just consumed gas: 0.010) + [ True + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 110 (just consumed gas: 0) + [ (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 110 (just consumed gas: 0.015) + [ (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 116 (just consumed gas: 0.010) + [ (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 117 (just consumed gas: 0.010) + [ None + (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 118 (just consumed gas: 0) + [ (Pair None + {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 120 (just consumed gas: 0.010) + [ None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 118 (just consumed gas: 0.025) + [ None + None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 121 (just consumed gas: 0.216) + [ 0x050306 + None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 122 (just consumed gas: 0) + [ None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 124 (just consumed gas: 0.216) + [ 0x050306 + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 125 (just consumed gas: 0.421) + [ (Some None) + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 129 (just consumed gas: 0) + [ None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 129 (just consumed gas: 0.015) + [ None + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 135 (just consumed gas: 0.216) + [ 0x050306 + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 122 (just consumed gas: 0.025) + [ 0x050306 + 0x050306 + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 138 (just consumed gas: 0.035) + [ 0 + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 139 (just consumed gas: 0.010) + [ True + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 140 (just consumed gas: 0) + [ (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 140 (just consumed gas: 0.015) + [ (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 146 (just consumed gas: 0.010) + [ (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 147 (just consumed gas: 0.010) + [ {} + (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 148 (just consumed gas: 0) + [ (Pair {} + {} + (Pair 40 -10) + (Right "2019-09-09T08:35:33Z") + {} + { DUP ; DROP ; PACK }) ] + - location: 150 (just consumed gas: 0.010) + [ {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 148 (just consumed gas: 0.025) + [ {} + {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 151 (just consumed gas: 0.216) + [ 0x050200000000 + {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 152 (just consumed gas: 0) + [ {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 154 (just consumed gas: 0.216) + [ 0x050200000000 + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 155 (just consumed gas: 0.483) + [ (Some {}) + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 159 (just consumed gas: 0) + [ {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 159 (just consumed gas: 0.015) + [ {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 165 (just consumed gas: 0.216) + [ 0x050200000000 + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 152 (just consumed gas: 0.025) + [ 0x050200000000 + 0x050200000000 + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 168 (just consumed gas: 0.035) + [ 0 + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 169 (just consumed gas: 0.010) + [ True + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 170 (just consumed gas: 0) + [ (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 170 (just consumed gas: 0.015) + [ (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 176 (just consumed gas: 0.010) + [ (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 177 (just consumed gas: 0.010) + [ {} + (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 178 (just consumed gas: 0) + [ (Pair {} (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 180 (just consumed gas: 0.010) + [ {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 178 (just consumed gas: 0.025) + [ {} + {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 181 (just consumed gas: 0.216) + [ 0x050200000000 + {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 182 (just consumed gas: 0) + [ {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 184 (just consumed gas: 0.216) + [ 0x050200000000 + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 185 (just consumed gas: 0.483) + [ (Some {}) + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 189 (just consumed gas: 0) + [ {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 189 (just consumed gas: 0.015) + [ {} + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 195 (just consumed gas: 0.216) + [ 0x050200000000 + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 182 (just consumed gas: 0.025) + [ 0x050200000000 + 0x050200000000 + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 198 (just consumed gas: 0.035) + [ 0 + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 199 (just consumed gas: 0.010) + [ True + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 200 (just consumed gas: 0) + [ (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 200 (just consumed gas: 0.015) + [ (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 206 (just consumed gas: 0.010) + [ (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 207 (just consumed gas: 0.010) + [ (Pair 40 -10) + (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 208 (just consumed gas: 0) + [ (Pair (Pair 40 -10) (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 210 (just consumed gas: 0.010) + [ (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 208 (just consumed gas: 0.025) + [ (Pair 40 -10) + (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 211 (just consumed gas: 0.698) + [ 0x0507070028004a + (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 212 (just consumed gas: 0) + [ (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 214 (just consumed gas: 0.698) + [ 0x0507070028004a + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 215 (just consumed gas: 0.703) + [ (Some (Pair 40 -10)) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 220 (just consumed gas: 0) + [ (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 220 (just consumed gas: 0.015) + [ (Pair 40 -10) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 226 (just consumed gas: 0.698) + [ 0x0507070028004a + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 212 (just consumed gas: 0.025) + [ 0x0507070028004a + 0x0507070028004a + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 229 (just consumed gas: 0.035) + [ 0 + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 230 (just consumed gas: 0.010) + [ True + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 231 (just consumed gas: 0) + [ (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 231 (just consumed gas: 0.015) + [ (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 237 (just consumed gas: 0.010) + [ (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 238 (just consumed gas: 0.010) + [ (Right "2019-09-09T08:35:33Z") + (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 239 (just consumed gas: 0) + [ (Pair (Right "2019-09-09T08:35:33Z") {} { DUP ; DROP ; PACK }) ] + - location: 241 (just consumed gas: 0.010) + [ (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 239 (just consumed gas: 0.025) + [ (Right "2019-09-09T08:35:33Z") + (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 242 (just consumed gas: 0.532) + [ 0x0505080095bbb0d70b + (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 243 (just consumed gas: 0) + [ (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 245 (just consumed gas: 0.532) + [ 0x0505080095bbb0d70b + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 246 (just consumed gas: 0.644) + [ (Some (Right "2019-09-09T08:35:33Z")) + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 251 (just consumed gas: 0) + [ (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 251 (just consumed gas: 0.015) + [ (Right "2019-09-09T08:35:33Z") + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 257 (just consumed gas: 0.532) + [ 0x0505080095bbb0d70b + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 243 (just consumed gas: 0.025) + [ 0x0505080095bbb0d70b + 0x0505080095bbb0d70b + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 260 (just consumed gas: 0.035) + [ 0 + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 261 (just consumed gas: 0.010) + [ True + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 262 (just consumed gas: 0) + [ (Pair {} { DUP ; DROP ; PACK }) ] + - location: 262 (just consumed gas: 0.015) + [ (Pair {} { DUP ; DROP ; PACK }) ] + - location: 268 (just consumed gas: 0.010) + [ (Pair {} { DUP ; DROP ; PACK }) + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 269 (just consumed gas: 0.010) + [ {} + (Pair {} { DUP ; DROP ; PACK }) ] + - location: 270 (just consumed gas: 0) + [ (Pair {} { DUP ; DROP ; PACK }) ] + - location: 272 (just consumed gas: 0.010) + [ {} + { DUP ; DROP ; PACK } ] + - location: 270 (just consumed gas: 0.025) + [ {} + {} + { DUP ; DROP ; PACK } ] + - location: 273 (just consumed gas: 0.216) + [ 0x050200000000 + {} + { DUP ; DROP ; PACK } ] + - location: 274 (just consumed gas: 0) + [ {} + { DUP ; DROP ; PACK } ] + - location: 276 (just consumed gas: 0.216) + [ 0x050200000000 + { DUP ; DROP ; PACK } ] + - location: 277 (just consumed gas: 0.483) + [ (Some {}) + { DUP ; DROP ; PACK } ] + - location: 282 (just consumed gas: 0) + [ {} + { DUP ; DROP ; PACK } ] + - location: 282 (just consumed gas: 0.015) + [ {} + { DUP ; DROP ; PACK } ] + - location: 288 (just consumed gas: 0.216) + [ 0x050200000000 + { DUP ; DROP ; PACK } ] + - location: 274 (just consumed gas: 0.025) + [ 0x050200000000 + 0x050200000000 + { DUP ; DROP ; PACK } ] + - location: 291 (just consumed gas: 0.035) + [ 0 + { DUP ; DROP ; PACK } ] + - location: 292 (just consumed gas: 0.010) + [ True + { DUP ; DROP ; PACK } ] + - location: 293 (just consumed gas: 0) + [ { DUP ; DROP ; PACK } ] + - location: 293 (just consumed gas: 0.015) + [ { DUP ; DROP ; PACK } ] + - location: 299 (just consumed gas: 0.010) + [ { DUP ; DROP ; PACK } + { DUP ; DROP ; PACK } ] + - location: 300 (just consumed gas: 1.129) + [ 0x05020000000603210320030c + { DUP ; DROP ; PACK } ] + - location: 301 (just consumed gas: 0) + [ { DUP ; DROP ; PACK } ] + - location: 303 (just consumed gas: 1.129) + [ 0x05020000000603210320030c ] + - location: 304 (just consumed gas: 2.086) + [ (Some { DUP ; DROP ; PACK }) ] + - location: 309 (just consumed gas: 0) + [ { DUP ; DROP ; PACK } ] + - location: 309 (just consumed gas: 0.015) + [ { DUP ; DROP ; PACK } ] + - location: 315 (just consumed gas: 1.129) + [ 0x05020000000603210320030c ] + - location: 301 (just consumed gas: 0.025) + [ 0x05020000000603210320030c + 0x05020000000603210320030c ] + - location: 318 (just consumed gas: 0.035) + [ 0 ] + - location: 319 (just consumed gas: 0.010) + [ True ] + - location: 320 (just consumed gas: 0) + [ ] + - location: 320 (just consumed gas: 0.015) + [ ] + - location: 326 (just consumed gas: 0.010) + [ Unit ] + - location: 327 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 329 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input106930123-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input106930123-.out new file mode 100644 index 000000000000..23cbf1a6be2f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input106930123-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pair_id.tz on storage None and input '(Pair False True)' --level 1 --trace-stack +storage + (Some (Pair False True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 5.501) + [ (Pair (Pair False True) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair False True) ] + - location: 13 (just consumed gas: 0.010) + [ (Some (Pair False True)) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some (Pair False True)) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair False True))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input181204719-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input181204719-.out new file mode 100644 index 000000000000..6fe698e64225 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input181204719-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pair_id.tz on storage None and input '(Pair True False)' --level 1 --trace-stack +storage + (Some (Pair True False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 5.501) + [ (Pair (Pair True False) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair True False) ] + - location: 13 (just consumed gas: 0.010) + [ (Some (Pair True False)) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some (Pair True False)) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair True False))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input223774825-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input223774825-.out new file mode 100644 index 000000000000..8ebfc6f3ab2b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input223774825-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pair_id.tz on storage None and input '(Pair False False)' --level 1 --trace-stack +storage + (Some (Pair False False)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 5.501) + [ (Pair (Pair False False) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair False False) ] + - location: 13 (just consumed gas: 0.010) + [ (Some (Pair False False)) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some (Pair False False)) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair False False))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input908807505-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input908807505-.out new file mode 100644 index 000000000000..555596403b5c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pair_id.tz--storage921624073--input908807505-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pair_id.tz on storage None and input '(Pair True True)' --level 1 --trace-stack +storage + (Some (Pair True True)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 5.501) + [ (Pair (Pair True True) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair True True) ] + - location: 13 (just consumed gas: 0.010) + [ (Some (Pair True True)) ] + - location: 14 (just consumed gas: 0.010) + [ {} + (Some (Pair True True)) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair True True))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec.tz--storage256947135--input1050356042-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec.tz--storage256947135--input1050356042-.out new file mode 100644 index 000000000000..9f7dc83b54c9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec.tz--storage256947135--input1050356042-.out @@ -0,0 +1,47 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pexec.tz on storage 14 and input 38 --level 1 --trace-stack +storage + 52 +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 9.021) + [ (Pair 38 14) ] + - location: 7 (just consumed gas: 0.010) + [ { UNPAIR ; ADD } + (Pair 38 14) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair 38 14) + { UNPAIR ; ADD } ] + - location: 16 (just consumed gas: 0.010) + [ 38 + 14 + { UNPAIR ; ADD } ] + - location: 17 (just consumed gas: 0) + [ 14 + { UNPAIR ; ADD } ] + - location: 19 (just consumed gas: 0.401) + [ { PUSH nat 14 ; PAIR ; { UNPAIR ; ADD } } ] + - location: 17 (just consumed gas: 0.025) + [ 38 + { PUSH nat 14 ; PAIR ; { UNPAIR ; ADD } } ] + - location: 12 (just consumed gas: 0.010) + [ 14 + 38 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair 14 38) ] + - location: 13 (just consumed gas: 0.010) + [ 14 + 38 ] + - location: 14 (just consumed gas: 0.035) + [ 52 ] + - location: 20 (just consumed gas: 0.025) + [ 52 ] + - location: 21 (just consumed gas: 0.010) + [ {} + 52 ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} 52) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec_2.tz--storage197120858--input179371027-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec_2.tz--storage197120858--input179371027-.out new file mode 100644 index 000000000000..5df1e0ce45d3 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -pexec_2.tz--storage197120858--input179371027-.out @@ -0,0 +1,282 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/pexec_2.tz on storage '{ 0 ; 1 ; 2 ; 3}' and input 4 --level 1 --trace-stack +storage + { 0 ; 7 ; 14 ; 21 } +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 17.009) + [ (Pair 4 { 0 ; 1 ; 2 ; 3 }) ] + - location: 8 (just consumed gas: 0.010) + [ 4 + { 0 ; 1 ; 2 ; 3 } ] + - location: 9 (just consumed gas: 0.010) + [ { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } + 4 + { 0 ; 1 ; 2 ; 3 } ] + - location: 23 (just consumed gas: 0.010) + [ 4 + { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } + { 0 ; 1 ; 2 ; 3 } ] + - location: 24 (just consumed gas: 0.401) + [ { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } + { 0 ; 1 ; 2 ; 3 } ] + - location: 25 (just consumed gas: 0.010) + [ 3 + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } + { 0 ; 1 ; 2 ; 3 } ] + - location: 28 (just consumed gas: 0.401) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { 0 ; 1 ; 2 ; 3 } ] + - location: 29 (just consumed gas: 0.010) + [ { 0 ; 1 ; 2 ; 3 } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 30 (just consumed gas: 0) + [ 0 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 34 (just consumed gas: 0.010) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0.025) + [ 0 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 16 (just consumed gas: 0.010) + [ 3 + 0 ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 3 0) ] + - location: 16 (just consumed gas: 0.010) + [ 4 + (Pair 3 0) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 4 3 0) ] + - location: 17 (just consumed gas: 0.010) + [ 4 + (Pair 3 0) ] + - location: 18 (just consumed gas: 0) + [ (Pair 3 0) ] + - location: 20 (just consumed gas: 0.010) + [ 3 + 0 ] + - location: 18 (just consumed gas: 0.025) + [ 4 + 3 + 0 ] + - location: 21 (just consumed gas: 0.035) + [ 7 + 0 ] + - location: 22 (just consumed gas: 0.056) + [ 0 ] + - location: 35 (just consumed gas: 0.025) + [ 0 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 30 (just consumed gas: 0.015) + [ 1 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 34 (just consumed gas: 0.010) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0.025) + [ 1 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 16 (just consumed gas: 0.010) + [ 3 + 1 ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 3 1) ] + - location: 16 (just consumed gas: 0.010) + [ 4 + (Pair 3 1) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 4 3 1) ] + - location: 17 (just consumed gas: 0.010) + [ 4 + (Pair 3 1) ] + - location: 18 (just consumed gas: 0) + [ (Pair 3 1) ] + - location: 20 (just consumed gas: 0.010) + [ 3 + 1 ] + - location: 18 (just consumed gas: 0.025) + [ 4 + 3 + 1 ] + - location: 21 (just consumed gas: 0.035) + [ 7 + 1 ] + - location: 22 (just consumed gas: 0.059) + [ 7 ] + - location: 35 (just consumed gas: 0.025) + [ 7 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 30 (just consumed gas: 0.015) + [ 2 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 34 (just consumed gas: 0.010) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0.025) + [ 2 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 16 (just consumed gas: 0.010) + [ 3 + 2 ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 3 2) ] + - location: 16 (just consumed gas: 0.010) + [ 4 + (Pair 3 2) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 4 3 2) ] + - location: 17 (just consumed gas: 0.010) + [ 4 + (Pair 3 2) ] + - location: 18 (just consumed gas: 0) + [ (Pair 3 2) ] + - location: 20 (just consumed gas: 0.010) + [ 3 + 2 ] + - location: 18 (just consumed gas: 0.025) + [ 4 + 3 + 2 ] + - location: 21 (just consumed gas: 0.035) + [ 7 + 2 ] + - location: 22 (just consumed gas: 0.059) + [ 14 ] + - location: 35 (just consumed gas: 0.025) + [ 14 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 30 (just consumed gas: 0.015) + [ 3 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 34 (just consumed gas: 0.010) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 32 (just consumed gas: 0.025) + [ 3 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 16 (just consumed gas: 0.010) + [ 3 + 3 ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 3 3) ] + - location: 16 (just consumed gas: 0.010) + [ 4 + (Pair 3 3) ] + - location: 16 (just consumed gas: 0.010) + [ (Pair 4 3 3) ] + - location: 17 (just consumed gas: 0.010) + [ 4 + (Pair 3 3) ] + - location: 18 (just consumed gas: 0) + [ (Pair 3 3) ] + - location: 20 (just consumed gas: 0.010) + [ 3 + 3 ] + - location: 18 (just consumed gas: 0.025) + [ 4 + 3 + 3 ] + - location: 21 (just consumed gas: 0.035) + [ 7 + 3 ] + - location: 22 (just consumed gas: 0.059) + [ 21 ] + - location: 35 (just consumed gas: 0.025) + [ 21 + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 30 (just consumed gas: 0.015) + [ { 0 ; 7 ; 14 ; 21 } + { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 36 (just consumed gas: 0) + [ { PUSH int 3 ; + PAIR ; + { PUSH int 4 ; PAIR ; { UNPAIR ; DIP { UNPAIR } ; ADD ; MUL } } } ] + - location: 38 (just consumed gas: 0.010) + [ ] + - location: 36 (just consumed gas: 0.025) + [ { 0 ; 7 ; 14 ; 21 } ] + - location: 39 (just consumed gas: 0.010) + [ {} + { 0 ; 7 ; 14 ; 21 } ] + - location: 41 (just consumed gas: 0.010) + [ (Pair {} { 0 ; 7 ; 14 ; 21 }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ret_int.tz--storage921624073--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ret_int.tz--storage921624073--input125992234-.out new file mode 100644 index 000000000000..abc1341f4e2c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -ret_int.tz--storage921624073--input125992234-.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/ret_int.tz on storage None and input Unit --level 1 --trace-stack +storage + (Some 300) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.514) + [ (Pair Unit None) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.010) + [ 300 ] + - location: 12 (just consumed gas: 0.010) + [ (Some 300) ] + - location: 13 (just consumed gas: 0.010) + [ {} + (Some 300) ] + - location: 15 (just consumed gas: 0.010) + [ (Pair {} (Some 300)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input457300675-.out new file mode 100644 index 000000000000..89263c9dd5e9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/reverse.tz on storage '{""}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 6.956) + [ (Pair {} { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0) + [ {} ] + - location: 16 (just consumed gas: 0.010) + [ {} + {} ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input851203613-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input851203613-.out new file mode 100644 index 000000000000..b471f8a90c8e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse.tz--storage528921618--input851203613-.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/reverse.tz on storage '{""}' and input '{ "c" ; "b" ; "a" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.328) + [ (Pair { "c" ; "b" ; "a" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "c" ; "b" ; "a" } ] + - location: 12 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } + {} ] + - location: 13 (just consumed gas: 0) + [ "c" + {} ] + - location: 15 (just consumed gas: 0.010) + [ { "c" } ] + - location: 13 (just consumed gas: 0.015) + [ "b" + { "c" } ] + - location: 15 (just consumed gas: 0.010) + [ { "b" ; "c" } ] + - location: 13 (just consumed gas: 0.015) + [ "a" + { "b" ; "c" } ] + - location: 15 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 13 (just consumed gas: 0.015) + [ { "a" ; "b" ; "c" } ] + - location: 16 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input457300675-.out new file mode 100644 index 000000000000..cd310b8f9a8e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input457300675-.out @@ -0,0 +1,50 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/reverse_loop.tz on storage '{""}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 13.786) + [ (Pair {} { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.010) + [ True + {} + {} ] + - location: 33 (just consumed gas: 0) + [ {} + {} ] + - location: 18 (just consumed gas: 0) + [ {} ] + - location: 28 (just consumed gas: 0.010) + [ {} + {} ] + - location: 30 (just consumed gas: 0.010) + [ False + {} + {} ] + - location: 18 (just consumed gas: 0.015) + [ False + {} + {} ] + - location: 33 (just consumed gas: 0.015) + [ {} + {} ] + - location: 33 (just consumed gas: 0.010) + [ {} ] + - location: 34 (just consumed gas: 0.010) + [ {} + {} ] + - location: 36 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input851203613-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input851203613-.out new file mode 100644 index 000000000000..7c66f788342c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -reverse_loop.tz--storage528921618--input851203613-.out @@ -0,0 +1,131 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/reverse_loop.tz on storage '{""}' and input '{ "c" ; "b" ; "a" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 14.158) + [ (Pair { "c" ; "b" ; "a" } { "" }) ] + - location: 9 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "c" ; "b" ; "a" } ] + - location: 12 (just consumed gas: 0.010) + [ { "c" ; "b" ; "a" } + {} ] + - location: 13 (just consumed gas: 0.010) + [ True + { "c" ; "b" ; "a" } + {} ] + - location: 33 (just consumed gas: 0) + [ { "c" ; "b" ; "a" } + {} ] + - location: 18 (just consumed gas: 0) + [ "c" + { "b" ; "a" } + {} ] + - location: 20 (just consumed gas: 0.010) + [ { "b" ; "a" } + "c" + {} ] + - location: 21 (just consumed gas: 0) + [ "c" + {} ] + - location: 23 (just consumed gas: 0.010) + [ { "c" } ] + - location: 21 (just consumed gas: 0.025) + [ { "b" ; "a" } + { "c" } ] + - location: 24 (just consumed gas: 0.010) + [ True + { "b" ; "a" } + { "c" } ] + - location: 18 (just consumed gas: 0.015) + [ True + { "b" ; "a" } + { "c" } ] + - location: 33 (just consumed gas: 0.015) + [ { "b" ; "a" } + { "c" } ] + - location: 18 (just consumed gas: 0) + [ "b" + { "a" } + { "c" } ] + - location: 20 (just consumed gas: 0.010) + [ { "a" } + "b" + { "c" } ] + - location: 21 (just consumed gas: 0) + [ "b" + { "c" } ] + - location: 23 (just consumed gas: 0.010) + [ { "b" ; "c" } ] + - location: 21 (just consumed gas: 0.025) + [ { "a" } + { "b" ; "c" } ] + - location: 24 (just consumed gas: 0.010) + [ True + { "a" } + { "b" ; "c" } ] + - location: 18 (just consumed gas: 0.015) + [ True + { "a" } + { "b" ; "c" } ] + - location: 33 (just consumed gas: 0.015) + [ { "a" } + { "b" ; "c" } ] + - location: 18 (just consumed gas: 0) + [ "a" + {} + { "b" ; "c" } ] + - location: 20 (just consumed gas: 0.010) + [ {} + "a" + { "b" ; "c" } ] + - location: 21 (just consumed gas: 0) + [ "a" + { "b" ; "c" } ] + - location: 23 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 21 (just consumed gas: 0.025) + [ {} + { "a" ; "b" ; "c" } ] + - location: 24 (just consumed gas: 0.010) + [ True + {} + { "a" ; "b" ; "c" } ] + - location: 18 (just consumed gas: 0.015) + [ True + {} + { "a" ; "b" ; "c" } ] + - location: 33 (just consumed gas: 0.015) + [ {} + { "a" ; "b" ; "c" } ] + - location: 18 (just consumed gas: 0) + [ { "a" ; "b" ; "c" } ] + - location: 28 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 30 (just consumed gas: 0.010) + [ False + {} + { "a" ; "b" ; "c" } ] + - location: 18 (just consumed gas: 0.015) + [ False + {} + { "a" ; "b" ; "c" } ] + - location: 33 (just consumed gas: 0.015) + [ {} + { "a" ; "b" ; "c" } ] + - location: 33 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 34 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 36 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sapling_empty_state.tz--storage457300675--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sapling_empty_state.tz--storage457300675--input125992234-.out new file mode 100644 index 000000000000..bca8b981d1fc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sapling_empty_state.tz--storage457300675--input125992234-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/sapling_empty_state.tz on storage '{}' and input Unit --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.358) + [ (Pair Unit {}) ] + - location: 8 (just consumed gas: 0.010) + [ ] + - location: 9 (just consumed gas: 0.300) + [ {} ] + - location: 11 (just consumed gas: 0.010) + [ {} + {} ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_address.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_address.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..18d7a1aea8f1 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_address.tz--storage125992234--input125992234-.out @@ -0,0 +1,46 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/self_address.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 13.726) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ { DROP ; SELF_ADDRESS } ] + - location: 14 (just consumed gas: 0.010) + [ Unit + { DROP ; SELF_ADDRESS } ] + - location: 12 (just consumed gas: 0.010) + [ ] + - location: 13 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 15 (just consumed gas: 0.025) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 16 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" + "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 17 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" + "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 20 (just consumed gas: 0.036) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ Unit ] + - location: 29 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_default_entrypoint.tz--storage125992234--input1259922.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_default_entrypoint.tz--storage125992234--input1259922.out new file mode 100644 index 000000000000..0e9ff7e66be7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_default_entrypoint.tz--storage125992234--input1259922.out @@ -0,0 +1,47 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 15.515) + [ (Pair (Right (Left Unit)) Unit) ] + - location: 13 (just consumed gas: 0.010) + [ ] + - location: 14 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 15 (just consumed gas: 0.010) + [ ] + - location: 16 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%A" ] + - location: 17 (just consumed gas: 0.010) + [ ] + - location: 18 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 19 (just consumed gas: 0.506) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 20 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 21 (just consumed gas: 0.506) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 24 (just consumed gas: 0.035) + [ 0 ] + - location: 25 (just consumed gas: 0.010) + [ True ] + - location: 26 (just consumed gas: 0) + [ ] + - location: 26 (just consumed gas: 0.015) + [ ] + - location: 32 (just consumed gas: 0.010) + [ Unit ] + - location: 33 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 35 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_entrypoint.tz--storage125992234--input289072903-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_entrypoint.tz--storage125992234--input289072903-.out new file mode 100644 index 000000000000..9b14ed45b19e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -self_with_entrypoint.tz--storage125992234--input289072903-.out @@ -0,0 +1,93 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/self_with_entrypoint.tz on storage Unit and input 'Left (Left 0)' --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 13 (just consumed gas: 40.124) + [ (Pair (Left (Left 0)) Unit) ] + - location: 13 (just consumed gas: 0.010) + [ ] + - location: 14 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%A" ] + - location: 15 (just consumed gas: 0.516) + [ 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 ] + - location: 16 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" + 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 ] + - location: 17 (just consumed gas: 0.506) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 ] + - location: 18 (just consumed gas: 0.010) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 ] + - location: 19 (just consumed gas: 0) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 ] + - location: 21 (just consumed gas: 0.010) + [ 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 19 (just consumed gas: 0.025) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000017011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe60041 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 24 (just consumed gas: 0.035) + [ -1 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 25 (just consumed gas: 0.010) + [ True + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 26 (just consumed gas: 0) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 26 (just consumed gas: 0.015) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 32 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 33 (just consumed gas: 0.506) + [ 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 + 0x050a00000016011d23c1d3d2f8a4ea5e8784b8f7ecf2ad304c0fe600 ] + - location: 36 (just consumed gas: 0.035) + [ 0 ] + - location: 37 (just consumed gas: 0.010) + [ True ] + - location: 38 (just consumed gas: 0) + [ ] + - location: 38 (just consumed gas: 0.015) + [ ] + - location: 44 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%A" ] + - location: 48 (just consumed gas: 0.010) + [ ] + - location: 49 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%B" ] + - location: 53 (just consumed gas: 0.010) + [ ] + - location: 54 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%maybe_C" ] + - location: 60 (just consumed gas: 0.010) + [ ] + - location: 61 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi%Z" ] + - location: 65 (just consumed gas: 0.010) + [ ] + - location: 66 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 76 (just consumed gas: 0.010) + [ ] + - location: 77 (just consumed gas: 0.010) + [ "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi" ] + - location: 87 (just consumed gas: 0.010) + [ ] + - location: 88 (just consumed gas: 0.010) + [ Unit ] + - location: 89 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 91 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input620760059-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input620760059-.out new file mode 100644 index 000000000000..85716f3cad9c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input620760059-.out @@ -0,0 +1,49 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_car.tz on storage '(Pair "hello" 0)' and input '"world"' --level 1 --trace-stack +storage + (Pair "world" 0) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.979) + [ (Pair "world" "hello" 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "world" "hello" 0) + (Pair "world" "hello" 0) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "world" "hello" 0) ] + - location: 11 (just consumed gas: 0) + [ (Pair "world" "hello" 0) ] + - location: 13 (just consumed gas: 0.010) + [ "world" ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 0) + "world" ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "hello" 0) + "world" ] + - location: 16 (just consumed gas: 0.010) + [ "hello" + (Pair "hello" 0) + "world" ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 0) + "world" ] + - location: 18 (just consumed gas: 0.010) + [ 0 + "world" ] + - location: 19 (just consumed gas: 0.010) + [ "world" + 0 ] + - location: 20 (just consumed gas: 0.010) + [ (Pair "world" 0) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair "world" 0) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} "world" 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input717096222-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input717096222-.out new file mode 100644 index 000000000000..1cc5c93f53f7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input717096222-.out @@ -0,0 +1,49 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_car.tz on storage '(Pair "hello" 0)' and input '"abc"' --level 1 --trace-stack +storage + (Pair "abc" 0) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.959) + [ (Pair "abc" "hello" 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "abc" "hello" 0) + (Pair "abc" "hello" 0) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "abc" "hello" 0) ] + - location: 11 (just consumed gas: 0) + [ (Pair "abc" "hello" 0) ] + - location: 13 (just consumed gas: 0.010) + [ "abc" ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 0) + "abc" ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "hello" 0) + "abc" ] + - location: 16 (just consumed gas: 0.010) + [ "hello" + (Pair "hello" 0) + "abc" ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 0) + "abc" ] + - location: 18 (just consumed gas: 0.010) + [ 0 + "abc" ] + - location: 19 (just consumed gas: 0.010) + [ "abc" + 0 ] + - location: 20 (just consumed gas: 0.010) + [ (Pair "abc" 0) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair "abc" 0) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} "abc" 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input79230375-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input79230375-.out new file mode 100644 index 000000000000..50d52f413202 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_car.tz--storage224747103--input79230375-.out @@ -0,0 +1,49 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_car.tz on storage '(Pair "hello" 0)' and input '""' --level 1 --trace-stack +storage + (Pair "" 0) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.929) + [ (Pair "" "hello" 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "" "hello" 0) + (Pair "" "hello" 0) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "" "hello" 0) ] + - location: 11 (just consumed gas: 0) + [ (Pair "" "hello" 0) ] + - location: 13 (just consumed gas: 0.010) + [ "" ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 0) + "" ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "hello" 0) + "" ] + - location: 16 (just consumed gas: 0.010) + [ "hello" + (Pair "hello" 0) + "" ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 0) + "" ] + - location: 18 (just consumed gas: 0.010) + [ 0 + "" ] + - location: 19 (just consumed gas: 0.010) + [ "" + 0 ] + - location: 20 (just consumed gas: 0.010) + [ (Pair "" 0) ] + - location: 21 (just consumed gas: 0.010) + [ {} + (Pair "" 0) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair {} "" 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage205576101--input654274102-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage205576101--input654274102-.out new file mode 100644 index 000000000000..22121dff5c17 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage205576101--input654274102-.out @@ -0,0 +1,46 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_cdr.tz on storage '(Pair "hello" 500)' and input 3 --level 1 --trace-stack +storage + (Pair "hello" 3) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.357) + [ (Pair 3 "hello" 500) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair 3 "hello" 500) + (Pair 3 "hello" 500) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 500) + (Pair 3 "hello" 500) ] + - location: 11 (just consumed gas: 0) + [ (Pair 3 "hello" 500) ] + - location: 13 (just consumed gas: 0.010) + [ 3 ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 500) + 3 ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 500) + (Pair "hello" 500) + 3 ] + - location: 16 (just consumed gas: 0.010) + [ 500 + (Pair "hello" 500) + 3 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 500) + 3 ] + - location: 18 (just consumed gas: 0.010) + [ "hello" + 3 ] + - location: 19 (just consumed gas: 0.010) + [ (Pair "hello" 3) ] + - location: 20 (just consumed gas: 0.010) + [ {} + (Pair "hello" 3) ] + - location: 22 (just consumed gas: 0.010) + [ (Pair {} "hello" 3) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage224747103--input453441034-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage224747103--input453441034-.out new file mode 100644 index 000000000000..4dd9c0cc6b61 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage224747103--input453441034-.out @@ -0,0 +1,46 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_cdr.tz on storage '(Pair "hello" 0)' and input 1 --level 1 --trace-stack +storage + (Pair "hello" 1) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.357) + [ (Pair 1 "hello" 0) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair 1 "hello" 0) + (Pair 1 "hello" 0) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair 1 "hello" 0) ] + - location: 11 (just consumed gas: 0) + [ (Pair 1 "hello" 0) ] + - location: 13 (just consumed gas: 0.010) + [ 1 ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 0) + 1 ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 0) + (Pair "hello" 0) + 1 ] + - location: 16 (just consumed gas: 0.010) + [ 0 + (Pair "hello" 0) + 1 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 0) + 1 ] + - location: 18 (just consumed gas: 0.010) + [ "hello" + 1 ] + - location: 19 (just consumed gas: 0.010) + [ (Pair "hello" 1) ] + - location: 20 (just consumed gas: 0.010) + [ {} + (Pair "hello" 1) ] + - location: 22 (just consumed gas: 0.010) + [ (Pair {} "hello" 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage611418174--input967284912-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage611418174--input967284912-.out new file mode 100644 index 000000000000..1b0d2a3d1688 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_cdr.tz--storage611418174--input967284912-.out @@ -0,0 +1,46 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_cdr.tz on storage '(Pair "hello" 7)' and input 100 --level 1 --trace-stack +storage + (Pair "hello" 100) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 10.357) + [ (Pair 100 "hello" 7) ] + - location: 9 (just consumed gas: 0.010) + [ (Pair 100 "hello" 7) + (Pair 100 "hello" 7) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "hello" 7) + (Pair 100 "hello" 7) ] + - location: 11 (just consumed gas: 0) + [ (Pair 100 "hello" 7) ] + - location: 13 (just consumed gas: 0.010) + [ 100 ] + - location: 11 (just consumed gas: 0.025) + [ (Pair "hello" 7) + 100 ] + - location: 15 (just consumed gas: 0.010) + [ (Pair "hello" 7) + (Pair "hello" 7) + 100 ] + - location: 16 (just consumed gas: 0.010) + [ 7 + (Pair "hello" 7) + 100 ] + - location: 17 (just consumed gas: 0.010) + [ (Pair "hello" 7) + 100 ] + - location: 18 (just consumed gas: 0.010) + [ "hello" + 100 ] + - location: 19 (just consumed gas: 0.010) + [ (Pair "hello" 100) ] + - location: 20 (just consumed gas: 0.010) + [ {} + (Pair "hello" 100) ] + - location: 22 (just consumed gas: 0.010) + [ (Pair {} "hello" 100) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input264787654-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input264787654-.out new file mode 100644 index 000000000000..a239d15acea2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input264787654-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_id.tz on storage '{}' and input '{ "a" ; "b" ; "c" }' --level 1 --trace-stack +storage + { "a" ; "b" ; "c" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.919) + [ (Pair { "a" ; "b" ; "c" } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { "a" ; "b" ; "c" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "a" ; "b" ; "c" } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { "a" ; "b" ; "c" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input457300675-.out new file mode 100644 index 000000000000..72aec378e405 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input457300675-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_id.tz on storage '{}' and input '{}' --level 1 --trace-stack +storage + {} +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.075) + [ (Pair {} {}) ] + - location: 9 (just consumed gas: 0.010) + [ {} ] + - location: 10 (just consumed gas: 0.010) + [ {} + {} ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} {}) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input989507347-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input989507347-.out new file mode 100644 index 000000000000..53b382f7a75b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_id.tz--storage457300675--input989507347-.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_id.tz on storage '{}' and input '{ "asdf" ; "bcde" }' --level 1 --trace-stack +storage + { "asdf" ; "bcde" } +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 4.702) + [ (Pair { "asdf" ; "bcde" } {}) ] + - location: 9 (just consumed gas: 0.010) + [ { "asdf" ; "bcde" } ] + - location: 10 (just consumed gas: 0.010) + [ {} + { "asdf" ; "bcde" } ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} { "asdf" ; "bcde" }) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input457300675-.out new file mode 100644 index 000000000000..67dbd753900c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input457300675-.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_iter.tz on storage 111 and input '{}' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 6.702) + [ (Pair {} 111) ] + - location: 8 (just consumed gas: 0.010) + [ {} ] + - location: 9 (just consumed gas: 0.010) + [ 0 + {} ] + - location: 12 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 13 (just consumed gas: 0) + [ 0 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input701684511-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input701684511-.out new file mode 100644 index 000000000000..6b8f0fb7c2cf --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input701684511-.out @@ -0,0 +1,47 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_iter.tz on storage 111 and input '{ -100 ; 1 ; 2 ; 3 }' --level 1 --trace-stack +storage + -94 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 7.727) + [ (Pair { -100 ; 1 ; 2 ; 3 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { -100 ; 1 ; 2 ; 3 } ] + - location: 9 (just consumed gas: 0.010) + [ 0 + { -100 ; 1 ; 2 ; 3 } ] + - location: 12 (just consumed gas: 0.010) + [ { -100 ; 1 ; 2 ; 3 } + 0 ] + - location: 13 (just consumed gas: 0) + [ -100 + 0 ] + - location: 15 (just consumed gas: 0.035) + [ -100 ] + - location: 13 (just consumed gas: 0.015) + [ 1 + -100 ] + - location: 15 (just consumed gas: 0.035) + [ -99 ] + - location: 13 (just consumed gas: 0.015) + [ 2 + -99 ] + - location: 15 (just consumed gas: 0.035) + [ -97 ] + - location: 13 (just consumed gas: 0.015) + [ 3 + -97 ] + - location: 15 (just consumed gas: 0.035) + [ -94 ] + - location: 13 (just consumed gas: 0.015) + [ -94 ] + - location: 16 (just consumed gas: 0.010) + [ {} + -94 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} -94) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input802622031-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input802622031-.out new file mode 100644 index 000000000000..dc249a8f26b9 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_iter.tz--storage492856247--input802622031-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_iter.tz on storage 111 and input '{ 1 }' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 6.932) + [ (Pair { 1 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 } ] + - location: 9 (just consumed gas: 0.010) + [ 0 + { 1 } ] + - location: 12 (just consumed gas: 0.010) + [ { 1 } + 0 ] + - location: 13 (just consumed gas: 0) + [ 1 + 0 ] + - location: 15 (just consumed gas: 0.035) + [ 1 ] + - location: 13 (just consumed gas: 0.015) + [ 1 ] + - location: 16 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage495706788--input33757838-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage495706788--input33757838-.out new file mode 100644 index 000000000000..6e1f0bced3f8 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage495706788--input33757838-.out @@ -0,0 +1,61 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_member.tz on storage '(Pair {} None)' and input '"Hi"' --level 1 --trace-stack +storage + (Pair {} (Some False)) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 13.724) + [ (Pair "Hi" {} None) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "Hi" {} None) + (Pair "Hi" {} None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "Hi" {} None) + (Pair "Hi" {} None) + (Pair "Hi" {} None) ] + - location: 13 (just consumed gas: 0.010) + [ "Hi" + (Pair "Hi" {} None) + (Pair "Hi" {} None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "Hi" {} None) + (Pair "Hi" {} None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair {} None) + (Pair "Hi" {} None) ] + - location: 18 (just consumed gas: 0.010) + [ {} + (Pair "Hi" {} None) ] + - location: 14 (just consumed gas: 0.025) + [ "Hi" + {} + (Pair "Hi" {} None) ] + - location: 19 (just consumed gas: 0.117) + [ False + (Pair "Hi" {} None) ] + - location: 20 (just consumed gas: 0.010) + [ (Some False) + (Pair "Hi" {} None) ] + - location: 21 (just consumed gas: 0) + [ (Pair "Hi" {} None) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + - location: 25 (just consumed gas: 0.010) + [ {} ] + - location: 21 (just consumed gas: 0.025) + [ (Some False) + {} ] + - location: 26 (just consumed gas: 0.010) + [ {} + (Some False) ] + - location: 27 (just consumed gas: 0.010) + [ (Pair {} (Some False)) ] + - location: 28 (just consumed gas: 0.010) + [ {} + (Pair {} (Some False)) ] + - location: 30 (just consumed gas: 0.010) + [ (Pair {} {} (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage550087893--input79230375-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage550087893--input79230375-.out new file mode 100644 index 000000000000..b30ac0d03c32 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage550087893--input79230375-.out @@ -0,0 +1,61 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_member.tz on storage '(Pair { "Hello" ; "World" } None)' and input '""' --level 1 --trace-stack +storage + (Pair { "Hello" ; "World" } (Some False)) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 14.357) + [ (Pair "" { "Hello" ; "World" } None) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "" { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "" { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) ] + - location: 13 (just consumed gas: 0.010) + [ "" + (Pair "" { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "" { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair { "Hello" ; "World" } None) + (Pair "" { "Hello" ; "World" } None) ] + - location: 18 (just consumed gas: 0.010) + [ { "Hello" ; "World" } + (Pair "" { "Hello" ; "World" } None) ] + - location: 14 (just consumed gas: 0.025) + [ "" + { "Hello" ; "World" } + (Pair "" { "Hello" ; "World" } None) ] + - location: 19 (just consumed gas: 0.115) + [ False + (Pair "" { "Hello" ; "World" } None) ] + - location: 20 (just consumed gas: 0.010) + [ (Some False) + (Pair "" { "Hello" ; "World" } None) ] + - location: 21 (just consumed gas: 0) + [ (Pair "" { "Hello" ; "World" } None) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair { "Hello" ; "World" } None) ] + - location: 25 (just consumed gas: 0.010) + [ { "Hello" ; "World" } ] + - location: 21 (just consumed gas: 0.025) + [ (Some False) + { "Hello" ; "World" } ] + - location: 26 (just consumed gas: 0.010) + [ { "Hello" ; "World" } + (Some False) ] + - location: 27 (just consumed gas: 0.010) + [ (Pair { "Hello" ; "World" } (Some False)) ] + - location: 28 (just consumed gas: 0.010) + [ {} + (Pair { "Hello" ; "World" } (Some False)) ] + - location: 30 (just consumed gas: 0.010) + [ (Pair {} { "Hello" ; "World" } (Some False)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage605111220--input33757838-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage605111220--input33757838-.out new file mode 100644 index 000000000000..1973fa994cbc --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_member.tz--storage605111220--input33757838-.out @@ -0,0 +1,61 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_member.tz on storage '(Pair { "Hi" } None)' and input '"Hi"' --level 1 --trace-stack +storage + (Pair { "Hi" } (Some True)) +emitted operations + +big_map diff + +trace + - location: 11 (just consumed gas: 13.992) + [ (Pair "Hi" { "Hi" } None) ] + - location: 11 (just consumed gas: 0.010) + [ (Pair "Hi" { "Hi" } None) + (Pair "Hi" { "Hi" } None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair "Hi" { "Hi" } None) + (Pair "Hi" { "Hi" } None) + (Pair "Hi" { "Hi" } None) ] + - location: 13 (just consumed gas: 0.010) + [ "Hi" + (Pair "Hi" { "Hi" } None) + (Pair "Hi" { "Hi" } None) ] + - location: 14 (just consumed gas: 0) + [ (Pair "Hi" { "Hi" } None) + (Pair "Hi" { "Hi" } None) ] + - location: 17 (just consumed gas: 0.010) + [ (Pair { "Hi" } None) + (Pair "Hi" { "Hi" } None) ] + - location: 18 (just consumed gas: 0.010) + [ { "Hi" } + (Pair "Hi" { "Hi" } None) ] + - location: 14 (just consumed gas: 0.025) + [ "Hi" + { "Hi" } + (Pair "Hi" { "Hi" } None) ] + - location: 19 (just consumed gas: 0.119) + [ True + (Pair "Hi" { "Hi" } None) ] + - location: 20 (just consumed gas: 0.010) + [ (Some True) + (Pair "Hi" { "Hi" } None) ] + - location: 21 (just consumed gas: 0) + [ (Pair "Hi" { "Hi" } None) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair { "Hi" } None) ] + - location: 25 (just consumed gas: 0.010) + [ { "Hi" } ] + - location: 21 (just consumed gas: 0.025) + [ (Some True) + { "Hi" } ] + - location: 26 (just consumed gas: 0.010) + [ { "Hi" } + (Some True) ] + - location: 27 (just consumed gas: 0.010) + [ (Pair { "Hi" } (Some True)) ] + - location: 28 (just consumed gas: 0.010) + [ {} + (Pair { "Hi" } (Some True)) ] + - location: 30 (just consumed gas: 0.010) + [ (Pair {} { "Hi" } (Some True)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input403499055-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input403499055-.out new file mode 100644 index 000000000000..20324df93b3e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input403499055-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_size.tz on storage 111 and input '{ 1 ; 2 ; 3 ; 4 ; 5 ; 6 }' --level 1 --trace-stack +storage + 6 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.950) + [ (Pair { 1 ; 2 ; 3 ; 4 ; 5 ; 6 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 ; 4 ; 5 ; 6 } ] + - location: 9 (just consumed gas: 0.010) + [ 6 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 6 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 6) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input457300675-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input457300675-.out new file mode 100644 index 000000000000..b297e77b57f5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input457300675-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_size.tz on storage 111 and input '{}' --level 1 --trace-stack +storage + 0 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.395) + [ (Pair {} 111) ] + - location: 8 (just consumed gas: 0.010) + [ {} ] + - location: 9 (just consumed gas: 0.010) + [ 0 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 0 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 0) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input469078912-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input469078912-.out new file mode 100644 index 000000000000..a8960fea1152 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input469078912-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_size.tz on storage 111 and input '{ 1 ; 2 ; 3 }' --level 1 --trace-stack +storage + 3 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.155) + [ (Pair { 1 ; 2 ; 3 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 ; 2 ; 3 } ] + - location: 9 (just consumed gas: 0.010) + [ 3 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 3 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 3) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input802622031-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input802622031-.out new file mode 100644 index 000000000000..324118b5152d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -set_size.tz--storage492856247--input802622031-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/set_size.tz on storage 111 and input '{ 1 }' --level 1 --trace-stack +storage + 1 +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.625) + [ (Pair { 1 } 111) ] + - location: 8 (just consumed gas: 0.010) + [ { 1 } ] + - location: 9 (just consumed gas: 0.010) + [ 1 ] + - location: 10 (just consumed gas: 0.010) + [ {} + 1 ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} 1) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sha3.tz--storage921624073--input1008262038-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sha3.tz--storage921624073--input1008262038-.out new file mode 100644 index 000000000000..7edd50d469e5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sha3.tz--storage921624073--input1008262038-.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/sha3.tz on storage None and input 0x48656c6c6f2c20776f726c6421 --level 1 --trace-stack +storage + (Some 0xf345a219da005ebe9c1a1eaad97bbf38a10c8473e41d0af7fb617caa0c6aa722) +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 5.053) + [ (Pair 0x48656c6c6f2c20776f726c6421 None) ] + - location: 8 (just consumed gas: 0.010) + [ 0x48656c6c6f2c20776f726c6421 ] + - location: 9 (just consumed gas: 1.457) + [ 0xf345a219da005ebe9c1a1eaad97bbf38a10c8473e41d0af7fb617caa0c6aa722 ] + - location: 10 (just consumed gas: 0.010) + [ (Some 0xf345a219da005ebe9c1a1eaad97bbf38a10c8473e41d0af7fb617caa0c6aa722) ] + - location: 11 (just consumed gas: 0.010) + [ {} + (Some 0xf345a219da005ebe9c1a1eaad97bbf38a10c8473e41d0af7fb617caa0c6aa722) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair {} + (Some 0xf345a219da005ebe9c1a1eaad97bbf38a10c8473e41d0af7fb617caa0c6aa722)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input115382786-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input115382786-.out new file mode 100644 index 000000000000..b8e5b03ac2ee --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input115382786-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Left (Pair 15 2))' --level 1 --trace-stack +storage + (Some 60) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 15 2)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 15 2)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 15 2) ] + - location: 17 (just consumed gas: 0.010) + [ 15 + 2 ] + - location: 18 (just consumed gas: 0) + [ 60 ] + - location: 15 (just consumed gas: 0.015) + [ 60 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 60) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 60) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 60)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input271566295-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input271566295-.out new file mode 100644 index 000000000000..6aae4e95d5ed --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input271566295-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Right (Pair 0 1))' --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 0 1)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 0 1)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 0 1) ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 1 ] + - location: 21 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.015) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input340971987-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input340971987-.out new file mode 100644 index 000000000000..58ad91926520 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input340971987-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Left (Pair 0 0))' --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 0 0)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 0 0)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 17 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 18 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.015) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input374168553-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input374168553-.out new file mode 100644 index 000000000000..107db05a8b27 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input374168553-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Right (Pair 15 2))' --level 1 --trace-stack +storage + (Some 3) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 15 2)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 15 2)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 15 2) ] + - location: 20 (just consumed gas: 0.010) + [ 15 + 2 ] + - location: 21 (just consumed gas: 0) + [ 3 ] + - location: 15 (just consumed gas: 0.015) + [ 3 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 3) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 3) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 3)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input413621582-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input413621582-.out new file mode 100644 index 000000000000..3dd9d67caf45 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input413621582-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Right (Pair 1 2))' --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 1 2)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 1 2)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 1 2) ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 2 ] + - location: 21 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.015) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input424849461-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input424849461-.out new file mode 100644 index 000000000000..6b699b9f6665 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input424849461-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Left (Pair 1 2))' --level 1 --trace-stack +storage + (Some 4) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 1 2)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 1 2)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 1 2) ] + - location: 17 (just consumed gas: 0.010) + [ 1 + 2 ] + - location: 18 (just consumed gas: 0) + [ 4 ] + - location: 15 (just consumed gas: 0.015) + [ 4 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 4) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 4) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 4)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input485030042-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input485030042-.out new file mode 100644 index 000000000000..51ee11de9073 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input485030042-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Left (Pair 8 1))' --level 1 --trace-stack +storage + (Some 16) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 8 1)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 8 1)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 8 1) ] + - location: 17 (just consumed gas: 0.010) + [ 8 + 1 ] + - location: 18 (just consumed gas: 0) + [ 16 ] + - location: 15 (just consumed gas: 0.015) + [ 16 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 16) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 16) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 16)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input705767726-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input705767726-.out new file mode 100644 index 000000000000..34947dc9f11b --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input705767726-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Right (Pair 8 1))' --level 1 --trace-stack +storage + (Some 4) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 8 1)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 8 1)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 8 1) ] + - location: 20 (just consumed gas: 0.010) + [ 8 + 1 ] + - location: 21 (just consumed gas: 0) + [ 4 ] + - location: 15 (just consumed gas: 0.015) + [ 4 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 4) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 4) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 4)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input769385932-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input769385932-.out new file mode 100644 index 000000000000..64bd414eae23 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input769385932-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Left (Pair 0 1))' --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Left (Pair 0 1)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Left (Pair 0 1)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 0 1) ] + - location: 17 (just consumed gas: 0.010) + [ 0 + 1 ] + - location: 18 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.015) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input913715337-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input913715337-.out new file mode 100644 index 000000000000..88800385abac --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -shifts.tz--storage921624073--input913715337-.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/shifts.tz on storage None and input '(Right (Pair 0 0))' --level 1 --trace-stack +storage + (Some 0) +emitted operations + +big_map diff + +trace + - location: 14 (just consumed gas: 8.811) + [ (Pair (Right (Pair 0 0)) None) ] + - location: 14 (just consumed gas: 0.010) + [ (Right (Pair 0 0)) ] + - location: 15 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 21 (just consumed gas: 0) + [ 0 ] + - location: 15 (just consumed gas: 0.015) + [ 0 ] + - location: 22 (just consumed gas: 0.010) + [ (Some 0) ] + - location: 23 (just consumed gas: 0.010) + [ {} + (Some 0) ] + - location: 25 (just consumed gas: 0.010) + [ (Pair {} (Some 0)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage351480851--input65907686-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage351480851--input65907686-.out new file mode 100644 index 000000000000..0c7f9f500dff --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage351480851--input65907686-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some"FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo"' and input 'Pair 1 10000' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 69.312) + [ (Pair (Pair 1 10000) + (Some "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 10000) + (Some "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo") + (Pair 1 10000) ] + - location: 13 (just consumed gas: 0) + [ "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo" + (Pair 1 10000) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 10000) + "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo" ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 10000 + "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo" ] + - location: 21 (just consumed gas: 3.025) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input198821575-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input198821575-.out new file mode 100644 index 000000000000..e1602b874f42 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input198821575-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 1 1' --level 1 --trace-stack +storage + (Some "o") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 1 1) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 1) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 1 1) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 1 1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 1) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 1 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ (Some "o") ] + - location: 13 (just consumed gas: 0.015) + [ (Some "o") ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some "o") ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some "o")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input359592843-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input359592843-.out new file mode 100644 index 000000000000..64930283a983 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input359592843-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 10 5' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 10 5) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 10 5) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 10 5) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 10 5) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 10 5) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 10 + 5 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input551316239-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input551316239-.out new file mode 100644 index 000000000000..b0accf034895 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input551316239-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 0 0' --level 1 --trace-stack +storage + (Some "") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 0 0) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 0) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 0 0) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 0 0) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 0 0) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 0 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ (Some "") ] + - location: 13 (just consumed gas: 0.015) + [ (Some "") ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some "") ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some "")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input722749044-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input722749044-.out new file mode 100644 index 000000000000..e1ad5a872b12 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input722749044-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 0 10' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 0 10) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 10) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 0 10) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 0 10) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 0 10) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 10 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input839234860-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input839234860-.out new file mode 100644 index 000000000000..e22e9ad98d3c --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input839234860-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 1 3' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 1 3) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 3) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 1 3) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 1 3) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 3) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 3 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input919180079-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input919180079-.out new file mode 100644 index 000000000000..c23a5a1b1649 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage364922380--input919180079-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage 'Some "Foo"' and input 'Pair 0 2' --level 1 --trace-stack +storage + (Some "Fo") +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.342) + [ (Pair (Pair 0 2) (Some "Foo")) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 2) + (Some "Foo") ] + - location: 11 (just consumed gas: 0.010) + [ (Some "Foo") + (Pair 0 2) ] + - location: 13 (just consumed gas: 0) + [ "Foo" + (Pair 0 2) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 0 2) + "Foo" ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 2 + "Foo" ] + - location: 21 (just consumed gas: 0.026) + [ (Some "Fo") ] + - location: 13 (just consumed gas: 0.015) + [ (Some "Fo") ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some "Fo") ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some "Fo")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage921624073--input551316239-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage921624073--input551316239-.out new file mode 100644 index 000000000000..087f0e31b5d2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice.tz--storage921624073--input551316239-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice.tz on storage None and input 'Pair 0 0' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.198) + [ (Pair (Pair 0 0) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 0) + None ] + - location: 11 (just consumed gas: 0.010) + [ None + (Pair 0 0) ] + - location: 13 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 15 (just consumed gas: 0.010) + [ ] + - location: 16 (just consumed gas: 0.010) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input198821575-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input198821575-.out new file mode 100644 index 000000000000..e03abec00810 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input198821575-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 1 1' --level 1 --trace-stack +storage + (Some 0xbb) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 1 1) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 1) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 1 1) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 1 1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 1) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 1 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ (Some 0xbb) ] + - location: 13 (just consumed gas: 0.015) + [ (Some 0xbb) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some 0xbb) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some 0xbb)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input462551352-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input462551352-.out new file mode 100644 index 000000000000..3711b7519f57 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input462551352-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 0 1' --level 1 --trace-stack +storage + (Some 0xaa) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 0 1) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 1) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 0 1) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 0 1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 0 1) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 1 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ (Some 0xaa) ] + - location: 13 (just consumed gas: 0.015) + [ (Some 0xaa) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some 0xaa) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some 0xaa)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input489157380-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input489157380-.out new file mode 100644 index 000000000000..37601a5bdd7a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input489157380-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 1 2' --level 1 --trace-stack +storage + (Some 0xbbcc) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 1 2) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 2) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 1 2) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 1 2) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 2) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 2 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ (Some 0xbbcc) ] + - location: 13 (just consumed gas: 0.015) + [ (Some 0xbbcc) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some 0xbbcc) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some 0xbbcc)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input551316239-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input551316239-.out new file mode 100644 index 000000000000..acd3c61ecc87 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input551316239-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 0 0' --level 1 --trace-stack +storage + (Some 0x) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 0 0) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 0) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 0 0) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 0 0) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 0 0) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 0 + 0 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ (Some 0x) ] + - location: 13 (just consumed gas: 0.015) + [ (Some 0x) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some 0x) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some 0x)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input669330759-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input669330759-.out new file mode 100644 index 000000000000..1111d331ddca --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input669330759-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 2 2' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 2 2) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 2 2) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 2 2) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 2 2) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 2 2) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 2 + 2 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input743596105-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input743596105-.out new file mode 100644 index 000000000000..cfddf35f1bf7 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input743596105-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 2 1' --level 1 --trace-stack +storage + (Some 0xcc) +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 2 1) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 2 1) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 2 1) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 2 1) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 2 1) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 2 + 1 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ (Some 0xcc) ] + - location: 13 (just consumed gas: 0.015) + [ (Some 0xcc) ] + - location: 22 (just consumed gas: 0.010) + [ {} + (Some 0xcc) ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} (Some 0xcc)) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input839234860-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input839234860-.out new file mode 100644 index 000000000000..794ce92f0614 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage229749865--input839234860-.out @@ -0,0 +1,37 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbcc' and input 'Pair 1 3' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 1 3) (Some 0xaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 3) + (Some 0xaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbcc) + (Pair 1 3) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbcc + (Pair 1 3) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 3) + 0xaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 3 + 0xaabbcc ] + - location: 21 (just consumed gas: 0.026) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage504917929--input65907686-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage504917929--input65907686-.out new file mode 100644 index 000000000000..36b46e15c2c2 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage504917929--input65907686-.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage 'Some 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc' and input 'Pair 1 10000' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.298) + [ (Pair (Pair 1 10000) + (Some 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc)) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 10000) + (Some 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc) ] + - location: 11 (just consumed gas: 0.010) + [ (Some 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc) + (Pair 1 10000) ] + - location: 13 (just consumed gas: 0) + [ 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc + (Pair 1 10000) ] + - location: 19 (just consumed gas: 0.010) + [ (Pair 1 10000) + 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc ] + - location: 20 (just consumed gas: 0.010) + [ 1 + 10000 + 0xaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbccaabbcc ] + - location: 21 (just consumed gas: 3.025) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage921624073--input462551352-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage921624073--input462551352-.out new file mode 100644 index 000000000000..33a9968f77ec --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -slice_bytes.tz--storage921624073--input462551352-.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/slice_bytes.tz on storage None and input 'Pair 0 1' --level 1 --trace-stack +storage + None +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 9.198) + [ (Pair (Pair 0 1) None) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 0 1) + None ] + - location: 11 (just consumed gas: 0.010) + [ None + (Pair 0 1) ] + - location: 13 (just consumed gas: 0) + [ (Pair 0 1) ] + - location: 15 (just consumed gas: 0.010) + [ ] + - location: 16 (just consumed gas: 0.010) + [ None ] + - location: 13 (just consumed gas: 0.015) + [ None ] + - location: 22 (just consumed gas: 0.010) + [ {} + None ] + - location: 24 (just consumed gas: 0.010) + [ (Pair {} None) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input1016369050-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input1016369050-.out new file mode 100644 index 000000000000..cdc4e86cf6d4 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input1016369050-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/str_id.tz on storage None and input '"abcd"' --level 1 --trace-stack +storage + (Some "abcd") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.554) + [ (Pair "abcd" None) ] + - location: 8 (just consumed gas: 0.010) + [ "abcd" ] + - location: 9 (just consumed gas: 0.010) + [ (Some "abcd") ] + - location: 10 (just consumed gas: 0.010) + [ {} + (Some "abcd") ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} (Some "abcd")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input93477117-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input93477117-.out new file mode 100644 index 000000000000..622971f65c57 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -str_id.tz--storage921624073--input93477117-.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/str_id.tz on storage None and input '"Hello"' --level 1 --trace-stack +storage + (Some "Hello") +emitted operations + +big_map diff + +trace + - location: 8 (just consumed gas: 4.564) + [ (Pair "Hello" None) ] + - location: 8 (just consumed gas: 0.010) + [ "Hello" ] + - location: 9 (just consumed gas: 0.010) + [ (Some "Hello") ] + - location: 10 (just consumed gas: 0.010) + [ {} + (Some "Hello") ] + - location: 12 (just consumed gas: 0.010) + [ (Pair {} (Some "Hello")) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input249636002-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input249636002-.out new file mode 100644 index 000000000000..8d9285abfa54 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input249636002-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/sub_timestamp_delta.tz on storage 111 and input '(Pair 100 100)' --level 1 --trace-stack +storage + "1970-01-01T00:00:00Z" +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:01:40Z" 100) "1970-01-01T00:01:51Z") ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 100) + (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" + (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:01:40Z" 100) ] + - location: 14 (just consumed gas: 0.010) + [ 100 ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:01:40Z" + 100 ] + - location: 15 (just consumed gas: 0.035) + [ "1970-01-01T00:00:00Z" ] + - location: 16 (just consumed gas: 0.010) + [ {} + "1970-01-01T00:00:00Z" ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} "1970-01-01T00:00:00Z") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input307538219-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input307538219-.out new file mode 100644 index 000000000000..dac72d31a308 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input307538219-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/sub_timestamp_delta.tz on storage 111 and input '(Pair 100 -100)' --level 1 --trace-stack +storage + "1970-01-01T00:03:20Z" +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:01:40Z" -100) "1970-01-01T00:01:51Z") ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" -100) + (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" + (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:01:40Z" -100) ] + - location: 14 (just consumed gas: 0.010) + [ -100 ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:01:40Z" + -100 ] + - location: 15 (just consumed gas: 0.035) + [ "1970-01-01T00:03:20Z" ] + - location: 16 (just consumed gas: 0.010) + [ {} + "1970-01-01T00:03:20Z" ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} "1970-01-01T00:03:20Z") ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input831449542-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input831449542-.out new file mode 100644 index 000000000000..33bf10f2db68 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -sub_timestamp_delta.tz--storage492856247--input831449542-.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/sub_timestamp_delta.tz on storage 111 and input '(Pair 100 2000000000000000000)' --level 1 --trace-stack +storage + -1999999999999999900 +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 7.437) + [ (Pair (Pair "1970-01-01T00:01:40Z" 2000000000000000000) "1970-01-01T00:01:51Z") ] + - location: 9 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 2000000000000000000) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair "1970-01-01T00:01:40Z" 2000000000000000000) + (Pair "1970-01-01T00:01:40Z" 2000000000000000000) ] + - location: 11 (just consumed gas: 0.010) + [ "1970-01-01T00:01:40Z" + (Pair "1970-01-01T00:01:40Z" 2000000000000000000) ] + - location: 12 (just consumed gas: 0) + [ (Pair "1970-01-01T00:01:40Z" 2000000000000000000) ] + - location: 14 (just consumed gas: 0.010) + [ 2000000000000000000 ] + - location: 12 (just consumed gas: 0.025) + [ "1970-01-01T00:01:40Z" + 2000000000000000000 ] + - location: 15 (just consumed gas: 0.039) + [ -1999999999999999900 ] + - location: 16 (just consumed gas: 0.010) + [ {} + -1999999999999999900 ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} -1999999999999999900) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input706350605-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input706350605-.out new file mode 100644 index 000000000000..18793384cd8f --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input706350605-.out @@ -0,0 +1,71 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/tez_add_sub.tz on storage None and input '(Pair 2310000 1010000)' --level 1 --trace-stack +storage + (Some (Pair 3320000 1300000)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 16.995) + [ (Pair (Pair 2310000 1010000) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair 2310000 1010000) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair 2310000 1010000) + (Pair 2310000 1010000) ] + - location: 14 (just consumed gas: 0.010) + [ (Pair 2310000 1010000) + (Pair 2310000 1010000) + (Pair 2310000 1010000) ] + - location: 15 (just consumed gas: 0.010) + [ 2310000 + (Pair 2310000 1010000) + (Pair 2310000 1010000) ] + - location: 16 (just consumed gas: 0) + [ (Pair 2310000 1010000) + (Pair 2310000 1010000) ] + - location: 18 (just consumed gas: 0.010) + [ 1010000 + (Pair 2310000 1010000) ] + - location: 16 (just consumed gas: 0.025) + [ 2310000 + 1010000 + (Pair 2310000 1010000) ] + - location: 19 (just consumed gas: 0.020) + [ 3320000 + (Pair 2310000 1010000) ] + - location: 20 (just consumed gas: 0) + [ (Pair 2310000 1010000) ] + - location: 22 (just consumed gas: 0.010) + [ (Pair 2310000 1010000) + (Pair 2310000 1010000) ] + - location: 23 (just consumed gas: 0.010) + [ 2310000 + (Pair 2310000 1010000) ] + - location: 24 (just consumed gas: 0) + [ (Pair 2310000 1010000) ] + - location: 26 (just consumed gas: 0.010) + [ 1010000 ] + - location: 24 (just consumed gas: 0.025) + [ 2310000 + 1010000 ] + - location: 27 (just consumed gas: 0.015) + [ (Some 1300000) ] + - location: 29 (just consumed gas: 0) + [ 1300000 ] + - location: 29 (just consumed gas: 0.015) + [ 1300000 ] + - location: 20 (just consumed gas: 0.025) + [ 3320000 + 1300000 ] + - location: 35 (just consumed gas: 0.010) + [ (Pair 3320000 1300000) ] + - location: 36 (just consumed gas: 0.010) + [ (Some (Pair 3320000 1300000)) ] + - location: 37 (just consumed gas: 0.010) + [ {} + (Some (Pair 3320000 1300000)) ] + - location: 39 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair 3320000 1300000))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input856198194-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input856198194-.out new file mode 100644 index 000000000000..c2ad3d1351ae --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -tez_add_sub.tz--storage921624073--input856198194-.out @@ -0,0 +1,71 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/tez_add_sub.tz on storage None and input '(Pair 2000000 1000000)' --level 1 --trace-stack +storage + (Some (Pair 3000000 1000000)) +emitted operations + +big_map diff + +trace + - location: 12 (just consumed gas: 16.995) + [ (Pair (Pair 2000000 1000000) None) ] + - location: 12 (just consumed gas: 0.010) + [ (Pair 2000000 1000000) ] + - location: 13 (just consumed gas: 0.010) + [ (Pair 2000000 1000000) + (Pair 2000000 1000000) ] + - location: 14 (just consumed gas: 0.010) + [ (Pair 2000000 1000000) + (Pair 2000000 1000000) + (Pair 2000000 1000000) ] + - location: 15 (just consumed gas: 0.010) + [ 2000000 + (Pair 2000000 1000000) + (Pair 2000000 1000000) ] + - location: 16 (just consumed gas: 0) + [ (Pair 2000000 1000000) + (Pair 2000000 1000000) ] + - location: 18 (just consumed gas: 0.010) + [ 1000000 + (Pair 2000000 1000000) ] + - location: 16 (just consumed gas: 0.025) + [ 2000000 + 1000000 + (Pair 2000000 1000000) ] + - location: 19 (just consumed gas: 0.020) + [ 3000000 + (Pair 2000000 1000000) ] + - location: 20 (just consumed gas: 0) + [ (Pair 2000000 1000000) ] + - location: 22 (just consumed gas: 0.010) + [ (Pair 2000000 1000000) + (Pair 2000000 1000000) ] + - location: 23 (just consumed gas: 0.010) + [ 2000000 + (Pair 2000000 1000000) ] + - location: 24 (just consumed gas: 0) + [ (Pair 2000000 1000000) ] + - location: 26 (just consumed gas: 0.010) + [ 1000000 ] + - location: 24 (just consumed gas: 0.025) + [ 2000000 + 1000000 ] + - location: 27 (just consumed gas: 0.015) + [ (Some 1000000) ] + - location: 29 (just consumed gas: 0) + [ 1000000 ] + - location: 29 (just consumed gas: 0.015) + [ 1000000 ] + - location: 20 (just consumed gas: 0.025) + [ 3000000 + 1000000 ] + - location: 35 (just consumed gas: 0.010) + [ (Pair 3000000 1000000) ] + - location: 36 (just consumed gas: 0.010) + [ (Some (Pair 3000000 1000000)) ] + - location: 37 (just consumed gas: 0.010) + [ {} + (Some (Pair 3000000 1000000)) ] + - location: 39 (just consumed gas: 0.010) + [ (Pair {} (Some (Pair 3000000 1000000))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -uncomb.tz--storage680650890--input394061083-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -uncomb.tz--storage680650890--input394061083-.out new file mode 100644 index 000000000000..4fbcc6201db5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -uncomb.tz--storage680650890--input394061083-.out @@ -0,0 +1,50 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/uncomb.tz on storage 0 and input '(Pair 1 4 2)' --level 1 --trace-stack +storage + 142 +emitted operations + +big_map diff + +trace + - location: 10 (just consumed gas: 10.144) + [ (Pair (Pair 1 4 2) 0) ] + - location: 10 (just consumed gas: 0.010) + [ (Pair 1 4 2) ] + - location: 11 (just consumed gas: 0.037) + [ 1 + 4 + 2 ] + - location: 13 (just consumed gas: 0.010) + [ 100 + 1 + 4 + 2 ] + - location: 16 (just consumed gas: 0.059) + [ 100 + 4 + 2 ] + - location: 17 (just consumed gas: 0.010) + [ 4 + 100 + 2 ] + - location: 18 (just consumed gas: 0.010) + [ 10 + 4 + 100 + 2 ] + - location: 21 (just consumed gas: 0.059) + [ 40 + 100 + 2 ] + - location: 22 (just consumed gas: 0.035) + [ 140 + 2 ] + - location: 23 (just consumed gas: 0.035) + [ 142 ] + - location: 24 (just consumed gas: 0.010) + [ {} + 142 ] + - location: 26 (just consumed gas: 0.010) + [ (Pair {} 142) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -unpair.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -unpair.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..cde488a4c38e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -unpair.tz--storage125992234--input125992234-.out @@ -0,0 +1,462 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/unpair.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 127.791) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ Unit ] + - location: 9 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 10 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 11 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 12 (just consumed gas: 0.035) + [ ] + - location: 14 (just consumed gas: 0.010) + [ Unit ] + - location: 15 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 16 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 17 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 18 (just consumed gas: 0.035) + [ ] + - location: 20 (just consumed gas: 0.010) + [ Unit ] + - location: 21 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 22 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 23 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 24 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 25 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 27 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 28 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 29 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 32 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 33 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 35 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 36 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 37 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 39 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 40 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 41 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 43 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 44 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 45 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 47 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 48 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 49 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 51 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 52 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 53 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 55 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 56 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 57 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 59 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 60 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 61 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 63 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 64 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 65 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 67 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 68 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 69 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 71 (just consumed gas: 0.010) + [ ] + - location: 72 (just consumed gas: 0.010) + [ Unit ] + - location: 73 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 74 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 75 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 76 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 77 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 79 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 80 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 81 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 83 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 84 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 85 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 87 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 88 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 89 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 91 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 92 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 93 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 95 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 96 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 97 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 99 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 100 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 101 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 103 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 104 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 105 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 107 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 108 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 109 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 111 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 112 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 113 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 115 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 116 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 117 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 119 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 120 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 121 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 123 (just consumed gas: 0.010) + [ ] + - location: 124 (just consumed gas: 0.010) + [ Unit ] + - location: 125 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 126 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 127 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 128 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 129 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 131 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 132 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 133 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 135 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 136 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 137 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 139 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 140 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 141 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 143 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 144 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 145 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 147 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 148 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 149 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 151 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 152 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 153 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 155 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 156 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 157 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 159 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 160 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 161 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 163 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 164 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 165 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 167 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 168 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 169 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 171 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 172 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 173 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 175 (just consumed gas: 0.010) + [ ] + - location: 176 (just consumed gas: 0.010) + [ Unit ] + - location: 177 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 178 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 179 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 180 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 181 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 183 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 184 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 185 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 187 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 188 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 189 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 191 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 192 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 193 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 195 (just consumed gas: 0.010) + [ (Pair Unit Unit) + (Pair Unit Unit) ] + - location: 196 (just consumed gas: 0.010) + [ Unit + Unit + (Pair Unit Unit) ] + - location: 197 (just consumed gas: 0.035) + [ (Pair Unit Unit) ] + - location: 199 (just consumed gas: 0.010) + [ ] + - location: 200 (just consumed gas: 0.010) + [ Unit ] + - location: 201 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 202 (just consumed gas: 0.010) + [ (Pair Unit Unit) ] + - location: 203 (just consumed gas: 0.010) + [ Unit + Unit ] + - location: 204 (just consumed gas: 0.035) + [ ] + - location: 206 (just consumed gas: 0.010) + [ Unit ] + - location: 207 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 209 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -voting_power.tz--storage1011138251--input1040351577-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -voting_power.tz--storage1011138251--input1040351577-.out new file mode 100644 index 000000000000..8dd0fff6ba00 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -voting_power.tz--storage1011138251--input1040351577-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/voting_power.tz on storage '(Pair 0 0)' and input '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"' --level 1 --trace-stack +storage + (Pair 4000000000000 20000000000000) +emitted operations + +big_map diff + +trace + - location: 9 (just consumed gas: 332.347) + [ (Pair "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" 0 0) ] + - location: 9 (just consumed gas: 0.010) + [ "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" ] + - location: 10 (just consumed gas: 0.605) + [ "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ] + - location: 11 (just consumed gas: 220.656) + [ 4000000000000 ] + - location: 12 (just consumed gas: 0) + [ ] + - location: 14 (just consumed gas: 210.466) + [ 20000000000000 ] + - location: 12 (just consumed gas: 0.025) + [ 4000000000000 + 20000000000000 ] + - location: 15 (just consumed gas: 0.010) + [ (Pair 4000000000000 20000000000000) ] + - location: 16 (just consumed gas: 0.010) + [ {} + (Pair 4000000000000 20000000000000) ] + - location: 18 (just consumed gas: 0.010) + [ (Pair {} 4000000000000 20000000000000) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1058477720-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1058477720-.out new file mode 100644 index 000000000000..82a65f677b4e --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1058477720-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Left (Pair False False)' --level 1 --trace-stack +storage + (Some (Left False)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Left (Pair False False)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Left (Pair False False)) ] + - location: 17 (just consumed gas: 0) + [ (Pair False False) ] + - location: 19 (just consumed gas: 0.010) + [ False + False ] + - location: 20 (just consumed gas: 0.015) + [ False ] + - location: 21 (just consumed gas: 0.010) + [ (Left False) ] + - location: 17 (just consumed gas: 0.015) + [ (Left False) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Left False)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Left False)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Left False))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1073176155-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1073176155-.out new file mode 100644 index 000000000000..704668dcd200 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input1073176155-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 0 0)' --level 1 --trace-stack +storage + (Some (Right 0)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 0 0)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 0 0)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 0 0) ] + - location: 24 (just consumed gas: 0.010) + [ 0 + 0 ] + - location: 25 (just consumed gas: 0.035) + [ 0 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 0) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 0) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 0)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 0)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 0))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input246594902-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input246594902-.out new file mode 100644 index 000000000000..1a135e21884a --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input246594902-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Left (Pair True False)' --level 1 --trace-stack +storage + (Some (Left True)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Left (Pair True False)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Left (Pair True False)) ] + - location: 17 (just consumed gas: 0) + [ (Pair True False) ] + - location: 19 (just consumed gas: 0.010) + [ True + False ] + - location: 20 (just consumed gas: 0.015) + [ True ] + - location: 21 (just consumed gas: 0.010) + [ (Left True) ] + - location: 17 (just consumed gas: 0.015) + [ (Left True) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Left True)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Left True)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Left True))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input506603577-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input506603577-.out new file mode 100644 index 000000000000..e02f61bcfab5 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input506603577-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 1 1)' --level 1 --trace-stack +storage + (Some (Right 0)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 1 1)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 1 1)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 1 1) ] + - location: 24 (just consumed gas: 0.010) + [ 1 + 1 ] + - location: 25 (just consumed gas: 0.035) + [ 0 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 0) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 0) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 0)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 0)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 0))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input576248088-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input576248088-.out new file mode 100644 index 000000000000..611aa54c0b69 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input576248088-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 0 1)' --level 1 --trace-stack +storage + (Some (Right 1)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 0 1)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 0 1)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 0 1) ] + - location: 24 (just consumed gas: 0.010) + [ 0 + 1 ] + - location: 25 (just consumed gas: 0.035) + [ 1 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 1) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 1) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 1)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 1)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 1))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input612012282-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input612012282-.out new file mode 100644 index 000000000000..7c871952de0d --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input612012282-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 42 21)' --level 1 --trace-stack +storage + (Some (Right 63)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 42 21)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 42 21)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 42 21) ] + - location: 24 (just consumed gas: 0.010) + [ 42 + 21 ] + - location: 25 (just consumed gas: 0.035) + [ 63 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 63) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 63) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 63)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 63)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 63))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input617591686-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input617591686-.out new file mode 100644 index 000000000000..32832d6b4440 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input617591686-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Left (Pair False True)' --level 1 --trace-stack +storage + (Some (Left True)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Left (Pair False True)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Left (Pair False True)) ] + - location: 17 (just consumed gas: 0) + [ (Pair False True) ] + - location: 19 (just consumed gas: 0.010) + [ False + True ] + - location: 20 (just consumed gas: 0.015) + [ True ] + - location: 21 (just consumed gas: 0.010) + [ (Left True) ] + - location: 17 (just consumed gas: 0.015) + [ (Left True) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Left True)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Left True)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Left True))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input639311176-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input639311176-.out new file mode 100644 index 000000000000..d9df2a232974 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input639311176-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Left (Pair True True)' --level 1 --trace-stack +storage + (Some (Left False)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Left (Pair True True)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Left (Pair True True)) ] + - location: 17 (just consumed gas: 0) + [ (Pair True True) ] + - location: 19 (just consumed gas: 0.010) + [ True + True ] + - location: 20 (just consumed gas: 0.015) + [ False ] + - location: 21 (just consumed gas: 0.010) + [ (Left False) ] + - location: 17 (just consumed gas: 0.015) + [ (Left False) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Left False)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Left False)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Left False))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input688315180-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input688315180-.out new file mode 100644 index 000000000000..dbffeaea76af --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input688315180-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 42 63)' --level 1 --trace-stack +storage + (Some (Right 21)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 42 63)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 42 63)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 42 63) ] + - location: 24 (just consumed gas: 0.010) + [ 42 + 63 ] + - location: 25 (just consumed gas: 0.035) + [ 21 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 21) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 21) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 21)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 21)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 21))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input967929605-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input967929605-.out new file mode 100644 index 000000000000..5fe53f4ae092 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor.tz--storage921624073--input967929605-.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor.tz on storage None and input 'Right (Pair 1 0)' --level 1 --trace-stack +storage + (Some (Right 1)) +emitted operations + +big_map diff + +trace + - location: 16 (just consumed gas: 11.026) + [ (Pair (Right (Pair 1 0)) None) ] + - location: 16 (just consumed gas: 0.010) + [ (Right (Pair 1 0)) ] + - location: 17 (just consumed gas: 0) + [ (Pair 1 0) ] + - location: 24 (just consumed gas: 0.010) + [ 1 + 0 ] + - location: 25 (just consumed gas: 0.035) + [ 1 ] + - location: 26 (just consumed gas: 0.010) + [ (Right 1) ] + - location: 17 (just consumed gas: 0.015) + [ (Right 1) ] + - location: 28 (just consumed gas: 0.010) + [ (Some (Right 1)) ] + - location: 29 (just consumed gas: 0.010) + [ {} + (Some (Right 1)) ] + - location: 31 (just consumed gas: 0.010) + [ (Pair {} (Some (Right 1))) ] + diff --git a/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor_bytes.tz--storage125992234--input125992234-.out b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor_bytes.tz--storage125992234--input125992234-.out new file mode 100644 index 000000000000..aeecc3aba487 --- /dev/null +++ b/tezt/tests/expected/contract_opcodes.ml/Mumbai- opcodes -xor_bytes.tz--storage125992234--input125992234-.out @@ -0,0 +1,75 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings run script ./tests_python/contracts_016/opcodes/xor_bytes.tz on storage Unit and input Unit --level 1 --trace-stack +storage + Unit +emitted operations + +big_map diff + +trace + - location: 7 (just consumed gas: 28.329) + [ (Pair Unit Unit) ] + - location: 7 (just consumed gas: 0.010) + [ ] + - location: 8 (just consumed gas: 0.010) + [ 0x05 ] + - location: 11 (just consumed gas: 0.010) + [ 0x06 + 0x05 ] + - location: 14 (just consumed gas: 0.030) + [ 0x03 ] + - location: 15 (just consumed gas: 0.010) + [ 0x03 + 0x03 ] + - location: 20 (just consumed gas: 0.035) + [ 0 ] + - location: 21 (just consumed gas: 0.010) + [ True ] + - location: 22 (just consumed gas: 0) + [ ] + - location: 22 (just consumed gas: 0.015) + [ ] + - location: 28 (just consumed gas: 0.010) + [ 0x0005 ] + - location: 31 (just consumed gas: 0.010) + [ 0x0106 + 0x0005 ] + - location: 34 (just consumed gas: 0.031) + [ 0x0103 ] + - location: 35 (just consumed gas: 0.010) + [ 0x0103 + 0x0103 ] + - location: 40 (just consumed gas: 0.035) + [ 0 ] + - location: 41 (just consumed gas: 0.010) + [ True ] + - location: 42 (just consumed gas: 0) + [ ] + - location: 42 (just consumed gas: 0.015) + [ ] + - location: 48 (just consumed gas: 0.010) + [ 0x05 ] + - location: 51 (just consumed gas: 0.010) + [ 0x0106 + 0x05 ] + - location: 54 (just consumed gas: 0.031) + [ 0x0103 ] + - location: 55 (just consumed gas: 0.010) + [ 0x0103 + 0x0103 ] + - location: 60 (just consumed gas: 0.035) + [ 0 ] + - location: 61 (just consumed gas: 0.010) + [ True ] + - location: 62 (just consumed gas: 0) + [ ] + - location: 62 (just consumed gas: 0.015) + [ ] + - location: 68 (just consumed gas: 0.010) + [ Unit ] + - location: 69 (just consumed gas: 0.010) + [ {} + Unit ] + - location: 71 (just consumed gas: 0.010) + [ (Pair {} Unit) ] + diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-accounts.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-accounts.tz.out new file mode 100644 index 000000000000..b606080557dc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-accounts.tz.out @@ -0,0 +1,215 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/accounts.tz --details +Well typed +Gas remaining: 1039932.585 units remaining +{ parameter + (or (key_hash %Initialize) + (pair %Withdraw (key %from) (pair (mutez %withdraw_amount) (signature %sig)))) ; + storage (map :stored_balance key_hash mutez) ; + code { DUP + /* [ pair (or key_hash (pair key mutez signature)) (map key_hash mutez) + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + CAR + /* [ or key_hash (pair key mutez signature) + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + IF_LEFT + { DUP + /* [ key_hash : key_hash + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DIIP { CDR %stored_balance + /* [ map key_hash mutez ] */ ; + DUP + /* [ map key_hash mutez : map key_hash mutez ] */ } + /* [ key_hash : key_hash : map key_hash mutez : map key_hash mutez ] */ ; + DIP { SWAP /* [ map key_hash mutez : key_hash : map key_hash mutez ] */ } + /* [ key_hash : map key_hash mutez : key_hash : map key_hash mutez ] */ ; + GET @opt_prev_balance + /* [ option mutez : key_hash : map key_hash mutez ] */ ; + IF_SOME + { RENAME @previous_balance + /* [ mutez : key_hash : map key_hash mutez ] */ ; + AMOUNT + /* [ mutez : mutez : key_hash : map key_hash mutez ] */ ; + ADD + /* [ mutez : key_hash : map key_hash mutez ] */ ; + SOME + /* [ option mutez : key_hash : map key_hash mutez ] */ ; + SWAP + /* [ key_hash : option mutez : map key_hash mutez ] */ ; + UPDATE + /* [ map key_hash mutez ] */ ; + NIL operation + /* [ list operation : map key_hash mutez ] */ ; + PAIR + /* [ pair (list operation) (map key_hash mutez) ] */ } + { DIP { AMOUNT + /* [ mutez : map key_hash mutez ] */ ; + SOME + /* [ option mutez : map key_hash mutez ] */ } + /* [ key_hash : option mutez : map key_hash mutez ] */ ; + UPDATE + /* [ map key_hash mutez ] */ ; + NIL operation + /* [ list operation : map key_hash mutez ] */ ; + PAIR + /* [ pair (list operation) (map key_hash mutez) ] */ } } + { DUP + /* [ pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DUP + /* [ pair key mutez signature : pair key mutez signature + : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DUP + /* [ pair key mutez signature : pair key mutez signature + : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DUP + /* [ pair key mutez signature : pair key mutez signature + : pair key mutez signature : pair key mutez signature + : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + CAR %from + /* [ key : pair key mutez signature : pair key mutez signature + : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DIIP { CDAR %withdraw_amount ; + PACK + /* [ bytes : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + BLAKE2B @signed_amount + /* [ bytes : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ } + /* [ key : pair key mutez signature : bytes : pair key mutez signature + : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + DIP { CDDR %sig } + /* [ key : signature : bytes : pair key mutez signature + : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + CHECK_SIGNATURE + /* [ bool : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + IF { /* [ pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ } + { PUSH string + "Bad signature" + /* [ string : pair key mutez signature : pair key mutez signature + : pair (or key_hash (pair key mutez signature)) (map key_hash mutez) ] */ ; + FAILWITH + /* [] */ } ; + DIIP { CDR %stored_balance + /* [ map key_hash mutez ] */ ; + DUP + /* [ map key_hash mutez : map key_hash mutez ] */ } + /* [ pair key mutez signature : pair key mutez signature : map key_hash mutez + : map key_hash mutez ] */ ; + CAR %from + /* [ key : pair key mutez signature : map key_hash mutez : map key_hash mutez ] */ ; + HASH_KEY @from_hash + /* [ key_hash : pair key mutez signature : map key_hash mutez + : map key_hash mutez ] */ ; + DUP + /* [ key_hash : key_hash : pair key mutez signature : map key_hash mutez + : map key_hash mutez ] */ ; + DIP { DIP { SWAP + /* [ map key_hash mutez : pair key mutez signature : map key_hash mutez ] */ } + /* [ key_hash : map key_hash mutez : pair key mutez signature + : map key_hash mutez ] */ ; + SWAP + /* [ map key_hash mutez : key_hash : pair key mutez signature + : map key_hash mutez ] */ } + /* [ key_hash : map key_hash mutez : key_hash : pair key mutez signature + : map key_hash mutez ] */ ; + GET + /* [ option mutez : key_hash : pair key mutez signature : map key_hash mutez ] */ ; + IF_NONE + { PUSH string + "Account does not exist" + /* [ string : key_hash : pair key mutez signature : map key_hash mutez ] */ ; + PAIR + /* [ pair string key_hash : pair key mutez signature : map key_hash mutez ] */ ; + FAILWITH + /* [] */ } + { RENAME @previous_balance + /* [ mutez : key_hash : pair key mutez signature : map key_hash mutez ] */ ; + DIP { DROP /* [ pair key mutez signature : map key_hash mutez ] */ } + /* [ mutez : pair key mutez signature : map key_hash mutez ] */ ; + DUP + /* [ mutez : mutez : pair key mutez signature : map key_hash mutez ] */ ; + DIIP { DUP + /* [ pair key mutez signature : pair key mutez signature : map key_hash mutez ] */ ; + CDAR %withdraw_amount ; + DUP + /* [ mutez : mutez : pair key mutez signature : map key_hash mutez ] */ } + /* [ mutez : mutez : mutez : mutez : pair key mutez signature + : map key_hash mutez ] */ ; + DIP { CMPLT @not_enough } + /* [ mutez : bool : mutez : pair key mutez signature : map key_hash mutez ] */ ; + SWAP + /* [ bool : mutez : mutez : pair key mutez signature : map key_hash mutez ] */ ; + IF { PUSH string + "Not enough funds" + /* [ string : mutez : mutez : pair key mutez signature : map key_hash mutez ] */ ; + FAILWITH + /* [] */ } + { SUB_MUTEZ @new_balance + /* [ option mutez : pair key mutez signature : map key_hash mutez ] */ ; + ASSERT_SOME ; + DIP { DUP + /* [ pair key mutez signature : pair key mutez signature : map key_hash mutez ] */ ; + DIP { SWAP /* [ map key_hash mutez : pair key mutez signature ] */ } + /* [ pair key mutez signature : map key_hash mutez : pair key mutez signature ] */ } + /* [ mutez : pair key mutez signature : map key_hash mutez + : pair key mutez signature ] */ ; + DUP + /* [ mutez : mutez : pair key mutez signature : map key_hash mutez + : pair key mutez signature ] */ ; + PUSH @zero + mutez + 0 + /* [ mutez : mutez : mutez : pair key mutez signature : map key_hash mutez + : pair key mutez signature ] */ ; + CMPEQ @null_balance ; + IF { DROP + /* [ pair key mutez signature : map key_hash mutez : pair key mutez signature ] */ ; + NONE @new_balance + mutez + /* [ option mutez : pair key mutez signature : map key_hash mutez + : pair key mutez signature ] */ } + { SOME @new_balance + /* [ option mutez : pair key mutez signature : map key_hash mutez + : pair key mutez signature ] */ } ; + SWAP + /* [ pair key mutez signature : option mutez : map key_hash mutez + : pair key mutez signature ] */ ; + CAR %from + /* [ key : option mutez : map key_hash mutez : pair key mutez signature ] */ ; + HASH_KEY @from_hash + /* [ key_hash : option mutez : map key_hash mutez : pair key mutez signature ] */ ; + UPDATE + /* [ map key_hash mutez : pair key mutez signature ] */ ; + SWAP + /* [ pair key mutez signature : map key_hash mutez ] */ ; + DUP + /* [ pair key mutez signature : pair key mutez signature : map key_hash mutez ] */ ; + CDAR %withdraw_amount ; + DIP { CAR %from + /* [ key : map key_hash mutez ] */ ; + HASH_KEY @from_hash + /* [ key_hash : map key_hash mutez ] */ ; + IMPLICIT_ACCOUNT @from_account + /* [ contract unit : map key_hash mutez ] */ } + /* [ mutez : contract unit : map key_hash mutez ] */ ; + UNIT + /* [ unit : mutez : contract unit : map key_hash mutez ] */ ; + TRANSFER_TOKENS @withdraw_transfer_op + /* [ operation : map key_hash mutez ] */ ; + NIL operation + /* [ list operation : operation : map key_hash mutez ] */ ; + SWAP + /* [ operation : list operation : map key_hash mutez ] */ ; + CONS + /* [ list operation : map key_hash mutez ] */ ; + PAIR + /* [ pair (list operation) (map key_hash mutez) ] */ } } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1.tz.out new file mode 100644 index 000000000000..d918236bef55 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/add1.tz --details +Well typed +Gas remaining: 1039996.774 units remaining +{ parameter int ; + storage int ; + code { CAR + /* [ int ] */ ; + PUSH int 1 + /* [ int : int ] */ ; + ADD + /* [ int ] */ ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1_list.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1_list.tz.out new file mode 100644 index 000000000000..162009e74f14 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-add1_list.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/add1_list.tz --details +Well typed +Gas remaining: 1039995.973 units remaining +{ parameter (list int) ; + storage (list int) ; + code { CAR + /* [ list int ] */ ; + MAP { PUSH int 1 /* [ int : int ] */ ; ADD /* [ int ] */ } + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-after_strategy.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-after_strategy.tz.out new file mode 100644 index 000000000000..e8123e47b721 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-after_strategy.tz.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/after_strategy.tz --details +Well typed +Gas remaining: 1039991.203 units remaining +{ parameter nat ; + storage (pair (pair nat bool) timestamp) ; + code { DUP + /* [ pair nat (pair nat bool) timestamp : pair nat (pair nat bool) timestamp ] */ ; + CAR + /* [ nat : pair nat (pair nat bool) timestamp ] */ ; + DIP { CDDR ; + DUP + /* [ timestamp : timestamp ] */ ; + NOW + /* [ timestamp : timestamp : timestamp ] */ ; + CMPGT } + /* [ nat : bool : timestamp ] */ ; + PAIR + /* [ pair nat bool : timestamp ] */ ; + PAIR + /* [ pair (pair nat bool) timestamp ] */ ; + NIL operation + /* [ list operation : pair (pair nat bool) timestamp ] */ ; + PAIR + /* [ pair (list operation) (pair nat bool) timestamp ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-always.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-always.tz.out new file mode 100644 index 000000000000..19c5e369a771 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-always.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/always.tz --details +Well typed +Gas remaining: 1039995.941 units remaining +{ parameter nat ; + storage (pair nat bool) ; + code { CAR + /* [ nat ] */ ; + PUSH bool True + /* [ bool : nat ] */ ; + SWAP + /* [ nat : bool ] */ ; + PAIR + /* [ pair nat bool ] */ ; + NIL operation + /* [ list operation : pair nat bool ] */ ; + PAIR + /* [ pair (list operation) nat bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-append.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-append.tz.out new file mode 100644 index 000000000000..75a9912e54b2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-append.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/append.tz --details +Well typed +Gas remaining: 1039993.459 units remaining +{ parameter (pair (list int) (list int)) ; + storage (list int) ; + code { CAR + /* [ pair (list int) (list int) ] */ ; + UNPAIR + /* [ list int : list int ] */ ; + NIL int + /* [ list int : list int : list int ] */ ; + SWAP + /* [ list int : list int : list int ] */ ; + ITER { CONS /* [ list int : list int ] */ } + /* [ list int : list int ] */ ; + ITER { CONS /* [ list int ] */ } + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-at_least.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-at_least.tz.out new file mode 100644 index 000000000000..def56f2ad5ef --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-at_least.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/at_least.tz --details +Well typed +Gas remaining: 1039993.870 units remaining +{ parameter unit ; + storage mutez ; + code { CDR + /* [ mutez ] */ ; + DUP + /* [ mutez : mutez ] */ ; + AMOUNT + /* [ mutez : mutez : mutez ] */ ; + CMPLT ; + IF { FAIL } + { NIL operation + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-auction.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-auction.tz.out new file mode 100644 index 000000000000..ef571ef71eef --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-auction.tz.out @@ -0,0 +1,66 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/auction.tz --details +Well typed +Gas remaining: 1039974.418 units remaining +{ parameter key_hash ; + storage (pair timestamp (pair mutez key_hash)) ; + code { DUP + /* [ pair key_hash timestamp mutez key_hash + : pair key_hash timestamp mutez key_hash ] */ ; + CDAR ; + DUP + /* [ timestamp : timestamp : pair key_hash timestamp mutez key_hash ] */ ; + NOW + /* [ timestamp : timestamp : timestamp + : pair key_hash timestamp mutez key_hash ] */ ; + CMPGT ; + IF { FAIL } { /* [ timestamp : pair key_hash timestamp mutez key_hash ] */ } ; + SWAP + /* [ pair key_hash timestamp mutez key_hash : timestamp ] */ ; + DUP + /* [ pair key_hash timestamp mutez key_hash + : pair key_hash timestamp mutez key_hash : timestamp ] */ ; + CAR + /* [ key_hash : pair key_hash timestamp mutez key_hash : timestamp ] */ ; + DIP { CDDR } + /* [ key_hash : pair mutez key_hash : timestamp ] */ ; + AMOUNT + /* [ mutez : key_hash : pair mutez key_hash : timestamp ] */ ; + PAIR + /* [ pair mutez key_hash : pair mutez key_hash : timestamp ] */ ; + SWAP + /* [ pair mutez key_hash : pair mutez key_hash : timestamp ] */ ; + DIP { SWAP + /* [ timestamp : pair mutez key_hash ] */ ; + PAIR + /* [ pair timestamp mutez key_hash ] */ } + /* [ pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + DUP + /* [ pair mutez key_hash : pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + CAR + /* [ mutez : pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + AMOUNT + /* [ mutez : mutez : pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + CMPLE ; + IF { FAIL } { /* [ pair mutez key_hash : pair timestamp mutez key_hash ] */ } ; + DUP + /* [ pair mutez key_hash : pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + CAR + /* [ mutez : pair mutez key_hash : pair timestamp mutez key_hash ] */ ; + DIP { CDR + /* [ key_hash : pair timestamp mutez key_hash ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : pair timestamp mutez key_hash ] */ } + /* [ mutez : contract unit : pair timestamp mutez key_hash ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair timestamp mutez key_hash ] */ ; + TRANSFER_TOKENS + /* [ operation : pair timestamp mutez key_hash ] */ ; + NIL operation + /* [ list operation : operation : pair timestamp mutez key_hash ] */ ; + SWAP + /* [ operation : list operation : pair timestamp mutez key_hash ] */ ; + CONS + /* [ list operation : pair timestamp mutez key_hash ] */ ; + PAIR + /* [ pair (list operation) timestamp mutez key_hash ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-bad_lockup.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-bad_lockup.tz.out new file mode 100644 index 000000000000..8498c135b988 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-bad_lockup.tz.out @@ -0,0 +1,59 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/bad_lockup.tz --details +Well typed +Gas remaining: 1039974.993 units remaining +{ parameter unit ; + storage (pair timestamp (pair address address)) ; + code { CDR + /* [ pair timestamp address address ] */ ; + DUP + /* [ pair timestamp address address : pair timestamp address address ] */ ; + CAR + /* [ timestamp : pair timestamp address address ] */ ; + NOW + /* [ timestamp : timestamp : pair timestamp address address ] */ ; + CMPLT ; + IF { FAIL } { /* [ pair timestamp address address ] */ } ; + DUP + /* [ pair timestamp address address : pair timestamp address address ] */ ; + CDAR ; + CONTRACT unit + /* [ option (contract unit) : pair timestamp address address ] */ ; + ASSERT_SOME ; + PUSH mutez 100000000 + /* [ mutez : contract unit : pair timestamp address address ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair timestamp address address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair timestamp address address ] */ ; + SWAP + /* [ pair timestamp address address : operation ] */ ; + DUP + /* [ pair timestamp address address : pair timestamp address address + : operation ] */ ; + CDDR ; + CONTRACT + unit + /* [ option (contract unit) : pair timestamp address address : operation ] */ ; + ASSERT_SOME ; + PUSH mutez + 100000000 + /* [ mutez : contract unit : pair timestamp address address : operation ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair timestamp address address : operation ] */ ; + TRANSFER_TOKENS + /* [ operation : pair timestamp address address : operation ] */ ; + DIP { SWAP /* [ operation : pair timestamp address address ] */ } + /* [ operation : operation : pair timestamp address address ] */ ; + NIL operation + /* [ list operation : operation : operation : pair timestamp address address ] */ ; + SWAP + /* [ operation : list operation : operation : pair timestamp address address ] */ ; + CONS + /* [ list operation : operation : pair timestamp address address ] */ ; + SWAP + /* [ operation : list operation : pair timestamp address address ] */ ; + CONS + /* [ list operation : pair timestamp address address ] */ ; + PAIR + /* [ pair (list operation) timestamp address address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-big_map_union.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-big_map_union.tz.out new file mode 100644 index 000000000000..d47e3ecc1df4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-big_map_union.tz.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/big_map_union.tz --details +Well typed +Gas remaining: 1039987.459 units remaining +{ parameter (list (pair string int)) ; + storage (pair (big_map string int) unit) ; + code { UNPAPAIR ; + ITER { UNPAIR + /* [ string : int : big_map string int : unit ] */ ; + DUUUP + /* [ big_map string int : string : int : big_map string int : unit ] */ ; + DUUP + /* [ string : big_map string int : string : int : big_map string int : unit ] */ ; + GET + /* [ option int : string : int : big_map string int : unit ] */ ; + IF_NONE + { PUSH int 0 /* [ int : string : int : big_map string int : unit ] */ } + { /* [ int : string : int : big_map string int : unit ] */ } ; + SWAP + /* [ string : int : int : big_map string int : unit ] */ ; + DIP { ADD + /* [ int : big_map string int : unit ] */ ; + SOME + /* [ option int : big_map string int : unit ] */ } + /* [ string : option int : big_map string int : unit ] */ ; + UPDATE + /* [ big_map string int : unit ] */ } + /* [ big_map string int : unit ] */ ; + PAIR + /* [ pair (big_map string int) unit ] */ ; + NIL operation + /* [ list operation : pair (big_map string int) unit ] */ ; + PAIR + /* [ pair (list operation) (big_map string int) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cadr_annotation.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cadr_annotation.tz.out new file mode 100644 index 000000000000..a882cdeda11c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cadr_annotation.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/cadr_annotation.tz --details +Well typed +Gas remaining: 1039995.385 units remaining +{ parameter (pair (pair %p1 unit (string %no_name)) bool) ; + storage unit ; + code { CAR @param + /* [ pair (pair unit string) bool ] */ ; + CADR @name %no_name ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-concat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-concat.tz.out new file mode 100644 index 000000000000..ccf48e026864 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-concat.tz.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/concat.tz --details +Well typed +Gas remaining: 1039993.578 units remaining +{ parameter string ; + storage string ; + code { DUP + /* [ pair string string : pair string string ] */ ; + DIP { CDR + /* [ string ] */ ; + NIL string + /* [ list string : string ] */ ; + SWAP + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ } + /* [ pair string string : list string ] */ ; + CAR + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ ; + CONCAT + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-conditionals.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-conditionals.tz.out new file mode 100644 index 000000000000..30cb4c94d765 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-conditionals.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/conditionals.tz --details +Well typed +Gas remaining: 1039990.576 units remaining +{ parameter (or string (option int)) ; + storage string ; + code { CAR + /* [ or string (option int) ] */ ; + IF_LEFT + { /* [ string ] */ } + { IF_NONE + { FAIL } + { PUSH int 0 + /* [ int : int ] */ ; + CMPGT ; + IF { FAIL } { PUSH string "" /* [ string ] */ } } } ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cons_twice.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cons_twice.tz.out new file mode 100644 index 000000000000..77ed0cf55a87 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cons_twice.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/cons_twice.tz --details +Well typed +Gas remaining: 1039993.758 units remaining +{ parameter nat ; + storage (list nat) ; + code { DUP + /* [ pair nat (list nat) : pair nat (list nat) ] */ ; + CAR + /* [ nat : pair nat (list nat) ] */ ; + DIP { CDR /* [ list nat ] */ } + /* [ nat : list nat ] */ ; + DUP + /* [ nat : nat : list nat ] */ ; + DIP { CONS /* [ list nat ] */ } + /* [ nat : list nat ] */ ; + CONS + /* [ list nat ] */ ; + NIL operation + /* [ list operation : list nat ] */ ; + PAIR + /* [ pair (list operation) (list nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cps_fact.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cps_fact.tz.out new file mode 100644 index 000000000000..256fb4d063ca --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-cps_fact.tz.out @@ -0,0 +1,66 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/cps_fact.tz --details +Well typed +Gas remaining: 1039976.109 units remaining +{ storage nat ; + parameter nat ; + code { UNPAIR + /* [ nat : nat ] */ ; + DIP { SELF + /* [ contract nat : nat ] */ ; + ADDRESS + /* [ address : nat ] */ ; + SENDER + /* [ address : address : nat ] */ ; + IFCMPEQ { /* [ nat ] */ } { DROP /* [] */ ; PUSH @storage nat 1 /* [ nat ] */ } } + /* [ nat : nat ] */ ; + DUP + /* [ nat : nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat : nat ] */ ; + IFCMPGE + { DROP + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } + { PUSH nat 1 + /* [ nat : nat : nat ] */ ; + SWAP + /* [ nat : nat : nat ] */ ; + SUB @parameter + /* [ int : nat ] */ ; + ISNAT + /* [ option nat : nat ] */ ; + IF_NONE + { NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } + { DUP + /* [ nat : nat : nat ] */ ; + DIP { PUSH nat 1 + /* [ nat : nat : nat ] */ ; + ADD + /* [ nat : nat ] */ ; + MUL @storage + /* [ nat ] */ } + /* [ nat : nat ] */ ; + SWAP + /* [ nat : nat ] */ ; + DIP { DIP { SELF /* [ contract nat ] */ ; PUSH mutez 0 /* [ mutez : contract nat ] */ } + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ } + /* [ nat : list operation ] */ ; + SWAP + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-create_add1_lists.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-create_add1_lists.tz.out new file mode 100644 index 000000000000..e46b4da2a1fc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-create_add1_lists.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/create_add1_lists.tz --details +Well typed +Gas remaining: 1039989.990 units remaining +{ parameter unit ; + storage address ; + code { DROP + /* [] */ ; + NIL int /* [ list int ] */ + /* [ list int ] */ ; + AMOUNT + /* [ list int ] */ ; + NONE key_hash /* [ int : int ] */ + /* [ option key_hash : mutez : list int ] */ ; + CREATE_CONTRACT + { parameter (list int /* [ list operation : list int ] */) + /* [ int ] */ ; + storage (list int) + /* [ pair (list operation) (list int) ] */ ; + code { CAR ; MAP { PUSH int 1 ; ADD } ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-data_publisher.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-data_publisher.tz.out new file mode 100644 index 000000000000..edb696e526ca --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-data_publisher.tz.out @@ -0,0 +1,73 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/data_publisher.tz --details +Well typed +Gas remaining: 1039975.804 units remaining +{ parameter (pair signature (pair string nat)) ; + storage (pair (pair key nat) string) ; + code { DUP + /* [ pair (pair signature string nat) (pair key nat) string + : pair (pair signature string nat) (pair key nat) string ] */ ; + CAR + /* [ pair signature string nat + : pair (pair signature string nat) (pair key nat) string ] */ ; + DIP { CDR + /* [ pair (pair key nat) string ] */ ; + DUP + /* [ pair (pair key nat) string : pair (pair key nat) string ] */ } + /* [ pair signature string nat : pair (pair key nat) string + : pair (pair key nat) string ] */ ; + SWAP + /* [ pair (pair key nat) string : pair signature string nat + : pair (pair key nat) string ] */ ; + DIP { DUP + /* [ pair signature string nat : pair signature string nat + : pair (pair key nat) string ] */ } + /* [ pair (pair key nat) string : pair signature string nat + : pair signature string nat : pair (pair key nat) string ] */ ; + CAAR ; + DIP { DUP + /* [ pair signature string nat : pair signature string nat + : pair signature string nat : pair (pair key nat) string ] */ ; + CAR + /* [ signature : pair signature string nat : pair signature string nat + : pair (pair key nat) string ] */ ; + DIP { CDR + /* [ pair string nat : pair signature string nat : pair (pair key nat) string ] */ ; + PACK + /* [ bytes : pair signature string nat : pair (pair key nat) string ] */ ; + BLAKE2B + /* [ bytes : pair signature string nat : pair (pair key nat) string ] */ } + /* [ signature : bytes : pair signature string nat + : pair (pair key nat) string ] */ } + /* [ key : signature : bytes : pair signature string nat + : pair (pair key nat) string ] */ ; + CHECK_SIGNATURE + /* [ bool : pair signature string nat : pair (pair key nat) string ] */ ; + IF { CDR + /* [ pair string nat : pair (pair key nat) string ] */ ; + DUP + /* [ pair string nat : pair string nat : pair (pair key nat) string ] */ ; + DIP { CAR + /* [ string : pair (pair key nat) string ] */ ; + DIP { CAAR } + /* [ string : key ] */ } + /* [ pair string nat : string : key ] */ ; + CDR + /* [ nat : string : key ] */ ; + PUSH nat 1 + /* [ nat : nat : string : key ] */ ; + ADD + /* [ nat : string : key ] */ ; + DIP { SWAP /* [ key : string ] */ } + /* [ nat : key : string ] */ ; + SWAP + /* [ key : nat : string ] */ ; + PAIR + /* [ pair key nat : string ] */ ; + PAIR + /* [ pair (pair key nat) string ] */ ; + NIL operation + /* [ list operation : pair (pair key nat) string ] */ ; + PAIR + /* [ pair (list operation) (pair key nat) string ] */ } + { FAIL } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-dispatch.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-dispatch.tz.out new file mode 100644 index 000000000000..a024db20e6cb --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-dispatch.tz.out @@ -0,0 +1,55 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/dispatch.tz --details +Well typed +Gas remaining: 1039983.006 units remaining +{ parameter (or string (pair string (lambda unit string))) ; + storage (pair string (map string (lambda unit string))) ; + code { DUP + /* [ pair (or string (pair string (lambda unit string))) + string + (map string (lambda unit string)) + : pair (or string (pair string (lambda unit string))) + string + (map string (lambda unit string)) ] */ ; + DIP { CDDR } + /* [ pair (or string (pair string (lambda unit string))) + string + (map string (lambda unit string)) : map string (lambda unit string) ] */ ; + CAR + /* [ or string (pair string (lambda unit string)) + : map string (lambda unit string) ] */ ; + IF_LEFT + { DIP { DUP + /* [ map string (lambda unit string) : map string (lambda unit string) ] */ } + /* [ string : map string (lambda unit string) + : map string (lambda unit string) ] */ ; + GET + /* [ option (lambda unit string) : map string (lambda unit string) ] */ ; + IF_NONE + { FAIL } + { /* [ lambda unit string : map string (lambda unit string) ] */ } ; + UNIT + /* [ unit : lambda unit string : map string (lambda unit string) ] */ ; + EXEC + /* [ string : map string (lambda unit string) ] */ } + { DUP + /* [ pair string (lambda unit string) : pair string (lambda unit string) + : map string (lambda unit string) ] */ ; + CAR + /* [ string : pair string (lambda unit string) + : map string (lambda unit string) ] */ ; + DIP { CDR + /* [ lambda unit string : map string (lambda unit string) ] */ ; + SOME + /* [ option (lambda unit string) : map string (lambda unit string) ] */ } + /* [ string : option (lambda unit string) : map string (lambda unit string) ] */ ; + UPDATE + /* [ map string (lambda unit string) ] */ ; + PUSH string "" + /* [ string : map string (lambda unit string) ] */ } ; + PAIR + /* [ pair string (map string (lambda unit string)) ] */ ; + NIL operation + /* [ list operation : pair string (map string (lambda unit string)) ] */ ; + PAIR + /* [ pair (list operation) string (map string (lambda unit string)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-empty.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-empty.tz.out new file mode 100644 index 000000000000..bc3aa142f535 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-empty.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/empty.tz --details +Well typed +Gas remaining: 1039997.907 units remaining +{ parameter unit ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-fail_amount.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-fail_amount.tz.out new file mode 100644 index 000000000000..f14259bacabf --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-fail_amount.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/fail_amount.tz --details +Well typed +Gas remaining: 1039993.067 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + AMOUNT + /* [ mutez ] */ ; + PUSH mutez 10000000 + /* [ mutez : mutez ] */ ; + CMPGT ; + IF { FAIL } { /* [] */ } ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-faucet.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-faucet.tz.out new file mode 100644 index 000000000000..33435cbf8aa2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-faucet.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/faucet.tz --details +Well typed +Gas remaining: 1039988.070 units remaining +{ parameter key_hash ; + storage timestamp ; + code { UNPAIR + /* [ key_hash : timestamp ] */ ; + SWAP + /* [ timestamp : key_hash ] */ ; + PUSH int 300 + /* [ int : timestamp : key_hash ] */ ; + ADD @FIVE_MINUTES_LATER + /* [ timestamp : key_hash ] */ ; + NOW + /* [ timestamp : timestamp : key_hash ] */ ; + ASSERT_CMPGE ; + IMPLICIT_ACCOUNT + /* [ contract unit ] */ ; + PUSH mutez 1000000 + /* [ mutez : contract unit ] */ ; + UNIT + /* [ unit : mutez : contract unit ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ ; + DIP { NOW /* [ timestamp ] */ } + /* [ list operation : timestamp ] */ ; + PAIR + /* [ pair (list operation) timestamp ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-forward.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-forward.tz.out new file mode 100644 index 000000000000..ea95d97acafd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-forward.tz.out @@ -0,0 +1,1775 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/forward.tz --details +Well typed +Gas remaining: 1039670.292 units remaining +{ parameter (or string nat) ; + storage + (pair (pair nat (pair mutez mutez)) + (pair (pair nat (pair timestamp timestamp)) + (pair (pair mutez mutez) (pair (pair address address) address)))) ; + code { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDADDR ; + PUSH int + 86400 + /* [ int : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ timestamp : int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NOW + /* [ timestamp : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CAR + /* [ or string nat + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF_LEFT + { DUP + /* [ string : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH string + "buyer" + /* [ string : string : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + EQ + /* [ bool : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DROP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADAR ; + DIP { AMOUNT + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADDR } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH nat + 0 + /* [ nat : pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair nat mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CDDR } + /* [ pair nat mutez mutez + : pair (pair nat timestamp timestamp) (pair mutez mutez) (pair address address) address ] */ ; + PAIR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { PUSH string + "seller" + /* [ string : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + EQ + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADDR ; + DIP { AMOUNT + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADAR } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH nat + 0 + /* [ nat : pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair nat mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CDDR } + /* [ pair nat mutez mutez + : pair (pair nat timestamp timestamp) (pair mutez mutez) (pair address address) address ] */ ; + PAIR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { FAIL } } } + { FAIL } } + { BALANCE + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH mutez + 0 + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IFCMPEQ + { FAIL } + { /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } ; + DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDAAR ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDADR } + /* [ nat : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + MUL + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH nat + 2 + /* [ nat : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + MUL + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + BALANCE + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { CDR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CADAR ; + DIP { DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDAAR } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ operation : list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CONS + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + CADDR ; + DIP { DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + CDDDADR } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + SWAP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + CADAR ; + DIP { DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + CADDR } + /* [ mutez : mutez + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + ADD + /* [ mutez + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + BALANCE + /* [ mutez : mutez + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + SUB_MUTEZ + /* [ option mutez + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + ASSERT_SOME ; + DIP { DUP + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + CDDDDR } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address : list operation ] */ ; + DIP { SWAP + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ operation : list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CONS + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDADAR ; + NOW + /* [ timestamp : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { FAIL } + { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDADAR ; + PUSH int + 86400 + /* [ int : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NOW + /* [ timestamp : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CAR + /* [ or string nat + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF_LEFT + { PUSH string + "buyer" + /* [ string : string + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + EQ + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADAR ; + DIP { AMOUNT + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DUP + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDAAR ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDAAR } + /* [ nat : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + MUL + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + GT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { FAIL } + { /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } } + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADDR } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH nat + 0 + /* [ nat : pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair nat mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CDDR } + /* [ pair nat mutez mutez + : pair (pair nat timestamp timestamp) (pair mutez mutez) (pair address address) address ] */ ; + PAIR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { FAIL } } + { FAIL } } + { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDAAR ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDAAR } + /* [ nat : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + MUL + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADAR } + /* [ mutez : mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NEQ + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { BALANCE + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDDADR } + /* [ mutez : address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIIP { CDR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ operation : list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CONS + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDADAR ; + PUSH int + 86400 + /* [ int : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PUSH int + 86400 + /* [ int : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NOW + /* [ timestamp : timestamp + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDDDR ; + SENDER + /* [ address : address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NEQ + /* [ bool + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { FAIL } + { /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } ; + DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CAR + /* [ or string nat + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF_LEFT + { FAIL } + { DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDAAR } + /* [ nat : nat + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ADD + /* [ nat + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDADR } + /* [ nat : pair mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair nat mutez mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CDDR } + /* [ pair nat mutez mutez + : pair (pair nat timestamp timestamp) (pair mutez mutez) (pair address address) address ] */ ; + PAIR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + UNIT + /* [ unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DUP + /* [ pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDAAR ; + DIP { DUP + /* [ pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDAAR } + /* [ nat : nat + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + COMPARE + /* [ int + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + LT + /* [ bool + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + IF { CDR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { BALANCE + /* [ mutez + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDDADR } + /* [ mutez : address + : pair unit + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIIP { CDR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ operation : list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CONS + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } } ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + { BALANCE + /* [ mutez + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { DUP + /* [ pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CDDDDAAR } + /* [ mutez : address + : pair (or string nat) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIIP { CDR + /* [ pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } + /* [ mutez : address + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + SWAP + /* [ operation : list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + CONS + /* [ list operation + : pair (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ ; + PAIR + /* [ pair (list operation) + (pair nat mutez mutez) + (pair nat timestamp timestamp) + (pair mutez mutez) + (pair address address) + address ] */ } } } } } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-id.tz.out new file mode 100644 index 000000000000..02245fb589b1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-id.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/id.tz --details +Well typed +Gas remaining: 1039997.907 units remaining +{ parameter string ; + storage string ; + code { CAR + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-infinite_loop.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-infinite_loop.tz.out new file mode 100644 index 000000000000..acd505f0a9d1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-infinite_loop.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/infinite_loop.tz --details +Well typed +Gas remaining: 1039995.465 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bool True + /* [ bool ] */ ; + LOOP { PUSH bool True /* [ bool ] */ } + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-insertion_sort.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-insertion_sort.tz.out new file mode 100644 index 000000000000..e486d2358a17 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-insertion_sort.tz.out @@ -0,0 +1,63 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/insertion_sort.tz --details +Well typed +Gas remaining: 1039976.745 units remaining +{ parameter (list int) ; + storage (list int) ; + code { CAR + /* [ list int ] */ ; + NIL int + /* [ list int : list int ] */ ; + SWAP + /* [ list int : list int ] */ ; + ITER { SWAP + /* [ list int : int ] */ ; + DIIP { NIL int /* [ list int ] */ } + /* [ list int : int : list int ] */ ; + PUSH bool True + /* [ bool : list int : int : list int ] */ ; + LOOP { IF_CONS + { SWAP + /* [ list int : int : int : list int ] */ ; + DIP { DUP + /* [ int : int : int : list int ] */ ; + DIIP { DUP /* [ int : int : list int ] */ } + /* [ int : int : int : int : list int ] */ ; + DIP { CMPLT } + /* [ int : bool : int : list int ] */ ; + SWAP + /* [ bool : int : int : list int ] */ } + /* [ list int : bool : int : int : list int ] */ ; + SWAP + /* [ bool : list int : int : int : list int ] */ ; + IF { DIP { SWAP + /* [ int : int : list int ] */ ; + DIP { CONS /* [ list int ] */ } + /* [ int : list int ] */ } + /* [ list int : int : list int ] */ ; + PUSH bool True + /* [ bool : list int : int : list int ] */ } + { SWAP + /* [ int : list int : int : list int ] */ ; + CONS + /* [ list int : int : list int ] */ ; + PUSH bool False + /* [ bool : list int : int : list int ] */ } } + { NIL int + /* [ list int : int : list int ] */ ; + PUSH bool False + /* [ bool : list int : int : list int ] */ } } + /* [ list int : int : list int ] */ ; + SWAP + /* [ int : list int : list int ] */ ; + CONS + /* [ list int : list int ] */ ; + SWAP + /* [ list int : list int ] */ ; + ITER { CONS /* [ list int ] */ } + /* [ list int ] */ } + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-int_publisher.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-int_publisher.tz.out new file mode 100644 index 000000000000..a37ebb8a8ef1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-int_publisher.tz.out @@ -0,0 +1,87 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/int_publisher.tz --details +Well typed +Gas remaining: 1039970.043 units remaining +{ parameter (option (pair signature int)) ; + storage (pair key int) ; + code { DUP + /* [ pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + DUP + /* [ pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + CAR + /* [ option (pair signature int) : pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + IF_NONE + { PUSH mutez + 1000000 + /* [ mutez : pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + AMOUNT + /* [ mutez : mutez : pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + CMPLE ; + IF { FAIL } + { /* [ pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ } ; + CDR + /* [ pair key int : pair (option (pair signature int)) key int ] */ ; + DIP { CDDR } + /* [ pair key int : int ] */ } + { DUP + /* [ pair signature int : pair signature int + : pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + DIP { SWAP + /* [ pair (option (pair signature int)) key int : pair signature int + : pair (option (pair signature int)) key int ] */ } + /* [ pair signature int : pair (option (pair signature int)) key int + : pair signature int : pair (option (pair signature int)) key int ] */ ; + SWAP + /* [ pair (option (pair signature int)) key int : pair signature int + : pair signature int : pair (option (pair signature int)) key int ] */ ; + CDAR ; + DIP { DUP + /* [ pair signature int : pair signature int : pair signature int + : pair (option (pair signature int)) key int ] */ ; + CAR + /* [ signature : pair signature int : pair signature int + : pair (option (pair signature int)) key int ] */ ; + DIP { CDR + /* [ int : pair signature int : pair (option (pair signature int)) key int ] */ ; + PACK + /* [ bytes : pair signature int : pair (option (pair signature int)) key int ] */ ; + BLAKE2B + /* [ bytes : pair signature int : pair (option (pair signature int)) key int ] */ } + /* [ signature : bytes : pair signature int + : pair (option (pair signature int)) key int ] */ } + /* [ key : signature : bytes : pair signature int + : pair (option (pair signature int)) key int ] */ ; + CHECK_SIGNATURE + /* [ bool : pair signature int : pair (option (pair signature int)) key int ] */ ; + IF { CDR + /* [ int : pair (option (pair signature int)) key int ] */ ; + SWAP + /* [ pair (option (pair signature int)) key int : int ] */ ; + DIP { DUP /* [ int : int ] */ } + /* [ pair (option (pair signature int)) key int : int : int ] */ ; + CDAR ; + PAIR + /* [ pair key int : int ] */ } + { DROP + /* [ pair (option (pair signature int)) key int ] */ ; + DUP + /* [ pair (option (pair signature int)) key int + : pair (option (pair signature int)) key int ] */ ; + CDR + /* [ pair key int : pair (option (pair signature int)) key int ] */ ; + DIP { CDDR } + /* [ pair key int : int ] */ } } ; + DIP { DROP /* [] */ } + /* [ pair key int ] */ ; + NIL operation + /* [ list operation : pair key int ] */ ; + PAIR + /* [ pair (list operation) key int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-king_of_tez.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-king_of_tez.tz.out new file mode 100644 index 000000000000..b888f01e0bd0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-king_of_tez.tz.out @@ -0,0 +1,70 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/king_of_tez.tz --details +Well typed +Gas remaining: 1039974.327 units remaining +{ parameter key_hash ; + storage (pair timestamp (pair mutez key_hash)) ; + code { DUP + /* [ pair key_hash timestamp mutez key_hash + : pair key_hash timestamp mutez key_hash ] */ ; + CDAR ; + NOW + /* [ timestamp : timestamp : pair key_hash timestamp mutez key_hash ] */ ; + CMPGT ; + IF { CAR + /* [ key_hash ] */ ; + AMOUNT + /* [ mutez : key_hash ] */ ; + PAIR + /* [ pair mutez key_hash ] */ ; + NOW + /* [ timestamp : pair mutez key_hash ] */ ; + PUSH int 604800 + /* [ int : timestamp : pair mutez key_hash ] */ ; + ADD + /* [ timestamp : pair mutez key_hash ] */ ; + PAIR + /* [ pair timestamp mutez key_hash ] */ ; + NIL operation + /* [ list operation : pair timestamp mutez key_hash ] */ } + { DUP + /* [ pair key_hash timestamp mutez key_hash + : pair key_hash timestamp mutez key_hash ] */ ; + CDDAR ; + AMOUNT + /* [ mutez : mutez : pair key_hash timestamp mutez key_hash ] */ ; + CMPLT ; + IF { FAIL } + { CAR + /* [ key_hash ] */ ; + DUP + /* [ key_hash : key_hash ] */ ; + DIP { AMOUNT + /* [ mutez : key_hash ] */ ; + PAIR + /* [ pair mutez key_hash ] */ ; + NOW + /* [ timestamp : pair mutez key_hash ] */ ; + PUSH int 604800 + /* [ int : timestamp : pair mutez key_hash ] */ ; + ADD + /* [ timestamp : pair mutez key_hash ] */ ; + PAIR + /* [ pair timestamp mutez key_hash ] */ } + /* [ key_hash : pair timestamp mutez key_hash ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : pair timestamp mutez key_hash ] */ ; + AMOUNT + /* [ mutez : contract unit : pair timestamp mutez key_hash ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair timestamp mutez key_hash ] */ ; + TRANSFER_TOKENS + /* [ operation : pair timestamp mutez key_hash ] */ ; + NIL operation + /* [ list operation : operation : pair timestamp mutez key_hash ] */ ; + SWAP + /* [ operation : list operation : pair timestamp mutez key_hash ] */ ; + CONS + /* [ list operation : pair timestamp mutez key_hash ] */ } } ; + PAIR + /* [ pair (list operation) timestamp mutez key_hash ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-list_of_transactions.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-list_of_transactions.tz.out new file mode 100644 index 000000000000..a5f600017868 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-list_of_transactions.tz.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/list_of_transactions.tz --details +Well typed +Gas remaining: 1039985.482 units remaining +{ parameter unit ; + storage (list address) ; + code { CDR + /* [ list address ] */ ; + DUP + /* [ list address : list address ] */ ; + DIP { NIL operation /* [ list operation : list address ] */ } + /* [ list address : list operation : list address ] */ ; + PUSH bool True + /* [ bool : list address : list operation : list address ] */ ; + LOOP { IF_CONS + { CONTRACT + unit + /* [ option (contract unit) : list address : list operation : list address ] */ ; + ASSERT_SOME ; + PUSH mutez + 1000000 + /* [ mutez : contract unit : list address : list operation : list address ] */ ; + UNIT + /* [ unit : mutez : contract unit : list address : list operation + : list address ] */ ; + TRANSFER_TOKENS + /* [ operation : list address : list operation : list address ] */ ; + SWAP + /* [ list address : operation : list operation : list address ] */ ; + DIP { CONS /* [ list operation : list address ] */ } + /* [ list address : list operation : list address ] */ ; + PUSH bool True + /* [ bool : list address : list operation : list address ] */ } + { NIL address + /* [ list address : list operation : list address ] */ ; + PUSH bool False + /* [ bool : list address : list operation : list address ] */ } } + /* [ list address : list operation : list address ] */ ; + DROP + /* [ list operation : list address ] */ ; + PAIR + /* [ pair (list operation) (list address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-queue.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-queue.tz.out new file mode 100644 index 000000000000..ad343feac5a3 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-queue.tz.out @@ -0,0 +1,106 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/queue.tz --details +Well typed +Gas remaining: 1039958.584 units remaining +{ parameter (option string) ; + storage (pair (option string) (pair (pair nat nat) (map nat string))) ; + code { DUP + /* [ pair (option string) (option string) (pair nat nat) (map nat string) + : pair (option string) (option string) (pair nat nat) (map nat string) ] */ ; + CAR + /* [ option string + : pair (option string) (option string) (pair nat nat) (map nat string) ] */ ; + IF_NONE + { CDDR ; + DUP + /* [ pair (pair nat nat) (map nat string) + : pair (pair nat nat) (map nat string) ] */ ; + CAR + /* [ pair nat nat : pair (pair nat nat) (map nat string) ] */ ; + DIP { CDR /* [ map nat string ] */ ; DUP /* [ map nat string : map nat string ] */ } + /* [ pair nat nat : map nat string : map nat string ] */ ; + DUP + /* [ pair nat nat : pair nat nat : map nat string : map nat string ] */ ; + CAR + /* [ nat : pair nat nat : map nat string : map nat string ] */ ; + SWAP + /* [ pair nat nat : nat : map nat string : map nat string ] */ ; + DIP { GET /* [ option string : map nat string ] */ } + /* [ pair nat nat : option string : map nat string ] */ ; + SWAP + /* [ option string : pair nat nat : map nat string ] */ ; + IF_NONE + { NONE string + /* [ option string : pair nat nat : map nat string ] */ ; + DIP { PAIR /* [ pair (pair nat nat) (map nat string) ] */ } + /* [ option string : pair (pair nat nat) (map nat string) ] */ ; + PAIR + /* [ pair (option string) (pair nat nat) (map nat string) ] */ } + { SOME + /* [ option string : pair nat nat : map nat string ] */ ; + DIP { DUP + /* [ pair nat nat : pair nat nat : map nat string ] */ ; + DIP { CAR + /* [ nat : map nat string ] */ ; + DIP { NONE string /* [ option string : map nat string ] */ } + /* [ nat : option string : map nat string ] */ ; + UPDATE + /* [ map nat string ] */ } + /* [ pair nat nat : map nat string ] */ ; + DUP + /* [ pair nat nat : pair nat nat : map nat string ] */ ; + CAR + /* [ nat : pair nat nat : map nat string ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat nat : map nat string ] */ ; + ADD + /* [ nat : pair nat nat : map nat string ] */ ; + DIP { CDR /* [ nat : map nat string ] */ } + /* [ nat : nat : map nat string ] */ ; + PAIR + /* [ pair nat nat : map nat string ] */ ; + PAIR + /* [ pair (pair nat nat) (map nat string) ] */ } + /* [ option string : pair (pair nat nat) (map nat string) ] */ ; + PAIR + /* [ pair (option string) (pair nat nat) (map nat string) ] */ } } + { DIP { DUP + /* [ pair (option string) (option string) (pair nat nat) (map nat string) + : pair (option string) (option string) (pair nat nat) (map nat string) ] */ ; + CDDAR ; + DIP { CDDDR } + /* [ pair nat nat : map nat string ] */ ; + DUP + /* [ pair nat nat : pair nat nat : map nat string ] */ } + /* [ string : pair nat nat : pair nat nat : map nat string ] */ ; + SWAP + /* [ pair nat nat : string : pair nat nat : map nat string ] */ ; + CAR + /* [ nat : string : pair nat nat : map nat string ] */ ; + DIP { SOME + /* [ option string : pair nat nat : map nat string ] */ ; + SWAP + /* [ pair nat nat : option string : map nat string ] */ ; + CDR + /* [ nat : option string : map nat string ] */ ; + DUP + /* [ nat : nat : option string : map nat string ] */ ; + DIP { UPDATE /* [ map nat string ] */ } + /* [ nat : map nat string ] */ ; + PUSH nat 1 + /* [ nat : nat : map nat string ] */ ; + ADD + /* [ nat : map nat string ] */ } + /* [ nat : nat : map nat string ] */ ; + PAIR + /* [ pair nat nat : map nat string ] */ ; + PAIR + /* [ pair (pair nat nat) (map nat string) ] */ ; + NONE string + /* [ option string : pair (pair nat nat) (map nat string) ] */ ; + PAIR + /* [ pair (option string) (pair nat nat) (map nat string) ] */ } ; + NIL operation + /* [ list operation : pair (option string) (pair nat nat) (map nat string) ] */ ; + PAIR + /* [ pair (list operation) (option string) (pair nat nat) (map nat string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reduce_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reduce_map.tz.out new file mode 100644 index 000000000000..22392f3f9219 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reduce_map.tz.out @@ -0,0 +1,56 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/reduce_map.tz --details +Well typed +Gas remaining: 1039978.486 units remaining +{ parameter (pair (lambda int int) (list int)) ; + storage (list int) ; + code { DIP { NIL int /* [ list int ] */ } + /* [ pair (pair (lambda int int) (list int)) (list int) : list int ] */ ; + CAR + /* [ pair (lambda int int) (list int) : list int ] */ ; + DUP + /* [ pair (lambda int int) (list int) : pair (lambda int int) (list int) + : list int ] */ ; + DIP { CAR + /* [ lambda int int : list int ] */ ; + PAIR + /* [ pair (lambda int int) (list int) ] */ } + /* [ pair (lambda int int) (list int) : pair (lambda int int) (list int) ] */ ; + CDR + /* [ list int : pair (lambda int int) (list int) ] */ ; + ITER { PAIR + /* [ pair int (lambda int int) (list int) ] */ ; + DUP + /* [ pair int (lambda int int) (list int) + : pair int (lambda int int) (list int) ] */ ; + CDAR ; + DIP { DUP + /* [ pair int (lambda int int) (list int) + : pair int (lambda int int) (list int) ] */ ; + DIP { CDAR } + /* [ pair int (lambda int int) (list int) : lambda int int ] */ ; + DUP + /* [ pair int (lambda int int) (list int) : pair int (lambda int int) (list int) + : lambda int int ] */ ; + CAR + /* [ int : pair int (lambda int int) (list int) : lambda int int ] */ ; + DIP { CDDR ; SWAP /* [ lambda int int : list int ] */ } + /* [ int : lambda int int : list int ] */ ; + EXEC + /* [ int : list int ] */ ; + CONS + /* [ list int ] */ } + /* [ lambda int int : list int ] */ ; + PAIR + /* [ pair (lambda int int) (list int) ] */ } + /* [ pair (lambda int int) (list int) ] */ ; + CDR + /* [ list int ] */ ; + DIP { NIL int /* [ list int ] */ } + /* [ list int : list int ] */ ; + ITER { CONS /* [ list int ] */ } + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reentrancy.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reentrancy.tz.out new file mode 100644 index 000000000000..2949c5478543 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reentrancy.tz.out @@ -0,0 +1,43 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/reentrancy.tz --details +Well typed +Gas remaining: 1039983.352 units remaining +{ parameter unit ; + storage (pair address address) ; + code { CDR + /* [ pair address address ] */ ; + DUP + /* [ pair address address : pair address address ] */ ; + CAR + /* [ address : pair address address ] */ ; + CONTRACT unit + /* [ option (contract unit) : pair address address ] */ ; + ASSERT_SOME ; + PUSH mutez 5000000 + /* [ mutez : contract unit : pair address address ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair address address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair address address ] */ ; + DIP { DUP + /* [ pair address address : pair address address ] */ ; + CDR + /* [ address : pair address address ] */ ; + CONTRACT unit + /* [ option (contract unit) : pair address address ] */ ; + ASSERT_SOME ; + PUSH mutez 5000000 + /* [ mutez : contract unit : pair address address ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair address address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair address address ] */ } + /* [ operation : operation : pair address address ] */ ; + DIIP { NIL operation /* [ list operation : pair address address ] */ } + /* [ operation : operation : list operation : pair address address ] */ ; + DIP { CONS /* [ list operation : pair address address ] */ } + /* [ operation : list operation : pair address address ] */ ; + CONS + /* [ list operation : pair address address ] */ ; + PAIR + /* [ pair (list operation) address address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reservoir.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reservoir.tz.out new file mode 100644 index 000000000000..9c7d1495eb8a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-reservoir.tz.out @@ -0,0 +1,78 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/reservoir.tz --details +Well typed +Gas remaining: 1039969.237 units remaining +{ parameter unit ; + storage (pair (pair (timestamp %T) (mutez %N)) (pair (address %A) (address %B))) ; + code { CDR + /* [ pair (pair timestamp mutez) address address ] */ ; + DUP + /* [ pair (pair timestamp mutez) address address + : pair (pair timestamp mutez) address address ] */ ; + CAAR %T ; + NOW + /* [ timestamp : timestamp : pair (pair timestamp mutez) address address ] */ ; + COMPARE + /* [ int : pair (pair timestamp mutez) address address ] */ ; + LE + /* [ bool : pair (pair timestamp mutez) address address ] */ ; + IF { DUP + /* [ pair (pair timestamp mutez) address address + : pair (pair timestamp mutez) address address ] */ ; + CADR %N ; + BALANCE + /* [ mutez : mutez : pair (pair timestamp mutez) address address ] */ ; + COMPARE + /* [ int : pair (pair timestamp mutez) address address ] */ ; + LE + /* [ bool : pair (pair timestamp mutez) address address ] */ ; + IF { NIL operation + /* [ list operation : pair (pair timestamp mutez) address address ] */ ; + PAIR + /* [ pair (list operation) (pair timestamp mutez) address address ] */ } + { DUP + /* [ pair (pair timestamp mutez) address address + : pair (pair timestamp mutez) address address ] */ ; + CDDR %B ; + CONTRACT + unit + /* [ option (contract unit) : pair (pair timestamp mutez) address address ] */ ; + ASSERT_SOME ; + BALANCE + /* [ mutez : contract unit : pair (pair timestamp mutez) address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair timestamp mutez) address address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair (pair timestamp mutez) address address ] */ ; + NIL operation + /* [ list operation : operation : pair (pair timestamp mutez) address address ] */ ; + SWAP + /* [ operation : list operation : pair (pair timestamp mutez) address address ] */ ; + CONS + /* [ list operation : pair (pair timestamp mutez) address address ] */ ; + PAIR + /* [ pair (list operation) (pair timestamp mutez) address address ] */ } } + { DUP + /* [ pair (pair timestamp mutez) address address + : pair (pair timestamp mutez) address address ] */ ; + CDAR %A ; + CONTRACT + unit + /* [ option (contract unit) : pair (pair timestamp mutez) address address ] */ ; + ASSERT_SOME ; + BALANCE + /* [ mutez : contract unit : pair (pair timestamp mutez) address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair (pair timestamp mutez) address address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair (pair timestamp mutez) address address ] */ ; + NIL operation + /* [ list operation : operation : pair (pair timestamp mutez) address address ] */ ; + SWAP + /* [ operation : list operation : pair (pair timestamp mutez) address address ] */ ; + CONS + /* [ list operation : pair (pair timestamp mutez) address address ] */ ; + PAIR + /* [ pair (list operation) (pair timestamp mutez) address address ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-scrutable_reservoir.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-scrutable_reservoir.tz.out new file mode 100644 index 000000000000..324d385f8a4c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-scrutable_reservoir.tz.out @@ -0,0 +1,247 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/scrutable_reservoir.tz --details +Well typed +Gas remaining: 1039889.171 units remaining +{ parameter unit ; + storage + (pair string + (pair timestamp (pair (pair mutez mutez) (pair address (pair address address))))) ; + code { DUP + /* [ pair unit string timestamp (pair mutez mutez) address address address + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + CDAR ; + PUSH string + "open" + /* [ string : string + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + COMPARE + /* [ int + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + NEQ + /* [ bool + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + IF { FAIL } + { DUP + /* [ pair unit string timestamp (pair mutez mutez) address address address + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + CDDAR ; + NOW + /* [ timestamp : timestamp + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + COMPARE + /* [ int + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + LT + /* [ bool + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + IF { PUSH mutez + 0 + /* [ mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair unit string timestamp (pair mutez mutez) address address address + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + CDDDAAR } + /* [ mutez : mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + ADD + /* [ mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair unit string timestamp (pair mutez mutez) address address address + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + CDDDADR } + /* [ mutez : mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + ADD + /* [ mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + BALANCE + /* [ mutez : mutez + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + COMPARE + /* [ int + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + LT + /* [ bool + : pair unit string timestamp (pair mutez mutez) address address address ] */ ; + IF { CDR + /* [ pair string timestamp (pair mutez mutez) address address address ] */ ; + NIL operation + /* [ list operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + PAIR + /* [ pair (list operation) string timestamp (pair mutez mutez) address address address ] */ } + { CDDR ; + PUSH string + "success" + /* [ string : pair timestamp (pair mutez mutez) address address address ] */ ; + PAIR + /* [ pair string timestamp (pair mutez mutez) address address address ] */ ; + DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDAAR ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDDAR } + /* [ mutez : address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair string timestamp (pair mutez mutez) address address address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDADR ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDDDAR } + /* [ mutez : address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair string timestamp (pair mutez mutez) address address address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair string timestamp (pair mutez mutez) address address address ] */ } + /* [ operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + NIL operation + /* [ list operation : operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + SWAP + /* [ operation : list operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CONS + /* [ list operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + SWAP + /* [ operation : list operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CONS + /* [ list operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + PAIR + /* [ pair (list operation) string timestamp (pair mutez mutez) address address address ] */ } } + { CDDR ; + PUSH string + "timeout" + /* [ string : pair timestamp (pair mutez mutez) address address address ] */ ; + PAIR + /* [ pair string timestamp (pair mutez mutez) address address address ] */ ; + BALANCE + /* [ mutez : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDAAR } + /* [ mutez : mutez + : pair string timestamp (pair mutez mutez) address address address ] */ ; + COMPARE + /* [ int : pair string timestamp (pair mutez mutez) address address address ] */ ; + LT + /* [ bool : pair string timestamp (pair mutez mutez) address address address ] */ ; + IF { BALANCE + /* [ mutez : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDDAR } + /* [ mutez : address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair string timestamp (pair mutez mutez) address address address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair string timestamp (pair mutez mutez) address address address ] */ } + { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDAAR ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDDAR } + /* [ mutez : address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair string timestamp (pair mutez mutez) address address address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair string timestamp (pair mutez mutez) address address address ] */ } ; + DIP { BALANCE + /* [ mutez : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { DUP + /* [ pair string timestamp (pair mutez mutez) address address address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CDDDDDR } + /* [ mutez : address + : pair string timestamp (pair mutez mutez) address address address ] */ ; + DIP { CONTRACT + unit + /* [ option (contract unit) + : pair string timestamp (pair mutez mutez) address address address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + UNIT + /* [ unit : mutez : contract unit + : pair string timestamp (pair mutez mutez) address address address ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair string timestamp (pair mutez mutez) address address address ] */ } + /* [ operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + NIL operation + /* [ list operation : operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + SWAP + /* [ operation : list operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CONS + /* [ list operation : operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + SWAP + /* [ operation : list operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + CONS + /* [ list operation + : pair string timestamp (pair mutez mutez) address address address ] */ ; + PAIR + /* [ pair (list operation) string timestamp (pair mutez mutez) address address address ] */ } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-spawn_identities.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-spawn_identities.tz.out new file mode 100644 index 000000000000..745ab0dc088c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-attic-spawn_identities.tz.out @@ -0,0 +1,61 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/attic/spawn_identities.tz --details +Well typed +Gas remaining: 1039976.440 units remaining +{ parameter nat ; + storage (list address) ; + code { /* [ pair string string ] */ + DUP + /* [ list operation : string ] */ ; + CAR + /* [ nat : pair nat (list address) ] */ ; + DIP { CDR /* [ list address ] */ ; NIL operation /* [ list operation : list address ] */ } + /* [ pair (list operation) string ] */ ; + PUSH bool True + /* [ bool : nat : list operation : list address ] */ ; + LOOP { DUP + /* [ nat : nat : list operation : list address ] */ ; + PUSH nat 0 + /* [ nat : nat : nat : list operation : list address ] */ ; + CMPEQ ; + IF { PUSH bool False /* [ bool : nat : list operation : list address ] */ } + { PUSH nat 1 + /* [ nat : nat : list operation : list address ] */ ; + SWAP + /* [ nat : nat : list operation : list address ] */ ; + SUB + /* [ int : list operation : list address ] */ ; + ABS + /* [ nat : list operation : list address ] */ ; + PUSH string "init" + /* [ string : nat : list operation : list address ] */ ; + PUSH mutez 5000000 + /* [ mutez : string : nat : list operation : list address ] */ ; + NONE key_hash + /* [ option key_hash : mutez : string : nat : list operation : list address ] */ ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } + /* [ operation : address : nat : list operation : list address ] */ ; + SWAP + /* [ address : operation : nat : list operation : list address ] */ ; + DIP { SWAP + /* [ nat : operation : list operation : list address ] */ ; + DIP { CONS /* [ list operation : list address ] */ } + /* [ nat : list operation : list address ] */ } + /* [ address : nat : list operation : list address ] */ ; + SWAP + /* [ nat : address : list operation : list address ] */ ; + DIP { SWAP + /* [ list operation : address : list address ] */ ; + DIP { CONS /* [ list address ] */ } + /* [ list operation : list address ] */ } + /* [ nat : list operation : list address ] */ ; + PUSH bool True + /* [ bool : nat : list operation : list address ] */ } } + /* [ nat : list operation : list address ] */ ; + DROP + /* [ list operation : list address ] */ ; + PAIR + /* [ pair (list operation) (list address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-big_map_entrypoints.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-big_map_entrypoints.tz.out new file mode 100644 index 000000000000..e6310ce46a52 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-big_map_entrypoints.tz.out @@ -0,0 +1,120 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/big_map_entrypoints.tz --details +Well typed +Gas remaining: 1039953.156 units remaining +{ storage (pair (big_map string nat) (big_map string nat)) ; + parameter + (or (unit %default + /* [ list operation : big_map string nat ] */) + (or (or %mem + (string %mem_left) + (string %mem_right) + /* [ pair (list operation) (big_map string nat) ] */) + (or (or %add (pair %add_left string nat) (pair %add_right string nat)) + (or %rem (string %rem_left) (string %rem_right)))) + /* [ big_map string nat ] */) + /* [ string : big_map string nat ] */ ; + code { UNPAIR + /* [ or unit + (or (or string string) (or (or (pair string nat) (pair string nat)) (or string string))) + : pair (big_map string nat) (big_map string nat) ] */ ; + IF_LEFT + { DROP + /* [ pair (big_map string nat) (big_map string nat) ] */ ; + DUP + /* [ pair (big_map string nat) (big_map string nat) + : pair (big_map string nat) (big_map string nat) ] */ ; + CAR + /* [ big_map string nat : pair (big_map string nat) (big_map string nat) ] */ ; + PUSH mutez + 0 + /* [ mutez : big_map string nat + : pair (big_map string nat) (big_map string nat) ] */ ; + NONE key_hash + /* [ option key_hash : mutez : big_map string nat + : pair (big_map string nat) (big_map string nat) ] */ ; + CREATE_CONTRACT + { parameter string ; + storage (big_map string nat) ; + code { UNPAIR ; DROP ; NIL operation ; PAIR } } + /* [ operation : address : pair (big_map string nat) (big_map string nat) ] */ ; + DIP { DROP /* [ pair (big_map string nat) (big_map string nat) ] */ } + /* [ operation : pair (big_map string nat) (big_map string nat) ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map string nat) (big_map string nat) ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map string nat) (big_map string nat) ] */ ; + CONS + /* [ list operation : pair (big_map string nat) (big_map string nat) ] */ ; + PAIR + /* [ pair (list operation) (big_map string nat) (big_map string nat) ] */ } + { IF_LEFT + { IF_LEFT + { DIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { DUP /* [ big_map string nat : big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat : big_map string nat ] */ ; + MEM + /* [ bool : big_map string nat : big_map string nat ] */ ; + ASSERT } + { DIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { DUP /* [ big_map string nat : big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat : big_map string nat ] */ ; + MEM + /* [ bool : big_map string nat : big_map string nat ] */ ; + ASSERT ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } + { IF_LEFT + { IF_LEFT + { UNPAIR + /* [ string : nat : pair (big_map string nat) (big_map string nat) ] */ ; + DIIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : nat : big_map string nat : big_map string nat ] */ ; + DIP { SOME /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ } + { UNPAIR + /* [ string : nat : pair (big_map string nat) (big_map string nat) ] */ ; + DIIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : nat : big_map string nat : big_map string nat ] */ ; + DIP { SOME /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } + { IF_LEFT + { DIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { NONE nat /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ } + { DIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { NONE nat /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } } ; + PAIR + /* [ pair (big_map string nat) (big_map string nat) ] */ ; + NIL operation + /* [ list operation : pair (big_map string nat) (big_map string nat) ] */ ; + PAIR + /* [ pair (list operation) (big_map string nat) (big_map string nat) ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-delegatable_target.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-delegatable_target.tz.out new file mode 100644 index 000000000000..33e29fd2d21c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-delegatable_target.tz.out @@ -0,0 +1,119 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/delegatable_target.tz --details +Well typed +Gas remaining: 1039960.927 units remaining +{ parameter + (or (or (key_hash %set_delegate) (unit %remove_delegate)) (or %default string nat)) ; + storage (pair key_hash (pair string nat)) ; + code { DUP + /* [ pair (or (or key_hash unit) (or string nat)) key_hash string nat + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + CAR + /* [ or (or key_hash unit) (or string nat) + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + IF_LEFT + { PUSH mutez + 0 + /* [ mutez : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + AMOUNT + /* [ mutez : mutez : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + ASSERT_CMPEQ ; + DUUP + /* [ pair (or (or key_hash unit) (or string nat)) key_hash string nat + : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + CDR + /* [ pair key_hash string nat : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + CAR + /* [ key_hash : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + ADDRESS + /* [ address : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + SENDER + /* [ address : address : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + IFCMPNEQ + { SENDER + /* [ address : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + PUSH string + "Only the owner can operate." + /* [ string : address : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + PAIR + /* [ pair string address : or key_hash unit + : pair (or (or key_hash unit) (or string nat)) key_hash string nat ] */ ; + FAILWITH + /* [] */ } + { DIP { CDR + /* [ pair key_hash string nat ] */ ; + NIL operation + /* [ list operation : pair key_hash string nat ] */ } + /* [ or key_hash unit : list operation : pair key_hash string nat ] */ ; + IF_LEFT + { SOME + /* [ option key_hash : list operation : pair key_hash string nat ] */ ; + SET_DELEGATE + /* [ operation : list operation : pair key_hash string nat ] */ ; + CONS + /* [ list operation : pair key_hash string nat ] */ ; + PAIR + /* [ pair (list operation) key_hash string nat ] */ } + { DROP + /* [ list operation : pair key_hash string nat ] */ ; + NONE key_hash + /* [ option key_hash : list operation : pair key_hash string nat ] */ ; + SET_DELEGATE + /* [ operation : list operation : pair key_hash string nat ] */ ; + CONS + /* [ list operation : pair key_hash string nat ] */ ; + PAIR + /* [ pair (list operation) key_hash string nat ] */ } } } + { DIP { CDR + /* [ pair key_hash string nat ] */ ; + DUP + /* [ pair key_hash string nat : pair key_hash string nat ] */ ; + CDR + /* [ pair string nat : pair key_hash string nat ] */ } + /* [ or string nat : pair string nat : pair key_hash string nat ] */ ; + PAIR + /* [ pair (or string nat) string nat : pair key_hash string nat ] */ ; + { UNPAIR + /* [ or string nat : pair string nat : pair key_hash string nat ] */ ; + IF_LEFT + { DIP { UNPAIR + /* [ string : nat : pair key_hash string nat ] */ ; + DROP + /* [ nat : pair key_hash string nat ] */ } + /* [ string : nat : pair key_hash string nat ] */ } + { DUG 1 + /* [ pair string nat : nat : pair key_hash string nat ] */ ; + UNPAIR + /* [ string : nat : nat : pair key_hash string nat ] */ ; + DIP { DROP /* [ nat : pair key_hash string nat ] */ } + /* [ string : nat : pair key_hash string nat ] */ } ; + PAIR + /* [ pair string nat : pair key_hash string nat ] */ ; + NIL operation + /* [ list operation : pair string nat : pair key_hash string nat ] */ ; + PAIR + /* [ pair (list operation) string nat : pair key_hash string nat ] */ } ; + SWAP + /* [ pair key_hash string nat : pair (list operation) string nat ] */ ; + CAR + /* [ key_hash : pair (list operation) string nat ] */ ; + SWAP + /* [ pair (list operation) string nat : key_hash ] */ ; + UNPAIR + /* [ list operation : pair string nat : key_hash ] */ ; + DIP { SWAP /* [ key_hash : pair string nat ] */ ; PAIR /* [ pair key_hash string nat ] */ } + /* [ list operation : pair key_hash string nat ] */ ; + PAIR + /* [ pair (list operation) key_hash string nat ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-manager.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-manager.tz.out new file mode 100644 index 000000000000..6919d84420f8 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-manager.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/manager.tz --details +Well typed +Gas remaining: 1039984.397 units remaining +{ parameter (or (lambda %do unit (list operation)) (unit %default)) ; + storage key_hash ; + code { UNPAIR + /* [ or (lambda unit (list operation)) unit : key_hash ] */ ; + IF_LEFT + { PUSH mutez 0 + /* [ mutez : lambda unit (list operation) : key_hash ] */ ; + AMOUNT + /* [ mutez : mutez : lambda unit (list operation) : key_hash ] */ ; + ASSERT_CMPEQ ; + DUUP + /* [ key_hash : lambda unit (list operation) : key_hash ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : lambda unit (list operation) : key_hash ] */ ; + ADDRESS + /* [ address : lambda unit (list operation) : key_hash ] */ ; + SENDER + /* [ address : address : lambda unit (list operation) : key_hash ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit : lambda unit (list operation) : key_hash ] */ ; + EXEC + /* [ list operation : key_hash ] */ ; + PAIR + /* [ pair (list operation) key_hash ] */ } + { DROP + /* [ key_hash ] */ ; + NIL operation + /* [ list operation : key_hash ] */ ; + PAIR + /* [ pair (list operation) key_hash ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_default_target.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_default_target.tz.out new file mode 100644 index 000000000000..69f4fcffcc56 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_default_target.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/no_default_target.tz --details +Well typed +Gas remaining: 1039990.140 units remaining +{ storage (pair string nat) ; + parameter (or unit (or %data string nat)) ; + code { UNPAIR + /* [ or unit (or string nat) : pair string nat ] */ ; + IF_LEFT + { DROP + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } + { IF_LEFT + { DIP { UNPAIR /* [ string : nat ] */ ; DROP /* [ nat ] */ } /* [ string : nat ] */ } + { DUG 1 + /* [ pair string nat : nat ] */ ; + UNPAIR + /* [ string : nat : nat ] */ ; + DIP { DROP /* [ nat ] */ } + /* [ string : nat ] */ } ; + PAIR + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_entrypoint_target.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_entrypoint_target.tz.out new file mode 100644 index 000000000000..7a4d0d6b3cc1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-no_entrypoint_target.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/no_entrypoint_target.tz --details +Well typed +Gas remaining: 1039990.140 units remaining +{ storage (pair string nat) ; + parameter (or unit (or string nat)) ; + code { UNPAIR + /* [ or unit (or string nat) : pair string nat ] */ ; + IF_LEFT + { DROP + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } + { IF_LEFT + { DIP { UNPAIR /* [ string : nat ] */ ; DROP /* [ nat ] */ } /* [ string : nat ] */ } + { DUG 1 + /* [ pair string nat : nat ] */ ; + UNPAIR + /* [ string : nat : nat ] */ ; + DIP { DROP /* [ nat ] */ } + /* [ string : nat ] */ } ; + PAIR + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-rooted_target.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-rooted_target.tz.out new file mode 100644 index 000000000000..ceb9b55d5517 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-rooted_target.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/rooted_target.tz --details +Well typed +Gas remaining: 1039990.140 units remaining +{ storage (pair string nat) ; + parameter (or %root unit (or %default string nat)) ; + code { UNPAIR + /* [ or unit (or string nat) : pair string nat ] */ ; + IF_LEFT + { DROP + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } + { IF_LEFT + { DIP { UNPAIR /* [ string : nat ] */ ; DROP /* [ nat ] */ } /* [ string : nat ] */ } + { DUG 1 + /* [ pair string nat : nat ] */ ; + UNPAIR + /* [ string : nat : nat ] */ ; + DIP { DROP /* [ nat ] */ } + /* [ string : nat ] */ } ; + PAIR + /* [ pair string nat ] */ ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-simple_entrypoints.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-simple_entrypoints.tz.out new file mode 100644 index 000000000000..6fe542b53b5f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-entrypoints-simple_entrypoints.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/entrypoints/simple_entrypoints.tz --details +Well typed +Gas remaining: 1039997.574 units remaining +{ parameter (or (unit %A) (or (string %B) (nat %C))) ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert.tz.out new file mode 100644 index 000000000000..c2ef980a135a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert.tz --details +Well typed +Gas remaining: 1039995.213 units remaining +{ parameter bool ; + storage unit ; + code { CAR + /* [ bool ] */ ; + ASSERT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpeq.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpeq.tz.out new file mode 100644 index 000000000000..1761aef88c97 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpeq.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmpeq.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpge.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpge.tz.out new file mode 100644 index 000000000000..ff8d0daea693 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpge.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmpge.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPGE ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpgt.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpgt.tz.out new file mode 100644 index 000000000000..dc8e9235b5bc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpgt.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmpgt.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPGT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmple.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmple.tz.out new file mode 100644 index 000000000000..f244d8eb8fb0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmple.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmple.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPLE ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmplt.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmplt.tz.out new file mode 100644 index 000000000000..db2783aa5dfe --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmplt.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmplt.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPLT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpneq.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpneq.tz.out new file mode 100644 index 000000000000..dd854a713824 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_cmpneq.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_cmpneq.tz --details +Well typed +Gas remaining: 1039991.596 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + ASSERT_CMPNEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_eq.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_eq.tz.out new file mode 100644 index 000000000000..5ab3f51858fc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_eq.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_eq.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_ge.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_ge.tz.out new file mode 100644 index 000000000000..412fc31e2be1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_ge.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_ge.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GE ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_gt.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_gt.tz.out new file mode 100644 index 000000000000..53ef8fcafc39 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_gt.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_gt.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_le.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_le.tz.out new file mode 100644 index 000000000000..b67ae45be09f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_le.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_le.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LE ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_lt.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_lt.tz.out new file mode 100644 index 000000000000..79a7e3c43ef1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_lt.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_lt.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_neq.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_neq.tz.out new file mode 100644 index 000000000000..12c931201ce1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-assert_neq.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/assert_neq.tz --details +Well typed +Gas remaining: 1039991.843 units remaining +{ parameter (pair int int) ; + storage unit ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_NEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_get_add.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_get_add.tz.out new file mode 100644 index 000000000000..8c7a79148638 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_get_add.tz.out @@ -0,0 +1,55 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/big_map_get_add.tz --details +Well typed +Gas remaining: 1039971.186 units remaining +{ parameter (pair (pair %set_pair int (option int)) (pair %check_pair int (option int))) ; + storage (pair (big_map int int) unit) ; + code { DUP + /* [ pair (pair (pair int (option int)) int (option int)) (big_map int int) unit + : pair (pair (pair int (option int)) int (option int)) (big_map int int) unit ] */ ; + DIP { CDAR } + /* [ pair (pair (pair int (option int)) int (option int)) (big_map int int) unit + : big_map int int ] */ ; + DUP + /* [ pair (pair (pair int (option int)) int (option int)) (big_map int int) unit + : pair (pair (pair int (option int)) int (option int)) (big_map int int) unit + : big_map int int ] */ ; + DIP { CADR ; + DUP + /* [ pair int (option int) : pair int (option int) : big_map int int ] */ ; + CAR + /* [ int : pair int (option int) : big_map int int ] */ ; + DIP { CDR /* [ option int : big_map int int ] */ } + /* [ int : option int : big_map int int ] */ ; + UPDATE + /* [ big_map int int ] */ ; + DUP + /* [ big_map int int : big_map int int ] */ } + /* [ pair (pair (pair int (option int)) int (option int)) (big_map int int) unit + : big_map int int : big_map int int ] */ ; + CADR ; + DUP + /* [ pair int (option int) : pair int (option int) : big_map int int + : big_map int int ] */ ; + CDR + /* [ option int : pair int (option int) : big_map int int : big_map int int ] */ ; + DIP { CAR + /* [ int : big_map int int : big_map int int ] */ ; + GET + /* [ option int : big_map int int ] */ } + /* [ option int : option int : big_map int int ] */ ; + IF_SOME + { SWAP + /* [ option int : int : big_map int int ] */ ; + IF_SOME { ASSERT_CMPEQ } { FAIL } } + { ASSERT_NONE } ; + UNIT + /* [ unit : big_map int int ] */ ; + SWAP + /* [ big_map int int : unit ] */ ; + PAIR + /* [ pair (big_map int int) unit ] */ ; + NIL operation + /* [ list operation : pair (big_map int int) unit ] */ ; + PAIR + /* [ pair (list operation) (big_map int int) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_mem.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_mem.tz.out new file mode 100644 index 000000000000..ca8a13472ce4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-big_map_mem.tz.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/big_map_mem.tz --details +Well typed +Gas remaining: 1039984.191 units remaining +{ parameter (pair int bool) ; + storage (pair (big_map int unit) unit) ; + code { DUP + /* [ pair (pair int bool) (big_map int unit) unit + : pair (pair int bool) (big_map int unit) unit ] */ ; + DUP + /* [ pair (pair int bool) (big_map int unit) unit + : pair (pair int bool) (big_map int unit) unit + : pair (pair int bool) (big_map int unit) unit ] */ ; + CADR ; + DIP { CAAR ; + DIP { CDAR ; DUP /* [ big_map int unit : big_map int unit ] */ } + /* [ int : big_map int unit : big_map int unit ] */ ; + MEM + /* [ bool : big_map int unit ] */ } + /* [ bool : bool : big_map int unit ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit : big_map int unit ] */ ; + SWAP + /* [ big_map int unit : unit ] */ ; + PAIR + /* [ pair (big_map int unit) unit ] */ ; + NIL operation + /* [ list operation : pair (big_map int unit) unit ] */ ; + PAIR + /* [ pair (list operation) (big_map int unit) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-build_list.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-build_list.tz.out new file mode 100644 index 000000000000..1c09fd46d48b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-build_list.tz.out @@ -0,0 +1,45 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/build_list.tz --details +Well typed +Gas remaining: 1039985.111 units remaining +{ parameter nat ; + storage (list nat) ; + code { CAR @counter + /* [ nat ] */ ; + NIL @acc nat + /* [ list nat : nat ] */ ; + SWAP + /* [ nat : list nat ] */ ; + DUP @cmp_num + /* [ nat : nat : list nat ] */ ; + PUSH nat 0 + /* [ nat : nat : nat : list nat ] */ ; + CMPNEQ ; + LOOP { DUP + /* [ nat : nat : list nat ] */ ; + DIP { SWAP /* [ list nat : nat ] */ } + /* [ nat : list nat : nat ] */ ; + CONS @acc + /* [ list nat : nat ] */ ; + SWAP + /* [ nat : list nat ] */ ; + PUSH nat 1 + /* [ nat : nat : list nat ] */ ; + SWAP + /* [ nat : nat : list nat ] */ ; + SUB @counter + /* [ int : list nat ] */ ; + DUP + /* [ int : int : list nat ] */ ; + DIP { ABS /* [ nat : list nat ] */ } + /* [ int : nat : list nat ] */ ; + PUSH int 0 + /* [ int : int : nat : list nat ] */ ; + CMPNEQ } + /* [ nat : list nat ] */ ; + CONS + /* [ list nat ] */ ; + NIL operation + /* [ list operation : list nat ] */ ; + PAIR + /* [ pair (list operation) (list nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-carn_and_cdrn.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-carn_and_cdrn.tz.out new file mode 100644 index 000000000000..f5d6fc171e65 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-carn_and_cdrn.tz.out @@ -0,0 +1,47 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/carn_and_cdrn.tz --details +Well typed +Gas remaining: 1039965.224 units remaining +{ parameter (pair nat nat nat unit) ; + storage unit ; + code { CAR + /* [ pair nat nat nat unit ] */ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CAR + /* [ nat : pair nat nat nat unit ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CAR 0 ; + PUSH nat 1 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CAR 1 ; + PUSH nat 4 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CAR 2 ; + PUSH nat 2 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CDR 3 ; + UNIT + /* [ unit : unit : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare.tz.out new file mode 100644 index 000000000000..ac577c54e20c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare.tz.out @@ -0,0 +1,92 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/compare.tz --details +Well typed +Gas remaining: 1039971.322 units remaining +{ parameter (pair mutez mutez) ; + storage (list bool) ; + code { CAR + /* [ pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez : pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez : pair mutez mutez + : pair mutez mutez ] */ ; + DIIIIIP + { NIL bool /* [ list bool ] */ } + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez : pair mutez mutez + : pair mutez mutez : list bool ] */ ; + DIIIIP + { DUP + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + CAR + /* [ mutez : pair mutez mutez : list bool ] */ ; + DIP { CDR /* [ mutez : list bool ] */ } + /* [ mutez : mutez : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + LE + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez : pair mutez mutez + : list bool ] */ ; + DIIIP + { DUP + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + CAR + /* [ mutez : pair mutez mutez : list bool ] */ ; + DIP { CDR /* [ mutez : list bool ] */ } + /* [ mutez : mutez : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + GE + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez : list bool ] */ ; + DIIP { DUP + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + CAR + /* [ mutez : pair mutez mutez : list bool ] */ ; + DIP { CDR /* [ mutez : list bool ] */ } + /* [ mutez : mutez : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + LT + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + DIP { DUP + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + CAR + /* [ mutez : pair mutez mutez : list bool ] */ ; + DIP { CDR /* [ mutez : list bool ] */ } + /* [ mutez : mutez : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + GT + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair mutez mutez : list bool ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez : list bool ] */ ; + CAR + /* [ mutez : pair mutez mutez : list bool ] */ ; + DIP { CDR /* [ mutez : list bool ] */ } + /* [ mutez : mutez : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + EQ + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ ; + NIL operation + /* [ list operation : list bool ] */ ; + PAIR + /* [ pair (list operation) (list bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare_bytes.tz.out new file mode 100644 index 000000000000..e270611e5892 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-compare_bytes.tz.out @@ -0,0 +1,92 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/compare_bytes.tz --details +Well typed +Gas remaining: 1039971.322 units remaining +{ parameter (pair bytes bytes) ; + storage (list bool) ; + code { CAR + /* [ pair bytes bytes ] */ ; + DUP + /* [ pair bytes bytes : pair bytes bytes ] */ ; + DUP + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes ] */ ; + DUP + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes : pair bytes bytes ] */ ; + DUP + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes : pair bytes bytes + : pair bytes bytes ] */ ; + DIIIIIP + { NIL bool /* [ list bool ] */ } + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes : pair bytes bytes + : pair bytes bytes : list bool ] */ ; + DIIIIP + { DUP + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + CAR + /* [ bytes : pair bytes bytes : list bool ] */ ; + DIP { CDR /* [ bytes : list bool ] */ } + /* [ bytes : bytes : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + LE + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes : pair bytes bytes + : list bool ] */ ; + DIIIP + { DUP + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + CAR + /* [ bytes : pair bytes bytes : list bool ] */ ; + DIP { CDR /* [ bytes : list bool ] */ } + /* [ bytes : bytes : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + GE + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair bytes bytes : pair bytes bytes : pair bytes bytes : list bool ] */ ; + DIIP { DUP + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + CAR + /* [ bytes : pair bytes bytes : list bool ] */ ; + DIP { CDR /* [ bytes : list bool ] */ } + /* [ bytes : bytes : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + LT + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + DIP { DUP + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + CAR + /* [ bytes : pair bytes bytes : list bool ] */ ; + DIP { CDR /* [ bytes : list bool ] */ } + /* [ bytes : bytes : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + GT + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ } + /* [ pair bytes bytes : list bool ] */ ; + DUP + /* [ pair bytes bytes : pair bytes bytes : list bool ] */ ; + CAR + /* [ bytes : pair bytes bytes : list bool ] */ ; + DIP { CDR /* [ bytes : list bool ] */ } + /* [ bytes : bytes : list bool ] */ ; + COMPARE + /* [ int : list bool ] */ ; + EQ + /* [ bool : list bool ] */ ; + CONS + /* [ list bool ] */ ; + NIL operation + /* [ list operation : list bool ] */ ; + PAIR + /* [ pair (list operation) (list bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-fail.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-fail.tz.out new file mode 100644 index 000000000000..c505b16193a1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-fail.tz.out @@ -0,0 +1,5 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/fail.tz --details +Well typed +Gas remaining: 1039998.449 units remaining +{ parameter unit ; storage unit ; code { FAIL } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-guestbook.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-guestbook.tz.out new file mode 100644 index 000000000000..fbb64b8a8317 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-guestbook.tz.out @@ -0,0 +1,33 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/guestbook.tz --details +Well typed +Gas remaining: 1039988.143 units remaining +{ parameter string ; + storage (map address (option string)) ; + code { UNPAIR @message @guestbook + /* [ string : map address (option string) ] */ ; + SWAP + /* [ map address (option string) : string ] */ ; + DUP + /* [ map address (option string) : map address (option string) : string ] */ ; + SENDER + /* [ address : map address (option string) : map address (option string) + : string ] */ ; + GET @previous_message + /* [ option (option string) : map address (option string) : string ] */ ; + ASSERT_SOME ; + ASSERT_NONE ; + SWAP + /* [ string : map address (option string) ] */ ; + SOME + /* [ option string : map address (option string) ] */ ; + SOME + /* [ option (option string) : map address (option string) ] */ ; + SENDER + /* [ address : option (option string) : map address (option string) ] */ ; + UPDATE + /* [ map address (option string) ] */ ; + NIL operation + /* [ list operation : map address (option string) ] */ ; + PAIR + /* [ pair (list operation) (map address (option string)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-macro_annotations.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-macro_annotations.tz.out new file mode 100644 index 000000000000..c5475776e02a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-macro_annotations.tz.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/macro_annotations.tz --details +Well typed +Gas remaining: 1039993.362 units remaining +{ parameter unit ; + storage (pair (unit %truc) unit) ; + code { DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + UNIT + /* [ unit : unit ] */ ; + PAIR %truc + /* [ pair unit unit ] */ ; + UNIT + /* [ unit : pair unit unit ] */ ; + DUUP @new_storage + /* [ pair unit unit : unit : pair unit unit ] */ ; + DIP { DROP /* [ pair unit unit ] */ ; DROP /* [] */ } + /* [ pair unit unit ] */ ; + NIL operation + /* [ list operation : pair unit unit ] */ ; + PAIR + /* [ pair (list operation) unit unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-map_caddaadr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-map_caddaadr.tz.out new file mode 100644 index 000000000000..28048c4cbad0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-map_caddaadr.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/map_caddaadr.tz --details +Well typed +Gas remaining: 1039966.766 units remaining +{ parameter unit ; + storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat) ; + code { MAP_CDADDAADR @new_storage %value + { PUSH mutez 1000000 + /* [ mutez : mutez : pair nat mutez ] */ ; + ADD + /* [ mutez : pair nat mutez ] */ } ; + NIL operation + /* [ list operation + : pair unit (pair nat nat (pair (pair nat mutez) nat) nat) nat ] */ ; + SWAP + /* [ pair unit (pair nat nat (pair (pair nat mutez) nat) nat) nat + : list operation ] */ ; + SET_CAR } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-max_in_list.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-max_in_list.tz.out new file mode 100644 index 000000000000..bf4fbc9dae63 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-max_in_list.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/max_in_list.tz --details +Well typed +Gas remaining: 1039987.861 units remaining +{ parameter (list int) ; + storage (option int) ; + code { CAR + /* [ list int ] */ ; + DIP { NONE int /* [ option int ] */ } + /* [ list int : option int ] */ ; + ITER { SWAP + /* [ option int : int ] */ ; + IF_NONE + { SOME /* [ option int ] */ } + { DIP { DUP /* [ int : int ] */ } + /* [ int : int : int ] */ ; + DUP + /* [ int : int : int : int ] */ ; + DIP { SWAP /* [ int : int : int ] */ } + /* [ int : int : int : int ] */ ; + CMPLE ; + IF { DROP /* [ int ] */ } { DIP { DROP /* [] */ } /* [ int ] */ } ; + SOME + /* [ option int ] */ } } + /* [ option int ] */ ; + NIL operation + /* [ list operation : option int ] */ ; + PAIR + /* [ pair (list operation) (option int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-min.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-min.tz.out new file mode 100644 index 000000000000..3121131a8016 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-min.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/min.tz --details +Well typed +Gas remaining: 1039991.951 units remaining +{ parameter (pair int int) ; + storage int ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + DUP + /* [ pair int int : pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int : pair int int ] */ ; + DIP { CDR /* [ int : pair int int ] */ } + /* [ int : int : pair int int ] */ ; + CMPLT ; + IF { CAR /* [ int ] */ } { CDR /* [ int ] */ } ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-pair_macro.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-pair_macro.tz.out new file mode 100644 index 000000000000..75c59e1b2dde --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-pair_macro.tz.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/pair_macro.tz --details +Well typed +Gas remaining: 1039988.858 units remaining +{ parameter unit ; + storage unit ; + code { UNIT + /* [ unit : pair unit unit ] */ ; + UNIT + /* [ unit : unit : pair unit unit ] */ ; + UNIT + /* [ unit : unit : unit : pair unit unit ] */ ; + UNIT + /* [ unit : unit : unit : unit : pair unit unit ] */ ; + UNIT + /* [ unit : unit : unit : unit : unit : pair unit unit ] */ ; + PAPAPAPAIR @name %x1 %x2 %x3 %x4 %x5 ; + CDDDAR %x4 @fourth ; + DROP + /* [ pair unit unit ] */ ; + CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-set_caddaadr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-set_caddaadr.tz.out new file mode 100644 index 000000000000..435d2dbd428c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-set_caddaadr.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/set_caddaadr.tz --details +Well typed +Gas remaining: 1039970.670 units remaining +{ parameter mutez ; + storage (pair (pair nat (pair nat (pair (pair (pair (nat %p) (mutez %value)) nat) nat))) nat) ; + code { DUP + /* [ pair mutez (pair nat nat (pair (pair nat mutez) nat) nat) nat + : pair mutez (pair nat nat (pair (pair nat mutez) nat) nat) nat ] */ ; + CAR + /* [ mutez : pair mutez (pair nat nat (pair (pair nat mutez) nat) nat) nat ] */ ; + SWAP + /* [ pair mutez (pair nat nat (pair (pair nat mutez) nat) nat) nat : mutez ] */ ; + CDR + /* [ pair (pair nat nat (pair (pair nat mutez) nat) nat) nat : mutez ] */ ; + SET_CADDAADR @toplevel_pair_name %value ; + NIL operation + /* [ list operation : pair (pair nat nat (pair (pair nat mutez) nat) nat) nat ] */ ; + PAIR + /* [ pair (list operation) (pair nat nat (pair (pair nat mutez) nat) nat) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-take_my_money.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-take_my_money.tz.out new file mode 100644 index 000000000000..df0f34a61440 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-take_my_money.tz.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/take_my_money.tz --details +Well typed +Gas remaining: 1039993.750 units remaining +{ parameter key_hash ; + storage unit ; + code { CAR + /* [ key_hash ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit ] */ ; + DIP { UNIT /* [ unit ] */ } + /* [ contract unit : unit ] */ ; + PUSH mutez 1000000 + /* [ mutez : contract unit : unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : unit ] */ ; + TRANSFER_TOKENS + /* [ operation : unit ] */ ; + NIL operation + /* [ list operation : operation : unit ] */ ; + SWAP + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-unpair_macro.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-unpair_macro.tz.out new file mode 100644 index 000000000000..da08546f5cc1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-macros-unpair_macro.tz.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/macros/unpair_macro.tz --details +Well typed +Gas remaining: 1039977.130 units remaining +{ parameter (unit :param_unit) ; + storage (unit :u1) ; + code { DROP + /* [] */ ; + UNIT :u4 @a4 + /* [ unit ] */ ; + UNIT :u3 @a3 + /* [ unit : unit ] */ ; + UNIT :u2 @a2 + /* [ unit : unit : unit ] */ ; + UNIT :u1 @a1 + /* [ unit : unit : unit : unit ] */ ; + PAIR + /* [ pair unit unit : unit : unit ] */ ; + UNPAIR @x1 @x2 + /* [ unit : unit : unit : unit ] */ ; + PPAIPAIR @p1 %x1 %x2 %x3 %x4 ; + UNPPAIPAIR %x1 % %x3 %x4 @uno @due @tre @quattro ; + PAPAPAIR @p2 %x1 %x2 %x3 %x4 ; + UNPAPAPAIR @un @deux @trois @quatre ; + PAPPAIIR @p3 %x1 %x2 %x3 %x4 ; + UNPAPPAIIR @one @two @three @four ; + DIP { DROP /* [ unit : unit ] */ ; DROP /* [ unit ] */ ; DROP /* [] */ } + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-add_clear_tickets.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-add_clear_tickets.tz.out new file mode 100644 index 000000000000..3f44ebe2c006 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-add_clear_tickets.tz.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/add_clear_tickets.tz --details +Well typed +Gas remaining: 1039988.509 units remaining +{ parameter (or (pair %add nat string) (unit %clear)) ; + storage (list (ticket string)) ; + code { UNPAIR + /* [ or (pair nat string) unit : list (ticket string) ] */ ; + IF_LEFT + { UNPAIR + /* [ nat : string : list (ticket string) ] */ ; + DIG 2 + /* [ list (ticket string) : nat : string ] */ ; + SWAP + /* [ nat : list (ticket string) : string ] */ ; + DIG 2 + /* [ string : nat : list (ticket string) ] */ ; + TICKET + /* [ option (ticket string) : list (ticket string) ] */ ; + ASSERT_SOME ; + CONS + /* [ list (ticket string) ] */ ; + NIL operation + /* [ list operation : list (ticket string) ] */ ; + PAIR + /* [ pair (list operation) (list (ticket string)) ] */ } + { DROP 2 + /* [] */ ; + NIL (ticket string) + /* [ list (ticket string) ] */ ; + NIL operation + /* [ list operation : list (ticket string) ] */ ; + PAIR + /* [ pair (list operation) (list (ticket string)) ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-authentication.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-authentication.tz.out new file mode 100644 index 000000000000..67a7f8030f77 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-authentication.tz.out @@ -0,0 +1,44 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/authentication.tz --details +Well typed +Gas remaining: 1039979.836 units remaining +{ parameter (pair (lambda unit (list operation)) signature) ; + storage (pair (nat %counter) key) ; + code { UNPPAIPAIR ; + DUUUP + /* [ nat : lambda unit (list operation) : signature : nat : key ] */ ; + DUUP + /* [ lambda unit (list operation) : nat : lambda unit (list operation) + : signature : nat : key ] */ ; + SELF + /* [ contract (pair (lambda unit (list operation)) signature) + : lambda unit (list operation) : nat : lambda unit (list operation) + : signature : nat : key ] */ ; + CHAIN_ID + /* [ chain_id : contract (pair (lambda unit (list operation)) signature) + : lambda unit (list operation) : nat : lambda unit (list operation) + : signature : nat : key ] */ ; + PPAIPAIR ; + PACK + /* [ bytes : lambda unit (list operation) : signature : nat : key ] */ ; + DIP { SWAP /* [ signature : lambda unit (list operation) : nat : key ] */ } + /* [ bytes : signature : lambda unit (list operation) : nat : key ] */ ; + DUUUUUP + /* [ key : bytes : signature : lambda unit (list operation) : nat : key ] */ ; + DIP { SWAP /* [ signature : bytes : lambda unit (list operation) : nat : key ] */ } + /* [ key : signature : bytes : lambda unit (list operation) : nat : key ] */ ; + DUUUP + /* [ bytes : key : signature : bytes : lambda unit (list operation) : nat + : key ] */ ; + DIP { CHECK_SIGNATURE /* [ bool : lambda unit (list operation) : nat : key ] */ } + /* [ bytes : bool : lambda unit (list operation) : nat : key ] */ ; + SWAP + /* [ bool : bytes : lambda unit (list operation) : nat : key ] */ ; + IF { DROP /* [ lambda unit (list operation) : nat : key ] */ } { FAILWITH /* [] */ } ; + UNIT + /* [ unit : lambda unit (list operation) : nat : key ] */ ; + EXEC + /* [ list operation : nat : key ] */ ; + DIP { PUSH nat 1 /* [ nat : nat : key ] */ ; ADD /* [ nat : key ] */ } + /* [ list operation : nat : key ] */ ; + PAPAIR } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_entrypoints.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_entrypoints.tz.out new file mode 100644 index 000000000000..8714ad00b341 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_entrypoints.tz.out @@ -0,0 +1,120 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/big_map_entrypoints.tz --details +Well typed +Gas remaining: 1039953.156 units remaining +{ storage (pair (big_map string nat) (big_map string nat)) ; + parameter + (or (unit %default + /* [ list operation : big_map string nat ] */) + (or (or %mem + (string %mem_left) + (string %mem_right) + /* [ pair (list operation) (big_map string nat) ] */) + (or (or %add (pair %add_left string nat) (pair %add_right string nat)) + (or %rem (string %rem_left) (string %rem_right)))) + /* [ big_map string nat ] */) + /* [ string : big_map string nat ] */ ; + code { UNPAIR + /* [ or unit + (or (or string string) (or (or (pair string nat) (pair string nat)) (or string string))) + : pair (big_map string nat) (big_map string nat) ] */ ; + IF_LEFT + { DROP + /* [ pair (big_map string nat) (big_map string nat) ] */ ; + DUP + /* [ pair (big_map string nat) (big_map string nat) + : pair (big_map string nat) (big_map string nat) ] */ ; + CAR + /* [ big_map string nat : pair (big_map string nat) (big_map string nat) ] */ ; + PUSH mutez + 0 + /* [ mutez : big_map string nat + : pair (big_map string nat) (big_map string nat) ] */ ; + NONE key_hash + /* [ option key_hash : mutez : big_map string nat + : pair (big_map string nat) (big_map string nat) ] */ ; + CREATE_CONTRACT + { parameter string ; + storage (big_map string nat) ; + code { UNPAIR ; DROP ; NIL operation ; PAIR } } + /* [ operation : address : pair (big_map string nat) (big_map string nat) ] */ ; + DIP { DROP /* [ pair (big_map string nat) (big_map string nat) ] */ } + /* [ operation : pair (big_map string nat) (big_map string nat) ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map string nat) (big_map string nat) ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map string nat) (big_map string nat) ] */ ; + CONS + /* [ list operation : pair (big_map string nat) (big_map string nat) ] */ ; + PAIR + /* [ pair (list operation) (big_map string nat) (big_map string nat) ] */ } + { IF_LEFT + { IF_LEFT + { DIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { DUP /* [ big_map string nat : big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat : big_map string nat ] */ ; + MEM + /* [ bool : big_map string nat : big_map string nat ] */ ; + ASSERT } + { DIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { DUP /* [ big_map string nat : big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat : big_map string nat ] */ ; + MEM + /* [ bool : big_map string nat : big_map string nat ] */ ; + ASSERT ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } + { IF_LEFT + { IF_LEFT + { UNPAIR + /* [ string : nat : pair (big_map string nat) (big_map string nat) ] */ ; + DIIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : nat : big_map string nat : big_map string nat ] */ ; + DIP { SOME /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ } + { UNPAIR + /* [ string : nat : pair (big_map string nat) (big_map string nat) ] */ ; + DIIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : nat : big_map string nat : big_map string nat ] */ ; + DIP { SOME /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } + { IF_LEFT + { DIP { UNPAIR /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { NONE nat /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ } + { DIP { UNPAIR + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + DIP { NONE nat /* [ option nat : big_map string nat : big_map string nat ] */ } + /* [ string : option nat : big_map string nat : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : big_map string nat ] */ } } } ; + PAIR + /* [ pair (big_map string nat) (big_map string nat) ] */ ; + NIL operation + /* [ list operation : pair (big_map string nat) (big_map string nat) ] */ ; + PAIR + /* [ pair (list operation) (big_map string nat) (big_map string nat) ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_magic.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_magic.tz.out new file mode 100644 index 000000000000..bf6af524c6e7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_magic.tz.out @@ -0,0 +1,103 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/big_map_magic.tz --details +Well typed +Gas remaining: 1039954.710 units remaining +{ storage (or (pair (big_map string string) (big_map string string)) unit) ; + parameter + (or (unit %swap) + (or (or %reset (pair (big_map string string) (big_map string string)) unit) + (or (pair %import (list (pair string string)) (list (pair string string))) + (or (list %add (pair string string)) (list %rem string))))) ; + code { UNPAIR + /* [ or unit + (or (or (pair (big_map string string) (big_map string string)) unit) + (or (pair (list (pair string string)) (list (pair string string))) + (or (list (pair string string)) (list string)))) + : or (pair (big_map string string) (big_map string string)) unit ] */ ; + IF_LEFT + { DROP + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ ; + ASSERT_LEFT ; + UNPAIR + /* [ big_map string string : big_map string string ] */ ; + SWAP + /* [ big_map string string : big_map string string ] */ ; + PAIR + /* [ pair (big_map string string) (big_map string string) ] */ ; + LEFT unit + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ } + { IF_LEFT + { SWAP + /* [ or (pair (big_map string string) (big_map string string)) unit + : or (pair (big_map string string) (big_map string string)) unit ] */ ; + DROP + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ } + { IF_LEFT + { DIP { ASSERT_RIGHT ; DROP /* [] */ } + /* [ pair (list (pair string string)) (list (pair string string)) ] */ ; + UNPAIR + /* [ list (pair string string) : list (pair string string) ] */ ; + DIP { EMPTY_BIG_MAP + string + string + /* [ big_map string string : list (pair string string) ] */ } + /* [ list (pair string string) : big_map string string + : list (pair string string) ] */ ; + ITER { UNPAIR + /* [ string : string : big_map string string : list (pair string string) ] */ ; + DIP { SOME + /* [ option string : big_map string string : list (pair string string) ] */ } + /* [ string : option string : big_map string string + : list (pair string string) ] */ ; + UPDATE + /* [ big_map string string : list (pair string string) ] */ } + /* [ big_map string string : list (pair string string) ] */ ; + SWAP + /* [ list (pair string string) : big_map string string ] */ ; + DIP { EMPTY_BIG_MAP string string + /* [ big_map string string : big_map string string ] */ } + /* [ list (pair string string) : big_map string string : big_map string string ] */ ; + ITER { UNPAIR + /* [ string : string : big_map string string : big_map string string ] */ ; + DIP { SOME /* [ option string : big_map string string : big_map string string ] */ } + /* [ string : option string : big_map string string : big_map string string ] */ ; + UPDATE + /* [ big_map string string : big_map string string ] */ } + /* [ big_map string string : big_map string string ] */ ; + SWAP + /* [ big_map string string : big_map string string ] */ ; + PAIR + /* [ pair (big_map string string) (big_map string string) ] */ ; + LEFT unit + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ } + { IF_LEFT + { DIP { ASSERT_LEFT ; UNPAIR /* [ big_map string string : big_map string string ] */ } + /* [ list (pair string string) : big_map string string : big_map string string ] */ ; + ITER { UNPAIR + /* [ string : string : big_map string string : big_map string string ] */ ; + DIP { SOME /* [ option string : big_map string string : big_map string string ] */ } + /* [ string : option string : big_map string string : big_map string string ] */ ; + UPDATE + /* [ big_map string string : big_map string string ] */ } + /* [ big_map string string : big_map string string ] */ ; + PAIR + /* [ pair (big_map string string) (big_map string string) ] */ ; + LEFT unit + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ } + { DIP { ASSERT_LEFT ; UNPAIR /* [ big_map string string : big_map string string ] */ } + /* [ list string : big_map string string : big_map string string ] */ ; + ITER { DIP { NONE string + /* [ option string : big_map string string : big_map string string ] */ } + /* [ string : option string : big_map string string : big_map string string ] */ ; + UPDATE + /* [ big_map string string : big_map string string ] */ } + /* [ big_map string string : big_map string string ] */ ; + PAIR + /* [ pair (big_map string string) (big_map string string) ] */ ; + LEFT unit + /* [ or (pair (big_map string string) (big_map string string)) unit ] */ } } } } ; + NIL operation + /* [ list operation + : or (pair (big_map string string) (big_map string string)) unit ] */ ; + PAIR + /* [ pair (list operation) (or (pair (big_map string string) (big_map string string)) unit) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_read.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_read.tz.out new file mode 100644 index 000000000000..ffbb35da86a1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_read.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/big_map_read.tz --details +Well typed +Gas remaining: 1039994.234 units remaining +{ storage nat ; + parameter (big_map nat nat) ; + code { CAR + /* [ big_map nat nat ] */ ; + PUSH nat 1 + /* [ nat : big_map nat nat ] */ ; + GET + /* [ option nat ] */ ; + ASSERT_SOME ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_store.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_store.tz.out new file mode 100644 index 000000000000..3e6a78c23b7a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_store.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/big_map_store.tz --details +Well typed +Gas remaining: 1039996.856 units remaining +{ storage (big_map nat nat) ; + parameter unit ; + code { DROP + /* [] */ ; + EMPTY_BIG_MAP nat nat + /* [ big_map nat nat ] */ ; + NIL operation + /* [ list operation : big_map nat nat ] */ ; + PAIR + /* [ pair (list operation) (big_map nat nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_write.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_write.tz.out new file mode 100644 index 000000000000..b27e5aeb460c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-big_map_write.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/big_map_write.tz --details +Well typed +Gas remaining: 1039994.982 units remaining +{ storage unit ; + parameter (big_map nat nat) ; + code { UNPAIR + /* [ big_map nat nat : unit ] */ ; + PUSH (option nat) (Some 1) + /* [ option nat : big_map nat nat : unit ] */ ; + PUSH nat 1 + /* [ nat : option nat : big_map nat nat : unit ] */ ; + UPDATE + /* [ big_map nat nat : unit ] */ ; + DROP + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract.tz.out new file mode 100644 index 000000000000..c27e946ddafd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract.tz.out @@ -0,0 +1,74 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/create_contract.tz --details +Well typed +Gas remaining: 1039973.277 units remaining +{ parameter (option address) ; + storage unit ; + code { /* [ pair string string ] */ + CAR + /* [ list operation : string ] */ ; + IF_NONE + { /* [ list operation : string ] */ + PUSH string "dummy" + /* [ string ] */ ; + PUSH mutez 100000000 + /* [ mutez : string ] */ ; + NONE key_hash + /* [ option key_hash : mutez : string ] */ ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + DIP { SOME + /* [ option address ] */ ; + DIP { SELF + /* [ contract (option address) ] */ ; + PUSH mutez 0 + /* [ mutez : contract (option address) ] */ } + /* [ option address : mutez : contract (option address) ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ } + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ ; + UNIT + /* [ unit : list operation ] */ ; + SWAP + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } + { SELF + /* [ contract (option address) : address ] */ ; + ADDRESS + /* [ address : address ] */ ; + SENDER + /* [ address : address : address ] */ ; + IFCMPNEQ { FAIL } { /* [ address ] */ } ; + CONTRACT string + /* [ option (contract string) ] */ ; + IF_SOME { /* [ contract string ] */ } { FAIL } ; + PUSH mutez 0 + /* [ mutez : contract string ] */ ; + PUSH string "abcdefg" + /* [ string : mutez : contract string ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ ; + UNIT + /* [ unit : list operation ] */ ; + SWAP + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract_simple.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract_simple.tz.out new file mode 100644 index 000000000000..70b42d2742a0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-create_contract_simple.tz.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/create_contract_simple.tz --details +Well typed +Gas remaining: 1039991.809 units remaining +{ parameter unit ; + storage unit ; + code { CAR + /* [ string ] */ ; + PUSH string "foo" /* [ pair (list operation) string ] */ + /* [ list operation : string ] */ ; + PUSH mutez 0 + /* [ mutez : string : unit ] */ ; + NONE key_hash + /* [ option key_hash : mutez : string : unit ] */ ; + CREATE_CONTRACT + { parameter string ; + storage string ; + code { CAR ; NIL operation ; PAIR } } + /* [ operation : address : unit ] */ ; + DROP + /* [ address : unit ] */ ; + DROP + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-default_account.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-default_account.tz.out new file mode 100644 index 000000000000..9c0909c1aca4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-default_account.tz.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/default_account.tz --details +Well typed +Gas remaining: 1039993.750 units remaining +{ parameter key_hash ; + storage unit ; + code { DIP { UNIT /* [ unit ] */ } + /* [ pair key_hash unit : unit ] */ ; + CAR + /* [ key_hash : unit ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : unit ] */ ; + PUSH mutez 100000000 + /* [ mutez : contract unit : unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : unit ] */ ; + TRANSFER_TOKENS + /* [ operation : unit ] */ ; + NIL operation + /* [ list operation : operation : unit ] */ ; + SWAP + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_appender.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_appender.tz.out new file mode 100644 index 000000000000..f665a60ef841 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_appender.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/execution_order_appender.tz --details +Well typed +Gas remaining: 1039990.644 units remaining +{ parameter unit ; + storage (pair address string) ; + code { CDR + /* [ pair address string ] */ ; + DUP + /* [ pair address string : pair address string ] */ ; + UNPAIR + /* [ address : string : pair address string ] */ ; + CONTRACT string + /* [ option (contract string) : string : pair address string ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract string : string : pair address string ] */ ; + DIG 2 + /* [ string : mutez : contract string : pair address string ] */ ; + TRANSFER_TOKENS + /* [ operation : pair address string ] */ ; + NIL operation + /* [ list operation : operation : pair address string ] */ ; + SWAP + /* [ operation : list operation : pair address string ] */ ; + CONS + /* [ list operation : pair address string ] */ ; + PAIR + /* [ pair (list operation) address string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_caller.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_caller.tz.out new file mode 100644 index 000000000000..5cb5febe31e1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_caller.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/execution_order_caller.tz --details +Well typed +Gas remaining: 1039992.571 units remaining +{ parameter unit ; + storage (list address) ; + code { CDR + /* [ list address ] */ ; + DUP + /* [ list address : list address ] */ ; + MAP { CONTRACT unit + /* [ option (contract unit) : list address ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract unit : list address ] */ ; + UNIT + /* [ unit : mutez : contract unit : list address ] */ ; + TRANSFER_TOKENS + /* [ operation : list address ] */ } + /* [ list operation : list address ] */ ; + PAIR + /* [ pair (list operation) (list address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_storer.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_storer.tz.out new file mode 100644 index 000000000000..cacc364de9c7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-execution_order_storer.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/execution_order_storer.tz --details +Well typed +Gas remaining: 1039996.980 units remaining +{ parameter string ; + storage string ; + code { UNPAIR + /* [ string : string ] */ ; + SWAP + /* [ string : string ] */ ; + CONCAT + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-fa12_reference.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-fa12_reference.tz.out new file mode 100644 index 000000000000..69cb01cfc450 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-fa12_reference.tz.out @@ -0,0 +1,2707 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/fa12_reference.tz --details +Well typed +Gas remaining: 1039349.178 units remaining +{ parameter + (or (or (or (pair %transfer (address :from) (pair (address :to) (nat :value))) + (pair %approve (address :spender) (nat :value))) + (or (pair %getAllowance (pair (address :owner) (address :spender)) (contract nat)) + (or (pair %getBalance (address :owner) (contract nat)) + (pair %getTotalSupply unit (contract nat))))) + (or (or (bool %setPause) (address %setAdministrator)) + (or (pair %getAdministrator unit (contract address)) + (or (pair %mint (address :to) (nat :value)) (pair %burn (address :from) (nat :value)))))) ; + storage + (pair (big_map %ledger + (address :user) + (pair (nat :balance) (map :approvals (address :spender) (nat :value)))) + (pair (address %admin) (pair (bool %paused) (nat %totalSupply)))) ; + code { CAST (pair (or (or (or (pair address (pair address nat)) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) + (pair (big_map address (pair nat (map address nat))) (pair address (pair bool nat)))) + /* [ pair (or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) + (big_map address (pair nat (map address nat))) + address + bool + nat ] */ ; + DUP + /* [ pair (or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) + (big_map address (pair nat (map address nat))) + address + bool + nat + : pair (or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) + (big_map address (pair nat (map address nat))) + address + bool + nat ] */ ; + CAR + /* [ or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat)))) + : pair (or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat))))) + (big_map address (pair nat (map address nat))) + address + bool + nat ] */ ; + DIP { CDR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ or (or (or (pair address address nat) (pair address nat)) + (or (pair (pair address address) (contract nat)) + (or (pair address (contract nat)) (pair unit (contract nat))))) + (or (or bool address) + (or (pair unit (contract address)) (or (pair address nat) (pair address nat)))) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "TokenOperationsArePaused" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address : pair address address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { EMPTY_MAP + address + nat + /* [ map address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { CDR + /* [ map address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address : map address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : map address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { SENDER + /* [ address : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat : nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SUB + /* [ int : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { DIP { DUP + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat : nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "NotEnoughAllowance" + /* [ string : pair nat nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ address : nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : pair address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address address nat : pair address address nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DROP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { EMPTY_MAP + address + nat + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EMPTY_MAP + address + nat + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ nat : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NONE nat + /* [ option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { SOME + /* [ option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DIP { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option nat : pair address address nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : option nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : option nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair nat (map address nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { SOME + /* [ option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { NONE (pair nat (map address nat)) + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { EMPTY_MAP + address + nat + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SOME + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SOME + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + SWAP + /* [ pair address address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ int : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH string + "Internal: Negative total supply" + /* [ string + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair bool nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair bool nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { CDR + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH nat + 0 + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "NotEnoughBalance" + /* [ string : pair nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SUB + /* [ int : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { CAR + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "NotEnoughBalance" + /* [ string : pair nat nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SIZE + /* [ nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NONE (pair nat (map address nat)) + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { SOME + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { SOME + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + SWAP + /* [ pair address address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NEG + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ int : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH string + "Internal: Negative total supply" + /* [ string + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair bool nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair bool nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DROP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { SENDER + /* [ address : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "TokenOperationsArePaused" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { EMPTY_MAP + address + nat + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { CDR + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DUP + /* [ nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { PUSH string + "UnsafeAllowanceChange" + /* [ string : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : address : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { EMPTY_MAP + address + nat + /* [ map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EMPTY_MAP + address + nat + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ nat : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NONE nat + /* [ option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { SOME + /* [ option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DIP { DIP { DUP + /* [ pair address address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address address nat + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : pair address address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option nat : pair address address nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : option nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address nat : option nat : map address nat + : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : option nat : map address nat : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ map address nat : pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) + : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ map address nat : nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : map address nat : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address address nat : pair nat (map address nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair nat (map address nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { SOME + /* [ option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { IF_LEFT + { DUP + /* [ pair (pair address address) (contract nat) + : pair (pair address address) (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ pair address address : pair (pair address address) (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (pair address address) + (big_map address (pair nat (map address nat))) + address + bool + nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair (pair address address) + (big_map address (pair nat (map address nat))) + address + bool + nat + : pair (pair address address) + (big_map address (pair nat (map address nat))) + address + bool + nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ pair address address + : pair (pair address address) + (big_map address (pair nat (map address nat))) + address + bool + nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address address : pair address address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { EMPTY_MAP + address + nat + /* [ map address nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { CDR + /* [ map address nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + /* [ pair address address : map address nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ address : map address nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { /* [ nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { AMOUNT + /* [ mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CONS + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { IF_LEFT + { DUP + /* [ pair address (contract nat) : pair address (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair address (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address (big_map address (pair nat (map address nat))) address bool nat + : pair address (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair address (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { CAR + /* [ nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { AMOUNT + /* [ mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CONS + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair unit (contract nat) : pair unit (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ unit : pair unit (contract nat) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ unit : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ unit : pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair unit (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { AMOUNT + /* [ mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : mutez : contract nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CONS + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } } } } + { IF_LEFT + { IF_LEFT + { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "SenderIsNotAdmin" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } } + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ bool : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ bool : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair bool nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair bool nat : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ bool : bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "SenderIsNotAdmin" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } } + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { IF_LEFT + { DUP + /* [ pair unit (contract address) : pair unit (contract address) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ unit : pair unit (contract address) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ unit : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ contract address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ unit : pair (big_map address (pair nat (map address nat))) address bool nat + : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair unit (big_map address (pair nat (map address nat))) address bool nat + : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { AMOUNT + /* [ mutez : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : mutez : contract address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + TRANSFER_TOKENS + /* [ operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation : operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ operation : list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CONS + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { IF_LEFT + { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "SenderIsNotAdmin" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { NONE (pair nat (map address nat)) + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { EMPTY_MAP + address + nat + /* [ map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SOME + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SOME + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + SWAP + /* [ pair address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address nat : pair address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ int : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH string + "Internal: Negative total supply" + /* [ string + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair bool nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair bool nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DROP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } + { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SENDER + /* [ address : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + COMPARE + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { UNIT + /* [ unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "SenderIsNotAdmin" + /* [ string : unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string unit + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat + : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ big_map address (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : big_map address (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + GET + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH nat + 0 + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "NotEnoughBalance" + /* [ string : pair nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat : nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ nat : nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SUB + /* [ int : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { CAR + /* [ nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat : nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PUSH string + "NotEnoughBalance" + /* [ string : pair nat nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair string nat nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : map address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair nat (map address nat) : pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ pair address nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DUP + /* [ pair nat (map address nat) : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ map address nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SIZE + /* [ nat : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + INT + /* [ int : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + EQ + /* [ bool : pair nat (map address nat) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF { DROP + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NONE (pair nat (map address nat)) + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + { SOME + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } } + { SOME + /* [ option (pair nat (map address nat)) : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + SWAP + /* [ pair address nat : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ address : option (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ address : option (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + UPDATE + /* [ big_map address (pair nat (map address nat)) + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR /* [ pair address bool nat ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair address bool nat ] */ ; + CAR + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) + : big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + DIP { DROP /* [ pair address bool nat ] */ } + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DUP + /* [ pair address nat : pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NEG + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ int : nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ADD + /* [ int + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + ISNAT + /* [ option nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + IF_NONE + { PUSH string + "Internal: Negative total supply" + /* [ string + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair address bool nat : pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair bool nat : pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair bool nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + CDR + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DROP + /* [ bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ nat : bool : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ bool : nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair bool nat : address + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + SWAP + /* [ address : pair bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { DUP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DIP { CAR /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair (big_map address (pair nat (map address nat))) address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + CDR + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : pair address bool nat + : big_map address (pair nat (map address nat)) ] */ ; + DIP { DROP /* [ big_map address (pair nat (map address nat)) ] */ } + /* [ pair address bool nat : big_map address (pair nat (map address nat)) ] */ ; + SWAP + /* [ big_map address (pair nat (map address nat)) : pair address bool nat ] */ ; + PAIR + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ } + /* [ pair address nat + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + DROP + /* [ pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address (pair nat (map address nat))) address bool nat ] */ ; + PAIR + /* [ pair (list operation) (big_map address (pair nat (map address nat))) address bool nat ] */ } } } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-generic_multisig.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-generic_multisig.tz.out new file mode 100644 index 000000000000..5862643fced7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-generic_multisig.tz.out @@ -0,0 +1,245 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/generic_multisig.tz --details +Well typed +Gas remaining: 1039939.911 units remaining +{ parameter + (or (unit %default) + (pair %main + (pair :payload + (nat %counter) + (or :action + (lambda %operation unit (list operation)) + (pair %change_keys (nat %threshold) (list %keys key)))) + (list %sigs (option signature)))) ; + storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; + code { UNPAIR + /* [ or unit + (pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature))) : pair nat nat (list key) ] */ ; + IF_LEFT + { DROP + /* [ pair nat nat (list key) ] */ ; + NIL operation + /* [ list operation : pair nat nat (list key) ] */ ; + PAIR + /* [ pair (list operation) nat nat (list key) ] */ } + { PUSH mutez + 0 + /* [ mutez + : pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) : pair nat nat (list key) ] */ ; + AMOUNT + /* [ mutez : mutez + : pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) : pair nat nat (list key) ] */ ; + ASSERT_CMPEQ ; + SWAP + /* [ pair nat nat (list key) + : pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) ] */ ; + DUP + /* [ pair nat nat (list key) : pair nat nat (list key) + : pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) ] */ ; + DIP { SWAP + /* [ pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) : pair nat nat (list key) ] */ } + /* [ pair nat nat (list key) + : pair (pair nat (or (lambda unit (list operation)) (pair nat (list key)))) + (list (option signature)) : pair nat nat (list key) ] */ ; + DIP { UNPAIR + /* [ pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + DUP + /* [ pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + SELF + /* [ contract unit + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + ADDRESS + /* [ address + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + CHAIN_ID + /* [ chain_id : address + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + PAIR + /* [ pair chain_id address + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + PAIR + /* [ pair (pair chain_id address) nat (or (lambda unit (list operation)) (pair nat (list key))) + : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + PACK + /* [ bytes : pair nat (or (lambda unit (list operation)) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + DIP { UNPAIR @counter + /* [ nat : or (lambda unit (list operation)) (pair nat (list key)) + : list (option signature) : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ nat : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ bytes : nat : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + SWAP + /* [ nat : bytes : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ pair nat nat (list key) : nat : bytes : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + UNPAIR @stored_counter + /* [ nat : pair nat (list key) : nat : bytes : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ nat : pair nat (list key) : bytes : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ nat : nat : pair nat (list key) : bytes : list (option signature) + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + ASSERT_CMPEQ ; + DIP { SWAP + /* [ list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ pair nat (list key) : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + UNPAIR @threshold @keys + /* [ nat : list key : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIP { PUSH @valid + nat + 0 + /* [ nat : list key : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + SWAP + /* [ list key : nat : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + ITER { DIP { SWAP + /* [ list (option signature) : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ key : list (option signature) : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + SWAP + /* [ list (option signature) : key : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + IF_CONS + { IF_SOME + { SWAP + /* [ list (option signature) : signature : key : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ key : signature : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIIP { DUUP + /* [ bytes : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ key : signature : bytes : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + { DUUUP + /* [ bytes : key : signature : bytes : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIP { CHECK_SIGNATURE + /* [ bool : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ bytes : bool : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + SWAP + /* [ bool : bytes : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + IF { DROP + /* [ nat : bytes : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + { FAILWITH /* [] */ } } ; + PUSH nat + 1 + /* [ nat : nat : bytes : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + ADD @valid + /* [ nat : bytes : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ list (option signature) : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + { SWAP + /* [ key : list (option signature) : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DROP + /* [ list (option signature) : nat : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } } + { FAIL } ; + SWAP + /* [ nat : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ nat : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } + /* [ nat : nat : list (option signature) : bytes + : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + ASSERT_CMPLE ; + IF_CONS + { FAIL } + { /* [ bytes : or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ } ; + DROP + /* [ or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + DIP { UNPAIR + /* [ nat : pair nat (list key) ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat (list key) ] */ ; + ADD @new_counter + /* [ nat : pair nat (list key) ] */ ; + PAIR + /* [ pair nat nat (list key) ] */ } + /* [ or (lambda unit (list operation)) (pair nat (list key)) + : pair nat nat (list key) ] */ ; + IF_LEFT + { UNIT + /* [ unit : lambda unit (list operation) : pair nat nat (list key) ] */ ; + EXEC + /* [ list operation : pair nat nat (list key) ] */ } + { DIP { CAR /* [ nat ] */ } + /* [ pair nat (list key) : nat ] */ ; + SWAP + /* [ nat : pair nat (list key) ] */ ; + PAIR + /* [ pair nat nat (list key) ] */ ; + NIL operation + /* [ list operation : pair nat nat (list key) ] */ } ; + PAIR + /* [ pair (list operation) nat nat (list key) ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-groth16.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-groth16.tz.out new file mode 100644 index 000000000000..9922c6c475de --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-groth16.tz.out @@ -0,0 +1,194 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/groth16.tz --details +Well typed +Gas remaining: 1039536.287 units remaining +{ storage unit ; + parameter + (pair (pair (bls12_381_fr %input_x) (bls12_381_fr %input_y)) + (pair (pair (bls12_381_g1 %proof_a) (bls12_381_g2 %proof_b)) (bls12_381_g1 %proof_c))) ; + code { CAR + /* [ pair (pair bls12_381_fr bls12_381_fr) (pair bls12_381_g1 bls12_381_g2) bls12_381_g1 ] */ ; + UNPPAIPPAIIR ; + DIP 5 + { PUSH @vk_gamma_c + bls12_381_g1 + 0x063bd6e11e2fcaac1dd8cf68c6b1925a73c3c583e298ed37c41c3715115cf96358a42dbe85a0228cbfd8a6c8a8c54cd015b5ae2860d1cc47f84698d951f14d9448d03f04df2ca0ffe609a2067d6f1a892163a5e05e541279134cae52b1f23c6b + /* [ bls12_381_g1 ] */ ; + PUSH @vk_gamma_b + bls12_381_g1 + 0x11f5b5db1da7f1f26217edcce2219d016003af6e5b4d1ca3ad0ff477e354717e658bf16beddc4f4fb76ce39d3327811e0601709dc7ed98c70463cfa1ba33f99851b52b51d1a042d7425bec6277287441c399973632445ce61e7fdd63a70f0f60 + /* [ bls12_381_g1 : bls12_381_g1 ] */ ; + PUSH @vk_gamma_a + bls12_381_g1 + 0x03535a322edd23c55b0ca025e54d450d95df49cc9ee873dcd500e8219f4771264bf159b3b105954d85c7bea8ffe1ea0400c767fe58989366c2837fba76f1b4f46644f19be8ad01e22d894b649e427e0d7e04677ee3919d982f0f96bb0a2f0c34 + /* [ bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PUSH @vk_delta + bls12_381_g2 + 0x10c6d5cdca84fc3c7f33061add256f48e0ab03a697832b338901898b650419eb6f334b28153fb73ad2ecd1cd2ac67053161e9f46cfbdaf7b1132a4654a55162850249650f9b873ac3113fa8c02ef1cd1df481480a4457f351d28f4da89d19fa405c3d77f686dc9a24d2681c9184bf2b091f62e6b24df651a3da8bd7067e14e7908fb02f8955b84af5081614cb5bc49b416d9edf914fc608c441b3f2eb8b6043736ddb9d4e4d62334a23b5625c14ef3e1a7e99258386310221b22d83a5eac035c + /* [ bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PUSH @vk_gamma + bls12_381_g2 + 0x16dcbd28bff336c2649c7dd1d8391ac7ce6f7ef0124a9db7a4a485a124199eded7ce963c1c18aee1eca9994fe06f192c00e0fb653e1fc737d8d0e2f2f91424ca01f6e6e7c5c04f1c43db03a2900cf6b942aaed6ae77daea6200e094b78c38d770028d531a9d1a118ec23d5a39be7aa6dc28f778da1988856d2235c4a35e81fa48380f050d4baf7ebd7b5e058bf294da916afc34562f097c02a8fcbcf62a00de44f8ae6cfa7acb8ad254e3aeea8b2af12f65b7ee0f54855cb9bd432f3436f238f + /* [ bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PUSH @vk_b + bls12_381_g2 + 0x0e9383f98df2c6e8b5b45f3876c3384596a0cdbc41349f83c4380bf463a050cdbd1d5057aa483a642e66486d1ed7362a1869e423c3877095e215c17282b11108601166f928043254bbce603bf86f4cec9f2e97e9660e98e4f5bce9b2b3bbacb40946b702ccfcc9a31e0bfc1543a2128edcc95807740a2310ae25eb47b935648e392c58dfae5b5e899d3b970d64e4e9e209741ea8bfedcfcc16b3fd890ff02c788ec0943feaaf01bbb354317acb85fcfd611133e4e563d53ca4e0f50e21cf2e7e + /* [ bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + PUSH @vk_a + bls12_381_g1 + 0x1040577c7d349e332735fc947c868c24a665f812f5dc1e7f60e65e2df80be2267a4b7341ed2287285fccd517acd96d910abba947235c364553aa6445f2f2b3a1a728225a330286ba5197ab87f0edc560d89fc7b623812f7d0d633341726e597a + /* [ bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ } + /* [ bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP + /* [ bls12_381_fr : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 12 + /* [ bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_fr : bls12_381_g1 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + MUL + /* [ bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 3 + /* [ bls12_381_fr : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 14 + /* [ bls12_381_g1 : bls12_381_fr : bls12_381_g1 : bls12_381_fr : bls12_381_fr + : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + MUL + /* [ bls12_381_g1 : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + ADD + /* [ bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 11 + /* [ bls12_381_g1 : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + ADD @vk_x + /* [ bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + NIL (pair bls12_381_g1 bls12_381_g2) + /* [ list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 : bls12_381_fr + : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + DUP 9 + /* [ bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 + : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 9 + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + NEG + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PAIR + /* [ pair bls12_381_g1 bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + CONS + /* [ list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 : bls12_381_fr + : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + DUP 11 + /* [ bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 + : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 8 + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + NEG + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PAIR + /* [ pair bls12_381_g1 bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + CONS + /* [ list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 : bls12_381_fr + : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + DUP 10 + /* [ bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 + : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 3 + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + NEG + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PAIR + /* [ pair bls12_381_g1 bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + CONS + /* [ list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 : bls12_381_fr + : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + DUP 6 + /* [ bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 + : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 + : bls12_381_g1 : bls12_381_g1 ] */ ; + DUP 6 + /* [ bls12_381_g1 : bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + PAIR + /* [ pair bls12_381_g1 bls12_381_g2 : list (pair bls12_381_g1 bls12_381_g2) + : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + CONS + /* [ list (pair bls12_381_g1 bls12_381_g2) : bls12_381_g1 : bls12_381_fr + : bls12_381_fr : bls12_381_g1 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g2 : bls12_381_g2 : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 + : bls12_381_g1 ] */ ; + PAIRING_CHECK + /* [ bool : bls12_381_g1 : bls12_381_fr : bls12_381_fr : bls12_381_g1 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g2 : bls12_381_g2 + : bls12_381_g2 : bls12_381_g1 : bls12_381_g1 : bls12_381_g1 ] */ ; + ASSERT ; + DROP 13 + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-hardlimit.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-hardlimit.tz.out new file mode 100644 index 000000000000..c987eccd553b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-hardlimit.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/hardlimit.tz --details +Well typed +Gas remaining: 1039992.503 units remaining +{ parameter unit ; + storage int ; + code { CDR + /* [ int ] */ ; + DUP + /* [ int : int ] */ ; + PUSH int 0 + /* [ int : int : int ] */ ; + CMPLT ; + IF { PUSH int -1 /* [ int : int ] */ ; ADD /* [ int ] */ } { FAIL } ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-legacy_multisig.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-legacy_multisig.tz.out new file mode 100644 index 000000000000..650033cc8845 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-legacy_multisig.tz.out @@ -0,0 +1,254 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/legacy_multisig.tz --details +Well typed +Gas remaining: 1039943.391 units remaining +{ parameter + (pair (pair :payload + (nat %counter) + (or :action + (pair :transfer (mutez %amount) (contract %dest unit)) + (or (option %delegate key_hash) + (pair %change_keys (nat %threshold) (list %keys key))))) + (list %sigs (option signature))) ; + storage (pair (nat %stored_counter) (pair (nat %threshold) (list %keys key))) ; + code { UNPAIR + /* [ pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature)) : pair nat nat (list key) ] */ ; + SWAP + /* [ pair nat nat (list key) + : pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature)) ] */ ; + DUP + /* [ pair nat nat (list key) : pair nat nat (list key) + : pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature)) ] */ ; + DIP { SWAP + /* [ pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature)) : pair nat nat (list key) ] */ } + /* [ pair nat nat (list key) + : pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature)) : pair nat nat (list key) ] */ ; + DIP { UNPAIR + /* [ pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + DUP + /* [ pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + SELF + /* [ contract + (pair (pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))))) + (list (option signature))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + ADDRESS + /* [ address + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + CHAIN_ID + /* [ chain_id : address + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + PAIR + /* [ pair chain_id address + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + PAIR + /* [ pair (pair chain_id address) + nat + (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + PACK + /* [ bytes + : pair nat (or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key)))) + : list (option signature) : pair nat nat (list key) ] */ ; + DIP { UNPAIR @counter + /* [ nat + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : list (option signature) : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ nat : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ bytes : nat : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + SWAP + /* [ nat : bytes : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ pair nat nat (list key) : nat : bytes : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + UNPAIR @stored_counter + /* [ nat : pair nat (list key) : nat : bytes : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ nat : pair nat (list key) : bytes : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ nat : nat : pair nat (list key) : bytes : list (option signature) + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + ASSERT_CMPEQ ; + DIP { SWAP + /* [ list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ pair nat (list key) : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + UNPAIR @threshold @keys + /* [ nat : list key : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIP { PUSH @valid + nat + 0 + /* [ nat : list key : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + SWAP + /* [ list key : nat : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + ITER { DIP { SWAP + /* [ list (option signature) : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ key : list (option signature) : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + SWAP + /* [ list (option signature) : key : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + IF_CONS + { IF_SOME + { SWAP + /* [ list (option signature) : signature : key : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIP { SWAP + /* [ key : signature : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIIP { DUUP + /* [ bytes : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ key : signature : bytes : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + { DUUUP + /* [ bytes : key : signature : bytes : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIP { CHECK_SIGNATURE + /* [ bool : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ bytes : bool : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + SWAP + /* [ bool : bytes : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + IF { DROP + /* [ nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + { FAILWITH /* [] */ } } ; + PUSH nat + 1 + /* [ nat : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + ADD @valid + /* [ nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ list (option signature) : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + { SWAP + /* [ key : list (option signature) : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DROP + /* [ list (option signature) : nat : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } } + { FAIL } ; + SWAP + /* [ nat : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ nat : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ } + /* [ nat : nat : list (option signature) : bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + ASSERT_CMPLE ; + DROP + /* [ bytes + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DROP + /* [ or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + DIP { UNPAIR + /* [ nat : pair nat (list key) ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat (list key) ] */ ; + ADD @new_counter + /* [ nat : pair nat (list key) ] */ ; + PAIR + /* [ pair nat nat (list key) ] */ } + /* [ or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + NIL operation + /* [ list operation + : or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : pair nat nat (list key) ] */ ; + SWAP + /* [ or (pair mutez (contract unit)) (or (option key_hash) (pair nat (list key))) + : list operation : pair nat nat (list key) ] */ ; + IF_LEFT + { UNPAIR + /* [ mutez : contract unit : list operation : pair nat nat (list key) ] */ ; + UNIT + /* [ unit : mutez : contract unit : list operation : pair nat nat (list key) ] */ ; + TRANSFER_TOKENS + /* [ operation : list operation : pair nat nat (list key) ] */ ; + CONS + /* [ list operation : pair nat nat (list key) ] */ } + { IF_LEFT + { SET_DELEGATE + /* [ operation : list operation : pair nat nat (list key) ] */ ; + CONS + /* [ list operation : pair nat nat (list key) ] */ } + { DIP { SWAP + /* [ pair nat nat (list key) : list operation ] */ ; + CAR + /* [ nat : list operation ] */ } + /* [ pair nat (list key) : nat : list operation ] */ ; + SWAP + /* [ nat : pair nat (list key) : list operation ] */ ; + PAIR + /* [ pair nat nat (list key) : list operation ] */ ; + SWAP + /* [ list operation : pair nat nat (list key) ] */ } } ; + PAIR + /* [ pair (list operation) nat nat (list key) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lockup.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lockup.tz.out new file mode 100644 index 000000000000..34328c205c89 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lockup.tz.out @@ -0,0 +1,42 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/lockup.tz --details +Well typed +Gas remaining: 1039983.115 units remaining +{ parameter unit ; + storage (pair timestamp (pair mutez address)) ; + code { CDR + /* [ pair timestamp mutez address ] */ ; + DUP + /* [ pair timestamp mutez address : pair timestamp mutez address ] */ ; + CAR + /* [ timestamp : pair timestamp mutez address ] */ ; + NOW + /* [ timestamp : timestamp : pair timestamp mutez address ] */ ; + CMPLT ; + IF { FAIL } { /* [ pair timestamp mutez address ] */ } ; + DUP + /* [ pair timestamp mutez address : pair timestamp mutez address ] */ ; + CDR + /* [ pair mutez address : pair timestamp mutez address ] */ ; + DUP + /* [ pair mutez address : pair mutez address : pair timestamp mutez address ] */ ; + CAR + /* [ mutez : pair mutez address : pair timestamp mutez address ] */ ; + DIP { CDR /* [ address : pair timestamp mutez address ] */ } + /* [ mutez : address : pair timestamp mutez address ] */ ; + DIP { CONTRACT unit + /* [ option (contract unit) : pair timestamp mutez address ] */ ; + ASSERT_SOME } + /* [ mutez : contract unit : pair timestamp mutez address ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair timestamp mutez address ] */ ; + TRANSFER_TOKENS + /* [ operation : pair timestamp mutez address ] */ ; + NIL operation + /* [ list operation : operation : pair timestamp mutez address ] */ ; + SWAP + /* [ operation : list operation : pair timestamp mutez address ] */ ; + CONS + /* [ list operation : pair timestamp mutez address ] */ ; + PAIR + /* [ pair (list operation) timestamp mutez address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lqt_fa12.mligo.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lqt_fa12.mligo.tz.out new file mode 100644 index 000000000000..13e4b44bc44f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-lqt_fa12.mligo.tz.out @@ -0,0 +1,1385 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/lqt_fa12.mligo.tz --details +Well typed +Gas remaining: 1039738.642 units remaining +{ parameter + (or (or (or (pair %approve (address %spender) (nat %value)) + (pair %getAllowance + (pair %request (address %owner) (address %spender)) + (contract %callback nat))) + (or (pair %getBalance (address %owner) (contract %callback nat)) + (pair %getTotalSupply (unit %request) (contract %callback nat)))) + (or (pair %mintOrBurn (int %quantity) (address %target)) + (pair %transfer (address %from) (pair (address %to) (nat %value))))) ; + storage + (pair (big_map %tokens address nat) + (pair (big_map %allowances (pair (address %owner) (address %spender)) nat) + (pair (address %admin) (nat %total_supply)))) ; + code { DUP + /* [ pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + CDR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + PUSH mutez + 0 + /* [ mutez + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + AMOUNT + /* [ mutez : mutez + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + COMPARE + /* [ int + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + NEQ + /* [ bool + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + IF { PUSH string + "DontSendTez" + /* [ string + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } ; + SWAP + /* [ pair (or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat))) + (big_map address nat) + (big_map (pair address address) nat) + address + nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ or (or (or (pair address nat) (pair (pair address address) (contract nat))) + (or (pair address (contract nat)) (pair unit (contract nat)))) + (or (pair int address) (pair address address nat)) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_LEFT + { IF_LEFT + { IF_LEFT + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat ] */ ; + DUG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address nat : pair address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ pair address nat : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SENDER + /* [ address : address : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair address nat : nat : pair address address + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address nat : pair address nat : nat : pair address address + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ pair address nat : nat : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : nat : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GT + /* [ bool : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : bool : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ big_map (pair address address) nat : nat : bool : pair address address + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ big_map (pair address address) nat : big_map (pair address address) nat + : nat : bool : pair address address : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ big_map (pair address address) nat : nat : bool : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair address address : big_map (pair address address) nat : nat : bool + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address : pair address address + : big_map (pair address address) nat : nat : bool + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ pair address address : big_map (pair address address) nat : nat : bool + : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : nat : bool : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : nat : bool : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : nat : bool : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + COMPARE + /* [ int : bool : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GT + /* [ bool : bool : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + AND + /* [ bool : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { PUSH string + "UnsafeAllowanceChange" + /* [ string : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address : big_map (pair address address) nat + : pair address nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address : big_map (pair address address) nat + : pair address nat ] */ ; + DUG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat + : pair address address : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : pair address address + : big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ big_map (pair address address) nat : pair address nat + : pair address address : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair address nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ nat : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ nat : nat : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ nat : nat : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + EQ + /* [ bool : nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { DROP + /* [ big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NONE nat + /* [ option nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { SOME + /* [ option nat : big_map (pair address address) nat : pair address nat + : pair address address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 3 + /* [ pair address address : option nat : big_map (pair address address) nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + UPDATE + /* [ big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (pair address address) (contract nat) ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (pair address address) (contract nat) ] */ ; + DIG 2 + /* [ pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair (pair address address) (contract nat) : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair (pair address address) (contract nat) + : pair (pair address address) (contract nat) : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ pair (pair address address) (contract nat) : list operation + : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ contract nat : list operation : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH mutez + 0 + /* [ mutez : contract nat : list operation + : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : mutez : contract nat : list operation + : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : mutez + : contract nat : list operation : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map (pair address address) nat : mutez : contract nat : list operation + : pair (pair address address) (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair (pair address address) (contract nat) + : big_map (pair address address) nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ pair address address : big_map (pair address address) nat : mutez + : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + TRANSFER_TOKENS + /* [ operation : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CONS + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } } + { IF_LEFT + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address (contract nat) ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address (contract nat) ] */ ; + DIG 2 + /* [ pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair address (contract nat) : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address (contract nat) : pair address (contract nat) : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ pair address (contract nat) : list operation : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ contract nat : list operation : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH mutez + 0 + /* [ mutez : contract nat : list operation : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : mutez : contract nat : list operation : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat : mutez : contract nat : list operation + : pair address (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair address (contract nat) : big_map address nat : mutez : contract nat + : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : big_map address nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + TRANSFER_TOKENS + /* [ operation : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CONS + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair unit (contract nat) ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair unit (contract nat) ] */ ; + DIG 2 + /* [ pair unit (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation : pair unit (contract nat) + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair unit (contract nat) : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH mutez + 0 + /* [ mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : mutez + : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : mutez : contract nat : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + TRANSFER_TOKENS + /* [ operation : list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CONS + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } } } + { IF_LEFT + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair int address ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair int address ] */ ; + DUG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SENDER + /* [ address : address : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NEQ + /* [ bool : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { PUSH string + "OnlyAdmin" + /* [ string : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + FAILWITH + /* [] */ } + { /* [ pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DUP + /* [ pair int address : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : pair int address ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : pair int address ] */ ; + DUG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair int address : big_map address nat : int + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair int address : pair int address : big_map address nat : int + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ pair int address : big_map address nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ address : big_map address nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + ADD + /* [ int : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + ISNAT + /* [ option nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH string + "Cannot burn more than the target's balance." + /* [ string : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + SWAP + /* [ pair int address : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair int address : pair int address : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ pair int address : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ int : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : nat : pair int address ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : nat : pair int address ] */ ; + DUG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : int : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : int : nat + : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : int : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : int : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + ADD + /* [ int : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + ABS + /* [ nat : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat : nat : pair int address ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat : nat : pair int address ] */ ; + DUG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat : nat : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address ] */ ; + CAR + /* [ big_map address nat : pair (big_map (pair address address) nat) address nat + : nat : nat : pair int address ] */ ; + PUSH nat + 0 + /* [ nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address ] */ ; + DIG 4 + /* [ nat : nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ ; + DUP + /* [ nat : nat : nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ ; + DUG 5 + /* [ nat : nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address ] */ ; + COMPARE + /* [ int : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address ] */ ; + EQ + /* [ bool : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat : nat + : pair int address ] */ ; + IF { DIG 3 + /* [ nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ ; + DROP + /* [ big_map address nat : pair (big_map (pair address address) nat) address nat + : nat : pair int address ] */ ; + NONE nat + /* [ option nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ } + { DIG 3 + /* [ nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ ; + SOME + /* [ option nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat + : pair int address ] */ } ; + DIG 4 + /* [ pair int address : option nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat ] */ ; + CDR + /* [ address : option nat : big_map address nat + : pair (big_map (pair address address) nat) address nat : nat ] */ ; + UPDATE + /* [ big_map address nat : pair (big_map (pair address address) nat) address nat + : nat ] */ ; + PAIR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat ] */ ; + DUG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat ] */ ; + DUG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } + { SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address nat ] */ ; + DUG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat : pair address address nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat : pair address address nat ] */ ; + DUG 3 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair address address nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ pair address address nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SENDER + /* [ address : address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + EQ + /* [ bool : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { SWAP + /* [ big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { SENDER + /* [ address : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair address address nat : address : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : address + : big_map address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ pair address address nat : address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ pair address address nat : pair address address : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : pair address address + : big_map address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ pair address address nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 3 + /* [ big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ big_map (pair address address) nat : big_map (pair address address) nat + : nat : pair address address : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ big_map (pair address address) nat : nat : pair address address + : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair address address : big_map (pair address address) nat : nat + : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address : pair address address + : big_map (pair address address) nat : nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ pair address address : big_map (pair address address) nat : nat + : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + SUB + /* [ int : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + ISNAT + /* [ option nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH string + "NotEnoughAllowance" + /* [ string : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : pair address address : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 3 + /* [ big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ nat : nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ nat : nat : nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ nat : nat : big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + EQ + /* [ bool : big_map (pair address address) nat : nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { SWAP + /* [ nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DROP + /* [ big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NONE nat + /* [ option nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { SWAP + /* [ nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SOME + /* [ option nat : big_map (pair address address) nat : pair address address + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 2 + /* [ pair address address : option nat : big_map (pair address address) nat + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + UPDATE + /* [ big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 2 + /* [ pair address address nat : big_map (pair address address) nat + : big_map address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat + : big_map (pair address address) nat : big_map address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ pair address address nat : big_map (pair address address) nat + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ big_map address nat : big_map address nat : nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ big_map address nat : nat : big_map (pair address address) nat + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair address address nat : big_map address nat : nat + : big_map (pair address address) nat : big_map address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : big_map address nat + : nat : big_map (pair address address) nat : big_map address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 5 + /* [ pair address address nat : big_map address nat : nat + : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : big_map address nat : nat : big_map (pair address address) nat + : big_map address nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + SUB + /* [ int : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + ISNAT + /* [ option nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH string + "NotEnoughBalance" + /* [ string : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + FAILWITH + /* [] */ } + { /* [ nat : big_map (pair address address) nat : big_map address nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 2 + /* [ big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ nat : nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ nat : nat : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + EQ + /* [ bool : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { SWAP + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DROP + /* [ big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NONE nat + /* [ option nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { SWAP + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SOME + /* [ option nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 3 + /* [ pair address address nat : option nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : option nat + : big_map address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 4 + /* [ pair address address nat : option nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : option nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + UPDATE + /* [ big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair address address nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ pair address address nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ big_map address nat : big_map address nat : nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 2 + /* [ big_map address nat : nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 4 + /* [ pair address address nat : big_map address nat : nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ pair address address nat : pair address address nat : big_map address nat + : nat : big_map address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 5 + /* [ pair address address nat : big_map address nat : nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : big_map address nat : nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : big_map address nat : nat : big_map address nat + : big_map (pair address address) nat : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + GET + /* [ option nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF_NONE + { PUSH nat + 0 + /* [ nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { /* [ nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + ADD + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PUSH nat + 0 + /* [ nat : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUP + /* [ nat : nat : nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DUG 3 + /* [ nat : nat : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + COMPARE + /* [ int : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + EQ + /* [ bool : big_map address nat : nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + IF { SWAP + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DROP + /* [ big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NONE nat + /* [ option nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } + { SWAP + /* [ nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SOME + /* [ option nat : big_map address nat : big_map (pair address address) nat + : pair address address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ } ; + DIG 3 + /* [ pair address address nat : option nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CDR + /* [ pair address nat : option nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ address : option nat : big_map address nat + : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + UPDATE + /* [ big_map address nat : big_map (pair address address) nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + DIG 2 + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map address nat : big_map (pair address address) nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat : big_map address nat + : big_map (pair address address) nat ] */ ; + SWAP + /* [ big_map address nat : pair (big_map (pair address address) nat) address nat + : big_map (pair address address) nat ] */ ; + PAIR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat ] */ ; + DUP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat ] */ ; + CDR + /* [ pair (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat ] */ ; + CDR + /* [ pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat + : big_map (pair address address) nat ] */ ; + DIG 2 + /* [ big_map (pair address address) nat : pair address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map (pair address address) nat) address nat + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + SWAP + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + CAR + /* [ big_map address nat + : pair (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + NIL operation + /* [ list operation + : pair (big_map address nat) (big_map (pair address address) nat) address nat ] */ ; + PAIR + /* [ pair (list operation) + (big_map address nat) + (big_map (pair address address) nat) + address + nat ] */ } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_en2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_en2.tz.out new file mode 100644 index 000000000000..8dd40ce36be4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_en2.tz.out @@ -0,0 +1,165 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/multiple_en2.tz --details +Well typed +Gas remaining: 1039928.052 units remaining +{ parameter unit ; + storage (option address) ; + code { SENDER + /* [ address : pair unit (option address) ] */ ; + SELF + /* [ contract unit : address : pair unit (option address) ] */ ; + ADDRESS + /* [ address : address : pair unit (option address) ] */ ; + { /* [ pair (or (or nat nat) unit) int ] */ + COMPARE + /* [ mutez : mutez : pair (or (or nat nat) unit) int ] */ ; + EQ + /* [ bool : pair unit (option address) ] */ ; + IF { CDR + /* [ option address ] */ ; + { /* [ mutez : mutez : pair (or (or nat nat) unit) int ] */ + IF_NONE + { { /* [ pair (or (or nat nat) unit) int ] */ UNIT /* [ unit ] */ ; FAILWITH /* [] */ } } + { /* [ pair (or (or nat nat) unit) int ] */ } + /* [ bool : pair (or (or nat nat) unit) int ] */ } ; + DIP { NIL operation + /* [ pair (or (or nat nat) unit) int : pair (or (or nat nat) unit) int ] */ + /* [ list operation ] */ } + /* [] */ ; + DUP + /* [ or (or nat nat) unit : pair (or (or nat nat) unit) int ] */ ; + CONTRACT %add unit + /* [ or (or nat nat) unit : int ] */ ; + { /* [ pair (or (or nat nat) unit) int ] */ + IF_NONE + { /* [ address : list operation ] */ } + { { UNIT /* [ int ] */ ; FAILWITH /* [] */ } } } ; + DUP + /* [ int : nat ] */ ; + CONTRACT %fact nat + /* [ int ] */ ; + { /* [ unit : int ] */ + IF_NONE { /* [] */ } { { UNIT /* [ list operation : int ] */ ; FAILWITH /* [] */ } } + /* [] */ } ; + DUP + /* [ pair (list operation) int ] */ ; + CONTRACT %add nat + /* [ option (contract nat) : address : list operation ] */ ; + { IF_NONE + { { UNIT /* [ unit : address : list operation ] */ ; FAILWITH /* [] */ } } + { /* [ contract nat : address : list operation ] */ } } ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 12 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT unit + /* [ option (contract unit) : address : list operation ] */ ; + { IF_NONE + { { UNIT /* [ unit : address : list operation ] */ ; FAILWITH /* [] */ } } + { /* [ contract unit : address : list operation ] */ } } ; + PUSH mutez 0 + /* [ mutez : contract unit : address : list operation ] */ ; + PUSH unit Unit + /* [ unit : mutez : contract unit : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %sub nat + /* [ option (contract nat) : address : list operation ] */ ; + { IF_NONE + { { UNIT /* [ unit : address : list operation ] */ ; FAILWITH /* [] */ } } + { /* [ contract nat : address : list operation ] */ } } ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 3 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %add nat + /* [ option (contract nat) : address : list operation ] */ ; + { IF_NONE + { { UNIT /* [ unit : address : list operation ] */ ; FAILWITH /* [] */ } } + { /* [ contract nat : address : list operation ] */ } } ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 5 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DROP + /* [ list operation ] */ ; + DIP { NONE address /* [ option address ] */ } + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } + { CAR + /* [ unit ] */ ; + DUP + /* [ unit : unit ] */ ; + DIP { DIP { PUSH int 0 + /* [ int ] */ ; + PUSH mutez 0 + /* [ mutez : int ] */ ; + NONE key_hash + /* [ option key_hash : mutez : int ] */ } + /* [ unit : option key_hash : mutez : int ] */ ; + DROP + /* [ option key_hash : mutez : int ] */ ; + CREATE_CONTRACT + { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; + storage int ; + code { AMOUNT ; + PUSH mutez 0 ; + { { COMPARE ; EQ } ; IF {} { { UNIT ; FAILWITH } } } ; + { { DUP ; CAR ; DIP { CDR } } } ; + IF_LEFT + { IF_LEFT { ADD } { SWAP ; SUB } } + { DROP ; DROP ; PUSH int 0 } ; + NIL operation ; + PAIR } } + /* [ operation : address ] */ } + /* [ unit : operation : address ] */ ; + DIP { SELF + /* [ contract unit : operation : address ] */ ; + PUSH mutez 0 + /* [ mutez : contract unit : operation : address ] */ } + /* [ unit : mutez : contract unit : operation : address ] */ ; + TRANSFER_TOKENS + /* [ operation : operation : address ] */ ; + NIL operation + /* [ list operation : operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : operation : address ] */ ; + CONS + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + DIP { SOME /* [ option address ] */ } + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_entrypoints_counte.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_entrypoints_counte.out new file mode 100644 index 000000000000..afa9a516c454 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-multiple_entrypoints_counte.out @@ -0,0 +1,148 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/multiple_entrypoints_counter.tz --details +Well typed +Gas remaining: 1039930.762 units remaining +{ parameter unit ; + storage (option address) ; + code { SENDER + /* [ address : pair unit (option address) ] */ ; + SELF + /* [ contract unit : address : pair unit (option address) ] */ ; + ADDRESS + /* [ address : address : pair unit (option address) ] */ ; + IFCMPEQ + { CDR + /* [ option address ] */ ; + ASSERT_SOME + /* [ int : pair (or (or nat nat) unit) int ] */ ; + DIP { /* [ pair (or (or nat nat) unit) int ] */ NIL operation /* [ list operation ] */ } + /* [] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %add + unit + /* [ int ] */ + /* [ option (contract unit) : address : list operation ] */ ; + ASSERT_NONE ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %fact + nat + /* [ list operation : int ] */ + /* [ option (contract nat) : address : list operation ] */ ; + ASSERT_NONE ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %add nat + /* [ option (contract nat) : address : list operation ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 12 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT unit + /* [ option (contract unit) : address : list operation ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract unit : address : list operation ] */ ; + PUSH unit Unit + /* [ unit : mutez : contract unit : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %sub nat + /* [ option (contract nat) : address : list operation ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 3 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DUP + /* [ address : address : list operation ] */ ; + CONTRACT %add nat + /* [ option (contract nat) : address : list operation ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract nat : address : list operation ] */ ; + PUSH nat 5 + /* [ nat : mutez : contract nat : address : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : address : list operation ] */ ; + SWAP + /* [ address : operation : list operation ] */ ; + DIP { CONS /* [ list operation ] */ } + /* [ address : list operation ] */ ; + DROP + /* [ list operation ] */ ; + DIP { NONE address /* [ option address ] */ } + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } + { CAR + /* [ unit ] */ ; + DUP + /* [ unit : unit ] */ ; + DIP { DIP { PUSH int 0 + /* [ int ] */ ; + PUSH mutez 0 + /* [ mutez : int ] */ ; + NONE key_hash + /* [ option key_hash : mutez : int ] */ } + /* [ unit : option key_hash : mutez : int ] */ ; + DROP + /* [ option key_hash : mutez : int ] */ ; + CREATE_CONTRACT + { parameter (or (or (nat %add) (nat %sub)) (unit %default)) ; + storage int ; + code { AMOUNT ; + PUSH mutez 0 ; + ASSERT_CMPEQ ; + UNPAIR ; + IF_LEFT + { IF_LEFT { ADD } { SWAP ; SUB } } + { DROP ; DROP ; PUSH int 0 } ; + NIL operation ; + PAIR } } + /* [ operation : address ] */ } + /* [ unit : operation : address ] */ ; + DIP { SELF + /* [ contract unit : operation : address ] */ ; + PUSH mutez 0 + /* [ mutez : contract unit : operation : address ] */ } + /* [ unit : mutez : contract unit : operation : address ] */ ; + TRANSFER_TOKENS + /* [ operation : operation : address ] */ ; + NIL operation + /* [ list operation : operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : operation : address ] */ ; + CONS + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + DIP { SOME /* [ option address ] */ } + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } + /* [ mutez : pair (or (or nat nat) unit) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-originate_contract.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-originate_contract.tz.out new file mode 100644 index 000000000000..a2c0bde0f52a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-originate_contract.tz.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/originate_contract.tz --details +Well typed +Gas remaining: 1039991.040 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [ unit ] */ ; + UNIT + /* [ list operation : unit ] */ ; + AMOUNT + /* [ mutez : unit ] */ ; + NONE key_hash + /* [ pair (list operation) unit ] */ ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + DIP { DROP + /* [] */ ; + PUSH unit Unit + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ } + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-parameterized_multisig.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-parameterized_multisig.tz.out new file mode 100644 index 000000000000..4e75017a9e1f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-parameterized_multisig.tz.out @@ -0,0 +1,166 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/parameterized_multisig.tz --details +Well typed +Gas remaining: 1039940.583 units remaining +{ storage (pair bool (pair (map nat (pair bool bool)) (pair key key))) ; + parameter (or nat (pair signature nat)) ; + code { DUP + /* [ pair (or nat (pair signature nat)) bool (map nat (pair bool bool)) key key + : pair (or nat (pair signature nat)) bool (map nat (pair bool bool)) key key ] */ ; + CAR + /* [ or nat (pair signature nat) + : pair (or nat (pair signature nat)) bool (map nat (pair bool bool)) key key ] */ ; + DIP { CDDR } + /* [ or nat (pair signature nat) : pair (map nat (pair bool bool)) key key ] */ ; + IF_LEFT + { DIP { DUP + /* [ pair (map nat (pair bool bool)) key key + : pair (map nat (pair bool bool)) key key ] */ ; + CAR + /* [ map nat (pair bool bool) : pair (map nat (pair bool bool)) key key ] */ } + /* [ nat : map nat (pair bool bool) : pair (map nat (pair bool bool)) key key ] */ ; + GET + /* [ option (pair bool bool) : pair (map nat (pair bool bool)) key key ] */ ; + IF_NONE + { PUSH bool False /* [ bool : pair (map nat (pair bool bool)) key key ] */ } + { DUP + /* [ pair bool bool : pair bool bool : pair (map nat (pair bool bool)) key key ] */ ; + CAR + /* [ bool : pair bool bool : pair (map nat (pair bool bool)) key key ] */ ; + DIP { CDR /* [ bool : pair (map nat (pair bool bool)) key key ] */ } + /* [ bool : bool : pair (map nat (pair bool bool)) key key ] */ ; + AND + /* [ bool : pair (map nat (pair bool bool)) key key ] */ } ; + PAIR + /* [ pair bool (map nat (pair bool bool)) key key ] */ } + { DUP + /* [ pair signature nat : pair signature nat + : pair (map nat (pair bool bool)) key key ] */ ; + CAR + /* [ signature : pair signature nat : pair (map nat (pair bool bool)) key key ] */ ; + DIP { CDR + /* [ nat : pair (map nat (pair bool bool)) key key ] */ ; + DUP + /* [ nat : nat : pair (map nat (pair bool bool)) key key ] */ ; + PACK + /* [ bytes : nat : pair (map nat (pair bool bool)) key key ] */ ; + BLAKE2B + /* [ bytes : nat : pair (map nat (pair bool bool)) key key ] */ } + /* [ signature : bytes : nat : pair (map nat (pair bool bool)) key key ] */ ; + PAIR + /* [ pair signature bytes : nat : pair (map nat (pair bool bool)) key key ] */ ; + SWAP + /* [ nat : pair signature bytes : pair (map nat (pair bool bool)) key key ] */ ; + DIP { DIP { DUP + /* [ pair (map nat (pair bool bool)) key key + : pair (map nat (pair bool bool)) key key ] */ ; + CDR + /* [ pair key key : pair (map nat (pair bool bool)) key key ] */ ; + DIP { CAR /* [ map nat (pair bool bool) ] */ } + /* [ pair key key : map nat (pair bool bool) ] */ ; + DUP + /* [ pair key key : pair key key : map nat (pair bool bool) ] */ } + /* [ pair signature bytes : pair key key : pair key key + : map nat (pair bool bool) ] */ ; + SWAP + /* [ pair key key : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ ; + CAR + /* [ key : pair signature bytes : pair key key : map nat (pair bool bool) ] */ ; + DIP { DUP + /* [ pair signature bytes : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ ; + UNPAIR + /* [ signature : bytes : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ } + /* [ key : signature : bytes : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ ; + CHECK_SIGNATURE + /* [ bool : pair signature bytes : pair key key : map nat (pair bool bool) ] */ } + /* [ nat : bool : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ ; + SWAP + /* [ bool : nat : pair signature bytes : pair key key + : map nat (pair bool bool) ] */ ; + IF { DIP { DROP + /* [ pair key key : map nat (pair bool bool) ] */ ; + SWAP + /* [ map nat (pair bool bool) : pair key key ] */ ; + DUP + /* [ map nat (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + /* [ nat : map nat (pair bool bool) : map nat (pair bool bool) : pair key key ] */ ; + DUP + /* [ nat : nat : map nat (pair bool bool) : map nat (pair bool bool) + : pair key key ] */ ; + DIP { GET + /* [ option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ ; + IF_NONE + { PUSH (pair bool bool) + (Pair False False) + /* [ pair bool bool : map nat (pair bool bool) : pair key key ] */ } + { /* [ pair bool bool : map nat (pair bool bool) : pair key key ] */ } ; + CDR + /* [ bool : map nat (pair bool bool) : pair key key ] */ ; + PUSH bool True + /* [ bool : bool : map nat (pair bool bool) : pair key key ] */ ; + PAIR + /* [ pair bool bool : map nat (pair bool bool) : pair key key ] */ ; + SOME + /* [ option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + /* [ nat : option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + { DIP { DIP { DUP + /* [ pair key key : pair key key : map nat (pair bool bool) ] */ ; + CDR + /* [ key : pair key key : map nat (pair bool bool) ] */ } + /* [ pair signature bytes : key : pair key key : map nat (pair bool bool) ] */ ; + SWAP + /* [ key : pair signature bytes : pair key key : map nat (pair bool bool) ] */ ; + DIP { UNPAIR /* [ signature : bytes : pair key key : map nat (pair bool bool) ] */ } + /* [ key : signature : bytes : pair key key : map nat (pair bool bool) ] */ ; + CHECK_SIGNATURE + /* [ bool : pair key key : map nat (pair bool bool) ] */ } + /* [ nat : bool : pair key key : map nat (pair bool bool) ] */ ; + SWAP + /* [ bool : nat : pair key key : map nat (pair bool bool) ] */ ; + IF { DUP + /* [ nat : nat : pair key key : map nat (pair bool bool) ] */ ; + DIP { DIP { SWAP + /* [ map nat (pair bool bool) : pair key key ] */ ; + DUP + /* [ map nat (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + /* [ nat : map nat (pair bool bool) : map nat (pair bool bool) : pair key key ] */ ; + GET + /* [ option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + /* [ nat : option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ ; + SWAP + /* [ option (pair bool bool) : nat : map nat (pair bool bool) : pair key key ] */ ; + IF_NONE + { PUSH (pair bool bool) + (Pair False False) + /* [ pair bool bool : nat : map nat (pair bool bool) : pair key key ] */ } + { /* [ pair bool bool : nat : map nat (pair bool bool) : pair key key ] */ } ; + CAR + /* [ bool : nat : map nat (pair bool bool) : pair key key ] */ ; + PUSH bool True + /* [ bool : bool : nat : map nat (pair bool bool) : pair key key ] */ ; + SWAP + /* [ bool : bool : nat : map nat (pair bool bool) : pair key key ] */ ; + PAIR + /* [ pair bool bool : nat : map nat (pair bool bool) : pair key key ] */ ; + SOME + /* [ option (pair bool bool) : nat : map nat (pair bool bool) : pair key key ] */ ; + SWAP + /* [ nat : option (pair bool bool) : map nat (pair bool bool) : pair key key ] */ } + { FAIL } } ; + UPDATE + /* [ map nat (pair bool bool) : pair key key ] */ ; + PAIR + /* [ pair (map nat (pair bool bool)) key key ] */ ; + PUSH bool False + /* [ bool : pair (map nat (pair bool bool)) key key ] */ ; + PAIR + /* [ pair bool (map nat (pair bool bool)) key key ] */ } ; + NIL operation + /* [ list operation : pair bool (map nat (pair bool bool)) key key ] */ ; + PAIR + /* [ pair (list operation) bool (map nat (pair bool bool)) key key ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-receive_tickets_in_big_map..out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-receive_tickets_in_big_map..out new file mode 100644 index 000000000000..8858d8a3ec44 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-receive_tickets_in_big_map..out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/receive_tickets_in_big_map.tz --details +Well typed +Gas remaining: 1039997.029 units remaining +{ parameter (big_map int (ticket string)) ; + storage (big_map int (ticket string)) ; + code { CAR + /* [ big_map int (ticket string) ] */ ; + NIL operation + /* [ list operation : big_map int (ticket string) ] */ ; + PAIR + /* [ pair (list operation) (big_map int (ticket string)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-replay.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-replay.tz.out new file mode 100644 index 000000000000..517a758773e6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-replay.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/replay.tz --details +Well typed +Gas remaining: 1039990.860 units remaining +{ parameter unit ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + SOURCE + /* [ address : list operation : unit ] */ ; + CONTRACT unit + /* [ option (contract unit) : list operation : unit ] */ ; + ASSERT_SOME ; + PUSH mutez 1 + /* [ mutez : contract unit : list operation : unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : list operation : unit ] */ ; + TRANSFER_TOKENS + /* [ operation : list operation : unit ] */ ; + DUP + /* [ operation : operation : list operation : unit ] */ ; + DIP { CONS /* [ list operation : unit ] */ } + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-reveal_signed_preimage.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-reveal_signed_preimage.tz.out new file mode 100644 index 000000000000..572423f437f4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-reveal_signed_preimage.tz.out @@ -0,0 +1,63 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/reveal_signed_preimage.tz --details +Well typed +Gas remaining: 1039978.896 units remaining +{ parameter (pair bytes signature) ; + storage (pair bytes key) ; + code { DUP + /* [ pair (pair bytes signature) bytes key + : pair (pair bytes signature) bytes key ] */ ; + UNPAIR + /* [ pair bytes signature : pair bytes key + : pair (pair bytes signature) bytes key ] */ ; + CAR + /* [ bytes : pair bytes key : pair (pair bytes signature) bytes key ] */ ; + SHA256 + /* [ bytes : pair bytes key : pair (pair bytes signature) bytes key ] */ ; + DIP { CAR /* [ bytes : pair (pair bytes signature) bytes key ] */ } + /* [ bytes : bytes : pair (pair bytes signature) bytes key ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (pair bytes signature) bytes key + : pair (pair bytes signature) bytes key ] */ ; + UNPAIR + /* [ pair bytes signature : pair bytes key + : pair (pair bytes signature) bytes key ] */ ; + SWAP + /* [ pair bytes key : pair bytes signature + : pair (pair bytes signature) bytes key ] */ ; + DIP { UNPAIR + /* [ bytes : signature : pair (pair bytes signature) bytes key ] */ ; + SWAP + /* [ signature : bytes : pair (pair bytes signature) bytes key ] */ } + /* [ pair bytes key : signature : bytes + : pair (pair bytes signature) bytes key ] */ ; + CDR + /* [ key : signature : bytes : pair (pair bytes signature) bytes key ] */ ; + CHECK_SIGNATURE + /* [ bool : pair (pair bytes signature) bytes key ] */ ; + ASSERT ; + CDR + /* [ pair bytes key ] */ ; + DUP + /* [ pair bytes key : pair bytes key ] */ ; + CDR + /* [ key : pair bytes key ] */ ; + HASH_KEY + /* [ key_hash : pair bytes key ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : pair bytes key ] */ ; + BALANCE + /* [ mutez : contract unit : pair bytes key ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair bytes key ] */ ; + TRANSFER_TOKENS + /* [ operation : pair bytes key ] */ ; + NIL operation + /* [ list operation : operation : pair bytes key ] */ ; + SWAP + /* [ operation : list operation : pair bytes key ] */ ; + CONS + /* [ list operation : pair bytes key ] */ ; + PAIR + /* [ pair (list operation) bytes key ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_receiver.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_receiver.tz.out new file mode 100644 index 000000000000..5a22e41219ee --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_receiver.tz.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/self_address_receiver.tz --details +Well typed +Gas remaining: 1039992.799 units remaining +{ parameter (lambda unit address) ; + storage unit ; + code { UNPAIR + /* [ lambda unit address : unit ] */ ; + UNIT + /* [ unit : lambda unit address : unit ] */ ; + EXEC + /* [ address : unit ] */ ; + SELF_ADDRESS + /* [ address : address : unit ] */ ; + ASSERT_CMPEQ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_sender.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_sender.tz.out new file mode 100644 index 000000000000..2a97f980f656 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-self_address_sender.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/self_address_sender.tz --details +Well typed +Gas remaining: 1039993.319 units remaining +{ parameter (contract (lambda unit address)) ; + storage unit ; + code { CAR + /* [ contract (lambda unit address) ] */ ; + BALANCE + /* [ mutez : contract (lambda unit address) ] */ ; + LAMBDA + unit + address + { DROP /* [] */ ; SELF_ADDRESS /* [ address ] */ } + /* [ lambda unit address : mutez : contract (lambda unit address) ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + DIP { UNIT /* [ unit ] */ ; NIL operation /* [ list operation : unit ] */ } + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-send_tickets_in_big_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-send_tickets_in_big_map.tz.out new file mode 100644 index 000000000000..0cc048702663 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-send_tickets_in_big_map.tz.out @@ -0,0 +1,133 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/send_tickets_in_big_map.tz --details +Well typed +Gas remaining: 1039967.113 units remaining +{ parameter address ; + storage unit ; + code { CAR + /* [ address ] */ ; + CONTRACT + (big_map int (ticket string)) + /* [ option (contract (big_map int (ticket string))) ] */ ; + IF_NONE + { PUSH string "Contract of type `big_map(ticket(string))` not found" + /* [ string ] */ ; + FAILWITH + /* [] */ } + { EMPTY_BIG_MAP + int + (ticket string) + /* [ big_map int (ticket string) : contract (big_map int (ticket string)) ] */ ; + PUSH int + 100 + /* [ int : big_map int (ticket string) + : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + PAIR + /* [ pair (big_map int (ticket string)) int + : contract (big_map int (ticket string)) ] */ ; + LEFT (big_map int (ticket string)) + /* [ or (pair (big_map int (ticket string)) int) (big_map int (ticket string)) + : contract (big_map int (ticket string)) ] */ ; + LOOP_LEFT + { UNPAIR + /* [ big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ int : big_map int (ticket string) + : contract (big_map int (ticket string)) ] */ ; + DUP + /* [ int : int : big_map int (ticket string) + : contract (big_map int (ticket string)) ] */ ; + DUG 2 + /* [ int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + PUSH int + 0 + /* [ int : int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + COMPARE + /* [ int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + LT + /* [ bool : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + IF { PUSH int + 1 + /* [ int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + DUP 3 + /* [ int : int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SUB + /* [ int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ big_map int (ticket string) : int : int + : contract (big_map int (ticket string)) ] */ ; + PUSH nat + 1 + /* [ nat : big_map int (ticket string) : int : int + : contract (big_map int (ticket string)) ] */ ; + PUSH string + "BLUE" + /* [ string : nat : big_map int (ticket string) : int : int + : contract (big_map int (ticket string)) ] */ ; + TICKET + /* [ option (ticket string) : big_map int (ticket string) : int : int + : contract (big_map int (ticket string)) ] */ ; + ASSERT_SOME ; + DIG 3 + /* [ int : ticket string : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ ticket string : int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SOME + /* [ option (ticket string) : int : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ int : option (ticket string) : big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + UPDATE + /* [ big_map int (ticket string) : int + : contract (big_map int (ticket string)) ] */ ; + PAIR + /* [ pair (big_map int (ticket string)) int + : contract (big_map int (ticket string)) ] */ ; + LEFT (big_map int (ticket string)) + /* [ or (pair (big_map int (ticket string)) int) (big_map int (ticket string)) + : contract (big_map int (ticket string)) ] */ } + { SWAP + /* [ int : big_map int (ticket string) + : contract (big_map int (ticket string)) ] */ ; + DROP + /* [ big_map int (ticket string) : contract (big_map int (ticket string)) ] */ ; + RIGHT + (pair (big_map int (ticket string)) int) + /* [ or (pair (big_map int (ticket string)) int) (big_map int (ticket string)) + : contract (big_map int (ticket string)) ] */ } } + /* [ big_map int (ticket string) : contract (big_map int (ticket string)) ] */ ; + SWAP + /* [ contract (big_map int (ticket string)) : big_map int (ticket string) ] */ ; + PUSH mutez + 0 + /* [ mutez : contract (big_map int (ticket string)) + : big_map int (ticket string) ] */ ; + DIG 2 + /* [ big_map int (ticket string) : mutez + : contract (big_map int (ticket string)) ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + PUSH unit Unit + /* [ unit : operation ] */ ; + NIL operation + /* [ list operation : unit : operation ] */ ; + DIG 2 + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_fungible.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_fungible.tz.out new file mode 100644 index 000000000000..00823dd459c9 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_fungible.tz.out @@ -0,0 +1,58 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/ticket_builder_fungible.tz --details +Well typed +Gas remaining: 1039974.006 units remaining +{ parameter + (or (ticket %burn unit) + (pair %mint (contract %destination (ticket unit)) (nat %amount))) ; + storage address ; + code { AMOUNT + /* [ mutez + : pair (or (ticket unit) (pair (contract (ticket unit)) nat)) address ] */ ; + PUSH mutez + 0 + /* [ mutez : mutez + : pair (or (ticket unit) (pair (contract (ticket unit)) nat)) address ] */ ; + ASSERT_CMPEQ ; + UNPAIR + /* [ or (ticket unit) (pair (contract (ticket unit)) nat) : address ] */ ; + IF_LEFT + { READ_TICKET + /* [ pair address unit nat : ticket unit : address ] */ ; + CAR + /* [ address : ticket unit : address ] */ ; + SELF_ADDRESS + /* [ address : address : ticket unit : address ] */ ; + ASSERT_CMPEQ ; + DROP + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ } + { DUP @manager 2 + /* [ address : pair (contract (ticket unit)) nat : address ] */ ; + SENDER + /* [ address : address : pair (contract (ticket unit)) nat : address ] */ ; + ASSERT_CMPEQ ; + UNPAIR + /* [ contract (ticket unit) : nat : address ] */ ; + SWAP + /* [ nat : contract (ticket unit) : address ] */ ; + UNIT + /* [ unit : nat : contract (ticket unit) : address ] */ ; + TICKET + /* [ option (ticket unit) : contract (ticket unit) : address ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : ticket unit : contract (ticket unit) : address ] */ ; + SWAP + /* [ ticket unit : mutez : contract (ticket unit) : address ] */ ; + TRANSFER_TOKENS + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ } ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_non_fungible.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_non_fungible.out new file mode 100644 index 000000000000..8346022d831f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_builder_non_fungible.out @@ -0,0 +1,56 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/ticket_builder_non_fungible.tz --details +Well typed +Gas remaining: 1039971.519 units remaining +{ parameter (or (ticket %burn nat) (contract %mint_destination (ticket nat))) ; + storage (pair (address %manager) (nat %counter)) ; + code { AMOUNT + /* [ mutez : pair (or (ticket nat) (contract (ticket nat))) address nat ] */ ; + PUSH mutez + 0 + /* [ mutez : mutez + : pair (or (ticket nat) (contract (ticket nat))) address nat ] */ ; + ASSERT_CMPEQ ; + UNPAIR 3 + /* [ or (ticket nat) (contract (ticket nat)) : address : nat ] */ ; + IF_LEFT + { READ_TICKET + /* [ pair address nat nat : ticket nat : address : nat ] */ ; + CAR + /* [ address : ticket nat : address : nat ] */ ; + SELF_ADDRESS + /* [ address : address : ticket nat : address : nat ] */ ; + ASSERT_CMPEQ ; + DROP + /* [ address : nat ] */ ; + NIL operation + /* [ list operation : address : nat ] */ } + { DUP @manager 2 + /* [ address : contract (ticket nat) : address : nat ] */ ; + SENDER + /* [ address : address : contract (ticket nat) : address : nat ] */ ; + ASSERT_CMPEQ ; + PUSH @amount nat 1 + /* [ nat : contract (ticket nat) : address : nat ] */ ; + DUP @counter 4 + /* [ nat : nat : contract (ticket nat) : address : nat ] */ ; + TICKET + /* [ option (ticket nat) : contract (ticket nat) : address : nat ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : ticket nat : contract (ticket nat) : address : nat ] */ ; + SWAP + /* [ ticket nat : mutez : contract (ticket nat) : address : nat ] */ ; + TRANSFER_TOKENS + /* [ operation : address : nat ] */ ; + NIL operation + /* [ list operation : operation : address : nat ] */ ; + SWAP + /* [ operation : list operation : address : nat ] */ ; + CONS + /* [ list operation : address : nat ] */ ; + DIP 2 + { PUSH nat 1 /* [ nat : nat ] */ ; ADD /* [ nat ] */ } + /* [ list operation : address : nat ] */ } ; + PAIR 3 + /* [ pair (list operation) address nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_fungible.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_fungible.tz.out new file mode 100644 index 000000000000..0cb811df3d74 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_fungible.tz.out @@ -0,0 +1,194 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/ticket_wallet_fungible.tz --details +Well typed +Gas remaining: 1039937.454 units remaining +{ parameter + (or (ticket %receive unit) + (pair %send (contract %destination (ticket unit)) (nat %amount) (address %ticketer))) ; + storage (pair (address %manager) (big_map %tickets address (ticket unit))) ; + code { AMOUNT + /* [ mutez + : pair (or (ticket unit) (pair (contract (ticket unit)) nat address)) + address + (big_map address (ticket unit)) ] */ ; + PUSH mutez + 0 + /* [ mutez : mutez + : pair (or (ticket unit) (pair (contract (ticket unit)) nat address)) + address + (big_map address (ticket unit)) ] */ ; + ASSERT_CMPEQ ; + UNPAIR + 3 + /* [ or (ticket unit) (pair (contract (ticket unit)) nat address) : address + : big_map address (ticket unit) ] */ ; + IF_LEFT + { READ_TICKET + /* [ pair address unit nat : ticket unit : address + : big_map address (ticket unit) ] */ ; + CAR @ticketer + /* [ address : ticket unit : address : big_map address (ticket unit) ] */ ; + DUP + /* [ address : address : ticket unit : address : big_map address (ticket unit) ] */ ; + DIG 4 + /* [ big_map address (ticket unit) : address : address : ticket unit : address ] */ ; + NONE (ticket unit) + /* [ option (ticket unit) : big_map address (ticket unit) : address : address + : ticket unit : address ] */ ; + DIG 2 + /* [ address : option (ticket unit) : big_map address (ticket unit) : address + : ticket unit : address ] */ ; + GET_AND_UPDATE + /* [ option (ticket unit) : big_map address (ticket unit) : address + : ticket unit : address ] */ ; + IF_SOME + { DIG 3 + /* [ ticket unit : ticket unit : big_map address (ticket unit) : address + : address ] */ ; + PAIR + /* [ pair (ticket unit) (ticket unit) : big_map address (ticket unit) : address + : address ] */ ; + JOIN_TICKETS + /* [ option (ticket unit) : big_map address (ticket unit) : address : address ] */ ; + ASSERT_SOME } + { DIG 2 + /* [ ticket unit : big_map address (ticket unit) : address : address ] */ } ; + SOME + /* [ option (ticket unit) : big_map address (ticket unit) : address : address ] */ ; + DIG 2 + /* [ address : option (ticket unit) : big_map address (ticket unit) : address ] */ ; + GET_AND_UPDATE + /* [ option (ticket unit) : big_map address (ticket unit) : address ] */ ; + ASSERT_NONE ; + SWAP + /* [ address : big_map address (ticket unit) ] */ ; + PAIR + /* [ pair address (big_map address (ticket unit)) ] */ ; + NIL operation + /* [ list operation : pair address (big_map address (ticket unit)) ] */ } + { DUP @manager + 2 + /* [ address : pair (contract (ticket unit)) nat address : address + : big_map address (ticket unit) ] */ ; + SENDER + /* [ address : address : pair (contract (ticket unit)) nat address : address + : big_map address (ticket unit) ] */ ; + ASSERT_CMPEQ ; + UNPAIR + 3 + /* [ contract (ticket unit) : nat : address : address + : big_map address (ticket unit) ] */ ; + DIG 4 + /* [ big_map address (ticket unit) : contract (ticket unit) : nat : address + : address ] */ ; + NONE (ticket unit) + /* [ option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + DUP @ticketer + 5 + /* [ address : option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + GET_AND_UPDATE + /* [ option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + ASSERT_SOME ; + READ_TICKET + /* [ pair address unit nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + GET @total_amount + 4 + /* [ nat : ticket unit : big_map address (ticket unit) : contract (ticket unit) + : nat : address : address ] */ ; + DUP @amount + 5 + /* [ nat : nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + SWAP + /* [ nat : nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + SUB + /* [ int : ticket unit : big_map address (ticket unit) : contract (ticket unit) + : nat : address : address ] */ ; + DUP + /* [ int : int : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + EQ + /* [ bool : int : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + IF { DROP + /* [ ticket unit : big_map address (ticket unit) : contract (ticket unit) : nat + : address : address ] */ ; + DIG 3 + /* [ nat : ticket unit : big_map address (ticket unit) : contract (ticket unit) + : address : address ] */ ; + DROP + /* [ ticket unit : big_map address (ticket unit) : contract (ticket unit) + : address : address ] */ ; + DIG 3 + /* [ address : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : address ] */ ; + DROP + /* [ ticket unit : big_map address (ticket unit) : contract (ticket unit) + : address ] */ ; + DUG 3 + /* [ big_map address (ticket unit) : contract (ticket unit) : address + : ticket unit ] */ } + { ISNAT + /* [ option nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : nat : address : address ] */ ; + ASSERT_SOME @remaining_amount ; + DIG 4 + /* [ nat : nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : address : address ] */ ; + PAIR + /* [ pair nat nat : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : address : address ] */ ; + SWAP + /* [ ticket unit : pair nat nat : big_map address (ticket unit) + : contract (ticket unit) : address : address ] */ ; + SPLIT_TICKET + /* [ option (pair (ticket unit) (ticket unit)) : big_map address (ticket unit) + : contract (ticket unit) : address : address ] */ ; + ASSERT_SOME ; + UNPAIR @to_send @to_keep + /* [ ticket unit : ticket unit : big_map address (ticket unit) + : contract (ticket unit) : address : address ] */ ; + DUG 5 + /* [ ticket unit : big_map address (ticket unit) : contract (ticket unit) + : address : address : ticket unit ] */ ; + SOME + /* [ option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : address : address : ticket unit ] */ ; + DIG 3 + /* [ address : option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : address : ticket unit ] */ ; + GET_AND_UPDATE + /* [ option (ticket unit) : big_map address (ticket unit) + : contract (ticket unit) : address : ticket unit ] */ ; + ASSERT_NONE } ; + DIG 2 + /* [ address : big_map address (ticket unit) : contract (ticket unit) + : ticket unit ] */ ; + PAIR + /* [ pair address (big_map address (ticket unit)) : contract (ticket unit) + : ticket unit ] */ ; + SWAP + /* [ contract (ticket unit) : pair address (big_map address (ticket unit)) + : ticket unit ] */ ; + PUSH mutez + 0 + /* [ mutez : contract (ticket unit) + : pair address (big_map address (ticket unit)) : ticket unit ] */ ; + DIG 3 + /* [ ticket unit : mutez : contract (ticket unit) + : pair address (big_map address (ticket unit)) ] */ ; + TRANSFER_TOKENS + /* [ operation : pair address (big_map address (ticket unit)) ] */ ; + NIL operation + /* [ list operation : operation : pair address (big_map address (ticket unit)) ] */ ; + SWAP + /* [ operation : list operation : pair address (big_map address (ticket unit)) ] */ ; + CONS + /* [ list operation : pair address (big_map address (ticket unit)) ] */ } ; + PAIR + /* [ pair (list operation) address (big_map address (ticket unit)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_non_fungible..out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_non_fungible..out new file mode 100644 index 000000000000..a6f0c3539112 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-ticket_wallet_non_fungible..out @@ -0,0 +1,116 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/ticket_wallet_non_fungible.tz --details +Well typed +Gas remaining: 1039959.702 units remaining +{ parameter + (or (ticket %receive nat) + (pair %send (contract %destination (ticket nat)) (address %ticketer) (nat %id))) ; + storage (pair (address %manager) (big_map %tickets (pair address nat) (ticket nat))) ; + code { AMOUNT + /* [ mutez + : pair (or (ticket nat) (pair (contract (ticket nat)) address nat)) + address + (big_map (pair address nat) (ticket nat)) ] */ ; + PUSH mutez + 0 + /* [ mutez : mutez + : pair (or (ticket nat) (pair (contract (ticket nat)) address nat)) + address + (big_map (pair address nat) (ticket nat)) ] */ ; + ASSERT_CMPEQ ; + UNPAIR + 3 + /* [ or (ticket nat) (pair (contract (ticket nat)) address nat) : address + : big_map (pair address nat) (ticket nat) ] */ ; + IF_LEFT + { READ_TICKET + /* [ pair address nat nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + CAST (pair (address %ticketer) (nat %id) (nat %amount)) + /* [ pair address nat nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + UNPAIR + 3 + /* [ address : nat : nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + DIG 2 + /* [ nat : address : nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + PUSH nat + 1 + /* [ nat : nat : address : nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + ASSERT_CMPEQ ; + PAIR + /* [ pair address nat : ticket nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + DIP { SOME + /* [ option (ticket nat) : address : big_map (pair address nat) (ticket nat) ] */ ; + DIP { SWAP /* [ big_map (pair address nat) (ticket nat) : address ] */ } + /* [ option (ticket nat) : big_map (pair address nat) (ticket nat) : address ] */ } + /* [ pair address nat : option (ticket nat) + : big_map (pair address nat) (ticket nat) : address ] */ ; + GET_AND_UPDATE + /* [ option (ticket nat) : big_map (pair address nat) (ticket nat) : address ] */ ; + ASSERT_NONE ; + SWAP + /* [ address : big_map (pair address nat) (ticket nat) ] */ ; + PAIR + /* [ pair address (big_map (pair address nat) (ticket nat)) ] */ ; + NIL operation + /* [ list operation : pair address (big_map (pair address nat) (ticket nat)) ] */ } + { DUP @manager + 2 + /* [ address : pair (contract (ticket nat)) address nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + SENDER + /* [ address : address : pair (contract (ticket nat)) address nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + ASSERT_CMPEQ ; + UNPAIR + /* [ contract (ticket nat) : pair address nat : address + : big_map (pair address nat) (ticket nat) ] */ ; + DIG 3 + /* [ big_map (pair address nat) (ticket nat) : contract (ticket nat) + : pair address nat : address ] */ ; + NONE (ticket nat) + /* [ option (ticket nat) : big_map (pair address nat) (ticket nat) + : contract (ticket nat) : pair address nat : address ] */ ; + DIG 3 + /* [ pair address nat : option (ticket nat) + : big_map (pair address nat) (ticket nat) : contract (ticket nat) : address ] */ ; + GET_AND_UPDATE + /* [ option (ticket nat) : big_map (pair address nat) (ticket nat) + : contract (ticket nat) : address ] */ ; + ASSERT_SOME ; + SWAP + /* [ big_map (pair address nat) (ticket nat) : ticket nat + : contract (ticket nat) : address ] */ ; + DIG 3 + /* [ address : big_map (pair address nat) (ticket nat) : ticket nat + : contract (ticket nat) ] */ ; + PAIR + /* [ pair address (big_map (pair address nat) (ticket nat)) : ticket nat + : contract (ticket nat) ] */ ; + DUG 2 + /* [ ticket nat : contract (ticket nat) + : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + PUSH mutez + 0 + /* [ mutez : ticket nat : contract (ticket nat) + : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + SWAP + /* [ ticket nat : mutez : contract (ticket nat) + : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + TRANSFER_TOKENS + /* [ operation : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + NIL operation + /* [ list operation : operation + : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + SWAP + /* [ operation : list operation + : pair address (big_map (pair address nat) (ticket nat)) ] */ ; + CONS + /* [ list operation : pair address (big_map (pair address nat) (ticket nat)) ] */ } ; + PAIR + /* [ pair (list operation) address (big_map (pair address nat) (ticket nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-vote_for_delegate.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-vote_for_delegate.tz.out new file mode 100644 index 000000000000..f59f0b5886c3 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-vote_for_delegate.tz.out @@ -0,0 +1,114 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/vote_for_delegate.tz --details +Well typed +Gas remaining: 1039945.231 units remaining +{ parameter (option key_hash) ; + storage + (pair (pair %mgr1 (address %addr) (option %key key_hash)) + (pair %mgr2 (address %addr) (option %key key_hash))) ; + code { DUP + /* [ pair (option key_hash) (pair address (option key_hash)) address (option key_hash) + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + CDAAR %addr @% ; + SENDER + /* [ address : address + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + PAIR %@ %@ + /* [ pair address address + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + UNPAIR + /* [ address : address + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + IFCMPEQ + { UNPAIR + /* [ option key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SWAP + /* [ pair (pair address (option key_hash)) address (option key_hash) + : option key_hash ] */ ; + SET_CADR %key @changed_mgr1_key } + { DUP + /* [ pair (option key_hash) (pair address (option key_hash)) address (option key_hash) + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + CDDAR ; + SENDER + /* [ address : address + : pair (option key_hash) (pair address (option key_hash)) address (option key_hash) ] */ ; + IFCMPEQ + { UNPAIR + /* [ option key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SWAP + /* [ pair (pair address (option key_hash)) address (option key_hash) + : option key_hash ] */ ; + SET_CDDR %key } + { FAIL } } ; + DUP + /* [ pair (pair address (option key_hash)) address (option key_hash) + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + CADR ; + DIP { DUP + /* [ pair (pair address (option key_hash)) address (option key_hash) + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + CDDR } + /* [ option key_hash : option key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + IF_NONE + { IF_NONE + { NONE key_hash + /* [ option key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SET_DELEGATE + /* [ operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SWAP + /* [ operation : list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + CONS + /* [ list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ } + { DROP + /* [ pair (pair address (option key_hash)) address (option key_hash) ] */ ; + NIL operation + /* [ list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ } } + { SWAP + /* [ option key_hash : key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + IF_SOME + { DIP { DUP + /* [ key_hash : key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ } + /* [ key_hash : key_hash : key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + IFCMPEQ + { SOME + /* [ option key_hash + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SET_DELEGATE + /* [ operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + NIL operation + /* [ list operation : operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + SWAP + /* [ operation : list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ ; + CONS + /* [ list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ } + { DROP + /* [ pair (pair address (option key_hash)) address (option key_hash) ] */ ; + NIL operation + /* [ list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ } } + { DROP + /* [ pair (pair address (option key_hash)) address (option key_hash) ] */ ; + NIL operation + /* [ list operation + : pair (pair address (option key_hash)) address (option key_hash) ] */ } } ; + PAIR + /* [ pair (list operation) (pair address (option key_hash)) address (option key_hash) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-weather_insurance.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-weather_insurance.tz.out new file mode 100644 index 000000000000..24c948d72c4b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-weather_insurance.tz.out @@ -0,0 +1,87 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/weather_insurance.tz --details +Well typed +Gas remaining: 1039963.680 units remaining +{ parameter (pair (signature %signed_weather_data) (nat :rain %actual_level)) ; + storage + (pair (pair (address %under_key) (address %over_key)) + (pair (nat :rain %rain_level) (key %weather_service_key))) ; + code { DUP + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + DUP + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + CAR + /* [ pair signature nat + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + MAP_CDR + { PACK + /* [ bytes : pair signature nat + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + BLAKE2B + /* [ bytes : pair signature nat + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ } ; + SWAP + /* [ pair (pair signature nat) (pair address address) nat key + : pair signature bytes + : pair (pair signature nat) (pair address address) nat key ] */ ; + CDDDR %weather_service_key ; + DIP { UNPAIR + /* [ signature : bytes + : pair (pair signature nat) (pair address address) nat key ] */ } + /* [ key : signature : bytes + : pair (pair signature nat) (pair address address) nat key ] */ ; + CHECK_SIGNATURE @sigok + /* [ bool : pair (pair signature nat) (pair address address) nat key ] */ ; + ASSERT ; + DUP + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + DUP + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + DUP + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key ] */ ; + DIIIP + { CDR %storage /* [ pair (pair address address) nat key ] */ } + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair (pair address address) nat key ] */ ; + DIIP { CDAR } + /* [ pair (pair signature nat) (pair address address) nat key + : pair (pair signature nat) (pair address address) nat key + : pair address address : pair (pair address address) nat key ] */ ; + DIP { CADR %actual_level } + /* [ pair (pair signature nat) (pair address address) nat key : nat + : pair address address : pair (pair address address) nat key ] */ ; + CDDAR %rain_level ; + CMPLT ; + IF { CAR %under_key /* [ address : pair (pair address address) nat key ] */ } + { CDR %over_key /* [ address : pair (pair address address) nat key ] */ } ; + CONTRACT unit + /* [ option (contract unit) : pair (pair address address) nat key ] */ ; + ASSERT_SOME ; + BALANCE + /* [ mutez : contract unit : pair (pair address address) nat key ] */ ; + UNIT + /* [ unit : mutez : contract unit : pair (pair address address) nat key ] */ ; + TRANSFER_TOKENS @trans.op + /* [ operation : pair (pair address address) nat key ] */ ; + NIL operation + /* [ list operation : operation : pair (pair address address) nat key ] */ ; + SWAP + /* [ operation : list operation : pair (pair address address) nat key ] */ ; + CONS + /* [ list operation : pair (pair address address) nat key ] */ ; + PAIR + /* [ pair (list operation) (pair address address) nat key ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat.tz.out new file mode 100644 index 000000000000..f87fed7b1a52 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat.tz.out @@ -0,0 +1,83 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/xcat.tz --details +Well typed +Gas remaining: 1039967.905 units remaining +{ parameter bytes ; + storage unit ; + code { CAR @preimage + /* [ bytes ] */ ; + DIP { PUSH @from key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + /* [ key_hash ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit ] */ ; + PUSH @to + key_hash + "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" + /* [ key_hash : contract unit ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : contract unit ] */ ; + PUSH @target_hash bytes 0x123456 + /* [ bytes : contract unit : contract unit ] */ ; + PUSH @deadline + timestamp + "2018-08-08 00:00:00Z" + /* [ timestamp : bytes : contract unit : contract unit ] */ } + /* [ bytes : timestamp : bytes : contract unit : contract unit ] */ ; + SWAP + /* [ timestamp : bytes : bytes : contract unit : contract unit ] */ ; + NOW + /* [ timestamp : timestamp : bytes : bytes : contract unit : contract unit ] */ ; + IFCMPLT + { DROP + /* [ bytes : contract unit : contract unit ] */ ; + DROP + /* [ contract unit : contract unit ] */ ; + DROP + /* [ contract unit ] */ ; + BALANCE + /* [ mutez : contract unit ] */ ; + UNIT + /* [ unit : mutez : contract unit ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ } + { DUP + /* [ bytes : bytes : bytes : contract unit : contract unit ] */ ; + SIZE + /* [ nat : bytes : bytes : contract unit : contract unit ] */ ; + PUSH @max_length + nat + 32 + /* [ nat : nat : bytes : bytes : contract unit : contract unit ] */ ; + IFCMPLT + { PUSH string + "preimage too long" + /* [ string : bytes : bytes : contract unit : contract unit ] */ ; + FAILWITH + /* [] */ } + { SHA256 @candidate_hash + /* [ bytes : bytes : contract unit : contract unit ] */ ; + IFCMPNEQ + { PUSH string "invalid preimage" + /* [ string : contract unit : contract unit ] */ ; + FAILWITH + /* [] */ } + { BALANCE + /* [ mutez : contract unit : contract unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : contract unit ] */ ; + TRANSFER_TOKENS + /* [ operation : contract unit ] */ ; + DIP { DROP /* [] */ } + /* [ operation ] */ } } } ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ ; + UNIT + /* [ unit : list operation ] */ ; + SWAP + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat_dapp.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat_dapp.tz.out new file mode 100644 index 000000000000..c8b6b037c222 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-mini_scenarios-xcat_dapp.tz.out @@ -0,0 +1,308 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/mini_scenarios/xcat_dapp.tz --details +Well typed +Gas remaining: 1039922.932 units remaining +{ parameter + (or (pair %fund + (address %dest) + (pair %settings (bytes %target_hash) (timestamp %deadline))) + (or %claim_refund (bytes %preimage_claim) (bytes %refund_hash))) ; + storage + (pair (big_map + bytes + (pair (pair %recipients (address %from) (address %dest)) + (pair %settings (mutez %amount) (timestamp %deadline)))) + unit) ; + code { NIL @operations + operation + /* [ list operation + : pair (or (pair address bytes timestamp) (or bytes bytes)) + (big_map bytes (pair (pair address address) mutez timestamp)) + unit ] */ ; + SWAP + /* [ pair (or (pair address bytes timestamp) (or bytes bytes)) + (big_map bytes (pair (pair address address) mutez timestamp)) + unit : list operation ] */ ; + UNPAPAIR @% @% @% ; + DIP { DUP + /* [ big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ } + /* [ or (pair address bytes timestamp) (or bytes bytes) + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + IF_LEFT + { UNPAIR @% @% + /* [ address : pair bytes timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DUP + /* [ address : address : pair bytes timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + CONTRACT @dest + unit + /* [ option (contract unit) : address : pair bytes timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_SOME ; + DROP + /* [ address : pair bytes timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SWAP + /* [ pair bytes timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + UNPAIR @% @% + /* [ bytes : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIP { AMOUNT @amount + /* [ mutez : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SENDER + /* [ address : mutez : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DUP + /* [ address : address : mutez : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + CONTRACT @from + unit + /* [ option (contract unit) : address : mutez : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_SOME ; + DROP + /* [ address : mutez : timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIP { PAIR + /* [ pair mutez timestamp : address + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SWAP + /* [ address : pair mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ } + /* [ address : address : pair mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + PAIR + /* [ pair address address : pair mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + PAIR + /* [ pair (pair address address) mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SOME @xcat + /* [ option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SWAP + /* [ big_map bytes (pair (pair address address) mutez timestamp) + : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ } + /* [ bytes : big_map bytes (pair (pair address address) mutez timestamp) + : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DUP + /* [ bytes : bytes : big_map bytes (pair (pair address address) mutez timestamp) + : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIP { MEM + /* [ bool : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + NOT + /* [ bool : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT } + /* [ bytes : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + UPDATE + /* [ big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + PAIR @new_storage + /* [ pair (big_map bytes (pair (pair address address) mutez timestamp)) unit + : list operation ] */ ; + SWAP + /* [ list operation + : pair (big_map bytes (pair (pair address address) mutez timestamp)) unit ] */ ; + PAIR + /* [ pair (list operation) + (big_map bytes (pair (pair address address) mutez timestamp)) + unit ] */ } + { IF_LEFT + { DUP + /* [ bytes : bytes : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SIZE + /* [ nat : bytes : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + PUSH nat + 32 + /* [ nat : nat : bytes + : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_CMPGE ; + SHA256 @hash + /* [ bytes : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DUP + /* [ bytes : bytes : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIP { SWAP + /* [ big_map bytes (pair (pair address address) mutez timestamp) : bytes + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ } + /* [ bytes : big_map bytes (pair (pair address address) mutez timestamp) : bytes + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIIP { GET + /* [ option (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_SOME ; + DUP + /* [ pair (pair address address) mutez timestamp + : pair (pair address address) mutez timestamp : unit : list operation ] */ ; + CADR @% ; + CONTRACT @dest + unit + /* [ option (contract unit) : pair (pair address address) mutez timestamp : unit + : list operation ] */ ; + ASSERT_SOME ; + SWAP + /* [ pair (pair address address) mutez timestamp : contract unit : unit + : list operation ] */ ; + CDR @% + /* [ pair mutez timestamp : contract unit : unit : list operation ] */ ; + UNPAIR @% @% + /* [ mutez : timestamp : contract unit : unit : list operation ] */ ; + SWAP + /* [ timestamp : mutez : contract unit : unit : list operation ] */ ; + NOW + /* [ timestamp : timestamp : mutez : contract unit : unit : list operation ] */ ; + ASSERT_CMPLT ; + UNIT + /* [ unit : mutez : contract unit : unit : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : unit : list operation ] */ } + /* [ bytes : big_map bytes (pair (pair address address) mutez timestamp) + : operation : unit : list operation ] */ } + { DUP + /* [ bytes : bytes : big_map bytes (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + DIP { GET + /* [ option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_SOME ; + DUP + /* [ pair (pair address address) mutez timestamp + : pair (pair address address) mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + CAAR @% ; + CONTRACT @from + unit + /* [ option (contract unit) : pair (pair address address) mutez timestamp + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_SOME ; + SWAP + /* [ pair (pair address address) mutez timestamp : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + CDR + /* [ pair mutez timestamp : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + UNPAIR @% @% + /* [ mutez : timestamp : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + SWAP + /* [ timestamp : mutez : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + NOW + /* [ timestamp : timestamp : mutez : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + ASSERT_CMPGE ; + UNIT + /* [ unit : mutez : contract unit + : big_map bytes (pair (pair address address) mutez timestamp) : unit + : list operation ] */ ; + TRANSFER_TOKENS + /* [ operation : big_map bytes (pair (pair address address) mutez timestamp) + : unit : list operation ] */ ; + SWAP + /* [ big_map bytes (pair (pair address address) mutez timestamp) : operation + : unit : list operation ] */ } + /* [ bytes : big_map bytes (pair (pair address address) mutez timestamp) + : operation : unit : list operation ] */ } ; + NONE @none + (pair (pair address address) (pair mutez timestamp)) + /* [ option (pair (pair address address) mutez timestamp) : bytes + : big_map bytes (pair (pair address address) mutez timestamp) : operation + : unit : list operation ] */ ; + SWAP + /* [ bytes : option (pair (pair address address) mutez timestamp) + : big_map bytes (pair (pair address address) mutez timestamp) : operation + : unit : list operation ] */ ; + UPDATE @cleared_map + /* [ big_map bytes (pair (pair address address) mutez timestamp) : operation + : unit : list operation ] */ ; + SWAP + /* [ operation : big_map bytes (pair (pair address address) mutez timestamp) + : unit : list operation ] */ ; + DIP { PAIR + /* [ pair (big_map bytes (pair (pair address address) mutez timestamp)) unit + : list operation ] */ ; + SWAP + /* [ list operation + : pair (big_map bytes (pair (pair address address) mutez timestamp)) unit ] */ } + /* [ operation : list operation + : pair (big_map bytes (pair (pair address address) mutez timestamp)) unit ] */ ; + CONS + /* [ list operation + : pair (big_map bytes (pair (pair address address) mutez timestamp)) unit ] */ ; + PAIR + /* [ pair (list operation) + (big_map bytes (pair (pair address address) mutez timestamp)) + unit ] */ } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bad_annot_contract.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bad_annot_contract.tz.out new file mode 100644 index 000000000000..80c1631dcff7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bad_annot_contract.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/non_regression/bad_annot_contract.tz --details +Well typed +Gas remaining: 1039996.681 units remaining +{ parameter bytes ; + storage (option (lambda unit unit)) ; + code { CAR + /* [ bytes ] */ ; + UNPACK (lambda unit unit) + /* [ option (lambda unit unit) ] */ ; + NIL operation + /* [ list operation : option (lambda unit unit) ] */ ; + PAIR + /* [ pair (list operation) (option (lambda unit unit)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_262.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_262.tz.out new file mode 100644 index 000000000000..3800196976c4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_262.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/non_regression/bug_262.tz --details +Well typed +Gas remaining: 1039995.909 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + LAMBDA unit unit { /* [ unit ] */ } + /* [ lambda unit unit ] */ ; + UNIT + /* [ unit : lambda unit unit ] */ ; + EXEC + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_843.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_843.tz.out new file mode 100644 index 000000000000..acee08058e27 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-bug_843.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/non_regression/bug_843.tz --details +Well typed +Gas remaining: 1039993.849 units remaining +{ parameter never ; + storage (pair address (lambda unit unit)) ; + code { CAR + /* [ never ] */ ; + PUSH address "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + /* [ address : never ] */ ; + DROP + /* [ never ] */ ; + NEVER + /* [] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-pairk_annot.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-pairk_annot.tz.out new file mode 100644 index 000000000000..07b5f83b42de --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-non_regression-pairk_annot.tz.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/non_regression/pairk_annot.tz --details +Well typed +Gas remaining: 1039993.678 units remaining +{ parameter unit ; + storage unit ; + code { SENDER + /* [ address : pair unit unit ] */ ; + SOURCE + /* [ address : address : pair unit unit ] */ ; + PAIR 2 + /* [ pair address address : pair unit unit ] */ ; + SOURCE + /* [ address : pair address address : pair unit unit ] */ ; + SENDER + /* [ address : address : pair address address : pair unit unit ] */ ; + PAIR 2 + /* [ pair address address : pair address address : pair unit unit ] */ ; + COMPARE + /* [ int : pair unit unit ] */ ; + DROP + /* [ pair unit unit ] */ ; + CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-abs.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-abs.tz.out new file mode 100644 index 000000000000..7a8a6dbd27e9 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-abs.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/abs.tz --details +Well typed +Gas remaining: 1039992.714 units remaining +{ parameter nat ; + storage unit ; + code { CAR + /* [ nat ] */ ; + DUP + /* [ nat : nat ] */ ; + NEG + /* [ int : nat ] */ ; + ABS + /* [ nat : nat ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add.tz.out new file mode 100644 index 000000000000..a2f8222df73a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add.tz.out @@ -0,0 +1,84 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add.tz --details +Well typed +Gas remaining: 1039947.571 units remaining +{ parameter unit ; + storage unit ; + code { CAR + /* [ unit ] */ ; + PUSH int 2 + /* [ int : unit ] */ ; + PUSH int 2 + /* [ int : int : unit ] */ ; + ADD + /* [ int : unit ] */ ; + PUSH int 4 + /* [ int : int : unit ] */ ; + ASSERT_CMPEQ ; + PUSH int 2 + /* [ int : unit ] */ ; + PUSH int 2 + /* [ int : int : unit ] */ ; + ADD + /* [ int : unit ] */ ; + PUSH int 4 + /* [ int : int : unit ] */ ; + ASSERT_CMPEQ ; + PUSH int 2 + /* [ int : unit ] */ ; + PUSH nat 2 + /* [ nat : int : unit ] */ ; + ADD + /* [ int : unit ] */ ; + PUSH int 4 + /* [ int : int : unit ] */ ; + ASSERT_CMPEQ ; + PUSH nat 2 + /* [ nat : unit ] */ ; + PUSH int 2 + /* [ int : nat : unit ] */ ; + ADD + /* [ int : unit ] */ ; + PUSH int 4 + /* [ int : int : unit ] */ ; + ASSERT_CMPEQ ; + PUSH nat 2 + /* [ nat : unit ] */ ; + PUSH nat 2 + /* [ nat : nat : unit ] */ ; + ADD + /* [ nat : unit ] */ ; + PUSH nat 4 + /* [ nat : nat : unit ] */ ; + ASSERT_CMPEQ ; + PUSH int 60 + /* [ int : unit ] */ ; + PUSH timestamp "2019-09-09T12:08:37Z" + /* [ timestamp : int : unit ] */ ; + ADD + /* [ timestamp : unit ] */ ; + PUSH timestamp "2019-09-09T12:09:37Z" + /* [ timestamp : timestamp : unit ] */ ; + ASSERT_CMPEQ ; + PUSH timestamp "2019-09-09T12:08:37Z" + /* [ timestamp : unit ] */ ; + PUSH int 60 + /* [ int : timestamp : unit ] */ ; + ADD + /* [ timestamp : unit ] */ ; + PUSH timestamp "2019-09-09T12:09:37Z" + /* [ timestamp : timestamp : unit ] */ ; + ASSERT_CMPEQ ; + PUSH mutez 1000 + /* [ mutez : unit ] */ ; + PUSH mutez 1000 + /* [ mutez : mutez : unit ] */ ; + ADD + /* [ mutez : unit ] */ ; + PUSH mutez 2000 + /* [ mutez : mutez : unit ] */ ; + ASSERT_CMPEQ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_fr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_fr.tz.out new file mode 100644 index 000000000000..07458602e684 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_fr.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add_bls12_381_fr.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_fr bls12_381_fr) ; + storage (option bls12_381_fr) ; + code { CAR + /* [ pair bls12_381_fr bls12_381_fr ] */ ; + UNPAIR + /* [ bls12_381_fr : bls12_381_fr ] */ ; + ADD + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g1.tz.out new file mode 100644 index 000000000000..0d00e21179e1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g1.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add_bls12_381_g1.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_g1 bls12_381_g1) ; + storage (option bls12_381_g1) ; + code { CAR + /* [ pair bls12_381_g1 bls12_381_g1 ] */ ; + UNPAIR + /* [ bls12_381_g1 : bls12_381_g1 ] */ ; + ADD + /* [ bls12_381_g1 ] */ ; + SOME + /* [ option bls12_381_g1 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g1 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g1) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g2.tz.out new file mode 100644 index 000000000000..1c9e455484d2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_bls12_381_g2.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add_bls12_381_g2.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_g2 bls12_381_g2) ; + storage (option bls12_381_g2) ; + code { CAR + /* [ pair bls12_381_g2 bls12_381_g2 ] */ ; + UNPAIR + /* [ bls12_381_g2 : bls12_381_g2 ] */ ; + ADD + /* [ bls12_381_g2 ] */ ; + SOME + /* [ option bls12_381_g2 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g2 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g2) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_delta_timestamp.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_delta_timestamp.tz.out new file mode 100644 index 000000000000..c50905271fc8 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_delta_timestamp.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add_delta_timestamp.tz --details +Well typed +Gas remaining: 1039994.398 units remaining +{ parameter (pair int timestamp) ; + storage (option timestamp) ; + code { CAR + /* [ pair int timestamp ] */ ; + DUP + /* [ pair int timestamp : pair int timestamp ] */ ; + CAR + /* [ int : pair int timestamp ] */ ; + DIP { CDR /* [ timestamp ] */ } + /* [ int : timestamp ] */ ; + ADD + /* [ timestamp ] */ ; + SOME + /* [ option timestamp ] */ ; + NIL operation + /* [ list operation : option timestamp ] */ ; + PAIR + /* [ pair (list operation) (option timestamp) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_timestamp_delta.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_timestamp_delta.tz.out new file mode 100644 index 000000000000..6bb25188269f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-add_timestamp_delta.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/add_timestamp_delta.tz --details +Well typed +Gas remaining: 1039994.398 units remaining +{ parameter (pair timestamp int) ; + storage (option timestamp) ; + code { CAR + /* [ pair timestamp int ] */ ; + DUP + /* [ pair timestamp int : pair timestamp int ] */ ; + CAR + /* [ timestamp : pair timestamp int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ timestamp : int ] */ ; + ADD + /* [ timestamp ] */ ; + SOME + /* [ option timestamp ] */ ; + NIL operation + /* [ list operation : option timestamp ] */ ; + PAIR + /* [ pair (list operation) (option timestamp) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-address.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-address.tz.out new file mode 100644 index 000000000000..6d0578054e20 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-address.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/address.tz --details +Well typed +Gas remaining: 1039996.754 units remaining +{ parameter (contract unit) ; + storage (option address) ; + code { CAR + /* [ contract unit ] */ ; + ADDRESS + /* [ address ] */ ; + SOME + /* [ option address ] */ ; + NIL operation + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_fib_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_fib_view.tz.out new file mode 100644 index 000000000000..0ab0d261d1df --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_fib_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/amount_after_fib_view.tz --details +Well typed +Gas remaining: 1039986.567 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 3 + /* [ nat : address : address ] */ ; + VIEW "fib" nat + /* [ option nat : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + AMOUNT + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_nonexistent_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_nonexistent_view.tz.out new file mode 100644 index 000000000000..f4645da33db5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_nonexistent_view.tz.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/amount_after_nonexistent_view.tz --details +Well typed +Gas remaining: 1039986.775 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "nonexistent" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_NONE ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + AMOUNT + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_view.tz.out new file mode 100644 index 000000000000..7ceffbdc2159 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-amount_after_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/amount_after_view.tz --details +Well typed +Gas remaining: 1039986.392 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + AMOUNT + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and.tz.out new file mode 100644 index 000000000000..357e856b3235 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/and.tz --details +Well typed +Gas remaining: 1039995.193 units remaining +{ parameter (pair :param (bool %first) (bool %second)) ; + storage (option bool) ; + code { CAR + /* [ pair bool bool ] */ ; + UNPAIR + /* [ bool : bool ] */ ; + AND @and + /* [ bool ] */ ; + SOME @res + /* [ option bool ] */ ; + NIL @noop operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ ; + UNPAIR @x @y + /* [ list operation : option bool ] */ ; + PAIR %a %b + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_binary.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_binary.tz.out new file mode 100644 index 000000000000..66a12224c49b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_binary.tz.out @@ -0,0 +1,50 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/and_binary.tz --details +Well typed +Gas remaining: 1039972.796 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 5 + /* [ nat ] */ ; + PUSH nat 6 + /* [ nat : nat ] */ ; + AND + /* [ nat ] */ ; + PUSH nat 4 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH nat 6 + /* [ nat ] */ ; + PUSH int 5 + /* [ int : nat ] */ ; + AND + /* [ nat ] */ ; + PUSH nat 4 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH nat 12 + /* [ nat ] */ ; + PUSH int -1 + /* [ int : nat ] */ ; + AND + /* [ nat ] */ ; + PUSH nat 12 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH nat 12 + /* [ nat ] */ ; + PUSH int -5 + /* [ int : nat ] */ ; + AND + /* [ nat ] */ ; + PUSH nat 8 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_bytes.tz.out new file mode 100644 index 000000000000..670d3a5823b9 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_bytes.tz.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/and_bytes.tz --details +Well typed +Gas remaining: 1039978.916 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x06 + /* [ bytes : bytes ] */ ; + AND + /* [ bytes ] */ ; + PUSH bytes 0x04 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0005 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + AND + /* [ bytes ] */ ; + PUSH bytes 0x0004 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + AND + /* [ bytes ] */ ; + PUSH bytes 0x04 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_logical_1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_logical_1.tz.out new file mode 100644 index 000000000000..e4e62f63fc6a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-and_logical_1.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/and_logical_1.tz --details +Well typed +Gas remaining: 1039996.814 units remaining +{ parameter (pair bool bool) ; + storage bool ; + code { CAR + /* [ pair bool bool ] */ ; + UNPAIR + /* [ bool : bool ] */ ; + AND @and + /* [ bool ] */ ; + NIL @noop operation + /* [ list operation : bool ] */ ; + PAIR + /* [ pair (list operation) bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance.tz.out new file mode 100644 index 000000000000..f375a5649b7c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/balance.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage mutez ; + code { DROP + /* [] */ ; + BALANCE + /* [ mutez ] */ ; + NIL operation + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_fib_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_fib_view.tz.out new file mode 100644 index 000000000000..e942b0fcf1b8 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_fib_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/balance_after_fib_view.tz --details +Well typed +Gas remaining: 1039986.567 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 3 + /* [ nat : address : address ] */ ; + VIEW "fib" nat + /* [ option nat : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + BALANCE + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_nonexistent_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_nonexistent_view.tz.out new file mode 100644 index 000000000000..705ef2335a09 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_nonexistent_view.tz.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/balance_after_nonexistent_view.tz --details +Well typed +Gas remaining: 1039986.775 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "nonexistent" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_NONE ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + BALANCE + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_view.tz.out new file mode 100644 index 000000000000..e2e3c52faaf8 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-balance_after_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/balance_after_view.tz --details +Well typed +Gas remaining: 1039986.392 units remaining +{ parameter address ; + storage mutez ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 15000000 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + BALANCE + /* [ mutez : operation ] */ ; + SWAP + /* [ operation : mutez ] */ ; + NIL operation + /* [ list operation : operation : mutez ] */ ; + SWAP + /* [ operation : list operation : mutez ] */ ; + CONS + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_nat.tz.out new file mode 100644 index 000000000000..a5c534ab85c6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_nat.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/big_map_mem_nat.tz --details +Well typed +Gas remaining: 1039993.494 units remaining +{ parameter nat ; + storage (pair (big_map nat nat) (option bool)) ; + code { UNPAIR + /* [ nat : pair (big_map nat nat) (option bool) ] */ ; + DIP { CAR /* [ big_map nat nat ] */ ; DUP /* [ big_map nat nat : big_map nat nat ] */ } + /* [ nat : big_map nat nat : big_map nat nat ] */ ; + MEM + /* [ bool : big_map nat nat ] */ ; + SOME + /* [ option bool : big_map nat nat ] */ ; + SWAP + /* [ big_map nat nat : option bool ] */ ; + PAIR + /* [ pair (big_map nat nat) (option bool) ] */ ; + NIL operation + /* [ list operation : pair (big_map nat nat) (option bool) ] */ ; + PAIR + /* [ pair (list operation) (big_map nat nat) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_string.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_string.tz.out new file mode 100644 index 000000000000..14d42e5e2d33 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_mem_string.tz.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/big_map_mem_string.tz --details +Well typed +Gas remaining: 1039993.494 units remaining +{ parameter string ; + storage (pair (big_map string nat) (option bool)) ; + code { UNPAIR + /* [ string : pair (big_map string nat) (option bool) ] */ ; + DIP { CAR + /* [ big_map string nat ] */ ; + DUP + /* [ big_map string nat : big_map string nat ] */ } + /* [ string : big_map string nat : big_map string nat ] */ ; + MEM + /* [ bool : big_map string nat ] */ ; + SOME + /* [ option bool : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : option bool ] */ ; + PAIR + /* [ pair (big_map string nat) (option bool) ] */ ; + NIL operation + /* [ list operation : pair (big_map string nat) (option bool) ] */ ; + PAIR + /* [ pair (list operation) (big_map string nat) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_to_self.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_to_self.tz.out new file mode 100644 index 000000000000..5cbf8c8ce1e9 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-big_map_to_self.tz.out @@ -0,0 +1,56 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/big_map_to_self.tz --details +Well typed +Gas remaining: 1039987.387 units remaining +{ parameter (or (pair %have_fun (big_map string nat) unit) (unit %default)) ; + storage (big_map string nat) ; + code { UNPAIR + /* [ or (pair (big_map string nat) unit) unit : big_map string nat ] */ ; + DIP { NIL operation /* [ list operation : big_map string nat ] */ } + /* [ or (pair (big_map string nat) unit) unit : list operation + : big_map string nat ] */ ; + IF_LEFT + { DROP /* [ list operation : big_map string nat ] */ } + { DROP + /* [ list operation : big_map string nat ] */ ; + SELF %have_fun + /* [ contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + PUSH mutez + 0 + /* [ mutez : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + DUP 4 + /* [ big_map string nat : mutez : contract (pair (big_map string nat) unit) + : list operation : big_map string nat ] */ ; + PUSH (option nat) + (Some 8) + /* [ option nat : big_map string nat : mutez + : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + PUSH string + "hahaha" + /* [ string : option nat : big_map string nat : mutez + : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + UPDATE + /* [ big_map string nat : mutez : contract (pair (big_map string nat) unit) + : list operation : big_map string nat ] */ ; + UNIT + /* [ unit : big_map string nat : mutez + : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + SWAP + /* [ big_map string nat : unit : mutez + : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + PAIR + /* [ pair (big_map string nat) unit : mutez + : contract (pair (big_map string nat) unit) : list operation + : big_map string nat ] */ ; + TRANSFER_TOKENS + /* [ operation : list operation : big_map string nat ] */ ; + CONS + /* [ list operation : big_map string nat ] */ } ; + PAIR + /* [ pair (list operation) (big_map string nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_bytes_not_padded.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_bytes_not_padded.out new file mode 100644 index 000000000000..288b36e5cdde --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_bytes_not_padded.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_push_bytes_not_padded.tz --details +Well typed +Gas remaining: 1039996.436 units remaining +{ parameter unit ; + storage (option bls12_381_fr) ; + code { DROP + /* [] */ ; + PUSH bls12_381_fr 0x00 + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_nat.tz.out new file mode 100644 index 000000000000..6880a3fa853c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_push_nat.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_push_nat.tz --details +Well typed +Gas remaining: 1039996.436 units remaining +{ parameter unit ; + storage (option bls12_381_fr) ; + code { DROP + /* [] */ ; + PUSH bls12_381_fr 16 + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_int.tz.out new file mode 100644 index 000000000000..fe4808d9cae2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_int.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_to_int.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter bls12_381_fr ; + storage int ; + code { CAR + /* [ bls12_381_fr ] */ ; + INT + /* [ int ] */ ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_mutez.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_mutez.tz.out new file mode 100644 index 000000000000..d05db0e3c110 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_to_mutez.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_to_mutez.tz --details +Well typed +Gas remaining: 1039993.594 units remaining +{ parameter bls12_381_fr ; + storage mutez ; + code { CAR + /* [ bls12_381_fr ] */ ; + INT + /* [ int ] */ ; + ISNAT + /* [ option nat ] */ ; + ASSERT_SOME ; + PUSH mutez 1 + /* [ mutez : nat ] */ ; + MUL + /* [ mutez ] */ ; + NIL operation + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_int.tz.out new file mode 100644 index 000000000000..7d281819733e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_int.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_z_int.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter int ; + storage bls12_381_fr ; + code { UNPAIR + /* [ int : bls12_381_fr ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + NIL operation + /* [ list operation : bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) bls12_381_fr ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_nat.tz.out new file mode 100644 index 000000000000..106236036cc5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_fr_z_nat.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_fr_z_nat.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter nat ; + storage bls12_381_fr ; + code { UNPAIR + /* [ nat : bls12_381_fr ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + NIL operation + /* [ list operation : bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) bls12_381_fr ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_int.tz.out new file mode 100644 index 000000000000..f7e06b637443 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_int.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_z_fr_int.tz --details +Well typed +Gas remaining: 1039996.980 units remaining +{ parameter int ; + storage bls12_381_fr ; + code { UNPAIR + /* [ int : bls12_381_fr ] */ ; + SWAP + /* [ bls12_381_fr : int ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + NIL operation + /* [ list operation : bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) bls12_381_fr ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_nat.tz.out new file mode 100644 index 000000000000..00849e84f1eb --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bls12_381_z_fr_nat.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bls12_381_z_fr_nat.tz --details +Well typed +Gas remaining: 1039996.980 units remaining +{ parameter nat ; + storage bls12_381_fr ; + code { UNPAIR + /* [ nat : bls12_381_fr ] */ ; + SWAP + /* [ bls12_381_fr : nat ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + NIL operation + /* [ list operation : bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) bls12_381_fr ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes.tz.out new file mode 100644 index 000000000000..49666bb9884a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bytes.tz --details +Well typed +Gas remaining: 1039997.907 units remaining +{ parameter bytes ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_int.tz.out new file mode 100644 index 000000000000..6ebb63a51041 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_int.tz.out @@ -0,0 +1,126 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bytes_of_int.tz --details +Well typed +Gas remaining: 1039908.105 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH int 0 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH int 1 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x01 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH int 1193046 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x123456 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x123456 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int 1193046 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0000123456 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int 1193046 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int 0 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0000 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int 0 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH int -128 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x80 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH int -129 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0xff7f + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH int -33024 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0xff7f00 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH int -4294967296 + /* [ int ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0xff00000000 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x80 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int -128 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0xff7f + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int -129 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0xff7f00 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int -33024 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0xffffff7f00 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int -33024 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0xff00000000 + /* [ bytes ] */ ; + INT + /* [ int ] */ ; + PUSH int -4294967296 + /* [ int : int ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_nat.tz.out new file mode 100644 index 000000000000..4439de6b337e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-bytes_of_nat.tz.out @@ -0,0 +1,63 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/bytes_of_nat.tz --details +Well typed +Gas remaining: 1039958.808 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 0 + /* [ nat ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 1 + /* [ nat ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x01 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 1193046 + /* [ nat ] */ ; + BYTES + /* [ bytes ] */ ; + PUSH bytes 0x123456 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x123456 + /* [ bytes ] */ ; + NAT + /* [ nat ] */ ; + PUSH nat 1193046 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0000123456 + /* [ bytes ] */ ; + NAT + /* [ nat ] */ ; + PUSH nat 1193046 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x + /* [ bytes ] */ ; + NAT + /* [ nat ] */ ; + PUSH nat 0 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0000 + /* [ bytes ] */ ; + NAT + /* [ nat ] */ ; + PUSH nat 0 + /* [ nat : nat ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-car.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-car.tz.out new file mode 100644 index 000000000000..0c35590c8bfd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-car.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/car.tz --details +Well typed +Gas remaining: 1039997.277 units remaining +{ parameter (pair (nat :l) (nat :r)) ; + storage nat ; + code { CAR + /* [ pair nat nat ] */ ; + CAR + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cdr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cdr.tz.out new file mode 100644 index 000000000000..2fbd1ecf15ce --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cdr.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/cdr.tz --details +Well typed +Gas remaining: 1039997.277 units remaining +{ parameter (pair (nat :l) (nat :r)) ; + storage nat ; + code { CAR + /* [ pair nat nat ] */ ; + CDR + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id.tz.out new file mode 100644 index 000000000000..f2568727719d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/chain_id.tz --details +Well typed +Gas remaining: 1039996.980 units remaining +{ parameter unit ; + storage unit ; + code { CHAIN_ID + /* [ chain_id : pair unit unit ] */ ; + DROP + /* [ pair unit unit ] */ ; + CAR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id_store.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id_store.tz.out new file mode 100644 index 000000000000..69a92646e8f5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-chain_id_store.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/chain_id_store.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter unit ; + storage (option chain_id) ; + code { DROP + /* [] */ ; + CHAIN_ID + /* [ chain_id ] */ ; + SOME + /* [ option chain_id ] */ ; + NIL operation + /* [ list operation : option chain_id ] */ ; + PAIR + /* [ pair (list operation) (option chain_id) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-check_signature.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-check_signature.tz.out new file mode 100644 index 000000000000..9ef777afb91e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-check_signature.tz.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/check_signature.tz --details +Well typed +Gas remaining: 1039988.984 units remaining +{ parameter key ; + storage (pair signature string) ; + code { DUP + /* [ pair key signature string : pair key signature string ] */ ; + DUP + /* [ pair key signature string : pair key signature string + : pair key signature string ] */ ; + DIP { CDR + /* [ pair signature string : pair key signature string ] */ ; + DUP + /* [ pair signature string : pair signature string : pair key signature string ] */ ; + CAR + /* [ signature : pair signature string : pair key signature string ] */ ; + DIP { CDR + /* [ string : pair key signature string ] */ ; + PACK + /* [ bytes : pair key signature string ] */ } + /* [ signature : bytes : pair key signature string ] */ } + /* [ pair key signature string : signature : bytes : pair key signature string ] */ ; + CAR + /* [ key : signature : bytes : pair key signature string ] */ ; + CHECK_SIGNATURE + /* [ bool : pair key signature string ] */ ; + IF { /* [ pair key signature string ] */ } { FAIL } ; + CDR + /* [ pair signature string ] */ ; + NIL operation + /* [ list operation : pair signature string ] */ ; + PAIR + /* [ pair (list operation) signature string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-get.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-get.tz.out new file mode 100644 index 000000000000..ca6a9d260c6b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-get.tz.out @@ -0,0 +1,51 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comb-get.tz --details +Well typed +Gas remaining: 1039966.252 units remaining +{ parameter (pair nat nat nat unit) ; + storage unit ; + code { CAR + /* [ pair nat nat nat unit ] */ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + CAR + /* [ nat : pair nat nat nat unit ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + GET 1 + /* [ nat : pair nat nat nat unit ] */ ; + PUSH nat 1 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + GET 3 + /* [ nat : pair nat nat nat unit ] */ ; + PUSH nat 4 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + GET 5 + /* [ nat : pair nat nat nat unit ] */ ; + PUSH nat 2 + /* [ nat : nat : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat nat nat unit : pair nat nat nat unit ] */ ; + GET 6 + /* [ unit : pair nat nat nat unit ] */ ; + UNIT + /* [ unit : unit : pair nat nat nat unit ] */ ; + ASSERT_CMPEQ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-literals.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-literals.tz.out new file mode 100644 index 000000000000..85bfff85e59d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-literals.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comb-literals.tz --details +Well typed +Gas remaining: 1039993.270 units remaining +{ parameter unit ; + storage unit ; + code { PUSH (list (pair nat nat nat nat)) + { Pair 0 3 6 9 ; Pair 1 (Pair 4 (Pair 7 10)) ; { 2 ; 5 ; 8 ; 11 } } + /* [ list (pair nat nat nat nat) : pair unit unit ] */ ; + DROP 2 + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set-2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set-2.tz.out new file mode 100644 index 000000000000..bd14e81d8b5e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set-2.tz.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comb-set-2.tz --details +Well typed +Gas remaining: 1039991.581 units remaining +{ parameter (pair nat nat nat unit) ; + storage (option (pair int nat string bytes)) ; + code { CAR + /* [ pair nat nat nat unit ] */ ; + PUSH int 2 + /* [ int : pair nat nat nat unit ] */ ; + UPDATE 1 + /* [ pair int nat nat unit ] */ ; + PUSH string "toto" + /* [ string : pair int nat nat unit ] */ ; + UPDATE 5 + /* [ pair int nat string unit ] */ ; + PUSH bytes 0x01 + /* [ bytes : pair int nat string unit ] */ ; + UPDATE 6 + /* [ pair int nat string bytes ] */ ; + SOME + /* [ option (pair int nat string bytes) ] */ ; + NIL operation + /* [ list operation : option (pair int nat string bytes) ] */ ; + PAIR + /* [ pair (list operation) (option (pair int nat string bytes)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set.tz.out new file mode 100644 index 000000000000..7c85495329b3 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb-set.tz.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comb-set.tz --details +Well typed +Gas remaining: 1039991.623 units remaining +{ parameter unit ; + storage (pair nat nat nat unit) ; + code { CDR + /* [ pair nat nat nat unit ] */ ; + PUSH nat 2 + /* [ nat : pair nat nat nat unit ] */ ; + UPDATE 1 + /* [ pair nat nat nat unit ] */ ; + PUSH nat 12 + /* [ nat : pair nat nat nat unit ] */ ; + UPDATE 3 + /* [ pair nat nat nat unit ] */ ; + PUSH nat 8 + /* [ nat : pair nat nat nat unit ] */ ; + UPDATE 5 + /* [ pair nat nat nat unit ] */ ; + UNIT + /* [ unit : pair nat nat nat unit ] */ ; + UPDATE 6 + /* [ pair nat nat nat unit ] */ ; + NIL operation + /* [ list operation : pair nat nat nat unit ] */ ; + PAIR + /* [ pair (list operation) nat nat nat unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb.tz.out new file mode 100644 index 000000000000..a09de001bdd0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comb.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comb.tz --details +Well typed +Gas remaining: 1039995.014 units remaining +{ parameter unit ; + storage (pair nat nat nat) ; + code { DROP + /* [] */ ; + PUSH nat 3 + /* [ nat ] */ ; + PUSH nat 2 + /* [ nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat ] */ ; + NIL operation + /* [ list operation : nat : nat : nat ] */ ; + PAIR 4 + /* [ pair (list operation) nat nat nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare.tz.out new file mode 100644 index 000000000000..9b4369d51509 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare.tz.out @@ -0,0 +1,217 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/compare.tz --details +Well typed +Gas remaining: 1039841.663 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bool True + /* [ bool ] */ ; + DUP + /* [ bool : bool ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH bool False + /* [ bool ] */ ; + DUP + /* [ bool : bool ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH bool False + /* [ bool ] */ ; + PUSH bool True + /* [ bool : bool ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH bool True + /* [ bool ] */ ; + PUSH bool False + /* [ bool : bool ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH bytes 0xaabbcc + /* [ bytes ] */ ; + DUP + /* [ bytes : bytes ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH bytes 0x + /* [ bytes ] */ ; + PUSH bytes 0x + /* [ bytes : bytes ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH bytes 0x + /* [ bytes ] */ ; + PUSH bytes 0x01 + /* [ bytes : bytes ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH bytes 0x01 + /* [ bytes ] */ ; + PUSH bytes 0x02 + /* [ bytes : bytes ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH bytes 0x02 + /* [ bytes ] */ ; + PUSH bytes 0x01 + /* [ bytes : bytes ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH int 1 + /* [ int ] */ ; + DUP + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH int 10 + /* [ int ] */ ; + PUSH int 5 + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH int -4 + /* [ int ] */ ; + PUSH int 1923 + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH nat 1 + /* [ nat ] */ ; + DUP + /* [ nat : nat ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH nat 10 + /* [ nat ] */ ; + PUSH nat 5 + /* [ nat : nat ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH nat 4 + /* [ nat ] */ ; + PUSH nat 1923 + /* [ nat : nat ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + /* [ key_hash ] */ ; + DUP + /* [ key_hash : key_hash ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH key_hash "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" + /* [ key_hash ] */ ; + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + /* [ key_hash : key_hash ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH key_hash "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + /* [ key_hash ] */ ; + PUSH key_hash "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" + /* [ key_hash : key_hash ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH mutez 1 + /* [ mutez ] */ ; + DUP + /* [ mutez : mutez ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH mutez 10 + /* [ mutez ] */ ; + PUSH mutez 5 + /* [ mutez : mutez ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH mutez 4 + /* [ mutez ] */ ; + PUSH mutez 1923 + /* [ mutez : mutez ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH string "AABBCC" + /* [ string ] */ ; + DUP + /* [ string : string ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH string "" + /* [ string ] */ ; + PUSH string "" + /* [ string : string ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH string "" + /* [ string ] */ ; + PUSH string "a" + /* [ string : string ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH string "a" + /* [ string ] */ ; + PUSH string "b" + /* [ string : string ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH string "b" + /* [ string ] */ ; + PUSH string "a" + /* [ string : string ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + PUSH timestamp "2019-09-16T08:38:05Z" + /* [ timestamp ] */ ; + DUP + /* [ timestamp : timestamp ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH timestamp "2017-09-16T08:38:04Z" + /* [ timestamp ] */ ; + PUSH timestamp "2019-09-16T08:38:05Z" + /* [ timestamp : timestamp ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_GT ; + PUSH timestamp "2019-09-16T08:38:05Z" + /* [ timestamp ] */ ; + PUSH timestamp "2019-09-16T08:38:04Z" + /* [ timestamp : timestamp ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_LT ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type.tz.out new file mode 100644 index 000000000000..ec878676a912 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type.tz.out @@ -0,0 +1,3737 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/compare_big_type.tz --details +Well typed +Gas remaining: 1039129.907 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 0 + /* [ nat ] */ ; + DUP + /* [ nat : nat ] */ ; + PAIR + /* [ pair nat nat ] */ ; + DUP + /* [ pair nat nat : pair nat nat ] */ ; + PAIR + /* [ pair (pair nat nat) nat nat ] */ ; + DUP + /* [ pair (pair nat nat) nat nat : pair (pair nat nat) nat nat ] */ ; + PAIR + /* [ pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat ] */ ; + DUP + /* [ pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat + : pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat ] */ ; + PAIR + /* [ pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type2.tz.out new file mode 100644 index 000000000000..2d81385a7396 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-compare_big_type2.tz.out @@ -0,0 +1,4302 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/compare_big_type2.tz --details +Well typed +Gas remaining: 1038995.158 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 0 + /* [ nat ] */ ; + DUP + /* [ nat : nat ] */ ; + PAIR + /* [ pair nat nat ] */ ; + DUP + /* [ pair nat nat : pair nat nat ] */ ; + PAIR + /* [ pair (pair nat nat) nat nat ] */ ; + DUP + /* [ pair (pair nat nat) nat nat : pair (pair nat nat) nat nat ] */ ; + PAIR + /* [ pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat ] */ ; + DUP + /* [ pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat + : pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat ] */ ; + PAIR + /* [ pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + PAIR + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DUP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + COMPARE + /* [ int + : pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [ pair (pair (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat) + (pair (pair (pair nat nat) nat nat) (pair nat nat) nat nat) + (pair (pair nat nat) nat nat) + (pair nat nat) + nat + nat ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comparisons.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comparisons.tz.out new file mode 100644 index 000000000000..a914030aba5a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-comparisons.tz.out @@ -0,0 +1,65 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/comparisons.tz --details +Well typed +Gas remaining: 1039977.212 units remaining +{ parameter (list int) ; + storage (list (list bool)) ; + code { CAR + /* [ list int ] */ ; + NIL (list bool) + /* [ list (list bool) : list int ] */ ; + DIP { DUP + /* [ list int : list int ] */ ; + MAP { EQ /* [ bool : list int ] */ } + /* [ list bool : list int ] */ } + /* [ list (list bool) : list bool : list int ] */ ; + SWAP + /* [ list bool : list (list bool) : list int ] */ ; + CONS + /* [ list (list bool) : list int ] */ ; + DIP { DUP + /* [ list int : list int ] */ ; + MAP { NEQ /* [ bool : list int ] */ } + /* [ list bool : list int ] */ } + /* [ list (list bool) : list bool : list int ] */ ; + SWAP + /* [ list bool : list (list bool) : list int ] */ ; + CONS + /* [ list (list bool) : list int ] */ ; + DIP { DUP + /* [ list int : list int ] */ ; + MAP { LE /* [ bool : list int ] */ } + /* [ list bool : list int ] */ } + /* [ list (list bool) : list bool : list int ] */ ; + SWAP + /* [ list bool : list (list bool) : list int ] */ ; + CONS + /* [ list (list bool) : list int ] */ ; + DIP { DUP + /* [ list int : list int ] */ ; + MAP { LT /* [ bool : list int ] */ } + /* [ list bool : list int ] */ } + /* [ list (list bool) : list bool : list int ] */ ; + SWAP + /* [ list bool : list (list bool) : list int ] */ ; + CONS + /* [ list (list bool) : list int ] */ ; + DIP { DUP + /* [ list int : list int ] */ ; + MAP { GE /* [ bool : list int ] */ } + /* [ list bool : list int ] */ } + /* [ list (list bool) : list bool : list int ] */ ; + SWAP + /* [ list bool : list (list bool) : list int ] */ ; + CONS + /* [ list (list bool) : list int ] */ ; + DIP { MAP { GT /* [ bool ] */ } /* [ list bool ] */ } + /* [ list (list bool) : list bool ] */ ; + SWAP + /* [ list bool : list (list bool) ] */ ; + CONS + /* [ list (list bool) ] */ ; + NIL operation + /* [ list operation : list (list bool) ] */ ; + PAIR + /* [ pair (list operation) (list (list bool)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello.tz.out new file mode 100644 index 000000000000..02f89a6d5c25 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/concat_hello.tz --details +Well typed +Gas remaining: 1039995.899 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + MAP { PUSH @hello string "Hello " /* [ string : string ] */ ; CONCAT /* [ string ] */ } + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello_bytes.tz.out new file mode 100644 index 000000000000..ebca3fab6241 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_hello_bytes.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/concat_hello_bytes.tz --details +Well typed +Gas remaining: 1039995.973 units remaining +{ parameter (list bytes) ; + storage (list bytes) ; + code { CAR + /* [ list bytes ] */ ; + MAP { PUSH bytes 0xff /* [ bytes : bytes ] */ ; CONCAT /* [ bytes ] */ } + /* [ list bytes ] */ ; + NIL operation + /* [ list operation : list bytes ] */ ; + PAIR + /* [ pair (list operation) (list bytes) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_list.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_list.tz.out new file mode 100644 index 000000000000..9e5b6e84be02 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-concat_list.tz.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/concat_list.tz --details +Well typed +Gas remaining: 1039992.537 units remaining +{ parameter (list string) ; + storage string ; + code { CAR + /* [ list string ] */ ; + PUSH string "" + /* [ string : list string ] */ ; + SWAP + /* [ list string : string ] */ ; + ITER { SWAP + /* [ string : string ] */ ; + DIP { NIL string + /* [ list string : string ] */ ; + SWAP + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ } + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ ; + CONCAT + /* [ string ] */ } + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cons.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cons.tz.out new file mode 100644 index 000000000000..dfe2af3da7ca --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-cons.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/cons.tz --details +Well typed +Gas remaining: 1039997.240 units remaining +{ parameter int ; + storage (list int) ; + code { UNPAIR + /* [ int : list int ] */ ; + CONS + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contains_all.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contains_all.tz.out new file mode 100644 index 000000000000..314010480e1f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contains_all.tz.out @@ -0,0 +1,75 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/contains_all.tz --details +Well typed +Gas remaining: 1039974.767 units remaining +{ parameter (pair (list string) (list string)) ; + storage (option bool) ; + code { CAR + /* [ pair (list string) (list string) ] */ ; + DUP + /* [ pair (list string) (list string) : pair (list string) (list string) ] */ ; + CAR + /* [ list string : pair (list string) (list string) ] */ ; + DIP { CDR /* [ list string ] */ } + /* [ list string : list string ] */ ; + EMPTY_SET string + /* [ set string : list string : list string ] */ ; + SWAP + /* [ list string : set string : list string ] */ ; + ITER { PAIR + /* [ pair string (set string) : list string ] */ ; + DUP + /* [ pair string (set string) : pair string (set string) : list string ] */ ; + CAR + /* [ string : pair string (set string) : list string ] */ ; + DIP { CDR /* [ set string : list string ] */ } + /* [ string : set string : list string ] */ ; + PUSH bool True + /* [ bool : string : set string : list string ] */ ; + SWAP + /* [ string : bool : set string : list string ] */ ; + UPDATE + /* [ set string : list string ] */ } + /* [ set string : list string ] */ ; + PUSH bool True + /* [ bool : set string : list string ] */ ; + SWAP + /* [ set string : bool : list string ] */ ; + PAIR + /* [ pair (set string) bool : list string ] */ ; + SWAP + /* [ list string : pair (set string) bool ] */ ; + ITER { PAIR + /* [ pair string (set string) bool ] */ ; + DUP + /* [ pair string (set string) bool : pair string (set string) bool ] */ ; + DUP + /* [ pair string (set string) bool : pair string (set string) bool + : pair string (set string) bool ] */ ; + CAR + /* [ string : pair string (set string) bool : pair string (set string) bool ] */ ; + DIP { CDAR ; + DIP { CDDR } + /* [ set string : bool ] */ ; + DUP + /* [ set string : set string : bool ] */ } + /* [ string : set string : set string : bool ] */ ; + MEM + /* [ bool : set string : bool ] */ ; + DIP { SWAP /* [ bool : set string ] */ } + /* [ bool : bool : set string ] */ ; + AND + /* [ bool : set string ] */ ; + SWAP + /* [ set string : bool ] */ ; + PAIR + /* [ pair (set string) bool ] */ } + /* [ pair (set string) bool ] */ ; + CDR + /* [ bool ] */ ; + SOME + /* [ option bool ] */ ; + NIL operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contract.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contract.tz.out new file mode 100644 index 000000000000..557db276a9ea --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-contract.tz.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/contract.tz --details +Well typed +Gas remaining: 1039994.190 units remaining +{ parameter address ; + storage unit ; + code { CAR + /* [ address ] */ ; + CONTRACT unit + /* [ option (contract unit) ] */ ; + ASSERT_SOME ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract.tz.out new file mode 100644 index 000000000000..a62d060dcee7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract.tz.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/create_contract.tz --details +Well typed +Gas remaining: 1039991.584 units remaining +{ parameter unit ; + storage (option address) ; + code { /* [ pair unit unit ] */ + DROP + /* [ list operation : unit ] */ ; + UNIT + /* [ unit ] */ ; + AMOUNT + /* [ pair (list operation) unit ] */ ; + NONE key_hash + /* [ option key_hash : mutez : unit ] */ ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + DIP { SOME + /* [ option address ] */ ; + NIL operation + /* [ list operation : option address ] */ } + /* [ operation : list operation : option address ] */ ; + CONS + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname.tz.out new file mode 100644 index 000000000000..c1f100fed1e7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/create_contract_rootname.tz --details +Well typed +Gas remaining: 1039991.584 units remaining +{ parameter unit ; + storage (option address) ; + code { /* [ pair unit unit ] */ + DROP + /* [ list operation : unit ] */ ; + UNIT + /* [ unit ] */ ; + AMOUNT + /* [ pair (list operation) unit ] */ ; + NONE key_hash + /* [ option key_hash : mutez : unit ] */ ; + CREATE_CONTRACT + { parameter (unit %root) ; + storage unit ; + code { CDR ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + DIP { SOME + /* [ option address ] */ ; + NIL operation + /* [ list operation : option address ] */ } + /* [ operation : list operation : option address ] */ ; + CONS + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname_alt.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname_alt.tz.out new file mode 100644 index 000000000000..bb3665255885 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_rootname_alt.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/create_contract_rootname_alt.tz --details +Well typed +Gas remaining: 1039991.584 units remaining +{ parameter unit ; + storage (option address) ; + code { /* [ pair unit unit ] */ + DROP + /* [ list operation : unit ] */ ; + UNIT + /* [ unit ] */ ; + AMOUNT + /* [ pair (list operation) unit ] */ ; + NONE key_hash + /* [ option key_hash : mutez : unit ] */ ; + CREATE_CONTRACT + { parameter (unit %root) ; + storage unit ; + code { CDR ; NIL operation ; PAIR } } + /* [ operation : address ] */ ; + DIP { SOME + /* [ option address ] */ ; + NIL operation + /* [ list operation : option address ] */ } + /* [ operation : list operation : option address ] */ ; + CONS + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_with_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_with_view.tz.out new file mode 100644 index 000000000000..6bae0e775ef6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-create_contract_with_view.tz.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/create_contract_with_view.tz --details +Well typed +Gas remaining: 1039990.516 units remaining +{ parameter unit ; + storage (option address) ; + code { /* [ pair unit unit ] */ + DROP + /* [ list operation : unit ] */ ; + UNIT + /* [ unit ] */ ; + AMOUNT + /* [ pair (list operation) unit ] */ ; + NONE key_hash + /* [ option key_hash : mutez : unit ] */ ; + CREATE_CONTRACT + { parameter unit /* [ nat ] */ ; + storage unit ; + code { CDR ; NIL operation ; PAIR } ; + view "const" nat nat { CAR } } + /* [ operation : address ] */ ; + DIP { SOME + /* [ option address ] */ ; + NIL operation + /* [ list operation : option address ] */ } + /* [ operation : list operation : option address ] */ ; + CONS + /* [ list operation : option address ] */ ; + PAIR + /* [ pair (list operation) (option address) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-diff_timestamps.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-diff_timestamps.tz.out new file mode 100644 index 000000000000..476ae96f9f13 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-diff_timestamps.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/diff_timestamps.tz --details +Well typed +Gas remaining: 1039995.013 units remaining +{ parameter (pair timestamp timestamp) ; + storage int ; + code { CAR + /* [ pair timestamp timestamp ] */ ; + DUP + /* [ pair timestamp timestamp : pair timestamp timestamp ] */ ; + CAR + /* [ timestamp : pair timestamp timestamp ] */ ; + DIP { CDR /* [ timestamp ] */ } + /* [ timestamp : timestamp ] */ ; + SUB + /* [ int ] */ ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dig_eq.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dig_eq.tz.out new file mode 100644 index 000000000000..a4991bfe01f5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dig_eq.tz.out @@ -0,0 +1,157 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dig_eq.tz --details +Well typed +Gas remaining: 1039909.247 units remaining +{ parameter + (pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat) ; + storage unit ; + code { CAR + /* [ pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DUP + /* [ pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + UNPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAIR ; + DIG 0 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 1 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 2 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 3 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 4 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 5 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 6 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 7 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 8 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 9 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 10 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 11 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 12 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 13 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 14 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 15 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 16 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 0 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 1 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 2 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 3 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 4 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 5 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 6 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 7 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 8 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 9 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 10 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 11 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 12 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 13 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 14 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 15 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + DIG 16 + /* [ nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat : nat + : nat : nat : nat : nat + : pair nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat nat ] */ ; + PAPAPAPAPAPAPAPAPAPAPAPAPAPAPAPAIR ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dign.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dign.tz.out new file mode 100644 index 000000000000..3ef992bd8ec0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dign.tz.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dign.tz --details +Well typed +Gas remaining: 1039992.220 units remaining +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR + /* [ pair (pair (pair (pair nat nat) nat) nat) nat ] */ ; + UNPAIR + /* [ pair (pair (pair nat nat) nat) nat : nat ] */ ; + UNPAIR + /* [ pair (pair nat nat) nat : nat : nat ] */ ; + UNPAIR + /* [ pair nat nat : nat : nat : nat ] */ ; + UNPAIR + /* [ nat : nat : nat : nat : nat ] */ ; + DIG 4 + /* [ nat : nat : nat : nat : nat ] */ ; + DIP { DROP /* [ nat : nat : nat ] */ ; DROP /* [ nat : nat ] */ ; DROP /* [ nat ] */ ; DROP /* [] */ } + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dip.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dip.tz.out new file mode 100644 index 000000000000..661406edcc02 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dip.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dip.tz --details +Well typed +Gas remaining: 1039994.918 units remaining +{ parameter (pair nat nat) ; + storage (pair nat nat) ; + code { CAR + /* [ pair nat nat ] */ ; + UNPAIR + /* [ nat : nat ] */ ; + DUP + /* [ nat : nat : nat ] */ ; + DIP { ADD /* [ nat ] */ } + /* [ nat : nat ] */ ; + PAIR + /* [ pair nat nat ] */ ; + NIL operation + /* [ list operation : pair nat nat ] */ ; + PAIR + /* [ pair (list operation) nat nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dipn.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dipn.tz.out new file mode 100644 index 000000000000..7094e1c49258 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dipn.tz.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dipn.tz --details +Well typed +Gas remaining: 1039991.330 units remaining +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR + /* [ pair (pair (pair (pair nat nat) nat) nat) nat ] */ ; + UNPAIR + /* [ pair (pair (pair nat nat) nat) nat : nat ] */ ; + UNPAIR + /* [ pair (pair nat nat) nat : nat : nat ] */ ; + UNPAIR + /* [ pair nat nat : nat : nat : nat ] */ ; + UNPAIR + /* [ nat : nat : nat : nat : nat ] */ ; + DIP 5 { PUSH nat 6 /* [ nat ] */ } + /* [ nat : nat : nat : nat : nat : nat ] */ ; + DROP + /* [ nat : nat : nat : nat : nat ] */ ; + DROP + /* [ nat : nat : nat : nat ] */ ; + DROP + /* [ nat : nat : nat ] */ ; + DROP + /* [ nat : nat ] */ ; + DROP + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dropn.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dropn.tz.out new file mode 100644 index 000000000000..6a5c68963c2f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dropn.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dropn.tz --details +Well typed +Gas remaining: 1039994.587 units remaining +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR + /* [ pair (pair (pair (pair nat nat) nat) nat) nat ] */ ; + UNPAIR + /* [ pair (pair (pair nat nat) nat) nat : nat ] */ ; + UNPAIR + /* [ pair (pair nat nat) nat : nat : nat ] */ ; + UNPAIR + /* [ pair nat nat : nat : nat : nat ] */ ; + UNPAIR + /* [ nat : nat : nat : nat : nat ] */ ; + DROP 4 + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dugn.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dugn.tz.out new file mode 100644 index 000000000000..03c8aeffd41a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dugn.tz.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dugn.tz --details +Well typed +Gas remaining: 1039992.716 units remaining +{ parameter (pair (pair (pair (pair nat nat) nat) nat) nat) ; + storage nat ; + code { CAR + /* [ pair (pair (pair (pair nat nat) nat) nat) nat ] */ ; + UNPAIR + /* [ pair (pair (pair nat nat) nat) nat : nat ] */ ; + UNPAIR + /* [ pair (pair nat nat) nat : nat : nat ] */ ; + UNPAIR + /* [ pair nat nat : nat : nat : nat ] */ ; + UNPAIR + /* [ nat : nat : nat : nat : nat ] */ ; + DUG 4 + /* [ nat : nat : nat : nat : nat ] */ ; + DROP + /* [ nat : nat : nat : nat ] */ ; + DROP + /* [ nat : nat : nat ] */ ; + DROP + /* [ nat : nat ] */ ; + DROP + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dup-n.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dup-n.tz.out new file mode 100644 index 000000000000..cddb0000016a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-dup-n.tz.out @@ -0,0 +1,51 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/dup-n.tz --details +Well typed +Gas remaining: 1039968.032 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 5 + /* [ nat ] */ ; + PUSH nat 4 + /* [ nat : nat ] */ ; + PUSH nat 3 + /* [ nat : nat : nat ] */ ; + PUSH nat 2 + /* [ nat : nat : nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat : nat : nat ] */ ; + DUP 1 + /* [ nat : nat : nat : nat : nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat : nat : nat : nat : nat ] */ ; + ASSERT_CMPEQ ; + DUP 2 + /* [ nat : nat : nat : nat : nat : nat ] */ ; + PUSH nat 2 + /* [ nat : nat : nat : nat : nat : nat : nat ] */ ; + ASSERT_CMPEQ ; + DUP 3 + /* [ nat : nat : nat : nat : nat : nat ] */ ; + PUSH nat 3 + /* [ nat : nat : nat : nat : nat : nat : nat ] */ ; + ASSERT_CMPEQ ; + DUP 4 + /* [ nat : nat : nat : nat : nat : nat ] */ ; + PUSH nat 4 + /* [ nat : nat : nat : nat : nat : nat : nat ] */ ; + ASSERT_CMPEQ ; + DUP 5 + /* [ nat : nat : nat : nat : nat : nat ] */ ; + PUSH nat 5 + /* [ nat : nat : nat : nat : nat : nat : nat ] */ ; + ASSERT_CMPEQ ; + DROP 5 + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv.tz.out new file mode 100644 index 000000000000..d99263896c80 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv.tz.out @@ -0,0 +1,67 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ediv.tz --details +Well typed +Gas remaining: 1039981.718 units remaining +{ parameter (pair int int) ; + storage + (pair (option (pair int nat)) + (option (pair int nat)) + (option (pair int nat)) + (option (pair nat nat))) ; + code { CAR + /* [ pair int int ] */ ; + DUP + /* [ pair int int : pair int int ] */ ; + UNPAIR + /* [ int : int : pair int int ] */ ; + ABS + /* [ nat : int : pair int int ] */ ; + DIP { ABS /* [ nat : pair int int ] */ } + /* [ nat : nat : pair int int ] */ ; + EDIV + /* [ option (pair nat nat) : pair int int ] */ ; + SWAP + /* [ pair int int : option (pair nat nat) ] */ ; + DUP + /* [ pair int int : pair int int : option (pair nat nat) ] */ ; + UNPAIR + /* [ int : int : pair int int : option (pair nat nat) ] */ ; + ABS + /* [ nat : int : pair int int : option (pair nat nat) ] */ ; + EDIV + /* [ option (pair int nat) : pair int int : option (pair nat nat) ] */ ; + SWAP + /* [ pair int int : option (pair int nat) : option (pair nat nat) ] */ ; + DUP + /* [ pair int int : pair int int : option (pair int nat) + : option (pair nat nat) ] */ ; + UNPAIR + /* [ int : int : pair int int : option (pair int nat) : option (pair nat nat) ] */ ; + DIP { ABS + /* [ nat : pair int int : option (pair int nat) : option (pair nat nat) ] */ } + /* [ int : nat : pair int int : option (pair int nat) : option (pair nat nat) ] */ ; + EDIV + /* [ option (pair int nat) : pair int int : option (pair int nat) + : option (pair nat nat) ] */ ; + SWAP + /* [ pair int int : option (pair int nat) : option (pair int nat) + : option (pair nat nat) ] */ ; + UNPAIR + /* [ int : int : option (pair int nat) : option (pair int nat) + : option (pair nat nat) ] */ ; + EDIV + /* [ option (pair int nat) : option (pair int nat) : option (pair int nat) + : option (pair nat nat) ] */ ; + PAPAPAIR ; + NIL operation + /* [ list operation + : pair (option (pair int nat)) + (option (pair int nat)) + (option (pair int nat)) + (option (pair nat nat)) ] */ ; + PAIR + /* [ pair (list operation) + (option (pair int nat)) + (option (pair int nat)) + (option (pair int nat)) + (option (pair nat nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv_mutez.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv_mutez.tz.out new file mode 100644 index 000000000000..0ab2b858f3b0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ediv_mutez.tz.out @@ -0,0 +1,30 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ediv_mutez.tz --details +Well typed +Gas remaining: 1039990.621 units remaining +{ parameter (pair mutez (or mutez nat)) ; + storage (or (option (pair nat mutez)) (option (pair mutez mutez))) ; + code { CAR + /* [ pair mutez (or mutez nat) ] */ ; + UNPAIR + /* [ mutez : or mutez nat ] */ ; + SWAP + /* [ or mutez nat : mutez ] */ ; + IF_LEFT + { SWAP + /* [ mutez : mutez ] */ ; + EDIV + /* [ option (pair nat mutez) ] */ ; + LEFT (option (pair mutez mutez)) + /* [ or (option (pair nat mutez)) (option (pair mutez mutez)) ] */ } + { SWAP + /* [ mutez : nat ] */ ; + EDIV + /* [ option (pair mutez mutez) ] */ ; + RIGHT + (option (pair nat mutez)) + /* [ or (option (pair nat mutez)) (option (pair mutez mutez)) ] */ } ; + NIL operation + /* [ list operation : or (option (pair nat mutez)) (option (pair mutez mutez)) ] */ ; + PAIR + /* [ pair (list operation) (or (option (pair nat mutez)) (option (pair mutez mutez))) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-emit.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-emit.tz.out new file mode 100644 index 000000000000..60df05352aba --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-emit.tz.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/emit.tz --details +Well typed +Gas remaining: 1039991.050 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + PUSH nat 10 + /* [ nat : unit ] */ ; + LEFT string + /* [ or nat string : unit ] */ ; + EMIT %event + /* [ operation : unit ] */ ; + PUSH string "lorem ipsum" + /* [ string : operation : unit ] */ ; + RIGHT nat + /* [ or nat string : operation : unit ] */ ; + EMIT %event (or (nat %number) (string %words)) + /* [ operation : operation : unit ] */ ; + NIL operation + /* [ list operation : operation : operation : unit ] */ ; + SWAP + /* [ operation : list operation : operation : unit ] */ ; + CONS + /* [ list operation : operation : unit ] */ ; + SWAP + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-empty_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-empty_map.tz.out new file mode 100644 index 000000000000..50ac248ac397 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-empty_map.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/empty_map.tz --details +Well typed +Gas remaining: 1039994.366 units remaining +{ storage (map string string) ; + parameter unit ; + code { DROP + /* [] */ ; + EMPTY_MAP string string + /* [ map string string ] */ ; + PUSH string "world" + /* [ string : map string string ] */ ; + SOME + /* [ option string : map string string ] */ ; + PUSH string "hello" + /* [ string : option string : map string string ] */ ; + UPDATE + /* [ map string string ] */ ; + NIL operation + /* [ list operation : map string string ] */ ; + PAIR + /* [ pair (list operation) (map string string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-exec_concat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-exec_concat.tz.out new file mode 100644 index 000000000000..871fe07a09ec --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-exec_concat.tz.out @@ -0,0 +1,34 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/exec_concat.tz --details +Well typed +Gas remaining: 1039992.377 units remaining +{ parameter string ; + storage string ; + code { CAR + /* [ string ] */ ; + LAMBDA + string + string + { PUSH string "_abc" + /* [ string : string ] */ ; + NIL string + /* [ list string : string : string ] */ ; + SWAP + /* [ string : list string : string ] */ ; + CONS + /* [ list string : string ] */ ; + SWAP + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ ; + CONCAT + /* [ string ] */ } + /* [ lambda string string : string ] */ ; + SWAP + /* [ string : lambda string string ] */ ; + EXEC + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-first.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-first.tz.out new file mode 100644 index 000000000000..b877c8b49213 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-first.tz.out @@ -0,0 +1,13 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/first.tz --details +Well typed +Gas remaining: 1039995.098 units remaining +{ parameter (list nat) ; + storage nat ; + code { CAR + /* [ list nat ] */ ; + IF_CONS { DIP { DROP /* [] */ } /* [ nat ] */ } { FAIL } ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_big_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_big_map.tz.out new file mode 100644 index 000000000000..dd2d9820616b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_big_map.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/get_and_update_big_map.tz --details +Well typed +Gas remaining: 1039994.790 units remaining +{ parameter string ; + storage (pair (option nat) (big_map string nat)) ; + code { UNPAPAIR ; + GET_AND_UPDATE + /* [ option nat : big_map string nat ] */ ; + PAIR + /* [ pair (option nat) (big_map string nat) ] */ ; + NIL operation + /* [ list operation : pair (option nat) (big_map string nat) ] */ ; + PAIR + /* [ pair (list operation) (option nat) (big_map string nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_map.tz.out new file mode 100644 index 000000000000..79f3823f0bf5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_and_update_map.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/get_and_update_map.tz --details +Well typed +Gas remaining: 1039994.850 units remaining +{ parameter string ; + storage (pair (option nat) (map string nat)) ; + code { UNPAPAIR ; + GET_AND_UPDATE + /* [ option nat : map string nat ] */ ; + PAIR + /* [ pair (option nat) (map string nat) ] */ ; + NIL operation + /* [ list operation : pair (option nat) (map string nat) ] */ ; + PAIR + /* [ pair (list operation) (option nat) (map string nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_big_map_value.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_big_map_value.tz.out new file mode 100644 index 000000000000..926a33db3309 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_big_map_value.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/get_big_map_value.tz --details +Well typed +Gas remaining: 1039992.079 units remaining +{ parameter string ; + storage (pair (big_map string string) (option string)) ; + code { DUP + /* [ pair string (big_map string string) (option string) + : pair string (big_map string string) (option string) ] */ ; + CAR + /* [ string : pair string (big_map string string) (option string) ] */ ; + DIP { CDAR ; DUP /* [ big_map string string : big_map string string ] */ } + /* [ string : big_map string string : big_map string string ] */ ; + GET + /* [ option string : big_map string string ] */ ; + SWAP + /* [ big_map string string : option string ] */ ; + PAIR + /* [ pair (big_map string string) (option string) ] */ ; + NIL operation + /* [ list operation : pair (big_map string string) (option string) ] */ ; + PAIR + /* [ pair (list operation) (big_map string string) (option string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_map_value.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_map_value.tz.out new file mode 100644 index 000000000000..2214e3576a6e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-get_map_value.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/get_map_value.tz --details +Well typed +Gas remaining: 1039992.607 units remaining +{ parameter string ; + storage (pair (option string) (map string string)) ; + code { DUP + /* [ pair string (option string) (map string string) + : pair string (option string) (map string string) ] */ ; + CAR + /* [ string : pair string (option string) (map string string) ] */ ; + DIP { CDDR ; DUP /* [ map string string : map string string ] */ } + /* [ string : map string string : map string string ] */ ; + GET + /* [ option string : map string string ] */ ; + PAIR + /* [ pair (option string) (map string string) ] */ ; + NIL operation + /* [ list operation : pair (option string) (map string string) ] */ ; + PAIR + /* [ pair (list operation) (option string) (map string string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_consistency_checker.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_consistency_checker.tz.out new file mode 100644 index 000000000000..418418b64cef --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_consistency_checker.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/hash_consistency_checker.tz --details +Well typed +Gas remaining: 1039996.569 units remaining +{ parameter (pair mutez (pair timestamp int)) ; + storage bytes ; + code { CAR + /* [ pair mutez timestamp int ] */ ; + PACK + /* [ bytes ] */ ; + BLAKE2B + /* [ bytes ] */ ; + NIL operation + /* [ list operation : bytes ] */ ; + PAIR + /* [ pair (list operation) bytes ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_key.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_key.tz.out new file mode 100644 index 000000000000..e7f007b46dc5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_key.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/hash_key.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter key ; + storage (option key_hash) ; + code { CAR + /* [ key ] */ ; + HASH_KEY + /* [ key_hash ] */ ; + SOME + /* [ option key_hash ] */ ; + NIL operation + /* [ list operation : option key_hash ] */ ; + PAIR + /* [ pair (list operation) (option key_hash) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_string.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_string.tz.out new file mode 100644 index 000000000000..73a05c42b906 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-hash_string.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/hash_string.tz --details +Well typed +Gas remaining: 1039996.980 units remaining +{ parameter string ; + storage bytes ; + code { CAR + /* [ string ] */ ; + PACK + /* [ bytes ] */ ; + BLAKE2B + /* [ bytes ] */ ; + NIL operation + /* [ list operation : bytes ] */ ; + PAIR + /* [ pair (list operation) bytes ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if.tz.out new file mode 100644 index 000000000000..41f1bf6e1003 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/if.tz --details +Well typed +Gas remaining: 1039995.290 units remaining +{ parameter bool ; + storage (option bool) ; + code { CAR + /* [ bool ] */ ; + IF { PUSH bool True /* [ bool ] */ } { PUSH bool False /* [ bool ] */ } ; + SOME + /* [ option bool ] */ ; + NIL operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if_some.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if_some.tz.out new file mode 100644 index 000000000000..275fcacac913 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-if_some.tz.out @@ -0,0 +1,13 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/if_some.tz --details +Well typed +Gas remaining: 1039996.019 units remaining +{ parameter (option string) ; + storage string ; + code { CAR + /* [ option string ] */ ; + IF_SOME { /* [ string ] */ } { PUSH string "" /* [ string ] */ } ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-int.tz.out new file mode 100644 index 000000000000..50a3e0b397dc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-int.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/int.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter nat ; + storage (option int) ; + code { CAR + /* [ nat ] */ ; + INT + /* [ int ] */ ; + SOME + /* [ option int ] */ ; + NIL operation + /* [ list operation : option int ] */ ; + PAIR + /* [ pair (list operation) (option int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-iter_fail.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-iter_fail.tz.out new file mode 100644 index 000000000000..fbea64f5f9dc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-iter_fail.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/iter_fail.tz --details +Well typed +Gas remaining: 1039996.874 units remaining +{ parameter (set nat) ; + storage unit ; + code { UNPAIR + /* [ set nat : unit ] */ ; + ITER { FAILWITH /* [] */ } + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-keccak.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-keccak.tz.out new file mode 100644 index 000000000000..817c7faecbdf --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-keccak.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/keccak.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ storage (option bytes) ; + parameter bytes ; + code { CAR + /* [ bytes ] */ ; + KECCAK + /* [ bytes ] */ ; + SOME + /* [ option bytes ] */ ; + NIL operation + /* [ list operation : option bytes ] */ ; + PAIR + /* [ pair (list operation) (option bytes) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-left_right.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-left_right.tz.out new file mode 100644 index 000000000000..8c70f4d7f2a2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-left_right.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/left_right.tz --details +Well typed +Gas remaining: 1039995.570 units remaining +{ parameter (or bool string) ; + storage (or string bool) ; + code { CAR + /* [ or bool string ] */ ; + IF_LEFT + { RIGHT string /* [ or string bool ] */ } + { LEFT bool /* [ or string bool ] */ } ; + NIL operation + /* [ list operation : or string bool ] */ ; + PAIR + /* [ pair (list operation) (or string bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-level.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-level.tz.out new file mode 100644 index 000000000000..be3c581111e1 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-level.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/level.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage nat ; + code { DROP + /* [] */ ; + LEVEL + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat.tz.out new file mode 100644 index 000000000000..aa494ba43669 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_concat.tz --details +Well typed +Gas remaining: 1039996.374 units remaining +{ parameter (list string) ; + storage string ; + code { UNPAIR + /* [ list string : string ] */ ; + SWAP + /* [ string : list string ] */ ; + CONS + /* [ list string ] */ ; + CONCAT + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat_bytes.tz.out new file mode 100644 index 000000000000..b5ef8ef94172 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_concat_bytes.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_concat_bytes.tz --details +Well typed +Gas remaining: 1039996.374 units remaining +{ parameter (list bytes) ; + storage bytes ; + code { UNPAIR + /* [ list bytes : bytes ] */ ; + SWAP + /* [ bytes : list bytes ] */ ; + CONS + /* [ list bytes ] */ ; + CONCAT + /* [ bytes ] */ ; + NIL operation + /* [ list operation : bytes ] */ ; + PAIR + /* [ pair (list operation) bytes ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id.tz.out new file mode 100644 index 000000000000..28664a8cbb4d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_id.tz --details +Well typed +Gas remaining: 1039997.680 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id_map.tz.out new file mode 100644 index 000000000000..0073aafcec48 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_id_map.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_id_map.tz --details +Well typed +Gas remaining: 1039996.974 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + MAP { /* [ string ] */ } + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_iter.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_iter.tz.out new file mode 100644 index 000000000000..c1f0b70988e3 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_iter.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_iter.tz --details +Well typed +Gas remaining: 1039995.593 units remaining +{ parameter (list int) ; + storage int ; + code { CAR + /* [ list int ] */ ; + PUSH int 1 + /* [ int : list int ] */ ; + SWAP + /* [ list int : int ] */ ; + ITER { MUL /* [ int ] */ } + /* [ int ] */ ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_map_block.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_map_block.tz.out new file mode 100644 index 000000000000..f8a478621de4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_map_block.tz.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_map_block.tz --details +Well typed +Gas remaining: 1039991.624 units remaining +{ parameter (list int) ; + storage (list int) ; + code { CAR + /* [ list int ] */ ; + PUSH int 0 + /* [ int : list int ] */ ; + SWAP + /* [ list int : int ] */ ; + MAP { DIP { DUP /* [ int : int ] */ } + /* [ int : int : int ] */ ; + ADD + /* [ int : int ] */ ; + DIP { PUSH int 1 /* [ int : int ] */ ; ADD /* [ int ] */ } + /* [ int : int ] */ } + /* [ list int : int ] */ ; + NIL operation + /* [ list operation : list int : int ] */ ; + PAIR + /* [ pair (list operation) (list int) : int ] */ ; + DIP { DROP /* [] */ } + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_size.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_size.tz.out new file mode 100644 index 000000000000..6dcb89d1eb1d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-list_size.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/list_size.tz --details +Well typed +Gas remaining: 1039997.360 units remaining +{ parameter (list int) ; + storage nat ; + code { CAR + /* [ list int ] */ ; + SIZE + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_failwith.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_failwith.tz.out new file mode 100644 index 000000000000..b1c82c5be192 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_failwith.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/loop_failwith.tz --details +Well typed +Gas remaining: 1039996.957 units remaining +{ parameter bool ; + storage unit ; + code { UNPAIR + /* [ bool : unit ] */ ; + LOOP { FAILWITH /* [] */ } + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left.tz.out new file mode 100644 index 000000000000..28e68fb7179a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left.tz.out @@ -0,0 +1,40 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/loop_left.tz --details +Well typed +Gas remaining: 1039987.396 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + NIL string + /* [ list string : list string ] */ ; + SWAP + /* [ list string : list string ] */ ; + PAIR + /* [ pair (list string) (list string) ] */ ; + LEFT (list string) + /* [ or (pair (list string) (list string)) (list string) ] */ ; + LOOP_LEFT + { DUP + /* [ pair (list string) (list string) : pair (list string) (list string) ] */ ; + CAR + /* [ list string : pair (list string) (list string) ] */ ; + DIP { CDR /* [ list string ] */ } + /* [ list string : list string ] */ ; + IF_CONS + { SWAP + /* [ list string : string : list string ] */ ; + DIP { CONS /* [ list string ] */ } + /* [ list string : list string ] */ ; + PAIR + /* [ pair (list string) (list string) ] */ ; + LEFT (list string) + /* [ or (pair (list string) (list string)) (list string) ] */ } + { RIGHT + (pair (list string) (list string)) + /* [ or (pair (list string) (list string)) (list string) ] */ } } + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left_failwith.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left_failwith.tz.out new file mode 100644 index 000000000000..42e8b60f4e1d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-loop_left_failwith.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/loop_left_failwith.tz --details +Well typed +Gas remaining: 1039996.716 units remaining +{ parameter (or string nat) ; + storage nat ; + code { CAR + /* [ or string nat ] */ ; + LOOP_LEFT { FAILWITH /* [] */ } + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsl_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsl_bytes.tz.out new file mode 100644 index 000000000000..6beda6087272 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsl_bytes.tz.out @@ -0,0 +1,50 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/lsl_bytes.tz --details +Well typed +Gas remaining: 1039972.796 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 0 + /* [ nat ] */ ; + PUSH bytes 0x06 + /* [ bytes : nat ] */ ; + LSL + /* [ bytes ] */ ; + PUSH bytes 0x06 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 1 + /* [ nat ] */ ; + PUSH bytes 0x06 + /* [ bytes : nat ] */ ; + LSL + /* [ bytes ] */ ; + PUSH bytes 0x000c + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 8 + /* [ nat ] */ ; + PUSH bytes 0x06 + /* [ bytes : nat ] */ ; + LSL + /* [ bytes ] */ ; + PUSH bytes 0x0600 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 1 + /* [ nat ] */ ; + PUSH bytes 0x0006 + /* [ bytes : nat ] */ ; + LSL + /* [ bytes ] */ ; + PUSH bytes 0x00000c + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsr_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsr_bytes.tz.out new file mode 100644 index 000000000000..d57c9e954858 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-lsr_bytes.tz.out @@ -0,0 +1,68 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/lsr_bytes.tz --details +Well typed +Gas remaining: 1039959.946 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH nat 1 + /* [ nat ] */ ; + PUSH bytes 0x06 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x03 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 8 + /* [ nat ] */ ; + PUSH bytes 0x06 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 1 + /* [ nat ] */ ; + PUSH bytes 0x0006 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x0003 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 8 + /* [ nat ] */ ; + PUSH bytes 0x0006 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x00 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 0 + /* [ nat ] */ ; + PUSH bytes 0x001234 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x001234 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH nat 30 + /* [ nat ] */ ; + PUSH bytes 0x001234 + /* [ bytes : nat ] */ ; + LSR + /* [ bytes ] */ ; + PUSH bytes 0x + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_car.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_car.tz.out new file mode 100644 index 000000000000..37fcfd7dddfb --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_car.tz.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_car.tz --details +Well typed +Gas remaining: 1039991.063 units remaining +{ parameter bool ; + storage (pair (bool %b) (nat %n)) ; + code { DUP + /* [ pair bool bool nat : pair bool bool nat ] */ ; + CAR + /* [ bool : pair bool bool nat ] */ ; + DIP { CDR /* [ pair bool nat ] */ } + /* [ bool : pair bool nat ] */ ; + SWAP + /* [ pair bool nat : bool ] */ ; + MAP_CAR @new_storage %b { AND /* [ bool ] */ } ; + NIL operation + /* [ list operation : pair bool nat ] */ ; + PAIR + /* [ pair (list operation) bool nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_id.tz.out new file mode 100644 index 000000000000..a9fd31ab82bd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_id.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_id.tz --details +Well typed +Gas remaining: 1039997.454 units remaining +{ parameter (map nat nat) ; + storage (map nat nat) ; + code { CAR + /* [ map nat nat ] */ ; + NIL operation + /* [ list operation : map nat nat ] */ ; + PAIR + /* [ pair (list operation) (map nat nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_iter.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_iter.tz.out new file mode 100644 index 000000000000..d50f74a662d6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_iter.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_iter.tz --details +Well typed +Gas remaining: 1039986.949 units remaining +{ parameter (map (int :k) (int :e)) ; + storage (pair (int :k) (int :e)) ; + code { CAR + /* [ map int int ] */ ; + PUSH @acc_e (int :e) 0 + /* [ int : map int int ] */ ; + PUSH @acc_k (int :k) 0 + /* [ int : int : map int int ] */ ; + PAIR % %r + /* [ pair int int : map int int ] */ ; + SWAP + /* [ map int int : pair int int ] */ ; + ITER { DIP { DUP + /* [ pair int int : pair int int ] */ ; + CAR + /* [ int : pair int int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ int : int ] */ } + /* [ pair int int : int : int ] */ ; + DUP + /* [ pair int int : pair int int : int : int ] */ ; + DIP { CAR /* [ int : int : int ] */ ; ADD /* [ int : int ] */ } + /* [ pair int int : int : int ] */ ; + SWAP + /* [ int : pair int int : int ] */ ; + DIP { CDR /* [ int : int ] */ ; ADD /* [ int ] */ } + /* [ int : int ] */ ; + PAIR % %r + /* [ pair int int ] */ } + /* [ pair int int ] */ ; + NIL operation + /* [ list operation : pair int int ] */ ; + PAIR + /* [ pair (list operation) int int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map.tz.out new file mode 100644 index 000000000000..ad32cf96b723 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_map.tz --details +Well typed +Gas remaining: 1039993.574 units remaining +{ parameter nat ; + storage (map string nat) ; + code { UNPAIR + /* [ nat : map string nat ] */ ; + SWAP + /* [ map string nat : nat ] */ ; + MAP { CDR + /* [ nat : nat ] */ ; + DIP { DUP /* [ nat : nat ] */ } + /* [ nat : nat : nat ] */ ; + ADD + /* [ nat : nat ] */ } + /* [ map string nat : nat ] */ ; + DIP { DROP /* [] */ } + /* [ map string nat ] */ ; + NIL operation + /* [ list operation : map string nat ] */ ; + PAIR + /* [ pair (list operation) (map string nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map_sideeffect.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map_sideeffect.tz.out new file mode 100644 index 000000000000..9d0c8ab04ef2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_map_sideeffect.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_map_sideeffect.tz --details +Well typed +Gas remaining: 1039988.534 units remaining +{ parameter nat ; + storage (pair (map string nat) nat) ; + code { UNPAIR + /* [ nat : pair (map string nat) nat ] */ ; + SWAP + /* [ pair (map string nat) nat : nat ] */ ; + CAR + /* [ map string nat : nat ] */ ; + DIP 2 { PUSH @sum nat 0 /* [ nat ] */ } + /* [ map string nat : nat : nat ] */ ; + MAP { CDR + /* [ nat : nat : nat ] */ ; + DIP { DUP /* [ nat : nat : nat ] */ } + /* [ nat : nat : nat : nat ] */ ; + ADD + /* [ nat : nat : nat ] */ ; + DUP + /* [ nat : nat : nat : nat ] */ ; + DUG 2 + /* [ nat : nat : nat : nat ] */ ; + DIP 2 { ADD @sum /* [ nat ] */ } + /* [ nat : nat : nat ] */ } + /* [ map string nat : nat : nat ] */ ; + DIP { DROP /* [ nat ] */ } + /* [ map string nat : nat ] */ ; + PAIR + /* [ pair (map string nat) nat ] */ ; + NIL operation + /* [ list operation : pair (map string nat) nat ] */ ; + PAIR + /* [ pair (list operation) (map string nat) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_nat.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_nat.tz.out new file mode 100644 index 000000000000..49d87b20e44c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_nat.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_mem_nat.tz --details +Well typed +Gas remaining: 1039993.554 units remaining +{ parameter nat ; + storage (pair (map nat nat) (option bool)) ; + code { UNPAIR + /* [ nat : pair (map nat nat) (option bool) ] */ ; + DIP { CAR /* [ map nat nat ] */ ; DUP /* [ map nat nat : map nat nat ] */ } + /* [ nat : map nat nat : map nat nat ] */ ; + MEM + /* [ bool : map nat nat ] */ ; + SOME + /* [ option bool : map nat nat ] */ ; + SWAP + /* [ map nat nat : option bool ] */ ; + PAIR + /* [ pair (map nat nat) (option bool) ] */ ; + NIL operation + /* [ list operation : pair (map nat nat) (option bool) ] */ ; + PAIR + /* [ pair (list operation) (map nat nat) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_string.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_string.tz.out new file mode 100644 index 000000000000..f4b59db42e88 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_mem_string.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_mem_string.tz --details +Well typed +Gas remaining: 1039993.554 units remaining +{ parameter string ; + storage (pair (map string nat) (option bool)) ; + code { UNPAIR + /* [ string : pair (map string nat) (option bool) ] */ ; + DIP { CAR /* [ map string nat ] */ ; DUP /* [ map string nat : map string nat ] */ } + /* [ string : map string nat : map string nat ] */ ; + MEM + /* [ bool : map string nat ] */ ; + SOME + /* [ option bool : map string nat ] */ ; + SWAP + /* [ map string nat : option bool ] */ ; + PAIR + /* [ pair (map string nat) (option bool) ] */ ; + NIL operation + /* [ list operation : pair (map string nat) (option bool) ] */ ; + PAIR + /* [ pair (list operation) (map string nat) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_size.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_size.tz.out new file mode 100644 index 000000000000..8649cf1188c3 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-map_size.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/map_size.tz --details +Well typed +Gas remaining: 1039997.277 units remaining +{ parameter (map string nat) ; + storage nat ; + code { CAR + /* [ map string nat ] */ ; + SIZE + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-merge_comparable_pairs.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-merge_comparable_pairs.tz.out new file mode 100644 index 000000000000..f70657f48c9b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-merge_comparable_pairs.tz.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/merge_comparable_pairs.tz --details +Well typed +Gas remaining: 1039992.173 units remaining +{ parameter (set (pair (nat %n) (pair %p (string %s) (int %i)))) ; + storage nat ; + code { UNPAIR + /* [ set (pair nat string int) : nat ] */ ; + SWAP + /* [ nat : set (pair nat string int) ] */ ; + PUSH nat 3 + /* [ nat : nat : set (pair nat string int) ] */ ; + COMPARE + /* [ int : set (pair nat string int) ] */ ; + GT + /* [ bool : set (pair nat string int) ] */ ; + IF { /* [ set (pair nat string int) ] */ } + { DROP + /* [] */ ; + EMPTY_SET (pair nat (pair string int)) + /* [ set (pair nat string int) ] */ } ; + SIZE + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul.tz.out new file mode 100644 index 000000000000..e93a43e9d6a5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul.tz.out @@ -0,0 +1,82 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mul.tz --details +Well typed +Gas remaining: 1039961.621 units remaining +{ parameter unit ; + storage unit ; + code { CAR + /* [ unit ] */ ; + DROP + /* [] */ ; + PUSH nat 7987 + /* [ nat ] */ ; + PUSH mutez 10 + /* [ mutez : nat ] */ ; + MUL + /* [ mutez ] */ ; + PUSH mutez 79870 + /* [ mutez : mutez ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH mutez 10 + /* [ mutez ] */ ; + PUSH nat 7987 + /* [ nat : mutez ] */ ; + MUL + /* [ mutez ] */ ; + PUSH mutez 79870 + /* [ mutez : mutez ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH int 10 + /* [ int ] */ ; + PUSH int -7987 + /* [ int : int ] */ ; + MUL + /* [ int ] */ ; + PUSH int -79870 + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH nat 10 + /* [ nat ] */ ; + PUSH int -7987 + /* [ int : nat ] */ ; + MUL + /* [ int ] */ ; + PUSH int -79870 + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH int -10 + /* [ int ] */ ; + PUSH nat 7987 + /* [ nat : int ] */ ; + MUL + /* [ int ] */ ; + PUSH int -79870 + /* [ int : int ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + PUSH nat 10 + /* [ nat ] */ ; + PUSH nat 7987 + /* [ nat : nat ] */ ; + MUL + /* [ nat ] */ ; + PUSH nat 79870 + /* [ nat : nat ] */ ; + COMPARE + /* [ int ] */ ; + ASSERT_EQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_fr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_fr.tz.out new file mode 100644 index 000000000000..cc4aa165d152 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_fr.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mul_bls12_381_fr.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_fr bls12_381_fr) ; + storage (option bls12_381_fr) ; + code { CAR + /* [ pair bls12_381_fr bls12_381_fr ] */ ; + UNPAIR + /* [ bls12_381_fr : bls12_381_fr ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g1.tz.out new file mode 100644 index 000000000000..33e5bc67892c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g1.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mul_bls12_381_g1.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_g1 bls12_381_fr) ; + storage (option bls12_381_g1) ; + code { CAR + /* [ pair bls12_381_g1 bls12_381_fr ] */ ; + UNPAIR + /* [ bls12_381_g1 : bls12_381_fr ] */ ; + MUL + /* [ bls12_381_g1 ] */ ; + SOME + /* [ option bls12_381_g1 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g1 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g1) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g2.tz.out new file mode 100644 index 000000000000..99e30ddff2eb --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_bls12_381_g2.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mul_bls12_381_g2.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair bls12_381_g2 bls12_381_fr) ; + storage (option bls12_381_g2) ; + code { CAR + /* [ pair bls12_381_g2 bls12_381_fr ] */ ; + UNPAIR + /* [ bls12_381_g2 : bls12_381_fr ] */ ; + MUL + /* [ bls12_381_g2 ] */ ; + SOME + /* [ option bls12_381_g2 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g2 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g2) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_overflow.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_overflow.tz.out new file mode 100644 index 000000000000..4c57b07286fc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mul_overflow.tz.out @@ -0,0 +1,29 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mul_overflow.tz --details +Well typed +Gas remaining: 1039992.344 units remaining +{ parameter (or unit unit) ; + storage unit ; + code { CAR + /* [ or unit unit ] */ ; + IF_LEFT + { PUSH nat 922337203685477580700 + /* [ nat : unit ] */ ; + PUSH mutez 10 + /* [ mutez : nat : unit ] */ ; + MUL + /* [ mutez : unit ] */ ; + DROP + /* [ unit ] */ } + { PUSH mutez 10 + /* [ mutez : unit ] */ ; + PUSH nat 922337203685477580700 + /* [ nat : mutez : unit ] */ ; + MUL + /* [ mutez : unit ] */ ; + DROP + /* [ unit ] */ } ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-munch.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-munch.tz.out new file mode 100644 index 000000000000..ae739dfd3c10 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-munch.tz.out @@ -0,0 +1,13 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/munch.tz --details +Well typed +Gas remaining: 1039997.065 units remaining +{ parameter + (or (bytes %bytes) (or (lambda %lambda unit unit) (or (nat %nat) (list %list_nat nat)))) ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mutez_to_bls12_381_fr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mutez_to_bls12_381_fr.tz.out new file mode 100644 index 000000000000..30167d11b994 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-mutez_to_bls12_381_fr.tz.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/mutez_to_bls12_381_fr.tz --details +Well typed +Gas remaining: 1039992.323 units remaining +{ parameter mutez ; + storage bls12_381_fr ; + code { CAR + /* [ mutez ] */ ; + PUSH mutez 1 + /* [ mutez : mutez ] */ ; + SWAP + /* [ mutez : mutez ] */ ; + EDIV + /* [ option (pair nat mutez) ] */ ; + ASSERT_SOME ; + CAR + /* [ nat ] */ ; + PUSH bls12_381_fr 1 + /* [ bls12_381_fr : nat ] */ ; + MUL + /* [ bls12_381_fr ] */ ; + NIL operation + /* [ list operation : bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) bls12_381_fr ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg.tz.out new file mode 100644 index 000000000000..0334c69c13dc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg.tz.out @@ -0,0 +1,13 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/neg.tz --details +Well typed +Gas remaining: 1039996.161 units remaining +{ parameter (or int nat) ; + storage int ; + code { CAR + /* [ or int nat ] */ ; + IF_LEFT { NEG /* [ int ] */ } { NEG /* [ int ] */ } ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_fr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_fr.tz.out new file mode 100644 index 000000000000..bdd8a9ef28f2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_fr.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/neg_bls12_381_fr.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter bls12_381_fr ; + storage (option bls12_381_fr) ; + code { CAR + /* [ bls12_381_fr ] */ ; + NEG + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g1.tz.out new file mode 100644 index 000000000000..12e48a126977 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g1.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/neg_bls12_381_g1.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter bls12_381_g1 ; + storage (option bls12_381_g1) ; + code { CAR + /* [ bls12_381_g1 ] */ ; + NEG + /* [ bls12_381_g1 ] */ ; + SOME + /* [ option bls12_381_g1 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g1 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g1) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g2.tz.out new file mode 100644 index 000000000000..5c294f15542a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-neg_bls12_381_g2.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/neg_bls12_381_g2.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter bls12_381_g2 ; + storage (option bls12_381_g2) ; + code { CAR + /* [ bls12_381_g2 ] */ ; + NEG + /* [ bls12_381_g2 ] */ ; + SOME + /* [ option bls12_381_g2 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g2 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g2) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-none.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-none.tz.out new file mode 100644 index 000000000000..3ec1c5523921 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-none.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/none.tz --details +Well typed +Gas remaining: 1039997.217 units remaining +{ parameter unit ; + storage (option nat) ; + code { DROP + /* [] */ ; + NONE nat + /* [ option nat ] */ ; + NIL operation + /* [ list operation : option nat ] */ ; + PAIR + /* [ pair (list operation) (option nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-noop.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-noop.tz.out new file mode 100644 index 000000000000..f122498dc17d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-noop.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/noop.tz --details +Well typed +Gas remaining: 1039997.907 units remaining +{ parameter unit ; + storage unit ; + code { CDR + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not.tz.out new file mode 100644 index 000000000000..32363c2c8344 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/not.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ parameter bool ; + storage (option bool) ; + code { CAR + /* [ bool ] */ ; + NOT + /* [ bool ] */ ; + SOME + /* [ option bool ] */ ; + NIL operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_binary.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_binary.tz.out new file mode 100644 index 000000000000..6176a0bbf04b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_binary.tz.out @@ -0,0 +1,15 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/not_binary.tz --details +Well typed +Gas remaining: 1039995.545 units remaining +{ parameter (or int nat) ; + storage (option int) ; + code { CAR + /* [ or int nat ] */ ; + IF_LEFT { NOT /* [ int ] */ } { NOT /* [ int ] */ } ; + SOME + /* [ option int ] */ ; + NIL operation + /* [ list operation : option int ] */ ; + PAIR + /* [ pair (list operation) (option int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_bytes.tz.out new file mode 100644 index 000000000000..e7e6fdb165f0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-not_bytes.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/not_bytes.tz --details +Well typed +Gas remaining: 1039981.341 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + NOT + /* [ bytes ] */ ; + PUSH bytes 0xfa + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0005 + /* [ bytes ] */ ; + NOT + /* [ bytes ] */ ; + PUSH bytes 0xfffa + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0xff05 + /* [ bytes ] */ ; + NOT + /* [ bytes ] */ ; + PUSH bytes 0x00fa + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or.tz.out new file mode 100644 index 000000000000..b4e93fa9f018 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or.tz.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/or.tz --details +Well typed +Gas remaining: 1039994.425 units remaining +{ parameter (pair bool bool) ; + storage (option bool) ; + code { CAR + /* [ pair bool bool ] */ ; + DUP + /* [ pair bool bool : pair bool bool ] */ ; + CAR + /* [ bool : pair bool bool ] */ ; + SWAP + /* [ pair bool bool : bool ] */ ; + CDR + /* [ bool : bool ] */ ; + OR + /* [ bool ] */ ; + SOME + /* [ option bool ] */ ; + NIL operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_binary.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_binary.tz.out new file mode 100644 index 000000000000..b847f53e1cd0 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_binary.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/or_binary.tz --details +Well typed +Gas remaining: 1039996.129 units remaining +{ parameter (pair nat nat) ; + storage (option nat) ; + code { CAR + /* [ pair nat nat ] */ ; + UNPAIR + /* [ nat : nat ] */ ; + OR + /* [ nat ] */ ; + SOME + /* [ option nat ] */ ; + NIL operation + /* [ list operation : option nat ] */ ; + PAIR + /* [ pair (list operation) (option nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_bytes.tz.out new file mode 100644 index 000000000000..f6005f2c2b3d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-or_bytes.tz.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/or_bytes.tz --details +Well typed +Gas remaining: 1039978.916 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x06 + /* [ bytes : bytes ] */ ; + OR + /* [ bytes ] */ ; + PUSH bytes 0x07 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0005 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + OR + /* [ bytes ] */ ; + PUSH bytes 0x0107 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + OR + /* [ bytes ] */ ; + PUSH bytes 0x0107 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-originate_big_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-originate_big_map.tz.out new file mode 100644 index 000000000000..5c1a32a6288a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-originate_big_map.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/originate_big_map.tz --details +Well typed +Gas remaining: 1039997.334 units remaining +{ parameter (big_map int int) ; + storage (big_map int int) ; + code { CAR + /* [ big_map int int ] */ ; + NIL operation + /* [ list operation : big_map int int ] */ ; + PAIR + /* [ pair (list operation) (big_map int int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack.tz.out new file mode 100644 index 000000000000..b83dc35de6e2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack.tz.out @@ -0,0 +1,27 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/packunpack.tz --details +Well typed +Gas remaining: 1039987.310 units remaining +{ parameter (pair (pair (pair string (list int)) (set nat)) bytes) ; + storage unit ; + code { CAR + /* [ pair (pair (pair string (list int)) (set nat)) bytes ] */ ; + UNPAIR + /* [ pair (pair string (list int)) (set nat) : bytes ] */ ; + DIP { DUP /* [ bytes : bytes ] */ } + /* [ pair (pair string (list int)) (set nat) : bytes : bytes ] */ ; + PACK + /* [ bytes : bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNPACK + (pair (pair string (list int)) (set nat)) + /* [ option (pair (pair string (list int)) (set nat)) ] */ ; + ASSERT_SOME ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev.tz.out new file mode 100644 index 000000000000..0b40b91e1b3a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev.tz.out @@ -0,0 +1,162 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/packunpack_rev.tz --details +Well typed +Gas remaining: 1039888.774 units remaining +{ parameter (pair int nat string bytes mutez bool key_hash timestamp address) ; + storage unit ; + code { CAR + /* [ pair int nat string bytes mutez bool key_hash timestamp address ] */ ; + DUP + /* [ pair int nat string bytes mutez bool key_hash timestamp address + : pair int nat string bytes mutez bool key_hash timestamp address ] */ ; + CAR + /* [ int : pair int nat string bytes mutez bool key_hash timestamp address ] */ ; + DIP { UNPAIR + /* [ int : pair nat string bytes mutez bool key_hash timestamp address ] */ } + /* [ int : int : pair nat string bytes mutez bool key_hash timestamp address ] */ ; + PACK + /* [ bytes : int : pair nat string bytes mutez bool key_hash timestamp address ] */ ; + UNPACK + int + /* [ option int : int + : pair nat string bytes mutez bool key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair nat string bytes mutez bool key_hash timestamp address + : pair nat string bytes mutez bool key_hash timestamp address ] */ ; + CAR + /* [ nat : pair nat string bytes mutez bool key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ nat : pair string bytes mutez bool key_hash timestamp address ] */ } + /* [ nat : nat : pair string bytes mutez bool key_hash timestamp address ] */ ; + PACK + /* [ bytes : nat : pair string bytes mutez bool key_hash timestamp address ] */ ; + UNPACK + nat + /* [ option nat : nat + : pair string bytes mutez bool key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair string bytes mutez bool key_hash timestamp address + : pair string bytes mutez bool key_hash timestamp address ] */ ; + CAR + /* [ string : pair string bytes mutez bool key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ string : pair bytes mutez bool key_hash timestamp address ] */ } + /* [ string : string : pair bytes mutez bool key_hash timestamp address ] */ ; + PACK + /* [ bytes : string : pair bytes mutez bool key_hash timestamp address ] */ ; + UNPACK + string + /* [ option string : string : pair bytes mutez bool key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair bytes mutez bool key_hash timestamp address + : pair bytes mutez bool key_hash timestamp address ] */ ; + CAR + /* [ bytes : pair bytes mutez bool key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ bytes : pair mutez bool key_hash timestamp address ] */ } + /* [ bytes : bytes : pair mutez bool key_hash timestamp address ] */ ; + PACK + /* [ bytes : bytes : pair mutez bool key_hash timestamp address ] */ ; + UNPACK + bytes + /* [ option bytes : bytes : pair mutez bool key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair mutez bool key_hash timestamp address + : pair mutez bool key_hash timestamp address ] */ ; + CAR + /* [ mutez : pair mutez bool key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ mutez : pair bool key_hash timestamp address ] */ } + /* [ mutez : mutez : pair bool key_hash timestamp address ] */ ; + PACK + /* [ bytes : mutez : pair bool key_hash timestamp address ] */ ; + UNPACK mutez + /* [ option mutez : mutez : pair bool key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair bool key_hash timestamp address + : pair bool key_hash timestamp address ] */ ; + CAR + /* [ bool : pair bool key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ bool : pair key_hash timestamp address ] */ } + /* [ bool : bool : pair key_hash timestamp address ] */ ; + PACK + /* [ bytes : bool : pair key_hash timestamp address ] */ ; + UNPACK bool + /* [ option bool : bool : pair key_hash timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair key_hash timestamp address : pair key_hash timestamp address ] */ ; + CAR + /* [ key_hash : pair key_hash timestamp address ] */ ; + DIP { UNPAIR /* [ key_hash : pair timestamp address ] */ } + /* [ key_hash : key_hash : pair timestamp address ] */ ; + PACK + /* [ bytes : key_hash : pair timestamp address ] */ ; + UNPACK key_hash + /* [ option key_hash : key_hash : pair timestamp address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ pair timestamp address : pair timestamp address ] */ ; + CAR + /* [ timestamp : pair timestamp address ] */ ; + DIP { UNPAIR /* [ timestamp : address ] */ } + /* [ timestamp : timestamp : address ] */ ; + PACK + /* [ bytes : timestamp : address ] */ ; + UNPACK timestamp + /* [ option timestamp : timestamp : address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + DUP + /* [ address : address ] */ ; + PACK + /* [ bytes : address ] */ ; + UNPACK address + /* [ option address : address ] */ ; + ASSERT_SOME ; + ASSERT_CMPEQ ; + PUSH int 0 + /* [ int ] */ ; + PACK + /* [ bytes ] */ ; + UNPACK nat + /* [ option nat ] */ ; + ASSERT_SOME ; + DROP + /* [] */ ; + PUSH int -1 + /* [ int ] */ ; + PACK + /* [ bytes ] */ ; + UNPACK nat + /* [ option nat ] */ ; + ASSERT_NONE ; + PUSH bytes 0x + /* [ bytes ] */ ; + UNPACK nat + /* [ option nat ] */ ; + ASSERT_NONE ; + PUSH bytes 0x04 + /* [ bytes ] */ ; + UNPACK nat + /* [ option nat ] */ ; + ASSERT_NONE ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + UNPACK nat + /* [ option nat ] */ ; + ASSERT_NONE ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev_cty.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev_cty.tz.out new file mode 100644 index 000000000000..c51b05c2963e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-packunpack_rev_cty.tz.out @@ -0,0 +1,611 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/packunpack_rev_cty.tz --details +Well typed +Gas remaining: 1039875.178 units remaining +{ parameter + (pair key + unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes)) ; + storage unit ; + code { CAR + /* [ pair key + unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DUP + /* [ pair key + unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair key + unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ key + : pair key + unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ key + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ key : key + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + PACK + /* [ bytes : key + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + UNPACK + key + /* [ option key + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ unit + : pair unit + signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ unit + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ unit : unit + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + PACK + /* [ bytes : unit + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + UNPACK + unit + /* [ option unit + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ signature + : pair signature + (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ signature + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ signature : signature + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + PACK + /* [ bytes : signature + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + UNPACK + signature + /* [ option signature + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ option signature + : pair (option signature) + (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ option signature + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ option signature : option signature + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + PACK + /* [ bytes : option signature + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + UNPACK + (option signature) + /* [ option (option signature) + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ list unit + : pair (list unit) + (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ list unit + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ list unit : list unit + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + PACK + /* [ bytes : list unit + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + UNPACK + (list unit) + /* [ option (list unit) + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + CAR + /* [ set bool + : pair (set bool) + (pair int int) + (or key_hash timestamp) + (map int string) + (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ set bool + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ } + /* [ set bool : set bool + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + PACK + /* [ bytes : set bool + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + UNPACK + (set bool) + /* [ option (set bool) + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + CAR + /* [ pair int int + : pair (pair int int) (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ pair int int + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ } + /* [ pair int int : pair int int + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + PACK + /* [ bytes : pair int int + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + UNPACK + (pair int int) + /* [ option (pair int int) + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ } + /* [ bytes : bytes + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (or key_hash timestamp) (map int string) (lambda string bytes) + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + CAR + /* [ or key_hash timestamp + : pair (or key_hash timestamp) (map int string) (lambda string bytes) ] */ ; + DIP { UNPAIR + /* [ or key_hash timestamp : pair (map int string) (lambda string bytes) ] */ } + /* [ or key_hash timestamp : or key_hash timestamp + : pair (map int string) (lambda string bytes) ] */ ; + PACK + /* [ bytes : or key_hash timestamp + : pair (map int string) (lambda string bytes) ] */ ; + DIP { PACK + /* [ bytes : pair (map int string) (lambda string bytes) ] */ ; + UNPACK + (or key_hash timestamp) + /* [ option (or key_hash timestamp) + : pair (map int string) (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes : pair (map int string) (lambda string bytes) ] */ } + /* [ bytes : bytes : pair (map int string) (lambda string bytes) ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ pair (map int string) (lambda string bytes) + : pair (map int string) (lambda string bytes) ] */ ; + CAR + /* [ map int string : pair (map int string) (lambda string bytes) ] */ ; + DIP { UNPAIR /* [ map int string : lambda string bytes ] */ } + /* [ map int string : map int string : lambda string bytes ] */ ; + PACK + /* [ bytes : map int string : lambda string bytes ] */ ; + DIP { PACK + /* [ bytes : lambda string bytes ] */ ; + UNPACK (map int string) + /* [ option (map int string) : lambda string bytes ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes : lambda string bytes ] */ } + /* [ bytes : bytes : lambda string bytes ] */ ; + ASSERT_CMPEQ ; + DUP + /* [ lambda string bytes : lambda string bytes ] */ ; + PACK + /* [ bytes : lambda string bytes ] */ ; + DIP { PACK + /* [ bytes ] */ ; + UNPACK (lambda string bytes) + /* [ option (lambda string bytes) ] */ ; + ASSERT_SOME ; + PACK + /* [ bytes ] */ } + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pair_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pair_id.tz.out new file mode 100644 index 000000000000..c03b61d9c327 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pair_id.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/pair_id.tz --details +Well typed +Gas remaining: 1039996.769 units remaining +{ parameter (pair bool bool) ; + storage (option (pair bool bool)) ; + code { CAR + /* [ pair bool bool ] */ ; + SOME + /* [ option (pair bool bool) ] */ ; + NIL operation + /* [ list operation : option (pair bool bool) ] */ ; + PAIR + /* [ pair (list operation) (option (pair bool bool)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pairing_check.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pairing_check.tz.out new file mode 100644 index 000000000000..979218cc1e64 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pairing_check.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/pairing_check.tz --details +Well typed +Gas remaining: 1039996.509 units remaining +{ parameter (list (pair bls12_381_g1 bls12_381_g2)) ; + storage (option bool) ; + code { CAR + /* [ list (pair bls12_381_g1 bls12_381_g2) ] */ ; + PAIRING_CHECK + /* [ bool ] */ ; + SOME + /* [ option bool ] */ ; + NIL operation + /* [ list operation : option bool ] */ ; + PAIR + /* [ pair (list operation) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec.tz.out new file mode 100644 index 000000000000..422524fb55c7 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/pexec.tz --details +Well typed +Gas remaining: 1039993.994 units remaining +{ parameter nat ; + storage nat ; + code { LAMBDA + (pair nat nat) + nat + { UNPAIR /* [ nat : nat ] */ ; ADD /* [ nat ] */ } + /* [ lambda (pair nat nat) nat : pair nat nat ] */ ; + SWAP + /* [ pair nat nat : lambda (pair nat nat) nat ] */ ; + UNPAIR + /* [ nat : nat : lambda (pair nat nat) nat ] */ ; + DIP { APPLY /* [ lambda nat nat ] */ } + /* [ nat : lambda nat nat ] */ ; + EXEC + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec_2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec_2.tz.out new file mode 100644 index 000000000000..656b7dd701b4 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-pexec_2.tz.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/pexec_2.tz --details +Well typed +Gas remaining: 1039988.161 units remaining +{ parameter int ; + storage (list int) ; + code { UNPAIR @p @s + /* [ int : list int ] */ ; + LAMBDA + (pair int (pair int int)) + int + { UNPAIR + /* [ int : pair int int ] */ ; + DIP { UNPAIR /* [ int : int ] */ } + /* [ int : int : int ] */ ; + ADD + /* [ int : int ] */ ; + MUL + /* [ int ] */ } + /* [ lambda (pair int int int) int : int : list int ] */ ; + SWAP + /* [ int : lambda (pair int int int) int : list int ] */ ; + APPLY + /* [ lambda (pair int int) int : list int ] */ ; + PUSH int 3 + /* [ int : lambda (pair int int) int : list int ] */ ; + APPLY + /* [ lambda int int : list int ] */ ; + SWAP + /* [ list int : lambda int int ] */ ; + MAP { DIP { DUP /* [ lambda int int : lambda int int ] */ } + /* [ int : lambda int int : lambda int int ] */ ; + EXEC + /* [ int : lambda int int ] */ } + /* [ list int : lambda int int ] */ ; + DIP { DROP /* [] */ } + /* [ list int ] */ ; + NIL operation + /* [ list operation : list int ] */ ; + PAIR + /* [ pair (list operation) (list int) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-proxy.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-proxy.tz.out new file mode 100644 index 000000000000..d3399a45d0ae --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-proxy.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/proxy.tz --details +Well typed +Gas remaining: 1039995.281 units remaining +{ parameter (contract unit) ; + storage unit ; + code { UNPAIR + /* [ contract unit : unit ] */ ; + AMOUNT + /* [ mutez : contract unit : unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : unit ] */ ; + TRANSFER_TOKENS + /* [ operation : unit ] */ ; + DIP { NIL operation /* [ list operation : unit ] */ } + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ret_int.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ret_int.tz.out new file mode 100644 index 000000000000..6d9d4e534214 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ret_int.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ret_int.tz --details +Well typed +Gas remaining: 1039996.556 units remaining +{ parameter unit ; + storage (option nat) ; + code { DROP + /* [] */ ; + PUSH nat 300 + /* [ nat ] */ ; + SOME + /* [ option nat ] */ ; + NIL operation + /* [ list operation : option nat ] */ ; + PAIR + /* [ pair (list operation) (option nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse.tz.out new file mode 100644 index 000000000000..3537b25e178f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/reverse.tz --details +Well typed +Gas remaining: 1039995.453 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + NIL string + /* [ list string : list string ] */ ; + SWAP + /* [ list string : list string ] */ ; + ITER { CONS /* [ list string ] */ } + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse_loop.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse_loop.tz.out new file mode 100644 index 000000000000..73b2195ea876 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-reverse_loop.tz.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/reverse_loop.tz --details +Well typed +Gas remaining: 1039990.243 units remaining +{ parameter (list string) ; + storage (list string) ; + code { CAR + /* [ list string ] */ ; + NIL string + /* [ list string : list string ] */ ; + SWAP + /* [ list string : list string ] */ ; + PUSH bool True + /* [ bool : list string : list string ] */ ; + LOOP { IF_CONS + { SWAP + /* [ list string : string : list string ] */ ; + DIP { CONS /* [ list string ] */ } + /* [ list string : list string ] */ ; + PUSH bool True + /* [ bool : list string : list string ] */ } + { NIL string + /* [ list string : list string ] */ ; + PUSH bool False + /* [ bool : list string : list string ] */ } } + /* [ list string : list string ] */ ; + DROP + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sapling_empty_state.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sapling_empty_state.tz.out new file mode 100644 index 000000000000..192b640c6687 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sapling_empty_state.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sapling_empty_state.tz --details +Well typed +Gas remaining: 1039997.397 units remaining +{ parameter unit ; + storage (sapling_state 8) ; + code { DROP + /* [] */ ; + SAPLING_EMPTY_STATE 8 + /* [ sapling_state 8 ] */ ; + NIL operation + /* [ list operation : sapling_state 8 ] */ ; + PAIR + /* [ pair (list operation) (sapling_state 8) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self.tz.out new file mode 100644 index 000000000000..5f5ff41b6f7a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self.tz --details +Well typed +Gas remaining: 1039996.945 units remaining +{ parameter unit ; + storage address ; + code { DROP + /* [] */ ; + SELF + /* [ contract unit ] */ ; + ADDRESS + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address.tz.out new file mode 100644 index 000000000000..699a8d255a03 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address.tz.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_address.tz --details +Well typed +Gas remaining: 1039990.189 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + LAMBDA + unit + address + { DROP /* [] */ ; SELF_ADDRESS /* [ address ] */ } + /* [ lambda unit address ] */ ; + UNIT + /* [ unit : lambda unit address ] */ ; + EXEC + /* [ address ] */ ; + SELF + /* [ contract unit : address ] */ ; + ADDRESS + /* [ address : address ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_fib_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_fib_view.tz.out new file mode 100644 index 000000000000..f795bcf2d439 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_fib_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_address_after_fib_view.tz --details +Well typed +Gas remaining: 1039986.567 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 3 + /* [ nat : address : address ] */ ; + VIEW "fib" nat + /* [ option nat : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF_ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_nonexistent_vie.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_nonexistent_vie.out new file mode 100644 index 000000000000..aff09a91bd7e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_nonexistent_vie.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_address_after_nonexistent_view.tz --details +Well typed +Gas remaining: 1039987.050 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" string + /* [ option string : address ] */ ; + ASSERT_NONE ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF_ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_view.tz.out new file mode 100644 index 000000000000..bba06561049e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_address_after_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_address_after_view.tz --details +Well typed +Gas remaining: 1039986.392 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF_ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_fib_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_fib_view.tz.out new file mode 100644 index 000000000000..ff7889cbfede --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_fib_view.tz.out @@ -0,0 +1,40 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_after_fib_view.tz --details +Well typed +Gas remaining: 1039986.060 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 3 + /* [ nat : address : address ] */ ; + VIEW "fib" nat + /* [ option nat : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF + /* [ contract address : operation ] */ ; + ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_nonexistent_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_nonexistent_view.tz.out new file mode 100644 index 000000000000..fc1f297fafdd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_nonexistent_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_after_nonexistent_view.tz --details +Well typed +Gas remaining: 1039986.452 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "nonexistent" string + /* [ option string : address ] */ ; + ASSERT_NONE ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF + /* [ contract address : operation ] */ ; + ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_view.tz.out new file mode 100644 index 000000000000..8547f2996ce6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_after_view.tz.out @@ -0,0 +1,40 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_after_view.tz --details +Well typed +Gas remaining: 1039985.886 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SELF + /* [ contract address : operation ] */ ; + ADDRESS + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_default_entrypoint.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_default_entrypoint.tz.out new file mode 100644 index 000000000000..11b892d9c73f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_default_entrypoint.tz.out @@ -0,0 +1,31 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_with_default_entrypoint.tz --details +Well typed +Gas remaining: 1039988.800 units remaining +{ parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %default) (string %C))) ; + storage unit ; + code { DROP + /* [] */ ; + SELF + /* [ contract unit ] */ ; + DROP + /* [] */ ; + SELF %A + /* [ contract nat ] */ ; + DROP + /* [] */ ; + SELF %default + /* [ contract unit ] */ ; + PACK + /* [ bytes ] */ ; + SELF + /* [ contract unit : bytes ] */ ; + PACK + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_entrypoint.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_entrypoint.tz.out new file mode 100644 index 000000000000..94b0af671e24 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-self_with_entrypoint.tz.out @@ -0,0 +1,68 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/self_with_entrypoint.tz --details +Well typed +Gas remaining: 1039970.861 units remaining +{ parameter (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C))) ; + storage unit ; + code { DROP + /* [] */ ; + SELF %A + /* [ contract nat ] */ ; + PACK @Apacked + /* [ bytes ] */ ; + SELF %default + /* [ contract (or (or nat bool) (or unit string)) : bytes ] */ ; + PACK @defpacked + /* [ bytes : bytes ] */ ; + DUP + /* [ bytes : bytes : bytes ] */ ; + DIP { SWAP /* [ bytes : bytes ] */ } + /* [ bytes : bytes : bytes ] */ ; + ASSERT_CMPNEQ ; + SELF + /* [ contract (or (or nat bool) (or unit string)) : bytes ] */ ; + PACK @selfpacked + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + SELF %A + /* [ contract nat ] */ ; + CAST (contract nat) + /* [ contract nat ] */ ; + DROP + /* [] */ ; + SELF %B + /* [ contract bool ] */ ; + CAST (contract bool) + /* [ contract bool ] */ ; + DROP + /* [] */ ; + SELF %maybe_C + /* [ contract (or unit string) ] */ ; + CAST (contract (or unit string)) + /* [ contract (or unit string) ] */ ; + DROP + /* [] */ ; + SELF %Z + /* [ contract unit ] */ ; + CAST (contract unit) + /* [ contract unit ] */ ; + DROP + /* [] */ ; + SELF + /* [ contract (or (or nat bool) (or unit string)) ] */ ; + CAST (contract (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))) + /* [ contract (or (or nat bool) (or unit string)) ] */ ; + DROP + /* [] */ ; + SELF %default + /* [ contract (or (or nat bool) (or unit string)) ] */ ; + CAST (contract (or (or (nat %A) (bool %B)) (or %maybe_C (unit %Z) (string %C)))) + /* [ contract (or (or nat bool) (or unit string)) ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender.tz.out new file mode 100644 index 000000000000..cf0fab49a05e --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sender.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage address ; + code { DROP + /* [] */ ; + SENDER + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_fib_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_fib_view.tz.out new file mode 100644 index 000000000000..5d557fc01a56 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_fib_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sender_after_fib_view.tz --details +Well typed +Gas remaining: 1039986.567 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 3 + /* [ nat : address : address ] */ ; + VIEW "fib" nat + /* [ option nat : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SENDER + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_nonexistent_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_nonexistent_view.tz.out new file mode 100644 index 000000000000..083175ebf32d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_nonexistent_view.tz.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sender_after_nonexistent_view.tz --details +Well typed +Gas remaining: 1039987.050 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" string + /* [ option string : address ] */ ; + ASSERT_NONE ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SENDER + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_view.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_view.tz.out new file mode 100644 index 000000000000..ec6cfdb77fea --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sender_after_view.tz.out @@ -0,0 +1,38 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sender_after_view.tz --details +Well typed +Gas remaining: 1039986.392 units remaining +{ parameter address ; + storage address ; + code { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + PUSH nat 0 + /* [ nat : address : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) : address ] */ ; + ASSERT_SOME ; + DROP + /* [ address ] */ ; + CONTRACT nat + /* [ option (contract nat) ] */ ; + ASSERT_SOME ; + PUSH mutez 1500 + /* [ mutez : contract nat ] */ ; + PUSH nat 0 + /* [ nat : mutez : contract nat ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + SENDER + /* [ address : operation ] */ ; + SWAP + /* [ operation : address ] */ ; + NIL operation + /* [ list operation : operation : address ] */ ; + SWAP + /* [ operation : list operation : address ] */ ; + CONS + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_car.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_car.tz.out new file mode 100644 index 000000000000..73a3e92c73d2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_car.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_car.tz --details +Well typed +Gas remaining: 1039992.274 units remaining +{ parameter string ; + storage (pair (string %s) (nat %n)) ; + code { DUP + /* [ pair string string nat : pair string string nat ] */ ; + CDR + /* [ pair string nat : pair string string nat ] */ ; + DIP { CAR /* [ string ] */ } + /* [ pair string nat : string ] */ ; + SET_CAR %s ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_cdr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_cdr.tz.out new file mode 100644 index 000000000000..4d5eeea8c1b5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_cdr.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_cdr.tz --details +Well typed +Gas remaining: 1039992.742 units remaining +{ parameter nat ; + storage (pair (string %s) (nat %n)) ; + code { DUP + /* [ pair nat string nat : pair nat string nat ] */ ; + CDR + /* [ pair string nat : pair nat string nat ] */ ; + DIP { CAR /* [ nat ] */ } + /* [ pair string nat : nat ] */ ; + SET_CDR %n ; + NIL operation + /* [ list operation : pair string nat ] */ ; + PAIR + /* [ pair (list operation) string nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_delegate.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_delegate.tz.out new file mode 100644 index 000000000000..b51098de57a9 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_delegate.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_delegate.tz --details +Well typed +Gas remaining: 1039996.276 units remaining +{ parameter (option key_hash) ; + storage unit ; + code { UNPAIR + /* [ option key_hash : unit ] */ ; + SET_DELEGATE + /* [ operation : unit ] */ ; + DIP { NIL operation /* [ list operation : unit ] */ } + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_id.tz.out new file mode 100644 index 000000000000..b2050e7e6f9d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_id.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_id.tz --details +Well typed +Gas remaining: 1039997.680 units remaining +{ parameter (set string) ; + storage (set string) ; + code { CAR + /* [ set string ] */ ; + NIL operation + /* [ list operation : set string ] */ ; + PAIR + /* [ pair (list operation) (set string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_iter.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_iter.tz.out new file mode 100644 index 000000000000..102a7b10f115 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_iter.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_iter.tz --details +Well typed +Gas remaining: 1039995.593 units remaining +{ parameter (set int) ; + storage int ; + code { CAR + /* [ set int ] */ ; + PUSH int 0 + /* [ int : set int ] */ ; + SWAP + /* [ set int : int ] */ ; + ITER { ADD /* [ int ] */ } + /* [ int ] */ ; + NIL operation + /* [ list operation : int ] */ ; + PAIR + /* [ pair (list operation) int ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_member.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_member.tz.out new file mode 100644 index 000000000000..aa9807ed3379 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_member.tz.out @@ -0,0 +1,32 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_member.tz --details +Well typed +Gas remaining: 1039989.840 units remaining +{ parameter string ; + storage (pair (set string) (option bool)) ; + code { DUP + /* [ pair string (set string) (option bool) + : pair string (set string) (option bool) ] */ ; + DUP + /* [ pair string (set string) (option bool) + : pair string (set string) (option bool) + : pair string (set string) (option bool) ] */ ; + CAR + /* [ string : pair string (set string) (option bool) + : pair string (set string) (option bool) ] */ ; + DIP { CDAR } + /* [ string : set string : pair string (set string) (option bool) ] */ ; + MEM + /* [ bool : pair string (set string) (option bool) ] */ ; + SOME + /* [ option bool : pair string (set string) (option bool) ] */ ; + DIP { CDAR } + /* [ option bool : set string ] */ ; + SWAP + /* [ set string : option bool ] */ ; + PAIR + /* [ pair (set string) (option bool) ] */ ; + NIL operation + /* [ list operation : pair (set string) (option bool) ] */ ; + PAIR + /* [ pair (list operation) (set string) (option bool) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_size.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_size.tz.out new file mode 100644 index 000000000000..5bb0c0afa1ff --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-set_size.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/set_size.tz --details +Well typed +Gas remaining: 1039997.360 units remaining +{ parameter (set int) ; + storage nat ; + code { CAR + /* [ set int ] */ ; + SIZE + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sets.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sets.tz.out new file mode 100644 index 000000000000..194e734093f6 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sets.tz.out @@ -0,0 +1,68 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sets.tz --details +Well typed +Gas remaining: 1039953.534 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH (set nat) { 0 ; 1 ; 3 } + /* [ set nat ] */ ; + DROP + /* [] */ ; + PUSH (set int) { -1 ; 0 ; 3 } + /* [ set int ] */ ; + DROP + /* [] */ ; + PUSH (set mutez) { 1 ; 4 ; 5 ; 10 ; 1923 } + /* [ set mutez ] */ ; + DROP + /* [] */ ; + PUSH (set timestamp) + { -1 ; 0 ; "2017-09-16T08:38:04Z" ; "2019-09-16T08:38:05Z" } + /* [ set timestamp ] */ ; + DROP + /* [] */ ; + PUSH (set bool) {} + /* [ set bool ] */ ; + DROP + /* [] */ ; + PUSH (set bool) { True } + /* [ set bool ] */ ; + DROP + /* [] */ ; + PUSH (set bool) { False } + /* [ set bool ] */ ; + DROP + /* [] */ ; + PUSH (set bool) { False ; True } + /* [ set bool ] */ ; + DROP + /* [] */ ; + PUSH (set string) { "" ; "A" ; "B" ; "a" ; "aa" ; "b" } + /* [ set string ] */ ; + DROP + /* [] */ ; + PUSH (set bytes) { 0x ; 0x01 ; 0x02 ; 0xaabbcc } + /* [ set bytes ] */ ; + DROP + /* [] */ ; + PUSH (set key_hash) + { "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ; + "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" } + /* [ set key_hash ] */ ; + DROP + /* [] */ ; + PUSH (set address) + { "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" ; + "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv" ; + "KT1TZCh8fmUbuDqFxetPWC2fsQanAHzLx4W9" } + /* [ set address ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sha3.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sha3.tz.out new file mode 100644 index 000000000000..19770d9bba78 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sha3.tz.out @@ -0,0 +1,16 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sha3.tz --details +Well typed +Gas remaining: 1039996.837 units remaining +{ storage (option bytes) ; + parameter bytes ; + code { CAR + /* [ bytes ] */ ; + SHA3 + /* [ bytes ] */ ; + SOME + /* [ option bytes ] */ ; + NIL operation + /* [ list operation : option bytes ] */ ; + PAIR + /* [ pair (list operation) (option bytes) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-shifts.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-shifts.tz.out new file mode 100644 index 000000000000..eebc6a7f431a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-shifts.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/shifts.tz --details +Well typed +Gas remaining: 1039994.259 units remaining +{ parameter (or (pair nat nat) (pair nat nat)) ; + storage (option nat) ; + code { CAR + /* [ or (pair nat nat) (pair nat nat) ] */ ; + IF_LEFT + { UNPAIR /* [ nat : nat ] */ ; LSL /* [ nat ] */ } + { UNPAIR /* [ nat : nat ] */ ; LSR /* [ nat ] */ } ; + SOME + /* [ option nat ] */ ; + NIL operation + /* [ list operation : option nat ] */ ; + PAIR + /* [ pair (list operation) (option nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice.tz.out new file mode 100644 index 000000000000..7f236fdadd53 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/slice.tz --details +Well typed +Gas remaining: 1039993.747 units remaining +{ parameter (pair nat nat) ; + storage (option string) ; + code { UNPAIR + /* [ pair nat nat : option string ] */ ; + SWAP + /* [ option string : pair nat nat ] */ ; + IF_SOME + { SWAP + /* [ pair nat nat : string ] */ ; + UNPAIR + /* [ nat : nat : string ] */ ; + SLICE + /* [ option string ] */ } + { DROP /* [] */ ; NONE string /* [ option string ] */ } ; + NIL operation + /* [ list operation : option string ] */ ; + PAIR + /* [ pair (list operation) (option string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice_bytes.tz.out new file mode 100644 index 000000000000..8ca48ce6ac47 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slice_bytes.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/slice_bytes.tz --details +Well typed +Gas remaining: 1039993.747 units remaining +{ parameter (pair nat nat) ; + storage (option bytes) ; + code { UNPAIR + /* [ pair nat nat : option bytes ] */ ; + SWAP + /* [ option bytes : pair nat nat ] */ ; + IF_SOME + { SWAP + /* [ pair nat nat : bytes ] */ ; + UNPAIR + /* [ nat : nat : bytes ] */ ; + SLICE + /* [ option bytes ] */ } + { DROP /* [] */ ; NONE bytes /* [ option bytes ] */ } ; + NIL operation + /* [ list operation : option bytes ] */ ; + PAIR + /* [ pair (list operation) (option bytes) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slices.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slices.tz.out new file mode 100644 index 000000000000..c667def97bb8 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-slices.tz.out @@ -0,0 +1,116 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/slices.tz --details +Well typed +Gas remaining: 1039937.057 units remaining +{ parameter (pair bytes signature) ; + storage key ; + code { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CAAR ; + DUP + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + SIZE + /* [ nat : bytes : pair (pair bytes signature) key ] */ ; + PUSH nat 128 + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SWAP + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SUB + /* [ int : bytes : pair (pair bytes signature) key ] */ ; + ISNAT + /* [ option nat : bytes : pair (pair bytes signature) key ] */ ; + IF_SOME { /* [ nat : bytes : pair (pair bytes signature) key ] */ } { FAIL } ; + PUSH nat 128 + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SLICE @payload + /* [ option bytes : pair (pair bytes signature) key ] */ ; + ASSERT_SOME ; + DUP + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + DIP { DIP { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CAAR ; + PUSH nat 32 + /* [ nat : bytes : pair (pair bytes signature) key ] */ ; + PUSH nat 0 + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SLICE + /* [ option bytes : pair (pair bytes signature) key ] */ ; + ASSERT_SOME } + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + SHA256 + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + ASSERT_CMPEQ } + /* [ bytes : pair (pair bytes signature) key ] */ ; + DUP + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + DIP { DIP { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CAAR ; + PUSH nat 32 + /* [ nat : bytes : pair (pair bytes signature) key ] */ ; + PUSH nat 32 + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SLICE + /* [ option bytes : pair (pair bytes signature) key ] */ ; + ASSERT_SOME } + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + BLAKE2B + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + ASSERT_CMPEQ } + /* [ bytes : pair (pair bytes signature) key ] */ ; + DUP + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + DIP { DIP { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CAAR ; + PUSH nat 64 + /* [ nat : bytes : pair (pair bytes signature) key ] */ ; + PUSH nat 64 + /* [ nat : nat : bytes : pair (pair bytes signature) key ] */ ; + SLICE + /* [ option bytes : pair (pair bytes signature) key ] */ ; + ASSERT_SOME } + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + SHA512 + /* [ bytes : bytes : pair (pair bytes signature) key ] */ ; + ASSERT_CMPEQ } + /* [ bytes : pair (pair bytes signature) key ] */ ; + DIP { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CDR + /* [ key : pair (pair bytes signature) key ] */ ; + DIP { DUP + /* [ pair (pair bytes signature) key : pair (pair bytes signature) key ] */ ; + CADR } + /* [ key : signature : pair (pair bytes signature) key ] */ } + /* [ bytes : key : signature : pair (pair bytes signature) key ] */ ; + SWAP + /* [ key : bytes : signature : pair (pair bytes signature) key ] */ ; + DIP { SWAP /* [ signature : bytes : pair (pair bytes signature) key ] */ } + /* [ key : signature : bytes : pair (pair bytes signature) key ] */ ; + CHECK_SIGNATURE + /* [ bool : pair (pair bytes signature) key ] */ ; + ASSERT ; + CDR + /* [ key ] */ ; + DUP + /* [ key : key ] */ ; + HASH_KEY + /* [ key_hash : key ] */ ; + IMPLICIT_ACCOUNT + /* [ contract unit : key ] */ ; + BALANCE + /* [ mutez : contract unit : key ] */ ; + UNIT + /* [ unit : mutez : contract unit : key ] */ ; + TRANSFER_TOKENS + /* [ operation : key ] */ ; + NIL operation + /* [ list operation : operation : key ] */ ; + SWAP + /* [ operation : list operation : key ] */ ; + CONS + /* [ list operation : key ] */ ; + PAIR + /* [ pair (list operation) key ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-source.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-source.tz.out new file mode 100644 index 000000000000..71ff140a9259 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-source.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/source.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage address ; + code { DROP + /* [] */ ; + SOURCE + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_bytes.tz.out new file mode 100644 index 000000000000..1854554c7f7f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_bytes.tz.out @@ -0,0 +1,71 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/split_bytes.tz --details +Well typed +Gas remaining: 1039973.337 units remaining +{ parameter bytes ; + storage (list bytes) ; + code { UNPAIR + /* [ bytes : list bytes ] */ ; + DIP { NIL bytes + /* [ list bytes : list bytes ] */ ; + SWAP + /* [ list bytes : list bytes ] */ ; + ITER { CONS /* [ list bytes ] */ } + /* [ list bytes ] */ } + /* [ bytes : list bytes ] */ ; + DUP + /* [ bytes : bytes : list bytes ] */ ; + SIZE + /* [ nat : bytes : list bytes ] */ ; + PUSH nat 0 + /* [ nat : nat : bytes : list bytes ] */ ; + CMPNEQ ; + DIP { PUSH @index nat 0 /* [ nat : bytes : list bytes ] */ } + /* [ bool : nat : bytes : list bytes ] */ ; + LOOP { PAIR + /* [ pair nat bytes : list bytes ] */ ; + DUP + /* [ pair nat bytes : pair nat bytes : list bytes ] */ ; + DIP { UNPAIR + /* [ nat : bytes : list bytes ] */ ; + DIP { PUSH nat 1 /* [ nat : bytes : list bytes ] */ } + /* [ nat : nat : bytes : list bytes ] */ ; + SLICE + /* [ option bytes : list bytes ] */ ; + ASSERT_SOME ; + CONS @storage + /* [ list bytes ] */ } + /* [ pair nat bytes : list bytes ] */ ; + UNPAIR + /* [ nat : bytes : list bytes ] */ ; + PUSH nat 1 + /* [ nat : nat : bytes : list bytes ] */ ; + ADD @index + /* [ nat : bytes : list bytes ] */ ; + DUP + /* [ nat : nat : bytes : list bytes ] */ ; + DIP { DIP { DUP /* [ bytes : bytes : list bytes ] */ } + /* [ nat : bytes : bytes : list bytes ] */ ; + SWAP + /* [ bytes : nat : bytes : list bytes ] */ ; + SIZE + /* [ nat : nat : bytes : list bytes ] */ ; + CMPNEQ } + /* [ nat : bool : bytes : list bytes ] */ ; + SWAP + /* [ bool : nat : bytes : list bytes ] */ } + /* [ nat : bytes : list bytes ] */ ; + DROP + /* [ bytes : list bytes ] */ ; + DROP + /* [ list bytes ] */ ; + NIL bytes + /* [ list bytes : list bytes ] */ ; + SWAP + /* [ list bytes : list bytes ] */ ; + ITER { CONS /* [ list bytes ] */ } + /* [ list bytes ] */ ; + NIL operation + /* [ list operation : list bytes ] */ ; + PAIR + /* [ pair (list operation) (list bytes) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_string.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_string.tz.out new file mode 100644 index 000000000000..232e1a65864b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-split_string.tz.out @@ -0,0 +1,71 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/split_string.tz --details +Well typed +Gas remaining: 1039973.337 units remaining +{ parameter string ; + storage (list string) ; + code { UNPAIR + /* [ string : list string ] */ ; + DIP { NIL string + /* [ list string : list string ] */ ; + SWAP + /* [ list string : list string ] */ ; + ITER { CONS /* [ list string ] */ } + /* [ list string ] */ } + /* [ string : list string ] */ ; + DUP + /* [ string : string : list string ] */ ; + SIZE + /* [ nat : string : list string ] */ ; + PUSH nat 0 + /* [ nat : nat : string : list string ] */ ; + CMPNEQ ; + DIP { PUSH @index nat 0 /* [ nat : string : list string ] */ } + /* [ bool : nat : string : list string ] */ ; + LOOP { PAIR + /* [ pair nat string : list string ] */ ; + DUP + /* [ pair nat string : pair nat string : list string ] */ ; + DIP { UNPAIR + /* [ nat : string : list string ] */ ; + DIP { PUSH nat 1 /* [ nat : string : list string ] */ } + /* [ nat : nat : string : list string ] */ ; + SLICE + /* [ option string : list string ] */ ; + ASSERT_SOME ; + CONS @storage + /* [ list string ] */ } + /* [ pair nat string : list string ] */ ; + UNPAIR + /* [ nat : string : list string ] */ ; + PUSH nat 1 + /* [ nat : nat : string : list string ] */ ; + ADD @index + /* [ nat : string : list string ] */ ; + DUP + /* [ nat : nat : string : list string ] */ ; + DIP { DIP { DUP /* [ string : string : list string ] */ } + /* [ nat : string : string : list string ] */ ; + SWAP + /* [ string : nat : string : list string ] */ ; + SIZE + /* [ nat : nat : string : list string ] */ ; + CMPNEQ } + /* [ nat : bool : string : list string ] */ ; + SWAP + /* [ bool : nat : string : list string ] */ } + /* [ nat : string : list string ] */ ; + DROP + /* [ string : list string ] */ ; + DROP + /* [ list string ] */ ; + NIL string + /* [ list string : list string ] */ ; + SWAP + /* [ list string : list string ] */ ; + ITER { CONS /* [ list string ] */ } + /* [ list string ] */ ; + NIL operation + /* [ list operation : list string ] */ ; + PAIR + /* [ pair (list operation) (list string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_fr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_fr.tz.out new file mode 100644 index 000000000000..c859d88b111a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_fr.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/store_bls12_381_fr.tz --details +Well typed +Gas remaining: 1039997.300 units remaining +{ parameter bls12_381_fr ; + storage (option bls12_381_fr) ; + code { CAR + /* [ bls12_381_fr ] */ ; + SOME + /* [ option bls12_381_fr ] */ ; + NIL operation + /* [ list operation : option bls12_381_fr ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_fr) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g1.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g1.tz.out new file mode 100644 index 000000000000..1a9cc6766d22 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g1.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/store_bls12_381_g1.tz --details +Well typed +Gas remaining: 1039997.300 units remaining +{ parameter bls12_381_g1 ; + storage (option bls12_381_g1) ; + code { CAR + /* [ bls12_381_g1 ] */ ; + SOME + /* [ option bls12_381_g1 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g1 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g1) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g2.tz.out new file mode 100644 index 000000000000..6d0d2a69e8eb --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_bls12_381_g2.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/store_bls12_381_g2.tz --details +Well typed +Gas remaining: 1039997.300 units remaining +{ parameter bls12_381_g2 ; + storage (option bls12_381_g2) ; + code { CAR + /* [ bls12_381_g2 ] */ ; + SOME + /* [ option bls12_381_g2 ] */ ; + NIL operation + /* [ list operation : option bls12_381_g2 ] */ ; + PAIR + /* [ pair (list operation) (option bls12_381_g2) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_input.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_input.tz.out new file mode 100644 index 000000000000..771d06dcd0ae --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_input.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/store_input.tz --details +Well typed +Gas remaining: 1039997.907 units remaining +{ parameter string ; + storage string ; + code { CAR + /* [ string ] */ ; + NIL operation + /* [ list operation : string ] */ ; + PAIR + /* [ pair (list operation) string ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_now.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_now.tz.out new file mode 100644 index 000000000000..eae6e704f7de --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-store_now.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/store_now.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage timestamp ; + code { DROP + /* [] */ ; + NOW + /* [ timestamp ] */ ; + NIL operation + /* [ list operation : timestamp ] */ ; + PAIR + /* [ pair (list operation) timestamp ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-str_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-str_id.tz.out new file mode 100644 index 000000000000..403ae17d91c5 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-str_id.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/str_id.tz --details +Well typed +Gas remaining: 1039997.300 units remaining +{ parameter string ; + storage (option string) ; + code { CAR + /* [ string ] */ ; + SOME + /* [ option string ] */ ; + NIL operation + /* [ list operation : option string ] */ ; + PAIR + /* [ pair (list operation) (option string) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sub_timestamp_delta.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sub_timestamp_delta.tz.out new file mode 100644 index 000000000000..b5c543a43198 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-sub_timestamp_delta.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/sub_timestamp_delta.tz --details +Well typed +Gas remaining: 1039995.013 units remaining +{ parameter (pair timestamp int) ; + storage timestamp ; + code { CAR + /* [ pair timestamp int ] */ ; + DUP + /* [ pair timestamp int : pair timestamp int ] */ ; + CAR + /* [ timestamp : pair timestamp int ] */ ; + DIP { CDR /* [ int ] */ } + /* [ timestamp : int ] */ ; + SUB + /* [ timestamp ] */ ; + NIL operation + /* [ list operation : timestamp ] */ ; + PAIR + /* [ pair (list operation) timestamp ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-subset.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-subset.tz.out new file mode 100644 index 000000000000..62f72a0c6d3a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-subset.tz.out @@ -0,0 +1,45 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/subset.tz --details +Well typed +Gas remaining: 1039986.401 units remaining +{ parameter (pair (set string) (set string)) ; + storage bool ; + code { CAR + /* [ pair (set string) (set string) ] */ ; + DUP + /* [ pair (set string) (set string) : pair (set string) (set string) ] */ ; + CDR + /* [ set string : pair (set string) (set string) ] */ ; + DIP { CAR /* [ set string ] */ } + /* [ set string : set string ] */ ; + PUSH bool True + /* [ bool : set string : set string ] */ ; + PAIR + /* [ pair bool (set string) : set string ] */ ; + SWAP + /* [ set string : pair bool (set string) ] */ ; + ITER { DIP { DUP + /* [ pair bool (set string) : pair bool (set string) ] */ ; + DUP + /* [ pair bool (set string) : pair bool (set string) : pair bool (set string) ] */ ; + CDR + /* [ set string : pair bool (set string) : pair bool (set string) ] */ ; + DIP { CAR + /* [ bool : pair bool (set string) ] */ ; + DIP { CDR /* [ set string ] */ } + /* [ bool : set string ] */ } + /* [ set string : bool : set string ] */ } + /* [ string : set string : bool : set string ] */ ; + MEM + /* [ bool : bool : set string ] */ ; + AND + /* [ bool : set string ] */ ; + PAIR + /* [ pair bool (set string) ] */ } + /* [ pair bool (set string) ] */ ; + CAR + /* [ bool ] */ ; + NIL operation + /* [ list operation : bool ] */ ; + PAIR + /* [ pair (list operation) bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-tez_add_sub.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-tez_add_sub.tz.out new file mode 100644 index 000000000000..0435e59fc31f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-tez_add_sub.tz.out @@ -0,0 +1,36 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/tez_add_sub.tz --details +Well typed +Gas remaining: 1039987.345 units remaining +{ parameter (pair mutez mutez) ; + storage (option (pair mutez mutez)) ; + code { CAR + /* [ pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez ] */ ; + DUP + /* [ pair mutez mutez : pair mutez mutez : pair mutez mutez ] */ ; + CAR + /* [ mutez : pair mutez mutez : pair mutez mutez ] */ ; + DIP { CDR /* [ mutez : pair mutez mutez ] */ } + /* [ mutez : mutez : pair mutez mutez ] */ ; + ADD + /* [ mutez : pair mutez mutez ] */ ; + DIP { DUP + /* [ pair mutez mutez : pair mutez mutez ] */ ; + CAR + /* [ mutez : pair mutez mutez ] */ ; + DIP { CDR /* [ mutez ] */ } + /* [ mutez : mutez ] */ ; + SUB_MUTEZ + /* [ option mutez ] */ ; + ASSERT_SOME } + /* [ mutez : mutez ] */ ; + PAIR + /* [ pair mutez mutez ] */ ; + SOME + /* [ option (pair mutez mutez) ] */ ; + NIL operation + /* [ list operation : option (pair mutez mutez) ] */ ; + PAIR + /* [ pair (list operation) (option (pair mutez mutez)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_bad.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_bad.tz.out new file mode 100644 index 000000000000..67bf92953290 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_bad.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_bad.tz --details +Well typed +Gas remaining: 1039997.763 units remaining +{ parameter unit ; + storage (ticket nat) ; + code { CDR + /* [ ticket nat ] */ ; + NIL operation + /* [ list operation : ticket nat ] */ ; + PAIR + /* [ pair (list operation) (ticket nat) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_big_store.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_big_store.tz.out new file mode 100644 index 000000000000..5aa2ad1eaabd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_big_store.tz.out @@ -0,0 +1,25 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_big_store.tz --details +Well typed +Gas remaining: 1039991.976 units remaining +{ parameter nat ; + storage (big_map unit (ticket nat)) ; + code { UNPAIR + /* [ nat : big_map unit (ticket nat) ] */ ; + PUSH nat 1 + /* [ nat : nat : big_map unit (ticket nat) ] */ ; + SWAP + /* [ nat : nat : big_map unit (ticket nat) ] */ ; + TICKET + /* [ option (ticket nat) : big_map unit (ticket nat) ] */ ; + ASSERT_SOME ; + SOME + /* [ option (ticket nat) : big_map unit (ticket nat) ] */ ; + UNIT + /* [ unit : option (ticket nat) : big_map unit (ticket nat) ] */ ; + UPDATE + /* [ big_map unit (ticket nat) ] */ ; + NIL operation + /* [ list operation : big_map unit (ticket nat) ] */ ; + PAIR + /* [ pair (list operation) (big_map unit (ticket nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_join.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_join.tz.out new file mode 100644 index 000000000000..64556a384fcd --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_join.tz.out @@ -0,0 +1,23 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_join.tz --details +Well typed +Gas remaining: 1039992.503 units remaining +{ parameter (ticket nat) ; + storage (option (ticket nat)) ; + code { UNPAIR + /* [ ticket nat : option (ticket nat) ] */ ; + SWAP + /* [ option (ticket nat) : ticket nat ] */ ; + IF_NONE + { /* [ ticket nat ] */ } + { PAIR + /* [ pair (ticket nat) (ticket nat) ] */ ; + JOIN_TICKETS + /* [ option (ticket nat) ] */ ; + ASSERT_SOME } ; + SOME + /* [ option (ticket nat) ] */ ; + NIL operation + /* [ list operation : option (ticket nat) ] */ ; + PAIR + /* [ pair (list operation) (option (ticket nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_read.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_read.tz.out new file mode 100644 index 000000000000..288a16ce5dcc --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_read.tz.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_read.tz --details +Well typed +Gas remaining: 1039985.350 units remaining +{ parameter (ticket nat) ; + storage address ; + code { CAR + /* [ ticket nat ] */ ; + READ_TICKET + /* [ pair address nat nat : ticket nat ] */ ; + DIP { DROP /* [] */ } + /* [ pair address nat nat ] */ ; + UNPAIR + /* [ address : pair nat nat ] */ ; + DIP { UNPAIR /* [ nat : nat ] */ } + /* [ address : nat : nat ] */ ; + DIIP { PUSH nat 1 /* [ nat : nat ] */ ; ASSERT_CMPEQ } + /* [ address : nat ] */ ; + DIP { PUSH nat 42 /* [ nat : nat ] */ ; ASSERT_CMPEQ } + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_split.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_split.tz.out new file mode 100644 index 000000000000..84271a6e1729 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_split.tz.out @@ -0,0 +1,39 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_split.tz --details +Well typed +Gas remaining: 1039979.558 units remaining +{ parameter (ticket nat) ; + storage unit ; + code { CAR + /* [ ticket nat ] */ ; + PUSH (pair nat nat) (Pair 1 2) + /* [ pair nat nat : ticket nat ] */ ; + SWAP + /* [ ticket nat : pair nat nat ] */ ; + SPLIT_TICKET + /* [ option (pair (ticket nat) (ticket nat)) ] */ ; + ASSERT_SOME ; + UNPAIR + /* [ ticket nat : ticket nat ] */ ; + READ_TICKET + /* [ pair address nat nat : ticket nat : ticket nat ] */ ; + CDDR ; + PUSH nat 1 + /* [ nat : nat : ticket nat : ticket nat ] */ ; + ASSERT_CMPEQ ; + DROP + /* [ ticket nat ] */ ; + READ_TICKET + /* [ pair address nat nat : ticket nat ] */ ; + CDDR ; + PUSH nat 2 + /* [ nat : nat : ticket nat ] */ ; + ASSERT_CMPEQ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store-2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store-2.tz.out new file mode 100644 index 000000000000..3319de15b817 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store-2.tz.out @@ -0,0 +1,12 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_store-2.tz --details +Well typed +Gas remaining: 1039997.454 units remaining +{ parameter (option (ticket nat)) ; + storage (option (ticket nat)) ; + code { CAR + /* [ option (ticket nat) ] */ ; + NIL operation + /* [ list operation : option (ticket nat) ] */ ; + PAIR + /* [ pair (list operation) (option (ticket nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store.tz.out new file mode 100644 index 000000000000..246c9d332dca --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticket_store.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticket_store.tz --details +Well typed +Gas remaining: 1039997.074 units remaining +{ parameter (ticket nat) ; + storage (option (ticket nat)) ; + code { CAR + /* [ ticket nat ] */ ; + SOME + /* [ option (ticket nat) ] */ ; + NIL operation + /* [ list operation : option (ticket nat) ] */ ; + PAIR + /* [ pair (list operation) (option (ticket nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer-2.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer-2.tz.out new file mode 100644 index 000000000000..952184fde222 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer-2.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticketer-2.tz --details +Well typed +Gas remaining: 1039986.226 units remaining +{ parameter (pair (pair address nat) nat) ; + storage unit ; + code { CAR + /* [ pair (pair address nat) nat ] */ ; + UNPAIR + /* [ pair address nat : nat ] */ ; + UNPAIR + /* [ address : nat : nat ] */ ; + CONTRACT (ticket nat) + /* [ option (contract (ticket nat)) : nat : nat ] */ ; + ASSERT_SOME ; + DIP { TICKET /* [ option (ticket nat) ] */ ; ASSERT_SOME } + /* [ contract (ticket nat) : ticket nat ] */ ; + SWAP + /* [ ticket nat : contract (ticket nat) ] */ ; + DIP { PUSH mutez 0 /* [ mutez : contract (ticket nat) ] */ } + /* [ ticket nat : mutez : contract (ticket nat) ] */ ; + TRANSFER_TOKENS + /* [ operation ] */ ; + NIL operation + /* [ list operation : operation ] */ ; + SWAP + /* [ operation : list operation ] */ ; + CONS + /* [ list operation ] */ ; + UNIT + /* [ unit : list operation ] */ ; + SWAP + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer.tz.out new file mode 100644 index 000000000000..5ec48a618255 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-ticketer.tz.out @@ -0,0 +1,35 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/ticketer.tz --details +Well typed +Gas remaining: 1039986.744 units remaining +{ parameter address ; + storage nat ; + code { UNPAIR + /* [ address : nat ] */ ; + DIP { DUP /* [ nat : nat ] */ } + /* [ address : nat : nat ] */ ; + SWAP + /* [ nat : address : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : address : nat ] */ ; + SWAP + /* [ nat : nat : address : nat ] */ ; + TICKET + /* [ option (ticket nat) : address : nat ] */ ; + ASSERT_SOME ; + DIP { CONTRACT (ticket nat) + /* [ option (contract (ticket nat)) : nat ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract (ticket nat) : nat ] */ } + /* [ ticket nat : mutez : contract (ticket nat) : nat ] */ ; + TRANSFER_TOKENS + /* [ operation : nat ] */ ; + NIL operation + /* [ list operation : operation : nat ] */ ; + SWAP + /* [ operation : list operation : nat ] */ ; + CONS + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_amount.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_amount.tz.out new file mode 100644 index 000000000000..3071b0c3397a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_amount.tz.out @@ -0,0 +1,14 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/transfer_amount.tz --details +Well typed +Gas remaining: 1039997.443 units remaining +{ parameter unit ; + storage mutez ; + code { DROP + /* [] */ ; + AMOUNT + /* [ mutez ] */ ; + NIL operation + /* [ list operation : mutez ] */ ; + PAIR + /* [ pair (list operation) mutez ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_tokens.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_tokens.tz.out new file mode 100644 index 000000000000..4b57437fa101 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-transfer_tokens.tz.out @@ -0,0 +1,24 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/transfer_tokens.tz --details +Well typed +Gas remaining: 1039994.130 units remaining +{ parameter (contract unit) ; + storage unit ; + code { CAR + /* [ contract unit ] */ ; + DIP { UNIT /* [ unit ] */ } + /* [ contract unit : unit ] */ ; + PUSH mutez 100000000 + /* [ mutez : contract unit : unit ] */ ; + UNIT + /* [ unit : mutez : contract unit : unit ] */ ; + TRANSFER_TOKENS + /* [ operation : unit ] */ ; + NIL operation + /* [ list operation : operation : unit ] */ ; + SWAP + /* [ operation : list operation : unit ] */ ; + CONS + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-uncomb.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-uncomb.tz.out new file mode 100644 index 000000000000..8e28d64fe2ff --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-uncomb.tz.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/uncomb.tz --details +Well typed +Gas remaining: 1039993.181 units remaining +{ parameter (pair nat nat nat) ; + storage nat ; + code { CAR + /* [ pair nat nat nat ] */ ; + UNPAIR 3 + /* [ nat : nat : nat ] */ ; + PUSH nat 100 + /* [ nat : nat : nat : nat ] */ ; + MUL + /* [ nat : nat : nat ] */ ; + SWAP + /* [ nat : nat : nat ] */ ; + PUSH nat 10 + /* [ nat : nat : nat : nat ] */ ; + MUL + /* [ nat : nat : nat ] */ ; + ADD + /* [ nat : nat ] */ ; + ADD + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair.tz.out new file mode 100644 index 000000000000..563b30e704f2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair.tz.out @@ -0,0 +1,322 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/unpair.tz --details +Well typed +Gas remaining: 1039904.519 units remaining +{ parameter (unit :param_unit) ; + storage (unit :u1) ; + code { DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + UNIT + /* [ unit : unit ] */ ; + PAIR + /* [ pair unit unit ] */ ; + UNPAIR + /* [ unit : unit ] */ ; + DROP 2 + /* [] */ ; + UNIT @b + /* [ unit ] */ ; + UNIT @a + /* [ unit : unit ] */ ; + PAIR + /* [ pair unit unit ] */ ; + UNPAIR @c @d + /* [ unit : unit ] */ ; + DROP 2 + /* [] */ ; + UNIT @b + /* [ unit ] */ ; + UNIT @a + /* [ unit : unit ] */ ; + PAIR %@ %@ + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b @a @b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DROP + /* [] */ ; + UNIT @d + /* [ unit ] */ ; + UNIT @c + /* [ unit : unit ] */ ; + PAIR %a %b + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b @a @b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + UNIT + /* [ unit : unit ] */ ; + PAIR %a %b + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR % + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %a %b @a @b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @% %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @b %a %b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + UNIT + /* [ unit : unit ] */ ; + PAIR %a %b @p + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @%% @b + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @a @%% + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @%% @%% + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @% @%% + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR @%% @% + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DROP + /* [] */ ; + UNIT @b + /* [ unit ] */ ; + UNIT @a + /* [ unit : unit ] */ ; + PAIR @c + /* [ pair unit unit ] */ ; + UNPAIR @b @a + /* [ unit : unit ] */ ; + DROP 2 + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair_field_annotation_mismatch.t.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair_field_annotation_mismatch.t.out new file mode 100644 index 000000000000..e46439a82479 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-unpair_field_annotation_mismatch.t.out @@ -0,0 +1,28 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/unpair_field_annotation_mismatch.tz --details +Well typed +Gas remaining: 1039993.685 units remaining +{ parameter (unit :param_unit) ; + storage (unit :u1) ; + code { DROP + /* [] */ ; + UNIT @b + /* [ unit ] */ ; + UNIT @a + /* [ unit : unit ] */ ; + PAIR %@ %@ + /* [ pair unit unit ] */ ; + DUP + /* [ pair unit unit : pair unit unit ] */ ; + UNPAIR %c %d + /* [ unit : unit : pair unit unit ] */ ; + DROP 2 + /* [ pair unit unit ] */ ; + DROP + /* [] */ ; + UNIT + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-update_big_map.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-update_big_map.tz.out new file mode 100644 index 000000000000..920425484f44 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-update_big_map.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/update_big_map.tz --details +Well typed +Gas remaining: 1039993.471 units remaining +{ storage (pair (big_map string string) unit) ; + parameter (map string (option string)) ; + code { UNPAPAIR ; + ITER { UNPAIR + /* [ string : option string : big_map string string : unit ] */ ; + UPDATE + /* [ big_map string string : unit ] */ } + /* [ big_map string string : unit ] */ ; + PAIR + /* [ pair (big_map string string) unit ] */ ; + NIL operation + /* [ list operation : pair (big_map string string) unit ] */ ; + PAIR + /* [ pair (list operation) (big_map string string) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxo_read.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxo_read.tz.out new file mode 100644 index 000000000000..c83f94bcf3e2 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxo_read.tz.out @@ -0,0 +1,26 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/utxo_read.tz --details +Well typed +Gas remaining: 1039985.390 units remaining +{ parameter (pair (ticket nat) nat) ; + storage address ; + code { CAR + /* [ pair (ticket nat) nat ] */ ; + UNPAIR + /* [ ticket nat : nat ] */ ; + READ_TICKET + /* [ pair address nat nat : ticket nat : nat ] */ ; + DIP { DROP /* [ nat ] */ } + /* [ pair address nat nat : nat ] */ ; + UNPAIR + /* [ address : pair nat nat : nat ] */ ; + DIP { UNPAIR /* [ nat : nat : nat ] */ } + /* [ address : nat : nat : nat ] */ ; + DIIP { ASSERT_CMPEQ } + /* [ address : nat ] */ ; + DIP { PUSH nat 42 /* [ nat : nat ] */ ; ASSERT_CMPEQ } + /* [ address ] */ ; + NIL operation + /* [ list operation : address ] */ ; + PAIR + /* [ pair (list operation) address ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxor.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxor.tz.out new file mode 100644 index 000000000000..854272725426 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-utxor.tz.out @@ -0,0 +1,93 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/utxor.tz --details +Well typed +Gas remaining: 1039966.804 units remaining +{ parameter (pair address address) ; + storage nat ; + code { UNPAIR + /* [ pair address address : nat ] */ ; + DIP { DUP /* [ nat : nat ] */ } + /* [ pair address address : nat : nat ] */ ; + SWAP + /* [ nat : pair address address : nat ] */ ; + PUSH nat 5 + /* [ nat : nat : pair address address : nat ] */ ; + SWAP + /* [ nat : nat : pair address address : nat ] */ ; + TICKET + /* [ option (ticket nat) : pair address address : nat ] */ ; + ASSERT_SOME ; + PUSH nat 2 + /* [ nat : ticket nat : pair address address : nat ] */ ; + PUSH nat 3 + /* [ nat : nat : ticket nat : pair address address : nat ] */ ; + PAIR + /* [ pair nat nat : ticket nat : pair address address : nat ] */ ; + SWAP + /* [ ticket nat : pair nat nat : pair address address : nat ] */ ; + SPLIT_TICKET + /* [ option (pair (ticket nat) (ticket nat)) : pair address address : nat ] */ ; + ASSERT_SOME ; + UNPAIR + /* [ ticket nat : ticket nat : pair address address : nat ] */ ; + DIP { DIP { DUP + /* [ pair address address : pair address address : nat ] */ ; + CAR + /* [ address : pair address address : nat ] */ ; + CONTRACT + (pair (ticket nat) nat) + /* [ option (contract (pair (ticket nat) nat)) : pair address address : nat ] */ ; + ASSERT_SOME ; + PUSH mutez + 0 + /* [ mutez : contract (pair (ticket nat) nat) : pair address address : nat ] */ } + /* [ ticket nat : mutez : contract (pair (ticket nat) nat) + : pair address address : nat ] */ ; + PUSH nat + 2 + /* [ nat : ticket nat : mutez : contract (pair (ticket nat) nat) + : pair address address : nat ] */ ; + SWAP + /* [ ticket nat : nat : mutez : contract (pair (ticket nat) nat) + : pair address address : nat ] */ ; + PAIR + /* [ pair (ticket nat) nat : mutez : contract (pair (ticket nat) nat) + : pair address address : nat ] */ } + /* [ ticket nat : pair (ticket nat) nat : mutez + : contract (pair (ticket nat) nat) : pair address address : nat ] */ ; + DIP { TRANSFER_TOKENS /* [ operation : pair address address : nat ] */ } + /* [ ticket nat : operation : pair address address : nat ] */ ; + SWAP + /* [ operation : ticket nat : pair address address : nat ] */ ; + DIP { DIP { CDR + /* [ address : nat ] */ ; + CONTRACT + (pair (ticket nat) nat) + /* [ option (contract (pair (ticket nat) nat)) : nat ] */ ; + ASSERT_SOME ; + PUSH mutez 0 + /* [ mutez : contract (pair (ticket nat) nat) : nat ] */ } + /* [ ticket nat : mutez : contract (pair (ticket nat) nat) : nat ] */ ; + PUSH nat + 3 + /* [ nat : ticket nat : mutez : contract (pair (ticket nat) nat) : nat ] */ ; + SWAP + /* [ ticket nat : nat : mutez : contract (pair (ticket nat) nat) : nat ] */ ; + PAIR + /* [ pair (ticket nat) nat : mutez : contract (pair (ticket nat) nat) : nat ] */ } + /* [ operation : pair (ticket nat) nat : mutez + : contract (pair (ticket nat) nat) : nat ] */ ; + DIP { TRANSFER_TOKENS /* [ operation : nat ] */ } + /* [ operation : operation : nat ] */ ; + NIL operation + /* [ list operation : operation : operation : nat ] */ ; + SWAP + /* [ operation : list operation : operation : nat ] */ ; + CONS + /* [ list operation : operation : nat ] */ ; + SWAP + /* [ operation : list operation : nat ] */ ; + CONS + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_fib.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_fib.tz.out new file mode 100644 index 000000000000..9d5876063a2c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_fib.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_fib.tz --details +Well typed +Gas remaining: 1039994.630 units remaining +{ parameter (pair nat address) ; + storage nat ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "fib" nat + /* [ option nat ] */ ; + IF_SOME + { NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } + { FAIL } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_mutual_recursion.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_mutual_recursion.tz.out new file mode 100644 index 000000000000..ddf7208f1e26 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_mutual_recursion.tz.out @@ -0,0 +1,22 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_mutual_recursion.tz --details +Well typed +Gas remaining: 1039993.335 units remaining +{ parameter (pair nat address) ; + storage nat ; + code { CAR + /* [ pair nat address ] */ ; + DUP + /* [ pair nat address : pair nat address ] */ ; + CDR + /* [ address : pair nat address ] */ ; + SWAP + /* [ pair nat address : address ] */ ; + VIEW "is_twenty" nat + /* [ option nat ] */ ; + IF_SOME + { NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } + { FAIL } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_add.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_add.tz.out new file mode 100644 index 000000000000..201f8679c19a --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_add.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_add.tz --details +Well typed +Gas remaining: 1039994.410 units remaining +{ parameter (pair nat address) ; + storage nat ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "add" nat + /* [ option nat ] */ ; + IF_SOME { /* [ nat ] */ } { FAIL } ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_constant.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_constant.tz.out new file mode 100644 index 000000000000..a8d74f8b8b82 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_constant.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_constant.tz --details +Well typed +Gas remaining: 1039994.390 units remaining +{ parameter (pair nat address) ; + storage nat ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "const" nat + /* [ option nat ] */ ; + IF_SOME { /* [ nat ] */ } { FAIL } ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_id.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_id.tz.out new file mode 100644 index 000000000000..b418053c4099 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_id.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_id.tz --details +Well typed +Gas remaining: 1039993.949 units remaining +{ parameter (pair nat address) ; + storage (pair nat nat) ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "id" (pair nat nat) + /* [ option (pair nat nat) ] */ ; + IF_SOME { /* [ pair nat nat ] */ } { FAIL } ; + NIL operation + /* [ list operation : pair nat nat ] */ ; + PAIR + /* [ pair (list operation) nat nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_addr.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_addr.tz.out new file mode 100644 index 000000000000..f1e591bc9a93 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_addr.tz.out @@ -0,0 +1,21 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_nonexistent_addr.tz --details +Well typed +Gas remaining: 1039989.559 units remaining +{ parameter (pair nat address) ; + storage bool ; + code { DROP + /* [] */ ; + PUSH address "tz1SuakBpFdG9b4twyfrSMqZzruxhpMeSrE5" + /* [ address ] */ ; + PUSH nat 0 + /* [ nat : address ] */ ; + VIEW "test" bool + /* [ option bool ] */ ; + IF_SOME + { DROP /* [] */ ; PUSH bool True /* [ bool ] */ } + { PUSH bool False /* [ bool ] */ } ; + NIL operation + /* [ list operation : bool ] */ ; + PAIR + /* [ pair (list operation) bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_func.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_func.tz.out new file mode 100644 index 000000000000..fdf5cea71d38 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_nonexistent_func.tz.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_nonexistent_func.tz --details +Well typed +Gas remaining: 1039993.859 units remaining +{ parameter (pair nat address) ; + storage bool ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "not_exist" bool + /* [ option bool ] */ ; + IF_SOME + { DROP /* [] */ ; PUSH bool True /* [ bool ] */ } + { PUSH bool False /* [ bool ] */ } ; + NIL operation + /* [ list operation : bool ] */ ; + PAIR + /* [ pair (list operation) bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_test_step_contants.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_test_step_contants.tz.out new file mode 100644 index 000000000000..f3404e41a66f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_test_step_contants.tz.out @@ -0,0 +1,18 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_test_step_contants.tz --details +Well typed +Gas remaining: 1039994.470 units remaining +{ parameter address ; + storage (option (pair (pair mutez mutez) (pair (pair address address) address))) ; + code { CAR + /* [ address ] */ ; + UNIT + /* [ unit : address ] */ ; + VIEW "step_constants" + (pair (pair mutez mutez) (pair (pair address address) address)) + /* [ option (pair (pair mutez mutez) (pair address address) address) ] */ ; + NIL operation + /* [ list operation + : option (pair (pair mutez mutez) (pair address address) address) ] */ ; + PAIR + /* [ pair (list operation) (option (pair (pair mutez mutez) (pair address address) address)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_inpu.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_inpu.out new file mode 100644 index 000000000000..11798adcda20 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_inpu.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_input_type.tz --details +Well typed +Gas remaining: 1039993.919 units remaining +{ parameter (pair int address) ; + storage nat ; + code { CAR + /* [ pair int address ] */ ; + UNPAIR + /* [ int : address ] */ ; + VIEW "add" nat + /* [ option nat ] */ ; + IF_SOME { DROP /* [] */ ; PUSH nat 1 /* [ nat ] */ } { PUSH nat 0 /* [ nat ] */ } ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_outp.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_outp.out new file mode 100644 index 000000000000..ccbeeac5a49c --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_op_toplevel_inconsistent_outp.out @@ -0,0 +1,19 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_op_toplevel_inconsistent_output_type.tz --details +Well typed +Gas remaining: 1039993.919 units remaining +{ parameter (pair nat address) ; + storage bool ; + code { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + VIEW "add" bool + /* [ option bool ] */ ; + IF_SOME + { DROP /* [] */ ; PUSH bool True /* [ bool ] */ } + { PUSH bool False /* [ bool ] */ } ; + NIL operation + /* [ list operation : bool ] */ ; + PAIR + /* [ pair (list operation) bool ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_rec.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_rec.tz.out new file mode 100644 index 000000000000..913c7fda1f06 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_rec.tz.out @@ -0,0 +1,33 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_rec.tz --details +Well typed +Gas remaining: 1039988.440 units remaining +{ parameter unit ; + storage unit ; + view "loop" + address + never + { CAR + /* [ address ] */ ; + DUP + /* [ address : address ] */ ; + VIEW "loop" never + /* [ option never ] */ ; + ASSERT_SOME } ; + code { CDR + /* [ unit ] */ ; + SELF + /* [ contract unit : unit ] */ ; + ADDRESS + /* [ address : unit ] */ ; + DUP + /* [ address : address : unit ] */ ; + VIEW "loop" never + /* [ option never : unit ] */ ; + ASSERT_SOME ; + DROP + /* [ unit ] */ ; + NIL operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_toplevel_lib.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_toplevel_lib.tz.out new file mode 100644 index 000000000000..c0bb3912d26f --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-view_toplevel_lib.tz.out @@ -0,0 +1,143 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/view_toplevel_lib.tz --details +Well typed +Gas remaining: 1039947.179 units remaining +{ parameter nat ; + storage nat ; + code { CAR + /* [ nat ] */ ; + NIL operation + /* [ list operation : nat ] */ ; + PAIR + /* [ pair (list operation) nat ] */ } ; + view "add" nat nat { UNPAIR /* [ nat : nat ] */ ; ADD /* [ nat ] */ } ; + view "id" nat (pair nat nat) { /* [ pair nat nat ] */ } ; + view "test_failwith" nat (pair nat nat) { FAILWITH /* [] */ } ; + view "step_constants" + unit + (pair (pair mutez mutez) (pair (pair address address) address)) + { DROP + /* [] */ ; + SOURCE + /* [ address ] */ ; + SENDER + /* [ address : address ] */ ; + SELF_ADDRESS + /* [ address : address : address ] */ ; + PAIR + /* [ pair address address : address ] */ ; + PAIR + /* [ pair (pair address address) address ] */ ; + BALANCE + /* [ mutez : pair (pair address address) address ] */ ; + AMOUNT + /* [ mutez : mutez : pair (pair address address) address ] */ ; + PAIR + /* [ pair mutez mutez : pair (pair address address) address ] */ ; + PAIR + /* [ pair (pair mutez mutez) (pair address address) address ] */ } ; + view "succ" + (pair nat address) + nat + { CAR + /* [ pair nat address ] */ ; + UNPAIR + /* [ nat : address ] */ ; + PUSH nat 1 + /* [ nat : nat : address ] */ ; + ADD + /* [ nat : address ] */ ; + PAIR + /* [ pair nat address ] */ ; + DUP + /* [ pair nat address : pair nat address ] */ ; + CDR + /* [ address : pair nat address ] */ ; + SWAP + /* [ pair nat address : address ] */ ; + VIEW "is_twenty" nat + /* [ option nat ] */ ; + ASSERT_SOME } ; + view "is_twenty" + (pair nat address) + nat + { CAR + /* [ pair nat address ] */ ; + DUP + /* [ pair nat address : pair nat address ] */ ; + CAR + /* [ nat : pair nat address ] */ ; + PUSH nat 20 + /* [ nat : nat : pair nat address ] */ ; + COMPARE + /* [ int : pair nat address ] */ ; + EQ + /* [ bool : pair nat address ] */ ; + IF { CAR /* [ nat ] */ } + { DUP + /* [ pair nat address : pair nat address ] */ ; + CDR + /* [ address : pair nat address ] */ ; + SWAP + /* [ pair nat address : address ] */ ; + VIEW "succ" nat + /* [ option nat ] */ ; + ASSERT_SOME } } ; + view "fib" + nat + nat + { CAR + /* [ nat ] */ ; + DUP + /* [ nat : nat ] */ ; + PUSH nat 0 + /* [ nat : nat : nat ] */ ; + COMPARE + /* [ int : nat ] */ ; + EQ + /* [ bool : nat ] */ ; + IF { /* [ nat ] */ } + { DUP + /* [ nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat ] */ ; + COMPARE + /* [ int : nat ] */ ; + EQ + /* [ bool : nat ] */ ; + IF { /* [ nat ] */ } + { DUP + /* [ nat : nat ] */ ; + PUSH nat 1 + /* [ nat : nat : nat ] */ ; + SWAP + /* [ nat : nat : nat ] */ ; + SUB + /* [ int : nat ] */ ; + ABS + /* [ nat : nat ] */ ; + SELF_ADDRESS + /* [ address : nat : nat ] */ ; + SWAP + /* [ nat : address : nat ] */ ; + VIEW "fib" nat + /* [ option nat : nat ] */ ; + IF_SOME + { SWAP + /* [ nat : nat ] */ ; + PUSH nat 2 + /* [ nat : nat : nat ] */ ; + SWAP + /* [ nat : nat : nat ] */ ; + SUB + /* [ int : nat ] */ ; + ABS + /* [ nat : nat ] */ ; + SELF_ADDRESS + /* [ address : nat : nat ] */ ; + SWAP + /* [ nat : address : nat ] */ ; + VIEW "fib" nat + /* [ option nat : nat ] */ ; + IF_SOME { ADD /* [ nat ] */ } { FAIL } } + { FAIL } } } } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-voting_power.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-voting_power.tz.out new file mode 100644 index 000000000000..aa6b08f49705 --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-voting_power.tz.out @@ -0,0 +1,20 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/voting_power.tz --details +Well typed +Gas remaining: 1039995.193 units remaining +{ parameter key ; + storage (pair nat nat) ; + code { CAR + /* [ key ] */ ; + HASH_KEY + /* [ key_hash ] */ ; + VOTING_POWER + /* [ nat ] */ ; + DIP { TOTAL_VOTING_POWER /* [ nat ] */ } + /* [ nat : nat ] */ ; + PAIR + /* [ pair nat nat ] */ ; + NIL operation + /* [ list operation : pair nat nat ] */ ; + PAIR + /* [ pair (list operation) nat nat ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor.tz.out new file mode 100644 index 000000000000..afc3ed1a7e7d --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor.tz.out @@ -0,0 +1,17 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/xor.tz --details +Well typed +Gas remaining: 1039992.584 units remaining +{ parameter (or (pair bool bool) (pair nat nat)) ; + storage (option (or bool nat)) ; + code { CAR + /* [ or (pair bool bool) (pair nat nat) ] */ ; + IF_LEFT + { UNPAIR /* [ bool : bool ] */ ; XOR /* [ bool ] */ ; LEFT nat /* [ or bool nat ] */ } + { UNPAIR /* [ nat : nat ] */ ; XOR /* [ nat ] */ ; RIGHT bool /* [ or bool nat ] */ } ; + SOME + /* [ option (or bool nat) ] */ ; + NIL operation + /* [ list operation : option (or bool nat) ] */ ; + PAIR + /* [ pair (list operation) (option (or bool nat)) ] */ } } diff --git a/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor_bytes.tz.out b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor_bytes.tz.out new file mode 100644 index 000000000000..10dfa0fc882b --- /dev/null +++ b/tezt/tests/expected/contract_typecheck_regression.ml/Mumbai- Tc tests_python-contracts_016-opcodes-xor_bytes.tz.out @@ -0,0 +1,41 @@ + +./octez-client --protocol PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD --mode mockup --no-base-dir-warnings typecheck script tests_python/contracts_016/opcodes/xor_bytes.tz --details +Well typed +Gas remaining: 1039978.916 units remaining +{ parameter unit ; + storage unit ; + code { DROP + /* [] */ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x06 + /* [ bytes : bytes ] */ ; + XOR + /* [ bytes ] */ ; + PUSH bytes 0x03 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x0005 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + XOR + /* [ bytes ] */ ; + PUSH bytes 0x0103 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + PUSH bytes 0x05 + /* [ bytes ] */ ; + PUSH bytes 0x0106 + /* [ bytes : bytes ] */ ; + XOR + /* [ bytes ] */ ; + PUSH bytes 0x0103 + /* [ bytes : bytes ] */ ; + ASSERT_CMPEQ ; + UNIT + /* [ unit ] */ ; + NIL @noop operation + /* [ list operation : unit ] */ ; + PAIR + /* [ pair (list operation) unit ] */ } } diff --git a/tezt/tests/expected/create_contract.ml/Mumbai- Create contract.out b/tezt/tests/expected/create_contract.ml/Mumbai- Create contract.out new file mode 100644 index 000000000000..9697e72316d3 --- /dev/null +++ b/tezt/tests/expected/create_contract.ml/Mumbai- Create contract.out @@ -0,0 +1,109 @@ + +./octez-client --mode mockup --wait none originate contract originate_contract transferring 200 from bootstrap1 running michelson_test_scripts/mini_scenarios/originate_contract.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1428.677 units (will add 100 for safety) +Estimated storage: 350 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000476 + Expected counter: 1 + Gas limit: 1529 + Storage limit: 370 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000476 + payload fees(the block proposer) ....... +ꜩ0.000476 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + UNIT ; + AMOUNT ; + NONE key_hash ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; + DIP { DROP ; PUSH unit Unit ; NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 93 bytes + Paid storage size diff: 93 bytes + Consumed gas: 1428.677 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02325 + storage fees ........................... +ꜩ0.02325 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as originate_contract. + +./octez-client --mode mockup --wait none transfer 1 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --arg Unit +Node is bootstrapped. +Estimated gas: 3525.462 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000614 + Expected counter: 1 + Gas limit: 3626 + Storage limit: 315 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000614 + payload fees(the block proposer) ....... +ꜩ0.000614 + Transaction: + Amount: ꜩ1 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 93 bytes + Consumed gas: 2120.820 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + Internal operations: + Internal Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1405.287 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. diff --git a/tezt/tests/expected/deposits_limit.ml/Mumbai- set deposits limit.out b/tezt/tests/expected/deposits_limit.ml/Mumbai- set deposits limit.out new file mode 100644 index 000000000000..9d8a1b857027 --- /dev/null +++ b/tezt/tests/expected/deposits_limit.ml/Mumbai- set deposits limit.out @@ -0,0 +1,26 @@ +Node is bootstrapped. +Estimated gas: 1000 units (will add 0 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is 'ooNSHh2tG2DkND4aYzz2eG75ySzedcNdLvfjtKixM69Sdej11U7' +NOT waiting for the operation to be included. +Use command + octez-client wait for ooNSHh2tG2DkND4aYzz2eG75ySzedcNdLvfjtKixM69Sdej11U7 to be included --confirmations 1 --branch BLockGenesisGenesisGenesisGenesisGenesisf79b5d1CoW2 +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx + Fee to the baker: ꜩ0.00033 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.00033 + payload fees(the block proposer) ....... +ꜩ0.00033 + Set deposits limit: + Delegate: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx + Limit: 1000 + This deposits limit modification was successfully applied + Consumed gas: 1000 + + diff --git a/tezt/tests/expected/deposits_limit.ml/Mumbai- unset deposits limit.out b/tezt/tests/expected/deposits_limit.ml/Mumbai- unset deposits limit.out new file mode 100644 index 000000000000..ac4ec7fd9220 --- /dev/null +++ b/tezt/tests/expected/deposits_limit.ml/Mumbai- unset deposits limit.out @@ -0,0 +1,26 @@ +Node is bootstrapped. +Estimated gas: 1000 units (will add 0 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is 'onqFPeWE1g1A8kQ9hcyLW22Z71kd8t7Wmpfc15Yzi8ph2eprrUn' +NOT waiting for the operation to be included. +Use command + octez-client wait for onqFPeWE1g1A8kQ9hcyLW22Z71kd8t7Wmpfc15Yzi8ph2eprrUn to be included --confirmations 1 --branch BLockGenesisGenesisGenesisGenesisGenesisf79b5d1CoW2 +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx + Fee to the baker: ꜩ0.000325 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx ... -ꜩ0.000325 + payload fees(the block proposer) ....... +ꜩ0.000325 + Set deposits limit: + Delegate: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx + Unlimited deposits + This deposits limit modification was successfully applied + Consumed gas: 1000 + + diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.out new file mode 100644 index 000000000000..728d7eb3a047 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.out @@ -0,0 +1,35 @@ + +./octez-codec encode 016-PtMumbai.block_header from '{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 +}' +00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d5580166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.block_header from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d5580166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "level": 1331, "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off", + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.raw.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.raw.out new file mode 100644 index 000000000000..6327c1d2eefe --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.raw.out @@ -0,0 +1,26 @@ + +./octez-codec encode 016-PtMumbai.block_header.raw from '{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "protocol_data": "521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" +}' +00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.block_header.raw from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "level": 1331, "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "protocol_data": + "521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.unsigned.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.unsigned.out new file mode 100644 index 000000000000..12769407b9db --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- block_header.unsigned.out @@ -0,0 +1,32 @@ + +./octez-codec encode 016-PtMumbai.block_header.unsigned from '{ + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 +}' +00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55801 + +./octez-codec decode 016-PtMumbai.block_header.unsigned from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55801 +{ "level": 1331, "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 2, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_toggle_vote": "off" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- contract.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- contract.out new file mode 100644 index 000000000000..1588311f69e2 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- contract.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.contract from '"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"' +000002298c03ed7d454a101eb7022bc95f7e5f41ac78 + +./octez-codec decode 016-PtMumbai.contract from 000002298c03ed7d454a101eb7022bc95f7e5f41ac78 +"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + +./octez-codec encode 016-PtMumbai.contract from '"KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat"' +0138560805b4c8d7b7fbbafad5c59dbfa3878ca70500 + +./octez-codec decode 016-PtMumbai.contract from 0138560805b4c8d7b7fbbafad5c59dbfa3878ca70500 +"KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- cycle.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- cycle.out new file mode 100644 index 000000000000..a707f1321278 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- cycle.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.cycle from 2147483647 +7fffffff + +./octez-codec decode 016-PtMumbai.cycle from 7fffffff +2147483647 + +./octez-codec encode 016-PtMumbai.cycle from 0 +00000000 + +./octez-codec decode 016-PtMumbai.cycle from 00000000 +0 diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- fitness.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- fitness.out new file mode 100644 index 000000000000..68f805dddb49 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- fitness.out @@ -0,0 +1,11 @@ + +./octez-codec encode 016-PtMumbai.fitness from '{ + "level": 1, + "locked_round": 1, + "predecessor_round": 1, + "round": 2 +}' +0000000101000000010000000100000002 + +./octez-codec decode 016-PtMumbai.fitness from 0000000101000000010000000100000002 +{ "level": 1, "locked_round": 1, "predecessor_round": 1, "round": 2 } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.cost.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.cost.out new file mode 100644 index 000000000000..271beefdccad --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.cost.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.gas.cost from '"8920392083423078"' +a6fd9d9694c3d81f + +./octez-codec decode 016-PtMumbai.gas.cost from a6fd9d9694c3d81f +"8920392083423078" + +./octez-codec encode 016-PtMumbai.gas.cost from '"0"' +00 + +./octez-codec decode 016-PtMumbai.gas.cost from 00 +"0" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.out new file mode 100644 index 000000000000..5fcd79c2b05c --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- gas.out @@ -0,0 +1,18 @@ + +./octez-codec encode 016-PtMumbai.gas from '"1238"' +009613 + +./octez-codec decode 016-PtMumbai.gas from 009613 +"1238" + +./octez-codec encode 016-PtMumbai.gas from '"unaccounted"' +01 + +./octez-codec decode 016-PtMumbai.gas from 01 +"unaccounted" + +./octez-codec encode 016-PtMumbai.gas from '"0"' +0000 + +./octez-codec decode 016-PtMumbai.gas from 0000 +"0" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- level.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- level.out new file mode 100644 index 000000000000..ffc8ee49aa1a --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- level.out @@ -0,0 +1,13 @@ + +./octez-codec encode 016-PtMumbai.level from '{ + "level": 1331, + "level_position": 2147483647, + "cycle": 300, + "cycle_position": 600, + "expected_commitment": true +}' +000005337fffffff0000012c00000258ff + +./octez-codec decode 016-PtMumbai.level from 000005337fffffff0000012c00000258ff +{ "level": 1331, "level_position": 2147483647, "cycle": 300, + "cycle_position": 600, "expected_commitment": true } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- nonce.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- nonce.out new file mode 100644 index 000000000000..d811474150c8 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- nonce.out @@ -0,0 +1,6 @@ + +./octez-codec encode 016-PtMumbai.nonce from '"0000000000000000000000000000000000000000000000000000000000000000"' +0000000000000000000000000000000000000000000000000000000000000000 + +./octez-codec decode 016-PtMumbai.nonce from 0000000000000000000000000000000000000000000000000000000000000000 +"0000000000000000000000000000000000000000000000000000000000000000" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.internal.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.internal.out new file mode 100644 index 000000000000..9b6280b445b3 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.internal.out @@ -0,0 +1,140 @@ + +./octez-codec encode 016-PtMumbai.operation.internal from '{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "delegation" +}' +000002298c03ed7d454a101eb7022bc95f7e5f41ac7800000300 + +./octez-codec decode 016-PtMumbai.operation.internal from 000002298c03ed7d454a101eb7022bc95f7e5f41ac7800000300 +{ "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "nonce": 0, + "kind": "delegation" } + +./octez-codec encode 016-PtMumbai.operation.internal from '{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "delegation", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" +}' +000002298c03ed7d454a101eb7022bc95f7e5f41ac78000003ff0002298c03ed7d454a101eb7022bc95f7e5f41ac78 + +./octez-codec decode 016-PtMumbai.operation.internal from 000002298c03ed7d454a101eb7022bc95f7e5f41ac78000003ff0002298c03ed7d454a101eb7022bc95f7e5f41ac78 +{ "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "nonce": 0, + "kind": "delegation", "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } + +./octez-codec encode 016-PtMumbai.operation.internal from '{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "origination", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [ + { + "prim": "parameter", + "args": [ + { + "prim": "string" + } + ] + }, + { + "prim": "storage", + "args": [ + { + "prim": "option", + "args": [ + { + "prim": "string" + } + ] + } + ] + }, + { + "prim": "code", + "args": [ + [ + { + "prim": "CAR" + }, + { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [ + { + "prim": "operation" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [ + { + "string": "test" + } + ] + } +}' +000002298c03ed7d454a101eb7022bc95f7e5f41ac78000002af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e0200000009010000000474657374 + +./octez-codec decode 016-PtMumbai.operation.internal from 000002298c03ed7d454a101eb7022bc95f7e5f41ac78000002af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e0200000009010000000474657374 +{ "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "nonce": 0, + "kind": "origination", "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": [ { "string": "test" } ] } } + +./octez-codec encode 016-PtMumbai.operation.internal from '{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 3, + "kind": "transaction", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" +}' +000002298c03ed7d454a101eb7022bc95f7e5f41ac780003019703000002298c03ed7d454a101eb7022bc95f7e5f41ac7800 + +./octez-codec decode 016-PtMumbai.operation.internal from 000002298c03ed7d454a101eb7022bc95f7e5f41ac780003019703000002298c03ed7d454a101eb7022bc95f7e5f41ac7800 +{ "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "nonce": 3, + "kind": "transaction", "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } + +./octez-codec encode 016-PtMumbai.operation.internal from '{ + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "nonce": 0, + "kind": "transaction", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [ + { + "prim": "UNIT" + } + ] + } +}' +000002298c03ed7d454a101eb7022bc95f7e5f41ac7800000197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f + +./octez-codec decode 016-PtMumbai.operation.internal from 000002298c03ed7d454a101eb7022bc95f7e5f41ac7800000197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f +{ "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "nonce": 0, + "kind": "transaction", "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { "entrypoint": "action", "value": [ { "prim": "UNIT" } ] } } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.out new file mode 100644 index 000000000000..ea05dca910fa --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.out @@ -0,0 +1,531 @@ + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a804c55cf02dbeecc978d9c84625dcae72bb77ea4fbd41f98b15efc63fa893d61d7d6eee4a2ce9427ac466804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a804c55cf02dbeecc978d9c84625dcae72bb77ea4fbd41f98b15efc63fa893d61d7d6eee4a2ce9427ac466804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "ballot", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8060002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c0066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8060002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c0066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "ballot", "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4010066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4010066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_baking_evidence", + "bh1": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 + }, + "bh2": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 + } + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "double_baking_evidence", + "bh1": + { "level": 1331, "proto": 1, + "predecessor": + "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 4, + "operations_hash": + "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, + "bh2": + { "level": 1331, "proto": 1, + "predecessor": + "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 4, + "operations_hash": + "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_endorsement_evidence", + "op1": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + }, + "op2": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + } + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8020000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c0000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8020000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c0000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "double_endorsement_evidence", + "op1": + { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": + { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" }, + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, + "op2": + { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": + { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" }, + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [ + { + "prim": "parameter", + "args": [ + { + "prim": "string" + } + ] + }, + { + "prim": "storage", + "args": [ + { + "prim": "option", + "args": [ + { + "prim": "string" + } + ] + } + ] + }, + { + "prim": "code", + "args": [ + [ + { + "prim": "CAR" + }, + { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [ + { + "prim": "operation" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [ + { + "string": "test" + } + ] + } + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86d0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e020000000901000000047465737466804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86d0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e020000000901000000047465737466804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": [ { "string": "test" } ] } } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposals": [ + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" + ] + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8050002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf000000407663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8050002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf000000407663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "period": 719, + "proposals": + [ "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" ] } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "reveal", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86b0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86b0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "reveal", "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "seed_nonce_revelation", + "level": 1331, + "nonce": "0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a80100000533000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a80100000533000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "seed_nonce_revelation", "level": 1331, + "nonce": + "0000000000000000000000000000000000000000000000000000000000000000" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4019703000002298c03ed7d454a101eb7022bc95f7e5f41ac780066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4019703000002298c03ed7d454a101eb7022bc95f7e5f41ac780066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } + +./octez-codec encode 016-PtMumbai.operation from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [ + { + "prim": "UNIT" + } + ] + } + } + ], + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": + { "entrypoint": "action", "value": [ { "prim": "UNIT" } ] } } ], + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.raw.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.raw.out new file mode 100644 index 000000000000..9bfd45654b2f --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.raw.out @@ -0,0 +1,11 @@ + +./octez-codec encode 016-PtMumbai.operation.raw from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "data": "000000053366804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000053366804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation.raw from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000053366804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "data": + "000000053366804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.unsigned.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.unsigned.out new file mode 100644 index 000000000000..8324ab6a9fda --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- operation.unsigned.out @@ -0,0 +1,468 @@ + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a804c55cf02dbeecc978d9c84625dcae72bb77ea4fbd41f98b15efc63fa893d61d7d6eee4a2ce9427ac4 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a804c55cf02dbeecc978d9c84625dcae72bb77ea4fbd41f98b15efc63fa893d61d7d6eee4a2ce9427ac4 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "activate_account", + "pkh": "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv", + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "ballot", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8060002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c00 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8060002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c00 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "ballot", "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposal": "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "ballot": "yay" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40100 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40100 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401ff0002298c03ed7d454a101eb7022bc95f7e5f41ac78 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86e0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401ff0002298c03ed7d454a101eb7022bc95f7e5f41ac78 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "delegation", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_baking_evidence", + "bh1": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 + }, + "bh2": { + "level": 1331, + "proto": 1, + "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", + "validation_pass": 4, + "operations_hash": "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ + "01", + "000000000000000a" + ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ", + "payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0 + } + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000f100000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c000000000000000000000000000000000000000000000000000000000000000000000000101895ca00000000000166804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "double_baking_evidence", + "bh1": + { "level": 1331, "proto": 1, + "predecessor": + "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 4, + "operations_hash": + "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, + "bh2": + { "level": 1331, "proto": 1, + "predecessor": + "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 4, + "operations_hash": + "LLoZqBDX1E2ADRXbmwYo8VtMNeHG6Ygzmm4Zqv97i91UPBQHy9Vq3", + "fitness": [ "01", "000000000000000a" ], + "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", + "payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "payload_round": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_toggle_vote": "off", + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "double_endorsement_evidence", + "op1": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + }, + "op2": { + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + }, + "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" + } + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8020000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c0000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8020000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c0000008b0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a81500000000053300000000000000000000000000000000000000000000000000000000000000000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "double_endorsement_evidence", + "op1": + { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": + { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" }, + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, + "op2": + { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "operations": + { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" }, + "signature": + "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "endorsement", + "level": 1331, + "block_payload_hash": "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG", + "round": 0, + "slot": 0 + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a815000000000533000000000000000000000000000000000000000000000000000000000000000000000000 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a815000000000533000000000000000000000000000000000000000000000000000000000000000000000000 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "endorsement", "slot": 0, "level": 1331, "round": 0, + "block_payload_hash": + "vh1g87ZG6scSYxKhspAUzprQVuLAyoa5qMBKcUfjgnQGnFb3dJcG" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": { + "code": [ + { + "prim": "parameter", + "args": [ + { + "prim": "string" + } + ] + }, + { + "prim": "storage", + "args": [ + { + "prim": "option", + "args": [ + { + "prim": "string" + } + ] + } + ] + }, + { + "prim": "code", + "args": [ + [ + { + "prim": "CAR" + }, + { + "prim": "SOME" + }, + { + "prim": "NIL", + "args": [ + { + "prim": "operation" + } + ] + }, + { + "prim": "PAIR" + } + ] + ] + } + ], + "storage": [ + { + "string": "test" + } + ] + } + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86d0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e0200000009010000000474657374 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86d0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401af9105ff0002298c03ed7d454a101eb7022bc95f7e5f41ac7800000020020000001b050003680501056303680502020000000a03160346053d036d03420000000e0200000009010000000474657374 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "origination", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "balance": "84143", + "delegate": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "script": + { "code": + [ { "prim": "parameter", "args": [ { "prim": "string" } ] }, + { "prim": "storage", + "args": + [ { "prim": "option", "args": [ { "prim": "string" } ] } ] }, + { "prim": "code", + "args": + [ [ { "prim": "CAR" }, { "prim": "SOME" }, + { "prim": "NIL", + "args": [ { "prim": "operation" } ] }, + { "prim": "PAIR" } ] ] } ], + "storage": [ { "string": "test" } ] } } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "period": 719, + "proposals": [ + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" + ] + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8050002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf000000407663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8050002298c03ed7d454a101eb7022bc95f7e5f41ac78000002cf000000407663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c7663cf120f3dc8189d5dc7d4d7a0483bcc53f3f18e700f5a2f5076aa8b9dc55c +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "proposals", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "period": 719, + "proposals": + [ "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp", + "PscqRYywd243M2eZspXZEJGsRmNchp4ZKfKmoyEZTRHeLQvVGjp" ] } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "reveal", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86b0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86b0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d401004798d2cc98473d7e250c898885718afd2e4efbcb1a1595ab9730761ed830de0f +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "reveal", "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", + "public_key": + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "seed_nonce_revelation", + "level": 1331, + "nonce": "0000000000000000000000000000000000000000000000000000000000000000" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a801000005330000000000000000000000000000000000000000000000000000000000000000 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a801000005330000000000000000000000000000000000000000000000000000000000000000 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "seed_nonce_revelation", "level": 1331, + "nonce": + "0000000000000000000000000000000000000000000000000000000000000000" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4019703000002298c03ed7d454a101eb7022bc95f7e5f41ac7800 + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d4019703000002298c03ed7d454a101eb7022bc95f7e5f41ac7800 +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "amount": "407", + "destination": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" } ] } + +./octez-codec encode 016-PtMumbai.operation.unsigned from '{ + "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": [ + { + "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "fee": "33", + "counter": "732", + "gas_limit": "9451117", + "storage_limit": "57024931117", + "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": { + "entrypoint": "action", + "value": [ + { + "prim": "UNIT" + } + ] + } + } + ] +}' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f + +./octez-codec decode 016-PtMumbai.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a86c0002298c03ed7d454a101eb7022bc95f7e5f41ac7821dc05edecc004adcacdb7d40197030138560805b4c8d7b7fbbafad5c59dbfa3878ca70500ffff06616374696f6e000000070200000002034f +{ "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", + "contents": + [ { "kind": "transaction", + "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "fee": "33", + "counter": "732", "gas_limit": "9451117", + "storage_limit": "57024931117", "amount": "407", + "destination": "KT1DieU51jzXLerQx5AqMCiLC1SsCeM8yRat", + "parameters": + { "entrypoint": "action", "value": [ { "prim": "UNIT" } ] } } ] } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- period.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- period.out new file mode 100644 index 000000000000..7ed29efc7cc2 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- period.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.period from '"2789"' +0000000000000ae5 + +./octez-codec decode 016-PtMumbai.period from 0000000000000ae5 +"2789" + +./octez-codec encode 016-PtMumbai.period from '"0"' +0000000000000000 + +./octez-codec decode 016-PtMumbai.period from 0000000000000000 +"0" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- raw_level.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- raw_level.out new file mode 100644 index 000000000000..7c206ce5997e --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- raw_level.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.raw_level from 2147483647 +7fffffff + +./octez-codec decode 016-PtMumbai.raw_level from 7fffffff +2147483647 + +./octez-codec encode 016-PtMumbai.raw_level from 0 +00000000 + +./octez-codec decode 016-PtMumbai.raw_level from 00000000 +0 diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- seed.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- seed.out new file mode 100644 index 000000000000..5b6f589b44c5 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- seed.out @@ -0,0 +1,6 @@ + +./octez-codec encode 016-PtMumbai.seed from '"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8"' +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8 + +./octez-codec decode 016-PtMumbai.seed from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8 +"0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- tez.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- tez.out new file mode 100644 index 000000000000..ec53e6d3c641 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- tez.out @@ -0,0 +1,12 @@ + +./octez-codec encode 016-PtMumbai.tez from '"7322135"' +97f4be03 + +./octez-codec decode 016-PtMumbai.tez from 97f4be03 +"7322135" + +./octez-codec encode 016-PtMumbai.tez from '"0"' +00 + +./octez-codec decode 016-PtMumbai.tez from 00 +"0" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- timestamp.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- timestamp.out new file mode 100644 index 000000000000..7a6142663b65 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- timestamp.out @@ -0,0 +1,6 @@ + +./octez-codec encode 016-PtMumbai.timestamp from '"2020-04-20T16:19:59Z"' +000000005e9dcbaf + +./octez-codec decode 016-PtMumbai.timestamp from 000000005e9dcbaf +"2020-04-20T16:19:59Z" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballot.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballot.out new file mode 100644 index 000000000000..c567a0e7c82a --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballot.out @@ -0,0 +1,18 @@ + +./octez-codec encode 016-PtMumbai.vote.ballot from '"nay"' +01 + +./octez-codec decode 016-PtMumbai.vote.ballot from 01 +"nay" + +./octez-codec encode 016-PtMumbai.vote.ballot from '"pass"' +02 + +./octez-codec decode 016-PtMumbai.vote.ballot from 02 +"pass" + +./octez-codec encode 016-PtMumbai.vote.ballot from '"yay"' +00 + +./octez-codec decode 016-PtMumbai.vote.ballot from 00 +"yay" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballots.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballots.out new file mode 100644 index 000000000000..5d944834940f --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.ballots.out @@ -0,0 +1,10 @@ + +./octez-codec encode 016-PtMumbai.vote.ballots from '{ + "yay": "2147483647", + "nay": "0", + "pass": "455" +}' +000000007fffffff000000000000000000000000000001c7 + +./octez-codec decode 016-PtMumbai.vote.ballots from 000000007fffffff000000000000000000000000000001c7 +{ "yay": "2147483647", "nay": "0", "pass": "455" } diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.listings.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.listings.out new file mode 100644 index 000000000000..74077518ba65 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- vote.listings.out @@ -0,0 +1,16 @@ + +./octez-codec encode 016-PtMumbai.vote.listings from '[ + { + "pkh": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", + "voting_power": "20115" + }, + { + "pkh": "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN", + "voting_power": "9000" + } +]' +0000003a0002298c03ed7d454a101eb7022bc95f7e5f41ac780000000000004e9300e7670f32038107a59a2b9cfefae36ea21f5aa63c0000000000002328 + +./octez-codec decode 016-PtMumbai.vote.listings from 0000003a0002298c03ed7d454a101eb7022bc95f7e5f41ac780000000000004e9300e7670f32038107a59a2b9cfefae36ea21f5aa63c0000000000002328 +[ { "pkh": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx", "voting_power": "20115" }, + { "pkh": "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN", "voting_power": "9000" } ] diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.kind.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.kind.out new file mode 100644 index 000000000000..c2ef5b5cd489 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.kind.out @@ -0,0 +1,24 @@ + +./octez-codec encode 016-PtMumbai.voting_period.kind from '"promotion"' +03 + +./octez-codec decode 016-PtMumbai.voting_period.kind from 03 +"promotion" + +./octez-codec encode 016-PtMumbai.voting_period.kind from '"proposal"' +00 + +./octez-codec decode 016-PtMumbai.voting_period.kind from 00 +"proposal" + +./octez-codec encode 016-PtMumbai.voting_period.kind from '"exploration"' +01 + +./octez-codec decode 016-PtMumbai.voting_period.kind from 01 +"exploration" + +./octez-codec encode 016-PtMumbai.voting_period.kind from '"cooldown"' +02 + +./octez-codec decode 016-PtMumbai.voting_period.kind from 02 +"cooldown" diff --git a/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.out b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.out new file mode 100644 index 000000000000..868fb84b4917 --- /dev/null +++ b/tezt/tests/expected/encoding.ml/Mumbai- protocol encoding regression test- voting_period.out @@ -0,0 +1,20 @@ + +./octez-codec encode 016-PtMumbai.voting_period from '{ + "start_position": 1159026, + "kind": "proposal", + "index": 0 +}' +00000000000011af72 + +./octez-codec decode 016-PtMumbai.voting_period from 00000000000011af72 +{ "index": 0, "kind": "proposal", "start_position": 1159026 } + +./octez-codec encode 016-PtMumbai.voting_period from '{ + "start_position": 0, + "kind": "proposal", + "index": 0 +}' +000000000000000000 + +./octez-codec decode 016-PtMumbai.voting_period from 000000000000000000 +{ "index": 0, "kind": "proposal", "start_position": 0 } diff --git a/tezt/tests/expected/normalize.ml/Mumbai- Test normalize in unparsing mode.out b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize in unparsing mode.out new file mode 100644 index 000000000000..80323b4574cb --- /dev/null +++ b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize in unparsing mode.out @@ -0,0 +1,14 @@ + +./octez-client --mode mockup normalize data '{Pair 0 3 6 9; Pair 1 (Pair 4 (Pair 7 10)); {2; 5; 8; 11}}' of type 'list (pair nat nat nat nat)' +{ Pair 0 3 6 9 ; Pair 1 4 7 10 ; Pair 2 5 8 11 } + +./octez-client --mode mockup normalize data '{Pair 0 3 6 9; Pair 1 (Pair 4 (Pair 7 10)); {2; 5; 8; 11}}' of type 'list (pair nat nat nat nat)' --unparsing-mode Readable +{ Pair 0 3 6 9 ; Pair 1 4 7 10 ; Pair 2 5 8 11 } + +./octez-client --mode mockup normalize data '{Pair 0 3 6 9; Pair 1 (Pair 4 (Pair 7 10)); {2; 5; 8; 11}}' of type 'list (pair nat nat nat nat)' --unparsing-mode Optimized +{ { 0 ; 3 ; 6 ; 9 } ; { 1 ; 4 ; 7 ; 10 } ; { 2 ; 5 ; 8 ; 11 } } + +./octez-client --mode mockup normalize data '{Pair 0 3 6 9; Pair 1 (Pair 4 (Pair 7 10)); {2; 5; 8; 11}}' of type 'list (pair nat nat nat nat)' --unparsing-mode Optimized_legacy +{ Pair 0 (Pair 3 (Pair 6 9)) ; + Pair 1 (Pair 4 (Pair 7 10)) ; + Pair 2 (Pair 5 (Pair 8 11)) } diff --git a/tezt/tests/expected/normalize.ml/Mumbai- Test normalize script.out b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize script.out new file mode 100644 index 000000000000..d652c67231df --- /dev/null +++ b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize script.out @@ -0,0 +1,42 @@ + +./octez-client --mode mockup normalize script file:./tests_python/contracts_016/opcodes/comb-literals.tz +{ parameter unit ; + storage unit ; + code { PUSH (list (pair nat nat nat nat)) + { Pair 0 3 6 9 ; Pair 1 4 7 10 ; Pair 2 5 8 11 } ; + DROP 2 ; + UNIT ; + NIL operation ; + PAIR } } + +./octez-client --mode mockup normalize script file:./tests_python/contracts_016/opcodes/comb-literals.tz --unparsing-mode Readable +{ parameter unit ; + storage unit ; + code { PUSH (list (pair nat nat nat nat)) + { Pair 0 3 6 9 ; Pair 1 4 7 10 ; Pair 2 5 8 11 } ; + DROP 2 ; + UNIT ; + NIL operation ; + PAIR } } + +./octez-client --mode mockup normalize script file:./tests_python/contracts_016/opcodes/comb-literals.tz --unparsing-mode Optimized +{ parameter unit ; + storage unit ; + code { PUSH (list (pair nat nat nat nat)) + { { 0 ; 3 ; 6 ; 9 } ; { 1 ; 4 ; 7 ; 10 } ; { 2 ; 5 ; 8 ; 11 } } ; + DROP 2 ; + UNIT ; + NIL operation ; + PAIR } } + +./octez-client --mode mockup normalize script file:./tests_python/contracts_016/opcodes/comb-literals.tz --unparsing-mode Optimized_legacy +{ parameter unit ; + storage unit ; + code { PUSH (list (pair nat nat nat nat)) + { Pair 0 (Pair 3 (Pair 6 9)) ; + Pair 1 (Pair 4 (Pair 7 10)) ; + Pair 2 (Pair 5 (Pair 8 11)) } ; + DROP 2 ; + UNIT ; + NIL operation ; + PAIR } } diff --git a/tezt/tests/expected/normalize.ml/Mumbai- Test normalize type.out b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize type.out new file mode 100644 index 000000000000..c35ef0e62ff8 --- /dev/null +++ b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize type.out @@ -0,0 +1,24 @@ + +./octez-client --mode mockup normalize type nat +nat + +./octez-client --mode mockup normalize type 'list nat' +list nat + +./octez-client --mode mockup normalize type 'pair nat int' +pair nat int + +./octez-client --mode mockup normalize type 'list (pair nat int)' +list (pair nat int) + +./octez-client --mode mockup normalize type 'pair nat int bool' +pair nat (pair int bool) + +./octez-client --mode mockup normalize type 'list (pair nat int bool)' +list (pair nat (pair int bool)) + +./octez-client --mode mockup normalize type 'pair nat int bool bytes' +pair nat (pair int (pair bool bytes)) + +./octez-client --mode mockup normalize type 'list (pair nat int bool bytes)' +list (pair nat (pair int (pair bool bytes))) diff --git a/tezt/tests/expected/normalize.ml/Mumbai- Test normalize with legacy flag.out b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize with legacy flag.out new file mode 100644 index 000000000000..8ecc6976ccf6 --- /dev/null +++ b/tezt/tests/expected/normalize.ml/Mumbai- Test normalize with legacy flag.out @@ -0,0 +1,10 @@ + +./octez-client --mode mockup normalize data '{Elt %a 0 1}' of type 'map nat nat' --legacy +{ Elt 0 1 } + +./octez-client --mode mockup normalize data '{Elt %a 0 1}' of type 'map nat nat' +At (unshown) location 0, value { Elt %a 0 1 } +is invalid for type map nat nat. +At (unshown) location 1, unexpected annotation. +Fatal error: + ill-typed data expression diff --git a/tezt/tests/expected/script_hash_regression.ml/Mumbai- Test script hash regression.out b/tezt/tests/expected/script_hash_regression.ml/Mumbai- Test script hash regression.out new file mode 100644 index 000000000000..a07d25bc4af2 --- /dev/null +++ b/tezt/tests/expected/script_hash_regression.ml/Mumbai- Test script hash regression.out @@ -0,0 +1,399 @@ +exprvFK4dJmFGinHHBe92WR4kA7L8WSBQQYDigmyVCyKpiQHCXe9fk [CONTRACT_PATH]/attic/accounts.tz +expruucsMyaSmmP5gmkFWjJfv4a52FQV5EGaf3XpHoeXHQgyJgMJfF [CONTRACT_PATH]/attic/add1.tz +exprvEM4Lvihz6jFYszxazuQQPsHjxA4J54tfLeowwDkY1jjTi8Qft [CONTRACT_PATH]/attic/add1_list.tz +exprta1x6QtexpFktejHoB1KwuMQRXePhgre9rDiJ3GDSZCqb3vtqL [CONTRACT_PATH]/attic/after_strategy.tz +expruEosJCXYteRXxfbAVJ5XythgpVQPMdiu3kbbZj3VAVSVjk8ud7 [CONTRACT_PATH]/attic/always.tz +exprvR9m6PaVeLfPHZjA3A929bbfjonzMJs1Kzcmj8baoEvLct9Ry9 [CONTRACT_PATH]/attic/append.tz +exprvQh7vw7vYfp2qdiyYPCFgd6jVkxqYZimmqoYCGZbqaoMgfLifS [CONTRACT_PATH]/attic/at_least.tz +exprtyZC9vL831BnATCkdrP585F4cEzQQQp1ZqnZSqvCDLqp7S33V1 [CONTRACT_PATH]/attic/auction.tz +expruZ4wjBCm3DQNhEf69L27tqaqAJa1TF34728yyPJ9BUg3sEwcxB [CONTRACT_PATH]/attic/bad_lockup.tz +expruazd13u4uPHS7oFWFeZ5nodWR5QC6nQwgy5LGoUTAR3KXsYPXg [CONTRACT_PATH]/attic/big_map_union.tz +exprv7aEg823PTvrEG5bXr4QGk3XCsEkodhUxWCaMBBSq44ZuAxnNf [CONTRACT_PATH]/attic/cadr_annotation.tz +expruwmej4r1RSMDEmmU4SjWUbrzpURnAwybrSwBaMkHpxVobLkWAe [CONTRACT_PATH]/attic/concat.tz +exprte328K2NmgWrmHLbFrGVjvoZKZNFB7577Vt7cWQa8KdvWbfxYk [CONTRACT_PATH]/attic/conditionals.tz +exprvRVXhJFcFjGMkatDwgaLRcJq4TctY979bjniTqwACgXtC3mWko [CONTRACT_PATH]/attic/cons_twice.tz +exprtcnAL38pt7fyZdCiqd97qcYeESWQStPR6sbN2SxMCfbPJhVjau [CONTRACT_PATH]/attic/cps_fact.tz +exprv9BquR6NXVwKMwD4MS5vdWqqvMzjvWumrBf6NsGQXSfgm2Rtqk [CONTRACT_PATH]/attic/create_add1_lists.tz +exprv4cq5g9hsxWU65zCp8dfUi3RtBzu9rGXZ7otetL23tj1zSkNQ2 [CONTRACT_PATH]/attic/data_publisher.tz +expruavAC89RfrZxSrYwdoA6Wr5ghwdUSns8SNaHcng1JRcqR1dwpR [CONTRACT_PATH]/attic/dispatch.tz +expruat2BS4KCwn9kbopeX1ZwxtrtJbyFhpnpnG6A5KdCBCwHNsdod [CONTRACT_PATH]/attic/empty.tz +exprubD7VQHa8qeqRsFByes3ANZ24mvUnqW3qKAsKVUCncjxYEXtGp [CONTRACT_PATH]/attic/fail_amount.tz +expruYCfXuFoyakdWc3C6Np5ojQrGLDMMN6btVbVEAc97MJzpQYVrm [CONTRACT_PATH]/attic/faucet.tz +expruuvYJkV5YndLNMHFg54yDF1HG6AP4zMsui7RgQBLr6vCZVBVYt [CONTRACT_PATH]/attic/forward.tz +exprv8K6ceBpFH5SFjQm4BRYSLJCHQBFeQU6BFTdvQSRPaPkzdLyAL [CONTRACT_PATH]/attic/id.tz +exprujqMuqia1zKuReMgjumpsn8XAJ5N6RWaoz3kZpLNRUyyQXwrtY [CONTRACT_PATH]/attic/infinite_loop.tz +exprtoE9fvqNeHngkFPopZv412GoqoZ57HgaCi2XFR7YxkwPpvHXBZ [CONTRACT_PATH]/attic/insertion_sort.tz +exprux8tMeArJNXUekbuHqLb6epu2eWXJy85f8Yts5oHASHyWp6bva [CONTRACT_PATH]/attic/int_publisher.tz +expruosSkGQbRDc3NUt5oEqSkt3dqxymQDKDeNxcjRgFNLxARG414v [CONTRACT_PATH]/attic/king_of_tez.tz +exprtZcF9NutGBwyuXTqEi4SyL3bZdAWqzkDc782wxNhYT7LtdY4Lb [CONTRACT_PATH]/attic/list_of_transactions.tz +expruDiMLqyYi67RbkDfNyEjBDgJqQLiCGVx2xLUiWujSkwr7rVyRD [CONTRACT_PATH]/attic/queue.tz +exprtZYeWyxANtdrSANECgXdeakcP9fJm7ecJhpeuGR55a8gDTSXWe [CONTRACT_PATH]/attic/reduce_map.tz +exprvMneQMtBQzcPKboFsEV7R4BAuoF8QLUDMWB62iYLmKz9tztNdJ [CONTRACT_PATH]/attic/reentrancy.tz +exprueaa65wkL9ennP6vZoUP6yCkzz6Wc4cF3w11q8bGXguokXAEvK [CONTRACT_PATH]/attic/reservoir.tz +exprtwrNpVRUJaVTBs5vXFLbt4v6Fb8LRySwc1Ap8ZWZh4JbLfgJ6P [CONTRACT_PATH]/attic/scrutable_reservoir.tz +expruwtkYFMkNLVjKD8hypuDc53SHLQQ65g6VPGiHFXbY5hHwmb552 [CONTRACT_PATH]/attic/spawn_identities.tz +exprtjdvZr5J7WfN4SyNgKueLnxX4fALUYJ4cmi675EHJdUu5yyg2n [CONTRACT_PATH]/entrypoints/big_map_entrypoints.tz +expruwheT76ehrMrKiyNw8pQEEUfQ1t184BMXGqhaMEuJUCKHNytMj [CONTRACT_PATH]/entrypoints/delegatable_target.tz +exprv2AhXPjk56KeNgWmzN15v8f9SoLHMQhNmDAgt6SpAMFmYRCQjx [CONTRACT_PATH]/entrypoints/manager.tz +exprv2SsGeZ6PiC2CXiSePHYQhn88XWmsKVGgG8ZGyNo8p9CNPrRXj [CONTRACT_PATH]/entrypoints/no_default_target.tz +exprvFzfTFqHSFZuDHh91nrupqpULYorBNZRgLEEiPkUhkNVyskyTz [CONTRACT_PATH]/entrypoints/no_entrypoint_target.tz +exprtw1GsUzdCfFR6bHsdF78uTbejEJ4iTdXn7YTYRU5C7XS89dyxU [CONTRACT_PATH]/entrypoints/rooted_target.tz +exprtaqrrvZzcS8wKS8u6RcVqRJhnu2Qbex9jRUZHQxJJeqhhfhtXJ [CONTRACT_PATH]/entrypoints/simple_entrypoints.tz +expruN224mpoNLwPiVuGuaJ22QZjMuK6sKjGFAeSyQY8PQoBC7Hoim [CONTRACT_PATH]/ill_typed/big_dip.tz +exprtnvncrJA5Fo5iyGnhyXhHXyWJuwvzWHP6Rbokbr7HsSqxQ7QLC [CONTRACT_PATH]/ill_typed/big_drop.tz +expruMk21qTMDDKvFNjTNLab33QEbdnG3kP7M1WEWcXhpPLkCAA21X [CONTRACT_PATH]/ill_typed/chain_id_arity.tz +exprtrJKmsNVineQxEPp8Eq7FcC7edZHbJEdrn56WpqxW61QCpjacm [CONTRACT_PATH]/ill_typed/comb0.tz +expruQsBtw9Fg9gmZSiCPUDD8FjqzDvQDTG5FSFbSJsr7j64DLbwjE [CONTRACT_PATH]/ill_typed/comb1.tz +expruDceVcE3mACUGZhntGk2BMQNNn8UaFZhd8BnRfyWWzdFav7VyP [CONTRACT_PATH]/ill_typed/contract_annotation_default.tz +exprv8no3WSXCsf89WYazUNurLm8hwZRwTWYBQrzihscQcR6M1uKEu [CONTRACT_PATH]/ill_typed/create_contract_rootname.tz +exprtxuT8vf615qpJ9ycmVu7XUGBB8pZZjnPKnZhFhBMfdUpw2JarU [CONTRACT_PATH]/ill_typed/dip_failwith.tz +expruUrLEKFhakNNzTRBigYqnGi2DkvS64m52omEYizdjmscmgF2AQ [CONTRACT_PATH]/ill_typed/dup0.tz +expruUbLS1knNLEJMoE8c7oTbNo3EXiEgagPewKZLFUukFpQZJ7zce [CONTRACT_PATH]/ill_typed/failwith_big_map.tz +expruk5YNGKzCkCMbLhr3euh9xQWZcmtZkGV891LMhNHbxpe1P5QTW [CONTRACT_PATH]/ill_typed/invalid_self_entrypoint.tz +exprtX6MmAqAQ37LRgnkdv525PKHiGdGXyKT33M1NASahAMSCt43VS [CONTRACT_PATH]/ill_typed/map_failwith.tz +expru9tAzQAm6c8Uv4oU6EpkJR6wWXZ8b7MUfyQMorpR8j3HKb2xQM [CONTRACT_PATH]/ill_typed/missing_only_code_field.tz +expru1TjqXpC2u8BLGP5Ps6DPyXLvRY7arR187zjhTJsT3ovrbyqSm [CONTRACT_PATH]/ill_typed/missing_only_parameter_field.tz +exprtnqtHEs13CBddyrcWuvRzsBqgk4vFqdaYTGp2UzY4Z8ahAW6Ej [CONTRACT_PATH]/ill_typed/missing_only_storage_field.tz +expruyMAkvFzMm9ANKFgnpX5cfTVufBcrEn47wYGmnD1hocSbHJLxp [CONTRACT_PATH]/ill_typed/missing_parameter_and_storage_fields.tz +expruRoBeRu3HBshceKrBikpiJWgz9pET8UC6QH7xvM33wPtxJ5cxL [CONTRACT_PATH]/ill_typed/multiple_code_field.tz +exprvLL1MBfbBRMb3R4cy6bJ6KgoMuzNmL6u2y6NaT1hhbCmkprDi1 [CONTRACT_PATH]/ill_typed/multiple_parameter_field.tz +exprudNsSikUJ8etsu55GFBJY33H2x9tzT7v2k1w5m5gLJBb8vU2B9 [CONTRACT_PATH]/ill_typed/multiple_storage_and_code_fields.tz +expruLyv1V3fshbeb9HzsodyQFGDihmbt9wZD8UdP3NJEXzBvkaUL8 [CONTRACT_PATH]/ill_typed/multiple_storage_field.tz +expruvbJCzBYasMCg3DcjmYK9FodRbLokBpWNxZpJDyyunsQK6gWCF [CONTRACT_PATH]/ill_typed/never_literal.tz +exprvBkft3ii7B5gjvqFJKsEGq1z9VhnRHW5JAdPNGWPvMdkMRKjTA [CONTRACT_PATH]/ill_typed/pack_big_map.tz +exprutSqwcaXa6tmF2D4asfxkb6QN5CDn128U4ntCgRG5JKUPan7i2 [CONTRACT_PATH]/ill_typed/pack_operation.tz +expru6yXKqKsiikqZe4hgfbACNDFiGtSSoRsuEtcJy5iYwkwDCG9T4 [CONTRACT_PATH]/ill_typed/pack_sapling_state.tz +exprvQzTcT6STxdp9CJi4mtrY9fvv6VvmfRjEqoQwUqYwEK85mjw5H [CONTRACT_PATH]/ill_typed/push_big_map_with_id_with_parens.tz +exprvMz8TqvLs55NtZzBJ2quCwCB7FqxhVuAiMtEZGK8MWxQw6H9Xx [CONTRACT_PATH]/ill_typed/push_big_map_with_id_without_parens.tz +expruW1dZrFKoyXWLXr3Yeqhmivj9qqqnDyWSc3NzyVHudEANGYjVW [CONTRACT_PATH]/ill_typed/sapling_build_empty_state_with_int_parameter.tz +exprv7mqCULEgnAUKoU4foKVKZeuM6uMSkCCgoMeE1oGYMXGebu5L7 [CONTRACT_PATH]/ill_typed/set_update_non_comparable.tz +expruVMMR2tyqqRqpVQzhLXF47658GNFQB2gLaemhrV8gRm9yZt1x4 [CONTRACT_PATH]/ill_typed/stack_bottom_undig2able.tz +expruxH5WZ4TkhVCUq767J2fHG2yuqL13fWjcKK8azQmy2N9ud11RG [CONTRACT_PATH]/ill_typed/stack_bottom_undigable.tz +expruVvGWPSfsZCtSGEm3qMmCgyveYXhVLQhhxpYBv7GTqaDL91kLf [CONTRACT_PATH]/ill_typed/stack_bottom_undip2able.tz +exprtYhZdG4uP6y2pq4ewHDahRQP4fZ2iBMEYRgpq1hqMFQmMRZuWR [CONTRACT_PATH]/ill_typed/stack_bottom_undipable.tz +exprttbYRZnFJLumEAvLpyH6R1A1GjcwuP39EZTqwNWYyceAAWFKoK [CONTRACT_PATH]/ill_typed/stack_bottom_undropable.tz +expruRbdhi81mKdvamEnP2LoCNVVz6ewvyWhezKqZGxjrVFt7hpcq2 [CONTRACT_PATH]/ill_typed/stack_bottom_undug2able.tz +exprtgLFbB3vNCxh9hHfH2rQdS2Vnqqucwqa2PGZScv6f64agKeay3 [CONTRACT_PATH]/ill_typed/stack_bottom_undugable.tz +exprvQjZYDufKeuRxvKsMEPFMyuZYWYVUSe2GZJw8eXRXYSD73buTB [CONTRACT_PATH]/ill_typed/stack_bottom_undup2able.tz +exprtz1gy2jW3mpiJxgquMA68mjWh8s61HDQJzVp5hhUQnVsP9xR5L [CONTRACT_PATH]/ill_typed/stack_bottom_unfailwithable.tz +exprvDK14kRaERXV4ygtEJTgd5UQikyupAMdTWbZFTULAFPzARqAdQ [CONTRACT_PATH]/ill_typed/stack_bottom_ungetable.tz +exprtydB8VD3snEKSXYgV2SphRE8bZvPJd3o1QEU6GPqZm8cHc1iTR [CONTRACT_PATH]/ill_typed/stack_bottom_unleftable.tz +expruKgcBzkj11KzkbRKYAsWrngu4rBuqNmhPdGWudV4KeePSJGoEk [CONTRACT_PATH]/ill_typed/stack_bottom_unpairable.tz +expruFLiTmNwLXuXVaPGquovMCYjgCeJzKKV27DK14NQAG7z4nGxvQ [CONTRACT_PATH]/ill_typed/stack_bottom_unpopable.tz +expruQAEgAnhPLZuaywyGgJGqcRFWn2rEDprqNHvRDxirdShLwc26c [CONTRACT_PATH]/ill_typed/stack_bottom_unpopable_in_lambda.tz +expruGDfhqvw6oH6cA6Vvvjdn8FyEmJ7SUizhNFCYNSfG2ikmBr5ea [CONTRACT_PATH]/ill_typed/stack_bottom_unrightable.tz +exprunAg8DteXhBhjmmEPasSRe5u18oN5UdwJUyz7crzktR1n7aj7g [CONTRACT_PATH]/ill_typed/ticket_apply.tz +exprtv5Yt3ihwrqvfZm2CZdHkJk544CdepaQ5g6jTF5UhfvK3y1PAc [CONTRACT_PATH]/ill_typed/ticket_dup.tz +expruQfVM57mGxNiY7XpV3Rex8xhqLwRyXvvSEBEZuHKvoVgo8sfsU [CONTRACT_PATH]/ill_typed/ticket_in_ticket.tz +exprtw4id4R45wkzJz7g5GBiRStuREcD515mjMvECP2Nsjt1GCDQSb [CONTRACT_PATH]/ill_typed/ticket_unpack.tz +expruWHcaUVqG6kmYxQF1Mxx5hmB2SYUeNVWNkVrprgax67e9sLATa [CONTRACT_PATH]/ill_typed/uncomb0.tz +exprtrL9J2534bFgoBvVC1YaNVXDsE1c2FXWxgyDhDHtUz5zghortN [CONTRACT_PATH]/ill_typed/uncomb1.tz +exprujrucGLAmdmT3k2iRC2imquB7sUbcvSg6zVrvAxcvbrrkodSRb [CONTRACT_PATH]/ill_typed/unpack_sapling_state.tz +expru2vU5zmzGh2HRrwNeSnysgcVLMbPb1tkGoFTrNg6YiNMqm2dxD [CONTRACT_PATH]/ill_typed/view_op_bad_name_invalid_char_set.tz +exprufbbZ4jHZ6PJJT614zAJU4ZdSEEmjTpxM9YMnEMSLLR85tKe97 [CONTRACT_PATH]/ill_typed/view_op_bad_name_invalid_type.tz +exprtZFiFcS8quUpTKd6cdop8WKZ9km6X18pF8gWngrTarAiVWWuxv [CONTRACT_PATH]/ill_typed/view_op_bad_name_non_printable_char.tz +exprtn9rV6YNYRDCKtShnzAeKaYh8jqTNKjGxVYo1twk7hrAhPaLrT [CONTRACT_PATH]/ill_typed/view_op_bad_name_too_long.tz +expruBC7TwAKWgKbY8dpuDR7cuvxjFM6nCd935jCcWq9rSJNw1aA75 [CONTRACT_PATH]/ill_typed/view_op_bad_return_type.tz +expruoFRmDZuVddy7VmkV2QBcLgSStqpEDMDacTWsFzqTxZXdWdZfC [CONTRACT_PATH]/ill_typed/view_op_dupable_type.tz +expruxYAxsENuXbe9kyhfUaWWAjBfWkbuQy8irkyJkevrfLBsWt7xc [CONTRACT_PATH]/ill_typed/view_op_invalid_arity.tz +exprvPFLSH8Yzs7khoVZkEz4sYWbh6b8ekM6iHrGY5Ds1BjUm763QM [CONTRACT_PATH]/ill_typed/view_op_lazy_storage.tz +exprvPFLSH8Yzs7khoVZkEz4sYWbh6b8ekM6iHrGY5Ds1BjUm763QM [CONTRACT_PATH]/ill_typed/view_op_lazy_storage_type.tz +expruUdCLKAbj9Ww3JkAZ4W2UuTiJ7ugE7kg9DVe4AUfXKE8Q1iPVQ [CONTRACT_PATH]/ill_typed/view_toplevel_bad_input_type.tz +expruWvd91ycMrLFH8jF534BhTWjnHxaHrEubeRNeodafNWfjqqBXC [CONTRACT_PATH]/ill_typed/view_toplevel_bad_name_invalid_char_set.tz +expruethdzDpBvRtq9UQPdXGwRZqkWnqs6CrcNagNVhDU9vCwsMdzA [CONTRACT_PATH]/ill_typed/view_toplevel_bad_name_invalid_type.tz +exprtnn8xxH2nr6UErb9DNv9Z9xngpSzpYnNk6hwBTbye4x5uacMeQ [CONTRACT_PATH]/ill_typed/view_toplevel_bad_name_non_printable_char.tz +exprunFKRQPF9Hobtkqx32WyQ6ikygyLkL7DCBMNuMoG95NqzVF6si [CONTRACT_PATH]/ill_typed/view_toplevel_bad_name_too_long.tz +exprvMAXDRZuAVGhFHJwnWVoZ411MwmQ9EdVh2JuRnw5qcdz6MjQC1 [CONTRACT_PATH]/ill_typed/view_toplevel_bad_return_type.tz +exprv56pnBNv6EsEHTHjWhJ3tdv5qptVpQGw4ShYC4ojPMxk7Nkxok [CONTRACT_PATH]/ill_typed/view_toplevel_bad_type.tz +exprvAA9gioYUserBNWfg3dM3tpUkeJpEvQBhdCYo6Zkbj8cDciEHE [CONTRACT_PATH]/ill_typed/view_toplevel_dupable_type_input.tz +expru63YpYAZBw9UnRy2pmB9uMQRH4EJXF1BcRAV5xeq3tBdtKtt1F [CONTRACT_PATH]/ill_typed/view_toplevel_dupable_type_output.tz +expruhHAADYeL1YyPJJ6JJDVG1uZMtUChzTRY7wUqjqDJv42WF9iuM [CONTRACT_PATH]/ill_typed/view_toplevel_duplicated_name.tz +exprugDV6TiQP1tmA2JMGXiuF29EKmqacQeF3q7rWkfwzVrw5Qgksd [CONTRACT_PATH]/ill_typed/view_toplevel_invalid_arity.tz +exprum4MVnmugWSpeJysnzAkDFshNeuWboGS3qsgCi3eo9GCxGWZC1 [CONTRACT_PATH]/ill_typed/view_toplevel_lazy_storage_input.tz +expruT8foeFBSvHXuiN9UvAxj6d3ZhidwFteyE4pNHNe3zxcC1LKNv [CONTRACT_PATH]/ill_typed/view_toplevel_lazy_storage_output.tz +exprtf4cGFGDne118G4RFZkHFXFdZMNgAtm1h3zXohFS4n6mzEe4Bp [CONTRACT_PATH]/legacy/create_account.tz +exprtcuNLyAhcZ7Zt6K8pH3KzVyU9YELeSXkJsMPG1h3FyKebyzBz9 [CONTRACT_PATH]/legacy/create_contract.tz +exprutTcX1BwgaPug446zmc16pnipd59ytpVmA6JxAAEyUwJbD47Qv [CONTRACT_PATH]/legacy/create_contract_flags.tz +expruypHz1N6PhereVyiB349tQbrYJhBDr6pJBck1BAUudKRMvMH77 [CONTRACT_PATH]/legacy/create_contract_rootname.tz +exprvPF2hwUEU3GeucamVx6wnv9VWH39QsJVtQW3uUWwXc4aQWJVEw [CONTRACT_PATH]/legacy/originator.tz +expruyPygjWK6gmUgsRZgv7Df2rnqpQUMj65ApbCqmHXNbS2o6QAMk [CONTRACT_PATH]/legacy/steps_to_quota.tz +expruiDvGyQG5GzKzcBP7d5Z5doUcdxTmUcM6vL1jCTyTmxLrekmP7 [CONTRACT_PATH]/macros/assert.tz +expruMKaaLoPjYfDaKymizi9fnFY7hSDyPj2NfJFxSuAoEVknDxSM6 [CONTRACT_PATH]/macros/assert_cmpeq.tz +exprtqiRJEnWeqF5KKBRPjamJGoi2oQvekfnRwsdZNRy8w8wkbroKJ [CONTRACT_PATH]/macros/assert_cmpge.tz +exprtZWviL38eegiNAN55KfEtAHhAqUWoadkbxyFCGs3vDnDRzueft [CONTRACT_PATH]/macros/assert_cmpgt.tz +exprvBWTmSLBAGgcuBFSToCQPqH5J1F5R2vf8iJMiPVdZjG3B7hWq7 [CONTRACT_PATH]/macros/assert_cmple.tz +expruuDzygKxAaQ348e6BcRSk8A2Chq4WinaTUCTvg5YEVnGpptBg3 [CONTRACT_PATH]/macros/assert_cmplt.tz +expruxeuWRoEFHhzv7tG1rwderXePZzxtpL9BRQ9N7ZhoFXS6RPy9a [CONTRACT_PATH]/macros/assert_cmpneq.tz +expruaqEBPqAjaUawnFTSbGZXXr1HemnecV8GuLGD15nQvtxaXiH3z [CONTRACT_PATH]/macros/assert_eq.tz +expru9etUCKvNXZyDCx1x55QfZzyGxmgsteFNBoWAZeh6F5FHEHy3m [CONTRACT_PATH]/macros/assert_ge.tz +exprvP9aPgepXY1C4hVPWPMoDGhvSjNvH5sJvB25qcMMPFHurVyH9c [CONTRACT_PATH]/macros/assert_gt.tz +exprtbLVpjXVnhdMUyDM53MXHH2HBNSMxdnXsVTNtFFMHHVn18yUuZ [CONTRACT_PATH]/macros/assert_le.tz +exprtx7nibNobG8Y7asBYktu2NdPv3k3No29rM4nP1WSbricymunvc [CONTRACT_PATH]/macros/assert_lt.tz +exprvQM6Ukz3TKVSo4dqNDYmMvNG5rs3U7WGXpvjSVsM2oQj6SbdLM [CONTRACT_PATH]/macros/assert_neq.tz +exprueGaPWpG6szfmTAccNH5MaoqxovN7JCbx4CDsmpvnhBAUrAizc [CONTRACT_PATH]/macros/big_map_get_add.tz +exprvFc9HFkvwNGZVrJkU2KpXuXieVKCJ9VXbTo51LRWBMAB6oEbWq [CONTRACT_PATH]/macros/big_map_mem.tz +exprv7Gwz5KP32zP9FYPSng9mPqLYbxwttDZin5QPnqzsUM3MZBvLK [CONTRACT_PATH]/macros/build_list.tz +exprvNqdnnqWgrrZYgnkuFeXrboqQYnYiRLSb7wV4E27bdZcbrU5GK [CONTRACT_PATH]/macros/carn_and_cdrn.tz +exprtknptGzyx8quFM8gHyGcpyX5xYeUxUpoVPhZeBkRqz5hUHfuq7 [CONTRACT_PATH]/macros/compare.tz +exprussGZ9wiqKqGkCsFJrfvr5DXxqZiLuHATJuvr3D8ar3KCeNaCz [CONTRACT_PATH]/macros/compare_bytes.tz +expru4Mmhu46yLQj4Q767jgVgvbaNe7B6EwvYvWA9KCrfzCxwBnzCQ [CONTRACT_PATH]/macros/fail.tz +exprtyJ1YYdejX7jRUh8FDjbbwrbAFwZYKPjdEZMNUUWdncqEwvuyr [CONTRACT_PATH]/macros/guestbook.tz +exprvMCL9Ti9C12EZUiFR1YtSp7nYjPN4DoyJPQiyVDYCZsSsheTeV [CONTRACT_PATH]/macros/macro_annotations.tz +expruq2AH96hXvqFqphuMKhJUY8mGMmdHuiHWHjkZqooZoEusTNNRf [CONTRACT_PATH]/macros/map_caddaadr.tz +exprueEkWTdWS8F25vnUP8gWd75MCfxk3vMhETn5dUYtrifV6FU8x5 [CONTRACT_PATH]/macros/max_in_list.tz +expruGfNErSHzpWnoNpgvZ3MRc52jiCHu8YTDUvh2T643QABr7NDZN [CONTRACT_PATH]/macros/min.tz +exprtw4kigYCiREgky6KBKryS7JkaGih6ju8jkjaXtpdcWYrYukRKX [CONTRACT_PATH]/macros/pair_macro.tz +exprtxutG1Nu8d198ebiCraNuQ8a6iYYqJYfGXq19aykNPB1uECc8w [CONTRACT_PATH]/macros/set_caddaadr.tz +exprvCE6JDXrzEfZuxTQzSgxWXtxX5GoNxvidL84CN2TAm6Hk3kuK6 [CONTRACT_PATH]/macros/take_my_money.tz +exprunGqZLZZwm9mY31NFGbBemCgXGevYqLRKdeRKQArPf824Npnni [CONTRACT_PATH]/macros/unpair_macro.tz +expruwYQvEdTgNzbm3228Xp6srt9FbG2v7w2F8yVH7BCK1P2NJTJUi [CONTRACT_PATH]/mini_scenarios/add_clear_tickets.tz +exprufRUAYF6r5QHQvK8CzWkKQcdvYkPx5fjEYzWPXc35Dry77KDT1 [CONTRACT_PATH]/mini_scenarios/authentication.tz +exprtjdvZr5J7WfN4SyNgKueLnxX4fALUYJ4cmi675EHJdUu5yyg2n [CONTRACT_PATH]/mini_scenarios/big_map_entrypoints.tz +exprtfWRfK4RoY8CF9VXvcHeBxizfjMMPAkLojfUTuoZkMSyiPKoyK [CONTRACT_PATH]/mini_scenarios/big_map_magic.tz +expruRE8G1Qc1dU8ZeQCTA48D69uPv8hpZYtDiKKHbfiy1mQLno8nx [CONTRACT_PATH]/mini_scenarios/big_map_read.tz +exprtotUpA2o34SHPX7ZQHD69WvJyEykTvPJ8T3RFErKAq4TQHFAgP [CONTRACT_PATH]/mini_scenarios/big_map_store.tz +exprtbeKR4fc2tqCWahuCeXAb42Hpye5dwmq8sj2guSztorTFJnh1J [CONTRACT_PATH]/mini_scenarios/big_map_write.tz +exprvTRcwMZnUPdSeRG8DdiC2xH3DrfMbp8qCwg76Av4pqbX5k4tHw [CONTRACT_PATH]/mini_scenarios/create_contract.tz +exprubRYeqf14u8CU4cEri2RWBrx26gkxyGe5wGeVAf4PDjKdsNhLK [CONTRACT_PATH]/mini_scenarios/create_contract_simple.tz +exprvLDpqaNLp1Cb8hbCqRU6tyU53n9PQkixgcBwFdSLJWsUdwhCQU [CONTRACT_PATH]/mini_scenarios/default_account.tz +expruaNoYRNTQxG5yujhHLetzS68ppQ38MFyi2ZhzNs5WNFv3wBAHG [CONTRACT_PATH]/mini_scenarios/execution_order_appender.tz +exprv6GXw7FheWdWKfY5oxtkB1AcqWkpKQDq4w7rxYFvwypZQijymK [CONTRACT_PATH]/mini_scenarios/execution_order_caller.tz +exprvSqfUw3oLZmQDwys8V5Qn9K1RAgMDGxdUUxzx1wpnyif3uSZG8 [CONTRACT_PATH]/mini_scenarios/execution_order_storer.tz +expruhMQvp6kKepaVGL8EEMPPk6zY1uyyW22Ugrr4ty21dtjDcVdbq [CONTRACT_PATH]/mini_scenarios/fa12_reference.tz +exprub9UzpxmhedNQnsv1J1DazWGJnj1dLhtG1fxkUoWSdFLBGLqJ4 [CONTRACT_PATH]/mini_scenarios/generic_multisig.tz +exprvTVuhJ2wNH8LHYEUiNC6ugx264rdfka1HkGfdVxV5632GjqgNv [CONTRACT_PATH]/mini_scenarios/groth16.tz +expru1u3Ta2uCGgcz6Z86K2mA5ierGB9RMaSwSppzVFxeuiXpBFZrf [CONTRACT_PATH]/mini_scenarios/hardlimit.tz +exprutz4BVGJ3Qms6qjmqvUF8sEk27H1cfqhRT17qpTdhEs5hEjbWm [CONTRACT_PATH]/mini_scenarios/legacy_multisig.tz +exprvRy1WUs7SQaNJm478UQHzz8uJAQoWT3bR5TXSnmbxWAcpZdGKu [CONTRACT_PATH]/mini_scenarios/lockup.tz +exprufAK15C2FCbxGLCEVXFe26p3eQdYuwZRk1morJUwy9NBUmEZVB [CONTRACT_PATH]/mini_scenarios/lqt_fa12.mligo.tz +expruBi6wgss7SRmpBCseBzcu3L283Jfx2CpUjgfuT2MgsozUsvBwt [CONTRACT_PATH]/mini_scenarios/multiple_en2.tz +exprtgxcdQP1EVvEYN2BHjbqTvwzywuYAdCmnfVgeP9zcgkxUrmScN [CONTRACT_PATH]/mini_scenarios/multiple_entrypoints_counter.tz +exprtzYM9ERr612k6ZBwGFJYHYcFbrG44y3KsanKg6Rz5VtEV7vUZK [CONTRACT_PATH]/mini_scenarios/originate_contract.tz +exprucgYdABPRbbq2yy2rpyt4Z8fv7PN4yhkch3QYZ5QQ5ehbtNA4K [CONTRACT_PATH]/mini_scenarios/parameterized_multisig.tz +expruyXnWo3aJfqo9Z6ycLDjyJygYCeH5JUrchAfFHZcvU1ebtDBXx [CONTRACT_PATH]/mini_scenarios/receive_tickets_in_big_map.tz +exprvJ8zXaBkyXMhJ2eKtPwdwbg5NLrggvW8MEpVK3hk3nAe215PQ6 [CONTRACT_PATH]/mini_scenarios/replay.tz +exprtuiYUMjM6d8XxPda1yfKeN61ko6riom35PzybC31NKXkVhgBQy [CONTRACT_PATH]/mini_scenarios/reveal_signed_preimage.tz +expruB4maBvk1y4JaeSLpDXWC3zKiXK5QFYv4B3R5KfdGEt4B5VvTT [CONTRACT_PATH]/mini_scenarios/self_address_receiver.tz +exprvTG7hjtWXeogStj3pzM1MCVcNg1q6KnivqNVzQjviUrJvsjfQn [CONTRACT_PATH]/mini_scenarios/self_address_sender.tz +expru6tUaVWpaR7D5invwY7inJnPZGPXTcDqFvirrHPMRxSeHki5Fz [CONTRACT_PATH]/mini_scenarios/send_tickets_in_big_map.tz +expruaFvFLsin2MWRuDkLRfe56pdPTUQ8RK9k1ks1rUTjBnwryPyPx [CONTRACT_PATH]/mini_scenarios/ticket_builder_fungible.tz +expruMFhigCZpXrGaL5sMyjGw5k7CanAa7XRkHFemCoCwMfJFJjDuD [CONTRACT_PATH]/mini_scenarios/ticket_builder_non_fungible.tz +exprthFU1n1xhXLi4D2G4andPJsLcem1g1UtKiKJjXkCfVHztC393b [CONTRACT_PATH]/mini_scenarios/ticket_wallet_fungible.tz +expruoGtEJH3sXXm2ruNG6DGTFE3GM6fjAS6fzDZKtdaMnRzHvi3Xd [CONTRACT_PATH]/mini_scenarios/ticket_wallet_non_fungible.tz +exprugya6ngixBfjyxV28ffnC8jmJPi4vbJdqD1aVUx82YLhzbH8Tn [CONTRACT_PATH]/mini_scenarios/vote_for_delegate.tz +expruaKedvXmhg6wbV361DHykomz5dPqLi473KxBwJwyicEnKMhpb9 [CONTRACT_PATH]/mini_scenarios/weather_insurance.tz +exprv9PvyjnsPjPCg5f13WtBiuD3o6idDAVWU6QfPtdWMjCLGRpwTh [CONTRACT_PATH]/mini_scenarios/xcat.tz +exprvKm5t6a6LL2d3HjvRiJumGrGei24aRXscJk3zB1hs516Ju4oMZ [CONTRACT_PATH]/mini_scenarios/xcat_dapp.tz +exprtyJrKmrcvMroXNvbNSJr4hrWcLqa6QHmKSSJLMNqe1nueq1MSt [CONTRACT_PATH]/non_regression/bad_annot_contract.tz +exprucvy7NUDPu2yTWEA6WVsusEZgGRmU1WpVzrFnNZV7m2H8BVysF [CONTRACT_PATH]/non_regression/bug_262.tz +exprumT8doqCpoTqPAuJa8dsnrC7giaz6aGnMkJDF9kg8j8mBEafAC [CONTRACT_PATH]/non_regression/bug_843.tz +exprv3FvpUYzomvhmzxsQyuR1katpswNnicQZB4jA5uec3MERXk1cB [CONTRACT_PATH]/non_regression/pairk_annot.tz +exprujPzkrPVucSvhHc1d9xm6kcs7oggkQyJXN8L2Rj3fteEABAkTe [CONTRACT_PATH]/opcodes/abs.tz +expruNtqq51Lm75X61pxUx7P2FyR2uyUKLsZNHMXWx6X5rsyJ5M6WX [CONTRACT_PATH]/opcodes/add.tz +exprupWD554EpqFBjo4KUpTqrfQcJAHqr3ijKmv5cmLRJ93Q1SgwGX [CONTRACT_PATH]/opcodes/add_bls12_381_fr.tz +exprugu3H5MPrpWJRZMPMGDM3Dbvykaa1fHejEvYr7ePKaLtahjQV5 [CONTRACT_PATH]/opcodes/add_bls12_381_g1.tz +expru41eYPF7gPvBRAtantBxbFU75RqBEwHPZ7UeX2EgHmExRoA4dh [CONTRACT_PATH]/opcodes/add_bls12_381_g2.tz +exprtcPYR7TZHxzcpmZWjjLgMWp6CeRWAxQ5Bt2bgpUK5uKjmNAdzL [CONTRACT_PATH]/opcodes/add_delta_timestamp.tz +expruLFQ1mcR5sg9sqyFHThknANoBeL4C5HFGgH55MqwPBEb1TUxLt [CONTRACT_PATH]/opcodes/add_timestamp_delta.tz +exprtz1uUW5sVUVaKNLhPaKGjA7jK9JmzWBCQu5Xn1MC3aS1FjTUmK [CONTRACT_PATH]/opcodes/address.tz +expruskF2nSeJeBaVHZsp45yN7mer9a4f8fAUBYvU3oRzbmpm5cVmt [CONTRACT_PATH]/opcodes/amount_after_fib_view.tz +exprucSgNGh1wkijmUcjLdifceE7GeMdLnxL3JZKpbxAmzF41ALo91 [CONTRACT_PATH]/opcodes/amount_after_nonexistent_view.tz +expruUQ1z6YqZM1baKofNLYhK9nocp9puAXCo4MYzEkQPbQcXTnajq [CONTRACT_PATH]/opcodes/amount_after_view.tz +exprvJ4NRS33cboLuTx58f3sbYpXf1m7Cq2ou9gpCh1k8foaCZAoas [CONTRACT_PATH]/opcodes/and.tz +expru5BXwmdpWQ3WDKA24g6gYGwLxPc868wKkdeAaGh899nD77Uxwn [CONTRACT_PATH]/opcodes/and_binary.tz +expruthG9mteYkv8qKgRq13VjZTvbjtJYt1HmQg8HktkvjCvKZgdhR [CONTRACT_PATH]/opcodes/and_bytes.tz +expruL6aKRTXN2hWb9EXLuJASu7nuBGJxL7VyT1oEjX9b2s3u6Y5Ff [CONTRACT_PATH]/opcodes/and_logical_1.tz +exprtpYYuLewZWKCK1aPb9gfYSiPWSaeXRM4P2e4rpa6UktVueB1uf [CONTRACT_PATH]/opcodes/balance.tz +expruWVQymVzetzkRaBYh4thmdWCvzWZNqdGrCTinGxLn58rPXDkgC [CONTRACT_PATH]/opcodes/balance_after_fib_view.tz +exprukgm7LHJiEywzSseHXp23nXM5Y9GfJ61ULij58BgRQ4nt3bYYT [CONTRACT_PATH]/opcodes/balance_after_nonexistent_view.tz +expruggCnM7PeEcUr2BapBmFMhD1QGvEoM4dUfyxp2u64ic1fM9SYN [CONTRACT_PATH]/opcodes/balance_after_view.tz +exprtZRAy4QHqpF8c3CusD6e1kxWA3KAUrmgeXndfQYSEGArDmkWUm [CONTRACT_PATH]/opcodes/big_map_mem_nat.tz +exprugsT35M51mCw6Fim3ysNKpCh8JyW9m7CYW65QQ7XUEDmspqz2i [CONTRACT_PATH]/opcodes/big_map_mem_string.tz +exprvN3tk4o5YPYJB6aYAxEx8KU93yNSaw4K6mbEZZh9RQayua6odv [CONTRACT_PATH]/opcodes/big_map_to_self.tz +exprv712JoEC7RRhoP7gbTUiVgLbtAgHmenwa5TqhVykDZ3e538MGU [CONTRACT_PATH]/opcodes/bls12_381_fr_push_bytes_not_padded.tz +exprufF1yaR5QHdy8iECBLjhBtDZVLiEjZRuJntSkXjsrJRYozXLmW [CONTRACT_PATH]/opcodes/bls12_381_fr_push_nat.tz +expruSVRATSSsbfHowLHGs5XHms95RuqBWSdDJoUKdns3fWbwasU1p [CONTRACT_PATH]/opcodes/bls12_381_fr_to_int.tz +exprvTBYxSJ7d1z1aZvvAgPrdZUXHzoFxkwBC7McES5BS56xvqkGXg [CONTRACT_PATH]/opcodes/bls12_381_fr_to_mutez.tz +expruTppbXBm1YHSCB4uYv9MQs6zxqRWqbkwGWoiKfF5Sjj5n2TpJx [CONTRACT_PATH]/opcodes/bls12_381_fr_z_int.tz +exprv5Si29PfXErNuJdEvJWQhWRJ3qPETygaWzRE3ctmCU4s6y2V9v [CONTRACT_PATH]/opcodes/bls12_381_fr_z_nat.tz +expruRsYz6JopAFGU95WfFU61SE3RbMGn3XPR9PFiTfLbgQr2kzu7u [CONTRACT_PATH]/opcodes/bls12_381_z_fr_int.tz +expruyE3E3o8EAptRBZtQAB5Kv3sxUZGv7DK6CpJ2YdotQj9gqW5wN [CONTRACT_PATH]/opcodes/bls12_381_z_fr_nat.tz +exprui72n1Jur5Px5ESXgxiF9Uw86DsoXPt1edGDpSv4CvnuPCtBPR [CONTRACT_PATH]/opcodes/bytes.tz +expruxed4mBnPkdz81bZmzgQ6wFEEdKZqFazTkD9cTGWAuHAB2HTfA [CONTRACT_PATH]/opcodes/bytes_of_int.tz +exprue485QnZ1W1ctgYRzPCy3pAcQmUAkAGGp6StowguHVCqMCVo7E [CONTRACT_PATH]/opcodes/bytes_of_nat.tz +exprtvRRYmpToi9y67ZzNmgjtdrgNkwVduSnBi7GZVrsmgDna8TSjB [CONTRACT_PATH]/opcodes/car.tz +expru5dDnxp1rhgXGmKigbLJ9ASaVHbkpkL6gLggtk9krgYC3jusc8 [CONTRACT_PATH]/opcodes/cdr.tz +expruxH6gEuBmNzg5nWEM4tv3jMBbknbEtTHKTPMeC4EBdFdujbRph [CONTRACT_PATH]/opcodes/chain_id.tz +expruGhHABGLz2wxAyyx3RpfyKHa8HE9voC19vLiAKYWYMMsUUTFdd [CONTRACT_PATH]/opcodes/chain_id_store.tz +exprtjDuLEzh8dcjpCcJiiuKXDdG3XusjuuURVCh3JWKBgjJGsVsMs [CONTRACT_PATH]/opcodes/check_signature.tz +expruHKTiWeY6mty7RokwdyZdwdzHQbu7udbbZbpu3C8h9n6jXnp4v [CONTRACT_PATH]/opcodes/comb-get.tz +exprtsyJo5ceZQM76zpAUeTren1YnBxw2MNDKmx8k11Ejai8T296Sg [CONTRACT_PATH]/opcodes/comb-literals.tz +exprv733yfMh1C9uyuAJJP66WPQDXAjjfcTcSfHhbboJnz6DUCEh41 [CONTRACT_PATH]/opcodes/comb-set-2.tz +exprvHamsTHMJKF6ohaSAwdgp2Sv33LGgYnjase3LUcwXKnJfh53wn [CONTRACT_PATH]/opcodes/comb-set.tz +expruufsxtik2vxyQfL3QKNWWH9TnJZgGx1ELi3AR5L3LM71uqxiP4 [CONTRACT_PATH]/opcodes/comb.tz +expruKknV6VYzPHkSxc3EFb488JPBfUX1UHsJUzceaGFafdnbgsKw2 [CONTRACT_PATH]/opcodes/compare.tz +exprvGXTYwatNh32w78r83SuLAW1YQefufYN1Bcu9AZ1BLDUU77dKR [CONTRACT_PATH]/opcodes/compare_big_type.tz +expruR3ZCLJTuojpTuS2sR3SGxqait52kXQNKfy8bipv69b2XJZG8A [CONTRACT_PATH]/opcodes/compare_big_type2.tz +expruUDL3EP43hFhcdCZD7K1xvfPtiNWfkU2Nyq8jmr9XgZuXqWXc5 [CONTRACT_PATH]/opcodes/comparisons.tz +exprtjqEmEBnmG7yiDXn224ER9bt4qh18LF4LzFSfoeuo1cbJpNBPy [CONTRACT_PATH]/opcodes/concat_hello.tz +exprtqd5qPLeh5Fi52YdkgWuvRXctgUoxU1Q4JDB2VseRk6DAEpMvd [CONTRACT_PATH]/opcodes/concat_hello_bytes.tz +expruv8MHvRmp3ipXYRyyP4aEE4iFHWsNZjNQSaCWUt7fwbgLeFBXY [CONTRACT_PATH]/opcodes/concat_list.tz +expruYk7GXYQ7bKbUcqcHDKs97USVBrxAkzSo2Bkj5AXVjSawDkNAS [CONTRACT_PATH]/opcodes/cons.tz +expruMW9W9kkb2JaQWzKVThky4ULQ6ckgLzE2xD49XUp5E1iwWfUbe [CONTRACT_PATH]/opcodes/contains_all.tz +exprvDvotLP1G2qjPJiqz2RvVUm8wJ2cEuFvKtm7YUNW3w6krDponF [CONTRACT_PATH]/opcodes/contract.tz +exprvNrgGoLvfEaXw6QmjQrkXESpWo72JHR4G4mhTJy7Y266YXa3fe [CONTRACT_PATH]/opcodes/create_contract.tz +exprttdxhC3YwJ9SGJNTDMQRpyWX1KwqAUuPbkQHX3uMPHNt3GKkZK [CONTRACT_PATH]/opcodes/create_contract_rootname.tz +exprttdxhC3YwJ9SGJNTDMQRpyWX1KwqAUuPbkQHX3uMPHNt3GKkZK [CONTRACT_PATH]/opcodes/create_contract_rootname_alt.tz +expruxUAUoijmC6A4rZK9XHcQL4WmgreJwT17hrgpuYkg1VeELBdbF [CONTRACT_PATH]/opcodes/create_contract_with_view.tz +exprteqmco8PDGH1PnTGgF5jPjBPCYyZfyvER2ULtv2y3MRgGdcP8T [CONTRACT_PATH]/opcodes/diff_timestamps.tz +exprtt6joHWnYr4AAW3uem8nzbxYgLcSpEJtaUT66qWchoKPS8sFXx [CONTRACT_PATH]/opcodes/dig_eq.tz +exprvKBfwAg4hVHrTtq3UV8AunaqUKxAkvx35TScbZDARNSgH737Ck [CONTRACT_PATH]/opcodes/dign.tz +exprv8t3ZfoBs6B7LMeFNN6U4PRpE1M6MhdtKPT5keNZT4je3RBadj [CONTRACT_PATH]/opcodes/dip.tz +expruncwh1qqNqSwq6kHYXfwhQyjpuJjbernTsyHAMnaLjU5h3qjxr [CONTRACT_PATH]/opcodes/dipn.tz +exprv62zo2ACMdseAu1HKzDDLSjBrYr2nZzi36PCTVJqcBwSdvt4yU [CONTRACT_PATH]/opcodes/dropn.tz +exprujbvaRkoroj5eVgboUyeP3578oJgScTQ78eBYMgfdLVaGWPPTW [CONTRACT_PATH]/opcodes/dugn.tz +exprur99uFkrwM63FXSTqSTypHcfEmzb5KQ9EypTRqZWDY5NP6tCHL [CONTRACT_PATH]/opcodes/dup-n.tz +exprtarW6tiguR7YAo6SxhCUDs1pLDhx9xJEG78h6GnXLAWpt3H1pT [CONTRACT_PATH]/opcodes/ediv.tz +exprvQhRaLYxiWN3QsJgT6VKf6DmGVuXR8DxeU63P9A8iNWA4TVQfs [CONTRACT_PATH]/opcodes/ediv_mutez.tz +exprtuM993oiKiYWoztZwpAaUuvDDcx9xDX31Q88kpuo7owk6Q8JeR [CONTRACT_PATH]/opcodes/emit.tz +exprv8Sy3DsiKMm3ZQPmi46kZGn9ctTigpLB2t6xYFdYkkeVHMXy6z [CONTRACT_PATH]/opcodes/empty_map.tz +exprufqf2G8PoZN768K2YGex6M7zmz7bYHE5LF5QHJBVvFtAFLi6qr [CONTRACT_PATH]/opcodes/exec_concat.tz +exprut53jocMPdPP8FXrKRDYSoRaxk1FXqCt7o46ak2wQaocjsSwwx [CONTRACT_PATH]/opcodes/first.tz +expru5fjTGWP1BXZz3BbbEFyDFkyZGJKHcZ2Y6jDT3CdHHp81n6G1r [CONTRACT_PATH]/opcodes/get_and_update_big_map.tz +exprua5oh3PDJEPQbEsnbHYCz6L7bY6kNvpyhEt7Cg9sPsrx82UmHQ [CONTRACT_PATH]/opcodes/get_and_update_map.tz +exprtgnkjSH6Tdw5C1BMKr8kCJjEnxCfMiaAxHTVLnEcyCQ6WmJ1jr [CONTRACT_PATH]/opcodes/get_big_map_value.tz +expruv8JdHeURNpuLHao37SGJauDPwB9yxFXUaL6hNCdXGzbHSqCZN [CONTRACT_PATH]/opcodes/get_map_value.tz +exprvHC1MDkeqCNL8yrN74nmqk5qrZCvR42qoVUxYCB4ALpgDfmhbL [CONTRACT_PATH]/opcodes/hash_consistency_checker.tz +expruzeve85eDLTpQ1EbgrQQcEUft7AGauZBwtK1ibuvJpwmZt9AE8 [CONTRACT_PATH]/opcodes/hash_key.tz +expruycqvZn4ufKjVQmYXcCfAfm7C81zN3BAqxuYVVfnpFibSKsahG [CONTRACT_PATH]/opcodes/hash_string.tz +expru34ooMhYSarFg7vZCe1Y23jwfxfHiDqwaE1wGXC48yjB21PLi1 [CONTRACT_PATH]/opcodes/if.tz +exprtmbKAmbV2XioTbmpJQpg9QDAxXkTBXmKRWdC8zbk8CWAtVXwAc [CONTRACT_PATH]/opcodes/if_some.tz +expruTGRZeiojz3Rrr45KUcwtpJuJYu6U8pxi4DBZpL2kGavVxxM4H [CONTRACT_PATH]/opcodes/int.tz +exprtu4Xbe67UZyTubEtKx83bMyQGXDwBibcdgLF5hftZYTEL2kSst [CONTRACT_PATH]/opcodes/iter_fail.tz +exprudLYgw6yWSrTHpXYsg9NcZxGGpCxdNFbNv7ksr6Ss8rNmh2fgT [CONTRACT_PATH]/opcodes/keccak.tz +exprusrBf5Sakr6dRngzuPmwsP28X6W56nVqCXqG1Jcfrd1SYwPRuU [CONTRACT_PATH]/opcodes/left_right.tz +exprvHZpmtBKjjsUZmchx2RTLmFAZnYKCnHSKXaKUdP5EUpiPYwsp2 [CONTRACT_PATH]/opcodes/level.tz +exprtkasRZbYRQg7WKnoXwJnRwXkvmjZEY4yPYXKGAQQFUupt5VAmt [CONTRACT_PATH]/opcodes/list_concat.tz +expru32VE4LnqAqhbpUFCdgEdRSHjLQipkXTjn624fL41yk3a4H5Q3 [CONTRACT_PATH]/opcodes/list_concat_bytes.tz +exprvCkexzSQFgEWkFvrkrQ8wATasfkbKCyeXYSM4qZft3g3UuoTBi [CONTRACT_PATH]/opcodes/list_id.tz +exprtbHaLLF4cUTh4VCjtnH32EAA2AFwvPBsCzUTgrrdofbotKMyr7 [CONTRACT_PATH]/opcodes/list_id_map.tz +expruAxpePKSFaGkjukWx4HEZAvXaWvyfyGyxCfhvK9tZjkPNSpZ1m [CONTRACT_PATH]/opcodes/list_iter.tz +exprvSCwmQGBkxgu2Tg5rYUXbyv33SpUskCJS7sPF4LN7e5pQ1fn7z [CONTRACT_PATH]/opcodes/list_map_block.tz +expruu6vcnLhDhSkSo8NNNJWQL99VCFr6iArtKrmavJWSNkQwDJsKC [CONTRACT_PATH]/opcodes/list_size.tz +expru8Et3hTjxKQpydKSThjR6fXSmPEmZDjBTNhTAbuyNjcPYoUQUL [CONTRACT_PATH]/opcodes/loop_failwith.tz +exprv15pFChKhH3QKoJn5BCT1bP4R7DjnXWtTDsSfwf2eVonZNxzZs [CONTRACT_PATH]/opcodes/loop_left.tz +expruAKUrHWCxb3qtVQ1a8qDzrS19HnTm7bS146AztFHekvpqbehaU [CONTRACT_PATH]/opcodes/loop_left_failwith.tz +exprtch5jHa718ipv2f28nbAQzQxk5LneyayirKxTBf8Q4gtS1XNGo [CONTRACT_PATH]/opcodes/lsl_bytes.tz +expruaRKkzMwKE6uDBPyUZ2u9nfKo1HenCVQLkBvevtteAxh7ey3w2 [CONTRACT_PATH]/opcodes/lsr_bytes.tz +exprubosuA8peKBt4EEo1RsYjxSxK7HXytSkBFAjns5Zg7ncicPWrC [CONTRACT_PATH]/opcodes/map_car.tz +expruqCpEBS2R8FqpBfDNUNrPhXZr39CBL6zKpyMogJR94sve62iv9 [CONTRACT_PATH]/opcodes/map_id.tz +exprtb1QBmNfCYjce9FnvKdikbtgqcN5o2VdVwZZP2Fmy8C3TJjA7q [CONTRACT_PATH]/opcodes/map_iter.tz +exprtuspLRSrYnp2FyqNcLfsBrBBFD8nnFog2Em3p7tfG4DcGujS3f [CONTRACT_PATH]/opcodes/map_map.tz +exprtipeMFcMFwYRAmzZBMoUjrtPYDk5ZyhMSyuhSgfiJV5UNAcLGp [CONTRACT_PATH]/opcodes/map_map_sideeffect.tz +exprtc9HPyzpfc71TE4a8UbRPxfdm4WGRPNQhfB5fHiWwkh1aA8uzm [CONTRACT_PATH]/opcodes/map_mem_nat.tz +exprtrkfCSUckShrEP5TmC5Y4CdeU35FFL7R8kyJHQUFZ4DNdJZasD [CONTRACT_PATH]/opcodes/map_mem_string.tz +expruqncptpX6oXeX88mAkVHh9DnzWb6vPwT6LvuND9yobgcH5Gd2x [CONTRACT_PATH]/opcodes/map_size.tz +expruZ7Tb7uhcAu3MhiDJFWrJiYseWyagZYEnzjEdpjSei8i73hsfG [CONTRACT_PATH]/opcodes/merge_comparable_pairs.tz +exprvNxEfUTwaryUzets4qyTbHAfNPb5ARQsMsxbm8CnGNHDedqxgy [CONTRACT_PATH]/opcodes/mul.tz +exprtYi1xHmB1AY6j4e3XTPvXpmuWnM4b4o78yVihYt1i2yNjrQqhY [CONTRACT_PATH]/opcodes/mul_bls12_381_fr.tz +expruFTKqYqMmWSakzE1gjs2p8kWtcRWTaddkYL5p2Z8wpcCfe5ei1 [CONTRACT_PATH]/opcodes/mul_bls12_381_g1.tz +exprvBDM3kep2f7bRkhRa2XWt9sdPGJ79sq6TdWNNnM4yydTQ88TaH [CONTRACT_PATH]/opcodes/mul_bls12_381_g2.tz +exprujbPsZAUa1tzgWNgeHEQ22JXDfNhkgx6sCCxbWjYoNWPbTvwhy [CONTRACT_PATH]/opcodes/mul_overflow.tz +exprth31LKm5FDFGxcXg1Rv9z9YeAQ8eu2oYTh2zZ7kJas3f5CWkZm [CONTRACT_PATH]/opcodes/munch.tz +expruP5gECQdRLkmuYg8xqvEAdE4oRGFjDVG3ZkWxtCyxve1jviw6k [CONTRACT_PATH]/opcodes/mutez_to_bls12_381_fr.tz +exprtw9PgkJCxyqdLjuA4dEdRjQXY7Ge4a7jjd2UoU6Q6KrvhFgciM [CONTRACT_PATH]/opcodes/neg.tz +expru5fYi1tAG8a9j2dYT561dXaox8wYjsZDZP18xPa5JN3bUNfHWS [CONTRACT_PATH]/opcodes/neg_bls12_381_fr.tz +expruY94PxNhmT8BeyGrFurRF6gC7XfgsBY9Vjh6hJyiDPaR8nFmri [CONTRACT_PATH]/opcodes/neg_bls12_381_g1.tz +exprv9bM4xnqjA33RkvUzz8ZppJXT32KdNXoYqY2NSh7whBcFPn2QS [CONTRACT_PATH]/opcodes/neg_bls12_381_g2.tz +expruZzA96Rh5o6HBboygY3iD97dgQcepXd45WBBD4DYZ2qcn8cxyY [CONTRACT_PATH]/opcodes/none.tz +expruat2BS4KCwn9kbopeX1ZwxtrtJbyFhpnpnG6A5KdCBCwHNsdod [CONTRACT_PATH]/opcodes/noop.tz +expruMUpBKBPGde4GfNLM8NgMq9nL6KsQXGA3LPt4C6wtMTxcUnE9A [CONTRACT_PATH]/opcodes/not.tz +exprtnpHGyp2TurQb2YzbXBKTipXnrUQ4RrZwPxWfa1yMXS7oi49jV [CONTRACT_PATH]/opcodes/not_binary.tz +exprtr3AhRfBVUibP5MtbenGDTEasfxSJAFsuYgkjmLqfpHnDahfWz [CONTRACT_PATH]/opcodes/not_bytes.tz +exprusKUuYeoKXUAYtUhtknryT9MpbPZVZtbfUNCdRpXUbdzEzbwmN [CONTRACT_PATH]/opcodes/or.tz +exprvG84juZWwLHTrhtvWFWBs8D2wZw6rfpoAbXp2pkekuCMAaPbAn [CONTRACT_PATH]/opcodes/or_binary.tz +exprvN5DmSbMk2JQ9nNSEakbicPj4vfGP4N4iWo3yabNAFvqNxCAkq [CONTRACT_PATH]/opcodes/or_bytes.tz +exprv39cZxxm6fTcFSbLcwpBbAPW56FPqjdf6aGm21KqGA6DQtwn6u [CONTRACT_PATH]/opcodes/originate_big_map.tz +exprunveMvzjDskHYCvYJzDfRR9aGwwvXkVUMqTwSxJJbEjeq63c2D [CONTRACT_PATH]/opcodes/packunpack.tz +expruKkmmajE1UFXRHXtntLZU8VvnLfFKwYPd4azsAdcrDMaq5zu9H [CONTRACT_PATH]/opcodes/packunpack_rev.tz +exprtk9p4ur3KZK2w8ziFoZVHPABxQWZXeSNowcJuTauL3zTxr1zcH [CONTRACT_PATH]/opcodes/packunpack_rev_cty.tz +expruSamDrL2Dh4zp92cVgfV7ETT7VcnqACDVcvnafi3qgBZq9v3PL [CONTRACT_PATH]/opcodes/pair_id.tz +expru3WFEX5bVjBUkZzuWspLG18hy5jTzbr2WtKEYpfPHGpDFvcqhd [CONTRACT_PATH]/opcodes/pairing_check.tz +expru2U5Bi7ehgkQvP7Qmij4c8gkSFUBNtiCyXMX3WwGjEdRRZc5x1 [CONTRACT_PATH]/opcodes/pexec.tz +expruPr8QtATywJFqPjDhF7gyqdF15L6J7pxgpypzorEvtubdJN8U2 [CONTRACT_PATH]/opcodes/pexec_2.tz +exprvBUenyTMJKwERZ1ULzMVrJ1owqymBF32f627arqtFUzMpaMvbC [CONTRACT_PATH]/opcodes/proxy.tz +exprvPaPcYHvKmnyBMaYXtp6ZuaSEHWr5y92bcroKKppAZvF4RvcWE [CONTRACT_PATH]/opcodes/ret_int.tz +expru8MKLXqiNRYnPccUN4if3VnWfthDy24K4zuJrFh2JaMmmh6Rii [CONTRACT_PATH]/opcodes/reverse.tz +expruta4Bjo3FggDcvZDzEVwzeTcdZptzkJZyFEkdB8suFGbMVtT2Z [CONTRACT_PATH]/opcodes/reverse_loop.tz +exprueR2MPCHUFtPjMZXE57X3EsysuWJXGRz8ZgcPJj21UySLqULV1 [CONTRACT_PATH]/opcodes/sapling_empty_state.tz +exprvSNMswzVUk47vqs4wTGipDb3qDKVUwNBDwXtGzjCprEYx4nWPo [CONTRACT_PATH]/opcodes/self.tz +exprtzokY2FHvPvB9YHSi8MM5YUbPdUPLi7tEKkp8BKongPb2zrZch [CONTRACT_PATH]/opcodes/self_address.tz +exprukm3NvsYbS9ymX3MuXh6LciuF8ef2qt8ktTGaXtyFxCpisMBdD [CONTRACT_PATH]/opcodes/self_address_after_fib_view.tz +expruV4HCC6sRdEL5HyXVC9gTkMZbh8BnxXsKZDTydtztRhDUT3qxa [CONTRACT_PATH]/opcodes/self_address_after_nonexistent_view.tz +expruUWxiqrD566farETUi3VChWNZ5teemC3q4G8tf83xhjTwRSEws [CONTRACT_PATH]/opcodes/self_address_after_view.tz +exprvQ8rhMFcCrwNSLZERQSQ9TMR1Tsnyj7R1jS8J2UESKXUoJuLTV [CONTRACT_PATH]/opcodes/self_after_fib_view.tz +exprvKoMUnUmthGpVmQfYkLa8F6GRwmU36D9jYXNG8j8QbQYNWUoAC [CONTRACT_PATH]/opcodes/self_after_nonexistent_view.tz +exprtXqpN6sqTKUVNissE3rkzKGSBuW2gTh8pRb3XyHZ4dpaAqLnhL [CONTRACT_PATH]/opcodes/self_after_view.tz +exprvDVUQXNsfs9FiHkMSofonWCWcBfYbfxeQy9DRaa5Tnbw1XM18Y [CONTRACT_PATH]/opcodes/self_with_default_entrypoint.tz +expruXGf2YpXKkr74mcv83fQ6bztVD1RBoFXaEnAd9bidnRXcfD3Nj [CONTRACT_PATH]/opcodes/self_with_entrypoint.tz +exprudmJ37Q8ZASPbZSSBfy5UezxLhniszTVkLAB8QKvxkav4gVVYr [CONTRACT_PATH]/opcodes/sender.tz +exprtufbuVP6RKm1PGPUQnZy6dqwxCha1jbafqyVGpCUNWeUVpcBhc [CONTRACT_PATH]/opcodes/sender_after_fib_view.tz +exprug4Jd1WdLqrZWiG8PsGDETN1ahpX5PycBrdNWadM96M5SjvLae [CONTRACT_PATH]/opcodes/sender_after_nonexistent_view.tz +exprvR3pRxvwuwM1c4Jk1zRfuDabRPwLnazpSsySQkzymatANufH9h [CONTRACT_PATH]/opcodes/sender_after_view.tz +exprurSxmHBRCHUxtXcqNkPA8UE6gaFeJa19bBhq1CarZ3CZuAzShs [CONTRACT_PATH]/opcodes/set_car.tz +expruogQk6tG5W7CtZrcMzsRtJ1f9moG9y5Qg5j29NATiaSywvQCcS [CONTRACT_PATH]/opcodes/set_cdr.tz +exprvCt5LtbC3mLLWHdvyxGcX3ND21Ym5GayCvePEHHGXAtgWu32sJ [CONTRACT_PATH]/opcodes/set_delegate.tz +expru133Wm63xA1qs5ymovjbP3N3iwPoTMcdUsbUqqbTf896jU78WR [CONTRACT_PATH]/opcodes/set_id.tz +expru151wgMY5reA7WVbnvkHrh9MVnfYFbCDaiE2aTGmkKACu2ZbJA [CONTRACT_PATH]/opcodes/set_iter.tz +expru13v2dm35MgMgTbwDJ4nEwNjRTau8mqztAyxGxXVbHNmskAA2q [CONTRACT_PATH]/opcodes/set_member.tz +expruE8c9EzG6kYQdp5RQXrAt2CekSFXVtKUzNDUnpVTDygEBP7VvF [CONTRACT_PATH]/opcodes/set_size.tz +exprtzSBcPatLYnGe5xtsSNGVjNBLMmHefxsQ7Q2QNjDMGmADKdWUC [CONTRACT_PATH]/opcodes/sets.tz +exprteVcB53uqnwQsZMTsBojwez6tkgRqj1qWCQTLgaQWxQGiNWXEE [CONTRACT_PATH]/opcodes/sha3.tz +exprvPbB5NtiV87RARduqoXtMoRjjy6jX8WYrfiu3RDjQrTKxPQnoe [CONTRACT_PATH]/opcodes/shifts.tz +exprtnS2EjwJ3MdSWS7R6UbZMqFoUHj1JpUhhtJacXdfmmzRNHL33W [CONTRACT_PATH]/opcodes/slice.tz +exprugZMQtZN7safMU7hV5QpM7nh7Vi5ur9sGjeWsmGRkW1ETox8uR [CONTRACT_PATH]/opcodes/slice_bytes.tz +exprvCqvDAp66YnPaZDdaAkCNafoGtw1fEuWaLxMFeMnX6oqrb93nP [CONTRACT_PATH]/opcodes/slices.tz +exprtzW4jh4MgY6iXgiCXft5q3Mig5XXANHn9CmcL8ApTrdnQgWzAm [CONTRACT_PATH]/opcodes/source.tz +exprvD9HJMfLEUdamfH9U8ozBaxA7hYVRMbK7At6sUqFMmhZ6UorWv [CONTRACT_PATH]/opcodes/split_bytes.tz +exprvJcmHwozD2DTtagjJJfyPgoCvBx5bMzXAkrsteYVvxeMr9SWm3 [CONTRACT_PATH]/opcodes/split_string.tz +expruDY992zB37mWpZwFQCrfDbkwmrCmjSHD4fzQcW1z1AeWeW8M3r [CONTRACT_PATH]/opcodes/store_bls12_381_fr.tz +expruZAkBxtwSXuMp6ZDNp41mJ6uZ4bw7RF9HNzJS9EnzTLxVhQ4SB [CONTRACT_PATH]/opcodes/store_bls12_381_g1.tz +expruZfFC7WkBQhK4Ksg5k5WxBamF4PvH2NGCxcd4DHUkKfeqQEBUe [CONTRACT_PATH]/opcodes/store_bls12_381_g2.tz +exprv8K6ceBpFH5SFjQm4BRYSLJCHQBFeQU6BFTdvQSRPaPkzdLyAL [CONTRACT_PATH]/opcodes/store_input.tz +exprvStWRo24QuETruMmMqkmLme6UAMHuTRNNq9Lq65oFgUvQmJGPV [CONTRACT_PATH]/opcodes/store_now.tz +exprtZPsTsBtNf9hjv7Yfda2EV4Sz3iaHpk4NkYHcKteXbsyQ9d6pH [CONTRACT_PATH]/opcodes/str_id.tz +exprv4UZUuBDCZZjtW5kaezZjaKqpi1GN6vxHsvQNNkFktnaEbDb1M [CONTRACT_PATH]/opcodes/sub_timestamp_delta.tz +expruVuXhQmoBMzZjPeY7VQSuJxefBBTuPyNR7PGnYhwouo9zKg3T1 [CONTRACT_PATH]/opcodes/subset.tz +exprtz2jbsXuMMPAXYAGJZqjuBp8iF38XadE3YuZoC2W5NkyhhHMuq [CONTRACT_PATH]/opcodes/tez_add_sub.tz +exprugbVFDGWcSSozyN3EK3AcdwtPeES3ao45HNogWc5V8fsJ8NsSP [CONTRACT_PATH]/opcodes/ticket_bad.tz +expruwtzPEyCm4Vaq42Fct7QG5eD1MzXzkJbRqm6EVQH6YSV2QLkr1 [CONTRACT_PATH]/opcodes/ticket_big_store.tz +expruqx789AMcKUYwDeeeRvSnwdCw8gMVvWA6vuzPzBQwBM2qcDXJB [CONTRACT_PATH]/opcodes/ticket_join.tz +exprvMp1LX8aeyEq9NiMXGyD34J4offZDANGRwFTxoEWXumEsDdAP8 [CONTRACT_PATH]/opcodes/ticket_read.tz +exprtvtEFi6v3awAwbHivJkjki6mDNivewiCBeJDJT78PqWtq7VyUD [CONTRACT_PATH]/opcodes/ticket_split.tz +exprtifPFaLqHvR9uGWbeLj5r3YVBnKaawt12q3BMhM9wsUdM9dFNy [CONTRACT_PATH]/opcodes/ticket_store-2.tz +exprvJGjz1EDdnAPWZQ7ZngDNDDDXnxA2VY6SHdHKu8LxqcVHd3E6z [CONTRACT_PATH]/opcodes/ticket_store.tz +exprvDjqte3hX8aieidgPA2qyPWA5eYuVrvb3KKZ8aYkeDotovgkQ4 [CONTRACT_PATH]/opcodes/ticketer-2.tz +exprvSU3oSiKqMLpWgBhwJZbEMDnvKiNW57MYQ8YG787N7jocXMEuR [CONTRACT_PATH]/opcodes/ticketer.tz +expruhV9RSEPAtKAUhBbdTw5gPFdjcKk8zr7cVLSsGtmJuH3o7VXXo [CONTRACT_PATH]/opcodes/transfer_amount.tz +expru3MSjYZRmQi3yiN6gYa4X6rs88XLWH4H8ivzrCvxs8z8cJfu4Z [CONTRACT_PATH]/opcodes/transfer_tokens.tz +exprtbACDcFtDfEwsBA5LAG13uMRAjnQsFjzNELMS7jQ87bcqgdE6r [CONTRACT_PATH]/opcodes/uncomb.tz +exprufJpS3BWpgv4QBaBEMucbn1jsVpdqEGLLMfXjDuKGPRGCpZUkj [CONTRACT_PATH]/opcodes/unpair.tz +exprtqjpmEs9GUjSEzJYSnN3skiCb8js2bY48R9Lhxk9JW1CKnm6VP [CONTRACT_PATH]/opcodes/unpair_field_annotation_mismatch.tz +exprv4ACaZe4aECCfG93NGVVHbQBNQ5Atxtju5vWASZSEp5sLECcjg [CONTRACT_PATH]/opcodes/update_big_map.tz +expruWzM36ATA3fAee4WHDS4vvMeewkwhya1fZaa6HFPbjwt9vvGpg [CONTRACT_PATH]/opcodes/utxo_read.tz +expruNCoB4n3KQTeXbDJWLwynT32T6dz2Nxw5f7SwaqRNkQSBog79A [CONTRACT_PATH]/opcodes/utxor.tz +expruJxgC2Q8Ubt8tPyQbZ41j6w4b8yw5f6bxjrMMM81TmMC9x5Lrc [CONTRACT_PATH]/opcodes/view_fib.tz +expru9EavkgPCUAwHccJf9j1t4aTTssPKoBkCqC4YNr12kxXSwqFqD [CONTRACT_PATH]/opcodes/view_mutual_recursion.tz +exprv4QXQuZtQE7CpKyecjrXJ8U2ovU1qjUKtw37J6kAEmu3fAKyN5 [CONTRACT_PATH]/opcodes/view_op_add.tz +exprugGjNh2tTsofJyhkNMrQVJnkyLydJywNVMAXL9rW3nhnCmRd3F [CONTRACT_PATH]/opcodes/view_op_constant.tz +exprtn56ZZ3mXHoz9GMS9HGMfmgayukvVXub8zXeDKbE4U7L5L8dXX [CONTRACT_PATH]/opcodes/view_op_id.tz +exprtaNDFRcdw8SB4Bz1a6CKARxZaoxpc6G2hnJYedp1iZgJqEwMNV [CONTRACT_PATH]/opcodes/view_op_nonexistent_addr.tz +exprtmA9Auh8GAHpvKP2qkVhiaRCtokWcw7qg31CaxbouJW1g8yYK7 [CONTRACT_PATH]/opcodes/view_op_nonexistent_func.tz +exprubMFU6xrnHREoXUZinEeV3PuZBjSw35M6gti7tyQ83S6LTKja1 [CONTRACT_PATH]/opcodes/view_op_test_step_contants.tz +exprtj9pixxS7UHchhthZa8zdU2GAjvW7oA7QEMA3PHgf88vmAEjFb [CONTRACT_PATH]/opcodes/view_op_toplevel_inconsistent_input_type.tz +exprurrbjDgnipRBhqb7pPLQFAgtPm5jrpwJjJL5ZvQyFJZzGvqteY [CONTRACT_PATH]/opcodes/view_op_toplevel_inconsistent_output_type.tz +exprvSPcq1w7iTMA3LjQcHegnRUQ621sqQLRJm1Zh4tjHCkmeZV268 [CONTRACT_PATH]/opcodes/view_rec.tz +exprv1LkSMvSyZSBrg9Tf2PdcoiWDYPz2npmYb7rH6bWx2sYMAHMgg [CONTRACT_PATH]/opcodes/view_toplevel_lib.tz +expruF13NKWWyF51seiYv4tsb55dZHYViNWDKTmhLq9b1LXXenwaB2 [CONTRACT_PATH]/opcodes/voting_power.tz +exprvSZMaiMSbKgRYm1W4rcoBGN21bPu8NMQuYBH9ujhXGeHhdtVGk [CONTRACT_PATH]/opcodes/xor.tz +expruDwpzxhBEyYY2Tqt9HE9iL18wWJEUJtF9WnkfAyHg1mqkRqs91 [CONTRACT_PATH]/opcodes/xor_bytes.tz diff --git a/tezt/tests/expected/self_address_transfer.ml/Mumbai- Self address transfer.out b/tezt/tests/expected/self_address_transfer.ml/Mumbai- Self address transfer.out new file mode 100644 index 000000000000..a4313faa6e46 --- /dev/null +++ b/tezt/tests/expected/self_address_transfer.ml/Mumbai- Self address transfer.out @@ -0,0 +1,141 @@ + +./octez-client --mode mockup --wait none originate contract self_address_sender.tz transferring 0 from bootstrap1 running tests_python/contracts_016/mini_scenarios/self_address_sender.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1422.112 units (will add 100 for safety) +Estimated storage: 339 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000462 + Expected counter: 1 + Gas limit: 1523 + Storage limit: 359 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000462 + payload fees(the block proposer) ....... +ꜩ0.000462 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (contract (lambda unit address)) ; + storage unit ; + code { CAR ; + BALANCE ; + LAMBDA unit address { DROP ; SELF_ADDRESS } ; + TRANSFER_TOKENS ; + DIP { UNIT ; NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 82 bytes + Paid storage size diff: 82 bytes + Consumed gas: 1422.112 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0205 + storage fees ........................... +ꜩ0.0205 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as self_address_sender.tz. + +./octez-client --mode mockup --wait none originate contract self_address_receiver.tz transferring 0 from bootstrap1 running tests_python/contracts_016/mini_scenarios/self_address_receiver.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1422.521 units (will add 100 for safety) +Estimated storage: 340 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000463 + Expected counter: 2 + Gas limit: 1523 + Storage limit: 360 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000463 + payload fees(the block proposer) ....... +ꜩ0.000463 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (lambda unit address) ; + storage unit ; + code { UNPAIR ; + UNIT ; + EXEC ; + SELF_ADDRESS ; + ASSERT_CMPEQ ; + NIL operation ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 83 bytes + Paid storage size diff: 83 bytes + Consumed gas: 1422.521 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02075 + storage fees ........................... +ꜩ0.02075 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as self_address_receiver.tz. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --arg '"[CONTRACT_HASH]"' +Node is bootstrapped. +Estimated gas: 4691.625 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000774 + Expected counter: 1 + Gas limit: 4792 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000774 + payload fees(the block proposer) ....... +ꜩ0.000774 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 82 bytes + Consumed gas: 2575.785 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: { DROP ; SELF_ADDRESS } + This transaction was successfully applied + Updated storage: Unit + Storage size: 83 bytes + Consumed gas: 2117.087 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Create and remove tickets.out b/tezt/tests/expected/tickets.ml/Mumbai- Create and remove tickets.out new file mode 100644 index 000000000000..7ecdf1cec3b9 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Create and remove tickets.out @@ -0,0 +1,220 @@ + +./octez-client --mode mockup --wait none originate contract add_clear_tickets transferring 200 from bootstrap1 running michelson_test_scripts/mini_scenarios/add_clear_tickets_015.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1437.780 units (will add 100 for safety) +Estimated storage: 398 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000525 + Expected counter: 1 + Gas limit: 1538 + Storage limit: 418 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000525 + payload fees(the block proposer) ....... +ꜩ0.000525 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter (or (pair %add nat string) (unit %clear)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { UNPAIR ; + DIG 2 ; + SWAP ; + DIG 2 ; + TICKET ; + ASSERT_SOME ; + CONS ; + NIL operation ; + PAIR } + { DROP 2 ; NIL (ticket string) ; NIL operation ; PAIR } } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 141 bytes + Paid storage size diff: 141 bytes + Consumed gas: 1437.780 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.03525 + storage fees ........................... +ꜩ0.03525 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as add_clear_tickets. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --entrypoint add --arg 'Pair 1 "A"' +Node is bootstrapped. +Estimated gas: 2582.758 units (will add 100 for safety) +Estimated storage: 105 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000536 + Expected counter: 1 + Gas limit: 2683 + Storage limit: 125 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000536 + payload fees(the block proposer) ....... +ꜩ0.000536 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: add + Parameter: (Pair 1 "A") + This transaction was successfully applied + Updated storage: + { Pair 0x0135c48b18c573e6d98d89ef9192f152c92c3ef39a00 (Pair "A" 1) } + Storage size: 180 bytes + Paid storage size diff: 105 bytes + Consumed gas: 2583.403 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02625 + storage fees ........................... +ꜩ0.02625 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "A" + Account updates: + [CONTRACT_HASH] ... +1 + + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --entrypoint clear --arg Unit +Node is bootstrapped. +Estimated gas: 2772.629 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000549 + Expected counter: 2 + Gas limit: 2873 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000549 + payload fees(the block proposer) ....... +ꜩ0.000549 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: clear + This transaction was successfully applied + Updated storage: {} + Storage size: 141 bytes + Consumed gas: 2773.274 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "A" + Account updates: + [CONTRACT_HASH] ... -1 + + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --entrypoint add --arg 'Pair 1 "B"' +Node is bootstrapped. +Estimated gas: 2582.758 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000536 + Expected counter: 3 + Gas limit: 2683 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000536 + payload fees(the block proposer) ....... +ꜩ0.000536 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: add + Parameter: (Pair 1 "B") + This transaction was successfully applied + Updated storage: + { Pair 0x0135c48b18c573e6d98d89ef9192f152c92c3ef39a00 (Pair "B" 1) } + Storage size: 180 bytes + Consumed gas: 2583.403 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "B" + Account updates: + [CONTRACT_HASH] ... +1 + + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --entrypoint add --arg 'Pair 1 "C"' +Node is bootstrapped. +Estimated gas: 3264.687 units (will add 100 for safety) +Estimated storage: 105 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000604 + Expected counter: 4 + Gas limit: 3365 + Storage limit: 125 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000604 + payload fees(the block proposer) ....... +ꜩ0.000604 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: add + Parameter: (Pair 1 "C") + This transaction was successfully applied + Updated storage: + { Pair 0x0135c48b18c573e6d98d89ef9192f152c92c3ef39a00 (Pair "C" 1) ; + Pair 0x0135c48b18c573e6d98d89ef9192f152c92c3ef39a00 (Pair "B" 1) } + Storage size: 219 bytes + Paid storage size diff: 105 bytes + Consumed gas: 3265.332 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02625 + storage fees ........................... +ꜩ0.02625 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "C" + Account updates: + [CONTRACT_HASH] ... +1 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Minting then sending tickets to smart-contract rollup should succeed wit.out b/tezt/tests/expected/tickets.ml/Mumbai- Minting then sending tickets to smart-contract rollup should succeed wit.out new file mode 100644 index 000000000000..5caa15f9a511 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Minting then sending tickets to smart-contract rollup should succeed wit.out @@ -0,0 +1,55 @@ + +./octez-client --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg '"[SMART_ROLLUP_HASH]"' +Node is bootstrapped. +Estimated gas: 4513.134 units (will add 100 for safety) +Estimated storage: 132 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000757 + Expected counter: 3 + Gas limit: 4614 + Storage limit: 152 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000757 + payload fees(the block proposer) ....... +ꜩ0.000757 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[SMART_ROLLUP_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 197 bytes + Paid storage size diff: 132 bytes + Consumed gas: 3504.115 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.033 + storage fees ........................... +ꜩ0.033 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [SMART_ROLLUP_HASH] + Parameter: { Pair 0x01fd32c99a7029e62387c85d6e9394626ecbcaa97700 (Pair "Ticket2" 1) ; + Pair 0x01fd32c99a7029e62387c85d6e9394626ecbcaa97700 (Pair "Ticket" 1) } + This transaction was successfully applied + Consumed gas: 1009.053 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [SMART_ROLLUP_HASH] ... +1 + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket2" + Account updates: + [SMART_ROLLUP_HASH] ... +1 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Overdrafting ticket from implicit accounts must be rejected.out b/tezt/tests/expected/tickets.ml/Mumbai- Overdrafting ticket from implicit accounts must be rejected.out new file mode 100644 index 000000000000..e1e1a34448ce --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Overdrafting ticket from implicit accounts must be rejected.out @@ -0,0 +1,210 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 2 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup --wait none transfer 2 tickets from bootstrap1 to bootstrap2 with entrypoint default and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 3 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transfer tickets: + Ticket content: "Ticket" + Ticket content type: string + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 2 + Destination: [PUBLIC_KEY_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + Attempted to set negative ticket balance value '-1' for key expruK1GiQe8Hzv7WY6McsaUsUFqgPJGzmZGvGZQ5VG3NACdyPgVEM. + +./octez-client --mode mockup --wait none originate contract tickets_bag transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_bag_016.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1446.306 units (will add 100 for safety) +Estimated storage: 451 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000576 + Expected counter: 3 + Gas limit: 1547 + Storage limit: 471 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000576 + payload fees(the block proposer) ....... +ꜩ0.000576 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (or (ticket %save string) (address %send)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { CONS ; NIL operation ; PAIR } + { SWAP ; + IF_CONS + { DIG 2 ; + CONTRACT %ticket (ticket string) ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } + { PUSH string "no ticket to send" ; FAILWITH } } } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 194 bytes + Paid storage size diff: 194 bytes + Consumed gas: 1446.306 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0485 + storage fees ........................... +ꜩ0.0485 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_bag. + +./octez-client --mode mockup --wait none transfer 2 tickets from bootstrap1 to '[CONTRACT_HASH]' with entrypoint save and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 4 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transfer tickets: + Ticket content: "Ticket" + Ticket content type: string + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 2 + Destination: [CONTRACT_HASH] + Entrypoint: save + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + Attempted to set negative ticket balance value '-1' for key expruK1GiQe8Hzv7WY6McsaUsUFqgPJGzmZGvGZQ5VG3NACdyPgVEM. diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Send tickets between originated contracts and implicit accounts.out b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets between originated contracts and implicit accounts.out new file mode 100644 index 000000000000..c10e66fa7e93 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets between originated contracts and implicit accounts.out @@ -0,0 +1,387 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none originate contract tickets_bag transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_bag_016.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1446.306 units (will add 100 for safety) +Estimated storage: 451 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000576 + Expected counter: 2 + Gas limit: 1547 + Storage limit: 471 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000576 + payload fees(the block proposer) ....... +ꜩ0.000576 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (or (ticket %save string) (address %send)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { CONS ; NIL operation ; PAIR } + { SWAP ; + IF_CONS + { DIG 2 ; + CONTRACT %ticket (ticket string) ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } + { PUSH string "no ticket to send" ; FAILWITH } } } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 194 bytes + Paid storage size diff: 194 bytes + Consumed gas: 1446.306 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0485 + storage fees ........................... +ꜩ0.0485 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_bag. + +./octez-client --mode mockup --wait none originate contract tickets_blackhole transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_blackhole_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1410.196 units (will add 100 for safety) +Estimated storage: 308 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00043 + Expected counter: 3 + Gas limit: 1511 + Storage limit: 328 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00043 + payload fees(the block proposer) ....... +ꜩ0.00043 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (ticket %ticket string) ; + storage unit ; + code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 51 bytes + Paid storage size diff: 51 bytes + Consumed gas: 1410.196 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.01275 + storage fees ........................... +ꜩ0.01275 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_blackhole. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 3' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 4 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 3) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 3)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +3 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +3 + +./octez-client --mode mockup --wait none transfer 2 tickets from bootstrap1 to bootstrap2 with entrypoint default and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 2124.710 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000524 + Expected counter: 5 + Gas limit: 2225 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000524 + payload fees(the block proposer) ....... +ꜩ0.000524 + Transfer tickets: + Ticket content: "Ticket" + Ticket content type: string + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 2 + Destination: [PUBLIC_KEY_HASH] + From: [PUBLIC_KEY_HASH] + This tickets transfer was successfully applied + Paid storage size diff: 66 bytes + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... -2 + [PUBLIC_KEY_HASH] ... +2 + Consumed gas: 2124.710 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup get ticket balance for bootstrap2 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +2 + +./octez-client --mode mockup --wait none transfer 1 tickets from bootstrap2 to '[CONTRACT_HASH]' with entrypoint save and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 4936.930 units (will add 100 for safety) +Estimated storage: 110 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000803 + Expected counter: 1 + Gas limit: 5037 + Storage limit: 130 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000803 + payload fees(the block proposer) ....... +ꜩ0.000803 + Transfer tickets: + Ticket content: "Ticket" + Ticket content type: string + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 1 + Destination: [CONTRACT_HASH] + Entrypoint: save + From: [PUBLIC_KEY_HASH] + This tickets transfer was successfully applied + Paid storage size diff: 66 bytes + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... -1 + Consumed gas: 2126.230 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: save + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Updated storage: + { Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1) } + Storage size: 238 bytes + Paid storage size diff: 44 bytes + Consumed gas: 2811.345 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.011 + storage fees ........................... +ꜩ0.011 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap2 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup get ticket balance for '[CONTRACT_HASH]' with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --entrypoint send --arg '"[CONTRACT_HASH]"' +Node is bootstrapped. +Estimated gas: 6446.754 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000954 + Expected counter: 6 + Gas limit: 6547 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000954 + payload fees(the block proposer) ....... +ꜩ0.000954 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: send + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: {} + Storage size: 194 bytes + Consumed gas: 3694.167 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... -1 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Entrypoint: ticket + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Updated storage: Unit + Storage size: 51 bytes + Consumed gas: 2753.748 + + +./octez-client --mode mockup get ticket balance for '[CONTRACT_HASH]' with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +0 + +./octez-client --mode mockup get ticket balance for '[CONTRACT_HASH]' with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +0 diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with some Tez along.out b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with some Tez along.out new file mode 100644 index 000000000000..a9c8e26d247b --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with some Tez along.out @@ -0,0 +1,115 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send_with_tez transferring 1 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_with_tez_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1439.500 units (will add 100 for safety) +Estimated storage: 411 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000537 + Expected counter: 1 + Gas limit: 1540 + Storage limit: 431 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000537 + payload fees(the block proposer) ....... +ꜩ0.000537 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ1 + Script: + { parameter address ; + storage unit ; + code { CAR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 1 ; + PUSH nat 1 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 154 bytes + Paid storage size diff: 154 bytes + Consumed gas: 1439.500 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0385 + storage fees ........................... +ꜩ0.0385 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send_with_tez. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg '"[PUBLIC_KEY_HASH]"' +Node is bootstrapped. +Estimated gas: 3586.780 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000663 + Expected counter: 2 + Gas limit: 3687 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000663 + payload fees(the block proposer) ....... +ꜩ0.000663 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[PUBLIC_KEY_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 154 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2587.027 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0.000001 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x017dfc16eb4482b866500d1104e3e8822d43b67dd100 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Balance updates: + [CONTRACT_HASH] ... -ꜩ0.000001 + [PUBLIC_KEY_HASH] ... +ꜩ0.000001 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with the wrong type mus.out b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with the wrong type mus.out new file mode 100644 index 000000000000..ad6884db559b --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts with the wrong type mus.out @@ -0,0 +1,195 @@ + +./octez-client --mode mockup --wait none originate contract send_ticket_list transferring 1 from bootstrap1 running michelson_test_scripts/mini_scenarios/send_ticket_list_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.840 units (will add 100 for safety) +Estimated storage: 402 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000529 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 422 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000529 + payload fees(the block proposer) ....... +ꜩ0.000529 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ1 + Script: + { parameter address ; + storage unit ; + code { CAR ; + CONTRACT (list (ticket string)) ; + ASSERT_SOME ; + PUSH mutez 0 ; + NIL (ticket string) ; + PUSH nat 1 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + CONS ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + UNIT ; + SWAP ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 145 bytes + Paid storage size diff: 145 bytes + Consumed gas: 1441.840 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.03625 + storage fees ........................... +ꜩ0.03625 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. +Contract memorized as send_ticket_list. + +./octez-client --mode mockup --wait none originate contract tickets_list_blackhole transferring 1 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_list_blackhole_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1410.157 units (will add 100 for safety) +Estimated storage: 299 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000423 + Expected counter: 2 + Gas limit: 1511 + Storage limit: 319 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000423 + payload fees(the block proposer) ....... +ꜩ0.000423 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ1 + Script: + { parameter (list (ticket string)) ; + storage unit ; + code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 42 bytes + Paid storage size diff: 42 bytes + Consumed gas: 1410.157 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0105 + storage fees ........................... +ꜩ0.0105 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_list_blackhole. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg '"[CONTRACT_HASH]"' +Node is bootstrapped. +Estimated gas: 5793.984 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000884 + Expected counter: 3 + Gas limit: 5894 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000884 + payload fees(the block proposer) ....... +ꜩ0.000884 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Storage size: 145 bytes + Paid storage size diff: 66 bytes + Consumed gas: 3041.341 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: { Pair 0x01b90a0e40c09f8a1de565627e93370247fbfe637b00 (Pair "Ticket" 1) } + This transaction was successfully applied + Updated storage: Unit + Storage size: 42 bytes + Consumed gas: 2753.804 + + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg '"[PUBLIC_KEY_HASH]"' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 4 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[PUBLIC_KEY_HASH]" + This operation FAILED. + +Runtime error in contract [CONTRACT_HASH]: + 01: { parameter address ; + 02: storage unit ; + 03: code { CAR ; + 04: CONTRACT (list (ticket string)) ; + 05: ASSERT_SOME ; + 06: PUSH mutez 0 ; + 07: NIL (ticket string) ; + 08: PUSH nat 1 ; + 09: PUSH string "Ticket" ; + 10: TICKET ; + 11: ASSERT_SOME ; + 12: CONS ; + 13: TRANSFER_TOKENS ; + 14: NIL operation ; + 15: SWAP ; + 16: CONS ; + 17: UNIT ; + 18: SWAP ; + 19: PAIR } } +At line 5 characters 9 to 20, +script reached FAILWITH instruction +with Unit +Fatal error: + transfer simulation failed diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts.out b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts.out new file mode 100644 index 000000000000..0859b10f4f69 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets from contracts to implicit accounts.out @@ -0,0 +1,111 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 2 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Send tickets in bigmap.out b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets in bigmap.out new file mode 100644 index 000000000000..15e882b0c29f --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Send tickets in bigmap.out @@ -0,0 +1,296 @@ + +./octez-client --mode mockup --wait none originate contract receive_tickets_in_big_map transferring 200 from bootstrap1 running michelson_test_scripts/mini_scenarios/receive_tickets_in_big_map.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1413.313 units (will add 100 for safety) +Estimated storage: 340 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000435 + Expected counter: 1 + Gas limit: 1514 + Storage limit: 360 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000435 + payload fees(the block proposer) ....... +ꜩ0.000435 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter (big_map int (ticket string)) ; + storage (big_map int (ticket string)) ; + code { CAR ; NIL operation ; PAIR } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 83 bytes + Updated big_maps: + New map(4) of type (big_map int (ticket string)) + Paid storage size diff: 83 bytes + Consumed gas: 1413.313 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02075 + storage fees ........................... +ꜩ0.02075 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as receive_tickets_in_big_map. + +./octez-client --mode mockup --wait none originate contract send_tickets_in_big_map transferring 200 from bootstrap1 running michelson_test_scripts/mini_scenarios/send_tickets_in_big_map_015.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1497.307 units (will add 100 for safety) +Estimated storage: 577 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00071 + Expected counter: 2 + Gas limit: 1598 + Storage limit: 597 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00071 + payload fees(the block proposer) ....... +ꜩ0.00071 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter address ; + storage unit ; + code { CAR ; + CONTRACT (big_map int (ticket string)) ; + IF_NONE + { PUSH string "Contract of type `big_map(ticket(string))` not found" ; + FAILWITH } + { EMPTY_BIG_MAP int (ticket string) ; + PUSH int 100 ; + SWAP ; + PAIR ; + LEFT (big_map int (ticket string)) ; + LOOP_LEFT + { UNPAIR ; + SWAP ; + DUP ; + DUG 2 ; + PUSH int 0 ; + COMPARE ; + LT ; + IF { PUSH int 1 ; + DUP 3 ; + SUB ; + SWAP ; + PUSH nat 1 ; + PUSH string "BLUE" ; + TICKET ; + ASSERT_SOME ; + DIG 3 ; + SWAP ; + SOME ; + SWAP ; + UPDATE ; + PAIR ; + LEFT (big_map int (ticket string)) } + { SWAP ; DROP ; RIGHT (pair (big_map int (ticket string)) int) } } ; + SWAP ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 320 bytes + Paid storage size diff: 320 bytes + Consumed gas: 1497.307 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.08 + storage fees ........................... +ꜩ0.08 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as send_tickets_in_big_map. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 30 --storage-limit 1000000 --arg '"[CONTRACT_HASH]"' +Node is bootstrapped. +Estimated gas: 100555.299 units (will add 100 for safety) +Estimated storage: 10767 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.010362 + Expected counter: 1 + Gas limit: 100656 + Storage limit: 10787 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.010362 + payload fees(the block proposer) ....... +ꜩ0.010362 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: "[CONTRACT_HASH]" + This transaction was successfully applied + Updated storage: Unit + Updated big_maps: + New temp(1) of type (big_map int (ticket string)) + Set temp(1)[22] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[48] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[20] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[67] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[30] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[33] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[42] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[13] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[50] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[84] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[44] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[41] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[4] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[73] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[5] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[28] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[19] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[9] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[86] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[76] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[8] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[97] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[80] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[45] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[87] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[1] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[26] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[38] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[65] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[99] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[69] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[2] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[81] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[82] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[64] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[92] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[90] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[98] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[37] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[66] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[32] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[71] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[51] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[56] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[14] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[12] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[85] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[47] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[74] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[18] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[10] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[35] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[96] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[27] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[77] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[62] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[58] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[25] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[94] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[60] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[7] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[53] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[11] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[17] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[83] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[72] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[6] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[88] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[75] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[3] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[70] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[52] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[95] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[68] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[78] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[23] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[79] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[59] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[100] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[24] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[21] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[49] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[93] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[39] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[63] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[55] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[15] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[16] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[31] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[43] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[29] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[54] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[89] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[36] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[46] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[91] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[61] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[34] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[57] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Set temp(1)[40] to (Pair 0x01e09c4d537373c6c8ca48684433c792ceb69c9dd200 (Pair "BLUE" 1)) + Storage size: 320 bytes + Paid storage size diff: 67 bytes + Consumed gas: 50736.525 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.01675 + storage fees ........................... +ꜩ0.01675 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: -1 + This transaction was successfully applied + Updated storage: 5 + Updated big_maps: + Clear map(4) + Copy temp(1) to map(5) + Storage size: 10783 bytes + Paid storage size diff: 10700 bytes + Consumed gas: 49819.806 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ2.675 + storage fees ........................... +ꜩ2.675 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "BLUE" + Account updates: + [CONTRACT_HASH] ... +100 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket from contract storage to implicit accounts.out b/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket from contract storage to implicit accounts.out new file mode 100644 index 000000000000..c8941dbb4110 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket from contract storage to implicit accounts.out @@ -0,0 +1,294 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none originate contract tickets_bag_implicit transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_bag_implicit_016.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1445.657 units (will add 100 for safety) +Estimated storage: 440 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000565 + Expected counter: 2 + Gas limit: 1546 + Storage limit: 460 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000565 + payload fees(the block proposer) ....... +ꜩ0.000565 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (or (ticket %save string) (address %send)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { CONS ; NIL operation ; PAIR } + { SWAP ; + IF_CONS + { DIG 2 ; + CONTRACT (ticket string) ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } + { PUSH string "no ticket to send" ; FAILWITH } } } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 183 bytes + Paid storage size diff: 183 bytes + Consumed gas: 1445.657 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.04575 + storage fees ........................... +ꜩ0.04575 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_bag_implicit. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 3 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup --wait none transfer 1 tickets from bootstrap1 to '[CONTRACT_HASH]' with entrypoint save and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 4906.419 units (will add 100 for safety) +Estimated storage: 44 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000799 + Expected counter: 4 + Gas limit: 5007 + Storage limit: 64 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000799 + payload fees(the block proposer) ....... +ꜩ0.000799 + Transfer tickets: + Ticket content: "Ticket" + Ticket content type: string + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 1 + Destination: [CONTRACT_HASH] + Entrypoint: save + From: [PUBLIC_KEY_HASH] + This tickets transfer was successfully applied + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... -1 + Consumed gas: 2096.226 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: save + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Updated storage: + { Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1) } + Storage size: 227 bytes + Paid storage size diff: 44 bytes + Consumed gas: 2810.838 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.011 + storage fees ........................... +ꜩ0.011 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +0 + +./octez-client --mode mockup get ticket balance for '[CONTRACT_HASH]' with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --entrypoint send --arg '"[PUBLIC_KEY_HASH]"' +Node is bootstrapped. +Estimated gas: 4240.926 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000734 + Expected counter: 5 + Gas limit: 4341 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000734 + payload fees(the block proposer) ....... +ꜩ0.000734 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: send + Parameter: "[PUBLIC_KEY_HASH]" + This transaction was successfully applied + Updated storage: {} + Storage size: 183 bytes + Consumed gas: 3241.173 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... -1 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap2 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup get ticket balance for '[CONTRACT_HASH]' with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +0 diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket of wrong type from implicit accounts must be rejected.out b/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket of wrong type from implicit accounts must be rejected.out new file mode 100644 index 000000000000..85d63f896fb2 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Sending ticket of wrong type from implicit accounts must be rejected.out @@ -0,0 +1,129 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 2 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup --wait none transfer 2 tickets from bootstrap1 to bootstrap2 with entrypoint default and contents 0 and type nat and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 3 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transfer tickets: + Ticket content: 0 + Ticket content type: nat + Ticket ticketer: [CONTRACT_HASH] + Ticket amount: 2 + Destination: [PUBLIC_KEY_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + Attempted to set negative ticket balance value '-2' for key exprugq4eqX58rVLseAJHVWVa8QNzQ4MTPUxdceBLT1zZHt2whCrLp. diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets from storage to smart-contract rollup should succeed wit.out b/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets from storage to smart-contract rollup should succeed wit.out new file mode 100644 index 000000000000..65291faeee16 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets from storage to smart-contract rollup should succeed wit.out @@ -0,0 +1,111 @@ + +./octez-client --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --entrypoint mint +Node is bootstrapped. +Estimated gas: 3053.548 units (will add 100 for safety) +Estimated storage: 221 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000577 + Expected counter: 3 + Gas limit: 3154 + Storage limit: 241 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000577 + payload fees(the block proposer) ....... +ꜩ0.000577 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: mint + This transaction was successfully applied + Updated storage: + { Pair 0x017a1d05251a570ed6e6e5af81f60883b857f8664500 (Pair "Ticket2" 1) ; + Pair 0x017a1d05251a570ed6e6e5af81f60883b857f8664500 (Pair "Ticket" 1) } + Storage size: 309 bytes + Paid storage size diff: 221 bytes + Consumed gas: 3053.548 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.05525 + storage fees ........................... +ꜩ0.05525 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... +1 + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket2" + Account updates: + [CONTRACT_HASH] ... +1 + + +./octez-client --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --entrypoint send --arg '"[SMART_ROLLUP_HASH]"' +Node is bootstrapped. +Estimated gas: 4870.301 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000797 + Expected counter: 4 + Gas limit: 4971 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000797 + payload fees(the block proposer) ....... +ꜩ0.000797 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Entrypoint: send + Parameter: "[SMART_ROLLUP_HASH]" + This transaction was successfully applied + Updated storage: {} + Storage size: 220 bytes + Consumed gas: 3861.282 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [CONTRACT_HASH] ... -1 + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket2" + Account updates: + [CONTRACT_HASH] ... -1 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [SMART_ROLLUP_HASH] + Parameter: { Pair 0x017a1d05251a570ed6e6e5af81f60883b857f8664500 (Pair "Ticket2" 1) ; + Pair 0x017a1d05251a570ed6e6e5af81f60883b857f8664500 (Pair "Ticket" 1) } + This transaction was successfully applied + Consumed gas: 1009.053 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [SMART_ROLLUP_HASH] ... +1 + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket2" + Account updates: + [SMART_ROLLUP_HASH] ... +1 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets to either implicit accounts or originated contracts acce.out b/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets to either implicit accounts or originated contracts acce.out new file mode 100644 index 000000000000..84037a86a08c --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Sending tickets to either implicit accounts or originated contracts acce.out @@ -0,0 +1,197 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none originate contract tickets_blackhole transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_blackhole_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1410.196 units (will add 100 for safety) +Estimated storage: 308 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00043 + Expected counter: 2 + Gas limit: 1511 + Storage limit: 328 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00043 + payload fees(the block proposer) ....... +ꜩ0.00043 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (ticket %ticket string) ; + storage unit ; + code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 51 bytes + Paid storage size diff: 51 bytes + Consumed gas: 1410.196 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.01275 + storage fees ........................... +ꜩ0.01275 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_blackhole. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 3 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[CONTRACT_HASH]" 1' +Node is bootstrapped. +Estimated gas: 5793.484 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000888 + Expected counter: 4 + Gas limit: 5894 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000888 + payload fees(the block proposer) ....... +ꜩ0.000888 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[CONTRACT_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 3040.897 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Updated storage: Unit + Storage size: 51 bytes + Consumed gas: 2753.748 + diff --git a/tezt/tests/expected/tickets.ml/Mumbai- Sending zero ticket from implicit accounts must be rejected.out b/tezt/tests/expected/tickets.ml/Mumbai- Sending zero ticket from implicit accounts must be rejected.out new file mode 100644 index 000000000000..131ddb8912f9 --- /dev/null +++ b/tezt/tests/expected/tickets.ml/Mumbai- Sending zero ticket from implicit accounts must be rejected.out @@ -0,0 +1,174 @@ + +./octez-client --mode mockup --wait none originate contract tickets_send transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_send_016.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1441.228 units (will add 100 for safety) +Estimated storage: 415 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00054 + Expected counter: 1 + Gas limit: 1542 + Storage limit: 435 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00054 + payload fees(the block proposer) ....... +ꜩ0.00054 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (pair address nat) ; + storage unit ; + code { CAR ; + UNPAIR ; + CONTRACT (ticket string) ; + IF_NONE + { PUSH string "Contract not found" ; FAILWITH } + { PUSH mutez 0 ; + DIG 2 ; + PUSH string "Ticket" ; + TICKET ; + ASSERT_SOME ; + TRANSFER_TOKENS ; + PUSH unit Unit ; + NIL operation ; + DIG 2 ; + CONS ; + PAIR } } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 158 bytes + Paid storage size diff: 158 bytes + Consumed gas: 1441.228 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0395 + storage fees ........................... +ꜩ0.0395 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_send. + +./octez-client --mode mockup --wait none transfer 0 from bootstrap1 to '[CONTRACT_HASH]' --burn-cap 1 --arg 'Pair "[PUBLIC_KEY_HASH]" 1' +Node is bootstrapped. +Estimated gas: 3588.163 units (will add 100 for safety) +Estimated storage: 66 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000667 + Expected counter: 2 + Gas limit: 3689 + Storage limit: 86 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000667 + payload fees(the block proposer) ....... +ꜩ0.000667 + Transaction: + Amount: ꜩ0 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + Parameter: (Pair "[PUBLIC_KEY_HASH]" 1) + This transaction was successfully applied + Updated storage: Unit + Storage size: 158 bytes + Paid storage size diff: 66 bytes + Consumed gas: 2588.410 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0165 + storage fees ........................... +ꜩ0.0165 + Internal operations: + Internal Transaction: + Amount: ꜩ0 + From: [CONTRACT_HASH] + To: [PUBLIC_KEY_HASH] + Parameter: (Pair 0x013c68b1807d42e2e2cb5a4dddb457b75dbf4a4dce00 (Pair "Ticket" 1)) + This transaction was successfully applied + Consumed gas: 1000.398 + Ticket updates: + Ticketer: [CONTRACT_HASH] + Content type: string + Content: "Ticket" + Account updates: + [PUBLIC_KEY_HASH] ... +1 + + +./octez-client --mode mockup get ticket balance for bootstrap1 with ticketer '[CONTRACT_HASH]' and type string and content '"Ticket"' +1 + +./octez-client --mode mockup --wait none originate contract tickets_bag transferring 0 from bootstrap1 running michelson_test_scripts/mini_scenarios/tickets_bag_016.tz --init '{}' --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1446.306 units (will add 100 for safety) +Estimated storage: 451 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000576 + Expected counter: 3 + Gas limit: 1547 + Storage limit: 471 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000576 + payload fees(the block proposer) ....... +ꜩ0.000576 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ0 + Script: + { parameter (or (ticket %save string) (address %send)) ; + storage (list (ticket string)) ; + code { UNPAIR ; + IF_LEFT + { CONS ; NIL operation ; PAIR } + { SWAP ; + IF_CONS + { DIG 2 ; + CONTRACT %ticket (ticket string) ; + ASSERT_SOME ; + PUSH mutez 0 ; + DIG 2 ; + TRANSFER_TOKENS ; + NIL operation ; + SWAP ; + CONS ; + PAIR } + { PUSH string "no ticket to send" ; FAILWITH } } } } + Initial storage: {} + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 194 bytes + Paid storage size diff: 194 bytes + Consumed gas: 1446.306 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0485 + storage fees ........................... +ꜩ0.0485 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + +New contract [CONTRACT_HASH] originated. +Contract memorized as tickets_bag. + +./octez-client --mode mockup --wait none transfer 0 tickets from bootstrap1 to '[CONTRACT_HASH]' with entrypoint save and contents '"Ticket"' and type string and ticketer '[CONTRACT_HASH]' --burn-cap 1 +Fatal error: + ticket quantity should not be zero or negative diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out new file mode 100644 index 000000000000..b65fac2e5a4f --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out @@ -0,0 +1,132 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' +Node is bootstrapped. +Estimated gas: 3694.500 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000697 + Expected counter: 3 + Gas limit: 3795 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000697 + payload fees(the block proposer) ....... +ꜩ0.000697 + Transaction rollup commitment: + Address: [TX_ROLLUP_HASH] + Commitment: + Level: 0 + Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] + Predecessor: None + Inbox merkle root: [TX_ROLLUP_INBOX_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 + Consumed gas: 3694.500 + + +./octez-client --wait none reject commitment of tx rollup '[TX_ROLLUP_HASH]' at level 0 with result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' and result path '[ + "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]" +]' for message at position 0 with content '{"batch":"6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262"}' and path '[ + "[TX_ROLLUP_INBOX_HASH]" +]' with agreed context hash '[CONTEXT_HASH]' and withdraw list hash txw1sFoLju3ySMAdY6v1dcHUMqJ4Zxc1kcynC8xkYgCmH6bpNSDhV and result path '[]' using proof '{ "version": 3, + "before": { "node": "[CONTEXT_HASH]" }, + "after": { "node": "[CONTEXT_HASH]" } , + "state": [] }' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 52116.302 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.010724 + Expected counter: 4 + Gas limit: 52217 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.010724 + payload fees(the block proposer) ....... +ꜩ0.010724 + Transaction rollup rejection: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment rejection was successfully applied + Balance updates: + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... -ꜩ10000 + tx rollup rejection punishments ............................................................ +ꜩ10000 + tx rollup rejection rewards ................................................................ -ꜩ5000 + [PUBLIC_KEY_HASH] ....................................................... +ꜩ5000 + Consumed gas: 52116.302 + diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out new file mode 100644 index 000000000000..f46b34639302 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out @@ -0,0 +1,39 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' +{ "last_removed_commitment_hashes": null, + "finalized_commitments": { "next": 0 }, + "unfinalized_commitments": { "next": 0 }, + "uncommitted_inboxes": { "next": 0 }, "commitment_newest_hash": null, + "tezos_head_level": null, "burn_per_byte": "0", + "allocated_storage": "4000", "occupied_storage": "0", "inbox_ema": 0, + "commitments_watermark": null } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out new file mode 100644 index 000000000000..8b4f0b5a9baf --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out @@ -0,0 +1,59 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2232.850 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000739 + Expected counter: 2 + Gas limit: 2333 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000739 + payload fees(the block proposer) ....... +ꜩ0.000739 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 256 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2232.850 + +"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out new file mode 100644 index 000000000000..765e8bb93805 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out @@ -0,0 +1,235 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' +Node is bootstrapped. +Estimated gas: 3694.500 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000697 + Expected counter: 3 + Gas limit: 3795 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000697 + payload fees(the block proposer) ....... +ꜩ0.000697 + Transaction rollup commitment: + Address: [TX_ROLLUP_HASH] + Commitment: + Level: 0 + Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] + Predecessor: None + Inbox merkle root: [TX_ROLLUP_INBOX_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 + Consumed gas: 3694.500 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' +{ "commitment": + { "level": 0, + "messages": + { "count": 1, + "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", + "last_message_result_hash": + "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, + "predecessor": null, + "inbox_merkle_root": + "[TX_ROLLUP_INBOX_HASH]" }, + "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", + "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' +{ "last_removed_commitment_hashes": null, + "finalized_commitments": { "next": 0 }, + "unfinalized_commitments": { "newest": 0, "oldest": 0 }, + "uncommitted_inboxes": { "next": 1 }, + "commitment_newest_hash": + "[TX_ROLLUP_COMMITMENT_HASH]", + "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", + "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 4 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", + "description": "There is no commitment to finalize", "data": {} } + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2501.420 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000505 + Expected counter: 4 + Gas limit: 2602 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000505 + payload fees(the block proposer) ....... +ꜩ0.000505 + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment finalization was successfully applied + Consumed gas: 2501.420@finalized level: + 0 + + +./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 1 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup remove commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_remove_commitment_too_early", + "description": + "It's too early to try to remove the oldest final commitment", + "data": {} } + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' +{ "last_removed_commitment_hashes": null, + "finalized_commitments": { "newest": 0, "oldest": 0 }, + "unfinalized_commitments": { "next": 1 }, + "uncommitted_inboxes": { "next": 1 }, + "commitment_newest_hash": + "[TX_ROLLUP_COMMITMENT_HASH]", + "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", + "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } + +./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 3171.024 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000572 + Expected counter: 1 + Gas limit: 3272 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000572 + payload fees(the block proposer) ....... +ꜩ0.000572 + Transaction rollup remove commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment removal was successfully applied + Consumed gas: 3171.024@finalized level: + 0 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' +{ "last_removed_commitment_hashes": + { "last_message_hash": + "[TX_ROLLUP_MESSAGE_RESULT_HASH]", + "commitment_hash": + "[TX_ROLLUP_COMMITMENT_HASH]" }, + "finalized_commitments": { "next": 1 }, + "unfinalized_commitments": { "next": 1 }, + "uncommitted_inboxes": { "next": 1 }, + "commitment_newest_hash": + "[TX_ROLLUP_COMMITMENT_HASH]", + "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", + "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out new file mode 100644 index 000000000000..a215b10d1cf9 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out @@ -0,0 +1,117 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' +Node is bootstrapped. +Estimated gas: 3694.500 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000697 + Expected counter: 3 + Gas limit: 3795 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000697 + payload fees(the block proposer) ....... +ꜩ0.000697 + Transaction rollup commitment: + Address: [TX_ROLLUP_HASH] + Commitment: + Level: 0 + Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] + Predecessor: None + Inbox merkle root: [TX_ROLLUP_INBOX_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 + Consumed gas: 3694.500 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' +{ "commitment": + { "level": 0, + "messages": + { "count": 1, + "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", + "last_message_result_hash": + "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, + "predecessor": null, + "inbox_merkle_root": + "[TX_ROLLUP_INBOX_HASH]" }, + "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", + "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' +{ "last_removed_commitment_hashes": null, + "finalized_commitments": { "next": 0 }, + "unfinalized_commitments": { "newest": 0, "oldest": 0 }, + "uncommitted_inboxes": { "next": 1 }, + "commitment_newest_hash": + "[TX_ROLLUP_COMMITMENT_HASH]", + "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", + "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out new file mode 100644 index 000000000000..258c59e3b6ba --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out @@ -0,0 +1,22 @@ + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "626c6f62" + } +}' + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "676c6f756269626f756c6761" + } +}' +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_hash with '{ + "message_hashes": [ + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]" + ] +}' +{ "hash": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out new file mode 100644 index 000000000000..38f5e76b895a --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out @@ -0,0 +1,67 @@ + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "4b6f75726f756b6f756b6f75" + } +}' + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "726f756b6f756b6f75" + } +}' + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "7374616368" + } +}' + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "7374616368" + } +}' +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ + "message_hashes": [ + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]" + ], + "position": 3 +}' +{ "path": + [ "[TX_ROLLUP_INBOX_HASH]", + "[TX_ROLLUP_INBOX_HASH]" ] } + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ + "message_hashes": [ + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]" + ], + "position": 0 +}' +{ "path": + [ "[TX_ROLLUP_INBOX_HASH]", + "[TX_ROLLUP_INBOX_HASH]" ] } + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ + "message_hashes": [ + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]", + "[TX_ROLLUP_MESSAGE_HASH]" + ], + "position": 4 +}' +Fatal error: + Command failed: Merkle_list_invalid_position + diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out new file mode 100644 index 000000000000..8c70d644a87c --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out @@ -0,0 +1,7 @@ + +./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ + "message": { + "batch": "626c6f62" + } +}' +{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out new file mode 100644 index 000000000000..4c803666a8f8 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out @@ -0,0 +1,62 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' +{ "inbox_length": 1, "cumulated_size": 4, + "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out new file mode 100644 index 000000000000..dbc2f5e129d2 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out @@ -0,0 +1,99 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' +Node is bootstrapped. +Estimated gas: 3694.500 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000697 + Expected counter: 3 + Gas limit: 3795 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000697 + payload fees(the block proposer) ....... +ꜩ0.000697 + Transaction rollup commitment: + Address: [TX_ROLLUP_HASH] + Commitment: + Level: 0 + Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] + Predecessor: None + Inbox merkle root: [TX_ROLLUP_INBOX_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 + Consumed gas: 3694.500 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' +1 + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' +0 diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out new file mode 100644 index 000000000000..85195a31084a --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out @@ -0,0 +1,36 @@ + +./octez-client --wait none submit tx rollup batch 0x to 'this is an invalid tx rollup address' from '[PUBLIC_KEY_HASH]' +Error: + Erroneous command line argument 7 (this is an invalid tx rollup address). + Parameter 'this is an invalid tx rollup address' is an invalid transaction rollup address encoded in a base58 string. + +Usage: + octez-client [global options] command [command options] + octez-client --help (for global options) + octez-client [global options] command --help (for command options) + octez-client --version (for version information) + +To browse the documentation: + octez-client [global options] man (for a list of commands) + octez-client [global options] man -v 3 (for the full manual) + +Global options (must come before the command): + -d --base-dir <path>: client data directory (absent: TEZOS_CLIENT_DIR env) + -n --no-base-dir-warnings: silence warnings about client data directory + -c --config-file <path>: configuration file + -t --timings: show RPC request times + --chain <hash|tag>: chain on which to apply contextual commands (commands dependent on the context associated with the specified chain). Possible tags are 'main' and 'test'. + -b --block <hash|level|tag>: block on which to apply contextual commands (commands dependent on the context associated with the specified block). Possible tags include 'head' and 'genesis' +/- an optional offset (e.g. "octez-client -b head-1 get timestamp"). Note that block queried must exist in node's storage. + -w --wait <none|<int>>: how many confirmation blocks are needed before an operation is considered included + -p --protocol <hash>: use commands of a specific protocol + -l --log-requests: log all requests to the node + --better-errors: Error reporting is more detailed. Can be used if a call to an RPC fails or if you don't know the input accepted by the RPC. It may happen that the RPC calls take more time however. + -A --addr <IP addr|host>: [DEPRECATED: use --endpoint instead] IP address of the node + -P --port <number>: [DEPRECATED: use --endpoint instead] RPC port of the node + -S --tls: [DEPRECATED: use --endpoint instead] use TLS to connect to node. + -m --media-type <json, binary, any or default>: Sets the "media-type" value for the "accept" header for RPC requests to the node. The media accept header indicates to the node which format of data serialisation is supported. Use the value "json" for serialisation to the JSON format. + -E --endpoint <uri>: HTTP(S) endpoint of the node RPC interface; e.g. 'http://localhost:8732' + -s --sources <path>: path to JSON file containing sources for --mode light. Example file content: {"min_agreement": 1.0, "uris": ["http://localhost:8732", "https://localhost:8733"]} + -R --remote-signer <uri>: URI of the remote signer + -f --password-filename <filename>: path to the password filename + -M --mode <client|light|mockup|proxy>: how to interact with the node diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out new file mode 100644 index 000000000000..430beed302fa --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out @@ -0,0 +1,76 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 3 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", + "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out new file mode 100644 index 000000000000..73c7f7dc1a93 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out @@ -0,0 +1,48 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 2 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", + "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out new file mode 100644 index 000000000000..430beed302fa --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out @@ -0,0 +1,76 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 3 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", + "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out new file mode 100644 index 000000000000..6e2f5c7c1a60 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out @@ -0,0 +1,58 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2104.274 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00047 + Expected counter: 2 + Gas limit: 2205 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00047 + payload fees(the block proposer) ....... +ꜩ0.00047 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 0 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2104.274 + diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out new file mode 100644 index 000000000000..beaaff4f9793 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out @@ -0,0 +1,66 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Error: + { "id": "proto.016-PtMumbai.tx_rollup_message_size_exceeds_limit", + "description": + "A message submitted to a transaction rollup inbox exceeds limit", + "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out new file mode 100644 index 000000000000..3d51a630b097 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out @@ -0,0 +1,4259 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap1 +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap2 +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 1 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap3 +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 1 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap4 +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 1 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap5 +Node is bootstrapped. +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005721 + Expected counter: 1 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005721 + payload fees(the block proposer) ....... +ꜩ0.005721 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap6 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap7 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap8 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap9 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap10 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap11 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap12 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap13 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap14 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap15 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap16 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap17 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap18 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap19 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap20 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap21 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap22 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap23 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap24 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap25 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap26 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap27 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap28 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap29 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap30 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap31 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap32 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap33 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap34 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap35 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap36 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap37 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap38 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap39 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap40 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap41 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap42 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap43 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap44 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap45 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap46 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap47 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap48 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap49 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap50 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap51 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap52 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap53 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap54 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap55 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap56 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap57 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap58 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap59 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap60 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap61 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap62 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap63 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap64 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap65 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap66 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap67 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap68 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap69 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap70 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap71 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap72 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap73 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap74 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap75 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap76 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap77 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap78 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap79 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap80 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap81 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap82 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap83 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap84 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap85 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap86 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap87 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap88 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap89 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap90 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap91 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap92 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap93 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap94 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap95 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap96 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap97 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap98 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap99 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap100 +Node is bootstrapped. +Estimated storage: no bytes added +Estimated gas: 4615.524 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000357 + Expected counter: 1 + Gas limit: 1000 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000357 + payload fees(the block proposer) ....... +ꜩ0.000357 + Revelation of manager public key: + Contract: [PUBLIC_KEY_HASH] + Key: [PUBLIC_KEY] + This revelation was successfully applied + Consumed gas: 1000 + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.005625 + Expected counter: 2 + Gas limit: 4716 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.005625 + payload fees(the block proposer) ....... +ꜩ0.005625 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 5000 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 4615.524 + + +./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' +{ "inbox_length": 100, "cumulated_size": 500000, + "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out new file mode 100644 index 000000000000..0a5ff8a90ec5 --- /dev/null +++ b/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out @@ -0,0 +1,111 @@ + +./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 +Node is bootstrapped. +Estimated gas: 1420.108 units (will add 100 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000379 + Expected counter: 1 + Gas limit: 1521 + Storage limit: 60000 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000379 + payload fees(the block proposer) ....... +ꜩ0.000379 + Transaction rollup origination: + From: [PUBLIC_KEY_HASH] + This transaction rollup origination was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + storage fees ........................... +ꜩ1 + Consumed gas: 1420.108 + Originated tx rollup: [TX_ROLLUP_HASH] + +Transaction rollup memorized as tx_rollup + +./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +Estimated gas: 2108.283 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000474 + Expected counter: 2 + Gas limit: 2209 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000474 + payload fees(the block proposer) ....... +ꜩ0.000474 + Transaction rollup transaction: + Address:[TX_ROLLUP_HASH] + Message length: 4 bytes + From: [PUBLIC_KEY_HASH] + This transaction rollup batch submission was successfully applied + Consumed gas: 2108.283 + + +./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' +Node is bootstrapped. +Estimated gas: 3694.500 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000697 + Expected counter: 3 + Gas limit: 3795 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000697 + payload fees(the block proposer) ....... +ꜩ0.000697 + Transaction rollup commitment: + Address: [TX_ROLLUP_HASH] + Commitment: + Level: 0 + Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] + Predecessor: None + Inbox merkle root: [TX_ROLLUP_INBOX_HASH] + From: [PUBLIC_KEY_HASH] + This transaction rollup commitment was successfully applied + Balance updates: + [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 + Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 + Consumed gas: 3694.500 + + +./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' +Node is bootstrapped. +This simulation failed: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0 + Expected counter: 4 + Gas limit: 1040000 + Storage limit: 60000 bytes + Transaction rollup finalize commitment: + Address: [TX_ROLLUP_HASH] + From: [PUBLIC_KEY_HASH] + This operation FAILED. + +Error: + { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", + "description": "There is no commitment to finalize", "data": {} } -- GitLab From 797f05bdcdaff5e9bfcb467aac32395e9904224f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Wed, 7 Dec 2022 18:04:42 +0000 Subject: [PATCH 12/18] Doc: rename Alpha to Mumbai --- docs/protocols/016_mumbai.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/protocols/016_mumbai.rst b/docs/protocols/016_mumbai.rst index 03d19535a3dc..ea36afcf9bea 100644 --- a/docs/protocols/016_mumbai.rst +++ b/docs/protocols/016_mumbai.rst @@ -1,7 +1,7 @@ -Protocol Alpha -============== +Protocol Mumbai +=============== -This page documents the changes brought by protocol Alpha with respect +This page documents the changes brought by protocol Mumbai with respect to Lima (see :ref:`naming_convention`). The code can be found in directory :src:`src/proto_016_PtMumbai` of the ``master`` -- GitLab From b2efdec735bfa2b1941579867e50fcce8e976d8b Mon Sep 17 00:00:00 2001 From: Thomas Letan <lthms@nomadic-labs.com> Date: Thu, 8 Dec 2022 12:05:37 +0100 Subject: [PATCH 13/18] Tx_rollup: Do not build TORU binaries for Mumbai and Alpha --- .gitlab/ci/jobs/packaging/opam_package.yml | 61 +- dune-project | 4 - manifest/main.ml | 4 +- opam/octez-tx-rollup-client-PtMumbai.opam | 26 - opam/octez-tx-rollup-client-alpha.opam | 26 - opam/octez-tx-rollup-node-PtMumbai.opam | 25 - opam/octez-tx-rollup-node-alpha.opam | 25 - script-inputs/experimental-executables | 2 - script-inputs/released-executables | 2 - .../bin_tx_rollup_client/dune | 32 - .../bin_tx_rollup_node/dune | 29 - src/proto_alpha/bin_tx_rollup_client/dune | 32 - src/proto_alpha/bin_tx_rollup_node/dune | 29 - ...PC (tx_rollup- regression) - rejection.out | 132 - ...a- RPC (tx_rollup- regression) - state.out | 39 - ..._rollups- regression) - batch encoding.out | 59 - ...llups- regression) - commitment remove.out | 235 - ... (tx_rollups- regression) - commitment.out | 117 - ...- regression) - inbox merkle tree hash.out | 22 - ...- regression) - inbox merkle tree path.out | 67 - ...lups- regression) - inbox message hash.out | 7 - ...- RPC (tx_rollups- regression) - inbox.out | 62 - ...gression) - pending bonded commitments.out | 99 - ... an invalid rollup address should fail.out | 36 - ...eration for a commitment in the future.out | 76 - ...ize commitment operation without batch.out | 48 - ...ommitment operation without commitment.out | 76 - .../Alpha- Submit empty batch.out | 58 - .../Alpha- Submit maximum size batch.out | 66 - .../Alpha- Submit maximum size inbox.out | 4259 ----------------- ...ry to finalize a too recent commitment.out | 111 - ...PC (tx_rollup- regression) - rejection.out | 132 - ...i- RPC (tx_rollup- regression) - state.out | 39 - ..._rollups- regression) - batch encoding.out | 59 - ...llups- regression) - commitment remove.out | 235 - ... (tx_rollups- regression) - commitment.out | 117 - ...- regression) - inbox merkle tree hash.out | 22 - ...- regression) - inbox merkle tree path.out | 67 - ...lups- regression) - inbox message hash.out | 7 - ...- RPC (tx_rollups- regression) - inbox.out | 62 - ...gression) - pending bonded commitments.out | 99 - ... an invalid rollup address should fail.out | 36 - ...eration for a commitment in the future.out | 76 - ...ize commitment operation without batch.out | 48 - ...ommitment operation without commitment.out | 76 - .../Mumbai- Submit empty batch.out | 58 - .../Mumbai- Submit maximum size batch.out | 66 - .../Mumbai- Submit maximum size inbox.out | 4259 ----------------- ...ry to finalize a too recent commitment.out | 111 - tezt/tests/main.ml | 4 +- tezt/tests/tx_rollup_l2_node.ml | 4 +- 51 files changed, 26 insertions(+), 11417 deletions(-) delete mode 100644 opam/octez-tx-rollup-client-PtMumbai.opam delete mode 100644 opam/octez-tx-rollup-client-alpha.opam delete mode 100644 opam/octez-tx-rollup-node-PtMumbai.opam delete mode 100644 opam/octez-tx-rollup-node-alpha.opam delete mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_client/dune delete mode 100644 src/proto_016_PtMumbai/bin_tx_rollup_node/dune delete mode 100644 src/proto_alpha/bin_tx_rollup_client/dune delete mode 100644 src/proto_alpha/bin_tx_rollup_node/dune delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - rejection.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - state.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - batch encoding.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment remove.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree hash.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree path.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox message hash.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - pending bonded commitments.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit a batch to an invalid rollup address should fail.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation for a commitment in the future.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without commitment.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit empty batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size inbox.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Alpha- Try to finalize a too recent commitment.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out delete mode 100644 tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out diff --git a/.gitlab/ci/jobs/packaging/opam_package.yml b/.gitlab/ci/jobs/packaging/opam_package.yml index b298cdc88166..ab61123e8c0b 100644 --- a/.gitlab/ci/jobs/packaging/opam_package.yml +++ b/.gitlab/ci/jobs/packaging/opam_package.yml @@ -285,7 +285,7 @@ opam:octez-protocol-compiler: opam:octez-proxy-server: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_1 variables: package: octez-proxy-server @@ -330,15 +330,6 @@ opam:octez-tx-rollup-client-PtLimaPt: variables: package: octez-tx-rollup-client-PtLimaPt -opam:octez-tx-rollup-client-PtMumbai: - extends: - - .opam_template - - .rules_template__trigger_opam_batch_1 - variables: - package: octez-tx-rollup-client-PtMumbai - -# Ignoring unreleased package octez-tx-rollup-client-alpha. - opam:octez-tx-rollup-node-PtKathma: extends: - .opam_template @@ -353,15 +344,6 @@ opam:octez-tx-rollup-node-PtLimaPt: variables: package: octez-tx-rollup-node-PtLimaPt -opam:octez-tx-rollup-node-PtMumbai: - extends: - - .opam_template - - .rules_template__trigger_opam_batch_1 - variables: - package: octez-tx-rollup-node-PtMumbai - -# Ignoring unreleased package octez-tx-rollup-node-alpha. - # Ignoring unreleased package octez-wasm-repl. # Ignoring unreleased package tezos-014-PtKathma-test-helpers. @@ -375,7 +357,7 @@ opam:octez-tx-rollup-node-PtMumbai: opam:tezos-baking-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_1 variables: package: tezos-baking-014-PtKathma @@ -389,7 +371,7 @@ opam:tezos-baking-014-PtKathma-commands: opam:tezos-baking-015-PtLimaPt: extends: - .opam_template - - .rules_template__trigger_opam_batch_2 + - .rules_template__trigger_opam_batch_1 variables: package: tezos-baking-015-PtLimaPt @@ -438,7 +420,7 @@ opam:tezos-base: opam:tezos-base-test-helpers: extends: - .opam_template - - .rules_template__trigger_opam_batch_7 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-base-test-helpers @@ -682,7 +664,7 @@ opam:tezos-dal-node-lib: opam:tezos-dal-node-services: extends: - .opam_template - - .rules_template__trigger_opam_batch_7 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-dal-node-services @@ -724,21 +706,21 @@ opam:tezos-embedded-protocol-004-Pt24m4xi: opam:tezos-embedded-protocol-005-PsBABY5H: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-embedded-protocol-005-PsBABY5H opam:tezos-embedded-protocol-005-PsBabyM1: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-embedded-protocol-005-PsBabyM1 opam:tezos-embedded-protocol-006-PsCARTHA: extends: - .opam_template - - .rules_template__trigger_opam_batch_4 + - .rules_template__trigger_opam_batch_3 variables: package: tezos-embedded-protocol-006-PsCARTHA @@ -983,7 +965,7 @@ opam:tezos-p2p: opam:tezos-p2p-services: extends: - .opam_template - - .rules_template__trigger_opam_batch_7 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-p2p-services @@ -1088,21 +1070,21 @@ opam:tezos-protocol-011-PtHangz2: opam:tezos-protocol-012-Psithaca: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-012-Psithaca opam:tezos-protocol-013-PtJakart: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-013-PtJakart opam:tezos-protocol-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_5 variables: package: tezos-protocol-014-PtKathma @@ -1236,7 +1218,7 @@ opam:tezos-protocol-plugin-011-PtHangz2-registerer: opam:tezos-protocol-plugin-012-Psithaca: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-protocol-plugin-012-Psithaca @@ -1250,7 +1232,7 @@ opam:tezos-protocol-plugin-012-Psithaca-registerer: opam:tezos-protocol-plugin-013-PtJakart: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-protocol-plugin-013-PtJakart @@ -1264,14 +1246,14 @@ opam:tezos-protocol-plugin-013-PtJakart-registerer: opam:tezos-protocol-plugin-014-PtKathma: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_4 variables: package: tezos-protocol-plugin-014-PtKathma opam:tezos-protocol-plugin-014-PtKathma-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-protocol-plugin-014-PtKathma-registerer @@ -1287,7 +1269,7 @@ opam:tezos-protocol-plugin-015-PtLimaPt: opam:tezos-protocol-plugin-015-PtLimaPt-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-protocol-plugin-015-PtLimaPt-registerer @@ -1303,7 +1285,7 @@ opam:tezos-protocol-plugin-016-PtMumbai: opam:tezos-protocol-plugin-016-PtMumbai-registerer: extends: - .opam_template - - .rules_template__trigger_opam_batch_3 + - .rules_template__trigger_opam_batch_2 variables: package: tezos-protocol-plugin-016-PtMumbai-registerer @@ -1532,12 +1514,7 @@ opam:tezos-tx-rollup-015-PtLimaPt: variables: package: tezos-tx-rollup-015-PtLimaPt -opam:tezos-tx-rollup-016-PtMumbai: - extends: - - .opam_template - - .rules_template__trigger_opam_batch_1 - variables: - package: tezos-tx-rollup-016-PtMumbai +# Ignoring unreleased package tezos-tx-rollup-016-PtMumbai. # Ignoring unreleased package tezos-tx-rollup-alpha. diff --git a/dune-project b/dune-project index 374729252c1d..3800ebcee03c 100644 --- a/dune-project +++ b/dune-project @@ -26,12 +26,8 @@ (package (name octez-snoop)) (package (name octez-tx-rollup-client-PtKathma)) (package (name octez-tx-rollup-client-PtLimaPt)) -(package (name octez-tx-rollup-client-PtMumbai)) -(package (name octez-tx-rollup-client-alpha)) (package (name octez-tx-rollup-node-PtKathma)) (package (name octez-tx-rollup-node-PtLimaPt)) -(package (name octez-tx-rollup-node-PtMumbai)) -(package (name octez-tx-rollup-node-alpha)) (package (name octez-wasm-repl)) (package (name tezos-014-PtKathma-test-helpers)) (package (name tezos-015-PtLimaPt-test-helpers)) diff --git a/manifest/main.ml b/manifest/main.ml index 9a1ff5c87f9a..cf43b6bbd230 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4983,7 +4983,7 @@ module Protocol = Protocol ~linkall:true in let _tx_rollup_client = - only_if (active && N.(number >= 013)) @@ fun () -> + only_if (active && N.(number >= 013 && number <= 015)) @@ fun () -> public_exe (sf "octez-tx-rollup-client-%s" short_hash) ~internal_name:(sf "main_tx_rollup_client_%s" name_underscore) @@ -5005,7 +5005,7 @@ module Protocol = Protocol ] in let _tx_rollup_node = - only_if (active && N.(number >= 013)) @@ fun () -> + only_if (active && N.(number >= 013 && number <= 015)) @@ fun () -> public_exe (sf "octez-tx-rollup-node-%s" short_hash) ~internal_name:(sf "main_tx_rollup_node_%s" name_underscore) diff --git a/opam/octez-tx-rollup-client-PtMumbai.opam b/opam/octez-tx-rollup-client-PtMumbai.opam deleted file mode 100644 index 508c463f6e2f..000000000000 --- a/opam/octez-tx-rollup-client-PtMumbai.opam +++ /dev/null @@ -1,26 +0,0 @@ -# This file was automatically generated, do not edit. -# Edit file manifest/main.ml instead. -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: ["Tezos devteam"] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "dune" { >= "3.0" } - "tezos-base" - "tezos-clic" - "tezos-protocol-016-PtMumbai" - "tezos-client-016-PtMumbai" - "tezos-client-base-unix" - "tezos-stdlib-unix" - "tezos-tx-rollup-016-PtMumbai" - "uri" { >= "2.2.0" } -] -build: [ - ["rm" "-r" "vendors"] - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -synopsis: "Tezos/Protocol: `octez-tx-rollup-client-alpha` client binary" diff --git a/opam/octez-tx-rollup-client-alpha.opam b/opam/octez-tx-rollup-client-alpha.opam deleted file mode 100644 index 9cc4f4d8fb1b..000000000000 --- a/opam/octez-tx-rollup-client-alpha.opam +++ /dev/null @@ -1,26 +0,0 @@ -# This file was automatically generated, do not edit. -# Edit file manifest/main.ml instead. -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: ["Tezos devteam"] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "dune" { >= "3.0" } - "tezos-base" - "tezos-clic" - "tezos-protocol-alpha" - "tezos-client-alpha" - "tezos-client-base-unix" - "tezos-stdlib-unix" - "tezos-tx-rollup-alpha" - "uri" { >= "2.2.0" } -] -build: [ - ["rm" "-r" "vendors"] - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -synopsis: "Tezos/Protocol: `octez-tx-rollup-client-alpha` client binary" diff --git a/opam/octez-tx-rollup-node-PtMumbai.opam b/opam/octez-tx-rollup-node-PtMumbai.opam deleted file mode 100644 index 479d95f429f1..000000000000 --- a/opam/octez-tx-rollup-node-PtMumbai.opam +++ /dev/null @@ -1,25 +0,0 @@ -# This file was automatically generated, do not edit. -# Edit file manifest/main.ml instead. -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: ["Tezos devteam"] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "dune" { >= "3.0" } - "tezos-base" - "tezos-clic" - "tezos-protocol-016-PtMumbai" - "tezos-client-016-PtMumbai" - "tezos-client-base" - "tezos-client-base-unix" - "tezos-tx-rollup-016-PtMumbai" -] -build: [ - ["rm" "-r" "vendors"] - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -synopsis: "Tezos/Protocol: Transaction Rollup node binary" diff --git a/opam/octez-tx-rollup-node-alpha.opam b/opam/octez-tx-rollup-node-alpha.opam deleted file mode 100644 index 0f7f393bb9cb..000000000000 --- a/opam/octez-tx-rollup-node-alpha.opam +++ /dev/null @@ -1,25 +0,0 @@ -# This file was automatically generated, do not edit. -# Edit file manifest/main.ml instead. -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: ["Tezos devteam"] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "dune" { >= "3.0" } - "tezos-base" - "tezos-clic" - "tezos-protocol-alpha" - "tezos-client-alpha" - "tezos-client-base" - "tezos-client-base-unix" - "tezos-tx-rollup-alpha" -] -build: [ - ["rm" "-r" "vendors"] - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -synopsis: "Tezos/Protocol: Transaction Rollup node binary" diff --git a/script-inputs/experimental-executables b/script-inputs/experimental-executables index 5fef88016180..e884e4ebd993 100644 --- a/script-inputs/experimental-executables +++ b/script-inputs/experimental-executables @@ -1,6 +1,4 @@ octez-dal-node -octez-tx-rollup-node-alpha -octez-tx-rollup-client-alpha octez-wasm-repl-alpha octez-sc-rollup-node-alpha octez-sc-rollup-client-alpha diff --git a/script-inputs/released-executables b/script-inputs/released-executables index ee414a742048..ede1902a87f2 100644 --- a/script-inputs/released-executables +++ b/script-inputs/released-executables @@ -4,8 +4,6 @@ octez-codec octez-client octez-admin-client octez-node -octez-tx-rollup-node-PtMumbai -octez-tx-rollup-client-PtMumbai octez-sc-rollup-node-PtMumbai octez-sc-rollup-client-PtMumbai octez-accuser-PtMumbai diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_client/dune b/src/proto_016_PtMumbai/bin_tx_rollup_client/dune deleted file mode 100644 index 6cf7e64cdba7..000000000000 --- a/src/proto_016_PtMumbai/bin_tx_rollup_client/dune +++ /dev/null @@ -1,32 +0,0 @@ -; This file was automatically generated, do not edit. -; Edit file manifest/main.ml instead. - -(executable - (name main_tx_rollup_client_016_PtMumbai) - (public_name octez-tx-rollup-client-PtMumbai) - (package octez-tx-rollup-client-PtMumbai) - (instrumentation (backend bisect_ppx)) - (libraries - tezos-base - tezos-clic - tezos-protocol-016-PtMumbai - tezos-client-016-PtMumbai - tezos-client-016-PtMumbai.commands - tezos-client-base-unix - tezos-stdlib-unix - tezos-tx-rollup-016-PtMumbai - uri) - (link_flags - (:standard) - (:include %{workspace_root}/static-link-flags.sexp)) - (flags - (:standard) - -open Tezos_base.TzPervasives - -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_016_PtMumbai - -open Tezos_protocol_016_PtMumbai.Protocol - -open Tezos_client_016_PtMumbai - -open Tezos_client_016_PtMumbai_commands - -open Tezos_client_base_unix - -open Tezos_stdlib_unix - -open Tezos_tx_rollup_016_PtMumbai)) diff --git a/src/proto_016_PtMumbai/bin_tx_rollup_node/dune b/src/proto_016_PtMumbai/bin_tx_rollup_node/dune deleted file mode 100644 index 26e8f1286236..000000000000 --- a/src/proto_016_PtMumbai/bin_tx_rollup_node/dune +++ /dev/null @@ -1,29 +0,0 @@ -; This file was automatically generated, do not edit. -; Edit file manifest/main.ml instead. - -(executable - (name main_tx_rollup_node_016_PtMumbai) - (public_name octez-tx-rollup-node-PtMumbai) - (package octez-tx-rollup-node-PtMumbai) - (instrumentation (backend bisect_ppx)) - (libraries - tezos-base - tezos-clic - tezos-protocol-016-PtMumbai - tezos-client-016-PtMumbai - tezos-client-base - tezos-client-base-unix - tezos-tx-rollup-016-PtMumbai) - (link_flags - (:standard) - (:include %{workspace_root}/static-link-flags.sexp)) - (flags - (:standard) - -open Tezos_base.TzPervasives - -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_base - -open Tezos_protocol_016_PtMumbai - -open Tezos_client_016_PtMumbai - -open Tezos_client_base - -open Tezos_client_base_unix - -open Tezos_tx_rollup_016_PtMumbai)) diff --git a/src/proto_alpha/bin_tx_rollup_client/dune b/src/proto_alpha/bin_tx_rollup_client/dune deleted file mode 100644 index 9389a79136e2..000000000000 --- a/src/proto_alpha/bin_tx_rollup_client/dune +++ /dev/null @@ -1,32 +0,0 @@ -; This file was automatically generated, do not edit. -; Edit file manifest/main.ml instead. - -(executable - (name main_tx_rollup_client_alpha) - (public_name octez-tx-rollup-client-alpha) - (package octez-tx-rollup-client-alpha) - (instrumentation (backend bisect_ppx)) - (libraries - tezos-base - tezos-clic - tezos-protocol-alpha - tezos-client-alpha - tezos-client-alpha.commands - tezos-client-base-unix - tezos-stdlib-unix - tezos-tx-rollup-alpha - uri) - (link_flags - (:standard) - (:include %{workspace_root}/static-link-flags.sexp)) - (flags - (:standard) - -open Tezos_base.TzPervasives - -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_protocol_alpha - -open Tezos_protocol_alpha.Protocol - -open Tezos_client_alpha - -open Tezos_client_alpha_commands - -open Tezos_client_base_unix - -open Tezos_stdlib_unix - -open Tezos_tx_rollup_alpha)) diff --git a/src/proto_alpha/bin_tx_rollup_node/dune b/src/proto_alpha/bin_tx_rollup_node/dune deleted file mode 100644 index 7fbae62f8e39..000000000000 --- a/src/proto_alpha/bin_tx_rollup_node/dune +++ /dev/null @@ -1,29 +0,0 @@ -; This file was automatically generated, do not edit. -; Edit file manifest/main.ml instead. - -(executable - (name main_tx_rollup_node_alpha) - (public_name octez-tx-rollup-node-alpha) - (package octez-tx-rollup-node-alpha) - (instrumentation (backend bisect_ppx)) - (libraries - tezos-base - tezos-clic - tezos-protocol-alpha - tezos-client-alpha - tezos-client-base - tezos-client-base-unix - tezos-tx-rollup-alpha) - (link_flags - (:standard) - (:include %{workspace_root}/static-link-flags.sexp)) - (flags - (:standard) - -open Tezos_base.TzPervasives - -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals - -open Tezos_base - -open Tezos_protocol_alpha - -open Tezos_client_alpha - -open Tezos_client_base - -open Tezos_client_base_unix - -open Tezos_tx_rollup_alpha)) diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - rejection.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - rejection.out deleted file mode 100644 index b65fac2e5a4f..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - rejection.out +++ /dev/null @@ -1,132 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client --wait none reject commitment of tx rollup '[TX_ROLLUP_HASH]' at level 0 with result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' and result path '[ - "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]" -]' for message at position 0 with content '{"batch":"6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262"}' and path '[ - "[TX_ROLLUP_INBOX_HASH]" -]' with agreed context hash '[CONTEXT_HASH]' and withdraw list hash txw1sFoLju3ySMAdY6v1dcHUMqJ4Zxc1kcynC8xkYgCmH6bpNSDhV and result path '[]' using proof '{ "version": 3, - "before": { "node": "[CONTEXT_HASH]" }, - "after": { "node": "[CONTEXT_HASH]" } , - "state": [] }' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 52116.302 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.010724 - Expected counter: 4 - Gas limit: 52217 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.010724 - payload fees(the block proposer) ....... +ꜩ0.010724 - Transaction rollup rejection: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment rejection was successfully applied - Balance updates: - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... -ꜩ10000 - tx rollup rejection punishments ............................................................ +ꜩ10000 - tx rollup rejection rewards ................................................................ -ꜩ5000 - [PUBLIC_KEY_HASH] ....................................................... +ꜩ5000 - Consumed gas: 52116.302 - diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - state.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - state.out deleted file mode 100644 index f46b34639302..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollup- regression) - state.out +++ /dev/null @@ -1,39 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "next": 0 }, - "uncommitted_inboxes": { "next": 0 }, "commitment_newest_hash": null, - "tezos_head_level": null, "burn_per_byte": "0", - "allocated_storage": "4000", "occupied_storage": "0", "inbox_ema": 0, - "commitments_watermark": null } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - batch encoding.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - batch encoding.out deleted file mode 100644 index 8b4f0b5a9baf..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - batch encoding.out +++ /dev/null @@ -1,59 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2232.850 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000739 - Expected counter: 2 - Gas limit: 2333 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000739 - payload fees(the block proposer) ....... +ꜩ0.000739 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 256 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2232.850 - -"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment remove.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment remove.out deleted file mode 100644 index 67a2736ab2f1..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment remove.out +++ /dev/null @@ -1,235 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' -{ "commitment": - { "level": 0, - "messages": - { "count": 1, - "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", - "last_message_result_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, - "predecessor": null, - "inbox_merkle_root": - "[TX_ROLLUP_INBOX_HASH]" }, - "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", - "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "newest": 0, "oldest": 0 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 4 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2501.420 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000505 - Expected counter: 4 - Gas limit: 2602 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000505 - payload fees(the block proposer) ....... +ꜩ0.000505 - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment finalization was successfully applied - Consumed gas: 2501.420@finalized level: - 0 - - -./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 1 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup remove commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_remove_commitment_too_early", - "description": - "It's too early to try to remove the oldest final commitment", - "data": {} } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "newest": 0, "oldest": 0 }, - "unfinalized_commitments": { "next": 1 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } - -./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 3171.024 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000572 - Expected counter: 1 - Gas limit: 3272 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000572 - payload fees(the block proposer) ....... +ꜩ0.000572 - Transaction rollup remove commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment removal was successfully applied - Consumed gas: 3171.024@finalized level: - 0 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": - { "last_message_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]", - "commitment_hash": - "[TX_ROLLUP_COMMITMENT_HASH]" }, - "finalized_commitments": { "next": 1 }, - "unfinalized_commitments": { "next": 1 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment.out deleted file mode 100644 index a215b10d1cf9..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - commitment.out +++ /dev/null @@ -1,117 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' -{ "commitment": - { "level": 0, - "messages": - { "count": 1, - "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", - "last_message_result_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, - "predecessor": null, - "inbox_merkle_root": - "[TX_ROLLUP_INBOX_HASH]" }, - "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", - "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "newest": 0, "oldest": 0 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree hash.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree hash.out deleted file mode 100644 index 258c59e3b6ba..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree hash.out +++ /dev/null @@ -1,22 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "626c6f62" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "676c6f756269626f756c6761" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_hash with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ] -}' -{ "hash": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree path.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree path.out deleted file mode 100644 index 38f5e76b895a..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox merkle tree path.out +++ /dev/null @@ -1,67 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "4b6f75726f756b6f756b6f75" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "726f756b6f756b6f75" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "7374616368" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "7374616368" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 3 -}' -{ "path": - [ "[TX_ROLLUP_INBOX_HASH]", - "[TX_ROLLUP_INBOX_HASH]" ] } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 0 -}' -{ "path": - [ "[TX_ROLLUP_INBOX_HASH]", - "[TX_ROLLUP_INBOX_HASH]" ] } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 4 -}' -Fatal error: - Command failed: Merkle_list_invalid_position - diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox message hash.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox message hash.out deleted file mode 100644 index 8c70d644a87c..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox message hash.out +++ /dev/null @@ -1,7 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "626c6f62" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox.out deleted file mode 100644 index 4c803666a8f8..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - inbox.out +++ /dev/null @@ -1,62 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' -{ "inbox_length": 1, "cumulated_size": 4, - "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - pending bonded commitments.out b/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - pending bonded commitments.out deleted file mode 100644 index dbc2f5e129d2..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- RPC (tx_rollups- regression) - pending bonded commitments.out +++ /dev/null @@ -1,99 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' -1 - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' -0 diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a batch to an invalid rollup address should fail.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a batch to an invalid rollup address should fail.out deleted file mode 100644 index 85195a31084a..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a batch to an invalid rollup address should fail.out +++ /dev/null @@ -1,36 +0,0 @@ - -./octez-client --wait none submit tx rollup batch 0x to 'this is an invalid tx rollup address' from '[PUBLIC_KEY_HASH]' -Error: - Erroneous command line argument 7 (this is an invalid tx rollup address). - Parameter 'this is an invalid tx rollup address' is an invalid transaction rollup address encoded in a base58 string. - -Usage: - octez-client [global options] command [command options] - octez-client --help (for global options) - octez-client [global options] command --help (for command options) - octez-client --version (for version information) - -To browse the documentation: - octez-client [global options] man (for a list of commands) - octez-client [global options] man -v 3 (for the full manual) - -Global options (must come before the command): - -d --base-dir <path>: client data directory (absent: TEZOS_CLIENT_DIR env) - -n --no-base-dir-warnings: silence warnings about client data directory - -c --config-file <path>: configuration file - -t --timings: show RPC request times - --chain <hash|tag>: chain on which to apply contextual commands (commands dependent on the context associated with the specified chain). Possible tags are 'main' and 'test'. - -b --block <hash|level|tag>: block on which to apply contextual commands (commands dependent on the context associated with the specified block). Possible tags include 'head' and 'genesis' +/- an optional offset (e.g. "octez-client -b head-1 get timestamp"). Note that block queried must exist in node's storage. - -w --wait <none|<int>>: how many confirmation blocks are needed before an operation is considered included - -p --protocol <hash>: use commands of a specific protocol - -l --log-requests: log all requests to the node - --better-errors: Error reporting is more detailed. Can be used if a call to an RPC fails or if you don't know the input accepted by the RPC. It may happen that the RPC calls take more time however. - -A --addr <IP addr|host>: [DEPRECATED: use --endpoint instead] IP address of the node - -P --port <number>: [DEPRECATED: use --endpoint instead] RPC port of the node - -S --tls: [DEPRECATED: use --endpoint instead] use TLS to connect to node. - -m --media-type <json, binary, any or default>: Sets the "media-type" value for the "accept" header for RPC requests to the node. The media accept header indicates to the node which format of data serialisation is supported. Use the value "json" for serialisation to the JSON format. - -E --endpoint <uri>: HTTP(S) endpoint of the node RPC interface; e.g. 'http://localhost:8732' - -s --sources <path>: path to JSON file containing sources for --mode light. Example file content: {"min_agreement": 1.0, "uris": ["http://localhost:8732", "https://localhost:8733"]} - -R --remote-signer <uri>: URI of the remote signer - -f --password-filename <filename>: path to the password filename - -M --mode <client|light|mockup|proxy>: how to interact with the node diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation for a commitment in the future.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation for a commitment in the future.out deleted file mode 100644 index 4aba231e50fe..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation for a commitment in the future.out +++ /dev/null @@ -1,76 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 3 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without batch.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without batch.out deleted file mode 100644 index 834014aa0579..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without batch.out +++ /dev/null @@ -1,48 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 2 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without commitment.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without commitment.out deleted file mode 100644 index 4aba231e50fe..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit a finalize commitment operation without commitment.out +++ /dev/null @@ -1,76 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 3 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit empty batch.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit empty batch.out deleted file mode 100644 index 6e2f5c7c1a60..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit empty batch.out +++ /dev/null @@ -1,58 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2104.274 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00047 - Expected counter: 2 - Gas limit: 2205 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00047 - payload fees(the block proposer) ....... +ꜩ0.00047 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 0 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2104.274 - diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size batch.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size batch.out deleted file mode 100644 index d82ebca99da4..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size batch.out +++ /dev/null @@ -1,66 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Error: - { "id": "proto.alpha.tx_rollup_message_size_exceeds_limit", - "description": - "A message submitted to a transaction rollup inbox exceeds limit", - "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size inbox.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size inbox.out deleted file mode 100644 index 3d51a630b097..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Submit maximum size inbox.out +++ /dev/null @@ -1,4259 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap1 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap2 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap3 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap4 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap5 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap6 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap7 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap8 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap9 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap10 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap11 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap12 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap13 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap14 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap15 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap16 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap17 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap18 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap19 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap20 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap21 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap22 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap23 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap24 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap25 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap26 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap27 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap28 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap29 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap30 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap31 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap32 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap33 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap34 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap35 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap36 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap37 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap38 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap39 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap40 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap41 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap42 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap43 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap44 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap45 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap46 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap47 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap48 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap49 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap50 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap51 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap52 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap53 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap54 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap55 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap56 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap57 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap58 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap59 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap60 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap61 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap62 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap63 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap64 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap65 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap66 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap67 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap68 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap69 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap70 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap71 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap72 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap73 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap74 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap75 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap76 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap77 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap78 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap79 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap80 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap81 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap82 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap83 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap84 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap85 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap86 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap87 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap88 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap89 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap90 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap91 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap92 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap93 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap94 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap95 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap96 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap97 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap98 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap99 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap100 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' -{ "inbox_length": 100, "cumulated_size": 500000, - "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Alpha- Try to finalize a too recent commitment.out b/tezt/tests/expected/tx_rollup.ml/Alpha- Try to finalize a too recent commitment.out deleted file mode 100644 index 34f886b2da46..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Alpha- Try to finalize a too recent commitment.out +++ /dev/null @@ -1,111 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 4 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.alpha.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out deleted file mode 100644 index b65fac2e5a4f..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - rejection.out +++ /dev/null @@ -1,132 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client --wait none reject commitment of tx rollup '[TX_ROLLUP_HASH]' at level 0 with result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' and result path '[ - "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]" -]' for message at position 0 with content '{"batch":"6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262"}' and path '[ - "[TX_ROLLUP_INBOX_HASH]" -]' with agreed context hash '[CONTEXT_HASH]' and withdraw list hash txw1sFoLju3ySMAdY6v1dcHUMqJ4Zxc1kcynC8xkYgCmH6bpNSDhV and result path '[]' using proof '{ "version": 3, - "before": { "node": "[CONTEXT_HASH]" }, - "after": { "node": "[CONTEXT_HASH]" } , - "state": [] }' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 52116.302 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.010724 - Expected counter: 4 - Gas limit: 52217 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.010724 - payload fees(the block proposer) ....... +ꜩ0.010724 - Transaction rollup rejection: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment rejection was successfully applied - Balance updates: - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... -ꜩ10000 - tx rollup rejection punishments ............................................................ +ꜩ10000 - tx rollup rejection rewards ................................................................ -ꜩ5000 - [PUBLIC_KEY_HASH] ....................................................... +ꜩ5000 - Consumed gas: 52116.302 - diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out deleted file mode 100644 index f46b34639302..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollup- regression) - state.out +++ /dev/null @@ -1,39 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "next": 0 }, - "uncommitted_inboxes": { "next": 0 }, "commitment_newest_hash": null, - "tezos_head_level": null, "burn_per_byte": "0", - "allocated_storage": "4000", "occupied_storage": "0", "inbox_ema": 0, - "commitments_watermark": null } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out deleted file mode 100644 index 8b4f0b5a9baf..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - batch encoding.out +++ /dev/null @@ -1,59 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2232.850 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000739 - Expected counter: 2 - Gas limit: 2333 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000739 - payload fees(the block proposer) ....... +ꜩ0.000739 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 256 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2232.850 - -"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out deleted file mode 100644 index 765e8bb93805..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment remove.out +++ /dev/null @@ -1,235 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' -{ "commitment": - { "level": 0, - "messages": - { "count": 1, - "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", - "last_message_result_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, - "predecessor": null, - "inbox_merkle_root": - "[TX_ROLLUP_INBOX_HASH]" }, - "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", - "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "newest": 0, "oldest": 0 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 4 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2501.420 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000505 - Expected counter: 4 - Gas limit: 2602 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000505 - payload fees(the block proposer) ....... +ꜩ0.000505 - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment finalization was successfully applied - Consumed gas: 2501.420@finalized level: - 0 - - -./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 1 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup remove commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_remove_commitment_too_early", - "description": - "It's too early to try to remove the oldest final commitment", - "data": {} } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "newest": 0, "oldest": 0 }, - "unfinalized_commitments": { "next": 1 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } - -./octez-client --wait none remove commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 3171.024 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000572 - Expected counter: 1 - Gas limit: 3272 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000572 - payload fees(the block proposer) ....... +ꜩ0.000572 - Transaction rollup remove commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment removal was successfully applied - Consumed gas: 3171.024@finalized level: - 0 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": - { "last_message_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]", - "commitment_hash": - "[TX_ROLLUP_COMMITMENT_HASH]" }, - "finalized_commitments": { "next": 1 }, - "unfinalized_commitments": { "next": 1 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out deleted file mode 100644 index a215b10d1cf9..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - commitment.out +++ /dev/null @@ -1,117 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' -{ "commitment": - { "level": 0, - "messages": - { "count": 1, - "root": "[TX_ROLLUP_MESSAGE_RESULT_LIST_HASH]", - "last_message_result_hash": - "[TX_ROLLUP_MESSAGE_RESULT_HASH]" }, - "predecessor": null, - "inbox_merkle_root": - "[TX_ROLLUP_INBOX_HASH]" }, - "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", - "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/state' -{ "last_removed_commitment_hashes": null, - "finalized_commitments": { "next": 0 }, - "unfinalized_commitments": { "newest": 0, "oldest": 0 }, - "uncommitted_inboxes": { "next": 1 }, - "commitment_newest_hash": - "[TX_ROLLUP_COMMITMENT_HASH]", - "tezos_head_level": 3, "burn_per_byte": "0", "allocated_storage": "4000", - "occupied_storage": "0", "inbox_ema": 0, "commitments_watermark": 0 } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out deleted file mode 100644 index 258c59e3b6ba..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree hash.out +++ /dev/null @@ -1,22 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "626c6f62" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "676c6f756269626f756c6761" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_hash with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ] -}' -{ "hash": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out deleted file mode 100644 index 38f5e76b895a..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox merkle tree path.out +++ /dev/null @@ -1,67 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "4b6f75726f756b6f756b6f75" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "726f756b6f756b6f75" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "7374616368" - } -}' - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "7374616368" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 3 -}' -{ "path": - [ "[TX_ROLLUP_INBOX_HASH]", - "[TX_ROLLUP_INBOX_HASH]" ] } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 0 -}' -{ "path": - [ "[TX_ROLLUP_INBOX_HASH]", - "[TX_ROLLUP_INBOX_HASH]" ] } - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/merkle_tree_path with '{ - "message_hashes": [ - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]", - "[TX_ROLLUP_MESSAGE_HASH]" - ], - "position": 4 -}' -Fatal error: - Command failed: Merkle_list_invalid_position - diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out deleted file mode 100644 index 8c70d644a87c..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox message hash.out +++ /dev/null @@ -1,7 +0,0 @@ - -./octez-client rpc post /chains/main/blocks/head/helpers/forge/tx_rollup/inbox/message_hash with '{ - "message": { - "batch": "626c6f62" - } -}' -{ "hash": "[TX_ROLLUP_MESSAGE_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out deleted file mode 100644 index 4c803666a8f8..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - inbox.out +++ /dev/null @@ -1,62 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' -{ "inbox_length": 1, "cumulated_size": 4, - "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out deleted file mode 100644 index dbc2f5e129d2..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- RPC (tx_rollups- regression) - pending bonded commitments.out +++ /dev/null @@ -1,99 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' -1 - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' -0 diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out deleted file mode 100644 index 85195a31084a..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a batch to an invalid rollup address should fail.out +++ /dev/null @@ -1,36 +0,0 @@ - -./octez-client --wait none submit tx rollup batch 0x to 'this is an invalid tx rollup address' from '[PUBLIC_KEY_HASH]' -Error: - Erroneous command line argument 7 (this is an invalid tx rollup address). - Parameter 'this is an invalid tx rollup address' is an invalid transaction rollup address encoded in a base58 string. - -Usage: - octez-client [global options] command [command options] - octez-client --help (for global options) - octez-client [global options] command --help (for command options) - octez-client --version (for version information) - -To browse the documentation: - octez-client [global options] man (for a list of commands) - octez-client [global options] man -v 3 (for the full manual) - -Global options (must come before the command): - -d --base-dir <path>: client data directory (absent: TEZOS_CLIENT_DIR env) - -n --no-base-dir-warnings: silence warnings about client data directory - -c --config-file <path>: configuration file - -t --timings: show RPC request times - --chain <hash|tag>: chain on which to apply contextual commands (commands dependent on the context associated with the specified chain). Possible tags are 'main' and 'test'. - -b --block <hash|level|tag>: block on which to apply contextual commands (commands dependent on the context associated with the specified block). Possible tags include 'head' and 'genesis' +/- an optional offset (e.g. "octez-client -b head-1 get timestamp"). Note that block queried must exist in node's storage. - -w --wait <none|<int>>: how many confirmation blocks are needed before an operation is considered included - -p --protocol <hash>: use commands of a specific protocol - -l --log-requests: log all requests to the node - --better-errors: Error reporting is more detailed. Can be used if a call to an RPC fails or if you don't know the input accepted by the RPC. It may happen that the RPC calls take more time however. - -A --addr <IP addr|host>: [DEPRECATED: use --endpoint instead] IP address of the node - -P --port <number>: [DEPRECATED: use --endpoint instead] RPC port of the node - -S --tls: [DEPRECATED: use --endpoint instead] use TLS to connect to node. - -m --media-type <json, binary, any or default>: Sets the "media-type" value for the "accept" header for RPC requests to the node. The media accept header indicates to the node which format of data serialisation is supported. Use the value "json" for serialisation to the JSON format. - -E --endpoint <uri>: HTTP(S) endpoint of the node RPC interface; e.g. 'http://localhost:8732' - -s --sources <path>: path to JSON file containing sources for --mode light. Example file content: {"min_agreement": 1.0, "uris": ["http://localhost:8732", "https://localhost:8733"]} - -R --remote-signer <uri>: URI of the remote signer - -f --password-filename <filename>: path to the password filename - -M --mode <client|light|mockup|proxy>: how to interact with the node diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out deleted file mode 100644 index 430beed302fa..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation for a commitment in the future.out +++ /dev/null @@ -1,76 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 3 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out deleted file mode 100644 index 73c7f7dc1a93..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without batch.out +++ /dev/null @@ -1,48 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 2 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out deleted file mode 100644 index 430beed302fa..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit a finalize commitment operation without commitment.out +++ /dev/null @@ -1,76 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 3 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out deleted file mode 100644 index 6e2f5c7c1a60..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit empty batch.out +++ /dev/null @@ -1,58 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2104.274 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00047 - Expected counter: 2 - Gas limit: 2205 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00047 - payload fees(the block proposer) ....... +ꜩ0.00047 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 0 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2104.274 - diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out deleted file mode 100644 index beaaff4f9793..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size batch.out +++ /dev/null @@ -1,66 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Error: - { "id": "proto.016-PtMumbai.tx_rollup_message_size_exceeds_limit", - "description": - "A message submitted to a transaction rollup inbox exceeds limit", - "data": {} } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out deleted file mode 100644 index 3d51a630b097..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Submit maximum size inbox.out +++ /dev/null @@ -1,4259 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap1 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap2 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap3 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap4 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap5 -Node is bootstrapped. -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005721 - Expected counter: 1 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005721 - payload fees(the block proposer) ....... +ꜩ0.005721 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap6 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap7 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap8 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap9 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap10 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap11 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap12 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap13 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap14 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap15 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap16 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap17 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap18 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap19 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap20 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap21 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap22 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap23 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap24 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap25 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap26 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap27 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap28 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap29 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap30 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap31 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap32 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap33 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap34 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap35 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap36 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap37 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap38 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap39 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap40 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap41 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap42 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap43 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap44 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap45 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap46 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap47 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap48 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap49 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap50 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap51 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap52 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap53 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap54 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap55 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap56 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap57 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap58 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap59 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap60 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap61 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap62 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap63 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap64 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap65 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap66 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap67 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap68 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap69 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap70 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap71 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap72 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap73 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap74 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap75 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap76 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap77 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap78 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap79 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap80 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap81 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap82 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap83 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap84 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap85 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap86 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap87 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap88 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap89 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap90 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap91 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap92 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap93 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap94 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap95 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap96 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap97 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap98 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap99 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client --wait none submit tx rollup batch 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 to '[TX_ROLLUP_HASH]' from bootstrap100 -Node is bootstrapped. -Estimated storage: no bytes added -Estimated gas: 4615.524 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000357 - Expected counter: 1 - Gas limit: 1000 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000357 - payload fees(the block proposer) ....... +ꜩ0.000357 - Revelation of manager public key: - Contract: [PUBLIC_KEY_HASH] - Key: [PUBLIC_KEY] - This revelation was successfully applied - Consumed gas: 1000 - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.005625 - Expected counter: 2 - Gas limit: 4716 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.005625 - payload fees(the block proposer) ....... +ꜩ0.005625 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 5000 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 4615.524 - - -./octez-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/inbox/0' -{ "inbox_length": 100, "cumulated_size": 500000, - "merkle_root": "[TX_ROLLUP_INBOX_HASH]" } diff --git a/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out b/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out deleted file mode 100644 index 0a5ff8a90ec5..000000000000 --- a/tezt/tests/expected/tx_rollup.ml/Mumbai- Try to finalize a too recent commitment.out +++ /dev/null @@ -1,111 +0,0 @@ - -./octez-client --wait none originate tx rollup tx_rollup from '[PUBLIC_KEY_HASH]' --burn-cap 9999999 --storage-limit 60000 -Node is bootstrapped. -Estimated gas: 1420.108 units (will add 100 for safety) -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000379 - Expected counter: 1 - Gas limit: 1521 - Storage limit: 60000 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000379 - payload fees(the block proposer) ....... +ꜩ0.000379 - Transaction rollup origination: - From: [PUBLIC_KEY_HASH] - This transaction rollup origination was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1 - storage fees ........................... +ꜩ1 - Consumed gas: 1420.108 - Originated tx rollup: [TX_ROLLUP_HASH] - -Transaction rollup memorized as tx_rollup - -./octez-client --wait none submit tx rollup batch 0x626c6f62 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -Estimated gas: 2108.283 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000474 - Expected counter: 2 - Gas limit: 2209 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000474 - payload fees(the block proposer) ....... +ꜩ0.000474 - Transaction rollup transaction: - Address:[TX_ROLLUP_HASH] - Message length: 4 bytes - From: [PUBLIC_KEY_HASH] - This transaction rollup batch submission was successfully applied - Consumed gas: 2108.283 - - -./octez-client --wait none commit to tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for level 0 with inbox hash '[TX_ROLLUP_INBOX_HASH]' and messages result hash '[TX_ROLLUP_MESSAGE_RESULT_HASH]' -Node is bootstrapped. -Estimated gas: 3694.500 units (will add 100 for safety) -Estimated storage: no bytes added -Operation successfully injected in the node. -Operation hash is '[OPERATION_HASH]' -NOT waiting for the operation to be included. -Use command - octez-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.000697 - Expected counter: 3 - Gas limit: 3795 - Storage limit: 0 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000697 - payload fees(the block proposer) ....... +ꜩ0.000697 - Transaction rollup commitment: - Address: [TX_ROLLUP_HASH] - Commitment: - Level: 0 - Messages: [TX_ROLLUP_MESSAGE_RESULT_HASH] - Predecessor: None - Inbox merkle root: [TX_ROLLUP_INBOX_HASH] - From: [PUBLIC_KEY_HASH] - This transaction rollup commitment was successfully applied - Balance updates: - [PUBLIC_KEY_HASH] ....................................................... -ꜩ10000 - Frozen_bonds([PUBLIC_KEY_HASH],[TX_ROLLUP_HASH]) ... +ꜩ10000 - Consumed gas: 3694.500 - - -./octez-client --wait none finalize commitment of tx rollup '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' -Node is bootstrapped. -This simulation failed: - Manager signed operations: - From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0 - Expected counter: 4 - Gas limit: 1040000 - Storage limit: 60000 bytes - Transaction rollup finalize commitment: - Address: [TX_ROLLUP_HASH] - From: [PUBLIC_KEY_HASH] - This operation FAILED. - -Error: - { "id": "proto.016-PtMumbai.tx_rollup_no_commitment_to_finalize", - "description": "There is no commitment to finalize", "data": {} } diff --git a/tezt/tests/main.ml b/tezt/tests/main.ml index 56b8f04c0176..156a4887ee13 100644 --- a/tezt/tests/main.ml +++ b/tezt/tests/main.ml @@ -170,8 +170,6 @@ let register_protocol_tests_that_use_supports_correctly () = Transfer.register ~protocols ; Tickets.register ~protocols ; Timelock.register ~protocols ; - Tx_rollup.register ~protocols ; - Tx_rollup_l2_node.register ~protocols ; Tzip4_view.register ~protocols ; Used_paid_storage_spaces.register ~protocols ; Vdf_test.register ~protocols @@ -188,6 +186,8 @@ let register_protocol_specific_because_regression_tests () = Sc_rollup.register ~protocols:[Alpha] ; Test_contract_bls12_381.register ~protocols:[Alpha] ; Ticket_receipt_and_rpc.register ~protocols:[Alpha] ; + Tx_rollup.register ~protocols:[Kathmandu; Lima] ; + Tx_rollup_l2_node.register ~protocols:[Kathmandu; Lima] ; Views.register [Alpha] ; Zk_rollup.register ~protocols:[Alpha] diff --git a/tezt/tests/tx_rollup_l2_node.ml b/tezt/tests/tx_rollup_l2_node.ml index 1ecbe0cc0636..a4457374379b 100644 --- a/tezt/tests/tx_rollup_l2_node.ml +++ b/tezt/tests/tx_rollup_l2_node.ml @@ -2984,7 +2984,9 @@ let register ~protocols = test_committer protocols ; test_tickets_context protocols ; test_withdrawals protocols ; - test_withdrawals_tz4 [Alpha] ; + (match List.filter Protocol.(fun proto -> proto = Alpha) protocols with + | [] -> () + | protocols -> test_withdrawals_tz4 protocols) ; test_single_signer protocols ; test_signer_reveals protocols ; test_accuser protocols ; -- GitLab From f9c1925cfccc0882c51c9dcace149df1ed760a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Fri, 9 Dec 2022 16:32:24 +0000 Subject: [PATCH 14/18] Doc: Generate RPCs for protocol --- docs/kathmandu/rpc.rst | 10245 ++++-- docs/lima/rpc.rst | 17249 +++++----- docs/mumbai/rpc.rst | 72659 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 88629 insertions(+), 11524 deletions(-) create mode 100644 docs/mumbai/rpc.rst diff --git a/docs/kathmandu/rpc.rst b/docs/kathmandu/rpc.rst index 9799bdfbc03f..939b6a53f0fa 100644 --- a/docs/kathmandu/rpc.rst +++ b/docs/kathmandu/rpc.rst @@ -78,7 +78,6 @@ -.. _rpc_index: .. _rpc_index_kathmandu : RPCs - Reference @@ -177,6 +176,8 @@ Protocol Kathmandu * ../<block_id>/context/merkle_tree (`GET <GET_..--block_id--context--merkle_tree_>`_) + * ../<block_id>/context/merkle_tree_v2 (`GET <GET_..--block_id--context--merkle_tree_v2_>`_) + * ../<block_id>/context/nonces * ../<block_id>/context/nonces/<block_level> (`GET <GET_..--block_id--context--nonces--block_level_>`_) @@ -271,6 +272,8 @@ Protocol Kathmandu * ../<block_id>/protocols (`GET <GET_..--block_id--protocols_>`_) + * ../<block_id>/resulting_context_hash (`GET <GET_..--block_id--resulting_context_hash_>`_) + * ../<block_id>/votes * ../<block_id>/votes/ballot_list (`GET <GET_..--block_id--votes--ballot_list_>`_) @@ -325,9 +328,8 @@ Protocol Kathmandu "nonce": integer ∈ [0, 2^16-1], "amount": $014-PtKathma.mutez, "destination": $014-PtKathma.transaction_destination, - "parameters"?: - { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, + "value": any }, "result": $014-PtKathma.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -335,7 +337,7 @@ Protocol Kathmandu "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "result": $014-PtKathma.operation.alpha.internal_operation_result.origination } @@ -343,7 +345,7 @@ Protocol Kathmandu "kind": "delegation", "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $014-PtKathma.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -377,7 +379,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $014-PtKathma.tx_rollup_id } @@ -401,7 +403,7 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.error: /* The full list of RPC errors would be too long to include. @@ -413,7 +415,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -425,7 +427,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -662,7 +664,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -690,26 +692,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -718,28 +720,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -747,7 +749,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -759,15 +761,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -775,7 +777,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -785,7 +787,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -798,7 +800,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -806,7 +808,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -814,7 +816,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -822,7 +824,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -834,7 +836,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -895,7 +897,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -906,27 +908,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -937,7 +939,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -948,10 +950,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -960,7 +962,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -969,7 +971,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -983,13 +985,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -1109,18 +1111,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1133,7 +1135,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1141,7 +1143,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1150,7 +1152,7 @@ Protocol Kathmandu "slot_index": integer ∈ [0, 255] } $014-PtKathma.operation.alpha.contents_and_signature: { "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -1306,7 +1308,7 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Preendorsement */ "kind": "preendorsement", @@ -1317,13 +1319,13 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $014-PtKathma.inlined.preendorsement, @@ -1354,25 +1356,25 @@ Protocol Kathmandu $014-PtKathma.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1382,7 +1384,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1391,7 +1393,7 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1401,13 +1403,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "metadata": { "balance_updates"?: @@ -1418,12 +1420,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1433,12 +1435,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1448,7 +1450,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1463,7 +1465,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1479,7 +1481,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1494,7 +1496,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1511,7 +1513,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1531,7 +1533,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1546,7 +1548,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1561,7 +1563,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1576,7 +1578,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1588,7 +1590,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -1656,13 +1658,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, @@ -1676,7 +1678,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1694,7 +1696,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1705,11 +1707,11 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1719,7 +1721,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1730,7 +1732,7 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1740,7 +1742,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1756,7 +1758,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1772,7 +1774,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1793,13 +1795,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -1926,15 +1928,15 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -1944,7 +1946,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1964,7 +1966,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1979,7 +1981,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -2256,7 +2258,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -2278,7 +2280,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -2295,7 +2297,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -2317,7 +2319,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -2582,10 +2584,10 @@ Protocol Kathmandu { /* Operation_with_metadata */ "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.operation.alpha.successful_manager_operation_result: { /* reveal */ "kind": "reveal", @@ -2667,7 +2669,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -2708,7 +2710,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -2780,9 +2782,8 @@ Protocol Kathmandu /* Sapling state identifier A sapling state identifier */ $bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -2831,13 +2832,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -2864,8 +2865,8 @@ Protocol Kathmandu "max_operation_list_length": [ { "max_size": integer ∈ [-2^30, 2^30], "max_op"?: integer ∈ [-2^30, 2^30] } ... ], - "proposer": $Signature.Public_key_hash, - "baker": $Signature.Public_key_hash, + "proposer": $Signature.V0.Public_key_hash, + "baker": $Signature.V0.Public_key_hash, "level_info": { "level": integer ∈ [-2^31-1, 2^31] @@ -2919,7 +2920,7 @@ Protocol Kathmandu /* The number of blocks remaining till the end of the voting period. */ }, "nonce_hash": $cycle_nonce /* Some */ || null /* None */, - "deactivated": [ $Signature.Public_key_hash ... ], + "deactivated": [ $Signature.V0.Public_key_hash ... ], "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], @@ -2984,7 +2985,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -2992,7 +2993,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -3000,7 +3001,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, @@ -3008,14 +3009,14 @@ Protocol Kathmandu "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -3038,7 +3039,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ $sapling.transaction.ciphertext: { "cv": $sapling.transaction.commitment_value, @@ -3426,13 +3427,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -4857,30 +4858,20 @@ Protocol Kathmandu X_78 **** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ - + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_79 - **** - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_78 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ - - - X_82 + X_80 **** +-----------------+----------------------+------------------------+ @@ -4892,7 +4883,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_83 (Determined from data, 8-bit tag) + X_81 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -4905,7 +4896,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_82 | + | sparse_proof | Variable | sequence of $X_80 | +-----------------------+----------+-------------------------+ @@ -4921,7 +4912,7 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_81 + X_79 **** +--------+----------------------+-----------------------+ @@ -4929,17 +4920,29 @@ Protocol Kathmandu +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_83 | + | proofs | Determined from data | $X_81 | +--------+----------------------+-----------------------+ - X_84 + X_83 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_82 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_78 | + | Unnamed field 0 | Determined from data | $X_83 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -4970,7 +4973,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_84 | + | inode_values | Variable | sequence of $X_82 | +-----------------------+----------+-------------------------+ @@ -4982,7 +4985,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_81 | + | inode_tree | Determined from data | $X_79 | +------------+----------------------+------------------------+ @@ -4994,7 +4997,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_79 | + | inode_extender | Determined from data | $X_78 | +----------------+----------------------+------------------------+ @@ -5047,7 +5050,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_84 | + | node | Variable | sequence of $X_82 | +-----------------------+----------+-------------------------+ @@ -5071,7 +5074,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_81 | + | inode | Determined from data | $X_79 | +-------+----------------------+------------------------+ @@ -5083,7 +5086,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_79 | + | extender | Determined from data | $X_78 | +----------+----------------------+------------------------+ @@ -5113,7 +5116,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_109 (Determined from data, 8-bit tag) + X_105 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -5144,7 +5147,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_110 (Determined from data, 8-bit tag) + X_106 (Determined from data, 8-bit tag) *************************************** No_input_required (tag 0) @@ -5181,7 +5184,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_148 (Determined from data, 8-bit tag) + X_140 (Determined from data, 8-bit tag) *************************************** Arithmetic PVM with proof (tag 0) @@ -5194,9 +5197,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_74 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_109 | + | given | Determined from data | $X_105 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_110 | + | requested | Determined from data | $X_106 | +------------+----------------------+------------------------+ @@ -5210,13 +5213,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_74 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_109 | + | given | Determined from data | $X_105 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_110 | + | requested | Determined from data | $X_106 | +------------+----------------------+------------------------+ - X_152 + X_144 ***** +-----------------------+----------+-------------------------+ @@ -5228,7 +5231,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_149 + X_141 ***** +-----------------+----------------------+----------+ @@ -5236,11 +5239,11 @@ Protocol Kathmandu +=================+======================+==========+ | Unnamed field 0 | Determined from data | $X_40 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_152 | + | Unnamed field 1 | Determined from data | $X_144 | +-----------------+----------------------+----------+ - X_192 (Determined from data, 8-bit tag) + X_180 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -5263,7 +5266,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_149 | + | skips | Variable | sequence of $X_141 | +-----------------------+----------------------+-------------------------+ | level | Determined from data | $X_40 | +-----------------------+----------------------+-------------------------+ @@ -5275,7 +5278,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_194 (Determined from data, 8-bit tag) + X_182 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -5300,19 +5303,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_193 + X_181 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_194 | + | Unnamed field 0 | Determined from data | $X_182 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_195 (Determined from data, 8-bit tag) + X_183 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -5325,7 +5328,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_193 | + | Unnamed field 0 | Variable | sequence of $X_181 | +-----------------------+----------+-------------------------+ @@ -5337,9 +5340,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_148 | + | pvm_step | Determined from data | $X_140 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_192 | + | inbox | Determined from data | $X_180 | +----------+----------------------+------------------------+ @@ -5351,11 +5354,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_195 | + | step | Determined from data | $X_183 | +--------+----------------------+----------+ - X_196 + X_184 ***** +--------------------+----------+-----------------------+ @@ -5373,7 +5376,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_197 + X_185 ***** +-----------------------+----------+-------------------------+ @@ -5385,7 +5388,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_198 (2 bytes, 16-bit tag) + X_186 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -5408,7 +5411,7 @@ Protocol Kathmandu +------+---------+-------------------------+ - X_200 (Determined from data, 8-bit tag) + X_188 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -5459,7 +5462,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_199 + X_187 ***** +-----------------------+----------------------+---------------------------+ @@ -5475,13 +5478,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_200 | + | amount | Determined from data | $X_188 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_201 + X_189 ***** +-------------+----------------------+------------------+ @@ -5493,11 +5496,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_200 | + | amount | Determined from data | $X_188 | +-------------+----------------------+------------------+ - X_203 (Determined from data, 8-bit tag) + X_191 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -5522,11 +5525,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_201 | + | deposit | Determined from data | $X_189 | +---------+----------------------+------------------------+ - X_204 + X_192 ***** +--------------------+----------+----------+ @@ -5538,7 +5541,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_212 (33 bytes, 8-bit tag) + X_200 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -5565,19 +5568,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_210 + X_198 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_78 | + | Unnamed field 0 | Determined from data | $X_83 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_212 | + | Unnamed field 1 | 33 bytes | $X_200 | +-----------------+----------------------+----------+ - X_219 + X_207 ***** +-----------------+----------+----------+ @@ -5589,7 +5592,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_223 + X_211 ***** +-----------------+----------+----------+ @@ -5599,11 +5602,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_231 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_235 (Determined from data, 8-bit tag) + X_223 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -5664,7 +5663,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5678,7 +5677,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+-------------------------+ @@ -5692,7 +5691,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5706,7 +5705,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5720,7 +5719,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5734,7 +5733,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+-------------------------+ @@ -5748,7 +5747,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5762,7 +5761,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_223 | + | Unnamed field 1 | 32 bytes | $X_211 | +-----------------+----------+------------------------+ @@ -5776,7 +5775,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_219 | + | Unnamed field 1 | 64 bytes | $X_207 | +-----------------+----------+------------------------+ @@ -5790,7 +5789,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_219 | + | Unnamed field 1 | 64 bytes | $X_207 | +-----------------+----------+-------------------------+ @@ -5804,7 +5803,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_219 | + | Unnamed field 1 | 64 bytes | $X_207 | +-----------------+----------+------------------------+ @@ -5818,7 +5817,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_219 | + | Unnamed field 1 | 64 bytes | $X_207 | +-----------------+----------+------------------------+ @@ -5840,7 +5839,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_210 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_198 | +-----------------+----------+------------------------------+ @@ -5852,7 +5851,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_210 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_198 | +-----------------+----------+------------------------------+ @@ -5866,7 +5865,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_210 | + | Unnamed field 0 | Variable | sequence of $X_198 | +-----------------------+----------+-------------------------+ @@ -5922,7 +5921,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_78 | + | Unnamed field 1 | Determined from data | $X_83 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -5938,7 +5937,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_78 | + | Unnamed field 1 | Determined from data | $X_83 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -5954,7 +5953,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_78 | + | Unnamed field 1 | Determined from data | $X_83 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -5970,13 +5969,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_78 | + | Unnamed field 1 | Determined from data | $X_83 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_205 + X_193 ***** +-----------------------+----------+-------------------------+ @@ -5984,11 +5983,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_235 | + | Unnamed field 0 | Variable | sequence of $X_223 | +-----------------------+----------+-------------------------+ - X_329 (Determined from data, 8-bit tag) + X_317 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -6005,7 +6004,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_205 | + | Unnamed field 3 | Determined from data | $X_193 | +-----------------+----------------------+------------------------+ @@ -6023,7 +6022,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_205 | + | Unnamed field 3 | Determined from data | $X_193 | +-----------------+----------------------+------------------------+ @@ -6041,7 +6040,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_205 | + | Unnamed field 3 | Determined from data | $X_193 | +-----------------+----------------------+------------------------+ @@ -6059,11 +6058,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_205 | + | Unnamed field 3 | Determined from data | $X_193 | +-----------------+----------------------+------------------------+ - X_331 (Determined from data, 8-bit tag) + X_319 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -6088,7 +6087,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_330 + X_318 ***** +-----------------------+----------------------+-------------------------+ @@ -6100,7 +6099,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_331 | + | predecessor | Determined from data | $X_319 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -6189,7 +6188,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_332 + X_320 ***** +-----------------------+----------------------+--------------------------+ @@ -6242,7 +6241,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_333 + X_321 ***** +-----------------+-----------+----------+ @@ -6453,7 +6452,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_333 | + | solution | 200 bytes | $X_321 | +----------+-----------+------------------------+ @@ -6567,7 +6566,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_332 | + | parameters | Determined from data | $X_320 | +----------------------------------+----------------------+-------------------------------------+ @@ -6765,7 +6764,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_330 | + | commitment | Determined from data | $X_318 | +---------------+----------------------+------------------------+ @@ -6857,7 +6856,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_203 | + | message | Determined from data | $X_191 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -6871,13 +6870,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_204 | + | previous_message_result | 64 bytes | $X_192 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_329 | + | proof | Determined from data | $X_317 | +------------------------------+----------------------+-------------------------+ @@ -6913,7 +6912,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_199 | + | tickets_info | Variable | sequence of $X_187 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -6973,7 +6972,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_198 | + | kind | 2 bytes | $X_186 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -7009,7 +7008,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_197 | + | message | Variable | sequence of $X_185 | +------------------------------------------------+----------------------+-------------------------+ @@ -7061,7 +7060,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_196 | + | commitment | 76 bytes | $X_184 | +------------------------------------------------+----------------------+-------------------------+ @@ -7229,7 +7228,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ - X_339 + X_327 ***** +-----------------------+----------+-------------------------+ @@ -7237,7 +7236,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_197 | + | Unnamed field 0 | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7266,7 +7265,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7290,7 +7289,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -7337,7 +7336,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7361,7 +7360,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -7389,13 +7388,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -7465,7 +7464,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7489,7 +7488,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +------------------------------+----------------------+-------------------------------------+ | Unnamed field 0 | Determined from data | $X_69 | +------------------------------+----------------------+-------------------------------------+ @@ -7516,7 +7515,7 @@ Protocol Kathmandu +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_332 | + | parameters | Determined from data | $X_320 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -7592,7 +7591,7 @@ Protocol Kathmandu +-------------------------------+----------------------+------------------------------------------------------------------------+ - X_335 + X_323 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -7639,7 +7638,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7663,7 +7662,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -7673,7 +7672,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_453 + X_441 ***** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -7720,7 +7719,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7744,7 +7743,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -7754,7 +7753,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_571 + X_559 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -7803,7 +7802,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7827,7 +7826,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -7839,7 +7838,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_695 + X_683 ***** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -7857,7 +7856,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_825 (Determined from data, 8-bit tag) + X_813 (Determined from data, 8-bit tag) *************************************** Conflict_resolved (tag 0) @@ -7894,7 +7893,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_826 (Determined from data, 8-bit tag) + X_814 (Determined from data, 8-bit tag) *************************************** Ongoing (tag 0) @@ -7915,7 +7914,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_825 | + | Unnamed field 0 | Determined from data | $X_813 | +-----------------+----------------------+------------------------+ | Unnamed field 1 | 21 bytes | $public_key_hash | +-----------------+----------------------+------------------------+ @@ -7934,7 +7933,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | status | Determined from data | $X_826 | + | status | Determined from data | $X_814 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -7952,7 +7951,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -7976,11 +7975,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | status | Determined from data | $X_826 | + | status | Determined from data | $X_814 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -7988,7 +7987,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_820 + X_808 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8039,7 +8038,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8063,7 +8062,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8077,7 +8076,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1200 + X_1176 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8122,7 +8121,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8146,7 +8145,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -8154,7 +8153,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_1443 + X_1419 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8205,7 +8204,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8229,7 +8228,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8243,7 +8242,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1566 + X_1542 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8292,7 +8291,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8316,7 +8315,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8328,7 +8327,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2193 + X_2169 ****** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -8377,7 +8376,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8401,7 +8400,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8413,7 +8412,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2691 + X_2667 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8462,7 +8461,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8486,7 +8485,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8498,7 +8497,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2815 + X_2791 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8549,7 +8548,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_197 | + | errors | Variable | sequence of $X_185 | +-----------------------+----------+-------------------------+ @@ -8573,7 +8572,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_339 | + | errors | Determined from data | $X_327 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -8587,7 +8586,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_3181 + X_3157 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8605,7 +8604,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3423 + X_3399 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8623,7 +8622,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3588 + X_3564 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -8641,7 +8640,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3884 + X_3860 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -8657,7 +8656,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_3888 + X_3864 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -8824,7 +8823,7 @@ Protocol Kathmandu +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_333 | + | solution | 200 bytes | $X_321 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $014-PtKathma.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -8846,7 +8845,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3888 | + | metadata | Determined from data | $X_3864 | +--------------------+----------------------+-------------------------+ @@ -8866,7 +8865,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3884 | + | metadata | Determined from data | $X_3860 | +--------------------+----------------------+-------------------------+ @@ -8906,7 +8905,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_335 | + | metadata | Determined from data | $X_323 | +---------------+----------------------+------------------------+ @@ -8934,9 +8933,9 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_332 | + | parameters | Determined from data | $X_320 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3588 | + | metadata | Determined from data | $X_3564 | +----------------------------------+----------------------+-------------------------------------+ @@ -8966,7 +8965,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $014-PtKathma.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3423 | + | metadata | Determined from data | $X_3399 | +--------------------------------+----------------------+-------------------------------------+ @@ -8992,7 +8991,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_335 | + | metadata | Determined from data | $X_323 | +--------------------------------+----------------------+-------------------------------------+ @@ -9018,7 +9017,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3181 | + | metadata | Determined from data | $X_3157 | +-----------------------+----------------------+-------------------------+ @@ -9044,7 +9043,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_335 | + | metadata | Determined from data | $X_323 | +-----------------------------+----------------------+-------------------------------------+ @@ -9070,7 +9069,7 @@ Protocol Kathmandu +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $014-PtKathma.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_571 | + | metadata | Determined from data | $X_559 | +---------------+----------------------+--------------------------------------+ @@ -9092,7 +9091,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2815 | + | metadata | Determined from data | $X_2791 | +---------------+----------------------+------------------------+ @@ -9124,7 +9123,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_2691 | + | metadata | Determined from data | $X_2667 | +----------------------------------+----------------------+-------------------------------------+ @@ -9148,9 +9147,9 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_330 | + | commitment | Determined from data | $X_318 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_571 | + | metadata | Determined from data | $X_559 | +---------------+----------------------+------------------------+ @@ -9174,7 +9173,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_571 | + | metadata | Determined from data | $X_559 | +---------------+----------------------+------------------------+ @@ -9198,7 +9197,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2193 | + | metadata | Determined from data | $X_2169 | +---------------+----------------------+------------------------+ @@ -9222,7 +9221,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2193 | + | metadata | Determined from data | $X_2169 | +---------------+----------------------+------------------------+ @@ -9248,7 +9247,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_203 | + | message | Determined from data | $X_191 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -9262,15 +9261,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_204 | + | previous_message_result | 64 bytes | $X_192 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_329 | + | proof | Determined from data | $X_317 | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_571 | + | metadata | Determined from data | $X_559 | +------------------------------+----------------------+-------------------------+ @@ -9306,9 +9305,9 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_199 | + | tickets_info | Variable | sequence of $X_187 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_695 | + | metadata | Determined from data | $X_683 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -9348,7 +9347,7 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_695 | + | metadata | Determined from data | $X_683 | +-----------------------+----------------------+---------------------------+ @@ -9370,7 +9369,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_198 | + | kind | 2 bytes | $X_186 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -9380,7 +9379,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1566 | + | metadata | Determined from data | $X_1542 | +-----------------------+----------------------+-------------------------+ @@ -9408,9 +9407,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_197 | + | message | Variable | sequence of $X_185 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1443 | + | metadata | Determined from data | $X_1419 | +------------------------------------------------+----------------------+-------------------------+ @@ -9438,7 +9437,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_335 | + | metadata | Determined from data | $X_323 | +------------------------------------------------+----------------------+-------------------------+ @@ -9464,9 +9463,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_196 | + | commitment | 76 bytes | $X_184 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1200 | + | metadata | Determined from data | $X_1176 | +------------------------------------------------+----------------------+-------------------------+ @@ -9498,7 +9497,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------------------+ | is_opening_move | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_820 | + | metadata | Determined from data | $X_808 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -9526,7 +9525,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | stakers | 42 bytes | $X_72 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_820 | + | metadata | Determined from data | $X_808 | +------------------------------------------------+----------------------+-------------------------+ @@ -9566,7 +9565,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+--------------------------------------------------------------+ | message | Variable | bytes | +------------------------------------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_695 | + | metadata | Determined from data | $X_683 | +------------------------------------------------+----------------------+--------------------------------------------------------------+ @@ -9590,7 +9589,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_571 | + | metadata | Determined from data | $X_559 | +---------------+----------------------+------------------------+ @@ -9618,7 +9617,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_453 | + | metadata | Determined from data | $X_441 | +------------------------------------------------+----------------------+-------------------------+ @@ -9642,11 +9641,11 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | slot | 9 bytes | $X_71 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_335 | + | metadata | Determined from data | $X_323 | +---------------+----------------------+------------------------+ - X_3911 (Determined from data, 8-bit tag) + X_3887 (Determined from data, 8-bit tag) **************************************** Operation_with_metadata (tag 0) @@ -9685,7 +9684,7 @@ Protocol Kathmandu +---------------------------------+----------+----------------------------------------------------+ - X_4438 (Variable, 8-bit tag) + X_4390 (Variable, 8-bit tag) **************************** Operation with too large metadata (tag 0) @@ -9724,7 +9723,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_3911 | + | Unnamed field 0 | Determined from data | $X_3887 | +-----------------+----------------------+------------------------+ @@ -9744,7 +9743,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_4438 | + | Unnamed field 0 | Variable | $X_4390 | +-----------------------+----------+-------------------------+ @@ -9952,7 +9951,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -10657,7 +10656,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -11448,7 +11447,7 @@ Protocol Kathmandu "ratio_of_frozen_deposits_slashed_per_double_endorsement": { "numerator": integer ∈ [0, 2^16-1], "denominator": integer ∈ [0, 2^16-1] }, - "testnet_dictator"?: $Signature.Public_key_hash, + "testnet_dictator"?: $Signature.V0.Public_key_hash, "initial_seed"?: $random, "cache_script_size": integer ∈ [-2^30, 2^30], "cache_stake_distribution_cycles": integer ∈ [-128, 127], @@ -11484,7 +11483,7 @@ Protocol Kathmandu "sc_rollup_max_active_outbox_levels": integer ∈ [-2^31-1, 2^31], "sc_rollup_max_outbox_messages_per_level": integer ∈ [-2^30, 2^30] } $014-PtKathma.mutez: $positive_bignum - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $bignum: @@ -11881,13 +11880,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -11923,400 +11922,227 @@ Protocol Kathmandu <div id="GET_..--block_id--context--contracts--contract_idoutput.json" class="GET_..--block_id--context--contracts--contract_id tabcontent"> <pre> { "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script"?: $014-PtKathma.scripted.contracts, "counter"?: $positive_bignum } - $014-PtKathma.michelson.v1.primitives: - "ABS" - | "IF" - | "SOURCE" - | "DUG" - | "False" - | "DIG" - | "SAPLING_VERIFY_UPDATE" - | "bls12_381_g1" - | "BLAKE2B" - | "key_hash" - | "sapling_transaction_deprecated" - | "Pair" - | "INT" - | "map" - | "sapling_transaction" - | "storage" - | "RIGHT" - | "view" - | "SHA256" - | "AND" - | "VIEW" - | "signature" - | "NIL" - | "lambda" - | "STEPS_TO_QUOTA" - | "RENAME" - | "CHECK_SIGNATURE" - | "NEVER" - | "timestamp" - | "MAP" - | "big_map" - | "chain_id" - | "ADD" - | "IMPLICIT_ACCOUNT" - | "SHA512" - | "bool" - | "LSL" - | "chest" - | "never" - | "sapling_state" - | "operation" - | "COMPARE" - | "SUB_MUTEZ" - | "SLICE" - | "DROP" - | "option" - | "BALANCE" - | "CONCAT" - | "ticket" - | "MUL" - | "FAILWITH" - | "Elt" - | "key" - | "MIN_BLOCK_TIME" - | "DIP" - | "MEM" - | "XOR" - | "int" - | "UPDATE" - | "Some" - | "parameter" - | "unit" - | "EMPTY_MAP" - | "None" - | "SWAP" - | "nat" - | "AMOUNT" - | "pair" - | "KECCAK" - | "set" - | "CHAIN_ID" - | "HASH_KEY" - | "IF_LEFT" - | "CREATE_ACCOUNT" - | "LT" - | "VOTING_POWER" - | "UNPACK" - | "TICKET" - | "SELF" - | "bytes" - | "TRANSFER_TOKENS" - | "LE" - | "SOME" - | "CREATE_CONTRACT" - | "Unit" - | "SAPLING_EMPTY_STATE" - | "NONE" - | "ADDRESS" - | "GE" - | "SIZE" - | "contract" - | "SENDER" - | "or" - | "CAR" - | "NOT" - | "mutez" - | "CDR" - | "ITER" - | "SHA3" - | "PUSH" - | "LEFT" - | "ISNAT" - | "True" - | "Right" - | "PACK" - | "IF_CONS" - | "TOTAL_VOTING_POWER" - | "bls12_381_g2" - | "SET_DELEGATE" - | "EMPTY_SET" - | "NEQ" - | "LAMBDA" - | "string" - | "PAIRING_CHECK" - | "LOOP" - | "Left" - | "EMIT" - | "constant" - | "LSR" - | "EMPTY_BIG_MAP" - | "address" - | "SPLIT_TICKET" - | "LEVEL" - | "PAIR" - | "READ_TICKET" - | "list" - | "UNPAIR" - | "GT" - | "bls12_381_fr" - | "tx_rollup_l2_address" - | "NOW" - | "IF_NONE" - | "OR" - | "GET_AND_UPDATE" - | "UNIT" - | "CONTRACT" - | "CAST" - | "JOIN_TICKETS" - | "EDIV" - | "EQ" - | "LOOP_LEFT" - | "chest_key" - | "OPEN_CHEST" - | "EXEC" - | "GET" - | "NEG" - | "SELF_ADDRESS" - | "DUP" - | "CONS" - | "SUB" - | "APPLY" - | "code" - $014-PtKathma.mutez: $positive_bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } - $Signature.Public_key_hash: - /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ - $unistring - $bignum: - /* Big number - Decimal representation of a big number */ - string - $micheline.014-PtKathma.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.014-PtKathma.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $014-PtKathma.michelson.v1.primitives, - "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } - $positive_bignum: - /* Positive big number - Decimal representation of a positive big number */ - string - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> - </div> - <div id="GET_..--block_id--context--contracts--contract_idoutput.bin" class="GET_..--block_id--context--contracts--contract_id tabcontent"> - <pre> - +--------------------------------+----------------------+-------------------------------------+ - | Name | Size | Contents | - +================================+======================+=====================================+ - | balance | Determined from data | $N.t | - +--------------------------------+----------------------+-------------------------------------+ - | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | - +--------------------------------+----------------------+-------------------------------------+ - | delegate | 21 bytes | $public_key_hash | - +--------------------------------+----------------------+-------------------------------------+ - | ? presence of field "script" | 1 byte | boolean (0 for false, 255 for true) | - +--------------------------------+----------------------+-------------------------------------+ - | script | Determined from data | $014-PtKathma.scripted.contracts | - +--------------------------------+----------------------+-------------------------------------+ - | ? presence of field "counter" | 1 byte | boolean (0 for false, 255 for true) | - +--------------------------------+----------------------+-------------------------------------+ - | counter | Determined from data | $N.t | - +--------------------------------+----------------------+-------------------------------------+ - - - N.t - *** - - A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. - - +------+----------------------+----------+ - | Name | Size | Contents | - +======+======================+==========+ - | N.t | Determined from data | bytes | - +------+----------------------+----------+ - - - public_key_hash (21 bytes, 8-bit tag) - ************************************* - - Ed25519 (tag 0) - =============== - - +-------------------------+----------+------------------------+ - | Name | Size | Contents | - +=========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------------------+----------+------------------------+ - | Ed25519.Public_key_hash | 20 bytes | bytes | - +-------------------------+----------+------------------------+ - - - Secp256k1 (tag 1) - ================= - - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Secp256k1.Public_key_hash | 20 bytes | bytes | - +---------------------------+----------+------------------------+ - - - P256 (tag 2) - ============ - - +----------------------+----------+------------------------+ - | Name | Size | Contents | - +======================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +----------------------+----------+------------------------+ - | P256.Public_key_hash | 20 bytes | bytes | - +----------------------+----------+------------------------+ - - - 014-PtKathma.scripted.contracts - ******************************* - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | code | Variable | bytes | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | storage | Variable | bytes | - +-----------------------+----------+-------------------------+ - - </pre> - </div> - - -.. _GET_..--block_id--context--contracts--contract_id--balance : - -**GET ../<block_id>/context/contracts/<contract_id>/balance** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balancedescr', 'GET_..--block_id--context--contracts--contract_id--balance')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance')">Binary output</button> - </div><div id="GET_..--block_id--context--contracts--contract_id--balancedescr" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> - <p> - Access the spendable balance of a contract, excluding frozen bonds.</p> - </div> - <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> - <pre> - $positive_bignum - $positive_bignum: - /* Positive big number - Decimal representation of a positive big number */ - string</pre> - </div> - <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> - <pre> - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $N.t | - +-----------------+----------------------+----------+ - - - N.t - *** - - A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. - - +------+----------------------+----------+ - | Name | Size | Contents | - +======+======================+==========+ - | N.t | Determined from data | bytes | - +------+----------------------+----------+ - - </pre> - </div> - - - -.. _GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds : - -**GET ../<block_id>/context/contracts/<contract_id>/balance_and_frozen_bonds** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Binary output</button> - </div><div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> - <p> - Access the sum of the spendable balance and frozen bonds of a contract. This sum is part of the contract's stake, and it is exactly the contract's stake if the contract is not a delegate.</p> - </div> - <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> - <pre> - $positive_bignum - $positive_bignum: - /* Positive big number - Decimal representation of a positive big number */ - string</pre> - </div> - <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> - <pre> - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $N.t | - +-----------------+----------------------+----------+ - - - N.t - *** - - A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. - - +------+----------------------+----------+ - | Name | Size | Contents | - +======+======================+==========+ - | N.t | Determined from data | bytes | - +------+----------------------+----------+ - - </pre> - </div> - - - -.. _POST_..--block_id--context--contracts--contract_id--big_map_get : - -**POST ../<block_id>/context/contracts/<contract_id>/big_map_get** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getdescr', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Description</button> - <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json input</button> - <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary input</button> - <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary output</button> - </div><div id="POST_..--block_id--context--contracts--contract_id--big_map_getdescr" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> - <p> - Access the value associated with a key in a big map of the contract (deprecated).</p> - </div> - <div id="POST_..--block_id--context--contracts--contract_id--big_map_getinput.json" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> - <pre> - { "key": $micheline.014-PtKathma.michelson_v1.expression, - "type": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.mutez: $positive_bignum + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } + $Signature.V0.Public_key_hash: + /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ + $unistring + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_idoutput.bin" class="GET_..--block_id--context--contracts--contract_id tabcontent"> + <pre> + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "script" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $014-PtKathma.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "counter" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + 014-PtKathma.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--contracts--contract_id--balance : + +**GET ../<block_id>/context/contracts/<contract_id>/balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balancedescr', 'GET_..--block_id--context--contracts--contract_id--balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--balancedescr" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <p> + Access the spendable balance of a contract, excluding frozen bonds.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds : + +**GET ../<block_id>/context/contracts/<contract_id>/balance_and_frozen_bonds** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <p> + Access the sum of the spendable balance and frozen bonds of a contract. This sum is part of the contract's stake, and it is exactly the contract's stake if the contract is not a delegate.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _POST_..--block_id--context--contracts--contract_id--big_map_get : + +**POST ../<block_id>/context/contracts/<contract_id>/big_map_get** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getdescr', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary output</button> + </div><div id="POST_..--block_id--context--contracts--contract_id--big_map_getdescr" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <p> + Access the value associated with a key in a big map of the contract (deprecated).</p> + </div> + <div id="POST_..--block_id--context--contracts--contract_id--big_map_getinput.json" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <pre> + { "key": $micheline.014-PtKathma.michelson_v1.expression, + "type": $micheline.014-PtKathma.michelson_v1.expression } $014-PtKathma.michelson.v1.primitives: "ABS" | "IF" @@ -12488,7 +12314,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -13181,7 +13007,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -13792,11 +13618,11 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--context--contracts--contract_id--delegateoutput.bin" class="GET_..--block_id--context--contracts--contract_id--delegate tabcontent"> <pre> - +---------------------------+----------+------------------+ - | Name | Size | Contents | - +===========================+==========+==================+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------+ + +------------------------------+----------+------------------+ + | Name | Size | Contents | + +==============================+==========+==================+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------+ public_key_hash (21 bytes, 8-bit tag) @@ -14031,7 +13857,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -14776,7 +14602,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -15354,8 +15180,8 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--context--contracts--contract_id--manager_keyoutput.json" class="GET_..--block_id--context--contracts--contract_id--manager_key tabcontent"> <pre> - $Signature.Public_key /* Some */ || null /* None */ - $Signature.Public_key: + $Signature.V0.Public_key /* Some */ || null /* None */ + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring $unistring: @@ -15428,13 +15254,13 @@ Protocol Kathmandu Some (tag 1) ============ - +----------------------+----------------------+------------------------+ - | Name | Size | Contents | - +======================+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +----------------------+----------------------+------------------------+ - | Signature.Public_key | Determined from data | $public_key | - +----------------------+----------------------+------------------------+ + +-------------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=========================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------------------+------------------------+ + | Signature.V0.Public_key | Determined from data | $public_key | + +-------------------------+----------------------+------------------------+ </pre> </div> @@ -15456,185 +15282,8 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.json" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> <pre> - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } - $014-PtKathma.michelson.v1.primitives: - "ABS" - | "IF" - | "SOURCE" - | "DUG" - | "False" - | "DIG" - | "SAPLING_VERIFY_UPDATE" - | "bls12_381_g1" - | "BLAKE2B" - | "key_hash" - | "sapling_transaction_deprecated" - | "Pair" - | "INT" - | "map" - | "sapling_transaction" - | "storage" - | "RIGHT" - | "view" - | "SHA256" - | "AND" - | "VIEW" - | "signature" - | "NIL" - | "lambda" - | "STEPS_TO_QUOTA" - | "RENAME" - | "CHECK_SIGNATURE" - | "NEVER" - | "timestamp" - | "MAP" - | "big_map" - | "chain_id" - | "ADD" - | "IMPLICIT_ACCOUNT" - | "SHA512" - | "bool" - | "LSL" - | "chest" - | "never" - | "sapling_state" - | "operation" - | "COMPARE" - | "SUB_MUTEZ" - | "SLICE" - | "DROP" - | "option" - | "BALANCE" - | "CONCAT" - | "ticket" - | "MUL" - | "FAILWITH" - | "Elt" - | "key" - | "MIN_BLOCK_TIME" - | "DIP" - | "MEM" - | "XOR" - | "int" - | "UPDATE" - | "Some" - | "parameter" - | "unit" - | "EMPTY_MAP" - | "None" - | "SWAP" - | "nat" - | "AMOUNT" - | "pair" - | "KECCAK" - | "set" - | "CHAIN_ID" - | "HASH_KEY" - | "IF_LEFT" - | "CREATE_ACCOUNT" - | "LT" - | "VOTING_POWER" - | "UNPACK" - | "TICKET" - | "SELF" - | "bytes" - | "TRANSFER_TOKENS" - | "LE" - | "SOME" - | "CREATE_CONTRACT" - | "Unit" - | "SAPLING_EMPTY_STATE" - | "NONE" - | "ADDRESS" - | "GE" - | "SIZE" - | "contract" - | "SENDER" - | "or" - | "CAR" - | "NOT" - | "mutez" - | "CDR" - | "ITER" - | "SHA3" - | "PUSH" - | "LEFT" - | "ISNAT" - | "True" - | "Right" - | "PACK" - | "IF_CONS" - | "TOTAL_VOTING_POWER" - | "bls12_381_g2" - | "SET_DELEGATE" - | "EMPTY_SET" - | "NEQ" - | "LAMBDA" - | "string" - | "PAIRING_CHECK" - | "LOOP" - | "Left" - | "EMIT" - | "constant" - | "LSR" - | "EMPTY_BIG_MAP" - | "address" - | "SPLIT_TICKET" - | "LEVEL" - | "PAIR" - | "READ_TICKET" - | "list" - | "UNPAIR" - | "GT" - | "bls12_381_fr" - | "tx_rollup_l2_address" - | "NOW" - | "IF_NONE" - | "OR" - | "GET_AND_UPDATE" - | "UNIT" - | "CONTRACT" - | "CAST" - | "JOIN_TICKETS" - | "EDIV" - | "EQ" - | "LOOP_LEFT" - | "chest_key" - | "OPEN_CHEST" - | "EXEC" - | "GET" - | "NEG" - | "SELF_ADDRESS" - | "DUP" - | "CONS" - | "SUB" - | "APPLY" - | "code" - $bignum: - /* Big number - Decimal representation of a big number */ - string - $micheline.014-PtKathma.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.014-PtKathma.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $014-PtKathma.michelson.v1.primitives, - "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + { "code": any, + "storage": any }</pre> </div> <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.bin" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> <pre> @@ -15930,7 +15579,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -16462,8 +16111,8 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--context--delegatesoutput.json" class="GET_..--block_id--context--delegates tabcontent"> <pre> - [ $Signature.Public_key_hash ... ] - $Signature.Public_key_hash: + [ $Signature.V0.Public_key_hash ... ] + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -16676,13 +16325,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -16908,13 +16557,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -17363,116 +17012,3941 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_0 (22 bytes, 8-bit tag) - ************************* + X_0 (22 bytes, 8-bit tag) + ************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree : + +**GET ../<block_id>/context/merkle_tree(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_treedescr', 'GET_..--block_id--context--merkle_tree')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.json', 'GET_..--block_id--context--merkle_tree')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.bin', 'GET_..--block_id--context--merkle_tree')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_treedescr" class="GET_..--block_id--context--merkle_tree tabcontent"> + <p> + Returns the merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.json" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + $merkle_tree /* Some */ || null /* None */ + $merkle_tree: + [ [ $unistring, + [ boolean, $unistring ] + /* Hash */ + || $raw_context + /* Data */ + || $merkle_tree + /* Continue */ ] ... ] + $raw_context: + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* Key */ + || { /* Dir */ + *: $raw_context } + || null + /* Cut */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.bin" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_8 | + +-----------------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------+----------------------+--------------+ + | Name | Size | Contents | + +=================+======================+==============+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+--------------+ + | Unnamed field 1 | Determined from data | $raw_context | + +-----------------+----------------------+--------------+ + + + raw_context (Determined from data, 8-bit tag) + ********************************************* + + Key (tag 0) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Dir (tag 1) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Cut (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_7 (Determined from data, 8-bit tag) + ************************************* + + Hash (tag 0) + ============ + + +-----------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 1 | Determined from data | $X_2 | + +-----------------+----------------------+-------------------------------------+ + + + Data (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $raw_context | + +-----------------+----------------------+------------------------+ + + + Continue (tag 2) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_7 | + +-----------------+----------------------+----------+ + + + merkle_tree + *********** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + + + X_8 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree_v2 : + +**GET ../<block_id>/context/merkle_tree_v2(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2descr', 'GET_..--block_id--context--merkle_tree_v2')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.json', 'GET_..--block_id--context--merkle_tree_v2')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.bin', 'GET_..--block_id--context--merkle_tree_v2')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_tree_v2descr" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <p> + Returns the Irmin merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.json" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + { /* Some */ + "version": integer ∈ [-2^15, 2^15-1], + "before": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "after": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "state": $tree_encoding } + || null + /* None */ + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $inode_tree: + { /* Inode_tree */ + "inode_tree": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Inode_values */ + "inode_values": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Blinded_inode */ + "blinded_inode": $Context_hash } + || { /* Inode_extender */ + "inode_extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $tree_encoding: + { /* Inode */ + "inode": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_trees */ + "other_trees": + { /* Node */ + "node": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_trees */ + "other_trees": + { /* Value */ + "value": + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* short_bytes */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* medium_bytes */ + || any + /* long_bytes + This case is void. No data is accepted. */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* unlimited_bytes */ } + || { /* Blinded_value */ + "blinded_value": $Context_hash } + || { /* Blinded_node */ + "blinded_node": $Context_hash } + || { /* Extender */ + "extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.bin" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_53821 | + +-----------------+----------------------+----------+ + + + X_0 + *** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_5 + *** + + +-----------------+----------------------+----------------+ + | Name | Size | Contents | + +=================+======================+================+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------------+ + | Unnamed field 1 | Determined from data | $tree_encoding | + +-----------------+----------------------+----------------+ + + + X_132 + ***** + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + X_131 + ***** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_132 | + +-----------------------+----------+-------------------------+ + + + inode_tree (Determined from data, 8-bit tag) + ******************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 186 (tag 186) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 187 (tag 187) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 188 (tag 188) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 189 (tag 189) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 190 (tag 190) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 191 (tag 191) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_5 | + +-----------------------+----------+-------------------------+ + + + case 192 (tag 192) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 209 (tag 209) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 210 (tag 210) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 211 (tag 211) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + tree_encoding (Determined from data, 8-bit tag) + *********************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 186 (tag 186) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 187 (tag 187) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ + - Originated (tag 1) + case 188 (tag 188) ================== - +---------------+----------+------------------------+ - | Name | Size | Contents | - +===============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------+----------+------------------------+ - | Contract_hash | 20 bytes | bytes | - +---------------+----------+------------------------+ - | padding | 1 byte | padding | - +---------------+----------+------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ - </pre> - </div> - - - -.. _GET_..--block_id--context--merkle_tree : - -**GET ../<block_id>/context/merkle_tree(/<context_path>)*?[holey=<bool>]** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_treedescr', 'GET_..--block_id--context--merkle_tree')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.json', 'GET_..--block_id--context--merkle_tree')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.bin', 'GET_..--block_id--context--merkle_tree')">Binary output</button> - </div><div id="GET_..--block_id--context--merkle_treedescr" class="GET_..--block_id--context--merkle_tree tabcontent"> - <p> - Returns the merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> - </div> - <div id="GET_..--block_id--context--merkle_treeoutput.json" class="GET_..--block_id--context--merkle_tree tabcontent"> - <pre> - $merkle_tree /* Some */ || null /* None */ - $merkle_tree: - [ [ $unistring, - [ boolean, $unistring ] - /* Hash */ - || $raw_context - /* Data */ - || $merkle_tree - /* Continue */ ] ... ] - $raw_context: - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ - /* Key */ - || { /* Dir */ - *: $raw_context } - || null - /* Cut */ - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> - </div> - <div id="GET_..--block_id--context--merkle_treeoutput.bin" class="GET_..--block_id--context--merkle_tree tabcontent"> - <pre> - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | - +-----------------+----------------------+----------+ + case 189 (tag 189) + ================== - X_2 - *** + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 190 (tag 190) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 191 (tag 191) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | bytes | + | Unnamed field 0 | Variable | sequence of $X_5 | +-----------------------+----------+-------------------------+ - X_3 - *** - - +-----------------+----------------------+--------------+ - | Name | Size | Contents | - +=================+======================+==============+ - | Unnamed field 0 | Determined from data | $X_2 | - +-----------------+----------------------+--------------+ - | Unnamed field 1 | Determined from data | $raw_context | - +-----------------+----------------------+--------------+ + case 192 (tag 192) + ================== + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ - raw_context (Determined from data, 8-bit tag) - ********************************************* - Key (tag 0) - =========== + case 193 (tag 193) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | + | # bytes in next field | 2 bytes | unsigned 16-bit integer | +-----------------------+----------+-------------------------+ | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - Dir (tag 1) - =========== + case 195 (tag 195) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | @@ -17481,12 +20955,100 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_3 | + | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - Cut (tag 2) - =========== + case 200 (tag 200) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 216 (tag 216) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 217 (tag 217) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 218 (tag 218) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 219 (tag 219) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== +------+--------+------------------------+ | Name | Size | Contents | @@ -17495,73 +21057,83 @@ Protocol Kathmandu +------+--------+------------------------+ - X_7 (Determined from data, 8-bit tag) - ************************************* - - Hash (tag 0) - ============ - - +-----------------+----------------------+-------------------------------------+ - | Name | Size | Contents | - +=================+======================+=====================================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------------------+-------------------------------------+ - | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | - +-----------------+----------------------+-------------------------------------+ - | Unnamed field 1 | Determined from data | $X_2 | - +-----------------+----------------------+-------------------------------------+ - + X_53820 (Determined from data, 8-bit tag) + ***************************************** - Data (tag 1) - ============ + case 0 (tag 0) + ============== +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $raw_context | + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | +-----------------+----------------------+------------------------+ - Continue (tag 2) - ================ + case 1 (tag 1) + ============== +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $merkle_tree | + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | +-----------------+----------------------+------------------------+ - X_1 - *** + case 2 (tag 2) + ============== - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_2 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_7 | - +-----------------+----------------------+----------+ + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ - merkle_tree - *********** + case 3 (tag 3) + ============== - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_1 | - +-----------------------+----------+-------------------------+ + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ - X_8 (Determined from data, 8-bit tag) - ************************************* + X_53821 (Determined from data, 8-bit tag) + ***************************************** None (tag 0) ============ @@ -17581,7 +21153,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $merkle_tree | + | Unnamed field 0 | Determined from data | $X_53820 | +-----------------+----------------------+------------------------+ </pre> @@ -18029,7 +21601,7 @@ Protocol Kathmandu "predecessor": $Commitment_hash /* Some */ || null /* None */, "inbox_merkle_root": $Inbox_list_hash }, "commitment_hash": $Commitment_hash, - "committer": $Signature.Public_key_hash, + "committer": $Signature.V0.Public_key_hash, "submitted_at": integer ∈ [-2^31-1, 2^31], "finalized_at"?: integer ∈ [-2^31-1, 2^31] } || null @@ -18046,7 +21618,7 @@ Protocol Kathmandu $Message_result_list_hash: /* A merklised message result list hash (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -18588,7 +22160,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.liquidity_baking_toggle_vote: "off" | "on" | "pass" $Chain_id: /* Network identifier (Base58Check-encoded) */ @@ -18599,7 +22171,7 @@ Protocol Kathmandu $Operation_list_list_hash: /* A list of list of operations (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring $block_hash: @@ -18708,9 +22280,9 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.liquidity_baking_toggle_vote: "off" | "on" | "pass" - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring $cycle_nonce: @@ -19097,7 +22669,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature }, + "signature": $Signature.V0 }, "operations": [ [ $next_operation ... ] ... ] } $014-PtKathma.block_header.alpha.full_header: /* Shell header @@ -19117,7 +22689,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a @@ -19136,13 +22708,13 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.inlined.endorsement: /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -19154,7 +22726,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -19163,159 +22735,6 @@ Protocol Kathmandu "round": integer ∈ [-2^31-1, 2^31], "block_payload_hash": $value_hash } $014-PtKathma.liquidity_baking_toggle_vote: "off" | "on" | "pass" - $014-PtKathma.michelson.v1.primitives: - "ABS" - | "IF" - | "SOURCE" - | "DUG" - | "False" - | "DIG" - | "SAPLING_VERIFY_UPDATE" - | "bls12_381_g1" - | "BLAKE2B" - | "key_hash" - | "sapling_transaction_deprecated" - | "Pair" - | "INT" - | "map" - | "sapling_transaction" - | "storage" - | "RIGHT" - | "view" - | "SHA256" - | "AND" - | "VIEW" - | "signature" - | "NIL" - | "lambda" - | "STEPS_TO_QUOTA" - | "RENAME" - | "CHECK_SIGNATURE" - | "NEVER" - | "timestamp" - | "MAP" - | "big_map" - | "chain_id" - | "ADD" - | "IMPLICIT_ACCOUNT" - | "SHA512" - | "bool" - | "LSL" - | "chest" - | "never" - | "sapling_state" - | "operation" - | "COMPARE" - | "SUB_MUTEZ" - | "SLICE" - | "DROP" - | "option" - | "BALANCE" - | "CONCAT" - | "ticket" - | "MUL" - | "FAILWITH" - | "Elt" - | "key" - | "MIN_BLOCK_TIME" - | "DIP" - | "MEM" - | "XOR" - | "int" - | "UPDATE" - | "Some" - | "parameter" - | "unit" - | "EMPTY_MAP" - | "None" - | "SWAP" - | "nat" - | "AMOUNT" - | "pair" - | "KECCAK" - | "set" - | "CHAIN_ID" - | "HASH_KEY" - | "IF_LEFT" - | "CREATE_ACCOUNT" - | "LT" - | "VOTING_POWER" - | "UNPACK" - | "TICKET" - | "SELF" - | "bytes" - | "TRANSFER_TOKENS" - | "LE" - | "SOME" - | "CREATE_CONTRACT" - | "Unit" - | "SAPLING_EMPTY_STATE" - | "NONE" - | "ADDRESS" - | "GE" - | "SIZE" - | "contract" - | "SENDER" - | "or" - | "CAR" - | "NOT" - | "mutez" - | "CDR" - | "ITER" - | "SHA3" - | "PUSH" - | "LEFT" - | "ISNAT" - | "True" - | "Right" - | "PACK" - | "IF_CONS" - | "TOTAL_VOTING_POWER" - | "bls12_381_g2" - | "SET_DELEGATE" - | "EMPTY_SET" - | "NEQ" - | "LAMBDA" - | "string" - | "PAIRING_CHECK" - | "LOOP" - | "Left" - | "EMIT" - | "constant" - | "LSR" - | "EMPTY_BIG_MAP" - | "address" - | "SPLIT_TICKET" - | "LEVEL" - | "PAIR" - | "READ_TICKET" - | "list" - | "UNPAIR" - | "GT" - | "bls12_381_fr" - | "tx_rollup_l2_address" - | "NOW" - | "IF_NONE" - | "OR" - | "GET_AND_UPDATE" - | "UNIT" - | "CONTRACT" - | "CAST" - | "JOIN_TICKETS" - | "EDIV" - | "EQ" - | "LOOP_LEFT" - | "chest_key" - | "OPEN_CHEST" - | "EXEC" - | "GET" - | "NEG" - | "SELF_ADDRESS" - | "DUP" - | "CONS" - | "SUB" - | "APPLY" - | "code" $014-PtKathma.mutez: $positive_bignum $014-PtKathma.operation.alpha.contents: { /* Endorsement */ @@ -19332,7 +22751,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -19360,26 +22779,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19388,28 +22807,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19417,7 +22836,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19429,15 +22848,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19445,7 +22864,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19455,7 +22874,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19468,7 +22887,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19476,7 +22895,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19484,7 +22903,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19492,7 +22911,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19504,7 +22923,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -19565,7 +22984,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19576,27 +22995,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19607,7 +23026,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19618,10 +23037,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19630,7 +23049,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19639,7 +23058,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19653,13 +23072,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -19779,18 +23198,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19803,7 +23222,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19811,7 +23230,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -19823,9 +23242,8 @@ Protocol Kathmandu A smart contract rollup is identified by a base58 address starting with scr1 */ $unistring - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.tx_rollup_id: /* A tx rollup handle A tx rollup notation as given to an RPC or inside scripts, is a base58 @@ -19858,13 +23276,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -19924,27 +23342,12 @@ Protocol Kathmandu /* 64 bit integers Decimal representation of 64 bit integers */ string - $micheline.014-PtKathma.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.014-PtKathma.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $014-PtKathma.michelson.v1.primitives, - "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } $next_operation: /* An operation's shell header. */ { "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -20138,30 +23541,20 @@ Protocol Kathmandu X_9 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ - - - X_10 - **** - - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_9 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_13 + X_11 **** +-----------------+----------------------+------------------------+ @@ -20173,7 +23566,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_14 (Determined from data, 8-bit tag) + X_12 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -20186,7 +23579,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_13 | + | sparse_proof | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -20202,7 +23595,7 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_12 + X_10 **** +--------+----------------------+-----------------------+ @@ -20210,17 +23603,29 @@ Protocol Kathmandu +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_14 | + | proofs | Determined from data | $X_12 | +--------+----------------------+-----------------------+ - X_15 + X_14 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_13 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_9 | + | Unnamed field 0 | Determined from data | $X_14 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -20251,7 +23656,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_15 | + | inode_values | Variable | sequence of $X_13 | +-----------------------+----------+-------------------------+ @@ -20263,7 +23668,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_12 | + | inode_tree | Determined from data | $X_10 | +------------+----------------------+------------------------+ @@ -20275,7 +23680,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_10 | + | inode_extender | Determined from data | $X_9 | +----------------+----------------------+------------------------+ @@ -20328,7 +23733,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_15 | + | node | Variable | sequence of $X_13 | +-----------------------+----------+-------------------------+ @@ -20352,7 +23757,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_12 | + | inode | Determined from data | $X_10 | +-------+----------------------+------------------------+ @@ -20364,7 +23769,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_10 | + | extender | Determined from data | $X_9 | +----------+----------------------+------------------------+ @@ -20394,7 +23799,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_40 (Determined from data, 8-bit tag) + X_36 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -20425,7 +23830,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_41 (Determined from data, 8-bit tag) + X_37 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -20462,7 +23867,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_79 (Determined from data, 8-bit tag) + X_71 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -20475,9 +23880,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_5 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_40 | + | given | Determined from data | $X_36 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_41 | + | requested | Determined from data | $X_37 | +------------+----------------------+------------------------+ @@ -20491,13 +23896,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_5 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_40 | + | given | Determined from data | $X_36 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_41 | + | requested | Determined from data | $X_37 | +------------+----------------------+------------------------+ - X_82 + X_74 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -20513,7 +23918,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_81 + X_73 **** +------------------------------------------------+----------------------+-------------------------+ @@ -20535,11 +23940,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_82 | + | old_levels_messages | Determined from data | $X_74 | +------------------------------------------------+----------------------+-------------------------+ - X_83 + X_75 **** +-----------------------+----------+-------------------------+ @@ -20547,23 +23952,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_82 | + | Unnamed field 0 | Variable | sequence of $X_74 | +-----------------------+----------+-------------------------+ - X_80 + X_72 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_81 | + | Unnamed field 0 | Determined from data | $X_73 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_83 | + | Unnamed field 1 | Determined from data | $X_75 | +-----------------+----------------------+----------+ - X_123 (Determined from data, 8-bit tag) + X_111 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -20586,19 +23991,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_80 | + | skips | Variable | sequence of $X_72 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_81 | + | level | Determined from data | $X_73 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_82 | + | inc | Variable | sequence of $X_74 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_5 | +-----------------------+----------------------+-------------------------+ - X_125 (Determined from data, 8-bit tag) + X_113 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -20623,19 +24028,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_124 + X_112 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_125 | + | Unnamed field 0 | Determined from data | $X_113 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_126 (Determined from data, 8-bit tag) + X_114 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -20648,7 +24053,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_124 | + | Unnamed field 0 | Variable | sequence of $X_112 | +-----------------------+----------+-------------------------+ @@ -20660,9 +24065,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_79 | + | pvm_step | Determined from data | $X_71 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_123 | + | inbox | Determined from data | $X_111 | +----------+----------------------+------------------------+ @@ -20674,11 +24079,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_126 | + | step | Determined from data | $X_114 | +--------+----------------------+----------+ - X_127 + X_115 ***** +--------------------+----------+-----------------------+ @@ -20696,7 +24101,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_128 + X_116 ***** +-----------------------+----------+-------------------------+ @@ -20708,7 +24113,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_129 (2 bytes, 16-bit tag) + X_117 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -20737,13 +24142,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -20760,7 +24165,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_131 (Determined from data, 8-bit tag) + X_119 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -20811,7 +24216,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_130 + X_118 ***** +-----------------------+----------------------+---------------------------+ @@ -20827,13 +24232,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_131 | + | amount | Determined from data | $X_119 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_132 + X_120 ***** +-------------+----------------------+------------------+ @@ -20845,11 +24250,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_131 | + | amount | Determined from data | $X_119 | +-------------+----------------------+------------------+ - X_134 (Determined from data, 8-bit tag) + X_122 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -20874,11 +24279,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_132 | + | deposit | Determined from data | $X_120 | +---------+----------------------+------------------------+ - X_135 + X_123 ***** +--------------------+----------+----------+ @@ -20890,7 +24295,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_143 (33 bytes, 8-bit tag) + X_131 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -20917,19 +24322,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_141 + X_129 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_9 | + | Unnamed field 0 | Determined from data | $X_14 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_143 | + | Unnamed field 1 | 33 bytes | $X_131 | +-----------------+----------------------+----------+ - X_150 + X_138 ***** +-----------------+----------+----------+ @@ -20941,7 +24346,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_154 + X_142 ***** +-----------------+----------+----------+ @@ -20951,11 +24356,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_162 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_166 (Determined from data, 8-bit tag) + X_154 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -21016,7 +24417,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21030,7 +24431,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+-------------------------+ @@ -21044,7 +24445,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21058,7 +24459,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21072,7 +24473,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21086,7 +24487,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+-------------------------+ @@ -21100,7 +24501,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21114,7 +24515,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_154 | + | Unnamed field 1 | 32 bytes | $X_142 | +-----------------+----------+------------------------+ @@ -21128,7 +24529,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_150 | + | Unnamed field 1 | 64 bytes | $X_138 | +-----------------+----------+------------------------+ @@ -21142,7 +24543,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_150 | + | Unnamed field 1 | 64 bytes | $X_138 | +-----------------+----------+-------------------------+ @@ -21156,7 +24557,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_150 | + | Unnamed field 1 | 64 bytes | $X_138 | +-----------------+----------+------------------------+ @@ -21170,7 +24571,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_150 | + | Unnamed field 1 | 64 bytes | $X_138 | +-----------------+----------+------------------------+ @@ -21192,7 +24593,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_141 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_129 | +-----------------+----------+------------------------------+ @@ -21204,7 +24605,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_141 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_129 | +-----------------+----------+------------------------------+ @@ -21218,7 +24619,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_141 | + | Unnamed field 0 | Variable | sequence of $X_129 | +-----------------------+----------+-------------------------+ @@ -21274,7 +24675,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_9 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -21290,7 +24691,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_9 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -21306,7 +24707,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_9 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -21322,13 +24723,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_9 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_136 + X_124 ***** +-----------------------+----------+-------------------------+ @@ -21336,11 +24737,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_166 | + | Unnamed field 0 | Variable | sequence of $X_154 | +-----------------------+----------+-------------------------+ - X_260 (Determined from data, 8-bit tag) + X_248 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -21357,7 +24758,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_136 | + | Unnamed field 3 | Determined from data | $X_124 | +-----------------+----------------------+------------------------+ @@ -21375,7 +24776,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_136 | + | Unnamed field 3 | Determined from data | $X_124 | +-----------------+----------------------+------------------------+ @@ -21393,7 +24794,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_136 | + | Unnamed field 3 | Determined from data | $X_124 | +-----------------+----------------------+------------------------+ @@ -21411,11 +24812,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_136 | + | Unnamed field 3 | Determined from data | $X_124 | +-----------------+----------------------+------------------------+ - X_262 (Determined from data, 8-bit tag) + X_250 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -21440,7 +24841,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_261 + X_249 ***** +-----------------------+----------------------+-------------------------+ @@ -21452,7 +24853,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_262 | + | predecessor | Determined from data | $X_250 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -21570,7 +24971,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_263 + X_251 ***** +-----------------------+----------------------+--------------------------+ @@ -21623,7 +25024,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_264 + X_252 ***** +-----------------+-----------+----------+ @@ -21886,7 +25287,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_264 | + | solution | 200 bytes | $X_252 | +----------+-----------+------------------------+ @@ -22000,7 +25401,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_263 | + | parameters | Determined from data | $X_251 | +----------------------------------+----------------------+-------------------------------------+ @@ -22198,7 +25599,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_261 | + | commitment | Determined from data | $X_249 | +---------------+----------------------+------------------------+ @@ -22290,7 +25691,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_134 | + | message | Determined from data | $X_122 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -22304,13 +25705,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_135 | + | previous_message_result | 64 bytes | $X_123 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_260 | + | proof | Determined from data | $X_248 | +------------------------------+----------------------+-------------------------+ @@ -22346,7 +25747,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_130 | + | tickets_info | Variable | sequence of $X_118 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -22406,7 +25807,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_129 | + | kind | 2 bytes | $X_117 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -22442,7 +25843,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_128 | + | message | Variable | sequence of $X_116 | +------------------------------------------------+----------------------+-------------------------+ @@ -22494,7 +25895,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_127 | + | commitment | 76 bytes | $X_115 | +------------------------------------------------+----------------------+-------------------------+ @@ -22937,7 +26338,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a @@ -22956,13 +26357,13 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.inlined.endorsement: /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -22974,7 +26375,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -22983,159 +26384,6 @@ Protocol Kathmandu "round": integer ∈ [-2^31-1, 2^31], "block_payload_hash": $value_hash } $014-PtKathma.liquidity_baking_toggle_vote: "off" | "on" | "pass" - $014-PtKathma.michelson.v1.primitives: - "ABS" - | "IF" - | "SOURCE" - | "DUG" - | "False" - | "DIG" - | "SAPLING_VERIFY_UPDATE" - | "bls12_381_g1" - | "BLAKE2B" - | "key_hash" - | "sapling_transaction_deprecated" - | "Pair" - | "INT" - | "map" - | "sapling_transaction" - | "storage" - | "RIGHT" - | "view" - | "SHA256" - | "AND" - | "VIEW" - | "signature" - | "NIL" - | "lambda" - | "STEPS_TO_QUOTA" - | "RENAME" - | "CHECK_SIGNATURE" - | "NEVER" - | "timestamp" - | "MAP" - | "big_map" - | "chain_id" - | "ADD" - | "IMPLICIT_ACCOUNT" - | "SHA512" - | "bool" - | "LSL" - | "chest" - | "never" - | "sapling_state" - | "operation" - | "COMPARE" - | "SUB_MUTEZ" - | "SLICE" - | "DROP" - | "option" - | "BALANCE" - | "CONCAT" - | "ticket" - | "MUL" - | "FAILWITH" - | "Elt" - | "key" - | "MIN_BLOCK_TIME" - | "DIP" - | "MEM" - | "XOR" - | "int" - | "UPDATE" - | "Some" - | "parameter" - | "unit" - | "EMPTY_MAP" - | "None" - | "SWAP" - | "nat" - | "AMOUNT" - | "pair" - | "KECCAK" - | "set" - | "CHAIN_ID" - | "HASH_KEY" - | "IF_LEFT" - | "CREATE_ACCOUNT" - | "LT" - | "VOTING_POWER" - | "UNPACK" - | "TICKET" - | "SELF" - | "bytes" - | "TRANSFER_TOKENS" - | "LE" - | "SOME" - | "CREATE_CONTRACT" - | "Unit" - | "SAPLING_EMPTY_STATE" - | "NONE" - | "ADDRESS" - | "GE" - | "SIZE" - | "contract" - | "SENDER" - | "or" - | "CAR" - | "NOT" - | "mutez" - | "CDR" - | "ITER" - | "SHA3" - | "PUSH" - | "LEFT" - | "ISNAT" - | "True" - | "Right" - | "PACK" - | "IF_CONS" - | "TOTAL_VOTING_POWER" - | "bls12_381_g2" - | "SET_DELEGATE" - | "EMPTY_SET" - | "NEQ" - | "LAMBDA" - | "string" - | "PAIRING_CHECK" - | "LOOP" - | "Left" - | "EMIT" - | "constant" - | "LSR" - | "EMPTY_BIG_MAP" - | "address" - | "SPLIT_TICKET" - | "LEVEL" - | "PAIR" - | "READ_TICKET" - | "list" - | "UNPAIR" - | "GT" - | "bls12_381_fr" - | "tx_rollup_l2_address" - | "NOW" - | "IF_NONE" - | "OR" - | "GET_AND_UPDATE" - | "UNIT" - | "CONTRACT" - | "CAST" - | "JOIN_TICKETS" - | "EDIV" - | "EQ" - | "LOOP_LEFT" - | "chest_key" - | "OPEN_CHEST" - | "EXEC" - | "GET" - | "NEG" - | "SELF_ADDRESS" - | "DUP" - | "CONS" - | "SUB" - | "APPLY" - | "code" $014-PtKathma.mutez: $positive_bignum $014-PtKathma.operation.alpha.contents: { /* Endorsement */ @@ -23152,7 +26400,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -23180,26 +26428,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23208,28 +26456,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23237,7 +26485,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23249,15 +26497,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23265,7 +26513,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23275,7 +26523,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23288,7 +26536,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23296,7 +26544,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23304,7 +26552,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23312,7 +26560,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23324,7 +26572,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -23385,7 +26633,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23396,27 +26644,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23427,7 +26675,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23438,10 +26686,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23450,7 +26698,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23459,7 +26707,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23473,13 +26721,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -23599,18 +26847,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23623,7 +26871,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23631,7 +26879,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -23643,9 +26891,8 @@ Protocol Kathmandu A smart contract rollup is identified by a base58 address starting with scr1 */ $unistring - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.tx_rollup_id: /* A tx rollup handle A tx rollup notation as given to an RPC or inside scripts, is a base58 @@ -23678,13 +26925,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -23744,27 +26991,12 @@ Protocol Kathmandu /* 64 bit integers Decimal representation of 64 bit integers */ string - $micheline.014-PtKathma.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.014-PtKathma.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $014-PtKathma.michelson.v1.primitives, - "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } $next_operation: /* An operation's shell header. */ { "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -23932,32 +27164,22 @@ Protocol Kathmandu X_7 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_8 + X_9 *** - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_7 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ - - - X_11 - **** - +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ @@ -23967,7 +27189,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_12 (Determined from data, 8-bit tag) + X_10 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -23980,7 +27202,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_11 | + | sparse_proof | Variable | sequence of $X_9 | +-----------------------+----------+-------------------------+ @@ -23996,25 +27218,37 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_10 - **** + X_8 + *** +--------+----------------------+-----------------------+ | Name | Size | Contents | +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_12 | + | proofs | Determined from data | $X_10 | +--------+----------------------+-----------------------+ - X_13 + X_12 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_11 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -24045,7 +27279,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_13 | + | inode_values | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -24057,7 +27291,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_10 | + | inode_tree | Determined from data | $X_8 | +------------+----------------------+------------------------+ @@ -24069,7 +27303,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_8 | + | inode_extender | Determined from data | $X_7 | +----------------+----------------------+------------------------+ @@ -24122,7 +27356,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_13 | + | node | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -24146,7 +27380,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_10 | + | inode | Determined from data | $X_8 | +-------+----------------------+------------------------+ @@ -24158,7 +27392,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_8 | + | extender | Determined from data | $X_7 | +----------+----------------------+------------------------+ @@ -24188,7 +27422,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_38 (Determined from data, 8-bit tag) + X_34 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -24219,7 +27453,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_39 (Determined from data, 8-bit tag) + X_35 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -24256,7 +27490,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_77 (Determined from data, 8-bit tag) + X_69 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -24269,9 +27503,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ @@ -24285,13 +27519,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ - X_80 + X_72 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -24307,7 +27541,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_79 + X_71 **** +------------------------------------------------+----------------------+-------------------------+ @@ -24329,11 +27563,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_80 | + | old_levels_messages | Determined from data | $X_72 | +------------------------------------------------+----------------------+-------------------------+ - X_81 + X_73 **** +-----------------------+----------+-------------------------+ @@ -24341,23 +27575,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_80 | + | Unnamed field 0 | Variable | sequence of $X_72 | +-----------------------+----------+-------------------------+ - X_78 + X_70 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_79 | + | Unnamed field 0 | Determined from data | $X_71 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_81 | + | Unnamed field 1 | Determined from data | $X_73 | +-----------------+----------------------+----------+ - X_121 (Determined from data, 8-bit tag) + X_109 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -24380,19 +27614,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_78 | + | skips | Variable | sequence of $X_70 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_79 | + | level | Determined from data | $X_71 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_80 | + | inc | Variable | sequence of $X_72 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_3 | +-----------------------+----------------------+-------------------------+ - X_123 (Determined from data, 8-bit tag) + X_111 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -24417,19 +27651,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_122 + X_110 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_123 | + | Unnamed field 0 | Determined from data | $X_111 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_124 (Determined from data, 8-bit tag) + X_112 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -24442,7 +27676,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_122 | + | Unnamed field 0 | Variable | sequence of $X_110 | +-----------------------+----------+-------------------------+ @@ -24454,9 +27688,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_77 | + | pvm_step | Determined from data | $X_69 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_121 | + | inbox | Determined from data | $X_109 | +----------+----------------------+------------------------+ @@ -24468,11 +27702,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_124 | + | step | Determined from data | $X_112 | +--------+----------------------+----------+ - X_125 + X_113 ***** +--------------------+----------+-----------------------+ @@ -24490,7 +27724,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_126 + X_114 ***** +-----------------------+----------+-------------------------+ @@ -24502,7 +27736,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_127 (2 bytes, 16-bit tag) + X_115 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -24531,13 +27765,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -24554,7 +27788,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_129 (Determined from data, 8-bit tag) + X_117 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -24605,7 +27839,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_128 + X_116 ***** +-----------------------+----------------------+---------------------------+ @@ -24621,13 +27855,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_130 + X_118 ***** +-------------+----------------------+------------------+ @@ -24639,11 +27873,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-------------+----------------------+------------------+ - X_132 (Determined from data, 8-bit tag) + X_120 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -24668,11 +27902,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_130 | + | deposit | Determined from data | $X_118 | +---------+----------------------+------------------------+ - X_133 + X_121 ***** +--------------------+----------+----------+ @@ -24684,7 +27918,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_141 (33 bytes, 8-bit tag) + X_129 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -24711,19 +27945,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_139 + X_127 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_141 | + | Unnamed field 1 | 33 bytes | $X_129 | +-----------------+----------------------+----------+ - X_148 + X_136 ***** +-----------------+----------+----------+ @@ -24735,7 +27969,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_152 + X_140 ***** +-----------------+----------+----------+ @@ -24745,11 +27979,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_160 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_164 (Determined from data, 8-bit tag) + X_152 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -24810,7 +28040,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24824,7 +28054,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -24838,7 +28068,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24852,7 +28082,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24866,7 +28096,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24880,7 +28110,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -24894,7 +28124,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24908,7 +28138,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -24922,7 +28152,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -24936,7 +28166,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+-------------------------+ @@ -24950,7 +28180,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -24964,7 +28194,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -24986,7 +28216,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_127 | +-----------------+----------+------------------------------+ @@ -24998,7 +28228,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_127 | +-----------------+----------+------------------------------+ @@ -25012,7 +28242,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_139 | + | Unnamed field 0 | Variable | sequence of $X_127 | +-----------------------+----------+-------------------------+ @@ -25068,7 +28298,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -25084,7 +28314,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -25100,7 +28330,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -25116,13 +28346,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_134 + X_122 ***** +-----------------------+----------+-------------------------+ @@ -25130,11 +28360,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_164 | + | Unnamed field 0 | Variable | sequence of $X_152 | +-----------------------+----------+-------------------------+ - X_258 (Determined from data, 8-bit tag) + X_246 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -25151,7 +28381,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -25169,7 +28399,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -25187,7 +28417,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -25205,11 +28435,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ - X_260 (Determined from data, 8-bit tag) + X_248 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -25234,7 +28464,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_259 + X_247 ***** +-----------------------+----------------------+-------------------------+ @@ -25246,7 +28476,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_260 | + | predecessor | Determined from data | $X_248 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -25364,7 +28594,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_261 + X_249 ***** +-----------------------+----------------------+--------------------------+ @@ -25417,7 +28647,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_262 + X_250 ***** +-----------------+-----------+----------+ @@ -25680,7 +28910,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_262 | + | solution | 200 bytes | $X_250 | +----------+-----------+------------------------+ @@ -25794,7 +29024,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+-------------------------------------+ @@ -25992,7 +29222,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_259 | + | commitment | Determined from data | $X_247 | +---------------+----------------------+------------------------+ @@ -26084,7 +29314,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_132 | + | message | Determined from data | $X_120 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -26098,13 +29328,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_133 | + | previous_message_result | 64 bytes | $X_121 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_258 | + | proof | Determined from data | $X_246 | +------------------------------+----------------------+-------------------------+ @@ -26140,7 +29370,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_128 | + | tickets_info | Variable | sequence of $X_116 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -26200,7 +29430,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_127 | + | kind | 2 bytes | $X_115 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -26236,7 +29466,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_126 | + | message | Variable | sequence of $X_114 | +------------------------------------------------+----------------------+-------------------------+ @@ -26288,7 +29518,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_125 | + | commitment | 76 bytes | $X_113 | +------------------------------------------------+----------------------+-------------------------+ @@ -26485,9 +29715,8 @@ Protocol Kathmandu "nonce": integer ∈ [0, 2^16-1], "amount": $014-PtKathma.mutez, "destination": $014-PtKathma.transaction_destination, - "parameters"?: - { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, + "value": any }, "result": $014-PtKathma.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -26495,7 +29724,7 @@ Protocol Kathmandu "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "result": $014-PtKathma.operation.alpha.internal_operation_result.origination } @@ -26503,7 +29732,7 @@ Protocol Kathmandu "kind": "delegation", "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $014-PtKathma.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -26537,7 +29766,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $014-PtKathma.tx_rollup_id } @@ -26561,7 +29790,7 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.error: /* The full list of RPC errors would be too long to include. @@ -26573,7 +29802,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -26585,7 +29814,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -26822,7 +30051,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -26850,26 +30079,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26878,28 +30107,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26907,7 +30136,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26919,15 +30148,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26935,7 +30164,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26945,7 +30174,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26958,7 +30187,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26966,7 +30195,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26974,7 +30203,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26982,7 +30211,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -26994,7 +30223,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -27055,7 +30284,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27066,27 +30295,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27097,7 +30326,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27108,10 +30337,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27120,7 +30349,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27129,7 +30358,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27143,13 +30372,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -27269,18 +30498,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27293,7 +30522,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27301,7 +30530,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27463,7 +30692,7 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Preendorsement */ "kind": "preendorsement", @@ -27474,13 +30703,13 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $014-PtKathma.inlined.preendorsement, @@ -27511,25 +30740,25 @@ Protocol Kathmandu $014-PtKathma.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27539,7 +30768,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27548,7 +30777,7 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27558,13 +30787,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "metadata": { "balance_updates"?: @@ -27575,12 +30804,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27590,12 +30819,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27605,7 +30834,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27620,7 +30849,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27636,7 +30865,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27651,7 +30880,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27668,7 +30897,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27688,7 +30917,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27703,7 +30932,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27718,7 +30947,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27733,7 +30962,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27745,7 +30974,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -27813,13 +31042,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, @@ -27833,7 +31062,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27851,7 +31080,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27862,11 +31091,11 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27876,7 +31105,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27887,7 +31116,7 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -27897,7 +31126,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27913,7 +31142,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27929,7 +31158,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -27950,13 +31179,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -28083,15 +31312,15 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -28101,7 +31330,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -28121,7 +31350,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -28136,7 +31365,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -28413,7 +31642,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -28435,7 +31664,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -28452,7 +31681,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -28474,7 +31703,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -28739,10 +31968,10 @@ Protocol Kathmandu { /* Operation_with_metadata */ "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -28757,7 +31986,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -28798,7 +32027,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -28870,9 +32099,8 @@ Protocol Kathmandu /* Sapling state identifier A sapling state identifier */ $bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -28915,13 +32143,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -28995,7 +32223,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -29174,30 +32402,20 @@ Protocol Kathmandu X_8 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ - - - X_9 - *** - - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_8 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_12 + X_10 **** +-----------------+----------------------+------------------------+ @@ -29209,7 +32427,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_13 (Determined from data, 8-bit tag) + X_11 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -29222,7 +32440,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_12 | + | sparse_proof | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -29238,25 +32456,37 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_11 - **** + X_9 + *** +--------+----------------------+-----------------------+ | Name | Size | Contents | +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_13 | + | proofs | Determined from data | $X_11 | +--------+----------------------+-----------------------+ - X_14 + X_13 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_12 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_8 | + | Unnamed field 0 | Determined from data | $X_13 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -29287,7 +32517,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_14 | + | inode_values | Variable | sequence of $X_12 | +-----------------------+----------+-------------------------+ @@ -29299,7 +32529,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_11 | + | inode_tree | Determined from data | $X_9 | +------------+----------------------+------------------------+ @@ -29311,7 +32541,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_9 | + | inode_extender | Determined from data | $X_8 | +----------------+----------------------+------------------------+ @@ -29364,7 +32594,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_14 | + | node | Variable | sequence of $X_12 | +-----------------------+----------+-------------------------+ @@ -29388,7 +32618,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_11 | + | inode | Determined from data | $X_9 | +-------+----------------------+------------------------+ @@ -29400,7 +32630,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_9 | + | extender | Determined from data | $X_8 | +----------+----------------------+------------------------+ @@ -29430,7 +32660,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_39 (Determined from data, 8-bit tag) + X_35 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -29461,7 +32691,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_40 (Determined from data, 8-bit tag) + X_36 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -29498,7 +32728,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_78 (Determined from data, 8-bit tag) + X_70 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -29511,9 +32741,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_4 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_39 | + | given | Determined from data | $X_35 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_40 | + | requested | Determined from data | $X_36 | +------------+----------------------+------------------------+ @@ -29527,13 +32757,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_4 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_39 | + | given | Determined from data | $X_35 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_40 | + | requested | Determined from data | $X_36 | +------------+----------------------+------------------------+ - X_81 + X_73 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -29549,7 +32779,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_80 + X_72 **** +------------------------------------------------+----------------------+-------------------------+ @@ -29571,11 +32801,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_81 | + | old_levels_messages | Determined from data | $X_73 | +------------------------------------------------+----------------------+-------------------------+ - X_82 + X_74 **** +-----------------------+----------+-------------------------+ @@ -29583,23 +32813,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_81 | + | Unnamed field 0 | Variable | sequence of $X_73 | +-----------------------+----------+-------------------------+ - X_79 + X_71 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_80 | + | Unnamed field 0 | Determined from data | $X_72 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_82 | + | Unnamed field 1 | Determined from data | $X_74 | +-----------------+----------------------+----------+ - X_122 (Determined from data, 8-bit tag) + X_110 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -29622,19 +32852,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_79 | + | skips | Variable | sequence of $X_71 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_80 | + | level | Determined from data | $X_72 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_81 | + | inc | Variable | sequence of $X_73 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_4 | +-----------------------+----------------------+-------------------------+ - X_124 (Determined from data, 8-bit tag) + X_112 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -29659,19 +32889,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_123 + X_111 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_124 | + | Unnamed field 0 | Determined from data | $X_112 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_125 (Determined from data, 8-bit tag) + X_113 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -29684,7 +32914,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_123 | + | Unnamed field 0 | Variable | sequence of $X_111 | +-----------------------+----------+-------------------------+ @@ -29696,9 +32926,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_78 | + | pvm_step | Determined from data | $X_70 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_122 | + | inbox | Determined from data | $X_110 | +----------+----------------------+------------------------+ @@ -29710,11 +32940,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_125 | + | step | Determined from data | $X_113 | +--------+----------------------+----------+ - X_126 + X_114 ***** +--------------------+----------+-----------------------+ @@ -29732,7 +32962,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_127 + X_115 ***** +-----------------------+----------+-------------------------+ @@ -29744,7 +32974,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_128 (2 bytes, 16-bit tag) + X_116 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -29773,13 +33003,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -29796,7 +33026,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_130 (Determined from data, 8-bit tag) + X_118 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -29847,7 +33077,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_129 + X_117 ***** +-----------------------+----------------------+---------------------------+ @@ -29863,13 +33093,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_130 | + | amount | Determined from data | $X_118 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_131 + X_119 ***** +-------------+----------------------+------------------+ @@ -29881,11 +33111,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_130 | + | amount | Determined from data | $X_118 | +-------------+----------------------+------------------+ - X_133 (Determined from data, 8-bit tag) + X_121 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -29910,11 +33140,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_131 | + | deposit | Determined from data | $X_119 | +---------+----------------------+------------------------+ - X_134 + X_122 ***** +--------------------+----------+----------+ @@ -29926,7 +33156,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_142 (33 bytes, 8-bit tag) + X_130 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -29953,19 +33183,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_140 + X_128 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | + | Unnamed field 0 | Determined from data | $X_13 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_142 | + | Unnamed field 1 | 33 bytes | $X_130 | +-----------------+----------------------+----------+ - X_149 + X_137 ***** +-----------------+----------+----------+ @@ -29977,7 +33207,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_153 + X_141 ***** +-----------------+----------+----------+ @@ -29987,11 +33217,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_161 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_165 (Determined from data, 8-bit tag) + X_153 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -30052,7 +33278,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30066,7 +33292,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+-------------------------+ @@ -30080,7 +33306,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30094,7 +33320,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30108,7 +33334,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30122,7 +33348,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+-------------------------+ @@ -30136,7 +33362,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30150,7 +33376,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -30164,7 +33390,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -30178,7 +33404,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+-------------------------+ @@ -30192,7 +33418,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -30206,7 +33432,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -30228,7 +33454,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_140 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_128 | +-----------------+----------+------------------------------+ @@ -30240,7 +33466,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_140 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_128 | +-----------------+----------+------------------------------+ @@ -30254,7 +33480,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_140 | + | Unnamed field 0 | Variable | sequence of $X_128 | +-----------------------+----------+-------------------------+ @@ -30310,7 +33536,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -30326,7 +33552,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -30342,7 +33568,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -30358,13 +33584,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_135 + X_123 ***** +-----------------------+----------+-------------------------+ @@ -30372,11 +33598,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_165 | + | Unnamed field 0 | Variable | sequence of $X_153 | +-----------------------+----------+-------------------------+ - X_259 (Determined from data, 8-bit tag) + X_247 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -30393,7 +33619,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -30411,7 +33637,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -30429,7 +33655,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -30447,11 +33673,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ - X_261 (Determined from data, 8-bit tag) + X_249 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -30476,7 +33702,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_260 + X_248 ***** +-----------------------+----------------------+-------------------------+ @@ -30488,7 +33714,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_261 | + | predecessor | Determined from data | $X_249 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -30606,7 +33832,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_262 + X_250 ***** +-----------------------+----------------------+--------------------------+ @@ -30659,7 +33885,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_263 + X_251 ***** +-----------------+-----------+----------+ @@ -30922,7 +34148,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_263 | + | solution | 200 bytes | $X_251 | +----------+-----------+------------------------+ @@ -31036,7 +34262,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+-------------------------------------+ @@ -31234,7 +34460,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_260 | + | commitment | Determined from data | $X_248 | +---------------+----------------------+------------------------+ @@ -31326,7 +34552,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_133 | + | message | Determined from data | $X_121 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -31340,13 +34566,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_134 | + | previous_message_result | 64 bytes | $X_122 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_259 | + | proof | Determined from data | $X_247 | +------------------------------+----------------------+-------------------------+ @@ -31382,7 +34608,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_129 | + | tickets_info | Variable | sequence of $X_117 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -31442,7 +34668,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_128 | + | kind | 2 bytes | $X_116 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -31478,7 +34704,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_127 | + | message | Variable | sequence of $X_115 | +------------------------------------------------+----------------------+-------------------------+ @@ -31530,7 +34756,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_126 | + | commitment | 76 bytes | $X_114 | +------------------------------------------------+----------------------+-------------------------+ @@ -31727,7 +34953,7 @@ Protocol Kathmandu +------------------------------------------------+----------+-------------------------+ - X_267 (Determined from data, 8-bit tag) + X_255 (Determined from data, 8-bit tag) *************************************** Contract (tag 0) @@ -31966,7 +35192,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_268 (1 byte, 8-bit tag) + X_256 (1 byte, 8-bit tag) ************************* Block_application (tag 0) @@ -32009,21 +35235,21 @@ Protocol Kathmandu +------+--------+------------------------+ - X_266 + X_254 ***** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_267 | + | Unnamed field 0 | Determined from data | $X_255 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_268 | + | origin | 1 byte | $X_256 | +-----------------+----------------------+-----------------------+ - X_269 + X_257 ***** +-----------------------+----------+-------------------------+ @@ -32031,7 +35257,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_127 | + | Unnamed field 0 | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -32060,7 +35286,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -32084,7 +35310,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -32597,7 +35823,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_279 + X_267 ***** +-----------------+----------------------+---------------------------------+ @@ -32609,7 +35835,7 @@ Protocol Kathmandu +-----------------+----------------------+---------------------------------+ - X_278 + X_266 ***** +-----------------------------+----------+-------------------------+ @@ -32617,7 +35843,7 @@ Protocol Kathmandu +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_279 | + | commitments_and_ciphertexts | Variable | sequence of $X_267 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -32625,7 +35851,7 @@ Protocol Kathmandu +-----------------------------+----------+-------------------------+ - X_284 (Determined from data, 8-bit tag) + X_272 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -32636,7 +35862,7 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +---------+----------------------+------------------------+ @@ -32660,7 +35886,7 @@ Protocol Kathmandu +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +---------+----------------------+------------------------+ @@ -32672,13 +35898,13 @@ Protocol Kathmandu +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_285 + X_273 ***** +-----------------------------+----------------------+-------------------------------------------------+ @@ -32694,7 +35920,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------------------+ - X_296 (Determined from data, 8-bit tag) + X_284 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -32707,7 +35933,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------+-------------------------+ @@ -32733,7 +35959,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------------------+-------------------------+ @@ -32747,7 +35973,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.014-PtKathma.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -32755,7 +35981,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ - X_297 (Determined from data, 8-bit tag) + X_285 (Determined from data, 8-bit tag) *************************************** big_map (tag 0) @@ -32768,7 +35994,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_296 | + | diff | Determined from data | $X_284 | +------+----------------------+------------------------+ @@ -32782,7 +36008,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_284 | + | diff | Determined from data | $X_272 | +------+----------------------+------------------------+ @@ -32794,7 +36020,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_297 | + | Unnamed field 0 | Variable | sequence of $X_285 | +-----------------------+----------+-------------------------+ @@ -32811,7 +36037,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -32839,7 +36065,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -32863,11 +36089,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -32891,13 +36117,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -32942,7 +36168,7 @@ Protocol Kathmandu +----------------+----------+------------------------+ - X_352 (Determined from data, 8-bit tag) + X_340 (Determined from data, 8-bit tag) *************************************** To_contract (tag 0) @@ -32959,7 +36185,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -32989,7 +36215,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33009,7 +36235,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +-------------------+----------------------+------------------------+ @@ -33024,7 +36250,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_352 | + | Unnamed field 0 | Determined from data | $X_340 | +-----------------+----------------------+------------------------+ @@ -33038,7 +36264,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33062,9 +36288,9 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_352 | + | Unnamed field 0 | Determined from data | $X_340 | +------------------------------+----------------------+-------------------------------------+ @@ -33089,7 +36315,7 @@ Protocol Kathmandu +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -33165,7 +36391,7 @@ Protocol Kathmandu +-------------------------------+----------------------+------------------------------------------------------------------------+ - X_265 + X_253 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33173,7 +36399,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.dal_publish_slot_header | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33212,7 +36438,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33236,7 +36462,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -33246,7 +36472,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_383 + X_371 ***** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -33254,7 +36480,7 @@ Protocol Kathmandu +==========================================================================+======================+=============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -33277,7 +36503,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33293,7 +36519,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33317,17 +36543,17 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_501 + X_489 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33335,7 +36561,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33358,7 +36584,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33376,7 +36602,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33400,11 +36626,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -33412,7 +36638,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_625 + X_613 ***** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -33420,7 +36646,7 @@ Protocol Kathmandu +==========================================================================+======================+=================================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -33430,7 +36656,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_755 (Determined from data, 8-bit tag) + X_743 (Determined from data, 8-bit tag) *************************************** Conflict_resolved (tag 0) @@ -33467,7 +36693,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_756 (Determined from data, 8-bit tag) + X_744 (Determined from data, 8-bit tag) *************************************** Ongoing (tag 0) @@ -33488,7 +36714,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_755 | + | Unnamed field 0 | Determined from data | $X_743 | +-----------------+----------------------+------------------------+ | Unnamed field 1 | 21 bytes | $public_key_hash | +-----------------+----------------------+------------------------+ @@ -33507,11 +36733,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | status | Determined from data | $X_756 | + | status | Determined from data | $X_744 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33525,7 +36751,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33549,19 +36775,19 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | status | Determined from data | $X_756 | + | status | Determined from data | $X_744 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_750 + X_738 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33569,7 +36795,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33598,7 +36824,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33612,7 +36838,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33636,7 +36862,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -33646,11 +36872,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1130 + X_1106 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33658,7 +36884,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33681,7 +36907,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +-------------------+----------------------+------------------------+ @@ -33695,7 +36921,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33719,15 +36945,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +------------------------------+----------------------+-------------------------------------+ - X_1373 + X_1349 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33735,7 +36961,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33758,7 +36984,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33778,7 +37004,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33802,11 +37028,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -33816,7 +37042,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1496 + X_1472 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33824,7 +37050,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33847,7 +37073,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33865,7 +37091,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33889,11 +37115,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -33901,7 +37127,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2123 + X_2099 ****** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -33909,7 +37135,7 @@ Protocol Kathmandu +==========================================================================+======================+============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -33932,7 +37158,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -33950,7 +37176,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -33974,11 +37200,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -33986,7 +37212,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2621 + X_2597 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -33994,7 +37220,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34017,7 +37243,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -34035,7 +37261,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -34059,11 +37285,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -34071,7 +37297,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2745 + X_2721 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34079,7 +37305,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34102,7 +37328,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -34122,7 +37348,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -34146,11 +37372,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -34160,7 +37386,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_3111 + X_3087 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34168,7 +37394,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34178,7 +37404,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3353 + X_3329 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34186,7 +37412,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34196,7 +37422,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3518 + X_3494 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34204,7 +37430,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -34214,7 +37440,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3814 + X_3790 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -34222,7 +37448,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -34230,7 +37456,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_3818 + X_3794 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -34238,7 +37464,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -34254,7 +37480,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_266 | + | Unnamed field 0 | Variable | sequence of $X_254 | +-----------------------+----------+-------------------------+ @@ -34397,7 +37623,7 @@ Protocol Kathmandu +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_263 | + | solution | 200 bytes | $X_251 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $014-PtKathma.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -34419,7 +37645,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3818 | + | metadata | Determined from data | $X_3794 | +--------------------+----------------------+-------------------------+ @@ -34439,7 +37665,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3814 | + | metadata | Determined from data | $X_3790 | +--------------------+----------------------+-------------------------+ @@ -34479,7 +37705,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +---------------+----------------------+------------------------+ @@ -34507,9 +37733,9 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3518 | + | metadata | Determined from data | $X_3494 | +----------------------------------+----------------------+-------------------------------------+ @@ -34539,7 +37765,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $014-PtKathma.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3353 | + | metadata | Determined from data | $X_3329 | +--------------------------------+----------------------+-------------------------------------+ @@ -34565,7 +37791,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +--------------------------------+----------------------+-------------------------------------+ @@ -34591,7 +37817,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3111 | + | metadata | Determined from data | $X_3087 | +-----------------------+----------------------+-------------------------+ @@ -34617,7 +37843,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +-----------------------------+----------------------+-------------------------------------+ @@ -34643,7 +37869,7 @@ Protocol Kathmandu +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $014-PtKathma.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+--------------------------------------+ @@ -34665,7 +37891,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2745 | + | metadata | Determined from data | $X_2721 | +---------------+----------------------+------------------------+ @@ -34697,7 +37923,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_2621 | + | metadata | Determined from data | $X_2597 | +----------------------------------+----------------------+-------------------------------------+ @@ -34721,9 +37947,9 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_260 | + | commitment | Determined from data | $X_248 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -34747,7 +37973,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -34771,7 +37997,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2123 | + | metadata | Determined from data | $X_2099 | +---------------+----------------------+------------------------+ @@ -34795,7 +38021,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2123 | + | metadata | Determined from data | $X_2099 | +---------------+----------------------+------------------------+ @@ -34821,7 +38047,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_133 | + | message | Determined from data | $X_121 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -34835,15 +38061,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_134 | + | previous_message_result | 64 bytes | $X_122 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_259 | + | proof | Determined from data | $X_247 | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +------------------------------+----------------------+-------------------------+ @@ -34879,9 +38105,9 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_129 | + | tickets_info | Variable | sequence of $X_117 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -34921,7 +38147,7 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +-----------------------+----------------------+---------------------------+ @@ -34943,7 +38169,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_128 | + | kind | 2 bytes | $X_116 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -34953,7 +38179,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1496 | + | metadata | Determined from data | $X_1472 | +-----------------------+----------------------+-------------------------+ @@ -34981,9 +38207,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_127 | + | message | Variable | sequence of $X_115 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1373 | + | metadata | Determined from data | $X_1349 | +------------------------------------------------+----------------------+-------------------------+ @@ -35011,7 +38237,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +------------------------------------------------+----------------------+-------------------------+ @@ -35037,9 +38263,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_126 | + | commitment | 76 bytes | $X_114 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1130 | + | metadata | Determined from data | $X_1106 | +------------------------------------------------+----------------------+-------------------------+ @@ -35071,7 +38297,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------------------+ | is_opening_move | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_750 | + | metadata | Determined from data | $X_738 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -35099,7 +38325,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | stakers | 42 bytes | $X_2 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_750 | + | metadata | Determined from data | $X_738 | +------------------------------------------------+----------------------+-------------------------+ @@ -35139,7 +38365,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+--------------------------------------------------------------+ | message | Variable | bytes | +------------------------------------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +------------------------------------------------+----------------------+--------------------------------------------------------------+ @@ -35163,7 +38389,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -35191,7 +38417,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_383 | + | metadata | Determined from data | $X_371 | +------------------------------------------------+----------------------+-------------------------+ @@ -35215,11 +38441,11 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | slot | 9 bytes | $X_1 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +---------------+----------------------+------------------------+ - X_3841 (Determined from data, 8-bit tag) + X_3817 (Determined from data, 8-bit tag) **************************************** Operation_with_metadata (tag 0) @@ -35266,7 +38492,7 @@ Protocol Kathmandu +=======================+======================+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | Unnamed field 0 | Determined from data | $X_3841 | + | Unnamed field 0 | Determined from data | $X_3817 | +-----------------------+----------------------+-------------------------+ </pre> @@ -35339,8 +38565,8 @@ Protocol Kathmandu "max_operation_list_length": [ { "max_size": integer ∈ [-2^30, 2^30], "max_op"?: integer ∈ [-2^30, 2^30] } ... ], - "proposer": $Signature.Public_key_hash, - "baker": $Signature.Public_key_hash, + "proposer": $Signature.V0.Public_key_hash, + "baker": $Signature.V0.Public_key_hash, "level_info": { "level": integer ∈ [-2^31-1, 2^31] @@ -35392,7 +38618,7 @@ Protocol Kathmandu /* The number of blocks remaining till the end of the voting period. */ }, "nonce_hash": $cycle_nonce /* Some */ || null /* None */, - "deactivated": [ $Signature.Public_key_hash ... ], + "deactivated": [ $Signature.V0.Public_key_hash ... ], "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], @@ -35712,7 +38938,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -35753,7 +38979,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -35842,7 +39068,7 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $bignum: @@ -35876,7 +39102,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -36208,13 +39434,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -37853,9 +41079,8 @@ Protocol Kathmandu "nonce": integer ∈ [0, 2^16-1], "amount": $014-PtKathma.mutez, "destination": $014-PtKathma.transaction_destination, - "parameters"?: - { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, + "value": any }, "result": $014-PtKathma.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -37863,7 +41088,7 @@ Protocol Kathmandu "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "result": $014-PtKathma.operation.alpha.internal_operation_result.origination } @@ -37871,7 +41096,7 @@ Protocol Kathmandu "kind": "delegation", "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $014-PtKathma.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -37905,7 +41130,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $014-PtKathma.tx_rollup_id } @@ -37929,7 +41154,7 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.error: /* The full list of RPC errors would be too long to include. @@ -37941,7 +41166,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -37953,7 +41178,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -38190,7 +41415,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -38218,26 +41443,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38246,28 +41471,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38275,7 +41500,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38287,15 +41512,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38303,7 +41528,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38313,7 +41538,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38326,7 +41551,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38334,7 +41559,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38342,7 +41567,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38350,7 +41575,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38362,7 +41587,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -38423,7 +41648,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38434,27 +41659,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38465,7 +41690,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38476,10 +41701,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38488,7 +41713,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38497,7 +41722,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38511,13 +41736,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -38637,18 +41862,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38661,7 +41886,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38669,7 +41894,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38678,7 +41903,7 @@ Protocol Kathmandu "slot_index": integer ∈ [0, 255] } $014-PtKathma.operation.alpha.contents_and_signature: { "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -38834,7 +42059,7 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Preendorsement */ "kind": "preendorsement", @@ -38845,13 +42070,13 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $014-PtKathma.inlined.preendorsement, @@ -38882,25 +42107,25 @@ Protocol Kathmandu $014-PtKathma.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -38910,7 +42135,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38919,7 +42144,7 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -38929,13 +42154,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "metadata": { "balance_updates"?: @@ -38946,12 +42171,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -38961,12 +42186,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -38976,7 +42201,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -38991,7 +42216,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39007,7 +42232,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39022,7 +42247,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39039,7 +42264,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39059,7 +42284,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39074,7 +42299,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39089,7 +42314,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39104,7 +42329,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39116,7 +42341,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -39184,13 +42409,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, @@ -39204,7 +42429,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39222,7 +42447,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39233,11 +42458,11 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -39247,7 +42472,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39258,7 +42483,7 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -39268,7 +42493,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39284,7 +42509,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39300,7 +42525,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39321,13 +42546,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -39454,15 +42679,15 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -39472,7 +42697,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39492,7 +42717,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39507,7 +42732,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39784,7 +43009,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -39806,7 +43031,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -39823,7 +43048,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -39845,7 +43070,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -40110,10 +43335,10 @@ Protocol Kathmandu { /* Operation_with_metadata */ "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -40128,7 +43353,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -40169,7 +43394,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -40241,9 +43466,8 @@ Protocol Kathmandu /* Sapling state identifier A sapling state identifier */ $bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -40292,13 +43516,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -40372,7 +43596,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -40380,7 +43604,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -40388,7 +43612,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, @@ -40396,14 +43620,14 @@ Protocol Kathmandu "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -40582,30 +43806,20 @@ Protocol Kathmandu X_8 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ - - - X_9 - *** - - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_8 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_12 + X_10 **** +-----------------+----------------------+------------------------+ @@ -40617,7 +43831,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_13 (Determined from data, 8-bit tag) + X_11 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -40630,7 +43844,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_12 | + | sparse_proof | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -40646,25 +43860,37 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_11 - **** + X_9 + *** +--------+----------------------+-----------------------+ | Name | Size | Contents | +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_13 | + | proofs | Determined from data | $X_11 | +--------+----------------------+-----------------------+ - X_14 + X_13 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_12 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_8 | + | Unnamed field 0 | Determined from data | $X_13 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -40695,7 +43921,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_14 | + | inode_values | Variable | sequence of $X_12 | +-----------------------+----------+-------------------------+ @@ -40707,7 +43933,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_11 | + | inode_tree | Determined from data | $X_9 | +------------+----------------------+------------------------+ @@ -40719,7 +43945,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_9 | + | inode_extender | Determined from data | $X_8 | +----------------+----------------------+------------------------+ @@ -40772,7 +43998,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_14 | + | node | Variable | sequence of $X_12 | +-----------------------+----------+-------------------------+ @@ -40796,7 +44022,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_11 | + | inode | Determined from data | $X_9 | +-------+----------------------+------------------------+ @@ -40808,7 +44034,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_9 | + | extender | Determined from data | $X_8 | +----------+----------------------+------------------------+ @@ -40838,7 +44064,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_39 (Determined from data, 8-bit tag) + X_35 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -40869,7 +44095,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_40 (Determined from data, 8-bit tag) + X_36 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -40906,7 +44132,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_78 (Determined from data, 8-bit tag) + X_70 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -40919,9 +44145,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_4 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_39 | + | given | Determined from data | $X_35 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_40 | + | requested | Determined from data | $X_36 | +------------+----------------------+------------------------+ @@ -40935,13 +44161,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_4 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_39 | + | given | Determined from data | $X_35 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_40 | + | requested | Determined from data | $X_36 | +------------+----------------------+------------------------+ - X_81 + X_73 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -40957,7 +44183,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_80 + X_72 **** +------------------------------------------------+----------------------+-------------------------+ @@ -40979,11 +44205,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_81 | + | old_levels_messages | Determined from data | $X_73 | +------------------------------------------------+----------------------+-------------------------+ - X_82 + X_74 **** +-----------------------+----------+-------------------------+ @@ -40991,23 +44217,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_81 | + | Unnamed field 0 | Variable | sequence of $X_73 | +-----------------------+----------+-------------------------+ - X_79 + X_71 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_80 | + | Unnamed field 0 | Determined from data | $X_72 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_82 | + | Unnamed field 1 | Determined from data | $X_74 | +-----------------+----------------------+----------+ - X_122 (Determined from data, 8-bit tag) + X_110 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -41030,19 +44256,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_79 | + | skips | Variable | sequence of $X_71 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_80 | + | level | Determined from data | $X_72 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_81 | + | inc | Variable | sequence of $X_73 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_4 | +-----------------------+----------------------+-------------------------+ - X_124 (Determined from data, 8-bit tag) + X_112 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -41067,19 +44293,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_123 + X_111 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_124 | + | Unnamed field 0 | Determined from data | $X_112 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_125 (Determined from data, 8-bit tag) + X_113 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -41092,7 +44318,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_123 | + | Unnamed field 0 | Variable | sequence of $X_111 | +-----------------------+----------+-------------------------+ @@ -41104,9 +44330,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_78 | + | pvm_step | Determined from data | $X_70 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_122 | + | inbox | Determined from data | $X_110 | +----------+----------------------+------------------------+ @@ -41118,11 +44344,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_125 | + | step | Determined from data | $X_113 | +--------+----------------------+----------+ - X_126 + X_114 ***** +--------------------+----------+-----------------------+ @@ -41140,7 +44366,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_127 + X_115 ***** +-----------------------+----------+-------------------------+ @@ -41152,7 +44378,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_128 (2 bytes, 16-bit tag) + X_116 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -41181,13 +44407,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -41204,7 +44430,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_130 (Determined from data, 8-bit tag) + X_118 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -41255,7 +44481,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_129 + X_117 ***** +-----------------------+----------------------+---------------------------+ @@ -41271,13 +44497,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_130 | + | amount | Determined from data | $X_118 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_131 + X_119 ***** +-------------+----------------------+------------------+ @@ -41289,11 +44515,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_130 | + | amount | Determined from data | $X_118 | +-------------+----------------------+------------------+ - X_133 (Determined from data, 8-bit tag) + X_121 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -41318,11 +44544,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_131 | + | deposit | Determined from data | $X_119 | +---------+----------------------+------------------------+ - X_134 + X_122 ***** +--------------------+----------+----------+ @@ -41334,7 +44560,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_142 (33 bytes, 8-bit tag) + X_130 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -41361,19 +44587,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_140 + X_128 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | + | Unnamed field 0 | Determined from data | $X_13 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_142 | + | Unnamed field 1 | 33 bytes | $X_130 | +-----------------+----------------------+----------+ - X_149 + X_137 ***** +-----------------+----------+----------+ @@ -41385,7 +44611,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_153 + X_141 ***** +-----------------+----------+----------+ @@ -41395,11 +44621,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_161 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_165 (Determined from data, 8-bit tag) + X_153 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -41460,7 +44682,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41474,7 +44696,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+-------------------------+ @@ -41488,7 +44710,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41502,7 +44724,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41516,7 +44738,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41530,7 +44752,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+-------------------------+ @@ -41544,7 +44766,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41558,7 +44780,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_153 | + | Unnamed field 1 | 32 bytes | $X_141 | +-----------------+----------+------------------------+ @@ -41572,7 +44794,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -41586,7 +44808,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+-------------------------+ @@ -41600,7 +44822,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -41614,7 +44836,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_149 | + | Unnamed field 1 | 64 bytes | $X_137 | +-----------------+----------+------------------------+ @@ -41636,7 +44858,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_140 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_128 | +-----------------+----------+------------------------------+ @@ -41648,7 +44870,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_140 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_128 | +-----------------+----------+------------------------------+ @@ -41662,7 +44884,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_140 | + | Unnamed field 0 | Variable | sequence of $X_128 | +-----------------------+----------+-------------------------+ @@ -41718,7 +44940,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -41734,7 +44956,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -41750,7 +44972,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -41766,13 +44988,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_8 | + | Unnamed field 1 | Determined from data | $X_13 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_135 + X_123 ***** +-----------------------+----------+-------------------------+ @@ -41780,11 +45002,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_165 | + | Unnamed field 0 | Variable | sequence of $X_153 | +-----------------------+----------+-------------------------+ - X_259 (Determined from data, 8-bit tag) + X_247 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -41801,7 +45023,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -41819,7 +45041,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -41837,7 +45059,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ @@ -41855,11 +45077,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_135 | + | Unnamed field 3 | Determined from data | $X_123 | +-----------------+----------------------+------------------------+ - X_261 (Determined from data, 8-bit tag) + X_249 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -41884,7 +45106,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_260 + X_248 ***** +-----------------------+----------------------+-------------------------+ @@ -41896,7 +45118,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_261 | + | predecessor | Determined from data | $X_249 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -42014,7 +45236,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_262 + X_250 ***** +-----------------------+----------------------+--------------------------+ @@ -42067,7 +45289,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_263 + X_251 ***** +-----------------+-----------+----------+ @@ -42330,7 +45552,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_263 | + | solution | 200 bytes | $X_251 | +----------+-----------+------------------------+ @@ -42444,7 +45666,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+-------------------------------------+ @@ -42642,7 +45864,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_260 | + | commitment | Determined from data | $X_248 | +---------------+----------------------+------------------------+ @@ -42734,7 +45956,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_133 | + | message | Determined from data | $X_121 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -42748,13 +45970,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_134 | + | previous_message_result | 64 bytes | $X_122 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_259 | + | proof | Determined from data | $X_247 | +------------------------------+----------------------+-------------------------+ @@ -42790,7 +46012,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_129 | + | tickets_info | Variable | sequence of $X_117 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -42850,7 +46072,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_128 | + | kind | 2 bytes | $X_116 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -42886,7 +46108,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_127 | + | message | Variable | sequence of $X_115 | +------------------------------------------------+----------------------+-------------------------+ @@ -42938,7 +46160,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_126 | + | commitment | 76 bytes | $X_114 | +------------------------------------------------+----------------------+-------------------------+ @@ -43135,7 +46357,7 @@ Protocol Kathmandu +------------------------------------------------+----------+-------------------------+ - X_267 (Determined from data, 8-bit tag) + X_255 (Determined from data, 8-bit tag) *************************************** Contract (tag 0) @@ -43374,7 +46596,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_268 (1 byte, 8-bit tag) + X_256 (1 byte, 8-bit tag) ************************* Block_application (tag 0) @@ -43417,21 +46639,21 @@ Protocol Kathmandu +------+--------+------------------------+ - X_266 + X_254 ***** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_267 | + | Unnamed field 0 | Determined from data | $X_255 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_268 | + | origin | 1 byte | $X_256 | +-----------------+----------------------+-----------------------+ - X_269 + X_257 ***** +-----------------------+----------+-------------------------+ @@ -43439,7 +46661,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_127 | + | Unnamed field 0 | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -43468,7 +46690,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -43492,7 +46714,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -44005,7 +47227,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_279 + X_267 ***** +-----------------+----------------------+---------------------------------+ @@ -44017,7 +47239,7 @@ Protocol Kathmandu +-----------------+----------------------+---------------------------------+ - X_278 + X_266 ***** +-----------------------------+----------+-------------------------+ @@ -44025,7 +47247,7 @@ Protocol Kathmandu +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_279 | + | commitments_and_ciphertexts | Variable | sequence of $X_267 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -44033,7 +47255,7 @@ Protocol Kathmandu +-----------------------------+----------+-------------------------+ - X_284 (Determined from data, 8-bit tag) + X_272 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -44044,7 +47266,7 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +---------+----------------------+------------------------+ @@ -44068,7 +47290,7 @@ Protocol Kathmandu +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +---------+----------------------+------------------------+ @@ -44080,13 +47302,13 @@ Protocol Kathmandu +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_278 | + | updates | Determined from data | $X_266 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_285 + X_273 ***** +-----------------------------+----------------------+-------------------------------------------------+ @@ -44102,7 +47324,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------------------+ - X_296 (Determined from data, 8-bit tag) + X_284 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -44115,7 +47337,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------+-------------------------+ @@ -44141,7 +47363,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------------------+-------------------------+ @@ -44155,7 +47377,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_285 | + | updates | Variable | sequence of $X_273 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.014-PtKathma.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -44163,7 +47385,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ - X_297 (Determined from data, 8-bit tag) + X_285 (Determined from data, 8-bit tag) *************************************** big_map (tag 0) @@ -44176,7 +47398,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_296 | + | diff | Determined from data | $X_284 | +------+----------------------+------------------------+ @@ -44190,7 +47412,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_284 | + | diff | Determined from data | $X_272 | +------+----------------------+------------------------+ @@ -44202,7 +47424,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_297 | + | Unnamed field 0 | Variable | sequence of $X_285 | +-----------------------+----------+-------------------------+ @@ -44219,7 +47441,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -44247,7 +47469,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44271,11 +47493,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -44299,13 +47521,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -44350,7 +47572,7 @@ Protocol Kathmandu +----------------+----------+------------------------+ - X_352 (Determined from data, 8-bit tag) + X_340 (Determined from data, 8-bit tag) *************************************** To_contract (tag 0) @@ -44367,7 +47589,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -44397,7 +47619,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -44417,7 +47639,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +-------------------+----------------------+------------------------+ @@ -44432,7 +47654,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_352 | + | Unnamed field 0 | Determined from data | $X_340 | +-----------------+----------------------+------------------------+ @@ -44446,7 +47668,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44470,9 +47692,9 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_352 | + | Unnamed field 0 | Determined from data | $X_340 | +------------------------------+----------------------+-------------------------------------+ @@ -44497,7 +47719,7 @@ Protocol Kathmandu +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -44573,7 +47795,7 @@ Protocol Kathmandu +-------------------------------+----------------------+------------------------------------------------------------------------+ - X_265 + X_253 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -44581,7 +47803,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.dal_publish_slot_header | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -44620,7 +47842,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44644,7 +47866,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -44654,7 +47876,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_383 + X_371 ***** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -44662,7 +47884,7 @@ Protocol Kathmandu +==========================================================================+======================+=============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -44685,7 +47907,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -44701,7 +47923,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44725,17 +47947,17 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_501 + X_489 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -44743,7 +47965,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -44766,7 +47988,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -44784,7 +48006,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44808,11 +48030,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -44820,7 +48042,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_625 + X_613 ***** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -44828,7 +48050,7 @@ Protocol Kathmandu +==========================================================================+======================+=================================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -44838,7 +48060,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_755 (Determined from data, 8-bit tag) + X_743 (Determined from data, 8-bit tag) *************************************** Conflict_resolved (tag 0) @@ -44875,7 +48097,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_756 (Determined from data, 8-bit tag) + X_744 (Determined from data, 8-bit tag) *************************************** Ongoing (tag 0) @@ -44896,7 +48118,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_755 | + | Unnamed field 0 | Determined from data | $X_743 | +-----------------+----------------------+------------------------+ | Unnamed field 1 | 21 bytes | $public_key_hash | +-----------------+----------------------+------------------------+ @@ -44915,11 +48137,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | status | Determined from data | $X_756 | + | status | Determined from data | $X_744 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -44933,7 +48155,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -44957,19 +48179,19 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | status | Determined from data | $X_756 | + | status | Determined from data | $X_744 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_750 + X_738 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -44977,7 +48199,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45006,7 +48228,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45020,7 +48242,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45044,7 +48266,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45054,11 +48276,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1130 + X_1106 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45066,7 +48288,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45089,7 +48311,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +-------------------+----------------------+------------------------+ @@ -45103,7 +48325,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45127,15 +48349,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_80 | + | inbox_after | Determined from data | $X_72 | +------------------------------+----------------------+-------------------------------------+ - X_1373 + X_1349 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45143,7 +48365,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45166,7 +48388,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45186,7 +48408,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45210,11 +48432,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45224,7 +48446,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1496 + X_1472 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45232,7 +48454,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45255,7 +48477,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45273,7 +48495,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45297,11 +48519,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45309,7 +48531,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2123 + X_2099 ****** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -45317,7 +48539,7 @@ Protocol Kathmandu +==========================================================================+======================+============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -45340,7 +48562,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45358,7 +48580,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45382,11 +48604,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45394,7 +48616,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2621 + X_2597 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45402,7 +48624,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45425,7 +48647,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45443,7 +48665,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45467,11 +48689,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45479,7 +48701,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2745 + X_2721 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45487,7 +48709,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45510,7 +48732,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -45530,7 +48752,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_127 | + | errors | Variable | sequence of $X_115 | +-----------------------+----------+-------------------------+ @@ -45554,11 +48776,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_269 | + | errors | Determined from data | $X_257 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -45568,7 +48790,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_3111 + X_3087 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45576,7 +48798,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45586,7 +48808,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3353 + X_3329 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45594,7 +48816,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45604,7 +48826,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3518 + X_3494 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45612,7 +48834,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -45622,7 +48844,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3814 + X_3790 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -45630,7 +48852,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -45638,7 +48860,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_3818 + X_3794 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -45646,7 +48868,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_266 | + | balance_updates | Variable | sequence of $X_254 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -45662,7 +48884,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_266 | + | Unnamed field 0 | Variable | sequence of $X_254 | +-----------------------+----------+-------------------------+ @@ -45805,7 +49027,7 @@ Protocol Kathmandu +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_263 | + | solution | 200 bytes | $X_251 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $014-PtKathma.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -45827,7 +49049,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3818 | + | metadata | Determined from data | $X_3794 | +--------------------+----------------------+-------------------------+ @@ -45847,7 +49069,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3814 | + | metadata | Determined from data | $X_3790 | +--------------------+----------------------+-------------------------+ @@ -45887,7 +49109,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +---------------+----------------------+------------------------+ @@ -45915,9 +49137,9 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_262 | + | parameters | Determined from data | $X_250 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3518 | + | metadata | Determined from data | $X_3494 | +----------------------------------+----------------------+-------------------------------------+ @@ -45947,7 +49169,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $014-PtKathma.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3353 | + | metadata | Determined from data | $X_3329 | +--------------------------------+----------------------+-------------------------------------+ @@ -45973,7 +49195,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +--------------------------------+----------------------+-------------------------------------+ @@ -45999,7 +49221,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3111 | + | metadata | Determined from data | $X_3087 | +-----------------------+----------------------+-------------------------+ @@ -46025,7 +49247,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +-----------------------------+----------------------+-------------------------------------+ @@ -46051,7 +49273,7 @@ Protocol Kathmandu +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $014-PtKathma.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+--------------------------------------+ @@ -46073,7 +49295,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2745 | + | metadata | Determined from data | $X_2721 | +---------------+----------------------+------------------------+ @@ -46105,7 +49327,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_2621 | + | metadata | Determined from data | $X_2597 | +----------------------------------+----------------------+-------------------------------------+ @@ -46129,9 +49351,9 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_260 | + | commitment | Determined from data | $X_248 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -46155,7 +49377,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -46179,7 +49401,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2123 | + | metadata | Determined from data | $X_2099 | +---------------+----------------------+------------------------+ @@ -46203,7 +49425,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2123 | + | metadata | Determined from data | $X_2099 | +---------------+----------------------+------------------------+ @@ -46229,7 +49451,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_133 | + | message | Determined from data | $X_121 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -46243,15 +49465,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_134 | + | previous_message_result | 64 bytes | $X_122 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_259 | + | proof | Determined from data | $X_247 | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +------------------------------+----------------------+-------------------------+ @@ -46287,9 +49509,9 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_129 | + | tickets_info | Variable | sequence of $X_117 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -46329,7 +49551,7 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +-----------------------+----------------------+---------------------------+ @@ -46351,7 +49573,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_128 | + | kind | 2 bytes | $X_116 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -46361,7 +49583,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1496 | + | metadata | Determined from data | $X_1472 | +-----------------------+----------------------+-------------------------+ @@ -46389,9 +49611,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_127 | + | message | Variable | sequence of $X_115 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1373 | + | metadata | Determined from data | $X_1349 | +------------------------------------------------+----------------------+-------------------------+ @@ -46419,7 +49641,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +------------------------------------------------+----------------------+-------------------------+ @@ -46445,9 +49667,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_126 | + | commitment | 76 bytes | $X_114 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1130 | + | metadata | Determined from data | $X_1106 | +------------------------------------------------+----------------------+-------------------------+ @@ -46479,7 +49701,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------------------+ | is_opening_move | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_750 | + | metadata | Determined from data | $X_738 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -46507,7 +49729,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | stakers | 42 bytes | $X_2 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_750 | + | metadata | Determined from data | $X_738 | +------------------------------------------------+----------------------+-------------------------+ @@ -46547,7 +49769,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+--------------------------------------------------------------+ | message | Variable | bytes | +------------------------------------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_625 | + | metadata | Determined from data | $X_613 | +------------------------------------------------+----------------------+--------------------------------------------------------------+ @@ -46571,7 +49793,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_501 | + | metadata | Determined from data | $X_489 | +---------------+----------------------+------------------------+ @@ -46599,7 +49821,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_383 | + | metadata | Determined from data | $X_371 | +------------------------------------------------+----------------------+-------------------------+ @@ -46623,11 +49845,11 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | slot | 9 bytes | $X_1 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_265 | + | metadata | Determined from data | $X_253 | +---------------+----------------------+------------------------+ - X_3841 (Determined from data, 8-bit tag) + X_3817 (Determined from data, 8-bit tag) **************************************** Operation_with_metadata (tag 0) @@ -46666,7 +49888,7 @@ Protocol Kathmandu +---------------------------------+----------+----------------------------------------------------+ - X_4368 (Variable, 8-bit tag) + X_4320 (Variable, 8-bit tag) **************************** Operation with too large metadata (tag 0) @@ -46705,7 +49927,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_3841 | + | Unnamed field 0 | Determined from data | $X_3817 | +-----------------+----------------------+------------------------+ @@ -46725,7 +49947,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_4368 | + | Unnamed field 0 | Variable | $X_4320 | +-----------------------+----------+-------------------------+ @@ -46769,9 +49991,8 @@ Protocol Kathmandu "nonce": integer ∈ [0, 2^16-1], "amount": $014-PtKathma.mutez, "destination": $014-PtKathma.transaction_destination, - "parameters"?: - { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, + "value": any }, "result": $014-PtKathma.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -46779,7 +50000,7 @@ Protocol Kathmandu "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "result": $014-PtKathma.operation.alpha.internal_operation_result.origination } @@ -46787,7 +50008,7 @@ Protocol Kathmandu "kind": "delegation", "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $014-PtKathma.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -46821,7 +50042,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $014-PtKathma.tx_rollup_id } @@ -46845,7 +50066,7 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.error: /* The full list of RPC errors would be too long to include. @@ -46857,7 +50078,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -46869,7 +50090,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -47106,7 +50327,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -47134,26 +50355,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47162,28 +50383,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47191,7 +50412,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47203,15 +50424,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47219,7 +50440,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47229,7 +50450,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47242,7 +50463,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47250,7 +50471,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47258,7 +50479,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47266,7 +50487,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47278,7 +50499,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -47339,7 +50560,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47350,27 +50571,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47381,7 +50602,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47392,10 +50613,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47404,7 +50625,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47413,7 +50634,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47427,13 +50648,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -47553,18 +50774,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47577,7 +50798,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47585,7 +50806,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47594,7 +50815,7 @@ Protocol Kathmandu "slot_index": integer ∈ [0, 255] } $014-PtKathma.operation.alpha.contents_and_signature: { "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -47750,7 +50971,7 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Preendorsement */ "kind": "preendorsement", @@ -47761,13 +50982,13 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $014-PtKathma.inlined.preendorsement, @@ -47798,25 +51019,25 @@ Protocol Kathmandu $014-PtKathma.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -47826,7 +51047,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47835,7 +51056,7 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -47845,13 +51066,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "metadata": { "balance_updates"?: @@ -47862,12 +51083,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -47877,12 +51098,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -47892,7 +51113,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47907,7 +51128,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47923,7 +51144,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47938,7 +51159,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47955,7 +51176,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47975,7 +51196,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -47990,7 +51211,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48005,7 +51226,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48020,7 +51241,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48032,7 +51253,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -48100,13 +51321,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, @@ -48120,7 +51341,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48138,7 +51359,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48149,11 +51370,11 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -48163,7 +51384,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48174,7 +51395,7 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -48184,7 +51405,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48200,7 +51421,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48216,7 +51437,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48237,13 +51458,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -48370,15 +51591,15 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -48388,7 +51609,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48408,7 +51629,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48423,7 +51644,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -48700,7 +51921,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -48722,7 +51943,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -48739,7 +51960,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -48761,7 +51982,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -49026,10 +52247,10 @@ Protocol Kathmandu { /* Operation_with_metadata */ "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -49044,7 +52265,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -49085,7 +52306,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -49157,9 +52378,8 @@ Protocol Kathmandu /* Sapling state identifier A sapling state identifier */ $bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -49208,13 +52428,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -49288,7 +52508,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -49296,7 +52516,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -49304,7 +52524,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, @@ -49312,14 +52532,14 @@ Protocol Kathmandu "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -49498,32 +52718,22 @@ Protocol Kathmandu X_7 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_8 + X_9 *** - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_7 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ - - - X_11 - **** - +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ @@ -49533,7 +52743,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_12 (Determined from data, 8-bit tag) + X_10 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -49546,7 +52756,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_11 | + | sparse_proof | Variable | sequence of $X_9 | +-----------------------+----------+-------------------------+ @@ -49562,25 +52772,37 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_10 - **** + X_8 + *** +--------+----------------------+-----------------------+ | Name | Size | Contents | +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_12 | + | proofs | Determined from data | $X_10 | +--------+----------------------+-----------------------+ - X_13 + X_12 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_11 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -49611,7 +52833,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_13 | + | inode_values | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49623,7 +52845,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_10 | + | inode_tree | Determined from data | $X_8 | +------------+----------------------+------------------------+ @@ -49635,7 +52857,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_8 | + | inode_extender | Determined from data | $X_7 | +----------------+----------------------+------------------------+ @@ -49688,7 +52910,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_13 | + | node | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49712,7 +52934,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_10 | + | inode | Determined from data | $X_8 | +-------+----------------------+------------------------+ @@ -49724,7 +52946,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_8 | + | extender | Determined from data | $X_7 | +----------+----------------------+------------------------+ @@ -49754,7 +52976,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_38 (Determined from data, 8-bit tag) + X_34 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -49785,7 +53007,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_39 (Determined from data, 8-bit tag) + X_35 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -49822,7 +53044,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_77 (Determined from data, 8-bit tag) + X_69 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -49835,9 +53057,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ @@ -49851,13 +53073,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ - X_80 + X_72 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -49873,7 +53095,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_79 + X_71 **** +------------------------------------------------+----------------------+-------------------------+ @@ -49895,11 +53117,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_80 | + | old_levels_messages | Determined from data | $X_72 | +------------------------------------------------+----------------------+-------------------------+ - X_81 + X_73 **** +-----------------------+----------+-------------------------+ @@ -49907,23 +53129,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_80 | + | Unnamed field 0 | Variable | sequence of $X_72 | +-----------------------+----------+-------------------------+ - X_78 + X_70 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_79 | + | Unnamed field 0 | Determined from data | $X_71 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_81 | + | Unnamed field 1 | Determined from data | $X_73 | +-----------------+----------------------+----------+ - X_121 (Determined from data, 8-bit tag) + X_109 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -49946,19 +53168,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_78 | + | skips | Variable | sequence of $X_70 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_79 | + | level | Determined from data | $X_71 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_80 | + | inc | Variable | sequence of $X_72 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_3 | +-----------------------+----------------------+-------------------------+ - X_123 (Determined from data, 8-bit tag) + X_111 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -49983,19 +53205,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_122 + X_110 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_123 | + | Unnamed field 0 | Determined from data | $X_111 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_124 (Determined from data, 8-bit tag) + X_112 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -50008,7 +53230,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_122 | + | Unnamed field 0 | Variable | sequence of $X_110 | +-----------------------+----------+-------------------------+ @@ -50020,9 +53242,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_77 | + | pvm_step | Determined from data | $X_69 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_121 | + | inbox | Determined from data | $X_109 | +----------+----------------------+------------------------+ @@ -50034,11 +53256,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_124 | + | step | Determined from data | $X_112 | +--------+----------------------+----------+ - X_125 + X_113 ***** +--------------------+----------+-----------------------+ @@ -50056,7 +53278,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_126 + X_114 ***** +-----------------------+----------+-------------------------+ @@ -50068,7 +53290,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_127 (2 bytes, 16-bit tag) + X_115 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -50097,13 +53319,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -50120,7 +53342,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_129 (Determined from data, 8-bit tag) + X_117 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -50171,7 +53393,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_128 + X_116 ***** +-----------------------+----------------------+---------------------------+ @@ -50187,13 +53409,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_130 + X_118 ***** +-------------+----------------------+------------------+ @@ -50205,11 +53427,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-------------+----------------------+------------------+ - X_132 (Determined from data, 8-bit tag) + X_120 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -50234,11 +53456,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_130 | + | deposit | Determined from data | $X_118 | +---------+----------------------+------------------------+ - X_133 + X_121 ***** +--------------------+----------+----------+ @@ -50250,7 +53472,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_141 (33 bytes, 8-bit tag) + X_129 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -50277,19 +53499,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_139 + X_127 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_141 | + | Unnamed field 1 | 33 bytes | $X_129 | +-----------------+----------------------+----------+ - X_148 + X_136 ***** +-----------------+----------+----------+ @@ -50301,7 +53523,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_152 + X_140 ***** +-----------------+----------+----------+ @@ -50311,11 +53533,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_160 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_164 (Determined from data, 8-bit tag) + X_152 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -50376,7 +53594,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50390,7 +53608,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -50404,7 +53622,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50418,7 +53636,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50432,7 +53650,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50446,7 +53664,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -50460,7 +53678,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50474,7 +53692,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -50488,7 +53706,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -50502,7 +53720,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+-------------------------+ @@ -50516,7 +53734,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -50530,7 +53748,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -50552,7 +53770,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_127 | +-----------------+----------+------------------------------+ @@ -50564,7 +53782,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_127 | +-----------------+----------+------------------------------+ @@ -50578,7 +53796,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_139 | + | Unnamed field 0 | Variable | sequence of $X_127 | +-----------------------+----------+-------------------------+ @@ -50634,7 +53852,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -50650,7 +53868,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -50666,7 +53884,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -50682,13 +53900,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_134 + X_122 ***** +-----------------------+----------+-------------------------+ @@ -50696,11 +53914,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_164 | + | Unnamed field 0 | Variable | sequence of $X_152 | +-----------------------+----------+-------------------------+ - X_258 (Determined from data, 8-bit tag) + X_246 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -50717,7 +53935,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -50735,7 +53953,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -50753,7 +53971,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -50771,11 +53989,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ - X_260 (Determined from data, 8-bit tag) + X_248 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -50800,7 +54018,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_259 + X_247 ***** +-----------------------+----------------------+-------------------------+ @@ -50812,7 +54030,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_260 | + | predecessor | Determined from data | $X_248 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -50930,7 +54148,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_261 + X_249 ***** +-----------------------+----------------------+--------------------------+ @@ -50983,7 +54201,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_262 + X_250 ***** +-----------------+-----------+----------+ @@ -51246,7 +54464,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_262 | + | solution | 200 bytes | $X_250 | +----------+-----------+------------------------+ @@ -51360,7 +54578,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+-------------------------------------+ @@ -51558,7 +54776,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_259 | + | commitment | Determined from data | $X_247 | +---------------+----------------------+------------------------+ @@ -51650,7 +54868,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_132 | + | message | Determined from data | $X_120 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -51664,13 +54882,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_133 | + | previous_message_result | 64 bytes | $X_121 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_258 | + | proof | Determined from data | $X_246 | +------------------------------+----------------------+-------------------------+ @@ -51706,7 +54924,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_128 | + | tickets_info | Variable | sequence of $X_116 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -51766,7 +54984,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_127 | + | kind | 2 bytes | $X_115 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -51802,7 +55020,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_126 | + | message | Variable | sequence of $X_114 | +------------------------------------------------+----------------------+-------------------------+ @@ -51854,7 +55072,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_125 | + | commitment | 76 bytes | $X_113 | +------------------------------------------------+----------------------+-------------------------+ @@ -52051,7 +55269,7 @@ Protocol Kathmandu +------------------------------------------------+----------+-------------------------+ - X_266 (Determined from data, 8-bit tag) + X_254 (Determined from data, 8-bit tag) *************************************** Contract (tag 0) @@ -52290,7 +55508,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_267 (1 byte, 8-bit tag) + X_255 (1 byte, 8-bit tag) ************************* Block_application (tag 0) @@ -52333,21 +55551,21 @@ Protocol Kathmandu +------+--------+------------------------+ - X_265 + X_253 ***** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_266 | + | Unnamed field 0 | Determined from data | $X_254 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_267 | + | origin | 1 byte | $X_255 | +-----------------+----------------------+-----------------------+ - X_268 + X_256 ***** +-----------------------+----------+-------------------------+ @@ -52355,7 +55573,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_126 | + | Unnamed field 0 | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -52384,7 +55602,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -52408,7 +55626,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -52921,7 +56139,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_278 + X_266 ***** +-----------------+----------------------+---------------------------------+ @@ -52933,7 +56151,7 @@ Protocol Kathmandu +-----------------+----------------------+---------------------------------+ - X_277 + X_265 ***** +-----------------------------+----------+-------------------------+ @@ -52941,7 +56159,7 @@ Protocol Kathmandu +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_278 | + | commitments_and_ciphertexts | Variable | sequence of $X_266 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -52949,7 +56167,7 @@ Protocol Kathmandu +-----------------------------+----------+-------------------------+ - X_283 (Determined from data, 8-bit tag) + X_271 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -52960,7 +56178,7 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +---------+----------------------+------------------------+ @@ -52984,7 +56202,7 @@ Protocol Kathmandu +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +---------+----------------------+------------------------+ @@ -52996,13 +56214,13 @@ Protocol Kathmandu +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_284 + X_272 ***** +-----------------------------+----------------------+-------------------------------------------------+ @@ -53018,7 +56236,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------------------+ - X_295 (Determined from data, 8-bit tag) + X_283 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -53031,7 +56249,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------+-------------------------+ @@ -53057,7 +56275,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------------------+-------------------------+ @@ -53071,7 +56289,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.014-PtKathma.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -53079,7 +56297,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ - X_296 (Determined from data, 8-bit tag) + X_284 (Determined from data, 8-bit tag) *************************************** big_map (tag 0) @@ -53092,7 +56310,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_295 | + | diff | Determined from data | $X_283 | +------+----------------------+------------------------+ @@ -53106,7 +56324,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_283 | + | diff | Determined from data | $X_271 | +------+----------------------+------------------------+ @@ -53118,7 +56336,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_296 | + | Unnamed field 0 | Variable | sequence of $X_284 | +-----------------------+----------+-------------------------+ @@ -53135,7 +56353,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -53163,7 +56381,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53187,11 +56405,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -53215,13 +56433,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -53266,7 +56484,7 @@ Protocol Kathmandu +----------------+----------+------------------------+ - X_351 (Determined from data, 8-bit tag) + X_339 (Determined from data, 8-bit tag) *************************************** To_contract (tag 0) @@ -53283,7 +56501,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -53313,7 +56531,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -53333,7 +56551,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +-------------------+----------------------+------------------------+ @@ -53348,7 +56566,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_351 | + | Unnamed field 0 | Determined from data | $X_339 | +-----------------+----------------------+------------------------+ @@ -53362,7 +56580,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53386,9 +56604,9 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_351 | + | Unnamed field 0 | Determined from data | $X_339 | +------------------------------+----------------------+-------------------------------------+ @@ -53413,7 +56631,7 @@ Protocol Kathmandu +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -53489,7 +56707,7 @@ Protocol Kathmandu +-------------------------------+----------------------+------------------------------------------------------------------------+ - X_264 + X_252 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53497,7 +56715,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.dal_publish_slot_header | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53536,7 +56754,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53560,7 +56778,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -53570,7 +56788,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_382 + X_370 ***** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -53578,7 +56796,7 @@ Protocol Kathmandu +==========================================================================+======================+=============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -53601,7 +56819,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -53617,7 +56835,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53641,17 +56859,17 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_500 + X_488 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53659,7 +56877,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53682,7 +56900,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -53700,7 +56918,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53724,11 +56942,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -53736,7 +56954,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_624 + X_612 ***** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -53744,7 +56962,7 @@ Protocol Kathmandu +==========================================================================+======================+=================================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -53754,7 +56972,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_754 (Determined from data, 8-bit tag) + X_742 (Determined from data, 8-bit tag) *************************************** Conflict_resolved (tag 0) @@ -53791,7 +57009,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_755 (Determined from data, 8-bit tag) + X_743 (Determined from data, 8-bit tag) *************************************** Ongoing (tag 0) @@ -53812,7 +57030,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_754 | + | Unnamed field 0 | Determined from data | $X_742 | +-----------------+----------------------+------------------------+ | Unnamed field 1 | 21 bytes | $public_key_hash | +-----------------+----------------------+------------------------+ @@ -53831,11 +57049,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | status | Determined from data | $X_755 | + | status | Determined from data | $X_743 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -53849,7 +57067,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53873,19 +57091,19 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | status | Determined from data | $X_755 | + | status | Determined from data | $X_743 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_749 + X_737 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53893,7 +57111,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53922,7 +57140,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -53936,7 +57154,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -53960,7 +57178,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -53970,11 +57188,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1129 + X_1105 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -53982,7 +57200,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54005,7 +57223,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +-------------------+----------------------+------------------------+ @@ -54019,7 +57237,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54043,15 +57261,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +------------------------------+----------------------+-------------------------------------+ - X_1372 + X_1348 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54059,7 +57277,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54082,7 +57300,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -54102,7 +57320,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54126,11 +57344,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -54140,7 +57358,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1495 + X_1471 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54148,7 +57366,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54171,7 +57389,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -54189,7 +57407,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54213,11 +57431,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -54225,7 +57443,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2122 + X_2098 ****** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -54233,7 +57451,7 @@ Protocol Kathmandu +==========================================================================+======================+============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -54256,7 +57474,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -54274,7 +57492,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54298,11 +57516,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -54310,7 +57528,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2620 + X_2596 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54318,7 +57536,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54341,7 +57559,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -54359,7 +57577,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54383,11 +57601,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -54395,7 +57613,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2744 + X_2720 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54403,7 +57621,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54426,7 +57644,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -54446,7 +57664,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -54470,11 +57688,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -54484,7 +57702,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_3110 + X_3086 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54492,7 +57710,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54502,7 +57720,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3352 + X_3328 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54510,7 +57728,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54520,7 +57738,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3517 + X_3493 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54528,7 +57746,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -54538,7 +57756,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3813 + X_3789 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -54546,7 +57764,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -54554,7 +57772,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_3817 + X_3793 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -54562,7 +57780,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -54578,7 +57796,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_265 | + | Unnamed field 0 | Variable | sequence of $X_253 | +-----------------------+----------+-------------------------+ @@ -54721,7 +57939,7 @@ Protocol Kathmandu +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_262 | + | solution | 200 bytes | $X_250 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $014-PtKathma.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -54743,7 +57961,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3817 | + | metadata | Determined from data | $X_3793 | +--------------------+----------------------+-------------------------+ @@ -54763,7 +57981,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3813 | + | metadata | Determined from data | $X_3789 | +--------------------+----------------------+-------------------------+ @@ -54803,7 +58021,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +---------------+----------------------+------------------------+ @@ -54831,9 +58049,9 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3517 | + | metadata | Determined from data | $X_3493 | +----------------------------------+----------------------+-------------------------------------+ @@ -54863,7 +58081,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $014-PtKathma.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3352 | + | metadata | Determined from data | $X_3328 | +--------------------------------+----------------------+-------------------------------------+ @@ -54889,7 +58107,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +--------------------------------+----------------------+-------------------------------------+ @@ -54915,7 +58133,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3110 | + | metadata | Determined from data | $X_3086 | +-----------------------+----------------------+-------------------------+ @@ -54941,7 +58159,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +-----------------------------+----------------------+-------------------------------------+ @@ -54967,7 +58185,7 @@ Protocol Kathmandu +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $014-PtKathma.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+--------------------------------------+ @@ -54989,7 +58207,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2744 | + | metadata | Determined from data | $X_2720 | +---------------+----------------------+------------------------+ @@ -55021,7 +58239,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_2620 | + | metadata | Determined from data | $X_2596 | +----------------------------------+----------------------+-------------------------------------+ @@ -55045,9 +58263,9 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_259 | + | commitment | Determined from data | $X_247 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -55071,7 +58289,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -55095,7 +58313,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2122 | + | metadata | Determined from data | $X_2098 | +---------------+----------------------+------------------------+ @@ -55119,7 +58337,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2122 | + | metadata | Determined from data | $X_2098 | +---------------+----------------------+------------------------+ @@ -55145,7 +58363,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_132 | + | message | Determined from data | $X_120 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -55159,15 +58377,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_133 | + | previous_message_result | 64 bytes | $X_121 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_258 | + | proof | Determined from data | $X_246 | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +------------------------------+----------------------+-------------------------+ @@ -55203,9 +58421,9 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_128 | + | tickets_info | Variable | sequence of $X_116 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -55245,7 +58463,7 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +-----------------------+----------------------+---------------------------+ @@ -55267,7 +58485,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_127 | + | kind | 2 bytes | $X_115 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -55277,7 +58495,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1495 | + | metadata | Determined from data | $X_1471 | +-----------------------+----------------------+-------------------------+ @@ -55305,9 +58523,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_126 | + | message | Variable | sequence of $X_114 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1372 | + | metadata | Determined from data | $X_1348 | +------------------------------------------------+----------------------+-------------------------+ @@ -55335,7 +58553,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +------------------------------------------------+----------------------+-------------------------+ @@ -55361,9 +58579,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_125 | + | commitment | 76 bytes | $X_113 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1129 | + | metadata | Determined from data | $X_1105 | +------------------------------------------------+----------------------+-------------------------+ @@ -55395,7 +58613,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------------------+ | is_opening_move | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_749 | + | metadata | Determined from data | $X_737 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -55423,7 +58641,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | stakers | 42 bytes | $X_1 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_749 | + | metadata | Determined from data | $X_737 | +------------------------------------------------+----------------------+-------------------------+ @@ -55463,7 +58681,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+--------------------------------------------------------------+ | message | Variable | bytes | +------------------------------------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +------------------------------------------------+----------------------+--------------------------------------------------------------+ @@ -55487,7 +58705,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -55515,7 +58733,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_382 | + | metadata | Determined from data | $X_370 | +------------------------------------------------+----------------------+-------------------------+ @@ -55539,11 +58757,11 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | slot | 9 bytes | $X_0 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +---------------+----------------------+------------------------+ - X_3840 (Determined from data, 8-bit tag) + X_3816 (Determined from data, 8-bit tag) **************************************** Operation_with_metadata (tag 0) @@ -55582,7 +58800,7 @@ Protocol Kathmandu +---------------------------------+----------+----------------------------------------------------+ - X_4367 (Variable, 8-bit tag) + X_4319 (Variable, 8-bit tag) **************************** Operation with too large metadata (tag 0) @@ -55621,7 +58839,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_3840 | + | Unnamed field 0 | Determined from data | $X_3816 | +-----------------+----------------------+------------------------+ @@ -55641,7 +58859,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_4367 | + | Unnamed field 0 | Variable | $X_4319 | +-----------------------+----------+-------------------------+ </pre> @@ -55669,7 +58887,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", @@ -55677,7 +58895,7 @@ Protocol Kathmandu "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, @@ -55685,14 +58903,14 @@ Protocol Kathmandu "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.apply_internal_results.alpha.operation_result: { /* transaction */ "kind": "transaction", @@ -55700,9 +58918,8 @@ Protocol Kathmandu "nonce": integer ∈ [0, 2^16-1], "amount": $014-PtKathma.mutez, "destination": $014-PtKathma.transaction_destination, - "parameters"?: - { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, + "value": any }, "result": $014-PtKathma.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -55710,7 +58927,7 @@ Protocol Kathmandu "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "result": $014-PtKathma.operation.alpha.internal_operation_result.origination } @@ -55718,7 +58935,7 @@ Protocol Kathmandu "kind": "delegation", "source": $014-PtKathma.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $014-PtKathma.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -55752,7 +58969,7 @@ Protocol Kathmandu "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $014-PtKathma.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $014-PtKathma.tx_rollup_id } @@ -55776,7 +58993,7 @@ Protocol Kathmandu || "do" || "set_delegate" || "remove_delegate" - || string + || $unistring /* named */ $014-PtKathma.error: /* The full list of RPC errors would be too long to include. @@ -55788,7 +59005,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -55800,7 +59017,7 @@ Protocol Kathmandu /* An operation's shell header. */ { "branch": $block_hash, "operations": $014-PtKathma.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -56037,7 +59254,7 @@ Protocol Kathmandu "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -56065,26 +59282,26 @@ Protocol Kathmandu "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56093,28 +59310,28 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56122,7 +59339,7 @@ Protocol Kathmandu "limit"?: $014-PtKathma.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56134,15 +59351,15 @@ Protocol Kathmandu "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56150,7 +59367,7 @@ Protocol Kathmandu "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56160,7 +59377,7 @@ Protocol Kathmandu "burn_limit"?: $014-PtKathma.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56173,7 +59390,7 @@ Protocol Kathmandu "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56181,7 +59398,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56189,7 +59406,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56197,7 +59414,7 @@ Protocol Kathmandu "rollup": $014-PtKathma.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56209,7 +59426,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -56270,7 +59487,7 @@ Protocol Kathmandu "proof": $Context_hash } } } } ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56281,27 +59498,27 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56312,7 +59529,7 @@ Protocol Kathmandu "header": integer ∈ [-2^30, 2^30] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56323,10 +59540,10 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56335,7 +59552,7 @@ Protocol Kathmandu "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56344,7 +59561,7 @@ Protocol Kathmandu "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56358,13 +59575,13 @@ Protocol Kathmandu "number_of_ticks": integer ∈ [-2^31-1, 2^31] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -56484,18 +59701,18 @@ Protocol Kathmandu "is_opening_move": boolean } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56508,7 +59725,7 @@ Protocol Kathmandu "message": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56516,7 +59733,7 @@ Protocol Kathmandu "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56525,7 +59742,7 @@ Protocol Kathmandu "slot_index": integer ∈ [0, 255] } $014-PtKathma.operation.alpha.contents_and_signature: { "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $014-PtKathma.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -56681,7 +59898,7 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Preendorsement */ "kind": "preendorsement", @@ -56692,13 +59909,13 @@ Protocol Kathmandu "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30] } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $014-PtKathma.inlined.preendorsement, @@ -56729,25 +59946,25 @@ Protocol Kathmandu $014-PtKathma.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -56757,7 +59974,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56766,7 +59983,7 @@ Protocol Kathmandu "destination": $014-PtKathma.contract_id, "parameters"?: { "entrypoint": $014-PtKathma.entrypoint, - "value": $micheline.014-PtKathma.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -56776,13 +59993,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $014-PtKathma.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $014-PtKathma.scripted.contracts, "metadata": { "balance_updates"?: @@ -56793,12 +60010,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -56808,12 +60025,12 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.014-PtKathma.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -56823,7 +60040,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56838,7 +60055,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56854,7 +60071,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56869,7 +60086,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56886,7 +60103,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56906,7 +60123,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56921,7 +60138,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56936,7 +60153,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56951,7 +60168,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56963,7 +60180,7 @@ Protocol Kathmandu "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Tx_rollup_l2_address, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -57031,13 +60248,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.014-PtKathma.michelson_v1.expression, - "ticket_ty": $micheline.014-PtKathma.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $014-PtKathma.contract_id, "ticket_amount": $positive_bignum, "destination": $014-PtKathma.contract_id, @@ -57051,7 +60268,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57069,7 +60286,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57080,11 +60297,11 @@ Protocol Kathmandu "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.014-PtKathma.michelson_v1.expression, - "ty": $micheline.014-PtKathma.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $014-PtKathma.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -57094,7 +60311,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57105,7 +60322,7 @@ Protocol Kathmandu || any /* Wasm 2.0.0 smart contract rollup kind */, "boot_sector": $unistring, - "parameters_ty": $micheline.014-PtKathma.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -57115,7 +60332,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57131,7 +60348,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57147,7 +60364,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57168,13 +60385,13 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation": { "choice": $positive_bignum, "step": @@ -57301,15 +60518,15 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $014-PtKathma.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $014-PtKathma.operation_metadata.alpha.balance_updates, @@ -57319,7 +60536,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57339,7 +60556,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57354,7 +60571,7 @@ Protocol Kathmandu [ $014-PtKathma.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $014-PtKathma.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -57631,7 +60848,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -57653,7 +60870,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -57670,7 +60887,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -57692,7 +60909,7 @@ Protocol Kathmandu /* Invalid_move */ || any /* Timeout */, - $Signature.Public_key_hash ] + $Signature.V0.Public_key_hash ] /* Ended */, "balance_updates": $014-PtKathma.operation_metadata.alpha.balance_updates } @@ -57957,10 +61174,10 @@ Protocol Kathmandu { /* Operation_with_metadata */ "contents": [ $014-PtKathma.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $014-PtKathma.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $014-PtKathma.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -57975,7 +61192,7 @@ Protocol Kathmandu || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -58016,7 +61233,7 @@ Protocol Kathmandu || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -58088,9 +61305,8 @@ Protocol Kathmandu /* Sapling state identifier A sapling state identifier */ $bignum - $014-PtKathma.scripted.contracts: - { "code": $micheline.014-PtKathma.michelson_v1.expression, - "storage": $micheline.014-PtKathma.michelson_v1.expression } + $014-PtKathma.scripted.contracts: { "code": any, + "storage": any } $014-PtKathma.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -58139,13 +61355,13 @@ Protocol Kathmandu $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Tx_rollup_l2_address: @@ -58219,7 +61435,7 @@ Protocol Kathmandu annotations) */ "prim": $014-PtKathma.michelson.v1.primitives, "args"?: [ $micheline.014-PtKathma.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -58295,7 +61511,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_4367 | + | Unnamed field 0 | Variable | $X_4319 | +-----------------------+----------+-------------------------+ @@ -58406,32 +61622,22 @@ Protocol Kathmandu X_7 *** - +-----------------------+----------+------------------------+ - | Name | Size | Contents | - +=======================+==========+========================+ - | # bytes in next field | 1 byte | unsigned 8-bit integer | - +-----------------------+----------+------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+------------------------+ + +-----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=======================+======================+========================+ + | length | 8 bytes | signed 64-bit integer | + +-----------------------+----------------------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------+ + | segment | Variable | bytes | + +-----------------------+----------------------+------------------------+ + | proof | Determined from data | $inode_tree | + +-----------------------+----------------------+------------------------+ - X_8 + X_9 *** - +---------+----------------------+-----------------------+ - | Name | Size | Contents | - +=========+======================+=======================+ - | length | 8 bytes | signed 64-bit integer | - +---------+----------------------+-----------------------+ - | segment | Determined from data | $X_7 | - +---------+----------------------+-----------------------+ - | proof | Determined from data | $inode_tree | - +---------+----------------------+-----------------------+ - - - X_11 - **** - +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ @@ -58441,7 +61647,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_12 (Determined from data, 8-bit tag) + X_10 (Determined from data, 8-bit tag) ************************************** sparse_proof (tag 0) @@ -58454,7 +61660,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | sparse_proof | Variable | sequence of $X_11 | + | sparse_proof | Variable | sequence of $X_9 | +-----------------------+----------+-------------------------+ @@ -58470,25 +61676,37 @@ Protocol Kathmandu +-------------+----------------------+------------------------------------+ - X_10 - **** + X_8 + *** +--------+----------------------+-----------------------+ | Name | Size | Contents | +========+======================+=======================+ | length | 8 bytes | signed 64-bit integer | +--------+----------------------+-----------------------+ - | proofs | Determined from data | $X_12 | + | proofs | Determined from data | $X_10 | +--------+----------------------+-----------------------+ - X_13 + X_12 + **** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_11 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ @@ -58519,7 +61737,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | inode_values | Variable | sequence of $X_13 | + | inode_values | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -58531,7 +61749,7 @@ Protocol Kathmandu +============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------+----------------------+------------------------+ - | inode_tree | Determined from data | $X_10 | + | inode_tree | Determined from data | $X_8 | +------------+----------------------+------------------------+ @@ -58543,7 +61761,7 @@ Protocol Kathmandu +================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------------+----------------------+------------------------+ - | inode_extender | Determined from data | $X_8 | + | inode_extender | Determined from data | $X_7 | +----------------+----------------------+------------------------+ @@ -58596,7 +61814,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | node | Variable | sequence of $X_13 | + | node | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -58620,7 +61838,7 @@ Protocol Kathmandu +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | inode | Determined from data | $X_10 | + | inode | Determined from data | $X_8 | +-------+----------------------+------------------------+ @@ -58632,7 +61850,7 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | extender | Determined from data | $X_8 | + | extender | Determined from data | $X_7 | +----------+----------------------+------------------------+ @@ -58662,7 +61880,7 @@ Protocol Kathmandu +---------+----------------------+-----------------------+ - X_38 (Determined from data, 8-bit tag) + X_34 (Determined from data, 8-bit tag) ************************************** None (tag 0) @@ -58693,7 +61911,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ - X_39 (Determined from data, 8-bit tag) + X_35 (Determined from data, 8-bit tag) ************************************** No_input_required (tag 0) @@ -58730,7 +61948,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ - X_77 (Determined from data, 8-bit tag) + X_69 (Determined from data, 8-bit tag) ************************************** Arithmetic PVM with proof (tag 0) @@ -58743,9 +61961,9 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ @@ -58759,13 +61977,13 @@ Protocol Kathmandu +------------+----------------------+------------------------+ | tree_proof | Determined from data | $X_3 | +------------+----------------------+------------------------+ - | given | Determined from data | $X_38 | + | given | Determined from data | $X_34 | +------------+----------------------+------------------------+ - | requested | Determined from data | $X_39 | + | requested | Determined from data | $X_35 | +------------+----------------------+------------------------+ - X_80 + X_72 **** +-----------------------+----------+--------------------------------------------------------------+ @@ -58781,7 +61999,7 @@ Protocol Kathmandu +-----------------------+----------+--------------------------------------------------------------+ - X_79 + X_71 **** +------------------------------------------------+----------------------+-------------------------+ @@ -58803,11 +62021,11 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | current_messages_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_80 | + | old_levels_messages | Determined from data | $X_72 | +------------------------------------------------+----------------------+-------------------------+ - X_81 + X_73 **** +-----------------------+----------+-------------------------+ @@ -58815,23 +62033,23 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_80 | + | Unnamed field 0 | Variable | sequence of $X_72 | +-----------------------+----------+-------------------------+ - X_78 + X_70 **** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_79 | + | Unnamed field 0 | Determined from data | $X_71 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_81 | + | Unnamed field 1 | Determined from data | $X_73 | +-----------------+----------------------+----------+ - X_121 (Determined from data, 8-bit tag) + X_109 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -58854,19 +62072,19 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | skips | Variable | sequence of $X_78 | + | skips | Variable | sequence of $X_70 | +-----------------------+----------------------+-------------------------+ - | level | Determined from data | $X_79 | + | level | Determined from data | $X_71 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | inc | Variable | sequence of $X_80 | + | inc | Variable | sequence of $X_72 | +-----------------------+----------------------+-------------------------+ | message_proof | Determined from data | $X_3 | +-----------------------+----------------------+-------------------------+ - X_123 (Determined from data, 8-bit tag) + X_111 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -58891,19 +62109,19 @@ Protocol Kathmandu +------------+----------+------------------------+ - X_122 + X_110 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_123 | + | Unnamed field 0 | Determined from data | $X_111 | +-----------------+----------------------+----------+ | Unnamed field 1 | Determined from data | $N.t | +-----------------+----------------------+----------+ - X_124 (Determined from data, 8-bit tag) + X_112 (Determined from data, 8-bit tag) *************************************** Dissection (tag 0) @@ -58916,7 +62134,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_122 | + | Unnamed field 0 | Variable | sequence of $X_110 | +-----------------------+----------+-------------------------+ @@ -58928,9 +62146,9 @@ Protocol Kathmandu +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | pvm_step | Determined from data | $X_77 | + | pvm_step | Determined from data | $X_69 | +----------+----------------------+------------------------+ - | inbox | Determined from data | $X_121 | + | inbox | Determined from data | $X_109 | +----------+----------------------+------------------------+ @@ -58942,11 +62160,11 @@ Protocol Kathmandu +========+======================+==========+ | choice | Determined from data | $N.t | +--------+----------------------+----------+ - | step | Determined from data | $X_124 | + | step | Determined from data | $X_112 | +--------+----------------------+----------+ - X_125 + X_113 ***** +--------------------+----------+-----------------------+ @@ -58964,7 +62182,7 @@ Protocol Kathmandu +--------------------+----------+-----------------------+ - X_126 + X_114 ***** +-----------------------+----------+-------------------------+ @@ -58976,7 +62194,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_127 (2 bytes, 16-bit tag) + X_115 (2 bytes, 16-bit tag) *************************** Example_arith smart contract rollup kind (tag 0) @@ -59005,13 +62223,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -59028,7 +62246,7 @@ Protocol Kathmandu +---------------+----------+------------------------+ - X_129 (Determined from data, 8-bit tag) + X_117 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -59079,7 +62297,7 @@ Protocol Kathmandu +-----------------+---------+------------------------+ - X_128 + X_116 ***** +-----------------------+----------------------+---------------------------+ @@ -59095,13 +62313,13 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $014-PtKathma.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_130 + X_118 ***** +-------------+----------------------+------------------+ @@ -59113,11 +62331,11 @@ Protocol Kathmandu +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_129 | + | amount | Determined from data | $X_117 | +-------------+----------------------+------------------+ - X_132 (Determined from data, 8-bit tag) + X_120 (Determined from data, 8-bit tag) *************************************** Batch (tag 0) @@ -59142,11 +62360,11 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_130 | + | deposit | Determined from data | $X_118 | +---------+----------------------+------------------------+ - X_133 + X_121 ***** +--------------------+----------+----------+ @@ -59158,7 +62376,7 @@ Protocol Kathmandu +--------------------+----------+----------+ - X_141 (33 bytes, 8-bit tag) + X_129 (33 bytes, 8-bit tag) *************************** case 0 (tag 0) @@ -59185,19 +62403,19 @@ Protocol Kathmandu +--------------+----------+------------------------+ - X_139 + X_127 ***** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+----------+ - | Unnamed field 1 | 33 bytes | $X_141 | + | Unnamed field 1 | 33 bytes | $X_129 | +-----------------+----------------------+----------+ - X_148 + X_136 ***** +-----------------+----------+----------+ @@ -59209,7 +62427,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_152 + X_140 ***** +-----------------+----------+----------+ @@ -59219,11 +62437,7 @@ Protocol Kathmandu +-----------------+----------+----------+ - X_160 - ***** - - This value's binary representation is empty. It takes zero (0) bytes of output. - X_164 (Determined from data, 8-bit tag) + X_152 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -59284,7 +62498,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59298,7 +62512,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -59312,7 +62526,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59326,7 +62540,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59340,7 +62554,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59354,7 +62568,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+-------------------------+ @@ -59368,7 +62582,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59382,7 +62596,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 32 bytes | $X_152 | + | Unnamed field 1 | 32 bytes | $X_140 | +-----------------+----------+------------------------+ @@ -59396,7 +62610,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -59410,7 +62624,7 @@ Protocol Kathmandu +-----------------+----------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------+-------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+-------------------------+ @@ -59424,7 +62638,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -59438,7 +62652,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------+------------------------+ - | Unnamed field 1 | 64 bytes | $X_148 | + | Unnamed field 1 | 64 bytes | $X_136 | +-----------------+----------+------------------------+ @@ -59460,7 +62674,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_127 | +-----------------+----------+------------------------------+ @@ -59472,7 +62686,7 @@ Protocol Kathmandu +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_139 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_127 | +-----------------+----------+------------------------------+ @@ -59486,7 +62700,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_139 | + | Unnamed field 0 | Variable | sequence of $X_127 | +-----------------------+----------+-------------------------+ @@ -59542,7 +62756,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -59558,7 +62772,7 @@ Protocol Kathmandu +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+-------------------------+ @@ -59574,7 +62788,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ @@ -59590,13 +62804,13 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_7 | + | Unnamed field 1 | Determined from data | $X_12 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - X_134 + X_122 ***** +-----------------------+----------+-------------------------+ @@ -59604,11 +62818,11 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_164 | + | Unnamed field 0 | Variable | sequence of $X_152 | +-----------------------+----------+-------------------------+ - X_258 (Determined from data, 8-bit tag) + X_246 (Determined from data, 8-bit tag) *************************************** case 0 (tag 0) @@ -59625,7 +62839,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -59643,7 +62857,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -59661,7 +62875,7 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ @@ -59679,11 +62893,11 @@ Protocol Kathmandu +-----------------+----------------------+------------------------+ | Unnamed field 2 | 32 bytes | bytes | +-----------------+----------------------+------------------------+ - | Unnamed field 3 | Determined from data | $X_134 | + | Unnamed field 3 | Determined from data | $X_122 | +-----------------+----------------------+------------------------+ - X_260 (Determined from data, 8-bit tag) + X_248 (Determined from data, 8-bit tag) *************************************** None (tag 0) @@ -59708,7 +62922,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_259 + X_247 ***** +-----------------------+----------------------+-------------------------+ @@ -59720,7 +62934,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_260 | + | predecessor | Determined from data | $X_248 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -59838,7 +63052,7 @@ Protocol Kathmandu +-----------------------+----------+------------------------+ - X_261 + X_249 ***** +-----------------------+----------------------+--------------------------+ @@ -59891,7 +63105,7 @@ Protocol Kathmandu +-----------------+----------+------------------------+ - X_262 + X_250 ***** +-----------------+-----------+----------+ @@ -60154,7 +63368,7 @@ Protocol Kathmandu +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_262 | + | solution | 200 bytes | $X_250 | +----------+-----------+------------------------+ @@ -60268,7 +63482,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+-------------------------------------+ @@ -60466,7 +63680,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_259 | + | commitment | Determined from data | $X_247 | +---------------+----------------------+------------------------+ @@ -60558,7 +63772,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_132 | + | message | Determined from data | $X_120 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -60572,13 +63786,13 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_133 | + | previous_message_result | 64 bytes | $X_121 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_258 | + | proof | Determined from data | $X_246 | +------------------------------+----------------------+-------------------------+ @@ -60614,7 +63828,7 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_128 | + | tickets_info | Variable | sequence of $X_116 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -60674,7 +63888,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_127 | + | kind | 2 bytes | $X_115 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -60710,7 +63924,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_126 | + | message | Variable | sequence of $X_114 | +------------------------------------------------+----------------------+-------------------------+ @@ -60762,7 +63976,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_125 | + | commitment | 76 bytes | $X_113 | +------------------------------------------------+----------------------+-------------------------+ @@ -60959,7 +64173,7 @@ Protocol Kathmandu +------------------------------------------------+----------+-------------------------+ - X_266 (Determined from data, 8-bit tag) + X_254 (Determined from data, 8-bit tag) *************************************** Contract (tag 0) @@ -61198,7 +64412,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_267 (1 byte, 8-bit tag) + X_255 (1 byte, 8-bit tag) ************************* Block_application (tag 0) @@ -61241,21 +64455,21 @@ Protocol Kathmandu +------+--------+------------------------+ - X_265 + X_253 ***** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_266 | + | Unnamed field 0 | Determined from data | $X_254 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_267 | + | origin | 1 byte | $X_255 | +-----------------+----------------------+-----------------------+ - X_268 + X_256 ***** +-----------------------+----------+-------------------------+ @@ -61263,7 +64477,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_126 | + | Unnamed field 0 | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -61292,7 +64506,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -61316,7 +64530,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -61829,7 +65043,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ - X_278 + X_266 ***** +-----------------+----------------------+---------------------------------+ @@ -61841,7 +65055,7 @@ Protocol Kathmandu +-----------------+----------------------+---------------------------------+ - X_277 + X_265 ***** +-----------------------------+----------+-------------------------+ @@ -61849,7 +65063,7 @@ Protocol Kathmandu +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_278 | + | commitments_and_ciphertexts | Variable | sequence of $X_266 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -61857,7 +65071,7 @@ Protocol Kathmandu +-----------------------------+----------+-------------------------+ - X_283 (Determined from data, 8-bit tag) + X_271 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -61868,7 +65082,7 @@ Protocol Kathmandu +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +---------+----------------------+------------------------+ @@ -61892,7 +65106,7 @@ Protocol Kathmandu +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +---------+----------------------+------------------------+ @@ -61904,13 +65118,13 @@ Protocol Kathmandu +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_277 | + | updates | Determined from data | $X_265 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_284 + X_272 ***** +-----------------------------+----------------------+-------------------------------------------------+ @@ -61926,7 +65140,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------------------+ - X_295 (Determined from data, 8-bit tag) + X_283 (Determined from data, 8-bit tag) *************************************** update (tag 0) @@ -61939,7 +65153,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------+-------------------------+ @@ -61965,7 +65179,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------------------+-------------------------+ @@ -61979,7 +65193,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_284 | + | updates | Variable | sequence of $X_272 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.014-PtKathma.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -61987,7 +65201,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------------------------------+ - X_296 (Determined from data, 8-bit tag) + X_284 (Determined from data, 8-bit tag) *************************************** big_map (tag 0) @@ -62000,7 +65214,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_295 | + | diff | Determined from data | $X_283 | +------+----------------------+------------------------+ @@ -62014,7 +65228,7 @@ Protocol Kathmandu +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_283 | + | diff | Determined from data | $X_271 | +------+----------------------+------------------------+ @@ -62026,7 +65240,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_296 | + | Unnamed field 0 | Variable | sequence of $X_284 | +-----------------------+----------+-------------------------+ @@ -62043,7 +65257,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -62071,7 +65285,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62095,11 +65309,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -62123,13 +65337,13 @@ Protocol Kathmandu Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -62174,7 +65388,7 @@ Protocol Kathmandu +----------------+----------+------------------------+ - X_351 (Determined from data, 8-bit tag) + X_339 (Determined from data, 8-bit tag) *************************************** To_contract (tag 0) @@ -62191,7 +65405,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -62221,7 +65435,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -62241,7 +65455,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +-------------------+----------------------+------------------------+ @@ -62256,7 +65470,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_351 | + | Unnamed field 0 | Determined from data | $X_339 | +-----------------+----------------------+------------------------+ @@ -62270,7 +65484,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62294,9 +65508,9 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_351 | + | Unnamed field 0 | Determined from data | $X_339 | +------------------------------+----------------------+-------------------------------------+ @@ -62321,7 +65535,7 @@ Protocol Kathmandu +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -62397,7 +65611,7 @@ Protocol Kathmandu +-------------------------------+----------------------+------------------------------------------------------------------------+ - X_264 + X_252 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62405,7 +65619,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.dal_publish_slot_header | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62444,7 +65658,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62468,7 +65682,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -62478,7 +65692,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ - X_382 + X_370 ***** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -62486,7 +65700,7 @@ Protocol Kathmandu +==========================================================================+======================+=============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -62509,7 +65723,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -62525,7 +65739,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62549,17 +65763,17 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_500 + X_488 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62567,7 +65781,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62590,7 +65804,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -62608,7 +65822,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62632,11 +65846,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -62644,7 +65858,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_624 + X_612 ***** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -62652,7 +65866,7 @@ Protocol Kathmandu +==========================================================================+======================+=================================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -62662,7 +65876,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_754 (Determined from data, 8-bit tag) + X_742 (Determined from data, 8-bit tag) *************************************** Conflict_resolved (tag 0) @@ -62699,7 +65913,7 @@ Protocol Kathmandu +------+--------+------------------------+ - X_755 (Determined from data, 8-bit tag) + X_743 (Determined from data, 8-bit tag) *************************************** Ongoing (tag 0) @@ -62720,7 +65934,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_754 | + | Unnamed field 0 | Determined from data | $X_742 | +-----------------+----------------------+------------------------+ | Unnamed field 1 | 21 bytes | $public_key_hash | +-----------------+----------------------+------------------------+ @@ -62739,11 +65953,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | status | Determined from data | $X_755 | + | status | Determined from data | $X_743 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -62757,7 +65971,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62781,19 +65995,19 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | status | Determined from data | $X_755 | + | status | Determined from data | $X_743 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_749 + X_737 ***** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62801,7 +66015,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62830,7 +66044,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -62844,7 +66058,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62868,7 +66082,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -62878,11 +66092,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1129 + X_1105 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62890,7 +66104,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62913,7 +66127,7 @@ Protocol Kathmandu +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +-------------------+----------------------+------------------------+ @@ -62927,7 +66141,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -62951,15 +66165,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_79 | + | inbox_after | Determined from data | $X_71 | +------------------------------+----------------------+-------------------------------------+ - X_1372 + X_1348 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62967,7 +66181,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -62990,7 +66204,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -63010,7 +66224,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -63034,11 +66248,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -63048,7 +66262,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_1495 + X_1471 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63056,7 +66270,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63079,7 +66293,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -63097,7 +66311,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -63121,11 +66335,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -63133,7 +66347,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2122 + X_2098 ****** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -63141,7 +66355,7 @@ Protocol Kathmandu +==========================================================================+======================+============================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -63164,7 +66378,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -63182,7 +66396,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -63206,11 +66420,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -63218,7 +66432,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2620 + X_2596 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63226,7 +66440,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63249,7 +66463,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -63267,7 +66481,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -63291,11 +66505,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -63303,7 +66517,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_2744 + X_2720 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63311,7 +66525,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63334,7 +66548,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -63354,7 +66568,7 @@ Protocol Kathmandu +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_126 | + | errors | Variable | sequence of $X_114 | +-----------------------+----------+-------------------------+ @@ -63378,11 +66592,11 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_268 | + | errors | Determined from data | $X_256 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -63392,7 +66606,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_3110 + X_3086 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63400,7 +66614,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63410,7 +66624,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3352 + X_3328 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63418,7 +66632,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63428,7 +66642,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3517 + X_3493 ****** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63436,7 +66650,7 @@ Protocol Kathmandu +==========================================================================+======================+=========================================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $014-PtKathma.operation.alpha.internal_operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -63446,7 +66660,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_3813 + X_3789 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -63454,7 +66668,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -63462,7 +66676,7 @@ Protocol Kathmandu +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_3817 + X_3793 ****** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -63470,7 +66684,7 @@ Protocol Kathmandu +==========================================================================+==========+==============================================================+ | # bytes in field "014-PtKathma.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_265 | + | balance_updates | Variable | sequence of $X_253 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -63486,7 +66700,7 @@ Protocol Kathmandu +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_265 | + | Unnamed field 0 | Variable | sequence of $X_253 | +-----------------------+----------+-------------------------+ @@ -63629,7 +66843,7 @@ Protocol Kathmandu +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_262 | + | solution | 200 bytes | $X_250 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $014-PtKathma.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -63651,7 +66865,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3817 | + | metadata | Determined from data | $X_3793 | +--------------------+----------------------+-------------------------+ @@ -63671,7 +66885,7 @@ Protocol Kathmandu +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3813 | + | metadata | Determined from data | $X_3789 | +--------------------+----------------------+-------------------------+ @@ -63711,7 +66925,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +---------------+----------------------+------------------------+ @@ -63739,9 +66953,9 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_261 | + | parameters | Determined from data | $X_249 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3517 | + | metadata | Determined from data | $X_3493 | +----------------------------------+----------------------+-------------------------------------+ @@ -63771,7 +66985,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $014-PtKathma.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_3352 | + | metadata | Determined from data | $X_3328 | +--------------------------------+----------------------+-------------------------------------+ @@ -63797,7 +67011,7 @@ Protocol Kathmandu +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +--------------------------------+----------------------+-------------------------------------+ @@ -63823,7 +67037,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_3110 | + | metadata | Determined from data | $X_3086 | +-----------------------+----------------------+-------------------------+ @@ -63849,7 +67063,7 @@ Protocol Kathmandu +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +-----------------------------+----------------------+-------------------------------------+ @@ -63875,7 +67089,7 @@ Protocol Kathmandu +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $014-PtKathma.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+--------------------------------------+ @@ -63897,7 +67111,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2744 | + | metadata | Determined from data | $X_2720 | +---------------+----------------------+------------------------+ @@ -63929,7 +67143,7 @@ Protocol Kathmandu +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_2620 | + | metadata | Determined from data | $X_2596 | +----------------------------------+----------------------+-------------------------------------+ @@ -63953,9 +67167,9 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_259 | + | commitment | Determined from data | $X_247 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -63979,7 +67193,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -64003,7 +67217,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2122 | + | metadata | Determined from data | $X_2098 | +---------------+----------------------+------------------------+ @@ -64027,7 +67241,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_2122 | + | metadata | Determined from data | $X_2098 | +---------------+----------------------+------------------------+ @@ -64053,7 +67267,7 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_132 | + | message | Determined from data | $X_120 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -64067,15 +67281,15 @@ Protocol Kathmandu +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_133 | + | previous_message_result | 64 bytes | $X_121 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ | previous_message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | proof | Determined from data | $X_258 | + | proof | Determined from data | $X_246 | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +------------------------------+----------------------+-------------------------+ @@ -64111,9 +67325,9 @@ Protocol Kathmandu +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_128 | + | tickets_info | Variable | sequence of $X_116 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -64153,7 +67367,7 @@ Protocol Kathmandu +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +-----------------------+----------------------+---------------------------+ @@ -64175,7 +67389,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+-------------------------+ - | kind | 2 bytes | $X_127 | + | kind | 2 bytes | $X_115 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ @@ -64185,7 +67399,7 @@ Protocol Kathmandu +-----------------------+----------------------+-------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1495 | + | metadata | Determined from data | $X_1471 | +-----------------------+----------------------+-------------------------+ @@ -64213,9 +67427,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_126 | + | message | Variable | sequence of $X_114 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1372 | + | metadata | Determined from data | $X_1348 | +------------------------------------------------+----------------------+-------------------------+ @@ -64243,7 +67457,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +------------------------------------------------+----------------------+-------------------------+ @@ -64269,9 +67483,9 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_125 | + | commitment | 76 bytes | $X_113 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_1129 | + | metadata | Determined from data | $X_1105 | +------------------------------------------------+----------------------+-------------------------+ @@ -64303,7 +67517,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------------------+ | is_opening_move | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_749 | + | metadata | Determined from data | $X_737 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -64331,7 +67545,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | stakers | 42 bytes | $X_1 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_749 | + | metadata | Determined from data | $X_737 | +------------------------------------------------+----------------------+-------------------------+ @@ -64371,7 +67585,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+--------------------------------------------------------------+ | message | Variable | bytes | +------------------------------------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_624 | + | metadata | Determined from data | $X_612 | +------------------------------------------------+----------------------+--------------------------------------------------------------+ @@ -64395,7 +67609,7 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_500 | + | metadata | Determined from data | $X_488 | +---------------+----------------------+------------------------+ @@ -64423,7 +67637,7 @@ Protocol Kathmandu +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_382 | + | metadata | Determined from data | $X_370 | +------------------------------------------------+----------------------+-------------------------+ @@ -64447,11 +67661,11 @@ Protocol Kathmandu +---------------+----------------------+------------------------+ | slot | 9 bytes | $X_0 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_264 | + | metadata | Determined from data | $X_252 | +---------------+----------------------+------------------------+ - X_3840 (Determined from data, 8-bit tag) + X_3816 (Determined from data, 8-bit tag) **************************************** Operation_with_metadata (tag 0) @@ -64490,7 +67704,7 @@ Protocol Kathmandu +---------------------------------+----------+----------------------------------------------------+ - X_4367 (Variable, 8-bit tag) + X_4319 (Variable, 8-bit tag) **************************** Operation with too large metadata (tag 0) @@ -64529,7 +67743,7 @@ Protocol Kathmandu +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_3840 | + | Unnamed field 0 | Determined from data | $X_3816 | +-----------------+----------------------+------------------------+ </pre> @@ -64616,6 +67830,43 @@ Protocol Kathmandu +.. _GET_..--block_id--resulting_context_hash : + +**GET ../<block_id>/resulting_context_hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashdescr', 'GET_..--block_id--resulting_context_hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.json', 'GET_..--block_id--resulting_context_hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.bin', 'GET_..--block_id--resulting_context_hash')">Binary output</button> + </div><div id="GET_..--block_id--resulting_context_hashdescr" class="GET_..--block_id--resulting_context_hash tabcontent"> + <p> + Context hash resulting of the block application.</p> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.json" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + $unistring + /* A hash of context (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.bin" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + +--------------+----------+----------+ + | Name | Size | Contents | + +==============+==========+==========+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+----------+ + + + </pre> + </div> + + + .. _GET_..--block_id--votes--ballot_list : **GET ../<block_id>/votes/ballot_list** @@ -64631,9 +67882,9 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--votes--ballot_listoutput.json" class="GET_..--block_id--votes--ballot_list tabcontent"> <pre> - [ { "pkh": $Signature.Public_key_hash, + [ { "pkh": $Signature.V0.Public_key_hash, "ballot": "nay" | "yay" | "pass" } ... ] - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -64981,9 +68232,9 @@ Protocol Kathmandu </div> <div id="GET_..--block_id--votes--listingsoutput.json" class="GET_..--block_id--votes--listings tabcontent"> <pre> - [ { "pkh": $Signature.Public_key_hash, + [ { "pkh": $Signature.V0.Public_key_hash, "voting_power": $int64 } ... ] - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $int64: diff --git a/docs/lima/rpc.rst b/docs/lima/rpc.rst index 85bf43d6367d..d99b710791ec 100644 --- a/docs/lima/rpc.rst +++ b/docs/lima/rpc.rst @@ -180,6 +180,8 @@ Protocol Lima * ../<block_id>/context/merkle_tree (`GET <GET_..--block_id--context--merkle_tree_>`_) + * ../<block_id>/context/merkle_tree_v2 (`GET <GET_..--block_id--context--merkle_tree_v2_>`_) + * ../<block_id>/context/nonces * ../<block_id>/context/nonces/<block_level> (`GET <GET_..--block_id--context--nonces--block_level_>`_) @@ -274,6 +276,8 @@ Protocol Lima * ../<block_id>/protocols (`GET <GET_..--block_id--protocols_>`_) + * ../<block_id>/resulting_context_hash (`GET <GET_..--block_id--resulting_context_hash_>`_) + * ../<block_id>/votes * ../<block_id>/votes/ballot_list (`GET <GET_..--block_id--votes--ballot_list_>`_) @@ -328,9 +332,8 @@ Protocol Lima "nonce": integer ∈ [0, 2^16-1], "amount": $015-PtLimaPt.mutez, "destination": $015-PtLimaPt.transaction_destination, - "parameters"?: - { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, + "value": any }, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -338,7 +341,7 @@ Protocol Lima "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.origination } @@ -346,7 +349,7 @@ Protocol Lima "kind": "delegation", "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -380,7 +383,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $015-PtLimaPt.tx_rollup_id } @@ -405,7 +408,7 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.error: /* The full list of RPC errors would be too long to include. @@ -417,7 +420,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -429,7 +432,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -669,7 +672,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -697,26 +700,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -725,28 +728,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -754,7 +757,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -763,31 +766,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -795,7 +798,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -805,7 +808,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -818,7 +821,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -826,7 +829,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -834,7 +837,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -842,7 +845,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -854,7 +857,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -869,7 +872,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -880,27 +883,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -911,7 +914,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -919,10 +922,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -931,7 +934,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -940,7 +943,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -953,13 +956,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -1014,18 +1017,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1035,7 +1038,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1043,7 +1046,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1052,54 +1055,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1109,7 +1077,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -1120,7 +1088,7 @@ Protocol Lima /* None */ ] ... ] } $015-PtLimaPt.operation.alpha.contents_and_signature: { "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -1292,9 +1260,9 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Preendorsement */ "kind": "preendorsement", "slot": integer ∈ [0, 2^16-1], @@ -1304,14 +1272,14 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $015-PtLimaPt.inlined.preendorsement, @@ -1342,25 +1310,25 @@ Protocol Lima $015-PtLimaPt.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1370,7 +1338,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1379,7 +1347,7 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1389,13 +1357,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "metadata": { "balance_updates"?: @@ -1406,12 +1374,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1421,12 +1389,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1436,7 +1404,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1451,7 +1419,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1467,12 +1435,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key, + "pk": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1482,16 +1450,16 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash, + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "allocated_destination_contract"?: boolean } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1506,7 +1474,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1523,7 +1491,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1543,7 +1511,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1558,7 +1526,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1573,7 +1541,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1588,7 +1556,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1600,7 +1568,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -1622,13 +1590,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, @@ -1642,7 +1610,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1660,7 +1628,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1671,11 +1639,11 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1685,7 +1653,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1693,7 +1661,7 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1703,7 +1671,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1719,7 +1687,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1735,7 +1703,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1755,13 +1723,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -1823,15 +1791,15 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -1841,7 +1809,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1858,7 +1826,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1873,7 +1841,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1889,48 +1857,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30], @@ -1943,7 +1876,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -1953,7 +1886,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -2287,7 +2220,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -2365,7 +2298,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -2436,7 +2369,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -2514,7 +2447,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -2851,10 +2784,10 @@ Protocol Lima { /* Operation_with_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.operation.alpha.successful_manager_operation_result: { /* reveal */ "kind": "reveal", @@ -2949,7 +2882,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -2990,7 +2923,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -3067,9 +3000,8 @@ Protocol Lima /* Sapling state identifier A sapling state identifier */ $bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -3124,13 +3056,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -3156,8 +3088,8 @@ Protocol Lima "max_operation_list_length": [ { "max_size": integer ∈ [-2^30, 2^30], "max_op"?: integer ∈ [-2^30, 2^30] } ... ], - "proposer": $Signature.Public_key_hash, - "baker": $Signature.Public_key_hash, + "proposer": $Signature.V0.Public_key_hash, + "baker": $Signature.V0.Public_key_hash, "level_info": { "level": integer ∈ [-2^31-1, 2^31] @@ -3211,14 +3143,14 @@ Protocol Lima /* The number of blocks remaining till the end of the voting period. */ }, "nonce_hash": $cycle_nonce /* Some */ || null /* None */, - "deactivated": [ $Signature.Public_key_hash ... ], + "deactivated": [ $Signature.V0.Public_key_hash ... ], "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], "implicit_operations_results": [ $015-PtLimaPt.operation.alpha.successful_manager_operation_result ... ], - "proposer_consensus_key": $Signature.Public_key_hash, - "baker_consensus_key": $Signature.Public_key_hash, + "proposer_consensus_key": $Signature.V0.Public_key_hash, + "baker_consensus_key": $Signature.V0.Public_key_hash, "consumed_milligas": $positive_bignum, "dal_slot_availability"?: $bignum } $commitment_hash: @@ -3281,7 +3213,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -3289,7 +3221,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -3297,7 +3229,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, @@ -3305,14 +3237,14 @@ Protocol Lima "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -3335,7 +3267,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ $sapling.transaction.ciphertext: { "cv": $sapling.transaction.commitment_value, @@ -3736,13 +3668,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -4909,13 +4841,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -5333,19 +5265,19 @@ Protocol Lima +-----------------+----------------------+----------+ - X_86 + X_82 **** - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ + +-----------------+----------------------+---------------+ + | Name | Size | Contents | + +=================+======================+===============+ + | Unnamed field 0 | Determined from data | $fitness.elem | + +-----------------+----------------------+---------------+ + | Unnamed field 1 | Determined from data | $fitness.elem | + +-----------------+----------------------+---------------+ - X_88 + X_86 **** +-----------------------+----------+-------------------------+ @@ -5357,303 +5289,20 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_87 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - X_85 **** - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_86 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_87 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_92 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - - - X_90 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_92 | - +-----------------+----------------------+----------+ - - - X_100 - ***** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_99 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_100 | - +-----------------------+----------+-------------------------+ - - - X_98 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_99 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_97 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_98 | - +-----------------------+----------+-------------------------+ - - - X_95 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_97 | - +-----------------+----------------------+----------+ - - - X_105 - ***** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_104 - ***** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_105 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_106 (Determined from data, 8-bit tag) - *************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_104 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_102 - ***** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_106 | - +-----------------+----------------------+----------+ - - - X_89 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_90 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_95 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_102 | - +-----------------------+----------+-------------------------+ - - - X_84 - **** - - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_85 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_89 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_88 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_110 - ***** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_88 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_108 - ***** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_88 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_110 | - +-----------------+----------------------+----------+ - - - X_83 - **** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_84 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_108 | - +-----------------------+----------------------+-------------------------+ - - - X_82 - **** - - +-----------------+----------------------+---------------+ - | Name | Size | Contents | - +=================+======================+===============+ - | Unnamed field 0 | Determined from data | $X_83 | - +-----------------+----------------------+---------------+ - | Unnamed field 1 | Determined from data | $fitness.elem | - +-----------------+----------------------+---------------+ - - - X_114 - ***** - +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_88 | + | Unnamed field 0 | Determined from data | $X_86 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_116 - ***** + X_87 + **** +--------+----------+------------------------+ | Name | Size | Contents | @@ -5666,8 +5315,8 @@ Protocol Lima +--------+----------+------------------------+ - X_117 - ***** + X_88 + **** +-------+----------+------------------+ | Name | Size | Contents | @@ -5678,8 +5327,8 @@ Protocol Lima +-------+----------+------------------+ - X_119 - ***** + X_90 + **** +-----------------------+----------+------------------------+ | Name | Size | Contents | @@ -5690,19 +5339,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_124 - ***** + X_95 + **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_119 | + | Unnamed field 0 | Determined from data | $X_90 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_251 + X_222 ***** +-----------------+----------------------+------------------------+ @@ -5714,7 +5363,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_250 + X_221 ***** +-----------------------+----------+-------------------------+ @@ -5722,7 +5371,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_251 | + | Unnamed field 0 | Variable | sequence of $X_222 | +-----------------------+----------+-------------------------+ @@ -5787,7 +5436,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5801,7 +5450,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5815,7 +5464,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5829,7 +5478,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5843,7 +5492,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5857,7 +5506,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5871,7 +5520,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5885,7 +5534,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5899,7 +5548,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5913,7 +5562,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5927,7 +5576,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5941,7 +5590,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5955,7 +5604,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5969,7 +5618,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5983,7 +5632,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -5997,7 +5646,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6011,7 +5660,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6025,7 +5674,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6039,7 +5688,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6053,7 +5702,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6067,7 +5716,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6081,7 +5730,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6095,7 +5744,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6109,7 +5758,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6123,7 +5772,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6137,7 +5786,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6151,7 +5800,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6165,7 +5814,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6179,7 +5828,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6193,7 +5842,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6207,7 +5856,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6221,7 +5870,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6235,7 +5884,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6249,7 +5898,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6263,7 +5912,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6277,7 +5926,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -6291,7 +5940,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6305,7 +5954,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6319,7 +5968,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6333,7 +5982,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6347,7 +5996,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6361,7 +6010,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6375,7 +6024,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6389,7 +6038,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6403,7 +6052,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6417,7 +6066,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6431,7 +6080,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6445,7 +6094,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6459,7 +6108,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6473,7 +6122,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6487,7 +6136,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6501,7 +6150,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6515,7 +6164,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6529,7 +6178,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6543,7 +6192,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6557,7 +6206,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -6571,7 +6220,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -6585,7 +6234,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+-------------------------+ @@ -6599,7 +6248,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -6613,7 +6262,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -6686,745 +6335,745 @@ Protocol Lima case 129 (tag 129) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_95 | + +-----------------+----------+-----------------------------+ case 130 (tag 130) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_95 | + +-----------------+----------+-----------------------------+ case 131 (tag 131) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_95 | + +-----------------+----------+-----------------------------+ case 132 (tag 132) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_95 | + +-----------------+----------+-----------------------------+ case 133 (tag 133) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_95 | + +-----------------+----------+-----------------------------+ case 134 (tag 134) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_95 | + +-----------------+----------+-----------------------------+ case 135 (tag 135) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_95 | + +-----------------+----------+-----------------------------+ case 136 (tag 136) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_95 | + +-----------------+----------+-----------------------------+ case 137 (tag 137) ================== + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_95 | + +-----------------+----------+-----------------------------+ + + + case 138 (tag 138) + ================== + +-----------------+----------+------------------------------+ | Name | Size | Contents | +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_124 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_95 | +-----------------+----------+------------------------------+ - case 138 (tag 138) - ================== - - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_124 | - +-----------------+----------+-------------------------------+ - - case 139 (tag 139) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_95 | + +-----------------+----------+------------------------------+ case 140 (tag 140) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_95 | + +-----------------+----------+------------------------------+ case 141 (tag 141) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_95 | + +-----------------+----------+------------------------------+ case 142 (tag 142) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_95 | + +-----------------+----------+------------------------------+ case 143 (tag 143) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_95 | + +-----------------+----------+------------------------------+ case 144 (tag 144) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_95 | + +-----------------+----------+------------------------------+ case 145 (tag 145) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_95 | + +-----------------+----------+------------------------------+ case 146 (tag 146) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_95 | + +-----------------+----------+------------------------------+ case 147 (tag 147) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_95 | + +-----------------+----------+------------------------------+ case 148 (tag 148) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_95 | + +-----------------+----------+------------------------------+ case 149 (tag 149) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_95 | + +-----------------+----------+------------------------------+ case 150 (tag 150) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_95 | + +-----------------+----------+------------------------------+ case 151 (tag 151) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_95 | + +-----------------+----------+------------------------------+ case 152 (tag 152) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_95 | + +-----------------+----------+------------------------------+ case 153 (tag 153) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_95 | + +-----------------+----------+------------------------------+ case 154 (tag 154) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_95 | + +-----------------+----------+------------------------------+ case 155 (tag 155) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_95 | + +-----------------+----------+------------------------------+ case 156 (tag 156) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_95 | + +-----------------+----------+------------------------------+ case 157 (tag 157) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_95 | + +-----------------+----------+------------------------------+ case 158 (tag 158) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_95 | + +-----------------+----------+------------------------------+ case 159 (tag 159) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_95 | + +-----------------+----------+------------------------------+ case 160 (tag 160) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_95 | + +-----------------+----------+------------------------------+ case 161 (tag 161) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_95 | + +-----------------+----------+------------------------------+ case 162 (tag 162) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_95 | + +-----------------+----------+------------------------------+ case 163 (tag 163) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_95 | + +-----------------+----------+------------------------------+ case 164 (tag 164) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_124 | - +-----------------+----------+-------------------------------+ - - + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_95 | + +-----------------+----------+------------------------------+ + + case 165 (tag 165) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_95 | + +-----------------+----------+------------------------------+ case 166 (tag 166) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_95 | + +-----------------+----------+------------------------------+ case 167 (tag 167) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_95 | + +-----------------+----------+------------------------------+ case 168 (tag 168) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_95 | + +-----------------+----------+------------------------------+ case 169 (tag 169) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_95 | + +-----------------+----------+------------------------------+ case 170 (tag 170) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_95 | + +-----------------+----------+------------------------------+ case 171 (tag 171) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_95 | + +-----------------+----------+------------------------------+ case 172 (tag 172) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_95 | + +-----------------+----------+------------------------------+ case 173 (tag 173) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_95 | + +-----------------+----------+------------------------------+ case 174 (tag 174) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_95 | + +-----------------+----------+------------------------------+ case 175 (tag 175) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_95 | + +-----------------+----------+------------------------------+ case 176 (tag 176) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_95 | + +-----------------+----------+------------------------------+ case 177 (tag 177) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_95 | + +-----------------+----------+------------------------------+ case 178 (tag 178) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_95 | + +-----------------+----------+------------------------------+ case 179 (tag 179) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_95 | + +-----------------+----------+------------------------------+ case 180 (tag 180) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_95 | + +-----------------+----------+------------------------------+ case 181 (tag 181) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_95 | + +-----------------+----------+------------------------------+ case 182 (tag 182) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_95 | + +-----------------+----------+------------------------------+ case 183 (tag 183) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_95 | + +-----------------+----------+------------------------------+ case 184 (tag 184) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_95 | + +-----------------+----------+------------------------------+ case 185 (tag 185) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_95 | + +-----------------+----------+------------------------------+ case 186 (tag 186) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_95 | + +-----------------+----------+------------------------------+ case 187 (tag 187) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_95 | + +-----------------+----------+------------------------------+ case 188 (tag 188) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_95 | + +-----------------+----------+------------------------------+ case 189 (tag 189) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_95 | + +-----------------+----------+------------------------------+ case 190 (tag 190) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_95 | + +-----------------+----------+------------------------------+ case 191 (tag 191) @@ -7437,7 +7086,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_124 | + | Unnamed field 0 | Variable | sequence of $X_95 | +-----------------------+----------+-------------------------+ @@ -7463,7 +7112,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -7479,7 +7128,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -7495,7 +7144,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -7511,7 +7160,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -7588,7 +7237,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7602,7 +7251,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7616,7 +7265,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7630,7 +7279,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7644,7 +7293,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7658,7 +7307,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7672,7 +7321,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7686,7 +7335,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7700,7 +7349,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7714,7 +7363,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7728,7 +7377,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7742,7 +7391,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7756,7 +7405,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7770,7 +7419,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7784,7 +7433,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7798,7 +7447,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7812,7 +7461,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7826,7 +7475,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7840,7 +7489,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7854,7 +7503,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7868,7 +7517,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7882,7 +7531,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7896,7 +7545,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7910,7 +7559,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7924,7 +7573,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7938,7 +7587,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7952,7 +7601,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7966,7 +7615,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7980,7 +7629,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -7994,7 +7643,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8008,7 +7657,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8022,7 +7671,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8036,7 +7685,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8050,7 +7699,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8064,7 +7713,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8078,7 +7727,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_222 | +-----------------+----------------------+------------------------------+ @@ -8092,7 +7741,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8106,7 +7755,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8120,7 +7769,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8134,7 +7783,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8148,7 +7797,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8162,7 +7811,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8176,7 +7825,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8190,7 +7839,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8204,7 +7853,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8218,7 +7867,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8232,7 +7881,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8246,7 +7895,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8260,7 +7909,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8274,7 +7923,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8288,7 +7937,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8302,7 +7951,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8316,7 +7965,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8330,7 +7979,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8344,7 +7993,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8358,7 +8007,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_251 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_222 | +-----------------+----------------------+-------------------------------+ @@ -8372,7 +8021,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -8386,7 +8035,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+-------------------------+ @@ -8400,7 +8049,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -8414,7 +8063,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_250 | + | Unnamed field 1 | Determined from data | $X_221 | +-----------------+----------------------+------------------------+ @@ -8487,745 +8136,745 @@ Protocol Lima case 129 (tag 129) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_95 | + +-----------------+----------+-----------------------------+ case 130 (tag 130) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_95 | + +-----------------+----------+-----------------------------+ case 131 (tag 131) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_95 | + +-----------------+----------+-----------------------------+ case 132 (tag 132) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_95 | + +-----------------+----------+-----------------------------+ case 133 (tag 133) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_95 | + +-----------------+----------+-----------------------------+ case 134 (tag 134) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_95 | + +-----------------+----------+-----------------------------+ case 135 (tag 135) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_95 | + +-----------------+----------+-----------------------------+ case 136 (tag 136) ================== - +-----------------+----------+------------------------------+ - | Name | Size | Contents | - +=================+==========+==============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_124 | - +-----------------+----------+------------------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_95 | + +-----------------+----------+-----------------------------+ case 137 (tag 137) ================== + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_95 | + +-----------------+----------+-----------------------------+ + + + case 138 (tag 138) + ================== + +-----------------+----------+------------------------------+ | Name | Size | Contents | +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_124 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_95 | +-----------------+----------+------------------------------+ - case 138 (tag 138) - ================== - - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_124 | - +-----------------+----------+-------------------------------+ - - case 139 (tag 139) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_95 | + +-----------------+----------+------------------------------+ case 140 (tag 140) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_95 | + +-----------------+----------+------------------------------+ case 141 (tag 141) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_95 | + +-----------------+----------+------------------------------+ case 142 (tag 142) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_95 | + +-----------------+----------+------------------------------+ case 143 (tag 143) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_95 | + +-----------------+----------+------------------------------+ case 144 (tag 144) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_95 | + +-----------------+----------+------------------------------+ case 145 (tag 145) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_95 | + +-----------------+----------+------------------------------+ case 146 (tag 146) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_95 | + +-----------------+----------+------------------------------+ case 147 (tag 147) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_95 | + +-----------------+----------+------------------------------+ case 148 (tag 148) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_95 | + +-----------------+----------+------------------------------+ case 149 (tag 149) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_95 | + +-----------------+----------+------------------------------+ case 150 (tag 150) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_95 | + +-----------------+----------+------------------------------+ case 151 (tag 151) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_95 | + +-----------------+----------+------------------------------+ case 152 (tag 152) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_95 | + +-----------------+----------+------------------------------+ case 153 (tag 153) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_95 | + +-----------------+----------+------------------------------+ case 154 (tag 154) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_95 | + +-----------------+----------+------------------------------+ case 155 (tag 155) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_95 | + +-----------------+----------+------------------------------+ case 156 (tag 156) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_95 | + +-----------------+----------+------------------------------+ case 157 (tag 157) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_95 | + +-----------------+----------+------------------------------+ case 158 (tag 158) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_95 | + +-----------------+----------+------------------------------+ case 159 (tag 159) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_95 | + +-----------------+----------+------------------------------+ case 160 (tag 160) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_95 | + +-----------------+----------+------------------------------+ case 161 (tag 161) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_95 | + +-----------------+----------+------------------------------+ case 162 (tag 162) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_95 | + +-----------------+----------+------------------------------+ case 163 (tag 163) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_95 | + +-----------------+----------+------------------------------+ case 164 (tag 164) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_95 | + +-----------------+----------+------------------------------+ case 165 (tag 165) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_95 | + +-----------------+----------+------------------------------+ case 166 (tag 166) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_95 | + +-----------------+----------+------------------------------+ case 167 (tag 167) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_95 | + +-----------------+----------+------------------------------+ case 168 (tag 168) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_95 | + +-----------------+----------+------------------------------+ case 169 (tag 169) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_95 | + +-----------------+----------+------------------------------+ case 170 (tag 170) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_95 | + +-----------------+----------+------------------------------+ case 171 (tag 171) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_95 | + +-----------------+----------+------------------------------+ case 172 (tag 172) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_95 | + +-----------------+----------+------------------------------+ case 173 (tag 173) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_95 | + +-----------------+----------+------------------------------+ case 174 (tag 174) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_95 | + +-----------------+----------+------------------------------+ case 175 (tag 175) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_95 | + +-----------------+----------+------------------------------+ case 176 (tag 176) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_95 | + +-----------------+----------+------------------------------+ case 177 (tag 177) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_95 | + +-----------------+----------+------------------------------+ case 178 (tag 178) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_124 | - +-----------------+----------+-------------------------------+ - - + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_95 | + +-----------------+----------+------------------------------+ + + case 179 (tag 179) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_95 | + +-----------------+----------+------------------------------+ case 180 (tag 180) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_95 | + +-----------------+----------+------------------------------+ case 181 (tag 181) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_95 | + +-----------------+----------+------------------------------+ case 182 (tag 182) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_95 | + +-----------------+----------+------------------------------+ case 183 (tag 183) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_95 | + +-----------------+----------+------------------------------+ case 184 (tag 184) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_95 | + +-----------------+----------+------------------------------+ case 185 (tag 185) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_95 | + +-----------------+----------+------------------------------+ case 186 (tag 186) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_95 | + +-----------------+----------+------------------------------+ case 187 (tag 187) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_95 | + +-----------------+----------+------------------------------+ case 188 (tag 188) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_95 | + +-----------------+----------+------------------------------+ case 189 (tag 189) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_95 | + +-----------------+----------+------------------------------+ case 190 (tag 190) ================== - +-----------------+----------+-------------------------------+ - | Name | Size | Contents | - +=================+==========+===============================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------+-------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_124 | - +-----------------+----------+-------------------------------+ + +-----------------+----------+------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_95 | + +-----------------+----------+------------------------------+ case 191 (tag 191) @@ -9238,7 +8887,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_124 | + | Unnamed field 0 | Variable | sequence of $X_95 | +-----------------------+----------+-------------------------+ @@ -9318,7 +8967,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -9334,7 +8983,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -9350,7 +8999,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -9366,7 +9015,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_119 | + | Unnamed field 1 | Determined from data | $X_90 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -9382,7 +9031,7 @@ Protocol Lima +------+--------+------------------------+ - X_53939 (Determined from data, 8-bit tag) + X_53910 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -9457,7 +9106,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107761 (Determined from data, 8-bit tag) + X_107732 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -9468,7 +9117,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53939 | + | proof | Determined from data | $X_53910 | +-------+----------------------+------------------------+ @@ -9480,7 +9129,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53939 | + | proof | Determined from data | $X_53910 | +-------+----------------------+------------------------+ @@ -9494,7 +9143,7 @@ Protocol Lima +------+--------+------------------------+ - X_107763 (Determined from data, 8-bit tag) + X_107734 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -9509,7 +9158,7 @@ Protocol Lima +----------+----------------------+------------------------+ - X_107764 (Determined from data, 8-bit tag) + X_107735 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -9538,11 +9187,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107763 | + | reveal_proof | Determined from data | $X_107734 | +--------------+----------------------+------------------------+ - X_107765 + X_107736 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -9556,7 +9205,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107766 (Determined from data, 8-bit tag) + X_107737 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -9569,7 +9218,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107765 | + | Unnamed field 0 | Variable | sequence of $X_107736 | +-----------------------+----------+-------------------------+ @@ -9581,27 +9230,27 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107761 | + | pvm_step | Determined from data | $X_107732 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107764 | + | input_proof | Determined from data | $X_107735 | +-----------------------------------+----------------------+-------------------------------------+ - X_118 - ***** + X_89 + **** +--------+----------------------+-----------+ | Name | Size | Contents | +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107766 | + | step | Determined from data | $X_107737 | +--------+----------------------+-----------+ - X_107767 + X_107738 ******** +------------------+----------+-----------------------+ @@ -9617,7 +9266,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107769 (Enumeration: unsigned 8-bit integer): + X_107740 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -9629,7 +9278,7 @@ Protocol Lima +-------------+---------------------+ - X_107771 (Determined from data, 8-bit tag) + X_107742 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -9680,7 +9329,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107770 + X_107741 ******** +-----------------------+----------------------+---------------------------+ @@ -9696,13 +9345,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107771 | + | amount | Determined from data | $X_107742 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107772 + X_107743 ******** +-------------+----------------------+------------------+ @@ -9714,11 +9363,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107771 | + | amount | Determined from data | $X_107742 | +-------------+----------------------+------------------+ - X_107774 (Determined from data, 8-bit tag) + X_107745 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -9743,11 +9392,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107772 | + | deposit | Determined from data | $X_107743 | +---------+----------------------+------------------------+ - X_107775 + X_107746 ******** +--------------------+----------+----------+ @@ -9759,7 +9408,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107777 (Determined from data, 8-bit tag) + X_107748 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -9784,7 +9433,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107776 + X_107747 ******** +-----------------------+----------------------+-------------------------+ @@ -9796,7 +9445,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107777 | + | predecessor | Determined from data | $X_107748 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -9934,7 +9583,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107778 + X_107749 ******** +-----------------------+----------------------+--------------------------+ @@ -9948,7 +9597,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107779 + X_107750 ******** +-----------------+-----------+----------+ @@ -10159,7 +9808,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107779 | + | solution | 200 bytes | $X_107750 | +----------+-----------+------------------------+ @@ -10289,7 +9938,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107778 | + | parameters | Determined from data | $X_107749 | +----------------------------------+----------------------+-------------------------------------+ @@ -10509,7 +10158,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107776 | + | commitment | Determined from data | $X_107747 | +---------------+----------------------+------------------------+ @@ -10601,7 +10250,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107774 | + | message | Determined from data | $X_107745 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -10615,7 +10264,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107775 | + | previous_message_result | 64 bytes | $X_107746 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -10659,7 +10308,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107770 | + | tickets_info | Variable | sequence of $X_107741 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -10719,7 +10368,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107769) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107740) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -10759,7 +10408,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_88 | + | message | Variable | sequence of $X_86 | +------------------------------------------------+----------------------+-------------------------+ @@ -10811,7 +10460,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107767 | + | commitment | 76 bytes | $X_107738 | +------------------------------------------------+----------------------+-------------------------+ @@ -10841,7 +10490,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_118 | + | refutation | Determined from data | $X_89 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -10867,7 +10516,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_117 | + | stakers | 42 bytes | $X_88 | +------------------------------------------------+----------------------+-------------------------+ @@ -10967,7 +10616,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_116 | + | slot | 53 bytes | $X_87 | +---------------+----------------------+------------------------+ @@ -10993,7 +10642,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_114 | + | circuits_info | Variable | sequence of $X_85 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -11029,7 +10678,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ - X_107790 + X_107761 ******** +-----------------------+----------+-------------------------+ @@ -11037,7 +10686,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_88 | + | Unnamed field 0 | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11072,7 +10721,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11096,7 +10745,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -11133,7 +10782,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11157,7 +10806,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -11204,7 +10853,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11228,7 +10877,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -11250,7 +10899,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - X_107884 (Determined from data, 8-bit tag) + X_107855 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -11336,7 +10985,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_107884 | + | Unnamed field 0 | Determined from data | $X_107855 | +-----------------+----------------------+------------------------+ @@ -11350,7 +10999,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11374,9 +11023,9 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_107884 | + | Unnamed field 0 | Determined from data | $X_107855 | +------------------------------+----------------------+-------------------------------------+ @@ -11401,7 +11050,7 @@ Protocol Lima +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_107778 | + | parameters | Determined from data | $X_107749 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -11477,7 +11126,7 @@ Protocol Lima +-------------------------------+----------------------+---------------------------------------------------------------+ - X_107786 + X_107757 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -11528,7 +11177,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11552,7 +11201,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -11566,7 +11215,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_107954 + X_107896 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -11584,7 +11233,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_108089 + X_108031 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -11631,7 +11280,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11655,7 +11304,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -11665,7 +11314,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_108217 + X_108159 ******** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -11712,7 +11361,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11736,7 +11385,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -11746,7 +11395,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108345 + X_108287 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -11795,7 +11444,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -11819,7 +11468,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -11831,7 +11480,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108479 + X_108421 ******** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -11849,7 +11498,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_108619 (Determined from data, 8-bit tag) + X_108561 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -11874,7 +11523,7 @@ Protocol Lima +------------+----------+------------------------+ - X_108627 (Determined from data, 8-bit tag) + X_108569 (Determined from data, 8-bit tag) ****************************************** sc_rollup_dissection_choice_not_found (tag 0) @@ -11923,9 +11572,9 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | expected | Determined from data | $X_108619 | + | expected | Determined from data | $X_108561 | +----------+----------------------+------------------------+ - | given | Determined from data | $X_108619 | + | given | Determined from data | $X_108561 | +----------+----------------------+------------------------+ @@ -11937,7 +11586,7 @@ Protocol Lima +======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------+----------------------+------------------------+ - | hash | Determined from data | $X_108619 | + | hash | Determined from data | $X_108561 | +------+----------------------+------------------------+ @@ -12009,7 +11658,7 @@ Protocol Lima +==================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------------+----------------------+------------------------+ - | start_state_hash | Determined from data | $X_108619 | + | start_state_hash | Determined from data | $X_108561 | +------------------+----------------------+------------------------+ | start_proof | 32 bytes | bytes | +------------------+----------------------+------------------------+ @@ -12023,9 +11672,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108619 | + | stop_state_hash | Determined from data | $X_108561 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108619 | + | stop_proof | Determined from data | $X_108561 | +-----------------+----------------------+------------------------+ @@ -12037,9 +11686,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108619 | + | stop_state_hash | Determined from data | $X_108561 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108619 | + | stop_proof | Determined from data | $X_108561 | +-----------------+----------------------+------------------------+ @@ -12057,7 +11706,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_108628 (Determined from data, 8-bit tag) + X_108570 (Determined from data, 8-bit tag) ****************************************** Conflict_resolved (tag 0) @@ -12078,7 +11727,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_108627 | + | Unnamed field 0 | Determined from data | $X_108569 | +-----------------+----------------------+------------------------+ @@ -12092,7 +11741,7 @@ Protocol Lima +------+--------+------------------------+ - X_108629 (Determined from data, 8-bit tag) + X_108571 (Determined from data, 8-bit tag) ****************************************** Loser (tag 0) @@ -12103,7 +11752,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | reason | Determined from data | $X_108628 | + | reason | Determined from data | $X_108570 | +--------+----------------------+------------------------+ | player | 21 bytes | $public_key_hash | +--------+----------------------+------------------------+ @@ -12119,7 +11768,7 @@ Protocol Lima +------+--------+------------------------+ - X_108630 (Determined from data, 8-bit tag) + X_108572 (Determined from data, 8-bit tag) ****************************************** Ongoing (tag 0) @@ -12140,7 +11789,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | result | Determined from data | $X_108629 | + | result | Determined from data | $X_108571 | +--------+----------------------+------------------------+ @@ -12157,7 +11806,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | game_status | Determined from data | $X_108630 | + | game_status | Determined from data | $X_108572 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -12175,7 +11824,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12199,11 +11848,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | game_status | Determined from data | $X_108630 | + | game_status | Determined from data | $X_108572 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12211,7 +11860,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108614 + X_108556 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12262,7 +11911,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12286,7 +11935,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12300,7 +11949,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216580 + X_216522 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12345,7 +11994,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12369,7 +12018,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -12377,7 +12026,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216714 + X_216656 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12422,7 +12071,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12446,7 +12095,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -12454,7 +12103,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216843 + X_216785 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12507,7 +12156,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12531,7 +12180,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12547,7 +12196,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216976 + X_216918 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12596,7 +12245,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12620,7 +12269,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12632,7 +12281,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217518 + X_217460 ******** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -12681,7 +12330,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12705,7 +12354,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12717,7 +12366,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218056 + X_217998 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12766,7 +12415,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12790,7 +12439,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12802,7 +12451,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218190 + X_218132 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12847,7 +12496,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12871,7 +12520,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | consumed_gas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -12879,7 +12528,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_218324 + X_218266 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12930,7 +12579,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -12954,7 +12603,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -12968,7 +12617,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218714 + X_218656 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -12986,7 +12635,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_218976 + X_218918 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -13029,7 +12678,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_88 | + | errors | Variable | sequence of $X_86 | +-----------------------+----------+-------------------------+ @@ -13053,13 +12702,13 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107790 | + | errors | Determined from data | $X_107761 | +------------------------------+----------------------+-------------------------------------+ | Unnamed field 0 | Determined from data | $X_74 | +------------------------------+----------------------+-------------------------------------+ - X_219151 + X_219093 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -13077,7 +12726,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219477 + X_219419 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -13095,7 +12744,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219481 + X_219423 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -13113,7 +12762,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219485 + X_219427 ******** +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -13278,7 +12927,7 @@ Protocol Lima +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_107779 | + | solution | 200 bytes | $X_107750 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $015-PtLimaPt.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -13298,7 +12947,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | destination | 21 bytes | $public_key_hash | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_219485 | + | metadata | Determined from data | $X_219427 | +---------------+----------------------+------------------------+ @@ -13318,7 +12967,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219481 | + | metadata | Determined from data | $X_219423 | +--------------------+----------------------+-------------------------+ @@ -13338,7 +12987,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219477 | + | metadata | Determined from data | $X_219419 | +--------------------+----------------------+-------------------------+ @@ -13378,7 +13027,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108089 | + | metadata | Determined from data | $X_108031 | +---------------+----------------------+------------------------+ @@ -13406,9 +13055,9 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107778 | + | parameters | Determined from data | $X_107749 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_219151 | + | metadata | Determined from data | $X_219093 | +----------------------------------+----------------------+-------------------------------------+ @@ -13438,7 +13087,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $015-PtLimaPt.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218976 | + | metadata | Determined from data | $X_218918 | +--------------------------------+----------------------+-------------------------------------+ @@ -13464,7 +13113,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108089 | + | metadata | Determined from data | $X_108031 | +--------------------------------+----------------------+-------------------------------------+ @@ -13490,7 +13139,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_218714 | + | metadata | Determined from data | $X_218656 | +-----------------------+----------------------+-------------------------+ @@ -13516,7 +13165,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108089 | + | metadata | Determined from data | $X_108031 | +-----------------------------+----------------------+-------------------------------------+ @@ -13542,7 +13191,7 @@ Protocol Lima +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $015-PtLimaPt.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_108345 | + | metadata | Determined from data | $X_108287 | +---------------+----------------------+--------------------------------------+ @@ -13566,7 +13215,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | pk | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218324 | + | metadata | Determined from data | $X_218266 | +---------------+----------------------+------------------------+ @@ -13588,7 +13237,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218190 | + | metadata | Determined from data | $X_218132 | +---------------+----------------------+------------------------+ @@ -13620,7 +13269,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218056 | + | metadata | Determined from data | $X_217998 | +----------------------------------+----------------------+-------------------------------------+ @@ -13644,9 +13293,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107776 | + | commitment | Determined from data | $X_107747 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108345 | + | metadata | Determined from data | $X_108287 | +---------------+----------------------+------------------------+ @@ -13670,7 +13319,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108345 | + | metadata | Determined from data | $X_108287 | +---------------+----------------------+------------------------+ @@ -13694,7 +13343,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217518 | + | metadata | Determined from data | $X_217460 | +---------------+----------------------+------------------------+ @@ -13718,7 +13367,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217518 | + | metadata | Determined from data | $X_217460 | +---------------+----------------------+------------------------+ @@ -13744,7 +13393,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107774 | + | message | Determined from data | $X_107745 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -13758,7 +13407,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107775 | + | previous_message_result | 64 bytes | $X_107746 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -13768,7 +13417,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | proof | Variable | bytes | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108345 | + | metadata | Determined from data | $X_108287 | +------------------------------+----------------------+-------------------------+ @@ -13804,9 +13453,9 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107770 | + | tickets_info | Variable | sequence of $X_107741 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_108479 | + | metadata | Determined from data | $X_108421 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -13846,7 +13495,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_108479 | + | metadata | Determined from data | $X_108421 | +-----------------------+----------------------+---------------------------+ @@ -13868,7 +13517,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107769) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107740) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -13882,7 +13531,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+---------------------------------------------------------------+ - | metadata | Determined from data | $X_216976 | + | metadata | Determined from data | $X_216918 | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -13910,9 +13559,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_88 | + | message | Variable | sequence of $X_86 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216843 | + | metadata | Determined from data | $X_216785 | +------------------------------------------------+----------------------+-------------------------+ @@ -13940,7 +13589,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216714 | + | metadata | Determined from data | $X_216656 | +------------------------------------------------+----------------------+-------------------------+ @@ -13966,9 +13615,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107767 | + | commitment | 76 bytes | $X_107738 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216580 | + | metadata | Determined from data | $X_216522 | +------------------------------------------------+----------------------+-------------------------+ @@ -13998,9 +13647,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_118 | + | refutation | Determined from data | $X_89 | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108614 | + | metadata | Determined from data | $X_108556 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -14026,9 +13675,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_117 | + | stakers | 42 bytes | $X_88 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108614 | + | metadata | Determined from data | $X_108556 | +------------------------------------------------+----------------------+-------------------------+ @@ -14060,7 +13709,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | output_proof | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108479 | + | metadata | Determined from data | $X_108421 | +------------------------------------------------+----------------------+-------------------------+ @@ -14084,7 +13733,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108345 | + | metadata | Determined from data | $X_108287 | +---------------+----------------------+------------------------+ @@ -14112,7 +13761,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108217 | + | metadata | Determined from data | $X_108159 | +------------------------------------------------+----------------------+-------------------------+ @@ -14134,9 +13783,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_116 | + | slot | 53 bytes | $X_87 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108089 | + | metadata | Determined from data | $X_108031 | +---------------+----------------------+------------------------+ @@ -14162,7 +13811,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_114 | + | circuits_info | Variable | sequence of $X_85 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -14170,7 +13819,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_107954 | + | metadata | Determined from data | $X_107896 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -14198,11 +13847,11 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | op | Variable | sequence of $X_76 | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_107786 | + | metadata | Determined from data | $X_107757 | +-----------------------+----------------------+-------------------------+ - X_219508 (Determined from data, 8-bit tag) + X_219450 (Determined from data, 8-bit tag) ****************************************** Operation_with_metadata (tag 0) @@ -14241,7 +13890,7 @@ Protocol Lima +---------------------------------+----------+----------------------------------------------------+ - X_434917 (Variable, 8-bit tag) + X_434801 (Variable, 8-bit tag) ****************************** Operation with too large metadata (tag 0) @@ -14280,7 +13929,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219508 | + | Unnamed field 0 | Determined from data | $X_219450 | +-----------------+----------------------+------------------------+ @@ -14300,7 +13949,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_434917 | + | Unnamed field 0 | Variable | $X_434801 | +-----------------------+----------+-------------------------+ @@ -14511,7 +14160,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -15225,7 +14874,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -16022,7 +15671,7 @@ Protocol Lima "ratio_of_frozen_deposits_slashed_per_double_endorsement": { "numerator": integer ∈ [0, 2^16-1], "denominator": integer ∈ [0, 2^16-1] }, - "testnet_dictator"?: $Signature.Public_key_hash, + "testnet_dictator"?: $Signature.V0.Public_key_hash, "initial_seed"?: $random, "cache_script_size": integer ∈ [-2^30, 2^30], "cache_stake_distribution_cycles": integer ∈ [-128, 127], @@ -16068,7 +15717,7 @@ Protocol Lima "zk_rollup_origination_size": integer ∈ [-2^30, 2^30], "zk_rollup_min_pending_to_process": integer ∈ [-2^30, 2^30] } $015-PtLimaPt.mutez: $positive_bignum - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $bignum: @@ -16452,7 +16101,7 @@ Protocol Lima "ratio_of_frozen_deposits_slashed_per_double_endorsement": { "numerator": integer ∈ [0, 2^16-1], "denominator": integer ∈ [0, 2^16-1] }, - "testnet_dictator"?: $Signature.Public_key_hash, + "testnet_dictator"?: $Signature.V0.Public_key_hash, "initial_seed"?: $random, "cache_script_size": integer ∈ [-2^30, 2^30], "cache_stake_distribution_cycles": integer ∈ [-128, 127], @@ -16498,7 +16147,7 @@ Protocol Lima "zk_rollup_origination_size": integer ∈ [-2^30, 2^30], "zk_rollup_min_pending_to_process": integer ∈ [-2^30, 2^30] } $015-PtLimaPt.mutez: $positive_bignum - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $bignum: @@ -16857,13 +16506,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -16899,191 +16548,15 @@ Protocol Lima <div id="GET_..--block_id--context--contracts--contract_idoutput.json" class="GET_..--block_id--context--contracts--contract_id tabcontent"> <pre> { "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script"?: $015-PtLimaPt.scripted.contracts, "counter"?: $positive_bignum } - $015-PtLimaPt.michelson.v1.primitives: - "SHA512" - | "HASH_KEY" - | "SIZE" - | "SAPLING_VERIFY_UPDATE" - | "False" - | "SAPLING_EMPTY_STATE" - | "RENAME" - | "sapling_state" - | "UNPACK" - | "contract" - | "address" - | "chest_key" - | "Pair" - | "IF_NONE" - | "key_hash" - | "operation" - | "storage" - | "UNPAIR" - | "view" - | "BLAKE2B" - | "AMOUNT" - | "DUP" - | "or" - | "NEG" - | "int" - | "SELF_ADDRESS" - | "ISNAT" - | "DIG" - | "CHAIN_ID" - | "string" - | "LSR" - | "lambda" - | "sapling_transaction" - | "ABS" - | "CREATE_CONTRACT" - | "SHA256" - | "JOIN_TICKETS" - | "LEVEL" - | "bls12_381_fr" - | "sapling_transaction_deprecated" - | "tx_rollup_l2_address" - | "mutez" - | "CHECK_SIGNATURE" - | "STEPS_TO_QUOTA" - | "SELF" - | "DIP" - | "map" - | "AND" - | "COMPARE" - | "bls12_381_g1" - | "MAP" - | "APPLY" - | "Elt" - | "bool" - | "NOT" - | "IMPLICIT_ACCOUNT" - | "LT" - | "UNIT" - | "EMIT" - | "SET_DELEGATE" - | "Some" - | "parameter" - | "bytes" - | "chest" - | "EMPTY_BIG_MAP" - | "None" - | "SUB" - | "list" - | "ADD" - | "nat" - | "VOTING_POWER" - | "option" - | "CDR" - | "GT" - | "IF_CONS" - | "CONS" - | "LSL" - | "DUG" - | "PACK" - | "SHA3" - | "SOURCE" - | "set" - | "SUB_MUTEZ" - | "LAMBDA" - | "RIGHT" - | "CREATE_ACCOUNT" - | "Unit" - | "CAST" - | "NEQ" - | "ITER" - | "FAILWITH" - | "PUSH" - | "OPEN_CHEST" - | "SOME" - | "big_map" - | "BALANCE" - | "NIL" - | "signature" - | "CAR" - | "UPDATE" - | "TOTAL_VOTING_POWER" - | "PAIR" - | "LAMBDA_REC" - | "ADDRESS" - | "True" - | "Right" - | "Lambda_rec" - | "IF" - | "NEVER" - | "chain_id" - | "SWAP" - | "EMPTY_MAP" - | "MUL" - | "INT" - | "pair" - | "KECCAK" - | "LEFT" - | "Left" - | "SPLIT_TICKET" - | "constant" - | "ticket" - | "EDIV" - | "LOOP" - | "timestamp" - | "TICKET" - | "LE" - | "PAIRING_CHECK" - | "MIN_BLOCK_TIME" - | "OR" - | "key" - | "GET_AND_UPDATE" - | "unit" - | "never" - | "NONE" - | "IF_LEFT" - | "GET" - | "NOW" - | "TRANSFER_TOKENS" - | "LOOP_LEFT" - | "CONTRACT" - | "TICKET_DEPRECATED" - | "VIEW" - | "EMPTY_SET" - | "XOR" - | "bls12_381_g2" - | "READ_TICKET" - | "EQ" - | "GE" - | "MEM" - | "SENDER" - | "DROP" - | "CONCAT" - | "EXEC" - | "SLICE" - | "code" $015-PtLimaPt.mutez: $positive_bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } - $Signature.Public_key_hash: + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring - $bignum: - /* Big number - Decimal representation of a big number */ - string - $micheline.015-PtLimaPt.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.015-PtLimaPt.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $015-PtLimaPt.michelson.v1.primitives, - "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -17470,7 +16943,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -18172,7 +17645,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -18789,11 +18262,11 @@ Protocol Lima </div> <div id="GET_..--block_id--context--contracts--contract_id--delegateoutput.bin" class="GET_..--block_id--context--contracts--contract_id--delegate tabcontent"> <pre> - +---------------------------+----------+------------------+ - | Name | Size | Contents | - +===========================+==========+==================+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------+ + +------------------------------+----------+------------------+ + | Name | Size | Contents | + +==============================+==========+==================+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------+ public_key_hash (21 bytes, 8-bit tag) @@ -19031,7 +18504,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -19785,7 +19258,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -20369,8 +19842,8 @@ Protocol Lima </div> <div id="GET_..--block_id--context--contracts--contract_id--manager_keyoutput.json" class="GET_..--block_id--context--contracts--contract_id--manager_key tabcontent"> <pre> - $Signature.Public_key /* Some */ || null /* None */ - $Signature.Public_key: + $Signature.V0.Public_key /* Some */ || null /* None */ + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring $unistring: @@ -20443,13 +19916,13 @@ Protocol Lima Some (tag 1) ============ - +----------------------+----------------------+------------------------+ - | Name | Size | Contents | - +======================+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +----------------------+----------------------+------------------------+ - | Signature.Public_key | Determined from data | $public_key | - +----------------------+----------------------+------------------------+ + +-------------------------+----------------------+------------------------+ + | Name | Size | Contents | + +=========================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------------------+------------------------+ + | Signature.V0.Public_key | Determined from data | $public_key | + +-------------------------+----------------------+------------------------+ </pre> </div> @@ -20471,188 +19944,8 @@ Protocol Lima </div> <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.json" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> <pre> - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } - $015-PtLimaPt.michelson.v1.primitives: - "SHA512" - | "HASH_KEY" - | "SIZE" - | "SAPLING_VERIFY_UPDATE" - | "False" - | "SAPLING_EMPTY_STATE" - | "RENAME" - | "sapling_state" - | "UNPACK" - | "contract" - | "address" - | "chest_key" - | "Pair" - | "IF_NONE" - | "key_hash" - | "operation" - | "storage" - | "UNPAIR" - | "view" - | "BLAKE2B" - | "AMOUNT" - | "DUP" - | "or" - | "NEG" - | "int" - | "SELF_ADDRESS" - | "ISNAT" - | "DIG" - | "CHAIN_ID" - | "string" - | "LSR" - | "lambda" - | "sapling_transaction" - | "ABS" - | "CREATE_CONTRACT" - | "SHA256" - | "JOIN_TICKETS" - | "LEVEL" - | "bls12_381_fr" - | "sapling_transaction_deprecated" - | "tx_rollup_l2_address" - | "mutez" - | "CHECK_SIGNATURE" - | "STEPS_TO_QUOTA" - | "SELF" - | "DIP" - | "map" - | "AND" - | "COMPARE" - | "bls12_381_g1" - | "MAP" - | "APPLY" - | "Elt" - | "bool" - | "NOT" - | "IMPLICIT_ACCOUNT" - | "LT" - | "UNIT" - | "EMIT" - | "SET_DELEGATE" - | "Some" - | "parameter" - | "bytes" - | "chest" - | "EMPTY_BIG_MAP" - | "None" - | "SUB" - | "list" - | "ADD" - | "nat" - | "VOTING_POWER" - | "option" - | "CDR" - | "GT" - | "IF_CONS" - | "CONS" - | "LSL" - | "DUG" - | "PACK" - | "SHA3" - | "SOURCE" - | "set" - | "SUB_MUTEZ" - | "LAMBDA" - | "RIGHT" - | "CREATE_ACCOUNT" - | "Unit" - | "CAST" - | "NEQ" - | "ITER" - | "FAILWITH" - | "PUSH" - | "OPEN_CHEST" - | "SOME" - | "big_map" - | "BALANCE" - | "NIL" - | "signature" - | "CAR" - | "UPDATE" - | "TOTAL_VOTING_POWER" - | "PAIR" - | "LAMBDA_REC" - | "ADDRESS" - | "True" - | "Right" - | "Lambda_rec" - | "IF" - | "NEVER" - | "chain_id" - | "SWAP" - | "EMPTY_MAP" - | "MUL" - | "INT" - | "pair" - | "KECCAK" - | "LEFT" - | "Left" - | "SPLIT_TICKET" - | "constant" - | "ticket" - | "EDIV" - | "LOOP" - | "timestamp" - | "TICKET" - | "LE" - | "PAIRING_CHECK" - | "MIN_BLOCK_TIME" - | "OR" - | "key" - | "GET_AND_UPDATE" - | "unit" - | "never" - | "NONE" - | "IF_LEFT" - | "GET" - | "NOW" - | "TRANSFER_TOKENS" - | "LOOP_LEFT" - | "CONTRACT" - | "TICKET_DEPRECATED" - | "VIEW" - | "EMPTY_SET" - | "XOR" - | "bls12_381_g2" - | "READ_TICKET" - | "EQ" - | "GE" - | "MEM" - | "SENDER" - | "DROP" - | "CONCAT" - | "EXEC" - | "SLICE" - | "code" - $bignum: - /* Big number - Decimal representation of a big number */ - string - $micheline.015-PtLimaPt.michelson_v1.expression: - { /* Int */ - "int": $bignum } - || { /* String */ - "string": $unistring } - || { /* Bytes */ - "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || [ $micheline.015-PtLimaPt.michelson_v1.expression ... ] - /* Sequence */ - || { /* Prim__generic - Generic primitive (any number of args with or without - annotations) */ - "prim": $015-PtLimaPt.michelson.v1.primitives, - "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + { "code": any, + "storage": any }</pre> </div> <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.bin" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> <pre> @@ -20951,7 +20244,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $unistring: /* Universal string representation Either a plain UTF8 string, or a sequence of bytes for strings that @@ -21489,8 +20782,8 @@ Protocol Lima </div> <div id="GET_..--block_id--context--delegatesoutput.json" class="GET_..--block_id--context--delegates tabcontent"> <pre> - [ $Signature.Public_key_hash ... ] - $Signature.Public_key_hash: + [ $Signature.V0.Public_key_hash ... ] + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -21580,10 +20873,10 @@ Protocol Lima "current_ballot"?: "nay" | "yay" | "pass", "current_proposals"?: [ $Protocol_hash ... ], "remaining_proposals"?: integer ∈ [-2^30, 2^30], - "active_consensus_key": $Signature.Public_key_hash, + "active_consensus_key": $Signature.V0.Public_key_hash, "pending_consensus_keys"?: [ { "cycle": integer ∈ [-2^31-1, 2^31], - "pkh": $Signature.Public_key_hash } ... ] } + "pkh": $Signature.V0.Public_key_hash } ... ] } $015-PtLimaPt.contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a @@ -21593,7 +20886,7 @@ Protocol Lima $Protocol_hash: /* A Tezos protocol ID (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $int64: @@ -21716,13 +21009,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -21769,11 +21062,11 @@ Protocol Lima </div> <div id="GET_..--block_id--context--delegates--pkh--consensus_keyoutput.json" class="GET_..--block_id--context--delegates--pkh--consensus_key tabcontent"> <pre> - { "active": $Signature.Public_key_hash, + { "active": $Signature.V0.Public_key_hash, "pendings"?: [ { "cycle": integer ∈ [-2^31-1, 2^31], - "pkh": $Signature.Public_key_hash } ... ] } - $Signature.Public_key_hash: + "pkh": $Signature.V0.Public_key_hash } ... ] } + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -22056,13 +21349,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -22324,303 +21617,4128 @@ Protocol Lima +--------------------------------+----------------------+--------------------------------------------------------------+ - N.t - *** + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--staking_balance : + +**GET ../<block_id>/context/delegates/<pkh>/staking_balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balancedescr', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--staking_balancedescr" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <p> + Returns the total amount of tokens (in mutez) delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself, its frozen deposits, and its frozen bonds.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--voting_info : + +**GET ../<block_id>/context/delegates/<pkh>/voting_info** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infodescr', 'GET_..--block_id--context--delegates--pkh--voting_info')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.json', 'GET_..--block_id--context--delegates--pkh--voting_info')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_info')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--voting_infodescr" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <p> + Returns the delegate info (e.g. voting power) found in the listings of the current voting period.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.json" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <pre> + { "voting_power"?: $int64, + "current_ballot"?: "nay" | "yay" | "pass", + "current_proposals"?: [ $Protocol_hash ... ], + "remaining_proposals"?: integer ∈ [-2^30, 2^30] } + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <pre> + +--------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +======================================+==========+==============================================================+ + | ? presence of field "voting_power" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------+----------+--------------------------------------------------------------+ + | voting_power | 8 bytes | signed 64-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | ? presence of field "current_ballot" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------+----------+--------------------------------------------------------------+ + | current_ballot | 1 byte | signed 8-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | current_proposals | Variable | sequence of bytes | + +--------------------------------------+----------+--------------------------------------------------------------+ + | remaining_proposals | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------+----------+--------------------------------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--voting_power : + +**GET ../<block_id>/context/delegates/<pkh>/voting_power** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_powerdescr', 'GET_..--block_id--context--delegates--pkh--voting_power')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.json', 'GET_..--block_id--context--delegates--pkh--voting_power')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_power')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--voting_powerdescr" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <p> + The voting power in the vote listings for a given delegate.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.json" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <pre> + string + /* 64 bit integers + Decimal representation of 64 bit integers */</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--liquidity_baking--cpmm_address : + +**GET ../<block_id>/context/liquidity_baking/cpmm_address** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressdescr', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Binary output</button> + </div><div id="GET_..--block_id--context--liquidity_baking--cpmm_addressdescr" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <p> + Liquidity baking CPMM address</p> + </div> + <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <pre> + $unistring + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <pre> + +-----------------+----------+----------+ + | Name | Size | Contents | + +=================+==========+==========+ + | Unnamed field 0 | 22 bytes | $X_0 | + +-----------------+----------+----------+ + + + X_0 (22 bytes, 8-bit tag) + ************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree : + +**GET ../<block_id>/context/merkle_tree(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_treedescr', 'GET_..--block_id--context--merkle_tree')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.json', 'GET_..--block_id--context--merkle_tree')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.bin', 'GET_..--block_id--context--merkle_tree')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_treedescr" class="GET_..--block_id--context--merkle_tree tabcontent"> + <p> + Returns the merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.json" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + $merkle_tree /* Some */ || null /* None */ + $merkle_tree: + [ [ $unistring, + [ boolean, $unistring ] + /* Hash */ + || $raw_context + /* Data */ + || $merkle_tree + /* Continue */ ] ... ] + $raw_context: + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* Key */ + || { /* Dir */ + *: $raw_context } + || null + /* Cut */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.bin" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_8 | + +-----------------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------+----------------------+--------------+ + | Name | Size | Contents | + +=================+======================+==============+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+--------------+ + | Unnamed field 1 | Determined from data | $raw_context | + +-----------------+----------------------+--------------+ + + + raw_context (Determined from data, 8-bit tag) + ********************************************* + + Key (tag 0) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Dir (tag 1) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Cut (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_7 (Determined from data, 8-bit tag) + ************************************* + + Hash (tag 0) + ============ + + +-----------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 1 | Determined from data | $X_2 | + +-----------------+----------------------+-------------------------------------+ + + + Data (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $raw_context | + +-----------------+----------------------+------------------------+ + + + Continue (tag 2) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_7 | + +-----------------+----------------------+----------+ + + + merkle_tree + *********** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + + + X_8 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree_v2 : + +**GET ../<block_id>/context/merkle_tree_v2(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2descr', 'GET_..--block_id--context--merkle_tree_v2')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.json', 'GET_..--block_id--context--merkle_tree_v2')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.bin', 'GET_..--block_id--context--merkle_tree_v2')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_tree_v2descr" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <p> + Returns the Irmin merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.json" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + { /* Some */ + "version": integer ∈ [-2^15, 2^15-1], + "before": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "after": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "state": $tree_encoding } + || null + /* None */ + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $inode_tree: + { /* Inode_tree */ + "inode_tree": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Inode_values */ + "inode_values": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Blinded_inode */ + "blinded_inode": $Context_hash } + || { /* Inode_extender */ + "inode_extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $tree_encoding: + { /* Inode */ + "inode": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_trees */ + "other_trees": + { /* Node */ + "node": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_trees */ + "other_trees": + { /* Value */ + "value": + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* short_bytes */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* medium_bytes */ + || any + /* long_bytes + This case is void. No data is accepted. */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* unlimited_bytes */ } + || { /* Blinded_value */ + "blinded_value": $Context_hash } + || { /* Blinded_node */ + "blinded_node": $Context_hash } + || { /* Extender */ + "extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.bin" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_53821 | + +-----------------+----------------------+----------+ + + + X_0 + *** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_5 + *** + + +-----------------+----------------------+----------------+ + | Name | Size | Contents | + +=================+======================+================+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------------+ + | Unnamed field 1 | Determined from data | $tree_encoding | + +-----------------+----------------------+----------------+ + + + X_132 + ***** + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + X_131 + ***** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_132 | + +-----------------------+----------+-------------------------+ + + + inode_tree (Determined from data, 8-bit tag) + ******************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 186 (tag 186) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 187 (tag 187) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 188 (tag 188) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 189 (tag 189) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 190 (tag 190) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 191 (tag 191) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_5 | + +-----------------------+----------+-------------------------+ + + + case 192 (tag 192) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 209 (tag 209) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 210 (tag 210) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 211 (tag 211) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + tree_encoding (Determined from data, 8-bit tag) + *********************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== - A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ - +------+----------------------+----------+ - | Name | Size | Contents | - +======+======================+==========+ - | N.t | Determined from data | bytes | - +------+----------------------+----------+ - </pre> - </div> - - - -.. _GET_..--block_id--context--delegates--pkh--staking_balance : - -**GET ../<block_id>/context/delegates/<pkh>/staking_balance** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balancedescr', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Binary output</button> - </div><div id="GET_..--block_id--context--delegates--pkh--staking_balancedescr" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> - <p> - Returns the total amount of tokens (in mutez) delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself, its frozen deposits, and its frozen bonds.</p> - </div> - <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> - <pre> - $positive_bignum - $positive_bignum: - /* Positive big number - Decimal representation of a positive big number */ - string</pre> - </div> - <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> - <pre> - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $N.t | - +-----------------+----------------------+----------+ + case 186 (tag 186) + ================== + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ - N.t - *** - A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + case 187 (tag 187) + ================== - +------+----------------------+----------+ - | Name | Size | Contents | - +======+======================+==========+ - | N.t | Determined from data | bytes | - +------+----------------------+----------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ - </pre> - </div> - - - -.. _GET_..--block_id--context--delegates--pkh--voting_info : - -**GET ../<block_id>/context/delegates/<pkh>/voting_info** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infodescr', 'GET_..--block_id--context--delegates--pkh--voting_info')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.json', 'GET_..--block_id--context--delegates--pkh--voting_info')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_info')">Binary output</button> - </div><div id="GET_..--block_id--context--delegates--pkh--voting_infodescr" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> - <p> - Returns the delegate info (e.g. voting power) found in the listings of the current voting period.</p> - </div> - <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.json" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> - <pre> - { "voting_power"?: $int64, - "current_ballot"?: "nay" | "yay" | "pass", - "current_proposals"?: [ $Protocol_hash ... ], - "remaining_proposals"?: integer ∈ [-2^30, 2^30] } - $Protocol_hash: - /* A Tezos protocol ID (Base58Check-encoded) */ - $unistring - $int64: - /* 64 bit integers - Decimal representation of 64 bit integers */ - string - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> - </div> - <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> - <pre> - +--------------------------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +======================================+==========+==============================================================+ - | ? presence of field "voting_power" | 1 byte | boolean (0 for false, 255 for true) | - +--------------------------------------+----------+--------------------------------------------------------------+ - | voting_power | 8 bytes | signed 64-bit integer | - +--------------------------------------+----------+--------------------------------------------------------------+ - | ? presence of field "current_ballot" | 1 byte | boolean (0 for false, 255 for true) | - +--------------------------------------+----------+--------------------------------------------------------------+ - | current_ballot | 1 byte | signed 8-bit integer | - +--------------------------------------+----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +--------------------------------------+----------+--------------------------------------------------------------+ - | current_proposals | Variable | sequence of bytes | - +--------------------------------------+----------+--------------------------------------------------------------+ - | remaining_proposals | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +--------------------------------------+----------+--------------------------------------------------------------+ + case 188 (tag 188) + ================== - </pre> - </div> - - - -.. _GET_..--block_id--context--delegates--pkh--voting_power : - -**GET ../<block_id>/context/delegates/<pkh>/voting_power** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_powerdescr', 'GET_..--block_id--context--delegates--pkh--voting_power')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.json', 'GET_..--block_id--context--delegates--pkh--voting_power')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_power')">Binary output</button> - </div><div id="GET_..--block_id--context--delegates--pkh--voting_powerdescr" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> - <p> - The voting power in the vote listings for a given delegate.</p> - </div> - <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.json" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> - <pre> - string - /* 64 bit integers - Decimal representation of 64 bit integers */</pre> - </div> - <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> - <pre> - +-----------------+---------+-----------------------+ - | Name | Size | Contents | - +=================+=========+=======================+ - | Unnamed field 0 | 8 bytes | signed 64-bit integer | - +-----------------+---------+-----------------------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ - </pre> - </div> - - - -.. _GET_..--block_id--context--liquidity_baking--cpmm_address : - -**GET ../<block_id>/context/liquidity_baking/cpmm_address** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressdescr', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Binary output</button> - </div><div id="GET_..--block_id--context--liquidity_baking--cpmm_addressdescr" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> - <p> - Liquidity baking CPMM address</p> - </div> - <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> - <pre> - $unistring - /* A contract handle -- originated account - A contract notation as given to an RPC or inside scripts. Can be a - base58 originated contract hash. */ - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> - </div> - <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> - <pre> - +-----------------+----------+----------+ - | Name | Size | Contents | - +=================+==========+==========+ - | Unnamed field 0 | 22 bytes | $X_0 | - +-----------------+----------+----------+ + case 189 (tag 189) + ================== + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ - X_0 (22 bytes, 8-bit tag) - ************************* - Originated (tag 1) + case 190 (tag 190) ================== - +---------------+----------+------------------------+ - | Name | Size | Contents | - +===============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------+----------+------------------------+ - | Contract_hash | 20 bytes | bytes | - +---------------+----------+------------------------+ - | padding | 1 byte | padding | - +---------------+----------+------------------------+ - - </pre> - </div> - - - -.. _GET_..--block_id--context--merkle_tree : - -**GET ../<block_id>/context/merkle_tree(/<context_path>)*?[holey=<bool>]** - -.. raw:: html - - <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_treedescr', 'GET_..--block_id--context--merkle_tree')">Description</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.json', 'GET_..--block_id--context--merkle_tree')">Json output</button> - <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.bin', 'GET_..--block_id--context--merkle_tree')">Binary output</button> - </div><div id="GET_..--block_id--context--merkle_treedescr" class="GET_..--block_id--context--merkle_tree tabcontent"> - <p> - Returns the merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> - </div> - <div id="GET_..--block_id--context--merkle_treeoutput.json" class="GET_..--block_id--context--merkle_tree tabcontent"> - <pre> - $merkle_tree /* Some */ || null /* None */ - $merkle_tree: - [ [ $unistring, - [ boolean, $unistring ] - /* Hash */ - || $raw_context - /* Data */ - || $merkle_tree - /* Continue */ ] ... ] - $raw_context: - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ - /* Key */ - || { /* Dir */ - *: $raw_context } - || null - /* Cut */ - $unistring: - /* Universal string representation - Either a plain UTF8 string, or a sequence of bytes for strings that - contain invalid byte sequences. */ - string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> - </div> - <div id="GET_..--block_id--context--merkle_treeoutput.bin" class="GET_..--block_id--context--merkle_tree tabcontent"> - <pre> - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | - +-----------------+----------------------+----------+ + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ - X_2 - *** + case 191 (tag 191) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | bytes | + | Unnamed field 0 | Variable | sequence of $X_5 | +-----------------------+----------+-------------------------+ - X_3 - *** - - +-----------------+----------------------+--------------+ - | Name | Size | Contents | - +=================+======================+==============+ - | Unnamed field 0 | Determined from data | $X_2 | - +-----------------+----------------------+--------------+ - | Unnamed field 1 | Determined from data | $raw_context | - +-----------------+----------------------+--------------+ + case 192 (tag 192) + ================== + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ - raw_context (Determined from data, 8-bit tag) - ********************************************* - Key (tag 0) - =========== + case 193 (tag 193) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | + | # bytes in next field | 2 bytes | unsigned 16-bit integer | +-----------------------+----------+-------------------------+ | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - Dir (tag 1) - =========== + case 195 (tag 195) + ================== +-----------------------+----------+-------------------------+ | Name | Size | Contents | @@ -22629,12 +25747,100 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_3 | + | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - Cut (tag 2) - =========== + case 200 (tag 200) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 216 (tag 216) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 217 (tag 217) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 218 (tag 218) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 219 (tag 219) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== +------+--------+------------------------+ | Name | Size | Contents | @@ -22643,73 +25849,83 @@ Protocol Lima +------+--------+------------------------+ - X_7 (Determined from data, 8-bit tag) - ************************************* - - Hash (tag 0) - ============ - - +-----------------+----------------------+-------------------------------------+ - | Name | Size | Contents | - +=================+======================+=====================================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-----------------+----------------------+-------------------------------------+ - | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | - +-----------------+----------------------+-------------------------------------+ - | Unnamed field 1 | Determined from data | $X_2 | - +-----------------+----------------------+-------------------------------------+ - + X_53820 (Determined from data, 8-bit tag) + ***************************************** - Data (tag 1) - ============ + case 0 (tag 0) + ============== +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $raw_context | + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | +-----------------+----------------------+------------------------+ - Continue (tag 2) - ================ + case 1 (tag 1) + ============== +-----------------+----------------------+------------------------+ | Name | Size | Contents | +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $merkle_tree | + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | +-----------------+----------------------+------------------------+ - X_1 - *** + case 2 (tag 2) + ============== - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_2 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_7 | - +-----------------+----------------------+----------+ + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ - merkle_tree - *********** + case 3 (tag 3) + ============== - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_1 | - +-----------------------+----------+-------------------------+ + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ - X_8 (Determined from data, 8-bit tag) - ************************************* + X_53821 (Determined from data, 8-bit tag) + ***************************************** None (tag 0) ============ @@ -22729,7 +25945,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $merkle_tree | + | Unnamed field 0 | Determined from data | $X_53820 | +-----------------+----------------------+------------------------+ </pre> @@ -23177,7 +26393,7 @@ Protocol Lima "predecessor": $Commitment_hash /* Some */ || null /* None */, "inbox_merkle_root": $Inbox_list_hash }, "commitment_hash": $Commitment_hash, - "committer": $Signature.Public_key_hash, + "committer": $Signature.V0.Public_key_hash, "submitted_at": integer ∈ [-2^31-1, 2^31], "finalized_at"?: integer ∈ [-2^31-1, 2^31] } || null @@ -23194,7 +26410,7 @@ Protocol Lima $Message_result_list_hash: /* A merklised message result list hash (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -23736,7 +26952,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.liquidity_baking_toggle_vote: "off" | "on" | "pass" $Chain_id: /* Network identifier (Base58Check-encoded) */ @@ -23747,7 +26963,7 @@ Protocol Lima $Operation_list_list_hash: /* A list of list of operations (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring $block_hash: @@ -23856,9 +27072,9 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.liquidity_baking_toggle_vote: "off" | "on" | "pass" - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring $cycle_nonce: @@ -24245,7 +27461,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature }, + "signature": $Signature.V0 }, "operations": [ [ $next_operation ... ] ... ] } $015-PtLimaPt.block_header.alpha.full_header: /* Shell header @@ -24265,7 +27481,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a @@ -24285,13 +27501,13 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.inlined.endorsement: /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -24303,7 +27519,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -24484,7 +27700,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -24512,26 +27728,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24540,28 +27756,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24569,7 +27785,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24578,31 +27794,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24610,7 +27826,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24620,7 +27836,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24633,7 +27849,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24641,7 +27857,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24649,7 +27865,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24657,7 +27873,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24669,7 +27885,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -24684,7 +27900,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24695,27 +27911,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24726,7 +27942,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24734,10 +27950,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24746,7 +27962,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24755,7 +27971,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24768,13 +27984,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -24829,18 +28045,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24850,7 +28066,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24858,7 +28074,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24867,54 +28083,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -24924,7 +28105,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -24938,9 +28119,8 @@ Protocol Lima A smart contract rollup is identified by a base58 address starting with scr1 */ $unistring - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.tx_rollup_id: /* A tx rollup handle A tx rollup notation as given to an RPC or inside scripts, is a base58 @@ -24979,13 +28159,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -25058,13 +28238,13 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $next_operation: /* An operation's shell header. */ { "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -25756,13 +28936,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -25820,20 +29000,8 @@ Protocol Lima +-----------------+----------------------+----------+ - X_12 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_14 - **** + X_9 + *** +-----------------------+----------+-------------------------+ | Name | Size | Contents | @@ -25844,278 +29012,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_13 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_11 - **** - - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_12 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_13 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_18 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - - - X_16 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_18 | - +-----------------+----------------------+----------+ - - - X_26 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_25 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_26 | - +-----------------------+----------+-------------------------+ - - - X_24 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_25 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_23 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_24 | - +-----------------------+----------+-------------------------+ - - - X_21 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_23 | - +-----------------+----------------------+----------+ - - - X_31 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_30 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_31 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_32 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_30 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_28 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_32 | - +-----------------+----------------------+----------+ - - - X_15 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_16 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_21 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_28 | - +-----------------------+----------+-------------------------+ - - - X_10 - **** - - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_11 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_15 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_14 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_36 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_14 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_34 - **** + X_8 + *** +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_14 | + | Unnamed field 0 | Determined from data | $X_9 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_36 | + | Unnamed field 1 | Determined from data | $X_9 | +-----------------+----------------------+----------+ - X_9 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_10 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_34 | - +-----------------------+----------------------+-------------------------+ - - - X_39 + X_12 **** +-----------------------+----------+-------------------------+ @@ -26127,31 +29036,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_8 - *** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_9 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_39 | - +-----------------+----------------------+----------+ - - - X_40 + X_11 **** +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_14 | + | Unnamed field 0 | Determined from data | $X_12 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_42 + X_13 **** +--------+----------+------------------------+ @@ -26165,7 +29062,7 @@ Protocol Lima +--------+----------+------------------------+ - X_43 + X_14 **** +-------+----------+------------------+ @@ -26177,7 +29074,7 @@ Protocol Lima +-------+----------+------------------+ - X_45 + X_16 **** +-----------------------+----------+------------------------+ @@ -26189,19 +29086,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_50 + X_21 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_45 | + | Unnamed field 0 | Determined from data | $X_16 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_177 + X_148 ***** +-----------------+----------------------+------------------------+ @@ -26213,7 +29110,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_176 + X_147 ***** +-----------------------+----------+-------------------------+ @@ -26221,7 +29118,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_177 | + | Unnamed field 0 | Variable | sequence of $X_148 | +-----------------------+----------+-------------------------+ @@ -26286,7 +29183,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26300,7 +29197,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26314,7 +29211,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26328,7 +29225,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26342,7 +29239,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26356,7 +29253,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26370,7 +29267,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26384,7 +29281,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26398,7 +29295,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26412,7 +29309,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26426,7 +29323,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26440,7 +29337,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26454,7 +29351,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26468,7 +29365,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26482,7 +29379,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26496,7 +29393,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26510,7 +29407,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26524,7 +29421,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26538,7 +29435,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26552,7 +29449,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26566,7 +29463,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26580,7 +29477,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26594,7 +29491,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26608,7 +29505,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26622,7 +29519,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26636,7 +29533,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26650,7 +29547,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26664,7 +29561,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26678,7 +29575,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26692,7 +29589,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26706,7 +29603,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26720,7 +29617,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26734,7 +29631,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26748,7 +29645,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26762,7 +29659,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26776,7 +29673,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -26790,7 +29687,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26804,7 +29701,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26818,7 +29715,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26832,7 +29729,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26846,7 +29743,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26860,7 +29757,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26874,7 +29771,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26888,7 +29785,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26902,7 +29799,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26916,7 +29813,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26930,7 +29827,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26944,7 +29841,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26958,7 +29855,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26972,7 +29869,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -26986,7 +29883,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27000,7 +29897,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27014,7 +29911,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27028,7 +29925,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27042,7 +29939,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27056,7 +29953,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -27070,7 +29967,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -27084,7 +29981,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+-------------------------+ @@ -27098,7 +29995,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -27112,7 +30009,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -27190,7 +30087,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_21 | +-----------------+----------+-----------------------------+ @@ -27202,7 +30099,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_21 | +-----------------+----------+-----------------------------+ @@ -27214,7 +30111,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_21 | +-----------------+----------+-----------------------------+ @@ -27226,7 +30123,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_21 | +-----------------+----------+-----------------------------+ @@ -27238,7 +30135,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_21 | +-----------------+----------+-----------------------------+ @@ -27250,7 +30147,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_21 | +-----------------+----------+-----------------------------+ @@ -27262,7 +30159,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_21 | +-----------------+----------+-----------------------------+ @@ -27274,7 +30171,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_21 | +-----------------+----------+-----------------------------+ @@ -27286,7 +30183,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_21 | +-----------------+----------+-----------------------------+ @@ -27298,7 +30195,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_21 | +-----------------+----------+------------------------------+ @@ -27310,7 +30207,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_21 | +-----------------+----------+------------------------------+ @@ -27322,7 +30219,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_21 | +-----------------+----------+------------------------------+ @@ -27334,7 +30231,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_21 | +-----------------+----------+------------------------------+ @@ -27346,7 +30243,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_21 | +-----------------+----------+------------------------------+ @@ -27358,7 +30255,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_21 | +-----------------+----------+------------------------------+ @@ -27370,7 +30267,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_21 | +-----------------+----------+------------------------------+ @@ -27382,7 +30279,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_21 | +-----------------+----------+------------------------------+ @@ -27394,7 +30291,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_21 | +-----------------+----------+------------------------------+ @@ -27406,7 +30303,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_21 | +-----------------+----------+------------------------------+ @@ -27418,7 +30315,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_21 | +-----------------+----------+------------------------------+ @@ -27430,7 +30327,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_21 | +-----------------+----------+------------------------------+ @@ -27442,7 +30339,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_21 | +-----------------+----------+------------------------------+ @@ -27454,7 +30351,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_21 | +-----------------+----------+------------------------------+ @@ -27466,7 +30363,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_21 | +-----------------+----------+------------------------------+ @@ -27478,7 +30375,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_21 | +-----------------+----------+------------------------------+ @@ -27490,7 +30387,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_21 | +-----------------+----------+------------------------------+ @@ -27502,7 +30399,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_21 | +-----------------+----------+------------------------------+ @@ -27514,7 +30411,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_21 | +-----------------+----------+------------------------------+ @@ -27526,7 +30423,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_21 | +-----------------+----------+------------------------------+ @@ -27538,7 +30435,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_21 | +-----------------+----------+------------------------------+ @@ -27550,7 +30447,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_21 | +-----------------+----------+------------------------------+ @@ -27562,7 +30459,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_21 | +-----------------+----------+------------------------------+ @@ -27574,7 +30471,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_21 | +-----------------+----------+------------------------------+ @@ -27586,7 +30483,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_21 | +-----------------+----------+------------------------------+ @@ -27598,7 +30495,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_21 | +-----------------+----------+------------------------------+ @@ -27610,7 +30507,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_21 | +-----------------+----------+------------------------------+ @@ -27622,7 +30519,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_21 | +-----------------+----------+------------------------------+ @@ -27634,7 +30531,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_21 | +-----------------+----------+------------------------------+ @@ -27646,7 +30543,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_21 | +-----------------+----------+------------------------------+ @@ -27658,7 +30555,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_21 | +-----------------+----------+------------------------------+ @@ -27670,7 +30567,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_21 | +-----------------+----------+------------------------------+ @@ -27682,7 +30579,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_21 | +-----------------+----------+------------------------------+ @@ -27694,7 +30591,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_21 | +-----------------+----------+------------------------------+ @@ -27706,7 +30603,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_21 | +-----------------+----------+------------------------------+ @@ -27718,7 +30615,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_21 | +-----------------+----------+------------------------------+ @@ -27730,7 +30627,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_21 | +-----------------+----------+------------------------------+ @@ -27742,7 +30639,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_21 | +-----------------+----------+------------------------------+ @@ -27754,7 +30651,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_21 | +-----------------+----------+------------------------------+ @@ -27766,7 +30663,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_21 | +-----------------+----------+------------------------------+ @@ -27778,7 +30675,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_21 | +-----------------+----------+------------------------------+ @@ -27790,7 +30687,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_21 | +-----------------+----------+------------------------------+ @@ -27802,7 +30699,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_21 | +-----------------+----------+------------------------------+ @@ -27814,7 +30711,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_21 | +-----------------+----------+------------------------------+ @@ -27826,7 +30723,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_21 | +-----------------+----------+------------------------------+ @@ -27838,7 +30735,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_21 | +-----------------+----------+------------------------------+ @@ -27850,7 +30747,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_21 | +-----------------+----------+------------------------------+ @@ -27862,7 +30759,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_21 | +-----------------+----------+------------------------------+ @@ -27874,7 +30771,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_21 | +-----------------+----------+------------------------------+ @@ -27886,7 +30783,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_21 | +-----------------+----------+------------------------------+ @@ -27898,7 +30795,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_21 | +-----------------+----------+------------------------------+ @@ -27910,7 +30807,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_21 | +-----------------+----------+------------------------------+ @@ -27922,7 +30819,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_21 | +-----------------+----------+------------------------------+ @@ -27936,7 +30833,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_50 | + | Unnamed field 0 | Variable | sequence of $X_21 | +-----------------------+----------+-------------------------+ @@ -27962,7 +30859,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -27978,7 +30875,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -27994,7 +30891,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -28010,7 +30907,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -28087,7 +30984,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28101,7 +30998,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28115,7 +31012,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28129,7 +31026,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28143,7 +31040,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28157,7 +31054,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28171,7 +31068,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28185,7 +31082,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28199,7 +31096,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28213,7 +31110,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28227,7 +31124,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28241,7 +31138,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28255,7 +31152,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28269,7 +31166,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28283,7 +31180,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28297,7 +31194,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28311,7 +31208,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28325,7 +31222,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28339,7 +31236,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28353,7 +31250,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28367,7 +31264,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28381,7 +31278,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28395,7 +31292,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28409,7 +31306,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28423,7 +31320,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28437,7 +31334,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28451,7 +31348,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28465,7 +31362,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28479,7 +31376,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28493,7 +31390,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28507,7 +31404,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28521,7 +31418,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28535,7 +31432,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28549,7 +31446,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28563,7 +31460,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28577,7 +31474,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_148 | +-----------------+----------------------+------------------------------+ @@ -28591,7 +31488,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28605,7 +31502,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28619,7 +31516,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28633,7 +31530,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28647,7 +31544,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28661,7 +31558,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28675,7 +31572,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28689,7 +31586,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28703,7 +31600,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28717,7 +31614,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28731,7 +31628,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28745,7 +31642,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28759,7 +31656,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28773,7 +31670,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28787,7 +31684,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28801,7 +31698,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28815,7 +31712,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28829,7 +31726,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28843,7 +31740,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28857,7 +31754,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_177 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_148 | +-----------------+----------------------+-------------------------------+ @@ -28871,7 +31768,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -28885,7 +31782,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+-------------------------+ @@ -28899,7 +31796,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -28913,7 +31810,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_176 | + | Unnamed field 1 | Determined from data | $X_147 | +-----------------+----------------------+------------------------+ @@ -28991,7 +31888,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_21 | +-----------------+----------+-----------------------------+ @@ -29003,7 +31900,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_21 | +-----------------+----------+-----------------------------+ @@ -29015,7 +31912,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_21 | +-----------------+----------+-----------------------------+ @@ -29027,7 +31924,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_21 | +-----------------+----------+-----------------------------+ @@ -29039,7 +31936,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_21 | +-----------------+----------+-----------------------------+ @@ -29051,7 +31948,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_21 | +-----------------+----------+-----------------------------+ @@ -29063,7 +31960,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_21 | +-----------------+----------+-----------------------------+ @@ -29075,7 +31972,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_21 | +-----------------+----------+-----------------------------+ @@ -29087,7 +31984,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_21 | +-----------------+----------+-----------------------------+ @@ -29099,7 +31996,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_21 | +-----------------+----------+------------------------------+ @@ -29111,7 +32008,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_21 | +-----------------+----------+------------------------------+ @@ -29123,7 +32020,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_21 | +-----------------+----------+------------------------------+ @@ -29135,7 +32032,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_21 | +-----------------+----------+------------------------------+ @@ -29147,7 +32044,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_21 | +-----------------+----------+------------------------------+ @@ -29159,7 +32056,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_21 | +-----------------+----------+------------------------------+ @@ -29171,7 +32068,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_21 | +-----------------+----------+------------------------------+ @@ -29183,7 +32080,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_21 | +-----------------+----------+------------------------------+ @@ -29195,7 +32092,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_21 | +-----------------+----------+------------------------------+ @@ -29207,7 +32104,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_21 | +-----------------+----------+------------------------------+ @@ -29219,7 +32116,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_21 | +-----------------+----------+------------------------------+ @@ -29231,7 +32128,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_21 | +-----------------+----------+------------------------------+ @@ -29243,7 +32140,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_21 | +-----------------+----------+------------------------------+ @@ -29255,7 +32152,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_21 | +-----------------+----------+------------------------------+ @@ -29267,7 +32164,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_21 | +-----------------+----------+------------------------------+ @@ -29279,7 +32176,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_21 | +-----------------+----------+------------------------------+ @@ -29291,7 +32188,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_21 | +-----------------+----------+------------------------------+ @@ -29303,7 +32200,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_21 | +-----------------+----------+------------------------------+ @@ -29315,7 +32212,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_21 | +-----------------+----------+------------------------------+ @@ -29327,7 +32224,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_21 | +-----------------+----------+------------------------------+ @@ -29339,7 +32236,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_21 | +-----------------+----------+------------------------------+ @@ -29351,7 +32248,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_21 | +-----------------+----------+------------------------------+ @@ -29363,7 +32260,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_21 | +-----------------+----------+------------------------------+ @@ -29375,7 +32272,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_21 | +-----------------+----------+------------------------------+ @@ -29387,7 +32284,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_21 | +-----------------+----------+------------------------------+ @@ -29399,7 +32296,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_21 | +-----------------+----------+------------------------------+ @@ -29411,7 +32308,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_21 | +-----------------+----------+------------------------------+ @@ -29423,7 +32320,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_21 | +-----------------+----------+------------------------------+ @@ -29435,7 +32332,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_21 | +-----------------+----------+------------------------------+ @@ -29447,7 +32344,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_21 | +-----------------+----------+------------------------------+ @@ -29459,7 +32356,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_21 | +-----------------+----------+------------------------------+ @@ -29471,7 +32368,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_21 | +-----------------+----------+------------------------------+ @@ -29483,7 +32380,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_21 | +-----------------+----------+------------------------------+ @@ -29495,7 +32392,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_21 | +-----------------+----------+------------------------------+ @@ -29507,7 +32404,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_21 | +-----------------+----------+------------------------------+ @@ -29519,7 +32416,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_21 | +-----------------+----------+------------------------------+ @@ -29531,7 +32428,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_21 | +-----------------+----------+------------------------------+ @@ -29543,7 +32440,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_21 | +-----------------+----------+------------------------------+ @@ -29555,7 +32452,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_21 | +-----------------+----------+------------------------------+ @@ -29567,7 +32464,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_21 | +-----------------+----------+------------------------------+ @@ -29579,7 +32476,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_21 | +-----------------+----------+------------------------------+ @@ -29591,7 +32488,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_21 | +-----------------+----------+------------------------------+ @@ -29603,7 +32500,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_21 | +-----------------+----------+------------------------------+ @@ -29615,7 +32512,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_21 | +-----------------+----------+------------------------------+ @@ -29627,7 +32524,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_21 | +-----------------+----------+------------------------------+ @@ -29639,7 +32536,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_21 | +-----------------+----------+------------------------------+ @@ -29651,7 +32548,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_21 | +-----------------+----------+------------------------------+ @@ -29663,7 +32560,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_21 | +-----------------+----------+------------------------------+ @@ -29675,7 +32572,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_21 | +-----------------+----------+------------------------------+ @@ -29687,7 +32584,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_21 | +-----------------+----------+------------------------------+ @@ -29699,7 +32596,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_21 | +-----------------+----------+------------------------------+ @@ -29711,7 +32608,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_21 | +-----------------+----------+------------------------------+ @@ -29723,7 +32620,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_50 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_21 | +-----------------+----------+------------------------------+ @@ -29737,7 +32634,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_50 | + | Unnamed field 0 | Variable | sequence of $X_21 | +-----------------------+----------+-------------------------+ @@ -29817,7 +32714,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -29833,7 +32730,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -29849,7 +32746,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -29865,7 +32762,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_45 | + | Unnamed field 1 | Determined from data | $X_16 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -29881,7 +32778,7 @@ Protocol Lima +------+--------+------------------------+ - X_53865 (Determined from data, 8-bit tag) + X_53836 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -29956,7 +32853,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107687 (Determined from data, 8-bit tag) + X_107658 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -29967,7 +32864,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53865 | + | proof | Determined from data | $X_53836 | +-------+----------------------+------------------------+ @@ -29979,7 +32876,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53865 | + | proof | Determined from data | $X_53836 | +-------+----------------------+------------------------+ @@ -29993,7 +32890,7 @@ Protocol Lima +------+--------+------------------------+ - X_107689 (Determined from data, 8-bit tag) + X_107660 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -30004,11 +32901,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_39 | + | raw_data | Determined from data | $X_9 | +----------+----------------------+------------------------+ - X_107690 (Determined from data, 8-bit tag) + X_107661 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -30037,11 +32934,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107689 | + | reveal_proof | Determined from data | $X_107660 | +--------------+----------------------+------------------------+ - X_107691 + X_107662 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -30055,7 +32952,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107692 (Determined from data, 8-bit tag) + X_107663 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -30068,7 +32965,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107691 | + | Unnamed field 0 | Variable | sequence of $X_107662 | +-----------------------+----------+-------------------------+ @@ -30080,15 +32977,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107687 | + | pvm_step | Determined from data | $X_107658 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107690 | + | input_proof | Determined from data | $X_107661 | +-----------------------------------+----------------------+-------------------------------------+ - X_44 + X_15 **** +--------+----------------------+-----------+ @@ -30096,11 +32993,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107692 | + | step | Determined from data | $X_107663 | +--------+----------------------+-----------+ - X_107693 + X_107664 ******** +------------------+----------+-----------------------+ @@ -30116,7 +33013,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107695 (Enumeration: unsigned 8-bit integer): + X_107666 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -30128,7 +33025,7 @@ Protocol Lima +-------------+---------------------+ - X_107697 (Determined from data, 8-bit tag) + X_107668 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -30179,7 +33076,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107696 + X_107667 ******** +-----------------------+----------------------+---------------------------+ @@ -30195,13 +33092,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107697 | + | amount | Determined from data | $X_107668 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107698 + X_107669 ******** +-------------+----------------------+------------------+ @@ -30213,11 +33110,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107697 | + | amount | Determined from data | $X_107668 | +-------------+----------------------+------------------+ - X_107700 (Determined from data, 8-bit tag) + X_107671 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -30242,11 +33139,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107698 | + | deposit | Determined from data | $X_107669 | +---------+----------------------+------------------------+ - X_107701 + X_107672 ******** +--------------------+----------+----------+ @@ -30258,7 +33155,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107703 (Determined from data, 8-bit tag) + X_107674 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -30283,7 +33180,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107702 + X_107673 ******** +-----------------------+----------------------+-------------------------+ @@ -30295,7 +33192,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107703 | + | predecessor | Determined from data | $X_107674 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -30450,7 +33347,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107704 + X_107675 ******** +-----------------------+----------------------+--------------------------+ @@ -30464,7 +33361,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107705 + X_107676 ******** +-----------------+-----------+----------+ @@ -30531,7 +33428,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_39 | + | fitness | Variable | sequence of $X_9 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -30715,7 +33612,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107705 | + | solution | 200 bytes | $X_107676 | +----------+-----------+------------------------+ @@ -30845,7 +33742,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107704 | + | parameters | Determined from data | $X_107675 | +----------------------------------+----------------------+-------------------------------------+ @@ -31065,7 +33962,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107702 | + | commitment | Determined from data | $X_107673 | +---------------+----------------------+------------------------+ @@ -31157,7 +34054,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107700 | + | message | Determined from data | $X_107671 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -31171,7 +34068,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107701 | + | previous_message_result | 64 bytes | $X_107672 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -31215,7 +34112,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107696 | + | tickets_info | Variable | sequence of $X_107667 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -31275,7 +34172,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107695) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107666) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -31315,7 +34212,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_14 | + | message | Variable | sequence of $X_12 | +------------------------------------------------+----------------------+-------------------------+ @@ -31367,7 +34264,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107693 | + | commitment | 76 bytes | $X_107664 | +------------------------------------------------+----------------------+-------------------------+ @@ -31397,7 +34294,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_44 | + | refutation | Determined from data | $X_15 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -31423,7 +34320,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_43 | + | stakers | 42 bytes | $X_14 | +------------------------------------------------+----------------------+-------------------------+ @@ -31523,7 +34420,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_42 | + | slot | 53 bytes | $X_13 | +---------------+----------------------+------------------------+ @@ -31549,7 +34446,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_40 | + | circuits_info | Variable | sequence of $X_11 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -31860,7 +34757,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a @@ -31880,13 +34777,13 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.inlined.endorsement: /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -31898,7 +34795,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -32079,7 +34976,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -32107,26 +35004,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32135,28 +35032,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32164,7 +35061,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32173,31 +35070,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32205,7 +35102,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32215,7 +35112,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32228,7 +35125,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32236,7 +35133,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32244,7 +35141,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32252,7 +35149,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32264,7 +35161,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -32279,7 +35176,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32290,27 +35187,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32321,7 +35218,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32329,10 +35226,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32341,7 +35238,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32350,7 +35247,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32363,13 +35260,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -32424,18 +35321,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32445,7 +35342,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32453,7 +35350,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32462,54 +35359,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -32519,7 +35381,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -32533,9 +35395,8 @@ Protocol Lima A smart contract rollup is identified by a base58 address starting with scr1 */ $unistring - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.tx_rollup_id: /* A tx rollup handle A tx rollup notation as given to an RPC or inside scripts, is a base58 @@ -32574,13 +35435,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -32653,13 +35514,13 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $next_operation: /* An operation's shell header. */ { "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -33325,13 +36186,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -33389,302 +36250,31 @@ Protocol Lima +-----------------+----------------------+----------+ - X_10 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_12 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+-------------------------+ - - - X_11 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_9 + X_7 *** - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_10 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_11 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_16 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - - - X_14 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_16 | - +-----------------+----------------------+----------+ - - - X_24 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_23 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_24 | - +-----------------------+----------+-------------------------+ - - - X_22 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_23 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_21 - **** - +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_22 | - +-----------------------+----------+-------------------------+ - - - X_19 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_21 | - +-----------------+----------------------+----------+ - - - X_29 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_28 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_29 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_30 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_28 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_26 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_30 | - +-----------------+----------------------+----------+ - - - X_13 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_14 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_19 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_26 | + | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - X_8 + X_6 *** - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_9 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_13 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_12 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_34 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_12 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_32 - **** - +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_34 | + | Unnamed field 1 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - X_7 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_8 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_32 | - +-----------------------+----------------------+-------------------------+ - - - X_37 + X_10 **** +-----------------------+----------+-------------------------+ @@ -33696,31 +36286,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_6 + X_9 *** - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_37 | - +-----------------+----------------------+----------+ - - - X_38 - **** - +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_10 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_40 + X_11 **** +--------+----------+------------------------+ @@ -33734,7 +36312,7 @@ Protocol Lima +--------+----------+------------------------+ - X_41 + X_12 **** +-------+----------+------------------+ @@ -33746,7 +36324,7 @@ Protocol Lima +-------+----------+------------------+ - X_43 + X_14 **** +-----------------------+----------+------------------------+ @@ -33758,19 +36336,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_48 + X_19 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_43 | + | Unnamed field 0 | Determined from data | $X_14 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_175 + X_146 ***** +-----------------+----------------------+------------------------+ @@ -33782,7 +36360,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_174 + X_145 ***** +-----------------------+----------+-------------------------+ @@ -33790,7 +36368,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_175 | + | Unnamed field 0 | Variable | sequence of $X_146 | +-----------------------+----------+-------------------------+ @@ -33855,7 +36433,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33869,7 +36447,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33883,7 +36461,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33897,7 +36475,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33911,7 +36489,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33925,7 +36503,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33939,7 +36517,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33953,7 +36531,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33967,7 +36545,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33981,7 +36559,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -33995,7 +36573,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34009,7 +36587,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34023,7 +36601,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34037,7 +36615,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34051,7 +36629,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34065,7 +36643,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34079,7 +36657,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34093,7 +36671,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34107,7 +36685,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34121,7 +36699,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34135,7 +36713,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34149,7 +36727,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34163,7 +36741,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34177,7 +36755,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34191,7 +36769,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34205,7 +36783,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34219,7 +36797,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34233,7 +36811,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34247,7 +36825,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34261,7 +36839,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34275,7 +36853,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34289,7 +36867,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34303,7 +36881,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34317,7 +36895,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34331,7 +36909,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34345,7 +36923,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -34359,7 +36937,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34373,7 +36951,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34387,7 +36965,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34401,7 +36979,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34415,7 +36993,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34429,7 +37007,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34443,7 +37021,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34457,7 +37035,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34471,7 +37049,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34485,7 +37063,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34499,7 +37077,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34513,7 +37091,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34527,7 +37105,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34541,7 +37119,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34555,7 +37133,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34569,7 +37147,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34583,7 +37161,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34597,7 +37175,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34611,7 +37189,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34625,7 +37203,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -34639,7 +37217,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -34653,7 +37231,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -34667,7 +37245,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -34681,7 +37259,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -34759,7 +37337,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -34771,7 +37349,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -34783,7 +37361,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -34795,7 +37373,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -34807,7 +37385,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -34819,7 +37397,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -34831,7 +37409,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -34843,7 +37421,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -34855,7 +37433,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -34867,7 +37445,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -34879,7 +37457,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -34891,7 +37469,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -34903,7 +37481,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -34915,7 +37493,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -34927,7 +37505,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -34939,7 +37517,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -34951,7 +37529,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -34963,7 +37541,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -34975,7 +37553,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -34987,7 +37565,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -34999,7 +37577,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -35011,7 +37589,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -35023,7 +37601,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -35035,7 +37613,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -35047,7 +37625,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -35059,7 +37637,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -35071,7 +37649,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -35083,7 +37661,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -35095,7 +37673,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -35107,7 +37685,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -35119,7 +37697,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -35131,7 +37709,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -35143,7 +37721,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -35155,7 +37733,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -35167,7 +37745,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -35179,7 +37757,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -35191,7 +37769,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -35203,7 +37781,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -35215,7 +37793,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -35227,7 +37805,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -35239,7 +37817,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -35251,7 +37829,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -35263,7 +37841,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -35275,7 +37853,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -35287,7 +37865,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -35299,7 +37877,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -35311,7 +37889,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -35323,7 +37901,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -35335,7 +37913,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -35347,7 +37925,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -35359,7 +37937,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -35371,7 +37949,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -35383,7 +37961,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -35395,7 +37973,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -35407,7 +37985,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -35419,7 +37997,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -35431,7 +38009,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -35443,7 +38021,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -35455,7 +38033,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -35467,7 +38045,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -35479,7 +38057,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -35491,7 +38069,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -35505,7 +38083,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -35531,7 +38109,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -35547,7 +38125,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -35563,7 +38141,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -35579,7 +38157,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -35656,7 +38234,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35670,7 +38248,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35684,7 +38262,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35698,7 +38276,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35712,7 +38290,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35726,7 +38304,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35740,7 +38318,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35754,7 +38332,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35768,7 +38346,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35782,7 +38360,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35796,7 +38374,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35810,7 +38388,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35824,7 +38402,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35838,7 +38416,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35852,7 +38430,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35866,7 +38444,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35880,7 +38458,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35894,7 +38472,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35908,7 +38486,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35922,7 +38500,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35936,7 +38514,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35950,7 +38528,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35964,7 +38542,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35978,7 +38556,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -35992,7 +38570,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36006,7 +38584,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36020,7 +38598,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36034,7 +38612,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36048,7 +38626,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36062,7 +38640,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36076,7 +38654,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36090,7 +38668,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36104,7 +38682,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36118,7 +38696,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36132,7 +38710,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36146,7 +38724,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -36160,7 +38738,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36174,7 +38752,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36188,7 +38766,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36202,7 +38780,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36216,7 +38794,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36230,7 +38808,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36244,7 +38822,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36258,7 +38836,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36272,7 +38850,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36286,7 +38864,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36300,7 +38878,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36314,7 +38892,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36328,7 +38906,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36342,7 +38920,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36356,7 +38934,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36370,7 +38948,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36384,7 +38962,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36398,7 +38976,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36412,7 +38990,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36426,7 +39004,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -36440,7 +39018,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -36454,7 +39032,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -36468,7 +39046,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -36482,7 +39060,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -36560,7 +39138,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -36572,7 +39150,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -36584,7 +39162,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -36596,7 +39174,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -36608,7 +39186,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -36620,7 +39198,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -36632,7 +39210,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -36644,7 +39222,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -36656,7 +39234,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -36668,7 +39246,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -36680,7 +39258,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -36692,7 +39270,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -36704,7 +39282,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -36716,7 +39294,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -36728,7 +39306,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -36740,7 +39318,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -36752,7 +39330,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -36764,7 +39342,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -36776,7 +39354,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -36788,7 +39366,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -36800,7 +39378,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -36812,7 +39390,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -36824,7 +39402,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -36836,7 +39414,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -36848,7 +39426,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -36860,7 +39438,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -36872,7 +39450,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -36884,7 +39462,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -36896,7 +39474,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -36908,7 +39486,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -36920,7 +39498,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -36932,7 +39510,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -36944,7 +39522,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -36956,7 +39534,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -36968,7 +39546,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -36980,7 +39558,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -36992,7 +39570,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -37004,7 +39582,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -37016,7 +39594,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -37028,7 +39606,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -37040,7 +39618,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -37052,7 +39630,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -37064,7 +39642,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -37076,7 +39654,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -37088,7 +39666,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -37100,7 +39678,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -37112,7 +39690,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -37124,7 +39702,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -37136,7 +39714,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -37148,7 +39726,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -37160,7 +39738,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -37172,7 +39750,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -37184,7 +39762,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -37196,7 +39774,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -37208,7 +39786,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -37220,7 +39798,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -37232,7 +39810,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -37244,7 +39822,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -37256,7 +39834,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -37268,7 +39846,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -37280,7 +39858,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -37292,7 +39870,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -37306,7 +39884,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -37386,7 +39964,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -37402,7 +39980,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -37418,7 +39996,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -37434,7 +40012,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -37450,7 +40028,7 @@ Protocol Lima +------+--------+------------------------+ - X_53863 (Determined from data, 8-bit tag) + X_53834 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -37525,7 +40103,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107685 (Determined from data, 8-bit tag) + X_107656 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -37536,7 +40114,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -37548,7 +40126,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -37562,7 +40140,7 @@ Protocol Lima +------+--------+------------------------+ - X_107687 (Determined from data, 8-bit tag) + X_107658 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -37573,11 +40151,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_37 | + | raw_data | Determined from data | $X_7 | +----------+----------------------+------------------------+ - X_107688 (Determined from data, 8-bit tag) + X_107659 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -37606,11 +40184,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107687 | + | reveal_proof | Determined from data | $X_107658 | +--------------+----------------------+------------------------+ - X_107689 + X_107660 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -37624,7 +40202,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107690 (Determined from data, 8-bit tag) + X_107661 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -37637,7 +40215,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107689 | + | Unnamed field 0 | Variable | sequence of $X_107660 | +-----------------------+----------+-------------------------+ @@ -37649,15 +40227,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107685 | + | pvm_step | Determined from data | $X_107656 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107688 | + | input_proof | Determined from data | $X_107659 | +-----------------------------------+----------------------+-------------------------------------+ - X_42 + X_13 **** +--------+----------------------+-----------+ @@ -37665,11 +40243,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107690 | + | step | Determined from data | $X_107661 | +--------+----------------------+-----------+ - X_107691 + X_107662 ******** +------------------+----------+-----------------------+ @@ -37685,7 +40263,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107693 (Enumeration: unsigned 8-bit integer): + X_107664 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -37697,7 +40275,7 @@ Protocol Lima +-------------+---------------------+ - X_107695 (Determined from data, 8-bit tag) + X_107666 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -37748,7 +40326,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107694 + X_107665 ******** +-----------------------+----------------------+---------------------------+ @@ -37764,13 +40342,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107696 + X_107667 ******** +-------------+----------------------+------------------+ @@ -37782,11 +40360,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-------------+----------------------+------------------+ - X_107698 (Determined from data, 8-bit tag) + X_107669 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -37811,11 +40389,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107696 | + | deposit | Determined from data | $X_107667 | +---------+----------------------+------------------------+ - X_107699 + X_107670 ******** +--------------------+----------+----------+ @@ -37827,7 +40405,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107701 (Determined from data, 8-bit tag) + X_107672 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -37852,7 +40430,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107700 + X_107671 ******** +-----------------------+----------------------+-------------------------+ @@ -37864,7 +40442,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107701 | + | predecessor | Determined from data | $X_107672 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -38019,7 +40597,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107702 + X_107673 ******** +-----------------------+----------------------+--------------------------+ @@ -38033,7 +40611,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107703 + X_107674 ******** +-----------------+-----------+----------+ @@ -38100,7 +40678,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_37 | + | fitness | Variable | sequence of $X_7 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -38284,7 +40862,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107703 | + | solution | 200 bytes | $X_107674 | +----------+-----------+------------------------+ @@ -38414,7 +40992,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+-------------------------------------+ @@ -38634,7 +41212,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107700 | + | commitment | Determined from data | $X_107671 | +---------------+----------------------+------------------------+ @@ -38726,7 +41304,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107698 | + | message | Determined from data | $X_107669 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -38740,7 +41318,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107699 | + | previous_message_result | 64 bytes | $X_107670 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -38784,7 +41362,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107694 | + | tickets_info | Variable | sequence of $X_107665 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -38844,7 +41422,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107693) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107664) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -38884,7 +41462,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_12 | + | message | Variable | sequence of $X_10 | +------------------------------------------------+----------------------+-------------------------+ @@ -38936,7 +41514,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107691 | + | commitment | 76 bytes | $X_107662 | +------------------------------------------------+----------------------+-------------------------+ @@ -38966,7 +41544,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_42 | + | refutation | Determined from data | $X_13 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -38992,7 +41570,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_41 | + | stakers | 42 bytes | $X_12 | +------------------------------------------------+----------------------+-------------------------+ @@ -39092,7 +41670,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_40 | + | slot | 53 bytes | $X_11 | +---------------+----------------------+------------------------+ @@ -39118,7 +41696,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_38 | + | circuits_info | Variable | sequence of $X_9 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -39183,9 +41761,8 @@ Protocol Lima "nonce": integer ∈ [0, 2^16-1], "amount": $015-PtLimaPt.mutez, "destination": $015-PtLimaPt.transaction_destination, - "parameters"?: - { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, + "value": any }, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -39193,7 +41770,7 @@ Protocol Lima "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.origination } @@ -39201,7 +41778,7 @@ Protocol Lima "kind": "delegation", "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -39235,7 +41812,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $015-PtLimaPt.tx_rollup_id } @@ -39260,7 +41837,7 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.error: /* The full list of RPC errors would be too long to include. @@ -39272,7 +41849,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -39284,7 +41861,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -39524,7 +42101,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -39552,26 +42129,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39580,28 +42157,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39609,7 +42186,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39618,31 +42195,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39650,7 +42227,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39660,7 +42237,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39673,7 +42250,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39681,7 +42258,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39689,7 +42266,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39697,7 +42274,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39709,7 +42286,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -39724,7 +42301,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39735,27 +42312,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39766,7 +42343,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39774,10 +42351,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39786,7 +42363,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39795,7 +42372,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39808,13 +42385,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -39869,18 +42446,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39890,7 +42467,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39898,7 +42475,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39907,54 +42484,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -39964,7 +42506,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -40144,9 +42686,9 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Preendorsement */ "kind": "preendorsement", "slot": integer ∈ [0, 2^16-1], @@ -40156,14 +42698,14 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $015-PtLimaPt.inlined.preendorsement, @@ -40194,25 +42736,25 @@ Protocol Lima $015-PtLimaPt.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40222,7 +42764,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40231,7 +42773,7 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40241,13 +42783,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "metadata": { "balance_updates"?: @@ -40258,12 +42800,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40273,12 +42815,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40288,7 +42830,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40303,7 +42845,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40319,12 +42861,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key, + "pk": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40334,16 +42876,16 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash, + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "allocated_destination_contract"?: boolean } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40358,7 +42900,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40375,7 +42917,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40395,7 +42937,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40410,7 +42952,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40425,7 +42967,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40440,7 +42982,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40452,7 +42994,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -40474,13 +43016,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, @@ -40494,7 +43036,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40512,7 +43054,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40523,11 +43065,11 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40537,7 +43079,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40545,7 +43087,7 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40555,7 +43097,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40571,7 +43113,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40587,7 +43129,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40607,13 +43149,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -40675,15 +43217,15 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -40693,7 +43235,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40710,7 +43252,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40725,7 +43267,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40741,48 +43283,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30], @@ -40795,7 +43302,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -40805,7 +43312,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -41139,7 +43646,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -41217,7 +43724,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -41288,7 +43795,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -41366,7 +43873,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -41703,10 +44210,10 @@ Protocol Lima { /* Operation_with_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -41721,7 +44228,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -41762,7 +44269,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -41839,9 +44346,8 @@ Protocol Lima /* Sapling state identifier A sapling state identifier */ $bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -41890,13 +44396,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -41972,7 +44478,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -42649,13 +45155,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -42713,20 +45219,8 @@ Protocol Lima +-----------------+----------------------+----------+ - X_11 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_13 - **** + X_8 + *** +-----------------------+----------+-------------------------+ | Name | Size | Contents | @@ -42737,278 +45231,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_12 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_10 - **** - - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_11 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_12 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_17 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - - - X_15 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_17 | - +-----------------+----------------------+----------+ - - - X_25 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_24 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_25 | - +-----------------------+----------+-------------------------+ - - - X_23 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_24 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_22 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_23 | - +-----------------------+----------+-------------------------+ - - - X_20 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_22 | - +-----------------+----------------------+----------+ - - - X_30 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_29 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_30 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_31 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_29 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_27 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_31 | - +-----------------+----------------------+----------+ - - - X_14 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_15 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_20 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_27 | - +-----------------------+----------+-------------------------+ - - - X_9 + X_7 *** - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_10 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_14 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_13 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_35 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_13 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_33 - **** - +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | + | Unnamed field 0 | Determined from data | $X_8 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_35 | + | Unnamed field 1 | Determined from data | $X_8 | +-----------------+----------------------+----------+ - X_8 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_9 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_33 | - +-----------------------+----------------------+-------------------------+ - - - X_38 + X_11 **** +-----------------------+----------+-------------------------+ @@ -43020,31 +45255,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_7 - *** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_38 | - +-----------------+----------------------+----------+ - - - X_39 + X_10 **** +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_13 | + | Unnamed field 0 | Determined from data | $X_11 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_41 + X_12 **** +--------+----------+------------------------+ @@ -43058,7 +45281,7 @@ Protocol Lima +--------+----------+------------------------+ - X_42 + X_13 **** +-------+----------+------------------+ @@ -43070,7 +45293,7 @@ Protocol Lima +-------+----------+------------------+ - X_44 + X_15 **** +-----------------------+----------+------------------------+ @@ -43082,19 +45305,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_49 + X_20 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_44 | + | Unnamed field 0 | Determined from data | $X_15 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_176 + X_147 ***** +-----------------+----------------------+------------------------+ @@ -43106,7 +45329,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_175 + X_146 ***** +-----------------------+----------+-------------------------+ @@ -43114,7 +45337,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_176 | + | Unnamed field 0 | Variable | sequence of $X_147 | +-----------------------+----------+-------------------------+ @@ -43179,7 +45402,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43193,7 +45416,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43207,7 +45430,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43221,7 +45444,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43235,7 +45458,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43249,7 +45472,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43263,7 +45486,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43277,7 +45500,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43291,7 +45514,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43305,7 +45528,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43319,7 +45542,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43333,7 +45556,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43347,7 +45570,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43361,7 +45584,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43375,7 +45598,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43389,7 +45612,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43403,7 +45626,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43417,7 +45640,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43431,7 +45654,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43445,7 +45668,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43459,7 +45682,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43473,7 +45696,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43487,7 +45710,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43501,7 +45724,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43515,7 +45738,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43529,7 +45752,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43543,7 +45766,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43557,7 +45780,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43571,7 +45794,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43585,7 +45808,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43599,7 +45822,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43613,7 +45836,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43627,7 +45850,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43641,7 +45864,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43655,7 +45878,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43669,7 +45892,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -43683,7 +45906,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43697,7 +45920,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43711,7 +45934,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43725,7 +45948,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43739,7 +45962,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43753,7 +45976,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43767,7 +45990,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43781,7 +46004,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43795,7 +46018,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43809,7 +46032,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43823,7 +46046,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43837,7 +46060,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43851,7 +46074,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43865,7 +46088,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43879,7 +46102,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43893,7 +46116,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43907,7 +46130,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43921,7 +46144,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43935,7 +46158,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43949,7 +46172,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -43963,7 +46186,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -43977,7 +46200,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+-------------------------+ @@ -43991,7 +46214,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -44005,7 +46228,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -44083,7 +46306,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_20 | +-----------------+----------+-----------------------------+ @@ -44095,7 +46318,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_20 | +-----------------+----------+-----------------------------+ @@ -44107,7 +46330,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_20 | +-----------------+----------+-----------------------------+ @@ -44119,7 +46342,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_20 | +-----------------+----------+-----------------------------+ @@ -44131,7 +46354,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_20 | +-----------------+----------+-----------------------------+ @@ -44143,7 +46366,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_20 | +-----------------+----------+-----------------------------+ @@ -44155,7 +46378,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_20 | +-----------------+----------+-----------------------------+ @@ -44167,7 +46390,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_20 | +-----------------+----------+-----------------------------+ @@ -44179,7 +46402,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_20 | +-----------------+----------+-----------------------------+ @@ -44191,7 +46414,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_20 | +-----------------+----------+------------------------------+ @@ -44203,7 +46426,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_20 | +-----------------+----------+------------------------------+ @@ -44215,7 +46438,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_20 | +-----------------+----------+------------------------------+ @@ -44227,7 +46450,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_20 | +-----------------+----------+------------------------------+ @@ -44239,7 +46462,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_20 | +-----------------+----------+------------------------------+ @@ -44251,7 +46474,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_20 | +-----------------+----------+------------------------------+ @@ -44263,7 +46486,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_20 | +-----------------+----------+------------------------------+ @@ -44275,7 +46498,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_20 | +-----------------+----------+------------------------------+ @@ -44287,7 +46510,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_20 | +-----------------+----------+------------------------------+ @@ -44299,7 +46522,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_20 | +-----------------+----------+------------------------------+ @@ -44311,7 +46534,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_20 | +-----------------+----------+------------------------------+ @@ -44323,7 +46546,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_20 | +-----------------+----------+------------------------------+ @@ -44335,7 +46558,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_20 | +-----------------+----------+------------------------------+ @@ -44347,7 +46570,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_20 | +-----------------+----------+------------------------------+ @@ -44359,7 +46582,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_20 | +-----------------+----------+------------------------------+ @@ -44371,7 +46594,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_20 | +-----------------+----------+------------------------------+ @@ -44383,7 +46606,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_20 | +-----------------+----------+------------------------------+ @@ -44395,7 +46618,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_20 | +-----------------+----------+------------------------------+ @@ -44407,7 +46630,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_20 | +-----------------+----------+------------------------------+ @@ -44419,7 +46642,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_20 | +-----------------+----------+------------------------------+ @@ -44431,7 +46654,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_20 | +-----------------+----------+------------------------------+ @@ -44443,7 +46666,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_20 | +-----------------+----------+------------------------------+ @@ -44455,7 +46678,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_20 | +-----------------+----------+------------------------------+ @@ -44467,7 +46690,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_20 | +-----------------+----------+------------------------------+ @@ -44479,7 +46702,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_20 | +-----------------+----------+------------------------------+ @@ -44491,7 +46714,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_20 | +-----------------+----------+------------------------------+ @@ -44503,7 +46726,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_20 | +-----------------+----------+------------------------------+ @@ -44515,7 +46738,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_20 | +-----------------+----------+------------------------------+ @@ -44527,7 +46750,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_20 | +-----------------+----------+------------------------------+ @@ -44539,7 +46762,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_20 | +-----------------+----------+------------------------------+ @@ -44551,7 +46774,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_20 | +-----------------+----------+------------------------------+ @@ -44563,7 +46786,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_20 | +-----------------+----------+------------------------------+ @@ -44575,7 +46798,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_20 | +-----------------+----------+------------------------------+ @@ -44587,7 +46810,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_20 | +-----------------+----------+------------------------------+ @@ -44599,7 +46822,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_20 | +-----------------+----------+------------------------------+ @@ -44611,7 +46834,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_20 | +-----------------+----------+------------------------------+ @@ -44623,7 +46846,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_20 | +-----------------+----------+------------------------------+ @@ -44635,7 +46858,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_20 | +-----------------+----------+------------------------------+ @@ -44647,7 +46870,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_20 | +-----------------+----------+------------------------------+ @@ -44659,7 +46882,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_20 | +-----------------+----------+------------------------------+ @@ -44671,7 +46894,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_20 | +-----------------+----------+------------------------------+ @@ -44683,7 +46906,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_20 | +-----------------+----------+------------------------------+ @@ -44695,7 +46918,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_20 | +-----------------+----------+------------------------------+ @@ -44707,7 +46930,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_20 | +-----------------+----------+------------------------------+ @@ -44719,7 +46942,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_20 | +-----------------+----------+------------------------------+ @@ -44731,7 +46954,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_20 | +-----------------+----------+------------------------------+ @@ -44743,7 +46966,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_20 | +-----------------+----------+------------------------------+ @@ -44755,7 +46978,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_20 | +-----------------+----------+------------------------------+ @@ -44767,7 +46990,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_20 | +-----------------+----------+------------------------------+ @@ -44779,7 +47002,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_20 | +-----------------+----------+------------------------------+ @@ -44791,7 +47014,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_20 | +-----------------+----------+------------------------------+ @@ -44803,7 +47026,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_20 | +-----------------+----------+------------------------------+ @@ -44815,7 +47038,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_20 | +-----------------+----------+------------------------------+ @@ -44829,7 +47052,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_49 | + | Unnamed field 0 | Variable | sequence of $X_20 | +-----------------------+----------+-------------------------+ @@ -44855,7 +47078,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -44871,7 +47094,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -44887,7 +47110,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -44903,7 +47126,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -44980,7 +47203,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -44994,7 +47217,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45008,7 +47231,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45022,7 +47245,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45036,7 +47259,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45050,7 +47273,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45064,7 +47287,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45078,7 +47301,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45092,7 +47315,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45106,7 +47329,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45120,7 +47343,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45134,7 +47357,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45148,7 +47371,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45162,7 +47385,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45176,7 +47399,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45190,7 +47413,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45204,7 +47427,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45218,7 +47441,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45232,7 +47455,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45246,7 +47469,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45260,7 +47483,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45274,7 +47497,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45288,7 +47511,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45302,7 +47525,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45316,7 +47539,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45330,7 +47553,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45344,7 +47567,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45358,7 +47581,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45372,7 +47595,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45386,7 +47609,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45400,7 +47623,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45414,7 +47637,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45428,7 +47651,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45442,7 +47665,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45456,7 +47679,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45470,7 +47693,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -45484,7 +47707,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45498,7 +47721,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45512,7 +47735,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45526,7 +47749,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45540,7 +47763,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45554,7 +47777,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45568,7 +47791,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45582,7 +47805,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45596,7 +47819,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45610,7 +47833,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45624,7 +47847,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45638,7 +47861,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45652,7 +47875,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45666,7 +47889,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45680,7 +47903,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45694,7 +47917,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45708,7 +47931,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45722,7 +47945,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45736,7 +47959,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45750,7 +47973,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -45764,7 +47987,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -45778,7 +48001,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+-------------------------+ @@ -45792,7 +48015,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -45806,7 +48029,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -45884,7 +48107,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_20 | +-----------------+----------+-----------------------------+ @@ -45896,7 +48119,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_20 | +-----------------+----------+-----------------------------+ @@ -45908,7 +48131,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_20 | +-----------------+----------+-----------------------------+ @@ -45920,7 +48143,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_20 | +-----------------+----------+-----------------------------+ @@ -45932,7 +48155,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_20 | +-----------------+----------+-----------------------------+ @@ -45944,7 +48167,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_20 | +-----------------+----------+-----------------------------+ @@ -45956,7 +48179,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_20 | +-----------------+----------+-----------------------------+ @@ -45968,7 +48191,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_20 | +-----------------+----------+-----------------------------+ @@ -45980,7 +48203,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_20 | +-----------------+----------+-----------------------------+ @@ -45992,7 +48215,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_20 | +-----------------+----------+------------------------------+ @@ -46004,7 +48227,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_20 | +-----------------+----------+------------------------------+ @@ -46016,7 +48239,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_20 | +-----------------+----------+------------------------------+ @@ -46028,7 +48251,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_20 | +-----------------+----------+------------------------------+ @@ -46040,7 +48263,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_20 | +-----------------+----------+------------------------------+ @@ -46052,7 +48275,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_20 | +-----------------+----------+------------------------------+ @@ -46064,7 +48287,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_20 | +-----------------+----------+------------------------------+ @@ -46076,7 +48299,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_20 | +-----------------+----------+------------------------------+ @@ -46088,7 +48311,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_20 | +-----------------+----------+------------------------------+ @@ -46100,7 +48323,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_20 | +-----------------+----------+------------------------------+ @@ -46112,7 +48335,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_20 | +-----------------+----------+------------------------------+ @@ -46124,7 +48347,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_20 | +-----------------+----------+------------------------------+ @@ -46136,7 +48359,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_20 | +-----------------+----------+------------------------------+ @@ -46148,7 +48371,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_20 | +-----------------+----------+------------------------------+ @@ -46160,7 +48383,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_20 | +-----------------+----------+------------------------------+ @@ -46172,7 +48395,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_20 | +-----------------+----------+------------------------------+ @@ -46184,7 +48407,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_20 | +-----------------+----------+------------------------------+ @@ -46196,7 +48419,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_20 | +-----------------+----------+------------------------------+ @@ -46208,7 +48431,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_20 | +-----------------+----------+------------------------------+ @@ -46220,7 +48443,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_20 | +-----------------+----------+------------------------------+ @@ -46232,7 +48455,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_20 | +-----------------+----------+------------------------------+ @@ -46244,7 +48467,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_20 | +-----------------+----------+------------------------------+ @@ -46256,7 +48479,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_20 | +-----------------+----------+------------------------------+ @@ -46268,7 +48491,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_20 | +-----------------+----------+------------------------------+ @@ -46280,7 +48503,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_20 | +-----------------+----------+------------------------------+ @@ -46292,7 +48515,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_20 | +-----------------+----------+------------------------------+ @@ -46304,7 +48527,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_20 | +-----------------+----------+------------------------------+ @@ -46316,7 +48539,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_20 | +-----------------+----------+------------------------------+ @@ -46328,7 +48551,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_20 | +-----------------+----------+------------------------------+ @@ -46340,7 +48563,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_20 | +-----------------+----------+------------------------------+ @@ -46352,7 +48575,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_20 | +-----------------+----------+------------------------------+ @@ -46364,7 +48587,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_20 | +-----------------+----------+------------------------------+ @@ -46376,7 +48599,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_20 | +-----------------+----------+------------------------------+ @@ -46388,7 +48611,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_20 | +-----------------+----------+------------------------------+ @@ -46400,7 +48623,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_20 | +-----------------+----------+------------------------------+ @@ -46412,7 +48635,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_20 | +-----------------+----------+------------------------------+ @@ -46424,7 +48647,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_20 | +-----------------+----------+------------------------------+ @@ -46436,7 +48659,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_20 | +-----------------+----------+------------------------------+ @@ -46448,7 +48671,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_20 | +-----------------+----------+------------------------------+ @@ -46460,7 +48683,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_20 | +-----------------+----------+------------------------------+ @@ -46472,7 +48695,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_20 | +-----------------+----------+------------------------------+ @@ -46484,7 +48707,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_20 | +-----------------+----------+------------------------------+ @@ -46496,7 +48719,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_20 | +-----------------+----------+------------------------------+ @@ -46508,7 +48731,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_20 | +-----------------+----------+------------------------------+ @@ -46520,7 +48743,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_20 | +-----------------+----------+------------------------------+ @@ -46532,7 +48755,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_20 | +-----------------+----------+------------------------------+ @@ -46544,7 +48767,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_20 | +-----------------+----------+------------------------------+ @@ -46556,7 +48779,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_20 | +-----------------+----------+------------------------------+ @@ -46568,7 +48791,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_20 | +-----------------+----------+------------------------------+ @@ -46580,7 +48803,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_20 | +-----------------+----------+------------------------------+ @@ -46592,7 +48815,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_20 | +-----------------+----------+------------------------------+ @@ -46604,7 +48827,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_20 | +-----------------+----------+------------------------------+ @@ -46616,7 +48839,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_20 | +-----------------+----------+------------------------------+ @@ -46630,7 +48853,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_49 | + | Unnamed field 0 | Variable | sequence of $X_20 | +-----------------------+----------+-------------------------+ @@ -46710,7 +48933,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -46726,7 +48949,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -46742,7 +48965,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -46758,7 +48981,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -46774,7 +48997,7 @@ Protocol Lima +------+--------+------------------------+ - X_53864 (Determined from data, 8-bit tag) + X_53835 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -46849,7 +49072,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107686 (Determined from data, 8-bit tag) + X_107657 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -46860,7 +49083,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53864 | + | proof | Determined from data | $X_53835 | +-------+----------------------+------------------------+ @@ -46872,7 +49095,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53864 | + | proof | Determined from data | $X_53835 | +-------+----------------------+------------------------+ @@ -46886,7 +49109,7 @@ Protocol Lima +------+--------+------------------------+ - X_107688 (Determined from data, 8-bit tag) + X_107659 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -46897,11 +49120,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_38 | + | raw_data | Determined from data | $X_8 | +----------+----------------------+------------------------+ - X_107689 (Determined from data, 8-bit tag) + X_107660 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -46930,11 +49153,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107688 | + | reveal_proof | Determined from data | $X_107659 | +--------------+----------------------+------------------------+ - X_107690 + X_107661 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -46948,7 +49171,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107691 (Determined from data, 8-bit tag) + X_107662 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -46961,7 +49184,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107690 | + | Unnamed field 0 | Variable | sequence of $X_107661 | +-----------------------+----------+-------------------------+ @@ -46973,15 +49196,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107686 | + | pvm_step | Determined from data | $X_107657 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107689 | + | input_proof | Determined from data | $X_107660 | +-----------------------------------+----------------------+-------------------------------------+ - X_43 + X_14 **** +--------+----------------------+-----------+ @@ -46989,11 +49212,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107691 | + | step | Determined from data | $X_107662 | +--------+----------------------+-----------+ - X_107692 + X_107663 ******** +------------------+----------+-----------------------+ @@ -47009,7 +49232,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107694 (Enumeration: unsigned 8-bit integer): + X_107665 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -47021,7 +49244,7 @@ Protocol Lima +-------------+---------------------+ - X_107696 (Determined from data, 8-bit tag) + X_107667 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -47072,7 +49295,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107695 + X_107666 ******** +-----------------------+----------------------+---------------------------+ @@ -47088,13 +49311,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107696 | + | amount | Determined from data | $X_107667 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107697 + X_107668 ******** +-------------+----------------------+------------------+ @@ -47106,11 +49329,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107696 | + | amount | Determined from data | $X_107667 | +-------------+----------------------+------------------+ - X_107699 (Determined from data, 8-bit tag) + X_107670 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -47135,11 +49358,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107697 | + | deposit | Determined from data | $X_107668 | +---------+----------------------+------------------------+ - X_107700 + X_107671 ******** +--------------------+----------+----------+ @@ -47151,7 +49374,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107702 (Determined from data, 8-bit tag) + X_107673 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -47176,7 +49399,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107701 + X_107672 ******** +-----------------------+----------------------+-------------------------+ @@ -47188,7 +49411,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107702 | + | predecessor | Determined from data | $X_107673 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -47343,7 +49566,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107703 + X_107674 ******** +-----------------------+----------------------+--------------------------+ @@ -47357,7 +49580,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107704 + X_107675 ******** +-----------------+-----------+----------+ @@ -47424,7 +49647,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_38 | + | fitness | Variable | sequence of $X_8 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -47608,7 +49831,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107704 | + | solution | 200 bytes | $X_107675 | +----------+-----------+------------------------+ @@ -47738,7 +49961,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+-------------------------------------+ @@ -47958,7 +50181,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107701 | + | commitment | Determined from data | $X_107672 | +---------------+----------------------+------------------------+ @@ -48050,7 +50273,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107699 | + | message | Determined from data | $X_107670 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -48064,7 +50287,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107700 | + | previous_message_result | 64 bytes | $X_107671 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -48108,7 +50331,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107695 | + | tickets_info | Variable | sequence of $X_107666 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -48168,7 +50391,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107694) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107665) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -48208,7 +50431,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_13 | + | message | Variable | sequence of $X_11 | +------------------------------------------------+----------------------+-------------------------+ @@ -48260,7 +50483,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107692 | + | commitment | 76 bytes | $X_107663 | +------------------------------------------------+----------------------+-------------------------+ @@ -48290,7 +50513,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_43 | + | refutation | Determined from data | $X_14 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -48316,7 +50539,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_42 | + | stakers | 42 bytes | $X_13 | +------------------------------------------------+----------------------+-------------------------+ @@ -48416,7 +50639,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_41 | + | slot | 53 bytes | $X_12 | +---------------+----------------------+------------------------+ @@ -48442,7 +50665,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_39 | + | circuits_info | Variable | sequence of $X_10 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -48507,7 +50730,7 @@ Protocol Lima +------------------------------------------------+----------+-------------------------+ - X_107713 (Determined from data, 8-bit tag) + X_107684 (Determined from data, 8-bit tag) ****************************************** Contract (tag 0) @@ -48756,7 +50979,7 @@ Protocol Lima +------+--------+------------------------+ - X_107714 (1 byte, 8-bit tag) + X_107685 (1 byte, 8-bit tag) **************************** Block_application (tag 0) @@ -48799,21 +51022,21 @@ Protocol Lima +------+--------+------------------------+ - X_107712 + X_107683 ******** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_107713 | + | Unnamed field 0 | Determined from data | $X_107684 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_107714 | + | origin | 1 byte | $X_107685 | +-----------------+----------------------+-----------------------+ - X_107715 + X_107686 ******** +-----------------------+----------+-------------------------+ @@ -48821,7 +51044,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_13 | + | Unnamed field 0 | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -48838,7 +51061,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -48856,7 +51079,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -48880,11 +51103,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -48917,7 +51140,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -48941,7 +51164,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -48969,7 +51192,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_107731 + X_107702 ******** +-----------------+----------------------+---------------------------------+ @@ -48981,7 +51204,7 @@ Protocol Lima +-----------------+----------------------+---------------------------------+ - X_107730 + X_107701 ******** +-----------------------------+----------+-------------------------+ @@ -48989,7 +51212,7 @@ Protocol Lima +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_107731 | + | commitments_and_ciphertexts | Variable | sequence of $X_107702 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -48997,7 +51220,7 @@ Protocol Lima +-----------------------------+----------+-------------------------+ - X_107736 (Determined from data, 8-bit tag) + X_107707 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -49008,7 +51231,7 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +---------+----------------------+------------------------+ @@ -49032,7 +51255,7 @@ Protocol Lima +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +---------+----------------------+------------------------+ @@ -49044,13 +51267,13 @@ Protocol Lima +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_107737 + X_107708 ******** +-----------------------------+----------------------+-------------------------------------------------+ @@ -49066,7 +51289,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------------------+ - X_107748 (Determined from data, 8-bit tag) + X_107719 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -49079,7 +51302,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------+-------------------------+ @@ -49105,7 +51328,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------------------+-------------------------+ @@ -49119,7 +51342,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.015-PtLimaPt.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -49127,7 +51350,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ - X_107749 (Determined from data, 8-bit tag) + X_107720 (Determined from data, 8-bit tag) ****************************************** big_map (tag 0) @@ -49140,7 +51363,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107748 | + | diff | Determined from data | $X_107719 | +------+----------------------+------------------------+ @@ -49154,7 +51377,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107736 | + | diff | Determined from data | $X_107707 | +------+----------------------+------------------------+ @@ -49166,7 +51389,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107749 | + | Unnamed field 0 | Variable | sequence of $X_107720 | +-----------------------+----------+-------------------------+ @@ -49183,7 +51406,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -49211,7 +51434,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49235,11 +51458,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -49263,13 +51486,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -49328,7 +51551,7 @@ Protocol Lima +----------------+----------+------------------------+ - X_107776 + X_107747 ******** +-----------------------+----------+--------------------------------------------------------------+ @@ -49344,7 +51567,7 @@ Protocol Lima +-----------------------+----------+--------------------------------------------------------------+ - X_107775 + X_107746 ******** +------------------------------------------------+----------------------+-------------------------+ @@ -49364,11 +51587,11 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | current_level_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_107776 | + | old_levels_messages | Determined from data | $X_107747 | +------------------------------------------------+----------------------+-------------------------+ - X_107785 + X_107756 ******** +--------------+----------------------+-------------------------------------------------+ @@ -49382,7 +51605,7 @@ Protocol Lima +--------------+----------------------+-------------------------------------------------+ - X_107788 + X_107759 ******** +---------+----------------------+---------------------------------------+ @@ -49394,21 +51617,21 @@ Protocol Lima +---------+----------------------+---------------------------------------+ - X_107784 + X_107755 ******** +-----------------------+----------------------+-------------------------+ | Name | Size | Contents | +=======================+======================+=========================+ - | ticket_token | Determined from data | $X_107785 | + | ticket_token | Determined from data | $X_107756 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107788 | + | updates | Variable | sequence of $X_107759 | +-----------------------+----------------------+-------------------------+ - X_107809 (Determined from data, 8-bit tag) + X_107780 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -49425,11 +51648,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_receipt | Variable | sequence of $X_107784 | + | ticket_receipt | Variable | sequence of $X_107755 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -49459,7 +51682,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -49479,7 +51702,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -49494,7 +51717,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_107809 | + | Unnamed field 0 | Determined from data | $X_107780 | +-----------------+----------------------+------------------------+ @@ -49508,7 +51731,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49532,9 +51755,9 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_107809 | + | Unnamed field 0 | Determined from data | $X_107780 | +------------------------------+----------------------+-------------------------------------+ @@ -49559,7 +51782,7 @@ Protocol Lima +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -49635,7 +51858,7 @@ Protocol Lima +-------------------------------+----------------------+---------------------------------------------------------------+ - X_107711 + X_107682 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49643,7 +51866,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49666,7 +51889,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -49686,7 +51909,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49710,11 +51933,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -49724,7 +51947,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_107879 + X_107821 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49732,7 +51955,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49742,7 +51965,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_108014 + X_107956 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49750,7 +51973,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.event | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49789,7 +52012,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49813,7 +52036,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -49823,7 +52046,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_108142 + X_108084 ******** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -49831,7 +52054,7 @@ Protocol Lima +==========================================================================+======================+=============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -49854,7 +52077,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -49870,7 +52093,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49894,17 +52117,17 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108270 + X_108212 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49912,7 +52135,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -49935,7 +52158,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -49953,7 +52176,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -49977,11 +52200,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -49989,7 +52212,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108404 + X_108346 ******** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -49997,7 +52220,7 @@ Protocol Lima +==========================================================================+======================+=================================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -50007,7 +52230,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_108544 (Determined from data, 8-bit tag) + X_108486 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -50032,7 +52255,7 @@ Protocol Lima +------------+----------+------------------------+ - X_108552 (Determined from data, 8-bit tag) + X_108494 (Determined from data, 8-bit tag) ****************************************** sc_rollup_dissection_choice_not_found (tag 0) @@ -50081,9 +52304,9 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | expected | Determined from data | $X_108544 | + | expected | Determined from data | $X_108486 | +----------+----------------------+------------------------+ - | given | Determined from data | $X_108544 | + | given | Determined from data | $X_108486 | +----------+----------------------+------------------------+ @@ -50095,7 +52318,7 @@ Protocol Lima +======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------+----------------------+------------------------+ - | hash | Determined from data | $X_108544 | + | hash | Determined from data | $X_108486 | +------+----------------------+------------------------+ @@ -50167,7 +52390,7 @@ Protocol Lima +==================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------------+----------------------+------------------------+ - | start_state_hash | Determined from data | $X_108544 | + | start_state_hash | Determined from data | $X_108486 | +------------------+----------------------+------------------------+ | start_proof | 32 bytes | bytes | +------------------+----------------------+------------------------+ @@ -50181,9 +52404,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108544 | + | stop_state_hash | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108544 | + | stop_proof | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ @@ -50195,9 +52418,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108544 | + | stop_state_hash | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108544 | + | stop_proof | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ @@ -50215,7 +52438,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_108553 (Determined from data, 8-bit tag) + X_108495 (Determined from data, 8-bit tag) ****************************************** Conflict_resolved (tag 0) @@ -50236,7 +52459,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_108552 | + | Unnamed field 0 | Determined from data | $X_108494 | +-----------------+----------------------+------------------------+ @@ -50250,7 +52473,7 @@ Protocol Lima +------+--------+------------------------+ - X_108554 (Determined from data, 8-bit tag) + X_108496 (Determined from data, 8-bit tag) ****************************************** Loser (tag 0) @@ -50261,7 +52484,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | reason | Determined from data | $X_108553 | + | reason | Determined from data | $X_108495 | +--------+----------------------+------------------------+ | player | 21 bytes | $public_key_hash | +--------+----------------------+------------------------+ @@ -50277,7 +52500,7 @@ Protocol Lima +------+--------+------------------------+ - X_108555 (Determined from data, 8-bit tag) + X_108497 (Determined from data, 8-bit tag) ****************************************** Ongoing (tag 0) @@ -50298,7 +52521,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | result | Determined from data | $X_108554 | + | result | Determined from data | $X_108496 | +--------+----------------------+------------------------+ @@ -50315,11 +52538,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | game_status | Determined from data | $X_108555 | + | game_status | Determined from data | $X_108497 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50333,7 +52556,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50357,19 +52580,19 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | game_status | Determined from data | $X_108555 | + | game_status | Determined from data | $X_108497 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108539 + X_108481 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50377,7 +52600,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50406,7 +52629,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50420,7 +52643,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50444,7 +52667,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -50454,11 +52677,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216505 + X_216447 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50466,7 +52689,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50503,7 +52726,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50527,7 +52750,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -50535,7 +52758,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216639 + X_216581 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50543,7 +52766,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_cement | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50566,7 +52789,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -50580,7 +52803,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50604,15 +52827,15 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +------------------------------+----------------------+-------------------------------------+ - X_216768 + X_216710 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50620,7 +52843,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50643,7 +52866,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50665,7 +52888,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50689,11 +52912,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -50705,7 +52928,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216901 + X_216843 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50713,7 +52936,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50736,7 +52959,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50754,7 +52977,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50778,11 +53001,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -50790,7 +53013,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217443 + X_217385 ******** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -50798,7 +53021,7 @@ Protocol Lima +==========================================================================+======================+============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -50821,7 +53044,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50839,7 +53062,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50863,11 +53086,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -50875,7 +53098,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217981 + X_217923 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50883,7 +53106,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50906,7 +53129,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -50924,7 +53147,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -50948,11 +53171,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -50960,7 +53183,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218115 + X_218057 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -50968,7 +53191,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51005,7 +53228,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -51029,7 +53252,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_gas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -51037,7 +53260,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_218249 + X_218191 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51045,7 +53268,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.update_consensus_key | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51068,7 +53291,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -51088,7 +53311,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -51112,11 +53335,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -51126,7 +53349,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218639 + X_218581 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51134,7 +53357,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51144,7 +53367,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_218901 + X_218843 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51152,7 +53375,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51162,7 +53385,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219115 (Determined from data, 8-bit tag) + X_219057 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -51179,11 +53402,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_updates | Variable | sequence of $X_107784 | + | ticket_updates | Variable | sequence of $X_107755 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -51213,7 +53436,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -51233,7 +53456,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -51248,7 +53471,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219115 | + | Unnamed field 0 | Determined from data | $X_219057 | +-----------------+----------------------+------------------------+ @@ -51262,7 +53485,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -51286,13 +53509,13 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_219115 | + | Unnamed field 0 | Determined from data | $X_219057 | +------------------------------+----------------------+-------------------------------------+ - X_219076 + X_219018 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51300,7 +53523,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -51310,7 +53533,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219402 + X_219344 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -51318,7 +53541,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -51328,7 +53551,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219406 + X_219348 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -51336,7 +53559,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -51346,7 +53569,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219410 + X_219352 ******** +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -51354,7 +53577,7 @@ Protocol Lima +==========================================================================+==========+=====================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+-------------------------------------+ | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -51368,7 +53591,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107712 | + | Unnamed field 0 | Variable | sequence of $X_107683 | +-----------------------+----------+-------------------------+ @@ -51511,7 +53734,7 @@ Protocol Lima +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_107704 | + | solution | 200 bytes | $X_107675 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $015-PtLimaPt.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -51531,7 +53754,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | destination | 21 bytes | $public_key_hash | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_219410 | + | metadata | Determined from data | $X_219352 | +---------------+----------------------+------------------------+ @@ -51551,7 +53774,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219406 | + | metadata | Determined from data | $X_219348 | +--------------------+----------------------+-------------------------+ @@ -51571,7 +53794,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219402 | + | metadata | Determined from data | $X_219344 | +--------------------+----------------------+-------------------------+ @@ -51611,7 +53834,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +---------------+----------------------+------------------------+ @@ -51639,9 +53862,9 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_219076 | + | metadata | Determined from data | $X_219018 | +----------------------------------+----------------------+-------------------------------------+ @@ -51671,7 +53894,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $015-PtLimaPt.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218901 | + | metadata | Determined from data | $X_218843 | +--------------------------------+----------------------+-------------------------------------+ @@ -51697,7 +53920,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +--------------------------------+----------------------+-------------------------------------+ @@ -51723,7 +53946,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_218639 | + | metadata | Determined from data | $X_218581 | +-----------------------+----------------------+-------------------------+ @@ -51749,7 +53972,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +-----------------------------+----------------------+-------------------------------------+ @@ -51775,7 +53998,7 @@ Protocol Lima +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $015-PtLimaPt.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+--------------------------------------+ @@ -51799,7 +54022,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | pk | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218249 | + | metadata | Determined from data | $X_218191 | +---------------+----------------------+------------------------+ @@ -51821,7 +54044,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218115 | + | metadata | Determined from data | $X_218057 | +---------------+----------------------+------------------------+ @@ -51853,7 +54076,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_217981 | + | metadata | Determined from data | $X_217923 | +----------------------------------+----------------------+-------------------------------------+ @@ -51877,9 +54100,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107701 | + | commitment | Determined from data | $X_107672 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -51903,7 +54126,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -51927,7 +54150,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217443 | + | metadata | Determined from data | $X_217385 | +---------------+----------------------+------------------------+ @@ -51951,7 +54174,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217443 | + | metadata | Determined from data | $X_217385 | +---------------+----------------------+------------------------+ @@ -51977,7 +54200,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107699 | + | message | Determined from data | $X_107670 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -51991,7 +54214,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107700 | + | previous_message_result | 64 bytes | $X_107671 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -52001,7 +54224,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | proof | Variable | bytes | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +------------------------------+----------------------+-------------------------+ @@ -52037,9 +54260,9 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107695 | + | tickets_info | Variable | sequence of $X_107666 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -52079,7 +54302,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +-----------------------+----------------------+---------------------------+ @@ -52101,7 +54324,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107694) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107665) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -52115,7 +54338,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+---------------------------------------------------------------+ - | metadata | Determined from data | $X_216901 | + | metadata | Determined from data | $X_216843 | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -52143,9 +54366,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_13 | + | message | Variable | sequence of $X_11 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216768 | + | metadata | Determined from data | $X_216710 | +------------------------------------------------+----------------------+-------------------------+ @@ -52173,7 +54396,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216639 | + | metadata | Determined from data | $X_216581 | +------------------------------------------------+----------------------+-------------------------+ @@ -52199,9 +54422,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107692 | + | commitment | 76 bytes | $X_107663 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216505 | + | metadata | Determined from data | $X_216447 | +------------------------------------------------+----------------------+-------------------------+ @@ -52231,9 +54454,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_43 | + | refutation | Determined from data | $X_14 | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108539 | + | metadata | Determined from data | $X_108481 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -52259,9 +54482,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_42 | + | stakers | 42 bytes | $X_13 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108539 | + | metadata | Determined from data | $X_108481 | +------------------------------------------------+----------------------+-------------------------+ @@ -52293,7 +54516,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | output_proof | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +------------------------------------------------+----------------------+-------------------------+ @@ -52317,7 +54540,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -52345,7 +54568,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108142 | + | metadata | Determined from data | $X_108084 | +------------------------------------------------+----------------------+-------------------------+ @@ -52367,9 +54590,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_41 | + | slot | 53 bytes | $X_12 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +---------------+----------------------+------------------------+ @@ -52395,7 +54618,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_39 | + | circuits_info | Variable | sequence of $X_10 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -52403,7 +54626,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_107879 | + | metadata | Determined from data | $X_107821 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -52431,11 +54654,11 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | op | Variable | sequence of $X_1 | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_107711 | + | metadata | Determined from data | $X_107682 | +-----------------------+----------------------+-------------------------+ - X_219433 (Determined from data, 8-bit tag) + X_219375 (Determined from data, 8-bit tag) ****************************************** Operation_with_metadata (tag 0) @@ -52482,7 +54705,7 @@ Protocol Lima +=======================+======================+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | Unnamed field 0 | Determined from data | $X_219433 | + | Unnamed field 0 | Determined from data | $X_219375 | +-----------------------+----------------------+-------------------------+ </pre> @@ -52555,8 +54778,8 @@ Protocol Lima "max_operation_list_length": [ { "max_size": integer ∈ [-2^30, 2^30], "max_op"?: integer ∈ [-2^30, 2^30] } ... ], - "proposer": $Signature.Public_key_hash, - "baker": $Signature.Public_key_hash, + "proposer": $Signature.V0.Public_key_hash, + "baker": $Signature.V0.Public_key_hash, "level_info": { "level": integer ∈ [-2^31-1, 2^31] @@ -52608,14 +54831,14 @@ Protocol Lima /* The number of blocks remaining till the end of the voting period. */ }, "nonce_hash": $cycle_nonce /* Some */ || null /* None */, - "deactivated": [ $Signature.Public_key_hash ... ], + "deactivated": [ $Signature.V0.Public_key_hash ... ], "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], "implicit_operations_results": [ $015-PtLimaPt.operation.alpha.successful_manager_operation_result ... ], - "proposer_consensus_key": $Signature.Public_key_hash, - "baker_consensus_key": $Signature.Public_key_hash, + "proposer_consensus_key": $Signature.V0.Public_key_hash, + "baker_consensus_key": $Signature.V0.Public_key_hash, "consumed_milligas": $positive_bignum, "dal_slot_availability"?: $bignum } $015-PtLimaPt.big_map_id: @@ -52946,7 +55169,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -52987,7 +55210,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -53088,7 +55311,7 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $bignum: @@ -53126,7 +55349,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -53462,13 +55685,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -54635,13 +56858,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -55252,9 +57475,8 @@ Protocol Lima "nonce": integer ∈ [0, 2^16-1], "amount": $015-PtLimaPt.mutez, "destination": $015-PtLimaPt.transaction_destination, - "parameters"?: - { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, + "value": any }, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -55262,7 +57484,7 @@ Protocol Lima "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.origination } @@ -55270,7 +57492,7 @@ Protocol Lima "kind": "delegation", "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -55304,7 +57526,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $015-PtLimaPt.tx_rollup_id } @@ -55329,7 +57551,7 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.error: /* The full list of RPC errors would be too long to include. @@ -55341,7 +57563,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -55353,7 +57575,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -55593,7 +57815,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -55621,26 +57843,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55649,28 +57871,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55678,7 +57900,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55687,31 +57909,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55719,7 +57941,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55729,7 +57951,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55742,7 +57964,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55750,7 +57972,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55758,7 +57980,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55766,7 +57988,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55778,7 +58000,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -55793,7 +58015,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55804,27 +58026,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55835,7 +58057,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55843,10 +58065,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55855,7 +58077,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55864,7 +58086,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55877,13 +58099,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -55938,18 +58160,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55959,7 +58181,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55967,7 +58189,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -55976,54 +58198,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56033,7 +58220,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -56044,7 +58231,7 @@ Protocol Lima /* None */ ] ... ] } $015-PtLimaPt.operation.alpha.contents_and_signature: { "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -56216,9 +58403,9 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Preendorsement */ "kind": "preendorsement", "slot": integer ∈ [0, 2^16-1], @@ -56228,14 +58415,14 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $015-PtLimaPt.inlined.preendorsement, @@ -56266,25 +58453,25 @@ Protocol Lima $015-PtLimaPt.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56294,7 +58481,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56303,7 +58490,7 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56313,13 +58500,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "metadata": { "balance_updates"?: @@ -56330,12 +58517,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56345,12 +58532,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56360,7 +58547,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56375,7 +58562,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56391,12 +58578,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key, + "pk": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56406,16 +58593,16 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash, + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "allocated_destination_contract"?: boolean } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56430,7 +58617,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56447,7 +58634,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56467,7 +58654,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56482,7 +58669,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56497,7 +58684,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56512,7 +58699,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56524,7 +58711,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -56546,13 +58733,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, @@ -56566,7 +58753,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56584,7 +58771,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56595,11 +58782,11 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56609,7 +58796,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56617,7 +58804,7 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56627,7 +58814,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56643,7 +58830,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56659,7 +58846,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56679,13 +58866,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -56747,15 +58934,15 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -56765,7 +58952,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56782,7 +58969,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56797,7 +58984,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56813,48 +59000,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30], @@ -56867,7 +59019,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -56877,7 +59029,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -57211,7 +59363,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -57289,7 +59441,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -57360,7 +59512,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -57438,7 +59590,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -57775,10 +59927,10 @@ Protocol Lima { /* Operation_with_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -57793,7 +59945,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -57834,7 +59986,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -57911,9 +60063,8 @@ Protocol Lima /* Sapling state identifier A sapling state identifier */ $bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -57968,13 +60119,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -58050,7 +60201,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -58058,7 +60209,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -58066,7 +60217,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, @@ -58074,14 +60225,14 @@ Protocol Lima "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -58758,13 +60909,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -58822,20 +60973,8 @@ Protocol Lima +-----------------+----------------------+----------+ - X_11 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_13 - **** + X_8 + *** +-----------------------+----------+-------------------------+ | Name | Size | Contents | @@ -58846,278 +60985,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_12 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_10 - **** - - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_11 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_12 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_17 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - - - X_15 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_17 | - +-----------------+----------------------+----------+ - - - X_25 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_24 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_25 | - +-----------------------+----------+-------------------------+ - - - X_23 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_24 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_22 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_23 | - +-----------------------+----------+-------------------------+ - - - X_20 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_22 | - +-----------------+----------------------+----------+ - - - X_30 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_29 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_30 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_31 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_29 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_27 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_31 | - +-----------------+----------------------+----------+ - - - X_14 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_15 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_20 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_27 | - +-----------------------+----------+-------------------------+ - - - X_9 + X_7 *** - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_10 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_14 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_13 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_35 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_13 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_33 - **** - +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_13 | + | Unnamed field 0 | Determined from data | $X_8 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_35 | + | Unnamed field 1 | Determined from data | $X_8 | +-----------------+----------------------+----------+ - X_8 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_9 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_33 | - +-----------------------+----------------------+-------------------------+ - - - X_38 + X_11 **** +-----------------------+----------+-------------------------+ @@ -59129,31 +61009,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_7 - *** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_8 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_38 | - +-----------------+----------------------+----------+ - - - X_39 + X_10 **** +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_13 | + | Unnamed field 0 | Determined from data | $X_11 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_41 + X_12 **** +--------+----------+------------------------+ @@ -59167,7 +61035,7 @@ Protocol Lima +--------+----------+------------------------+ - X_42 + X_13 **** +-------+----------+------------------+ @@ -59179,7 +61047,7 @@ Protocol Lima +-------+----------+------------------+ - X_44 + X_15 **** +-----------------------+----------+------------------------+ @@ -59191,19 +61059,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_49 + X_20 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_44 | + | Unnamed field 0 | Determined from data | $X_15 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_176 + X_147 ***** +-----------------+----------------------+------------------------+ @@ -59215,7 +61083,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_175 + X_146 ***** +-----------------------+----------+-------------------------+ @@ -59223,7 +61091,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_176 | + | Unnamed field 0 | Variable | sequence of $X_147 | +-----------------------+----------+-------------------------+ @@ -59288,7 +61156,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59302,7 +61170,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59316,7 +61184,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59330,7 +61198,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59344,7 +61212,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59358,7 +61226,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59372,7 +61240,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59386,7 +61254,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59400,7 +61268,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59414,7 +61282,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59428,7 +61296,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59442,7 +61310,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59456,7 +61324,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59470,7 +61338,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59484,7 +61352,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59498,7 +61366,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59512,7 +61380,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59526,7 +61394,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59540,7 +61408,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59554,7 +61422,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59568,7 +61436,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59582,7 +61450,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59596,7 +61464,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59610,7 +61478,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59624,7 +61492,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59638,7 +61506,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59652,7 +61520,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59666,7 +61534,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59680,7 +61548,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59694,7 +61562,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59708,7 +61576,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59722,7 +61590,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59736,7 +61604,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59750,7 +61618,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59764,7 +61632,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59778,7 +61646,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -59792,7 +61660,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59806,7 +61674,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59820,7 +61688,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59834,7 +61702,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59848,7 +61716,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59862,7 +61730,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59876,7 +61744,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59890,7 +61758,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59904,7 +61772,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59918,7 +61786,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59932,7 +61800,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59946,7 +61814,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59960,7 +61828,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59974,7 +61842,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -59988,7 +61856,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60002,7 +61870,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60016,7 +61884,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60030,7 +61898,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60044,7 +61912,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60058,7 +61926,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -60072,7 +61940,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -60086,7 +61954,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+-------------------------+ @@ -60100,7 +61968,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -60114,7 +61982,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -60192,7 +62060,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_20 | +-----------------+----------+-----------------------------+ @@ -60204,7 +62072,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_20 | +-----------------+----------+-----------------------------+ @@ -60216,7 +62084,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_20 | +-----------------+----------+-----------------------------+ @@ -60228,7 +62096,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_20 | +-----------------+----------+-----------------------------+ @@ -60240,7 +62108,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_20 | +-----------------+----------+-----------------------------+ @@ -60252,7 +62120,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_20 | +-----------------+----------+-----------------------------+ @@ -60264,7 +62132,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_20 | +-----------------+----------+-----------------------------+ @@ -60276,7 +62144,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_20 | +-----------------+----------+-----------------------------+ @@ -60288,7 +62156,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_20 | +-----------------+----------+-----------------------------+ @@ -60300,7 +62168,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_20 | +-----------------+----------+------------------------------+ @@ -60312,7 +62180,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_20 | +-----------------+----------+------------------------------+ @@ -60324,7 +62192,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_20 | +-----------------+----------+------------------------------+ @@ -60336,7 +62204,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_20 | +-----------------+----------+------------------------------+ @@ -60348,7 +62216,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_20 | +-----------------+----------+------------------------------+ @@ -60360,7 +62228,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_20 | +-----------------+----------+------------------------------+ @@ -60372,7 +62240,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_20 | +-----------------+----------+------------------------------+ @@ -60384,7 +62252,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_20 | +-----------------+----------+------------------------------+ @@ -60396,7 +62264,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_20 | +-----------------+----------+------------------------------+ @@ -60408,7 +62276,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_20 | +-----------------+----------+------------------------------+ @@ -60420,7 +62288,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_20 | +-----------------+----------+------------------------------+ @@ -60432,7 +62300,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_20 | +-----------------+----------+------------------------------+ @@ -60444,7 +62312,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_20 | +-----------------+----------+------------------------------+ @@ -60456,7 +62324,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_20 | +-----------------+----------+------------------------------+ @@ -60468,7 +62336,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_20 | +-----------------+----------+------------------------------+ @@ -60480,7 +62348,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_20 | +-----------------+----------+------------------------------+ @@ -60492,7 +62360,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_20 | +-----------------+----------+------------------------------+ @@ -60504,7 +62372,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_20 | +-----------------+----------+------------------------------+ @@ -60516,7 +62384,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_20 | +-----------------+----------+------------------------------+ @@ -60528,7 +62396,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_20 | +-----------------+----------+------------------------------+ @@ -60540,7 +62408,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_20 | +-----------------+----------+------------------------------+ @@ -60552,7 +62420,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_20 | +-----------------+----------+------------------------------+ @@ -60564,7 +62432,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_20 | +-----------------+----------+------------------------------+ @@ -60576,7 +62444,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_20 | +-----------------+----------+------------------------------+ @@ -60588,7 +62456,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_20 | +-----------------+----------+------------------------------+ @@ -60600,7 +62468,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_20 | +-----------------+----------+------------------------------+ @@ -60612,7 +62480,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_20 | +-----------------+----------+------------------------------+ @@ -60624,7 +62492,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_20 | +-----------------+----------+------------------------------+ @@ -60636,7 +62504,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_20 | +-----------------+----------+------------------------------+ @@ -60648,7 +62516,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_20 | +-----------------+----------+------------------------------+ @@ -60660,7 +62528,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_20 | +-----------------+----------+------------------------------+ @@ -60672,7 +62540,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_20 | +-----------------+----------+------------------------------+ @@ -60684,7 +62552,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_20 | +-----------------+----------+------------------------------+ @@ -60696,7 +62564,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_20 | +-----------------+----------+------------------------------+ @@ -60708,7 +62576,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_20 | +-----------------+----------+------------------------------+ @@ -60720,7 +62588,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_20 | +-----------------+----------+------------------------------+ @@ -60732,7 +62600,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_20 | +-----------------+----------+------------------------------+ @@ -60744,7 +62612,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_20 | +-----------------+----------+------------------------------+ @@ -60756,7 +62624,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_20 | +-----------------+----------+------------------------------+ @@ -60768,7 +62636,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_20 | +-----------------+----------+------------------------------+ @@ -60780,7 +62648,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_20 | +-----------------+----------+------------------------------+ @@ -60792,7 +62660,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_20 | +-----------------+----------+------------------------------+ @@ -60804,7 +62672,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_20 | +-----------------+----------+------------------------------+ @@ -60816,7 +62684,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_20 | +-----------------+----------+------------------------------+ @@ -60828,7 +62696,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_20 | +-----------------+----------+------------------------------+ @@ -60840,7 +62708,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_20 | +-----------------+----------+------------------------------+ @@ -60852,7 +62720,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_20 | +-----------------+----------+------------------------------+ @@ -60864,7 +62732,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_20 | +-----------------+----------+------------------------------+ @@ -60876,7 +62744,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_20 | +-----------------+----------+------------------------------+ @@ -60888,7 +62756,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_20 | +-----------------+----------+------------------------------+ @@ -60900,7 +62768,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_20 | +-----------------+----------+------------------------------+ @@ -60912,7 +62780,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_20 | +-----------------+----------+------------------------------+ @@ -60924,7 +62792,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_20 | +-----------------+----------+------------------------------+ @@ -60938,7 +62806,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_49 | + | Unnamed field 0 | Variable | sequence of $X_20 | +-----------------------+----------+-------------------------+ @@ -60964,7 +62832,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -60980,7 +62848,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -60996,7 +62864,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -61012,7 +62880,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -61089,7 +62957,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61103,7 +62971,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61117,7 +62985,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61131,7 +62999,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61145,7 +63013,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61159,7 +63027,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61173,7 +63041,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61187,7 +63055,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61201,7 +63069,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61215,7 +63083,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61229,7 +63097,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61243,7 +63111,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61257,7 +63125,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61271,7 +63139,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61285,7 +63153,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61299,7 +63167,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61313,7 +63181,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61327,7 +63195,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61341,7 +63209,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61355,7 +63223,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61369,7 +63237,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61383,7 +63251,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61397,7 +63265,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61411,7 +63279,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61425,7 +63293,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61439,7 +63307,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61453,7 +63321,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61467,7 +63335,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61481,7 +63349,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61495,7 +63363,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61509,7 +63377,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61523,7 +63391,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61537,7 +63405,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61551,7 +63419,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61565,7 +63433,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61579,7 +63447,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_147 | +-----------------+----------------------+------------------------------+ @@ -61593,7 +63461,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61607,7 +63475,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61621,7 +63489,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61635,7 +63503,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61649,7 +63517,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61663,7 +63531,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61677,7 +63545,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61691,7 +63559,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61705,7 +63573,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61719,7 +63587,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61733,7 +63601,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61747,7 +63615,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61761,7 +63629,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61775,7 +63643,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61789,7 +63657,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61803,7 +63671,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61817,7 +63685,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61831,7 +63699,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61845,7 +63713,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61859,7 +63727,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_176 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_147 | +-----------------+----------------------+-------------------------------+ @@ -61873,7 +63741,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -61887,7 +63755,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+-------------------------+ @@ -61901,7 +63769,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -61915,7 +63783,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_175 | + | Unnamed field 1 | Determined from data | $X_146 | +-----------------+----------------------+------------------------+ @@ -61993,7 +63861,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_20 | +-----------------+----------+-----------------------------+ @@ -62005,7 +63873,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_20 | +-----------------+----------+-----------------------------+ @@ -62017,7 +63885,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_20 | +-----------------+----------+-----------------------------+ @@ -62029,7 +63897,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_20 | +-----------------+----------+-----------------------------+ @@ -62041,7 +63909,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_20 | +-----------------+----------+-----------------------------+ @@ -62053,7 +63921,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_20 | +-----------------+----------+-----------------------------+ @@ -62065,7 +63933,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_20 | +-----------------+----------+-----------------------------+ @@ -62077,7 +63945,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_20 | +-----------------+----------+-----------------------------+ @@ -62089,7 +63957,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_20 | +-----------------+----------+-----------------------------+ @@ -62101,7 +63969,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_20 | +-----------------+----------+------------------------------+ @@ -62113,7 +63981,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_20 | +-----------------+----------+------------------------------+ @@ -62125,7 +63993,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_20 | +-----------------+----------+------------------------------+ @@ -62137,7 +64005,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_20 | +-----------------+----------+------------------------------+ @@ -62149,7 +64017,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_20 | +-----------------+----------+------------------------------+ @@ -62161,7 +64029,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_20 | +-----------------+----------+------------------------------+ @@ -62173,7 +64041,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_20 | +-----------------+----------+------------------------------+ @@ -62185,7 +64053,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_20 | +-----------------+----------+------------------------------+ @@ -62197,7 +64065,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_20 | +-----------------+----------+------------------------------+ @@ -62209,7 +64077,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_20 | +-----------------+----------+------------------------------+ @@ -62221,7 +64089,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_20 | +-----------------+----------+------------------------------+ @@ -62233,7 +64101,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_20 | +-----------------+----------+------------------------------+ @@ -62245,7 +64113,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_20 | +-----------------+----------+------------------------------+ @@ -62257,7 +64125,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_20 | +-----------------+----------+------------------------------+ @@ -62269,7 +64137,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_20 | +-----------------+----------+------------------------------+ @@ -62281,7 +64149,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_20 | +-----------------+----------+------------------------------+ @@ -62293,7 +64161,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_20 | +-----------------+----------+------------------------------+ @@ -62305,7 +64173,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_20 | +-----------------+----------+------------------------------+ @@ -62317,7 +64185,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_20 | +-----------------+----------+------------------------------+ @@ -62329,7 +64197,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_20 | +-----------------+----------+------------------------------+ @@ -62341,7 +64209,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_20 | +-----------------+----------+------------------------------+ @@ -62353,7 +64221,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_20 | +-----------------+----------+------------------------------+ @@ -62365,7 +64233,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_20 | +-----------------+----------+------------------------------+ @@ -62377,7 +64245,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_20 | +-----------------+----------+------------------------------+ @@ -62389,7 +64257,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_20 | +-----------------+----------+------------------------------+ @@ -62401,7 +64269,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_20 | +-----------------+----------+------------------------------+ @@ -62413,7 +64281,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_20 | +-----------------+----------+------------------------------+ @@ -62425,7 +64293,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_20 | +-----------------+----------+------------------------------+ @@ -62437,7 +64305,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_20 | +-----------------+----------+------------------------------+ @@ -62449,7 +64317,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_20 | +-----------------+----------+------------------------------+ @@ -62461,7 +64329,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_20 | +-----------------+----------+------------------------------+ @@ -62473,7 +64341,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_20 | +-----------------+----------+------------------------------+ @@ -62485,7 +64353,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_20 | +-----------------+----------+------------------------------+ @@ -62497,7 +64365,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_20 | +-----------------+----------+------------------------------+ @@ -62509,7 +64377,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_20 | +-----------------+----------+------------------------------+ @@ -62521,7 +64389,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_20 | +-----------------+----------+------------------------------+ @@ -62533,7 +64401,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_20 | +-----------------+----------+------------------------------+ @@ -62545,7 +64413,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_20 | +-----------------+----------+------------------------------+ @@ -62557,7 +64425,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_20 | +-----------------+----------+------------------------------+ @@ -62569,7 +64437,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_20 | +-----------------+----------+------------------------------+ @@ -62581,7 +64449,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_20 | +-----------------+----------+------------------------------+ @@ -62593,7 +64461,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_20 | +-----------------+----------+------------------------------+ @@ -62605,7 +64473,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_20 | +-----------------+----------+------------------------------+ @@ -62617,7 +64485,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_20 | +-----------------+----------+------------------------------+ @@ -62629,7 +64497,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_20 | +-----------------+----------+------------------------------+ @@ -62641,7 +64509,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_20 | +-----------------+----------+------------------------------+ @@ -62653,7 +64521,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_20 | +-----------------+----------+------------------------------+ @@ -62665,7 +64533,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_20 | +-----------------+----------+------------------------------+ @@ -62677,7 +64545,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_20 | +-----------------+----------+------------------------------+ @@ -62689,7 +64557,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_20 | +-----------------+----------+------------------------------+ @@ -62701,7 +64569,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_20 | +-----------------+----------+------------------------------+ @@ -62713,7 +64581,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_20 | +-----------------+----------+------------------------------+ @@ -62725,7 +64593,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_49 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_20 | +-----------------+----------+------------------------------+ @@ -62739,7 +64607,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_49 | + | Unnamed field 0 | Variable | sequence of $X_20 | +-----------------------+----------+-------------------------+ @@ -62819,7 +64687,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -62835,7 +64703,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -62851,7 +64719,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -62867,7 +64735,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_44 | + | Unnamed field 1 | Determined from data | $X_15 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -62883,7 +64751,7 @@ Protocol Lima +------+--------+------------------------+ - X_53864 (Determined from data, 8-bit tag) + X_53835 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -62958,7 +64826,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107686 (Determined from data, 8-bit tag) + X_107657 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -62969,7 +64837,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53864 | + | proof | Determined from data | $X_53835 | +-------+----------------------+------------------------+ @@ -62981,7 +64849,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53864 | + | proof | Determined from data | $X_53835 | +-------+----------------------+------------------------+ @@ -62995,7 +64863,7 @@ Protocol Lima +------+--------+------------------------+ - X_107688 (Determined from data, 8-bit tag) + X_107659 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -63006,11 +64874,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_38 | + | raw_data | Determined from data | $X_8 | +----------+----------------------+------------------------+ - X_107689 (Determined from data, 8-bit tag) + X_107660 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -63039,11 +64907,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107688 | + | reveal_proof | Determined from data | $X_107659 | +--------------+----------------------+------------------------+ - X_107690 + X_107661 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -63057,7 +64925,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107691 (Determined from data, 8-bit tag) + X_107662 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -63070,7 +64938,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107690 | + | Unnamed field 0 | Variable | sequence of $X_107661 | +-----------------------+----------+-------------------------+ @@ -63082,15 +64950,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107686 | + | pvm_step | Determined from data | $X_107657 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107689 | + | input_proof | Determined from data | $X_107660 | +-----------------------------------+----------------------+-------------------------------------+ - X_43 + X_14 **** +--------+----------------------+-----------+ @@ -63098,11 +64966,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107691 | + | step | Determined from data | $X_107662 | +--------+----------------------+-----------+ - X_107692 + X_107663 ******** +------------------+----------+-----------------------+ @@ -63118,7 +64986,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107694 (Enumeration: unsigned 8-bit integer): + X_107665 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -63130,7 +64998,7 @@ Protocol Lima +-------------+---------------------+ - X_107696 (Determined from data, 8-bit tag) + X_107667 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -63181,7 +65049,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107695 + X_107666 ******** +-----------------------+----------------------+---------------------------+ @@ -63197,13 +65065,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107696 | + | amount | Determined from data | $X_107667 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107697 + X_107668 ******** +-------------+----------------------+------------------+ @@ -63215,11 +65083,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107696 | + | amount | Determined from data | $X_107667 | +-------------+----------------------+------------------+ - X_107699 (Determined from data, 8-bit tag) + X_107670 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -63244,11 +65112,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107697 | + | deposit | Determined from data | $X_107668 | +---------+----------------------+------------------------+ - X_107700 + X_107671 ******** +--------------------+----------+----------+ @@ -63260,7 +65128,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107702 (Determined from data, 8-bit tag) + X_107673 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -63285,7 +65153,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107701 + X_107672 ******** +-----------------------+----------------------+-------------------------+ @@ -63297,7 +65165,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107702 | + | predecessor | Determined from data | $X_107673 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -63452,7 +65320,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107703 + X_107674 ******** +-----------------------+----------------------+--------------------------+ @@ -63466,7 +65334,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107704 + X_107675 ******** +-----------------+-----------+----------+ @@ -63533,7 +65401,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_38 | + | fitness | Variable | sequence of $X_8 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -63717,7 +65585,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107704 | + | solution | 200 bytes | $X_107675 | +----------+-----------+------------------------+ @@ -63847,7 +65715,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+-------------------------------------+ @@ -64067,7 +65935,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107701 | + | commitment | Determined from data | $X_107672 | +---------------+----------------------+------------------------+ @@ -64159,7 +66027,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107699 | + | message | Determined from data | $X_107670 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -64173,7 +66041,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107700 | + | previous_message_result | 64 bytes | $X_107671 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -64217,7 +66085,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107695 | + | tickets_info | Variable | sequence of $X_107666 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -64277,7 +66145,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107694) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107665) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -64317,7 +66185,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_13 | + | message | Variable | sequence of $X_11 | +------------------------------------------------+----------------------+-------------------------+ @@ -64369,7 +66237,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107692 | + | commitment | 76 bytes | $X_107663 | +------------------------------------------------+----------------------+-------------------------+ @@ -64399,7 +66267,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_43 | + | refutation | Determined from data | $X_14 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -64425,7 +66293,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_42 | + | stakers | 42 bytes | $X_13 | +------------------------------------------------+----------------------+-------------------------+ @@ -64525,7 +66393,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_41 | + | slot | 53 bytes | $X_12 | +---------------+----------------------+------------------------+ @@ -64551,7 +66419,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_39 | + | circuits_info | Variable | sequence of $X_10 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -64616,7 +66484,7 @@ Protocol Lima +------------------------------------------------+----------+-------------------------+ - X_107713 (Determined from data, 8-bit tag) + X_107684 (Determined from data, 8-bit tag) ****************************************** Contract (tag 0) @@ -64865,7 +66733,7 @@ Protocol Lima +------+--------+------------------------+ - X_107714 (1 byte, 8-bit tag) + X_107685 (1 byte, 8-bit tag) **************************** Block_application (tag 0) @@ -64908,21 +66776,21 @@ Protocol Lima +------+--------+------------------------+ - X_107712 + X_107683 ******** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_107713 | + | Unnamed field 0 | Determined from data | $X_107684 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_107714 | + | origin | 1 byte | $X_107685 | +-----------------+----------------------+-----------------------+ - X_107715 + X_107686 ******** +-----------------------+----------+-------------------------+ @@ -64930,7 +66798,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_13 | + | Unnamed field 0 | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -64947,7 +66815,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -64965,7 +66833,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -64989,11 +66857,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -65026,7 +66894,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -65050,7 +66918,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -65078,7 +66946,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_107731 + X_107702 ******** +-----------------+----------------------+---------------------------------+ @@ -65090,7 +66958,7 @@ Protocol Lima +-----------------+----------------------+---------------------------------+ - X_107730 + X_107701 ******** +-----------------------------+----------+-------------------------+ @@ -65098,7 +66966,7 @@ Protocol Lima +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_107731 | + | commitments_and_ciphertexts | Variable | sequence of $X_107702 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -65106,7 +66974,7 @@ Protocol Lima +-----------------------------+----------+-------------------------+ - X_107736 (Determined from data, 8-bit tag) + X_107707 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -65117,7 +66985,7 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +---------+----------------------+------------------------+ @@ -65141,7 +67009,7 @@ Protocol Lima +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +---------+----------------------+------------------------+ @@ -65153,13 +67021,13 @@ Protocol Lima +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_107730 | + | updates | Determined from data | $X_107701 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_107737 + X_107708 ******** +-----------------------------+----------------------+-------------------------------------------------+ @@ -65175,7 +67043,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------------------+ - X_107748 (Determined from data, 8-bit tag) + X_107719 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -65188,7 +67056,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------+-------------------------+ @@ -65214,7 +67082,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------------------+-------------------------+ @@ -65228,7 +67096,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_107737 | + | updates | Variable | sequence of $X_107708 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.015-PtLimaPt.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -65236,7 +67104,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ - X_107749 (Determined from data, 8-bit tag) + X_107720 (Determined from data, 8-bit tag) ****************************************** big_map (tag 0) @@ -65249,7 +67117,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107748 | + | diff | Determined from data | $X_107719 | +------+----------------------+------------------------+ @@ -65263,7 +67131,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107736 | + | diff | Determined from data | $X_107707 | +------+----------------------+------------------------+ @@ -65275,7 +67143,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107749 | + | Unnamed field 0 | Variable | sequence of $X_107720 | +-----------------------+----------+-------------------------+ @@ -65292,7 +67160,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -65320,7 +67188,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -65344,11 +67212,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -65372,13 +67240,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -65437,7 +67305,7 @@ Protocol Lima +----------------+----------+------------------------+ - X_107776 + X_107747 ******** +-----------------------+----------+--------------------------------------------------------------+ @@ -65453,7 +67321,7 @@ Protocol Lima +-----------------------+----------+--------------------------------------------------------------+ - X_107775 + X_107746 ******** +------------------------------------------------+----------------------+-------------------------+ @@ -65473,11 +67341,11 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | current_level_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_107776 | + | old_levels_messages | Determined from data | $X_107747 | +------------------------------------------------+----------------------+-------------------------+ - X_107785 + X_107756 ******** +--------------+----------------------+-------------------------------------------------+ @@ -65491,7 +67359,7 @@ Protocol Lima +--------------+----------------------+-------------------------------------------------+ - X_107788 + X_107759 ******** +---------+----------------------+---------------------------------------+ @@ -65503,21 +67371,21 @@ Protocol Lima +---------+----------------------+---------------------------------------+ - X_107784 + X_107755 ******** +-----------------------+----------------------+-------------------------+ | Name | Size | Contents | +=======================+======================+=========================+ - | ticket_token | Determined from data | $X_107785 | + | ticket_token | Determined from data | $X_107756 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107788 | + | updates | Variable | sequence of $X_107759 | +-----------------------+----------------------+-------------------------+ - X_107809 (Determined from data, 8-bit tag) + X_107780 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -65534,11 +67402,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_receipt | Variable | sequence of $X_107784 | + | ticket_receipt | Variable | sequence of $X_107755 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -65568,7 +67436,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -65588,7 +67456,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -65603,7 +67471,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_107809 | + | Unnamed field 0 | Determined from data | $X_107780 | +-----------------+----------------------+------------------------+ @@ -65617,7 +67485,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -65641,9 +67509,9 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_107809 | + | Unnamed field 0 | Determined from data | $X_107780 | +------------------------------+----------------------+-------------------------------------+ @@ -65668,7 +67536,7 @@ Protocol Lima +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -65744,7 +67612,7 @@ Protocol Lima +-------------------------------+----------------------+---------------------------------------------------------------+ - X_107711 + X_107682 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65752,7 +67620,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65775,7 +67643,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -65795,7 +67663,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -65819,11 +67687,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -65833,7 +67701,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_107879 + X_107821 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65841,7 +67709,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65851,7 +67719,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_108014 + X_107956 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65859,7 +67727,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.event | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -65898,7 +67766,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -65922,7 +67790,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -65932,7 +67800,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_108142 + X_108084 ******** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -65940,7 +67808,7 @@ Protocol Lima +==========================================================================+======================+=============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -65963,7 +67831,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -65979,7 +67847,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66003,17 +67871,17 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108270 + X_108212 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66021,7 +67889,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66044,7 +67912,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66062,7 +67930,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66086,11 +67954,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -66098,7 +67966,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108404 + X_108346 ******** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -66106,7 +67974,7 @@ Protocol Lima +==========================================================================+======================+=================================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -66116,7 +67984,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_108544 (Determined from data, 8-bit tag) + X_108486 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -66141,7 +68009,7 @@ Protocol Lima +------------+----------+------------------------+ - X_108552 (Determined from data, 8-bit tag) + X_108494 (Determined from data, 8-bit tag) ****************************************** sc_rollup_dissection_choice_not_found (tag 0) @@ -66190,9 +68058,9 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | expected | Determined from data | $X_108544 | + | expected | Determined from data | $X_108486 | +----------+----------------------+------------------------+ - | given | Determined from data | $X_108544 | + | given | Determined from data | $X_108486 | +----------+----------------------+------------------------+ @@ -66204,7 +68072,7 @@ Protocol Lima +======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------+----------------------+------------------------+ - | hash | Determined from data | $X_108544 | + | hash | Determined from data | $X_108486 | +------+----------------------+------------------------+ @@ -66276,7 +68144,7 @@ Protocol Lima +==================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------------+----------------------+------------------------+ - | start_state_hash | Determined from data | $X_108544 | + | start_state_hash | Determined from data | $X_108486 | +------------------+----------------------+------------------------+ | start_proof | 32 bytes | bytes | +------------------+----------------------+------------------------+ @@ -66290,9 +68158,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108544 | + | stop_state_hash | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108544 | + | stop_proof | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ @@ -66304,9 +68172,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108544 | + | stop_state_hash | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108544 | + | stop_proof | Determined from data | $X_108486 | +-----------------+----------------------+------------------------+ @@ -66324,7 +68192,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_108553 (Determined from data, 8-bit tag) + X_108495 (Determined from data, 8-bit tag) ****************************************** Conflict_resolved (tag 0) @@ -66345,7 +68213,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_108552 | + | Unnamed field 0 | Determined from data | $X_108494 | +-----------------+----------------------+------------------------+ @@ -66359,7 +68227,7 @@ Protocol Lima +------+--------+------------------------+ - X_108554 (Determined from data, 8-bit tag) + X_108496 (Determined from data, 8-bit tag) ****************************************** Loser (tag 0) @@ -66370,7 +68238,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | reason | Determined from data | $X_108553 | + | reason | Determined from data | $X_108495 | +--------+----------------------+------------------------+ | player | 21 bytes | $public_key_hash | +--------+----------------------+------------------------+ @@ -66386,7 +68254,7 @@ Protocol Lima +------+--------+------------------------+ - X_108555 (Determined from data, 8-bit tag) + X_108497 (Determined from data, 8-bit tag) ****************************************** Ongoing (tag 0) @@ -66407,7 +68275,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | result | Determined from data | $X_108554 | + | result | Determined from data | $X_108496 | +--------+----------------------+------------------------+ @@ -66424,11 +68292,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | game_status | Determined from data | $X_108555 | + | game_status | Determined from data | $X_108497 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66442,7 +68310,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66466,19 +68334,19 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | game_status | Determined from data | $X_108555 | + | game_status | Determined from data | $X_108497 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108539 + X_108481 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66486,7 +68354,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66515,7 +68383,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66529,7 +68397,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66553,7 +68421,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -66563,11 +68431,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216505 + X_216447 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66575,7 +68443,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66612,7 +68480,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66636,7 +68504,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -66644,7 +68512,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216639 + X_216581 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66652,7 +68520,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_cement | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66675,7 +68543,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -66689,7 +68557,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66713,15 +68581,15 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +------------------------------+----------------------+-------------------------------------+ - X_216768 + X_216710 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66729,7 +68597,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66752,7 +68620,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66774,7 +68642,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66798,11 +68666,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -66814,7 +68682,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216901 + X_216843 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66822,7 +68690,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66845,7 +68713,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66863,7 +68731,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66887,11 +68755,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -66899,7 +68767,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217443 + X_217385 ******** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -66907,7 +68775,7 @@ Protocol Lima +==========================================================================+======================+============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -66930,7 +68798,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -66948,7 +68816,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -66972,11 +68840,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -66984,7 +68852,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217981 + X_217923 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -66992,7 +68860,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67015,7 +68883,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -67033,7 +68901,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -67057,11 +68925,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -67069,7 +68937,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218115 + X_218057 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67077,7 +68945,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67114,7 +68982,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -67138,7 +69006,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ | consumed_gas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -67146,7 +69014,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_218249 + X_218191 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67154,7 +69022,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.update_consensus_key | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67177,7 +69045,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -67197,7 +69065,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -67221,11 +69089,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -67235,7 +69103,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218639 + X_218581 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67243,7 +69111,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67253,7 +69121,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_218901 + X_218843 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67261,7 +69129,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67271,7 +69139,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219115 (Determined from data, 8-bit tag) + X_219057 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -67288,11 +69156,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_updates | Variable | sequence of $X_107784 | + | ticket_updates | Variable | sequence of $X_107755 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -67322,7 +69190,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -67342,7 +69210,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107775 | + | inbox_after | Determined from data | $X_107746 | +-------------------+----------------------+------------------------+ @@ -67357,7 +69225,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219115 | + | Unnamed field 0 | Determined from data | $X_219057 | +-----------------+----------------------+------------------------+ @@ -67371,7 +69239,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_13 | + | errors | Variable | sequence of $X_11 | +-----------------------+----------+-------------------------+ @@ -67395,13 +69263,13 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107715 | + | errors | Determined from data | $X_107686 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_219115 | + | Unnamed field 0 | Determined from data | $X_219057 | +------------------------------+----------------------+-------------------------------------+ - X_219076 + X_219018 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67409,7 +69277,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -67419,7 +69287,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219402 + X_219344 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -67427,7 +69295,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -67437,7 +69305,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219406 + X_219348 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -67445,7 +69313,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -67455,7 +69323,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219410 + X_219352 ******** +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -67463,7 +69331,7 @@ Protocol Lima +==========================================================================+==========+=====================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107712 | + | balance_updates | Variable | sequence of $X_107683 | +--------------------------------------------------------------------------+----------+-------------------------------------+ | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -67477,7 +69345,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107712 | + | Unnamed field 0 | Variable | sequence of $X_107683 | +-----------------------+----------+-------------------------+ @@ -67620,7 +69488,7 @@ Protocol Lima +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_107704 | + | solution | 200 bytes | $X_107675 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $015-PtLimaPt.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -67640,7 +69508,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | destination | 21 bytes | $public_key_hash | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_219410 | + | metadata | Determined from data | $X_219352 | +---------------+----------------------+------------------------+ @@ -67660,7 +69528,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219406 | + | metadata | Determined from data | $X_219348 | +--------------------+----------------------+-------------------------+ @@ -67680,7 +69548,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219402 | + | metadata | Determined from data | $X_219344 | +--------------------+----------------------+-------------------------+ @@ -67720,7 +69588,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +---------------+----------------------+------------------------+ @@ -67748,9 +69616,9 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107703 | + | parameters | Determined from data | $X_107674 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_219076 | + | metadata | Determined from data | $X_219018 | +----------------------------------+----------------------+-------------------------------------+ @@ -67780,7 +69648,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $015-PtLimaPt.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218901 | + | metadata | Determined from data | $X_218843 | +--------------------------------+----------------------+-------------------------------------+ @@ -67806,7 +69674,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +--------------------------------+----------------------+-------------------------------------+ @@ -67832,7 +69700,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_218639 | + | metadata | Determined from data | $X_218581 | +-----------------------+----------------------+-------------------------+ @@ -67858,7 +69726,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +-----------------------------+----------------------+-------------------------------------+ @@ -67884,7 +69752,7 @@ Protocol Lima +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $015-PtLimaPt.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+--------------------------------------+ @@ -67908,7 +69776,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | pk | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218249 | + | metadata | Determined from data | $X_218191 | +---------------+----------------------+------------------------+ @@ -67930,7 +69798,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218115 | + | metadata | Determined from data | $X_218057 | +---------------+----------------------+------------------------+ @@ -67962,7 +69830,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_217981 | + | metadata | Determined from data | $X_217923 | +----------------------------------+----------------------+-------------------------------------+ @@ -67986,9 +69854,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107701 | + | commitment | Determined from data | $X_107672 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -68012,7 +69880,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -68036,7 +69904,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217443 | + | metadata | Determined from data | $X_217385 | +---------------+----------------------+------------------------+ @@ -68060,7 +69928,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217443 | + | metadata | Determined from data | $X_217385 | +---------------+----------------------+------------------------+ @@ -68086,7 +69954,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107699 | + | message | Determined from data | $X_107670 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -68100,7 +69968,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107700 | + | previous_message_result | 64 bytes | $X_107671 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -68110,7 +69978,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | proof | Variable | bytes | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +------------------------------+----------------------+-------------------------+ @@ -68146,9 +70014,9 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107695 | + | tickets_info | Variable | sequence of $X_107666 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -68188,7 +70056,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +-----------------------+----------------------+---------------------------+ @@ -68210,7 +70078,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107694) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107665) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -68224,7 +70092,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+---------------------------------------------------------------+ - | metadata | Determined from data | $X_216901 | + | metadata | Determined from data | $X_216843 | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -68252,9 +70120,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_13 | + | message | Variable | sequence of $X_11 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216768 | + | metadata | Determined from data | $X_216710 | +------------------------------------------------+----------------------+-------------------------+ @@ -68282,7 +70150,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216639 | + | metadata | Determined from data | $X_216581 | +------------------------------------------------+----------------------+-------------------------+ @@ -68308,9 +70176,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107692 | + | commitment | 76 bytes | $X_107663 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216505 | + | metadata | Determined from data | $X_216447 | +------------------------------------------------+----------------------+-------------------------+ @@ -68340,9 +70208,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_43 | + | refutation | Determined from data | $X_14 | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108539 | + | metadata | Determined from data | $X_108481 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -68368,9 +70236,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_42 | + | stakers | 42 bytes | $X_13 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108539 | + | metadata | Determined from data | $X_108481 | +------------------------------------------------+----------------------+-------------------------+ @@ -68402,7 +70270,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | output_proof | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108404 | + | metadata | Determined from data | $X_108346 | +------------------------------------------------+----------------------+-------------------------+ @@ -68426,7 +70294,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108270 | + | metadata | Determined from data | $X_108212 | +---------------+----------------------+------------------------+ @@ -68454,7 +70322,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108142 | + | metadata | Determined from data | $X_108084 | +------------------------------------------------+----------------------+-------------------------+ @@ -68476,9 +70344,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_41 | + | slot | 53 bytes | $X_12 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108014 | + | metadata | Determined from data | $X_107956 | +---------------+----------------------+------------------------+ @@ -68504,7 +70372,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_39 | + | circuits_info | Variable | sequence of $X_10 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -68512,7 +70380,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_107879 | + | metadata | Determined from data | $X_107821 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -68540,11 +70408,11 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | op | Variable | sequence of $X_1 | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_107711 | + | metadata | Determined from data | $X_107682 | +-----------------------+----------------------+-------------------------+ - X_219433 (Determined from data, 8-bit tag) + X_219375 (Determined from data, 8-bit tag) ****************************************** Operation_with_metadata (tag 0) @@ -68583,7 +70451,7 @@ Protocol Lima +---------------------------------+----------+----------------------------------------------------+ - X_434842 (Variable, 8-bit tag) + X_434726 (Variable, 8-bit tag) ****************************** Operation with too large metadata (tag 0) @@ -68622,7 +70490,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219433 | + | Unnamed field 0 | Determined from data | $X_219375 | +-----------------+----------------------+------------------------+ @@ -68642,7 +70510,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_434842 | + | Unnamed field 0 | Variable | $X_434726 | +-----------------------+----------+-------------------------+ @@ -68686,9 +70554,8 @@ Protocol Lima "nonce": integer ∈ [0, 2^16-1], "amount": $015-PtLimaPt.mutez, "destination": $015-PtLimaPt.transaction_destination, - "parameters"?: - { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, + "value": any }, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -68696,7 +70563,7 @@ Protocol Lima "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.origination } @@ -68704,7 +70571,7 @@ Protocol Lima "kind": "delegation", "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -68738,7 +70605,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $015-PtLimaPt.tx_rollup_id } @@ -68763,7 +70630,7 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.error: /* The full list of RPC errors would be too long to include. @@ -68775,7 +70642,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -68787,7 +70654,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -69027,7 +70894,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -69055,26 +70922,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69083,28 +70950,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69112,7 +70979,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69121,31 +70988,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69153,7 +71020,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69163,7 +71030,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69176,7 +71043,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69184,7 +71051,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69192,7 +71059,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69200,7 +71067,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69212,7 +71079,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -69227,7 +71094,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69238,27 +71105,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69269,7 +71136,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69277,10 +71144,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69289,7 +71156,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69298,7 +71165,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69311,13 +71178,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -69372,18 +71239,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69393,7 +71260,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69401,7 +71268,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69410,54 +71277,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69467,7 +71299,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -69478,7 +71310,7 @@ Protocol Lima /* None */ ] ... ] } $015-PtLimaPt.operation.alpha.contents_and_signature: { "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -69650,9 +71482,9 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Preendorsement */ "kind": "preendorsement", "slot": integer ∈ [0, 2^16-1], @@ -69662,14 +71494,14 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $015-PtLimaPt.inlined.preendorsement, @@ -69700,25 +71532,25 @@ Protocol Lima $015-PtLimaPt.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -69728,7 +71560,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69737,7 +71569,7 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -69747,13 +71579,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "metadata": { "balance_updates"?: @@ -69764,12 +71596,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -69779,12 +71611,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -69794,7 +71626,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69809,7 +71641,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69825,12 +71657,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key, + "pk": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -69840,16 +71672,16 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash, + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "allocated_destination_contract"?: boolean } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69864,7 +71696,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69881,7 +71713,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69901,7 +71733,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69916,7 +71748,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69931,7 +71763,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69946,7 +71778,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -69958,7 +71790,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -69980,13 +71812,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, @@ -70000,7 +71832,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70018,7 +71850,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70029,11 +71861,11 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -70043,7 +71875,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70051,7 +71883,7 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -70061,7 +71893,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70077,7 +71909,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70093,7 +71925,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70113,13 +71945,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -70181,15 +72013,15 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -70199,7 +72031,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70216,7 +72048,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70231,7 +72063,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70247,48 +72079,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30], @@ -70301,7 +72098,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -70311,7 +72108,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -70645,7 +72442,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -70723,7 +72520,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -70794,7 +72591,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -70872,7 +72669,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -71209,10 +73006,10 @@ Protocol Lima { /* Operation_with_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -71227,7 +73024,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -71268,7 +73065,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -71345,9 +73142,8 @@ Protocol Lima /* Sapling state identifier A sapling state identifier */ $bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -71402,13 +73198,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -71484,7 +73280,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $operation: { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -71492,7 +73288,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -71500,7 +73296,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, @@ -71508,14 +73304,14 @@ Protocol Lima "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -72192,13 +73988,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -72256,302 +74052,31 @@ Protocol Lima +-----------------+----------------------+----------+ - X_10 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_12 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+-------------------------+ - - - X_11 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_9 + X_7 *** - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_10 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_11 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_16 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - - - X_14 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_16 | - +-----------------+----------------------+----------+ - - - X_24 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_23 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_24 | - +-----------------------+----------+-------------------------+ - - - X_22 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_23 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_21 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_22 | - +-----------------------+----------+-------------------------+ - - - X_19 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_21 | - +-----------------+----------------------+----------+ - - - X_29 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_28 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_29 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_30 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_28 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_26 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_30 | - +-----------------+----------------------+----------+ - - - X_13 - **** - +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_14 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_19 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_26 | + | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - X_8 + X_6 *** - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_9 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_13 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_12 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_34 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_12 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_32 - **** - +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_34 | + | Unnamed field 1 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - X_7 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_8 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_32 | - +-----------------------+----------------------+-------------------------+ - - - X_37 + X_10 **** +-----------------------+----------+-------------------------+ @@ -72563,31 +74088,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_6 + X_9 *** - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_37 | - +-----------------+----------------------+----------+ - - - X_38 - **** - +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_10 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_40 + X_11 **** +--------+----------+------------------------+ @@ -72601,7 +74114,7 @@ Protocol Lima +--------+----------+------------------------+ - X_41 + X_12 **** +-------+----------+------------------+ @@ -72613,7 +74126,7 @@ Protocol Lima +-------+----------+------------------+ - X_43 + X_14 **** +-----------------------+----------+------------------------+ @@ -72625,19 +74138,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_48 + X_19 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_43 | + | Unnamed field 0 | Determined from data | $X_14 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_175 + X_146 ***** +-----------------+----------------------+------------------------+ @@ -72649,7 +74162,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_174 + X_145 ***** +-----------------------+----------+-------------------------+ @@ -72657,7 +74170,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_175 | + | Unnamed field 0 | Variable | sequence of $X_146 | +-----------------------+----------+-------------------------+ @@ -72722,7 +74235,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72736,7 +74249,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72750,7 +74263,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72764,7 +74277,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72778,7 +74291,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72792,7 +74305,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72806,7 +74319,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72820,7 +74333,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72834,7 +74347,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72848,7 +74361,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72862,7 +74375,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72876,7 +74389,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72890,7 +74403,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72904,7 +74417,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72918,7 +74431,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72932,7 +74445,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72946,7 +74459,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72960,7 +74473,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72974,7 +74487,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -72988,7 +74501,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73002,7 +74515,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73016,7 +74529,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73030,7 +74543,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73044,7 +74557,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73058,7 +74571,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73072,7 +74585,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73086,7 +74599,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73100,7 +74613,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73114,7 +74627,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73128,7 +74641,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73142,7 +74655,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73156,7 +74669,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73170,7 +74683,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73184,7 +74697,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73198,7 +74711,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73212,7 +74725,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -73226,7 +74739,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73240,7 +74753,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73254,7 +74767,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73268,7 +74781,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73282,7 +74795,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73296,7 +74809,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73310,7 +74823,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73324,7 +74837,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73338,7 +74851,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73352,7 +74865,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73366,7 +74879,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73380,7 +74893,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73394,7 +74907,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73408,7 +74921,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73422,7 +74935,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73436,7 +74949,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73450,7 +74963,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73464,7 +74977,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73478,7 +74991,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73492,7 +75005,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -73506,7 +75019,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -73520,7 +75033,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -73534,7 +75047,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -73548,7 +75061,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -73626,7 +75139,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -73638,7 +75151,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -73650,7 +75163,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -73662,7 +75175,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -73674,7 +75187,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -73686,7 +75199,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -73698,7 +75211,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -73710,7 +75223,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -73722,7 +75235,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -73734,7 +75247,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -73746,7 +75259,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -73758,7 +75271,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -73770,7 +75283,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -73782,7 +75295,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -73794,7 +75307,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -73806,7 +75319,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -73818,7 +75331,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -73830,7 +75343,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -73842,7 +75355,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -73854,7 +75367,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -73866,7 +75379,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -73878,7 +75391,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -73890,7 +75403,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -73902,7 +75415,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -73914,7 +75427,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -73926,7 +75439,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -73938,7 +75451,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -73950,7 +75463,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -73962,7 +75475,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -73974,7 +75487,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -73986,7 +75499,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -73998,7 +75511,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -74010,7 +75523,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -74022,7 +75535,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -74034,7 +75547,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -74046,7 +75559,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -74058,7 +75571,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -74070,7 +75583,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -74082,7 +75595,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -74094,7 +75607,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -74106,7 +75619,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -74118,7 +75631,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -74130,7 +75643,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -74142,7 +75655,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -74154,7 +75667,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -74166,7 +75679,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -74178,7 +75691,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -74190,7 +75703,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -74202,7 +75715,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -74214,7 +75727,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -74226,7 +75739,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -74238,7 +75751,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -74250,7 +75763,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -74262,7 +75775,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -74274,7 +75787,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -74286,7 +75799,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -74298,7 +75811,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -74310,7 +75823,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -74322,7 +75835,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -74334,7 +75847,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -74346,7 +75859,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -74358,7 +75871,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -74372,7 +75885,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -74398,7 +75911,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -74414,7 +75927,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -74430,7 +75943,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -74446,7 +75959,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -74523,7 +76036,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74537,7 +76050,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74551,7 +76064,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74565,7 +76078,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74579,7 +76092,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74593,7 +76106,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74607,7 +76120,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74621,7 +76134,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74635,7 +76148,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74649,7 +76162,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74663,7 +76176,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74677,7 +76190,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74691,7 +76204,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74705,7 +76218,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74719,7 +76232,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74733,7 +76246,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74747,7 +76260,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74761,7 +76274,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74775,7 +76288,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74789,7 +76302,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74803,7 +76316,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74817,7 +76330,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74831,7 +76344,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74845,7 +76358,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74859,7 +76372,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74873,7 +76386,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74887,7 +76400,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74901,7 +76414,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74915,7 +76428,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74929,7 +76442,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74943,7 +76456,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74957,7 +76470,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74971,7 +76484,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74985,7 +76498,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -74999,7 +76512,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -75013,7 +76526,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -75027,7 +76540,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75041,7 +76554,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75055,7 +76568,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75069,7 +76582,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75083,7 +76596,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75097,7 +76610,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75111,7 +76624,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75125,7 +76638,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75139,7 +76652,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75153,7 +76666,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75167,7 +76680,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75181,7 +76694,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75195,7 +76708,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75209,7 +76722,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75223,7 +76736,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75237,7 +76750,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75251,7 +76764,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75265,7 +76778,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75279,7 +76792,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75293,7 +76806,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -75307,7 +76820,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -75321,7 +76834,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -75335,7 +76848,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -75349,7 +76862,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -75427,7 +76940,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -75439,7 +76952,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -75451,7 +76964,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -75463,7 +76976,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -75475,7 +76988,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -75487,7 +77000,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -75499,7 +77012,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -75511,7 +77024,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -75523,7 +77036,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -75535,7 +77048,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -75547,7 +77060,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -75559,7 +77072,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -75571,7 +77084,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -75583,7 +77096,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -75595,7 +77108,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -75607,7 +77120,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -75619,7 +77132,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -75631,7 +77144,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -75643,7 +77156,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -75655,7 +77168,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -75667,7 +77180,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -75679,7 +77192,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -75691,7 +77204,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -75703,7 +77216,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -75715,7 +77228,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -75727,7 +77240,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -75739,7 +77252,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -75751,7 +77264,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -75763,7 +77276,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -75775,7 +77288,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -75787,7 +77300,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -75799,7 +77312,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -75811,7 +77324,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -75823,7 +77336,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -75835,7 +77348,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -75847,7 +77360,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -75859,7 +77372,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -75871,7 +77384,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -75883,7 +77396,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -75895,7 +77408,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -75907,7 +77420,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -75919,7 +77432,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -75931,7 +77444,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -75943,7 +77456,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -75955,7 +77468,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -75967,7 +77480,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -75979,7 +77492,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -75991,7 +77504,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -76003,7 +77516,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -76015,7 +77528,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -76027,7 +77540,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -76039,7 +77552,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -76051,7 +77564,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -76063,7 +77576,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -76075,7 +77588,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -76087,7 +77600,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -76099,7 +77612,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -76111,7 +77624,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -76123,7 +77636,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -76135,7 +77648,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -76147,7 +77660,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -76159,7 +77672,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -76173,7 +77686,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -76253,7 +77766,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -76269,7 +77782,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -76285,7 +77798,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -76301,7 +77814,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -76317,7 +77830,7 @@ Protocol Lima +------+--------+------------------------+ - X_53863 (Determined from data, 8-bit tag) + X_53834 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -76392,7 +77905,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107685 (Determined from data, 8-bit tag) + X_107656 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -76403,7 +77916,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -76415,7 +77928,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -76429,7 +77942,7 @@ Protocol Lima +------+--------+------------------------+ - X_107687 (Determined from data, 8-bit tag) + X_107658 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -76440,11 +77953,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_37 | + | raw_data | Determined from data | $X_7 | +----------+----------------------+------------------------+ - X_107688 (Determined from data, 8-bit tag) + X_107659 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -76473,11 +77986,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107687 | + | reveal_proof | Determined from data | $X_107658 | +--------------+----------------------+------------------------+ - X_107689 + X_107660 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -76491,7 +78004,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107690 (Determined from data, 8-bit tag) + X_107661 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -76504,7 +78017,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107689 | + | Unnamed field 0 | Variable | sequence of $X_107660 | +-----------------------+----------+-------------------------+ @@ -76516,15 +78029,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107685 | + | pvm_step | Determined from data | $X_107656 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107688 | + | input_proof | Determined from data | $X_107659 | +-----------------------------------+----------------------+-------------------------------------+ - X_42 + X_13 **** +--------+----------------------+-----------+ @@ -76532,11 +78045,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107690 | + | step | Determined from data | $X_107661 | +--------+----------------------+-----------+ - X_107691 + X_107662 ******** +------------------+----------+-----------------------+ @@ -76552,7 +78065,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107693 (Enumeration: unsigned 8-bit integer): + X_107664 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -76564,7 +78077,7 @@ Protocol Lima +-------------+---------------------+ - X_107695 (Determined from data, 8-bit tag) + X_107666 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -76615,7 +78128,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107694 + X_107665 ******** +-----------------------+----------------------+---------------------------+ @@ -76631,13 +78144,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107696 + X_107667 ******** +-------------+----------------------+------------------+ @@ -76649,11 +78162,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-------------+----------------------+------------------+ - X_107698 (Determined from data, 8-bit tag) + X_107669 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -76678,11 +78191,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107696 | + | deposit | Determined from data | $X_107667 | +---------+----------------------+------------------------+ - X_107699 + X_107670 ******** +--------------------+----------+----------+ @@ -76694,7 +78207,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107701 (Determined from data, 8-bit tag) + X_107672 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -76719,7 +78232,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107700 + X_107671 ******** +-----------------------+----------------------+-------------------------+ @@ -76731,7 +78244,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107701 | + | predecessor | Determined from data | $X_107672 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -76886,7 +78399,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107702 + X_107673 ******** +-----------------------+----------------------+--------------------------+ @@ -76900,7 +78413,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107703 + X_107674 ******** +-----------------+-----------+----------+ @@ -76967,7 +78480,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_37 | + | fitness | Variable | sequence of $X_7 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -77151,7 +78664,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107703 | + | solution | 200 bytes | $X_107674 | +----------+-----------+------------------------+ @@ -77281,7 +78794,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+-------------------------------------+ @@ -77501,7 +79014,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107700 | + | commitment | Determined from data | $X_107671 | +---------------+----------------------+------------------------+ @@ -77593,7 +79106,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107698 | + | message | Determined from data | $X_107669 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -77607,7 +79120,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107699 | + | previous_message_result | 64 bytes | $X_107670 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -77651,7 +79164,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107694 | + | tickets_info | Variable | sequence of $X_107665 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -77711,7 +79224,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107693) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107664) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -77751,7 +79264,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_12 | + | message | Variable | sequence of $X_10 | +------------------------------------------------+----------------------+-------------------------+ @@ -77803,7 +79316,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107691 | + | commitment | 76 bytes | $X_107662 | +------------------------------------------------+----------------------+-------------------------+ @@ -77833,7 +79346,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_42 | + | refutation | Determined from data | $X_13 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -77859,7 +79372,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_41 | + | stakers | 42 bytes | $X_12 | +------------------------------------------------+----------------------+-------------------------+ @@ -77959,7 +79472,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_40 | + | slot | 53 bytes | $X_11 | +---------------+----------------------+------------------------+ @@ -77985,7 +79498,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_38 | + | circuits_info | Variable | sequence of $X_9 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -78050,7 +79563,7 @@ Protocol Lima +------------------------------------------------+----------+-------------------------+ - X_107712 (Determined from data, 8-bit tag) + X_107683 (Determined from data, 8-bit tag) ****************************************** Contract (tag 0) @@ -78299,7 +79812,7 @@ Protocol Lima +------+--------+------------------------+ - X_107713 (1 byte, 8-bit tag) + X_107684 (1 byte, 8-bit tag) **************************** Block_application (tag 0) @@ -78342,21 +79855,21 @@ Protocol Lima +------+--------+------------------------+ - X_107711 + X_107682 ******** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_107712 | + | Unnamed field 0 | Determined from data | $X_107683 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_107713 | + | origin | 1 byte | $X_107684 | +-----------------+----------------------+-----------------------+ - X_107714 + X_107685 ******** +-----------------------+----------+-------------------------+ @@ -78364,7 +79877,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_12 | + | Unnamed field 0 | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -78381,7 +79894,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -78399,7 +79912,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -78423,11 +79936,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -78460,7 +79973,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -78484,7 +79997,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -78512,7 +80025,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_107730 + X_107701 ******** +-----------------+----------------------+---------------------------------+ @@ -78524,7 +80037,7 @@ Protocol Lima +-----------------+----------------------+---------------------------------+ - X_107729 + X_107700 ******** +-----------------------------+----------+-------------------------+ @@ -78532,7 +80045,7 @@ Protocol Lima +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_107730 | + | commitments_and_ciphertexts | Variable | sequence of $X_107701 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -78540,7 +80053,7 @@ Protocol Lima +-----------------------------+----------+-------------------------+ - X_107735 (Determined from data, 8-bit tag) + X_107706 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -78551,7 +80064,7 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +---------+----------------------+------------------------+ @@ -78575,7 +80088,7 @@ Protocol Lima +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +---------+----------------------+------------------------+ @@ -78587,13 +80100,13 @@ Protocol Lima +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_107736 + X_107707 ******** +-----------------------------+----------------------+-------------------------------------------------+ @@ -78609,7 +80122,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------------------+ - X_107747 (Determined from data, 8-bit tag) + X_107718 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -78622,7 +80135,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------+-------------------------+ @@ -78648,7 +80161,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------------------+-------------------------+ @@ -78662,7 +80175,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.015-PtLimaPt.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -78670,7 +80183,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ - X_107748 (Determined from data, 8-bit tag) + X_107719 (Determined from data, 8-bit tag) ****************************************** big_map (tag 0) @@ -78683,7 +80196,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107747 | + | diff | Determined from data | $X_107718 | +------+----------------------+------------------------+ @@ -78697,7 +80210,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107735 | + | diff | Determined from data | $X_107706 | +------+----------------------+------------------------+ @@ -78709,7 +80222,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107748 | + | Unnamed field 0 | Variable | sequence of $X_107719 | +-----------------------+----------+-------------------------+ @@ -78726,7 +80239,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -78754,7 +80267,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -78778,11 +80291,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -78806,13 +80319,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -78871,7 +80384,7 @@ Protocol Lima +----------------+----------+------------------------+ - X_107775 + X_107746 ******** +-----------------------+----------+--------------------------------------------------------------+ @@ -78887,7 +80400,7 @@ Protocol Lima +-----------------------+----------+--------------------------------------------------------------+ - X_107774 + X_107745 ******** +------------------------------------------------+----------------------+-------------------------+ @@ -78907,11 +80420,11 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | current_level_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_107775 | + | old_levels_messages | Determined from data | $X_107746 | +------------------------------------------------+----------------------+-------------------------+ - X_107784 + X_107755 ******** +--------------+----------------------+-------------------------------------------------+ @@ -78925,7 +80438,7 @@ Protocol Lima +--------------+----------------------+-------------------------------------------------+ - X_107787 + X_107758 ******** +---------+----------------------+---------------------------------------+ @@ -78937,21 +80450,21 @@ Protocol Lima +---------+----------------------+---------------------------------------+ - X_107783 + X_107754 ******** +-----------------------+----------------------+-------------------------+ | Name | Size | Contents | +=======================+======================+=========================+ - | ticket_token | Determined from data | $X_107784 | + | ticket_token | Determined from data | $X_107755 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107787 | + | updates | Variable | sequence of $X_107758 | +-----------------------+----------------------+-------------------------+ - X_107808 (Determined from data, 8-bit tag) + X_107779 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -78968,11 +80481,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_receipt | Variable | sequence of $X_107783 | + | ticket_receipt | Variable | sequence of $X_107754 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -79002,7 +80515,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79022,7 +80535,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -79037,7 +80550,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_107808 | + | Unnamed field 0 | Determined from data | $X_107779 | +-----------------+----------------------+------------------------+ @@ -79051,7 +80564,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79075,9 +80588,9 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_107808 | + | Unnamed field 0 | Determined from data | $X_107779 | +------------------------------+----------------------+-------------------------------------+ @@ -79102,7 +80615,7 @@ Protocol Lima +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -79178,7 +80691,7 @@ Protocol Lima +-------------------------------+----------------------+---------------------------------------------------------------+ - X_107710 + X_107681 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79186,7 +80699,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79209,7 +80722,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79229,7 +80742,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79253,11 +80766,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -79267,7 +80780,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_107878 + X_107820 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79275,7 +80788,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79285,7 +80798,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_108013 + X_107955 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79293,7 +80806,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.event | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79332,7 +80845,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79356,7 +80869,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -79366,7 +80879,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_108141 + X_108083 ******** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -79374,7 +80887,7 @@ Protocol Lima +==========================================================================+======================+=============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -79397,7 +80910,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79413,7 +80926,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79437,17 +80950,17 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108269 + X_108211 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79455,7 +80968,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79478,7 +80991,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79496,7 +81009,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79520,11 +81033,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -79532,7 +81045,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108403 + X_108345 ******** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -79540,7 +81053,7 @@ Protocol Lima +==========================================================================+======================+=================================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -79550,7 +81063,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_108543 (Determined from data, 8-bit tag) + X_108485 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -79575,7 +81088,7 @@ Protocol Lima +------------+----------+------------------------+ - X_108551 (Determined from data, 8-bit tag) + X_108493 (Determined from data, 8-bit tag) ****************************************** sc_rollup_dissection_choice_not_found (tag 0) @@ -79624,9 +81137,9 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | expected | Determined from data | $X_108543 | + | expected | Determined from data | $X_108485 | +----------+----------------------+------------------------+ - | given | Determined from data | $X_108543 | + | given | Determined from data | $X_108485 | +----------+----------------------+------------------------+ @@ -79638,7 +81151,7 @@ Protocol Lima +======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------+----------------------+------------------------+ - | hash | Determined from data | $X_108543 | + | hash | Determined from data | $X_108485 | +------+----------------------+------------------------+ @@ -79710,7 +81223,7 @@ Protocol Lima +==================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------------+----------------------+------------------------+ - | start_state_hash | Determined from data | $X_108543 | + | start_state_hash | Determined from data | $X_108485 | +------------------+----------------------+------------------------+ | start_proof | 32 bytes | bytes | +------------------+----------------------+------------------------+ @@ -79724,9 +81237,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108543 | + | stop_state_hash | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108543 | + | stop_proof | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ @@ -79738,9 +81251,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108543 | + | stop_state_hash | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108543 | + | stop_proof | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ @@ -79758,7 +81271,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_108552 (Determined from data, 8-bit tag) + X_108494 (Determined from data, 8-bit tag) ****************************************** Conflict_resolved (tag 0) @@ -79779,7 +81292,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_108551 | + | Unnamed field 0 | Determined from data | $X_108493 | +-----------------+----------------------+------------------------+ @@ -79793,7 +81306,7 @@ Protocol Lima +------+--------+------------------------+ - X_108553 (Determined from data, 8-bit tag) + X_108495 (Determined from data, 8-bit tag) ****************************************** Loser (tag 0) @@ -79804,7 +81317,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | reason | Determined from data | $X_108552 | + | reason | Determined from data | $X_108494 | +--------+----------------------+------------------------+ | player | 21 bytes | $public_key_hash | +--------+----------------------+------------------------+ @@ -79820,7 +81333,7 @@ Protocol Lima +------+--------+------------------------+ - X_108554 (Determined from data, 8-bit tag) + X_108496 (Determined from data, 8-bit tag) ****************************************** Ongoing (tag 0) @@ -79841,7 +81354,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | result | Determined from data | $X_108553 | + | result | Determined from data | $X_108495 | +--------+----------------------+------------------------+ @@ -79858,11 +81371,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | game_status | Determined from data | $X_108554 | + | game_status | Determined from data | $X_108496 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79876,7 +81389,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79900,19 +81413,19 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | game_status | Determined from data | $X_108554 | + | game_status | Determined from data | $X_108496 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108538 + X_108480 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79920,7 +81433,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -79949,7 +81462,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -79963,7 +81476,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -79987,7 +81500,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -79997,11 +81510,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216504 + X_216446 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80009,7 +81522,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80046,7 +81559,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80070,7 +81583,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -80078,7 +81591,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216638 + X_216580 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80086,7 +81599,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_cement | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80109,7 +81622,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -80123,7 +81636,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80147,15 +81660,15 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +------------------------------+----------------------+-------------------------------------+ - X_216767 + X_216709 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80163,7 +81676,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80186,7 +81699,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80208,7 +81721,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80232,11 +81745,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -80248,7 +81761,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216900 + X_216842 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80256,7 +81769,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80279,7 +81792,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80297,7 +81810,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80321,11 +81834,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -80333,7 +81846,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217442 + X_217384 ******** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -80341,7 +81854,7 @@ Protocol Lima +==========================================================================+======================+============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -80364,7 +81877,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80382,7 +81895,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80406,11 +81919,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -80418,7 +81931,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217980 + X_217922 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80426,7 +81939,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80449,7 +81962,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80467,7 +81980,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80491,11 +82004,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -80503,7 +82016,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218114 + X_218056 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80511,7 +82024,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80548,7 +82061,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80572,7 +82085,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_gas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -80580,7 +82093,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_218248 + X_218190 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80588,7 +82101,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.update_consensus_key | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80611,7 +82124,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80631,7 +82144,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80655,11 +82168,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -80669,7 +82182,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218638 + X_218580 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80677,7 +82190,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80687,7 +82200,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_218900 + X_218842 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80695,7 +82208,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80705,7 +82218,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219114 (Determined from data, 8-bit tag) + X_219056 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -80722,11 +82235,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_updates | Variable | sequence of $X_107783 | + | ticket_updates | Variable | sequence of $X_107754 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -80756,7 +82269,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -80776,7 +82289,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -80791,7 +82304,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219114 | + | Unnamed field 0 | Determined from data | $X_219056 | +-----------------+----------------------+------------------------+ @@ -80805,7 +82318,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -80829,13 +82342,13 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_219114 | + | Unnamed field 0 | Determined from data | $X_219056 | +------------------------------+----------------------+-------------------------------------+ - X_219075 + X_219017 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80843,7 +82356,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -80853,7 +82366,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219401 + X_219343 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -80861,7 +82374,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -80871,7 +82384,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219405 + X_219347 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -80879,7 +82392,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -80889,7 +82402,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219409 + X_219351 ******** +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -80897,7 +82410,7 @@ Protocol Lima +==========================================================================+==========+=====================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+-------------------------------------+ | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -80911,7 +82424,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107711 | + | Unnamed field 0 | Variable | sequence of $X_107682 | +-----------------------+----------+-------------------------+ @@ -81054,7 +82567,7 @@ Protocol Lima +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_107703 | + | solution | 200 bytes | $X_107674 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $015-PtLimaPt.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -81074,7 +82587,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | destination | 21 bytes | $public_key_hash | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_219409 | + | metadata | Determined from data | $X_219351 | +---------------+----------------------+------------------------+ @@ -81094,7 +82607,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219405 | + | metadata | Determined from data | $X_219347 | +--------------------+----------------------+-------------------------+ @@ -81114,7 +82627,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219401 | + | metadata | Determined from data | $X_219343 | +--------------------+----------------------+-------------------------+ @@ -81154,7 +82667,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +---------------+----------------------+------------------------+ @@ -81182,9 +82695,9 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_219075 | + | metadata | Determined from data | $X_219017 | +----------------------------------+----------------------+-------------------------------------+ @@ -81214,7 +82727,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $015-PtLimaPt.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218900 | + | metadata | Determined from data | $X_218842 | +--------------------------------+----------------------+-------------------------------------+ @@ -81240,7 +82753,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +--------------------------------+----------------------+-------------------------------------+ @@ -81266,7 +82779,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_218638 | + | metadata | Determined from data | $X_218580 | +-----------------------+----------------------+-------------------------+ @@ -81292,7 +82805,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +-----------------------------+----------------------+-------------------------------------+ @@ -81318,7 +82831,7 @@ Protocol Lima +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $015-PtLimaPt.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+--------------------------------------+ @@ -81342,7 +82855,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | pk | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218248 | + | metadata | Determined from data | $X_218190 | +---------------+----------------------+------------------------+ @@ -81364,7 +82877,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218114 | + | metadata | Determined from data | $X_218056 | +---------------+----------------------+------------------------+ @@ -81396,7 +82909,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_217980 | + | metadata | Determined from data | $X_217922 | +----------------------------------+----------------------+-------------------------------------+ @@ -81420,9 +82933,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107700 | + | commitment | Determined from data | $X_107671 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -81446,7 +82959,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -81470,7 +82983,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217442 | + | metadata | Determined from data | $X_217384 | +---------------+----------------------+------------------------+ @@ -81494,7 +83007,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217442 | + | metadata | Determined from data | $X_217384 | +---------------+----------------------+------------------------+ @@ -81520,7 +83033,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107698 | + | message | Determined from data | $X_107669 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -81534,7 +83047,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107699 | + | previous_message_result | 64 bytes | $X_107670 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -81544,7 +83057,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | proof | Variable | bytes | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +------------------------------+----------------------+-------------------------+ @@ -81580,9 +83093,9 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107694 | + | tickets_info | Variable | sequence of $X_107665 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -81622,7 +83135,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +-----------------------+----------------------+---------------------------+ @@ -81644,7 +83157,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107693) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107664) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -81658,7 +83171,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+---------------------------------------------------------------+ - | metadata | Determined from data | $X_216900 | + | metadata | Determined from data | $X_216842 | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -81686,9 +83199,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_12 | + | message | Variable | sequence of $X_10 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216767 | + | metadata | Determined from data | $X_216709 | +------------------------------------------------+----------------------+-------------------------+ @@ -81716,7 +83229,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216638 | + | metadata | Determined from data | $X_216580 | +------------------------------------------------+----------------------+-------------------------+ @@ -81742,9 +83255,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107691 | + | commitment | 76 bytes | $X_107662 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216504 | + | metadata | Determined from data | $X_216446 | +------------------------------------------------+----------------------+-------------------------+ @@ -81774,9 +83287,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_42 | + | refutation | Determined from data | $X_13 | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108538 | + | metadata | Determined from data | $X_108480 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -81802,9 +83315,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_41 | + | stakers | 42 bytes | $X_12 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108538 | + | metadata | Determined from data | $X_108480 | +------------------------------------------------+----------------------+-------------------------+ @@ -81836,7 +83349,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | output_proof | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +------------------------------------------------+----------------------+-------------------------+ @@ -81860,7 +83373,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -81888,7 +83401,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108141 | + | metadata | Determined from data | $X_108083 | +------------------------------------------------+----------------------+-------------------------+ @@ -81910,9 +83423,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_40 | + | slot | 53 bytes | $X_11 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +---------------+----------------------+------------------------+ @@ -81938,7 +83451,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_38 | + | circuits_info | Variable | sequence of $X_9 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -81946,7 +83459,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_107878 | + | metadata | Determined from data | $X_107820 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -81974,11 +83487,11 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | op | Variable | sequence of $X_0 | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_107710 | + | metadata | Determined from data | $X_107681 | +-----------------------+----------------------+-------------------------+ - X_219432 (Determined from data, 8-bit tag) + X_219374 (Determined from data, 8-bit tag) ****************************************** Operation_with_metadata (tag 0) @@ -82017,7 +83530,7 @@ Protocol Lima +---------------------------------+----------+----------------------------------------------------+ - X_434841 (Variable, 8-bit tag) + X_434725 (Variable, 8-bit tag) ****************************** Operation with too large metadata (tag 0) @@ -82056,7 +83569,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219432 | + | Unnamed field 0 | Determined from data | $X_219374 | +-----------------+----------------------+------------------------+ @@ -82076,7 +83589,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_434841 | + | Unnamed field 0 | Variable | $X_434725 | +-----------------------+----------+-------------------------+ </pre> @@ -82104,7 +83617,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature, + "signature": $Signature.V0, "metadata": "too large" } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", @@ -82112,7 +83625,7 @@ Protocol Lima "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, @@ -82120,14 +83633,14 @@ Protocol Lima "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* An operation's shell header. */ "protocol": "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", "chain_id": $Chain_id, "hash": $Operation_hash, "branch": $block_hash, "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.apply_internal_results.alpha.operation_result: { /* transaction */ "kind": "transaction", @@ -82135,9 +83648,8 @@ Protocol Lima "nonce": integer ∈ [0, 2^16-1], "amount": $015-PtLimaPt.mutez, "destination": $015-PtLimaPt.transaction_destination, - "parameters"?: - { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, + "value": any }, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.transaction } || { /* origination */ @@ -82145,7 +83657,7 @@ Protocol Lima "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.origination } @@ -82153,7 +83665,7 @@ Protocol Lima "kind": "delegation", "source": $015-PtLimaPt.contract_id, "nonce": integer ∈ [0, 2^16-1], - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "result": $015-PtLimaPt.operation.alpha.internal_operation_result.delegation } || { /* event */ @@ -82187,7 +83699,7 @@ Protocol Lima "seed_nonce_hash"?: $cycle_nonce, "liquidity_baking_toggle_vote": $015-PtLimaPt.liquidity_baking_toggle_vote, - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.bond_id: { /* Tx_rollup_bond_id */ "tx_rollup": $015-PtLimaPt.tx_rollup_id } @@ -82212,7 +83724,7 @@ Protocol Lima || "set_delegate" || "remove_delegate" || "deposit" - || string + || $unistring /* named */ $015-PtLimaPt.error: /* The full list of RPC errors would be too long to include. @@ -82224,7 +83736,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.endorsement_mempool.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.endorsement_mempool.contents: { /* Endorsement */ "kind": "endorsement", @@ -82236,7 +83748,7 @@ Protocol Lima /* An operation's shell header. */ { "branch": $block_hash, "operations": $015-PtLimaPt.inlined.preendorsement.contents, - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.inlined.preendorsement.contents: { /* Preendorsement */ "kind": "preendorsement", @@ -82476,7 +83988,7 @@ Protocol Lima "block_payload_hash": $value_hash } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum } || { /* Seed_nonce_revelation */ "kind": "seed_nonce_revelation", @@ -82504,26 +84016,26 @@ Protocol Lima "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ] } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass" } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key } + "public_key": $Signature.V0.Public_key } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82532,28 +84044,28 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } } + "value": any } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash } + "delegate"?: $Signature.V0.Public_key_hash } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82561,7 +84073,7 @@ Protocol Lima "limit"?: $015-PtLimaPt.mutez } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82570,31 +84082,31 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id.originated } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key } + "pk": $Signature.V0.Public_key } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash } + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash } || { /* Failing_noop */ "kind": "failing_noop", "arbitrary": $unistring } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression } + "value": any } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82602,7 +84114,7 @@ Protocol Lima "tx_rollup_origination": any } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82612,7 +84124,7 @@ Protocol Lima "burn_limit"?: $015-PtLimaPt.mutez } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82625,7 +84137,7 @@ Protocol Lima "inbox_merkle_root": $Inbox_list_hash } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82633,7 +84145,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82641,7 +84153,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82649,7 +84161,7 @@ Protocol Lima "rollup": $015-PtLimaPt.tx_rollup_id } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82661,7 +84173,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -82676,7 +84188,7 @@ Protocol Lima "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82687,27 +84199,27 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ] } + "claimer": $Signature.V0.Public_key_hash } ... ] } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, "entrypoint": $unistring } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82718,7 +84230,7 @@ Protocol Lima "header": $DAL_commitment } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82726,10 +84238,10 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression } + "parameters_ty": any } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82738,7 +84250,7 @@ Protocol Lima "message": [ $unistring ... ] } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82747,7 +84259,7 @@ Protocol Lima "commitment": $commitment_hash } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82760,13 +84272,13 @@ Protocol Lima "number_of_ticks": $int64 } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -82821,18 +84333,18 @@ Protocol Lima "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } } } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash } } + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82842,7 +84354,7 @@ Protocol Lima "output_proof": $unistring } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82850,7 +84362,7 @@ Protocol Lima "rollup": $Sc_rollup_hash } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82859,54 +84371,19 @@ Protocol Lima "slot_index": integer ∈ [0, 255] } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30] } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -82916,7 +84393,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -82927,7 +84404,7 @@ Protocol Lima /* None */ ] ... ] } $015-PtLimaPt.operation.alpha.contents_and_signature: { "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature": $Signature } + "signature": $Signature.V0 } $015-PtLimaPt.operation.alpha.internal_operation_result.delegation: { /* Applied */ "status": "applied", @@ -83099,9 +84576,9 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "endorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Preendorsement */ "kind": "preendorsement", "slot": integer ∈ [0, 2^16-1], @@ -83111,14 +84588,14 @@ Protocol Lima "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "preendorsement_power": integer ∈ [-2^30, 2^30], - "consensus_key": $Signature.Public_key_hash } } + "consensus_key": $Signature.V0.Public_key_hash } } || { /* Dal_slot_availability */ "kind": "dal_slot_availability", - "endorser": $Signature.Public_key_hash, + "endorser": $Signature.V0.Public_key_hash, "endorsement": $bignum, - "metadata": { "delegate": $Signature.Public_key_hash } } + "metadata": { "delegate": $Signature.V0.Public_key_hash } } || { /* Double_preendorsement_evidence */ "kind": "double_preendorsement_evidence", "op1": $015-PtLimaPt.inlined.preendorsement, @@ -83149,25 +84626,25 @@ Protocol Lima $015-PtLimaPt.operation_metadata.alpha.balance_updates } } || { /* Proposals */ "kind": "proposals", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposals": [ $Protocol_hash ... ], "metadata": { } } || { /* Ballot */ "kind": "ballot", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "period": integer ∈ [-2^31-1, 2^31], "proposal": $Protocol_hash, "ballot": "nay" | "yay" | "pass", "metadata": { } } || { /* Reveal */ "kind": "reveal", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "public_key": $Signature.Public_key, + "public_key": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83177,7 +84654,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transaction */ "kind": "transaction", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83186,7 +84663,7 @@ Protocol Lima "destination": $015-PtLimaPt.contract_id, "parameters"?: { "entrypoint": $015-PtLimaPt.entrypoint, - "value": $micheline.015-PtLimaPt.michelson_v1.expression }, + "value": any }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83196,13 +84673,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Origination */ "kind": "origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "balance": $015-PtLimaPt.mutez, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "script": $015-PtLimaPt.scripted.contracts, "metadata": { "balance_updates"?: @@ -83213,12 +84690,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Delegation */ "kind": "delegation", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "delegate"?: $Signature.Public_key_hash, + "delegate"?: $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83228,12 +84705,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Register_global_constant */ "kind": "register_global_constant", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "value": $micheline.015-PtLimaPt.michelson_v1.expression, + "value": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83243,7 +84720,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Set_deposits_limit */ "kind": "set_deposits_limit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83258,7 +84735,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Increase_paid_storage */ "kind": "increase_paid_storage", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83274,12 +84751,12 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Update_consensus_key */ "kind": "update_consensus_key", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "pk": $Signature.Public_key, + "pk": $Signature.V0.Public_key, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83289,16 +84766,16 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Drain_delegate */ "kind": "drain_delegate", - "consensus_key": $Signature.Public_key_hash, - "delegate": $Signature.Public_key_hash, - "destination": $Signature.Public_key_hash, + "consensus_key": $Signature.V0.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, + "destination": $Signature.V0.Public_key_hash, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, "allocated_destination_contract"?: boolean } } || { /* Tx_rollup_origination */ "kind": "tx_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83313,7 +84790,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_submit_batch */ "kind": "tx_rollup_submit_batch", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83330,7 +84807,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_commit */ "kind": "tx_rollup_commit", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83350,7 +84827,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_return_bond */ "kind": "tx_rollup_return_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83365,7 +84842,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_finalize_commitment */ "kind": "tx_rollup_finalize_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83380,7 +84857,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_remove_commitment */ "kind": "tx_rollup_remove_commitment", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83395,7 +84872,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_rejection */ "kind": "tx_rollup_rejection", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83407,7 +84884,7 @@ Protocol Lima "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } || { /* Deposit */ "deposit": - { "sender": $Signature.Public_key_hash, + { "sender": $Signature.V0.Public_key_hash, "destination": $Bls12_381.Public_key_hash, "ticket_hash": $script_expr, "amount": $int64 } }, @@ -83429,13 +84906,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Transfer_ticket */ "kind": "transfer_ticket", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, - "ticket_contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ticket_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "ticket_contents": any, + "ticket_ty": any, "ticket_ticketer": $015-PtLimaPt.contract_id, "ticket_amount": $positive_bignum, "destination": $015-PtLimaPt.contract_id, @@ -83449,7 +84926,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Dal_publish_slot_header */ "kind": "dal_publish_slot_header", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83467,7 +84944,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Tx_rollup_dispatch_tickets */ "kind": "tx_rollup_dispatch_tickets", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83478,11 +84955,11 @@ Protocol Lima "message_index": integer ∈ [-2^30, 2^30], "message_result_path": [ $Message_result_list_hash ... ], "tickets_info": - [ { "contents": $micheline.015-PtLimaPt.michelson_v1.expression, - "ty": $micheline.015-PtLimaPt.michelson_v1.expression, + [ { "contents": any, + "ty": any, "ticketer": $015-PtLimaPt.contract_id, "amount": $int64, - "claimer": $Signature.Public_key_hash } ... ], + "claimer": $Signature.V0.Public_key_hash } ... ], "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83492,7 +84969,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_originate */ "kind": "sc_rollup_originate", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83500,7 +84977,7 @@ Protocol Lima "pvm_kind": "wasm_2_0_0_pvm_kind" | "arith_pvm_kind", "boot_sector": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "parameters_ty": $micheline.015-PtLimaPt.michelson_v1.expression, + "parameters_ty": any, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83510,7 +84987,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_add_messages */ "kind": "sc_rollup_add_messages", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83526,7 +85003,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_cement */ "kind": "sc_rollup_cement", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83542,7 +85019,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_publish */ "kind": "sc_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83562,13 +85039,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_refute */ "kind": "sc_rollup_refute", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, - "opponent": $Signature.Public_key_hash, + "opponent": $Signature.V0.Public_key_hash, "refutation"?: { "choice": $positive_bignum, "step": @@ -83630,15 +85107,15 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_timeout */ "kind": "sc_rollup_timeout", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "rollup": $015-PtLimaPt.rollup_address, "stakers": - { "alice": $Signature.Public_key_hash, - "bob": $Signature.Public_key_hash }, + { "alice": $Signature.V0.Public_key_hash, + "bob": $Signature.V0.Public_key_hash }, "metadata": { "balance_updates"?: $015-PtLimaPt.operation_metadata.alpha.balance_updates, @@ -83648,7 +85125,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_execute_outbox_message */ "kind": "sc_rollup_execute_outbox_message", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83665,7 +85142,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_recover_bond */ "kind": "sc_rollup_recover_bond", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83680,7 +85157,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Sc_rollup_dal_slot_subscribe */ "kind": "sc_rollup_dal_slot_subscribe", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83696,48 +85173,13 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_origination */ "kind": "zk_rollup_origination", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, "storage_limit": $positive_bignum, "public_parameters": - [ { "common_pp": - { "n": integer ∈ [-2^30, 2^30], - "generator": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "pp_public_parameters": - { "pc_public_parameter": - { "encoding_1": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "encoding_x": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, - "subgroup_size": integer ∈ [-2^30, 2^30], - "cm_g_map": - [ [ $unistring, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] }, - "query": - { "v_map": - [ [ $unistring, [ $unistring, $unistring ] ] ... ], - "identities": - [ [ $unistring, - [ [ [ [ $unistring, integer ∈ [-2^30, 2^30] ] ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] ... ] ] ... ], - "not_committed": - [ [ $unistring, - { /* permutation */ - "permutation": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } - || { /* plookup */ - "plookup": any } - || { /* public */ - "public": - [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], - /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - integer ∈ [-2^30, 2^30] ] } ] ... ] }, - "common_keys": [ $unistring ... ] }, - "circuits_map": - [ [ $unistring, - { "gates": [ [ $unistring, any ] ... ], - "nb_wires": integer ∈ [-2^30, 2^30], - "alpha": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, - "ultra": boolean } ] ... ] }, - /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], "circuits_info": [ [ $unistring, boolean ] ... ], "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], "nb_ops": integer ∈ [-2^30, 2^30], @@ -83750,7 +85192,7 @@ Protocol Lima [ $015-PtLimaPt.apply_internal_results.alpha.operation_result ... ] } } || { /* Zk_rollup_publish */ "kind": "zk_rollup_publish", - "source": $Signature.Public_key_hash, + "source": $Signature.V0.Public_key_hash, "fee": $015-PtLimaPt.mutez, "counter": $positive_bignum, "gas_limit": $positive_bignum, @@ -83760,7 +85202,7 @@ Protocol Lima [ [ { "op_code": integer ∈ [-2^30, 2^30], "price": { "id": $script_expr, "amount": $bignum }, - "l1_dst": $Signature.Public_key_hash, + "l1_dst": $Signature.V0.Public_key_hash, "rollup_id": $Zk_rollup_hash, "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, { /* Some */ @@ -84094,7 +85536,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -84172,7 +85614,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -84243,7 +85685,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -84321,7 +85763,7 @@ Protocol Lima "kind": "proof_invalid", "message": $unistring } || "timeout", - "player": $Signature.Public_key_hash } + "player": $Signature.V0.Public_key_hash } || { /* Draw */ "kind": "draw" } }, "balance_updates": @@ -84658,10 +86100,10 @@ Protocol Lima { /* Operation_with_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.operation_contents_and_result ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } || { /* Operation_without_metadata */ "contents": [ $015-PtLimaPt.operation.alpha.contents ... ], - "signature"?: $Signature } + "signature"?: $Signature.V0 } $015-PtLimaPt.operation_metadata.alpha.balance_updates: [ { /* Contract */ "kind": "contract", @@ -84676,7 +86118,7 @@ Protocol Lima || { /* Deposits */ "kind": "freezer", "category": "deposits", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "change": $int64, "origin": "block" || "migration" || "subsidy" || "simulation" } || { /* Nonce_revelation_rewards */ @@ -84717,7 +86159,7 @@ Protocol Lima || { /* Lost_endorsing_rewards */ "kind": "burned", "category": "lost endorsing rewards", - "delegate": $Signature.Public_key_hash, + "delegate": $Signature.V0.Public_key_hash, "participation": boolean, "revelation": boolean, "change": $int64, @@ -84794,9 +86236,8 @@ Protocol Lima /* Sapling state identifier A sapling state identifier */ $bignum - $015-PtLimaPt.scripted.contracts: - { "code": $micheline.015-PtLimaPt.michelson_v1.expression, - "storage": $micheline.015-PtLimaPt.michelson_v1.expression } + $015-PtLimaPt.scripted.contracts: { "code": any, + "storage": any } $015-PtLimaPt.transaction_destination: /* A destination of a transaction A destination notation compatible with the contract notation as given @@ -84851,13 +86292,13 @@ Protocol Lima $Sc_rollup_hash: /* A smart contract rollup address (Base58Check-encoded) */ $unistring - $Signature: + $Signature.V0: /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */ $unistring - $Signature.Public_key: + $Signature.V0.Public_key: /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ $unistring - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $Withdraw_list_hash: @@ -84933,7 +86374,7 @@ Protocol Lima annotations) */ "prim": $015-PtLimaPt.michelson.v1.primitives, "args"?: [ $micheline.015-PtLimaPt.michelson_v1.expression ... ], - "annots"?: [ string ... ] } + "annots"?: [ $unistring ... ] } $positive_bignum: /* Positive big number Decimal representation of a positive big number */ @@ -85022,7 +86463,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | $X_434841 | + | Unnamed field 0 | Variable | $X_434725 | +-----------------------+----------+-------------------------+ @@ -85618,13 +87059,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -85682,302 +87123,31 @@ Protocol Lima +-----------------+----------------------+----------+ - X_10 - **** - - +------------+----------+----------+ - | Name | Size | Contents | - +============+==========+==========+ - | encoding_1 | 96 bytes | bytes | - +------------+----------+----------+ - | encoding_x | 96 bytes | bytes | - +------------+----------+----------+ - - - X_12 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | bytes | - +-----------------------+----------+-------------------------+ - - - X_11 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 48 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_9 + X_7 *** - +-----------------------+-----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+===========+==============================================================+ - | pc_public_parameter | 192 bytes | $X_10 | - +-----------------------+-----------+--------------------------------------------------------------+ - | subgroup_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+-----------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+-----------+--------------------------------------------------------------+ - | cm_g_map | Variable | sequence of $X_11 | - +-----------------------+-----------+--------------------------------------------------------------+ - - - X_16 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - - - X_14 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_16 | - +-----------------+----------------------+----------+ - - - X_24 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_23 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_24 | - +-----------------------+----------+-------------------------+ - - - X_22 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_23 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+----------+ - - - X_21 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_22 | - +-----------------------+----------+-------------------------+ - - - X_19 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_21 | - +-----------------+----------------------+----------+ - - - X_29 - **** - - +-----------------------+----------+-------------------------+ - | Name | Size | Contents | - +=======================+==========+=========================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of bytes | - +-----------------------+----------+-------------------------+ - - - X_28 - **** - - +-----------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=================+======================+==============================================================+ - | Unnamed field 0 | Determined from data | $X_29 | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 1 | 32 bytes | bytes | - +-----------------+----------------------+--------------------------------------------------------------+ - | Unnamed field 2 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------+----------------------+--------------------------------------------------------------+ - - - X_30 (Determined from data, 8-bit tag) - ************************************** - - public (tag 0) - ============== - - +--------+----------------------+------------------------+ - | Name | Size | Contents | - +========+======================+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +--------+----------------------+------------------------+ - | public | Determined from data | $X_28 | - +--------+----------------------+------------------------+ - - - permutation (tag 1) - =================== - - +-------------+----------+------------------------+ - | Name | Size | Contents | - +=============+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +-------------+----------+------------------------+ - | permutation | 32 bytes | bytes | - +-------------+----------+------------------------+ - - - plookup (tag 2) - =============== - - +------+--------+------------------------+ - | Name | Size | Contents | - +======+========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +------+--------+------------------------+ - - - X_26 - **** - - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_30 | - +-----------------+----------------------+----------+ - - - X_13 - **** - +-----------------------+----------+-------------------------+ | Name | Size | Contents | +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | v_map | Variable | sequence of $X_14 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | identities | Variable | sequence of $X_19 | - +-----------------------+----------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+-------------------------+ - | not_committed | Variable | sequence of $X_26 | + | Unnamed field 0 | Variable | bytes | +-----------------------+----------+-------------------------+ - X_8 + X_6 *** - +-----------------------+----------------------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+======================+==============================================================+ - | n | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | generator | 32 bytes | bytes | - +-----------------------+----------------------+--------------------------------------------------------------+ - | pp_public_parameters | Determined from data | $X_9 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | query | Determined from data | $X_13 | - +-----------------------+----------------------+--------------------------------------------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+--------------------------------------------------------------+ - | common_keys | Variable | sequence of $X_12 | - +-----------------------+----------------------+--------------------------------------------------------------+ - - - X_34 - **** - - +-----------------------+----------+--------------------------------------------------------------+ - | Name | Size | Contents | - +=======================+==========+==============================================================+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------+--------------------------------------------------------------+ - | gates | Variable | sequence of $X_12 | - +-----------------------+----------+--------------------------------------------------------------+ - | nb_wires | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | - +-----------------------+----------+--------------------------------------------------------------+ - | alpha | 32 bytes | bytes | - +-----------------------+----------+--------------------------------------------------------------+ - | ultra | 1 byte | boolean (0 for false, 255 for true) | - +-----------------------+----------+--------------------------------------------------------------+ - - - X_32 - **** - +-----------------+----------------------+----------+ | Name | Size | Contents | +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_34 | + | Unnamed field 1 | Determined from data | $X_7 | +-----------------+----------------------+----------+ - X_7 - *** - - +-----------------------+----------------------+-------------------------+ - | Name | Size | Contents | - +=======================+======================+=========================+ - | common_pp | Determined from data | $X_8 | - +-----------------------+----------------------+-------------------------+ - | # bytes in next field | 4 bytes | unsigned 30-bit integer | - +-----------------------+----------------------+-------------------------+ - | circuits_map | Variable | sequence of $X_32 | - +-----------------------+----------------------+-------------------------+ - - - X_37 + X_10 **** +-----------------------+----------+-------------------------+ @@ -85989,31 +87159,19 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_6 + X_9 *** - +-----------------+----------------------+----------+ - | Name | Size | Contents | - +=================+======================+==========+ - | Unnamed field 0 | Determined from data | $X_7 | - +-----------------+----------------------+----------+ - | Unnamed field 1 | Determined from data | $X_37 | - +-----------------+----------------------+----------+ - - - X_38 - **** - +-----------------+----------------------+-------------------------------------+ | Name | Size | Contents | +=================+======================+=====================================+ - | Unnamed field 0 | Determined from data | $X_12 | + | Unnamed field 0 | Determined from data | $X_10 | +-----------------+----------------------+-------------------------------------+ | Unnamed field 1 | 1 byte | boolean (0 for false, 255 for true) | +-----------------+----------------------+-------------------------------------+ - X_40 + X_11 **** +--------+----------+------------------------+ @@ -86027,7 +87185,7 @@ Protocol Lima +--------+----------+------------------------+ - X_41 + X_12 **** +-------+----------+------------------+ @@ -86039,7 +87197,7 @@ Protocol Lima +-------+----------+------------------+ - X_43 + X_14 **** +-----------------------+----------+------------------------+ @@ -86051,19 +87209,19 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_48 + X_19 **** +-----------------+----------------------+----------------+ | Name | Size | Contents | +=================+======================+================+ - | Unnamed field 0 | Determined from data | $X_43 | + | Unnamed field 0 | Determined from data | $X_14 | +-----------------+----------------------+----------------+ | Unnamed field 1 | Determined from data | $tree_encoding | +-----------------+----------------------+----------------+ - X_175 + X_146 ***** +-----------------+----------------------+------------------------+ @@ -86075,7 +87233,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_174 + X_145 ***** +-----------------------+----------+-------------------------+ @@ -86083,7 +87241,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_175 | + | Unnamed field 0 | Variable | sequence of $X_146 | +-----------------------+----------+-------------------------+ @@ -86148,7 +87306,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86162,7 +87320,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86176,7 +87334,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86190,7 +87348,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86204,7 +87362,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86218,7 +87376,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86232,7 +87390,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86246,7 +87404,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86260,7 +87418,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86274,7 +87432,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86288,7 +87446,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86302,7 +87460,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86316,7 +87474,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86330,7 +87488,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86344,7 +87502,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86358,7 +87516,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86372,7 +87530,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86386,7 +87544,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86400,7 +87558,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86414,7 +87572,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86428,7 +87586,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86442,7 +87600,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86456,7 +87614,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86470,7 +87628,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86484,7 +87642,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86498,7 +87656,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86512,7 +87670,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86526,7 +87684,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86540,7 +87698,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86554,7 +87712,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86568,7 +87726,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86582,7 +87740,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86596,7 +87754,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86610,7 +87768,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86624,7 +87782,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86638,7 +87796,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -86652,7 +87810,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86666,7 +87824,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86680,7 +87838,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86694,7 +87852,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86708,7 +87866,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86722,7 +87880,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86736,7 +87894,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86750,7 +87908,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86764,7 +87922,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86778,7 +87936,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86792,7 +87950,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86806,7 +87964,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86820,7 +87978,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86834,7 +87992,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86848,7 +88006,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86862,7 +88020,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86876,7 +88034,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86890,7 +88048,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86904,7 +88062,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86918,7 +88076,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -86932,7 +88090,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -86946,7 +88104,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -86960,7 +88118,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -86974,7 +88132,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -87052,7 +88210,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -87064,7 +88222,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -87076,7 +88234,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -87088,7 +88246,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -87100,7 +88258,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -87112,7 +88270,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -87124,7 +88282,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -87136,7 +88294,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -87148,7 +88306,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -87160,7 +88318,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -87172,7 +88330,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -87184,7 +88342,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -87196,7 +88354,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -87208,7 +88366,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -87220,7 +88378,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -87232,7 +88390,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -87244,7 +88402,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -87256,7 +88414,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -87268,7 +88426,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -87280,7 +88438,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -87292,7 +88450,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -87304,7 +88462,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -87316,7 +88474,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -87328,7 +88486,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -87340,7 +88498,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -87352,7 +88510,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -87364,7 +88522,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -87376,7 +88534,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -87388,7 +88546,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -87400,7 +88558,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -87412,7 +88570,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -87424,7 +88582,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -87436,7 +88594,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -87448,7 +88606,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -87460,7 +88618,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -87472,7 +88630,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -87484,7 +88642,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -87496,7 +88654,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -87508,7 +88666,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -87520,7 +88678,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -87532,7 +88690,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -87544,7 +88702,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -87556,7 +88714,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -87568,7 +88726,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -87580,7 +88738,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -87592,7 +88750,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -87604,7 +88762,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -87616,7 +88774,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -87628,7 +88786,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -87640,7 +88798,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -87652,7 +88810,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -87664,7 +88822,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -87676,7 +88834,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -87688,7 +88846,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -87700,7 +88858,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -87712,7 +88870,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -87724,7 +88882,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -87736,7 +88894,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -87748,7 +88906,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -87760,7 +88918,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -87772,7 +88930,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -87784,7 +88942,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -87798,7 +88956,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -87824,7 +88982,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -87840,7 +88998,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -87856,7 +89014,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -87872,7 +89030,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -87949,7 +89107,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -87963,7 +89121,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -87977,7 +89135,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -87991,7 +89149,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88005,7 +89163,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88019,7 +89177,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88033,7 +89191,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88047,7 +89205,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88061,7 +89219,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88075,7 +89233,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88089,7 +89247,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88103,7 +89261,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88117,7 +89275,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88131,7 +89289,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88145,7 +89303,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88159,7 +89317,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88173,7 +89331,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88187,7 +89345,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88201,7 +89359,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88215,7 +89373,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88229,7 +89387,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88243,7 +89401,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88257,7 +89415,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88271,7 +89429,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88285,7 +89443,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88299,7 +89457,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88313,7 +89471,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88327,7 +89485,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88341,7 +89499,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88355,7 +89513,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88369,7 +89527,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88383,7 +89541,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88397,7 +89555,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88411,7 +89569,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88425,7 +89583,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88439,7 +89597,7 @@ Protocol Lima +-----------------+----------------------+------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_146 | +-----------------+----------------------+------------------------------+ @@ -88453,7 +89611,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88467,7 +89625,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88481,7 +89639,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88495,7 +89653,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88509,7 +89667,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88523,7 +89681,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88537,7 +89695,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88551,7 +89709,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88565,7 +89723,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88579,7 +89737,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88593,7 +89751,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88607,7 +89765,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88621,7 +89779,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88635,7 +89793,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88649,7 +89807,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88663,7 +89821,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88677,7 +89835,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88691,7 +89849,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88705,7 +89863,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88719,7 +89877,7 @@ Protocol Lima +-----------------+----------------------+-------------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-------------------------------+ - | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_175 | + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_146 | +-----------------+----------------------+-------------------------------+ @@ -88733,7 +89891,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -88747,7 +89905,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+-------------------------+ @@ -88761,7 +89919,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -88775,7 +89933,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_174 | + | Unnamed field 1 | Determined from data | $X_145 | +-----------------+----------------------+------------------------+ @@ -88853,7 +90011,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 1 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 1 $X_19 | +-----------------+----------+-----------------------------+ @@ -88865,7 +90023,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 2 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 2 $X_19 | +-----------------+----------+-----------------------------+ @@ -88877,7 +90035,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 3 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 3 $X_19 | +-----------------+----------+-----------------------------+ @@ -88889,7 +90047,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 4 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 4 $X_19 | +-----------------+----------+-----------------------------+ @@ -88901,7 +90059,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 5 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 5 $X_19 | +-----------------+----------+-----------------------------+ @@ -88913,7 +90071,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 6 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 6 $X_19 | +-----------------+----------+-----------------------------+ @@ -88925,7 +90083,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 7 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 7 $X_19 | +-----------------+----------+-----------------------------+ @@ -88937,7 +90095,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 8 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 8 $X_19 | +-----------------+----------+-----------------------------+ @@ -88949,7 +90107,7 @@ Protocol Lima +=================+==========+=============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+-----------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 9 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 9 $X_19 | +-----------------+----------+-----------------------------+ @@ -88961,7 +90119,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 10 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 10 $X_19 | +-----------------+----------+------------------------------+ @@ -88973,7 +90131,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 11 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 11 $X_19 | +-----------------+----------+------------------------------+ @@ -88985,7 +90143,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 12 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 12 $X_19 | +-----------------+----------+------------------------------+ @@ -88997,7 +90155,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 13 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 13 $X_19 | +-----------------+----------+------------------------------+ @@ -89009,7 +90167,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 14 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 14 $X_19 | +-----------------+----------+------------------------------+ @@ -89021,7 +90179,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 15 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 15 $X_19 | +-----------------+----------+------------------------------+ @@ -89033,7 +90191,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 16 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 16 $X_19 | +-----------------+----------+------------------------------+ @@ -89045,7 +90203,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 17 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 17 $X_19 | +-----------------+----------+------------------------------+ @@ -89057,7 +90215,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 18 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 18 $X_19 | +-----------------+----------+------------------------------+ @@ -89069,7 +90227,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 19 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 19 $X_19 | +-----------------+----------+------------------------------+ @@ -89081,7 +90239,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 20 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 20 $X_19 | +-----------------+----------+------------------------------+ @@ -89093,7 +90251,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 21 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 21 $X_19 | +-----------------+----------+------------------------------+ @@ -89105,7 +90263,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 22 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 22 $X_19 | +-----------------+----------+------------------------------+ @@ -89117,7 +90275,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 23 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 23 $X_19 | +-----------------+----------+------------------------------+ @@ -89129,7 +90287,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 24 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 24 $X_19 | +-----------------+----------+------------------------------+ @@ -89141,7 +90299,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 25 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 25 $X_19 | +-----------------+----------+------------------------------+ @@ -89153,7 +90311,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 26 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 26 $X_19 | +-----------------+----------+------------------------------+ @@ -89165,7 +90323,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 27 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 27 $X_19 | +-----------------+----------+------------------------------+ @@ -89177,7 +90335,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 28 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 28 $X_19 | +-----------------+----------+------------------------------+ @@ -89189,7 +90347,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 29 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 29 $X_19 | +-----------------+----------+------------------------------+ @@ -89201,7 +90359,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 30 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 30 $X_19 | +-----------------+----------+------------------------------+ @@ -89213,7 +90371,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 31 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 31 $X_19 | +-----------------+----------+------------------------------+ @@ -89225,7 +90383,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 32 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 32 $X_19 | +-----------------+----------+------------------------------+ @@ -89237,7 +90395,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 33 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 33 $X_19 | +-----------------+----------+------------------------------+ @@ -89249,7 +90407,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 34 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 34 $X_19 | +-----------------+----------+------------------------------+ @@ -89261,7 +90419,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 35 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 35 $X_19 | +-----------------+----------+------------------------------+ @@ -89273,7 +90431,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 36 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 36 $X_19 | +-----------------+----------+------------------------------+ @@ -89285,7 +90443,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 37 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 37 $X_19 | +-----------------+----------+------------------------------+ @@ -89297,7 +90455,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 38 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 38 $X_19 | +-----------------+----------+------------------------------+ @@ -89309,7 +90467,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 39 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 39 $X_19 | +-----------------+----------+------------------------------+ @@ -89321,7 +90479,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 40 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 40 $X_19 | +-----------------+----------+------------------------------+ @@ -89333,7 +90491,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 41 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 41 $X_19 | +-----------------+----------+------------------------------+ @@ -89345,7 +90503,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 42 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 42 $X_19 | +-----------------+----------+------------------------------+ @@ -89357,7 +90515,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 43 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 43 $X_19 | +-----------------+----------+------------------------------+ @@ -89369,7 +90527,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 44 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 44 $X_19 | +-----------------+----------+------------------------------+ @@ -89381,7 +90539,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 45 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 45 $X_19 | +-----------------+----------+------------------------------+ @@ -89393,7 +90551,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 46 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 46 $X_19 | +-----------------+----------+------------------------------+ @@ -89405,7 +90563,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 47 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 47 $X_19 | +-----------------+----------+------------------------------+ @@ -89417,7 +90575,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 48 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 48 $X_19 | +-----------------+----------+------------------------------+ @@ -89429,7 +90587,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 49 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 49 $X_19 | +-----------------+----------+------------------------------+ @@ -89441,7 +90599,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 50 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 50 $X_19 | +-----------------+----------+------------------------------+ @@ -89453,7 +90611,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 51 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 51 $X_19 | +-----------------+----------+------------------------------+ @@ -89465,7 +90623,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 52 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 52 $X_19 | +-----------------+----------+------------------------------+ @@ -89477,7 +90635,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 53 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 53 $X_19 | +-----------------+----------+------------------------------+ @@ -89489,7 +90647,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 54 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 54 $X_19 | +-----------------+----------+------------------------------+ @@ -89501,7 +90659,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 55 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 55 $X_19 | +-----------------+----------+------------------------------+ @@ -89513,7 +90671,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 56 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 56 $X_19 | +-----------------+----------+------------------------------+ @@ -89525,7 +90683,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 57 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 57 $X_19 | +-----------------+----------+------------------------------+ @@ -89537,7 +90695,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 58 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 58 $X_19 | +-----------------+----------+------------------------------+ @@ -89549,7 +90707,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 59 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 59 $X_19 | +-----------------+----------+------------------------------+ @@ -89561,7 +90719,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 60 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 60 $X_19 | +-----------------+----------+------------------------------+ @@ -89573,7 +90731,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 61 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 61 $X_19 | +-----------------+----------+------------------------------+ @@ -89585,7 +90743,7 @@ Protocol Lima +=================+==========+==============================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------+------------------------------+ - | Unnamed field 0 | Variable | sequence of exactly 62 $X_48 | + | Unnamed field 0 | Variable | sequence of exactly 62 $X_19 | +-----------------+----------+------------------------------+ @@ -89599,7 +90757,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_48 | + | Unnamed field 0 | Variable | sequence of $X_19 | +-----------------------+----------+-------------------------+ @@ -89679,7 +90837,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -89695,7 +90853,7 @@ Protocol Lima +-----------------+----------------------+-------------------------+ | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | +-----------------+----------------------+-------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+-------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+-------------------------+ @@ -89711,7 +90869,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 4 bytes | signed 32-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -89727,7 +90885,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ | Unnamed field 0 | 8 bytes | signed 64-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 1 | Determined from data | $X_43 | + | Unnamed field 1 | Determined from data | $X_14 | +-----------------+----------------------+------------------------+ | Unnamed field 2 | Determined from data | $inode_tree | +-----------------+----------------------+------------------------+ @@ -89743,7 +90901,7 @@ Protocol Lima +------+--------+------------------------+ - X_53863 (Determined from data, 8-bit tag) + X_53834 (Determined from data, 8-bit tag) ***************************************** case 0 (tag 0) @@ -89818,7 +90976,7 @@ Protocol Lima +-----------------+----------------------+------------------------+ - X_107685 (Determined from data, 8-bit tag) + X_107656 (Determined from data, 8-bit tag) ****************************************** Arithmetic PVM with proof (tag 0) @@ -89829,7 +90987,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -89841,7 +90999,7 @@ Protocol Lima +=======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-------+----------------------+------------------------+ - | proof | Determined from data | $X_53863 | + | proof | Determined from data | $X_53834 | +-------+----------------------+------------------------+ @@ -89855,7 +91013,7 @@ Protocol Lima +------+--------+------------------------+ - X_107687 (Determined from data, 8-bit tag) + X_107658 (Determined from data, 8-bit tag) ****************************************** raw data proof (tag 0) @@ -89866,11 +91024,11 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | raw_data | Determined from data | $X_37 | + | raw_data | Determined from data | $X_7 | +----------+----------------------+------------------------+ - X_107688 (Determined from data, 8-bit tag) + X_107659 (Determined from data, 8-bit tag) ****************************************** inbox proof (tag 0) @@ -89899,11 +91057,11 @@ Protocol Lima +==============+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------------+----------------------+------------------------+ - | reveal_proof | Determined from data | $X_107687 | + | reveal_proof | Determined from data | $X_107658 | +--------------+----------------------+------------------------+ - X_107689 + X_107660 ******** +-----------------------------+----------------------+-------------------------------------+ @@ -89917,7 +91075,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ - X_107690 (Determined from data, 8-bit tag) + X_107661 (Determined from data, 8-bit tag) ****************************************** Dissection (tag 0) @@ -89930,7 +91088,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107689 | + | Unnamed field 0 | Variable | sequence of $X_107660 | +-----------------------+----------+-------------------------+ @@ -89942,15 +91100,15 @@ Protocol Lima +===================================+======================+=====================================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------------------------+----------------------+-------------------------------------+ - | pvm_step | Determined from data | $X_107685 | + | pvm_step | Determined from data | $X_107656 | +-----------------------------------+----------------------+-------------------------------------+ | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | +-----------------------------------+----------------------+-------------------------------------+ - | input_proof | Determined from data | $X_107688 | + | input_proof | Determined from data | $X_107659 | +-----------------------------------+----------------------+-------------------------------------+ - X_42 + X_13 **** +--------+----------------------+-----------+ @@ -89958,11 +91116,11 @@ Protocol Lima +========+======================+===========+ | choice | Determined from data | $N.t | +--------+----------------------+-----------+ - | step | Determined from data | $X_107690 | + | step | Determined from data | $X_107661 | +--------+----------------------+-----------+ - X_107691 + X_107662 ******** +------------------+----------+-----------------------+ @@ -89978,7 +91136,7 @@ Protocol Lima +------------------+----------+-----------------------+ - X_107693 (Enumeration: unsigned 8-bit integer): + X_107664 (Enumeration: unsigned 8-bit integer): *********************************************** +-------------+---------------------+ @@ -89990,7 +91148,7 @@ Protocol Lima +-------------+---------------------+ - X_107695 (Determined from data, 8-bit tag) + X_107666 (Determined from data, 8-bit tag) ****************************************** case 0 (tag 0) @@ -90041,7 +91199,7 @@ Protocol Lima +-----------------+---------+------------------------+ - X_107694 + X_107665 ******** +-----------------------+----------------------+---------------------------+ @@ -90057,13 +91215,13 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | ticketer | 22 bytes | $015-PtLimaPt.contract_id | +-----------------------+----------------------+---------------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-----------------------+----------------------+---------------------------+ | claimer | 21 bytes | $public_key_hash | +-----------------------+----------------------+---------------------------+ - X_107696 + X_107667 ******** +-------------+----------------------+------------------+ @@ -90075,11 +91233,11 @@ Protocol Lima +-------------+----------------------+------------------+ | ticket_hash | 32 bytes | bytes | +-------------+----------------------+------------------+ - | amount | Determined from data | $X_107695 | + | amount | Determined from data | $X_107666 | +-------------+----------------------+------------------+ - X_107698 (Determined from data, 8-bit tag) + X_107669 (Determined from data, 8-bit tag) ****************************************** Batch (tag 0) @@ -90104,11 +91262,11 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | deposit | Determined from data | $X_107696 | + | deposit | Determined from data | $X_107667 | +---------+----------------------+------------------------+ - X_107699 + X_107670 ******** +--------------------+----------+----------+ @@ -90120,7 +91278,7 @@ Protocol Lima +--------------------+----------+----------+ - X_107701 (Determined from data, 8-bit tag) + X_107672 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -90145,7 +91303,7 @@ Protocol Lima +-----------------+----------+------------------------+ - X_107700 + X_107671 ******** +-----------------------+----------------------+-------------------------+ @@ -90157,7 +91315,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | messages | Variable | sequence of bytes | +-----------------------+----------------------+-------------------------+ - | predecessor | Determined from data | $X_107701 | + | predecessor | Determined from data | $X_107672 | +-----------------------+----------------------+-------------------------+ | inbox_merkle_root | 32 bytes | bytes | +-----------------------+----------------------+-------------------------+ @@ -90312,7 +91470,7 @@ Protocol Lima +-----------------------+----------+------------------------+ - X_107702 + X_107673 ******** +-----------------------+----------------------+--------------------------+ @@ -90326,7 +91484,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------+ - X_107703 + X_107674 ******** +-----------------+-----------+----------+ @@ -90393,7 +91551,7 @@ Protocol Lima +---------------------------------------+----------+-------------------------------------+ | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | +---------------------------------------+----------+-------------------------------------+ - | fitness | Variable | sequence of $X_37 | + | fitness | Variable | sequence of $X_7 | +---------------------------------------+----------+-------------------------------------+ | context | 32 bytes | bytes | +---------------------------------------+----------+-------------------------------------+ @@ -90577,7 +91735,7 @@ Protocol Lima +==========+===========+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+-----------+------------------------+ - | solution | 200 bytes | $X_107703 | + | solution | 200 bytes | $X_107674 | +----------+-----------+------------------------+ @@ -90707,7 +91865,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+-------------------------------------+ @@ -90927,7 +92085,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107700 | + | commitment | Determined from data | $X_107671 | +---------------+----------------------+------------------------+ @@ -91019,7 +92177,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107698 | + | message | Determined from data | $X_107669 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -91033,7 +92191,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107699 | + | previous_message_result | 64 bytes | $X_107670 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -91077,7 +92235,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107694 | + | tickets_info | Variable | sequence of $X_107665 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -91137,7 +92295,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107693) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107664) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -91177,7 +92335,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_12 | + | message | Variable | sequence of $X_10 | +------------------------------------------------+----------------------+-------------------------+ @@ -91229,7 +92387,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107691 | + | commitment | 76 bytes | $X_107662 | +------------------------------------------------+----------------------+-------------------------+ @@ -91259,7 +92417,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_42 | + | refutation | Determined from data | $X_13 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -91285,7 +92443,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_41 | + | stakers | 42 bytes | $X_12 | +------------------------------------------------+----------------------+-------------------------+ @@ -91385,7 +92543,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_40 | + | slot | 53 bytes | $X_11 | +---------------+----------------------+------------------------+ @@ -91411,7 +92569,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_38 | + | circuits_info | Variable | sequence of $X_9 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -91476,7 +92634,7 @@ Protocol Lima +------------------------------------------------+----------+-------------------------+ - X_107712 (Determined from data, 8-bit tag) + X_107683 (Determined from data, 8-bit tag) ****************************************** Contract (tag 0) @@ -91725,7 +92883,7 @@ Protocol Lima +------+--------+------------------------+ - X_107713 (1 byte, 8-bit tag) + X_107684 (1 byte, 8-bit tag) **************************** Block_application (tag 0) @@ -91768,21 +92926,21 @@ Protocol Lima +------+--------+------------------------+ - X_107711 + X_107682 ******** +-----------------+----------------------+-----------------------+ | Name | Size | Contents | +=================+======================+=======================+ - | Unnamed field 0 | Determined from data | $X_107712 | + | Unnamed field 0 | Determined from data | $X_107683 | +-----------------+----------------------+-----------------------+ | change | 8 bytes | signed 64-bit integer | +-----------------+----------------------+-----------------------+ - | origin | 1 byte | $X_107713 | + | origin | 1 byte | $X_107684 | +-----------------+----------------------+-----------------------+ - X_107714 + X_107685 ******** +-----------------------+----------+-------------------------+ @@ -91790,7 +92948,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_12 | + | Unnamed field 0 | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -91807,7 +92965,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -91825,7 +92983,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -91849,11 +93007,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -91886,7 +93044,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -91910,7 +93068,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -91938,7 +93096,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_107730 + X_107701 ******** +-----------------+----------------------+---------------------------------+ @@ -91950,7 +93108,7 @@ Protocol Lima +-----------------+----------------------+---------------------------------+ - X_107729 + X_107700 ******** +-----------------------------+----------+-------------------------+ @@ -91958,7 +93116,7 @@ Protocol Lima +=============================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ - | commitments_and_ciphertexts | Variable | sequence of $X_107730 | + | commitments_and_ciphertexts | Variable | sequence of $X_107701 | +-----------------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------------+----------+-------------------------+ @@ -91966,7 +93124,7 @@ Protocol Lima +-----------------------------+----------+-------------------------+ - X_107735 (Determined from data, 8-bit tag) + X_107706 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -91977,7 +93135,7 @@ Protocol Lima +=========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +---------+----------------------+------------------------+ @@ -92001,7 +93159,7 @@ Protocol Lima +---------+----------------------+------------------------+ | source | Determined from data | $Z.t | +---------+----------------------+------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +---------+----------------------+------------------------+ @@ -92013,13 +93171,13 @@ Protocol Lima +===========+======================+=========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------+----------------------+-------------------------+ - | updates | Determined from data | $X_107729 | + | updates | Determined from data | $X_107700 | +-----------+----------------------+-------------------------+ | memo_size | 2 bytes | unsigned 16-bit integer | +-----------+----------------------+-------------------------+ - X_107736 + X_107707 ******** +-----------------------------+----------------------+-------------------------------------------------+ @@ -92035,7 +93193,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------------------+ - X_107747 (Determined from data, 8-bit tag) + X_107718 (Determined from data, 8-bit tag) ****************************************** update (tag 0) @@ -92048,7 +93206,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------+-------------------------+ @@ -92074,7 +93232,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------------------+-------------------------+ @@ -92088,7 +93246,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------------------------------+ - | updates | Variable | sequence of $X_107736 | + | updates | Variable | sequence of $X_107707 | +-----------------------+----------------------+-------------------------------------------------+ | key_type | Determined from data | $micheline.015-PtLimaPt.michelson_v1.expression | +-----------------------+----------------------+-------------------------------------------------+ @@ -92096,7 +93254,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------------------------------+ - X_107748 (Determined from data, 8-bit tag) + X_107719 (Determined from data, 8-bit tag) ****************************************** big_map (tag 0) @@ -92109,7 +93267,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107747 | + | diff | Determined from data | $X_107718 | +------+----------------------+------------------------+ @@ -92123,7 +93281,7 @@ Protocol Lima +------+----------------------+------------------------+ | id | Determined from data | $Z.t | +------+----------------------+------------------------+ - | diff | Determined from data | $X_107735 | + | diff | Determined from data | $X_107706 | +------+----------------------+------------------------+ @@ -92135,7 +93293,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107748 | + | Unnamed field 0 | Variable | sequence of $X_107719 | +-----------------------+----------+-------------------------+ @@ -92152,7 +93310,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -92180,7 +93338,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92204,11 +93362,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -92232,13 +93390,13 @@ Protocol Lima Implicit (tag 0) ================ - +---------------------------+----------+------------------------+ - | Name | Size | Contents | - +===========================+==========+========================+ - | Tag | 1 byte | unsigned 8-bit integer | - +---------------------------+----------+------------------------+ - | Signature.Public_key_hash | 21 bytes | $public_key_hash | - +---------------------------+----------+------------------------+ + +------------------------------+----------+------------------------+ + | Name | Size | Contents | + +==============================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------+------------------------+ + | Signature.V0.Public_key_hash | 21 bytes | $public_key_hash | + +------------------------------+----------+------------------------+ Originated (tag 1) @@ -92297,7 +93455,7 @@ Protocol Lima +----------------+----------+------------------------+ - X_107775 + X_107746 ******** +-----------------------+----------+--------------------------------------------------------------+ @@ -92313,7 +93471,7 @@ Protocol Lima +-----------------------+----------+--------------------------------------------------------------+ - X_107774 + X_107745 ******** +------------------------------------------------+----------------------+-------------------------+ @@ -92333,11 +93491,11 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | current_level_hash | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | old_levels_messages | Determined from data | $X_107775 | + | old_levels_messages | Determined from data | $X_107746 | +------------------------------------------------+----------------------+-------------------------+ - X_107784 + X_107755 ******** +--------------+----------------------+-------------------------------------------------+ @@ -92351,7 +93509,7 @@ Protocol Lima +--------------+----------------------+-------------------------------------------------+ - X_107787 + X_107758 ******** +---------+----------------------+---------------------------------------+ @@ -92363,21 +93521,21 @@ Protocol Lima +---------+----------------------+---------------------------------------+ - X_107783 + X_107754 ******** +-----------------------+----------------------+-------------------------+ | Name | Size | Contents | +=======================+======================+=========================+ - | ticket_token | Determined from data | $X_107784 | + | ticket_token | Determined from data | $X_107755 | +-----------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+-------------------------+ - | updates | Variable | sequence of $X_107787 | + | updates | Variable | sequence of $X_107758 | +-----------------------+----------------------+-------------------------+ - X_107808 (Determined from data, 8-bit tag) + X_107779 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -92394,11 +93552,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_receipt | Variable | sequence of $X_107783 | + | ticket_receipt | Variable | sequence of $X_107754 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -92428,7 +93586,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -92448,7 +93606,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -92463,7 +93621,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_107808 | + | Unnamed field 0 | Determined from data | $X_107779 | +-----------------+----------------------+------------------------+ @@ -92477,7 +93635,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92501,9 +93659,9 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_107808 | + | Unnamed field 0 | Determined from data | $X_107779 | +------------------------------+----------------------+-------------------------------------+ @@ -92528,7 +93686,7 @@ Protocol Lima +----------------------------------+----------------------+---------------------------------------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+---------------------------------------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+---------------------------------------------------------------------+ | result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.transaction | +----------------------------------+----------------------+---------------------------------------------------------------------+ @@ -92604,7 +93762,7 @@ Protocol Lima +-------------------------------+----------------------+---------------------------------------------------------------+ - X_107710 + X_107681 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92612,7 +93770,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92635,7 +93793,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -92655,7 +93813,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92679,11 +93837,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | originated_zk_rollup | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -92693,7 +93851,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_107878 + X_107820 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92701,7 +93859,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.zk_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92711,7 +93869,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_108013 + X_107955 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92719,7 +93877,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.event | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92758,7 +93916,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92782,7 +93940,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -92792,7 +93950,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_108141 + X_108083 ******** +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -92800,7 +93958,7 @@ Protocol Lima +==========================================================================+======================+=============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_dal_slot_subscribe | +--------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------+ @@ -92823,7 +93981,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -92839,7 +93997,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92863,17 +94021,17 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108269 + X_108211 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92881,7 +94039,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_recover_bond | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -92904,7 +94062,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -92922,7 +94080,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -92946,11 +94104,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -92958,7 +94116,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108403 + X_108345 ******** +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -92966,7 +94124,7 @@ Protocol Lima +==========================================================================+======================+=================================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_execute_outbox_message | +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ @@ -92976,7 +94134,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ - X_108543 (Determined from data, 8-bit tag) + X_108485 (Determined from data, 8-bit tag) ****************************************** None (tag 0) @@ -93001,7 +94159,7 @@ Protocol Lima +------------+----------+------------------------+ - X_108551 (Determined from data, 8-bit tag) + X_108493 (Determined from data, 8-bit tag) ****************************************** sc_rollup_dissection_choice_not_found (tag 0) @@ -93050,9 +94208,9 @@ Protocol Lima +==========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+------------------------+ - | expected | Determined from data | $X_108543 | + | expected | Determined from data | $X_108485 | +----------+----------------------+------------------------+ - | given | Determined from data | $X_108543 | + | given | Determined from data | $X_108485 | +----------+----------------------+------------------------+ @@ -93064,7 +94222,7 @@ Protocol Lima +======+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------+----------------------+------------------------+ - | hash | Determined from data | $X_108543 | + | hash | Determined from data | $X_108485 | +------+----------------------+------------------------+ @@ -93136,7 +94294,7 @@ Protocol Lima +==================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +------------------+----------------------+------------------------+ - | start_state_hash | Determined from data | $X_108543 | + | start_state_hash | Determined from data | $X_108485 | +------------------+----------------------+------------------------+ | start_proof | 32 bytes | bytes | +------------------+----------------------+------------------------+ @@ -93150,9 +94308,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108543 | + | stop_state_hash | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108543 | + | stop_proof | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ @@ -93164,9 +94322,9 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | stop_state_hash | Determined from data | $X_108543 | + | stop_state_hash | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ - | stop_proof | Determined from data | $X_108543 | + | stop_proof | Determined from data | $X_108485 | +-----------------+----------------------+------------------------+ @@ -93184,7 +94342,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ - X_108552 (Determined from data, 8-bit tag) + X_108494 (Determined from data, 8-bit tag) ****************************************** Conflict_resolved (tag 0) @@ -93205,7 +94363,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_108551 | + | Unnamed field 0 | Determined from data | $X_108493 | +-----------------+----------------------+------------------------+ @@ -93219,7 +94377,7 @@ Protocol Lima +------+--------+------------------------+ - X_108553 (Determined from data, 8-bit tag) + X_108495 (Determined from data, 8-bit tag) ****************************************** Loser (tag 0) @@ -93230,7 +94388,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | reason | Determined from data | $X_108552 | + | reason | Determined from data | $X_108494 | +--------+----------------------+------------------------+ | player | 21 bytes | $public_key_hash | +--------+----------------------+------------------------+ @@ -93246,7 +94404,7 @@ Protocol Lima +------+--------+------------------------+ - X_108554 (Determined from data, 8-bit tag) + X_108496 (Determined from data, 8-bit tag) ****************************************** Ongoing (tag 0) @@ -93267,7 +94425,7 @@ Protocol Lima +========+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +--------+----------------------+------------------------+ - | result | Determined from data | $X_108553 | + | result | Determined from data | $X_108495 | +--------+----------------------+------------------------+ @@ -93284,11 +94442,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | game_status | Determined from data | $X_108554 | + | game_status | Determined from data | $X_108496 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93302,7 +94460,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93326,19 +94484,19 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | game_status | Determined from data | $X_108554 | + | game_status | Determined from data | $X_108496 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_108538 + X_108480 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93346,7 +94504,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_timeout | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93375,7 +94533,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93389,7 +94547,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93413,7 +94571,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -93423,11 +94581,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216504 + X_216446 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93435,7 +94593,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_publish | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93472,7 +94630,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93496,7 +94654,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -93504,7 +94662,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_216638 + X_216580 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93512,7 +94670,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_cement | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93535,7 +94693,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -93549,7 +94707,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93573,15 +94731,15 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +------------------------------+----------------------+-------------------------------------+ - X_216767 + X_216709 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93589,7 +94747,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_add_messages | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93612,7 +94770,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93634,7 +94792,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93658,11 +94816,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | address | 20 bytes | bytes | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -93674,7 +94832,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_216900 + X_216842 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93682,7 +94840,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.sc_rollup_originate | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93705,7 +94863,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93723,7 +94881,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93747,11 +94905,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -93759,7 +94917,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217442 + X_217384 ******** +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -93767,7 +94925,7 @@ Protocol Lima +==========================================================================+======================+============================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_remove_commitment | +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ @@ -93790,7 +94948,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93808,7 +94966,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93832,11 +94990,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -93844,7 +95002,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_217980 + X_217922 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93852,7 +95010,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_submit_batch | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93875,7 +95033,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -93893,7 +95051,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93917,11 +95075,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -93929,7 +95087,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218114 + X_218056 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93937,7 +95095,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.tx_rollup_origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -93974,7 +95132,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -93998,7 +95156,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ | consumed_gas | Determined from data | $N.t | +------------------------------+----------------------+-------------------------------------+ @@ -94006,7 +95164,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ - X_218248 + X_218190 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94014,7 +95172,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.update_consensus_key | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94037,7 +95195,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -94057,7 +95215,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -94081,11 +95239,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------------------+ @@ -94095,7 +95253,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------+ - X_218638 + X_218580 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94103,7 +95261,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.register_global_constant | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94113,7 +95271,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_218900 + X_218842 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94121,7 +95279,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.internal_operation_result.origination | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94131,7 +95289,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219114 (Determined from data, 8-bit tag) + X_219056 (Determined from data, 8-bit tag) ****************************************** To_contract (tag 0) @@ -94148,11 +95306,11 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ - | ticket_updates | Variable | sequence of $X_107783 | + | ticket_updates | Variable | sequence of $X_107754 | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ @@ -94182,7 +95340,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------+ | consumed_milligas | Determined from data | $N.t | +--------------------------------------------------------------------------+----------------------+-------------------------+ @@ -94202,7 +95360,7 @@ Protocol Lima +-------------------+----------------------+------------------------+ | consumed_milligas | Determined from data | $N.t | +-------------------+----------------------+------------------------+ - | inbox_after | Determined from data | $X_107774 | + | inbox_after | Determined from data | $X_107745 | +-------------------+----------------------+------------------------+ @@ -94217,7 +95375,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219114 | + | Unnamed field 0 | Determined from data | $X_219056 | +-----------------+----------------------+------------------------+ @@ -94231,7 +95389,7 @@ Protocol Lima +-----------------------+----------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | errors | Variable | sequence of $X_12 | + | errors | Variable | sequence of $X_10 | +-----------------------+----------+-------------------------+ @@ -94255,13 +95413,13 @@ Protocol Lima +------------------------------+----------------------+-------------------------------------+ | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------+----------------------+-------------------------------------+ - | errors | Determined from data | $X_107714 | + | errors | Determined from data | $X_107685 | +------------------------------+----------------------+-------------------------------------+ - | Unnamed field 0 | Determined from data | $X_219114 | + | Unnamed field 0 | Determined from data | $X_219056 | +------------------------------+----------------------+-------------------------------------+ - X_219075 + X_219017 ******** +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94269,7 +95427,7 @@ Protocol Lima +==========================================================================+======================+=========================================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ | operation_result | Determined from data | $015-PtLimaPt.operation.alpha.operation_result.transaction | +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ @@ -94279,7 +95437,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ - X_219401 + X_219343 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -94287,7 +95445,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -94297,7 +95455,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219405 + X_219347 ******** +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -94305,7 +95463,7 @@ Protocol Lima +==========================================================================+==========+==============================================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ @@ -94315,7 +95473,7 @@ Protocol Lima +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ - X_219409 + X_219351 ******** +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -94323,7 +95481,7 @@ Protocol Lima +==========================================================================+==========+=====================================+ | # bytes in field "015-PtLimaPt.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | +--------------------------------------------------------------------------+----------+-------------------------------------+ - | balance_updates | Variable | sequence of $X_107711 | + | balance_updates | Variable | sequence of $X_107682 | +--------------------------------------------------------------------------+----------+-------------------------------------+ | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | +--------------------------------------------------------------------------+----------+-------------------------------------+ @@ -94337,7 +95495,7 @@ Protocol Lima +=======================+==========+=========================+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------+-------------------------+ - | Unnamed field 0 | Variable | sequence of $X_107711 | + | Unnamed field 0 | Variable | sequence of $X_107682 | +-----------------------+----------+-------------------------+ @@ -94480,7 +95638,7 @@ Protocol Lima +==========+======================+========================================================+ | Tag | 1 byte | unsigned 8-bit integer | +----------+----------------------+--------------------------------------------------------+ - | solution | 200 bytes | $X_107703 | + | solution | 200 bytes | $X_107674 | +----------+----------------------+--------------------------------------------------------+ | metadata | Determined from data | $015-PtLimaPt.operation_metadata.alpha.balance_updates | +----------+----------------------+--------------------------------------------------------+ @@ -94500,7 +95658,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | destination | 21 bytes | $public_key_hash | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_219409 | + | metadata | Determined from data | $X_219351 | +---------------+----------------------+------------------------+ @@ -94520,7 +95678,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219405 | + | metadata | Determined from data | $X_219347 | +--------------------+----------------------+-------------------------+ @@ -94540,7 +95698,7 @@ Protocol Lima +--------------------+----------------------+-------------------------+ | block_payload_hash | 32 bytes | bytes | +--------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_219401 | + | metadata | Determined from data | $X_219343 | +--------------------+----------------------+-------------------------+ @@ -94580,7 +95738,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | public_key | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +---------------+----------------------+------------------------+ @@ -94608,9 +95766,9 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | +----------------------------------+----------------------+-------------------------------------+ - | parameters | Determined from data | $X_107702 | + | parameters | Determined from data | $X_107673 | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_219075 | + | metadata | Determined from data | $X_219017 | +----------------------------------+----------------------+-------------------------------------+ @@ -94640,7 +95798,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | script | Determined from data | $015-PtLimaPt.scripted.contracts | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_218900 | + | metadata | Determined from data | $X_218842 | +--------------------------------+----------------------+-------------------------------------+ @@ -94666,7 +95824,7 @@ Protocol Lima +--------------------------------+----------------------+-------------------------------------+ | delegate | 21 bytes | $public_key_hash | +--------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +--------------------------------+----------------------+-------------------------------------+ @@ -94692,7 +95850,7 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | value | Variable | bytes | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_218638 | + | metadata | Determined from data | $X_218580 | +-----------------------+----------------------+-------------------------+ @@ -94718,7 +95876,7 @@ Protocol Lima +-----------------------------+----------------------+-------------------------------------+ | limit | Determined from data | $N.t | +-----------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +-----------------------------+----------------------+-------------------------------------+ @@ -94744,7 +95902,7 @@ Protocol Lima +---------------+----------------------+--------------------------------------+ | destination | 22 bytes | $015-PtLimaPt.contract_id.originated | +---------------+----------------------+--------------------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+--------------------------------------+ @@ -94768,7 +95926,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | pk | Determined from data | $public_key | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218248 | + | metadata | Determined from data | $X_218190 | +---------------+----------------------+------------------------+ @@ -94790,7 +95948,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_218114 | + | metadata | Determined from data | $X_218056 | +---------------+----------------------+------------------------+ @@ -94822,7 +95980,7 @@ Protocol Lima +----------------------------------+----------------------+-------------------------------------+ | burn_limit | Determined from data | $N.t | +----------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_217980 | + | metadata | Determined from data | $X_217922 | +----------------------------------+----------------------+-------------------------------------+ @@ -94846,9 +96004,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | commitment | Determined from data | $X_107700 | + | commitment | Determined from data | $X_107671 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -94872,7 +96030,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -94896,7 +96054,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217442 | + | metadata | Determined from data | $X_217384 | +---------------+----------------------+------------------------+ @@ -94920,7 +96078,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_217442 | + | metadata | Determined from data | $X_217384 | +---------------+----------------------+------------------------+ @@ -94946,7 +96104,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | level | 4 bytes | signed 32-bit integer | +------------------------------+----------------------+-------------------------+ - | message | Determined from data | $X_107698 | + | message | Determined from data | $X_107669 | +------------------------------+----------------------+-------------------------+ | message_position | Determined from data | $N.t | +------------------------------+----------------------+-------------------------+ @@ -94960,7 +96118,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | message_result_path | Variable | sequence of bytes | +------------------------------+----------------------+-------------------------+ - | previous_message_result | 64 bytes | $X_107699 | + | previous_message_result | 64 bytes | $X_107670 | +------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------+----------------------+-------------------------+ @@ -94970,7 +96128,7 @@ Protocol Lima +------------------------------+----------------------+-------------------------+ | proof | Variable | bytes | +------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +------------------------------+----------------------+-------------------------+ @@ -95006,9 +96164,9 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | tickets_info | Variable | sequence of $X_107694 | + | tickets_info | Variable | sequence of $X_107665 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -95048,7 +96206,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------+ | entrypoint | Variable | bytes | +-----------------------+----------------------+---------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +-----------------------+----------------------+---------------------------+ @@ -95070,7 +96228,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | storage_limit | Determined from data | $N.t | +-----------------------+----------------------+---------------------------------------------------------------+ - | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107693) | + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_107664) | +-----------------------+----------------------+---------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -95084,7 +96242,7 @@ Protocol Lima +-----------------------+----------------------+---------------------------------------------------------------+ | parameters_ty | Variable | bytes | +-----------------------+----------------------+---------------------------------------------------------------+ - | metadata | Determined from data | $X_216900 | + | metadata | Determined from data | $X_216842 | +-----------------------+----------------------+---------------------------------------------------------------+ @@ -95112,9 +96270,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | message | Variable | sequence of $X_12 | + | message | Variable | sequence of $X_10 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216767 | + | metadata | Determined from data | $X_216709 | +------------------------------------------------+----------------------+-------------------------+ @@ -95142,7 +96300,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | commitment | 32 bytes | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216638 | + | metadata | Determined from data | $X_216580 | +------------------------------------------------+----------------------+-------------------------+ @@ -95168,9 +96326,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | commitment | 76 bytes | $X_107691 | + | commitment | 76 bytes | $X_107662 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_216504 | + | metadata | Determined from data | $X_216446 | +------------------------------------------------+----------------------+-------------------------+ @@ -95200,9 +96358,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------------------+ | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | +------------------------------------------------+----------------------+-------------------------------------+ - | refutation | Determined from data | $X_42 | + | refutation | Determined from data | $X_13 | +------------------------------------------------+----------------------+-------------------------------------+ - | metadata | Determined from data | $X_108538 | + | metadata | Determined from data | $X_108480 | +------------------------------------------------+----------------------+-------------------------------------+ @@ -95228,9 +96386,9 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | rollup | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | stakers | 42 bytes | $X_41 | + | stakers | 42 bytes | $X_12 | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108538 | + | metadata | Determined from data | $X_108480 | +------------------------------------------------+----------------------+-------------------------+ @@ -95262,7 +96420,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | output_proof | Variable | bytes | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108403 | + | metadata | Determined from data | $X_108345 | +------------------------------------------------+----------------------+-------------------------+ @@ -95286,7 +96444,7 @@ Protocol Lima +---------------+----------------------+------------------------+ | rollup | 20 bytes | bytes | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108269 | + | metadata | Determined from data | $X_108211 | +---------------+----------------------+------------------------+ @@ -95314,7 +96472,7 @@ Protocol Lima +------------------------------------------------+----------------------+-------------------------+ | slot_index | 1 byte | unsigned 8-bit integer | +------------------------------------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_108141 | + | metadata | Determined from data | $X_108083 | +------------------------------------------------+----------------------+-------------------------+ @@ -95336,9 +96494,9 @@ Protocol Lima +---------------+----------------------+------------------------+ | storage_limit | Determined from data | $N.t | +---------------+----------------------+------------------------+ - | slot | 53 bytes | $X_40 | + | slot | 53 bytes | $X_11 | +---------------+----------------------+------------------------+ - | metadata | Determined from data | $X_108013 | + | metadata | Determined from data | $X_107955 | +---------------+----------------------+------------------------+ @@ -95364,7 +96522,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ - | circuits_info | Variable | sequence of $X_38 | + | circuits_info | Variable | sequence of $X_9 | +-----------------------+----------------------+--------------------------------------------------------------+ | # bytes in next field | 4 bytes | unsigned 30-bit integer | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -95372,7 +96530,7 @@ Protocol Lima +-----------------------+----------------------+--------------------------------------------------------------+ | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | +-----------------------+----------------------+--------------------------------------------------------------+ - | metadata | Determined from data | $X_107878 | + | metadata | Determined from data | $X_107820 | +-----------------------+----------------------+--------------------------------------------------------------+ @@ -95400,11 +96558,11 @@ Protocol Lima +-----------------------+----------------------+-------------------------+ | op | Variable | sequence of $X_0 | +-----------------------+----------------------+-------------------------+ - | metadata | Determined from data | $X_107710 | + | metadata | Determined from data | $X_107681 | +-----------------------+----------------------+-------------------------+ - X_219432 (Determined from data, 8-bit tag) + X_219374 (Determined from data, 8-bit tag) ****************************************** Operation_with_metadata (tag 0) @@ -95443,7 +96601,7 @@ Protocol Lima +---------------------------------+----------+----------------------------------------------------+ - X_434841 (Variable, 8-bit tag) + X_434725 (Variable, 8-bit tag) ****************************** Operation with too large metadata (tag 0) @@ -95482,7 +96640,7 @@ Protocol Lima +=================+======================+========================+ | Tag | 1 byte | unsigned 8-bit integer | +-----------------+----------------------+------------------------+ - | Unnamed field 0 | Determined from data | $X_219432 | + | Unnamed field 0 | Determined from data | $X_219374 | +-----------------+----------------------+------------------------+ </pre> @@ -95569,6 +96727,43 @@ Protocol Lima +.. _GET_..--block_id--resulting_context_hash : + +**GET ../<block_id>/resulting_context_hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashdescr', 'GET_..--block_id--resulting_context_hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.json', 'GET_..--block_id--resulting_context_hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.bin', 'GET_..--block_id--resulting_context_hash')">Binary output</button> + </div><div id="GET_..--block_id--resulting_context_hashdescr" class="GET_..--block_id--resulting_context_hash tabcontent"> + <p> + Context hash resulting of the block application.</p> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.json" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + $unistring + /* A hash of context (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.bin" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + +--------------+----------+----------+ + | Name | Size | Contents | + +==============+==========+==========+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+----------+ + + + </pre> + </div> + + + .. _GET_..--block_id--votes--ballot_list : **GET ../<block_id>/votes/ballot_list** @@ -95584,9 +96779,9 @@ Protocol Lima </div> <div id="GET_..--block_id--votes--ballot_listoutput.json" class="GET_..--block_id--votes--ballot_list tabcontent"> <pre> - [ { "pkh": $Signature.Public_key_hash, + [ { "pkh": $Signature.V0.Public_key_hash, "ballot": "nay" | "yay" | "pass" } ... ] - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $unistring: @@ -95934,9 +97129,9 @@ Protocol Lima </div> <div id="GET_..--block_id--votes--listingsoutput.json" class="GET_..--block_id--votes--listings tabcontent"> <pre> - [ { "pkh": $Signature.Public_key_hash, + [ { "pkh": $Signature.V0.Public_key_hash, "voting_power": $int64 } ... ] - $Signature.Public_key_hash: + $Signature.V0.Public_key_hash: /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */ $unistring $int64: diff --git a/docs/mumbai/rpc.rst b/docs/mumbai/rpc.rst new file mode 100644 index 000000000000..2bcfe194a92c --- /dev/null +++ b/docs/mumbai/rpc.rst @@ -0,0 +1,72659 @@ +.. raw:: html + + + <style> + .wy-nav-content { + max-width: 100%; + } + .tab { + overflow: hidden; + border: 1px solid #ccc; + background-color: #f1f1f1; + } + .tab button { + background-color: inherit; + float: left; + border: none; + outline: none; + cursor: pointer; + padding: 5px 10px; + } + .tab button:hover { + background-color: #ddd; + } + .tab button.active { + background-color: #ccc; + } + .tabcontent { + display: none; + padding: 6px 12px; + border: 1px solid #ccc; + border-top: none; + max-height: 40ex; + margin-bottom: 7ex; + overflow: auto; + } + .tabcontent p { + margin-bottom: 12px; + } + pre { + font-size: 12px + } + .rst-content .section ul p { + margin-bottom: 0; + } + span.query { + font-family: monospace; + white-space: pre; + } + </style> + + + +.. raw:: html + + + <script> + function showTab(elt, tab, ref) { + var i, tabcontent, tablinks; + tabcontent = document.getElementsByClassName(ref); + for (i = 0; i < tabcontent.length; i++) { + tabcontent[i].style.display = 'none'; + } + + tablinks = elt.parentNode.children; + for (i = 0; i < tablinks.length; i++) { + tablinks[i].className = tablinks[i].className.replace(' active', ''); + } + + document.getElementById(tab).style.display = 'block'; + elt.className += ' active'; + } + + document.addEventListener('DOMContentLoaded', function() { + var a = document.getElementsByClassName('defaultOpen'); + for (i = 0; i < a.length; i++) { a[i].click() } + }) + </script> + + + +.. _rpc_index_mumbai : + +RPCs - Reference +################ + +.. include:: /include/rpc_introduction.rst.inc + +Protocol Mumbai +=============== + +* ../<block_id> (`GET <GET_..--block_id_>`_) + + * ../<block_id>/context + + * ../<block_id>/context/big_maps + + * ../<block_id>/context/big_maps/<big_map_id> (`GET <GET_..--block_id--context--big_maps--big_map_id_>`_) + + * ../<block_id>/context/big_maps/<big_map_id>/<script_expr> (`GET <GET_..--block_id--context--big_maps--big_map_id--script_expr_>`_) + + * ../<block_id>/context/cache + + * ../<block_id>/context/cache/contracts + + * ../<block_id>/context/cache/contracts/all (`GET <GET_..--block_id--context--cache--contracts--all_>`_) + + * ../<block_id>/context/cache/contracts/rank (`POST <POST_..--block_id--context--cache--contracts--rank_>`_) + + * ../<block_id>/context/cache/contracts/size (`GET <GET_..--block_id--context--cache--contracts--size_>`_) + + * ../<block_id>/context/cache/contracts/size_limit (`GET <GET_..--block_id--context--cache--contracts--size_limit_>`_) + + * ../<block_id>/context/constants (`GET <GET_..--block_id--context--constants_>`_) + + * ../<block_id>/context/constants/errors (`GET <GET_..--block_id--context--constants--errors_>`_) + + * ../<block_id>/context/constants/parametric (`GET <GET_..--block_id--context--constants--parametric_>`_) + + * ../<block_id>/context/contracts (`GET <GET_..--block_id--context--contracts_>`_) + + * ../<block_id>/context/contracts/<contract_id> (`GET <GET_..--block_id--context--contracts--contract_id_>`_) + + * ../<block_id>/context/contracts/<contract_id>/balance (`GET <GET_..--block_id--context--contracts--contract_id--balance_>`_) + + * ../<block_id>/context/contracts/<contract_id>/balance_and_frozen_bonds (`GET <GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds_>`_) + + * ../<block_id>/context/contracts/<contract_id>/big_map_get (`POST <POST_..--block_id--context--contracts--contract_id--big_map_get_>`_) + + * ../<block_id>/context/contracts/<contract_id>/counter (`GET <GET_..--block_id--context--contracts--contract_id--counter_>`_) + + * ../<block_id>/context/contracts/<contract_id>/delegate (`GET <GET_..--block_id--context--contracts--contract_id--delegate_>`_) + + * ../<block_id>/context/contracts/<contract_id>/entrypoints (`GET <GET_..--block_id--context--contracts--contract_id--entrypoints_>`_) + + * ../<block_id>/context/contracts/<contract_id>/entrypoints/<entrypoint> (`GET <GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint_>`_) + + * ../<block_id>/context/contracts/<contract_id>/frozen_bonds (`GET <GET_..--block_id--context--contracts--contract_id--frozen_bonds_>`_) + + * ../<block_id>/context/contracts/<contract_id>/manager_key (`GET <GET_..--block_id--context--contracts--contract_id--manager_key_>`_) + + * ../<block_id>/context/contracts/<contract_id>/script (`GET <GET_..--block_id--context--contracts--contract_id--script_>`_) + + * ../<block_id>/context/contracts/<contract_id>/single_sapling_get_diff (`GET <GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff_>`_) + + * ../<block_id>/context/contracts/<contract_id>/storage (`GET <GET_..--block_id--context--contracts--contract_id--storage_>`_) + + * ../<block_id>/context/delegates (`GET <GET_..--block_id--context--delegates_>`_) + + * ../<block_id>/context/delegates/<pkh> (`GET <GET_..--block_id--context--delegates--pkh_>`_) + + * ../<block_id>/context/delegates/<pkh>/consensus_key (`GET <GET_..--block_id--context--delegates--pkh--consensus_key_>`_) + + * ../<block_id>/context/delegates/<pkh>/current_frozen_deposits (`GET <GET_..--block_id--context--delegates--pkh--current_frozen_deposits_>`_) + + * ../<block_id>/context/delegates/<pkh>/deactivated (`GET <GET_..--block_id--context--delegates--pkh--deactivated_>`_) + + * ../<block_id>/context/delegates/<pkh>/delegated_balance (`GET <GET_..--block_id--context--delegates--pkh--delegated_balance_>`_) + + * ../<block_id>/context/delegates/<pkh>/delegated_contracts (`GET <GET_..--block_id--context--delegates--pkh--delegated_contracts_>`_) + + * ../<block_id>/context/delegates/<pkh>/frozen_deposits (`GET <GET_..--block_id--context--delegates--pkh--frozen_deposits_>`_) + + * ../<block_id>/context/delegates/<pkh>/frozen_deposits_limit (`GET <GET_..--block_id--context--delegates--pkh--frozen_deposits_limit_>`_) + + * ../<block_id>/context/delegates/<pkh>/full_balance (`GET <GET_..--block_id--context--delegates--pkh--full_balance_>`_) + + * ../<block_id>/context/delegates/<pkh>/grace_period (`GET <GET_..--block_id--context--delegates--pkh--grace_period_>`_) + + * ../<block_id>/context/delegates/<pkh>/participation (`GET <GET_..--block_id--context--delegates--pkh--participation_>`_) + + * ../<block_id>/context/delegates/<pkh>/staking_balance (`GET <GET_..--block_id--context--delegates--pkh--staking_balance_>`_) + + * ../<block_id>/context/delegates/<pkh>/voting_info (`GET <GET_..--block_id--context--delegates--pkh--voting_info_>`_) + + * ../<block_id>/context/delegates/<pkh>/voting_power (`GET <GET_..--block_id--context--delegates--pkh--voting_power_>`_) + + * ../<block_id>/context/liquidity_baking + + * ../<block_id>/context/liquidity_baking/cpmm_address (`GET <GET_..--block_id--context--liquidity_baking--cpmm_address_>`_) + + * ../<block_id>/context/merkle_tree (`GET <GET_..--block_id--context--merkle_tree_>`_) + + * ../<block_id>/context/merkle_tree_v2 (`GET <GET_..--block_id--context--merkle_tree_v2_>`_) + + * ../<block_id>/context/nonces + + * ../<block_id>/context/nonces/<block_level> (`GET <GET_..--block_id--context--nonces--block_level_>`_) + + * ../<block_id>/context/raw + + * ../<block_id>/context/raw/bytes (`GET <GET_..--block_id--context--raw--bytes_>`_) + + * ../<block_id>/context/raw/json (<dyn>) + + * ../<block_id>/context/sapling + + * ../<block_id>/context/sapling/<sapling_state_id> + + * ../<block_id>/context/sapling/<sapling_state_id>/get_diff (`GET <GET_..--block_id--context--sapling--sapling_state_id--get_diff_>`_) + + * ../<block_id>/context/seed (`POST <POST_..--block_id--context--seed_>`_) + + * ../<block_id>/context/seed_computation (`GET <GET_..--block_id--context--seed_computation_>`_) + + * ../<block_id>/context/selected_snapshot (`GET <GET_..--block_id--context--selected_snapshot_>`_) + + * ../<block_id>/context/tx_rollup + + * ../<block_id>/context/tx_rollup/<tx_rollup_id> + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/commitment + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/commitment/<block_level> (`GET <GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level_>`_) + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/inbox + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/inbox/<block_level> (`GET <GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level_>`_) + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/pending_bonded_commitments + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/pending_bonded_commitments/<pkh> (`GET <GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh_>`_) + + * ../<block_id>/context/tx_rollup/<tx_rollup_id>/state (`GET <GET_..--block_id--context--tx_rollup--tx_rollup_id--state_>`_) + + * ../<block_id>/hash (`GET <GET_..--block_id--hash_>`_) + + * ../<block_id>/header (`GET <GET_..--block_id--header_>`_) + + * ../<block_id>/header/protocol_data (`GET <GET_..--block_id--header--protocol_data_>`_) + + * ../<block_id>/header/protocol_data/raw (`GET <GET_..--block_id--header--protocol_data--raw_>`_) + + * ../<block_id>/header/raw (`GET <GET_..--block_id--header--raw_>`_) + + * ../<block_id>/header/shell (`GET <GET_..--block_id--header--shell_>`_) + + * ../<block_id>/helpers + + * ../<block_id>/helpers/complete + + * ../<block_id>/helpers/complete/<prefix> (`GET <GET_..--block_id--helpers--complete--prefix_>`_) + + * ../<block_id>/helpers/forge_block_header (`POST <POST_..--block_id--helpers--forge_block_header_>`_) + + * ../<block_id>/helpers/preapply + + * ../<block_id>/helpers/preapply/block (`POST <POST_..--block_id--helpers--preapply--block_>`_) + + * ../<block_id>/helpers/preapply/operations (`POST <POST_..--block_id--helpers--preapply--operations_>`_) + + * ../<block_id>/live_blocks (`GET <GET_..--block_id--live_blocks_>`_) + + * ../<block_id>/metadata (`GET <GET_..--block_id--metadata_>`_) + + * ../<block_id>/metadata_hash (`GET <GET_..--block_id--metadata_hash_>`_) + + * ../<block_id>/operation_hashes (`GET <GET_..--block_id--operation_hashes_>`_) + + * ../<block_id>/operation_hashes/<list_offset> (`GET <GET_..--block_id--operation_hashes--list_offset_>`_) + + * ../<block_id>/operation_hashes/<list_offset>/<operation_offset> (`GET <GET_..--block_id--operation_hashes--list_offset--operation_offset_>`_) + + * ../<block_id>/operation_metadata_hashes (`GET <GET_..--block_id--operation_metadata_hashes_>`_) + + * ../<block_id>/operation_metadata_hashes/<list_offset> (`GET <GET_..--block_id--operation_metadata_hashes--list_offset_>`_) + + * ../<block_id>/operation_metadata_hashes/<list_offset>/<operation_offset> (`GET <GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset_>`_) + + * ../<block_id>/operations (`GET <GET_..--block_id--operations_>`_) + + * ../<block_id>/operations/<list_offset> (`GET <GET_..--block_id--operations--list_offset_>`_) + + * ../<block_id>/operations/<list_offset>/<operation_offset> (`GET <GET_..--block_id--operations--list_offset--operation_offset_>`_) + + * ../<block_id>/operations_metadata_hash (`GET <GET_..--block_id--operations_metadata_hash_>`_) + + * ../<block_id>/protocols (`GET <GET_..--block_id--protocols_>`_) + + * ../<block_id>/resulting_context_hash (`GET <GET_..--block_id--resulting_context_hash_>`_) + + * ../<block_id>/votes + + * ../<block_id>/votes/ballot_list (`GET <GET_..--block_id--votes--ballot_list_>`_) + + * ../<block_id>/votes/ballots (`GET <GET_..--block_id--votes--ballots_>`_) + + * ../<block_id>/votes/current_period (`GET <GET_..--block_id--votes--current_period_>`_) + + * ../<block_id>/votes/current_proposal (`GET <GET_..--block_id--votes--current_proposal_>`_) + + * ../<block_id>/votes/current_quorum (`GET <GET_..--block_id--votes--current_quorum_>`_) + + * ../<block_id>/votes/listings (`GET <GET_..--block_id--votes--listings_>`_) + + * ../<block_id>/votes/proposals (`GET <GET_..--block_id--votes--proposals_>`_) + + * ../<block_id>/votes/successor_period (`GET <GET_..--block_id--votes--successor_period_>`_) + + * ../<block_id>/votes/total_voting_power (`GET <GET_..--block_id--votes--total_voting_power_>`_) + +RPCs - Full description +*********************** + +Protocol Mumbai +=============== + +.. _GET_..--block_id : + +**GET ../<block_id>?[force_metadata]&[metadata=<metadata_rpc_arg>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_iddescr', 'GET_..--block_id')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_idoutput.json', 'GET_..--block_id')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_idoutput.bin', 'GET_..--block_id')">Binary output</button> + </div><div id="GET_..--block_iddescr" class="GET_..--block_id tabcontent"> + <p> + All the information about a block. The associated metadata may not be present depending on the history mode and block's distance from the head.</p> <p>Optional query arguments :<ul><li><span class="query">force_metadata</span> : DEPRECATED: Forces to recompute the operations metadata if it was considered as too large.</li><li><span class="query">metadata = <metadata_rpc_arg></span> : Specifies whether or not if the operations metadata should be returned. To get the metadata, even if it is needed to recompute them, use "always". To avoid getting the metadata, use "never". By default, the metadata will be returned depending on the node's metadata size limit policy.</li></ul></p> + </div> + <div id="GET_..--block_idoutput.json" class="GET_..--block_id tabcontent"> + <pre> + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $block_hash, + "header": $raw_block_header, + "metadata"?: $block_header_metadata, + "operations": [ [ $operation ... ] ... ] } + $016-PtMumbai.apply_internal_results.alpha.operation_result: + { /* transaction */ + "kind": "transaction", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.transaction_destination, + "parameters"?: { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.transaction } + || { /* origination */ + "kind": "origination", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.origination } + || { /* delegation */ + "kind": "delegation", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "delegate"?: $Signature.Public_key_hash, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.delegation } + || { /* event */ + "kind": "event", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "type": $micheline.016-PtMumbai.michelson_v1.expression, + "tag"?: $016-PtMumbai.entrypoint, + "payload"?: $micheline.016-PtMumbai.michelson_v1.expression, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.event } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.error: + /* The full list of RPC errors would be too long to include. + It is available at RPC `/errors` (GET). + Errors specific to protocol Alpha have an id that starts with + `proto.alpha`. */ + any + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.operation.alpha.contents_and_signature: + { "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation.alpha.internal_operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.event: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.internal_operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_contents_and_result: + { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "endorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "preendorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31], + "metadata": { "delegate": $Signature.Public_key_hash } } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ], + "metadata": { } } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass", + "metadata": { } } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.reveal, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transaction, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.delegation, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.register_global_constant, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "allocated_destination_contract"?: boolean } } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.operation_result.register_global_constant: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + $016-PtMumbai.operation.alpha.operation_result.reveal: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_with_metadata: + { /* Operation_with_metadata */ + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* Operation_without_metadata */ + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation.alpha.successful_manager_operation_result: + { /* reveal */ + "kind": "reveal", + "consumed_milligas"?: $positive_bignum } + || /* transaction */ + { /* To_contract */ + "kind": "transaction", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "kind": "transaction", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "kind": "transaction", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* origination */ + "kind": "origination", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* delegation */ + "kind": "delegation", + "consumed_milligas"?: $positive_bignum } + || { /* update_consensus_key */ + "kind": "update_consensus_key", + "consumed_milligas"?: $positive_bignum } + || { /* set_deposits_limit */ + "kind": "set_deposits_limit", + "consumed_milligas"?: $positive_bignum } + || { /* increase_paid_storage */ + "kind": "increase_paid_storage", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* sc_rollup_originate */ + "kind": "sc_rollup_originate", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $block_header_metadata: + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "next_protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "test_chain_status": $test_chain_status, + "max_operations_ttl": integer ∈ [-2^30, 2^30], + "max_operation_data_length": integer ∈ [-2^30, 2^30], + "max_block_header_length": integer ∈ [-2^30, 2^30], + "max_operation_list_length": + [ { "max_size": integer ∈ [-2^30, 2^30], + "max_op"?: integer ∈ [-2^30, 2^30] } ... ], + "proposer": $Signature.Public_key_hash, + "baker": $Signature.Public_key_hash, + "level_info": + { "level": + integer ∈ [-2^31-1, 2^31] + /* The level of the block relative to genesis. This is also the + Shell's notion of level. */, + "level_position": + integer ∈ [-2^31-1, 2^31] + /* The level of the block relative to the successor of the + genesis block. More precisely, it is the position of the block + relative to the block that starts the "Alpha family" of + protocols, which includes all protocols except Genesis (that + is, from 001 onwards). */, + "cycle": + integer ∈ [-2^31-1, 2^31] + /* The current cycle's number. Note that cycles are a + protocol-specific notion. As a result, the cycle number starts + at 0 with the first block of the Alpha family of protocols. */, + "cycle_position": + integer ∈ [-2^31-1, 2^31] + /* The current level of the block relative to the first block of + the current cycle. */, + "expected_commitment": + boolean + /* Tells whether the baker of this block has to commit a seed + nonce hash. */ }, + "voting_period_info": + { "voting_period": + { /* The voting period to which the block belongs. */ + "index": + integer ∈ [-2^31-1, 2^31] + /* The voting period's index. Starts at 0 with the first + block of the Alpha family of protocols. */, + "kind": + /* One of the several kinds of periods in the voting + procedure. */ + "proposal" + || "exploration" + || "cooldown" + || "promotion" + || "adoption", + "start_position": + integer ∈ [-2^31-1, 2^31] + /* The relative position of the first level of the period + with respect to the first level of the Alpha family of + protocols. */ }, + "position": + integer ∈ [-2^31-1, 2^31] + /* The position of the block within the voting period. */, + "remaining": + integer ∈ [-2^31-1, 2^31] + /* The number of blocks remaining till the end of the voting + period. */ }, + "nonce_hash": $cycle_nonce /* Some */ || null /* None */, + "deactivated": [ $Signature.Public_key_hash ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], + "implicit_operations_results": + [ $016-PtMumbai.operation.alpha.successful_manager_operation_result ... ], + "proposer_consensus_key": $Signature.Public_key_hash, + "baker_consensus_key": $Signature.Public_key_hash, + "consumed_milligas": $positive_bignum, + "dal_attestation"?: $bignum } + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $operation: + { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1, + "metadata": "too large" } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $raw_block_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $test_chain_status: + /* The status of the test chain: not_running (there is no test chain at + the moment), forking (the test chain is being setup), running (the + test chain is running). */ + { /* Not_running */ + "status": "not_running" } + || { /* Forking */ + "status": "forking", + "protocol": $Protocol_hash, + "expiration": $timestamp.protocol } + || { /* Running */ + "status": "running", + "chain_id": $Chain_id, + "genesis": $block_hash, + "protocol": $Protocol_hash, + "expiration": $timestamp.protocol } + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_idoutput.bin" class="GET_..--block_id tabcontent"> + <pre> + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | chain_id | 4 bytes | bytes | + +--------------------------------+----------------------+-------------------------------------+ + | hash | 32 bytes | bytes | + +--------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | header | Variable | $raw_block_header | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "metadata" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_0 | + +--------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | operations | Variable | sequence of $X_78 | + +--------------------------------+----------------------+-------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + raw_block_header + **************** + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + test_chain_status (Determined from data, 8-bit tag) + *************************************************** + + Not_running (tag 0) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Forking (tag 1) + =============== + + +------------+----------+------------------------+ + | Name | Size | Contents | + +============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------+----------+------------------------+ + | protocol | 32 bytes | bytes | + +------------+----------+------------------------+ + | expiration | 8 bytes | signed 64-bit integer | + +------------+----------+------------------------+ + + + Running (tag 2) + =============== + + +------------+----------+------------------------+ + | Name | Size | Contents | + +============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------+----------+------------------------+ + | chain_id | 4 bytes | bytes | + +------------+----------+------------------------+ + | genesis | 32 bytes | bytes | + +------------+----------+------------------------+ + | protocol | 32 bytes | bytes | + +------------+----------+------------------------+ + | expiration | 8 bytes | signed 64-bit integer | + +------------+----------+------------------------+ + + + X_2 + *** + + +------------------------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==============================+=========+==============================================================+ + | max_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------------+---------+--------------------------------------------------------------+ + | ? presence of field "max_op" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+---------+--------------------------------------------------------------+ + | max_op | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------------+---------+--------------------------------------------------------------+ + + + X_1 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_3 + *** + + +---------------------+---------+-------------------------------------+ + | Name | Size | Contents | + +=====================+=========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | level_position | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | cycle | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | cycle_position | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | expected_commitment | 1 byte | boolean (0 for false, 255 for true) | + +---------------------+---------+-------------------------------------+ + + + X_6 (1 byte, 8-bit tag) + *********************** + + Proposal (tag 0) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + exploration (tag 1) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Cooldown (tag 2) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Promotion (tag 3) + ================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Adoption (tag 4) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_5 + *** + + +----------------+---------+-----------------------+ + | Name | Size | Contents | + +================+=========+=======================+ + | index | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + | kind | 1 byte | $X_6 | + +----------------+---------+-----------------------+ + | start_position | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + + + X_4 + *** + + +---------------+---------+-----------------------+ + | Name | Size | Contents | + +===============+=========+=======================+ + | voting_period | 9 bytes | $X_5 | + +---------------+---------+-----------------------+ + | position | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + | remaining | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + + + X_7 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | cycle_nonce | 32 bytes | bytes | + +-------------+----------+------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_9 (Determined from data, 8-bit tag) + ************************************* + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_10 (1 byte, 8-bit tag) + ************************ + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_8 + *** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_9 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_10 | + +-----------------+----------------------+-----------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_21 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_20 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_21 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_26 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_20 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_20 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_20 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_27 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_38 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_27 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_27 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_27 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_39 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_38 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_26 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_39 | + +-----------------------+----------+-------------------------+ + + + X_41 + **** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_44 + **** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_40 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_41 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_44 | + +-----------------------+----------------------+-------------------------+ + + + X_77 (Determined from data, 8-bit tag) + ************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_40 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_40 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.successful_manager_operation_result (Determined from data, 8-bit tag) + ************************************************************************************************** + + reveal (tag 0) + ============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + transaction (tag 1) + =================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_77 | + +-----------------+----------------------+------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + delegation (tag 3) + ================== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + set_deposits_limit (tag 5) + ========================== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + update_consensus_key (tag 6) + ============================ + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + increase_paid_storage (tag 9) + ============================= + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + sc_rollup_originate (tag 200) + ============================= + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + X_0 + *** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+===============================================================================+ + | # bytes in next 22 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | test_chain_status | Determined from data | $test_chain_status | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operations_ttl | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operation_data_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_block_header_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operation_list_length | Determined from data | $X_1 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | proposer | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | baker | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | level_info | 17 bytes | $X_3 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | voting_period_info | 17 bytes | $X_4 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | nonce_hash | Determined from data | $X_7 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | deactivated | Variable | sequence of $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | liquidity_baking_toggle_ema | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | implicit_operations_results | Variable | sequence of $016-PtMumbai.operation.alpha.successful_manager_operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | proposer_consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | baker_consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | dal_attestation | Variable | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + + + X_81 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_82 + **** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_80 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_81 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_82 | + +-----------------+----------------------+----------+ + + + X_85 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_83 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_81 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_85 | + +-----------------+----------------------+----------+ + + + X_86 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_79 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_80 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_83 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_86 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + X_89 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_88 + **** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_89 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + X_92 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_87 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_88 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_92 | + +-----------------+----------------------+----------+ + + + X_95 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_93 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_81 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_95 | + +-----------------+----------------------+----------+ + + + X_96 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_97 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_99 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_100 (Determined from data, 8-bit tag) + *************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_99 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_101 (Determined from data, 8-bit tag) + *************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_100 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_102 + ***** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_103 (Determined from data, 8-bit tag) + *************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_102 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_101 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_98 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_103 | + +--------+----------------------+----------+ + + + X_104 + ***** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_106 (Enumeration: unsigned 8-bit integer): + ******************************************** + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_108 (Determined from data, 8-bit tag) + *************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_107 + ***** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_108 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_109 + ***** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_108 | + +-------------+----------------------+------------------+ + + + X_111 (Determined from data, 8-bit tag) + *************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_109 | + +---------+----------------------+------------------------+ + + + X_112 + ***** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_114 (Determined from data, 8-bit tag) + *************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_113 + ***** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_114 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_115 + ***** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_116 + ***** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents (Determined from data, 8-bit tag) + *********************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bh1 | Variable | $raw_block_header | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bh2 | Variable | $raw_block_header | + +-----------------------+----------+-------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_116 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_115 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_113 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_111 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_112 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_107 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_106) | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_81 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_104 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_98 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_97 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_96 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_93 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_87 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_79 | + +---------------+----------------------+------------------------+ + + + X_129 + ***** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_update (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.event (Determined from data, 8-bit tag) + ********************************************************************************************** + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.origination (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + X_226 (Determined from data, 8-bit tag) + *************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_receipt | Variable | sequence of $X_40 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_receipt | Variable | sequence of $X_40 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.transaction (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_226 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_226 | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.apply_internal_results.alpha.operation_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + transaction (tag 1) + =================== + + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.transaction_destination | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | parameters | Determined from data | $X_115 | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.transaction | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + + + delegation (tag 3) + ================== + + +--------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------+----------------------+---------------------------------------------------------------+ + + + event (tag 4) + ============= + + +-------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "tag" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | tag | Determined from data | $016-PtMumbai.entrypoint | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "payload" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | payload | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +-------------------------------+----------------------+---------------------------------------------------------------+ + + + X_125 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_271 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_414 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_555 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_689 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message (Determined from data, 8-bit tag) + **************************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_40 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ticket_updates | Variable | sequence of $X_40 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_829 + ***** + + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=================================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + + + X_985 (1 byte, 8-bit tag) + ************************* + + Conflict_resolved (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Timeout (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_986 (Determined from data, 8-bit tag) + *************************************** + + Loser (tag 0) + ============= + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | reason | 1 byte | $X_985 | + +--------+----------+------------------------+ + | player | 21 bytes | $public_key_hash | + +--------+----------+------------------------+ + + + Draw (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_987 (Determined from data, 8-bit tag) + *************************************** + + Ongoing (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Ended (tag 1) + ============= + + +--------+----------------------+------------------------+ + | Name | Size | Contents | + +========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------------------+------------------------+ + | result | Determined from data | $X_986 | + +--------+----------------------+------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | game_status | Determined from data | $X_987 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | game_status | Determined from data | $X_987 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_980 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1279 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------------------+ + + + X_1419 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate (Determined from data, 8-bit tag) + *************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1689 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment (Determined from data, 8-bit tag) + *********************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2265 + ****** + + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+============================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2827 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2967 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.register_global_constant (Determined from data, 8-bit tag) + ******************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_3515 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.register_global_constant | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3789 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.transaction (Determined from data, 8-bit tag) + ******************************************************************************************* + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_77 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_81 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_129 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_77 | + +------------------------------+----------------------+-------------------------------------+ + + + X_3970 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.transaction | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_4314 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | endorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4318 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | preendorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4322 + ****** + + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+=====================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_8 | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.operation_metadata.alpha.balance_updates + ***************************************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_8 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | nonce | 32 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh1 | Variable | $raw_block_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh2 | Variable | $raw_block_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | pkh | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | secret | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | solution | 200 bytes | $X_116 | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_4322 | + +---------------+----------------------+------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4318 | + +--------------------+----------------------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4314 | + +--------------------+----------------------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + | metadata | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_555 | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_115 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3970 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3789 | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_555 | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_3515 | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_555 | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + | metadata | Determined from data | $X_689 | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_555 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2967 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_2827 | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_113 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_689 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_689 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2265 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2265 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_111 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_112 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_689 | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_107 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_125 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | metadata | Determined from data | $X_829 | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_106) | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | metadata | Determined from data | $X_1689 | + +-----------------------+----------------------+------------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_81 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_555 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1419 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_104 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1279 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_98 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_980 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_97 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_980 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_829 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_689 | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_96 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_555 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_93 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_414 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_87 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_271 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_79 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_125 | + +---------------+----------------------+------------------------+ + + + X_4345 (Variable, 8-bit tag) + **************************** + + Operation_with_metadata (tag 0) + =============================== + + +-----------------------+----------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.operation_contents_and_result | + +-----------------------+----------+-------------------------------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------+ + + + Operation_without_metadata (tag 1) + ================================== + + +-----------------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+====================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.contents | + +-----------------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+----------------------------------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bh1 | Variable | $raw_block_header | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bh2 | Variable | $raw_block_header | + +-----------------------+----------+-------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_116 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_115 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_113 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_111 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_112 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_107 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+------------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_106) | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+------------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+------------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_81 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_104 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_98 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_97 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_96 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_93 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_87 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_79 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + X_4422 (Variable, 8-bit tag) + **************************** + + Operation with too large metadata (tag 0) + ========================================= + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation without metadata (tag 1) + ================================== + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation with metadata (tag 2) + =============================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | Variable | $X_4345 | + +-----------------+----------+------------------------+ + + + operation + ********* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | chain_id | 4 bytes | bytes | + +-----------------------+----------+-------------------------+ + | hash | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | $X_4422 | + +-----------------------+----------+-------------------------+ + + + X_78 + **** + + +--------------------------+----------+-------------------------+ + | Name | Size | Contents | + +==========================+==========+=========================+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $operation | + +--------------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--big_maps--big_map_id : + +**GET ../<block_id>/context/big_maps/<big_map_id>?[offset=<uint>]&[length=<uint>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_iddescr', 'GET_..--block_id--context--big_maps--big_map_id')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_idoutput.json', 'GET_..--block_id--context--big_maps--big_map_id')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_idoutput.bin', 'GET_..--block_id--context--big_maps--big_map_id')">Binary output</button> + </div><div id="GET_..--block_id--context--big_maps--big_map_iddescr" class="GET_..--block_id--context--big_maps--big_map_id tabcontent"> + <p> + Get the (optionally paginated) list of values in a big map. Order of values is unspecified, but is guaranteed to be consistent.</p> <p>Optional query arguments :<ul><li><span class="query">offset = <uint></span> : Skip the first [offset] values. Useful in combination with [length] for pagination.</li><li><span class="query">length = <uint></span> : Only retrieve [length] values. Useful in combination with [offset] for pagination.</li></ul></p> + </div> + <div id="GET_..--block_id--context--big_maps--big_map_idoutput.json" class="GET_..--block_id--context--big_maps--big_map_id tabcontent"> + <pre> + [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--big_maps--big_map_idoutput.bin" class="GET_..--block_id--context--big_maps--big_map_id tabcontent"> + <pre> + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--big_maps--big_map_id--script_expr : + +**GET ../<block_id>/context/big_maps/<big_map_id>/<script_expr>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_id--script_exprdescr', 'GET_..--block_id--context--big_maps--big_map_id--script_expr')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_id--script_exproutput.json', 'GET_..--block_id--context--big_maps--big_map_id--script_expr')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--big_maps--big_map_id--script_exproutput.bin', 'GET_..--block_id--context--big_maps--big_map_id--script_expr')">Binary output</button> + </div><div id="GET_..--block_id--context--big_maps--big_map_id--script_exprdescr" class="GET_..--block_id--context--big_maps--big_map_id--script_expr tabcontent"> + <p> + Access the value associated with a key in a big map.</p> + </div> + <div id="GET_..--block_id--context--big_maps--big_map_id--script_exproutput.json" class="GET_..--block_id--context--big_maps--big_map_id--script_expr tabcontent"> + <pre> + $micheline.016-PtMumbai.michelson_v1.expression + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--big_maps--big_map_id--script_exproutput.bin" class="GET_..--block_id--context--big_maps--big_map_id--script_expr tabcontent"> + <pre> + +-----------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================================+ + | Unnamed field 0 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--cache--contracts--all : + +**GET ../<block_id>/context/cache/contracts/all** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--alldescr', 'GET_..--block_id--context--cache--contracts--all')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--alloutput.json', 'GET_..--block_id--context--cache--contracts--all')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--alloutput.bin', 'GET_..--block_id--context--cache--contracts--all')">Binary output</button> + </div><div id="GET_..--block_id--context--cache--contracts--alldescr" class="GET_..--block_id--context--cache--contracts--all tabcontent"> + <p> + Return the list of cached contracts</p> + </div> + <div id="GET_..--block_id--context--cache--contracts--alloutput.json" class="GET_..--block_id--context--cache--contracts--all tabcontent"> + <pre> + [ [ $Contract_hash, integer ∈ [-2^30, 2^30] ] ... ] + $Contract_hash: + /* A contract ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--cache--contracts--alloutput.bin" class="GET_..--block_id--context--cache--contracts--all tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=================+==========+==============================================================+ + | Unnamed field 0 | 20 bytes | bytes | + +-----------------+----------+--------------------------------------------------------------+ + | Unnamed field 1 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------+----------+--------------------------------------------------------------+ + + </pre> + </div> + + + +.. _POST_..--block_id--context--cache--contracts--rank : + +**POST ../<block_id>/context/cache/contracts/rank** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--context--cache--contracts--rankdescr', 'POST_..--block_id--context--cache--contracts--rank')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--cache--contracts--rankinput.json', 'POST_..--block_id--context--cache--contracts--rank')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--cache--contracts--rankinput.bin', 'POST_..--block_id--context--cache--contracts--rank')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--cache--contracts--rankoutput.json', 'POST_..--block_id--context--cache--contracts--rank')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--cache--contracts--rankoutput.bin', 'POST_..--block_id--context--cache--contracts--rank')">Binary output</button> + </div><div id="POST_..--block_id--context--cache--contracts--rankdescr" class="POST_..--block_id--context--cache--contracts--rank tabcontent"> + <p> + Return the number of cached contracts older than the provided contract</p> + </div> + <div id="POST_..--block_id--context--cache--contracts--rankinput.json" class="POST_..--block_id--context--cache--contracts--rank tabcontent"> + <pre> + $unistring + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="POST_..--block_id--context--cache--contracts--rankinput.bin" class="POST_..--block_id--context--cache--contracts--rank tabcontent"> + <pre> + +-----------------+----------+----------+ + | Name | Size | Contents | + +=================+==========+==========+ + | Unnamed field 0 | 22 bytes | $X_0 | + +-----------------+----------+----------+ + + + X_0 (22 bytes, 8-bit tag) + ************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + <div id="POST_..--block_id--context--cache--contracts--rankoutput.json" class="POST_..--block_id--context--cache--contracts--rank tabcontent"> + <pre> + integer ∈ [-2^30, 2^30] /* Some */ || null /* None */</pre> + </div> + <div id="POST_..--block_id--context--cache--contracts--rankoutput.bin" class="POST_..--block_id--context--cache--contracts--rank tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=================+=========+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+--------------------------------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------+---------+--------------------------------------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--cache--contracts--size : + +**GET ../<block_id>/context/cache/contracts/size** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--sizedescr', 'GET_..--block_id--context--cache--contracts--size')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--sizeoutput.json', 'GET_..--block_id--context--cache--contracts--size')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--sizeoutput.bin', 'GET_..--block_id--context--cache--contracts--size')">Binary output</button> + </div><div id="GET_..--block_id--context--cache--contracts--sizedescr" class="GET_..--block_id--context--cache--contracts--size tabcontent"> + <p> + Return the size of the contract cache</p> + </div> + <div id="GET_..--block_id--context--cache--contracts--sizeoutput.json" class="GET_..--block_id--context--cache--contracts--size tabcontent"> + <pre> + integer ∈ [-2^30, 2^30]</pre> + </div> + <div id="GET_..--block_id--context--cache--contracts--sizeoutput.bin" class="GET_..--block_id--context--cache--contracts--size tabcontent"> + <pre> + +-----------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=================+=========+==============================================================+ + | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------+---------+--------------------------------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--cache--contracts--size_limit : + +**GET ../<block_id>/context/cache/contracts/size_limit** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--size_limitdescr', 'GET_..--block_id--context--cache--contracts--size_limit')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--size_limitoutput.json', 'GET_..--block_id--context--cache--contracts--size_limit')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--cache--contracts--size_limitoutput.bin', 'GET_..--block_id--context--cache--contracts--size_limit')">Binary output</button> + </div><div id="GET_..--block_id--context--cache--contracts--size_limitdescr" class="GET_..--block_id--context--cache--contracts--size_limit tabcontent"> + <p> + Return the size limit of the contract cache</p> + </div> + <div id="GET_..--block_id--context--cache--contracts--size_limitoutput.json" class="GET_..--block_id--context--cache--contracts--size_limit tabcontent"> + <pre> + integer ∈ [-2^30, 2^30]</pre> + </div> + <div id="GET_..--block_id--context--cache--contracts--size_limitoutput.bin" class="GET_..--block_id--context--cache--contracts--size_limit tabcontent"> + <pre> + +-----------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=================+=========+==============================================================+ + | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------+---------+--------------------------------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--constants : + +**GET ../<block_id>/context/constants** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--constantsdescr', 'GET_..--block_id--context--constants')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constantsoutput.json', 'GET_..--block_id--context--constants')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constantsoutput.bin', 'GET_..--block_id--context--constants')">Binary output</button> + </div><div id="GET_..--block_id--context--constantsdescr" class="GET_..--block_id--context--constants tabcontent"> + <p> + All constants</p> + </div> + <div id="GET_..--block_id--context--constantsoutput.json" class="GET_..--block_id--context--constants tabcontent"> + <pre> + { "proof_of_work_nonce_size": integer ∈ [0, 255], + "nonce_length": integer ∈ [0, 255], + "max_anon_ops_per_block": integer ∈ [0, 255], + "max_operation_data_length": integer ∈ [-2^30, 2^30], + "max_proposals_per_delegate": integer ∈ [0, 255], + "max_micheline_node_count": integer ∈ [-2^30, 2^30], + "max_micheline_bytes_limit": integer ∈ [-2^30, 2^30], + "max_allowed_global_constants_depth": integer ∈ [-2^30, 2^30], + "cache_layout_size": integer ∈ [0, 255], + "michelson_maximum_type_size": integer ∈ [0, 2^16-1], + "sc_max_wrapped_proof_binary_size": integer ∈ [-2^30, 2^30], + "sc_rollup_message_size_limit": integer ∈ [-2^30, 2^30], + "sc_rollup_max_number_of_messages_per_level": $positive_bignum, + "preserved_cycles": integer ∈ [0, 255], + "blocks_per_cycle": integer ∈ [-2^31-1, 2^31], + "blocks_per_commitment": integer ∈ [-2^31-1, 2^31], + "nonce_revelation_threshold": integer ∈ [-2^31-1, 2^31], + "blocks_per_stake_snapshot": integer ∈ [-2^31-1, 2^31], + "cycles_per_voting_period": integer ∈ [-2^31-1, 2^31], + "hard_gas_limit_per_operation": $bignum, + "hard_gas_limit_per_block": $bignum, + "proof_of_work_threshold": $int64, + "minimal_stake": $016-PtMumbai.mutez, + "vdf_difficulty": $int64, + "seed_nonce_revelation_tip": $016-PtMumbai.mutez, + "origination_size": integer ∈ [-2^30, 2^30], + "baking_reward_fixed_portion": $016-PtMumbai.mutez, + "baking_reward_bonus_per_slot": $016-PtMumbai.mutez, + "endorsing_reward_per_slot": $016-PtMumbai.mutez, + "cost_per_byte": $016-PtMumbai.mutez, + "hard_storage_limit_per_operation": $bignum, + "quorum_min": integer ∈ [-2^31-1, 2^31], + "quorum_max": integer ∈ [-2^31-1, 2^31], + "min_proposal_quorum": integer ∈ [-2^31-1, 2^31], + "liquidity_baking_subsidy": $016-PtMumbai.mutez, + "liquidity_baking_toggle_ema_threshold": integer ∈ [-2^31-1, 2^31], + "max_operations_time_to_live": integer ∈ [-2^15, 2^15-1], + "minimal_block_delay": $int64, + "delay_increment_per_round": $int64, + "consensus_committee_size": integer ∈ [-2^30, 2^30], + "consensus_threshold": integer ∈ [-2^30, 2^30], + "minimal_participation_ratio": + { "numerator": integer ∈ [0, 2^16-1], + "denominator": integer ∈ [0, 2^16-1] }, + "max_slashing_period": integer ∈ [-2^30, 2^30], + "frozen_deposits_percentage": integer ∈ [-2^30, 2^30], + "double_baking_punishment": $016-PtMumbai.mutez, + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": integer ∈ [0, 2^16-1], + "denominator": integer ∈ [0, 2^16-1] }, + "testnet_dictator"?: $Signature.Public_key_hash, + "initial_seed"?: $random, + "cache_script_size": integer ∈ [-2^30, 2^30], + "cache_stake_distribution_cycles": integer ∈ [-128, 127], + "cache_sampler_state_cycles": integer ∈ [-128, 127], + "tx_rollup_enable": boolean, + "tx_rollup_origination_size": integer ∈ [-2^30, 2^30], + "tx_rollup_hard_size_limit_per_inbox": integer ∈ [-2^30, 2^30], + "tx_rollup_hard_size_limit_per_message": integer ∈ [-2^30, 2^30], + "tx_rollup_max_withdrawals_per_batch": integer ∈ [-2^30, 2^30], + "tx_rollup_commitment_bond": $016-PtMumbai.mutez, + "tx_rollup_finality_period": integer ∈ [-2^30, 2^30], + "tx_rollup_withdraw_period": integer ∈ [-2^30, 2^30], + "tx_rollup_max_inboxes_count": integer ∈ [-2^30, 2^30], + "tx_rollup_max_messages_per_inbox": integer ∈ [-2^30, 2^30], + "tx_rollup_max_commitments_count": integer ∈ [-2^30, 2^30], + "tx_rollup_cost_per_byte_ema_factor": integer ∈ [-2^30, 2^30], + "tx_rollup_max_ticket_payload_size": integer ∈ [-2^30, 2^30], + "tx_rollup_rejection_max_proof_size": integer ∈ [-2^30, 2^30], + "tx_rollup_sunset_level": integer ∈ [-2^31-1, 2^31], + "dal_parametric": + { "feature_enable": boolean, + "number_of_slots": integer ∈ [-2^15, 2^15-1], + "attestation_lag": integer ∈ [-2^15, 2^15-1], + "availability_threshold": integer ∈ [-2^15, 2^15-1], + "redundancy_factor": integer ∈ [0, 255], + "page_size": integer ∈ [0, 2^16-1], + "slot_size": integer ∈ [-2^30, 2^30], + "number_of_shards": integer ∈ [0, 2^16-1] }, + "sc_rollup_enable": boolean, + "sc_rollup_origination_size": integer ∈ [-2^30, 2^30], + "sc_rollup_challenge_window_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_stake_amount": $016-PtMumbai.mutez, + "sc_rollup_commitment_period_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_max_lookahead_in_blocks": integer ∈ [-2^31-1, 2^31], + "sc_rollup_max_active_outbox_levels": integer ∈ [-2^31-1, 2^31], + "sc_rollup_max_outbox_messages_per_level": integer ∈ [-2^30, 2^30], + "sc_rollup_number_of_sections_in_dissection": integer ∈ [0, 255], + "sc_rollup_timeout_period_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_max_number_of_cemented_commitments": integer ∈ [-2^30, 2^30], + "sc_rollup_max_number_of_parallel_games": integer ∈ [-2^30, 2^30], + "zk_rollup_enable": boolean, + "zk_rollup_origination_size": integer ∈ [-2^30, 2^30], + "zk_rollup_min_pending_to_process": integer ∈ [-2^30, 2^30] } + $016-PtMumbai.mutez: $positive_bignum + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $random: + /* A random generation state (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--constantsoutput.bin" class="GET_..--block_id--context--constants tabcontent"> + <pre> + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=========================================================+======================+==============================================================+ + | proof_of_work_nonce_size | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | nonce_length | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_anon_ops_per_block | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_operation_data_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_proposals_per_delegate | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_micheline_node_count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_micheline_bytes_limit | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_allowed_global_constants_depth | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_layout_size | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | michelson_maximum_type_size | 2 bytes | unsigned 16-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_max_wrapped_proof_binary_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_message_size_limit | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_number_of_messages_per_level | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | preserved_cycles | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_cycle | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_commitment | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | nonce_revelation_threshold | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_stake_snapshot | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cycles_per_voting_period | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_gas_limit_per_operation | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_gas_limit_per_block | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | proof_of_work_threshold | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_stake | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | vdf_difficulty | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | seed_nonce_revelation_tip | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | baking_reward_fixed_portion | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | baking_reward_bonus_per_slot | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | endorsing_reward_per_slot | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cost_per_byte | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_storage_limit_per_operation | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | quorum_min | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | quorum_max | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | min_proposal_quorum | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | liquidity_baking_subsidy | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | liquidity_baking_toggle_ema_threshold | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_operations_time_to_live | 2 bytes | signed 16-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_block_delay | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | delay_increment_per_round | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | consensus_committee_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | consensus_threshold | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_participation_ratio | 4 bytes | $X_0 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_slashing_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | frozen_deposits_percentage | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | double_baking_punishment | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ratio_of_frozen_deposits_slashed_per_double_endorsement | 4 bytes | $X_0 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "testnet_dictator" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | testnet_dictator | 21 bytes | $public_key_hash | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "initial_seed" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | initial_seed | 32 bytes | bytes | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_script_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_stake_distribution_cycles | 1 byte | signed 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_sampler_state_cycles | 1 byte | signed 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_hard_size_limit_per_inbox | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_hard_size_limit_per_message | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_withdrawals_per_batch | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_commitment_bond | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_finality_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_withdraw_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_inboxes_count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_messages_per_inbox | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_commitments_count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_cost_per_byte_ema_factor | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_ticket_payload_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_rejection_max_proof_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_sunset_level | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | dal_parametric | 16 bytes | $X_2 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_challenge_window_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_stake_amount | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_commitment_period_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_lookahead_in_blocks | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_active_outbox_levels | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_outbox_messages_per_level | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_number_of_sections_in_dissection | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_timeout_period_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_number_of_cemented_commitments | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_number_of_parallel_games | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_min_pending_to_process | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_0 + *** + + +-------------+---------+-------------------------+ + | Name | Size | Contents | + +=============+=========+=========================+ + | numerator | 2 bytes | unsigned 16-bit integer | + +-------------+---------+-------------------------+ + | denominator | 2 bytes | unsigned 16-bit integer | + +-------------+---------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_2 + *** + + +------------------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +========================+=========+==============================================================+ + | feature_enable | 1 byte | boolean (0 for false, 255 for true) | + +------------------------+---------+--------------------------------------------------------------+ + | number_of_slots | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | attestation_lag | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | availability_threshold | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | redundancy_factor | 1 byte | unsigned 8-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | page_size | 2 bytes | unsigned 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | slot_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------+---------+--------------------------------------------------------------+ + | number_of_shards | 2 bytes | unsigned 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--constants--errors : + +**GET ../<block_id>/context/constants/errors** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--constants--errorsdescr', 'GET_..--block_id--context--constants--errors')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constants--errorsoutput.json', 'GET_..--block_id--context--constants--errors')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constants--errorsoutput.bin', 'GET_..--block_id--context--constants--errors')">Binary output</button> + </div><div id="GET_..--block_id--context--constants--errorsdescr" class="GET_..--block_id--context--constants--errors tabcontent"> + <p> + Schema for all the RPC errors from this protocol version</p> + </div> + <div id="GET_..--block_id--context--constants--errorsoutput.json" class="GET_..--block_id--context--constants--errors tabcontent"> + <pre> + any</pre> + </div> + <div id="GET_..--block_id--context--constants--errorsoutput.bin" class="GET_..--block_id--context--constants--errors tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--constants--parametric : + +**GET ../<block_id>/context/constants/parametric** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--constants--parametricdescr', 'GET_..--block_id--context--constants--parametric')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constants--parametricoutput.json', 'GET_..--block_id--context--constants--parametric')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--constants--parametricoutput.bin', 'GET_..--block_id--context--constants--parametric')">Binary output</button> + </div><div id="GET_..--block_id--context--constants--parametricdescr" class="GET_..--block_id--context--constants--parametric tabcontent"> + <p> + Parametric constants</p> + </div> + <div id="GET_..--block_id--context--constants--parametricoutput.json" class="GET_..--block_id--context--constants--parametric tabcontent"> + <pre> + { "preserved_cycles": integer ∈ [0, 255], + "blocks_per_cycle": integer ∈ [-2^31-1, 2^31], + "blocks_per_commitment": integer ∈ [-2^31-1, 2^31], + "nonce_revelation_threshold": integer ∈ [-2^31-1, 2^31], + "blocks_per_stake_snapshot": integer ∈ [-2^31-1, 2^31], + "cycles_per_voting_period": integer ∈ [-2^31-1, 2^31], + "hard_gas_limit_per_operation": $bignum, + "hard_gas_limit_per_block": $bignum, + "proof_of_work_threshold": $int64, + "minimal_stake": $016-PtMumbai.mutez, + "vdf_difficulty": $int64, + "seed_nonce_revelation_tip": $016-PtMumbai.mutez, + "origination_size": integer ∈ [-2^30, 2^30], + "baking_reward_fixed_portion": $016-PtMumbai.mutez, + "baking_reward_bonus_per_slot": $016-PtMumbai.mutez, + "endorsing_reward_per_slot": $016-PtMumbai.mutez, + "cost_per_byte": $016-PtMumbai.mutez, + "hard_storage_limit_per_operation": $bignum, + "quorum_min": integer ∈ [-2^31-1, 2^31], + "quorum_max": integer ∈ [-2^31-1, 2^31], + "min_proposal_quorum": integer ∈ [-2^31-1, 2^31], + "liquidity_baking_subsidy": $016-PtMumbai.mutez, + "liquidity_baking_toggle_ema_threshold": integer ∈ [-2^31-1, 2^31], + "max_operations_time_to_live": integer ∈ [-2^15, 2^15-1], + "minimal_block_delay": $int64, + "delay_increment_per_round": $int64, + "consensus_committee_size": integer ∈ [-2^30, 2^30], + "consensus_threshold": integer ∈ [-2^30, 2^30], + "minimal_participation_ratio": + { "numerator": integer ∈ [0, 2^16-1], + "denominator": integer ∈ [0, 2^16-1] }, + "max_slashing_period": integer ∈ [-2^30, 2^30], + "frozen_deposits_percentage": integer ∈ [-2^30, 2^30], + "double_baking_punishment": $016-PtMumbai.mutez, + "ratio_of_frozen_deposits_slashed_per_double_endorsement": + { "numerator": integer ∈ [0, 2^16-1], + "denominator": integer ∈ [0, 2^16-1] }, + "testnet_dictator"?: $Signature.Public_key_hash, + "initial_seed"?: $random, + "cache_script_size": integer ∈ [-2^30, 2^30], + "cache_stake_distribution_cycles": integer ∈ [-128, 127], + "cache_sampler_state_cycles": integer ∈ [-128, 127], + "tx_rollup_enable": boolean, + "tx_rollup_origination_size": integer ∈ [-2^30, 2^30], + "tx_rollup_hard_size_limit_per_inbox": integer ∈ [-2^30, 2^30], + "tx_rollup_hard_size_limit_per_message": integer ∈ [-2^30, 2^30], + "tx_rollup_max_withdrawals_per_batch": integer ∈ [-2^30, 2^30], + "tx_rollup_commitment_bond": $016-PtMumbai.mutez, + "tx_rollup_finality_period": integer ∈ [-2^30, 2^30], + "tx_rollup_withdraw_period": integer ∈ [-2^30, 2^30], + "tx_rollup_max_inboxes_count": integer ∈ [-2^30, 2^30], + "tx_rollup_max_messages_per_inbox": integer ∈ [-2^30, 2^30], + "tx_rollup_max_commitments_count": integer ∈ [-2^30, 2^30], + "tx_rollup_cost_per_byte_ema_factor": integer ∈ [-2^30, 2^30], + "tx_rollup_max_ticket_payload_size": integer ∈ [-2^30, 2^30], + "tx_rollup_rejection_max_proof_size": integer ∈ [-2^30, 2^30], + "tx_rollup_sunset_level": integer ∈ [-2^31-1, 2^31], + "dal_parametric": + { "feature_enable": boolean, + "number_of_slots": integer ∈ [-2^15, 2^15-1], + "attestation_lag": integer ∈ [-2^15, 2^15-1], + "availability_threshold": integer ∈ [-2^15, 2^15-1], + "redundancy_factor": integer ∈ [0, 255], + "page_size": integer ∈ [0, 2^16-1], + "slot_size": integer ∈ [-2^30, 2^30], + "number_of_shards": integer ∈ [0, 2^16-1] }, + "sc_rollup_enable": boolean, + "sc_rollup_origination_size": integer ∈ [-2^30, 2^30], + "sc_rollup_challenge_window_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_stake_amount": $016-PtMumbai.mutez, + "sc_rollup_commitment_period_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_max_lookahead_in_blocks": integer ∈ [-2^31-1, 2^31], + "sc_rollup_max_active_outbox_levels": integer ∈ [-2^31-1, 2^31], + "sc_rollup_max_outbox_messages_per_level": integer ∈ [-2^30, 2^30], + "sc_rollup_number_of_sections_in_dissection": integer ∈ [0, 255], + "sc_rollup_timeout_period_in_blocks": integer ∈ [-2^30, 2^30], + "sc_rollup_max_number_of_cemented_commitments": integer ∈ [-2^30, 2^30], + "sc_rollup_max_number_of_parallel_games": integer ∈ [-2^30, 2^30], + "zk_rollup_enable": boolean, + "zk_rollup_origination_size": integer ∈ [-2^30, 2^30], + "zk_rollup_min_pending_to_process": integer ∈ [-2^30, 2^30] } + $016-PtMumbai.mutez: $positive_bignum + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $random: + /* A random generation state (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--constants--parametricoutput.bin" class="GET_..--block_id--context--constants--parametric tabcontent"> + <pre> + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=========================================================+======================+==============================================================+ + | preserved_cycles | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_cycle | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_commitment | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | nonce_revelation_threshold | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | blocks_per_stake_snapshot | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cycles_per_voting_period | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_gas_limit_per_operation | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_gas_limit_per_block | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | proof_of_work_threshold | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_stake | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | vdf_difficulty | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | seed_nonce_revelation_tip | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | baking_reward_fixed_portion | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | baking_reward_bonus_per_slot | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | endorsing_reward_per_slot | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cost_per_byte | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | hard_storage_limit_per_operation | Determined from data | $Z.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | quorum_min | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | quorum_max | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | min_proposal_quorum | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | liquidity_baking_subsidy | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | liquidity_baking_toggle_ema_threshold | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_operations_time_to_live | 2 bytes | signed 16-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_block_delay | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | delay_increment_per_round | 8 bytes | signed 64-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | consensus_committee_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | consensus_threshold | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_participation_ratio | 4 bytes | $X_0 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | max_slashing_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | frozen_deposits_percentage | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | double_baking_punishment | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ratio_of_frozen_deposits_slashed_per_double_endorsement | 4 bytes | $X_0 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "testnet_dictator" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | testnet_dictator | 21 bytes | $public_key_hash | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "initial_seed" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | initial_seed | 32 bytes | bytes | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_script_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_stake_distribution_cycles | 1 byte | signed 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | cache_sampler_state_cycles | 1 byte | signed 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_hard_size_limit_per_inbox | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_hard_size_limit_per_message | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_withdrawals_per_batch | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_commitment_bond | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_finality_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_withdraw_period | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_inboxes_count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_messages_per_inbox | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_commitments_count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_cost_per_byte_ema_factor | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_max_ticket_payload_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_rejection_max_proof_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup_sunset_level | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | dal_parametric | 16 bytes | $X_2 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_challenge_window_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_stake_amount | Determined from data | $N.t | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_commitment_period_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_lookahead_in_blocks | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_active_outbox_levels | 4 bytes | signed 32-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_outbox_messages_per_level | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_number_of_sections_in_dissection | 1 byte | unsigned 8-bit integer | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_timeout_period_in_blocks | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_number_of_cemented_commitments | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | sc_rollup_max_number_of_parallel_games | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_enable | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_origination_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + | zk_rollup_min_pending_to_process | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------------------+----------------------+--------------------------------------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_0 + *** + + +-------------+---------+-------------------------+ + | Name | Size | Contents | + +=============+=========+=========================+ + | numerator | 2 bytes | unsigned 16-bit integer | + +-------------+---------+-------------------------+ + | denominator | 2 bytes | unsigned 16-bit integer | + +-------------+---------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_2 + *** + + +------------------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +========================+=========+==============================================================+ + | feature_enable | 1 byte | boolean (0 for false, 255 for true) | + +------------------------+---------+--------------------------------------------------------------+ + | number_of_slots | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | attestation_lag | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | availability_threshold | 2 bytes | signed 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | redundancy_factor | 1 byte | unsigned 8-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | page_size | 2 bytes | unsigned 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + | slot_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------+---------+--------------------------------------------------------------+ + | number_of_shards | 2 bytes | unsigned 16-bit integer | + +------------------------+---------+--------------------------------------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts : + +**GET ../<block_id>/context/contracts** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contractsdescr', 'GET_..--block_id--context--contracts')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contractsoutput.json', 'GET_..--block_id--context--contracts')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contractsoutput.bin', 'GET_..--block_id--context--contracts')">Binary output</button> + </div><div id="GET_..--block_id--context--contractsdescr" class="GET_..--block_id--context--contracts tabcontent"> + <p> + All existing contracts (excluding empty implicit contracts).</p> + </div> + <div id="GET_..--block_id--context--contractsoutput.json" class="GET_..--block_id--context--contracts tabcontent"> + <pre> + [ $016-PtMumbai.contract_id ... ] + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contractsoutput.bin" class="GET_..--block_id--context--contracts tabcontent"> + <pre> + +-----------------------+----------+---------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=======================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+---------------------------------------+ + | Unnamed field 0 | Variable | sequence of $016-PtMumbai.contract_id | + +-----------------------+----------+---------------------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--contracts--contract_id : + +**GET ../<block_id>/context/contracts/<contract_id>?[normalize_types]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_iddescr', 'GET_..--block_id--context--contracts--contract_id')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_idoutput.json', 'GET_..--block_id--context--contracts--contract_id')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_idoutput.bin', 'GET_..--block_id--context--contracts--contract_id')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_iddescr" class="GET_..--block_id--context--contracts--contract_id tabcontent"> + <p> + Access the complete status of a contract.</p> <p>Optional query arguments :<ul><li><span class="query">normalize_types</span> : Whether types should be normalized (annotations removed, combs flattened) or kept as they appeared in the original script.</li></ul></p> + </div> + <div id="GET_..--block_id--context--contracts--contract_idoutput.json" class="GET_..--block_id--context--contracts--contract_id tabcontent"> + <pre> + { "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script"?: $016-PtMumbai.scripted.contracts, + "counter"?: $positive_bignum } + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_idoutput.bin" class="GET_..--block_id--context--contracts--contract_id tabcontent"> + <pre> + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "script" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "counter" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--contracts--contract_id--balance : + +**GET ../<block_id>/context/contracts/<contract_id>/balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balancedescr', 'GET_..--block_id--context--contracts--contract_id--balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balanceoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--balancedescr" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <p> + Access the spendable balance of a contract, excluding frozen bonds.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balanceoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds : + +**GET ../<block_id>/context/contracts/<contract_id>/balance_and_frozen_bonds** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin', 'GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsdescr" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <p> + Access the sum of the spendable balance and frozen bonds of a contract. This sum is part of the contract's stake, and it is exactly the contract's stake if the contract is not a delegate.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.json" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bondsoutput.bin" class="GET_..--block_id--context--contracts--contract_id--balance_and_frozen_bonds tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _POST_..--block_id--context--contracts--contract_id--big_map_get : + +**POST ../<block_id>/context/contracts/<contract_id>/big_map_get** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getdescr', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getinput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.json', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--contracts--contract_id--big_map_getoutput.bin', 'POST_..--block_id--context--contracts--contract_id--big_map_get')">Binary output</button> + </div><div id="POST_..--block_id--context--contracts--contract_id--big_map_getdescr" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <p> + Access the value associated with a key in a big map of the contract (deprecated).</p> + </div> + <div id="POST_..--block_id--context--contracts--contract_id--big_map_getinput.json" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <pre> + { "key": $micheline.016-PtMumbai.michelson_v1.expression, + "type": $micheline.016-PtMumbai.michelson_v1.expression } + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="POST_..--block_id--context--contracts--contract_id--big_map_getinput.bin" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <pre> + +------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +======+======================+=================================================+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + <div id="POST_..--block_id--context--contracts--contract_id--big_map_getoutput.json" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <pre> + $micheline.016-PtMumbai.michelson_v1.expression + /* Some */ + || null + /* None */ + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="POST_..--block_id--context--contracts--contract_id--big_map_getoutput.bin" class="POST_..--block_id--context--contracts--contract_id--big_map_get tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_1 | + +-----------------+----------------------+----------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_1 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------------------------+ + | Unnamed field 0 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------+----------------------+-------------------------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--counter : + +**GET ../<block_id>/context/contracts/<contract_id>/counter** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--counterdescr', 'GET_..--block_id--context--contracts--contract_id--counter')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--counteroutput.json', 'GET_..--block_id--context--contracts--contract_id--counter')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--counteroutput.bin', 'GET_..--block_id--context--contracts--contract_id--counter')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--counterdescr" class="GET_..--block_id--context--contracts--contract_id--counter tabcontent"> + <p> + Access the counter of a contract, if any.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--counteroutput.json" class="GET_..--block_id--context--contracts--contract_id--counter tabcontent"> + <pre> + string + /* Positive big number + Decimal representation of a positive big number */</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--counteroutput.bin" class="GET_..--block_id--context--contracts--contract_id--counter tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--delegate : + +**GET ../<block_id>/context/contracts/<contract_id>/delegate** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--delegatedescr', 'GET_..--block_id--context--contracts--contract_id--delegate')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--delegateoutput.json', 'GET_..--block_id--context--contracts--contract_id--delegate')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--delegateoutput.bin', 'GET_..--block_id--context--contracts--contract_id--delegate')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--delegatedescr" class="GET_..--block_id--context--contracts--contract_id--delegate tabcontent"> + <p> + Access the delegate of a contract, if any.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--delegateoutput.json" class="GET_..--block_id--context--contracts--contract_id--delegate tabcontent"> + <pre> + $unistring + /* A Ed25519, Secp256k1, P256, or BLS public key hash (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--delegateoutput.bin" class="GET_..--block_id--context--contracts--contract_id--delegate tabcontent"> + <pre> + +---------------------------+----------+------------------+ + | Name | Size | Contents | + +===========================+==========+==================+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--entrypoints : + +**GET ../<block_id>/context/contracts/<contract_id>/entrypoints?[normalize_types]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypointsdescr', 'GET_..--block_id--context--contracts--contract_id--entrypoints')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypointsoutput.json', 'GET_..--block_id--context--contracts--contract_id--entrypoints')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypointsoutput.bin', 'GET_..--block_id--context--contracts--contract_id--entrypoints')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--entrypointsdescr" class="GET_..--block_id--context--contracts--contract_id--entrypoints tabcontent"> + <p> + Return the list of entrypoints of the contract</p> <p>Optional query arguments :<ul><li><span class="query">normalize_types</span> : Whether types should be normalized (annotations removed, combs flattened) or kept as they appeared in the original script.</li></ul></p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--entrypointsoutput.json" class="GET_..--block_id--context--contracts--contract_id--entrypoints tabcontent"> + <pre> + { "unreachable"?: + [ { "path": [ $016-PtMumbai.michelson.v1.primitives ... ] } ... ], + "entrypoints": { *: $micheline.016-PtMumbai.michelson_v1.expression } } + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--entrypointsoutput.bin" class="GET_..--block_id--context--contracts--contract_id--entrypoints tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | unreachable | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | entrypoints | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=======================================================================================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------------------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_1 + *** + + +-----------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================================+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+-------------------------------------------------+ + | Unnamed field 1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------+----------------------+-------------------------------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint : + +**GET ../<block_id>/context/contracts/<contract_id>/entrypoints/<entrypoint>?[normalize_types]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointdescr', 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointoutput.json', 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointoutput.bin', 'GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointdescr" class="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint tabcontent"> + <p> + Return the type of the given entrypoint of the contract</p> <p>Optional query arguments :<ul><li><span class="query">normalize_types</span> : Whether types should be normalized (annotations removed, combs flattened) or kept as they appeared in the original script.</li></ul></p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointoutput.json" class="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint tabcontent"> + <pre> + $micheline.016-PtMumbai.michelson_v1.expression + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypointoutput.bin" class="GET_..--block_id--context--contracts--contract_id--entrypoints--entrypoint tabcontent"> + <pre> + +-----------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================================+ + | Unnamed field 0 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--frozen_bonds : + +**GET ../<block_id>/context/contracts/<contract_id>/frozen_bonds** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--frozen_bondsdescr', 'GET_..--block_id--context--contracts--contract_id--frozen_bonds')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--frozen_bondsoutput.json', 'GET_..--block_id--context--contracts--contract_id--frozen_bonds')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--frozen_bondsoutput.bin', 'GET_..--block_id--context--contracts--contract_id--frozen_bonds')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--frozen_bondsdescr" class="GET_..--block_id--context--contracts--contract_id--frozen_bonds tabcontent"> + <p> + Access the frozen bonds of a contract.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--frozen_bondsoutput.json" class="GET_..--block_id--context--contracts--contract_id--frozen_bonds tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--frozen_bondsoutput.bin" class="GET_..--block_id--context--contracts--contract_id--frozen_bonds tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--manager_key : + +**GET ../<block_id>/context/contracts/<contract_id>/manager_key** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--manager_keydescr', 'GET_..--block_id--context--contracts--contract_id--manager_key')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--manager_keyoutput.json', 'GET_..--block_id--context--contracts--contract_id--manager_key')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--manager_keyoutput.bin', 'GET_..--block_id--context--contracts--contract_id--manager_key')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--manager_keydescr" class="GET_..--block_id--context--contracts--contract_id--manager_key tabcontent"> + <p> + Access the manager of an implicit contract.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--manager_keyoutput.json" class="GET_..--block_id--context--contracts--contract_id--manager_key tabcontent"> + <pre> + $Signature.Public_key /* Some */ || null /* None */ + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--manager_keyoutput.bin" class="GET_..--block_id--context--contracts--contract_id--manager_key tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------------------+----------------------+------------------------+ + | Name | Size | Contents | + +======================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------------------+------------------------+ + | Signature.Public_key | Determined from data | $public_key | + +----------------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--script : + +**GET ../<block_id>/context/contracts/<contract_id>/script** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--scriptdescr', 'GET_..--block_id--context--contracts--contract_id--script')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--scriptoutput.json', 'GET_..--block_id--context--contracts--contract_id--script')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--scriptoutput.bin', 'GET_..--block_id--context--contracts--contract_id--script')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--scriptdescr" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> + <p> + Access the code and data of the contract.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.json" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> + <pre> + { "code": any, + "storage": any }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--scriptoutput.bin" class="GET_..--block_id--context--contracts--contract_id--script tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff : + +**GET ../<block_id>/context/contracts/<contract_id>/single_sapling_get_diff?[offset_commitment=<uint63>]&[offset_nullifier=<uint63>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffdescr', 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffoutput.json', 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffoutput.bin', 'GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffdescr" class="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff tabcontent"> + <p> + Returns the root and a diff of a state starting from an optional offset which is zero by default.</p> <p>Optional query arguments :<ul><li><span class="query">offset_commitment = <uint63></span> : Commitments and ciphertexts are returned from the specified offset up to the most recent.</li><li><span class="query">offset_nullifier = <uint63></span> : Nullifiers are returned from the specified offset up to the most recent.</li></ul></p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffoutput.json" class="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff tabcontent"> + <pre> + { "root": $sapling.transaction.commitment_hash, + "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_hash: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diffoutput.bin" class="GET_..--block_id--context--contracts--contract_id--single_sapling_get_diff tabcontent"> + <pre> + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | root | 32 bytes | bytes | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_0 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--contracts--contract_id--storage : + +**GET ../<block_id>/context/contracts/<contract_id>/storage** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--storagedescr', 'GET_..--block_id--context--contracts--contract_id--storage')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--storageoutput.json', 'GET_..--block_id--context--contracts--contract_id--storage')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--contracts--contract_id--storageoutput.bin', 'GET_..--block_id--context--contracts--contract_id--storage')">Binary output</button> + </div><div id="GET_..--block_id--context--contracts--contract_id--storagedescr" class="GET_..--block_id--context--contracts--contract_id--storage tabcontent"> + <p> + Access the data of the contract.</p> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--storageoutput.json" class="GET_..--block_id--context--contracts--contract_id--storage tabcontent"> + <pre> + $micheline.016-PtMumbai.michelson_v1.expression + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $bignum: + /* Big number + Decimal representation of a big number */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--contracts--contract_id--storageoutput.bin" class="GET_..--block_id--context--contracts--contract_id--storage tabcontent"> + <pre> + +-----------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================================+ + | Unnamed field 0 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates : + +**GET ../<block_id>/context/delegates?[active]&[inactive]&[with_minimal_stake]&[without_minimal_stake]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegatesdescr', 'GET_..--block_id--context--delegates')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegatesoutput.json', 'GET_..--block_id--context--delegates')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegatesoutput.bin', 'GET_..--block_id--context--delegates')">Binary output</button> + </div><div id="GET_..--block_id--context--delegatesdescr" class="GET_..--block_id--context--delegates tabcontent"> + <p> + Lists all registered delegates by default. The arguments `active`, `inactive`, `with_minimal_stake`, and `without_minimal_stake` allow to enumerate only the delegates that are active, inactive, have at least a minimal stake to participate in consensus and in governance, or do not have such a minimal stake, respectively. Note, setting these arguments to false has no effect.</p> <p>Optional query arguments :<ul><li><span class="query">active</span></li><li><span class="query">inactive</span></li><li><span class="query">with_minimal_stake</span></li><li><span class="query">without_minimal_stake</span></li></ul></p> + </div> + <div id="GET_..--block_id--context--delegatesoutput.json" class="GET_..--block_id--context--delegates tabcontent"> + <pre> + [ $Signature.Public_key_hash ... ] + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegatesoutput.bin" class="GET_..--block_id--context--delegates tabcontent"> + <pre> + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | Unnamed field 0 | Variable | sequence of $public_key_hash | + +-----------------------+----------+------------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--delegates--pkh : + +**GET ../<block_id>/context/delegates/<pkh>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkhdescr', 'GET_..--block_id--context--delegates--pkh')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkhoutput.json', 'GET_..--block_id--context--delegates--pkh')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkhoutput.bin', 'GET_..--block_id--context--delegates--pkh')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkhdescr" class="GET_..--block_id--context--delegates--pkh tabcontent"> + <p> + Everything about a delegate.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkhoutput.json" class="GET_..--block_id--context--delegates--pkh tabcontent"> + <pre> + { "full_balance": $016-PtMumbai.mutez, + "current_frozen_deposits": $016-PtMumbai.mutez, + "frozen_deposits": $016-PtMumbai.mutez, + "staking_balance": $016-PtMumbai.mutez, + "frozen_deposits_limit"?: $016-PtMumbai.mutez, + "delegated_contracts": [ $016-PtMumbai.contract_id ... ], + "delegated_balance": $016-PtMumbai.mutez, + "deactivated": boolean, + "grace_period": integer ∈ [-2^31-1, 2^31], + "voting_power"?: $int64, + "current_ballot"?: "nay" | "yay" | "pass", + "current_proposals"?: [ $Protocol_hash ... ], + "remaining_proposals"?: integer ∈ [-2^30, 2^30], + "active_consensus_key": $Signature.Public_key_hash, + "pending_consensus_keys"?: + [ { "cycle": integer ∈ [-2^31-1, 2^31], + "pkh": $Signature.Public_key_hash } ... ] } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.mutez: $positive_bignum + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkhoutput.bin" class="GET_..--block_id--context--delegates--pkh tabcontent"> + <pre> + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=============================================+======================+==============================================================+ + | full_balance | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | current_frozen_deposits | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | frozen_deposits | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | staking_balance | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "frozen_deposits_limit" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | frozen_deposits_limit | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | delegated_contracts | Variable | sequence of $016-PtMumbai.contract_id | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | delegated_balance | Determined from data | $N.t | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | deactivated | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | grace_period | 4 bytes | signed 32-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "voting_power" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | voting_power | 8 bytes | signed 64-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | ? presence of field "current_ballot" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | current_ballot | 1 byte | signed 8-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | current_proposals | Variable | sequence of bytes | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | remaining_proposals | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | active_consensus_key | 21 bytes | $public_key_hash | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + | pending_consensus_keys | Variable | sequence of $X_0 | + +---------------------------------------------+----------------------+--------------------------------------------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_0 + *** + + +-------+----------+-----------------------+ + | Name | Size | Contents | + +=======+==========+=======================+ + | cycle | 4 bytes | signed 32-bit integer | + +-------+----------+-----------------------+ + | pkh | 21 bytes | $public_key_hash | + +-------+----------+-----------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--context--delegates--pkh--consensus_key : + +**GET ../<block_id>/context/delegates/<pkh>/consensus_key** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--consensus_keydescr', 'GET_..--block_id--context--delegates--pkh--consensus_key')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--consensus_keyoutput.json', 'GET_..--block_id--context--delegates--pkh--consensus_key')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--consensus_keyoutput.bin', 'GET_..--block_id--context--delegates--pkh--consensus_key')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--consensus_keydescr" class="GET_..--block_id--context--delegates--pkh--consensus_key tabcontent"> + <p> + The active consensus key for a given delegate and the pending consensus keys.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--consensus_keyoutput.json" class="GET_..--block_id--context--delegates--pkh--consensus_key tabcontent"> + <pre> + { "active": $Signature.Public_key_hash, + "pendings"?: + [ { "cycle": integer ∈ [-2^31-1, 2^31], + "pkh": $Signature.Public_key_hash } ... ] } + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--consensus_keyoutput.bin" class="GET_..--block_id--context--delegates--pkh--consensus_key tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | active | 21 bytes | $public_key_hash | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | pendings | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_0 + *** + + +-------+----------+-----------------------+ + | Name | Size | Contents | + +=======+==========+=======================+ + | cycle | 4 bytes | signed 32-bit integer | + +-------+----------+-----------------------+ + | pkh | 21 bytes | $public_key_hash | + +-------+----------+-----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--current_frozen_deposits : + +**GET ../<block_id>/context/delegates/<pkh>/current_frozen_deposits** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--current_frozen_depositsdescr', 'GET_..--block_id--context--delegates--pkh--current_frozen_deposits')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--current_frozen_depositsoutput.json', 'GET_..--block_id--context--delegates--pkh--current_frozen_deposits')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--current_frozen_depositsoutput.bin', 'GET_..--block_id--context--delegates--pkh--current_frozen_deposits')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--current_frozen_depositsdescr" class="GET_..--block_id--context--delegates--pkh--current_frozen_deposits tabcontent"> + <p> + Returns the current amount of the frozen deposits (in mutez).</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--current_frozen_depositsoutput.json" class="GET_..--block_id--context--delegates--pkh--current_frozen_deposits tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--current_frozen_depositsoutput.bin" class="GET_..--block_id--context--delegates--pkh--current_frozen_deposits tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--deactivated : + +**GET ../<block_id>/context/delegates/<pkh>/deactivated** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--deactivateddescr', 'GET_..--block_id--context--delegates--pkh--deactivated')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--deactivatedoutput.json', 'GET_..--block_id--context--delegates--pkh--deactivated')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--deactivatedoutput.bin', 'GET_..--block_id--context--delegates--pkh--deactivated')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--deactivateddescr" class="GET_..--block_id--context--delegates--pkh--deactivated tabcontent"> + <p> + Tells whether the delegate is currently tagged as deactivated or not.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--deactivatedoutput.json" class="GET_..--block_id--context--delegates--pkh--deactivated tabcontent"> + <pre> + boolean</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--deactivatedoutput.bin" class="GET_..--block_id--context--delegates--pkh--deactivated tabcontent"> + <pre> + +-----------------+--------+-------------------------------------+ + | Name | Size | Contents | + +=================+========+=====================================+ + | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | + +-----------------+--------+-------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--delegated_balance : + +**GET ../<block_id>/context/delegates/<pkh>/delegated_balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_balancedescr', 'GET_..--block_id--context--delegates--pkh--delegated_balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_balanceoutput.json', 'GET_..--block_id--context--delegates--pkh--delegated_balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_balanceoutput.bin', 'GET_..--block_id--context--delegates--pkh--delegated_balance')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--delegated_balancedescr" class="GET_..--block_id--context--delegates--pkh--delegated_balance tabcontent"> + <p> + Returns the sum (in mutez) of all balances of all the contracts that delegate to a given delegate. This excludes the delegate's own balance, its frozen deposits and its frozen bonds.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--delegated_balanceoutput.json" class="GET_..--block_id--context--delegates--pkh--delegated_balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--delegated_balanceoutput.bin" class="GET_..--block_id--context--delegates--pkh--delegated_balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--delegated_contracts : + +**GET ../<block_id>/context/delegates/<pkh>/delegated_contracts** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_contractsdescr', 'GET_..--block_id--context--delegates--pkh--delegated_contracts')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_contractsoutput.json', 'GET_..--block_id--context--delegates--pkh--delegated_contracts')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--delegated_contractsoutput.bin', 'GET_..--block_id--context--delegates--pkh--delegated_contracts')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--delegated_contractsdescr" class="GET_..--block_id--context--delegates--pkh--delegated_contracts tabcontent"> + <p> + Returns the list of contracts that delegate to a given delegate.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--delegated_contractsoutput.json" class="GET_..--block_id--context--delegates--pkh--delegated_contracts tabcontent"> + <pre> + [ $016-PtMumbai.contract_id ... ] + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--delegated_contractsoutput.bin" class="GET_..--block_id--context--delegates--pkh--delegated_contracts tabcontent"> + <pre> + +-----------------------+----------+---------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=======================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+---------------------------------------+ + | Unnamed field 0 | Variable | sequence of $016-PtMumbai.contract_id | + +-----------------------+----------+---------------------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--frozen_deposits : + +**GET ../<block_id>/context/delegates/<pkh>/frozen_deposits** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_depositsdescr', 'GET_..--block_id--context--delegates--pkh--frozen_deposits')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_depositsoutput.json', 'GET_..--block_id--context--delegates--pkh--frozen_deposits')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_depositsoutput.bin', 'GET_..--block_id--context--delegates--pkh--frozen_deposits')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--frozen_depositsdescr" class="GET_..--block_id--context--delegates--pkh--frozen_deposits tabcontent"> + <p> + Returns the initial amount (that is, at the beginning of a cycle) of the frozen deposits (in mutez). This amount is the same as the current amount of the frozen deposits, unless the delegate has been punished.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--frozen_depositsoutput.json" class="GET_..--block_id--context--delegates--pkh--frozen_deposits tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--frozen_depositsoutput.bin" class="GET_..--block_id--context--delegates--pkh--frozen_deposits tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--frozen_deposits_limit : + +**GET ../<block_id>/context/delegates/<pkh>/frozen_deposits_limit** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limitdescr', 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limit')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limitoutput.json', 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limit')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limitoutput.bin', 'GET_..--block_id--context--delegates--pkh--frozen_deposits_limit')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--frozen_deposits_limitdescr" class="GET_..--block_id--context--delegates--pkh--frozen_deposits_limit tabcontent"> + <p> + Returns the frozen deposits limit for the given delegate or none if no limit is set.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--frozen_deposits_limitoutput.json" class="GET_..--block_id--context--delegates--pkh--frozen_deposits_limit tabcontent"> + <pre> + $016-PtMumbai.mutez /* Some */ || null /* None */ + $016-PtMumbai.mutez: $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--frozen_deposits_limitoutput.bin" class="GET_..--block_id--context--delegates--pkh--frozen_deposits_limit tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--full_balance : + +**GET ../<block_id>/context/delegates/<pkh>/full_balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--full_balancedescr', 'GET_..--block_id--context--delegates--pkh--full_balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--full_balanceoutput.json', 'GET_..--block_id--context--delegates--pkh--full_balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--full_balanceoutput.bin', 'GET_..--block_id--context--delegates--pkh--full_balance')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--full_balancedescr" class="GET_..--block_id--context--delegates--pkh--full_balance tabcontent"> + <p> + Returns the full balance (in mutez) of a given delegate, including the frozen deposits and the frozen bonds. It does not include its delegated balance.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--full_balanceoutput.json" class="GET_..--block_id--context--delegates--pkh--full_balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--full_balanceoutput.bin" class="GET_..--block_id--context--delegates--pkh--full_balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--grace_period : + +**GET ../<block_id>/context/delegates/<pkh>/grace_period** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--grace_perioddescr', 'GET_..--block_id--context--delegates--pkh--grace_period')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--grace_periodoutput.json', 'GET_..--block_id--context--delegates--pkh--grace_period')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--grace_periodoutput.bin', 'GET_..--block_id--context--delegates--pkh--grace_period')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--grace_perioddescr" class="GET_..--block_id--context--delegates--pkh--grace_period tabcontent"> + <p> + Returns the cycle by the end of which the delegate might be deactivated if she fails to execute any delegate action. A deactivated delegate might be reactivated (without loosing any stake) by simply re-registering as a delegate. For deactivated delegates, this value contains the cycle at which they were deactivated.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--grace_periodoutput.json" class="GET_..--block_id--context--delegates--pkh--grace_period tabcontent"> + <pre> + integer ∈ [-2^31-1, 2^31]</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--grace_periodoutput.bin" class="GET_..--block_id--context--delegates--pkh--grace_period tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--participation : + +**GET ../<block_id>/context/delegates/<pkh>/participation** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--participationdescr', 'GET_..--block_id--context--delegates--pkh--participation')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--participationoutput.json', 'GET_..--block_id--context--delegates--pkh--participation')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--participationoutput.bin', 'GET_..--block_id--context--delegates--pkh--participation')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--participationdescr" class="GET_..--block_id--context--delegates--pkh--participation tabcontent"> + <p> + Returns cycle and level participation information. In particular this indicates, in the field 'expected_cycle_activity', the number of slots the delegate is expected to have in the cycle based on its active stake. The field 'minimal_cycle_activity' indicates the minimal endorsing slots in the cycle required to get endorsing rewards. It is computed based on 'expected_cycle_activity. The fields 'missed_slots' and 'missed_levels' indicate the number of missed endorsing slots and missed levels (for endorsing) in the cycle so far. 'missed_slots' indicates the number of missed endorsing slots in the cycle so far. The field 'remaining_allowed_missed_slots' indicates the remaining amount of endorsing slots that can be missed in the cycle before forfeiting the rewards. Finally, 'expected_endorsing_rewards' indicates the endorsing rewards that will be distributed at the end of the cycle if activity at that point will be greater than the minimal required; if the activity is already known to be below the required minimum, then the rewards are zero.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--participationoutput.json" class="GET_..--block_id--context--delegates--pkh--participation tabcontent"> + <pre> + { "expected_cycle_activity": integer ∈ [-2^30, 2^30], + "minimal_cycle_activity": integer ∈ [-2^30, 2^30], + "missed_slots": integer ∈ [-2^30, 2^30], + "missed_levels": integer ∈ [-2^30, 2^30], + "remaining_allowed_missed_slots": integer ∈ [-2^30, 2^30], + "expected_endorsing_rewards": $016-PtMumbai.mutez } + $016-PtMumbai.mutez: $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--participationoutput.bin" class="GET_..--block_id--context--delegates--pkh--participation tabcontent"> + <pre> + +--------------------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+==============================================================+ + | expected_cycle_activity | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | minimal_cycle_activity | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | missed_slots | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | missed_levels | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | remaining_allowed_missed_slots | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | expected_endorsing_rewards | Determined from data | $N.t | + +--------------------------------+----------------------+--------------------------------------------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--staking_balance : + +**GET ../<block_id>/context/delegates/<pkh>/staking_balance** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balancedescr', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin', 'GET_..--block_id--context--delegates--pkh--staking_balance')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--staking_balancedescr" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <p> + Returns the total amount of tokens (in mutez) delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself, its frozen deposits, and its frozen bonds.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.json" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <pre> + $positive_bignum + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--staking_balanceoutput.bin" class="GET_..--block_id--context--delegates--pkh--staking_balance tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $N.t | + +-----------------+----------------------+----------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--voting_info : + +**GET ../<block_id>/context/delegates/<pkh>/voting_info** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infodescr', 'GET_..--block_id--context--delegates--pkh--voting_info')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.json', 'GET_..--block_id--context--delegates--pkh--voting_info')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_infooutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_info')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--voting_infodescr" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <p> + Returns the delegate info (e.g. voting power) found in the listings of the current voting period.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.json" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <pre> + { "voting_power"?: $int64, + "current_ballot"?: "nay" | "yay" | "pass", + "current_proposals"?: [ $Protocol_hash ... ], + "remaining_proposals"?: integer ∈ [-2^30, 2^30] } + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_infooutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_info tabcontent"> + <pre> + +--------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +======================================+==========+==============================================================+ + | ? presence of field "voting_power" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------+----------+--------------------------------------------------------------+ + | voting_power | 8 bytes | signed 64-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | ? presence of field "current_ballot" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------+----------+--------------------------------------------------------------+ + | current_ballot | 1 byte | signed 8-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------+----------+--------------------------------------------------------------+ + | current_proposals | Variable | sequence of bytes | + +--------------------------------------+----------+--------------------------------------------------------------+ + | remaining_proposals | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------+----------+--------------------------------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--delegates--pkh--voting_power : + +**GET ../<block_id>/context/delegates/<pkh>/voting_power** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_powerdescr', 'GET_..--block_id--context--delegates--pkh--voting_power')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.json', 'GET_..--block_id--context--delegates--pkh--voting_power')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin', 'GET_..--block_id--context--delegates--pkh--voting_power')">Binary output</button> + </div><div id="GET_..--block_id--context--delegates--pkh--voting_powerdescr" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <p> + The voting power in the vote listings for a given delegate.</p> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.json" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <pre> + string + /* 64 bit integers + Decimal representation of 64 bit integers */</pre> + </div> + <div id="GET_..--block_id--context--delegates--pkh--voting_poweroutput.bin" class="GET_..--block_id--context--delegates--pkh--voting_power tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--liquidity_baking--cpmm_address : + +**GET ../<block_id>/context/liquidity_baking/cpmm_address** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressdescr', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin', 'GET_..--block_id--context--liquidity_baking--cpmm_address')">Binary output</button> + </div><div id="GET_..--block_id--context--liquidity_baking--cpmm_addressdescr" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <p> + Liquidity baking CPMM address</p> + </div> + <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.json" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <pre> + $unistring + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--liquidity_baking--cpmm_addressoutput.bin" class="GET_..--block_id--context--liquidity_baking--cpmm_address tabcontent"> + <pre> + +-----------------+----------+----------+ + | Name | Size | Contents | + +=================+==========+==========+ + | Unnamed field 0 | 22 bytes | $X_0 | + +-----------------+----------+----------+ + + + X_0 (22 bytes, 8-bit tag) + ************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree : + +**GET ../<block_id>/context/merkle_tree(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_treedescr', 'GET_..--block_id--context--merkle_tree')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.json', 'GET_..--block_id--context--merkle_tree')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_treeoutput.bin', 'GET_..--block_id--context--merkle_tree')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_treedescr" class="GET_..--block_id--context--merkle_tree tabcontent"> + <p> + Returns the merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.json" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + $merkle_tree /* Some */ || null /* None */ + $merkle_tree: + [ [ $unistring, + [ boolean, $unistring ] + /* Hash */ + || $raw_context + /* Data */ + || $merkle_tree + /* Continue */ ] ... ] + $raw_context: + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* Key */ + || { /* Dir */ + *: $raw_context } + || null + /* Cut */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_treeoutput.bin" class="GET_..--block_id--context--merkle_tree tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_8 | + +-----------------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------+----------------------+--------------+ + | Name | Size | Contents | + +=================+======================+==============+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+--------------+ + | Unnamed field 1 | Determined from data | $raw_context | + +-----------------+----------------------+--------------+ + + + raw_context (Determined from data, 8-bit tag) + ********************************************* + + Key (tag 0) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Dir (tag 1) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Cut (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_7 (Determined from data, 8-bit tag) + ************************************* + + Hash (tag 0) + ============ + + +-----------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) | + +-----------------+----------------------+-------------------------------------+ + | Unnamed field 1 | Determined from data | $X_2 | + +-----------------+----------------------+-------------------------------------+ + + + Data (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $raw_context | + +-----------------+----------------------+------------------------+ + + + Continue (tag 2) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_7 | + +-----------------+----------------------+----------+ + + + merkle_tree + *********** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + + + X_8 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $merkle_tree | + +-----------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--merkle_tree_v2 : + +**GET ../<block_id>/context/merkle_tree_v2(/<context_path>)*?[holey=<bool>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2descr', 'GET_..--block_id--context--merkle_tree_v2')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.json', 'GET_..--block_id--context--merkle_tree_v2')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--merkle_tree_v2output.bin', 'GET_..--block_id--context--merkle_tree_v2')">Binary output</button> + </div><div id="GET_..--block_id--context--merkle_tree_v2descr" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <p> + Returns the Irmin merkle tree of a piece of context.</p> <p>Optional query arguments :<ul><li><span class="query">holey = <bool></span> : Send only hashes, omit data of key</li></ul></p> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.json" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + { /* Some */ + "version": integer ∈ [-2^15, 2^15-1], + "before": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "after": + { /* Value */ + "value": $Context_hash } + || { /* Node */ + "node": $Context_hash }, + "state": $tree_encoding } + || null + /* None */ + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $inode_tree: + { /* Inode_tree */ + "inode_tree": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Inode_values */ + "inode_values": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_inode_trees */ + "other_inode_trees": + { /* Blinded_inode */ + "blinded_inode": $Context_hash } + || { /* Inode_extender */ + "inode_extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $tree_encoding: + { /* Inode */ + "inode": + { "length": $int64, + "proofs": + { /* sparse_proof */ + "sparse_proof": [ [ integer ∈ [0, 255], $inode_tree ] ... ] } + || { /* dense_proof */ + "dense_proof": [ $inode_tree ... ] } } } + || { /* other_trees */ + "other_trees": + { /* Node */ + "node": + [ [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, $tree_encoding ] ... ] } + || { /* other_trees */ + "other_trees": + { /* Value */ + "value": + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* short_bytes */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* medium_bytes */ + || any + /* long_bytes + This case is void. No data is accepted. */ + || /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* unlimited_bytes */ } + || { /* Blinded_value */ + "blinded_value": $Context_hash } + || { /* Blinded_node */ + "blinded_node": $Context_hash } + || { /* Extender */ + "extender": + { "length": $int64, + "segment": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "proof": $inode_tree } } + || { /* None */ + "none": any } } } + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--merkle_tree_v2output.bin" class="GET_..--block_id--context--merkle_tree_v2 tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_53821 | + +-----------------+----------------------+----------+ + + + X_0 + *** + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_5 + *** + + +-----------------+----------------------+----------------+ + | Name | Size | Contents | + +=================+======================+================+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------------+ + | Unnamed field 1 | Determined from data | $tree_encoding | + +-----------------+----------------------+----------------+ + + + X_132 + ***** + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + X_131 + ***** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_132 | + +-----------------------+----------+-------------------------+ + + + inode_tree (Determined from data, 8-bit tag) + ******************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 186 (tag 186) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 187 (tag 187) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 188 (tag 188) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 189 (tag 189) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 190 (tag 190) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 191 (tag 191) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_5 | + +-----------------------+----------+-------------------------+ + + + case 192 (tag 192) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 209 (tag 209) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 210 (tag 210) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 211 (tag 211) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + tree_encoding (Determined from data, 8-bit tag) + *********************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + case 4 (tag 4) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 5 (tag 5) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 6 (tag 6) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 7 (tag 7) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 1 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 8 (tag 8) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 9 (tag 9) + ============== + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 10 (tag 10) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 11 (tag 11) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 2 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 12 (tag 12) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 13 (tag 13) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 14 (tag 14) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 15 (tag 15) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 3 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 16 (tag 16) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 17 (tag 17) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 18 (tag 18) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 19 (tag 19) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 4 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 20 (tag 20) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 21 (tag 21) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 22 (tag 22) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 23 (tag 23) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 5 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 24 (tag 24) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 25 (tag 25) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 26 (tag 26) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 27 (tag 27) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 6 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 28 (tag 28) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 29 (tag 29) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 30 (tag 30) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 31 (tag 31) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 7 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 32 (tag 32) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 33 (tag 33) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 34 (tag 34) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 35 (tag 35) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 8 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 36 (tag 36) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 37 (tag 37) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 38 (tag 38) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 39 (tag 39) + ================ + + +-----------------+----------------------+------------------------------+ + | Name | Size | Contents | + +=================+======================+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 9 $X_132 | + +-----------------+----------------------+------------------------------+ + + + case 40 (tag 40) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 41 (tag 41) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 42 (tag 42) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 43 (tag 43) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 10 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 44 (tag 44) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 45 (tag 45) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 46 (tag 46) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 47 (tag 47) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 11 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 48 (tag 48) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 49 (tag 49) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 50 (tag 50) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 51 (tag 51) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 12 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 52 (tag 52) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 53 (tag 53) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 54 (tag 54) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 55 (tag 55) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 13 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 56 (tag 56) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 57 (tag 57) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 58 (tag 58) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 59 (tag 59) + ================ + + +-----------------+----------------------+-------------------------------+ + | Name | Size | Contents | + +=================+======================+===============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 14 $X_132 | + +-----------------+----------------------+-------------------------------+ + + + case 60 (tag 60) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 61 (tag 61) + ================ + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+-------------------------+ + + + case 62 (tag 62) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 63 (tag 63) + ================ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_131 | + +-----------------+----------------------+------------------------+ + + + case 64 (tag 64) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 65 (tag 65) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 66 (tag 66) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 67 (tag 67) + ================ + + +-----------------+----------------------+------------------------------------+ + | Name | Size | Contents | + +=================+======================+====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------------------+ + | Unnamed field 1 | Determined from data | sequence of exactly 32 $inode_tree | + +-----------------+----------------------+------------------------------------+ + + + case 128 (tag 128) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + case 129 (tag 129) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 1 $X_5 | + +-----------------+----------+----------------------------+ + + + case 130 (tag 130) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 2 $X_5 | + +-----------------+----------+----------------------------+ + + + case 131 (tag 131) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 3 $X_5 | + +-----------------+----------+----------------------------+ + + + case 132 (tag 132) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 4 $X_5 | + +-----------------+----------+----------------------------+ + + + case 133 (tag 133) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 5 $X_5 | + +-----------------+----------+----------------------------+ + + + case 134 (tag 134) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 6 $X_5 | + +-----------------+----------+----------------------------+ + + + case 135 (tag 135) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 7 $X_5 | + +-----------------+----------+----------------------------+ + + + case 136 (tag 136) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 8 $X_5 | + +-----------------+----------+----------------------------+ + + + case 137 (tag 137) + ================== + + +-----------------+----------+----------------------------+ + | Name | Size | Contents | + +=================+==========+============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 9 $X_5 | + +-----------------+----------+----------------------------+ + + + case 138 (tag 138) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 10 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 139 (tag 139) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 11 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 140 (tag 140) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 12 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 141 (tag 141) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 13 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 142 (tag 142) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 14 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 143 (tag 143) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 15 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 144 (tag 144) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 16 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 145 (tag 145) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 17 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 146 (tag 146) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 18 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 147 (tag 147) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 19 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 148 (tag 148) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 20 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 149 (tag 149) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 21 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 150 (tag 150) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 22 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 151 (tag 151) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 23 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 152 (tag 152) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 24 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 153 (tag 153) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 25 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 154 (tag 154) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 26 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 155 (tag 155) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 27 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 156 (tag 156) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 28 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 157 (tag 157) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 29 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 158 (tag 158) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 30 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 159 (tag 159) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 31 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 160 (tag 160) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 32 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 161 (tag 161) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 33 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 162 (tag 162) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 34 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 163 (tag 163) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 35 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 164 (tag 164) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 36 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 165 (tag 165) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 37 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 166 (tag 166) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 38 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 167 (tag 167) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 39 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 168 (tag 168) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 40 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 169 (tag 169) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 41 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 170 (tag 170) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 42 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 171 (tag 171) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 43 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 172 (tag 172) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 44 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 173 (tag 173) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 45 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 174 (tag 174) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 46 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 175 (tag 175) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 47 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 176 (tag 176) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 48 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 177 (tag 177) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 49 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 178 (tag 178) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 50 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 179 (tag 179) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 51 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 180 (tag 180) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 52 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 181 (tag 181) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 53 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 182 (tag 182) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 54 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 183 (tag 183) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 55 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 184 (tag 184) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 56 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 185 (tag 185) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 57 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 186 (tag 186) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 58 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 187 (tag 187) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 59 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 188 (tag 188) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 60 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 189 (tag 189) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 61 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 190 (tag 190) + ================== + + +-----------------+----------+-----------------------------+ + | Name | Size | Contents | + +=================+==========+=============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of exactly 62 $X_5 | + +-----------------+----------+-----------------------------+ + + + case 191 (tag 191) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_5 | + +-----------------------+----------+-------------------------+ + + + case 192 (tag 192) + ================== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + case 193 (tag 193) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + case 195 (tag 195) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + case 200 (tag 200) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 208 (tag 208) + ================== + + +--------------+----------+------------------------+ + | Name | Size | Contents | + +==============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------+------------------------+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+------------------------+ + + + case 216 (tag 216) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 217 (tag 217) + ================== + + +-----------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+----------------------+-------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+-------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+-------------------------+ + + + case 218 (tag 218) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 219 (tag 219) + ================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | Determined from data | $X_0 | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | Determined from data | $inode_tree | + +-----------------+----------------------+------------------------+ + + + case 224 (tag 224) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_53820 (Determined from data, 8-bit tag) + ***************************************** + + case 0 (tag 0) + ============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | 2 bytes | signed 16-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 1 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 2 | 32 bytes | bytes | + +-----------------+----------------------+------------------------+ + | Unnamed field 3 | Determined from data | $tree_encoding | + +-----------------+----------------------+------------------------+ + + + X_53821 (Determined from data, 8-bit tag) + ***************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_53820 | + +-----------------+----------------------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--nonces--block_level : + +**GET ../<block_id>/context/nonces/<block_level>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--nonces--block_leveldescr', 'GET_..--block_id--context--nonces--block_level')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--nonces--block_leveloutput.json', 'GET_..--block_id--context--nonces--block_level')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--nonces--block_leveloutput.bin', 'GET_..--block_id--context--nonces--block_level')">Binary output</button> + </div><div id="GET_..--block_id--context--nonces--block_leveldescr" class="GET_..--block_id--context--nonces--block_level tabcontent"> + <p> + Info about the nonce of a previous block.</p> + </div> + <div id="GET_..--block_id--context--nonces--block_leveloutput.json" class="GET_..--block_id--context--nonces--block_level tabcontent"> + <pre> + { /* Revealed */ + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Missing */ + "hash": $cycle_nonce } + || { /* Forgotten */ + } + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--nonces--block_leveloutput.bin" class="GET_..--block_id--context--nonces--block_level tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + Revealed (tag 0) + ================ + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Missing (tag 1) + =============== + + +------+----------+------------------------+ + | Name | Size | Contents | + +======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------+------------------------+ + | hash | 32 bytes | bytes | + +------+----------+------------------------+ + + + Forgotten (tag 2) + ================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--raw--bytes : + +**GET ../<block_id>/context/raw/bytes(/<context_path>)*?[depth=<uint>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--raw--bytesdescr', 'GET_..--block_id--context--raw--bytes')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--raw--bytesoutput.json', 'GET_..--block_id--context--raw--bytes')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--raw--bytesoutput.bin', 'GET_..--block_id--context--raw--bytes')">Binary output</button> + </div><div id="GET_..--block_id--context--raw--bytesdescr" class="GET_..--block_id--context--raw--bytes tabcontent"> + <p> + Returns the raw context.</p> <p>Optional query arguments :<ul><li><span class="query">depth = <uint></span></li></ul></p> + </div> + <div id="GET_..--block_id--context--raw--bytesoutput.json" class="GET_..--block_id--context--raw--bytes tabcontent"> + <pre> + $raw_context + $raw_context: + /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + /* Key */ + || { /* Dir */ + *: $raw_context } + || null + /* Cut */</pre> + </div> + <div id="GET_..--block_id--context--raw--bytesoutput.bin" class="GET_..--block_id--context--raw--bytes tabcontent"> + <pre> + +-----------------+----------------------+--------------+ + | Name | Size | Contents | + +=================+======================+==============+ + | Unnamed field 0 | Determined from data | $raw_context | + +-----------------+----------------------+--------------+ + + + X_1 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------+----------------------+--------------+ + | Name | Size | Contents | + +=================+======================+==============+ + | Unnamed field 0 | Determined from data | $X_1 | + +-----------------+----------------------+--------------+ + | Unnamed field 1 | Determined from data | $raw_context | + +-----------------+----------------------+--------------+ + + + raw_context (Determined from data, 8-bit tag) + ********************************************* + + Key (tag 0) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Dir (tag 1) + =========== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + Cut (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--sapling--sapling_state_id--get_diff : + +**GET ../<block_id>/context/sapling/<sapling_state_id>/get_diff?[offset_commitment=<uint63>]&[offset_nullifier=<uint63>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--sapling--sapling_state_id--get_diffdescr', 'GET_..--block_id--context--sapling--sapling_state_id--get_diff')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--sapling--sapling_state_id--get_diffoutput.json', 'GET_..--block_id--context--sapling--sapling_state_id--get_diff')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--sapling--sapling_state_id--get_diffoutput.bin', 'GET_..--block_id--context--sapling--sapling_state_id--get_diff')">Binary output</button> + </div><div id="GET_..--block_id--context--sapling--sapling_state_id--get_diffdescr" class="GET_..--block_id--context--sapling--sapling_state_id--get_diff tabcontent"> + <p> + Returns the root and a diff of a state starting from an optional offset which is zero by default.</p> <p>Optional query arguments :<ul><li><span class="query">offset_commitment = <uint63></span> : Commitments and ciphertexts are returned from the specified offset up to the most recent.</li><li><span class="query">offset_nullifier = <uint63></span> : Nullifiers are returned from the specified offset up to the most recent.</li></ul></p> + </div> + <div id="GET_..--block_id--context--sapling--sapling_state_id--get_diffoutput.json" class="GET_..--block_id--context--sapling--sapling_state_id--get_diff tabcontent"> + <pre> + { "root": $sapling.transaction.commitment_hash, + "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_hash: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/</pre> + </div> + <div id="GET_..--block_id--context--sapling--sapling_state_id--get_diffoutput.bin" class="GET_..--block_id--context--sapling--sapling_state_id--get_diff tabcontent"> + <pre> + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | root | 32 bytes | bytes | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_0 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + </pre> + </div> + + + +.. _POST_..--block_id--context--seed : + +**POST ../<block_id>/context/seed** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--context--seeddescr', 'POST_..--block_id--context--seed')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--seedinput.json', 'POST_..--block_id--context--seed')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--seedinput.bin', 'POST_..--block_id--context--seed')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--seedoutput.json', 'POST_..--block_id--context--seed')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--context--seedoutput.bin', 'POST_..--block_id--context--seed')">Binary output</button> + </div><div id="POST_..--block_id--context--seeddescr" class="POST_..--block_id--context--seed tabcontent"> + <p> + Seed of the cycle to which the block belongs.</p> + </div> + <div id="POST_..--block_id--context--seedinput.json" class="POST_..--block_id--context--seed tabcontent"> + <pre> + { }</pre> + </div> + <div id="POST_..--block_id--context--seedinput.bin" class="POST_..--block_id--context--seed tabcontent"> + <pre> + This value's binary representation is empty. It takes zero (0) bytes of output. + </pre> + </div> + <div id="POST_..--block_id--context--seedoutput.json" class="POST_..--block_id--context--seed tabcontent"> + <pre> + /^([a-zA-Z0-9][a-zA-Z0-9])*$/</pre> + </div> + <div id="POST_..--block_id--context--seedoutput.bin" class="POST_..--block_id--context--seed tabcontent"> + <pre> + +-----------------+----------+----------+ + | Name | Size | Contents | + +=================+==========+==========+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--seed_computation : + +**GET ../<block_id>/context/seed_computation** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--seed_computationdescr', 'GET_..--block_id--context--seed_computation')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--seed_computationoutput.json', 'GET_..--block_id--context--seed_computation')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--seed_computationoutput.bin', 'GET_..--block_id--context--seed_computation')">Binary output</button> + </div><div id="GET_..--block_id--context--seed_computationdescr" class="GET_..--block_id--context--seed_computation tabcontent"> + <p> + Seed computation status</p> + </div> + <div id="GET_..--block_id--context--seed_computationoutput.json" class="GET_..--block_id--context--seed_computation tabcontent"> + <pre> + { /* Nonce revelation stage */ + "nonce_revelation_stage": any } + || { /* VDF revelation stage */ + "seed_discriminant": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_challenge": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Computation finished */ + "computation_finished": any }</pre> + </div> + <div id="GET_..--block_id--context--seed_computationoutput.bin" class="GET_..--block_id--context--seed_computation tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + Nonce revelation stage (tag 0) + ============================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + VDF revelation stage (tag 1) + ============================ + + +-------------------+----------+------------------------+ + | Name | Size | Contents | + +===================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------+------------------------+ + | seed_discriminant | 32 bytes | bytes | + +-------------------+----------+------------------------+ + | seed_challenge | 32 bytes | bytes | + +-------------------+----------+------------------------+ + + + Computation finished (tag 2) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--selected_snapshot : + +**GET ../<block_id>/context/selected_snapshot?[cycle=<block_cycle>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--selected_snapshotdescr', 'GET_..--block_id--context--selected_snapshot')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--selected_snapshotoutput.json', 'GET_..--block_id--context--selected_snapshot')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--selected_snapshotoutput.bin', 'GET_..--block_id--context--selected_snapshot')">Binary output</button> + </div><div id="GET_..--block_id--context--selected_snapshotdescr" class="GET_..--block_id--context--selected_snapshot tabcontent"> + <p> + Returns the index of the selected snapshot for the current cycle or for the specific `cycle` passed as argument, if any.</p> <p>Optional query arguments :<ul><li><span class="query">cycle = <block_cycle></span></li></ul></p> + </div> + <div id="GET_..--block_id--context--selected_snapshotoutput.json" class="GET_..--block_id--context--selected_snapshot tabcontent"> + <pre> + integer ∈ [-2^30, 2^30]</pre> + </div> + <div id="GET_..--block_id--context--selected_snapshotoutput.bin" class="GET_..--block_id--context--selected_snapshot tabcontent"> + <pre> + +-----------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=================+=========+==============================================================+ + | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------+---------+--------------------------------------------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level : + +**GET ../<block_id>/context/tx_rollup/<tx_rollup_id>/commitment/<block_level>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveldescr', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveloutput.json', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveloutput.bin', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level')">Binary output</button> + </div><div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveldescr" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level tabcontent"> + <p> + Return the commitment for a level, if any</p> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveloutput.json" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level tabcontent"> + <pre> + { /* Some */ + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": + { "count": integer ∈ [-2^30, 2^30], + "root": $Message_result_list_hash, + "last_message_result_hash": $Message_result_hash }, + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "commitment_hash": $Commitment_hash, + "committer": $Signature.Public_key_hash, + "submitted_at": integer ∈ [-2^31-1, 2^31], + "finalized_at"?: integer ∈ [-2^31-1, 2^31] } + || null + /* None */ + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_leveloutput.bin" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--commitment--block_level tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + + + X_1 + *** + + +--------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================+==========+==============================================================+ + | count | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------+----------+--------------------------------------------------------------+ + | root | 32 bytes | bytes | + +--------------------------+----------+--------------------------------------------------------------+ + | last_message_result_hash | 32 bytes | bytes | + +--------------------------+----------+--------------------------------------------------------------+ + + + X_2 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_0 + *** + + +-------------------+----------------------+-----------------------+ + | Name | Size | Contents | + +===================+======================+=======================+ + | level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+-----------------------+ + | messages | 68 bytes | $X_1 | + +-------------------+----------------------+-----------------------+ + | predecessor | Determined from data | $X_2 | + +-------------------+----------------------+-----------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-------------------+----------------------+-----------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_3 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +====================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------------+----------------------+-------------------------------------+ + | commitment | Determined from data | $X_0 | + +------------------------------------+----------------------+-------------------------------------+ + | commitment_hash | 32 bytes | bytes | + +------------------------------------+----------------------+-------------------------------------+ + | committer | 21 bytes | $public_key_hash | + +------------------------------------+----------------------+-------------------------------------+ + | submitted_at | 4 bytes | signed 32-bit integer | + +------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "finalized_at" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------------+----------------------+-------------------------------------+ + | finalized_at | 4 bytes | signed 32-bit integer | + +------------------------------------+----------------------+-------------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level : + +**GET ../<block_id>/context/tx_rollup/<tx_rollup_id>/inbox/<block_level>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveldescr', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveloutput.json', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveloutput.bin', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level')">Binary output</button> + </div><div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveldescr" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level tabcontent"> + <p> + Get the inbox of a transaction rollup</p> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveloutput.json" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level tabcontent"> + <pre> + { /* Some */ + "inbox_length": integer ∈ [-2^30, 2^30], + "cumulated_size": integer ∈ [-2^30, 2^30], + "merkle_root": $Inbox_list_hash } + || null + /* None */ + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_leveloutput.bin" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--inbox--block_level tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +================+==========+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+--------------------------------------------------------------+ + | inbox_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +----------------+----------+--------------------------------------------------------------+ + | cumulated_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +----------------+----------+--------------------------------------------------------------+ + | merkle_root | 32 bytes | bytes | + +----------------+----------+--------------------------------------------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh : + +**GET ../<block_id>/context/tx_rollup/<tx_rollup_id>/pending_bonded_commitments/<pkh>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhdescr', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhoutput.json', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhoutput.bin', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh')">Binary output</button> + </div><div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhdescr" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh tabcontent"> + <p> + Get the number of pending bonded commitments for a pkh on a rollup</p> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhoutput.json" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh tabcontent"> + <pre> + integer ∈ [-2^31-1, 2^31]</pre> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkhoutput.bin" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--pending_bonded_commitments--pkh tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--context--tx_rollup--tx_rollup_id--state : + +**GET ../<block_id>/context/tx_rollup/<tx_rollup_id>/state** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--statedescr', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--state')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--stateoutput.json', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--state')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--context--tx_rollup--tx_rollup_id--stateoutput.bin', 'GET_..--block_id--context--tx_rollup--tx_rollup_id--state')">Binary output</button> + </div><div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--statedescr" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--state tabcontent"> + <p> + Access the state of a rollup.</p> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--stateoutput.json" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--state tabcontent"> + <pre> + { "last_removed_commitment_hashes": + { /* Some */ + "last_message_hash": $Message_result_hash, + "commitment_hash": $Commitment_hash } + || null + /* None */, + "finalized_commitments": + { /* empty */ + "next": integer ∈ [-2^31-1, 2^31] } + || { /* interval */ + "newest": integer ∈ [-2^31-1, 2^31], + "oldest": integer ∈ [-2^31-1, 2^31] }, + "unfinalized_commitments": + { /* empty */ + "next": integer ∈ [-2^31-1, 2^31] } + || { /* interval */ + "newest": integer ∈ [-2^31-1, 2^31], + "oldest": integer ∈ [-2^31-1, 2^31] }, + "uncommitted_inboxes": + { /* empty */ + "next": integer ∈ [-2^31-1, 2^31] } + || { /* interval */ + "newest": integer ∈ [-2^31-1, 2^31], + "oldest": integer ∈ [-2^31-1, 2^31] }, + "commitment_newest_hash": $Commitment_hash /* Some */ || null /* None */, + "tezos_head_level": + integer ∈ [-2^31-1, 2^31] /* Some */ || null /* None */, + "burn_per_byte": $016-PtMumbai.mutez, + "allocated_storage": $positive_bignum, + "occupied_storage": $positive_bignum, + "inbox_ema": integer ∈ [-2^30, 2^30], + "commitments_watermark": + integer ∈ [-2^31-1, 2^31] /* Some */ || null /* None */ } + $016-PtMumbai.mutez: $positive_bignum + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--context--tx_rollup--tx_rollup_id--stateoutput.bin" class="GET_..--block_id--context--tx_rollup--tx_rollup_id--state tabcontent"> + <pre> + +--------------------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+==============================================================+ + | last_removed_commitment_hashes | Determined from data | $X_0 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | finalized_commitments | Determined from data | $X_1 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | unfinalized_commitments | Determined from data | $X_1 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | uncommitted_inboxes | Determined from data | $X_1 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | commitment_newest_hash | Determined from data | $X_4 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | tezos_head_level | Determined from data | $X_5 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | burn_per_byte | Determined from data | $N.t | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | allocated_storage | Determined from data | $N.t | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | occupied_storage | Determined from data | $N.t | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | inbox_ema | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + | commitments_watermark | Determined from data | $X_5 | + +--------------------------------+----------------------+--------------------------------------------------------------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-------------------+----------+------------------------+ + | Name | Size | Contents | + +===================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------+------------------------+ + | last_message_hash | 32 bytes | bytes | + +-------------------+----------+------------------------+ + | commitment_hash | 32 bytes | bytes | + +-------------------+----------+------------------------+ + + + X_1 (Determined from data, 8-bit tag) + ************************************* + + empty (tag 0) + ============= + + +------+---------+------------------------+ + | Name | Size | Contents | + +======+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+---------+------------------------+ + | next | 4 bytes | signed 32-bit integer | + +------+---------+------------------------+ + + + interval (tag 1) + ================ + + +--------+---------+------------------------+ + | Name | Size | Contents | + +========+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+---------+------------------------+ + | newest | 4 bytes | signed 32-bit integer | + +--------+---------+------------------------+ + | oldest | 4 bytes | signed 32-bit integer | + +--------+---------+------------------------+ + + + X_4 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_5 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + </pre> + </div> + + + +.. _GET_..--block_id--hash : + +**GET ../<block_id>/hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--hashdescr', 'GET_..--block_id--hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--hashoutput.json', 'GET_..--block_id--hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--hashoutput.bin', 'GET_..--block_id--hash')">Binary output</button> + </div><div id="GET_..--block_id--hashdescr" class="GET_..--block_id--hash tabcontent"> + <p> + The block's hash, its unique identifier.</p> + </div> + <div id="GET_..--block_id--hashoutput.json" class="GET_..--block_id--hash tabcontent"> + <pre> + $unistring + /* A block identifier (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--hashoutput.bin" class="GET_..--block_id--hash tabcontent"> + <pre> + +------------+----------+----------+ + | Name | Size | Contents | + +============+==========+==========+ + | block_hash | 32 bytes | bytes | + +------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--header : + +**GET ../<block_id>/header** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--headerdescr', 'GET_..--block_id--header')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--headeroutput.json', 'GET_..--block_id--header')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--headeroutput.bin', 'GET_..--block_id--header')">Binary output</button> + </div><div id="GET_..--block_id--headerdescr" class="GET_..--block_id--header tabcontent"> + <p> + The whole block header.</p> + </div> + <div id="GET_..--block_id--headeroutput.json" class="GET_..--block_id--header tabcontent"> + <pre> + { /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $block_hash, + "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_id--headeroutput.bin" class="GET_..--block_id--header tabcontent"> + <pre> + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | chain_id | 4 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--header--protocol_data : + +**GET ../<block_id>/header/protocol_data** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--header--protocol_datadescr', 'GET_..--block_id--header--protocol_data')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--protocol_dataoutput.json', 'GET_..--block_id--header--protocol_data')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--protocol_dataoutput.bin', 'GET_..--block_id--header--protocol_data')">Binary output</button> + </div><div id="GET_..--block_id--header--protocol_datadescr" class="GET_..--block_id--header--protocol_data tabcontent"> + <p> + The version-specific fragment of the block header.</p> + </div> + <div id="GET_..--block_id--header--protocol_dataoutput.json" class="GET_..--block_id--header--protocol_data tabcontent"> + <pre> + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_id--header--protocol_dataoutput.bin" class="GET_..--block_id--header--protocol_data tabcontent"> + <pre> + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + </pre> + </div> + + +.. _GET_..--block_id--header--protocol_data--raw : + +**GET ../<block_id>/header/protocol_data/raw** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--header--protocol_data--rawdescr', 'GET_..--block_id--header--protocol_data--raw')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--protocol_data--rawoutput.json', 'GET_..--block_id--header--protocol_data--raw')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--protocol_data--rawoutput.bin', 'GET_..--block_id--header--protocol_data--raw')">Binary output</button> + </div><div id="GET_..--block_id--header--protocol_data--rawdescr" class="GET_..--block_id--header--protocol_data--raw tabcontent"> + <p> + The version-specific fragment of the block header (unparsed).</p> + </div> + <div id="GET_..--block_id--header--protocol_data--rawoutput.json" class="GET_..--block_id--header--protocol_data--raw tabcontent"> + <pre> + /^([a-zA-Z0-9][a-zA-Z0-9])*$/</pre> + </div> + <div id="GET_..--block_id--header--protocol_data--rawoutput.bin" class="GET_..--block_id--header--protocol_data--raw tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--header--raw : + +**GET ../<block_id>/header/raw** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--header--rawdescr', 'GET_..--block_id--header--raw')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--rawoutput.json', 'GET_..--block_id--header--raw')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--rawoutput.bin', 'GET_..--block_id--header--raw')">Binary output</button> + </div><div id="GET_..--block_id--header--rawdescr" class="GET_..--block_id--header--raw tabcontent"> + <p> + The whole block header (unparsed).</p> + </div> + <div id="GET_..--block_id--header--rawoutput.json" class="GET_..--block_id--header--raw tabcontent"> + <pre> + /^([a-zA-Z0-9][a-zA-Z0-9])*$/</pre> + </div> + <div id="GET_..--block_id--header--rawoutput.bin" class="GET_..--block_id--header--raw tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--header--shell : + +**GET ../<block_id>/header/shell** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--header--shelldescr', 'GET_..--block_id--header--shell')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--shelloutput.json', 'GET_..--block_id--header--shell')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--header--shelloutput.bin', 'GET_..--block_id--header--shell')">Binary output</button> + </div><div id="GET_..--block_id--header--shelldescr" class="GET_..--block_id--header--shell tabcontent"> + <p> + The shell-specific fragment of the block header.</p> + </div> + <div id="GET_..--block_id--header--shelloutput.json" class="GET_..--block_id--header--shell tabcontent"> + <pre> + { /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash } + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--header--shelloutput.bin" class="GET_..--block_id--header--shell tabcontent"> + <pre> + +----------------------------+----------+---------------------------+ + | Name | Size | Contents | + +============================+==========+===========================+ + | level | 4 bytes | signed 32-bit integer | + +----------------------------+----------+---------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | predecessor | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +----------------------------+----------+---------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | operations_hash | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +----------------------------+----------+---------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +----------------------------+----------+---------------------------+ + | context | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--helpers--complete--prefix : + +**GET ../<block_id>/helpers/complete/<prefix>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--helpers--complete--prefixdescr', 'GET_..--block_id--helpers--complete--prefix')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--helpers--complete--prefixoutput.json', 'GET_..--block_id--helpers--complete--prefix')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--helpers--complete--prefixoutput.bin', 'GET_..--block_id--helpers--complete--prefix')">Binary output</button> + </div><div id="GET_..--block_id--helpers--complete--prefixdescr" class="GET_..--block_id--helpers--complete--prefix tabcontent"> + <p> + Try to complete a prefix of a Base58Check-encoded data. This RPC is actually able to complete hashes of block, operations, public_keys and contracts.</p> + </div> + <div id="GET_..--block_id--helpers--complete--prefixoutput.json" class="GET_..--block_id--helpers--complete--prefix tabcontent"> + <pre> + [ $unistring ... ] + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--helpers--complete--prefixoutput.bin" class="GET_..--block_id--helpers--complete--prefix tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _POST_..--block_id--helpers--forge_block_header : + +**POST ../<block_id>/helpers/forge_block_header** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--helpers--forge_block_headerdescr', 'POST_..--block_id--helpers--forge_block_header')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--forge_block_headerinput.json', 'POST_..--block_id--helpers--forge_block_header')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--forge_block_headerinput.bin', 'POST_..--block_id--helpers--forge_block_header')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--forge_block_headeroutput.json', 'POST_..--block_id--helpers--forge_block_header')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--forge_block_headeroutput.bin', 'POST_..--block_id--helpers--forge_block_header')">Binary output</button> + </div><div id="POST_..--block_id--helpers--forge_block_headerdescr" class="POST_..--block_id--helpers--forge_block_header tabcontent"> + <p> + Forge a block header</p> + </div> + <div id="POST_..--block_id--helpers--forge_block_headerinput.json" class="POST_..--block_id--helpers--forge_block_header tabcontent"> + <pre> + { /* Block header + Block header. It contains both shell and protocol specific data. */ + "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "protocol_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="POST_..--block_id--helpers--forge_block_headerinput.bin" class="POST_..--block_id--helpers--forge_block_header tabcontent"> + <pre> + +----------------------------+----------+---------------------------+ + | Name | Size | Contents | + +============================+==========+===========================+ + | level | 4 bytes | signed 32-bit integer | + +----------------------------+----------+---------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | predecessor | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +----------------------------+----------+---------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | operations_hash | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +----------------------------+----------+---------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +----------------------------+----------+---------------------------+ + | context | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | protocol_data | Variable | bytes | + +----------------------------+----------+---------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + <div id="POST_..--block_id--helpers--forge_block_headeroutput.json" class="POST_..--block_id--helpers--forge_block_header tabcontent"> + <pre> + { "block": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }</pre> + </div> + <div id="POST_..--block_id--helpers--forge_block_headeroutput.bin" class="POST_..--block_id--helpers--forge_block_header tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | block | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _POST_..--block_id--helpers--preapply--block : + +**POST ../<block_id>/helpers/preapply/block?[sort]&[timestamp=<date>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--blockdescr', 'POST_..--block_id--helpers--preapply--block')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--blockinput.json', 'POST_..--block_id--helpers--preapply--block')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--blockinput.bin', 'POST_..--block_id--helpers--preapply--block')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--blockoutput.json', 'POST_..--block_id--helpers--preapply--block')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--blockoutput.bin', 'POST_..--block_id--helpers--preapply--block')">Binary output</button> + </div><div id="POST_..--block_id--helpers--preapply--blockdescr" class="POST_..--block_id--helpers--preapply--block tabcontent"> + <p> + Simulate the validation of a block that would contain the given operations and return the resulting fitness and context hash.</p> <p>Optional query arguments :<ul><li><span class="query">sort</span></li><li><span class="query">timestamp = <date></span></li></ul></p> + </div> + <div id="POST_..--block_id--helpers--preapply--blockinput.json" class="POST_..--block_id--helpers--preapply--block tabcontent"> + <pre> + { "protocol_data": + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 }, + "operations": [ [ $next_operation ... ] ... ] } + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $next_operation: + /* An operation's shell header. */ + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="POST_..--block_id--helpers--preapply--blockinput.bin" class="POST_..--block_id--helpers--preapply--block tabcontent"> + <pre> + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | protocol_data | Determined from data | $X_0 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | operations | Variable | sequence of $X_1 | + +-----------------------+----------------------+-------------------------+ + + + X_0 + *** + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | # bytes in next 7 fields | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_4 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_5 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_3 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_4 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_5 | + +-----------------+----------------------+----------+ + + + X_8 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_6 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_4 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_8 | + +-----------------+----------------------+----------+ + + + X_9 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_2 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_6 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_9 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_12 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_11 + **** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_12 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_15 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_10 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_11 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_15 | + +-----------------+----------------------+----------+ + + + X_18 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_16 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_4 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_18 | + +-----------------+----------------------+----------+ + + + X_19 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_20 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_22 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_23 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_22 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_24 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_23 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_25 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_26 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_25 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_24 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_21 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_26 | + +--------+----------------------+----------+ + + + X_27 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_29 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_31 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_30 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_31 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_32 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_31 | + +-------------+----------------------+------------------+ + + + X_34 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_32 | + +---------+----------------------+------------------------+ + + + X_35 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_37 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_36 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_37 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_38 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_39 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_39 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_38 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_36 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_34 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_35 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_30 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_29) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_4 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_27 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_21 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_20 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_19 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_16 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_10 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_2 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + next_operation + ************** + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | branch | 32 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + X_1 + *** + + +--------------------------+----------+-----------------------------+ + | Name | Size | Contents | + +==========================+==========+=============================+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-----------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of $next_operation | + +--------------------------+----------+-----------------------------+ + + </pre> + </div> + <div id="POST_..--block_id--helpers--preapply--blockoutput.json" class="POST_..--block_id--helpers--preapply--block tabcontent"> + <pre> + { "shell_header": $block_header.shell, + "operations": + [ { "applied": + [ { /* An operation. The shell_header part indicates a block an + operation is meant to apply on top of. The proto part is + protocol-specific and appears as a binary blob. */ + "hash": $Operation_hash, + "branch": $block_hash, + "data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ... ], + "refused": + [ { /* An operation. The shell_header part indicates a block an + operation is meant to apply on top of. The proto part is + protocol-specific and appears as a binary blob. */ + "hash": $Operation_hash, + "branch": $block_hash, + "data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "error": $error } ... ], + "outdated": + [ { /* An operation. The shell_header part indicates a block an + operation is meant to apply on top of. The proto part is + protocol-specific and appears as a binary blob. */ + "hash": $Operation_hash, + "branch": $block_hash, + "data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "error": $error } ... ], + "branch_refused": + [ { /* An operation. The shell_header part indicates a block an + operation is meant to apply on top of. The proto part is + protocol-specific and appears as a binary blob. */ + "hash": $Operation_hash, + "branch": $block_hash, + "data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "error": $error } ... ], + "branch_delayed": + [ { /* An operation. The shell_header part indicates a block an + operation is meant to apply on top of. The proto part is + protocol-specific and appears as a binary blob. */ + "hash": $Operation_hash, + "branch": $block_hash, + "data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "error": $error } ... ] } ... ] } + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $block_header.shell: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash } + $error: + /* The full list of errors is available with the global RPC `GET errors` */ + any + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="POST_..--block_id--helpers--preapply--blockoutput.bin" class="POST_..--block_id--helpers--preapply--block tabcontent"> + <pre> + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | shell_header | Determined from data | $block_header.shell | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | operations | Variable | sequence of $X_0 | + +-----------------------+----------------------+-------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + block_header.shell + ****************** + + +----------------------------+----------+---------------------------+ + | Name | Size | Contents | + +============================+==========+===========================+ + | level | 4 bytes | signed 32-bit integer | + +----------------------------+----------+---------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | predecessor | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +----------------------------+----------+---------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +----------------------------+----------+---------------------------+ + | operations_hash | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +----------------------------+----------+---------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +----------------------------+----------+---------------------------+ + | context | 32 bytes | bytes | + +----------------------------+----------+---------------------------+ + + + X_1 + *** + + +--------------------------+----------+-------------------------+ + | Name | Size | Contents | + +==========================+==========+=========================+ + | hash | 32 bytes | bytes | + +--------------------------+----------+-------------------------+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +--------------------------+----------+-------------------------+ + | data | Variable | bytes | + +--------------------------+----------+-------------------------+ + + + X_2 + *** + + +--------------------------+----------+-------------------------+ + | Name | Size | Contents | + +==========================+==========+=========================+ + | hash | 32 bytes | bytes | + +--------------------------+----------+-------------------------+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +--------------------------+----------+-------------------------+ + | data | Variable | bytes | + +--------------------------+----------+-------------------------+ + | # bytes in field "error" | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | error | Variable | bytes | + +--------------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | applied | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | refused | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | outdated | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch_refused | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch_delayed | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _POST_..--block_id--helpers--preapply--operations : + +**POST ../<block_id>/helpers/preapply/operations** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--operationsdescr', 'POST_..--block_id--helpers--preapply--operations')">Description</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--operationsinput.json', 'POST_..--block_id--helpers--preapply--operations')">Json input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--operationsinput.bin', 'POST_..--block_id--helpers--preapply--operations')">Binary input</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--operationsoutput.json', 'POST_..--block_id--helpers--preapply--operations')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'POST_..--block_id--helpers--preapply--operationsoutput.bin', 'POST_..--block_id--helpers--preapply--operations')">Binary output</button> + </div><div id="POST_..--block_id--helpers--preapply--operationsdescr" class="POST_..--block_id--helpers--preapply--operations tabcontent"> + <p> + Simulate the application of the operations with the context of the given block and return the result of each operation application.</p> + </div> + <div id="POST_..--block_id--helpers--preapply--operationsinput.json" class="POST_..--block_id--helpers--preapply--operations tabcontent"> + <pre> + [ $next_operation ... ] + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $next_operation: + /* An operation's shell header. */ + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="POST_..--block_id--helpers--preapply--operationsinput.bin" class="POST_..--block_id--helpers--preapply--operations tabcontent"> + <pre> + +-----------------------+----------+-----------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------+ + | Unnamed field 0 | Variable | sequence of $next_operation | + +-----------------------+----------+-----------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + + + X_6 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_4 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_6 | + +-----------------+----------------------+----------+ + + + X_7 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_1 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_4 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_7 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_10 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_9 + *** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_10 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_13 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_8 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_9 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_13 | + +-----------------+----------------------+----------+ + + + X_16 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_14 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_16 | + +-----------------+----------------------+----------+ + + + X_17 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_18 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_20 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_21 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_20 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_22 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_21 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_23 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_24 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_23 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_22 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_19 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_24 | + +--------+----------------------+----------+ + + + X_25 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_27 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_29 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_28 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_29 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_30 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_29 | + +-------------+----------------------+------------------+ + + + X_32 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_30 | + +---------+----------------------+------------------------+ + + + X_33 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_35 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_34 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_35 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_36 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_37 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_37 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + next_operation + ************** + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | branch | 32 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + </pre> + </div> + <div id="POST_..--block_id--helpers--preapply--operationsoutput.json" class="POST_..--block_id--helpers--preapply--operations tabcontent"> + <pre> + [ $016-PtMumbai.operation.alpha.operation_with_metadata ... ] + $016-PtMumbai.apply_internal_results.alpha.operation_result: + { /* transaction */ + "kind": "transaction", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.transaction_destination, + "parameters"?: { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.transaction } + || { /* origination */ + "kind": "origination", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.origination } + || { /* delegation */ + "kind": "delegation", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "delegate"?: $Signature.Public_key_hash, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.delegation } + || { /* event */ + "kind": "event", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "type": $micheline.016-PtMumbai.michelson_v1.expression, + "tag"?: $016-PtMumbai.entrypoint, + "payload"?: $micheline.016-PtMumbai.michelson_v1.expression, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.event } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.error: + /* The full list of RPC errors would be too long to include. + It is available at RPC `/errors` (GET). + Errors specific to protocol Alpha have an id that starts with + `proto.alpha`. */ + any + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.operation.alpha.internal_operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.event: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.internal_operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_contents_and_result: + { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "endorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "preendorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31], + "metadata": { "delegate": $Signature.Public_key_hash } } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ], + "metadata": { } } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass", + "metadata": { } } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.reveal, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transaction, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.delegation, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.register_global_constant, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "allocated_destination_contract"?: boolean } } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.operation_result.register_global_constant: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + $016-PtMumbai.operation.alpha.operation_result.reveal: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_with_metadata: + { /* Operation_with_metadata */ + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* Operation_without_metadata */ + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="POST_..--block_id--helpers--preapply--operationsoutput.bin" class="POST_..--block_id--helpers--preapply--operations tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_3 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_4 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_2 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_4 | + +-----------------+----------------------+----------+ + + + X_7 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_5 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_7 | + +-----------------+----------------------+----------+ + + + X_8 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_1 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_5 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_8 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_11 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_10 + **** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_11 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_14 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_9 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_10 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_14 | + +-----------------+----------------------+----------+ + + + X_17 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_15 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_17 | + +-----------------+----------------------+----------+ + + + X_18 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_19 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_21 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_22 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_21 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_23 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_22 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_24 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_25 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_24 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_23 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_20 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_25 | + +--------+----------------------+----------+ + + + X_26 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_28 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_30 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_29 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_30 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_31 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_30 | + +-------------+----------------------+------------------+ + + + X_33 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_31 | + +---------+----------------------+------------------------+ + + + X_34 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_36 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_35 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_36 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_37 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_38 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents (Determined from data, 8-bit tag) + *********************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_38 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_35 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_33 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_34 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_29 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_28) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_26 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_20 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_19 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_15 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_9 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_1 | + +---------------+----------------------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_49 (Determined from data, 8-bit tag) + ************************************** + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_50 (1 byte, 8-bit tag) + ************************ + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_48 + **** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_49 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_50 | + +-----------------+----------------------+-----------------------+ + + + X_51 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_update (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.event (Determined from data, 8-bit tag) + ********************************************************************************************** + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_67 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_66 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_67 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_72 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_66 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_66 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_66 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + X_73 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_84 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_85 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_84 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_72 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_85 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.origination (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_112 + ***** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + X_115 + ***** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_111 + ***** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_112 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_115 | + +-----------------------+----------------------+-------------------------+ + + + X_148 (Determined from data, 8-bit tag) + *************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_receipt | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_receipt | Variable | sequence of $X_111 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.transaction (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_148 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_148 | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.apply_internal_results.alpha.operation_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + transaction (tag 1) + =================== + + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.transaction_destination | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.transaction | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + + + delegation (tag 3) + ================== + + +--------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------+----------------------+---------------------------------------------------------------+ + + + event (tag 4) + ============= + + +-------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "tag" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | tag | Determined from data | $016-PtMumbai.entrypoint | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "payload" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | payload | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +-------------------------------+----------------------+---------------------------------------------------------------+ + + + X_47 + **** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_193 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_336 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_477 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_611 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message (Determined from data, 8-bit tag) + **************************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_751 + ***** + + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=================================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + + + X_907 (1 byte, 8-bit tag) + ************************* + + Conflict_resolved (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Timeout (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_908 (Determined from data, 8-bit tag) + *************************************** + + Loser (tag 0) + ============= + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | reason | 1 byte | $X_907 | + +--------+----------+------------------------+ + | player | 21 bytes | $public_key_hash | + +--------+----------+------------------------+ + + + Draw (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_909 (Determined from data, 8-bit tag) + *************************************** + + Ongoing (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Ended (tag 1) + ============= + + +--------+----------------------+------------------------+ + | Name | Size | Contents | + +========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------------------+------------------------+ + | result | Determined from data | $X_908 | + +--------+----------------------+------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | game_status | Determined from data | $X_909 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | game_status | Determined from data | $X_909 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_902 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1201 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------------------+ + + + X_1341 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate (Determined from data, 8-bit tag) + *************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1611 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment (Determined from data, 8-bit tag) + *********************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2187 + ****** + + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+============================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2749 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2889 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.register_global_constant (Determined from data, 8-bit tag) + ******************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_3437 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.register_global_constant | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3711 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3934 (Determined from data, 8-bit tag) + **************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.transaction (Determined from data, 8-bit tag) + ******************************************************************************************* + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_3934 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_3934 | + +------------------------------+----------------------+-------------------------------------+ + + + X_3892 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.transaction | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_4236 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | endorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4240 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | preendorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4244 + ****** + + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+=====================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.operation_metadata.alpha.balance_updates + ***************************************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_48 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | nonce | 32 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | pkh | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | secret | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | solution | 200 bytes | $X_38 | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_4244 | + +---------------+----------------------+------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4240 | + +--------------------+----------------------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4236 | + +--------------------+----------------------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + | metadata | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3892 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3711 | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_477 | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_3437 | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_477 | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2889 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_2749 | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_35 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2187 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2187 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_33 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_34 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_611 | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_29 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_47 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | metadata | Determined from data | $X_751 | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_28) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | metadata | Determined from data | $X_1611 | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_477 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1341 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_26 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1201 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_20 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_902 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_19 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_902 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_751 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_18 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_15 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_336 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_9 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_193 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_1 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_47 | + +---------------+----------------------+------------------------+ + + + X_4267 (Variable, 8-bit tag) + **************************** + + Operation_with_metadata (tag 0) + =============================== + + +-----------------------+----------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.operation_contents_and_result | + +-----------------------+----------+-------------------------------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------+ + + + Operation_without_metadata (tag 1) + ================================== + + +-----------------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+====================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.contents | + +-----------------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+----------------------------------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | $X_4267 | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--live_blocks : + +**GET ../<block_id>/live_blocks** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--live_blocksdescr', 'GET_..--block_id--live_blocks')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--live_blocksoutput.json', 'GET_..--block_id--live_blocks')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--live_blocksoutput.bin', 'GET_..--block_id--live_blocks')">Binary output</button> + </div><div id="GET_..--block_id--live_blocksdescr" class="GET_..--block_id--live_blocks tabcontent"> + <p> + List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.</p> + </div> + <div id="GET_..--block_id--live_blocksoutput.json" class="GET_..--block_id--live_blocks tabcontent"> + <pre> + [ $block_hash ... ] + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--live_blocksoutput.bin" class="GET_..--block_id--live_blocks tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--metadata : + +**GET ../<block_id>/metadata** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--metadatadescr', 'GET_..--block_id--metadata')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--metadataoutput.json', 'GET_..--block_id--metadata')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--metadataoutput.bin', 'GET_..--block_id--metadata')">Binary output</button> + </div><div id="GET_..--block_id--metadatadescr" class="GET_..--block_id--metadata tabcontent"> + <p> + All the metadata associated to the block.</p> + </div> + <div id="GET_..--block_id--metadataoutput.json" class="GET_..--block_id--metadata tabcontent"> + <pre> + { "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "next_protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "test_chain_status": $test_chain_status, + "max_operations_ttl": integer ∈ [-2^30, 2^30], + "max_operation_data_length": integer ∈ [-2^30, 2^30], + "max_block_header_length": integer ∈ [-2^30, 2^30], + "max_operation_list_length": + [ { "max_size": integer ∈ [-2^30, 2^30], + "max_op"?: integer ∈ [-2^30, 2^30] } ... ], + "proposer": $Signature.Public_key_hash, + "baker": $Signature.Public_key_hash, + "level_info": + { "level": + integer ∈ [-2^31-1, 2^31] + /* The level of the block relative to genesis. This is also the + Shell's notion of level. */, + "level_position": + integer ∈ [-2^31-1, 2^31] + /* The level of the block relative to the successor of the genesis + block. More precisely, it is the position of the block relative + to the block that starts the "Alpha family" of protocols, which + includes all protocols except Genesis (that is, from 001 + onwards). */, + "cycle": + integer ∈ [-2^31-1, 2^31] + /* The current cycle's number. Note that cycles are a + protocol-specific notion. As a result, the cycle number starts + at 0 with the first block of the Alpha family of protocols. */, + "cycle_position": + integer ∈ [-2^31-1, 2^31] + /* The current level of the block relative to the first block of + the current cycle. */, + "expected_commitment": + boolean + /* Tells whether the baker of this block has to commit a seed nonce + hash. */ }, + "voting_period_info": + { "voting_period": + { /* The voting period to which the block belongs. */ + "index": + integer ∈ [-2^31-1, 2^31] + /* The voting period's index. Starts at 0 with the first block + of the Alpha family of protocols. */, + "kind": + /* One of the several kinds of periods in the voting procedure. */ + "proposal" + || "exploration" + || "cooldown" + || "promotion" + || "adoption", + "start_position": + integer ∈ [-2^31-1, 2^31] + /* The relative position of the first level of the period with + respect to the first level of the Alpha family of protocols. */ }, + "position": + integer ∈ [-2^31-1, 2^31] + /* The position of the block within the voting period. */, + "remaining": + integer ∈ [-2^31-1, 2^31] + /* The number of blocks remaining till the end of the voting + period. */ }, + "nonce_hash": $cycle_nonce /* Some */ || null /* None */, + "deactivated": [ $Signature.Public_key_hash ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "liquidity_baking_toggle_ema": integer ∈ [-2^31-1, 2^31], + "implicit_operations_results": + [ $016-PtMumbai.operation.alpha.successful_manager_operation_result ... ], + "proposer_consensus_key": $Signature.Public_key_hash, + "baker_consensus_key": $Signature.Public_key_hash, + "consumed_milligas": $positive_bignum, + "dal_attestation"?: $bignum } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.operation.alpha.successful_manager_operation_result: + { /* reveal */ + "kind": "reveal", + "consumed_milligas"?: $positive_bignum } + || /* transaction */ + { /* To_contract */ + "kind": "transaction", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "kind": "transaction", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "kind": "transaction", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* origination */ + "kind": "origination", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* delegation */ + "kind": "delegation", + "consumed_milligas"?: $positive_bignum } + || { /* update_consensus_key */ + "kind": "update_consensus_key", + "consumed_milligas"?: $positive_bignum } + || { /* set_deposits_limit */ + "kind": "set_deposits_limit", + "consumed_milligas"?: $positive_bignum } + || { /* increase_paid_storage */ + "kind": "increase_paid_storage", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* sc_rollup_originate */ + "kind": "sc_rollup_originate", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $test_chain_status: + /* The status of the test chain: not_running (there is no test chain at + the moment), forking (the test chain is being setup), running (the + test chain is running). */ + { /* Not_running */ + "status": "not_running" } + || { /* Forking */ + "status": "forking", + "protocol": $Protocol_hash, + "expiration": $timestamp.protocol } + || { /* Running */ + "status": "running", + "chain_id": $Chain_id, + "genesis": $block_hash, + "protocol": $Protocol_hash, + "expiration": $timestamp.protocol } + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--metadataoutput.bin" class="GET_..--block_id--metadata tabcontent"> + <pre> + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+===============================================================================+ + | test_chain_status | Determined from data | $test_chain_status | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operations_ttl | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operation_data_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_block_header_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | max_operation_list_length | Determined from data | $X_0 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | proposer | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | baker | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | level_info | 17 bytes | $X_2 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | voting_period_info | 17 bytes | $X_3 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | nonce_hash | Determined from data | $X_6 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | deactivated | Variable | sequence of $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | liquidity_baking_toggle_ema | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | implicit_operations_results | Variable | sequence of $016-PtMumbai.operation.alpha.successful_manager_operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | proposer_consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | baker_consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + | dal_attestation | Variable | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------+ + + + test_chain_status (Determined from data, 8-bit tag) + *************************************************** + + Not_running (tag 0) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Forking (tag 1) + =============== + + +------------+----------+------------------------+ + | Name | Size | Contents | + +============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------+----------+------------------------+ + | protocol | 32 bytes | bytes | + +------------+----------+------------------------+ + | expiration | 8 bytes | signed 64-bit integer | + +------------+----------+------------------------+ + + + Running (tag 2) + =============== + + +------------+----------+------------------------+ + | Name | Size | Contents | + +============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------+----------+------------------------+ + | chain_id | 4 bytes | bytes | + +------------+----------+------------------------+ + | genesis | 32 bytes | bytes | + +------------+----------+------------------------+ + | protocol | 32 bytes | bytes | + +------------+----------+------------------------+ + | expiration | 8 bytes | signed 64-bit integer | + +------------+----------+------------------------+ + + + X_1 + *** + + +------------------------------+---------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==============================+=========+==============================================================+ + | max_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------------+---------+--------------------------------------------------------------+ + | ? presence of field "max_op" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+---------+--------------------------------------------------------------+ + | max_op | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +------------------------------+---------+--------------------------------------------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_1 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_2 + *** + + +---------------------+---------+-------------------------------------+ + | Name | Size | Contents | + +=====================+=========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | level_position | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | cycle | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | cycle_position | 4 bytes | signed 32-bit integer | + +---------------------+---------+-------------------------------------+ + | expected_commitment | 1 byte | boolean (0 for false, 255 for true) | + +---------------------+---------+-------------------------------------+ + + + X_5 (1 byte, 8-bit tag) + *********************** + + Proposal (tag 0) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + exploration (tag 1) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Cooldown (tag 2) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Promotion (tag 3) + ================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Adoption (tag 4) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_4 + *** + + +----------------+---------+-----------------------+ + | Name | Size | Contents | + +================+=========+=======================+ + | index | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + | kind | 1 byte | $X_5 | + +----------------+---------+-----------------------+ + | start_position | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + + + X_3 + *** + + +---------------+---------+-----------------------+ + | Name | Size | Contents | + +===============+=========+=======================+ + | voting_period | 9 bytes | $X_4 | + +---------------+---------+-----------------------+ + | position | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + | remaining | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + + + X_6 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | cycle_nonce | 32 bytes | bytes | + +-------------+----------+------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_8 (Determined from data, 8-bit tag) + ************************************* + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_9 (1 byte, 8-bit tag) + *********************** + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_7 + *** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_8 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_9 | + +-----------------+----------------------+-----------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_20 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_19 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_20 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_25 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_19 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_19 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_19 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_26 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_37 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_26 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_26 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_26 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_38 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_37 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_25 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_38 | + +-----------------------+----------+-------------------------+ + + + X_40 + **** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_43 + **** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_39 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_40 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_43 | + +-----------------------+----------------------+-------------------------+ + + + X_76 (Determined from data, 8-bit tag) + ************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_39 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_39 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.successful_manager_operation_result (Determined from data, 8-bit tag) + ************************************************************************************************** + + reveal (tag 0) + ============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + transaction (tag 1) + =================== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_76 | + +-----------------+----------------------+------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + delegation (tag 3) + ================== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + set_deposits_limit (tag 5) + ========================== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + update_consensus_key (tag 6) + ============================ + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + increase_paid_storage (tag 9) + ============================= + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + sc_rollup_originate (tag 200) + ============================= + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_7 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--metadata_hash : + +**GET ../<block_id>/metadata_hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--metadata_hashdescr', 'GET_..--block_id--metadata_hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--metadata_hashoutput.json', 'GET_..--block_id--metadata_hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--metadata_hashoutput.bin', 'GET_..--block_id--metadata_hash')">Binary output</button> + </div><div id="GET_..--block_id--metadata_hashdescr" class="GET_..--block_id--metadata_hash tabcontent"> + <p> + Hash of the metadata associated to the block. This is only set on blocks starting from environment V1.</p> + </div> + <div id="GET_..--block_id--metadata_hashoutput.json" class="GET_..--block_id--metadata_hash tabcontent"> + <pre> + $unistring + /* A Tezos block metadata ID (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--metadata_hashoutput.bin" class="GET_..--block_id--metadata_hash tabcontent"> + <pre> + +---------------------+----------+----------+ + | Name | Size | Contents | + +=====================+==========+==========+ + | Block_metadata_hash | 32 bytes | bytes | + +---------------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--operation_hashes : + +**GET ../<block_id>/operation_hashes** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_hashesdescr', 'GET_..--block_id--operation_hashes')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashesoutput.json', 'GET_..--block_id--operation_hashes')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashesoutput.bin', 'GET_..--block_id--operation_hashes')">Binary output</button> + </div><div id="GET_..--block_id--operation_hashesdescr" class="GET_..--block_id--operation_hashes tabcontent"> + <p> + The hashes of all the operations included in the block.</p> + </div> + <div id="GET_..--block_id--operation_hashesoutput.json" class="GET_..--block_id--operation_hashes tabcontent"> + <pre> + [ [ $Operation_hash ... ] ... ] + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_hashesoutput.bin" class="GET_..--block_id--operation_hashes tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--operation_hashes--list_offset : + +**GET ../<block_id>/operation_hashes/<list_offset>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offsetdescr', 'GET_..--block_id--operation_hashes--list_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offsetoutput.json', 'GET_..--block_id--operation_hashes--list_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offsetoutput.bin', 'GET_..--block_id--operation_hashes--list_offset')">Binary output</button> + </div><div id="GET_..--block_id--operation_hashes--list_offsetdescr" class="GET_..--block_id--operation_hashes--list_offset tabcontent"> + <p> + All the operations included in `n-th` validation pass of the block.</p> + </div> + <div id="GET_..--block_id--operation_hashes--list_offsetoutput.json" class="GET_..--block_id--operation_hashes--list_offset tabcontent"> + <pre> + [ $Operation_hash ... ] + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_hashes--list_offsetoutput.bin" class="GET_..--block_id--operation_hashes--list_offset tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + +.. _GET_..--block_id--operation_hashes--list_offset--operation_offset : + +**GET ../<block_id>/operation_hashes/<list_offset>/<operation_offset>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offset--operation_offsetdescr', 'GET_..--block_id--operation_hashes--list_offset--operation_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offset--operation_offsetoutput.json', 'GET_..--block_id--operation_hashes--list_offset--operation_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_hashes--list_offset--operation_offsetoutput.bin', 'GET_..--block_id--operation_hashes--list_offset--operation_offset')">Binary output</button> + </div><div id="GET_..--block_id--operation_hashes--list_offset--operation_offsetdescr" class="GET_..--block_id--operation_hashes--list_offset--operation_offset tabcontent"> + <p> + The hash of then `m-th` operation in the `n-th` validation pass of the block.</p> + </div> + <div id="GET_..--block_id--operation_hashes--list_offset--operation_offsetoutput.json" class="GET_..--block_id--operation_hashes--list_offset--operation_offset tabcontent"> + <pre> + $unistring + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_hashes--list_offset--operation_offsetoutput.bin" class="GET_..--block_id--operation_hashes--list_offset--operation_offset tabcontent"> + <pre> + +----------------+----------+----------+ + | Name | Size | Contents | + +================+==========+==========+ + | Operation_hash | 32 bytes | bytes | + +----------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--operation_metadata_hashes : + +**GET ../<block_id>/operation_metadata_hashes** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashesdescr', 'GET_..--block_id--operation_metadata_hashes')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashesoutput.json', 'GET_..--block_id--operation_metadata_hashes')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashesoutput.bin', 'GET_..--block_id--operation_metadata_hashes')">Binary output</button> + </div><div id="GET_..--block_id--operation_metadata_hashesdescr" class="GET_..--block_id--operation_metadata_hashes tabcontent"> + <p> + The hashes of all the operation metadata included in the block. This is only set on blocks starting from environment V1.</p> + </div> + <div id="GET_..--block_id--operation_metadata_hashesoutput.json" class="GET_..--block_id--operation_metadata_hashes tabcontent"> + <pre> + [ [ $Operation_metadata_hash ... ] ... ] + $Operation_metadata_hash: + /* A Tezos operation metadata ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_metadata_hashesoutput.bin" class="GET_..--block_id--operation_metadata_hashes tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--operation_metadata_hashes--list_offset : + +**GET ../<block_id>/operation_metadata_hashes/<list_offset>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offsetdescr', 'GET_..--block_id--operation_metadata_hashes--list_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offsetoutput.json', 'GET_..--block_id--operation_metadata_hashes--list_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offsetoutput.bin', 'GET_..--block_id--operation_metadata_hashes--list_offset')">Binary output</button> + </div><div id="GET_..--block_id--operation_metadata_hashes--list_offsetdescr" class="GET_..--block_id--operation_metadata_hashes--list_offset tabcontent"> + <p> + All the operation metadata included in `n-th` validation pass of the block. This is only set on blocks starting from environment V1.</p> + </div> + <div id="GET_..--block_id--operation_metadata_hashes--list_offsetoutput.json" class="GET_..--block_id--operation_metadata_hashes--list_offset tabcontent"> + <pre> + [ $Operation_metadata_hash ... ] + $Operation_metadata_hash: + /* A Tezos operation metadata ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_metadata_hashes--list_offsetoutput.bin" class="GET_..--block_id--operation_metadata_hashes--list_offset tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + </pre> + </div> + + +.. _GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset : + +**GET ../<block_id>/operation_metadata_hashes/<list_offset>/<operation_offset>** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetdescr', 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetoutput.json', 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetoutput.bin', 'GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset')">Binary output</button> + </div><div id="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetdescr" class="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset tabcontent"> + <p> + The hash of then `m-th` operation metadata in the `n-th` validation pass of the block. This is only set on blocks starting from environment V1.</p> + </div> + <div id="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetoutput.json" class="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset tabcontent"> + <pre> + $unistring + /* A Tezos operation metadata ID (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offsetoutput.bin" class="GET_..--block_id--operation_metadata_hashes--list_offset--operation_offset tabcontent"> + <pre> + +-------------------------+----------+----------+ + | Name | Size | Contents | + +=========================+==========+==========+ + | Operation_metadata_hash | 32 bytes | bytes | + +-------------------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--operations : + +**GET ../<block_id>/operations?[force_metadata]&[metadata=<metadata_rpc_arg>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operationsdescr', 'GET_..--block_id--operations')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operationsoutput.json', 'GET_..--block_id--operations')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operationsoutput.bin', 'GET_..--block_id--operations')">Binary output</button> + </div><div id="GET_..--block_id--operationsdescr" class="GET_..--block_id--operations tabcontent"> + <p> + All the operations included in the block.</p> <p>Optional query arguments :<ul><li><span class="query">force_metadata</span> : DEPRECATED: Forces to recompute the operations metadata if it was considered as too large.</li><li><span class="query">metadata = <metadata_rpc_arg></span> : Specifies whether or not if the operations metadata should be returned. To get the metadata, even if it is needed to recompute them, use "always". To avoid getting the metadata, use "never". By default, the metadata will be returned depending on the node's metadata size limit policy.</li></ul></p> + </div> + <div id="GET_..--block_id--operationsoutput.json" class="GET_..--block_id--operations tabcontent"> + <pre> + [ [ $operation ... ] ... ] + $016-PtMumbai.apply_internal_results.alpha.operation_result: + { /* transaction */ + "kind": "transaction", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.transaction_destination, + "parameters"?: { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.transaction } + || { /* origination */ + "kind": "origination", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.origination } + || { /* delegation */ + "kind": "delegation", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "delegate"?: $Signature.Public_key_hash, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.delegation } + || { /* event */ + "kind": "event", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "type": $micheline.016-PtMumbai.michelson_v1.expression, + "tag"?: $016-PtMumbai.entrypoint, + "payload"?: $micheline.016-PtMumbai.michelson_v1.expression, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.event } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.error: + /* The full list of RPC errors would be too long to include. + It is available at RPC `/errors` (GET). + Errors specific to protocol Alpha have an id that starts with + `proto.alpha`. */ + any + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.operation.alpha.contents_and_signature: + { "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation.alpha.internal_operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.event: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.internal_operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_contents_and_result: + { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "endorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "preendorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31], + "metadata": { "delegate": $Signature.Public_key_hash } } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ], + "metadata": { } } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass", + "metadata": { } } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.reveal, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transaction, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.delegation, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.register_global_constant, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "allocated_destination_contract"?: boolean } } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.operation_result.register_global_constant: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + $016-PtMumbai.operation.alpha.operation_result.reveal: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_with_metadata: + { /* Operation_with_metadata */ + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* Operation_without_metadata */ + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $operation: + { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1, + "metadata": "too large" } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_id--operationsoutput.bin" class="GET_..--block_id--operations tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_3 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_4 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_2 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_4 | + +-----------------+----------------------+----------+ + + + X_7 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_5 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_7 | + +-----------------+----------------------+----------+ + + + X_8 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_1 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_5 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_8 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_11 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_10 + **** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_11 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_14 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_9 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_10 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_14 | + +-----------------+----------------------+----------+ + + + X_17 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_15 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_17 | + +-----------------+----------------------+----------+ + + + X_18 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_19 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_21 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_22 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_21 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_23 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_22 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_24 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_25 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_24 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_23 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_20 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_25 | + +--------+----------------------+----------+ + + + X_26 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_28 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_30 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_29 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_30 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_31 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_30 | + +-------------+----------------------+------------------+ + + + X_33 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_31 | + +---------+----------------------+------------------------+ + + + X_34 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_36 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_35 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_36 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_37 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_38 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents (Determined from data, 8-bit tag) + *********************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_38 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_35 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_33 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_34 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_29 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_28) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_26 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_20 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_19 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_15 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_9 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_1 | + +---------------+----------------------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_49 (Determined from data, 8-bit tag) + ************************************** + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_50 (1 byte, 8-bit tag) + ************************ + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_48 + **** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_49 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_50 | + +-----------------+----------------------+-----------------------+ + + + X_51 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_update (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.event (Determined from data, 8-bit tag) + ********************************************************************************************** + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_67 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_66 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_67 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_72 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_66 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_66 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_66 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + X_73 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_84 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_73 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_85 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_84 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_72 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_85 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.origination (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_112 + ***** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + X_115 + ***** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_111 + ***** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_112 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_115 | + +-----------------------+----------------------+-------------------------+ + + + X_148 (Determined from data, 8-bit tag) + *************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_receipt | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_receipt | Variable | sequence of $X_111 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.transaction (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_148 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_148 | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.apply_internal_results.alpha.operation_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + transaction (tag 1) + =================== + + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.transaction_destination | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.transaction | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + + + delegation (tag 3) + ================== + + +--------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------+----------------------+---------------------------------------------------------------+ + + + event (tag 4) + ============= + + +-------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "tag" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | tag | Determined from data | $016-PtMumbai.entrypoint | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "payload" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | payload | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +-------------------------------+----------------------+---------------------------------------------------------------+ + + + X_47 + **** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_193 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_336 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_477 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_611 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message (Determined from data, 8-bit tag) + **************************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_751 + ***** + + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=================================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + + + X_907 (1 byte, 8-bit tag) + ************************* + + Conflict_resolved (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Timeout (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_908 (Determined from data, 8-bit tag) + *************************************** + + Loser (tag 0) + ============= + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | reason | 1 byte | $X_907 | + +--------+----------+------------------------+ + | player | 21 bytes | $public_key_hash | + +--------+----------+------------------------+ + + + Draw (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_909 (Determined from data, 8-bit tag) + *************************************** + + Ongoing (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Ended (tag 1) + ============= + + +--------+----------------------+------------------------+ + | Name | Size | Contents | + +========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------------------+------------------------+ + | result | Determined from data | $X_908 | + +--------+----------------------+------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | game_status | Determined from data | $X_909 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | game_status | Determined from data | $X_909 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_902 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1201 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------------------+ + + + X_1341 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate (Determined from data, 8-bit tag) + *************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1611 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment (Determined from data, 8-bit tag) + *********************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2187 + ****** + + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+============================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2749 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2889 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.register_global_constant (Determined from data, 8-bit tag) + ******************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_3437 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.register_global_constant | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3711 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3934 (Determined from data, 8-bit tag) + **************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_111 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.transaction (Determined from data, 8-bit tag) + ******************************************************************************************* + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_3934 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_3 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_51 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_3934 | + +------------------------------+----------------------+-------------------------------------+ + + + X_3892 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.transaction | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_4236 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | endorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4240 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | preendorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4244 + ****** + + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+=====================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_48 | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.operation_metadata.alpha.balance_updates + ***************************************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_48 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | nonce | 32 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | pkh | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | secret | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | solution | 200 bytes | $X_38 | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_4244 | + +---------------+----------------------+------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4240 | + +--------------------+----------------------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4236 | + +--------------------+----------------------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + | metadata | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3892 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3711 | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_477 | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_3437 | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_477 | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2889 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_2749 | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_35 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2187 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2187 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_33 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_34 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_611 | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_29 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_47 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | metadata | Determined from data | $X_751 | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_28) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | metadata | Determined from data | $X_1611 | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_477 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1341 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_26 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1201 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_20 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_902 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_19 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_902 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_751 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_611 | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_18 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_477 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_15 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_336 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_9 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_193 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_1 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_47 | + +---------------+----------------------+------------------------+ + + + X_4267 (Variable, 8-bit tag) + **************************** + + Operation_with_metadata (tag 0) + =============================== + + +-----------------------+----------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.operation_contents_and_result | + +-----------------------+----------+-------------------------------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------+ + + + Operation_without_metadata (tag 1) + ================================== + + +-----------------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+====================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.contents | + +-----------------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+----------------------------------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_38 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_37 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_35 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_33 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_34 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_29 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_28) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_3 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_26 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_20 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_19 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_15 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_9 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_1 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + X_4344 (Variable, 8-bit tag) + **************************** + + Operation with too large metadata (tag 0) + ========================================= + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation without metadata (tag 1) + ================================== + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation with metadata (tag 2) + =============================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | Variable | $X_4267 | + +-----------------+----------+------------------------+ + + + operation + ********* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | chain_id | 4 bytes | bytes | + +-----------------------+----------+-------------------------+ + | hash | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | $X_4344 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +--------------------------+----------+-------------------------+ + | Name | Size | Contents | + +==========================+==========+=========================+ + | # bytes in next 2 fields | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $operation | + +--------------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--operations--list_offset : + +**GET ../<block_id>/operations/<list_offset>?[force_metadata]&[metadata=<metadata_rpc_arg>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operations--list_offsetdescr', 'GET_..--block_id--operations--list_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations--list_offsetoutput.json', 'GET_..--block_id--operations--list_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations--list_offsetoutput.bin', 'GET_..--block_id--operations--list_offset')">Binary output</button> + </div><div id="GET_..--block_id--operations--list_offsetdescr" class="GET_..--block_id--operations--list_offset tabcontent"> + <p> + All the operations included in `n-th` validation pass of the block.</p> <p>Optional query arguments :<ul><li><span class="query">force_metadata</span> : DEPRECATED: Forces to recompute the operations metadata if it was considered as too large.</li><li><span class="query">metadata = <metadata_rpc_arg></span> : Specifies whether or not if the operations metadata should be returned. To get the metadata, even if it is needed to recompute them, use "always". To avoid getting the metadata, use "never". By default, the metadata will be returned depending on the node's metadata size limit policy.</li></ul></p> + </div> + <div id="GET_..--block_id--operations--list_offsetoutput.json" class="GET_..--block_id--operations--list_offset tabcontent"> + <pre> + [ $operation ... ] + $016-PtMumbai.apply_internal_results.alpha.operation_result: + { /* transaction */ + "kind": "transaction", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.transaction_destination, + "parameters"?: { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.transaction } + || { /* origination */ + "kind": "origination", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.origination } + || { /* delegation */ + "kind": "delegation", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "delegate"?: $Signature.Public_key_hash, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.delegation } + || { /* event */ + "kind": "event", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "type": $micheline.016-PtMumbai.michelson_v1.expression, + "tag"?: $016-PtMumbai.entrypoint, + "payload"?: $micheline.016-PtMumbai.michelson_v1.expression, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.event } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.error: + /* The full list of RPC errors would be too long to include. + It is available at RPC `/errors` (GET). + Errors specific to protocol Alpha have an id that starts with + `proto.alpha`. */ + any + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.operation.alpha.contents_and_signature: + { "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation.alpha.internal_operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.event: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.internal_operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_contents_and_result: + { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "endorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "preendorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31], + "metadata": { "delegate": $Signature.Public_key_hash } } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ], + "metadata": { } } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass", + "metadata": { } } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.reveal, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transaction, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.delegation, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.register_global_constant, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "allocated_destination_contract"?: boolean } } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.operation_result.register_global_constant: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + $016-PtMumbai.operation.alpha.operation_result.reveal: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_with_metadata: + { /* Operation_with_metadata */ + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* Operation_without_metadata */ + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $operation: + { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1, + "metadata": "too large" } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_id--operations--list_offsetoutput.bin" class="GET_..--block_id--operations--list_offset tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $operation | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + + + X_6 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_4 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_6 | + +-----------------+----------------------+----------+ + + + X_7 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_1 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_4 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_7 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_10 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_9 + *** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_10 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_13 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_8 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_9 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_13 | + +-----------------+----------------------+----------+ + + + X_16 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_14 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_16 | + +-----------------+----------------------+----------+ + + + X_17 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_18 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_20 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_21 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_20 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_22 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_21 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_23 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_24 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_23 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_22 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_19 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_24 | + +--------+----------------------+----------+ + + + X_25 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_27 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_29 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_28 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_29 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_30 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_29 | + +-------------+----------------------+------------------+ + + + X_32 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_30 | + +---------+----------------------+------------------------+ + + + X_33 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_35 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_34 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_35 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_36 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_37 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents (Determined from data, 8-bit tag) + *********************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_37 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_48 (Determined from data, 8-bit tag) + ************************************** + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_49 (1 byte, 8-bit tag) + ************************ + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_47 + **** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_48 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_49 | + +-----------------+----------------------+-----------------------+ + + + X_50 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_update (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.event (Determined from data, 8-bit tag) + ********************************************************************************************** + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_66 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_65 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_66 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_71 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_65 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_65 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_65 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + X_72 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_83 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_84 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_83 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_71 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_84 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.origination (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_111 + ***** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + X_114 + ***** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_110 + ***** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_111 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_114 | + +-----------------------+----------------------+-------------------------+ + + + X_147 (Determined from data, 8-bit tag) + *************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_receipt | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_receipt | Variable | sequence of $X_110 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.transaction (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_147 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_147 | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.apply_internal_results.alpha.operation_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + transaction (tag 1) + =================== + + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.transaction_destination | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.transaction | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + + + delegation (tag 3) + ================== + + +--------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------+----------------------+---------------------------------------------------------------+ + + + event (tag 4) + ============= + + +-------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "tag" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | tag | Determined from data | $016-PtMumbai.entrypoint | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "payload" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | payload | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +-------------------------------+----------------------+---------------------------------------------------------------+ + + + X_46 + **** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_192 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_335 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_476 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_610 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message (Determined from data, 8-bit tag) + **************************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_750 + ***** + + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=================================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + + + X_906 (1 byte, 8-bit tag) + ************************* + + Conflict_resolved (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Timeout (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_907 (Determined from data, 8-bit tag) + *************************************** + + Loser (tag 0) + ============= + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | reason | 1 byte | $X_906 | + +--------+----------+------------------------+ + | player | 21 bytes | $public_key_hash | + +--------+----------+------------------------+ + + + Draw (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_908 (Determined from data, 8-bit tag) + *************************************** + + Ongoing (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Ended (tag 1) + ============= + + +--------+----------------------+------------------------+ + | Name | Size | Contents | + +========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------------------+------------------------+ + | result | Determined from data | $X_907 | + +--------+----------------------+------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | game_status | Determined from data | $X_908 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | game_status | Determined from data | $X_908 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_901 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1200 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------------------+ + + + X_1340 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate (Determined from data, 8-bit tag) + *************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1610 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment (Determined from data, 8-bit tag) + *********************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2186 + ****** + + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+============================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2748 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2888 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.register_global_constant (Determined from data, 8-bit tag) + ******************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_3436 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.register_global_constant | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3710 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3933 (Determined from data, 8-bit tag) + **************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.transaction (Determined from data, 8-bit tag) + ******************************************************************************************* + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_3933 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_3933 | + +------------------------------+----------------------+-------------------------------------+ + + + X_3891 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.transaction | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_4235 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | endorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4239 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | preendorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4243 + ****** + + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+=====================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.operation_metadata.alpha.balance_updates + ***************************************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_47 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | nonce | 32 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | pkh | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | secret | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | solution | 200 bytes | $X_37 | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_4243 | + +---------------+----------------------+------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4239 | + +--------------------+----------------------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4235 | + +--------------------+----------------------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + | metadata | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3891 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3710 | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_476 | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_3436 | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_476 | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2888 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_2748 | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2186 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2186 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_610 | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_46 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | metadata | Determined from data | $X_750 | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | metadata | Determined from data | $X_1610 | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_476 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1340 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1200 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_901 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_901 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_750 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_335 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_192 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_46 | + +---------------+----------------------+------------------------+ + + + X_4266 (Variable, 8-bit tag) + **************************** + + Operation_with_metadata (tag 0) + =============================== + + +-----------------------+----------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.operation_contents_and_result | + +-----------------------+----------+-------------------------------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------+ + + + Operation_without_metadata (tag 1) + ================================== + + +-----------------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+====================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.contents | + +-----------------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+----------------------------------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_37 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + X_4343 (Variable, 8-bit tag) + **************************** + + Operation with too large metadata (tag 0) + ========================================= + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation without metadata (tag 1) + ================================== + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation with metadata (tag 2) + =============================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | Variable | $X_4266 | + +-----------------+----------+------------------------+ + + + operation + ********* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | chain_id | 4 bytes | bytes | + +-----------------------+----------+-------------------------+ + | hash | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | $X_4343 | + +-----------------------+----------+-------------------------+ + + </pre> + </div> + + +.. _GET_..--block_id--operations--list_offset--operation_offset : + +**GET ../<block_id>/operations/<list_offset>/<operation_offset>?[force_metadata]&[metadata=<metadata_rpc_arg>]** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operations--list_offset--operation_offsetdescr', 'GET_..--block_id--operations--list_offset--operation_offset')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations--list_offset--operation_offsetoutput.json', 'GET_..--block_id--operations--list_offset--operation_offset')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations--list_offset--operation_offsetoutput.bin', 'GET_..--block_id--operations--list_offset--operation_offset')">Binary output</button> + </div><div id="GET_..--block_id--operations--list_offset--operation_offsetdescr" class="GET_..--block_id--operations--list_offset--operation_offset tabcontent"> + <p> + The `m-th` operation in the `n-th` validation pass of the block.</p> <p>Optional query arguments :<ul><li><span class="query">force_metadata</span> : DEPRECATED: Forces to recompute the operations metadata if it was considered as too large.</li><li><span class="query">metadata = <metadata_rpc_arg></span> : Specifies whether or not if the operations metadata should be returned. To get the metadata, even if it is needed to recompute them, use "always". To avoid getting the metadata, use "never". By default, the metadata will be returned depending on the node's metadata size limit policy.</li></ul></p> + </div> + <div id="GET_..--block_id--operations--list_offset--operation_offsetoutput.json" class="GET_..--block_id--operations--list_offset--operation_offset tabcontent"> + <pre> + { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1, + "metadata": "too large" } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* An operation's shell header. */ + "protocol": "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD", + "chain_id": $Chain_id, + "hash": $Operation_hash, + "branch": $block_hash, + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.apply_internal_results.alpha.operation_result: + { /* transaction */ + "kind": "transaction", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.transaction_destination, + "parameters"?: { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.transaction } + || { /* origination */ + "kind": "origination", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.origination } + || { /* delegation */ + "kind": "delegation", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "delegate"?: $Signature.Public_key_hash, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.delegation } + || { /* event */ + "kind": "event", + "source": $016-PtMumbai.contract_id, + "nonce": integer ∈ [0, 2^16-1], + "type": $micheline.016-PtMumbai.michelson_v1.expression, + "tag"?: $016-PtMumbai.entrypoint, + "payload"?: $micheline.016-PtMumbai.michelson_v1.expression, + "result": + $016-PtMumbai.operation.alpha.internal_operation_result.event } + $016-PtMumbai.big_map_id: + /* Big map identifier + A big map identifier */ + $bignum + $016-PtMumbai.block_header.alpha.full_header: + /* Shell header + Block header's shell-related content. It contains information such as + the block level, its predecessor and timestamp. */ + { "level": integer ∈ [-2^31-1, 2^31], + "proto": integer ∈ [0, 255], + "predecessor": $block_hash, + "timestamp": $timestamp.protocol, + "validation_pass": integer ∈ [0, 255], + "operations_hash": $Operation_list_list_hash, + "fitness": $fitness, + "context": $Context_hash, + "payload_hash": $value_hash, + "payload_round": integer ∈ [-2^31-1, 2^31], + "proof_of_work_nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "seed_nonce_hash"?: $cycle_nonce, + "liquidity_baking_toggle_vote": + $016-PtMumbai.liquidity_baking_toggle_vote, + "signature": $Signature.V1 } + $016-PtMumbai.bond_id: + { /* Tx_rollup_bond_id */ + "tx_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Sc_rollup_bond_id */ + "sc_rollup": $016-PtMumbai.rollup_address } + $016-PtMumbai.contract_id: + /* A contract handle + A contract notation as given to an RPC or inside scripts. Can be a + base58 implicit contract hash or a base58 originated contract hash. */ + $unistring + $016-PtMumbai.contract_id.originated: + /* A contract handle -- originated account + A contract notation as given to an RPC or inside scripts. Can be a + base58 originated contract hash. */ + $unistring + $016-PtMumbai.entrypoint: + /* entrypoint + Named entrypoint to a Michelson smart contract */ + "default" + || "root" + || "do" + || "set_delegate" + || "remove_delegate" + || "deposit" + || $unistring + /* named */ + $016-PtMumbai.error: + /* The full list of RPC errors would be too long to include. + It is available at RPC `/errors` (GET). + Errors specific to protocol Alpha have an id that starts with + `proto.alpha`. */ + any + $016-PtMumbai.inlined.endorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.endorsement_mempool.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.endorsement_mempool.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.inlined.preendorsement: + /* An operation's shell header. */ + { "branch": $block_hash, + "operations": $016-PtMumbai.inlined.preendorsement.contents, + "signature"?: $Signature.V1 } + $016-PtMumbai.inlined.preendorsement.contents: + { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + $016-PtMumbai.lazy_storage_diff: + [ { /* big_map */ + "kind": "big_map", + "id": $016-PtMumbai.big_map_id, + "diff": + { /* update */ + "action": "update", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.big_map_id, + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ] } + || { /* alloc */ + "action": "alloc", + "updates": + [ { "key_hash": $script_expr, + "key": $micheline.016-PtMumbai.michelson_v1.expression, + "value"?: + $micheline.016-PtMumbai.michelson_v1.expression } ... ], + "key_type": $micheline.016-PtMumbai.michelson_v1.expression, + "value_type": $micheline.016-PtMumbai.michelson_v1.expression } } + || { /* sapling_state */ + "kind": "sapling_state", + "id": $016-PtMumbai.sapling_state_id, + "diff": + { /* update */ + "action": "update", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* remove */ + "action": "remove" } + || { /* copy */ + "action": "copy", + "source": $016-PtMumbai.sapling_state_id, + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] } } + || { /* alloc */ + "action": "alloc", + "updates": + { "commitments_and_ciphertexts": + [ [ $sapling.transaction.commitment, + $sapling.transaction.ciphertext ] ... ], + "nullifiers": [ $sapling.transaction.nullifier ... ] }, + "memo_size": integer ∈ [0, 2^16-1] } } ... ] + $016-PtMumbai.liquidity_baking_toggle_vote: "off" | "on" | "pass" + $016-PtMumbai.michelson.v1.primitives: + "SHA512" + | "HASH_KEY" + | "SIZE" + | "SAPLING_VERIFY_UPDATE" + | "False" + | "SAPLING_EMPTY_STATE" + | "RENAME" + | "sapling_transaction" + | "UNPACK" + | "NAT" + | "unit" + | "bls12_381_fr" + | "Pair" + | "IF_NONE" + | "int" + | "timestamp" + | "storage" + | "UNPAIR" + | "view" + | "BLAKE2B" + | "AMOUNT" + | "DUP" + | "nat" + | "NEG" + | "bool" + | "SELF_ADDRESS" + | "ISNAT" + | "DIG" + | "CHAIN_ID" + | "set" + | "LSR" + | "key" + | "address" + | "ABS" + | "CREATE_CONTRACT" + | "SHA256" + | "JOIN_TICKETS" + | "LEVEL" + | "bls12_381_g1" + | "operation" + | "tx_rollup_l2_address" + | "string" + | "CHECK_SIGNATURE" + | "STEPS_TO_QUOTA" + | "SELF" + | "DIP" + | "lambda" + | "AND" + | "COMPARE" + | "chain_id" + | "MAP" + | "APPLY" + | "Elt" + | "BYTES" + | "NOT" + | "IMPLICIT_ACCOUNT" + | "LT" + | "UNIT" + | "EMIT" + | "SET_DELEGATE" + | "Some" + | "parameter" + | "signature" + | "ticket" + | "EMPTY_BIG_MAP" + | "None" + | "SUB" + | "key_hash" + | "ADD" + | "map" + | "VOTING_POWER" + | "big_map" + | "CDR" + | "GT" + | "IF_CONS" + | "CONS" + | "LSL" + | "DUG" + | "PACK" + | "SHA3" + | "SOURCE" + | "or" + | "SUB_MUTEZ" + | "LAMBDA" + | "RIGHT" + | "CREATE_ACCOUNT" + | "Unit" + | "CAST" + | "NEQ" + | "ITER" + | "FAILWITH" + | "PUSH" + | "OPEN_CHEST" + | "SOME" + | "list" + | "BALANCE" + | "NIL" + | "pair" + | "CAR" + | "UPDATE" + | "TOTAL_VOTING_POWER" + | "PAIR" + | "constant" + | "LAMBDA_REC" + | "ADDRESS" + | "True" + | "Right" + | "Lambda_rec" + | "IF" + | "NEVER" + | "sapling_transaction_deprecated" + | "SWAP" + | "EMPTY_MAP" + | "MUL" + | "INT" + | "option" + | "KECCAK" + | "LEFT" + | "Left" + | "chest" + | "SPLIT_TICKET" + | "chest_key" + | "bls12_381_g2" + | "EDIV" + | "LOOP" + | "bytes" + | "TICKET" + | "LE" + | "PAIRING_CHECK" + | "MIN_BLOCK_TIME" + | "OR" + | "contract" + | "GET_AND_UPDATE" + | "mutez" + | "sapling_state" + | "NONE" + | "IF_LEFT" + | "GET" + | "NOW" + | "TRANSFER_TOKENS" + | "LOOP_LEFT" + | "CONTRACT" + | "TICKET_DEPRECATED" + | "VIEW" + | "EMPTY_SET" + | "XOR" + | "never" + | "READ_TICKET" + | "EQ" + | "GE" + | "MEM" + | "SENDER" + | "DROP" + | "CONCAT" + | "EXEC" + | "SLICE" + | "code" + $016-PtMumbai.mutez: $positive_bignum + $016-PtMumbai.operation.alpha.contents: + { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ] } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ] } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass" } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash } + || { /* Failing_noop */ + "kind": "failing_noop", + "arbitrary": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ] } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30] } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ] } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + $016-PtMumbai.operation.alpha.contents_and_signature: + { "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation.alpha.internal_operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.event: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.internal_operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.internal_operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_receipt"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_receipt": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_contents_and_result: + { /* Seed_nonce_revelation */ + "kind": "seed_nonce_revelation", + "level": integer ∈ [-2^31-1, 2^31], + "nonce": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Vdf_revelation */ + "kind": "vdf_revelation", + "solution": + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/, /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Endorsement */ + "kind": "endorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "endorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Preendorsement */ + "kind": "preendorsement", + "slot": integer ∈ [0, 2^16-1], + "level": integer ∈ [-2^31-1, 2^31], + "round": integer ∈ [-2^31-1, 2^31], + "block_payload_hash": $value_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "delegate": $Signature.Public_key_hash, + "preendorsement_power": integer ∈ [-2^30, 2^30], + "consensus_key": $Signature.Public_key_hash } } + || { /* Dal_attestation */ + "kind": "dal_attestation", + "attestor": $Signature.Public_key_hash, + "attestation": $bignum, + "level": integer ∈ [-2^31-1, 2^31], + "metadata": { "delegate": $Signature.Public_key_hash } } + || { /* Double_preendorsement_evidence */ + "kind": "double_preendorsement_evidence", + "op1": $016-PtMumbai.inlined.preendorsement, + "op2": $016-PtMumbai.inlined.preendorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_endorsement_evidence */ + "kind": "double_endorsement_evidence", + "op1": $016-PtMumbai.inlined.endorsement, + "op2": $016-PtMumbai.inlined.endorsement, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Double_baking_evidence */ + "kind": "double_baking_evidence", + "bh1": $016-PtMumbai.block_header.alpha.full_header, + "bh2": $016-PtMumbai.block_header.alpha.full_header, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Activate_account */ + "kind": "activate_account", + "pkh": $Ed25519.Public_key_hash, + "secret": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates } } + || { /* Proposals */ + "kind": "proposals", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposals": [ $Protocol_hash ... ], + "metadata": { } } + || { /* Ballot */ + "kind": "ballot", + "source": $Signature.Public_key_hash, + "period": integer ∈ [-2^31-1, 2^31], + "proposal": $Protocol_hash, + "ballot": "nay" | "yay" | "pass", + "metadata": { } } + || { /* Reveal */ + "kind": "reveal", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_key": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.reveal, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transaction */ + "kind": "transaction", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $016-PtMumbai.mutez, + "destination": $016-PtMumbai.contract_id, + "parameters"?: + { "entrypoint": $016-PtMumbai.entrypoint, + "value": any }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transaction, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Origination */ + "kind": "origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "balance": $016-PtMumbai.mutez, + "delegate"?: $Signature.Public_key_hash, + "script": $016-PtMumbai.scripted.contracts, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Delegation */ + "kind": "delegation", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "delegate"?: $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.delegation, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Register_global_constant */ + "kind": "register_global_constant", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "value": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.register_global_constant, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Set_deposits_limit */ + "kind": "set_deposits_limit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Increase_paid_storage */ + "kind": "increase_paid_storage", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "amount": $bignum, + "destination": $016-PtMumbai.contract_id.originated, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Update_consensus_key */ + "kind": "update_consensus_key", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pk": $Signature.Public_key, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Drain_delegate */ + "kind": "drain_delegate", + "consensus_key": $Signature.Public_key_hash, + "delegate": $Signature.Public_key_hash, + "destination": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "allocated_destination_contract"?: boolean } } + || { /* Tx_rollup_origination */ + "kind": "tx_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup_origination": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_submit_batch */ + "kind": "tx_rollup_submit_batch", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "content": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "burn_limit"?: $016-PtMumbai.mutez, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_commit */ + "kind": "tx_rollup_commit", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "commitment": + { "level": integer ∈ [-2^31-1, 2^31], + "messages": [ $Message_result_hash ... ], + "predecessor": $Commitment_hash /* Some */ || null /* None */, + "inbox_merkle_root": $Inbox_list_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_return_bond */ + "kind": "tx_rollup_return_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_finalize_commitment */ + "kind": "tx_rollup_finalize_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_remove_commitment */ + "kind": "tx_rollup_remove_commitment", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_rejection */ + "kind": "tx_rollup_rejection", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "message": + { /* Batch */ + "batch": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* Deposit */ + "deposit": + { "sender": $Signature.Public_key_hash, + "destination": $Bls12_381.Public_key_hash, + "ticket_hash": $script_expr, + "amount": $int64 } }, + "message_position": $positive_bignum, + "message_path": [ $Inbox_list_hash ... ], + "message_result_hash": $Message_result_hash, + "message_result_path": [ $Message_result_list_hash ... ], + "previous_message_result": + { "context_hash": $Context_hash, + "withdraw_list_hash": $Withdraw_list_hash }, + "previous_message_result_path": [ $Message_result_list_hash ... ], + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Transfer_ticket */ + "kind": "transfer_ticket", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "ticket_contents": any, + "ticket_ty": any, + "ticket_ticketer": $016-PtMumbai.contract_id, + "ticket_amount": $positive_bignum, + "destination": $016-PtMumbai.contract_id, + "entrypoint": $unistring, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Dal_publish_slot_header */ + "kind": "dal_publish_slot_header", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "slot_header": + { "level": integer ∈ [-2^31-1, 2^31], + "index": integer ∈ [0, 255], + "commitment": $DAL_commitment, + "commitment_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Tx_rollup_dispatch_tickets */ + "kind": "tx_rollup_dispatch_tickets", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "tx_rollup": $016-PtMumbai.tx_rollup_id, + "level": integer ∈ [-2^31-1, 2^31], + "context_hash": $Context_hash, + "message_index": integer ∈ [-2^30, 2^30], + "message_result_path": [ $Message_result_list_hash ... ], + "tickets_info": + [ { "contents": any, + "ty": any, + "ticketer": $016-PtMumbai.contract_id, + "amount": $int64, + "claimer": $Signature.Public_key_hash } ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_originate */ + "kind": "sc_rollup_originate", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "pvm_kind": "wasm_2_0_0" | "arith", + "kernel": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "origination_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "parameters_ty": any, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_add_messages */ + "kind": "sc_rollup_add_messages", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "message": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_cement */ + "kind": "sc_rollup_cement", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": $commitment_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_publish */ + "kind": "sc_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "commitment": + { "compressed_state": $state_hash, + "inbox_level": integer ∈ [-2^31-1, 2^31], + "predecessor": $commitment_hash, + "number_of_ticks": $int64 }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_refute */ + "kind": "sc_rollup_refute", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "opponent": $Signature.Public_key_hash, + "refutation"?: + { "choice": $positive_bignum, + "step": + [ { "state"?: $state_hash, + "tick": $positive_bignum } ... ] + /* Dissection */ + || { /* Proof */ + "pvm_step": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "input_proof"?: + { /* inbox proof */ + "input_proof_kind": "inbox_proof", + "level": integer ∈ [-2^31-1, 2^31], + "message_counter": $positive_bignum, + "serialized_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* reveal proof */ + "input_proof_kind": "reveal_proof", + "reveal_proof": + { /* raw data proof */ + "reveal_proof_kind": "raw_data_proof", + "raw_data": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || { /* metadata proof */ + "reveal_proof_kind": "metadata_proof" } + || { /* dal page proof */ + "reveal_proof_kind": "dal_page_proof", + "dal_page_id": + { "published_level": + integer ∈ [-2^31-1, 2^31], + "slot_index": integer ∈ [0, 255], + "page_index": + integer ∈ [-2^15, 2^15-1] }, + "dal_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } } + || { /* first input */ + "input_proof_kind": "first_input" } } }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_timeout */ + "kind": "sc_rollup_timeout", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "stakers": + { "alice": $Signature.Public_key_hash, + "bob": $Signature.Public_key_hash }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_execute_outbox_message */ + "kind": "sc_rollup_execute_outbox_message", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $016-PtMumbai.rollup_address, + "cemented_commitment": $commitment_hash, + "output_proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Sc_rollup_recover_bond */ + "kind": "sc_rollup_recover_bond", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "rollup": $Sc_rollup_hash, + "staker": $Signature.Public_key_hash, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_origination */ + "kind": "zk_rollup_origination", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "public_parameters": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "circuits_info": + [ [ $unistring, + { /* Public */ + "public": any } + || { /* Private */ + "private": any } + || { /* Fee */ + "fee": any } ] ... ], + "init_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "nb_ops": integer ∈ [-2^30, 2^30], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_publish */ + "kind": "zk_rollup_publish", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "op": + [ [ { "op_code": integer ∈ [-2^30, 2^30], + "price": { "id": $script_expr, + "amount": $bignum }, + "l1_dst": $Signature.Public_key_hash, + "rollup_id": $Zk_rollup_hash, + "payload": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + { /* Some */ + "contents": $micheline.016-PtMumbai.michelson_v1.expression, + "ty": $micheline.016-PtMumbai.michelson_v1.expression, + "ticketer": $016-PtMumbai.contract_id } + || null + /* None */ ] ... ], + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + || { /* Zk_rollup_update */ + "kind": "zk_rollup_update", + "source": $Signature.Public_key_hash, + "fee": $016-PtMumbai.mutez, + "counter": $positive_bignum, + "gas_limit": $positive_bignum, + "storage_limit": $positive_bignum, + "zk_rollup": $Zk_rollup_hash, + "update": + { "pending_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "exit_validity": boolean } ] ... ], + "private_pis": + [ [ $unistring, + { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ], + "fee": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } ] ... ], + "fee_pi": { "new_state": [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] }, + "proof": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ }, + "metadata": + { "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "operation_result": + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update, + "internal_operation_results"?: + [ $016-PtMumbai.apply_internal_results.alpha.operation_result ... ] } } + $016-PtMumbai.operation.alpha.operation_result.dal_publish_slot_header: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.delegation: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.increase_paid_storage: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.origination: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_contracts"?: + [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + $016-PtMumbai.operation.alpha.operation_result.register_global_constant: + { /* Applied */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "global_address": $script_expr } + $016-PtMumbai.operation.alpha.operation_result.reveal: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_add_messages: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "inbox_level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "address": $Sc_rollup_hash, + "genesis_commitment_hash": $commitment_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "staked_hash": $commitment_hash, + "published_at_level": integer ∈ [-2^31-1, 2^31], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_refute: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "game_status": + "ongoing" + || { /* Ended */ + "result": + { /* Loser */ + "kind": "loser", + "reason": "conflict_resolved" || "timeout", + "player": $Signature.Public_key_hash } + || { /* Draw */ + "kind": "draw" } }, + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates } + $016-PtMumbai.operation.alpha.operation_result.set_deposits_limit: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.transaction: + /* Applied */ + { /* To_contract */ + "status": "applied", + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "applied", + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "applied", + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || /* Backtracked */ + { /* To_contract */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "storage"?: $micheline.016-PtMumbai.michelson_v1.expression, + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates"?: + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "originated_contracts"?: [ $016-PtMumbai.contract_id.originated ... ], + "consumed_milligas"?: $positive_bignum, + "storage_size"?: $bignum, + "paid_storage_size_diff"?: $bignum, + "allocated_destination_contract"?: boolean, + "lazy_storage_diff"?: $016-PtMumbai.lazy_storage_diff } + || { /* To_tx_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates"?: + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "ticket_hash": $script_expr, + "paid_storage_size_diff": $positive_bignum } + || { /* To_sc_rollup */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ] } + $016-PtMumbai.operation.alpha.operation_result.transfer_ticket: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "ticket_updates": + [ { "ticket_token": + { "ticketer": $016-PtMumbai.contract_id, + "content_type": + $micheline.016-PtMumbai.michelson_v1.expression, + "content": $micheline.016-PtMumbai.michelson_v1.expression }, + "updates": + [ { "account": $016-PtMumbai.transaction_destination, + "amount": $bignum } ... ] } ... ], + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_commit: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_dispatch_tickets: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_finalize_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "originated_rollup": $016-PtMumbai.tx_rollup_id } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_rejection: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "level": integer ∈ [-2^31-1, 2^31] } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_return_bond: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff": $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.update_consensus_key: + { /* Applied */ + "status": "applied", + "consumed_milligas"?: $positive_bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "consumed_milligas"?: $positive_bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "originated_zk_rollup": $Zk_rollup_hash, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "size": $bignum } + $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update: + { /* Applied */ + "status": "applied", + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + || { /* Failed */ + "status": "failed", + "errors": [ $016-PtMumbai.error ... ] } + || { /* Skipped */ + "status": "skipped" } + || { /* Backtracked */ + "status": "backtracked", + "errors"?: [ $016-PtMumbai.error ... ], + "balance_updates": + $016-PtMumbai.operation_metadata.alpha.balance_updates, + "consumed_milligas"?: $positive_bignum, + "paid_storage_size_diff"?: $bignum } + $016-PtMumbai.operation.alpha.operation_with_metadata: + { /* Operation_with_metadata */ + "contents": + [ $016-PtMumbai.operation.alpha.operation_contents_and_result ... ], + "signature"?: $Signature.V1 } + || { /* Operation_without_metadata */ + "contents": [ $016-PtMumbai.operation.alpha.contents ... ], + "signature"?: $Signature.V1 } + $016-PtMumbai.operation_metadata.alpha.balance_updates: + [ { /* Contract */ + "kind": "contract", + "contract": $016-PtMumbai.contract_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Block_fees */ + "kind": "accumulator", + "category": "block fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Deposits */ + "kind": "freezer", + "category": "deposits", + "delegate": $Signature.Public_key_hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Nonce_revelation_rewards */ + "kind": "minted", + "category": "nonce revelation rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_evidence_rewards */ + "kind": "minted", + "category": "double signing evidence rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Endorsing_rewards */ + "kind": "minted", + "category": "endorsing rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_rewards */ + "kind": "minted", + "category": "baking rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Baking_bonuses */ + "kind": "minted", + "category": "baking bonuses", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Storage_fees */ + "kind": "burned", + "category": "storage fees", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Double_signing_punishments */ + "kind": "burned", + "category": "punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Lost_endorsing_rewards */ + "kind": "burned", + "category": "lost endorsing rewards", + "delegate": $Signature.Public_key_hash, + "participation": boolean, + "revelation": boolean, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Liquidity_baking_subsidies */ + "kind": "minted", + "category": "subsidy", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Burned */ + "kind": "burned", + "category": "burned", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Commitments */ + "kind": "commitment", + "category": "commitment", + "committer": $Blinded public key hash, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Bootstrap */ + "kind": "minted", + "category": "bootstrap", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Invoice */ + "kind": "minted", + "category": "invoice", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Initial_commitments */ + "kind": "minted", + "category": "commitment", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Minted */ + "kind": "minted", + "category": "minted", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Frozen_bonds */ + "kind": "freezer", + "category": "bonds", + "contract": $016-PtMumbai.contract_id, + "bond_id": $016-PtMumbai.bond_id, + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_rewards */ + "kind": "minted", + "category": "tx_rollup_rejection_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Tx_rollup_rejection_punishments */ + "kind": "burned", + "category": "tx_rollup_rejection_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_punishments */ + "kind": "burned", + "category": "sc_rollup_refutation_punishments", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } + || { /* Sc_rollup_refutation_rewards */ + "kind": "minted", + "category": "sc_rollup_refutation_rewards", + "change": $int64, + "origin": "block" || "migration" || "subsidy" || "simulation" } ... ] + $016-PtMumbai.rollup_address: + /* A smart contract rollup address + A smart contract rollup is identified by a base58 address starting + with sr1 */ + $Sc_rollup_hash + $016-PtMumbai.sapling_state_id: + /* Sapling state identifier + A sapling state identifier */ + $bignum + $016-PtMumbai.scripted.contracts: { "code": any, + "storage": any } + $016-PtMumbai.transaction_destination: + /* A destination of a transaction + A destination notation compatible with the contract notation as given + to an RPC or inside scripts. Can be a base58 implicit contract hash, a + base58 originated contract hash, a base58 originated transaction + rollup, or a base58 originated smart-contract rollup. */ + $unistring + $016-PtMumbai.tx_rollup_id: + /* A tx rollup handle + A tx rollup notation as given to an RPC or inside scripts, is a base58 + tx rollup hash */ + $unistring + $Blinded public key hash: + /* A blinded public key hash (Base58Check-encoded) */ + $unistring + $Bls12_381.Public_key_hash: + /* A Bls12_381 public key hash (Base58Check-encoded) */ + $unistring + $Chain_id: + /* Network identifier (Base58Check-encoded) */ + $unistring + $Commitment_hash: + /* A commitment ID (Base58Check-encoded) */ + $unistring + $Context_hash: + /* A hash of context (Base58Check-encoded) */ + $unistring + $DAL_commitment: + /* Commitment representation for the DAL (Base58Check-encoded) */ + $unistring + $Ed25519.Public_key_hash: + /* An Ed25519 public key hash (Base58Check-encoded) */ + $unistring + $Inbox_list_hash: + /* A merkle root hash for inboxes (Base58Check-encoded) */ + $unistring + $Message_result_hash: + /* A message result hash (Base58Check-encoded) */ + $unistring + $Message_result_list_hash: + /* A merklised message result list hash (Base58Check-encoded) */ + $unistring + $Operation_hash: + /* A Tezos operation ID (Base58Check-encoded) */ + $unistring + $Operation_list_list_hash: + /* A list of list of operations (Base58Check-encoded) */ + $unistring + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $Sc_rollup_hash: + /* A smart contract rollup address (Base58Check-encoded) */ + $unistring + $Signature.Public_key: + /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */ + $unistring + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $Signature.V1: + /* A Ed25519, Secp256k1, P256 or BLS signature (Base58Check-encoded) */ + $unistring + $Withdraw_list_hash: + /* A list of withdraw orders (Base58Check-encoded) */ + $unistring + $Zk_rollup_hash: + /* A zk rollup address (Base58Check-encoded) */ + $unistring + $bignum: + /* Big number + Decimal representation of a big number */ + string + $block_hash: + /* A block identifier (Base58Check-encoded) */ + $unistring + $commitment_hash: + /* The hash of a commitment of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $cycle_nonce: + /* A nonce hash (Base58Check-encoded) */ + $unistring + $fitness: + /* Block fitness + The fitness, or score, of a block, that allow the Tezos to decide + which chain is the best. A fitness value is a list of byte sequences. + They are compared as follows: shortest lists are smaller; lists of the + same length are compared according to the lexicographical order. */ + [ /^([a-zA-Z0-9][a-zA-Z0-9])*$/ ... ] + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $micheline.016-PtMumbai.michelson_v1.expression: + { /* Int */ + "int": $bignum } + || { /* String */ + "string": $unistring } + || { /* Bytes */ + "bytes": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + || [ $micheline.016-PtMumbai.michelson_v1.expression ... ] + /* Sequence */ + || { /* Prim__generic + Generic primitive (any number of args with or without + annotations) */ + "prim": $016-PtMumbai.michelson.v1.primitives, + "args"?: [ $micheline.016-PtMumbai.michelson_v1.expression ... ], + "annots"?: [ $unistring ... ] } + $positive_bignum: + /* Positive big number + Decimal representation of a positive big number */ + string + $sapling.DH.epk: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.ciphertext: + { "cv": $sapling.transaction.commitment_value, + "epk": $sapling.DH.epk, + "payload_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_enc": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "payload_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/, + "nonce_out": /^([a-zA-Z0-9][a-zA-Z0-9])*$/ } + $sapling.transaction.commitment: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.commitment_value: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $sapling.transaction.nullifier: /^([a-zA-Z0-9][a-zA-Z0-9])*$/ + $script_expr: + /* A script expression ID (Base58Check-encoded) */ + $unistring + $state_hash: + /* The hash of the VM state of a smart contract rollup + (Base58Check-encoded) */ + $unistring + $timestamp.protocol: + /* A timestamp as seen by the protocol: second-level precision, epoch + based. */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] } + $value_hash: + /* Hash of a consensus value (Base58Check-encoded) */ + $unistring</pre> + </div> + <div id="GET_..--block_id--operations--list_offset--operation_offsetoutput.bin" class="GET_..--block_id--operations--list_offset--operation_offset tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | chain_id | 4 bytes | bytes | + +-----------------------+----------+-------------------------+ + | hash | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | branch | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | $X_4343 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + N.t + *** + + A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | N.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_2 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_3 + *** + + +-----------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=====================================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------------------+ + | exit_validity | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------+----------+-------------------------------------+ + + + X_1 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_3 | + +-----------------+----------------------+----------+ + + + X_6 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | new_state | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + | fee | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_4 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_6 | + +-----------------+----------------------+----------+ + + + X_7 + *** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of bytes | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | pending_pis | Variable | sequence of $X_1 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | private_pis | Variable | sequence of $X_4 | + +-----------------------+----------------------+-------------------------+ + | fee_pi | Determined from data | $X_7 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Z.t + *** + + A variable-length sequence of bytes encoding a Zarith integer. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). The second most significant bit of the first byte is reserved for the sign (0 for positive, 1 for negative). Size and sign bits ignored, the data is the binary representation of the absolute value of the number in little-endian order. + + +------+----------------------+----------+ + | Name | Size | Contents | + +======+======================+==========+ + | Z.t | Determined from data | bytes | + +------+----------------------+----------+ + + + X_10 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | id | 32 bytes | bytes | + +--------+----------------------+----------+ + | amount | Determined from data | $Z.t | + +--------+----------------------+----------+ + + + X_9 + *** + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | op_code | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | price | Determined from data | $X_10 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | l1_dst | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | rollup_id | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | payload | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + 016-PtMumbai.michelson.v1.primitives (Enumeration: unsigned 8-bit integer): + *************************************************************************** + + +-------------+--------------------------------+ + | Case number | Encoded string | + +=============+================================+ + | 0 | parameter | + +-------------+--------------------------------+ + | 1 | storage | + +-------------+--------------------------------+ + | 2 | code | + +-------------+--------------------------------+ + | 3 | False | + +-------------+--------------------------------+ + | 4 | Elt | + +-------------+--------------------------------+ + | 5 | Left | + +-------------+--------------------------------+ + | 6 | None | + +-------------+--------------------------------+ + | 7 | Pair | + +-------------+--------------------------------+ + | 8 | Right | + +-------------+--------------------------------+ + | 9 | Some | + +-------------+--------------------------------+ + | 10 | True | + +-------------+--------------------------------+ + | 11 | Unit | + +-------------+--------------------------------+ + | 12 | PACK | + +-------------+--------------------------------+ + | 13 | UNPACK | + +-------------+--------------------------------+ + | 14 | BLAKE2B | + +-------------+--------------------------------+ + | 15 | SHA256 | + +-------------+--------------------------------+ + | 16 | SHA512 | + +-------------+--------------------------------+ + | 17 | ABS | + +-------------+--------------------------------+ + | 18 | ADD | + +-------------+--------------------------------+ + | 19 | AMOUNT | + +-------------+--------------------------------+ + | 20 | AND | + +-------------+--------------------------------+ + | 21 | BALANCE | + +-------------+--------------------------------+ + | 22 | CAR | + +-------------+--------------------------------+ + | 23 | CDR | + +-------------+--------------------------------+ + | 24 | CHECK_SIGNATURE | + +-------------+--------------------------------+ + | 25 | COMPARE | + +-------------+--------------------------------+ + | 26 | CONCAT | + +-------------+--------------------------------+ + | 27 | CONS | + +-------------+--------------------------------+ + | 28 | CREATE_ACCOUNT | + +-------------+--------------------------------+ + | 29 | CREATE_CONTRACT | + +-------------+--------------------------------+ + | 30 | IMPLICIT_ACCOUNT | + +-------------+--------------------------------+ + | 31 | DIP | + +-------------+--------------------------------+ + | 32 | DROP | + +-------------+--------------------------------+ + | 33 | DUP | + +-------------+--------------------------------+ + | 34 | EDIV | + +-------------+--------------------------------+ + | 35 | EMPTY_MAP | + +-------------+--------------------------------+ + | 36 | EMPTY_SET | + +-------------+--------------------------------+ + | 37 | EQ | + +-------------+--------------------------------+ + | 38 | EXEC | + +-------------+--------------------------------+ + | 39 | FAILWITH | + +-------------+--------------------------------+ + | 40 | GE | + +-------------+--------------------------------+ + | 41 | GET | + +-------------+--------------------------------+ + | 42 | GT | + +-------------+--------------------------------+ + | 43 | HASH_KEY | + +-------------+--------------------------------+ + | 44 | IF | + +-------------+--------------------------------+ + | 45 | IF_CONS | + +-------------+--------------------------------+ + | 46 | IF_LEFT | + +-------------+--------------------------------+ + | 47 | IF_NONE | + +-------------+--------------------------------+ + | 48 | INT | + +-------------+--------------------------------+ + | 49 | LAMBDA | + +-------------+--------------------------------+ + | 50 | LE | + +-------------+--------------------------------+ + | 51 | LEFT | + +-------------+--------------------------------+ + | 52 | LOOP | + +-------------+--------------------------------+ + | 53 | LSL | + +-------------+--------------------------------+ + | 54 | LSR | + +-------------+--------------------------------+ + | 55 | LT | + +-------------+--------------------------------+ + | 56 | MAP | + +-------------+--------------------------------+ + | 57 | MEM | + +-------------+--------------------------------+ + | 58 | MUL | + +-------------+--------------------------------+ + | 59 | NEG | + +-------------+--------------------------------+ + | 60 | NEQ | + +-------------+--------------------------------+ + | 61 | NIL | + +-------------+--------------------------------+ + | 62 | NONE | + +-------------+--------------------------------+ + | 63 | NOT | + +-------------+--------------------------------+ + | 64 | NOW | + +-------------+--------------------------------+ + | 65 | OR | + +-------------+--------------------------------+ + | 66 | PAIR | + +-------------+--------------------------------+ + | 67 | PUSH | + +-------------+--------------------------------+ + | 68 | RIGHT | + +-------------+--------------------------------+ + | 69 | SIZE | + +-------------+--------------------------------+ + | 70 | SOME | + +-------------+--------------------------------+ + | 71 | SOURCE | + +-------------+--------------------------------+ + | 72 | SENDER | + +-------------+--------------------------------+ + | 73 | SELF | + +-------------+--------------------------------+ + | 74 | STEPS_TO_QUOTA | + +-------------+--------------------------------+ + | 75 | SUB | + +-------------+--------------------------------+ + | 76 | SWAP | + +-------------+--------------------------------+ + | 77 | TRANSFER_TOKENS | + +-------------+--------------------------------+ + | 78 | SET_DELEGATE | + +-------------+--------------------------------+ + | 79 | UNIT | + +-------------+--------------------------------+ + | 80 | UPDATE | + +-------------+--------------------------------+ + | 81 | XOR | + +-------------+--------------------------------+ + | 82 | ITER | + +-------------+--------------------------------+ + | 83 | LOOP_LEFT | + +-------------+--------------------------------+ + | 84 | ADDRESS | + +-------------+--------------------------------+ + | 85 | CONTRACT | + +-------------+--------------------------------+ + | 86 | ISNAT | + +-------------+--------------------------------+ + | 87 | CAST | + +-------------+--------------------------------+ + | 88 | RENAME | + +-------------+--------------------------------+ + | 89 | bool | + +-------------+--------------------------------+ + | 90 | contract | + +-------------+--------------------------------+ + | 91 | int | + +-------------+--------------------------------+ + | 92 | key | + +-------------+--------------------------------+ + | 93 | key_hash | + +-------------+--------------------------------+ + | 94 | lambda | + +-------------+--------------------------------+ + | 95 | list | + +-------------+--------------------------------+ + | 96 | map | + +-------------+--------------------------------+ + | 97 | big_map | + +-------------+--------------------------------+ + | 98 | nat | + +-------------+--------------------------------+ + | 99 | option | + +-------------+--------------------------------+ + | 100 | or | + +-------------+--------------------------------+ + | 101 | pair | + +-------------+--------------------------------+ + | 102 | set | + +-------------+--------------------------------+ + | 103 | signature | + +-------------+--------------------------------+ + | 104 | string | + +-------------+--------------------------------+ + | 105 | bytes | + +-------------+--------------------------------+ + | 106 | mutez | + +-------------+--------------------------------+ + | 107 | timestamp | + +-------------+--------------------------------+ + | 108 | unit | + +-------------+--------------------------------+ + | 109 | operation | + +-------------+--------------------------------+ + | 110 | address | + +-------------+--------------------------------+ + | 111 | SLICE | + +-------------+--------------------------------+ + | 112 | DIG | + +-------------+--------------------------------+ + | 113 | DUG | + +-------------+--------------------------------+ + | 114 | EMPTY_BIG_MAP | + +-------------+--------------------------------+ + | 115 | APPLY | + +-------------+--------------------------------+ + | 116 | chain_id | + +-------------+--------------------------------+ + | 117 | CHAIN_ID | + +-------------+--------------------------------+ + | 118 | LEVEL | + +-------------+--------------------------------+ + | 119 | SELF_ADDRESS | + +-------------+--------------------------------+ + | 120 | never | + +-------------+--------------------------------+ + | 121 | NEVER | + +-------------+--------------------------------+ + | 122 | UNPAIR | + +-------------+--------------------------------+ + | 123 | VOTING_POWER | + +-------------+--------------------------------+ + | 124 | TOTAL_VOTING_POWER | + +-------------+--------------------------------+ + | 125 | KECCAK | + +-------------+--------------------------------+ + | 126 | SHA3 | + +-------------+--------------------------------+ + | 127 | PAIRING_CHECK | + +-------------+--------------------------------+ + | 128 | bls12_381_g1 | + +-------------+--------------------------------+ + | 129 | bls12_381_g2 | + +-------------+--------------------------------+ + | 130 | bls12_381_fr | + +-------------+--------------------------------+ + | 131 | sapling_state | + +-------------+--------------------------------+ + | 132 | sapling_transaction_deprecated | + +-------------+--------------------------------+ + | 133 | SAPLING_EMPTY_STATE | + +-------------+--------------------------------+ + | 134 | SAPLING_VERIFY_UPDATE | + +-------------+--------------------------------+ + | 135 | ticket | + +-------------+--------------------------------+ + | 136 | TICKET_DEPRECATED | + +-------------+--------------------------------+ + | 137 | READ_TICKET | + +-------------+--------------------------------+ + | 138 | SPLIT_TICKET | + +-------------+--------------------------------+ + | 139 | JOIN_TICKETS | + +-------------+--------------------------------+ + | 140 | GET_AND_UPDATE | + +-------------+--------------------------------+ + | 141 | chest | + +-------------+--------------------------------+ + | 142 | chest_key | + +-------------+--------------------------------+ + | 143 | OPEN_CHEST | + +-------------+--------------------------------+ + | 144 | VIEW | + +-------------+--------------------------------+ + | 145 | view | + +-------------+--------------------------------+ + | 146 | constant | + +-------------+--------------------------------+ + | 147 | SUB_MUTEZ | + +-------------+--------------------------------+ + | 148 | tx_rollup_l2_address | + +-------------+--------------------------------+ + | 149 | MIN_BLOCK_TIME | + +-------------+--------------------------------+ + | 150 | sapling_transaction | + +-------------+--------------------------------+ + | 151 | EMIT | + +-------------+--------------------------------+ + | 152 | Lambda_rec | + +-------------+--------------------------------+ + | 153 | LAMBDA_REC | + +-------------+--------------------------------+ + | 154 | TICKET | + +-------------+--------------------------------+ + | 155 | BYTES | + +-------------+--------------------------------+ + | 156 | NAT | + +-------------+--------------------------------+ + + + micheline.016-PtMumbai.michelson_v1.expression (Determined from data, 8-bit tag) + ******************************************************************************** + + Int (tag 0) + =========== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | int | Determined from data | $Z.t | + +------+----------------------+------------------------+ + + + String (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | string | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Sequence (tag 2) + ================ + + +-----------------------+----------+-------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------+ + | Unnamed field 0 | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------+ + + + Prim__no_args__no_annots (tag 3) + ================================ + + +------+--------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+--------+-------------------------------------------------------------------------------------------+ + + + Prim__no_args__some_annots (tag 4) + ================================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__no_annots (tag 5) + ============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__1_arg__some_annots (tag 6) + ================================ + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__no_annots (tag 7) + =============================== + + +------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +======+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__2_args__some_annots (tag 8) + ================================= + + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg1 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | arg2 | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------------------+-------------------------------------------------------------------------------------------+ + + + Prim__generic (tag 9) + ===================== + + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+===========================================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see 016-PtMumbai.michelson.v1.primitives) | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | args | Variable | sequence of $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + | annots | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------------------------+ + + + Bytes (tag 10) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | bytes | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.contract_id (22 bytes, 8-bit tag) + ********************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + X_13 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +----------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+-------------------------------------------------+ + | contents | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ty | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +----------+----------------------+-------------------------------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------------------+-------------------------------------------------+ + + + X_8 + *** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_9 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | Determined from data | $X_13 | + +-----------------+----------------------+----------+ + + + X_16 (1 byte, 8-bit tag) + ************************ + + Public (tag 0) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Private (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Fee (tag 2) + =========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_14 + **** + + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_2 | + +-----------------+----------------------+----------+ + | Unnamed field 1 | 1 byte | $X_16 | + +-----------------+----------------------+----------+ + + + X_17 + **** + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | level | 4 bytes | signed 32-bit integer | + +------------------+----------+------------------------+ + | index | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | commitment | 48 bytes | bytes | + +------------------+----------+------------------------+ + | commitment_proof | 48 bytes | bytes | + +------------------+----------+------------------------+ + + + X_18 + **** + + +-------+----------+------------------+ + | Name | Size | Contents | + +=======+==========+==================+ + | alice | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + | bob | 21 bytes | $public_key_hash | + +-------+----------+------------------+ + + + X_20 + **** + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | published_level | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + | slot_index | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | page_index | 2 bytes | signed 16-bit integer | + +-----------------+---------+------------------------+ + + + X_21 (Determined from data, 8-bit tag) + ************************************** + + raw data proof (tag 0) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 2 bytes | unsigned 16-bit integer | + +-----------------------+----------+-------------------------+ + | raw_data | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + metadata proof (tag 1) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + dal page proof (tag 2) + ====================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | dal_page_id | 7 bytes | $X_20 | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | dal_proof | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + X_22 (Determined from data, 8-bit tag) + ************************************** + + inbox proof (tag 0) + =================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | message_counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | serialized_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + reveal proof (tag 1) + ==================== + + +--------------+----------------------+------------------------+ + | Name | Size | Contents | + +==============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------+----------------------+------------------------+ + | reveal_proof | Determined from data | $X_21 | + +--------------+----------------------+------------------------+ + + + first input (tag 2) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_23 + **** + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | ? presence of field "state" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | state | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------+ + | tick | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + X_24 (Determined from data, 8-bit tag) + ************************************** + + Dissection (tag 0) + ================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_23 | + +-----------------------+----------+-------------------------+ + + + Proof (tag 1) + ============= + + +-----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +===================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------------+----------------------+-------------------------------------+ + | pvm_step | Variable | bytes | + +-----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "input_proof" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------------+----------------------+-------------------------------------+ + | input_proof | Determined from data | $X_22 | + +-----------------------------------+----------------------+-------------------------------------+ + + + X_19 + **** + + +--------+----------------------+----------+ + | Name | Size | Contents | + +========+======================+==========+ + | choice | Determined from data | $N.t | + +--------+----------------------+----------+ + | step | Determined from data | $X_24 | + +--------+----------------------+----------+ + + + X_25 + **** + + +------------------+----------+-----------------------+ + | Name | Size | Contents | + +==================+==========+=======================+ + | compressed_state | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------+----------+-----------------------+ + | predecessor | 32 bytes | bytes | + +------------------+----------+-----------------------+ + | number_of_ticks | 8 bytes | signed 64-bit integer | + +------------------+----------+-----------------------+ + + + X_27 (Enumeration: unsigned 8-bit integer): + ******************************************* + + +-------------+----------------+ + | Case number | Encoded string | + +=============+================+ + | 0 | arith | + +-------------+----------------+ + | 1 | wasm_2_0_0 | + +-------------+----------------+ + + + X_29 (Determined from data, 8-bit tag) + ************************************** + + case 0 (tag 0) + ============== + + +-----------------+--------+------------------------+ + | Name | Size | Contents | + +=================+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + | Unnamed field 0 | 1 byte | unsigned 8-bit integer | + +-----------------+--------+------------------------+ + + + case 1 (tag 1) + ============== + + +-----------------+---------+-------------------------+ + | Name | Size | Contents | + +=================+=========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+-------------------------+ + | Unnamed field 0 | 2 bytes | unsigned 16-bit integer | + +-----------------+---------+-------------------------+ + + + case 2 (tag 2) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+------------------------+ + + + case 3 (tag 3) + ============== + + +-----------------+---------+------------------------+ + | Name | Size | Contents | + +=================+=========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+---------+------------------------+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+------------------------+ + + + X_28 + **** + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | amount | Determined from data | $X_29 | + +-----------------------+----------------------+---------------------------+ + | claimer | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + + + X_30 + **** + + +-------------+----------------------+------------------+ + | Name | Size | Contents | + +=============+======================+==================+ + | sender | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------+ + | destination | 20 bytes | bytes | + +-------------+----------------------+------------------+ + | ticket_hash | 32 bytes | bytes | + +-------------+----------------------+------------------+ + | amount | Determined from data | $X_29 | + +-------------+----------------------+------------------+ + + + X_32 (Determined from data, 8-bit tag) + ************************************** + + Batch (tag 0) + ============= + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | batch | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Deposit (tag 1) + =============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | deposit | Determined from data | $X_30 | + +---------+----------------------+------------------------+ + + + X_33 + **** + + +--------------------+----------+----------+ + | Name | Size | Contents | + +====================+==========+==========+ + | context_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + | withdraw_list_hash | 32 bytes | bytes | + +--------------------+----------+----------+ + + + X_35 (Determined from data, 8-bit tag) + ************************************** + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Commitment_hash | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + X_34 + **** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | messages | Variable | sequence of bytes | + +-----------------------+----------------------+-------------------------+ + | predecessor | Determined from data | $X_35 | + +-----------------------+----------------------+-------------------------+ + | inbox_merkle_root | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + + + public_key (Determined from data, 8-bit tag) + ******************************************** + + Ed25519 (tag 0) + =============== + + +--------------------+----------+------------------------+ + | Name | Size | Contents | + +====================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+------------------------+ + | Ed25519.Public_key | 32 bytes | bytes | + +--------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Secp256k1.Public_key | 33 bytes | bytes | + +----------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | P256.Public_key | 33 bytes | bytes | + +-----------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | Bls12_381.Public_key | 48 bytes | bytes | + +----------------------+----------+------------------------+ + + + 016-PtMumbai.contract_id.originated (22 bytes, 8-bit tag) + ********************************************************* + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + 016-PtMumbai.scripted.contracts + ******************************* + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | code | Variable | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | storage | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.entrypoint (Determined from data, 8-bit tag) + ********************************************************* + + default (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + root (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + do (tag 2) + ========== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + set_delegate (tag 3) + ==================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + remove_delegate (tag 4) + ======================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + deposit (tag 5) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + named (tag 255) + =============== + + +-----------------------+----------+------------------------+ + | Name | Size | Contents | + +=======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | # bytes in next field | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+------------------------+ + + + X_36 + **** + + +-----------------------+----------------------+--------------------------+ + | Name | Size | Contents | + +=======================+======================+==========================+ + | entrypoint | Determined from data | $016-PtMumbai.entrypoint | + +-----------------------+----------------------+--------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+--------------------------+ + + + X_37 + **** + + +-----------------+-----------+----------+ + | Name | Size | Contents | + +=================+===========+==========+ + | Unnamed field 0 | 100 bytes | bytes | + +-----------------+-----------+----------+ + | Unnamed field 1 | 100 bytes | bytes | + +-----------------+-----------+----------+ + + + 016-PtMumbai.inlined.preendorsement.contents (43 bytes, 8-bit tag) + ****************************************************************** + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.preendorsement + *********************************** + + +------------+----------+-----------------------------------------------+ + | Name | Size | Contents | + +============+==========+===============================================+ + | branch | 32 bytes | bytes | + +------------+----------+-----------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.preendorsement.contents | + +------------+----------+-----------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+-----------------------------------------------+ + + + fitness.elem + ************ + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.block_header.alpha.full_header + ******************************************* + + +---------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +=======================================+==========+=====================================+ + | level | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proto | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | predecessor | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | timestamp | 8 bytes | signed 64-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | validation_pass | 1 byte | unsigned 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | operations_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | # bytes in field "fitness" | 4 bytes | unsigned 30-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | fitness | Variable | sequence of $fitness.elem | + +---------------------------------------+----------+-------------------------------------+ + | context | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | payload_round | 4 bytes | signed 32-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | proof_of_work_nonce | 8 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | ? presence of field "seed_nonce_hash" | 1 byte | boolean (0 for false, 255 for true) | + +---------------------------------------+----------+-------------------------------------+ + | seed_nonce_hash | 32 bytes | bytes | + +---------------------------------------+----------+-------------------------------------+ + | liquidity_baking_toggle_vote | 1 byte | signed 8-bit integer | + +---------------------------------------+----------+-------------------------------------+ + | signature | Variable | bytes | + +---------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.inlined.endorsement_mempool.contents (43 bytes, 8-bit tag) + *********************************************************************** + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + 016-PtMumbai.inlined.endorsement + ******************************** + + +------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +============+==========+====================================================+ + | branch | 32 bytes | bytes | + +------------+----------+----------------------------------------------------+ + | operations | 43 bytes | $016-PtMumbai.inlined.endorsement_mempool.contents | + +------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +------------+----------+----------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.contents (Determined from data, 8-bit tag) + *********************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_37 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + + + 016-PtMumbai.bond_id (21 bytes, 8-bit tag) + ****************************************** + + Tx_rollup_bond_id (tag 0) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Sc_rollup_bond_id (tag 1) + ========================= + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | sc_rollup | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + X_48 (Determined from data, 8-bit tag) + ************************************** + + Contract (tag 0) + ================ + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + + + Block_fees (tag 2) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Deposits (tag 4) + ================ + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + + + Nonce_revelation_rewards (tag 5) + ================================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_evidence_rewards (tag 6) + ======================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Endorsing_rewards (tag 7) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_rewards (tag 8) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Baking_bonuses (tag 9) + ====================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Storage_fees (tag 11) + ===================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Double_signing_punishments (tag 12) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Lost_endorsing_rewards (tag 13) + =============================== + + +---------------+----------+-------------------------------------+ + | Name | Size | Contents | + +===============+==========+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+-------------------------------------+ + | participation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + | revelation | 1 byte | boolean (0 for false, 255 for true) | + +---------------+----------+-------------------------------------+ + + + Liquidity_baking_subsidies (tag 14) + =================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Burned (tag 15) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Commitments (tag 16) + ==================== + + +-----------+----------+------------------------+ + | Name | Size | Contents | + +===========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------+------------------------+ + | committer | 20 bytes | bytes | + +-----------+----------+------------------------+ + + + Bootstrap (tag 17) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Invoice (tag 18) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Initial_commitments (tag 19) + ============================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Minted (tag 20) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Frozen_bonds (tag 21) + ===================== + + +----------+----------+---------------------------+ + | Name | Size | Contents | + +==========+==========+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+---------------------------+ + | contract | 22 bytes | $016-PtMumbai.contract_id | + +----------+----------+---------------------------+ + | bond_id | 21 bytes | $016-PtMumbai.bond_id | + +----------+----------+---------------------------+ + + + Tx_rollup_rejection_rewards (tag 22) + ==================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Tx_rollup_rejection_punishments (tag 23) + ======================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_punishments (tag 24) + ========================================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Sc_rollup_refutation_rewards (tag 25) + ===================================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_49 (1 byte, 8-bit tag) + ************************ + + Block_application (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Protocol_migration (tag 1) + ========================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Subsidy (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Simulation (tag 3) + ================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_47 + **** + + +-----------------+----------------------+-----------------------+ + | Name | Size | Contents | + +=================+======================+=======================+ + | Unnamed field 0 | Determined from data | $X_48 | + +-----------------+----------------------+-----------------------+ + | change | 8 bytes | signed 64-bit integer | + +-----------------+----------------------+-----------------------+ + | origin | 1 byte | $X_49 | + +-----------------+----------------------+-----------------------+ + + + X_50 + **** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_update (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.event (Determined from data, 8-bit tag) + ********************************************************************************************** + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + + + sapling.transaction.ciphertext + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | cv | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | epk | 32 bytes | bytes | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | payload_enc | Variable | bytes | + +-----------------------+----------+-------------------------+ + | nonce_enc | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + | payload_out | 80 bytes | bytes | + +-----------------------+----------+-------------------------+ + | nonce_out | 24 bytes | bytes | + +-----------------------+----------+-------------------------+ + + + X_66 + **** + + +-----------------+----------------------+---------------------------------+ + | Name | Size | Contents | + +=================+======================+=================================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------------------+---------------------------------+ + | Unnamed field 1 | Determined from data | $sapling.transaction.ciphertext | + +-----------------+----------------------+---------------------------------+ + + + X_65 + **** + + +-----------------------------+----------+-------------------------+ + | Name | Size | Contents | + +=============================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | commitments_and_ciphertexts | Variable | sequence of $X_66 | + +-----------------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------------+----------+-------------------------+ + | nullifiers | Variable | sequence of bytes | + +-----------------------------+----------+-------------------------+ + + + X_71 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_65 | + +---------+----------------------+------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +---------+----------------------+------------------------+ + | Name | Size | Contents | + +=========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------+----------------------+------------------------+ + | source | Determined from data | $Z.t | + +---------+----------------------+------------------------+ + | updates | Determined from data | $X_65 | + +---------+----------------------+------------------------+ + + + alloc (tag 3) + ============= + + +-----------+----------------------+-------------------------+ + | Name | Size | Contents | + +===========+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------+----------------------+-------------------------+ + | updates | Determined from data | $X_65 | + +-----------+----------------------+-------------------------+ + | memo_size | 2 bytes | unsigned 16-bit integer | + +-----------+----------------------+-------------------------+ + + + X_72 + **** + + +-----------------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=================================================+ + | key_hash | 32 bytes | bytes | + +-----------------------------+----------------------+-------------------------------------------------+ + | key | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + | ? presence of field "value" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------------------+ + | value | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------------+----------------------+-------------------------------------------------+ + + + X_83 (Determined from data, 8-bit tag) + ************************************** + + update (tag 0) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------+-------------------------+ + + + remove (tag 1) + ============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + copy (tag 2) + ============ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | Determined from data | $Z.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------------------+-------------------------+ + + + alloc (tag 3) + ============= + + +-----------------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+=================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------------------------------+ + | updates | Variable | sequence of $X_72 | + +-----------------------+----------------------+-------------------------------------------------+ + | key_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + | value_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-----------------------+----------------------+-------------------------------------------------+ + + + X_84 (Determined from data, 8-bit tag) + ************************************** + + big_map (tag 0) + =============== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_83 | + +------+----------------------+------------------------+ + + + sapling_state (tag 1) + ===================== + + +------+----------------------+------------------------+ + | Name | Size | Contents | + +======+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+----------------------+------------------------+ + | id | Determined from data | $Z.t | + +------+----------------------+------------------------+ + | diff | Determined from data | $X_71 | + +------+----------------------+------------------------+ + + + 016-PtMumbai.lazy_storage_diff + ****************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_84 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.origination (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + 016-PtMumbai.transaction_destination (22 bytes, 8-bit tag) + ********************************************************** + + Implicit (tag 0) + ================ + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Signature.Public_key_hash | 21 bytes | $public_key_hash | + +---------------------------+----------+------------------------+ + + + Originated (tag 1) + ================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Contract_hash | 20 bytes | bytes | + +---------------+----------+------------------------+ + | padding | 1 byte | padding | + +---------------+----------+------------------------+ + + + Tx_rollup (tag 2) + ================= + + +-------------+----------+------------------------+ + | Name | Size | Contents | + +=============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------+------------------------+ + | Rollup_hash | 20 bytes | bytes | + +-------------+----------+------------------------+ + | padding | 1 byte | padding | + +-------------+----------+------------------------+ + + + Sc_rollup (tag 3) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Sc_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + Zk_rollup (tag 4) + ================= + + +----------------+----------+------------------------+ + | Name | Size | Contents | + +================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------+----------+------------------------+ + | Zk_rollup_hash | 20 bytes | bytes | + +----------------+----------+------------------------+ + | padding | 1 byte | padding | + +----------------+----------+------------------------+ + + + X_111 + ***** + + +--------------+----------------------+-------------------------------------------------+ + | Name | Size | Contents | + +==============+======================+=================================================+ + | ticketer | 22 bytes | $016-PtMumbai.contract_id | + +--------------+----------------------+-------------------------------------------------+ + | content_type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + | content | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------+----------------------+-------------------------------------------------+ + + + X_114 + ***** + + +---------+----------------------+---------------------------------------+ + | Name | Size | Contents | + +=========+======================+=======================================+ + | account | 22 bytes | $016-PtMumbai.transaction_destination | + +---------+----------------------+---------------------------------------+ + | amount | Determined from data | $Z.t | + +---------+----------------------+---------------------------------------+ + + + X_110 + ***** + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | ticket_token | Determined from data | $X_111 | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | updates | Variable | sequence of $X_114 | + +-----------------------+----------------------+-------------------------+ + + + X_147 (Determined from data, 8-bit tag) + *************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_receipt | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_receipt | Variable | sequence of $X_110 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.internal_operation_result.transaction (Determined from data, 8-bit tag) + **************************************************************************************************** + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_147 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_147 | + +------------------------------+----------------------+-------------------------------------+ + + + 016-PtMumbai.apply_internal_results.alpha.operation_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + transaction (tag 1) + =================== + + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.transaction_destination | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.transaction | + +----------------------------------+----------------------+---------------------------------------------------------------------+ + + + origination (tag 2) + =================== + + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------+----------------------+---------------------------------------------------------------------+ + + + delegation (tag 3) + ================== + + +--------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +================================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------+----------------------+---------------------------------------------------------------+ + + + event (tag 4) + ============= + + +-------------------------------+----------------------+---------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+======================+===============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | source | 22 bytes | $016-PtMumbai.contract_id | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | nonce | 2 bytes | unsigned 16-bit integer | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | type | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "tag" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | tag | Determined from data | $016-PtMumbai.entrypoint | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | ? presence of field "payload" | 1 byte | boolean (0 for false, 255 for true) | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | payload | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +-------------------------------+----------------------+---------------------------------------------------------------+ + | result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +-------------------------------+----------------------+---------------------------------------------------------------+ + + + X_46 + **** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_update | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_192 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_zk_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_335 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.zk_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_476 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.event | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_610 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_recover_bond | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message (Determined from data, 8-bit tag) + **************************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_750 + ***** + + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=================================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_execute_outbox_message | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+ + + + X_906 (1 byte, 8-bit tag) + ************************* + + Conflict_resolved (tag 0) + ========================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Timeout (tag 1) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_907 (Determined from data, 8-bit tag) + *************************************** + + Loser (tag 0) + ============= + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | reason | 1 byte | $X_906 | + +--------+----------+------------------------+ + | player | 21 bytes | $public_key_hash | + +--------+----------+------------------------+ + + + Draw (tag 1) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_908 (Determined from data, 8-bit tag) + *************************************** + + Ongoing (tag 0) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Ended (tag 1) + ============= + + +--------+----------------------+------------------------+ + | Name | Size | Contents | + +========+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------------------+------------------------+ + | result | Determined from data | $X_907 | + +--------+----------------------+------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | game_status | Determined from data | $X_908 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | game_status | Determined from data | $X_908 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_901 + ***** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_timeout | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish (Determined from data, 8-bit tag) + ************************************************************************************************* + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | staked_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | published_at_level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1200 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_publish | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement (Determined from data, 8-bit tag) + ************************************************************************************************ + + Applied (tag 0) + =============== + + +-------------------+----------------------+------------------------+ + | Name | Size | Contents | + +===================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------+----------------------+------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-------------------+----------------------+------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +-------------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------------------+ + | inbox_level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------------------+ + + + X_1340 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_cement | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate (Determined from data, 8-bit tag) + *************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | address | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | genesis_commitment_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_1610 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.sc_rollup_originate | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment (Determined from data, 8-bit tag) + *********************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2186 + ****** + + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+============================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_remove_commitment | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+----------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch (Determined from data, 8-bit tag) + ****************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2748 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_submit_batch | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination (Determined from data, 8-bit tag) + ***************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | originated_rollup | 20 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_2888 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.tx_rollup_origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.register_global_constant (Determined from data, 8-bit tag) + ******************************************************************************************************** + + Applied (tag 0) + =============== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + | global_address | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------------------+ + + + X_3436 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.register_global_constant | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3710 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.internal_operation_result.origination | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_3933 (Determined from data, 8-bit tag) + **************************************** + + To_contract (tag 0) + =================== + + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+==================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "storage" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage | Determined from data | $micheline.016-PtMumbai.michelson_v1.expression | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | originated_contracts | Variable | sequence of $016-PtMumbai.contract_id.originated | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | storage_size | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | paid_storage_size_diff | Determined from data | $Z.t | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | ? presence of field "lazy_storage_diff" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + | lazy_storage_diff | Determined from data | $016-PtMumbai.lazy_storage_diff | + +--------------------------------------------------------------------------+----------------------+--------------------------------------------------+ + + + To_tx_rollup (tag 1) + ==================== + + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | ticket_hash | 32 bytes | bytes | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + | paid_storage_size_diff | Determined from data | $N.t | + +--------------------------------------------------------------------------+----------------------+-------------------------+ + + + To_sc_rollup (tag 2) + ==================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | consumed_milligas | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | ticket_updates | Variable | sequence of $X_110 | + +-----------------------+----------------------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_result.transaction (Determined from data, 8-bit tag) + ******************************************************************************************* + + Applied (tag 0) + =============== + + +-----------------+----------------------+------------------------+ + | Name | Size | Contents | + +=================+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------------------+------------------------+ + | Unnamed field 0 | Determined from data | $X_3933 | + +-----------------+----------------------+------------------------+ + + + Failed (tag 1) + ============== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | errors | Variable | sequence of $X_2 | + +-----------------------+----------+-------------------------+ + + + Skipped (tag 2) + =============== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Backtracked (tag 3) + =================== + + +------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------------------+ + | ? presence of field "errors" | 1 byte | boolean (0 for false, 255 for true) | + +------------------------------+----------------------+-------------------------------------+ + | errors | Determined from data | $X_50 | + +------------------------------+----------------------+-------------------------------------+ + | Unnamed field 0 | Determined from data | $X_3933 | + +------------------------------+----------------------+-------------------------------------+ + + + X_3891 + ****** + + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+======================+=========================================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | operation_result | Determined from data | $016-PtMumbai.operation.alpha.operation_result.transaction | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + | internal_operation_results | Variable | sequence of $016-PtMumbai.apply_internal_results.alpha.operation_result | + +--------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------+ + + + X_4235 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | endorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4239 + ****** + + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+==============================================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | preendorsement_power | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +--------------------------------------------------------------------------+----------+--------------------------------------------------------------+ + + + X_4243 + ****** + + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | Name | Size | Contents | + +==========================================================================+==========+=====================================+ + | # bytes in field "016-PtMumbai.operation_metadata.alpha.balance_updates" | 4 bytes | unsigned 30-bit integer | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | balance_updates | Variable | sequence of $X_47 | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + | allocated_destination_contract | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------------------------------------------------+----------+-------------------------------------+ + + + 016-PtMumbai.operation_metadata.alpha.balance_updates + ***************************************************** + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_47 | + +-----------------------+----------+-------------------------+ + + + 016-PtMumbai.operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag) + ******************************************************************************************** + + Seed_nonce_revelation (tag 1) + ============================= + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | nonce | 32 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | pkh | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | secret | 20 bytes | bytes | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +-----------------------+----------------------+--------------------------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+----------------------+--------------------------------------------------------+ + | Name | Size | Contents | + +==========+======================+========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------------------+--------------------------------------------------------+ + | solution | 200 bytes | $X_37 | + +----------+----------------------+--------------------------------------------------------+ + | metadata | Determined from data | $016-PtMumbai.operation_metadata.alpha.balance_updates | + +----------+----------------------+--------------------------------------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_4243 | + +---------------+----------------------+------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4239 | + +--------------------+----------------------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +====================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------------------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------------------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_4235 | + +--------------------+----------------------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + | metadata | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3891 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_3710 | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_476 | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_3436 | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_476 | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2888 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_2748 | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2186 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_2186 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_610 | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_46 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | metadata | Determined from data | $X_750 | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | metadata | Determined from data | $X_1610 | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_476 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1340 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_1200 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + | metadata | Determined from data | $X_901 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_901 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_750 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_610 | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_476 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | metadata | Determined from data | $X_335 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + | metadata | Determined from data | $X_192 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + | metadata | Determined from data | $X_46 | + +---------------+----------------------+------------------------+ + + + X_4266 (Variable, 8-bit tag) + **************************** + + Operation_with_metadata (tag 0) + =============================== + + +-----------------------+----------+-------------------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.operation_contents_and_result | + +-----------------------+----------+-------------------------------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+-------------------------------------------------------------------------+ + + + Operation_without_metadata (tag 1) + ================================== + + +-----------------------+----------+----------------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+====================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------------+ + | contents | Variable | sequence of $016-PtMumbai.operation.alpha.contents | + +-----------------------+----------+----------------------------------------------------+ + | signature | Variable | bytes | + +-----------------------+----------+----------------------------------------------------+ + + + bls_signature_prefix (33 bytes, 8-bit tag) + ****************************************** + + Bls_prefix (tag 3) + ================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+------------------------+ + + + 016-PtMumbai.operation.alpha.contents_or_signature_prefix (Determined from data, 8-bit tag) + ******************************************************************************************* + + Seed_nonce_revelation (tag 1) + ============================= + + +-------+----------+------------------------+ + | Name | Size | Contents | + +=======+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------+----------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------+----------+------------------------+ + | nonce | 32 bytes | bytes | + +-------+----------+------------------------+ + + + Double_endorsement_evidence (tag 2) + =================================== + + +-----------------------+----------+-----------------------------------+ + | Name | Size | Contents | + +=======================+==========+===================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-----------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.endorsement | + +-----------------------+----------+-----------------------------------+ + + + Double_baking_evidence (tag 3) + ============================== + + +-----------------------+----------+----------------------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh1 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+----------------------------------------------+ + | bh2 | Variable | $016-PtMumbai.block_header.alpha.full_header | + +-----------------------+----------+----------------------------------------------+ + + + Activate_account (tag 4) + ======================== + + +--------+----------+------------------------+ + | Name | Size | Contents | + +========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------+----------+------------------------+ + | pkh | 20 bytes | bytes | + +--------+----------+------------------------+ + | secret | 20 bytes | bytes | + +--------+----------+------------------------+ + + + Proposals (tag 5) + ================= + + +-----------------------+----------+------------------------------+ + | Name | Size | Contents | + +=======================+==========+==============================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------+------------------------------+ + | period | 4 bytes | signed 32-bit integer | + +-----------------------+----------+------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+------------------------------+ + | proposals | Variable | sequence of at most 20 bytes | + +-----------------------+----------+------------------------------+ + + + Ballot (tag 6) + ============== + + +----------+----------+------------------------+ + | Name | Size | Contents | + +==========+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+----------+------------------------+ + | source | 21 bytes | $public_key_hash | + +----------+----------+------------------------+ + | period | 4 bytes | signed 32-bit integer | + +----------+----------+------------------------+ + | proposal | 32 bytes | bytes | + +----------+----------+------------------------+ + | ballot | 1 byte | signed 8-bit integer | + +----------+----------+------------------------+ + + + Double_preendorsement_evidence (tag 7) + ====================================== + + +-----------------------+----------+--------------------------------------+ + | Name | Size | Contents | + +=======================+==========+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op1 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+--------------------------------------+ + | op2 | Variable | $016-PtMumbai.inlined.preendorsement | + +-----------------------+----------+--------------------------------------+ + + + Vdf_revelation (tag 8) + ====================== + + +----------+-----------+------------------------+ + | Name | Size | Contents | + +==========+===========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------+-----------+------------------------+ + | solution | 200 bytes | $X_37 | + +----------+-----------+------------------------+ + + + Drain_delegate (tag 9) + ====================== + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | consensus_key | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | delegate | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + | destination | 21 bytes | $public_key_hash | + +---------------+----------+------------------------+ + + + Failing_noop (tag 17) + ===================== + + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | arbitrary | Variable | bytes | + +-----------------------+----------+-------------------------+ + + + Preendorsement (tag 20) + ======================= + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Endorsement (tag 21) + ==================== + + +--------------------+----------+-------------------------+ + | Name | Size | Contents | + +====================+==========+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------+----------+-------------------------+ + | slot | 2 bytes | unsigned 16-bit integer | + +--------------------+----------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | round | 4 bytes | signed 32-bit integer | + +--------------------+----------+-------------------------+ + | block_payload_hash | 32 bytes | bytes | + +--------------------+----------+-------------------------+ + + + Dal_attestation (tag 22) + ======================== + + +-------------+----------------------+------------------------+ + | Name | Size | Contents | + +=============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------+----------------------+------------------------+ + | attestor | 21 bytes | $public_key_hash | + +-------------+----------------------+------------------------+ + | attestation | Determined from data | $Z.t | + +-------------+----------------------+------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-------------+----------------------+------------------------+ + + + Reveal (tag 107) + ================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | public_key | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Transaction (tag 108) + ===================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | amount | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "parameters" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | parameters | Determined from data | $X_36 | + +----------------------------------+----------------------+-------------------------------------+ + + + Origination (tag 109) + ===================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | balance | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | script | Determined from data | $016-PtMumbai.scripted.contracts | + +--------------------------------+----------------------+-------------------------------------+ + + + Delegation (tag 110) + ==================== + + +--------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +--------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +--------------------------------+----------------------+-------------------------------------+ + | ? presence of field "delegate" | 1 byte | boolean (0 for false, 255 for true) | + +--------------------------------+----------------------+-------------------------------------+ + | delegate | 21 bytes | $public_key_hash | + +--------------------------------+----------------------+-------------------------------------+ + + + Register_global_constant (tag 111) + ================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | value | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Set_deposits_limit (tag 112) + ============================ + + +-----------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +=============================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + | ? presence of field "limit" | 1 byte | boolean (0 for false, 255 for true) | + +-----------------------------+----------------------+-------------------------------------+ + | limit | Determined from data | $N.t | + +-----------------------------+----------------------+-------------------------------------+ + + + Increase_paid_storage (tag 113) + =============================== + + +---------------+----------------------+--------------------------------------+ + | Name | Size | Contents | + +===============+======================+======================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+--------------------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+--------------------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+--------------------------------------+ + | amount | Determined from data | $Z.t | + +---------------+----------------------+--------------------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id.originated | + +---------------+----------------------+--------------------------------------+ + + + Update_consensus_key (tag 114) + ============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | pk | Determined from data | $public_key | + +---------------+----------------------+------------------------+ + + + Tx_rollup_origination (tag 150) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + + + Tx_rollup_submit_batch (tag 151) + ================================ + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | content | Variable | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "burn_limit" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | burn_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + + + Tx_rollup_commit (tag 152) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | Determined from data | $X_34 | + +---------------+----------------------+------------------------+ + + + Tx_rollup_return_bond (tag 153) + =============================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_finalize_commitment (tag 154) + ======================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_remove_commitment (tag 155) + ===================================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Tx_rollup_rejection (tag 156) + ============================= + + +------------------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +==============================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +------------------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | level | 4 bytes | signed 32-bit integer | + +------------------------------+----------------------+-------------------------+ + | message | Determined from data | $X_32 | + +------------------------------+----------------------+-------------------------+ + | message_position | Determined from data | $N.t | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | message_result_hash | 32 bytes | bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | previous_message_result | 64 bytes | $X_33 | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | previous_message_result_path | Variable | sequence of bytes | + +------------------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +------------------------------+----------------------+-------------------------+ + | proof | Variable | bytes | + +------------------------------+----------------------+-------------------------+ + + + Tx_rollup_dispatch_tickets (tag 157) + ==================================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tx_rollup | 20 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | level | 4 bytes | signed 32-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | context_hash | 32 bytes | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_index | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | message_result_path | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | tickets_info | Variable | sequence of $X_28 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Transfer_ticket (tag 158) + ========================= + + +-----------------------+----------------------+---------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+---------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+---------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_contents | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | ticket_ty | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + | ticket_ticketer | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | ticket_amount | Determined from data | $N.t | + +-----------------------+----------------------+---------------------------+ + | destination | 22 bytes | $016-PtMumbai.contract_id | + +-----------------------+----------------------+---------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+---------------------------+ + | entrypoint | Variable | bytes | + +-----------------------+----------------------+---------------------------+ + + + Sc_rollup_originate (tag 200) + ============================= + + +-----------------------+----------------------+-----------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+===========================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-----------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-----------------------------------------------------------+ + | pvm_kind | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_27) | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | kernel | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | origination_proof | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-----------------------------------------------------------+ + | parameters_ty | Variable | bytes | + +-----------------------+----------------------+-----------------------------------------------------------+ + + + Sc_rollup_add_messages (tag 201) + ================================ + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | message | Variable | sequence of $X_2 | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_cement (tag 202) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 32 bytes | bytes | + +---------------+----------------------+------------------------+ + + + Sc_rollup_publish (tag 203) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | commitment | 76 bytes | $X_25 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_refute (tag 204) + ========================== + + +----------------------------------+----------------------+-------------------------------------+ + | Name | Size | Contents | + +==================================+======================+=====================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------------------+----------------------+-------------------------------------+ + | source | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | fee | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | counter | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | gas_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | storage_limit | Determined from data | $N.t | + +----------------------------------+----------------------+-------------------------------------+ + | rollup | 20 bytes | bytes | + +----------------------------------+----------------------+-------------------------------------+ + | opponent | 21 bytes | $public_key_hash | + +----------------------------------+----------------------+-------------------------------------+ + | ? presence of field "refutation" | 1 byte | boolean (0 for false, 255 for true) | + +----------------------------------+----------------------+-------------------------------------+ + | refutation | Determined from data | $X_19 | + +----------------------------------+----------------------+-------------------------------------+ + + + Sc_rollup_timeout (tag 205) + =========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | stakers | 42 bytes | $X_18 | + +---------------+----------------------+------------------------+ + + + Sc_rollup_execute_outbox_message (tag 206) + ========================================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | cemented_commitment | 32 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | output_proof | Variable | bytes | + +-----------------------+----------------------+-------------------------+ + + + Sc_rollup_recover_bond (tag 207) + ================================ + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | staker | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + + + Dal_publish_slot_header (tag 230) + ================================= + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | slot_header | 101 bytes | $X_17 | + +---------------+----------------------+------------------------+ + + + Zk_rollup_origination (tag 250) + =============================== + + +-----------------------+----------------------+--------------------------------------------------------------+ + | Name | Size | Contents | + +=======================+======================+==============================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+--------------------------------------------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | public_parameters | Variable | bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | circuits_info | Variable | sequence of $X_14 | + +-----------------------+----------------------+--------------------------------------------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+--------------------------------------------------------------+ + | init_state | Variable | sequence of bytes | + +-----------------------+----------------------+--------------------------------------------------------------+ + | nb_ops | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 | + +-----------------------+----------------------+--------------------------------------------------------------+ + + + Zk_rollup_publish (tag 251) + =========================== + + +-----------------------+----------------------+-------------------------+ + | Name | Size | Contents | + +=======================+======================+=========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------------+----------------------+-------------------------+ + | source | 21 bytes | $public_key_hash | + +-----------------------+----------------------+-------------------------+ + | fee | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | counter | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | gas_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | storage_limit | Determined from data | $N.t | + +-----------------------+----------------------+-------------------------+ + | zk_rollup | 20 bytes | bytes | + +-----------------------+----------------------+-------------------------+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------------------+-------------------------+ + | op | Variable | sequence of $X_8 | + +-----------------------+----------------------+-------------------------+ + + + Zk_rollup_update (tag 252) + ========================== + + +---------------+----------------------+------------------------+ + | Name | Size | Contents | + +===============+======================+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------------------+------------------------+ + | source | 21 bytes | $public_key_hash | + +---------------+----------------------+------------------------+ + | fee | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | counter | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | gas_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | storage_limit | Determined from data | $N.t | + +---------------+----------------------+------------------------+ + | zk_rollup | 20 bytes | bytes | + +---------------+----------------------+------------------------+ + | update | Determined from data | $X_0 | + +---------------+----------------------+------------------------+ + + + Signature_prefix (tag 255) + ========================== + + +------------------+----------+------------------------+ + | Name | Size | Contents | + +==================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------------------+----------+------------------------+ + | signature_prefix | 33 bytes | $bls_signature_prefix | + +------------------+----------+------------------------+ + + + X_4343 (Variable, 8-bit tag) + **************************** + + Operation with too large metadata (tag 0) + ========================================= + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation without metadata (tag 1) + ================================== + + +-------------------------------+----------+------------------------------------------------------------------------+ + | Name | Size | Contents | + +===============================+==========+========================================================================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------------+----------+------------------------------------------------------------------------+ + | contents_and_signature_prefix | Variable | sequence of $016-PtMumbai.operation.alpha.contents_or_signature_prefix | + +-------------------------------+----------+------------------------------------------------------------------------+ + | signature_suffix | 64 bytes | bytes | + +-------------------------------+----------+------------------------------------------------------------------------+ + + + Operation with metadata (tag 2) + =============================== + + +-----------------+----------+------------------------+ + | Name | Size | Contents | + +=================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-----------------+----------+------------------------+ + | Unnamed field 0 | Variable | $X_4266 | + +-----------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--operations_metadata_hash : + +**GET ../<block_id>/operations_metadata_hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--operations_metadata_hashdescr', 'GET_..--block_id--operations_metadata_hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations_metadata_hashoutput.json', 'GET_..--block_id--operations_metadata_hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--operations_metadata_hashoutput.bin', 'GET_..--block_id--operations_metadata_hash')">Binary output</button> + </div><div id="GET_..--block_id--operations_metadata_hashdescr" class="GET_..--block_id--operations_metadata_hash tabcontent"> + <p> + The root hash of the operations metadata from the block. This is only set on blocks starting from environment V1.</p> + </div> + <div id="GET_..--block_id--operations_metadata_hashoutput.json" class="GET_..--block_id--operations_metadata_hash tabcontent"> + <pre> + $unistring + /* A list of list of operation metadata (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--operations_metadata_hashoutput.bin" class="GET_..--block_id--operations_metadata_hash tabcontent"> + <pre> + +-----------------------------------+----------+----------+ + | Name | Size | Contents | + +===================================+==========+==========+ + | Operation_metadata_list_list_hash | 32 bytes | bytes | + +-----------------------------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--protocols : + +**GET ../<block_id>/protocols** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--protocolsdescr', 'GET_..--block_id--protocols')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--protocolsoutput.json', 'GET_..--block_id--protocols')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--protocolsoutput.bin', 'GET_..--block_id--protocols')">Binary output</button> + </div><div id="GET_..--block_id--protocolsdescr" class="GET_..--block_id--protocols tabcontent"> + <p> + Current and next protocol.</p> + </div> + <div id="GET_..--block_id--protocolsoutput.json" class="GET_..--block_id--protocols tabcontent"> + <pre> + { "protocol": $Protocol_hash, + "next_protocol": $Protocol_hash } + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--protocolsoutput.bin" class="GET_..--block_id--protocols tabcontent"> + <pre> + +---------------+----------+----------+ + | Name | Size | Contents | + +===============+==========+==========+ + | protocol | 32 bytes | bytes | + +---------------+----------+----------+ + | next_protocol | 32 bytes | bytes | + +---------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--resulting_context_hash : + +**GET ../<block_id>/resulting_context_hash** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashdescr', 'GET_..--block_id--resulting_context_hash')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.json', 'GET_..--block_id--resulting_context_hash')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--resulting_context_hashoutput.bin', 'GET_..--block_id--resulting_context_hash')">Binary output</button> + </div><div id="GET_..--block_id--resulting_context_hashdescr" class="GET_..--block_id--resulting_context_hash tabcontent"> + <p> + Context hash resulting of the block application.</p> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.json" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + $unistring + /* A hash of context (Base58Check-encoded) */ + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--resulting_context_hashoutput.bin" class="GET_..--block_id--resulting_context_hash tabcontent"> + <pre> + +--------------+----------+----------+ + | Name | Size | Contents | + +==============+==========+==========+ + | Context_hash | 32 bytes | bytes | + +--------------+----------+----------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--votes--ballot_list : + +**GET ../<block_id>/votes/ballot_list** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--ballot_listdescr', 'GET_..--block_id--votes--ballot_list')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--ballot_listoutput.json', 'GET_..--block_id--votes--ballot_list')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--ballot_listoutput.bin', 'GET_..--block_id--votes--ballot_list')">Binary output</button> + </div><div id="GET_..--block_id--votes--ballot_listdescr" class="GET_..--block_id--votes--ballot_list tabcontent"> + <p> + Ballots casted so far during a voting period.</p> + </div> + <div id="GET_..--block_id--votes--ballot_listoutput.json" class="GET_..--block_id--votes--ballot_list tabcontent"> + <pre> + [ { "pkh": $Signature.Public_key_hash, + "ballot": "nay" | "yay" | "pass" } ... ] + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--votes--ballot_listoutput.bin" class="GET_..--block_id--votes--ballot_list tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_0 + *** + + +--------+----------+----------------------+ + | Name | Size | Contents | + +========+==========+======================+ + | pkh | 21 bytes | $public_key_hash | + +--------+----------+----------------------+ + | ballot | 1 byte | signed 8-bit integer | + +--------+----------+----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--ballots : + +**GET ../<block_id>/votes/ballots** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--ballotsdescr', 'GET_..--block_id--votes--ballots')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--ballotsoutput.json', 'GET_..--block_id--votes--ballots')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--ballotsoutput.bin', 'GET_..--block_id--votes--ballots')">Binary output</button> + </div><div id="GET_..--block_id--votes--ballotsdescr" class="GET_..--block_id--votes--ballots tabcontent"> + <p> + Sum of ballots casted so far during a voting period.</p> + </div> + <div id="GET_..--block_id--votes--ballotsoutput.json" class="GET_..--block_id--votes--ballots tabcontent"> + <pre> + { "yay": $int64, + "nay": $int64, + "pass": $int64 } + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string</pre> + </div> + <div id="GET_..--block_id--votes--ballotsoutput.bin" class="GET_..--block_id--votes--ballots tabcontent"> + <pre> + +------+---------+-----------------------+ + | Name | Size | Contents | + +======+=========+=======================+ + | yay | 8 bytes | signed 64-bit integer | + +------+---------+-----------------------+ + | nay | 8 bytes | signed 64-bit integer | + +------+---------+-----------------------+ + | pass | 8 bytes | signed 64-bit integer | + +------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--votes--current_period : + +**GET ../<block_id>/votes/current_period** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--current_perioddescr', 'GET_..--block_id--votes--current_period')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_periodoutput.json', 'GET_..--block_id--votes--current_period')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_periodoutput.bin', 'GET_..--block_id--votes--current_period')">Binary output</button> + </div><div id="GET_..--block_id--votes--current_perioddescr" class="GET_..--block_id--votes--current_period tabcontent"> + <p> + Returns the voting period (index, kind, starting position) and related information (position, remaining) of the interrogated block.</p> + </div> + <div id="GET_..--block_id--votes--current_periodoutput.json" class="GET_..--block_id--votes--current_period tabcontent"> + <pre> + { "voting_period": + { /* The voting period to which the block belongs. */ + "index": + integer ∈ [-2^31-1, 2^31] + /* The voting period's index. Starts at 0 with the first block of + the Alpha family of protocols. */, + "kind": + /* One of the several kinds of periods in the voting procedure. */ + "proposal" + || "exploration" + || "cooldown" + || "promotion" + || "adoption", + "start_position": + integer ∈ [-2^31-1, 2^31] + /* The relative position of the first level of the period with + respect to the first level of the Alpha family of protocols. */ }, + "position": + integer ∈ [-2^31-1, 2^31] + /* The position of the block within the voting period. */, + "remaining": + integer ∈ [-2^31-1, 2^31] + /* The number of blocks remaining till the end of the voting period. */ }</pre> + </div> + <div id="GET_..--block_id--votes--current_periodoutput.bin" class="GET_..--block_id--votes--current_period tabcontent"> + <pre> + +---------------+---------+-----------------------+ + | Name | Size | Contents | + +===============+=========+=======================+ + | voting_period | 9 bytes | $X_0 | + +---------------+---------+-----------------------+ + | position | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + | remaining | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + + + X_1 (1 byte, 8-bit tag) + *********************** + + Proposal (tag 0) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + exploration (tag 1) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Cooldown (tag 2) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Promotion (tag 3) + ================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Adoption (tag 4) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_0 + *** + + +----------------+---------+-----------------------+ + | Name | Size | Contents | + +================+=========+=======================+ + | index | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + | kind | 1 byte | $X_1 | + +----------------+---------+-----------------------+ + | start_position | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--current_proposal : + +**GET ../<block_id>/votes/current_proposal** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--current_proposaldescr', 'GET_..--block_id--votes--current_proposal')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_proposaloutput.json', 'GET_..--block_id--votes--current_proposal')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_proposaloutput.bin', 'GET_..--block_id--votes--current_proposal')">Binary output</button> + </div><div id="GET_..--block_id--votes--current_proposaldescr" class="GET_..--block_id--votes--current_proposal tabcontent"> + <p> + Current proposal under evaluation.</p> + </div> + <div id="GET_..--block_id--votes--current_proposaloutput.json" class="GET_..--block_id--votes--current_proposal tabcontent"> + <pre> + $Protocol_hash /* Some */ || null /* None */ + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--votes--current_proposaloutput.bin" class="GET_..--block_id--votes--current_proposal tabcontent"> + <pre> + +-----------------+----------------------+----------+ + | Name | Size | Contents | + +=================+======================+==========+ + | Unnamed field 0 | Determined from data | $X_0 | + +-----------------+----------------------+----------+ + + + X_0 (Determined from data, 8-bit tag) + ************************************* + + None (tag 0) + ============ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Some (tag 1) + ============ + + +---------------+----------+------------------------+ + | Name | Size | Contents | + +===============+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------+----------+------------------------+ + | Protocol_hash | 32 bytes | bytes | + +---------------+----------+------------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--current_quorum : + +**GET ../<block_id>/votes/current_quorum** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--current_quorumdescr', 'GET_..--block_id--votes--current_quorum')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_quorumoutput.json', 'GET_..--block_id--votes--current_quorum')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--current_quorumoutput.bin', 'GET_..--block_id--votes--current_quorum')">Binary output</button> + </div><div id="GET_..--block_id--votes--current_quorumdescr" class="GET_..--block_id--votes--current_quorum tabcontent"> + <p> + Current expected quorum.</p> + </div> + <div id="GET_..--block_id--votes--current_quorumoutput.json" class="GET_..--block_id--votes--current_quorum tabcontent"> + <pre> + integer ∈ [-2^31-1, 2^31]</pre> + </div> + <div id="GET_..--block_id--votes--current_quorumoutput.bin" class="GET_..--block_id--votes--current_quorum tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 4 bytes | signed 32-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + +.. _GET_..--block_id--votes--listings : + +**GET ../<block_id>/votes/listings** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--listingsdescr', 'GET_..--block_id--votes--listings')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--listingsoutput.json', 'GET_..--block_id--votes--listings')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--listingsoutput.bin', 'GET_..--block_id--votes--listings')">Binary output</button> + </div><div id="GET_..--block_id--votes--listingsdescr" class="GET_..--block_id--votes--listings tabcontent"> + <p> + List of delegates with their voting power.</p> + </div> + <div id="GET_..--block_id--votes--listingsoutput.json" class="GET_..--block_id--votes--listings tabcontent"> + <pre> + [ { "pkh": $Signature.Public_key_hash, + "voting_power": $int64 } ... ] + $Signature.Public_key_hash: + /* A Ed25519, Secp256k1, P256, or BLS public key hash + (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--votes--listingsoutput.bin" class="GET_..--block_id--votes--listings tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + public_key_hash (21 bytes, 8-bit tag) + ************************************* + + Ed25519 (tag 0) + =============== + + +-------------------------+----------+------------------------+ + | Name | Size | Contents | + +=========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +-------------------------+----------+------------------------+ + | Ed25519.Public_key_hash | 20 bytes | bytes | + +-------------------------+----------+------------------------+ + + + Secp256k1 (tag 1) + ================= + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Secp256k1.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + P256 (tag 2) + ============ + + +----------------------+----------+------------------------+ + | Name | Size | Contents | + +======================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +----------------------+----------+------------------------+ + | P256.Public_key_hash | 20 bytes | bytes | + +----------------------+----------+------------------------+ + + + Bls (tag 3) + =========== + + +---------------------------+----------+------------------------+ + | Name | Size | Contents | + +===========================+==========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +---------------------------+----------+------------------------+ + | Bls12_381.Public_key_hash | 20 bytes | bytes | + +---------------------------+----------+------------------------+ + + + X_0 + *** + + +--------------+----------+-----------------------+ + | Name | Size | Contents | + +==============+==========+=======================+ + | pkh | 21 bytes | $public_key_hash | + +--------------+----------+-----------------------+ + | voting_power | 8 bytes | signed 64-bit integer | + +--------------+----------+-----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--proposals : + +**GET ../<block_id>/votes/proposals** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--proposalsdescr', 'GET_..--block_id--votes--proposals')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--proposalsoutput.json', 'GET_..--block_id--votes--proposals')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--proposalsoutput.bin', 'GET_..--block_id--votes--proposals')">Binary output</button> + </div><div id="GET_..--block_id--votes--proposalsdescr" class="GET_..--block_id--votes--proposals tabcontent"> + <p> + List of proposals with number of supporters.</p> + </div> + <div id="GET_..--block_id--votes--proposalsoutput.json" class="GET_..--block_id--votes--proposals tabcontent"> + <pre> + [ [ $Protocol_hash, $int64 ] ... ] + $Protocol_hash: + /* A Tezos protocol ID (Base58Check-encoded) */ + $unistring + $int64: + /* 64 bit integers + Decimal representation of 64 bit integers */ + string + $unistring: + /* Universal string representation + Either a plain UTF8 string, or a sequence of bytes for strings that + contain invalid byte sequences. */ + string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }</pre> + </div> + <div id="GET_..--block_id--votes--proposalsoutput.bin" class="GET_..--block_id--votes--proposals tabcontent"> + <pre> + +-----------------------+----------+-------------------------+ + | Name | Size | Contents | + +=======================+==========+=========================+ + | # bytes in next field | 4 bytes | unsigned 30-bit integer | + +-----------------------+----------+-------------------------+ + | Unnamed field 0 | Variable | sequence of $X_0 | + +-----------------------+----------+-------------------------+ + + + X_0 + *** + + +-----------------+----------+-----------------------+ + | Name | Size | Contents | + +=================+==========+=======================+ + | Unnamed field 0 | 32 bytes | bytes | + +-----------------+----------+-----------------------+ + | Unnamed field 1 | 8 bytes | signed 64-bit integer | + +-----------------+----------+-----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--successor_period : + +**GET ../<block_id>/votes/successor_period** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--successor_perioddescr', 'GET_..--block_id--votes--successor_period')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--successor_periodoutput.json', 'GET_..--block_id--votes--successor_period')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--successor_periodoutput.bin', 'GET_..--block_id--votes--successor_period')">Binary output</button> + </div><div id="GET_..--block_id--votes--successor_perioddescr" class="GET_..--block_id--votes--successor_period tabcontent"> + <p> + Returns the voting period (index, kind, starting position) and related information (position, remaining) of the next block.Useful to craft operations that will be valid in the next block.</p> + </div> + <div id="GET_..--block_id--votes--successor_periodoutput.json" class="GET_..--block_id--votes--successor_period tabcontent"> + <pre> + { "voting_period": + { /* The voting period to which the block belongs. */ + "index": + integer ∈ [-2^31-1, 2^31] + /* The voting period's index. Starts at 0 with the first block of + the Alpha family of protocols. */, + "kind": + /* One of the several kinds of periods in the voting procedure. */ + "proposal" + || "exploration" + || "cooldown" + || "promotion" + || "adoption", + "start_position": + integer ∈ [-2^31-1, 2^31] + /* The relative position of the first level of the period with + respect to the first level of the Alpha family of protocols. */ }, + "position": + integer ∈ [-2^31-1, 2^31] + /* The position of the block within the voting period. */, + "remaining": + integer ∈ [-2^31-1, 2^31] + /* The number of blocks remaining till the end of the voting period. */ }</pre> + </div> + <div id="GET_..--block_id--votes--successor_periodoutput.bin" class="GET_..--block_id--votes--successor_period tabcontent"> + <pre> + +---------------+---------+-----------------------+ + | Name | Size | Contents | + +===============+=========+=======================+ + | voting_period | 9 bytes | $X_0 | + +---------------+---------+-----------------------+ + | position | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + | remaining | 4 bytes | signed 32-bit integer | + +---------------+---------+-----------------------+ + + + X_1 (1 byte, 8-bit tag) + *********************** + + Proposal (tag 0) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + exploration (tag 1) + =================== + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Cooldown (tag 2) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Promotion (tag 3) + ================= + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + Adoption (tag 4) + ================ + + +------+--------+------------------------+ + | Name | Size | Contents | + +======+========+========================+ + | Tag | 1 byte | unsigned 8-bit integer | + +------+--------+------------------------+ + + + X_0 + *** + + +----------------+---------+-----------------------+ + | Name | Size | Contents | + +================+=========+=======================+ + | index | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + | kind | 1 byte | $X_1 | + +----------------+---------+-----------------------+ + | start_position | 4 bytes | signed 32-bit integer | + +----------------+---------+-----------------------+ + + </pre> + </div> + + + +.. _GET_..--block_id--votes--total_voting_power : + +**GET ../<block_id>/votes/total_voting_power** + +.. raw:: html + + <div class="tab"><button class="tablinks defaultOpen" onclick="showTab(this, 'GET_..--block_id--votes--total_voting_powerdescr', 'GET_..--block_id--votes--total_voting_power')">Description</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--total_voting_poweroutput.json', 'GET_..--block_id--votes--total_voting_power')">Json output</button> + <button class="tablinks" onclick="showTab(this, 'GET_..--block_id--votes--total_voting_poweroutput.bin', 'GET_..--block_id--votes--total_voting_power')">Binary output</button> + </div><div id="GET_..--block_id--votes--total_voting_powerdescr" class="GET_..--block_id--votes--total_voting_power tabcontent"> + <p> + Total voting power in the voting listings.</p> + </div> + <div id="GET_..--block_id--votes--total_voting_poweroutput.json" class="GET_..--block_id--votes--total_voting_power tabcontent"> + <pre> + string + /* 64 bit integers + Decimal representation of 64 bit integers */</pre> + </div> + <div id="GET_..--block_id--votes--total_voting_poweroutput.bin" class="GET_..--block_id--votes--total_voting_power tabcontent"> + <pre> + +-----------------+---------+-----------------------+ + | Name | Size | Contents | + +=================+=========+=======================+ + | Unnamed field 0 | 8 bytes | signed 64-bit integer | + +-----------------+---------+-----------------------+ + + + </pre> + </div> + + + + -- GitLab From d59aab49622f15fe6f8a743a87d2a2b048950331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Fri, 9 Dec 2022 17:15:05 +0000 Subject: [PATCH 15/18] Doc: De-duplicate references for Mumbai docs --- docs/mumbai/smart_rollups.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/mumbai/smart_rollups.rst b/docs/mumbai/smart_rollups.rst index 00c3a4dc3bbb..b6187d22df75 100644 --- a/docs/mumbai/smart_rollups.rst +++ b/docs/mumbai/smart_rollups.rst @@ -101,7 +101,7 @@ rollups inbox: first, she can inject the dedicated layer-1 operation using the Octez client (see command ``send sc rollup message <messages> from <src>``) ; second, she can use the batcher of a smart rollup node. More details can be found -:ref:`sending_external_inbox_message`. +:ref:`sending_external_inbox_message_mumbai`. Internal messages """"""""""""""""" @@ -131,7 +131,7 @@ A rollup can do the following requests through the reveal data channel: #. **preimage requests** The rollup can request a page, that is 4kB of data, provided that it knows a (blake2b) hash of this sequence of bytes. The request is fulfilled by the rollup node - :ref:`populating_the_reveal_channel`. + :ref:`populating_the_reveal_channel_mumbai`. #. **metadata requests** The rollup can request information from the protocol, namely the address and the origination level of the @@ -205,7 +205,7 @@ removal of the invalid commitment. If no one posts such a concurrent commitment during the refutation period, the commitment can be cemented with a dedicated operation injected in layer-1, and the outbox messages can be executed by the layer-1 by an explicit layer-1 -operation (see :ref:`triggering_execution_outbox_message`), typically +operation (see :ref:`triggering_execution_outbox_message_mumbai`), typically to transfer assets from the rollup to the layer-1. Refutation @@ -493,22 +493,22 @@ Second, the configured rollup node can be run: The log should show that the rollup node follows the layer-1 chain and processes the inbox of each level. -.. _sending_external_inbox_message: +.. _sending_external_inbox_message_mumbai: Sending an external inbox message ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _sending_internal_inbox_message: +.. _sending_internal_inbox_message_mumbai: Sending an internal inbox message ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _triggering_execution_outbox_message: +.. _triggering_execution_outbox_message_mumbai: Triggering the execution of an outbox message ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _populating_the_reveal_channel: +.. _populating_the_reveal_channel_mumbai: Populating the reveal channel ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- GitLab From 94bd391e1b7f8a9fdac1c5557a9fff94e09e02ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Tue, 13 Dec 2022 10:30:26 +0000 Subject: [PATCH 16/18] Test: disable flaky synchronisation heuristics tests --- .gitlab/ci/jobs/test/tezt.yml | 2 ++ tezt/tests/synchronisation_heuristic.ml | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitlab/ci/jobs/test/tezt.yml b/.gitlab/ci/jobs/test/tezt.yml index f10f5cddb60e..1afd9f021fcd 100644 --- a/.gitlab/ci/jobs/test/tezt.yml +++ b/.gitlab/ci/jobs/test/tezt.yml @@ -28,6 +28,8 @@ tezt: - .integration_template - .template__coverage_files - .tezt_template + variables: + TESTS: "/synchronisation_threshold" # WARNING: if you increase the number of parallel jobs, you need to # update test_coverage.yml with the new list of jobs. parallel: 30 diff --git a/tezt/tests/synchronisation_heuristic.ml b/tezt/tests/synchronisation_heuristic.ml index 4a32702d8763..f70492dffe9e 100644 --- a/tezt/tests/synchronisation_heuristic.ml +++ b/tezt/tests/synchronisation_heuristic.ml @@ -71,7 +71,7 @@ let check_node_synchronization_state = Protocol.register_test ~__FILE__ ~title:"check synchronization state" - ~tags:["bootstrap"; "node"; "sync"] + ~tags:["synchronisation_threshold"; "bootstrap"; "node"; "sync"] @@ fun protocol -> let* main_node = Node.init ~name:"main_node" [] in let* nodes = @@ -156,7 +156,7 @@ let check_prevalidator_start = Protocol.register_test ~__FILE__ ~title:"Check prevalidator start" - ~tags:["bootstrap"; "node"; "prevalidator"] + ~tags:["synchronisation_threshold"; "bootstrap"; "node"; "prevalidator"] @@ fun protocol -> let init_node threshold = Node.init [Synchronisation_threshold threshold] in let* node1 = init_node 0 in @@ -215,7 +215,7 @@ let test_threshold_zero = Protocol.register_test ~__FILE__ ~title:"bootstrap: test threshold zero" - ~tags:["bootstrap"; "threshold"] + ~tags:["synchronisation_threshold"; "bootstrap"; "threshold"] @@ fun protocol -> Log.info "Setup network" ; let* node, client = @@ -287,7 +287,7 @@ let test_threshold_two = Protocol.register_test ~__FILE__ ~title:"bootstrap: test threshold two" - ~tags:["bootstrap"; "threshold"] + ~tags:["synchronisation_threshold"; "bootstrap"; "threshold"] @@ fun protocol -> Log.info "Add a first peer with threshold zero" ; let* node, client = @@ -353,7 +353,7 @@ let test_threshold_stuck = Protocol.register_test ~__FILE__ ~title:"bootstrap: test threshold stuck" - ~tags:["bootstrap"; "threshold"] + ~tags:["synchronisation_threshold"; "bootstrap"; "threshold"] @@ fun protocol -> let sync_latency = 3 in @@ -414,7 +414,7 @@ let test_threshold_split_view = Protocol.register_test ~__FILE__ ~title:"bootstrap: test threshold split view" - ~tags:["bootstrap"; "threshold"] + ~tags:["synchronisation_threshold"; "bootstrap"; "threshold"] @@ fun protocol -> Log.info "Add two peers with threshold zero, and one with threshold 2 and a high \ @@ -480,7 +480,7 @@ let test_many_nodes_bootstrap = Protocol.register_test ~__FILE__ ~title:"bootstrap: many nodes bootstrap" - ~tags:["bootstrap"; "threshold"] + ~tags:["synchronisation_threshold"; "bootstrap"; "threshold"] @@ fun protocol -> let num_nodes = 8 in let running_time = 10.0 in -- GitLab From 4b2f842469925cae36f5f1d357c3ec0bfc1639ec Mon Sep 17 00:00:00 2001 From: Pierre Boutillier <pierre.boutillier@nomadic-labs.com> Date: Thu, 15 Dec 2022 12:49:11 +0000 Subject: [PATCH 17/18] Test: Fix Mumbai daemon name --- tests_python/tools/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests_python/tools/constants.py b/tests_python/tools/constants.py index e44b37839d05..bae5fe9f49f2 100644 --- a/tests_python/tools/constants.py +++ b/tests_python/tools/constants.py @@ -100,7 +100,7 @@ LIMA_FOLDER = "proto_015_PtLimaPt" LIMA_PARAMETERS = get_parameters(LIMA_FOLDER) MUMBAI = "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD" -MUMBAI_DAEMON = "016-PtMumbai" +MUMBAI_DAEMON = "PtMumbai" MUMBAI_FOLDER = "proto_016_PtMumbai" MUMBAI_PARAMETERS = get_parameters(MUMBAI_FOLDER) -- GitLab From 27e6ce7b927b23346e044cba849d8a9ac2e8d1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= <ole.kruger@trili.tech> Date: Thu, 15 Dec 2022 14:27:15 +0000 Subject: [PATCH 18/18] Doc: Back port merge request 7097 --- docs/alpha/consensus.rst | 24 ++++++++++++------------ docs/alpha/liquidity_baking.rst | 4 ++-- docs/alpha/proof_of_stake.rst | 4 ++-- docs/alpha/randomness_generation.rst | 4 ++-- docs/mumbai/consensus.rst | 22 +++++++++++----------- docs/mumbai/liquidity_baking.rst | 4 ++-- docs/mumbai/proof_of_stake.rst | 4 ++-- docs/mumbai/randomness_generation.rst | 4 ++-- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/alpha/consensus.rst b/docs/alpha/consensus.rst index 7dbc919a1bf1..795c312eaa5e 100644 --- a/docs/alpha/consensus.rst +++ b/docs/alpha/consensus.rst @@ -331,7 +331,7 @@ CONSENSUS_COMMITTEE_SIZE * active_stake / total_active_stake``). Regarding the concrete values for rewards, we first fix the total reward per level, call it ``total_rewards``, to ``80 / blocks_per_minute`` tez. -Assuming ``blocks_per_minute = 2``, ``total_rewards`` is 40 tez. +Assuming ``blocks_per_minute = 4``, ``total_rewards`` is 20 tez. We define: - ``BAKING_REWARD_FIXED_PORTION := baking_reward_ratio * total_rewards`` @@ -343,16 +343,16 @@ where: - ``baking_reward_ratio`` to ``1 / 4``, - ``bonus_ratio`` to ``1 / 3``. -Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 10`` tez, -(maximum) ``bonus = 10`` tez, and ``endorsing_rewards = 20`` tez. +Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 5`` tez, +(maximum) ``bonus = 5`` tez, and ``endorsing_rewards = 10`` tez. The bonus per additional endorsement slot is in turn ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` (because there are at most ``CONSENSUS_COMMITTEE_SIZE / 3`` validator slots corresponding to the additional endorsements included in a block). The rewards per endorsement slot are ``endorsing_rewards / CONSENSUS_COMMITTEE_SIZE``. Assuming ``CONSENSUS_COMMITTEE_SIZE = 7000``, we obtain a bonus per slot of -``10 / (7000 / 3) = 0.004286`` tez and an endorsing -rewards per slot of ``20 / 7000 = 0.002857`` tez. +``5 / (7000 / 3) = 0.002143`` tez and an endorsing +rewards per slot of ``10 / 7000 = 0.001428`` tez. Let's take an example. Say a block has round 1, is proposed by delegate B, and contains the payload from round 0 produced by delegate @@ -360,7 +360,7 @@ A. Also, B includes endorsements with endorsing power ``5251``. Then A receives the fees and 10 tez (the ``BAKING_REWARD_FIXED_PORTION``) as a reward for producing the block's payload. Concerning the bonus, given that ``CONSENSUS_COMMITTEE_SIZE = 7000``, the minimum required validator slots is ``4667``, and there are ``2333 = 7000 - 4667`` additional validator slots. -Therefore B receives the bonus ``(5251 - 4667) * 0.004286 = 2.503`` tez. (Note +Therefore B receives the bonus ``(5251 - 4667) * 0.002143 = 1.251512`` tez. (Note that B only included endorsements corresponding to 584 = 5251 - 4667 additional validator slots, about a quarter of the maximum 2333 extra endorsements it could have theoretically included.) Finally, consider some delegate C, whose active stake at some cycle is 5% of the total stake. Note that @@ -368,7 +368,7 @@ his expected number of validator slots for that cycle is ``5/100 * 8192 * 7000 = 2,867,200`` slots. Assume also that the endorsing power of C's endorsements included during that cycle has been ``2,123,456`` slots. Given that this number is bigger than the minimum required (``2,867,200 * 2 / 3``), it receives an endorsing -reward of ``2,867,200 * 0.002857 = 8191.59`` tez for that cycle. +reward of ``2,867,200 * 0.001428 = 4094.3616`` tez for that cycle. .. _slashing_alpha: @@ -414,9 +414,9 @@ Consensus related protocol parameters * - ``CONSENSUS_THRESHOLD`` - ``ceil(2 * CONSENSUS_COMMITTEE_SIZE / 3)`` = 4667 * - ``MINIMAL_BLOCK_DELAY`` - - 30s - * - ``DELAY_INCREMENT_PER_ROUND`` - 15s + * - ``DELAY_INCREMENT_PER_ROUND`` + - 8s * - ``MINIMAL_PARTICIPATION_RATIO`` - 2/3 * - ``FROZEN_DEPOSITS_PERCENTAGE`` @@ -428,11 +428,11 @@ Consensus related protocol parameters * - ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` - 1/2 * - ``BAKING_REWARD_FIXED_PORTION`` - - 10 tez + - 5 tez * - ``BAKING_REWARD_BONUS_PER_SLOT`` - - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.004286 tez + - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.002143 tez * - ``ENDORSING_REWARD_PER_SLOT`` - - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez + - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.001428 tez These are a subset of the :ref:`protocol constants <protocol_constants_alpha>`. diff --git a/docs/alpha/liquidity_baking.rst b/docs/alpha/liquidity_baking.rst index 19f4bd704f37..6685c0fe8c8a 100644 --- a/docs/alpha/liquidity_baking.rst +++ b/docs/alpha/liquidity_baking.rst @@ -26,7 +26,7 @@ The LIGO and Michelson code for these contracts, as well as detailed documentati Subsidy ~~~~~~~ -At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block; currently these rewards are 40 tez per block so the amount that is sent to the CPMM contract is 2.5 tez per block. +At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block of round 0 with all endorsements; currently these rewards are 20 tez per block so the amount that is sent to the CPMM contract is 1.25 tez per block. So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. @@ -60,7 +60,7 @@ For indicative purposes, if among the non-abstaining blocks a fraction reached after roughly ``2*(log(1-1/(2f)) / log(0.999))`` non-abstaining blocks, about 1386 blocks if everyone signals, 1963 blocks if 80% do, 3583 blocks if 60% do etc. Recall for comparison -that assuming two blocks per minute there are 2880 blocks per day. +that assuming four blocks per minute there are 5760 blocks per day. When producing blocks using Octez baking daemon ``octez-baker``, there are two command-line options affecting toggle vote. The diff --git a/docs/alpha/proof_of_stake.rst b/docs/alpha/proof_of_stake.rst index 450f9e9d2696..0a221815deff 100644 --- a/docs/alpha/proof_of_stake.rst +++ b/docs/alpha/proof_of_stake.rst @@ -149,13 +149,13 @@ Proof-of-stake parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_CYCLE`` - - 8192 blocks + - 16384 blocks * - ``PRESERVED_CYCLES`` - 5 cycles * - ``TOKENS_PER_ROLL`` - 6,000 ꜩ * - ``BLOCKS_PER_STAKE_SNAPSHOT`` - - 512 blocks + - 1024 blocks Further External Resources diff --git a/docs/alpha/randomness_generation.rst b/docs/alpha/randomness_generation.rst index 417c5acaa144..6e2d21933fce 100644 --- a/docs/alpha/randomness_generation.rst +++ b/docs/alpha/randomness_generation.rst @@ -150,9 +150,9 @@ Randomness generation parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_COMMITMENT`` - - 64 blocks + - 128 blocks * - ``NONCE_REVELATION_THRESHOLD`` - - 256 blocks + - 512 blocks * - ``MAX_ANON_OPS_PER_BLOCK`` - 132 revelations * - ``SEED_NONCE_REVELATION_TIP`` diff --git a/docs/mumbai/consensus.rst b/docs/mumbai/consensus.rst index f0f44f515f97..f5a2d3d6c8c6 100644 --- a/docs/mumbai/consensus.rst +++ b/docs/mumbai/consensus.rst @@ -331,7 +331,7 @@ CONSENSUS_COMMITTEE_SIZE * active_stake / total_active_stake``). Regarding the concrete values for rewards, we first fix the total reward per level, call it ``total_rewards``, to ``80 / blocks_per_minute`` tez. -Assuming ``blocks_per_minute = 2``, ``total_rewards`` is 40 tez. +Assuming ``blocks_per_minute = 4``, ``total_rewards`` is 20 tez. We define: - ``BAKING_REWARD_FIXED_PORTION := baking_reward_ratio * total_rewards`` @@ -343,16 +343,16 @@ where: - ``baking_reward_ratio`` to ``1 / 4``, - ``bonus_ratio`` to ``1 / 3``. -Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 10`` tez, -(maximum) ``bonus = 10`` tez, and ``endorsing_rewards = 20`` tez. +Thus, we obtain ``BAKING_REWARD_FIXED_PORTION = 5`` tez, +(maximum) ``bonus = 5`` tez, and ``endorsing_rewards = 10`` tez. The bonus per additional endorsement slot is in turn ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` (because there are at most ``CONSENSUS_COMMITTEE_SIZE / 3`` validator slots corresponding to the additional endorsements included in a block). The rewards per endorsement slot are ``endorsing_rewards / CONSENSUS_COMMITTEE_SIZE``. Assuming ``CONSENSUS_COMMITTEE_SIZE = 7000``, we obtain a bonus per slot of -``10 / (7000 / 3) = 0.004286`` tez and an endorsing -rewards per slot of ``20 / 7000 = 0.002857`` tez. +``5 / (7000 / 3) = 0.002143`` tez and an endorsing +rewards per slot of ``10 / 7000 = 0.001428`` tez. Let's take an example. Say a block has round 1, is proposed by delegate B, and contains the payload from round 0 produced by delegate @@ -360,7 +360,7 @@ A. Also, B includes endorsements with endorsing power ``5251``. Then A receives the fees and 10 tez (the ``BAKING_REWARD_FIXED_PORTION``) as a reward for producing the block's payload. Concerning the bonus, given that ``CONSENSUS_COMMITTEE_SIZE = 7000``, the minimum required validator slots is ``4667``, and there are ``2333 = 7000 - 4667`` additional validator slots. -Therefore B receives the bonus ``(5251 - 4667) * 0.004286 = 2.503`` tez. (Note +Therefore B receives the bonus ``(5251 - 4667) * 0.002143 = 1.251512`` tez. (Note that B only included endorsements corresponding to 584 = 5251 - 4667 additional validator slots, about a quarter of the maximum 2333 extra endorsements it could have theoretically included.) Finally, consider some delegate C, whose active stake at some cycle is 5% of the total stake. Note that @@ -414,9 +414,9 @@ Consensus related protocol parameters * - ``CONSENSUS_THRESHOLD`` - ``ceil(2 * CONSENSUS_COMMITTEE_SIZE / 3)`` = 4667 * - ``MINIMAL_BLOCK_DELAY`` - - 30s - * - ``DELAY_INCREMENT_PER_ROUND`` - 15s + * - ``DELAY_INCREMENT_PER_ROUND`` + - 8s * - ``MINIMAL_PARTICIPATION_RATIO`` - 2/3 * - ``FROZEN_DEPOSITS_PERCENTAGE`` @@ -428,11 +428,11 @@ Consensus related protocol parameters * - ``RATIO_OF_FROZEN_DEPOSITS_SLASHED_PER_DOUBLE_ENDORSEMENT`` - 1/2 * - ``BAKING_REWARD_FIXED_PORTION`` - - 10 tez + - 5 tez * - ``BAKING_REWARD_BONUS_PER_SLOT`` - - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.004286 tez + - ``bonus / (CONSENSUS_COMMITTEE_SIZE / 3)`` = 0.002143 tez * - ``ENDORSING_REWARD_PER_SLOT`` - - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.002857 tez + - ``endorsing_reward / CONSENSUS_COMMITTEE_SIZE`` = 0.001428 tez These are a subset of the :ref:`protocol constants <protocol_constants_mumbai>`. diff --git a/docs/mumbai/liquidity_baking.rst b/docs/mumbai/liquidity_baking.rst index 7665c2ae2d04..801677c4eb86 100644 --- a/docs/mumbai/liquidity_baking.rst +++ b/docs/mumbai/liquidity_baking.rst @@ -26,7 +26,7 @@ The LIGO and Michelson code for these contracts, as well as detailed documentati Subsidy ~~~~~~~ -At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block; currently these rewards are 40 tez per block so the amount that is sent to the CPMM contract is 2.5 tez per block. +At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block of round 0 with all endorsements; currently these rewards are 20 tez per block so the amount that is sent to the CPMM contract is 1.25 tez per block. So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. @@ -60,7 +60,7 @@ For indicative purposes, if among the non-abstaining blocks a fraction reached after roughly ``2*(log(1-1/(2f)) / log(0.999))`` non-abstaining blocks, about 1386 blocks if everyone signals, 1963 blocks if 80% do, 3583 blocks if 60% do etc. Recall for comparison -that assuming two blocks per minute there are 2880 blocks per day. +that assuming four blocks per minute there are 5760 blocks per day. When producing blocks using Octez baking daemon ``octez-baker``, there are two command-line options affecting toggle vote. The diff --git a/docs/mumbai/proof_of_stake.rst b/docs/mumbai/proof_of_stake.rst index f00b7fe61614..613079004f73 100644 --- a/docs/mumbai/proof_of_stake.rst +++ b/docs/mumbai/proof_of_stake.rst @@ -149,13 +149,13 @@ Proof-of-stake parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_CYCLE`` - - 8192 blocks + - 16384 blocks * - ``PRESERVED_CYCLES`` - 5 cycles * - ``TOKENS_PER_ROLL`` - 6,000 ꜩ * - ``BLOCKS_PER_STAKE_SNAPSHOT`` - - 512 blocks + - 1024 blocks Further External Resources diff --git a/docs/mumbai/randomness_generation.rst b/docs/mumbai/randomness_generation.rst index f166e32b4864..aa44b67b6879 100644 --- a/docs/mumbai/randomness_generation.rst +++ b/docs/mumbai/randomness_generation.rst @@ -150,9 +150,9 @@ Randomness generation parameters * - Parameter name - Parameter value * - ``BLOCKS_PER_COMMITMENT`` - - 64 blocks + - 128 blocks * - ``NONCE_REVELATION_THRESHOLD`` - - 256 blocks + - 512 blocks * - ``MAX_ANON_OPS_PER_BLOCK`` - 132 revelations * - ``SEED_NONCE_REVELATION_TIP`` -- GitLab